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

  • Home
  • SEARCH
  • 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 8225575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:27:36+00:00 2026-06-07T15:27:36+00:00

I am writing a simple VM and I have a question on implementing object

  • 0

I am writing a simple VM and I have a question on implementing object and structure member access.

Since the begin address of a program is arbitrary on each run, and subsequently the address of each and every of its objects is arbitrary too.

Thus the only way I can think of to access an object or its member object is by accessing an offset from the “base” pointer, which means there is an arithmetic operation needed to access anything in a program structure.

My question is whether this is the way it is done in professional compilers, because obviously this approach adds some overhead to the runtime, and I myself can’t think of any way to offload this process from the runtime because of the lack of guarantees for consistency of memory allocation and its address?

  • 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-07T15:27:39+00:00Added an answer on June 7, 2026 at 3:27 pm

    Most computers for many decades provide addressing modes that let you specify the address as a combination of a base and an offset, and the actual calculation is carried out in the hardware for no additional cost in CPU clock cycles.

    More recent (past few decades) computers offer hardware for virtualizing memory layout, meaning that even through the physical address of an item is different on every run, its address in the virtual address space remains the same. Again, there is no additional cost for using the base address, because the calculations are performed implicitly and invisibly to the executing binary code of a program.

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

Sidebar

Related Questions

I'm writing a simple web app in PHP that needs to have write access
I have the following simple methods for writing a python object to a file
I have a rather simple threading question. I'm writing a simple utility that will
I'm writing a simple client-server system and the question is: how to structure my
I'm writing a simple shopping cart application and have hit a road block. Currently
I'm writing a simple game and I'm going to have the mouse control the
I am writing a simple little DSL for specifying constraints on messages, and Have
I'm writing a simple calendar control for better understanding of WPF. I have a
I'm writing a simple batch downloader for files, which have the format Y-m-d.pdf. I
I have a problem with protocol-buffers in Haskell. I'm writing a simple UDP receiver

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.