Create programming language to develop emulators
Posted: Wed Mar 16, 2011 4:44 am
Hi all.
I plan to start such task, and next write an emulator. Advantage of such language is, that it will help to write emulators easily and fast, and it will be easily to improve next.
Note the following:
- C or assembler are not good choices, since the result product will be fast, but not easy to develop!
- VHDL is also not suitable for explained aim. Main future of presented language is the it can be easily to develop, not to be easily to implement in real system.
I will give one demonstration of my idea, give some demo code:
Of course this is only pre-version of my language. Note that local variables as "arg1" and "rez" not require to declare, and also they are of "unlimited" size. If you implement the code in C you must caring about size of variables!
If someone want to help me to develop this language, please send me private message. Of course he/she must know x86 assembler (but here I hope that everybody know this).
I plan to start such task, and next write an emulator. Advantage of such language is, that it will help to write emulators easily and fast, and it will be easily to improve next.
Note the following:
- C or assembler are not good choices, since the result product will be fast, but not easy to develop!
- VHDL is also not suitable for explained aim. Main future of presented language is the it can be easily to develop, not to be easily to implement in real system.
I will give one demonstration of my idea, give some demo code:
Code: Select all
cmd add b45; // command add has opcode byte value 45
reg acc b; // define register accumulator
ref flags b;
template fl {zero_f:1;over_f:1; :6.}
func add
{arg1=get b; // Read 1 byte after IP (instruction pointer)
rez=arg1+acc; // Apply operation.
acc=rez[1b]; // Store in accumulator register l.byte of rez
flags.fl[over_f]|=rez[1b:1] // Set flag, if overflow
if(0==rez) flags.fl[zero_f]=1;
}
If someone want to help me to develop this language, please send me private message. Of course he/she must know x86 assembler (but here I hope that everybody know this).