Что-то вы меня запутали. Не поленился, расчехлил IAR: #include <ioavr.h>
#include <stdint.h>
void test (uint8_t volatile * port, uint8_t mask)
{
*port |= mask;
}
int main( void )
{
test(&PORTC, 0x04);
PORTC |= 0x04;
return 0;
}
# 11/Nov/2008 22:11:06 #
# IAR Atmel AVR C/C++ Compiler V4.10B/W32, Evaluation Version #
1 #include <ioavr.h>
2 #include <stdint.h>
\ In segment CODE, align 2, keep-with-next
3 void test (uint8_t volatile * port, uint8_t mask)
\ test:
4 {
5 *port |= mask;
\ 00000000 01F8 MOVW R31:R30, R17:R16
\ 00000002 8100 LD R16, Z
\ 00000004 2B02 OR R16, R18
\ 00000006 8300 ST Z, R16
6 }
\ 00000008 9508 RET
7
\ In segment CODE, align 2, keep-with-next
8 int main( void )
\ main:
9 {
10 test(&PORTC, 0x04);
\ 00000000 E024 LDI R18, 4
\ 00000002 E305 LDI R16, 53
\ 00000004 E010 LDI R17, 0
\ 00000006 .... RCALL test
11 PORTC |= 0x04;
\ 00000008 9AAA SBI 0x15, 0x02
12 return 0;
\ 0000000A E000 LDI R16, 0
\ 0000000C E010 LDI R17, 0
\ 0000000E 9508 RET
13 }
main.c Done. 0 error(s), 0 warning(s)