Daryl sent me a PM a couple of years ago when I had trouble tracking down the details of the built-in I/O system. I'm not sure if anyone else has struggled to find this in the documentation, but I'm including it here anyway, and apologizing in advance if it's redundant:
Code:
Functions built into the Simulator's IO page.
The following table lists the IO functions supported within the IO page. The IO Page is set in the options menu. The variable "IO_AREA" is reserved and will return the start address of the IO page.
IO_AREA+0: TERMINAL_CLS (w)
IO_AREA+1: TERMINAL_OUT (w)
IO_AREA+2: TERMINAL_OUT_CHR (w)
IO_AREA+3: TERMINAL_OUT_HEX (w)
IO_AREA+4: TERMINAL_IN (r)
IO_AREA+5: TERMINAL_X_POS (r/w)
IO_AREA+6: TERMINAL_Y_POS (r/w)
(w) means write only port, (r) read only, (r/w) read/write.
TERMINAL_CLS - clear terminal window, set cursor at (0,0) position.
TERMINAL_OUT - output single character interpreting control characters.
Terminal can only recognize those characters:
ASCII $0D (carriage return) moving cursor to the beginning of line,
ASCII $0A (line feed) moving cursor to the next line and scrolling window if necessary,
ASCII $08 (backspace) moving one position to the left and erasing char below cursor.
TERMINAL_OUT_CHR - outputs single character; control chars are being output just like regular characters.
TERMINAL_OUT_HEX - outputs single byte as a two-digit hexadecimal number.
TERMINAL_IN - input single byte, returns 0 if there's no characters available in terminal's buffer; when I/O terminal window is active it can accept keyboard input; press [Ins] key to paste clipboard's contents into terminal.
TERMINAL_X_POS - cursor X position (column).
TERMINAL_Y_POS - cursor Y position (row).
GARTHWILSON wrote:
... what I've done there is just follow the data sheets carefully, and things have always worked.
You have a rare talent, Garth. I consider myself lucky when a non-trivial creation of mine works properly on the first run. It happens, but not often, and certainly not always.
_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some
VTL02C on it and see how it grows on you!
Mike B.
(about me) (learning how to github)