Community

SCI Programming => SCI Syntax Help => Topic started by: MusicallyInspired on April 30, 2018, 10:47:48 AM

Title: Assembly code blocks
Post by: MusicallyInspired on April 30, 2018, 10:47:48 AM
Can someone help me make sense of them? Some of the scripts I decompile from Sierra games fall back to assembly for certain code blocks. I've tried taking the disassembly and comparing it to its successful decompile to try to see a similarity but I'm not getting it. I assume this can't be explained easily (because if it could SCI Companion would have decompiled correctly), but I'm wondering if I can rewrite blocks of code by hand if I understand enough of the language. Or can someone point me in the direction of something that would help more than a reply here would (if such is the case).
Title: Re: Assembly code blocks
Post by: Kawa on April 30, 2018, 12:06:36 PM
You could rewrite it by hand considering that's what Brian originally did, yeah. The trick, no matter what machine code you're targeting, is mostly in recognizing patterns. Or at least that's what I know. Patterns that the decompiler can't work out.
Title: Re: Assembly code blocks
Post by: lskovlun on April 30, 2018, 07:32:06 PM
anything in particular you're struggling with?
Title: Re: Assembly code blocks
Post by: MusicallyInspired on May 01, 2018, 11:21:33 AM
I just don't know where to begin. I don't understand the language at all. I assume assembly code blocks are a syntax? Or is it more of a summary or something?
Title: Re: Assembly code blocks
Post by: OmerMor on May 01, 2018, 04:29:58 PM
Here are some links that might help you with specific instructions:
Title: Re: Assembly code blocks
Post by: troflip on May 01, 2018, 07:01:21 PM
but I'm wondering if I can rewrite blocks of code by hand if I understand enough of the language.

Yes, you can. Omer's links are good, especially the first one, which explains all the SCI machine instructions in detail.

It's very similar to any other kind of assembly language (very low level, basically a 1-to-1 mapping of what the processor can do), but has a few fancy instructions like sends and such. So if you have a basic familiarity with any other assembly languages, and notions like registers and push/popping from a stack, it isn't too difficult to figure out (just extremely tedious).
Title: Re: Assembly code blocks
Post by: MusicallyInspired on May 03, 2018, 03:03:43 PM
Thanks, guys. Will definitely check out those links.