diff --git a/.Docs/.HELLOWORLD.S.txt b/.Docs/.HELLOWORLD.S.txt index 99501a89..7b962998 100644 --- a/.Docs/.HELLOWORLD.S.txt +++ b/.Docs/.HELLOWORLD.S.txt @@ -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 diff --git a/.Docs/.HELLOWORLD.Z.txt b/.Docs/.HELLOWORLD.Z.txt new file mode 100644 index 00000000..abf21c54 --- /dev/null +++ b/.Docs/.HELLOWORLD.Z.txt @@ -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 diff --git a/BIN/ASM.S.EXP.txt b/BIN/ASM.S.EXP.txt index f95a8ebd..18f66dae 100644 --- a/BIN/ASM.S.EXP.txt +++ b/BIN/ASM.S.EXP.txt @@ -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 diff --git a/BIN/ASM.S.OUT.txt b/BIN/ASM.S.OUT.txt index 99f593ce..333fb3aa 100644 --- a/BIN/ASM.S.OUT.txt +++ b/BIN/ASM.S.OUT.txt @@ -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 diff --git a/BIN/ASM.S.SRC.txt b/BIN/ASM.S.SRC.txt index 8aa457e0..a77196a3 100644 --- a/BIN/ASM.S.SRC.txt +++ b/BIN/ASM.S.SRC.txt @@ -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 diff --git a/BIN/ASM.S.txt b/BIN/ASM.S.txt index 5473aadf..d131708e 100644 --- a/BIN/ASM.S.txt +++ b/BIN/ASM.S.txt @@ -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