13.07.2013 Views

EECE 259 - Lab 5 - Using The Assembler and Debug Monitor.pdf

EECE 259 - Lab 5 - Using The Assembler and Debug Monitor.pdf

EECE 259 - Lab 5 - Using The Assembler and Debug Monitor.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4 digits of your student number are “1257”, then the resulting 16 bit BCD number<br />

should be 0001 0010 0101 0111. You should investigate the 68000 instruction set for<br />

arithmetic shift left operations. Store the resulting 16 bit BCD number as a word in<br />

memory (e.g. where there is some static memory such as at address $00010000).<br />

Question: How many bytes of data will be stored <strong>and</strong> what is the address of each byte<br />

<strong>and</strong> hence what is the address of the next free byte in memory.<br />

Now read the 2 nd 4 digits of your student number <strong>and</strong> convert them into a 2 nd 16 bit<br />

(4 digit BCD number) as above <strong>and</strong> store it somewhere else in memory (do not<br />

overwrite the first data stored at $00010000).<br />

Now, using Switch SW10, add or subtract the 2 nd four digits of your student number,<br />

from the 1 st four digits <strong>and</strong> display the result as a 4 digit number on the HEX display.<br />

That is, the program should run indefinitely, reading SW10 <strong>and</strong> performing addition<br />

or subtraction based on SW10 position (up or down). Investigate the ABCD <strong>and</strong><br />

SBCD instructions in the 68000 instruction set for adding <strong>and</strong> subtracting in BCD.<br />

Store the result in memory. Ignore negative results<br />

When SW11 is moved into the up position, the program should stop <strong>and</strong> return to the<br />

debug monitor using a Trap #15 instruction. Use the debugger to single step <strong>and</strong><br />

debug the program.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!