Thread: a microprocessor thing!

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    3

    Question a microprocessor thing!

    In a microprocessor based system, the hardware would call the subroutine whose address was stored in location 0 when it is switched on (powered on). Can anyone suggest a C statement that calls this subroutine explicitly to simulate the above condition.

  2. #2
    Registered User
    Join Date
    May 2002
    Posts
    50
    You're talking about hardware programming, which is a much more difficult, involved process than writing applications in C..


    I happened to do just that job, last summer at a communications firm.. however, Assembly is the language to do that particular job. It can be done in C but the compilers are insanely expensive (as they're written by the hardware companies themselves and are used by few people -> very high price).

    Go to dspvillage.ti.com and you'll find a wealth of information (99% of which you're not looking for). There are some code examples on the site, and I'm sure you'll find an example somewhere that instructs the microprocessor to access data address 0x0000000 and run the code located there, written in C or C++.

  3. #3
    Registered User stautze's Avatar
    Join Date
    Apr 2002
    Posts
    195
    what type of microprocessor?
    'During my service in the United States Congress, I took the initiative in creating the Internet.' - Al Gore, March 9, 1999: On CNN's Late Edition

  4. #4
    Registered User
    Join Date
    May 2002
    Posts
    50
    I worked on DSPs, processors whose module structure is specifically designed to crunch numbers very, very fast...

    The C syntax shouldn't be all that different though, if you have a compiler that will compile C code into microprocessor code (i.e. hexcode). The DSPs I worked on (and most of the DSPs at TI) are all based on the Harvard architechture, the same basic architecture used in your average every day AMD or Intel processor.

  5. #5
    Unregistered
    Guest
    If you just like to jump to reset routine in your C code, use the function pointer.

    define function pointer :
    void (*reset)();

    in some function:

    reset = 0; // Entry address
    // Before entry, may need to initialize some registers to its reset default
    (*reset)(); // Call to reset routine

  6. #6
    Registered User
    Join Date
    May 2002
    Posts
    3
    any normal microprocessor?The one used in a home pc!Does anyone know any website or book that deals with such arcane details??

  7. #7
    Unregistered
    Guest
    Function pointer is commonly used in device driver design. And can just be used to call into an absolute address for some special purpose.

    function pointer reference:
    http://www.newty.de/

    This feature maybe can fit our need.

  8. #8
    Registered User stautze's Avatar
    Join Date
    Apr 2002
    Posts
    195
    Originally posted by badhri
    any normal microprocessor?The one used in a home pc!
    That really narrows it down.
    'During my service in the United States Congress, I took the initiative in creating the Internet.' - Al Gore, March 9, 1999: On CNN's Late Edition

  9. #9
    *
    Guest
    virtually all processors work the same. You're talking about jumping to location zero on the 'zero page'.


    It isn't a big deal.

Popular pages Recent additions subscribe to a feed