We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, I'm having troubles with translating this code from IAR to KEIL taken from TI cc1110 datasheet which aligns the halFlashDmaTrigger function to 2-bytes boundary:
MODULE flashDmaTrigger.s51 RSEG RCODE (1) PUBLIC halFlashDmaTrigger FUNCTION halFlashDmaTrigger, 0203H
halFlashDmaTrigger: ORL FCTL, #0x02; RET; END;
I read the uVision3 help about this but I didnt understand how to combine it my C code.It doesn't let me use the #pragma asm in header files.Its probably quite basic, I'm just quite new to this....
Thanks!
"aligns the halFlashDmaTrigger function to 2-bytes boundary"
Add "WORD" alignment to the SEGMENT, using AX51 assembler.
"SEGMENT Assembler Statement" http://www.keil.com/support/man/docs/a51/a51_st_segment.htm
If you aren't familiar with KEIL assembler, Write the subroutine in C as a separated source file first, without considering the alignment. Then, compile it with SRC option. The compiler generates ASM source file (.src). Add WORD alignment to the SEGMENT, and rename the ASM file to .A51.
Tsuneo