SUBTTL Glavni program (RPMAIN.ASM) v1.0,(C)26.11.90 OLEO
TITLE  REKLAMNI PANEL

.Z80	;Procesor je Z80A (Z8400)

.XLIST
IF1
	INCLUDE RP.ASI
	INCLUDE RPFNAMES.ASI
ENDIF
.LIST
.SALL
	PUBLIC		START
	EXTERNAL	EDIT
	EXTERNAL	CRCOK
	EXTERNAL	RSTXT
	EXTERNAL	OPEN
	EXTERNAL	ISBRK
	EXTERNAL	RUN
	
	CSEG

START:
	ld sp,STACK	;nastavi sklad
	rst CLRWDT
	ld a,0FFh
	ld (P1OUTMASK),a
	out (P1),a
	ld b,NUL
setwd:	xor WDC
	out (P1),a
	djnz setwd

	ld iy,RAMSTART	;nastavi kazalec za spremenljivke
	im 2  ;prekinitveni na~in 2


NMION:
	
	ld a,(P1OUTMASK)	;Pri`gi NMI
  IFDEF NMION
	and NOT NMIEN
  ELSE
	or NMIEN
  ENDIF
	ld (P1OUTMASK),a
	out (P1),a	


	VBIOS LOADROMFONT
	DB NUL
	VBIOS CLRPAGES
	DB NUL
	VBIOS SETDPAGE
	DB 0,NUL

  	call RSTXT
  	VBIOS PO_TESTIRANJE
	DB NUL
	VBIOS VDELAY
	DB 0,20,NUL
	call ISBRK  	;ali je pritisnjena tipka break
	jp nc,EDIT	;~e je BREAK sko~i v editor

	call CRCOK	;Ali je kontrolna vsota OK
	jr z, m_edit
	call OPEN	;~e kontrolna vsota ni OK odpri datoteko
	call RSTXT
	jr c, no_kb
	jp EDIT
m_edit:	VBIOS CLRPAGES
	db NUL
	call RUN	;~e bo BREAK
	jp EDIT		;bo sko~il v editor

no_kb:			;tipkovnica ni prisotna
	VBIOS POERROR
	dw nokbdmsg
	db NUL
no_kbl:	VBIOS VDELAY
	db 10,NUL
	call RSTXT
	jr c, no_kbl
	call OPEN
	jp EDIT
nokbdmsg: DEFM "#4 No Keybrd"""


END