Lobbo1
Joined: 07 Feb 2005 Posts: 5
|
Posted: Wed Feb 23, 2005 6:03 pm Post subject: Z80 help. |
|
|
Hi,
I have the following two instructions codes (code A & code B) for the Z80 processor.
For code A I need the detailed actions of the microprocessor (example).
For code B I need to show in some way how contents of registers/memory locations changed as the program was executed.
CODE A:(Swaps contents of memory location 2100 with 2101)
2000 | 2A 00 21 | LD HL,($2100) | Load contents of memory loc. 2100 and 2101 | to HL reg.
2003 | 7D | LD A,L | Copy value of L reg. to A reg.
2004 | 6C | LD L,H | Copy value of H reg. to L reg.
2005 | 67 | LD H,A | Copy value of A reg. to H reg.
2006 | 22 00 21 | LD ($2100),HL | Store swapped H and L back to memory
CODE B:(Adds two 16bit numbers from memory and stores result in memory)
2000 | 2A 00 21 | LD HL,($2100) | Load contents of memory loc. 2100 and 2101 to HL reg.
2003 | EB | EX DE,HL | Exchange HL with DE (fast copy of HL to DE)
2004 | 2A 02 21 | LD HL,($2102) | Load contents of memory loc. 2102 and 2103 to HL reg.
2007 | 19 | ADD HL,DE | Add HL with DE, result in HL
2008 | 22 04 21 | LD ($2104),HL | Store HL to memory loc. 2104 and 2105
If anyone is familiar with the board and could shed some light on either of the problems I would be most grateful!
Many Thanks,
Rob |
|