embedded questions!!!

Dec 27, 2005 62 Replies

Hello All,



Some questions were bugging me from quite some time. Any answers! please share.


  1. GIven an .EXE is there a way to find how many global varibale it uses?


  1. Given 2 Strings char *str1 = "JHONSON"; char *str2 = "O";



what is the fastest way to remove all occurences of letter O from str1.


  1. Given 2 STACKS, how to implement a QUEUE?


  1. what are MAK files? where are they used (Not quite C related but just in case.)

  2. what does .OBJ files contains?


  1. how does DLL link on runtime?

  2. what is ELF format?


  1. what is COFF format? what's it for?

  2. why do we need so many file formats .HEX, S-REC to represent exe.

Best Regards,



#define



I think your professor wants you to do your own homework.

Hello All,

Some C questions were bugging me from quite some time. Any answers! please share.

  1. GIven an .EXE is there a way to find how many global varibale it uses?

  1. Given 2 Strings char *str1 = "JHONSON"; char *str2 = "O";

what is the fastest way to remove all occurences of letter O from str1.

  1. Given 2 STACKS, how to implement a QUEUE?

  1. what are MAK files? where are they used (Not quite C related but just in case.)

  2. what does .OBJ files contains?

  1. how does DLL link on runtime?

  2. what is ELF format?

Best Regards,

#define

Well, you've posted it twice, is your prof going to fail you twice?

It's the season of goodwill to all men - except people who are failing

100-level CS courses and trying to beg for answers on Usenet. They *deserve* to go to the wall.

pete

pete@fenelon.com "there's no room for enigmas in built-up areas" - HMHB.

In article , #define writes

Yes, use a Logic Analyser with a read through trace. (Must be read through not read back)

Don't use any O in str1 when you write it. I have also found that if you lower the temperature it tends to shorten your Johnson to Jhnsn.

Tell them there is a 2 for 1 special offer. Seriously it depends of your stacks are in system, supervisor or user space.

MAK files are in fact a form of EXE files. These are used on a MAC computer as executables. ie PC uses .EXE and MAC uses .MAK

OBJects.... these files contain the classes or OBJects in C++ programming. They are sometimes seen in C programming when doing Advanced Modular Programming (AMP)

By using the fourth pass of the linker

A Linking is the executable B Linking is the standard library C linking is the user library D linking is the Dynamic Library

This is a joke from the K&R Unix team and dates back to the 1950's it is an uprated version of the cut down format for 8 bit processors. The cut down version was the Dwarf version and the one with the twist of "magic" was the Elf version for 16 bit processors.

This is the C Object Format "F" This is the other method for doing OO type work in C. This makes it possible to link C to C++. The other method AMP (Advanced Modular Programming) is for C only

This depends if you are using big endian or little endian.

\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Well done -- clear and concise. Pound's gonna ace the test for sure.

Dan Henry

Chris, Please make sure what you post is accurate.

in Ans 1, You use a scope and not a logic analyzer.

:-)

Then you need to recalibrate with a Johnson Counter.

There really is a lot to learn, isn't there?

Bob

^^^^^ You misspelt multimeter...

I kept confusing it with a Johnson Bar.

Kunal Shenoy ( snipped-for-privacy@xilinx.com) wrote at Tuesday 27 December 2005 20:26 in comp.arch.embedded:

But be shure not to set it to auto trigger mode. Otherwise you will only find automatic variables.

Reinhardt Behm, Nauheim, Germany, reinhardt.behm@t-online.de

Depends on method. I assume you mean a Digital memory scope. If you are looking for the Scope of the Global variables this is correct. However if the globals are in file scope it is easier (if less correct) to use a Logic analyser and "cheat" by using the read through trace.

IT won't work with the read-back trace which confuses some people and they think a analyser can't be used for this. So perhaps you are right that the simple answer is a scope. This is why most lecturers go on about the scope of variables so much.

\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

There is some research to say that you have to have two measurements. One by a male and one by a female Johnson Counter then average the two as both can be a little unreliable in opposite directions of magnitude. Then calibrate for temperature and angle of dangle.

\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

I have been programming for many years, but it always nice to get such clear answers to basic questions. The old adage, that one is never to old to learn is still true.

Regards Anton Erasmus

No, that's Johansson, and is what Ingemar opened after winning the heavyweight championship from Floyd Patterson.

Some informative links: news:news.announce.newusers http://www.geocities.com/nnqweb/ http://www.catb.org/~esr/faqs/smart-questions.html http://www.caliburn.nl/topposting.html http://www.netmeister.org/news/learn2quote.html

Only on a Swedish steam locomotive.

Assume Stack S1,S2; insert_rear(element) { PUSH(element,S1); }

delete_front() { for all elements in S1 { element=POP(S1) PUSH(element,S2) } //Now all the elements are in the FIFO order in S2 //Now if u pop one element in S2 it is nothing but deleting from an element from the Q deleted_from_Q= POP(s2)

for all elements in S2 { element=POP(S2) PUSH(element,S1); }

return deleted_from_Q }

Let's not confuse the OP. The Swede with the steam locomotive (Novelty) was John Ericsson.

http://www.flexusergroup.com/

Ok, I got that far. Now the question is whether a Swedish locomotive has a Johnson Bar or a Johansson Bar to control valve timing. (Reverser to our British readers...)

A Johansson Bar and Johnson Counter-weights, mayhaps?

http://www.flexusergroup.com/

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required