您好StackOverFlowers!
我对整个linux事物是非常陌生的,并且我正在使用Cygwin尝试执行以下操作。
将测试文件通过解析器...
./parser < test.c > test.asm //工作并生成ASM代码
按照本教程中的描述执行此行,我不确定它到底是做什么的...
nasm -f elf test.asm //作品
最后一行创建可执行文件(如果我正确理解了本教程)
ld -s -o test test.o
我ld: i386 architecture of input file test.o' is incompatible with i386:x86-64 output在这条线上出现错误。我知道这是因为我正在尝试从32位升级到64位,但是我不知道该如何解决。我尝试使用elf_i386,但得到了ld: unrecognised emulation mode: elf_i386. Supported emulations: i386pep i386pe。
任何和所有建议都非常感谢!
编辑:
Test.asm文件
section .data
numbers db "0123456789", 0xA
inputchar db 0
section .text
global F_124565444
F_124565444:
push ebp
mov ebp, esp
sub esp, 4
mov dword [ebp-4], 0
jmp G2
G1:
add dword [ebp-4], …Run Code Online (Sandbox Code Playgroud)