by Chris Careaga
Register-based VM, and debugger written in C, and a stack-based VM written inside the first.

In its current state, useless is a register-based virtual machine written in C. It has 24 instructions and uses an assembly language smiliar to x86 assembly. After creating useless, I wanted to test it's effectiveness. In order to do this I wrote an even simpler VM that runs inside of useless called even-more-useless VM (emuvm). EmuVM is a very simple stack-based virtual machine written entirely in the language of the useless VM. Along the way I also created a debugging command-line called udb. It displays registers, the stack, and the current line and supports typical debugging commands such as break, continue, step and print.

mv &src a
call print_reverse

exit

$print_reverse
    eq 0 *a
    hopt rev_ret

    add 1 a
    call print_reverse
    print *a

    $rev_ret
        sub 1 a
        ret

$src
    "\nI am useless"
Information updated 12/27/19
Note: This entry has not yet been moderated.
View Comments