ƒ‚RŽ²ƒ‚[ƒ^§ŒäŠ„ž‚݃‹[ƒ`ƒ“„
;@@start Z80 mode0/mode1
;
; this file must be located at address 0x0000
EXTRN main_
EXTRN nmi_handler_
EXTRN rst38_handler_
;
;
;
;// ‚m‚l‚hŠ„‚螂݃tƒ‰ƒO
EXTRN Nmi_flag_
;// ƒGƒ‰[ƒ|[ƒg‚Ì’l
EXTRN Err_pdata_
;
;
;// ‚h^‚nƒ|[ƒg‚Ì’è‹`
FIFOW EQU 0x80
FIFOR EQU 0x80
P8255_0 EQU 0x00
P8255_1 EQU 0x01
P8255_2 EQU 0x02
P8255_C EQU 0x03
C8254_0 EQU 0x40
C8254_1 EQU 0x41
C8254_2 EQU 0x42
C8254_C EQU 0x43
ERR_POUT EQU 0xf0
;
;
CSEG
PUBLIC START_
START::
LD SP,0
JP STARTUP
ORG 8H
JP RST08
ORG 10H
JP RST10
ORG 18H
JP RST18
ORG 20H
JP RST20
ORG 28H
JP RST28
ORG 30H
JP RST30
ORG 38H
JP RST38
ORG 66H
JP NMI
ORG 80H
;
;
;
STARTUP:
; clear DATA segment
;
LD HL,DATATOP
;
LD DE,_endx_## ;
_endx_ is defined in romlib
;
LD A,E
; SUB
L
;
LD C,A
;
LD A,D
; SBC
A,H
;
LD B,A
; _1:
LD A,B
;
OR C
;
JP Z,_2
;
LD (HL),0
;
INC HL
;
DEC BC
;
JP _1
; _2:
;;;; ‰Šú‰»
IM 1 ; if you
run in mode 1
; EI
JP main_##
; interrupt handlers
RST08::
HALT
RST10::
HALT
RST18::
HALT
RST20::
HALT
RST28::
HALT
RST30::
HALT
RST38::
PUSH AF
PUSH BC
PUSH DE
PUSH HL
CALL
int_handler_## ; call interrupt handler
POP HL
POP DE
POP BC
POP AF
EI
RETI
;
;
;
NMI::
PUSH AF
;
LD A,1
LD (Nmi_flag_),a
;ƒtƒ‰ƒO‚ð‚P‚Ö
;
LD
A,(Err_pdata_) ;ƒGƒ‰[ƒ|[ƒg‚Ì’l‚𓾂é
AND 0feh
@@;‚m‚l‚hQ‚d‚mQ‚a‚h‚s‚ð‚k‚n‚v‚É
;
OUT (ERR_POUT),a
;‚m‚l‚hƒJƒEƒ“ƒ^”‚O‚ð’âŽ~‚·‚é
;
POP AF
;
RETN
;
DSEG
DATATOP::
END