简体   繁体   English

在Windows上编译Linux汇编程序

[英]Compiling Linux assembler on Windows

    .string "Hello\n"
    .globl main
main:
    pushl %ebp
    movl %esp, %ebp
    pushl $hello
    call puts
    movl $0, %eax
    movl %ebp, %esp
    popl %ebp
    ret

This code works on 32bit Linux. 此代码在32位Linux上有效。 How can I run this on Windows? 如何在Windows上运行它?

gcc hello.s

You need to find a Windows version of an x86 assembler. 您需要找到Windows版本的x86汇编程序。 The GNU Assembler is available on Windows through the MinGW project. 可通过MinGW项目在Windows上使用GNU汇编器。 This is the same assembler you are using on Linux. 这是您在Linux上使用的同一汇编程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM