System OS ROM Routines
INCH Routine
FDF4
Entry: None
Exit: Acca contains hex value of closed key.
INCH guards against the entry of a false output from the keyboard due to contact bounce or pressing more than one key. ACCB is loaded with hex 20 and ENCODE is called to scan the keyboard. If C is set (key closed), a branch occurs back to the beginning. If C is clear (no closure), ACCB is decremented and ENCODE is called again. ENCODE must return C clear 32 consecutive times (approx. 9ms) to exit this loop. The second half of the routine is then entered. This half is identical to that described above, except C must be set 32 consecutive times before exit with the hex value of the key closed in ACCA.
ENCODE Routine
FDBB
Entry: None
Exit: Acca contains hex value of key closed.
“C” set for valid condition.
ENCODE is the keyboard scanning routine. If a key is closed, the value is found in the hex table and loaded in ACCA. The C bit in the condition code register is set to indicate a valid key. If no key is closed or if the value is not in HEX-TAB, the C bit is cleared.
OUTCH Routine
FE3A
Entry: Acca contains segment code. DIGADD contains address of desired digit. Entry at OUTO if index register is not to be saved.
Exit: DIGADD contains address of next digit to right.
OUTCH outputs a character to the display whose address is contained at memory location DIGADD (00F0-00F1). This routine may be entered at OUTO if the index register does not need to be saved. The code for the character to be displayed must be in ACCA when the routine is entered. The following drawing shows the segment identification and the corresponding positions in the eight bits of ACCA. A logic one in a bit will cause that segment to light, whereas a logic zero will keep it off. The hex and corresponding bit codes are shown for two characters used in the monitor program. The most significant bit is DP and the least significant bit is segment G.
Segment codes used by the monitor program are shown at the end of the monitor listing.
|
|
D7
|
D6
|
D5
|
D4
|
D3
|
D2
|
D1
|
D0
|
|
Segment
|
DP
|
a
|
b
|
c
|
d
|
e
|
f
|
g
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OUTHEX Routine
FE28
Entry: ACCA contains hex value.
Exit: Address of next digit to right contained in DIGADD.
OUTHEX determines the segment code for a hex value contained in the four least-significant bits(LSB) of ACCA. Subroutine OUTO is then called to output the hex value to the display whose address is obtained from DIGADD. OUTHEX does not preserve the contents of the index register.
OUTBYT Routine
FE20
Entry: ACCA contains two hex values.
Exit: Digit address for next digit to right contained in DIGADD.
OUTBYT outputs two hex values contained in ACCA to two adjacent displays. The value contained in the four most-significant bits are moved to the LSB positions. OUTHEX is called to determine the segment code and in turn calls OUTO to output the character to the display addressed at DIGADD. ACCA is restored, and OUTHEX and OUTO are called again to output the LSB to the next display to the right.
String Output Routines
[top]
OUTST1 FE50
OUTSTJ FD8C
OUTSTA FC86
OUTSTR FE52
Entry: Calling convention must be JSR to entry point. Segment codes for output characters from left to right at consecutive addresses immediately following jump instruction. Entry at OUTSTJ or OUTSTA set up for left-most character at H or V display respectively. Entry at OUTST1 requires the Index register to contain left most digit address. Entry at OUTSTR requires left-most digit address at DIGADD. Decimal point must be lit on last character.
Exit: To next instruction at 1 + address of last character. ACCA is clear. DIGADD contains address of display to right of last digit lit.
OUTST1 outputs a string of characters from left to right on the displays. The first character is output to the display whose address is contained in the index register upon entry to the routine. The last character must have the decimal point lit to indicate the end of the string. The routine may be entered at OUTSTJ and the first character will be diaplayed at “H.” Entry at OUTSTA will display the first character at “V.” Entry at OUTST1 will display the first character at the address contained in the index register. Entry at OUTSRT will display the first character at the address in DIGADD.
DSPLAY Routine
FD7B
Entry: Index Register contains address of first byte of display data. ACCB contains number of bytes to output. DIGADD contains the address of first digit.
Exit: Index Register and ACCB unchanged. Address of next digit to right contained in DIGADD.
DSPLAY is called to output two or three bytes to the displays. The number of bytes to output is indicated by the contents of ACCB. This routine could be called to output one byte, although OUTBYT would normally be called for this purpose. ACCA is loaded with a byte value from an address contained in the index register and OUTBYT is called to output the byte to the displays. Then the index register is incremented to get the next byte, ACCB is decremented, and OUTBYT is called again. When ACCB is zero, all bytes have been output and the index register and ACCB are restored before returning from the routine.
IHB Routine
FE09
Entry: None
Exit: ACCA contains byte value. Digit address for next digit to right contained in DIGADD.
IHB outputs two hex characters to the displays corresponding to two consecutive key closures and returns to the calling routine with the byte value of the two closures in ACCA. INCH is called to get the value of the first closure. OUTHEX is called to display the value on the display whose address is contained at DIGADD. The value contained in the four LSB of ACCA is moved to the four MSB of ACCA and then saved in ACCB. INCH is called again to get the value of the second key closure. OUTHEX is then called again and this value is displayed on the next display to the right. The contents of ACCA and ACCB are combined and placed in ACCA. ACCA now contains the byte value of the two closures. The MSB contains the first closure and the LSB contains the second value. ACCB is restored, ACCA is pushed onto the stack, and ENCODE is called to wait for the release of the second key. When the key is released, the byte is puled from the stack and the program returns to the calling routine with the byte contained in ACCA.
REDIS Routine
FCBC
Entry: None
Exit DIGADD contains address of left hand digit.
REDIS is a short routine to reset the address at DIGADD to the left most display digit. The displays are blanked.
Memory Map
[top]
FFFF-FC00 System OS ROM $400, 1024
FBFF-E000 FREE $1C00, 7168
DFFF-D000 Application ROM $1000, 4096
CFFF-C170 FREE $E90, 3728
C16F-C110 System Displays $60, 96
C10F-C100 FREE $10, 16
C0FF-C000 System Keypad $100, 256
BFFF-0400 FREE $BC00, 48128
03FF-0000 RAM $400, 1024
|