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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:15:25+00:00 2026-06-04T10:15:25+00:00

I’m trying to solve an equation. I’m using MASM32. I think that I’m using

  • 0

I’m trying to solve an equation. I’m using MASM32. I think that I’m using the correct code. But I am getting “greater” value even when I’m using necessary values to solve the equation. What am I missing or doing wrong?

.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
blogas_a db "OK",0
a_value dw 6   
a_min dw 1     
a_max dw 7



blogas_b db "less",0
b_value dw -9  
b_min dw -10
b_max dw 19

blogas_c db "greater",0
c_value dw 2
c_min dw -3
c_max dw 27

.code
start:
;________1 lygtis______a-b*c+2*a=36____________________________
_check1:
mov ax, [a_value]
push ax

mov ax, [b_value]
mov bx, [c_value]
mul bx
push ax

mov ax, 2
mov bx, [a_value]
mul bx
push ax

pop ax
pop bx
add ax, bx
pop bx
sub bx, ax

cmp ax, 36
je _outOfRange
jg _outOfRange2
jl _outOfRange3
;_____________________________________
_outOfRange: invoke StdOut, addr blogas_a
JMP _exit
_outOfRange3: invoke StdOut, addr blogas_c
JMP _exit
_outOfRange2: invoke StdOut, addr blogas_b
_exit: invoke ExitProcess, 0
end start
  • 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-04T10:15:26+00:00Added an answer on June 4, 2026 at 10:15 am

    sub bx, ax will modify bx, and ax will remain as it was. You’re probably looking for sub ax, bx instead.


    Edit: You’re computing a different equation than your comment suggests. Your code pushes the following values to the stack:

    a
    b * c
    a * 2
    

    and pops them to perform the following math (after applying the change I suggested above):

    (a * 2) + (b * c) - (a)
    

    You need to modify the math you’re performing.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function

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.