RosettaCodeData/Task/Function-definition/X86-Assembly/function-definition-2.x86

25 lines
336 B
Text
Raw Permalink Normal View History

2015-02-20 00:35:01 -05:00
section .text
global _start
_multiply_regs:
2014-01-17 05:32:22 +00:00
mul ebx
mov eax, ebx
ret
2015-02-20 00:35:01 -05:00
_multiply_stack:
enter 2,0
mov eax, [esp+4]
mov ebx, [esp+8]
mul ebx
mov eax, ebx
leave
ret
_start:
mov ax, 6 ;The number to multiply by
mov ebx, 16 ;base number to multiply.
call _multiply_regs
push 6
push 16
call _multiply_stack