0
votes

I've been reading a book and i got stuck in this:

They showed me this chart:

image

I put this values by myself (does it make sense to you?):

PC (program counter) = 16 bits

TAR (temporary address register) = 16 bits

MAR (memory address register) = 16 bits

RTR = 8 bits Stack = 16 bits

Index = 16 bits

Page = 8 bits

Aux1 = 8 bits

Aux2 = 8 bits

Accumulator A = 8 bits

Accumulator B = 8 bits

MBR = 8 bits

Intruction register = 8 bits

Address Bus = 16 bits

Data Bus = 8 bits

I want to create my own intruction (double operand): Some of the addressing modes must use an internal CPU register (not limited to accumulators A and B only), for example page, index, stack.

i.e: A addressing mode where the index register contains the offset and the operand in the instruction indicates the address to add to that offset.

I was thinking about something like this:

MOVE #$58, (INDEX) but it does not look correct to me

I'm quite lost right now :/...Could you please show me an example and briefly explain in what situation your mode of addressing would be useful?

1

1 Answers

0
votes

On x86 platform you can specify the base or index registers. E.g. mov ax, WORD PTR [bx] OR mov ax, [bx+si], here bx is base and si register content is index.

The instruction that you have mentioned seems to indicate that value INDEX will be added to base address in some DEFAULT register. If that is your intent than the instruction is okay. Otherwise there should be a provision for mentioning what the base register is, but only if there are many possible base registers.