Need Help Writing an Essay?
Tell us about your assignment and we will find the best writer for your PAPER.
GET WRITING HELP!
Description
Assembly language
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: “,0
message2 db “Enter another number: “, 0
message3 db “The larger number is: “, 0
segment .bss
input1 resd 1 ; first number entered
segment .text
global asm_main
asm_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
The post University of Guadalajara Assembly Language 32x Programming Code appeared first on Paper Answers.
For over a decade, our online assignment writing company has been providing invaluable assistance to university students in completing their academic papers. At paperwritingagency.com, we offer comprehensive coverage of over 75 academic disciplines, catering to the diverse needs of students. Our extensive range of services encompasses more than 137 types of papers, including essays, term papers, coursework, plans, projects, theses, research papers, PowerPoint/poster presentations, and Excel homework assignments.
Together we can improve your grades. Our team of competent online assignment writers provides professional writing help to students in all academic levels. No matter whether you need a narrative essay, 5-paragraph essay, persuasive essay, descriptive essay, or expository essay, we will provide you with quality papers at student friendly price.