Skip to content

How bad am I doing with x86 assembly? #143697

Discussion options

You must be logged in to vote

There are some issues in your x86 assembly code, as well as a few improvements that can be made. Let's examine each function:

  1. General Structure:

    • Your functions generally follow the correct prologue (saving ebp and setting up the stack), but there are some things that need fixing.
  2. Addition Function (_addIntegers):

    • This function looks good overall. It correctly takes two integers from the stack, adds them, and puts the result in eax.
  3. Subtraction Function (_subIntegers):

    • This function also looks correct, following the same pattern as the addition function.
  4. Multiplication Function (_mulInteger):

    • The issue here is with the mul instruction. The mul instruction does not take an ar…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@DumbestPerson224
Comment options

@DumbestPerson224
Comment options

Answer selected by DumbestPerson224
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Programming Help Programming languages, open source, and software development.
2 participants