C51ASM - User guide.pdf
(
3732 KB
)
Pobierz
3710A.book
C51ASM
....................................................................................................................
User Guide
3710A–MICRO–10/10
1-2
C51ASM User Guide
3710A–MICRO–10/10
Table of Contents
Section 1
Introduction................................................................................................................. 1-1
1.1 References......................................................................................................................... 1-1
Section 2
Running the Assembler .............................................................................................. 2-1
2.1 Installation.......................................................................................................................... 2-1
2.1.1 Installation under Microsoft Windows .................................................................. 2-1
2.1.2 Installation under Linux........................................................................................ 2-6
2.2 Environment....................................................................................................................... 2-7
2.2.1 Microsoft Windows Environment ......................................................................... 2-7
2.2.2 Linux Environment ............................................................................................... 2-7
2.3 Command Line Operation.................................................................................................. 2-8
2.3.1 Output Files ......................................................................................................... 2-9
2.3.2 Command Line Options ..................................................................................... 2-10
2.4 Batch File Operation ........................................................................................................ 2-19
2.4.1 Drag–and–Drop ................................................................................................. 2-19
2.4.2 Send To Menu ................................................................................................... 2-19
Section 3
C51ASM Assembly Language ................................................................................... 3-1
3.1 Statements......................................................................................................................... 3-1
3.2 Comments.......................................................................................................................... 3-1
3.3 Symbols ............................................................................................................................. 3-2
3.3.1 Labels .................................................................................................................. 3-2
3.3.2 Predefined Symbols............................................................................................. 3-3
3.4 Constants........................................................................................................................... 3-4
3.5 Expressions ....................................................................................................................... 3-6
3.6 Segment Type.................................................................................................................... 3-7
3.7 The 8051 Instruction Set.................................................................................................... 3-9
3.8 Assembler Directives ....................................................................................................... 3-10
3.9 Assembler Controls.......................................................................................................... 3-12
3.10 Conditional Assembly ...................................................................................................... 3-14
Section 4
Macro Processing....................................................................................................... 4-1
4.1 Standard Callable Macros.................................................................................................. 4-1
C51ASM User Guide
i
3710A–MICROC–10/10
Table of Contents (Continued)
4.1.1 Defining Macros................................................................................................... 4-1
4.1.2 Calling Macros ..................................................................................................... 4-2
4.1.3 Macro Parameters ............................................................................................... 4-3
4.1.4 Local Symbols ..................................................................................................... 4-4
4.1.5 Macro Operators.................................................................................................. 4-5
4.1.6 Exiting Macro Expansion ..................................................................................... 4-8
4.2 Repeat Macros................................................................................................................... 4-8
4.3 Nested and Recursive Macro Calls.................................................................................... 4-9
4.4 Nested Macro Definitions................................................................................................. 4-10
Section 5
Assembler Directives.................................................................................................. 5-1
5.1 DB ...................................................................................................................................... 5-3
5.2 DW ..................................................................................................................................... 5-3
5.3 DS ...................................................................................................................................... 5-4
5.4 DBIT................................................................................................................................... 5-4
5.5 DEFINE.............................................................................................................................. 5-5
5.6 NAME................................................................................................................................. 5-5
5.7 ORG................................................................................................................................... 5-6
5.8 USING................................................................................................................................ 5-6
5.9 END ................................................................................................................................... 5-7
5.10 EQU ................................................................................................................................... 5-7
5.11 CODE................................................................................................................................. 5-8
5.12 DATA ................................................................................................................................. 5-8
5.13 SFR.................................................................................................................................... 5-9
5.14 BIT ..................................................................................................................................... 5-9
5.15 IDATA .............................................................................................................................. 5-10
5.16 EDATA ............................................................................................................................. 5-10
5.17 FDATA ............................................................................................................................. 5-11
5.18 XDATA ............................................................................................................................. 5-11
5.19 CSEG............................................................................................................................... 5-12
5.20 DSEG............................................................................................................................... 5-12
5.21 ISEG ................................................................................................................................ 5-13
5.22 ESEG ............................................................................................................................... 5-13
5.23 FSEG ............................................................................................................................... 5-14
5.24 BSEG ............................................................................................................................... 5-15
5.25 XSEG ............................................................................................................................... 5-15
5.26 SET .................................................................................................................................. 5-16
5.27 #UNDEF........................................................................................................................... 5-17
5.28 IF...................................................................................................................................... 5-17
5.29 IFN ................................................................................................................................... 5-18
ii
C51ASM User Guide
3710A–MICROC–10/10
Table of Contents (Continued)
5.30 IFDEF............................................................................................................................... 5-18
5.31 IFNDEF ............................................................................................................................ 5-19
5.32 IFB ................................................................................................................................... 5-19
5.33 IFNB................................................................................................................................. 5-20
5.34 #IF.................................................................................................................................... 5-21
5.35 #IFDEF............................................................................................................................. 5-22
5.36 #IFNDEF .......................................................................................................................... 5-22
5.37 .IF..................................................................................................................................... 5-23
5.38 ELSEIF............................................................................................................................. 5-23
5.39 ELSEIFN .......................................................................................................................... 5-24
5.40 ELSEIFDEF ..................................................................................................................... 5-25
5.41 ELSEIFNDEF................................................................................................................... 5-25
5.42 ELSEIFB .......................................................................................................................... 5-25
5.43 ELSEIFNB........................................................................................................................ 5-26
5.44 #ELIF ............................................................................................................................... 5-27
5.45 ELSE................................................................................................................................ 5-28
5.46 #ELSE.............................................................................................................................. 5-28
5.47 .ELSE............................................................................................................................... 5-29
5.48 ENDIF .............................................................................................................................. 5-29
5.49 #ENDIF ............................................................................................................................ 5-30
5.50 .ENDIF ............................................................................................................................. 5-30
5.51 MACRO............................................................................................................................ 5-31
5.52 LOCAL ............................................................................................................................. 5-32
5.53 ENDM .............................................................................................................................. 5-32
5.54 EXITM .............................................................................................................................. 5-33
5.55 REPT ............................................................................................................................... 5-33
Section 6
Assembler Controls .................................................................................................... 6-1
6.1 $DATE ............................................................................................................................... 6-2
6.2 $DEBUG ............................................................................................................................ 6-3
6.3 $NODEBUG....................................................................................................................... 6-3
6.4 $DEVICE............................................................................................................................ 6-4
6.5 $INCDIR............................................................................................................................. 6-4
6.6 $MACRO............................................................................................................................ 6-5
6.7 $NOMACRO ...................................................................................................................... 6-5
6.8 $MAPFSEG ....................................................................................................................... 6-6
6.9 $MOD51............................................................................................................................. 6-6
6.10 $MOD52............................................................................................................................. 6-7
6.11 $NOMOD51 ....................................................................................................................... 6-7
6.12 $OBJECT........................................................................................................................... 6-8
6.13 $NOOBJECT ..................................................................................................................... 6-8
C51ASM User Guide
iii
3710A–MICROC–10/10
Plik z chomika:
phill2k
Inne pliki z tego folderu:
AT89LP Developer Studio - User guide.pdf
(830 KB)
C51ASM - User guide.pdf
(3732 KB)
LP51SIM_WXP_v1.2.zip
(270 KB)
LP_Studio_Board.zip
(157 KB)
c51asm_win_1-1.zip
(1644 KB)
Inne foldery tego chomika:
Bascom8051
SDCC
SOFT
Zgłoś jeśli
naruszono regulamin