[7] HC89S003F4 development board to establish assembly project

HC89S003F4 development board to establish assembly project

I. Introduction

There is documentation to achieve ASM & C mixed programming in the supporting information, the establishment of a full project templates compiled according to this method can be derived.

Second, to achieve mixed programming ASM & C

  • 1, open Keil project, click Open HC89S003F4.h header file and defined sfr16 DPTR = 0x82;block or delete.

image

  • 2, select the need to embed compiled .C file, then right-click and then select Options For Filein the option box will pop Generate Assembler SRC Fileand Assemble SRC Filechecked black.

image

  • 3, look at the current project Memory Model, as an example of engineering Small,

image

  • 4, 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 - Small model no floating point operations
    C51C.LIB - no floating point operations Model Compact
    C51L.LIB - no floating point operations Model Large
    C51FPS.LIB - Small Model with a floating-point operations
    C51FPC.LIB - with floating point operation Model Compact
    C51FPL.LIB - Large Model with floating point
    add is completed as shown below:

image

  • 5, where the need to embed the assembler added #pragma asmand the #pragma endasmtwo lines of code written in the corresponding assembler to between two lines of code.

image

Third, the generated assembly project

  • Main.SRC file will be generated in the Project \ Objects folder after compilation, the compiled file the same name as main.asm.

image

  • Adding the project delete main.c main.asm, you can compile.

image

Guess you like

Origin www.cnblogs.com/yywBlogW/p/11372650.html