<span style="font-family:Microsoft YaHei;">.section .data
UserMsg:
.ascii "Please input the message:"
LenOfUserMsg:
.equ lenMsg, LenOfUserMsg - UserMsg
#.section .bss
# .lcomm resb, 200
OutputMsg:
.ascii "This is your input:"
LenOfOutputMsg:
.equ lenOutput, LenOfOutputMsg - OutputMsg
.section .bss
.lcomm resb, 200
.section .text
.globl _start
_start:
#display UserMsg
movl $4, %eax
movl $1, %ecx
movl $UserMsg, %ecx
movl $lenMsg, %edx
int $0x80
#Read what input
movl $3, %eax
movl $0, %ebx
movl $resb, %ecx
movl $200, %edx
int $0x80
#-------------------------------------
#dispaly what you input
movl $4, %eax
movl $1, %ebx
movl $OutputMsg, %ecx
movl $lenOutput, %edx
int $0x80
movl $4, %eax
movl $1, %ebx
movl $resb, %ecx
movl $200, %edx
int $0x80
movl $1, %eax
movl $0, %ebx
int $0x80
</span>
代码就是这样的。要做什么呢?
很简单:运行后,命令行提示你输入数字或