LoginSignup
0
0

More than 3 years have passed since last update.

概要

cpuを書いてみた。
アセンブラを更新した。
in,outに対応した。

ソース

loop:
  in
  set  i
  get  i
  jz  loop
  get  i
  out
  jmp  loop
i:
  0x0000

アセンブラ結果

mem[12'h000] = 16'hd000;//loop:  in
mem[12'h001] = 16'h3007;//       set  i
mem[12'h002] = 16'h2007;//       get  i
mem[12'h003] = 16'h5000;//       jz  loop
mem[12'h004] = 16'h2007;//       get  i
mem[12'h005] = 16'he000;//       out
mem[12'h006] = 16'h4000;//       jmp  loop
mem[12'h007] = 16'h0000;//i:  0x0000  

成果物

以上。

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