mirror of
https://github.com/A2osX/A2osX.git
synced 2024-08-11 23:28:56 +00:00
Kernel 0.93+
This commit is contained in:
parent
5c04c99bc9
commit
a31bb0f068
Binary file not shown.
@ -1,6 +1,5 @@
|
|||||||
NEW
|
NEW
|
||||||
PREFIX
|
AUTO 3,1
|
||||||
AUTO 4,1
|
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
.OP 65C02
|
.OP 65C02
|
||||||
.OR $2000
|
.OR $2000
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
NEW
|
NEW
|
||||||
PREFIX
|
AUTO 3,1
|
||||||
AUTO 4,1
|
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
.OP 65C02
|
.OP 65C02
|
||||||
.OR $2000
|
.OR $2000
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
NEW
|
NEW
|
||||||
PREFIX
|
AUTO 3,1
|
||||||
AUTO 4,1
|
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
.OP 65C02
|
.OP 65C02
|
||||||
.OR $2000
|
.OR $2000
|
||||||
|
@ -108,6 +108,7 @@ CS.END
|
|||||||
MSG.USAGE .AS "Usage : KILL <signal> PID\r\n"
|
MSG.USAGE .AS "Usage : KILL <signal> PID\r\n"
|
||||||
.AS " -0 : No Signal\r\n"
|
.AS " -0 : No Signal\r\n"
|
||||||
.AZ " -1 : SIGQUIT\r\n"
|
.AZ " -1 : SIGQUIT\r\n"
|
||||||
|
.AZ " -2 : SIGKILL\r\n"
|
||||||
SSCANF.PID .AZ "%d"
|
SSCANF.PID .AZ "%d"
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.DUMMY
|
.DUMMY
|
||||||
|
@ -42,15 +42,15 @@ ZPBIN.SIZE .EQ 32
|
|||||||
PSCTX.SIZE .EQ $100-pSession
|
PSCTX.SIZE .EQ $100-pSession
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* A2osX GLOBAL PAGE
|
* A2osX GLOBAL PAGE
|
||||||
* $BD00->$BD0F : Public Vetors
|
* $BC00->$BC0F : Public Vetors
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
A2osX.SYSCALL .EQ $BD00
|
A2osX.SYSCALL .EQ $BC00
|
||||||
A2osX.LIBCALL .EQ $BD03
|
A2osX.LIBCALL .EQ $BC03
|
||||||
A2osX.ATKCALL .EQ $BD06
|
A2osX.ATKCALL .EQ $BC06
|
||||||
A2osX.FPUCALL .EQ $BD09
|
A2osX.FPUCALL .EQ $BC09
|
||||||
A2osX.BADCALL .EQ $BD0C
|
A2osX.BADCALL .EQ $BC0C
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
A2osX.SLEEP .EQ $BD10
|
A2osX.SLEEP .EQ $BC10
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* $BEE0->$BEEF : Public Variables
|
* $BEE0->$BEEF : Public Variables
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -289,7 +289,7 @@ SYS.PutPW .EQ $D4
|
|||||||
* .EQ $D8
|
* .EQ $D8
|
||||||
* .EQ $DA
|
* .EQ $DA
|
||||||
* .EQ $DC
|
* .EQ $DC
|
||||||
* .EQ $DF
|
SYS.OSD .EQ $DF
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
SYS.GetMem .EQ $E0
|
SYS.GetMem .EQ $E0
|
||||||
SYS.GetMem0 .EQ $E2
|
SYS.GetMem0 .EQ $E2
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
NEW
|
NEW
|
||||||
AUTO 4,1
|
AUTO 3,1
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
.OP 65C02
|
.OP 65C02
|
||||||
.OR $2000
|
.OR $2000
|
||||||
|
@ -23,7 +23,7 @@ A2osX.E0.S .EQ A2osX.E0.E-A2osX.E0
|
|||||||
* ERROR:AUX too big
|
* ERROR:AUX too big
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
.FIN
|
.FIN
|
||||||
.DO A2osX.GP.SC>$1E0
|
.DO A2osX.GP.SC>$2E0
|
||||||
.LIST ON
|
.LIST ON
|
||||||
* ERROR:GP too big
|
* ERROR:GP too big
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
|
@ -109,7 +109,7 @@ K.Buf256 .EQ $1100
|
|||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
K.IOBuf .EQ $1200
|
K.IOBuf .EQ $1200
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
Mem.MHiMem .EQ $BD00
|
Mem.MHiMem .EQ A2osX.SYSCALL
|
||||||
Mem.XHiMem .EQ $C000
|
Mem.XHiMem .EQ $C000
|
||||||
DevMgr.HiMem .EQ $FFFA Protect IRQ vectors in Aux LC
|
DevMgr.HiMem .EQ $FFFA Protect IRQ vectors in Aux LC
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -29,7 +29,7 @@ K.OpenDir jsr PFT.CheckPathYA
|
|||||||
cmp #$0F Directory ?
|
cmp #$0F Directory ?
|
||||||
bne .98
|
bne .98
|
||||||
|
|
||||||
jsr IO.MLIOPEN
|
jsr IO.MLI.OPEN
|
||||||
bcs .98
|
bcs .98
|
||||||
|
|
||||||
.8 lda IO.hFD
|
.8 lda IO.hFD
|
||||||
@ -55,7 +55,7 @@ K.OpenDir jsr PFT.CheckPathYA
|
|||||||
* note : A = 0 means no more entry
|
* note : A = 0 means no more entry
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
.DUMMY
|
.DUMMY
|
||||||
.OR ZPTMP+15 conflict with PTime2Time
|
.OR ZPTMP 8 Bytes
|
||||||
K.ReadDir.hMem .BS 1
|
K.ReadDir.hMem .BS 1
|
||||||
K.ReadDir.BufSize .BS 2
|
K.ReadDir.BufSize .BS 2
|
||||||
K.ReadDir.ECIB .BS 1
|
K.ReadDir.ECIB .BS 1
|
||||||
|
@ -42,7 +42,7 @@ K.ChTyp jsr PFT.CheckPathYA
|
|||||||
* X = hMem of Loaded File
|
* X = hMem of Loaded File
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
.DUMMY
|
.DUMMY
|
||||||
.OR ZPTMP
|
.OR ZPTMP 5 Bytes
|
||||||
FIO.bTXT .BS 1
|
FIO.bTXT .BS 1
|
||||||
FIO.hFILE .BS 1
|
FIO.hFILE .BS 1
|
||||||
FIO.MemPtr .BS 2
|
FIO.MemPtr .BS 2
|
||||||
|
@ -171,6 +171,237 @@ GP.AtkCall dec IRQ.InKernel
|
|||||||
|
|
||||||
inc IRQ.InKernel
|
inc IRQ.InKernel
|
||||||
rts
|
rts
|
||||||
|
*/--------------------------------------
|
||||||
|
* # FAdd,FSub,FMult,FDiv,FPwr
|
||||||
|
* Return X+Y, X-Y, X*Y, X/Y, X^Y
|
||||||
|
* ## ASM
|
||||||
|
* **In:**
|
||||||
|
* `>PUSHF X (float)`
|
||||||
|
* `>PUSHF Y (float)`
|
||||||
|
* `>FPU fadd`
|
||||||
|
* `>FPU fsub`
|
||||||
|
* `>FPU fmult`
|
||||||
|
* `>FPU fdiv`
|
||||||
|
* `>FPU fpwr`
|
||||||
|
* ## RETURN VALUE
|
||||||
|
* On stack (float)
|
||||||
|
*\--------------------------------------
|
||||||
|
*/--------------------------------------
|
||||||
|
* # Log,Sqr,Exp,Cos,Sin,Tan,ATan
|
||||||
|
* Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
|
||||||
|
* ## C
|
||||||
|
* `float log ( float x);`
|
||||||
|
* `float sqr ( float x);`
|
||||||
|
* `float exp ( float x);`
|
||||||
|
* `float cos ( float x);`
|
||||||
|
* `float sin ( float x);`
|
||||||
|
* `float tan ( float x);`
|
||||||
|
* `float atan ( float x);`
|
||||||
|
* ## ASM
|
||||||
|
* **In:**
|
||||||
|
* `>PUSHF x (Float)`
|
||||||
|
* `>FPU log`
|
||||||
|
* ## RETURN VALUE
|
||||||
|
* On stack (Float)
|
||||||
|
*\--------------------------------------
|
||||||
|
* >PUSHL ARG
|
||||||
|
* >PUSHL ACC
|
||||||
|
* >FPU ADD32
|
||||||
|
* >PULLL (ARG+ACC)
|
||||||
|
*--------------------------------------
|
||||||
|
MATH.ADD32 clc
|
||||||
|
.HS B0 BCS
|
||||||
|
MATH.SUB32 sec
|
||||||
|
|
||||||
|
php
|
||||||
|
|
||||||
|
jsr MATH.PopACC32
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
ldx #3
|
||||||
|
|
||||||
|
plp
|
||||||
|
bcs .2
|
||||||
|
|
||||||
|
.1 lda (pStack),y
|
||||||
|
adc ACC32,y
|
||||||
|
sta (pStack),y
|
||||||
|
iny
|
||||||
|
dex
|
||||||
|
bpl .1
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
.2 lda (pStack),y
|
||||||
|
sbc ACC32,y
|
||||||
|
sta (pStack),y
|
||||||
|
iny
|
||||||
|
dex
|
||||||
|
bpl .2
|
||||||
|
|
||||||
|
MATH.SUB32.RTS rts
|
||||||
|
*--------------------------------------
|
||||||
|
* >PUSHL ARG
|
||||||
|
* >PUSHL ACC
|
||||||
|
* >(I)MUL32
|
||||||
|
* >PULLL (ARG*ACC)
|
||||||
|
*--------------------------------------
|
||||||
|
MATH.UMUL32 clc
|
||||||
|
.HS B0 BCS
|
||||||
|
MATH.IMUL32 sec
|
||||||
|
|
||||||
|
php
|
||||||
|
jsr MATH.MULDIVMOD.COMMON
|
||||||
|
jsr MATH.MUL32
|
||||||
|
|
||||||
|
plp
|
||||||
|
bcc MATH.SUB32.RTS
|
||||||
|
|
||||||
|
MATH.RETURN.ITMP
|
||||||
|
lda ACC32.Sign
|
||||||
|
eor ARG32.Sign
|
||||||
|
bpl MATH.PutTMP32
|
||||||
|
bra MATH.PutNotTMP32
|
||||||
|
*--------------------------------------
|
||||||
|
* >PUSHL ARG
|
||||||
|
* >PUSHL ACC
|
||||||
|
* >(I)DIV32
|
||||||
|
* >PULLL (ARG / ACC)
|
||||||
|
*--------------------------------------
|
||||||
|
* >PUSHL ARG
|
||||||
|
* >PUSHL ACC
|
||||||
|
* >(I)MOD32
|
||||||
|
* >PULLL (ARG mod ACC)
|
||||||
|
*--------------------------------------
|
||||||
|
MATH.UDIV32 clc
|
||||||
|
.HS B0 BCS
|
||||||
|
MATH.IDIV32 sec
|
||||||
|
clv
|
||||||
|
bra MATH.DIVMOD
|
||||||
|
|
||||||
|
MATH.UMOD32 clc
|
||||||
|
.HS B0 BCS
|
||||||
|
MATH.IMOD32 sec
|
||||||
|
bit MATH.SUB32.RTS $60
|
||||||
|
|
||||||
|
MATH.DIVMOD php
|
||||||
|
jsr MATH.MULDIVMOD.COMMON
|
||||||
|
jsr MATH.DIVMOD32
|
||||||
|
|
||||||
|
plp
|
||||||
|
bcc .3
|
||||||
|
bvs MATH.RETURN.ITMP IMOD
|
||||||
|
|
||||||
|
lda ACC32.Sign IDIV
|
||||||
|
eor ARG32.Sign
|
||||||
|
bmi MATH.PutARG32
|
||||||
|
bra MATH.PutNotARG32
|
||||||
|
|
||||||
|
.3 bvs MATH.PutARG32 DIV
|
||||||
|
*--------------------------------------
|
||||||
|
MATH.PutTMP32 lda #TMP32 MOD
|
||||||
|
.HS 2C BIT ABS
|
||||||
|
*--------------------------------------
|
||||||
|
MATH.PutARG32 lda #ARG32
|
||||||
|
sta .1+1
|
||||||
|
|
||||||
|
ldy #3
|
||||||
|
|
||||||
|
.1 lda $ff,y SELF MODIFIED
|
||||||
|
sta (pStack),y
|
||||||
|
dey
|
||||||
|
bpl .1
|
||||||
|
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
MATH.PutNotTMP32
|
||||||
|
lda #TMP32
|
||||||
|
.HS 2C BIT ABS
|
||||||
|
*--------------------------------------
|
||||||
|
MATH.PutNotARG32
|
||||||
|
lda #ARG32
|
||||||
|
sta .1+1
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
ldx #3
|
||||||
|
|
||||||
|
sec
|
||||||
|
|
||||||
|
.1 lda $ff,y SELF MODIFIED
|
||||||
|
eor #$ff two's complement of X bytes
|
||||||
|
adc #0
|
||||||
|
sta (pStack),y
|
||||||
|
iny
|
||||||
|
dex
|
||||||
|
bpl .1
|
||||||
|
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
MATH.PopACC32 ldy #$ff
|
||||||
|
|
||||||
|
.1 iny
|
||||||
|
lda (pStack),y
|
||||||
|
sta ACC32,y
|
||||||
|
cpy #3
|
||||||
|
bne .1
|
||||||
|
|
||||||
|
sta ACC32.Sign
|
||||||
|
|
||||||
|
tya
|
||||||
|
* sec Add 3+CS=4
|
||||||
|
adc pStack
|
||||||
|
sta pStack
|
||||||
|
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
MATH.GetARG32 ldy #0
|
||||||
|
|
||||||
|
.1 lda (pStack),y
|
||||||
|
sta ARG32,y
|
||||||
|
iny
|
||||||
|
cpy #4
|
||||||
|
bne .1
|
||||||
|
|
||||||
|
sta ARG32.Sign
|
||||||
|
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
MATH.MULDIVMOD.COMMON
|
||||||
|
php
|
||||||
|
|
||||||
|
jsr MATH.PopACC32
|
||||||
|
jsr MATH.GetARG32
|
||||||
|
|
||||||
|
plp
|
||||||
|
bcc .1
|
||||||
|
|
||||||
|
jsr MATH.ACC32ABS
|
||||||
|
jsr MATH.ARG32ABS
|
||||||
|
|
||||||
|
.1 rts
|
||||||
|
*/--------------------------------------
|
||||||
|
* # float
|
||||||
|
* Return 'floated' long
|
||||||
|
* ## C
|
||||||
|
* `float f = (float)12345678;
|
||||||
|
* ## ASM
|
||||||
|
* **In:**
|
||||||
|
* `>PUSHL X` (long)
|
||||||
|
* ## RETURN VALUE
|
||||||
|
* On stack (float)
|
||||||
|
*\--------------------------------------
|
||||||
|
*/--------------------------------------
|
||||||
|
* # lrintf
|
||||||
|
* Return float rounded into a long
|
||||||
|
* ## C
|
||||||
|
* `long int lrintf (float x);`
|
||||||
|
* ## ASM
|
||||||
|
* **In:**
|
||||||
|
* `>PUSHF x`
|
||||||
|
* `>SYSCALL lrintf`
|
||||||
|
* ## RETURN VALUE
|
||||||
|
* On stack (long)
|
||||||
|
*\--------------------------------------
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
GP.FpuCall dec IRQ.InKernel
|
GP.FpuCall dec IRQ.InKernel
|
||||||
jsr .1
|
jsr .1
|
||||||
@ -274,6 +505,42 @@ GP.SetFAC ldx #FPU.SETFAC
|
|||||||
>LDYA pStack
|
>LDYA pStack
|
||||||
bra GP.ROMCALL
|
bra GP.ROMCALL
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
K.Float ldy #3
|
||||||
|
|
||||||
|
.1 lda (pStack),y
|
||||||
|
sta FAC,y Reverse Order
|
||||||
|
dey
|
||||||
|
bpl .1
|
||||||
|
|
||||||
|
dec pStack keep 5 bytes on stack
|
||||||
|
|
||||||
|
stz FAC.SIGN
|
||||||
|
lda #$80+32
|
||||||
|
sta FAC Positive + Exp=32
|
||||||
|
|
||||||
|
ldx #FPU.LTOF
|
||||||
|
|
||||||
|
MATH.RomCallPushFAC
|
||||||
|
jsr GP.ROMCALL
|
||||||
|
jmp GP.GETFAC.ON.STACK
|
||||||
|
*--------------------------------------
|
||||||
|
K.lrintf jsr GP.SetFAC
|
||||||
|
|
||||||
|
inc pStack keep 4 bytes on stack
|
||||||
|
|
||||||
|
ldx #FPU.QINT
|
||||||
|
jsr GP.ROMCALL
|
||||||
|
|
||||||
|
ldy #3
|
||||||
|
|
||||||
|
.1 lda FAC+1,y
|
||||||
|
sta (pStack),y
|
||||||
|
dey
|
||||||
|
bpl .1
|
||||||
|
|
||||||
|
clc
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
GP.MLICall stx .1
|
GP.MLICall stx .1
|
||||||
sta K.MLI.PARAMS
|
sta K.MLI.PARAMS
|
||||||
jsr GO.ProDOS
|
jsr GO.ProDOS
|
||||||
@ -382,6 +649,11 @@ CORE.Tick10t .BS 1
|
|||||||
CORE.CPUStatCnt .DA #100
|
CORE.CPUStatCnt .DA #100
|
||||||
CORE.LastPSID .DA #0
|
CORE.LastPSID .DA #0
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
DevMgr.Stat .DA DevMgr.FreeMem
|
||||||
|
DevMgr.Free .DA DevMgr.FreeMem
|
||||||
|
.DA DevMgr.HiMem
|
||||||
|
DevMgr.DevIdx .DA #1
|
||||||
|
*--------------------------------------
|
||||||
IRQ.InKernel .BS 1
|
IRQ.InKernel .BS 1
|
||||||
IRQ.InLib .BS 1
|
IRQ.InLib .BS 1
|
||||||
IRQ.SkipA2osX .BS 1
|
IRQ.SkipA2osX .BS 1
|
||||||
@ -392,6 +664,8 @@ IRQ.VBL.0n .BS 1
|
|||||||
IRQ.Mode .BS 1
|
IRQ.Mode .BS 1
|
||||||
IRQ.Tick .BS 1
|
IRQ.Tick .BS 1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
IRQ.Vectors .BS K.IRQDEV.MAX*2
|
||||||
|
*--------------------------------------
|
||||||
*GO.Reset jsr GO.A2osX
|
*GO.Reset jsr GO.A2osX
|
||||||
* jmp CORE.Run
|
* jmp CORE.Run
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
|
@ -33,7 +33,7 @@ Kernel.Init2 sei
|
|||||||
>STYA A1L Src Start Address (MAIN)
|
>STYA A1L Src Start Address (MAIN)
|
||||||
>LDYAI A2osX.GP
|
>LDYAI A2osX.GP
|
||||||
>STYA A2L Src End Address (MAIN)
|
>STYA A2L Src End Address (MAIN)
|
||||||
>LDYAI X.GUIOSD
|
>LDYAI X.OSD
|
||||||
>STYA A4L Dst Address (AUX)
|
>STYA A4L Dst Address (AUX)
|
||||||
sec Main To Aux
|
sec Main To Aux
|
||||||
jsr AuxMove
|
jsr AuxMove
|
||||||
|
@ -13,6 +13,8 @@ NEW
|
|||||||
* A = hFD
|
* A = hFD
|
||||||
* REG File created on ProDOS : T=TXT,X=$0000
|
* REG File created on ProDOS : T=TXT,X=$0000
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
|
.DUMMY
|
||||||
|
.OR ZPTMP+20 9 Bytes
|
||||||
K.Open.FLAGS .BS 1
|
K.Open.FLAGS .BS 1
|
||||||
K.Open.TYPE .BS 1
|
K.Open.TYPE .BS 1
|
||||||
K.Open.AUXTYPE .BS 2
|
K.Open.AUXTYPE .BS 2
|
||||||
@ -20,6 +22,7 @@ IO.hDev .BS 1
|
|||||||
IO.hFD .BS 1
|
IO.hFD .BS 1
|
||||||
IO.hFILE .BS 1
|
IO.hFILE .BS 1
|
||||||
IO.Counter .BS 2
|
IO.Counter .BS 2
|
||||||
|
.ED
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
K.Open jsr PFT.YAToMLIPATH
|
K.Open jsr PFT.YAToMLIPATH
|
||||||
>PULLB K.Open.FLAGS
|
>PULLB K.Open.FLAGS
|
||||||
@ -116,7 +119,7 @@ IO.OPEN.REG.E ldx #0
|
|||||||
jsr IO.MkFD
|
jsr IO.MkFD
|
||||||
bcs IO.OPEN.RTS
|
bcs IO.OPEN.RTS
|
||||||
|
|
||||||
jsr IO.MLIOPEN
|
jsr IO.MLI.OPEN
|
||||||
bcs IO.OPEN.ERR
|
bcs IO.OPEN.ERR
|
||||||
|
|
||||||
lda K.Open.FLAGS
|
lda K.Open.FLAGS
|
||||||
@ -181,21 +184,6 @@ IO.OPEN.DSOCK
|
|||||||
IO.OPEN.SSOCK lda IO.hFD
|
IO.OPEN.SSOCK lda IO.hFD
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
|
||||||
IO.MLI.CREATE sta K.MLI.PARAMS+7 Storage Type
|
|
||||||
|
|
||||||
ldx #3
|
|
||||||
|
|
||||||
.1 lda DATELO,x
|
|
||||||
sta K.MLI.PARAMS+8,x Create Date/Time
|
|
||||||
dex
|
|
||||||
bpl .1
|
|
||||||
|
|
||||||
lda #S.FI.A.FULL
|
|
||||||
sta K.MLI.PARAMS+3 Access
|
|
||||||
|
|
||||||
>MLICALL MLICREATE
|
|
||||||
rts
|
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # close
|
* # close
|
||||||
* ## C
|
* ## C
|
||||||
@ -759,11 +747,6 @@ IO.EOF lda (pFD)
|
|||||||
.DA STDIO.IOERR DSOCK
|
.DA STDIO.IOERR DSOCK
|
||||||
.DA IO.EOF.SSOCK
|
.DA IO.EOF.SSOCK
|
||||||
.DA IO.EOF.PIPE
|
.DA IO.EOF.PIPE
|
||||||
*--------------------------------------
|
|
||||||
.DUMMY
|
|
||||||
.OR ZPTMP
|
|
||||||
K.EOF.MARK .BS 3
|
|
||||||
.ED
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
IO.EOF.REG >MLICALL MLIGETMARK
|
IO.EOF.REG >MLICALL MLIGETMARK
|
||||||
bcs IO.EOF.REG.RTS
|
bcs IO.EOF.REG.RTS
|
||||||
@ -771,7 +754,7 @@ IO.EOF.REG >MLICALL MLIGETMARK
|
|||||||
ldy #2
|
ldy #2
|
||||||
|
|
||||||
.1 lda K.MLI.PARAMS+2,y
|
.1 lda K.MLI.PARAMS+2,y
|
||||||
sta K.EOF.MARK,y
|
sta ACC32,y
|
||||||
dey
|
dey
|
||||||
bpl .1
|
bpl .1
|
||||||
|
|
||||||
@ -781,7 +764,7 @@ IO.EOF.REG >MLICALL MLIGETMARK
|
|||||||
ldy #2
|
ldy #2
|
||||||
|
|
||||||
.2 lda K.MLI.PARAMS+2,y
|
.2 lda K.MLI.PARAMS+2,y
|
||||||
eor K.EOF.MARK,y
|
eor ACC32,y
|
||||||
bne IO.EOF.FALSE
|
bne IO.EOF.FALSE
|
||||||
dey
|
dey
|
||||||
bpl .2
|
bpl .2
|
||||||
@ -848,7 +831,22 @@ IO.MkFD stx .8+1
|
|||||||
IO.MkFD.Y .DA #S.FD.REG,#S.FD.DIR,#S.FD.PIPE
|
IO.MkFD.Y .DA #S.FD.REG,#S.FD.DIR,#S.FD.PIPE
|
||||||
IO.MkFD.T .DA #S.FD.T.REG,#S.FD.T.DIR,#S.FD.T.PIPE
|
IO.MkFD.T .DA #S.FD.T.REG,#S.FD.T.DIR,#S.FD.T.PIPE
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
IO.MLIOPEN >LDYAI 1024 get a ProDOS IOBUF
|
IO.MLI.CREATE sta K.MLI.PARAMS+7 Storage Type
|
||||||
|
|
||||||
|
ldx #3
|
||||||
|
|
||||||
|
.1 lda DATELO,x
|
||||||
|
sta K.MLI.PARAMS+8,x Create Date/Time
|
||||||
|
dex
|
||||||
|
bpl .1
|
||||||
|
|
||||||
|
lda #S.FI.A.FULL
|
||||||
|
sta K.MLI.PARAMS+3 Access
|
||||||
|
|
||||||
|
>MLICALL MLICREATE
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
IO.MLI.OPEN >LDYAI 1024 get a ProDOS IOBUF
|
||||||
ldx #S.MEM.F.ALIGN+S.MEM.F.NOMOVE
|
ldx #S.MEM.F.ALIGN+S.MEM.F.NOMOVE
|
||||||
jsr MEM.GetMem.YAX
|
jsr MEM.GetMem.YAX
|
||||||
bcs .9
|
bcs .9
|
||||||
|
@ -227,8 +227,6 @@ K.IrqH.DEV ldx #0
|
|||||||
.8 clv clear V (no task switching)
|
.8 clv clear V (no task switching)
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
IRQ.Vectors .BS K.IRQDEV.MAX*2
|
|
||||||
*--------------------------------------
|
|
||||||
MAN
|
MAN
|
||||||
SAVE USR/SRC/SYS/KERNEL.S.IRQ
|
SAVE USR/SRC/SYS/KERNEL.S.IRQ
|
||||||
LOAD USR/SRC/SYS/KERNEL.S
|
LOAD USR/SRC/SYS/KERNEL.S
|
||||||
|
@ -131,7 +131,7 @@ K.SYSCALL .DA K.GetMemStat $00
|
|||||||
.DA 0
|
.DA 0
|
||||||
.DA 0
|
.DA 0
|
||||||
.DA 0
|
.DA 0
|
||||||
.DA 0
|
.DA X.OSD
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* $E000
|
* $E000
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -395,7 +395,7 @@ K.SYSCALL.BANK .DA #RRAMWRAMBNK1 $00
|
|||||||
.DA #$80
|
.DA #$80
|
||||||
.DA #RRAMWRAMBNK2
|
.DA #RRAMWRAMBNK2
|
||||||
.DA #$80
|
.DA #$80
|
||||||
.DA #RRAMWRAMBNK2
|
.DA #$C0 Off Screen Driver
|
||||||
.DA #$80
|
.DA #$80
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.DA #0 $E0 : MemMgr at $E000
|
.DA #0 $E0 : MemMgr at $E000
|
||||||
|
@ -1,274 +1,9 @@
|
|||||||
NEW
|
NEW
|
||||||
AUTO 3,1
|
AUTO 3,1
|
||||||
*/--------------------------------------
|
|
||||||
* # FAdd,FSub,FMult,FDiv,FPwr
|
|
||||||
* Return X+Y, X-Y, X*Y, X/Y, X^Y
|
|
||||||
* ## ASM
|
|
||||||
* **In:**
|
|
||||||
* `>PUSHF X (float)`
|
|
||||||
* `>PUSHF Y (float)`
|
|
||||||
* `>FPU fadd`
|
|
||||||
* `>FPU fsub`
|
|
||||||
* `>FPU fmult`
|
|
||||||
* `>FPU fdiv`
|
|
||||||
* `>FPU fpwr`
|
|
||||||
* ## RETURN VALUE
|
|
||||||
* On stack (float)
|
|
||||||
*\--------------------------------------
|
|
||||||
*/--------------------------------------
|
|
||||||
* # Log,Sqr,Exp,Cos,Sin,Tan,ATan
|
|
||||||
* Return Log(x), Sqr(x), E^X, Cos(x), Sin(X), Tan(x), ATan(x)
|
|
||||||
* ## C
|
|
||||||
* `float log ( float x);`
|
|
||||||
* `float sqr ( float x);`
|
|
||||||
* `float exp ( float x);`
|
|
||||||
* `float cos ( float x);`
|
|
||||||
* `float sin ( float x);`
|
|
||||||
* `float tan ( float x);`
|
|
||||||
* `float atan ( float x);`
|
|
||||||
* ## ASM
|
|
||||||
* **In:**
|
|
||||||
* `>PUSHF x (Float)`
|
|
||||||
* `>FPU log`
|
|
||||||
* ## RETURN VALUE
|
|
||||||
* On stack (Float)
|
|
||||||
*\--------------------------------------
|
|
||||||
*/--------------------------------------
|
|
||||||
* # float
|
|
||||||
* Return 'floated' long
|
|
||||||
* ## C
|
|
||||||
* `float f = (float)12345678;
|
|
||||||
* ## ASM
|
|
||||||
* **In:**
|
|
||||||
* `>PUSHL X` (long)
|
|
||||||
* ## RETURN VALUE
|
|
||||||
* On stack (float)
|
|
||||||
*\--------------------------------------
|
|
||||||
K.Float ldy #3
|
|
||||||
|
|
||||||
.1 lda (pStack),y
|
|
||||||
sta FAC,y Reverse Order
|
|
||||||
dey
|
|
||||||
bpl .1
|
|
||||||
|
|
||||||
dec pStack keep 5 bytes on stack
|
|
||||||
|
|
||||||
stz FAC.SIGN
|
|
||||||
lda #$80+32
|
|
||||||
sta FAC Positive + Exp=32
|
|
||||||
|
|
||||||
ldx #FPU.LTOF
|
|
||||||
*--------------------------------------
|
|
||||||
MATH.RomCallPushFAC
|
|
||||||
jsr GP.ROMCALL
|
|
||||||
jmp GP.GETFAC.ON.STACK
|
|
||||||
*/--------------------------------------
|
|
||||||
* # lrintf
|
|
||||||
* Return float rounded into a long
|
|
||||||
* ## C
|
|
||||||
* `long int lrintf (float x);`
|
|
||||||
* ## ASM
|
|
||||||
* **In:**
|
|
||||||
* `>PUSHF x`
|
|
||||||
* `>SYSCALL lrintf`
|
|
||||||
* ## RETURN VALUE
|
|
||||||
* On stack (long)
|
|
||||||
*\--------------------------------------
|
|
||||||
K.lrintf jsr GP.SetFAC
|
|
||||||
|
|
||||||
inc pStack keep 4 bytes on stack
|
|
||||||
|
|
||||||
ldx #FPU.QINT
|
|
||||||
jsr GP.ROMCALL
|
|
||||||
|
|
||||||
ldy #3
|
|
||||||
|
|
||||||
.1 lda FAC+1,y
|
|
||||||
sta (pStack),y
|
|
||||||
dey
|
|
||||||
bpl .1
|
|
||||||
|
|
||||||
clc
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* http://6502.org/source/integers/32muldiv.htm
|
* http://6502.org/source/integers/32muldiv.htm
|
||||||
* http://nparker.llx.com/a2/mult.html
|
* http://nparker.llx.com/a2/mult.html
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* >PUSHL ARG
|
|
||||||
* >PUSHL ACC
|
|
||||||
* >FPU ADD32
|
|
||||||
* >PULLL (ARG+ACC)
|
|
||||||
*--------------------------------------
|
|
||||||
MATH.ADD32 clc
|
|
||||||
.HS B0 BCS
|
|
||||||
MATH.SUB32 sec
|
|
||||||
|
|
||||||
php
|
|
||||||
|
|
||||||
jsr MATH.PopACC32
|
|
||||||
|
|
||||||
ldy #0
|
|
||||||
ldx #3
|
|
||||||
|
|
||||||
plp
|
|
||||||
bcs .2
|
|
||||||
|
|
||||||
.1 lda (pStack),y
|
|
||||||
adc ACC32,y
|
|
||||||
sta (pStack),y
|
|
||||||
iny
|
|
||||||
dex
|
|
||||||
bpl .1
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
.2 lda (pStack),y
|
|
||||||
sbc ACC32,y
|
|
||||||
sta (pStack),y
|
|
||||||
iny
|
|
||||||
dex
|
|
||||||
bpl .2
|
|
||||||
|
|
||||||
MATH.SUB32.RTS rts
|
|
||||||
*--------------------------------------
|
|
||||||
* >PUSHL ARG
|
|
||||||
* >PUSHL ACC
|
|
||||||
* >(I)MUL32
|
|
||||||
* >PULLL (ARG*ACC)
|
|
||||||
*--------------------------------------
|
|
||||||
MATH.UMUL32 clc
|
|
||||||
.HS B0 BCS
|
|
||||||
MATH.IMUL32 sec
|
|
||||||
|
|
||||||
php
|
|
||||||
jsr MATH.MULDIVMOD.COMMON
|
|
||||||
jsr MATH.MUL32
|
|
||||||
|
|
||||||
plp
|
|
||||||
bcc MATH.SUB32.RTS
|
|
||||||
|
|
||||||
MATH.RETURN.ITMP
|
|
||||||
lda ACC32.Sign
|
|
||||||
eor ARG32.Sign
|
|
||||||
bpl MATH.PutTMP32
|
|
||||||
bra MATH.PutNotTMP32
|
|
||||||
*--------------------------------------
|
|
||||||
* >PUSHL ARG
|
|
||||||
* >PUSHL ACC
|
|
||||||
* >(I)DIV32
|
|
||||||
* >PULLL (ARG / ACC)
|
|
||||||
*--------------------------------------
|
|
||||||
* >PUSHL ARG
|
|
||||||
* >PUSHL ACC
|
|
||||||
* >(I)MOD32
|
|
||||||
* >PULLL (ARG mod ACC)
|
|
||||||
*--------------------------------------
|
|
||||||
MATH.UDIV32 clc
|
|
||||||
.HS B0 BCS
|
|
||||||
MATH.IDIV32 sec
|
|
||||||
clv
|
|
||||||
bra MATH.DIVMOD
|
|
||||||
|
|
||||||
MATH.UMOD32 clc
|
|
||||||
.HS B0 BCS
|
|
||||||
MATH.IMOD32 sec
|
|
||||||
bit MATH.SUB32.RTS $60
|
|
||||||
|
|
||||||
MATH.DIVMOD php
|
|
||||||
jsr MATH.MULDIVMOD.COMMON
|
|
||||||
jsr MATH.DIVMOD32
|
|
||||||
|
|
||||||
plp
|
|
||||||
bcc .3
|
|
||||||
bvs MATH.RETURN.ITMP IMOD
|
|
||||||
|
|
||||||
lda ACC32.Sign IDIV
|
|
||||||
eor ARG32.Sign
|
|
||||||
bmi MATH.PutARG32
|
|
||||||
bra MATH.PutNotARG32
|
|
||||||
|
|
||||||
.3 bvs MATH.PutARG32 DIV
|
|
||||||
*--------------------------------------
|
|
||||||
MATH.PutTMP32 lda #TMP32 MOD
|
|
||||||
.HS 2C BIT ABS
|
|
||||||
*--------------------------------------
|
|
||||||
MATH.PutARG32 lda #ARG32
|
|
||||||
sta .1+1
|
|
||||||
|
|
||||||
ldy #3
|
|
||||||
|
|
||||||
.1 lda $ff,y SELF MODIFIED
|
|
||||||
sta (pStack),y
|
|
||||||
dey
|
|
||||||
bpl .1
|
|
||||||
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
MATH.PutNotTMP32
|
|
||||||
lda #TMP32
|
|
||||||
.HS 2C BIT ABS
|
|
||||||
*--------------------------------------
|
|
||||||
MATH.PutNotARG32
|
|
||||||
lda #ARG32
|
|
||||||
sta .1+1
|
|
||||||
|
|
||||||
ldy #0
|
|
||||||
ldx #3
|
|
||||||
|
|
||||||
sec
|
|
||||||
|
|
||||||
.1 lda $ff,y SELF MODIFIED
|
|
||||||
eor #$ff two's complement of X bytes
|
|
||||||
adc #0
|
|
||||||
sta (pStack),y
|
|
||||||
iny
|
|
||||||
dex
|
|
||||||
bpl .1
|
|
||||||
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
MATH.PopACC32 ldy #0
|
|
||||||
|
|
||||||
.1 lda (pStack),y
|
|
||||||
sta ACC32,y
|
|
||||||
iny
|
|
||||||
cpy #4
|
|
||||||
bne .1
|
|
||||||
|
|
||||||
sta ACC32.Sign
|
|
||||||
|
|
||||||
tya
|
|
||||||
clc
|
|
||||||
adc pStack
|
|
||||||
sta pStack
|
|
||||||
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
MATH.GetARG32 ldy #0
|
|
||||||
|
|
||||||
.1 lda (pStack),y
|
|
||||||
sta ARG32,y
|
|
||||||
iny
|
|
||||||
cpy #4
|
|
||||||
bne .1
|
|
||||||
|
|
||||||
sta ARG32.Sign
|
|
||||||
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
MATH.MULDIVMOD.COMMON
|
|
||||||
php
|
|
||||||
|
|
||||||
jsr MATH.PopACC32
|
|
||||||
jsr MATH.GetARG32
|
|
||||||
|
|
||||||
plp
|
|
||||||
bcc .1
|
|
||||||
|
|
||||||
jsr MATH.ACC32ABS
|
|
||||||
jsr MATH.ARG32ABS
|
|
||||||
|
|
||||||
.1 rts
|
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
* ARG32*ACC32->TMP32
|
* ARG32*ACC32->TMP32
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
@ -276,7 +11,7 @@ MATH.MUL32 jsr MATH.TMP32ZERO
|
|||||||
|
|
||||||
ldx #32
|
ldx #32
|
||||||
|
|
||||||
.2 lsr ARG32+3
|
.1 lsr ARG32+3
|
||||||
ror ARG32+2
|
ror ARG32+2
|
||||||
ror ARG32+1
|
ror ARG32+1
|
||||||
ror ARG32
|
ror ARG32
|
||||||
@ -285,26 +20,21 @@ MATH.MUL32 jsr MATH.TMP32ZERO
|
|||||||
|
|
||||||
clc
|
clc
|
||||||
|
|
||||||
lda TMP32
|
ldy #0
|
||||||
adc ACC32
|
|
||||||
sta TMP32
|
|
||||||
|
|
||||||
lda TMP32+1
|
.2 lda TMP32,y
|
||||||
adc ACC32+1
|
adc ACC32,y
|
||||||
sta TMP32+1
|
sta TMP32,y
|
||||||
|
|
||||||
lda TMP32+2
|
iny
|
||||||
adc ACC32+2
|
tya
|
||||||
sta TMP32+2
|
eor #4
|
||||||
|
bne .2
|
||||||
lda TMP32+3
|
|
||||||
adc ACC32+3
|
|
||||||
sta TMP32+3
|
|
||||||
|
|
||||||
.3 jsr MATH.ACC32.T2
|
.3 jsr MATH.ACC32.T2
|
||||||
|
|
||||||
dex
|
dex
|
||||||
bne .2
|
bne .1
|
||||||
|
|
||||||
clc
|
clc
|
||||||
rts
|
rts
|
||||||
|
@ -633,144 +633,6 @@ MEM.GetKrnlBuf pha
|
|||||||
* sec
|
* sec
|
||||||
rts
|
rts
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
MEM.GetKeyCharY sta CLRREADAUX
|
|
||||||
lda (ZPSListDataPtr),y
|
|
||||||
sta SETREADAUX
|
|
||||||
beq MEM.IsDigit.9
|
|
||||||
|
|
||||||
MEM.IsIDValid cmp #'.'
|
|
||||||
beq MEM.IsDigit.8
|
|
||||||
|
|
||||||
cmp #'_'
|
|
||||||
beq MEM.IsDigit.8
|
|
||||||
|
|
||||||
MEM.IsDigitOrL cmp #'z'+1
|
|
||||||
bcs MEM.IsDigit.RTS
|
|
||||||
cmp #'a'
|
|
||||||
bcs MEM.IsDigit.8
|
|
||||||
|
|
||||||
MEM.IsDigitOrUC cmp #'Z'+1
|
|
||||||
bcs MEM.IsDigit.RTS
|
|
||||||
cmp #'A'
|
|
||||||
bcs MEM.IsDigit.8
|
|
||||||
|
|
||||||
jmp IsDigit
|
|
||||||
|
|
||||||
MEM.IsDigit.9 sec
|
|
||||||
rts
|
|
||||||
|
|
||||||
MEM.IsDigit.8 clc
|
|
||||||
MEM.IsDigit.RTS rts
|
|
||||||
*--------------------------------------
|
|
||||||
MEM.IsHexDigit jsr IsDigit
|
|
||||||
bcc .8
|
|
||||||
|
|
||||||
cmp #'A'
|
|
||||||
bcc MEM.IsDigit.9
|
|
||||||
cmp #'F'+1
|
|
||||||
bcc .1
|
|
||||||
|
|
||||||
cmp #'a'
|
|
||||||
bcc MEM.IsDigit.9
|
|
||||||
cmp #'f'+1
|
|
||||||
bcs MEM.IsDigit.RTS
|
|
||||||
|
|
||||||
eor #$20
|
|
||||||
.1
|
|
||||||
* clc
|
|
||||||
sbc #'A'-11 cc so A->10 (11-CC)
|
|
||||||
clc
|
|
||||||
|
|
||||||
.8 and #$0F
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
MEM.SetKeyCharY sta CLRWRITEAUX
|
|
||||||
sta (ZPSListDataPtr),y
|
|
||||||
sta SETWRITEAUX
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
MEM.GetDataByte sta CLRREADAUX
|
|
||||||
lda (ZPSListDataPtr)
|
|
||||||
sta SETREADAUX
|
|
||||||
bra MEM.SetDataByte.1
|
|
||||||
*--------------------------------------
|
|
||||||
MEM.SetDataByte sta CLRWRITEAUX
|
|
||||||
sta (ZPSListDataPtr)
|
|
||||||
sta SETWRITEAUX
|
|
||||||
MEM.SetDataByte.1
|
|
||||||
inc ZPSListDataPtr
|
|
||||||
bne .8
|
|
||||||
inc ZPSListDataPtr+1
|
|
||||||
.8 rts
|
|
||||||
*--------------------------------------
|
|
||||||
MEM.TXTPTR.GetY sta CLRREADAUX
|
|
||||||
lda (TXTPTR),y
|
|
||||||
sta SETREADAUX
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
MEM.TXTPTR.GetNext
|
|
||||||
sta CLRREADAUX
|
|
||||||
lda (TXTPTR)
|
|
||||||
sta SETREADAUX
|
|
||||||
beq .9
|
|
||||||
inc TXTPTR
|
|
||||||
bne .9
|
|
||||||
inc TXTPTR+1
|
|
||||||
.9 rts
|
|
||||||
*--------------------------------------
|
|
||||||
MEM.SPtr1PPtr2 >STYA ZPPtr1
|
|
||||||
>PULLW ZPPtr2
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
MEM.SPtr2PPtr1 >STYA ZPPtr2
|
|
||||||
>PULLW ZPPtr1
|
|
||||||
rts
|
|
||||||
*--------------------------------------
|
|
||||||
MEM.GetCharPtr1 lda (ZPPtr1)
|
|
||||||
bne MEM.NextCharPtr1
|
|
||||||
rts
|
|
||||||
|
|
||||||
MEM.PutCharPtr1 sta (ZPPtr1)
|
|
||||||
MEM.NextCharPtr1
|
|
||||||
inc ZPPtr1
|
|
||||||
bne .8
|
|
||||||
inc ZPPtr1+1 never Z
|
|
||||||
.8 rts
|
|
||||||
*--------------------------------------
|
|
||||||
MEM.AddYp1ToPtr1
|
|
||||||
sec
|
|
||||||
.HS 90 BCC
|
|
||||||
MEM.AddYToPtr1 clc
|
|
||||||
tya
|
|
||||||
adc ZPPtr1
|
|
||||||
sta ZPPtr1
|
|
||||||
bcc .8
|
|
||||||
inc ZPPtr1+1
|
|
||||||
.8 rts
|
|
||||||
*--------------------------------------
|
|
||||||
MEM.AddYp1ToPtr2
|
|
||||||
sec
|
|
||||||
.HS 90 BCC
|
|
||||||
MEM.AddYToPtr2 clc
|
|
||||||
tya
|
|
||||||
adc ZPPtr2
|
|
||||||
sta ZPPtr2
|
|
||||||
bcc .8
|
|
||||||
clc keep CC as some JMP exit here
|
|
||||||
inc ZPPtr2+1
|
|
||||||
.8 rts
|
|
||||||
*--------------------------------------
|
|
||||||
MEM.GetCharPtr2 lda (ZPPtr2)
|
|
||||||
bne MEM.NextCharPtr2
|
|
||||||
rts
|
|
||||||
|
|
||||||
MEM.PutCharPtr2 sta (ZPPtr2)
|
|
||||||
MEM.NextCharPtr2
|
|
||||||
inc ZPPtr2
|
|
||||||
bne .8
|
|
||||||
inc ZPPtr2+1
|
|
||||||
.8 rts
|
|
||||||
*--------------------------------------
|
|
||||||
MAN
|
MAN
|
||||||
SAVE USR/SRC/SYS/KERNEL.S.MEM
|
SAVE USR/SRC/SYS/KERNEL.S.MEM
|
||||||
LOAD USR/SRC/SYS/KERNEL.S
|
LOAD USR/SRC/SYS/KERNEL.S
|
||||||
|
@ -12,7 +12,7 @@ ZPTmpPtr .EQ ZPDRV+14
|
|||||||
* YA =Ptr to S.CB in MAIN
|
* YA =Ptr to S.CB in MAIN
|
||||||
* X = DstBM hMem
|
* X = DstBM hMem
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
X.GUIOSD >STYA TXTPTR
|
X.OSD >STYA TXTPTR
|
||||||
|
|
||||||
ldy #S.CB-1
|
ldy #S.CB-1
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ NEW
|
|||||||
AUTO 3,1
|
AUTO 3,1
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
.DUMMY
|
.DUMMY
|
||||||
.OR ZPTMP+21
|
.OR ZPTMP+8 7 Bytes
|
||||||
PS.Flags .BS 1
|
PS.Flags .BS 1
|
||||||
PS.ArgV .BS 2
|
PS.ArgV .BS 2
|
||||||
PS.ArgSize .BS 2
|
PS.ArgSize .BS 2
|
||||||
|
145
SYS/KERNEL.S.SHARED.txt
Normal file
145
SYS/KERNEL.S.SHARED.txt
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
NEW
|
||||||
|
AUTO 3,1
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.GetKeyCharY sta CLRREADAUX
|
||||||
|
lda (ZPSListDataPtr),y
|
||||||
|
sta SETREADAUX
|
||||||
|
beq MEM.IsDigit.9
|
||||||
|
|
||||||
|
MEM.IsIDValid cmp #'.'
|
||||||
|
beq MEM.IsDigit.8
|
||||||
|
|
||||||
|
cmp #'_'
|
||||||
|
beq MEM.IsDigit.8
|
||||||
|
|
||||||
|
MEM.IsDigitOrL cmp #'z'+1
|
||||||
|
bcs MEM.IsDigit.RTS
|
||||||
|
cmp #'a'
|
||||||
|
bcs MEM.IsDigit.8
|
||||||
|
|
||||||
|
MEM.IsDigitOrUC cmp #'Z'+1
|
||||||
|
bcs MEM.IsDigit.RTS
|
||||||
|
cmp #'A'
|
||||||
|
bcs MEM.IsDigit.8
|
||||||
|
|
||||||
|
jmp IsDigit
|
||||||
|
|
||||||
|
MEM.IsDigit.9 sec
|
||||||
|
rts
|
||||||
|
|
||||||
|
MEM.IsDigit.8 clc
|
||||||
|
MEM.IsDigit.RTS rts
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.IsHexDigit jsr IsDigit
|
||||||
|
bcc .8
|
||||||
|
|
||||||
|
cmp #'A'
|
||||||
|
bcc MEM.IsDigit.9
|
||||||
|
cmp #'F'+1
|
||||||
|
bcc .1
|
||||||
|
|
||||||
|
cmp #'a'
|
||||||
|
bcc MEM.IsDigit.9
|
||||||
|
cmp #'f'+1
|
||||||
|
bcs MEM.IsDigit.RTS
|
||||||
|
|
||||||
|
eor #$20
|
||||||
|
.1
|
||||||
|
* clc
|
||||||
|
sbc #'A'-11 cc so A->10 (11-CC)
|
||||||
|
clc
|
||||||
|
|
||||||
|
.8 and #$0F
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.SetKeyCharY sta CLRWRITEAUX
|
||||||
|
sta (ZPSListDataPtr),y
|
||||||
|
sta SETWRITEAUX
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.GetDataByte sta CLRREADAUX
|
||||||
|
lda (ZPSListDataPtr)
|
||||||
|
sta SETREADAUX
|
||||||
|
bra MEM.SetDataByte.1
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.SetDataByte sta CLRWRITEAUX
|
||||||
|
sta (ZPSListDataPtr)
|
||||||
|
sta SETWRITEAUX
|
||||||
|
MEM.SetDataByte.1
|
||||||
|
inc ZPSListDataPtr
|
||||||
|
bne .8
|
||||||
|
inc ZPSListDataPtr+1
|
||||||
|
.8 rts
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.TXTPTR.GetY sta CLRREADAUX
|
||||||
|
lda (TXTPTR),y
|
||||||
|
sta SETREADAUX
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.TXTPTR.GetNext
|
||||||
|
sta CLRREADAUX
|
||||||
|
lda (TXTPTR)
|
||||||
|
sta SETREADAUX
|
||||||
|
beq .9
|
||||||
|
inc TXTPTR
|
||||||
|
bne .9
|
||||||
|
inc TXTPTR+1
|
||||||
|
.9 rts
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.SPtr1PPtr2 >STYA ZPPtr1
|
||||||
|
>PULLW ZPPtr2
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.SPtr2PPtr1 >STYA ZPPtr2
|
||||||
|
>PULLW ZPPtr1
|
||||||
|
rts
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.GetCharPtr1 lda (ZPPtr1)
|
||||||
|
bne MEM.NextCharPtr1
|
||||||
|
rts
|
||||||
|
|
||||||
|
MEM.PutCharPtr1 sta (ZPPtr1)
|
||||||
|
MEM.NextCharPtr1
|
||||||
|
inc ZPPtr1
|
||||||
|
bne .8
|
||||||
|
inc ZPPtr1+1 never Z
|
||||||
|
.8 rts
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.AddYp1ToPtr1
|
||||||
|
sec
|
||||||
|
.HS 90 BCC
|
||||||
|
MEM.AddYToPtr1 clc
|
||||||
|
tya
|
||||||
|
adc ZPPtr1
|
||||||
|
sta ZPPtr1
|
||||||
|
bcc .8
|
||||||
|
inc ZPPtr1+1
|
||||||
|
.8 rts
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.AddYp1ToPtr2
|
||||||
|
sec
|
||||||
|
.HS 90 BCC
|
||||||
|
MEM.AddYToPtr2 clc
|
||||||
|
tya
|
||||||
|
adc ZPPtr2
|
||||||
|
sta ZPPtr2
|
||||||
|
bcc .8
|
||||||
|
clc keep CC as some JMP exit here
|
||||||
|
inc ZPPtr2+1
|
||||||
|
.8 rts
|
||||||
|
*--------------------------------------
|
||||||
|
MEM.GetCharPtr2 lda (ZPPtr2)
|
||||||
|
bne MEM.NextCharPtr2
|
||||||
|
rts
|
||||||
|
|
||||||
|
MEM.PutCharPtr2 sta (ZPPtr2)
|
||||||
|
MEM.NextCharPtr2
|
||||||
|
inc ZPPtr2
|
||||||
|
bne .8
|
||||||
|
inc ZPPtr2+1
|
||||||
|
.8 rts
|
||||||
|
*--------------------------------------
|
||||||
|
MAN
|
||||||
|
SAVE USR/SRC/SYS/KERNEL.S.SHARED
|
||||||
|
LOAD USR/SRC/SYS/KERNEL.S
|
||||||
|
ASM
|
@ -232,11 +232,11 @@ K.FPutS jsr PFT.CheckNodeA set IO.hFD
|
|||||||
* + %011s : 'ABCDEFGH000'
|
* + %011s : 'ABCDEFGH000'
|
||||||
* + %2f : '3.14'
|
* + %2f : '3.14'
|
||||||
*\--------------------------------------
|
*\--------------------------------------
|
||||||
* .DUMMY
|
.DUMMY
|
||||||
* .OR ZPTMP
|
.OR ZPTMP+5 3 Bytes
|
||||||
PrintF.Cnt .BS 2
|
PrintF.Cnt .BS 2
|
||||||
PrintF.hFILE .BS 1
|
PrintF.hFILE .BS 1
|
||||||
* .ED
|
.ED
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
K.PrintF.GetFormat
|
K.PrintF.GetFormat
|
||||||
lda (pStack)
|
lda (pStack)
|
||||||
|
@ -7,13 +7,6 @@ SECSDAY .EQ 86400 60*60*24
|
|||||||
CENTURY0 .EQ 19
|
CENTURY0 .EQ 19
|
||||||
YEAR0 .EQ 70
|
YEAR0 .EQ 70
|
||||||
DAY0 .EQ 4 day 0 was a thursday
|
DAY0 .EQ 4 day 0 was a thursday
|
||||||
*--------------------------------------
|
|
||||||
.DUMMY
|
|
||||||
.OR ZPTMP
|
|
||||||
TIME.DWORD .BS 4
|
|
||||||
TIME.Century .BS 1
|
|
||||||
TIME.Year .BS 1
|
|
||||||
.ED
|
|
||||||
*/--------------------------------------
|
*/--------------------------------------
|
||||||
* # Time
|
* # Time
|
||||||
* Get System Time in Buffer
|
* Get System Time in Buffer
|
||||||
@ -46,7 +39,7 @@ K.PTime2Time jsr MEM.SPtr1PPtr2
|
|||||||
lsr C is high bit of month
|
lsr C is high bit of month
|
||||||
ldy #S.Time.YEAR
|
ldy #S.Time.YEAR
|
||||||
sta (ZPPtr2),y set year
|
sta (ZPPtr2),y set year
|
||||||
sta TIME.Year for conputing Century/WDAY later
|
sta ACC32+3 for conputing Century/WDAY later
|
||||||
|
|
||||||
lda (ZPPtr1) Get Month/day
|
lda (ZPPtr1) Get Month/day
|
||||||
pha save Day
|
pha save Day
|
||||||
@ -63,7 +56,7 @@ K.PTime2Time jsr MEM.SPtr1PPtr2
|
|||||||
iny
|
iny
|
||||||
sta (ZPPtr2),y set day
|
sta (ZPPtr2),y set day
|
||||||
|
|
||||||
lda TIME.Year get back year
|
lda ACC32+3 get back year
|
||||||
|
|
||||||
cmp #69 if before 70 CC,if > 70, CS
|
cmp #69 if before 70 CC,if > 70, CS
|
||||||
lda #0
|
lda #0
|
||||||
@ -71,7 +64,7 @@ K.PTime2Time jsr MEM.SPtr1PPtr2
|
|||||||
eor #1 toggle C
|
eor #1 toggle C
|
||||||
adc #19 set date before 1970 -> 20xx
|
adc #19 set date before 1970 -> 20xx
|
||||||
sta (ZPPtr2) set Century
|
sta (ZPPtr2) set Century
|
||||||
sta TIME.Century for conputing WDAY later
|
sta ACC32+2 for conputing WDAY later
|
||||||
|
|
||||||
ldy #2
|
ldy #2
|
||||||
lda (ZPPtr1),y Get Min
|
lda (ZPPtr1),y Get Min
|
||||||
@ -87,22 +80,22 @@ K.PTime2Time jsr MEM.SPtr1PPtr2
|
|||||||
iny
|
iny
|
||||||
lda #0
|
lda #0
|
||||||
sta (ZPPtr2),y set seconds (ProDOS does not provide it)
|
sta (ZPPtr2),y set seconds (ProDOS does not provide it)
|
||||||
|
*--------------------------------------
|
||||||
* 1/1/1970 was Thursday...if not leap, add one, if leap add 2
|
* 1/1/1970 was Thursday...if not leap, add one, if leap add 2
|
||||||
|
*--------------------------------------
|
||||||
K.ComputeWDAY lda #DAY0-1 Thursday : 4 (-1 for mod 7)
|
K.ComputeWDAY lda #DAY0-1 Thursday : 4 (-1 for mod 7)
|
||||||
pha
|
pha
|
||||||
lda #19
|
lda #19
|
||||||
sta TIME.DWORD
|
sta ACC32
|
||||||
lda #70
|
lda #70
|
||||||
sta TIME.DWORD+1
|
sta ACC32+1
|
||||||
|
|
||||||
.1 ldy TIME.DWORD
|
.1 ldy ACC32
|
||||||
lda TIME.DWORD+1
|
lda ACC32+1
|
||||||
|
|
||||||
cpy TIME.Century
|
cpy ACC32+2
|
||||||
bne .2
|
bne .2
|
||||||
cmp TIME.Year
|
cmp ACC32+3
|
||||||
beq .4
|
beq .4
|
||||||
|
|
||||||
.2 jsr TIME.IsLeapYearYA CS = Leap
|
.2 jsr TIME.IsLeapYearYA CS = Leap
|
||||||
@ -114,24 +107,25 @@ K.ComputeWDAY lda #DAY0-1 Thursday : 4 (-1 for mod 7)
|
|||||||
sbc #7 MOD 7
|
sbc #7 MOD 7
|
||||||
|
|
||||||
.3 pha
|
.3 pha
|
||||||
inc TIME.DWORD+1
|
inc ACC32+1
|
||||||
lda TIME.DWORD+1
|
lda ACC32+1
|
||||||
cmp #100
|
cmp #100
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
stz TIME.DWORD+1
|
stz ACC32+1
|
||||||
inc TIME.DWORD
|
inc ACC32
|
||||||
bra .1
|
bra .1
|
||||||
|
*--------------------------------------
|
||||||
.4 ldy #S.Time.MONTH
|
.4 ldy #S.Time.MONTH
|
||||||
lda (ZPPtr2),y get month
|
lda (ZPPtr2),y get month
|
||||||
tax
|
tax
|
||||||
|
|
||||||
.5 lda K.StrFTime.MDAY-1,x get day count in this month
|
.5 lda K.StrFTime.MDAY-1,x get day count in this month
|
||||||
|
clc
|
||||||
bne .6 february ?
|
bne .6 february ?
|
||||||
|
|
||||||
ldy TIME.Century
|
ldy ACC32+2
|
||||||
lda TIME.Year
|
lda ACC32+3
|
||||||
jsr TIME.IsLeapYearYA CS = Leap
|
jsr TIME.IsLeapYearYA CS = Leap
|
||||||
|
|
||||||
.6 pla
|
.6 pla
|
||||||
@ -217,13 +211,13 @@ K.CTime2Time jsr MEM.SPtr1PPtr2
|
|||||||
ldy #S.Time.WDAY
|
ldy #S.Time.WDAY
|
||||||
sta (ZPPtr2),y
|
sta (ZPPtr2),y
|
||||||
|
|
||||||
lda #CENTURY0
|
ldy #CENTURY0
|
||||||
sta TIME.Century
|
sty ZPPtr3
|
||||||
lda #YEAR0
|
lda #YEAR0
|
||||||
sta TIME.Year
|
sta ZPPtr3+1
|
||||||
K.CTime2Time.Year
|
K.CTime2Time.Year
|
||||||
.1 ldy TIME.Century
|
.1 ldy ZPPtr3
|
||||||
lda TIME.Year
|
lda ZPPtr3+1
|
||||||
jsr TIME.IsLeapYearYA if Leap year CS
|
jsr TIME.IsLeapYearYA if Leap year CS
|
||||||
|
|
||||||
rol Toggle Carry
|
rol Toggle Carry
|
||||||
@ -241,23 +235,23 @@ K.CTime2Time.Year
|
|||||||
pla
|
pla
|
||||||
sta ARG32
|
sta ARG32
|
||||||
|
|
||||||
inc TIME.Year
|
inc ZPPtr3
|
||||||
lda TIME.Year
|
lda ZPPtr3
|
||||||
cmp #100
|
cmp #100
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
stz TIME.Year
|
stz ZPPtr3
|
||||||
inc TIME.Century
|
inc ZPPtr3+1
|
||||||
bne .1
|
bne .1
|
||||||
|
|
||||||
.2 pla
|
.2 pla
|
||||||
|
|
||||||
lda TIME.Century
|
lda ZPPtr3+1
|
||||||
* ldy #S.Time.CENTURY
|
* ldy #S.Time.CENTURY
|
||||||
sta (ZPPtr2)
|
sta (ZPPtr2)
|
||||||
|
|
||||||
ldy #S.Time.YEAR
|
ldy #S.Time.YEAR
|
||||||
lda TIME.Year
|
lda ZPPtr3
|
||||||
sta (ZPPtr2),y
|
sta (ZPPtr2),y
|
||||||
K.CTime2Time.HMS
|
K.CTime2Time.HMS
|
||||||
ldx #3
|
ldx #3
|
||||||
|
@ -36,7 +36,7 @@ A2osX.AUX .PH $1000
|
|||||||
Mem.XLoMem .EQ *
|
Mem.XLoMem .EQ *
|
||||||
.LIST OFF
|
.LIST OFF
|
||||||
.EP
|
.EP
|
||||||
A2osX.GP .PH $BD00
|
A2osX.GP .PH A2osX.SYSCALL
|
||||||
.INB USR/SRC/SYS/KERNEL.S.GP
|
.INB USR/SRC/SYS/KERNEL.S.GP
|
||||||
.EP
|
.EP
|
||||||
A2osX.D1 .PH $D000
|
A2osX.D1 .PH $D000
|
||||||
@ -65,15 +65,11 @@ A2osX.E0 .PH $E000
|
|||||||
.INB USR/SRC/SYS/KERNEL.S.MEM
|
.INB USR/SRC/SYS/KERNEL.S.MEM
|
||||||
.INB USR/SRC/SYS/KERNEL.S.MATH
|
.INB USR/SRC/SYS/KERNEL.S.MATH
|
||||||
.INB USR/SRC/SYS/KERNEL.S.TERMLC
|
.INB USR/SRC/SYS/KERNEL.S.TERMLC
|
||||||
|
.INB USR/SRC/SYS/KERNEL.S.SHARED
|
||||||
********* TMP ***** go to A2osX.D1
|
********* TMP ***** go to A2osX.D1
|
||||||
.INB USR/SRC/SYS/KERNEL.S.IO
|
.INB USR/SRC/SYS/KERNEL.S.IO
|
||||||
********* TMP ***** go to A2osX.D2
|
********* TMP ***** go to A2osX.D2
|
||||||
*--------------------------------------
|
*--------------------------------------
|
||||||
DevMgr.Stat .DA DevMgr.FreeMem
|
|
||||||
DevMgr.Free .DA DevMgr.FreeMem
|
|
||||||
.DA DevMgr.HiMem
|
|
||||||
DevMgr.DevIdx .DA #1
|
|
||||||
*--------------------------------------
|
|
||||||
PWD.bDirty .BS 1
|
PWD.bDirty .BS 1
|
||||||
PWD.hDB .BS 1
|
PWD.hDB .BS 1
|
||||||
PWD.DBPtr .BS 2
|
PWD.DBPtr .BS 2
|
||||||
|
Loading…
Reference in New Issue
Block a user