prog8/examples/test.p8

54 lines
1.1 KiB
Plaintext
Raw Normal View History

%import floats
main {
sub start() {
2024-11-15 22:37:08 +00:00
float zz
thing()
2024-11-15 22:37:08 +00:00
zz = thang(1.22)
bool status
cx16.r0L, status = extfunction(42, 11223, 999, 1.22, true)
cx16.r0L, status = function(42, 11223, 999, 1.22, true)
func1(42)
func2(9999)
func3(42,9999)
func4(42,9999,12345)
}
sub thing() -> bool {
cx16.r0++
return true
}
2024-11-15 22:37:08 +00:00
sub thang(float arg) -> float {
arg++
return arg
}
sub func1(ubyte arg) {
cx16.r0L +=arg
}
sub func2(uword arg) {
cx16.r0 += arg
}
sub func3(ubyte arg1, uword arg2) {
cx16.r0 += arg2
cx16.r0L =+ arg1
}
sub func4(ubyte arg1, uword arg2, uword arg3) {
cx16.r0L =+ arg1
cx16.r0 += arg2
cx16.r1 += arg3
}
extsub $2000 = extfunction(ubyte arg1 @A, uword arg2 @XY, uword arg3 @R0, float frac @FAC1, bool flag @Pc) -> ubyte @Y, bool @Pz
asmsub function(ubyte arg1 @A, uword arg2 @XY, uword arg3 @R0, float frac @FAC1, bool flag @Pc) -> ubyte @Y, bool @Pz {
%asm {{
rts
}}
2024-11-08 18:43:59 +00:00
}
}