Mikroelektronika MIKROE-742 데이터 시트
Directive org
Directive org specifies the starting address of a routine in ROM. It is appended to
the declaration of a routine. For example:
the declaration of a routine. For example:
procedure proc(par : byte); org $200;
begin
// Procedure will start at address $200;
...
end;
begin
// Procedure will start at address $200;
...
end;
org
directive can be used with main routine too. For example:
program Led_Blinking;
procedure some_proc();
begin
begin
...
end;
org 0x800; // main procedure starts at 0x800
begin
begin
DDRB := 0xFF;
while TRUE do
begin
PORTB := 0x00;
Delay_ms(500);
Delay_ms(500);
PORTB := 0xFF;
Delay_ms(500);
Delay_ms(500);
end;
end.
Note: You must specify an even address when using the org directive.
101
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Specifics
mikroPASCAL PRO for AVR
CHAPTER 3