COPY START 3000
** LDA THREE
** STA ALPHA
** LDCH CHARC
** STCH C1
** LDCH CHARZ
** STCH C3
ALPHA RESW 3
THREE WORD 3
CHARC BYTE C'FO'
C1 RESB 3
CHARZ BYTE C'EOF'
C3 RESB 3
** END **
This is the Input file I got.
And right below is the Intermediate file and its object code.
COPY START 3000
3000 ** LDA THREE
3003 ** STA ALPHA
3006 ** LDCH CHARC
3009 ** STCH C1
3012 ** LDCH CHARZ
3015 ** STCH C3
3018 ALPHA RESW 3
3027 THREE WORD 3
3030 CHARC BYTE C'FO'
3031 C1 RESB 3
3034 CHARZ BYTE C'EOF'
3035 C3 RESB 3
3038 ** END **
H^COPY^003000^003038
T^003000^37^333027^443018^533030^573031^533034^573035^000003^464f^454f46
E^003000
I thought the text length(T part) would be "35", but according to the result I got, it is "37". And I don't get this part. Could someone tell me the exact way of getting the length?
My program (which I designed) also gave me the value of 35, so this is very confusing.
There are some mistakes in your intermediate file and object code.
3000
address of first instruction is0xbb8
.H
record, program name should have length 6, so you should pad it with spaces. The second number should be length of the program, not the address of the last instruction.RESW
in assembly code, you should indicate empty space in the object code. You could either add zeroes for the entire reserved space, or (especially in case of larger reserved spaces) start a newT
record with address of the next instruction.'FO'
, where you add only 1 to the address instead of 2.**
which, I assume, indicate missing label. Also opcodes seem to be different. But otherwise, it seems to be the SIC assembly from Leeland Beck's System Software.Here is intermediate file. Every address is written in decimal and hexadecimal format. Then there is generated object code for each instruction.
And final object code:
I assumed you are writing for extended version (SIC/XE) with simple addressing.