short int pointer limitations?? - Linux

This is a discussion on short int pointer limitations?? - Linux ; Assuming a flat memory model, what are the limitations of a short int pointer??...

+ Reply to Thread
Results 1 to 12 of 12

Thread: short int pointer limitations??

  1. short int pointer limitations??

    Assuming a flat memory model, what are the limitations of a short int
    pointer??

  2. Re: short int pointer limitations??

    On May 16, 5:40*am, MAx wrote:
    > Assuming a flat memory model, what are the limitations of a short int
    > pointer??


    Can you rephrase the question? I do not understand it.

    -Mike

  3. Re: short int pointer limitations??

    MAx writes:

    > Assuming a flat memory model, what are the limitations of a short int
    > pointer??


    What's a short int pointer?

  4. Re: short int pointer limitations??

    Joe Pfeiffer wrote:
    > MAx writes:
    >
    >
    >>Assuming a flat memory model, what are the limitations of a short int
    >>pointer??

    >
    >
    > What's a short int pointer?


    Let's make a guess:

    1. The OP is using an Intel 80x86 derivative processor,

    2. The processor is runningt in 32 bit mode with all
    segments set to alias the full 32 bit address range

    3. He would like to use a 16 bit number as a pointer.

    The simple answer is: Don't.

    The possible negative values of a short int are ill
    defined for an unsigned 32 bit flat address. Also, the
    positive values reach only the lowest 32 kibytes of
    the full 4 Gibytes address range.

    The situation is not much better with unsigned shorts.

    --

    -Tauno Voipio

  5. Re: short int pointer limitations??

    On Fri, 16 May 2008 18:20:45 UTC in comp.os.linux.development.system, Tauno
    Voipio wrote:

    > Joe Pfeiffer wrote:
    > > MAx writes:
    > >
    > >
    > >>Assuming a flat memory model, what are the limitations of a short int
    > >>pointer??

    > >
    > > What's a short int pointer?

    >
    > Let's make a guess:


    Let's make a further guess:

    this is homework question!

    --
    Trevor Hemsley, Brighton, UK
    Trevor dot Hemsley at ntlworld dot com

  6. Re: short int pointer limitations??

    "Trevor Hemsley" writes:

    > On Fri, 16 May 2008 18:20:45 UTC in comp.os.linux.development.system, Tauno
    > Voipio wrote:
    >
    >> Joe Pfeiffer wrote:
    >> > MAx writes:
    >> >
    >> >
    >> >>Assuming a flat memory model, what are the limitations of a short int
    >> >>pointer??
    >> >
    >> > What's a short int pointer?

    >>
    >> Let's make a guess:

    >
    > Let's make a further guess:
    >
    > this is homework question!


    Let's elaborate: the teacher is clueless.

    --
    Måns Rullgård
    mans@mansr.com

  7. Re: short int pointer limitations??

    On 2008-05-16, Måns Rullgård wrote:

    >>>>>Assuming a flat memory model, what are the limitations of a short int
    >>>>>pointer??
    >>>>
    >>>> What's a short int pointer?
    >>>
    >>> Let's make a guess:

    >>
    >> Let's make a further guess:
    >>
    >> this is homework question!

    >
    > Let's elaborate: the teacher is clueless.


    Possibly true, but it doesn't relieve one of the obligation to
    try to figure out what answer the teacher is looking for.

    --
    Grant Edwards grante Yow! If Robert Di Niro
    at assassinates Walter Slezak,
    visi.com will Jodie Foster marry
    Bonzo??

  8. Re: short int pointer limitations??

    Måns Rullgård writes:

    > "Trevor Hemsley" writes:
    >
    >> On Fri, 16 May 2008 18:20:45 UTC in comp.os.linux.development.system, Tauno
    >> Voipio wrote:
    >>
    >>> Joe Pfeiffer wrote:
    >>> > MAx writes:
    >>> >
    >>> >
    >>> >>Assuming a flat memory model, what are the limitations of a short int
    >>> >>pointer??
    >>> >
    >>> > What's a short int pointer?
    >>>
    >>> Let's make a guess:

    >>
    >> Let's make a further guess:
    >>
    >> this is homework question!

    >
    > Let's elaborate: the teacher is clueless.


    Not necessarily. The phrase "short int pointer" is sufficiently
    meaningless that it might be a very poorly understood question. Or it
    might be an 8086 assembly language class (yes, I realize that would
    mean it was posted to the wrong newsgroup).


  9. Re: short int pointer limitations??

    Joe Pfeiffer wrote:
    > Måns Rullgård writes:
    >
    >
    >>"Trevor Hemsley" writes:
    >>
    >>
    >>>On Fri, 16 May 2008 18:20:45 UTC in comp.os.linux.development.system, Tauno
    >>>Voipio wrote:
    >>>
    >>>
    >>>>Joe Pfeiffer wrote:
    >>>>
    >>>>>MAx writes:
    >>>>>
    >>>>>
    >>>>>
    >>>>>>Assuming a flat memory model, what are the limitations of a short int
    >>>>>>pointer??
    >>>>>
    >>>>>What's a short int pointer?
    >>>>
    >>>>
    >>>>Let's make a guess:
    >>>
    >>>Let's make a further guess:
    >>>
    >>>this is homework question!

    >>
    >>Let's elaborate: the teacher is clueless.

    >
    >
    > Not necessarily. The phrase "short int pointer" is sufficiently
    > meaningless that it might be a very poorly understood question. Or it
    > might be an 8086 assembly language class (yes, I realize that would
    > mean it was posted to the wrong newsgroup).



    'Flat memory model' does not apply to 16 bit Intel programming.

    AFAIK, the 80286/80186/8086 segmentation model did not use the term.

    --

    Tauno Voipio


  10. Re: short int pointer limitations??

    Tauno Voipio writes:
    > Joe Pfeiffer wrote:
    >>
    >> Not necessarily. The phrase "short int pointer" is sufficiently
    >> meaningless that it might be a very poorly understood question. Or it
    >> might be an 8086 assembly language class (yes, I realize that would
    >> mean it was posted to the wrong newsgroup).

    >
    >
    > 'Flat memory model' does not apply to 16 bit Intel programming.
    >
    > AFAIK, the 80286/80186/8086 segmentation model did not use the term.


    Ah, OK -- I'd forgotten he'd specified 'flat memory model'. You're
    right, there was no flat memory before the 386.

    So we're back to

    (1) clueless instructor
    (2) poorly-stated homework problem (having had to post many corrections
    to my assignments over the years, I like to think that this isn't a
    special case of (1), though my students may differ)
    (3) poorly-understood homework problem.

  11. Re: short int pointer limitations??

    Joe Pfeiffer wrote:
    > Tauno Voipio writes:
    >
    >>Joe Pfeiffer wrote:
    >>
    >>>Not necessarily. The phrase "short int pointer" is sufficiently
    >>>meaningless that it might be a very poorly understood question. Or it
    >>>might be an 8086 assembly language class (yes, I realize that would
    >>>mean it was posted to the wrong newsgroup).

    >>
    >>
    >>'Flat memory model' does not apply to 16 bit Intel programming.
    >>
    >>AFAIK, the 80286/80186/8086 segmentation model did not use the term.

    >
    >
    > Ah, OK -- I'd forgotten he'd specified 'flat memory model'. You're
    > right, there was no flat memory before the 386.
    >
    > So we're back to
    >
    > (1) clueless instructor
    > (2) poorly-stated homework problem (having had to post many corrections
    > to my assignments over the years, I like to think that this isn't a
    > special case of (1), though my students may differ)
    > (3) poorly-understood homework problem.



    You're right - if this is a homework, the question, as posed,
    is impossible to respond sensibly to.

    --

    Tauno Voipio

  12. Re: short int pointer limitations??

    On May 17, 10:16*pm, Tauno Voipio wrote:
    > Joe Pfeiffer wrote:
    > > Tauno Voipio writes:

    >
    > >>Joe Pfeiffer wrote:

    >
    > >>>Not necessarily. *The phrase "short int pointer" is sufficiently
    > >>>meaningless that it might be a very poorly understood question. *Or it
    > >>>might be an 8086 assembly language class (yes, I realize that would
    > >>>mean it was posted to the wrong newsgroup).

    >
    > >>'Flat memory model' does not apply to 16 bit Intel programming.

    >
    > >>AFAIK, the 80286/80186/8086 segmentation model did not use the term.

    >
    > > Ah, OK -- I'd forgotten he'd specified 'flat memory model'. *You're
    > > right, there was no flat memory before the 386.

    >
    > > So we're back to

    >
    > > (1) clueless instructor
    > > (2) poorly-stated homework problem (having had to post many corrections
    > > * * to my assignments over the years, I like to think that this isn't a
    > > * * special case of (1), though my students may differ)
    > > (3) poorly-understood homework problem.

    >
    > You're right - if this is a homework, the question, as posed,
    > is impossible to respond sensibly to.
    >
    > --
    >
    > Tauno Voipio- Hide quoted text -
    >
    > - Show quoted text -


    Hi,
    Guess what, this question was asked in an interview.
    I was equally clueless abt the answer. Thanks for the effort put in.
    I feel bettr to know that most of the gurus too failed to understand
    the question as me (a newbie) did.

    I wonder what the guy who asked the question was thinking....???

    Thanks to all who tried :-)

+ Reply to Thread