186 Computer Architecture and Organization
3. Move memory to accumulator (one instruction) for loading from memory. Three-nibble instruc-
tion; third nibble would contain data memory address.
4. Copy from register to register (56 instructions) for general purpose data transaction. Source and
destination cannot be the same location. This would be 2-nibble instruction with source and
destination register address consuming six bits at the end.
5. Push register on stack top (eight instructions) to save any one of eight registers of currently
selected bank on stack top. This would take two nibbles, with register code in last three bits.
6. Pop register from stack (eight instructions) the opposite of push instruction. This would take two
nibbles.
7. Read from addressed port to accumulator (one instruction). Three nibble opcode with port
address at last nibble.
8. Write accumulator to port (one instruction). Three nibble opcode with port address at last nibble.
9. Select the other register bank (one instruction) to exchange all eight registers. Two nibble
opcode.
10. Exchange accumulators (one instruction) between active and passive accumulators. Two nibble
opcode.
11. Exchange ag registers (one instruction) between active and passive ag registers. Two nibble
opcode.
12. Interchange contents of accumulator and indicated register except accumulator (seven instruc-
tions). Two nibble opcode.
Next comes the selection of arithmetic instructions. Here, we follow true RISC architecture and offer
instructions for add with register, add immediate, increment by 1 and decrement by 1. No subtraction
instruction is provided as it may be implemented by two’s complement addition. Moreover, adding
immediate data is applicable only for accumulator. Note that add without carry instruction is not pro-
vided as it may be implemented by clearing the carry ag before using add with carry instruction. Based
on these considerations, following arithmetic instructions are offered:
1. Add accumulator and indicated register with carry (eight instructions). Two-nibble opcode.
2. Add immediate data with accumulator with carry (one instruction). Three-nibble instruction with
immediate data in third nibble.
3. Increment register content by 1 (seven instructions) not applicable for ag register. Two-nibble
opcode.
4. Decrement register content by 1 (seven instructions) not applicable for ag register. Two-nibble
opcode.
For logical instruction set, rotate accumulator is a must and all four rotate type instruction, i.e.,
rotate left or right and circular or through carry should be provided. Operations for AND, OR are
necessary between accumulator and any other register. For immediate data, only accumulator is suf-
cient. Note that XOR operation may be implemented through other logical operations. Therefore,
no instruction for XOR operation is provided. Instructions for complementing all eight registers and
carry ag and also clearing carry ag are accommodated. The scope of complementing any register
would make subtraction operation easier in two’s complement addition technique. Following logical
instructions may be provided:
M06_GHOS1557_01_SE_C06.indd 186M06_GHOS1557_01_SE_C06.indd 186 4/29/11 5:09 PM4/29/11 5:09 PM