Skip to content

Commit

Permalink
Merge pull request #6 from StevenClifford/libsup; THE NEW ARCHITECTUR…
Browse files Browse the repository at this point in the history
…E IS HERE

The ability to add 'libraries', as well as a universal bugfixing
  • Loading branch information
Stvff authored Mar 17, 2022
2 parents a889ca0 + c41e82b commit e7e2b11
Show file tree
Hide file tree
Showing 17 changed files with 835 additions and 725 deletions.
18 changes: 10 additions & 8 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,16 @@ For ease of reading, the rest of this document assumes the program is either in

`aasm` can take arguments from the shell:
```
$ aasm <statement (without spaces)> <options>
$ aasm <script> <options>
```
Good replacements for spaces are dots (`.`) and underscores (`_`).
|Option|Description|
|------|-----------|
|`-e` |Exit immediately after executing the statement that was passed as argument.|
|`-u <statefile>`|Load the designated statefile, and save to it again on exit.|
|`-b` |Sets the notation to big endian before doing anything else.|
|`-h` |Prints this table.|
|Option |Description|
|----------------|-----------|
|`-e` |Exit immediately after executing the statement that was passed as argument.|
|`-i <statement>`|Executes the designated statement. This statement can not contain spaces.|
|`-l <statefile>`|Loads the designated statefile before interpreting any statements.|
|`-b` |Sets the notation to big endian before doing anything else.|
|`-h` |Prints this table.|


## Syntax, registers and instructions
Expand Down Expand Up @@ -98,14 +99,15 @@ Registers are effectively built-in variables.
|Register|Length |Can be changed (with effect)|Description|
|--------|--------|----------------------------|-----------|
|`gr1`, `gr2`, `gr3`, `gr4`|variable|yes|The general purpose registers, intended for storing and modifying numbers.|
|`ans` |variable|yes(-ish)|Contains the number/string that was returned by the previous statement. Does not work in scripting mode.|
|`ir` |variable|yes|The index register, intended for keeping track of continuously incremented (or decremented) numbers in loops.|
|`inplen`|variable|yes|Holds the maximum length of user input.|
|`endian`|1 |yes|Holds the endianness, 0 for little endian, 1 for big endian.|
|`stacsz`|variable|yes|Holds the size of the both the main and return stack, note that both stacks will be cleared if this register is re-set.|
|`mstptr`|variable|no |Holds the main stack pointer. As the main stack grows, this number goes to zero.|
|`rstptr`|variable|no |Holds the return stack pointer. As the return stack grows, this number goes to zero.|
|`time` |variable|no |Contains the amount of seconds the previous statement took to execute.|
|`flag` |1 |yes-(ish)|It contains the result of the comparison instructions `cmp` and `scmp`.|
|`flag` |1 |yes(-ish)|Contains the result of the comparison instructions `cmp` and `scmp`.|
|`loop` |1 |yes|Holds either a `1` or `0`. Scripts loop if the register is `1` at the end of the script.|

### Instruction mnemonics
Expand Down
2 changes: 1 addition & 1 deletion .github/arbasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rules:
- symbol.operator: "([,+]|)"

## Registers
- identifier: "\\b(?i)(gr1|gr2|gr3|gr4|ir|flag|inplen|endian|stacsz|mstptr|rstptr|ptime|time|loop)(?-i)\\b"
- identifier: "\\b(?i)(gr1|gr2|gr3|gr4|ans|ir|flag|inplen|endian|stacsz|mstptr|rstptr|ptime|time|loop)(?-i)\\b"
- identifier: "\\b(?i)(qr1|qr2|qr3|qr4)(?-i)\\b"

## Constants
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ jobs:
run: make

- name: Test Linux executable
run: cd scripts/bigtest/ && ./../../aasm SCR_main.aa -e && cd ../../

run: cd scripts/bigtest/ && ./../../aasm main.aa -e && cd ../../

- name: Make Mandelbrot
run: cd scripts/mandelbrot/ && ./../../aasm main.aa -e && cd ../../

- name: Install mingw-gcc
run: sudo apt install gcc-mingw-w64-x86-64 -y

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
aasm
aasm.exe
ArbAsmlibsup/*
scripts/game_of_life/*
Loading

0 comments on commit e7e2b11

Please sign in to comment.