Many thanks for all the assistance - Flax is now running and ODIN made it easy

Hi Everyone,

I must say that I am absolutely loving ODIN. Best regards to @gingerBill for such an incredible achievement.

I’ve spent most of my career writing assembly code, in fact my first job was writing assembly language compilers back in the DOS days.

I have to say I have never clicked with another language in the way that I have with ODIN. Currently I’m working on a platform agnostic Assembly compiler and runtime engine, for use in education and possibly as the backend to a game engine. Yesterday I finally got everything to the point of being able to compile and run some assembly code though there is lot more work to be done. The performance is incredible, and is orders of magnitude faster than any previous version I’ve written and I’ve written a lot of assembly compilers and engines for education and personal use.

Below is a little example of the assembly code. This is mostly for use in education for teaching low level programming concepts without the danger of writing native code which could brick the machine. In this example we’re using a 6502 style subset, but by changing the pattern’s file we can choose any instruction set we like. This new version when complete will also be available for anyone to use for personal use.

I’ll reveal the name when I’m ready… :slight_smile:

;Hello World - Example
.debug false

_start:
	lda #0
	sta b

mainLoop:
	lda myMsg, b
	jz end
	out
	lda b
	inc
	sta b
	jp mainLoop

end:
	brk

.db myMsg, "Hello, ODIN World!"

I’ve also just bought @karl_zylinski book on ODIN which I look forward to reading. I am also an author of a number of sci-fi / fantasy and super natural books.

As a special thanks to everyone in the ODIN community for the help and support all my books are now available for free on the Apple iBooks Store, under my pen name Trig Charters. If you wanted to donate anything toward them there is a PayPal link at the end of each book, though it’s not expected.

https://books.apple.com/au/book/blood-lines/id6752360059

All other books can be found off this link. If you don’t have access to the Apple iBooks Store, message me and I’d gladly email you any or all of the books…

As soon as I can find the link I’ll be donating toward ODIN as well.

As I’ve said, apart from assembly, never before have I clicked with a language the way I have with ODIN.

My best to you all.

Kindy

Ryn
(Trig Charters Pen Name)

1 Like

Managed to get about half the assembly op codes in and running today, so the above assembly now works, which I’ve updated to say ODIN not Godot, which I was experimenting with by recoding much of Godot in assembly. Was a fun exercise but not a trivial one if I was to keep it updated with every change.

I’m using the below make script and was hoping someone might be kind enough to have a look and suggest any improvements. I realise that ODIN doesn’t need much which I love.

#!/bin/sh

if [ -e "flax" ]; then
    rm flax
fi

odin build . -o:speed -no-bounds-check -vet-unused-imports -vet-unused-variables

if [ -e "flax" ]; then
    ./flax speedtest.flax
    exit 0
else
    echo "Build Failed"
    exit 1
fi

The goal with the project, this year is performance. The best we ever achieved using another language was about 145.000.000 assembly instructions per second. Using the exact same assembly code in the ODIN based engine we’ve achieved over 700.000.000 million assembly instructions per second. That in itself is enough for us to stay with ODIN from now on. Love @karl_zylinski book btw.

Kindly

Ryn

2 Likes