assembly - 如何在汇编中使用带有 BYTE 参数的 SIZEOF?
问题描述
编辑:我现在正在尝试使用 Str_length,但是当我调试它时它会引发异常
在这种情况下,我不知道如何使用 SIZEOF。我知道如何正常使用它,但我通常将它与数组而不是字符串一起使用。但我认为数组和字符串的工作方式相同
INCLUDE Irvine32.inc
.data
myKey BYTE "efbcdghijklmnopqrstuvwxyza"
message BYTE "the contents of this message will be a mystery.",0
dest DWORD -1
.code
main PROC
;; inside the MAIN procedure
push OFFSET myKey
push OFFSET message
push OFFSET dest
call compute
;; message now contains the encrypted string
mov edx, OFFSET message
call WriteString
;; should display "uid bpoudout pg uijt ndttehd xjmm fd e nztudsz."
exit
main ENDP
compute PROC
...
; prepare for encrypting or decrypting
mov eax, [esp+12]
mov ecx, SIZEOF [esp+12]
mov esi, OFFSET [esp+12]
mov edi, OFFSET outString
mov edx, [esp+16]
cld
...
compute ENDP
END main```
解决方案
推荐阅读
- c++ - Arduino(c++),如何从套接字(WiFiClient)读取字节?
- javascript - 原始函数被调用而不是开玩笑的间谍函数
- php - PHP - 切片嵌套数组
- python - 强制对齐
- swift - 如何在 SpriteKit 中检测联系人
- python - 如何用这个 csv 数据填充 Pandas 数据框?
- javascript - 分配一个值而不先声明它?
- react-native - 在 react-native-paper 中按下另一个按钮时如何禁用一个按钮
- reactjs - 反应原生搜索问题 - 搜索结果返回“未定义”
- regex - 用于 URL 角度验证的正则表达式