反向汇编中数组的内容 [英] Reverse contents of array in assembly
问题描述
我正在做一些组装作业,但在上一个程序中遇到了麻烦.如果有x86汇编知识的人潜伏,请随时评论我可能如何开始.谢谢!
问题:
使用具有间接寻址或索引寻址的循环在适当的位置反转整数数组的元素.不要将元素复制到任何其他数组.还可以使用SIZEOF,TYPE和LENGTHOF运算符来使程序灵活地适用于不同的数组.
到目前为止的代码:.data
array BYTE 10h,20h, 30h, 40h
.code
main PROC
call Clrscr
;no clue...
exit
main ENDP
END main
好,用esi指向数组的开头,用edi指向数组的末尾,加载这两个元素.元素(?),交换它们,然后更改esi和edi相应地重复直到....提示:您无需交换任何内容,因为您处于装配体= P
I am working on some assembly homework and am stumped on my last program. If anyone with x86 assembly knowledge is lurking, please feel free to comment on how I might get started with this. Thanks!
problem:
Use a loop with indirect or indexed addressing to reverse the elements of an integer array in place. do not copy the elements to any other array. Also use SIZEOF, TYPE, and LENGTHOF operators to make the program flexible to different arrays.
code so far:
.data
array BYTE 10h,20h, 30h, 40h
.code
main PROC
call Clrscr
;no clue...
exit
main ENDP
END main
Well, point the begin of the array with esi and the end with edi, load the two.. Elements (?), swap them then change esi and edi accordingly and repeat until.... hint: you don't have to swap anything, since you're in assembly =P
这篇关于反向汇编中数组的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!