HC89S003F4 development board to establish assembly project
Select the file compiled
- @ Selected development board flashing routines, the routine will remove the extra notes, generated after the file would be more intuitive.
#define ALLOCATE_EXTERN
#include "HC89S003F4.h"
void Delay_ms(unsigned int fui_i)
{
unsigned int fui_j;
for(;fui_i > 0;fui_i --)
for(fui_j = 1596;fui_j > 0;fui_j --);
}
void main()
{
WDTCCR = 0x00;
CLKSWR = 0x51;
CLKDIV = 0x01;
P0M0 = P0M0&0xF0|0x08;
while(1)
{
P0_0= 0;
Delay_ms(1000);
P0_0= 1;
Delay_ms(1000);
}
}
Setting generate an assembly file
Select main.c, then right-click and then select Options For File
in the option box will pop Generate Assembler SRC File
and Assemble SRC File` check black
The re-establishment project
- 1, will generate main.SRC file in Project \ Objects folder after compilation, the compiled file the same name as main.asm.
- 2, depending on the compilation mode, in KEIL installation directory under the table keil \ c51 \ lib \ in selecting the appropriate library files added to the project.
C51S.LIB - no floating point operations Small model
C51C.LIB - no floating point operations Compact model
C51L.LIB - Large model no floating-point operations
C51FPS.LIB - Small model with floating-point operations
C51FPC.LIB - Compact model with floating-point operations
C51FPL.LIB - Large model with floating-point operations
After the addition was complete as shown below:
- 3, adding the project delete main.c main.asm, you can compile.
Achieve results
- led flashing