ToroCraft / Minecoprocessors

Increase your redstone possibilities and learn assembly programming at the same time with the Minecoprocessors Minecraft Mod!
https://minecraft.curseforge.com/projects/minecoprocessors
GNU General Public License v3.0
33 stars 10 forks source link

Implement the DB instruction #39

Closed frodare closed 6 years ago

frodare commented 7 years ago

This will need some additional research. I am thinking when the DB instruction is assembled, it will store a the byte in the assembled program along with a label that can be used as an operand.

josephcsible commented 7 years ago

I don't think it should automatically include a label. In ”real” assembly, you put your own label before any "db"s you need them for.

frodare commented 7 years ago

OK, I think I see what you are saying. After looking around I found two ways DB is used:

var_name DB 0xff
var_name: DB 0xff

The latter one would be easier to deal with.

var_name: 
DB 0xff
DB 0xfe
MOV a, var_name
MOV b, var_name+1 ; <- how do you do label offsets?  Is that a thing?

Is this how you think it would be used, or is a label required for every DB?

josephcsible commented 7 years ago

Yes, label offsets are a thing (thankfully).

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.