Assemblitor is a light-weight editor for a simple dialect of Assembly.
Easily write, edit and execute your code in a visual user inteface that comes with some quick tools to help you develop.
- Python 3.10+
- Pillow 10.0.0+
Open "Assemblitor/Assemblitor.pyw" to start the program.
This Assembly dialect is a low-level column-oriented programming language that is close to machine code. It is case-insensitive.
The language consists of a sequence of memory cells (MCs) that can store values or commands. Each MC starts with its address and ends with a line break. The MCs have to be in increasing order but empty ones don't have to be displayed. A value has to be stored after the address as an integer. An empty MC will be interpreted as having a value of 0. A command is also stored after the address, with most of them requiring operands to work. Comments can be made with a semicolon. All text between the semicolon and the next line break will be ignored by the computer.
The program orients itself to the architecture of a von Neumann processor. This means it takes usage of the program counter (PC), the accumulator (ACC) and the instruction register (IR). The PC is set to 0 by default. If the program is executed, the command at the address stored in the PC will be loaded into the IR. There the command can be executed. After its execution the PC gets increased by one (excluding jumps and stops) and the next command can be loaded into the IR.
A simple program may look like this:
00 LDA #4 ; load the value 4 into the ACC
01 STA 04 ; store the value of the ACC into the 4th MC
02 STP ; stop the program
This would be the result after executing the program:
00 LDA #4
01 STA 04
02 STP
04 4 ; a stored value
A list of all accepted commands:
STP
stops the programLDA n
loads the value at MC n into the ACCLDA #n
loads the value n into the ACCLDA (n)
loads the value of the MC that has the address that is stored in MC n into the ACCSTA n
stores the value of the ACC into MC nADD n
adds the value at MC n to the value of the ACC and stores the result into the ACCADD #n
adds the value n to the value of the ACC and stores the result into the ACCADD (n)
adds the value of the MC that has the address that is stored in MC n to the value of the ACC and stores the result into the ACCSUB n
subtracts the value at MC n from the value of the ACC and stores the result into the ACCSUB #n
subtracts the value n from the value of the ACC and stores the result into the ACCSUB (n)
subtracts the value of the MC that has the address that is stored in MC n from the value of the ACC and stores the result into the ACCMUL n
multiplies the value at MC n by the value of the ACC and stores the result into the ACCMUL #n
multiplies the value n by the value of the ACC and stores the result into the ACCMUL (n)
multiplies the value of the MC that has the address that is stored in MC n by the value of the ACC and stores the result into the ACCJMP n
jumps to MC n by setting the PC to nJZE n
jumps to MC n by setting the PC to n if the value of the ACC is equal to zeroJLE n
jumps to MC n by setting the PC to n if the value of the ACC is less than or equal to zero
The editor consists of a menubar, a toolbar and the two code blocks. Write your Assembly program in the left code block and execute it by clicking the green button on the left of the toolbar. You will find your executed code in the right code block. Use the orange button to execute one step at a time. If you want to adjust addresses or operands, you can use the de-/increment tool found right to the execution buttons on the toolbar. Simply select the code you want to change and click the blue buttons. You can adjust the step size through the spinbox and which numbers it should affect with the option menu.
F5
– Run programShift + F5
– Run single stepCtrl + Z
– Undo changeCtrl + Shift + Z
– Redo changeCtrl + Y
– Redo changeCtrl + Backspace
– Delete whole wordShift + Enter
– Line break without addressShift + Tab
– Switch affected numbersShift + Scroll up
– Increment affected numbersShift + Scroll down
– Decrement affected numbersCtrl + N
– New fileCtrl + O
– Open fileCtrl + R
– Reload fileCtrl + S
– Save fileCtrl + Shift + S
– Save file as
- will default to Editor.save_as() when using Editor.save() after aborting one Editor.save_as()
- tkinter.messagebox.askyesnocancel() buttons don't adjust to program language and will instead use the OS language
The whole project is rooted in and inspired by an old Delphi emulator used by my school at that time. In fact, the Assembly dialect is almost exactly the same, with a few added conveniences and a more open spacing/commenting syntax.
Found a bug? Tell me on GitHub. You can also contribute by suggesting features and translating Assemblitor to another language.