University of Guadalajara Assembly Language 32x Programming Code

Assemblylanguage

Modify this code into a program that receives two numbers and prints the minimum. The program then doubles the minimum and compares it to another number. It will then print the new minimum.

Ex:

Input1 = 2

Input2=3

Minimum=2

Newinput1=4

Newinput2=3

Newminimum=3

MY CODE:

%include “asm_io.inc”segment .data

message1 db “Enter a number: “,0message2 db “Enter another number: “, 0message3 db “The larger number is: “, 0

segment .bss

input1 resd 1 ; first number entered

segment .text global asm_mainasm_main: enter 0,0 ; setup routine pusha

mov eax, message1 ; print out first message call print_string call read_int ; input first number mov [input1], eax

mov eax, message2 ; print out second message call print_string call read_int ; input second number (in eax)

xor ebx, ebx ; ebx = 0 cmp eax, [input1] ; compare second and first number setg bl ; ebx = (input2 > input1) ? 1 : 0 neg ebx ; ebx = (input2 > input1) ? 0xFFFFFFFF : 0 mov ecx, ebx ; ecx = (input2 > input1) ? 0xFFFFFFFF : 0 and ecx, eax ; ecx = (input2 > input1) ? input2 : 0 not ebx ; ebx = (input2 > input1) ? 0 : 0xFFFFFFFF and ebx, [input1] ; ebx = (input2 > input1) ? 0 : input1 or ecx, ebx ; ecx = (input2 > input1) ? input2 : input1

mov eax, message3 ; print out result call print_string mov eax, ecx call print_int call print_nl

popa mov eax, 0 ; return back to C leave ret

Calculate your order
275 words
Total price: $0.00

Top-quality papers guaranteed

54

100% original papers

We sell only unique pieces of writing completed according to your demands.

54

Confidential service

We use security encryption to keep your personal data protected.

54

Money-back guarantee

We can give your money back if something goes wrong with your order.

Enjoy the free features we offer to everyone

  1. Title page

    Get a free title page formatted according to the specifics of your particular style.

  2. Custom formatting

    Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.

  3. Bibliography page

    Don’t pay extra for a list of references that perfectly fits your academic needs.

  4. 24/7 support assistance

    Ask us a question anytime you need to—we don’t charge extra for supporting you!

Calculate how much your essay costs

Type of paper
Academic level
Deadline
550 words

How to place an order

  • Choose the number of pages, your academic level, and deadline
  • Push the orange button
  • Give instructions for your paper
  • Pay with PayPal or a credit card
  • Track the progress of your order
  • Approve and enjoy your custom paper

Ask experts to write you a cheap essay of excellent quality

Place an order