Indeed. The Z80 was released in 1976 or thereabouts.
What was the SLL instruction supposed to do?
- Ast A. Moore
- Rick Dangerous
- Posts: 2640
- Joined: Mon Nov 13, 2017 3:16 pm
Re: What was the SLL instruction supposed to do?
Every man should plant a tree, build a house, and write a ZX Spectrum game.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Re: What was the SLL instruction supposed to do?
Yeah, I knew that. It's just that the undocumented instructions didn't seem to be widespread on the Spectrum until years later, and there weren't many articles about them early on, so early discoveries like this must have just been 'forgotten' and had to be rediscovered for a new generation of programmers when the Spectrum came along. It's possible that the Z80 was mainly being used for embedded systems in its early days, so using these undocumented instructions could have been seen as a safety risk if future versions of the chip failed to support them.
- Ast A. Moore
- Rick Dangerous
- Posts: 2640
- Joined: Mon Nov 13, 2017 3:16 pm
Re: What was the SLL instruction supposed to do?
True. Although I seem to remember bumping into quite a few of them while disassembling some early Spectrum titles. Granted, SLL is not nearly as widespread as some others.
Every man should plant a tree, build a house, and write a ZX Spectrum game.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
Re: What was the SLL instruction supposed to do?
I read in a book somewhere, don't remember exactly where, that the first Z80 chips that were commercially available, didn't have a reliable SLL, and hence the reason, for Z80 not to document it.
How true this is, is up for grabs.
How true this is, is up for grabs.
Re: What was the SLL instruction supposed to do?
Note the Editors note on that page:djnzx48 wrote: ↑Wed May 09, 2018 7:27 am ... And here's the July 1981 article that it refers to, which instead of SLL, uses the bizarre notation DUPINC. How about incorporating that into modern assemblers?
Taking into account that Zilog licensed the z80 core to several manufacturers and that there were several non official copies, these opcodes are likely not to work or work differently in Z80 from other manufacturers.These OpCodes are not tested during production of the Z80 chip by Zilog.
It is possible, in a small number of cases, that any of these opcodes may not work.
Re: What was the SLL instruction supposed to do?
But if the presence of SLL was merely an implementation detail that wasn't meant to occur in the first place, then what would be the point of testing it?
Re: What was the SLL instruction supposed to do?
A CPU is basically a state machine, that given a set of inputs generates some output and changes internal state.
When the documented instructions, do not cover all possible combinations, the curious human mind, will need to find out, what happens in the other cases
And the search for undocumented opcodes is born.
Most of these were probably meant as instructions, but some are just a side effect of how the state machine was built.
A good example are the prefixes, which were added, to increase the functionality, for example by swamping the HL register by IX or iY, among other possible examples. So changing just one of the referenced registers in an operation, provides a complete new set of instructions.
Some examples, are redundant, like "SLA A" and "ADD A, A".
On some systems/CPUs, the shift operation doesn't even exist, because it can be implemented with an ADD.
And for better or for worse, the add is more efficient (4T) than shift (6T).
But ADD only works with A register, where Shift works with any of the 8 bit registers.
When the documented instructions, do not cover all possible combinations, the curious human mind, will need to find out, what happens in the other cases
And the search for undocumented opcodes is born.
Most of these were probably meant as instructions, but some are just a side effect of how the state machine was built.
A good example are the prefixes, which were added, to increase the functionality, for example by swamping the HL register by IX or iY, among other possible examples. So changing just one of the referenced registers in an operation, provides a complete new set of instructions.
Some examples, are redundant, like "SLA A" and "ADD A, A".
On some systems/CPUs, the shift operation doesn't even exist, because it can be implemented with an ADD.
And for better or for worse, the add is more efficient (4T) than shift (6T).
But ADD only works with A register, where Shift works with any of the 8 bit registers.
Re: What was the SLL instruction supposed to do?
This is where FPGA projects tend to win big is you get all the undocumented features 'free' as everything from the gate logic level is implemented. As long as you exactly replicate what is on the die, you don't need to 'know' what is going on and implement it like with an emulator.
FPGA's are getting cheaper every year, when it hits the widget sweet spot I figure 8-bit fpga widgets are going to appear like roaches flooding the market It will be awesome.
FPGA's are getting cheaper every year, when it hits the widget sweet spot I figure 8-bit fpga widgets are going to appear like roaches flooding the market It will be awesome.
Re: What was the SLL instruction supposed to do?
Except not really, because most FPGA cores model chip behaviour, not structure.
The T80 as used in the Next and Uno ZX core mimics behaviour. The A-Z80 as used in the Uno CPC core is derived from decapping and photographing, and mimics structure. But it takes up a lot more FPGA resources than the T80 does.
https://opencores.org/project/t80
https://opencores.org/project/a-z80
We will get there in a few more years, as entry-level FPGAs get bigger and more sophisticated.
Behaviour modelling designs are a lot closer to software emulators than most FPGA fanbois will admit.
The T80 as used in the Next and Uno ZX core mimics behaviour. The A-Z80 as used in the Uno CPC core is derived from decapping and photographing, and mimics structure. But it takes up a lot more FPGA resources than the T80 does.
https://opencores.org/project/t80
https://opencores.org/project/a-z80
We will get there in a few more years, as entry-level FPGAs get bigger and more sophisticated.
Behaviour modelling designs are a lot closer to software emulators than most FPGA fanbois will admit.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel • NXTP • ESP Update • ESP Reset • CSpect Plugins
SevenFFF / Threetwosevensixseven / colonel32
NXtel • NXTP • ESP Update • ESP Reset • CSpect Plugins
Re: What was the SLL instruction supposed to do?
True, I never liked behavior simulation projects. It's an emulator hiding inside an fpga You get all the disadvantages of an emulator.
The next 10-20 years though, gate level re-creations of cpus will be a reality in budget packages. Then comes the interesting question on whom will buy these widgets? because most of the original consumers of 8-bit tech are not going to be in a position to consume...
The next 10-20 years though, gate level re-creations of cpus will be a reality in budget packages. Then comes the interesting question on whom will buy these widgets? because most of the original consumers of 8-bit tech are not going to be in a position to consume...
Re: What was the SLL instruction supposed to do?
We will be in our 90s, buying nostalgia-driven recreations of pacemakers and colostomy devices that we used in our 70s!
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel • NXTP • ESP Update • ESP Reset • CSpect Plugins
SevenFFF / Threetwosevensixseven / colonel32
NXtel • NXTP • ESP Update • ESP Reset • CSpect Plugins