MC INKEY$ replacement

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
User avatar
Posts: 250
Joined: Sat Dec 14, 2013 7:46 pm

MC INKEY$ replacement

Post by GCHarder » Sat Apr 13, 2019 10:16 pm

From "Syntax" magazine
(3.95 KiB) Downloaded 88 times

User avatar
Posts: 888
Joined: Thu May 08, 2008 9:30 am
Location: Dauernheim, Germany

Re: MC INKEY$ replacement

Post by siggi » Mon Apr 15, 2019 9:15 am

Hi Greg
this is not a real "inkey" function like in BASIC.
The BASIC inkey$ function reads the keyboard "on the fly" and does not wait for a key to be pressed. But this mc stays inside a loop (and does not return) if no key is pressed:

Code: Select all

	Call Keyboard	;Call ROM scan keybd.
	INC L		;Check for no key press, L=FF
	JR Z Again	;If L=0 then Scan again.
My ZX81 web-server: online since 2007

User avatar
Posts: 1160
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark

Re: MC INKEY$ replacement

Post by mrtinb » Mon Apr 15, 2019 9:40 am

A new "INKEY$" that fixes the problem with pressing Space/Break has to be a MC that does not return to Basic. Because if it returns to Basic, Space will break at any Basic statement.
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

Post Reply