Quote:
Of course, you could avoid the issue by specifying only 24-bit operands, but that seems to be rather limiting, especially in the case of immediate constants.
Myself, I can't imagine using more than 16Mwords of memory space unless the price and density of SRAM improves further, but the matter of the larger immediate constants is important to my uses, as I want to do a lot of 32-bit scaled-integer math. If the larger immediate constants can be synthesized efficiently with
two instructions, I guess I don't have any problem with that if it lets other things be more efficient. It probably can't be formed in the accumulator though if it is the operand to subtract
from the number already in the accumulator for example. Mike seems to have a good method of handling this in his 65m32 although its relation to the 65 family is not as close. IIRC, he reserves $800000 to mean "Get the operand from the next word" if it's either that value or something that cannot be represented in 24 bits.
I'm not very concerned about the economy of
program memory though; and the savings afforded by merging op code and operand are only in programs. What will take most of the memory (in my own applications, and, I suspect, in most other people's too) is data. I will probably never have even 64Kwords of actual program, but I want many megawords of data-- as much as I can practically afford. The purpose in merging the op code and operand is of course to get better performance from limited-speed memory, since fewer accesses are needed to get the job done.
In the way the 65Org32 is defined (like an '816, just with all the registers and buses extended to 32-bit), ZP (or, more accurately, DP) does indeed cover all the same address space that abs does, but it's still different in that abs is precisely that--absolute--whereas DP changes the origin, something that's important for relocatable code and data spaces.
The difference between abs (which is 16-bit on the 6502/816) and long (which is 24-bit on the '816) isn't really gone on the 65Org32 either, because although
all addressing modes now cover the entire 32-bit range, "long" is like the abs on the '02 where there are no bank registers, whereas the 816's abs is not really absolute, because the bank registers act as an offset, something that is again important for relocatable code and data spaces. Addresses that will never be relocated are those of I/O ICs, and there will be system routines whose only relocation, will be reflected by updates in a jump table (and the table will not be relocated).
I might make some comments about the PIC microcontrollers that merge operands with op code:
- The op code portion of a word is variable length, leaving the most operand space for the things that need it. (Intelligent character LCDs do this too.)
- Because of #1, looking at actual machine language down the left edge of a .lst file (or a hex dump as mentioned earlier) to see for example if a macro I wrote is truly assembling what I wanted, it is usually much harder to see the op code and the operand. If they were always on byte boundaries (for example having the first 6 bits for op code and the last 8 bits for operand), it would be much easier. It's not possible though with their 14-bit word, 11-bit addresses, and related things.
- Even if the PIC were able to write program words directly like data space, the merged op code and operand would still make self-modifying code far too expensive to be worth it. The 65m32's (not 65Org32's) addressing modes may however remove almost all need for self-modifying code. I don't know yet.