Textmode / TMVM

Textmode's Virtual Macaroni: A VM for, er...we'll get back to you.
Other
4 stars 0 forks source link

The ISA is horrendous. #4

Open Textmode opened 13 years ago

Textmode commented 13 years ago

The Instruction Set Architecture is, frankly, horrendous. There's many obvious omissions, and numerous "magic registers". In many cases you have no choice but to work with specific registers (such as 'MOV nn, A' being basically the only defined op that places a number in any register). Its a minor miracle anything can be written at all!

Textmode commented 13 years ago

we've now documented the existing opcodes for easier review.

Textmode commented 13 years ago

I've made the mathematical Instructions MOD, DIV, SUB, MUL, and ADD have variants targeting both ACC and RET, which should alleviate some strain.

Textmode commented 13 years ago

Added alternate MOV forms: 'MOV nn,B', 'MOV &nn,B', and 'MOV B, &nn'. so A is no longer the only 'clearing house' register.

Textmode commented 13 years ago

we'll probably have to revise the conditional instructions to key off relevant flags. Its been suggested that CMP is basically a SUB that doesn't store a value. Its also been pointed out that mathematical operators generally just store their result in the first parm, rather than targeting another register.

Textmode commented 13 years ago

Its been suggested that having both an A and an ACC is unconventional and Potentially confusing.

Textmode commented 13 years ago

yeah, I'm probably going to have to cave and add a stack (and the StackSegment and StackPointer registers)

That and Call/Ret instructions. opspace Vs. code space...at 64k, codespace wins...

Textmode commented 13 years ago

Made structural changes to how opcodes are handled, it should be much easier to revise them now (should be just a matter of updating the numbers in 'opcodes.lua', and reassembling any affected asm segments)