Hi,
how to do the equivalent of kbhit() or wait key pressed with cpm assembler.
function 1 of bdos read, waits for a character to be pressed then displays it on the screen.
I would like the same thing but without displaying it on the screen (echo off)
thanks for your help.
https://turpas3.angelfire.com/unifirm.pas
Cpm 2.2
CALL #BE9B
DW #BB18 <- Each firmware procedure address
Cpm 3.1
CALL #FC5A
DW #BB18
But its for CPC only
for _kbd_kbhit i use this
_kbd_kbhit:
call wait_k
ret
wait_k:
LD C, 11 ; C_STAT
LD DE,0
call bdos
OR A
JR Z, wait_k
ret
but it don't work, it always loop
my code is for CP/M for agon original CP/M Z80.
i use zcc from z88dk (zcc +cpm .....)
i search equivalent to kbhit() from c language, but don't find anything on internet.
commande line:
zcc.exe +cpm -mz80 -compiler=sdcc -DAMALLOC @/src/text.lst -obin/myprog.com
Do you want to use the program only on CPC or on any other computer with CPM?
any other computer with cpm with standard bdos call and bios call
Check if bdos is definitely 5.
I have a different problem. Very often I have A=1 without pressing a key.
Quote from: andromedaa92 on 20:07, 22 June 24wait_k:
LD C, 11 ; C_STAT
LD DE,0
call bdos
OR A
JR Z, wait_k
ret
but it don't work, it always loop
Did you try BDOS function 6 C_RAWIO?
https://www.seasip.info/Cpm/bdos.html#6
LD C,6
LD E,255
CALL 5
This will return in A the char or 0, if no char is available. And it will not echo anything.
But it's strange, that you have this behaviour with C_STAT...
yes i tested it work, thank you.
do you know a cp/m 2.2 z80 emulator for windows 10 ?
Quote from: andromedaa92 on 13:03, 23 June 24do you know a cp/m 2.2 z80 emulator for windows 10 ?
According to Prevtenet (author of CPvM (http://www.symbos.org/cpvm.htm) ) this one is very useful:
https://github.com/MockbaTheBorg/RunCPM
(builds natively on Visual Studio)
thanks for the link