Unformatted text preview: ; ; LOOP TRAP x20 ;Reads the keyboard (Your input) TRAP x21 ;It sends it to the console LD R1,OKAY ;Loads OKAY(the enter function) into R1 STR R0,R3,0 ;Stores R3 to R0 ADD R3,R3,1 ;Adds one to R3, into R3 ADD R1,R0,R1 ;Adds R1 to R0, into R1 BRnp LOOP ;Branch back to again if R1 is not 0 AND R0,R1,0 ;Clears R1, stores in R0 STR R0,R3,-1 ;Stores R3-1 into R0 LEA R0,VALUE ;Loads the .BLKW into R0, ;meaning you have that many bits to input. ; TRAP x22 ;Prints what is typed HALT ;Halt processor (0 arguments) INST .STRINGZ “ ” ;String = Nothing. You can type here OKAY .FILL xFFF6 ;Fills OKAY with the ENTER function. VALUE .BLKW 1 ;How many memory values are used. .END ;End program...
View Full Document
This note was uploaded on 01/12/2010 for the course BME 14345 taught by Professor Orlyalter during the Fall '09 term at University of Texas.
- Fall '09