Thread: How to explain the problem about address?

  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
    Registered User
    Join Date
    Sep 2012
    Posts
    357
    According to my google result:
    Code:
    MK_FP(0x20, 0x100) = (0x20 << 16) | 0x100 = 0x200000 | 0x100 = 0x200100

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    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
    4,183
    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.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  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, 03:01 PM
  2. Replies: 2
    Last Post: 05-19-2004, 07: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