From the INPUT routine:
Code:
LAB_1934
JSR LAB_CKRN ; check not Direct, back here if ok
JSR LAB_INLN ; print "? " and get BASIC input
LDA #$00 ; set mode = INPUT
CMP Ibuffs ; test first byte in buffer
BNE LAB_1953 ; branch if not null input
CLC ; was null input so clear carry to exit program
JMP LAB_1647 ; go do BREAK exit
As you can see at the bottom there is a JMP to the BREAK exit when the input buffer is empty ($00 in the first position of the buffer). Normally you can exit a running program at any time by typing CTRL-C on the keyboard. This is not true for the INPUT statement as it pauses program execution. To give you an alternative to exit the program while pausing on an INPUT statement, the input of an empty line replaces CTRL-C.
You can also find this in the documentation for the CONT statement:
Quote:
CONT
Continues program execution after CTRL-C has been typed, a STOP has been encountered during program execution or a null input was given to an INPUT request.
First of all I would recommend to use GET instead of INPUT where you need full control of what the user may enter.
Of course you could patch the INPUT code to simply repeat the statement after nothing was entered:
Code:
LAB_1934
JSR LAB_CKRN ; check not Direct, back here if ok
JSR LAB_INLN ; print "? " and get BASIC input
LDA #$00 ; set mode = INPUT
CMP Ibuffs ; test first byte in buffer
BEQ LAB_1934 ; **** patch ****
; BNE LAB_1953 ; branch if not null input
; CLC ; was null input so clear carry to exit program
; JMP LAB_1647 ; go do BREAK exit
While checking this out, I found the CONT statement throwing a "Can't continue error" after a null input. In addition if the user enters a string when a number is expected the "redo from start" message was followed by a syntax error. I'll see if I can fix those in the patched version.