You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,15 @@ Ran 52 tests in 8.842s
77
77
OK
78
78
```
79
79
80
-
Check the messages generated by `make help` to learn more.
80
+
### Command Line Options
81
+
AMaCC supports the following command line options:
82
+
*`-s` : Print source and generated intermediate representation (IR)
83
+
*`-o <file>` : Create executable file and terminate normally
84
+
*`-fsigned-char` : Use signed char for char type (default is unsigned)
85
+
86
+
If no options are specified, the compiled code is executed immediately (if there were no compile errors) with any additional command line arguments passed to the program.
87
+
88
+
Check the messages generated by `make help` to learn more about build targets.
81
89
82
90
## Benchmark
83
91
AMaCC is able to generate machine code really fast and provides 70% of the performance of `gcc -O0`.
|LEA | LEA \<offset\>|add r0, r11, #\<offset> |fetch arguments inside sub function |
84
86
|IMM | IMM \<num\>|mov r0, #20|put immediate \<num\> into general register |
85
-
|JMP | JMP \<addr\>|b \<addr\>|set PC register to \<addr\>|
86
-
|JSR | JSR \<addr\>|bl \<addr\>|stores current execution position and jump to \<addr\>|
87
-
|LEV | LEV |add sp, r11, #0; pop {r11, pc} |fetch bookkeeping info to resume previous execution |
88
-
|ENT | ENT \<size\>|push {r11, lr} ;add r11, sp, #0|called when we are about to enter the function call to "make a new calling frame".It will store the current PC value onto the stack, and save \<size\> bytes to store the local variable for function.|
89
-
|ADJ | ADJ \<size\>|add sp, sp, #\<size\>|adjust the stack(to remove argument from frame) |
90
87
|LI | LI |ldr r0, [r0]|loads an integer into general register from a given memory address which is stored in general register before execution|
91
88
|SI | SI |pop {r1};str r0, [r1]|stores the integer in general register into the memory whose address is stored on the top of the stack|
92
89
|LC | LC |ldrb r0, [r0]|loads an character into general register from a given memory address which is stored in general register before execution|
93
90
|SC | SC |pop {r1}; strb r0, [r1]|stores the character in general register into the memory whose address is stored on the top of the stack|
94
91
|PSH | PSH |push {r0} |pushes the value in general register onto the stack |
|ENT | ENT \<size\>|push {r11, lr} ;add r11, sp, #0|called when we are about to enter the function call to "make a new calling frame".It will store the current PC value onto the stack, and save \<size\> bytes to store the local variable for function.|
107
+
|ADJ | ADJ \<size\>|add sp, sp, #\<size\>|adjust the stack(to remove argument from frame) |
108
+
|LEV | LEV |add sp, r11, #0; pop {r11, pc} |fetch bookkeeping info to resume previous execution |
0 commit comments