{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

PS04-soln - ECE 109 Spring 2010 Name Section Problem...

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

View Full Document Right Arrow Icon
ECE 109 Spring 2010 Name:__________________________________________ Section:______________________ Mar 1-4, 2010 1 Problem Session 4 1. Warm-ups (20 pts 5 pts each): Write a sequence of LC-3 instructions in binary to perform each task. Assume that EACH INSTRUCTION sequence begins at memory location x3000 . (NOTE: Each task is independent do not rely on the results of one task to perform the next.) (a) Load the value from memory location x2FF0 into register R2. 0010 010 111101111 ; LD R2, offset=xFFEF (x2FF0 x3001) (b) Store the value in R3 to memory location x30A0. 0011 011 010011111 ; ST R3, offset=x009F (x30A0 x3001) (c) Store the value 12 into memory location x302F. 0101 000 000 1 00000 ; R0 <- 0 0001 000 000 1 01100 ; R0 <- R0 + 12 0011 000 000101100 ; ST R0, offset=x002C (x302F x3003) (d) Clear the low-order four bits of memory location x2FFF. (In other words, set bits 3:0 to zero. Leave all other bits unchanged.) 0010 000 111111110 ; LD R0, offset=xFFFE (x2FFF x3001) 0101 000 000 1 10000 ; AND R0, R0, xFFF0 0011 000 111111100 ; ST R0, offset=xFFFC (x2FFF x3003)
Background image of page 1

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

View Full Document Right Arrow Icon
ECE 109 Spring 2010 Name:__________________________________________ Section:______________________ Mar 1-4, 2010 2 For each remaining problem, (1) draw a flowchart , and (2) write a sequence of LC-3 instructions. End
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.

{[ snackBarMessage ]}