본문 바로가기
나머지/IT개발.잡다한것.

usb boot, 0xc0, RSEG, SEGMENT

by 무늬만학생 2012. 9. 27.
반응형

 if ((WORD)&DeviceDscr & 0xC000)



fx2 datasheet

During the power-up sequence, internal logic checks the I2C

port for the connection of an EEPROM whose first byte is

either 0xC0 or 0xC2. If found, it uses the VID/PID/DID values

in the EEPROM in place of the internally stored values (0xC0),

or it boot-loads the EEPROM contents into internal RAM

(0xC2). If no EEPROM is detected, FX2LP enumerates using

internally stored descriptors. The default ID values for FX2LP

are VID/PID/DID (0x04B4, 0x8613, 0xAxxx where xxx = Chip

revision).




RSEG Assembler Statement


Arguments RSEG segment

Description

The RSEG statement selects a relocatable segment that was previously declared using the SEGMENT state


Example

MYPROG  SEGMENT CODE     ; Declare the segment

        RSEG    MYPROG   ; Select the segment


http://www.keil.com/support/man/docs/a51/a51_st_rseg.htm


SEGMENT Assembler Statement


Arguments segname SEGMENT class [relocation [alignment]]

Description


The SEGMENT statement declares a generic segment along with memory class and segment location options.


Where


segname specifies the symbol name to assign to the segment. This symbol is references by subsequent RSEG statements. It may also be used in expressions to represent the base or starting address of the combined segment.

class is the memory classification for the segment. The class specifies the memory space where the segment is located.

relocation determines what relocation options are available to the linker for this segment.

alignment determines what address alignment options are available to the linker for this segment.


The name of each segment in a source module must be unique. The linker combines segments that have the same type.


These classes are available in the AX51 Assembler only.

Following are a few examples of segments defined using the basic classes.


seg1    SEGMENT  XDATA

seg2    SEGMENT  HCONST

seg3    SEGMENT  DATA

User-Defined Classes


User-defined classes allow you to access the same address space as basic class names but with greater flexibility and more granular control over program segments. The primary benefit to user-defined segments is the ability to locate only certain segments to specific physical addresses using the linker.


User-defined class names are composed of a basic class name and an extension and are enclosed in single-quotes ('). For example:


seg1    SEGMENT  'XDATA_FLASH'

seg2    SEGMENT  'HCONST_IMAGES'

seg3    SEGMENT  'DATA1'

 Note


User-defined classes are available in the AX51 Assembler only


Class


The segment class specifies the memory space for the segment and is used by the linker to access all segments that belong to that class. The following table lists the basic classes.


class Description

BIT The BIT address space with the valid address range is 20H.0-2FH.7. For example: 21H.5.

CODE The CODE address space (from 0000h-0FFFFh).

CONST1 The CONST address space. This is the same as the CODE space but is used for constants only. This memory is accessed using the MOVC instruction.


http://www.keil.com/support/man/docs/a51/a51_st_segment.htm

반응형

댓글0