2 assembly
我有这个汇编代码:
push dword ' You'
push dword 'Hey'
push esp
call printf
Run Code Online (Sandbox Code Playgroud)
它只打印'嘿'.如何修复它来打印'嘿你'?
你应该在嘿嘿之后添加一个空格,这样'嘿'.
为什么?因为'嘿'是一个dword,即4个字节:( 'H' 'e' 'y' 0null),printf打印到第一个null,因此你只得到'嘿'.
但是'嘿'是'H' 'e' 'y' ' ',而第一个null现在将在'你'之后.