Valhalla Legends Forums Archive | Assembly Language (any cpu) | z80 cpu assembly commands

AuthorMessageTime
Atom
This isnt actually for programming in assembly at all. I want to write an emulator for this CPU and i have little experience in ASM. DONT SHOOT ME! I know I should have the experience but I figure I would learn the ASM as I go through it.
[url]http://www.zophar.net/tech/files/z80opcod.txt[/url]
Is a good list of opcodes for the cpu and their mnemonics, but I don't know what each does exactly. I am pretty sure I have a pretty good of how everything works with register sand addresses but I don't know what each opcode does.

I am not asking for someone to go through the list of opcodes and and type in what each does, I want some general help. Also a link to a good guide which i imagine is out there seeing as how I have seen some of the same mnemonics for other cpu's.

Why are there 30 opcodes for almost the same mnemonic?

Someone could start off by explaining this statement to me.

LD (BC),A

Im assuming LD is the actual opcode, and BC is a byte and A is an address, but i have no idea!
December 2, 2004, 5:23 PM
Myndfyr
The same site where you got that has some nice things, including a ZIP file with a Word document about fourth from the top:
http://www.zophar.net/tech/z80.html

If you're not familiar with assembly, the reason for having 30 different opcodes varies.  Generally speaking, they are there for different memory addressing modes, or for different register placement.
December 2, 2004, 5:46 PM
iago
[quote author=Atom link=topic=9750.msg90805#msg90805 date=1102008185]
This isnt actually for programming in assembly at all. I want to write an emulator for this CPU and i have little experience in ASM. DONT SHOOT ME! [/quote]

On a sidenote, I was involved in hiring students for the next work term at my job.  Two of them mentioned "z80" assembly on their resumes, which intrigued me.  It's something that stands out, since not many people know about it.

Good job trying to broaden your horizons :)
December 2, 2004, 6:09 PM
Adron
[quote author=Atom link=topic=9750.msg90805#msg90805 date=1102008185]
LD (BC),A

Im assuming LD is the actual opcode, and BC is a byte and A is an address, but i have no idea!
[/quote]

I'll assume it means "*BC = A;" in C-style code. It's probably storing a word, unless A is some special register with non-standard size for the cpu.


[quote author=Atom link=topic=9750.msg90805#msg90805 date=1102008185]
Why are there 30 opcodes for almost the same mnemonic?
[/quote]

That's probably because they're only almost the same? How would the processor know which of the things you wanted it to do if there was no difference in how you told it to do it?
December 2, 2004, 6:54 PM
Atom
Thanks for your help so far guys, I appreciate it.
As I stare at these documents and they bring more meaning, I am perfecting the way I am emulating the memory addresses (low endian).That part is pretty simple.  Thanks.
December 2, 2004, 9:06 PM
Atom
Ok, i found probably the best documentation out there that explains everything to death and the deepest depth. www.z80.info

Thought i would share it if anyone else needs z80 stuff.
December 14, 2004, 4:45 PM
Stwong
BTW iago: knowledge of z80 asm translates into "was a slacker during geometry and programmed TI series calculator" :P

(TI-8*'s and TI-9*'s are z80-based.)
December 21, 2004, 8:21 PM
Atom
exactly. And i now have to repeat college alg and trig. This project has been dropped.
January 11, 2005, 2:23 AM
Darkness
[quote author=Stwong link=topic=9750.msg93145#msg93145 date=1103660463]
BTW iago: knowledge of z80 asm translates into "was a slacker during geometry and programmed TI series calculator" :P

(TI-8*'s and TI-9*'s are z80-based.)
[/quote]

Actually only some of the TI-8*s are z80 based, but the 89 operates on a Motorola 68k cpu. If what you want to do is just test the assembly commands on this CPU, you could always use the emulator of TI calcs.
June 22, 2005, 3:21 AM
Quarantine
Good job responding to someone who revived a 5 month old thread even though they had something useful to add to the topic and there has not been a noticeable pattern of the specific person reviving topics. Thanks for being a wannabe moderator and offering advice that no one wants to hear when you have no common sense.

Thanks.
June 24, 2005, 9:11 AM
R.a.B.B.i.T
[quote author=iago link=topic=9750.msg90808#msg90808 date=1102010948]
[quote author=Atom link=topic=9750.msg90805#msg90805 date=1102008185]
This isnt actually for programming in assembly at all. I want to write an emulator for this CPU and i have little experience in ASM. DONT SHOOT ME! [/quote]

On a sidenote, I was involved in hiring students for the next work term at my job.  Two of them mentioned "z80" assembly on their resumes, which intrigued me.  It's something that stands out, since not many people know about it.

Good job trying to broaden your horizons :)
[/quote]My Computer Science teacher actually said to keep that off all resumes because 'z80 knowlege' means 'I got bored in class and poked around my graphing calculater'.
June 25, 2005, 4:22 PM
Darkness
He seriously said that? Because z80 development is more than just calculators. And you can't even prorgram z80 in class <_<
June 27, 2005, 6:09 AM
R.a.B.B.i.T
Eh...that's what he said.  All of the people who would bother with z80 "take notes" in class with a laptop.
June 27, 2005, 4:19 PM
warz
http://www.insanedev.net/tks/tuts/index.php?dir=&file=win32asm%20tutorial.chm

That's a decent reference I use a lot, although some of his wording make a few instructions seem incorrect.
June 28, 2005, 4:15 PM
Darkness
That would be good, if it was about z80 Assembly...
June 28, 2005, 6:55 PM

Search