Close

Back to the contest

A project log for Brainf*cktor

Standalone brainf*ck computer in less than 1kB of code

jaromirsukubajaromir.sukuba 01/04/2017 at 06:390 Comments

Now I'll check selected points from contest rules

January 4th now, so probably OK

My code left 10B unused out of 1024B quote (here is complete program image)

though it touches 5B of configuration bytes. I believe those are to be added to program FLASH consumption, as it is part of MCU initialization. Microchip MPLABX counts config bytes to FLASH consumption, displaying expected 1019B overall consumed.

Listing from gpasm apparently takes all config bytes as 16-bit values, indicating 1023 consumed, what is still OK.

Program Memory Bytes Used:  1023
Program Memory Bytes Free: 64513

There is some ambiguity whether and how to count the config bytes/fuses whatever you call it, but I tried to look at it from more points of view and it looks I'm under 1024B.

Notice there is single define which can include sample BF and input string into buffers. This code exceeds 1024B limit by a few dozens of bytes and isn't needed for Brainf*cktor to run - just for users convenience. Intended contest setting is with demo program off, so you can start with empty buffers, just like in the video.

Since I removed HD44780 LCD module, I have no ROM in the device. AFAIK, the PT6520 driver in my LCD module has no ROM and my character generator is software based.

Project is hosted on github as well as in files section. The github is probably more complete and up-to-date.

It contains source files for the PIC, as well as binaries. PCB files are in Eagle format, main board and keyboard being in limit of free Eagle license. PDF file with schematics is included too.

For sake of completeness, the source code is distributed as MPLABX project, being available for free with no registration/activation/whatever (just download, install and run) on Windows, Mac and Linux.

If you don't like this option, you can use open-source tools. Just copy out the main.asm source and let the gpasm (part of gputils) do the job

gpasm -p p18f26k22 main.asm
It should compile the same binary as the one generated by MPLABX. Then you can use another open-source tool to flash the binary into PIC MCU, PIC18F26K22 is among the supported types.

Discussions