1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-12-28 11:31:58 +00:00
millfork/include/trs80/kernal.mfk
2020-09-27 18:58:46 +02:00

27 lines
451 B
Plaintext

#pragma zilog_syntax
import default_readword
asm void putchar(byte register(a) char) @$33 extern
inline asm void new_line() {
? LD A,13
? JP putchar
}
array __readline_out[45]
const pointer readline_out = __readline_out.addr
asm pointer readline() {
LD HL,readline_out
LD B,__readline_out.length-1
CALL $40
; b contains the input length:
LD C,B
LD B,0
ADD HL,BC
LD (HL),0
LD HL, readline_out
RET
}