0
为什么长度可以直接推入堆栈,而消息必须复制到寄存器然后推入堆栈?将数据推入堆栈,可信
为什么字符串被声明为一个字节而11被定义为一个字?
message:db'hello world'
length:dw 11
mov ax, message
push ax
push word [length]
为什么长度可以直接推入堆栈,而消息必须复制到寄存器然后推入堆栈?将数据推入堆栈,可信
为什么字符串被声明为一个字节而11被定义为一个字?
message:db'hello world'
length:dw 11
mov ax, message
push ax
push word [length]
您应该可以直接执行push message
,但确切的语法通常是汇编程序特定的。您可能需要编写push offset message
。这会将'h'
的地址推入堆栈。
推动'he'
(有点像push word [message]
或push word ptr [message]
),OTOH,可能不是你真正想要的。我没有看到使用堆栈传递只有2个字符的字符串的好理由。代之以传递第一个字符的地址更有意义。
so message defined as a byte is just pointing to the first byte of any string a write? – user2221424