C²
Jump to navigation
Jump to search
- This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
- This is still a work in progress. It may be changed in the future.
Simple low-level assembly-like programming language that focuses on being easy to "parse"
Example:
label _start: othervar: charget othervar+1: charget othervar+2: charget othervar: atoi 3 ; 3 bytes string (3 chars) myvar: set 3 myvar: add 9 myvar: add othervar myvar: itoa 2 3 ; 2 byte integer (16 bit) to 3 chars myvar: outchar myvar+1: outchar myvar+2: outchar var myvar [3]u8 ; 3 byte array var othervar [3]u8 ; 3 byte array
Example with macros (redefines the add macro defined in the stdlib):
macro (var pt->u8compatible) add (val imm=u8compatible): #switch arch #=bf @raw "$*var*$*times val char +*$:*val*$" #=x86 @raw "add $*var*$, *val*" #=ezbrain @raw "do $*var*$ byteOp 0 add *val*" #else #- @error "inc macro does not support architecture" label _start: myvar: add 3 var myvar u8