Download and install. Open program. This Welcome screen provides a summary of the software features. An assembler program is included.
We install the SDCC small device C compiler for mcu8051ide in another project. Look in the Configure menu for settings.
Open mcu8051ide DemoOpen program. Menu Project->Open Windows folder C:/Program Files (x86)/MCU 8051 IDE/demo.
The same demo files are in the Linux /usr/share/mcu8051ide.
The demo will open in Read Only mode. If you want to edit the files and work with them then copy them all to your home folder.
Click on the little rocket ship icon. We are toggling between simulator mode to run our program and editor mode to work on the code. Look closely as menus go on and off.
Menus are duplicated, same buttons on the simulator and the top menu bar. Hover over the buttons and read functions. You can single step or step backwards, reset. Animate program
Simulator PanelHover over the buttons and read the controls. Try starting and stopping, running, pausing and stepping. Animate program lets us see inside the processor but it runs slower.
Changing code means stopping the simulator and recompiling. Run program does not mean it shows you activity, a program can just run and end.
AnimateThe green line shows which instruction is being run by the chip. Look for numbers all over the panel. R0 has an incrementing value, that value is being written into memory.
Very simple code. So, let's look at it. It is organized to start from flash address 0 hexadecimal. This assembly language program is meant to run from an instruction labelled main: to a final instruction end. That makes sense.
; MCU 8051 IDE - Demonstration code
; Very simple code
; Press F2 and F6 to run the program (start simulator and animate)
org 0h
main: inc R0
inc @R0
cjne R0, #07Fh, main
mov R0, #0d
sjmp main
end
; <-- Bookmark (try Alt+PgUp/Alt+PgDown)
; <-- Breakpoint
; -----------------------------------------
; NOTICE:
; Simulator limitations:
; * SPI
; * Access to external code memory
; * Power down modes
; -----------------------------------------
; IF YOU HAVE FOUND SOME BUG IN THIS IDE , PLEASE LET ME KNOW
main: is a label on the first instruction, to increment register R0. Second instruction is to increment @R0. now it gets mathematical. R0 has a value that is counting up, @R0 is an address pointed at by R0.
There are two jumps in the program. cjne means conditional jump when not equal and sjmp simple jump to instruction. There is a big loop and a little loop running in the program.
First, a conditional jump if not equal cjneR0, #07Fh, main. If R0 has counted up to 0x7F hexadecimal the program will go to mov R0, #0d, otherwise jump back to main:
mov R0, #0d. Resets R0 back to zero, decimal. Watch R0 to R7 at the bottom of the simulator panel.
sjmpmain. Simply jumps back to the instruction labelled main: repeating the loop from 0d00 to 0x7F. We never reach end.
Look CloserMenu Virtual MCU->ShowBitarea a new panel will open showing some of the memory being written by our code. This is how an emulator or simulator shows you what your code really does.
Try some more of the assembly demo code examples. Look at the files contained in the demo folder. Explore menus and virtual hardware.
With no C compiler you will get error messages compiling your own code.
Read to see what is going on. Check results. Look for changing displays showing activity. Virtualization does slow computers down. Some warnings have tick boxes so you can proceed.
Comments
Please log in or sign up to comment.