Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Writing an emulator for a slightly unusual abstract FSM

Name: Anonymous 2016-05-12 15:20

what would be a relatively hassle-free way of writing an elegant, intuitive code that emulates a finite state machine (no jumps or conditionals) with a self-modifying instruction set (or maybe just two instruction sets: one for modifying data, other for modifying the first instruction set)? I don't care about performance right now (I doubt it will get to the stage when I need to care about that but if it does, some fuckery with C function pointers will be inevitable; right now I care about readability and being able to prototype quickly) so functional is OK but I'm thinking of instructions having four-bit length and I'm not sure how good purefuncs are at handling that

Name: Anonymous 2016-05-13 19:53

>>23
not genetic algorithm, although this would be one possible use for such architecture. I can think of only other one and I think you'll figure it out when I add two constraints to the mix:
- every instruction must be a bijection so that given a program and its output, it's trivial to create a program which calculates the initial input
- if this ever reaches production (>imblyign), each instruction should take equal amount of time to execute
>>24
I'm not sure if switch is a way to go here. remember, 0x012 might mean 'add 0x12' in one step of execution and 'xor 0x12' in another.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List