ROM Addresses - General

Introduction

The following Z80 registers and register pairs apply:  A,F,B,C,D,E,H,L,AF,BC,DE,HL,IX,IY.
Any of these preceeded by a "'" refers to the alternate set.

Miscellaneous

  • SA - Software accumulator
  • SA1 - Alternate software accumulator
  • RA - Register accumulator (E,D,C,B).
HexDec.LabelTypeDescription
00000DOSCLDJpIn cassette systems, reset computer; in disk systems, cold boot of DOS. Could also be done via RST 00H.
00088SYNTAXRSTChecks for syntax. HL points to byte to be checked and proper byte follows RST 08H instruction.
000B11WHERECallVector used to resolve relocation address of calling routine. On exit, HL points to address following Call instruction.
001319GETCallThis routine gets a byte from a logical device or a file that is open. When calling, DE =starting address of DCB of device. On exit, A= byte received from device, z set if device ready. Uses AF.
001824CP16RstCompare DE and HL as 16 bit unsigned intergers.
001B27PUTCallOutputs a byte to a logical device or FCB. Outputs a byte to a device. When calling, A = output byte, DE = starting address of DCB of device. On exit, z set if device ready. Uses AF. Don't confuse with CTL at 0023.
002335CTLCallOutputs a control byte to a logical device or FCB. DE = FCB and A = control byte.
002840 RstPressing Break key RST's here and then jumps to location 400CH. Also normal DOS function vector.
002B43KBDSCNCallScan keyboard and return with accumulator containing result. DE is used.
003351VDCHARCallDisplays a character at current cursor location.
003B59PRCHARCallWaits until printer is ready then prints charatcter. A = ASCII character. If BREAK is pressed, a return to caller is made.
004064KBLINECallCall Input a line from the keyboard. B = max length of line. HL points at buffer. Buffer should be the length of B plus 1. To terminate, hit BREAK or ENTER. On exit, HL points at buffer and B = number of characters entered. Carry will be set if BREAK was pressed.
004973KBWAITCallScans the keyboard until a key is pressed. If BREAK is pressed, it is returned like other keys.
005080RSRCVCallRecieve a character from RS-232. No entry conditions. On exit, memory location 16872 contains character recieved. DE is altered. This routine honors wait status.
005585RSTXCallTransmit character to RS-232. On entry, Accumulator or memory location 16880 contains character. On exit, 16880 = 0 if no character sent. Wait status honored.
005A90RSINITCallCall Initialize RS-232 interface. On entry, memory location 16888 = send/recieve baud rate code, location 16890 = wait/don't wait switch, location 16889 = RS-232 characteristics switch. On exit, DE is altered. For more detail, consult Model 3 reference manual.
006096DELAYCallLoad BC with how many times to loop, then call.
0069105INITIOCallInitialize all I/O drivers to their ROM routines. No entry conditions. On exit, all registers changed.
006C108ROUTECallOn entry, location 4222H = two byte source device ASCII abbreviation and location 4220H = two byte destination ASCII abbreviation. On exit, DE is altered.
0072114  An alternative for entering Basic. See also 1A19H.
00B1177  Type in SYSTEM (even from DISK BASIC) and reply to the "*?" prompt with /177. The computer will then ask you for memory size. Upon return, you'll still be in DISK BASIC, but your program will be gone. Also, it doesn't get along with any high memory routines present.
00FA250  Call this routine from BASIC and your computer will brag about it having Level II or Model III BASIC.
0132306POINT Basic's POINT routine.
0135309SET Basic's SET routine.
0138312RESET Basic's RESET routine.
0150336GRAPHJpThis is the routine that is Basic's SET, RESET, and POINT functions. Here's how to use it. Load HL with return address and push. Load register A with one of the following: 00H = POINT, 01H = RESET, and 80H = SET. Push AF onto stack. Load A with X coordinate and push onto stack. Load A with Y coordianate and JP GRAPH.
018C396 CallChecks for syntax of "")"" via RST 08H.
01C9457CLSCallClear screen.
01D3467RANDOMCallRandomize.
01F8504CSOFFCallThis routine turns off the cassette drive.
0212530DEFCASCallA register contains a 0 or 1 which is the cassette number. This routine defines cassette number and turns on cassette. Model I only.
022C556  Model I only (also may be used with Model III). Blinks right asterisk during tape load operations. NOTE: On Model III this location has jump to 0212H (zeroes A register and returns). Uses AF.
0235565CSINCallInputs data one byte at a time from cassette after you use CSHIN. A = the data byte.
0264612CSOUTCallOutputs data one byte at a time to cassette after you use CSHWR. A = the output byte.
0287647CSHWRCallTurns on the cassette and writes the header.
0296662CSHINCallFinds the cassette header info at the beggining of cassette file.
02B2690SYSTEM Basic's SYSTEM routine.
0314788  Reads two bytes (LSB/MSB) and transfers to HL registers (used when reading SYSTEM format tapes). Uses AF,HL.
032A810OUTCHRCallOutput a byte to device determined by byte stored at (409CH) - FFH=Tape, 0=Video, l=Printer. When calling, A = output byte. Uses AF (may use other registers as well). Warning: This routine CALLS a Disk BASIC link at address 41ClH which may have to be "plugged" with a RETurn (C9H) instruction
033A826DISPACallDisplays character in A on screen at next print position. Uses AF.
0358856  Calls keyboard scan routine.
035B859 CallSame as 002BH.
0361865KIBUFFCallReads keyboard into buffer until a carriage return is entered. 40A7H contains the address of the buffer.
03C2962  Line printer driver for Model I.
03E3995  Keyboard driver for Model I. Model III = 3024H.
04581112  Video driver for Model I.
04731139  Video driver for Model III.
05061286CURCON Start of cursor control table. Model I. 80 Microcomputing, Sept. 1980, p. 187.
05401344  End of cursor control table.
058D1421  Line printer driver for Model I.
05D91497KLINECallSame as KBLINE. See 0040.
06CC1740  An alternative for entering Basic. See also 1A19H.
06D21746  Start of Model 1 interrupts relocated to RAM on boot up.
06E61766  End of Model 1 interrupts relocated to RAM on boot up.
06E71767  Start of Model 1 keyboard DCB.
06EE1774  End of Model 1 keyboard DCB.
06EF1775  Start of Model 1 Video DCB.
06F61782  End of Model 1 Video DCB.
06F71783  Start of Model 1 Printer DCB.
06FE1790  End of Model 1 Printer DCB.
07131811SUBSPCallSubtract SA from RA; result in SA.
07161814ADDSPCallAdd RA and SA; result in SA.
07781912RSETSACallIf SA contains a 00H, RND generates a number between 0 and 1. Use this call to place a 00H in SA.
08092057LOGCallBasic's LOG function.
08472119MLTSPCallMultiply RA and SA; result in SA.
08A22210DIVSPCallDivide RA by SA; result in SA.
09772423ABSCallBasic's ABS function.
09822434MVVARCallMove number of bytes shown by typeflag from area pointed to by DE to area pointed to by HL.
098A2442SGNCallBasic's SGN function.
09A42468LDSTSACallLoad SA into stack.
09B12481LDSAHLCallLoad single precision number pointed to by HL into SA.
09B42484LDSARACallLoad RA into SA.
09BF2495LDRASACallLoad SA into RA.
09C22498LDRAHLCallLoad single precision number pointed to by HL into RA.
09CB2507LDHLSACallLoad SA into area pointed to by HL.
09D22514LDDEHLCallLoad single precision number pointed to by HL into area pointed to by DE; needs FLAGSP.
09D32515LDHLDECallLoad single precision number pointed to by DE into area pointed to by HL; needs FLAGSP.
09D62518MOVEACallMove data; DE = source, HL = destination, A = how much to move.
09D72519MOVEBCallSame as above, except B contains the count.
09F72551MVSAHLCallMove number pointed to by HL into SA; needs FLAGDP.
09FC2556MVALTCallMove SA into SA1.
0A0C2572CPSPCallCompare RA and SA1.
0A392617CPINTCallCompare DE and HL.
0A782680CPDPCallCompare SA and SA1.
0A7F2687GETPARCallLoad parameter in USR(x) into HL; this must be first instruction of USR call. Also used for CINT function.
0A9A2714BSCPARJpReturn to Basic program with parameter.
0A9D2717FLAGINCallSet typeflag of SA to interger.
0AB12737CSASPCallConvert SA to single precision. Also Basic's CSNG routine.
0ACC2764CHGISCallValue in workspace/accumulator is changed from integer to single precision.
0ADB2779CSADPCallConvert SA to double precision. Also Basic's CDBL routine.
0AEC2796FLAGDPCallSet typeflag for SA to double precision.
0AEF2799FLAGSPCallSet typeflag for SA to single presision.
0B262854FIXCallBasic's FIX function.
0B372871INTCallBasic's INT function.
0BC73015SUBINTCallSubtract HL from DE; result in HL and SA if no overflow (flag = 2); result in SA only if overflow (flag = 4).
0BD23026ADDINTCallAdd DE and HL; result in HL and in SA if no overflow.
0BF23058MLTINTCallMultiply DE and HL; result in HL and SA if no overflow (flag=2), result in SA only if overflow (flag=4)
0C703184SUBDPCallSubtract SA1 from SA; result in SA.
0C773191ADDDPCallAdd SA and SA1; result in SA.
0DA13489MLTDPCallMultiply SA and SA1; result in SA.
0DE53557DIVDPCallDivided SA by SA1; result in SA.
0FAF4015  Display integer number in HL in ASCII decimal. The ASCII number will also be in memory at 4131H - 4135H.
0FBD4029CSAASCCallConvert SA (set typeflag) to ASCII. Result (in dec) is placed in buffer starting at 4130H and terminated by a 00H byte and HL = 4130H.
13E75095SQRCallBasic's SQR function.
13F75111POWERCallRaise RA to the power SA; result in SA.
14395177EXPCallBasic's EXP function.
14C95321RNDCallBasic's RND function.
14CC5321RNDCallBASIC's RND function if there is a number in the parenthetical