Skip to content

Instantly share code, notes, and snippets.

@4lex1v
Created December 3, 2012 21:28
Show Gist options
  • Save 4lex1v/4198242 to your computer and use it in GitHub Desktop.
Save 4lex1v/4198242 to your computer and use it in GitHub Desktop.
Solution
_DATA SEGMENT
TriTable \
BYTE 64
BYTE 45,63
BYTE 75,09,91
...et cetera
_DATA ENDS
mov ebx, 0FFFFFFh ; path ;)
xor ebp, ebp ; max total
next: mov ecx, ebx
xor edx, edx
xor edi, edi
shl ecx, 32-24
mov esi, 0
@@: inc esi
shl ecx, 1
movzx eax, [TriTable][edx]
adc edx, esi
add edi, eax
cmp esi, 25
jne @B
; max path total
cmp ebp, edi
cmovc ebp, edi
dec ebx
jns next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment