Answer the question
In order to leave comments, you need to log in
Why does it give an error in fasm?
format ELF executable 3
entry start
segment readable executable
start:
mov eax,4
mov ebx,1
mov ecx,menu
mov edx,menu_size
int 80h
select_loop:
mov eax,4
mov ebx,1
mov ecx, select
mov edx, select_size
int 80h
; read data
mov eax,3
mov ebx,1
mov ecx,buffer
mov edx,1
int 80h
cmp buffer,'0'
je exit
cmp buffer, '1'
je c1
cmp buffer,'2'
je c2
jmp select_loop
c1:
mov eax,4
mov ebx,1
mov ecx, hello
mov edx, hello_size
int 80h
c2:
mov eax,4
mov ebx,1
mov ecx, go_away
mov edx, go_away_size
int 80h
exit:
mov eax,1
xor ebx,ebx
int 80h
segment readable writeable
menu db '1 - Print hello',13,10
db '2 - Print go away',13,10
db '0 - Exit',13,10
menu_size = $-menu
select db 13,10,'Select>'
select_size = $-select
hello db 13,10,'Hello!',13,10,13,10
hello_size = $-hello
go_away db 13,10,'Go away!',13,10,13,10
go_away_size = $-go_away
buffer db ?
flat assembler version 1.73.02 (16384 kilobytes memory)
program.asm [26]:
cmp buffer,0
processed: cmp buffer,0
error: invalid operand.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question