VolksForth/msdos/disasm.fb

1 line
44 KiB
Plaintext
Raw Normal View History

2017-04-23 22:25:49 +00:00
\ \ A disassembler for the 8086 by Charles Curley cas 10nov05\ adapted to volksFORTH-83 by B. Molte | : internal 1 ?head ! ; | : external ?head off ; onlyFORTH forth DEFINITIONS DECIMAL VOCABULARY DISAM DISAM also DEFINITIONS 2 capacity 1- thru onlyforth cr .( Use DIS <name> to disassemble word. ) cr .( ESC will stop the output. ) \ cas 10nov05 internal : [and] and ; \ the forth and : [or] or ; : mask ( n maskb -- n n' ) over and ; 5 constant 5 \ save some space 6 constant 6 7 constant 7 8 constant 8 \ internal : EXEC [and] 2* R> + PERFORM ; : STOP[ 0 ?pairs [compile] [ reveal ; immediate restrict code shift> \ n ct --- n' | shift n right ct times D C mov D pop D C* shr next end-code \ : shift> 0 ?DO 2/ ( shift's artihm.!) $7FFF and LOOP ; code SEXT \ n --- n' | sign extend lower half of n to upper D A mov cbw A D mov next end-code \ : hsext $FF and dup $80 and IF $FF00 or THEN ;