Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .586
- .model flat, stdcall
- ExitProcess PROTO, dwExitCode:DWORD
- include \Irvine\Irvine32.inc
- includelib \Irvine\kernel32.lib
- includelib \Irvine\user32.lib
- include module.inc
- .data
- CaptionGreet BYTE "Last <<< --- First", 0
- ; First --->>> Last
- arrA DWORD 80010001h, 0, 0, 0
- arrB DWORD 80000001h, 0, 0, 0
- arrC DWORD 0, 0, 0, 0
- toOut DB 64 dup(?)
- .code
- main PROC
- mov edi, OFFSET arrA ; Address of arrA
- mov esi, OFFSET arrB ; Address of arrB
- mov ebx, Offset arrC ; Address of arrC
- mov eax, 0 ; Register with result
- mov ecx, LENGTHOF arrA ; Length of arrays
- L1:
- mov eax, [edi] ; Copy current arrA element to eax
- adc eax, [esi] ; Add current arrB element to eax
- add edi, TYPE arrA ; Move pointer to the next arrA element
- add esi, TYPE arrB ; Move pointer to the next arrB element
- mov [ebx], eax ; Move current eax value to current arrC element
- add ebx, TYPE arrC ; Move pointer to the next arrC element
- loop L1
- ; Convert result to HEX toOut
- push OFFSET toOut
- push OFFSET arrC
- push 128
- call StrHex_MY
- ; Output result. Should be 01 00010002
- INVOKE MessageBoxA, 0, ADDR toOut, ADDR CaptionGreet, 0
- INVOKE ExitProcess,0
- main ENDP
- END main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement