Thanks again for all your reading and patience.
If I would had wanted to build a thing like a new processor, I would had titled the thread with the right subject.
But the subject is about discussing about the concept of separate the machine code used in 65xx processor from the hardware that implement that machine code, having an abstraction in between.
Is HAL the right term? It seems not to.
I will try to explain once more:
The internal architecture of a i8086 is different from the one in a i80486, which itself is different from Pentiums, and so. Even Intel mobile processors with the same brand and sold under the same family can have different internal architectures.
But all of them understand the x86 instruction set.
How the Intel processors run the x86 instructions set has been evolving during decades, but the original instruction set still apply.
Maybe rephrasing the question would help:
Is there any point on evolving the hardware that run the 65xx instruction set at all?
Discussion: What would be the point of a 65xx HAL?
Re: Discussion: What would be the point of a 65xx HAL?
There are one or two very fast emulators which run 6502 code on ARM, in the PiTubeDirect project.
And I can think of at least one project mentioned here which aimed to increase the fetch bandwidth and therefore improve the number of instructions per clock. In fact maybe two.
I'm not sure whether or not we've seen a more fully pipelined implementation, other than that.
In your original post and some followups you were also talking about extending the 6502 - that makes it a much different conversation, because not only must the implementation have the extra registers and operations, but the machine code also needs to encode them. (And of course the programmer or the compiler also needs to make use of them.) (And everything needs to be well-tested and documented.)
(So you see it might make sense to start a new thread, with a new title, and a new head post which asks the question you're thinking of. You can link back to this one, and probably that would be a good idea.)
And I can think of at least one project mentioned here which aimed to increase the fetch bandwidth and therefore improve the number of instructions per clock. In fact maybe two.
I'm not sure whether or not we've seen a more fully pipelined implementation, other than that.
In your original post and some followups you were also talking about extending the 6502 - that makes it a much different conversation, because not only must the implementation have the extra registers and operations, but the machine code also needs to encode them. (And of course the programmer or the compiler also needs to make use of them.) (And everything needs to be well-tested and documented.)
(So you see it might make sense to start a new thread, with a new title, and a new head post which asks the question you're thinking of. You can link back to this one, and probably that would be a good idea.)
Re: Discussion: What would be the point of a 65xx HAL?
tokafondo wrote:
The internal architecture of a i8086 is different from the one in a i80486, which itself is different from Pentiums, and so. Even Intel mobile processors with the same brand and sold under the same family can have different internal architectures.
But all of them understand the x86 instruction set.
But all of them understand the x86 instruction set.
The architecture is the defining factor. It says what's possible, and (by omission) what's not. For example, there's no ability to arbitrarily add more accumulators (as you suggested upstream, iirc).
I'm not arguing against your proposition. I'm just pointing out that the Intel i8086 doesn't seem like a good example to support it.
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Discussion: What would be the point of a 65xx HAL?
BigEd wrote:
There are one or two very fast emulators which run 6502 code on ARM, in the PiTubeDirect project.
What is the way to do that by hardware? By using a FPGA, that also simulate what the real hardware should be doing. It's not that a FPGA contains resistors, capacitors and transistors like the real CPU has, but programmable logic that behaves like the original hardware does.
So those two could be a way to implement my wrongly called HAL. Those two are ways to separate the 65xx instruction set from the hardware it runs on.
BigEd wrote:
In your original post and some followups you were also talking about extending the 6502 - that makes it a much different conversation, because not only must the implementation have the extra registers and operations, but the machine code also needs to encode them. (And of course the programmer or the compiler also needs to make use of them.) (And everything needs to be well-tested and documented.)
Dr Jefyll wrote:
The architecture is the defining factor. It says what's possible, and (by omission) what's not. For example, there's no ability to arbitrarily add more accumulators (as you suggested upstream, iirc).
So... at this point, about extending the 6502, I think it would be better to think about extending the 65xx instruction set and from there redesigning or enhancing the CPU hardware design itself.
Would be useful to extend the 6502 instruction set?
Would be useful to expand or extend what the CPU has to offer to the instruction set, with things like (but not limited to)... two accumulators or zero and first page implemented directly in the core die?
Would be useful to separate the 65xx logical instruction set from the hardware it runs on, like what happens in the x86, where there are several manufacturers of x86 compatible CPUs, but that works differently at hardware level?
...or is it all of that pointless because the 65xx architecture is perfect as it is?
- GARTHWILSON
- Forum Moderator
- Posts: 8774
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Discussion: What would be the point of a 65xx HAL?
tokafondo wrote:
So... at this point, about extending the 6502, I think it would be better to think about extending the 65xx instruction set and from there redesigning or enhancing the CPU hardware design itself.
Would be useful to extend the 6502 instruction set?
Would be useful to extend the 6502 instruction set?
Quote:
Would be useful to expand or extend what the CPU has to offer to the instruction set, with things like (but not limited to)... two accumulators or zero and first page implemented directly in the core die?
- You've mentioned two accumulators a few times now. Do you have a specific use envisioned for them? I'm not sure I've ever wished to two accumulators, but I wouldn't mind having another register that duplicates the functions of X. The '816 allows 16-bit index registers (and allows a 16-bit accumulator too, independently), so at least indexing past 255 is possible there, and adds the stack-relative addressing modes. Its op-code table is full; so adding more registers and the op codes to use them would require a wider instruction word, or more operand bytes, or two-byte op codes and more complex (and probably also slower, as BigEd said) internal instruction decoding.
then I mentioned various functions you can get with self-modifying code, and later mentioned the penalties that may come with putting pages 0 and 1 on their own internal buses.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: Discussion: What would be the point of a 65xx HAL?
I still don't understand what you're getting at.
The instruction set already is separate from the implementation (if we ignore the strange implementation-dependent behaviour of the undefined opcodes on the original NMOS 6502, which pretty much everyone but the demo scene does). There are many implementations of the 6502 - NMOS, CMOS, FPGA, software, discrete transistors, 74-series chips. They all execute the same base instruction set, with completely different hardware.
And of course it would be useful to extend that instruction set. It has happened several times already, with several versions of the 65C02, the 65816, and the wide variety of extensions designed by hobbyists. I have one of my own.
Two accumulators must have already been done. But putting pages zero and one onto the chip - that is not an extension of the instruction set. It's an implementation detail. You could make one chip with internal page zero and one without, and there would be no way for software to know which it is running on. Which instructions are you imagining this change would affect, and in what way?
The instruction set already is separate from the implementation (if we ignore the strange implementation-dependent behaviour of the undefined opcodes on the original NMOS 6502, which pretty much everyone but the demo scene does). There are many implementations of the 6502 - NMOS, CMOS, FPGA, software, discrete transistors, 74-series chips. They all execute the same base instruction set, with completely different hardware.
And of course it would be useful to extend that instruction set. It has happened several times already, with several versions of the 65C02, the 65816, and the wide variety of extensions designed by hobbyists. I have one of my own.
Quote:
Would be useful to expand or extend what the CPU has to offer to the instruction set, with things like (but not limited to)... two accumulators or zero and first page implemented directly in the core die?
Re: Discussion: What would be the point of a 65xx HAL?
GARTHWILSON wrote:
I'm not sure I've ever wished to two accumulators, but I wouldn't mind having another register that duplicates the functions of X.
John West wrote:
The instruction set already is separate from the implementation
John West wrote:
Two accumulators must have already been done.
John West wrote:
But putting pages zero and one onto the chip - that is not an extension of the instruction set. It's an implementation detail. You could make one chip with internal page zero and one without, and there would be no way for software to know which it is running on. Which instructions are you imagining this change would affect, and in what way?
Is it, then, commonly accepted that the 65xx instruction set and its hardware implementations are different things?
- GARTHWILSON
- Forum Moderator
- Posts: 8774
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: Discussion: What would be the point of a 65xx HAL?
tokafondo wrote:
It seems to me, however, that not using the real thing -- a 6502 chip is considered not canon: Most of the SBC projects shown here include the 40 pin 6502 and the chips needed for it to do what intended to do. Is it like that? Do people prefer to use the real chips instead of FPGA or emulation implementations?
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
Re: Discussion: What would be the point of a 65xx HAL?
You'll find a great variety of interests and perspectives, here. From TTL remakes to single boards with 40 pin DIPs, to FPGA reimplementations and to emulators written in high level or low level languages.
It's not helpful, I think, because it's not accurate, to seek a consensus in this situation, as to what kind of endeavour is valid, or is considered canon.
Even the terminology is not consensus: I know very well what I mean when I say simulate or emulate, but there's at least one other view which assigns different meanings to those words.
There is not a hive mind on this forum, or any other, or on any mailing list.
Better, I think, to put forward an idea and see who is in favour. There will always be some who are not in favour, because that particular idea doesn't mesh with their particular interests.
I don't know if they have already been linked in this thread, but there are at least a couple of previous topics which are worth investigating. Whether or not your ideas are new, it's worth seeing what others have thought previously, and what those ideas led to, by way of discussion or development.
A pool of odd ideas for speeding up a 6502 architecture
Index of threads for improved 6502 and derived architectures
Overview of 6502-like cores, hard, soft, partial, overblown
It's not helpful, I think, because it's not accurate, to seek a consensus in this situation, as to what kind of endeavour is valid, or is considered canon.
Even the terminology is not consensus: I know very well what I mean when I say simulate or emulate, but there's at least one other view which assigns different meanings to those words.
There is not a hive mind on this forum, or any other, or on any mailing list.
Better, I think, to put forward an idea and see who is in favour. There will always be some who are not in favour, because that particular idea doesn't mesh with their particular interests.
I don't know if they have already been linked in this thread, but there are at least a couple of previous topics which are worth investigating. Whether or not your ideas are new, it's worth seeing what others have thought previously, and what those ideas led to, by way of discussion or development.
A pool of odd ideas for speeding up a 6502 architecture
Index of threads for improved 6502 and derived architectures
Overview of 6502-like cores, hard, soft, partial, overblown
Re: Discussion: What would be the point of a 65xx HAL?
GARTHWILSON wrote:
I would go for the programmable-logic ones if someone would supply them ready to go.
BigEd wrote:
Better, I think, to put forward an idea and see who is in favour. There will always be some who are not in favour, because that particular idea doesn't mesh with their particular interests.
- several accumulators
- more index registers
- every zero page register being both a memory address and an accumulator
- every register being able to be accumulator and index register
Maybe hardware wise, it would not easy to implement those - or any other - proposals, but... software wise would there advantages from them? Would they make coding easier or more efficient?
Re: Discussion: What would be the point of a 65xx HAL?
tokafondo wrote:
I'm talking about setting a sort of standard that would allow hardware natively understand and run 65xx code as a real chip would do, but without the constraints that the 65xx hardware architecture has.
In ARM's spec you'll not find timing diagrams, or instruction cycle counts. These are implementation details. The spec is an abstraction of a processing element. Implementation is up to you.
There's a separate spec for the interrupt architecture, detailing how compliant system should handle everything from pin-interrupts, to messages interrupts (e.g. PCIE MSIX), to interrupt routing and programming of the controller. Again, it's a behavior specification.
[RISC-V also has architecture specs, but they're not as detailed as ARM's. Same exact idea though: behavior, not implementation].
These specifications could be called a HAL. It's not how I use the term, but it doesn't entirely not fit.
More commonly, a HAL is a software layer that isolates higher level software from hardware-specific lower level software. For example, companies that build networking equipment such as switches and routers have code bases that span multiple generations of product. Over those generations the underlying switching ASICs evolve (whether they be internally developed ASICs or 3rd party), so a HAL provides a clean layer to allow one code base to operate across products.
For a CPU like the 6502, you could develop a HAL that hides the details of things like interrupt control, UART, storage, and network, RTC, and sensors, video... with applications using well-defined APIs and compliant system builders implementing the calls. That's a BIOS.
Quote:
Some ideas have been proposed just as examples in this thread, like
- several accumulators
- more index registers
- every zero page register being both a memory address and an accumulator
- every register being able to be accumulator and index register
I think at some point, where you're asking for more of this, or more of that, what you're really doing is coming to a realization that your needs no longer align with what the 6502 offers.
Re: Discussion: What would be the point of a 65xx HAL?
There’s a nearby recent discussion on the 6809 with links to both the question of what the designers intended and also to what the users thought after the fact.
The point being that the 6809 was very much intended to be an improvement on the 6800.
The point being that the 6809 was very much intended to be an improvement on the 6800.