Keil Logo

CSEG Assembler Statement

Arguments
CSEG 〚AT address
Description

The CSEG statement selects an absolute segment within CODE space.

If the optional address is included, the assembler starts the absolute segment from that address. The valid address range is 0000h-0FFFFh.

If the optional address is omitted, the assembler starts the absolute segment from address 0 (if no prior absolute CODE segment was defined). If an absolute CODE segment was previously defined, the assembler continues from the end of that segment.

Note

  • The start address must be an absolute expression.
  • The AX51 Assembler converts CSEG statements into the following:
    ?CO?modulename?n SEGMENT OFFS address
    

    Where

    modulename is the name of the source file.
    n is a sequential number.
    address is the address specified in the CSEG statement.
See Also

BSEG, CODE, DSEG, ISEG, XSEG

Example
        CSEG    AT 0003h        ; absolute code segment
                                ; at address 0x3
VECT_0: LJMP    ISR_0           ; jump instruction for the
                                ; interrupt vector location

        CSEG    AT 0x100        ; absolute code segment
                                ; at address 0x100
CRight: DB      "(C) MyCompany" ; copyright string at
                                ; fixed location

        CSEG    AT 1000H        ; absolute code segment
                                ; at address 0x1000
Parity_TAB:                     ; table named Parity_TAB
        DB      00H             ; fixed encoding for
        DB      01H             ; parity information
        DB      01H
        DB      00H
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.