2017-12-22 21:24:30 +00:00
|
|
|
|
NEW
|
2019-05-25 19:24:07 +00:00
|
|
|
|
AUTO 3,1
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-26 16:00:52 +00:00
|
|
|
|
* SYSCALL (AUXLC to AUXLC)
|
2021-01-12 21:14:13 +00:00
|
|
|
|
* Used by user & kernel for inter bank Calls
|
2016-06-07 06:10:18 +00:00
|
|
|
|
* In:
|
|
|
|
|
* X = SYSfnc.Index
|
|
|
|
|
* Y,A = free for Inline param
|
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
GP.CS jmp GP.SysCall
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* LIBCALL (AUXLC to AUXLC)
|
2021-01-12 21:14:13 +00:00
|
|
|
|
* Used by user
|
2016-06-07 06:10:18 +00:00
|
|
|
|
* In:
|
|
|
|
|
* Y = LIB.ID
|
|
|
|
|
* X = LIBfnc.Index
|
|
|
|
|
* A = free for Inline param
|
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
jmp GP.LibCall
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-05 21:23:21 +00:00
|
|
|
|
* AppleTalk MLICALL (AUXLC to MAINLC)
|
|
|
|
|
* Used by user
|
2016-06-07 06:10:18 +00:00
|
|
|
|
* In:
|
2017-11-05 21:23:21 +00:00
|
|
|
|
* Y,A = Params
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-05 21:23:21 +00:00
|
|
|
|
jmp GP.AtkCall
|
2016-11-25 16:20:28 +00:00
|
|
|
|
*--------------------------------------
|
2018-06-14 15:31:36 +00:00
|
|
|
|
* ROMCALL (AUXLC to ROMLC)
|
2017-08-31 15:35:15 +00:00
|
|
|
|
* Used by Kernel
|
|
|
|
|
* In:
|
2018-06-14 15:31:36 +00:00
|
|
|
|
* X = ROM Function
|
|
|
|
|
* Y,A = Param
|
2017-08-31 15:35:15 +00:00
|
|
|
|
*--------------------------------------
|
2019-07-07 20:48:57 +00:00
|
|
|
|
jmp GP.FpuCall
|
2017-07-01 13:44:40 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* BADCALL
|
|
|
|
|
*--------------------------------------
|
2017-10-26 16:01:54 +00:00
|
|
|
|
lda #MLI.E.BADCALL
|
2017-07-01 13:44:40 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
2017-11-22 16:27:50 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* SLEEP
|
2017-11-17 16:16:05 +00:00
|
|
|
|
*--------------------------------------
|
2019-02-19 14:51:33 +00:00
|
|
|
|
GP.Sleep php
|
2018-04-28 12:10:58 +00:00
|
|
|
|
sei
|
|
|
|
|
|
|
|
|
|
phy
|
|
|
|
|
ldy #S.PS.A
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2018-04-28 12:10:58 +00:00
|
|
|
|
txa
|
|
|
|
|
iny #S.PS.X
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2018-04-28 12:10:58 +00:00
|
|
|
|
pla
|
2019-05-04 21:13:50 +00:00
|
|
|
|
iny #S.PS.Y
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2018-04-28 12:10:58 +00:00
|
|
|
|
pla
|
|
|
|
|
iny #S.PS.P
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2018-04-28 12:10:58 +00:00
|
|
|
|
|
|
|
|
|
pla get PC LO
|
|
|
|
|
plx get PC HI
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2018-04-28 12:10:58 +00:00
|
|
|
|
inc Advance one byte because of return by RTI
|
2019-05-04 21:13:50 +00:00
|
|
|
|
bne GP.Sleep2
|
2018-04-28 12:10:58 +00:00
|
|
|
|
inx
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2019-05-04 21:13:50 +00:00
|
|
|
|
GP.Sleep2 ldy #S.PS.PC
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2018-04-28 12:10:58 +00:00
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
iny #S.PS.PC+1
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2018-04-28 12:10:58 +00:00
|
|
|
|
|
|
|
|
|
tsx
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
|
|
|
|
inx
|
2021-01-12 21:14:13 +00:00
|
|
|
|
|
2019-01-04 13:17:31 +00:00
|
|
|
|
inx keep PC HI,LO from KERNEL jsr PSExec/PSResume
|
|
|
|
|
inx Stack Ptr is $1ff if empty
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2018-04-28 12:10:58 +00:00
|
|
|
|
txa
|
2019-01-04 13:17:31 +00:00
|
|
|
|
beq .3
|
2018-04-28 12:10:58 +00:00
|
|
|
|
|
|
|
|
|
tay Save !Byte count for later
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2018-04-28 12:10:58 +00:00
|
|
|
|
.2 pla
|
|
|
|
|
>PUSHA
|
|
|
|
|
inx
|
|
|
|
|
bne .2
|
2019-10-03 06:25:27 +00:00
|
|
|
|
|
2018-04-28 12:10:58 +00:00
|
|
|
|
tya
|
2021-01-12 21:14:13 +00:00
|
|
|
|
|
2019-01-04 13:17:31 +00:00
|
|
|
|
.3 >PUSHA push CPU Stack BC to restore on top of Soft Stack
|
2018-04-28 12:10:58 +00:00
|
|
|
|
|
2019-01-04 13:17:31 +00:00
|
|
|
|
inc $1fe PC=PC+1
|
|
|
|
|
bne .4
|
2020-12-15 13:23:22 +00:00
|
|
|
|
|
2019-01-04 13:17:31 +00:00
|
|
|
|
inc $1ff because of RTI
|
2020-12-15 13:23:22 +00:00
|
|
|
|
|
2020-02-28 07:21:46 +00:00
|
|
|
|
.4 lda (pPS)
|
2018-04-28 12:10:58 +00:00
|
|
|
|
ora #S.PS.F.SLEEP
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS)
|
2018-04-28 12:10:58 +00:00
|
|
|
|
lda #0 cld,clc,cli
|
|
|
|
|
pha
|
|
|
|
|
rti exit to kernel with CC
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
2016-09-26 16:00:52 +00:00
|
|
|
|
* *** MUST BE REINTRANT ***
|
|
|
|
|
*--------------------------------------
|
2018-04-10 15:03:29 +00:00
|
|
|
|
GP.SysCall dec IRQ.InKernel
|
2016-09-26 16:00:52 +00:00
|
|
|
|
|
2019-05-04 21:13:50 +00:00
|
|
|
|
pha
|
|
|
|
|
phy
|
|
|
|
|
ldy #S.PS.A
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2019-05-04 21:13:50 +00:00
|
|
|
|
txa
|
|
|
|
|
iny #S.PS.X
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2019-05-04 21:13:50 +00:00
|
|
|
|
pla
|
|
|
|
|
iny #S.PS.Y
|
2020-02-28 07:21:46 +00:00
|
|
|
|
sta (pPS),y
|
2019-05-04 21:13:50 +00:00
|
|
|
|
tay
|
|
|
|
|
pla
|
2019-05-12 20:45:11 +00:00
|
|
|
|
jsr K.SYSCALL2
|
2019-05-04 21:13:50 +00:00
|
|
|
|
bcc .2 no error quit...
|
2020-12-15 13:23:22 +00:00
|
|
|
|
|
2019-02-19 14:51:33 +00:00
|
|
|
|
tax CS,A=0 ?
|
2019-05-04 21:13:50 +00:00
|
|
|
|
beq .3 Yes, BLOCKING I/O
|
2018-04-10 15:03:29 +00:00
|
|
|
|
|
2019-05-04 21:13:50 +00:00
|
|
|
|
.2 inc IRQ.InKernel
|
|
|
|
|
rts Unmodified Carry
|
|
|
|
|
|
2019-10-03 06:25:27 +00:00
|
|
|
|
.3 sei
|
2021-01-12 21:14:13 +00:00
|
|
|
|
inc IRQ.InKernel
|
|
|
|
|
|
|
|
|
|
GO.Sleep2 pla get PC LO
|
2019-10-03 06:25:27 +00:00
|
|
|
|
plx get PC HI
|
2019-05-04 21:13:50 +00:00
|
|
|
|
* sec
|
2021-01-12 21:14:13 +00:00
|
|
|
|
sbc #2
|
|
|
|
|
bcs GP.Sleep2
|
2020-12-15 13:23:22 +00:00
|
|
|
|
|
2019-02-19 14:51:33 +00:00
|
|
|
|
dex
|
2020-12-15 13:23:22 +00:00
|
|
|
|
|
2021-01-12 21:14:13 +00:00
|
|
|
|
.1 bra GP.Sleep2
|
2016-09-26 16:00:52 +00:00
|
|
|
|
*--------------------------------------
|
2019-03-27 17:01:01 +00:00
|
|
|
|
GP.LibCall dec IRQ.InLib
|
2018-04-10 15:03:29 +00:00
|
|
|
|
|
2021-01-12 21:14:13 +00:00
|
|
|
|
pha
|
|
|
|
|
phy
|
|
|
|
|
ldy #S.PS.A
|
|
|
|
|
sta (pPS),y
|
|
|
|
|
txa
|
|
|
|
|
iny #S.PS.X
|
|
|
|
|
sta (pPS),y
|
|
|
|
|
pla
|
|
|
|
|
iny #S.PS.Y
|
|
|
|
|
sta (pPS),y
|
|
|
|
|
|
2019-01-04 13:17:31 +00:00
|
|
|
|
jsr K.GetMemPtr Get LIB Code Segment (MemMgr in $E000, no BNK change)
|
2017-03-27 15:32:30 +00:00
|
|
|
|
>STYA .1+1
|
2016-06-07 06:10:18 +00:00
|
|
|
|
pla
|
2020-12-15 13:23:22 +00:00
|
|
|
|
|
2019-01-04 13:17:31 +00:00
|
|
|
|
.1 jsr $FFFF SELF MODIFIED
|
2018-04-10 15:03:29 +00:00
|
|
|
|
|
2021-01-12 21:14:13 +00:00
|
|
|
|
bcc .2
|
|
|
|
|
|
|
|
|
|
tax
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
.2 inc IRQ.InLib
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.3 sei
|
|
|
|
|
inc IRQ.InLib
|
|
|
|
|
|
|
|
|
|
bra GO.Sleep2
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
2018-04-10 15:03:29 +00:00
|
|
|
|
GP.AtkCall dec IRQ.InKernel
|
|
|
|
|
|
2019-05-04 21:13:50 +00:00
|
|
|
|
>STYA .1
|
2020-12-15 13:23:22 +00:00
|
|
|
|
|
2019-05-04 21:13:50 +00:00
|
|
|
|
jsr GO.ProDOS
|
2020-12-15 13:23:22 +00:00
|
|
|
|
|
2019-05-04 21:13:50 +00:00
|
|
|
|
jsr MLI
|
|
|
|
|
.DA #MLIATALK
|
|
|
|
|
.1 .DA *
|
2020-12-15 13:23:22 +00:00
|
|
|
|
|
2019-05-04 21:13:50 +00:00
|
|
|
|
jsr GO.A2osX
|
2020-12-15 13:23:22 +00:00
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
inc IRQ.InKernel
|
2019-03-27 17:01:01 +00:00
|
|
|
|
rts
|
2019-08-01 14:59:15 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # Add32,Sub32,Mul32,IMul32,Div32,IDiv32,Mod32,IMod32,Cmp32,ICmp32
|
|
|
|
|
* Return X+Y, X-Y, X*Y, X/Y, X mod Y....
|
|
|
|
|
* ## ASM
|
|
|
|
|
* **In:**
|
2020-02-16 20:45:16 +00:00
|
|
|
|
* `>PUSHL X (long)`
|
|
|
|
|
* `>PUSHL Y (long)`
|
2019-08-01 14:59:15 +00:00
|
|
|
|
* `>FPU add32`
|
|
|
|
|
* `...`
|
|
|
|
|
* ## RETURN VALUE
|
|
|
|
|
* On stack (long)
|
|
|
|
|
*\--------------------------------------
|
2019-07-28 20:39:30 +00:00
|
|
|
|
GP.FpuCall dec IRQ.InKernel
|
2021-05-04 17:31:21 +00:00
|
|
|
|
cpx #FPU.FMUL
|
2020-02-16 20:45:16 +00:00
|
|
|
|
bcs .1
|
2021-01-12 21:14:13 +00:00
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
jsr MATH math16 & math32, direct JMP
|
|
|
|
|
|
|
|
|
|
inc IRQ.InKernel
|
|
|
|
|
rts
|
2020-02-16 20:45:16 +00:00
|
|
|
|
|
|
|
|
|
.1 phx
|
2019-07-28 20:39:30 +00:00
|
|
|
|
jsr GP.SetFAC Get float from stack
|
|
|
|
|
plx
|
|
|
|
|
cpx #FPU.PWR+1
|
2021-05-04 17:31:21 +00:00
|
|
|
|
bcs GP.GetFAC
|
2019-07-26 14:23:07 +00:00
|
|
|
|
*/--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
* # FAdd,FSub,FMul,FDiv,FPwr
|
|
|
|
|
* Return X*Y, X/Y, X+Y, X-Y
|
|
|
|
|
* ## C
|
|
|
|
|
* `float pwr ( float x, float y);`
|
2019-07-26 14:23:07 +00:00
|
|
|
|
* ## ASM
|
|
|
|
|
* **In:**
|
|
|
|
|
* `>PUSHF X (float)`
|
|
|
|
|
* `>PUSHF Y (float)`
|
2021-05-04 17:31:21 +00:00
|
|
|
|
* `>FPU fmul`
|
|
|
|
|
* `>FPU fdiv`
|
|
|
|
|
* `>FPU fmod` TODO
|
2019-07-26 14:23:07 +00:00
|
|
|
|
* `>FPU fadd`
|
|
|
|
|
* `>FPU fsub`
|
|
|
|
|
* `>FPU fpwr`
|
|
|
|
|
* ## RETURN VALUE
|
|
|
|
|
* On stack (float)
|
|
|
|
|
*\--------------------------------------
|
2019-07-28 20:39:30 +00:00
|
|
|
|
lda pStack
|
|
|
|
|
clc
|
|
|
|
|
adc #5
|
|
|
|
|
sta pStack
|
|
|
|
|
phx
|
|
|
|
|
jsr GP.SetARG
|
|
|
|
|
plx
|
2019-07-26 14:23:07 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # 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)
|
|
|
|
|
*\--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
GP.GetFAC jsr GP.ROMCALL
|
2021-01-12 21:14:13 +00:00
|
|
|
|
|
2019-07-28 20:39:30 +00:00
|
|
|
|
lda pStack
|
|
|
|
|
ldy pStack+1
|
|
|
|
|
sta FORPNT Ptr to dst buffer
|
|
|
|
|
sty FORPNT+1
|
|
|
|
|
ldx #FPU.GETFAC
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
GP.RomCall phx
|
|
|
|
|
ldx $D000
|
|
|
|
|
stx .8+1
|
|
|
|
|
bit RROMBNK1
|
|
|
|
|
plx
|
2020-02-16 20:45:16 +00:00
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
jsr MATHF
|
2021-01-12 21:14:13 +00:00
|
|
|
|
|
2019-07-28 20:39:30 +00:00
|
|
|
|
.8 ldx #$ff
|
|
|
|
|
bit $C000,x
|
|
|
|
|
bit $C000,x
|
|
|
|
|
rts
|
2019-07-26 14:23:07 +00:00
|
|
|
|
*--------------------------------------
|
2019-08-01 14:59:15 +00:00
|
|
|
|
GP.SetARG ldx #FPU.SETARG
|
|
|
|
|
.HS 2C BIT ABS
|
|
|
|
|
GP.SetFAC ldx #FPU.SETFAC
|
2019-09-02 15:34:10 +00:00
|
|
|
|
lda pStack
|
|
|
|
|
ldy pStack+1
|
2019-08-01 14:59:15 +00:00
|
|
|
|
bra GP.RomCall
|
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # float
|
|
|
|
|
* Return 'floated' long
|
|
|
|
|
* ## C
|
|
|
|
|
* `float f = (float)l;
|
|
|
|
|
* ## ASM
|
|
|
|
|
* **In:**
|
|
|
|
|
* `>PUSHL l` (long)
|
|
|
|
|
* `>FPU float`
|
|
|
|
|
* ## RETURN VALUE
|
|
|
|
|
* On stack (float)
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
GP.Float ldy #3
|
|
|
|
|
|
|
|
|
|
.1 lda (pStack),y
|
|
|
|
|
sta FAC+1,y Reverse Order
|
|
|
|
|
dey
|
|
|
|
|
bpl .1
|
2020-08-23 19:46:37 +00:00
|
|
|
|
|
2019-08-01 14:59:15 +00:00
|
|
|
|
dec pStack keep 5 bytes on stack
|
|
|
|
|
stz FAC.SIGN
|
|
|
|
|
lda #$80+32
|
|
|
|
|
sta FAC Positive + Exp=32
|
|
|
|
|
ldx #FPU.LTOF
|
|
|
|
|
|
2021-05-04 17:31:21 +00:00
|
|
|
|
bra GP.GetFAC
|
2019-08-01 14:59:15 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # lrintf
|
|
|
|
|
* Return float rounded into a long
|
|
|
|
|
* ## C
|
|
|
|
|
* `long int lrintf (float x);`
|
|
|
|
|
* ## ASM
|
|
|
|
|
* **In:**
|
|
|
|
|
* `>PUSHF x`
|
|
|
|
|
* `>FPU lrintf`
|
|
|
|
|
* ## RETURN VALUE
|
|
|
|
|
* On stack (long)
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
GP.lrintf jsr GP.SetFAC
|
|
|
|
|
inc pStack keep 4 bytes on stack
|
|
|
|
|
ldx #FPU.QINT
|
2021-01-12 21:14:13 +00:00
|
|
|
|
jsr GP.ROMCALL
|
2019-08-01 14:59:15 +00:00
|
|
|
|
|
|
|
|
|
ldy #3
|
2020-12-15 13:23:22 +00:00
|
|
|
|
|
2019-08-01 14:59:15 +00:00
|
|
|
|
.1 lda FAC+1,y
|
|
|
|
|
sta (pStack),y
|
|
|
|
|
dey
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* MLI : From Kernel Aux LC to Main LC
|
2019-07-26 14:23:07 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-05 21:23:21 +00:00
|
|
|
|
GP.MLICall stx .1
|
|
|
|
|
sta K.MLI.PARAMS
|
|
|
|
|
jsr GO.ProDOS
|
|
|
|
|
jsr MLI
|
|
|
|
|
.1 .BS 1
|
|
|
|
|
.DA K.MLI.PARAMS
|
|
|
|
|
jsr GO.A2osX
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-03-31 15:24:42 +00:00
|
|
|
|
GO.ProDOS pha
|
|
|
|
|
lda $D000 We re coming from AUXLC, saving bank...
|
2016-09-26 16:00:52 +00:00
|
|
|
|
sta GO.A2osX.BNK+1
|
2017-03-31 15:24:42 +00:00
|
|
|
|
pla
|
2016-09-05 16:00:11 +00:00
|
|
|
|
php
|
2016-06-07 06:10:18 +00:00
|
|
|
|
clc
|
|
|
|
|
.HS 2C bit abs
|
2016-09-26 16:00:52 +00:00
|
|
|
|
GO.A2osX php
|
2016-06-07 06:10:18 +00:00
|
|
|
|
sec
|
|
|
|
|
sei
|
2017-05-03 15:40:02 +00:00
|
|
|
|
sta GO.EXIT.SaveA+1
|
|
|
|
|
stx GO.EXIT.SaveX+1
|
|
|
|
|
sty GO.EXIT.SaveY+1
|
2016-09-05 16:00:11 +00:00
|
|
|
|
pla Restore P in A for later
|
|
|
|
|
plx Get PC and add 1 for return
|
2016-06-07 06:10:18 +00:00
|
|
|
|
ply
|
|
|
|
|
inx
|
|
|
|
|
bne .1
|
|
|
|
|
iny
|
|
|
|
|
.1 stx GO.EXIT.JMP+1
|
|
|
|
|
sty GO.EXIT.JMP+2
|
|
|
|
|
|
2016-09-26 16:00:52 +00:00
|
|
|
|
bcs GO.A2osX.BNK if CS, go AUXLC
|
2016-09-05 16:00:11 +00:00
|
|
|
|
bit RRAMWRAMBNK1 Go MAINLC (ProDOS), always BNK1
|
2020-12-15 13:23:22 +00:00
|
|
|
|
* bit RRAMWRAMBNK1
|
2016-09-05 16:00:11 +00:00
|
|
|
|
|
|
|
|
|
tsx
|
2021-05-04 17:31:21 +00:00
|
|
|
|
stx SaveSX
|
|
|
|
|
ldx SaveSM
|
2016-06-07 06:10:18 +00:00
|
|
|
|
txs
|
2016-09-05 16:00:11 +00:00
|
|
|
|
sta CLRALTZP
|
2016-06-07 06:10:18 +00:00
|
|
|
|
bra GO.EXIT
|
2016-09-05 16:00:11 +00:00
|
|
|
|
|
2016-09-28 15:34:15 +00:00
|
|
|
|
GO.A2osX.BNK ldx #RRAMWRAMBNK1 Self Modified, initialized to BNK1 for INIT3
|
2016-09-05 16:00:11 +00:00
|
|
|
|
|
|
|
|
|
bit $C000,x
|
2020-12-15 13:23:22 +00:00
|
|
|
|
* bit $C000,x
|
2016-09-05 16:00:11 +00:00
|
|
|
|
sta SETALTZP
|
2016-06-07 06:10:18 +00:00
|
|
|
|
tsx
|
2021-05-04 17:31:21 +00:00
|
|
|
|
stx SaveSM
|
|
|
|
|
ldx SaveSX
|
2016-06-07 06:10:18 +00:00
|
|
|
|
txs
|
|
|
|
|
*--------------------------------------
|
2017-09-12 15:24:36 +00:00
|
|
|
|
GO.EXIT pha push P on stack
|
2017-05-03 15:40:02 +00:00
|
|
|
|
GO.EXIT.SaveY ldy #$ff
|
|
|
|
|
GO.EXIT.SaveX ldx #$ff
|
|
|
|
|
GO.EXIT.SaveA lda #$ff
|
2016-06-07 06:10:18 +00:00
|
|
|
|
plp
|
2018-11-19 07:43:00 +00:00
|
|
|
|
GO.EXIT.JMP jmp $FFFF SELF MODIFIED
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
2017-11-23 16:51:52 +00:00
|
|
|
|
* Called from ProDOS IRQ Manager (LCBNK1)
|
2017-01-25 16:18:35 +00:00
|
|
|
|
* A,X,Y, $FA->$FF Already Saved
|
|
|
|
|
* Main RAM,ZP/LC selected
|
|
|
|
|
* must begin with CLD
|
|
|
|
|
* must exit with RTS
|
|
|
|
|
* - CC if IRQ cleared, CS if NOT
|
|
|
|
|
*--------------------------------------
|
2020-09-24 15:31:48 +00:00
|
|
|
|
GP.IRQ cld
|
2018-04-05 20:32:22 +00:00
|
|
|
|
|
2021-01-12 21:14:13 +00:00
|
|
|
|
bit IRQ.Skip After A2osX IRQ.H ?
|
2020-09-24 15:31:48 +00:00
|
|
|
|
bmi GP.IRQ.Exit
|
2020-11-25 16:29:06 +00:00
|
|
|
|
|
2018-04-27 14:35:55 +00:00
|
|
|
|
sta SETALTZP switch to aux LC
|
2017-01-25 16:18:35 +00:00
|
|
|
|
tsx
|
2021-05-04 17:31:21 +00:00
|
|
|
|
stx SaveSM
|
|
|
|
|
ldx SaveSX
|
2017-01-25 16:18:35 +00:00
|
|
|
|
txs
|
2018-04-27 14:35:55 +00:00
|
|
|
|
|
2020-09-24 15:31:48 +00:00
|
|
|
|
GP.IRQ.JSR jsr CORE.IRQ.DEV SELF MODIFIED
|
2020-11-25 16:29:06 +00:00
|
|
|
|
|
2018-04-27 13:43:40 +00:00
|
|
|
|
tsx go back to Main
|
2021-05-04 17:31:21 +00:00
|
|
|
|
stx SaveSX
|
|
|
|
|
ldx SaveSM
|
2017-01-25 16:18:35 +00:00
|
|
|
|
txs
|
|
|
|
|
sta CLRALTZP
|
2019-10-03 06:25:27 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2020-09-25 12:05:23 +00:00
|
|
|
|
GP.IRQ.Exit stz IRQ.Skip reset flag
|
2018-04-27 14:35:55 +00:00
|
|
|
|
sec
|
2018-04-05 20:32:22 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2017-10-18 15:32:56 +00:00
|
|
|
|
*GO.Reset jsr GO.A2osX
|
|
|
|
|
* jmp CORE.Run
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
*BrkHandler bra *
|
2017-05-03 15:40:02 +00:00
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
GP.CE .BS $BED0-*
|
2017-10-27 14:56:46 +00:00
|
|
|
|
*--------------------------------------
|
2020-03-12 07:46:43 +00:00
|
|
|
|
* $BED0->$BEEF : Public Variables
|
2017-10-27 14:56:46 +00:00
|
|
|
|
*--------------------------------------
|
2020-03-12 07:46:43 +00:00
|
|
|
|
.BS 32
|
2017-10-27 14:56:46 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* $BEF0->$BEFF : Kernel Config Block
|
2017-05-03 15:40:02 +00:00
|
|
|
|
*--------------------------------------
|
2018-04-28 12:10:58 +00:00
|
|
|
|
.DA #6 A2osX.HZ=60hz
|
2019-01-21 21:45:47 +00:00
|
|
|
|
.DA #2 A2osX.TTYDEVS=2
|
2018-12-10 16:45:37 +00:00
|
|
|
|
.HS 000000000000
|
2018-04-27 14:35:55 +00:00
|
|
|
|
.DA #0 ChRoot/Preemptive Disabled
|
|
|
|
|
.HS 00000000000000 All Slots marked as "Free"
|
2016-06-07 06:10:18 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2020-12-15 13:23:22 +00:00
|
|
|
|
SAVE usr/src/sys/kernel.s.gp
|
|
|
|
|
LOAD usr/src/sys/kernel.s
|
2016-06-07 06:10:18 +00:00
|
|
|
|
ASM
|