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 3 years have passed since last update.

vistaでquartus その28

Last updated at Posted at 2020-08-18

#概要

vistaでquartusやってみた。
cpu作ってみた。
1から99を表示する。

#アセンブラ

  push  1
  set  i
loop:
  get  i
  push  99
  >
pass:
  jz  pass 
  push  32
  out
  get  i
  push  10
  /
  push  48
  +
  out
  get  i
  push  10
  %
  push  48
  +
  out
  get  i
  push  1
  +
  set  i
  jmp loop

#ハンドアセンブル


		mem[0]  = 16'h1001;//push 1
		mem[1]  = 16'h3019;//set i
		mem[2]  = 16'h2019;//get i
		mem[3]  = 16'h1064;//push 99
		mem[4]  = 16'hf002;//>
		mem[5]  = 16'h5005;//jz 5
		mem[6]  = 16'h1020;//push 32
		mem[7]  = 16'he000;//out
		mem[8]  = 16'h2019;//get i
		mem[9]  = 16'h100a;//push 10
		mem[10] = 16'hf005;///
		mem[11] = 16'h1030;//push 48
		mem[12] = 16'hf000;//+
		mem[13] = 16'he000;//out
		mem[14] = 16'h2019;//get i
		mem[15] = 16'h100a;//push 10
		mem[16] = 16'hf006;//%
		mem[17] = 16'h1030;//push 48
		mem[18] = 16'hf000;//+
		mem[19] = 16'he000;//out
		mem[20] = 16'h2019;//get i
		mem[21] = 16'h1001;//push 1
		mem[22] = 16'hf000;//+
		mem[23] = 16'h3019;//set i
		mem[24] = 16'h4002;//jp 2
		mem[25] = 16'h0000;//i

#実行結果

無題.jpg

以上。

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?