These vectors evaluate parameters to SuperBASIC procedures and functions and put them on the maths stack.
Call Parameters | Return Parameters | ||
---|---|---|---|
D0.L | Unused | D0.L | Error code. |
D1.L | Unused | D1.L | Corrupted. |
D2.L | Unused | D2.L | Corrupted. |
D3.L | Unused | D3.W | Number of parameters fetched. |
D4.L | Unused | D4.L | Corrupted. |
D6.L | Unused | D6.L | Corrupted. |
A0.L | Unused | A0.L | Corrupted. |
A1.L | Unused | A1.L | Updated pointer to maths stack |
A2.L | Unused | A2.L | Corrupted. |
A3.L | Pointer to first parameter | A3.L | Preserved. |
A5.L | Pointer to last parameter | A5.L | Preserved. |
A6.L | SuperBASIC pointer | A6.L | Could be changed. |
ERR_BP | Bad parameter. |
ERR_XP | Error in expression. |
In this example we need three integer parameters followed by two long integers.
lea 5*8(a3),a0 ; To check for 5 parameters cmpa.l a0,a5 bne bad_parm ----> ; There were not 5 parameters movea.l a5,a4 ; Keep the pointer to the end of parameters lea 3*8(a3),a5 ; Arrange to input 3 parameters movea.w CA_GTINT,a2 jsr (a2) ; Process the parameters bne bad_parm ----> ; (No need to test D0.L) subq.w #3,d3 ; Three parameters? . . bne bad_parm ----> ; . . no! movem.l (a1,a6.l),d5-7 ; Extract parameters to D5 to D7 addq.l #6,bv_rip(a6) ; Tidy the maths stack movea.l a5,a3 ; Point to the last two parameters movea.l a4,a5 ; Restore A5 movea.w CA_GTLIN,a2 jsr (a2) ; Process the remaining 2 parameters bne bad_parm ----> subq.w #2,d3 ; Two parameters? . . bne bad_parm ----> ; . . no addq.l #8,bv_rip(a6) ; Tidy the maths stack