我知道如果你想说两个字符输入,你会使用:
input_str: .ascii "??"
然后:
mov $2, %edx
比如在:
.data
input_str: .ascii "??"
.text
.global _start
_start:
mov $3, %eax # eax = 3 = function number for "read"
mov $0, %ebx # ebx = 0 = file descriptor (stdin)
mov $input_str, %ecx # ecx = address of input buffer
mov $2, %edx # edx = buffer maximum size
int $0x80 # Call Linux kernel API
# eax = error code or number of bytes read
ETC...
但是,如果你要求一个随机长度的句子呢?输入后如何读取有多少?