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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:13:02+00:00 2026-05-13T21:13:02+00:00

There is something I can’t digest. I’m learning some assembler and right now I’m

  • 0

There is something I can’t digest. I’m learning some assembler and right now I’m at the chapter with addressing. I understand the concept of brackets for dereferencing, but somehow when I see the usage of it I just can’t soak up the point of it. To be a little bit more exact here is where my confusion started:

mov al, [L1]

Here I suppose L1 as an example case is some kind of macro which is later substituted for a real address in the machine code, right?

So what this instruction does is: dereferencing al register (because you could hardly change physical address) and changing the value to the one stored at L1.

If till now everything is ok:

mov [L1], al

that would analogicaly mean, there must have been an address stored (so there was some point in doing this) and you change it to some other place in memory, right?

If you could just tell me it’s ok in case you don’t see any mistakes please do it, that would make it possible for me to continue learning.

One last thing, NASM adds a bunch of 0xAA55 under my code (this sequence is supposed to end the program right?), why is it there so many times?

  • 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-05-13T21:13:03+00:00Added an answer on May 13, 2026 at 9:13 pm

    L1 is typically/probably a label, associated with one particular address in memory. The programmer defines various labels for his/her convenience, and such labels are used to symbolically represent a particular location in memory (L1 is a lousy name; labels are typically indicative of the underlying purpose of the location: say, PingCounter, ErrorMessage, Login and the like).

    A label for 1 byte of static storage is how a C compiler would implement char L1; at global scope.


    In NASM syntax, mov edi, L1 will assemble to the mov eax, imm32 form of mov, i.e. the label address will become a 32-bit immediate in the machine code. (The assembler doesn’t know the final numeric value, but the linker does.) Beware that in MASM syntax, this would be a load and you’d need mov edi, OFFSET L1 to get a label address as an immediate.

    But mov al, [L1] will assemble to a different instruction, with the 32-bit address embedded in the machine code as an address to be dereferenced. This instruction loads 1 byte from the address L1, and places it in AL.

    In the assembly language, this indirect addressing mode is signified by square bracketing the source or destination operand of a given instruction. (But not both: x86 only supports at most one explicit memory operand per instruction.)

    mov al, [L1]
    

    uses the address stored in L1, to locate some location in memory and reads 1 byte (= 8 bits = the size of AL register) at this location, and loads it into the AL register.

      mov [L1], al
    

    Does this in reverse. i.e., specifically, read the address stored in L1, use this address to find a particular place in memory and stores the contents of AL register there.


    Provided that you understand the following information to be incomplete and somewhat outdated with regards to the newer processors in the x86 family, this primer on the 8086 architecture is probably very useful to get one started with Assembly language for the x86 family.
    The advantage of starting with this “antiquity of a CPU” (still in use, actually), is that the fundamental concepts are all there, unencumbered of the newer sets of registers, fancy addressing modes, modes of operation and other concepts. The bigger sizes, features and modes of the newer CPUs merely introduce a combinatorial explosion of options, all (most?) of them useful in their way, but essentially irrelevant for an initiation.

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

Sidebar

Related Questions

Obviously I can do and DateTime.Now.After - DateTime.Now.Before but there must be something more
Is there something like InstallShield that I can use for free?
Is there something like a panel that I can use in a MFC application.
In C# you can use verbatim strings like this: @\\server\share\file.txt Is there something similar
How can I comment a JSP expression like: <%= map.size() %> Is there something
I thought there was something in GExperts to do this, but I can't see
Are there any good code profilers/analyzers for Erlang? I need something that can build
Is there a SSCLI equivalent for .Net Framework 3.5? Something that can be debugged
I can do an eval(something()); to execute the code dynamically in JavaScript. Is there
Is there something like the Python descriptor protocol implemented in other languages? It seems

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.