Fixed return instruction and EOF behavior
This commit is contained in:
@@ -301,8 +301,8 @@ void equi_main_loop() {
|
||||
ram.pc = 65535U;
|
||||
while(1) { /* iterate over the instructions in the command buffer */
|
||||
instr = ram.cmdbuf[++ram.pc];
|
||||
/* silently exit on zero */
|
||||
if(instr == 0) break;
|
||||
/* silently exit on zero or FF */
|
||||
if(instr == 0 || instr == 0xFFu) break;
|
||||
/* first, check for II mode */
|
||||
if(ram.II) {
|
||||
if(instr == INS_IIEND)
|
||||
@@ -364,7 +364,8 @@ void equi_main_loop() {
|
||||
lhash = crc16(&ram.literal_stack[0], ram.lsp);
|
||||
for(pbuf=0;pbuf<CLT_ENTRIES_MAX;++pbuf)
|
||||
if(ram.clt[pbuf].nhash == lhash) {
|
||||
ram.pc = ram.clt[pbuf].loc;
|
||||
pushRet(ram.pc); /* first, save the PC into the return stack */
|
||||
ram.pc = ram.clt[pbuf].loc; /* then jump to the word location */
|
||||
break;
|
||||
}
|
||||
if(pbuf >= CLT_ENTRIES_MAX)
|
||||
@@ -547,7 +548,9 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
while(1) { /* Now, we're in the command mode loop */
|
||||
instr = ram.cmdbuf[++ram.ibp] = cgetc(); /* Fetch the next instruction from the keyboard */
|
||||
if(instr == BS && ram.ibp > ram.cmd_start) { /* process the backspace */
|
||||
if(instr == 0xFFU || instr == 0U) /* exit */
|
||||
break;
|
||||
else if(instr == BS && ram.ibp > ram.cmd_start) { /* process the backspace */
|
||||
#ifdef __CC65__
|
||||
cputc(instr); /* echo it */
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user