Like Tree2Likes
  • 2 Post By stahta01

How to explain the problem about address?

This is a discussion on How to explain the problem about address? within the C Programming forums, part of the General Programming Boards category; I use TC2.0,and I want to calculate address through segment and offset,look: Code: unsigned long p; p=MK_FP(0x20,0x100); printf("p=%lx\n",p); when it ...

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    50

    How to explain the problem about address?

    I use TC2.0,and I want to calculate address through
    segment and offset,look:
    Code:
    unsigned long p;
    p=MK_FP(0x20,0x100);
    printf("p=%lx\n",p);
    when it run,it display 200100,but I
    think the address must be 0x300,why?
    how to explain the problem

  2. #2
    qny
    qny is offline
    Registered User
    Join Date
    Sep 2012
    Posts
    355
    According to my google result:
    Code:
    MK_FP(0x20, 0x100) = (0x20 << 16) | 0x100 = 0x200000 | 0x100 = 0x200100

  3. #3
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,655
    TC2.0
    Seriously??? Turbo C 2.0? Why? You do realize this software is from the late 1980s, right?

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    2,764
    You need to watch the new show revolution; from it I see them using old PC to get around whatever shuts the electricity down in the USA and likely the world. http://www.nbc.com/revolution/
    Then, there might be a lot of people in on it needing to use old Turbo C versions.

    Anyone, recognize how old the PC was in the show?
    I believe it was from the MS-DOS days.



    Tim S.
    rags_to_riches and iMalc like this.
    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the Universe is winning." Rick Cook

  5. #5
    Registered User poornaMoksha's Avatar
    Join Date
    Sep 2011
    Location
    India
    Posts
    41
    Yup, I am also a bit curious as to where TC2.0 is being used now a days??

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Address out of bounds problem
    By raczzoli in forum C Programming
    Replies: 6
    Last Post: 06-16-2012, 04:01 PM
  2. Replies: 2
    Last Post: 05-19-2004, 08:24 PM
  3. address book problem
    By datainjector in forum C Programming
    Replies: 13
    Last Post: 11-27-2002, 08:14 PM
  4. Can someone explain the problem with this?
    By Robert602 in forum Windows Programming
    Replies: 3
    Last Post: 03-02-2002, 04:11 AM
  5. explain linked lists returning a node address
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 12-11-2001, 09:53 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21