在汇编器中将数据从指针写入局部变量(另一个指针)
replace PROC
enter 8, 0
min_i equ [bp - 2]
min equ [bp - 4]
max_i equ [bp - 6]
max equ [bp - 8]
mov bx,offset ptr_arr
mov [min_i],[bx]
mov [max_i],[bx]
...
leave
ret
replace ENDP
该程序使用矩阵,ptr_arr
存储第一行的偏移量。
在 bx
中,我想移动到 min_i
和 max_i
的偏移量,但程序无法编译。编译器写入错误a2023指令操作数必须有大小
。
我尝试使用 mov [min_i],WORD ptr bx
,但在调试中看起来像 mov [bp - 2],bx
而没有取消对 bx
的引用>我需要的。
是否可以在 1 行中完成此操作,而无需将 bx
传输到缓冲区并从那里读取。
我在 ms-dos 上使用 masm。在dosbox中使用masm+link编译。
replace PROC
enter 8, 0
min_i equ [bp - 2]
min equ [bp - 4]
max_i equ [bp - 6]
max equ [bp - 8]
mov bx,offset ptr_arr
mov [min_i],[bx]
mov [max_i],[bx]
...
leave
ret
replace ENDP
The program works with matrices and ptr_arr
stores the offsets of the first row.
In bx
there is an offset that I want to move to min_i
and max_i
, but the program does not compile. Compiler writes error a2023 instruction operand must have size
.
I tried using mov [min_i],WORD ptr bx
, but in debug is looks like mov [bp - 2],bx
without dereference for bx
which I need.
Is it possible to do this in 1 line without transferring bx
to the buffer and reading from there.
I'm using masm for ms-dos. Compiling with masm+link in dosbox.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在ASM中,无法从内存到内存(从指针到指针)在一个指令中中。更多信息在这里 x86汇编指针
In asm isn't possible to copy from memory to memory(from pointer to pointer) in one instruction. More info here x86 Assembly pointers