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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:17:26+00:00 2026-05-26T15:17:26+00:00

len: equ 2 len: db 2 Are they the same, producing a label that

  • 0
len:  equ  2
len:  db   2

Are they the same, producing a label that can be used instead of 2? If not, then what is the advantage or disadvantage of each declaration form? Can they be used interchangeably?

  • 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-26T15:17:27+00:00Added an answer on May 26, 2026 at 3:17 pm

    The first is equate, similar to C’s:

    #define len 2
    

    in that it doesn’t actually allocate any space in the final code, it simply sets the len symbol to be equal to 2. Then, when you use len later on in your source code, it’s the same as if you’re using the constant 2.

    The second is define byte, similar to C’s:

    int len = 2;
    

    It does actually allocate space, one byte in memory, stores a 2 there, and sets len to be the address of that byte.

    Here’s some pseudo-assembler code that shows the distinction:

    line   addr   code       label   instruction
    ----   ----   --------   -----   -----------
       1   0000                      org    1234h
       2   1234              elen    equ    2
       3   1234   02         dlen    db     2
       4   1235   44 02 00           mov    ax,     elen
       5   1238   44 34 12           mov    ax,     dlen
    

    Line 1 simply sets the assembly address to be 1234h, to make it easier to explain what’s happening.

    In line 2, no code is generated, the assembler simply loads elen into the symbol table with the value 2. Since no code has been generated, the address does not change.

    Then, when you use it on line 4, it loads that value into the register.

    Line 3 shows that db is different, it actually allocates some space (one byte) and stores the value in that space. It then loads dlen into the symbol table but gives it the value of that address 1234h rather than the constant value 2.

    When you later use dlen on line 5, you get the address, which you would have to dereference to get the actual value 2.

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

Sidebar

Related Questions

I know that python has a len() function that is used to determine the
2 forms in constant declaration: len equ 2 len: equ 2 Are they the
Python's len() and padding functions like string.ljust() are not tabstop-aware, i.e. they treat '\t'
for row in c: for i in range(len(row)): if i not in keep: del
My code creats only the last instance times len(list) how can i change this
I have a NSString [WORD] that has some length [LEN]. What i need to
if len(sys.argv) < 2: sys.stderr.write('Usage: sys.argv[0] ') sys.exit(1) if not os.path.exists(sys.argv[1]): sys.stderr.write('ERROR: Database sys.argv[1]
var len = 160 - $(this).val.length; I get same value foreach key press on
I have a char data[len] populated from unzipped data that is read off of
Ive got a query that looks like: SELECT LEN(REPLACE(address, ' CA', '')) FROM Tbl

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.