MidtermSolutionAu08

MidtermSolutionAu08 - 1 0.Name_i/lé_%é_ Midterm ECE 265...

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

View Full Document Right Arrow Icon
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 0.Name_i/lé_%é_ Midterm ECE 265 Au 08 Prof Klein 0 pen processor handout. l. (8) Hand assemble and fill in symbol table. Hex equ $10 Org $30 Go nop Nop Nop Nop xx Bra Go Org $fffe de Go 2. (6) Hand assemble Org $20 Ldaa #data de data Org $50 Data fdb 3,4,5 3. (6) Suppose this code executes. What are the final values in Y and ? Lds #SFF Ldaa #5 Ldy #51234 IE Psha F F gull); Y B i puIY 4. (6) Using the terminology of 68HCll branch instruction, is a) $FF higher than 1? Va; 266M b) $FF greater than I? NQ ,\ Li 5. (6)Write a short piece of code that branches to EVEN if register A is even and ODD if register A is odd. Don’t destroy A. BiT‘A M B E Q EVEN @RH ODD 6. (5)Write a short piece of code to do the l’s complement of the 4 msb’s of B without changing any of the other bits of B. [0% #%llllOOOO 7. (8) Recall that our E clock runs at 0.5 [.15 per clock cycle. Calculate how long this code takes to run. Show the number of cycles per instruction. 3 FFFC:’Ll£ Loop aba 34 {72+ glfi): Aba 21 Inx L :g+qO;Ll3 8. (6) Show the final value in A. de #$FFFC Org $20 de #data Ldaa 4.x A 5L Loop bra loop Org $50 Data fcb 7,8,9,l 3,4,5 ’0 a a 3 .n . O/x bx 9. (6) Show the final values in X. Or $20 Ldi data X Loop bra loop Org $50 Data fcb 9,1,2,3,4,5 10. (6) Suppose that A holds $FF and B holds $3 .Suppose that the CC’s start with all l’s. Then the code below is executed. Q3 What is the final value ofA and the CC’s? G) I ‘ i i i t i ABA (F H l l I l l l 03 l 0000 00! l NZ c W: A H v é l__Q_Qg_L l l. (6) What is the value of B and C at the end of the execution of this code 13: Ill] OOWQ Asrb 3 £8 C l flsrb a m 1000 [2. 10. Suppose that Aholds $FF andB holds $3 ,Suppose that the CC’s start with all l‘s. Then the code below is executed. l '\ ‘l i l‘ i i (' l .- 3: What is the final value ofA and the CC’s? F F + ’ t K | l ‘0 l SBA ‘3 C. : 2 W 3 Hit Hooch A H N Z V C (:31 ‘ , lat—C _l _L Q Q 1L 5mm dde 93 Camp C no???“ 13. (6) Look at this code: Assume SP starts with $FF. While the code executes the infinite loop, fill in the memory table and let me know the value of SP. Org $20 10 start Jsr suba{:$\ final Spfl Loop bra loopfia 3 Suba rts l4. (6) After this code runs, what is the final value in B and C. clc B ; I l 0000 LDAB #$F0 mpb O“ i 1 000 O Rorb 1 Sec 0 Rolb C Q F0“? llll OOOI — l5. (6) Write a short piece of co e to put the byte value $l5 in memory location $2025. LDAA a 15 sTAA Masts l6. (6) Write a short piece of code to clear the N bit with changing any other CC’s. TPA TAP AN DA H?» F 7 /5 l7. (3) Does a program run as r if you use the X index register instead of the Y index register? Why or why not? \/€,5/ bum/bf, y [ndfx Moéfi3 Mavc a which Mules ’llw, lflfilrudlm \oncer lo reach ...
View Full Document

Page1 / 3

MidtermSolutionAu08 - 1 0.Name_i/lé_%é_ Midterm ECE 265...

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