Diff for /gforth/arch/mips/disasm.fs between versions 1.6 and 1.10

version 1.6, 2000/06/03 07:56:03 version 1.10, 2000/07/01 20:48:52
Line 23 Line 23
 \ particular pages A3, A181, A182 (p. 471, 649, 650 in xpdf).  \ particular pages A3, A181, A182 (p. 471, 649, 650 in xpdf).
 \ it is limited to the R3000 (MIPS-I) architecture, though.  \ it is limited to the R3000 (MIPS-I) architecture, though.
   
   \ test this with
   \ gforth arch/mips/disasm.fs -e "here" arch/mips/testdisasm.fs -e "here over - disasm bye" |sed 's/([^)]*) //'|diff -u - arch/mips/testasm.fs
   
   get-current
   vocabulary disassembler
   also disassembler definitions
   
 \ instruction fields  \ instruction fields
   
 : disasm-op ( w -- u )  : disasm-op ( w -- u )
Line 80  $40 disasm-table cp0-tab-entry     \ COP Line 87  $40 disasm-table cp0-tab-entry     \ COP
   
 \ disassembler central decode cascade  \ disassembler central decode cascade
   
   dup set-current
   
 : disasm-inst ( addr w -- )  : disasm-inst ( addr w -- )
     \G disassemble instruction w at addr (addr is used for computing      \G disassemble instruction w at addr (addr is used for computing
     \G branch targets)      \G branch targets)
     dup disasm-op opc-tab-entry @ execute ;      dup disasm-op opc-tab-entry @ execute ;
   
 : disasm-dump ( addr u -- ) \ gforth  : disasm ( addr u -- ) \ gforth
     \G disassemble u aus starting at addr      \G disassemble u aus starting at addr
     bounds u+do      bounds u+do
         cr ." ( " i hex. ." ) " i i @ disasm-inst          cr ." ( " i hex. ." ) " i i @ disasm-inst
         1 cells +loop ;          1 cells +loop
       cr ;
   
   ' disasm IS discode
   
   definitions
   
 : disasm-special ( addr w -- )  : disasm-special ( addr w -- )
     \ disassemble inst with opcode special      \ disassemble inst with opcode special
Line 128  $40 disasm-table cp0-tab-entry     \ COP Line 142  $40 disasm-table cp0-tab-entry     \ COP
   
 : disasm-J-target ( addr w -- )  : disasm-J-target ( addr w -- )
     \ print jump target      \ print jump target
     $03ffffff and swap $fc000000 and or 2 lshift hex. ;      2 lshift $0fffffff and swap $f0000000 and or hex. ;
   
 : disasm-I-rs,rt,imm ( addr w -- )  : disasm-I-rs,rt,imm ( addr w -- )
     dup disasm-rs .      dup disasm-rs .
Line 266  does> ( addr w -- ) Line 280  does> ( addr w -- )
     drop nip asm-copz-imm1 ;      drop nip asm-copz-imm1 ;
   
 include ./insts.fs  include ./insts.fs
   
   previous set-current

Removed from v.1.6  
changed lines
  Added in v.1.10


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>