Thanks for all the work in Octo Jam
Though this year have been less entries but we have at least two new compilers, one for c and one for extended octo assembly, some new libraries and a hand full of new emulators. I hope the number of users will rise if we can make Mega Chip8 a replacement for Flash games. The rest ist marketing. We need new programmers, new players but also marketing professionals.
tquester
Creator of
Recent community posts
This code implements a 16 bit unsigned int library in octo. It can read and print 16 bit numbers and has the operations add, sub, mult, div and mod
https://github.com/tquester/J-Octo-Chip8-IDE/blob/main/samples/lib/libMath.8o
Currently I did not talk to John.
There is already a pre-processor that supports :include, I saw it in Timendus test suits.
The compiler is a completly re-written and supports for...next, switch..case, inline math and some commands to enable the sprite and the tile editor to find and modify the data (which is implemented currently for reading from the source code).
I do not have a pre-processor, but with compile to disassembler you can generate a source code that compiles on any octo or chipper compiler.
Later I will add command line arguments, so that compiler, disassembler, tile and sprite editor and debugger can be used without the ide or in visual studio code.
In order to do this, you need to write a 16 bit math library: addition, subtraction, multiplication, division. The first two are relativly easy, just add the low and the hight byte and add or subtract the carry bit. For multiplication you may use the russian multipication algorythm (see for example https://www.wikihow.com/Multiply-Using-the-Russian-Peasant-Method) which only works by shifting a binary number and addition. Divison works like you divide on paper. You may convert z80 assembly to chip8. For example from here: https://wikiti.brandonw.net/index.php?title=Z80_Routines:Math:Division or for 6502 (https://llx.com/Neil/a2/mult.html) with good explanation of the algorythm.
Lazy Multiplication by 10 can be done by
x = x + x ; *2
y = x
x = x + x ; *4
x = x + x ; * 8
x = x + y; * 10
You have to use your 16bit addition here and work with two registers. There is no lazy divide by 10
If you have all this, you can start decoding the number to decimal.
The last digit you get by
1. Divide by 10.
2. Multiply by 10.
3. Take difference.
Repeat this until the number is 0
You may also work the other way around.
digit1 = x / 1000
x = x / 10
digit2 = x / 100
x = x / 10
digit3 = x / 10
digit4 = x
I wrote my own compiler/ide with some language extensions: https://github.com/tquester/J-Octo-Chip8-IDE
For compatibility there is a version that compiles with https://johnearnest.github.io/Octo/