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.

俺cpuAdvent Calendar 2020

Day 21

vistaでquartus その34

Last updated at Posted at 2020-08-26

#概要

vistaでquartusやってみた。
cpu作ってみた。
シミュレータで実行。
アセンブラでコンパイル。
実機で実行。

#ソース

fizzbuzz

  push  1
  set  i
loop:
  get  i
  push  100
  >
bye:
  jz  bye
  get  i
  push  15
  %
  jz  fizzbuzz
  get  i
  push  5
  %
  jz  buzz
  get  i
  push  3
  %
  jz  fizz
  get  i
  push  10
  /
  push  48
  +
  out
  get  i
  push  10
  %
  push  48
  +
  out
  jmp  tugi
fizzbuzz:
  push  'f'
  out
  push  'i'
  out
  push  'z'
  out
  push  'z'
  out
  push  'b'
  out
  push  'u'
  out
  push  'z'
  out
  push  'z'
  out
  jmp  tugi
buzz:
  push  'b'
  out
  push  'u'
  out
  push  'z'
  out
  push  'z'
  out
  jmp  tugi
fizz:
  push  'f'
  out
  push  'i'
  out
  push  'z'
  out
  push  'z'
  out
tugi:
  push  32
  out
  get  i
  push  1
  +
  set  i
  jmp  loop
i:
  0x0000

#シミュレータで実行。

#アセンブラでコンパイル。

#実機で実行。

無題.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?