我不太理解如何在x86汇编语言中遍历二维数组。我缺少一些理解。以下是我的代码:
问题在于带有
问题在于带有
//offset
和//moving through array
的行。
对于//offset
行,我得到的错误是“second operand中的非常量表达式”,也出现了“ebx:second operand中的非法寄存器”。
对于下一行,我得到的错误是“edx:second operand中的非法寄存器”。 mov esi, dim
mul esi
mov eax, 0 // row index
mov ebx, 0 // column index
mov ecx, dim
StartFor:
cmp ecx, esi
jge EndFor
lea edi, image;
mov edx, [eax *dim + ebx] // offset
mov dl, byte ptr [edi + esi*edx] // moving through array
mov edx, edi
and edx, 0x80
cmp edx, 0x00
jne OverThreshold
mov edx, 0xFF
OverThreshold:
mov edx, 0x0