;------------------------------------- ;-- testVID.asm ;-- Sends chars to display. Should test DSR on first output, ;-- but doesn't since this supposedly runs before any other ;-- code at boot time. ;------------------------------------- ;;;;;;============= clear 80X24 screen ld r0, ZERO ld r4, CR ld r3, NUM24 ;-- row = 24 disp1: ld r2, NUM80 ;-- col = 80 poll1: ld r0, ZERO ldi r1, DSR ;-- Check DSR to see if ready BRzp poll1 ;-- No: poll again sti r0, DDR ;-- send char to display DDR add r2, r2, -1 ;-- col-- BRp poll1 poll2: ld r0, CR ldi r1, DSR ;-- Check DSR to see if ready BRzp poll2 ;-- No: poll again sti r0, DDR ;-- send char to display DDR add r3, r3, -1 ;-- row-- BRp disp1 kbLoop: poll3: ldi r1, KBSR ;-- Check KBSR to see if ready BRzp poll3 ;-- No: poll again ldi r0, KBDR ;-- get char from KBDR poll4: ldi r1, DSR ;-- Check DSR to see if ready BRzp poll4 ;-- No: poll again sti r0, DDR ;-- send char to display DDR BR kbLoop done: ld r4, STOP ;-- Disable sys_clk, sti r4, MCR ;-- shuts down hardware (simulation). ZERO: .FILL x0030 NUM24: .FILL #24 NUM80: .FILL #80 CR: .FILL x000A LF: .FILL x000D poll: ldi r1, DSR ;-- Check DSR to see if ready BRzp poll ;-- No: poll again sti r0, DDR ;-- send char to display DDR, and STOP: .FILL x8000 ;-- MCR[15] == 1 (disables sys_clk => shutdown) DoneN: .FILL x0039 ;-- Stop printing chars before '9' dispLoop: ldi r0,DSR ;-- wait for a display to be ready BRzp dispLoop ;-- DSR[15] == 1? no: poll again _mov( r0, r1 ) ;-- get char sti r0,DDR ;-- write char BR kbLoop ;-- do it again.