Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/new gifs - update gifs + pngs to match new fj cli command, new debugger, .. #265

Merged
merged 4 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ fj hello_world.fj
![Hello World in FlipJump](resources/hello.gif)

- The --no-stl flag tells the assembler not to include the standard library. for example: `fj programs/print_tests/hello_no-stl.fj --no-stl`.
- the -w [WIDTH] flag allows compiling the .fj files to a WIDTH-bits memory width. WIDTH is 64 by default.
- You can use the -o flag to save the assembled file for later use too.
- the `-w [WIDTH]` flag allows compiling the .fj files to a WIDTH-bits memory width. WIDTH is 64 by default.
- You can use the `-o` flag to save the assembled file for later use too.
- you can find all the different flags with `fj -h`.

You can also **[Test the project](tests/README.md#run-the-tests)** with the project's tests, and with your own tests.
Expand Down
15 changes: 11 additions & 4 deletions flipjump/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The assembler has 4 steps:
- writing the binary data into the executable ([fjm_writer.py](fjm/fjm_writer.py)).

The whole process is executed within the [assemble()](assembler/assembler.py) function.
![Assembly of calc.fj](../resources/calc__asm.jpg)
![Assembly of calc.fj](../resources/calc__asm.png)

- The [ops.py](assembler/inner_classes/ops.py) file contains the classes of the different assembly ops.
- The [expr.py](assembler/inner_classes/expr.py) file contains the expression class (Expr), which is the code's representation of the assembly mathematical expressions. The expressions are based on numbers and labels.
Expand All @@ -22,7 +22,7 @@ The Interpreter ([fjm_run.py](interpretter/fjm_run.py)) stores the entire memory

The whole interpretation is done within the [run()](interpretter/fjm_run.py) function (also uses the [fjm_reader.py](fjm/fjm_reader.py) to read the fjm file - i.e. to get the flipjump program memory from the compiled fjm file).
More about [how to run](../README.md#how-to-run).
![Running the compiled calculator](../resources/calc__run.jpg)
![Running the compiled calculator](../resources/calc__run.png)

### The Debugger

Expand Down Expand Up @@ -72,8 +72,15 @@ for example: f1:32:rep6:hex.print---f2:17:print_bit---print_label
the short_file_name is (by default) s1,s2,s3,... for the standard library files (in the order of [stl/conf.json - all](stl/conf.json)),
and f1,f2,f3,... for the compiled .fj files, in the order they are mentioned to the compiler (or appear in the test-line).

You can place breakpoints to stop on specific labels using the `-d`, followed by a `-b` and a label name (or `-B` and a part of a label name). For example:
![Debugging Demo](../resources/breakpoint.jpg)
You can place breakpoints to stop on specific labels using the `-d`, followed by a `-b` and a label name. You cal also use `-B` instead of `-d` in order to stop on all labels that contain a substring.

For example stopping on the label "start":
![Debugging Demo](../resources/breakpoint.png)
Read memory (You can read the memory as if it was flipjump variables):
![Debugging Demo](../resources/debug_read_memory.png)
Notice that `:b8:ascii` is 0x36, which is the ascii of `'6'`, which was the input to the program:
![Debugging Demo](../resources/debug_read_memory_result.png)


## More Files

Expand Down
Binary file removed resources/breakpoint.jpg
Binary file not shown.
Binary file added resources/breakpoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/calc__asm.jpg
Binary file not shown.
Binary file added resources/calc__asm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/calc__run.jpg
Binary file not shown.
Binary file added resources/calc__run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/debug_read_memory.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/debug_read_memory_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/hello.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/sum.gif
Binary file not shown.
6 changes: 3 additions & 3 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ To add a new test, create your .fj programs, and you predefined input and expect
Then choose the relevant csv file.
The rule of thumb (for the sum of compile+run times, in seconds):

| fast | medium | slow |
|--------------|--------------|------|
| 0 → 0.5 | 0.5 → 5 | else |
| fast | medium | slow | hexlib |
|--------------|----------------|------|----------------|
| 0 → 0.2 | 0.2 → 0.7 | 0.7+ | tests `ns hex` |

Then add a new line to the relevant compile-csv and run-csv files, according to the next formats.

Expand Down