svchamlian svchamlian

Encapsulate code into  header and trailer

Discussion created by svchamlian svchamlian on May 20, 2008
Latest reply on May 29, 2008 by yevgenit

Hi,

 I am trying to encapsulate the code into a header and trailer. Therefore, I used the following technique:

In vectors.s, I have

Code:
 _DEF_SW_VERSION .set 5407 .global VECTOR_TABLE .global _VECTOR_TABLE .global start .extern _asm_startmeup .extern ___SP_INIT .extern _asm_exception_handler .extern _asm_isr_handler .extern _dbug_sc_handler .def _header .def _header_end .def _trailer .def _trailer_end .text "header"/* * Exception Vector Table */VECTOR_TABLE:_VECTOR_TABLE:INITSP:  .long ___SP_INIT  /* Initial SP   */INITPC:  .long 0x400   /* Initial PC   */vector02: .long _asm_exception_handler /* Access Error  */vector03: .long _asm_exception_handler /* Address Error  */vector04: .long _asm_exception_handler /* Illegal Instruction */vector05: .long _asm_exception_handler /* Divide by Zero  */vector06: .long _asm_exception_handler /* Reserved   */vector07: .long _asm_exception_handler /* Reserved   *//* … etc … */vectorFF: .long _asm_isr_handlerstart: .long 12351236h       ; 2 word header signature .long _DEF_SW_VERSION ; 2 words for version identification .word 0               ; 1 word for n_words .word 0               ; 1 word for checksum .word 0, 0, 0, 0      ; 4 words for future expansion move.w #0x2700,SR jmp  _asm_startmeup_header_end:/* -------- Trailer ------*/.text "trailer"_trailer:  .long 0ABCEABCFh        ; 2 word trailer signature      .word 0, 0, 0, 0, 0, 0  ; 6 words for future expansion _trailer_end:/* End of vector.s */ .end


 In the memory, I can see header’s signature (12351236h) followed by (after some data) the trailer’s signature.

How can I make the trailer part go at the end of the code in memory?

Thanks,

Simon

 

 

Outcomes