Kernel 0.9.2

This commit is contained in:
Rémy GIBERT 2018-07-04 16:59:12 +02:00
parent 058eb00a47
commit 939745ccbf
5 changed files with 118 additions and 10 deletions

View File

@ -468,10 +468,11 @@ LIBMGR.UNLOAD .EQ 2
*--------------------------------------
* Task Function Indexes
*--------------------------------------
TSKMGR.INIT .EQ 0
TSKMGR.RUN .EQ 2
TSKMGR.DOEVENT .EQ 4
TSKMGR.QUIT .EQ 6
PS.INIT .EQ 0
PS.RUN .EQ 2
PS.DOEVENT .EQ 4
PS.QUIT .EQ 6
PS.RESUME .EQ 8
*--------------------------------------
* EVENT STRUCT
*--------------------------------------

View File

@ -129,7 +129,7 @@ K.IOBuf .EQ $0F00
*--------------------------------------
*** Z80 Reserved $1000-10FF***
*--------------------------------------
Z80JMP .EQ $1000 (00000h) Up To $10FF
Z80CODE .EQ $1000 (00000h) Up To $10FF
Z80STACK .EQ $10FF (000FFh) Down to $1000
*--------------------------------------
* CORE $1100->$17FF = $700 Main

View File

@ -461,14 +461,14 @@ CORE.PSExec lda (pPS)
bit #S.PS.F.INIT
bne .1
ldx #TSKMGR.QUIT
ldx #PS.QUIT
.HS 2C BIT ABS
.1 ldx #TSKMGR.INIT
.1 ldx #PS.INIT
.HS 2C BIT ABS
.2 ldx #TSKMGR.RUN
.2 ldx #PS.RUN
.HS 2C BIT ABS
CORE.PSDoEvent ldx #TSKMGR.DOEVENT
CORE.PSDoEvent ldx #PS.DOEVENT
lda pCode+1
pha

View File

@ -376,7 +376,7 @@ Detect6502 ldy #0 Test 6502 BCD bug
*--------------------------------------
DetectZ80 ldx #Z80Code.Size
.1 lda Z80Code.Start-1,x
sta $1000-1,x 00000H for Z80
sta Z80CODE-1,x 00000H for Z80
dex
bne .1

107
SYS/KERNEL.S.Z80.txt Normal file
View File

@ -0,0 +1,107 @@
NEW
PREFIX /A2OSX.BUILD
AUTO 4,1
*--------------------------------------
Z80.pPs .EQ pPs+0F000H
Z80.pCode .EQ pCode+0F000H
Z80.pData .EQ pData+0F000H
Z80.pStack .EQ pStack+0F000H
Z80.pLocal .EQ pLocal+0F000H
*--------------------------------------
Z80.6502P.N .EQ %10000000
Z80.6502P.V .EQ %01000000
Z80.6502P.B .EQ %00010000
Z80.6502P.D .EQ %00001000
Z80.6502P.I .EQ %00000100
Z80.6502P.Z .EQ %00000010
Z80.6502P.C .EQ %00000001
*--------------------------------------
.OP Z80
.OR 0
*--------------------------------------
* First time entry point after reset
* Called from Kernel.Init2
*--------------------------------------
Z80.Init ld SP,000FFH Init Stack to 000FFH ($10ff)
ld A,0FFH Set Flag...
ld Z80.6502A,A ...in 6502 A reg
im 1
ei
jr Z80.Exit
*--------------------------------------
.BS 00038h-*
*--------------------------------------
Z80.Irq push AF
push BC
push DE
push HL
push IX
push IY
ld (Z80.pStack),SP
*--------------------------------------
Z80.Exit ld Z80.IOz,A exit to 6502, falling in main loop for next call
*--------------------------------------
* Called from :
* - CORE.PSExec : Z80.6502X = PS.INIT/PS.RUN/PS.DOEVENT/PS.QUIT
* - CORE.PSExec : Resume
* - SYSCALL Return
* - LIBCALL Return
* -
*--------------------------------------
Z80.Enter ld A,(Z80.6502X) get 6502,X
cp A,PS.RESUME
jpz Z80.Resume
ld L,A
ld H,0 HL=offset in jump table
ld DE,(Z80.pCode) DE=Code Base
add DE,4 skip header
add HL,DE HL=CodeBase+4+X
ld A,(HL) get jmp lo at X
inc HL
ld H,(HL) get jmp hi at X+1
ld L,A
call Z80.JumpHL
ld Z80.6502A,A
*--------------------------------------
Z80.Resume ld SP,(Z80.pStack)
pop IY
pop IX
pop HL
pop DE
pop BC
pop AF
ei
reti
*--------------------------------------
*--------------------------------------
Z80.SYSCALL ld
*--------------------------------------
Z80.LIBCALL
*--------------------------------------
Z80.JumpHL jp (HL)
*--------------------------------------
Z80.IOz .DA 0E100H
Z80.6502A .BS 1
Z80.6502X .BS 1
Z80.6502Y .BS 1
Z80.6502P .BS 1
*--------------------------------------
MAN
SAVE /A2OSX.SRC/SYS/KERNEL.S.Z80
LOAD /A2OSX.SRC/SYS/KERNEL.S
ASM