クロス・アセンブラの使用法



エラーメッセージ


文法エラーは以下のような形式で出力されます.

   foo.asm:13: Illegal Instruction "mov"
   foo.asm:13: addressing mode error
もしかすると,上記以外のエラーを出力するかもしれません. その場合は kiteasmをデバッグモードで動作させてみて下さい. 以下のような形式でアセンブリ言語のソースの構文解析過程が出力されるので, ソース上のエラーを発見できるかもしれません.

デバッグ・オプションの出力例

% kiteasm -d foo
Text  segment : 00000000
Data  segment : 00000400
BSS   segment : 00000600
Const segment : 00000700
Input  file   : foo.asm
Output file   : foo.hex
First pass
   2 text =000
   3 text =000 mnemonic: ld   mode: immediate  value: 007 
   3 text =001 symbol=_MAIN  data=000
   4 text =001 mnemonic: swp  mode: inherent 
   5 text =002 mnemonic: or   mode: immediate  value: 0ff 
   6 text =003 mnemonic: mv   mode: register   dest : sp    src  : acc  
   7 text =004 mnemonic: in   mode: inherent 
   8 text =005 mnemonic: push mode: inherent 
   9 text =006 mnemonic: call mode: direct     addr : fff 
  10 text =007 mnemonic: pop  mode: inherent 
  11 text =008 mnemonic: out  mode: inherent 
  12 text =009 mnemonic: halt mode: inherent 
  14 text =00a mnemonic: mv   mode: register   dest : ixr   src  : sp   
  14 text =00b symbol=radd  data=00a
  15 text =00b mnemonic: ld   mode: index      disp.: 001 
  16 text =00c mnemonic: push mode: inherent 
  17 text =00d mnemonic: or   mode: immediate  value: 000 
  18 text =00e mnemonic: jpz  mode: direct     addr : fff 
  19 text =00f mnemonic: dec  mode: register   dest : acc   src  : acc  
  20 text =010 mnemonic: push mode: inherent 
  21 text =011 mnemonic: call mode: direct     addr : 00a 
  22 text =012 mnemonic: pop  mode: inherent 
  23 text =013 mnemonic: mv   mode: register   dest : ixr   src  : sp   
  24 text =014 mnemonic: add  mode: index      disp.: 000 
  25 text =015 mnemonic: mv   mode: register   dest : ixr   src  : sp   
  25 text =016 symbol=radd0  data=015
  26 text =016 mnemonic: st   mode: index      disp.: 002 
  27 text =017 mnemonic: pop  mode: inherent 
  28 text =018 mnemonic: ret  mode: inherent 
  30 data =400
  31 data =400 mnemonic: word data : 00000000  length: 1 
  31 data =401 symbol=ZERO  data=400
  32 data =401 mnemonic: word data : 00000064  length: 1 
  32 data =402 symbol=D100  data=401
Second pass
text =000 mnemonic: ld   mode: immediate  value: 007 
text =001 mnemonic: swp  mode: inherent   dest : none  src  : none 
text =002 mnemonic: or   mode: immediate  value: 0ff 
text =003 mnemonic: mv   mode: register   dest : sp    src  : acc  
text =004 mnemonic: in   mode: inherent   dest : none  src  : none 
text =005 mnemonic: push mode: inherent   dest : none  src  : none 
text =006 mnemonic: call mode: direct     addr : 00a 
text =007 mnemonic: pop  mode: inherent   dest : none  src  : none 
text =008 mnemonic: out  mode: inherent   dest : none  src  : none 
text =009 mnemonic: halt mode: inherent   dest : none  src  : none 
text =00a mnemonic: mv   mode: register   dest : ixr   src  : sp   
text =00b mnemonic: ld   mode: index      disp.: 001 
text =00c mnemonic: push mode: inherent   dest : none  src  : none 
text =00d mnemonic: or   mode: immediate  value: 000 
text =00e mnemonic: jpz  mode: direct     addr : 015 
text =00f mnemonic: dec  mode: register   dest : acc   src  : acc  
text =010 mnemonic: push mode: inherent   dest : none  src  : none 
text =011 mnemonic: call mode: direct     addr : 00a 
text =012 mnemonic: pop  mode: inherent   dest : none  src  : none 
text =013 mnemonic: mv   mode: register   dest : ixr   src  : sp   
text =014 mnemonic: add  mode: index      disp.: 000 
text =015 mnemonic: mv   mode: register   dest : ixr   src  : sp   
text =016 mnemonic: st   mode: index      disp.: 002 
text =017 mnemonic: pop  mode: inherent   dest : none  src  : none 
text =018 mnemonic: ret  mode: inherent   dest : none  src  : none 
data =400 mnemonic: word data : 00000000  length: 1 
data =401 mnemonic: word data : 00000064  length: 1 
%


クロス・アセンブラの文法


ホーム もどる 辞書

This is my e-mail address:

arch_www < www@cs.kumamoto-u.ac.jp >
Copyright (C) KITE Microprocessor Project, 1996