From: Ernst B. <e.b...@xe...> - 2005-09-29 12:34:22
|
Hi List, I'm looking for a way to align a (naked) function in memory so that its address is a multiple of 0x0100. Platform is mcs51, actually an EzUSB chip. currently I'm moving the functions start address arround by allocating space just before it, like: -------- ... void _fill_before_usb_table() _naked { // align the usb_table to 0x100 _asm; .blkb 0x4B _endasm; } void usb_table() interrupt USB_VECT _naked critical { _asm; ... -------- But I have to recalc the offset by hand everytime I change the code before that snippet. Is there a way to force a function to a specific location, like > void test() at 0x100 { .. ? if not, is there a way to calculate the offset automatically, like > .blkb (0x100 - . <current address>) ? Thanks in advance, /Ernst |