BIG 8051 Manual
32
Coding the Simulator
Above the assembly code window, you will see the toolbar depicted below. Either select “New” to begin
a new assembly or “Load” to import an existing one
Once a program has been written or loaded, select either “Assm” or “Run” to execute it. If the simulator
identifies any errors in the code, the program will not run, and a message will appear indicating where
the problem originated
“Assm” is used to manually step through the code and observe the individual steps. Once it has
been clicked, the button will change to “Step” and must be pressed repeatedly to advance the
program one line of code at a time
“Run” will run the program all the way to the end without stopping. At any point, the user may
pause the program by clicking the button again.
3) If you wish to stop the program from running entirely, select “RST”. This will end the program and allow
you to make modifications or simply begin the program again
4) When finished, you can save your code as a
.asm
by clicking save, which will allow you to import your
work at a later time
Sample Code:
1) A simple program to display binary values from 0 to 255 on the LEDs (
note, since the simulator considers
logic 0 to be ‘lit’ for the LEDs, the program must decrement instead of increment
)
main:
DEC P1
;decrement instead of increment because logic 0 lights the LEDs
JMP main
2) A Program to mirror the 8 push buttons onto the corresponding LEDs
main:
MOV P1, P2
;move values on buttons into the LEDs
JMP main