Kernel 0.94

This commit is contained in:
Rémy GIBERT 2020-03-10 08:24:08 +01:00
parent 4689a6acb2
commit 5ffc539fe2
6 changed files with 135 additions and 79 deletions

View File

@ -1,17 +1,17 @@
NEW
AUTO 3,1 Enable MASM3 auto line num
.LIST OFF
.OP 65C02 Target CPU, must = CPU header level
.OR $2000 usualy $2000, any value > $100 ok
.TF ROOT/HELLOWORLD
.LIST OFF
.OP 65C02 Target CPU, must = CPU header level
.OR $2000 usually $2000, any value > $100 ok
.TF root/helloworld
*--------------------------------------
.INB INC/MACROS.I
.INB INC/A2OSX.I
.INB INC/MACROS.I
.INB INC/A2OSX.I
*--------------------------------------
* Zero Page Segment, up to 32 bytes
*--------------------------------------
.DUMMY
.OR ZPBIN
.DUMMY
.OR ZPBIN
ZS.START
* MyPtr .BS 2
ZS.END .ED
@ -19,28 +19,28 @@ ZS.END .ED
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA #0 S.PS.F.EVENT
.DA #0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data SegmentSize
.DA #64 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
.DA 0
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA #0 S.PS.F.EVENT
.DA #0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data Segment Size
.DA #64 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
* Add any address you want be relocated by loader
* Usefull if you have to pass EFFECTIVE address to an API call...
L.MSG.HELLO .DA MSG.HELLO
.DA 0
.DA 0
*--------------------------------------
* Called once at process creation
* Put code for loading LIB here
@ -53,26 +53,28 @@ CS.INIT clc
*--------------------------------------
CS.RUN
* Put your code here
>LDYA L.MSG.HELLO
>SYSCALL PutS
.8 lda #0 Exit Code = Succes
sec QUIT Process
rts
.9 lda #E.SYN Exit Code = Succes
sec QUIT Process
rts
>LDYA L.MSG.HELLO
>SYSCALL PutS
.8 lda #0 Exit Code = Success
sec QUIT Process
rts
.9 lda #E.SYN Exit Code = Error
sec QUIT Process
rts
*--------------------------------------
* Called if option S.PS.F.EVENT enabled in Header
* Timer Event : every 10th seconds
*--------------------------------------
CS.DOEVENT sec
rts
rts
*--------------------------------------
* Called once, when RUN exited with CS
* Put code for unloading LIB here
*--------------------------------------
CS.QUIT clc
rts
rts
*--------------------------------------
CS.END
*--------------------------------------
@ -82,13 +84,12 @@ CS.END
* Put your constant here :
MSG.HELLO .AZ "Hello World"
*--------------------------------------
* Per Process DATA segement (0 filled before INIT)
* Per Process DATA segment (0 filled before INIT)
*--------------------------------------
.DUMMY
.OR 0
.DUMMY
.OR 0
DS.START
DS.END
.ED
DS.END .ED
*--------------------------------------
MAN
SAVE ROOT/HELLOWORLD.S Save this source file

92
.Docs/.HELLOWORLD.Z.txt Normal file
View File

@ -0,0 +1,92 @@
NEW
AUTO 3,1 Enable MASM3 auto line num
.LIST OFF
.OP Z80 Target CPU, must = CPU header level
.OR $2000 usually $2000, any value > $100 ok
.TF root/helloworldz
*--------------------------------------
.INB INC/A2OSX.I
*--------------------------------------
* Zero Page Segment, up to 32 bytes
*--------------------------------------
.DUMMY
.OR ZPBIN
ZS.START
* MyPtr .BS 2
ZS.END .ED
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
CS.START ccf
jp (.1)
.DA #$80 Z80
.DA #1 BIN Layout Version 1
.DA #0 S.PS.F.EVENT
.DA #0
.DA CS.END-CS.START Code Size (without Constants)
.DA DS.END-DS.START Data SegmentSize
.DA #64 Stack Size
.DA #ZS.END-ZS.START Zero Page Size
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
* Add any address you want be relocated by loader
* Usefull if you have to pass EFFECTIVE address to an API call...
L.MSG.HELLO .DA MSG.HELLO
.DA 0
*--------------------------------------
* Called once at process creation
* Put code for loading LIB here
*--------------------------------------
CS.INIT ccf
ret
*--------------------------------------
* Called until exit with CS
* if RUN exits with CC, RN entered again
*--------------------------------------
CS.RUN
ld de,(L.MSG.HELLO)
ld a,SYS.PutS
call A2osX.ZCALL
.8 ld a,0 Exit Code = Success
scf QUIT Process
ret
.9 ld a,E.SYN Exit Code = Error
scf QUIT Process
ret
*--------------------------------------
* Called if option S.PS.F.EVENT enabled in Header
* Timer Event : every 10th seconds
*--------------------------------------
CS.DOEVENT scf
ret
*--------------------------------------
* Called once, when RUN exited with CS
* Put code for unloading LIB here
*--------------------------------------
CS.QUIT scf
ret
*--------------------------------------
CS.END
*--------------------------------------
* Initialized DATA
*--------------------------------------
* Put your constant here :
MSG.HELLO .AZ "Z80 Hello World"
*--------------------------------------
* Per Process DATA segement (0 filled before INIT)
*--------------------------------------
.DUMMY
.OR 0
DS.START
DS.END .ED
*--------------------------------------
MAN
SAVE ROOT/HELLOWORLD.Z Save this source file

View File

@ -302,7 +302,7 @@ EXP.OP.LOW jsr EXP.OP.SUB
EXP.OP.EQU ldx #0 ARG-ACC->ACC
ldy #4
clc il not Equals, return 0
clc if not Equals, return 0
.1 lda SRC.ARG,x
eor SRC.ACC,x

View File

@ -3,6 +3,7 @@ NEW
*---------------------------------------
OUT.Init lda #PAGE.LEN
>STA.G OUT.LineCnt
clc
rts
*---------------------------------------
OUT.EmitByte phy
@ -317,41 +318,6 @@ OUT.PrintCR1 >DEC.G OUT.LineCnt
OUT.Print.RTS rts
*---------------------------------------
OUT.DEBUG phy
phx
>SYSCALL PutChar
>PUSHW L.MSG.DEBUG
ldy #ASM.PC+4
.1 dey
lda (pData),y
>PUSHA
cpy #ASM.PC
bne .1
ldy #5
.2 lda SRC.ACC.F,y
>PUSHA
dey
bpl .2
ldy #4
.3 lda SRC.ARG.SIZE,y
>PUSHA
dey
bpl .3
>PUSHBI 15
>SYSCALL PrintF
plx
ply
rts
*---------------------------------------
MAN
SAVE USR/SRC/BIN/ASM.S.OUT
LOAD USR/SRC/BIN/ASM.S

View File

@ -244,7 +244,7 @@ SRC.ParseLine.AM
jsr SRC.AddToBuf
.75 ldx SRC.ACC.SIZE
.75 ldx SRC.ACC.SIZE
beq * SHOULD NEVER APPEND
jsr SRC.GetACCSize

View File

@ -224,10 +224,7 @@ CS.INIT jsr CS.RUN.ARGS
jsr MAC.Init
bcs .9
jsr OUT.Init
* clc
rts
jmp OUT.Init
.99 pha
>PUSHW L.MSG.HELP