1,207 views
1 votes
1 votes

I am getting 37.

1 Answer

1 votes
1 votes

It should be 18 .

Zero Flag (Z) – After any arithmetical or logical operation if the result is 0 (00)H, the zero flag becomes set i.e. 1, otherwise it becomes reset i.e. 0.

(23) base 8 = 19 in dec​​​​​​imal 

Add R1 + R2 = 19

DCR R2 = 19 -1 = 18 

Now it enters into the loop . 

As 18 != 0 again execution goes to ADD R2, R1 ( R1 = 0 , R2 = 18 )

so after execution R2 = 17  and again enter into the loop . like it will continue until it will not 0  

Related questions

3 votes
3 votes
1 answer
3
Greepes asked Sep 19, 2023
237 views
A CPU has instructions 12 bits long. The size of an address field is 4 bits. It is possible to have: 14 commands of two addresses 29 commands of an address 48 zero-addres...