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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:39:32+00:00 2026-06-11T17:39:32+00:00

All I need to do is get the user-inputted strings and put them inside

  • 0

All I need to do is get the user-inputted strings and put them inside the array or structure, but I keep getting the error

Invalid effective address

What does this mean?

The code

section .data
  fName db 'Enter your first name: '
  fNameLen equ $-fName
  lName db 'Enter your last name: '
  lNameLen equ $-lName

  numberOfStruct equ 50
  structSize equ 25
  firstName equ 0
  lastName equ 10


section .bss
  person resb numberOfStruct*structSize

section .text
  global _start

_start:
  mov esi, 0
  input_start:
    mov eax, 4
    mov ebx, 1
    mov ecx, fName
    mov edx, fNameLen
    int 80h

    mov eax, 3
    mov ebx, 0
    lea ecx, [person+structSize*esi+firstName] ;This is where the error appears
    mov edx, 15
    int 80h

    mov eax, 4
    mov ebx, 1
    mov ecx, lName
    mov edx, lNameLen
    int 80h

    mov eax, 3
    mov ebx, 0
    lea ecx, [person+structSize*esi+lastName] ;This is where the error appears
    mov edx, 10
    int 80h

    inc esi

    cmp esi,10
    jl input_start

    exit:
    mov eax, 1
    mov ebx, 0
    int 80h

Did I do it entirely wrong?

  • 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-11T17:39:33+00:00Added an answer on June 11, 2026 at 5:39 pm

    Edit: Added code and edited answer to match changes in question.

    lea ecx, [person+structSize*esi+firstName] ; this is where the error appears
    
    lea ecx, [person+structSize*esi+lastName]   ; this is where the error appears
    

    Both these have the same error: You cannot multiply with 25, the valid scaling factors are 1, 2, 4 and 8.

    Edit: As Harold pointed out, imul is the easiest way to compute the address:

     imul ecx,esi,25                    ; ecx == 25*esi
     lea ecx,[ecx+person+firstName]     ; ecx == 25*esi + person + firstName
    

    You can also compute the address by using 3 lea‘s:

     lea ecx,[8*esi]                    ; ecx == 8*esi
     lea ecx,[ecx+2*ecx]                ; ecx == 24*esi
     lea ecx,[ecx+esi+person+firstName] ; ecx == 25*esi + person + firstName
    

    Wikipedia has a useful summary of all 64-bit, 32-bit and 16-bit addressing modes.

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

Sidebar

Related Questions

I need to get all user groups from liferay portal, but UserGroupServiceUtil from it's
I need to get all controls inside a specific RowDefinition/ColumnDefinition without iterating through all
I need a get a list of all databases in a Couchdb server inside
I need to get the coordinates of all the pixels inside this particular region
i have PostsController controller and in this controller i need get all user list.
I need get all items these have no categories int? categoryId = null; var
All I need is to get the list of currently open documents in the
I need to get all the appointments from my table for a particular patient,
I need to get all the objects whose id matches a specific pattern .
I need to get all substrings from string. For ex: StringParser.GetSubstrings([start]aaaaaa[end] wwwww [start]cccccc[end], [start],

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.