KyteLabs CrossAssemblers - Online User Manual Last modified: 2005-03-04 (14366)

Table of Contents

  1. Introduction
  2. Platform Specific Concerns
    1. Using the Mac Version
    2. Technical Data
  3. Command Line Options and Job Files
  4. Mnemonics
  5. Labels and Symbols
  6. Target Specific Details
    1. The AS80C52 Assembler for the 8051 Family
    2. Assembler Directives
    3. Operators
    4. Predefined Symbols - Bits & Bytes
    5. Special Function Registers
  7. Appendix
  8. Known Bugs and Shortcomings
  9. Release and Revision History
  10. Legalese and Support

Introduction

This manual describes the operation and use of the KyteLabs CrossAssemblers for various 8-bit targets and running on different platforms.
Currently supported target microprocessors and embedded controllers are the Motorola 6809, 68HC11, Intel 8048, 8051 family, and Zilog Z8. Future versions will include the Atmel AVR RISC and the Fairchild ACEx microcontrollers.

Platform Specific Concerns

Most chip manufacturers are supporting only the mainstream hardware and software platform and there are virtually no technical development tools available on the Mac, a few more for Linux systems. So the KyteLabs CrossAssemblers are actually aiming at embedded systems designers and hobbyists, thinking of it to be desirable to work on a Mac or a Linux powered workstation.
The current software development on the assembler projects is using the Mac as the reference platform, with plans for expansion to Linux.

Using the Mac Version

Since the assembler has got no graphic user interface or IDE (Integrated Development Environment) on the Mac platform (yet), it supports simply dropping the source file onto the application's icon.
The best approach will be to organize your project using a top level source file, eventually including additional sources inside. The assembler accepts all kinds of file types and creators, so you can use the text editor of your own choice to work on the source files.
An other way is to use a job file simulating multiple invocations of the assembler even with command line parameters. If you double-click the AS80C52 icon, the program starts looking for a file named AS80C52.JOB where it assumes further instructions.
The assembler is provided in a working environment with lots of example code and some test projects.

Technical Data

The crossassembler written in ANSI C, has been ported to the Think C 6.0 environment for the Macintosh. Using a more recent C compiler, the console interface produced unpredictable screen output, thus making the program unusable.
Internal memory allocation is fixed. So it's of no use to increase the external memory partition via the Finder. The symbol table allows a maximum of 2999 entries, the macro text buffer holds 16 KB of text. The reason of these limits lie in the platform independency of the source code and the limited system integration. The OS is only involved in detecting the dropped file, the rest is done by the standard ANSI C runtime library.

Command Line Options and Job Files

Originating from the early versions of the program running on command-line-oriented operating systems, these options have been made available on the Mac platform by using a job file. Alternatively most options can be adjusted inside the source code by the OPT directive too, so using command line parameters is not essential.
The AS80C52 assembler's help page shows an overview:

 Command:  AS80C52  <source file> [+|-<options>]
 Defaults:              *.ASM       +GLSU +B=0
 OPTIONS WITHOUT PARAMETERS:
 +?  Show help page.                  -L  Suppress listing if no errors.
 -B  No object file generated.        +M  Show macro expansion.
 +C  Show Conditioning.               -P  No page formatting.
 -G  No multiple code lines.          -S  No symbols in object file.
 +H  H/L byte sex using DW.           -U  Force upper-case folding.
 OPTIONS WITH PARAMETERS:
 +B=S     Generate object file in following format:
          S=M Motorola, S=I Intel, S=NN binary file for NN K size EPROM.
 +A=SSSS  Assign string SSSS to assembler parameter &A.
 +D=N     Debug mode N=1: Show PC destination address.
 +R=NN    Reduced symbol length NN characters.
 +T=NN    Tabulator steps.
 +W=NNN   Listing characters per line.
 +X=HHHH  Define external symbol with value HHHH.
 +Z=NNN   Listing lines per page.

Mnemonics

can be written in upper or lower case (not case-sensitive). Normally all mnemonics specified in the chip manufacturers' official programming manuals are supported.

Labels and Symbols

The assembler is case-sensitive in labels and symbols, so xyz is different from XYZ. Symbol discrimination is done within the first 16 characters.
(To be compatible with older assemblers there is an option to force all characters to upper case, but do not use it for new projects. It can be confusing!).

Target Specific Details

The AS80C52 Assembler for the 8051 Family

Assembler Directives

Operators

Predefined Symbols - Bits & Bytes

Support of all internal register and bit names corresponding to the classical Intel 8051, 8052, 80C51, and 80C52 hardware description are provided.
Declarations of other derivatives have to be included as specific assembly source code, as there are sometimes conflicting definitions of names. The file sfr.d, being part of the complete package and containing information about the Special Function Registers of many known members of the 8051 family, can be used as a template to enable the definitions of a dedicated 8051 derivative to be targeted.

List of predefined symbols inherent to AS80C52:

List of Predefined Byte Names

Byte
Name
Byte
Address
Description Resident
in
P080Port 0All
SP81Stack PointerAll
DPL82Data Pointer, Low ByteAll
DPH83Data Pointer, High ByteAll
PCON87Power Control RegisterAll
TCON87Timer/Counter 0/1 Control RegisterAll
TMOD89Timer/Counter 0/1 Mode Control RegisterAll
TL08ATimer 0 Register, Low ByteAll
TL18BTimer 1 Register, Low ByteAll
TH08CTimer 0 Register, High ByteAll
TH18DTimer 1 Register, High ByteAll
P190Port 1All
SCON98Serial Port Control RegisterAll
SBUF99Serial Data BufferAll
P2A0Port 2All
IEA8Interrupt Enable RegisterAll
SADDRA9Serial Address Register80C52
P3B0Port 3All
IPB8Interrupt Priority RegisterAll
SADENB9Serial Address Enable Mask Register80C52
T2CONC8Timer/Counter 2 Control Register8052/C52
T2MODC9Timer/Counter 2 Mode Control Register80C52
RCAP2LCATimer/Counter 2 Reload/Capture Register, Low Byte8052/C52
RCAP2HCBTimer/Counter 2 Reload/Capture Register, High Byte8052/C52
TL2CCTimer 2 Register, Low Byte8052/C52
TH2CDTimer 2 Register, High Byte8052/C52
PSWD0Program Status Word RegisterAll
ACCE0Accumulator RegisterAll
BF0B RegisterAll

List of Predefined Bit Names

Bit
Name
Bit
Address
Description Register
 88-8FTimer/Counter Control RegisterTCON
IT088External Interrupt 0 Type Control BitTCON.0
IE089External Interrupt 0 Edge FlagTCON.1
IT18AExternal Interrupt 1 Type Control BitTCON.2
IE18BExternal Interrupt 1 Edge FlagTCON.3
TR08CTimer 0 Run Control BitTCON.4
TF08DTimer 0 Overflow FlagTCON.5
TR18ETimer 1 Run Control BitTCON.6
TF18FTimer 1 Overflow FlagTCON.7
 98-9FSerial Port Control RegisterSCON
RI98Receive Interrupt FlagSCON.0
TI99Transmit Interrupt FlagSCON.1
RB89AReceived Serial Bit 8SCON.2
TB89BTransmitted Serial Bit 8SCON.3
REN9CReceive Enable BitSCON.4
SM29DSerial Mode Specifier Bit 2SCON.5
SM19ESerial Mode Specifier Bit 1SCON.6
SM09FSerial Mode Specifier Bit 0SCON.7
 A8-AFInterrupt Enable RegisterIE
EX0A8External Interrupt 0 Enable BitIE.0
ET0A9Timer 0 Interrupt Enable BitIE.1
EX1AAExternal Interrupt 1 Enable BitIE.2
ET1ABTimer 1 Interrupt Enable BitIE.3
ESACSerial Port Interrupt Enable BitIE.4
ET2ADTimer 2 Interrupt Enable BitIE.5
-AE(reserved)IE.6
EAAFEnable All Interrupts BitIE.7
 B8-BFInterrupt Priority RegisterIP
PX0B8External Interrupt 0 Priority BitIP.0
PT0B9Timer 0 Interrupt Priority BitIP.1
PX1BAExternal Interrupt 1 Priority BitIP.2
PT1BBTimer 1 Interrupt Priority BitIP.3
PSBCSerial Port Interrupt Priority BitIP.4
PT2BDTimer 2 Interrupt Priority BitIP.5
-BE(reserved)IP.6
-BF(reserved)IP.7
 C8-CFTimer/Counter 2 Control RegisterT2CON
CP_RL2C8Capture/Reload FlagT2CON.0
C_T2C9Timer or Couter Select BitT2CON.1
TR2CAStart/Stop Control Bit for Timer 2T2CON.2
EXEN2CBTimer 2 External Enable FlagT2CON.3
TCLKCCTransmit Clock FlagT2CON.4
RCLKCDReceive Clock FlagT2CON.5
EXF2CETimer 2 External FlagT2CON.6
TF2CFTimer 2 Overflow FlagT2CON.7
 D0-D8Program Status Word RegisterPSW
PD0Parity FlagPSW.0
F1D1User Definable Flag 1PSW.1
OVD2Overflow FlagPSW.2
RS0D3Register Bank Select Control Bit 0PSW.2
RS1D4Register Bank Select Control Bit 1PSW.4
F0D5User Flag 0PSW.5
ACD6Auxiliary Carry FlagPSW.6
CYD7Carry FlagPSW.7

Release and Revision History

Date
(Version#)
Target Platform Remarks
1999-11-15
(12430.03)
AS80C52
(8051
Family)
Mac First release to the public. Internationalized version based on English language with Preliminary User Manual supplied.
1999-11-21
(12436.01)
AS80C52
(8051
Family)
Mac Enhanced version supporting Intel Hex object file output. New online user manual provided, now platform independent by using HTML.

Known Bugs and Shortcomings

Mac platform: There is a chance that the assembler will get stuck while opening a source file, if there is very low system memory left. The reason is unknown and there is no other workaround than to have some free memory around. Increasing the memory partition of the program does not help.

Automatically generated local labels (especially in macros) are not yet implemented.
Workaround: Use the SET directive to define labels as volatile symbols.

Legalese and Support

The KyteLabs CrossAssembler is supplied free for your personal use and you may redistribute the program, but you may not charge for it in any way nor include it with any product that is sold. But you may use it for delevoping commercially sold software. The program and included source code examples are for educational and evaluation purposes only, no responsibility is taken over that all is working correctly. Efforts are taken to do bug fixes, so reports are appreciated.
Support is offered via email: support@kytelabs.de

[Top of Document] - [Table of Contents]