Skip to content

basic programming language influenced by assembly syntax

Notifications You must be signed in to change notification settings

valentinRyckaert/ALL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 

Repository files navigation

ALL (Assembly-Like Language)

the language still have a lot of bugs and limited functionalities, so do not expect something incredible.

Launch a file

gcc main.c -o main # compile
./main # execute

Docs

Registers

There are 8 registers:

  • rax, rbx, rcx, rdx, rex, rfx (for storing values)
  • rip (instruction pointer : which line is executed)
  • rmp (memory pointer : which memory place is pointed)

Types

ALL is dynamicly typed. Available types are:

  • integer
  • float
  • string

Others types (arrays, dictionaries...) can be done using the memory.

Basic instructions

init

set a register to a specific value

init rax 4

print

show value of a register

print 4

input

get string from user input and store the value in a register

input rax

add, sub, mul and div

basic operations on registers

add rax 4
sub rax 2
mul rax 3
div rax 2
print rax # result : 3

exit

close the program

print 'end'
exit
print "Hello World!" # not printed

comments

oneline comments

# hello

If statement

go?eq, go?bi, go?le

go to a specific line if the value equals, is bigger or less than 0

init rax 3
go?bi rax 4
print "hello" # not executed
print 'end'

Convertion

tos

converts a register which contains an integer or a float to a string

init rex 3
tos rex # rex now contains a string

toi

converts a register which contains a string or a float to a integer

init rex '3'
toi rex # rex now contains an integer

tof

converts a register which contains an integer or a string to a float

init rex 3
tof rex # rex now contains a float

Memory

store

store a value where rmp is pointing

store 5 # value 5 is stored at case number 0
add rmp 2 # case number 2
init rax rmp
store rax # value 2 is stored

load

load in a register the value where rmp is pointing

store 3
load rax
print rax # result : 3

About

basic programming language influenced by assembly syntax

Topics

Resources

Stars

Watchers

Forks

Languages