• Welcome to Valhalla Legends Archive.
 

z80 cpu assembly commands

Started by Atom, December 02, 2004, 11:23 AM

Previous topic - Next topic

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.
http://www.zophar.net/tech/files/z80opcod.txt
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!
I am back! aINC is dead, ThinkTank PRO is alive.
VB, JAVA, ASM, C, its all yummy to me.

MyndFyre

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.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

iago

Quote from: Atom on December 02, 2004, 11:23 AM
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!

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 :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Adron

Quote from: Atom on December 02, 2004, 11:23 AM
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!

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 from: Atom on December 02, 2004, 11:23 AM
Why are there 30 opcodes for almost the same mnemonic?

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?

Atom

#4
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.
I am back! aINC is dead, ThinkTank PRO is alive.
VB, JAVA, ASM, C, its all yummy to me.

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.
I am back! aINC is dead, ThinkTank PRO is alive.
VB, JAVA, ASM, C, its all yummy to me.

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.)

Atom

exactly. And i now have to repeat college alg and trig. This project has been dropped.
I am back! aINC is dead, ThinkTank PRO is alive.
VB, JAVA, ASM, C, its all yummy to me.

Darkness

Quote from: Stwong on December 21, 2004, 02:21 PM
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.)

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.

Warrior

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.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

R.a.B.B.i.T

Quote from: iago on December 02, 2004, 12:09 PM
Quote from: Atom on December 02, 2004, 11:23 AM
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!

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 :)
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'.

Darkness

He seriously said that? Because z80 development is more than just calculators. And you can't even prorgram z80 in class <_<

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.

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.

Darkness

That would be good, if it was about z80 Assembly...