mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-24 14:31:05 +00:00
BASIC.SYSTEM : Added EXTCMDs (wip)
This commit is contained in:
parent
4aedd7caee
commit
04e3901894
Binary file not shown.
@ -181,7 +181,7 @@ BS.ERROUT sta GP.ERRCODE
|
||||
|
||||
stz MLI.LEVEL
|
||||
stz GP.MLICF.REFNUM
|
||||
lda #MLI.C.FLUSH
|
||||
lda #MLI.FLUSH
|
||||
jsr GP.GOSYSTEM
|
||||
|
||||
L9B27 plp
|
||||
@ -276,7 +276,7 @@ BS.IO.IN.EXEC sta (ZP.BASL),y
|
||||
lda GP.STATE
|
||||
bne L9C01
|
||||
|
||||
sta IO.KSTROBE
|
||||
sta IO.KBDSTROBE
|
||||
beq L9C01
|
||||
|
||||
L9BCD jsr BS.Setup4readEFBytesAt200
|
||||
@ -336,7 +336,7 @@ L9C1F lda GP.PREGA
|
||||
cmp #$83
|
||||
bne L9C31
|
||||
|
||||
bit IO.KSTROBE
|
||||
bit IO.KBDSTROBE
|
||||
rts
|
||||
|
||||
L9C31 lda ZP.PROMPT
|
||||
|
@ -115,7 +115,7 @@ BS.SetFileBuf sta GP.SBUFADR+1
|
||||
stz GP.SBUFADR
|
||||
lda BS.REFNUMs,x
|
||||
sta GP.MLIMRKEOFBUF.REFNUM
|
||||
lda #MLI.C.SETBUF
|
||||
lda #MLI.SETBUF
|
||||
jmp GP.GOSYSTEM
|
||||
*--------------------------------------
|
||||
BS.GETBUFR jsr BS.GetSysBufA
|
||||
@ -461,7 +461,9 @@ BS.LINEBUFCLR80 lda #$A0
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
BS.DOSCMD lda #$FF
|
||||
BS.DOSCMD stz BS.bFreeBuf
|
||||
|
||||
lda #$FF
|
||||
sta GP.XCNUM
|
||||
lda #$20
|
||||
sta BS.GetCharSep
|
||||
@ -481,9 +483,9 @@ LA6A5 jsr BS.IsIntCmd
|
||||
bcc .1
|
||||
|
||||
jsr BS.IsExtCmd
|
||||
bcs LA6A2
|
||||
bcc .1
|
||||
|
||||
jmp BS.ExecCmd
|
||||
rts
|
||||
|
||||
.1 lda GP.STATE
|
||||
bne LA6BA
|
||||
@ -524,7 +526,7 @@ LA6BA stz GP.FoundBITS
|
||||
lda GP.AllowedBITS
|
||||
bpl LA6F8 CMDBITS0.PFIX
|
||||
|
||||
lda #MLI.C.GETPREFIX
|
||||
lda #MLI.GETPREFIX
|
||||
jsr GP.GOSYSTEM
|
||||
|
||||
LA6F8 pla
|
||||
@ -738,11 +740,27 @@ LA80B lda GP.XCNUM
|
||||
rts
|
||||
|
||||
.8 clc
|
||||
LA844 jmp (BS.KW.JMPADDR)
|
||||
LA844 jsr .1
|
||||
|
||||
bit BS.bFreeBuf
|
||||
bpl .8
|
||||
|
||||
php
|
||||
pha
|
||||
|
||||
jsr GP.FREEBUFR
|
||||
|
||||
pla
|
||||
plp
|
||||
.8 rts
|
||||
|
||||
.1 jmp (BS.KW.JMPADDR)
|
||||
|
||||
BS.SYNERR lda #BS.E.SYNTAX
|
||||
LA849 sec
|
||||
rts
|
||||
|
||||
BS.bFreeBuf .BS 1
|
||||
*--------------------------------------
|
||||
BS.GetVolAtSxDy lda GP.ParamS
|
||||
asl
|
||||
@ -762,7 +780,7 @@ BS.GetVolAtSxDy lda GP.ParamS
|
||||
ldy #$02
|
||||
jsr BS.SetSBUFADRXY
|
||||
|
||||
lda #MLI.C.ONLINE
|
||||
lda #MLI.ONLINE
|
||||
jsr GP.GOSYSTEM
|
||||
bcs LA849
|
||||
|
||||
@ -1229,7 +1247,7 @@ BS.CreateFileOrDir
|
||||
|
||||
LAD82 stx GP.CRACCESS
|
||||
sty GP.CRSTTYPE
|
||||
lda #MLI.C.CREATE
|
||||
lda #MLI.CREATE
|
||||
jmp GP.GOSYSTEM
|
||||
|
||||
LAD8D lda #BS.E.NOBUFFER
|
||||
@ -1238,14 +1256,14 @@ LAD8D lda #BS.E.NOBUFFER
|
||||
BS.KW.RENAME lda GP.FoundBITS
|
||||
lsr
|
||||
lsr
|
||||
lda #MLI.C.RENAME
|
||||
lda #MLI.RENAME
|
||||
bcs LAD9E
|
||||
|
||||
jmp BS.SYNERR
|
||||
*--------------------------------------
|
||||
BS.KW.DELETE lda #MLI.C.DESTROY
|
||||
BS.KW.DELETE lda #MLI.DESTROY
|
||||
.HS 2C BIT ABS
|
||||
BS.SETPREFIX lda #MLI.C.SETPREFIX
|
||||
BS.SETPREFIX lda #MLI.SETPREFIX
|
||||
|
||||
LAD9E jmp GP.GOSYSTEM
|
||||
*--------------------------------------
|
||||
@ -1297,7 +1315,6 @@ LADF0 sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
BS.IsExtCmd ldx #BSX.GetPath.X
|
||||
|
||||
jsr BS.ToAUX
|
||||
|
||||
ldx BS.CMDBUF.LEN
|
||||
@ -1317,40 +1334,89 @@ BS.IsExtCmd ldx #BSX.GetPath.X
|
||||
bra .1
|
||||
|
||||
.2 stx BS.CMDBUF.LEN
|
||||
dey
|
||||
sty GP.XLEN
|
||||
|
||||
jsr BS.GetFileInfo
|
||||
bcs .9
|
||||
|
||||
jsr MON.CROUT
|
||||
bcs .99
|
||||
|
||||
lda GP.FIAUXTYPE+1
|
||||
ldx GP.FIAUXTYPE
|
||||
jsr PRNTAX
|
||||
stz GP.XCNUM
|
||||
|
||||
lda AS.HIMEM+1
|
||||
sta BS.BUFPAGE
|
||||
|
||||
jsr MON.CROUT
|
||||
lda #$01 Read
|
||||
ldx #$06 BIN
|
||||
|
||||
lda #$01
|
||||
ldx #$04
|
||||
jsr BS.OpenTypeXAccessA
|
||||
>DEBUG
|
||||
bcs .9
|
||||
bcs .99
|
||||
|
||||
jsr BS.MLIGetEOF
|
||||
bcs .9
|
||||
php
|
||||
pha
|
||||
jsr BS.MLIClose
|
||||
pla
|
||||
plp
|
||||
bcs .99
|
||||
|
||||
lda GP.SBUFADR+1
|
||||
ldx GP.SBUFADR
|
||||
jsr PRNTAX
|
||||
|
||||
jsr MON.CROUT
|
||||
|
||||
|
||||
jmp BS.MLIClose
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
BS.ExecCmd clc
|
||||
lda GP.SBUFADR+2 File LEN in GP.SBUFADR
|
||||
beq .20
|
||||
|
||||
lda #BS.E.TOOLARGE
|
||||
sec
|
||||
rts
|
||||
|
||||
.20 lda GP.SBUFADR+1
|
||||
sta GP.MLIRW.COUNT+1
|
||||
ldx GP.SBUFADR
|
||||
stx GP.MLIRW.COUNT
|
||||
beq .3
|
||||
|
||||
inc
|
||||
|
||||
.3 jsr GP.GETBUFR
|
||||
bcs .99
|
||||
|
||||
dec BS.bFreeBuf
|
||||
stz GP.MLIRW.DATAPTR
|
||||
|
||||
stz BS.KW.JMPADDR
|
||||
|
||||
lda GP.SBUFADR+1 Buffer Addr in GP.SBUFADR
|
||||
sta GP.MLIRW.DATAPTR+1
|
||||
|
||||
sta BS.KW.JMPADDR+1
|
||||
|
||||
lda AS.HIMEM+1
|
||||
sta BS.BUFPAGE
|
||||
|
||||
lda #$01 Read
|
||||
ldx #$06 BIN
|
||||
|
||||
jsr BS.OpenTypeXAccessA
|
||||
bcs .98
|
||||
|
||||
lda #MLI.READ
|
||||
jsr GP.GOSYSTEM
|
||||
bcs .98
|
||||
|
||||
jsr BS.MLIClose
|
||||
bcs .98
|
||||
|
||||
ldx #BSX.Rel.X
|
||||
|
||||
jsr BS.ToAUX
|
||||
bcc .99
|
||||
|
||||
.98 pha
|
||||
|
||||
jsr GP.FREEBUFR
|
||||
|
||||
pla
|
||||
|
||||
sec
|
||||
|
||||
.99 rts
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE usr/src/basic.fx/basic.s.b
|
||||
|
@ -153,7 +153,7 @@ LAEDD jsr BS.MLISetMark
|
||||
rts
|
||||
|
||||
LAEF7 ldx GP.XCNUM
|
||||
lda #MLI.C.READ
|
||||
lda #MLI.READ
|
||||
cpx #$0F
|
||||
bne LAF24
|
||||
|
||||
@ -169,7 +169,7 @@ LAEF7 ldx GP.XCNUM
|
||||
jsr BS.SetSBUFADRXY0
|
||||
jsr BS.MLISetEOF
|
||||
|
||||
LAF22 lda #MLI.C.WRITE
|
||||
LAF22 lda #MLI.WRITE
|
||||
|
||||
LAF24 jsr GP.GOSYSTEM
|
||||
bcs LAF38
|
||||
@ -291,19 +291,19 @@ BS.WriteXYBytes sec
|
||||
stx GP.MLIRW.COUNT
|
||||
bcc BS.MLIRead
|
||||
|
||||
BS.MLIWrite lda #MLI.C.WRITE
|
||||
BS.MLIWrite lda #MLI.WRITE
|
||||
.HS 2C BIT ABS
|
||||
BS.MLIRead lda #MLI.C.READ
|
||||
BS.MLIRead lda #MLI.READ
|
||||
.HS 2C BIT ABS
|
||||
BS.MLIClose lda #MLI.C.CLOSE
|
||||
BS.MLIClose lda #MLI.CLOSE
|
||||
.HS 2C BIT ABS
|
||||
BS.MLIGetEOF lda #MLI.C.GETEOF
|
||||
BS.MLIGetEOF lda #MLI.GETEOF
|
||||
.HS 2C BIT ABS
|
||||
BS.MLISetEOF lda #MLI.C.SETEOF
|
||||
BS.MLISetEOF lda #MLI.SETEOF
|
||||
.HS 2C BIT ABS
|
||||
BS.MLIGetMark lda #MLI.C.GETMARK
|
||||
BS.MLIGetMark lda #MLI.GETMARK
|
||||
.HS 2C BIT ABS
|
||||
BS.MLISetMark lda #MLI.C.SETMARK
|
||||
BS.MLISetMark lda #MLI.SETMARK
|
||||
jmp GP.GOSYSTEM
|
||||
*--------------------------------------
|
||||
BS.KW.PR lda #$00
|
||||
@ -385,12 +385,12 @@ BS.KW.BYE jsr BS.CloseAll
|
||||
jsr BS.RAMReset
|
||||
* lda #$65
|
||||
jsr MLI
|
||||
.DA #MLI.C.QUIT
|
||||
.DA #MLI.QUIT
|
||||
.DA GP.MLIRW
|
||||
*--------------------------------------
|
||||
BS.QUIT.IIgs jsr BS.RAMReset
|
||||
jsr MLI
|
||||
.DA #MLI.C.QUIT
|
||||
.DA #MLI.QUIT
|
||||
.DA .1
|
||||
|
||||
.1 .DA #4
|
||||
@ -478,7 +478,7 @@ LB0FD lda IO.KBD
|
||||
lda GP.STATE
|
||||
bne LB113
|
||||
|
||||
bit IO.KSTROBE
|
||||
bit IO.KBDSTROBE
|
||||
bcs LB113
|
||||
|
||||
LB10E lda #$FF
|
||||
@ -531,7 +531,7 @@ BS.MkCatLineF jsr BS.SetSBUFADRCMDBUF
|
||||
|
||||
lda MLI.DEVNUM
|
||||
sta GP.MLIMRKEOFBUF.REFNUM
|
||||
lda #MLI.C.ONLINE
|
||||
lda #MLI.ONLINE
|
||||
jsr GP.GOSYSTEM
|
||||
bcs LB127
|
||||
|
||||
@ -608,7 +608,7 @@ BS.OpenTypeXAccessA
|
||||
sta GP.OSYSBUF+1
|
||||
lda #$0F
|
||||
sta MLI.LEVEL
|
||||
lda #MLI.C.OPEN
|
||||
lda #MLI.OPEN
|
||||
jsr GP.GOSYSTEM
|
||||
bcs LB238
|
||||
|
||||
@ -742,7 +742,7 @@ LB2FB tya
|
||||
sta BS.BUFPAGEs-1,x
|
||||
lda BS.REFNUMs,x
|
||||
sta GP.MLIMRKEOFBUF.REFNUM
|
||||
lda #MLI.C.SETBUF
|
||||
lda #MLI.SETBUF
|
||||
jsr GP.GOSYSTEM
|
||||
bcc LB30D
|
||||
|
||||
@ -755,7 +755,7 @@ LB30E sta BS.BUFPAGE
|
||||
|
||||
stz MLI.LEVEL
|
||||
|
||||
lda #MLI.C.OPEN
|
||||
lda #MLI.OPEN
|
||||
jsr GP.GOSYSTEM
|
||||
bcc LB327
|
||||
|
||||
@ -782,7 +782,7 @@ LB333 sta GP.MLIRW.REFNUM
|
||||
|
||||
lda #$7F
|
||||
sta GP.NLINEMASK
|
||||
lda #MLI.C.NEWLINE
|
||||
lda #MLI.NEWLINE
|
||||
jsr GP.GOSYSTEM
|
||||
lda GP.FoundBITS+1
|
||||
and #CMDBITS1.F+CMDBITS1.R
|
||||
@ -833,7 +833,7 @@ BS.KW.FLUSH lda GP.FoundBITS
|
||||
bcs .9
|
||||
|
||||
.1 sta GP.MLICF.REFNUM
|
||||
lda #MLI.C.FLUSH
|
||||
lda #MLI.FLUSH
|
||||
jsr GP.GOSYSTEM
|
||||
|
||||
.9 rts
|
||||
@ -911,7 +911,7 @@ LB41D jsr BS.GetSysBuf
|
||||
lda #$07
|
||||
sta MLI.LEVEL
|
||||
|
||||
lda #MLI.C.OPEN
|
||||
lda #MLI.OPEN
|
||||
jsr GP.GOSYSTEM
|
||||
bcc LB43B
|
||||
|
||||
@ -1143,7 +1143,7 @@ LB5AD lda #$EF
|
||||
|
||||
lda #$7F
|
||||
sta GP.NLINEMASK
|
||||
lda #MLI.C.NEWLINE
|
||||
lda #MLI.NEWLINE
|
||||
jsr GP.GOSYSTEM
|
||||
bcs LB5F0
|
||||
|
||||
@ -1252,7 +1252,7 @@ LB67C sta GP.MLIRW.DATAPTR
|
||||
|
||||
stz GP.MLIRW.COUNT+1
|
||||
|
||||
lda #MLI.C.NEWLINE
|
||||
lda #MLI.NEWLINE
|
||||
jsr GP.GOSYSTEM
|
||||
bcs LB69B
|
||||
|
||||
@ -1485,7 +1485,7 @@ LB805 dey
|
||||
LB839 rts
|
||||
*--------------------------------------
|
||||
BS.GetFileInfo ldx #$0A
|
||||
lda #MLI.C.GETFILEINFO
|
||||
lda #MLI.GFINFO
|
||||
bne LB858
|
||||
|
||||
BS.SetFileInfoNoDate
|
||||
@ -1496,7 +1496,7 @@ BS.SetFileInfoNoDate
|
||||
bpl .1
|
||||
|
||||
BS.SetFileInfo ldx #$07
|
||||
lda #MLI.C.SETFILEINFO
|
||||
lda #MLI.SFINFO
|
||||
|
||||
LB858 stx GP.SSGINFO
|
||||
jmp GP.GOSYSTEM
|
||||
@ -1550,7 +1550,7 @@ BS.KW.ONLINE jsr MON.CROUT
|
||||
|
||||
.1 sta GP.MLIMRKEOFBUF.REFNUM
|
||||
|
||||
lda #MLI.C.ONLINE
|
||||
lda #MLI.ONLINE
|
||||
jsr GP.GOSYSTEM
|
||||
bcc .2
|
||||
|
||||
@ -1765,10 +1765,10 @@ BS.KW.PATH lda GP.FoundBITS
|
||||
jsr MON.CROUT
|
||||
ldx #$00
|
||||
|
||||
.1 cpx MLI.PATHBUF
|
||||
.1 cpx BS.CMDBUF.LEN
|
||||
beq .2
|
||||
|
||||
lda MLI.PATHBUF+1,x
|
||||
lda BS.CMDBUF+1,x
|
||||
ora #$80
|
||||
jsr MON.COUT
|
||||
inx
|
||||
@ -1784,7 +1784,7 @@ BS.SetPath clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
BS.WBlock jsr MLI
|
||||
.DA #MLI.C.WRITEBLOCK
|
||||
.DA #MLI.WRITEBLOCK
|
||||
.DA BS.WBlock.P
|
||||
bcs .9
|
||||
|
||||
@ -1811,7 +1811,7 @@ BS.Expand2PATHBUF
|
||||
beq .1
|
||||
|
||||
jsr MLI no, get current path as a base
|
||||
.DA #MLI.C.GETPREFIX
|
||||
.DA #MLI.GETPREFIX
|
||||
.DA BS.Expand2.P
|
||||
|
||||
.1 ldx #BSX.Expand.X
|
||||
|
@ -1,12 +1,12 @@
|
||||
NEW
|
||||
AUTO 3,1
|
||||
*--------------------------------------
|
||||
GP.ENTRY jmp BS.ENTRY
|
||||
GP.DOSCMD jmp BS.DOSCMD
|
||||
GP.EXTRNCMD jmp GP.RTS
|
||||
GP.ERROUT jmp BS.ERROUT
|
||||
GP.PRINTERR jmp BS.PRINTERR
|
||||
GP.ERRCODE .BS 1
|
||||
jmp BS.ENTRY GP.ENTRY
|
||||
jmp BS.DOSCMD GP.DOSCMD
|
||||
jmp GP.RTS GP.EXTRNCMD
|
||||
jmp BS.ERROUT GP.ERROUT
|
||||
jmp BS.PRINTERR GP.PRINTERR
|
||||
.BS 1 GP.ERRCODE
|
||||
*--------------------------------------
|
||||
GP.OUTVECT0 .DA MON.COUT1
|
||||
GP.OUTVECT1 .DA BS.NODEVERR
|
||||
@ -85,15 +85,15 @@ GP.GOSYSTEM.P .DA GP.GOSYSTEM.P
|
||||
*--------------------------------------
|
||||
GP.BADCALL ldx #$12
|
||||
|
||||
LBE8D cmp BS.MLIERTBL,x
|
||||
beq LBE97
|
||||
.1 cmp BS.MLIERTBL,x
|
||||
beq .2
|
||||
|
||||
dex
|
||||
bpl LBE8D
|
||||
bpl .1
|
||||
|
||||
ldx #$13
|
||||
|
||||
LBE97 lda BS.BIERRTBL,x
|
||||
.2 lda BS.BIERRTBL,x
|
||||
ldx BS.CALLX
|
||||
sec
|
||||
|
||||
@ -153,8 +153,8 @@ GP.MLICF.REFNUM .BS 1
|
||||
GP.CCCSPARE .BS 1
|
||||
*--------------------------------------
|
||||
GP.COPYRIGHT .AS -"COPYRIGHT APPLE, 1983"
|
||||
GP.GETBUFR jmp BS.GETBUFR
|
||||
GP.FREEBUFR jmp BS.FREEBUFR
|
||||
jmp BS.GETBUFR GP.GETBUFR
|
||||
jmp BS.FREEBUFR GP.FREEBUFR
|
||||
GP.RSHIMEM .BS 5
|
||||
*--------------------------------------
|
||||
MAN
|
||||
|
@ -157,7 +157,7 @@ L2115 iny
|
||||
beq L214E
|
||||
|
||||
jsr MLI
|
||||
.DA #MLI.C.GETPREFIX
|
||||
.DA #MLI.GETPREFIX
|
||||
.DA LDR.GETSETPFX.P
|
||||
bne L218B
|
||||
|
||||
@ -177,11 +177,11 @@ L213E dex
|
||||
bcs L216F
|
||||
|
||||
jsr MLI
|
||||
.DA #MLI.C.SETPREFIX
|
||||
.DA #MLI.SETPREFIX
|
||||
.DA LDR.SETPFXSLASH.P
|
||||
|
||||
L214E jsr MLI
|
||||
.DA #MLI.C.ONLINE
|
||||
.DA #MLI.ONLINE
|
||||
.DA LDR.ONLINE.P
|
||||
bne L218B
|
||||
|
||||
@ -194,7 +194,7 @@ L214E jsr MLI
|
||||
lda #'/'
|
||||
sta MLI.PATHBUF+1
|
||||
jsr MLI
|
||||
.DA #MLI.C.SETPREFIX
|
||||
.DA #MLI.SETPREFIX
|
||||
.DA LDR.GETSETPFX.P
|
||||
bne L218B
|
||||
|
||||
@ -222,7 +222,7 @@ L218B lda LDR.PFX.LEN
|
||||
bcs L2198
|
||||
|
||||
jsr MLI
|
||||
.DA #MLI.C.SETPREFIX
|
||||
.DA #MLI.SETPREFIX
|
||||
.DA LDR.SETPFXSLASH.P
|
||||
|
||||
L2198 lda LDR.STARTUP.LEN
|
||||
@ -367,7 +367,7 @@ LDR.GFInfoYA sty LDR.GFINFO.P+1
|
||||
pha
|
||||
|
||||
jsr MLI
|
||||
.DA #MLI.C.GETFILEINFO
|
||||
.DA #MLI.GFINFO
|
||||
.DA LDR.GFINFO.P
|
||||
|
||||
plx
|
||||
|
@ -45,6 +45,9 @@ BSX.Fre0.X .EQ *-BSX.JMP
|
||||
BSX.Fre1.X .EQ *-BSX.JMP
|
||||
.DA BSX.Fre1
|
||||
*--------------------------------------
|
||||
BSX.Rel.X .EQ *-BSX.JMP
|
||||
.DA BSX.Rel
|
||||
*--------------------------------------
|
||||
BSX.CheckOpt jsr BS.TMPBUF3Reset
|
||||
|
||||
jsr BSX.ToUpper
|
||||
@ -486,9 +489,6 @@ BSX.IsIntCmd lda #BSX.IntCmds
|
||||
.5 dec GP.XCNUM
|
||||
bne .1
|
||||
|
||||
|
||||
|
||||
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
|
191
BASIC.FX/BASIC.S.XR.txt
Normal file
191
BASIC.FX/BASIC.S.XR.txt
Normal file
@ -0,0 +1,191 @@
|
||||
NEW
|
||||
AUTO 3,1
|
||||
*--------------------------------------
|
||||
* GP.FIAUXTYPE = ORG
|
||||
* GP.MLIRW.DATAPTR = new ORG
|
||||
*--------------------------------------
|
||||
BSX.RelOfs .BS 2
|
||||
BSX.RelStart .BS 2
|
||||
BSX.RelEnd .BS 2
|
||||
BSX.RelStop .BS 2
|
||||
*--------------------------------------
|
||||
BSX.Rel lda GP.MLIRW.DATAPTR
|
||||
sta ZP.A1L
|
||||
sec
|
||||
sbc GP.FIAUXTYPE
|
||||
sta BSX.RelOfs
|
||||
|
||||
lda GP.MLIRW.DATAPTR+1
|
||||
sta ZP.A1L+1
|
||||
sbc GP.FIAUXTYPE+1
|
||||
sta BSX.RelOfs+1
|
||||
|
||||
ldy #2
|
||||
lda (ZP.A1L),y
|
||||
sta BSX.RelStart
|
||||
iny
|
||||
lda (ZP.A1L),y
|
||||
sta BSX.RelStart+1
|
||||
|
||||
ldy #10
|
||||
lda (ZP.A1L),y
|
||||
sta BSX.RelEnd
|
||||
iny
|
||||
lda (ZP.A1L),y
|
||||
sta BSX.RelEnd+1
|
||||
|
||||
ldy #8
|
||||
lda (ZP.A1L),y
|
||||
clc
|
||||
adc BSX.RelOfs
|
||||
sta BSX.RelStop
|
||||
iny
|
||||
lda (ZP.A1L),y
|
||||
adc BSX.RelOfs+1
|
||||
sta BSX.RelStop+1
|
||||
|
||||
ldy #4
|
||||
lda (ZP.A1L),y
|
||||
sta GP.AllowedBITS
|
||||
iny
|
||||
lda (ZP.A1L),y
|
||||
sta GP.AllowedBITS+1
|
||||
|
||||
ldy #2
|
||||
jsr BSX.RelAtA1Y relocate CLD JMP CODE.START
|
||||
|
||||
lda #16 skip header
|
||||
jsr BSX.RelSkipA
|
||||
|
||||
.1 ldy #1
|
||||
lda (ZP.A1L),y
|
||||
ora (ZP.A1L)
|
||||
beq .20
|
||||
|
||||
dey ldy #0
|
||||
|
||||
jsr BSX.RelAtA1Y
|
||||
lda #2
|
||||
jsr BSX.RelSkipA
|
||||
bra .1
|
||||
|
||||
.20 lda #2
|
||||
jsr BSX.RelSkipA
|
||||
|
||||
.2 lda (ZP.A1L)
|
||||
lsr
|
||||
tax
|
||||
lda BSX.65R02,x
|
||||
bcs .3
|
||||
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
|
||||
.3 and #$0f
|
||||
bit #$08
|
||||
beq .7
|
||||
|
||||
and #$07
|
||||
pha
|
||||
|
||||
ldy #1
|
||||
jsr BSX.RelAtA1Y
|
||||
|
||||
lda (ZP.A1L)
|
||||
cmp #$20 JSR
|
||||
bne .6
|
||||
|
||||
ldy #1
|
||||
lda (ZP.A1L),y
|
||||
bne .6
|
||||
|
||||
iny
|
||||
lda (ZP.A1L),y
|
||||
cmp #$BF jsr $BF00 ?
|
||||
bne .6
|
||||
|
||||
pla
|
||||
lda #6
|
||||
pha
|
||||
|
||||
.6 pla
|
||||
|
||||
.7 clc
|
||||
adc ZP.A1L
|
||||
sta ZP.A1L
|
||||
bcc .8
|
||||
|
||||
inc ZP.A1L+1
|
||||
|
||||
.8 cmp BSX.RelStop
|
||||
lda ZP.A1L+1
|
||||
sbc BSX.RelStop+1
|
||||
bcc .2
|
||||
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
BSX.RelAtA1Y lda (ZP.A1L),y
|
||||
tax
|
||||
iny
|
||||
|
||||
cpx BSX.RelStart
|
||||
lda (ZP.A1L),y
|
||||
sbc BSX.RelStart+1
|
||||
|
||||
bcc .9
|
||||
|
||||
cpx BSX.RelEnd
|
||||
lda (ZP.A1L),y
|
||||
sbc BSX.RelEnd+1
|
||||
bcs .9
|
||||
|
||||
dey
|
||||
lda (ZP.A1L),y
|
||||
clc
|
||||
adc BSX.RelOfs
|
||||
sta (ZP.A1L),y
|
||||
iny
|
||||
lda (ZP.A1L),y
|
||||
adc BSX.RelOfs+1
|
||||
sta (ZP.A1L),y
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
BSX.RelSkipA clc
|
||||
adc ZP.A1L
|
||||
sta ZP.A1L
|
||||
bcc .8
|
||||
|
||||
inc ZP.A1L+1
|
||||
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
* 65R02 OPCODES
|
||||
*--------------------------------------
|
||||
* 0.1.2.3.4.5.6.7.8.9.A.B.C.D.E.F
|
||||
BSX.65R02 .HS 1.2.2.1.2.2.2.2.1.2.1.1.B.B.B.3
|
||||
.HS 2.2.2.1.2.2.2.2.1.B.1.1.B.B.B.3
|
||||
.HS B.2.2.1.2.2.2.2.1.2.1.1.B.B.B.3
|
||||
.HS 2.2.2.1.2.2.2.2.1.B.1.1.B.B.B.3
|
||||
.HS 1.2.2.1.2.2.2.2.1.2.1.1.B.B.B.3
|
||||
.HS 2.2.2.1.2.2.2.2.1.B.1.1.1.B.B.3
|
||||
.HS 1.2.2.1.2.2.2.2.1.2.1.1.B.B.B.3
|
||||
.HS 2.2.2.1.2.2.2.2.1.B.1.1.B.B.B.3
|
||||
.HS 2.2.2.1.2.2.2.2.1.2.1.1.B.B.B.3
|
||||
.HS 2.2.2.1.2.2.2.2.1.B.1.1.B.B.B.3
|
||||
.HS 2.2.2.1.2.2.2.2.1.2.1.1.B.B.B.3
|
||||
.HS 2.2.2.1.2.2.2.2.1.B.1.1.B.B.B.3
|
||||
.HS 2.2.2.1.2.2.2.2.1.2.1.1.B.B.B.3
|
||||
.HS 2.2.2.1.2.2.2.2.1.B.1.1.1.B.B.3
|
||||
.HS 2.2.2.1.2.2.2.2.1.2.1.1.B.B.B.3
|
||||
.HS 2.2.2.1.2.2.2.2.1.B.1.1.1.B.B.3
|
||||
*--------------------------------------
|
||||
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE usr/src/basic.fx/basic.s.xr
|
||||
LOAD usr/src/basic.fx/basic.s
|
||||
ASM
|
@ -12,52 +12,14 @@ NEW
|
||||
.EM
|
||||
*--------------------------------------
|
||||
.INB inc/monitor.i
|
||||
.INB inc/io.i
|
||||
.INB inc/io.d2.i
|
||||
.INB inc/mli.i
|
||||
.INB inc/bs.i
|
||||
*--------------------------------------
|
||||
HIMEM .EQ $A000
|
||||
LOWERCASE .EQ 1
|
||||
*--------------------------------------
|
||||
BS.E.RANGE .EQ $02
|
||||
BS.E.NODEV .EQ $03
|
||||
BS.E.WPROT .EQ $04
|
||||
BS.E.ENDOFDATA .EQ $05
|
||||
BS.E.PATHNFND6 .EQ $06
|
||||
BS.E.PATHNFND7 .EQ $07
|
||||
BS.E.IO .EQ $08
|
||||
BS.E.DISKFULL .EQ $09
|
||||
BS.E.LOCKED .EQ $0A
|
||||
BS.E.INVOPT .EQ $0B
|
||||
BS.E.NOBUFFER .EQ $0C
|
||||
BS.E.MISMATCH .EQ $0D
|
||||
BS.E.TOOLARGE .EQ $0E
|
||||
BS.E.NODIRECT .EQ $0F
|
||||
BS.E.SYNTAX .EQ $10
|
||||
BS.E.DIRFULL .EQ $11
|
||||
BS.E.FNOTOPEN .EQ $12
|
||||
BS.E.DUPFILE .EQ $13
|
||||
BS.E.FBUSTY .EQ $14
|
||||
BS.E.FSTILLOPEN .EQ $15
|
||||
*--------------------------------------
|
||||
CMDBITS0.PFIX .EQ $80 Prefix needs fetching, pathname optional
|
||||
CMDBITS0.SLOT .EQ $40 No parameters to be processed
|
||||
CMDBITS0.RRUN .EQ $20 Command only valid during program
|
||||
CMDBITS0.FNOPT .EQ $10 Filename is optional
|
||||
CMDBITS0.CRFLG .EQ $08 CREATE allowed
|
||||
CMDBITS0.T .EQ $04 File type
|
||||
CMDBITS0.FN2 .EQ $02 Filename '2' for RENAME
|
||||
CMDBITS0.FN1 .EQ $01 Filename expected
|
||||
|
||||
CMDBITS1.A .EQ $80 Address
|
||||
CMDBITS1.B .EQ $40 Byte
|
||||
CMDBITS1.E .EQ $20 End address
|
||||
CMDBITS1.L .EQ $10 Length
|
||||
CMDBITS1.LINE .EQ $08 '@' line number
|
||||
CMDBITS1.SD .EQ $04 Slot and drive numbers
|
||||
CMDBITS1.F .EQ $02 Field
|
||||
CMDBITS1.R .EQ $01 Record
|
||||
|
||||
CMDBITS1.V .EQ $00 Volume number ignored
|
||||
*--------------------------------------
|
||||
ZPPtr1 .EQ 0
|
||||
ZPPtr2 .EQ 2
|
||||
ZPInBufPtr .EQ 4
|
||||
@ -156,36 +118,6 @@ MON.BRKVECT .EQ $03F0
|
||||
MON.POWERUP .EQ $03F2
|
||||
MON.POWERUPBYTE .EQ $03F4
|
||||
*--------------------------------------
|
||||
MLI.MAXPATH .EQ 64
|
||||
MLI.C.ALLOCIRQ .EQ $40
|
||||
MLI.C.DEALLOCIRQ .EQ $41
|
||||
MLI.C.ATALK .EQ $42
|
||||
MLI.C.QUIT .EQ $65
|
||||
MLI.C.READBLOCK .EQ $80
|
||||
MLI.C.WRITEBLOCK .EQ $81
|
||||
MLI.C.GETTIME .EQ $82
|
||||
MLI.C.CREATE .EQ $C0
|
||||
MLI.C.DESTROY .EQ $C1
|
||||
MLI.C.RENAME .EQ $C2
|
||||
MLI.C.SETFILEINFO .EQ $C3
|
||||
MLI.C.GETFILEINFO .EQ $C4
|
||||
MLI.C.ONLINE .EQ $C5
|
||||
MLI.C.SETPREFIX .EQ $C6
|
||||
MLI.C.GETPREFIX .EQ $C7
|
||||
MLI.C.OPEN .EQ $C8
|
||||
MLI.C.NEWLINE .EQ $C9
|
||||
MLI.C.READ .EQ $CA
|
||||
MLI.C.WRITE .EQ $CB
|
||||
MLI.C.CLOSE .EQ $CC
|
||||
MLI.C.FLUSH .EQ $CD
|
||||
MLI.C.SETMARK .EQ $CE
|
||||
MLI.C.GETMARK .EQ $CF
|
||||
MLI.C.SETEOF .EQ $D0
|
||||
MLI.C.GETEOF .EQ $D1
|
||||
MLI.C.SETBUF .EQ $D2
|
||||
MLI.C.GETBUF .EQ $D3
|
||||
*--------------------------------------
|
||||
MLI .EQ $BF00
|
||||
MLI.DEVPTRS .EQ $BF10
|
||||
MLI.DEVPTRS3D2 .EQ $BF26
|
||||
MLI.DEVNUM .EQ $BF30
|
||||
@ -200,23 +132,6 @@ MLI.PFIXPTR .EQ $BF9A
|
||||
MLI.MLIACTV .EQ $BF9B
|
||||
MLI.IVERSION .EQ $BFFD
|
||||
*--------------------------------------
|
||||
IO.KBD .EQ $C000 R
|
||||
IO.CLR80STORE .EQ $C000 W
|
||||
IO.SET80STORE .EQ $C001 W
|
||||
IO.CLRREADAUX .EQ $C002 W
|
||||
IO.SETREADAUX .EQ $C003 W
|
||||
IO.CLRWRITEAUX .EQ $C004 W
|
||||
IO.SETWRITEAUX .EQ $C005 W
|
||||
IO.CLRALTZP .EQ $C008 W
|
||||
IO.SETALTZP .EQ $C009 W
|
||||
IO.CLR80DISP .EQ $C00C W
|
||||
IO.SET80DISP .EQ $C00D W
|
||||
IO.KSTROBE .EQ $C010 W
|
||||
IO.RROMBNK2 .EQ $C082 R
|
||||
IO.RRAMWRAMBNK2 .EQ $C083 RR
|
||||
IO.RROMBNK1 .EQ $C08A R
|
||||
IO.RRAMWRAMBNK1 .EQ $C08B RR
|
||||
*--------------------------------------
|
||||
AS.RESTART .EQ $D43C
|
||||
AS.RESTART1 .EQ $D43F
|
||||
AS.FINDLINE .EQ $D61A
|
||||
@ -300,6 +215,7 @@ X.TRkFMT.Z .EQ $10
|
||||
.LIST OFF
|
||||
.INB usr/src/basic.fx/basic.s.xf
|
||||
.INB usr/src/basic.fx/basic.s.xm
|
||||
.INB usr/src/basic.fx/basic.s.xr
|
||||
.INB usr/src/basic.fx/basic.s.x
|
||||
.EP
|
||||
AUX.LEN .EQ *-LDR.AUX.SRC
|
||||
|
45
BASIC.FX/TEST.S.txt
Normal file
45
BASIC.FX/TEST.S.txt
Normal file
@ -0,0 +1,45 @@
|
||||
NEW
|
||||
AUTO 3,1
|
||||
.LIST OFF
|
||||
.OP 65c02
|
||||
.OR $2000
|
||||
.TF BIN/test
|
||||
*--------------------------------------
|
||||
.INB inc/monitor.i
|
||||
.INB inc/bs.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 .DA MSG
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
CODE.START ldx #0
|
||||
|
||||
.1 lda MSG,x ABS relocation required
|
||||
beq .8
|
||||
|
||||
jsr COUT
|
||||
inx
|
||||
jmp .1 ABS relocation required
|
||||
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
|
||||
CODE.END .EQ *
|
||||
*--------------------------------------
|
||||
MSG .CZ -"\r\rHello from test EXT command.\r\r"
|
||||
|
||||
DATA.END .EQ *
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE usr/src/basic.fx/test.s
|
||||
ASM
|
62
INC/BS.I.txt
Normal file
62
INC/BS.I.txt
Normal file
@ -0,0 +1,62 @@
|
||||
NEW
|
||||
AUTO 3,1
|
||||
.LIST OFF
|
||||
*--------------------------------------
|
||||
* BASIC.SYSTEM Defines
|
||||
*--------------------------------------
|
||||
BS.E.RANGE .EQ $02
|
||||
BS.E.NODEV .EQ $03
|
||||
BS.E.WPROT .EQ $04
|
||||
BS.E.ENDOFDATA .EQ $05
|
||||
BS.E.PATHNFND6 .EQ $06
|
||||
BS.E.PATHNFND7 .EQ $07
|
||||
BS.E.IO .EQ $08
|
||||
BS.E.DISKFULL .EQ $09
|
||||
BS.E.LOCKED .EQ $0A
|
||||
BS.E.INVOPT .EQ $0B
|
||||
BS.E.NOBUFFER .EQ $0C
|
||||
BS.E.MISMATCH .EQ $0D
|
||||
BS.E.TOOLARGE .EQ $0E
|
||||
BS.E.NODIRECT .EQ $0F
|
||||
BS.E.SYNTAX .EQ $10
|
||||
BS.E.DIRFULL .EQ $11
|
||||
BS.E.FNOTOPEN .EQ $12
|
||||
BS.E.DUPFILE .EQ $13
|
||||
BS.E.FBUSTY .EQ $14
|
||||
BS.E.FSTILLOPEN .EQ $15
|
||||
*--------------------------------------
|
||||
CMDBITS0.PFIX .EQ $80 Prefix needs fetching, pathname optional
|
||||
CMDBITS0.SLOT .EQ $40 No parameters to be processed
|
||||
CMDBITS0.RRUN .EQ $20 Command only valid during program
|
||||
CMDBITS0.FNOPT .EQ $10 Filename is optional
|
||||
CMDBITS0.CRFLG .EQ $08 CREATE allowed
|
||||
CMDBITS0.T .EQ $04 File type
|
||||
CMDBITS0.FN2 .EQ $02 Filename '2' for RENAME
|
||||
CMDBITS0.FN1 .EQ $01 Filename expected
|
||||
|
||||
CMDBITS1.A .EQ $80 Address
|
||||
CMDBITS1.B .EQ $40 Byte
|
||||
CMDBITS1.E .EQ $20 End address
|
||||
CMDBITS1.L .EQ $10 Length
|
||||
CMDBITS1.LINE .EQ $08 '@' line number
|
||||
CMDBITS1.SD .EQ $04 Slot and drive numbers
|
||||
CMDBITS1.F .EQ $02 Field
|
||||
CMDBITS1.R .EQ $01 Record
|
||||
|
||||
CMDBITS1.V .EQ $00 Volume number ignored
|
||||
*--------------------------------------
|
||||
* BASIC.SYSTEM Global page
|
||||
*--------------------------------------
|
||||
GP.ENTRY .EQ $BE00
|
||||
GP.DOSCMD .EQ $BE03
|
||||
GP.EXTRNCMD .EQ $BE06
|
||||
GP.ERROUT .EQ $BE09
|
||||
GP.PRINTERR .EQ $BE0C
|
||||
GP.ERRCODE .EQ $BE0F
|
||||
|
||||
|
||||
GP.GETBUFR .EQ $BEF5
|
||||
GP.FREEBUFR .EQ $BEF8
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE inc/bs.i
|
Loading…
Reference in New Issue
Block a user