accepting numbers, text, and other symbols as user input

This commit is contained in:
Thiago Auler dos Santos 2017-11-22 23:28:49 -02:00
parent bac269c9c2
commit 1deb00495d
2 changed files with 8 additions and 3 deletions

View File

@ -16,7 +16,9 @@ void input()
{
int ch = getch();
if (ch == '\n') { ch = '\r'; }
if (ch == '\r' || (ch >= '0' && ch <= '9'))
if (ch == '\r' || ch == '.' || ch == ':' ||
(ch >= '0' && ch <= '9') ||
(ch >= 'A' && ch <= 'Z'))
{
keyboard_buffer = ch | 0x80;
keyboard_control = 0xFF;

View File

@ -307,6 +307,7 @@ void clv()
void cmp()
{
// compare memory with accumulator
C_SET;
fetch_operand();
operand = operand ^ 0xFF;
adder(ac, operand);
@ -315,6 +316,7 @@ void cmp()
void cpx()
{
// compare memory and index x
C_SET;
fetch_operand();
operand = operand ^ 0xFF;
adder(x, operand);
@ -323,6 +325,7 @@ void cpx()
void cpy()
{
// compare memory and index y
C_SET;
fetch_operand();
operand = operand ^ 0xFF;
adder(y, operand);