0
我已經用Gnu管理'Hello World'!
那麼,接下來的事情是打印1到10吧? (也許在紅寶石)
現在,我會很高興打印A緊跟着B.這就是我的。
.section .text
.globl _start
_start:
# Print A
movl $4,%eax
pushl $0x41
movl %esp,%ecx # Would rather movl $0x41,%ecx
movl $1,%ebx
movl $1,%edx
int $0x80
# Closely followed by B
movl $4,%eax
incl (%esp) # Rather incl(%ecx) here
movl %esp,%ecx
movl $1,%ebx
movl $1,%edx
int $0x80
movl $1,%eax
movl $0,%ebx
int $0x80
而且它的實際工作,但我的問題是,爲什麼我不能
movl $0x41,%ecx
首先,然後
incl (%ecx)
待會兒嗎?
這是不一樣的。它看起來像'ecx'被用作某種基本指針。 – Mysticial 2012-07-17 01:25:14
@Mysticial寫入聲明爲:'ssize_t write(int fd,const void * buf,size_t count)',ecx爲buf – bluekeys 2012-07-17 01:42:26