archived forum

Please login or register.

Login with username, password and session length
Advanced search  

News: forum restored.  registration disabled.  thanks to xboxexpert for the db dump and netham45 for cleaning it up!

Author Topic: Canonic Assembler  (Read 145 times)


  • Guest
Canonic Assembler
« on: April 10, 2007, 05:35:14 AM »

Minidash (and probably other independant software) will be able to relocate, pre-process and execute programs written in canonic assembler.

What's that?

In mathematics, 'canonic' means 'simplest' (can't reduce it more).
Main interest of canonic assembler is to allow to write interpreted code.
The Canonic Engines (interpreters) are easy to implement quickly.
You lose speed (10 up to 100 times slower than compiled native code), but you save research & development time, especially when you are trying to design a driver on a recently hacked environment, because you just need...  notepad. Micro-codes uploaded in co-processors are NOT slowed down...
Relocation and symbol pre-processing is performed directly from text file.

1 instruction per line
1 character per instruction name
1 operand per instruction

Here is the syntax details (kept voluntarily short) :

It may still evolve (but I doubt). I'm currently studying xbox360 homebrew to see if it needs adjustments (probably some 32 bits aliases for the 128 bits port addresses).
(and when the current 'curse' gets lifted from the PS3 scene, I will examine PS3 homebrew too...)

A very clean "hello world" program would look like this :


//reserve space for 2 labels, 1 local and 1 global

//global register (stores line number in debug mode)

//unified api functions IDs

//code entry point

    S'Hello world'

//activate debug mode 1 from here


//turns off debug mode

A smaller but dirtier version would look like this :


    S'Hello world'

More samples (ogg vorbis decoder, already tested successfully on pc0) and more explanations will come when Minidash v0.1 will be released...

Edited by openxdkman, 28 March 2009 - 10:49 PM.



  • Guest
Canonic Assembler
« Reply #1 on: April 13, 2007, 09:06:37 AM »

Here is a program that calls printf and draws a sinus function (fpu used).
There are plenty of useless global variables and constants just to show you syntax.


//0N,L+G :10 labels, 10 local registers + 10 global registers
//First char of first line must be '0' in canonic code

//Global macros (max 32500 chars in global macros string at any time)

// Global macros used as registers names:
// Each new pre-processing starts with global macro string "...=<L-1>"
// Next vars will start automatically at value L (see "0N,L+G")
// First global register can receive source line at run time for debug
// Second and third global register can be used as references as well

// Global macros used as constants:

// Global macros used as unified api function IDs


// Global macros used as structures members offsets:

//Labels (max 32500 chars in labels macros string at any time)
//Compels incoming label 'main' to have value zero (code entry point)
//(allows you to put 'main' function code at bottom of file)

//Constant strings
S'Hello world %ld %04lx %s'

//let's ask for debug information (0=none, 1=report g_line)








//turns off debugging mode (faster execution for code after this line)

//keyboard scancodes for getch
//0x01 escape
//0x1c enter
//0x39 space
//0xc8 up
//0xd0 down
//0xcb left
//0xcd right

Edited by openxdkman, 10 June 2007 - 10:04 AM.


Page created in 0.64 seconds with 14 queries.