how to reserve memory in mikroC (C-language) for (PIC16F877A), if i wanna reserve 0x0200??? how ??? somebody teach me...this is the starting point that i get stack...please someone help me....
i know using the
void main()org 0x200{
}
izzit like this ???
void main()org 0x200{
PORTC = 0; // Initialize PORTC
TRISC = 0; // Configure PORTC as output
while(1) {
PORTC = ~PORTC; // toggle PORTC
Delay_ms(1000); // one second delay
}
}
inside Assembly code
(
$0000 $2A00 GOTO _main //i wanna make this instruction put at 0x200,,,,,how ???
$0200 $ _main:
;Led_Blinking.c,19 :: void main()org 0x200{
;Led_Blinking.c,20 :: PORTC = 0; // Initialize PORTC
$0200 $1303 BCF STATUS, RP1
$0201 $1283 BCF STATUS, RP0
$0202 $0187 CLRF PORTC, 1
;Led_Blinking.c,21 :: TRISC = 0; // Configure PORTC as output
$0203 $1683 BSF STATUS, RP0
$0204 $0187 CLRF TRISC, 1
;Led_Blinking.c,23 :: while(1) {
$0205 $ L_main_0:
.
.
.
.
.
)
but i see from the assembly, the address of goto still at 0x0000, just only the main in 0x200, if i wanna make the goto start at 0x200....izzit posible ???
NEED HELP!!!!!URGENT!!!!
- slavisa.zlatanovic
- mikroElektronika team
- Posts: 1321
- Joined: 07 Apr 2009 09:39
Re: NEED HELP!!!!!URGENT!!!!
Hi!
Best regards
Slavisa
No, address 0x0000 is reserved for the reset vector.but i see from the assembly, the address of goto still at 0x0000, just only the main in 0x200, if i wanna make the goto start at 0x200....izzit posible ???
Best regards
Slavisa
Best regards
Slavisa
Slavisa
Re: NEED HELP!!!!!URGENT!!!!
Dear ME team,
i have the same request in another recent thread ( http://www.mikroe.com/forum/viewtopic.php?f=10&t=25500 ) ..
we dont want to modify the reset vector of course ..
we want to use a bootloader .. in my case the Microchip bootloader use 0x0000 to 0x0FFF
so my application need to start @ 0x1000.
when we use ORGALL, the application start effectively @x1000 ...
BUT we have : GOTO _main @0x0000 ...
we want that : GOTO _main @ x1000 ...
the bottloader jump to 0x1000 if no bootload needed ...
Please may we do something to relocate this Goto _main ...?
i use MB 7.0.0.3 for that application
Thanks
i have the same request in another recent thread ( http://www.mikroe.com/forum/viewtopic.php?f=10&t=25500 ) ..
we dont want to modify the reset vector of course ..
we want to use a bootloader .. in my case the Microchip bootloader use 0x0000 to 0x0FFF
so my application need to start @ 0x1000.
when we use ORGALL, the application start effectively @x1000 ...
BUT we have : GOTO _main @0x0000 ...
we want that : GOTO _main @ x1000 ...
the bottloader jump to 0x1000 if no bootload needed ...
Please may we do something to relocate this Goto _main ...?
i use MB 7.0.0.3 for that application
Thanks