結果

問題 No.9010 うるう年判定
ユーザー data9824data9824
提出日時 2019-11-30 14:39:03
言語 Assembler
(nasm 2.16.01)
結果
RE  
実行時間 -
コード長 955 bytes
コンパイル時間 214 ms
コンパイル使用メモリ 5,440 KB
実行使用メモリ 5,296 KB
最終ジャッジ日時 2023-08-13 08:19:31
合計ジャッジ時間 5,281 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
ld: warning: cannot find entry symbol _start; defaulting to 00000000004000b0

ソースコード

diff #

  global  _start

  section .text

  xor eax, eax
loop:
  push rax
  mov eax, 3 ; sys_read
  mov ebx, 0 ; fd
  mov ecx, input
  mov edx, 1
  int 0x80
  xor ecx, ecx
  mov cl, [input]
  cmp cl, 0x0a
  pop rax
  je readend
  mov edx, 10
  mul edx
  sub ecx, 0x30 ; '0'
  add eax, ecx
  jmp loop

readend:
  mov esi, eax

  xor edx, edx
  mov eax, esi
  mov ecx, 400
  div ecx
  test edx, edx
  je yes

  mov eax, esi
  xor edx, edx
  mov eax, esi
  mov ecx, 100
  div ecx
  test edx, edx
  je no
  
  mov eax, esi
  xor edx, edx
  mov eax, esi
  mov ecx, 4
  div ecx
  test edx, edx
  je yes

no:
  mov eax, 4 ; sys_write
  mov ebx, 1 ; fd
  mov ecx, notext
  mov edx, 3
  int 0x80

  mov eax, 60
  mov edi, 0
  int 0x80
  ret

yes:
  mov eax, 4 ; sys_write
  mov ebx, 1 ; fd
  mov ecx, yestext
  mov edx, 4
  int 0x80

  mov eax, 60
  mov edi, 0
  int 0x80
  ret

  section .data
  
input db 0
notext db "no"
       db 0x0a
yestext db "yes"
       db 0x0a
0