Page:Forth Dimensions Volume 01 Number 2.pdf/10

 SCR # 6 HELP

0  THE "HELP" COMMAND IS PROBABLY THE MOST USEFUL OPTION FOR 1 A FORTH SYSTEM. IT ALLOWS YOU TO VIEW THE DICTIONARY WORDS 2 AND LOCATE THEM IN MEMORY. WHEN YOU ARE TESTING NEW 3 DEFINITIONS, IT WILL SHOW RE-DEFINITIONS. IT IS A WAY TO 4 LOCATE WHERE A MISSING WORD SHOULD BE, BUT ISN'T. 5 6  IF YOU MAKE A COMPILE ERROR FROM DISC, "HELP" WILL SHOW 7 THE WORD IN WHICH THE ERROR OCCURED. 8 9   YOU SHOULD MODIFY THE FOLLOWING DEFINITIONS TO THE FORMAT 10 YOU WANT. FOR OBJECT CODE EXAMINATION, I LIKE THE CODE FIELD 11 ADDRESSES AS SHOWN, SINCE THIS IS WHAT RESULTS IN THE COMPILED 12 CODE. FOR A QUICK SNAP-SHOT OF THE DICTIONARY, I JUST PRINT 13 THE LENGTH AND NAMES. 14 15  JUST TYPE "HELP" AND HIT THE "BREAK" KEY TO STOP.

SCR #7

O ( HELP )    HEX 1 00 CONSTANT LAST-LINK ( IS $8000 ON MICRO-FORTH ) 2 4 CONSTANT #/LINE ( WORDS PRINTED PER LINE ) 3 4 .NAME ( ENTER WITH ADDRESS OF LENGTH BYTE ) 5 DUP C@ 7F AND DECIMAL 3 .R SPACE 1+ 3 TYPE SPACE ; 6 7 : .CODE-ADDRESS ( ENTER WITH ADDRESS OF LENGTH BYTE ) 8 6 + HEX 5 .R SPACE ; 9 10 : .HEADER ( ENTER WITH ADDRESS OF LENGTH BYTE ) 11 DUP .NAME .CODE-ADDRESS 3 12 13 : ?TERMINAL 0 ; ( USER'S MACHINE DEPENDENT TERMINAL BREAK ) 14 ( RETURN "00" FOR NO BREAK, AND "01" FOR A BREAK ) 15 8 LOAD ;S 8/27/78 WFR

SCR #8

0 ( HELP, CONT. ) 1 2 : .LINE ( PRINT A LINE OF NAMES AND CODE ADDRESSES ) 3 #/LINE 0 ( ENTER WITH ADDRESS OF LENGTH BYTE ) 4 DO DUP .HEADER SPACE 4 + @ DUP LAST-LINK 5 IF LEAVE THEN LOOP ; ( EXIT WITH NEXT ADDRESS ) 6 7 : HELP ( PRINT DICTIONARY FROM TOP CURRENT WORD DOWN ) 8 ( TO BOTTOM. FORMAT IS LENGTH COUNT, 3 LETTERS OF ) 9 ( NAME, AND CODE FIELD ADDRESS. WILL TERMINATE ) 10 ( UPON LAST LINK VALUE OR A TERMINAL BREAK. ) 11 BASE C@ >R CURRENT @ @ 12 BEGIN CR .LINE DUP LAST-LINK = ?TERMINAL + 13 END DROP ( LAST LINK ) R> BASE C! ; 14 15 DECIMAL ;S 8/28/78 WFR  PAGE 19 FORTH INTEREST GROUP