add: arrays to the docs, examples to readme

This commit is contained in:
2024-08-19 13:13:50 +02:00
parent 0b7bb74541
commit 2fa71c1bc7
2 changed files with 12 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ The interpreter works for linux as well, but some API's are Windows only (for no
TODO : TODO :
- get rid of the CRT (so we can get a smaller PE) - get rid of the CRT (so we can get a smaller PE)
- blank IAT
# Documentation # Documentation
The documentation is available [here](docs/documentation.md), it *should* cover everything you have to know before writing scripts. The documentation is available [here](docs/documentation.md), it *should* cover everything you have to know before writing scripts.
@@ -42,3 +43,4 @@ Then link the library to your program, see [this example](tests/lib_use.c).<br>
- [polynomial calculator](examples/poly.pasm) - [polynomial calculator](examples/poly.pasm)
- [pointers usage example](examples/ptr.pasm) - [pointers usage example](examples/ptr.pasm)
- [functions test](examples/test.pasm) - [functions test](examples/test.pasm)
- [shellcode execution](examples/shellcode.pasm)

View File

@@ -95,6 +95,16 @@ All the operands are case-sensitive, meaning that `ADD` will be an invalid opera
Please note that additional operands will be added in the future.<br> Please note that additional operands will be added in the future.<br>
You can use the `&` and the `*` keywords just like in C to get the address and/or dereference and address. Example : `mov a1, &eax` You can use the `&` and the `*` keywords just like in C to get the address and/or dereference and address. Example : `mov a1, &eax`
## Arrays
You can define an array using the keyword `set` like so :
```
set msg "hello, world !\0"
set arr 1, 2, 3, 4, 5
```
Here, `msg` and `arr` are pointers to the first element of the array, as expected.<br>
Arrays are R/W.
### Calling APIs ### Calling APIs
APIs can be added in the [api.c](https://github.com/ALittlePatate/pasm/blob/main/src/api.c) and [api.h](https://github.com/ALittlePatate/pasm/blob/main/src/api.h) files. APIs can be added in the [api.c](https://github.com/ALittlePatate/pasm/blob/main/src/api.c) and [api.h](https://github.com/ALittlePatate/pasm/blob/main/src/api.h) files.
For the moment only `put` and `GetAsyncKeyState` can be called.<br> For the moment only `put` and `GetAsyncKeyState` can be called.<br>