Author Topic: Opcodes that should have been incorporated into the Z80 processor  (Read 15378 times)

0 Members and 1 Guest are viewing this topic.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
If too many opcodes are put into a processor, it becomes expensive.  But sometimes there are commands that we Z80 programmers use so often, we wonder why they don't exist in the Z80 hardware by default...we wonder why we have to code the routines ourselves. 

What are some that you wish the Z80 had?  Keep it simple--if time changes and the z80 becomes what we want it to be, we don't want it to be expensive ;D

For me:  add hl, a     sub hl, a     cp hl, reg16

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #1 on: March 13, 2012, 08:42:13 pm »
eZ80 has pretty much everything I'd want. LD HL,(HL) ftw
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #2 on: March 13, 2012, 08:52:38 pm »
mul reg16

EDIT: I don't think this is too high-end/expensive for Zilog to have added, I'm pretty sure the eZ80 had it.
« Last Edit: March 13, 2012, 08:59:17 pm by Runer112 »

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #3 on: March 13, 2012, 09:10:58 pm »
Sure would be darn expensive in the 1980s :P
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #4 on: March 13, 2012, 09:46:45 pm »
How about add hl,(**)? I would use that in cases where, say, HL is the offset into a buffer and the location of the buffer is at **. Or an instruction I just invented off the top of my head:

asjnc *

It performs add a,c \ sub b and does a relative jump if it did not go below zero. That might be useful, especially for line drawing and circle drawing and whatnot. I think it would be 16 cycles using the current processor.

Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #5 on: March 26, 2012, 02:47:11 am »
It would be nice if there were IX' and IY'. 

LD (REG 16),REG 16 and LD (REG 16),REG 16 would be extremely useful as well.

I wonder how the computer world would be if Zilog made the eZ80 immediately after the z80.  Nobody would have to deal with the 8086's yucky segment registers.  The world would be a better place.  :P
« Last Edit: March 26, 2012, 02:49:23 am by ralphdspam »
ld a, 0
ld a, a

Offline C0deH4cker

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 258
  • Rating: +11/-1
    • View Profile
    • iNinjas Forum/Repo
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #6 on: March 26, 2012, 04:48:27 pm »
It would be nice if there were IX' and IY'. 

LD (REG 16),REG 16 and LD (REG 16),REG 16 would be extremely useful as well.

Lol, those are the same.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #7 on: March 26, 2012, 05:31:20 pm »
Sure would be darn expensive in the 1980s :P
I bet TI today would use the z80 power as excuse to the $100-130 price tags on their 83+ <_<
« Last Edit: March 26, 2012, 05:31:28 pm by DJ_O »

Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #8 on: April 02, 2012, 09:00:37 pm »
It would be nice if there were IX' and IY'. 

LD (REG 16),REG 16 and LD (REG 16),REG 16 would be extremely useful as well.

Lol, those are the same.
Yeah, I meant LD (Reg 16),Reg 16 and LD Reg 16,(Reg 16).  :P
ld a, 0
ld a, a

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #9 on: June 18, 2012, 08:34:44 am »
eZ80 has pretty much everything I'd want. LD HL,(HL) ftw
A little bump, but ld hl,(hl) would have been great.

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: Opcodes that should have been incorporated into the Z80 processor
« Reply #10 on: June 18, 2012, 06:37:50 pm »
eZ80 has pretty much everything I'd want. LD HL,(HL) ftw
A little bump, but ld hl,(hl) would have been great.

Oh, ho, ho, let's not forget bcall(_ldHlInd). At three bytes, it's only one byte bigger than ld hl,(hl) would be :D
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 chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #11 on: June 19, 2012, 12:21:11 am »
...and just as quick ;)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #12 on: June 19, 2012, 07:45:39 am »
eZ80 has pretty much everything I'd want. LD HL,(HL) ftw
A little bump, but ld hl,(hl) would have been great.

Oh, ho, ho, let's not forget bcall(_ldHlInd). At three bytes, it's only one byte bigger than ld hl,(hl) would be :D
But does it blend?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #13 on: June 19, 2012, 11:48:10 am »
I was looking through some old code of mine today and found "getHL()" all over the place. Btw, what is the ez80? It sounds pretty cool, what devices use it? :D

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Opcodes that should have been incorporated into the Z80 processor
« Reply #14 on: June 20, 2012, 04:08:47 am »
No idea what devices use it, but it's essentially an updated Z80 that has (at least some,not sure how much) backwards compatibility. It was being discussed here because there were a couple of hobbyist projects going on attempting to build a "dream" graphing calculator. That was one of the chips being discussed, and largely for backwards compatibility with TI's stuff IIRC. Ease of transition was also a plus, as many current Z80 programmers would be (largely) familiar with it due to the similarities.
« Last Edit: June 20, 2012, 04:09:40 am by Art_of_camelot »