assemblydcpu-16

How to understand the first line of the DCPU-16 specs assembly example?


I am trying to understand the specs, but fail to understand the first line of the example given:

SET A, 0x30              ; 7c01 0030

Here is what I understood from the specs:

So I understand the instruction as SET A, 0x3C

Can anyone advise where I go wrong?


Solution

  • Ah ok from the comments I finally got my answer.

    You are missing the "Values" section from the spec, there it says:

    Values:
    ....
    0x1f: next word (literal)
    

    So we have:

    0x7c01 = 0111110000000001
    
    0001 = SET
    000000 = register A
    011111 = 1F -> next word -> [PC++]
    

    Next word is 0x0030... voilĂ .