GOAL: To write an assembly language program that implements a small 68HC11-monitor program similar to the one used on the Motorola development board and the simulator.
1. Write a subroutine the prints 2 ASCII numbers in HEX format (one byte) to the display using the OUTA subroutine.
2. Write a subroutine the inputs and echo’s to the screen two valid ASCII HEX format characters from the keyboard using the INCHAR subroutine.
3. Write a subroutine that calls the subroutine in step 1 twice to output 4 ASCII numbers in HEX format.
4. Write a subroutine that calls the subroutine in step 2 twice to input 4 valid ASCII HEX format numbers.
5. Write a subroutine that calls the subroutine in step 4 twice to input two sets of 4 valid HEX format numbers separated by a space (i.e. XXXX YYYY).
6. Write a subroutine to print a carriage return and a line feed.
7. Write a subroutine that fills memory with ASCII characters starting at address XXXX.
Command Format: F XXXX <CR>
This is a test
8. Write a subroutine that executes code at the location XXXX. You will need to load the registers before starting to execute the code at XXXX. Hint: JMP 0, X
Command Format: G XXXX
9. Write a subroutine that modifies memory at address XXXX.
Command Format: M XXXX QQ D
Where QQ is the HEX number to be stored in location XXXX
Where QQ is a ASCII value enclosed in quotes
Where D is the ASCII input of space it waits for additional input
Where D is the ASCII input of <CR> it ends data input.
M 3000 EF 12 45 'A'<CR>
Puts data in 3000 as EF, 3001 as 12, 3002 as 45 and 3003 as 41
10. Write a subroutine that displays and modifies the registers. These register values are values that are stored in memory locations defined as A FCB, B FCB, Y FDB, X FDB, PC FDB, SP FDB and FLAGE FCB. They are loaded into the registers on execution of the G command given in Step 9.
Command Format: R<CR>
A =WW, B=EE, X=TTTT, Y=GGGG, SP=XXXX, PC=XXXX, FLAGS=BB
11. Write a subroutine that changes the registers stored in the locations as defined Step 10.
R A XX<CR> fills the A accumulator with XX
R B XX<CR> files the B accumulator with XX
F XX<CR> files the flag register with XX
X AAAA<CR> fills the X index register with AAAA
Y AAAA<CR> fills the Y index register with AAAA
S AAAA<CR> fills the stack pointer with AAAA
P AAAA<CR> fills the program counter with AAAA
12. Write a subroutine to display memory as a 2-digit HEX number and an ASCII character between the values of ($21 to $7E) from addresses XXXX to YYYY. You should display 16 bytes per line.
D 0100 0112
0100 31 32 33 30 41 00 FE 00 02 03 04 05 39 41 42 43 1 2 3 0 A . . . . . . . 9 A B C
0110 41 ED 42
(ASCII and HEX values on the same line of the display)
13. Write a function that performs a disassembly of the code at address XXXX to YYYY
U XXXX YYYY
Where XXXX is the starting address and YYYY is the ending address. You will need a table of 255 elements one for the opcode, the type of addressing, and the number of bytes the instruction uses in memory.
Direct STAA $10
Extended STAA $1000
Indexed STAA 0, X
LDAA 1, X
14. Write a subroutine that sets a breakpoint at address XXXX. This command lets a user run a program up to the breakpoint address. It then displays the contents of the registers once the breakpoint occurs. If a breakpoint has been already set it clears the old one and set it to the new address. You will need to use the SWI instruction for this operation. The SWI instruction vector is at address $FFF6 and $FFF7
15. Write a subroutine that clears the breakpoint. It resets the user program back to its original condition.
16. Write a subroutine that performs a branch address calculation. It displays the address that a branch instruction will jump to given W the offset and the address the branch is located at.
Q XXXX WW RRRR
Where XXXX is the 16 bit hex address of the branch instruction, WW is the 8 bit hex offset, and RRRR is the 16 bit hex result.
17. Combine all of the commands together into one main program that looks for an input command and executes appropriate subroutines Step 7 – Step 16.
5 freelancers are bidding on average $223 for this job
hi, i have worked on varied processors including microcontrollers,DSP(TI & Motorola),[url removed, login to view] in assembly for all the above processors. awaiting your reply. Thanx 'n' Regards