Thread: what is PTR32 ATTRIBUTE

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

    Exclamation what is PTR32 ATTRIBUTE

    Hi,

    I am working on 2 programs say, TKKS and TKS5. TKKS is written in assembler and uses 4 byte address while TKS5 in CPP and uses 8 byte address
    I get a lot of dumps in TKS5 when input data is passed to it by TKKS.
    I have been advised that TKS5 should add a couple of PTR32 definitions in its parameter list definition that it gets from TKKS.

    struct Input_Parameters {
    pFKSSTR FKK_Lst; //Input data passed by TKKU AND TKKS
    pFKSSTR CCN_Lst; //Input data passed by TKKU AND TKKS

    Can someone let me know how to add these PTR32 definitions?

  2. #2
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    So you are using a 64bit compiler for CPP and trying to interface your program with a 32bit assembly program? In order to make your pointer definitions 32bits you need to look at the stdint header file of your C++ compiler to see how it defines a 32bit int. You should see a typedef along the lines of uint32_t. If you were to declare a pointer to a 32bit integer you would use it like:
    Code:
     uint32_t* ptr32;
    This creates a 32bit integer pointer named ptr32.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    3
    Thank you Andrew.
    This has been very helpful


    "It is only when you convince yourself that you are strong, you become stronger"

  4. #4
    Registered User
    Join Date
    Aug 2010
    Location
    Poland
    Posts
    733
    Quote Originally Posted by AndrewHunter View Post
    So you are using a 64bit compiler for CPP and trying to interface your program with a 32bit assembly program? In order to make your pointer definitions 32bits you need to look at the stdint header file of your C++ compiler to see how it defines a 32bit int. You should see a typedef along the lines of uint32_t. If you were to declare a pointer to a 32bit integer you would use it like:
    Code:
     uint32_t* ptr32;
    This creates a 32bit integer pointer named ptr32.
    32-bit pointer is not a pointer which points to a 32-bit integer, but a pointer that occupies 4 bytes in the memory.

    @Ariyana: I guess you want to share integers, not pointers...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. subclass attribute
    By Farnaz in forum C++ Programming
    Replies: 4
    Last Post: 03-18-2011, 02:32 PM
  2. XML Loop through attribute help
    By Striph in forum C# Programming
    Replies: 5
    Last Post: 05-07-2010, 09:01 AM
  3. meta data and attribute
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 05-13-2008, 01:26 AM
  4. Read only attribute
    By earnshaw in forum C# Programming
    Replies: 1
    Last Post: 02-18-2006, 10:46 PM

Tags for this Thread