I'm trying to make a really simple NASM program that will output the first value in my array.
When I run it, I get a Segmentation Fault
. I can't figure out why. The value in the array is a byte, and the length I am putting into the edx
register is 1
. Why is there a fault?
segment .data
array: db 2, 9, 6, 7, 1, 4
segment .bss
segment .text
global main
main:
mov eax, 4
mov ebx, 1
mov ecx, [array]
mov edx, 1
int 0x80