Write LC3 machine code routines for the followings To perfor
Write LC-3 machine code routines for the followings: To perform an NOR on two binary numbers stored in x3100 and x3101 Store the result at x3102. To perform an XOR on two binary numbers stored in x3100 and x3101 Store the result at x3102.
Solution
4)
a)
.ORIGx3100
AND R0,R0,#0
NOT R0,R0
AND R1 R1 #0 R1,R1,#0
ADD R1,R1,#1
NOT R1,R1
NOT R1,R1
NOR R0,R0,R1
HALT
.END
------------------------------------------------------------------------------------------------------------------
4)
b)
.ORIGx3100
AND R0,R0,#0
NOT R0,R0
AND R1 R1 #0 R1,R1,#0
ADD R1,R1,#1
NOT R1,R1
NOT R1,R1
XOR R0,R0,R1
HALT
.END
