If I have a CPU/system with the following characteristics...
- 16 bit architecture (16 bit registers and bus)
- 8 total registers
- A set of 64 assembly instructions
And assuming my assembly instructions follow the format...
OPCode (6 bits) + Register (3 bits) + Register (3 bits) + Unused (4 bits)
** Example Instructions (below) **
Assembly: LOAD R1, R7 (Loads value of address stored in R1 into destination register R7)
Machine: 110000 001 111 0000
Assembly: STORE R1, R7 (Stores value in R1 into destination address stored in register R7)
Machine: 110001 001 111 0000
These types of instructions make sense to me because all of the required bits fit nicely into a 16 bit format and thus into the instruction register (which hold 16 bits), but I am confused on how one gets the desired address into a register to begin with due to this instruction length constraint?
If an address is 16 bits on this system, it seems to me like I would need more than 16 bits to represent an instruction that would assign an address value to any given register before I could even use something like a LOAD or STORE instruction...
OPCode (6bits) + destinationRegister (3 bits) + addressLiteral (16 bits) ???
However, something like this would not fit in my 16 bit instruction register. What am I not understanding here? Any help is greatly appreciated, thanks!