.section .data


scanf_str:

.string "%d"

printf_str:

.string "(input number 0-4:)\n"


printf_str1:

.string "linux\n"



x:

.int 0


.section .text

.global main

main:

pushl p

movl        %esp,p


pushl $printf_str

call       printf


pushl $x

pushl $scanf_str

call       scanf


movl  x,x


cmpl   $0,x

pushl $printf_str1

call        printf

je        END


END:

movl        p,%esp

pushl p

ret


어셈블리 기초코드임

Segmentation fault (core dumped)

프로그램이 실행이 되긴하는데

위에오류가 나옴

왜 뜨는거지? 아무리봐도 틀린게 없는거 같은데..ㅠㅠ