Difference between revisions of "CSC270 Homework 7 2012"
(Created page with "--~~~~ ---- <bluebox> This homework assignment is due on 4/4/12, at 1:00 p.m. You may work on this lab in teams of at most 2 people. </bluebox> =Problem #1= Using the same ...") |
|||
Line 6: | Line 6: | ||
This homework assignment is due on 4/4/12, at 1:00 p.m. You may work on this lab in teams of at most 2 people. | This homework assignment is due on 4/4/12, at 1:00 p.m. You may work on this lab in teams of at most 2 people. | ||
</bluebox> | </bluebox> | ||
+ | |||
=Problem #1= | =Problem #1= | ||
+ | |||
+ | Disassemble the code you used to display your message. This requires looking up the op-codes and figuring out what instructions they correspond to, and write the whole program using mnemonics. | ||
+ | |||
+ | The reverse table found [http://home.earthlink.net/~tdickens/68hc11/68hc11_opcode_map.html here] will help you do the reverse engineering. | ||
+ | |||
+ | =Problem #2= | ||
Using the same idea as the "Hacking" problem in the last [[CSC270 Lab 7 2012|lab]] (putting your name into the display of the kit), pick a message that you want to display, and ''hack'' the code you used in the lab to make it display your code. | Using the same idea as the "Hacking" problem in the last [[CSC270 Lab 7 2012|lab]] (putting your name into the display of the kit), pick a message that you want to display, and ''hack'' the code you used in the lab to make it display your code. | ||
Take a picture (or several pictures) of the display showing your message and include it/them with your answer | Take a picture (or several pictures) of the display showing your message and include it/them with your answer | ||
− | =Problem #2= | + | =Problem #3= |
+ | |||
+ | * Write a program in 6800 Assembly Language that computes the quantity | ||
+ | |||
+ | Y = 3 * ( a + b ) - ( c - 2 )<code><pre> | ||
+ | |||
+ | <source lang="asm"> | ||
+ | ORG 0000 ; specifies starting address 0000 | ||
+ | |||
+ | LDAA 10 ; get Mem[0000] in ACCA (direct addressing) | ||
+ | LDAB 11 ; get Mem[0001] in ACCB | ||
+ | ABA ; ACCA <- ACCA + ACCB | ||
+ | STAA 12 ; Mem[0002] <- ACCA | ||
+ | |||
+ | ORG 0010 ; specifies starting address 0 | ||
+ | |||
+ | a DB 2 ; 2 is stored at 0010 | ||
+ | b DB 3 ; 3 is stored at 0011 | ||
+ | result DB ? ; | ||
+ | </source> | ||
+ | |||
+ | </pre></code> | ||
− | + | :where ''Y'', ''a'', ''b'', and ''c'' are byte variables. | |
− | + | * Assemble your code by hand. | |
+ | * Write the listing of your code in a format similar to the example below: | ||
Revision as of 12:52, 28 March 2012
--D. Thiebaut 13:43, 28 March 2012 (EDT)
This homework assignment is due on 4/4/12, at 1:00 p.m. You may work on this lab in teams of at most 2 people.
Problem #1
Disassemble the code you used to display your message. This requires looking up the op-codes and figuring out what instructions they correspond to, and write the whole program using mnemonics.
The reverse table found here will help you do the reverse engineering.
Problem #2
Using the same idea as the "Hacking" problem in the last lab (putting your name into the display of the kit), pick a message that you want to display, and hack the code you used in the lab to make it display your code.
Take a picture (or several pictures) of the display showing your message and include it/them with your answer
Problem #3
- Write a program in 6800 Assembly Language that computes the quantity
<source lang="asm">
ORG 0000 ; specifies starting address 0000
LDAA 10 ; get Mem[0000] in ACCA (direct addressing)
LDAB 11 ; get Mem[0001] in ACCB
ABA ; ACCA <- ACCA + ACCB
STAA 12 ; Mem[0002] <- ACCA
ORG 0010 ; specifies starting address 0
a DB 2 ; 2 is stored at 0010
b DB 3 ; 3 is stored at 0011
result DB ? ;
</source>
- where Y, a, b, and c are byte variables.
- Assemble your code by hand.
- Write the listing of your code in a format similar to the example below: