title 'Executive processor Test Program' ;---------------------------------------------------------------- ; This little program tests the EXEC executive processor ; by performing many of the functions provided. ; ; It can be downloaded into any Z80 computer running EXEC ; so long as the program is assembled to run at the correct ; address and loaded there etc.... It also must be modified ; so that it actually gets to EXEC. In a Z80, this is usually ; a restart ; ; Written by Richard Holmes 13/12/1987 ; Last Update by Richard Holmes 13/12/1987 ;---------------------------------------------------------------- ; maclib z80 maclib exec ; Loads the function names ; ; cr equ 0dh lf equ 0ah ; mvi c,exe$res ; Reset/Init system rst 1 ; mvi c,inln$chn rst 1 db cr,lf db cr,lf,'---- EXEC Test Program ----' db cr,lf,'Written By Richard Holmes' db cr,lf,' V1.1 08/01/1988' db cr,lf,0 ; ; ---- Main loop point to get the users key-stroke ---- ; get$info: lxi d,prompt mvi c,ptxt$chn rst 1 ; mvi c,inp$chn ; Read a character from channel rst 1 mvi c,caps ; Capitalize the accumulator rst 1 ; cpi 'N' ; Numerics test jz numbers$test ; cpi 'S' ; Channel change jz select$channel ; cpi 'P' jz printer$test ; cpi 'L' jz LCD$test ; cpi 'V' jz video$test ; cpi '?' jz help ; cpi 01bh jz 0 cpi 'Q' jz 0 ; mvi a,'?' mvi c,out$chn rst 1 jmp get$info ; page ; ;---------------------------------------------------------------- ; Save the current channel with a PUSH. ; Select the LCD Channel ; Write some guff to it ; Restore (pop) the original channel back. ;---------------------------------------------------------------- ; lcd$test: mvi c,inln$chn rst 1 db cr,lf,'-- LCD Test in Progress --',0 ; mvi c,psh$chn rst 1 ; ; Select the LCD now mvi a,6 ; LCD channel number mvi c,sel$chn ; Select channel function rst 1 ; rmenu1: mvi c,cscr$chn rst 1 lxi d,lcd$menu1 mvi c,menu$chn rst 1 ; Look for a key now mvi c,30 ; Read console key rst 1 cpi 01bh jz 0 cpi 'R' and 01fh jz rmenu1 ; ; At the LCD now. Clear it, Write string and numbers. mvi c,cscr$chn ; Clear screen rst 1 lxi d,lcd$menu ; X-Y Menu print mvi c,menu$chn ; Menu function code rst 1 ; mvi b,16 lxi d,1 ; Number seed lcd$num$loop: push d lxi d,1201h ; X = 18, y = 2 mvi c,crsr$chn ; Cursor address rst 1 pop d ; ; Now print some numbers mvi c,phde$chn ; Print hex DE rst 1 ; mvi a,'h' mvi c,out$chn ; Write accumulator rst 1 ; mvi c,spce$chn rst 1 ; Print a space ; mvi a,'=' mvi c,out$chn ; Write accumulator rst 1 ; mvi c,spce$chn rst 1 ; Print a space ; mvi c,pdde$chn rst 1 ; Print 1234h as a decimal now ; Change the seed now xchg dad h ; HL = HL * 2 xchg ; djnz lcd$num$loop ; Print again. ; ; Some text lxi d,1202h ; One line down mvi c,crsr$chn rst 1 ; mvi c,inln$chn rst 1 db 'at x = 18, y = 2',0 ; ; Return back to the original channel. mvi c,pop$chn rst 1 ; mvi c,crlf$chn rst 1 ; jmp get$info ; lcd$menu1: db 05,00,'+--------------------------------+',0 db 05,01,'| 4 by 40 LCD Display Test |',0 db 05,02,'| By Richard Holmes |',0 db 05,03,'+--------------------------------+',0 db 0ffh ; lcd$menu: ; 0123456789012345678901234567890123456789 db 00,00,' EXEC LCD Test Screen',0 db 00,01,' Numeric output : ',0 db 00,02,' Cursor Address : ',0 db 00,03,' .... Thats all folks',0 db 0ffh ; ;---------------------------------------------------------------- ; Test the video driver functions by performing all the ; possible screen driver routines and attributes provided. ; ; Clear screen ; Fill with a character ; Cursor position to 10,10 ; Clear to end of line ; Cursor position to 10,15 ; Clear to end of page ; Delay 2 seconds ; Clear screen ; Write messages each with a different video attribute ; ;---------------------------------------------------------------- ; video$test: mvi c,cscr$chn ; Clear screen rst 1 ; mvi b,24 ; Lines ; fill$screen: push b mvi b,80 ; Chars per line fill$line: mvi a,'H' mvi c,out$chn rst 1 djnz fill$line ; pop b djnz fill$screen ; ; Display a message and clear to end of line mvi c,xyin$chn ; X-Y Addressed inline print rst 1 db 10,10,'Tests Clear to end of line : ',0 ; mvi c,ceol$chn rst 1 ; ; Small delay lxi d,500 mvi c,delay rst 1 ; ; Display a message and clear to end of line mvi c,xyin$chn ; X-Y Addressed inline print rst 1 db 10,15,'Tests Clear to end of page : ',0 ; mvi c,ceos$chn rst 1 ; ; Delay lxi d,2000 ; 2 seconds mvi c,delay rst 1 ; ; Clear mvi c,cscr$chn rst 1 ; ; Test all the attributes now mvi a,1 mvi c,vatt$chn rst 1 ; Selects the video attribute mvi c,xyin$chn rst 1 ; Prints the x-y following string db 10,02,'Video Attribute 1',0 ; mvi a,2 mvi c,vatt$chn rst 1 ; Selects the video attribute mvi c,xyin$chn rst 1 ; Prints the x-y following string db 10,04,'Video Attribute 2',0 ; mvi a,3 mvi c,vatt$chn rst 1 ; Selects the video attribute mvi c,xyin$chn rst 1 ; Prints the x-y following string db 10,06,'Video Attribute 3',0 ; mvi a,4 mvi c,vatt$chn rst 1 ; Selects the video attribute mvi c,xyin$chn rst 1 ; Prints the x-y following string db 10,08,'Video Attribute 4',0 ; mvi a,5 mvi c,vatt$chn rst 1 ; Selects the video attribute mvi c,xyin$chn rst 1 ; Prints the x-y following string db 10,10,'Video Attribute 5',0 ; mvi a,6 mvi c,vatt$chn rst 1 ; Selects the video attribute mvi c,xyin$chn rst 1 ; Prints the x-y following string db 10,12,'Video Attribute 6',0 ; xra a mvi c,vatt$chn rst 1 ; jmp get$info ; ;---------------------------------------------------------------- ; Test the displaying of numbers in decimal and hex format. ;---------------------------------------------------------------- ; numbers$test: jmp get$info ; ;---------------------------------------------------------------- ; Test the printer by sending data to it. ;---------------------------------------------------------------- ; printer$test: mvi c,inln$chn rst 1 db cr,lf,'-- Printer Test in Progress --',0 ; ; Save current channel number/addresses etc. mvi c,psh$chn rst 1 ; mvi a,5 ; Printer channel mvi c,sel$chn ; Channel select function rst 1 ; Select the printer for all I/O now. ; call inln$chn db cr,lf,'---- EXEC Processor Test of the Printer ----' db cr,lf,0 ; ; ; Return back to the original channel. mvi c,pop$chn rst 1 jmp get$info ; ; -- Select a channel number to read from -- ; select$channel: mvi c,inln$chn rst 1 db cr,lf,'Current channel is : ',0 ; mvi c,get$chn rst 1 mvi c,pdac$chn ; Print decimal accumulator rst 1 ; mvi c,inln$chn rst 1 db cr,lf,'Enter Channel Number : ',0 ; mvi c,idhl$chn ; Read channel number rst 1 ; mov a,l ora a jz get$info ; mvi c,sel$chn ; Select this channel rst 1 jmp get$info ; ; -- Display help info -- ; help: lxi d,msg$help mvi c,ptxt$chn rst 1 jmp get$info ; prompt: db cr,lf,'ExecTest > ',0 ; msg$help: db cr,lf,'Press' db cr,lf,' L LCD Test' db cr,lf,' N Number display test' db cr,lf,' P Printer test' db cr,lf,' S Select a channel' db cr,lf,' V Video driver test' db cr,lf,' or Q to quit' db cr,lf,0 ; dseg ; ; ; end ;