Question

x86-64 Windows Assembly Language. A YASM Assembly Language Program that adds 2 unsigned Integer values and...

x86-64 Windows Assembly Language. A YASM Assembly Language Program that adds 2 unsigned Integer values and produces formatted console output using the 'C' library function printf().

Homework Answers

Answer #1

dat1 db ff

dat2 db ff

res dw ?

In the code segment

mov ax, dat1
add ax, dat2
mov dl,0
adc dl,0 ;initialize the contents of dl and use it to store the carry flag
mov byte ptr res, ax
mov byte ptr res+1, dl

printf function in assembly :

mov rdi,formatStr ; first argument: format string
mov rsi,5 ; second argument (for format string below): integer to print
mov al,0 ; magic for varargs (0==no magic, to prevent a crash!)

extern printf
call printf

ret

formatStr:
        db `The int is %d\n`,0
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
In x86-64 Windows Assembly Language. Program that adds two unsigned integer values and produces formatted console...
In x86-64 Windows Assembly Language. Program that adds two unsigned integer values and produces formatted console output using the 'C' library function printf(). The two unsigned integer values are input by the user from the keyboard at runtime using the 'C' library function scanf().
Convert this C++ program exactly as you see it into x86 assembly language: // Use the...
Convert this C++ program exactly as you see it into x86 assembly language: // Use the Irvine library for the print function #include <iostream> // The string that needs to be printed char word[] = "Golf\0"; // Pointer to a specific character in the string char * character = word; //NOTE: This main() function is not portable outside of Visual Studio void main() { // Set up a LOOP - See the while loop's conditional expression below int ecx =...
Write a program in assembly language for x86 Processors, that uses a loop to calculate the...
Write a program in assembly language for x86 Processors, that uses a loop to calculate the first seven values of the Fibonacci number sequence, described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n -1) + Fib(n - 2)
write a MIPS assembly program to get an integer input from the user and multiply it...
write a MIPS assembly program to get an integer input from the user and multiply it by 2 and print output to the console
Using Kip irvine32 X86 assembly language using Visual Studios. Please use CORRECT SYNTAX and actually run...
Using Kip irvine32 X86 assembly language using Visual Studios. Please use CORRECT SYNTAX and actually run on Visual Studio as asm file before posting. I keep getting answers that simply solve the problem without writing an actual program that runs on visual studio. Write a program that evaluates the following arithmetic expression: ((A+B)/C) * ((D-A)+E) Assign test values to the variables and display the resulting value.
Assembly Language Programming create an .asm [assembly language program file, using Microsoft Visual Studio or equivalent...
Assembly Language Programming create an .asm [assembly language program file, using Microsoft Visual Studio or equivalent Windows32 integrated development environment (IDE)] program into one that inputs two positive integers, and outputs their greatest common divisor, by implementing the following pseudo-code: input num1 and num2 (assume num1 > 0 and num2 > 0) gcd := num1 remainder := num2 repeat numerator := gcd gcd := remainder remainder := numerator % gcd until (remainder == 0) output gcd The following 3 windows...
Write a simple ARM assembly language program that finds the mean (as an integer) of all...
Write a simple ARM assembly language program that finds the mean (as an integer) of all values of an integer array. When your program starts, you should assume that r0 contains the address of the array and r1 contains the number of integers in the array. When you program finishes, the mean should be stored in r2. You may use other registers as stack registers.
Assembly Language Programming Write a complete assembly program that inputs a small signed integer n, whose...
Assembly Language Programming Write a complete assembly program that inputs a small signed integer n, whose value can fit within 8 bits, and outputs the value of the expression n2 – n + 6. (This is not C++ or Java. Has to be masm file)
Please complete in MASM (x86 assembly language). Use the code below to get started. Write a...
Please complete in MASM (x86 assembly language). Use the code below to get started. Write a program that uses a loop to calculate the first seven values of the Fibonacci number sequence, described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n – 1) + Fib(n – 2). .386 .model flat,stdcall .stack 4096 ExitProcess PROTO,dwExitCode:DWORD .data    ; define your variables here .code main PROC    ; write your assembly code here    INVOKE ExitProcess,0 main...
C language Create the following programs: Program to solve for Area of Rectangle Variable inputs for...
C language Create the following programs: Program to solve for Area of Rectangle Variable inputs for length and width of integer data type Variable output for area of integer data type Program to find Area of Circle variable array with 10 inputs from 3-30 by steps of 3 variable array with 10 solutions for Area of Circle of float data type Program to solve for any angle with inputs of x and y using the standard Cartesian coordinate system Use...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT