mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-26 13:49:18 +00:00
Kernel 0.9.1 : ASM ... more directives
This commit is contained in:
parent
9f979e44eb
commit
ab8bcb9b40
Binary file not shown.
@ -16,14 +16,55 @@ DIR.Init lda #$80
|
||||
DIR.AC clc
|
||||
rts
|
||||
*---------------------------------------
|
||||
DIR.AT sec
|
||||
.HS 90 BCC
|
||||
*---------------------------------------
|
||||
DIR.AS clc
|
||||
lda #0
|
||||
ror
|
||||
sta DIR.Byte Save b7 of last char in string
|
||||
|
||||
jsr SRC.GetNextChar
|
||||
bcs .9
|
||||
|
||||
sta DIR.Word Save delimiter....
|
||||
sta DIR.Word+1 Save also in prev char..
|
||||
|
||||
.1 jsr SRC.GetNextChar
|
||||
bcs .8
|
||||
|
||||
cmp DIR.Word delimiter ?
|
||||
beq .8
|
||||
|
||||
ldx DIR.Word+1 Get prev char
|
||||
sta DIR.Word+1 replace it with new
|
||||
txa
|
||||
cmp DIR.Word is it the starting delimiter
|
||||
beq .1 yes, skip
|
||||
|
||||
jsr OUT.EmitByte no, emit prev char
|
||||
bcc .1
|
||||
|
||||
.9 lda #ERR.SYNTAX.ERROR
|
||||
sec
|
||||
rts
|
||||
|
||||
.8 lda DIR.Word+1 Get prev char
|
||||
cmp DIR.Word someone typed .AS "" ?
|
||||
beq .80
|
||||
|
||||
ora DIR.Byte
|
||||
|
||||
jmp OUT.EmitByte
|
||||
.80 clc
|
||||
rts
|
||||
*---------------------------------------
|
||||
DIR.AT clc
|
||||
rts
|
||||
*---------------------------------------
|
||||
DIR.AZ clc
|
||||
rts
|
||||
DIR.AZ jsr DIR.AS
|
||||
bcs .9
|
||||
|
||||
lda #0
|
||||
jmp OUT.EmitByte
|
||||
.9 rts
|
||||
*---------------------------------------
|
||||
DIR.BS jsr SRC.GetNextChar
|
||||
bcs .98
|
||||
@ -36,10 +77,10 @@ DIR.BS jsr SRC.GetNextChar
|
||||
bne .99
|
||||
lda SRC.ACC
|
||||
eor #$ff
|
||||
sta DIR.Counter
|
||||
sta DIR.Word
|
||||
lda SRC.ACC+1
|
||||
eor #$ff
|
||||
sta DIR.Counter+1
|
||||
sta DIR.Word+1
|
||||
|
||||
stz DIR.Byte
|
||||
|
||||
@ -60,9 +101,9 @@ DIR.BS jsr SRC.GetNextChar
|
||||
lda SRC.ACC
|
||||
sta DIR.Byte
|
||||
|
||||
.1 inc DIR.Counter
|
||||
.1 inc DIR.Word
|
||||
bne .2
|
||||
inc DIR.Counter+1
|
||||
inc DIR.Word+1
|
||||
beq .8
|
||||
|
||||
.2 lda DIR.Byte
|
||||
|
@ -436,7 +436,7 @@ SRC.LINENUM .BS 2
|
||||
|
||||
ASM.T.hMem .BS 1
|
||||
|
||||
DIR.Counter .BS 2
|
||||
DIR.Word .BS 2
|
||||
DIR.Byte .BS 1
|
||||
|
||||
ASM.PASS .BS 1
|
||||
|
14
TEST.S.txt
14
TEST.S.txt
@ -111,19 +111,19 @@ CS.QUIT clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
CS.END
|
||||
MSG1 >CSTR "PrintF:%e, %e, %e\r\n%e, %e\r\nStrToF:%e, %e\r\n"
|
||||
MSG1 .AZ "PrintF:%e, %e, %e\r\n%e, %e\r\nStrToF:%e, %e\r\n"
|
||||
FLOAT1 .HS 9B3EBC1FFD 99,999,999.9
|
||||
FLOAT2 .HS 9E6E6B27FD 999,999,999
|
||||
FLOAT3 .HS 9E6E6B2800 1,000,000,000
|
||||
FLOAT4 .HS 8100000000 1
|
||||
FLOAT5 .HS 9080000000 -32768
|
||||
CONST1 >CSTR "3.141592653"
|
||||
CONST2 >CSTR "3"
|
||||
CONST1 .AZ "3.141592653"
|
||||
CONST2 .AZ "3"
|
||||
LONG1 .DA >123456789
|
||||
MSG2 >CSTR "PI/3=%e\r\n"
|
||||
MSG3 >CSTR "COS(PI/3)=%e\r\n"
|
||||
MSG4 >CSTR "Long=%L\r\n"
|
||||
MSG5 >CSTR "Float=%e\r\n"
|
||||
MSG2 .AZ "PI/3=%e\r\n"
|
||||
MSG3 .AZ "COS(PI/3)=%e\r\n"
|
||||
MSG4 .AZ "Long=%L\r\n"
|
||||
MSG5 .AZ "Float=%e\r\n"
|
||||
*--------------------------------------
|
||||
.DUMMY
|
||||
.OR 0
|
||||
|
Loading…
Reference in New Issue
Block a user