My Master Project... a virtual operating environment

Started by
12 comments, last by PnP Bios 19 years, 10 months ago
You can probably save yourself the trouble of having separate instructions if you just have a flag in the instruction specifying immediate values or memory. Read up in the Intel IA-32 manual, volume two, (chapter two?) on the instruction format. x86 uses flags coded in the instruction itself (mod r/m byte, SIB) to distinguish between registers, memory, and immediate values. You can probably design something similar to that.
Advertisement
Duke, do you mean like instruction 1000123A and 1000123B would be the same instruction, just handling the operation different? or am I way off base?
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
hmmmmmm
got distracted while looking for IA-32. Bochs. hmmm.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
quote:Original post by PnP Bios
Duke, do you mean like instruction 1000123A and 1000123B would be the same instruction, just handling the operation different? or am I way off base?


Exactly. They can have the same mnemonic, but the assembler or compiler decides which way to code the instruction to hex based on the operands. Just like you can use the MOV instruction with a register/memory/immediate value. The assembler decides what kind of data youre using and codes the instruction appropriately.

I used to use Bochs during my OS development days. Its pretty useful. You can play old dos games on it too .

This topic is closed to new replies.

Advertisement