<< 11/89 >>
First Last

うるう年判定 - x86

  mov     eax, [esp + 4]  # eax = year
  cdq
  mov     ecx, 100        # ecx = 100
  idiv    ecx             # eax = year/100, edx = year%100
  test    edx, edx        # year%100 == 0
  cmovnz  eax, edx        # eax = year%100 != 0 ? edx : eax
  and     eax, byte 3     # eax % 4
  ret

http://homepage1.nifty.com/herumi/diary/0803.html#15