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
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...
;Assembly x86-64 ;Q9: What is the value of eax (in decimal) after the function call in...
;Assembly x86-64 ;Q9: What is the value of eax (in decimal) after the function call in _start returns? global _start _start: mov edi, 4 call function1 global function1 function1: push rdi inc edi mov esi, 2 call function2 pop rdi mul edi ret global function2 function2: mov eax, edi mov edx, 0 div esi add eax, edi add eax, edx ret ;Q10: A function uses 10 integer arguments. What is the appropriate value for the blank operand to clear the...
Using Windows 32 framework , write an assembly language program; Write a recursive procedure to find...
Using Windows 32 framework , write an assembly language program; Write a recursive procedure to find the greatest common divisor of two non negative numbers. You should use Euclidean algorithm and this is typically discussed in CSC 230. Your procedure: ❼ Needs to follow cdecl protocol. ❼ Needs to take two parameters. ❼ Should return -1, if the parameters are negative. ❼ Should return gcd, if the parameters are non negative. Your main procedure should do the followings. ❼ Read...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT