diff --git a/.Floppies/A2OSX.BUILD.po b/.Floppies/A2OSX.BUILD.po index c88e5ba7..1c54c328 100644 Binary files a/.Floppies/A2OSX.BUILD.po and b/.Floppies/A2OSX.BUILD.po differ diff --git a/.Floppies/A2OSX.TEST.po b/.Floppies/A2OSX.TEST.po index 72971c28..052633e2 100644 Binary files a/.Floppies/A2OSX.TEST.po and b/.Floppies/A2OSX.TEST.po differ diff --git a/.Floppies/ProDOSFX.BOOT.po b/.Floppies/ProDOSFX.BOOT.po index a47d6ef4..fc3c7ff0 100644 Binary files a/.Floppies/ProDOSFX.BOOT.po and b/.Floppies/ProDOSFX.BOOT.po differ diff --git a/A2osX.S.QC.txt b/A2osX.S.QC.txt index ccf52e66..ef7eb56d 100644 --- a/A2osX.S.QC.txt +++ b/A2osX.S.QC.txt @@ -19,6 +19,7 @@ A2osX.QC.ROOT .BS 64 A2osX.QC.Start1 sei ldx #$FF txs + cli bit RROMBNK1 >LDYAI A2osX.QC @@ -271,6 +272,6 @@ QC.FREE .EQ $1300-* .EP *-------------------------------------- MAN -SAVE USR/SRC/A2OSX.S.QC -LOAD USR/SRC/A2OSX.S +SAVE usr/src/a2osx.s.qc +LOAD usr/src/a2osx.s ASM diff --git a/A2osX.S.txt b/A2osX.S.txt index 18c5454c..933da1fe 100644 --- a/A2osX.S.txt +++ b/A2osX.S.txt @@ -17,15 +17,16 @@ NEW TmpPtr1 .EQ $0 main & aux ZP TmpPtr2 .EQ $2 main & aux ZP *-------------------------------------- -A2osX.KMLOAD .EQ $2000 +A2osX.PMLOAD .EQ $2000 A2osX.LOGOLOAD .EQ $4000 -A2osX.KMMAXLEN .EQ $6000 +A2osX.PMMAXLEN .EQ $6000 A2osX.OpenBuff1 .EQ $8000 1024 Buffer for MLIOPEN01 A2osX.OpenBuff2 .EQ $8400 1024 Buffer for MLIOPEN02 A2osX.ReadBuff .EQ $8800 512 Buffer for MLIREAD01 Boot.Prefix .EQ $8A00 MLI.MAXPATH -LOGO.Filename .EQ $8A80 MLI.MAXPATH -KM.Filename .EQ $8B00 MLI.MAXPATH +Logo.Filename .EQ $8A80 MLI.MAXPATH +Sys.Prefix .EQ $8B00 MLI.MAXPATH +PM.Filename .EQ $8B80 MLI.MAXPATH MLIONLINE01BUF .EQ $8C00 256 *-------------------------------------- * Kernel Stage 0 @@ -37,12 +38,14 @@ A2osX.Init0 >LDYAI $2000 >LDYAI $1000 >STYA TmpPtr2 - ldx #$10 reloc $2000-$2FFF to $1000-$1FFF + ldx /SYSTEM.END-$1F00 + ldy #0 .1 lda (TmpPtr1),y sta (TmpPtr2),y iny bne .1 + inc TmpPtr1+1 inc TmpPtr2+1 dex @@ -76,6 +79,9 @@ A2osX.Init1.128 jsr MLI ldx Boot.Prefix .1 lda Boot.Prefix,x + sta Logo.Filename,x + sta Sys.Prefix,x + sta PM.Filename,x sta A2osX.QC.B.BOOT,x sta A2osX.QC.B.ROOT,x dex @@ -140,15 +146,11 @@ A2osX.RamDrv >LDYAI MSG.RAMDRV .8 jsr PrintFYA *-------------------------------------- -A2osX.EnumKM >LDYAI MSG.KMENUM - jsr PrintFYA - jsr EnumKM -*-------------------------------------- A2osX.SetupQC lda RRAMWRAMBNK2 lda RRAMWRAMBNK2 ldx #0 -.1 lda A2osX.QC.B.Start,x +.1 lda A2osX.QC.B.Start,x Still at $2xxx !!! not moved to $1xxx sta $D100,x lda A2osX.QC.B.Start+$100,x sta $D200,x @@ -159,6 +161,10 @@ A2osX.SetupQC lda RRAMWRAMBNK2 lda RROMBNK1 *-------------------------------------- +A2osX.EnumPM >LDYAI MSG.PMENUM do this After SetupQC, a PM could override QC + jsr PrintFYA + jsr EnumPM +*-------------------------------------- A2osX.MLIQuit >LDYAI MSG.INIT0OK jsr PrintFYA >DEBUGOA @@ -174,23 +180,16 @@ A2osX.Screen80 lda #$8C Reset 80 col screen ($0C:HOME) jsr $C300 ldx Boot.Prefix - -.1 lda Boot.Prefix,x - sta LOGO.Filename,x - dex - bne .1 - - ldx Boot.Prefix ldy #0 .2 inx iny lda A2osX.LOGO,y - sta LOGO.Filename,x + sta Logo.Filename,x cpy A2osX.LOGO bne .2 - stx LOGO.Filename + stx Logo.Filename jsr MLI .DA #MLIOPEN .DA MLIOPEN00 @@ -387,34 +386,42 @@ DisableRamDRV php sec rts *-------------------------------------- -EnumKM.EPB .EQ $0D -EnumKM.EL .EQ $27 +EnumPM.EPB .EQ $0D +EnumPM.EL .EQ $27 *-------------------------------------- -EnumKM ldx #0 +EnumPM ldx #0 ldy Boot.Prefix .1 inx lda SYS,x - sta Boot.Prefix+1,y + sta Sys.Prefix+1,y + sta PM.Filename+1,y iny cpx SYS bne .1 - sty Boot.Prefix - lda #Boot.Prefix + sty Sys.Prefix + sty PM.Filename + + lda #Sys.Prefix pha - lda /Boot.Prefix + lda /Sys.Prefix pha - >LDYAI MSG.KMSYSDIR + >LDYAI MSG.PMSYSDIR jsr PrintFYA + jsr MLI + .DA #MLISETPREFIX + .DA MLISETPREFIX02 + bcs .19 + jsr MLI .DA #MLIOPEN .DA MLIOPEN01 bcc .10 - pha - >LDYAI MSG.KMSYSDIR.KO +.19 pha + >LDYAI MSG.PMSYSDIR.KO jsr PrintFYA sec rts @@ -428,13 +435,13 @@ EnumKM ldx #0 .DA MLIREAD01 bcs .98 - lda #EnumKM.EPB - sta EnumKM.EC + lda #EnumPM.EPB + sta EnumPM.EC >LDYAI A2osX.ReadBuff+4 - >STYA EnumKM.BPTR + >STYA EnumPM.BPTR -.3 >LDYA EnumKM.BPTR +.3 >LDYA EnumPM.BPTR >STYA TmpPtr1 lda (TmpPtr1) @@ -446,7 +453,7 @@ EnumKM ldx #0 lda (TmpPtr1) and #$0F - cmp KM.PREFIX at least enough chars for KM.*? + cmp PM. at least enough chars for PM.*? bcc .5 no, skip ldy #$10 file type @@ -454,26 +461,26 @@ EnumKM ldx #0 cmp #$06 'BIN'? bne .5 skip - ldy KM.PREFIX + ldy PM. -.4 lda (TmpPtr1),y KM.* ? - cmp KM.PREFIX,y +.4 lda (TmpPtr1),y PM.* ? + cmp PM.,y bne .5 dey bne .4 - jsr LoadKM + jsr LoadPM -.5 lda EnumKM.BPTR +.5 lda EnumPM.BPTR clc - adc #EnumKM.EL - sta EnumKM.BPTR + adc #EnumPM.EL + sta EnumPM.BPTR bcc .6 - inc EnumKM.BPTR+1 + inc EnumPM.BPTR+1 -.6 dec EnumKM.EC +.6 dec EnumPM.EC bne .3 bra .2 @@ -491,47 +498,46 @@ EnumKM ldx #0 .8 jsr MLI .DA #MLICLOSE .DA MLICLOSE01 - rts -*-------------------------------------- -EnumKM.EC .BS 1 -EnumKM.BPTR .BS 2 -*-------------------------------------- -LoadKM ldx Boot.Prefix + bcs .99 -.1 lda Boot.Prefix,x - sta KM.Filename,x - dex - bne .1 - - ldy #$1c + jsr MLI + .DA #MLISETPREFIX + .DA MLISETPREFIX01 + +.99 rts +*-------------------------------------- +EnumPM.EC .BS 1 +EnumPM.BPTR .BS 2 +*-------------------------------------- +LoadPM ldy #$1c lda (TmpPtr1),y - sta LoadKM.VERSION + sta LoadPM.VERSION iny lda (TmpPtr1),y - sta LoadKM.MVERSION + sta LoadPM.MVERSION - ldx Boot.Prefix + ldx Sys.Prefix lda (TmpPtr1) and #$0F tay clc - adc Boot.Prefix - sta KM.Filename + adc sys.Prefix + sta PM.Filename tax -.2 bit LoadKM.MVERSION +.2 bit LoadPM.MVERSION bpl .6 cpy #8 bcs .3 - lda LoadKM.Bits,y - bit LoadKM.MVERSION + lda LoadPM.Bits,y + bit LoadPM.MVERSION beq .6 bra .4 -.3 lda LoadKM.Bits-8,y - bit LoadKM.VERSION +.3 lda LoadPM.Bits-8,y + bit LoadPM.VERSION beq .6 .4 lda (TmpPtr1),y @@ -539,17 +545,17 @@ LoadKM ldx Boot.Prefix .HS 2C BIT ABS .6 lda (TmpPtr1),y - sta KM.Filename,x + sta PM.Filename,x dex dey bne .2 - lda #KM.Filename + lda #PM.Filename pha - lda /KM.Filename + lda /PM.Filename pha - >LDYAI MSG.KMLOAD + >LDYAI MSG.PMLOAD jsr PrintFYA jsr MLI @@ -567,7 +573,7 @@ LoadKM ldx Boot.Prefix bcs .98 jsr .9 - jmp A2osX.KMLOAD + jmp A2osX.PMLOAD .98 pha jsr .9 @@ -581,9 +587,9 @@ LoadKM ldx Boot.Prefix .DA MLICLOSE02 .99 rts *-------------------------------------- -LoadKM.VERSION .BS 1 -LoadKM.MVERSION .BS 1 -LoadKM.Bits .HS 8040201008040201 +LoadPM.VERSION .BS 1 +LoadPM.MVERSION .BS 1 +LoadPM.Bits .HS 8040201008040201 *-------------------------------------- .INB usr/src/shared/x.printf.s *-------------------------------------- @@ -599,26 +605,30 @@ MSG.CPU.KO .AZ "A2osX Requires At Least A 65C02 CPU.\n" MSG.RAMDRV .AZ "Checking ProDOS RamDrive..." MSG.RAMDRV.OK .AZ "Successfully Disabled.\n" MSG.RAMDRV.KO0 .AZ "Not Detected.\n" -MSG.RAMDRV.KO1 .AZ "Uninstall Failed !!!\n" +MSG.RAMDRV.KO1 .AZ "Uninstall Failed.\n" MSG.BOOTPREFIX .AZ "Boot Prefix:%S\n" -MSG.KMENUM .AZ "Looking For Kernel Modules...\n" -MSG.KMSYSDIR .AZ "SYS dir is %S\n" -MSG.KMSYSDIR.KO .AZ "***Error : $%h\n" -MSG.KMLOAD .AZ "***Loading KM : %S\n" +MSG.PMENUM .AZ "Looking For ProDOS Modules...\n" +MSG.PMSYSDIR .AZ "SYS dir is %S\n" +MSG.PMSYSDIR.KO .AZ "***Error : $%h\n" +MSG.PMLOAD .AZ "***Loading PM : %S\n" MSG.INIT0OK .AZ "A2osX[Stage0]:Complete.\n" *-------------------------------------- -MLIGETPREFIX01 .DA #1 +MLIGETPREFIX01 +MLISETPREFIX01 .DA #1 .DA Boot.Prefix *-------------------------------------- +MLISETPREFIX02 .DA #1 + .DA Sys.Prefix +*-------------------------------------- MLIONLINE01 .DA #2 * .DA #0 .DA #$B0 S3D2 .DA MLIONLINE01BUF *-------------------------------------- MLIOPEN00 .DA #3 For DIR listing - .DA LOGO.Filename + .DA Logo.Filename .DA A2osX.OpenBuff1 .BS 1 MLIREAD00 .DA #4 @@ -630,7 +640,7 @@ MLICLOSE00 .DA #1 .BS 1 *-------------------------------------- MLIOPEN01 .DA #3 For DIR listing - .DA Boot.Prefix + .DA Sys.Prefix .DA A2osX.OpenBuff1 .BS 1 MLIREAD01 .DA #4 @@ -642,13 +652,13 @@ MLICLOSE01 .DA #1 .BS 1 *-------------------------------------- MLIOPEN02 .DA #3 - .DA KM.Filename + .DA PM.Filename .DA A2osX.OpenBuff2 .BS 1 MLIREAD02 .DA #4 .BS 1 - .DA A2osX.KMLOAD Load address for KMs - .DA A2osX.KMMAXLEN Maxlen of KM + .DA A2osX.PMLOAD Load address for PMs + .DA A2osX.PMMAXLEN Maxlen of PM .BS 2 MLICLOSE02 .DA #1 .BS 1 @@ -661,7 +671,7 @@ MLIQUIT01 .DA #4 *-------------------------------------- A2osX.LOGO >PSTR "A2osX.logo" SYS >PSTR "sys/" -KM.PREFIX >PSTR "KM." +PM. >PSTR "PM." *-------------------------------------- SCR.BASEL .HS 00.80.00.80.00.80.00.80.28.A8.28.A8.28.A8.28.A8.50.D0.50.D0.50.D0.50.D0 SCR.BASEH .HS 04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07.04.04.05.05.06.06.07.07 @@ -672,15 +682,16 @@ PALETTE.AUX .HS 00.01.02.03.04.05.06.07 .HS 08.09.0A.0B.0C.0D.0E.0F *-------------------------------------- .EP + + .LIST ON +SYSTEM.END .EQ * + .LIST OFF *-------------------------------------- A2osX.QC.B.Start A2osX.QC.B.BOOT .EQ *+4 A2osX.QC.B.ROOT .EQ *+4+64 .INB usr/src/a2osx.s.qc - .LIST ON -SYSTEM.END .EQ * - .LIST OFF *-------------------------------------- MAN -SAVE USR/SRC/A2OSX.S +SAVE usr/src/a2osx.s ASM diff --git a/BASIC.FX/BASIC.S.A.txt b/BASIC.FX/BASIC.S.A.txt index 993d598f..daeb94dd 100644 --- a/BASIC.FX/BASIC.S.A.txt +++ b/BASIC.FX/BASIC.S.A.txt @@ -2,47 +2,46 @@ NEW AUTO 3,1 *-------------------------------------- BS.ResetCSWKSW pha - lda GP.VECTOUT + lda GP.VECTOUT sta ZP.CSW - lda GP.VECTOUT+1 + lda GP.VECTOUT+1 sta ZP.CSW+1 - lda GP.VECTIN + lda GP.VECTIN sta ZP.KSW - lda GP.VECTIN+1 + lda GP.VECTIN+1 sta ZP.KSW+1 pla rts - +*-------------------------------------- BS.SetState0 ldx #$00 jsr BS.SetState - lda ZP.KSW+1 + + lda ZP.KSW+1 cmp GP.VDOSI+1 - bne L9A26 + beq BS.SetCSWKSW2VDOS - jmp BS.SetCSWKSW2VDOS - -L9A26 lda ZP.CSW+1 + lda ZP.CSW+1 cmp GP.VDOSO+1 beq BS.SetCSWKSW2VDOS bne BS.SaveCSWKSW - +*-------------------------------------- BS.IO.OUT cmp X9F65 bne L9A54 stx GP.PREGX tsx - lda $103,x - cmp #$12 + lda $103,x + cmp #$12 From AS rom: TRACE bne L9A6E - lda $104,x - cmp #$D8 + lda $104,x + cmp #$D8 jsr from $D810, then JSR MON.COUT bne L9A6E ldx #$04 jsr BS.SetState - lda X9F65 + lda X9F65 ldx GP.PREGX jmp BS.JMP.GP.VSYSO @@ -53,58 +52,59 @@ L9A54 cmp GP.CHRLAST cmp #$8D bne L9A74 - lda ZP.CH + lda ZP.CH bne L9A69 - lda BS.CMDBUF + lda BS.CMDBUF cmp #$3F -L9A69 lda #$8D +L9A69 lda #$8D bcs L9A74 rts L9A6E ldx GP.PREGX - lda X9F65 + lda X9F65 L9A74 jsr BS.ResetCSWKSW jsr MON.COUT cmp #$8D bne BS.SaveCSWKSW - lda AS.TRCFLG + lda AS.TRCFLG cmp #$A5 beq L9A8B sta GP.DTRACE - lda #$A5 + lda #$A5 sta AS.TRCFLG -L9A8B lda #$8D +L9A8B lda #$8D + BS.SaveCSWKSW pha - lda ZP.KSW+1 + lda ZP.KSW+1 sta GP.VECTIN+1 - lda ZP.KSW + lda ZP.KSW sta GP.VECTIN - lda ZP.CSW+1 + lda ZP.CSW+1 sta GP.VECTOUT+1 - lda ZP.CSW + lda ZP.CSW sta GP.VECTOUT pla BS.SetCSWKSW2VDOS pha - lda GP.VDOSO + lda GP.VDOSO sta ZP.CSW - lda GP.VDOSO+1 + lda GP.VDOSO+1 sta ZP.CSW+1 - lda GP.VDOSI + lda GP.VDOSI sta ZP.KSW - lda GP.VDOSI+1 + lda GP.VDOSI+1 sta ZP.KSW+1 pla rts - +*-------------------------------------- BS.IO.IN bit GP.EXECACTV bpl L9AC5 @@ -126,37 +126,37 @@ BS.CheckDOSCMD jsr BS.DOSCMD bcs BS.ERROUT ldy GP.PREGY - lda #$88 + lda #$88 ldx #$00 beq L9AEB L9AE8 jsr BS.RestoreAXY L9AEB jmp BS.SaveCSWKSW -BS.NODEVERR lda #$03 +BS.NODEVERR lda #$03 BS.ERROUT sta GP.ERRCODE sta AS.ERRNUM - lda GP.STATE + lda GP.STATE cmp #$01 php - lda #$0F + lda #$0F sta MLI.LEVEL - lda #$00 - sta GP.IFILACTV - sta GP.OFILACTV - sta GP.PFXACTV - sta GP.MLICF.REFNUM - lda #MLI.C.CLOSE - jsr GP.GOSYSTEM + + stz GP.IFILACTV + stz GP.OFILACTV + stz GP.PFXACTV + stz GP.MLICF.REFNUM + + lda #MLI.C.CLOSE + jsr GP.GOSYSTEM bcs L9B27 jsr LA004 bcs L9B27 - lda #$00 - sta MLI.LEVEL - sta GP.MLICF.REFNUM + stz MLI.LEVEL + stz GP.MLICF.REFNUM lda #MLI.C.FLUSH jsr GP.GOSYSTEM @@ -170,7 +170,7 @@ L9B27 plp L9B30 php jsr BS.SetState jsr BS.SetCSWKSW2VDOS - lda GP.ERRCODE + lda GP.ERRCODE plp bmi L9B4D @@ -189,12 +189,11 @@ L9B4D ldx AS.REMSTK txs tax -L9B53 lda #$03 +L9B53 lda #$03 jmp AS.BITERRFLG -L9B58 lda #$00 - sta AS.ERRNUM - lda #$A3 +L9B58 stz AS.ERRNUM + lda #$A3 sta X9F65 jsr AS.NORMAL jsr BS.ResetCSWKSW @@ -206,6 +205,7 @@ L9B58 lda #$00 BS.IO.IN0 jsr BS.SaveAXY bit GP.PFXACTV bpl L9B7E + jmp BS.IO.IN.CAT L9B7E bit GP.IFILACTV @@ -215,41 +215,41 @@ L9B7E bit GP.IFILACTV L9B86 bit GP.EXECACTV bmi BS.IO.IN.EXEC - lda ZP.PROMPT + lda ZP.PROMPT cmp #$DD beq L9B58 jsr BS.ResetCSWKSW -L9B94 lda GP.PREGA +L9B94 lda GP.PREGA ldy GP.PREGY jsr MON.KEYIN0 cmp #$88 bne L9BAC - lda ZP.PROMPT + lda ZP.PROMPT cmp #$BE beq L9BAA txa beq L9B94 -L9BAA lda #$88 +L9BAA lda #$88 L9BAC jmp BS.SaveCSWKSW BS.IO.IN.EXEC sta (ZP.BASL),y - lda ZP.PROMPT + lda ZP.PROMPT cmp #$BE beq L9BF2 - lda IO.KBD + lda IO.KBD bpl L9BCD cmp #$83 bne L9BCD jsr LB36B - lda GP.STATE + lda GP.STATE bne L9C01 sta IO.KSTROBE @@ -263,7 +263,7 @@ L9BCD jsr BS.Setup4readEFBytesAt200 bcc L9BDE L9BDA dex - lda IO.LINEBUF,x + lda IO.LINEBUF,x L9BDE ora #$80 sta IO.LINEBUF,x @@ -289,23 +289,24 @@ L9C01 ldx #$00 ldy ZP.CH bne L9C0E - lda #$DD + lda #$DD sta ZP.PROMPT - lda #$88 + lda #$88 rts -L9C0E lda (ZP.BASL),y +L9C0E lda (ZP.BASL),y jmp (ZP.KSW) + L9C13 jmp BS.ERROUT -BS.IO.IN.FILE lda ZP.PROMPT +BS.IO.IN.FILE lda ZP.PROMPT cmp #$DD bne L9C1F jmp L9B58 -L9C1F lda GP.PREGA +L9C1F lda GP.PREGA sta (ZP.BASL),y - lda IO.KBD + lda IO.KBD bpl L9C31 cmp #$83 @@ -314,7 +315,7 @@ L9C1F lda GP.PREGA bit IO.KSTROBE rts -L9C31 lda ZP.PROMPT +L9C31 lda ZP.PROMPT bit GP.DIRFLG bmi L9C95 @@ -331,46 +332,46 @@ L9C42 jsr BS.ReadOneByte rts -BS.ReadOneByte lda GP.MLIRW.COUNT +BS.ReadOneByte lda GP.MLIRW.COUNT sta GP.ParamL - lda #$01 + lda #$01 sta GP.MLIRW.COUNT - lda #MLI.C.READ - jsr GP.GOSYSTEM + lda #MLI.C.READ + jsr GP.GOSYSTEM bcs L9C66 - lda GP.ParamL + lda GP.ParamL sta GP.MLIRW.COUNT ldx GP.MLIRW.DATAPTR - lda IO.LINEBUF,x + lda IO.LINEBUF,x L9C66 rts -L9C67 lda GP.PREGA +L9C67 lda GP.PREGA sta (ZP.BASL),y -L9C6C lda #MLI.C.READ - jsr GP.GOSYSTEM +L9C6C lda #MLI.C.READ + jsr GP.GOSYSTEM bcs L9C66 - lda GP.MLIRW.TRANS + lda GP.MLIRW.TRANS beq L9C8E clc adc GP.MLIRW.DATAPTR tax - lda IO.LINEBUF-1,x + lda IO.LINEBUF-1,x and #$7F cmp #$0D bne L9C8E - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 and #$10 bne L9C8E dex -L9C8E lda #$8D +L9C8E lda #$8D ldy GP.PREGY clc rts @@ -378,48 +379,47 @@ L9C8E lda #$8D L9C95 cmp #$BE beq L9C8E - lda GP.PREGA + lda GP.PREGA sta (ZP.BASL),y - lda #$4F + lda #$4F sta BS.CATWIDTH - lda #MLI.C.GETMARK - jsr GP.GOSYSTEM + lda #MLI.C.GETMARK + jsr GP.GOSYSTEM bcs L9D1F - lda GP.SBUFADR + lda GP.SBUFADR ora GP.SBUFADR+1 bne L9CDF - lda #$02 + lda #$02 sta GP.CATFLAG jsr BS.ReadDirEnt bcs L9D1F - lda GP.MLIRW.REFNUM - lsr - ror - ror - ror - tax - lda XBC12 + jsr BS.GetFTableIdx + + lda XBC12 sta XBC5A,x - lda XBC13 + lda XBC13 sta XBC5B,x jsr LB128 -L9CD3 lda #$A2 +L9CD3 lda #$A2 sta IO.LINEBUF - lda #$8D + lda #$8D sta IO.LINEBUF,x clc rts -L9CDF lda GP.CATFLAG +L9CDF lda GP.CATFLAG beq L9D22 + bmi L9CF9 + ldx #$00 dec GP.CATFLAG beq L9CD3 + jsr BS.LINEBUFCLR80 ldx #$10 jsr BS.PRINTERRMSGX @@ -431,41 +431,39 @@ L9CF9 cmp #$FF bne L9D1C dec GP.CATFLAG - lda #$00 - sta GP.MLIRW.COUNT - sta GP.MLIRW.COUNT+1 - lda #MLI.C.READ - jsr GP.GOSYSTEM + + stz GP.MLIRW.COUNT + stz GP.MLIRW.COUNT+1 + + lda #MLI.C.READ + jsr GP.GOSYSTEM jsr LB157 pha - lda GP.MLIRW.REFNUM + lda GP.MLIRW.REFNUM sta GP.MLIMRKEOFBUF.REFNUM pla bcc L9CF5 bcs L9D1F -L9D1C lda #$05 +L9D1C lda #$05 sec L9D1F jmp BS.ERROUT -L9D22 lda #$FF +L9D22 lda #$FF sta XBC16 - lda GP.MLIRW.REFNUM - lsr - ror - ror - ror - tax - lda XBC5A,x + + jsr BS.GetFTableIdx + + lda XBC5A,x sta XBC12 - lda XBC5B,x + lda XBC5B,x sta XBC13 - lda GP.SBUFADR+1 + lda GP.SBUFADR+1 and #$01 tax - lda GP.SBUFADR + lda GP.SBUFADR sec L9D45 inc XBC16 @@ -496,31 +494,31 @@ BS.IO.IN.CAT cmp #$DD jmp L9B58 -L9D72 lda GP.PREGA +L9D72 lda GP.PREGA sta (ZP.BASL),y - lda #$00 - sta GP.PFXACTV + + stz GP.PFXACTV ldx BS.CMDBUF.LEN -L9D7F lda BS.CMDBUF.LEN,x +L9D7F lda BS.CMDBUF.LEN,x sta IO.LINEBUF-1,x dex bne L9D7F ldx BS.CMDBUF.LEN - lda #$8D + lda #$8D rts BS.Setup4readEFBytesAt200 - lda XBBFE + lda XBBFE sta GP.MLIRW.REFNUM - lda #$02 + lda #$02 sta GP.MLIRW.DATAPTR+1 - lda #$EF + lda #$EF sta GP.MLIRW.COUNT - lda #$00 - sta GP.MLIRW.COUNT+1 - sta GP.MLIRW.DATAPTR + + stz GP.MLIRW.COUNT+1 + stz GP.MLIRW.DATAPTR rts BS.VSYSO jsr BS.SaveAXY @@ -550,7 +548,7 @@ BS.IO.OUT.CAT jsr BS.SaveAXY inc GP.INPTR bne L9DE7 - lda #$10 + lda #$10 L9DE4 jmp BS.ERROUT @@ -602,11 +600,11 @@ L9E2F rts BS.IO.OUT.TRACE pha stx GP.PREGX tsx - lda $104,x + lda $104,x cmp #$12 bne L9E46 - lda $105,x + lda $105,x cmp #$D8 bne L9E46 @@ -614,9 +612,6 @@ BS.IO.OUT.TRACE pha bcs L9EBA L9E46 pla - nop - nop - nop ldx GP.PREGX bit GP.OFILACTV bpl L9E70 @@ -630,22 +625,22 @@ L9E46 pla L9E5A cmp #$8D bne L9E02 - lda ZP.PROMPT + lda ZP.PROMPT cmp #$FF - lda #$8D + lda #$8D bcc L9E02 jsr BS.WriteTBUF sta GP.OFILACTV - lda #$8D + lda #$8D bne L9EA3 L9E70 pha - lda GP.IFILACTV + lda GP.IFILACTV ora GP.PFXACTV bpl L9E81 - lda ZP.PROMPT + lda ZP.PROMPT ora #$04 cmp #$84 beq L9EA6 @@ -658,13 +653,13 @@ L9E81 pla bne L9EA3 L9E8A jsr BS.SaveAXY - lda GP.OPENCNT + lda GP.OPENCNT beq L9EA0 jsr BS.WriteTBUF sta GP.OFILACTV jsr BS.ResetCSWKSW - lda #$15 + lda #$15 jsr GP.PRINTERR L9EA0 jsr BS.RestoreAXY @@ -697,7 +692,7 @@ L9EBE ldx #$FF bmi L9F3D L9ECA ldy #$00 - lda (AS.TXTPTR),y + lda (AS.TXTPTR),y bmi L9EF5 beq L9EF2 @@ -705,26 +700,26 @@ L9ECA ldy #$00 L9ED2 dec GP.STRINGS bne L9EF0 - lda AS.STRINGSTART+1 + lda AS.STRINGSTART+1 sbc AS.ARRAYEND+1 cmp #$03 bcs L9EE9 jsr BS.WriteTBUF jsr BS.KW.01 - lda AS.STRINGSTART+1 + lda AS.STRINGSTART+1 sbc AS.ARRAYEND+1 L9EE9 sta GP.STRINGS ldy #$00 - lda (AS.TXTPTR),y + lda (AS.TXTPTR),y L9EF0 cmp #$3A L9EF2 jmp AS.EXECSTMT L9EF5 sta ZP.PROMPT tay - lda BS.BYTES-$80,y + lda BS.BYTES-$80,y bmi L9EF2 sta X9F00+1 @@ -733,17 +728,17 @@ X9F00 bne L9F02 SELF MODIFIED L9F02 sta ZP.PROMPT sta GP.CHRLAST - lda BS.VSYSO.LO + lda BS.VSYSO.LO sta GP.VSYSO - lda BS.VSYSO.HI + lda BS.VSYSO.HI sta GP.VSYSO+1 bne L9F32 - lda #$01 + lda #$01 sta ZP.PROMPT bne L9F32 - lda #$02 + lda #$02 sta ZP.PROMPT bne L9F32 @@ -756,33 +751,36 @@ L9F02 sta ZP.PROMPT sta GP.DTRACE dey -L9F2E lda #$4A +L9F2E lda #$4A sta AS.TRCFLG L9F32 tya jmp AS.EXECSTMT - lda #$00 - sta AS.ERRNUM - tya - bne L9EF0 + brk + +* UNREACHABLE CODE ???? +* lda #$00 +* sta AS.ERRNUM +* tya +* bne L9EF0 L9F3D jsr BS.ResetCSWKSW - lda #$A3 + lda #$A3 jsr MON.COUT ldx AS.CURLINE - lda AS.CURLINE+1 + lda AS.CURLINE+1 jsr AS.INTPRINTAX - lda #$A0 + lda #$A0 jsr MON.COUT jsr BS.SaveCSWKSW sec jmp L9ECA - lda #$E3 + lda #$E3 bne L9F5E - lda #$A3 + lda #$A3 L9F5E sta X9F65 tya @@ -797,7 +795,7 @@ BS.SaveAXY sta GP.PREGA sty GP.PREGY rts -BS.RestoreAXY lda GP.PREGA +BS.RestoreAXY lda GP.PREGA ldx GP.PREGX ldy GP.PREGY rts @@ -805,12 +803,12 @@ BS.RestoreAXY lda GP.PREGA BS.SetState stx GP.STATE ldy #$00 -L9F7F lda BS.SYSIOVECTS,x +.1 lda BS.SYSIOVECTS,x sta GP.VSYSO,y inx iny cpy #$04 - bne L9F7F + bne .1 rts @@ -821,20 +819,20 @@ BS.PRINTERRX jsr BS.PRINTERRMSGX ldx GP.INPTR stx BS.CATWIDTH jsr BS.CROUT - lda #$87 + lda #$87 jsr BS.COUT BS.LINEBUFOUT ldx #$00 -L9FA3 lda IO.LINEBUF+1,x +.1 lda IO.LINEBUF+1,x jsr BS.COUT inx cpx BS.CATWIDTH - bcc L9FA3 + bcc .1 -BS.CROUT lda #$8D +BS.CROUT lda #$8D BS.COUT jmp MON.COUT - +*-------------------------------------- BS.PRINTERRMSGX ldy #$00 clc sty GP.INPTR @@ -846,7 +844,7 @@ L9FBA jsr L9FD6 ora #$10 L9FC4 tay - lda BS.TBL6,y + lda BS.TBL6,y beq L9FD5 ldy GP.INPTR @@ -856,7 +854,7 @@ L9FC4 tay L9FD5 rts -L9FD6 lda BS.TBL7,x +L9FD6 lda BS.TBL7,x bcs L9FED beq L9FE3 @@ -869,7 +867,7 @@ L9FD6 lda BS.TBL7,x rts L9FE3 inx - lda BS.TBL7,x + lda BS.TBL7,x sta GP.INPTR inx bne L9FD6 @@ -878,8 +876,8 @@ L9FED inx and #$0F clc rts - -BS.WriteTBUF256 lda #$00 +*-------------------------------------- +BS.WriteTBUF256 lda #$00 ldy #$01 bne LA00B @@ -893,17 +891,16 @@ BS.WriteTBUF jsr LA004 jmp BS.ERROUT LA004 ldy #$00 - lda GP.TBUFPTR + lda GP.TBUFPTR beq LA01F LA00B sta GP.MLIRW.COUNT sty GP.MLIRW.COUNT+1 - lda #MLI.C.WRITE - jsr GP.GOSYSTEM - pha - lda #$00 - sta GP.TBUFPTR - pla + lda #MLI.C.WRITE + jsr GP.GOSYSTEM + + stz GP.TBUFPTR + bcs LA020 LA01F clc @@ -912,29 +909,29 @@ LA020 rts LA021 jsr BS.KW.01 bcs LA047 - lda AS.PGRMSTART+1 + lda AS.PGRMSTART+1 sta BS.TXTTAB+1 - lda AS.PGRMSTART + lda AS.PGRMSTART sta BS.TXTTAB - lda AS.HIMEM+1 + lda AS.HIMEM+1 sta XBBD8 - lda #$03 + lda #$03 sta XBBD9 - lda AS.STRINGSTART+1 + lda AS.STRINGSTART+1 sta BS.MEMSIZE+1 + lda #$00 sta BS.MEMSIZE - jsr LA089 + jsr LA089 Z LA047 rts -BS.KW.01 lda #$00 - sta BS.TXTTAB - lda #$03 +BS.KW.01 stz BS.TXTTAB + lda #$03 sta XBBD9 - lda AS.HIMEM+1 + lda AS.HIMEM+1 sta XBBD8 - lda AS.STRINGSTART+1 + lda AS.STRINGSTART+1 sta BS.TXTTAB+1 sec sbc AS.ARRAYEND+1 @@ -943,10 +940,10 @@ BS.KW.01 lda #$00 sbc #$03 sta XBBD9 - lda AS.ARRAYEND+1 + lda AS.ARRAYEND+1 adc #$00 sta XBBD8 - lda AS.HIMEM+1 + lda AS.HIMEM+1 sbc AS.STRINGSTART+1 adc #$01 cmp XBBD9 @@ -954,9 +951,9 @@ BS.KW.01 lda #$00 sta XBBD9 -LA07D lda AS.HIMEM+1 +LA07D lda AS.HIMEM+1 sta BS.MEMSIZE+1 - lda AS.HIMEM + lda AS.HIMEM sta BS.MEMSIZE sta AS.STRINGSTART @@ -965,31 +962,31 @@ LA089 clc sec -LA08D lda BS.MEMSIZE+1 +LA08D lda BS.MEMSIZE+1 sta AS.STRINGSTART+1 sbc #$00 sta XBBDA adc #$00 sta XBBDB - lda AS.ARRAYEND+1 + lda AS.ARRAYEND+1 adc #$01 sta XBBDD -LA0A3 lda AS.VARSTART +LA0A3 lda AS.VARSTART sbc #$06 sta ZP.A2L - lda AS.VARSTART+1 + lda AS.VARSTART+1 sbc #$00 sta ZP.A2H - lda AS.ARRAYSTART + lda AS.ARRAYSTART sta XBBDC - lda XBBDA + lda XBBDA cmp BS.TXTTAB+1 bcc LA0FA sbc XBBD9 sta XBBD7 - lda AS.STRINGSTART+1 + lda AS.STRINGSTART+1 sbc XBBDA sbc XBBD7 eor #$FF @@ -997,12 +994,12 @@ LA0A3 lda AS.VARSTART cmp XBBD7 bcc LA0D6 - lda XBBD7 + lda XBBD7 LA0D6 cmp BS.TXTTAB+1 bcs LA0E0 - lda BS.TXTTAB+1 + lda BS.TXTTAB+1 sbc #$00 LA0E0 sta XBBDA @@ -1012,16 +1009,16 @@ LA0E0 sta XBBDA bcs LA0F8 jsr LA131 - lda XBBDA + lda XBBDA sta XBBDB bcc LA0A3 -LA0F8 lda #$0C +LA0F8 lda #$0C LA0FA rts LA0FB clc -LA0FC lda ZP.A2L +LA0FC lda ZP.A2L adc #$07 sta ZP.A2L bcc LA106 @@ -1035,16 +1032,16 @@ LA106 eor AS.ARRAYSTART beq LA12F LA10E ldy #$00 - lda (ZP.A2L),y + lda (ZP.A2L),y iny eor (ZP.A2L),y bpl LA0FB - lda (ZP.A2L),y + lda (ZP.A2L),y bpl LA0FB ldy #$04 - lda (ZP.A2L),y + lda (ZP.A2L),y cmp XBBDA bcc LA0FC @@ -1063,7 +1060,7 @@ LA131 jsr LA160 bcs LA12F LA136 ldy #$02 - lda (ZP.A2L),y + lda (ZP.A2L),y cmp XBBDA bcc LA14A @@ -1076,7 +1073,7 @@ LA136 ldy #$02 rts LA14A clc -LA14B lda #$03 +LA14B lda #$03 adc ZP.A2L sta ZP.A2L bcc LA155 @@ -1092,7 +1089,7 @@ LA155 cmp XBBDC beq LA131 LA160 clc - lda XBBDC + lda XBBDC sta ZP.A2L stx ZP.A2H eor AS.ARRAYEND @@ -1102,21 +1099,21 @@ LA160 clc beq LA198 LA170 ldy #$02 - lda (ZP.A2L),y + lda (ZP.A2L),y adc ZP.A2L sta XBBDC iny - lda (ZP.A2L),y + lda (ZP.A2L),y adc ZP.A2H tax ldy #$00 - lda (ZP.A2L),y + lda (ZP.A2L),y iny eor (ZP.A2L),y bpl LA160 ldy #$04 - lda (ZP.A2L),y + lda (ZP.A2L),y asl adc #$05 adc ZP.A2L @@ -1128,9 +1125,9 @@ LA170 ldy #$02 clc LA198 rts -LA199 lda XBBD7 +LA199 lda XBBD7 sta ZP.PCH - lda XBBD8 + lda XBBD8 sta ZP.A1H ldy #$00 sty ZP.PCL @@ -1138,7 +1135,7 @@ LA199 lda XBBD7 ldx XBBD9 inx -LA1AD lda (ZP.PCL),y +LA1AD lda (ZP.PCL),y sta (ZP.A1L),y iny bne LA1AD @@ -1159,70 +1156,70 @@ LA1BC cmp XBBD7 LA1C8 sta ZP.PCH dey - lda (ZP.A2L),y + lda (ZP.A2L),y sta ZP.PCL dey sec - lda AS.STRINGSTART + lda AS.STRINGSTART sbc (ZP.A2L),y sta AS.STRINGSTART iny sta (ZP.A2L),y - lda AS.STRINGSTART+1 + lda AS.STRINGSTART+1 sbc #$00 sta AS.STRINGSTART+1 iny sta (ZP.A2L),y dey dey - lda (ZP.A2L),y + lda (ZP.A2L),y beq LA1F2 tay LA1EA dey - lda (ZP.PCL),y + lda (ZP.PCL),y sta (AS.STRINGSTART),y tya bne LA1EA LA1F2 clc - lda XBBDD + lda XBBDD sbc AS.STRINGSTART+1 rts -LA1F9 lda #$04 +LA1F9 lda #$04 LA1FB sta XBBB5 jsr BS.KW.01 bcs LA24E - lda AS.STRINGSTART+1 + lda AS.STRINGSTART+1 sbc AS.ARRAYEND+1 cmp XBBB5 - lda #$0C + lda #$0C bcc LA24E - lda AS.STRINGSTART+1 + lda AS.STRINGSTART+1 sta ZP.PCH sbc XBBB5 sta ZP.A1H sta AS.STRINGSTART+1 - lda AS.STRINGSTART + lda AS.STRINGSTART sta ZP.PCL sta ZP.A1L - lda AS.HIMEM + lda AS.HIMEM sbc ZP.PCL sta XBBED - lda AS.HIMEM+1 + lda AS.HIMEM+1 sbc ZP.PCH sta XBBEE jsr LA35F - lda #$00 + lda #$00 sec sbc XBBB5 sta XBBE2 jsr LA3A3 - lda AS.HIMEM+1 + lda AS.HIMEM+1 sta XBBB7 sec sbc XBBB5 @@ -1238,29 +1235,29 @@ LA24E sec LA250 jsr BS.KW.01 bcs LA29D - lda AS.HIMEM+1 + lda AS.HIMEM+1 sbc #$00 sta ZP.PCH adc #$03 sta ZP.A1H - lda AS.STRINGSTART + lda AS.STRINGSTART sta ZP.PCL sta ZP.A1L - lda AS.HIMEM + lda AS.HIMEM sec sbc AS.STRINGSTART sta XBBED - lda AS.HIMEM+1 + lda AS.HIMEM+1 sbc AS.STRINGSTART+1 sta XBBEE jsr LA383 - lda #$04 + lda #$04 sta XBBE2 clc adc AS.HIMEM+1 sta AS.HIMEM+1 jsr LA3A3 - lda XBBE3 + lda XBBE3 cmp AS.HIMEM+1 beq LA2B7 @@ -1268,7 +1265,7 @@ LA250 jsr BS.KW.01 ldx GP.OPENCNT beq LA29B - lda AS.HIMEM+1 + lda AS.HIMEM+1 LA293 cmp XBBEE,x beq LA29E @@ -1281,14 +1278,15 @@ LA29B pla LA29D rts LA29E pla + LA29F sta GP.SBUFADR+1 sta XBBEE,x - lda #$00 - sta GP.SBUFADR - lda XBBF6,x + + stz GP.SBUFADR + lda XBBF6,x sta GP.MLIMRKEOFBUF.REFNUM - lda #MLI.C.SETBUF - jsr GP.GOSYSTEM + lda #MLI.C.SETBUF + jsr GP.GOSYSTEM bcs LA29D LA2B7 clc diff --git a/BASIC.FX/BASIC.S.B.txt b/BASIC.FX/BASIC.S.B.txt index bac792a3..b9fff234 100644 --- a/BASIC.FX/BASIC.S.B.txt +++ b/BASIC.FX/BASIC.S.B.txt @@ -1,6 +1,8 @@ NEW AUTO 3,1 *-------------------------------------- +BS.WHICHBITS .HS 8040201008040201 + BS.GETBUFR jsr LA1FB bcs LA304 pha @@ -12,7 +14,7 @@ LA2C5 sta GP.SBUFADR+1 ldx GP.OPENCNT beq LA2EE - lda XBBB7 + lda XBBB7 clc adc #$04 sta XBBB7 @@ -20,37 +22,37 @@ LA2C5 sta GP.SBUFADR+1 LA2D6 cmp XBBEE,x bne LA2EB - lda GP.SBUFADR+1 + lda GP.SBUFADR+1 jsr LA356 jsr LA29F - lda GP.SBUFADR+1 + lda GP.SBUFADR+1 adc #$04 bcc LA2C5 LA2EB dex bne LA2D6 -LA2EE lda GP.SBUFADR+1 +LA2EE lda GP.SBUFADR+1 bit GP.EXECACTV bpl LA303 LA2F6 ldx #$08 jsr LA356 jsr LA29F - lda GP.SBUFADR+1 + lda GP.SBUFADR+1 adc #$04 LA303 clc LA304 rts -BS.FREEBUFR lda GP.OPENCNT +BS.FREEBUFR lda GP.OPENCNT asl asl adc AS.HIMEM+1 sta XBBB7 - lda AS.HIMEM+1 + lda AS.HIMEM+1 sta XBBB8 - lda GP.RSHIMEM + lda GP.RSHIMEM cmp AS.HIMEM+1 beq LA354 @@ -61,22 +63,22 @@ BS.FREEBUFR lda GP.OPENCNT jsr LA2F6 bcc LA345 -LA327 lda XBBB7 +LA327 lda XBBB7 ldx GP.OPENCNT beq LA351 LA32F cmp XBBEE,x bne LA34E - lda AS.HIMEM+1 + lda AS.HIMEM+1 jsr LA356 jsr LA29F sec - lda XBBB7 + lda XBBB7 sbc #$04 sta XBBB7 -LA345 lda AS.HIMEM+1 +LA345 lda AS.HIMEM+1 sec sbc #$04 sta AS.HIMEM+1 @@ -90,7 +92,7 @@ LA354 clc rts LA356 pha - lda XBBB8 + lda XBBB8 jsr LA29F pla rts @@ -99,7 +101,7 @@ LA35F ldy #$00 cpy XBBEE beq LA376 -LA366 lda (ZP.PCL),y +LA366 lda (ZP.PCL),y sta (ZP.A1L),y iny bne LA366 @@ -112,7 +114,7 @@ LA366 lda (ZP.PCL),y LA376 cpy XBBED beq LA382 - lda (ZP.PCL),y + lda (ZP.PCL),y sta (ZP.A1L),y iny bne LA376 @@ -133,22 +135,22 @@ LA38F cpy XBBEE jmp LA388 LA39A dey - lda (ZP.PCL),y + lda (ZP.PCL),y sta (ZP.A1L),y tya bne LA39A LA3A2 rts -LA3A3 lda AS.VARSTART+1 +LA3A3 lda AS.VARSTART+1 sta ZP.A2H - lda AS.VARSTART + lda AS.VARSTART ldx AS.ARRAYSTART+1 clc bcc LA3B3 LA3AE clc - lda ZP.A2L + lda ZP.A2L adc #$07 LA3B3 sta ZP.A2L @@ -165,19 +167,19 @@ LA3BF clc beq LA3D6 ldy #$00 - lda (ZP.A2L),y + lda (ZP.A2L),y iny eor (ZP.A2L),y bpl LA3AE - lda (ZP.A2L),y + lda (ZP.A2L),y bpl LA3AE iny jsr LA3FD jmp LA3AE -LA3D6 lda ZP.A2L +LA3D6 lda ZP.A2L sta XBBDC LA3DB clc @@ -188,7 +190,7 @@ LA3E1 ldy #$00 clc jsr LA3FD clc - lda #$03 + lda #$03 adc ZP.A2L sta ZP.A2L bcc LA3F2 @@ -203,103 +205,103 @@ LA3F2 cmp XBBDC beq LA3DB -LA3FD lda (ZP.A2L),y +LA3FD lda (ZP.A2L),y beq LA410 iny iny - lda AS.VARSTART+1 + lda AS.VARSTART+1 cmp (ZP.A2L),y bcs LA410 - lda (ZP.A2L),y + lda (ZP.A2L),y adc XBBE2 sta (ZP.A2L),y LA410 rts - +*-------------------------------------- LA411 jsr LA021 bcs LA47F - lda AS.ARRAYEND + lda AS.ARRAYEND sec sbc AS.VARSTART sta BS.BAS.HDR sta XBBED - lda AS.ARRAYEND+1 + lda AS.ARRAYEND+1 sbc AS.VARSTART+1 sta BS.BAS.HDR+1 sta XBBEE - lda AS.ARRAYSTART + lda AS.ARRAYSTART sbc AS.VARSTART sta BS.BAS.HDR+2 - lda AS.ARRAYSTART+1 + lda AS.ARRAYSTART+1 sbc AS.VARSTART+1 sta BS.BAS.HDR+3 - lda AS.STRINGSTART + lda AS.STRINGSTART sbc XBBED sta ZP.A1L - lda AS.STRINGSTART+1 + lda AS.STRINGSTART+1 sbc #$00 sta ZP.A1H - lda AS.ARRAYEND + lda AS.ARRAYEND sbc XBBED sta ZP.PCL - lda AS.ARRAYEND+1 + lda AS.ARRAYEND+1 sbc #$00 sta ZP.PCH - lda #$03 + lda #$03 sta XA386+1 jsr LA383 - lda #$07 + lda #$07 sta XA386+1 - lda ZP.A1L + lda ZP.A1L sta XBBE9 inc ZP.A1H - lda ZP.A1H + lda ZP.A1H sta XBBEA - lda AS.HIMEM + lda AS.HIMEM sec sbc ZP.A1L sta XBBEB - lda AS.HIMEM+1 + lda AS.HIMEM+1 sta BS.BAS.HDR+4 sbc ZP.A1H sta XBBEC clc LA47F rts -LA480 lda BS.BAS.HDR +LA480 lda BS.BAS.HDR sta XBBED clc adc AS.VARSTART sta AS.ARRAYEND - lda BS.BAS.HDR+1 + lda BS.BAS.HDR+1 sta XBBEE adc AS.VARSTART+1 sta AS.ARRAYEND+1 - lda AS.VARSTART + lda AS.VARSTART sta ZP.A1L adc BS.BAS.HDR+2 sta AS.ARRAYSTART - lda AS.VARSTART+1 + lda AS.VARSTART+1 sta ZP.A1H adc BS.BAS.HDR+3 sta AS.ARRAYSTART+1 - lda XBBE9 + lda XBBE9 sta ZP.PCL - lda XBBEA + lda XBBEA sta ZP.PCH jsr LA35F - lda XBBED + lda XBBED clc adc ZP.PCL sta AS.STRINGSTART - lda ZP.PCH + lda ZP.PCH adc #$00 sta AS.STRINGSTART+1 sec - lda AS.HIMEM+1 + lda AS.HIMEM+1 sbc BS.BAS.HDR+4 beq LA4D0 @@ -308,22 +310,53 @@ LA480 lda BS.BAS.HDR LA4D0 clc rts - +*-------------------------------------- LA4D2 jsr BS.LINEBUFCLR80 - lda #$A2 + lda #$A2 sta IO.LINEBUF - lda DIRENTBUF + lda DIRENTBUF and #$0F tay -LA4E0 lda DIRENTBUF,y +LA4E0 lda DIRENTBUF,y ora #$80 sta IO.LINEBUF+1,y dey bne LA4E0 - sty BS.TMPBUF4+2 - lda DIRENTBUF.TYPE + .DO LOWERCASE=1 + lda DIRENTBUF+$1D + bpl .18 + + lda DIRENTBUF + and #$0f + tay + +.10 cpy #8 + bcs .13 + + lda DIRENTBUF+$1D + and BS.WHICHBITS,y + beq .15 + + bne .14 + +.13 lda DIRENTBUF+$1C + and BS.WHICHBITS-8,y + beq .15 + +.14 lda IO.LINEBUF+1,y + eor #$20 + sta IO.LINEBUF+1,y + +.15 dey + bne .10 + +.18 .FIN + + stz BS.TMPBUF4+2 + + lda DIRENTBUF.TYPE ldx #$0E LA4F3 iny @@ -342,11 +375,12 @@ LA4F3 iny LA505 ldx #$02 pha -LA508 lda BS.PRODOSTYPES.ASC,y +LA508 lda BS.PRODOSTYPES.ASC,y sta $212,x dey dex bpl LA508 + pla bit BS.CATWIDTH bvc LA561 @@ -358,26 +392,26 @@ LA508 lda BS.PRODOSTYPES.ASC,y cmp #$04 bne LA549 - lda #$D2 + lda #$D2 sta $249 - lda DIRENTBUF.AUXT + lda DIRENTBUF.AUXT ldx DIRENTBUF.AUXT+1 jsr BS.AXDEC2LINEBUFY jmp LA544 -LA533 lda #$C1 +LA533 lda #$C1 sta $249 - lda DIRENTBUF.AUXT + lda DIRENTBUF.AUXT jsr BS.AHEX2LINEBUFY - lda DIRENTBUF.AUXT+1 + lda DIRENTBUF.AUXT+1 jsr BS.AHEX2LINEBUFY -LA544 lda #$BD +LA544 lda #$BD sta $24A -LA549 lda DIRENTBUF.EOF+2 +LA549 lda DIRENTBUF.EOF+2 sta BS.TMPBUF4+2 - lda DIRENTBUF.EOF + lda DIRENTBUF.EOF ldx DIRENTBUF.EOF+1 ldy #$46 jsr BS.AXDEC2LINEBUFY @@ -386,24 +420,24 @@ LA549 lda DIRENTBUF.EOF+2 jsr LA57E LA561 ldy #$1B - lda DIRENTBUF.UBLK + lda DIRENTBUF.UBLK ldx DIRENTBUF.UBLK+1 jsr BS.AXDEC2LINEBUFY - lda DIRENTBUF.ACCESS + lda DIRENTBUF.ACCESS and #$C2 cmp #$C2 beq LA57A - lda #$AA + lda #$AA sta IO.LINEBUF+1 LA57A ldx #$21 ldy #$2C -LA57E lda $25A,x +LA57E lda $25A,x lsr sta XBC10 - lda DIRENTBUF,x + lda DIRENTBUF,x pha and #$1F sta XBC0F @@ -422,10 +456,10 @@ LA57E lda $25A,x asl adc XBC0E sta XBC0E - lda XBC0F + lda XBC0F beq LA5B1 - lda XBC10 + lda XBC10 cmp #$64 bcc LA5C3 @@ -435,7 +469,7 @@ LA5B1 tya tay ldx #$08 -LA5B8 lda BS.NODATE,x +LA5B8 lda BS.NODATE,x sta IO.LINEBUF+1,y dey dex @@ -443,9 +477,9 @@ LA5B8 lda BS.NODATE,x rts -LA5C3 lda $25C,x +LA5C3 lda $25C,x pha - lda $25B,x + lda $25B,x ldx #$00 cmp #$3C bcc LA5D1 @@ -453,7 +487,7 @@ LA5C3 lda $25C,x txa LA5D1 jsr LA618 - lda #$BA + lda #$BA sta IO.LINEBUF+1,y dey pla @@ -472,7 +506,7 @@ LA5E2 cmp #$0A dey LA5EC dey - lda XBC10 + lda XBC10 jsr LA618 dey ldx XBC0E @@ -480,18 +514,18 @@ LA5EC dey inx inx -LA5FA lda BS.MONTHS-4,x +LA5FA lda BS.MONTHS-4,x sta IO.LINEBUF+1,y dey dex cpx XBC0E bne LA5FA - lda #$AD + lda #$AD sta IO.LINEBUF+1,y sta $205,y dey - lda XBC0F + lda XBC0F ldx #$00 jmp BS.AXDEC2LINEBUFY @@ -519,7 +553,7 @@ LA62B ora #$B0 LA633 sta IO.LINEBUF+1,y dey - lda #$A4 + lda #$A4 sta IO.LINEBUF+1,y rts @@ -528,11 +562,11 @@ BS.AXDEC2LINEBUFY sta BS.TMPBUF4 LA643 jsr LA65B - lda BS.TMPBUF4+3 + lda BS.TMPBUF4+3 ora #$B0 sta IO.LINEBUF+1,y dey - lda BS.TMPBUF4 + lda BS.TMPBUF4 ora BS.TMPBUF4+1 ora BS.TMPBUF4+2 bne LA643 @@ -540,13 +574,13 @@ LA643 jsr LA65B rts LA65B ldx #$18 - lda #$00 + lda #$00 sta BS.TMPBUF4+3 LA662 jsr BS.TMPBUF3x2 rol BS.TMPBUF4+3 sec - lda BS.TMPBUF4+3 + lda BS.TMPBUF4+3 sbc #$0A bcc LA676 @@ -558,7 +592,7 @@ LA676 dex rts -BS.LINEBUFCLR80 lda #$A0 +BS.LINEBUFCLR80 lda #$A0 ldx #$4F LA67E sta IO.LINEBUF+1,x @@ -566,19 +600,19 @@ LA67E sta IO.LINEBUF+1,x bpl LA67E rts - -BS.DOSCMD lda #$FF +*-------------------------------------- +BS.DOSCMD lda #$FF sta GP.XCNUM - lda #$20 + lda #$20 sta BS.GetCharSep - lda #$08 + lda #$08 sta BS.GetCharMax jsr BS.GetKWInCmdBuf - lda BS.CMDBUF - cmp #$41 + lda BS.CMDBUF + cmp #'A' bcs LA6A5 - eor #$2D + eor #'-' beq LA6A5 LA6A2 jmp BS.ERR10 @@ -586,31 +620,31 @@ LA6A2 jmp BS.ERR10 LA6A5 jsr BS.IsIntCmdMTR bcs LA6A2 - lda GP.STATE + lda GP.STATE bne LA6BA - lda GP.EXECACTV + lda GP.EXECACTV bne LA6BA jsr MON.CLREOL jsr BS.CROUT -LA6BA lda #$00 - sta GP.FoundBITS - sta GP.FoundBITS+1 - sta BS.CMDBUF - sta MLI.PATHBUF - lda GP.VDEFSLT +LA6BA stz GP.FoundBITS + stz GP.FoundBITS+1 + stz BS.CMDBUF + stz MLI.PATHBUF + + lda GP.VDEFSLT sta GP.ParamS - lda GP.VDEFDRV + lda GP.VDEFDRV sta GP.ParamD - lda AS.HIMEM+1 + lda AS.HIMEM+1 sta XBBE3 ldx GP.XLEN inx inx stx BS.GetCharMax - lda GP.AllowedBITS + lda GP.AllowedBITS beq LA744 asl @@ -619,28 +653,28 @@ LA6BA lda #$00 jsr BS.GetKWInCmdBuf php pha - lda GP.AllowedBITS + lda GP.AllowedBITS bpl LA6F8 - lda #MLI.C.GETPREFIX + lda #MLI.C.GETPREFIX jsr GP.GOSYSTEM LA6F8 pla plp beq LA744 - cmp #$2C + cmp #',' bne LA703 jmp LA795 -LA703 cmp #$2F +LA703 cmp #'/' beq LA70B - cmp #$41 + cmp #'A' bcc LA73D LA70B dex - lda #$82 + lda #$82 sta BS.GetCharSep lsr sta BS.GetCharMax @@ -648,10 +682,10 @@ LA70B dex jsr LAA2D dey sty BS.CMDBUF.LEN - lda #$01 + lda #CMDBITS0.FN1 sta GP.FoundBITS -LA723 lda BS.CMDBUF.LEN,y +LA723 lda BS.CMDBUF.LEN,y sta MLI.PATHBUF,y dey bpl LA723 @@ -662,13 +696,13 @@ LA723 lda BS.CMDBUF.LEN,y bcc LA7A6 - lda GP.AllowedBITS + lda GP.AllowedBITS lsr bcs LA770 LA73A jmp BS.ERR10 -LA73D lda GP.XCNUM +LA73D lda GP.XCNUM cmp #$06 bne LA73A @@ -681,19 +715,21 @@ LA747 jsr BS.GetKWInCmdBuf beq LA79A jsr BS.TMPBUF3Reset - sty XBC08 + stz XBC08 + ldy #$13 sty XBC09 ldy #$40 sty GP.FoundBITS + jsr LA96E bcs LA76F - lda GP.ParamINPR + lda GP.ParamINPR cmp #$08 bcc LA79F -LA76C lda #$02 +LA76C lda #$02 sec LA76F rts @@ -704,14 +740,14 @@ LA770 lsr beq LA73A dex - lda #$82 + lda #$82 sta BS.GetCharSep ldy #$01 jsr BS.GetPathInPathBuf dey dey sty MLI.PATHBUF - lda #$03 + lda #$03 sta GP.FoundBITS dex jsr BS.GetCharSpaceSep @@ -730,76 +766,79 @@ LA79F jsr BS.GetCharSpaceSep bcs LA795 -LA7A6 lda GP.ParamS +LA7A6 lda GP.ParamS beq LA76C cmp #$08 bcs LA76C - lda GP.ParamD + lda GP.ParamD beq LA76C cmp #$03 bcs LA76C - lda GP.AllowedBITS + lda GP.AllowedBITS and #$21 lsr beq LA7C9 - lda GP.STATE + lda GP.STATE bne LA7C9 - lda #$0F + lda #$0F sec rts LA7C9 bcc LA80B - lda GP.AllowedBITS+1 + lda GP.AllowedBITS+1 and #$04 beq LA80B - lda GP.FoundBITS + lda GP.FoundBITS lsr bcs LA7E1 - lda GP.AllowedBITS + lda GP.AllowedBITS and #$90 beq BS.ERR10 bpl LA80B -LA7E1 lda BS.CMDBUF +LA7E1 lda BS.CMDBUF eor #$2F beq LA7ED - lda MLI.PFIXPTR + lda MLI.PFIXPTR beq LA806 -LA7ED lda GP.FoundBITS+1 +LA7ED lda GP.FoundBITS+1 and #$04 beq LA80B bcs LA806 - lda #$00 - sta BS.CMDBUF.LEN - sta BS.CMDBUF - lda #$01 + stz BS.CMDBUF.LEN + stz BS.CMDBUF + + lda #$01 ora GP.FoundBITS sta GP.FoundBITS LA806 jsr BS.GetVolAtSxDy bcs LA849 -LA80B lda GP.XCNUM +LA80B lda GP.XCNUM asl tax - lda BS.KW.JMP,x + + lda BS.KW.JMP,x sta BS.KW.JMPADDR - lda BS.KW.JMP+1,x + lda BS.KW.JMP+1,x sta BS.KW.JMPADDR+1 +* >DEBUG + clc txa beq LA844 @@ -807,11 +846,11 @@ LA80B lda GP.XCNUM eor #$32 beq LA844 - lda GP.AllowedBITS+1 + lda GP.AllowedBITS+1 and #$04 beq LA844 - lda GP.FoundBITS + lda GP.FoundBITS lsr bcc LA844 @@ -821,56 +860,57 @@ LA80B lda GP.XCNUM cmp #$07 bne LA849 - lda GP.AllowedBITS + lda GP.AllowedBITS and #$08 bne LA844 - lda #$06 + lda #$06 rts LA844 jmp (BS.KW.JMPADDR) -BS.ERR10 lda #$10 +BS.ERR10 lda #$10 LA849 sec rts - -BS.GetVolAtSxDy lda GP.ParamS +*-------------------------------------- +BS.GetVolAtSxDy lda GP.ParamS asl asl asl asl asl pha - lda GP.ParamD + lda GP.ParamD eor #$01 lsr pla ror sta GP.MLIMRKEOFBUF.REFNUM - lda #$01 - sta GP.SBUFADR - lda #$02 - sta GP.SBUFADR+1 - lda #MLI.C.ONLINE + + ldx #$01 + ldy #$02 + jsr BS.SetSBUFADRXY + + lda #MLI.C.ONLINE jsr GP.GOSYSTEM bcs LA849 - lda GP.ParamD + lda GP.ParamD sta GP.VDEFDRV - lda GP.ParamS + lda GP.ParamS sta GP.VDEFSLT - lda BS.CMDBUF + lda BS.CMDBUF eor #$2F beq LA8F4 - lda IO.LINEBUF+1 + lda IO.LINEBUF+1 and #$0F adc #$02 sta IO.LINEBUF+1 adc BS.CMDBUF.LEN cmp #$40 tax - lda #$10 + lda #$10 bcs LA8F5 ldy BS.CMDBUF.LEN @@ -880,19 +920,19 @@ LA89D dex dey bmi LA8AA - lda BS.CMDBUF,y + lda BS.CMDBUF,y sta BS.CMDBUF,x jmp LA89D -LA8AA lda #$2F +LA8AA lda #$2F sta BS.CMDBUF LA8AF sta BS.CMDBUF,x - lda IO.LINEBUF,x + lda IO.LINEBUF,x dex bne LA8AF - lda GP.XCNUM + lda GP.XCNUM cmp #$0B beq LA8F4 @@ -902,13 +942,13 @@ LA8AF sta BS.CMDBUF,x cmp #$08 beq LA8F4 - lda MLI.PATHBUF + lda MLI.PATHBUF tay clc adc IO.LINEBUF+1 cmp #$40 tax - lda #$10 + lda #$10 bcs LA8F5 stx MLI.PATHBUF @@ -917,15 +957,15 @@ LA8D9 dex dey bmi LA8E6 - lda MLI.PATHBUF+1,y + lda MLI.PATHBUF+1,y sta MLI.PATHBUF+1,x jmp LA8D9 -LA8E6 lda #$2F +LA8E6 lda #$2F sta MLI.PATHBUF+1 LA8EB sta MLI.PATHBUF+1,x - lda IO.LINEBUF,x + lda IO.LINEBUF,x dex bne LA8EB @@ -936,26 +976,29 @@ LA8F5 rts LA8F6 jsr BS.TMPBUF3Reset ldy #$09 + jsr BS.ToUpper + LA8FB cmp BS.KW.OPT,y beq LA935 dey bpl LA8FB - cmp #$54 + cmp #'T' beq LA90A LA907 jmp BS.ERR10 -LA90A lda #$04 +LA90A lda #$04 and GP.AllowedBITS beq LA931 ora GP.FoundBITS sta GP.FoundBITS - lda #$00 - sta XBC08 - lda #$12 + + stz XBC08 + + lda #$12 sta XBC09 jsr BS.GetCharSpaceSep beq LA907 @@ -969,10 +1012,10 @@ LA90A lda #$04 jmp BS.GetFTypeASC LA931 sec - lda #$0B + lda #$0B rts -LA935 lda BS.KW.OPT.PBITSLO,y +LA935 lda BS.KW.OPT.PBITSLO,y beq LA955 and GP.AllowedBITS+1 @@ -984,17 +1027,17 @@ LA935 lda BS.KW.OPT.PBITSLO,y and GP.FoundBITS+1 bne LA955 - lda #$01 + lda #$01 sta GP.ParamD - lda #$04 + lda #$04 LA94F ora GP.FoundBITS+1 sta GP.FoundBITS+1 -LA955 lda BS.KW.OPT.PBITSHI,y +LA955 lda BS.KW.OPT.PBITSHI,y and #$03 sta XBC08 - lda BS.KW.OPT.PBITSHI,y + lda BS.KW.OPT.PBITSHI,y lsr lsr sta XBC09 @@ -1005,7 +1048,7 @@ LA955 lda BS.KW.OPT.PBITSHI,y beq LA984 LA96E stx GP.INPTR - jsr LAA6A + jsr BS.GetDecDigit bcc LA97A bmi LA9C1 @@ -1022,7 +1065,7 @@ LA984 jsr BS.GetCharSpaceSep beq LA9BE LA989 stx GP.INPTR - jsr LAABC + jsr BS.GetHexDigit bcc LA995 bmi LA9C1 @@ -1037,14 +1080,14 @@ LA99D ldx #$02 LA99F cpx XBC08 beq LA9AC - lda BS.TMPBUF4,x + lda BS.TMPBUF4,x bne LA9C1 dex bne LA99F LA9AC ldy XBC09 -LA9AF lda BS.TMPBUF4,x +LA9AF lda BS.TMPBUF4,x sta GP.ParamA,y dey dex @@ -1071,7 +1114,7 @@ LA9C6 sta BS.TMPBUF4,y LA9D5 stx GP.INPTR LA9D8 ldx #$00 - lda XBC08 + lda XBC08 cmp #$0F beq LA9BE @@ -1079,7 +1122,7 @@ LA9D8 ldx #$00 adc XBC08 tay -LA9E6 lda BS.TMPBUF4,x +LA9E6 lda BS.TMPBUF4,x eor BS.PRODOSTYPES.ASC,y asl bne LA9F7 @@ -1094,18 +1137,18 @@ LA9E6 lda BS.TMPBUF4,x LA9F7 inc XBC08 bne LA9D8 -LA9FC lda #$0E +LA9FC lda #$0E sec sbc XBC08 tay - lda BS.PRODOSTYPES.H,y + lda BS.PRODOSTYPES.H,y sta GP.ParamT ldx GP.INPTR clc rts - +*-------------------------------------- BS.GetPathInPathBuf - jsr BS.GetCharUC + jsr BS.GetChar UC sta MLI.PATHBUF,y iny cmp #$2C @@ -1122,15 +1165,15 @@ BS.GetPathInPathBuf ora #$00 rts - +*-------------------------------------- BS.GetKWInCmdBuf ldx #$00 ldy #$00 -LAA2D jsr BS.GetCharUC +LAA2D jsr BS.GetChar UC sta BS.CMDBUF,y iny - cmp #$2C + cmp #',' beq LAA45 cmp #$20 @@ -1144,33 +1187,42 @@ LAA2D jsr BS.GetCharUC LAA45 ora #$00 rts - +*-------------------------------------- BS.GetCharSpaceSep - lda #$20 + lda #$20 sta BS.GetCharSep - jsr BS.GetCharUC - cmp #$2C + jsr BS.GetChar UC + cmp #',' beq LAA57 cmp #$0D LAA56 clc LAA57 rts - -BS.GetCharUC lda IO.LINEBUF,x +*-------------------------------------- +BS.GetCharUC lda IO.LINEBUF,x and #$7F cmp #$61 - bcc LAA63 + bcc .1 and #$5F -LAA63 inx +.1 inx cmp BS.GetCharSep beq BS.GetCharUC rts +*-------------------------------------- +BS.GetChar lda IO.LINEBUF,x + and #$7F -LAA6A cmp #$30 + inx + cmp BS.GetCharSep + beq BS.GetChar + + rts +*-------------------------------------- +BS.GetDecDigit cmp #$30 bcc LAA72 cmp #$3A @@ -1182,13 +1234,13 @@ LAA72 sec LAA76 and #$0F pha - lda BS.TMPBUF4+2 + lda BS.TMPBUF4+2 cmp #$1A bcs LAAA2 ldx #$02 -LAA82 lda BS.TMPBUF4,x +LAA82 lda BS.TMPBUF4,x pha dex bpl LAA82 @@ -1222,11 +1274,11 @@ LAAA2 pla inc BS.TMPBUF4+2 bne LAABB -LAAB8 lda #$FF +LAAB8 lda #$FF sec LAABB rts - -LAABC cmp #$30 +*-------------------------------------- +BS.GetHexDigit cmp #$30 bcc LAACC cmp #$3A @@ -1243,6 +1295,7 @@ LAACC sec rts LAAD0 sbc #$06 + LAAD2 and #$0F ldx #$03 @@ -1255,16 +1308,16 @@ LAAD6 jsr BS.TMPBUF3x2 ora BS.TMPBUF4 sta BS.TMPBUF4 rts - +*-------------------------------------- BS.TMPBUF3x2 asl BS.TMPBUF4 rol BS.TMPBUF4+1 rol BS.TMPBUF4+2 rts - +*-------------------------------------- BS.IsIntCmd ldx #$1F stx GP.XCNUM - lda BS.CMDBUF - eor #$2D + lda BS.CMDBUF + eor #'-' bne LAB03 inc GP.XCNUM @@ -1274,7 +1327,7 @@ BS.IsIntCmd ldx #$1F LAB03 ldy #$08 sty GP.XLEN -LAB08 lda BS.KW.LEN,x +LAB08 lda BS.KW.LEN,x bpl LAB13 and #$7F @@ -1282,7 +1335,9 @@ LAB08 lda BS.KW.LEN,x dec GP.XLEN LAB13 tax -LAB14 lda BS.CMDBUF,y + +LAB14 lda BS.CMDBUF,y + jsr BS.ToUpper cmp BS.KW.TABLE,x bne LAB33 @@ -1290,12 +1345,12 @@ LAB14 lda BS.CMDBUF,y dey bpl LAB14 -LAB20 lda GP.XCNUM +LAB20 lda GP.XCNUM asl tax - lda BS.KW.PBITS-1,x + lda BS.KW.PBITS-1,x sta GP.AllowedBITS+1 - lda BS.KW.PBITS-2,x + lda BS.KW.PBITS-2,x sta GP.AllowedBITS clc rts @@ -1308,16 +1363,15 @@ LAB33 ldy GP.XLEN dec GP.XCNUM sec jmp GP.EXTRNCMD - -BS.TMPBUF3Reset ldy #$00 - sty BS.TMPBUF4 - sty BS.TMPBUF4+1 - sty BS.TMPBUF4+2 +*-------------------------------------- +BS.TMPBUF3Reset stz BS.TMPBUF4 + stz BS.TMPBUF4+1 + stz BS.TMPBUF4+2 rts - -BS.KW.APPEND lda GP.FITYPE +*-------------------------------------- +BS.KW.APPEND lda GP.FITYPE cmp #$FC - beq BS.KW.02 + beq BS.KW.RUN cmp #$06 beq LABA3 @@ -1331,31 +1385,32 @@ LAB63 cmp #$FF beq LAB6F cmp #$B3 beq LAB6F - lda #$0D + lda #$0D sec rts LAB6F pha jsr LB562 jsr LB36B - lda #$00 - sta GP.ParamA - sta MLI.MEMTABL+19 - sta MLI.MEMTABL+20 - sta MLI.MEMTABL+21 - sta MLI.MEMTABL+22 - lda #$01 + + stz GP.ParamA + stz MLI.MEMTABL+19 + stz MLI.MEMTABL+20 + stz MLI.MEMTABL+21 + stz MLI.MEMTABL+22 + + lda #$01 sta MLI.MEMTABL+23 - lda #$20 + lda #$20 sta GP.ParamA+1 pla cmp #$FF bne LABA6 sta GP.ParamT - lda #$80 + lda #$80 sta GP.FoundBITS+1 - lda #$05 + lda #$05 sta GP.FoundBITS LABA3 jmp BS.KW.BRUN @@ -1363,10 +1418,10 @@ LABA6 sec jsr MON.IIGSID bcs LABA3 - jmp LB099 + jmp BS.QUIT.IIgs BS.KW.X05 jsr LA411 - lda AS.HIMEM+1 + lda AS.HIMEM+1 sta BS.AS.HIMEMSave ldx XBBEA dex @@ -1378,13 +1433,13 @@ BS.KW.X05 jsr LA411 jsr AS.CLEAR1 jsr LA480 - lda #$00 + lda #$00 beq LABE6 -BS.KW.02 lda #$00 - sta GP.IFILACTV - sta AS.ERRNUM - lda GP.FoundBITS +BS.KW.RUN stz GP.IFILACTV + stz AS.ERRNUM + + lda GP.FoundBITS lsr bcc LABF4 @@ -1400,9 +1455,9 @@ LABE6 sta AS.ERRFLG jmp AS.NEXTSTMT LABF4 jsr AS.NORMAL - lda #$A3 + lda #$A3 sta X9F65 - lda #$FF + lda #$FF sta GP.XCNUM sta ZP.PROMPT ldx #$04 @@ -1414,7 +1469,7 @@ BS.KW.RESTORE jsr LAC1D BS.ENTRY jsr AS.CLEAR1 jsr BS.SetState0 - lda #$00 + lda #$00 sta ZP.CH jmp AS.RESTART1 @@ -1433,20 +1488,20 @@ LAC22 jsr LAC34 LAC33 rts -LAC34 lda #$01 +LAC34 lda #$01 ldx #$FC jsr BS.CheckFTypeXAccessA bcs LAC33 - lda #MLI.C.GETEOF + lda #MLI.C.GETEOF jsr GP.GOSYSTEM bcs LAC33 - lda AS.PGRMSTART + lda AS.PGRMSTART sta GP.MLIRW.DATAPTR adc GP.SBUFADR sta GP.ParamA - lda AS.PGRMSTART+1 + lda AS.PGRMSTART+1 sta GP.MLIRW.DATAPTR+1 adc GP.SBUFADR+1 sta GP.ParamA+1 @@ -1454,7 +1509,7 @@ LAC34 lda #$01 cmp AS.HIMEM+1 -LAC5E lda #$0E +LAC5E lda #$0E bcs LAC33 ldx GP.SBUFADR @@ -1473,10 +1528,10 @@ LAC5E lda #$0E rts LAC80 sec - lda AS.PGRMSTART + lda AS.PGRMSTART sbc GP.FIAUXTYPE sta ZP.A1L - lda AS.PGRMSTART+1 + lda AS.PGRMSTART+1 sbc GP.FIAUXTYPE+1 sta ZP.A1H ora ZP.A1L @@ -1484,94 +1539,97 @@ LAC80 sec beq LACD9 ldx AS.PGRMSTART - lda AS.PGRMSTART+1 + lda AS.PGRMSTART+1 LAC98 stx ZP.PCL sta ZP.PCH ldy #$01 - lda (ZP.PCL),y + lda (ZP.PCL),y dey ora (ZP.PCL),y beq LACD9 - lda (ZP.PCL),y + lda (ZP.PCL),y adc ZP.A1L tax sta (ZP.PCL),y iny - lda (ZP.PCL),y + lda (ZP.PCL),y adc ZP.A1H sta (ZP.PCL),y clc bcc LAC98 -LACB6 lda GP.FoundBITS+1 +LACB6 lda GP.FoundBITS+1 and #$08 clc beq LACD9 - lda GP.ParamAT + lda GP.ParamAT sta AS.LINNUM - lda GP.ParamAT+1 + lda GP.ParamAT+1 sta AS.LINNUM+1 jsr AS.FINDLINE clc - lda AS.LOWTR + lda AS.LOWTR adc #$FF sta AS.TXTPTR - lda AS.LOWTR+1 + lda AS.LOWTR+1 adc #$FF sta AS.TXTPTR+1 clc LACD9 rts - +*-------------------------------------- BS.KW.STORE bcc LACFE - lda #$FC + lda #$FC sta GP.ParamT sta GP.FITYPE - lda #$C3 + lda #$C3 sta GP.FIACCESS - lda AS.PGRMSTART + lda AS.PGRMSTART sta GP.CRAUXTYPE sta GP.FIAUXTYPE - lda AS.PGRMSTART+1 + lda AS.PGRMSTART+1 sta GP.CRAUXTYPE+1 sta GP.FIAUXTYPE+1 jsr BS.CreateFileOrDir bcs LAD47 -LACFE lda #$02 +LACFE lda #$02 ldx #$FC jsr BS.CheckFTypeXAccessA bcs LAD47 - lda AS.PGRMEND + lda AS.PGRMEND sec sbc AS.PGRMSTART tax - sta GP.SBUFADR - lda AS.PGRMEND+1 +* sta GP.SBUFADR + lda AS.PGRMEND+1 sbc AS.PGRMSTART+1 tay - sta GP.SBUFADR+1 - lda #$00 - sta GP.SBUFADR+2 - lda AS.PGRMSTART +* sta GP.SBUFADR+1 +* lda #$00 +* sta GP.SBUFADR+2 + + jsr BS.SetSBUFADRXY0 + + lda AS.PGRMSTART sta GP.MLIRW.DATAPTR - lda AS.PGRMSTART+1 + lda AS.PGRMSTART+1 sta GP.MLIRW.DATAPTR+1 jsr BS.WriteXYBytes bcs LAD47 - lda #MLI.C.SETEOF + lda #MLI.C.SETEOF jsr GP.GOSYSTEM bcs LAD47 jsr BS.FileClose bcs LAD47 - lda AS.PGRMSTART+1 + lda AS.PGRMSTART+1 ldx AS.PGRMSTART cmp GP.FIAUXTYPE+1 bne LAD48 @@ -1585,25 +1643,25 @@ LAD47 rts LAD48 stx GP.FIAUXTYPE sta GP.FIAUXTYPE+1 jmp BS.SetFileInfoNoDate - -BS.KW.CREATE lda #$00 - sta GP.CRAUXTYPE - sta GP.CRAUXTYPE+1 - lda GP.FoundBITS - and #$04 +*-------------------------------------- +BS.KW.CREATE stz GP.CRAUXTYPE + stz GP.CRAUXTYPE+1 + >DEBUG + lda GP.FoundBITS + and #CMDBITS0.T bne BS.CreateFileOrDir - lda #$0F + lda #$0F sta GP.ParamT BS.CreateFileOrDir - lda GP.EXECACTV + lda GP.EXECACTV asl - lda #$00 + lda #$00 adc GP.OPENCNT cmp #$08 bcs LAD8D - lda GP.ParamT + lda GP.ParamT sta GP.CRTYPE ldx #$C3 ldy #$01 @@ -1614,49 +1672,49 @@ BS.CreateFileOrDir LAD82 stx GP.CRACCESS sty GP.CRSTTYPE - lda #MLI.C.CREATE + lda #MLI.C.CREATE jmp GP.GOSYSTEM -LAD8D lda #$0C +LAD8D lda #$0C rts -BS.KW.RENAME lda GP.FoundBITS +BS.KW.RENAME lda GP.FoundBITS lsr lsr - lda #MLI.C.RENAME + lda #MLI.C.RENAME bcs LAD9E jmp BS.ERR10 -BS.KW.DELETE lda #MLI.C.DESTROY +BS.KW.DELETE lda #MLI.C.DESTROY LAD9E jmp GP.GOSYSTEM BS.KW.LOCK jsr BS.GetFileInfo - lda GP.FIACCESS + lda GP.FIACCESS and #$3C ora #$01 sta GP.FIACCESS jmp BS.SetFileInfo BS.KW.UNLOCK jsr BS.GetFileInfo - lda #$C3 + lda #$C3 ora GP.FIACCESS sta GP.FIACCESS jmp BS.SetFileInfo -BS.KW.PREFIX lda GP.FoundBITS+1 +BS.KW.PREFIX lda GP.FoundBITS+1 and #$04 sec bne LADCB - lda GP.FoundBITS + lda GP.FoundBITS lsr -LADCB lda #$C6 +LADCB lda #$C6 bcs LAD9E - lda ZP.PROMPT + lda ZP.PROMPT beq LADF0 jsr BS.CROUT @@ -1665,7 +1723,7 @@ LADCB lda #$C6 LADD8 cpx BS.CMDBUF.LEN beq LADE8 - lda BS.CMDBUF,x + lda BS.CMDBUF,x ora #$80 jsr BS.COUT inx @@ -1676,7 +1734,7 @@ LADE8 jsr BS.CROUT clc rts -LADF0 lda #$FF +LADF0 lda #$FF sta GP.PFXACTV clc rts diff --git a/BASIC.FX/BASIC.S.C.txt b/BASIC.FX/BASIC.S.C.txt index 31d9b463..d2dd038f 100644 --- a/BASIC.FX/BASIC.S.C.txt +++ b/BASIC.FX/BASIC.S.C.txt @@ -3,22 +3,22 @@ NEW *-------------------------------------- BS.KW.BSAVE bcc LAE2D - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 and #$B0 cmp #$90 XAE00 bcc LAE31 - lda GP.ParamA + lda GP.ParamA sta GP.CRAUXTYPE sta GP.FIAUXTYPE - lda GP.ParamA+1 + lda GP.ParamA+1 sta GP.CRAUXTYPE+1 sta GP.FIAUXTYPE+1 - lda #$06 + lda #$06 sta GP.ParamT sta GP.FITYPE - lda GP.FoundBITS + lda GP.FoundBITS and #$04 bne LAE31 @@ -28,10 +28,10 @@ XAE00 bcc LAE31 jsr BS.GetFileInfo bcs LAE33 -LAE2D lda #$02 +LAE2D lda #$02 bne LAE44 -LAE31 lda #$06 +LAE31 lda #$06 LAE33 sec rts @@ -45,23 +45,23 @@ BS.KW.BRUN jsr BS.KW.BLOAD LAE3F jmp (GP.MLIRW.DATAPTR) -BS.KW.BLOAD lda #$01 +BS.KW.BLOAD lda #$01 LAE44 ldx #$06 jsr BS.CheckFTypeXAccessA bcs LAE33 ldx GP.ParamA ldy GP.ParamA+1 - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 bmi LAE66 ldx GP.FIAUXTYPE ldy GP.FIAUXTYPE+1 - lda GP.FoundBITS + lda GP.FoundBITS and #$04 bne LAEAB - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 LAE66 stx GP.MLIRW.DATAPTR sty GP.MLIRW.DATAPTR+1 @@ -69,7 +69,7 @@ LAE66 stx GP.MLIRW.DATAPTR bvs LAE80 pha - lda GP.FITYPE + lda GP.FITYPE cmp #$06 bne LAE7F @@ -88,11 +88,11 @@ LAE80 ldx GP.ParamL and #$10 beq LAEC5 - lda GP.ParamE + lda GP.ParamE sec sbc GP.ParamA tax - lda GP.ParamE+1 + lda GP.ParamE+1 sbc GP.ParamA+1 tay inx @@ -102,40 +102,40 @@ LAE80 ldx GP.ParamL LAEA5 bcs LAEC5 - lda #$02 + lda #$02 sec rts -LAEAB lda #$0B +LAEAB lda #$0B sec rts -LAEAF lda #MLI.C.GETEOF +LAEAF lda #MLI.C.GETEOF jsr GP.GOSYSTEM bcs LAEC3 ldx GP.SBUFADR ldy GP.SBUFADR+1 - lda GP.SBUFADR+2 + lda GP.SBUFADR+2 beq LAEC5 - lda #$0E + lda #$0E LAEC3 sec rts LAEC5 stx GP.MLIRW.COUNT sty GP.MLIRW.COUNT+1 - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 and #$40 beq LAEF7 ldx #$02 -LAED4 lda GP.ParamB,x +LAED4 lda GP.ParamB,x sta GP.SBUFADR,x dex bpl LAED4 -LAEDD lda #MLI.C.SETMARK +LAEDD lda #MLI.C.SETMARK jsr GP.GOSYSTEM ldx GP.XCNUM bcc LAEF7 @@ -146,36 +146,34 @@ LAEDD lda #MLI.C.SETMARK cpx #$0F bne LAEC3 - lda #MLI.C.SETEOF + lda #MLI.C.SETEOF jsr GP.GOSYSTEM bcc LAEDD rts LAEF7 ldx GP.XCNUM - lda #$CA + lda #$CA cpx #$0F bne LAF24 bit GP.FoundBITS+1 bvs LAF22 - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 and #$30 beq LAF22 - lda GP.MLIRW.COUNT - sta GP.SBUFADR - lda GP.MLIRW.COUNT+1 - sta GP.SBUFADR+1 - lda #$00 - sta GP.SBUFADR+2 - lda #MLI.C.SETEOF + ldx GP.MLIRW.COUNT + ldy GP.MLIRW.COUNT+1 + jsr BS.SetSBUFADRXY0 + lda #MLI.C.SETEOF jsr GP.GOSYSTEM -LAF22 lda #MLI.C.WRITE +LAF22 lda #MLI.C.WRITE LAF24 jsr GP.GOSYSTEM bcs LAF38 + bit GP.FoundBITS+1 bvs LAF35 @@ -191,10 +189,10 @@ LAF38 sec BS.KW.SAVE bcc LAF4E - lda #$FD + lda #$FD sta GP.ParamT sta GP.FITYPE - lda #$C3 + lda #$C3 sta GP.FIACCESS jsr BS.CreateFileOrDir bcs LAF9C @@ -203,7 +201,7 @@ LAF4E jsr LA411 bcs LAF9C ldx #$FD - lda #$02 + lda #$02 jsr BS.CheckFTypeXAccessA bcs LAF95 @@ -211,10 +209,10 @@ LAF4E jsr LA411 jsr BS.WriteXYBytes bcs LAF95 - lda XBBE9 + lda XBBE9 sta GP.MLIRW.DATAPTR sta GP.FIAUXTYPE - lda XBBEA + lda XBBEA sta GP.MLIRW.DATAPTR+1 sta GP.FIAUXTYPE+1 ldy XBBEC @@ -222,9 +220,10 @@ LAF4E jsr LA411 jsr BS.WriteXYBytes bcs LAF95 - lda #MLI.C.GETMARK + lda #MLI.C.GETMARK jsr GP.GOSYSTEM - lda #MLI.C.SETEOF + + lda #MLI.C.SETEOF jsr GP.GOSYSTEM bcs LAF95 @@ -241,16 +240,16 @@ LAF95 php LAF9C rts BS.SetupRW5AtBBE4 - lda #$E4 + lda #$E4 sta GP.MLIRW.DATAPTR - lda #$BB + lda #$BB sta GP.MLIRW.DATAPTR+1 ldy #$00 ldx #$05 rts BS.KW.LOAD ldx #$FD - lda #$01 + lda #$01 jsr BS.CheckFTypeXAccessA bcs LAF9C @@ -258,10 +257,10 @@ BS.KW.LOAD ldx #$FD jsr BS.ReadXYBytes bcs LAF9C - lda GP.FIAUXTYPE + lda GP.FIAUXTYPE sta XBBE9 sta GP.MLIRW.DATAPTR - lda AS.HIMEM+1 + lda AS.HIMEM+1 sec sbc BS.BAS.HDR+4 clc @@ -273,10 +272,10 @@ BS.KW.LOAD ldx #$FD beq LAFF3 - lda #$00 + lda #$00 sbc XBBE9 tax - lda AS.HIMEM+1 + lda AS.HIMEM+1 sbc XBBEA tay jsr BS.ReadXYBytes @@ -285,74 +284,75 @@ BS.KW.LOAD ldx #$FD jsr BS.FileClose jmp LAF95 -LAFF3 lda #$0E +LAFF3 lda #$0E sec rts -BS.FileClose lda #MLI.C.CLOSE +BS.FileClose lda #MLI.C.CLOSE bne LB007 -BS.ReadXYBytes lda #MLI.C.READ +BS.ReadXYBytes lda #MLI.C.READ bne LB001 -BS.WriteXYBytes lda #MLI.C.WRITE +BS.WriteXYBytes lda #MLI.C.WRITE LB001 sty GP.MLIRW.COUNT+1 stx GP.MLIRW.COUNT LB007 jmp GP.GOSYSTEM -BS.KW.IN lda #$00 +BS.KW.IN lda #$00 sta BS.GetCharSep beq LB018 -BS.KW.PR lda #$02 +BS.KW.PR lda #$02 sta BS.GetCharSep - lda #$08 + lda #$08 + LB018 ora GP.ParamINPR asl tax - lda GP.FoundBITS + lda GP.FoundBITS and #$40 beq LB035 - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 bmi LB04A - lda GP.OUTVECT0,x + lda GP.OUTVECT0,x sta GP.ParamA - lda GP.OUTVECT0+1,x + lda GP.OUTVECT0+1,x sta GP.ParamA+1 LB035 jsr LB05C bcs LB049 ldy BS.GetCharSep - lda GP.ParamA + lda GP.ParamA sta ZP.CSW,y - lda GP.ParamA+1 + lda GP.ParamA+1 sta ZP.CSW+1,y LB049 rts LB04A jsr LB05C bcs LB05B - lda GP.ParamA+1 + lda GP.ParamA+1 sta GP.OUTVECT0+1,x - lda GP.ParamA + lda GP.ParamA sta GP.OUTVECT0,x LB05B rts -LB05C lda GP.ParamA +LB05C lda GP.ParamA sta ZP.PCL - lda GP.ParamA+1 + lda GP.ParamA+1 sta ZP.PCH ldy #$00 cmp #$C0 bcc LB081 - lda $CFFF + lda $CFFF sty ZP.A1L - lda (ZP.PCL),y + lda (ZP.PCL),y cmp #$FF beq LB087 @@ -365,38 +365,37 @@ LB077 cmp (ZP.PCL),y LB07F clc rts -LB081 lda (ZP.PCL),y +LB081 lda (ZP.PCL),y cmp #$D8 beq LB07F -LB087 lda #$03 +LB087 lda #$03 sec rts - +*-------------------------------------- BS.KW.BYE jsr LB562 jsr LB36B - lda #$65 + lda #$65 jsr MLI .DA #MLI.C.QUIT .DA GP.MLIRW - -LB099 jsr MLI +*-------------------------------------- +BS.QUIT.IIgs jsr MLI .DA #MLI.C.QUIT - .DA BS.MLIQUIT2.Param -BS.MLIQUIT2.Param - .DA #4 + .DA .1 + +.1 .DA #4 .DA #$EE .DA MLI.PATHBUF .DA #0 .DA 0 +*-------------------------------------- +BS.KW.CAT lda #$27 + .HS 2C BIT ABS +BS.KW.CATALOG lda #$4F -BS.KW.CAT lda #$27 - bne LB0AC - -BS.KW.CATALOG lda #$4F - -LB0AC sta BS.CATWIDTH - lda GP.FoundBITS + sta BS.CATWIDTH + lda GP.FoundBITS and #$05 lsr bne LB0BA @@ -420,15 +419,13 @@ LB0C1 jsr LB1BA jsr BS.PRINTERRMSGX jsr BS.LINEBUFOUT jsr BS.CROUT - lda XBC14 + lda XBC14 ora XBC15 - nop - nop LB0E8 jsr LB241 bcs LB113 - lda GP.ParamT + lda GP.ParamT beq LB0F7 cmp DIRENTBUF.TYPE @@ -437,18 +434,17 @@ LB0E8 jsr LB241 LB0F7 jsr LA4D2 jsr BS.LINEBUFOUT -LB0FD lda IO.KBD +LB0FD lda IO.KBD cmp #$83 bne LB10E - lda GP.STATE + lda GP.STATE bne LB113 bit IO.KSTROBE bcs LB113 -LB10E nop - lda #$FF +LB10E lda #$FF bne LB0E8 LB113 jsr BS.FileClose @@ -463,11 +459,11 @@ LB113 jsr BS.FileClose clc LB127 rts - +*-------------------------------------- LB128 jsr BS.LINEBUFCLR80 ldx #$01 ldy DIRENTBUF.STNL - lda #$AF + lda #$AF cpy #$F0 bcc LB13A @@ -479,7 +475,7 @@ LB13A tya sta IO.LINEBUF ldy #$05 -LB142 lda DIRENTBUF,y +LB142 lda DIRENTBUF,y ora #$80 sta IO.LINEBUF,x iny @@ -487,26 +483,29 @@ LB142 lda DIRENTBUF,y dec IO.LINEBUF bne LB142 - lda #$A2 + lda #$A2 sta IO.LINEBUF rts -LB157 lda #$18 - sta GP.SBUFADR - lda #$BC - sta GP.SBUFADR+1 - lda MLI.DEVNUM +LB157 ldx #BS.CMDBUF +* sta GP.SBUFADR + ldy /BS.CMDBUF +* sta GP.SBUFADR+1 + + jsr BS.SetSBUFADRXY + + lda MLI.DEVNUM sta GP.MLIMRKEOFBUF.REFNUM - lda #MLI.C.ONLINE + lda #MLI.C.ONLINE jsr GP.GOSYSTEM bcs LB127 - lda BS.CMDBUF + lda BS.CMDBUF and #$0F tax inx stx BS.CMDBUF.LEN - lda #$AF + lda #$AF sta BS.CMDBUF jsr BS.GetFileInfo bcs LB127 @@ -515,19 +514,19 @@ LB157 lda #$18 ldx #$36 jsr BS.PRINTERRMSGX jsr BS.TMPBUF3Reset - lda GP.FIAUXTYPE + lda GP.FIAUXTYPE ldx GP.FIAUXTYPE+1 ldy #$3D jsr BS.AXDEC2LINEBUFY - lda GP.FIBLOKS + lda GP.FIBLOKS ldx GP.FIBLOKS+1 ldy #$26 jsr BS.AXDEC2LINEBUFY - lda GP.FIAUXTYPE + lda GP.FIAUXTYPE sec sbc GP.FIBLOKS pha - lda GP.FIAUXTYPE+1 + lda GP.FIAUXTYPE+1 sbc GP.FIBLOKS+1 tax pla @@ -535,8 +534,8 @@ LB157 lda #$18 jsr BS.AXDEC2LINEBUFY clc rts - -LB1BA lda #$01 +*-------------------------------------- +LB1BA lda #$01 ldx #$0F ldy GP.STTYPE cpy #$0F @@ -547,36 +546,36 @@ LB1BA lda #$01 LB1C8 jsr LB210 bcs LB203 -BS.ReadDirEnt lda #$59 +BS.ReadDirEnt lda #$59 sta GP.MLIRW.DATAPTR - lda #$02 + lda #$02 sta GP.MLIRW.DATAPTR+1 - lda #$2B + lda #$2B sta GP.MLIRW.COUNT - lda #$00 - sta GP.MLIRW.COUNT+1 - lda #MLI.C.READ + + stz GP.MLIRW.COUNT+1 + lda #MLI.C.READ jsr GP.GOSYSTEM bcs LB203 ldx #$03 -LB1EA lda $27C,x +LB1EA lda $27C,x sta XBC12,x dex bpl LB1EA sta GP.MLIRW.COUNT - lda #$01 + lda #$01 sta XBC16 - lda #$00 - sta GP.SBUFADR+1 - sta GP.SBUFADR+2 + + stz GP.SBUFADR+1 + stz GP.SBUFADR+2 LB203 rts BS.CheckFTypeXAccessA pha - lda GP.FoundBITS + lda GP.FoundBITS and #$04 beq LB20F @@ -590,34 +589,34 @@ LB210 cpx GP.FITYPE and GP.FIACCESS beq LB23D - lda XBBE3 + lda XBBE3 sta GP.OSYSBUF+1 - lda #$0F + lda #$0F sta MLI.LEVEL - lda #MLI.C.OPEN + lda #MLI.C.OPEN jsr GP.GOSYSTEM bcs LB238 - lda GP.OREFNUM + lda GP.OREFNUM sta GP.MLIRW.REFNUM sta GP.MLICF.REFNUM sta GP.MLIMRKEOFBUF.REFNUM LB238 rts -LB239 lda #$0D +LB239 lda #$0D sec rts -LB23D lda #$0A +LB23D lda #$0A sec rts - -LB241 lda GP.SBUFADR+1 +*-------------------------------------- +LB241 lda GP.SBUFADR+1 and #$FE sta GP.SBUFADR+1 ldy XBC16 - lda #$00 + lda #$00 cpy XBC13 bcc LB25D @@ -638,25 +637,26 @@ LB25D dey LB268 adc #$04 sta GP.SBUFADR - lda #MLI.C.SETMARK + lda #MLI.C.SETMARK jsr GP.GOSYSTEM bcs LB28D - lda #MLI.C.READ + lda #MLI.C.READ jsr GP.GOSYSTEM bcs LB28D inc XBC16 - lda DIRENTBUF + lda DIRENTBUF and #$F0 beq LB241 - +* BUG on DEC word dec XBC14 bne LB28D dec XBC15 LB28D rts + BS.JMP.XTRNADDR jmp (GP.XTRNADDR) BS.KW.EXEC jsr BS.CheckFilename @@ -666,15 +666,14 @@ BS.KW.EXEC jsr BS.CheckFilename bpl LB2BC sta GP.MLIMRKEOFBUF.REFNUM - lda #$00 - sta GP.SBUFADR - sta GP.SBUFADR+1 - sta GP.SBUFADR+2 - lda #MLI.C.SETMARK + + jsr BS.ZeroSBUFADR + + lda #MLI.C.SETMARK jsr GP.GOSYSTEM bcs LB2B5 - lda GP.MLIMRKEOFBUF.REFNUM + lda GP.MLIMRKEOFBUF.REFNUM bne LB333 LB2B5 pha @@ -683,7 +682,7 @@ LB2B5 pha sec rts -LB2BC lda #$14 +LB2BC lda #$14 sec rts @@ -693,20 +692,20 @@ LB2C0 bit GP.EXECACTV jsr LB36B bcs LB2D3 -LB2CA lda GP.FITYPE +LB2CA lda GP.FITYPE cmp #$04 beq LB2D5 - lda #$0D + lda #$0D LB2D3 sec rts LB2D5 jsr LA1F9 bcs LB2D3 - lda #$00 - sta GP.SBUFADR - lda XBBE3 + stz GP.SBUFADR + + lda XBBE3 sta GP.SBUFADR+1 ldx GP.OPENCNT beq LB30E @@ -727,10 +726,10 @@ LB2F2 cmp XBBEE,x LB2FB tya sta XBBEE,x - lda XBBF6,x + lda XBBF6,x sta GP.MLIMRKEOFBUF.REFNUM - lda #MLI.C.SETBUF - jsr GP.GOSYSTEM + lda #MLI.C.SETBUF + jsr GP.GOSYSTEM bcc LB30D brk @@ -738,9 +737,10 @@ LB2FB tya LB30D pla LB30E sta XBBE3 sta GP.OSYSBUF+1 - lda #$00 - sta MLI.LEVEL - lda #MLI.C.OPEN + + stz MLI.LEVEL + + lda #MLI.C.OPEN jsr GP.GOSYSTEM bcc LB327 @@ -752,8 +752,9 @@ LB30E sta XBBE3 LB327 ldx GP.OSYSBUF+1 stx XBBF6 - lda GP.OREFNUM + lda GP.OREFNUM sta XBBFE + LB333 sta GP.MLIRW.REFNUM sta GP.MLIMRKEOFBUF.REFNUM sta GP.NEWLREF @@ -762,11 +763,11 @@ LB333 sta GP.MLIRW.REFNUM ldx GP.FIAUXTYPE+1 stx GP.ParamL+1 jsr LB45B - lda #$7F + lda #$7F sta GP.NLINEMASK - lda #MLI.C.NEWLINE + lda #MLI.C.NEWLINE jsr GP.GOSYSTEM - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 and #$03 beq LB364 @@ -775,24 +776,24 @@ LB333 sta GP.MLIRW.REFNUM jmp LB2B5 -LB364 lda #$FF +LB364 lda #$FF sta GP.EXECACTV clc rts -LB36B lda GP.EXECACTV +LB36B lda GP.EXECACTV bpl LB37B sta GP.EXECFILE ldx #$08 - lda XBBF6,x + lda XBBF6,x jsr LB515 LB37B rts BS.KW.X10 bcs LB3B7 - lda GP.FoundBITS + lda GP.FoundBITS and #$01 bne LB38D @@ -803,10 +804,10 @@ BS.KW.X10 bcs LB3B7 LB38D clc rts - lda #$00 - beq LB39F +* lda #$00 +* beq LB39F -BS.KW.FLUSH lda GP.FoundBITS +BS.KW.FLUSH lda GP.FoundBITS and #$01 beq LB39F @@ -814,7 +815,7 @@ BS.KW.FLUSH lda GP.FoundBITS bcs LB3A7 LB39F sta GP.MLICF.REFNUM - lda #MLI.C.FLUSH + lda #MLI.C.FLUSH jsr GP.GOSYSTEM LB3A7 rts @@ -824,34 +825,34 @@ BS.KW.03 php bcs LB3BB plp - lda #$14 + lda #$14 sec rts -LB3B3 lda #$0D +LB3B3 lda #$0D sec rts -LB3B7 lda #$06 +LB3B7 lda #$06 LB3B9 sec rts LB3BB plp ldx #$00 ldy #$00 - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 and #$10 bne LB3CD stx GP.ParamL+1 sty GP.ParamL -LB3CD lda GP.FoundBITS +LB3CD lda GP.FoundBITS and #$04 eor #$04 beq LB3DB - lda #$04 + lda #$04 sta GP.ParamT LB3DB bcc LB3FE @@ -859,7 +860,7 @@ LB3DB bcc LB3FE beq LB3B7 sta GP.FITYPE - lda #$C3 + lda #$C3 sta GP.FIACCESS ldx GP.ParamL+1 ldy GP.ParamL @@ -870,7 +871,7 @@ LB3DB bcc LB3FE jsr BS.CreateFileOrDir bcs LB3B9 -LB3FE lda GP.FITYPE +LB3FE lda GP.FITYPE cmp GP.ParamT bne LB3B3 @@ -879,7 +880,7 @@ LB3FE lda GP.FITYPE ldx GP.FIAUXTYPE+1 ldy GP.FIAUXTYPE - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 and #$10 bne LB41D @@ -889,11 +890,11 @@ LB3FE lda GP.FITYPE LB41D jsr LA1F9 bcs LB3B9 - lda XBBE3 + lda XBBE3 sta GP.OSYSBUF+1 - lda #$07 + lda #$07 sta MLI.LEVEL - lda #MLI.C.OPEN + lda #MLI.C.OPEN jsr GP.GOSYSTEM bcc LB43B @@ -903,28 +904,29 @@ LB41D jsr LA1F9 sec rts -LB43B lda GP.FITYPE +LB43B lda GP.FITYPE cmp #$0F beq LB443 clc -LB443 lda #$00 +LB443 lda #$00 ror sta GP.DIRFLG ldx GP.OPENCNT - lda XBBE3 + lda XBBE3 sta XBBEF,x - lda GP.OREFNUM + lda GP.OREFNUM sta XBBF7,x inc GP.OPENCNT + LB45B asl asl asl asl asl tax - lda MLI.PATHBUF + lda MLI.PATHBUF ora GP.DIRFLG sta XBC59,x and #$7F @@ -932,16 +934,16 @@ LB45B asl cmp #$1E bcc LB473 - lda #$1D + lda #$1D LB473 sta ZP.PCL - lda GP.ParamL + lda GP.ParamL sta XBC5A,x - lda GP.ParamL+1 + lda GP.ParamL+1 sta XBC5B,x LB481 inx - lda MLI.PATHBUF,y + lda MLI.PATHBUF,y sta XBC5B,x dey dec ZP.PCL @@ -951,11 +953,11 @@ BS.KW.X07 clc rts BS.CheckFilename - lda GP.FoundBITS + lda GP.FoundBITS and #$01 bne LB49A - lda #$10 + lda #$10 sec rts @@ -965,13 +967,13 @@ LB49A ldx GP.OPENCNT stx GP.EXECFILE LB4A2 stx ZP.PCH - lda XBBF6,x + lda XBBF6,x jsr LB4D2 bne LB4B3 ldx ZP.PCH -LB4AE lda XBBF6,x +LB4AE lda XBBF6,x LB4B1 clc rts @@ -979,19 +981,19 @@ LB4B3 ldx ZP.PCH dex bne LB4A2 -LB4B8 lda GP.EXECACTV +LB4B8 lda GP.EXECACTV bpl LB4CE - lda XBBFE + lda XBBFE jsr LB4D2 bne LB4CE - lda #$FF + lda #$FF sta GP.EXECFILE ldx #$08 bne LB4AE -LB4CE lda #$12 +LB4CE lda #$12 sec rts @@ -1001,7 +1003,7 @@ LB4D2 asl asl asl tax - lda XBC59,x + lda XBC59,x sta GP.DIRFLG and #$7F cmp MLI.PATHBUF @@ -1011,16 +1013,16 @@ LB4D2 asl cmp #$1E bcc LB4EC - lda #$1D + lda #$1D LB4EC sta ZP.PCL - lda XBC5A,x + lda XBC5A,x sta XBBFF - lda XBC5B,x + lda XBC5B,x sta XBC00 LB4FA inx - lda MLI.PATHBUF,y + lda MLI.PATHBUF,y cmp XBC5B,x bne LB508 @@ -1030,7 +1032,7 @@ LB4FA inx LB508 rts -BS.KW.X06 lda GP.FoundBITS +BS.KW.X06 lda GP.FoundBITS and #$01 beq LB562 @@ -1038,27 +1040,27 @@ BS.KW.X06 lda GP.FoundBITS bcs LB4B1 LB515 sta GP.MLICF.REFNUM - lda XBBEE,x + lda XBBEE,x sta XBBE3 bit GP.EXECFILE bmi LB53F ldy GP.OPENCNT pha - lda XBBEE,y + lda XBBEE,y sta XBBEE,x pla sta XBBEE,y - lda XBBF6,x + lda XBBF6,x pha - lda XBBF6,y + lda XBBF6,y sta XBBF6,x pla sta XBBF6,y -LB53F lda #$00 - sta MLI.LEVEL - lda #MLI.C.CLOSE +LB53F stz MLI.LEVEL + + lda #MLI.C.CLOSE jsr GP.GOSYSTEM bcs LB572 @@ -1066,11 +1068,9 @@ LB53F lda #$00 bit GP.EXECFILE bpl LB55E - pha - lda #$00 - sta GP.EXECACTV - sta GP.EXECFILE - pla + stz GP.EXECACTV + stz GP.EXECFILE + rts LB55E dec GP.OPENCNT @@ -1080,17 +1080,17 @@ LB562 ldx GP.OPENCNT beq LB573 stx GP.EXECFILE - lda XBBF6,x + lda XBBF6,x jsr LB515 bcc LB562 LB572 rts -LB573 lda #$00 - sta GP.MLICF.REFNUM - lda #$07 +LB573 stz GP.MLICF.REFNUM + + lda #$07 sta MLI.LEVEL - lda #MLI.C.CLOSE + lda #MLI.C.CLOSE jmp GP.GOSYSTEM BS.KW.CLOSE jsr BS.CheckFilename @@ -1101,7 +1101,7 @@ BS.KW.CLOSE jsr BS.CheckFilename bit GP.DIRFLG bmi LB5F0 -LB592 lda GP.FoundBITS+1 +LB592 lda GP.FoundBITS+1 and #$03 beq LB5ED @@ -1111,55 +1111,56 @@ LB592 lda GP.FoundBITS+1 and #$01 beq LB5AD - lda GP.ParamR + lda GP.ParamR sta GP.ParamF - lda GP.ParamR+1 + lda GP.ParamR+1 sta GP.ParamF+1 -LB5AD lda #$EF +LB5AD lda #$EF sta GP.MLIRW.COUNT - lda #$00 - sta GP.MLIRW.COUNT+1 - sta GP.MLIRW.DATAPTR - lda #$02 + + stz GP.MLIRW.COUNT+1 + stz GP.MLIRW.DATAPTR + + lda #$02 sta GP.MLIRW.DATAPTR+1 - lda #$7F + lda #$7F sta GP.NLINEMASK - lda #MLI.C.NEWLINE + lda #MLI.C.NEWLINE jsr GP.GOSYSTEM bcs LB5EF -LB5CB lda GP.ParamF +LB5CB lda GP.ParamF ora GP.ParamF+1 clc beq LB5F0 - lda #MLI.C.READ + lda #MLI.C.READ jsr GP.GOSYSTEM bcs LB5EF - lda GP.ParamF + lda GP.ParamF sbc #$00 sta GP.ParamF - lda GP.ParamF+1 + lda GP.ParamF+1 sbc #$00 sta GP.ParamF+1 bcs LB5CB -LB5ED lda #$0B +LB5ED lda #$0B LB5EF sec LB5F0 rts -LB5F1 lda XBBFF +LB5F1 lda XBBFF sta BS.TMPBUF4 - lda XBC00 + lda XBC00 sta BS.TMPBUF4+1 - lda #$00 - sta BS.TMPBUF4+2 - sta BS.TMPBUF4+3 - sta GP.SBUFADR - sta GP.SBUFADR+1 - sta GP.SBUFADR+2 + + stz BS.TMPBUF4+2 + stz BS.TMPBUF4+3 + + jsr BS.ZeroSBUFADR + LB60E lsr GP.ParamR+1 ror GP.ParamR ldx #$00 @@ -1167,7 +1168,7 @@ LB60E lsr GP.ParamR+1 clc -LB619 lda BS.TMPBUF4,x +LB619 lda BS.TMPBUF4,x adc GP.SBUFADR,x sta GP.SBUFADR,x inx @@ -1186,14 +1187,14 @@ LB62F rol BS.TMPBUF4,x eor #$04 bne LB62F - lda GP.ParamR + lda GP.ParamR ora GP.ParamR+1 bne LB60E clc rts -LB642 lda #$02 +LB642 lda #$02 sec rts @@ -1211,7 +1212,7 @@ BS.KW.X04 jsr BS.CheckFilename ldx #$7F ldy #$EF - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 and #$10 beq LB67C @@ -1222,56 +1223,55 @@ BS.KW.X04 jsr BS.CheckFilename cpy #$EF bcs LB6CB - lda #$22 + lda #$22 sta IO.LINEBUF - lda #$01 + lda #$01 LB67C sta GP.MLIRW.DATAPTR sty GP.MLIRW.COUNT stx GP.NLINEMASK - lda #$02 + lda #$02 sta GP.MLIRW.DATAPTR+1 - lda #$00 - sta GP.MLIRW.COUNT+1 - lda #MLI.C.NEWLINE + + stz GP.MLIRW.COUNT+1 + + lda #MLI.C.NEWLINE jsr GP.GOSYSTEM bcs LB69B -LB696 lda #$FF +LB696 lda #$FF sta GP.IFILACTV LB69B rts -LB69C lda #$59 +LB69C lda #$59 sta GP.MLIRW.DATAPTR - lda #$02 + lda #$02 sta GP.MLIRW.DATAPTR+1 - lda #$01 + lda #$01 sta GP.CATFLAG - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 and #$01 clc beq LB696 - lda #$00 - sta GP.SBUFADR - sta GP.SBUFADR+1 - sta GP.SBUFADR+2 - lda #MLI.C.SETMARK + jsr BS.ZeroSBUFADR + + lda #MLI.C.SETMARK jsr GP.GOSYSTEM bcs LB6CA - lda #$FF + lda #$FF sta GP.IFILACTV LB6CA rts -LB6CB lda #$02 +LB6CB lda #$02 tax sec rts -LB6D0 lda GP.FoundBITS+1 +LB6D0 lda GP.FoundBITS+1 and #$43 beq LB719 @@ -1284,25 +1284,25 @@ LB6D0 lda GP.FoundBITS+1 LB6E0 jsr LB712 bcs LB71A LB6E5 - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 and #$02 beq LB6F1 jsr LB5AD bcs LB71A -LB6F1 lda GP.FoundBITS+1 +LB6F1 lda GP.FoundBITS+1 and #$40 beq LB719 - lda #MLI.C.GETMARK + lda #MLI.C.GETMARK jsr GP.GOSYSTEM bcs LB71A ldx #$00 ldy #$02 -LB703 lda GP.ParamB,x +LB703 lda GP.ParamB,x adc GP.SBUFADR,x sta GP.SBUFADR,x inx @@ -1311,7 +1311,7 @@ LB703 lda GP.ParamB,x bcs LB6CB -LB712 lda #MLI.C.SETMARK +LB712 lda #MLI.C.SETMARK jsr GP.GOSYSTEM bcs LB71A @@ -1328,14 +1328,13 @@ BS.KW.X08 jsr BS.CheckFilename bit GP.DIRFLG bpl LB734 - lda #$0A + lda #$0A LB732 sec rts -LB734 lda #$00 - sta GP.MLIRW.DATAPTR - lda #$02 +LB734 stz GP.MLIRW.DATAPTR + lda #$02 sta GP.MLIRW.DATAPTR+1 jsr LB6D0 bcc LB757 @@ -1346,18 +1345,18 @@ LB734 lda #$00 cpx #$02 beq LB732 -LB74B lda #MLI.C.SETEOF +LB74B lda #MLI.C.SETEOF jsr GP.GOSYSTEM bcs LB732 jsr LB6E0 bcs LB732 -LB757 lda AS.HIMEM +LB757 lda AS.HIMEM sta GP.MLIRW.DATAPTR - lda AS.HIMEM+1 + lda AS.HIMEM+1 sta GP.MLIRW.DATAPTR+1 - lda #$FF + lda #$FF sta GP.OFILACTV clc rts @@ -1370,7 +1369,7 @@ BS.KW.X09 php jsr BS.KW.03 bcs LB788 - lda GP.OREFNUM + lda GP.OREFNUM bne LB77B brk @@ -1382,14 +1381,14 @@ LB77B sta GP.MLIRW.REFNUM bit GP.DIRFLG bpl LB78A - lda #$0A + lda #$0A LB788 sec rts LB78A ldx GP.ParamL ldy GP.ParamL+1 - lda GP.FoundBITS+1 + lda GP.FoundBITS+1 and #$10 bne LB79D @@ -1397,26 +1396,21 @@ LB78A ldx GP.ParamL ldy GP.FIAUXTYPE+1 LB79D txa pha - lda GP.MLIRW.REFNUM - lsr - ror - ror - ror - tax + jsr BS.GetFTableIdx pla sta XBC5A,x sta XBBFF tya sta XBC5B,x sta XBC00 - lda #MLI.C.GETEOF + lda #MLI.C.GETEOF jsr GP.GOSYSTEM bcs LB788 - lda XBC00 + lda XBC00 bne LB7C8 - lda XBBFF + lda XBBFF cmp #$02 bcc LB7CD @@ -1426,7 +1420,7 @@ LB7C8 jsr LB7D0 LB7CD jmp LB74B LB7D0 ldx #$03 -LB7D2 lda GP.MLIMRKEOFBUF.REFNUM,x +LB7D2 lda GP.MLIMRKEOFBUF.REFNUM,x sta XBC09,x dex bne LB7D2 @@ -1439,10 +1433,10 @@ LB7E3 jsr BS.TMPBUF3x2 rol BS.TMPBUF4+3 rol XBC0E sec - lda BS.TMPBUF4+3 + lda BS.TMPBUF4+3 sbc XBBFF tax - lda XBC0E + lda XBC0E sbc XBC00 bcc LB805 @@ -1453,16 +1447,16 @@ LB7E3 jsr BS.TMPBUF3x2 LB805 dey bne LB7E3 - lda BS.TMPBUF4+3 + lda BS.TMPBUF4+3 ora XBC0E clc beq LB839 - lda XBBFF + lda XBBFF sec sbc BS.TMPBUF4+3 tax - lda XBC00 + lda XBC00 sbc XBC0E tay txa @@ -1472,34 +1466,64 @@ LB805 dey tya adc GP.SBUFADR+1 sta GP.SBUFADR+1 - lda GP.SBUFADR+2 + lda GP.SBUFADR+2 adc #$00 sta GP.SBUFADR+2 - lda #$02 + lda #$02 LB839 rts -BS.GetFileInfo lda #$0A +BS.GetFileInfo lda #$0A sta GP.SSGINFO - lda #MLI.C.GETFILEINFO + lda #MLI.C.GETFILEINFO bne LB858 BS.SetFileInfoNoDate - lda #$00 - sta GP.FIMDATE - sta GP.FIMDATE+1 - sta GP.FICDATE - sta GP.FICDATE+1 + stz GP.FIMDATE + stz GP.FIMDATE+1 + stz GP.FICDATE + stz GP.FICDATE+1 -BS.SetFileInfo lda #$07 +BS.SetFileInfo lda #$07 sta GP.SSGINFO - lda #MLI.C.SETFILEINFO + lda #MLI.C.SETFILEINFO LB858 jmp GP.GOSYSTEM BS.JMP.GP.VSYSO jmp (GP.VSYSO) BS.JMP.GP.VSYSI jmp (GP.VSYSI) *-------------------------------------- +BS.ToUpper cmp #'a' + bcc .9 + + cmp #'z'+1 + bcs .9 + + eor #$20 + +.9 rts +*-------------------------------------- +BS.GetFTableIdx lda GP.MLIRW.REFNUM + lsr + ror + ror + ror + tax + rts +*-------------------------------------- +BS.SetSBUFADRXY0 + stz GP.SBUFADR+2 + +BS.SetSBUFADRXY stx GP.SBUFADR + sty GP.SBUFADR+1 + rts +*-------------------------------------- +BS.ZeroSBUFADR lda #0 + sta GP.SBUFADR + sta GP.SBUFADR+1 + sta GP.SBUFADR+2 + rts +*-------------------------------------- MAN SAVE usr/src/basic.fx/basic.s.c LOAD usr/src/basic.fx/basic.s diff --git a/BASIC.FX/BASIC.S.D.txt b/BASIC.FX/BASIC.S.D.txt index 6d242a48..1fe334bc 100644 --- a/BASIC.FX/BASIC.S.D.txt +++ b/BASIC.FX/BASIC.S.D.txt @@ -1,5 +1,10 @@ NEW AUTO 3,1 +*-------------------------------------- + .LIST ON +BS.FREESPACE .EQ $B861-* + .BS BS.FREESPACE + .LIST OFF *-------------------------------------- BS.SYSIOVECTS .DA BS.IO.OUT .DA BS.IO.IN @@ -7,8 +12,8 @@ BS.SYSIOVECTS .DA BS.IO.OUT .DA BS.IO.IN0 .DA BS.IO.OUT.CAT .DA BS.IO.IN0 -BS.VSYSO.LO .DA #$A7 -BS.VSYSO.HI .DA #$9D +BS.VSYSO.LO .DA #BS.VSYSO +BS.VSYSO.HI .DA /BS.VSYSO BS.ParamLByte .DA #$A0 .DA #$AC .DA #$AF @@ -125,15 +130,15 @@ BS.KW.LEN .DA #$BF .DA #$B5 .DA #$D8 BS.KW.TABLE .AS "BSAVERIFYBLOADELETEBYECATALOGOPENWRITEXECREATEFRESTORENAMEBRUNLOCKCHAIN#FLUSHREADPOSITIONOMONPR#PREFIXCLOSEAPPEND" -BS.KW.JMP .DA BS.JMP.XTRNADDR +BS.KW.JMP .DA BS.JMP.XTRNADDR $00 .DA BS.KW.PR .DA BS.KW.IN .DA BS.KW.CAT .DA BS.KW.01 .DA BS.KW.BYE - .DA BS.KW.02 + .DA BS.KW.RUN .DA BS.KW.BRUN - .DA BS.KW.EXEC + .DA BS.KW.EXEC $10 .DA BS.KW.RESTORE .DA BS.KW.LOCK .DA BS.KW.03 @@ -141,7 +146,7 @@ BS.KW.JMP .DA BS.JMP.XTRNADDR .DA BS.KW.STORE .DA BS.KW.BLOAD .DA BS.KW.BSAVE - .DA BS.KW.X05 + .DA BS.KW.X05 $20 .DA BS.KW.X06 .DA BS.KW.FLUSH .DA BS.KW.X07 @@ -149,7 +154,7 @@ BS.KW.JMP .DA BS.JMP.XTRNADDR .DA BS.KW.X08 .DA BS.KW.X09 .DA BS.KW.CREATE - .DA BS.KW.DELETE + .DA BS.KW.DELETE $30 .DA BS.KW.PREFIX .DA BS.KW.RENAME .DA BS.KW.UNLOCK @@ -157,7 +162,7 @@ BS.KW.JMP .DA BS.JMP.XTRNADDR .DA BS.KW.CATALOG .DA BS.KW.LOAD .DA BS.KW.CLOSE - .DA BS.KW.APPEND + .DA BS.KW.APPEND $40 BS.KW.PBITS .DA $8040 .DA $8040 .DA $0495 @@ -583,7 +588,7 @@ XBBB5 .BS 2 XBBB7 .BS 1 XBBB8 .BS 1 BS.IsIntCmdMTR ldy #$02 -LBBBB lda BS.CMDBUF,y +LBBBB lda BS.CMDBUF,y cmp BS.MTR,y bne LBBCF dey diff --git a/BASIC.FX/BASIC.S.GP..txt b/BASIC.FX/BASIC.S.GP..txt index 37fe2087..55f757ba 100644 --- a/BASIC.FX/BASIC.S.GP..txt +++ b/BASIC.FX/BASIC.S.GP..txt @@ -74,7 +74,7 @@ GP.GOSYSTEM sta GP.GOSYSTEM.C stx BS.CALLX and #$1F tax - lda BS.ParamLByte,x + lda BS.ParamLByte,x sta GP.GOSYSTEM.P ldx BS.CALLX jsr MLI @@ -93,7 +93,7 @@ LBE8D cmp BS.MLIERTBL,x ldx #$13 -LBE97 lda BS.BIERRTBL,x +LBE97 lda BS.BIERRTBL,x ldx BS.CALLX sec diff --git a/BASIC.FX/BASIC.S.LDR.txt b/BASIC.FX/BASIC.S.LDR.txt index c3a2a70c..9aa5d1bc 100644 --- a/BASIC.FX/BASIC.S.LDR.txt +++ b/BASIC.FX/BASIC.S.LDR.txt @@ -7,53 +7,53 @@ LDR.SIG .DA $EEEE LDR.STARTUP.LEN .DA #7 LDR.STARTUP .AS "STARTUP" .BS MLI.MAXPATH-7 -LDR.START1 lda #$9A +LDR.START1 lda #$9A sta Ptr2+1 - lda #$24 + lda #$24 sta Ptr1+1 - lda #$00 + lda #$00 sta Ptr1 sta Ptr2 ldx #$23 tay jsr LDR.MoveXpages ldx #$01 - lda #$BE + lda #$BE sta Ptr2+1 jsr LDR.MoveXpages - lda #$15 + lda #$15 jsr MON.COUT jsr MON.SETNORM jsr MON.INIT jsr MON.MON ldx #$17 - lda #$00 + lda #$00 L2076 sta MLI.MEMTABL,x dex bne L2076 - lda #$CF + lda #$CF sta MLI.MEMTABL - lda #$3F + lda #$3F sta MLI.MEMTABL+19 - lda #$FF + lda #$FF sta MLI.MEMTABL+20 sta MLI.MEMTABL+21 sta MLI.MEMTABL+22 - lda #$C3 + lda #$C3 sta MLI.MEMTABL+23 - lda AS.COLDBOOT + lda AS.COLDBOOT cmp #$4C bne L20B1 - lda MLI.MACHID + lda MLI.MACHID and #$20 beq L20B1 ldx #$03 -L20A6 lda LDR.CSWVECT,x +L20A6 lda LDR.CSWVECT,x sta ZP.CSW,x dex bpl L20A6 @@ -62,7 +62,7 @@ L20A6 lda LDR.CSWVECT,x L20B1 ldx #$27 -L20B3 lda LDR.UNABLE,x +L20B3 lda LDR.UNABLE,x sta $628,x dex bpl L20B3 @@ -73,7 +73,7 @@ L20B3 lda LDR.UNABLE,x L20C2 bmi L20C2 LDR.MoveXpages dey - lda (Ptr1),y + lda (Ptr1),y sta (Ptr2),y tya bne LDR.MoveXpages @@ -88,11 +88,11 @@ L20D3 rts LDR.CSW cmp #$DD bne L20D3 - lda GP.OUTVECT0 + lda GP.OUTVECT0 sta ZP.CSW - lda GP.OUTVECT0+1 + lda GP.OUTVECT0+1 sta ZP.CSW+1 - lda MLI.DEVNUM + lda MLI.DEVNUM sta LDR.ONLINE.P.DEVNUM ldx #$01 asl @@ -109,14 +109,14 @@ L20EE stx GP.VDEFDRV sta GP.VDEFSLT ldx #$C1 ldy #$02 - lda MLI.SLTBYT + lda MLI.SLTBYT lsr L2102 lsr pha bcc L2115 - lda #$00 + lda #$00 sta GP.OUTVECT0,y sta GP.INVECT0,y txa @@ -129,11 +129,11 @@ L2115 iny pla bne L2102 - lda #$96 + lda #$96 sta AS.HIMEM+1 sta AS.STRINGSTART+1 sta GP.RSHIMEM - lda MLI.PFIXPTR + lda MLI.PFIXPTR beq L214E jsr MLI @@ -142,7 +142,7 @@ L2115 iny bne L218B ldx MLI.PATHBUF - lda #$2F + lda #$2F L2136 cmp MLI.PATHBUF,x bne L213E @@ -152,7 +152,7 @@ L2136 cmp MLI.PATHBUF,x L213E dex bne L2136 - lda LDR.PFXLEN + lda LDR.PFXLEN cmp #$03 bcs L216F @@ -165,14 +165,14 @@ L214E jsr MLI .DA LDR.ONLINE.P bne L218B - lda MLI.PATHBUF+1 + lda MLI.PATHBUF+1 and #$0F beq L218B tax inx stx MLI.PATHBUF - lda #$2F + lda #$2F sta MLI.PATHBUF+1 jsr MLI .DA #MLI.C.SETPREFIX @@ -187,15 +187,15 @@ L216F jsr MLI ldx LDR.STARTUP.LEN stx LDR.STARTUP.LEN1 -L217D lda LDR.STARTUP.LEN,x +L217D lda LDR.STARTUP.LEN,x sta IO.LINEBUF,x dex bne L217D - lda #$AD + lda #$AD sta IO.LINEBUF -L218B lda LDR.PFXLEN +L218B lda LDR.PFXLEN cmp #$03 bcs L2198 @@ -203,52 +203,52 @@ L218B lda LDR.PFXLEN .DA #MLI.C.SETPREFIX .DA LDR.GETSETPFX1.P -L2198 lda LDR.STARTUP.LEN1 +L2198 lda LDR.STARTUP.LEN1 bne L21C1 jsr LDR.KSW ldx #$1C -L21A2 lda LDR.PRODOSBASIC,x +L21A2 lda LDR.PRODOSBASIC,x sta $400,x dex bpl L21A2 ldx #$1F -L21AD lda LDR.COPYRIGHT,x +L21AD lda LDR.COPYRIGHT,x sta $480,x dex bpl L21AD - lda #$8D + lda #$8D jsr MON.COUT1 jsr MON.COUT1 jsr MON.COUT1 L21C1 ldx #$02 -L21C3 lda LDR.JMP.GP.ENTRY,x +L21C3 lda LDR.JMP.GP.ENTRY,x sta DOS.WARMSTART,x sta DOS.COLDSTART,x sta MON.USRJMP,x - lda LDR.AMPERSANDJMP,x + lda LDR.AMPERSANDJMP,x sta MON.AMPERSANDJMP,x dex bpl L21C3 - lda LDR.BRKVECT + lda LDR.BRKVECT sta MON.BRKVECT - lda LDR.BRKVECT+1 + lda LDR.BRKVECT+1 sta MON.BRKVECT+1 - lda LDR.POWERUP + lda LDR.POWERUP sta MON.POWERUP - lda LDR.POWERUP+1 + lda LDR.POWERUP+1 sta MON.POWERUP+1 eor #$A5 sta MON.POWERUPBYTE - lda #$A5 + lda #$A5 sta AS.TRCFLG - lda BS.IVERSION + lda BS.IVERSION sta MLI.IVERSION LDR.JMP.GP.ENTRY @@ -260,13 +260,13 @@ LDR.POWERUP .DA GP.ENTRY LDR.AMPERSANDJMP jmp GP.DOSCMD -LDR.KSW lda GP.INVECT0 +LDR.KSW lda GP.INVECT0 sta ZP.KSW - lda GP.INVECT0+1 + lda GP.INVECT0+1 sta ZP.KSW+1 ldx LDR.STARTUP.LEN inx - lda #$8D + lda #$8D rts LDR.CSWVECT .DA LDR.CSW @@ -279,11 +279,9 @@ LDR.GFINFO.P.PATHBUF LDR.GETSETPFX1.P .DA #1 -LDR.GETSETPFX1.P.BUF - .DA LDR.GETSETPFX1.SLASHLEN -LDR.GETSETPFX1.SLASHLEN - .DA #1 + .DA LDR.GETSETPFX1.SLASH LDR.GETSETPFX1.SLASH + .DA #1 .AS "/" LDR.STARTUP.LEN1 .DA #0 @@ -295,13 +293,12 @@ LDR.ONLINE.P.BUF .DA MLI.PATHBUF+1 LDR.GETSETPFX2.P .DA #1 -LDR.GETSETPFX2.P.BUF .DA MLI.PATHBUF LDR.PFXLEN .DA #0 LDR.UNABLE .AS -"*** UNABLE TO EXECUTE BASIC SYSTEM ***" -LDR.PRODOSBASIC .AS -" PRODOS BASIC 1.5 " -LDR.COPYRIGHT .AS -" COPYRIGHT APPLE 1983-92" +LDR.PRODOSBASIC .AS -" PRODOS BASIC FX" +LDR.COPYRIGHT .AS -" COPYRIGHT APPLE 1983-92" .BS $2400-* *-------------------------------------- MAN diff --git a/BASIC.FX/BASIC.S.txt b/BASIC.FX/BASIC.S.txt index 4154900a..80e15a52 100644 --- a/BASIC.FX/BASIC.S.txt +++ b/BASIC.FX/BASIC.S.txt @@ -1,9 +1,36 @@ NEW AUTO 3,1 .LIST OFF - .OP 6502 + .OP 65c02 .OR $2000 - .TF BASIC.FX,TSYS + .TF BASIC.SYSTEM,TSYS +*-------------------------------------- + .MA DEBUG +:1 bit $C000 + bpl :1 + sta $C010 + .EM +*-------------------------------------- +LOWERCASE .EQ 1 +*-------------------------------------- +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.AD .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 *-------------------------------------- Ptr1 .EQ 0 Ptr2 .EQ 2 diff --git a/ProDOS.FX/ProDOS.S.ILDR.txt b/ProDOS.FX/ProDOS.S.ILDR.txt index 1b3bebba..7d84a596 100644 --- a/ProDOS.FX/ProDOS.S.ILDR.txt +++ b/ProDOS.FX/ProDOS.S.ILDR.txt @@ -27,8 +27,9 @@ ILDR.ENUMPM .DO PM jsr ILDR.EnumInit .1 ldx #S.FI.T.BIN - ldy #ILDR.KMSFX - lda /ILDR.KMSFX + ldy #ILDR.KMPFX + lda /ILDR.KMPFX + clc prefix jsr ILDR.EnumNext bcs .4 @@ -65,6 +66,7 @@ ILDR.ENUMPM .DO PM ldx #S.FI.T.SYS ldy #ILDR.SYSTEMSFX lda /ILDR.SYSTEMSFX + sec suffix jsr ILDR.EnumNext bcs .9 @@ -151,11 +153,13 @@ ILDR.EnumInit.RTS rts *-------------------------------------- * X = expected FileType -* Y,A = expected suffix +* Y,A = expected prefix/suffix *-------------------------------------- ILDR.EnumNext stx ILDR.FT sty src sta src+1 + + ror ILDR.bPFXSFX .1 inc ILDR.nFC bne .2 @@ -208,9 +212,12 @@ ILDR.EnumNext stx ILDR.FT cmp ILDR.FT expected file type bne .1 - lda (src) expected suffix len + lda (src) expected prefix/suffix len cmp pbuf - bcs .1 filename LE suffix + bcs .1 filename LE prefix/suffix + + bit ILDR.bPFXSFX + bpl .12 go check prefix tay ldx pbuf @@ -223,8 +230,20 @@ ILDR.EnumNext stx ILDR.FT dex dey bne .11 + bra .15 + +.12 lda (src) expected prefix/suffix len + tay - ldy #$1D MIN_VERSION +.13 lda pbuf,y + eor (src),y + asl + bne .1 + + dey + bne .13 + +.15 ldy #$1D MIN_VERSION lda (idxl),y bpl .10 no lowercase information @@ -335,8 +354,8 @@ ILDR.QUIT .DA #4 PARAM CNT *-------------------------------------- ILDR.ATINIT .DA #6 .AS "ATINIT" -ILDR.KMSFX .DA #3 - .AS ".PM" +ILDR.KMPFX .DA #3 + .AS "PM." ILDR.SYSTEMSFX .DA #7 .AS ".SYSTEM" *-------------------------------------- @@ -348,6 +367,7 @@ ILDR.EL .BS 1 ILDR.nFC .BS 2 ILDR.FT .BS 1 ILDR.EITB .BS 1 +ILDR.bPFXSFX .BS 1 .ED *-------------------------------------- MAN diff --git a/ProDOS.FX/ProDOS.S.txt b/ProDOS.FX/ProDOS.S.txt index 973c7b62..9c52bba7 100644 --- a/ProDOS.FX/ProDOS.S.txt +++ b/ProDOS.FX/ProDOS.S.txt @@ -3,7 +3,7 @@ NEW .LIST OFF .OP 65816 .OR $2000 - .TF PRODOS.FX,TSYS + .TF PRODOS,TSYS *-------------------------------------- READCAT .EQ 0 Boot Block read Catalog at $C00 ENHFILENAME .EQ 1 diff --git a/SBIN/VEDD.S.txt b/SBIN/VEDD.S.txt index 8c6d5862..db4d2f1c 100644 --- a/SBIN/VEDD.S.txt +++ b/SBIN/VEDD.S.txt @@ -299,6 +299,10 @@ CS.QUIT .8 clc rts *-------------------------------------- +* +*-------------------------------------- +CS.DRV +*-------------------------------------- CS.END *-------------------------------------- * Initialized DATA diff --git a/SYS/KERNEL.S.INIT.txt b/SYS/KERNEL.S.INIT.txt index 0cdac4a4..0f069095 100644 --- a/SYS/KERNEL.S.INIT.txt +++ b/SYS/KERNEL.S.INIT.txt @@ -460,19 +460,18 @@ CPU.Init >PUSHWI MSG.CPU >PUSHBI 1 >SYSCALL2 printf - ldy #0 - stz A2osX.CPUSPEED+1 + ldx A2osX.HZ + ldy #0 + php sei - ldx A2osX.HWType - cpx #A2osX.HWType.IIc + lda A2osX.HWType + cmp #A2osX.HWType.IIc beq CPU.Init2c - ldx A2osX.HZ - .1 bit VBL //e : Wait VBL high.... bpl .1 @@ -489,8 +488,6 @@ CPU.Init >PUSHWI MSG.CPU pla (4) pha (3) pla (4) - pha (3) - pla (4) iny cpy #100 @@ -507,21 +504,22 @@ CPU.Init >PUSHWI MSG.CPU bra CPU.InitOK *-------------------------------------- -CPU.Init2c sta CLRIOUDIS +CPU.Init2c lda RDIOUDIS + pha + sta CLRIOUDIS + lda IO.IIC.RDVBLMSK pha Save VBLIRQ enable - sta IO.IIC.ENVBL - lda IO.IIC.CLRVBLIRQ - ldx A2osX.HZ + lda IO.IIC.CLRVBLIRQ .1 bit VBL Wait VBL high.... bpl .1 bit IO.IIC.CLRVBLIRQ clear //c IRQ -.3 lda #40 +.3 lda #60 .4 pha (3) pla (4) @@ -547,9 +545,14 @@ CPU.Init2c sta CLRIOUDIS bne .3 pla Disable VBLIRQ ? - bpl CPU.InitOk + bpl .8 sta IO.IIC.DISVBL + +.8 pla + bpl CPU.InitOk + + sta SETIOUDIS *-------------------------------------- CPU.InitOk plp diff --git a/SYS/KM.APPLETALK.S.txt b/SYS/KM.APPLETALK.S.txt index d269b949..28d24cac 100644 --- a/SYS/KM.APPLETALK.S.txt +++ b/SYS/KM.APPLETALK.S.txt @@ -3,7 +3,7 @@ NEW .LIST OFF .OP 65C02 .OR $2000 - .TF sys/km/km.appletalk + .TF sys/pm/pm.appletalk *-------------------------------------- .INB inc/macros.i .INB inc/io.i @@ -177,5 +177,5 @@ MLI.AT.FINaming .DA #0 Synchonous .DA #%10000000 b7=1:Use AFP long Name, b6=0:Update ProDOS dev table *-------------------------------------- MAN -SAVE usr/src/sys/km.appletalk.s +SAVE usr/src/sys/pm.appletalk.s ASM diff --git a/SYS/KM.NSC.S.txt b/SYS/KM.NSC.S.txt index 7d4dd8fc..988f51ea 100644 --- a/SYS/KM.NSC.S.txt +++ b/SYS/KM.NSC.S.txt @@ -3,7 +3,7 @@ NEW .LIST OFF .OP 65C02 .OR $2000 - .TF sys/km/km.nsc + .TF sys/pm/pm.nsc *-------------------------------------- .INB inc/macros.i .INB inc/io.i @@ -319,5 +319,5 @@ NSCDRV.SIZE .EQ *-NSCDRV.B.START .FIN *-------------------------------------- MAN -SAVE usr/src/sys/km.nsc.s +SAVE usr/src/sys/pm.nsc.s ASM diff --git a/SYS/KM.RAMWORKS.S.txt b/SYS/KM.RAMWORKS.S.txt index d4bfd9fc..1420d377 100644 --- a/SYS/KM.RAMWORKS.S.txt +++ b/SYS/KM.RAMWORKS.S.txt @@ -3,8 +3,7 @@ NEW .LIST OFF .OP 65C02 .OR $2000 - .TF sys/km/km.ramworks -* .TF ramworks.pm + .TF sys/pm/pm.ramworks *-------------------------------------- .INB inc/macros.i .INB inc/io.i @@ -793,5 +792,5 @@ RWDRVX.SIZE .EQ RWDRVX.B.END-RWDRVX.B.START .FIN *-------------------------------------- MAN -SAVE usr/src/sys/km.ramworks.s +SAVE usr/src/sys/pm.ramworks.s ASM diff --git a/SYS/KM.VEDRIVE.S.CF.txt b/SYS/KM.VEDRIVE.S.CF.txt index 682f9850..371d30e6 100644 --- a/SYS/KM.VEDRIVE.S.CF.txt +++ b/SYS/KM.VEDRIVE.S.CF.txt @@ -374,6 +374,6 @@ VEDRIVE.GetCharPtr1 .9 rts *-------------------------------------- MAN -SAVE usr/src/sys/km.vedrive.s.cf -LOAD usr/src/sys/km.vedrive.s +SAVE usr/src/sys/pm.vedrive.s.cf +LOAD usr/src/sys/pm.vedrive.s ASM diff --git a/SYS/KM.VEDRIVE.S.GS.txt b/SYS/KM.VEDRIVE.S.GS.txt index 7e88e826..61a724a2 100644 --- a/SYS/KM.VEDRIVE.S.GS.txt +++ b/SYS/KM.VEDRIVE.S.GS.txt @@ -12,6 +12,6 @@ DRV.GS .EQ * .EP *-------------------------------------- MAN -SAVE usr/src/sys/km.vedrive.s.gs -LOAD usr/src/sys/km.vedrive.s +SAVE usr/src/sys/pm.vedrive.s.gs +LOAD usr/src/sys/pm.vedrive.s ASM diff --git a/SYS/KM.VEDRIVE.S.IP.txt b/SYS/KM.VEDRIVE.S.IP.txt index 8eebba1e..980e5361 100644 --- a/SYS/KM.VEDRIVE.S.IP.txt +++ b/SYS/KM.VEDRIVE.S.IP.txt @@ -524,6 +524,6 @@ VEDRIVE.CheckARPFrame rts *-------------------------------------- MAN -SAVE usr/src/sys/km.vedrive.s.ip -LOAD usr/src/sys/km.vedrive.s +SAVE usr/src/sys/pm.vedrive.s.ip +LOAD usr/src/sys/pm.vedrive.s ASM diff --git a/SYS/KM.VEDRIVE.S.U1.txt b/SYS/KM.VEDRIVE.S.U1.txt index 045911df..d3400516 100644 --- a/SYS/KM.VEDRIVE.S.U1.txt +++ b/SYS/KM.VEDRIVE.S.U1.txt @@ -6,8 +6,7 @@ U1.Init lda CONF.SLOT asl asl asl - sta DRV.U1+2 set DRV.U1.Slotn0 - + sta Slotn0 tax lda /PP.ID @@ -47,7 +46,7 @@ U1.Init lda CONF.SLOT >LDYAI VEDRIVE.NICOK jsr PrintFYA - ldx DRV.U1+2 + ldx Slotn0 lda /PP.RxCTL sta PacketPagePTR+1,x @@ -104,7 +103,7 @@ U1.Init lda CONF.SLOT U1.READ php sei - ldx DRV.U1+2 + ldx Slotn0 lda /PP.RxEvent sta PacketPagePTR+1,x @@ -129,7 +128,7 @@ U1.READ php eor #$ff sta ZPnCnt - ldx DRV.U1+2 + ldx Slotn0 lda ZPBufPtr+1 pha @@ -174,7 +173,7 @@ U1.READWRITE.9 plp U1.WRITE php sei - ldx DRV.U1+2 + ldx Slotn0 lda /PP.TxCMD.LID+PP.TxCMD.TxStartFULL sta TxCMD+1,x @@ -201,7 +200,7 @@ U1.WRITE php bit /PP.BusST.Rdy4TxNOW beq U1.READWRITE.9 - ldx DRV.U1+2 + ldx Slotn0 ldy #0 @@ -237,12 +236,10 @@ U1.Name >PSTR "Uthernet V1" *-------------------------------------- DRV.U1 .EQ * .PH $D400 - cld - ldx #$ff SELF MODIFIED .EP *-------------------------------------- MAN -SAVE usr/src/sys/km.vedrive.s.u1 -LOAD usr/src/sys/km.vedrive.s +SAVE usr/src/sys/pm.vedrive.s.u1 +LOAD usr/src/sys/pm.vedrive.s ASM diff --git a/SYS/KM.VEDRIVE.S.U2.txt b/SYS/KM.VEDRIVE.S.U2.txt index af58f865..1090a55c 100644 --- a/SYS/KM.VEDRIVE.S.U2.txt +++ b/SYS/KM.VEDRIVE.S.U2.txt @@ -8,9 +8,9 @@ U2.Init lda CONF.SLOT asl clc adc #$88 - sta DRV.U2+2 set DRV.U2.Slotn0 + sta Slotn0 tax - + lda #W5100.MR.RST sta W5100.MR,x @@ -56,7 +56,7 @@ U2.Init lda CONF.SLOT >LDYAI VEDRIVE.NICOK jsr PrintFYA - ldx DRV.U2+2 + ldx Slotn0 lda #W5100.MR.PB+W5100.MR.AI+W5100.MR.IND sta W5100.MR,x @@ -83,14 +83,13 @@ U2.Init lda CONF.SLOT lda #W5100.AR.Sn.CR.OPEN sta W5100.DR,x - clc rts *-------------------------------------- U2.Read php sei - ldx DRV.U2+2 + ldx Slotn0 >AR.SELECT S0.RX.RSR lda W5100.DR,x get the received size HI @@ -180,7 +179,7 @@ U2.READWRITE.9 plp U2.Write php sei - ldx DRV.U2+2 + ldx Slotn0 lda ZPBufCnt eor #$ff @@ -252,13 +251,181 @@ Offset .BS 2 TotalSize .BS 2 *-------------------------------------- DRV.U2 .EQ * - .PH $D400 - cld - ldx #$ff SELF MODIFIED + .PH DRV.NIC.START + +DRV.U2.START jmp DRV.U2.Write + +DRV.U2.Read php + sei + + ldx DRV.START + + >AR.SELECT S0.RX.RSR + lda W5100.DR,x get the received size HI + nop + nop + ora W5100.DR,x LO + bne .1 + + jmp DRV.U2.9 + +.1 >AR.SELECT S0.RX.RD + lda W5100.DR,x get the received ptr HI + sta Offset+1 + ldy W5100.DR,x get the received ptr LO + sty Offset + + and /RXTX.MASK + ora /RX.BASE + sta W5100.AR,x + tya + sta W5100.AR+1,x + + lda W5100.DR,x get RX.Size HI (Frame size + 2) + sta TotalSize+1 + lda W5100.DR,x get RX.Size LO + sta TotalSize + + sec + sbc #2 MACRAW:strip 2 bytes Header from Size + sta ZPBufCnt + eor #$ff + sta ZPnCnt + + lda TotalSize+1 + sbc #0 + sta ZPBufCnt + eor #$ff + sta ZPnCnt+1 + + lda ZPBufPtr+1 + pha + + ldy #0 + +.2 inc ZPnCnt + bne .3 + + inc ZPnCnt+1 + beq .8 + +.3 lda W5100.DR,x + sta (ZPBufPtr),y + iny + bne .2 + + inc ZPBufPtr+1 + bra .2 + +.8 >AR.SELECT S0.RX.RD + + lda Offset + clc + adc TotalSize + pha save LO + + lda Offset+1 + adc TotalSize+1 + sta W5100.DR,x write HI + pla + sta W5100.DR,x write LO + + >AR.SELECT S0.CR + lda #W5100.AR.Sn.CR.RCVD + sta W5100.DR,x + + pla + sta ZPBufPtr+1 + + plp + clc + rts +*-------------------------------------- +DRV.U2.9 plp + sec + rts +*-------------------------------------- +DRV.U2.Write php + sei + + >STYA ZPBufCnt + + eor #$ff + sta ZPnCnt+1 + + tya + eor #$ff + sta ZPnCnt + + >LDYA DRV.OutBuf + >STYA ZPBufPtr + + ldx DRV.START + + >AR.SELECT S0.TX.FSR + lda W5100.DR,x get send size HI + nop + nop + ldy W5100.DR,x LO + cpy ZPBufCnt + sbc ZPBufCnt+1 + bcc DRV.U2.9 + + >AR.SELECT S0.TX.WR + lda W5100.DR,x Get HI + nop + nop + ldy W5100.DR,x Get LO + and /RXTX.MASK + ora /TX.BASE + sta W5100.AR,x Write HI + sta Offset+1 + tya + sta W5100.AR+1,x Write LO + sta Offset + + ldy #0 + +.2 inc ZPnCnt + bne .3 + + inc ZPnCnt+1 + beq .8 + +.3 lda (ZPBufPtr),y + sta W5100.DR,x + iny + bne .2 + + inc ZPBufPtr+1 + bra .2 + +.8 >AR.SELECT S0.TX.WR + lda Offset + clc + adc ZPBufCnt + pha save LO + lda Offset+1 + adc ZPBufCnt+1 + sta W5100.DR,x write HI + pla + sta W5100.DR,x write LO + + >AR.SELECT S0.CR + lda #W5100.AR.Sn.CR.SEND + sta W5100.DR,x + + plp + clc + rts .EP + + .LIST ON +DRV.U2.SIZE .EQ *-DRV.U2 + .LIST OFF *-------------------------------------- MAN -SAVE usr/src/sys/km.vedrive.s.u2 -LOAD usr/src/sys/km.vedrive.s +SAVE usr/src/sys/pm.vedrive.s.u2 +LOAD usr/src/sys/pm.vedrive.s ASM diff --git a/SYS/KM.VEDRIVE.S.txt b/SYS/KM.VEDRIVE.S.txt index 90a9cc5b..850fc55c 100644 --- a/SYS/KM.VEDRIVE.S.txt +++ b/SYS/KM.VEDRIVE.S.txt @@ -3,8 +3,8 @@ NEW .LIST OFF .OP 65C02 .OR $2000 -* .TF sys/km.vedrive - .TF vedrive.pm +* .TF sys/pm/pm.vedrive + .TF sys/pm.vedrive *-------------------------------------- .INB inc/macros.i .INB inc/io.i @@ -31,11 +31,12 @@ ZPCheckSum .EQ 14 timerS .EQ 16 timerC .EQ 17 bRemoteMac .EQ 18 +Slotn0 .EQ 19 *-------------------------------------- ADT.CMD.VSD .EQ $C5 "E": Virtual Drive Command Envelope ADT.CMD.PING .EQ $D9 "Y": PING DRV.EntryPoint .EQ $BF41 -DRV.ADDR .EQ $D400 +DRV.NIC.START .EQ $D500 *-------------------------------------- CONF.FBUF .EQ $4000 CONF.LBUF .EQ $4400 @@ -67,7 +68,6 @@ VEDRIVE.Init >LDYAI VEDRIVE.MSG0 rts .3 jsr VEDRIVE.MACInit - lda CONF.ADDRESS bne .4 @@ -111,7 +111,7 @@ VEDRIVE.Init >LDYAI VEDRIVE.MSG0 .7 >LDYAI VEDRIVE.SRVOK jsr PrintFYA - jsr VEDRIVE.SetSlot +* jsr VEDRIVE.SetSlot bcc .8 >LDYAI VEDRIVE.NOSLOT @@ -135,22 +135,20 @@ VEDRIVE.Init >LDYAI VEDRIVE.MSG0 rts *-------------------------------------- VEDRIVE.CheckDRV - bit RRAMWRAMBNK2 - bit RRAMWRAMBNK2 - - clc - lda $D400 - eor #$D8 CLD - bne .8 - - lda $D401 - eor #$A2 LDX #imm - bne .8 + ldx #COPYRIGHT.LEN sec -.8 bit RROMBNK1 - rts +.1 lda DRV.EntryPoint-1,x + eor COPYRIGHT-1,x + bne .9 + + dex + bne .1 + + clc + +.9 rts *-------------------------------------- VEDRIVE.Ping lda CONF.PORT sta ADT.REQ.UDP.DST @@ -287,28 +285,93 @@ VEDRIVE.SetSlot ldx #2 Starts at Slot1 *-------------------------------------- VEDRIVE.Install ldx #PATCH.SIZE -.1 lda PATCH-1,x - sta DRV.EntryPoint-1,x - dex - bne .1 +*.1 lda PATCH-1,x +* sta DRV.EntryPoint-1,x +* dex +* bne .1 bit RRAMWRAMBNK2 bit RRAMWRAMBNK2 + ldy #DRV.SIZE-1 +.2 lda DRV,y + sta DRV.START,y + dey + bne .2 + lda Slotn0 + sta DRV.START + ldy #DRV.IP.SIZE-1 + +.3 lda DRV.IP,y + sta DRV.IP.START,y + dey + bne .3 + ldx CONF.NIC + lda .10,x + sta ZPPtr1 + lda .10+1,x + sta ZPPtr1+1 + + lda .20,x + eor #$ff + sta ZPnCnt + lda .20+1,x + eor #$ff + sta ZPnCnt+1 + + lda #DRV.NIC.START + sta ZPPtr2 + lda /DRV.NIC.START + sta ZPPtr2+1 + + ldy #0 + +.4 inc ZPnCnt + bne .5 + + inc ZPnCnt+1 + beq .6 + +.5 lda (ZPPtr1),y + sta (ZPPtr2),y + iny + bne .4 + + inc ZPPtr1+1 + inc ZPPtr2+1 + bra .4 + +.6 ldy #S.UDP + +.7 lda ADT.REQ-1,y + sta DRV.OutBuf-1,y + dey + bne .7 + bit RROMBNK1 clc rts +*-------------------------------------- +.10 .DA DRV.U2 + .DA DRV.U2 + .DA DRV.U2 +*-------------------------------------- +.20 .DA DRV.U2.SIZE + .DA DRV.U2.SIZE + .DA DRV.U2.SIZE *-------------------------------------- .INB usr/src/shared/x.printf.s *-------------------------------------- * ProDOS $BE41->$BE4B Patch for switching to BANK2 (10 bytes) *-------------------------------------- +COPYRIGHT .AS "(C)APPLE " +COPYRIGHT.LEN .EQ *-COPYRIGHT PATCH .PH DRV.EntryPoint bit RRAMWRAMBNK2 jsr $D002 @@ -338,13 +401,18 @@ DRV.UNITNUM .EQ $43 DRV.BUFF .EQ $44 DRV.BLKNUM .EQ $46 *-------------------------------------- -DRV.FrmBuf .EQ $DA00 Frame Buffer = 1536 bytes -DRV.FrmBuf.Env .EQ DRV.FrmBuf+S.UDP -DRV.FrmBuf.Cmd .EQ DRV.FrmBuf+S.UDP+1 -DRV.FrmBuf.BlkL .EQ DRV.FrmBuf+S.UDP+2 -DRV.FrmBuf.BlkH .EQ DRV.FrmBuf+S.UDP+3 -DRV.FrmBuf.Sum .EQ DRV.FrmBuf+S.UDP+4 -DRV.FrmBuf.Data .EQ DRV.FrmBuf+S.UDP+5 +DRV.Write .EQ DRV.NIC.START +DRV.Read .EQ DRV.NIC.START+3 +*-------------------------------------- +DRV.OutBuf .EQ $D800-S.UDP-6 Frame Buffer = S.UDP+5+512+1 bytes +DRV.OutBuf.Env .EQ DRV.OutBuf+S.UDP +DRV.OutBuf.Cmd .EQ DRV.OutBuf+S.UDP+1 +DRV.OutBuf.BlkL .EQ DRV.OutBuf+S.UDP+2 +DRV.OutBuf.BlkH .EQ DRV.OutBuf+S.UDP+3 +DRV.OutBuf.Sum .EQ DRV.OutBuf+S.UDP+4 +DRV.OutBuf.Data .EQ DRV.OutBuf+S.UDP+5 +*-------------------------------------- +DRV.InBuf .EQ $DA00 Frame Buffer = 1536 bytes *-------------------------------------- DRV .PH $D001 Main LC Bnk 2 $D001->$DFFF @@ -363,7 +431,7 @@ DRV.START .BS 1 SELF MODIFIED slot 0n .1 cmp #3 beq .8 Format .... -* bcs DRV.DO.CMD.ERR more....IO error + bcs DRV.DO.CMD.ERR more....IO error ora #2 W=2,R=3 ldy DRV.UNITNUM @@ -371,16 +439,16 @@ DRV.START .BS 1 SELF MODIFIED slot 0n adc #2 CC from bcs -.2 sta DRV.FrmBuf.Cmd store cmd +.2 sta DRV.OutBuf.Cmd store cmd eor #ADT.CMD.VSD eor DRV.BLKNUM eor DRV.BLKNUM+1 - sta DRV.FrmBuf.Sum Compute & store CheckSum + sta DRV.OutBuf.Sum Compute & store CheckSum lda DRV.BLKNUM - sta DRV.FrmBuf.BlkL + sta DRV.OutBuf.BlkL lda DRV.BLKNUM+1 - sta DRV.FrmBuf.BlkH + sta DRV.OutBuf.BlkH *-------------------------------------- lda DRV.COMMAND dec 1-1=0 if read @@ -388,48 +456,12 @@ DRV.START .BS 1 SELF MODIFIED slot 0n *-------------------------------------- * Read block *-------------------------------------- -DRV.DO.CMD.R ldy #3 Read Back and check 4 bytes +DRV.DO.CMD.R ldy #S.UDP+5 + lda /S.UDP+5 + jsr DRV.Write + -.1 eor DRV.FrmBuf.BlkH,y - bne DRV.DO.CMD.ERR - dey - bpl .1 - - ldy #4 Read 4 bytes DATE/TIME + 1 Byte Checksum - -.2 eor DRV.FrmBuf.Sum - sta DRV.FrmBuf.Sum - dey - bpl .2 - - tay Last EOR was with Checksum, must be 0 - bne DRV.DO.CMD.ERR - -* Y=0 from TAY - - stz DRV.FrmBuf.Sum - sec - -.3 jsr $100 - eor DRV.FrmBuf.Sum - sta DRV.FrmBuf.Sum - iny - bne .3 - bcc .4 - inc DRV.BUFF+1 - clc - bcc .3 - -.4 dec DRV.BUFF+1 - - eor DRV.FrmBuf.Sum - bne DRV.DO.CMD.ERR - rts A=0,CC from bcc .4 -*-------------------------------------- -DRV.DO.CMD.ERR1 - pla - pla DRV.DO.CMD.ERR lda #MLI.E.IO sec @@ -438,35 +470,9 @@ DRV.DO.CMD.ERR * Write Block *-------------------------------------- DRV.DO.CMD.W lda #$B1 lda (),y - - sta $103 - ldy #0 - - stz DRV.FrmBuf.Sum - + + lda #MLI.E.IO sec - -.1 - eor DRV.FrmBuf.Sum - sta DRV.FrmBuf.Sum - iny - bne .1 - bcc .2 - inc DRV.BUFF+1 - clc - bcc .1 -.2 dec DRV.BUFF+1 -* A = DRV.FrmBuf.Sum - - - -* read back CMD - ldy #4 Read 5 bytes (echo from server) -.3 - eor DRV.FrmBuf.Sum,y Check 5 bytes (including block Sum) - bne DRV.DO.CMD.ERR - dey - bpl .3 rts *-------------------------------------- DRV.RWBYTE bit RRAMWRAMBNK1 @@ -480,20 +486,174 @@ DRV.RWBYTE bit RRAMWRAMBNK1 DRV.SIZE .EQ *-DRV .LIST OFF *-------------------------------------- +DRV.IP .PH $D400 + +DRV.IP.START ldy #S.IP.TOTAL.LENGTH+1 + lda ZPBufCnt + sec + sbc #S.ETH.EII + sta (ZPBufPtr),y + dey + lda ZPBufCnt+1 + sbc /S.ETH.EII + sta (ZPBufPtr),y + lda #0 + ldy #S.IP.HDR.CHECKSUM + sta (ZPBufPtr),y + iny + sta (ZPBufPtr),y + + stz ZPCheckSum RESET IP CHECKSUM + stz ZPCheckSum+1 + + clc + + ldy #S.IP.V.IHL + + ldx #10 10 words for IP Header + +.1 lda (ZPBufPtr),y + adc ZPCheckSum + sta ZPCheckSum + iny + lda (ZPBufPtr),y + adc ZPCheckSum+1 + sta ZPCheckSum+1 + iny + dex + bne .1 + + ldy #S.IP.HDR.CHECKSUM + lda ZPCheckSum + adc #0 + eor #$FF + sta (ZPBufPtr),y + iny + lda ZPCheckSum+1 + adc #0 + eor #$FF + sta (ZPBufPtr),y + rts +*-------------------------------------- + clc + + ldy #S.UDP.LENGTH+1 + lda (ZPBufPtr),y + adc #S.IP.PROTOCOL.UDP + sta ZPCheckSum+1 + + dey + lda (ZPBufPtr),y + adc /S.IP.PROTOCOL.UDP (all zero) + sta ZPCheckSum + + ldy #S.IP.SRC + ldx #4 4 words for SRC & DST IP + +.2 lda (ZPBufPtr),y + adc ZPCheckSum + sta ZPCheckSum + iny + lda (ZPBufPtr),y + adc ZPCheckSum+1 + sta ZPCheckSum+1 + iny + dex + bne .2 + + ldy #S.UDP.LENGTH+1 + lda (ZPBufPtr),y + eor #$ff + tax + + dey + lda (ZPBufPtr),y + eor #$ff + ldy #S.UDP.CHECKSUM + + phy Save Offset + pha Save !ByteCount.HI + + lda #0 Reset Checksum + sta (ZPBufPtr),y + iny + sta (ZPBufPtr),y + + >LDYA ZPBufPtr + >STYA ZPPtr1 + + ldy #S.IP + +.3 inx + bne .4 + + pla + inc + beq .8 + + pha +.4 lda (ZPPtr1),y + adc ZPCheckSum + sta ZPCheckSum + + iny + bne .5 + + inc ZPPtr1+1 +.5 inx + bne .6 + + pla + inc + beq .7 + + pha + +.6 lda (ZPPtr1),y + + adc ZPCheckSum+1 + sta ZPCheckSum+1 + iny + bne .3 + + inc ZPPtr1+1 + bra .3 + +.7 adc ZPCheckSum+1 A=0 from beq .7 + sta ZPCheckSum+1 + +.8 ply + lda ZPCheckSum + adc #0 Don't forget to add last carry!!! + eor #$FF + sta (ZPBufPtr),y + iny + lda ZPCheckSum+1 + adc #0 Don't forget to add last carry!!! + eor #$FF + sta (ZPBufPtr),y + rts +*-------------------------------------- + .EP +*-------------------------------------- + .LIST ON +DRV.IP.SIZE .EQ *-DRV.IP + .LIST OFF +*-------------------------------------- * CONTROL SECTION : *-------------------------------------- .DO DRV.SIZE>255 -* ERROR:DRV.SIZE too big + ERROR:DRV.SIZE too big .FIN *-------------------------------------- *-------------------------------------- - .INB usr/src/sys/km.vedrive.s.cf - .INB usr/src/sys/km.vedrive.s.ip - .INB usr/src/sys/km.vedrive.s.u1 - .INB usr/src/sys/km.vedrive.s.u2 - .INB usr/src/sys/km.vedrive.s.gs + .INB usr/src/sys/pm.vedrive.s.cf + .INB usr/src/sys/pm.vedrive.s.ip + .INB usr/src/sys/pm.vedrive.s.u1 + .INB usr/src/sys/pm.vedrive.s.u2 + .INB usr/src/sys/pm.vedrive.s.gs *-------------------------------------- VEDRIVE.MSG0 .AZ "VEDRIVE (ADTPro Virtual Ethernet HD) Driver\n" VEDRIVE.DRVKO .AZ "VEDRIVE (Or other custom Driver) Already Installed.\n" @@ -693,5 +853,5 @@ ADT.REQ.END .EQ * ADT.REQ.LEN .EQ *-ADT.REQ *-------------------------------------- MAN -SAVE usr/src/sys/km.vedrive.s +SAVE usr/src/sys/pm.vedrive.s ASM diff --git a/SYS/KM.VSDRIVE.S.txt b/SYS/KM.VSDRIVE.S.txt index 9254d0b0..80133c3e 100644 --- a/SYS/KM.VSDRIVE.S.txt +++ b/SYS/KM.VSDRIVE.S.txt @@ -3,7 +3,7 @@ NEW .LIST OFF .OP 65C02 .OR $2000 - .TF sys/km/km.vsdrive + .TF sys/pm/pm.vsdrive *-------------------------------------- .INB inc/macros.i .INB inc/io.i @@ -618,5 +618,5 @@ DRV.SIZE .EQ *-DRV .FIN *-------------------------------------- MAN -SAVE usr/src/sys/km.vsdrive.s +SAVE usr/src/sys/pm.vsdrive.s ASM