Author Topic: List of Bytes/Time each command takes?  (Read 3353 times)

0 Members and 1 Guest are viewing this topic.

Offline Jerros

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 137
  • Rating: +9/-0
    • View Profile
List of Bytes/Time each command takes?
« on: July 02, 2011, 08:45:47 am »
Is there any list stating all .z80 ASM commands with the number of T-cycles and Bytes they take? Or actually just the latter, since there are sites giving the number of T-cycles already, but no luck on finding the bytes per command yet... This would really help making speed/lenth decisions.
Thank you!


79% of all statistics are made up randomly.

Offline JosJuice

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1344
  • Rating: +66/-14
    • View Profile
Re: List of Bytes/Time each command takes?
« Reply #1 on: July 02, 2011, 09:02:50 am »
I remember seeing a .txt file with that information somewhere, but I can't remember where it was... It might've been on WikiTI, or brandonw.net.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: List of Bytes/Time each command takes?
« Reply #2 on: July 02, 2011, 09:22:35 am »
Oh, boy jerros, these are so many.

1. There is zilog's official documentation. It's drawn out over the course of a pdf, but it's really in depth.
2. Learn asm in 28 days has a set of pages containing almost all of the instructions. (It is missing a few like jp (hl))
3. There's this cool table. (Although it doesn't have t-states and the bytes take some figuring.
4. WikiTi has a page on the matter.

So there are four. Of those four, I personally use 2, and if I want to be absolutely sure of something, I use 1. Option 4 is probably the best "table," but it could use some color.

Edit:
    I never realized how in depth zilog's manual is. They give an example of each instruction.
« Last Edit: July 02, 2011, 09:27:08 am by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: List of Bytes/Time each command takes?
« Reply #3 on: July 02, 2011, 09:40:49 am »
You can use this page, too. On the left you can see the bytes, and cycles are there under the heading "T". However it doesn't seem to have the number of cycles for most of the undocumented commands.
There's something about Tuesday...


Pushpins 'n' stuff...


Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: List of Bytes/Time each command takes?
« Reply #4 on: July 02, 2011, 05:33:04 pm »
http://clrhome.org/table/ (hover for size, time, and flags)[/ad]

I use 28 Days's instruction set all the time for more detailed stuff.
« Last Edit: August 13, 2012, 01:14:28 pm by Deep Thought »




Offline Jerros

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 137
  • Rating: +9/-0
    • View Profile
Re: List of Bytes/Time each command takes?
« Reply #5 on: July 03, 2011, 04:01:47 am »
http://clrhome.co.cc/resources/table/ (hover for size, time, and flags)[/ad]
This is what I was looking for, thanks! I've found all those other tables before too, though didn't knew how to figure the 'size' of the commands out of all those numbers... But that link you provded, Deep Thought, directly states so, so thank you! This'll certainly help somewhat.

EDIT:
Oh, just one more... the size/time of a Label? :)
« Last Edit: July 03, 2011, 04:43:25 am by Jerros »


79% of all statistics are made up randomly.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: List of Bytes/Time each command takes?
« Reply #6 on: July 03, 2011, 05:54:16 am »
A label is just a nice reference point for other instructions to refer to. It's just a number, and it's not any code at all.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Jerros

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 137
  • Rating: +9/-0
    • View Profile
Re: List of Bytes/Time each command takes?
« Reply #7 on: July 03, 2011, 08:22:42 am »
A label is just a nice reference point for other instructions to refer to. It's just a number, and it's not any code at all.
But they have to take up space... right? Ahh well, s'pose I have all the info now, thanks.


79% of all statistics are made up randomly.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: List of Bytes/Time each command takes?
« Reply #8 on: July 03, 2011, 03:18:57 pm »
A label is just a nice reference point for other instructions to refer to. It's just a number, and it's not any code at all.
But they have to take up space... right? Ahh well, s'pose I have all the info now, thanks.

Nope, it's more like a bookmark for the assembler to keep track of. It doesn't affect the size of the compiled program at all -- try it!

How it works is this: As you know, each byte of memory on the calculator has an address (between $0000 and $FFFF, where everything $8000 and above is usually RAM). This includes every byte of the program, which gets moved to $9D95 whenever it gets executed. (In other words, while a program is running, the first byte is at address $9D95, the second byte at $9D96, and so on.)

So when you create a label, all it's doing is giving a name to the address of the instruction immediately following it. Something like

Code: (Z80 assembly) [Select]
.org $9D95 - 2
.db $BB,$6D
    LD HL,0    ; This instruction starts at $9D95 and is three bytes long
Label:
    LD DE,Label    ; This instruction starts at $9D98 and is three bytes long

is entirely equivalent to

Code: (Z80 assembly) [Select]
.org $9D95 - 2
.db $BB,$6D
    LD HL,0    ; This instruction starts at $9D95 and is three bytes long
Label .EQU $9D98
    LD DE,Label    ; This instruction starts at $9D98 and is three bytes long

and both are exactly the same as

Code: (Z80 assembly) [Select]
.org $9D95 - 2
.db $BB,$6D
    LD HL,0    ; This instruction starts at $9D95 and is three bytes long
    LD DE,$    ; This instruction starts at $9D98 and is three bytes long

and even

Code: (Z80 assembly) [Select]
.org $9D95 - 2
.db $BB,$6D
    LD HL,0    ; This instruction starts at $9D95 and is three bytes long
    LD DE,$9D98    ; This instruction starts at $9D98 and is three bytes long

Hope that clears things up :)