Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8711587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:54:48+00:00 2026-06-13T04:54:48+00:00

I have an application consisting of mixed C and x86 assembly code. For complex

  • 0

I have an application consisting of mixed C and x86 assembly code. For complex reasons, the assembly code wants to know if a (purported program counter) value is an address in the area in which the object code for the C code exists. This application has worked very well in the past, including this oddball check.

All I actually need are “bookends” on the C code area whose addresses I trust.
This of course assumes that the compiled C code is deposited in the load image relatively densely.

I currently get my bookends by defining dummy functions LowestAddress(){} and HighestAddress(){} and placing them respectively first and last in the file containing the code. The assembly code simply compares a value of interest to the the addresses of these functions to determine if that value is in the C code range. Oops, this makes a second assumption, that functions are ordered in memory in source file text order, which used to apparantly be true with much older versions of Visual Studio.

Alas, no longer, certainly not with VS2010 compiling with link-time code generation. (I don’t know what other [non]optimizations settings do.) On inspection with VS2010, my LowestAddress function is clearly in the middle of the object code for a bunch of other C functions.

How can I (re)implement these bookends? Some kind of segment control? The options available for build in VS 2010 don’t seem to offer anything useful. (I understand that a really smart compiler might actually re-arrange the code to minimize cache line conflicts based on a call graph. Is MS actually that smart?). I don’t really insist on ordering all the functions in this region by text order; I just need the upper and lower bounds of the region.

[I’m going to try turning off link-time code generation, which is the only place that a [global] call graph could be constructed, and see what effect that has.]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:54:50+00:00Added an answer on June 13, 2026 at 4:54 am

    You can specify the order of how functions are placed in a image by using the /ORDER compiler parameter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a .Net application consisting of mixed managed and unmanaged code. We have
I have a vb application consisting of several winForms and code files. Is it
I have an application consisting of different modules written in C++. One of the
I have property management application consisting of tables: tenants landlords units properties vendors-contacts Basically
I have a C# application using WPF consisting of a single Window holding four
I have a flashlite3 application with navigation consisting of icons the user can browse
I have a web application, built with Maven, consisting of a Java (Spring) backend
I'm creating my first application and I have a window consisting of multiple subclasses
I have an application consisting of two windows, one communicates to the other and
I have an application consisting of many scripts doing some stuff on their own.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.