Rob Finch wrote:
Quote:
the 65Org32 is strictly a 32-bit machine, both for address and data...
You've probably heard this before but,
It's many pages long, but the discussion on it is at
viewtopic.php?f=1&t=1419. You'll see I mentioned you right up front. The 65Org32 is like a 65816 (minus the emulation mode) but with all the registers being 32-bit; so it's far more suitable than a big 6502 for multitasking, multithreading, relocatable code, higher-level languages, etc.. Since the bank registers are 32-bit also, there are no bank boundaries, because the entire 4gigaword space is available all the time to every addressing mode, so the bank registers simply become offsets, and every program can think that it (and its private data) starts at address 0 (even if it had to be moved after having been loaded).
Quote:
If the 65org32 is strictly 32 bits, then the absolute addressing modes are redundant. abs,x is the same as zp,x. and abs is the same as zp.
I'd suggest reusing the address mode opcodes to add another index register 'w'. abs,y becomes zp,y and abs,x becomes zp,w.
There would certainly be enough op codes available to do anything we wanted. Although ZP (or, in the parlance of the '816, "DP" since it can be moved around) covers the whole 4gigaword space, it is still desirable to keep it, and the DP register (which is also 32-bit) becomes another offset. The 816's "long" address modes would be used not for anything particularly longer but for ignoring the bank registers in instructions that look outside the currently running program.
I might be in favor of another index register if it doesn't come with a penalty somewhere else. BigEd
observed, "With 6502, I suspect more than one
beginner has wondered why they can't do arithmetic or logic operations on X or Y, or struggled to remember which addressing modes use which of the two. And then the
intermediate 6502 programmer will be loading and saving X and Y while the
expert always seems to have the right values already in place." I really had little desire for an additional index register until working through an idea for a third stack for high-precision or floating-point as we
discussed on the forum years ago and I'm expanding on it for the stacks primer (which I've been able to work on again for the last few days). [
Edit: It's up, at
http://wilsonminesco.com/stacks/ .] Really the only higher-level language I've used on the 6502 is Forth, and it uses X constantly as the data stack pointer and seldom has any need to save it to use X for anything else. If I were to implement a complex floating-point stack too though, it would make it nice to have the equivalent of another X register, in this case apparently W. It would be good to hear from those who intimately know the insides of C or other compiled languages, to see what would be most helpful there. Just throwing registers at it without a clear plan of what to use them for may not be a very good idea.
Quote:
It would also save code space to have a short form immediate eg. 16 bits instead of 32 (did this onthe rtf65002).
Do you mean merging the operand with the op code in the same word? The BBS, BBR, SMB, and RMB do that which are considered to be kind of oddball instructions on the 65c02 since they're mainly useful for I/O and yet I/O is seldom in ZP where they operate except in the microcontrollers these instructions get used in. Since I know very little about HDL design of processors' internals, it would seem to me that instruction decoding would become more complex than the traditional 6502 way. On the PIC microcontrollers, having the op code and operand merged sometimes makes it harder to check things in the list code, but that might be remedied with a clean and consistent division between hex digits so no digit has bits from both.
Quote:
Then with 32 bits it also makes sense to use a plain ADD/SUB instruction rather than ADC/SBC.
Otherwise I'd keep the rest of the processor the same in order to keep it small.
There's total freedom to do whatever a designer wants of course; but the goal with the 65Org32 itself is to retain the 6502/816 flavor and make a truly 65-family processor with a lot more computing power. I have lamented that other efforts like the 65GZ032 which, although never finished, did have working hardware, was really a RISC with very little resemblance to the 6502 except in emulation mode. I think the idea was a plug-in replacement to run in the Commodore 64, which is why the emulation mode, for boot-up.
Quote:
there'd be no backwards compatibility.
Probably the only reasons for backwards compatibility is so customers will migrate more easily and so already-written software can continue to be sold. Otherwise I see backwards compatibility as big damper on performance. The backward-compatibility part here is really more a matter of taking advantage of a lot of 6502 programming experience and to make it capable of going much further than it ever could on a 6502 or even '816. That can still happen even if same mnemonics result in different op codes, the bus widths are different, etc..
Quote:
No barrel shifter, no additional registers (save w). no additional instructions. No cache. The goal being to fit the processor in a relatively small FPGA.
With 32 bits, I think a barrel shifter is going to be rather necessary. Doing ASL for example 20 or 30 times would be a killer to performance.