ce12_w08_hw5_sol

ce12_w08_hw5_sol - CMPE 12 Winter 2008 Homework 5: Due...

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

View Full Document Right Arrow Icon
CMPE 12 Winter 2008 Name: SOLUTIONS Homework 5: Due February 20 Email: Alex was taking a short break during one of the lab sections when she overheard one of the lab tutors (who will remain unnamed) mutter “What's the deal with these labs? Team Fortress 2 is not that amazing.” This blasphemy will not stand, so Eric quickly made this program: .ORIG x3000 INIT: LEA R0, INPUT LD R3, SEARCH LD R4, SPACE LOOP: ADD R0, R0, #1 LDR R1, R0, #-1 BR DONE NOT R1, R1 LDR R2, R3, #0 ADD R1, R1, R2 BRnp LOOP ERASECHAR: STR R4, R0, #-1 ADD R3, R3, #1 BR LOOP DONE: LEA R0, INPUT PUTS HALT INPUT: .STRINGZ "Team Fortress 2 is not that amazing." SEARCH: .STRINGZ "not" SPACE: .FILL x20 .END The purpose of this program is to correct the given sentence. It does this by searching for a string within a string and replacing it with spaces. This program assembles without errors, but it doesn't work . 1) (15 pts) Eric sent the buggy program to Alec, who spotted three programming errors. To fix them, two lines of code must be altered and one line of code must be added.
Background image of page 1

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

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

Page1 / 2

ce12_w08_hw5_sol - CMPE 12 Winter 2008 Homework 5: Due...

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

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