NEED HELP!!!!!URGENT!!!!

General discussion on mikroC.
Post Reply
Author
Message
johnson_tee
Posts: 6
Joined: 18 Apr 2010 21:17

NEED HELP!!!!!URGENT!!!!

#1 Post by johnson_tee » 01 May 2010 15:23

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 ???

User avatar
slavisa.zlatanovic
mikroElektronika team
Posts: 1321
Joined: 07 Apr 2009 09:39

Re: NEED HELP!!!!!URGENT!!!!

#2 Post by slavisa.zlatanovic » 05 May 2010 13:19

Hi!
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 ???
No, address 0x0000 is reserved for the reset vector.

Best regards
Slavisa
Best regards
Slavisa

phil31
Posts: 348
Joined: 02 Apr 2009 15:02
Location: France
Contact:

Re: NEED HELP!!!!!URGENT!!!!

#3 Post by phil31 » 02 Jun 2010 11:51

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

Post Reply

Return to “mikroC General”