All pastes #171222 Raw Edit

Pi

public text v1 · immutable
·published 2006-09-15 05:51 UTC
rendered paste body
inloop:
    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