mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-28 10:52:33 +00:00
34f9969c0c
BASIC.FX: bugfix in PATH, relocation code, Added Toolbox function "printf"
69 lines
1.4 KiB
Plaintext
69 lines
1.4 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
.LIST OFF
|
||
.OP 65c02
|
||
.OR $2000
|
||
.TF BIN/test
|
||
*--------------------------------------
|
||
.MA DEBUG
|
||
:1 bit $C000
|
||
bpl :1
|
||
sta $C010
|
||
.EM
|
||
*--------------------------------------
|
||
.INB inc/bs.i
|
||
.INB inc/mon.i
|
||
*--------------------------------------
|
||
HEADER cld Allows BRUN at ORG=$2000
|
||
jmp CODE.START for debugging without relocation
|
||
.DA #0 CMDBITS0
|
||
.DA #0 CMDBITS1
|
||
.DA 0 spare
|
||
.DA CODE.END
|
||
.DA DATA.END
|
||
.DA 0
|
||
.DA 0 spare....16 bytes header
|
||
*--------------------------------------
|
||
R.MSG.HELLO .DA MSG.HELLO
|
||
R.MSG.RELOC .DA MSG.RELOC
|
||
.DA 0
|
||
*--------------------------------------
|
||
CODE.START ldx #0
|
||
|
||
.1 lda MSG.HELLO,x ABS relocation required
|
||
beq .2
|
||
|
||
jsr MON.COUT
|
||
inx
|
||
bne .1
|
||
|
||
.2 lda R.MSG.HELLO
|
||
pha
|
||
lda R.MSG.HELLO+1
|
||
pha
|
||
|
||
lda HEADER+2
|
||
pha
|
||
lda HEADER+3
|
||
pha
|
||
|
||
ldy R.MSG.RELOC
|
||
lda R.MSG.RELOC+1
|
||
ldx #GP.TBOX.PrintF
|
||
jsr GP.TBOX
|
||
|
||
.8 clc
|
||
rts
|
||
|
||
CODE.END .EQ *
|
||
*--------------------------------------
|
||
MSG.HELLO .CZ -"\r\rHello from test EXT command.\r\r"
|
||
MSG.RELOC .CS "Code relocated at $%H\r"
|
||
.CZ "Data relocated at $%H\r"
|
||
|
||
DATA.END .EQ *
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/basic.fx/test.s
|
||
ASM
|