Z80 help.

Post new topic   Reply to topic    CPU-World.com forums Forum Index -> Information Requests (Collectible Chips only)
View previous topic :: View next topic  
Author Message
Lobbo1



Joined: 07 Feb 2005
Posts: 5

PostPosted: Wed Feb 23, 2005 6:03 pm    Post subject: Z80 help. Reply with quote

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
Back to top
View user's profile Send private message  
Display posts from previous:   
Post new topic   Reply to topic    CPU-World.com forums Forum Index -> Information Requests (Collectible Chips only) All times are GMT - 5 Hours
Page 1 of 1
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001 phpBB Group