lowbyteproductions / 16-Bit-Virtual-Machine

Code for the "16-Bit Virtual Machine" Series
https://www.youtube.com/watch?v=fTBwD3sb5mw&list=PLP29wDx6QmW5DdwpdwHCRJsEubS5NrQ9b
200 stars 18 forks source link

QUESTION: something about ADD/ROR #20

Open kktos opened 3 years ago

kktos commented 3 years ago

Hi Francis,

I noticed there's no status register. Therefore no carry. How can we do a more-than 16bits addition ? How can we do a ROL/ROL ?

Cheers.

lowbyteproductions commented 3 years ago

Hey @kktos - the status register (or flags as I've planned to call it) will be added soon, and thus carry/overflow will be observable. I'm also planning on adding an adc add with carry instruction, and a few additional branching instructions that operate based on the flags register, rather than the contents of the accumulator.

I hadn't planned on adding rotate instructions - but there'll very likely be space left over in the end, so it might happen. Rotating manually should be possible but would take about 5 op 6 instructions (I didn't work the exact sequence out).