; Author: Example ; Date: March 31, 2011 ; ; Description: ; Example using pseudo directives. ; ; Variables: ; R0: ; R1: ; R2: ; R3: ; R4: ; R5: ; R6: ; R7: ; ; Initialization ; .ORIG x3000 TEMP .BLKW 5 COUNT .FILL 5 HELLO .STRINGZ "Hello World\n" AND R0, R0, #0 ;clear R0 AND R1, R1, #0 ;clear R1 AND R2, R2, #0 ;clear R2 AND R3, R3, #0 ;clear R3 LD R2, COUNT LEA R3, TEMP ;r6 will hold the # to guess LEA R0, HELLO ; load guess string ;;;;;;;; ; Main loop ;;;;;;;; LOOP PUTS ;Display text from HELLO var STR R2, R3, #0 ; store num of times thru in TEMP ADD R3, R3, #1 ; point to next address for TEMP ADD R2, R2, #-1 ; decr loop counter, R2 BRp LOOP ; branch to loop if positive HALT ; halt program .END