Dragon 12 plus 2 simple command interface on bash shell, Archlinux.
Recommended: bash 4.4+
Depends: screen, wine, wine-mono, wine_gecko
First clone the repository directory.
git clone https://github.com/jeancahu/bash-dragon-12-tool.git ~/.dragon_12
If you desire, you can use the configure script to automatically configure the tool.
./config
Otherwise, add ~/.dragon_12 directory to PATH environment variable.
PATH=$PATH:$HOME/.dragon_12
And customize the dragon_12_vars_config.sh file to your needs.
Remove script directory:
rm -ir ~/.dragon_12/
Flag | Interpretation |
---|---|
-h | Help option. |
-f <file.asm> | Indicate .asm script input. |
-l <file.lst> | Define list file out name. |
-o <file.s19> | Define object file out name. |
-a | Use asm12 to create the object file. |
-b | Send the object file to board. |
-g | Indicate program counter initial value and run program on board, 16b HEX. |
-c [STRING] | Send a char/string to serial TTY. This does not permit spaces, all string is concatenated. Control chars are: -S Space -R CarrieReturn |
-C | Send a char/string to serial TTY. This does permit spaces. Control chars are: -S Space -R CarrieReturn -E Exit loop |
-s | Run the object file with the simulator. |
-S | Open TTY serial access to communicate with board through Terminal. |
First, open a terminal to communicate over RS232 with the board.
dragon_12.sh -S
To generate the object file:
dragon_12.sh -af <name.asm> -o <name.s19>
where <name.asm> is the source assembly code. To write the object file to the board:
dragon_12.sh -bo <name.s19>
To send the value of the program counter (PC) and execute the program on the board:
dragon_12.sh -g XXXX
where XXXX corresponds to the hexadecimal value in which the execution of the program begins.
All previous steps can be executed on a single program call, by typing:
dragon_12.sh -af <name.asm> -o <name.s19> -b -g XXXX
If the name of either the object file or the list file is not specified, the program will assume the same name as the source file and will proceed to change only the suffix.
If you want to run the .s19 with the simulator you have three options:
-
If you want to open an existing object file with the simulator.
dragon_12.sh -so <name.s19>
-
If you want to assemble the .asm and run the object file generated by the assembler.
dragon_12.sh -saf <name.asm>
This will run the object file named after the .asm.
-
If you want to bring the object file a different name.
dragon_12.sh -saf <name.asm> -o <name.s19>
If you just want to run the simulator, you can type:
dragon_12.sh simulator