- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that the Powerstation 4.0 Compiler had a builtin function named integer*4 LOCFAR. It is defined as the "segmented address function" opposed to integer*2 LOCNEAR the "unsegmented address function". Is there an equivalent in Intel Visual Fortran?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no "segmented addressing" anymore Maybe just use LOC.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also be mindful that LOC returns an integer who's width is that of the memory model (4 for 32-bit, 8 for 64-bit).
INTEGER (KIND=INT_PTR_KIND()) :: YOUR_POINTER_AS_INTEGER
Also consult the language reference under POINTER.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LOCNEAR and LOCFAR are holdovers from 16-bit Windows. I don't know what you'd even do with a 16-bit address on a 32-bit system!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you both for the clarification and the pointer to the pointers.
That's probably why there are just uses of LOCFAR an none of LOCNEAR in the code. I'll just try LOC and will have to be mindful when a swithc to 64bit will occur. But hopefully most of that codebase will be reworked by then.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could take things a step further and note/fix any instances of 2-byte integers in the old code. For example, GETTIM() took 2-byte integer arguments in 16-bit Fortran and, with USE IFPORT, in Intel Fortran. However, the default arguments to GETTIM are 4-byte integers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, but there was a rework for INTEGER*4 instead of INTEGER*2 a few years ago. This rework will focus on dynamic allocation of memory or object oriented data structures... well as soon as i have it working with the new compiler. There are still a few pitfalls (multiple definitions, type checking shows wrong dimensions on arrays, etc.). But it compiled.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page