Andeeh
Andeeh

Reputation: 99

Simple carry bit

Ok so I am revising for a test One of the revision questions is:

If

What are the contents of A and Carry after the following code:

MOV A,R6 
SUBB A,R4 
SUBB A,R5

The correct answer is Carry = 1 and A = D0h

I can work out what the registers are, but I can't get the correct answer for the carry bit. Can anyone help me understand this?

Upvotes: 1

Views: 157

Answers (1)

stark
stark

Reputation: 13189

The first subtract is AB - FE => AD Since FE > AB the carry bit is set

The second subtrract is AD - (DC + 1) => DO Since DD > AD the carry bit is set again.

Upvotes: 1

Related Questions