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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:35:47+00:00 2026-06-02T00:35:47+00:00

PLATFORM: Pentium 4 processor (i really need to upgrade :) running Windows XP. I

  • 0

PLATFORM: Pentium 4 processor (i really need to upgrade 🙂 running Windows XP. I am currently assembling with MASM32.

I am an absolute beginner with assembly and I am trying to figure out how to add variables. I understand how to define variables, place data in a register, and how to place registers in the stack, but I don’t know how to combine the values of two variables (by adding).

Also, could anyone give me a link or something to an easy to understand tutorial on x86 assembly, all the ones that I’ve found so far are really high-level stuff and they don’t explain much. That would be really appreciated.

Thanks in advance,
Progrmr

  • 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-02T00:35:49+00:00Added an answer on June 2, 2026 at 12:35 am

    Simple addition:

    add eax, ebx   ; Adds eax and ebx and stores the result in eax
    

    Load from memory, then add, then store in memory:

    mov eax, DWORD PTR [esi]    ; Load a double word from memory into eax
    mov ebx, DWORD PTR [edi]    ; Load a double word from memory into ebx
    add eax, ebx                ; Adds eax and ebx and stores the result in eax
    mov DWROD PTR[esi], eax     ; Store a double word in eax into memory
    

    In the examples above, DWORD PTR isn’t strictly needed, but is a good habit to practice because it remove any ambiguity and makes code easier to read.

    It’s important to remember that you can only add registers of the same size (DWORD in the examples above). If you want to add two registers of different sizes:

    mov al, BYTE PTR [esi]    ; Loads a single byte from memory into al
    mov bx, WORD PTR [edi]    ; Loads a word from memory into bx
    movzx eax, al             ; Zero extends al into the entire eax register
    movzx ebx, bx             ; Zero extends bx into the entire ebx register
    add eax, ebx              ; Adds eax and ebx and stores the result in eax
    

    This isn’t a terribly good example because there are easier ways to do the same thing, but hopefully it’ll show some of the tricks you can use.

    You can also add a memory value to a registers:

    mov eax, DWORD PTR [esi]     ; Load a double word from memory into eax
    add eax, DWORD PTR [edi]     ; Add a double word in memory to eax
    

    Here’s a good site to use as a reference: http://ref.x86asm.net/

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

Sidebar

Related Questions

Platform: Windows XP Development Platform: VB6 When trying to set an application title via
I need a cross platform way to find a running process by name and
Platform : Windows running Oracle 10g I have to modify some old dll library
Platform: Windows XP Processor : Dual Core I have a program written in C
Platform Builder is a tool for building a Windows CE Operating system on your
I have a cross platform program that runs on Windows, Linux and Macintosh. My
Platform: Windows 7, 64 bit (x64), Visual Studio 2008 I chose Python & Swig
When I do multi-platform testing on Windows it gets annoying that Eclipse shows errors
Language : C++ Platform : Windows Server 2003 I have an exe calling a
I need a cross-platform way to get the current working directory (yes, getcwd does

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.