Prev: 1623 Up: Map Next: 16D1
1632: page_out_to_basic: Relocatable initialize BASIC routine.
This routine is copied into the printer buffer to run so that this ROM can be paged out.
This routine replaces code from the OEL Issue 2.3 ROM.
page_out_to_basic 1632 LD A,$08 Output $08 to control register to page out ROM (also disables AFC and switches to channel 1).
1634 OUT ($7F),A
1636 LD HL,(telesoftware_RAMT) Load address from telesoftware_RAMT and store in P-RAMT system variable (address of last byte of physical RAM).
1639 LD ($5CB4),HL
163C LD DE,$3EAF Copy UDGs from BASIC ROM to the end of physical memory.
163F LD BC,$00A8
1642 EX DE,HL
1643 LDDR
1645 EX DE,HL Set UDG system variable.
1646 INC HL
1647 LD ($5C7B),HL
164A DEC HL Set RASP system variable (length of warning buzz) to 64 and RAMTOP system variable below UDG.
164B LD BC,$0040
164E LD ($5C38),BC
1652 LD ($5CB2),HL
1655 LD HL,$3C00 Set CHARS system variable to $3C00 (256 bytes before BASIC ROM font data).
1658 LD ($5C36),HL
165B LD HL,($5CB2) Reset stack below RAMTOP.
165E LD (HL),$3E
1660 DEC HL
1661 LD SP,HL
1662 DEC HL Set ERR-SP system variable (Address of item on machine stack to use as error return).
1663 DEC HL
1664 LD ($5C3D),HL
1667 IM 1 Switch to interrupt mode 1.
1669 LD IY,$5C3A Set IY register to address of ERR-NR system variable.
166D EI Enable interrupts.
166E LD HL,$5CB6 Set CHANS system variable to CHINFO (address of channel information).
1671 LD ($5C4F),HL Copy 21 bytes from CHANINFO to CHINFO system variable.
1674 LD DE,$15AF
1677 LD BC,$0015
167A EX DE,HL
167B LDIR
167D EX DE,HL Set DATADD system variable (Address of terminator of last DATA item) to end of channel info.
167E DEC HL
167F LD ($5C57),HL
1682 INC HL Set PROG system variable to following address.
1683 LD ($5C53),HL
1686 LD HL,($5C61) Set STKBOT and STKEND system variables to value of WORKSP system variable.
1689 LD ($5C63),HL
168C LD ($5C65),HL
168F LD A,$38 Set ATTR-P, ATTR-T, and BORDCR system variables to black on white attributes.
1691 LD ($5C8D),A
1694 LD ($5C8F),A
1697 LD ($5C48),A
169A LD HL,$0523 Initialize REPDEL and REPPER system variables.
169D LD ($5C09),HL
16A0 LD HL,$5C00 Decrement KSTATE0 and KSTATE4.
16A3 DEC (HL)
16A4 LD HL,$5C04
16A7 DEC (HL)
16A8 LD HL,$15C6 Copy 14 bytes from STRMDATA to STRMS system variable (addresses of channels attached to streams).
16AB LD DE,$5C10
16AE LD BC,$000E
16B1 LDIR
16B3 LD HL,$5C3B Set bit 1 of FLAGS system variable (printer in use).
16B6 SET 1,(HL)
16B8 LD A,$02 Set DF-SZ system variable (number of lower screen lines) to 2.
16BA LD ($5C6B),A
16BD LD A,$FF Set ERR-NR system variable to $FF (error 0).
16BF LD ($5C3A),A
16C2 CALL $0D6B Call $0D6B (CLS routine).
16C5 LD A,$07 Set the border colour to white, and EAR and MIC bits low.
16C7 OUT ($FE),A
16C9 LD A,$00 Call $1601 (CHAN-OPEN) to open stream 0 (channel 'K').
16CB CALL $1601
16CE JP $12CF Jump to $12CF (MAIN_3) in the ROM main execution loop.
Prev: 1623 Up: Map Next: 16D1