alright, so I just tried to write a hello world program for windows. I took a course on 16 bit assembly on one of those old machines, but I've never written a piece of assembly code on a new machine.
this is my attempt taken directly from tutorials_point:
section .text
global _start ;must be declared for linker (ld)
_start: ;tells linker entry point
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel
section .data
msg db 'Hello, world!', 0xa ;string to be printed
len equ $ - msg ;length of the string
to my understanding this outputs hello world to stdout by invoking an interrupt. I used nasm on cmd:
nasm -f elf file.asm
ld -m i386pe -s -o file.exe file.o
I guess that I need to create an exe file differently, since this was originally meant to run on linux. if so, please correct my mistake.