Exercise_2_Questions-F09

Exercise_2_Questions-F09 - CE-320 Microcomputers I Fall B...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CE-320 Microcomputers I Fall B 2009 Exercise 2 Page 1 Do NOT use a calculator on this assignment. You will not be allowed to use one on the test or quizzes. Exercise 2 Questions 1. Convert the following assembly code fragments into machine code using the most efficient addressing mode available (i.e. if possible, use direct instead of extended). Represent your answer as a memory diagram beginning at address $1000. a. LDAB $2000 ADDB #10 STAB $2000 b. LDY #$3000 LDD 0,Y c. LDAA $20 LDAB #20 ABA STAA $21 d. LDAA $2500 CMPA $2501 BGT $50 e. LDD $40 SUBD #1 BEQ -100 f. MOVB #45,$1500 g. MOVB $2000,10,X h. MOVW 5,X,-10,Y 2. Write the assembly code and the machine code to load the specified register with the given address using indexed addressing off of X. Assume that register X already contains $32F0, and use the most efficient offset possible (i.e. don’t use a 9-bit offset if a 5-bit offset can be used). Note that indexed addressing uses a sign and magnitude representation for offsets. a. A, $32F5 b. A, $32E0 c. B, $32D0 d. B, $3255 e. X, $3200 f. D, $32AA g. D, $3353 h. Y, $3361 i. S, $3300 j. S, $3232
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CE-320 Microcomputers I Fall B 2009 Exercise 2 Page 2 3. The strings below represent bytes of machine code. Beginning with the first byte, convert one machine code instruction into assembly code. Note that most, perhaps all, strings will have extra bytes. a.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/12/2009.

Page1 / 5

Exercise_2_Questions-F09 - CE-320 Microcomputers I Fall B...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online