Cześć. Zaczynam uczyć się assemblera i nie mogę uruchomić pliku. Robię wszystko tak jak piszą w komentarzach w kodzie najpierw używam komendy nasm -f elf helloworld.asm i tworzy mi się plik helloworld.o potem ld -m elf_i386 helloworld.o -o helloworld ale wyskakuje mi błąd, że obsługiwana jest opcja i386pe zamiast elf_i386 więc kolejna komenda wygląda tak : ld -m i386pe helloworld.o -o helloworld. Następnie tworzy mi się plik który nazywa się helloworld i nie ma on żadnego rozszerzenia piszę tylko we właściwościach, że to po prostu plik. gdy próbuję odpalić program za pomocą ./helloworld wyskakuje mi taki błąd:
'.' is not recognized as an internal or external command,
operable program or batch file.
Tutorial do assemblera mam z tej strony: https://asmtutor.com/#lesson1
; Hello World Program - asmtutor.com
; Compile with: nasm -f elf helloworld.asm
; Link with (64 bit systems require elf_i386 option): ld -m elf_i386 helloworld.o -o helloworld
; Run with: ./helloworld
SECTION .data
msg db 'Hello World!', 0Ah ; assign msg variable with your message string
SECTION .text
global _start
_start:
mov edx, 13 ; number of bytes to write - one for each letter plus 0Ah (line feed character)
mov ecx, msg ; move the memory address of our message string into ecx
mov ebx, 1 ; write to the STDOUT file
mov eax, 4 ; invoke SYS_WRITE (kernel opcode 4)
int 80h
Pliki, które mi powstały:
Wiecie dlaczego tak się dzieje i jak to naprawić?