Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Leap-year/X86-Assembly/leap-year.x86
Normal file
17
Task/Leap-year/X86-Assembly/leap-year.x86
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
align 16
|
||||
; Input year as signed dword in EAX
|
||||
IsLeapYear:
|
||||
test eax,11b
|
||||
jz .4
|
||||
retn ; 75% : ZF=0, not a leap year
|
||||
.4:
|
||||
mov ecx,100
|
||||
cdq
|
||||
idiv ecx
|
||||
test edx,edx
|
||||
jz .100
|
||||
cmp edx,edx
|
||||
retn ; 24% : ZF=1, leap year
|
||||
.100:
|
||||
test eax,11b
|
||||
retn ; 1% : ZF=?, leap year if EAX%400=0
|
||||
Loading…
Add table
Add a link
Reference in a new issue