But aren't they still just a sad substitute for a zero page like in say the 6800? This cat has to much mustard.Ast A. Moore wrote: ↑Sat Apr 25, 2020 7:01 pm If you can get by without using index registers, then don’t worry about them. You’ll figure out why you need them when you need them.
So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
"Truth would quickly cease to be stranger than fiction, once we got used to it." - H.L. Mencken
- Lethargeek
- Manic Miner
- Posts: 743
- Joined: Wed Dec 11, 2019 6:47 am
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
Best 8-bit design ever.
Proud owner of Didaktik M
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
No. The Z80 is a more advanced architecture. It doesn’t need a zero page, because it has a plethora of registers to work with. Regardless, the 6800 did have an actual index register.
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: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
I'm willing to compromise. Of course the Z80 designer can not be held responsible for Sir Clive's decision, to offer no hardware sprites. In connection with memory mapped hardware which needs more than one address, the (IX+n) stuff actually seems convenient. On the other hand, they already decided, that the memory preferably should be pristine, by offering the IORQ to connect to hardware. Also compatibility to the 8085 is already so so, as there is no https://www.geeksforgeeks.org/serial-i- ... processor/
Anyway I'm puzzled that programmers of sprites for the Spectrum seem to think in terms of "we'll do an emulation of hardware sprites" which seems to be an unnecessary restriction on a machine with little resources to waste. I wonder what the usage of HL etc vs. IX/IY say in the ROMs is.
"Truth would quickly cease to be stranger than fiction, once we got used to it." - H.L. Mencken
- Lethargeek
- Manic Miner
- Posts: 743
- Joined: Wed Dec 11, 2019 6:47 am
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
not hardware sprites but rather object descriptors (likely including the sprite data)
IY is used to access system variables (and due to a bug, it needs to point at them all the time if the interrupt mode 1 is allowed)
IX has no dedicated role and is used in the beeper and tape routines only iirc just like HL
Anyway, because the memory access with these registers is rather slow, it is used usually for rarely accessed data when it's even slower to save and restore other registers being already in use at the moment. Same about the usual register ops, as these two are just a slower version of HL.
- 1024MAK
- Bugaboo
- Posts: 3123
- Joined: Wed Nov 15, 2017 2:52 pm
- Location: Sunny Somerset in the U.K. in Europe
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
System designers can use memory mapped I/O on a Z80 system if they wish. Some ZX81 expansions used I/O that was memory mapped. And some Z80 systems did use memory mapped I/O. Further, you could make the case that the ZX Spectrum screen RAM is memory mapped I/O....1bvl109 wrote: ↑Sun Apr 26, 2020 6:24 pm On the other hand, they already decided, that the memory preferably should be pristine, by offering the IORQ to connect to hardware. Also compatibility to the 8085 is already so so, as there is no https://www.geeksforgeeks.org/serial-i- ... processor/
The Z80 had already been designed when Intel launched it’s 8085. The Z80 was designed so it can run 8080 code. As it happens, the 8085 was designed to also run 8080 code. Only the SIM and RIM instructions were new to the 8085. So any 8085 code that only uses 8080 instructions will run on a Z80 (although there are minor timing differences between 8080 and 8085 with some instructions).
If you want pain with a stack, use a 8 bit Microchip PIC microcontroller (fixed hardware stack), or a 6502 where the stack is stuck in page 1.
At least with the Z80 you can have the stack anywhere you like in memory. And it is possible to have more than one stack in memory if you are careful with your code (but only one active at a time).
Also keep in mind that the Z80, 6502, 6800, 6802 etc were all designed for embedded systems and not for general purpose computers, let alone for games machines.
If you want a CPU with lots of fancy and flexible instructions, use a 680xx. E.g, a Sinclair QL
Mark
Standby alert
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
Could as well go the other way too. Apart from the fact, that the PC is usually not a register used to manipulate what is there. There darn well should already be something sensible there.
Meanwhile in other semantics: The design is inherently dangerous, unless there is code, which detects when it overlaps. But there also could have been hardware for the purpose. LSPC nn, load stack pointer control register, an interrupt to $40 is triggered, if the SP goes below nn.
Depends. In BASIC, using an out of bound index, you expect your interpreter to tell you. In C you expect .... everything.
Of course not. If at all, we all do it the Speccy-ROM way, but that is because we are all sinners,
"Truth would quickly cease to be stranger than fiction, once we got used to it." - H.L. Mencken
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
I would be hard pressed how a CPU using memory could deny this.
There was plenty of room though. Who needs a shadow ROM? Wait a minute. OUT on a ZX81? Wasn't the screen crashing down on you?
Sure. Not the fault of the Z80 designers though.
Thanks, I had no clue.
Calmly, calmly .. I'll shoot myself in this foot next time.
"Truth would quickly cease to be stranger than fiction, once we got used to it." - H.L. Mencken
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
I find coders arguing quite an amusing thing to watch, that's because I've always sort of imagined (being a complete ignoramus in this field) that there shouldn't be any room for manuever. It seems such a scientifically strict area after all. Most other internet bickerings are about opinions, so anybody can say pretty much anything and get away with it, but this is like, maths, innit?
- 1024MAK
- Bugaboo
- Posts: 3123
- Joined: Wed Nov 15, 2017 2:52 pm
- Location: Sunny Somerset in the U.K. in Europe
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
Although ZX81 does not have OUT or IN in it’s BASIC, the relevant Z80 machine code instructions work fine without crashing the screen, as long as you don’t do something silly. As on the ZX Spectrum, Sinclair only used minimal decoding.
Mark
Standby alert
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
- 1024MAK
- Bugaboo
- Posts: 3123
- Joined: Wed Nov 15, 2017 2:52 pm
- Location: Sunny Somerset in the U.K. in Europe
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
To continue, please pay the £1 charge...akeley wrote: ↑Thu Apr 30, 2020 9:10 pm I find coders arguing quite an amusing thing to watch, that's because I've always sort of imagined (being a complete ignoramus in this field) that there shouldn't be any room for manuever. It seems such a scientifically strict area after all. Most other internet bickerings are about opinions, so anybody can say pretty much anything and get away with it, but this is like, maths, innit?
Mark
Standby alert
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
“There are four lights!”
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
There's plenty of room to learn!akeley wrote: ↑Thu Apr 30, 2020 9:10 pm I find coders arguing quite an amusing thing to watch, that's because I've always sort of imagined (being a complete ignoramus in this field) that there shouldn't be any room for manuever. It seems such a scientifically strict area after all. Most other internet bickerings are about opinions, so anybody can say pretty much anything and get away with it, but this is like, maths, innit?
Programming is like LEGO - there are all these fixed-sized pieces that at first glance appear to only do one thing. But get a handful together and do a few sums and you quickly discover you've got a billion different possible combinations and it's up to you to pick what you think is the best one. Chances are someone else may not make exactly the same choice given that many options!
And maybe you figure it out on your own, or someone tells you, that the best way to build a LEGO house is to sort out the roof first, since it's the most complex shape, then plan the layout of the house to fit under it. And you start building way better houses with roofs with all sorts of angles and dormer windows that all seem to fit perfectly that you never managed before.
Then someone shows you how, with the odd hinge or bracket here and there, you can fit those same pieces you've always been using sideways or upside-down and you've suddenly shifted onto a whole new way of putting things together and making shapes you never even thought of before.
And before you know it, you've solved a problem by writing a program that runs backwards and then you can't find anyone else who understands how it even works.
Spoiler
The trick is to ignore the people who tell you what you can't do. Or at least, don't take them seriously.
- Ast A. Moore
- Rick Dangerous
- Posts: 2641
- Joined: Mon Nov 13, 2017 3:16 pm
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
And that anyone often includes you.
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: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
At the risk of getting splinters in my ar$e from the fence I'm currently sitting on... ...
...When I wrote Catacombs I was learning assembly, and didn't use the IX or IY registers at all. So overall, yep - you don't need to use them if you don't want to.
...Well, actually - IX appears a couple of times in the redefine keys routine, but that's 'cos I copied & pasted (read: stole) that routine wholesale from [mention]R-Tape[/mention] so I'm not counting those...
For the sequel I'd learned about IX and I had to keep track of more objects, sprites etc. and wasn't too worried about speed, so I used IX+n a fair bit for the reasons already suggested. Though I think it's probably the only time I've actively made a change for the sake of making my code more structured...
What I like about assembly is because it tends to be a one-person-development, readability and structure is up to you, and it's fine to do crazy things if you want as long as the end result is what you intended. Like that Snake game that only used the LD instruction.
...When I wrote Catacombs I was learning assembly, and didn't use the IX or IY registers at all. So overall, yep - you don't need to use them if you don't want to.
...Well, actually - IX appears a couple of times in the redefine keys routine, but that's 'cos I copied & pasted (read: stole) that routine wholesale from [mention]R-Tape[/mention] so I'm not counting those...
For the sequel I'd learned about IX and I had to keep track of more objects, sprites etc. and wasn't too worried about speed, so I used IX+n a fair bit for the reasons already suggested. Though I think it's probably the only time I've actively made a change for the sake of making my code more structured...
What I like about assembly is because it tends to be a one-person-development, readability and structure is up to you, and it's fine to do crazy things if you want as long as the end result is what you intended. Like that Snake game that only used the LD instruction.
Sure, but all you need to know is your 2x table...
My Speccy site: thirdharmoniser.com
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
I think, I had this in mind
https://problemkaputt.de/zxdocs.htm#zx80zx81iomapZX80/ZX81 I/O Ports
Output to Port FFh (or ANY other port)
Writing any data to any port terminates the Vertical Retrace period, and restarts the LINECNTR counter. The retrace signal is also output to the cassette (ie. the Cassette Output becomes High).
"Truth would quickly cease to be stranger than fiction, once we got used to it." - H.L. Mencken
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
Well sure, we only need a couple of Next or other hardware emulation, where we can run different CPU-designs an say some 100+ programmers willing to optimize their games on both and than we''ll see. Be warned, that I'm prepared to call everyone chicken, who doesn't shell out the money to prove me wrong. I want justice! https://www.oglaf.com/justice/
Math is math though. Maybe there you'll find guaranteed correctitude and tranquillity of mind, traveler. Simply never ever mention Banach-Tarski or a couple of other things and it's unlikely that the big knives come out.
"Truth would quickly cease to be stranger than fiction, once we got used to it." - H.L. Mencken
Re: So the Z80 is an improved 8080/8085, but what about LD A,(MN)?
OOP-Think in assembler than.Lethargeek wrote: ↑Sun Apr 26, 2020 11:41 pm not hardware sprites but rather object descriptors (likely including the sprite data)
This I admit is some reasonable use, so that you can have one byte magic numbers instead of two byte addresses.Lethargeek wrote: ↑Sun Apr 26, 2020 11:41 pm IY is used to access system variables (and due to a bug, it needs to point at them all the time if the interrupt mode 1 is allowed)
I'm not quite sure, that you mean here by "usual register ops". BC and DE as compared to HL? LD A,(...) all have seven clock cycles.Lethargeek wrote: ↑Sun Apr 26, 2020 11:41 pm Same about the usual register ops, as these two are just a slower version of HL.
"Truth would quickly cease to be stranger than fiction, once we got used to it." - H.L. Mencken