Question

1. How many bytes are allocated in total for the variables (va vb, ve, vd, and ve)? 2. For cach of the instructions highlighted (boldface), derive the effective address of the memory variable (source) if any mmory variable is involved, and the contents of the register a or d (whichever one involved) right after the instruction is executed. Answer in hexadeci Asset all bytes in the variables va, vb and vc are inally zero. RAMStart EQU S0800 ROMStart EQU $4000 ORG DS.B DS.B DS.W DC.B $01,$10,SAF,1 DC.W $01,$10,$800,$806, 1,234 RAMStart ve vo ORG ROMStart #$12 #5802 $802 idd idd Idaa ldaa ldx $810 #101 daa daa ldab ldaa ldx ldaa $14,x Idd daa #2 b.x 5802 #22

Thanks for the help

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

Answer :- 1) The number of bytes allocated can be known by using the letter 'W' or 'B' just after DS in the declaration of the variable. W means word and one word = 2 bytes. B means a single byte.

So, va has a sigle byte.
vb has 5 bytes.
vc has (2x4) = 8 bytes.
vd has (1x4) = 4 bytes.
ve has (2x6) = 12 bytes.

Answer :- 2) The content of register has been written in comment in the figure below-

2. For cach of the instructions highlighted (boldface), derive the effective address of the memory variable (source) if any mmory variable is involved, and the contents of the register a or d (whichever one involved) right after the instruction is executed. Answer in hexadecl. Assume that all bytes in the variables va, vb and vc are initially zero. ORG Idaa idd Idd ROMStart #812 #$802 $802 D value at memory $802 ;A = $12 $802 ;D :A = value in va = 0 ;A = value at location $810 10 #vd ldx ldaa 0.5 ;A = value at location which is kept in register x daa ldaa2,+x first x-x+1, then A-value at location(x+2) 3.x ;A = value at location (x+3) aaLxA-value at location(x+1) then x-x-1 ldab ldaa ldx Idaa idd #2 b.x A-value at location (x+b), note b -2 #8802 l$14M ;x=$802, add $14 gives $816. Get value at $816, let it #22 be z. Now find the value stored at this address z and ldaa [d.x keep this value in A. first find the value at (d+x), let it be z. Now assuming z as an address find the value at z, keep this value in A.

2. For cach of the instructions highlighted (boldface), derive the effective address of the memory variable (source) if any mmory variable is involved, and the contents of the register a or d (whichever one involved) right after the instruction is executed. Answer in hexadecl. Assume that all bytes in the variables va, vb and vc are initially zero. ORG Idaa idd Idd ROMStart #812 #$802 $802 D value at memory $802 ;A = $12 $802 ;D :A = value in va = 0 ;A = value at location $810 10 #vd ldx ldaa 0.5 ;A = value at location which is kept in register x daa ldaa2,+x first x-x+1, then A-value at location(x+2) 3.x ;A = value at location (x+3) aaLxA-value at location(x+1) then x-x-1 ldab ldaa ldx Idaa idd #2 b.x A-value at location (x+b), note b -2 #8802 l$14M ;x=$802, add $14 gives $816. Get value at $816, let it #22 be z. Now find the value stored at this address z and ldaa [d.x keep this value in A. first find the value at (d+x), let it be z. Now assuming z as an address find the value at z, keep this value in A.

Add a comment
Know the answer?
Add Answer to:
Thanks for the help 1. How many bytes are allocated in total for the variables (va...
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
  • 1. How many bytes are allocated in total for the variables (va, vb, vc, vd, and...

    1. How many bytes are allocated in total for the variables (va, vb, vc, vd, and ve)? 2. For each of the instructions highlighted (boldface), derive the effective address of the memory variable (source) if any memory variable is involved, and the contents of the register a or d (whichever one involved) right after the instruction is executed. Answer in hexadecimal. Assume that all bytes in the variables va, vb and vc are initially zero. $0800 RAMStart EQU EQU ROMStart...

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