mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-03-14 23:10:03 +01:00
[SPCA] more assembly
This commit is contained in:
8
semester3/spca/code-examples/01_asm/03_absdiff.s
Normal file
8
semester3/spca/code-examples/01_asm/03_absdiff.s
Normal file
@@ -0,0 +1,8 @@
|
||||
absdiff:
|
||||
movl %edi, %eax
|
||||
subl %esi, %eax // arg2 - arg1 -> eax
|
||||
movl %esi, %edx
|
||||
subl %edi, %edx // arg1 - arg2 -> edx
|
||||
cmpl %esi, %edi // Set condition flags
|
||||
cmovle %edx, %eax // edx -> eax, only if eax <= edx
|
||||
ret
|
||||
Reference in New Issue
Block a user