Pi
public text v1 · immutableinloop:
in a,(stdin) ; Grab a character from the keyboard
ld (hl),a ; stick it in main memory
inc hl
nine:
cp #00111000 ; ASCII 9
jp z inloop ; If we got a 9, then read the next character.
eight:
cp #00111001 ; 8
jp z inloop ; ditto
rest:
and #00110000 ; 0-7 have this bit pattern but we don't care about the lower nybble.
cp #00110000
jp z inloop