mirror of
https://github.com/A2osX/A2osX.git
synced 2024-12-31 14:29:28 +00:00
Kernel 0.9.1 : ASM ...
This commit is contained in:
parent
e95b70c710
commit
3d8081601b
24
.Docs/ASM.md
24
.Docs/ASM.md
@ -8,35 +8,35 @@ Multi-CPU macro assembler based on S-C MASM 3.0 dialect
|
||||
|
||||
| Code | Description | Compatibility | Status | Syntax | Comment |
|
||||
|-|-|-|-|-|-|
|
||||
| .AC | | S-C | NOT IMPL. | | As strings are supposed to be printed with A2osX API, Printf cannot handle 'AC' compressed strings |
|
||||
| .AC | Ascii Compressed string| S-C | NOT IMPL. | | As strings are supposed to be printed with A2osX API, Printf cannot handle 'AC' compressed strings |
|
||||
| .AS | Ascii String | S-C,A2osX | Working | `.AS dTEXTd` where d is any delimiter `.AS -"TEXT"`produce ascii code with b7=1 | |
|
||||
| .AT | Ascii String Terminated | S-C,A2osX | Working | (same as above) | |
|
||||
| .AZ | Ascii String Zero Terminated (CString) | S-C,A2osX | Working | (same as above) | |
|
||||
| .AT | Ascii string Terminated | S-C,A2osX | Working | (same as above) | |
|
||||
| .AZ | Ascii string Zero terminated (C String) | S-C,A2osX | Working | (same as above) | |
|
||||
| .BS | Block Storage | S-C,A2osX | Working | | |
|
||||
| .DA | Data | S-C,A2osX | In Progress | | |
|
||||
| .DO | conditional start | S-C,A2osX | In Progress | | |
|
||||
| .DU,.DUMMY | begin Dummy section | S-C,A2osX | In Progress | | |
|
||||
| .ED | End Dummy section | S-C,A2osX | In Progress | | |
|
||||
| .DA | Data | S-C,A2osX | Working | | |
|
||||
| .DO | conditional start | S-C,A2osX | Working | | |
|
||||
| .DU,.DUMMY | begin DUmmy section | S-C,A2osX | In Progress | | |
|
||||
| .ED | End Dmmy section | S-C,A2osX | In Progress | | |
|
||||
| .DA | | S-C,A2osX | In Progress | | |
|
||||
| .ELSE | conditional ELSE | S-C,A2osX | In Progress | | |
|
||||
| .ELSE | conditional ELSE | S-C,A2osX | Working | | |
|
||||
| .EM | End Macro | S-C,A2osX | In Progress | | |
|
||||
| .EN | ENd of source code | S-C,A2osX | In Progress | | |
|
||||
| .EP | End Phase| S-C,A2osX | In Progress | | |
|
||||
| .EQ | EQuate | S-C,A2osX | In Progress | | |
|
||||
| .FIN | conditional end| S-C,A2osX | In Progress | | |
|
||||
| .PH | PHase start| S-C,A2osX | In Progress | | |
|
||||
| .FIN | conditional end| S-C,A2osX | Working | | |
|
||||
| .PH | PHase start| S-C,A2osX | Working | | |
|
||||
| .HS | Hex String | S-C,A2osX | Working | `HS FE1A78` delimiter allowed : `HS 00.11,22` | |
|
||||
| .IN,.INB,.INBx | | S-C,A2osX | Working | | |
|
||||
| .LI,.LIST | | S-C,A2osX | Working | | |
|
||||
| .MA | MAcro deffinition | S-C,A2osX | Working | | |
|
||||
| .OP | OPCode | S-C,A2osX | Working | `.OP cpu` where cpu is one of 6502,65C02,65R02,65816,Z80,S16 | |
|
||||
| .OR | ORigin | S-C,A2osX | Working | | |
|
||||
| .PG | PaGe| S-C,A2osX | IGNORED | | |
|
||||
| .PG | PaGe control | S-C,A2osX | IGNORED | | |
|
||||
| .PH | PHase | S-C,A2osX | Working | | |
|
||||
| .SE | | S-C,A2osX | Working | | |
|
||||
| .TA | Target Address| S-C,A2osX | IGNORED | | |
|
||||
| .TF | Target File | S-C,A2osX | Working | | |
|
||||
| .TI | ??? | S-C,A2osX | IGNORED | | |
|
||||
| .TI | TItle | S-C,A2osX | IGNORED | | |
|
||||
| .US | USer defined | S-C,A2osX | IGNORED | | |
|
||||
|
||||
|
||||
|
Binary file not shown.
@ -165,7 +165,7 @@ DIR.DA jsr SRC.GetNextCharNB
|
||||
.8 clc
|
||||
rts
|
||||
*---------------------------------------
|
||||
DIR.DO >LDA.G ASM.DO.Count
|
||||
DIR.DO >LDA.G ASM.DO.StackPtr
|
||||
inc
|
||||
cmp #SRC.DO.MAXDEPTH
|
||||
bcs .98
|
||||
@ -176,17 +176,20 @@ DIR.DO >LDA.G ASM.DO.Count
|
||||
jsr EXP.Eval
|
||||
bcs .99
|
||||
|
||||
>INC.G ASM.DO.Count
|
||||
>INC.G ASM.DO.StackPtr
|
||||
* clc ok from bcs .99
|
||||
adc #ASM.DOELSE.Flag-1
|
||||
adc #ASM.DO.Stack-1
|
||||
tay
|
||||
|
||||
lda SRC.ACC
|
||||
ora SRC.ACC+1
|
||||
ora SRC.ACC+2
|
||||
ora SRC.ACC+3 if
|
||||
ora SRC.ACC+3
|
||||
beq .1
|
||||
|
||||
lda #$ff
|
||||
|
||||
sta (pData),y
|
||||
.1 sta (pData),y
|
||||
lda #$FF
|
||||
>STA.G ASM.DO.ON
|
||||
clc
|
||||
@ -202,7 +205,22 @@ DIR.DU clc
|
||||
DIR.ED clc
|
||||
rts
|
||||
*---------------------------------------
|
||||
DIR.EL clc
|
||||
DIR.EL >LDA.G ASM.DO.StackPtr
|
||||
beq .9
|
||||
|
||||
clc
|
||||
adc #ASM.DO.Stack-1
|
||||
tay
|
||||
lda (pData),y
|
||||
eor #$ff
|
||||
sta (pData),y
|
||||
|
||||
clc
|
||||
rts
|
||||
|
||||
|
||||
.9 lda #ERR.ELSE.WITHOUT.DO
|
||||
sec
|
||||
rts
|
||||
*---------------------------------------
|
||||
DIR.EM lda #ERR.MACRO.INV.DEF
|
||||
@ -264,7 +282,7 @@ DIR.EQ >LDA.G SYM.bGlobal
|
||||
sec
|
||||
.9 rts
|
||||
*---------------------------------------
|
||||
DIR.FI ldy #ASM.DO.Count
|
||||
DIR.FI ldy #ASM.DO.StackPtr
|
||||
lda (pData),y
|
||||
beq .99
|
||||
dec
|
||||
|
@ -213,11 +213,32 @@ EXP.Compute dec
|
||||
.8 clc
|
||||
rts
|
||||
*---------------------------------------
|
||||
EXP.OP.EOR
|
||||
EXP.OP.EOR ldx #3
|
||||
|
||||
.1 lda SRC.ARG,x
|
||||
eor SRC.ACC,x
|
||||
sta SRC.ACC,x
|
||||
dex
|
||||
bpl .1
|
||||
rts
|
||||
*---------------------------------------
|
||||
EXP.OP.ORA
|
||||
EXP.OP.ORA ldx #3
|
||||
|
||||
.1 lda SRC.ARG,x
|
||||
ora SRC.ACC,x
|
||||
sta SRC.ACC,x
|
||||
dex
|
||||
bpl .1
|
||||
rts
|
||||
*---------------------------------------
|
||||
EXP.OP.AND
|
||||
EXP.OP.AND ldx #3
|
||||
|
||||
.1 lda SRC.ARG,x
|
||||
and SRC.ACC,x
|
||||
sta SRC.ACC,x
|
||||
dex
|
||||
bpl .1
|
||||
rts
|
||||
*---------------------------------------
|
||||
EXP.OP.LOW clc
|
||||
rts
|
||||
|
@ -73,17 +73,34 @@ OUT.PrintLine.1 jsr OUT.PrintLineOutBuf
|
||||
>SYSCALL PrintF.YA
|
||||
OUT.PrintLine.9 rts
|
||||
*---------------------------------------
|
||||
OUT.PrintLineOn >LDA.G ASM.LI.ON
|
||||
OUT.PrintLineOn clc
|
||||
rts
|
||||
|
||||
|
||||
>LDA.G ASM.LI.ON
|
||||
bpl .9
|
||||
|
||||
>LDA.G MAC.bAdd
|
||||
>LDA.G MAC.bAdd MACRO Mode ?
|
||||
bpl .1
|
||||
|
||||
>LDA.G ASM.LI.MON
|
||||
bpl .9
|
||||
bmi .8
|
||||
|
||||
.1
|
||||
.1 >LDA.G ASM.DO.StackPtr within a DO/ELSE ?
|
||||
beq .2
|
||||
|
||||
clc
|
||||
adc #ASM.DO.Stack-1
|
||||
tay
|
||||
lda (pData),y TRUE ?
|
||||
bne .8 yes, print always
|
||||
|
||||
>LDA.G ASM.LI.CON FALSE, check CON flag...
|
||||
bpl .9
|
||||
bmi .8
|
||||
|
||||
.2
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
|
@ -2,7 +2,9 @@ NEW
|
||||
PREFIX /A2OSX.BUILD
|
||||
AUTO 4,1
|
||||
*---------------------------------------
|
||||
SRC.ParseLine jsr SRC.GetChar
|
||||
SRC.ParseLine jsr OUT.Reset
|
||||
|
||||
jsr SRC.GetChar
|
||||
bcs .8
|
||||
|
||||
cmp #'*' Comment?
|
||||
@ -10,9 +12,16 @@ SRC.ParseLine jsr SRC.GetChar
|
||||
cmp #';' Comment?
|
||||
beq .8
|
||||
|
||||
jsr OUT.Reset
|
||||
>LDA.G ASM.DO.StackPtr
|
||||
beq .1
|
||||
|
||||
>LDA.G MAC.bAdd
|
||||
clc
|
||||
adc #ASM.DO.Stack-1
|
||||
tay
|
||||
lda (pData),y
|
||||
beq .8
|
||||
|
||||
.1 >LDA.G MAC.bAdd
|
||||
bmi SRC.ParseLine.MACRO
|
||||
|
||||
jmp SRC.ParseLine.LABEL
|
||||
|
@ -51,7 +51,8 @@ ERR.RANGE .EQ $A9
|
||||
ERR.UNDEF.SYMBOL .EQ $AA
|
||||
ERR.SYMBOL.REDEF .EQ $AB
|
||||
ERR.TOO.MANY.DO .EQ $AC
|
||||
ERR.TOO.MANY.LOCAL .EQ $AD
|
||||
ERR.ELSE.WITHOUT.DO .EQ $AD
|
||||
ERR.TOO.MANY.LOCAL .EQ $AE
|
||||
ERR.MISSING.EXP .EQ $B0
|
||||
ERR.EXP.SYN.ERROR .EQ $B1
|
||||
ERR.MACRO.INV.DEF .EQ $E0
|
||||
@ -446,8 +447,8 @@ DIR.Word .BS 2
|
||||
DIR.Byte .BS 1
|
||||
|
||||
ASM.PASS .BS 1
|
||||
ASM.DO.Count .BS 1
|
||||
ASM.DOELSE.Flag .BS SRC.DO.MAXDEPTH
|
||||
ASM.DO.StackPtr .BS 1
|
||||
ASM.DO.Stack .BS SRC.DO.MAXDEPTH
|
||||
ASM.DO.ON .BS 1
|
||||
ASM.PH.ON .BS 1
|
||||
ASM.LI.ON .BS 1
|
||||
|
Loading…
Reference in New Issue
Block a user