Выжимка из l51_bank.a51
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено Al Volovich 06 апреля 2004 г. 12:01
В ответ на: проблема вот в чем: отправлено MPL 06 апреля 2004 г. 11:23

; *
; THEORY OF OPERATION *
; ------------------- *
; This section describes how the extended LX51 linker/locater manages the *
; extended address spaces that are addressed with the new C51 memory types *
; 'far' and 'far const'. The C51 Compiler uses 3 byte pointer generic *
; pointer to access these memory areas. 'far' variables are placed in the *
; memory class HDATA and 'far const' variables get the memory class 'HCONST'. *
; The LX51 linker/locater allows you to locate these memory classes in the *
; logical 16 MBYTE CODE or 16 MBYTE XDATA spaces. *
; *
; The memory access itself is performed via eight different subroutines that *
; can be configured in this assembler module. These routines are: *
; ?C?CLDXPTR, ?C?CSTXPTR ; load/store BYTE (char) in extended memory *
; ?C?ILDXPTR, ?C?ISTXPTR ; load/store WORD (int) in extended memory *
; ?C?PLDXPTR, ?C?PSTXPTR ; load/store 3-BYTE PTR in extended memory *
; ?C?LLDXPTR, ?C?LSTXPTR ; load/store DWORD (long) in extended memory *
; *
; Each function gets as a parameter the memory address with 3 BYTE POINTER *
; representation in the CPU registers R1/R2/R3. The register R3 holds the *
; memory type. The C51 compiler uses the following memory types: *
; *
; R3 Value | Memory Type | Memory Class | Address Range *
; -----------------------+--------------+-------------------------- *
; 00 | data/idata | DATA/IDATA | I:0x00 .. I:0xFF *
; 01 | xdata | XDATA | X:0x0000 .. X:0xFFFF *
; 02..7F | far | HDATA | X:0x010000 .. X:0x7E0000 *
; 80..FD | far const | HCONST | C:0x800000 .. C:0xFD0000 (see note) *
; FE | pdata | XDATA | one 256-byte page in XDATA memory *
; FF | code | CODE | C:0x0000 .. C:0xFFFF *
; *
; Note: the far const memory area is mapped into the banked memory areas. *
; *
; The R3 values 00, 01, FE and FF are already handled within the C51 run-time *
; library. Only the values 02..FE are passed to the XPTR access functions *
; described below. The AX51 macro assembler provides the MBYTE operator *
; that calculates the R3 value that needs to be passed to the XPTR access *
; function. AX51 Assembler example for using XPTR access functions: *
; MOV R1,#LOW (variable) ; gives LSB address byte of variable *
; MOV R2,#HIGH (variable) ; gives MSB address byte of variable *
; MOV R3,#MBYTE (variable) ; gives memory type byte of variable *
; CALL ?C?CLDXPTR ; load BYTE variable into A *
;******************************************************************************

То есть по идее должна она уметь работать с указателями far. Если отказывается напрямую - можно немного извратиться и сделать как надо...

Составить ответ  |||  Конференция  |||  Архив

Ответы



Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru