gets() on MC-1000 and OSCA (v6z80p)

Discussion about other targets
Post Reply
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

gets() on MC-1000 and OSCA (v6z80p)

Post by stefano »

I just discovered that the weiderness I noticed on the CCE MC-1000 while reading the keyboard was limited to some input functions, i.e. gets().
The same effect is present on the v6z80p port, but still haven't found the reason for it.
I still don't know if the effect is limited to my tiny gets() version with cursor emulation and what's causing it.

Here's a fancy workaround for the v6z80p port:

#include <flos.h>
#define LineInput(a) flos_get_input_string(a,255); putchar('\n');
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

Bug found !
My tiny version of gets() assumed we have the result in the A register too, but it is not true on all the targets.


push de
push hl ; preserve buffer location
call fgetc_cons
---> ld a,l <---- THIS WAS MISSING
pop hl
pop de
and a
jr z,getloop
Post Reply