汇编语言实现数组倒序
程序员文章站
2024-02-02 15:46:34
...
.686
.MODEL flat, stdcall
option casemap : none
;//========================================
includelib ucrt.lib
includelib legacy_stdio_definitions.lib
;//========================================
.data
array dd 1h,2h,3h,4h
.code
main proc
pushad
mov ecx,(lengthof array)/2
mov esi,0
mov edi,((lengthof array)-1)
L1:
MOV EAX,array[esi*4]
MOV EBX,array[edi*4]
MOV array[esi*4],EBX
MOV array[edi*4],EAX
INC ESI
DEC EDI
loop L1
popad
ret
main endp
end main
注:LENGTHOF 不是LENGTH
下一篇: 汇编语言检测点10.3