Division of two numbers in NASM

Viewed 18341

Starting to teach myself assembly (NASM) I wanted to know how to divide 2 numbers (For instance on Windows).

My code looks like this but it crashes.

global _main
extern _printf

section .text

_main:

mov eax, 250
mov ebx, 25
div ebx
push ebx
push message 

call _printf
add esp , 8
ret

message db "Value is = %d", 10 , 0

I wonder what's really wrong? It doesn't even display the value after the division.

2 Answers
Related