Hello, MG here. I'm working on what functions to include in the ALU stage right now. I want to reduce the number of ops, but honestly I'm not sure what to get rid of. e.g. the nimplies ops.
BTW the following is a rough draft. In no way is this the finished list XP
BTW the following is a rough draft. In no way is this the finished list XP
Code:
Key: [word], {opcodes/arguments}, (generated words)
[{if}{3-bit flag address}] [{jump address}]
[{jump}] [{jump address}]
[{call}] [{function address}]
[{prog}] [{program address}]
[{return}]
[{halt}]
[{read}{3-bit peripheral addr}] [{8-bit address}]
[{ptr}{3-bit ptr address}]
[{register}{reg address}]
[{const}] [{8-bit immediate}]
[{pop}]
[{add}{to reg address}]
[{a-b}{to reg address}]
[{b-a}{to reg address}]
[{xor}{to reg address}]
[{xnor}{to reg address}]
[{or}{to reg address}]
[{nor}{to reg address}]
[{and}{to reg address}]
[{nand}{to reg address}]
[{a nimplies b}{to reg address}]
[{b nimplies a}{to reg address}]
[{!a}{to reg address}]
[{SHR}{to reg address}]
[{ptrW}{ptr address}]
[{write}{address}]
------------------------------------------------
general pipeline:
1. Branch processing block:
[{if}{3-bit flag address}] [{jump address}]
[{jump}] [{jump address}]
[{call}] [{function address}]
[{return}]
[{halt}]
2. Read processing block:
[{read}{3-bit peripheral address}] [{8-bit address}]
[{ptr}{3-bit ptr address}]
3. ALU processing block:
Loading to ALU:
[{register}{reg address}]
[{const}] [{8-bit immediate}]
({const}) ({8-bit immediate}) // converted from [{read}{}] instruction
[{pop}]
ALU ops:
[{add}{to reg address}]
[{a-b}{to reg address}]
[{b-a}{to reg address}]
[{xor}{to reg address}]
[{xnor}{to reg address}]
[{or}{to reg address}]
[{nor}{to reg address}]
[{and}{to reg address}]
[{nand}{to reg address}]
[{a nimplies b}{to reg address}]
[{b nimplies a}{to reg address}]
[{!a}{to reg address}]
[{SHR}{to reg address}]
Misc:
({if}{3-bit flag address})
Write ops:
Push to write block:
[{ptrW}{ptr address}] (a reg as physical address) (b reg as peripheral address)
if a & b registers loaded, and no other ops have been executed:
Push to write block:
[{write}{peripheral address}] (a reg as value) (b reg as address)
else:
[{write}{to reg address}]
4. Write processing block:
({write}{peripheral address}) (value) (address)
({ptrW}{ptr address}) (physical address) (peripheral address)