forth | stack | neum | hw | tick -> instr | struct | trap -> stream | port | pstr | prob5 | spi
Should use Forth: "An awesome stack based programming language, which is able to extend itself during runtime."
Instead of registers uses stack
Uses von Neumann architecture: instructions and data shares memory
Control unit is implemented inside model
Need to model with precision of 1 instruction
Machine code should be in high-level structured file
Input-output is stream of tokens. At the beginning there are all needed tokens
Should be special command to input and output data.
Strings should be length-prefixed
Algorithm for testing purposes: problem 5. Smallest multiple
Task: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all the numbers from 1 to 20?
+----------------+
| 00: const data |
| .. |
| n: program |
| .. | |
| .. v |
| .. |
| .. ^ |
| .. | |
| k: stack |
+----------------+
ФИО | алг | LoC | code байт | code инстр. | инстр. | такт. | вариант |
---|---|---|---|---|---|---|---|
Дзензелюк Илья Алексеевич | cat | 1 | - | 9 | 32 | 117 | forth | stack | neum | hw | instr | struct | stream | port | pstr | prob5 | spi |
Дзензелюк Илья Алексеевич | hello | 1 | - | 30 | 298 | 1557 | forth | stack | neum | hw | instr | struct | stream | port | pstr | prob5 | spi |
Дзензелюк Илья Алексеевич | hello_user | 1 | - | 40 | 231 | 1140 | forth | stack | neum | hw | instr | struct | stream | port | pstr | prob5 | spi |
Дзензелюк Илья Алексеевич | prob5 | 3 | - | 106 | 2327 | 12118 | forth | stack | neum | hw | instr | struct | stream | port | pstr | prob5 | spi |