I am playing around with the Basic68k that you can find here on this page: https://philpem.me.uk/leeedavison/68k/ehbasic/index.html at the bottom called source.zip.
In it there is a section that sets up vectors to subroutine in the code. Here is the code I am looking at.
* BASIC cold start entry point
LAB_COLD
MOVE.l #ram_base,sp * set simulator stack for this prog
MOVE.w #$4EF9,d0 * JMP opcode
MOVEA.l sp,a0 * point to start of vector table
MOVE.w d0,(a0)+ * LAB_WARM
LEA (LAB_COLD,PC),a1 * initial warm start vector
MOVE.l a1,(a0)+ * set vector
MOVE.w d0,(a0)+ * Usrjmp
LEA (LAB_FCER,PC),a1 * initial user function vector
* "Function call" error
MOVE.l a1,(a0)+ * set vector
MOVE.w d0,(a0)+ * V_INPT JMP opcode
LEA (VEC_IN,PC),a1 * get byte from input device vector
MOVE.l a1,(a0)+ * set vector
MOVE.w d0,(a0)+ * V_OUTP JMP opcode
LEA (VEC_OUT,PC),a1 * send byte to output device vector
MOVE.l a1,(a0)+ * set vector
MOVE.w d0,(a0)+ * V_LOAD JMP opcode
LEA (VEC_LD,PC),a1 * load BASIC program vector
MOVE.l a1,(a0)+ * set vector
MOVE.w d0,(a0)+ * V_SAVE JMP opcode
LEA (VEC_SV,PC),a1 * save BASIC program vector
MOVE.l a1,(a0)+ * set vector
MOVE.w d0,(a0)+ * V_CTLC JMP opcode
LEA (VEC_CC,PC),a1 * save CTRL-C check vector
MOVE.l a1,(a0)+ * set vector
MOVE.l sp,(a0) * save entry stack value
* set-up start values
I see they put the JMP opcode into D0 and then they increment through the starting address called RAM_BASE. Why is this done? Is this code from the good ole days when we didn't have a compiler to find labels and replace with the address locations? Is this a speed hack for the slower designs?
I am still learning the wonderful world of 68k Assembly language.
In it there is a section that sets up vectors to subroutine in the code. Here is the code I am looking at.
* BASIC cold start entry point
LAB_COLD
MOVE.l #ram_base,sp * set simulator stack for this prog
MOVE.w #$4EF9,d0 * JMP opcode
MOVEA.l sp,a0 * point to start of vector table
MOVE.w d0,(a0)+ * LAB_WARM
LEA (LAB_COLD,PC),a1 * initial warm start vector
MOVE.l a1,(a0)+ * set vector
MOVE.w d0,(a0)+ * Usrjmp
LEA (LAB_FCER,PC),a1 * initial user function vector
* "Function call" error
MOVE.l a1,(a0)+ * set vector
MOVE.w d0,(a0)+ * V_INPT JMP opcode
LEA (VEC_IN,PC),a1 * get byte from input device vector
MOVE.l a1,(a0)+ * set vector
MOVE.w d0,(a0)+ * V_OUTP JMP opcode
LEA (VEC_OUT,PC),a1 * send byte to output device vector
MOVE.l a1,(a0)+ * set vector
MOVE.w d0,(a0)+ * V_LOAD JMP opcode
LEA (VEC_LD,PC),a1 * load BASIC program vector
MOVE.l a1,(a0)+ * set vector
MOVE.w d0,(a0)+ * V_SAVE JMP opcode
LEA (VEC_SV,PC),a1 * save BASIC program vector
MOVE.l a1,(a0)+ * set vector
MOVE.w d0,(a0)+ * V_CTLC JMP opcode
LEA (VEC_CC,PC),a1 * save CTRL-C check vector
MOVE.l a1,(a0)+ * set vector
MOVE.l sp,(a0) * save entry stack value
* set-up start values
I see they put the JMP opcode into D0 and then they increment through the starting address called RAM_BASE. Why is this done? Is this code from the good ole days when we didn't have a compiler to find labels and replace with the address locations? Is this a speed hack for the slower designs?
I am still learning the wonderful world of 68k Assembly language.