;------------------------------------- ;-- testVID.asm ;-- Sends string to display. While-loop version. ;------------------------------------- .ORIG x0200 lea r1, MSG ;-- char_ptr <== &MSG (1st char) ldr r0, r1, 0 ;-- char <== *char_ptr while_nonNUL: ;-- while( char != NUL ) brz done ;-- begin_while_non_NUL poll: ;-- do ldi r2, DSR ;-- status <== DSR brzp poll ;-- until( status == READY ) sti r0, DDR ;-- DDR <== char (print char) add r1, r1, 1 ;-- char_ptr++ (next char) ldr r0, r1, 0 ;-- char <== *char_ptr br while_nonNUL ;-- end_while_non_NUL done: ld r4, STOP_CLOCK ;-- R4 <== STOP_CLOCK sti r4, MCR ;-- MCR <== R4 (shutdown LC3) MSG: .STRINGZ "\nAre You Happy To See ME?\n" DSR: .FILL xFE04 ;-- display status register DDR: .FILL xFE06 ;-- display data register STOP_CLOCK: .FILL x8000 ;-- MCR[15] == 1 (stop clock) MCR: .FILL xFFFE ;-- machine control register .END