.orig x2000 start ldi r1, KBSR ; test for 1st input character brzp start ldi r0, KBDR ; load character into r0 start2 ldi r1, KBSR ; test for 2nd input character brzp start2 ldi r2, KBDR ; load character into r2 not r2, r2 ; invert R2 AND R2, r2, r0 ; compare r2 with r0 brz TWO ; they were the same if result 0 lea r1, ONCE ; they were not the same brnzp loop TWO lea r1, TWICE loop ldr r0, r1, #0 ; output string brz done ; if character is zero, we're done l2 ldi r2, CRTSR ; test for monitor available brzp l2 sti r0, CRTDR add R1,R1, #1 brnzp loop done halt TWICE .STRINGZ "You hit it twice!!" ONCE .STRINGZ "You hit differently!!" KBSR .fill xF400 KBDR .fill xF401 CRTSR .fill xF3FC CRTDR .fill xF3FF .end