Windows Bash上的Excecute程序?

时间:2017-03-17 10:42:00

标签: linux bash assembly windows-10

我写了一些.s程序,女巫必须在显示器上打印一个小字符串。 然后我在Windows 10上打开了linux bash并完成了:

as -o file.o file.s
ld -o file file.o
./file

但它没有打印任何东西 为什么?我在linux虚拟机上尝试了相同的代码并且可以正常工作

这个文件是一个简单的"你好世界"在学校学习集会

.section .data

hello:
    .ascii "Hello, World!\n"

hello_len:
    .long . - hello


.section .text
    .global _start

_start:

    movl $4, %eax
    movl $1, %ebx
    leal hello, %ecx
    movl hello_len, %edx
    int $0x80
    movl $1, %eax
    xor %ebx, %ebx
    int $0x80

1 个答案:

答案 0 :(得分:0)

由于WSL目前处于测试阶段,因此某些功能尚未实现。运行32位ELF二进制文件是缺少功能的一部分(问题记录在WSL githubuservoice)。

目前,为了做你想做的事,你可以等到开发者发布这个功能,或者使用x86_64找到的#define WINVER 0x0501 #define _WIN32_WINNT 0x0501 #include <commctrl.h> 指令集重做你的程序。