小编Ego*_*kov的帖子

NASM elf 文件大小差异(部分大小写字母)

我在debian linux下用汇编写了一个简单的“Hello world”:

; Define variables in the data section
SECTION .data
    hello:     db 'Hello world!',10
    helloLen:  equ $-hello

; Code goes in the text section
SECTION .text
GLOBAL _start 

_start:
    mov eax,4            ; 'write' system call = 4
    mov ebx,1            ; file descriptor 1 = STDOUT
    mov ecx,hello        ; string to write
    mov edx,helloLen     ; length of string to write
    int 80h              ; call the kernel

    ; Terminate program
    mov eax,1            ; 'exit' system call
    mov ebx,0            ; exit …
Run Code Online (Sandbox Code Playgroud)

linux compiler-construction assembly nasm binary-size

2
推荐指数
1
解决办法
122
查看次数