0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

#概要

jsdoでchip8やってみた。
アセンブラ練習問題、解いてみた。
お題は、fizzbuzz

#サンプルコード

  load  v3  5
  load  v4  5
  load  v5  5
  load  v6  1
  load  v7  1
  load  v8  0
  load  v9  15
  load  v10  5
  load  v11  3
jp0  load  v12  v6
jp1  sub  v12  v9
  eq  v12  0
  goto  jj0
  goto  jp2
jj0  eq  v15  0
  goto  jp1
  load  v12  v6
jp9  sub  v12  v10
  eq  v12  0
  goto  jj1
  goto  jp4
jj1  eq  v15  0
  goto  jp9
  load  v12  v6
jp11  sub  v12  v11
  eq  v12  0
  goto  jj2
  goto  jp6
jj2  eq  v15  0
  goto  jp11
  load  I  100
  load  v3  5
  load  B  v6
  load  v2  I
  load  I  0
loop0  sub  v0  v7
  eq  v15  0
  goto  loop1
  disp  v3  v4  5
  add  v3  v5
  load  I  0
loop2  sub  v1  v7
  eq  v15  0
  goto  loop3
  disp  v3  v4  5
  add  v3  v5
  load  I  0
loop4  sub  v2  v7
  eq  v15  0
  goto  loop5
  disp  v3  v4  5
  scroll
  add  v6  v7
  goto  jp0
loop1  add  I  v5
  goto  loop0
loop3  add  I  v5
  goto  loop2
loop5  add  I  v5
  goto  loop4
jp2  load  I  704
  load  v3  5
  load  v8  8
jp3  disp  v3  v4  5
  add  v3  v5
  sub  v8  v7
  add  I  v5
  eq  v8  0
  goto  jp3
  scroll
  add  v6  v7
  goto  jp0
jp4  load  I  724
  load  v3  5
  load  v8  4
jp5  disp  v3  v4  5
  add  v3  v5
  sub  v8  v7
  add  I  v5
  eq  v8  0
  goto  jp5
  scroll
  add  v6  v7
  goto  jp0
jp6  load  I  704
  load  v3  5
  load  v8  4
jp7  disp  v3  v4  5
  add  v3  v5
  sub  v8  v7
  add  I  v5
  eq  v8  0
  goto  jp7
  scroll
  add  v6  v7
  goto  jp0    
  data  240
  data  128
  data  224
  data  128
  data  128
  data  224
  data  64
  data  64
  data  64
  data  224
  data  240
  data  32
  data  64
  data  128
  data  240
  data  240
  data  32
  data  64
  data  128
  data  240
  data  224
  data  144
  data  224
  data  144
  data  224
  data  144
  data  144
  data  144
  data  144
  data  96
  data  240
  data  32
  data  64
  data  128
  data  240
  data  240
  data  32
  data  64
  data  128
  data  240

#成果物

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?