; part of virtual processor, emulator for FIFTH xvidput: mov ebx, edi ; read data from stack, and save it to variables mov eax, [es:ebx] mov [cory], eax add ebx, 4 mov eax, [es:ebx] mov [corx], eax add ebx, 4 mov eax, [es:ebx] add eax, [xms_addr] mov ecx, [es:eax] mov [img2x], ecx add eax, 4 mov ecx, [es:eax] mov [img2y], ecx add eax, 4 mov [img2a], eax add ebx, 4 mov eax, [es:ebx] add eax, [xms_addr] mov ecx, [es:eax] mov [img1x], ecx add eax, 4 mov ecx, [es:eax] mov [img1y], ecx add eax, 4 mov [img1a], eax add ebx, 4 mov edi, ebx cmp dword [cory] , 0 ; calculate Y start jl vidl1 mov dword [starty], 0 jmp vidl2 vidl1: mov eax, [cory] neg eax mov [starty], eax vidl2: cmp dword [corx] , 0 ; calculate X start jl vidl3 mov dword [startx], 0 jmp vidl4 vidl3: mov eax, [corx] neg eax mov [startx], eax vidl4: mov eax, [cory] ; calculate Y end add eax, [img1y] cmp eax, [img2y] jg vidl5 mov eax, [img1y] mov [endy], eax jmp vidl6 vidl5: mov eax, [img2y] sub eax, [cory] mov [endy], eax vidl6: mov eax, [corx] ; calculate X end add eax, [img1x] cmp eax, [img2x] jg vidl7 mov eax, [img1x] mov [endx], eax jmp vidl8 vidl7: mov eax, [img2x] sub eax, [corx] mov [endx], eax vidl8: mov eax, [endy] ; calculate Y length sub eax, [starty] cmp eax, 0 jle emu mov [lengthy], eax mov eax, [endx] ; calculate X length sub eax, [startx] cmp eax, 0 jle emu mov [lengthx], eax mov eax, [starty] ; calculate img1 start address mov ebx, [img1x] sub edx, edx mul ebx add eax, [img1a] add eax, [startx] mov [img1start], eax mov eax, [cory] ; calculate img2 start address add eax, [starty] mov ebx, [img2x] sub edx, edx mul ebx add eax, [img2a] add eax, [corx] add eax, [startx] mov [img2start], eax vidl9: mov ebx, [img1start] mov ecx, [lengthx] mov edx, [img2start] call memmove mov eax, [img1x] add [img1start], eax mov eax, [img2x] add [img2start], eax dec dword [lengthy] cmp [lengthy], 0 jg vidl9 jmp emu cory dd 0 corx dd 0 img2x dd 0 img2y dd 0 img2a dd 0 img1x dd 0 img1y dd 0 img1a dd 0 starty dd 0 startx dd 0 endy dd 0 endx dd 0 lengthx dd 0 lengthy dd 0 img1start dd 0 img2start dd 0