figForth Word - EXPECT

  Some parts of this page/site are currently incomplete & will be updated asap
  Other parts will change continually so use “Refresh” in your browser !!
  There is extensive use of “Tooltips” text to support learning which do
not seem to render on a Smartphone


EXPECT        addr  count  ---                                      L0

    Transfer characters from the terminal to address addr, until a "return" or the count of
    characters have been received
    One or more nulls are added at the end of the text

So EXPECT is Forth’s way of getting text input (normally from the keyboard) into the Forth System via QUERY

NFA:    006CD9 86               DB   86H
        006CDA 45585045 43      DB   "EXPEC"
        006CDF D4               DB   'T'+80H
LFA:    006CE0 AA6C             DW   DOTQ-5
CFA:    006CE2 3C28      EXPEC: DW   DOCOL           ;   :
PFA:    006CE4 BD26             DW   OVER            ;   OVER
        006CE6 1226             DW   PLUS            ;   +
        006CE8 BD26             DW   OVER            ;   OVER
        006CEA 3622             DW   XDO             ; DO
        006CEC 4723      EXPE1: DW   KEY             ;   KEY
        006CEE 0621 7F00        DW   LIT,7FH         ;   7FH
        006CF2 4B24             DW   ANDD            ;   AND
        006CF4 0B27             DW   DUP             ;   DUP
        006CF6 0621 0800        DW   LIT,8           ;   LIT,8
        006CFA 5969             DW   EQUAL           ;   =
        006CFC DA21 3000        DW   ZBRAN,EXPE2-$   ;  IF
        006D00 CC26             DW   DROP            ;    DROP
        006D02 0B27             DW   DUP             ;    DUP
        006D04 5222             DW   IDO             ;    I
        006D06 5969             DW   EQUAL           ;    =
        006D08 0B27             DW   DUP             ;    DUP
        006D0A C925             DW   FROMR           ;    R>
        006D0C C767             DW   TWO             ;    2
        006D0E 4B69             DW   SUBB            ;    -
        006D10 1226             DW   PLUS            ;    +
        006D12 8525             DW   TOR             ;    >R
        006D14 DA21 0A00        DW   ZBRAN,EXPE6-$   ;	IF
        006D18 0621 0700        DW   LIT,BELL        ;	  BELL
        006D1C C221 0C00        DW   BRAN,EXPE7-$    ;	ELSE
        006D20 0621 0800 EXPE6: DW   LIT,8           ;        LIT,8
        006D24 0B27             DW   DUP             ;        DUP
        006D26 3623             DW   EMIT            ;        EMIT
        006D28 E469             DW   SPACE           ;        SPACE
        006D2A           EXPE7:                      ;      THEN
        006D2A C221 2800        DW   BRAN,EXPE3-$    ;  ELSE
        006D2E 0B27      EXPE2: DW   DUP             ;    DUP
        006D30 0621 0D00        DW   LIT,0DH         ;    LIT,0DH
        006D34 5969             DW   EQUAL           ;    =
        006D36 DA21 0E00        DW   ZBRAN,EXPE4-$   ;     IF
        006D3A 2E25             DW   LEAVE           ;       LEAVE
        006D3C CC26             DW   DROP            ;       DROP
        006D3E F067             DW   BL              ;       BL
        006D40 BF67             DW   ZERO            ;       0
        006D42 C221 0400        DW   BRAN,EXPE5-$    ;     ELSE
        006D46 0B27      EXPE4: DW   DUP             ;    DUP
        006D48           EXPE5:                      ;     THEN
        006D48 5222             DW   IDO             ;   I
        006D4A 1328             DW   CSTOR           ;   C!
        006D4C BF67             DW   ZERO            ;   0
        006D4E 5222             DW   IDO             ;   I
        006D50 D368             DW   ONEP            ;   1+
        006D52 F027             DW   STORE           ;   !
        006D54           EXPE3:                      ;  THEN
        006D54 3623             DW   EMIT            ;    EMIT
        006D56 EF21 94FF        DW   XLOOP,EXPE1-$   ; LOOP
        006D5A CC26             DW   DROP            ;   DROP
        006D5C 1725             DW   SEMIS           ;   ;S

The Meaning of the Dictionary Fields:

NFALFACFAPFA


Updated: 5th September 2022 by David Husband
© 2021 David Husband, a.k.a. Baremetal Engineer Extraordinaire
All Rights Reserved – All Trademarks & Copyrights Acknowledged
All personal information is subject to the Data Protection Act 2018 & the UK GDPR
“ad auxilium aliis ad auxilium sibi”