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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:48:25+00:00 2026-05-16T16:48:25+00:00

.intel_syntax noprefix .include console.i .data ask1: .long 0 ask2: .long 0 ans : .long

  • 0

.intel_syntax noprefix

.include "console.i"


.data
        ask1:   .long  0
        ask2:   .long  0
        ans :   .long  0

.text
        ask:    .asciz "Enter number: "
        ans1:   .asciz "multiplication= "

_entry:

        Prompt ask
        GetInt ask1
        Prompt ask
        GetInt ask2

        mov eax, ask1
        mov edx, ask2
        mul edx
        mov ans,edx

        Prompt ans1
        PutInt ans
        PutEol

 ret

.global _entry

.end



OUTPUT:
      Enter number: 2
      Enter number: 4
      multiplication= 0


In above code it gives output as 0.
why it is showing 0  instead of 8 ?

edit1: added mov ans, edx
  • 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-16T16:48:25+00:00Added an answer on May 16, 2026 at 4:48 pm

    You’re using quite a few macros I don’t understand, but the basic problem seems to be that you’re not doing anything with the results of ‘mul edx’.

    The result of MUL EDX are in edx:eax and you seem to be throwing that information away without putting it in your variable ans.

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

Sidebar

Related Questions

I have a code like this: .bss woof: .long 0 .text bleh: ...some op
Intel's 32-bit processors such as Pentium have 64-bit wide data bus and therefore fetch
What is wrong with the following code? __asm__(mov %0, %%eax : :a (ptr)); __asm__(.intel_syntax
#include <stdio.h> #define OPT //define for assembly int main() { char chr; for(chr =
I'm loading XAML using XamlReader and I'm having trouble loading it when I data-bind
Intel makes microprocessor, so he could define the instruction format and its corresponse assembly
From Intel's article : The integer format conversions are commonly used in imaging and
With Intel's launch of a Hexa-Core(6) processor for the desktop, it looks like we
I read the Intel manual and found there is a lock prefix for instructions,
experts,i wonder the intel x86 machineCode/assemblyCode conversion is singleSide or bothSide? means: assemblyCode --->

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.