簡體   English   中英

這是什么樣式的組件(intel、att...等?),我該如何生產它?

[英]What style assembly is this (intel, att...etc?) and how can I produce it?

我正在嘗試生成這樣的匯編代碼(以便它與 nasm 一起使用)

;hello.asm
[SECTION .text]

global _start


_start:

    jmp short ender

    starter:

    xor eax, eax    ;clean up the registers
    xor ebx, ebx
    xor edx, edx
    xor ecx, ecx

    mov al, 4       ;syscall write
    mov bl, 1       ;stdout is 1
    pop ecx         ;get the address of the string from the stack
    mov dl, 5       ;length of the string
    int 0x80

    xor eax, eax
    mov al, 1       ;exit the shellcode
    xor ebx,ebx
    int 0x80

    ender:
    call starter    ;put the address of the string on the stack
    db 'hello'

首先,這是什么匯編樣式,其次,我如何使用類似於gcc -S code.c -o code.S -masm=intel的命令從 C 文件生成它

這是英特爾的風格。

你在問題中寫的命令行有什么問題?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM