Question: Complete the following program that only adds integers that are even negatives. The program considers the NON - ZERO integers at labels N 1 ,

Complete the following program that only adds integers that are even negatives. The program considers the NON-ZERO integers at labels N1, N2, and N3 and stores the sum of the appropriate integers in the memory at label SUM. It uses a subroutine at label CHKN to check each integer.
.ORIG x3000
LD R0, N1
[ Select ]
L1 ADD R1, R0, #0
LD R0, N2
LEA R6, CHKN
[ Select ]
JMP R6
L2 ADD R1, R1, R0
LD R0, N3
[ Select ]
L3 ADD R1, R1, R0
ST R1, SUM
HALT
CHKN ADD R4, R0, #0 ; move in to R4 for testing
[ Select ]
AND R4, R4, x0001 ; right most bit is always 1 if odd
[ Select ]
WRONG AND R0, R0, #0 ; zero out wrong values
RETURN RET
N1.FILL ; value not shown
N2.FILL ; value not shown
N3.FILL ; value not shown
SUM .FILL #0
.END

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!