Go to Post Anything worth analyzing is worth over-analyzing. And anything worth over-analyzing is worth hyper-analyzing. Ready, go! - Michael Hill [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 26-10-2003, 16:21
ScottWolchok ScottWolchok is offline
Pwnt.
#0217 (ThunderChickens)
Team Role: Programmer
 
Join Date: Oct 2003
Rookie Year: 2004
Location: Utica, MI
Posts: 23
ScottWolchok will become famous soon enoughScottWolchok will become famous soon enough
Send a message via AIM to ScottWolchok
Weird Stuff in ifi_startup.c

I was poking through the default code in an effort to determine if we could program the Master PIC as well as the User PIC, and I found this odd stuff thither.
Code:
void
_entry (void)
{
_asm goto _startup _endasm

}
#pragma code _startup_scn
void
_startup (void)
{
  _asm
    // Initialize the stack pointer
    lfsr 1, _stack lfsr 2, _stack clrf TBLPTRU, 0 // 1st silicon doesn't do this o
n POR
    bcf  FPFLAGS,RND,0 // Initialize rounding flag for floating point libs
    
    // initialize the flash memory access configuration. this is harmless
    // for non-flash devices, so we do it on all parts.
    bsf 0xa6, 7, 0
    bcf 0xa6, 6, 0
  _endasm 

loop:

        Clear_Memory();              
  _do_cinit ();
  // Call the user's main routine
  main ();

  goto loop;
}                               /* end _startup() */
Mmkay, so I look at this and I'm really lost. First of all, what does the underscore at the start of all these functions signify? Second, isn't assembler in C done like a function call? Thirdly, is that entry function even necessary? And last, I thought C programs started with the main function, but this code calls it instead... @_@
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird Al MattK Chit-Chat 7 10-11-2002 00:33
Team 84 stuff... evulish Robot Showcase 6 24-07-2002 00:41
What does everyone like to do besides FIRST stuff?? Katie_269 Chit-Chat 45 17-07-2002 17:01
the weird feeling.. archiver 2000 3 23-06-2002 23:08
who can we buy stuff from?!?! archiver 2001 7 23-06-2002 23:04


All times are GMT -5. The time now is 10:42.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi