From: Kalus M. <mic...@on...> - 2010-09-17 21:54:42
|
Hi. If you like to see what has been compiled, gforth has comfortable SEE <word> as a command. There is no see in amforth so far? So this may help a little. <snip> new hex ( source: amforth-4.1/lib/ans94/ans.frt) \ go from the XT backwards to get the Name field : xt>nfa ( xt -- nfa ) 1- \ link address \ tricky: we look for the flash cell whose address + it content & 0x00ff is \ this address dup 1- >r ( -- lfa) begin 1- dup ( -- fla fla ) i@ $00ff and 1+ 2/ ( -- fla len ) over + ( fla lfa? ) r@ = ( fla lfa? ) until r> drop ; \ now create a lister : lister ( xt -- ) xt>nfa here swap - 0 do cr here 1- i - dup 4 u0.r space i@ 4 u0.r loop ; here . : dummy 1122 3344 5566 ; here . ' dummy . ' lister . ' lister lister .s </snip> This is what I got: » here . 1524 ok » : dummy 1122 3344 5566 ; ok » here . 1531 ok » ' dummy . 1529 ok » ' lister . 150B ok » ok » ' lister lister 1530 1C37 152F 5566 152E 1C54 152D 3344 152C 1C54 152B 1122 152A 1C54 1529 1C0A 1528 1506 1527 0079 1526 6D6D 1525 7564 1524 FF05 1523 1C37 1522 1513 1521 1EBF 1520 0FB5 151F 0004 151E 1C54 151D 1FEB 151C 03AD 151B 0FB5 151A 0004 1519 1C54 1518 1CA5 1517 1D95 1516 1EB7 1515 1E38 1514 0121 1513 03A0 1512 1523 1511 1E92 1510 1D36 150F 1D95 150E 1CB8 150D 0121 150C 14F0 150B 1C0A 150A 14EB 1509 7265 1508 7473 1507 696C 1506 FF06 ok » .s ok » Then I looked up cfa in the <application>.lst file: addr cfa mnemonic 1530 1C37 XT_EXIT 152F 5566 $5566 152E 1C54 XT_DOLITERAL 152D 3344 $3344 152C 1C54 XT_DOLITERAL 152B 1122 $1122 152A 1C54 XT_DOLITERAL 1529 1C0A DO_COLON 1528 1506 link to precedence cell of previous word 1527 0079 0 y 1526 6D6D m m 1525 7564 u d 1524 FF05 FF == precedence bits, 05 == count byte of name. Voilà. So we see the latest words compiled this way. Michael |