dis interpreter - report 4

10 views
Skip to first unread message

alexandre....@gmail.com

unread,
Aug 6, 2013, 6:28:00 PM8/6/13
to plan9...@googlegroups.com
Hello again

There's been a lot of head-banging against my desk this week. Apparently half my stuff is inadequate for one reason or another when faced with GC or even some supposedly trivial nuances. Many low-level things that are straight-forward in C, like the address-of operator (&), or really, most memory-based functionalities heavily conflict with the abstraction layer I'm trying to work with. As a result, my project is following more and more the existing interpreter.

Rather than interpret/execute assembly or object code, I need to first build a Dart representation of the code segment from whichever source, and give it a memory interface for the Dis code. I wanted to do it directly, but it has lead to very ugly code, and horrible program structure.

Technically, the assembler currently works for all instructions and addressing modes, but it will need to be adapted a bit to follow the new design.

The generated functions now get their operands much like the C code, by accessing fields on the R variable. Now they're simpler, and I gained an abstraction level as a bonus, thanks to Dart's getters/setters. An additional file is now generated from the DSL, that creates an object representing each Dis instruction's argument order & type.

Reply all
Reply to author
Forward
0 new messages