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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:05:44+00:00 2026-06-14T07:05:44+00:00

Can I do this in assembly mov eax, [ax] or must I specify the

  • 0

Can I do this in assembly mov eax, [ax] or must I specify the size mov eax, dword [ax].

  • 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-14T07:05:46+00:00Added an answer on June 14, 2026 at 7:05 am

    [ax] is not a valid 16-bit addressing mode. Change it to mov ebx, [bx] and you could do it. The ebx determines the size of the operation, so you wouldn’t need to say dword. In 32-bit mode, [bx] is unlikely to be a “useful” address, but it’s “valid” code. In 32-bit mode, mov al, [eax], mov ax, [eax] and mov eax, [eax] are all valid, and the sizes are determined by the size of the destination register, but you might want to say “byte”, “word”, or “dword” for clarity. In this(!) case, the sizes do not have to match.

    FWIW, it is possible to use 32-bit instructions – and 32-bit addressing modes – in 16-bit code. The entire address needs to be within the segment limit – usually 64k – but mov eax, [eax + ecx * 4] is valid code. Nasm (or other “competent” assembler) will generate the required “operand size override prefix” and “address size override prefix” (0x66 and 0x67).

    Don’t be afraid to try these things… although it may not be clear WHY Nasm is refusing, and if Nasm DOES accept it that doesn’t mean it will do what you intend…

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

Sidebar

Related Questions

I can't seem to figure out what eax contains after this peice of assembly:
So I've embedded my silverlight XAP like this [assembly: WebResource(GravityWeb.PlayerControl.Silverlight.SilverlightPlayer.xap, application/x-silverlight-2)] and I can
Consider this x86 assembly code: section .data foo: mov ebx, [boo] mov [goo], ebx
Why C++/CLI compiler can compile this code: using namespace System; inline void Assembly(){ __asm{
This code is a C program (bubble sort) disassembled into assembly. How can I
Can this MS-Access query be improved? i.e. the SELECT TOP 1 col FROM Table2
Can this be done quickly in jQuery before I start looping through them? Or
Can this be done? It seems like this should be possible. In general, I
Can this be done in JavaScript? type == 1 ? function1() : function2();
Can this be simplified to a one liner? Feel free to completely rewrite it

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.