Last active
August 29, 2015 14:17
-
-
Save Mischa-Alff/5356c2e0c198125f8e79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section .data | |
fmt: db "%#06x", 0xA, 0x0 | |
align 16 | |
aabb1: | |
.left: dd 1 | |
.top: dd 1 | |
.right: dd 1 | |
.bottom: dd 1 | |
align 16 | |
aabb2: | |
.left: dd 0 | |
.top: dd 0 | |
.right: dd 2 | |
.bottom: dd 2 | |
section .bss | |
align 16 | |
tmp: | |
.right: resd 1 | |
.bottom: resd 1 | |
.left: resd 1 | |
.top: resd 1 | |
section .text | |
extern printf | |
global main | |
global _start | |
_start: | |
main: | |
mov eax, [aabb2.right] | |
mov [tmp.right], eax | |
mov eax, [aabb2.left] | |
mov [tmp.left], eax | |
mov eax, [aabb2.bottom] | |
mov [tmp.bottom], eax | |
mov eax, [aabb2.top] | |
mov [tmp.top], eax | |
movaps xmm0, [aabb1] | |
movaps xmm1, [tmp] | |
pcmpgtd xmm1, xmm0 | |
pmovmskb rax, xmm1 | |
xor eax, 0x00FF | |
setz al | |
and eax, 0x1 | |
mov esi, eax | |
mov edi, fmt | |
mov eax, 0x0 | |
call printf | |
mov ebx, 0x0 | |
mov eax, 0x1 | |
int 0x80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment