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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:39:28+00:00 2026-06-03T01:39:28+00:00

I am trying to make a password file where you enter the password and

  • 0

I am trying to make a password file where you enter the password and it shows you all your passwords. My current code is this, but it has an error:

.386
.model flat,stdcall
option casemap:none

include     \masm32\include\windows.inc
include     \masm32\include\kernel32.inc
include     \masm32\include\masm32.inc
includelib  \masm32\lib\kernel32.lib
includelib  \masm32\lib\masm32.lib

.data
        input   db 'Enter the password:',13,10,0
        string  db 'The passwords are:',0
        space db '       ',0
        pass1 db 'example password 1',0
        pass2 db 'example password 2',0
        pass3 db 'example password 3',0
        pass4 db 'example password 4',0
        ermsg db 'Incorrect Password. Exiting....',0
        count dd 0
            comp dd 13243546

.data?
        buffer db 100 dup(?)
.code
start:
_top:
        invoke StdOut,ADDR input
        invoke StdIn,ADDR buffer,100 ; receive text input
        cmp buffer, comp ;sorry for not pointing this out - this is line 32
        jz _next
        jmp _error
_next:
        invoke StdOut, ADDR string
        invoke StdOut, ADDR space
        invoke StdOut, ADDR pass1
        invoke StdOut, ADDR pass2
        invoke StdOut, ADDR pass3
        invoke StdOut, ADDR pass4
        invoke ExitProcess,0
_error:
        invoke StdOut, ADDR ermsg
        mov eax, 1
            mov count, eax
            cmp count, 3
            jz _exit
            jmp _top:
_exit:
            invoke ExitProcess, 0

This is the error:

 test.asm(32) : error a2070: invalid instruction operands

Why does that happen. I understand that the error is on line 32 but I don’t understand what the error is.

  • 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-03T01:39:29+00:00Added an answer on June 3, 2026 at 1:39 am

    cmp is used to compare two bytes/words/dwords, not strings. So you’re basically asking it to compare the first four bytes of buffer to the four bytes of comp and using invalid syntax to do this.

    To compare strings, you need to use cmps or a manual loop.

    Additionally, comp should be declared as comp db '13243546', 0 . The way you declared it now makes it into a dword 00CA149A, which is equivalent to the C string "\x9A\x14\xCA" – quite complex to type 🙂

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

Sidebar

Related Questions

I have been trying to make OOP PHP5 code. But I think my attempts
I'm trying to make a simple text encrypter (not all functions are complete) but
I'm trying to make a method of compressing file using Ionic.Zip.dll of DotNetZip. Code
I'm trying to make a password protected project in Visual Studio 2010. Is there
I'm working on a password reset function and trying to check to make sure
I'm trying make a login window where a user is prompted to enter their
I'm trying make an entity with doctrine that has three associations with other entities
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
Trying to make a simple number clicker control for BlackBerry 6/7, like this: At
Trying to make a small countdown timer in my app but it's not working.

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.