Fixed an issue with the input where you can't backspace properly
This commit is contained in:
9
data/fb.bas
Normal file
9
data/fb.bas
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
FOR A = 1 TO 100
|
||||||
|
PRINT A ;
|
||||||
|
B = A % 3
|
||||||
|
C = A % 5
|
||||||
|
IF B = 0 then PRINT "Fizz" ;
|
||||||
|
IF C = 0 then PRINT "Buzz" ;
|
||||||
|
PRINT ""
|
||||||
|
NEXT A
|
||||||
|
END
|
||||||
@@ -1,5 +1,17 @@
|
|||||||
PRINT "What's your name?"
|
$1 = "_________"
|
||||||
INPUT $1
|
A = & $1
|
||||||
PRINT "Hello " ;
|
FOR X = 1 TO 9
|
||||||
PRINT $1
|
FOR Y = 1 TO 9
|
||||||
|
PEEK B A
|
||||||
|
IF B = 95 THEN PRINT "_" ;
|
||||||
|
IF B = 88 THEN PRINT "X" ;
|
||||||
|
IF B = 79 THEN PRINT "O" ;
|
||||||
|
C = A % 3
|
||||||
|
IF C = 0 THEN PRINT " "
|
||||||
|
A = A + 1
|
||||||
|
NEXT Y
|
||||||
|
Z = X % 2
|
||||||
|
IF Z = 0 THEN PRINT "You are X"
|
||||||
|
IF Z = 1 THEN PRINT "You are O"
|
||||||
|
NEXT X
|
||||||
END
|
END
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ keyboard_display_input:
|
|||||||
ret ; Return to the parent function (whatever that may be)
|
ret ; Return to the parent function (whatever that may be)
|
||||||
|
|
||||||
.backspace:
|
.backspace:
|
||||||
call .move_cursor_back ; then .move_cursor_back
|
jmp .move_cursor_back ; then .move_cursor_back
|
||||||
call .loop ; Else .loop
|
jmp .loop ; Else .loop
|
||||||
|
|
||||||
.move_cursor_back:
|
.move_cursor_back:
|
||||||
mov ah, 0Eh
|
mov ah, 0Eh
|
||||||
@@ -71,7 +71,7 @@ keyboard_display_input:
|
|||||||
int 10h
|
int 10h
|
||||||
|
|
||||||
dec di
|
dec di
|
||||||
jmp keyboard_display_input
|
jmp .loop
|
||||||
|
|
||||||
.print_current_input: ; Echo back that character and return the key inputing
|
.print_current_input: ; Echo back that character and return the key inputing
|
||||||
stosb
|
stosb
|
||||||
|
|||||||
Reference in New Issue
Block a user