You have to read my module before you proceed to the next steps.
MiniIDE
1. Open MGTEK MiniIDE. Click on 'File' and 'New'.Write your program with assembly language here. You must start with tab once. Your program should begin with 'org' which is the locations of your instructions will be stored.
3. Go to menu ‘Build’-click on ‘Set Project File’.
This 'Build' is actually an assembler. It will automatically generate list file and machine language with *.lst file and *.s19 file correspondingly. You can see the file it is generated inside the file you save your program.
Click on file with extension of *.lst and *.s19 file. s19 file is a machine code that is already translated by the assembler.
:\ECE 365 microprocessor systems\NEW\microC\SIMULATOR\SIMULATOR\ex1.lst - generated by MGTEK Assembler ASM12 V1.26 Build 144 for WIN32 (x86) - Tue Aug 03 18:10:35 2010
1: =0000800 ORG $800
2: 800 CC 983E LDD #$983E ; load accumulator d with 16bit data (D <= 983EH)
3: 803 02 INY ; increase index register y (Y <= Y + 1)
4: END
Symbols:
********************************************************************************
########################s19 file#################################
S0030000FC
S1070800CC983E024C
S9030000FC
##############################################################
SIMHC12
Assume this simulator as CPU12 complete with memory space. You have to load the machine language file because CPU can only understand the machine code, not the assembly language or else.
1. Load your machine file (*.s19) to this simulator with choose File menu and click on Load.
2. Observe that the machine language is already in the memory.
3. Set your PC to the location where your program is stored. In this case, your program is starting at address $800.
4. Use step to observe the result of the instruction step-by-step.
First 'step execute' means that the first instruction is executed. First instruction is LDD #$983E; the data $983E is loaded into double accumulator D. PC is pointed to the next instruction that is INY.
After click on 'step' again, we realise that the index register y increase to 1 from 0 value.
After click on 'step' again, we realise that the index register y increase to 1 from 0 value.
Wish you all the best.
Dear my students, you have to try without my guidance. It's an e-learning. See you in the lab. Insya Allah.
ReplyDeleteTQ MIS...
ReplyDeleteTHIS IS VERY HELPFUL