Skip to content

Commit

Permalink
Merge pull request #265 from tomhea/feature/new-gifs
Browse files Browse the repository at this point in the history
Feature/new gifs - update gifs + pngs to match new `fj` cli command, new debugger, ..
  • Loading branch information
tomhea authored Dec 11, 2023
2 parents 67436d3 + 2a4ad02 commit ab0c1b8
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 9 deletions.
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

0 comments on commit ab0c1b8

Please sign in to comment.