ipl-logo

Nt1310 Unit 1 Reaction Paper

306 Words2 Pages
;================================================= ; Name: Jiunn Siow ; Username:jsiow001@ucr.edu ; Lab: lab 5 ; Lab section: 124 ; TA: Jose R. ;collaboration allowed ;================================================= .orig x3000 LEA R0,PROMPT_THE_USER PUTS JSR INPUT HALT PROMPT_THE_USER .STRINGZ "Insert a binary number\n" .orig x3200 INPUT ST R7,R7_BACKUP_3200 VALIDATION_WRONG GETC OUT LD R3,B NOT R0,R0 ADD R0,R0,#1 ADD R0,R0,R3 BRz CONTINUE LEA R0,ERROR_3200 PUTS BR VALIDATION_WRONG CONTINUE AND R4,R4,#0 LD R5,DEC_16_3200 WHILE AND R2,R2,#0 GETC OUT LD R3,ASCII ADD R0,R0,R3 ADD R2,R2,R0 BRz ZERO_3200 ADD R6,R2,#-1 BRz ONE_3200 ;space LD R2,SPACE_3200 NOT R0,R0 ADD R0,R0,#1 ADD R0,R0,R2 BRz SPACECASE_3200
Open Document