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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:30:23+00:00 2026-06-02T19:30:23+00:00

I made this 8086 assembly program for string comparison, but it contains an infinite

  • 0

I made this 8086 assembly program for string comparison, but it contains an infinite loop. I have checked and rechecked. Can anyone find where i am wrong?

org 100
jmp start
str1: db "hello$"
str2: db "ello$"


start: 
lea bx,str1
mov si,bx
lea ax,str2
mov di,ax  
mov ax,1234
jmp compare

compare:
mov bl,[si]
cmp [di],bl
jne notequal
cmp bx,'$'
je equal
inc si
inc di
jmp compare

notequal:
mov ax,0000h 
hlt

equal:
mov bx,0001h
hlt
  ret         
  • 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-02T19:30:24+00:00Added an answer on June 2, 2026 at 7:30 pm

    I don’t know what you checked and rechecked, but you’re reading bytes from one of the strings into bl and yet comparing the entire bx with ‘$’ instead of comparing bl with ‘$’.

    Did you consider debugging your code???

    Also I don’t know why you use hlt. If interrupts are disabled, your program will never return.

    Finally, if this is a .COM program for DOS, there’s a “little” difference between org 100 and org 100h.

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

Sidebar

Related Questions

I have made this infinitely scrolling script, but I can't rebind the window scroll
I made this plugin to make the method '[0].click()' cross-browser, but I can not
Made this nice little loop for hiding and showing div's, works as a charm
I made this program for a school, and it involves a telnet server. When
I have made this example and it works fine on a plain aspx webpage.
I made this little function: public String getDay() { String day = (String)android.text.format.DateFormat.format(E, new
I made this question over at the Openfire groups, but it seems to be
I made this code to resize images with two factors. It works, but the
I made this program just out of interest and wanted to make it better.
I made this simple example , which doesn't work in Chrome 16 (latest), but

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.