A2osX/TEST.S.txt

142 lines
3.1 KiB
Plaintext
Raw Normal View History

NEW
2018-01-11 16:34:09 +00:00
PREFIX /A2OSX.BUILD
AUTO 4,1
.LIST OFF
.OP 65C02
.OR $2000
2018-01-11 16:34:09 +00:00
.TF /A2OSX.BUILD/ROOT/TEST
*--------------------------------------
.INB /A2OSX.BUILD/INC/MACROS.I
.INB /A2OSX.BUILD/INC/A2OSX.I
*--------------------------------------
* File Header (16 Bytes)
*--------------------------------------
CS.START cld
jmp (.1,x)
.DA #$61 6502,Level 1 (65c02)
.DA #1 BIN Layout Version 1
.DA 0
.DA CS.END-CS.START CS
.DA DS.END-DS.START DS
.DA #64 SS
.DA #0 ZP
.DA 0
*--------------------------------------
* Relocation Table
*--------------------------------------
.1 .DA CS.INIT
.DA CS.RUN
.DA CS.DOEVENT
.DA CS.QUIT
L.FLOAT1 .DA FLOAT1
L.FLOAT2 .DA FLOAT2
L.FLOAT3 .DA FLOAT3
L.FLOAT4 .DA FLOAT4
L.FLOAT5 .DA FLOAT5
L.CONST1 .DA CONST1
L.CONST2 .DA CONST2
L.LONG1 .DA LONG1
2017-10-27 14:56:46 +00:00
L.MSG1 .DA MSG1
L.MSG2 .DA MSG2
L.MSG3 .DA MSG3
L.MSG4 .DA MSG4
L.MSG5 .DA MSG5
.DA 0
*--------------------------------------
CS.INIT clc
rts
*--------------------------------------
CS.RUN >PUSHEA.G ENDPTR
>PUSHW L.CONST2
>PUSHEA.G MYFLOAT2
>SYSCALL StrToF
>PUSHEA.G ENDPTR
>PUSHW L.CONST1
>PUSHEA.G MYFLOAT1
>SYSCALL StrToF
2017-10-27 14:56:46 +00:00
>PUSHEA.G MYFLOAT2
>PUSHEA.G MYFLOAT1
>PUSHW L.FLOAT5
>PUSHW L.FLOAT4
>PUSHW L.FLOAT3
>PUSHW L.FLOAT2
>PUSHW L.FLOAT1
>LDYA L.MSG1
2017-10-27 14:56:46 +00:00
>SYSCALL PrintF.YA
*--------------------------------------
2017-10-27 14:56:46 +00:00
>PUSHEA.G MYFLOAT1
>PUSHEA.G MYFLOAT2
>LEA.G MYFLOAT3
>SYSCALL FDiv
2017-10-27 14:56:46 +00:00
>PUSHEA.G MYFLOAT3
>LDYA L.MSG2
>SYSCALL PrintF.YA
*--------------------------------------
>PUSHEA.G MYFLOAT3
>LEA.G MYFLOAT3
>SYSCALL Cos
>PUSHEA.G MYFLOAT3
>LDYA L.MSG3
>SYSCALL PrintF.YA
*--------------------------------------
>PUSHW L.FLOAT1
>LEA.G MYLONG
>SYSCALL LRIntF
>PUSHEA.G MYLONG
>LDYA L.MSG4
>SYSCALL PrintF.YA
*--------------------------------------
>PUSHW L.LONG1
>LEA.G MYFLOAT1
>SYSCALL Float
>PUSHEA.G MYFLOAT1
>LDYA L.MSG5
>SYSCALL PrintF.YA
*--------------------------------------
lda #0
sec
2017-10-27 14:56:46 +00:00
rts
*--------------------------------------
CS.DOEVENT sec
rts
*--------------------------------------
CS.QUIT clc
rts
*--------------------------------------
CS.END
2017-10-27 14:56:46 +00:00
MSG1 >CSTR "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"
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"
*--------------------------------------
.DUMMY
.OR 0
DS.START
MYFLOAT1 .BS 5
MYFLOAT2 .BS 5
2017-10-27 14:56:46 +00:00
MYFLOAT3 .BS 5
MYLONG .BS 4
ENDPTR .BS 2
DS.END
.ED
*--------------------------------------
MAN
2018-01-11 16:34:09 +00:00
SAVE /A2OSX.BUILD/ROOT/TEST.S
ASM