logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·31.10.26
← Back to news

How I developed an Am29000 C compiler and web browser

Original article
nanochess.org|49 points|5 comments|by nanochess|Aug 16, 2026

The Genesis of an Am29000 C Compiler and Web Browser

By Oscar Toledo G.

Following my previous account of building a windowed OS using 32-bit machine code for a custom Am29000-based computer, I want to detail the creation of a C compiler and a web browser for that same architecture.

🕰️ A Snapshot of the Era

The development took place between the Christmas of 1998 and my birthday in 1999. At 20 years old, I was witnessing a whirlwind of cultural and technological shifts:

  • In Mexico: The Internet was expanding rapidly.
  • In Cinema: Bruce Willis was thwarting an asteroid apocalypse, and Arnold Schwarzenegger was hunting demons in End of Days.
  • In Society: New careers for graphic designers were booming, and the world was gripped by Y2K\text{Y2K}Y2K anxiety (the "digital armageddon"), a fear even satirized by The Simpsons.

🛠️ The Struggle with Machine Code

By 1997, I had already produced several utilities and printer drivers (supporting the HP DeskJet 500 and achieving color prints on the Epson Stylus 600). I had even mastered sending and receiving faxes via a modem card.

Everyone used to ask for your fax number to send ads or info. By the following year, that trend had vanished entirely.

However, coding exclusively in machine code was an exhausting process.

"It was like doing a deep dive in muddy water. Unless you had a dive mask—meaning meticulous notes on addresses and documentation—you were bound to get lost."

The mental overhead was immense. I faced constant challenges:

  • Planning memory layouts with extreme precision.
  • Shifting existing code to create space for new features.
  • Relocating jumps without introducing catastrophic bugs.

To cope, I often inserted sequences of 5 to 10 NOP (No Operation) instructions to allow for future expansion, and some routines ended up completely out of place because they simply wouldn't fit in their original slots.


🌐 The Cybercafé Quest

I spent a lot of time at "cybercafés," including one across from the (now closed) Bazar Pericoapa. We surfed the web to a soundtrack of:

  1. "Ciega, sordomuda"
  2. "Amor de papel"
  3. "Laura no esta"
  4. "Barbie girl"

Note: The café eventually stopped serving coffee after too many espressos were spilled on the keyboards.

While searching for Am29000 resources, I discovered two options: the High-C 29k compiler (unaffordable) and GCC v2.8.1. The GCC option was impossible for my hardware:

RequirementGCC v2.8.1My Hardware
RAM≥2 MB\ge 2 \text{ MB}≥2 MB512 KB512 \text{ KB}512 KB
OS SupportHighMinimal (Assembler/Linker only)

🏗️ Bootstrapping the Compiler

I refused to port two massive programs just for a single use, so I looked toward a previous project: my C compiler for the Transputer.

The Architectural Hurdle

The Am29000's register-heavy architecture was a stark contrast to the Transputer. In my single-pass compiler, register assignment was tricky. I needed a logic where: Variable→{Local Registerif simpleMemoryif indirection is used\text{Variable} \rightarrow \begin{cases} \text{Local Register} & \text{if simple} \\ \text{Memory} & \text{if indirection is used} \end{cases}Variable→{Local RegisterMemory​if simpleif indirection is used​

The Timeline of Attempts

  1. December 1997: I attempted to port Small-C. It was an utter failure and disappeared from my logs.
  2. February 2, 1998: I installed DJGPP (a GCC port for MS-DOS) on an 80486 PC. I couldn't use the Transputer for this as it only had 128 KB128 \text{ KB}128 KB of RAM. I owe a great debt to DJ Delorie for providing a free, working C++ compiler for DOS when others were prohibitively expensive.
  3. May 6, 1998: I took my Transputer C compiler source and successfully compiled it using DJGPP, replacing non-standard I/O with standard C library functions.

💾 Version Control via Floppy

Lacking professional tools, my "Source Code Control System" was simply copying files to a floppy disk.

Floppy Disk Image Placeholder The disk containing the progression of my compiler.

This disk held two evolved Transputer compilers and the first iteration of the Am29000 compiler.

The Expression Tree Logic

The compiler utilized a set of arrays to manage the expression tree:

  • nodo_izq[]: Pointers to left nodes.
  • nodo_der[]: Pointers to right nodes.
  • oper[]: Node values/operators.
  • esp[]: Node types.

This meant complex expressions were limited by the array size. You can find this in my git repository under the cc0 directory.

Code Implementation of crea_nodo:

++ultimo_nodo; 
if(ultimo_nodo == TAM_ARBOL) { 
    error("Expresión muy compleja"); 
    cancela(); 
} 
nodo_izq[ultimo_nodo] = izq; 
nodo_der[ultimo_nodo] = der; 
oper[ultimo_nodo] = op; 
esp[ultimo_nodo] = val; 
regs[ultimo_nodo] = 0; 
regsf[ultimo_nodo] = 0;