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

📄 asem_51.doc

📁 用芯片AT89C51做的简单的万年历
💻 DOC
📖 第 1 页 / 共 5 页
字号:
  - Create a new directory on your harddisk, e.g. C:\ASEM51.

  - Copy all files of the ASEM-51 package into this directory.

  - Append it to your PATH statement in file AUTOEXEC.BAT, e.g.

        PATH C:\DOS;C:\UTIL;C:\ASEM51

  - Reboot your PC.


II.3 Invoking ASEM
------------------
ASEM-51 provides full support of DOS command line operation and batch
capability as the best commercial development tools.   :-)
Nevertheless, it can be integrated into foreign development environments,
if desired.


II.3.1 DOS Command Line Operation
---------------------------------
ASEM-51 is invoked by typing:

ASEM <source> [<hex> [<list>]] [/INCLUDES:p] [/DEFINE:s:v:t] [/COLUMNS]

where <source> is the 8051 assembler source, <hex> is the output file in
Intel-HEX format, and <list> is the assembler list file.
The parameters <hex> and <list> are optional. When omitted, the file names
are derived from the <source> name, but with extensions HEX and LST.
All file names may be specified without extensions. In these cases, the
assembler adds default extensions as shown below:

        file             extension
        --------------------------
        <source>         .A51
        <hex>            .HEX
        <list>           .LST

If you want a file name to have no extension, terminate it with a '.'!
Instead of file names you may also specify device names to redirect the
output to character I/O ports. Device names may be terminated with a ':'!
It is not checked, whether the device is existing or suitable for the task.
Although it is possible to read the source file from a character device
(e.g. CON:) instead of a file, this cannot be recommended: Since ASEM-51
is a two-pass assembler, it always reads the source file twice!

When the /INCLUDES option is used, the assembler searches the specified
path p for include files that cannot be found in the working directory.
p may be any number of directories separated by ';' characters.
The directories will be searched from left to right.

The /DEFINE option is useful for selecting particular program variants
from the command line that have been implemented with conditional assembly.
It allows to define a symbol s with value v and segment type t in the
command line. v and t are optional. The segment type of the symbol defaults
to NUMBER, if t is omitted. The symbol value will be 0, if v is omitted.
v may be any numeric constant. t must be one of the following characters:

             C   =   CODE
             D   =   DATA
             I   =   IDATA
             X   =   XDATA
             B   =   BIT
             N   =   NUMBER    (default)

Options may be abbreviated as long as they remain unique!

Examples:

  1.)      ASEM PROGRAM

     will assemble the 8051 assembly language program PROGRAM.A51 and
     produce an Intel-HEX file PROGRAM.HEX and a listing PROGRAM.LST.

  2.)      ASEM TARZAN.ASM JANE JUNGLE.PRN

     will assemble the 8051 assembly language program TARZAN.ASM and
     produce an Intel-HEX file JANE.HEX and a listing JUNGLE.PRN.

  3.)      ASEM PROJECT EPROM.

     will assemble the 8051 assembly language program PROJECT.A51 and
     produce an Intel-HEX file EPROM and a listing PROJECT.LST.

  4.)      ASEM sample COM2: NUL

     will assemble the 8051 assembly language program SAMPLE.A51, send
     the HEX file output to the serial interface COM2 and suppress the
     list file output by sending it to the NUL device.

  5.)      ASEM APPLICAT /INC:C:\ASEM51;D:\MICROS\8051\HEADERS

     will assemble the program APPLICAT.A51, while all required include
     files will be searched first in the default directory, then in
     C:\ASEM51, and finally in D:\MICROS\8051\HEADERS.

  6.)      ASEM UNIVERSL /D:Eva_Board:8000H:C

     will assemble the program UNIVERSL.A51, while the CODE symbol
     EVA_BOARD will be predefined with value 8000H during assembly.

When program errors are detected, they are flagged on the console. This
may look as follows:


        MCS-51 Family Cross Assembler ASEM-51 V1.2

        APPLICAT.A51(14): must be known on first pass
        USERBITS.INC(6): attempt to divide by zero
        DEFINES.INC(37): symbol not defined
        APPLICAT.A51(20): symbol not defined
        APPLICAT.A51(27): no END statement found

             5 errors detected


Every error is flagged with the name of the source or include file, the
local line number where it was found, and the error message itself.
This output format makes it easy to integrate ASEM-51 into existing foreign
development environments or workbenches.
A perfect fit for the Turbo C++ IDE (and perhaps others) can be reached
with the /COLUMNS option. When specified, the column numbers of program
errors are output additionally after the line numbers:


        MCS-51 Family Cross Assembler ASEM-51 V1.2

        APPLICAT.A51(14,12): must be known on first pass
        USERBITS.INC(6,27): attempt to divide by zero
        DEFINES.INC(37,18): symbol not defined
        APPLICAT.A51(20,18): symbol not defined
        APPLICAT.A51(27,1): no END statement found

             5 errors detected


When terminating ASEM-51 returns an exit code to the operating system:

     situation                           ERRORLEVEL
     ----------------------------------------------
     no errors                               0
     program errors detected                 1
     fatal runtime error                     2


II.3.2 Running ASEM-51 in the Borland-IDE
-----------------------------------------
Turbo C++ (1.0 thru 3.0) users will appreciate the possibility to invoke
ASEM-51 as a transfer program from the Borland IDE.
For this, the filter program ASEM2MSG for the ASEM-51 error messages
has been provided. To integrate ASEM-51 into the Borland IDE, perform
the following steps:

  - Be sure that ASEM-51 has been installed properly as described before,
    or that ASEM.EXE and ASEM2MSG.EXE are somewhere in your PATH.

  - Start the Turbo C++ (or Borland C++) IDE for DOS.

  - For Turbo C++ 1.0, first click:  Options | Full menus | ON

  - Click from the menu bar:         Options | Transfer

  - When the "Transfer" dialog box is active, press the Edit button.

  - Now the "Modify/New Transfer Item" dialog box should be active.
    Fill in the following items:

         Program Title:   ASEM-~51
         Program Path:    ASEM
         Command Line:    $NOSWAP $SAVE CUR $CAP MSG(ASEM2MSG) $EDNAME /C
         Translator:      [X]
         Hot key:         Shift F8

    Then press the New button.

  - When returned to the "Transfer" dialog box, press the OK button.

  - Click from the menu bar:         Options | Save | OK

Now it should be possible, to assemble the file in the active edit
window with ASEM-51, when pressing Shift-F8. The error messages (if any)
should appear in the "Message" window. You can browse through the errors,
and jump into the source text by simply pressing <Enter>. This even works,
if the error is not in the program itself, but in an include file!

Turbo-Pascal 7.0 users can also employ their Borland IDE for assembly.
To integrate ASEM-51 into the Turbo-Pascal IDE, perform the following
steps:

  - Be sure that ASEM-51 has been installed properly as described before,
    or that ASEM.EXE and ASEM2MSG.EXE are somewhere in your PATH.

  - Start the Turbo-Pascal 7.0 (or Borland-Pascal 7.0) IDE for DOS.

  - Click from the menu bar:         Options | Tools

  - When the "Tools" dialog box is active, press the New button.

  - Now the "Modify/New Tool" dialog box should be active.
    Fill in the following items:

         Title:           ASEM-~5~1
         Program path:    ASEM
         Command line:    $NOSWAP $SAVE CUR $CAP MSG(ASEM2MSG) $EDNAME
         Hot keys:        Shift+F8

    Then press the OK button.

  - When returned to the "Tools" dialog box, press the OK button.

  - Click from the menu bar:         Options | Environment | Preferences

  - When the "Preferences" dialog box is active, disable the "Close on
    go to source" item in the "Options" checkbox. Then press the OK button.

  - Finally click from the menu bar: Options | Save

Now ASEM-51 can be invoked with Shift F8, to assemble the program in the
active edit window, while error messages (if any) appear in the "Messages"
window.

Users of both Turbo C++ and Turbo-Pascal should prefer the Turbo C++ IDE.
In the Turbo-Pascal 7.0 IDE, the /COLUMNS (or /C) option has no effect!


II.3.3 Running ASEM-51 from Windows 3.1
---------------------------------------
For integration into the Windows 3.1 desktop, the files ASEM.PIF and
ASEM.ICO have been provided. To insert ASEM-51 into a group of the
Program Manager, perform the following steps:

  - Be sure that ASEM-51 has been installed properly for MS-DOS
    as described before.

  - Start Windows 3.1 and expand the Program Manager window to its
    full screen size representation, if necessary.

  - Focus the program group in which ASEM-51 is to be inserted,
    e.g. "Applications".

  - Click from the Program Manager menu bar:   File | New

  - When the "New Program Object" dialog box is active, choose
    the option "program", and click the OK button.

  - Now the "Program Properties" dialog box should be active.
    Fill in the following items:

         Description:          ASEM-51
         Command line:         ASEM.PIF
         Working Directory:                  (whatever you want)
         Hot key:                            (whatever you want)
         as a Symbol:          [ ]

    Then press the [Change Icon] button.

  - Now a message box appears with the error message
    "no icon available for the specified file".
    Simply press the OK button.

  - The "Select Icon" dialog box should be displayed now. Fill in

         File Name:      ASEM.ICO

    and press the OK button. Now the ASEM-51 icon should be displayed
    in the icon field. Press the OK button again.

  - When returned to the "Program Properties" dialog box, press the
    OK button.

(Since I had no English Windows version to try this, things may look
 slightly different in real life.)

Now ASEM-51 can be invoked by simply clicking the ASEM-51 icon twice.
After entering the program parameters in a corresponding dialog box,
ASEM-51 is running in a DOS window, which remains open after program
termination, to let you have a look on the error messages.


II.3.4  Running ASEM-51 from BRIEF
----------------------------------
BRIEF 3.x users can integrate ASEM-51 into their editor by simply
defining another DOS environment variable in their AUTOEXEC.BAT with

         SET BCA51="ASEM %%s"

This specifies the command for compiling files with extension *.A51.
After that, ASEM-51 can be invoked from BRIEF with Alt-F10.


II.3.5  Running ASEM-51 in a UNIX Environment
---------------------------------------------
If you are running ASEM-51 on a Linux or another PC-based UNIX system
with an MS-DOS emulator, note that all executable programs of the ASEM-51
package can only read ASCII files in DOS format with CR/LF at the end of
line. Native UNIX text files with only a LF at the end of line cannot be
processed!
Consequently, all ASCII files, generated by programs of the ASEM-51
package, are written in MS-DOS format.


II.4 The HEXBIN Utility
-----------------------
Most EPROM blowers accept the Intel-HEX object file format that is output
by ASEM-51. However, for dumb EPROM blowers and special purposes it might be
useful to convert the HEX file to a pure binary image file.
For this the conversion utility HEXBIN is provided.
It is invoked as follows:

        HEXBIN <hex> [<bin>] [/OFFSET:o] [/LENGTH:l] [/FILL:f]

where <hex> is the input file in Intel-HEX format, and <bin> is the
binary output file. The parameter <bin> is optional. When omitted, the
file name is derived from the <hex> file name, but with the extension BIN.

⌨️ 快捷键说明

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