sci4me wrote:
... - TBH I don't really know what you mean... ??
As far as starting fresh, I suppose I should keep going with the 65S4ME... the benefit of that is that it already has a decent name
But really, I do want to EVENTUALLY create a new processor. I guess I should "finish" this one and after thats over, work on a new processor which is "a step up"?
No one would blame you for abandoning something that doesn't 'flip your switch' anymore. It's a free
country, and most of us are adults here ... take your project in whatever direction suits you, and we'll
try to help.
Regarding store immediate:
Code:
example lda 1234 ; grab a byte from memory location 1234 (a = mem[1234])
sta 5678 ; ... and copy it back out to memory location 5678 (mem[5678] = a)
ldx #56 ; set register x to 56 (x = 56)
stx 78 ; ... and place it in direct-page location 78 (mem[78] = x)
stx #9876 ; ... ??? where did the store go???
No-one is telling you how to implement your assembly language (mine has clearly caused some
head-scratching around here), but this sample shows the standard syntax for the assemblers
that most of us old farts know and love. The '#' operand prefix assembles into an immediate
instruction (one that takes the operand at face-value), and the absence of the '#' prefix assembles
into an absolute or direct-page instruction (one that uses the operand to specify a memory address).
When the cpu sees an immediate-mode opcode, it loads the following value 'directly' into the register.
When the cpu sees an absolute-mode opcode, it loads the following value into a memory access
register, basically using the value as a pointer into memory. If you look at any source code for
most processors, you will find that something like
sta #1234 is notably absent, since you are trying
to do the high-level language equivalent
1234 = a. In my assembly language, this is not an error,
but just one of many no-ops, since there is a hidden default register z embedded within the operand.
a + 1234 is assigned to register z, and the result is discarded at the next instruction fetch.
I hope that this explanation makes more sense.
Mike
[Edit: I just remembered something about the 6800 ...
staa #0 was not available in the assembly
language, but there was an undocumented op-code slot for it. If you executed this two-byte instruction,
the 6800 would do its best to comply, by storing the run-time contents of accumulator a after the 0
operand in the second byte of the instruction, and continuing execution at the byte after that ... kinky!!
Naturally, this only 'worked' if the instruction was in RAM.]