Question: Using online asm compiler on tutorialspoint but can't seem to get it right. Trying to add two numbers 5 and 1 0 but this also
Using online asm compiler on tutorialspoint but can't seem to get it right. Trying to add two numbers and but this also getting an error
section data
msg db 'The sum is:
section text
global start
start:
mov eax, ; First argument:
mov ebx, ; Second argument:
call sum
sum:
push ebp ; Function prologue
mov ebp, esp
add eax, ebx ; Add the two arguments
mov eax, ; Write system call number
mov ebx, ; File descriptor: stdout
mov ecx, msg ; Message to print
mov edx, ; Length of message
int h ; Call kernel
mov eax, ; Write system call number
mov ebx, ; File descriptor: stdout
mov ecx, eax ; Result to print
add ecx, ; Convert result to ASCII
mov edx, ; Length of result
int h ; Call kernel
pop ebp ; Function epilogue
ret
mov eax, ; Exit system call number
xor ebx, ebx ; Exit status:
int h ; Call kernel
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
