Question

DO 2 AND 3.

Question #1 Convert the following assembly program into machine code. LDAA WSA1 STAA $1000 INCA LDAB $1000 DECB ABA Here: Bra

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Q2 (a)

After LDA #$A1

# indicates immediate transfer

$ indicates data i.e A1 is in hexadecimal

In this step, hexadecimal A1i.e 161 in decimal is loaded in A

     A=A1, B = NA, N=0, Z=0, C=0,V=0

After STAA $1000

In this step, value stored in A i.e A1 is stored at location 1000

      A=A1, B = NA, N=0, Z=0, C=0,V=0

After INCA

In this step, value stored in A is incremented by 1

    A=A2, B = NA, N=0, Z=0, C=0,V=0

After LDAB #$1000

In this step, hexadecimal 1000 i.e 4096 in decimal is loaded in B

     A=A2, B = 1000, N=0, Z=0, C=0,V=0

After DECB

In this step, value stored in B is incremented by 1

    A=A2, B = 1001, N=0, Z=0, C=0,V=0

After ABA

In this step, value of A and B registers are added and the result is stored in A

    A=10A3, B = 1001, N=0, Z=0, C=0,V=0

After STAA $111111

In this step, value stored in A i.e 10A3 is stored at location 111111

A=10A3, B = 1001, N=0, Z=0, C=0,V=0

Q2(b)

answers can be easily verified by code warriors also

According to HomeworkLib policy, we are only supposed to answer one question per window

Add a comment
Know the answer?
Add Answer to:
DO 2 AND 3. Question #1 Convert the following assembly program into machine code. LDAA WSA1 STAA $1000 INCA LDAB $10...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT