Docsity

Assembly Quiz Solutions - Prof. Andrew Mason, Quizzes of Electrical and Electronics Engineering

Toggle sidebar
bg1
Quiz๎˜ƒ5๎˜ƒ
๎˜ƒ
1.๎˜ƒWhat๎˜ƒdoes๎˜ƒthe๎˜ƒfollowing๎˜ƒinstruction๎˜ƒdo?๎˜ƒ๎˜ƒBRSET๎˜ƒ๎˜ƒ๎˜ƒ$0,X,$05,GOTIT๎˜ƒ
Branches to GOTIT if the value at <IX> has bits 0 and 2 high ($5=%0000 0101)
2.๎˜ƒWrite๎˜ƒdirectives๎˜ƒto๎˜ƒsave๎˜ƒthe๎˜ƒvalues๎˜ƒ$55๎˜ƒand๎˜ƒ$AA๎˜ƒin๎˜ƒmemory๎˜ƒlocations๎˜ƒ$8010๎˜ƒand๎˜ƒ$8011.๎˜ƒ
ORG $8010
FCB $55,$AA
3.๎˜ƒWrite๎˜ƒa๎˜ƒdirective๎˜ƒthat๎˜ƒsets๎˜ƒthe๎˜ƒvalue๎˜ƒof๎˜ƒHERE๎˜ƒto๎˜ƒ$0D11.๎˜ƒ
HERE EQU $0D11
4.๎˜ƒWrite๎˜ƒa๎˜ƒprogram๎˜ƒto๎˜ƒimplement๎˜ƒthe๎˜ƒfollowing๎˜ƒpseudocode.๎˜ƒ
๎˜ƒevaluate:๎˜ƒZ๎˜ƒ=๎˜ƒ(value๎˜ƒat๎˜ƒDATA)๎˜ƒ+๎˜ƒ$50๎˜ƒ
๎˜ƒif๎˜ƒnegative,๎˜ƒend๎˜ƒ
๎˜ƒotherwise,๎˜ƒstore๎˜ƒZ๎˜ƒto๎˜ƒSAVE๎˜ƒ
LDAA #$50
ADDA $DATA
BMI NEG
STAA $SAVE
NEG END
๎˜ƒ

Partial preview of the text

Download Assembly Quiz Solutions - Prof. Andrew Mason and more Quizzes Electrical and Electronics Engineering in PDF only on Docsity!

Quiz 5

  1. What does the following instruction do? BRSET $0,X,$05,GOTIT Branches to GOTIT if the value at has bits 0 and 2 high ($5=%0000 0101)
  2. Write directives to save the values $55 and $AA in memory locations $8010 and $8011. ORG $ FCB $55,$AA
  3. Write a directive that sets the value of HERE to $0D11. HERE EQU $0D
  4. Write a program to implement the following pseudocode. evaluate: Z = (value at DATA) + $ if negative, end otherwise, store Z to SAVE LDAA #$ ADDA $DATA BMI NEG STAA $SAVE NEG END