Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run NASM Assembly on Windows 10 Insider 14332? #397

Closed
andischocke opened this issue May 19, 2016 · 1 comment
Closed

How to run NASM Assembly on Windows 10 Insider 14332? #397

andischocke opened this issue May 19, 2016 · 1 comment

Comments

@andischocke
Copy link

I've tried to run this simple assembly program on Windows 10 Insider Build with the Ubuntu Bash. However I always get the Error message: "bash: ./hello: cannot execute binary file: Exec format error".
So I've run said file on Ubuntu VM where it works without problems. Both operating systems are 64 bit. It turns out Windows can compile the code but not run it.
I use nasm -f elf32 hello.asm, gcc -m32 hello.o -o hello and ./hello as commands.
I appreciate any help.

section .text
global main
main:
mov eax, 4 ;system call number (sys_write)
mov ebx, 1 ;file descriptor (stdout)
mov ecx, mymsg ;message to write
mov edx, mylen ;message length
int 80h ;call kernel

mov eax, 1 ;system call number (sys_exit)
mov ebx, 0 ;exit with error code 0
int 80h ;call kernel

section .data
mymsg db 'Hello World!', 0xa
mylen equ $-mymsg

@benhillis
Copy link
Member

Currently WSL only supports amd64 binaries (elf64). This is being tracked by #228 and #390 so I'm going to go ahead and close this out as a duplicate.

Thanks for trying out WSL!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants