Problem description:
x86_64 is supposed to have backwards compatibility, and I have tested this on a couple of machines outside of repl, but when I try on repl, it does not work.
Expected behavior:
My repl is x86_64, and using nasm and ld goes well with my 32 bit asm, until i try to run it. I have checked my assembly in many different environments.
nasm -f elf ./index.asm
ld -m elf_i386 -o -s ./index.o -o index
./index
Hello World!
Actual behavior:
nasm -f elf ./index.asm
ld -m elf_i386 -o -s ./index.o -o index
./index
Bad system call (core dumped)
nasm -f elf ./index.asm
ld -m elf_i386 -o -s ./index.o -o index
qemu-i386 ./index
Hello World!
Steps to reproduce:
nasm -f elf ./index.asm
ld -m elf_i386 -o -s ./index.o -o index
./index
Bad system call (core dumped)
nasm -f elf ./index.asm
ld -m elf_i386 -o -s ./index.o -o index
qemu-i386 ./index
Hello World!
Bug appears at this link:
https://replit.com/@amukh1/rppt-1
Browser/OS/Device:
Me: Chrome, Windows + WSL, Laptop
Repl: AMD EPYK Ubuntu