UNTIL: различия между версиями

Материал из ПМК вики
Перейти к навигации Перейти к поиску
Нет описания правки
Нет описания правки
Строка 54: Строка 54:
         At compile-time, UNTIL compiles (0BRANCH) and an offset from HERE to
         At compile-time, UNTIL compiles (0BRANCH) and an offset from HERE to
         addr. n is used for error tests.
         addr. n is used for error tests.
== Реализация UNTIL ==
Юрий Семёнов приводит следующее описание слова UNTIL (стр. 65):
  : UNTIL  1 ?PAIR COMPILE ?BRANCH <RESOLVE ; IMMEDIATE





Версия от 08:00, 9 сентября 2015

UNTIL — стандартное слово Каллисто.

Конец цикла "BEGIN UNTIL".


UNTIL в стандарте ANS Forth

6.1.2390   UNTIL                                                           CORE
       Интерпретация: Семантика интерпретации для этого слова не определена.
       Компиляция: ( C: dest -- )
           Добавляет семантику времени-выполнения, данную ниже к текущему 
           определению, разрешая ссылку назад dest.
       Время-выполнения: ( x -- )
           Если все биты x нулевые, продолжает выполнение с адреса ячейки 
           определенного dest.
       См.: 6.1.0760 BEGIN.
A.6.1.2390   UNTIL
Типичное использование:
       : X ... BEGIN ... test UNTIL ... ;


UNTIL в предыдущем стандарте Forth-83 (англ.)

     UNTIL        flag --                       C,I,79
                  sys --   (compiling)
          Used in the form:
                  BEGIN ... flag UNTIL
          Marks the end of a BEGIN-UNTIL loop which will terminate
          based on flag.  If flag is true, the loop is terminated.  If
          flag is false, execution continues to just after the
          corresponding BEGIN .  sys is balanced with its
          corresponding BEGIN .  See:  BEGIN


UNTIL в стандарте Forth-79 (англ.)

UNTIL          flag --                       I,C,,237
    Within a colon-definition, mark the end of a BEGIN-UNTIL loop,
    which will terminate based on flag.  If flag is true, the loop
    is  terminated.   If flag is false,  execution returns to  the
    first word after BEGIN.  BEGIN-UNTIL structures may be nested.


UNTIL в fig-FORTH Release 1 glossary, май 1979 (англ.)

UNTIL          f --- (run-time)       addr n --- (compile) P,C2,L0
       Occurs within a colon-definition in the form:
                       BEGIN ... UNTIL
       At run-time, UNTIL controls the conditional branch back to the
       corresponding BEGIN. If f is false, execution returns to just after.
       BEGIN;
       if true, execution continues ahead.
       At compile-time, UNTIL compiles (0BRANCH) and an offset from HERE to
       addr. n is used for error tests.


Реализация UNTIL

Юрий Семёнов приводит следующее описание слова UNTIL (стр. 65):

 : UNTIL   1 ?PAIR COMPILE ?BRANCH <RESOLVE ; IMMEDIATE


История

Форт-83, Форт-79 и fig-Форт допускали слово END, как синоним UNTIL.


Ссылка


  У этой статьи нет иллюстраций. Вы можете помочь проекту, добавив их.


  Это заготовка статьи. Вы можете помочь проекту, дополнив её.