So right now I'm trying to understand how object code is generated but thse two lines really confuse me, anyone want explain it to me?
RSUB is 4C0000, I understand RSUB is 4C Mnemonic, but where did 0000 came from?
EOF BYTE C'EOF' Object code is 454F46, how did they get that?
INPUT BYTE X'F1' F1
how did generate F1 in the object code?
STCH BUFFER, X 549039
BUFFER is 1039, and STCH in mnemonic is 54, but shouldn't it be 541039?
also after a few lines,
LDCH BUFFER, X 509039?
All of these should be answered in the instruction set reference of your architecture and the manual of your assembler.
RSUB is 4C0000, I understand RSUB is 4C Mnemonic, but where did 0000 came from?
SIC seems to use 24 bit words and a fixed length instruction encoding. Since this instruction apparently takes no operands, hence the zeroes. Maybe the cpu ignores the address field, so you could use anything you wanted, or maybe it has to be zero. Couldn't find a definite answer to that.
EOF BYTE C'EOF' Object code is 454F46, how did they get that?
45
, 4F
and 46
are just the ascii codes for E
, O
and F
, respectively. Presumably the C
operator of your assembler instructs it to emit the ascii code of the following characters.
INPUT BYTE X'F1' F1 how did generate F1 in the object code?
Presumably the X
operator of your assembler means emit the byte with the given hex value.
STCH BUFFER, X 549039 BUFFER is 1039, and STCH in mnemonic is 54, but shouldn't it be 541039?
The address is the low 15 bits only. Bit #15 is used as a flag indicating indexed addressing mode, hence 1039
becomes 9039
.