Alarm Siren wrote:
cbmeeks wrote:
BigEd wrote:
But isn't Arduino from the programmer perspective a C machine? (Or indeed, C++.) And it has sizeof(int)==2, usually but not always. Even on an 8 bit micro then, the programmer sees a 16 bit machine.
And I think that's fine - almost all programming is done to a virtual machine, some it is high level and some of it is low level.
You know, you're right.
https://www.arduino.cc/reference/en/lan ... types/int/I knew they were 8-bit uc's but I had forgotten how much the Arduino libraries shield you from this.
Well, its not so much the Arduino
libraries, as it is the compiler abstracting those details away - which is kind of the point of a HLL, after all.
You don't need an HLL --- you can do this with assembler macros too.
The AVR8 has 32 8-bit registers, so you can write macros that abstract these into 16 16-bit registers.
Similarly, on the 6502 you can dedicate a portion of zero-page as 16 16-bit pseudo-registers (IIRC this is what the Woz's Sweet16 development system did).
So I was not right when I said: "In this day and age, 8-bit is too hard to work with."
I should have said: "In this day and age, 8-bit is too bloaty and slow to work with. "
Any program that deals primarily with 16-bit data is going to be bloaty and slow on an 8-bit processor --- a hybrid processor such as the 65c816 is going to be a lot better --- an actual 16-bit processor is, of course, preferred.
A game-machine is going to be dealing primarily with 16-bit data --- whether you use assembly-language, Forth or C, you are better off with a 16-bit processor, or at least a hybrid.
I'm not opposed to the 65c816 if it could be upgraded with an OSX prebyte like on the M65c02A --- without that, Forth is too bloaty and slow to bother with.
The OAY prebyte is pretty useful too.
The IND prebyte might be useful --- all I've done with it is to provide something similar to the 65c816's (offset,S),Y addressing-mode --- I might think of some other use though.
Unless you have 65c816 legacy code that you want to run, being compatible with the 65c816 isn't required --- it would be possible to have a processor "in the spirit of" the 65c816 that would be adequate --- Michael Barry's 65902 idea is intriguing.
The TOYF assembly-language is very difficult to work with --- I invented it, and I think it is difficult, so I can only imagine what the learning-curve will be like for other people --- I doubt that many teenagers would be able to figure it out (even among professional programmers, I would expect that at least 50% will run away screaming).
On a positive note though, I would expect TOYF programs to be several times faster than 65c816 or 65902 programs, when implemented on the same FPGA.
If the game-machine is going to be programmed by teenagers, then an upgraded 65c816 or a 65902 would be a more comfortable environment.