Code: Select all
char pausekey() {
int t;
char ch;
for (t=0; t<1000; ++t) {
ch = getk();
if (ch) return ch;
msleep(10);
}
return 0;
}
Thanks in advance!
Code: Select all
char pausekey() {
int t;
char ch;
for (t=0; t<1000; ++t) {
ch = getk();
if (ch) return ch;
msleep(10);
}
return 0;
}
Code: Select all
#include <stdio.h>
#include <stdlib.h>
char pausekey() {
int t;
int ch;
for (t=0; t<1000; ++t) {
ch = getk();
if (ch) return ch;
msleep(10);
}
return 0;
}
int getsp() {
#asm
ld hl,0
add hl,sp
#endasm
}
int main() {
while ( 1 ) {
int ch = pausekey();
printf("Read sp %d %d\n",getsp(),ch);
}
}
Code: Select all
54K CP/M 2.2 VERS B02
A>c:
C>dir
C: A COM
C>a
Read sp -15525 102
Read sp -15525 102
Read sp -15525 97
Read sp -15525 49
Read sp -15525 50
Read sp -15525 111
Read sp -15525 112
Read sp -15525 107
Read sp -15525 109
Read sp -15525 110
Read sp -15525 102
Read sp -15525 106
Read sp -15525 108
Read sp -15525 101
Read sp -15525 106
Read sp -15525 106
Read sp -15525 0
Read sp -15525 0
Read sp -15525 0
Read sp -15525 0