You can find the rom listing at http://www.wearmouth.demon.co.uk/zx81.htm
Interesting bits for you below.
cya, Andrew...
; -----------------------
; THE 'INKEY$' EVALUATION
; -----------------------
CALL L02BB ; routine KEYBOARD
LD B,H ;
LD C,L ;
LD D,C ;
INC D ;
CALL NZ,L07BD ; routine DECODE
LD A,D ;
ADC A,D ;
LD B,D ;
LD C,A ;
EX DE,HL ;
JR L0FED ; forward to S-STRING
; THE 'INKEY$' EVALUATION
; -----------------------
CALL L02BB ; routine KEYBOARD
LD B,H ;
LD C,L ;
LD D,C ;
INC D ;
CALL NZ,L07BD ; routine DECODE
LD A,D ;
ADC A,D ;
LD B,D ;
LD C,A ;
EX DE,HL ;
JR L0FED ; forward to S-STRING
; ----------------------------------
; THE 'KEYBOARD SCANNING' SUBROUTINE
; ----------------------------------
; The keyboard is read during the vertical sync interval while no video is
; being displayed. Reading a port with address bit 0 low i.e. $FE starts the
; vertical sync pulse.
;; KEYBOARD
L02BB: LD HL,$FFFF ; (16) prepare a buffer to take key.
...
; THE 'KEYBOARD SCANNING' SUBROUTINE
; ----------------------------------
; The keyboard is read during the vertical sync interval while no video is
; being displayed. Reading a port with address bit 0 low i.e. $FE starts the
; vertical sync pulse.
;; KEYBOARD
L02BB: LD HL,$FFFF ; (16) prepare a buffer to take key.
...
; -------------------------------
; THE 'KEYBOARD DECODING' SECTION
; -------------------------------
; The decoded key value is in E and HL points to the position in the
; key table. D contains zero.
;; K-DECODE
L04DF: LD A,($4006) ; Fetch value of system variable MODE
....
; THE 'KEYBOARD DECODING' SECTION
; -------------------------------
; The decoded key value is in E and HL points to the position in the
; key table. D contains zero.
;; K-DECODE
L04DF: LD A,($4006) ; Fetch value of system variable MODE
....
-----Original Message-----I am working on a ZX81 machine code program.
From: zx81forever [mailto:zx81forever@...]
Sent: Saturday, 10 January 2004 4:46 PM
To: zxgate@yahoogroups.com
Subject: [zxgate] ZX81 Machine Code ???
I have a question. I believe the answer may
have appeared in SYNC Magazine (Vol.3 No.6,
featuring "Machine Language:ROM Calls" ???)
but my copy has been misplaced.
My question: how do you determine which key
has been pressed? I need to know the CODE
value of the key pressed.
If I remember correctly, there is a ROM call,
followed by the placing of register BC in HL,
followed by another ROM call.
If anyone can post the exact details, or scan
the "ROM Calls" article out of SYNC (that'll
be a very big help), I would appreciate it.
Thank you,
zx81forever@...
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/zxgate/
- To unsubscribe from this group, send an email to:
zxgate-unsubscribe@yahoogroups.com
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.