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 8924253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:21:39+00:00 2026-06-15T07:21:39+00:00

Here’s a test procedure from a program I’m working on, I pass in some

  • 0

Here’s a test procedure from a program I’m working on, I pass in some parm’s via the stack, one of which is a pointer. When I try to change the value of the dereferenced pointer, the variable isn’t updated.

_testProc proc
    push bp                             ;Save base pointer to stack
    mov bp, sp                          ;Set new base pointer
    sub sp, 4                           ;Allocate stack space for locals
    pusha                               ;Save registers to stack

    mov di, [bp + 08]                   ;Parm 3 - ptr to variable

    mov word ptr [di], 10   ; <---- Doesn't work. di contains an address, 
                            ;       but what it points at doesn't get updated

    popa                                ;Restore registers from stack
    mov sp, bp                          ;Remove local vars by restoring sp
    pop bp                              ;Restore base pointer from stack
    ret 6                               ;Return and also clean up parms on stack
_testProc endp
  • 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-15T07:21:40+00:00Added an answer on June 15, 2026 at 7:21 am

    The 8086 produces and address by combining the contents of a segment register and an index register; I show that as [SR,IR].

    Your update via register di is updating a location defined by [DS,DI]; mov instructions without any special prefix default to using the DS register. If you got the address DI as an offset for some other segment (ES? SS?) then you are in effect combining the wrong registers to hit the address you desire.

    Your mistake is in not being clear about what the conventions are for passing a “pointer” to your routine. What you’ve define assume a relative offset from DS.

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

Sidebar

Related Questions

Here's a dump of the stats provided my mod_pagespeed from one of my sites.
Here is the script I'm using, copied directly from Google: <script type=text/javascript> var _gaq
Here's what I'm trying to accomplish with this program: a recursive method that checks
Here is my code, which takes two version identifiers in the form 1, 5,
Here's a piece of code I copied from http://www.schillmania.com/content/projects/javascript-animation-1/demo/ Very simple JS animation: function
Here's what I'm doing. I want to upload multipart file via Ajax to my
Here is a code snippet I was working with: int *a; int p =
Here is my program to find all the subsets of given set. To solve
Here's my procedure: DROP PROCEDURE IF EXISTS `couponExpires`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `couponExpires`(IN couponID BIGINT,
Here are some facts about my app followed by a question My app has

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.