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 その39

Last updated at Posted at 2020-09-04

概要

vistaでquartusやってみた。
俺言語をコンパイルして、俺cpuのアセンブラにかけた。
焼いてみた。

写真

無題.jpg

アセンブル結果

mem[12'h000] = 16'h1000;//       push  0
mem[12'h001] = 16'h305a;//       set  a
mem[12'h002] = 16'h205a;//label20:  get  a
mem[12'h003] = 16'h1001;//       push  1
mem[12'h004] = 16'hf000;//       +
mem[12'h005] = 16'h305a;//       set  a
mem[12'h006] = 16'h205a;//       get  a
mem[12'h007] = 16'h1064;//       push  100
mem[12'h008] = 16'hf001;//       >
mem[12'h009] = 16'h5009;//label255:  jz  label255
mem[12'h00a] = 16'h205a;//       get  a
mem[12'h00b] = 16'h100f;//       push  15
mem[12'h00c] = 16'hf006;//       %
mem[12'h00d] = 16'h305b;//       set  b
mem[12'h00e] = 16'h205b;//       get  b
mem[12'h00f] = 16'h1000;//       push  0
mem[12'h010] = 16'hf00A;//       =
mem[12'h011] = 16'h5031;//       jz  label120
mem[12'h012] = 16'h205a;//       get  a
mem[12'h013] = 16'h1005;//       push  5
mem[12'h014] = 16'hf006;//       %
mem[12'h015] = 16'h305b;//       set  b
mem[12'h016] = 16'h205b;//       get  b
mem[12'h017] = 16'h1000;//       push  0
mem[12'h018] = 16'hf00A;//       =
mem[12'h019] = 16'h5044;//       jz  label140
mem[12'h01a] = 16'h205a;//       get  a
mem[12'h01b] = 16'h1003;//       push  3
mem[12'h01c] = 16'hf006;//       %
mem[12'h01d] = 16'h305b;//       set  b
mem[12'h01e] = 16'h205b;//       get  b
mem[12'h01f] = 16'h1000;//       push  0
mem[12'h020] = 16'hf00A;//       =
mem[12'h021] = 16'h504f;//       jz  label160
mem[12'h022] = 16'h205a;//       get  a
mem[12'h023] = 16'h100a;//       push  10
mem[12'h024] = 16'hf005;//       /
mem[12'h025] = 16'h1030;//       push  48
mem[12'h026] = 16'hf000;//       +
mem[12'h027] = 16'he000;//       out
mem[12'h028] = 16'h205a;//       get  a
mem[12'h029] = 16'h100a;//       push  10
mem[12'h02a] = 16'hf006;//       %
mem[12'h02b] = 16'h1030;//       push  48
mem[12'h02c] = 16'hf000;//       +
mem[12'h02d] = 16'he000;//       out
mem[12'h02e] = 16'h1020;//       push  32
mem[12'h02f] = 16'he000;//       out
mem[12'h030] = 16'h4002;//       jmp  label20
mem[12'h031] = 16'h1066;//label120:  push  'f'
mem[12'h032] = 16'he000;//       out
mem[12'h033] = 16'h1069;//       push  'i'
mem[12'h034] = 16'he000;//       out
mem[12'h035] = 16'h107a;//       push  'z'
mem[12'h036] = 16'he000;//       out
mem[12'h037] = 16'h107a;//       push  'z'
mem[12'h038] = 16'he000;//       out
mem[12'h039] = 16'h1062;//       push  'b'
mem[12'h03a] = 16'he000;//       out
mem[12'h03b] = 16'h1075;//       push  'u'
mem[12'h03c] = 16'he000;//       out
mem[12'h03d] = 16'h107a;//       push  'z'
mem[12'h03e] = 16'he000;//       out
mem[12'h03f] = 16'h107a;//       push  'z'
mem[12'h040] = 16'he000;//       out
mem[12'h041] = 16'h1020;//       push  32
mem[12'h042] = 16'he000;//       out
mem[12'h043] = 16'h4002;//       jmp  label20
mem[12'h044] = 16'h1062;//label140:  push  'b'
mem[12'h045] = 16'he000;//       out
mem[12'h046] = 16'h1075;//       push  'u'
mem[12'h047] = 16'he000;//       out
mem[12'h048] = 16'h107a;//       push  'z'
mem[12'h049] = 16'he000;//       out
mem[12'h04a] = 16'h107a;//       push  'z'
mem[12'h04b] = 16'he000;//       out
mem[12'h04c] = 16'h1020;//       push  32
mem[12'h04d] = 16'he000;//       out
mem[12'h04e] = 16'h4002;//       jmp  label20
mem[12'h04f] = 16'h1066;//label160:  push  'f'
mem[12'h050] = 16'he000;//       out
mem[12'h051] = 16'h1069;//       push  'i'
mem[12'h052] = 16'he000;//       out
mem[12'h053] = 16'h107a;//       push  'z'
mem[12'h054] = 16'he000;//       out
mem[12'h055] = 16'h107a;//       push  'z'
mem[12'h056] = 16'he000;//       out
mem[12'h057] = 16'h1020;//       push  32
mem[12'h058] = 16'he000;//       out
mem[12'h059] = 16'h4002;//       jmp  label20
mem[12'h05a] = 16'h0000;//a:  0x0000  
mem[12'h05b] = 16'h0000;//b:  0x0000

修正点

>が1->2.

JZ が JNZ

以上。

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?