>Cpu_2
Last Edit: April 19, 2022, 3:16 a.m.
Assembler
This page will go over the program assembler for my cpu design in more detail.
/Assembler features:
on each line
- Variables are words that start wtih a $
- If alone on a line (in which case the address is defined sequentially at the end of the program space)
- If followed with a number that line will be the memory address for that variable.
- Can be used as operands for any instruction.
- Labels are words that start with a :
- Can be used as operands for any instruction.
- Instructions are the first non-whitespace non-reserved (not $ or :) words on a line.
- Operands are listed on the same line separated by whitespace.
Output is the verilog .mem format with one address per line starting at address 0 and increasing by one each line.
It also outputs a .dbg file which has extra columns for the memory address, memory value, where each instruction ended up, and where the labels are used.