;S2R0010B.Z80 -- Small Z80 Board, Bootstrap Loader ; ;Created: 29 JAN 1998 ;Author: Douglas Beattie Jr. ; NMIVEC EQU 0066H ;Z80 NMI vector MEMBOT EQU 0800H ;Base of RAM memory MEMTOP EQU 1000H ;End of 2K, Out of memory MEMSIZ EQU MEMTOP-MEMBOT .IF (MEMSIZ .GT. 2048) .ERROR "Memory Size too large." .ENDIF ; ; Note that the PIO decode uses A0 connected to C/D pin ; and A1 connected to Port-select pin. This is in ; contradiction with convention, but optimizes code ; for use in our application; where only one port will ; be extensively used in any ISR. ; PIO0 EQU 88H ;Base port addr, PIO #0 decode PIO1 EQU 80H ;PIO #1 not currently implemented P0DTAA EQU PIO0+0 ;Port A data P0CTLA EQU PIO0+1 ;Port A control P0DTAB P0CTLB ; ORG MEMBOT RST0 DS 4 ;4 bytes, allows for 'DI' opcode RST1 DS 4 RST2 DS 4 RST3 DS 4 RST4 DS 4 RST5 DS 4 RST6 DS 4 RST7 DS 4 ; ASEG ;Absolute Code Segment ORG 0000H ;Base of ROM JP ENTRY ;Jump to Cold Boot ORG 0008H ;Restart vector @ 0008h JP RST1 ; ORG 0038H EXX LD HL,(RST7VEC) PUSH HL EXX RET ; ; Initialize a PIO ; port address of PIO is in Reg C ; INITPIO LD A,01001100B OUT (C),A RET ; ; Entry from Cold Boot or Restart @ 0 ; ENTRY DI ;disable interrupts LD SP,MEMTOP-1 ;init stack ptr LD C,P0CTLA ;set port addr CALL INITPIO ;go init PIO0 LD HL,INTSERV ;point to ISR LD (RST7VEC),HL IM 1 EI HALT RST 1 RET ; END ENTRY ;Thu Jan 29 19:24:07 PST 1998 ;Fri Jan 30 22:16:38 PST 1998