diff --git a/images/apple/ASM-TK.po b/images/apple/ASM-TK.po new file mode 100755 index 0000000..1809af8 Binary files /dev/null and b/images/apple/ASM-TK.po differ diff --git a/src/mkrel b/src/mkrel index a5d0e2d..a1672a2 100755 --- a/src/mkrel +++ b/src/mkrel @@ -152,7 +152,9 @@ cp samplesrc/fppow.pla prodos/bld/samples/FPPOW.PLA.TXT cp utilsrc/apple/mon.pla prodos/bld/samples/MON.PLA.TXT cp utilsrc/apple/zipchip.pla prodos/bld/samples/ZIPCHIP.PLA.TXT -cp libsrc/apple/dhgrlib.pla prodos/bld/DHGR.PLA.TXT +cp libsrc/apple/dhgrlib.pla prodos/bld/samples/DHGR.PLA.TXT +cp samplesrc/testrel.asm prodos/bld/samples/TESTREL.ASM.TXT +cp samplesrc/testext.asm prodos/bld/samples/TESTEXT.ASM.TXT mkdir prodos/bld/scripts cp scripts/rod.4th prodos/bld/scripts/ROD.4TH.TXT diff --git a/src/samplesrc/test.asm b/src/samplesrc/test.asm deleted file mode 100644 index 9562023..0000000 --- a/src/samplesrc/test.asm +++ /dev/null @@ -1,42 +0,0 @@ - REL - ORG $1000 -; -ESTKH EQU $C0 -ESTKL EQU $D0 -; - EXTRN PUTS - EXTRN PUTLN -; -; EXT HEADER -; - DW $6502 - DW 0 ; SYSFLAGS - DW DEFSEG ; DEF OFFSET - DW 1 ; DEF COUNT (INCLUDING INIT) - DW MODINIT ; MOD INIT - MSB ON - ASC "CMDSY" ; MOD DEPENDENCIES - MSB OFF - ASC "S" - DB 0 -; -; DATA AND 6502 CODE SEGMENT -; -MSG STR "Hello" -MSGADDR DW MSG -ASMINIT LDA MSGADDR - LDY MSGADDR+1 - DEX - STA ESTKL,X - STY ESTKH,X - JSR PUTS - JMP PUTLN -; -; BYTECODE DEFS SEGMENT -; -DEFSEG EQU * -MODINIT DB $54 ; CALL ASMINIT - DW ASMINIT - DB $2C ; CW - DW $2000 ; MODKEEP - DB $5C ; RET diff --git a/src/samplesrc/testext.asm b/src/samplesrc/testext.asm new file mode 100644 index 0000000..12f1448 --- /dev/null +++ b/src/samplesrc/testext.asm @@ -0,0 +1,86 @@ +; +; EXTENDED REL MODULE WITH DEPENDENCIES, BYTECODE SEGMENT, AND INIT +; + REL + ORG $1000 +; +; USEFUL ZERO PAGE LOCATIONS +; +SRC EQU $06 +SRCL EQU SRC +SRCH EQU SRC+1 +DST EQU SRC+2 +DSTL EQU DST +DSTH EQU DST+1 +TMP EQU $E7 +TMPL EQU TMP +TMPH EQU TMP+1 +ESTKH EQU $C0 +ESTKL EQU $D0 +DROPOP EQU $EF +NEXTOP EQU $F0 +FETCHOP EQU NEXTOP+1 +; +; JUMP TO BYTECODE INTERPRETER ADDRESS +; +INTERP EQU $03D0 +; +; EXTERNALS USED BY THIS MODULE +; + EXTRN PUTS + EXTRN PUTLN +; +; EXT HEADER +; + DW $6502 + DW 0 ; SYSFLAGS + DW DEFSEG ; DEF OFFSET + DW 1 ; DEF COUNT (INCLUDING INIT) + DW MODINIT ; MOD INIT + MSB ON + ASC "CMDSY" ; MOD DEPENDENCIES (DCI BACKWARDS HI/LO BIT FROM REL FILE) + MSB OFF + ASC "S" + DB 0 +; +; DATA AND 6502 CODE SEGMENT +; +HIMSG STR "Hello" +HELLO DEF HELLO ; CALLABLE FROM EXTERNAL MODULES + LDA #>HIMSG + LDY #BYEMSG + LDY #HIMSG + LDY #BYEMSG + LDY #1+MODFIX STA DSTL + INY LDA (SRC),Y ADC ESTKH+3,X STA DSTH - PLA + LDY #$00 + LDA (SRC),Y AND #$10 ; EXTERN REF - EXIT BNE RLDEX - TAY ; FIXUP=*ADDR+MODOFST + LDA (SRC),Y + BMI FIX16 + AND #$40 + BNE FIXMSB +FIXLSB LDA (DST),Y + CLC + ADC ESTKL+2,X + CLC + BCC FIX8 +FIXMSB LDY #$03 + LDA (SRC),Y ; FIXUPH=(ENTRY->3+MODOFSTL)+(^ADDR+MODOFSTH) + CLC + ADC ESTKL+2,X + LDY #$00 LDA (DST),Y - INY + ADC ESTKH+2,X + CLC + BCC FIX8 +FIX16 LDA (DST),Y ; FIXUP=*ADDR+MODOFST CLC ADC ESTKL+2,X STA TMPL + INY LDA (DST),Y ADC ESTKH+2,X CMP ESTKH+1,X ; FIXUP >= BYTECODE? @@ -698,7 +715,7 @@ asm reloc(modfix, modofst, bytecode, rld)#3 + STA (DST),Y ; *ADDR=FIXUP DEY LDA TMPL - STA (DST),Y +FIX8 STA (DST),Y LDA SRCL ; NEXT ENTRY ; CLC ADC #$04 diff --git a/src/vmsrc/apple/cmd.pla b/src/vmsrc/apple/cmd.pla index 33d25cc..c84d009 100755 --- a/src/vmsrc/apple/cmd.pla +++ b/src/vmsrc/apple/cmd.pla @@ -753,25 +753,42 @@ asm reloc(modfix, modofst, bytecode, rld)#3 LDY #$00 - LDA (SRC),Y BEQ RLDEX ; END OF RLD - PHA INY LDA (SRC),Y - INY CLC ADC ESTKL+3,X ; ADDR=ENTRY=>1+MODFIX STA DSTL + INY LDA (SRC),Y ADC ESTKH+3,X STA DSTH - PLA + LDY #$00 + LDA (SRC),Y AND #$10 ; EXTERN REF - EXIT BNE RLDEX - TAY ; FIXUP=*ADDR+MODOFST + LDA (SRC),Y + BMI FIX16 + AND #$40 + BNE FIXMSB +FIXLSB LDA (DST),Y + CLC + ADC ESTKL+2,X + CLC + BCC FIX8 +FIXMSB LDY #$03 + LDA (SRC),Y ; FIXUPH=(ENTRY->3+MODOFSTL)+(^ADDR+MODOFSTH) + CLC + ADC ESTKL+2,X + LDY #$00 LDA (DST),Y - INY + ADC ESTKH+2,X + CLC + BCC FIX8 +FIX16 LDA (DST),Y ; FIXUP=*ADDR+MODOFST CLC ADC ESTKL+2,X STA TMPL + INY LDA (DST),Y ADC ESTKH+2,X CMP ESTKH+1,X ; FIXUP >= BYTECODE? @@ -785,7 +802,7 @@ asm reloc(modfix, modofst, bytecode, rld)#3 + STA (DST),Y ; *ADDR=FIXUP DEY LDA TMPL - STA (DST),Y +FIX8 STA (DST),Y LDA SRCL ; NEXT ENTRY ; CLC ADC #$04 diff --git a/src/vmsrc/apple/cmdjit.pla b/src/vmsrc/apple/cmdjit.pla index 76fc232..e0e0714 100755 --- a/src/vmsrc/apple/cmdjit.pla +++ b/src/vmsrc/apple/cmdjit.pla @@ -773,25 +773,42 @@ asm reloc(modfix, modofst, bytecode, rld)#3 LDY #$00 - LDA (SRC),Y BEQ RLDEX ; END OF RLD - PHA INY LDA (SRC),Y - INY CLC ADC ESTKL+3,X ; ADDR=ENTRY=>1+MODFIX STA DSTL + INY LDA (SRC),Y ADC ESTKH+3,X STA DSTH - PLA + LDY #$00 + LDA (SRC),Y AND #$10 ; EXTERN REF - EXIT BNE RLDEX - TAY ; FIXUP=*ADDR+MODOFST + LDA (SRC),Y + BMI FIX16 + AND #$40 + BNE FIXMSB +FIXLSB LDA (DST),Y + CLC + ADC ESTKL+2,X + CLC + BCC FIX8 +FIXMSB LDY #$03 + LDA (SRC),Y ; FIXUPH=(ENTRY->3+MODOFSTL)+(^ADDR+MODOFSTH) + CLC + ADC ESTKL+2,X + LDY #$00 LDA (DST),Y - INY + ADC ESTKH+2,X + CLC + BCC FIX8 +FIX16 LDA (DST),Y ; FIXUP=*ADDR+MODOFST CLC ADC ESTKL+2,X STA TMPL + INY LDA (DST),Y ADC ESTKH+2,X CMP ESTKH+1,X ; FIXUP >= BYTECODE? @@ -805,7 +822,7 @@ asm reloc(modfix, modofst, bytecode, rld)#3 + STA (DST),Y ; *ADDR=FIXUP DEY LDA TMPL - STA (DST),Y +FIX8 STA (DST),Y LDA SRCL ; NEXT ENTRY ; CLC ADC #$04 diff --git a/src/vmsrc/apple/sossys.pla b/src/vmsrc/apple/sossys.pla index c119b07..930208b 100755 --- a/src/vmsrc/apple/sossys.pla +++ b/src/vmsrc/apple/sossys.pla @@ -731,25 +731,42 @@ asm reloc(modfix, modofst, bytecode, rld)#3 LDY #$00 - LDA (SRC),Y BEQ RLDEX ; END OF RLD - PHA INY LDA (SRC),Y - INY CLC ADC ESTKL+3,X ; ADDR=ENTRY=>1+MODFIX STA DSTL + INY LDA (SRC),Y ADC ESTKH+3,X STA DSTH - PLA + LDY #$00 + LDA (SRC),Y AND #$10 ; EXTERN REF - EXIT BNE RLDEX - TAY ; FIXUP=*ADDR+MODOFST + LDA (SRC),Y + BMI FIX16 + AND #$40 + BNE FIXMSB +FIXLSB LDA (DST),Y + CLC + ADC ESTKL+2,X + CLC + BCC FIX8 +FIXMSB LDY #$03 + LDA (SRC),Y ; FIXUPH=(ENTRY->3+MODOFSTL)+(^ADDR+MODOFSTH) + CLC + ADC ESTKL+2,X + LDY #$00 LDA (DST),Y - INY + ADC ESTKH+2,X + CLC + BCC FIX8 +FIX16 LDA (DST),Y ; FIXUP=*ADDR+MODOFST CLC ADC ESTKL+2,X STA TMPL + INY LDA (DST),Y ADC ESTKH+2,X CMP ESTKH+1,X ; FIXUP >= BYTECODE? @@ -763,7 +780,7 @@ asm reloc(modfix, modofst, bytecode, rld)#3 + STA (DST),Y ; *ADDR=FIXUP DEY LDA TMPL - STA (DST),Y +FIX8 STA (DST),Y LDA SRCL ; NEXT ENTRY ; CLC ADC #$04 diff --git a/src/vmsrc/apple/sossysjit.pla b/src/vmsrc/apple/sossysjit.pla index dae50fd..56fa331 100755 --- a/src/vmsrc/apple/sossysjit.pla +++ b/src/vmsrc/apple/sossysjit.pla @@ -742,25 +742,42 @@ asm reloc(modfix, modofst, bytecode, rld)#3 LDY #$00 - LDA (SRC),Y BEQ RLDEX ; END OF RLD - PHA INY LDA (SRC),Y - INY CLC ADC ESTKL+3,X ; ADDR=ENTRY=>1+MODFIX STA DSTL + INY LDA (SRC),Y ADC ESTKH+3,X STA DSTH - PLA + LDY #$00 + LDA (SRC),Y AND #$10 ; EXTERN REF - EXIT BNE RLDEX - TAY ; FIXUP=*ADDR+MODOFST + LDA (SRC),Y + BMI FIX16 + AND #$40 + BNE FIXMSB +FIXLSB LDA (DST),Y + CLC + ADC ESTKL+2,X + CLC + BCC FIX8 +FIXMSB LDY #$03 + LDA (SRC),Y ; FIXUPH=(ENTRY->3+MODOFSTL)+(^ADDR+MODOFSTH) + CLC + ADC ESTKL+2,X + LDY #$00 LDA (DST),Y - INY + ADC ESTKH+2,X + CLC + BCC FIX8 +FIX16 LDA (DST),Y ; FIXUP=*ADDR+MODOFST CLC ADC ESTKL+2,X STA TMPL + INY LDA (DST),Y ADC ESTKH+2,X CMP ESTKH+1,X ; FIXUP >= BYTECODE? @@ -774,7 +791,7 @@ asm reloc(modfix, modofst, bytecode, rld)#3 + STA (DST),Y ; *ADDR=FIXUP DEY LDA TMPL - STA (DST),Y +FIX8 STA (DST),Y LDA SRCL ; NEXT ENTRY ; CLC ADC #$04