Assembly/Nasm - Segmentation fault (core dumped) error

前端 未结 1 1676
长发绾君心
长发绾君心 2020-12-11 14:15

I\'m very new to NASM and I\'m trying to execute a MASM example online that I found, but has been a pain translating to NASM.

It compiles and generates an output fil

相关标签:
1条回答
  • 2020-12-11 15:02

    The assembly code you’ve got there is for DOS, but you’re assembling it to an ELF and trying to run it with Ubuntu. NASM will assemble it either way (it’s doing its job, converting the assembly to machine code), but Ubuntu won’t be able to understand the result.

    If you want to run that code, have NASM assemble a flat binary with a com file extension, and then run it in DOSBox or a virtual machine or something.

    0 讨论(0)
提交回复
热议问题