Inputs a byte from an input device.
address of DCB
Outputs a byte to an output device.
address of DCB
;output dev not ready
INKEY subroutine – scans keyboard. The data is not echoed on your screen. Note that calling 0358H instead will eliminate need to save DE.
;no key pressed
key is now in A
DISPLAY subroutine- prints character in A at current cursor position on video display. Cursor position is stored at 4020-4021. Note that calling 033AH instead will eliminate need to save DE.
;* optionally position cursor
;* before displaying byte
LPRINT subroutine- prints character in A on line printer. Note that calling 039CH instead will eliminate need to save DE.
;printer not ready
INPUT subroutine- scans keyboard and waits for key to be pressed. Note that calling 0384H instead will eliminate need to save DE.
;wait for key
Delay loop in 14.66 microsecond increments. A value of 0 will be equal to .96 seconds.
;number of delays
;delay a little
NMI vector. Jumps here on non-maskable interrupt (ie. HALT or press of RESET button). Note- see 41BE.
SET, RESET, POINT graphics functions. You must make sure that the coordinates are within legal range.
x coordinate (0-127)
;y coordinate (0-47)
;POINT=00, RET=80H, RESET=01
;B, A, and HL will be destroyed
;*if POINT was done
;* the point was off
;* the point was on
;push x coordinate
;fake out BASIC’s RST8
;go do the selected function
make believe this is a BASIC program
CLS subroutine- homes cursor and clears screen.
SYSTEM command- prints “*?” and waits for entry. When using the SYSTEM command, if your program machine language program has an ORG for 41BEH with a 3 byte instruction following, then that 3 byte instruction will be automaticly executed after your tape is finished loading. For example:
; first instruction of your program
LINE INPUT subroutine- accepts a line of keyboard input terminated by ENTER or BREAK. Echoes characters typed and recognizes control functions (backspace, shift-backspace, etc.). None of these special characters ever get put into your buffer.
;maximum chars allowed to input
;address of buffer to store chars in
;get a line of input
;BREAK was hit
;B = number of characters typed including terminator
;C = original contents of B
Used to pass a 06-bit value to a machine language program.
;get value from BASIC
;value now in HL
Used to pass a 16-bit value back to BASIC.
;get value to give BASIC
at this point you’re back in BASIC with the value.
Normal entry point for a READY in Level II or Disk BASIC. Note that it is better to jump to 06CCH because it does not cause an OM error on the first command that follows.
Prints “?”, inputs up to 241 characters from the keyboard and echoes characters typed. Data goes into BASIC’s input buffer. 0361H is the same as 1BB3H, less the prompt.
;HL= points to 1st character minus 1
(RST10H) Finds next non-blank character in a sting. It increments through string, ignoring spaces and control characters 9 and 10 (enters) and returns when the next non-blank character is encountered.
start address of string minus 1
A= non-blank character found
;found a 00 byte (end of line)
or “:” (end of statement)
;got an ASCII numeric digit
;not a numeric digit
ASCII integer decimal to HEX converter.
address of ASCII decimal num
;translate to HEX
DE= HEX result
HL= points to first non-decimal character
Point to the VARPTR of a variable. If the variable doesn’t exist then create it first.
;point to ASCII variable name
;look for/create it
DE= points to VARPTR of the variable
PRINT subroutine- prints a string of text on the video display, terminated by ENTER (13) or NULL (00), at current cursor position.
;address of text