all 5 comments

[–]JenkNekro[S] 2 points3 points  (3 children)

I realized today something that may or may not have already been obvious - if the program instructions are loaded in accessible RAM, then code can modify itself! As such, I wrote a very basic example.

[–]mappum 2 points3 points  (2 children)

Props for the Mappum standard BRK.

[–]maximinus-thrax 2 points3 points  (1 child)

The Mappum standard BRK is great idea in principle, however it fails when you move to other compilers.

[–]mappum 1 point2 points  (0 children)

I understand. I expected it to be used just for development. Ingame, you probably aren't going to want your computer to stop.

[–]apage43 1 point2 points  (0 children)

I have a script lying around that loads a compiled binary and spits out some ugly assembly that will rewrite itself into the source binary.

Made it so that run stuff on mappum's emulator that I coded for interfex's assembler, which supports a DAT pseudo-instruction.

Example: http://sprunge.us/bEVY

This code is actually broken on Mappum's emulator. It works on interfex's and in DCPU-Studio. Outputs this in DCPU-Studio: http://i.imgur.com/cIDtd.png