embedded questions!!!

Embedded computer systems topics

embedded questions!!!

Postby #define » Tue Dec 27, 2005 11:26 pm

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?

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

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

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

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

5. what does .OBJ files contains?

6. how does DLL link on runtime?

7. what is ELF format?

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

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

Best Regards,

#define
#define
 

Re: embedded questions!!!

Postby Jim Stewart » Tue Dec 27, 2005 11:51 pm

#define wrote:
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?

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

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

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

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

5. what does .OBJ files contains?

6. how does DLL link on runtime?

7. what is ELF format?

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

9. 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.
Jim Stewart
 

Re: embedded questions!!!

Postby Chris Hills » Wed Dec 28, 2005 12:46 am

In article <1135704412.650597.123420@f14g2000cwb.googlegroups.com>,
#define <u4karsh@gmail.com> writes
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?

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

2. Given 2 Strings char *str1 = "JHONSON";
char *str2 = "O";
what is the fastest way to remove all occurences of letter O from str1.

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.

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

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

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

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

5. what does .OBJ files contains?
OBJects.... these files contain the classes or OBJects in C++

programming. They are sometimes seen in C programming when doing
Advanced Modular Programming (AMP)

6. how does DLL link on runtime?

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

7. what is ELF format?

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.

8. what is COFF format? what's it for?
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

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

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


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

Re: embedded questions!!!

Postby Dan Henry » Wed Dec 28, 2005 1:03 am

On Tue, 27 Dec 2005 18:46:46 +0000, Chris Hills <chris@phaedsys.org>
wrote:

In article <1135704412.650597.123420@f14g2000cwb.googlegroups.com>,
#define <u4karsh@gmail.com> writes
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?

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

2. Given 2 Strings char *str1 = "JHONSON";
char *str2 = "O";
what is the fastest way to remove all occurences of letter O from str1.

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.

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

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

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

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

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

6. how does DLL link on runtime?

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

7. what is ELF format?

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.

8. what is COFF format? what's it for?
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

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

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

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

--
Dan Henry
Dan Henry
 

Re: embedded questions!!!

Postby Kunal Shenoy » Wed Dec 28, 2005 1:15 am

Chris Hills wrote:
In article <1135704412.650597.123420@f14g2000cwb.googlegroups.com>,
#define <u4karsh@gmail.com> writes

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?


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


2. Given 2 Strings char *str1 = "JHONSON";
char *str2 = "O";
what is the fastest way to remove all occurences of letter O from str1.


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.


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


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


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


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


5. what does .OBJ files contains?

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


6. how does DLL link on runtime?


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


7. what is ELF format?


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.


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

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


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


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



Chris,
Please make sure what you post is accurate.

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

:-)
Kunal Shenoy
 

Re: embedded questions!!!

Postby Bob Stephens » Wed Dec 28, 2005 1:15 am

On Tue, 27 Dec 2005 12:03:37 -0700, Dan Henry wrote:

I have also found that if you
lower the temperature it tends to shorten your Johnson to Jhnsn.

Then you need to recalibrate with a Johnson Counter.

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


Bob
Bob Stephens
 

Re: embedded questions!!!

Postby Jim Stewart » Wed Dec 28, 2005 1:15 am

Kunal Shenoy wrote:
Chris Hills wrote:

In article <1135704412.650597.123420@f14g2000cwb.googlegroups.com>,
#define <u4karsh@gmail.com> writes

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?



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


2. Given 2 Strings char *str1 = "JHONSON";
char *str2 = "O";
what is the fastest way to remove all occurences of letter O from str1.



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.


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



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


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



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


5. what does .OBJ files contains?


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


6. how does DLL link on runtime?



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


7. what is ELF format?



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.


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


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


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



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


Chris,
Please make sure what you post is accurate.

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

You misspelt multimeter...
Jim Stewart
 

Re: embedded questions!!!

Postby Jim Stewart » Wed Dec 28, 2005 1:15 am

Bob Stephens wrote:

On Tue, 27 Dec 2005 12:03:37 -0700, Dan Henry wrote:


I have also found that if you

lower the temperature it tends to shorten your Johnson to Jhnsn.


Then you need to recalibrate with a Johnson Counter.

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

I kept confusing it with a Johnson Bar.
Jim Stewart
 

Re: embedded questions!!!

Postby Chris Hills » Wed Dec 28, 2005 1:15 am

In article <1ousbfr2quovn.180qy9el1gzp4.dlg@40tude.net>, Bob Stephens
<roberts@dcxchol.com> writes
On Tue, 27 Dec 2005 12:03:37 -0700, Dan Henry wrote:

I have also found that if you
lower the temperature it tends to shorten your Johnson to Jhnsn.

Then you need to recalibrate with a Johnson Counter.

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

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 \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Chris Hills
 

Re: embedded questions!!!

Postby Chris Hills » Wed Dec 28, 2005 1:15 am

In article <dos4hn$h543@cliff.xsj.xilinx.com>, Kunal Shenoy
<kunals@xilinx.com> writes
Chris Hills wrote:
In article <1135704412.650597.123420@f14g2000cwb.googlegroups.com>,
#define <u4karsh@gmail.com> writes

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?


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


2. Given 2 Strings char *str1 = "JHONSON";
char *str2 = "O";
what is the fastest way to remove all occurences of letter O from str1.


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.


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


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


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


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


5. what does .OBJ files contains?

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


6. how does DLL link on runtime?


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


7. what is ELF format?


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.


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

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


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


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



Chris,
Please make sure what you post is accurate.

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

:-)

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 \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Chris Hills
 

Re: embedded questions!!!

Postby Reinardt Behm » Wed Dec 28, 2005 1:15 am

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

Chris Hills wrote:
In article <1135704412.650597.123420@f14g2000cwb.googlegroups.com>,
#define <u4karsh@gmail.com> writes

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?


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


2. Given 2 Strings char *str1 = "JHONSON";
char *str2 = "O";
what is the fastest way to remove all occurences of letter O from str1.


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.


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


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


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


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


5. what does .OBJ files contains?

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


6. how does DLL link on runtime?


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


7. what is ELF format?


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.


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

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


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


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



Chris,
Please make sure what you post is accurate.

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

:-)
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
Reinardt Behm
 

Re: embedded questions!!!

Postby Anton Erasmus » Wed Dec 28, 2005 1:15 am

On Tue, 27 Dec 2005 19:54:17 +0000, Chris Hills <chris@phaedsys.org>
wrote:

In article <dos4hn$h543@cliff.xsj.xilinx.com>, Kunal Shenoy
kunals@xilinx.com> writes
Chris Hills wrote:
In article <1135704412.650597.123420@f14g2000cwb.googlegroups.com>,
#define <u4karsh@gmail.com> writes

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?


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


2. Given 2 Strings char *str1 = "JHONSON";
char *str2 = "O";
what is the fastest way to remove all occurences of letter O from str1.


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.


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


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


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


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


5. what does .OBJ files contains?

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


6. how does DLL link on runtime?


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


7. what is ELF format?


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.


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

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


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


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



Chris,
Please make sure what you post is accurate.

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

:-)

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.

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
Anton Erasmus
 

Re: embedded questions!!!

Postby Chuck F. » Wed Dec 28, 2005 1:15 am

Jim Stewart wrote:
Bob Stephens wrote:
On Tue, 27 Dec 2005 12:03:37 -0700, Dan Henry wrote:

I have also found that if you lower the temperature it tends
to shorten your Johnson to Jhnsn.

Then you need to recalibrate with a Johnson Counter.

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

I kept confusing it with a Johnson Bar.

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
Chuck F.
 

Re: embedded questions!!!

Postby Jim Stewart » Wed Dec 28, 2005 1:15 am

Chuck F. wrote:
Jim Stewart wrote:

Bob Stephens wrote:

On Tue, 27 Dec 2005 12:03:37 -0700, Dan Henry wrote:

I have also found that if you lower the temperature it tends
to shorten your Johnson to Jhnsn.


Then you need to recalibrate with a Johnson Counter.

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


I kept confusing it with a Johnson Bar.


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

Only on a Swedish steam locomotive.
Jim Stewart
 

Re: embedded questions!!!

Postby prasi » Wed Dec 28, 2005 9:15 am

#define wrote:
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?

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

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

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

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
}
4. what are MAK files? where are they used (Not quite C related but
just in case.)

5. what does .OBJ files contains?

6. how does DLL link on runtime?

7. what is ELF format?

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

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

Best Regards,

#define
prasi
 

Next

Return to Embedded System

Who is online

Users browsing this forum: No registered users and 1 guest