During this week when the RetroChallenge has started, I added more functionality to the Befunge-93 interpreter. The editor page now accepts input to enter simple code and to execute it press F5 key, I implemented the basic commands to print the string enclosed in double quotes, and the commands to change the program counter flow.
As I said, I'm developing the interpreter using 8086 assembly, I'm not using C language or another high-level language. The reasons are:
- To have more control of code and avoid high-level overhead;
- To make it easier to debug the code;
- Choice of the x86 calling convention (I'm using the Borland Turbo Pascal calling convention).
The 8086 assembly isn't that hard, considering that's a CISC processor, which means the processor has single instructions that can execute various operations.
Even that the Befunge-93 is limited to 80x25 cells and has only one stack, it's powerful enough to write interesting programs, like Hunt the Wumpus or Game of Life. Remember the mantra Fetch-Decode-Execute for parsing the individual commands.
The fun I'm having on building the interpreter is the concept of 8086 assembly and real mode on one side and an esolang on the other side. I'm learning more about the memory segmentation, the various BIOS interrupts of video and keyboard and the commands of Befunge-93.
Here is a video where I enter the example code and press F5 key to execute it:
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.