Kernel 0.92+

This commit is contained in:
Rémy GIBERT 2019-02-19 14:51:33 +00:00
parent 01fa428204
commit a225b5fe66
6 changed files with 55 additions and 43 deletions

Binary file not shown.

View File

@ -226,7 +226,7 @@ CS.RUN.GETC >LDA.G hFILE
ldy #S.PS.hStdErr
lda (pPS),y
>SYSCALL GetC
bra .2
rts
.1 >SYSCALL GetChar
.2 rts
@ -269,7 +269,10 @@ CS.RUN.GETLINE >PUSHWI 256
.8 sta (ZPBufPtr),y
clc
.9 rts
rts
.9 >DEBUG
rts
*--------------------------------------
CS.RUN.PRINT >LDA.G bLineNum
bpl .1

View File

@ -38,6 +38,7 @@ IO.Reset.In >LDA.G IO.hIn
ldy #S.PS.hStdIn
lda (pPS),y
>SYSCALL fclose
pla

View File

@ -42,7 +42,7 @@ GP.CodeStart jmp GP.SysCall
*--------------------------------------
* SLEEP
*--------------------------------------
php
GP.Sleep php
sei
phy
@ -112,49 +112,60 @@ GP.CodeStart jmp GP.SysCall
* *** MUST BE REINTRANT ***
*--------------------------------------
GP.SysCall dec IRQ.InKernel
sty .5+1 save Y (Func Arg)
sta .6+1 save A (Func Arg)
stx .7+1 save X (Func ID)
bit K.SYSCALL.BANK,x
bmi .1
jsr .8 in $E000, no BNK change
inc IRQ.InKernel
rts
.1 sta .7+1 save A (Func Arg)
lda K.SYSCALL.BANK,x Get Target BNK
bpl .1 0, E000, no BNK change
cmp $D000 #RRAMWRAMBNK1 or #RRAMWRAMBNK2
bne .2
jsr .7 same as actual BNK...go restore A and JMP
inc IRQ.InKernel
rts
.2 stx .6+1 save X (Func ID)
beq .1 same as actual BNK...go restore A and JMP
tax set Target BNK in x
lda $D000 get source BNK
bit $C000,x switch to Target BNK
bit $C000,x
pha
jsr .6 go to kernel.....
.1 pha remember source BNK
jsr .5 go to kernel.....
stx .5+1 save X
stx .4+1 save X
plx get back Source BNK
bit $C000,x switch to Target BNK
bit $C000,x
bit $C000,x
.5 ldx #$FF Self Modified
bcc .4 no error quit...
tax CS,A=0 ?
bne .4 no, return error to caller
pla get PC LO
plx get PC HI
sec
sbc #3 move back JSR GP.SysCall
bcs .2
dex
.2 phx
pha
ldy .5+1
lda .6+1
ldx .7+1
jmp GP.Sleep
.4 ldx #$FF Self Modified
inc IRQ.InKernel
rts Unmodified Carry
.6 ldx #$FF Self Modified
.7 lda #$FF Self Modified
.8 jmp (K.SYSCALL.JMP,x)
.5 ldy #$FF Self Modified
.6 lda #$FF Self Modified
.7 ldx #$FF Self Modified
jmp (K.SYSCALL.JMP,x)
*--------------------------------------
GP.LibCall dec IRQ.InKernel
@ -193,10 +204,6 @@ GP.RomCallPushFAC
sta FORPNT+1
ldx #ROM.GETFAC
jsr GP.ROMCALL
clc
rts
*--------------------------------------
GP.RomCall dec IRQ.InKernel
@ -214,7 +221,8 @@ GP.RomCall dec IRQ.InKernel
bit $C000,x
inc IRQ.InKernel
clc
rts
.1 jmp (.2,x)
@ -352,12 +360,6 @@ CORE.Tick10t .BS 1
CORE.CPUStatCnt .DA #100
CORE.LastPSID .DA #0
*--------------------------------------
DevMgr.Stat .DA DevMgr.FreeMem
DevMgr.Free .DA DevMgr.FreeMem
.DA DevMgr.HiMem
DevMgr.DevCnt .DA #0
DevMgr.NodCnt .DA #0
*--------------------------------------
IRQ.Mode .BS 1
IRQ.SkipA2osX .BS 1
IRQ.Tick .BS 1

View File

@ -438,7 +438,7 @@ IO.READ.PIPE >PULLW .3+1 S.IOCTL.BUFPTR
sec
rts
.99 lda #C.EOF
.99 lda #MLI.E.EOF
sec
rts
*--------------------------------------
@ -494,7 +494,7 @@ IO.WRITE.PIPE >PULLW .2+1 S.IOCTL.BUFPTR
sec
rts
.99 lda #C.EOF
.99 lda #MLI.E.EOF
sec
rts
*/--------------------------------------

View File

@ -745,6 +745,12 @@ MEM.NextCharPtr2
inc ZPPtr2+1
.8 rts
*--------------------------------------
DevMgr.Stat .DA DevMgr.FreeMem
DevMgr.Free .DA DevMgr.FreeMem
.DA DevMgr.HiMem
DevMgr.DevCnt .DA #0
DevMgr.NodCnt .DA #0
*--------------------------------------
MAN
SAVE USR/SRC/SYS/KERNEL.S.MEM
LOAD USR/SRC/SYS/KERNEL.S