       10 // Logical operator test program
       20 //
       30 p("and", t AND t, res_and)
       40 p("or", t OR t, res_or)
       50 p("eor", t EOR t, res_eor)
       60 p("and then", t AND THEN t, res_andthen)
       70 p("or then", t OR THEN t, res_orthen)
       80 //
       90 PROC p(op$, NAME logexp, PROC restore_proc)
      100   restore_proc
      110   FOR i:=1 TO 4 DO SYS assert, logexp=t
      120   SYS assert, t=99
      130 ENDPROC p
      140 //
      150 PRINT "Ok"
      160 //
      170 FUNC t CLOSED
      180   READ k
      190   RETURN k
      200 ENDFUNC t
      210 //
      220 PROC res_and
      230   RESTORE test_and
      240 ENDPROC res_and
      250 //
      260 test_and:
      270 DATA 0, 0, 0
      280 DATA 0, 1, 0
      290 DATA 1, 0, 0
      300 DATA 1, 1, 1
      310 DATA 99
      320 //
      330 PROC res_or
      340   RESTORE test_or
      350 ENDPROC res_or
      360 //
      370 test_or:
      380 DATA 0, 0, 0
      390 DATA 0, 1, 1
      400 DATA 1, 0, 1
      410 DATA 1, 1, 1
      420 DATA 99
      430 //
      440 PROC res_eor
      450   RESTORE test_eor
      460 ENDPROC res_eor
      470 //
      480 test_eor:
      490 DATA 0, 0, 0
      500 DATA 0, 1, 1
      510 DATA 1, 0, 1
      520 DATA 1, 1, 0
      530 DATA 99
      540 //
      550 PROC res_andthen
      560   RESTORE test_andthen
      570 ENDPROC res_andthen
      580 //
      590 test_andthen:
      600 DATA 0, 0
      610 DATA 1, 0, 0
      620 DATA 1, 1, 1
      630 DATA 1, 1, 1  // To make it four test cases
      640 DATA 99
      650 //
      660 PROC res_orthen
      670   RESTORE test_orthen
      680 ENDPROC res_orthen
      690 //
      700 test_orthen:
      710 DATA 0, 0, 0
      720 DATA 1, 1
      730 DATA 0, 1, 1
      740 DATA 0, 1, 1  // To make it four test cases
      750 DATA 99
