Enter key not registering in Cloud CP/M 7.7b? (Fixed)
Posted: Sat Apr 01, 2023 9:07 pm
I have stumbled across an issue in v7.7b of Cloud CP/M, where it appears that the C_RAWIO BDOS function no longer registers a carriage return. The function returns all other keyboard characters, but seems not to recognise the enter key - at least not in MAME. This function worked fine in the previous version(s) of Cloud CP/M.
The problem can be reproduced with the code below, or alternatively in ZORK2, which appears to show the same (or similar) issue.
I may well have missed something, so I'd be grateful for any pointers!
Thanks,
D.
The problem can be reproduced with the code below, or alternatively in ZORK2, which appears to show the same (or similar) issue.
I may well have missed something, so I'd be grateful for any pointers!
Thanks,
D.
Code: Select all
BDOS equ 05h ; standard cp/m entry
DCONIO equ 06h ; direct console I/O
INPREQ equ 0ffh ; console input request
org 0100h
ld de,msg ; print 'welcome' msg
call pstr
loop:
call getchar ; get a character
or a
jr z,loop ; nothing, so loop
call putchar ; print the character
jr loop
getchar:
push bc
push de
ld c,DCONIO ; direct console i/o
ld e,INPREQ ; input request
call BDOS ; any chr typed?
pop de ; if yes, (a)<--char
pop bc ; else (a)<--00h (ignore chr)
or a
ret
;
putchar:
push bc
push de
push af
push hl
ld c,DCONIO ; direct console i/o
ld e,a ; output char (a)
call BDOS
pop hl
pop af
pop de
pop bc
ret
pstr:
ld a,(de) ; get a character
inc de ; bump pointer
call putchar ; show character
cp 0dh ; was it a cr?
jr nz,pstr ; no, next character
ret ; yes, returns
msg: db "Type something:",0ah, 0dh