0
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.

Dalim Oh
  • 1
  • 2

1 Answers1

0

There are some mistakes in your intermediate file and object code.

  • SIC object code uses hexadecimal addresses. So instead of 3000 address of first instruction is 0xbb8.
  • In the 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.
  • If you use RESWin 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 new T record with address of the next instruction.
  • There is a mistake at 'FO', where you add only 1 to the address instead of 2.
  • Are you using some modified SIC assembly? There are ** 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.

dec   hex      objCode   assembly -------------
3000  0x00BB8            COPY   START   3000    
3000  0x00BB8  030BD3           LDA     THREE    
3003  0x00BBB  0F0BCA           STA     ALPHA    
3006  0x00BBE  530BD6           LDCH    CHARC    
3009  0x00BC1  570BD8           STCH    C1    
3012  0x00BC4  530BDB           LDCH    CHARZ    
3015  0x00BC7  570BDE           STCH    C3    
3018  0x00BCA  00....00  ALPHA  RESW    3    
3027  0x00BD3  000003    THREE  WORD    3    
3030  0x00BD6  464F      CHARC  BYTE    C'FO'    
3032  0x00BD8  000000    C1     RESB    3    
3035  0x00BDB  454F46    CHARZ  BYTE    C'EOF'    
3038  0x00BDE  000000    C3     RESB    3    
3041  0x00BE1                   END     COPY    

And final object code:

H^COPY  ^000BB8^000029
T^000BB8^12^030BD3^0F0BCA^530BD6^570BD8^530BDB^570BDE
T^000BD3^05^000003^464F
T^000BDB^03^454F46^
E^000BB8

I assumed you are writing for extended version (SIC/XE) with simple addressing.

Kljunas2
  • 56
  • 1
  • 6