Vous êtes sur la page 1sur 4

MADS Relocatable Binaries .RELOC [.byte / .

word] BLK UPDATE ADDRESS HEADER BLOCK Header is 16 bytes long: HEADER START_ADDRESS END_ADDRESS MADS_RELOC_HEADER UNUSED CONFIG @STACK_POINTER @STACK_ADDRESS @PROC_VARS_ADR .WORD .WORD .WORD .WORD .BYTE .BYTE .WORD .WORD .WORD = $FFFF = $0000 = FILE_LENGTH-1 = $524D = $00 (bit0)

MADS_RELOC_HEADER is always $524D ('MR'). FILE_LENGTH excludes 16 byte header. CONFIG: only bit 0 is used: 0 = relocate from $0000, 1 = relocate from %0100. The last six bytes contain information required for use of the software stack. I f the stack is not used, these values are zero. Values must be identical in all files linked together.

EXTERNAL SYMBOLS label EXT type label .EXTRN type .EXTRN label1,label2,label3... type Below is the header format in a file with external symbols. B=Byte, W=Word, L=Lo ng, D=Dword. This information is generated by: BLK UPDATE EXTERNAL External symbols are not only defined value type (.BYTE .WORD .LONG .DWORD), eg: name EXT. BYTE LABEL_NAME EXT .WORD .EXTRN LABEL_NAME .WORD wait EXT .PROC (.BYTE delay) Header format: HEADER TYPE DATA_LENGTH LABEL_LENGTH LABEL_NAME DATA WORD .WORD ($FFEE) .CHAR (B, W, L, D, <,>) .WORD (# addresses in relocation list) .WORD .ATASCII .. .. .. (list of words)

HEADER always = $FFEE TYPE data type is stored in the 0th bits of this byte .6 and specifies the type of modified addresses (?) DATA_LENGTH is the number of 2-byte data (addresses) to modify LABEL_LENGTH a symbol name length in bytes LABEL_NAME is the name of the symbol in ATASCII DATA proper sequence data for modification of the main block relokowalnego. At t he address indicated here should read the value of TYPE and then modify it under the new symbol value.

PUBLIC SYMBOLS Declaring public symbols: .PUBLIC label [, ,...] Label2 .GLOBAL label [, ,...] Label2 .GLOBL label [, ,...] Label2 Directives .GLOBAL and .GLOBL have been added in view of compatibility with othe r assemblers, and their meaning is identical to the Directive .PUBLIC. Update public symbols: BLK UPDATE PUBLIC Below is the format of information generated by BLK UPDATE PUBLIC: HEADER LENGTH TYPE LABEL_TYPE LABEL_LENGTH LABEL_NAME ADDRESS .WORD ($FFED) .WORD .BYTE (B, W, L, D) .CHAR (C=Constant, V=Variable, P=Procedure, A=Array, S=Struct) .WORD ATASCII .WORD

MADS automatically selects the appropriate type for public labels: C=Constant V=Variable P=Procedure A=Array S=Struct label, uncontrolled relocation label, uncontrolled relocation declared by the procedure .PROC, subject to relocation declared with .ARRAY, subject to relocation declared with .STRUCT, is NOT subject to relocation

If the symbol relates to a structure (.STRUCT), additional information (field ty pe structure, the name of the field structure, the number of repetitions of the structure) is saved: STRUCT_LABEL_TYPE STRUCT_LABEL_LENGTH STRUCT_LABEL_NAME STRUCT_LABEL_REPEAT .CHAR (B, W, L, D) .WORD ATASCII .WORD

If the symbol relates to an array (.ARRAY), additional information is saved (the maximum declared array index, an array of fields declared type): ARRAY_MAX_INDEX .WORD ARRAY_TYPE .CHAR (B, W, L, D)

If the symbol refers to a procedure (.PROC), additional information is recorded, regardless of whether the procedure declares parameters: PROC_CPU_REG PROC_TYPE PARAM_COUNT .BYTE (bits 00 = Accumulator, 01 = X Register, 10 = Y Register) .BYTE (D=Default, R=Register, V=Variable) .WORD

For the symbols on the procedures (.REG) are saved now only types of these param eters in the amount of PARAM_COUNT: PARAM_TYPE ... ... .CHAR (B, W, L, D)

For the symbols on the procedures (.VAR) parameter types are saved and their nam es. PARAM_COUNT specifies the total length of the data: PARAM_TYPE PARAM_LENGTH PARAM_NAME ... ... HEADER LENGTH TYPE LABEL_TYPE ruct) .CHAR (B, W, L, D) .WORD ATASCII

always = $FFED is the number of symbols stored in the block update symbolizes the type (B, W, L, D) symbol type: (C=Constant, V=Variable, P=Procedure, A=Array, S=St

For P-type, additional information: PROC_CPU_REG, PROC_TYPE, PARAM_COUNT, PARAM_ TYPE For type A, additional information: ARRAY_MAX_INDEX, ARRAY_TYPE For S-type, additional information: STRUCT_LABEL_TYPE, STRUCT_LABEL_LENGTH, STRU CT_LABEL_NAME, STRUCT_LABEL_REPEAT LABEL_LENGTH LABEL_NAME ADDRESS This value is PROC_CPU_REG e type (.REG) PROC_TYPE D=Default ADSR=Register .REG) V=Variable ) public symbol label length in bytes public symbol codes stored in ATASCII address assigned to the symbol in the block relokowalnym. Reloc. subject to relocation by adding to its current assembly address. information about the order of use of CPU registers for procedur type of procedure: default type to pass parameters using a software stack and the M parameters for the procedure are reported by the CPU registers ( parameters for the procedure are reported by the variables (.VAR

PARAM_COUNT information on the number of parameters in the procedure (.REG) or total length of data containing information about the type of parameters and their names (.VAR) PARAM_TYPE type parameters stored with the characters 'B', 'W', 'L', 'D' PARAM_LENGTH name length parameter (.VAR)

PARAM_NAME

parameter name in the code ATASCII (.VAR)

Vous aimerez peut-être aussi