prog8/examples/test.p8

26 lines
707 B
Plaintext
Raw Normal View History

%import textio
2023-11-28 22:50:30 +01:00
%import floats
%import string
2023-11-28 22:50:30 +01:00
%zeropage basicsafe
%option no_sysinit
main {
sub start() {
str buffer = "???????????????????????????"
repeat {
txt.print("enter number: ")
void txt.input_chars(buffer)
txt.print("\nprog8's parse_f: ")
float value = floats.parse_f(buffer)
floats.print_f(value)
2023-11-29 21:04:31 +01:00
; floats.VAL_1 is defined as:
; romsub $fe09 = VAL_1(uword string @XY, ubyte length @A) clobbers(A,X,Y) -> float @FAC1
txt.print("\nrom val_1: ")
value = floats.VAL_1(buffer, string.length(buffer))
floats.print_f(value)
txt.nl()
}
2023-11-14 18:23:37 +01:00
}
}