I am currently going through QLib_run_asm trying to add comments
This is what I have for these areas
Involves FOR loops.
A2 is a pointer to the start of variables
A4 is the compiled programs position pointer
Code: Select all
; code 9E - get FOR control variable
L1888 move.w (a4)+,d2 ;get FOR variable reference
movea.l $04(a2,d2.w),a3
move.l a3,d0
btst #$1E,d0
beq.s L18A0
clr.w $0012(a3)
clr.l $0014(a3)
rts
*
L18A0 moveq #$26,d6
bra L05E8 ;reset basic user stack pointer
In the next bit, This is during setting up the new jobs data area before actually running the compiled program
A5 points at the start of the job.
I may be coming up to this bit of code soon. I am working on the sub routine at L02A4 at the moment.
I am around L02E6, where it looks like it's about to create a name table.
Code: Select all
L0400 move.w d1,-$0002(a0)
addq.l #$02,a0
move.l (a0),d1
add.l d0,d1
bset #$1E,d1
tst.b jh_base+jh_autof(a5) ;test AUTOF
beq.s L0418 ;off
; AUTOF is on
bset #$1D,d1
L0418 move.l d1,(a0)+
bra.s L03EA
L041C move.l a4,-$0008(a2)
rts
This also to do with FOR handling
Code: Select all
; code A4 - Start the FOR
L18A6 movea.w (a4)+,a0 ;get the FOR variable reference
adda.l a2,a0
move.l $0004(a0),d0
movea.l d0,a3
addq.w #$04,$0012(a3)
btst #$1D,d0
beq.s L18CE
move.w -(a5),d0
add.w -(a5),d0
add.w -(a5),d0
addq.w #$06,a5
subi.b #$09,d0
bne.s L18F8
move.w #$0203,(a0)
bra.s L18D4
L18CE move.w (a0),d0
subq.b #$02,d0
beq.s L18FC
L18D4 bsr L103E ;make sure there is an integer on the stack
move.w (a1)+,$0002(a3)
bsr L103E ;make sure there is an integer on the stack
move.w (a1)+,$0004(a3)
bsr L103E ;make sure there is an integer on the stack
move.w (a1)+,d0
move.w d0,(a3)
lea $0004(a3),a0
tst.w $0002(a3)
bpl.s L1948
bra.s L1958
L18F8 move.w #$0202,(a0)
L18FC bsr L0FE6 ;convert TOS to float
move.w (a1)+,$000A(a3)
move.l (a1)+,$0006(a3)
bsr L0FE6 ;convert TOS to float
move.w (a1)+,$000C(a3)
move.l (a1)+,$000E(a3)
bsr L0FE6 ;convert TOS to float
move.w (a1)+,d4
move.w d4,(a3)
move.l (a1)+,d5
move.l d5,$0002(a3)
move.l $000E(a3),d1
move.w $000C(a3),d0
bra.s L1974
I am mostly working on the initialisation stuff at the moment. Not really looked into the actual running of the compiled program yet.