Assembler for H831 CPU in Minecraft.
This repository hosts the assembler for H831 CPU in minecraft, which converts the assembly code to native binary file for H831. The compiled binary is expected to be stored in the program ROM (PROM) of the H831 CPU.
Note that the program ROM (PROM) has only 2716b. Make sure the size your compiled program is less than that.
usage: h8as.py [-h] [-o OUT_FILENAME] IN_FILENAME MAPFILE
positional arguments:
IN_FILENAME File for assembly program
MAPFILE Microcode descriptor file
optional arguments:
-h, --help show this help message and exit
-o OUT_FILENAME File for assembler output
IN_FILENAME
: The program code for H831 in assembly.MAPFILE
: The Instruction Decode Descriptor file (Since there is no instruction decoder in that CPU)- If you download this repository, the
MAPFILE
would beconfig/ucode.map
. It is a text file.
- If you download this repository, the
OUT_FILENAME
: The filename for the compiled binary file.- The program will output the binary line-by-line regardless of having this parameter specified.
The following examples assumed that you have changed your working directory to the downloaded repository folder.
python3 h8as.py demo/memtest.asm config/ucode.map -o memtest.bin
python3 h8as.py demo/15x17.asm config/ucode.map
Check out "h831 Assembly Programming Guide", or download it in pdfdocs/h831 Assembly Programming Guide.pdf
.
Use hfpt.py
.
-
Compile the binary first. Subsititude your filenames in angled brakets.
python3 h8as.py <assembly code file> config/ucode.map -o <binary>
-
Run flash programming tool to generate a mcfunction file, which is used to program the computer easily. You will get a
romflash.mcfunction
file.python3 hfpt.py <binary>
-
Make sure the datapack prototype for hfpt is installed.
-
Subsititude the
romflash.mcfunction
in the datapack. Reload your world using/reload
. -
Stand on the programming spot and run these commands
![2020-09-20_22.49.30](README.assets/2020-09-20_22.49.30-0613393.png)
/function hfpt:romerase /function hfpt:romflash
-
Your program should be up and running after you have turned on the PC (Program counter).
Component | Revision | Date |
---|---|---|
Microcode/Pin layout | dev-a2e | 2020-09-02 |
Assembler | dev-a5e | 2020-09-05 |
Flash Programming Tool | dev-a1 | 2020-09-05 |