2018-01-20 21:10:04 +00:00
|
|
|
import stdio
|
2018-12-19 21:32:55 +00:00
|
|
|
|
|
|
|
#if CBM_64
|
|
|
|
import c64_basic
|
|
|
|
#elseif CBM_264
|
|
|
|
import c264_basic
|
2018-12-19 23:47:42 +00:00
|
|
|
#elseif ZX_SPECTRUM || NEC_PC_88
|
2018-12-19 21:32:55 +00:00
|
|
|
// no imports needed
|
|
|
|
#else
|
|
|
|
#error Unsupported platform
|
|
|
|
#endif
|
2018-01-20 21:10:04 +00:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
word a
|
|
|
|
word b
|
|
|
|
|
2018-12-19 18:01:53 +00:00
|
|
|
putstrz("enter first number:"z)
|
|
|
|
new_line()
|
2018-01-20 21:10:04 +00:00
|
|
|
a = readword()
|
2018-12-19 18:01:53 +00:00
|
|
|
while errno != err_ok {
|
|
|
|
putstrz("that wasn't a number, try again:"z)
|
|
|
|
new_line()
|
2018-01-20 21:10:04 +00:00
|
|
|
a = readword()
|
|
|
|
}
|
|
|
|
|
2018-07-27 22:58:20 +00:00
|
|
|
putstrz("enter second number:{n}"z)
|
2018-01-20 21:10:04 +00:00
|
|
|
b = readword()
|
2018-12-19 18:01:53 +00:00
|
|
|
while errno != err_ok {
|
|
|
|
putstrz("that wasn't a number, try again:"z)
|
|
|
|
new_line()
|
2018-01-20 21:10:04 +00:00
|
|
|
b = readword()
|
|
|
|
}
|
|
|
|
|
2018-12-19 18:01:53 +00:00
|
|
|
putstrz("the sum is:"z)
|
|
|
|
new_line()
|
|
|
|
putword(a + b)
|
|
|
|
new_line()
|
2018-01-20 21:10:04 +00:00
|
|
|
}
|