2017-10-16 15:41:48 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.BUILD
|
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
|
|
|
|
.TF /A2OSX.BUILD/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
|
2017-10-17 15:40:21 +00:00
|
|
|
|
L.CONST1 .DA CONST1
|
|
|
|
|
L.CONST2 .DA CONST2
|
2017-10-31 15:25:16 +00:00
|
|
|
|
L.LONG1 .DA LONG1
|
2017-10-27 14:56:46 +00:00
|
|
|
|
L.MSG1 .DA MSG1
|
|
|
|
|
L.MSG2 .DA MSG2
|
2017-10-30 16:11:07 +00:00
|
|
|
|
L.MSG3 .DA MSG3
|
|
|
|
|
L.MSG4 .DA MSG4
|
2017-10-31 15:25:16 +00:00
|
|
|
|
L.MSG5 .DA MSG5
|
2017-10-16 15:41:48 +00:00
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.INIT clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN >PUSHEA.G ENDPTR
|
2017-10-17 15:40:21 +00:00
|
|
|
|
>PUSHW L.CONST2
|
|
|
|
|
>PUSHEA.G MYFLOAT2
|
|
|
|
|
>SYSCALL StrToF
|
|
|
|
|
|
|
|
|
|
>PUSHEA.G ENDPTR
|
|
|
|
|
>PUSHW L.CONST1
|
|
|
|
|
>PUSHEA.G MYFLOAT1
|
2017-10-16 15:41:48 +00:00
|
|
|
|
>SYSCALL StrToF
|
|
|
|
|
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>PUSHEA.G MYFLOAT2
|
2017-10-17 15:40:21 +00:00
|
|
|
|
>PUSHEA.G MYFLOAT1
|
2017-10-16 15:41:48 +00:00
|
|
|
|
>PUSHW L.FLOAT5
|
|
|
|
|
>PUSHW L.FLOAT4
|
|
|
|
|
>PUSHW L.FLOAT3
|
|
|
|
|
>PUSHW L.FLOAT2
|
|
|
|
|
>PUSHW L.FLOAT1
|
|
|
|
|
|
2017-10-30 16:11:07 +00:00
|
|
|
|
>LDYA L.MSG1
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2017-10-30 16:11:07 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-27 14:56:46 +00:00
|
|
|
|
>PUSHEA.G MYFLOAT1
|
|
|
|
|
>PUSHEA.G MYFLOAT2
|
|
|
|
|
>LEA.G MYFLOAT3
|
2017-10-30 16:11:07 +00:00
|
|
|
|
>SYSCALL FDiv
|
2017-10-27 14:56:46 +00:00
|
|
|
|
|
|
|
|
|
>PUSHEA.G MYFLOAT3
|
2017-10-30 16:11:07 +00:00
|
|
|
|
>LDYA L.MSG2
|
2017-10-16 15:41:48 +00:00
|
|
|
|
>SYSCALL PrintF.YA
|
2017-10-30 16:11:07 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
>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
|
2017-10-31 15:25:16 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
>PUSHW L.LONG1
|
|
|
|
|
>LEA.G MYFLOAT1
|
|
|
|
|
>SYSCALL Float
|
|
|
|
|
|
|
|
|
|
>PUSHEA.G MYFLOAT1
|
|
|
|
|
>LDYA L.MSG5
|
|
|
|
|
>SYSCALL PrintF.YA
|
2017-10-30 16:11:07 +00:00
|
|
|
|
*--------------------------------------
|
2017-10-16 15:41:48 +00:00
|
|
|
|
lda #0
|
|
|
|
|
sec
|
2017-10-27 14:56:46 +00:00
|
|
|
|
rts
|
2017-10-16 15:41:48 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
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"
|
2017-10-16 15:41:48 +00:00
|
|
|
|
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
|
2017-10-17 15:40:21 +00:00
|
|
|
|
CONST1 >CSTR "3.141592653"
|
2017-10-30 16:11:07 +00:00
|
|
|
|
CONST2 >CSTR "3"
|
2017-10-31 15:25:16 +00:00
|
|
|
|
LONG1 .DA 123456789
|
2017-10-30 16:11:07 +00:00
|
|
|
|
MSG2 >CSTR "PI/3=%e\r\n"
|
|
|
|
|
MSG3 >CSTR "COS(PI/3)=%e\r\n"
|
|
|
|
|
MSG4 >CSTR "Long=%L\r\n"
|
2017-10-31 15:25:16 +00:00
|
|
|
|
MSG5 >CSTR "Float=%e\r\n"
|
2017-10-16 15:41:48 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
2017-10-17 15:40:21 +00:00
|
|
|
|
MYFLOAT1 .BS 5
|
|
|
|
|
MYFLOAT2 .BS 5
|
2017-10-27 14:56:46 +00:00
|
|
|
|
MYFLOAT3 .BS 5
|
2017-10-30 16:11:07 +00:00
|
|
|
|
MYLONG .BS 4
|
2017-10-16 15:41:48 +00:00
|
|
|
|
ENDPTR .BS 2
|
|
|
|
|
DS.END
|
|
|
|
|
.ED
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE /A2OSX.BUILD/TEST.S
|
|
|
|
|
ASM
|