- Code: Select all
;
; Input yes/no routine
;
LBL "Y/N"
8
ALENG
–
LBL 05
>" "
DSE X
GTO 05
>"Y/N?"
LBL 00
AVIEW ; Display question and get answer
GETKEY ; Yes or no?
SF 25 ; Ignore invalid key error
GTO IND X
SIZE?
DSE X
STO 00
ASTO IND X
ASHF
DSE X
ASTO IND X
"WHAT ?"
AVIEW
PSE
CLA
RCL 00
ARCL IND X
DSE X
ARCL IND X
GTO 00
LBL 71 ; returned 71 for the Y key
1 ; Enter 1
RTN
LBL 41 ; returned 41 for the N key
. ; Enter 0
END
This code formats and displays the question (up to 7 characters) and uses GETKEY for the user response. It even alerts the user if they pressed the wrong key. A 1 or 0 is left in the X-register, depending on the y or n keypress. I don't know how to implement an X=Y? type behavior when the subroutine returns to the main program.

