build 6 RC 2
Full Changelog: build6RC1...build6RC2
NewASM Release Notes
Welcome to NewASM: an interpreted low-level programming language which combines explicit memory and register control, giving it a breeze of assembly-like feel, with high-level functionalities such as objects, threads and more.
- Version:
build 6 RC
NOTE: This is a pre-release which means that this product version doesn't represent the final quality of the product - it may contain bugs and problems that aren't yet discovered.
What's new
- Added the new
tupledatatype! Basically an array that can hold any data.
.$using %ios
.data
tuple mytuple: () ; empty tuple
.start
mov tlr, mytuble(0) ; access the tuple value at a specific index
mov tlr, (43, 1.7, "Hi") ; or set `tlr` to be a tupleTuples can be only one-dimensional.
In order to update the specific index inside a tuple, you have to use the new lea instruction:
lea &tuple_name, 0 ; numeric index
mov tlr, some_value
stor tlr, &tuple_name ; just update the value at index 0In order to completely change the tuple, just set the specific register to a tuple:
mov tlr, ("ey", 67, 1.2, 'a')
stor tlr, &tuple_name ; change the whole tupleTo expand the new tuple functionality, new kernel module has been introduced, %tuple.
| Module | ID | Arguments | Description |
|---|---|---|---|
%tuple |
1 |
tlr |
tlr is a pointer to a tuple. Stores the size of a tuple inside the tlr register. |
- Added the new register dereferencing operator
*:
mov tlr, *stl ; set tlr to a value of stlWhat's changed
- Since we added tuples, also known as dynamic objects, standard object syntax has been changed to:
mov tlr, member @ object ; old syntax
mov tlr, object{member} ; new syntax to match tuple(index)To change the value of a member inside an object, just add the ampersand:
stor tlr, &object{member}- Performance of the virtual machine was improved with custom JIT compiler that compiles your code to bytecode before it is executed.
Fixed issues
- We've been focused on code optimisation.
Important notes
- Tuple management can be only done with the
tlrregister.
Building from source
- Use the following command to compile your own build of
NewASM; make sure that you have G++ installed:
C:\path_to_your_compiler\g++ -static -std=c++20 index.cpp -o index.exe- If you are using Windows Subsystem for Linux, use the following command:
wsl g++ -m32 -static -std=c++20 index.cpp -o index.outDownloading
- Download one of the following archives that suits your system. Once you have downloaded it, extract the archive into a folder of your choice and begin using the application.
Using the application
- Use the following command to execute your
NewASMprograms on Windows:
newasm -input yourfile.asm- If you are on Linux, just add the
.outextension:
./newasm.out -input yourfile.asmWriting your first NewASM app
- Create the file named
yourfile.asm, or just name it whatever you like, and edit it with an editor of your choice:
.$using %ios
.data
txt string : "Hello world!"
num len : $-string
.start
mov tlr, string
mov stl, 0c1
mov bos, len
mov fdx, 1
sysenter %ios
syscall
ret 0Output:
Hello world!