Close

Preparing for RetroChallenge

A project log for Fungesector

A Befunge-93 interpreter which runs on x86 real mode

louis-paulLouis Paul 09/02/2024 at 01:420 Comments

Now the RetroChallenge has just begun... Oh wait, it begins on October 1st, not September 1st... Anyway, I guess there is more time to do my research about the real mode and Befunge.

I'll give some brief explanation of real mode. When you boot your computer (assuming x86 architecture and with BIOS), the default operating mode is real mode, which has 1 MB addressable memory. The reason for booting on real mode is because of backward compatibility. There are other modes (unreal mode, protected mode, long mode), but for this challenge I chose real mode because it's simpler compared to other modes, and because it has a 'real' name.

Now for the Befunge explanation. Befunge is a esoteric language which is two-dimensional, meaning that the program counter can go up, down, left or right. The language has a stack (similar to Forth), which can be manipulated using stack operations, and features a playfield, where the commands are located and executed (and can be self-modifying). The two main dialects are Befunge-93 and Funge-98, the Befunge-93 has a limit of 80x25 cells and has fewer commands compared to Funge-98, but it's easier to implement.

What happens when the real mode and Befunge-93 are blended? I'll discover this and post new project logs about the tools used to make this project, the satisfactions and frustrations I had on this project, more explanations about real mode and Befunge, and running this project on real hardware.

Discussions