version 1.4, 2000/06/17 19:38:28
|
version 1.9, 2007/12/31 19:02:24
|
Line 1
|
Line 1
|
|
|
\ bernd thallner 9725890 e881 |
|
\ disassembler in forth for alpha |
\ disassembler in forth for alpha |
|
|
|
\ Copyright (C) 1999,2000,2007 Free Software Foundation, Inc. |
|
|
|
\ This file is part of Gforth. |
|
|
|
\ Gforth is free software; you can redistribute it and/or |
|
\ modify it under the terms of the GNU General Public License |
|
\ as published by the Free Software Foundation, either version 3 |
|
\ of the License, or (at your option) any later version. |
|
|
|
\ This program is distributed in the hope that it will be useful, |
|
\ but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
\ GNU General Public License for more details. |
|
|
|
\ You should have received a copy of the GNU General Public License |
|
\ along with this program. If not, see http://www.gnu.org/licenses/. |
|
|
|
\ contributed by Bernd Thallner |
|
|
\ util |
\ util |
|
|
require asm.fs |
\ require asm.fs |
|
|
\ : h@ ( addr -- n ) \ 32 bit fetch |
\ : h@ ( addr -- n ) \ 32 bit fetch |
\ dup dup aligned = if |
\ dup dup aligned = if |
Line 264 create decode_code
|
Line 281 create decode_code
|
print_string drop |
print_string drop |
; |
; |
|
|
: decode_Bra ( instruction tbentry -- ) |
: decode_Bra ( addr instruction tbentry -- addr ) |
swap |
swap |
dup $03e00000 and 21 rshift decode_register |
dup $03e00000 and 21 rshift decode_register |
$001fffff and hex. |
$001fffff and 2* 2* 2 pick + 4 + hex. |
print_string |
print_string |
; |
; |
|
|
Line 424 drop \ string_table end
|
Line 441 drop \ string_table end
|
|
|
set-current |
set-current |
|
|
: disasm-inst ( n -- ) \ instruction decoder |
: disasm-inst ( addr n -- addr ) \ instruction decoder |
dup $fc000000 and |
dup $fc000000 and |
26 rshift cells |
26 rshift cells |
opcode_table + |
opcode_table + |
Line 437 set-current
|
Line 454 set-current
|
\G disassemble u aus starting at addr |
\G disassemble u aus starting at addr |
cr bounds |
cr bounds |
u+do |
u+do |
." ( " i hex. ." ) " |
." ( " i hex. ." ) " |
i h@ disasm-inst |
i i h@ disasm-inst drop |
4 |
4 |
+loop ; |
+loop ; |
|
|