ßçûê Ôîðò è åãî ðåàëèçàöèè

         

Ìîäåëü ôîðò-ñèñòåìû


Ïðèâîäèìûé íèæå òåêñò ïðåäñòàâëÿåò ñîáîé ÿäðî ñèñòåìû ÔÎÐÒ-ÅÑ (ñì. ), èç êîòîðîãî èñêëþ÷åíû çàïóñêàþùàÿ ÷àñòü è ðåàëèçàöèè ñëîâ íèæíåãî óðîâíÿ äëÿ îáìåíà ñ òåðìèíàëîì è âíåøíåé ïàìÿòüþ. Îáùèé îáúåì ÿäðà — 8 Êáàéò (ñâûøå 200 ñëîâ). Òåêñò ñîñòîèò èç äâóõ ÷àñòåé — ñïèñêà ñëîâ ñ èõ êðàòêèìè ñïåöèôèêàöèÿìè è ýêðàíîâ ñ îïðåäåëåíèÿìè íà âñòðîåííîì ÿçûêå àññåìáëåðà è íà ÿçûêå Ôîðò.

Ïîìèìî ñëîâ, êîòîðûì ñîîòâåòñòâóþò ñòàòüè â ñëîâàðå, âíóòðè àññåìáëåðíûõ îïðåäåëåíèé èñïîëüçóþòñÿ ìåòêè è àäðåñà.  ñïåöèôèêàöèÿõ ýòè îáúåêòû îòìå÷åíû áóêâàìè Ì è À. Îíè îïðåäåëÿþòñÿ ñ ïîìîùüþ ñëîâ Ì: è À: ñîîòâåòñòâåííî. Ìåòêè èñïîëüçóþòñÿ â ìàøèííûõ êîìàíäàõ, à àäðåñà ïîðîæäàþò äâóõáàéòíîå çíà÷åíèå, ñîäåðæàùåå äàííûé àäðåñ. Àäðåñíûå îïåðàíäû FIRST è SECOND îáîçíà÷àþò ñîîòâåòñòâåííî ïåðâûé è âòîðîé ýëåìåíòû ñòåêà. Ìàêðîêîìàíäû PUSH, POP è PULL ìîæíî ðàññìàòðèâàòü êàê êîìàíäû ñ îäíèì ðåãèñòðîâûì îïåðàíäîì. Îïåðàöèÿ PUSH ïîìåùàåò íà ñòåê çíà÷åíèå èç ðåãèñòðà, POP ñíèìàåò âåðõíåå çíà÷åíèå ñî ñòåêà, çàñûëàÿ åãî â ðåãèñòð, è PULL êîïèðóåò âåðõíåå çíà÷åíèå ñòåêà â ðåãèñòð. Êðîìå òîãî, â àññåìáëåðíûõ îïðåäåëåíèÿõ èñïîëüçóþòñÿ ëîêàëüíûå ìåòêè [, ñ. 191], îáîçíà÷àåìûå öåëûìè ÷èñëàìè è ñëîâàìè =F (äëÿ ññûëêè âïåðåä) è =B (äëÿ ññûëêè íàçàä). Îïðåäåëÿåòñÿ ëîêàëüíàÿ ìåòêà ÷åðåç ñëîâî =H, êîòîðîå ïîëàãàåò åå ðàâíîé òåêóùåìó çíà÷åíèþ ñ÷åò÷èêà àäðåñà. Ðåãèñòðû îáùåãî íàçíà÷åíèÿ îáîçíà÷àþòñÿ ñïåöèàëüíûìè ñëîâàìè è èìåþò ñëåäóþùèé ñìûñë:

RW1 — ðàáî÷èé ðåãèñòð, ñòàðøèé â ïàðå;

RW2 — ðàáî÷èé ðåãèñòð, ìëàäøèé â ïàðå;

RI — óêàçàòåëü àäðåñíîãî èíòåðïðåòàòîðà;

RRET — àáñîëþòíûé àäðåñ âåðøèíû ñòåêà âîçâðàòîâ;

RSTACK — àáñîëþòíûé àäðåñ âåðøèíû ñòåêà äàííûõ;

RD — ôîðò-àäðåñ òåêóùåé âåðøèíû ñëîâàðÿ;

RFORTH — àáñîëþòíûé àäðåñ íà÷àëà ñëîâàðÿ, ñîîòâåòñòâóþùèé íóëåâîìó ôîðò-àäðåñó;

RNEXT — àäðåñ òî÷êè NEXT àäðåñíîãî èíòåðïðåòàòîðà (òîò æå àäðåñ, ÷òî è â RFORTH);

RTWO — êîíñòàíòà 2;


RMASK — êîíñòàíòà 65535.



Ïðåäïîëàãàåòñÿ òàêæå, ÷òî â ðåãèñòðå 13 íàõîäèòñÿ àäðåñ îáëàñòè ñîõðàíåíèÿ è ðåãèñòðû 0, 1, 14 è 15 ñâîáîäíî èñïîëüçóþòñÿ âíóòðè îïðåäåëåíèé êàê ðàáî÷èå.

Òåêñòû îïðåäåëåíèé ïðåäñòàâëåíû â âèäå ðàñïå÷àòîê ñòàíäàðòíûõ ôîðò-òåêñòîâ è çàíèìàþò ýêðàíû ñ íîìåðàìè îò 1 äî 47.  ïîñëåäíåì ñòîëáöå ñïåöèôèêàöèè äëÿ êàæäîãî ñëîâà óêàçàí íîìåð ýêðàíà, íà êîòîðîì îíî îïðåäåëåíî. Ãëàâíûì ñëîâîì ìîäåëè ÿâëÿåòñÿ ñëîâî ÔÎÐÒ-ÑÈÑÒÅÌÀ.

 ñïèñêå ñïåöèôèêàöèé ñëîâà ðàñïîëîæåíû ïî âîçðàñòàíèþ â êîäèðîâêå ÄÊÎÈ. Îíè ìîãóò èìåòü ñëåäóþùèå îòìåòêè:

À — àäðåñ;

Ì — ìåòêà;

Í — ñëîâî íåìåäëåííîãî èñïîëíåíèÿ;

Ê — òðåáóåòñÿ ðåæèì êîìïèëÿöèè;

Ï — ïåðåìåííàÿ, ðàçìåùåííàÿ â ïîëüçîâàòåëüñêîé îáëàñòè;

Ñ — ñèñòåìíàÿ ïåðåìåííàÿ, ðàçìåùåííàÿ â ñëîâàðå;

Ý — òðåáóåòñÿ ðåæèì îáðàáîòêè ýêðàíà;

+ — ñëîâî èç äîïîëíåíèÿ ê ñòàíäàðòó «Ôîðò-83»;

* — íåñòàíäàðòíîå ñëîâî.

Äëÿ êàæäîãî ñëîâà óêàçûâàþòñÿ çíà÷åíèÿ, êîòîðûå îíî ñíèìàåò ñî ñòåêà (ñëåâà îò çíàêà ->), è ðåçóëüòàò, êîòîðûé îíî îñòàâëÿåò íà ñòåêå (ñïðàâà îò çíàêà ->). Åñëè ïåðå÷èñëÿåòñÿ íåñêîëüêî çíà÷åíèé, òî âåðõíåå (âåðøèíà ñòåêà) íàõîäèòñÿ ñïðàâà.

Äëÿ çàäàíèÿ ïàðàìåòðîâ è ðåçóëüòàòîâ, ïåðåäàâàåìûõ ÷åðåç ñòåê äàííûõ, èñïîëüçóþòñÿ ñëåäóþùèå îáîçíà÷åíèÿ:

+N — íåîòðèöàòåëüíîå öåëîå ñî çíàêîì;

À — äâóõáàéòíûé ôîðò-àäðåñ;

Ñ — îäíîáàéòíîå çíà÷åíèå (ñòàðøèé áàéò, êàê ïðàâèëî, íóëåâîé);

CFA — äâóõáàéòíûé àäðåñ ïîëÿ êîäà ñëîâàðíîé ñòàòüè;

D — ÷åòûðåõáàéòíîå öåëîå ñî çíàêîì;

F — áóëåâñêîå çíà÷åíèå (0 — ËÎÆÜ, íå 0 — ÈÑÒÈÍÀ);

FF — áóëåâñêîå çíà÷åíèå ËÎÆÜ (0);

L — àáñîëþòíûé ìàøèííûé àäðåñ (÷åòûðåõáàéòíûé);

LFA — äâóõáàéòíûé àäðåñ ïîëÿ ñâÿçè ñëîâàðíîé ñòàòüè;

N — äâóõáàéòíîå öåëîå ñî çíàêîì;

NFA — äâóõáàéòíûé àäðåñ ïîëÿ èìåíè ñëîâàðíîé ñòàòüè;



PFA — äâóõáàéòíûé àäðåñ ïîëÿ ïàðàìåòðîâ ñëîâàðíîé ñòàòüè;

Ò — äâóõáàéòíûé àäðåñ ñòðîêè ñî ñ÷åò÷èêîì;

TF — áóëåâñêîå çíà÷åíèå ÈÑÒÈÍÀ (íå 0, îáû÷íî -1);

U — äâóõáàéòíîå öåëîå áåç çíàêà;

UD — ÷åòûðåõáàéòíîå öåëîå áåç çíàêà;

W — äâóõáàéòíîå öåëîå ñî çíàêîì èëè áåç íåãî (N èëè U);

WD — ÷åòûðåõáàéòíîå öåëîå ñî çíàêîì èëè áåç íåãî (D èëè UD).

Äëÿ íåêîòîðûõ ñëîâ óêàçàíû äâå ãðóïïû ðåçóëüòàòîâ, îòäåëÿåìûå äðóã îò äðóãà êîñîé ÷åðòîé (/). Îíè ðàçëè÷àþòñÿ ïî áóëåâñêîìó çíà÷åíèþ íà âåðøèíå ñòåêà: íå 0 (ÈÑÒÈÍÀ) îçíà÷àåò óñïåõ, 0 (ËÎÆÜ) — íåóäà÷ó.

*Í -> (ÏÓÑÒÎÅ ÑËÎÂÎ) - ÇÀÊÎÍ×ÈÒÜ ÈÍÒÅÐÏÐÅÒÀÖÈÞ 40 ÂÕÎÄÍÎÃÎ ÏÎÒÎÊÀ [ Í -> ÏÅÐÅÊËÞ×ÈÒÜ ÒÅÊÑÒÎÂÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ 22  ÐÅÆÈÌ ÈÑÏÎËÍÅÍÈß ['] ÍÊ -> /ÊÎÌÏÈËßÖÈß/ ÑÊÎÌÏÈËÈÐÎÂÀÒÜ CFA 41 ->CFA /ÈÑÏÎËÍÅÍÈÅ/ ÑËÅÄÓÞÙÅÃÎ ÑËÎÂÀ ÊÀÊ ×ÈÑËÎÂÎÉ ËÈÒÅÐÀË [COMPILE] ÍÊ -> ÑÊÎÌÏÈËÈÐÎÂÀÒÜ ÑËÅÄÓÞÙÅÅ ÑËÎÂÎ 41 ÍÅÇÀÂÈÑÈÌÎ ÎÒ ÅÃÎ ÏÐÈÇÍÀÊÀ "IMMEDIATE" . N-> ÍÀÏÅ×ÀÒÀÒÜ N ÍÀ ÒÅÐÌÈÍÀËÅ È ÄÀÒÜ ÏÐÎÁÅË 38 .( Í -> ÍÀÏÅ×ÀÒÀÒÜ ÑËÅÄÓÞÙÈÅ ËÈÒÅÐÛ ÄÎ 28 ÇÀÊÐÛÂÀÞÙÅÉ ÑÊÎÁÊÈ ÈÑÊËÞ×ÈÒÅËÜÍÎ ." ÍÊ -> ÏÐÈ ÈÑÏÎËÍÅÍÈÈ ÍÀÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ 28 ÑËÅÄÓÞÙÈÅ ËÈÒÅÐÛ ÄÎ ÊÀÂÛ×ÊÈ ÈÑÊËÞ×ÈÒÅËÜÍÎ 37 .R + N1,+N2-> ÍÀÏÅ×ÀÒÀÒÜ N1 ÍÀ ÒÅÐÌÈÍÀËÅ 38  ÏÎËÅ ÄËÈÍÛ +N2 ÑÏÐÀÂÀ .VOC * PFA+2-> ÍÀÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ ÈÌß 43 ÑËÎÂÀÐÍÎÉ ÑÒÀÒÜÈ ÄËß ÑÏÈÑÊÀ ÑËΠ< N1,N2->F F ÍÅ ÍÓËÜ, ÅÑËÈ N1 ÌÅÍÜØÅ N2 19 <> + W1,W2->F F ÍÅ ÍÓËÜ, ÅÑËÈ W1 ÍÅ ÐÀÂÍÎ W2 19 <# -> ÍÀ×ÀÒÜ ÔÎÐÌÀÒÍÎÅ ÏÐÅÎÁÐÀÇÎÂÀÍÈÅ 37 <MARK K ->A ÎÒÌÅÒÈÒÜ ÒÅÊÓÙÈÉ ÀÄÐÅÑ ÄËß ÑÑÛËÊÈ ÍÀÇÀÄ 19 <RESOLVE K A-> ÐÀÇÐÅØÈÒÜ ÑÑÛËÊÓ ÍÀÇÀÄ Â ÀÄÐÅÑ À 19 ( Í -> ÊÎÌÌÅÍÒÀÐÈÉ - ÏÐÎÏÓÑÒÈÒÜ ÑËÅÄÓÞÙÈÉ ÒÅÊÑÒ 28 ÄÎ ÇÀÊÐÛÂÀÞÙÅÉ ÊÐÓÃËÎÉ ÑÊÎÁÊÈ (.") *K -> ÏÐÎÖÅÄÓÐÀ, ÊÎÌÏÈËÈÐÓÅÌÀß Â ." 28 (+LOOP) * N-> ÒÅÑÒ ÍÀ ÇÀÂÅÐØÅÍÈÅ ÖÈÊËÀ "DO +LOOP" 5 Ñ ØÀÃÎÌ N (;CODE) *K -> ÇÀÏÈÑÀÒÜ Â ÏÎËÅ ÊÎÄÀ ÏÎÑËÅÄÍÅÉ ÑÒÀÒÜÈ 31 ÑËÅÄÓÞÙÈÉ ÀÄÐÅÑ È ÇÀÊÎÍ×ÈÒÜ ÎÏÐÅÄÅËÅÍÈÅ (#SCR) * N->A,T ÏÅÐÅÂÅÑÒÈ ÍÎÌÅÐ ÝÊÐÀÍÀ N  ÒÅÊÑÒ 46 (A") * F-> ÏÐÎÖÅÄÓÐÀ, ÊÎÌÏÈËÈÐÓÅÌÀß Â ABORT" 29 (DO) *K W1,W2-> ÂÕÎÄ Â ÖÈÊË ÑÎ Ñ×ÅÒ×ÈÊÎÌ ÎÒ W2 ÄÎ W1 24 (EXPECT) * A,+N1->A,+N2 ÂÂÅÑÒÈ Ñ ÒÅÐÌÈÍÀËÀ 6 +N1 ËÈÒÅÐ ÏÎ ÀÄÐÅÑÓ À ÄÎ ÏÅÐÅÂÎÄÀ ÑÒÐÎÊÈ; +N2 - ÔÀÊÒÈ×ÅÑÊÎÅ ×ÈÑËÎ ÂÂÅÄÅÍÍÛÕ ËÈÒÅÐ (FIND) * -1,AN,,,A1,T->CFA,C,TF/FF ÈÑÊÀÒÜ ÑËÎÂÎ Ò 34  ÑÏÈÑÊÀÕ À1,,,AN; ÏÐÈ ÓÑÏÅÕÅ ÄÀÒÜ CFA ÅÃÎ ÑÒÀÒÜÈ È Ñ - ÁÀÉÒ ÄËÈÍÛ Ñ ÏÐÈÇÍÀÊÀÌÈ (FORGET) * A-> ÓÄÀËÈÒÜ ÑËÎÂÀÐÍÛÅ ÑÒÀÒÜÈ ÏÎÑËÅ ÀÄÐÅÑÀ À 45 (LOOP) * -> ÒÅÑÒ ÍÀ ÇÀÂÅÐØÅÍÈÅ ÖÈÊËÀ "DO LOOP" 5 (VOC) * PFA1+2->PFA2,N/0,N ÄÀÒÜ ×ÈÑËÎ ÑÒÀÒÅÉ N  43 ÑÏÈÑÊÅ PFA1+2 È PFA ÑËÅÄÓÞÙÅÃÎ ÑÏÈÑÊÀ ÈËÈ ÍÓËÜ, ÅÑËÈ ÅÃÎ ÍÅÒ + W1,W2->W3 ÑÓÌÌÀ ×ÈÑÅË W1 È W2 17 +! W,A-> ÓÂÅËÈ×ÈÒÜ ÇÍÀ×ÅÍÈÅ ÏÎ ÀÄÐÅÑÓ À ÍÀ W 17 +BUF * A1->A2,F ÏÅÐÅÉÒÈ Ê ÑËÅÄÓÞÙÅÌÓ ÁÓÔÅÐÓ Â ÏÓËÅ 25 +LOOP HK A1,A2,3-> /ÊÎÌÏÈËßÖÈß/ ÊÎÍÅÖ ÖÈÊËÀ 47 N-> /ÈÑÏÎËÍÅÍÈÅ/ "DO +LOOP" Ñ ØÀÃÎÌ N ! W,A-> ÇÀÑËÀÒÜ ÇÍÀ×ÅÍÈÅ W ÏÎ ÀÄÐÅÑÓ À 11 !CSP * -> ÇÀÏÎÌÍÈÒÜ ÀÄÐÅÑ ÂÅÐØÈÍÛ ÑÒÅÊÀ  CSP 29 ] -> ÏÅÐÅÊËÞ×ÈÒÜ ÒÅÊÑÒÎÂÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ 22  ÐÅÆÈÌ ÊÎÌÏÈËßÖÈÈ * N1,N2->N3 ÏÐÎÈÇÂÅÄÅÍÈÅ ×ÈÑÅË N1 È N2 18 */ N1,N2,N3->N4 ×ÀÑÒÍÎÅ ÎÒ ÄÅËÅÍÈß N1*N2 ÍÀ N3 18 */MOD N1,N2,N3->N4,N5 ÎÑÒÀÒÎÊ N4 È ×ÀÑÒÍÎÅ N5 18 ÎÒ ÄÅËÅÍÈß ÏÐÎÈÇÂÅÄÅÍÈß N1*N2 ÍÀ N3 ; HK -> ÇÀÊÎÍ×ÈÒÜ ÎÏÐÅÄÅËÅÍÈÅ ×ÅÐÅÇ ÄÂÎÅÒÎ×ÈÅ 32 ;S +ÍÝ -> ÇÀÊÎÍ×ÈÒÜ ÈÍÒÅÐÏÐÅÒÀÖÈÞ ÝÊÐÀÍÀ 41 - W1,W2->W3 ÂÛ×ÅÑÒÜ W2 ÈÇ W1 17 --> +ÍÝ -> ÈÍÒÅÐÏÐÅÒÈÐÎÂÀÒÜ ÑËÅÄÓÞÙÈÉ ÝÊÐÀÍ 41 -FIND * ->A,N ÂÂÅÑÒÈ ÑËÎÂÎ È ÈÑÊÀÒÜ Â ÑËÎÂÀÐÅ; 35 ÐÅÇÓËÜÒÀÒ ÒÎÒ ÆÅ, ×ÒÎ È Ó FIND -TRAILING A,N1->A,N2 ÎÒÑÅ×Ü ÊÎÍÅ×ÍÛÅ ÏÐÎÁÅËÛ 41 / N1,N2->N3 ×ÀÑÒÍÎÅ ÎÒ ÄÅËÅÍÈß N1 ÍÀ N2 18 /MOD N1,N2->N3,N4 ÎÑÒÀÒÎÊ N3 È ×ÀÑÒÍÎÅ N4 18 ÎÒ ÄÅËÅÍÈß N1 ÍÀ N2 , W-> ÑÊÎÌÏÈËÈÐÎÂÀÒÜ W ÍÀ ÂÅÐØÈÍÓ ÑËÎÂÀÐß 11 ," * -> ÑÊÎÌÏÈËÈÐÎÂÀÒÜ ÑÒÐÎÊÓ ÑÎ Ñ×ÅÒ×ÈÊÎÌ 28 > N1,N2->F F ÍÅ ÍÓËÜ, ÅÑËÈ N1 ÁÎËÜØÅ N2 19 >= * N1,N2->F F ÍÅ ÍÓËÜ, ÅÑËÈ N1 ÍÅ ÌÅÍÜØÅ N2 19 >BODY CFA->PFA ÎÒ ÏÎËß ÊÎÄÀ Ê ÏÎËÞ ÏÀÐÀÌÅÒÐΠ30 >IN Ï ->A ÏÅÐÅÌÅÍÍÀß - ÑÌÅÙÅÍÈÅ Î×ÅÐÅÄÍÎÉ ËÈÒÅÐÛ 8 ÂÎ ÂÕÎÄÍÎÌ ÒÅÊÑÒÎÂÎÌ ÁÓÔÅÐÅ ÈËÈ ÝÊÐÀÍÅ >LINK * CFA->LFA ÏÅÐÅÉÒÈ ÎÒ ÏÎËß ÊÎÄÀ Ê ÏÎËÞ ÑÂßÇÈ 30 >MARK K ->A ÎÒÌÅÒÈÒÜ ÒÅÊÓÙÈÉ ÀÄÐÅÑ ÄËß ÑÑÛËÊÈ ÂÏÅÐÅÄ 19 >NAME * CFA->NFA ÏÅÐÅÉÒÈ ÎÒ ÏÎËß ÊÎÄÀ Ê ÏÎËÞ ÈÌÅÍÈ 30 >R K W-> ÏÅÐÅÍÅÑÒÈ W ÍÀ ÑÒÅÊ ÂÎÇÂÐÀÒΠ9 >RESOLVE K A-> ÐÀÇÐÅØÈÒÜ ÑÑÛËÊÓ ÂÏÅÐÅÄ Â ÀÄÐÅÑÅ À 19 ? * A-> ÍÀÏÅ×ÀÒÀÒÜ ÇÍÀ×ÅÍÈÅ ÏÎ ÀÄÐÅÑÓ À 38 ?+ * +N->+N ÏÐÎÂÅÐÈÒÜ, ×ÒÎ +N ÍÅÎÒÐÈÖÀÒÅËÜÍÎ 29 ?ABORT * F,T-> ÅÑËÈ F ÍÅ ÍÓËÜ, ÒÎ ÍÀÏÅ×ÀÒÀÒÜ ÍÀ 29 ÒÅÐÌÈÍÀËÅ ÑÒÐÎÊÓ Ò È ÓÉÒÈ ÍÀ ABORT ?BRANCH K F-> ÅÑËÈ F "ËÎÆÜ", ÒÎ ÊÀÊ BRANCH, ÈÍÀ×Å 5 ÏÐÎÄÎËÆÈÒÜ ÈÍÒÅÐÏÐÅÒÀÖÈÞ ÎÒ ÀÄÐÅÑÀ, ÑËÅÄÓÞÙÅÃÎ ÇÀ ÀÄÐÅÑÎÌ ÏÅÐÅÕÎÄÀ ?COMP * -> ÏÐÎÂÅÐÈÒÜ, ×ÒÎ ÒÅÊÓÙÈÉ ÐÅÆÈÌ - ÊÎÌÏÈËßÖÈß 29 ?CSP * -> ÂÛÄÀÒÜ ÎØÈÁÊÓ "ÑÁÈËÑß ÓÊÀÇÀÒÅËÜ ÑÒÅÊÀ" 29 ÅÑËÈ ÎÍ ÍÅ ÐÀÂÅÍ ÇÍÀ×ÅÍÈÞ Â CSP ?DUP W->W,W ÏÐÎÄÓÁËÈÐÎÂÀÒÜ W, ÅÑËÈ ÝÒÎ ÍÅ ÍÓËÜ 9 ?GAP * N-> ÂÛÄÀÒÜ ÎØÈÁÊÓ "ÈÑ×ÅÐÏÀÍÈÅ ÏÀÌßÒÈ", ÅÑËÈ 29 ÇÀÇÎÐ ÌÅÆÄÓ ÂÅÐØÈÍÀÌÈ ÑÒÅÊÀ È ÑËÎÂÀÐß ÌÅÍÅÅ N ÁÀÉÒΠ?LOADING * -> ÂÛÄÀÒÜ ÎØÈÁÊÓ "ÍÅÒÎÁÐÀÁÎÒÊÈ ÝÊÐÀÍÀ", 29 ÅÑËÈ ÂÕÎÄÍÎÉ ÒÅÊÑÒ ÈÄÅÒ ÍÅ Ñ ÝÊÐÀÍÀ ?PAIRS * W1,W2-> ÂÛÄÀÒÜ ÎØÈÁÊÓ "ÍÅÏÀÐÍÛÅ ÑÊÎÁÊÈ", 29 ÅÑËÈ W1 ÍÅ ÐÀÂÍÎ W2 ?STACK * -> ÂÛÄÀÒÜ ÎØÈÁÊÓ "ÈÑ×ÅÐÏÀÍÈÅ ÑÒÅÊÀ", ÅÑËÈ 29 ÎÍ ÁÎËÅÅ, ×ÅÌ ÏÓÑÒ, È "ÈÑ×ÅÐÏÀÍÈÅ ÏÀÌßÒÈ" ÏÐÈ ÇÀÇÎÐÅ, ÌÅÍÜØÅÌ 10 ÁÀÉÒΠ: -> ÍÀ×ÀÒÜ ÎÏÐÅÄÅËÅÍÈÅ ÑËÎÂÀ ×ÅÐÅÇ ÄÂÎÅÒÎ×ÈÅ 32 # D1->D2 ÄÅËÅÍÈÅÌ D1 ÍÀ ÇÍÀ×ÅÍÈÅ BASE 37 ÂÛÄÅËÈÒÜ 1 ÖÈÔÐÓ Ñ ÊÎÍÖÀ È ÄÎÁÀÂÈÒÜ ÅÅ Â ÁÓÔÅÐ PAD, ÎÑÒÀÂÈ ×ÀÑÒÍÎÅ D2 #> D->A,+N ÇÀÊÎÍ×ÈÒÜ ÔÎÐÌÀÒÍÎÅ ÏÐÅÎÁÐÀÇÎÂÀÍÈÅ; 37 ÄÀÒÜ ÀÄÐÅÑ À ÍÀ×ÀËÀ ËÈÒÅÐ È ÈÕ ×ÈÑËÎ +N #S D1->0,0 ÂÛÄÅËßÒÜ ÖÈÔÐÛ D1 ÏÎ ÑËÎÂÓ # ÄÎ 37 ÏÎËÓ×ÅÍÈß ÍÓËß #TIB Ï ->A ÏÅÐÅÌÅÍÍÀß - ×ÈÑËÎ ËÈÒÅÐ Â ÁÓÔÅÐÅ TIB 8 @ A->W ÄÀÒÜ ÇÍÀ×ÅÍÈÅ ÏÎ ÀÄÐÅÑÓ À 11 ' ->CFA ÄÀÒÜ CFA ÄËß ÑËÅÄÓÞÙÅÃÎ ÑËÎÂÀ 41 = W1,W2->F F ÍÅ ÍÓËÜ, ÅÑËÈ W1 ÐÀÂÍÎ W2 19 " *ÍÊ -> /ÊÎÌÏÈËßÖÈß/ ÑÊÎÌÏÈËÈÐÎÂÀÒÜ ÑËÅÄÓÞÙÈÅ 28 ->T /ÈÑÏÎËÍÅÍÈÅ/ ËÈÒÅÐÛ ÄÎ ÊÀÂÛ×ÊÈ ÈÑÊËÞ×ÈÒÅËÜÍÎ ÊÀÊ ÑÒÐÎÊÓ ÑÎ Ñ×ÅÒ×ÈÊÎÌ ". * T-> ÍÀÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ ÑÒÐÎÊÓ T 28 ABORT -> ÑÁÐÎÑÈÒÜ ÑÒÅÊ È ÓÉÒÈ ÏÎ QUIT 28 ABORT" ÊÍ -> /ÊÎÌÏÈËßÖÈß/ ÅÑËÈ F "ÈÑÒÈÍÀ" (ÍÅ ÍÓËÜ) 29 F-> /ÈÑÏÎËÍÅÍÈÅ/ ÒÎ ÍÀÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ ÑËÅÄÓÞÙÈÉ ÒÅÊÑÒ ÄÎ ÊÀÂÛ×ÊÈ È ÓÉÒÈ ÍÀ ABORT ABORT8 * -> ÂÛÄÀÒÜ ÎØÈÁÊÓ "ÍÅÏÐÀÂÈËÜÍÎÅ ÇÍÀ×ÅÍÈÅ" 29 ABS N1->N2 ÀÁÑÎËÞÒÍÀß ÂÅËÈ×ÈÍÀ 17 AGAIN +ÍÊ A,1-> /ÊÎÌÏÈËßÖÈß/ ÊÎÍÅÖ ÖÈÊËÀ "BEGIN AGAIN" 47 -> /ÈÑÏÎËÍÅÍÈÅ/ ALIGN * +N-> ÂÛÐÎÂÍßÒÜ ÂÅÐØÈÍÓ ÑËÎÂÀÐß ÍÀ +N 10 ALIGNH * -> ÂÛÐÎÂÍßÒÜ ÂÅÐØÈÍÓ ÑËÎÂÀÐß ÍÀ ÏÎËÓÑËÎÂÎ 10 ALLOT W-> ÑÌÅÑÒÈÒÜ ÂÅÐØÈÍÓ ÑËÎÂÀÐß ÍÀ W ÁÀÉÒΠ10 ALPHA * N->C ÏÐÅÎÁÐÀÇÎÂÀÒÜ N  ËÈÒÅÐÓ Ñ ÊÀÊ ÖÈÔÐÓ 37 AND W1,W2->W3 ÏÎÐÀÇÐßÄÍÎÅ ËÎÃÈ×ÅÑÊÎÅ "È" 13 B/BUF + ->1024 ×ÈÑËÎ ÁÀÉÒΠ ÁËÎ×ÍÎÌ ÁÓÔÅÐÅ 7 BADWORD * A-> ÑÎÎÁÙÈÒÜ Î ÍÅÎÏÎÇÍÀÍÎÌ ÑËÎÂÅ 29 BASE Ï ->A ÏÅÐÅÌÅÍÍÀß - ÒÅÊÓÙÅÅ ÎÑÍÎÂÀÍÈÅ ÑÈÑÒÅÌÛ 8 Ñ×ÈÑËÅÍÈß ÏÐÈ ÂÂÎÄÅ-ÂÛÂÎÄÅ ×ÈÑÅË BEGIN ÍÊ ->A,1 /ÊÎÌÏÈËßÖÈß/ ÍÀ×ÀËÎ ÖÈÊËÀ "BEGIN" 47 -> /ÈÑÏÎËÍÅÍÈÅ/ BL + ->64 ÊÎÍÑÒÀÍÒÀ - ÊÎÄ ÏÐÎÁÅËÀ  ÄÊÎÈ 7 BLANK + A,U-> ÇÀÑËÀÒÜ ÏÐÎÁÅËÛ Â U ÁÀÉÒΠÏÎ ÀÄÐÅÑÓ À 22 BLK Ï ->A ÏÅÐÅÌÅÍÍÀß - ÍÎÌÅÐ ÂÕÎÄÍÎÃÎ ÁËÎÊÀ-ÝÊÐÀÍÀ 8 BLOCK +N->A ÄÀÒÜ ÀÄÐÅÑ À ÁÓÔÅÐÀ Ñ ÁËÎÊÎÌ +N 25 BODY> * PFA->CFA ÎÒ ÏÎËß ÏÀÐÀÌÅÒÐÎÂ Ê ÏÎËÞ ÊÎÄÀ 30 BRANCH K -> ÏÐÎÄÎËÆÈÒÜ ÈÍÒÅÐÏÐÅÒÀÖÈÞ ÎÒ ÇÍÀ×ÅÍÈß 5 ÑËÅÄÓÞÙÅÃÎ ÑÊÎÌÏÈËÈÐÎÂÀÍÍÎÃÎ ÀÄÐÅÑÀ BRANCH# M ÏÐÎÄÎËÆÅÍÈÅ ÈÍÒÅÐÏÐÅÒÀÖÈÈ ÎÒ ÀÄÐÅÑÀ  5 ÑËÅÄÓÞÙÅÌ ÏÎËÓÑËÎÂÅ BUFFER +N->A ÏÐÈÏÈÑÀÒÜ ÁËÎÊÓ +N ÁÓÔÅÐ 25 C! C,A-> ÇÀÑËÀÒÜ ÁÀÉÒ Ñ ÏÎ ÀÄÐÅÑÓ À 11 C, + C-> ÑÊÎÌÏÈËÈÐÎÂÀÒÜ ÁÀÉÒ Ñ ÍÀ ÂÅÐØÈÍÓ ÑËÎÂÀÐß 11 Ñ@ A->C ÄÀÒÜ ÁÀÉÒ ÏÎ ÀÄÐÅÑÓ À 11 C" *H -> /ÊÎÌÏÈËßÖÈß/ ÑÊÎÌÏÈËÈÐÎÂÀÒÜ ÊÎÄ ÏÅÐÂÎÉ 28 ->C /ÈÑÏÎËÍÅÍÈÅ/ ËÈÒÅÐÛ ÑËÅÄÓÞÙÅÃÎ ÑËÎÂÀ ÊÀÊ ËÈÒÅÐÀË CMOVE A1,A2,U-> ÏÅÐÅÑËÀÒÜ U ÁÀÉÒΠÎÒ A1  A2 21 CMOVE> A1,A2,U-> ÏÅÐÅÑËÀÒÜ U ÁÀÉÒΠÎÒ ÀÄÐÅÑÀ A1 21 ÏÎ ÀÄÐÅÑÓ À2 ÍÀ×ÈÍÀß Ñ ÁÎËÜØÈÕ ÀÄÐÅÑΠCOMPILE K -> ÊÎÌÏÈËÈÐÎÂÀÒÜ ÑËÅÄÓÞÙÈÉ ÀÄÐÅÑ 22 CONSTANT W-> ÎÏÐÅÄÅËÈÒÜ ÑËÅÄÓÞÙÅÅ ÑËÎÂÎ 32 ÊÀÊ ÊÎÍÑÒÀÍÒÓ ÑÎ ÇÍÀ×ÅÍÈÅÌ W CONTEXT Ï ->A ÏÅÐÅÌÅÍÍÀß - ÑÏÈÑÎÊ, Ñ ÊÎÒÎÐÎÃÎ 7 ÍÀ×ÈÍÀÅÒÑß ÏÎÈÑÊ ÂÂÎÄÈÌÛÕ ÑËΠCONVERT WD1,A1->WD2,A2 ÏÐÅÎÁÐÀÇÎÂÀÒÜ WD1 È ËÈÒÅÐÛ 39 ÎÒ À1+1  WD2 È À2 - ÀÄÐÅÑ 1-ÎÉ ÍÅ ÖÈÔÐÛ COUNT T->A,N ÄÀÒÜ ÀÄÐÅÑ ÏÅÐÂÎÉ ËÈÒÅÐÛ È ×ÈÑËÎ 28 ËÈÒÅÐ N ÑÒÐÎÊÈ ÑÎ Ñ×ÅÒ×ÈÊÎÌ T CR -> ÂÛÂÅÑÒÈ ÍÀ ÒÅÐÌÈÍÀË ÏÅÐÅÂÎÄ ÑÒÐÎÊÈ 6 CREATE -> ÑÎÇÄÀÒÜ ÍÀ×ÀËÎ ÑÒÀÒÜÈ (ÄÎ PFA) ÄËß 36 ÑËÅÄÓÞÙÅÃÎ ÑËÎÂÀ; ÅÃÎ ÈÑÏÎËÍÅÍÈÅ ÊËÀÄÅÒ PFA ÍÀ ÑÒÅÊ CREATE# A ÍÀ×ÀËÎ ÈÑÏÎËÍÈÒÅËÜÍÎÉ ×ÀÑÒÈ "VARIABLE" 3 CSP *Ï ->A ÏÅÐÅÌÅÍÍÀß ÄËß ÊÎÍÒÐÎËÜÍÎÃÎ ÕÐÀÍÅÍÈß 8 ÇÍÀ×ÅÍÈß ÓÊÀÇÀÒÅËß ÑÒÅÊÀ CURRENT Ï ->A ÏÅÐÅÌÅÍÍÀß - ÑÏÈÑÎÊ ÄËß ÄÎÁÀÂËÅÍÈß ÑËΠ7 D.


D-> ÍÀÏÅ×ÀÒÀÒÜ D ÍÀ ÒÅÐÌÈÍÀËÅ È ÄÀÒÜ ÏÐÎÁÅË 38 D.R D,+N-> ÍÀÏÅ×ÀÒÀÒÜ D  ÏÎËÅ ÄËÈÍÛ +N ÑÏÐÀÂÀ 38 D< D1,D2->F F "ÈÑÒÈÍÀ", ÅÑËÈ D1 ÌÅÍÜØÅ D2 15 D+ WD1,WD2->WD3 ÑÓÌÌÀ ÄÂÎÉÍÛÕ ×ÈÑÅË WD1 È WD2 14 D- WD1,WD2->WD3 ÐÀÇÍÎÑÒÜ ÄÂÎÉÍÛÕ ×ÈÑÅË WD1-WD2 14 D/ * D1,D2->D3 ×ÀÑÒÍÎÅ D3 ÎÒ ÄÅËÅÍÈß D1 ÍÀ D2 15 D/MOD * D1,D2->D3,D4 ÎÑÒÀÒÎÊ D3 È ×ÀÑÒÍÎÅ D4 ÎÒ 15 ÄÅËÅÍÈß ÄÂÎÉÍÛÕ ×ÈÑÅË D1 ÍÀ D2 D= WD1,WD2->F F "ÈÑÒÈÍÀ", ÅÑËÈ WD1 È WD2 ÐÀÂÍÛ 15 DABS D1->D2 ÀÁÑÎËÞÒÍÀß ÂÅËÈ×ÈÍÀ ÄÂÎÉÍÎÃÎ ×ÈÑËÀ 14 DECIMAL -> ÏÅÐÅÉÒÈ Â ÄÅÑßÒÈ×ÍÓÞ ÑÈÑÒÅÌÓ 22 DEFINITIONS -> ÓÑÒÀÍÎÂÈÒÜ ÑÏÈÑÎÊ CURRENT ÍÀ CONTEXT 31 DEPTH ->+N ÊÎËÈ×ÅÑÒÂÎ ÇÍÀ×ÅÍÈÉ ÍÀ ÑÒÅÊÅ ÄÀÍÍÛÕ 20 DIGIT * C,N1->N2,TF/FF N2 - ÇÍÀ×ÅÍÈÅ ËÈÒÅÐÛ Ñ ÊÀÊ 39 ÖÈÔÐÛ Â ÑÈÑÒÅÌÅ Ñ×ÈÑËÅÍÈß ÏÎ ÎÑÍÎÂÀÍÈÞ N1 DMAX WD1,WD2->WD3 ÁÎËÜØÅÅ ÈÇ ÄÂÓÕ ×ÈÑÅË 16 DMIN WD1,WD2->WD3 ÌÅÍÜØÅÅ ÈÇ ÄÂÓÕ ×ÈÑÅË 16 DMOD * D1,D2->D3 ÎÑÒÀÒÎÊ D3 ÎÒ ÄÅËÅÍÈß D1 ÍÀ D2 15 DNEGATE D1->D2 ÐÅÇÓËÜÒÀÒ ÂÛ×ÈÒÀÍÈß D1 ÈÇ ÍÓËß 14 DO HK ->A1,A2,3 /ÊÎÌÏÈËßÖÈß/ ÍÀ×ÀËÎ ÖÈÊËÀ DO ÑÎ 47 N1,N2-> /ÈÑÏÎËÍÅÍÈÅ/ Ñ×ÅÒ×ÈÊÎÌ ÎÒ N2 ÄÎ N1 DOES> HK -> ÍÀ×ÀËÎ "ÈÑÏÎËÍÅÍÈß"  ÎÏÐÅÄÅËßÞÙÅÌ ÑËÎÂÅ 36 DOES# M ÏÎÄÏÐÎÃÐÀÌÌÀ - ÍÀ×ÀËÎ ÐÀÑØÈÐÅÍÈß DOES> 3 DP! * A-> ÓÑÒÀÍÎÂÈÒÜ ÂÅÐØÈÍÓ ÑËÎÂÀÐß ÍÀ ÀÄÐÅÑ À 10 DPL +Ï ->A ÏÅÐÅÌÅÍÍÀß - ÏÎÇÈÖÈß ÏÎÑËÅÄÍÅÉ ÒÎ×ÊÈ 8  ÏÎÑËÅÄÍÅÌ ÂÂÅÄÅÍÍÎÌ ×ÈÑËÅ ÎÒ ÊÎÍÖÀ DROP W-> ÓÁÐÀÒÜ ÑÎ ÑÒÅÊÀ ÂÅÐÕÍÅÅ ÇÍÀ×ÅÍÈÅ 9 DU< UD1,UD2->F F "ÈÑÒÈÍÀ", ÅÑËÈ UD1 ÌÅÍÜØÅ UD2 14 DUMP + A,U-> ÐÀÑÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ U ÁÀÉÒΠ42 ÎÒ ÀÄÐÅÑÀ À DUP W->W,W ÏÐÎÄÓÁËÈÐÎÂÀÒÜ ÂÅÐÕÍÅÅ ÇÍÀ×ÅÍÈÅ 9 D0< D->F F "ÈÑÒÈÍÀ", ÅÑËÈ D ÌÅÍÜØÅ ÍÓËß 15 D0= WD->F F "ÈÑÒÈÍÀ", ÅÑËÈ WD ÍÓËÜ 15 D2/ D1->D2 ÐÀÇÄÅËÈÒÜ ÍÀ ÄÂÀ 15 ELSE HK A1,2->A2,2 /ÊÎÌÏÈËßÖÈß/ ÍÀ×ÀËÎ 2-ÎÉ ÂÅÒÂÈ 47 -> /ÈÑÏÎËÍÅÍÈÅ/ ÂÅÒÂËÅÍÈß IF EMIT C-> ÂÛÂÅÑÒÈ ÍÀ ÒÅÐÌÈÍÀË ËÈÒÅÐÓ Ñ ÊÎÄÎÌ Ñ 6 EMPTY-BUFFERS + -> Î×ÈÑÒÈÒÜ ÁÓÔÅÐÍÛÉ ÏÓË 25 ENCLOSE * A,C->A,N1,N2,N3 ÂÂÎÄ ÑËÎÂÀ 27 ERASE + A,U-> ÇÀÑËÀÒÜ ÍÓËÈ Â U ÁÀÉÒΠÏÎ ÀÄÐÅÑÓ À 22 ERCOND8 M ÑÈÃÍÀËÈÇÀÖÈß Î ÍÅÏÐÀÂÈËÜÍÎÌ ÇÍÀ×ÅÍÈÈ 4 EXECUTE CFA-> ÈÑÏÎËÍÈÒÜ ÑËÎÂÎ ÏÎ CFA ÅÃÎ ÑÒÀÒÜÈ 11 EXIT K -> ÇÀÊÎÍ×ÈÒÜ ÈÑÏÎËÍÅÍÈÅ ÒÅÊÓÙÅÃÎ ÎÏÐÅÄÅËÅÍÈß 4 EXIT# M ÒÎ×ÊÀ "EXIT" ÀÄÐÅÑÍÎÃÎ ÈÍÒÅÐÏÐÅÒÀÒÎÐÀ 4 EXPECT A,+N-> ÂÂÅÑÒÈ Ñ ÒÅÐÌÈÍÀËÀ +N ËÈÒÅÐ ÏÎ 40 ÀÄÐÅÑÓ À;  ÏÅÐÅÌÅÍÍÓÞ SPAN ÇÀÑËÀÒÜ ÔÀÊÒÈ×ÅÑÊÎÅ ×ÈÑËÎ ÂÂÅÄÅÍÍÛÕ ËÈÒÅÐ; ËÈÒÅÐÛ ÍÀÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ FENCE *Ï ->A ÏÅÐÅÌÅÍÍÀß - ÃÐÀÍÈÖÀ ÇÀÙÈÒÛ ÎÒ FORGET 7 FILL A,U,C-> ÇÀÑËÀÒÜ Ñ Â U ÁÀÉÒΠÏÎ ÀÄÐÅÑÓ À 22 FIND T->A,N ÈÑÊÀÒÜ ÑËÎÂÎ Ò Â ÒÅÊÓÙÅÌ ÊÎÍÒÅÊÑÒÅ 35 ÅÑËÈ N=0, ÒÎ À=Ò È ÑËÎÂÎ ÍÅ ÍÀÉÄÅÍÎ; ÈÍÀ×Å À=CFA ÍÀÉÄÅÍÍÎÉ ÑÒÀÒÜÈ, N=1 ÄËß ÑËΠ"IMMEDIATE" È N=-1 ÄËß ÎÑÒÀËÜÍÛÕ FIRST * ->A ÊÎÍÑÒÀÍÒÀ - ÀÄÐÅÑ ÍÀ×ÀËÀ ÁÓÔÅÐÍÎÃÎ ÏÓËÀ 2 FIRST# Ì ÇÍÀ×ÅÍÈÅ ÊÎÍÑÒÀÍÒÛ FIRST 2 FL# A ÏÎËÅ ÑÂßÇÈ ÄËß ÑÏÈÑÊΠ ÏÎËÅ ÏÀÐÀÌÅÒÐΠ33 ÑËÎÂÀÐÍÎÉ ÑÒÀÒÜÈ ÑËÎÂÀ FORTH FLUSH -> ÇÀÏÈÑÀÒÜ ÁËÎÊÈ ÍÀ ÄÈÑÊ È Î×ÈÑÒÈÒÜ ÏÓË 26 FORGET -> ÓÄÀËÈÒÜ ÑËÎÂÀÐÍÓÞ ÑÒÀÒÜÞ ÑËÅÄÓÞÙÅÃÎ ÑËÎÂÀ 45 È ÂÑÅÕ ÑËÎÂ, ÎÏÐÅÄÅËÅÍÍÛÕ ÏÎÑËÅ ÍÅÃÎ FORTH -> ÓÑÒÀÍÎÂÈÒÜ CONTEXT ÍÀ ÍÀ×ÀËÜÍÛÉ ÑÏÈÑÎÊ 33 FORTH-83 -> ÑÒÀÍÄÀÐÒÍÛÉ ÊÎÍÒÅÊÑÒ ÔÎÐÒ-ÑÈÑÒÅÌÛ 33 FORTH# A PFA+2 ÄËß ÑËÎÂÀÐÍÎÉ ÑÒÀÒÜÈ FORTH 33 GOTO M ÏÎÄÏÐÎÃÐÀÌÌÀ ÏÅÐÅÕÎÄÀ ÏÎ ÑÑÛËÊÅ 4 H. + U-> ÍÀÏÅ×ÀÒÀÒÜ U ÍÀ ÒÅÐÌÈÍÀËÅ 38  16-ÍÎÉ ÑÈÑÒÅÌÅ È ÄÀÒÜ ÏÐÎÁÅË HERE ->A ÄÀÒÜ ÀÄÐÅÑ ÒÅÊÓÙÅÉ ÂÅÐØÈÍÛ ÑËÎÂÀÐß 10 HEX + -> ÏÅÐÅÉÒÈ Â ØÅÑÒÍÀÄÖÀÒÈÐÈ×ÍÓÞ ÑÈÑÒÅÌÓ 22 HLD *Ï ->A ÏÅÐÅÌÅÍÍÀß - ÏÎÇÈÖÈß ÏÎÑËÅÄÍÅÉ ËÈÒÅÐÛ, 8 ÏÅÐÅÍÅÑÅÍÍÎÉ Â ÁÓÔÅÐ PAD ÏÎ HOLD HOLD C-> ÏÅÐÅÍÅÑÒÈ ËÈÒÅÐÓ Ñ ÍÀ ÂÅÐØÈÍÓ ÁÓÔÅÐÀ PAD 37 I K ->W ÒÅÊÓÙÅÅ ÇÍÀ×ÅÍÈÅ W Ñ×ÅÒ×ÈÊÀ ÖÈÊËÀ DO 24 I' +K ->W ÊÎÍÅ×ÍÎÅ ÇÍÀ×ÅÍÈÅ W Ñ×ÅÒ×ÈÊÀ ÖÈÊËÀ DO 24 ID. * NFA-> ÍÀÏÅ×ÀÒÀÒÜ ÈÌß ÑËÎÂÀ È ÄÀÒÜ ÏÐÎÁÅË 31 IF HK ->A,2 /ÊÎÌÏÈËßÖÈß/ ÍÀ×ÀËÎ ÂÅÒÂËÅÍÈß IF 47 F-> /ÈÑÏÎËÍÅÍÈÅ/ IMMEDIATE -> ÄÀÒÜ ÏÐÈÇÍÀÊ IMMEDIATE ÏÎÑËÅÄÍÅÉ 31 ÑÎÇÄÀÍÍÎÉ ÑËÎÂÀÐÍÎÉ ÑÒÀÒÜÅ INDEX + N1,N2-> ÐÀÑÏÅ×ÀÒÀÒÜ ÍÀ×ÀËÜÍÓÞ ÑÒÐÎÊÓ ÝÊÐÀÍΠ46 Ñ ÍÎÌÅÐÀÌÈ ÎÒ N1 ÄÎ N2 INTERPRET + -> ÈÍÒÅÐÏÐÅÒÈÐÎÂÀÒÜ ÂÕÎÄÍÎÉ ÏÎÒÎÊ 40 IPUSH M ÏÎÄÏÐÎÃÐÀÌÌÀ - ÏÎÌÅÑÒÈÒÜ ÍÀ ÑÒÅÊ ÓÊÀÇÀÒÅËÜ 4 ÈÍÒÅÐÏÐÅÒÀÖÈÈ È ÎÁÎÉÒÈ ÑËÅÄÓÞÙÓÞ ÑÒÐÎÊÓ J K ->W ÒÅÊÓÙÅÅ ÇÍÀ×ÅÍÈÅ W Ñ×ÅÒ×ÈÊÀ ÂÒÎÐÎÃÎ 24 ÎÁÚÅÌËÞÙÅÃÎ ÖÈÊËÀ DO KEY ->C ÂÂÅÑÒÈ ËÈÒÅÐÓ Ñ ÒÅÐÌÈÍÀËÀ 6 L>NAME * LFA->NFA ÏÅÐÅÉÒÈ ÎÒ ÏÎËß ÑÂßÇÈ Ê ÏÎËÞ ÈÌÅÍÈ 30 LATEST * ->NFA ÄÀÒÜ NFA ÏÎÑËÅÄÍÅÉ ÑÎÇÄÀÍÍÎÉ ÑÒÀÒÜÈ 31 LEAVE K -> ÇÀÊÎÍ×ÈÒÜ ÈÑÏÎËÍÅÍÈÅ ÖÈÊËÀ DO 24 LENGMASK M ÏÎËÍÎÅ ÑËÎÂÎ - ÌÀÑÊÀ ÄËß ÓÄÀËÅÍÈß 2 ÁÈÒÀ IMMEDIATE ÈÇ ÁÀÉÒÀ ÄËÈÍÛ LENG1MSK M ÏÎËÍÎÅ ÑËÎÂÎ - ÌÀÑÊÀ ÄËß ÓÄÀËÅÍÈß 2 ÁÈÒΠIMMEDIATE È SMUDGE ÈÇ ÁÀÉÒÀ ÄËÈÍÛ LENG2MSK M ÏÎËÍÎÅ ÑËÎÂÎ - ÌÀÑÊÀ ÄËß ÂÛÑÅ×ÅÍÈß 2 ×ÈÑÒÎÉ ÄËÈÍÛ ÈÇ ÁÀÉÒÀ ÄËÈÍÛ Ñ ÏÐÈÇÍÀÊÀÌÈ LHRW12 M ÏÎÄÏÐÎÃÐÀÌÌÀ ÇÀÃÐÓÇÊÈ ÄÂÓÕ ÂÅÐÕÍÈÕ ÇÍÀ×ÅÍÈÉ 4 ÍÀ ÑÒÅÊÅ Â ÐÅÃÈÑÒÐÛ RW2 (ÂÅÐÕÍÅÅ) È RW1 LIMIT * ->A ÊÎÍÑÒÀÍÒÀ - ÀÄÐÅÑ ÊÎÍÖÀ ÁÓÔÅÐÍÎÃÎ ÏÓËÀ 2 LIMIT# M ÇÍÀ×ÅÍÈÅ ÊÎÍÑÒÀÍÒÛ LIMIT 2 LINK> * LFA->CFA ÏÅÐÅÉÒÈ ÎÒ ÏÎËß ÑÂßÇÈ Ê ÏÎËÞ ÊÎÄÀ 30 LIST + N-> ÐÀÑÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ ÝÊÐÀÍ N 46 LIT *K ->W ÏÎÌÅÑÒÈÒÜ ÍÀ ÑÒÅÊ ÑËÅÄÓÞÙÈÉ ÊÎÄ 23 LIT" *K ->T ÄÀÒÜ ÀÄÐÅÑ ÑÊÎÌÏÈËÈÐÎÂÀÍÍÎÉ ÑÒÐÎÊÈ È 28 ÏÐÎÄÎËÆÈÒÜ ÈÍÒÅÐÏÐÅÒÀÖÈÞ, ÎÁÎÉÄß ÅÅ LITERAL H W-> /ÊÎÌÏÈËßÖÈß/ ÑÊÎÌÏÈËÈÐÎÂÀÒÜ W ÊÀÊ 23 ->W /ÈÑÏÎËÍÅÍÈÅ/ ËÈÒÅÐÀË LOAD +N-> ÈÍÒÅÐÏÐÅÒÈÐÎÂÀÒÜ ÝÊÐÀÍ Ñ ÍÎÌÅÐÎÌ +N 41 LOOP HK A1,A2,3-> /ÊÎÌÏÈËßÖÈß/ ÊÎÍÅÖ ÖÈÊËÀ"DO LOOP" 47 -> /ÈÑÏÎËÍÅÍÈÅ/ LRW1 M ÏÎÄÏÐÎÃÐÀÌÌÀ ÇÀÃÐÓÇÊÈ ÄÂÎÉÍÎÃÎ ÇÍÀ×ÅÍÈß ÍÀ 4 ÂÅÐØÈÍÅ ÑÒÅÊÀ  ÐÅÃÈÑÒÐ RW1 LRW12 M ÏÎÄÏÐÎÃÐÀÌÌÀ ÇÀÃÐÓÇÊÈ ÄÂÓÕ ÂÅÐÕÍÈÕ ÄÂÎÉÍÛÕ 4 ÇÍÀ×ÅÍÈÉ ÍÀ ÑÒÅÊÅ Â ÐÅÃÈÑÒÐÛ RW2 (ÂÅÐÕÍÅÅ) È RW1 M* * N1,N2->D ÏÐÎÈÇÂÅÄÅÍÈÅ ÄÂÎÉÍÎÉ ÄËÈÍÛ N1 È N2 18 M/ * D,N1->N2,N3 ÎÑÒÀÒÎÊ N2 È ×ÀÑÒÍÎÅ N3 ÎÒ 18 ÄÅËÅÍÈß ÄÂÎÉÍÎÃÎ D ÍÀ ÎÄÈÍÀÐÍÎÅ N1 M/MOD * UD1,U2->U3,UD4 ÎÑÒÀÒÎÊ U3 È ÄÂÎÉÍÎÅ 16 ×ÀÑÒÍÎÅ UD4 ÎÒ ÄÅËÅÍÈß UD1 ÍÀ U2 MAX N1,N2->N3 ÁÎËÜØÅÅ ÈÇ ×ÈÑÅË N1 È N2 22 MIN N1,N2->N3 ÌÅÍÜØÅÅ ÈÇ ×ÈÑÅË N1 È N2 22 MOD N1,N2->N3 ÎÑÒÀÒÎÊ ÎÒ ÄÅËÅÍÈß N1 ÍÀ N2 18 MSG * ->A ÊÎÍÑÒÀÍÒÀ - ÀÄÐÅÑ ÍÀ×ÀËÀ ÁÓÔÅÐÀ MSG 2 MSG# M ÇÍÀ×ÅÍÈÅ ÊÎÍÑÒÀÍÒÛ MSG 2 N>LINK * NFA->LFA ÏÅÐÅÉÒÈ ÎÒ ÏÎËß ÈÌÅÍÈ Ê ÏÎËÞ ÑÂßÇÈ 30 NAME> * NFA->CFA ÏÅÐÅÉÒÈ ÎÒ ÏÎËß ÈÌÅÍÈ Ê ÏÎËÞ ÊÎÄÀ 30 NEGATE W1->W2 ÐÅÇÓËÜÒÀÒ ÂÛ×ÈÒÀÍÈß W1 ÈÇ ÍÓËß 17 NEXT M ÂÕÎÄ Â ÀÄÐÅÑÍÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ 1 NEXT1 M ÏÐÎÄÎËÆÅÍÈÅ ÀÄÐÅÑÍÎÉ ÈÍÒÅÐÏÐÅÒÀÖÈÈ ÎÒ 1 ÔÎÐÒ-ÀÄÐÅÑÀ  ÐÅÃÈÑÒÐÅ 14 NOT W1->W2 ÏÎÐÀÇÐßÄÍÎÅ ÈÍÂÅÐÒÈÐÎÂÀÍÈÅ 13 NUMBER + T->WD ÏÐÅÎÁÐÀÇÎÂÀÒÜ ÑÒÐÎÊÓ Ò Â ×ÈÑËÎ WD 39 OFFSET +Ï ->A ÏÅÐÅÌÅÍÍÀß - ÄÎÁÀÂÊÀ Ê ÍÎÌÅÐÓ ÁËÎÊÀ 8 OR W1,W2->W3 ÏÎÐÀÇÐßÄÍÎÅ ËÎÃÈ×ÅÑÊÎÅ "ÈËÈ" 13 OVER W1,W2->W1,W2,W1 ÏÐÎÄÓÁËÈÐÎÂÀÒÜ ÂÒÎÐÎÅ ÑÂÅÐÕÓ 9 PAD ->A ÄÀÒÜ ÀÄÐÅÑ ÒÅÊÓÙÅÉ ÂÅÐØÈÍÛ ÁÓÔÅÐÀ PAD 37 PICK WN,...,W0,+N->WN,...,W0,WN ÏÐÎÄÓÁËÈÐÎÂÀÒÜ 12 N-Å ÑÂÅÐÕÓ ÇÍÀ×ÅÍÈÅ POP M ÂÕÎÄ Â ÀÄÐÅÑÍÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ ÑÎ ÑÍßÒÈÅÌ 3 ÂÅÐÕÍÅÃÎ ÇÍÀ×ÅÍÈß Ñ ÂÅÐØÈÍÛ ÑÒÅÊÀ POPPUT1 M ÂÕÎÄ Â ÀÄÐÅÑÍÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ ÑÎ ÑÍßÒÈÅÌ 3 ÂÅÐÕÍÅÃÎ È ÇÀÌÅÍÎÉ ÏÐÅÄÛÄÓÙÅÃÎ ÍÀ ÇÍÀ×ÅÍÈÅ ÈÇ ÐÅÃÈÑÒÐÀ RW1 PREV *C ->A ÏÅÐÅÌÅÍÍÀß - ÒÅÊÓÙÈÉ ÁËÎ×ÍÛÉ ÁÓÔÅÐ 7 PUSHRW1 M ÂÕÎÄ Â ÀÄÐÅÑÍÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ Ñ ÏÎÌÅÙÅÍÈÅÌ 3 ÇÍÀ×ÅÍÈß ÈÇ ÐÅÃÈÑÒÐÀ RW1 ÍÀ ÂÅÐØÈÍÓ ÑÒÅÊÀ PUSH2RW1 M ÂÕÎÄ Â ÀÄÐÅÑÍÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ Ñ ÇÀÌÅÍÎÉ 3 ÂÅÐÕÍÅÃÎ ÍÀ ÄÂÎÉÍÎÅ ÇÍÀ×ÅÍÈÅ ÈÇ ÐÅÃÈÑÒÐÀ RW1 PUTRW1 M ÂÕÎÄ Â ÀÄÐÅÑÍÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ Ñ ÇÀÌÅÍÎÉ 3 ÂÅÐÕÍÅÃÎ ÇÍÀ×ÅÍÈß ÍÀ ÇÍÀ×ÅÍÈÅ ÈÇ RW1 QUERY + -> ÂÂÅÑÒÈ Ñ ÒÅÐÌÈÍÀËÀ ËÈÒÅÐÛ Â ÁÓÔÅÐ TIB; 40 ×ÈÑËÎ ÂÂÅÄÅÍÍÛÕ ËÈÒÅÐ ÇÀÑËÀÒÜ Â #TIB QUIT -> ÑÁÐÎÑÈÒÜ ÑÒÅÊ ÂÎÇÂÐÀÒÎÂ, ÏÅÐÅÉÒÈ Â ÐÅÆÈÌ 28 ÈÑÏÎËÍÅÍÈß È ÏÐÎÄÎËÆÈÒÜ ÈÍÒÅÐÏÐÅÒÀÖÈÞ R. * -> ÐÀÑÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ ÑÒÅÊ ÂÎÇÂÐÀÒΠ42 R> K ->W ÏÅÐÅÍÅÑÒÈ ÇÍÀ×ÅÍÈÅ ÑÎ ÑÒÅÊÀ ÂÎÇÂÐÀÒΠ9 R@ K ->W ÑÊÎÏÈÐÎÂÀÒÜ ÂÅÐØÈÍÓ ÑÒÅÊÀ ÂÎÇÂÐÀÒΠ9 RBLK * A,+N-> ÏÐÎ×ÅÑÒÜ ÝÊÐÀÍ +N ÏÎ ÀÄÐÅÑÓ A 6 RDROP *K -> ÑÍßÒÜ ÇÍÀ×ÅÍÈÅ ÑÎ ÑÒÅÊÀ ÂÎÇÂÐÀÒΠ9 RECURSE +HK -> ÑÊÎÌÏÈËÈÐÎÂÀÒÜ ÎÁÐÀÙÅÍÈÅ Ê ÊÎÌÏÈËÈÐÓÅÌÎÌÓ 31  ÄÀÍÍÛÉ ÌÎÌÅÍÒ ÎÏÐÅÄÅËÅÍÈÞ REMEMBER + -> ÎÏÐÅÄÅËÈÒÜ ÑËÎÂÎ, ÈÑÏÎËÍÅÍÈÅ ÊÎÒÎÐÎÃÎ 45 ÓÍÈ×ÒÎÆÀÅÒ ÂÑÅ ÏÎÑËÅÄÓÞÙÈÅ ÎÏÐÅÄÅËÅÍÈß REPEAT HK A1,1,A2,2-> /ÊÎÌÏÈËßÖÈß/ ÊÎÍÅÖ ÖÈÊËÀ 47 -> /ÈÑÏÎËÍÅÍÈÅ/ BEGIN WHILE REPEAT ROLL WN,WN-1,...,W0,+N->WN-1,...,W0,WN ÖÈÊËÈ×ÅÑÊÈ 12 ÏÅÐÅÑÒÀÂÈÒÜ N ÂÅÐÕÍÈÕ ÇÍÀ×ÅÍÈÉ ROT W1,W2,W3->W2,W3,W1 ÏÅÐÅÑÒÀÂÈÒÜ ÒÐÈ 9 ÂÅÐÕÍÈÕ ÇÍÀ×ÅÍÈß ÏÎ ×ÀÑÎÂÎÉ ÑÒÐÅËÊÅ RP! * A-> ÓÑÒÀÍÎÂÈÒÜ ÓÊÀÇÀÒÅËÜ ÂÅÐØÈÍÛ ÑÒÅÊÀ 20 ÂÎÇÂÐÀÒΠÍÀ À RP@ * ->A ÀÄÐÅÑ ÒÅÊÓÙÅÉ ÂÅÐØÈÍÛ ÑÒÅÊÀ ÂÎÇÂÐÀÒΠ20 R0 *C ->A ÏÅÐÅÌÅÍÍÀß - ÀÄÐÅÑ ÄÍÀ ÑÒÅÊÀ ÂÎÇÂÐÀÒΠ7 S. * -> ÐÀÑÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ ÑÒÅÊ ÄÀÍÍÛÕ 42 S>D * N->D ÐÀÑØÈÐÈÒÜ N ÄÎ ×ÈÑËÀ ÄÂÎÉÍÎÉ ÄËÈÍÛ D 14 SAVE-BUFFERS -> ÇÀÏÈÑÀÒÜ ÍÀ ÄÈÑÊ ÂÑÅ ÈÑÏÐÀÂËÅÍÍÛÅ ÁËÎÊÈ 26 SCR +Ï ->A ÏÅÐÅÌÅÍÍÀß - ÍÎÌÅÐ ÝÊÐÀÍÀ  LIST 8 SIGN N-> ÄÎÁÀÂÈÒÜ Â ÔÎÐÌÀÒÍÓÞ ÑÒÐÎÊÓ ÇÍÀÊ 37 ÌÈÍÓÑ, ÅÑËÈ ×ÈÑËÎ N ÎÒÐÈÖÀÒÅËÜÍÎ SMUDGE * -> ÓÑÒÀÍÎÂÈÒÜ Â ÅÄÈÍÈÖÓ ÔËÀà SMUDGE 31  ÏÎÑËÅÄÍÅÉ ÑÎÇÄÀÍÍÎÉ ÑÒÀÒÜÅ SNAPSTK * A1,A2,A3-> ÐÀÑÏÅ×ÀÒÊÀ ÑÒÅÊÀ ÎÒ À1 ÄÎ À2 42 Ñ ÒÅÊÑÒÎÌ À3; ÂÎÇÂÐÀÒ "×ÅÐÅÇ ÎÄÈÍ" SP! * A-> ÓÑÒÀÍÎÂÈÒÜ ÓÊÀÇÀÒÅËÜ ÂÅÐØÈÍÛ ÑÒÅÊÀ ÍÀ À 20 SP@ + ->A ÀÄÐÅÑ ÒÅÊÓÙÅÉ ÂÅÐØÈÍÛ ÑÒÅÊÀ ÄÀÍÍÛÕ 20 SPACE -> ÍÀÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ ÏÐÎÁÅË 23 SPACES +N-> ÍÀÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ +N ÏÐÎÁÅËΠ23 SPAN Ï ->A ÏÅÐÅÌÅÍÍÀß ÄËß ÐÅÇÓËÜÒÀÒÀ EXPECT 8 STATE Ï ->A ÏÅÐÅÌÅÍÍÀß Ñ ÑÎÑÒÎßÍÈÅÌ ÒÅÊÑÒÎÂÎÃÎ 8 ÈÍÒÅÐÏÐÅÒÀÒÎÐÀ: "ÈÑÒÈÍÀ" - ÊÎÌÏÈËßÖÈß SWAP W1,W2->W2,W1 ÎÁÌÅÍßÒÜ ÌÅÑÒÀÌÈ 2 ÂÅÐÕÍÈÕ 9 S0 +Ï ->A ÏÅÐÅÌÅÍÍÀß - ÀÄÐÅÑ ÄÍÀ ÑÒÅÊÀ ÄÀÍÍÛÕ 7 TEMP M ÐÀÁÎ×Àß ÎÁËÀÑÒÜ ÈÇ ÄÂÓÕ ÄÂÎÉÍÛÕ ÑËΠ2 THEN HK A,2-> /ÊÎÌÏÈËßÖÈß/ ÊÎÍÅÖ ÂÅÒÂËÅÍÈß IF 47 -> /ÈÑÏÎËÍÅÍÈÅ/ THRU + +N1,+N2-> ÈÍÒÅÐÏÐÅÒÈÐÎÂÀÒÜ ÝÊÐÀÍÛ Ñ ÍÎÌÅÐÀÌÈ 41 ÎÒ +N1 ÄÎ +N2 ÂÊËÞ×ÈÒÅËÜÍÎ TIB ->A ÀÄÐÅÑ ÂÕÎÄÍÎÃÎ ÒÅÊÑÒÎÂÎÃÎ ÁÓÔÅÐÀ 2 ÄËß ÂÂÎÄÀ Ñ ÒÅÐÌÈÍÀËÀ TIB# M ÔÎÐÒ-ÀÄÐÅÑ ÍÀ×ÀËÀ ÁÓÔÅÐÀ TIB 2 TYPE A,+N-> ÍÀÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ +N ËÈÒÅÐ 6 ÎÒ ÀÄÐÅÑÀ À U.


U-> ÍÀÏÅ×ÀÒÀÒÜ U ÍÀ ÒÅÐÌÈÍÀËÅ ÊÀÊ 38 ×ÈÑËÎ ÁÅÇ ÇÍÀÊÀ U.R + U,+N-> ÍÀÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ ×ÈÑËÎ U 38  ÏÎËÅ ÄËÈÍÛ +N ÑÏÐÀÂÀ U< U1,U2->F F "ÈÑÒÈÍÀ", ÅÑËÈ U1 ÌÅÍÜØÅ U2 16 UM* U1,U2->UD ÏÐÎÈÇÂÅÄÅÍÈÅ UD ×ÈÑÅË U1 È U2 16 UM/MOD UD,U1->U2,U3 ÎÑÒÀÒÎÊ U2 È ×ÀÑÒÍÎÅ U3 ÎÒ 16 ÄÅËÅÍÈß UD ÍÀ U1 UNSMUDGE * -> ÓÑÒÀÍÎÂÈÒÜ Â ÍÓËÜ ÔËÀà SMUDGE 31  ÏÎÑËÅÄÍÅÉ ÑÎÇÄÀÍÍÎÉ ÑÒÀÒÜÅ UNTIL HK A,1-> /ÊÎÌÏÈËßÖÈß/ ÊÎÍÅÖ ÖÈÊËÀ "BEGIN UNTIL" 47 F-> /ÈÑÏÎËÍÅÍÈÅ/ UPDATE -> ÎÒÌÅÒÈÒÜ ÒÅÊÓÙÈÉ ÁËÎÊ ÊÀÊ ÈÇÌÅÍÅÍÍÛÉ 25 USE *C ->A ÏÅÐÅÌÅÍÍÀß - ÑËÅÄÓÞÙÈÉ ÁËÎ×ÍÛÉ ÁÓÔÅÐ 7 VARIABLE -> ÎÏÐÅÄÅËÈÒÜ ÑËÅÄÓÞÙÅÅ ÑËÎÂÎ ÊÀÊ 32 ÏÅÐÅÌÅÍÍÓÞ Ñ ÍÀ×ÀËÜÍÛÌ ÇÍÀ×ÅÍÈÅÌ ÍÓËÜ VOC-LINK *Ï ->A ÏÅÐÅÌÅÍÍÀß - ÀÄÐÅÑ ÏÎËß ÑÂßÇÈ ÏÎÑËÅÄÍÅÃÎ 33 ÑÎÇÄÀÍÍÎÃÎ ÏÎ VOCABULARY ÑÏÈÑÊÀ ÑËΠVOCABULARY -> ÎÏÐÅÄÅËÈÒÜ ÑËÅÄÓÞÙÅÅ ÑËÎÂÎ ÊÀÊ 33 ÑÏÈÑÎÊ ÍÀÄ ÒÅÊÓÙÈÌ ÇÍÀ×ÅÍÈÅÌ CURRENT VOCABULARY# A ÍÀ×ÀËÎ ÈÑÏÎËÍÈÒÅËÜÍÎÉ ×ÀÑÒÈ VOCABULARY 33 VOCS * -> ÐÀÑÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ ÒÅÊÓÙÈÉ 43 ÏÎÐßÄÎÊ ÏÎÈÑÊÀ ÑËΠ ÑËÎÂÀÐÅ WBLK * A,+N-> ÇÀÏÈÑÀÒÜ ÝÊÐÀÍ +N ÈÇ ÀÄÐÅÑÀ À 6 WHILE HK 1->A,2 /ÊÎÌÏÈËßÖÈß/ ÂÅÒÂËÅÍÈÅ WHILE  47 F-> /ÈÑÏÎËÍÅÍÈÅ/ ÖÈÊËÅ "BEGIN WHILE REPEAT" WIDTH * ->N ÊÎÍÑÒÀÍÒÀ - ÌÀÊÑÈÌÀËÜÍÀß ÄËÈÍÀ ÈÌÅÍÈ 7 WORD C->T ÂÂÅÑÒÈ ÑËÎÂÎ ÄÎ ÑÒÎÏ-ËÈÒÅÐÛ Ñ; 27 ÄÀÒÜ ÅÃÎ ÀÄÐÅÑ ÊÀÊ ÑÒÐÎÊÈ ÑÎ Ñ×ÅÒ×ÈÊÎÌ WORDS + -> ÐÀÑÏÅ×ÀÒÀÒÜ ÍÀ ÒÅÐÌÈÍÀËÅ ÈÌÅÍÀ ÑËΠ44 ÈÇ ÑÏÈÑÊÀ CONTEXT XOR W1,W2->W3 ÏÎÐÀÇÐßÄÍÎÅ "ÈÑÊËÞ×ÀÞÙÅÅ ÈËÈ" 13 0 * ->0 ÊÎÍÑÒÀÍÒÀ ÍÓËÜ (ÇÍÀ×ÅÍÈÅ "ËÎÆÜ") 7 0< N->F F "ÈÑÒÈÍÀ", ÅÑËÈ N ÎÒÐÈÖÀÒÅËÜÍÎ 13 0<> * W->F F "ÈÑÒÈÍÀ", ÅÑËÈ W ÍÅ ÍÓËÜ 19 0! * A-> ÇÀÑËÀÒÜ ÍÓËÜ ÏÎ ÀÄÐÅÑÓ À 11 0= W->F F "ÈÑÒÈÍÀ", ÅÑËÈ W ÐÀÂÍÎ ÍÓËÞ 13 1+ W1->W2 ÓÂÅËÈ×ÈÒÜ W1 ÍÀ 1 17 1+! + A-> ÓÂÅËÈ×ÈÒÜ ÍÀ 1 ÇÍÀ×ÅÍÈÅ ÏÎ ÀÄÐÅÑÓ À 17 1- W1->W2 ÓÌÅÍÜØÈÒÜ W1 ÍÀ 1 17 2+ W1->W2 ÓÂÅËÈ×ÈÒÜ W1 ÍÀ 2 17 2! WD,A-> ÇÀÑËÀÒÜ ÄÂÎÉÍÎÅ WD ÏÎ ÀÄÐÅÑÓ A 20 2* + W1->W2 ÀÐÈÔÌÅÒÈ×ÅÑÊÈÉ ÑÄÂÈà ÂËÅÂÎ ÍÀ 1 20 2- W1->W2 ÓÌÅÍÜØÈÒÜ W1 ÍÀ 2 17 2/ W1->W2 ÀÐÈÔÌÅÒÈ×ÅÑÊÈÉ ÑÄÂÈà ÂÏÐÀÂÎ ÍÀ 1 20 2@ A->WD ÄÀÒÜ ÄÂÎÉÍÎÅ ÇÍÀ×ÅÍÈÅ ÏÎ ÀÄÐÅÑÓ À 20 2CONSTANT WD-> ÎÏÐÅÄÅËÈÒÜ ÑËÅÄÓÞÙÅÅ ÑËÎÂÎ ÊÀÊ 32 ÊÎÍÑÒÀÍÒÓ ÑÎ ÇÍÀ×ÅÍÈÅÌ WD 2DROP WD-> ÑÍßÒÜ ÂÅÐÕÍÅÅ ÄÂÎÉÍÎÅ ÇÍÀ×ÅÍÈÅ 12 2DUP WD->WD,WD ÏÐÎÄÓÁËÈÐÎÂÀÒÜ ÄÂÎÉÍÎÅ ÇÍÀ×ÅÍÈÅ 12 2LIT *K ->WD ÏÎÌÅÑÒÈÒÜ ÍÀ ÑÒÅÊ ÑËÅÄÓÞÙÈÅ 2 ÊÎÄÀ 23 2LITERAL *H WD-> /ÊÎÌÏÈËßÖÈß/ ÑÊÎÌÏÈËÈÐÎÂÀÒÜ WD ÊÀÊ 23 ->WD /ÈÑÏÎËÍÅÍÈÅ/ ËÈÒÅÐÀË 2OVER WD1,WD2->WD1,WD2,WD1 ÏÐÎÄÓÁËÈÐÎÂÀÒÜ ÂÒÎÐÎÅ 12 ÄÂÎÉÍÎÅ ÑÂÅÐÕÓ 2POP M ÂÕÎÄ Â ÀÄÐÅÑÍÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ ÑÎ ÑÍßÒÈÅÌ 3 ÄÂÎÉÍÎÃÎ ÇÍÀ×ÅÍÈß Ñ ÂÅÐØÈÍÛ ÑÒÅÊÀ 2POPPUT1 M ÂÕÎÄ Â ÀÄÐÅÑÍÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ ÑÎ ÑÍßÒÈÅÌ 3 ÄÂÎÉÍÎÃÎ ÂÅÐÕÍÅÃÎ ÇÍÀ×ÅÍÈß ÑÎ ÑÒÅÊÀ È ÇÀÌÅÍÎÉ ÏÐÅÄÛÄÓÙÅÃÎ ÄÂÎÉÍÎÃÎ ÍÀ 4-ÁÀÉÒÍÎÅ ÇÍÀ×ÅÍÈÅ ÈÇ ÐÅÃÈÑÒÐÀ RW1 2PUSHRW1 M ÂÕÎÄ Â ÀÄÐÅÑÍÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ Ñ ÏÎÌÅÙÅÍÈÅÌ 3 ÄÂÎÉÍÎÃÎ ÇÍÀ×ÅÍÈß ÈÇ RW1 ÍÀ ÂÅÐØÈÍÓ ÑÒÅÊÀ 2PUTRW1 M ÂÕÎÄ Â ÀÄÐÅÑÍÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ Ñ ÇÀÌÅÍÎÉ 3 ÄÂÎÉÍÎÃÎ ÂÅÐÕÍÅÃÎ ÇÍÀ×ÅÍÈß ÍÀ 4-ÁÀÉÒÍÎÅ ÇÍÀ×ÅÍÈÅ ÈÇ ÐÅÃÈÑÒÐÀ RW1 2ROT WD1,WD2,WD3->WD2,WD3,WD1 ÏÅÐÅÑÒÀÂÈÒÜ ÒÐÈ 12 ÂÅÐÕÍÈÕ ÄÂÎÉÍÛÕ ÏÎ ×ÀÑÎÂÎÉ ÑÒÐÅËÊÅ 2SWAP WD1,WD2->WD2,WD1 ÎÁÌÅÍßÒÜ ÌÅÑÒÀÌÈ ÄÂÀ 12 ÂÅÐÕÍÈÕ ÄÂÎÉÍÛÕ ÇÍÀ×ÅÍÈß 2VARIABLE -> ÎÏÐÅÄÅËÈÒÜ ÑËÅÄÓÞÙÅÅ ÑËÎÂÎ ÊÀÊ ÏÅÐÅÌÅÍÍÓÞ 32 ÄÂÎÉÍÎÉ ÄËÈÍÛ Ñ ÍÀ×ÀËÜÍÛÌ ÇÍÀ×ÅÍÈÅÌ ÍÓËÜ ÔÎÐÒ-ÑÈÑÒÅÌÀ * -> ÒÅÊÑÒÎÂÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ ÔÎÐÒ-ÑÈÑÒÅÌÛ 40



Ýêðàí íîìåð 1

( 09.09.86 ÍÀ×ÀËÎ ÌÎÄÅËÈ ÔÎÐÒ-ÑÈÑÒÅÌÛ ) DECIMAL ( ÊÎÍÑÒÀÍÒÛ ÏÅÐÈÎÄÀ ÊÎÌÏÈËßÖÈÈ ) 128 CONSTANT &IFLAG ( ÏÐÈÇÍÀÊ "IMMEDIATE") 32 CONSTANT &SFLAG ( ÏÐÈÇÍÀÊ "SMUDGE") 31 CONSTANT &LENG ( ÌÀÑÊÀ ÄËß ÂÛÑÅ×ÅÍÈß ÄËÈÍÛ) &SFLAG 256 * 64 + CONSTANT &DWORD ( ÔÈÊÒÈÂÍÎÅ ÈÌß ) ( ÍÀ×ÀËÜÍÎÅ ßÄÐÎ Ñ ÀÄÐÅÑÀÖÈÅÉ ÎÒ ÐÅÃÈÑÒÐÀ RFORTH) START-CODE *, RFORTH USING, ( ÀÄÐÅÑÍÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ) M: NEXT 14 0 (, RI RFORTH LH, RI RTWO AR, M: NEXT1 14 RMASK NR, 15 0 (, 14 RFORTH LH, 15 RMASK NR, 15 RFORTH AR, 14 RTWO AR, 15 BR,

Ýêðàí íîìåð 2

( 09.09.86 ÑÈÑÒÅÌÍÛÅ ÏÅÐÅÌÅÍÍÛÅ È ÊÎÍÑÒÀÍÒÛ ) CONST MSG M: MSG# 0 H, ( ÀÄÐÅÑ ÍÀ×ÀËÀ ÁÓÔÅÐÀ MSG) CONST FIRST M: FIRST# 0 H, ( ÀÄÐÅÑ ÍÀ×ÀËÀ ÏÓËÀ) CONST LIMIT M: LIMIT# 0 H, ( ÀÄÐÅÑ ÊÎÍÖÀ ÏÓËÀ) CONST TIB M: TIB# 0 H, ( ÀÄÐÅÑ ÍÀ×ÀËÀ ÁÓÔÅÐÀ TIB) 4 ALIGN M: LENGMASK 255 &IFLAG - S>D F, ( ÁÀÉÒ ÄËÈÍÛ ÁÅÇ IMMEDIATE) M: LENG1MSK 255 &IFLAG - &SFLAG - S>D F, ( ÁÅÇ IMMD È SMDG) M: LENG2MSK &LENG S>D F, ( ÁÀÉÒ ÄËÈÍÛ Ñ ×ÈÑÒÎÉ ÄËÈÍÎÉ) 8 ALIGN M: TEMP 16 ALLOT ( ÐÀÁÎ×Àß ÎÁËÀÑÒÜ)

Ýêðàí íîìåð 3

( 09.09.86 ÄÎÏÎËÍÈÒÅËÜÍÛÅ ÂÕÎÄÛ Â ÀÄÐÅÑÍÛÉ ÈÍÒÅÐÏÐÅÒÀÒÎÐ) M: DOES# RI RPUSH, RI 4 (, 15 LA, RI RFORTH SR, A: CREATE# RW1 14 LR, ( ÏÎÌÅÑÒÈÒÜ PFA ÑÒÀÒÜÈ) M: PUSHRW1 RSTACK RTWO SR, ( ÏÎÌÅÑÒÈÒÜ ÇÍÀ×ÅÍÈÅ ÈÇ RW1) M: PUTRW1 RW1 PUT, RNEXT BR, ( ÇÀÌÅÍÈÒÜ ÂÅÐÕÍÅÅ) M: 2POP RSTACK RTWO AR, ( ÑÍßÒÜ ÄÂÀ ÂÅÐÕÍÈÕ) M: POP RSTACK RTWO AR, RNEXT BR, ( ÑÍßÒÜ ÂÅÐÕÍÅÅ) M: POPPUT1 RSTACK RTWO AR, ( ÑÍßÒÜ ÂÅÐÕÍÅÅ È ÇÀÌÅÍÈÒÜ) RW1 PUT, RNEXT BR, ( ÇÍÀ×ÅÍÈÅÌ ÈÇ RW1) M: 2PUSHRW1 RSTACK RTWO SR, ( ÏÎËÎÆÈÒÜ ÄÂÎÉÍÎÅ ÍÀ ÑÒÅÊ) M: PUSH2RW1 RSTACK RTWO SR, ( ÇÀÌÅÍÈÒÜ ÂÅÐÕÍÅÅ ÍÀ ÄÂÎÉÍÎÅ) M: 2PUTRW1 RW1 TEMP ST, ( ÇÀÌÅÍÈÒÜ ÄÂÎÉÍÎÅ ÂÅÐÕÍÅÅ) FIRST (, 4 ), TEMP MVC, RNEXT BR, M: 2POPPUT1 RSTACK RTWO AR, RSTACK RTWO AR, 2PUTRW1 B,

Ýêðàí íîìåð 4

( 09.09.86 ÂÑÏÎÌÎÃÀÒÅËÜÍÛÅ ÏÎÄÏÐÎÃÐÀÌÌÛ: ÂÎÇÂÐÀÒ Â ÐÅÃ.14) M: LHRW12 RW1 SECOND LH, RW2 PULL, 14 BR, M: LRW1 TEMP (, 4 ), FIRST MVC, RW1 TEMP L, 14 BR, M: LRW12 TEMP (, 8 ), FIRST MVC, RW1 TEMP 4 +(, L, RW2 TEMP L, 14 BR, M: GOTO 14 0 (, 0 14 LH, NEXT1 B, M: IPUSH RI PUSH, RW2 RW2 SR, RW2 0 (, RI RFORTH IC, RI 2 (, RI RW2 LA, 14 BR, CODE EXIT M: EXIT# RI RPOP, RI RMASK NR, RNEXT BR, END-CODE M: ERCOND8 14 GOTO BAL, ] ABORT8 [



Ýêðàí íîìåð 5

( 09.09.86 BRANCH ?BRANCH (LOOP/ (+LOOP/ ) CODE BRANCH M: BRANCH# RI 0 (, RI RFORTH LH, RI RMASK NR, RNEXT BR, CODE ?BRANCH RW1 POP, RW1 RW1 LTR, BRANCH# BZ, RI RTWO AR, RNEXT BR, CODE (LOOP) RW1 1 LA, 1 =F B, CODE (+LOOP) RW1 POP, 1 =H 0 RFIRST LH, 0 RSECOND SH, 0 RMASK NR, 0 RW1 AR, RW1 RFIRST AH, RW1 RFIRST STH, 0 RMASK CLR, BRANCH# BNH, RRET 6 (, 0 RRET LA, RI RTWO AR, RNEXT BR, END-CODE

Ýêðàí íîìåð 6

( 09.09.86 KEY CR EMIT TYPE (EXPECT/ RBLK WBLK ) ( ÑËÅÄÓÞÙÈÅ ÎÏÐÅÄÅËÅÍÈß ÄÀÞÒ ÒÎËÜÊÎ ÈÌÅÍÀ ÏÐÎÖÅÄÓÐ) CODE KEY ( ->C ÂÂÅÑÒÈ ËÈÒÅÐÓ Ñ ÒÅÐÌÈÍÀËÀ) END-CODE CODE CR ( -> ÂÛÂÅÑÒÈ ÏÅÐÅÂÎÄ ÑÒÐÎÊÈ ) END-CODE CODE EMIT ( C-> ÂÛÂÅÑÒÈ ËÈÒÅÐÓ Ñ ÊÎÄÎÌ Ñ ÍÀ ÒÅÐÌÈÍÀË) END-CODE CODE TYPE ( A,N-> ÂÛÂÅÑÒÈ ÍÀ ÒÅÐÌÈÍÀË N ËÈÒÅÐ ÏÎ ÀÄÐÅÑÓ À) END-CODE CODE (EXPECT) ( A,N1->A,N2 ÂÂÅÑÒÈ Ñ ÒÅÐÌÈÍÀËÀ ÍÅ ÁÎËÅÅ N1 ËÈÒÅÐ /ÄÎ ÏÅÐÅÂÎÄÀ ÑÒÐÎÊÈ/  ÁÓÔÅÐ ÏÎ ÀÄÐÅÑÓ À; N2 - ÔÀÊÒÈ×ÅÑÊÎÅ ×ÈÑËÎ ÂÂÅÄÅÍÍÛÕ ËÈÒÅÐ) END-CODE CODE RBLK ( A,N-> ÏÐÎ×ÈÒÀÒÜ ÝÊÐÀÍ N  ÁÓÔÅÐ À) END-CODE CODE WBLK ( A,N-> ÇÀÏÈÑÀÒÜ ÝÊÐÀÍ N ÈÇ ÁÓÔÅÐÀ À) END-CODE

Ýêðàí íîìåð 7

( 09.09.86 ÊÎÍÑÒÀÍÒÛ È ÑÈÑÒÅÌÍÛÅ ÏÅÐÅÌÅÍÍÛÅ ) 64 CONSTANT BL ( ÊÎÄ ÏÐÎÁÅËÀ) 1024 CONSTANT B/BUF ( ÄËÈÍÀ ÁÓÔÅÐÀ ÄËß ÝÊÐÀÍÀ) &LENG CONSTANT WIDTH ( ÌÀÊÑÈÌÀËÜÍÀß ÄËÈÍÀ ÑËÎÂÀ ) 0 CONSTANT 0 ( ×ÈÑËÎ ÍÎËÜ) VARIABLE USE ( ÒÅÊÓÙÈÉ ÁÓÔÅÐ Â ÏÓËÅ) VARIABLE PREV ( ÑËÅÄÓÞÙÈÉ ÁÓÔÅÐ Â ÏÓËÅ) VARIABLE S0 ( ÀÄÐÅÑ ÄÍÀ ÑÒÅÊÀ ÄÀÍÍÛÕ) VARIABLE R0 ( ÀÄÐÅÑ ÄÍÀ ÑÒÅÊÀ ÂÎÇÂÐÀÒÎÂ) VARIABLE FENCE ( ÃÐÀÍÈÖÀ ÇÀÙÈÒÛ ÎÒ "FORGET") VARIABLE CONTEXT ( ÒÅÊÓÙÈÉ ÑÏÈÑÎÊ - ÍÀ×ÀËÎ ÏÎÈÑÊÀ) VARIABLE CURRENT ( ÒÅÊÓÙÈÉ ÑÏÈÑÎÊ - ÊÓÄÀ ÄÎÁÀÂËßÅÌ)

Ýêðàí íîìåð 8

( 09.09.86 ÑÈÑÒÅÌÍÛÅ ÏÅÐÅÌÅÍÍÛÅ - ÎÊÎÍ×ÀÍÈÅ) VARIABLE OFFSET ( ÄÎÁÀÂÊÀ Ê ÍÎÌÅÐÓ ÝÊÐÀÍÀ) VARIABLE BASE ( ÎÑÍÎÂÀÍÈÅ ÑÈÑÒÅÌÛ Ñ×ÈÑËÅÍÈß) VARIABLE STATE ( ÑÎÑÒÎßÍÈÅ ÒÅÊÑÒÎÂÎÃÎ ÈÍÒÅÐÏÐÅÒÀÒÎÐÀ) VARIABLE DPL ( ÏÎÇÈÖÈß ÄÅÑßÒÈ×ÍÎÉ ÒÎ×ÊÈ Â ×ÈÑËÅ) VARIABLE CSP ( ÄËß ÊÎÍÒÐÎËÜÍÎÃÎ ÕÐÀÍÅÍÈß ÓÊÀÇÀÒÅËß) VARIABLE HLD ( ÓÊÀÇÀÒÅËÜ ÂÅÐØÈÍÛ ÁÓÔÅÐÀ "PAD") VARIABLE BLK ( ÍÎÌÅÐ ÂÕÎÄÍÎÃÎ ÝÊÐÀÍÀ ÈËÈ ÍÎËÜ) VARIABLE >IN ( ÏÎÇÈÖÈß Î×ÅÐÅÄÍÎÉ ËÈÒÅÐÛ ÍÀ ÂÕÎÄÅ) VARIABLE SPAN ( ×ÈÑËÎ ËÈÒÅÐ, ÂÂÅÄÅÍÍÛÕ ÏÎ "EXPECT") VARIABLE #TIB ( ×ÈÑËÎ ËÈÒÅÐ, ÂÂÅÄÅÍÍÛÕ Â ÁÓÔÅÐ "TIB") VARIABLE SCR ( ÍÎÌÅÐ ÝÊÐÀÍÀ, ÐÀÑÏÅ×ÀÒÀÍÍÎÃÎ Â "LIST")



Ýêðàí íîìåð 9

( 31.03.86 DUP ?DUP DROP SWAP OVER >R R> R@ RDROP ROT ) CODE DUP ( W->W,W) RW1 PULL, PUSHRW1 B, END-CODE : ?DUP ( W->W,W; 0->0 ) DUP IF DUP THEN ; CODE DROP ( W-> ) RSTACK RTWO AR, RNEXT BR, END-CODE CODE SWAP ( W1,W2->W2,W1) 14 LHRW12 BAL, RW2 SECOND STH, PUTRW1 B, END-CODE CODE OVER ( W1,W2->W1,W2,W1) RW1 SECOND LH, PUSHRW1 B, END-CODE CODE >R ( W-> ) RW1 POP, RW1 RPUSH, RNEXT BR, END-CODE CODE R> ( ->W) RW1 RPOP, PUSHRW1 B, END-CODE CODE R@ ( ->W) RW1 RPULL, PUSHRW1 B, END-CODE CODE RDROP ( -> ) RRET RTWO AR, RNEXT BR, END-CODE : ROT ( N1,N2,N3->N2,N3,N1 ) >R SWAP R> SWAP ;

Ýêðàí íîìåð 10

( 31.03.86 HERE ALLOT ALIGN ALIGNH DP! ) CODE HERE ( ->A ) RW1 RD LR, PUSHRW1 B, END-CODE CODE ALLOT ( N-> ) RD FIRST AH, POP B, END-CODE CODE ALIGN ( N-> ) RW1 0 (, RD RFORTH LA, 0 (, RW1 0 MVI, 1 (, 7 RW1 ), 0 (, RW1 MVC, RW1 PULL, RW2 RW1 LCR, RD RW1 AR, RD 0 BCTR, RD RW2 NR, POP B, END-CODE : ALIGNH ( -> ) 2 ALIGN ; CODE DP! ( A-> ) RD PULL, RD RMASK NR, POP B, END-CODE

Ýêðàí íîìåð 11

( 31.03.86 ! 0! @ C! C@ , C, EXECUTE ) CODE ! ( W,A-> ÇÀÑËÀÒÜ W ÏÎ ÀÄÐÅÑÓ À) 14 LHRW12 BAL, RW2 RMASK NR, RW1 0 (, RW2 RFORTH STH, 2POP B, END-CODE : 0! ( A-> ) 0 SWAP ! ; CODE @ ( A->W ÐÀÇÛÌÅÍÎÂÀÒÜ À) RW2 PULL, RW2 RMASK NR, RW1 0 (, RW2 RFORTH LH, PUTRW1 B, END-CODE CODE C@ ( A->C) RW2 PULL, RW2 RMASK NR, RW1 RW1 SR, RW1 0 (, RW2 RFORTH IC, PUTRW1 B, END-CODE CODE C! ( C,A-> ) 14 LHRW12 BAL, RW2 RMASK NR, RW1 0 (, RW2 RFORTH STC, 2POP B, END-CODE : , ( W-> ) HERE 2 ALLOT ! ; : C, ( C-> ) HERE 1 ALLOT C! ; CODE EXECUTE ( CFA-> ) 14 POP, NEXT1 B, END-CODE

Ýêðàí íîìåð 12

( 31.03.86 ROLL PICK 2DUP 2DROP 2SWAP 2OVER 2ROT ) CODE ROLL ( WN,WN-1,...,W0,+N->WN-1,...,W0,WN) RW2 PULL, RW2 RW2 AR, ERCOND8 BM, RW1 SECOND (, RW2 LH, BEGIN, 0 FIRST (, RW2 LH, 0 SECOND (, RW2 STH, RW2 RTWO SR, ?NP UNTIL, POPPUT1 B, END-CODE CODE PICK ( WN,...,W0,+N->WN,...,W0,WN) RW2 PULL, RW2 RW2 AR, ERCOND8 BM, RW1 2 (, RW2 RSTACK LH, PUTRW1 B, END-CODE : 2DUP ( WD->WD,WD) OVER OVER ; : 2DROP ( WD->) DROP DROP ; : 2SWAP ( WD1,WD2->WD2,WD1) 3 ROLL 3 ROLL ; : 2OVER ( WD1,WD2->WD1,WD2,WD1) 3 PICK 3 PICK ; : 2ROT ( WD1,WD2,WD3->WD2,WD3,WD1) 5 ROLL 5 ROLL ;



Ýêðàí íîìåð 13

( 31.03. 86 AND OR XOR NOT 0= 0< ) CODE AND ( W1,W2->W3) 14 LHRW12 BAL, RW1 RW2 NR, POPPUT1 B, END-CODE CODE OR ( W1,W2->W3) 14 LHRW12 BAL, RW1 RW2 OR, POPPUT1 B, END-CODE CODE XOR ( W1,W2->W3) 14 LHRW12 BAL, RW1 RW2 XR, POPPUT1 B, END-CODE : NOT ( W1->W2 ) -1 XOR ; CODE 0= ( W->F) RW1 RW1 SR, RW2 PULL, RW2 RW2 LTR, PUTRW1 BNZ, RW1 0 BCTR, PUTRW1 B, END-CODE CODE 0< ( N->F) RW1 RW1 SR, RW2 PULL, RW2 RW2 LTR, PUTRW1 BNM, RW1 0 BCTR, PUTRW1 B, END-CODE

Ýêðàí íîìåð 14

( 31.03.86 S>D DABS DNEGATE D+ D- DU< ) CODE S>D ( N->D ) RW1 PULL, PUSH2RW1 B, END-CODE CODE DABS ( D1->D2) 14 LRW1 BAL, RW1 RW1 LPR, 2PUTRW1 B, END-CODE CODE DNEGATE ( WD1->WD2) 14 LRW1 BAL, RW1 RW1 LCR, 2PUTRW1 B, END-CODE CODE D+ ( WD1,WD2->WD3) 14 LRW12 BAL, RW1 RW2 AR, 2POPPUT1 B, END-CODE CODE D- ( WD1,WD2->WD3) 14 LRW12 BAL, RW1 RW2 SR, 2POPPUT1 B, END-CODE CODE DU< ( UD1,UD2->F) 14 LRW12 BAL, 0 0 SR, RW1 RW2 CLR, ?L IF, 0 0 BCTR, THEN, RSTACK 6 (, 0 RSTACK LA, 0 PUT, RNEXT BR, END-CODE

Ýêðàí íîìåð 15

( 31.03.86 D/MOD D/ DMOD D0= D= D0< D< D2/ ) CODE D/MOD ( D1,D2->D3,D4) 14 LRW12 BAL, 1 RW1 LR, 0 RW2 LR, RW1 32 SRDA, RW1 0 DR, 1 0 XR, 1 1 LTR, ?M IF, RW1 0 AR, RW1 0 BCTR, THEN, RW1 TEMP ST, FIRST 4 +(, 4 ), TEMP MVC, RW1 RW2 LR, 2PUTRW1 B, END-CODE : D/ ( D1,D2->D3) D/MOD 2SWAP 2DROP ; : DMOD ( D1,D2->D3) D/MOD 2DROP ; : D0= ( WD->F) OR 0= ; : D= ( WD1,WD2->F) D- D0= ; : D0< ( D->F) SWAP DROP 0< ; : D< ( D1,D2->F) D- D0< ; CODE D2/ ( D1->D2) 14 LRW1 BAL, RW1 1 SRA, PUTRW1 B, END-CODE

Ýêðàí íîìåð 16

( 09.09.86 UM* UM/MOD U< M/MOD DMAX DMIN ) CODE UM* ( U1,U2->UD) 14 LHRW12 BAL, RW1 RMASK NR, RW2 RMASK NR, RW1 RW1 MR, RW1 RW2 LR, 2PUTRW1 B, END-CODE CODE UM/MOD ( UD,U1->U2,U3) 1 POP, 1 RMASK NR, 14 LRW1 BAL, RSTACK RTWO SR, RW2 RW1 LR, RW1 RW1 SR, RW1 1 DR, RW1 FIRST 4 +(, STH, RW1 RW2 LR, POPPUT1 B, END-CODE CODE U< ( U1,U2->F) RW1 RW1 SR, RW2 PULL, RW2 RMASK NR, 0 SECOND LH, 0 RMASK NR, 0 RW2 CR, POPPUT1 BNL, RW1 0 BCTR, ( ÐÅÇÓËÜÒÀÒ "ÈÑÒÈÍÀ") POPPUT1 B, END-CODE : M/MOD ( UD1,U2->U3,UD4) >R 0 R@ UM/MOD R> SWAP >R UM/MOD R> ; : DMAX ( D1,D2->D3) 2OVER 2OVER D< IF 2SWAP THEN 2DROP ; : DMIN ( D1,D2->D3) 2OVER 2OVER D< NOT IF 2SWAP THEN 2DROP ;



Ýêðàí íîìåð 17

( 31.03.86 NEGATE ABS + - 1+ 1- 2+ 2- +! 1+! ) CODE NEGATE ( W1->W2) RW1 PULL, RW1 RW1 LCR, PUTRW1 B, END-CODE : ABS ( N1->+N2) S>D DABS DROP ; CODE + 14 LHRW12 BAL, RW1 RW2 AR, POPPUT1 B, END-CODE : - ( W1,W2->W3) NEGATE + ; : 1+ ( W1->W2) 1 + ; : 1- ( W1->W2) -1 + ; : 2+ ( W1->W2) 2 + ; : 2- ( W1->W2) 2 - ; CODE +! ( W,A->) 14 LHRW12 BAL, RW2 RMASK NR, RW1 0 (, RW2 RFORTH AH, RW1 0 (, RW2 RFORTH STH, 2POP B, END-CODE : 1+! ( A->) 1 SWAP +! ;

Ýêðàí íîìåð 18

( 03.10.86 M* M/ * /MOD / MOD */MOD */ ) CODE M* ( N1,N2->D) RW1 SECOND LH, RW1 FIRST MH, 2PUTRW1 B, END-CODE CODE M/ ( D,N1->N2,N3) 1 POP, 14 LRW1 BAL, RSTACK RTWO SR, RW1 32 SRDA, 0 RW1 LR, RW1 1 DR, 0 1 XR, 0 0 LTR, ?M IF, RW1 1 AR, RW2 0 BCTR, THEN, RW1 FIRST 4 +(, STH, RW1 RW2 LR, ( ×ÀÑÒÍÎÅ) POPPUT1 B, END-CODE : * ( N1,N2->N3) M* DROP ; : /MOD ( N1,N2->N3,N4) >R S>D R> M/ ; : / ( N1,N2->N3) /MOD SWAP DROP ; : MOD ( N1,N2->N3) /MOD DROP ; : */MOD ( N1,N2,N3->N4,N5) >R M* R> M/ ; : */ ( N1,N2,N3->N4) */MOD SWAP DROP ;

Ýêðàí íîìåð 19

( 31.03.86 ÑÐÀÂÍÅÍÈß È ÐÀÇÐÅØÅÍÈß Â ØÈÒÎÌ ÊÎÄÅ ) : 0<> ( N->F) 0= NOT ; : = ( W1,W2->F) - 0= ; : <> ( W1,W2->F) - 0<> ; : < ( N1,N2->F) - 0< ;

: >MARK ( ->A ) HERE 0 , ; : >RESOLVE ( A-> ) HERE SWAP ! ; : <MARK ( ->A ) HERE ; : <RESOLVE ( A-> ) , ;

Ýêðàí íîìåð 20

( 31.03.86 SP@ SP! RP@ RP! 2/ 2* 2@ 2! DEPTH ) CODE SP@ ( ->A) RW1 RSTACK LR, RW1 RFORTH SR, PUSHRW1 B, END-CODE CODE SP! ( A->) RSTACK PULL, RSTACK RMASK NR, RSTACK RFORTH AR, RNEXT BR, END-CODE CODE RP@ ( ->A) RW1 RRET LR, RW1 RFORTH SR, PUSHRW1 B, END-CODE CODE RP! ( A->) RRET POP, RRET RMASK NR, RRET RFORTH AR, RNEXT BR, END-CODE CODE 2/ ( W1->W2 ) RW1 PULL, RW1 1 SRA, PUTRW1 B, END-CODE : 2* ( W1->W2 ) DUP + ; : 2@ ( A->WD) DUP 2+ @ SWAP @ ; : 2! ( WD,A->) DUP >R ! R> 2+ ! ; : DEPTH ( ->+N) SP@ S0 @ SWAP - 2/ ;

Ýêðàí íîìåð 21

( 31.03.86 CMOVE CMOVE> ) CODE CMOVE ( A1,A2,U->) 14 LHRW12 BAL, RW2 RMASK NR, 2 =F BZ, RW1 RMASK NR, RW1 RFORTH AR, 1 FIRST 4 +(, LH, 1 RMASK NR, 1 RFORTH AR, 0 256 LA, 1 =F B, BEGIN, 0 (, 256 RW1 ), 0 (, 1 MVC, RW1 0 AR, 1 0 AR, 1 =H RW2 0 SR, ?M UNTIL, RW2 0 BCTR, RW2 0 AR, ?NM IF, RW2 3 =F EX, THEN, 2 =H RSTACK 6 (, 0 RSTACK LA, RNEXT BR, 3 =H 0 (, 1 RW1 ), 0 (, 1 MVC, END-CODE CODE CMOVE> ( A1,A2,U->) 14 LHRW12 BAL, RW2 RMASK NR, 1 =F BZ, RW1 RMASK NR, RW1 RFORTH AR, RW1 0 BCTR, 1 FIRST 4 +(, LH, 1 RMASK NR, 1 RFORTH AR, 1 0 BCTR, DO, 0 0 (, 1 RW2 IC, 0 0 (, RW1 RW2 STC, RW2 LOOPBCT, 1 =H RSTACK 6 (, 0 RSTACK LA, RNEXT BR, END-CODE



Ýêðàí íîìåð 22

( 31.03. 86 FILL ERASE BLANK COMPILE [ ] MIN MAX HEX DECIMAL) : FILL ( A,U,C->) SWAP ?DUP IF >R OVER C! DUP 1+ R> 1- CMOVE EXIT THEN 2DROP ; : ERASE ( A,U-> ) 0 FILL ; : BLANK ( A,U-> ) BL FILL ; : COMPILE ( -> ) R> DUP 2+ >R @ , ; : [ ( -> ) STATE 0! ; IMMEDIATE : ] ( -> ) -1 STATE ! ; CODE MIN ( N1,N2->N3 ) 14 LHRW12 BAL, RW1 RW2 CR, POP BNH, RW1 RW2 LR, POPPUT1 B, END-CODE CODE MAX ( N1,N2->N3 ) 14 LHRW12 BAL, RW1 RW2 CR, POP BNL, RW1 RW2 LR, POPPUT1 B, END-CODE : HEX ( ->) 16 BASE ! ; : DECIMAL ( ->) 10 BASE ! ;

Ýêðàí íîìåð 23

( 31.03.86 LIT 2LIT LITERAL 2LITERAL SPACE SPACES ) CODE LIT ( ->W ) RW1 0 (, RI RFORTH LH, RI RTWO AR, PUSHRW1 B, END-CODE CODE 2LIT ( ->WD ) RW1 4 LA, RSTACK RW1 SR, RW2 0 (, RI RFORTH LA, FIRST (, 4 ), 0 (, RW2 MVC, RI RW1 AR, RNEXT BR, END-CODE : LITERAL ( W->) STATE @ IF COMPILE LIT , THEN ; IMMEDIATE : 2LITERAL ( WD->) STATE @ IF COMPILE 2LIT , , THEN ; IMMEDIATE : SPACE ( ->) BL EMIT ; : SPACES ( +N->) 0 OVER < IF 0 DO SPACE LOOP EXIT THEN DROP ;

Ýêðàí íîìåð 24

( 09.09.86 ÖÈÊËÛ ÑÎ Ñ×ÅÒ×ÈÊÎÌ: (DO/ I I' J LEAVE ) CODE (DO) ( U1,U2-> ) 14 LHRW12 BAL, 1 =H 1 0 (, RI RFORTH LH, 1 RPUSH, RI RTWO AR, RW1 RPUSH, RW2 RPUSH, 2POP B, END-CODE CODE I ( ->U ÒÅÊÓÙÅÅ ÇÍÀ×ÅÍÈÅ Ñ×ÅÒ×ÈÊÀ ÖÈÊËÀ) RW1 RPULL, PUSHRW1 B, END-CODE CODE I' ( ->U ÂÅÐÕÍßß ÃÐÀÍÈÖÀ ÖÈÊËÀ) RW1 RSECOND LH, PUSHRW1 B, END-CODE CODE J ( ->U ÒÅÊÓÙÅÅ ÇÍÀ×ÅÍÈÅ Ñ×ÅÒ×ÈÊÀ 2-ÃÎ ÖÈÊËÀ) RW1 RFIRST 6 +(, LH, PUSHRW1 B, END-CODE CODE LEAVE ( ->) RI RFIRST 4 +(, LH, RI RMASK NR, RRET 6 (, 0 RRET LA, RNEXT BR, END-CODE

Ýêðàí íîìåð 25

( 31.03.86 +BUF BUFFER BLOCK EMPTY-BUFFERS UPDATE ) : +BUF ( A1->A2,F ÏÅÐÅÉÒÈ Ê ÑËÅÄÓÞÙÅÌÓ ÁÓÔÅÐÓ Â ÏÓËÅ) B/BUF 4 + + DUP LIMIT = IF DROP FIRST THEN DUP PREV @ - ; : BUFFER ( +N->A) OFFSET @ + USE @ DUP >R ( ÈÙÅÌ ÑÂÎÁÎÄÍÛÉ ÁÓÔÅÐ) BEGIN +BUF UNTIL USE ! R@ @ 0< IF ( ÓÑÒÀÍÎÂËÅÍ ÏÐÈÇÍÀÊ "UPDATE") R@ 2+ R@ @ 32767 AND WBLK THEN R@ ! R@ PREV ! R> 2+ ; : BLOCK ( +N->A) OFFSET @ + >R PREV @ DUP @ R@ - DUP + IF BEGIN +BUF 0= IF DROP R@ OFFSET @ - BUFFER DUP R@ RBLK 2- THEN DUP @ R@ - DUP + 0= UNTIL DUP PREV ! THEN RDROP 2+ ; : EMPTY-BUFFERS ( -> ) FIRST LIMIT OVER - ERASE ; : UPDATE ( -> ) PREV @ @ 32768 OR PREV @ ! ;



Ýêðàí íîìåð 26

( 31.03.86 SAVE-BUFFERS FLUSH ) : SAVE-BUFFERS ( -> ) LIMIT FIRST DO I @ 32768 AND IF I @ 32767 AND DUP I ! I 2+ SWAP WBLK THEN B/BUF 4 + +LOOP ; : FLUSH ( -> ) SAVE-BUFFERS EMPTY-BUFFERS ;

Ýêðàí íîìåð 27

( 31.03.86 ENCLOSE WORD ) CODE ENCLOSE ( A,C->A,N1,N2,N3) 14 LHRW12 BAL, RW1 RMASK NR, RW1 RFORTH AR, 14 14 SR, 0 0 SR, BEGIN, 0 0 (, 14 RW1 IC, 0 0 LTR 2 =F BZ, 14 1 (, 0 14 LA, 0 RW2 CR, ?NE UNTIL, 14 0 BCTR, 2 =H 14 PUT, BEGIN, 1 14 LR, 0 0 (, 1 RW1 IC, 0 0 LTR, 2 =F BZ, 14 1 (, 0 14 LA, 0 RW2 CR, ?E UNTIL, 2 =H 1 PUSH, RW1 14 LR, PUSHRW1 B, END-CODE : WORD ( C->T ) BLK @ IF BLK @ BLOCK ELSE TIB THEN >IN @ + SWAP ENCLOSE >IN +! HERE >R OVER - >R + ALIGNH HERE 1+ R@ CMOVE HERE R> 1+ ALLOT ALIGNH HERE OVER - 2- OVER C! R> DP! ;

Ýêðàí íîìåð 28

( 31.03.86 LIT" COUNT ," " ". (."/ ." C" ( .( QUIT ABORT ) CODE LIT" ( ->T ) 14 IPUSH BAL, RNEXT BR, END-CODE : COUNT ( T->A,N) DUP 1+ SWAP C@ 2DUP + C@ IF 1+ THEN ; : ," ( -> ) C" " WORD C@ 2+ ALLOT ALIGNH ; : " ( ->T) ?COMP COMPILE LIT" ," ; IMMEDIATE : ". ( T-> ) COUNT TYPE ; CODE (.") ( ->) 14 IPUSH BAL, 14 GOTO BAL, ] ". [ : ." ( -> ) ?COMP COMPILE (.") ," ; IMMEDIATE : C" ( ->C) BL WORD 1+ C@ [COMPILE] LITERAL ; IMMEDIATE : ( ( ->) C" ) WORD DROP ; IMMEDIATE : .( ( ->) C" ) WORD COUNT TYPE ; IMMEDIATE : QUIT ( ->) [COMPILE] [ S0 @ SP! R0 @ RP! ÔÎÐÒ-ÑÈÑÒÅÌÀ ;

Ýêðàí íîìåð 29

( 31.03.86 ÏÐÎÂÅÐÊÈ È ÑÈÃÍÀËÈÇÀÖÈÈ ÎÁ ÎØÈÁÊÀÕ ) : ?ABORT ( F,T->) SWAP IF COUNT CR TYPE ABORT THEN DROP ; CODE (A") ( F->) 14 IPUSH BAL, 14 GOTO BAL, ] ?ABORT [ END-CODE : ABORT" ( F->) COMPILE (A") ," ; IMMEDIATE : ABORT8 ( ->) -1 ABORT" ÍÅÏÐÀÂÈËÜÍÎÅ ÇÍÀ×ÅÍÈÅ Â ÑÒÅÊÅ" ; : !CSP ( ->) SP@ CSP 1 ; : ?CSP ( ->) SP@ CSP @ - ABORT" ÑÁÈËÑß ÓÊÀÇÀÒÅËÜ ÑÒÅÊÀ" ; : ?PAIRS ( N1,N2-> ) - ABORT" ÍÅÏÀÐÍÛÅ ÑÊÎÁÊÈ" ; CODE ?+ ( N->N ) FIRST 128 TM, RNEXT BZR, ERCOND8 B, END-CODE : ?COMP ( ->) STATE @ NOT ABORT" ÒÐÅÁÓÅÒÑß ÐÅÆÈÌ ÊÎÌÏÈËßÖÈÈ" ; : BADWORD ( T->) CR ". ." ?" ABORT ;



Ýêðàí íîìåð 30

( 31.03.86 >BODY BODY> >LINK LINK> L>NAME N>LINK >NAME NAME> ) : >BODY ( CFA->PFA) 2+ ; : BODY> ( PFA->CFA) 2- ; : >LINK ( CFA->LFA) 2- ; : LINK> ( LFA->CFA) 2+ ; CODE L>NAME ( LFA->NFA) RW2 PULL, RW2 RMASK NR, RW1 RW2 LR, 14 &LENG LA, 1 1 SR, DO, RW1 RTWO SR, 1 0 (, RW1 RFORTH IC, 1 LENG1MSK N, 0 2 (, 1 RW1 LA, 0 RW2 CR, PUTRW1 BE, 14 LOOPBCT, PUTRW1 B, END-CODE : N>LINK ( NFA->LFA) DUP C@ 31 AND + 2+ ; : >NAME ( CFA->NFA) >LINK L>NAME ; : NAME> ( NFA->CFA) N>LINK LINK> ;

Ýêðàí íîìåð 31

( 31.03.86 LATEST DEFINITIONS SMUDGE UNSMUDGE IMMEDIATE ID.) : LATEST ( ->NFA) CURRENT @ @ ; ( (;CODE/ RECURSE ) : DEFINITIONS ( ->) CONTEXT @ CURRENT ! ; : SMUDGE ( ->) LATEST C@ [ &SFLAG ] LITERAL OR LATEST C! ; : UNSMUDGE ( ->) LATEST C@ [ 255 &SFLAG - ] LITERAL AND LATEST C! ; : IMMEDIATE ( ->) LATEST C@ [ &IFLAG ] LITERAL OR LATEST C! ; : ID. ( NFA-> ) DUP 1+ SWAP C@ [ &LENG ] LITERAL AND 2DUP + C@ IF 1+ THEN TYPE SPACE ; : (;CODE) ( -> ) R> LATEST NAME> ! ; : RECURSE ( -> ) LATEST NAME> , ; IMMEDIATE

Ýêðàí íîìåð 32

( 31.03.86 CONSTANT VARIABLE 2CONSTANT 2VARIABLE : ; ) : ?LOADING ( ->) BLK @ 0= ABORT" ÍÅÒ ÎÁÐÀÁÎÒÊÈ ÝÊÐÀÍÀ" ; : ?GAP ( N->) HERE + SP@ SWAP U< ABORT" ÈÑ×ÅÐÏÀÍÈÅ ÏÀÌßÒÈ" ; : ?STACK ( ->) S0 @ SP@ U< ABORT" ÈÑ×ÅÐÏÀÍÈÅ ÑÒÅÊÀ" 10 ?GAP ; : CONSTANT ( W-> ) CREATE , ;CODE RW1 0 (, 14 RFORTH LH, PUSHRW1 B, END-CODE : VARIABLE ( -> ) CREATE 0 , ; : 2VARIABLE ( -> ) CREATE 0 , 0 , ; : 2CONSTANT ( WD-> ) CREATE , , DOES> 2@ ; : : ( -> ) !CSP CREATE ] SMUDGE ;CODE RI RPUSH, RI 14 LR, RNEXT BR, END-CODE : ; ( -> ) ?CSP COMPILE EXIT UNSMUDGE [COMPILE] [ ; IMMEDIATE

Ýêðàí íîìåð 33

( 09.09.86 FORTH FORTH# FL# VOC-LINK VOCABULARY VOCABULARY# ) VOC FORTH &DWORD H, ( FORTH-83 ) A: FORTH# LASTWORD ( ÂÕÎÄ Â ÑÏÈÑÎÊ ÑËÎÂÀÐÍÛÕ ÑÒÀÒÅÉ) A: FL# 0 H, ( ÏÎËÅ ÑÂßÇÈ ÄËß ÑÏÈÑÊΠÑÒÀÒÅÉ) CREATE VOC-LINK FL# ( ÂÕÎÄ Â ÑÏÈÑÎÊ ÑÏÈÑÊΠÑÒÀÒÅÉ) : VOCABULARY ( -> ) CREATE [ &DWORD ] LITERAL , LIT [ FORTH# ] CONTEXT @ - IF CONTEXT @ 2- ELSE 0 THEN , HERE VOC-LINK @ , VOC-LINK ! DOES> [ THERE 4 - :A: VOCABULARY# ] 2+ CONTEXT ! ; : FORTH-83 ( ->) FORTH DEFINITIONS DECIMAL ;



Ýêðàí íîìåð 34

( 31.03.86 (FIND/ ) CODE (FIND) ( -1,AN,...,A1,T->CFA,C,TF/FF ) RW2 POP, RW2 RMASK NR, RW2 RFORTH AR, ( ÎÁÐÀÇÅÖ) 0 0 SR, 0 0 (, 0 RW2 IC, 0 LENG1MSK N, ( ÄËÈÍÀ) 1 1 SR, 1 0 BCTR, BEGIN, RW1 PULL, ( ÂÕÎÄ Â Î×ÅÐÅÄÍÎÉ ÑÏÈÑÎÊ ÑËÎÂ) 2 =F B, BEGIN, RW1 RFORTH AR, 14 0 (, 0 RW1 IC, 14 LENGMASK N, 14 0 CR, ?E IF, 14 4 =F EX, 3 =F BE, THEN, 14 LENG1MSK N, RW1 2 (, 14 RW1 LH, 2 =H RW1 RMASK NR, ?Z UNTIL, RSTACK RTWO AR, 1 FIRST CH, ?E UNTIL, PUTRW1 B, BEGIN, RSTACK RTWO AR, 3 =H 1 FIRST CH, ?E UNTIL, 0 0 (, 0 RW1 IC, RW1 RFORTH SR, RW1 4 (, 14 RW1 LA, RW1 PUT, 0 PUSH, RW1 1 LR, PUSHRW1 B, 4 =H 1 (, 1 RW1 ), 1 (, RW2 CLC, END-CODE

Ýêðàí íîìåð 35

( 31.03.86 FIND -FIND ) : FIND ( T->A,N) DUP >R -1 LIT [ FORTH# ] @ CURRENT @ @ 2DUP = IF DROP THEN CONTEXT @ @ 2DUP = IF DROP THEN R> (FIND) DUP IF DROP ROT DROP [ &IFLAG ] LITERAL AND IF 1 ELSE -1 THEN THEN ; : -FIND ( ->A,N) BL WORD FIND ;

Ýêðàí íîìåð 36

( 09.09.86 CREATE DOES> ) : CREATE ( -> ) 100 ?GAP ALIGNH -FIND SWAP DROP IF HERE ID. ." ÓÆÅ ÅÑÒÜ " ABORT THEN HERE DUP C@ WIDTH AND 2+ ALLOT ALIGNH HERE OVER - 2- OVER C! LATEST , CURRENT @ ! LIT [ CREATE# ] , ;

: DOES> ( -> ) COMPILE (;CODE) 2LIT [ DOES# B, ] , , ; IMMEDIATE

Ýêðàí íîìåð 37

( 31.03.86 PAD HOLD ALPHA <# #> # #S SIGN ) : PAD ( ->A) HERE 100 + ; : HOLD ( C-> ) -1 HLD +! HLD @ C! ; CODE ALPHA ( N->C) RW2 FIRST LH, RW1 RW1 SR, RW1 1 =F (, RW2 IC, PUTRW1 B, 1 =H C,' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' END-CODE : <# ( -> ) PAD HLD ! ; : #> ( D->A,+N) 2DROP HLD @ PAD OVER - ; : # ( D1->D2) BASE @ M/MOD ROT ALPHA HOLD ; : #S ( D->0,0) BEGIN # 2DUP OR 0= UNTIL ; : SIGN ( N->) 0< IF C" - HOLD THEN ;

Ýêðàí íîìåð 38

( 31.03.86 D.R D. .R . H. U. U.R ? ) : D.R ( D,+N-> ) ?+ >R DUP >R DABS <# #S R> SIGN #> R> OVER - SPACES TYPE ; : D. ( D-> ) 0 D.R SPACE ; : .R ( N1,+N2->) >R S>D R> D.R ; : . ( N-> ) S>D D. ; : H. ( N->) BASE @ SWAP 0 HEX <# # # # # #> TYPE SPACE BASE ! ; : U. ( U->) 0 D. ; : U.R ( U,+N->) >R 0 >R D.R ; : ? ( A-> ) @ . ;



Ýêðàí íîìåð 39

( 31.03.86 DIGIT CONVERT NUMBER ) : DIGIT ( C,N1->N2,TF/FF) 0 ROT ROT 0 DO I ALPHA OVER = IF 2DROP I -1 0 LEAVE THEN LOOP DROP ; : CONVERT ( WD1,A1->WD2,A2) BEGIN 1+ DUP >R C@ BASE @ DIGIT WHILE SWAP BASE @ UM* DROP ROT BASE @ UM* D+ DPL @ 1+ IF DPL 1+! THEN R> REPEAT R> ; : NUMBER ( T->WD ) 0 0 ROT DUP >R COUNT OVER + OVER C@ C" - = DUP >R SWAP >R IF ELSE 1- THEN -1 BEGIN DPL ! CONVERT DUP R@ < WHILE DUP C@ C" . <> IF RDROP RDROP R> BADWORD THEN 0 REPEAT DROP RDROP R> IF DNEGATE THEN RDROP ;

Ýêðàí íîìåð 40

( 31.03.86 EXPECT QUERY INTERPRET ÔÎÐÒ-ÑÈÑÒÅÌÀ X ) : EXPECT ( A,+N-> ) DUP >R (EXPECT) DUP SPAN ! TYPE R> SPAN @ - IF SPACE THEN ; : QUERY ( ->) TIB 80 EXPECT >IN 0! BLK 0! SPAN @ #TIB ! ; : INTERPRET ( ->) BEGIN -FIND ?DUP IF 1+ IF EXECUTE ELSE STATE @ IF , ELSE EXECUTE THEN THEN ELSE NUMBER DPL @ 1+ IF [COMPILE] 2LITERAL ELSE DROP [COMPILE] LITERAL THEN THEN ?STACK AGAIN ; : ÔÎÐÒ-ÑÈÑÒÅÌÀ ( ->) BEGIN QUERY INTERPRET AGAIN ; CODE X ( ->) ÇÀÁÈÒÜ-X ( ÍÓËÅÂÎÉ ÊÎÄ ÂÌÅÑÒÎ ÁÓÊÂÛ "X") EXIT# B, END-CODE IMMEDIATE

Ýêðàí íîìåð 41

( 31.03.86 -TRAILING ' ['] [COMPILE] LOAD THRU ;S --> ) CODE -TRAILING ( A,N1->A,N2) 14 LHRW12 BAL, RW1 RMASK NR, RW1 RFORTH AR, 0 RW1 LR, RW1 RW2 AR, BEGIN, RW1 0 CR, 1 =F BNH, RW1 0 BCTR, 0 (, RW1 64 CLI, ?NE UNTIL, 0 0 BCTR, 1 =H RW1 0 SR, PUTRW1 B, END-CODE : ' ( ->CFA) -FIND 0= IF BADWORD THEN ; : ['] ( -> ) ?COMP ' [COMPILE] LITERAL ; IMMEDIATE : [COMPILE] ( ->) -FIND IF , EXIT THEN BADWORD ; IMMEDIATE : LOAD ( N-> ÈÍÒÅÐÏÐÅÒÈÐÎÂÀÒÜ ÂËÎÊ Ñ ÍÎÌÅÐÎÌ N ) >IN @ >R BLK @ >R BLK ! >IN 0! INTERPRET R> BLK ! R> >IN ! ; : THRU ( N1,N2-> ÈÍÒÅÐÏÐÅÒÈÐÎÂÀÒÜ ÁËÎÊÈ ÎÒ N1 ÄÎ N2 ) 1+ SWAP DO I LOAD LOOP ; : ;S ( ->) ?LOADING RDROP ; IMMEDIATE : --> ( ->) ?LOADING >IN 0! BLK 1+! ; IMMEDIATE

Ýêðàí íîìåð 42

( 09.09.86 DUMP SNAPSTK S. R. ) : DUMP ( A,U-> ÐÀÑÏÅ×ÀÒÀÒÜ U ÁÀÉÒΠ) DUP IF BASE @ >R HEX OVER + SWAP DO CR I <# C" * HOLD 0 15 DO DUP I + C@ HOLD -1 +LOOP C" * HOLD 0 15 DO BL HOLD DUP I + C@ 0 # # 2DROP -1 +LOOP BL HOLD BL HOLD 0 # # # # #> TYPE 16 +LOOP R> BASE ! ELSE 2DROP THEN ; : SNAPSTK RDROP CR ". ." , ÂÑÅÃÎ ÇÍÀ×ÅÍÈÉ " 2DUP SWAP - 2/ DUP . 0 SWAP , IF ." (ÂÅÐØÈÍÀ ÑÏÐÀÂÀ)" CR 2- DO I @ . -2 +LOOP ELSE 2DROP THEN ; : S. ( ->) SP@ S0 @ " ÑÒÅÊ ÄÀÍÍÛÕ" SNAPSTK ; : R. ( ->) RP@ 2+ R0 @ " ÑÒÅÊ ÂÎÇÂÐÀÒÎÂ" SNAPSTK ;



Ýêðàí íîìåð 43

( 31.03.86 .VOC (VOC/ VOCS ) : .VOC ( PFA+2-> ) 2- BODY> >NAME ID. ; : (VOC) ( PFA1+2->PFA2,N) @ 0 BEGIN OVER DUP IF @ [ &DWORD ] LITERAL <> THEN WHILE 1+ ( Ñ×ÅÒ×ÈÊ ÑËÎÂ) SWAP N>LINK @ SWAP REPEAT ; : VOCS ( -> ) -1 ['] FORTH >BODY 2+ CURRENT @ ." ÑÏÈÑÎÊ CURRENT: " DUP .VOC OVER @ OVER @ = IF DROP THEN CONTEXT @ ." ÑÏÈÑÎÊ CONTEXT: " DUP .VOC OVER @ OVER @ = IF DROP THEN CR ." ÑÒÀÍÄÀÐÒÍÛÉ ÏÎÐßÄÎÊ ÏÎÈÑÊÀ: " BEGIN 2- BEGIN 2+ DUP .VOC (VOC) DROP DUP 0= UNTIL DROP DUP -1 = UNTIL DROP CR ." ÍÀËÈ×ÍÛÅ ÑÏÈÑÊÈ ÑËÎÂ: " VOC-LINK @ BEGIN DUP 2- .VOC @ DUP 0= UNTIL DROP ;

Ýêðàí íîìåð 44

( 31.03.86 WORDS ) : WORDS ( -> ) ." ÑÏÈÑÎÊ " CONTEXT @ DUP .VOC DUP (VOC) ." ÂÑÅÃÎ ÑËÎÂ - " . ." CËÅÄÓÞÙÈÉ ÑÏÈÑÎÊ - " ?DUP IF 2+ .VOC THEN CR @ BEGIN DUP DUP IF @ [ &DWORD ] LITERAL <> THEN WHILE DUP C@ [ &SFLAG ] LITERAL AND 0= IF DUP ID. SPACE THEN N>LINK @ REPEAT DROP ;

Ýêðàí íîìåð 45

( 31.03.86 (FORGET/ FORGET REMEMBER FORGET0 ) : (FORGET) ( A-> ÈÑÊËÞ×ÈÒÜ ÂÑÅ ÑËÎÂÀ ÂÛØÅ ÀÄÐÅÑÀ À ) DUP FENCE @ U< ABORT" ÇÀÙÈÒÀ ÏÎ FENCE" >R VOC-LINK @ BEGIN R@ OVER U< WHILE FORTH DEFINITIONS @ DUP VOC-LINK ! REPEAT ( ÄÎØËÈ ÄÎ ÑÏÈÑÊÀ, ÃÄÅ ÅÑÒÜ ÝÒÎ ÑËÎÂÎ ) BEGIN DUP 4 - BEGIN N>LINK @ DUP R@ U< UNTIL OVER 2- ! @ ?DUP 0= UNTIL R> DP! ; : FORGET ( ->) ' >NAME (FORGET) ; : REMEMBER ( ->) CREATE DOES> (FORGET) ;

Ýêðàí íîìåð 46

( 31.09.86 (#SCR/ LIST SCR? INDEX ) : (#SCR) ( N->A,T ÏÅÐÅÂÅÑÒÈ ÍÎÌÅÐ N ÝÊÐÀÍÀ  ÒÅÊÑÒÎÂÎÅ ÈÌß ) BASE @ >R DECIMAL 0 <# #S #> R> BASE ! ; : LIST ( N-> ÐÀÑÏÅ×ÀÒÀÒÜ ÝÊÐÀÍ N, ÇÀÏÎÌÍÈÒÜ ÅÃÎ Â "SCR" ) DUP SCR ! CR ." ÝÊÐÀÍ " DUP (#SCR) TYPE BLOCK 16 0 DO DUP I 64 * + CR I 3 .R SPACE 64 TYPE LOOP DROP ;

Ýêðàí íîìåð 47

( 31.03.86 ÑÒÀÍÄÀÐÒÍÛÅ ÑÒÐÓÊÒÓÐÛ ÓÏÐÀÂËÅÍÈß ) : BEGIN ?COMP <MARK 1 ; IMMEDIATE : UNTIL 1 ?PAIRS COMPILE ?BRANCH <RESOLVE ; IMMEDIATE : AGAIN 1 ?PAIRS COMPILE BRANCH <RESOLVE ; IMMEDIATE : IF ?COMP COMPILE ?BRANCH &gtMARK 2 ; IMMEDIATE : THEN 2 ?PAIRS &gtRESOLVE ; IMMEDIATE : ELSE 2 ?PAIRS COMPILE BRANCH &gtMARK SWAP &gtRESOLVE 2 ; IMMEDIATE : WHILE 1 ?PAIRS 1 [COMPILE] IF ; IMMEDIATE : REPEAT &gtR &gtR [COMPILE] AGAIN R&gt R&gt [COMPILE] THEN ; IMMEDIATE : DO ?COMP COMPILE (DO) &gtMARK <MARK 3 ; IMMEDIATE : LOOP 3 ?PAIRS COMPILE (LOOP) <RESOLVE &gtRESOLVE ; IMMEDIATE : +LOOP 3 ?PAIRS COMPILE (+LOOP) <RESOLVE &gtRESOLVE ; IMMEDIATE


Ñîäåðæàíèå ðàçäåëà