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 5 and 10 but this also getting an error
section .data
msg db 'The sum is: ',0
section .text
global _start
_start:
mov eax, 5 ; First argument: 5
mov ebx, 10 ; Second argument: 10
call sum
sum:
push ebp ; Function prologue
mov ebp, esp
add eax, ebx ; Add the two arguments
mov eax, 4 ; Write system call number
mov ebx, 1 ; File descriptor: stdout
mov ecx, msg ; Message to print
mov edx, 14 ; Length of message
int 80h ; Call kernel
mov eax, 4 ; Write system call number
mov ebx, 1 ; File descriptor: stdout
mov ecx, eax ; Result to print
add ecx, 48 ; Convert result to ASCII
mov edx, 1 ; Length of result
int 80h ; Call kernel
pop ebp ; Function epilogue
ret
mov eax, 1 ; Exit system call number
xor ebx, ebx ; Exit status: 0
int 80h ; Call kernel
Using online asm compiler on tutorialspoint but

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!