Computer Architecture Lab/WS2007/diogenes tools

Assembler Syntax
The Assembler of Diogenes is generated using YACC and LEX. It supports simple jump (call) labels that might either be a string or a number followed by a semicolon. To jump to a label a branch instruction like brz (branch on zero) is followed by a semicolon and the label name. Unlike Branches jumps (and calls) are always absolute jumps, that jump to the address stored in a register. As jump addresses are 32 Bit wide and only 8 Bit Load Immediate instructions are available on diogenes, four instructions are needed to load Jump addresses: But the assembler supports the builtin macro LDL (Load Label) that can be used to write the above in yust one line: Furthermore LDL supports the loading of 32 Bit Label Addresses: For more details see Instruction Set and  Assembler Examples.

Assembler usage
The assembler binary is just called asm. It reads from stdin and writes to stdout. By default it produces a file suitable for direct download via the serial link. But with the parameters -h and -b it generates its output in hexadizimal respectively ACSII-coded binary format, that were use during development of the bootloader.

Simulator Usage
The simulator expects its first parameter to be the name of a binary (downloadable) file. It generates its output to stdout, while stderr is used for debugging purposes (as far as the simulator is compiled with USE_DEBUG=1). So a common call of the simulator binary would look something like

Simulation of the VGA port
The Simulator is capable of simulating the output of the VGA port. Every few emulated cycles (for example every 40000) a snapshot of the display is stored in a file called picXXXX.tga where XXXX is a n increasing number. A demonstration of this feature can be seen here.

Transfer Utility
We made a simple utility that sends binary files to the target. It can be found in the download section in the simulator.tar.gz file. It reads from stdin and writes /dev/USB0 which is what we use for our serial cable.