⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asmlnk.doc

📁 很少见的源码公开的msc51和z80的c编译器。
💻 DOC
📖 第 1 页 / 共 5 页
字号:
                .       as a 16-bit word expression,                .       the high-order byte will be truncated.                .       Multiple expressions must be        THE ASSEMBLER                                          PAGE 1-18        GENERAL ASSEMBLER DIRECTIVES                expn    separated by commas.           The  .byte  or .db directives are used to generate successive        bytes of binary data in the object module.          1.4.6  .word and .dw Directives         Format:                  .word   exp             ;Stores the binary value                .dw     exp             ;of the expression in                                        ;the next word.                        .word   exp1,exp2,expn  ;Stores the binary values                .dw     exp1,exp2,expn  ;of the list of expressions                                        ;in successive words.                where:  exp,    represent expressions that will occupy two                exp1,   bytes of data. Each expression will be                .       calculated as a 16-bit word expression.                .       Multiple expressions must be                expn    separated by commas.           The  .word  or .dw directives are used to generate successive        words of binary data in the object module.          1.4.7  .blkb, .blkw, and .ds Directives         Format:                  .blkb   N       ;reserve N bytes of space                .blkw   N       ;reserve N words of space                .ds     N       ;reserve N bytes of space           The  .blkb  and .ds directives reserve byte blocks in the ob-        ject module;  the .blkw directive reserves word blocks.          1.4.8  .ascii Directive         Format:                  .ascii  /string/         where:  string  is a string of printable ascii characters.                  /  /    represent   the  delimiting  characters.   These                        delimiters   may   be   any   paired    printing                        characters,  as  long  as the characters are not                        contained within  the  string  itself.   If  the        THE ASSEMBLER                                          PAGE 1-19        GENERAL ASSEMBLER DIRECTIVES                        delimiting  characters  do not match, the .ascii                        directive will give the (q) error.          The  .ascii  directive  places  one binary byte of data for each        character in the string into the object module.          1.4.9  .ascis Directive         Format:                  .ascis  /string/         where:  string  is a string of printable ascii characters.                  /  /    represent   the  delimiting  characters.   These                        delimiters   may   be   any   paired    printing                        characters,  as  long  as the characters are not                        contained within  the  string  itself.   If  the                        delimiting  characters  do not match, the .ascis                        directive will give the (q) error.          The  .ascis  directive  places  one binary byte of data for each        character in the  string  into  the  object  module.   The  last        character in the string will have the high order bit set.          1.4.10  .asciz Directive         Format:                  .asciz  /string/         where:  string  is a string of printable ascii characters.                  /  /    represent   the  delimiting  characters.   These                        delimiters   may   be   any   paired    printing                        characters,  as  long  as the characters are not                        contained within  the  string  itself.   If  the                        delimiting  characters  do not match, the .asciz                        directive will give the (q) error.          The  .asciz  directive  places  one binary byte of data for each        character in the string into the object module.   Following  all        the  character  data  a  zero  byte is inserted to terminate the        character string.          THE ASSEMBLER                                          PAGE 1-20        GENERAL ASSEMBLER DIRECTIVES        1.4.11  .radix Directive         Format:                  .radix  character         where:  character  represents  a single character specifying the                        default radix to be used for succeeding numbers.                        The character may be any one of the following:                          B,b     Binary                                O,o     Octal                        Q,q                                D,d     Decimal                        'blank'                                H,h     Hexidecimal                        X,x        1.4.12  .even Directive         Format:                  .even            The .even directive ensures that the current location counter        contains an even boundary value by adding 1 if the current loca-        tion is odd.          1.4.13  .odd Directive         Format:                  .odd            The  .odd directive ensures that the current location counter        contains an odd boundary value by adding one if the current  lo-        cation is even.          THE ASSEMBLER                                          PAGE 1-21        GENERAL ASSEMBLER DIRECTIVES        1.4.14  .area Directive         Format:                  .area   name    [(options)]         where:  name    represents the symbolic name of the program sec-                        tion.   This  name  may  be  the  same  as   any                        user-defined  symbol  as  the area names are in-                        dependent of all symbols and labels.                  options specify the type of program or data area:                          ABS     absolute (automatically invokes OVR)                         REL     relocatable                         OVR     overlay                         CON     concatenate                         PAG     paged area            The .area directive provides a means of defining and separat-        ing multiple programming and data sections.   The  name  is  the        area  label used by the assembler and the linker to collect code        from various separately assembled modules into one section.  The        name may be from 1 to 8 characters in length.             The options are specified within parenthesis and separated by        commas as shown in the following example:                  .area  TEST  (REL,CON)  ;This section is relocatable                                        ;and concatenated with other                                        ;sections of this program area.                        .area  DATA  (REL,OVR)  ;This section is relocatable                                        ;and overlays other sections                                        ;of this program area.                        .area  SYS   (ABS,OVR)  ;(CON not allowed with ABS)                                        ;This section is defined as                                        ;absolute. Absolute sections                                        ;are always overlayed with                                        ;other sections of this program                                        ;area.                        .area  PAGE  (PAG)      ;This is a paged section. The                                        ;section must be on a 256 byte                                        ;boundary and its length is                                        ;checked by the linker to be                                        ;no larger than 256 bytes.                                        ;This is useful for direct page                                        ;areas.        THE ASSEMBLER                                          PAGE 1-22        GENERAL ASSEMBLER DIRECTIVES           The  default  area type is REL|CON;  i.e.  a relocatable sec-        tion which is concatenated with other sections of code with  the        same area name.  The ABS option indicates an absolute area.  The        OVR and CON options indicate if program  sections  of  the  same        name  will overlay each other (start at the same location) or be        concatenated with each other (appended to each other).             Multiple  invocations  of  the  .area directive with the same        name must specify the same options or leave  the  options  field        blank,  this  defaults  to  the previously specified options for        this program area.          The   ASxxxx   assemblers   automatically  provide  two  program        sections:                  '.  .ABS.'      This dumby section contains all absolute                                symbols and their values.                  '_CODE'         This  is  the default program/data area.                                This program area is of type (REL,CON).         The  ASxxxx  assemblers  also automatically generate two symbols        for each program area:                  's_<area>'      This is the starting address of the pro-                                gram area.                                  indent  -16  'l_<area>'      This is the                                length of the program area.          1.4.15  .org Directive         Format:                  .org    exp         where:  exp     is  an absolute expression that becomes the cur-                        rent location counter.          The  .org directive is valid only in an absolute program section        and will give a (q) error if used in a relocatable program area.        The  .org  directive specifies that the current location counter        is to become the specified absolute value.          THE ASSEMBLER                                          PAGE 1-23        GENERAL ASSEMBLER DIRECTIVES        1.4.16  .globl Directive         Format:                  .globl  sym1,sym2,...,symn         where:  sym1,           represent legal symbolic names. When                sym2,...        When multiple symbols are specified,                symn            they are separated by commas.           A  .globl directive may also have a label field and/or a com-        ment field.             The  .globl directive is provided to define (and thus provide        linkage to) symbols not  otherwise  defined  as  global  symbols        within  a  module.   In  defining  global  symbols the directive        .globl J is similar to:                J == expression or J::             Because  object  modules  are linked by global symbols, these        symbols are vital to a program.  All internal symbols  appearing        within  a  given program must be defined at the end of pass 1 or        they will be considered undefined.  The assembly directive  (-g)        can  be  be  invoked to make all undefined symbols global at the        end of pass 1.          1.4.17  .if, .else, and .endif Directives         Format:                  .if     expr                .                       ;}                .                       ;} range of true condition                .                       ;}                .else                .                       ;}                .                       ;} range of false condition                .                       ;}                .endif           The  conditional  assembly directives allow you to include or        exclude blocks of source code durin

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -