$A000 and in an order that does not change. jsr $A000 prints a character on this ROM and on the next one. 6502.inc gives every slot its name, so you will write jsr Chrout.$A09F to $A0FE are reserved. Each is a real jump to a bare RTS, so calling one is harmless now and may do something later. Do not put your own code there.| Addr | Name | In / out |
|---|---|---|
| $A000 | Chrout | Output char (dispatched by IO_MODE) in A = character to output |
| $A003 | Chrin | Input char from buffer |
| $A090 | PrintStr | Print NUL-terminated string (A=lo, Y=hi); clobbers A,Y,STR_PTR in A = string address low, Y = string address high · out A, Y clobbered; X preserved; clobbers STR_PTR (Chrout preserves it) |
| $A093 | PrintCRLF | Print CR+LF |
| $A096 | PrintDecU16 | Print unsigned 16-bit decimal (A=lo, X=hi), no leading zeros in A = value low, X = value high |
| $A006 | WriteBuffer | Write byte to input buffer |
| $A009 | ReadBuffer | Read byte from input buffer |
| $A00C | BufferSize | Get buffer count |
| $A00F | SetIOMode | Set IO_MODE in A = mode (bit 0: 0=video, 1=serial) |
| $A012 | GetIOMode | Get IO_MODE out A = current IO_MODE |
| Addr | Name | In / out |
|---|---|---|
| $A015 | InitVideo | Initialize TMS9918 (mode registers + character set) |
| $A018 | VideoClear | Clear video screen |
| $A01B | VideoPutChar | Write char at cursor in A = character to write |
| $A02A | VideoChroutRaw | Output char to video (raw, no control-code handling) in A = character code (0-255) |
| $A01E | VideoSetCursor | Set cursor (X=col, Y=row) in X = column (0-39), Y = row (0-23) |
| $A021 | VideoGetCursor | Get cursor position out X = column (0-39), Y = row (0-23) |
| $A024 | VideoScroll | Scroll screen up one line |
| $A027 | VideoSetColor | Set TMS9918 text color (A=reg7 byte: hi=fg, lo=bg) in A = color byte (high nibble = fg color, low nibble = bg color) |
| Addr | Name | In / out |
|---|---|---|
| $A02D | InitSID | Initialize SID |
| $A030 | Beep | Play beep tone |
| $A033 | SidPlayNote | Play note (A=voice, X=freqLo, Y=freqHi) in A = voice (0-2), X = frequency low byte, Y = frequency high byte |
| $A036 | SidSilence | Silence all voices |
| $A039 | SidSetVolume | Set SID master volume (A=0-15) in A = volume (0-15); upper nibble of SID_MODE_VOL is cleared (no filter) |
| Addr | Name | In / out |
|---|---|---|
| $A045 | InitKB | Initialize GPIO/VIA keyboard |
| $A048 | ReadJoystick1 | Read joystick 1 out A = joystick bitmask (active-low bits: R-L-D-U-Y-X-B-A) |
| $A04B | ReadJoystick2 | Read joystick 2 out A = joystick bitmask (active-low bits: R-L-D-U-Y-X-B-A) |
| $A099 | KBDisable | Release both encoders and settle; ports free for raw read |
| $A09C | KBEnable | Re-enable both encoders |
| Addr | Name | In / out |
|---|---|---|
| $A07E | FsLoadFileAddr | Load named file to FS_IO_ADDR in STR_PTR = filename, FS_IO_ADDR = destination address |
| $A081 | FsSaveFileAddr | Save FS_FILE_SIZE bytes from FS_IO_ADDR to named file in STR_PTR = filename, FS_IO_ADDR = source address, FS_FILE_SIZE = byte count |
| $A03C | FsLoadFile | Load file from CF in STR_PTR ($02-$03) points to null-terminated filename · out Carry clear = success, FS_FILE_SIZE = bytes loaded; Carry set = file not found or read error |
| $A03F | FsSaveFile | Save file to CF in STR_PTR ($02-$03) points to null-terminated filename; FS_FILE_SIZE ($034A-$034B) = number of bytes to save · out Carry clear = success, Carry set = error (directory full or write error) |
| $A042 | FsDeleteFile | Delete file from CF in STR_PTR ($02-$03) points to null-terminated filename · out Carry clear = success, Carry set = file not found or error |
| $A084 | FsFormatDisk | Zero the current disk's directory sector out Carry clear = success, Carry set = write error |
| $A087 | FsSetDisk | Select current CF disk (A=0-255) in A = disk number (0-255) |
| $A08A | FsGetDisk | Get current CF disk (A=disk) out A = current disk number |
| $A08D | FsPrintDisk | Print "DISK n" + CRLF via Chrout |
| Addr | Name | In / out |
|---|---|---|
| $A06C | StReadSector | Read CF sector in CF_LBA ($26-$29) = LBA address, CF_BUF_PTR ($24-$25) = destination pointer · out Carry clear = success, Carry set = error; CF_BUF_PTR advanced by 512 bytes on success |
| $A06F | StWriteSector | Write CF sector in CF_LBA ($26-$29) = LBA address, CF_BUF_PTR ($24-$25) = source pointer · out Carry clear = success, Carry set = error; CF_BUF_PTR advanced by 512 bytes on success |
| $A072 | StWaitReady | Wait CF ready out Carry clear = ready, Carry set = error or timeout |
| Addr | Name | In / out |
|---|---|---|
| $A04E | InitSC | Initialize serial 6551 |
| $A051 | SerialChrout | Direct serial output (bypass IO_MODE) |
| $A054 | XModemLoad | Receive binary via XModem in XFER_PTR = destination address (set by caller) · out Carry clear = success, XFER_PTR past last byte written; XFER_REMAIN = total bytes received; Carry set = transfer failed |
| $A057 | XModemSave | Send binary via XModem in XFER_PTR = source address, XFER_REMAIN = byte count (set by caller) · out Carry clear = success, Carry set = transfer failed |
| Addr | Name | In / out |
|---|---|---|
| $A05A | RtcReadTime | Read RTC time out A = hours (binary), X = minutes (binary), Y = seconds (binary) |
| $A05D | RtcReadDate | Read RTC date out A = day of month (binary), X = month (binary), Y = year (binary); RTC_BUF_CENT = century (binary) |
| $A060 | RtcWriteTime | Set RTC time in A = hours (binary), X = minutes (binary), Y = seconds (binary) |
| $A063 | RtcWriteDate | Set RTC date in A = day of month (binary), X = month (binary), Y = year (binary); RTC_BUF_CENT = century (binary) |
| $A066 | RtcReadNVRAM | Read NVRAM byte in X = NVRAM address ($00-$FF) · out A = data byte |
| $A069 | RtcWriteNVRAM | Write NVRAM byte in X = NVRAM address ($00-$FF), A = data byte |
| Addr | Name | In / out |
|---|---|---|
| $A075 | SysDelay | Delay A=cnt_lo, X=cnt_hi centiseconds in A = count low byte, X = count high byte |
| $A078 | KernalInit | Initialize all hardware (caller must reset SP; no cli, no splash); rts when done |
| $A07B | KernalVersion | Get BIOS version (A=major, X=minor) out A = major version, X = minor version |