added v2.0

This commit is contained in:
Michael Schröder
2023-01-11 11:13:09 +01:00
parent 2a5a64ca91
commit 971b323822
584 changed files with 159319 additions and 0 deletions

View File

@@ -0,0 +1 @@
../GPIO.jack

View File

@@ -0,0 +1,11 @@
class Main{
function void main() {
while(true){
do GPIO.writeLed(GPIO.readLed()+1);
do Sys.wait(1);
}
return;
}
}

View File

@@ -0,0 +1,18 @@
all: jack vm asm bin sim
jack:
../../tools/JackCompiler/JackCompiler.pyc ./
vm:
../../tools/VMTranslator/VMTranslator.pyc ./
asm:
../../tools/Assembler/assembler.pyc out.asm
bin:
../../tools/AsciiToBin.py out.hack
sim:
cp out.hack ../00_HACK/ROM.hack
upload:
iceprogduino -o 64k -w out.bin
clean:
rm -f *.vm *.asm *.hack *.bin *~
.PHONY: all clean

View File

@@ -0,0 +1,46 @@
## Sys.jack
A library that supports various program execution services.
**Hint:** To debug the next projects in real hardware, we can implement one or both of the following strategies into `Sys.jack`
1. Use LED to indicate the state of JACK-OS according to
| LED[1:0] | Sys.jack | JACK-OS state |
| -------- | -------------- | ---------------------------------- |
| 00 | at entry | nothing happened yet |
| 01 | Sys.init() | start execution of Main.main() |
| 10 | Sys.halt() | Main.main() terminated succesfully |
| 11 | Sys.error(int) | a system error occured |
2. We can use UART to send some chars according to the state of JACK-OS. e.g. send "GO" at `Sys.init()`, "HALT" at `Sys.halt()` and "ERR" at `Sys.error(int)`.
***
### Project
* Implement `Sys.jack`
* Test in simulation. Change the delay time in `Main.jack` to 1ms.
```
$ cd 03_Sys_Test
$ make
$ cd ../00_HACK
$ apio clean
$ apio sim
```
* Check, if the LED toggles every 1 milli second:
![](sys.png)
* run in real hardware. Set the delay to 1s = 1000ms with `Sys.wait(1000)` in `Main.main()`.
```
$ cd 03_Sys_Test
$ make
$ make upload
```
* Check if the LED change state every 1 second.

View File

@@ -0,0 +1,40 @@
## Sys.jack
A library that supports various program execution services.
***
## Project
* Implement `Sys.jack`
* Test in simulation. Change the delay time in `Main.jack` to 1ms.
```
$ cd 03_Sys_Test
$ make
$ cd ../00_HACK
$ apio clean
$ apio sim
```
Check, if the LED toggles every 1 milli second:
![](sys.png)
* run in real hardware. Set the delay to 1s = 1000ms with `Sys.wait(1000)` in `Main.main()`.
```
$ cd 03_Sys_Test
$ make
$ make upload
```
* Check if the LED change state every 1 second.
**Hint:** To debug the next projects in real hardware, we can implement one or both of the following strategies into `Sys.jack`
1. Use LED to indicate the state of JACK-OS according to
|LED[1:0]|Sys.jack |JACK-OS state |
|------|-|-------|
|00 |at entry|nothing happened yet|
|01 |Sys.init()|start execution of Main.main()|
|10 |Sys.halt()|Main.main() terminated succesfully|
|11 |Sys.error(int)|a system error occured|
2. We can use UART to send some chars according to the state of JACK-OS. e.g. send "GO" at Sys,init(), "HALT" at Sys.halt() and "ERR<digit>" at Sys.error(int).

View File

@@ -0,0 +1 @@
../Sys.jack

View File

@@ -0,0 +1 @@
../UART.jack

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB