Ver Fonte

SVI Переделка форматирования

SVI há 3 anos atrás
pai
commit
8cded3d51c
16 ficheiros alterados com 10784 adições e 10822 exclusões
  1. 575 576
      source/MSP430RTL.ob07
  2. 1028 1035
      source/PARS.ob07
  3. 100 107
      source/PATHS.ob07
  4. 415 422
      source/PE32.ob07
  5. 780 787
      source/PROG.ob07
  6. 179 186
      source/REG.ob07
  7. 1162 1169
      source/RVMxI.ob07
  8. 76 76
      source/SCAN.ob07
  9. 2114 2060
      source/STATEMENTS.ob07
  10. 253 260
      source/STRINGS.ob07
  11. 48 55
      source/TARGETS.ob07
  12. 120 127
      source/TEXTDRV.ob07
  13. 1829 1836
      source/THUMB.ob07
  14. 87 94
      source/UTILS.ob07
  15. 55 62
      source/WRITER.ob07
  16. 1963 1970
      source/X86.ob07

+ 575 - 576
source/MSP430RTL.ob07

@@ -1,6 +1,5 @@
 MODULE MSP430RTL;
 
-
 CONST
 
     _mul*      =  0;
@@ -70,595 +69,595 @@ VAR
 PROCEDURE Gen*;
 
 
-    PROCEDURE Word1 (word: INTEGER);
-    BEGIN
-        Word(word)
-    END Word1;
+        PROCEDURE Word1 (word: INTEGER);
+        BEGIN
+            Word(word)
+        END Word1;
 
 
-    PROCEDURE Word2 (word1, word2: INTEGER);
-    BEGIN
-        Word1(word1);
-        Word1(word2)
-    END Word2;
+        PROCEDURE Word2 (word1, word2: INTEGER);
+        BEGIN
+            Word1(word1);
+            Word1(word2)
+        END Word2;
+
+
+        PROCEDURE Word3 (word1, word2, word3: INTEGER);
+        BEGIN
+            Word1(word1);
+            Word1(word2);
+            Word1(word3)
+        END Word3;
 
 
-    PROCEDURE Word3 (word1, word2, word3: INTEGER);
     BEGIN
-        Word1(word1);
-        Word1(word2);
-        Word1(word3)
-    END Word3;
-
-
-BEGIN
-    (* _lsl (n, x: INTEGER): INTEGER *)
-    IF rtl[_lsl].used THEN
-        Label(rtl[_lsl].label);
-        Word2(4115H, 2);              (*  MOV  2(SP), R5; R5 <- n  *)
-        Word2(4114H, 4);              (*  MOV  4(SP), R4; R4 <- x  *)
-        Word2(0F035H, 15);            (*  AND  #15, R5             *)
-        Word1(2400H + 3);             (*  JZ   L1                  *)
-                                      (*  L2:                      *)
-        Word1(5404H);                 (*  ADD  R4, R4              *)
-        Word1(8315H);                 (*  SUB  #1, R5              *)
-        Word1(2000H + 400H - 3);      (*  JNZ  L2                  *)
-                                      (*  L1:                      *)
-        Word1(4130H)                  (*  RET                      *)
-    END;
-
-    (* _asr (n, x: INTEGER): INTEGER *)
-    IF rtl[_asr].used THEN
-        Label(rtl[_asr].label);
-        Word2(4115H, 2);              (*  MOV  2(SP), R5; R5 <- n  *)
-        Word2(4114H, 4);              (*  MOV  4(SP), R4; R4 <- x  *)
-        Word2(0F035H, 15);            (*  AND  #15, R5             *)
-        Word1(2400H + 3);             (*  JZ   L1                  *)
-                                      (*  L2:                      *)
-        Word1(1104H);                 (*  RRA  R4                  *)
-        Word1(8315H);                 (*  SUB  #1, R5              *)
-        Word1(2000H + 400H - 3);      (*  JNZ  L2                  *)
-                                      (*  L1:                      *)
-        Word1(4130H)                  (*  RET                      *)
-    END;
-
-    (* _ror (n, x: INTEGER): INTEGER *)
-    IF rtl[_ror].used THEN
-        Label(rtl[_ror].label);
-        Word2(4115H, 2);              (*  MOV  2(SP), R5; R5 <- n  *)
-        Word2(4114H, 4);              (*  MOV  4(SP), R4; R4 <- x  *)
-        Word2(0F035H, 15);            (*  AND  #15, R5             *)
-        Word1(2400H + 5);             (*  JZ   L1                  *)
-        Word1(4406H);                 (*  MOV  R4, R6              *)
-                                      (*  L2:                      *)
-        Word1(1006H);                 (*  RRC  R6                  *)
-        Word1(1004H);                 (*  RRC  R4                  *)
-        Word1(8315H);                 (*  SUB  #1, R5              *)
-        Word1(2000H + 400H - 4);      (*  JNZ  L2                  *)
-                                      (*  L1:                      *)
-        Word1(4130H)                  (*  RET                      *)
-    END;
-
-    (* _lsr (n, x: INTEGER): INTEGER *)
-    IF rtl[_lsr].used THEN
-        Label(rtl[_lsr].label);
-        Word2(4115H, 2);              (*  MOV  2(SP), R5; R5 <- n  *)
-        Word2(4114H, 4);              (*  MOV  4(SP), R4; R4 <- x  *)
-        Word2(0F035H, 15);            (*  AND  #15, R5             *)
-        Word1(2400H + 4);             (*  JZ   L1                  *)
-                                      (*  L2:                      *)
-        Word1(0C312H);                (*  BIC  #1, SR              *)
-        Word1(1004H);                 (*  RRC  R4                  *)
-        Word1(8315H);                 (*  SUB  #1, R5              *)
-        Word1(2000H + 400H - 4);      (*  JNZ  L2                  *)
-                                      (*  L1:                      *)
-        Word1(4130H)                  (*  RET                      *)
-    END;
-
-    (* _set (b, a: INTEGER): SET *)
-    IF rtl[_set].used THEN
-        Label(rtl[_set].label);
-        Word2(4114H, 2);              (*  MOV  2(SP), R4; R4 <- b  *)
-        Word2(4115H, 4);              (*  MOV  4(SP), R5; R5 <- a  *)
-        Word1(9504H);                 (*  CMP  R5, R4              *)
-        Word1(3800H + 24);            (*  JL   L1                  *)
-        Word2(9035H, 16);             (*  CMP  #16, R5             *)
-        Word1(3400H + 21);            (*  JGE  L1                  *)
-        Word1(9304H);                 (*  CMP  #0, R4              *)
-        Word1(3800H + 19);            (*  JL   L1                  *)
-        Word2(9034H, 16);             (*  CMP  #16, R4             *)
-        Word1(3800H + 2);             (*  JL   L2                  *)
-        Word2(4034H, 15);             (*  MOV  #15, R4             *)
-                                      (*  L2:                      *)
-        Word1(9305H);                 (*  CMP  #0, R5              *)
-        Word1(3400H + 1);             (*  JGE  L3                  *)
-        Word1(4305H);                 (*  MOV  #0, R5              *)
-                                      (*  L3:                      *)
-        Word1(8504H);                 (*  SUB  R5, R4              *)
-        Word1(5404H);                 (*  ADD  R4, R4              *)
-        Word2(5034H, bits_offs);      (*  ADD  bits_offs, R4       *)
-        Word1(4424H);                 (*  MOV  @R4, R4             *)
-        Word1(5505H);                 (*  ADD  R5, R5              *)
-        Word1(5405H);                 (*  ADD  R4, R5              *)
-        Word2(5035H, bits);           (*  ADD  bits, R5            *)
-        Word1(4524H);                 (*  MOV  @R5, R4             *)
-        Word1(4130H);                 (*  RET                      *)
-                                      (*  L1:                      *)
-        Word1(4304H);                 (*  MOV  #0, R4              *)
-        Word1(4130H)                  (*  RET                      *)
-    END;
-
-    (* _set1 (a: INTEGER): SET *)
-    IF rtl[_set1].used THEN
-        Label(rtl[_set1].label);
-        Word2(4114H, 2);              (*  MOV  2(SP), R4; R4 <- a  *)
-        Word2(0B034H, 0FFF0H);        (*  BIT  #0FFF0H, R4         *)
-        Word1(2000H + 5);             (*  JNZ  L1                  *)
-        Word1(5404H);                 (*  ADD  R4, R4              *)
-        Word2(5034H, bits);           (*  ADD  bits, R4            *)
-        Word1(4424H);                 (*  MOV  @R4, R4             *)
-        Word1(4130H);                 (*  RET                      *)
-                                      (*  L1:                      *)
-        Word1(4304H);                 (*  MOV  #0, R4              *)
-        Word1(4130H)                  (*  RET                      *)
-    END;
-
-    (* _in2 (i, s: INTEGER): BOOLEAN *)
-    IF rtl[_in2].used THEN
-        Label(rtl[_in2].label);
-        Word2(4114H, 2);               (*  MOV  2(SP), R4; R4 <- i  *)
-        Word1(5404H);                  (*  ADD  R4, R4              *)
-        Word2(5034H, bits);            (*  ADD  bits, R4            *)
-        Word1(4424H);                  (*  MOV  @R4, R4             *)
-        Word2(0F114H, 4);              (*  AND  4(SP), R4           *)
-        Word1(2400H + 1);              (*  JZ   L1                  *)
-        Word1(4314H);                  (*  MOV  #1, R4              *)
-                                       (*  L1:                      *)
-        Word1(4130H)                   (*  RET                      *)
-    END;
-
-    (* _in (s, i: INTEGER): BOOLEAN *)
-    IF rtl[_in].used THEN
-        Label(rtl[_in].label);
-        Word2(4114H, 4);               (*  MOV  4(SP), R4; R4 <- i  *)
-        Word2(0B034H, 0FFF0H);         (*  BIT  #0FFF0H, R4         *)
-        Word1(2000H + 9);              (*  JNZ  L2                  *)
-        Word1(5404H);                  (*  ADD  R4, R4              *)
-        Word2(5034H, bits);            (*  ADD  bits, R4            *)
-        Word1(4424H);                  (*  MOV  @R4, R4             *)
-        Word2(0F114H, 2);              (*  AND  2(SP), R4           *)
-        Word1(2400H + 3);              (*  JZ   L1                  *)
-        Word1(4314H);                  (*  MOV  #1, R4              *)
-        Word1(4130H);                  (*  RET                      *)
-                                       (*  L2:                      *)
-        Word1(4304H);                  (*  MOV  #0, R4              *)
-                                       (*  L1:                      *)
-        Word1(4130H)                   (*  RET                      *)
-    END;
-
-    (* _incl (VAR s: SET; i: INTEGER) *)
-    IF rtl[_incl].used THEN
-        Label(rtl[_incl].label);
-        Word2(4114H, 4);          (*  MOV  4(SP), R4; R4 <- i  *)
-        Word2(0B034H, 0FFF0H);    (*  BIT  #0FFF0H, R4         *)
-        Word1(2000H + 8);         (*  JNZ  L1                  *)
-        Word1(5404H);             (*  ADD  R4, R4              *)
-        Word2(5034H, bits);       (*  ADD  bits, R4            *)
-        Word1(4424H);             (*  MOV  @R4, R4             *)
-        Word2(4115H, 2);          (*  MOV  2(SP), R5; R5 <- @s *)
-        Word2(0D485H, 0);         (*  BIS  R4, 0(R5)           *)
-                                  (*  L1:                      *)
-        Word1(4130H)              (*  RET                      *)
-    END;
-
-    (* _excl (VAR s: SET; i: INTEGER) *)
-    IF rtl[_excl].used THEN
-        Label(rtl[_excl].label);
-        Word2(4114H, 4);          (*  MOV  4(SP), R4; R4 <- i  *)
-        Word2(0B034H, 0FFF0H);    (*  BIT  #0FFF0H, R4         *)
-        Word1(2000H + 8);         (*  JNZ  L1                  *)
-        Word1(5404H);             (*  ADD  R4, R4              *)
-        Word2(5034H, bits);       (*  ADD  bits, R4            *)
-        Word1(4424H);             (*  MOV  @R4, R4             *)
-        Word2(4115H, 2);          (*  MOV  2(SP), R5; R5 <- @s *)
-        Word2(0C485H, 0);         (*  BIC  R4, 0(R5)           *)
-                                  (*  L1:                      *)
-        Word1(4130H)              (*  RET                      *)
-    END;
-
-    (* _rot (len, adr: INTEGER) *)
-    IF rtl[_rot].used THEN
-        Label(rtl[_rot].label);
-        Word2(4114H, 2);              (*  MOV    2(SP), R4; R4 <- len   *)
-        Word2(4115H, 4);              (*  MOV    4(SP), R5; R5 <- adr   *)
-        Word1(8314H);                 (*  SUB    #1, R4                 *)
-        Word1(5404H);                 (*  ADD    R4, R4                 *)
-        Word1(1225H);                 (*  PUSH   @R5                    *)
-        Word1(4406H);                 (*  MOV    R4, R6                 *)
-                                      (*  L1:                           *)
-        Word3(4595H, 2, 0);           (*  MOV    2(R5), 0(R5)           *)
-        Word1(5325H);                 (*  ADD    #2, R5                 *)
-        Word1(8326H);                 (*  SUB    #2, R6                 *)
-        Word1(2000H + 400H - 6);      (*  JNZ    L1                     *)
-        Word2(41B5H, 0);              (*  MOV    @SP+, 0(R5)            *)
-        Word1(4130H)                  (*  RET                           *)
-    END;
-
-    (* _divmod (b, a: INTEGER): INTEGER (* res -> R4, mod -> R5 *) *)
-    IF rtl[_divmod].used THEN
-        Label(rtl[_divmod].label);
-        Word2(4115H, 4);              (*  MOV  4(SP), R5; R5 <- a  *)
-        Word1(4304H);                 (*  MOV  #0, R4              *)
-                                      (*  L1:                      *)
-        Word2(4116H, 2);              (*  MOV  2(SP), R6; R6 <- b  *)
-        Word1(9605H);                 (*  CMP  R6, R5              *)
-        Word1(3800H + 17);            (*  JL   L3                  *)
-        Word1(4327H);                 (*  MOV  #2, R7              *)
-        Word1(5606H);                 (*  ADD  R6, R6              *)
-                                      (*  L4:                      *)
-        Word1(9306H);                 (*  CMP  #0, R6              *)
-        Word1(2400H + 6);             (*  JZ   L2                  *)
-        Word1(3800H + 5);             (*  JL   L2                  *)
-        Word1(9605H);                 (*  CMP  R6, R5              *)
-        Word1(3800H + 3);             (*  JL   L2                  *)
-        Word1(5606H);                 (*  ADD  R6, R6              *)
-        Word1(5707H);                 (*  ADD  R7, R7              *)
-        Word1(3C00H + 400H - 8);      (*  JMP  L4                  *)
-                                      (*  L2:                      *)
-        Word1(0C312H);                (*  BIC  #1, SR              *)
-        Word1(1006H);                 (*  RRC  R6                  *)
-        Word1(0C312H);                (*  BIC  #1, SR              *)
-        Word1(1007H);                 (*  RRC  R7                  *)
-        Word1(8605H);                 (*  SUB  R6, R5              *)
-        Word1(5704H);                 (*  ADD  R7, R4              *)
-        Word1(3C00H + 400H - 21);     (*  JMP  L1                  *)
-                                      (*  L3:                      *)
-        (*----------- (a < 0) --------------*)
-                                      (*  L1:                      *)
-        Word1(9305H);                 (*  CMP  #0, R5              *)
-        Word1(3400H + 23);            (*  JGE  L3                  *)
-        Word2(4116H, 2);              (*  MOV  2(SP), R6; R6 <- b  *)
-        Word1(4327H);                 (*  MOV  #2, R7              *)
-        Word1(5606H);                 (*  ADD  R6, R6              *)
-        Word1(0E335H);                (*  XOR  #-1, R5             *)
-        Word1(5315H);                 (*  ADD  #1,  R5             *)
-                                      (*  L4:                      *)
-        Word1(9306H);                 (*  CMP  #0, R6              *)
-        Word1(2400H + 6);             (*  JZ   L2                  *)
-        Word1(3800H + 5);             (*  JL   L2                  *)
-        Word1(9605H);                 (*  CMP  R6, R5              *)
-        Word1(3800H + 3);             (*  JL   L2                  *)
-        Word1(5606H);                 (*  ADD  R6, R6              *)
-        Word1(5707H);                 (*  ADD  R7, R7              *)
-        Word1(3C00H + 400H - 8);      (*  JMP  L4                  *)
-                                      (*  L2:                      *)
-        Word1(0E335H);                (*  XOR  #-1, R5             *)
-        Word1(5315H);                 (*  ADD  #1,  R5             *)
-        Word1(0C312H);                (*  BIC  #1, SR              *)
-        Word1(1006H);                 (*  RRC  R6                  *)
-        Word1(0C312H);                (*  BIC  #1, SR              *)
-        Word1(1007H);                 (*  RRC  R7                  *)
-        Word1(5605H);                 (*  ADD  R6, R5              *)
-        Word1(8704H);                 (*  SUB  R7, R4              *)
-        Word1(3C00H + 400H - 25);     (*  JMP  L1                  *)
-                                      (*  L3:                      *)
-        Word1(4130H)                  (*  RET                      *)
-    END;
-
-    (* _mul (a, b: INTEGER): INTEGER *)
-    IF rtl[_mul].used THEN
-        Label(rtl[_mul].label);
-        Word2(4115H, 2);              (*  MOV  2(SP), R5; R5 <- a  *)
-        Word2(4116H, 4);              (*  MOV  4(SP), R6; R6 <- b  *)
-        Word1(4304H);                 (*  MOV  #0, R4; res := 0    *)
-        Word1(9306H);                 (*  CMP  #0, R6              *)
-        Word1(2400H + 7);             (*  JZ   L1                  *)
-                                      (*  L2:                      *)
-        Word1(0B316H);                (*  BIT  #1, R6              *)
-        Word1(2400H + 1);             (*  JZ   L3                  *)
-        Word1(5504H);                 (*  ADD  R5, R4              *)
-                                      (*  L3:                      *)
-        Word1(5505H);                 (*  ADD  R5, R5              *)
-        Word1(0C312H);                (*  BIC  #1, SR              *)
-        Word1(1006H);                 (*  RRC  R6                  *)
-        Word1(2000H + 400H - 7);      (*  JNZ  L2                  *)
-                                      (*  L1:                      *)
-        Word1(4130H)                  (*  RET                      *)
-    END;
-
-    (* _error (modNum, modName, err, line: INTEGER) *)
-    IF rtl[_error].used THEN
-        Label(rtl[_error].label);
-        Word1(5321H);          (*  ADD   #2, SP             *)
-        Word1(4134H);          (*  POP   R4; R4 <- modNum   *)
-        Word1(4135H);          (*  POP   R5; R5 <- modName  *)
-        Word1(4136H);          (*  POP   R6; R6 <- err      *)
-        Word1(4137H);          (*  POP   R7; R7 <- line     *)
-        Word2(4211H, sp);      (*  MOV   sp(SR), SP                   *)
-        Word1(1207H);          (*  PUSH  R7                           *)
-        Word1(1206H);          (*  PUSH  R6                           *)
-        Word1(1205H);          (*  PUSH  R5                           *)
-        Word1(1204H);          (*  PUSH  R4                           *)
-        Word2(4214H, sp);      (*  MOV   sp(SR), R4                   *)
-        Word2(1294H, trap);    (*  CALL  trap(R4)                     *)
-        Word2(04032H, 0F0H)    (*  MOV   CPUOFF+OSCOFF+SCG0+SCG1, SR  *)
-    END;
-
-    (* _new (t, size: INTEGER; VAR ptr: INTEGER) *)
-    IF rtl[_new].used THEN
-        Label(rtl[_new].label);
-        Word1(1202H);                  (*  PUSH SR               *)
-        Word1(4302H);                  (*  MOV  #0, SR           *)
-        Word1(4303H);                  (*  NOP                   *)
-        Word1(4104H);                  (*  MOV  SP, R4           *)
-        Word2(8034H, StkReserve);      (*  SUB  #StkReserve, R4  *)
-        Word1(4005H + 100H * HP);      (*  MOV  HP, R5           *)
-        Word2(5115H, 6);               (*  ADD  6(SP), R5        *)
-        Word1(9504H);                  (*  CMP  R5, R4           *)
-        Word2(4114H, 8);               (*  MOV  8(SP), R4        *)
-        Word1(3800H + 12);             (*  JL   L1               *)
-        Word3(4190H + HP, 4, 0);       (*  MOV  4(SP), 0(HP)     *)
-        Word1(5320H + HP);             (*  ADD  #2, HP           *)
-        Word2(4084H + 100H * HP, 0);   (*  MOV  HP, 0(R4)        *)
-                                       (*  L3                    *)
-        Word2(4380H + HP, 0);          (*  MOV  #0, 0(HP)        *)
-        Word1(5320H + HP);             (*  ADD  #2, HP           *)
-        Word1(9500H + HP);             (*  CMP  R5, HP           *)
-        Word1(3800H + 400H - 5);       (*  JL   L3               *)
-        Word1(3C00H + 2);              (*  JMP  L2               *)
-                                       (*  L1                    *)
-        Word2(4384H, 0);               (*  MOV  #0, 0(R4)        *)
-                                       (*  L2                    *)
-        Word1(1300H)                   (*  RETI                  *)
-    END;
-
-    (* _guardrec (t0, t1: INTEGER): INTEGER *)
-    IF rtl[_guardrec].used THEN
-        Label(rtl[_guardrec].label);
-        Word2(4114H, 2);              (*  MOV  2(SP), R4; R4 <- t0  *)
-        Word2(4115H, 4);              (*  MOV  4(SP), R5; R5 <- t1  *)
-        Word2(4036H, types);          (*  MOV  #types, R6           *)
-                                      (*  L3:                       *)
-        Word1(9305H);                 (*  CMP  #0, R5               *)
-        Word1(2400H + 8);             (*  JZ   L1                   *)
-        Word1(9405H);                 (*  CMP  R4, R5               *)
-        Word1(2400H + 10);            (*  JZ   L2                   *)
-        Word1(5505H);                 (*  ADD  R5, R5               *)
-        Word1(0E335H);                (*  XOR  #-1, R5              *)
-        Word1(5315H);                 (*  ADD  #1, R5               *)
-        Word1(5605H);                 (*  ADD  R6, R5               *)
-        Word1(4525H);                 (*  MOV  @R5, R5              *)
-        Word1(3C00H + 400H - 10);     (*  JMP  L3                   *)
-                                      (*  L1:                       *)
-        Word1(9405H);                 (*  CMP  R4, R5               *)
-        Word1(2400H + 2);             (*  JZ   L2                   *)
-        Word1(4304H);                 (*  MOV  #0, R4               *)
-        Word1(4130H);                 (*  RET                       *)
-                                      (*  L2:                       *)
-        Word1(4314H);                 (*  MOV  #1, R4               *)
-        Word1(4130H)                  (*  RET                       *)
-    END;
-
-    (* _is (t, p: INTEGER): INTEGER *)
-    IF rtl[_is].used THEN
-        Label(rtl[_is].label);
-        Word2(4114H, 4);             (*  MOV  4(SP), R4; R4 <- p  *)
-        Word2(4115H, 2);             (*  MOV  2(SP), R5; R5 <- t  *)
-        Word1(9304H);                (*  TST  R4                  *)
-        Word1(2400H + 2);            (*  JZ   L                   *)
-        Word2(4414H, -2);            (*  MOV  -2(R4), R4          *)
-                                     (*  L:                       *)
-        Word1(1204H);                (*  PUSH R4                  *)
-        Word1(1205H);                (*  PUSH R5                  *)
-        Call(rtl[_guardrec].label);  (*  CALL _guardrec           *)
-        Word1(5221H);                (*  ADD  #4, SP              *)
-        Word1(4130H)                 (*  RET                      *)
-    END;
-
-    (* _guard (t, p: INTEGER): INTEGER *)
-    IF rtl[_guard].used THEN
-        Label(rtl[_guard].label);
-        Word2(4115H, 4);             (*  MOV  4(SP), R5; R5 <- p  *)
-        Word1(4314H);                (*  MOV  #1, R4              *)
-        Word1(4525H);                (*  MOV  @R5, R5             *)
-        Word1(9305H);                (*  TST  R5                  *)
-        Word1(2400H + 9);            (*  JZ   L                   *)
-        Word2(4515H, -2);            (*  MOV  -2(R5), R5          *)
-        Word2(4114H, 2);             (*  MOV  2(SP), R4; R4 <- t  *)
-        Word1(1205H);                (*  PUSH R5                  *)
-        Word1(1204H);                (*  PUSH R4                  *)
-        Call(rtl[_guardrec].label);  (*  CALL _guardrec           *)
-        Word1(5221H);                (*  ADD  #4, SP              *)
-                                     (*  L:                       *)
-        Word1(4130H)                 (*  RET                      *)
-    END;
-
-    (* _move (bytes, dest, source: INTEGER) *)
-    IF rtl[_move].used THEN
-        Label(rtl[_move].label);
-        Word2(4116H, 2);              (*  MOV    2(SP), R6; R6 <- bytes   *)
-        Word2(4117H, 4);              (*  MOV    4(SP), R7; R7 <- dest    *)
-        Word2(4115H, 6);              (*  MOV    6(SP), R5; R5 <- source  *)
-        Word1(9306H);                 (*  CMP    #0, R6                   *)
-        Word1(3800H + 6);             (*  JL     L1                       *)
-        Word1(2400H + 5);             (*  JZ     L1                       *)
-                                      (*  L2:                             *)
-        Word2(45F7H, 0);              (*  MOV.B  @R5+, 0(R7)              *)
-        Word1(5317H);                 (*  ADD    #1, R7                   *)
-        Word1(8316H);                 (*  SUB    #1, R6                   *)
-        Word1(2000H + 400H - 5);      (*  JNZ    L2                       *)
-                                      (*  L1:                             *)
-        Word1(4130H)                  (*  RET                             *)
-    END;
-
-    (* _arrcpy (base_size, len_dst, dst, len_src, src: INTEGER) *)
-    IF rtl[_arrcpy].used THEN
-        Label(rtl[_arrcpy].label);
-        Word3(9191H, 8, 4);          (*  CMP  8(SP), 4(SP) *)
-        Word1(3800H + 18);           (*  JL   L1           *)
-        Word2(1211H, 12);            (*  PUSH 12(SP)       *)
-        Word2(1211H, 10);            (*  PUSH 10(SP)       *)
-        Word2(1211H, 14);            (*  PUSH 14(SP)       *)
-        Word2(1211H, 10);            (*  PUSH 10(SP)       *)
-        Call(rtl[_mul].label);       (*  CALL _mul         *)
-        Word1(5221H);                (*  ADD  #4, SP       *)
-        Word1(1204H);                (*  PUSH R4           *)
-        Call(rtl[_move].label);      (*  CALL _move        *)
-        Word2(5031H, 6);             (*  ADD  #6, SP       *)
-        Word1(4314H);                (*  MOV  #1, R4       *)
-        Word1(4130H);                (*  RET               *)
-                                     (*  L1                *)
-        Word1(4304H);                (*  MOV  #0, R4       *)
-        Word1(4130H)                 (*  RET               *)
-    END;
-
-    (* _length (len, str: INTEGER): INTEGER *)
-    IF rtl[_length].used THEN
-        Label(rtl[_length].label);
-        Word2(4116H, 2);              (*  MOV    2(SP), R6; R6 <- len  *)
-        Word2(4117H, 4);              (*  MOV    4(SP), R7; R7 <- str  *)
-        Word1(4304H);                 (*  MOV    #0, R4; res := 0      *)
-                                      (*  L2:                          *)
-        Word1(4775H);                 (*  MOV.B  @R7+, R5              *)
-        Word1(9305H);                 (*  CMP    #0, R5                *)
-        Word1(2400H + 3);             (*  JZ     L1                    *)
-        Word1(5314H);                 (*  ADD    #1, R4                *)
-        Word1(8316H);                 (*  SUB    #1, R6                *)
-        Word1(2000H + 400H - 6);      (*  JNZ    L2                    *)
-                                      (*  L1:                          *)
-        Word1(4130H)                  (*  RET                          *)
-    END;
-
-    (* _strcmp (op, len2, str2, len1, str1: INTEGER): BOOLEAN *)
-    IF rtl[_strcmp].used THEN
-        Label(rtl[_strcmp].label);
-        Word2(4116H, 4);            (*  MOV    4(SP), R6; R6 <- len2   *)
-        Word2(4117H, 8);            (*  MOV    8(SP), R7; R7 <- len1   *)
-        Word1(9607H);               (*  CMP    R6, R7                  *)
-        Word1(3400H + 1);           (*  JGE    L5                      *)
-        Word1(4706H);               (*  MOV    R7, R6                  *)
-                                    (*  L5:                            *)
-        Word1(1206H);               (*  PUSH   R6                      *)
-        Word2(4116H, 12);           (*  MOV    12(SP), R6; R6 <- str1  *)
-        Word2(4117H, 8);            (*  MOV    8(SP), R7; R7 <- str2   *)
-                                    (*  L3:                            *)
-        Word2(9381H, 0);            (*  CMP    #0, 0(SP)               *)
-        Word1(2400H + 11);          (*  JZ     L1                      *)
-        Word1(4674H);               (*  MOV.B  @R6+, R4                *)
-        Word1(4775H);               (*  MOV.B  @R7+, R5                *)
-        Word2(8391H, 0);            (*  SUB    #1, 0(SP)               *)
-        Word1(9405H);               (*  CMP    R4, R5                  *)
-        Word1(2400H + 2);           (*  JZ     L2                      *)
-        Word1(8504H);               (*  SUB    R5, R4                  *)
-        Word1(3C00H + 5);           (*  JMP    L4                      *)
-                                    (*  L2:                            *)
-        Word1(9304H);               (*  CMP    #0, R4                  *)
-        Word1(2000H + 400H - 13);   (*  JNZ    L3                      *)
-        Word1(3C00H + 2);           (*  JMP    L4                      *)
-                                    (*  L1:                            *)
-        Word2(4034H, 8000H);        (*  MOV    #8000H, R4              *)
-                                    (*  L4:                            *)
-        Word1(5321H);               (*  ADD    #2, SP                  *)
-
-        Word2(9034H, 8000H);        (*  CMP    #8000H, R4              *)
-        Word1(2000H + 18);          (*  JNZ    L6                      *)
-        Word2(4116H, 4);            (*  MOV    4(SP), R6; R6 <- len2   *)
-        Word2(4117H, 8);            (*  MOV    8(SP), R7; R7 <- len1   *)
-        Word1(9607H);               (*  CMP    R6, R7                  *)
-        Word1(2400H + 11);          (*  JZ     L7                      *)
-        Word1(3800H + 4);           (*  JL     L8                      *)
-        Word2(5116H, 10);           (*  ADD    10(SP), R6              *)
-        Word1(4664H);               (*  MOV.B  @R6, R4                 *)
-        Word1(3C00H + 7);           (*  JMP    L6                      *)
-                                    (*  L8:                            *)
-        Word2(5117H, 6);            (*  ADD    6(SP), R7               *)
-        Word1(4764H);               (*  MOV.B  @R7, R4                 *)
-        Word1(0E334H);              (*  XOR    #-1, R4                 *)
-        Word1(5314H);               (*  ADD    #1, R4                  *)
-        Word1(3C00H + 1);           (*  JMP    L6                      *)
-                                    (*  L7:                            *)
-        Word1(4304H);               (*  MOV    #0, R4                  *)
-                                    (*  L6:                            *)
-
-        Word2(5110H, 2);            (*  ADD  2(SP), PC; PC <- PC + op  *)
-
-        Word1(9304H);               (*  CMP  #0, R4  *)
-        Word1(4314H);               (*  MOV  #1, R4  *)
-        Word1(2400H + 1);           (*  JZ   L       *)
-        Word1(4304H);               (*  MOV  #0, R4  *)
-                                    (*  L            *)
-        Word1(4130H);               (*  RET          *)
-        Word1(4303H);               (*  NOP          *)
-
-        Word1(9304H);               (*  CMP  #0, R4  *)
-        Word1(4314H);               (*  MOV  #1, R4  *)
-        Word1(2000H + 1);           (*  JNZ  L       *)
-        Word1(4304H);               (*  MOV  #0, R4  *)
-                                    (*  L            *)
-        Word1(4130H);               (*  RET          *)
-        Word1(4303H);               (*  NOP          *)
-
-        Word1(9304H);               (*  CMP  #0, R4  *)
-        Word1(4314H);               (*  MOV  #1, R4  *)
-        Word1(3800H + 1);           (*  JL   L       *)
-        Word1(4304H);               (*  MOV  #0, R4  *)
-                                    (*  L            *)
-        Word1(4130H);               (*  RET          *)
-        Word1(4303H);               (*  NOP          *)
-
-        Word1(9304H);               (*  CMP  #0, R4  *)
-        Word1(4314H);               (*  MOV  #1, R4  *)
-        Word1(3800H + 2);           (*  JL   L       *)
-        Word1(2400H + 1);           (*  JZ   L       *)
-        Word1(4304H);               (*  MOV  #0, R4  *)
-                                    (*  L            *)
-        Word1(4130H);               (*  RET          *)
-
-        Word1(9304H);               (*  CMP  #0, R4  *)
-        Word1(4304H);               (*  MOV  #0, R4  *)
-        Word1(3800H + 2);           (*  JL   L       *)
-        Word1(2400H + 1);           (*  JZ   L       *)
-        Word1(4314H);               (*  MOV  #1, R4  *)
-                                    (*  L            *)
-        Word1(4130H);               (*  RET          *)
-
-        Word1(9304H);               (*  CMP  #0, R4  *)
-        Word1(4314H);               (*  MOV  #1, R4  *)
-        Word1(3400H + 1);           (*  JGE  L       *)
-        Word1(4304H);               (*  MOV  #0, R4  *)
-                                    (*  L            *)
-        Word1(4130H)                (*  RET          *)
-    END
-
-END Gen;
+        (* _lsl (n, x: INTEGER): INTEGER *)
+        IF rtl[_lsl].used THEN
+            Label(rtl[_lsl].label);
+            Word2(4115H, 2);              (*  MOV  2(SP), R5; R5 <- n  *)
+            Word2(4114H, 4);              (*  MOV  4(SP), R4; R4 <- x  *)
+            Word2(0F035H, 15);            (*  AND  #15, R5             *)
+            Word1(2400H + 3);             (*  JZ   L1                  *)
+                                        (*  L2:                      *)
+            Word1(5404H);                 (*  ADD  R4, R4              *)
+            Word1(8315H);                 (*  SUB  #1, R5              *)
+            Word1(2000H + 400H - 3);      (*  JNZ  L2                  *)
+                                        (*  L1:                      *)
+            Word1(4130H)                  (*  RET                      *)
+        END;
+
+        (* _asr (n, x: INTEGER): INTEGER *)
+        IF rtl[_asr].used THEN
+            Label(rtl[_asr].label);
+            Word2(4115H, 2);              (*  MOV  2(SP), R5; R5 <- n  *)
+            Word2(4114H, 4);              (*  MOV  4(SP), R4; R4 <- x  *)
+            Word2(0F035H, 15);            (*  AND  #15, R5             *)
+            Word1(2400H + 3);             (*  JZ   L1                  *)
+                                        (*  L2:                      *)
+            Word1(1104H);                 (*  RRA  R4                  *)
+            Word1(8315H);                 (*  SUB  #1, R5              *)
+            Word1(2000H + 400H - 3);      (*  JNZ  L2                  *)
+                                        (*  L1:                      *)
+            Word1(4130H)                  (*  RET                      *)
+        END;
+
+        (* _ror (n, x: INTEGER): INTEGER *)
+        IF rtl[_ror].used THEN
+            Label(rtl[_ror].label);
+            Word2(4115H, 2);              (*  MOV  2(SP), R5; R5 <- n  *)
+            Word2(4114H, 4);              (*  MOV  4(SP), R4; R4 <- x  *)
+            Word2(0F035H, 15);            (*  AND  #15, R5             *)
+            Word1(2400H + 5);             (*  JZ   L1                  *)
+            Word1(4406H);                 (*  MOV  R4, R6              *)
+                                        (*  L2:                      *)
+            Word1(1006H);                 (*  RRC  R6                  *)
+            Word1(1004H);                 (*  RRC  R4                  *)
+            Word1(8315H);                 (*  SUB  #1, R5              *)
+            Word1(2000H + 400H - 4);      (*  JNZ  L2                  *)
+                                        (*  L1:                      *)
+            Word1(4130H)                  (*  RET                      *)
+        END;
+
+        (* _lsr (n, x: INTEGER): INTEGER *)
+        IF rtl[_lsr].used THEN
+            Label(rtl[_lsr].label);
+            Word2(4115H, 2);              (*  MOV  2(SP), R5; R5 <- n  *)
+            Word2(4114H, 4);              (*  MOV  4(SP), R4; R4 <- x  *)
+            Word2(0F035H, 15);            (*  AND  #15, R5             *)
+            Word1(2400H + 4);             (*  JZ   L1                  *)
+                                        (*  L2:                      *)
+            Word1(0C312H);                (*  BIC  #1, SR              *)
+            Word1(1004H);                 (*  RRC  R4                  *)
+            Word1(8315H);                 (*  SUB  #1, R5              *)
+            Word1(2000H + 400H - 4);      (*  JNZ  L2                  *)
+                                        (*  L1:                      *)
+            Word1(4130H)                  (*  RET                      *)
+        END;
+
+        (* _set (b, a: INTEGER): SET *)
+        IF rtl[_set].used THEN
+            Label(rtl[_set].label);
+            Word2(4114H, 2);              (*  MOV  2(SP), R4; R4 <- b  *)
+            Word2(4115H, 4);              (*  MOV  4(SP), R5; R5 <- a  *)
+            Word1(9504H);                 (*  CMP  R5, R4              *)
+            Word1(3800H + 24);            (*  JL   L1                  *)
+            Word2(9035H, 16);             (*  CMP  #16, R5             *)
+            Word1(3400H + 21);            (*  JGE  L1                  *)
+            Word1(9304H);                 (*  CMP  #0, R4              *)
+            Word1(3800H + 19);            (*  JL   L1                  *)
+            Word2(9034H, 16);             (*  CMP  #16, R4             *)
+            Word1(3800H + 2);             (*  JL   L2                  *)
+            Word2(4034H, 15);             (*  MOV  #15, R4             *)
+                                        (*  L2:                      *)
+            Word1(9305H);                 (*  CMP  #0, R5              *)
+            Word1(3400H + 1);             (*  JGE  L3                  *)
+            Word1(4305H);                 (*  MOV  #0, R5              *)
+                                        (*  L3:                      *)
+            Word1(8504H);                 (*  SUB  R5, R4              *)
+            Word1(5404H);                 (*  ADD  R4, R4              *)
+            Word2(5034H, bits_offs);      (*  ADD  bits_offs, R4       *)
+            Word1(4424H);                 (*  MOV  @R4, R4             *)
+            Word1(5505H);                 (*  ADD  R5, R5              *)
+            Word1(5405H);                 (*  ADD  R4, R5              *)
+            Word2(5035H, bits);           (*  ADD  bits, R5            *)
+            Word1(4524H);                 (*  MOV  @R5, R4             *)
+            Word1(4130H);                 (*  RET                      *)
+                                        (*  L1:                      *)
+            Word1(4304H);                 (*  MOV  #0, R4              *)
+            Word1(4130H)                  (*  RET                      *)
+        END;
+
+        (* _set1 (a: INTEGER): SET *)
+        IF rtl[_set1].used THEN
+            Label(rtl[_set1].label);
+            Word2(4114H, 2);              (*  MOV  2(SP), R4; R4 <- a  *)
+            Word2(0B034H, 0FFF0H);        (*  BIT  #0FFF0H, R4         *)
+            Word1(2000H + 5);             (*  JNZ  L1                  *)
+            Word1(5404H);                 (*  ADD  R4, R4              *)
+            Word2(5034H, bits);           (*  ADD  bits, R4            *)
+            Word1(4424H);                 (*  MOV  @R4, R4             *)
+            Word1(4130H);                 (*  RET                      *)
+                                        (*  L1:                      *)
+            Word1(4304H);                 (*  MOV  #0, R4              *)
+            Word1(4130H)                  (*  RET                      *)
+        END;
+
+        (* _in2 (i, s: INTEGER): BOOLEAN *)
+        IF rtl[_in2].used THEN
+            Label(rtl[_in2].label);
+            Word2(4114H, 2);               (*  MOV  2(SP), R4; R4 <- i  *)
+            Word1(5404H);                  (*  ADD  R4, R4              *)
+            Word2(5034H, bits);            (*  ADD  bits, R4            *)
+            Word1(4424H);                  (*  MOV  @R4, R4             *)
+            Word2(0F114H, 4);              (*  AND  4(SP), R4           *)
+            Word1(2400H + 1);              (*  JZ   L1                  *)
+            Word1(4314H);                  (*  MOV  #1, R4              *)
+                                        (*  L1:                      *)
+            Word1(4130H)                   (*  RET                      *)
+        END;
+
+        (* _in (s, i: INTEGER): BOOLEAN *)
+        IF rtl[_in].used THEN
+            Label(rtl[_in].label);
+            Word2(4114H, 4);               (*  MOV  4(SP), R4; R4 <- i  *)
+            Word2(0B034H, 0FFF0H);         (*  BIT  #0FFF0H, R4         *)
+            Word1(2000H + 9);              (*  JNZ  L2                  *)
+            Word1(5404H);                  (*  ADD  R4, R4              *)
+            Word2(5034H, bits);            (*  ADD  bits, R4            *)
+            Word1(4424H);                  (*  MOV  @R4, R4             *)
+            Word2(0F114H, 2);              (*  AND  2(SP), R4           *)
+            Word1(2400H + 3);              (*  JZ   L1                  *)
+            Word1(4314H);                  (*  MOV  #1, R4              *)
+            Word1(4130H);                  (*  RET                      *)
+                                        (*  L2:                      *)
+            Word1(4304H);                  (*  MOV  #0, R4              *)
+                                        (*  L1:                      *)
+            Word1(4130H)                   (*  RET                      *)
+        END;
+
+        (* _incl (VAR s: SET; i: INTEGER) *)
+        IF rtl[_incl].used THEN
+            Label(rtl[_incl].label);
+            Word2(4114H, 4);          (*  MOV  4(SP), R4; R4 <- i  *)
+            Word2(0B034H, 0FFF0H);    (*  BIT  #0FFF0H, R4         *)
+            Word1(2000H + 8);         (*  JNZ  L1                  *)
+            Word1(5404H);             (*  ADD  R4, R4              *)
+            Word2(5034H, bits);       (*  ADD  bits, R4            *)
+            Word1(4424H);             (*  MOV  @R4, R4             *)
+            Word2(4115H, 2);          (*  MOV  2(SP), R5; R5 <- @s *)
+            Word2(0D485H, 0);         (*  BIS  R4, 0(R5)           *)
+                                    (*  L1:                      *)
+            Word1(4130H)              (*  RET                      *)
+        END;
+
+        (* _excl (VAR s: SET; i: INTEGER) *)
+        IF rtl[_excl].used THEN
+            Label(rtl[_excl].label);
+            Word2(4114H, 4);          (*  MOV  4(SP), R4; R4 <- i  *)
+            Word2(0B034H, 0FFF0H);    (*  BIT  #0FFF0H, R4         *)
+            Word1(2000H + 8);         (*  JNZ  L1                  *)
+            Word1(5404H);             (*  ADD  R4, R4              *)
+            Word2(5034H, bits);       (*  ADD  bits, R4            *)
+            Word1(4424H);             (*  MOV  @R4, R4             *)
+            Word2(4115H, 2);          (*  MOV  2(SP), R5; R5 <- @s *)
+            Word2(0C485H, 0);         (*  BIC  R4, 0(R5)           *)
+                                    (*  L1:                      *)
+            Word1(4130H)              (*  RET                      *)
+        END;
+
+        (* _rot (len, adr: INTEGER) *)
+        IF rtl[_rot].used THEN
+            Label(rtl[_rot].label);
+            Word2(4114H, 2);              (*  MOV    2(SP), R4; R4 <- len   *)
+            Word2(4115H, 4);              (*  MOV    4(SP), R5; R5 <- adr   *)
+            Word1(8314H);                 (*  SUB    #1, R4                 *)
+            Word1(5404H);                 (*  ADD    R4, R4                 *)
+            Word1(1225H);                 (*  PUSH   @R5                    *)
+            Word1(4406H);                 (*  MOV    R4, R6                 *)
+                                        (*  L1:                           *)
+            Word3(4595H, 2, 0);           (*  MOV    2(R5), 0(R5)           *)
+            Word1(5325H);                 (*  ADD    #2, R5                 *)
+            Word1(8326H);                 (*  SUB    #2, R6                 *)
+            Word1(2000H + 400H - 6);      (*  JNZ    L1                     *)
+            Word2(41B5H, 0);              (*  MOV    @SP+, 0(R5)            *)
+            Word1(4130H)                  (*  RET                           *)
+        END;
+
+        (* _divmod (b, a: INTEGER): INTEGER (* res -> R4, mod -> R5 *) *)
+        IF rtl[_divmod].used THEN
+            Label(rtl[_divmod].label);
+            Word2(4115H, 4);              (*  MOV  4(SP), R5; R5 <- a  *)
+            Word1(4304H);                 (*  MOV  #0, R4              *)
+                                        (*  L1:                      *)
+            Word2(4116H, 2);              (*  MOV  2(SP), R6; R6 <- b  *)
+            Word1(9605H);                 (*  CMP  R6, R5              *)
+            Word1(3800H + 17);            (*  JL   L3                  *)
+            Word1(4327H);                 (*  MOV  #2, R7              *)
+            Word1(5606H);                 (*  ADD  R6, R6              *)
+                                        (*  L4:                      *)
+            Word1(9306H);                 (*  CMP  #0, R6              *)
+            Word1(2400H + 6);             (*  JZ   L2                  *)
+            Word1(3800H + 5);             (*  JL   L2                  *)
+            Word1(9605H);                 (*  CMP  R6, R5              *)
+            Word1(3800H + 3);             (*  JL   L2                  *)
+            Word1(5606H);                 (*  ADD  R6, R6              *)
+            Word1(5707H);                 (*  ADD  R7, R7              *)
+            Word1(3C00H + 400H - 8);      (*  JMP  L4                  *)
+                                        (*  L2:                      *)
+            Word1(0C312H);                (*  BIC  #1, SR              *)
+            Word1(1006H);                 (*  RRC  R6                  *)
+            Word1(0C312H);                (*  BIC  #1, SR              *)
+            Word1(1007H);                 (*  RRC  R7                  *)
+            Word1(8605H);                 (*  SUB  R6, R5              *)
+            Word1(5704H);                 (*  ADD  R7, R4              *)
+            Word1(3C00H + 400H - 21);     (*  JMP  L1                  *)
+                                        (*  L3:                      *)
+            (*----------- (a < 0) --------------*)
+                                        (*  L1:                      *)
+            Word1(9305H);                 (*  CMP  #0, R5              *)
+            Word1(3400H + 23);            (*  JGE  L3                  *)
+            Word2(4116H, 2);              (*  MOV  2(SP), R6; R6 <- b  *)
+            Word1(4327H);                 (*  MOV  #2, R7              *)
+            Word1(5606H);                 (*  ADD  R6, R6              *)
+            Word1(0E335H);                (*  XOR  #-1, R5             *)
+            Word1(5315H);                 (*  ADD  #1,  R5             *)
+                                        (*  L4:                      *)
+            Word1(9306H);                 (*  CMP  #0, R6              *)
+            Word1(2400H + 6);             (*  JZ   L2                  *)
+            Word1(3800H + 5);             (*  JL   L2                  *)
+            Word1(9605H);                 (*  CMP  R6, R5              *)
+            Word1(3800H + 3);             (*  JL   L2                  *)
+            Word1(5606H);                 (*  ADD  R6, R6              *)
+            Word1(5707H);                 (*  ADD  R7, R7              *)
+            Word1(3C00H + 400H - 8);      (*  JMP  L4                  *)
+                                        (*  L2:                      *)
+            Word1(0E335H);                (*  XOR  #-1, R5             *)
+            Word1(5315H);                 (*  ADD  #1,  R5             *)
+            Word1(0C312H);                (*  BIC  #1, SR              *)
+            Word1(1006H);                 (*  RRC  R6                  *)
+            Word1(0C312H);                (*  BIC  #1, SR              *)
+            Word1(1007H);                 (*  RRC  R7                  *)
+            Word1(5605H);                 (*  ADD  R6, R5              *)
+            Word1(8704H);                 (*  SUB  R7, R4              *)
+            Word1(3C00H + 400H - 25);     (*  JMP  L1                  *)
+                                        (*  L3:                      *)
+            Word1(4130H)                  (*  RET                      *)
+        END;
+
+        (* _mul (a, b: INTEGER): INTEGER *)
+        IF rtl[_mul].used THEN
+            Label(rtl[_mul].label);
+            Word2(4115H, 2);              (*  MOV  2(SP), R5; R5 <- a  *)
+            Word2(4116H, 4);              (*  MOV  4(SP), R6; R6 <- b  *)
+            Word1(4304H);                 (*  MOV  #0, R4; res := 0    *)
+            Word1(9306H);                 (*  CMP  #0, R6              *)
+            Word1(2400H + 7);             (*  JZ   L1                  *)
+                                        (*  L2:                      *)
+            Word1(0B316H);                (*  BIT  #1, R6              *)
+            Word1(2400H + 1);             (*  JZ   L3                  *)
+            Word1(5504H);                 (*  ADD  R5, R4              *)
+                                        (*  L3:                      *)
+            Word1(5505H);                 (*  ADD  R5, R5              *)
+            Word1(0C312H);                (*  BIC  #1, SR              *)
+            Word1(1006H);                 (*  RRC  R6                  *)
+            Word1(2000H + 400H - 7);      (*  JNZ  L2                  *)
+                                        (*  L1:                      *)
+            Word1(4130H)                  (*  RET                      *)
+        END;
+
+        (* _error (modNum, modName, err, line: INTEGER) *)
+        IF rtl[_error].used THEN
+            Label(rtl[_error].label);
+            Word1(5321H);          (*  ADD   #2, SP             *)
+            Word1(4134H);          (*  POP   R4; R4 <- modNum   *)
+            Word1(4135H);          (*  POP   R5; R5 <- modName  *)
+            Word1(4136H);          (*  POP   R6; R6 <- err      *)
+            Word1(4137H);          (*  POP   R7; R7 <- line     *)
+            Word2(4211H, sp);      (*  MOV   sp(SR), SP                   *)
+            Word1(1207H);          (*  PUSH  R7                           *)
+            Word1(1206H);          (*  PUSH  R6                           *)
+            Word1(1205H);          (*  PUSH  R5                           *)
+            Word1(1204H);          (*  PUSH  R4                           *)
+            Word2(4214H, sp);      (*  MOV   sp(SR), R4                   *)
+            Word2(1294H, trap);    (*  CALL  trap(R4)                     *)
+            Word2(04032H, 0F0H)    (*  MOV   CPUOFF+OSCOFF+SCG0+SCG1, SR  *)
+        END;
+
+        (* _new (t, size: INTEGER; VAR ptr: INTEGER) *)
+        IF rtl[_new].used THEN
+            Label(rtl[_new].label);
+            Word1(1202H);                  (*  PUSH SR               *)
+            Word1(4302H);                  (*  MOV  #0, SR           *)
+            Word1(4303H);                  (*  NOP                   *)
+            Word1(4104H);                  (*  MOV  SP, R4           *)
+            Word2(8034H, StkReserve);      (*  SUB  #StkReserve, R4  *)
+            Word1(4005H + 100H * HP);      (*  MOV  HP, R5           *)
+            Word2(5115H, 6);               (*  ADD  6(SP), R5        *)
+            Word1(9504H);                  (*  CMP  R5, R4           *)
+            Word2(4114H, 8);               (*  MOV  8(SP), R4        *)
+            Word1(3800H + 12);             (*  JL   L1               *)
+            Word3(4190H + HP, 4, 0);       (*  MOV  4(SP), 0(HP)     *)
+            Word1(5320H + HP);             (*  ADD  #2, HP           *)
+            Word2(4084H + 100H * HP, 0);   (*  MOV  HP, 0(R4)        *)
+                                        (*  L3                    *)
+            Word2(4380H + HP, 0);          (*  MOV  #0, 0(HP)        *)
+            Word1(5320H + HP);             (*  ADD  #2, HP           *)
+            Word1(9500H + HP);             (*  CMP  R5, HP           *)
+            Word1(3800H + 400H - 5);       (*  JL   L3               *)
+            Word1(3C00H + 2);              (*  JMP  L2               *)
+                                        (*  L1                    *)
+            Word2(4384H, 0);               (*  MOV  #0, 0(R4)        *)
+                                        (*  L2                    *)
+            Word1(1300H)                   (*  RETI                  *)
+        END;
+
+        (* _guardrec (t0, t1: INTEGER): INTEGER *)
+        IF rtl[_guardrec].used THEN
+            Label(rtl[_guardrec].label);
+            Word2(4114H, 2);              (*  MOV  2(SP), R4; R4 <- t0  *)
+            Word2(4115H, 4);              (*  MOV  4(SP), R5; R5 <- t1  *)
+            Word2(4036H, types);          (*  MOV  #types, R6           *)
+                                        (*  L3:                       *)
+            Word1(9305H);                 (*  CMP  #0, R5               *)
+            Word1(2400H + 8);             (*  JZ   L1                   *)
+            Word1(9405H);                 (*  CMP  R4, R5               *)
+            Word1(2400H + 10);            (*  JZ   L2                   *)
+            Word1(5505H);                 (*  ADD  R5, R5               *)
+            Word1(0E335H);                (*  XOR  #-1, R5              *)
+            Word1(5315H);                 (*  ADD  #1, R5               *)
+            Word1(5605H);                 (*  ADD  R6, R5               *)
+            Word1(4525H);                 (*  MOV  @R5, R5              *)
+            Word1(3C00H + 400H - 10);     (*  JMP  L3                   *)
+                                        (*  L1:                       *)
+            Word1(9405H);                 (*  CMP  R4, R5               *)
+            Word1(2400H + 2);             (*  JZ   L2                   *)
+            Word1(4304H);                 (*  MOV  #0, R4               *)
+            Word1(4130H);                 (*  RET                       *)
+                                        (*  L2:                       *)
+            Word1(4314H);                 (*  MOV  #1, R4               *)
+            Word1(4130H)                  (*  RET                       *)
+        END;
+
+        (* _is (t, p: INTEGER): INTEGER *)
+        IF rtl[_is].used THEN
+            Label(rtl[_is].label);
+            Word2(4114H, 4);             (*  MOV  4(SP), R4; R4 <- p  *)
+            Word2(4115H, 2);             (*  MOV  2(SP), R5; R5 <- t  *)
+            Word1(9304H);                (*  TST  R4                  *)
+            Word1(2400H + 2);            (*  JZ   L                   *)
+            Word2(4414H, -2);            (*  MOV  -2(R4), R4          *)
+                                        (*  L:                       *)
+            Word1(1204H);                (*  PUSH R4                  *)
+            Word1(1205H);                (*  PUSH R5                  *)
+            Call(rtl[_guardrec].label);  (*  CALL _guardrec           *)
+            Word1(5221H);                (*  ADD  #4, SP              *)
+            Word1(4130H)                 (*  RET                      *)
+        END;
+
+        (* _guard (t, p: INTEGER): INTEGER *)
+        IF rtl[_guard].used THEN
+            Label(rtl[_guard].label);
+            Word2(4115H, 4);             (*  MOV  4(SP), R5; R5 <- p  *)
+            Word1(4314H);                (*  MOV  #1, R4              *)
+            Word1(4525H);                (*  MOV  @R5, R5             *)
+            Word1(9305H);                (*  TST  R5                  *)
+            Word1(2400H + 9);            (*  JZ   L                   *)
+            Word2(4515H, -2);            (*  MOV  -2(R5), R5          *)
+            Word2(4114H, 2);             (*  MOV  2(SP), R4; R4 <- t  *)
+            Word1(1205H);                (*  PUSH R5                  *)
+            Word1(1204H);                (*  PUSH R4                  *)
+            Call(rtl[_guardrec].label);  (*  CALL _guardrec           *)
+            Word1(5221H);                (*  ADD  #4, SP              *)
+                                        (*  L:                       *)
+            Word1(4130H)                 (*  RET                      *)
+        END;
+
+        (* _move (bytes, dest, source: INTEGER) *)
+        IF rtl[_move].used THEN
+            Label(rtl[_move].label);
+            Word2(4116H, 2);              (*  MOV    2(SP), R6; R6 <- bytes   *)
+            Word2(4117H, 4);              (*  MOV    4(SP), R7; R7 <- dest    *)
+            Word2(4115H, 6);              (*  MOV    6(SP), R5; R5 <- source  *)
+            Word1(9306H);                 (*  CMP    #0, R6                   *)
+            Word1(3800H + 6);             (*  JL     L1                       *)
+            Word1(2400H + 5);             (*  JZ     L1                       *)
+                                        (*  L2:                             *)
+            Word2(45F7H, 0);              (*  MOV.B  @R5+, 0(R7)              *)
+            Word1(5317H);                 (*  ADD    #1, R7                   *)
+            Word1(8316H);                 (*  SUB    #1, R6                   *)
+            Word1(2000H + 400H - 5);      (*  JNZ    L2                       *)
+                                        (*  L1:                             *)
+            Word1(4130H)                  (*  RET                             *)
+        END;
+
+        (* _arrcpy (base_size, len_dst, dst, len_src, src: INTEGER) *)
+        IF rtl[_arrcpy].used THEN
+            Label(rtl[_arrcpy].label);
+            Word3(9191H, 8, 4);          (*  CMP  8(SP), 4(SP) *)
+            Word1(3800H + 18);           (*  JL   L1           *)
+            Word2(1211H, 12);            (*  PUSH 12(SP)       *)
+            Word2(1211H, 10);            (*  PUSH 10(SP)       *)
+            Word2(1211H, 14);            (*  PUSH 14(SP)       *)
+            Word2(1211H, 10);            (*  PUSH 10(SP)       *)
+            Call(rtl[_mul].label);       (*  CALL _mul         *)
+            Word1(5221H);                (*  ADD  #4, SP       *)
+            Word1(1204H);                (*  PUSH R4           *)
+            Call(rtl[_move].label);      (*  CALL _move        *)
+            Word2(5031H, 6);             (*  ADD  #6, SP       *)
+            Word1(4314H);                (*  MOV  #1, R4       *)
+            Word1(4130H);                (*  RET               *)
+                                        (*  L1                *)
+            Word1(4304H);                (*  MOV  #0, R4       *)
+            Word1(4130H)                 (*  RET               *)
+        END;
+
+        (* _length (len, str: INTEGER): INTEGER *)
+        IF rtl[_length].used THEN
+            Label(rtl[_length].label);
+            Word2(4116H, 2);              (*  MOV    2(SP), R6; R6 <- len  *)
+            Word2(4117H, 4);              (*  MOV    4(SP), R7; R7 <- str  *)
+            Word1(4304H);                 (*  MOV    #0, R4; res := 0      *)
+                                        (*  L2:                          *)
+            Word1(4775H);                 (*  MOV.B  @R7+, R5              *)
+            Word1(9305H);                 (*  CMP    #0, R5                *)
+            Word1(2400H + 3);             (*  JZ     L1                    *)
+            Word1(5314H);                 (*  ADD    #1, R4                *)
+            Word1(8316H);                 (*  SUB    #1, R6                *)
+            Word1(2000H + 400H - 6);      (*  JNZ    L2                    *)
+                                        (*  L1:                          *)
+            Word1(4130H)                  (*  RET                          *)
+        END;
+
+        (* _strcmp (op, len2, str2, len1, str1: INTEGER): BOOLEAN *)
+        IF rtl[_strcmp].used THEN
+            Label(rtl[_strcmp].label);
+            Word2(4116H, 4);            (*  MOV    4(SP), R6; R6 <- len2   *)
+            Word2(4117H, 8);            (*  MOV    8(SP), R7; R7 <- len1   *)
+            Word1(9607H);               (*  CMP    R6, R7                  *)
+            Word1(3400H + 1);           (*  JGE    L5                      *)
+            Word1(4706H);               (*  MOV    R7, R6                  *)
+                                        (*  L5:                            *)
+            Word1(1206H);               (*  PUSH   R6                      *)
+            Word2(4116H, 12);           (*  MOV    12(SP), R6; R6 <- str1  *)
+            Word2(4117H, 8);            (*  MOV    8(SP), R7; R7 <- str2   *)
+                                        (*  L3:                            *)
+            Word2(9381H, 0);            (*  CMP    #0, 0(SP)               *)
+            Word1(2400H + 11);          (*  JZ     L1                      *)
+            Word1(4674H);               (*  MOV.B  @R6+, R4                *)
+            Word1(4775H);               (*  MOV.B  @R7+, R5                *)
+            Word2(8391H, 0);            (*  SUB    #1, 0(SP)               *)
+            Word1(9405H);               (*  CMP    R4, R5                  *)
+            Word1(2400H + 2);           (*  JZ     L2                      *)
+            Word1(8504H);               (*  SUB    R5, R4                  *)
+            Word1(3C00H + 5);           (*  JMP    L4                      *)
+                                        (*  L2:                            *)
+            Word1(9304H);               (*  CMP    #0, R4                  *)
+            Word1(2000H + 400H - 13);   (*  JNZ    L3                      *)
+            Word1(3C00H + 2);           (*  JMP    L4                      *)
+                                        (*  L1:                            *)
+            Word2(4034H, 8000H);        (*  MOV    #8000H, R4              *)
+                                        (*  L4:                            *)
+            Word1(5321H);               (*  ADD    #2, SP                  *)
+
+            Word2(9034H, 8000H);        (*  CMP    #8000H, R4              *)
+            Word1(2000H + 18);          (*  JNZ    L6                      *)
+            Word2(4116H, 4);            (*  MOV    4(SP), R6; R6 <- len2   *)
+            Word2(4117H, 8);            (*  MOV    8(SP), R7; R7 <- len1   *)
+            Word1(9607H);               (*  CMP    R6, R7                  *)
+            Word1(2400H + 11);          (*  JZ     L7                      *)
+            Word1(3800H + 4);           (*  JL     L8                      *)
+            Word2(5116H, 10);           (*  ADD    10(SP), R6              *)
+            Word1(4664H);               (*  MOV.B  @R6, R4                 *)
+            Word1(3C00H + 7);           (*  JMP    L6                      *)
+                                        (*  L8:                            *)
+            Word2(5117H, 6);            (*  ADD    6(SP), R7               *)
+            Word1(4764H);               (*  MOV.B  @R7, R4                 *)
+            Word1(0E334H);              (*  XOR    #-1, R4                 *)
+            Word1(5314H);               (*  ADD    #1, R4                  *)
+            Word1(3C00H + 1);           (*  JMP    L6                      *)
+                                        (*  L7:                            *)
+            Word1(4304H);               (*  MOV    #0, R4                  *)
+                                        (*  L6:                            *)
+
+            Word2(5110H, 2);            (*  ADD  2(SP), PC; PC <- PC + op  *)
+
+            Word1(9304H);               (*  CMP  #0, R4  *)
+            Word1(4314H);               (*  MOV  #1, R4  *)
+            Word1(2400H + 1);           (*  JZ   L       *)
+            Word1(4304H);               (*  MOV  #0, R4  *)
+                                        (*  L            *)
+            Word1(4130H);               (*  RET          *)
+            Word1(4303H);               (*  NOP          *)
+
+            Word1(9304H);               (*  CMP  #0, R4  *)
+            Word1(4314H);               (*  MOV  #1, R4  *)
+            Word1(2000H + 1);           (*  JNZ  L       *)
+            Word1(4304H);               (*  MOV  #0, R4  *)
+                                        (*  L            *)
+            Word1(4130H);               (*  RET          *)
+            Word1(4303H);               (*  NOP          *)
+
+            Word1(9304H);               (*  CMP  #0, R4  *)
+            Word1(4314H);               (*  MOV  #1, R4  *)
+            Word1(3800H + 1);           (*  JL   L       *)
+            Word1(4304H);               (*  MOV  #0, R4  *)
+                                        (*  L            *)
+            Word1(4130H);               (*  RET          *)
+            Word1(4303H);               (*  NOP          *)
+
+            Word1(9304H);               (*  CMP  #0, R4  *)
+            Word1(4314H);               (*  MOV  #1, R4  *)
+            Word1(3800H + 2);           (*  JL   L       *)
+            Word1(2400H + 1);           (*  JZ   L       *)
+            Word1(4304H);               (*  MOV  #0, R4  *)
+                                        (*  L            *)
+            Word1(4130H);               (*  RET          *)
+
+            Word1(9304H);               (*  CMP  #0, R4  *)
+            Word1(4304H);               (*  MOV  #0, R4  *)
+            Word1(3800H + 2);           (*  JL   L       *)
+            Word1(2400H + 1);           (*  JZ   L       *)
+            Word1(4314H);               (*  MOV  #1, R4  *)
+                                        (*  L            *)
+            Word1(4130H);               (*  RET          *)
+
+            Word1(9304H);               (*  CMP  #0, R4  *)
+            Word1(4314H);               (*  MOV  #1, R4  *)
+            Word1(3400H + 1);           (*  JGE  L       *)
+            Word1(4304H);               (*  MOV  #0, R4  *)
+                                        (*  L            *)
+            Word1(4130H)                (*  RET          *)
+        END
+
+    END Gen;
 
 
 PROCEDURE Set* (idx, label: INTEGER);
-BEGIN
-    rtl[idx].label := label;
-    rtl[idx].used  := FALSE
-END Set;
+    BEGIN
+        rtl[idx].label := label;
+        rtl[idx].used  := FALSE
+    END Set;
 
 
 PROCEDURE Used* (idx: INTEGER);
-BEGIN
-    rtl[idx].used := TRUE;
-    IF (idx = _guard) OR (idx = _is) THEN
-        rtl[_guardrec].used := TRUE
-    ELSIF idx = _arrcpy THEN
-        rtl[_move].used := TRUE;
-        rtl[_mul].used  := TRUE
-    END
-END Used;
+    BEGIN
+        rtl[idx].used := TRUE;
+        IF (idx = _guard) OR (idx = _is) THEN
+            rtl[_guardrec].used := TRUE
+        ELSIF idx = _arrcpy THEN
+            rtl[_move].used := TRUE;
+            rtl[_mul].used  := TRUE
+        END
+    END Used;
 
 
 PROCEDURE Init* (pLabel, pWord, pCall: EMITPROC);
-BEGIN
-    Label := pLabel;
-    Word  := pWord;
-    Call  := pCall;
-    ram   := 200H;
-END Init;
+    BEGIN
+        Label := pLabel;
+        Word  := pWord;
+        Call  := pCall;
+        ram   := 200H;
+    END Init;
 
 
 END MSP430RTL.

+ 1028 - 1035
source/PARS.ob07

@@ -1,11 +1,4 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2018-2022, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE PARS;
+MODULE PARS;
 
 IMPORT PROG, SCAN, ARITH, STRINGS, ERRORS, LISTS, IL, CONSOLE, PATHS, UTILS,
        C := COLLECTIONS, TARGETS, THUMB, MSP430;
@@ -80,1318 +73,1318 @@ VAR
 
 
 PROCEDURE destroy* (VAR parser: PARSER);
-BEGIN
-    IF parser.scanner # NIL THEN
-        SCAN.close(parser.scanner)
-    END;
+    BEGIN
+        IF parser.scanner # NIL THEN
+            SCAN.close(parser.scanner)
+        END;
 
-    C.push(parsers, parser);
-    parser := NIL
-END destroy;
+        C.push(parsers, parser);
+        parser := NIL
+    END destroy;
 
 
 PROCEDURE getpos (parser: PARSER; VAR pos: POSITION);
-BEGIN
-    pos.line   := parser.lex.pos.line;
-    pos.col    := parser.lex.pos.col;
-    pos.parser := parser
-END getpos;
+    BEGIN
+        pos.line   := parser.lex.pos.line;
+        pos.col    := parser.lex.pos.col;
+        pos.parser := parser
+    END getpos;
 
 
 PROCEDURE error* (pos: POSITION; errno: INTEGER);
-BEGIN
-    ERRORS.ErrorMsg(pos.parser.fname, pos.line, pos.col, errno)
-END error;
+    BEGIN
+        ERRORS.ErrorMsg(pos.parser.fname, pos.line, pos.col, errno)
+    END error;
 
 
 PROCEDURE check* (condition: BOOLEAN; pos: POSITION; errno: INTEGER);
-BEGIN
-    IF ~condition THEN
-        error(pos, errno)
-    END
-END check;
+    BEGIN
+        IF ~condition THEN
+            error(pos, errno)
+        END
+    END check;
 
 
 PROCEDURE check1* (condition: BOOLEAN; parser: PARSER; errno: INTEGER);
-VAR
-    pos: POSITION;
+    VAR
+        pos: POSITION;
 
-BEGIN
-    IF ~condition THEN
-        getpos(parser, pos);
-        error(pos, errno)
-    END
-END check1;
+    BEGIN
+        IF ~condition THEN
+            getpos(parser, pos);
+            error(pos, errno)
+        END
+    END check1;
 
 
 PROCEDURE Next* (parser: PARSER);
-VAR
-    errno: INTEGER;
-
-BEGIN
-    SCAN.Next(parser.scanner, parser.lex);
-    errno := parser.lex.error;
-    IF errno = 0 THEN
-        IF (TARGETS.RealSize = 0) & (parser.lex.sym = SCAN.lxFLOAT) THEN
-            errno := -SCAN.lxERROR13
-        ELSIF (TARGETS.BitDepth = 16) & (parser.lex.sym = SCAN.lxCHAR) & (parser.lex.value.typ = ARITH.tWCHAR) THEN
-            errno := -SCAN.lxERROR10
-        END
-    END;
+    VAR
+        errno: INTEGER;
 
-    IF errno # 0 THEN
-        check1(FALSE, parser, errno)
-    END;
-    parser.sym := parser.lex.sym
-END Next;
+    BEGIN
+        SCAN.Next(parser.scanner, parser.lex);
+        errno := parser.lex.error;
+        IF errno = 0 THEN
+            IF (TARGETS.RealSize = 0) & (parser.lex.sym = SCAN.lxFLOAT) THEN
+                errno := -SCAN.lxERROR13
+            ELSIF (TARGETS.BitDepth = 16) & (parser.lex.sym = SCAN.lxCHAR) & (parser.lex.value.typ = ARITH.tWCHAR) THEN
+                errno := -SCAN.lxERROR10
+            END
+        END;
+
+        IF errno # 0 THEN
+            check1(FALSE, parser, errno)
+        END;
+        parser.sym := parser.lex.sym
+    END Next;
 
 
 PROCEDURE NextPos (parser: PARSER; VAR pos: POSITION);
-BEGIN
-    Next(parser);
-    getpos(parser, pos)
-END NextPos;
+    BEGIN
+        Next(parser);
+        getpos(parser, pos)
+    END NextPos;
 
 
 PROCEDURE checklex* (parser: PARSER; sym: INTEGER);
-VAR
-    err: INTEGER;
-
-BEGIN
-
-    IF parser.sym # sym THEN
-
-        CASE sym OF
-        |SCAN.lxCOMMA:   err := 65
-        |SCAN.lxRROUND:  err := 33
-        |SCAN.lxPOINT:   err := 26
-        |SCAN.lxIDENT:   err := 22
-        |SCAN.lxRSQUARE: err := 71
-        |SCAN.lxRCURLY:  err := 35
-        |SCAN.lxUNDEF:   err := 34
-        |SCAN.lxTHEN:    err := 88
-        |SCAN.lxEND:     err := 27
-        |SCAN.lxDO:      err := 89
-        |SCAN.lxUNTIL:   err := 90
-        |SCAN.lxCOLON:   err := 53
-        |SCAN.lxOF:      err := 67
-        |SCAN.lxASSIGN:  err := 96
-        |SCAN.lxTO:      err := 57
-        |SCAN.lxLROUND:  err := 64
-        |SCAN.lxEQ:      err := 32
-        |SCAN.lxSEMI:    err := 24
-        |SCAN.lxRETURN:  err := 38
-        |SCAN.lxMODULE:  err := 21
-        END;
+    VAR
+        err: INTEGER;
+
+    BEGIN
+
+        IF parser.sym # sym THEN
+
+            CASE sym OF
+            |SCAN.lxCOMMA:   err := 65
+            |SCAN.lxRROUND:  err := 33
+            |SCAN.lxPOINT:   err := 26
+            |SCAN.lxIDENT:   err := 22
+            |SCAN.lxRSQUARE: err := 71
+            |SCAN.lxRCURLY:  err := 35
+            |SCAN.lxUNDEF:   err := 34
+            |SCAN.lxTHEN:    err := 88
+            |SCAN.lxEND:     err := 27
+            |SCAN.lxDO:      err := 89
+            |SCAN.lxUNTIL:   err := 90
+            |SCAN.lxCOLON:   err := 53
+            |SCAN.lxOF:      err := 67
+            |SCAN.lxASSIGN:  err := 96
+            |SCAN.lxTO:      err := 57
+            |SCAN.lxLROUND:  err := 64
+            |SCAN.lxEQ:      err := 32
+            |SCAN.lxSEMI:    err := 24
+            |SCAN.lxRETURN:  err := 38
+            |SCAN.lxMODULE:  err := 21
+            END;
 
-        check1(FALSE, parser, err)
-    END
-END checklex;
+            check1(FALSE, parser, err)
+        END
+    END checklex;
 
 
 PROCEDURE ExpectSym* (parser: PARSER; sym: INTEGER);
-BEGIN
-    Next(parser);
-    checklex(parser, sym)
-END ExpectSym;
+    BEGIN
+        Next(parser);
+        checklex(parser, sym)
+    END ExpectSym;
 
 
 PROCEDURE ImportList (parser: PARSER);
-VAR
-    fname, path, ext, _name: PATH;
-    name:    SCAN.IDENT;
-    parser2: PARSER;
-    pos:     POSITION;
-    alias, _in: BOOLEAN;
-    unit:    PROG.UNIT;
-    ident:   PROG.IDENT;
-
-BEGIN
-    alias := FALSE;
-
-    REPEAT
+    VAR
+        fname, path, ext, _name: PATH;
+        name:    SCAN.IDENT;
+        parser2: PARSER;
+        pos:     POSITION;
+        alias, _in: BOOLEAN;
+        unit:    PROG.UNIT;
+        ident:   PROG.IDENT;
 
-        ExpectSym(parser, SCAN.lxIDENT);
-        name := parser.lex.ident;
+    BEGIN
+        alias := FALSE;
 
-        getpos(parser, pos);
+        REPEAT
 
-        IF ~alias THEN
-            ident := PROG.addIdent(parser.unit, name, PROG.idMODULE);
-            check(ident # NIL, pos, 30)
-        END;
+            ExpectSym(parser, SCAN.lxIDENT);
+            name := parser.lex.ident;
 
-        Next(parser);
+            getpos(parser, pos);
 
-        path := parser.path;
-        fname := "";
-        ext := UTILS.FILE_EXT;
-        COPY(name.s, _name);
-        _in := FALSE;
+            IF ~alias THEN
+                ident := PROG.addIdent(parser.unit, name, PROG.idMODULE);
+                check(ident # NIL, pos, 30)
+            END;
 
-        IF parser.sym = SCAN.lxIN THEN
-            _in := TRUE;
             Next(parser);
-            IF parser.sym = SCAN.lxSTRING THEN
-                STRINGS.trim(parser.lex.string.s, fname)
-            ELSIF parser.sym = SCAN.lxCHAR THEN
-                fname[0] := CHR(ARITH.Int(parser.lex.value));
-                fname[1] := 0X
-            ELSE
-                check1(FALSE, parser, 117)
-            END;
-            STRINGS.replace(fname, "/", UTILS.slash);
-            STRINGS.replace(fname, "\", UTILS.slash);
-            PATHS.DelSlashes(fname);
-            PATHS.split(fname, path, _name, ext);
-            IF PATHS.isRelative(path) THEN
-                PATHS.RelPath(parser.path, path, fname);
-                STRINGS.append(fname, _name);
-                STRINGS.append(fname, ext);
-                PATHS.split(fname, path, _name, ext)
-            END;
-            Next(parser)
-        END;
 
-        IF (parser.sym = SCAN.lxCOMMA) OR (parser.sym = SCAN.lxSEMI) THEN
-            alias := FALSE;
-            IF (fname = "") & ((_name = "SYSTEM") OR PROG.LowerCase & (_name = "system")) THEN
-                unit := PROG.program.sysunit
-            ELSE
-                IF fname # "" THEN
-                    unit := PROG.getUnit(fname)
+            path := parser.path;
+            fname := "";
+            ext := UTILS.FILE_EXT;
+            COPY(name.s, _name);
+            _in := FALSE;
+
+            IF parser.sym = SCAN.lxIN THEN
+                _in := TRUE;
+                Next(parser);
+                IF parser.sym = SCAN.lxSTRING THEN
+                    STRINGS.trim(parser.lex.string.s, fname)
+                ELSIF parser.sym = SCAN.lxCHAR THEN
+                    fname[0] := CHR(ARITH.Int(parser.lex.value));
+                    fname[1] := 0X
                 ELSE
-                    fname := path;
+                    check1(FALSE, parser, 117)
+                END;
+                STRINGS.replace(fname, "/", UTILS.slash);
+                STRINGS.replace(fname, "\", UTILS.slash);
+                PATHS.DelSlashes(fname);
+                PATHS.split(fname, path, _name, ext);
+                IF PATHS.isRelative(path) THEN
+                    PATHS.RelPath(parser.path, path, fname);
                     STRINGS.append(fname, _name);
-                    STRINGS.append(fname, UTILS.FILE_EXT);
-                    unit := PROG.getUnit(fname);
-                    IF unit = NIL THEN
-                        fname := parser.lib_path;
-                        STRINGS.append(fname, _name);
-                        STRINGS.append(fname, UTILS.FILE_EXT);
-                        unit := PROG.getUnit(fname)
-                    END
-                END
+                    STRINGS.append(fname, ext);
+                    PATHS.split(fname, path, _name, ext)
+                END;
+                Next(parser)
             END;
 
-            IF unit # NIL THEN
-                check(unit.closed, pos, 31)
-            ELSE
-                parser2 := parser.create(path, parser.lib_path,
-                    parser.StatSeq, parser.expression, parser.designator, parser.chkreturn);
-
-                IF ~parser2.open(parser2, _name, ext) THEN
-                    IF (path # parser.lib_path) & ~_in THEN
-                        destroy(parser2);
-                        parser2 := parser.create(parser.lib_path, parser.lib_path,
-                            parser.StatSeq, parser.expression, parser.designator, parser.chkreturn);
-                        check(parser2.open(parser2, _name, ext), pos, 29)
+            IF (parser.sym = SCAN.lxCOMMA) OR (parser.sym = SCAN.lxSEMI) THEN
+                alias := FALSE;
+                IF (fname = "") & ((_name = "SYSTEM") OR PROG.LowerCase & (_name = "system")) THEN
+                    unit := PROG.program.sysunit
+                ELSE
+                    IF fname # "" THEN
+                        unit := PROG.getUnit(fname)
                     ELSE
-                        error(pos, 29)
+                        fname := path;
+                        STRINGS.append(fname, _name);
+                        STRINGS.append(fname, UTILS.FILE_EXT);
+                        unit := PROG.getUnit(fname);
+                        IF unit = NIL THEN
+                            fname := parser.lib_path;
+                            STRINGS.append(fname, _name);
+                            STRINGS.append(fname, UTILS.FILE_EXT);
+                            unit := PROG.getUnit(fname)
+                        END
                     END
                 END;
 
-                parser2.parse(parser2);
-                unit := parser2.unit;
-                unit.fname := parser2.fname;
-                destroy(parser2)
-            END;
-            IF unit = PROG.program.sysunit THEN
-                parser.unit.sysimport := TRUE
-            END;
-            ident.unit := unit
+                IF unit # NIL THEN
+                    check(unit.closed, pos, 31)
+                ELSE
+                    parser2 := parser.create(path, parser.lib_path,
+                        parser.StatSeq, parser.expression, parser.designator, parser.chkreturn);
+
+                    IF ~parser2.open(parser2, _name, ext) THEN
+                        IF (path # parser.lib_path) & ~_in THEN
+                            destroy(parser2);
+                            parser2 := parser.create(parser.lib_path, parser.lib_path,
+                                parser.StatSeq, parser.expression, parser.designator, parser.chkreturn);
+                            check(parser2.open(parser2, _name, ext), pos, 29)
+                        ELSE
+                            error(pos, 29)
+                        END
+                    END;
+
+                    parser2.parse(parser2);
+                    unit := parser2.unit;
+                    unit.fname := parser2.fname;
+                    destroy(parser2)
+                END;
+                IF unit = PROG.program.sysunit THEN
+                    parser.unit.sysimport := TRUE
+                END;
+                ident.unit := unit
 
-        ELSIF parser.sym = SCAN.lxASSIGN THEN
-            alias := TRUE
+            ELSIF parser.sym = SCAN.lxASSIGN THEN
+                alias := TRUE
 
-        ELSE
-            check1(FALSE, parser, 28)
-        END
+            ELSE
+                check1(FALSE, parser, 28)
+            END
 
-    UNTIL parser.sym = SCAN.lxSEMI;
+        UNTIL parser.sym = SCAN.lxSEMI;
 
-    Next(parser)
+        Next(parser)
 
-END ImportList;
+    END ImportList;
 
 
 PROCEDURE QIdent (parser: PARSER; forward: BOOLEAN): PROG.IDENT;
-VAR
-    ident: PROG.IDENT;
-    unit:  PROG.UNIT;
+    VAR
+        ident: PROG.IDENT;
+        unit:  PROG.UNIT;
 
-BEGIN
-    ASSERT(parser.sym = SCAN.lxIDENT);
+    BEGIN
+        ASSERT(parser.sym = SCAN.lxIDENT);
 
-    ident := PROG.getIdent(parser.unit, parser.lex.ident, FALSE);
+        ident := PROG.getIdent(parser.unit, parser.lex.ident, FALSE);
 
-    IF ~forward THEN
-        check1(ident # NIL, parser, 48)
-    END;
+        IF ~forward THEN
+            check1(ident # NIL, parser, 48)
+        END;
 
-    IF (ident # NIL) & (ident.typ = PROG.idMODULE) THEN
-        unit := ident.unit;
-        ExpectSym(parser, SCAN.lxPOINT);
-        ExpectSym(parser, SCAN.lxIDENT);
-        ident := PROG.getIdent(unit, parser.lex.ident, FALSE);
-        check1((ident # NIL) & ident.export, parser, 48)
-    END
+        IF (ident # NIL) & (ident.typ = PROG.idMODULE) THEN
+            unit := ident.unit;
+            ExpectSym(parser, SCAN.lxPOINT);
+            ExpectSym(parser, SCAN.lxIDENT);
+            ident := PROG.getIdent(unit, parser.lex.ident, FALSE);
+            check1((ident # NIL) & ident.export, parser, 48)
+        END
 
-    RETURN ident
-END QIdent;
+        RETURN ident
+    END QIdent;
 
 
 PROCEDURE strcmp* (VAR v: ARITH.VALUE; v2: ARITH.VALUE; operator: INTEGER);
-VAR
-    str: SCAN.TEXTSTR;
-    string1, string2: SCAN.STRING;
-    bool: BOOLEAN;
+    VAR
+        str: SCAN.TEXTSTR;
+        string1, string2: SCAN.STRING;
+        bool: BOOLEAN;
 
-BEGIN
+    BEGIN
 
-    IF v.typ = ARITH.tCHAR THEN
-        ASSERT(v2.typ = ARITH.tSTRING);
-        ARITH.charToStr(v, str);
-        string1 := SCAN.enterStr(str);
-        string2 := v2.string(SCAN.STRING)
-    END;
+        IF v.typ = ARITH.tCHAR THEN
+            ASSERT(v2.typ = ARITH.tSTRING);
+            ARITH.charToStr(v, str);
+            string1 := SCAN.enterStr(str);
+            string2 := v2.string(SCAN.STRING)
+        END;
 
-    IF v2.typ = ARITH.tCHAR THEN
-        ASSERT(v.typ = ARITH.tSTRING);
-        ARITH.charToStr(v2, str);
-        string2 := SCAN.enterStr(str);
-        string1 := v.string(SCAN.STRING)
-    END;
+        IF v2.typ = ARITH.tCHAR THEN
+            ASSERT(v.typ = ARITH.tSTRING);
+            ARITH.charToStr(v2, str);
+            string2 := SCAN.enterStr(str);
+            string1 := v.string(SCAN.STRING)
+        END;
 
-    IF v.typ = v2.typ THEN
-        string1 := v.string(SCAN.STRING);
-        string2 := v2.string(SCAN.STRING)
-    END;
+        IF v.typ = v2.typ THEN
+            string1 := v.string(SCAN.STRING);
+            string2 := v2.string(SCAN.STRING)
+        END;
 
-    CASE operator OF
-    |SCAN.lxEQ: bool := string1.s =  string2.s
-    |SCAN.lxNE: bool := string1.s #  string2.s
-    |SCAN.lxLT: bool := string1.s <  string2.s
-    |SCAN.lxGT: bool := string1.s >  string2.s
-    |SCAN.lxLE: bool := string1.s <= string2.s
-    |SCAN.lxGE: bool := string1.s >= string2.s
-    END;
+        CASE operator OF
+        |SCAN.lxEQ: bool := string1.s =  string2.s
+        |SCAN.lxNE: bool := string1.s #  string2.s
+        |SCAN.lxLT: bool := string1.s <  string2.s
+        |SCAN.lxGT: bool := string1.s >  string2.s
+        |SCAN.lxLE: bool := string1.s <= string2.s
+        |SCAN.lxGE: bool := string1.s >= string2.s
+        END;
 
-    ARITH.setbool(v, bool)
-END strcmp;
+        ARITH.setbool(v, bool)
+    END strcmp;
 
 
 PROCEDURE ConstExpression* (parser: PARSER; VAR v: ARITH.VALUE);
-VAR
-    e: EXPR;
-    pos: POSITION;
+    VAR
+        e: EXPR;
+        pos: POSITION;
 
-BEGIN
-    getpos(parser, pos);
-    parser.constexp := TRUE;
-    parser.expression(parser, e);
-    parser.constexp := FALSE;
-    check(e.obj = eCONST, pos, 62);
-    v := e.value
-END ConstExpression;
+    BEGIN
+        getpos(parser, pos);
+        parser.constexp := TRUE;
+        parser.expression(parser, e);
+        parser.constexp := FALSE;
+        check(e.obj = eCONST, pos, 62);
+        v := e.value
+    END ConstExpression;
 
 
 PROCEDURE FieldList (parser: PARSER; rec: PROG._TYPE);
-VAR
-    name:   SCAN.IDENT;
-    export: BOOLEAN;
-    pos:    POSITION;
+    VAR
+        name:   SCAN.IDENT;
+        export: BOOLEAN;
+        pos:    POSITION;
 
-BEGIN
-    ASSERT(parser.sym = SCAN.lxIDENT);
+    BEGIN
+        ASSERT(parser.sym = SCAN.lxIDENT);
 
-    WHILE parser.sym = SCAN.lxIDENT DO
+        WHILE parser.sym = SCAN.lxIDENT DO
 
-        getpos(parser, pos);
+            getpos(parser, pos);
 
-        name := parser.lex.ident;
+            name := parser.lex.ident;
 
-        Next(parser);
+            Next(parser);
 
-        export := parser.sym = SCAN.lxMUL;
+            export := parser.sym = SCAN.lxMUL;
 
-        IF export THEN
-            check1(parser.unit.scopeLvl = 0, parser, 61);
-            Next(parser)
-        END;
+            IF export THEN
+                check1(parser.unit.scopeLvl = 0, parser, 61);
+                Next(parser)
+            END;
 
-        check(PROG.addField(rec, name, export), pos, 30);
+            check(PROG.addField(rec, name, export), pos, 30);
 
-        IF parser.sym = SCAN.lxCOMMA THEN
-            ExpectSym(parser, SCAN.lxIDENT)
-        ELSE
-            checklex(parser, SCAN.lxCOLON)
-        END
+            IF parser.sym = SCAN.lxCOMMA THEN
+                ExpectSym(parser, SCAN.lxIDENT)
+            ELSE
+                checklex(parser, SCAN.lxCOLON)
+            END
 
-    END
+        END
 
-END FieldList;
+    END FieldList;
 
 
 PROCEDURE FormalParameters (parser: PARSER; _type: PROG._TYPE);
-VAR
-    ident: PROG.IDENT;
-
-
-    PROCEDURE FPSection (parser: PARSER; _type: PROG._TYPE);
     VAR
-        ident:   PROG.IDENT;
-        exit:    BOOLEAN;
-        vPar:    BOOLEAN;
-        dim:     INTEGER;
-        t0, t1:  PROG._TYPE;
-        pos:     POSITION;
+        ident: PROG.IDENT;
 
-    BEGIN
-        vPar := parser.sym = SCAN.lxVAR;
-        IF vPar THEN
-            Next(parser)
-        END;
 
-        checklex(parser, SCAN.lxIDENT);
-        exit := FALSE;
+        PROCEDURE FPSection (parser: PARSER; _type: PROG._TYPE);
+        VAR
+            ident:   PROG.IDENT;
+            exit:    BOOLEAN;
+            vPar:    BOOLEAN;
+            dim:     INTEGER;
+            t0, t1:  PROG._TYPE;
+            pos:     POSITION;
 
-        WHILE (parser.sym = SCAN.lxIDENT) & ~exit DO
-            check1(PROG.addParam(_type, parser.lex.ident, vPar), parser, 30);
-            Next(parser);
-            IF parser.sym = SCAN.lxCOMMA THEN
-                ExpectSym(parser, SCAN.lxIDENT)
-            ELSIF parser.sym = SCAN.lxCOLON THEN
-                Next(parser);
-                getpos(parser, pos);
-                dim := 0;
-                WHILE parser.sym = SCAN.lxARRAY DO
-                    INC(dim);
-                    check1(dim <= PROG.MAXARRDIM, parser, 84);
-                    ExpectSym(parser, SCAN.lxOF);
-                    Next(parser)
-                END;
-                checklex(parser, SCAN.lxIDENT);
-                ident := QIdent(parser, FALSE);
-                check1(ident.typ = PROG.idTYPE, parser, 68);
+        BEGIN
+            vPar := parser.sym = SCAN.lxVAR;
+            IF vPar THEN
+                Next(parser)
+            END;
 
-                t0 := ident._type;
-                t1 := t0;
+            checklex(parser, SCAN.lxIDENT);
+            exit := FALSE;
 
-                WHILE dim > 0 DO
-                    t1 := PROG.enterType(PROG.tARRAY, -1, 0, parser.unit);
-                    t1.base := t0;
-                    t0 := t1;
-                    DEC(dim)
-                END;
-                IF _type.call IN {PROG.fastcall, PROG._fastcall} THEN
-                    check(t1.typ # PROG.tREAL, pos, 126)
-                END;
-                PROG.setParams(_type, t1);
+            WHILE (parser.sym = SCAN.lxIDENT) & ~exit DO
+                check1(PROG.addParam(_type, parser.lex.ident, vPar), parser, 30);
                 Next(parser);
-                exit := TRUE
-            ELSE
-                checklex(parser, SCAN.lxCOLON)
+                IF parser.sym = SCAN.lxCOMMA THEN
+                    ExpectSym(parser, SCAN.lxIDENT)
+                ELSIF parser.sym = SCAN.lxCOLON THEN
+                    Next(parser);
+                    getpos(parser, pos);
+                    dim := 0;
+                    WHILE parser.sym = SCAN.lxARRAY DO
+                        INC(dim);
+                        check1(dim <= PROG.MAXARRDIM, parser, 84);
+                        ExpectSym(parser, SCAN.lxOF);
+                        Next(parser)
+                    END;
+                    checklex(parser, SCAN.lxIDENT);
+                    ident := QIdent(parser, FALSE);
+                    check1(ident.typ = PROG.idTYPE, parser, 68);
+
+                    t0 := ident._type;
+                    t1 := t0;
+
+                    WHILE dim > 0 DO
+                        t1 := PROG.enterType(PROG.tARRAY, -1, 0, parser.unit);
+                        t1.base := t0;
+                        t0 := t1;
+                        DEC(dim)
+                    END;
+                    IF _type.call IN {PROG.fastcall, PROG._fastcall} THEN
+                        check(t1.typ # PROG.tREAL, pos, 126)
+                    END;
+                    PROG.setParams(_type, t1);
+                    Next(parser);
+                    exit := TRUE
+                ELSE
+                    checklex(parser, SCAN.lxCOLON)
+                END
             END
-        END
 
-    END FPSection;
+        END FPSection;
+
+
+    BEGIN
+        IF parser.sym = SCAN.lxLROUND THEN
 
+            Next(parser);
 
-BEGIN
-    IF parser.sym = SCAN.lxLROUND THEN
+            IF (parser.sym = SCAN.lxVAR) OR (parser.sym = SCAN.lxIDENT) THEN
+                FPSection(parser, _type);
+                WHILE parser.sym = SCAN.lxSEMI DO
+                    Next(parser);
+                    FPSection(parser, _type)
+                END
+            END;
 
-        Next(parser);
+            checklex(parser, SCAN.lxRROUND);
+            Next(parser);
 
-        IF (parser.sym = SCAN.lxVAR) OR (parser.sym = SCAN.lxIDENT) THEN
-            FPSection(parser, _type);
-            WHILE parser.sym = SCAN.lxSEMI DO
-                Next(parser);
-                FPSection(parser, _type)
+            IF parser.sym = SCAN.lxCOLON THEN
+                ExpectSym(parser, SCAN.lxIDENT);
+                ident := QIdent(parser, FALSE);
+                check1(ident.typ = PROG.idTYPE, parser, 68);
+                check1(~(ident._type.typ IN {PROG.tRECORD, PROG.tARRAY}), parser, 69);
+                check1( ~(ODD(_type.call) & (ident._type.typ = PROG.tREAL)), parser, 113);
+                _type.base := ident._type;
+                Next(parser)
+            ELSE
+                _type.base := NIL
             END
-        END;
-
-        checklex(parser, SCAN.lxRROUND);
-        Next(parser);
 
-        IF parser.sym = SCAN.lxCOLON THEN
-            ExpectSym(parser, SCAN.lxIDENT);
-            ident := QIdent(parser, FALSE);
-            check1(ident.typ = PROG.idTYPE, parser, 68);
-            check1(~(ident._type.typ IN {PROG.tRECORD, PROG.tARRAY}), parser, 69);
-            check1( ~(ODD(_type.call) & (ident._type.typ = PROG.tREAL)), parser, 113);
-            _type.base := ident._type;
-            Next(parser)
-        ELSE
-            _type.base := NIL
         END
-
-    END
-END FormalParameters;
+    END FormalParameters;
 
 
 PROCEDURE sysflag (parser: PARSER; proc: BOOLEAN): INTEGER;
-VAR
-    res, sf: INTEGER;
-
-BEGIN
-    checklex(parser, SCAN.lxIDENT);
-    IF parser.lex.ident.s = "stdcall" THEN
-        sf := PROG.sf_stdcall
-    ELSIF parser.lex.ident.s = "cdecl" THEN
-        sf := PROG.sf_cdecl
-    ELSIF parser.lex.ident.s = "ccall" THEN
-        sf := PROG.sf_ccall
-    ELSIF parser.lex.ident.s = "win64" THEN
-        sf := PROG.sf_win64
-    ELSIF parser.lex.ident.s = "systemv" THEN
-        sf := PROG.sf_systemv
-    ELSIF parser.lex.ident.s = "windows" THEN
-        sf := PROG.sf_windows
-    ELSIF parser.lex.ident.s = "linux" THEN
-        sf := PROG.sf_linux
-    ELSIF parser.lex.ident.s = "code" THEN
-        sf := PROG.sf_code
-    ELSIF parser.lex.ident.s = "oberon" THEN
-        sf := PROG.sf_oberon
-    ELSIF parser.lex.ident.s = "fastcall" THEN
-        sf := PROG.sf_fastcall
-    ELSIF parser.lex.ident.s = "noalign" THEN
-        sf := PROG.sf_noalign
-    ELSE
-        check1(FALSE, parser, 124)
-    END;
+    VAR
+        res, sf: INTEGER;
 
-    check1(sf IN PROG.program.sysflags, parser, 125);
+    BEGIN
+        checklex(parser, SCAN.lxIDENT);
+        IF parser.lex.ident.s = "stdcall" THEN
+            sf := PROG.sf_stdcall
+        ELSIF parser.lex.ident.s = "cdecl" THEN
+            sf := PROG.sf_cdecl
+        ELSIF parser.lex.ident.s = "ccall" THEN
+            sf := PROG.sf_ccall
+        ELSIF parser.lex.ident.s = "win64" THEN
+            sf := PROG.sf_win64
+        ELSIF parser.lex.ident.s = "systemv" THEN
+            sf := PROG.sf_systemv
+        ELSIF parser.lex.ident.s = "windows" THEN
+            sf := PROG.sf_windows
+        ELSIF parser.lex.ident.s = "linux" THEN
+            sf := PROG.sf_linux
+        ELSIF parser.lex.ident.s = "code" THEN
+            sf := PROG.sf_code
+        ELSIF parser.lex.ident.s = "oberon" THEN
+            sf := PROG.sf_oberon
+        ELSIF parser.lex.ident.s = "fastcall" THEN
+            sf := PROG.sf_fastcall
+        ELSIF parser.lex.ident.s = "noalign" THEN
+            sf := PROG.sf_noalign
+        ELSE
+            check1(FALSE, parser, 124)
+        END;
 
-    IF proc THEN
-        check1(sf IN PROG.proc_flags, parser, 123)
-    ELSE
-        check1(sf IN PROG.rec_flags, parser, 123)
-    END;
+        check1(sf IN PROG.program.sysflags, parser, 125);
 
-    CASE sf OF
-    |PROG.sf_stdcall:
-        res := PROG.stdcall
-    |PROG.sf_cdecl:
-        res := PROG.cdecl
-    |PROG.sf_ccall:
-        IF TARGETS.OS IN {TARGETS.osWIN32, TARGETS.osLINUX32, TARGETS.osKOS} THEN
-            res := PROG.ccall
-        ELSIF TARGETS.OS = TARGETS.osWIN64 THEN
-            res := PROG.win64
-        ELSIF TARGETS.OS = TARGETS.osLINUX64 THEN
-            res := PROG.systemv
-        END
-    |PROG.sf_win64:
-        res := PROG.win64
-    |PROG.sf_systemv:
-        res := PROG.systemv
-    |PROG.sf_code:
-        res := PROG.code
-    |PROG.sf_fastcall:
-        res := PROG.fastcall
-    |PROG.sf_oberon:
-        IF TARGETS.OS IN {TARGETS.osWIN32, TARGETS.osLINUX32, TARGETS.osKOS} THEN
-            res := PROG.default32
-        ELSIF TARGETS.OS IN {TARGETS.osWIN64, TARGETS.osLINUX64} THEN
-            res := PROG.default64
-        END
-    |PROG.sf_windows:
-        IF TARGETS.OS = TARGETS.osWIN32 THEN
+        IF proc THEN
+            check1(sf IN PROG.proc_flags, parser, 123)
+        ELSE
+            check1(sf IN PROG.rec_flags, parser, 123)
+        END;
+
+        CASE sf OF
+        |PROG.sf_stdcall:
             res := PROG.stdcall
-        ELSIF TARGETS.OS = TARGETS.osWIN64 THEN
+        |PROG.sf_cdecl:
+            res := PROG.cdecl
+        |PROG.sf_ccall:
+            IF TARGETS.OS IN {TARGETS.osWIN32, TARGETS.osLINUX32, TARGETS.osKOS} THEN
+                res := PROG.ccall
+            ELSIF TARGETS.OS = TARGETS.osWIN64 THEN
+                res := PROG.win64
+            ELSIF TARGETS.OS = TARGETS.osLINUX64 THEN
+                res := PROG.systemv
+            END
+        |PROG.sf_win64:
             res := PROG.win64
-        END
-    |PROG.sf_linux:
-        IF TARGETS.OS = TARGETS.osLINUX32 THEN
-            res := PROG.ccall
-        ELSIF TARGETS.OS = TARGETS.osLINUX64 THEN
+        |PROG.sf_systemv:
             res := PROG.systemv
+        |PROG.sf_code:
+            res := PROG.code
+        |PROG.sf_fastcall:
+            res := PROG.fastcall
+        |PROG.sf_oberon:
+            IF TARGETS.OS IN {TARGETS.osWIN32, TARGETS.osLINUX32, TARGETS.osKOS} THEN
+                res := PROG.default32
+            ELSIF TARGETS.OS IN {TARGETS.osWIN64, TARGETS.osLINUX64} THEN
+                res := PROG.default64
+            END
+        |PROG.sf_windows:
+            IF TARGETS.OS = TARGETS.osWIN32 THEN
+                res := PROG.stdcall
+            ELSIF TARGETS.OS = TARGETS.osWIN64 THEN
+                res := PROG.win64
+            END
+        |PROG.sf_linux:
+            IF TARGETS.OS = TARGETS.osLINUX32 THEN
+                res := PROG.ccall
+            ELSIF TARGETS.OS = TARGETS.osLINUX64 THEN
+                res := PROG.systemv
+            END
+        |PROG.sf_noalign:
+            res := PROG.noalign
         END
-    |PROG.sf_noalign:
-        res := PROG.noalign
-    END
 
-    RETURN res
-END sysflag;
+        RETURN res
+    END sysflag;
 
 
 PROCEDURE procflag (parser: PARSER; VAR _import: IL.IMPORT_PROC; isProc: BOOLEAN): INTEGER;
-VAR
-    call: INTEGER;
-    dll, proc: SCAN.TEXTSTR;
-    pos: POSITION;
-
-
-    PROCEDURE getStr (parser: PARSER; VAR name: SCAN.TEXTSTR);
     VAR
+        call: INTEGER;
+        dll, proc: SCAN.TEXTSTR;
         pos: POSITION;
-        str: ARITH.VALUE;
 
-    BEGIN
-        getpos(parser, pos);
-        ConstExpression(parser, str);
-        IF str.typ = ARITH.tSTRING THEN
-            name := str.string(SCAN.STRING).s
-        ELSIF str.typ = ARITH.tCHAR THEN
-            ARITH.charToStr(str, name)
-        ELSE
-            check(FALSE, pos, 117)
-        END
-    END getStr;
 
+        PROCEDURE getStr (parser: PARSER; VAR name: SCAN.TEXTSTR);
+        VAR
+            pos: POSITION;
+            str: ARITH.VALUE;
+
+        BEGIN
+            getpos(parser, pos);
+            ConstExpression(parser, str);
+            IF str.typ = ARITH.tSTRING THEN
+                name := str.string(SCAN.STRING).s
+            ELSIF str.typ = ARITH.tCHAR THEN
+                ARITH.charToStr(str, name)
+            ELSE
+                check(FALSE, pos, 117)
+            END
+        END getStr;
 
-BEGIN
-    _import := NIL;
 
-    IF parser.sym = SCAN.lxLSQUARE THEN
-        getpos(parser, pos);
-        check1(parser.unit.sysimport, parser, 54);
-        Next(parser);
-        call := sysflag(parser, TRUE);
-        Next(parser);
-        IF parser.sym = SCAN.lxMINUS THEN
-            Next(parser);
-            INC(call)
-        END;
+    BEGIN
+        _import := NIL;
 
-        IF isProc & (parser.sym = SCAN.lxCOMMA) THEN
+        IF parser.sym = SCAN.lxLSQUARE THEN
+            getpos(parser, pos);
+            check1(parser.unit.sysimport, parser, 54);
             Next(parser);
-            getStr(parser, dll);
-            STRINGS.UpCase(dll);
-            checklex(parser, SCAN.lxCOMMA);
+            call := sysflag(parser, TRUE);
             Next(parser);
-            getStr(parser, proc);
-            _import := IL.AddImp(dll, proc)
+            IF parser.sym = SCAN.lxMINUS THEN
+                Next(parser);
+                INC(call)
+            END;
+
+            IF isProc & (parser.sym = SCAN.lxCOMMA) THEN
+                Next(parser);
+                getStr(parser, dll);
+                STRINGS.UpCase(dll);
+                checklex(parser, SCAN.lxCOMMA);
+                Next(parser);
+                getStr(parser, proc);
+                _import := IL.AddImp(dll, proc)
+            END;
+
+            checklex(parser, SCAN.lxRSQUARE);
+            Next(parser)
+        ELSE
+            CASE TARGETS.BitDepth OF
+            |16: call := PROG.default16
+            |32: IF TARGETS.CPU = TARGETS.cpuX86 THEN
+                    call := PROG.default32
+                ELSE
+                    call := PROG.cdecl
+                END
+            |64: IF TARGETS.CPU = TARGETS.cpuAMD64 THEN
+                    call := PROG.default64
+                ELSE
+                    call := PROG.cdecl
+                END
+            END
         END;
 
-        checklex(parser, SCAN.lxRSQUARE);
-        Next(parser)
-    ELSE
-        CASE TARGETS.BitDepth OF
-        |16: call := PROG.default16
-        |32: IF TARGETS.CPU = TARGETS.cpuX86 THEN
-                 call := PROG.default32
-             ELSE
-                 call := PROG.cdecl
-             END
-        |64: IF TARGETS.CPU = TARGETS.cpuAMD64 THEN
-                 call := PROG.default64
-             ELSE
-                 call := PROG.cdecl
-             END
+        IF _import # NIL THEN
+            check(TARGETS.Import, pos, 70)
         END
-    END;
 
-    IF _import # NIL THEN
-        check(TARGETS.Import, pos, 70)
-    END
-
-    RETURN call
-END procflag;
+        RETURN call
+    END procflag;
 
 
 PROCEDURE _type (parser: PARSER; VAR t: PROG._TYPE; flags: SET);
-CONST
-    comma   = 0;
-    closed  = 1;
-    forward = 2;
+    CONST
+        comma   = 0;
+        closed  = 1;
+        forward = 2;
 
-VAR
-    arrLen:     ARITH.VALUE;
-    typeSize:   ARITH.VALUE;
-    ident:      PROG.IDENT;
-    unit:       PROG.UNIT;
-    pos, pos2:  POSITION;
-    fieldType:  PROG._TYPE;
-    baseIdent:  SCAN.IDENT;
-    a, b:       INTEGER;
-    RecFlag:    INTEGER;
-    _import:     IL.IMPORT_PROC;
-
-BEGIN
-    unit := parser.unit;
-    t := NIL;
-
-    IF parser.sym = SCAN.lxIDENT THEN
-        ident := QIdent(parser, forward IN flags);
-
-        IF ident # NIL THEN
-            check1(ident.typ = PROG.idTYPE, parser, 49);
-            t := ident._type;
-            check1(t # NIL, parser, 50);
-            IF closed IN flags THEN
-                check1(t.closed, parser, 50)
-            END
-        END;
+    VAR
+        arrLen:     ARITH.VALUE;
+        typeSize:   ARITH.VALUE;
+        ident:      PROG.IDENT;
+        unit:       PROG.UNIT;
+        pos, pos2:  POSITION;
+        fieldType:  PROG._TYPE;
+        baseIdent:  SCAN.IDENT;
+        a, b:       INTEGER;
+        RecFlag:    INTEGER;
+        _import:     IL.IMPORT_PROC;
 
-        Next(parser)
+    BEGIN
+        unit := parser.unit;
+        t := NIL;
 
-    ELSIF (parser.sym = SCAN.lxARRAY) OR ((parser.sym = SCAN.lxCOMMA) & (comma IN flags)) THEN
+        IF parser.sym = SCAN.lxIDENT THEN
+            ident := QIdent(parser, forward IN flags);
+
+            IF ident # NIL THEN
+                check1(ident.typ = PROG.idTYPE, parser, 49);
+                t := ident._type;
+                check1(t # NIL, parser, 50);
+                IF closed IN flags THEN
+                    check1(t.closed, parser, 50)
+                END
+            END;
 
-        IF parser.sym = SCAN.lxARRAY THEN
-            getpos(parser, pos2)
-        END;
-        NextPos(parser, pos);
+            Next(parser)
 
-        ConstExpression(parser, arrLen);
+        ELSIF (parser.sym = SCAN.lxARRAY) OR ((parser.sym = SCAN.lxCOMMA) & (comma IN flags)) THEN
 
-        check(arrLen.typ = ARITH.tINTEGER, pos, 43);
-        check(ARITH.check(arrLen),         pos, 39);
-        check(ARITH.getInt(arrLen) > 0,    pos, 51);
+            IF parser.sym = SCAN.lxARRAY THEN
+                getpos(parser, pos2)
+            END;
+            NextPos(parser, pos);
 
-        t := PROG.enterType(PROG.tARRAY, -1, ARITH.getInt(arrLen), unit);
+            ConstExpression(parser, arrLen);
 
-        IF parser.sym = SCAN.lxCOMMA THEN
-            _type(parser, t.base, {comma, closed})
-        ELSIF parser.sym = SCAN.lxOF THEN
-            Next(parser);
-            _type(parser, t.base, {closed})
-        ELSE
-            check1(FALSE, parser, 47)
-        END;
+            check(arrLen.typ = ARITH.tINTEGER, pos, 43);
+            check(ARITH.check(arrLen),         pos, 39);
+            check(ARITH.getInt(arrLen) > 0,    pos, 51);
 
-        t.align := t.base.align;
+            t := PROG.enterType(PROG.tARRAY, -1, ARITH.getInt(arrLen), unit);
 
-        a := t.length;
-        b := t.base.size;
-        check(ARITH.mulInt(a, b), pos2, 104);
-        check(ARITH.setInt(typeSize, a), pos2, 104);
-        t.size := a;
+            IF parser.sym = SCAN.lxCOMMA THEN
+                _type(parser, t.base, {comma, closed})
+            ELSIF parser.sym = SCAN.lxOF THEN
+                Next(parser);
+                _type(parser, t.base, {closed})
+            ELSE
+                check1(FALSE, parser, 47)
+            END;
 
-        t.closed := TRUE
+            t.align := t.base.align;
 
-    ELSIF parser.sym = SCAN.lxRECORD THEN
-        getpos(parser, pos2);
-        Next(parser);
+            a := t.length;
+            b := t.base.size;
+            check(ARITH.mulInt(a, b), pos2, 104);
+            check(ARITH.setInt(typeSize, a), pos2, 104);
+            t.size := a;
 
-        t := PROG.enterType(PROG.tRECORD, 0, 0, unit);
-        t.align := 1;
+            t.closed := TRUE
 
-        IF parser.sym = SCAN.lxLSQUARE THEN
-            check1(parser.unit.sysimport, parser, 54);
+        ELSIF parser.sym = SCAN.lxRECORD THEN
+            getpos(parser, pos2);
             Next(parser);
-            RecFlag := sysflag(parser, FALSE);
-            t.noalign := RecFlag = PROG.noalign;
-            ExpectSym(parser, SCAN.lxRSQUARE);
-            Next(parser)
-        END;
 
-        IF parser.sym = SCAN.lxLROUND THEN
-            check1(~t.noalign, parser, 111);
-            ExpectSym(parser, SCAN.lxIDENT);
-            getpos(parser, pos);
+            t := PROG.enterType(PROG.tRECORD, 0, 0, unit);
+            t.align := 1;
 
-            _type(parser, t.base, {closed});
+            IF parser.sym = SCAN.lxLSQUARE THEN
+                check1(parser.unit.sysimport, parser, 54);
+                Next(parser);
+                RecFlag := sysflag(parser, FALSE);
+                t.noalign := RecFlag = PROG.noalign;
+                ExpectSym(parser, SCAN.lxRSQUARE);
+                Next(parser)
+            END;
 
-            check(t.base.typ IN {PROG.tRECORD, PROG.tPOINTER}, pos, 52);
+            IF parser.sym = SCAN.lxLROUND THEN
+                check1(~t.noalign, parser, 111);
+                ExpectSym(parser, SCAN.lxIDENT);
+                getpos(parser, pos);
 
-            IF t.base.typ = PROG.tPOINTER THEN
-                t.base := t.base.base;
-                check(t.base # NIL, pos, 55)
-            END;
+                _type(parser, t.base, {closed});
 
-            check(~t.base.noalign, pos, 112);
+                check(t.base.typ IN {PROG.tRECORD, PROG.tPOINTER}, pos, 52);
 
-            checklex(parser, SCAN.lxRROUND);
-            Next(parser);
+                IF t.base.typ = PROG.tPOINTER THEN
+                    t.base := t.base.base;
+                    check(t.base # NIL, pos, 55)
+                END;
 
-            t.size := t.base.size;
-            IF t.base.align > t.align THEN
-                t.align := t.base.align
-            END
-        ELSE
-            t.base := PROG.program.stTypes.tANYREC
-        END;
+                check(~t.base.noalign, pos, 112);
 
-        WHILE parser.sym = SCAN.lxIDENT DO
-            FieldList(parser, t);
+                checklex(parser, SCAN.lxRROUND);
+                Next(parser);
 
-            ASSERT(parser.sym = SCAN.lxCOLON);
-            Next(parser);
+                t.size := t.base.size;
+                IF t.base.align > t.align THEN
+                    t.align := t.base.align
+                END
+            ELSE
+                t.base := PROG.program.stTypes.tANYREC
+            END;
 
-            _type(parser, fieldType, {closed});
-            check(PROG.setFields(t, fieldType), pos2, 104);
+            WHILE parser.sym = SCAN.lxIDENT DO
+                FieldList(parser, t);
 
-            IF (fieldType.align > t.align) & ~t.noalign THEN
-                t.align := fieldType.align
+                ASSERT(parser.sym = SCAN.lxCOLON);
+                Next(parser);
+
+                _type(parser, fieldType, {closed});
+                check(PROG.setFields(t, fieldType), pos2, 104);
+
+                IF (fieldType.align > t.align) & ~t.noalign THEN
+                    t.align := fieldType.align
+                END;
+
+                IF parser.sym = SCAN.lxSEMI THEN
+                    ExpectSym(parser, SCAN.lxIDENT)
+                ELSE
+                    checklex(parser, SCAN.lxEND)
+                END
             END;
 
-            IF parser.sym = SCAN.lxSEMI THEN
-                ExpectSym(parser, SCAN.lxIDENT)
-            ELSE
-                checklex(parser, SCAN.lxEND)
-            END
-        END;
+            t.closed := TRUE;
 
-        t.closed := TRUE;
+            IL.AddRec(t.base.num);
 
-        IL.AddRec(t.base.num);
+            IF ~t.noalign THEN
+                check(UTILS.Align(t.size, t.align), pos2, 104);
+                check(ARITH.setInt(typeSize, t.size), pos2, 104)
+            END;
 
-        IF ~t.noalign THEN
-            check(UTILS.Align(t.size, t.align), pos2, 104);
-            check(ARITH.setInt(typeSize, t.size), pos2, 104)
-        END;
+            checklex(parser, SCAN.lxEND);
+            Next(parser)
 
-        checklex(parser, SCAN.lxEND);
-        Next(parser)
+        ELSIF parser.sym = SCAN.lxPOINTER THEN
+            ExpectSym(parser, SCAN.lxTO);
+            Next(parser);
 
-    ELSIF parser.sym = SCAN.lxPOINTER THEN
-        ExpectSym(parser, SCAN.lxTO);
-        Next(parser);
+            t := PROG.enterType(PROG.tPOINTER, TARGETS.AdrSize, 0, unit);
+            t.align := TARGETS.AdrSize;
 
-        t := PROG.enterType(PROG.tPOINTER, TARGETS.AdrSize, 0, unit);
-        t.align := TARGETS.AdrSize;
+            getpos(parser, pos);
 
-        getpos(parser, pos);
+            IF parser.sym = SCAN.lxIDENT THEN
+                baseIdent := parser.lex.ident
+            END;
 
-        IF parser.sym = SCAN.lxIDENT THEN
-            baseIdent := parser.lex.ident
-        END;
+            _type(parser, t.base, {forward});
 
-        _type(parser, t.base, {forward});
+            IF t.base # NIL THEN
+                check(t.base.typ = PROG.tRECORD, pos, 58)
+            ELSE
+                PROG.frwPtr(unit, t, baseIdent, pos)
+            END
 
-        IF t.base # NIL THEN
-            check(t.base.typ = PROG.tRECORD, pos, 58)
+        ELSIF parser.sym = SCAN.lxPROCEDURE THEN
+            NextPos(parser, pos);
+            t := PROG.enterType(PROG.tPROCEDURE, TARGETS.AdrSize, 0, unit);
+            t.align := TARGETS.AdrSize;
+            t.call := procflag(parser, _import, FALSE);
+            FormalParameters(parser, t)
         ELSE
-            PROG.frwPtr(unit, t, baseIdent, pos)
+            check1(FALSE, parser, 49)
         END
 
-    ELSIF parser.sym = SCAN.lxPROCEDURE THEN
-        NextPos(parser, pos);
-        t := PROG.enterType(PROG.tPROCEDURE, TARGETS.AdrSize, 0, unit);
-        t.align := TARGETS.AdrSize;
-        t.call := procflag(parser, _import, FALSE);
-        FormalParameters(parser, t)
-    ELSE
-        check1(FALSE, parser, 49)
-    END
-
-END _type;
+    END _type;
 
 
 PROCEDURE IdentDef (parser: PARSER; typ: INTEGER; VAR name: SCAN.IDENT): PROG.IDENT;
-VAR
-    ident:  PROG.IDENT;
-    pos:    POSITION;
-
-BEGIN
-    ASSERT(parser.sym = SCAN.lxIDENT);
-
-    name := parser.lex.ident;
-    getpos(parser, pos);
-    ident := PROG.addIdent(parser.unit, name, typ);
-    check(ident # NIL, pos, 30);
-    ident.pos := pos;
-    Next(parser);
-
-    IF parser.sym = SCAN.lxMUL THEN
-        check1(ident.global, parser, 61);
-        ident.export := TRUE;
-        Next(parser)
-    END
+    VAR
+        ident:  PROG.IDENT;
+        pos:    POSITION;
+
+    BEGIN
+        ASSERT(parser.sym = SCAN.lxIDENT);
 
-    RETURN ident
-END IdentDef;
+        name := parser.lex.ident;
+        getpos(parser, pos);
+        ident := PROG.addIdent(parser.unit, name, typ);
+        check(ident # NIL, pos, 30);
+        ident.pos := pos;
+        Next(parser);
+
+        IF parser.sym = SCAN.lxMUL THEN
+            check1(ident.global, parser, 61);
+            ident.export := TRUE;
+            Next(parser)
+        END
+
+        RETURN ident
+    END IdentDef;
 
 
 PROCEDURE ConstTypeDeclaration (parser: PARSER; _const: BOOLEAN);
-VAR
-    ident: PROG.IDENT;
-    name:  SCAN.IDENT;
-    pos:   POSITION;
-
-BEGIN
-    IF _const THEN
-        ident := IdentDef(parser, PROG.idNONE, name)
-    ELSE
-        ident := IdentDef(parser, PROG.idTYPE, name)
-    END;
+    VAR
+        ident: PROG.IDENT;
+        name:  SCAN.IDENT;
+        pos:   POSITION;
+
+    BEGIN
+        IF _const THEN
+            ident := IdentDef(parser, PROG.idNONE, name)
+        ELSE
+            ident := IdentDef(parser, PROG.idTYPE, name)
+        END;
 
-    checklex(parser, SCAN.lxEQ);
-    NextPos(parser, pos);
+        checklex(parser, SCAN.lxEQ);
+        NextPos(parser, pos);
 
-    IF _const THEN
-        ConstExpression(parser, ident.value);
-        IF ident.value.typ = ARITH.tINTEGER THEN
-            check(ARITH.check(ident.value), pos, 39)
-        ELSIF ident.value.typ = ARITH.tREAL THEN
-            check(ARITH.check(ident.value), pos, 40)
+        IF _const THEN
+            ConstExpression(parser, ident.value);
+            IF ident.value.typ = ARITH.tINTEGER THEN
+                check(ARITH.check(ident.value), pos, 39)
+            ELSIF ident.value.typ = ARITH.tREAL THEN
+                check(ARITH.check(ident.value), pos, 40)
+            END;
+            ident.typ  := PROG.idCONST;
+            ident._type := PROG.getType(ident.value.typ)
+        ELSE
+            _type(parser, ident._type, {})
         END;
-        ident.typ  := PROG.idCONST;
-        ident._type := PROG.getType(ident.value.typ)
-    ELSE
-        _type(parser, ident._type, {})
-    END;
 
-    checklex(parser, SCAN.lxSEMI);
-    Next(parser)
+        checklex(parser, SCAN.lxSEMI);
+        Next(parser)
 
-END ConstTypeDeclaration;
+    END ConstTypeDeclaration;
 
 
 PROCEDURE VarDeclaration (parser: PARSER);
-VAR
-    ident: PROG.IDENT;
-    name:  SCAN.IDENT;
-    t:     PROG._TYPE;
+    VAR
+        ident: PROG.IDENT;
+        name:  SCAN.IDENT;
+        t:     PROG._TYPE;
 
-BEGIN
+    BEGIN
 
-    REPEAT
-        ident := IdentDef(parser, PROG.idVAR, name);
+        REPEAT
+            ident := IdentDef(parser, PROG.idVAR, name);
 
-        IF parser.sym = SCAN.lxCOMMA THEN
-            ExpectSym(parser, SCAN.lxIDENT)
-        ELSIF parser.sym = SCAN.lxCOLON THEN
-            Next(parser);
-            _type(parser, t, {});
-            PROG.setVarsType(parser.unit, t);
-            checklex(parser, SCAN.lxSEMI);
-            Next(parser)
-        ELSE
-            checklex(parser, SCAN.lxCOLON)
-        END
+            IF parser.sym = SCAN.lxCOMMA THEN
+                ExpectSym(parser, SCAN.lxIDENT)
+            ELSIF parser.sym = SCAN.lxCOLON THEN
+                Next(parser);
+                _type(parser, t, {});
+                PROG.setVarsType(parser.unit, t);
+                checklex(parser, SCAN.lxSEMI);
+                Next(parser)
+            ELSE
+                checklex(parser, SCAN.lxCOLON)
+            END
 
-    UNTIL parser.sym # SCAN.lxIDENT
+        UNTIL parser.sym # SCAN.lxIDENT
 
-END VarDeclaration;
+    END VarDeclaration;
 
 
 PROCEDURE DeclarationSequence (parser: PARSER): BOOLEAN;
-VAR
-    ptr: PROG.FRWPTR;
-    endmod: BOOLEAN;
-    pos: POSITION;
+    VAR
+        ptr: PROG.FRWPTR;
+        endmod: BOOLEAN;
+        pos: POSITION;
 
 
-    PROCEDURE ProcDeclaration (parser: PARSER): BOOLEAN;
-    VAR
-        proc:       PROG.IDENT;
-        endname,
-        name:       SCAN.IDENT;
-        param:      PROG.PARAM;
-        unit:       PROG.UNIT;
-        ident:      PROG.IDENT;
-        e:          EXPR;
-        pos, pos1,
-        pos2:       POSITION;
-        label:      INTEGER;
-        enter:      IL.COMMAND;
-        call:       INTEGER;
-        t:          PROG._TYPE;
-        _import:    IL.IMPORT_PROC;
-        endmod, b:  BOOLEAN;
-        fparams:    SET;
-        int, flt:   INTEGER;
-        comma:      BOOLEAN;
-        code, iv:   ARITH.VALUE;
-        codeProc,
-        handler:    BOOLEAN;
-        line:       INTEGER;
+        PROCEDURE ProcDeclaration (parser: PARSER): BOOLEAN;
+        VAR
+            proc:       PROG.IDENT;
+            endname,
+            name:       SCAN.IDENT;
+            param:      PROG.PARAM;
+            unit:       PROG.UNIT;
+            ident:      PROG.IDENT;
+            e:          EXPR;
+            pos, pos1,
+            pos2:       POSITION;
+            label:      INTEGER;
+            enter:      IL.COMMAND;
+            call:       INTEGER;
+            t:          PROG._TYPE;
+            _import:    IL.IMPORT_PROC;
+            endmod, b:  BOOLEAN;
+            fparams:    SET;
+            int, flt:   INTEGER;
+            comma:      BOOLEAN;
+            code, iv:   ARITH.VALUE;
+            codeProc,
+            handler:    BOOLEAN;
+            line:       INTEGER;
+
+        BEGIN
+            endmod := FALSE;
+            handler := FALSE;
+
+            unit := parser.unit;
+
+            call := procflag(parser, _import, TRUE);
 
-    BEGIN
-        endmod := FALSE;
-        handler := FALSE;
+            getpos(parser, pos);
+            pos1 := pos;
+            checklex(parser, SCAN.lxIDENT);
+            line := pos.line;
+
+            IF _import # NIL THEN
+                proc := IdentDef(parser, PROG.idIMP, name);
+                proc._import := _import;
+                IF _import.name = "" THEN
+                    COPY(name.s, _import.name)
+                END;
+                PROG.program.procs.last(PROG.PROC)._import := _import
+            ELSE
+                proc := IdentDef(parser, PROG.idPROC, name)
+            END;
 
-        unit := parser.unit;
+            check(PROG.openScope(unit, proc.proc), pos, 116);
 
-        call := procflag(parser, _import, TRUE);
+            proc._type := PROG.enterType(PROG.tPROCEDURE, TARGETS.AdrSize, 0, unit);
+            t := proc._type;
+            t.align := TARGETS.AdrSize;
+            t.call  := call;
 
-        getpos(parser, pos);
-        pos1 := pos;
-        checklex(parser, SCAN.lxIDENT);
-        line := pos.line;
+            FormalParameters(parser, t);
 
-        IF _import # NIL THEN
-            proc := IdentDef(parser, PROG.idIMP, name);
-            proc._import := _import;
-            IF _import.name = "" THEN
-                COPY(name.s, _import.name)
+            IF parser.sym = SCAN.lxLSQUARE THEN
+                getpos(parser, pos2);
+                check((TARGETS.CPU = TARGETS.cpuTHUMB) & (TARGETS.OS = TARGETS.osNONE), pos2, 24);
+                Next(parser);
+                getpos(parser, pos2);
+                ConstExpression(parser, iv);
+                check(iv.typ = ARITH.tINTEGER, pos2, 43);
+                check((0 <= ARITH.Int(iv)) & (ARITH.Int(iv) <= THUMB.maxIVT), pos2, 46);
+                check(THUMB.SetIV(ARITH.Int(iv)), pos2, 121);
+                checklex(parser, SCAN.lxRSQUARE);
+                Next(parser);
+                handler := TRUE
             END;
-            PROG.program.procs.last(PROG.PROC)._import := _import
-        ELSE
-            proc := IdentDef(parser, PROG.idPROC, name)
-        END;
 
-        check(PROG.openScope(unit, proc.proc), pos, 116);
+            codeProc := call IN {PROG.code, PROG._code};
 
-        proc._type := PROG.enterType(PROG.tPROCEDURE, TARGETS.AdrSize, 0, unit);
-        t := proc._type;
-        t.align := TARGETS.AdrSize;
-        t.call  := call;
+            IF call IN {PROG.systemv, PROG._systemv} THEN
+                check(t.parSize <= PROG.MAXSYSVPARAM, pos, 120)
+            END;
 
-        FormalParameters(parser, t);
+            param := t.params.first(PROG.PARAM);
+            WHILE param # NIL DO
+                ident := PROG.addIdent(unit, param.name, PROG.idPARAM);
+                ASSERT(ident # NIL);
+                ident._type := param._type;
+                ident.offset := param.offset;
+                IF param.vPar THEN
+                    ident.typ := PROG.idVPAR
+                END;
+                param := param.next(PROG.PARAM)
+            END;
 
-        IF parser.sym = SCAN.lxLSQUARE THEN
-            getpos(parser, pos2);
-            check((TARGETS.CPU = TARGETS.cpuTHUMB) & (TARGETS.OS = TARGETS.osNONE), pos2, 24);
-            Next(parser);
-            getpos(parser, pos2);
-            ConstExpression(parser, iv);
-            check(iv.typ = ARITH.tINTEGER, pos2, 43);
-            check((0 <= ARITH.Int(iv)) & (ARITH.Int(iv) <= THUMB.maxIVT), pos2, 46);
-            check(THUMB.SetIV(ARITH.Int(iv)), pos2, 121);
-            checklex(parser, SCAN.lxRSQUARE);
-            Next(parser);
-            handler := TRUE
-        END;
+            IF _import = NIL THEN
+                label := IL.NewLabel();
+                proc.proc.label := label;
+                proc.proc.used  := handler;
+                IF handler THEN
+                    IL.AddCmd2(IL.opHANDLER, label, ARITH.Int(iv))
+                END
+            END;
 
-        codeProc := call IN {PROG.code, PROG._code};
+            IF codeProc THEN
+                enter := IL.EnterC(label);
+                comma := FALSE;
+                WHILE (parser.sym # SCAN.lxSEMI) OR comma DO
+                    getpos(parser, pos2);
+                    ConstExpression(parser, code);
+                    check(code.typ = ARITH.tINTEGER, pos2, 43);
+                    IF TARGETS.WordSize > TARGETS.InstrSize THEN
+                        CASE TARGETS.InstrSize OF
+                        |1: check(ARITH.range(code, 0, 255), pos, 42)
+                        |2: check(ARITH.range(code, 0, 65535), pos, 110)
+                        END
+                    END;
+                    IL.AddCmd(IL.opCODE, ARITH.getInt(code));
+                    comma := parser.sym = SCAN.lxCOMMA;
+                    IF comma THEN
+                        Next(parser)
+                    ELSE
+                        checklex(parser, SCAN.lxSEMI)
+                    END
+                END
+            END;
 
-        IF call IN {PROG.systemv, PROG._systemv} THEN
-            check(t.parSize <= PROG.MAXSYSVPARAM, pos, 120)
-        END;
+            checklex(parser, SCAN.lxSEMI);
+            Next(parser);
 
-        param := t.params.first(PROG.PARAM);
-        WHILE param # NIL DO
-            ident := PROG.addIdent(unit, param.name, PROG.idPARAM);
-            ASSERT(ident # NIL);
-            ident._type := param._type;
-            ident.offset := param.offset;
-            IF param.vPar THEN
-                ident.typ := PROG.idVPAR
-            END;
-            param := param.next(PROG.PARAM)
-        END;
+            IF _import = NIL THEN
 
-        IF _import = NIL THEN
-            label := IL.NewLabel();
-            proc.proc.label := label;
-            proc.proc.used  := handler;
-            IF handler THEN
-                IL.AddCmd2(IL.opHANDLER, label, ARITH.Int(iv))
-            END
-        END;
+                IF parser.main & proc.export & TARGETS.Dll THEN
+                    IF TARGETS.target = TARGETS.KolibriOSDLL THEN
+                        check((proc.name.s # "lib_init") & (proc.name.s # "version"), pos, 114)
+                    END;
+                    IL.AddExp(label, proc.name.s);
+                    proc.proc.used := TRUE
+                END;
 
-        IF codeProc THEN
-            enter := IL.EnterC(label);
-            comma := FALSE;
-            WHILE (parser.sym # SCAN.lxSEMI) OR comma DO
-                getpos(parser, pos2);
-                ConstExpression(parser, code);
-                check(code.typ = ARITH.tINTEGER, pos2, 43);
-                IF TARGETS.WordSize > TARGETS.InstrSize THEN
-                    CASE TARGETS.InstrSize OF
-                    |1: check(ARITH.range(code, 0, 255), pos, 42)
-                    |2: check(ARITH.range(code, 0, 65535), pos, 110)
-                    END
+                IF ~codeProc THEN
+                    b := DeclarationSequence(parser)
                 END;
-                IL.AddCmd(IL.opCODE, ARITH.getInt(code));
-                comma := parser.sym = SCAN.lxCOMMA;
-                IF comma THEN
-                    Next(parser)
-                ELSE
-                    checklex(parser, SCAN.lxSEMI)
-                END
-            END
-        END;
 
-        checklex(parser, SCAN.lxSEMI);
-        Next(parser);
+                PROG.ResetLocSize;
+                IF call IN {PROG._win64, PROG.win64} THEN
+                    fparams := PROG.getFloatParamsPos(proc._type, 3, int, flt);
+                    enter := IL.Enter(label, LSL(ORD(fparams), 5) + MIN(proc._type.parSize, 4))
+                ELSIF call IN {PROG._systemv, PROG.systemv} THEN
+                    fparams := PROG.getFloatParamsPos(proc._type, PROG.MAXSYSVPARAM - 1, int, flt);
+                    enter := IL.Enter(label, -(LSL(ORD(fparams), 5) + proc._type.parSize))
+                ELSIF codeProc THEN
+
+                ELSIF call IN {PROG.fastcall, PROG._fastcall} THEN
+                    enter := IL.Enter(label, proc._type.parSize)
+                ELSE
+                    enter := IL.Enter(label, 0)
+                END;
+                proc.proc.enter := enter;
 
-        IF _import = NIL THEN
+                IF ~codeProc & (parser.sym = SCAN.lxBEGIN) THEN
+                    Next(parser);
+                    parser.StatSeq(parser)
+                END;
 
-            IF parser.main & proc.export & TARGETS.Dll THEN
-                IF TARGETS.target = TARGETS.KolibriOSDLL THEN
-                    check((proc.name.s # "lib_init") & (proc.name.s # "version"), pos, 114)
+                IF ~codeProc & (t.base # NIL) THEN
+                    checklex(parser, SCAN.lxRETURN);
+                    NextPos(parser, pos);
+                    parser.expression(parser, e);
+                    check(parser.chkreturn(parser, e, t.base, pos), pos, 87)
                 END;
-                IL.AddExp(label, proc.name.s);
-                proc.proc.used := TRUE
-            END;
 
-            IF ~codeProc THEN
-                b := DeclarationSequence(parser)
-            END;
+                IF ~codeProc THEN
+                    proc.proc.leave := IL.Leave(t.base # NIL, (t.base # NIL) & (t.base.typ = PROG.tREAL), PROG.program.locsize,
+                        t.parSize * ORD((t.call IN PROG.callee_clean_up) OR (t.call IN {PROG.systemv, PROG._systemv})));
+                    enter.param2 := PROG.program.locsize;
+                    checklex(parser, SCAN.lxEND)
+                ELSE
+                    proc.proc.leave := IL.LeaveC()
+                END;
 
-            PROG.ResetLocSize;
-            IF call IN {PROG._win64, PROG.win64} THEN
-                fparams := PROG.getFloatParamsPos(proc._type, 3, int, flt);
-                enter := IL.Enter(label, LSL(ORD(fparams), 5) + MIN(proc._type.parSize, 4))
-            ELSIF call IN {PROG._systemv, PROG.systemv} THEN
-                fparams := PROG.getFloatParamsPos(proc._type, PROG.MAXSYSVPARAM - 1, int, flt);
-                enter := IL.Enter(label, -(LSL(ORD(fparams), 5) + proc._type.parSize))
-            ELSIF codeProc THEN
-
-            ELSIF call IN {PROG.fastcall, PROG._fastcall} THEN
-                enter := IL.Enter(label, proc._type.parSize)
-            ELSE
-                enter := IL.Enter(label, 0)
+                IF (TARGETS.CPU = TARGETS.cpuMSP430) & ~codeProc THEN
+                    check(MSP430.CheckProcDataSize(enter.param2 + proc._type.parSize, PROG.program.options.ram), pos1, 63);
+                    enter.param2 := enter.param2 * 65536 + line;
+                    enter.param3 := IL.codes.errlabels[10]
+                END
             END;
-            proc.proc.enter := enter;
 
-            IF ~codeProc & (parser.sym = SCAN.lxBEGIN) THEN
+            IF parser.sym = SCAN.lxEND THEN
                 Next(parser);
-                parser.StatSeq(parser)
+                IF parser.sym = SCAN.lxIDENT THEN
+                    getpos(parser, pos);
+                    endname := parser.lex.ident;
+                    IF ~codeProc & (_import = NIL) THEN
+                        check(PROG.IdEq(endname, name), pos, 60);
+                        ExpectSym(parser, SCAN.lxSEMI);
+                        Next(parser)
+                    ELSE
+                        IF PROG.IdEq(endname, parser.unit.name) THEN
+                            ExpectSym(parser, SCAN.lxPOINT);
+                            Next(parser);
+                            endmod := TRUE
+                        ELSIF PROG.IdEq(endname, name) THEN
+                            ExpectSym(parser, SCAN.lxSEMI);
+                            Next(parser)
+                        ELSE
+                            error(pos, 60)
+                        END
+                    END
+                ELSIF parser.sym = SCAN.lxSEMI THEN
+                    Next(parser)
+                ELSE
+                    checklex(parser, SCAN.lxIDENT)
+                END
             END;
 
-            IF ~codeProc & (t.base # NIL) THEN
-                checklex(parser, SCAN.lxRETURN);
-                NextPos(parser, pos);
-                parser.expression(parser, e);
-                check(parser.chkreturn(parser, e, t.base, pos), pos, 87)
-            END;
+            PROG.closeScope(unit);
 
-            IF ~codeProc THEN
-                proc.proc.leave := IL.Leave(t.base # NIL, (t.base # NIL) & (t.base.typ = PROG.tREAL), PROG.program.locsize,
-                    t.parSize * ORD((t.call IN PROG.callee_clean_up) OR (t.call IN {PROG.systemv, PROG._systemv})));
-                enter.param2 := PROG.program.locsize;
-                checklex(parser, SCAN.lxEND)
-            ELSE
-                proc.proc.leave := IL.LeaveC()
-            END;
+            RETURN endmod
+        END ProcDeclaration;
 
-            IF (TARGETS.CPU = TARGETS.cpuMSP430) & ~codeProc THEN
-                check(MSP430.CheckProcDataSize(enter.param2 + proc._type.parSize, PROG.program.options.ram), pos1, 63);
-                enter.param2 := enter.param2 * 65536 + line;
-                enter.param3 := IL.codes.errlabels[10]
+
+    BEGIN
+        IF parser.sym = SCAN.lxCONST THEN
+            Next(parser);
+            WHILE parser.sym = SCAN.lxIDENT DO
+                ConstTypeDeclaration(parser, TRUE)
             END
         END;
 
-        IF parser.sym = SCAN.lxEND THEN
+        IF parser.sym = SCAN.lxTYPE THEN
             Next(parser);
-            IF parser.sym = SCAN.lxIDENT THEN
-                getpos(parser, pos);
-                endname := parser.lex.ident;
-                IF ~codeProc & (_import = NIL) THEN
-                    check(PROG.IdEq(endname, name), pos, 60);
-                    ExpectSym(parser, SCAN.lxSEMI);
-                    Next(parser)
-                ELSE
-                    IF PROG.IdEq(endname, parser.unit.name) THEN
-                        ExpectSym(parser, SCAN.lxPOINT);
-                        Next(parser);
-                        endmod := TRUE
-                    ELSIF PROG.IdEq(endname, name) THEN
-                        ExpectSym(parser, SCAN.lxSEMI);
-                        Next(parser)
-                    ELSE
-                        error(pos, 60)
-                    END
-                END
-            ELSIF parser.sym = SCAN.lxSEMI THEN
-                Next(parser)
-            ELSE
-                checklex(parser, SCAN.lxIDENT)
+            WHILE parser.sym = SCAN.lxIDENT DO
+                ConstTypeDeclaration(parser, FALSE)
             END
         END;
 
-        PROG.closeScope(unit);
-
-        RETURN endmod
-    END ProcDeclaration;
-
+        ptr := PROG.linkPtr(parser.unit);
+        IF ptr # NIL THEN
+            pos.line := ptr.pos.line;
+            pos.col  := ptr.pos.col;
+            pos.parser := parser;
+            IF ptr.notRecord THEN
+                error(pos, 58)
+            ELSE
+                error(pos, 48)
+            END
+        END;
 
-BEGIN
-    IF parser.sym = SCAN.lxCONST THEN
-        Next(parser);
-        WHILE parser.sym = SCAN.lxIDENT DO
-            ConstTypeDeclaration(parser, TRUE)
-        END
-    END;
+        IF parser.sym = SCAN.lxVAR THEN
+            Next(parser);
+            IF parser.sym = SCAN.lxIDENT THEN
+                VarDeclaration(parser)
+            END
+        END;
 
-    IF parser.sym = SCAN.lxTYPE THEN
-        Next(parser);
-        WHILE parser.sym = SCAN.lxIDENT DO
-            ConstTypeDeclaration(parser, FALSE)
+        endmod := FALSE;
+        WHILE ~endmod & (parser.sym = SCAN.lxPROCEDURE) DO
+            Next(parser);
+            endmod := ProcDeclaration(parser)
         END
-    END;
 
-    ptr := PROG.linkPtr(parser.unit);
-    IF ptr # NIL THEN
-        pos.line := ptr.pos.line;
-        pos.col  := ptr.pos.col;
-        pos.parser := parser;
-        IF ptr.notRecord THEN
-            error(pos, 58)
-        ELSE
-            error(pos, 48)
-        END
-    END;
+        RETURN endmod
+    END DeclarationSequence;
 
-    IF parser.sym = SCAN.lxVAR THEN
-        Next(parser);
-        IF parser.sym = SCAN.lxIDENT THEN
-            VarDeclaration(parser)
-        END
-    END;
 
-    endmod := FALSE;
-    WHILE ~endmod & (parser.sym = SCAN.lxPROCEDURE) DO
-        Next(parser);
-        endmod := ProcDeclaration(parser)
-    END
+PROCEDURE parse (parser: PARSER);
+    VAR
+        unit:     PROG.UNIT;
+        label:    INTEGER;
+        name:     INTEGER;
+        endmod:   BOOLEAN;
+        errlabel: INTEGER;
+        errno:    INTEGER;
+        ident:    PROG.IDENT;
 
-    RETURN endmod
-END DeclarationSequence;
+    BEGIN
+        ASSERT(parser # NIL);
+        ASSERT(parser.scanner # NIL);
 
+        ExpectSym(parser, SCAN.lxMODULE);
+        ExpectSym(parser, SCAN.lxIDENT);
 
-PROCEDURE parse (parser: PARSER);
-VAR
-    unit:     PROG.UNIT;
-    label:    INTEGER;
-    name:     INTEGER;
-    endmod:   BOOLEAN;
-    errlabel: INTEGER;
-    errno:    INTEGER;
-    ident:    PROG.IDENT;
-
-BEGIN
-    ASSERT(parser # NIL);
-    ASSERT(parser.scanner # NIL);
-
-    ExpectSym(parser, SCAN.lxMODULE);
-    ExpectSym(parser, SCAN.lxIDENT);
-
-    IF ~parser.main THEN
-        check1(parser.lex.ident.s = parser.modname, parser, 23)
-    END;
+        IF ~parser.main THEN
+            check1(parser.lex.ident.s = parser.modname, parser, 23)
+        END;
 
-    unit := PROG.newUnit(parser.lex.ident);
-    unit.fname := parser.fname;
-    parser.unit := unit;
+        unit := PROG.newUnit(parser.lex.ident);
+        unit.fname := parser.fname;
+        parser.unit := unit;
 
-    ExpectSym(parser, SCAN.lxSEMI);
+        ExpectSym(parser, SCAN.lxSEMI);
 
-    Next(parser);
-    IF parser.sym = SCAN.lxIMPORT THEN
-        ImportList(parser)
-    END;
+        Next(parser);
+        IF parser.sym = SCAN.lxIMPORT THEN
+            ImportList(parser)
+        END;
 
-    INC(modules);
+        INC(modules);
 
-    CONSOLE.String("compiling ");
-    CONSOLE.String("("); CONSOLE.Int(modules); CONSOLE.String(") ");
-    CONSOLE.String(unit.name.s);
-    IF unit.sysimport THEN
-        CONSOLE.String(" (SYSTEM)")
-    END;
-    CONSOLE.Ln;
+        CONSOLE.String("compiling ");
+        CONSOLE.String("("); CONSOLE.Int(modules); CONSOLE.String(") ");
+        CONSOLE.String(unit.name.s);
+        IF unit.sysimport THEN
+            CONSOLE.String(" (SYSTEM)")
+        END;
+        CONSOLE.Ln;
 
-    IF PROG.program.options.uses THEN
-        ident := unit.idents.first(PROG.IDENT);
-        WHILE ident # NIL DO
-            IF (ident.typ = PROG.idMODULE) & (ident.unit # PROG.program.sysunit) THEN
-                CONSOLE.String("    "); CONSOLE.String(ident.unit.fname); CONSOLE.Ln
+        IF PROG.program.options.uses THEN
+            ident := unit.idents.first(PROG.IDENT);
+            WHILE ident # NIL DO
+                IF (ident.typ = PROG.idMODULE) & (ident.unit # PROG.program.sysunit) THEN
+                    CONSOLE.String("    "); CONSOLE.String(ident.unit.fname); CONSOLE.Ln
+                END;
+                ident := ident.next(PROG.IDENT)
             END;
-            ident := ident.next(PROG.IDENT)
+            CONSOLE.Ln
         END;
-        CONSOLE.Ln
-    END;
 
-    IF TARGETS.CPU IN {TARGETS.cpuX86, TARGETS.cpuAMD64} THEN
-        IL.fname(parser.fname)
-    END;
+        IF TARGETS.CPU IN {TARGETS.cpuX86, TARGETS.cpuAMD64} THEN
+            IL.fname(parser.fname)
+        END;
 
-    label := IL.NewLabel();
-    IL.Jmp(IL.opJMP, label);
+        label := IL.NewLabel();
+        IL.Jmp(IL.opJMP, label);
 
-    name := IL.putstr(unit.name.s);
+        name := IL.putstr(unit.name.s);
 
-    errlabel := IL.NewLabel();
-    IL.SetLabel(errlabel);
-    IL.StrAdr(name);
-    IL.Param1;
-    IL.AddCmd(IL.opPUSHC, modules);
-    IL.AddCmd0(IL.opERR);
+        errlabel := IL.NewLabel();
+        IL.SetLabel(errlabel);
+        IL.StrAdr(name);
+        IL.Param1;
+        IL.AddCmd(IL.opPUSHC, modules);
+        IL.AddCmd0(IL.opERR);
 
-    FOR errno := 1 TO LEN(IL.codes.errlabels) - 1 DO
-        IL.SetErrLabel(errno);
-        IL.AddCmd(IL.opPUSHC, errno);
-        IL.Jmp(IL.opJMP, errlabel)
-    END;
+        FOR errno := 1 TO LEN(IL.codes.errlabels) - 1 DO
+            IL.SetErrLabel(errno);
+            IL.AddCmd(IL.opPUSHC, errno);
+            IL.Jmp(IL.opJMP, errlabel)
+        END;
 
-    endmod := DeclarationSequence(parser);
+        endmod := DeclarationSequence(parser);
 
-    IL.SetLabel(label);
+        IL.SetLabel(label);
 
-    IF ~endmod THEN
+        IF ~endmod THEN
 
-        IF parser.sym = SCAN.lxBEGIN THEN
-            Next(parser);
-            parser.StatSeq(parser)
-        END;
+            IF parser.sym = SCAN.lxBEGIN THEN
+                Next(parser);
+                parser.StatSeq(parser)
+            END;
 
-        checklex(parser, SCAN.lxEND);
+            checklex(parser, SCAN.lxEND);
 
-        ExpectSym(parser, SCAN.lxIDENT);
-        check1(parser.lex.ident.s = unit.name.s, parser, 25);
-        ExpectSym(parser, SCAN.lxPOINT)
-    END;
+            ExpectSym(parser, SCAN.lxIDENT);
+            check1(parser.lex.ident.s = unit.name.s, parser, 25);
+            ExpectSym(parser, SCAN.lxPOINT)
+        END;
 
-    INC(lines, parser.lex.pos.line);
-    PROG.closeUnit(unit)
-END parse;
+        INC(lines, parser.lex.pos.line);
+        PROG.closeUnit(unit)
+    END parse;
 
 
 PROCEDURE open (parser: PARSER; modname, FileExt: ARRAY OF CHAR): BOOLEAN;
-BEGIN
-    ASSERT(parser # NIL);
+    BEGIN
+        ASSERT(parser # NIL);
 
-    STRINGS.append(parser.fname, modname);
-    STRINGS.append(parser.fname, FileExt);
-    STRINGS.append(parser.modname, modname);
+        STRINGS.append(parser.fname, modname);
+        STRINGS.append(parser.fname, FileExt);
+        STRINGS.append(parser.modname, modname);
 
-    parser.scanner := SCAN.open(parser.fname)
+        parser.scanner := SCAN.open(parser.fname)
 
-    RETURN parser.scanner # NIL
-END open;
+        RETURN parser.scanner # NIL
+    END open;
 
 
 PROCEDURE NewParser (): PARSER;
-VAR
-    pars:  PARSER;
-    citem: C.ITEM;
+    VAR
+        pars:  PARSER;
+        citem: C.ITEM;
 
-BEGIN
-    citem := C.pop(parsers);
-    IF citem = NIL THEN
-        NEW(pars)
-    ELSE
-        pars := citem(PARSER)
-    END
+    BEGIN
+        citem := C.pop(parsers);
+        IF citem = NIL THEN
+            NEW(pars)
+        ELSE
+            pars := citem(PARSER)
+        END
 
-    RETURN pars
-END NewParser;
+        RETURN pars
+    END NewParser;
 
 
 PROCEDURE create* (path, lib_path: PATH; StatSeq: STATPROC; expression, designator: EXPRPROC; chkreturn: RETPROC): PARSER;
-VAR
-    parser: PARSER;
-
-BEGIN
-    parser := NewParser();
-
-    parser.path     := path;
-    parser.lib_path := lib_path;
-    parser.ext      := UTILS.FILE_EXT;
-    parser.fname    := path;
-    parser.modname  := "";
-    parser.scanner  := NIL;
-    parser.unit     := NIL;
-    parser.constexp := FALSE;
-    parser.main     := FALSE;
-
-    parser.open       := open;
-    parser.parse      := parse;
-    parser.StatSeq    := StatSeq;
-    parser.expression := expression;
-    parser.designator := designator;
-    parser.chkreturn  := chkreturn;
-    parser.create     := create
+    VAR
+        parser: PARSER;
 
-    RETURN parser
-END create;
+    BEGIN
+        parser := NewParser();
+
+        parser.path     := path;
+        parser.lib_path := lib_path;
+        parser.ext      := UTILS.FILE_EXT;
+        parser.fname    := path;
+        parser.modname  := "";
+        parser.scanner  := NIL;
+        parser.unit     := NIL;
+        parser.constexp := FALSE;
+        parser.main     := FALSE;
+
+        parser.open       := open;
+        parser.parse      := parse;
+        parser.StatSeq    := StatSeq;
+        parser.expression := expression;
+        parser.designator := designator;
+        parser.chkreturn  := chkreturn;
+        parser.create     := create
+
+        RETURN parser
+    END create;
 
 
 PROCEDURE init* (options: PROG.OPTIONS);
-BEGIN
-    PROG.create(options);
-    parsers := C.create();
-    lines   := 0;
-    modules := 0
-END init;
+    BEGIN
+        PROG.create(options);
+        parsers := C.create();
+        lines   := 0;
+        modules := 0
+    END init;
 
 
 END PARS.

+ 100 - 107
source/PATHS.ob07

@@ -1,11 +1,4 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2018-2021, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE PATHS;
+MODULE PATHS;
 
 IMPORT STRINGS, UTILS;
 
@@ -23,129 +16,129 @@ TYPE
 
 
 PROCEDURE split* (fname: ARRAY OF CHAR; VAR path, name, ext: ARRAY OF CHAR);
-VAR
-    pos1, pos2, len: INTEGER;
+    VAR
+        pos1, pos2, len: INTEGER;
 
-BEGIN
-    len := LENGTH(fname);
-    pos1 := len - 1;
-    pos2 := pos1;
-    STRINGS.search(fname, pos1, slash, FALSE);
-    STRINGS.search(fname, pos2,   ".", FALSE);
+    BEGIN
+        len := LENGTH(fname);
+        pos1 := len - 1;
+        pos2 := pos1;
+        STRINGS.search(fname, pos1, slash, FALSE);
+        STRINGS.search(fname, pos2,   ".", FALSE);
 
-    path := fname;
-    path[pos1 + 1] := 0X;
+        path := fname;
+        path[pos1 + 1] := 0X;
 
-    IF (pos2 = -1) OR (pos2 < pos1) THEN
-        pos2 := len
-    END;
+        IF (pos2 = -1) OR (pos2 < pos1) THEN
+            pos2 := len
+        END;
 
-    INC(pos1);
+        INC(pos1);
 
-    STRINGS.copy(fname, name, pos1, 0, pos2 - pos1);
-    name[pos2 - pos1] := 0X;
-    STRINGS.copy(fname, ext, pos2, 0, len - pos2);
-    ext[len - pos2] := 0X
-END split;
+        STRINGS.copy(fname, name, pos1, 0, pos2 - pos1);
+        name[pos2 - pos1] := 0X;
+        STRINGS.copy(fname, ext, pos2, 0, len - pos2);
+        ext[len - pos2] := 0X
+    END split;
 
 
 PROCEDURE RelPath* (absolute, relative: ARRAY OF CHAR; VAR res: ARRAY OF CHAR);
-VAR
-    i, j: INTEGER;
-    error: BOOLEAN;
-
-BEGIN
-    COPY(absolute, res);
-    i := LENGTH(res) - 1;
-    WHILE (i >= 0) & (res[i] # slash) DO
-        DEC(i)
-    END;
-
-    INC(i);
-    res[i] := 0X;
-
-    error := FALSE;
-    j := 0;
-    WHILE (relative[j] = ".") & (relative[j + 1] = slash) DO
-        INC(j, 2)
-    ELSIF relative[j] = slash DO
-        INC(j)
-    END;
-
-    WHILE ~error & (relative[j] # 0X) DO
-        IF (relative[j] = ".") & (relative[j + 1] = ".") & (relative[j + 2] = slash) & (i > 0) & (res[i - 1] = slash) THEN
-            DEC(i, 2);
-            WHILE (i >= 0) & (res[i] # slash) DO
-                DEC(i)
-            END;
-            IF i < 0 THEN
-                error := TRUE
+    VAR
+        i, j: INTEGER;
+        error: BOOLEAN;
+
+    BEGIN
+        COPY(absolute, res);
+        i := LENGTH(res) - 1;
+        WHILE (i >= 0) & (res[i] # slash) DO
+            DEC(i)
+        END;
+
+        INC(i);
+        res[i] := 0X;
+
+        error := FALSE;
+        j := 0;
+        WHILE (relative[j] = ".") & (relative[j + 1] = slash) DO
+            INC(j, 2)
+        ELSIF relative[j] = slash DO
+            INC(j)
+        END;
+
+        WHILE ~error & (relative[j] # 0X) DO
+            IF (relative[j] = ".") & (relative[j + 1] = ".") & (relative[j + 2] = slash) & (i > 0) & (res[i - 1] = slash) THEN
+                DEC(i, 2);
+                WHILE (i >= 0) & (res[i] # slash) DO
+                    DEC(i)
+                END;
+                IF i < 0 THEN
+                    error := TRUE
+                ELSE
+                    INC(i);
+                    INC(j, 3)
+                END
             ELSE
+                res[i] := relative[j];
                 INC(i);
-                INC(j, 3)
+                INC(j)
             END
+        END;
+
+        IF error THEN
+            COPY(relative, res)
         ELSE
-            res[i] := relative[j];
-            INC(i);
-            INC(j)
+            res[i] := 0X
         END
-    END;
-
-    IF error THEN
-        COPY(relative, res)
-    ELSE
-        res[i] := 0X
-    END
 
-END RelPath;
+    END RelPath;
 
 
 PROCEDURE DelSlashes* (VAR path: ARRAY OF CHAR);
-VAR
-    i, j, k: INTEGER;
-    c: CHAR;
-
-BEGIN
-    i := 0;
-    j := 0;
-    k := 0;
-    REPEAT
-        c := path[j];
-        INC(j);
-        IF c = slash THEN
-            INC(k)
-        ELSE
-            k := 0
-        END;
-        IF k <= 1 THEN
+    VAR
+        i, j, k: INTEGER;
+        c: CHAR;
+
+    BEGIN
+        i := 0;
+        j := 0;
+        k := 0;
+        REPEAT
+            c := path[j];
+            INC(j);
+            IF c = slash THEN
+                INC(k)
+            ELSE
+                k := 0
+            END;
+            IF k <= 1 THEN
+                path[i] := c;
+                INC(i)
+            END
+        UNTIL c = 0X;
+
+        i := 0;
+        j := 0;
+        REPEAT
+            c := path[j];
+            INC(j);
             path[i] := c;
-            INC(i)
-        END
-    UNTIL c = 0X;
-
-    i := 0;
-    j := 0;
-    REPEAT
-        c := path[j];
-        INC(j);
-        path[i] := c;
-        INC(i);
-        IF (c = slash) & (path[j] = ".") & (path[j + 1] = slash) THEN
-            INC(j, 2)
-        END
-    UNTIL c = 0X
-END DelSlashes;
+            INC(i);
+            IF (c = slash) & (path[j] = ".") & (path[j + 1] = slash) THEN
+                INC(j, 2)
+            END
+        UNTIL c = 0X
+    END DelSlashes;
 
 
 PROCEDURE isRelative* (path: ARRAY OF CHAR): BOOLEAN;
-    RETURN UTILS.isRelative(path)
-END isRelative;
+        RETURN UTILS.isRelative(path)
+    END isRelative;
 
 
 PROCEDURE GetCurrentDirectory* (VAR path: ARRAY OF CHAR);
-BEGIN
-    UTILS.GetCurrentDirectory(path)
-END GetCurrentDirectory;
+    BEGIN
+        UTILS.GetCurrentDirectory(path)
+    END GetCurrentDirectory;
 
 
 END PATHS.

+ 415 - 422
source/PE32.ob07

@@ -1,11 +1,4 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2018-2020, 2023, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE PE32;
+MODULE PE32;
 
 IMPORT BIN, LISTS, UTILS, WR := WRITER, CHL := CHUNKLISTS;
 
@@ -158,544 +151,544 @@ VAR
 
 
 PROCEDURE Export (program: BIN.PROGRAM; name: INTEGER; VAR ExportDir: IMAGE_EXPORT_DIRECTORY): INTEGER;
-BEGIN
+    BEGIN
 
-    ExportDir.Characteristics        :=  0;
-    ExportDir.TimeDateStamp          :=  FileHeader.TimeDateStamp;
-    ExportDir.MajorVersion           :=  0X;
-    ExportDir.MinorVersion           :=  0X;
-    ExportDir.Name                   :=  name;
-    ExportDir.Base                   :=  0;
-    ExportDir.NumberOfFunctions      :=  LISTS.count(program.exp_list);
-    ExportDir.NumberOfNames          :=  ExportDir.NumberOfFunctions;
-    ExportDir.AddressOfFunctions     :=  SIZE_OF_IMAGE_EXPORT_DIRECTORY;
-    ExportDir.AddressOfNames         :=  ExportDir.AddressOfFunctions + ExportDir.NumberOfFunctions * SIZE_OF_DWORD;
-    ExportDir.AddressOfNameOrdinals  :=  ExportDir.AddressOfNames     + ExportDir.NumberOfFunctions * SIZE_OF_DWORD
+        ExportDir.Characteristics        :=  0;
+        ExportDir.TimeDateStamp          :=  FileHeader.TimeDateStamp;
+        ExportDir.MajorVersion           :=  0X;
+        ExportDir.MinorVersion           :=  0X;
+        ExportDir.Name                   :=  name;
+        ExportDir.Base                   :=  0;
+        ExportDir.NumberOfFunctions      :=  LISTS.count(program.exp_list);
+        ExportDir.NumberOfNames          :=  ExportDir.NumberOfFunctions;
+        ExportDir.AddressOfFunctions     :=  SIZE_OF_IMAGE_EXPORT_DIRECTORY;
+        ExportDir.AddressOfNames         :=  ExportDir.AddressOfFunctions + ExportDir.NumberOfFunctions * SIZE_OF_DWORD;
+        ExportDir.AddressOfNameOrdinals  :=  ExportDir.AddressOfNames     + ExportDir.NumberOfFunctions * SIZE_OF_DWORD
 
-    RETURN SIZE_OF_IMAGE_EXPORT_DIRECTORY + ExportDir.NumberOfFunctions * (2 * SIZE_OF_DWORD + SIZE_OF_WORD)
-END Export;
+        RETURN SIZE_OF_IMAGE_EXPORT_DIRECTORY + ExportDir.NumberOfFunctions * (2 * SIZE_OF_DWORD + SIZE_OF_WORD)
+    END Export;
 
 
 PROCEDURE GetProcCount (lib: BIN.IMPRT): INTEGER;
-VAR
-    imp: BIN.IMPRT;
-    res: INTEGER;
+    VAR
+        imp: BIN.IMPRT;
+        res: INTEGER;
 
-BEGIN
-    res := 0;
-    imp := lib.next(BIN.IMPRT);
-    WHILE (imp # NIL) & (imp.label # 0) DO
-        INC(res);
-        imp := imp.next(BIN.IMPRT)
-    END
+    BEGIN
+        res := 0;
+        imp := lib.next(BIN.IMPRT);
+        WHILE (imp # NIL) & (imp.label # 0) DO
+            INC(res);
+            imp := imp.next(BIN.IMPRT)
+        END
 
-    RETURN res
-END GetProcCount;
+        RETURN res
+    END GetProcCount;
 
 
 PROCEDURE GetImportSize (imp_list: LISTS.LIST): INTEGER;
-VAR
-    imp: BIN.IMPRT;
-    proccnt: INTEGER;
-    procoffs: INTEGER;
-    OriginalCurrentThunk,
-    CurrentThunk: INTEGER;
-
-BEGIN
-    libcnt  := 0;
-    proccnt := 0;
-    imp  := imp_list.first(BIN.IMPRT);
-    WHILE imp # NIL DO
-        IF imp.label = 0 THEN
-            INC(libcnt)
-        ELSE
-            INC(proccnt)
-        END;
-        imp := imp.next(BIN.IMPRT)
-    END;
-
-    procoffs := 0;
+    VAR
+        imp: BIN.IMPRT;
+        proccnt: INTEGER;
+        procoffs: INTEGER;
+        OriginalCurrentThunk,
+        CurrentThunk: INTEGER;
 
-    imp  := imp_list.first(BIN.IMPRT);
-    WHILE imp # NIL DO
-        IF imp.label = 0 THEN
-            imp.OriginalFirstThunk := procoffs;
-            imp.FirstThunk := procoffs + (GetProcCount(imp) + 1);
-            OriginalCurrentThunk := imp.OriginalFirstThunk;
-            CurrentThunk := imp.FirstThunk;
-            INC(procoffs, (GetProcCount(imp) + 1) * 2)
-        ELSE
-            imp.OriginalFirstThunk := OriginalCurrentThunk;
-            imp.FirstThunk := CurrentThunk;
-            INC(OriginalCurrentThunk);
-            INC(CurrentThunk)
+    BEGIN
+        libcnt  := 0;
+        proccnt := 0;
+        imp  := imp_list.first(BIN.IMPRT);
+        WHILE imp # NIL DO
+            IF imp.label = 0 THEN
+                INC(libcnt)
+            ELSE
+                INC(proccnt)
+            END;
+            imp := imp.next(BIN.IMPRT)
         END;
-        imp := imp.next(BIN.IMPRT)
-    END
 
-    RETURN (libcnt + 1) * 5 * SIZE_OF_DWORD + (proccnt + libcnt) * 2 * SizeOfWord
-END GetImportSize;
+        procoffs := 0;
+
+        imp  := imp_list.first(BIN.IMPRT);
+        WHILE imp # NIL DO
+            IF imp.label = 0 THEN
+                imp.OriginalFirstThunk := procoffs;
+                imp.FirstThunk := procoffs + (GetProcCount(imp) + 1);
+                OriginalCurrentThunk := imp.OriginalFirstThunk;
+                CurrentThunk := imp.FirstThunk;
+                INC(procoffs, (GetProcCount(imp) + 1) * 2)
+            ELSE
+                imp.OriginalFirstThunk := OriginalCurrentThunk;
+                imp.FirstThunk := CurrentThunk;
+                INC(OriginalCurrentThunk);
+                INC(CurrentThunk)
+            END;
+            imp := imp.next(BIN.IMPRT)
+        END
+
+        RETURN (libcnt + 1) * 5 * SIZE_OF_DWORD + (proccnt + libcnt) * 2 * SizeOfWord
+    END GetImportSize;
 
 
 PROCEDURE fixup* (program: BIN.PROGRAM; Address: VIRTUAL_ADDR; amd64: BOOLEAN);
-VAR
-    reloc: BIN.RELOC;
-    iproc: BIN.IMPRT;
-    code:  CHL.BYTELIST;
-    L, delta, delta0, AdrImp, offset: INTEGER;
+    VAR
+        reloc: BIN.RELOC;
+        iproc: BIN.IMPRT;
+        code:  CHL.BYTELIST;
+        L, delta, delta0, AdrImp, offset: INTEGER;
 
-BEGIN
-    AdrImp := Address.Import + (libcnt + 1) * 5 * SIZE_OF_DWORD;
-    code := program.code;
-    reloc := program.rel_list.first(BIN.RELOC);
-    delta0 := 3 - 7 * ORD(amd64) - Address.Code;
+    BEGIN
+        AdrImp := Address.Import + (libcnt + 1) * 5 * SIZE_OF_DWORD;
+        code := program.code;
+        reloc := program.rel_list.first(BIN.RELOC);
+        delta0 := 3 - 7 * ORD(amd64) - Address.Code;
 
-    WHILE reloc # NIL DO
+        WHILE reloc # NIL DO
 
-        offset := reloc.offset;
-        L := BIN.get32le(code, offset);
-        delta := delta0 - offset;
+            offset := reloc.offset;
+            L := BIN.get32le(code, offset);
+            delta := delta0 - offset;
 
-        CASE reloc.opcode OF
-        |BIN.PICDATA:
-            INC(delta, L + Address.Data)
+            CASE reloc.opcode OF
+            |BIN.PICDATA:
+                INC(delta, L + Address.Data)
 
-        |BIN.PICCODE:
-            INC(delta, BIN.GetLabel(program, L) + Address.Code)
+            |BIN.PICCODE:
+                INC(delta, BIN.GetLabel(program, L) + Address.Code)
 
-        |BIN.PICBSS:
-            INC(delta, L + Address.Bss)
+            |BIN.PICBSS:
+                INC(delta, L + Address.Bss)
 
-        |BIN.PICIMP:
-            iproc := BIN.GetIProc(program, L);
-            INC(delta, iproc.FirstThunk * SizeOfWord + AdrImp)
-        END;
-        BIN.put32le(code, offset, delta);
+            |BIN.PICIMP:
+                iproc := BIN.GetIProc(program, L);
+                INC(delta, iproc.FirstThunk * SizeOfWord + AdrImp)
+            END;
+            BIN.put32le(code, offset, delta);
 
-        reloc := reloc.next(BIN.RELOC)
-    END
-END fixup;
+            reloc := reloc.next(BIN.RELOC)
+        END
+    END fixup;
 
 
 PROCEDURE WriteWord (w: WORD);
-BEGIN
-    WR.Write16LE(ORD(w))
-END WriteWord;
+    BEGIN
+        WR.Write16LE(ORD(w))
+    END WriteWord;
 
 
 PROCEDURE WriteName* (name: NAME);
-VAR
-    i, nameLen: INTEGER;
+    VAR
+        i, nameLen: INTEGER;
 
-BEGIN
-    nameLen := LENGTH(name);
+    BEGIN
+        nameLen := LENGTH(name);
 
-    FOR i := 0 TO nameLen - 1 DO
-        WR.WriteByte(ORD(name[i]))
-    END;
+        FOR i := 0 TO nameLen - 1 DO
+            WR.WriteByte(ORD(name[i]))
+        END;
 
-    i := LEN(name) - nameLen;
-    WHILE i > 0 DO
-        WR.WriteByte(0);
-        DEC(i)
-    END
+        i := LEN(name) - nameLen;
+        WHILE i > 0 DO
+            WR.WriteByte(0);
+            DEC(i)
+        END
 
-END WriteName;
+    END WriteName;
 
 
 PROCEDURE WriteSectionHeader* (h: IMAGE_SECTION_HEADER);
-VAR
-    i, nameLen: INTEGER;
+    VAR
+        i, nameLen: INTEGER;
 
-BEGIN
-    nameLen := LENGTH(h.Name);
+    BEGIN
+        nameLen := LENGTH(h.Name);
 
-    FOR i := 0 TO nameLen - 1 DO
-        WR.WriteByte(ORD(h.Name[i]))
-    END;
+        FOR i := 0 TO nameLen - 1 DO
+            WR.WriteByte(ORD(h.Name[i]))
+        END;
 
-    i := LEN(h.Name) - nameLen;
-    WHILE i > 0 DO
-        WR.WriteByte(0);
-        DEC(i)
-    END;
+        i := LEN(h.Name) - nameLen;
+        WHILE i > 0 DO
+            WR.WriteByte(0);
+            DEC(i)
+        END;
 
-    WR.Write32LE(h.VirtualSize);
-    WR.Write32LE(h.VirtualAddress);
-    WR.Write32LE(h.SizeOfRawData);
-    WR.Write32LE(h.PointerToRawData);
-    WR.Write32LE(h.PointerToRelocations);
-    WR.Write32LE(h.PointerToLinenumbers);
+        WR.Write32LE(h.VirtualSize);
+        WR.Write32LE(h.VirtualAddress);
+        WR.Write32LE(h.SizeOfRawData);
+        WR.Write32LE(h.PointerToRawData);
+        WR.Write32LE(h.PointerToRelocations);
+        WR.Write32LE(h.PointerToLinenumbers);
 
-    WriteWord(h.NumberOfRelocations);
-    WriteWord(h.NumberOfLinenumbers);
+        WriteWord(h.NumberOfRelocations);
+        WriteWord(h.NumberOfLinenumbers);
 
-    WR.Write32LE(h.Characteristics)
-END WriteSectionHeader;
+        WR.Write32LE(h.Characteristics)
+    END WriteSectionHeader;
 
 
 PROCEDURE WriteFileHeader* (h: IMAGE_FILE_HEADER);
-BEGIN
-    WriteWord(h.Machine);
-    WriteWord(h.NumberOfSections);
+    BEGIN
+        WriteWord(h.Machine);
+        WriteWord(h.NumberOfSections);
 
-    WR.Write32LE(h.TimeDateStamp);
-    WR.Write32LE(h.PointerToSymbolTable);
-    WR.Write32LE(h.NumberOfSymbols);
+        WR.Write32LE(h.TimeDateStamp);
+        WR.Write32LE(h.PointerToSymbolTable);
+        WR.Write32LE(h.NumberOfSymbols);
 
-    WriteWord(h.SizeOfOptionalHeader);
-    WriteWord(h.Characteristics)
-END WriteFileHeader;
+        WriteWord(h.SizeOfOptionalHeader);
+        WriteWord(h.Characteristics)
+    END WriteFileHeader;
 
 
 PROCEDURE write* (program: BIN.PROGRAM; FileName: ARRAY OF CHAR; console, dll, amd64: BOOLEAN; fa: INTEGER);
-VAR
-    i, n, temp: INTEGER;
+    VAR
+        i, n, temp: INTEGER;
 
-    Size: RECORD
+        Size: RECORD
 
-        Code, Data, Bss, Import, Reloc, Export: INTEGER
+            Code, Data, Bss, Import, Reloc, Export: INTEGER
 
-    END;
+        END;
 
-    BaseAddress: INTEGER;
+        BaseAddress: INTEGER;
+
+        Address: VIRTUAL_ADDR;
+
+        _import:      BIN.IMPRT;
+        ImportTable:  CHL.INTLIST;
 
-    Address: VIRTUAL_ADDR;
+        ExportDir:  IMAGE_EXPORT_DIRECTORY;
+        export:     BIN.EXPRT;
 
-    _import:      BIN.IMPRT;
-    ImportTable:  CHL.INTLIST;
 
-    ExportDir:  IMAGE_EXPORT_DIRECTORY;
-    export:     BIN.EXPRT;
+        PROCEDURE WriteExportDir (e: IMAGE_EXPORT_DIRECTORY);
+        BEGIN
+            WR.Write32LE(e.Characteristics);
+            WR.Write32LE(e.TimeDateStamp);
 
+            WriteWord(e.MajorVersion);
+            WriteWord(e.MinorVersion);
 
-    PROCEDURE WriteExportDir (e: IMAGE_EXPORT_DIRECTORY);
-    BEGIN
-        WR.Write32LE(e.Characteristics);
-        WR.Write32LE(e.TimeDateStamp);
+            WR.Write32LE(e.Name);
+            WR.Write32LE(e.Base);
+            WR.Write32LE(e.NumberOfFunctions);
+            WR.Write32LE(e.NumberOfNames);
+            WR.Write32LE(e.AddressOfFunctions);
+            WR.Write32LE(e.AddressOfNames);
+            WR.Write32LE(e.AddressOfNameOrdinals)
+        END WriteExportDir;
 
-        WriteWord(e.MajorVersion);
-        WriteWord(e.MinorVersion);
 
-        WR.Write32LE(e.Name);
-        WR.Write32LE(e.Base);
-        WR.Write32LE(e.NumberOfFunctions);
-        WR.Write32LE(e.NumberOfNames);
-        WR.Write32LE(e.AddressOfFunctions);
-        WR.Write32LE(e.AddressOfNames);
-        WR.Write32LE(e.AddressOfNameOrdinals)
-    END WriteExportDir;
+        PROCEDURE WriteOptHeader (h: IMAGE_OPTIONAL_HEADER; amd64: BOOLEAN);
+        VAR
+            i: INTEGER;
 
+        BEGIN
+            WriteWord(h.Magic);
 
-    PROCEDURE WriteOptHeader (h: IMAGE_OPTIONAL_HEADER; amd64: BOOLEAN);
-    VAR
-        i: INTEGER;
+            WR.WriteByte(h.MajorLinkerVersion);
+            WR.WriteByte(h.MinorLinkerVersion);
 
-    BEGIN
-        WriteWord(h.Magic);
+            WR.Write32LE(h.SizeOfCode);
+            WR.Write32LE(h.SizeOfInitializedData);
+            WR.Write32LE(h.SizeOfUninitializedData);
+            WR.Write32LE(h.AddressOfEntryPoint);
+            WR.Write32LE(h.BaseOfCode);
 
-        WR.WriteByte(h.MajorLinkerVersion);
-        WR.WriteByte(h.MinorLinkerVersion);
+            IF amd64 THEN
+                WR.Write64LE(h.ImageBase)
+            ELSE
+                WR.Write32LE(h.BaseOfData);
+                WR.Write32LE(h.ImageBase)
+            END;
 
-        WR.Write32LE(h.SizeOfCode);
-        WR.Write32LE(h.SizeOfInitializedData);
-        WR.Write32LE(h.SizeOfUninitializedData);
-        WR.Write32LE(h.AddressOfEntryPoint);
-        WR.Write32LE(h.BaseOfCode);
+            WR.Write32LE(h.SectionAlignment);
+            WR.Write32LE(h.FileAlignment);
 
-        IF amd64 THEN
-            WR.Write64LE(h.ImageBase)
-        ELSE
-            WR.Write32LE(h.BaseOfData);
-            WR.Write32LE(h.ImageBase)
-        END;
+            WriteWord(h.MajorOperatingSystemVersion);
+            WriteWord(h.MinorOperatingSystemVersion);
+            WriteWord(h.MajorImageVersion);
+            WriteWord(h.MinorImageVersion);
+            WriteWord(h.MajorSubsystemVersion);
+            WriteWord(h.MinorSubsystemVersion);
 
-        WR.Write32LE(h.SectionAlignment);
-        WR.Write32LE(h.FileAlignment);
+            WR.Write32LE(h.Win32VersionValue);
+            WR.Write32LE(h.SizeOfImage);
+            WR.Write32LE(h.SizeOfHeaders);
+            WR.Write32LE(h.CheckSum);
 
-        WriteWord(h.MajorOperatingSystemVersion);
-        WriteWord(h.MinorOperatingSystemVersion);
-        WriteWord(h.MajorImageVersion);
-        WriteWord(h.MinorImageVersion);
-        WriteWord(h.MajorSubsystemVersion);
-        WriteWord(h.MinorSubsystemVersion);
+            WriteWord(h.Subsystem);
+            WriteWord(h.DllCharacteristics);
 
-        WR.Write32LE(h.Win32VersionValue);
-        WR.Write32LE(h.SizeOfImage);
-        WR.Write32LE(h.SizeOfHeaders);
-        WR.Write32LE(h.CheckSum);
+            IF amd64 THEN
+                WR.Write64LE(h.SizeOfStackReserve);
+                WR.Write64LE(h.SizeOfStackCommit);
+                WR.Write64LE(h.SizeOfHeapReserve);
+                WR.Write64LE(h.SizeOfHeapCommit)
+            ELSE
+                WR.Write32LE(h.SizeOfStackReserve);
+                WR.Write32LE(h.SizeOfStackCommit);
+                WR.Write32LE(h.SizeOfHeapReserve);
+                WR.Write32LE(h.SizeOfHeapCommit)
+            END;
 
-        WriteWord(h.Subsystem);
-        WriteWord(h.DllCharacteristics);
+            WR.Write32LE(h.LoaderFlags);
+            WR.Write32LE(h.NumberOfRvaAndSizes);
 
-        IF amd64 THEN
-            WR.Write64LE(h.SizeOfStackReserve);
-            WR.Write64LE(h.SizeOfStackCommit);
-            WR.Write64LE(h.SizeOfHeapReserve);
-            WR.Write64LE(h.SizeOfHeapCommit)
-        ELSE
-            WR.Write32LE(h.SizeOfStackReserve);
-            WR.Write32LE(h.SizeOfStackCommit);
-            WR.Write32LE(h.SizeOfHeapReserve);
-            WR.Write32LE(h.SizeOfHeapCommit)
-        END;
+            FOR i := 0 TO LEN(h.DataDirectory) - 1 DO
+                WR.Write32LE(h.DataDirectory[i].VirtualAddress);
+                WR.Write32LE(h.DataDirectory[i].Size)
+            END
 
-        WR.Write32LE(h.LoaderFlags);
-        WR.Write32LE(h.NumberOfRvaAndSizes);
+        END WriteOptHeader;
 
-        FOR i := 0 TO LEN(h.DataDirectory) - 1 DO
-            WR.Write32LE(h.DataDirectory[i].VirtualAddress);
-            WR.Write32LE(h.DataDirectory[i].Size)
-        END
 
-    END WriteOptHeader;
+        PROCEDURE InitSection (VAR section: IMAGE_SECTION_HEADER; Name: NAME; VirtualSize: INTEGER; Characteristics: DWORD);
+        BEGIN
+            section.Name                  :=  Name;
+            section.VirtualSize           :=  VirtualSize;
+            section.SizeOfRawData         :=  WR.align(VirtualSize, FileAlignment);
+            section.PointerToRelocations  :=  0;
+            section.PointerToLinenumbers  :=  0;
+            section.NumberOfRelocations   :=  0X;
+            section.NumberOfLinenumbers   :=  0X;
+            section.Characteristics       :=  Characteristics
+        END InitSection;
 
 
-    PROCEDURE InitSection (VAR section: IMAGE_SECTION_HEADER; Name: NAME; VirtualSize: INTEGER; Characteristics: DWORD);
     BEGIN
-        section.Name                  :=  Name;
-        section.VirtualSize           :=  VirtualSize;
-        section.SizeOfRawData         :=  WR.align(VirtualSize, FileAlignment);
-        section.PointerToRelocations  :=  0;
-        section.PointerToLinenumbers  :=  0;
-        section.NumberOfRelocations   :=  0X;
-        section.NumberOfLinenumbers   :=  0X;
-        section.Characteristics       :=  Characteristics
-    END InitSection;
-
-
-BEGIN
-    IF (fa = 512) OR (fa = 1024) OR (fa = 2048) OR (fa = 4096) THEN
-        FileAlignment := fa
-    ELSE
-        FileAlignment := 512
-    END;
-
-    SizeOfWord := SIZE_OF_DWORD * (ORD(amd64) + 1);
+        IF (fa = 512) OR (fa = 1024) OR (fa = 2048) OR (fa = 4096) THEN
+            FileAlignment := fa
+        ELSE
+            FileAlignment := 512
+        END;
 
-    Size.Code  := CHL.Length(program.code);
-    Size.Data  := CHL.Length(program.data);
-    Size.Bss   := program.bss;
+        SizeOfWord := SIZE_OF_DWORD * (ORD(amd64) + 1);
 
-    IF dll THEN
-        BaseAddress := 10000000H
-    ELSE
-        BaseAddress := 400000H
-    END;
+        Size.Code  := CHL.Length(program.code);
+        Size.Data  := CHL.Length(program.data);
+        Size.Bss   := program.bss;
 
-    Signature[0] := 50H;
-    Signature[1] := 45H;
-    Signature[2] := 0;
-    Signature[3] := 0;
+        IF dll THEN
+            BaseAddress := 10000000H
+        ELSE
+            BaseAddress := 400000H
+        END;
 
-    IF amd64 THEN
-        FileHeader.Machine := 08664X
-    ELSE
-        FileHeader.Machine := 014CX
-    END;
+        Signature[0] := 50H;
+        Signature[1] := 45H;
+        Signature[2] := 0;
+        Signature[3] := 0;
 
-    FileHeader.NumberOfSections := WCHR(4 + ORD(dll));
-
-    FileHeader.TimeDateStamp         :=  UTILS.UnixTime();
-    FileHeader.PointerToSymbolTable  :=  0H;
-    FileHeader.NumberOfSymbols       :=  0H;
-    FileHeader.SizeOfOptionalHeader  :=  WCHR(0E0H + 10H * ORD(amd64));
-    FileHeader.Characteristics       :=  WCHR(010EH + (20H - 100H) * ORD(amd64) + 2000H * ORD(dll));
-
-    OptionalHeader.Magic                        :=  WCHR(010BH + 100H * ORD(amd64));
-    OptionalHeader.MajorLinkerVersion           :=  UTILS.vMajor;
-    OptionalHeader.MinorLinkerVersion           :=  UTILS.vMinor;
-    OptionalHeader.SizeOfCode                   :=  WR.align(Size.Code, FileAlignment);
-    OptionalHeader.SizeOfInitializedData        :=  0;
-    OptionalHeader.SizeOfUninitializedData      :=  0;
-    OptionalHeader.AddressOfEntryPoint          :=  SectionAlignment;
-    OptionalHeader.BaseOfCode                   :=  SectionAlignment;
-    OptionalHeader.BaseOfData                   :=  OptionalHeader.BaseOfCode + WR.align(Size.Code, SectionAlignment);
-    OptionalHeader.ImageBase                    :=  BaseAddress;
-    OptionalHeader.SectionAlignment             :=  SectionAlignment;
-    OptionalHeader.FileAlignment                :=  FileAlignment;
-    OptionalHeader.MajorOperatingSystemVersion  :=  1X;
-    OptionalHeader.MinorOperatingSystemVersion  :=  0X;
-    OptionalHeader.MajorImageVersion            :=  0X;
-    OptionalHeader.MinorImageVersion            :=  0X;
-    OptionalHeader.MajorSubsystemVersion        :=  4X;
-    OptionalHeader.MinorSubsystemVersion        :=  0X;
-    OptionalHeader.Win32VersionValue            :=  0H;
-    OptionalHeader.SizeOfImage                  :=  SectionAlignment;
-    OptionalHeader.SizeOfHeaders                :=  MAX(FileAlignment, 1024);
-    OptionalHeader.CheckSum                     :=  0;
-    OptionalHeader.Subsystem                    :=  WCHR((2 + ORD(console)) * ORD(~dll));
-    OptionalHeader.DllCharacteristics           :=  0040X;
-    OptionalHeader.SizeOfStackReserve           :=  100000H;
-    OptionalHeader.SizeOfStackCommit            :=  10000H;
-    OptionalHeader.SizeOfHeapReserve            :=  100000H;
-    OptionalHeader.SizeOfHeapCommit             :=  10000H;
-    OptionalHeader.LoaderFlags                  :=  0;
-    OptionalHeader.NumberOfRvaAndSizes          :=  IMAGE_NUMBEROF_DIRECTORY_ENTRIES;
-
-    FOR i := 0 TO IMAGE_NUMBEROF_DIRECTORY_ENTRIES - 1 DO
-        OptionalHeader.DataDirectory[i].VirtualAddress := 0;
-        OptionalHeader.DataDirectory[i].Size := 0
-    END;
+        IF amd64 THEN
+            FileHeader.Machine := 08664X
+        ELSE
+            FileHeader.Machine := 014CX
+        END;
 
-    InitSection(SectionHeaders[0], ".text", Size.Code, SHC_text);
-    SectionHeaders[0].VirtualAddress   := SectionAlignment;
-    SectionHeaders[0].PointerToRawData := OptionalHeader.SizeOfHeaders;
+        FileHeader.NumberOfSections := WCHR(4 + ORD(dll));
+
+        FileHeader.TimeDateStamp         :=  UTILS.UnixTime();
+        FileHeader.PointerToSymbolTable  :=  0H;
+        FileHeader.NumberOfSymbols       :=  0H;
+        FileHeader.SizeOfOptionalHeader  :=  WCHR(0E0H + 10H * ORD(amd64));
+        FileHeader.Characteristics       :=  WCHR(010EH + (20H - 100H) * ORD(amd64) + 2000H * ORD(dll));
+
+        OptionalHeader.Magic                        :=  WCHR(010BH + 100H * ORD(amd64));
+        OptionalHeader.MajorLinkerVersion           :=  UTILS.vMajor;
+        OptionalHeader.MinorLinkerVersion           :=  UTILS.vMinor;
+        OptionalHeader.SizeOfCode                   :=  WR.align(Size.Code, FileAlignment);
+        OptionalHeader.SizeOfInitializedData        :=  0;
+        OptionalHeader.SizeOfUninitializedData      :=  0;
+        OptionalHeader.AddressOfEntryPoint          :=  SectionAlignment;
+        OptionalHeader.BaseOfCode                   :=  SectionAlignment;
+        OptionalHeader.BaseOfData                   :=  OptionalHeader.BaseOfCode + WR.align(Size.Code, SectionAlignment);
+        OptionalHeader.ImageBase                    :=  BaseAddress;
+        OptionalHeader.SectionAlignment             :=  SectionAlignment;
+        OptionalHeader.FileAlignment                :=  FileAlignment;
+        OptionalHeader.MajorOperatingSystemVersion  :=  1X;
+        OptionalHeader.MinorOperatingSystemVersion  :=  0X;
+        OptionalHeader.MajorImageVersion            :=  0X;
+        OptionalHeader.MinorImageVersion            :=  0X;
+        OptionalHeader.MajorSubsystemVersion        :=  4X;
+        OptionalHeader.MinorSubsystemVersion        :=  0X;
+        OptionalHeader.Win32VersionValue            :=  0H;
+        OptionalHeader.SizeOfImage                  :=  SectionAlignment;
+        OptionalHeader.SizeOfHeaders                :=  MAX(FileAlignment, 1024);
+        OptionalHeader.CheckSum                     :=  0;
+        OptionalHeader.Subsystem                    :=  WCHR((2 + ORD(console)) * ORD(~dll));
+        OptionalHeader.DllCharacteristics           :=  0040X;
+        OptionalHeader.SizeOfStackReserve           :=  100000H;
+        OptionalHeader.SizeOfStackCommit            :=  10000H;
+        OptionalHeader.SizeOfHeapReserve            :=  100000H;
+        OptionalHeader.SizeOfHeapCommit             :=  10000H;
+        OptionalHeader.LoaderFlags                  :=  0;
+        OptionalHeader.NumberOfRvaAndSizes          :=  IMAGE_NUMBEROF_DIRECTORY_ENTRIES;
+
+        FOR i := 0 TO IMAGE_NUMBEROF_DIRECTORY_ENTRIES - 1 DO
+            OptionalHeader.DataDirectory[i].VirtualAddress := 0;
+            OptionalHeader.DataDirectory[i].Size := 0
+        END;
 
-    InitSection(SectionHeaders[1], ".data", Size.Data, SHC_data);
-    SectionHeaders[1].VirtualAddress   := WR.align(SectionHeaders[0].VirtualAddress + SectionHeaders[0].VirtualSize, SectionAlignment);
-    SectionHeaders[1].PointerToRawData := SectionHeaders[0].PointerToRawData + SectionHeaders[0].SizeOfRawData;
+        InitSection(SectionHeaders[0], ".text", Size.Code, SHC_text);
+        SectionHeaders[0].VirtualAddress   := SectionAlignment;
+        SectionHeaders[0].PointerToRawData := OptionalHeader.SizeOfHeaders;
 
-    InitSection(SectionHeaders[2], ".bss", Size.Bss, SHC_bss);
-    SectionHeaders[2].VirtualAddress   := WR.align(SectionHeaders[1].VirtualAddress + SectionHeaders[1].VirtualSize, SectionAlignment);
-    SectionHeaders[2].PointerToRawData := SectionHeaders[1].PointerToRawData + SectionHeaders[1].SizeOfRawData;
-    SectionHeaders[2].SizeOfRawData    := 0;
+        InitSection(SectionHeaders[1], ".data", Size.Data, SHC_data);
+        SectionHeaders[1].VirtualAddress   := WR.align(SectionHeaders[0].VirtualAddress + SectionHeaders[0].VirtualSize, SectionAlignment);
+        SectionHeaders[1].PointerToRawData := SectionHeaders[0].PointerToRawData + SectionHeaders[0].SizeOfRawData;
 
-    Size.Import := GetImportSize(program.imp_list);
+        InitSection(SectionHeaders[2], ".bss", Size.Bss, SHC_bss);
+        SectionHeaders[2].VirtualAddress   := WR.align(SectionHeaders[1].VirtualAddress + SectionHeaders[1].VirtualSize, SectionAlignment);
+        SectionHeaders[2].PointerToRawData := SectionHeaders[1].PointerToRawData + SectionHeaders[1].SizeOfRawData;
+        SectionHeaders[2].SizeOfRawData    := 0;
 
-    InitSection(SectionHeaders[3], ".idata", Size.Import + CHL.Length(program._import), SHC_data);
-    SectionHeaders[3].VirtualAddress   := WR.align(SectionHeaders[2].VirtualAddress + SectionHeaders[2].VirtualSize, SectionAlignment);
-    SectionHeaders[3].PointerToRawData := SectionHeaders[2].PointerToRawData + SectionHeaders[2].SizeOfRawData;
+        Size.Import := GetImportSize(program.imp_list);
 
-    Address.Code   := SectionHeaders[0].VirtualAddress + OptionalHeader.ImageBase;
-    Address.Data   := SectionHeaders[1].VirtualAddress + OptionalHeader.ImageBase;
-    Address.Bss    := SectionHeaders[2].VirtualAddress + OptionalHeader.ImageBase;
-    Address.Import := SectionHeaders[3].VirtualAddress + OptionalHeader.ImageBase;
+        InitSection(SectionHeaders[3], ".idata", Size.Import + CHL.Length(program._import), SHC_data);
+        SectionHeaders[3].VirtualAddress   := WR.align(SectionHeaders[2].VirtualAddress + SectionHeaders[2].VirtualSize, SectionAlignment);
+        SectionHeaders[3].PointerToRawData := SectionHeaders[2].PointerToRawData + SectionHeaders[2].SizeOfRawData;
 
-    fixup(program, Address, amd64);
+        Address.Code   := SectionHeaders[0].VirtualAddress + OptionalHeader.ImageBase;
+        Address.Data   := SectionHeaders[1].VirtualAddress + OptionalHeader.ImageBase;
+        Address.Bss    := SectionHeaders[2].VirtualAddress + OptionalHeader.ImageBase;
+        Address.Import := SectionHeaders[3].VirtualAddress + OptionalHeader.ImageBase;
 
-    IF dll THEN
-        Size.Export := Export(program, SectionHeaders[1].VirtualAddress + program.modname, ExportDir);
+        fixup(program, Address, amd64);
 
-        InitSection(SectionHeaders[4], ".edata", Size.Export + CHL.Length(program.export), SHC_data);
-        SectionHeaders[4].VirtualAddress   := WR.align(SectionHeaders[3].VirtualAddress + SectionHeaders[3].VirtualSize, SectionAlignment);
-        SectionHeaders[4].PointerToRawData := SectionHeaders[3].PointerToRawData + SectionHeaders[3].SizeOfRawData;
+        IF dll THEN
+            Size.Export := Export(program, SectionHeaders[1].VirtualAddress + program.modname, ExportDir);
 
-        OptionalHeader.DataDirectory[0].VirtualAddress := SectionHeaders[4].VirtualAddress;
-        OptionalHeader.DataDirectory[0].Size := SectionHeaders[4].VirtualSize
-    END;
+            InitSection(SectionHeaders[4], ".edata", Size.Export + CHL.Length(program.export), SHC_data);
+            SectionHeaders[4].VirtualAddress   := WR.align(SectionHeaders[3].VirtualAddress + SectionHeaders[3].VirtualSize, SectionAlignment);
+            SectionHeaders[4].PointerToRawData := SectionHeaders[3].PointerToRawData + SectionHeaders[3].SizeOfRawData;
 
-    OptionalHeader.DataDirectory[1].VirtualAddress := SectionHeaders[3].VirtualAddress;
-    OptionalHeader.DataDirectory[1].Size := SectionHeaders[3].VirtualSize;
+            OptionalHeader.DataDirectory[0].VirtualAddress := SectionHeaders[4].VirtualAddress;
+            OptionalHeader.DataDirectory[0].Size := SectionHeaders[4].VirtualSize
+        END;
 
-    FOR i := 1 TO ORD(FileHeader.NumberOfSections) - 1 DO
-        INC(OptionalHeader.SizeOfInitializedData, SectionHeaders[i].SizeOfRawData)
-    END;
+        OptionalHeader.DataDirectory[1].VirtualAddress := SectionHeaders[3].VirtualAddress;
+        OptionalHeader.DataDirectory[1].Size := SectionHeaders[3].VirtualSize;
 
-    OptionalHeader.SizeOfUninitializedData := WR.align(SectionHeaders[2].VirtualSize, FileAlignment);
+        FOR i := 1 TO ORD(FileHeader.NumberOfSections) - 1 DO
+            INC(OptionalHeader.SizeOfInitializedData, SectionHeaders[i].SizeOfRawData)
+        END;
 
-    FOR i := 0 TO ORD(FileHeader.NumberOfSections) - 1 DO
-        INC(OptionalHeader.SizeOfImage, WR.align(SectionHeaders[i].VirtualSize, SectionAlignment))
-    END;
+        OptionalHeader.SizeOfUninitializedData := WR.align(SectionHeaders[2].VirtualSize, FileAlignment);
 
-    n := 0;
-    BIN.InitArray(msdos, n, "4D5A80000100000004001000FFFF000040010000000000004000000000000000");
-    BIN.InitArray(msdos, n, "0000000000000000000000000000000000000000000000000000000080000000");
-    BIN.InitArray(msdos, n, "0E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F");
-    BIN.InitArray(msdos, n, "742062652072756E20696E20444F53206D6F64652E0D0A240000000000000000");
+        FOR i := 0 TO ORD(FileHeader.NumberOfSections) - 1 DO
+            INC(OptionalHeader.SizeOfImage, WR.align(SectionHeaders[i].VirtualSize, SectionAlignment))
+        END;
 
-    WR.Create(FileName);
+        n := 0;
+        BIN.InitArray(msdos, n, "4D5A80000100000004001000FFFF000040010000000000004000000000000000");
+        BIN.InitArray(msdos, n, "0000000000000000000000000000000000000000000000000000000080000000");
+        BIN.InitArray(msdos, n, "0E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F");
+        BIN.InitArray(msdos, n, "742062652072756E20696E20444F53206D6F64652E0D0A240000000000000000");
 
-    WR.Write(msdos, LEN(msdos));
+        WR.Create(FileName);
 
-    WR.Write(Signature, LEN(Signature));
-    WriteFileHeader(FileHeader);
-    WriteOptHeader(OptionalHeader, amd64);
+        WR.Write(msdos, LEN(msdos));
 
-    FOR i := 0 TO ORD(FileHeader.NumberOfSections) - 1 DO
-        WriteSectionHeader(SectionHeaders[i])
-    END;
+        WR.Write(Signature, LEN(Signature));
+        WriteFileHeader(FileHeader);
+        WriteOptHeader(OptionalHeader, amd64);
 
-    WR.Padding(FileAlignment);
+        FOR i := 0 TO ORD(FileHeader.NumberOfSections) - 1 DO
+            WriteSectionHeader(SectionHeaders[i])
+        END;
 
-    CHL.WriteToFile(program.code);
-    WR.Padding(FileAlignment);
+        WR.Padding(FileAlignment);
 
-    CHL.WriteToFile(program.data);
-    WR.Padding(FileAlignment);
+        CHL.WriteToFile(program.code);
+        WR.Padding(FileAlignment);
 
-    n := (libcnt + 1) * 5;
-    ImportTable := CHL.CreateIntList();
+        CHL.WriteToFile(program.data);
+        WR.Padding(FileAlignment);
 
-    FOR i := 0 TO (Size.Import - n * SIZE_OF_DWORD) DIV SizeOfWord + n - 1 DO
-        CHL.PushInt(ImportTable, 0)
-    END;
+        n := (libcnt + 1) * 5;
+        ImportTable := CHL.CreateIntList();
 
-    i := 0;
-    _import := program.imp_list.first(BIN.IMPRT);
-    WHILE _import # NIL DO
-        IF _import.label = 0 THEN
-            CHL.SetInt(ImportTable, i + 0, _import.OriginalFirstThunk * SizeOfWord + SectionHeaders[3].VirtualAddress + n * SIZE_OF_DWORD);
-            CHL.SetInt(ImportTable, i + 1, 0);
-            CHL.SetInt(ImportTable, i + 2, 0);
-            CHL.SetInt(ImportTable, i + 3, _import.nameoffs + Size.Import + SectionHeaders[3].VirtualAddress);
-            CHL.SetInt(ImportTable, i + 4, _import.FirstThunk * SizeOfWord + SectionHeaders[3].VirtualAddress + n * SIZE_OF_DWORD);
-            INC(i, 5)
+        FOR i := 0 TO (Size.Import - n * SIZE_OF_DWORD) DIV SizeOfWord + n - 1 DO
+            CHL.PushInt(ImportTable, 0)
         END;
-        _import := _import.next(BIN.IMPRT)
-    END;
 
-    CHL.SetInt(ImportTable, i + 0, 0);
-    CHL.SetInt(ImportTable, i + 1, 0);
-    CHL.SetInt(ImportTable, i + 2, 0);
-    CHL.SetInt(ImportTable, i + 3, 0);
-    CHL.SetInt(ImportTable, i + 4, 0);
-
-    _import := program.imp_list.first(BIN.IMPRT);
-    WHILE _import # NIL DO
-        IF _import.label # 0 THEN
-            temp := _import.nameoffs + Size.Import + SectionHeaders[3].VirtualAddress - 2;
-            CHL.SetInt(ImportTable, _import.OriginalFirstThunk + n, temp);
-            CHL.SetInt(ImportTable, _import.FirstThunk + n,         temp)
+        i := 0;
+        _import := program.imp_list.first(BIN.IMPRT);
+        WHILE _import # NIL DO
+            IF _import.label = 0 THEN
+                CHL.SetInt(ImportTable, i + 0, _import.OriginalFirstThunk * SizeOfWord + SectionHeaders[3].VirtualAddress + n * SIZE_OF_DWORD);
+                CHL.SetInt(ImportTable, i + 1, 0);
+                CHL.SetInt(ImportTable, i + 2, 0);
+                CHL.SetInt(ImportTable, i + 3, _import.nameoffs + Size.Import + SectionHeaders[3].VirtualAddress);
+                CHL.SetInt(ImportTable, i + 4, _import.FirstThunk * SizeOfWord + SectionHeaders[3].VirtualAddress + n * SIZE_OF_DWORD);
+                INC(i, 5)
+            END;
+            _import := _import.next(BIN.IMPRT)
         END;
-        _import := _import.next(BIN.IMPRT)
-    END;
 
-    FOR i := 0 TO n - 1 DO
-        WR.Write32LE(CHL.GetInt(ImportTable, i))
-    END;
+        CHL.SetInt(ImportTable, i + 0, 0);
+        CHL.SetInt(ImportTable, i + 1, 0);
+        CHL.SetInt(ImportTable, i + 2, 0);
+        CHL.SetInt(ImportTable, i + 3, 0);
+        CHL.SetInt(ImportTable, i + 4, 0);
+
+        _import := program.imp_list.first(BIN.IMPRT);
+        WHILE _import # NIL DO
+            IF _import.label # 0 THEN
+                temp := _import.nameoffs + Size.Import + SectionHeaders[3].VirtualAddress - 2;
+                CHL.SetInt(ImportTable, _import.OriginalFirstThunk + n, temp);
+                CHL.SetInt(ImportTable, _import.FirstThunk + n,         temp)
+            END;
+            _import := _import.next(BIN.IMPRT)
+        END;
 
-    FOR i := n TO CHL.Length(ImportTable) - 1 DO
-        IF amd64 THEN
-            WR.Write64LE(CHL.GetInt(ImportTable, i))
-        ELSE
+        FOR i := 0 TO n - 1 DO
             WR.Write32LE(CHL.GetInt(ImportTable, i))
-        END
-    END;
+        END;
 
-    CHL.WriteToFile(program._import);
-    WR.Padding(FileAlignment);
+        FOR i := n TO CHL.Length(ImportTable) - 1 DO
+            IF amd64 THEN
+                WR.Write64LE(CHL.GetInt(ImportTable, i))
+            ELSE
+                WR.Write32LE(CHL.GetInt(ImportTable, i))
+            END
+        END;
 
-    IF dll THEN
+        CHL.WriteToFile(program._import);
+        WR.Padding(FileAlignment);
 
-        INC(ExportDir.AddressOfFunctions,    SectionHeaders[4].VirtualAddress);
-        INC(ExportDir.AddressOfNames,        SectionHeaders[4].VirtualAddress);
-        INC(ExportDir.AddressOfNameOrdinals, SectionHeaders[4].VirtualAddress);
+        IF dll THEN
 
-        WriteExportDir(ExportDir);
+            INC(ExportDir.AddressOfFunctions,    SectionHeaders[4].VirtualAddress);
+            INC(ExportDir.AddressOfNames,        SectionHeaders[4].VirtualAddress);
+            INC(ExportDir.AddressOfNameOrdinals, SectionHeaders[4].VirtualAddress);
 
-        export := program.exp_list.first(BIN.EXPRT);
-        WHILE export # NIL DO
-            WR.Write32LE(export.label + SectionHeaders[0].VirtualAddress);
-            export := export.next(BIN.EXPRT)
-        END;
+            WriteExportDir(ExportDir);
 
-        export := program.exp_list.first(BIN.EXPRT);
-        WHILE export # NIL DO
-            WR.Write32LE(export.nameoffs + Size.Export + SectionHeaders[4].VirtualAddress);
-            export := export.next(BIN.EXPRT)
-        END;
+            export := program.exp_list.first(BIN.EXPRT);
+            WHILE export # NIL DO
+                WR.Write32LE(export.label + SectionHeaders[0].VirtualAddress);
+                export := export.next(BIN.EXPRT)
+            END;
 
-        FOR i := 0 TO ExportDir.NumberOfFunctions - 1 DO
-            WriteWord(WCHR(i))
-        END;
+            export := program.exp_list.first(BIN.EXPRT);
+            WHILE export # NIL DO
+                WR.Write32LE(export.nameoffs + Size.Export + SectionHeaders[4].VirtualAddress);
+                export := export.next(BIN.EXPRT)
+            END;
 
-        CHL.WriteToFile(program.export);
-        WR.Padding(FileAlignment)
-    END;
+            FOR i := 0 TO ExportDir.NumberOfFunctions - 1 DO
+                WriteWord(WCHR(i))
+            END;
+
+            CHL.WriteToFile(program.export);
+            WR.Padding(FileAlignment)
+        END;
 
-    WR.Close
-END write;
+        WR.Close
+    END write;
 
 
 END PE32.

+ 780 - 787
source/PROG.ob07

@@ -1,11 +1,4 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2018-2023, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE PROG;
+MODULE PROG;
 
 IMPORT SCAN, LISTS, ARITH, ERRORS, C := COLLECTIONS, IL, UTILS, TARGETS, STRINGS, PATHS;
 
@@ -222,1062 +215,1062 @@ VAR
 
 
 PROCEDURE NewIdent (): IDENT;
-VAR
-    ident: IDENT;
-    citem: C.ITEM;
+    VAR
+        ident: IDENT;
+        citem: C.ITEM;
 
-BEGIN
-    citem := C.pop(idents);
-    IF citem = NIL THEN
-        NEW(ident)
-    ELSE
-        ident := citem(IDENT)
-    END
+    BEGIN
+        citem := C.pop(idents);
+        IF citem = NIL THEN
+            NEW(ident)
+        ELSE
+            ident := citem(IDENT)
+        END
 
-    RETURN ident
-END NewIdent;
+        RETURN ident
+    END NewIdent;
 
 
 PROCEDURE getOffset* (varIdent: IDENT): INTEGER;
-VAR
-    size, glob_align: INTEGER;
-
-BEGIN
-    IF varIdent.offset = -1 THEN
-        size := varIdent._type.size;
-        IF varIdent.global THEN
-            IF TARGETS.WinLin THEN
-                glob_align := 16
-            ELSE
-                glob_align := varIdent._type.align
-            END;
-            IF UTILS.Align(program.bss, glob_align) THEN
-                IF UTILS.maxint - program.bss >= size THEN
-                    varIdent.offset := program.bss;
-                    INC(program.bss, size)
+    VAR
+        size, glob_align: INTEGER;
+
+    BEGIN
+        IF varIdent.offset = -1 THEN
+            size := varIdent._type.size;
+            IF varIdent.global THEN
+                IF TARGETS.WinLin THEN
+                    glob_align := 16
+                ELSE
+                    glob_align := varIdent._type.align
+                END;
+                IF UTILS.Align(program.bss, glob_align) THEN
+                    IF UTILS.maxint - program.bss >= size THEN
+                        varIdent.offset := program.bss;
+                        INC(program.bss, size)
+                    END
                 END
-            END
-        ELSE
-            IF UTILS.Align(size, TARGETS.WordSize) THEN
-                size := size DIV TARGETS.WordSize;
-                IF UTILS.maxint - program.locsize >= size THEN
-                    INC(program.locsize, size);
-                    varIdent.offset := program.locsize
+            ELSE
+                IF UTILS.Align(size, TARGETS.WordSize) THEN
+                    size := size DIV TARGETS.WordSize;
+                    IF UTILS.maxint - program.locsize >= size THEN
+                        INC(program.locsize, size);
+                        varIdent.offset := program.locsize
+                    END
                 END
-            END
-        END;
+            END;
 
-        IF varIdent.offset = -1 THEN
-            ERRORS.Error(204)
+            IF varIdent.offset = -1 THEN
+                ERRORS.Error(204)
+            END
         END
-    END
 
-    RETURN varIdent.offset
-END getOffset;
+        RETURN varIdent.offset
+    END getOffset;
 
 
 PROCEDURE closeUnit* (unit: UNIT);
-VAR
-    ident, prev: IDENT;
-    offset: INTEGER;
-
-BEGIN
-    ident := unit.idents.last(IDENT);
-    WHILE (ident # NIL) & (ident.typ # idGUARD) DO
-        IF (ident.typ = idVAR) & (ident.offset = -1) THEN
-            ERRORS.HintMsg(ident.name.s, ident.pos.line, ident.pos.col, 0);
-            IF ident.export THEN
-                offset := getOffset(ident)
-            END
+    VAR
+        ident, prev: IDENT;
+        offset: INTEGER;
+
+    BEGIN
+        ident := unit.idents.last(IDENT);
+        WHILE (ident # NIL) & (ident.typ # idGUARD) DO
+            IF (ident.typ = idVAR) & (ident.offset = -1) THEN
+                ERRORS.HintMsg(ident.name.s, ident.pos.line, ident.pos.col, 0);
+                IF ident.export THEN
+                    offset := getOffset(ident)
+                END
+            END;
+            ident := ident.prev(IDENT)
         END;
-        ident := ident.prev(IDENT)
-    END;
 
-    ident := unit.idents.last(IDENT);
-    WHILE ident # NIL DO
-        prev := ident.prev(IDENT);
-        IF ~ident.export THEN
-            LISTS.delete(unit.idents, ident);
-            C.push(idents, ident)
+        ident := unit.idents.last(IDENT);
+        WHILE ident # NIL DO
+            prev := ident.prev(IDENT);
+            IF ~ident.export THEN
+                LISTS.delete(unit.idents, ident);
+                C.push(idents, ident)
+            END;
+            ident := prev
         END;
-        ident := prev
-    END;
 
-    unit.closed := TRUE
-END closeUnit;
+        unit.closed := TRUE
+    END closeUnit;
 
 
 PROCEDURE IdEq* (a, b: SCAN.IDENT): BOOLEAN;
-    RETURN (a.hash = b.hash) & (a.s = b.s)
-END IdEq;
+        RETURN (a.hash = b.hash) & (a.s = b.s)
+    END IdEq;
 
 
 PROCEDURE unique (unit: UNIT; ident: SCAN.IDENT): BOOLEAN;
-VAR
-    item: IDENT;
+    VAR
+        item: IDENT;
 
-BEGIN
-    item := unit.idents.last(IDENT);
-    WHILE (item.typ # idGUARD) & ~IdEq(item.name, ident) DO
-        item := item.prev(IDENT)
-    END
+    BEGIN
+        item := unit.idents.last(IDENT);
+        WHILE (item.typ # idGUARD) & ~IdEq(item.name, ident) DO
+            item := item.prev(IDENT)
+        END
 
-    RETURN item.typ = idGUARD
-END unique;
+        RETURN item.typ = idGUARD
+    END unique;
 
 
 PROCEDURE addIdent* (unit: UNIT; ident: SCAN.IDENT; typ: INTEGER): IDENT;
-VAR
-    item:  IDENT;
-    res:   BOOLEAN;
-    proc:  PROC;
-
-BEGIN
-    ASSERT(unit # NIL);
-
-    res := unique(unit, ident);
-
-    IF res THEN
-        item := NewIdent();
-
-        item.name    := ident;
-        item.typ     := typ;
-        item.unit    := NIL;
-        item.export  := FALSE;
-        item._import := NIL;
-        item._type   := NIL;
-        item.value.typ := 0;
-        item.stproc := 0;
-
-        item.global := unit.scopeLvl = 0;
-        item.scopeLvl := unit.scopeLvl;
-        item.offset := -1;
-
-        IF item.typ IN {idPROC, idIMP} THEN
-            NEW(proc);
-            proc._import := NIL;
-            proc.label := 0;
-            proc.used := FALSE;
-            proc.processed := FALSE;
-            proc.using := LISTS.create(NIL);
-            LISTS.push(program.procs, proc);
-            item.proc := proc
-        END;
+    VAR
+        item:  IDENT;
+        res:   BOOLEAN;
+        proc:  PROC;
 
-        LISTS.push(unit.idents, item)
-    ELSE
-        item := NIL
-    END
+    BEGIN
+        ASSERT(unit # NIL);
 
-    RETURN item
-END addIdent;
+        res := unique(unit, ident);
+
+        IF res THEN
+            item := NewIdent();
+
+            item.name    := ident;
+            item.typ     := typ;
+            item.unit    := NIL;
+            item.export  := FALSE;
+            item._import := NIL;
+            item._type   := NIL;
+            item.value.typ := 0;
+            item.stproc := 0;
+
+            item.global := unit.scopeLvl = 0;
+            item.scopeLvl := unit.scopeLvl;
+            item.offset := -1;
+
+            IF item.typ IN {idPROC, idIMP} THEN
+                NEW(proc);
+                proc._import := NIL;
+                proc.label := 0;
+                proc.used := FALSE;
+                proc.processed := FALSE;
+                proc.using := LISTS.create(NIL);
+                LISTS.push(program.procs, proc);
+                item.proc := proc
+            END;
+
+            LISTS.push(unit.idents, item)
+        ELSE
+            item := NIL
+        END
+
+        RETURN item
+    END addIdent;
 
 
 PROCEDURE UseProc* (unit: UNIT; call_proc: PROC);
-VAR
-    procs: LISTS.LIST;
-    cur:   LISTS.ITEM;
-    proc:  USED_PROC;
-
-BEGIN
-    IF unit.scopeLvl = 0 THEN
-        call_proc.used := TRUE
-    ELSE
-        procs := unit.scopes[unit.scopeLvl].using;
-
-        cur := procs.first;
-        WHILE (cur # NIL) & (cur(USED_PROC).proc # call_proc) DO
-            cur := cur.next
-        END;
+    VAR
+        procs: LISTS.LIST;
+        cur:   LISTS.ITEM;
+        proc:  USED_PROC;
 
-        IF cur = NIL THEN
-            NEW(proc);
-            proc.proc := call_proc;
-            LISTS.push(procs, proc)
+    BEGIN
+        IF unit.scopeLvl = 0 THEN
+            call_proc.used := TRUE
+        ELSE
+            procs := unit.scopes[unit.scopeLvl].using;
+
+            cur := procs.first;
+            WHILE (cur # NIL) & (cur(USED_PROC).proc # call_proc) DO
+                cur := cur.next
+            END;
+
+            IF cur = NIL THEN
+                NEW(proc);
+                proc.proc := call_proc;
+                LISTS.push(procs, proc)
+            END
         END
-    END
-END UseProc;
+    END UseProc;
 
 
 PROCEDURE setVarsType* (unit: UNIT; _type: _TYPE);
-VAR
-    item: IDENT;
+    VAR
+        item: IDENT;
 
-BEGIN
-    ASSERT(_type # NIL);
+    BEGIN
+        ASSERT(_type # NIL);
 
-    item := unit.idents.last(IDENT);
-    WHILE (item # NIL) & (item.typ = idVAR) & (item._type = NIL) DO
-        item._type := _type;
-        item := item.prev(IDENT)
-    END
-END setVarsType;
+        item := unit.idents.last(IDENT);
+        WHILE (item # NIL) & (item.typ = idVAR) & (item._type = NIL) DO
+            item._type := _type;
+            item := item.prev(IDENT)
+        END
+    END setVarsType;
 
 
 PROCEDURE getIdent* (unit: UNIT; ident: SCAN.IDENT; currentScope: BOOLEAN): IDENT;
-VAR
-    item: IDENT;
+    VAR
+        item: IDENT;
 
-BEGIN
-    item := unit.idents.last(IDENT);
+    BEGIN
+        item := unit.idents.last(IDENT);
 
-    IF item # NIL THEN
+        IF item # NIL THEN
 
-        IF currentScope THEN
-            WHILE (item.typ # idGUARD) & ~IdEq(item.name, ident) DO
-                item := item.prev(IDENT)
-            END;
-            IF item.typ = idGUARD THEN
-                item := NIL
-            END
-        ELSE
-            WHILE (item # NIL) & ~IdEq(item.name, ident) DO
-                item := item.prev(IDENT)
+            IF currentScope THEN
+                WHILE (item.typ # idGUARD) & ~IdEq(item.name, ident) DO
+                    item := item.prev(IDENT)
+                END;
+                IF item.typ = idGUARD THEN
+                    item := NIL
+                END
+            ELSE
+                WHILE (item # NIL) & ~IdEq(item.name, ident) DO
+                    item := item.prev(IDENT)
+                END
             END
-        END
 
-    END
+        END
 
-    RETURN item
-END getIdent;
+        RETURN item
+    END getIdent;
 
 
 PROCEDURE openScope* (unit: UNIT; proc: PROC): BOOLEAN;
-VAR
-    item: IDENT;
-    res:  BOOLEAN;
+    VAR
+        item: IDENT;
+        res:  BOOLEAN;
 
-BEGIN
-    INC(unit.scopeLvl);
+    BEGIN
+        INC(unit.scopeLvl);
 
-    res := unit.scopeLvl < MAXSCOPE;
+        res := unit.scopeLvl < MAXSCOPE;
 
-    IF res THEN
+        IF res THEN
 
-        unit.scopes[unit.scopeLvl] := proc;
+            unit.scopes[unit.scopeLvl] := proc;
 
-        NEW(item);
-        item := NewIdent();
+            NEW(item);
+            item := NewIdent();
 
-        item.name.s := "";
-        item.name.hash := 0;
-        item.typ  := idGUARD;
+            item.name.s := "";
+            item.name.hash := 0;
+            item.typ  := idGUARD;
 
-        LISTS.push(unit.idents, item)
-    END
+            LISTS.push(unit.idents, item)
+        END
 
-    RETURN res
-END openScope;
+        RETURN res
+    END openScope;
 
 
 PROCEDURE closeScope* (unit: UNIT);
-VAR
-    item: IDENT;
-    del:  IDENT;
+    VAR
+        item: IDENT;
+        del:  IDENT;
 
-BEGIN
-    item := unit.idents.last(IDENT);
+    BEGIN
+        item := unit.idents.last(IDENT);
 
-    WHILE (item # NIL) & (item.typ # idGUARD) DO
-        del  := item;
-        item := item.prev(IDENT);
-        IF (del.typ = idVAR) & (del.offset = -1) THEN
-            ERRORS.HintMsg(del.name.s, del.pos.line, del.pos.col, 0)
+        WHILE (item # NIL) & (item.typ # idGUARD) DO
+            del  := item;
+            item := item.prev(IDENT);
+            IF (del.typ = idVAR) & (del.offset = -1) THEN
+                ERRORS.HintMsg(del.name.s, del.pos.line, del.pos.col, 0)
+            END;
+            LISTS.delete(unit.idents, del);
+            C.push(idents, del)
         END;
-        LISTS.delete(unit.idents, del);
-        C.push(idents, del)
-    END;
 
-    IF (item # NIL) & (item.typ = idGUARD) THEN
-        LISTS.delete(unit.idents, item);
-        C.push(idents, item)
-    END;
+        IF (item # NIL) & (item.typ = idGUARD) THEN
+            LISTS.delete(unit.idents, item);
+            C.push(idents, item)
+        END;
 
-    DEC(unit.scopeLvl)
-END closeScope;
+        DEC(unit.scopeLvl)
+    END closeScope;
 
 
 PROCEDURE frwPtr* (unit: UNIT; _type: _TYPE; baseIdent: SCAN.IDENT; pos: SCAN.POSITION);
-VAR
-    newptr: FRWPTR;
+    VAR
+        newptr: FRWPTR;
 
-BEGIN
-    ASSERT(unit # NIL);
-    ASSERT(_type # NIL);
+    BEGIN
+        ASSERT(unit # NIL);
+        ASSERT(_type # NIL);
 
-    NEW(newptr);
+        NEW(newptr);
 
-    newptr._type      := _type;
-    newptr.baseIdent := baseIdent;
-    newptr.pos       := pos;
-    newptr.linked    := FALSE;
-    newptr.notRecord := FALSE;
+        newptr._type      := _type;
+        newptr.baseIdent := baseIdent;
+        newptr.pos       := pos;
+        newptr.linked    := FALSE;
+        newptr.notRecord := FALSE;
 
-    LISTS.push(unit.frwPointers, newptr)
-END frwPtr;
+        LISTS.push(unit.frwPointers, newptr)
+    END frwPtr;
 
 
 PROCEDURE linkPtr* (unit: UNIT): FRWPTR;
-VAR
-    item:  FRWPTR;
-    ident: IDENT;
-    res:   FRWPTR;
+    VAR
+        item:  FRWPTR;
+        ident: IDENT;
+        res:   FRWPTR;
 
-BEGIN
-    res  := NIL;
-    item := unit.frwPointers.last(FRWPTR);
+    BEGIN
+        res  := NIL;
+        item := unit.frwPointers.last(FRWPTR);
 
-    WHILE (item # NIL) & ~item.linked & (res = NIL) DO
-        ident := getIdent(unit, item.baseIdent, TRUE);
+        WHILE (item # NIL) & ~item.linked & (res = NIL) DO
+            ident := getIdent(unit, item.baseIdent, TRUE);
 
-        IF (ident # NIL) THEN
-            IF (ident.typ = idTYPE) & (ident._type.typ = tRECORD) THEN
-                item._type.base := ident._type;
-                item.linked := TRUE
+            IF (ident # NIL) THEN
+                IF (ident.typ = idTYPE) & (ident._type.typ = tRECORD) THEN
+                    item._type.base := ident._type;
+                    item.linked := TRUE
+                ELSE
+                    item.notRecord := TRUE;
+                    res := item
+                END
             ELSE
-                item.notRecord := TRUE;
+                item.notRecord := FALSE;
                 res := item
-            END
-        ELSE
-            item.notRecord := FALSE;
-            res := item
-        END;
+            END;
 
-        item := item.prev(FRWPTR)
-    END
+            item := item.prev(FRWPTR)
+        END
 
-    RETURN res
-END linkPtr;
+        RETURN res
+    END linkPtr;
 
 
 PROCEDURE isTypeEq* (t1, t2: _TYPE): BOOLEAN;
-VAR
-    res: BOOLEAN;
-    param1, param2: LISTS.ITEM;
-
-BEGIN
-    IF t1 = t2 THEN
-        res := TRUE
-    ELSIF (t1 = NIL) OR (t2 = NIL) THEN
-        res := FALSE
-    ELSIF (t1.typ = tPROCEDURE) & (t2.typ = tPROCEDURE) THEN
-
-        param1 := t1.params.first;
-        param2 := t2.params.first;
-
-        res := ((t1.call = t2.call) OR (t1.call IN {code, _code}) OR (t2.call IN {code, _code})) & ((param1 # NIL) = (param2 # NIL));
-
-        WHILE res & (param1 # NIL) & (param2 # NIL) DO
-            res := (param1(PARAM).vPar = param2(PARAM).vPar) & isTypeEq(param1(PARAM)._type, param2(PARAM)._type);
-            param1 := param1.next;
-            param2 := param2.next;
-            res := res & ((param1 # NIL) = (param2 # NIL))
-        END;
+    VAR
+        res: BOOLEAN;
+        param1, param2: LISTS.ITEM;
+
+    BEGIN
+        IF t1 = t2 THEN
+            res := TRUE
+        ELSIF (t1 = NIL) OR (t2 = NIL) THEN
+            res := FALSE
+        ELSIF (t1.typ = tPROCEDURE) & (t2.typ = tPROCEDURE) THEN
 
-        res := res & isTypeEq(t1.base, t2.base)
+            param1 := t1.params.first;
+            param2 := t2.params.first;
 
-    ELSIF (t1.typ = tARRAY) & (t2.typ = tARRAY) THEN
-        res := (t1.length = 0) & (t2.length = 0) & isTypeEq(t1.base, t2.base)
-    ELSE
-        res := FALSE
-    END
+            res := ((t1.call = t2.call) OR (t1.call IN {code, _code}) OR (t2.call IN {code, _code})) & ((param1 # NIL) = (param2 # NIL));
 
-    RETURN res
-END isTypeEq;
+            WHILE res & (param1 # NIL) & (param2 # NIL) DO
+                res := (param1(PARAM).vPar = param2(PARAM).vPar) & isTypeEq(param1(PARAM)._type, param2(PARAM)._type);
+                param1 := param1.next;
+                param2 := param2.next;
+                res := res & ((param1 # NIL) = (param2 # NIL))
+            END;
 
+            res := res & isTypeEq(t1.base, t2.base)
 
-PROCEDURE isBaseOf* (t0, t1: _TYPE): BOOLEAN;
-VAR
-    res: BOOLEAN;
+        ELSIF (t1.typ = tARRAY) & (t2.typ = tARRAY) THEN
+            res := (t1.length = 0) & (t2.length = 0) & isTypeEq(t1.base, t2.base)
+        ELSE
+            res := FALSE
+        END
 
-BEGIN
-    res := (t0.typ = t1.typ) & (t0.typ IN {tPOINTER, tRECORD});
+        RETURN res
+    END isTypeEq;
 
-    IF res & (t0.typ = tPOINTER) THEN
-        t0 := t0.base;
-        t1 := t1.base
-    END;
 
-    IF res THEN
-        WHILE (t1 # NIL) & (t1 # t0) DO
+PROCEDURE isBaseOf* (t0, t1: _TYPE): BOOLEAN;
+    VAR
+        res: BOOLEAN;
+
+    BEGIN
+        res := (t0.typ = t1.typ) & (t0.typ IN {tPOINTER, tRECORD});
+
+        IF res & (t0.typ = tPOINTER) THEN
+            t0 := t0.base;
             t1 := t1.base
         END;
-        res := t1 # NIL
-    END
 
-    RETURN res
-END isBaseOf;
+        IF res THEN
+            WHILE (t1 # NIL) & (t1 # t0) DO
+                t1 := t1.base
+            END;
+            res := t1 # NIL
+        END
+
+        RETURN res
+    END isBaseOf;
 
 
 PROCEDURE isOpenArray* (t: _TYPE): BOOLEAN;
-    RETURN (t.typ = tARRAY) & (t.length = 0)
-END isOpenArray;
+        RETURN (t.typ = tARRAY) & (t.length = 0)
+    END isOpenArray;
 
 
 PROCEDURE arrcomp* (src, dst: _TYPE): BOOLEAN;
-    RETURN (dst.typ = tARRAY) & isOpenArray(src) &
-            ~isOpenArray(src.base) & ~isOpenArray(dst.base) &
-            isTypeEq(src.base, dst.base)
-END arrcomp;
+        RETURN (dst.typ = tARRAY) & isOpenArray(src) &
+                ~isOpenArray(src.base) & ~isOpenArray(dst.base) &
+                isTypeEq(src.base, dst.base)
+    END arrcomp;
 
 
 PROCEDURE getUnit* (name: PATHS.PATH): UNIT;
-VAR
-    item: UNIT;
+    VAR
+        item: UNIT;
 
-BEGIN
-    item := program.units.first(UNIT);
+    BEGIN
+        item := program.units.first(UNIT);
 
-    WHILE (item # NIL) & (item.fname # name) DO
-        item := item.next(UNIT)
-    END;
+        WHILE (item # NIL) & (item.fname # name) DO
+            item := item.next(UNIT)
+        END;
 
-    IF (item = NIL) & ((name = "SYSTEM") OR LowerCase & (name = "system")) THEN
-        item := program.sysunit
-    END
+        IF (item = NIL) & ((name = "SYSTEM") OR LowerCase & (name = "system")) THEN
+            item := program.sysunit
+        END
 
-    RETURN item
-END getUnit;
+        RETURN item
+    END getUnit;
 
 
 PROCEDURE enterStTypes (unit: UNIT);
 
 
-    PROCEDURE enter (unit: UNIT; nameStr: SCAN.IDSTR; _type: _TYPE);
-    VAR
-        ident: IDENT;
-        upper: SCAN.IDSTR;
-        name:  SCAN.IDENT;
+        PROCEDURE enter (unit: UNIT; nameStr: SCAN.IDSTR; _type: _TYPE);
+            VAR
+                ident: IDENT;
+                upper: SCAN.IDSTR;
+                name:  SCAN.IDENT;
+
+            BEGIN
+                IF LowerCase THEN
+                    SCAN.setIdent(name, nameStr);
+                    ident := addIdent(unit, name, idTYPE);
+                    ident._type := _type
+                END;
+                upper := nameStr;
+                STRINGS.UpCase(upper);
+                SCAN.setIdent(name, upper);
+                ident := addIdent(unit, name, idTYPE);
+                ident._type := _type
+            END enter;
+
 
     BEGIN
-        IF LowerCase THEN
-            SCAN.setIdent(name, nameStr);
-            ident := addIdent(unit, name, idTYPE);
-            ident._type := _type
+        enter(unit, "integer", program.stTypes.tINTEGER);
+        enter(unit, "byte",    program.stTypes.tBYTE);
+        enter(unit, "char",    program.stTypes.tCHAR);
+        enter(unit, "set",     program.stTypes.tSET);
+        enter(unit, "boolean", program.stTypes.tBOOLEAN);
+
+        IF TARGETS.RealSize # 0 THEN
+            enter(unit, "real", program.stTypes.tREAL)
         END;
-        upper := nameStr;
-        STRINGS.UpCase(upper);
-        SCAN.setIdent(name, upper);
-        ident := addIdent(unit, name, idTYPE);
-        ident._type := _type
-    END enter;
-
-
-BEGIN
-    enter(unit, "integer", program.stTypes.tINTEGER);
-    enter(unit, "byte",    program.stTypes.tBYTE);
-    enter(unit, "char",    program.stTypes.tCHAR);
-    enter(unit, "set",     program.stTypes.tSET);
-    enter(unit, "boolean", program.stTypes.tBOOLEAN);
-
-    IF TARGETS.RealSize # 0 THEN
-        enter(unit, "real", program.stTypes.tREAL)
-    END;
 
-    IF TARGETS.BitDepth >= 32 THEN
-        enter(unit, "wchar", program.stTypes.tWCHAR)
-    END
-END enterStTypes;
+        IF TARGETS.BitDepth >= 32 THEN
+            enter(unit, "wchar", program.stTypes.tWCHAR)
+        END
+    END enterStTypes;
 
 
 PROCEDURE enterStProcs (unit: UNIT);
 
 
-    PROCEDURE Enter (unit: UNIT; nameStr: SCAN.IDSTR; nfunc, tfunc: INTEGER);
-    VAR
-        ident: IDENT;
-        upper: SCAN.IDSTR;
-        name:  SCAN.IDENT;
+        PROCEDURE Enter (unit: UNIT; nameStr: SCAN.IDSTR; nfunc, tfunc: INTEGER);
+            VAR
+                ident: IDENT;
+                upper: SCAN.IDSTR;
+                name:  SCAN.IDENT;
+
+            BEGIN
+                IF LowerCase THEN
+                    SCAN.setIdent(name, nameStr);
+                    ident := addIdent(unit, name, tfunc);
+                    ident.stproc := nfunc;
+                    ident._type := program.stTypes.tNONE
+                END;
+                upper := nameStr;
+                STRINGS.UpCase(upper);
+                SCAN.setIdent(name, upper);
+                ident := addIdent(unit, name, tfunc);
+                ident.stproc := nfunc;
+                ident._type := program.stTypes.tNONE
+            END Enter;
+
 
     BEGIN
-        IF LowerCase THEN
-            SCAN.setIdent(name, nameStr);
-            ident := addIdent(unit, name, tfunc);
-            ident.stproc := nfunc;
-            ident._type := program.stTypes.tNONE
+        Enter(unit, "assert", stASSERT, idSTPROC);
+        Enter(unit, "dec",    stDEC,    idSTPROC);
+        Enter(unit, "excl",   stEXCL,   idSTPROC);
+        Enter(unit, "inc",    stINC,    idSTPROC);
+        Enter(unit, "incl",   stINCL,   idSTPROC);
+        Enter(unit, "new",    stNEW,    idSTPROC);
+        Enter(unit, "copy",   stCOPY,   idSTPROC);
+
+        Enter(unit, "abs",    stABS,    idSTFUNC);
+        Enter(unit, "asr",    stASR,    idSTFUNC);
+        Enter(unit, "chr",    stCHR,    idSTFUNC);
+        Enter(unit, "len",    stLEN,    idSTFUNC);
+        Enter(unit, "lsl",    stLSL,    idSTFUNC);
+        Enter(unit, "odd",    stODD,    idSTFUNC);
+        Enter(unit, "ord",    stORD,    idSTFUNC);
+        Enter(unit, "ror",    stROR,    idSTFUNC);
+        Enter(unit, "bits",   stBITS,   idSTFUNC);
+        Enter(unit, "lsr",    stLSR,    idSTFUNC);
+        Enter(unit, "length", stLENGTH, idSTFUNC);
+        Enter(unit, "min",    stMIN,    idSTFUNC);
+        Enter(unit, "max",    stMAX,    idSTFUNC);
+
+        IF TARGETS.RealSize # 0 THEN
+            Enter(unit, "pack",  stPACK,  idSTPROC);
+            Enter(unit, "unpk",  stUNPK,  idSTPROC);
+            Enter(unit, "floor", stFLOOR, idSTFUNC);
+            Enter(unit, "flt",   stFLT,   idSTFUNC)
         END;
-        upper := nameStr;
-        STRINGS.UpCase(upper);
-        SCAN.setIdent(name, upper);
-        ident := addIdent(unit, name, tfunc);
-        ident.stproc := nfunc;
-        ident._type := program.stTypes.tNONE
-    END Enter;
-
-
-BEGIN
-    Enter(unit, "assert", stASSERT, idSTPROC);
-    Enter(unit, "dec",    stDEC,    idSTPROC);
-    Enter(unit, "excl",   stEXCL,   idSTPROC);
-    Enter(unit, "inc",    stINC,    idSTPROC);
-    Enter(unit, "incl",   stINCL,   idSTPROC);
-    Enter(unit, "new",    stNEW,    idSTPROC);
-    Enter(unit, "copy",   stCOPY,   idSTPROC);
-
-    Enter(unit, "abs",    stABS,    idSTFUNC);
-    Enter(unit, "asr",    stASR,    idSTFUNC);
-    Enter(unit, "chr",    stCHR,    idSTFUNC);
-    Enter(unit, "len",    stLEN,    idSTFUNC);
-    Enter(unit, "lsl",    stLSL,    idSTFUNC);
-    Enter(unit, "odd",    stODD,    idSTFUNC);
-    Enter(unit, "ord",    stORD,    idSTFUNC);
-    Enter(unit, "ror",    stROR,    idSTFUNC);
-    Enter(unit, "bits",   stBITS,   idSTFUNC);
-    Enter(unit, "lsr",    stLSR,    idSTFUNC);
-    Enter(unit, "length", stLENGTH, idSTFUNC);
-    Enter(unit, "min",    stMIN,    idSTFUNC);
-    Enter(unit, "max",    stMAX,    idSTFUNC);
-
-    IF TARGETS.RealSize # 0 THEN
-        Enter(unit, "pack",  stPACK,  idSTPROC);
-        Enter(unit, "unpk",  stUNPK,  idSTPROC);
-        Enter(unit, "floor", stFLOOR, idSTFUNC);
-        Enter(unit, "flt",   stFLT,   idSTFUNC)
-    END;
 
-    IF TARGETS.BitDepth >= 32 THEN
-        Enter(unit, "wchr", stWCHR, idSTFUNC)
-    END;
+        IF TARGETS.BitDepth >= 32 THEN
+            Enter(unit, "wchr", stWCHR, idSTFUNC)
+        END;
 
-    IF TARGETS.Dispose THEN
-        Enter(unit, "dispose", stDISPOSE, idSTPROC)
-    END
+        IF TARGETS.Dispose THEN
+            Enter(unit, "dispose", stDISPOSE, idSTPROC)
+        END
 
-END enterStProcs;
+    END enterStProcs;
 
 
 PROCEDURE newUnit* (name: SCAN.IDENT): UNIT;
-VAR
-    unit: UNIT;
+    VAR
+        unit: UNIT;
 
-BEGIN
-    NEW(unit);
+    BEGIN
+        NEW(unit);
 
-    unit.name        := name;
-    unit.closed      := FALSE;
-    unit.idents      := LISTS.create(NIL);
-    unit.frwPointers := LISTS.create(NIL);
+        unit.name        := name;
+        unit.closed      := FALSE;
+        unit.idents      := LISTS.create(NIL);
+        unit.frwPointers := LISTS.create(NIL);
 
-    ASSERT(openScope(unit, NIL));
+        ASSERT(openScope(unit, NIL));
 
-    enterStTypes(unit);
-    enterStProcs(unit);
+        enterStTypes(unit);
+        enterStProcs(unit);
 
-    ASSERT(openScope(unit, NIL));
+        ASSERT(openScope(unit, NIL));
 
-    unit.gscope := unit.idents.last(IDENT);
+        unit.gscope := unit.idents.last(IDENT);
 
-    LISTS.push(program.units, unit);
+        LISTS.push(program.units, unit);
 
-    unit.scopeLvl := 0;
-    unit.scopes[0] := NIL;
+        unit.scopeLvl := 0;
+        unit.scopes[0] := NIL;
 
-    unit.sysimport := FALSE;
+        unit.sysimport := FALSE;
 
-    IF unit.name.s = UTILS.RTL_NAME THEN
-        program.rtl := unit
-    END
+        IF unit.name.s = UTILS.RTL_NAME THEN
+            program.rtl := unit
+        END
 
-    RETURN unit
-END newUnit;
+        RETURN unit
+    END newUnit;
 
 
 PROCEDURE getField* (self: _TYPE; name: SCAN.IDENT; unit: UNIT): FIELD;
-VAR
-    field: FIELD;
+    VAR
+        field: FIELD;
 
-BEGIN
-    ASSERT(self # NIL);
-    ASSERT(unit # NIL);
+    BEGIN
+        ASSERT(self # NIL);
+        ASSERT(unit # NIL);
 
-    field := NIL;
-    WHILE (self # NIL) & (field = NIL) DO
+        field := NIL;
+        WHILE (self # NIL) & (field = NIL) DO
 
-        field := self.fields.first(FIELD);
+            field := self.fields.first(FIELD);
 
-        WHILE (field # NIL) & ~IdEq(field.name, name) DO
-            field := field.next(FIELD)
-        END;
+            WHILE (field # NIL) & ~IdEq(field.name, name) DO
+                field := field.next(FIELD)
+            END;
 
-        IF field = NIL THEN
-            self := self.base
-        END
+            IF field = NIL THEN
+                self := self.base
+            END
 
-    END;
+        END;
 
-    IF (field # NIL) & (self.unit # unit) & ~field.export THEN
-        field := NIL
-    END
+        IF (field # NIL) & (self.unit # unit) & ~field.export THEN
+            field := NIL
+        END
 
-    RETURN field
-END getField;
+        RETURN field
+    END getField;
 
 
 PROCEDURE addField* (self: _TYPE; name: SCAN.IDENT; export: BOOLEAN): BOOLEAN;
-VAR
-    field: FIELD;
-    res:   BOOLEAN;
+    VAR
+        field: FIELD;
+        res:   BOOLEAN;
 
-BEGIN
-    res := getField(self, name, self.unit) = NIL;
+    BEGIN
+        res := getField(self, name, self.unit) = NIL;
 
-    IF res THEN
-        NEW(field);
+        IF res THEN
+            NEW(field);
 
-        field.name   := name;
-        field.export := export;
-        field._type  := NIL;
-        field.offset := self.size;
+            field.name   := name;
+            field.export := export;
+            field._type  := NIL;
+            field.offset := self.size;
 
-        LISTS.push(self.fields, field)
-    END
+            LISTS.push(self.fields, field)
+        END
 
-    RETURN res
-END addField;
+        RETURN res
+    END addField;
 
 
 PROCEDURE setFields* (self: _TYPE; _type: _TYPE): BOOLEAN;
-VAR
-    item: FIELD;
-    res:  BOOLEAN;
+    VAR
+        item: FIELD;
+        res:  BOOLEAN;
 
-BEGIN
-    ASSERT(_type # NIL);
+    BEGIN
+        ASSERT(_type # NIL);
 
-    item := self.fields.first(FIELD);
+        item := self.fields.first(FIELD);
 
-    WHILE (item # NIL) & (item._type # NIL) DO
-        item := item.next(FIELD)
-    END;
+        WHILE (item # NIL) & (item._type # NIL) DO
+            item := item.next(FIELD)
+        END;
 
-    res := TRUE;
+        res := TRUE;
 
-    WHILE res & (item # NIL) & (item._type = NIL) DO
-        item._type := _type;
-        IF ~self.noalign THEN
-            res := UTILS.Align(self.size, _type.align)
-        ELSE
-            res := TRUE
-        END;
-        item.offset := self.size;
-        res := res & (UTILS.maxint - self.size >= _type.size);
-        IF res THEN
-            INC(self.size, _type.size)
-        END;
-        item := item.next(FIELD)
-    END
+        WHILE res & (item # NIL) & (item._type = NIL) DO
+            item._type := _type;
+            IF ~self.noalign THEN
+                res := UTILS.Align(self.size, _type.align)
+            ELSE
+                res := TRUE
+            END;
+            item.offset := self.size;
+            res := res & (UTILS.maxint - self.size >= _type.size);
+            IF res THEN
+                INC(self.size, _type.size)
+            END;
+            item := item.next(FIELD)
+        END
 
-    RETURN res
-END setFields;
+        RETURN res
+    END setFields;
 
 
 PROCEDURE getParam* (self: _TYPE; name: SCAN.IDENT): PARAM;
-VAR
-    item: PARAM;
+    VAR
+        item: PARAM;
 
-BEGIN
-    item := self.params.first(PARAM);
+    BEGIN
+        item := self.params.first(PARAM);
 
-    WHILE (item # NIL) & ~IdEq(item.name, name) DO
-        item := item.next(PARAM)
-    END
+        WHILE (item # NIL) & ~IdEq(item.name, name) DO
+            item := item.next(PARAM)
+        END
 
-    RETURN item
-END getParam;
+        RETURN item
+    END getParam;
 
 
 PROCEDURE addParam* (self: _TYPE; name: SCAN.IDENT; vPar: BOOLEAN): BOOLEAN;
-VAR
-    param: PARAM;
-    res:   BOOLEAN;
+    VAR
+        param: PARAM;
+        res:   BOOLEAN;
 
-BEGIN
-    res := getParam(self, name) = NIL;
+    BEGIN
+        res := getParam(self, name) = NIL;
 
-    IF res THEN
-        NEW(param);
+        IF res THEN
+            NEW(param);
 
-        param.name  := name;
-        param._type := NIL;
-        param.vPar  := vPar;
+            param.name  := name;
+            param._type := NIL;
+            param.vPar  := vPar;
 
-        LISTS.push(self.params, param)
-    END
+            LISTS.push(self.params, param)
+        END
 
-    RETURN res
-END addParam;
+        RETURN res
+    END addParam;
 
 
 PROCEDURE Dim* (t: _TYPE): INTEGER;
-VAR
-    res: INTEGER;
+    VAR
+        res: INTEGER;
 
-BEGIN
-    res := 0;
-    WHILE isOpenArray(t) DO
-        t := t.base;
-        INC(res)
-    END
-    RETURN res
-END Dim;
+    BEGIN
+        res := 0;
+        WHILE isOpenArray(t) DO
+            t := t.base;
+            INC(res)
+        END
+        RETURN res
+    END Dim;
 
 
 PROCEDURE OpenBase* (t: _TYPE): _TYPE;
-BEGIN
-    WHILE isOpenArray(t) DO t := t.base END
-    RETURN t
-END OpenBase;
+    BEGIN
+        WHILE isOpenArray(t) DO t := t.base END
+        RETURN t
+    END OpenBase;
 
 
 PROCEDURE getFloatParamsPos* (self: _TYPE; maxoffs: INTEGER; VAR int, flt: INTEGER): SET;
-VAR
-    res: SET;
-    param: PARAM;
-
-BEGIN
-    res := {};
-    int := 0;
-    flt := 0;
-    param := self.params.first(PARAM);
-    WHILE (param # NIL) & (param.offset <= maxoffs + STACK_FRAME) DO
-        IF ~param.vPar & (param._type.typ = tREAL) THEN
-            INCL(res, param.offset - STACK_FRAME);
-            INC(flt)
+    VAR
+        res: SET;
+        param: PARAM;
+
+    BEGIN
+        res := {};
+        int := 0;
+        flt := 0;
+        param := self.params.first(PARAM);
+        WHILE (param # NIL) & (param.offset <= maxoffs + STACK_FRAME) DO
+            IF ~param.vPar & (param._type.typ = tREAL) THEN
+                INCL(res, param.offset - STACK_FRAME);
+                INC(flt)
+            END;
+            param := param.next(PARAM)
         END;
-        param := param.next(PARAM)
-    END;
 
-    int := self.parSize - flt
+        int := self.parSize - flt
 
-    RETURN res
-END getFloatParamsPos;
+        RETURN res
+    END getFloatParamsPos;
 
 
 PROCEDURE setParams* (self: _TYPE; _type: _TYPE);
-VAR
-    item: LISTS.ITEM;
-    param: PARAM;
-    word, size: INTEGER;
+    VAR
+        item: LISTS.ITEM;
+        param: PARAM;
+        word, size: INTEGER;
 
-BEGIN
-    ASSERT(_type # NIL);
+    BEGIN
+        ASSERT(_type # NIL);
 
-    word := UTILS.target.bit_depth DIV 8;
+        word := UTILS.target.bit_depth DIV 8;
 
-    item := self.params.first;
+        item := self.params.first;
 
-    WHILE (item # NIL) & (item(PARAM)._type # NIL) DO
-        item := item.next
-    END;
+        WHILE (item # NIL) & (item(PARAM)._type # NIL) DO
+            item := item.next
+        END;
 
-    WHILE (item # NIL) & (item(PARAM)._type = NIL) DO
-        param := item(PARAM);
-        param._type := _type;
-        IF param.vPar THEN
-            IF _type.typ = tRECORD THEN
-                size := 2
-            ELSIF isOpenArray(_type) THEN
-                size := Dim(_type) + 1
-            ELSE
-                size := 1
-            END;
-            param.offset := self.parSize + ORD(_type.typ = tRECORD) + Dim(_type) + STACK_FRAME;
-            INC(self.parSize, size)
-        ELSE
-            IF _type.typ IN {tRECORD, tARRAY} THEN
-                IF isOpenArray(_type) THEN
+        WHILE (item # NIL) & (item(PARAM)._type = NIL) DO
+            param := item(PARAM);
+            param._type := _type;
+            IF param.vPar THEN
+                IF _type.typ = tRECORD THEN
+                    size := 2
+                ELSIF isOpenArray(_type) THEN
                     size := Dim(_type) + 1
                 ELSE
                     size := 1
-                END
+                END;
+                param.offset := self.parSize + ORD(_type.typ = tRECORD) + Dim(_type) + STACK_FRAME;
+                INC(self.parSize, size)
             ELSE
-                size := _type.size;
-                ASSERT(UTILS.Align(size, word));
-                size := size DIV word
+                IF _type.typ IN {tRECORD, tARRAY} THEN
+                    IF isOpenArray(_type) THEN
+                        size := Dim(_type) + 1
+                    ELSE
+                        size := 1
+                    END
+                ELSE
+                    size := _type.size;
+                    ASSERT(UTILS.Align(size, word));
+                    size := size DIV word
+                END;
+                param.offset := self.parSize + Dim(_type) + STACK_FRAME;
+                INC(self.parSize, size)
             END;
-            param.offset := self.parSize + Dim(_type) + STACK_FRAME;
-            INC(self.parSize, size)
-        END;
 
-        item := item.next
-    END
+            item := item.next
+        END
 
-END setParams;
+    END setParams;
 
 
 PROCEDURE enterType* (typ, size, length: INTEGER; unit: UNIT): _TYPE;
-VAR
-    t: _TYPE;
-
-BEGIN
-    NEW(t);
-
-    t.typ     := typ;
-    t.size    := size;
-    t.length  := length;
-    t.align   := 0;
-    t.base    := NIL;
-    t.fields  := LISTS.create(NIL);
-    t.params  := LISTS.create(NIL);
-    t.unit    := unit;
-    t.num     := 0;
-
-    CASE TARGETS.BitDepth OF
-    |16: t.call := default16
-    |32: t.call := default32
-    |64: t.call := default64
-    END;
+    VAR
+        t: _TYPE;
 
-    t._import := FALSE;
-    t.noalign := FALSE;
-    t.parSize := 0;
+    BEGIN
+        NEW(t);
+
+        t.typ     := typ;
+        t.size    := size;
+        t.length  := length;
+        t.align   := 0;
+        t.base    := NIL;
+        t.fields  := LISTS.create(NIL);
+        t.params  := LISTS.create(NIL);
+        t.unit    := unit;
+        t.num     := 0;
+
+        CASE TARGETS.BitDepth OF
+        |16: t.call := default16
+        |32: t.call := default32
+        |64: t.call := default64
+        END;
 
-    IF typ IN {tARRAY, tRECORD} THEN
-        t.closed := FALSE;
-        IF typ = tRECORD THEN
-            INC(program.recCount);
-            t.num := program.recCount
-        END
-    ELSE
-        t.closed := TRUE
-    END;
+        t._import := FALSE;
+        t.noalign := FALSE;
+        t.parSize := 0;
 
-    LISTS.push(program.types, t)
+        IF typ IN {tARRAY, tRECORD} THEN
+            t.closed := FALSE;
+            IF typ = tRECORD THEN
+                INC(program.recCount);
+                t.num := program.recCount
+            END
+        ELSE
+            t.closed := TRUE
+        END;
+
+        LISTS.push(program.types, t)
 
-    RETURN t
-END enterType;
+        RETURN t
+    END enterType;
 
 
 PROCEDURE getType* (typ: INTEGER): _TYPE;
-VAR
-    res: _TYPE;
+    VAR
+        res: _TYPE;
 
-BEGIN
+    BEGIN
 
-    CASE typ OF
-    |ARITH.tINTEGER: res := program.stTypes.tINTEGER
-    |ARITH.tREAL:    res := program.stTypes.tREAL
-    |ARITH.tSET:     res := program.stTypes.tSET
-    |ARITH.tBOOLEAN: res := program.stTypes.tBOOLEAN
-    |ARITH.tCHAR:    res := program.stTypes.tCHAR
-    |ARITH.tWCHAR:   res := program.stTypes.tWCHAR
-    |ARITH.tSTRING:  res := program.stTypes.tSTRING
-    END
+        CASE typ OF
+        |ARITH.tINTEGER: res := program.stTypes.tINTEGER
+        |ARITH.tREAL:    res := program.stTypes.tREAL
+        |ARITH.tSET:     res := program.stTypes.tSET
+        |ARITH.tBOOLEAN: res := program.stTypes.tBOOLEAN
+        |ARITH.tCHAR:    res := program.stTypes.tCHAR
+        |ARITH.tWCHAR:   res := program.stTypes.tWCHAR
+        |ARITH.tSTRING:  res := program.stTypes.tSTRING
+        END
 
-    RETURN res
-END getType;
+        RETURN res
+    END getType;
 
 
 PROCEDURE createSysUnit;
-VAR
-    ident: IDENT;
-    unit:  UNIT;
-    name:  SCAN.IDENT;
-
-
-    PROCEDURE EnterProc (sys: UNIT; nameStr: SCAN.IDSTR; idtyp, proc: INTEGER);
     VAR
         ident: IDENT;
-        upper: SCAN.IDSTR;
+        unit:  UNIT;
         name:  SCAN.IDENT;
 
-    BEGIN
-        IF LowerCase THEN
-            SCAN.setIdent(name, nameStr);
+
+        PROCEDURE EnterProc (sys: UNIT; nameStr: SCAN.IDSTR; idtyp, proc: INTEGER);
+        VAR
+            ident: IDENT;
+            upper: SCAN.IDSTR;
+            name:  SCAN.IDENT;
+
+        BEGIN
+            IF LowerCase THEN
+                SCAN.setIdent(name, nameStr);
+                ident := addIdent(sys, name, idtyp);
+                ident.stproc := proc;
+                ident._type := program.stTypes.tNONE;
+                ident.export := TRUE
+            END;
+            upper := nameStr;
+            STRINGS.UpCase(upper);
+            SCAN.setIdent(name, upper);
             ident := addIdent(sys, name, idtyp);
             ident.stproc := proc;
             ident._type := program.stTypes.tNONE;
             ident.export := TRUE
-        END;
-        upper := nameStr;
-        STRINGS.UpCase(upper);
-        SCAN.setIdent(name, upper);
-        ident := addIdent(sys, name, idtyp);
-        ident.stproc := proc;
-        ident._type := program.stTypes.tNONE;
-        ident.export := TRUE
-    END EnterProc;
-
-
-BEGIN
-    SCAN.setIdent(name, "$SYSTEM");
-    unit := newUnit(name);
-    unit.fname := "SYSTEM";
-
-    EnterProc(unit, "adr",    idSYSFUNC, sysADR);
-    EnterProc(unit, "size",   idSYSFUNC, sysSIZE);
-    EnterProc(unit, "sadr",   idSYSFUNC, sysSADR);
-    EnterProc(unit, "typeid", idSYSFUNC, sysTYPEID);
-
-    EnterProc(unit, "get",    idSYSPROC, sysGET);
-    EnterProc(unit, "get8",   idSYSPROC, sysGET8);
-    EnterProc(unit, "put",    idSYSPROC, sysPUT);
-    EnterProc(unit, "put8",   idSYSPROC, sysPUT8);
-    EnterProc(unit, "code",   idSYSPROC, sysCODE);
-    EnterProc(unit, "move",   idSYSPROC, sysMOVE);
-    EnterProc(unit, "val",    idSYSPROC, sysVAL);
-           (*
-    IF program.target.sys = mConst.Target_iMSP430 THEN
-        EnterProc(unit, "nop",  idSYSPROC, sysNOP);
-        EnterProc(unit, "eint", idSYSPROC, sysEINT);
-        EnterProc(unit, "dint", idSYSPROC, sysDINT)
-    END;
-         *)
-    IF TARGETS.RealSize # 0 THEN
-        EnterProc(unit, "inf",    idSYSFUNC, sysINF);
-    END;
+        END EnterProc;
 
-    IF TARGETS.CPU IN {TARGETS.cpuX86, TARGETS.cpuAMD64} THEN
-        EnterProc(unit, "copy",   idSYSPROC, sysCOPY)
-    END;
 
-    IF TARGETS.BitDepth >= 32 THEN
-        EnterProc(unit, "wsadr",  idSYSFUNC, sysWSADR);
-        EnterProc(unit, "put16",  idSYSPROC, sysPUT16);
-        EnterProc(unit, "put32",  idSYSPROC, sysPUT32);
-        EnterProc(unit, "get16",  idSYSPROC, sysGET16);
-        EnterProc(unit, "get32",  idSYSPROC, sysGET32);
+    BEGIN
+        SCAN.setIdent(name, "$SYSTEM");
+        unit := newUnit(name);
+        unit.fname := "SYSTEM";
+
+        EnterProc(unit, "adr",    idSYSFUNC, sysADR);
+        EnterProc(unit, "size",   idSYSFUNC, sysSIZE);
+        EnterProc(unit, "sadr",   idSYSFUNC, sysSADR);
+        EnterProc(unit, "typeid", idSYSFUNC, sysTYPEID);
+
+        EnterProc(unit, "get",    idSYSPROC, sysGET);
+        EnterProc(unit, "get8",   idSYSPROC, sysGET8);
+        EnterProc(unit, "put",    idSYSPROC, sysPUT);
+        EnterProc(unit, "put8",   idSYSPROC, sysPUT8);
+        EnterProc(unit, "code",   idSYSPROC, sysCODE);
+        EnterProc(unit, "move",   idSYSPROC, sysMOVE);
+        EnterProc(unit, "val",    idSYSPROC, sysVAL);
+            (*
+        IF program.target.sys = mConst.Target_iMSP430 THEN
+            EnterProc(unit, "nop",  idSYSPROC, sysNOP);
+            EnterProc(unit, "eint", idSYSPROC, sysEINT);
+            EnterProc(unit, "dint", idSYSPROC, sysDINT)
+        END;
+            *)
+        IF TARGETS.RealSize # 0 THEN
+            EnterProc(unit, "inf",    idSYSFUNC, sysINF);
+        END;
+
+        IF TARGETS.CPU IN {TARGETS.cpuX86, TARGETS.cpuAMD64} THEN
+            EnterProc(unit, "copy",   idSYSPROC, sysCOPY)
+        END;
 
-        IF LowerCase THEN
-            SCAN.setIdent(name, "card32");
+        IF TARGETS.BitDepth >= 32 THEN
+            EnterProc(unit, "wsadr",  idSYSFUNC, sysWSADR);
+            EnterProc(unit, "put16",  idSYSPROC, sysPUT16);
+            EnterProc(unit, "put32",  idSYSPROC, sysPUT32);
+            EnterProc(unit, "get16",  idSYSPROC, sysGET16);
+            EnterProc(unit, "get32",  idSYSPROC, sysGET32);
+
+            IF LowerCase THEN
+                SCAN.setIdent(name, "card32");
+                ident := addIdent(unit, name, idTYPE);
+                ident._type := program.stTypes.tCARD32;
+                ident.export := TRUE
+            END;
+            SCAN.setIdent(name, "CARD32");
             ident := addIdent(unit, name, idTYPE);
             ident._type := program.stTypes.tCARD32;
-            ident.export := TRUE
+            ident.export := TRUE;
         END;
-        SCAN.setIdent(name, "CARD32");
-        ident := addIdent(unit, name, idTYPE);
-        ident._type := program.stTypes.tCARD32;
-        ident.export := TRUE;
-    END;
 
-    closeUnit(unit);
+        closeUnit(unit);
 
-    program.sysunit := unit
-END createSysUnit;
+        program.sysunit := unit
+    END createSysUnit;
 
 
 PROCEDURE DelUnused* (DelImport: DELIMPORT);
-VAR
-    proc: PROC;
-    flag: BOOLEAN;
+    VAR
+        proc: PROC;
+        flag: BOOLEAN;
 
 
-    PROCEDURE process (proc: PROC);
-    VAR
-        used_proc: LISTS.ITEM;
+        PROCEDURE process (proc: PROC);
+        VAR
+            used_proc: LISTS.ITEM;
 
-    BEGIN
-        proc.processed := TRUE;
+        BEGIN
+            proc.processed := TRUE;
 
-        used_proc := proc.using.first;
-        WHILE used_proc # NIL DO
-            used_proc(USED_PROC).proc.used := TRUE;
-            used_proc := used_proc.next
-        END
+            used_proc := proc.using.first;
+            WHILE used_proc # NIL DO
+                used_proc(USED_PROC).proc.used := TRUE;
+                used_proc := used_proc.next
+            END
 
-    END process;
+        END process;
 
 
-BEGIN
+    BEGIN
+
+        REPEAT
+            flag := FALSE;
+            proc := program.procs.first(PROC);
+
+            WHILE proc # NIL DO
+                IF proc.used & ~proc.processed THEN
+                    process(proc);
+                    flag := TRUE
+                END;
+                proc := proc.next(PROC)
+            END
+
+        UNTIL ~flag;
 
-    REPEAT
-        flag := FALSE;
         proc := program.procs.first(PROC);
 
         WHILE proc # NIL DO
-            IF proc.used & ~proc.processed THEN
-                process(proc);
-                flag := TRUE
+            IF ~proc.used THEN
+                IF proc._import = NIL THEN
+                    IL.delete2(proc.enter, proc.leave)
+                ELSE
+                    DelImport(proc._import)
+                END
             END;
             proc := proc.next(PROC)
         END
 
-    UNTIL ~flag;
+    END DelUnused;
 
-    proc := program.procs.first(PROC);
 
-    WHILE proc # NIL DO
-        IF ~proc.used THEN
-            IF proc._import = NIL THEN
-                IL.delete2(proc.enter, proc.leave)
-            ELSE
-                DelImport(proc._import)
-            END
-        END;
-        proc := proc.next(PROC)
-    END
+PROCEDURE ResetLocSize*;
+    BEGIN
+        program.locsize := 0
+    END ResetLocSize;
 
-END DelUnused;
 
+PROCEDURE create* (options: OPTIONS);
+    BEGIN
+        LowerCase := options.lower;
+        SCAN.init(options.lower);
+        idents := C.create();
 
-PROCEDURE ResetLocSize*;
-BEGIN
-    program.locsize := 0
-END ResetLocSize;
+        UTILS.SetBitDepth(TARGETS.BitDepth, TARGETS.RealSize = 8);
 
+        program.options := options;
 
-PROCEDURE create* (options: OPTIONS);
-BEGIN
-    LowerCase := options.lower;
-    SCAN.init(options.lower);
-    idents := C.create();
-
-    UTILS.SetBitDepth(TARGETS.BitDepth, TARGETS.RealSize = 8);
-
-    program.options := options;
-
-    CASE TARGETS.OS OF
-    |TARGETS.osWIN32:    program.sysflags := {sf_oberon, sf_windows, sf_stdcall, sf_cdecl, sf_ccall, sf_fastcall, sf_noalign}
-    |TARGETS.osLINUX32:  program.sysflags := {sf_oberon, sf_linux, sf_stdcall, sf_cdecl, sf_ccall, sf_fastcall, sf_noalign}
-    |TARGETS.osKOS:      program.sysflags := {sf_oberon, sf_stdcall, sf_cdecl, sf_ccall, sf_fastcall, sf_noalign}
-    |TARGETS.osWIN64:    program.sysflags := {sf_oberon, sf_windows, sf_win64, sf_systemv, sf_ccall, sf_noalign}
-    |TARGETS.osLINUX64:  program.sysflags := {sf_oberon, sf_linux, sf_win64, sf_systemv, sf_ccall, sf_noalign}
-    |TARGETS.osNONE:     program.sysflags := {sf_code}
-    END;
+        CASE TARGETS.OS OF
+        |TARGETS.osWIN32:    program.sysflags := {sf_oberon, sf_windows, sf_stdcall, sf_cdecl, sf_ccall, sf_fastcall, sf_noalign}
+        |TARGETS.osLINUX32:  program.sysflags := {sf_oberon, sf_linux, sf_stdcall, sf_cdecl, sf_ccall, sf_fastcall, sf_noalign}
+        |TARGETS.osKOS:      program.sysflags := {sf_oberon, sf_stdcall, sf_cdecl, sf_ccall, sf_fastcall, sf_noalign}
+        |TARGETS.osWIN64:    program.sysflags := {sf_oberon, sf_windows, sf_win64, sf_systemv, sf_ccall, sf_noalign}
+        |TARGETS.osLINUX64:  program.sysflags := {sf_oberon, sf_linux, sf_win64, sf_systemv, sf_ccall, sf_noalign}
+        |TARGETS.osNONE:     program.sysflags := {sf_code}
+        END;
 
-    program.recCount := -1;
-    program.bss := 0;
-
-    program.units := LISTS.create(NIL);
-    program.types := LISTS.create(NIL);
-    program.procs := LISTS.create(NIL);
-
-    program.stTypes.tINTEGER := enterType(tINTEGER, TARGETS.WordSize, 0, NIL);
-    program.stTypes.tBYTE    := enterType(tBYTE,                   1, 0, NIL);
-    program.stTypes.tCHAR    := enterType(tCHAR,                   1, 0, NIL);
-    program.stTypes.tSET     := enterType(tSET,     TARGETS.WordSize, 0, NIL);
-    program.stTypes.tBOOLEAN := enterType(tBOOLEAN,                1, 0, NIL);
-
-    program.stTypes.tINTEGER.align := TARGETS.WordSize;
-    program.stTypes.tBYTE.align    := 1;
-    program.stTypes.tCHAR.align    := 1;
-    program.stTypes.tSET.align     := TARGETS.WordSize;
-    program.stTypes.tBOOLEAN.align := 1;
-
-    IF TARGETS.BitDepth >= 32 THEN
-        program.stTypes.tWCHAR  := enterType(tWCHAR,  2, 0, NIL);
-        program.stTypes.tCARD32 := enterType(tCARD32, 4, 0, NIL);
-        program.stTypes.tWCHAR.align  := 2;
-        program.stTypes.tCARD32.align := 4
-    END;
+        program.recCount := -1;
+        program.bss := 0;
+
+        program.units := LISTS.create(NIL);
+        program.types := LISTS.create(NIL);
+        program.procs := LISTS.create(NIL);
+
+        program.stTypes.tINTEGER := enterType(tINTEGER, TARGETS.WordSize, 0, NIL);
+        program.stTypes.tBYTE    := enterType(tBYTE,                   1, 0, NIL);
+        program.stTypes.tCHAR    := enterType(tCHAR,                   1, 0, NIL);
+        program.stTypes.tSET     := enterType(tSET,     TARGETS.WordSize, 0, NIL);
+        program.stTypes.tBOOLEAN := enterType(tBOOLEAN,                1, 0, NIL);
+
+        program.stTypes.tINTEGER.align := TARGETS.WordSize;
+        program.stTypes.tBYTE.align    := 1;
+        program.stTypes.tCHAR.align    := 1;
+        program.stTypes.tSET.align     := TARGETS.WordSize;
+        program.stTypes.tBOOLEAN.align := 1;
+
+        IF TARGETS.BitDepth >= 32 THEN
+            program.stTypes.tWCHAR  := enterType(tWCHAR,  2, 0, NIL);
+            program.stTypes.tCARD32 := enterType(tCARD32, 4, 0, NIL);
+            program.stTypes.tWCHAR.align  := 2;
+            program.stTypes.tCARD32.align := 4
+        END;
 
-    IF TARGETS.RealSize # 0 THEN
-        program.stTypes.tREAL := enterType(tREAL, TARGETS.RealSize, 0, NIL);
-        IF TARGETS.OS = TARGETS.osLINUX32 THEN
-            program.stTypes.tREAL.align := 4
-        ELSE
-            program.stTypes.tREAL.align := TARGETS.RealSize
-        END
-    END;
+        IF TARGETS.RealSize # 0 THEN
+            program.stTypes.tREAL := enterType(tREAL, TARGETS.RealSize, 0, NIL);
+            IF TARGETS.OS = TARGETS.osLINUX32 THEN
+                program.stTypes.tREAL.align := 4
+            ELSE
+                program.stTypes.tREAL.align := TARGETS.RealSize
+            END
+        END;
 
-    program.stTypes.tSTRING := enterType(tSTRING, TARGETS.WordSize, 0, NIL);
-    program.stTypes.tNIL    := enterType(tNIL,    TARGETS.WordSize, 0, NIL);
-    program.stTypes.tNONE   := enterType(tNONE,   0, 0, NIL);
-    program.stTypes.tANYREC := enterType(tRECORD, 0, 0, NIL);
-    program.stTypes.tANYREC.closed := TRUE;
+        program.stTypes.tSTRING := enterType(tSTRING, TARGETS.WordSize, 0, NIL);
+        program.stTypes.tNIL    := enterType(tNIL,    TARGETS.WordSize, 0, NIL);
+        program.stTypes.tNONE   := enterType(tNONE,   0, 0, NIL);
+        program.stTypes.tANYREC := enterType(tRECORD, 0, 0, NIL);
+        program.stTypes.tANYREC.closed := TRUE;
 
-    createSysUnit
-END create;
+        createSysUnit
+    END create;
 
 
 END PROG.

+ 179 - 186
source/REG.ob07

@@ -1,11 +1,4 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2018-2021, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE REG;
+MODULE REG;
 
 
 CONST
@@ -37,250 +30,250 @@ TYPE
 
 
 PROCEDURE push (VAR R: REGS);
-VAR
-    i, reg: INTEGER;
-
-BEGIN
-    reg := R.stk[0];
-    INCL(R.regs, reg);
-    R.push(reg);
-    FOR i := 0 TO R.top - 1 DO
-        R.stk[i] := R.stk[i + 1]
-    END;
-    DEC(R.top);
-    INC(R.pushed)
-END push;
+    VAR
+        i, reg: INTEGER;
+
+    BEGIN
+        reg := R.stk[0];
+        INCL(R.regs, reg);
+        R.push(reg);
+        FOR i := 0 TO R.top - 1 DO
+            R.stk[i] := R.stk[i + 1]
+        END;
+        DEC(R.top);
+        INC(R.pushed)
+    END push;
 
 
 PROCEDURE pop (VAR R: REGS; reg: INTEGER);
-VAR
-    i: INTEGER;
+    VAR
+        i: INTEGER;
 
-BEGIN
-    FOR i := R.top + 1 TO 1 BY -1 DO
-        R.stk[i] := R.stk[i - 1]
-    END;
-    R.stk[0] := reg;
-    EXCL(R.regs, reg);
-    R.pop(reg);
-    INC(R.top);
-    DEC(R.pushed)
-END pop;
+    BEGIN
+        FOR i := R.top + 1 TO 1 BY -1 DO
+            R.stk[i] := R.stk[i - 1]
+        END;
+        R.stk[0] := reg;
+        EXCL(R.regs, reg);
+        R.pop(reg);
+        INC(R.top);
+        DEC(R.pushed)
+    END pop;
 
 
 PROCEDURE InStk (R: REGS; reg: INTEGER): INTEGER;
-VAR
-    i: INTEGER;
+    VAR
+        i: INTEGER;
 
-BEGIN
-    i := R.top;
-    WHILE (i >= 0) & (R.stk[i] # reg) DO
-        DEC(i)
-    END
+    BEGIN
+        i := R.top;
+        WHILE (i >= 0) & (R.stk[i] # reg) DO
+            DEC(i)
+        END
 
-    RETURN i
-END InStk;
+        RETURN i
+    END InStk;
 
 
 PROCEDURE GetFreeReg (R: REGS): INTEGER;
-VAR
-    i: INTEGER;
+    VAR
+        i: INTEGER;
 
-BEGIN
-    i := 0;
-    WHILE (i < N) & ~(i IN R.regs) DO
-        INC(i)
-    END;
+    BEGIN
+        i := 0;
+        WHILE (i < N) & ~(i IN R.regs) DO
+            INC(i)
+        END;
 
-    IF i = N THEN
-        i := -1
-    END
+        IF i = N THEN
+            i := -1
+        END
 
-    RETURN i
-END GetFreeReg;
+        RETURN i
+    END GetFreeReg;
 
 
 PROCEDURE Put (VAR R: REGS; reg: INTEGER);
-BEGIN
-    EXCL(R.regs, reg);
-    INC(R.top);
-    R.stk[R.top] := reg
-END Put;
+    BEGIN
+        EXCL(R.regs, reg);
+        INC(R.top);
+        R.stk[R.top] := reg
+    END Put;
 
 
 PROCEDURE PopAnyReg (VAR R: REGS): INTEGER;
-VAR
-    reg: INTEGER;
+    VAR
+        reg: INTEGER;
 
-BEGIN
-    reg := GetFreeReg(R);
-    ASSERT(reg # -1);
-    ASSERT(R.top < LEN(R.stk) - 1);
-    ASSERT(R.pushed > 0);
-    pop(R, reg)
+    BEGIN
+        reg := GetFreeReg(R);
+        ASSERT(reg # -1);
+        ASSERT(R.top < LEN(R.stk) - 1);
+        ASSERT(R.pushed > 0);
+        pop(R, reg)
 
-    RETURN reg
-END PopAnyReg;
+        RETURN reg
+    END PopAnyReg;
 
 
 PROCEDURE GetAnyReg* (VAR R: REGS): INTEGER;
-VAR
-    reg: INTEGER;
+    VAR
+        reg: INTEGER;
 
-BEGIN
-    reg := GetFreeReg(R);
-    IF reg = -1 THEN
-        ASSERT(R.top >= 0);
-        reg := R.stk[0];
-        push(R)
-    END;
+    BEGIN
+        reg := GetFreeReg(R);
+        IF reg = -1 THEN
+            ASSERT(R.top >= 0);
+            reg := R.stk[0];
+            push(R)
+        END;
 
-    Put(R, reg)
+        Put(R, reg)
 
-    RETURN reg
-END GetAnyReg;
+        RETURN reg
+    END GetAnyReg;
 
 
 PROCEDURE GetReg* (VAR R: REGS; reg: INTEGER): BOOLEAN;
-VAR
-    free: INTEGER;
-    res:  BOOLEAN;
+    VAR
+        free: INTEGER;
+        res:  BOOLEAN;
 
 
-    PROCEDURE exch (VAR R: REGS; reg1, reg2: INTEGER);
-    VAR
-        n1, n2: INTEGER;
+        PROCEDURE exch (VAR R: REGS; reg1, reg2: INTEGER);
+        VAR
+            n1, n2: INTEGER;
+
+        BEGIN
+            n1 := InStk(R, reg1);
+            n2 := InStk(R, reg2);
+            R.stk[n1] := reg2;
+            R.stk[n2] := reg1;
+            R.xch(reg1, reg2)
+        END exch;
+
 
     BEGIN
-        n1 := InStk(R, reg1);
-        n2 := InStk(R, reg2);
-        R.stk[n1] := reg2;
-        R.stk[n2] := reg1;
-        R.xch(reg1, reg2)
-    END exch;
-
-
-BEGIN
-    IF reg IN R.regs THEN
-        Put(R, reg);
-        res := TRUE
-    ELSE
-        res := InStk(R, reg) # -1;
-        IF res THEN
-            free := GetFreeReg(R);
-            IF free # -1 THEN
-                Put(R, free);
-                exch(R, reg, free)
-            ELSE
-                push(R);
+        IF reg IN R.regs THEN
+            Put(R, reg);
+            res := TRUE
+        ELSE
+            res := InStk(R, reg) # -1;
+            IF res THEN
                 free := GetFreeReg(R);
-                ASSERT(free # -1);
-                Put(R, free);
-                IF free # reg THEN
+                IF free # -1 THEN
+                    Put(R, free);
                     exch(R, reg, free)
+                ELSE
+                    push(R);
+                    free := GetFreeReg(R);
+                    ASSERT(free # -1);
+                    Put(R, free);
+                    IF free # reg THEN
+                        exch(R, reg, free)
+                    END
                 END
             END
         END
-    END
 
-    RETURN res
-END GetReg;
+        RETURN res
+    END GetReg;
 
 
 PROCEDURE Exchange* (VAR R: REGS; reg1, reg2: INTEGER): BOOLEAN;
-VAR
-    n1, n2: INTEGER;
-    res: BOOLEAN;
-
-BEGIN
-    res := TRUE;
-
-    IF reg1 # reg2 THEN
-        n1 := InStk(R, reg1);
-        n2 := InStk(R, reg2);
+    VAR
+        n1, n2: INTEGER;
+        res: BOOLEAN;
 
-        IF (n1 # -1) & (n2 # -1) THEN
-            R.stk[n1] := reg2;
-            R.stk[n2] := reg1;
-            R.xch(reg2, reg1)
-        ELSIF (n1 # -1) & (reg2 IN R.regs) THEN
-            R.stk[n1] := reg2;
-            INCL(R.regs, reg1);
-            EXCL(R.regs, reg2);
-            R.mov(reg2, reg1)
-        ELSIF (n2 # -1) & (reg1 IN R.regs) THEN
-            R.stk[n2] := reg1;
-            EXCL(R.regs, reg1);
-            INCL(R.regs, reg2);
-            R.mov(reg1, reg2)
-        ELSE
-            res := FALSE
+    BEGIN
+        res := TRUE;
+
+        IF reg1 # reg2 THEN
+            n1 := InStk(R, reg1);
+            n2 := InStk(R, reg2);
+
+            IF (n1 # -1) & (n2 # -1) THEN
+                R.stk[n1] := reg2;
+                R.stk[n2] := reg1;
+                R.xch(reg2, reg1)
+            ELSIF (n1 # -1) & (reg2 IN R.regs) THEN
+                R.stk[n1] := reg2;
+                INCL(R.regs, reg1);
+                EXCL(R.regs, reg2);
+                R.mov(reg2, reg1)
+            ELSIF (n2 # -1) & (reg1 IN R.regs) THEN
+                R.stk[n2] := reg1;
+                EXCL(R.regs, reg1);
+                INCL(R.regs, reg2);
+                R.mov(reg1, reg2)
+            ELSE
+                res := FALSE
+            END
         END
-    END
 
-    RETURN res
-END Exchange;
+        RETURN res
+    END Exchange;
 
 
 PROCEDURE Drop* (VAR R: REGS);
-BEGIN
-    INCL(R.regs, R.stk[R.top]);
-    DEC(R.top)
-END Drop;
+    BEGIN
+        INCL(R.regs, R.stk[R.top]);
+        DEC(R.top)
+    END Drop;
 
 
 PROCEDURE BinOp* (VAR R: REGS; VAR reg1, reg2: INTEGER);
-BEGIN
-    IF R.top > 0 THEN
-        reg1 := R.stk[R.top - 1];
-        reg2 := R.stk[R.top]
-    ELSIF R.top = 0 THEN
-        reg1 := PopAnyReg(R);
-        reg2 := R.stk[1]
-    ELSE (* R.top = -1 *)
-        reg2 := PopAnyReg(R);
-        reg1 := PopAnyReg(R)
-    END
-END BinOp;
+    BEGIN
+        IF R.top > 0 THEN
+            reg1 := R.stk[R.top - 1];
+            reg2 := R.stk[R.top]
+        ELSIF R.top = 0 THEN
+            reg1 := PopAnyReg(R);
+            reg2 := R.stk[1]
+        ELSE (* R.top = -1 *)
+            reg2 := PopAnyReg(R);
+            reg1 := PopAnyReg(R)
+        END
+    END BinOp;
 
 
 PROCEDURE UnOp* (VAR R: REGS; VAR reg: INTEGER);
-BEGIN
-    IF R.top >= 0 THEN
-        reg := R.stk[R.top]
-    ELSE
-        reg := PopAnyReg(R)
-    END
-END UnOp;
+    BEGIN
+        IF R.top >= 0 THEN
+            reg := R.stk[R.top]
+        ELSE
+            reg := PopAnyReg(R)
+        END
+    END UnOp;
 
 
 PROCEDURE PushAll* (VAR R: REGS);
-BEGIN
-    WHILE R.top >= 0 DO
-        push(R)
-    END
-END PushAll;
+    BEGIN
+        WHILE R.top >= 0 DO
+            push(R)
+        END
+    END PushAll;
 
 
 PROCEDURE PushAll_1* (VAR R: REGS);
-BEGIN
-    WHILE R.top >= 1 DO
-        push(R)
-    END
-END PushAll_1;
+    BEGIN
+        WHILE R.top >= 1 DO
+            push(R)
+        END
+    END PushAll_1;
 
 
 PROCEDURE Init* (VAR R: REGS; push, pop: OP1; mov, xch: OP2; regs: SET);
-BEGIN
-    R.regs := regs;
-    R.pushed := 0;
-    R.top := -1;
-
-    R.push := push;
-    R.pop  := pop;
-    R.mov  := mov;
-    R.xch  := xch;
-END Init;
+    BEGIN
+        R.regs := regs;
+        R.pushed := 0;
+        R.top := -1;
+
+        R.push := push;
+        R.pop  := pop;
+        R.mov  := mov;
+        R.xch  := xch;
+    END Init;
 
 
 END REG.

+ 1162 - 1169
source/RVMxI.ob07

@@ -1,11 +1,4 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2020-2022, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE RVMxI;
+MODULE RVMxI;
 
 IMPORT
 
@@ -59,1357 +52,1357 @@ VAR
 
 
 PROCEDURE OutByte (n: BYTE);
-BEGIN
-    WR.WriteByte(n);
-    INC(count)
-END OutByte;
+    BEGIN
+        WR.WriteByte(n);
+        INC(count)
+    END OutByte;
 
 
 PROCEDURE OutInt (n: INTEGER);
-BEGIN
-    IF szWord = 8 THEN
-        WR.Write64LE(n);
-        INC(count, 8)
-    ELSE (* szWord = 4 *)
-        WR.Write32LE(n);
-        INC(count, 4)
-    END
-END OutInt;
+    BEGIN
+        IF szWord = 8 THEN
+            WR.Write64LE(n);
+            INC(count, 8)
+        ELSE (* szWord = 4 *)
+            WR.Write32LE(n);
+            INC(count, 4)
+        END
+    END OutInt;
 
 
 PROCEDURE Emit (op, par1, par2: INTEGER);
-BEGIN
-    OutInt(op);
-    OutInt(par1);
-    OutInt(par2)
-END Emit;
+    BEGIN
+        OutInt(op);
+        OutInt(par1);
+        OutInt(par2)
+    END Emit;
 
 
 PROCEDURE drop;
-BEGIN
-    REG.Drop(R)
-END drop;
+    BEGIN
+        REG.Drop(R)
+    END drop;
 
 
 PROCEDURE GetAnyReg (): INTEGER;
-    RETURN REG.GetAnyReg(R)
-END GetAnyReg;
+        RETURN REG.GetAnyReg(R)
+    END GetAnyReg;
 
 
 PROCEDURE GetAcc;
-BEGIN
-    ASSERT(REG.GetReg(R, ACC))
-END GetAcc;
+    BEGIN
+        ASSERT(REG.GetReg(R, ACC))
+    END GetAcc;
 
 
 PROCEDURE UnOp (VAR r: INTEGER);
-BEGIN
-    REG.UnOp(R, r)
-END UnOp;
+    BEGIN
+        REG.UnOp(R, r)
+    END UnOp;
 
 
 PROCEDURE BinOp (VAR r1, r2: INTEGER);
-BEGIN
-    REG.BinOp(R, r1, r2)
-END BinOp;
+    BEGIN
+        REG.BinOp(R, r1, r2)
+    END BinOp;
 
 
 PROCEDURE PushAll (NumberOfParameters: INTEGER);
-BEGIN
-    REG.PushAll(R);
-    DEC(R.pushed, NumberOfParameters)
-END PushAll;
+    BEGIN
+        REG.PushAll(R);
+        DEC(R.pushed, NumberOfParameters)
+    END PushAll;
 
 
 PROCEDURE push (r: INTEGER);
-BEGIN
-    Emit(opPUSH, r, 0)
-END push;
+    BEGIN
+        Emit(opPUSH, r, 0)
+    END push;
 
 
 PROCEDURE pop (r: INTEGER);
-BEGIN
-    Emit(opPOP, r, 0)
-END pop;
+    BEGIN
+        Emit(opPOP, r, 0)
+    END pop;
 
 
 PROCEDURE mov (r1, r2: INTEGER);
-BEGIN
-    Emit(opMOV, r1, r2)
-END mov;
+    BEGIN
+        Emit(opMOV, r1, r2)
+    END mov;
 
 
 PROCEDURE xchg (r1, r2: INTEGER);
-BEGIN
-    Emit(opXCHG, r1, r2)
-END xchg;
+    BEGIN
+        Emit(opXCHG, r1, r2)
+    END xchg;
 
 
 PROCEDURE addrc (r, c: INTEGER);
-BEGIN
-    Emit(opADDC, r, c)
-END addrc;
+    BEGIN
+        Emit(opADDC, r, c)
+    END addrc;
 
 
 PROCEDURE subrc (r, c: INTEGER);
-BEGIN
-    Emit(opSUBC, r, c)
-END subrc;
+    BEGIN
+        Emit(opSUBC, r, c)
+    END subrc;
 
 
 PROCEDURE movrc (r, c: INTEGER);
-BEGIN
-    Emit(opMOVC, r, c)
-END movrc;
+    BEGIN
+        Emit(opMOVC, r, c)
+    END movrc;
 
 
 PROCEDURE pushc (c: INTEGER);
-BEGIN
-    Emit(opPUSHC, c, 0)
-END pushc;
+    BEGIN
+        Emit(opPUSHC, c, 0)
+    END pushc;
 
 
 PROCEDURE add (r1, r2: INTEGER);
-BEGIN
-    Emit(opADD, r1, r2)
-END add;
+    BEGIN
+        Emit(opADD, r1, r2)
+    END add;
 
 
 PROCEDURE sub (r1, r2: INTEGER);
-BEGIN
-    Emit(opSUB, r1, r2)
-END sub;
+    BEGIN
+        Emit(opSUB, r1, r2)
+    END sub;
 
 
 PROCEDURE ldr64 (r1, r2: INTEGER);
-BEGIN
-    Emit(opLDD, r2 * 256 + r1, 0)
-END ldr64;
+    BEGIN
+        Emit(opLDD, r2 * 256 + r1, 0)
+    END ldr64;
 
 
 PROCEDURE ldr32 (r1, r2: INTEGER);
-BEGIN
-    Emit(opLDW, r2 * 256 + r1, 0)
-END ldr32;
+    BEGIN
+        Emit(opLDW, r2 * 256 + r1, 0)
+    END ldr32;
 
 
 PROCEDURE ldr16 (r1, r2: INTEGER);
-BEGIN
-    Emit(opLDH, r2 * 256 + r1, 0)
-END ldr16;
+    BEGIN
+        Emit(opLDH, r2 * 256 + r1, 0)
+    END ldr16;
 
 
 PROCEDURE ldr8 (r1, r2: INTEGER);
-BEGIN
-    Emit(opLDB, r2 * 256 + r1, 0)
-END ldr8;
+    BEGIN
+        Emit(opLDB, r2 * 256 + r1, 0)
+    END ldr8;
 
 
 PROCEDURE str64 (r1, r2: INTEGER);
-BEGIN
-    Emit(opSTD, r1 * 256 + r2, 0)
-END str64;
+    BEGIN
+        Emit(opSTD, r1 * 256 + r2, 0)
+    END str64;
 
 
 PROCEDURE str32 (r1, r2: INTEGER);
-BEGIN
-    Emit(opSTW, r1 * 256 + r2, 0)
-END str32;
+    BEGIN
+        Emit(opSTW, r1 * 256 + r2, 0)
+    END str32;
 
 
 PROCEDURE str16 (r1, r2: INTEGER);
-BEGIN
-    Emit(opSTH, r1 * 256 + r2, 0)
-END str16;
+    BEGIN
+        Emit(opSTH, r1 * 256 + r2, 0)
+    END str16;
 
 
 PROCEDURE str8 (r1, r2: INTEGER);
-BEGIN
-    Emit(opSTB, r1 * 256 + r2, 0)
-END str8;
+    BEGIN
+        Emit(opSTB, r1 * 256 + r2, 0)
+    END str8;
 
 
 PROCEDURE GlobalAdr (r, offset: INTEGER);
-BEGIN
-    Emit(opLEA, r + 256 * LGlobal, offset)
-END GlobalAdr;
+    BEGIN
+        Emit(opLEA, r + 256 * LGlobal, offset)
+    END GlobalAdr;
 
 
 PROCEDURE StrAdr (r, offset: INTEGER);
-BEGIN
-    Emit(opLEA, r + 256 * LStrings, offset)
-END StrAdr;
+    BEGIN
+        Emit(opLEA, r + 256 * LStrings, offset)
+    END StrAdr;
 
 
 PROCEDURE ProcAdr (r, label: INTEGER);
-BEGIN
-    Emit(opLLA, r, label)
-END ProcAdr;
+    BEGIN
+        Emit(opLLA, r, label)
+    END ProcAdr;
 
 
 PROCEDURE jnz (r, label: INTEGER);
-BEGIN
-    Emit(opCMPC, r, 0);
-    Emit(opJNE, label, 0)
-END jnz;
+    BEGIN
+        Emit(opCMPC, r, 0);
+        Emit(opJNE, label, 0)
+    END jnz;
 
 
 PROCEDURE CallRTL (proc, par: INTEGER);
-BEGIN
-    Emit(opCALL, IL.codes.rtl[proc], 0);
-    addrc(SP, par * szWord)
-END CallRTL;
+    BEGIN
+        Emit(opCALL, IL.codes.rtl[proc], 0);
+        addrc(SP, par * szWord)
+    END CallRTL;
 
 
 PROCEDURE jcc (cc: INTEGER): INTEGER;
-BEGIN
-    CASE cc OF
-    |IL.opEQ, IL.opEQC: cc := opJEQ
-    |IL.opNE, IL.opNEC: cc := opJNE
-    |IL.opLT, IL.opLTC: cc := opJLT
-    |IL.opLE, IL.opLEC: cc := opJLE
-    |IL.opGT, IL.opGTC: cc := opJGT
-    |IL.opGE, IL.opGEC: cc := opJGE
-    END
-    RETURN cc
-END jcc;
+    BEGIN
+        CASE cc OF
+        |IL.opEQ, IL.opEQC: cc := opJEQ
+        |IL.opNE, IL.opNEC: cc := opJNE
+        |IL.opLT, IL.opLTC: cc := opJLT
+        |IL.opLE, IL.opLEC: cc := opJLE
+        |IL.opGT, IL.opGTC: cc := opJGT
+        |IL.opGE, IL.opGEC: cc := opJGE
+        END
+        RETURN cc
+    END jcc;
 
 
 PROCEDURE shift1 (op, param: INTEGER);
-VAR
-    r1, r2: INTEGER;
+    VAR
+        r1, r2: INTEGER;
 
-BEGIN
-    r2 := GetAnyReg();
-    Emit(opMOVC, r2, param);
-    BinOp(r1, r2);
-    Emit(op, r2, r1);
-    mov(r1, r2);
-    drop
-END shift1;
+    BEGIN
+        r2 := GetAnyReg();
+        Emit(opMOVC, r2, param);
+        BinOp(r1, r2);
+        Emit(op, r2, r1);
+        mov(r1, r2);
+        drop
+    END shift1;
 
 
 PROCEDURE shift (op: INTEGER);
-VAR
-    r1, r2: INTEGER;
+    VAR
+        r1, r2: INTEGER;
 
-BEGIN
-    BinOp(r1, r2);
-    Emit(op, r1, r2);
-    drop
-END shift;
+    BEGIN
+        BinOp(r1, r2);
+        Emit(op, r1, r2);
+        drop
+    END shift;
 
 
 PROCEDURE translate (szWord: INTEGER);
-VAR
-    cmd, next: IL.COMMAND;
+    VAR
+        cmd, next: IL.COMMAND;
+
+        opcode, param1, param2, r1, r2, r3,
+        a, b, label, opLD, opST, opSTC: INTEGER;
+
+    BEGIN
+        IF szWord = 8 THEN
+            opLD  := opLDD;
+            opST  := opSTD;
+            opSTC := opSTDC
+        ELSE
+            opLD  := opLDW;
+            opST  := opSTW;
+            opSTC := opSTWC
+        END;
 
-    opcode, param1, param2, r1, r2, r3,
-    a, b, label, opLD, opST, opSTC: INTEGER;
+        cmd := IL.codes.commands.first(IL.COMMAND);
 
-BEGIN
-    IF szWord = 8 THEN
-        opLD  := opLDD;
-        opST  := opSTD;
-        opSTC := opSTDC
-    ELSE
-        opLD  := opLDW;
-        opST  := opSTW;
-        opSTC := opSTWC
-    END;
+        WHILE cmd # NIL DO
 
-    cmd := IL.codes.commands.first(IL.COMMAND);
+            param1 := cmd.param1;
+            param2 := cmd.param2;
+            opcode := cmd.opcode;
 
-    WHILE cmd # NIL DO
+            CASE opcode OF
 
-        param1 := cmd.param1;
-        param2 := cmd.param2;
-        opcode := cmd.opcode;
+            |IL.opJMP:
+                Emit(opJMP, param1, 0)
 
-        CASE opcode OF
+            |IL.opLABEL:
+                Emit(opLABEL, param1, 0)
 
-        |IL.opJMP:
-            Emit(opJMP, param1, 0)
+            |IL.opCALL:
+                Emit(opCALL, param1, 0)
 
-        |IL.opLABEL:
-            Emit(opLABEL, param1, 0)
+            |IL.opCALLP:
+                UnOp(r1);
+                Emit(opCALLI, r1, 0);
+                drop;
+                ASSERT(R.top = -1)
+
+            |IL.opPUSHC:
+                pushc(param2)
+
+            |IL.opCLEANUP:
+                IF param2 # 0 THEN
+                    addrc(SP, param2 * szWord)
+                END
+
+            |IL.opNOP, IL.opAND, IL.opOR:
+
+            |IL.opSADR:
+                StrAdr(GetAnyReg(), param2)
+
+            |IL.opGADR:
+                GlobalAdr(GetAnyReg(), param2)
+
+            |IL.opLADR:
+                param2 := param2 * szWord;
+                next := cmd.next(IL.COMMAND);
+                IF ((next.opcode = IL.opSAVE) OR (next.opcode = IL.opSAVEF)) & (szWord = 8) OR (next.opcode = IL.opSAVE64) THEN
+                    UnOp(r1);
+                    Emit(opSTD, BP * 256 + r1, param2);
+                    drop;
+                    cmd := next
+                ELSIF ((next.opcode = IL.opSAVE) OR (next.opcode = IL.opSAVEF)) & (szWord = 4) OR (next.opcode = IL.opSAVE32) THEN
+                    UnOp(r1);
+                    Emit(opSTW, BP * 256 + r1, param2);
+                    drop;
+                    cmd := next
+                ELSIF next.opcode = IL.opSAVE16 THEN
+                    UnOp(r1);
+                    Emit(opSTH, BP * 256 + r1, param2);
+                    drop;
+                    cmd := next
+                ELSIF next.opcode = IL.opSAVE8 THEN
+                    UnOp(r1);
+                    Emit(opSTB, BP * 256 + r1, param2);
+                    drop;
+                    cmd := next
+                ELSE
+                    Emit(opADDRC, BP * 256 + GetAnyReg(), param2)
+                END
+
+            |IL.opPARAM:
+                IF param2 = 1 THEN
+                    UnOp(r1);
+                    push(r1);
+                    drop
+                ELSE
+                    ASSERT(R.top + 1 <= param2);
+                    PushAll(param2)
+                END
+
+            |IL.opONERR:
+                pushc(param2);
+                Emit(opJMP, param1, 0)
+
+            |IL.opPRECALL:
+                PushAll(0)
+
+            |IL.opRES, IL.opRESF:
+                ASSERT(R.top = -1);
+                GetAcc
+
+            |IL.opENTER:
+                ASSERT(R.top = -1);
+                Emit(opLABEL, param1, 0);
+                Emit(opENTER, param2, 0)
+
+            |IL.opLEAVE, IL.opLEAVER, IL.opLEAVEF:
+                IF opcode # IL.opLEAVE THEN
+                    UnOp(r1);
+                    IF r1 # ACC THEN
+                        mov(ACC, r1)
+                    END;
+                    drop
+                END;
 
-        |IL.opCALL:
-            Emit(opCALL, param1, 0)
+                ASSERT(R.top = -1);
 
-        |IL.opCALLP:
-            UnOp(r1);
-            Emit(opCALLI, r1, 0);
-            drop;
-            ASSERT(R.top = -1)
+                IF param1 > 0 THEN
+                    mov(SP, BP)
+                END;
 
-        |IL.opPUSHC:
-            pushc(param2)
+                pop(BP);
 
-        |IL.opCLEANUP:
-            IF param2 # 0 THEN
-                addrc(SP, param2 * szWord)
-            END
+                Emit(opRET, 0, 0)
 
-        |IL.opNOP, IL.opAND, IL.opOR:
+            |IL.opLEAVEC:
+                Emit(opRET, 0, 0)
 
-        |IL.opSADR:
-            StrAdr(GetAnyReg(), param2)
+            |IL.opCONST:
+                next := cmd.next(IL.COMMAND);
+                IF (next.opcode = IL.opPARAM) & (next.param2 = 1) THEN
+                    pushc(param2);
+                    cmd := next
+                ELSE
+                    movrc(GetAnyReg(), param2)
+                END
 
-        |IL.opGADR:
-            GlobalAdr(GetAnyReg(), param2)
+            |IL.opDROP:
+                UnOp(r1);
+                drop
 
-        |IL.opLADR:
-            param2 := param2 * szWord;
-            next := cmd.next(IL.COMMAND);
-            IF ((next.opcode = IL.opSAVE) OR (next.opcode = IL.opSAVEF)) & (szWord = 8) OR (next.opcode = IL.opSAVE64) THEN
+            |IL.opSAVEC:
                 UnOp(r1);
-                Emit(opSTD, BP * 256 + r1, param2);
-                drop;
-                cmd := next
-            ELSIF ((next.opcode = IL.opSAVE) OR (next.opcode = IL.opSAVEF)) & (szWord = 4) OR (next.opcode = IL.opSAVE32) THEN
+                Emit(opSTC, r1, param2);
+                drop
+
+            |IL.opSAVE8C:
                 UnOp(r1);
-                Emit(opSTW, BP * 256 + r1, param2);
-                drop;
-                cmd := next
-            ELSIF next.opcode = IL.opSAVE16 THEN
+                Emit(opSTBC, r1, param2 MOD 256);
+                drop
+
+            |IL.opSAVE16C:
                 UnOp(r1);
-                Emit(opSTH, BP * 256 + r1, param2);
+                Emit(opSTHC, r1, param2 MOD 65536);
+                drop
+
+            |IL.opSAVE, IL.opSAVEF:
+                BinOp(r2, r1);
+                str(r1, r2);
                 drop;
-                cmd := next
-            ELSIF next.opcode = IL.opSAVE8 THEN
-                UnOp(r1);
-                Emit(opSTB, BP * 256 + r1, param2);
+                drop
+
+            |IL.opSAVE32:
+                BinOp(r2, r1);
+                str32(r1, r2);
                 drop;
-                cmd := next
-            ELSE
-                Emit(opADDRC, BP * 256 + GetAnyReg(), param2)
-            END
+                drop
+
+            |IL.opSAVE64:
+                BinOp(r2, r1);
+                str64(r1, r2);
+                drop;
+                drop
+
+            |IL.opSAVEFI:
+                BinOp(r2, r1);
+                str(r2, r1);
+                drop;
+                drop
+
+            |IL.opSAVE8:
+                BinOp(r2, r1);
+                str8(r1, r2);
+                drop;
+                drop
+
+            |IL.opSAVE16:
+                BinOp(r2, r1);
+                str16(r1, r2);
+                drop;
+                drop
+
+            |IL.opGLOAD32:
+                r1 := GetAnyReg();
+                GlobalAdr(r1, param2);
+                ldr32(r1, r1)
 
-        |IL.opPARAM:
-            IF param2 = 1 THEN
+            |IL.opGLOAD64:
+                r1 := GetAnyReg();
+                GlobalAdr(r1, param2);
+                ldr64(r1, r1)
+
+            |IL.opVADR:
+                Emit(opLD, BP * 256 + GetAnyReg(), param2 * szWord)
+
+            |IL.opLLOAD32:
+                Emit(opLDW, BP * 256 + GetAnyReg(), param2 * szWord)
+
+            |IL.opLLOAD64:
+                Emit(opLDD, BP * 256 + GetAnyReg(), param2 * szWord)
+
+            |IL.opVLOAD32:
+                r1 := GetAnyReg();
+                Emit(opLD, BP * 256 + r1, param2 * szWord);
+                ldr32(r1, r1)
+
+            |IL.opVLOAD64:
+                r1 := GetAnyReg();
+                Emit(opLDD, BP * 256 + r1, param2 * szWord);
+                ldr64(r1, r1)
+
+            |IL.opGLOAD16:
+                r1 := GetAnyReg();
+                GlobalAdr(r1, param2);
+                ldr16(r1, r1)
+
+            |IL.opLLOAD16:
+                Emit(opLDH, BP * 256 + GetAnyReg(), param2 * szWord)
+
+            |IL.opVLOAD16:
+                r1 := GetAnyReg();
+                Emit(opLD, BP * 256 + r1, param2 * szWord);
+                ldr16(r1, r1)
+
+            |IL.opGLOAD8:
+                r1 := GetAnyReg();
+                GlobalAdr(r1, param2);
+                ldr8(r1, r1)
+
+            |IL.opLLOAD8:
+                Emit(opLDB, BP * 256 + GetAnyReg(), param2 * szWord)
+
+            |IL.opVLOAD8:
+                r1 := GetAnyReg();
+                Emit(opLD, BP * 256 + r1, param2 * szWord);
+                ldr8(r1, r1)
+
+            |IL.opLOAD8:
                 UnOp(r1);
-                push(r1);
+                ldr8(r1, r1)
+
+            |IL.opLOAD16:
+                UnOp(r1);
+                ldr16(r1, r1)
+
+            |IL.opLOAD32:
+                UnOp(r1);
+                ldr32(r1, r1)
+
+            |IL.opLOAD64:
+                UnOp(r1);
+                ldr64(r1, r1)
+
+            |IL.opLOADF:
+                UnOp(r1);
+                ldr(r1, r1)
+
+            |IL.opUMINUS:
+                UnOp(r1);
+                Emit(opNEG, r1, 0)
+
+            |IL.opADD:
+                BinOp(r1, r2);
+                add(r1, r2);
                 drop
-            ELSE
-                ASSERT(R.top + 1 <= param2);
-                PushAll(param2)
-            END
 
-        |IL.opONERR:
-            pushc(param2);
-            Emit(opJMP, param1, 0)
+            |IL.opSUB:
+                BinOp(r1, r2);
+                sub(r1, r2);
+                drop
+
+            |IL.opADDC:
+                UnOp(r1);
+                next := cmd.next(IL.COMMAND);
+                CASE next.opcode OF
+                |IL.opLOADF:
+                    Emit(opLD, r1 * 256 + r1, param2);
+                    cmd := next
+                |IL.opLOAD64:
+                    Emit(opLDD, r1 * 256 + r1, param2);
+                    cmd := next
+                |IL.opLOAD32:
+                    Emit(opLDW, r1 * 256 + r1, param2);
+                    cmd := next
+                |IL.opLOAD16:
+                    Emit(opLDH, r1 * 256 + r1, param2);
+                    cmd := next
+                |IL.opLOAD8:
+                    Emit(opLDB, r1 * 256 + r1, param2);
+                    cmd := next
+                ELSE
+                    addrc(r1, param2)
+                END
+
+            |IL.opSUBR:
+                UnOp(r1);
+                subrc(r1, param2)
+
+            |IL.opSUBL:
+                UnOp(r1);
+                subrc(r1, param2);
+                Emit(opNEG, r1, 0)
+
+            |IL.opMULC:
+                UnOp(r1);
+                Emit(opMULC, r1, param2)
+
+            |IL.opMUL:
+                BinOp(r1, r2);
+                Emit(opMUL, r1, r2);
+                drop
+
+            |IL.opDIV:
+                BinOp(r1, r2);
+                Emit(opDIV, r1, r2);
+                drop
 
-        |IL.opPRECALL:
-            PushAll(0)
+            |IL.opMOD:
+                BinOp(r1, r2);
+                Emit(opMOD, r1, r2);
+                drop
 
-        |IL.opRES, IL.opRESF:
-            ASSERT(R.top = -1);
-            GetAcc
+            |IL.opDIVR:
+                UnOp(r1);
+                Emit(opDIVC, r1, param2)
 
-        |IL.opENTER:
-            ASSERT(R.top = -1);
-            Emit(opLABEL, param1, 0);
-            Emit(opENTER, param2, 0)
+            |IL.opMODR:
+                UnOp(r1);
+                Emit(opMODC, r1, param2)
 
-        |IL.opLEAVE, IL.opLEAVER, IL.opLEAVEF:
-            IF opcode # IL.opLEAVE THEN
+            |IL.opDIVL:
                 UnOp(r1);
-                IF r1 # ACC THEN
-                    mov(ACC, r1)
-                END;
+                r2 := GetAnyReg();
+                movrc(r2, param2);
+                Emit(opDIV, r2, r1);
+                mov(r1, r2);
                 drop
-            END;
 
-            ASSERT(R.top = -1);
+            |IL.opMODL:
+                UnOp(r1);
+                r2 := GetAnyReg();
+                movrc(r2, param2);
+                Emit(opMOD, r2, r1);
+                mov(r1, r2);
+                drop
 
-            IF param1 > 0 THEN
-                mov(SP, BP)
-            END;
+            |IL.opEQ .. IL.opGE, IL.opEQC .. IL.opGEC:
+                IF (IL.opEQ <= opcode) & (opcode <= IL.opGE) THEN
+                    BinOp(r1, r2);
+                    Emit(opCMP, r1, r2);
+                    drop
+                ELSE
+                    UnOp(r1);
+                    Emit(opCMPC, r1, param2)
+                END;
+                next := cmd.next(IL.COMMAND);
+                IF next.opcode = IL.opJZ THEN
+                    Emit(ORD(BITS(jcc(opcode)) / {0}), next.param1, 0);
+                    cmd := next;
+                    drop
+                ELSIF next.opcode = IL.opJNZ THEN
+                    Emit(jcc(opcode), next.param1, 0);
+                    cmd := next;
+                    drop
+                ELSE
+                    Emit(jcc(opcode) + 6, r1, 0)
+                END
+
+            |IL.opJNZ1:
+                UnOp(r1);
+                jnz(r1, param1)
 
-            pop(BP);
+            |IL.opJG:
+                UnOp(r1);
+                Emit(opCMPC, r1, 0);
+                Emit(opJGT, param1, 0)
 
-            Emit(opRET, 0, 0)
+            |IL.opJNZ:
+                UnOp(r1);
+                jnz(r1, param1);
+                drop
 
-        |IL.opLEAVEC:
-            Emit(opRET, 0, 0)
+            |IL.opJZ:
+                UnOp(r1);
+                Emit(opCMPC, r1, 0);
+                Emit(opJEQ, param1, 0);
+                drop
 
-        |IL.opCONST:
-            next := cmd.next(IL.COMMAND);
-            IF (next.opcode = IL.opPARAM) & (next.param2 = 1) THEN
-                pushc(param2);
-                cmd := next
-            ELSE
-                movrc(GetAnyReg(), param2)
-            END
+            |IL.opMULS:
+                BinOp(r1, r2);
+                Emit(opAND, r1, r2);
+                drop
 
-        |IL.opDROP:
-            UnOp(r1);
-            drop
-
-        |IL.opSAVEC:
-            UnOp(r1);
-            Emit(opSTC, r1, param2);
-            drop
-
-        |IL.opSAVE8C:
-            UnOp(r1);
-            Emit(opSTBC, r1, param2 MOD 256);
-            drop
-
-        |IL.opSAVE16C:
-            UnOp(r1);
-            Emit(opSTHC, r1, param2 MOD 65536);
-            drop
-
-        |IL.opSAVE, IL.opSAVEF:
-            BinOp(r2, r1);
-            str(r1, r2);
-            drop;
-            drop
-
-        |IL.opSAVE32:
-            BinOp(r2, r1);
-            str32(r1, r2);
-            drop;
-            drop
-
-        |IL.opSAVE64:
-            BinOp(r2, r1);
-            str64(r1, r2);
-            drop;
-            drop
-
-        |IL.opSAVEFI:
-            BinOp(r2, r1);
-            str(r2, r1);
-            drop;
-            drop
-
-        |IL.opSAVE8:
-            BinOp(r2, r1);
-            str8(r1, r2);
-            drop;
-            drop
-
-        |IL.opSAVE16:
-            BinOp(r2, r1);
-            str16(r1, r2);
-            drop;
-            drop
-
-        |IL.opGLOAD32:
-            r1 := GetAnyReg();
-            GlobalAdr(r1, param2);
-            ldr32(r1, r1)
-
-        |IL.opGLOAD64:
-            r1 := GetAnyReg();
-            GlobalAdr(r1, param2);
-            ldr64(r1, r1)
-
-        |IL.opVADR:
-            Emit(opLD, BP * 256 + GetAnyReg(), param2 * szWord)
-
-        |IL.opLLOAD32:
-            Emit(opLDW, BP * 256 + GetAnyReg(), param2 * szWord)
-
-        |IL.opLLOAD64:
-            Emit(opLDD, BP * 256 + GetAnyReg(), param2 * szWord)
-
-        |IL.opVLOAD32:
-            r1 := GetAnyReg();
-            Emit(opLD, BP * 256 + r1, param2 * szWord);
-            ldr32(r1, r1)
-
-        |IL.opVLOAD64:
-            r1 := GetAnyReg();
-            Emit(opLDD, BP * 256 + r1, param2 * szWord);
-            ldr64(r1, r1)
-
-        |IL.opGLOAD16:
-            r1 := GetAnyReg();
-            GlobalAdr(r1, param2);
-            ldr16(r1, r1)
-
-        |IL.opLLOAD16:
-            Emit(opLDH, BP * 256 + GetAnyReg(), param2 * szWord)
-
-        |IL.opVLOAD16:
-            r1 := GetAnyReg();
-            Emit(opLD, BP * 256 + r1, param2 * szWord);
-            ldr16(r1, r1)
-
-        |IL.opGLOAD8:
-            r1 := GetAnyReg();
-            GlobalAdr(r1, param2);
-            ldr8(r1, r1)
-
-        |IL.opLLOAD8:
-            Emit(opLDB, BP * 256 + GetAnyReg(), param2 * szWord)
-
-        |IL.opVLOAD8:
-            r1 := GetAnyReg();
-            Emit(opLD, BP * 256 + r1, param2 * szWord);
-            ldr8(r1, r1)
-
-        |IL.opLOAD8:
-            UnOp(r1);
-            ldr8(r1, r1)
-
-        |IL.opLOAD16:
-            UnOp(r1);
-            ldr16(r1, r1)
-
-        |IL.opLOAD32:
-            UnOp(r1);
-            ldr32(r1, r1)
-
-        |IL.opLOAD64:
-            UnOp(r1);
-            ldr64(r1, r1)
-
-        |IL.opLOADF:
-            UnOp(r1);
-            ldr(r1, r1)
-
-        |IL.opUMINUS:
-            UnOp(r1);
-            Emit(opNEG, r1, 0)
-
-        |IL.opADD:
-            BinOp(r1, r2);
-            add(r1, r2);
-            drop
-
-        |IL.opSUB:
-            BinOp(r1, r2);
-            sub(r1, r2);
-            drop
-
-        |IL.opADDC:
-            UnOp(r1);
-            next := cmd.next(IL.COMMAND);
-            CASE next.opcode OF
-            |IL.opLOADF:
-                Emit(opLD, r1 * 256 + r1, param2);
-                cmd := next
-            |IL.opLOAD64:
-                Emit(opLDD, r1 * 256 + r1, param2);
-                cmd := next
-            |IL.opLOAD32:
-                Emit(opLDW, r1 * 256 + r1, param2);
-                cmd := next
-            |IL.opLOAD16:
-                Emit(opLDH, r1 * 256 + r1, param2);
-                cmd := next
-            |IL.opLOAD8:
-                Emit(opLDB, r1 * 256 + r1, param2);
-                cmd := next
-            ELSE
-                addrc(r1, param2)
-            END
+            |IL.opMULSC:
+                UnOp(r1);
+                Emit(opANDC, r1, param2)
 
-        |IL.opSUBR:
-            UnOp(r1);
-            subrc(r1, param2)
-
-        |IL.opSUBL:
-            UnOp(r1);
-            subrc(r1, param2);
-            Emit(opNEG, r1, 0)
-
-        |IL.opMULC:
-            UnOp(r1);
-            Emit(opMULC, r1, param2)
-
-        |IL.opMUL:
-            BinOp(r1, r2);
-            Emit(opMUL, r1, r2);
-            drop
-
-        |IL.opDIV:
-            BinOp(r1, r2);
-            Emit(opDIV, r1, r2);
-            drop
-
-        |IL.opMOD:
-            BinOp(r1, r2);
-            Emit(opMOD, r1, r2);
-            drop
-
-        |IL.opDIVR:
-            UnOp(r1);
-            Emit(opDIVC, r1, param2)
-
-        |IL.opMODR:
-            UnOp(r1);
-            Emit(opMODC, r1, param2)
-
-        |IL.opDIVL:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            movrc(r2, param2);
-            Emit(opDIV, r2, r1);
-            mov(r1, r2);
-            drop
-
-        |IL.opMODL:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            movrc(r2, param2);
-            Emit(opMOD, r2, r1);
-            mov(r1, r2);
-            drop
-
-        |IL.opEQ .. IL.opGE, IL.opEQC .. IL.opGEC:
-            IF (IL.opEQ <= opcode) & (opcode <= IL.opGE) THEN
+            |IL.opDIVS:
                 BinOp(r1, r2);
-                Emit(opCMP, r1, r2);
+                Emit(opXOR, r1, r2);
                 drop
-            ELSE
+
+            |IL.opDIVSC:
                 UnOp(r1);
-                Emit(opCMPC, r1, param2)
-            END;
-            next := cmd.next(IL.COMMAND);
-            IF next.opcode = IL.opJZ THEN
-                Emit(ORD(BITS(jcc(opcode)) / {0}), next.param1, 0);
-                cmd := next;
+                Emit(opXORC, r1, param2)
+
+            |IL.opADDS:
+                BinOp(r1, r2);
+                Emit(opOR, r1, r2);
                 drop
-            ELSIF next.opcode = IL.opJNZ THEN
-                Emit(jcc(opcode), next.param1, 0);
-                cmd := next;
+
+            |IL.opSUBS:
+                BinOp(r1, r2);
+                Emit(opNOT, r2, 0);
+                Emit(opAND, r1, r2);
                 drop
-            ELSE
-                Emit(jcc(opcode) + 6, r1, 0)
-            END
 
-        |IL.opJNZ1:
-            UnOp(r1);
-            jnz(r1, param1)
+            |IL.opADDSC:
+                UnOp(r1);
+                Emit(opORC, r1, param2)
 
-        |IL.opJG:
-            UnOp(r1);
-            Emit(opCMPC, r1, 0);
-            Emit(opJGT, param1, 0)
+            |IL.opSUBSL:
+                UnOp(r1);
+                Emit(opNOT, r1, 0);
+                Emit(opANDC, r1, param2)
 
-        |IL.opJNZ:
-            UnOp(r1);
-            jnz(r1, param1);
-            drop
+            |IL.opSUBSR:
+                UnOp(r1);
+                Emit(opANDC, r1, ORD(-BITS(param2)))
 
-        |IL.opJZ:
-            UnOp(r1);
-            Emit(opCMPC, r1, 0);
-            Emit(opJEQ, param1, 0);
-            drop
-
-        |IL.opMULS:
-            BinOp(r1, r2);
-            Emit(opAND, r1, r2);
-            drop
-
-        |IL.opMULSC:
-            UnOp(r1);
-            Emit(opANDC, r1, param2)
-
-        |IL.opDIVS:
-            BinOp(r1, r2);
-            Emit(opXOR, r1, r2);
-            drop
-
-        |IL.opDIVSC:
-            UnOp(r1);
-            Emit(opXORC, r1, param2)
-
-        |IL.opADDS:
-            BinOp(r1, r2);
-            Emit(opOR, r1, r2);
-            drop
-
-        |IL.opSUBS:
-            BinOp(r1, r2);
-            Emit(opNOT, r2, 0);
-            Emit(opAND, r1, r2);
-            drop
-
-        |IL.opADDSC:
-            UnOp(r1);
-            Emit(opORC, r1, param2)
-
-        |IL.opSUBSL:
-            UnOp(r1);
-            Emit(opNOT, r1, 0);
-            Emit(opANDC, r1, param2)
-
-        |IL.opSUBSR:
-            UnOp(r1);
-            Emit(opANDC, r1, ORD(-BITS(param2)))
-
-        |IL.opUMINS:
-            UnOp(r1);
-            Emit(opNOT, r1, 0)
-
-        |IL.opASR:
-            shift(opASR)
-
-        |IL.opLSL:
-            shift(opLSL)
-
-        |IL.opROR:
-            shift(opROR)
-
-        |IL.opLSR:
-            shift(opLSR)
-
-        |IL.opASR1:
-            shift1(opASR, param2)
-
-        |IL.opLSL1:
-            shift1(opLSL, param2)
-
-        |IL.opROR1:
-            shift1(opROR, param2)
-
-        |IL.opLSR1:
-            shift1(opLSR, param2)
-
-        |IL.opASR2:
-            UnOp(r1);
-            Emit(opASRC, r1, param2 MOD (szWord * 8))
-
-        |IL.opLSL2:
-            UnOp(r1);
-            Emit(opLSLC, r1, param2 MOD (szWord * 8))
-
-        |IL.opROR2:
-            UnOp(r1);
-            Emit(opRORC, r1, param2 MOD (szWord * 8))
-
-        |IL.opLSR2:
-            UnOp(r1);
-            Emit(opLSRC, r1, param2 MOD (szWord * 8))
-
-        |IL.opABS:
-            UnOp(r1);
-            Emit(opCMPC, r1, 0);
-            label := IL.NewLabel();
-            Emit(opJGE, label, 0);
-            Emit(opNEG, r1, 0);
-            Emit(opLABEL, label, 0)
+            |IL.opUMINS:
+                UnOp(r1);
+                Emit(opNOT, r1, 0)
 
-        |IL.opLEN:
-            UnOp(r1);
-            drop;
-            EXCL(R.regs, r1);
+            |IL.opASR:
+                shift(opASR)
 
-            WHILE param2 > 0 DO
-                UnOp(r2);
+            |IL.opLSL:
+                shift(opLSL)
+
+            |IL.opROR:
+                shift(opROR)
+
+            |IL.opLSR:
+                shift(opLSR)
+
+            |IL.opASR1:
+                shift1(opASR, param2)
+
+            |IL.opLSL1:
+                shift1(opLSL, param2)
+
+            |IL.opROR1:
+                shift1(opROR, param2)
+
+            |IL.opLSR1:
+                shift1(opLSR, param2)
+
+            |IL.opASR2:
+                UnOp(r1);
+                Emit(opASRC, r1, param2 MOD (szWord * 8))
+
+            |IL.opLSL2:
+                UnOp(r1);
+                Emit(opLSLC, r1, param2 MOD (szWord * 8))
+
+            |IL.opROR2:
+                UnOp(r1);
+                Emit(opRORC, r1, param2 MOD (szWord * 8))
+
+            |IL.opLSR2:
+                UnOp(r1);
+                Emit(opLSRC, r1, param2 MOD (szWord * 8))
+
+            |IL.opABS:
+                UnOp(r1);
+                Emit(opCMPC, r1, 0);
+                label := IL.NewLabel();
+                Emit(opJGE, label, 0);
+                Emit(opNEG, r1, 0);
+                Emit(opLABEL, label, 0)
+
+            |IL.opLEN:
+                UnOp(r1);
                 drop;
-                DEC(param2)
-            END;
+                EXCL(R.regs, r1);
 
-            INCL(R.regs, r1);
-            ASSERT(REG.GetReg(R, r1))
+                WHILE param2 > 0 DO
+                    UnOp(r2);
+                    drop;
+                    DEC(param2)
+                END;
 
-        |IL.opSWITCH:
-            UnOp(r1);
-            IF param2 = 0 THEN
-                r2 := ACC
-            ELSE
-                r2 := R1
-            END;
-            IF r1 # r2 THEN
-                ASSERT(REG.GetReg(R, r2));
-                ASSERT(REG.Exchange(R, r1, r2));
+                INCL(R.regs, r1);
+                ASSERT(REG.GetReg(R, r1))
+
+            |IL.opSWITCH:
+                UnOp(r1);
+                IF param2 = 0 THEN
+                    r2 := ACC
+                ELSE
+                    r2 := R1
+                END;
+                IF r1 # r2 THEN
+                    ASSERT(REG.GetReg(R, r2));
+                    ASSERT(REG.Exchange(R, r1, r2));
+                    drop
+                END;
                 drop
-            END;
-            drop
 
-        |IL.opENDSW:
+            |IL.opENDSW:
+
+            |IL.opCASEL:
+                Emit(opCMPC, ACC, param1);
+                Emit(opJLT, param2, 0)
+
+            |IL.opCASER:
+                Emit(opCMPC, ACC, param1);
+                Emit(opJGT, param2, 0)
+
+            |IL.opCASELR:
+                Emit(opCMPC, ACC, param1);
+                IF param2 = cmd.param3 THEN
+                    Emit(opJNE, param2, 0)
+                ELSE
+                    Emit(opJLT, param2, 0);
+                    Emit(opJGT, cmd.param3, 0)
+                END
+
+            |IL.opSBOOL:
+                BinOp(r2, r1);
+                Emit(opCMPC, r2, 0);
+                Emit(opSNE, r2, 0);
+                str8(r1, r2);
+                drop;
+                drop
 
-        |IL.opCASEL:
-            Emit(opCMPC, ACC, param1);
-            Emit(opJLT, param2, 0)
+            |IL.opSBOOLC:
+                UnOp(r1);
+                Emit(opSTBC, r1, ORD(param2 # 0));
+                drop
 
-        |IL.opCASER:
-            Emit(opCMPC, ACC, param1);
-            Emit(opJGT, param2, 0)
+            |IL.opINCC:
+                UnOp(r1);
+                r2 := GetAnyReg();
+                ldr(r2, r1);
+                addrc(r2, param2);
+                str(r1, r2);
+                drop;
+                drop
 
-        |IL.opCASELR:
-            Emit(opCMPC, ACC, param1);
-            IF param2 = cmd.param3 THEN
-                Emit(opJNE, param2, 0)
-            ELSE
-                Emit(opJLT, param2, 0);
-                Emit(opJGT, cmd.param3, 0)
-            END
+            |IL.opINCCB, IL.opDECCB:
+                IF opcode = IL.opDECCB THEN
+                    param2 := -param2
+                END;
+                UnOp(r1);
+                r2 := GetAnyReg();
+                ldr8(r2, r1);
+                addrc(r2, param2);
+                str8(r1, r2);
+                drop;
+                drop
 
-        |IL.opSBOOL:
-            BinOp(r2, r1);
-            Emit(opCMPC, r2, 0);
-            Emit(opSNE, r2, 0);
-            str8(r1, r2);
-            drop;
-            drop
-
-        |IL.opSBOOLC:
-            UnOp(r1);
-            Emit(opSTBC, r1, ORD(param2 # 0));
-            drop
-
-        |IL.opINCC:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            ldr(r2, r1);
-            addrc(r2, param2);
-            str(r1, r2);
-            drop;
-            drop
-
-        |IL.opINCCB, IL.opDECCB:
-            IF opcode = IL.opDECCB THEN
-                param2 := -param2
-            END;
-            UnOp(r1);
-            r2 := GetAnyReg();
-            ldr8(r2, r1);
-            addrc(r2, param2);
-            str8(r1, r2);
-            drop;
-            drop
-
-        |IL.opINCB, IL.opDECB:
-            BinOp(r2, r1);
-            r3 := GetAnyReg();
-            ldr8(r3, r1);
-            IF opcode = IL.opINCB THEN
-                add(r3, r2)
-            ELSE
-                sub(r3, r2)
-            END;
-            str8(r1, r3);
-            drop;
-            drop;
-            drop
-
-        |IL.opINC, IL.opDEC:
-            BinOp(r2, r1);
-            r3 := GetAnyReg();
-            ldr(r3, r1);
-            IF opcode = IL.opINC THEN
-                add(r3, r2)
-            ELSE
-                sub(r3, r2)
-            END;
-            str(r1, r3);
-            drop;
-            drop;
-            drop
-
-        |IL.opINCL, IL.opEXCL:
-            BinOp(r2, r1);
-            Emit(opBIT, r2, r2);
-            r3 := GetAnyReg();
-            ldr(r3, r1);
-            IF opcode = IL.opINCL THEN
-                Emit(opOR, r3, r2)
-            ELSE
-                Emit(opNOT, r2, 0);
-                Emit(opAND, r3, r2)
-            END;
-            str(r1, r3);
-            drop;
-            drop;
-            drop
-
-        |IL.opINCLC, IL.opEXCLC:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            ldr(r2, r1);
-            IF opcode = IL.opINCLC THEN
-                Emit(opORC, r2, ORD({param2}))
-            ELSE
-                Emit(opANDC, r2, ORD(-{param2}))
-            END;
-            str(r1, r2);
-            drop;
-            drop
-
-        |IL.opEQB, IL.opNEB:
-            BinOp(r1, r2);
-            Emit(opCMPC, r1, 0);
-            Emit(opSNE, r1, 0);
-            Emit(opCMPC, r2, 0);
-            Emit(opSNE, r2, 0);
-            Emit(opCMP, r1, r2);
-            IF opcode = IL.opEQB THEN
-                Emit(opSEQ, r1, 0)
-            ELSE
-                Emit(opSNE, r1, 0)
-            END;
-            drop
+            |IL.opINCB, IL.opDECB:
+                BinOp(r2, r1);
+                r3 := GetAnyReg();
+                ldr8(r3, r1);
+                IF opcode = IL.opINCB THEN
+                    add(r3, r2)
+                ELSE
+                    sub(r3, r2)
+                END;
+                str8(r1, r3);
+                drop;
+                drop;
+                drop
 
-        |IL.opCHKIDX:
-            UnOp(r1);
-            Emit(opCMPC, r1, param2);
-            Emit(opJBT, param1, 0)
+            |IL.opINC, IL.opDEC:
+                BinOp(r2, r1);
+                r3 := GetAnyReg();
+                ldr(r3, r1);
+                IF opcode = IL.opINC THEN
+                    add(r3, r2)
+                ELSE
+                    sub(r3, r2)
+                END;
+                str(r1, r3);
+                drop;
+                drop;
+                drop
 
-        |IL.opCHKIDX2:
-            BinOp(r1, r2);
-            IF param2 # -1 THEN
-                Emit(opCMP, r2, r1);
+            |IL.opINCL, IL.opEXCL:
+                BinOp(r2, r1);
+                Emit(opBIT, r2, r2);
+                r3 := GetAnyReg();
+                ldr(r3, r1);
+                IF opcode = IL.opINCL THEN
+                    Emit(opOR, r3, r2)
+                ELSE
+                    Emit(opNOT, r2, 0);
+                    Emit(opAND, r3, r2)
+                END;
+                str(r1, r3);
+                drop;
+                drop;
+                drop
+
+            |IL.opINCLC, IL.opEXCLC:
+                UnOp(r1);
+                r2 := GetAnyReg();
+                ldr(r2, r1);
+                IF opcode = IL.opINCLC THEN
+                    Emit(opORC, r2, ORD({param2}))
+                ELSE
+                    Emit(opANDC, r2, ORD(-{param2}))
+                END;
+                str(r1, r2);
+                drop;
+                drop
+
+            |IL.opEQB, IL.opNEB:
+                BinOp(r1, r2);
+                Emit(opCMPC, r1, 0);
+                Emit(opSNE, r1, 0);
+                Emit(opCMPC, r2, 0);
+                Emit(opSNE, r2, 0);
+                Emit(opCMP, r1, r2);
+                IF opcode = IL.opEQB THEN
+                    Emit(opSEQ, r1, 0)
+                ELSE
+                    Emit(opSNE, r1, 0)
+                END;
+                drop
+
+            |IL.opCHKIDX:
+                UnOp(r1);
+                Emit(opCMPC, r1, param2);
                 Emit(opJBT, param1, 0)
-            END;
-            INCL(R.regs, r1);
-            DEC(R.top);
-            R.stk[R.top] := r2
-
-        |IL.opEQP, IL.opNEP:
-            ProcAdr(GetAnyReg(), param1);
-            BinOp(r1, r2);
-            Emit(opCMP, r1, r2);
-            IF opcode = IL.opEQP THEN
+
+            |IL.opCHKIDX2:
+                BinOp(r1, r2);
+                IF param2 # -1 THEN
+                    Emit(opCMP, r2, r1);
+                    Emit(opJBT, param1, 0)
+                END;
+                INCL(R.regs, r1);
+                DEC(R.top);
+                R.stk[R.top] := r2
+
+            |IL.opEQP, IL.opNEP:
+                ProcAdr(GetAnyReg(), param1);
+                BinOp(r1, r2);
+                Emit(opCMP, r1, r2);
+                IF opcode = IL.opEQP THEN
+                    Emit(opSEQ, r1, 0)
+                ELSE
+                    Emit(opSNE, r1, 0)
+                END;
+                drop
+
+            |IL.opSAVEP:
+                UnOp(r1);
+                r2 := GetAnyReg();
+                ProcAdr(r2, param2);
+                str(r1, r2);
+                drop;
+                drop
+
+            |IL.opPUSHP:
+                ProcAdr(GetAnyReg(), param2)
+
+            |IL.opPUSHT:
+                UnOp(r1);
+                Emit(opLD, r1 * 256 + GetAnyReg(), -szWord)
+
+            |IL.opGET, IL.opGETC:
+                IF opcode = IL.opGET THEN
+                    BinOp(r1, r2)
+                ELSIF opcode = IL.opGETC THEN
+                    UnOp(r2);
+                    r1 := GetAnyReg();
+                    movrc(r1, param1)
+                END;
+                drop;
+                drop;
+
+                CASE param2 OF
+                |1: ldr8(r1, r1);  str8(r2, r1)
+                |2: ldr16(r1, r1); str16(r2, r1)
+                |4: ldr32(r1, r1); str32(r2, r1)
+                |8: ldr64(r1, r1); str64(r2, r1)
+                END
+
+            |IL.opNOT:
+                UnOp(r1);
+                Emit(opCMPC, r1, 0);
                 Emit(opSEQ, r1, 0)
-            ELSE
+
+            |IL.opORD:
+                UnOp(r1);
+                Emit(opCMPC, r1, 0);
                 Emit(opSNE, r1, 0)
-            END;
-            drop
-
-        |IL.opSAVEP:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            ProcAdr(r2, param2);
-            str(r1, r2);
-            drop;
-            drop
-
-        |IL.opPUSHP:
-            ProcAdr(GetAnyReg(), param2)
-
-        |IL.opPUSHT:
-            UnOp(r1);
-            Emit(opLD, r1 * 256 + GetAnyReg(), -szWord)
-
-        |IL.opGET, IL.opGETC:
-            IF opcode = IL.opGET THEN
-                BinOp(r1, r2)
-            ELSIF opcode = IL.opGETC THEN
+
+            |IL.opMIN, IL.opMAX:
+                BinOp(r1, r2);
+                Emit(opCMP, r1, r2);
+                label := IL.NewLabel();
+                IF opcode = IL.opMIN THEN
+                    Emit(opJLE, label, 0)
+                ELSE
+                    Emit(opJGE, label, 0)
+                END;
+                Emit(opMOV, r1, r2);
+                Emit(opLABEL, label, 0);
+                drop
+
+            |IL.opMINC, IL.opMAXC:
+                UnOp(r1);
+                Emit(opCMPC, r1, param2);
+                label := IL.NewLabel();
+                IF opcode = IL.opMINC THEN
+                    Emit(opJLE, label, 0)
+                ELSE
+                    Emit(opJGE, label, 0)
+                END;
+                Emit(opMOVC, r1, param2);
+                Emit(opLABEL, label, 0)
+
+            |IL.opIN:
+                BinOp(r1, r2);
+                Emit(opBIT, r1, r1);
+                Emit(opAND, r1, r2);
+                Emit(opCMPC, r1, 0);
+                Emit(opSNE, r1, 0);
+                drop
+
+            |IL.opINL:
+                UnOp(r1);
+                Emit(opANDC, r1, ORD({param2}));
+                Emit(opCMPC, r1, 0);
+                Emit(opSNE, r1, 0)
+
+            |IL.opINR:
+                UnOp(r1);
+                Emit(opBIT, r1, r1);
+                Emit(opANDC, r1, param2);
+                Emit(opCMPC, r1, 0);
+                Emit(opSNE, r1, 0)
+
+            |IL.opERR:
+                CallRTL(IL._error, 4)
+
+            |IL.opEQS .. IL.opGES:
+                PushAll(4);
+                pushc(opcode - IL.opEQS);
+                CallRTL(IL._strcmp, 5);
+                GetAcc
+
+            |IL.opEQSW .. IL.opGESW:
+                PushAll(4);
+                pushc(opcode - IL.opEQSW);
+                CallRTL(IL._strcmpw, 5);
+                GetAcc
+
+            |IL.opCOPY:
+                PushAll(2);
+                pushc(param2);
+                CallRTL(IL._move, 3)
+
+            |IL.opMOVE:
+                PushAll(3);
+                CallRTL(IL._move, 3)
+
+            |IL.opCOPYA:
+                PushAll(4);
+                pushc(param2);
+                CallRTL(IL._arrcpy, 5);
+                GetAcc
+
+            |IL.opCOPYS:
+                PushAll(4);
+                pushc(param2);
+                CallRTL(IL._strcpy, 5)
+
+            |IL.opROT:
+                PushAll(0);
+                mov(ACC, SP);
+                push(ACC);
+                pushc(param2);
+                CallRTL(IL._rot, 2)
+
+            |IL.opLENGTH:
+                PushAll(2);
+                CallRTL(IL._length, 2);
+                GetAcc
+
+            |IL.opLENGTHW:
+                PushAll(2);
+                CallRTL(IL._lengthw, 2);
+                GetAcc
+
+            |IL.opSAVES:
                 UnOp(r2);
+                REG.PushAll_1(R);
                 r1 := GetAnyReg();
-                movrc(r1, param1)
-            END;
-            drop;
-            drop;
-
-            CASE param2 OF
-            |1: ldr8(r1, r1);  str8(r2, r1)
-            |2: ldr16(r1, r1); str16(r2, r1)
-            |4: ldr32(r1, r1); str32(r2, r1)
-            |8: ldr64(r1, r1); str64(r2, r1)
-            END
+                StrAdr(r1, param2);
+                push(r1);
+                drop;
+                push(r2);
+                drop;
+                pushc(param1);
+                CallRTL(IL._move, 3)
 
-        |IL.opNOT:
-            UnOp(r1);
-            Emit(opCMPC, r1, 0);
-            Emit(opSEQ, r1, 0)
-
-        |IL.opORD:
-            UnOp(r1);
-            Emit(opCMPC, r1, 0);
-            Emit(opSNE, r1, 0)
-
-        |IL.opMIN, IL.opMAX:
-            BinOp(r1, r2);
-            Emit(opCMP, r1, r2);
-            label := IL.NewLabel();
-            IF opcode = IL.opMIN THEN
-                Emit(opJLE, label, 0)
-            ELSE
-                Emit(opJGE, label, 0)
-            END;
-            Emit(opMOV, r1, r2);
-            Emit(opLABEL, label, 0);
-            drop
-
-        |IL.opMINC, IL.opMAXC:
-            UnOp(r1);
-            Emit(opCMPC, r1, param2);
-            label := IL.NewLabel();
-            IF opcode = IL.opMINC THEN
-                Emit(opJLE, label, 0)
-            ELSE
-                Emit(opJGE, label, 0)
-            END;
-            Emit(opMOVC, r1, param2);
-            Emit(opLABEL, label, 0)
-
-        |IL.opIN:
-            BinOp(r1, r2);
-            Emit(opBIT, r1, r1);
-            Emit(opAND, r1, r2);
-            Emit(opCMPC, r1, 0);
-            Emit(opSNE, r1, 0);
-            drop
-
-        |IL.opINL:
-            UnOp(r1);
-            Emit(opANDC, r1, ORD({param2}));
-            Emit(opCMPC, r1, 0);
-            Emit(opSNE, r1, 0)
-
-        |IL.opINR:
-            UnOp(r1);
-            Emit(opBIT, r1, r1);
-            Emit(opANDC, r1, param2);
-            Emit(opCMPC, r1, 0);
-            Emit(opSNE, r1, 0)
-
-        |IL.opERR:
-            CallRTL(IL._error, 4)
-
-        |IL.opEQS .. IL.opGES:
-            PushAll(4);
-            pushc(opcode - IL.opEQS);
-            CallRTL(IL._strcmp, 5);
-            GetAcc
-
-        |IL.opEQSW .. IL.opGESW:
-            PushAll(4);
-            pushc(opcode - IL.opEQSW);
-            CallRTL(IL._strcmpw, 5);
-            GetAcc
-
-        |IL.opCOPY:
-            PushAll(2);
-            pushc(param2);
-            CallRTL(IL._move, 3)
-
-        |IL.opMOVE:
-            PushAll(3);
-            CallRTL(IL._move, 3)
-
-        |IL.opCOPYA:
-            PushAll(4);
-            pushc(param2);
-            CallRTL(IL._arrcpy, 5);
-            GetAcc
-
-        |IL.opCOPYS:
-            PushAll(4);
-            pushc(param2);
-            CallRTL(IL._strcpy, 5)
-
-        |IL.opROT:
-            PushAll(0);
-            mov(ACC, SP);
-            push(ACC);
-            pushc(param2);
-            CallRTL(IL._rot, 2)
-
-        |IL.opLENGTH:
-            PushAll(2);
-            CallRTL(IL._length, 2);
-            GetAcc
-
-        |IL.opLENGTHW:
-            PushAll(2);
-            CallRTL(IL._lengthw, 2);
-            GetAcc
-
-        |IL.opSAVES:
-            UnOp(r2);
-            REG.PushAll_1(R);
-            r1 := GetAnyReg();
-            StrAdr(r1, param2);
-            push(r1);
-            drop;
-            push(r2);
-            drop;
-            pushc(param1);
-            CallRTL(IL._move, 3)
-
-        |IL.opRSET:
-            PushAll(2);
-            CallRTL(IL._set, 2);
-            GetAcc
-
-        |IL.opRSETR:
-            PushAll(1);
-            pushc(param2);
-            CallRTL(IL._set, 2);
-            GetAcc
-
-        |IL.opRSETL:
-            UnOp(r1);
-            REG.PushAll_1(R);
-            pushc(param2);
-            push(r1);
-            drop;
-            CallRTL(IL._set, 2);
-            GetAcc
-
-        |IL.opRSET1:
-            PushAll(1);
-            CallRTL(IL._set1, 1);
-            GetAcc
-
-        |IL.opNEW:
-            PushAll(1);
-            INC(param2, szWord);
-            ASSERT(UTILS.Align(param2, szWord));
-            pushc(param2);
-            pushc(param1);
-            CallRTL(IL._new, 3)
-
-        |IL.opTYPEGP:
-            UnOp(r1);
-            PushAll(0);
-            push(r1);
-            pushc(param2);
-            CallRTL(IL._guard, 2);
-            GetAcc
-
-        |IL.opIS:
-            PushAll(1);
-            pushc(param2);
-            CallRTL(IL._is, 2);
-            GetAcc
-
-        |IL.opISREC:
-            PushAll(2);
-            pushc(param2);
-            CallRTL(IL._guardrec, 3);
-            GetAcc
-
-        |IL.opTYPEGR:
-            PushAll(1);
-            pushc(param2);
-            CallRTL(IL._guardrec, 2);
-            GetAcc
-
-        |IL.opTYPEGD:
-            UnOp(r1);
-            PushAll(0);
-            subrc(r1, szWord);
-            ldr(r1, r1);
-            push(r1);
-            pushc(param2);
-            CallRTL(IL._guardrec, 2);
-            GetAcc
-
-        |IL.opCASET:
-            push(R1);
-            push(R1);
-            pushc(param2);
-            CallRTL(IL._guardrec, 2);
-            pop(R1);
-            jnz(ACC, param1)
-
-        |IL.opCONSTF:
-            IF szWord = 8 THEN
-                movrc(GetAnyReg(), UTILS.splitf(cmd.float, a, b))
-            ELSE (* szWord = 4 *)
-                movrc(GetAnyReg(), UTILS.d2s(cmd.float))
-            END
+            |IL.opRSET:
+                PushAll(2);
+                CallRTL(IL._set, 2);
+                GetAcc
 
-        |IL.opMULF:
-            PushAll(2);
-            CallRTL(IL._fmul, 2);
-            GetAcc
-
-        |IL.opDIVF:
-            PushAll(2);
-            CallRTL(IL._fdiv, 2);
-            GetAcc
-
-        |IL.opDIVFI:
-            PushAll(2);
-            CallRTL(IL._fdivi, 2);
-            GetAcc
-
-        |IL.opADDF:
-            PushAll(2);
-            CallRTL(IL._fadd, 2);
-            GetAcc
-
-        |IL.opSUBFI:
-            PushAll(2);
-            CallRTL(IL._fsubi, 2);
-            GetAcc
-
-        |IL.opSUBF:
-            PushAll(2);
-            CallRTL(IL._fsub, 2);
-            GetAcc
-
-        |IL.opEQF..IL.opGEF:
-            PushAll(2);
-            pushc(opcode - IL.opEQF);
-            CallRTL(IL._fcmp, 3);
-            GetAcc
-
-        |IL.opFLOOR:
-            PushAll(1);
-            CallRTL(IL._floor, 1);
-            GetAcc
-
-        |IL.opFLT:
-            PushAll(1);
-            CallRTL(IL._flt, 1);
-            GetAcc
-
-        |IL.opUMINF:
-            UnOp(r1);
-            Emit(opRORC, r1, -1);
-            Emit(opXORC, r1,  1);
-            Emit(opRORC, r1,  1)
-
-        |IL.opFABS:
-            UnOp(r1);
-            Emit(opLSLC, r1, 1);
-            Emit(opLSRC, r1, 1)
-
-        |IL.opINF:
-            r1 := GetAnyReg();
-            Emit(opMOVC, r1, 1);
-            Emit(opRORC, r1, 1);
-            Emit(opASRC, r1, 7 + 3 * ORD(szWord = 8));
-            Emit(opLSRC, r1, 1)
-
-        |IL.opPUSHF:
-            UnOp(r1);
-            push(r1);
-            drop
-
-        |IL.opPACK:
-            PushAll(2);
-            CallRTL(IL._pack, 2)
-
-        |IL.opPACKC:
-            PushAll(1);
-            pushc(param2);
-            CallRTL(IL._pack, 2)
-
-        |IL.opUNPK:
-            PushAll(2);
-            CallRTL(IL._unpk, 2)
-
-        |IL.opCODE:
-            OutInt(param2)
-
-        |IL.opLADR_SAVE:
-            UnOp(r1);
-            Emit(opST, BP * 256 + r1, param2 * szWord);
-            drop
-
-        |IL.opLADR_INCC:
-            r1 := GetAnyReg();
-            Emit(opLD, BP * 256 + r1, param1 * szWord);
-            Emit(opADDC, r1, param2);
-            Emit(opST, BP * 256 + r1, param1 * szWord);
-            drop
+            |IL.opRSETR:
+                PushAll(1);
+                pushc(param2);
+                CallRTL(IL._set, 2);
+                GetAcc
 
-        END;
+            |IL.opRSETL:
+                UnOp(r1);
+                REG.PushAll_1(R);
+                pushc(param2);
+                push(r1);
+                drop;
+                CallRTL(IL._set, 2);
+                GetAcc
+
+            |IL.opRSET1:
+                PushAll(1);
+                CallRTL(IL._set1, 1);
+                GetAcc
+
+            |IL.opNEW:
+                PushAll(1);
+                INC(param2, szWord);
+                ASSERT(UTILS.Align(param2, szWord));
+                pushc(param2);
+                pushc(param1);
+                CallRTL(IL._new, 3)
+
+            |IL.opTYPEGP:
+                UnOp(r1);
+                PushAll(0);
+                push(r1);
+                pushc(param2);
+                CallRTL(IL._guard, 2);
+                GetAcc
+
+            |IL.opIS:
+                PushAll(1);
+                pushc(param2);
+                CallRTL(IL._is, 2);
+                GetAcc
+
+            |IL.opISREC:
+                PushAll(2);
+                pushc(param2);
+                CallRTL(IL._guardrec, 3);
+                GetAcc
+
+            |IL.opTYPEGR:
+                PushAll(1);
+                pushc(param2);
+                CallRTL(IL._guardrec, 2);
+                GetAcc
+
+            |IL.opTYPEGD:
+                UnOp(r1);
+                PushAll(0);
+                subrc(r1, szWord);
+                ldr(r1, r1);
+                push(r1);
+                pushc(param2);
+                CallRTL(IL._guardrec, 2);
+                GetAcc
+
+            |IL.opCASET:
+                push(R1);
+                push(R1);
+                pushc(param2);
+                CallRTL(IL._guardrec, 2);
+                pop(R1);
+                jnz(ACC, param1)
+
+            |IL.opCONSTF:
+                IF szWord = 8 THEN
+                    movrc(GetAnyReg(), UTILS.splitf(cmd.float, a, b))
+                ELSE (* szWord = 4 *)
+                    movrc(GetAnyReg(), UTILS.d2s(cmd.float))
+                END
+
+            |IL.opMULF:
+                PushAll(2);
+                CallRTL(IL._fmul, 2);
+                GetAcc
+
+            |IL.opDIVF:
+                PushAll(2);
+                CallRTL(IL._fdiv, 2);
+                GetAcc
+
+            |IL.opDIVFI:
+                PushAll(2);
+                CallRTL(IL._fdivi, 2);
+                GetAcc
+
+            |IL.opADDF:
+                PushAll(2);
+                CallRTL(IL._fadd, 2);
+                GetAcc
+
+            |IL.opSUBFI:
+                PushAll(2);
+                CallRTL(IL._fsubi, 2);
+                GetAcc
+
+            |IL.opSUBF:
+                PushAll(2);
+                CallRTL(IL._fsub, 2);
+                GetAcc
+
+            |IL.opEQF..IL.opGEF:
+                PushAll(2);
+                pushc(opcode - IL.opEQF);
+                CallRTL(IL._fcmp, 3);
+                GetAcc
+
+            |IL.opFLOOR:
+                PushAll(1);
+                CallRTL(IL._floor, 1);
+                GetAcc
+
+            |IL.opFLT:
+                PushAll(1);
+                CallRTL(IL._flt, 1);
+                GetAcc
+
+            |IL.opUMINF:
+                UnOp(r1);
+                Emit(opRORC, r1, -1);
+                Emit(opXORC, r1,  1);
+                Emit(opRORC, r1,  1)
 
-        cmd := cmd.next(IL.COMMAND)
-    END;
+            |IL.opFABS:
+                UnOp(r1);
+                Emit(opLSLC, r1, 1);
+                Emit(opLSRC, r1, 1)
+
+            |IL.opINF:
+                r1 := GetAnyReg();
+                Emit(opMOVC, r1, 1);
+                Emit(opRORC, r1, 1);
+                Emit(opASRC, r1, 7 + 3 * ORD(szWord = 8));
+                Emit(opLSRC, r1, 1)
+
+            |IL.opPUSHF:
+                UnOp(r1);
+                push(r1);
+                drop
+
+            |IL.opPACK:
+                PushAll(2);
+                CallRTL(IL._pack, 2)
+
+            |IL.opPACKC:
+                PushAll(1);
+                pushc(param2);
+                CallRTL(IL._pack, 2)
+
+            |IL.opUNPK:
+                PushAll(2);
+                CallRTL(IL._unpk, 2)
+
+            |IL.opCODE:
+                OutInt(param2)
+
+            |IL.opLADR_SAVE:
+                UnOp(r1);
+                Emit(opST, BP * 256 + r1, param2 * szWord);
+                drop
+
+            |IL.opLADR_INCC:
+                r1 := GetAnyReg();
+                Emit(opLD, BP * 256 + r1, param1 * szWord);
+                Emit(opADDC, r1, param2);
+                Emit(opST, BP * 256 + r1, param1 * szWord);
+                drop
+
+            END;
+
+            cmd := cmd.next(IL.COMMAND)
+        END;
 
-    ASSERT(R.pushed = 0);
-    ASSERT(R.top = -1)
-END translate;
+        ASSERT(R.pushed = 0);
+        ASSERT(R.top = -1)
+    END translate;
 
 
 PROCEDURE prolog;
-BEGIN
-    Emit(opLEA, SP + LStack * 256, 0);
-    Emit(opLEA, ACC + LTypes * 256, 0);
-    push(ACC);
-    Emit(opLEA, ACC + LHeap * 256, 0);
-    push(ACC);
-    pushc(CHL.Length(IL.codes.types));
-    CallRTL(IL._init, 3)
-END prolog;
+    BEGIN
+        Emit(opLEA, SP + LStack * 256, 0);
+        Emit(opLEA, ACC + LTypes * 256, 0);
+        push(ACC);
+        Emit(opLEA, ACC + LHeap * 256, 0);
+        push(ACC);
+        pushc(CHL.Length(IL.codes.types));
+        CallRTL(IL._init, 3)
+    END prolog;
 
 
 PROCEDURE epilog (ram, szWord: INTEGER);
-VAR
-    tcount, dcount, i, offTypes, offStrings,
-    szData, szGlobal, szHeapStack: INTEGER;
-
-BEGIN
-    Emit(opSTOP, 0, 0);
-
-    offTypes := count;
-
-    tcount := CHL.Length(IL.codes.types);
-    FOR i := 0 TO tcount - 1 DO
-        OutInt(CHL.GetInt(IL.codes.types, i))
-    END;
-
-    offStrings := count;
-    dcount := CHL.Length(IL.codes.data);
-    FOR i := 0 TO dcount - 1 DO
-        OutByte(CHL.GetByte(IL.codes.data, i))
-    END;
-
-    IF dcount MOD szWord # 0 THEN
-        i := szWord - dcount MOD szWord;
-        WHILE i > 0 DO
-            OutByte(0);
-            DEC(i)
-        END
-    END;
+    VAR
+        tcount, dcount, i, offTypes, offStrings,
+        szData, szGlobal, szHeapStack: INTEGER;
 
-    szData := count - offTypes;
-    szGlobal := (IL.codes.bss DIV szWord + 1) * szWord;
-    szHeapStack := ram - szData - szGlobal;
+    BEGIN
+        Emit(opSTOP, 0, 0);
 
-    OutInt(offTypes);
-    OutInt(offStrings);
-    OutInt(szGlobal DIV szWord);
-    OutInt(szHeapStack DIV szWord);
-    FOR i := 1 TO 8 DO
-        OutInt(0)
-    END
-END epilog;
+        offTypes := count;
+
+        tcount := CHL.Length(IL.codes.types);
+        FOR i := 0 TO tcount - 1 DO
+            OutInt(CHL.GetInt(IL.codes.types, i))
+        END;
+
+        offStrings := count;
+        dcount := CHL.Length(IL.codes.data);
+        FOR i := 0 TO dcount - 1 DO
+            OutByte(CHL.GetByte(IL.codes.data, i))
+        END;
+
+        IF dcount MOD szWord # 0 THEN
+            i := szWord - dcount MOD szWord;
+            WHILE i > 0 DO
+                OutByte(0);
+                DEC(i)
+            END
+        END;
+
+        szData := count - offTypes;
+        szGlobal := (IL.codes.bss DIV szWord + 1) * szWord;
+        szHeapStack := ram - szData - szGlobal;
+
+        OutInt(offTypes);
+        OutInt(offStrings);
+        OutInt(szGlobal DIV szWord);
+        OutInt(szHeapStack DIV szWord);
+        FOR i := 1 TO 8 DO
+            OutInt(0)
+        END
+    END epilog;
 
 
 PROCEDURE CodeGen* (outname: ARRAY OF CHAR; target: INTEGER; options: PROG.OPTIONS);
-CONST
-    minRAM = 32*1024;
-    maxRAM = 256*1024;
+    CONST
+        minRAM = 32*1024;
+        maxRAM = 256*1024;
+
+    VAR
+        szData, szRAM: INTEGER;
+
+    BEGIN
+        szWord := TARGETS.WordSize;
+        IF szWord = 8 THEN
+            ldr := ldr64;
+            str := str64
+        ELSE
+            ldr := ldr32;
+            str := str32
+        END;
+        szData := (CHL.Length(IL.codes.types) + CHL.Length(IL.codes.data) DIV szWord + IL.codes.bss DIV szWord + 2) * szWord;
+        szRAM := MIN(MAX(options.ram, minRAM), maxRAM) * 1024;
 
-VAR
-    szData, szRAM: INTEGER;
-
-BEGIN
-    szWord := TARGETS.WordSize;
-    IF szWord = 8 THEN
-        ldr := ldr64;
-        str := str64
-    ELSE
-        ldr := ldr32;
-        str := str32
-    END;
-    szData := (CHL.Length(IL.codes.types) + CHL.Length(IL.codes.data) DIV szWord + IL.codes.bss DIV szWord + 2) * szWord;
-    szRAM := MIN(MAX(options.ram, minRAM), maxRAM) * 1024;
-
-    IF szRAM - szData < 1024*1024 THEN
-        ERRORS.Error(208)
-    END;
-
-    count := 0;
-    WR.Create(outname);
-
-    REG.Init(R, push, pop, mov, xchg, GPRs);
-
-    prolog;
-    translate(szWord);
-    epilog(szRAM, szWord);
-
-    WR.Close
-END CodeGen;
+        IF szRAM - szData < 1024*1024 THEN
+            ERRORS.Error(208)
+        END;
+
+        count := 0;
+        WR.Create(outname);
+
+        REG.Init(R, push, pop, mov, xchg, GPRs);
+
+        prolog;
+        translate(szWord);
+        epilog(szRAM, szWord);
+
+        WR.Close
+    END CodeGen;
 
 
 END RVMxI.

+ 76 - 76
source/SCAN.ob07

@@ -98,13 +98,13 @@ VAR
 
 
 PROCEDURE enterKW (s: KEYWORD; idx: INTEGER);
-BEGIN
-    KW[idx].lower := s;
-    KW[idx].upper := s;
-    S.UpCase(KW[idx].upper);
-    KW[idx].uhash := S.HashStr(KW[idx].upper);
-    KW[idx].lhash := S.HashStr(KW[idx].lower);
-END enterKW;
+    BEGIN
+        KW[idx].lower := s;
+        KW[idx].upper := s;
+        S.UpCase(KW[idx].upper);
+        KW[idx].uhash := S.HashStr(KW[idx].upper);
+        KW[idx].lhash := S.HashStr(KW[idx].lower);
+    END enterKW;
 
 
 PROCEDURE checkKW (ident: IDENT): INTEGER;
@@ -124,7 +124,7 @@ PROCEDURE checkKW (ident: IDENT): INTEGER;
         END
 
         RETURN res
-END checkKW;
+    END checkKW;
 
 
 PROCEDURE enterStr* (s: TEXTSTR): STRING;
@@ -154,21 +154,21 @@ PROCEDURE enterStr* (s: TEXTSTR): STRING;
         END
 
         RETURN res
-END enterStr;
+    END enterStr;
 
 
 PROCEDURE nextc (text: TXT.TEXT): CHAR;
     BEGIN
         TXT.next(text)
         RETURN text.peak
-END nextc;
+    END nextc;
 
 
 PROCEDURE setIdent* (VAR ident: IDENT; s: IDSTR);
     BEGIN
         ident.s := s;
         ident.hash := S.HashStr(s)
-END setIdent;
+    END setIdent;
 
 
 PROCEDURE ident (text: TXT.TEXT; VAR lex: LEX);
@@ -197,7 +197,7 @@ PROCEDURE ident (text: TXT.TEXT; VAR lex: LEX);
                 c := nextc(text)
             END
         END
-END ident;
+    END ident;
 
 
 PROCEDURE number (text: TXT.TEXT; VAR lex: LEX);
@@ -326,7 +326,7 @@ PROCEDURE number (text: TXT.TEXT; VAR lex: LEX);
         END;
 
         lex.sym := sym
-END number;
+    END number;
 
 
 PROCEDURE string (text: TXT.TEXT; VAR lex: LEX; quot: CHAR);
@@ -369,7 +369,7 @@ PROCEDURE string (text: TXT.TEXT; VAR lex: LEX; quot: CHAR);
             lex.value.string := lex.string
         END
 
-END string;
+    END string;
 
 
 PROCEDURE comment (text: TXT.TEXT);
@@ -406,7 +406,7 @@ PROCEDURE comment (text: TXT.TEXT);
 
         UNTIL (depth = 0) OR text.eof
 
-END comment;
+    END comment;
 
 
 PROCEDURE delimiter (text: TXT.TEXT; c: CHAR): INTEGER;
@@ -521,7 +521,7 @@ PROCEDURE delimiter (text: TXT.TEXT; c: CHAR): INTEGER;
         END
 
         RETURN sym
-END delimiter;
+    END delimiter;
 
 
 PROCEDURE Next* (text: SCANNER; VAR lex: LEX);
@@ -690,84 +690,84 @@ PROCEDURE Next* (text: SCANNER; VAR lex: LEX);
 
         UNTIL (lex.sym # lxCOMMENT) & ~text.skip
 
-END Next;
+    END Next;
 
 
 PROCEDURE open* (name: ARRAY OF CHAR): SCANNER;
-    RETURN TXT.open(name)
-END open;
+        RETURN TXT.open(name)
+    END open;
 
 
 PROCEDURE close* (VAR scanner: SCANNER);
-BEGIN
-    TXT.close(scanner)
-END close;
+    BEGIN
+        TXT.close(scanner)
+    END close;
 
 
 PROCEDURE init* (lower: BOOLEAN);
-VAR
-    i: INTEGER;
-    delim: ARRAY 23 OF CHAR;
+    VAR
+        i: INTEGER;
+        delim: ARRAY 23 OF CHAR;
 
-BEGIN
-    upto := FALSE;
-    LowerCase := lower;
+    BEGIN
+        upto := FALSE;
+        LowerCase := lower;
 
-    FOR i := 0 TO 255 DO
-        delimiters[i] := FALSE
-    END;
+        FOR i := 0 TO 255 DO
+            delimiters[i] := FALSE
+        END;
 
-    delim := "+-*/~&.,;|([{^=#<>:)]}";
+        delim := "+-*/~&.,;|([{^=#<>:)]}";
 
-    FOR i := 0 TO LEN(delim) - 2 DO
-        delimiters[ORD(delim[i])] := TRUE
-    END;
+        FOR i := 0 TO LEN(delim) - 2 DO
+            delimiters[ORD(delim[i])] := TRUE
+        END;
 
-    enterKW("array",      0);
-    enterKW("begin",      1);
-    enterKW("by",         2);
-    enterKW("case",       3);
-    enterKW("const",      4);
-    enterKW("div",        5);
-    enterKW("do",         6);
-    enterKW("else",       7);
-    enterKW("elsif",      8);
-    enterKW("end",        9);
-    enterKW("false",     10);
-    enterKW("for",       11);
-    enterKW("if",        12);
-    enterKW("import",    13);
-    enterKW("in",        14);
-    enterKW("is",        15);
-    enterKW("mod",       16);
-    enterKW("module",    17);
-    enterKW("nil",       18);
-    enterKW("of",        19);
-    enterKW("or",        20);
-    enterKW("pointer",   21);
-    enterKW("procedure", 22);
-    enterKW("record",    23);
-    enterKW("repeat",    24);
-    enterKW("return",    25);
-    enterKW("then",      26);
-    enterKW("to",        27);
-    enterKW("true",      28);
-    enterKW("type",      29);
-    enterKW("until",     30);
-    enterKW("var",       31);
-    enterKW("while",     32)
-END init;
+        enterKW("array",      0);
+        enterKW("begin",      1);
+        enterKW("by",         2);
+        enterKW("case",       3);
+        enterKW("const",      4);
+        enterKW("div",        5);
+        enterKW("do",         6);
+        enterKW("else",       7);
+        enterKW("elsif",      8);
+        enterKW("end",        9);
+        enterKW("false",     10);
+        enterKW("for",       11);
+        enterKW("if",        12);
+        enterKW("import",    13);
+        enterKW("in",        14);
+        enterKW("is",        15);
+        enterKW("mod",       16);
+        enterKW("module",    17);
+        enterKW("nil",       18);
+        enterKW("of",        19);
+        enterKW("or",        20);
+        enterKW("pointer",   21);
+        enterKW("procedure", 22);
+        enterKW("record",    23);
+        enterKW("repeat",    24);
+        enterKW("return",    25);
+        enterKW("then",      26);
+        enterKW("to",        27);
+        enterKW("true",      28);
+        enterKW("type",      29);
+        enterKW("until",     30);
+        enterKW("var",       31);
+        enterKW("while",     32)
+    END init;
 
 
 PROCEDURE NewDef* (str: ARRAY OF CHAR);
-VAR
-    item: DEF;
+    VAR
+        item: DEF;
 
-BEGIN
-    NEW(item);
-    COPY(str, item.ident);
-    LISTS.push(def, item)
-END NewDef;
+    BEGIN
+        NEW(item);
+        COPY(str, item.ident);
+        LISTS.push(def, item)
+    END NewDef;
 
 
 BEGIN

Diff do ficheiro suprimidas por serem muito extensas
+ 2114 - 2060
source/STATEMENTS.ob07


+ 253 - 260
source/STRINGS.ob07

@@ -1,342 +1,335 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2018-2021, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE STRINGS;
+MODULE STRINGS;
 
 IMPORT UTILS;
 
 
 PROCEDURE copy* (src: ARRAY OF CHAR; VAR dst: ARRAY OF CHAR; spos, dpos, count: INTEGER);
-BEGIN
-    WHILE count > 0 DO
-        dst[dpos] := src[spos];
-        INC(spos);
-        INC(dpos);
-        DEC(count)
-    END
-END copy;
+    BEGIN
+        WHILE count > 0 DO
+            dst[dpos] := src[spos];
+            INC(spos);
+            INC(dpos);
+            DEC(count)
+        END
+    END copy;
 
 
 PROCEDURE append* (VAR s1: ARRAY OF CHAR; s2: ARRAY OF CHAR);
-VAR
-    n1, n2: INTEGER;
+    VAR
+        n1, n2: INTEGER;
 
-BEGIN
-    n1 := LENGTH(s1);
-    n2 := LENGTH(s2);
+    BEGIN
+        n1 := LENGTH(s1);
+        n2 := LENGTH(s2);
 
-    ASSERT(n1 + n2 < LEN(s1));
+        ASSERT(n1 + n2 < LEN(s1));
 
-    copy(s2, s1, 0, n1, n2);
-    s1[n1 + n2] := 0X
-END append;
+        copy(s2, s1, 0, n1, n2);
+        s1[n1 + n2] := 0X
+    END append;
 
 
 PROCEDURE IntToStr* (x: INTEGER; VAR str: ARRAY OF CHAR);
-VAR
-    i, a: INTEGER;
-
-BEGIN
-    IF x = UTILS.minint THEN
-        IF UTILS.bit_depth = 32 THEN
-            COPY("-2147483648", str)
-        ELSIF UTILS.bit_depth = 64 THEN
-            COPY("-9223372036854775808", str)
-        END
+    VAR
+        i, a: INTEGER;
+
+    BEGIN
+        IF x = UTILS.minint THEN
+            IF UTILS.bit_depth = 32 THEN
+                COPY("-2147483648", str)
+            ELSIF UTILS.bit_depth = 64 THEN
+                COPY("-9223372036854775808", str)
+            END
 
-    ELSE
-        i := 0;
-        IF x < 0 THEN
-            x := -x;
-            i := 1;
-            str[0] := "-"
-        END;
+        ELSE
+            i := 0;
+            IF x < 0 THEN
+                x := -x;
+                i := 1;
+                str[0] := "-"
+            END;
 
-        a := x;
-        REPEAT
-            INC(i);
-            a := a DIV 10
-        UNTIL a = 0;
+            a := x;
+            REPEAT
+                INC(i);
+                a := a DIV 10
+            UNTIL a = 0;
 
-        str[i] := 0X;
+            str[i] := 0X;
 
-        REPEAT
-            DEC(i);
-            str[i] := CHR(x MOD 10 + ORD("0"));
-            x := x DIV 10
-        UNTIL x = 0
-    END
-END IntToStr;
+            REPEAT
+                DEC(i);
+                str[i] := CHR(x MOD 10 + ORD("0"));
+                x := x DIV 10
+            UNTIL x = 0
+        END
+    END IntToStr;
 
 
 PROCEDURE search* (s: ARRAY OF CHAR; VAR pos: INTEGER; c: CHAR; forward: BOOLEAN);
-VAR
-    length: INTEGER;
-
-BEGIN
-    length := LENGTH(s);
-
-    IF (0 <= pos) & (pos < length) THEN
-        IF forward THEN
-            WHILE (pos < length) & (s[pos] # c) DO
-                INC(pos)
-            END;
-            IF pos = length THEN
-                pos := -1
+    VAR
+        length: INTEGER;
+
+    BEGIN
+        length := LENGTH(s);
+
+        IF (0 <= pos) & (pos < length) THEN
+            IF forward THEN
+                WHILE (pos < length) & (s[pos] # c) DO
+                    INC(pos)
+                END;
+                IF pos = length THEN
+                    pos := -1
+                END
+            ELSE
+                WHILE (pos >= 0) & (s[pos] # c) DO
+                    DEC(pos)
+                END
             END
         ELSE
-            WHILE (pos >= 0) & (s[pos] # c) DO
-                DEC(pos)
-            END
+            pos := -1
         END
-    ELSE
-        pos := -1
-    END
-END search;
+    END search;
 
 
 PROCEDURE replace* (VAR s: ARRAY OF CHAR; find, repl: CHAR);
-VAR
-    i, strlen: INTEGER;
-
-BEGIN
-    strlen := LENGTH(s) - 1;
-    FOR i := 0 TO strlen DO
-        IF s[i] = find THEN
-            s[i] := repl
+    VAR
+        i, strlen: INTEGER;
+
+    BEGIN
+        strlen := LENGTH(s) - 1;
+        FOR i := 0 TO strlen DO
+            IF s[i] = find THEN
+                s[i] := repl
+            END
         END
-    END
-END replace;
+    END replace;
 
 
 PROCEDURE trim* (source: ARRAY OF CHAR; VAR result: ARRAY OF CHAR);
-VAR
-    LenS, start, _end, i, j: INTEGER;
-
-BEGIN
-    LenS := LENGTH(source) - 1;
-    j := 0;
-    IF LenS >= 0 THEN
-        start := 0;
-        WHILE (start <= LenS) & (source[start] <= 20X) DO
-            INC(start)
-        END;
+    VAR
+        LenS, start, _end, i, j: INTEGER;
+
+    BEGIN
+        LenS := LENGTH(source) - 1;
+        j := 0;
+        IF LenS >= 0 THEN
+            start := 0;
+            WHILE (start <= LenS) & (source[start] <= 20X) DO
+                INC(start)
+            END;
 
-        _end := LenS;
-        WHILE (_end >= 0) & (source[_end] <= 20X) DO
-            DEC(_end)
-        END;
+            _end := LenS;
+            WHILE (_end >= 0) & (source[_end] <= 20X) DO
+                DEC(_end)
+            END;
 
-        FOR i := start TO _end DO
-            result[j] := source[i];
-            INC(j)
-        END
-    END;
-    result[j] := 0X
-END trim;
+            FOR i := start TO _end DO
+                result[j] := source[i];
+                INC(j)
+            END
+        END;
+        result[j] := 0X
+    END trim;
 
 
 PROCEDURE letter* (c: CHAR): BOOLEAN;
-    RETURN ("a" <= c) & (c <= "z") OR ("A" <= c) & (c <= "Z") OR (c = "_")
-END letter;
+        RETURN ("a" <= c) & (c <= "z") OR ("A" <= c) & (c <= "Z") OR (c = "_")
+    END letter;
 
 
 PROCEDURE digit* (c: CHAR): BOOLEAN;
-    RETURN ("0" <= c) & (c <= "9")
-END digit;
+        RETURN ("0" <= c) & (c <= "9")
+    END digit;
 
 
 PROCEDURE hexdigit* (c: CHAR): BOOLEAN;
-    RETURN ("0" <= c) & (c <= "9") OR ("A" <= c) & (c <= "F")
-END hexdigit;
+        RETURN ("0" <= c) & (c <= "9") OR ("A" <= c) & (c <= "F")
+    END hexdigit;
 
 
 PROCEDURE space* (c: CHAR): BOOLEAN;
-    RETURN (0X < c) & (c <= 20X)
-END space;
+        RETURN (0X < c) & (c <= 20X)
+    END space;
 
 
 PROCEDURE cap* (VAR c: CHAR);
-BEGIN
-    IF ("a" <= c) & (c <= "z") THEN
-        c := CHR(ORD(c) - 32)
-    END
-END cap;
+    BEGIN
+        IF ("a" <= c) & (c <= "z") THEN
+            c := CHR(ORD(c) - 32)
+        END
+    END cap;
 
 
 PROCEDURE UpCase* (VAR str: ARRAY OF CHAR);
-VAR
-    i: INTEGER;
-
-BEGIN
-    i := LENGTH(str) - 1;
-    WHILE i >= 0 DO
-        cap(str[i]);
-        DEC(i)
-    END
-END UpCase;
+    VAR
+        i: INTEGER;
+
+    BEGIN
+        i := LENGTH(str) - 1;
+        WHILE i >= 0 DO
+            cap(str[i]);
+            DEC(i)
+        END
+    END UpCase;
 
 
 PROCEDURE StrToInt* (str: ARRAY OF CHAR; VAR x: INTEGER): BOOLEAN;
-VAR
-    i, k: INTEGER;
-    res: BOOLEAN;
-
-BEGIN
-    res := TRUE;
-    i := 0;
-    x := 0;
-    k := LENGTH(str);
-    WHILE i < k DO
-        IF digit(str[i]) THEN
-            x := x * 10 + ORD(str[i]) - ORD("0")
-        ELSE
-            i := k;
-            res := FALSE
-        END;
-        INC(i)
-    END
-
-    RETURN res
-END StrToInt;
+    VAR
+        i, k: INTEGER;
+        res: BOOLEAN;
 
+    BEGIN
+        res := TRUE;
+        i := 0;
+        x := 0;
+        k := LENGTH(str);
+        WHILE i < k DO
+            IF digit(str[i]) THEN
+                x := x * 10 + ORD(str[i]) - ORD("0")
+            ELSE
+                i := k;
+                res := FALSE
+            END;
+            INC(i)
+        END
 
-PROCEDURE CheckVer (str: ARRAY OF CHAR): BOOLEAN;
-VAR
-    i, k: INTEGER;
-    res: BOOLEAN;
+        RETURN res
+    END StrToInt;
 
-BEGIN
-    k := LENGTH(str);
-    res := k < LEN(str);
 
-    IF res & digit(str[0]) THEN
-        i := 0;
-        WHILE (i < k) & digit(str[i]) DO
-            INC(i)
-        END;
-        IF (i < k) & (str[i] = ".") THEN
-            INC(i);
-            IF i < k THEN
-                WHILE (i < k) & digit(str[i]) DO
-                    INC(i)
+PROCEDURE CheckVer (str: ARRAY OF CHAR): BOOLEAN;
+    VAR
+        i, k: INTEGER;
+        res: BOOLEAN;
+
+    BEGIN
+        k := LENGTH(str);
+        res := k < LEN(str);
+
+        IF res & digit(str[0]) THEN
+            i := 0;
+            WHILE (i < k) & digit(str[i]) DO
+                INC(i)
+            END;
+            IF (i < k) & (str[i] = ".") THEN
+                INC(i);
+                IF i < k THEN
+                    WHILE (i < k) & digit(str[i]) DO
+                        INC(i)
+                    END
+                ELSE
+                    res := FALSE
                 END
             ELSE
                 res := FALSE
-            END
+            END;
+
+            res := res & (i = k)
         ELSE
             res := FALSE
-        END;
-
-        res := res & (i = k)
-    ELSE
-        res := FALSE
-    END
+        END
 
-    RETURN res
-END CheckVer;
+        RETURN res
+    END CheckVer;
 
 
 PROCEDURE StrToVer* (str: ARRAY OF CHAR; VAR major, minor: INTEGER): BOOLEAN;
-VAR
-    i: INTEGER;
-    res: BOOLEAN;
-
-BEGIN
-    res := CheckVer(str);
-
-    IF res THEN
-        i := 0;
-        minor := 0;
-        major := 0;
-        WHILE digit(str[i]) DO
-            major := major * 10 + ORD(str[i]) - ORD("0");
-            INC(i)
-        END;
-        INC(i);
-        WHILE digit(str[i]) DO
-            minor := minor * 10 + ORD(str[i]) - ORD("0");
-            INC(i)
+    VAR
+        i: INTEGER;
+        res: BOOLEAN;
+
+    BEGIN
+        res := CheckVer(str);
+
+        IF res THEN
+            i := 0;
+            minor := 0;
+            major := 0;
+            WHILE digit(str[i]) DO
+                major := major * 10 + ORD(str[i]) - ORD("0");
+                INC(i)
+            END;
+            INC(i);
+            WHILE digit(str[i]) DO
+                minor := minor * 10 + ORD(str[i]) - ORD("0");
+                INC(i)
+            END
         END
-    END
 
-    RETURN res
-END StrToVer;
+        RETURN res
+    END StrToVer;
 
 
 PROCEDURE Utf8To16* (src: ARRAY OF CHAR; VAR dst: ARRAY OF WCHAR): INTEGER;
-VAR
-    i, j, u, srclen, dstlen: INTEGER;
-    c: CHAR;
-
-BEGIN
-    srclen := LEN(src);
-    dstlen := LEN(dst);
-    i := 0;
-    j := 0;
-    WHILE (i < srclen) & (j < dstlen) & (src[i] # 0X) DO
-        c := src[i];
-        CASE c OF
-        |00X..7FX:
-            u := ORD(c)
-
-        |0C1X..0DFX:
-            u := (ORD(c) - 0C0H) * 64;
-            IF i + 1 < srclen THEN
-                INC(i);
-                INC(u, ORD(src[i]) MOD 64)
-            END
+    VAR
+        i, j, u, srclen, dstlen: INTEGER;
+        c: CHAR;
 
-        |0E1X..0EFX:
-            u := (ORD(c) - 0E0H) * 4096;
-            IF i + 1 < srclen THEN
-                INC(i);
-                INC(u, (ORD(src[i]) MOD 64) * 64)
+    BEGIN
+        srclen := LEN(src);
+        dstlen := LEN(dst);
+        i := 0;
+        j := 0;
+        WHILE (i < srclen) & (j < dstlen) & (src[i] # 0X) DO
+            c := src[i];
+            CASE c OF
+            |00X..7FX:
+                u := ORD(c)
+
+            |0C1X..0DFX:
+                u := (ORD(c) - 0C0H) * 64;
+                IF i + 1 < srclen THEN
+                    INC(i);
+                    INC(u, ORD(src[i]) MOD 64)
+                END
+
+            |0E1X..0EFX:
+                u := (ORD(c) - 0E0H) * 4096;
+                IF i + 1 < srclen THEN
+                    INC(i);
+                    INC(u, (ORD(src[i]) MOD 64) * 64)
+                END;
+                IF i + 1 < srclen THEN
+                    INC(i);
+                    INC(u, ORD(src[i]) MOD 64)
+                END
+    (*
+            |0F1X..0F7X:
+            |0F9X..0FBX:
+            |0FDX:
+            *)
+            ELSE
             END;
-            IF i + 1 < srclen THEN
-                INC(i);
-                INC(u, ORD(src[i]) MOD 64)
-            END
-(*
-        |0F1X..0F7X:
-        |0F9X..0FBX:
-        |0FDX:
-        *)
-        ELSE
+            INC(i);
+            dst[j] := WCHR(u);
+            INC(j)
         END;
-        INC(i);
-        dst[j] := WCHR(u);
-        INC(j)
-    END;
-    IF j < dstlen THEN
-        dst[j] := WCHR(0)
-    END
+        IF j < dstlen THEN
+            dst[j] := WCHR(0)
+        END
 
-    RETURN j
-END Utf8To16;
+        RETURN j
+    END Utf8To16;
 
 
 PROCEDURE HashStr* (name: ARRAY OF CHAR): INTEGER;
-VAR
-    i, h: INTEGER;
-    g: SET;
-
-BEGIN
-    h := 0;
-    i := 0;
-    WHILE name[i] # 0X DO
-        h := h * 16 + ORD(name[i]);
-        g := BITS(h) * {28..31};
-        h := ORD(BITS(h) / BITS(LSR(ORD(g), 24)) - g);
-        INC(i)
-    END
-
-    RETURN h
-END HashStr;
+    VAR
+        i, h: INTEGER;
+        g: SET;
+
+    BEGIN
+        h := 0;
+        i := 0;
+        WHILE name[i] # 0X DO
+            h := h * 16 + ORD(name[i]);
+            g := BITS(h) * {28..31};
+            h := ORD(BITS(h) / BITS(LSR(ORD(g), 24)) - g);
+            INC(i)
+        END
+
+        RETURN h
+    END HashStr;
 
 
 END STRINGS.

+ 48 - 55
source/TARGETS.ob07

@@ -1,11 +1,4 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2019-2021, 2023, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE TARGETS;
+MODULE TARGETS;
 
 IMPORT UTILS;
 
@@ -73,60 +66,60 @@ VAR
 
 
 PROCEDURE Enter (idx, CPU, RealSize, OS: INTEGER; ComLinePar, LibDir, FileExt: STRING);
-BEGIN
-    Targets[idx].target := idx;
-    Targets[idx].CPU := CPU;
-    Targets[idx].RealSize := RealSize;
-    Targets[idx].OS := OS;
-    Targets[idx].ComLinePar := ComLinePar;
-    Targets[idx].LibDir := LibDir;
-    Targets[idx].FileExt := FileExt;
-END Enter;
+    BEGIN
+        Targets[idx].target := idx;
+        Targets[idx].CPU := CPU;
+        Targets[idx].RealSize := RealSize;
+        Targets[idx].OS := OS;
+        Targets[idx].ComLinePar := ComLinePar;
+        Targets[idx].LibDir := LibDir;
+        Targets[idx].FileExt := FileExt;
+    END Enter;
 
 
 PROCEDURE Select* (ComLineParam: ARRAY OF CHAR): BOOLEAN;
-VAR
-    i: INTEGER;
-    res: BOOLEAN;
-
-BEGIN
-    i := 0;
-    WHILE (i < LEN(Targets)) & (Targets[i].ComLinePar # ComLineParam) DO
-        INC(i)
-    END;
+    VAR
+        i: INTEGER;
+        res: BOOLEAN;
+
+    BEGIN
+        i := 0;
+        WHILE (i < LEN(Targets)) & (Targets[i].ComLinePar # ComLineParam) DO
+            INC(i)
+        END;
 
-    res := i < LEN(Targets);
-    IF res THEN
-        target := Targets[i].target;
-        CPU := Targets[i].CPU;
-        BitDepth := CPUs[CPU].BitDepth;
-        InstrSize := CPUs[CPU].InstrSize;
-        LittleEndian := CPUs[CPU].LittleEndian;
-        RealSize := Targets[i].RealSize;
-        OS := Targets[i].OS;
-        ComLinePar := Targets[i].ComLinePar;
-        LibDir := Targets[i].LibDir;
-        FileExt := Targets[i].FileExt;
-
-        Import := (OS IN {osWIN32, osWIN64, osKOS}) & (target # KolibriOSKer);
-        Dispose := ~(target IN noDISPOSE);
-        RTL := ~(target IN noRTL);
-        Dll := target IN {Linux32SO, Linux64SO, Win32DLL, Win64DLL, KolibriOSDLL, KolibriOSDrv};
-        WinLin := OS IN {osWIN32, osLINUX32, osWIN64, osLINUX64};
-        WordSize := BitDepth DIV 8;
-        AdrSize  := WordSize
-    END
-
-    RETURN res
-END Select;
+        res := i < LEN(Targets);
+        IF res THEN
+            target := Targets[i].target;
+            CPU := Targets[i].CPU;
+            BitDepth := CPUs[CPU].BitDepth;
+            InstrSize := CPUs[CPU].InstrSize;
+            LittleEndian := CPUs[CPU].LittleEndian;
+            RealSize := Targets[i].RealSize;
+            OS := Targets[i].OS;
+            ComLinePar := Targets[i].ComLinePar;
+            LibDir := Targets[i].LibDir;
+            FileExt := Targets[i].FileExt;
+
+            Import := (OS IN {osWIN32, osWIN64, osKOS}) & (target # KolibriOSKer);
+            Dispose := ~(target IN noDISPOSE);
+            RTL := ~(target IN noRTL);
+            Dll := target IN {Linux32SO, Linux64SO, Win32DLL, Win64DLL, KolibriOSDLL, KolibriOSDrv};
+            WinLin := OS IN {osWIN32, osLINUX32, osWIN64, osLINUX64};
+            WordSize := BitDepth DIV 8;
+            AdrSize  := WordSize
+        END
+
+        RETURN res
+    END Select;
 
 
 PROCEDURE EnterCPU (cpu, BitDepth, InstrSize: INTEGER; LittleEndian: BOOLEAN);
-BEGIN
-    CPUs[cpu].BitDepth := BitDepth;
-    CPUs[cpu].InstrSize := InstrSize;
-    CPUs[cpu].LittleEndian := LittleEndian
-END EnterCPU;
+    BEGIN
+        CPUs[cpu].BitDepth := BitDepth;
+        CPUs[cpu].InstrSize := InstrSize;
+        CPUs[cpu].LittleEndian := LittleEndian
+    END EnterCPU;
 
 
 BEGIN

+ 120 - 127
source/TEXTDRV.ob07

@@ -1,11 +1,4 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2018-2021, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE TEXTDRV;
+MODULE TEXTDRV;
 
 IMPORT FILES, C := COLLECTIONS;
 
@@ -51,157 +44,157 @@ VAR
 
 
 PROCEDURE load (text: TEXT);
-BEGIN
-    IF ~text.eof THEN
-        text.size := FILES.read(text.file, text.chunk, LEN(text.chunk));
-        text.pos := 0;
-        IF text.size = 0 THEN
-            text.eof := TRUE;
-            text.chunk[0] := 0X
-        END;
-        text.peak := text.chunk[0]
-    END
-END load;
+    BEGIN
+        IF ~text.eof THEN
+            text.size := FILES.read(text.file, text.chunk, LEN(text.chunk));
+            text.pos := 0;
+            IF text.size = 0 THEN
+                text.eof := TRUE;
+                text.chunk[0] := 0X
+            END;
+            text.peak := text.chunk[0]
+        END
+    END load;
 
 
 PROCEDURE next* (text: TEXT);
-VAR
-    c: CHAR;
+    VAR
+        c: CHAR;
 
-BEGIN
-    IF text.pos < text.size - 1 THEN
-        INC(text.pos);
-        text.peak := text.chunk[text.pos]
-    ELSE
-        load(text)
-    END;
+    BEGIN
+        IF text.pos < text.size - 1 THEN
+            INC(text.pos);
+            text.peak := text.chunk[text.pos]
+        ELSE
+            load(text)
+        END;
 
-    IF ~text.eof THEN
+        IF ~text.eof THEN
 
-        c := text.peak;
+            c := text.peak;
 
-        IF c = CR THEN
-            INC(text.line);
-            text.col := 0;
-            text.eol := TRUE;
-            text.CR  := TRUE
-        ELSIF c = LF THEN
-            IF ~text.CR THEN
+            IF c = CR THEN
                 INC(text.line);
                 text.col := 0;
-                text.eol := TRUE
+                text.eol := TRUE;
+                text.CR  := TRUE
+            ELSIF c = LF THEN
+                IF ~text.CR THEN
+                    INC(text.line);
+                    text.col := 0;
+                    text.eol := TRUE
+                ELSE
+                    text.eol := FALSE
+                END;
+                text.CR := FALSE
+            ELSIF c = HT THEN
+                text.col := text.col + TabSize - text.col MOD TabSize;
+                text.eol := FALSE;
+                text.CR  := FALSE
             ELSE
-                text.eol := FALSE
-            END;
-            text.CR := FALSE
-        ELSIF c = HT THEN
-            text.col := text.col + TabSize - text.col MOD TabSize;
-            text.eol := FALSE;
-            text.CR  := FALSE
-        ELSE
-            IF text.utf8 THEN
-                IF ORD(c) DIV 64 # 2 THEN
+                IF text.utf8 THEN
+                    IF ORD(c) DIV 64 # 2 THEN
+                        INC(text.col)
+                    END
+                ELSE
                     INC(text.col)
-                END
-            ELSE
-                INC(text.col)
-            END;
-            text.eol := FALSE;
-            text.CR  := FALSE
-        END
+                END;
+                text.eol := FALSE;
+                text.CR  := FALSE
+            END
 
-    END
+        END
 
-END next;
+    END next;
 
 
 PROCEDURE init (text: TEXT);
-BEGIN
-    IF (text.pos = 0) & (text.size >= 3) THEN
-        IF (text.chunk[0] = 0EFX) &
-           (text.chunk[1] = 0BBX) &
-           (text.chunk[2] = 0BFX) THEN
-            text.pos := 3;
-            text.utf8 := TRUE
-        END
-    END;
+    BEGIN
+        IF (text.pos = 0) & (text.size >= 3) THEN
+            IF (text.chunk[0] = 0EFX) &
+            (text.chunk[1] = 0BBX) &
+            (text.chunk[2] = 0BFX) THEN
+                text.pos := 3;
+                text.utf8 := TRUE
+            END
+        END;
 
-    IF text.size = 0 THEN
-        text.chunk[0] := 0X;
-        text.size := 1;
-        text.eof := FALSE
-    END;
+        IF text.size = 0 THEN
+            text.chunk[0] := 0X;
+            text.size := 1;
+            text.eof := FALSE
+        END;
 
-    text.line := 1;
-    text.col  := 1;
+        text.line := 1;
+        text.col  := 1;
 
-    text.peak := text.chunk[text.pos]
-END init;
+        text.peak := text.chunk[text.pos]
+    END init;
 
 
 PROCEDURE close* (VAR text: TEXT);
-BEGIN
-    IF text # NIL THEN
-        IF text.file # NIL THEN
-            FILES.close(text.file)
-        END;
+    BEGIN
+        IF text # NIL THEN
+            IF text.file # NIL THEN
+                FILES.close(text.file)
+            END;
 
-        C.push(texts, text);
-        text := NIL
-    END
-END close;
+            C.push(texts, text);
+            text := NIL
+        END
+    END close;
 
 
 PROCEDURE open* (name: ARRAY OF CHAR): TEXT;
-VAR
-    text: TEXT;
-    citem: C.ITEM;
-
-BEGIN
-    citem := C.pop(texts);
-    IF citem = NIL THEN
-        NEW(text)
-    ELSE
-        text := citem(TEXT)
-    END;
-
-    IF text # NIL THEN
-        text.chunk[0] := 0X;
-        text.pos  := 0;
-        text.size := 0;
-        text.utf8 := FALSE;
-        text.CR   := FALSE;
-        text.line := 1;
-        text.col  := 1;
-        text.eof  := FALSE;
-        text.eol  := FALSE;
-        text.skip := FALSE;
-        text.ifc  := 0;
-        text.elsec := 0;
-        text._skip[0] := FALSE;
-        text.peak := 0X;
-        text.file := FILES.open(name);
-        COPY(name, text.fname);
-        IF text.file # NIL THEN
-            load(text);
-            init(text)
+    VAR
+        text: TEXT;
+        citem: C.ITEM;
+
+    BEGIN
+        citem := C.pop(texts);
+        IF citem = NIL THEN
+            NEW(text)
         ELSE
-            close(text)
+            text := citem(TEXT)
+        END;
+
+        IF text # NIL THEN
+            text.chunk[0] := 0X;
+            text.pos  := 0;
+            text.size := 0;
+            text.utf8 := FALSE;
+            text.CR   := FALSE;
+            text.line := 1;
+            text.col  := 1;
+            text.eof  := FALSE;
+            text.eol  := FALSE;
+            text.skip := FALSE;
+            text.ifc  := 0;
+            text.elsec := 0;
+            text._skip[0] := FALSE;
+            text.peak := 0X;
+            text.file := FILES.open(name);
+            COPY(name, text.fname);
+            IF text.file # NIL THEN
+                load(text);
+                init(text)
+            ELSE
+                close(text)
+            END
         END
-    END
 
-    RETURN text
-END open;
+        RETURN text
+    END open;
 
 
 PROCEDURE setTabSize* (n: INTEGER);
-BEGIN
-    IF (0 < n) & (n <= 64) THEN
-        TabSize := n
-    ELSE
-        TabSize := defTabSize
-    END
-END setTabSize;
+    BEGIN
+        IF (0 < n) & (n <= 64) THEN
+            TabSize := n
+        ELSE
+            TabSize := defTabSize
+        END
+    END setTabSize;
 
 
 BEGIN

+ 1829 - 1836
source/THUMB.ob07

@@ -1,11 +1,4 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2019-2022, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE THUMB;
+MODULE THUMB;
 
 IMPORT PROG, LISTS, CHL := CHUNKLISTS, BIN, REG, IL, C := CONSOLE,
        UTILS, WR := WRITER, HEX, ERRORS, TARGETS;
@@ -122,2336 +115,2336 @@ VAR
 
 
 PROCEDURE Code (code: INTEGER);
-VAR
-    c: CODE;
+    VAR
+        c: CODE;
 
-BEGIN
-    NEW(c);
-    c.code := code;
-    LISTS.push(CodeList, c)
-END Code;
+    BEGIN
+        NEW(c);
+        c.code := code;
+        LISTS.push(CodeList, c)
+    END Code;
 
 
 PROCEDURE Label (label: INTEGER);
-VAR
-    L: LABEL;
+    VAR
+        L: LABEL;
 
-BEGIN
-    NEW(L);
-    L.label := label;
-    LISTS.push(CodeList, L)
-END Label;
+    BEGIN
+        NEW(L);
+        L.label := label;
+        LISTS.push(CodeList, L)
+    END Label;
 
 
 PROCEDURE jcc (cond, label: INTEGER);
-VAR
-    j: JCC;
+    VAR
+        j: JCC;
 
-BEGIN
-    NEW(j);
-    j.label := label;
-    j.cond  := cond;
-    j.short := FALSE;
-    j.len   := 3;
-    LISTS.push(CodeList, j)
-END jcc;
+    BEGIN
+        NEW(j);
+        j.label := label;
+        j.cond  := cond;
+        j.short := FALSE;
+        j.len   := 3;
+        LISTS.push(CodeList, j)
+    END jcc;
 
 
 PROCEDURE cbxz (cond, reg, label: INTEGER);
-VAR
-    j: CBXZ;
+    VAR
+        j: CBXZ;
 
-BEGIN
-    NEW(j);
-    j.label := label;
-    j.cond  := cond;
-    j.reg   := reg;
-    j.short := FALSE;
-    j.len   := 4;
-    LISTS.push(CodeList, j)
-END cbxz;
+    BEGIN
+        NEW(j);
+        j.label := label;
+        j.cond  := cond;
+        j.reg   := reg;
+        j.short := FALSE;
+        j.len   := 4;
+        LISTS.push(CodeList, j)
+    END cbxz;
 
 
 PROCEDURE jmp (label: INTEGER);
-VAR
-    j: JMP;
+    VAR
+        j: JMP;
 
-BEGIN
-    NEW(j);
-    j.label := label;
-    j.short := FALSE;
-    j.len   := 2;
-    LISTS.push(CodeList, j)
-END jmp;
+    BEGIN
+        NEW(j);
+        j.label := label;
+        j.short := FALSE;
+        j.len   := 2;
+        LISTS.push(CodeList, j)
+    END jmp;
 
 
 PROCEDURE call (label: INTEGER);
-VAR
-    c: CALL;
+    VAR
+        c: CALL;
 
-BEGIN
-    NEW(c);
-    c.label := label;
-    c.short := FALSE;
-    c.len   := 2;
-    LISTS.push(CodeList, c)
-END call;
+    BEGIN
+        NEW(c);
+        c.label := label;
+        c.short := FALSE;
+        c.len   := 2;
+        LISTS.push(CodeList, c)
+    END call;
 
 
 PROCEDURE reloc (reg, rel, value: INTEGER);
-VAR
-    r: RELOC;
+    VAR
+        r: RELOC;
 
-BEGIN
-    NEW(r);
-    r.reg := reg;
-    r.rel := rel;
-    r.value := value;
-    LISTS.push(CodeList, r)
-END reloc;
+    BEGIN
+        NEW(r);
+        r.reg := reg;
+        r.rel := rel;
+        r.value := value;
+        LISTS.push(CodeList, r)
+    END reloc;
 
 
 PROCEDURE NewLabel (): INTEGER;
-BEGIN
-    BIN.NewLabel(program)
-    RETURN IL.NewLabel()
-END NewLabel;
+    BEGIN
+        BIN.NewLabel(program)
+        RETURN IL.NewLabel()
+    END NewLabel;
 
 
 PROCEDURE range (x, n: INTEGER): BOOLEAN;
-    RETURN (0 <= x) & (x < LSL(1, n))
-END range;
+        RETURN (0 <= x) & (x < LSL(1, n))
+    END range;
 
 
 PROCEDURE srange (x, n: INTEGER): BOOLEAN;
-    RETURN (-LSL(1, n - 1) <= x) & (x < LSL(1, n - 1))
-END srange;
+        RETURN (-LSL(1, n - 1) <= x) & (x < LSL(1, n - 1))
+    END srange;
 
 
 PROCEDURE gen1 (op, imm, rs, rd: INTEGER);
-BEGIN
-    ASSERT(op IN {0..2});
-    ASSERT(range(imm, 5));
-    ASSERT(range(rs, 3));
-    ASSERT(range(rd, 3));
-    Code(LSL(op, 11) + LSL(imm, 6) + LSL(rs, 3) + rd)
-END gen1;
+    BEGIN
+        ASSERT(op IN {0..2});
+        ASSERT(range(imm, 5));
+        ASSERT(range(rs, 3));
+        ASSERT(range(rd, 3));
+        Code(LSL(op, 11) + LSL(imm, 6) + LSL(rs, 3) + rd)
+    END gen1;
 
 
 PROCEDURE gen2 (i, op: BOOLEAN; imm, rs, rd: INTEGER);
-BEGIN
-    ASSERT(range(imm, 3));
-    ASSERT(range(rs, 3));
-    ASSERT(range(rd, 3));
-    Code(1800H + LSL(ORD(i), 10) + LSL(ORD(op), 9) + LSL(imm, 6) + LSL(rs, 3) + rd)
-END gen2;
+    BEGIN
+        ASSERT(range(imm, 3));
+        ASSERT(range(rs, 3));
+        ASSERT(range(rd, 3));
+        Code(1800H + LSL(ORD(i), 10) + LSL(ORD(op), 9) + LSL(imm, 6) + LSL(rs, 3) + rd)
+    END gen2;
 
 
 PROCEDURE gen3 (op, rd, imm: INTEGER);
-BEGIN
-    ASSERT(range(op, 2));
-    ASSERT(range(rd, 3));
-    ASSERT(range(imm, 8));
-    Code(2000H + LSL(op, 11) + LSL(rd, 8) + imm)
-END gen3;
+    BEGIN
+        ASSERT(range(op, 2));
+        ASSERT(range(rd, 3));
+        ASSERT(range(imm, 8));
+        Code(2000H + LSL(op, 11) + LSL(rd, 8) + imm)
+    END gen3;
 
 
 PROCEDURE gen4 (op, rs, rd: INTEGER);
-BEGIN
-    ASSERT(range(op, 4));
-    ASSERT(range(rs, 3));
-    ASSERT(range(rd, 3));
-    Code(4000H + LSL(op, 6) + LSL(rs, 3) + rd)
-END gen4;
+    BEGIN
+        ASSERT(range(op, 4));
+        ASSERT(range(rs, 3));
+        ASSERT(range(rd, 3));
+        Code(4000H + LSL(op, 6) + LSL(rs, 3) + rd)
+    END gen4;
 
 
 PROCEDURE gen5 (op: INTEGER; h1, h2: BOOLEAN; rs, rd: INTEGER);
-BEGIN
-    ASSERT(range(op, 2));
-    ASSERT(range(rs, 3));
-    ASSERT(range(rd, 3));
-    Code(4400H + LSL(op, 8) + LSL(ORD(h1), 7) + LSL(ORD(h2), 6) + LSL(rs, 3) + rd)
-END gen5;
+    BEGIN
+        ASSERT(range(op, 2));
+        ASSERT(range(rs, 3));
+        ASSERT(range(rd, 3));
+        Code(4400H + LSL(op, 8) + LSL(ORD(h1), 7) + LSL(ORD(h2), 6) + LSL(rs, 3) + rd)
+    END gen5;
 
 
 PROCEDURE gen7 (l, b: BOOLEAN; ro, rb, rd: INTEGER);
-BEGIN
-    ASSERT(range(ro, 3));
-    ASSERT(range(rb, 3));
-    ASSERT(range(rd, 3));
-    Code(5000H + LSL(ORD(l), 11) + LSL(ORD(b), 10) + LSL(ro, 6) + LSL(rb, 3) + rd)
-END gen7;
+    BEGIN
+        ASSERT(range(ro, 3));
+        ASSERT(range(rb, 3));
+        ASSERT(range(rd, 3));
+        Code(5000H + LSL(ORD(l), 11) + LSL(ORD(b), 10) + LSL(ro, 6) + LSL(rb, 3) + rd)
+    END gen7;
 
 
 PROCEDURE gen8 (h, s: BOOLEAN; ro, rb, rd: INTEGER);
-BEGIN
-    ASSERT(range(ro, 3));
-    ASSERT(range(rb, 3));
-    ASSERT(range(rd, 3));
-    Code(5200H + LSL(ORD(h), 11) + LSL(ORD(s), 10) + LSL(ro, 6) + LSL(rb, 3) + rd)
-END gen8;
+    BEGIN
+        ASSERT(range(ro, 3));
+        ASSERT(range(rb, 3));
+        ASSERT(range(rd, 3));
+        Code(5200H + LSL(ORD(h), 11) + LSL(ORD(s), 10) + LSL(ro, 6) + LSL(rb, 3) + rd)
+    END gen8;
 
 
 PROCEDURE gen9 (b, l: BOOLEAN; imm, rb, rd: INTEGER);
-BEGIN
-    ASSERT(range(imm, 5));
-    ASSERT(range(rb, 3));
-    ASSERT(range(rd, 3));
-    Code(6000H + LSL(ORD(b), 12) + LSL(ORD(l), 11) + LSL(imm, 6) + LSL(rb, 3) + rd)
-END gen9;
+    BEGIN
+        ASSERT(range(imm, 5));
+        ASSERT(range(rb, 3));
+        ASSERT(range(rd, 3));
+        Code(6000H + LSL(ORD(b), 12) + LSL(ORD(l), 11) + LSL(imm, 6) + LSL(rb, 3) + rd)
+    END gen9;
 
 
 PROCEDURE gen10 (l: BOOLEAN; imm, rb, rd: INTEGER);
-BEGIN
-    ASSERT(range(imm, 5));
-    ASSERT(range(rb, 3));
-    ASSERT(range(rd, 3));
-    Code(8000H + LSL(ORD(l), 11) + LSL(imm, 6) + LSL(rb, 3) + rd)
-END gen10;
+    BEGIN
+        ASSERT(range(imm, 5));
+        ASSERT(range(rb, 3));
+        ASSERT(range(rd, 3));
+        Code(8000H + LSL(ORD(l), 11) + LSL(imm, 6) + LSL(rb, 3) + rd)
+    END gen10;
 
 
 PROCEDURE gen11 (l: BOOLEAN; rd, imm: INTEGER);
-BEGIN
-    ASSERT(range(rd, 3));
-    ASSERT(range(imm, 8));
-    Code(9000H + LSL(ORD(l), 11) + LSL(rd, 8) + imm)
-END gen11;
+    BEGIN
+        ASSERT(range(rd, 3));
+        ASSERT(range(imm, 8));
+        Code(9000H + LSL(ORD(l), 11) + LSL(rd, 8) + imm)
+    END gen11;
 
 
 PROCEDURE gen12 (sp: BOOLEAN; rd, imm: INTEGER);
-BEGIN
-    ASSERT(range(rd, 3));
-    ASSERT(range(imm, 8));
-    Code(0A000H + LSL(ORD(sp), 11) + LSL(rd, 8) + imm)
-END gen12;
+    BEGIN
+        ASSERT(range(rd, 3));
+        ASSERT(range(imm, 8));
+        Code(0A000H + LSL(ORD(sp), 11) + LSL(rd, 8) + imm)
+    END gen12;
 
 
 PROCEDURE gen14 (l, r: BOOLEAN; rlist: SET);
-VAR
-    i, n: INTEGER;
+    VAR
+        i, n: INTEGER;
 
-BEGIN
-    ASSERT(range(ORD(rlist), 8));
+    BEGIN
+        ASSERT(range(ORD(rlist), 8));
 
-    n := ORD(r);
-    FOR i := 0 TO 7 DO
-        IF i IN rlist THEN
-            INC(n)
-        END
-    END;
+        n := ORD(r);
+        FOR i := 0 TO 7 DO
+            IF i IN rlist THEN
+                INC(n)
+            END
+        END;
 
-    IF l THEN
-        n := -n
-    END;
+        IF l THEN
+            n := -n
+        END;
 
-    INC(StkCount, n);
+        INC(StkCount, n);
 
-    Code(0B400H + LSL(ORD(l), 11) + LSL(ORD(r), 8) + ORD(rlist))
-END gen14;
+        Code(0B400H + LSL(ORD(l), 11) + LSL(ORD(r), 8) + ORD(rlist))
+    END gen14;
 
 
 PROCEDURE split16 (imm16: INTEGER; VAR imm4, imm1, imm3, imm8: INTEGER);
-BEGIN
-    ASSERT(range(imm16, 16));
-    imm8 := imm16 MOD 256;
-    imm4 := LSR(imm16, 12);
-    imm3 := LSR(imm16, 8) MOD 8;
-    imm1 := LSR(imm16, 11) MOD 2;
-END split16;
+    BEGIN
+        ASSERT(range(imm16, 16));
+        imm8 := imm16 MOD 256;
+        imm4 := LSR(imm16, 12);
+        imm3 := LSR(imm16, 8) MOD 8;
+        imm1 := LSR(imm16, 11) MOD 2;
+    END split16;
 
 
 PROCEDURE LslImm (r, imm5: INTEGER);
-BEGIN
-    gen1(0, imm5, r, r)
-END LslImm;
+    BEGIN
+        gen1(0, imm5, r, r)
+    END LslImm;
 
 
 PROCEDURE LsrImm (r, imm5: INTEGER);
-BEGIN
-    gen1(1, imm5, r, r)
-END LsrImm;
+    BEGIN
+        gen1(1, imm5, r, r)
+    END LsrImm;
 
 
 PROCEDURE AsrImm (r, imm5: INTEGER);
-BEGIN
-    gen1(2, imm5, r, r)
-END AsrImm;
+    BEGIN
+        gen1(2, imm5, r, r)
+    END AsrImm;
 
 
 PROCEDURE AddReg (rd, rs, rn: INTEGER);
-BEGIN
-    gen2(FALSE, FALSE, rn, rs, rd)
-END AddReg;
+    BEGIN
+        gen2(FALSE, FALSE, rn, rs, rd)
+    END AddReg;
 
 
 PROCEDURE SubReg (rd, rs, rn: INTEGER);
-BEGIN
-    gen2(FALSE, TRUE, rn, rs, rd)
-END SubReg;
+    BEGIN
+        gen2(FALSE, TRUE, rn, rs, rd)
+    END SubReg;
 
 
 PROCEDURE AddImm8 (rd, imm8: INTEGER);
-BEGIN
-    IF imm8 # 0 THEN
-        gen3(2, rd, imm8)
-    END
-END AddImm8;
+    BEGIN
+        IF imm8 # 0 THEN
+            gen3(2, rd, imm8)
+        END
+    END AddImm8;
 
 
 PROCEDURE SubImm8 (rd, imm8: INTEGER);
-BEGIN
-    IF imm8 # 0 THEN
-        gen3(3, rd, imm8)
-    END
-END SubImm8;
+    BEGIN
+        IF imm8 # 0 THEN
+            gen3(3, rd, imm8)
+        END
+    END SubImm8;
 
 
 PROCEDURE AddSubImm12 (r, imm12: INTEGER; sub: BOOLEAN);
-VAR
-    imm4, imm1, imm3, imm8: INTEGER;
+    VAR
+        imm4, imm1, imm3, imm8: INTEGER;
 
-BEGIN
-    split16(imm12, imm4, imm1, imm3, imm8);
-    Code(0F200H + LSL(imm1, 10) + r + 0A0H * ORD(sub));  (* addw/subw r, r, imm12 *)
-    Code(LSL(imm3, 12) + LSL(r, 8) + imm8)
-END AddSubImm12;
+    BEGIN
+        split16(imm12, imm4, imm1, imm3, imm8);
+        Code(0F200H + LSL(imm1, 10) + r + 0A0H * ORD(sub));  (* addw/subw r, r, imm12 *)
+        Code(LSL(imm3, 12) + LSL(r, 8) + imm8)
+    END AddSubImm12;
 
 
 PROCEDURE MovImm8 (rd, imm8: INTEGER);
-BEGIN
-    gen3(0, rd, imm8)
-END MovImm8;
+    BEGIN
+        gen3(0, rd, imm8)
+    END MovImm8;
 
 
 PROCEDURE CmpImm8 (rd, imm8: INTEGER);
-BEGIN
-    gen3(1, rd, imm8)
-END CmpImm8;
+    BEGIN
+        gen3(1, rd, imm8)
+    END CmpImm8;
 
 
 PROCEDURE Neg (r: INTEGER);
-BEGIN
-    gen4(9, r, r)
-END Neg;
+    BEGIN
+        gen4(9, r, r)
+    END Neg;
 
 
 PROCEDURE Mul (rd, rs: INTEGER);
-BEGIN
-    gen4(13, rs, rd)
-END Mul;
+    BEGIN
+        gen4(13, rs, rd)
+    END Mul;
 
 
 PROCEDURE Str32 (rs, rb: INTEGER);
-BEGIN
-    gen9(FALSE, FALSE, 0, rb, rs)
-END Str32;
+    BEGIN
+        gen9(FALSE, FALSE, 0, rb, rs)
+    END Str32;
 
 
 PROCEDURE Ldr32 (rd, rb: INTEGER);
-BEGIN
-    gen9(FALSE, TRUE, 0, rb, rd)
-END Ldr32;
+    BEGIN
+        gen9(FALSE, TRUE, 0, rb, rd)
+    END Ldr32;
 
 
 PROCEDURE Str16 (rs, rb: INTEGER);
-BEGIN
-    gen10(FALSE, 0, rb, rs)
-END Str16;
+    BEGIN
+        gen10(FALSE, 0, rb, rs)
+    END Str16;
 
 
 PROCEDURE Ldr16 (rd, rb: INTEGER);
-BEGIN
-    gen10(TRUE, 0, rb, rd)
-END Ldr16;
+    BEGIN
+        gen10(TRUE, 0, rb, rd)
+    END Ldr16;
 
 
 PROCEDURE Str8 (rs, rb: INTEGER);
-BEGIN
-    gen9(TRUE, FALSE, 0, rb, rs)
-END Str8;
+    BEGIN
+        gen9(TRUE, FALSE, 0, rb, rs)
+    END Str8;
 
 
 PROCEDURE Ldr8 (rd, rb: INTEGER);
-BEGIN
-    gen9(TRUE, TRUE, 0, rb, rd)
-END Ldr8;
+    BEGIN
+        gen9(TRUE, TRUE, 0, rb, rd)
+    END Ldr8;
 
 
 PROCEDURE Cmp (r1, r2: INTEGER);
-BEGIN
-    gen4(10, r2, r1)
-END Cmp;
+    BEGIN
+        gen4(10, r2, r1)
+    END Cmp;
 
 
 PROCEDURE Tst (r: INTEGER);
-BEGIN
-    gen3(1, r, 0) (* cmp r, 0 *)
-END Tst;
+    BEGIN
+        gen3(1, r, 0) (* cmp r, 0 *)
+    END Tst;
 
 
 PROCEDURE LdrSp (r, offset: INTEGER);
-BEGIN
-    gen11(TRUE, r, offset)
-END LdrSp;
+    BEGIN
+        gen11(TRUE, r, offset)
+    END LdrSp;
 
 
 PROCEDURE MovImm32 (r, imm32: INTEGER);
-BEGIN
-    MovImm8(r, LSR(imm32, 24) MOD 256);
-    LslImm(r, 8);
-    AddImm8(r, LSR(imm32, 16) MOD 256);
-    LslImm(r, 8);
-    AddImm8(r, LSR(imm32, 8) MOD 256);
-    LslImm(r, 8);
-    AddImm8(r, imm32 MOD 256)
-END MovImm32;
+    BEGIN
+        MovImm8(r, LSR(imm32, 24) MOD 256);
+        LslImm(r, 8);
+        AddImm8(r, LSR(imm32, 16) MOD 256);
+        LslImm(r, 8);
+        AddImm8(r, LSR(imm32, 8) MOD 256);
+        LslImm(r, 8);
+        AddImm8(r, imm32 MOD 256)
+    END MovImm32;
 
 
 PROCEDURE low (x: INTEGER): INTEGER;
-    RETURN x MOD 65536
-END low;
+        RETURN x MOD 65536
+    END low;
 
 
 PROCEDURE high (x: INTEGER): INTEGER;
-    RETURN (x DIV 65536) MOD 65536
-END high;
+        RETURN (x DIV 65536) MOD 65536
+    END high;
 
 
 PROCEDURE movwt (r, imm16, t: INTEGER);
-VAR
-    imm1, imm3, imm4, imm8: INTEGER;
+    VAR
+        imm1, imm3, imm4, imm8: INTEGER;
 
-BEGIN
-    ASSERT(range(r, 3));
-    ASSERT(range(imm16, 16));
-    ASSERT(range(t, 1));
-    split16(imm16, imm4, imm1, imm3, imm8);
-    Code(0F240H + imm1 * 1024 + t * 128 + imm4);
-    Code(imm3 * 4096 + r * 256 + imm8);
-END movwt;
+    BEGIN
+        ASSERT(range(r, 3));
+        ASSERT(range(imm16, 16));
+        ASSERT(range(t, 1));
+        split16(imm16, imm4, imm1, imm3, imm8);
+        Code(0F240H + imm1 * 1024 + t * 128 + imm4);
+        Code(imm3 * 4096 + r * 256 + imm8);
+    END movwt;
 
 
 PROCEDURE inv0 (cond: INTEGER): INTEGER;
-    RETURN ORD(BITS(cond) / {0})
-END inv0;
+        RETURN ORD(BITS(cond) / {0})
+    END inv0;
 
 
 PROCEDURE fixup (CodeAdr, DataAdr, BssAdr: INTEGER);
-VAR
-    code:    ANYCODE;
-    count:   INTEGER;
-    shorted: BOOLEAN;
-    jump:    JUMP;
+    VAR
+        code:    ANYCODE;
+        count:   INTEGER;
+        shorted: BOOLEAN;
+        jump:    JUMP;
 
-    reloc, i, diff, len: INTEGER;
+        reloc, i, diff, len: INTEGER;
 
-    RelocCode: RELOCCODE;
+        RelocCode: RELOCCODE;
 
 
-    PROCEDURE genjcc (cond, offset: INTEGER): INTEGER;
-    BEGIN
-        ASSERT(range(cond, 4));
-        ASSERT(srange(offset, 8))
-        RETURN 0D000H + cond * 256 + offset MOD 256
-    END genjcc;
+        PROCEDURE genjcc (cond, offset: INTEGER): INTEGER;
+        BEGIN
+            ASSERT(range(cond, 4));
+            ASSERT(srange(offset, 8))
+            RETURN 0D000H + cond * 256 + offset MOD 256
+        END genjcc;
 
 
-    PROCEDURE genjmp (offset: INTEGER): INTEGER;
-    BEGIN
-        ASSERT(srange(offset, 11))
-        RETURN 0E000H + offset MOD 2048
-    END genjmp;
+        PROCEDURE genjmp (offset: INTEGER): INTEGER;
+        BEGIN
+            ASSERT(srange(offset, 11))
+            RETURN 0E000H + offset MOD 2048
+        END genjmp;
 
 
-    PROCEDURE movwt (r, imm16, t: INTEGER; VAR code: RELOCCODE);
-    VAR
-        imm1, imm3, imm4, imm8: INTEGER;
+        PROCEDURE movwt (r, imm16, t: INTEGER; VAR code: RELOCCODE);
+        VAR
+            imm1, imm3, imm4, imm8: INTEGER;
 
-    BEGIN
-        split16(imm16, imm4, imm1, imm3, imm8);
-        code[t * 2]     := 0F240H + imm1 * 1024 + t * 128 + imm4;
-        code[t * 2 + 1] := imm3 * 4096 + r * 256 + imm8
-    END movwt;
+        BEGIN
+            split16(imm16, imm4, imm1, imm3, imm8);
+            code[t * 2]     := 0F240H + imm1 * 1024 + t * 128 + imm4;
+            code[t * 2 + 1] := imm3 * 4096 + r * 256 + imm8
+        END movwt;
 
 
-    PROCEDURE genmovimm32 (r, value: INTEGER; VAR code: RELOCCODE);
-    BEGIN
-        IF _THUMB2 IN Target.InstrSet THEN
-            movwt(r, low(value), 0, code);
-            movwt(r, high(value), 1, code)
-        ELSE
-            code[0] := 2000H + r * 256 + UTILS.Byte(value, 3);  (* movs r, imm8 *)
-            code[1] := 0200H + r * 9;                           (* lsls r, 8    *)
-            code[2] := 3000H + r * 256 + UTILS.Byte(value, 2);  (* adds r, imm8 *)
-            code[3] := code[1];                                 (* lsls r, 8    *)
-            code[4] := 3000H + r * 256 + UTILS.Byte(value, 1);  (* adds r, imm8 *)
-            code[5] := code[1];                                 (* lsls r, 8    *)
-            code[6] := 3000H + r * 256 + UTILS.Byte(value, 0)   (* adds r, imm8 *)
-        END
-    END genmovimm32;
+        PROCEDURE genmovimm32 (r, value: INTEGER; VAR code: RELOCCODE);
+        BEGIN
+            IF _THUMB2 IN Target.InstrSet THEN
+                movwt(r, low(value), 0, code);
+                movwt(r, high(value), 1, code)
+            ELSE
+                code[0] := 2000H + r * 256 + UTILS.Byte(value, 3);  (* movs r, imm8 *)
+                code[1] := 0200H + r * 9;                           (* lsls r, 8    *)
+                code[2] := 3000H + r * 256 + UTILS.Byte(value, 2);  (* adds r, imm8 *)
+                code[3] := code[1];                                 (* lsls r, 8    *)
+                code[4] := 3000H + r * 256 + UTILS.Byte(value, 1);  (* adds r, imm8 *)
+                code[5] := code[1];                                 (* lsls r, 8    *)
+                code[6] := 3000H + r * 256 + UTILS.Byte(value, 0)   (* adds r, imm8 *)
+            END
+        END genmovimm32;
 
 
-    PROCEDURE PutCode (code: INTEGER);
-    BEGIN
-        BIN.PutCode16LE(program, code)
-    END PutCode;
+        PROCEDURE PutCode (code: INTEGER);
+        BEGIN
+            BIN.PutCode16LE(program, code)
+        END PutCode;
 
 
-    PROCEDURE genlongjmp (offset: INTEGER);
-    BEGIN
-        ASSERT(srange(offset, 22));
-        PutCode(0F000H + ASR(offset, 11) MOD 2048);
-        PutCode(0F800H + offset MOD 2048)
-    END genlongjmp;
+        PROCEDURE genlongjmp (offset: INTEGER);
+        BEGIN
+            ASSERT(srange(offset, 22));
+            PutCode(0F000H + ASR(offset, 11) MOD 2048);
+            PutCode(0F800H + offset MOD 2048)
+        END genlongjmp;
 
 
-    PROCEDURE genbc (code: JUMP);
-    BEGIN
-        CASE code.len OF
-        |1: PutCode(genjcc(code.cond, code.diff))
-        |2: PutCode(genjcc(inv0(code.cond), 0));
-            PutCode(genjmp(code.diff))
-        |3: PutCode(genjcc(inv0(code.cond), 1));
-            genlongjmp(code.diff)
-        END
-    END genbc;
+        PROCEDURE genbc (code: JUMP);
+        BEGIN
+            CASE code.len OF
+            |1: PutCode(genjcc(code.cond, code.diff))
+            |2: PutCode(genjcc(inv0(code.cond), 0));
+                PutCode(genjmp(code.diff))
+            |3: PutCode(genjcc(inv0(code.cond), 1));
+                genlongjmp(code.diff)
+            END
+        END genbc;
 
 
-    PROCEDURE SetIV (idx, label, CodeAdr: INTEGER);
-    VAR
-        l, h: LISTS.ITEM;
+        PROCEDURE SetIV (idx, label, CodeAdr: INTEGER);
+        VAR
+            l, h: LISTS.ITEM;
 
-    BEGIN
-        l := CodeList.first;
-        h := l.next;
-        WHILE idx > 0 DO
-            l := h.next;
+        BEGIN
+            l := CodeList.first;
             h := l.next;
-            DEC(idx)
-        END;
-        label := BIN.GetLabel(program, label) * 2 + CodeAdr + 1;
-        l(CODE).code := low(label);
-        h(CODE).code := high(label)
-    END SetIV;
-
-
-BEGIN
+            WHILE idx > 0 DO
+                l := h.next;
+                h := l.next;
+                DEC(idx)
+            END;
+            label := BIN.GetLabel(program, label) * 2 + CodeAdr + 1;
+            l(CODE).code := low(label);
+            h(CODE).code := high(label)
+        END SetIV;
 
-    REPEAT
 
-        shorted := FALSE;
-        count := 0;
+    BEGIN
 
-        code := CodeList.first(ANYCODE);
-        WHILE code # NIL DO
-            code.offset := count;
+        REPEAT
 
-            CASE code OF
-            |CODE:  INC(count)
-            |LABEL: BIN.SetLabel(program, code.label, count)
-            |JUMP:  INC(count, code.len); code.offset := count + ORD(code.short)
-            |RELOC: INC(count, 7 - ORD(_THUMB2 IN Target.InstrSet) * 3 + code.rel MOD 2)
-            END;
+            shorted := FALSE;
+            count := 0;
 
-            code := code.next(ANYCODE)
-        END;
+            code := CodeList.first(ANYCODE);
+            WHILE code # NIL DO
+                code.offset := count;
 
-        code := CodeList.first(ANYCODE);
-        WHILE code # NIL DO
+                CASE code OF
+                |CODE:  INC(count)
+                |LABEL: BIN.SetLabel(program, code.label, count)
+                |JUMP:  INC(count, code.len); code.offset := count + ORD(code.short)
+                |RELOC: INC(count, 7 - ORD(_THUMB2 IN Target.InstrSet) * 3 + code.rel MOD 2)
+                END;
 
-            IF code IS JUMP THEN
-                jump := code(JUMP);
-                jump.diff := BIN.GetLabel(program, jump.label) - jump.offset;
-                len := jump.len;
-                diff := jump.diff;
-                CASE jump OF
-                |JMP:
-                    IF (len = 2) & srange(diff, 11) THEN
-                        len := 1
-                    END
+                code := code.next(ANYCODE)
+            END;
 
-                |JCC:
-                    CASE len OF
-                    |1:
-                    |2: IF srange(diff, 8) THEN DEC(len) END
-                    |3: IF srange(diff, 11) THEN DEC(len) END
-                    END
+            code := CodeList.first(ANYCODE);
+            WHILE code # NIL DO
+
+                IF code IS JUMP THEN
+                    jump := code(JUMP);
+                    jump.diff := BIN.GetLabel(program, jump.label) - jump.offset;
+                    len := jump.len;
+                    diff := jump.diff;
+                    CASE jump OF
+                    |JMP:
+                        IF (len = 2) & srange(diff, 11) THEN
+                            len := 1
+                        END
+
+                    |JCC:
+                        CASE len OF
+                        |1:
+                        |2: IF srange(diff, 8) THEN DEC(len) END
+                        |3: IF srange(diff, 11) THEN DEC(len) END
+                        END
+
+                    |CBXZ:
+                        CASE len OF
+                        |1:
+                        |2: IF range(diff, 6) THEN DEC(len) END
+                        |3: IF srange(diff, 8) THEN DEC(len) END
+                        |4: IF srange(diff, 11) THEN DEC(len) END
+                        END
+
+                    |CALL:
 
-                |CBXZ:
-                    CASE len OF
-                    |1:
-                    |2: IF range(diff, 6) THEN DEC(len) END
-                    |3: IF srange(diff, 8) THEN DEC(len) END
-                    |4: IF srange(diff, 11) THEN DEC(len) END
+                    END;
+                    IF len # jump.len THEN
+                        jump.len := len;
+                        jump.short := TRUE;
+                        shorted := TRUE
                     END
-
-                |CALL:
-
                 END;
-                IF len # jump.len THEN
-                    jump.len := len;
-                    jump.short := TRUE;
-                    shorted := TRUE
-                END
-            END;
 
-            code := code.next(ANYCODE)
-        END
+                code := code.next(ANYCODE)
+            END
 
-    UNTIL ~shorted;
+        UNTIL ~shorted;
 
-    FOR i := 1 TO Target.IVTLen - 1 DO
-        SetIV(i, IVT[i], CodeAdr)
-    END;
+        FOR i := 1 TO Target.IVTLen - 1 DO
+            SetIV(i, IVT[i], CodeAdr)
+        END;
 
-    code := CodeList.first(ANYCODE);
-    WHILE code # NIL DO
+        code := CodeList.first(ANYCODE);
+        WHILE code # NIL DO
 
-        CASE code OF
+            CASE code OF
 
-        |CODE:  BIN.PutCode16LE(program, code.code)
+            |CODE:  BIN.PutCode16LE(program, code.code)
 
-        |LABEL:
+            |LABEL:
 
-        |JMP:
-                IF code.len = 1 THEN
-                    PutCode(genjmp(code.diff))
-                ELSE
-                    genlongjmp(code.diff)
-                END
+            |JMP:
+                    IF code.len = 1 THEN
+                        PutCode(genjmp(code.diff))
+                    ELSE
+                        genlongjmp(code.diff)
+                    END
 
-        |JCC:   genbc(code)
+            |JCC:   genbc(code)
 
-        |CBXZ:
-                IF code.len > 1 THEN
-                    PutCode(2800H + code.reg * 256); (* cmp code.reg, 0 *)
-                    DEC(code.len);
-                    genbc(code)
-                ELSE
-                    (* cb(n)z code.reg, L *)
-                    PutCode(0B100H + 800H * ORD(code.cond = jne) + 200H * (code.diff DIV 32) + (code.diff MOD 32) * 8 + code.reg)
-                END
+            |CBXZ:
+                    IF code.len > 1 THEN
+                        PutCode(2800H + code.reg * 256); (* cmp code.reg, 0 *)
+                        DEC(code.len);
+                        genbc(code)
+                    ELSE
+                        (* cb(n)z code.reg, L *)
+                        PutCode(0B100H + 800H * ORD(code.cond = jne) + 200H * (code.diff DIV 32) + (code.diff MOD 32) * 8 + code.reg)
+                    END
 
-        |CALL:  genlongjmp(code.diff)
+            |CALL:  genlongjmp(code.diff)
 
-        |RELOC:
-                CASE code.rel OF
-                |BIN.RCODE, BIN.PICCODE: reloc := BIN.GetLabel(program, code.value) * 2 + CodeAdr
-                |BIN.RDATA, BIN.PICDATA: reloc := code.value + DataAdr
-                |BIN.RBSS,  BIN.PICBSS:  reloc := code.value + BssAdr
-                END;
-                IF code.rel IN {BIN.PICCODE, BIN.PICDATA, BIN.PICBSS} THEN
-                    DEC(reloc, CodeAdr + 2 * (code.offset - 3 * ORD(_THUMB2 IN Target.InstrSet) + 9))
-                END;
-                genmovimm32(code.reg, reloc, RelocCode);
-                FOR i := 0 TO 6 - 3 * ORD(_THUMB2 IN Target.InstrSet) DO
-                    PutCode(RelocCode[i])
-                END;
-                IF code.rel IN {BIN.PICCODE, BIN.PICDATA, BIN.PICBSS} THEN
-                    PutCode(4478H + code.reg) (* add code.reg, pc *)
-                END
-        END;
+            |RELOC:
+                    CASE code.rel OF
+                    |BIN.RCODE, BIN.PICCODE: reloc := BIN.GetLabel(program, code.value) * 2 + CodeAdr
+                    |BIN.RDATA, BIN.PICDATA: reloc := code.value + DataAdr
+                    |BIN.RBSS,  BIN.PICBSS:  reloc := code.value + BssAdr
+                    END;
+                    IF code.rel IN {BIN.PICCODE, BIN.PICDATA, BIN.PICBSS} THEN
+                        DEC(reloc, CodeAdr + 2 * (code.offset - 3 * ORD(_THUMB2 IN Target.InstrSet) + 9))
+                    END;
+                    genmovimm32(code.reg, reloc, RelocCode);
+                    FOR i := 0 TO 6 - 3 * ORD(_THUMB2 IN Target.InstrSet) DO
+                        PutCode(RelocCode[i])
+                    END;
+                    IF code.rel IN {BIN.PICCODE, BIN.PICDATA, BIN.PICBSS} THEN
+                        PutCode(4478H + code.reg) (* add code.reg, pc *)
+                    END
+            END;
 
-        code := code.next(ANYCODE)
-    END
+            code := code.next(ANYCODE)
+        END
 
-END fixup;
+    END fixup;
 
 
 PROCEDURE push (r: INTEGER);
-BEGIN
-    gen14(FALSE, FALSE, {r})
-END push;
+    BEGIN
+        gen14(FALSE, FALSE, {r})
+    END push;
 
 
 PROCEDURE pop (r: INTEGER);
-BEGIN
-    gen14(TRUE, FALSE, {r})
-END pop;
+    BEGIN
+        gen14(TRUE, FALSE, {r})
+    END pop;
 
 
 PROCEDURE mov (r1, r2: INTEGER);
-BEGIN
-    IF (r1 < 8) & (r2 < 8) THEN
-        gen1(0, 0, r2, r1)
-    ELSE
-        gen5(2, r1 >= 8, r2 >= 8, r2 MOD 8, r1 MOD 8)
-    END
-END mov;
+    BEGIN
+        IF (r1 < 8) & (r2 < 8) THEN
+            gen1(0, 0, r2, r1)
+        ELSE
+            gen5(2, r1 >= 8, r2 >= 8, r2 MOD 8, r1 MOD 8)
+        END
+    END mov;
 
 
 PROCEDURE xchg (r1, r2: INTEGER);
-BEGIN
-    push(r1);
-    mov(r1, r2);
-    pop(r2)
-END xchg;
+    BEGIN
+        push(r1);
+        mov(r1, r2);
+        pop(r2)
+    END xchg;
 
 
 PROCEDURE drop;
-BEGIN
-    REG.Drop(R)
-END drop;
+    BEGIN
+        REG.Drop(R)
+    END drop;
 
 
 PROCEDURE GetAnyReg (): INTEGER;
-    RETURN REG.GetAnyReg(R)
-END GetAnyReg;
+        RETURN REG.GetAnyReg(R)
+    END GetAnyReg;
 
 
 PROCEDURE UnOp (VAR r: INTEGER);
-BEGIN
-    REG.UnOp(R, r)
-END UnOp;
+    BEGIN
+        REG.UnOp(R, r)
+    END UnOp;
 
 
 PROCEDURE BinOp (VAR r1, r2: INTEGER);
-BEGIN
-    REG.BinOp(R, r1, r2)
-END BinOp;
+    BEGIN
+        REG.BinOp(R, r1, r2)
+    END BinOp;
 
 
 PROCEDURE PushAll (NumberOfParameters: INTEGER);
-BEGIN
-    REG.PushAll(R);
-    DEC(R.pushed, NumberOfParameters)
-END PushAll;
+    BEGIN
+        REG.PushAll(R);
+        DEC(R.pushed, NumberOfParameters)
+    END PushAll;
 
 
 PROCEDURE cond (op: INTEGER): INTEGER;
-VAR
-    res: INTEGER;
+    VAR
+        res: INTEGER;
 
-BEGIN
-    CASE op OF
-    |IL.opGT, IL.opGTC: res := jg
-    |IL.opGE, IL.opGEC: res := jge
-    |IL.opLT, IL.opLTC: res := jl
-    |IL.opLE, IL.opLEC: res := jle
-    |IL.opEQ, IL.opEQC: res := je
-    |IL.opNE, IL.opNEC: res := jne
-    END
+    BEGIN
+        CASE op OF
+        |IL.opGT, IL.opGTC: res := jg
+        |IL.opGE, IL.opGEC: res := jge
+        |IL.opLT, IL.opLTC: res := jl
+        |IL.opLE, IL.opLEC: res := jle
+        |IL.opEQ, IL.opEQC: res := je
+        |IL.opNE, IL.opNEC: res := jne
+        END
 
-    RETURN res
-END cond;
+        RETURN res
+    END cond;
 
 
 PROCEDURE GetRegA;
-BEGIN
-    ASSERT(REG.GetReg(R, ACC))
-END GetRegA;
+    BEGIN
+        ASSERT(REG.GetReg(R, ACC))
+    END GetRegA;
 
 
 PROCEDURE MovConst (r, c: INTEGER);
-BEGIN
-    IF (0 <= c) & (c <= 255) THEN
-        MovImm8(r, c)
-    ELSIF (-255 <= c) & (c < 0) THEN
-        MovImm8(r, -c);
-        Neg(r)
-    ELSIF UTILS.Log2(c) >= 0 THEN
-        MovImm8(r, 1);
-        LslImm(r, UTILS.Log2(c))
-    ELSIF c = UTILS.min32 THEN
-        MovImm8(r, 1);
-        LslImm(r, 31)
-    ELSE
-        IF _THUMB2 IN Target.InstrSet THEN
-            movwt(r, low(c), 0);
-            IF (c < 0) OR (c > 65535) THEN
-                movwt(r, high(c), 1)
-            END
+    BEGIN
+        IF (0 <= c) & (c <= 255) THEN
+            MovImm8(r, c)
+        ELSIF (-255 <= c) & (c < 0) THEN
+            MovImm8(r, -c);
+            Neg(r)
+        ELSIF UTILS.Log2(c) >= 0 THEN
+            MovImm8(r, 1);
+            LslImm(r, UTILS.Log2(c))
+        ELSIF c = UTILS.min32 THEN
+            MovImm8(r, 1);
+            LslImm(r, 31)
         ELSE
-            MovImm32(r, c)
+            IF _THUMB2 IN Target.InstrSet THEN
+                movwt(r, low(c), 0);
+                IF (c < 0) OR (c > 65535) THEN
+                    movwt(r, high(c), 1)
+                END
+            ELSE
+                MovImm32(r, c)
+            END
         END
-    END
-END MovConst;
+    END MovConst;
 
 
 PROCEDURE CmpConst (r, c: INTEGER);
-VAR
-    r2: INTEGER;
+    VAR
+        r2: INTEGER;
 
-BEGIN
-    IF (0 <= c) & (c <= 255) THEN
-        CmpImm8(r, c)
-    ELSE
-        r2 := GetAnyReg();
-        ASSERT(r2 # r);
-        MovConst(r2, c);
-        Cmp(r, r2);
-        drop
-    END
-END CmpConst;
+    BEGIN
+        IF (0 <= c) & (c <= 255) THEN
+            CmpImm8(r, c)
+        ELSE
+            r2 := GetAnyReg();
+            ASSERT(r2 # r);
+            MovConst(r2, c);
+            Cmp(r, r2);
+            drop
+        END
+    END CmpConst;
 
 
 PROCEDURE LocalOffset (offset: INTEGER): INTEGER;
-    RETURN offset + StkCount - ORD(offset > 0)
-END LocalOffset;
+        RETURN offset + StkCount - ORD(offset > 0)
+    END LocalOffset;
 
 
 PROCEDURE SetCC (cc, r: INTEGER);
-VAR
-    L1, L2: INTEGER;
+    VAR
+        L1, L2: INTEGER;
 
-BEGIN
-    IF _IT IN Target.InstrSet THEN
-        Code(0BF00H + cc * 16 + ((cc + 1) MOD 2) * 8 + 4); (* ite cc *)
-        MovConst(r, 1);
-        MovConst(r, 0)
-    ELSE
-        L1 := NewLabel();
-        L2 := NewLabel();
-        jcc(cc, L1);
-        MovConst(r, 0);
-        jmp(L2);
-        Label(L1);
-        MovConst(r, 1);
-        Label(L2)
-    END
-END SetCC;
+    BEGIN
+        IF _IT IN Target.InstrSet THEN
+            Code(0BF00H + cc * 16 + ((cc + 1) MOD 2) * 8 + 4); (* ite cc *)
+            MovConst(r, 1);
+            MovConst(r, 0)
+        ELSE
+            L1 := NewLabel();
+            L2 := NewLabel();
+            jcc(cc, L1);
+            MovConst(r, 0);
+            jmp(L2);
+            Label(L1);
+            MovConst(r, 1);
+            Label(L2)
+        END
+    END SetCC;
 
 
 PROCEDURE PushConst (n: INTEGER);
-VAR
-    r: INTEGER;
+    VAR
+        r: INTEGER;
 
-BEGIN
-    r := GetAnyReg();
-    MovConst(r, n);
-    push(r);
-    drop
-END PushConst;
+    BEGIN
+        r := GetAnyReg();
+        MovConst(r, n);
+        push(r);
+        drop
+    END PushConst;
 
 
 PROCEDURE AddConst (r, n: INTEGER);
-VAR
-    r2: INTEGER;
+    VAR
+        r2: INTEGER;
 
-BEGIN
-    IF n # 0 THEN
-        IF (-255 <= n) & (n <= 255) THEN
-            IF n > 0 THEN
-                AddImm8(r, n)
+    BEGIN
+        IF n # 0 THEN
+            IF (-255 <= n) & (n <= 255) THEN
+                IF n > 0 THEN
+                    AddImm8(r, n)
+                ELSE
+                    SubImm8(r, -n)
+                END
+            ELSIF (_THUMB2 IN Target.InstrSet) & (-4095 <= n) & (n <= 4095) THEN
+                AddSubImm12(r, ABS(n), n < 0)
             ELSE
-                SubImm8(r, -n)
-            END
-        ELSIF (_THUMB2 IN Target.InstrSet) & (-4095 <= n) & (n <= 4095) THEN
-            AddSubImm12(r, ABS(n), n < 0)
-        ELSE
-            r2 := GetAnyReg();
-            ASSERT(r2 # r);
-            IF n > 0 THEN
-                MovConst(r2, n);
-                AddReg(r, r, r2)
-            ELSE
-                MovConst(r2, -n);
-                SubReg(r, r, r2)
-            END;
-            drop
+                r2 := GetAnyReg();
+                ASSERT(r2 # r);
+                IF n > 0 THEN
+                    MovConst(r2, n);
+                    AddReg(r, r, r2)
+                ELSE
+                    MovConst(r2, -n);
+                    SubReg(r, r, r2)
+                END;
+                drop
+            END
         END
-    END
-END AddConst;
+    END AddConst;
 
 
 PROCEDURE AddHH (r1, r2: INTEGER);
-BEGIN
-    ASSERT((r1 >= 8) OR (r2 >= 8));
-    gen5(0, r1 >= 8, r2 >= 8, r2 MOD 8, r1 MOD 8)
-END AddHH;
+    BEGIN
+        ASSERT((r1 >= 8) OR (r2 >= 8));
+        gen5(0, r1 >= 8, r2 >= 8, r2 MOD 8, r1 MOD 8)
+    END AddHH;
 
 
 PROCEDURE AddSP (n: INTEGER);
-BEGIN
-    IF n > 0 THEN
-        IF n < 127 THEN
-            Code(0B000H + n) (* add sp, n*4 *)
-        ELSE
-            ASSERT(R2 IN R.regs);
-            MovConst(R2, n * 4);
-            AddHH(SP, R2)
-        END;
-        DEC(StkCount, n)
-    END
-END AddSP;
+    BEGIN
+        IF n > 0 THEN
+            IF n < 127 THEN
+                Code(0B000H + n) (* add sp, n*4 *)
+            ELSE
+                ASSERT(R2 IN R.regs);
+                MovConst(R2, n * 4);
+                AddHH(SP, R2)
+            END;
+            DEC(StkCount, n)
+        END
+    END AddSP;
 
 
 PROCEDURE cbxz2 (c, r, label: INTEGER);
-BEGIN
-    IF _CBXZ IN Target.InstrSet THEN
-        cbxz(c, r, label)
-    ELSE
-        Tst(r);
-        jcc(c, label)
-    END
-END cbxz2;
+    BEGIN
+        IF _CBXZ IN Target.InstrSet THEN
+            cbxz(c, r, label)
+        ELSE
+            Tst(r);
+            jcc(c, label)
+        END
+    END cbxz2;
 
 
 PROCEDURE cbz (r, label: INTEGER);
-BEGIN
-    cbxz2(je, r, label)
-END cbz;
+    BEGIN
+        cbxz2(je, r, label)
+    END cbz;
 
 
 PROCEDURE cbnz (r, label: INTEGER);
-BEGIN
-    cbxz2(jne, r, label)
-END cbnz;
+    BEGIN
+        cbxz2(jne, r, label)
+    END cbnz;
 
 
 PROCEDURE Shift (op, r1, r2: INTEGER);
-VAR
-    L: INTEGER;
+    VAR
+        L: INTEGER;
 
-BEGIN
-    LslImm(r2, 27);
-    LsrImm(r2, 27);
-    L := NewLabel();
-    cbz(r2, L);
-    CASE op OF
-    |IL.opLSL, IL.opLSL1: gen4(2, r2, r1)
-    |IL.opLSR, IL.opLSR1: gen4(3, r2, r1)
-    |IL.opASR, IL.opASR1: gen4(4, r2, r1)
-    |IL.opROR, IL.opROR1: gen4(7, r2, r1)
-    END;
-    Label(L)
-END Shift;
+    BEGIN
+        LslImm(r2, 27);
+        LsrImm(r2, 27);
+        L := NewLabel();
+        cbz(r2, L);
+        CASE op OF
+        |IL.opLSL, IL.opLSL1: gen4(2, r2, r1)
+        |IL.opLSR, IL.opLSR1: gen4(3, r2, r1)
+        |IL.opASR, IL.opASR1: gen4(4, r2, r1)
+        |IL.opROR, IL.opROR1: gen4(7, r2, r1)
+        END;
+        Label(L)
+    END Shift;
 
 
 PROCEDURE LocAdr (offs: INTEGER);
-VAR
-    r1, n: INTEGER;
+    VAR
+        r1, n: INTEGER;
 
-BEGIN
-    r1 := GetAnyReg();
-    n := LocalOffset(offs);
-    IF n <= 255 THEN
-        gen12(TRUE, r1, n)
-    ELSE
-        MovConst(r1, n * 4);
-        AddHH(r1, SP)
-    END
-END LocAdr;
+    BEGIN
+        r1 := GetAnyReg();
+        n := LocalOffset(offs);
+        IF n <= 255 THEN
+            gen12(TRUE, r1, n)
+        ELSE
+            MovConst(r1, n * 4);
+            AddHH(r1, SP)
+        END
+    END LocAdr;
 
 
 PROCEDURE CallRTL (proc, par: INTEGER);
-BEGIN
-    call(IL.codes.rtl[proc]);
-    AddSP(par)
-END CallRTL;
+    BEGIN
+        call(IL.codes.rtl[proc]);
+        AddSP(par)
+    END CallRTL;
 
 
 PROCEDURE divmod;
-BEGIN
-    call(sdivProc);
-    AddSP(2)
-END divmod;
+    BEGIN
+        call(sdivProc);
+        AddSP(2)
+    END divmod;
 
 
 PROCEDURE cpsid_i;
-BEGIN
-    Code(0B672H)  (*  cpsid i  *)
-END cpsid_i;
+    BEGIN
+        Code(0B672H)  (*  cpsid i  *)
+    END cpsid_i;
 
 
 PROCEDURE cpsie_i;
-BEGIN
-    Code(0B662H)  (*  cpsie i  *)
-END cpsie_i;
+    BEGIN
+        Code(0B662H)  (*  cpsie i  *)
+    END cpsie_i;
 
 
 PROCEDURE translate (pic, stroffs: INTEGER);
-VAR
-    cmd, next: COMMAND;
-    opcode, param1, param2: INTEGER;
+    VAR
+        cmd, next: COMMAND;
+        opcode, param1, param2: INTEGER;
 
-    r1, r2, r3: INTEGER;
+        r1, r2, r3: INTEGER;
 
-    a, n, cc, L, L2: INTEGER;
+        a, n, cc, L, L2: INTEGER;
 
-BEGIN
-    cmd := IL.codes.commands.first(COMMAND);
+    BEGIN
+        cmd := IL.codes.commands.first(COMMAND);
 
-    WHILE cmd # NIL DO
+        WHILE cmd # NIL DO
 
-        param1 := cmd.param1;
-        param2 := cmd.param2;
-        opcode := cmd.opcode;
+            param1 := cmd.param1;
+            param2 := cmd.param2;
+            opcode := cmd.opcode;
 
-        CASE opcode OF
+            CASE opcode OF
 
-        |IL.opJMP:
-            jmp(param1)
+            |IL.opJMP:
+                jmp(param1)
 
-        |IL.opLABEL:
-            Label(param1)
+            |IL.opLABEL:
+                Label(param1)
 
-        |IL.opHANDLER:
-            IF param2 = 0 THEN
-                int0 := param1
-            ELSIF param2 = 1 THEN
-                trap := param1
-            ELSE
-                IVT[param2] := param1
-            END
+            |IL.opHANDLER:
+                IF param2 = 0 THEN
+                    int0 := param1
+                ELSIF param2 = 1 THEN
+                    trap := param1
+                ELSE
+                    IVT[param2] := param1
+                END
 
-        |IL.opCALL:
-            call(param1)
+            |IL.opCALL:
+                call(param1)
 
-        |IL.opCALLP:
-            UnOp(r1);
-            AddImm8(r1, 1); (* Thumb mode *)
-            gen5(3, TRUE, FALSE, r1, 0); (* blx r1 *)
-            drop;
-            ASSERT(R.top = -1)
+            |IL.opCALLP:
+                UnOp(r1);
+                AddImm8(r1, 1); (* Thumb mode *)
+                gen5(3, TRUE, FALSE, r1, 0); (* blx r1 *)
+                drop;
+                ASSERT(R.top = -1)
 
-        |IL.opENTER:
-            ASSERT(R.top = -1);
+            |IL.opENTER:
+                ASSERT(R.top = -1);
 
-            Label(param1);
+                Label(param1);
 
-            gen14(FALSE, TRUE, {}); (* push {lr} *)
+                gen14(FALSE, TRUE, {}); (* push {lr} *)
 
-            n := param2;
-            IF n >= 5 THEN
-                MovConst(ACC, 0);
-                MovConst(R2, n);
-                L := NewLabel();
-                Label(L);
-                push(ACC);
-                SubImm8(R2, 1);
-                Tst(R2);
-                jcc(jne, L)
-            ELSIF n > 0 THEN
-                MovConst(ACC, 0);
-                WHILE n > 0 DO
+                n := param2;
+                IF n >= 5 THEN
+                    MovConst(ACC, 0);
+                    MovConst(R2, n);
+                    L := NewLabel();
+                    Label(L);
                     push(ACC);
-                    DEC(n)
-                END
-            END;
-            StkCount := param2
+                    SubImm8(R2, 1);
+                    Tst(R2);
+                    jcc(jne, L)
+                ELSIF n > 0 THEN
+                    MovConst(ACC, 0);
+                    WHILE n > 0 DO
+                        push(ACC);
+                        DEC(n)
+                    END
+                END;
+                StkCount := param2
 
-        |IL.opLEAVE, IL.opLEAVER, IL.opLEAVEF:
-            IF opcode # IL.opLEAVE THEN
-                UnOp(r1);
-                IF r1 # ACC THEN
-                    mov(ACC, r1)
+            |IL.opLEAVE, IL.opLEAVER, IL.opLEAVEF:
+                IF opcode # IL.opLEAVE THEN
+                    UnOp(r1);
+                    IF r1 # ACC THEN
+                        mov(ACC, r1)
+                    END;
+                    drop
                 END;
-                drop
-            END;
 
-            ASSERT(R.top = -1);
-            ASSERT(StkCount = param1);
+                ASSERT(R.top = -1);
+                ASSERT(StkCount = param1);
 
-            AddSP(param1);
-            gen14(TRUE, TRUE, {}) (* pop {pc} *)
+                AddSP(param1);
+                gen14(TRUE, TRUE, {}) (* pop {pc} *)
 
-        |IL.opLEAVEC:
-            gen5(3, FALSE, TRUE, 6, 0) (* bx lr *)
+            |IL.opLEAVEC:
+                gen5(3, FALSE, TRUE, 6, 0) (* bx lr *)
 
-        |IL.opPRECALL:
-            PushAll(0)
+            |IL.opPRECALL:
+                PushAll(0)
 
-        |IL.opPARAM:
-            IF param2 = 1 THEN
-                UnOp(r1);
-                push(r1);
-                drop
-            ELSE
-                ASSERT(R.top + 1 <= param2);
-                PushAll(param2)
-            END
+            |IL.opPARAM:
+                IF param2 = 1 THEN
+                    UnOp(r1);
+                    push(r1);
+                    drop
+                ELSE
+                    ASSERT(R.top + 1 <= param2);
+                    PushAll(param2)
+                END
 
-        |IL.opCLEANUP:
-            AddSP(param2)
+            |IL.opCLEANUP:
+                AddSP(param2)
 
-        |IL.opRES, IL.opRESF:
-            ASSERT(R.top = -1);
-            GetRegA
+            |IL.opRES, IL.opRESF:
+                ASSERT(R.top = -1);
+                GetRegA
 
-        |IL.opPUSHC:
-            PushConst(param2)
+            |IL.opPUSHC:
+                PushConst(param2)
 
-        |IL.opONERR:
-            cpsid_i;
-            MovConst(R0, param2);
-            push(R0);
-            DEC(StkCount);
-            jmp(param1)
+            |IL.opONERR:
+                cpsid_i;
+                MovConst(R0, param2);
+                push(R0);
+                DEC(StkCount);
+                jmp(param1)
 
-        |IL.opERR:
-            call(genTrap)
+            |IL.opERR:
+                call(genTrap)
 
-        |IL.opNOP, IL.opAND, IL.opOR:
+            |IL.opNOP, IL.opAND, IL.opOR:
 
-        |IL.opSADR:
-            reloc(GetAnyReg(), BIN.RDATA + pic, stroffs + param2)
+            |IL.opSADR:
+                reloc(GetAnyReg(), BIN.RDATA + pic, stroffs + param2)
 
-        |IL.opGADR:
-            reloc(GetAnyReg(), BIN.RBSS + pic, param2)
+            |IL.opGADR:
+                reloc(GetAnyReg(), BIN.RBSS + pic, param2)
 
-        |IL.opLADR:
-            LocAdr(param2)
+            |IL.opLADR:
+                LocAdr(param2)
 
-        |IL.opGLOAD32:
-            r1 := GetAnyReg();
-            reloc(r1, BIN.RBSS + pic, param2);
-            Ldr32(r1, r1)
+            |IL.opGLOAD32:
+                r1 := GetAnyReg();
+                reloc(r1, BIN.RBSS + pic, param2);
+                Ldr32(r1, r1)
 
-        |IL.opGLOAD16:
-            r1 := GetAnyReg();
-            reloc(r1, BIN.RBSS + pic, param2);
-            Ldr16(r1, r1)
+            |IL.opGLOAD16:
+                r1 := GetAnyReg();
+                reloc(r1, BIN.RBSS + pic, param2);
+                Ldr16(r1, r1)
 
-        |IL.opGLOAD8:
-            r1 := GetAnyReg();
-            reloc(r1, BIN.RBSS + pic, param2);
-            Ldr8(r1, r1)
+            |IL.opGLOAD8:
+                r1 := GetAnyReg();
+                reloc(r1, BIN.RBSS + pic, param2);
+                Ldr8(r1, r1)
 
-        |IL.opLADR_SAVE:
-            UnOp(r1);
-            n := LocalOffset(param2);
-            IF n <= 255 THEN
-                gen11(FALSE, r1, n)  (* str r1, [sp, n*4] *)
-            ELSE
-                LocAdr(param2);
-                BinOp(r1, r2);
-                Str32(r1, r2);
+            |IL.opLADR_SAVE:
+                UnOp(r1);
+                n := LocalOffset(param2);
+                IF n <= 255 THEN
+                    gen11(FALSE, r1, n)  (* str r1, [sp, n*4] *)
+                ELSE
+                    LocAdr(param2);
+                    BinOp(r1, r2);
+                    Str32(r1, r2);
+                    drop
+                END;
                 drop
-            END;
-            drop
 
-        |IL.opLADR_INCC:
-            n := LocalOffset(param1);
-            IF n <= 255 THEN
-                r1 := GetAnyReg();
-                LdrSp(r1, n);
-                AddConst(r1, param2);
-                gen11(FALSE, r1, n)  (* str r1, [sp, n*4] *)
-            ELSE
-                LocAdr(param1);
-                r1 := GetAnyReg();
-                BinOp(r2, r1);
-                Ldr32(r1, r2);
-                AddConst(r1, param2);
-                BinOp(r2, r1);
-                Str32(r1, r2);
+            |IL.opLADR_INCC:
+                n := LocalOffset(param1);
+                IF n <= 255 THEN
+                    r1 := GetAnyReg();
+                    LdrSp(r1, n);
+                    AddConst(r1, param2);
+                    gen11(FALSE, r1, n)  (* str r1, [sp, n*4] *)
+                ELSE
+                    LocAdr(param1);
+                    r1 := GetAnyReg();
+                    BinOp(r2, r1);
+                    Ldr32(r1, r2);
+                    AddConst(r1, param2);
+                    BinOp(r2, r1);
+                    Str32(r1, r2);
+                    drop
+                END;
                 drop
-            END;
-            drop
 
-        |IL.opLLOAD32, IL.opVADR, IL.opVLOAD32:
-            r1 := GetAnyReg();
-            n := LocalOffset(param2);
-            IF n <= 255 THEN
-                LdrSp(r1, n)
-            ELSE
-                drop;
+            |IL.opLLOAD32, IL.opVADR, IL.opVLOAD32:
+                r1 := GetAnyReg();
+                n := LocalOffset(param2);
+                IF n <= 255 THEN
+                    LdrSp(r1, n)
+                ELSE
+                    drop;
+                    LocAdr(param2);
+                    UnOp(r1);
+                    Ldr32(r1, r1)
+                END;
+                IF opcode = IL.opVLOAD32 THEN
+                    Ldr32(r1, r1)
+                END
+
+            |IL.opLLOAD16:
                 LocAdr(param2);
+                UnOp(r1);
+                Ldr16(r1, r1)
+
+            |IL.opLLOAD8:
+                LocAdr(param2);
+                UnOp(r1);
+                Ldr8(r1, r1)
+
+            |IL.opLOAD32, IL.opLOADF:
                 UnOp(r1);
                 Ldr32(r1, r1)
-            END;
-            IF opcode = IL.opVLOAD32 THEN
-                Ldr32(r1, r1)
-            END
 
-        |IL.opLLOAD16:
-            LocAdr(param2);
-            UnOp(r1);
-            Ldr16(r1, r1)
-
-        |IL.opLLOAD8:
-            LocAdr(param2);
-            UnOp(r1);
-            Ldr8(r1, r1)
-
-        |IL.opLOAD32, IL.opLOADF:
-            UnOp(r1);
-            Ldr32(r1, r1)
-
-        |IL.opLOAD16:
-            UnOp(r1);
-            Ldr16(r1, r1)
-
-        |IL.opLOAD8:
-            UnOp(r1);
-            Ldr8(r1, r1)
-
-        |IL.opVLOAD16:
-            LocAdr(param2);
-            UnOp(r1);
-            Ldr32(r1, r1);
-            Ldr16(r1, r1)
-
-        |IL.opVLOAD8:
-            LocAdr(param2);
-            UnOp(r1);
-            Ldr32(r1, r1);
-            Ldr8(r1, r1)
-
-        |IL.opSBOOL:
-            BinOp(r2, r1);
-            Tst(r2);
-            SetCC(jne, r2);
-            Str8(r2, r1);
-            drop;
-            drop
+            |IL.opLOAD16:
+                UnOp(r1);
+                Ldr16(r1, r1)
 
-        |IL.opSBOOLC:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            MovConst(r2, ORD(param2 # 0));
-            Str8(r2, r1);
-            drop;
-            drop
+            |IL.opLOAD8:
+                UnOp(r1);
+                Ldr8(r1, r1)
 
-        |IL.opSAVEC:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            MovConst(r2, param2);
-            Str32(r2, r1);
-            drop;
-            drop
+            |IL.opVLOAD16:
+                LocAdr(param2);
+                UnOp(r1);
+                Ldr32(r1, r1);
+                Ldr16(r1, r1)
 
-        |IL.opSAVE16C:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            MovConst(r2, low(param2));
-            Str16(r2, r1);
-            drop;
-            drop
+            |IL.opVLOAD8:
+                LocAdr(param2);
+                UnOp(r1);
+                Ldr32(r1, r1);
+                Ldr8(r1, r1)
 
-        |IL.opSAVE8C:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            MovConst(r2, param2 MOD 256);
-            Str8(r2, r1);
-            drop;
-            drop
+            |IL.opSBOOL:
+                BinOp(r2, r1);
+                Tst(r2);
+                SetCC(jne, r2);
+                Str8(r2, r1);
+                drop;
+                drop
 
-        |IL.opSAVE, IL.opSAVE32, IL.opSAVEF:
-            BinOp(r2, r1);
-            Str32(r2, r1);
-            drop;
-            drop
+            |IL.opSBOOLC:
+                UnOp(r1);
+                r2 := GetAnyReg();
+                MovConst(r2, ORD(param2 # 0));
+                Str8(r2, r1);
+                drop;
+                drop
 
-        |IL.opSAVEFI:
-            BinOp(r2, r1);
-            Str32(r1, r2);
-            drop;
-            drop
+            |IL.opSAVEC:
+                UnOp(r1);
+                r2 := GetAnyReg();
+                MovConst(r2, param2);
+                Str32(r2, r1);
+                drop;
+                drop
 
-        |IL.opSAVE16:
-            BinOp(r2, r1);
-            Str16(r2, r1);
-            drop;
-            drop
+            |IL.opSAVE16C:
+                UnOp(r1);
+                r2 := GetAnyReg();
+                MovConst(r2, low(param2));
+                Str16(r2, r1);
+                drop;
+                drop
 
-        |IL.opSAVE8:
-            BinOp(r2, r1);
-            Str8(r2, r1);
-            drop;
-            drop
+            |IL.opSAVE8C:
+                UnOp(r1);
+                r2 := GetAnyReg();
+                MovConst(r2, param2 MOD 256);
+                Str8(r2, r1);
+                drop;
+                drop
 
-        |IL.opSAVEP:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            reloc(r2, BIN.RCODE + pic, param2);
-            Str32(r2, r1);
-            drop;
-            drop
+            |IL.opSAVE, IL.opSAVE32, IL.opSAVEF:
+                BinOp(r2, r1);
+                Str32(r2, r1);
+                drop;
+                drop
+
+            |IL.opSAVEFI:
+                BinOp(r2, r1);
+                Str32(r1, r2);
+                drop;
+                drop
 
-        |IL.opPUSHP:
-            reloc(GetAnyReg(), BIN.RCODE + pic, param2)
+            |IL.opSAVE16:
+                BinOp(r2, r1);
+                Str16(r2, r1);
+                drop;
+                drop
 
-        |IL.opEQB, IL.opNEB:
-            BinOp(r1, r2);
-            drop;
+            |IL.opSAVE8:
+                BinOp(r2, r1);
+                Str8(r2, r1);
+                drop;
+                drop
 
-            L := NewLabel();
-            cbz(r1, L);
-            MovConst(r1, 1);
-            Label(L);
+            |IL.opSAVEP:
+                UnOp(r1);
+                r2 := GetAnyReg();
+                reloc(r2, BIN.RCODE + pic, param2);
+                Str32(r2, r1);
+                drop;
+                drop
 
-            L := NewLabel();
-            cbz(r2, L);
-            MovConst(r2, 1);
-            Label(L);
+            |IL.opPUSHP:
+                reloc(GetAnyReg(), BIN.RCODE + pic, param2)
 
-            Cmp(r1, r2);
-            IF opcode = IL.opEQB THEN
-                SetCC(je, r1)
-            ELSE
-                SetCC(jne, r1)
-            END
+            |IL.opEQB, IL.opNEB:
+                BinOp(r1, r2);
+                drop;
 
-        |IL.opDROP:
-            UnOp(r1);
-            drop
+                L := NewLabel();
+                cbz(r1, L);
+                MovConst(r1, 1);
+                Label(L);
 
-        |IL.opJNZ1:
-            UnOp(r1);
-            cbnz(r1, param1)
+                L := NewLabel();
+                cbz(r2, L);
+                MovConst(r2, 1);
+                Label(L);
 
-        |IL.opJG:
-            UnOp(r1);
-            Tst(r1);
-            jcc(jg, param1)
+                Cmp(r1, r2);
+                IF opcode = IL.opEQB THEN
+                    SetCC(je, r1)
+                ELSE
+                    SetCC(jne, r1)
+                END
 
-        |IL.opJNZ:
-            UnOp(r1);
-            cbnz(r1, param1);
-            drop
+            |IL.opDROP:
+                UnOp(r1);
+                drop
 
-        |IL.opJZ:
-            UnOp(r1);
-            cbz(r1, param1);
-            drop
+            |IL.opJNZ1:
+                UnOp(r1);
+                cbnz(r1, param1)
 
-        |IL.opSWITCH:
-            UnOp(r1);
-            IF param2 = 0 THEN
-                r2 := ACC
-            ELSE
-                r2 := R2
-            END;
-            IF r1 # r2 THEN
-                ASSERT(REG.GetReg(R, r2));
-                ASSERT(REG.Exchange(R, r1, r2));
+            |IL.opJG:
+                UnOp(r1);
+                Tst(r1);
+                jcc(jg, param1)
+
+            |IL.opJNZ:
+                UnOp(r1);
+                cbnz(r1, param1);
                 drop
-            END;
-            drop
 
-        |IL.opENDSW:
+            |IL.opJZ:
+                UnOp(r1);
+                cbz(r1, param1);
+                drop
 
-        |IL.opCASEL:
-            GetRegA;
-            CmpConst(ACC, param1);
-            jcc(jl, param2);
-            drop
+            |IL.opSWITCH:
+                UnOp(r1);
+                IF param2 = 0 THEN
+                    r2 := ACC
+                ELSE
+                    r2 := R2
+                END;
+                IF r1 # r2 THEN
+                    ASSERT(REG.GetReg(R, r2));
+                    ASSERT(REG.Exchange(R, r1, r2));
+                    drop
+                END;
+                drop
 
-        |IL.opCASER:
-            GetRegA;
-            CmpConst(ACC, param1);
-            jcc(jg, param2);
-            drop
+            |IL.opENDSW:
 
-        |IL.opCASELR:
-            GetRegA;
-            CmpConst(ACC, param1);
-            IF param2 = cmd.param3 THEN
-                jcc(jne, param2)
-            ELSE
+            |IL.opCASEL:
+                GetRegA;
+                CmpConst(ACC, param1);
                 jcc(jl, param2);
-                jcc(jg, cmd.param3)
-            END;
-            drop
+                drop
 
-        |IL.opCODE:
-            Code(param2)
+            |IL.opCASER:
+                GetRegA;
+                CmpConst(ACC, param1);
+                jcc(jg, param2);
+                drop
 
-        |IL.opEQ..IL.opGE,
-         IL.opEQC..IL.opGEC:
-            IF (IL.opEQ <= opcode) & (opcode <= IL.opGE) THEN
-                BinOp(r1, r2);
-                Cmp(r1, r2);
+            |IL.opCASELR:
+                GetRegA;
+                CmpConst(ACC, param1);
+                IF param2 = cmd.param3 THEN
+                    jcc(jne, param2)
+                ELSE
+                    jcc(jl, param2);
+                    jcc(jg, cmd.param3)
+                END;
                 drop
-            ELSE
-                UnOp(r1);
-                CmpConst(r1, param2)
-            END;
 
-            drop;
-            cc := cond(opcode);
-            next := cmd.next(COMMAND);
+            |IL.opCODE:
+                Code(param2)
 
-            IF next.opcode = IL.opJNZ THEN
-                jcc(cc, next.param1);
-                cmd := next
-            ELSIF next.opcode = IL.opJZ THEN
-                jcc(inv0(cc), next.param1);
-                cmd := next
-            ELSE
-                SetCC(cc, GetAnyReg())
-            END
+            |IL.opEQ..IL.opGE,
+            IL.opEQC..IL.opGEC:
+                IF (IL.opEQ <= opcode) & (opcode <= IL.opGE) THEN
+                    BinOp(r1, r2);
+                    Cmp(r1, r2);
+                    drop
+                ELSE
+                    UnOp(r1);
+                    CmpConst(r1, param2)
+                END;
 
-        |IL.opINCC:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            Ldr32(r2, r1);
-            AddConst(r2, param2);
-            Str32(r2, r1);
-            drop;
-            drop
+                drop;
+                cc := cond(opcode);
+                next := cmd.next(COMMAND);
+
+                IF next.opcode = IL.opJNZ THEN
+                    jcc(cc, next.param1);
+                    cmd := next
+                ELSIF next.opcode = IL.opJZ THEN
+                    jcc(inv0(cc), next.param1);
+                    cmd := next
+                ELSE
+                    SetCC(cc, GetAnyReg())
+                END
 
-        |IL.opINCCB, IL.opDECCB:
-            IF opcode = IL.opDECCB THEN
-                param2 := -param2
-            END;
-            UnOp(r1);
-            r2 := GetAnyReg();
-            Ldr8(r2, r1);
-            AddConst(r2, param2);
-            Str8(r2, r1);
-            drop;
-            drop
+            |IL.opINCC:
+                UnOp(r1);
+                r2 := GetAnyReg();
+                Ldr32(r2, r1);
+                AddConst(r2, param2);
+                Str32(r2, r1);
+                drop;
+                drop
 
-        |IL.opUMINUS:
-            UnOp(r1);
-            Neg(r1)
+            |IL.opINCCB, IL.opDECCB:
+                IF opcode = IL.opDECCB THEN
+                    param2 := -param2
+                END;
+                UnOp(r1);
+                r2 := GetAnyReg();
+                Ldr8(r2, r1);
+                AddConst(r2, param2);
+                Str8(r2, r1);
+                drop;
+                drop
 
-        |IL.opADD:
-            BinOp(r1, r2);
-            CASE cmd.next(COMMAND).opcode OF
-            |IL.opLOAD32, IL.opLOADF:
-                gen7(TRUE, FALSE, r2, r1, r1); (* ldr r1, [r1, r2] *)
-                cmd := cmd.next(COMMAND)
-            |IL.opLOAD8:
-                gen7(TRUE, TRUE, r2, r1, r1);  (* ldrb r1, [r1, r2] *)
-                cmd := cmd.next(COMMAND)
-            |IL.opLOAD16:
-                gen8(TRUE, FALSE, r2, r1, r1); (* ldrh r1, [r1, r2] *)
-                cmd := cmd.next(COMMAND)
-            ELSE
-                AddReg(r1, r1, r2)
-            END;
-            drop
+            |IL.opUMINUS:
+                UnOp(r1);
+                Neg(r1)
 
-        |IL.opADDC:
-            UnOp(r1);
-            AddConst(r1, param2)
+            |IL.opADD:
+                BinOp(r1, r2);
+                CASE cmd.next(COMMAND).opcode OF
+                |IL.opLOAD32, IL.opLOADF:
+                    gen7(TRUE, FALSE, r2, r1, r1); (* ldr r1, [r1, r2] *)
+                    cmd := cmd.next(COMMAND)
+                |IL.opLOAD8:
+                    gen7(TRUE, TRUE, r2, r1, r1);  (* ldrb r1, [r1, r2] *)
+                    cmd := cmd.next(COMMAND)
+                |IL.opLOAD16:
+                    gen8(TRUE, FALSE, r2, r1, r1); (* ldrh r1, [r1, r2] *)
+                    cmd := cmd.next(COMMAND)
+                ELSE
+                    AddReg(r1, r1, r2)
+                END;
+                drop
 
-        |IL.opSUB:
-            BinOp(r1, r2);
-            SubReg(r1, r1, r2);
-            drop
+            |IL.opADDC:
+                UnOp(r1);
+                AddConst(r1, param2)
 
-        |IL.opSUBL, IL.opSUBR:
-            UnOp(r1);
-            AddConst(r1, -param2);
-            IF opcode = IL.opSUBL THEN
-                Neg(r1)
-            END
+            |IL.opSUB:
+                BinOp(r1, r2);
+                SubReg(r1, r1, r2);
+                drop
 
-        |IL.opMUL:
-            BinOp(r1, r2);
-            Mul(r1, r2);
-            drop
+            |IL.opSUBL, IL.opSUBR:
+                UnOp(r1);
+                AddConst(r1, -param2);
+                IF opcode = IL.opSUBL THEN
+                    Neg(r1)
+                END
 
-        |IL.opMULC:
-            UnOp(r1);
+            |IL.opMUL:
+                BinOp(r1, r2);
+                Mul(r1, r2);
+                drop
 
-            a := param2;
-            IF a > 1 THEN
-                n := UTILS.Log2(a)
-            ELSIF a < -1 THEN
-                n := UTILS.Log2(-a)
-            ELSE
-                n := -1
-            END;
+            |IL.opMULC:
+                UnOp(r1);
 
-            IF a = 1 THEN
+                a := param2;
+                IF a > 1 THEN
+                    n := UTILS.Log2(a)
+                ELSIF a < -1 THEN
+                    n := UTILS.Log2(-a)
+                ELSE
+                    n := -1
+                END;
 
-            ELSIF a = -1 THEN
-                Neg(r1)
-            ELSIF a = 0 THEN
-                MovConst(r1, 0)
-            ELSE
-                IF n > 0 THEN
-                    IF a < 0 THEN
-                        Neg(r1)
-                    END;
-                    LslImm(r1, n)
+                IF a = 1 THEN
+
+                ELSIF a = -1 THEN
+                    Neg(r1)
+                ELSIF a = 0 THEN
+                    MovConst(r1, 0)
                 ELSE
-                    r2 := GetAnyReg();
-                    MovConst(r2, a);
-                    Mul(r1, r2);
-                    drop
+                    IF n > 0 THEN
+                        IF a < 0 THEN
+                            Neg(r1)
+                        END;
+                        LslImm(r1, n)
+                    ELSE
+                        r2 := GetAnyReg();
+                        MovConst(r2, a);
+                        Mul(r1, r2);
+                        drop
+                    END
                 END
-            END
 
-        |IL.opABS:
-            UnOp(r1);
-            Tst(r1);
-            L := NewLabel();
-            jcc(jge, L);
-            Neg(r1);
-            Label(L)
-
-        |IL.opNOT:
-            UnOp(r1);
-            Tst(r1);
-            SetCC(je, r1)
-
-        |IL.opORD:
-            UnOp(r1);
-            Tst(r1);
-            SetCC(jne, r1)
-
-        |IL.opASR, IL.opROR, IL.opLSL, IL.opLSR:
-            BinOp(r1, r2);
-            Shift(opcode, r1, r2);
-            drop
+            |IL.opABS:
+                UnOp(r1);
+                Tst(r1);
+                L := NewLabel();
+                jcc(jge, L);
+                Neg(r1);
+                Label(L)
 
-        |IL.opASR1, IL.opROR1, IL.opLSL1, IL.opLSR1:
-            MovConst(GetAnyReg(), param2);
-            BinOp(r2, r1);
-            Shift(opcode, r1, r2);
-            INCL(R.regs, r2);
-            DEC(R.top);
-            R.stk[R.top] := r1
-
-        |IL.opASR2, IL.opROR2, IL.opLSL2, IL.opLSR2:
-            n := param2 MOD 32;
-            IF n # 0 THEN
+            |IL.opNOT:
                 UnOp(r1);
-                CASE opcode OF
-                |IL.opASR2: AsrImm(r1, n)
-                |IL.opROR2: r2 := GetAnyReg(); MovConst(r2, n); Shift(IL.opROR, r1, r2); drop
-                |IL.opLSL2: LslImm(r1, n)
-                |IL.opLSR2: LsrImm(r1, n)
-                END
-            END
+                Tst(r1);
+                SetCC(je, r1)
 
-        |IL.opCHKIDX:
-            UnOp(r1);
-            CmpConst(r1, param2);
-            jcc(jb, param1)
+            |IL.opORD:
+                UnOp(r1);
+                Tst(r1);
+                SetCC(jne, r1)
 
-        |IL.opCHKIDX2:
-            BinOp(r1, r2);
-            IF param2 # -1 THEN
-                Cmp(r2, r1);
+            |IL.opASR, IL.opROR, IL.opLSL, IL.opLSR:
+                BinOp(r1, r2);
+                Shift(opcode, r1, r2);
+                drop
+
+            |IL.opASR1, IL.opROR1, IL.opLSL1, IL.opLSR1:
+                MovConst(GetAnyReg(), param2);
+                BinOp(r2, r1);
+                Shift(opcode, r1, r2);
+                INCL(R.regs, r2);
+                DEC(R.top);
+                R.stk[R.top] := r1
+
+            |IL.opASR2, IL.opROR2, IL.opLSL2, IL.opLSR2:
+                n := param2 MOD 32;
+                IF n # 0 THEN
+                    UnOp(r1);
+                    CASE opcode OF
+                    |IL.opASR2: AsrImm(r1, n)
+                    |IL.opROR2: r2 := GetAnyReg(); MovConst(r2, n); Shift(IL.opROR, r1, r2); drop
+                    |IL.opLSL2: LslImm(r1, n)
+                    |IL.opLSR2: LsrImm(r1, n)
+                    END
+                END
+
+            |IL.opCHKIDX:
+                UnOp(r1);
+                CmpConst(r1, param2);
                 jcc(jb, param1)
-            END;
-            INCL(R.regs, r1);
-            DEC(R.top);
-            R.stk[R.top] := r2
 
-        |IL.opLEN:
-            n := param2;
-            UnOp(r1);
-            drop;
-            EXCL(R.regs, r1);
+            |IL.opCHKIDX2:
+                BinOp(r1, r2);
+                IF param2 # -1 THEN
+                    Cmp(r2, r1);
+                    jcc(jb, param1)
+                END;
+                INCL(R.regs, r1);
+                DEC(R.top);
+                R.stk[R.top] := r2
 
-            WHILE n > 0 DO
-                UnOp(r2);
+            |IL.opLEN:
+                n := param2;
+                UnOp(r1);
                 drop;
-                DEC(n)
-            END;
+                EXCL(R.regs, r1);
 
-            INCL(R.regs, r1);
-            ASSERT(REG.GetReg(R, r1))
+                WHILE n > 0 DO
+                    UnOp(r2);
+                    drop;
+                    DEC(n)
+                END;
 
-        |IL.opINF:
-            MovConst(GetAnyReg(), inf)
+                INCL(R.regs, r1);
+                ASSERT(REG.GetReg(R, r1))
 
-        |IL.opPUSHF:
-            UnOp(r1);
-            push(r1);
-            drop
+            |IL.opINF:
+                MovConst(GetAnyReg(), inf)
 
-        |IL.opCONST:
-            MovConst(GetAnyReg(), param2)
+            |IL.opPUSHF:
+                UnOp(r1);
+                push(r1);
+                drop
 
-        |IL.opEQP, IL.opNEP:
-            reloc(GetAnyReg(), BIN.RCODE + pic, param1);
-            BinOp(r1, r2);
-            Cmp(r1, r2);
-            drop;
-            IF opcode = IL.opEQP THEN
-                SetCC(je, r1)
-            ELSE
-                SetCC(jne, r1)
-            END
+            |IL.opCONST:
+                MovConst(GetAnyReg(), param2)
 
-        |IL.opPUSHT:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            mov(r2, r1);
-            SubImm8(r2, 4);
-            Ldr32(r2, r2)
-
-        |IL.opGET, IL.opGETC:
-            IF opcode = IL.opGET THEN
-                BinOp(r1, r2)
-            ELSIF opcode = IL.opGETC THEN
-                UnOp(r2);
-                r1 := GetAnyReg();
-                MovConst(r1, param1)
-            END;
-            drop;
-            drop;
+            |IL.opEQP, IL.opNEP:
+                reloc(GetAnyReg(), BIN.RCODE + pic, param1);
+                BinOp(r1, r2);
+                Cmp(r1, r2);
+                drop;
+                IF opcode = IL.opEQP THEN
+                    SetCC(je, r1)
+                ELSE
+                    SetCC(jne, r1)
+                END
 
-            CASE param2 OF
-            |1: Ldr8(r1, r1); Str8(r1, r2)
-            |2: Ldr16(r1, r1); Str16(r1, r2)
-            |4: Ldr32(r1, r1); Str32(r1, r2)
-            END
+            |IL.opPUSHT:
+                UnOp(r1);
+                r2 := GetAnyReg();
+                mov(r2, r1);
+                SubImm8(r2, 4);
+                Ldr32(r2, r2)
+
+            |IL.opGET, IL.opGETC:
+                IF opcode = IL.opGET THEN
+                    BinOp(r1, r2)
+                ELSIF opcode = IL.opGETC THEN
+                    UnOp(r2);
+                    r1 := GetAnyReg();
+                    MovConst(r1, param1)
+                END;
+                drop;
+                drop;
 
-        |IL.opINC, IL.opDEC:
-            BinOp(r2, r1);
-            r3 := GetAnyReg();
-            Ldr32(r3, r1);
-            IF opcode = IL.opINC THEN
-                AddReg(r3, r3, r2)
-            ELSE
-                SubReg(r3, r3, r2)
-            END;
-            Str32(r3, r1);
-            drop;
-            drop;
-            drop
+                CASE param2 OF
+                |1: Ldr8(r1, r1); Str8(r1, r2)
+                |2: Ldr16(r1, r1); Str16(r1, r2)
+                |4: Ldr32(r1, r1); Str32(r1, r2)
+                END
 
-        |IL.opINCB, IL.opDECB:
-            BinOp(r2, r1);
-            r3 := GetAnyReg();
-            Ldr8(r3, r1);
-            IF opcode = IL.opINCB THEN
-                AddReg(r3, r3, r2)
-            ELSE
-                SubReg(r3, r3, r2)
-            END;
-            Str8(r3, r1);
-            drop;
-            drop;
-            drop
+            |IL.opINC, IL.opDEC:
+                BinOp(r2, r1);
+                r3 := GetAnyReg();
+                Ldr32(r3, r1);
+                IF opcode = IL.opINC THEN
+                    AddReg(r3, r3, r2)
+                ELSE
+                    SubReg(r3, r3, r2)
+                END;
+                Str32(r3, r1);
+                drop;
+                drop;
+                drop
 
-        |IL.opMIN, IL.opMAX:
-            BinOp(r1, r2);
-            Cmp(r1, r2);
-            L := NewLabel();
-            IF opcode = IL.opMIN THEN
-                cc := jle
-            ELSE
-                cc := jge
-            END;
-            jcc(cc, L);
-            mov(r1, r2);
-            Label(L);
-            drop
+            |IL.opINCB, IL.opDECB:
+                BinOp(r2, r1);
+                r3 := GetAnyReg();
+                Ldr8(r3, r1);
+                IF opcode = IL.opINCB THEN
+                    AddReg(r3, r3, r2)
+                ELSE
+                    SubReg(r3, r3, r2)
+                END;
+                Str8(r3, r1);
+                drop;
+                drop;
+                drop
 
-        |IL.opMINC, IL.opMAXC:
-            UnOp(r1);
-            CmpConst(r1, param2);
-            L := NewLabel();
-            IF opcode = IL.opMINC THEN
-                cc := jle
-            ELSE
-                cc := jge
-            END;
-            jcc(cc, L);
-            MovConst(r1, param2);
-            Label(L)
+            |IL.opMIN, IL.opMAX:
+                BinOp(r1, r2);
+                Cmp(r1, r2);
+                L := NewLabel();
+                IF opcode = IL.opMIN THEN
+                    cc := jle
+                ELSE
+                    cc := jge
+                END;
+                jcc(cc, L);
+                mov(r1, r2);
+                Label(L);
+                drop
 
-        |IL.opMULS:
-            BinOp(r1, r2);
-            gen4(0, r2, r1); (* ands r1, r2 *)
-            drop
+            |IL.opMINC, IL.opMAXC:
+                UnOp(r1);
+                CmpConst(r1, param2);
+                L := NewLabel();
+                IF opcode = IL.opMINC THEN
+                    cc := jle
+                ELSE
+                    cc := jge
+                END;
+                jcc(cc, L);
+                MovConst(r1, param2);
+                Label(L)
 
-        |IL.opMULSC:
-            MovConst(GetAnyReg(), param2);
-            BinOp(r1, r2);
-            gen4(0, r2, r1); (* ands r1, r2 *)
-            drop
+            |IL.opMULS:
+                BinOp(r1, r2);
+                gen4(0, r2, r1); (* ands r1, r2 *)
+                drop
 
-        |IL.opDIVS:
-            BinOp(r1, r2);
-            gen4(1, r2, r1); (* eors r1, r2 *)
-            drop
+            |IL.opMULSC:
+                MovConst(GetAnyReg(), param2);
+                BinOp(r1, r2);
+                gen4(0, r2, r1); (* ands r1, r2 *)
+                drop
 
-        |IL.opDIVSC:
-            MovConst(GetAnyReg(), param2);
-            BinOp(r1, r2);
-            gen4(1, r2, r1); (* eors r1, r2 *)
-            drop
+            |IL.opDIVS:
+                BinOp(r1, r2);
+                gen4(1, r2, r1); (* eors r1, r2 *)
+                drop
 
-        |IL.opADDS:
-            BinOp(r1, r2);
-            gen4(12, r2, r1); (* orrs r1, r2 *)
-            drop
+            |IL.opDIVSC:
+                MovConst(GetAnyReg(), param2);
+                BinOp(r1, r2);
+                gen4(1, r2, r1); (* eors r1, r2 *)
+                drop
 
-        |IL.opSUBS:
-            BinOp(r1, r2);
-            gen4(14, r2, r1); (* bics r1, r2 *)
-            drop
+            |IL.opADDS:
+                BinOp(r1, r2);
+                gen4(12, r2, r1); (* orrs r1, r2 *)
+                drop
 
-        |IL.opADDSC:
-            MovConst(GetAnyReg(), param2);
-            BinOp(r1, r2);
-            gen4(12, r2, r1); (* orrs r1, r2 *)
-            drop
+            |IL.opSUBS:
+                BinOp(r1, r2);
+                gen4(14, r2, r1); (* bics r1, r2 *)
+                drop
 
-        |IL.opSUBSL:
-            MovConst(GetAnyReg(), param2);
-            BinOp(r1, r2);
-            gen4(14, r1, r2); (* bics r2, r1 *)
-            INCL(R.regs, r1);
-            DEC(R.top);
-            R.stk[R.top] := r2
-
-        |IL.opSUBSR:
-            MovConst(GetAnyReg(), param2);
-            BinOp(r1, r2);
-            gen4(14, r2, r1); (* bics r1, r2 *)
-            drop
+            |IL.opADDSC:
+                MovConst(GetAnyReg(), param2);
+                BinOp(r1, r2);
+                gen4(12, r2, r1); (* orrs r1, r2 *)
+                drop
 
-        |IL.opUMINS:
-            UnOp(r1);
-            gen4(15, r1, r1) (* mvns r1, r1 *)
-
-        |IL.opINCL, IL.opEXCL:
-            BinOp(r1, r2);
-            r3 := GetAnyReg();
-            MovConst(r3, 1);
-            CmpConst(r1, 32);
-            L := NewLabel();
-            jcc(jnb, L);
-            gen4(2, r1, r3); (* lsls r3, r1 *)
-            Ldr32(r1, r2);
-            IF opcode = IL.opINCL THEN
-                gen4(12, r3, r1) (* orrs r1, r3 *)
-            ELSE
-                gen4(14, r3, r1) (* bics r1, r3 *)
-            END;
-            Str32(r1, r2);
-            Label(L);
-            drop;
-            drop;
-            drop
+            |IL.opSUBSL:
+                MovConst(GetAnyReg(), param2);
+                BinOp(r1, r2);
+                gen4(14, r1, r2); (* bics r2, r1 *)
+                INCL(R.regs, r1);
+                DEC(R.top);
+                R.stk[R.top] := r2
 
-        |IL.opINCLC, IL.opEXCLC:
-            UnOp(r2);
-            r1 := GetAnyReg();
-            r3 := GetAnyReg();
-            MovConst(r3, 1);
-            LslImm(r3, param2);
-            Ldr32(r1, r2);
-            IF opcode = IL.opINCLC THEN
-                gen4(12, r3, r1) (* orrs r1, r3 *)
-            ELSE
-                gen4(14, r3, r1) (* bics r1, r3 *)
-            END;
-            Str32(r1, r2);
-            drop;
-            drop;
-            drop
+            |IL.opSUBSR:
+                MovConst(GetAnyReg(), param2);
+                BinOp(r1, r2);
+                gen4(14, r2, r1); (* bics r1, r2 *)
+                drop
 
-        |IL.opLENGTH:
-            PushAll(2);
-            CallRTL(IL._length, 2);
-            GetRegA
-
-        |IL.opLENGTHW:
-            PushAll(2);
-            CallRTL(IL._lengthw, 2);
-            GetRegA
-
-        |IL.opSAVES:
-            UnOp(r2);
-            REG.PushAll_1(R);
-            r1 := GetAnyReg();
-            reloc(r1, BIN.RDATA + pic, stroffs + param2);
-            push(r1);
-            drop;
-            push(r2);
-            drop;
-            PushConst(param1);
-            CallRTL(IL._move, 3)
-
-        |IL.opEQS .. IL.opGES:
-            PushAll(4);
-            PushConst(opcode - IL.opEQS);
-            CallRTL(IL._strcmp, 5);
-            GetRegA
-
-        |IL.opEQSW .. IL.opGESW:
-            PushAll(4);
-            PushConst(opcode - IL.opEQSW);
-            CallRTL(IL._strcmpw, 5);
-            GetRegA
-
-        |IL.opCOPY:
-            PushAll(2);
-            PushConst(param2);
-            CallRTL(IL._move, 3)
-
-        |IL.opMOVE:
-            PushAll(3);
-            CallRTL(IL._move, 3)
-
-        |IL.opCOPYA:
-            PushAll(4);
-            PushConst(param2);
-            CallRTL(IL._arrcpy, 5);
-            GetRegA
-
-        |IL.opCOPYS:
-            PushAll(4);
-            PushConst(param2);
-            CallRTL(IL._strcpy, 5)
-
-        |IL.opDIV:
-            PushAll(2);
-            divmod;
-            GetRegA
-
-        |IL.opDIVL:
-            UnOp(r1);
-            REG.PushAll_1(R);
-            PushConst(param2);
-            push(r1);
-            drop;
-            divmod;
-            GetRegA
-
-        |IL.opDIVR:
-            n := UTILS.Log2(param2);
-            IF n > 0 THEN
+            |IL.opUMINS:
                 UnOp(r1);
-                AsrImm(r1, n)
-            ELSIF n < 0 THEN
-                PushAll(1);
+                gen4(15, r1, r1) (* mvns r1, r1 *)
+
+            |IL.opINCL, IL.opEXCL:
+                BinOp(r1, r2);
+                r3 := GetAnyReg();
+                MovConst(r3, 1);
+                CmpConst(r1, 32);
+                L := NewLabel();
+                jcc(jnb, L);
+                gen4(2, r1, r3); (* lsls r3, r1 *)
+                Ldr32(r1, r2);
+                IF opcode = IL.opINCL THEN
+                    gen4(12, r3, r1) (* orrs r1, r3 *)
+                ELSE
+                    gen4(14, r3, r1) (* bics r1, r3 *)
+                END;
+                Str32(r1, r2);
+                Label(L);
+                drop;
+                drop;
+                drop
+
+            |IL.opINCLC, IL.opEXCLC:
+                UnOp(r2);
+                r1 := GetAnyReg();
+                r3 := GetAnyReg();
+                MovConst(r3, 1);
+                LslImm(r3, param2);
+                Ldr32(r1, r2);
+                IF opcode = IL.opINCLC THEN
+                    gen4(12, r3, r1) (* orrs r1, r3 *)
+                ELSE
+                    gen4(14, r3, r1) (* bics r1, r3 *)
+                END;
+                Str32(r1, r2);
+                drop;
+                drop;
+                drop
+
+            |IL.opLENGTH:
+                PushAll(2);
+                CallRTL(IL._length, 2);
+                GetRegA
+
+            |IL.opLENGTHW:
+                PushAll(2);
+                CallRTL(IL._lengthw, 2);
+                GetRegA
+
+            |IL.opSAVES:
+                UnOp(r2);
+                REG.PushAll_1(R);
+                r1 := GetAnyReg();
+                reloc(r1, BIN.RDATA + pic, stroffs + param2);
+                push(r1);
+                drop;
+                push(r2);
+                drop;
+                PushConst(param1);
+                CallRTL(IL._move, 3)
+
+            |IL.opEQS .. IL.opGES:
+                PushAll(4);
+                PushConst(opcode - IL.opEQS);
+                CallRTL(IL._strcmp, 5);
+                GetRegA
+
+            |IL.opEQSW .. IL.opGESW:
+                PushAll(4);
+                PushConst(opcode - IL.opEQSW);
+                CallRTL(IL._strcmpw, 5);
+                GetRegA
+
+            |IL.opCOPY:
+                PushAll(2);
                 PushConst(param2);
-                divmod;
+                CallRTL(IL._move, 3)
+
+            |IL.opMOVE:
+                PushAll(3);
+                CallRTL(IL._move, 3)
+
+            |IL.opCOPYA:
+                PushAll(4);
+                PushConst(param2);
+                CallRTL(IL._arrcpy, 5);
                 GetRegA
-            END
 
-        |IL.opMOD:
-            PushAll(2);
-            divmod;
-            mov(R0, R1);
-            GetRegA
+            |IL.opCOPYS:
+                PushAll(4);
+                PushConst(param2);
+                CallRTL(IL._strcpy, 5)
+
+            |IL.opDIV:
+                PushAll(2);
+                divmod;
+                GetRegA
 
-        |IL.opMODR:
-            n := UTILS.Log2(param2);
-            IF n > 0 THEN
+            |IL.opDIVL:
                 UnOp(r1);
-                IF n = 8 THEN
-                    Code(0B2C0H + r1 * 9) (* uxtb r1, r1 *)
-                ELSIF n = 16 THEN
-                    Code(0B280H + r1 * 9) (* uxth r1, r1 *)
+                REG.PushAll_1(R);
+                PushConst(param2);
+                push(r1);
+                drop;
+                divmod;
+                GetRegA
+
+            |IL.opDIVR:
+                n := UTILS.Log2(param2);
+                IF n > 0 THEN
+                    UnOp(r1);
+                    AsrImm(r1, n)
+                ELSIF n < 0 THEN
+                    PushAll(1);
+                    PushConst(param2);
+                    divmod;
+                    GetRegA
+                END
+
+            |IL.opMOD:
+                PushAll(2);
+                divmod;
+                mov(R0, R1);
+                GetRegA
+
+            |IL.opMODR:
+                n := UTILS.Log2(param2);
+                IF n > 0 THEN
+                    UnOp(r1);
+                    IF n = 8 THEN
+                        Code(0B2C0H + r1 * 9) (* uxtb r1, r1 *)
+                    ELSIF n = 16 THEN
+                        Code(0B280H + r1 * 9) (* uxth r1, r1 *)
+                    ELSE
+                        LslImm(r1, 32 - n);
+                        LsrImm(r1, 32 - n)
+                    END
+                ELSIF n < 0 THEN
+                    PushAll(1);
+                    PushConst(param2);
+                    divmod;
+                    mov(R0, R1);
+                    GetRegA
                 ELSE
-                    LslImm(r1, 32 - n);
-                    LsrImm(r1, 32 - n)
+                    UnOp(r1);
+                    MovConst(r1, 0)
                 END
-            ELSIF n < 0 THEN
-                PushAll(1);
+
+            |IL.opMODL:
+                UnOp(r1);
+                REG.PushAll_1(R);
                 PushConst(param2);
+                push(r1);
+                drop;
                 divmod;
                 mov(R0, R1);
                 GetRegA
-            ELSE
+
+            |IL.opIN, IL.opINR:
+                IF opcode = IL.opINR THEN
+                    r2 := GetAnyReg();
+                    MovConst(r2, param2)
+                END;
+                L := NewLabel();
+                L2 := NewLabel();
+                BinOp(r1, r2);
+                r3 := GetAnyReg();
+                CmpConst(r1, 32);
+                jcc(jb, L);
+                MovConst(r1, 0);
+                jmp(L2);
+                Label(L);
+                MovConst(r3, 1);
+                Shift(IL.opLSL, r3, r1);
+                gen4(0, r3, r2); (* ands r2, r3 *)
+                SetCC(jne, r1);
+                Label(L2);
+                drop;
+                drop
+
+            |IL.opINL:
                 UnOp(r1);
-                MovConst(r1, 0)
-            END
+                r2 := GetAnyReg();
+                MovConst(r2, LSL(1, param2));
+                gen4(0, r2, r1); (* ands r1, r2 *)
+                SetCC(jne, r1);
+                drop
+
+            |IL.opRSET:
+                PushAll(2);
+                CallRTL(IL._set, 2);
+                GetRegA
+
+            |IL.opRSETR:
+                PushAll(1);
+                PushConst(param2);
+                CallRTL(IL._set, 2);
+                GetRegA
+
+            |IL.opRSETL:
+                UnOp(r1);
+                REG.PushAll_1(R);
+                PushConst(param2);
+                push(r1);
+                drop;
+                CallRTL(IL._set, 2);
+                GetRegA
+
+            |IL.opRSET1:
+                PushAll(1);
+                CallRTL(IL._set1, 1);
+                GetRegA
+
+            |IL.opCONSTF:
+                MovConst(GetAnyReg(), UTILS.d2s(cmd.float))
+
+            |IL.opMULF:
+                PushAll(2);
+                CallRTL(IL._fmul, 2);
+                GetRegA
+
+            |IL.opDIVF:
+                PushAll(2);
+                CallRTL(IL._fdiv, 2);
+                GetRegA
+
+            |IL.opDIVFI:
+                PushAll(2);
+                CallRTL(IL._fdivi, 2);
+                GetRegA
+
+            |IL.opADDF:
+                PushAll(2);
+                CallRTL(IL._fadd, 2);
+                GetRegA
 
-        |IL.opMODL:
-            UnOp(r1);
-            REG.PushAll_1(R);
-            PushConst(param2);
-            push(r1);
-            drop;
-            divmod;
-            mov(R0, R1);
-            GetRegA
-
-        |IL.opIN, IL.opINR:
-            IF opcode = IL.opINR THEN
+            |IL.opSUBFI:
+                PushAll(2);
+                CallRTL(IL._fsubi, 2);
+                GetRegA
+
+            |IL.opSUBF:
+                PushAll(2);
+                CallRTL(IL._fsub, 2);
+                GetRegA
+
+            |IL.opEQF..IL.opGEF:
+                PushAll(2);
+                PushConst(opcode - IL.opEQF);
+                CallRTL(IL._fcmp, 3);
+                GetRegA
+
+            |IL.opFLOOR:
+                PushAll(1);
+                CallRTL(IL._floor, 1);
+                GetRegA
+
+            |IL.opFLT:
+                PushAll(1);
+                CallRTL(IL._flt, 1);
+                GetRegA
+
+            |IL.opUMINF:
+                UnOp(r1);
                 r2 := GetAnyReg();
-                MovConst(r2, param2)
-            END;
-            L := NewLabel();
-            L2 := NewLabel();
-            BinOp(r1, r2);
-            r3 := GetAnyReg();
-            CmpConst(r1, 32);
-            jcc(jb, L);
-            MovConst(r1, 0);
-            jmp(L2);
-            Label(L);
-            MovConst(r3, 1);
-            Shift(IL.opLSL, r3, r1);
-            gen4(0, r3, r2); (* ands r2, r3 *)
-            SetCC(jne, r1);
-            Label(L2);
-            drop;
-            drop
+                MovConst(r2, 1);
+                LslImm(r2, 31);
+                gen4(1, r2, r1); (* eors r1, r2 *)
+                drop
 
-        |IL.opINL:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            MovConst(r2, LSL(1, param2));
-            gen4(0, r2, r1); (* ands r1, r2 *)
-            SetCC(jne, r1);
-            drop
+            |IL.opFABS:
+                UnOp(r1);
+                r2 := GetAnyReg();
+                MovConst(r2, 1);
+                LslImm(r2, 31);
+                gen4(14, r2, r1); (* bics r1, r2 *)
+                drop
 
-        |IL.opRSET:
-            PushAll(2);
-            CallRTL(IL._set, 2);
-            GetRegA
-
-        |IL.opRSETR:
-            PushAll(1);
-            PushConst(param2);
-            CallRTL(IL._set, 2);
-            GetRegA
-
-        |IL.opRSETL:
-            UnOp(r1);
-            REG.PushAll_1(R);
-            PushConst(param2);
-            push(r1);
-            drop;
-            CallRTL(IL._set, 2);
-            GetRegA
-
-        |IL.opRSET1:
-            PushAll(1);
-            CallRTL(IL._set1, 1);
-            GetRegA
-
-        |IL.opCONSTF:
-            MovConst(GetAnyReg(), UTILS.d2s(cmd.float))
-
-        |IL.opMULF:
-            PushAll(2);
-            CallRTL(IL._fmul, 2);
-            GetRegA
-
-        |IL.opDIVF:
-            PushAll(2);
-            CallRTL(IL._fdiv, 2);
-            GetRegA
-
-        |IL.opDIVFI:
-            PushAll(2);
-            CallRTL(IL._fdivi, 2);
-            GetRegA
-
-        |IL.opADDF:
-            PushAll(2);
-            CallRTL(IL._fadd, 2);
-            GetRegA
-
-        |IL.opSUBFI:
-            PushAll(2);
-            CallRTL(IL._fsubi, 2);
-            GetRegA
-
-        |IL.opSUBF:
-            PushAll(2);
-            CallRTL(IL._fsub, 2);
-            GetRegA
-
-        |IL.opEQF..IL.opGEF:
-            PushAll(2);
-            PushConst(opcode - IL.opEQF);
-            CallRTL(IL._fcmp, 3);
-            GetRegA
-
-        |IL.opFLOOR:
-            PushAll(1);
-            CallRTL(IL._floor, 1);
-            GetRegA
-
-        |IL.opFLT:
-            PushAll(1);
-            CallRTL(IL._flt, 1);
-            GetRegA
-
-        |IL.opUMINF:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            MovConst(r2, 1);
-            LslImm(r2, 31);
-            gen4(1, r2, r1); (* eors r1, r2 *)
-            drop
+            |IL.opNEW:
+                cpsid_i;
+                PushAll(1);
+                n := param2 + 4;
+                ASSERT(UTILS.Align(n, 4));
+                PushConst(n);
+                PushConst(param1);
+                CallRTL(IL._new, 3);
+                cpsie_i
+
+            |IL.opTYPEGP:
+                UnOp(r1);
+                PushAll(0);
+                push(r1);
+                PushConst(param2);
+                CallRTL(IL._guard, 2);
+                GetRegA
 
-        |IL.opFABS:
-            UnOp(r1);
-            r2 := GetAnyReg();
-            MovConst(r2, 1);
-            LslImm(r2, 31);
-            gen4(14, r2, r1); (* bics r1, r2 *)
-            drop
+            |IL.opIS:
+                PushAll(1);
+                PushConst(param2);
+                CallRTL(IL._is, 2);
+                GetRegA
 
-        |IL.opNEW:
-            cpsid_i;
-            PushAll(1);
-            n := param2 + 4;
-            ASSERT(UTILS.Align(n, 4));
-            PushConst(n);
-            PushConst(param1);
-            CallRTL(IL._new, 3);
-            cpsie_i
-
-        |IL.opTYPEGP:
-            UnOp(r1);
-            PushAll(0);
-            push(r1);
-            PushConst(param2);
-            CallRTL(IL._guard, 2);
-            GetRegA
-
-        |IL.opIS:
-            PushAll(1);
-            PushConst(param2);
-            CallRTL(IL._is, 2);
-            GetRegA
-
-        |IL.opISREC:
-            PushAll(2);
-            PushConst(param2);
-            CallRTL(IL._guardrec, 3);
-            GetRegA
-
-        |IL.opTYPEGR:
-            PushAll(1);
-            PushConst(param2);
-            CallRTL(IL._guardrec, 2);
-            GetRegA
-
-        |IL.opTYPEGD:
-            UnOp(r1);
-            PushAll(0);
-            SubImm8(r1, 4);
-            Ldr32(r1, r1);
-            push(r1);
-            PushConst(param2);
-            CallRTL(IL._guardrec, 2);
-            GetRegA
-
-        |IL.opCASET:
-            push(R2);
-            push(R2);
-            PushConst(param2);
-            CallRTL(IL._guardrec, 2);
-            pop(R2);
-            cbnz(ACC, param1)
-
-        |IL.opROT:
-            PushAll(0);
-            mov(R2, SP);
-            push(R2);
-            PushConst(param2);
-            CallRTL(IL._rot, 2)
-
-        |IL.opPACK:
-            PushAll(2);
-            CallRTL(IL._pack, 2)
-
-        |IL.opPACKC:
-            PushAll(1);
-            PushConst(param2);
-            CallRTL(IL._pack, 2)
-
-        |IL.opUNPK:
-            PushAll(2);
-            CallRTL(IL._unpk, 2)
+            |IL.opISREC:
+                PushAll(2);
+                PushConst(param2);
+                CallRTL(IL._guardrec, 3);
+                GetRegA
 
-        END;
+            |IL.opTYPEGR:
+                PushAll(1);
+                PushConst(param2);
+                CallRTL(IL._guardrec, 2);
+                GetRegA
 
-        cmd := cmd.next(COMMAND)
-    END;
+            |IL.opTYPEGD:
+                UnOp(r1);
+                PushAll(0);
+                SubImm8(r1, 4);
+                Ldr32(r1, r1);
+                push(r1);
+                PushConst(param2);
+                CallRTL(IL._guardrec, 2);
+                GetRegA
+
+            |IL.opCASET:
+                push(R2);
+                push(R2);
+                PushConst(param2);
+                CallRTL(IL._guardrec, 2);
+                pop(R2);
+                cbnz(ACC, param1)
+
+            |IL.opROT:
+                PushAll(0);
+                mov(R2, SP);
+                push(R2);
+                PushConst(param2);
+                CallRTL(IL._rot, 2)
+
+            |IL.opPACK:
+                PushAll(2);
+                CallRTL(IL._pack, 2)
+
+            |IL.opPACKC:
+                PushAll(1);
+                PushConst(param2);
+                CallRTL(IL._pack, 2)
+
+            |IL.opUNPK:
+                PushAll(2);
+                CallRTL(IL._unpk, 2)
 
-    ASSERT(R.pushed = 0);
-    ASSERT(R.top = -1)
-END translate;
+            END;
+
+            cmd := cmd.next(COMMAND)
+        END;
+
+        ASSERT(R.pushed = 0);
+        ASSERT(R.top = -1)
+    END translate;
 
 
 PROCEDURE prolog (GlobSize, tcount, pic, sp, ivt_len: INTEGER);
-VAR
-    r1, r2, i, dcount: INTEGER;
+    VAR
+        r1, r2, i, dcount: INTEGER;
 
-BEGIN
-    entry := NewLabel();
-    emptyProc := NewLabel();
-    genInt := NewLabel();
-    genTrap := NewLabel();
-    sdivProc := NewLabel();
-
-    trap := emptyProc;
-    int0 := emptyProc;
-
-    IVT[0] := sp;
-    IVT[1] := entry;
-    FOR i := 2 TO ivt_len - 1 DO
-        IVT[i] := genInt
-    END;
+    BEGIN
+        entry := NewLabel();
+        emptyProc := NewLabel();
+        genInt := NewLabel();
+        genTrap := NewLabel();
+        sdivProc := NewLabel();
+
+        trap := emptyProc;
+        int0 := emptyProc;
+
+        IVT[0] := sp;
+        IVT[1] := entry;
+        FOR i := 2 TO ivt_len - 1 DO
+            IVT[i] := genInt
+        END;
 
-    FOR i := 0 TO ivt_len - 1 DO
-        Code(low(IVT[i]));
-        Code(high(IVT[i]))
-    END;
+        FOR i := 0 TO ivt_len - 1 DO
+            Code(low(IVT[i]));
+            Code(high(IVT[i]))
+        END;
 
-    Label(entry);
-    cpsie_i;
+        Label(entry);
+        cpsie_i;
 
-    r1 := GetAnyReg();
-    r2 := GetAnyReg();
-    reloc(r1, BIN.RDATA + pic, 0);
+        r1 := GetAnyReg();
+        r2 := GetAnyReg();
+        reloc(r1, BIN.RDATA + pic, 0);
 
-    FOR i := 0 TO tcount - 1 DO
-        MovConst(r2, CHL.GetInt(IL.codes.types, i));
-        Str32(r2, r1);
-        AddImm8(r1, 4)
-    END;
+        FOR i := 0 TO tcount - 1 DO
+            MovConst(r2, CHL.GetInt(IL.codes.types, i));
+            Str32(r2, r1);
+            AddImm8(r1, 4)
+        END;
 
-    dcount := CHL.Length(IL.codes.data);
-    FOR i := 0 TO dcount - 1 BY 4 DO
-        MovConst(r2, BIN.get32le(IL.codes.data, i));
-        Str32(r2, r1);
-        AddImm8(r1, 4)
-    END;
+        dcount := CHL.Length(IL.codes.data);
+        FOR i := 0 TO dcount - 1 BY 4 DO
+            MovConst(r2, BIN.get32le(IL.codes.data, i));
+            Str32(r2, r1);
+            AddImm8(r1, 4)
+        END;
+
+        drop;
+        drop;
 
-    drop;
-    drop;
-
-    r1 := GetAnyReg();
-    MovConst(r1, sp);
-    mov(SP, r1);
-    reloc(r1, BIN.RDATA + pic, 0);
-    push(r1);
-    reloc(r1, BIN.RBSS + pic, 0);
-    r2 := GetAnyReg();
-    MovConst(r2, GlobSize);
-    AddReg(r1, r1, r2);
-    drop;
-    push(r1);
-    drop;
-    PushConst(tcount);
-    CallRTL(IL._init, 3)
-END prolog;
+        r1 := GetAnyReg();
+        MovConst(r1, sp);
+        mov(SP, r1);
+        reloc(r1, BIN.RDATA + pic, 0);
+        push(r1);
+        reloc(r1, BIN.RBSS + pic, 0);
+        r2 := GetAnyReg();
+        MovConst(r2, GlobSize);
+        AddReg(r1, r1, r2);
+        drop;
+        push(r1);
+        drop;
+        PushConst(tcount);
+        CallRTL(IL._init, 3)
+    END prolog;
 
 
 PROCEDURE epilog;
-VAR
-    L1, L2, L3, L4: INTEGER;
+    VAR
+        L1, L2, L3, L4: INTEGER;
 
-BEGIN
-                   (* L2:  *)
-    Code(0E7FEH);  (* b L2 *)
-
-    Label(genInt);
-    Code(0F3EFH); Code(08005H);  (* mrs r0, ipsr  *)
-    gen14(FALSE, TRUE, {R0});    (* push {lr, r0} *)
-    call(int0);
-    gen14(TRUE, TRUE, {R0});     (* pop {pc, r0}  *)
-
-    Label(emptyProc);
-    Code(04770H);  (* bx lr *)
-
-    Label(genTrap);
-    call(trap);
-    call(entry);
-
-    Label(sdivProc);
-    IF _SDIV IN Target.InstrSet THEN
-        Code(09800H);  (* ldr  r0, [sp]    *)
-        Code(09901H);  (* ldr  r1, [sp, 4] *)
-        Code(0FB91H);  (* sdiv r2, r1, r0  *)
-        Code(0F2F0H);
-        Code(00013H);  (* movs r3, r2      *)
-        Code(04343H);  (* muls r3, r0, r3  *)
-        Code(01AC9H);  (* subs r1, r1, r3  *)
-        Code(0DA01H);  (* bge  L           *)
-        Code(01809H);  (* adds r1, r1, r0  *)
-        Code(03A01H);  (* subs r2, 1       *)
-                       (* L:               *)
-        Code(00010H);  (* movs r0, r2      *)
-        Code(04770H);  (* bx   lr          *)
-    ELSE
-        (* a / b; a >= 0 *)
-        L1 := NewLabel();
-        L2 := NewLabel();
-        L3 := NewLabel();
-        L4 := NewLabel();
-
-        LdrSp(R1, 1);
-        LdrSp(R2, 0);
-        MovConst(R0, 0);
-        push(R4);
-
-        Label(L4);
-        Cmp(R1, R2);
-        jcc(jl, L1);
-        MovConst(R3, 2);
-        mov(R4, R2);
-        LslImm(R4, 1);
-        Label(L3);
-        Cmp(R1, R4);
-        jcc(jl, L2);
-        CmpConst(R4, 0);
-        jcc(jle, L2);
-        LslImm(R4, 1);
-        LslImm(R3, 1);
-        jmp(L3);
-        Label(L2);
-        LsrImm(R4, 1);
-        LsrImm(R3, 1);
-        SubReg(R1, R1, R4);
-        AddReg(R0, R0, R3);
-        jmp(L4);
-        Label(L1);
-
-        (* a / b; a < 0 *)
-        L1 := NewLabel();
-        L2 := NewLabel();
-        L3 := NewLabel();
-        L4 := NewLabel();
-
-        Label(L4);
-        CmpConst(R1, 0);
-        jcc(jge, L1);
-        MovConst(R3, 2);
-        mov(R4, R2);
-        LslImm(R4, 1);
-        Neg(R1);
-        Label(L3);
-        Cmp(R1, R4);
-        jcc(jl, L2);
-        CmpConst(R4, 0);
-        jcc(jle, L2);
-        LslImm(R4, 1);
-        LslImm(R3, 1);
-        jmp(L3);
-        Label(L2);
-        Neg(R1);
-        LsrImm(R4, 1);
-        LsrImm(R3, 1);
-        AddReg(R1, R1, R4);
-        SubReg(R0, R0, R3);
-        jmp(L4);
-        Label(L1);
-
-        pop(R4);
+    BEGIN
+                    (* L2:  *)
+        Code(0E7FEH);  (* b L2 *)
+
+        Label(genInt);
+        Code(0F3EFH); Code(08005H);  (* mrs r0, ipsr  *)
+        gen14(FALSE, TRUE, {R0});    (* push {lr, r0} *)
+        call(int0);
+        gen14(TRUE, TRUE, {R0});     (* pop {pc, r0}  *)
+
+        Label(emptyProc);
         Code(04770H);  (* bx lr *)
-    END
 
-END epilog;
+        Label(genTrap);
+        call(trap);
+        call(entry);
+
+        Label(sdivProc);
+        IF _SDIV IN Target.InstrSet THEN
+            Code(09800H);  (* ldr  r0, [sp]    *)
+            Code(09901H);  (* ldr  r1, [sp, 4] *)
+            Code(0FB91H);  (* sdiv r2, r1, r0  *)
+            Code(0F2F0H);
+            Code(00013H);  (* movs r3, r2      *)
+            Code(04343H);  (* muls r3, r0, r3  *)
+            Code(01AC9H);  (* subs r1, r1, r3  *)
+            Code(0DA01H);  (* bge  L           *)
+            Code(01809H);  (* adds r1, r1, r0  *)
+            Code(03A01H);  (* subs r2, 1       *)
+                        (* L:               *)
+            Code(00010H);  (* movs r0, r2      *)
+            Code(04770H);  (* bx   lr          *)
+        ELSE
+            (* a / b; a >= 0 *)
+            L1 := NewLabel();
+            L2 := NewLabel();
+            L3 := NewLabel();
+            L4 := NewLabel();
+
+            LdrSp(R1, 1);
+            LdrSp(R2, 0);
+            MovConst(R0, 0);
+            push(R4);
+
+            Label(L4);
+            Cmp(R1, R2);
+            jcc(jl, L1);
+            MovConst(R3, 2);
+            mov(R4, R2);
+            LslImm(R4, 1);
+            Label(L3);
+            Cmp(R1, R4);
+            jcc(jl, L2);
+            CmpConst(R4, 0);
+            jcc(jle, L2);
+            LslImm(R4, 1);
+            LslImm(R3, 1);
+            jmp(L3);
+            Label(L2);
+            LsrImm(R4, 1);
+            LsrImm(R3, 1);
+            SubReg(R1, R1, R4);
+            AddReg(R0, R0, R3);
+            jmp(L4);
+            Label(L1);
+
+            (* a / b; a < 0 *)
+            L1 := NewLabel();
+            L2 := NewLabel();
+            L3 := NewLabel();
+            L4 := NewLabel();
+
+            Label(L4);
+            CmpConst(R1, 0);
+            jcc(jge, L1);
+            MovConst(R3, 2);
+            mov(R4, R2);
+            LslImm(R4, 1);
+            Neg(R1);
+            Label(L3);
+            Cmp(R1, R4);
+            jcc(jl, L2);
+            CmpConst(R4, 0);
+            jcc(jle, L2);
+            LslImm(R4, 1);
+            LslImm(R3, 1);
+            jmp(L3);
+            Label(L2);
+            Neg(R1);
+            LsrImm(R4, 1);
+            LsrImm(R3, 1);
+            AddReg(R1, R1, R4);
+            SubReg(R0, R0, R3);
+            jmp(L4);
+            Label(L1);
+
+            pop(R4);
+            Code(04770H);  (* bx lr *)
+        END
+
+    END epilog;
 
 
 PROCEDURE SetTarget (FlashStart, FlashSize, FlashReserve, SRAMStart, SRAMSize, SRAMReserve: INTEGER; InstrSet: SET; isNXP: BOOLEAN);
-BEGIN
-    Target.flash.start := FlashStart;    
-    Target.flash.size  := FlashSize;
-    (*Target.flash.startReserve := 0;*)
-    Target.flash.endReserve := FlashReserve;
+    BEGIN
+        Target.flash.start := FlashStart;
+        Target.flash.size  := FlashSize;
+        (*Target.flash.startReserve := 0;*)
+        Target.flash.endReserve := FlashReserve;
 
-    Target.sram.start := SRAMStart;
-    Target.sram.size  := SRAMSize;
-    Target.sram.startReserve := 0;
-    Target.sram.endReserve   := SRAMReserve;
+        Target.sram.start := SRAMStart;
+        Target.sram.size  := SRAMSize;
+        Target.sram.startReserve := 0;
+        Target.sram.endReserve   := SRAMReserve;
 
-    Target.InstrSet := InstrSet;
-    Target.isNXP    := isNXP;
+        Target.InstrSet := InstrSet;
+        Target.isNXP    := isNXP;
 
-    Target.IVTLen := 256; (* >= 192 *)
-    Target.MinStkSize := 256;
-END SetTarget;
+        Target.IVTLen := 256; (* >= 192 *)
+        Target.MinStkSize := 256;
+    END SetTarget;
 
 
 PROCEDURE CodeGen* (outname: ARRAY OF CHAR; target: INTEGER; options: PROG.OPTIONS);
-VAR
-    opt: PROG.OPTIONS;
-    i, j, DataAdr, BssAdr, DataSize, BssSize, CodeSize: INTEGER;
+    VAR
+        opt: PROG.OPTIONS;
+        i, j, DataAdr, BssAdr, DataSize, BssSize, CodeSize: INTEGER;
 
-BEGIN
-    IF target = TARGETS.STM32CM3 THEN
-        SetTarget(08000000H, MIN(MAX(options.rom, minROM), maxROM) * 1024, 0,
-                  20000000H, MIN(MAX(options.ram, minRAM), maxRAM) * 1024, 0,
-                  CortexM3, FALSE)
-    END;
+    BEGIN
+        IF target = TARGETS.STM32CM3 THEN
+            SetTarget(08000000H, MIN(MAX(options.rom, minROM), maxROM) * 1024, 0,
+                    20000000H, MIN(MAX(options.ram, minRAM), maxRAM) * 1024, 0,
+                    CortexM3, FALSE)
+        END;
 
-    tcount := CHL.Length(IL.codes.types);
+        tcount := CHL.Length(IL.codes.types);
 
-    opt := options;
-    CodeList := LISTS.create(NIL);
+        opt := options;
+        CodeList := LISTS.create(NIL);
 
-    program := BIN.create(IL.codes.lcount);
+        program := BIN.create(IL.codes.lcount);
 
-    REG.Init(R, push, pop, mov, xchg, {R0, R1, R2, R3});
+        REG.Init(R, push, pop, mov, xchg, {R0, R1, R2, R3});
 
-    StkCount := 0;
+        StkCount := 0;
 
-    DataAdr := Target.sram.start + Target.sram.startReserve;
-    DataSize := CHL.Length(IL.codes.data) + tcount * 4 + Target.sram.startReserve;
-    WHILE DataSize MOD 4 # 0 DO
-        CHL.PushByte(IL.codes.data, 0);
-        INC(DataSize)
-    END;
-    BssAdr := DataAdr + DataSize - Target.sram.startReserve;
+        DataAdr := Target.sram.start + Target.sram.startReserve;
+        DataSize := CHL.Length(IL.codes.data) + tcount * 4 + Target.sram.startReserve;
+        WHILE DataSize MOD 4 # 0 DO
+            CHL.PushByte(IL.codes.data, 0);
+            INC(DataSize)
+        END;
+        BssAdr := DataAdr + DataSize - Target.sram.startReserve;
 
-    IL.set_bss(MAX(IL.codes.bss, MAX(IL.codes.dmin - CHL.Length(IL.codes.data), 4)));
+        IL.set_bss(MAX(IL.codes.bss, MAX(IL.codes.dmin - CHL.Length(IL.codes.data), 4)));
 
-    BssSize := IL.codes.bss;
-    ASSERT(UTILS.Align(BssSize, 4));
+        BssSize := IL.codes.bss;
+        ASSERT(UTILS.Align(BssSize, 4));
 
-    prolog(BssSize, tcount, ORD(opt.pic), Target.sram.start + Target.sram.size - Target.sram.endReserve, Target.IVTLen);
-    translate(ORD(opt.pic), tcount * 4);
-    epilog;
+        prolog(BssSize, tcount, ORD(opt.pic), Target.sram.start + Target.sram.size - Target.sram.endReserve, Target.IVTLen);
+        translate(ORD(opt.pic), tcount * 4);
+        epilog;
 
-    fixup(Target.flash.start, DataAdr, BssAdr);
+        fixup(Target.flash.start, DataAdr, BssAdr);
 
-    INC(DataSize, BssSize);
-    CodeSize := CHL.Length(program.code);
+        INC(DataSize, BssSize);
+        CodeSize := CHL.Length(program.code);
 
-    IF CodeSize > Target.flash.size - Target.flash.endReserve THEN
-        ERRORS.Error(203)
-    END;
+        IF CodeSize > Target.flash.size - Target.flash.endReserve THEN
+            ERRORS.Error(203)
+        END;
 
-    IF DataSize > Target.sram.size - Target.MinStkSize - Target.sram.endReserve THEN
-        ERRORS.Error(204)
-    END;
+        IF DataSize > Target.sram.size - Target.MinStkSize - Target.sram.endReserve THEN
+            ERRORS.Error(204)
+        END;
 
-    IF Target.isNXP THEN
-        BIN.put32le(program.code, 2FCH, 0H); (* code read protection (CRP) *)
-        (* NXP checksum *)
-        j := 0;
-        FOR i := 0 TO 6 DO
-            INC(j, BIN.get32le(program.code, i * 4))
+        IF Target.isNXP THEN
+            BIN.put32le(program.code, 2FCH, 0H); (* code read protection (CRP) *)
+            (* NXP checksum *)
+            j := 0;
+            FOR i := 0 TO 6 DO
+                INC(j, BIN.get32le(program.code, i * 4))
+            END;
+            BIN.put32le(program.code, 1CH, -j)
         END;
-        BIN.put32le(program.code, 1CH, -j)
-    END;
 
-    WR.Create(outname);
+        WR.Create(outname);
 
-    HEX.Data2(program.code, 0, CodeSize, high(Target.flash.start));
-    HEX.End;
+        HEX.Data2(program.code, 0, CodeSize, high(Target.flash.start));
+        HEX.End;
 
-    WR.Close;
+        WR.Close;
 
-    C.Dashes;
-    C.String(  "  rom:  "); C.Int(CodeSize); C.String(" of "); C.Int(Target.flash.size - Target.flash.endReserve);
-        C.String("  ("); C.Int(CodeSize * 100 DIV (Target.flash.size - Target.flash.endReserve)); C.StringLn("%)");
-    C.Ln;
-    C.String(  "  ram:  "); C.Int(DataSize); C.String(" of "); C.Int(Target.sram.size - Target.sram.endReserve);
-        C.String("  ("); C.Int(DataSize * 100 DIV (Target.sram.size - Target.sram.endReserve)); C.StringLn("%)")
-END CodeGen;
+        C.Dashes;
+        C.String(  "  rom:  "); C.Int(CodeSize); C.String(" of "); C.Int(Target.flash.size - Target.flash.endReserve);
+            C.String("  ("); C.Int(CodeSize * 100 DIV (Target.flash.size - Target.flash.endReserve)); C.StringLn("%)");
+        C.Ln;
+        C.String(  "  ram:  "); C.Int(DataSize); C.String(" of "); C.Int(Target.sram.size - Target.sram.endReserve);
+            C.String("  ("); C.Int(DataSize * 100 DIV (Target.sram.size - Target.sram.endReserve)); C.StringLn("%)")
+    END CodeGen;
 
 
 PROCEDURE SetIV* (idx: INTEGER): BOOLEAN;
-VAR
-    res: BOOLEAN;
+    VAR
+        res: BOOLEAN;
 
-BEGIN
-    res := IVT[idx] = 0;
-    IVT[idx] := 1
+    BEGIN
+        res := IVT[idx] = 0;
+        IVT[idx] := 1
 
-    RETURN res
-END SetIV;
+        RETURN res
+    END SetIV;
 
 
 PROCEDURE init;
-VAR
-    i: INTEGER;
+    VAR
+        i: INTEGER;
 
-BEGIN
-    FOR i := 0 TO LEN(IVT) - 1 DO
-        IVT[i] := 0
-    END
-END init;
+    BEGIN
+        FOR i := 0 TO LEN(IVT) - 1 DO
+            IVT[i] := 0
+        END
+    END init;
 
 
 BEGIN

+ 87 - 94
source/UTILS.ob07

@@ -1,11 +1,4 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2018-2023, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE UTILS;
+MODULE UTILS;
 
 IMPORT HOST;
 
@@ -56,158 +49,158 @@ VAR
 
 
 PROCEDURE FileRead* (F: INTEGER; VAR Buffer: ARRAY OF CHAR; bytes: INTEGER): INTEGER;
-    RETURN HOST.FileRead(F, Buffer, bytes)
-END FileRead;
+        RETURN HOST.FileRead(F, Buffer, bytes)
+    END FileRead;
 
 
 PROCEDURE FileWrite* (F: INTEGER; Buffer: ARRAY OF BYTE; bytes: INTEGER): INTEGER;
-    RETURN HOST.FileWrite(F, Buffer, bytes)
-END FileWrite;
+        RETURN HOST.FileWrite(F, Buffer, bytes)
+    END FileWrite;
 
 
 PROCEDURE FileCreate* (FName: ARRAY OF CHAR): INTEGER;
-    RETURN HOST.FileCreate(FName)
-END FileCreate;
+        RETURN HOST.FileCreate(FName)
+    END FileCreate;
 
 
 PROCEDURE FileClose* (F: INTEGER);
-BEGIN
-    HOST.FileClose(F)
-END FileClose;
+    BEGIN
+        HOST.FileClose(F)
+    END FileClose;
 
 
 PROCEDURE FileOpen* (FName: ARRAY OF CHAR): INTEGER;
-    RETURN HOST.FileOpen(FName)
-END FileOpen;
+        RETURN HOST.FileOpen(FName)
+    END FileOpen;
 
 
 PROCEDURE chmod* (FName: ARRAY OF CHAR);
-BEGIN
-    HOST.chmod(FName)
-END chmod;
+    BEGIN
+        HOST.chmod(FName)
+    END chmod;
 
 
 PROCEDURE GetArg* (i: INTEGER; VAR str: ARRAY OF CHAR);
-BEGIN
-    HOST.GetArg(i, str)
-END GetArg;
+    BEGIN
+        HOST.GetArg(i, str)
+    END GetArg;
 
 
 PROCEDURE Exit* (code: INTEGER);
-BEGIN
-    HOST.ExitProcess(code)
-END Exit;
+    BEGIN
+        HOST.ExitProcess(code)
+    END Exit;
 
 
 PROCEDURE GetTickCount* (): INTEGER;
-    RETURN HOST.GetTickCount()
-END GetTickCount;
+        RETURN HOST.GetTickCount()
+    END GetTickCount;
 
 
 PROCEDURE OutChar* (c: CHAR);
-BEGIN
-    HOST.OutChar(c)
-END OutChar;
+    BEGIN
+        HOST.OutChar(c)
+    END OutChar;
 
 
 PROCEDURE splitf* (x: REAL; VAR a, b: INTEGER): INTEGER;
-    RETURN HOST.splitf(x, a, b)
-END splitf;
+        RETURN HOST.splitf(x, a, b)
+    END splitf;
 
 
 PROCEDURE d2s* (x: REAL): INTEGER;
-    RETURN HOST.d2s(x)
-END d2s;
+        RETURN HOST.d2s(x)
+    END d2s;
 
 
 PROCEDURE isRelative* (path: ARRAY OF CHAR): BOOLEAN;
-    RETURN HOST.isRelative(path)
-END isRelative;
+        RETURN HOST.isRelative(path)
+    END isRelative;
 
 
 PROCEDURE GetCurrentDirectory* (VAR path: ARRAY OF CHAR);
-BEGIN
-    HOST.GetCurrentDirectory(path)
-END GetCurrentDirectory;
+    BEGIN
+        HOST.GetCurrentDirectory(path)
+    END GetCurrentDirectory;
 
 
 PROCEDURE UnixTime* (): INTEGER;
-    RETURN HOST.UnixTime()
-END UnixTime;
+        RETURN HOST.UnixTime()
+    END UnixTime;
 
 
 PROCEDURE SetBitDepth* (BitDepth: INTEGER; Double: BOOLEAN);
-BEGIN
-    ASSERT((BitDepth = 16) OR (BitDepth = 32) OR (BitDepth = 64));
-    bit_diff := bit_depth - BitDepth;
-    ASSERT(bit_diff >= 0);
-
-    target.bit_depth := BitDepth;
-    target.maxSet    := BitDepth - 1;
-    target.maxHex    := BitDepth DIV 4;
-    target.minInt    := ASR(minint, bit_diff);
-    target.maxInt    := ASR(maxint, bit_diff);
-
-    IF Double THEN
-        target.maxReal := maxreal
-    ELSE
-        target.maxReal := 1.9;
-        PACK(target.maxReal, 127)
-    END
-END SetBitDepth;
+    BEGIN
+        ASSERT((BitDepth = 16) OR (BitDepth = 32) OR (BitDepth = 64));
+        bit_diff := bit_depth - BitDepth;
+        ASSERT(bit_diff >= 0);
+
+        target.bit_depth := BitDepth;
+        target.maxSet    := BitDepth - 1;
+        target.maxHex    := BitDepth DIV 4;
+        target.minInt    := ASR(minint, bit_diff);
+        target.maxInt    := ASR(maxint, bit_diff);
+
+        IF Double THEN
+            target.maxReal := maxreal
+        ELSE
+            target.maxReal := 1.9;
+            PACK(target.maxReal, 127)
+        END
+    END SetBitDepth;
 
 
 PROCEDURE Byte* (n: INTEGER; idx: INTEGER): BYTE;
-    RETURN ASR(n, 8 * idx) MOD 256
-END Byte;
+        RETURN ASR(n, 8 * idx) MOD 256
+    END Byte;
 
 
 PROCEDURE Align* (VAR bytes: INTEGER; align: INTEGER): BOOLEAN;
-BEGIN
-    INC(bytes, (-bytes) MOD align)
-    RETURN bytes >= 0
-END Align;
+    BEGIN
+        INC(bytes, (-bytes) MOD align)
+        RETURN bytes >= 0
+    END Align;
 
 
 PROCEDURE Long* (value: INTEGER): INTEGER;
-    RETURN ASR(LSL(value, bit_diff), bit_diff)
-END Long;
+        RETURN ASR(LSL(value, bit_diff), bit_diff)
+    END Long;
 
 
 PROCEDURE Short* (value: INTEGER): INTEGER;
-    RETURN LSR(LSL(value, bit_diff), bit_diff)
-END Short;
+        RETURN LSR(LSL(value, bit_diff), bit_diff)
+    END Short;
 
 
 PROCEDURE Log2* (x: INTEGER): INTEGER;
-VAR
-    n: INTEGER;
+    VAR
+        n: INTEGER;
 
-BEGIN
-    n := 0;
-    WHILE ~ODD(x) DO
-        x := x DIV 2;
-        INC(n)
-    END;
+    BEGIN
+        n := 0;
+        WHILE ~ODD(x) DO
+            x := x DIV 2;
+            INC(n)
+        END;
 
-    IF x # 1 THEN
-        n := -1
-    END
+        IF x # 1 THEN
+            n := -1
+        END
 
-    RETURN n
-END Log2;
+        RETURN n
+    END Log2;
 
 
 PROCEDURE hexdgt* (n: BYTE): BYTE;
-BEGIN
-    IF n < 10 THEN
-        INC(n, ORD("0"))
-    ELSE
-        INC(n, ORD("A") - 10)
-    END
-
-    RETURN n
-END hexdgt;
+    BEGIN
+        IF n < 10 THEN
+            INC(n, ORD("0"))
+        ELSE
+            INC(n, ORD("A") - 10)
+        END
+
+        RETURN n
+    END hexdgt;
 
 
 BEGIN

+ 55 - 62
source/WRITER.ob07

@@ -1,11 +1,4 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2018-2021, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE WRITER;
+MODULE WRITER;
 
 IMPORT FILES, ERRORS, UTILS;
 
@@ -17,88 +10,88 @@ VAR
 
 
 PROCEDURE align* (n, _align: INTEGER): INTEGER;
-BEGIN
-    ASSERT(UTILS.Align(n, _align))
-    RETURN n
-END align;
+    BEGIN
+        ASSERT(UTILS.Align(n, _align))
+        RETURN n
+    END align;
 
 
 PROCEDURE WriteByte* (n: BYTE);
-BEGIN
-    IF FILES.WriteByte(file, n) THEN
-        INC(counter)
-    ELSE
-        ERRORS.Error(201)
-    END
-END WriteByte;
+    BEGIN
+        IF FILES.WriteByte(file, n) THEN
+            INC(counter)
+        ELSE
+            ERRORS.Error(201)
+        END
+    END WriteByte;
 
 
 PROCEDURE Write* (chunk: ARRAY OF BYTE; bytes: INTEGER);
-VAR
-    n: INTEGER;
+    VAR
+        n: INTEGER;
 
-BEGIN
-    n := FILES.write(file, chunk, bytes);
-    IF n # bytes THEN
-        ERRORS.Error(201)
-    END;
-    INC(counter, n)
-END Write;
+    BEGIN
+        n := FILES.write(file, chunk, bytes);
+        IF n # bytes THEN
+            ERRORS.Error(201)
+        END;
+        INC(counter, n)
+    END Write;
 
 
 PROCEDURE Write64LE* (n: INTEGER);
-VAR
-    i: INTEGER;
+    VAR
+        i: INTEGER;
 
-BEGIN
-    FOR i := 0 TO 7 DO
-        WriteByte(UTILS.Byte(n, i))
-    END
-END Write64LE;
+    BEGIN
+        FOR i := 0 TO 7 DO
+            WriteByte(UTILS.Byte(n, i))
+        END
+    END Write64LE;
 
 
 PROCEDURE Write32LE* (n: INTEGER);
-VAR
-    i: INTEGER;
+    VAR
+        i: INTEGER;
 
-BEGIN
-    FOR i := 0 TO 3 DO
-        WriteByte(UTILS.Byte(n, i))
-    END
-END Write32LE;
+    BEGIN
+        FOR i := 0 TO 3 DO
+            WriteByte(UTILS.Byte(n, i))
+        END
+    END Write32LE;
 
 
 PROCEDURE Write16LE* (n: INTEGER);
-BEGIN
-    WriteByte(UTILS.Byte(n, 0));
-    WriteByte(UTILS.Byte(n, 1))
-END Write16LE;
+    BEGIN
+        WriteByte(UTILS.Byte(n, 0));
+        WriteByte(UTILS.Byte(n, 1))
+    END Write16LE;
 
 
 PROCEDURE Padding* (FileAlignment: INTEGER);
-VAR
-    i: INTEGER;
+    VAR
+        i: INTEGER;
 
-BEGIN
-    i := align(counter, FileAlignment) - counter;
-    WHILE i > 0 DO
-        WriteByte(0);
-        DEC(i)
-    END
-END Padding;
+    BEGIN
+        i := align(counter, FileAlignment) - counter;
+        WHILE i > 0 DO
+            WriteByte(0);
+            DEC(i)
+        END
+    END Padding;
 
 
 PROCEDURE Create* (FileName: ARRAY OF CHAR);
-BEGIN
-    counter := 0;
-    file := FILES.create(FileName)
-END Create;
+    BEGIN
+        counter := 0;
+        file := FILES.create(FileName)
+    END Create;
 
 
 PROCEDURE Close*;
-BEGIN
-    FILES.close(file)
-END Close;
+    BEGIN
+        FILES.close(file)
+    END Close;
 
 
 END WRITER.

+ 1963 - 1970
source/X86.ob07

@@ -1,11 +1,4 @@
-(*
-    BSD 2-Clause License
-
-    Copyright (c) 2018-2023, Anton Krotov
-    All rights reserved.
-*)
-
-MODULE X86;
+MODULE X86;
 
 IMPORT IL, REG, UTILS, LISTS, BIN, PE32, KOS, MSCOFF, ELF, PROG,
        CHL := CHUNKLISTS, PATHS, TARGETS, ERRORS;
@@ -104,2442 +97,2442 @@ VAR
 
 
 PROCEDURE OutByte* (n: BYTE);
-VAR
-    c: CODE;
-    last: ANYCODE;
+    VAR
+        c: CODE;
+        last: ANYCODE;
 
-BEGIN
-    last := CodeList.last(ANYCODE);
+    BEGIN
+        last := CodeList.last(ANYCODE);
 
-    IF (last IS CODE) & (last(CODE).length < CODECHUNK) THEN
-        c := last(CODE);
-        c.code[c.length] := n;
-        INC(c.length)
-    ELSE
-        NEW(c);
-        c.code[0] := n;
-        c.length  := 1;
-        LISTS.push(CodeList, c)
-    END
+        IF (last IS CODE) & (last(CODE).length < CODECHUNK) THEN
+            c := last(CODE);
+            c.code[c.length] := n;
+            INC(c.length)
+        ELSE
+            NEW(c);
+            c.code[0] := n;
+            c.length  := 1;
+            LISTS.push(CodeList, c)
+        END
 
-END OutByte;
+    END OutByte;
 
 
 PROCEDURE OutInt (n: INTEGER);
-BEGIN
-    OutByte(n MOD 256);
-    OutByte(UTILS.Byte(n, 1));
-    OutByte(UTILS.Byte(n, 2));
-    OutByte(UTILS.Byte(n, 3))
-END OutInt;
+    BEGIN
+        OutByte(n MOD 256);
+        OutByte(UTILS.Byte(n, 1));
+        OutByte(UTILS.Byte(n, 2));
+        OutByte(UTILS.Byte(n, 3))
+    END OutInt;
 
 
 PROCEDURE OutByte2 (a, b: BYTE);
-BEGIN
-    OutByte(a);
-    OutByte(b)
-END OutByte2;
+    BEGIN
+        OutByte(a);
+        OutByte(b)
+    END OutByte2;
 
 
 PROCEDURE OutByte3 (a, b, c: BYTE);
-BEGIN
-    OutByte(a);
-    OutByte(b);
-    OutByte(c)
-END OutByte3;
+    BEGIN
+        OutByte(a);
+        OutByte(b);
+        OutByte(c)
+    END OutByte3;
 
 
 PROCEDURE OutWord (n: INTEGER);
-BEGIN
-    ASSERT((0 <= n) & (n <= 65535));
-    OutByte2(n MOD 256, n DIV 256)
-END OutWord;
+    BEGIN
+        ASSERT((0 <= n) & (n <= 65535));
+        OutByte2(n MOD 256, n DIV 256)
+    END OutWord;
 
 
 PROCEDURE isByte* (n: INTEGER): BOOLEAN;
-    RETURN (-128 <= n) & (n <= 127)
-END isByte;
+        RETURN (-128 <= n) & (n <= 127)
+    END isByte;
 
 
 PROCEDURE short (n: INTEGER): INTEGER;
-    RETURN 2 * ORD(isByte(n))
-END short;
+        RETURN 2 * ORD(isByte(n))
+    END short;
 
 
 PROCEDURE long (n: INTEGER): INTEGER;
-    RETURN 40H * ORD(~isByte(n))
-END long;
+        RETURN 40H * ORD(~isByte(n))
+    END long;
 
 
 PROCEDURE OutIntByte (n: INTEGER);
-BEGIN
-    IF isByte(n) THEN
-        OutByte(n MOD 256)
-    ELSE
-        OutInt(n)
-    END
-END OutIntByte;
+    BEGIN
+        IF isByte(n) THEN
+            OutByte(n MOD 256)
+        ELSE
+            OutInt(n)
+        END
+    END OutIntByte;
 
 
 PROCEDURE shift* (op, reg: INTEGER);
-BEGIN
-    CASE op OF
-    |IL.opASR, IL.opASR1, IL.opASR2: OutByte(0F8H + reg)
-    |IL.opROR, IL.opROR1, IL.opROR2: OutByte(0C8H + reg)
-    |IL.opLSL, IL.opLSL1, IL.opLSL2: OutByte(0E0H + reg)
-    |IL.opLSR, IL.opLSR1, IL.opLSR2: OutByte(0E8H + reg)
-    END
-END shift;
+    BEGIN
+        CASE op OF
+        |IL.opASR, IL.opASR1, IL.opASR2: OutByte(0F8H + reg)
+        |IL.opROR, IL.opROR1, IL.opROR2: OutByte(0C8H + reg)
+        |IL.opLSL, IL.opLSL1, IL.opLSL2: OutByte(0E0H + reg)
+        |IL.opLSR, IL.opLSR1, IL.opLSR2: OutByte(0E8H + reg)
+        END
+    END shift;
 
 
 PROCEDURE oprr (op: BYTE; reg1, reg2: INTEGER); (* op reg1, reg2 *)
-BEGIN
-    OutByte2(op, 0C0H + 8 * reg2 + reg1)
-END oprr;
+    BEGIN
+        OutByte2(op, 0C0H + 8 * reg2 + reg1)
+    END oprr;
 
 
 PROCEDURE mov (reg1, reg2: INTEGER); (* mov reg1, reg2 *)
-BEGIN
-    oprr(89H, reg1, reg2)
-END mov;
+    BEGIN
+        oprr(89H, reg1, reg2)
+    END mov;
 
 
 PROCEDURE xchg (reg1, reg2: INTEGER); (* xchg reg1, reg2 *)
-BEGIN
-    IF eax IN {reg1, reg2} THEN
-        OutByte(90H + reg1 + reg2)
-    ELSE
-        oprr(87H, reg1, reg2)
-    END
-END xchg;
+    BEGIN
+        IF eax IN {reg1, reg2} THEN
+            OutByte(90H + reg1 + reg2)
+        ELSE
+            oprr(87H, reg1, reg2)
+        END
+    END xchg;
 
 
 PROCEDURE pop (reg: INTEGER);
-BEGIN
-    OutByte(58H + reg) (* pop reg *)
-END pop;
+    BEGIN
+        OutByte(58H + reg) (* pop reg *)
+    END pop;
 
 
 PROCEDURE push (reg: INTEGER);
-BEGIN
-    OutByte(50H + reg) (* push reg *)
-END push;
+    BEGIN
+        OutByte(50H + reg) (* push reg *)
+    END push;
 
 
 PROCEDURE xor (reg1, reg2: INTEGER); (* xor reg1, reg2 *)
-BEGIN
-    oprr(31H, reg1, reg2)
-END xor;
+    BEGIN
+        oprr(31H, reg1, reg2)
+    END xor;
 
 
 PROCEDURE movrc (reg, n: INTEGER);
-BEGIN
-    IF n = 0 THEN
-        xor(reg, reg)
-    ELSE
-        OutByte(0B8H + reg); (* mov reg, n *)
-        OutInt(n)
-    END
-END movrc;
+    BEGIN
+        IF n = 0 THEN
+            xor(reg, reg)
+        ELSE
+            OutByte(0B8H + reg); (* mov reg, n *)
+            OutInt(n)
+        END
+    END movrc;
 
 
 PROCEDURE pushc* (n: INTEGER);
-BEGIN
-    OutByte(68H + short(n)); (* push n *)
-    OutIntByte(n)
-END pushc;
+    BEGIN
+        OutByte(68H + short(n)); (* push n *)
+        OutIntByte(n)
+    END pushc;
 
 
 PROCEDURE test (reg: INTEGER);
-BEGIN
-    OutByte2(85H, 0C0H + reg * 9)  (* test reg, reg *)
-END test;
+    BEGIN
+        OutByte2(85H, 0C0H + reg * 9)  (* test reg, reg *)
+    END test;
 
 
 PROCEDURE neg (reg: INTEGER);
-BEGIN
-    OutByte2(0F7H, 0D8H + reg)  (* neg reg *)
-END neg;
+    BEGIN
+        OutByte2(0F7H, 0D8H + reg)  (* neg reg *)
+    END neg;
 
 
 PROCEDURE not (reg: INTEGER);
-BEGIN
-    OutByte2(0F7H, 0D0H + reg)  (* not reg *)
-END not;
+    BEGIN
+        OutByte2(0F7H, 0D0H + reg)  (* not reg *)
+    END not;
 
 
 PROCEDURE add (reg1, reg2: INTEGER); (* add reg1, reg2 *)
-BEGIN
-    oprr(01H, reg1, reg2)
-END add;
+    BEGIN
+        oprr(01H, reg1, reg2)
+    END add;
 
 
 PROCEDURE oprc* (op, reg, n: INTEGER);
-BEGIN
-    IF (reg = eax) & ~isByte(n) THEN
-        CASE op OF
-        |0C0H: op := 05H (* add *)
-        |0E8H: op := 2DH (* sub *)
-        |0F8H: op := 3DH (* cmp *)
-        |0E0H: op := 25H (* and *)
-        |0C8H: op := 0DH (* or  *)
-        |0F0H: op := 35H (* xor *)
-        END;
-        OutByte(op);
-        OutInt(n)
-    ELSE
-        OutByte2(81H + short(n), op + reg MOD 8);
-        OutIntByte(n)
-    END
-END oprc;
+    BEGIN
+        IF (reg = eax) & ~isByte(n) THEN
+            CASE op OF
+            |0C0H: op := 05H (* add *)
+            |0E8H: op := 2DH (* sub *)
+            |0F8H: op := 3DH (* cmp *)
+            |0E0H: op := 25H (* and *)
+            |0C8H: op := 0DH (* or  *)
+            |0F0H: op := 35H (* xor *)
+            END;
+            OutByte(op);
+            OutInt(n)
+        ELSE
+            OutByte2(81H + short(n), op + reg MOD 8);
+            OutIntByte(n)
+        END
+    END oprc;
 
 
 PROCEDURE andrc (reg, n: INTEGER); (* and reg, n *)
-BEGIN
-    oprc(0E0H, reg, n)
-END andrc;
+    BEGIN
+        oprc(0E0H, reg, n)
+    END andrc;
 
 
 PROCEDURE orrc (reg, n: INTEGER); (* or reg, n *)
-BEGIN
-    oprc(0C8H, reg, n)
-END orrc;
+    BEGIN
+        oprc(0C8H, reg, n)
+    END orrc;
 
 
 PROCEDURE xorrc (reg, n: INTEGER); (* xor reg, n *)
-BEGIN
-    oprc(0F0H, reg, n)
-END xorrc;
+    BEGIN
+        oprc(0F0H, reg, n)
+    END xorrc;
 
 
 PROCEDURE addrc (reg, n: INTEGER); (* add reg, n *)
-BEGIN
-    oprc(0C0H, reg, n)
-END addrc;
+    BEGIN
+        oprc(0C0H, reg, n)
+    END addrc;
 
 
 PROCEDURE subrc (reg, n: INTEGER); (* sub reg, n *)
-BEGIN
-    oprc(0E8H, reg, n)
-END subrc;
+    BEGIN
+        oprc(0E8H, reg, n)
+    END subrc;
 
 
 PROCEDURE cmprc (reg, n: INTEGER); (* cmp reg, n *)
-BEGIN
-    IF n = 0 THEN
-        test(reg)
-    ELSE
-        oprc(0F8H, reg, n)
-    END
-END cmprc;
+    BEGIN
+        IF n = 0 THEN
+            test(reg)
+        ELSE
+            oprc(0F8H, reg, n)
+        END
+    END cmprc;
 
 
 PROCEDURE cmprr (reg1, reg2: INTEGER); (* cmp reg1, reg2 *)
-BEGIN
-    oprr(39H, reg1, reg2)
-END cmprr;
+    BEGIN
+        oprr(39H, reg1, reg2)
+    END cmprr;
 
 
 PROCEDURE setcc* (cc, reg: INTEGER); (* setcc reg *)
-BEGIN
-    IF reg >= 8 THEN
-        OutByte(41H)
-    END;
-    OutByte3(0FH, cc, 0C0H + reg MOD 8)
-END setcc;
+    BEGIN
+        IF reg >= 8 THEN
+            OutByte(41H)
+        END;
+        OutByte3(0FH, cc, 0C0H + reg MOD 8)
+    END setcc;
 
 
 PROCEDURE ret*;
-BEGIN
-    OutByte(0C3H)
-END ret;
+    BEGIN
+        OutByte(0C3H)
+    END ret;
 
 
 PROCEDURE drop;
-BEGIN
-    REG.Drop(R)
-END drop;
+    BEGIN
+        REG.Drop(R)
+    END drop;
 
 
 PROCEDURE GetAnyReg (): INTEGER;
-    RETURN REG.GetAnyReg(R)
-END GetAnyReg;
+        RETURN REG.GetAnyReg(R)
+    END GetAnyReg;
 
 
 PROCEDURE cond* (op: INTEGER): INTEGER;
-VAR
-    res: INTEGER;
+    VAR
+        res: INTEGER;
 
-BEGIN
-    CASE op OF
-    |IL.opGT, IL.opGTC: res := jg
-    |IL.opGE, IL.opGEC: res := jge
-    |IL.opLT, IL.opLTC: res := jl
-    |IL.opLE, IL.opLEC: res := jle
-    |IL.opEQ, IL.opEQC: res := je
-    |IL.opNE, IL.opNEC: res := jne
-    END
+    BEGIN
+        CASE op OF
+        |IL.opGT, IL.opGTC: res := jg
+        |IL.opGE, IL.opGEC: res := jge
+        |IL.opLT, IL.opLTC: res := jl
+        |IL.opLE, IL.opLEC: res := jle
+        |IL.opEQ, IL.opEQC: res := je
+        |IL.opNE, IL.opNEC: res := jne
+        END
 
-    RETURN res
-END cond;
+        RETURN res
+    END cond;
 
 
 PROCEDURE inv0* (op: INTEGER): INTEGER;
-    RETURN ORD(BITS(op) / {0})
-END inv0;
+        RETURN ORD(BITS(op) / {0})
+    END inv0;
 
 
 PROCEDURE Reloc* (op, value: INTEGER);
-VAR
-    reloc: RELOC;
+    VAR
+        reloc: RELOC;
 
-BEGIN
-    NEW(reloc);
-    reloc.op := op;
-    reloc.value := value;
-    LISTS.push(CodeList, reloc)
-END Reloc;
+    BEGIN
+        NEW(reloc);
+        reloc.op := op;
+        reloc.value := value;
+        LISTS.push(CodeList, reloc)
+    END Reloc;
 
 
 PROCEDURE PushFlt (label: LABEL; value: REAL);
-VAR
-    a, b, n: INTEGER;
+    VAR
+        a, b, n: INTEGER;
 
 
-    PROCEDURE pushImm (label: LABEL; value: INTEGER);
-    VAR
-        c: CODE;
-        i: INTEGER;
+        PROCEDURE pushImm (label: LABEL; value: INTEGER);
+        VAR
+            c: CODE;
+            i: INTEGER;
 
-    BEGIN
-        NEW(c);
-        IF isByte(value) THEN
-            c.code[0] := 6AH;
-            c.code[1] := value MOD 256;
-            c.length := 2
-        ELSE
-            c.code[0] := 68H;
-            FOR i := 1 TO 4 DO
-                c.code[i] := UTILS.Byte(value, i - 1)
+        BEGIN
+            NEW(c);
+            IF isByte(value) THEN
+                c.code[0] := 6AH;
+                c.code[1] := value MOD 256;
+                c.length := 2
+            ELSE
+                c.code[0] := 68H;
+                FOR i := 1 TO 4 DO
+                    c.code[i] := UTILS.Byte(value, i - 1)
+                END;
+                c.length := 5
             END;
-            c.length := 5
-        END;
-        LISTS.insertL(CodeList, label, c)
-    END pushImm;
+            LISTS.insertL(CodeList, label, c)
+        END pushImm;
 
 
-BEGIN
-    n := UTILS.splitf(value, a, b);
-    pushImm(label, b);
-    pushImm(label, a)
-END PushFlt;
+    BEGIN
+        n := UTILS.splitf(value, a, b);
+        pushImm(label, b);
+        pushImm(label, a)
+    END PushFlt;
 
 
 PROCEDURE jcc* (cc, label: INTEGER);
-VAR
-    j: JCC;
+    VAR
+        j: JCC;
 
-BEGIN
-    NEW(j);
-    j.label := label;
-    j.jmp   := cc;
-    j.short := FALSE;
-    LISTS.push(CodeList, j)
-END jcc;
+    BEGIN
+        NEW(j);
+        j.label := label;
+        j.jmp   := cc;
+        j.short := FALSE;
+        LISTS.push(CodeList, j)
+    END jcc;
 
 
 PROCEDURE jmp* (label: INTEGER);
-VAR
-    j: JMP;
+    VAR
+        j: JMP;
 
-BEGIN
-    NEW(j);
-    j.label := label;
-    j.short := FALSE;
-    LISTS.push(CodeList, j)
-END jmp;
+    BEGIN
+        NEW(j);
+        j.label := label;
+        j.short := FALSE;
+        LISTS.push(CodeList, j)
+    END jmp;
 
 
 PROCEDURE call* (label: INTEGER);
-VAR
-    c: CALL;
+    VAR
+        c: CALL;
 
-BEGIN
-    NEW(c);
-    c.label := label;
-    c.short := TRUE;
-    LISTS.push(CodeList, c)
-END call;
+    BEGIN
+        NEW(c);
+        c.label := label;
+        c.short := TRUE;
+        LISTS.push(CodeList, c)
+    END call;
 
 
 PROCEDURE Pic (reg, opcode, value: INTEGER);
-BEGIN
-    OutByte(0E8H); OutInt(0); (* call L
-                                 L: *)
-    pop(reg);
-    OutByte2(081H, 0C0H + reg);  (* add reg, ... *)
-    Reloc(opcode, value)
-END Pic;
+    BEGIN
+        OutByte(0E8H); OutInt(0); (* call L
+                                    L: *)
+        pop(reg);
+        OutByte2(081H, 0C0H + reg);  (* add reg, ... *)
+        Reloc(opcode, value)
+    END Pic;
 
 
 PROCEDURE CallRTL (pic: BOOLEAN; proc: INTEGER);
-VAR
-    label: INTEGER;
-    reg1:  INTEGER;
+    VAR
+        label: INTEGER;
+        reg1:  INTEGER;
 
-BEGIN
-    label := IL.codes.rtl[proc];
+    BEGIN
+        label := IL.codes.rtl[proc];
 
-    IF label < 0 THEN
-        label := -label;
-        IF pic THEN
-            reg1 := GetAnyReg();
-            Pic(reg1, BIN.PICIMP, label);
-            OutByte2(0FFH, 010H + reg1);  (* call dword[reg1] *)
-            drop
+        IF label < 0 THEN
+            label := -label;
+            IF pic THEN
+                reg1 := GetAnyReg();
+                Pic(reg1, BIN.PICIMP, label);
+                OutByte2(0FFH, 010H + reg1);  (* call dword[reg1] *)
+                drop
+            ELSE
+                OutByte2(0FFH, 015H);  (* call dword[label] *)
+                Reloc(BIN.RIMP, label)
+            END
         ELSE
-            OutByte2(0FFH, 015H);  (* call dword[label] *)
-            Reloc(BIN.RIMP, label)
+            call(label)
         END
-    ELSE
-        call(label)
-    END
-END CallRTL;
+    END CallRTL;
 
 
 PROCEDURE SetLabel* (label: INTEGER);
-VAR
-    L: LABEL;
+    VAR
+        L: LABEL;
 
-BEGIN
-    NEW(L);
-    L.label := label;
-    LISTS.push(CodeList, L)
-END SetLabel;
+    BEGIN
+        NEW(L);
+        L.label := label;
+        LISTS.push(CodeList, L)
+    END SetLabel;
 
 
 PROCEDURE fixup*;
-VAR
-    code:      ANYCODE;
-    count, i:  INTEGER;
-    shorted:   BOOLEAN;
-    jump:      JUMP;
+    VAR
+        code:      ANYCODE;
+        count, i:  INTEGER;
+        shorted:   BOOLEAN;
+        jump:      JUMP;
 
-BEGIN
+    BEGIN
 
-    REPEAT
+        REPEAT
 
-        shorted := FALSE;
-        count := 0;
+            shorted := FALSE;
+            count := 0;
 
-        code := CodeList.first(ANYCODE);
-        WHILE code # NIL DO
-            code.offset := count;
+            code := CodeList.first(ANYCODE);
+            WHILE code # NIL DO
+                code.offset := count;
 
-            CASE code OF
-            |CODE:   INC(count, code.length)
-            |LABEL:  BIN.SetLabel(program, code.label, count)
-            |JMP:    IF code.short THEN INC(count, 2) ELSE INC(count, 5) END; code.offset := count
-            |JCC:    IF code.short THEN INC(count, 2) ELSE INC(count, 6) END; code.offset := count
-            |CALL:   INC(count, 5); code.offset := count
-            |RELOC:  INC(count, 4)
+                CASE code OF
+                |CODE:   INC(count, code.length)
+                |LABEL:  BIN.SetLabel(program, code.label, count)
+                |JMP:    IF code.short THEN INC(count, 2) ELSE INC(count, 5) END; code.offset := count
+                |JCC:    IF code.short THEN INC(count, 2) ELSE INC(count, 6) END; code.offset := count
+                |CALL:   INC(count, 5); code.offset := count
+                |RELOC:  INC(count, 4)
+                END;
+
+                code := code.next(ANYCODE)
             END;
 
-            code := code.next(ANYCODE)
-        END;
+            code := CodeList.first(ANYCODE);
+            WHILE code # NIL DO
 
-        code := CodeList.first(ANYCODE);
-        WHILE code # NIL DO
+                IF code IS JUMP THEN
+                    jump := code(JUMP);
+                    jump.diff := BIN.GetLabel(program, jump.label) - code.offset;
+                    IF ~jump.short & isByte(jump.diff) THEN
+                        jump.short := TRUE;
+                        shorted := TRUE
+                    END
+                END;
 
-            IF code IS JUMP THEN
-                jump := code(JUMP);
-                jump.diff := BIN.GetLabel(program, jump.label) - code.offset;
-                IF ~jump.short & isByte(jump.diff) THEN
-                    jump.short := TRUE;
-                    shorted := TRUE
-                END
-            END;
+                code := code.next(ANYCODE)
+            END
 
-            code := code.next(ANYCODE)
-        END
+        UNTIL ~shorted;
 
-    UNTIL ~shorted;
+        code := CodeList.first(ANYCODE);
+        WHILE code # NIL DO
 
-    code := CodeList.first(ANYCODE);
-    WHILE code # NIL DO
+            CASE code OF
 
-        CASE code OF
+            |CODE:
+                    FOR i := 0 TO code.length - 1 DO
+                        BIN.PutCode(program, code.code[i])
+                    END
 
-        |CODE:
-                FOR i := 0 TO code.length - 1 DO
-                    BIN.PutCode(program, code.code[i])
-                END
+            |LABEL:
 
-        |LABEL:
+            |JMP:
+                    IF code.short THEN
+                        BIN.PutCode(program, 0EBH);
+                        BIN.PutCode(program, code.diff MOD 256)
+                    ELSE
+                        BIN.PutCode(program, 0E9H);
+                        BIN.PutCode32LE(program, code.diff)
+                    END
 
-        |JMP:
-                IF code.short THEN
-                    BIN.PutCode(program, 0EBH);
-                    BIN.PutCode(program, code.diff MOD 256)
-                ELSE
-                    BIN.PutCode(program, 0E9H);
-                    BIN.PutCode32LE(program, code.diff)
-                END
+            |JCC:
+                    IF code.short THEN
+                        BIN.PutCode(program, code.jmp - 16);
+                        BIN.PutCode(program, code.diff MOD 256)
+                    ELSE
+                        BIN.PutCode(program, 0FH);
+                        BIN.PutCode(program, code.jmp);
+                        BIN.PutCode32LE(program, code.diff)
+                    END
 
-        |JCC:
-                IF code.short THEN
-                    BIN.PutCode(program, code.jmp - 16);
-                    BIN.PutCode(program, code.diff MOD 256)
-                ELSE
-                    BIN.PutCode(program, 0FH);
-                    BIN.PutCode(program, code.jmp);
+            |CALL:
+                    BIN.PutCode(program, 0E8H);
                     BIN.PutCode32LE(program, code.diff)
-                END
 
-        |CALL:
-                BIN.PutCode(program, 0E8H);
-                BIN.PutCode32LE(program, code.diff)
+            |RELOC:
+                    BIN.PutReloc(program, code.op);
+                    BIN.PutCode32LE(program, code.value)
 
-        |RELOC:
-                BIN.PutReloc(program, code.op);
-                BIN.PutCode32LE(program, code.value)
-
-        END;
+            END;
 
-        code := code.next(ANYCODE)
-    END
+            code := code.next(ANYCODE)
+        END
 
-END fixup;
+    END fixup;
 
 
 PROCEDURE UnOp (VAR reg: INTEGER);
-BEGIN
-    REG.UnOp(R, reg)
-END UnOp;
+    BEGIN
+        REG.UnOp(R, reg)
+    END UnOp;
 
 
 PROCEDURE BinOp (VAR reg1, reg2: INTEGER);
-BEGIN
-    REG.BinOp(R, reg1, reg2)
-END BinOp;
+    BEGIN
+        REG.BinOp(R, reg1, reg2)
+    END BinOp;
 
 
 PROCEDURE PushAll (NumberOfParameters: INTEGER);
-BEGIN
-    REG.PushAll(R);
-    DEC(R.pushed, NumberOfParameters)
-END PushAll;
+    BEGIN
+        REG.PushAll(R);
+        DEC(R.pushed, NumberOfParameters)
+    END PushAll;
 
 
 PROCEDURE NewLabel (): INTEGER;
-BEGIN
-    BIN.NewLabel(program)
-    RETURN IL.NewLabel()
-END NewLabel;
+    BEGIN
+        BIN.NewLabel(program)
+        RETURN IL.NewLabel()
+    END NewLabel;
 
 
 PROCEDURE GetRegA;
-BEGIN
-    ASSERT(REG.GetReg(R, eax))
-END GetRegA;
+    BEGIN
+        ASSERT(REG.GetReg(R, eax))
+    END GetRegA;
 
 
 PROCEDURE fcmp;
-BEGIN
-    GetRegA;
-    OutByte2(0DAH, 0E9H);       (* fucompp *)
-    OutByte3(09BH, 0DFH, 0E0H); (* fstsw ax *)
-    OutByte(09EH);              (* sahf *)
-    OutByte(0B8H); OutInt(0)    (* mov eax, 0 *)
-END fcmp;
+    BEGIN
+        GetRegA;
+        OutByte2(0DAH, 0E9H);       (* fucompp *)
+        OutByte3(09BH, 0DFH, 0E0H); (* fstsw ax *)
+        OutByte(09EH);              (* sahf *)
+        OutByte(0B8H); OutInt(0)    (* mov eax, 0 *)
+    END fcmp;
 
 
 PROCEDURE movzx* (reg1, reg2, offs: INTEGER; word: BOOLEAN); (* movzx reg1, byte/word[reg2 + offs] *)
-VAR
-    b: BYTE;
-
-BEGIN
-    OutByte2(0FH, 0B6H + ORD(word));
-    IF (offs = 0) & (reg2 # ebp) THEN
-        b := 0
-    ELSE
-        b := 40H + long(offs)
-    END;
-    OutByte(b + (reg1 MOD 8) * 8 + reg2 MOD 8);
-    IF reg2 = esp THEN
-        OutByte(24H)
-    END;
-    IF b # 0 THEN
-        OutIntByte(offs)
-    END
-END movzx;
+    VAR
+        b: BYTE;
+
+    BEGIN
+        OutByte2(0FH, 0B6H + ORD(word));
+        IF (offs = 0) & (reg2 # ebp) THEN
+            b := 0
+        ELSE
+            b := 40H + long(offs)
+        END;
+        OutByte(b + (reg1 MOD 8) * 8 + reg2 MOD 8);
+        IF reg2 = esp THEN
+            OutByte(24H)
+        END;
+        IF b # 0 THEN
+            OutIntByte(offs)
+        END
+    END movzx;
 
 
 PROCEDURE _movrm* (reg1, reg2, offs, size: INTEGER; mr: BOOLEAN);
-VAR
-    b: BYTE;
+    VAR
+        b: BYTE;
 
-BEGIN
-    IF size = 16 THEN
-        OutByte(66H)
-    END;
-    IF (reg1 >= 8) OR (reg2 >= 8) OR (size = 64) THEN
-        OutByte(40H + reg2 DIV 8 + 4 * (reg1 DIV 8) + 8 * ORD(size = 64))
-    END;
-    OutByte(8BH - 2 * ORD(mr) - ORD(size = 8));
-    IF (offs = 0) & (reg2 # ebp) THEN
-        b := 0
-    ELSE
-        b := 40H + long(offs)
-    END;
-    OutByte(b + (reg1 MOD 8) * 8 + reg2 MOD 8);
-    IF reg2 = esp THEN
-        OutByte(24H)
-    END;
-    IF b # 0 THEN
-        OutIntByte(offs)
-    END
-END _movrm;
+    BEGIN
+        IF size = 16 THEN
+            OutByte(66H)
+        END;
+        IF (reg1 >= 8) OR (reg2 >= 8) OR (size = 64) THEN
+            OutByte(40H + reg2 DIV 8 + 4 * (reg1 DIV 8) + 8 * ORD(size = 64))
+        END;
+        OutByte(8BH - 2 * ORD(mr) - ORD(size = 8));
+        IF (offs = 0) & (reg2 # ebp) THEN
+            b := 0
+        ELSE
+            b := 40H + long(offs)
+        END;
+        OutByte(b + (reg1 MOD 8) * 8 + reg2 MOD 8);
+        IF reg2 = esp THEN
+            OutByte(24H)
+        END;
+        IF b # 0 THEN
+            OutIntByte(offs)
+        END
+    END _movrm;
 
 
 PROCEDURE movmr (reg1, offs, reg2: INTEGER); (* mov dword[reg1+offs], reg2 *)
-BEGIN
-    _movrm(reg2, reg1, offs, 32, TRUE)
-END movmr;
+    BEGIN
+        _movrm(reg2, reg1, offs, 32, TRUE)
+    END movmr;
 
 
 PROCEDURE movrm (reg1, reg2, offs: INTEGER); (* mov reg1, dword[reg2 + offs] *)
-BEGIN
-    _movrm(reg1, reg2, offs, 32, FALSE)
-END movrm;
+    BEGIN
+        _movrm(reg1, reg2, offs, 32, FALSE)
+    END movrm;
 
 
 PROCEDURE movmr8* (reg1, offs, reg2: INTEGER); (* mov byte[reg1+offs], reg2_8 *)
-BEGIN
-    _movrm(reg2, reg1, offs, 8, TRUE)
-END movmr8;
+    BEGIN
+        _movrm(reg2, reg1, offs, 8, TRUE)
+    END movmr8;
 
 
 PROCEDURE movrm8* (reg1, reg2, offs: INTEGER); (* mov reg1_8, byte[reg2+offs] *)
-BEGIN
-    _movrm(reg1, reg2, offs, 8, FALSE)
-END movrm8;
+    BEGIN
+        _movrm(reg1, reg2, offs, 8, FALSE)
+    END movrm8;
 
 
 PROCEDURE movmr16* (reg1, offs, reg2: INTEGER); (* mov word[reg1+offs], reg2_16 *)
-BEGIN
-    _movrm(reg2, reg1, offs, 16, TRUE)
-END movmr16;
+    BEGIN
+        _movrm(reg2, reg1, offs, 16, TRUE)
+    END movmr16;
 
 
 PROCEDURE movrm16* (reg1, reg2, offs: INTEGER); (* mov reg1_16, word[reg2+offs] *)
-BEGIN
-    _movrm(reg1, reg2, offs, 16, FALSE)
-END movrm16;
+    BEGIN
+        _movrm(reg1, reg2, offs, 16, FALSE)
+    END movrm16;
 
 
 PROCEDURE pushm* (reg, offs: INTEGER); (* push qword[reg+offs] *)
-VAR
-    b: BYTE;
+    VAR
+        b: BYTE;
 
-BEGIN
-    IF reg >= 8 THEN
-        OutByte(41H)
-    END;
-    OutByte(0FFH);
-    IF (offs = 0) & (reg # ebp) THEN
-        b := 30H
-    ELSE
-        b := 70H + long(offs)
-    END;
-    OutByte(b + reg MOD 8);
-    IF reg = esp THEN
-        OutByte(24H)
-    END;
-    IF b # 30H THEN
-        OutIntByte(offs)
-    END
-END pushm;
+    BEGIN
+        IF reg >= 8 THEN
+            OutByte(41H)
+        END;
+        OutByte(0FFH);
+        IF (offs = 0) & (reg # ebp) THEN
+            b := 30H
+        ELSE
+            b := 70H + long(offs)
+        END;
+        OutByte(b + reg MOD 8);
+        IF reg = esp THEN
+            OutByte(24H)
+        END;
+        IF b # 30H THEN
+            OutIntByte(offs)
+        END
+    END pushm;
 
 
 PROCEDURE LoadFltConst (value: REAL);
-BEGIN
-    PushFlt(FltConstLabel, value);
-    INC(LocVarSize, 8);
-    IF FltConstLabel = mainFltConstLabel THEN
-        mainLocVarSize := LocVarSize
-    END;
-    OutByte2(0DDH, 045H + long(-LocVarSize)); (* fld qword[ebp - LocVarSize] *)
-    OutIntByte(-LocVarSize)
-END LoadFltConst;
+    BEGIN
+        PushFlt(FltConstLabel, value);
+        INC(LocVarSize, 8);
+        IF FltConstLabel = mainFltConstLabel THEN
+            mainLocVarSize := LocVarSize
+        END;
+        OutByte2(0DDH, 045H + long(-LocVarSize)); (* fld qword[ebp - LocVarSize] *)
+        OutIntByte(-LocVarSize)
+    END LoadFltConst;
 
 
 PROCEDURE translate (pic: BOOLEAN; stroffs, target: INTEGER);
-VAR
-    cmd, next: COMMAND;
-
-    reg1, reg2, reg3, fr: INTEGER;
-
-    n, a, label, cc: INTEGER;
+    VAR
+        cmd, next: COMMAND;
 
-    opcode, param1, param2: INTEGER;
+        reg1, reg2, reg3, fr: INTEGER;
 
-    float: REAL;
+        n, a, label, cc: INTEGER;
 
-BEGIN
-    cmd := IL.codes.commands.first(COMMAND);
+        opcode, param1, param2: INTEGER;
 
-    fr := -1;
+        float: REAL;
 
-    WHILE cmd # NIL DO
+    BEGIN
+        cmd := IL.codes.commands.first(COMMAND);
 
-        param1 := cmd.param1;
-        param2 := cmd.param2;
+        fr := -1;
 
-        opcode := cmd.opcode;
+        WHILE cmd # NIL DO
 
-        CASE opcode OF
+            param1 := cmd.param1;
+            param2 := cmd.param2;
 
-        |IL.opJMP:
-            jmp(param1)
+            opcode := cmd.opcode;
 
-        |IL.opCALL:
-            call(param1)
+            CASE opcode OF
 
-        |IL.opCALLI:
-            IF pic THEN
-                reg1 := GetAnyReg();
-                Pic(reg1, BIN.PICIMP, param1);
-                OutByte2(0FFH, 010H + reg1);  (* call dword[reg1] *)
-                drop
-            ELSE
-                OutByte2(0FFH, 015H);  (* call dword[L] *)
-                Reloc(BIN.RIMP, param1)
-            END
+            |IL.opJMP:
+                jmp(param1)
 
-        |IL.opCALLP:
-            UnOp(reg1);
-            OutByte2(0FFH, 0D0H + reg1);  (* call reg1 *)
-            drop;
-            ASSERT(R.top = -1)
+            |IL.opCALL:
+                call(param1)
 
-        |IL.opFASTCALL:
-            IF param2 = 1 THEN
-                pop(ecx)
-            ELSIF param2 = 2 THEN
-                pop(ecx);
-                pop(edx)
-            END
+            |IL.opCALLI:
+                IF pic THEN
+                    reg1 := GetAnyReg();
+                    Pic(reg1, BIN.PICIMP, param1);
+                    OutByte2(0FFH, 010H + reg1);  (* call dword[reg1] *)
+                    drop
+                ELSE
+                    OutByte2(0FFH, 015H);  (* call dword[L] *)
+                    Reloc(BIN.RIMP, param1)
+                END
 
-        |IL.opPRECALL:
-            PushAll(0);
-            IF (param2 # 0) & (fr >= 0) THEN
-                subrc(esp, 8)
-            END;
-            INC(FR[0]);
-            FR[FR[0]] := fr + 1;
-            WHILE fr >= 0 DO
-                subrc(esp, 8);
-                OutByte3(0DDH, 01CH, 024H); (* fstp qword[esp] *)
-                DEC(fr)
-            END;
-            ASSERT(fr = -1)
-
-        |IL.opALIGN16:
-            ASSERT(eax IN R.regs);
-            mov(eax, esp);
-            andrc(esp, -16);
-            n := (3 - param2 MOD 4) * 4;
-            IF n > 0 THEN
-                subrc(esp, n)
-            END;
-            push(eax)
+            |IL.opCALLP:
+                UnOp(reg1);
+                OutByte2(0FFH, 0D0H + reg1);  (* call reg1 *)
+                drop;
+                ASSERT(R.top = -1)
+
+            |IL.opFASTCALL:
+                IF param2 = 1 THEN
+                    pop(ecx)
+                ELSIF param2 = 2 THEN
+                    pop(ecx);
+                    pop(edx)
+                END
 
-        |IL.opRESF, IL.opRES:
-            ASSERT(R.top = -1);
-            ASSERT(fr = -1);
-            n := FR[FR[0]]; DEC(FR[0]);
+            |IL.opPRECALL:
+                PushAll(0);
+                IF (param2 # 0) & (fr >= 0) THEN
+                    subrc(esp, 8)
+                END;
+                INC(FR[0]);
+                FR[FR[0]] := fr + 1;
+                WHILE fr >= 0 DO
+                    subrc(esp, 8);
+                    OutByte3(0DDH, 01CH, 024H); (* fstp qword[esp] *)
+                    DEC(fr)
+                END;
+                ASSERT(fr = -1)
 
-            IF opcode = IL.opRESF THEN
-                INC(fr);
+            |IL.opALIGN16:
+                ASSERT(eax IN R.regs);
+                mov(eax, esp);
+                andrc(esp, -16);
+                n := (3 - param2 MOD 4) * 4;
                 IF n > 0 THEN
-                    OutByte3(0DDH, 5CH + long(n * 8), 24H);
-                    OutIntByte(n * 8); (* fstp qword[esp + n*8] *)
-                    DEC(fr);
-                    INC(n)
+                    subrc(esp, n)
                 END;
+                push(eax)
 
-                IF fr + n > MAX_FR THEN
-                    ERRORS.ErrorMsg(fname, param1, param2, FPR_ERR)
-                END
-            ELSE
-                GetRegA
-            END;
-
-            WHILE n > 0 DO
-                OutByte3(0DDH, 004H, 024H); (* fld qword[esp] *)
-                addrc(esp, 8);
-                INC(fr);
-                DEC(n)
-            END
-
-        |IL.opENTER:
-            ASSERT(R.top = -1);
-
-            SetLabel(param1);
+            |IL.opRESF, IL.opRES:
+                ASSERT(R.top = -1);
+                ASSERT(fr = -1);
+                n := FR[FR[0]]; DEC(FR[0]);
 
-            IF cmd.param3 > 0 THEN
-                pop(eax);
-                IF cmd.param3 >= 2 THEN
-                    push(edx)
+                IF opcode = IL.opRESF THEN
+                    INC(fr);
+                    IF n > 0 THEN
+                        OutByte3(0DDH, 5CH + long(n * 8), 24H);
+                        OutIntByte(n * 8); (* fstp qword[esp + n*8] *)
+                        DEC(fr);
+                        INC(n)
+                    END;
+
+                    IF fr + n > MAX_FR THEN
+                        ERRORS.ErrorMsg(fname, param1, param2, FPR_ERR)
+                    END
+                ELSE
+                    GetRegA
                 END;
-                push(ecx);
-                push(eax)
-            END;
 
-            push(ebp);
-            mov(ebp, esp);
-
-            n := param2;
-            IF n > 4 THEN
-                movrc(ecx, n);
-                pushc(0);             (* L: push 0 *)
-                OutByte2(0E2H, 0FCH)  (* loop L    *)
-            ELSE
                 WHILE n > 0 DO
-                    pushc(0);
+                    OutByte3(0DDH, 004H, 024H); (* fld qword[esp] *)
+                    addrc(esp, 8);
+                    INC(fr);
                     DEC(n)
                 END
-            END;
-            SetLabel(NewLabel());
-            FltConstLabel := CodeList.last(LABEL);
-            LocVarSize := param2 * 4
 
-        |IL.opLEAVE, IL.opLEAVER, IL.opLEAVEF:
-            IF opcode = IL.opLEAVER THEN
-                UnOp(reg1);
-                IF reg1 # eax THEN
-                    mov(eax, reg1)
+            |IL.opENTER:
+                ASSERT(R.top = -1);
+
+                SetLabel(param1);
+
+                IF cmd.param3 > 0 THEN
+                    pop(eax);
+                    IF cmd.param3 >= 2 THEN
+                        push(edx)
+                    END;
+                    push(ecx);
+                    push(eax)
                 END;
-                drop
-            END;
 
-            ASSERT(R.top = -1);
+                push(ebp);
+                mov(ebp, esp);
 
-            IF opcode = IL.opLEAVEF THEN
-                DEC(fr)
-            END;
+                n := param2;
+                IF n > 4 THEN
+                    movrc(ecx, n);
+                    pushc(0);             (* L: push 0 *)
+                    OutByte2(0E2H, 0FCH)  (* loop L    *)
+                ELSE
+                    WHILE n > 0 DO
+                        pushc(0);
+                        DEC(n)
+                    END
+                END;
+                SetLabel(NewLabel());
+                FltConstLabel := CodeList.last(LABEL);
+                LocVarSize := param2 * 4
+
+            |IL.opLEAVE, IL.opLEAVER, IL.opLEAVEF:
+                IF opcode = IL.opLEAVER THEN
+                    UnOp(reg1);
+                    IF reg1 # eax THEN
+                        mov(eax, reg1)
+                    END;
+                    drop
+                END;
 
-            ASSERT(fr = -1);
+                ASSERT(R.top = -1);
 
-            IF LocVarSize > 0 THEN
-                mov(esp, ebp)
-            END;
+                IF opcode = IL.opLEAVEF THEN
+                    DEC(fr)
+                END;
 
-            pop(ebp);
+                ASSERT(fr = -1);
 
-            IF param2 > 0 THEN
-                OutByte(0C2H); OutWord(param2 * 4 MOD 65536) (* ret param2*4 *)
-            ELSE
-                ret
-            END;
-            FltConstLabel := mainFltConstLabel;
-            LocVarSize := mainLocVarSize
+                IF LocVarSize > 0 THEN
+                    mov(esp, ebp)
+                END;
 
-        |IL.opPUSHC:
-            pushc(param2)
+                pop(ebp);
 
-        |IL.opONERR:
-            pushc(param2);
-            jmp(param1)
+                IF param2 > 0 THEN
+                    OutByte(0C2H); OutWord(param2 * 4 MOD 65536) (* ret param2*4 *)
+                ELSE
+                    ret
+                END;
+                FltConstLabel := mainFltConstLabel;
+                LocVarSize := mainLocVarSize
 
-        |IL.opPARAM:
-            IF param2 = 1 THEN
-                UnOp(reg1);
-                push(reg1);
-                drop
-            ELSE
-                ASSERT(R.top + 1 <= param2);
-                PushAll(param2)
-            END
+            |IL.opPUSHC:
+                pushc(param2)
 
-        |IL.opCLEANUP:
-            IF param2 # 0 THEN
-                addrc(esp, param2 * 4)
-            END
+            |IL.opONERR:
+                pushc(param2);
+                jmp(param1)
 
-        |IL.opPOPSP:
-            pop(esp)
+            |IL.opPARAM:
+                IF param2 = 1 THEN
+                    UnOp(reg1);
+                    push(reg1);
+                    drop
+                ELSE
+                    ASSERT(R.top + 1 <= param2);
+                    PushAll(param2)
+                END
 
-        |IL.opCONST:
-            movrc(GetAnyReg(), param2)
+            |IL.opCLEANUP:
+                IF param2 # 0 THEN
+                    addrc(esp, param2 * 4)
+                END
 
-        |IL.opLABEL:
-            SetLabel(param1) (* L: *)
+            |IL.opPOPSP:
+                pop(esp)
 
-        |IL.opNOP, IL.opAND, IL.opOR:
+            |IL.opCONST:
+                movrc(GetAnyReg(), param2)
 
-        |IL.opGADR:
-            next := cmd.next(COMMAND);
-            IF next.opcode = IL.opADDC THEN
-                INC(param2, next.param2);
-                cmd := next
-            END;
-            reg1 := GetAnyReg();
-            IF pic THEN
-                Pic(reg1, BIN.PICBSS, param2)
-            ELSE
-                OutByte(0B8H + reg1);  (* mov reg1, _bss + param2 *)
-                Reloc(BIN.RBSS, param2)
-            END
+            |IL.opLABEL:
+                SetLabel(param1) (* L: *)
 
-        |IL.opLADR:
-            next := cmd.next(COMMAND);
-            n := param2 * 4;
-            IF next.opcode = IL.opADDC THEN
-                INC(n, next.param2);
-                cmd := next
-            END;
-            OutByte2(8DH, 45H + GetAnyReg() * 8 + long(n));  (* lea reg1, dword[ebp + n] *)
-            OutIntByte(n)
+            |IL.opNOP, IL.opAND, IL.opOR:
 
-        |IL.opVADR, IL.opLLOAD32:
-            movrm(GetAnyReg(), ebp, param2 * 4)
+            |IL.opGADR:
+                next := cmd.next(COMMAND);
+                IF next.opcode = IL.opADDC THEN
+                    INC(param2, next.param2);
+                    cmd := next
+                END;
+                reg1 := GetAnyReg();
+                IF pic THEN
+                    Pic(reg1, BIN.PICBSS, param2)
+                ELSE
+                    OutByte(0B8H + reg1);  (* mov reg1, _bss + param2 *)
+                    Reloc(BIN.RBSS, param2)
+                END
 
-        |IL.opSADR:
-            reg1 := GetAnyReg();
-            IF pic THEN
-                Pic(reg1, BIN.PICDATA, stroffs + param2);
-            ELSE
-                OutByte(0B8H + reg1);  (* mov reg1, _data + stroffs + param2 *)
-                Reloc(BIN.RDATA, stroffs + param2)
-            END
+            |IL.opLADR:
+                next := cmd.next(COMMAND);
+                n := param2 * 4;
+                IF next.opcode = IL.opADDC THEN
+                    INC(n, next.param2);
+                    cmd := next
+                END;
+                OutByte2(8DH, 45H + GetAnyReg() * 8 + long(n));  (* lea reg1, dword[ebp + n] *)
+                OutIntByte(n)
 
-        |IL.opSAVEC:
-            UnOp(reg1);
-            OutByte2(0C7H, reg1); OutInt(param2);  (* mov dword[reg1], param2 *)
-            drop
+            |IL.opVADR, IL.opLLOAD32:
+                movrm(GetAnyReg(), ebp, param2 * 4)
 
-        |IL.opSAVE8C:
-            UnOp(reg1);
-            OutByte3(0C6H, reg1, param2 MOD 256);  (* mov byte[reg1], param2 *)
-            drop
+            |IL.opSADR:
+                reg1 := GetAnyReg();
+                IF pic THEN
+                    Pic(reg1, BIN.PICDATA, stroffs + param2);
+                ELSE
+                    OutByte(0B8H + reg1);  (* mov reg1, _data + stroffs + param2 *)
+                    Reloc(BIN.RDATA, stroffs + param2)
+                END
 
-        |IL.opSAVE16C:
-            UnOp(reg1);
-            OutByte3(66H, 0C7H, reg1); OutWord(param2 MOD 65536);  (* mov word[reg1], param2 *)
-            drop
+            |IL.opSAVEC:
+                UnOp(reg1);
+                OutByte2(0C7H, reg1); OutInt(param2);  (* mov dword[reg1], param2 *)
+                drop
 
-        |IL.opVLOAD32:
-            reg1 := GetAnyReg();
-            movrm(reg1, ebp, param2 * 4);
-            movrm(reg1, reg1, 0)
+            |IL.opSAVE8C:
+                UnOp(reg1);
+                OutByte3(0C6H, reg1, param2 MOD 256);  (* mov byte[reg1], param2 *)
+                drop
 
-        |IL.opGLOAD32:
-            reg1 := GetAnyReg();
-            IF pic THEN
-                Pic(reg1, BIN.PICBSS, param2);
+            |IL.opSAVE16C:
+                UnOp(reg1);
+                OutByte3(66H, 0C7H, reg1); OutWord(param2 MOD 65536);  (* mov word[reg1], param2 *)
+                drop
+
+            |IL.opVLOAD32:
+                reg1 := GetAnyReg();
+                movrm(reg1, ebp, param2 * 4);
                 movrm(reg1, reg1, 0)
-            ELSE
-                OutByte2(08BH, 05H + reg1 * 8);  (* mov reg1, dword[_bss + param2] *)
-                Reloc(BIN.RBSS, param2)
-            END
 
-        |IL.opLOAD32:
-            UnOp(reg1);
-            movrm(reg1, reg1, 0)
+            |IL.opGLOAD32:
+                reg1 := GetAnyReg();
+                IF pic THEN
+                    Pic(reg1, BIN.PICBSS, param2);
+                    movrm(reg1, reg1, 0)
+                ELSE
+                    OutByte2(08BH, 05H + reg1 * 8);  (* mov reg1, dword[_bss + param2] *)
+                    Reloc(BIN.RBSS, param2)
+                END
 
-        |IL.opVLOAD8:
-            reg1 := GetAnyReg();
-            movrm(reg1, ebp, param2 * 4);
-            movzx(reg1, reg1, 0, FALSE)
+            |IL.opLOAD32:
+                UnOp(reg1);
+                movrm(reg1, reg1, 0)
 
-        |IL.opGLOAD8:
-            reg1 := GetAnyReg();
-            IF pic THEN
-                Pic(reg1, BIN.PICBSS, param2);
+            |IL.opVLOAD8:
+                reg1 := GetAnyReg();
+                movrm(reg1, ebp, param2 * 4);
                 movzx(reg1, reg1, 0, FALSE)
-            ELSE
-                OutByte3(00FH, 0B6H, 05H + reg1 * 8); (* movzx reg1, byte[_bss + param2] *)
-                Reloc(BIN.RBSS, param2)
-            END
 
-        |IL.opLLOAD8:
-            movzx(GetAnyReg(), ebp, param2 * 4, FALSE)
+            |IL.opGLOAD8:
+                reg1 := GetAnyReg();
+                IF pic THEN
+                    Pic(reg1, BIN.PICBSS, param2);
+                    movzx(reg1, reg1, 0, FALSE)
+                ELSE
+                    OutByte3(00FH, 0B6H, 05H + reg1 * 8); (* movzx reg1, byte[_bss + param2] *)
+                    Reloc(BIN.RBSS, param2)
+                END
 
-        |IL.opLOAD8:
-            UnOp(reg1);
-            movzx(reg1, reg1, 0, FALSE)
+            |IL.opLLOAD8:
+                movzx(GetAnyReg(), ebp, param2 * 4, FALSE)
 
-        |IL.opVLOAD16:
-            reg1 := GetAnyReg();
-            movrm(reg1, ebp, param2 * 4);
-            movzx(reg1, reg1, 0, TRUE)
+            |IL.opLOAD8:
+                UnOp(reg1);
+                movzx(reg1, reg1, 0, FALSE)
 
-        |IL.opGLOAD16:
-            reg1 := GetAnyReg();
-            IF pic THEN
-                Pic(reg1, BIN.PICBSS, param2);
+            |IL.opVLOAD16:
+                reg1 := GetAnyReg();
+                movrm(reg1, ebp, param2 * 4);
                 movzx(reg1, reg1, 0, TRUE)
-            ELSE
-                OutByte3(00FH, 0B7H, 05H + reg1 * 8);  (* movzx reg1, word[_bss + param2] *)
-                Reloc(BIN.RBSS, param2)
-            END
 
-        |IL.opLLOAD16:
-            movzx(GetAnyReg(), ebp, param2 * 4, TRUE)
+            |IL.opGLOAD16:
+                reg1 := GetAnyReg();
+                IF pic THEN
+                    Pic(reg1, BIN.PICBSS, param2);
+                    movzx(reg1, reg1, 0, TRUE)
+                ELSE
+                    OutByte3(00FH, 0B7H, 05H + reg1 * 8);  (* movzx reg1, word[_bss + param2] *)
+                    Reloc(BIN.RBSS, param2)
+                END
 
-        |IL.opLOAD16:
-            UnOp(reg1);
-            movzx(reg1, reg1, 0, TRUE)
+            |IL.opLLOAD16:
+                movzx(GetAnyReg(), ebp, param2 * 4, TRUE)
 
-        |IL.opUMINUS:
-            UnOp(reg1);
-            neg(reg1)
+            |IL.opLOAD16:
+                UnOp(reg1);
+                movzx(reg1, reg1, 0, TRUE)
 
-        |IL.opADD:
-            BinOp(reg1, reg2);
-            add(reg1, reg2);
-            drop
+            |IL.opUMINUS:
+                UnOp(reg1);
+                neg(reg1)
+
+            |IL.opADD:
+                BinOp(reg1, reg2);
+                add(reg1, reg2);
+                drop
+
+            |IL.opADDC:
+                IF param2 # 0 THEN
+                    UnOp(reg1);
+                    next := cmd.next(COMMAND);
+                    CASE next.opcode OF
+                    |IL.opLOAD32:
+                        movrm(reg1, reg1, param2);
+                        cmd := next
+                    |IL.opLOAD16:
+                        movzx(reg1, reg1, param2, TRUE);
+                        cmd := next
+                    |IL.opLOAD8:
+                        movzx(reg1, reg1, param2, FALSE);
+                        cmd := next
+                    |IL.opLOAD32_PARAM:
+                        pushm(reg1, param2);
+                        drop;
+                        cmd := next
+                    ELSE
+                        IF param2 = 1 THEN
+                            OutByte(40H + reg1) (* inc reg1 *)
+                        ELSIF param2 = -1 THEN
+                            OutByte(48H + reg1) (* dec reg1 *)
+                        ELSE
+                            addrc(reg1, param2)
+                        END
+                    END
+                END
 
-        |IL.opADDC:
-            IF param2 # 0 THEN
+            |IL.opSUB:
+                BinOp(reg1, reg2);
+                oprr(29H, reg1, reg2); (* sub reg1, reg2 *)
+                drop
+
+            |IL.opSUBR, IL.opSUBL:
                 UnOp(reg1);
-                next := cmd.next(COMMAND);
-                CASE next.opcode OF
-                |IL.opLOAD32:
-                    movrm(reg1, reg1, param2);
-                    cmd := next
-                |IL.opLOAD16:
-                    movzx(reg1, reg1, param2, TRUE);
-                    cmd := next
-                |IL.opLOAD8:
-                    movzx(reg1, reg1, param2, FALSE);
-                    cmd := next
-                |IL.opLOAD32_PARAM:
-                    pushm(reg1, param2);
+                IF param2 = 1 THEN
+                    OutByte(48H + reg1) (* dec reg1 *)
+                ELSIF param2 = -1 THEN
+                    OutByte(40H + reg1) (* inc reg1 *)
+                ELSIF param2 # 0 THEN
+                    subrc(reg1, param2)
+                END;
+                IF opcode = IL.opSUBL THEN
+                    neg(reg1)
+                END
+
+            |IL.opMULC:
+                IF (cmd.next(COMMAND).opcode = IL.opADD) & ((param2 = 2) OR (param2 = 4) OR (param2 = 8)) THEN
+                    BinOp(reg1, reg2);
+                    OutByte3(8DH, 04H + reg1 * 8, reg1 + reg2 * 8 + 40H * UTILS.Log2(param2)); (* lea reg1, [reg1 + reg2 * param2] *)
                     drop;
-                    cmd := next
+                    cmd := cmd.next(COMMAND)
                 ELSE
-                    IF param2 = 1 THEN
-                        OutByte(40H + reg1) (* inc reg1 *)
-                    ELSIF param2 = -1 THEN
-                        OutByte(48H + reg1) (* dec reg1 *)
+                    UnOp(reg1);
+
+                    a := param2;
+                    IF a > 1 THEN
+                        n := UTILS.Log2(a)
+                    ELSIF a < -1 THEN
+                        n := UTILS.Log2(-a)
                     ELSE
-                        addrc(reg1, param2)
+                        n := -1
+                    END;
+
+                    IF a = 1 THEN
+
+                    ELSIF a = -1 THEN
+                        neg(reg1)
+                    ELSIF a = 0 THEN
+                        xor(reg1, reg1)
+                    ELSE
+                        IF n > 0 THEN
+                            IF a < 0 THEN
+                                neg(reg1)
+                            END;
+
+                            IF n # 1 THEN
+                                OutByte3(0C1H, 0E0H + reg1, n)   (* shl reg1, n *)
+                            ELSE
+                                OutByte2(0D1H, 0E0H + reg1)      (* shl reg1, 1 *)
+                            END
+                        ELSE
+                            OutByte2(69H + short(a), 0C0H + reg1 * 9); (* imul reg1, a *)
+                            OutIntByte(a)
+                        END
                     END
                 END
-            END
 
-        |IL.opSUB:
-            BinOp(reg1, reg2);
-            oprr(29H, reg1, reg2); (* sub reg1, reg2 *)
-            drop
+            |IL.opMUL:
+                BinOp(reg1, reg2);
+                OutByte3(0FH, 0AFH, 0C0H + reg1 * 8 + reg2); (* imul reg1, reg2 *)
+                drop
 
-        |IL.opSUBR, IL.opSUBL:
-            UnOp(reg1);
-            IF param2 = 1 THEN
-                OutByte(48H + reg1) (* dec reg1 *)
-            ELSIF param2 = -1 THEN
-                OutByte(40H + reg1) (* inc reg1 *)
-            ELSIF param2 # 0 THEN
-                subrc(reg1, param2)
-            END;
-            IF opcode = IL.opSUBL THEN
-                neg(reg1)
-            END
+            |IL.opSAVE, IL.opSAVE32:
+                BinOp(reg2, reg1);
+                movmr(reg1, 0, reg2);
+                drop;
+                drop
 
-        |IL.opMULC:
-            IF (cmd.next(COMMAND).opcode = IL.opADD) & ((param2 = 2) OR (param2 = 4) OR (param2 = 8)) THEN
-                BinOp(reg1, reg2);
-                OutByte3(8DH, 04H + reg1 * 8, reg1 + reg2 * 8 + 40H * UTILS.Log2(param2)); (* lea reg1, [reg1 + reg2 * param2] *)
+            |IL.opSAVE8:
+                BinOp(reg2, reg1);
+                movmr8(reg1, 0, reg2);
                 drop;
-                cmd := cmd.next(COMMAND)
-            ELSE
+                drop
+
+            |IL.opSAVE16:
+                BinOp(reg2, reg1);
+                movmr16(reg1, 0, reg2);
+                drop;
+                drop
+
+            |IL.opSAVEP:
                 UnOp(reg1);
+                IF pic THEN
+                    reg2 := GetAnyReg();
+                    Pic(reg2, BIN.PICCODE, param2);
+                    movmr(reg1, 0, reg2);
+                    drop
+                ELSE
+                    OutByte2(0C7H, reg1);  (* mov dword[reg1], L *)
+                    Reloc(BIN.RCODE, param2)
+                END;
+                drop
 
-                a := param2;
-                IF a > 1 THEN
-                    n := UTILS.Log2(a)
-                ELSIF a < -1 THEN
-                    n := UTILS.Log2(-a)
+            |IL.opSAVEIP:
+                UnOp(reg1);
+                IF pic THEN
+                    reg2 := GetAnyReg();
+                    Pic(reg2, BIN.PICIMP, param2);
+                    pushm(reg2, 0);
+                    OutByte2(08FH, reg1);  (* pop dword[reg1] *)
+                    drop
                 ELSE
-                    n := -1
+                    OutByte2(0FFH, 035H);  (* push dword[L] *)
+                    Reloc(BIN.RIMP, param2);
+                    OutByte2(08FH, reg1)   (* pop dword[reg1] *)
                 END;
+                drop
 
-                IF a = 1 THEN
+            |IL.opPUSHP:
+                reg1 := GetAnyReg();
+                IF pic THEN
+                    Pic(reg1, BIN.PICCODE, param2)
+                ELSE
+                    OutByte(0B8H + reg1);  (* mov reg1, L *)
+                    Reloc(BIN.RCODE, param2)
+                END
 
-                ELSIF a = -1 THEN
-                    neg(reg1)
-                ELSIF a = 0 THEN
-                    xor(reg1, reg1)
+            |IL.opPUSHIP:
+                reg1 := GetAnyReg();
+                IF pic THEN
+                    Pic(reg1, BIN.PICIMP, param2);
+                    movrm(reg1, reg1, 0)
                 ELSE
-                    IF n > 0 THEN
-                        IF a < 0 THEN
-                            neg(reg1)
-                        END;
+                    OutByte2(08BH, 05H + reg1 * 8);  (* mov reg1, dword[L] *)
+                    Reloc(BIN.RIMP, param2)
+                END
 
-                        IF n # 1 THEN
-                            OutByte3(0C1H, 0E0H + reg1, n)   (* shl reg1, n *)
-                        ELSE
-                            OutByte2(0D1H, 0E0H + reg1)      (* shl reg1, 1 *)
-                        END
-                    ELSE
-                        OutByte2(69H + short(a), 0C0H + reg1 * 9); (* imul reg1, a *)
-                        OutIntByte(a)
-                    END
+            |IL.opNOT:
+                UnOp(reg1);
+                test(reg1);
+                setcc(sete, reg1);
+                andrc(reg1, 1)
+
+            |IL.opORD:
+                UnOp(reg1);
+                test(reg1);
+                setcc(setne, reg1);
+                andrc(reg1, 1)
+
+            |IL.opSBOOL:
+                BinOp(reg2, reg1);
+                test(reg2);
+                OutByte3(0FH, 95H, reg1); (* setne byte[reg1] *)
+                drop;
+                drop
+
+            |IL.opSBOOLC:
+                UnOp(reg1);
+                OutByte3(0C6H, reg1, ORD(param2 # 0)); (* mov byte[reg1], 0/1 *)
+                drop
+
+            |IL.opEQ..IL.opGE,
+            IL.opEQC..IL.opGEC:
+
+                IF (IL.opEQ <= opcode) & (opcode <= IL.opGE) THEN
+                    BinOp(reg1, reg2);
+                    cmprr(reg1, reg2);
+                    drop
+                ELSE
+                    UnOp(reg1);
+                    cmprc(reg1, param2)
+                END;
+
+                drop;
+                cc := cond(opcode);
+                next := cmd.next(COMMAND);
+
+                IF next.opcode = IL.opJNZ THEN
+                    jcc(cc, next.param1);
+                    cmd := next
+                ELSIF next.opcode = IL.opJZ THEN
+                    jcc(inv0(cc), next.param1);
+                    cmd := next
+                ELSE
+                    reg1 := GetAnyReg();
+                    setcc(cc + 16, reg1);
+                    andrc(reg1, 1)
                 END
-            END
 
-        |IL.opMUL:
-            BinOp(reg1, reg2);
-            OutByte3(0FH, 0AFH, 0C0H + reg1 * 8 + reg2); (* imul reg1, reg2 *)
-            drop
+            |IL.opEQB, IL.opNEB:
+                BinOp(reg1, reg2);
+                drop;
 
-        |IL.opSAVE, IL.opSAVE32:
-            BinOp(reg2, reg1);
-            movmr(reg1, 0, reg2);
-            drop;
-            drop
+                test(reg1);
+                OutByte2(74H, 5);  (* je @f *)
+                movrc(reg1, 1);    (* mov reg1, 1
+                                    @@: *)
+                test(reg2);
+                OutByte2(74H, 5);  (* je @f *)
+                movrc(reg2, 1);    (* mov reg2, 1
+                                    @@: *)
 
-        |IL.opSAVE8:
-            BinOp(reg2, reg1);
-            movmr8(reg1, 0, reg2);
-            drop;
-            drop
+                cmprr(reg1, reg2);
+                IF opcode = IL.opEQB THEN
+                    setcc(sete, reg1)
+                ELSE
+                    setcc(setne, reg1)
+                END;
+                andrc(reg1, 1)
 
-        |IL.opSAVE16:
-            BinOp(reg2, reg1);
-            movmr16(reg1, 0, reg2);
-            drop;
-            drop
+            |IL.opDROP:
+                UnOp(reg1);
+                drop
 
-        |IL.opSAVEP:
-            UnOp(reg1);
-            IF pic THEN
-                reg2 := GetAnyReg();
-                Pic(reg2, BIN.PICCODE, param2);
-                movmr(reg1, 0, reg2);
+            |IL.opJNZ1:
+                UnOp(reg1);
+                test(reg1);
+                jcc(jne, param1)
+
+            |IL.opJG:
+                UnOp(reg1);
+                test(reg1);
+                jcc(jg, param1)
+
+            |IL.opJNZ:
+                UnOp(reg1);
+                test(reg1);
+                jcc(jne, param1);
                 drop
-            ELSE
-                OutByte2(0C7H, reg1);  (* mov dword[reg1], L *)
-                Reloc(BIN.RCODE, param2)
-            END;
-            drop
 
-        |IL.opSAVEIP:
-            UnOp(reg1);
-            IF pic THEN
-                reg2 := GetAnyReg();
-                Pic(reg2, BIN.PICIMP, param2);
-                pushm(reg2, 0);
-                OutByte2(08FH, reg1);  (* pop dword[reg1] *)
+            |IL.opJZ:
+                UnOp(reg1);
+                test(reg1);
+                jcc(je, param1);
                 drop
-            ELSE
-                OutByte2(0FFH, 035H);  (* push dword[L] *)
-                Reloc(BIN.RIMP, param2);
-                OutByte2(08FH, reg1)   (* pop dword[reg1] *)
-            END;
-            drop
 
-        |IL.opPUSHP:
-            reg1 := GetAnyReg();
-            IF pic THEN
-                Pic(reg1, BIN.PICCODE, param2)
-            ELSE
-                OutByte(0B8H + reg1);  (* mov reg1, L *)
-                Reloc(BIN.RCODE, param2)
-            END
+            |IL.opSWITCH:
+                UnOp(reg1);
+                IF param2 = 0 THEN
+                    reg2 := eax
+                ELSE
+                    reg2 := ecx
+                END;
+                IF reg1 # reg2 THEN
+                    ASSERT(REG.GetReg(R, reg2));
+                    ASSERT(REG.Exchange(R, reg1, reg2));
+                    drop
+                END;
+                drop
 
-        |IL.opPUSHIP:
-            reg1 := GetAnyReg();
-            IF pic THEN
-                Pic(reg1, BIN.PICIMP, param2);
-                movrm(reg1, reg1, 0)
-            ELSE
-                OutByte2(08BH, 05H + reg1 * 8);  (* mov reg1, dword[L] *)
-                Reloc(BIN.RIMP, param2)
-            END
+            |IL.opENDSW:
 
-        |IL.opNOT:
-            UnOp(reg1);
-            test(reg1);
-            setcc(sete, reg1);
-            andrc(reg1, 1)
-
-        |IL.opORD:
-            UnOp(reg1);
-            test(reg1);
-            setcc(setne, reg1);
-            andrc(reg1, 1)
-
-        |IL.opSBOOL:
-            BinOp(reg2, reg1);
-            test(reg2);
-            OutByte3(0FH, 95H, reg1); (* setne byte[reg1] *)
-            drop;
-            drop
+            |IL.opCASEL:
+                cmprc(eax, param1);
+                jcc(jl, param2)
 
-        |IL.opSBOOLC:
-            UnOp(reg1);
-            OutByte3(0C6H, reg1, ORD(param2 # 0)); (* mov byte[reg1], 0/1 *)
-            drop
+            |IL.opCASER:
+                cmprc(eax, param1);
+                jcc(jg, param2)
+
+            |IL.opCASELR:
+                cmprc(eax, param1);
+                IF param2 = cmd.param3 THEN
+                    jcc(jne, param2)
+                ELSE
+                    jcc(jl, param2);
+                    jcc(jg, cmd.param3)
+                END
 
-        |IL.opEQ..IL.opGE,
-         IL.opEQC..IL.opGEC:
+            |IL.opCODE:
+                OutByte(param2)
 
-            IF (IL.opEQ <= opcode) & (opcode <= IL.opGE) THEN
+            |IL.opGET, IL.opGETC:
+                IF opcode = IL.opGET THEN
+                    BinOp(reg1, reg2)
+                ELSIF opcode = IL.opGETC THEN
+                    UnOp(reg2);
+                    reg1 := GetAnyReg();
+                    movrc(reg1, param1)
+                END;
+                drop;
+                drop;
+
+                IF param2 # 8 THEN
+                    _movrm(reg1, reg1, 0, param2 * 8, FALSE);
+                    _movrm(reg1, reg2, 0, param2 * 8, TRUE)
+                ELSE
+                    PushAll(0);
+                    push(reg1);
+                    push(reg2);
+                    pushc(8);
+                    CallRTL(pic, IL._move)
+                END
+
+            |IL.opSAVES:
+                UnOp(reg2);
+                REG.PushAll_1(R);
+
+                IF pic THEN
+                    reg1 := GetAnyReg();
+                    Pic(reg1, BIN.PICDATA, stroffs + param2);
+                    push(reg1);
+                    drop
+                ELSE
+                    OutByte(068H);  (* push _data + stroffs + param2 *)
+                    Reloc(BIN.RDATA, stroffs + param2);
+                END;
+
+                push(reg2);
+                drop;
+                pushc(param1);
+                CallRTL(pic, IL._move)
+
+            |IL.opCHKIDX:
+                UnOp(reg1);
+                cmprc(reg1, param2);
+                jcc(jb, param1)
+
+            |IL.opCHKIDX2:
                 BinOp(reg1, reg2);
-                cmprr(reg1, reg2);
-                drop
-            ELSE
+                IF param2 # -1 THEN
+                    cmprr(reg2, reg1);
+                    jcc(jb, param1)
+                END;
+                INCL(R.regs, reg1);
+                DEC(R.top);
+                R.stk[R.top] := reg2
+
+            |IL.opLEN:
+                n := param2;
                 UnOp(reg1);
-                cmprc(reg1, param2)
-            END;
+                drop;
+                EXCL(R.regs, reg1);
 
-            drop;
-            cc := cond(opcode);
-            next := cmd.next(COMMAND);
+                WHILE n > 0 DO
+                    UnOp(reg2);
+                    drop;
+                    DEC(n)
+                END;
 
-            IF next.opcode = IL.opJNZ THEN
-                jcc(cc, next.param1);
-                cmd := next
-            ELSIF next.opcode = IL.opJZ THEN
-                jcc(inv0(cc), next.param1);
-                cmd := next
-            ELSE
-                reg1 := GetAnyReg();
-                setcc(cc + 16, reg1);
-                andrc(reg1, 1)
-            END
+                INCL(R.regs, reg1);
+                ASSERT(REG.GetReg(R, reg1))
 
-        |IL.opEQB, IL.opNEB:
-            BinOp(reg1, reg2);
-            drop;
-
-            test(reg1);
-            OutByte2(74H, 5);  (* je @f *)
-            movrc(reg1, 1);    (* mov reg1, 1
-                                  @@: *)
-            test(reg2);
-            OutByte2(74H, 5);  (* je @f *)
-            movrc(reg2, 1);    (* mov reg2, 1
-                                  @@: *)
-
-            cmprr(reg1, reg2);
-            IF opcode = IL.opEQB THEN
-                setcc(sete, reg1)
-            ELSE
-                setcc(setne, reg1)
-            END;
-            andrc(reg1, 1)
+            |IL.opINCC:
+                UnOp(reg1);
+                IF param2 = 1 THEN
+                    OutByte2(0FFH, reg1) (* inc dword[reg1] *)
+                ELSIF param2 = -1 THEN
+                    OutByte2(0FFH, reg1 + 8) (* dec dword[reg1] *)
+                ELSE
+                    OutByte2(81H + short(param2), reg1); OutIntByte(param2) (* add dword[reg1], param2 *)
+                END;
+                drop
 
-        |IL.opDROP:
-            UnOp(reg1);
-            drop
+            |IL.opINC, IL.opDEC:
+                BinOp(reg1, reg2);
+                OutByte2(01H + 28H * ORD(opcode = IL.opDEC), reg1 * 8 + reg2); (* add/sub dword[reg2], reg1 *)
+                drop;
+                drop
 
-        |IL.opJNZ1:
-            UnOp(reg1);
-            test(reg1);
-            jcc(jne, param1)
+            |IL.opINCCB, IL.opDECCB:
+                UnOp(reg1);
+                OutByte3(80H, 28H * ORD(opcode = IL.opDECCB) + reg1, param2 MOD 256); (* add/sub byte[reg1], n *)
+                drop
 
-        |IL.opJG:
-            UnOp(reg1);
-            test(reg1);
-            jcc(jg, param1)
+            |IL.opINCB, IL.opDECB:
+                BinOp(reg1, reg2);
+                OutByte2(28H * ORD(opcode = IL.opDECB), reg1 * 8 + reg2); (* add/sub byte[reg2], reg1 *)
+                drop;
+                drop
 
-        |IL.opJNZ:
-            UnOp(reg1);
-            test(reg1);
-            jcc(jne, param1);
-            drop
+            |IL.opMULS:
+                BinOp(reg1, reg2);
+                oprr(21H, reg1, reg2); (* and reg1, reg2 *)
+                drop
 
-        |IL.opJZ:
-            UnOp(reg1);
-            test(reg1);
-            jcc(je, param1);
-            drop
+            |IL.opMULSC:
+                UnOp(reg1);
+                andrc(reg1, param2)
 
-        |IL.opSWITCH:
-            UnOp(reg1);
-            IF param2 = 0 THEN
-                reg2 := eax
-            ELSE
-                reg2 := ecx
-            END;
-            IF reg1 # reg2 THEN
-                ASSERT(REG.GetReg(R, reg2));
-                ASSERT(REG.Exchange(R, reg1, reg2));
+            |IL.opDIVS:
+                BinOp(reg1, reg2);
+                xor(reg1, reg2);
                 drop
-            END;
-            drop
 
-        |IL.opENDSW:
+            |IL.opDIVSC:
+                UnOp(reg1);
+                xorrc(reg1, param2)
 
-        |IL.opCASEL:
-            cmprc(eax, param1);
-            jcc(jl, param2)
+            |IL.opADDS:
+                BinOp(reg1, reg2);
+                oprr(9H, reg1, reg2); (* or reg1, reg2 *)
+                drop
 
-        |IL.opCASER:
-            cmprc(eax, param1);
-            jcc(jg, param2)
+            |IL.opSUBS:
+                BinOp(reg1, reg2);
+                not(reg2);
+                oprr(21H, reg1, reg2); (* and reg1, reg2 *)
+                drop
 
-        |IL.opCASELR:
-            cmprc(eax, param1);
-            IF param2 = cmd.param3 THEN
-                jcc(jne, param2)
-            ELSE
-                jcc(jl, param2);
-                jcc(jg, cmd.param3)
-            END
+            |IL.opADDSC:
+                UnOp(reg1);
+                orrc(reg1, param2)
 
-        |IL.opCODE:
-            OutByte(param2)
+            |IL.opSUBSL:
+                UnOp(reg1);
+                not(reg1);
+                andrc(reg1, param2)
 
-        |IL.opGET, IL.opGETC:
-            IF opcode = IL.opGET THEN
-                BinOp(reg1, reg2)
-            ELSIF opcode = IL.opGETC THEN
-                UnOp(reg2);
-                reg1 := GetAnyReg();
-                movrc(reg1, param1)
-            END;
-            drop;
-            drop;
+            |IL.opSUBSR:
+                UnOp(reg1);
+                andrc(reg1, ORD(-BITS(param2)))
 
-            IF param2 # 8 THEN
-                _movrm(reg1, reg1, 0, param2 * 8, FALSE);
-                _movrm(reg1, reg2, 0, param2 * 8, TRUE)
-            ELSE
-                PushAll(0);
-                push(reg1);
-                push(reg2);
-                pushc(8);
-                CallRTL(pic, IL._move)
-            END
+            |IL.opUMINS:
+                UnOp(reg1);
+                not(reg1)
 
-        |IL.opSAVES:
-            UnOp(reg2);
-            REG.PushAll_1(R);
+            |IL.opLENGTH:
+                PushAll(2);
+                CallRTL(pic, IL._length);
+                GetRegA
+
+            |IL.opLENGTHW:
+                PushAll(2);
+                CallRTL(pic, IL._lengthw);
+                GetRegA
+
+            |IL.opASR, IL.opROR, IL.opLSL, IL.opLSR:
+                UnOp(reg1);
+                IF reg1 # ecx THEN
+                    ASSERT(REG.GetReg(R, ecx));
+                    ASSERT(REG.Exchange(R, reg1, ecx));
+                    drop
+                END;
+
+                BinOp(reg1, reg2);
+                ASSERT(reg2 = ecx);
+                OutByte(0D3H);
+                shift(opcode, reg1); (* shift reg1, cl *)
+                drop
+
+            |IL.opASR1, IL.opROR1, IL.opLSL1, IL.opLSR1:
+                UnOp(reg1);
+                IF reg1 # ecx THEN
+                    ASSERT(REG.GetReg(R, ecx));
+                    ASSERT(REG.Exchange(R, reg1, ecx));
+                    drop
+                END;
 
-            IF pic THEN
                 reg1 := GetAnyReg();
-                Pic(reg1, BIN.PICDATA, stroffs + param2);
-                push(reg1);
+                movrc(reg1, param2);
+                BinOp(reg1, reg2);
+                ASSERT(reg1 = ecx);
+                OutByte(0D3H);
+                shift(opcode, reg2); (* shift reg2, cl *)
+                drop;
+                drop;
+                ASSERT(REG.GetReg(R, reg2))
+
+            |IL.opASR2, IL.opROR2, IL.opLSL2, IL.opLSR2:
+                UnOp(reg1);
+                n := param2 MOD 32;
+                IF n # 1 THEN
+                    OutByte(0C1H)
+                ELSE
+                    OutByte(0D1H)
+                END;
+                shift(opcode, reg1); (* shift reg1, n *)
+                IF n # 1 THEN
+                    OutByte(n)
+                END
+
+            |IL.opMAX, IL.opMIN:
+                BinOp(reg1, reg2);
+                cmprr(reg1, reg2);
+                OutByte2(07DH + ORD(opcode = IL.opMIN), 2);  (* jge/jle L *)
+                mov(reg1, reg2);
+                (* L: *)
                 drop
-            ELSE
-                OutByte(068H);  (* push _data + stroffs + param2 *)
-                Reloc(BIN.RDATA, stroffs + param2);
-            END;
 
-            push(reg2);
-            drop;
-            pushc(param1);
-            CallRTL(pic, IL._move)
+            |IL.opMAXC, IL.opMINC:
+                UnOp(reg1);
+                cmprc(reg1, param2);
+                label := NewLabel();
+                IF opcode = IL.opMINC THEN
+                    cc := jle
+                ELSE
+                    cc := jge
+                END;
+                jcc(cc, label);
+                movrc(reg1, param2);
+                SetLabel(label)
 
-        |IL.opCHKIDX:
-            UnOp(reg1);
-            cmprc(reg1, param2);
-            jcc(jb, param1)
+            |IL.opIN, IL.opINR:
+                IF opcode = IL.opINR THEN
+                    reg2 := GetAnyReg();
+                    movrc(reg2, param2)
+                END;
+                label := NewLabel();
+                BinOp(reg1, reg2);
+                cmprc(reg1, 32);
+                OutByte2(72H, 4); (* jb L *)
+                xor(reg1, reg1);
+                jmp(label);
+                (* L: *)
+                OutByte3(0FH, 0A3H, 0C0H + reg2 + 8 * reg1); (* bt reg2, reg1 *)
+                setcc(setc, reg1);
+                andrc(reg1, 1);
+                SetLabel(label);
+                drop
 
-        |IL.opCHKIDX2:
-            BinOp(reg1, reg2);
-            IF param2 # -1 THEN
-                cmprr(reg2, reg1);
-                jcc(jb, param1)
-            END;
-            INCL(R.regs, reg1);
-            DEC(R.top);
-            R.stk[R.top] := reg2
+            |IL.opINL:
+                UnOp(reg1);
+                OutByte3(0FH, 0BAH, 0E0H + reg1); OutByte(param2); (* bt reg1, param2 *)
+                setcc(setc, reg1);
+                andrc(reg1, 1)
 
-        |IL.opLEN:
-            n := param2;
-            UnOp(reg1);
-            drop;
-            EXCL(R.regs, reg1);
+            |IL.opRSET:
+                PushAll(2);
+                CallRTL(pic, IL._set);
+                GetRegA
 
-            WHILE n > 0 DO
-                UnOp(reg2);
+            |IL.opRSETR:
+                PushAll(1);
+                pushc(param2);
+                CallRTL(pic, IL._set);
+                GetRegA
+
+            |IL.opRSETL:
+                UnOp(reg1);
+                REG.PushAll_1(R);
+                pushc(param2);
+                push(reg1);
                 drop;
-                DEC(n)
-            END;
+                CallRTL(pic, IL._set);
+                GetRegA
 
-            INCL(R.regs, reg1);
-            ASSERT(REG.GetReg(R, reg1))
+            |IL.opRSET1:
+                PushAll(1);
+                CallRTL(pic, IL._set1);
+                GetRegA
 
-        |IL.opINCC:
-            UnOp(reg1);
-            IF param2 = 1 THEN
-                OutByte2(0FFH, reg1) (* inc dword[reg1] *)
-            ELSIF param2 = -1 THEN
-                OutByte2(0FFH, reg1 + 8) (* dec dword[reg1] *)
-            ELSE
-                OutByte2(81H + short(param2), reg1); OutIntByte(param2) (* add dword[reg1], param2 *)
-            END;
-            drop
+            |IL.opINCL, IL.opEXCL:
+                BinOp(reg1, reg2);
+                cmprc(reg1, 32);
+                OutByte2(73H, 03H); (* jnb L *)
+                OutByte(0FH);
+                IF opcode = IL.opINCL THEN
+                    OutByte(0ABH) (* bts dword[reg2], reg1 *)
+                ELSE
+                    OutByte(0B3H) (* btr dword[reg2], reg1 *)
+                END;
+                OutByte(reg2 + 8 * reg1);
+                (* L: *)
+                drop;
+                drop
 
-        |IL.opINC, IL.opDEC:
-            BinOp(reg1, reg2);
-            OutByte2(01H + 28H * ORD(opcode = IL.opDEC), reg1 * 8 + reg2); (* add/sub dword[reg2], reg1 *)
-            drop;
-            drop
+            |IL.opINCLC:
+                UnOp(reg1);
+                OutByte3(0FH, 0BAH, 28H + reg1); OutByte(param2); (* bts dword[reg1], param2 *)
+                drop
 
-        |IL.opINCCB, IL.opDECCB:
-            UnOp(reg1);
-            OutByte3(80H, 28H * ORD(opcode = IL.opDECCB) + reg1, param2 MOD 256); (* add/sub byte[reg1], n *)
-            drop
+            |IL.opEXCLC:
+                UnOp(reg1);
+                OutByte3(0FH, 0BAH, 30H + reg1); OutByte(param2); (* btr dword[reg1], param2 *)
+                drop
 
-        |IL.opINCB, IL.opDECB:
-            BinOp(reg1, reg2);
-            OutByte2(28H * ORD(opcode = IL.opDECB), reg1 * 8 + reg2); (* add/sub byte[reg2], reg1 *)
-            drop;
-            drop
+            |IL.opDIV:
+                PushAll(2);
+                CallRTL(pic, IL._divmod);
+                GetRegA
 
-        |IL.opMULS:
-            BinOp(reg1, reg2);
-            oprr(21H, reg1, reg2); (* and reg1, reg2 *)
-            drop
+            |IL.opDIVR:
+                n := UTILS.Log2(param2);
+                IF n > 0 THEN
+                    UnOp(reg1);
+                    IF n # 1 THEN
+                        OutByte3(0C1H, 0F8H + reg1, n) (* sar reg1, n *)
+                    ELSE
+                        OutByte2(0D1H, 0F8H + reg1)    (* sar reg1, 1 *)
+                    END
+                ELSIF n < 0 THEN
+                    PushAll(1);
+                    pushc(param2);
+                    CallRTL(pic, IL._divmod);
+                    GetRegA
+                END
 
-        |IL.opMULSC:
-            UnOp(reg1);
-            andrc(reg1, param2)
+            |IL.opDIVL:
+                UnOp(reg1);
+                REG.PushAll_1(R);
+                pushc(param2);
+                push(reg1);
+                drop;
+                CallRTL(pic, IL._divmod);
+                GetRegA
 
-        |IL.opDIVS:
-            BinOp(reg1, reg2);
-            xor(reg1, reg2);
-            drop
+            |IL.opMOD:
+                PushAll(2);
+                CallRTL(pic, IL._divmod);
+                mov(eax, edx);
+                GetRegA
 
-        |IL.opDIVSC:
-            UnOp(reg1);
-            xorrc(reg1, param2)
+            |IL.opMODR:
+                n := UTILS.Log2(param2);
+                IF n > 0 THEN
+                    UnOp(reg1);
+                    andrc(reg1, param2 - 1);
+                ELSIF n < 0 THEN
+                    PushAll(1);
+                    pushc(param2);
+                    CallRTL(pic, IL._divmod);
+                    mov(eax, edx);
+                    GetRegA
+                ELSE
+                    UnOp(reg1);
+                    xor(reg1, reg1)
+                END
 
-        |IL.opADDS:
-            BinOp(reg1, reg2);
-            oprr(9H, reg1, reg2); (* or reg1, reg2 *)
-            drop
+            |IL.opMODL:
+                UnOp(reg1);
+                REG.PushAll_1(R);
+                pushc(param2);
+                push(reg1);
+                drop;
+                CallRTL(pic, IL._divmod);
+                mov(eax, edx);
+                GetRegA
 
-        |IL.opSUBS:
-            BinOp(reg1, reg2);
-            not(reg2);
-            oprr(21H, reg1, reg2); (* and reg1, reg2 *)
-            drop
+            |IL.opERR:
+                CallRTL(pic, IL._error)
 
-        |IL.opADDSC:
-            UnOp(reg1);
-            orrc(reg1, param2)
-
-        |IL.opSUBSL:
-            UnOp(reg1);
-            not(reg1);
-            andrc(reg1, param2)
-
-        |IL.opSUBSR:
-            UnOp(reg1);
-            andrc(reg1, ORD(-BITS(param2)))
-
-        |IL.opUMINS:
-            UnOp(reg1);
-            not(reg1)
-
-        |IL.opLENGTH:
-            PushAll(2);
-            CallRTL(pic, IL._length);
-            GetRegA
-
-        |IL.opLENGTHW:
-            PushAll(2);
-            CallRTL(pic, IL._lengthw);
-            GetRegA
-
-        |IL.opASR, IL.opROR, IL.opLSL, IL.opLSR:
-            UnOp(reg1);
-            IF reg1 # ecx THEN
-                ASSERT(REG.GetReg(R, ecx));
-                ASSERT(REG.Exchange(R, reg1, ecx));
-                drop
-            END;
+            |IL.opABS:
+                UnOp(reg1);
+                test(reg1);
+                OutByte2(07DH, 002H); (* jge L *)
+                neg(reg1)             (* neg reg1
+                                        L: *)
+
+            |IL.opCOPY:
+                IF (0 < param2) & (param2 <= 64) THEN
+                    BinOp(reg1, reg2);
+                    reg3 := GetAnyReg();
+                    FOR n := 0 TO param2 - param2 MOD 4 - 1 BY 4 DO
+                        movrm(reg3, reg1, n);
+                        movmr(reg2, n, reg3)
+                    END;
+                    n := param2 - param2 MOD 4;
+                    IF param2 MOD 4 >= 2 THEN
+                        movrm16(reg3, reg1, n);
+                        movmr16(reg2, n, reg3);
+                        INC(n, 2);
+                        DEC(param2, 2)
+                    END;
+                    IF param2 MOD 4 = 1 THEN
+                        movrm8(reg3, reg1, n);
+                        movmr8(reg2, n, reg3);
+                    END;
+                    drop;
+                    drop;
+                    drop
+                ELSE
+                    PushAll(2);
+                    pushc(param2);
+                    CallRTL(pic, IL._move)
+                END
 
-            BinOp(reg1, reg2);
-            ASSERT(reg2 = ecx);
-            OutByte(0D3H);
-            shift(opcode, reg1); (* shift reg1, cl *)
-            drop
+            |IL.opMOVE:
+                PushAll(3);
+                CallRTL(pic, IL._move)
 
-        |IL.opASR1, IL.opROR1, IL.opLSL1, IL.opLSR1:
-            UnOp(reg1);
-            IF reg1 # ecx THEN
-                ASSERT(REG.GetReg(R, ecx));
-                ASSERT(REG.Exchange(R, reg1, ecx));
-                drop
-            END;
+            |IL.opCOPYA:
+                PushAll(4);
+                pushc(param2);
+                CallRTL(pic, IL._arrcpy);
+                GetRegA
 
-            reg1 := GetAnyReg();
-            movrc(reg1, param2);
-            BinOp(reg1, reg2);
-            ASSERT(reg1 = ecx);
-            OutByte(0D3H);
-            shift(opcode, reg2); (* shift reg2, cl *)
-            drop;
-            drop;
-            ASSERT(REG.GetReg(R, reg2))
-
-        |IL.opASR2, IL.opROR2, IL.opLSL2, IL.opLSR2:
-            UnOp(reg1);
-            n := param2 MOD 32;
-            IF n # 1 THEN
-                OutByte(0C1H)
-            ELSE
-                OutByte(0D1H)
-            END;
-            shift(opcode, reg1); (* shift reg1, n *)
-            IF n # 1 THEN
-                OutByte(n)
-            END
+            |IL.opCOPYS:
+                PushAll(4);
+                pushc(param2);
+                CallRTL(pic, IL._strcpy)
 
-        |IL.opMAX, IL.opMIN:
-            BinOp(reg1, reg2);
-            cmprr(reg1, reg2);
-            OutByte2(07DH + ORD(opcode = IL.opMIN), 2);  (* jge/jle L *)
-            mov(reg1, reg2);
-            (* L: *)
-            drop
+            |IL.opROT:
+                PushAll(0);
+                push(esp);
+                pushc(param2);
+                CallRTL(pic, IL._rot)
 
-        |IL.opMAXC, IL.opMINC:
-            UnOp(reg1);
-            cmprc(reg1, param2);
-            label := NewLabel();
-            IF opcode = IL.opMINC THEN
-                cc := jle
-            ELSE
-                cc := jge
-            END;
-            jcc(cc, label);
-            movrc(reg1, param2);
-            SetLabel(label)
-
-        |IL.opIN, IL.opINR:
-            IF opcode = IL.opINR THEN
-                reg2 := GetAnyReg();
-                movrc(reg2, param2)
-            END;
-            label := NewLabel();
-            BinOp(reg1, reg2);
-            cmprc(reg1, 32);
-            OutByte2(72H, 4); (* jb L *)
-            xor(reg1, reg1);
-            jmp(label);
-            (* L: *)
-            OutByte3(0FH, 0A3H, 0C0H + reg2 + 8 * reg1); (* bt reg2, reg1 *)
-            setcc(setc, reg1);
-            andrc(reg1, 1);
-            SetLabel(label);
-            drop
+            |IL.opNEW:
+                PushAll(1);
+                CASE TARGETS.OS OF
+                |TARGETS.osWIN32:
+                    n := param2 + 4;
+                    ASSERT(UTILS.Align(n, 4))
+                |TARGETS.osLINUX32:
+                    n := param2 + 16;
+                    ASSERT(UTILS.Align(n, 16))
+                |TARGETS.osKOS:
+                    n := param2 + 8;
+                    ASSERT(UTILS.Align(n, 32))
+                END;
+                pushc(n);
+                pushc(param1);
+                CallRTL(pic, IL._new)
+
+            |IL.opDISP:
+                PushAll(1);
+                CallRTL(pic, IL._dispose)
+
+            |IL.opEQS .. IL.opGES:
+                PushAll(4);
+                pushc(opcode - IL.opEQS);
+                CallRTL(pic, IL._strcmp);
+                GetRegA
+
+            |IL.opEQSW .. IL.opGESW:
+                PushAll(4);
+                pushc(opcode - IL.opEQSW);
+                CallRTL(pic, IL._strcmpw);
+                GetRegA
+
+            |IL.opEQP, IL.opNEP, IL.opEQIP, IL.opNEIP:
+                UnOp(reg1);
+                CASE opcode OF
+                |IL.opEQP, IL.opNEP:
+                    IF pic THEN
+                        reg2 := GetAnyReg();
+                        Pic(reg2, BIN.PICCODE, param1);
+                        cmprr(reg1, reg2);
+                        drop
+                    ELSE
+                        OutByte2(081H, 0F8H + reg1);  (* cmp reg1, L *)
+                        Reloc(BIN.RCODE, param1)
+                    END
 
-        |IL.opINL:
-            UnOp(reg1);
-            OutByte3(0FH, 0BAH, 0E0H + reg1); OutByte(param2); (* bt reg1, param2 *)
-            setcc(setc, reg1);
-            andrc(reg1, 1)
-
-        |IL.opRSET:
-            PushAll(2);
-            CallRTL(pic, IL._set);
-            GetRegA
-
-        |IL.opRSETR:
-            PushAll(1);
-            pushc(param2);
-            CallRTL(pic, IL._set);
-            GetRegA
-
-        |IL.opRSETL:
-            UnOp(reg1);
-            REG.PushAll_1(R);
-            pushc(param2);
-            push(reg1);
-            drop;
-            CallRTL(pic, IL._set);
-            GetRegA
-
-        |IL.opRSET1:
-            PushAll(1);
-            CallRTL(pic, IL._set1);
-            GetRegA
-
-        |IL.opINCL, IL.opEXCL:
-            BinOp(reg1, reg2);
-            cmprc(reg1, 32);
-            OutByte2(73H, 03H); (* jnb L *)
-            OutByte(0FH);
-            IF opcode = IL.opINCL THEN
-                OutByte(0ABH) (* bts dword[reg2], reg1 *)
-            ELSE
-                OutByte(0B3H) (* btr dword[reg2], reg1 *)
-            END;
-            OutByte(reg2 + 8 * reg1);
-            (* L: *)
-            drop;
-            drop
+                |IL.opEQIP, IL.opNEIP:
+                    IF pic THEN
+                        reg2 := GetAnyReg();
+                        Pic(reg2, BIN.PICIMP, param1);
+                        OutByte2(03BH, reg1 * 8 + reg2);  (* cmp reg1, dword [reg2] *)
+                        drop
+                    ELSE
+                        OutByte2(3BH, 05H + reg1 * 8);    (* cmp reg1, dword[L] *)
+                        Reloc(BIN.RIMP, param1)
+                    END
 
-        |IL.opINCLC:
-            UnOp(reg1);
-            OutByte3(0FH, 0BAH, 28H + reg1); OutByte(param2); (* bts dword[reg1], param2 *)
-            drop
+                END;
+                drop;
+                reg1 := GetAnyReg();
 
-        |IL.opEXCLC:
-            UnOp(reg1);
-            OutByte3(0FH, 0BAH, 30H + reg1); OutByte(param2); (* btr dword[reg1], param2 *)
-            drop
+                CASE opcode OF
+                |IL.opEQP, IL.opEQIP: setcc(sete,  reg1)
+                |IL.opNEP, IL.opNEIP: setcc(setne, reg1)
+                END;
 
-        |IL.opDIV:
-            PushAll(2);
-            CallRTL(pic, IL._divmod);
-            GetRegA
+                andrc(reg1, 1)
 
-        |IL.opDIVR:
-            n := UTILS.Log2(param2);
-            IF n > 0 THEN
+            |IL.opPUSHT:
                 UnOp(reg1);
-                IF n # 1 THEN
-                    OutByte3(0C1H, 0F8H + reg1, n) (* sar reg1, n *)
-                ELSE
-                    OutByte2(0D1H, 0F8H + reg1)    (* sar reg1, 1 *)
-                END
-            ELSIF n < 0 THEN
+                movrm(GetAnyReg(), reg1, -4)
+
+            |IL.opISREC:
+                PushAll(2);
+                IF ~(target IN {TARGETS.KolibriOSDrv, TARGETS.KolibriOSKer}) THEN
+                    param2 := param2*tcount
+                END;
+                pushc(param2);
+                CallRTL(pic, IL._isrec);
+                GetRegA
+
+            |IL.opIS:
                 PushAll(1);
+                IF ~(target IN {TARGETS.KolibriOSDrv, TARGETS.KolibriOSKer}) THEN
+                    param2 := param2*tcount
+                END;
                 pushc(param2);
-                CallRTL(pic, IL._divmod);
+                CallRTL(pic, IL._is);
                 GetRegA
-            END
 
-        |IL.opDIVL:
-            UnOp(reg1);
-            REG.PushAll_1(R);
-            pushc(param2);
-            push(reg1);
-            drop;
-            CallRTL(pic, IL._divmod);
-            GetRegA
-
-        |IL.opMOD:
-            PushAll(2);
-            CallRTL(pic, IL._divmod);
-            mov(eax, edx);
-            GetRegA
-
-        |IL.opMODR:
-            n := UTILS.Log2(param2);
-            IF n > 0 THEN
-                UnOp(reg1);
-                andrc(reg1, param2 - 1);
-            ELSIF n < 0 THEN
+            |IL.opTYPEGR:
                 PushAll(1);
+                IF ~(target IN {TARGETS.KolibriOSDrv, TARGETS.KolibriOSKer}) THEN
+                    param2 := param2*tcount
+                END;
                 pushc(param2);
-                CallRTL(pic, IL._divmod);
-                mov(eax, edx);
+                CallRTL(pic, IL._guardrec);
                 GetRegA
-            ELSE
-                UnOp(reg1);
-                xor(reg1, reg1)
-            END
 
-        |IL.opMODL:
-            UnOp(reg1);
-            REG.PushAll_1(R);
-            pushc(param2);
-            push(reg1);
-            drop;
-            CallRTL(pic, IL._divmod);
-            mov(eax, edx);
-            GetRegA
-
-        |IL.opERR:
-            CallRTL(pic, IL._error)
-
-        |IL.opABS:
-            UnOp(reg1);
-            test(reg1);
-            OutByte2(07DH, 002H); (* jge L *)
-            neg(reg1)             (* neg reg1
-                                     L: *)
-
-        |IL.opCOPY:
-            IF (0 < param2) & (param2 <= 64) THEN
-                BinOp(reg1, reg2);
-                reg3 := GetAnyReg();
-                FOR n := 0 TO param2 - param2 MOD 4 - 1 BY 4 DO
-                    movrm(reg3, reg1, n);
-                    movmr(reg2, n, reg3)
+            |IL.opTYPEGP:
+                UnOp(reg1);
+                PushAll(0);
+                push(reg1);
+                IF ~(target IN {TARGETS.KolibriOSDrv, TARGETS.KolibriOSKer}) THEN
+                    param2 := param2*tcount
                 END;
-                n := param2 - param2 MOD 4;
-                IF param2 MOD 4 >= 2 THEN
-                    movrm16(reg3, reg1, n);
-                    movmr16(reg2, n, reg3);
-                    INC(n, 2);
-                    DEC(param2, 2)
+                pushc(param2);
+                CallRTL(pic, IL._guard);
+                GetRegA
+
+            |IL.opTYPEGD:
+                UnOp(reg1);
+                PushAll(0);
+                pushm(reg1, -4);
+                IF ~(target IN {TARGETS.KolibriOSDrv, TARGETS.KolibriOSKer}) THEN
+                    param2 := param2*tcount
                 END;
-                IF param2 MOD 4 = 1 THEN
-                    movrm8(reg3, reg1, n);
-                    movmr8(reg2, n, reg3);
+                pushc(param2);
+                CallRTL(pic, IL._guardrec);
+                GetRegA
+
+            |IL.opCASET:
+                push(ecx);
+                push(ecx);
+                IF ~(target IN {TARGETS.KolibriOSDrv, TARGETS.KolibriOSKer}) THEN
+                    param2 := param2*tcount
                 END;
-                drop;
+                pushc(param2);
+                CallRTL(pic, IL._guardrec);
+                pop(ecx);
+                test(eax);
+                jcc(jne, param1)
+
+            |IL.opPACK:
+                BinOp(reg1, reg2);
+                push(reg2);
+                OutByte3(0DBH, 004H, 024H);   (* fild dword[esp]  *)
+                OutByte2(0DDH, reg1);         (* fld qword[reg1]  *)
+                OutByte2(0D9H, 0FDH);         (* fscale           *)
+                OutByte2(0DDH, 018H + reg1);  (* fstp qword[reg1] *)
+                OutByte3(0DBH, 01CH, 024H);   (* fistp dword[esp] *)
+                pop(reg2);
                 drop;
                 drop
-            ELSE
-                PushAll(2);
-                pushc(param2);
-                CallRTL(pic, IL._move)
-            END
 
-        |IL.opMOVE:
-            PushAll(3);
-            CallRTL(pic, IL._move)
+            |IL.opPACKC:
+                UnOp(reg1);
+                pushc(param2);
+                OutByte3(0DBH, 004H, 024H);   (* fild dword[esp]  *)
+                OutByte2(0DDH, reg1);         (* fld qword[reg1]  *)
+                OutByte2(0D9H, 0FDH);         (* fscale           *)
+                OutByte2(0DDH, 018H + reg1);  (* fstp qword[reg1] *)
+                OutByte3(0DBH, 01CH, 024H);   (* fistp dword[esp] *)
+                pop(reg1);
+                drop
 
-        |IL.opCOPYA:
-            PushAll(4);
-            pushc(param2);
-            CallRTL(pic, IL._arrcpy);
-            GetRegA
+            |IL.opUNPK:
+                BinOp(reg1, reg2);
+                OutByte2(0DDH, reg1);         (* fld qword[reg1]   *)
+                OutByte2(0D9H, 0F4H);         (* fxtract           *)
+                OutByte2(0DDH, 018H + reg1);  (* fstp qword[reg1]  *)
+                OutByte2(0DBH, 018H + reg2);  (* fistp dword[reg2] *)
+                drop;
+                drop
 
-        |IL.opCOPYS:
-            PushAll(4);
-            pushc(param2);
-            CallRTL(pic, IL._strcpy)
+            |IL.opPUSHF:
+                ASSERT(fr >= 0);
+                DEC(fr);
+                subrc(esp, 8);
+                OutByte3(0DDH, 01CH, 024H)    (* fstp qword[esp] *)
 
-        |IL.opROT:
-            PushAll(0);
-            push(esp);
-            pushc(param2);
-            CallRTL(pic, IL._rot)
-
-        |IL.opNEW:
-            PushAll(1);
-            CASE TARGETS.OS OF
-            |TARGETS.osWIN32:
-                n := param2 + 4;
-                ASSERT(UTILS.Align(n, 4))
-            |TARGETS.osLINUX32:
-                n := param2 + 16;
-                ASSERT(UTILS.Align(n, 16))
-            |TARGETS.osKOS:
-                n := param2 + 8;
-                ASSERT(UTILS.Align(n, 32))
-            END;
-            pushc(n);
-            pushc(param1);
-            CallRTL(pic, IL._new)
-
-        |IL.opDISP:
-            PushAll(1);
-            CallRTL(pic, IL._dispose)
-
-        |IL.opEQS .. IL.opGES:
-            PushAll(4);
-            pushc(opcode - IL.opEQS);
-            CallRTL(pic, IL._strcmp);
-            GetRegA
-
-        |IL.opEQSW .. IL.opGESW:
-            PushAll(4);
-            pushc(opcode - IL.opEQSW);
-            CallRTL(pic, IL._strcmpw);
-            GetRegA
-
-        |IL.opEQP, IL.opNEP, IL.opEQIP, IL.opNEIP:
-            UnOp(reg1);
-            CASE opcode OF
-            |IL.opEQP, IL.opNEP:
-                IF pic THEN
-                    reg2 := GetAnyReg();
-                    Pic(reg2, BIN.PICCODE, param1);
-                    cmprr(reg1, reg2);
-                    drop
-                ELSE
-                    OutByte2(081H, 0F8H + reg1);  (* cmp reg1, L *)
-                    Reloc(BIN.RCODE, param1)
-                END
+            |IL.opLOADF:
+                INC(fr);
+                IF fr > MAX_FR THEN
+                    ERRORS.ErrorMsg(fname, param1, param2, FPR_ERR)
+                END;
+                UnOp(reg1);
+                OutByte2(0DDH, reg1);         (* fld qword[reg1] *)
+                drop
 
-            |IL.opEQIP, IL.opNEIP:
-                IF pic THEN
-                    reg2 := GetAnyReg();
-                    Pic(reg2, BIN.PICIMP, param1);
-                    OutByte2(03BH, reg1 * 8 + reg2);  (* cmp reg1, dword [reg2] *)
-                    drop
+            |IL.opCONSTF:
+                INC(fr);
+                IF fr > MAX_FR THEN
+                    ERRORS.ErrorMsg(fname, param1, param2, FPR_ERR)
+                END;
+                float := cmd.float;
+                IF float = 0.0 THEN
+                    OutByte2(0D9H, 0EEH)      (* fldz *)
+                ELSIF float = 1.0 THEN
+                    OutByte2(0D9H, 0E8H)      (* fld1 *)
+                ELSIF float = -1.0 THEN
+                    OutByte2(0D9H, 0E8H);     (* fld1 *)
+                    OutByte2(0D9H, 0E0H)      (* fchs *)
                 ELSE
-                    OutByte2(3BH, 05H + reg1 * 8);    (* cmp reg1, dword[L] *)
-                    Reloc(BIN.RIMP, param1)
+                    LoadFltConst(float)
                 END
 
-            END;
-            drop;
-            reg1 := GetAnyReg();
-
-            CASE opcode OF
-            |IL.opEQP, IL.opEQIP: setcc(sete,  reg1)
-            |IL.opNEP, IL.opNEIP: setcc(setne, reg1)
-            END;
-
-            andrc(reg1, 1)
-
-        |IL.opPUSHT:
-            UnOp(reg1);
-            movrm(GetAnyReg(), reg1, -4)
+            |IL.opSAVEF, IL.opSAVEFI:
+                ASSERT(fr >= 0);
+                DEC(fr);
+                UnOp(reg1);
+                OutByte2(0DDH, 018H + reg1); (* fstp qword[reg1] *)
+                drop
 
-        |IL.opISREC:
-            PushAll(2);
-            IF ~(target IN {TARGETS.KolibriOSDrv, TARGETS.KolibriOSKer}) THEN                
-                param2 := param2*tcount
-            END;
-            pushc(param2);
-            CallRTL(pic, IL._isrec);
-            GetRegA
-
-        |IL.opIS:
-            PushAll(1);
-            IF ~(target IN {TARGETS.KolibriOSDrv, TARGETS.KolibriOSKer}) THEN                
-                param2 := param2*tcount
-            END;
-            pushc(param2);
-            CallRTL(pic, IL._is);
-            GetRegA
-
-        |IL.opTYPEGR:
-            PushAll(1);
-            IF ~(target IN {TARGETS.KolibriOSDrv, TARGETS.KolibriOSKer}) THEN                
-                param2 := param2*tcount
-            END;
-            pushc(param2);
-            CallRTL(pic, IL._guardrec);
-            GetRegA
-
-        |IL.opTYPEGP:
-            UnOp(reg1);
-            PushAll(0);
-            push(reg1);
-            IF ~(target IN {TARGETS.KolibriOSDrv, TARGETS.KolibriOSKer}) THEN                
-                param2 := param2*tcount
-            END;
-            pushc(param2);
-            CallRTL(pic, IL._guard);
-            GetRegA
-
-        |IL.opTYPEGD:
-            UnOp(reg1);
-            PushAll(0);
-            pushm(reg1, -4);
-            IF ~(target IN {TARGETS.KolibriOSDrv, TARGETS.KolibriOSKer}) THEN                
-                param2 := param2*tcount
-            END;
-            pushc(param2);
-            CallRTL(pic, IL._guardrec);
-            GetRegA
-
-        |IL.opCASET:
-            push(ecx);
-            push(ecx);
-            IF ~(target IN {TARGETS.KolibriOSDrv, TARGETS.KolibriOSKer}) THEN                
-                param2 := param2*tcount
-            END;
-            pushc(param2);
-            CallRTL(pic, IL._guardrec);
-            pop(ecx);
-            test(eax);
-            jcc(jne, param1)
-
-        |IL.opPACK:
-            BinOp(reg1, reg2);
-            push(reg2);
-            OutByte3(0DBH, 004H, 024H);   (* fild dword[esp]  *)
-            OutByte2(0DDH, reg1);         (* fld qword[reg1]  *)
-            OutByte2(0D9H, 0FDH);         (* fscale           *)
-            OutByte2(0DDH, 018H + reg1);  (* fstp qword[reg1] *)
-            OutByte3(0DBH, 01CH, 024H);   (* fistp dword[esp] *)
-            pop(reg2);
-            drop;
-            drop
+            |IL.opADDF:
+                ASSERT(fr >= 1);
+                DEC(fr);
+                OutByte2(0DEH, 0C1H)  (* faddp st1, st *)
+
+            |IL.opSUBF:
+                ASSERT(fr >= 1);
+                DEC(fr);
+                OutByte2(0DEH, 0E9H)  (* fsubp st1, st *)
+
+            |IL.opSUBFI:
+                ASSERT(fr >= 1);
+                DEC(fr);
+                OutByte2(0DEH, 0E1H)  (* fsubrp st1, st *)
+
+            |IL.opMULF:
+                ASSERT(fr >= 1);
+                DEC(fr);
+                OutByte2(0DEH, 0C9H)  (* fmulp st1, st *)
+
+            |IL.opDIVF:
+                ASSERT(fr >= 1);
+                DEC(fr);
+                OutByte2(0DEH, 0F9H)  (* fdivp st1, st *)
+
+            |IL.opDIVFI:
+                ASSERT(fr >= 1);
+                DEC(fr);
+                OutByte2(0DEH, 0F1H)  (* fdivrp st1, st *)
+
+            |IL.opUMINF:
+                ASSERT(fr >= 0);
+                OutByte2(0D9H, 0E0H)  (* fchs *)
+
+            |IL.opFABS:
+                ASSERT(fr >= 0);
+                OutByte2(0D9H, 0E1H)  (* fabs *)
+
+            |IL.opFLT:
+                INC(fr);
+                IF fr > MAX_FR THEN
+                    ERRORS.ErrorMsg(fname, param1, param2, FPR_ERR)
+                END;
+                UnOp(reg1);
+                push(reg1);
+                OutByte3(0DBH, 004H, 024H); (* fild dword[esp] *)
+                pop(reg1);
+                drop
 
-        |IL.opPACKC:
-            UnOp(reg1);
-            pushc(param2);
-            OutByte3(0DBH, 004H, 024H);   (* fild dword[esp]  *)
-            OutByte2(0DDH, reg1);         (* fld qword[reg1]  *)
-            OutByte2(0D9H, 0FDH);         (* fscale           *)
-            OutByte2(0DDH, 018H + reg1);  (* fstp qword[reg1] *)
-            OutByte3(0DBH, 01CH, 024H);   (* fistp dword[esp] *)
-            pop(reg1);
-            drop
+            |IL.opFLOOR:
+                ASSERT(fr >= 0);
+                DEC(fr);
+                subrc(esp, 8);
+                OutByte2(09BH, 0D9H); OutByte3(07CH, 024H, 004H);                   (* fstcw word[esp+4]                    *)
+                OutByte2(09BH, 0D9H); OutByte3(07CH, 024H, 006H);                   (* fstcw word[esp+6]                    *)
+                OutByte2(066H, 081H); OutByte3(064H, 024H, 004H); OutWord(0F3FFH);  (* and   word[esp+4], 1111001111111111b *)
+                OutByte2(066H, 081H); OutByte3(04CH, 024H, 004H); OutWord(00400H);  (* or    word[esp+4], 0000010000000000b *)
+                OutByte2(0D9H, 06CH); OutByte2(024H, 004H);                         (* fldcw word[esp+4]                    *)
+                OutByte2(0D9H, 0FCH);                                               (* frndint                              *)
+                OutByte3(0DBH, 01CH, 024H);                                         (* fistp dword[esp]                     *)
+                pop(GetAnyReg());
+                OutByte2(0D9H, 06CH); OutByte2(024H, 002H);                         (* fldcw word[esp+2]                    *)
+                addrc(esp, 4)
+
+            |IL.opEQF:
+                ASSERT(fr >= 1);
+                DEC(fr, 2);
+                fcmp;
+                OutByte2(07AH, 003H);       (* jp L *)
+                setcc(sete, al)
+                                            (* L: *)
+
+            |IL.opNEF:
+                ASSERT(fr >= 1);
+                DEC(fr, 2);
+                fcmp;
+                OutByte2(07AH, 003H);       (* jp L *)
+                setcc(setne, al)
+                                            (* L: *)
+
+            |IL.opLTF:
+                ASSERT(fr >= 1);
+                DEC(fr, 2);
+                fcmp;
+                OutByte2(07AH, 00EH);       (* jp L *)
+                setcc(setc, al);
+                setcc(sete, ah);
+                test(eax);
+                setcc(sete, al);
+                andrc(eax, 1)
+                                            (* L: *)
+
+            |IL.opGTF:
+                ASSERT(fr >= 1);
+                DEC(fr, 2);
+                fcmp;
+                OutByte2(07AH, 00FH);       (* jp L *)
+                setcc(setc, al);
+                setcc(sete, ah);
+                cmprc(eax, 1);
+                setcc(sete, al);
+                andrc(eax, 1)
+                                            (* L: *)
+
+            |IL.opLEF:
+                ASSERT(fr >= 1);
+                DEC(fr, 2);
+                fcmp;
+                OutByte2(07AH, 003H);       (* jp L *)
+                setcc(setnc, al)
+                                            (* L: *)
+
+            |IL.opGEF:
+                ASSERT(fr >= 1);
+                DEC(fr, 2);
+                fcmp;
+                OutByte2(07AH, 010H);       (* jp L *)
+                setcc(setc, al);
+                setcc(sete, ah);
+                OutByte2(000H, 0E0H);       (* add al, ah *)
+                OutByte2(03CH, 001H);       (* cmp al, 1 *)
+                setcc(sete, al);
+                andrc(eax, 1)
+                                            (* L: *)
+
+            |IL.opINF:
+                INC(fr);
+                IF fr > MAX_FR THEN
+                    ERRORS.ErrorMsg(fname, param1, param2, FPR_ERR)
+                END;
+                LoadFltConst(UTILS.inf)
 
-        |IL.opUNPK:
-            BinOp(reg1, reg2);
-            OutByte2(0DDH, reg1);         (* fld qword[reg1]   *)
-            OutByte2(0D9H, 0F4H);         (* fxtract           *)
-            OutByte2(0DDH, 018H + reg1);  (* fstp qword[reg1]  *)
-            OutByte2(0DBH, 018H + reg2);  (* fistp dword[reg2] *)
-            drop;
-            drop
 
-        |IL.opPUSHF:
-            ASSERT(fr >= 0);
-            DEC(fr);
-            subrc(esp, 8);
-            OutByte3(0DDH, 01CH, 024H)    (* fstp qword[esp] *)
+            |IL.opLADR_UNPK:
+                n := param2 * 4;
+                reg1 := GetAnyReg();
+                OutByte2(8DH, 45H + reg1 * 8 + long(n));  (* lea reg1, dword[ebp + n] *)
+                OutIntByte(n);
+                BinOp(reg1, reg2);
+                OutByte2(0DDH, reg1);         (* fld qword[reg1]   *)
+                OutByte2(0D9H, 0F4H);         (* fxtract           *)
+                OutByte2(0DDH, 018H + reg1);  (* fstp qword[reg1]  *)
+                OutByte2(0DBH, 018H + reg2);  (* fistp dword[reg2] *)
+                drop;
+                drop
 
-        |IL.opLOADF:
-            INC(fr);
-            IF fr > MAX_FR THEN
-                ERRORS.ErrorMsg(fname, param1, param2, FPR_ERR)
-            END;
-            UnOp(reg1);
-            OutByte2(0DDH, reg1);         (* fld qword[reg1] *)
-            drop
+            |IL.opSADR_PARAM:
+                IF pic THEN
+                    reg1 := GetAnyReg();
+                    Pic(reg1, BIN.PICDATA, stroffs + param2);
+                    push(reg1);
+                    drop
+                ELSE
+                    OutByte(068H);  (* push _data + stroffs + param2 *)
+                    Reloc(BIN.RDATA, stroffs + param2)
+                END
 
-        |IL.opCONSTF:
-            INC(fr);
-            IF fr > MAX_FR THEN
-                ERRORS.ErrorMsg(fname, param1, param2, FPR_ERR)
-            END;
-            float := cmd.float;
-            IF float = 0.0 THEN
-                OutByte2(0D9H, 0EEH)      (* fldz *)
-            ELSIF float = 1.0 THEN
-                OutByte2(0D9H, 0E8H)      (* fld1 *)
-            ELSIF float = -1.0 THEN
-                OutByte2(0D9H, 0E8H);     (* fld1 *)
-                OutByte2(0D9H, 0E0H)      (* fchs *)
-            ELSE
-                LoadFltConst(float)
-            END
+            |IL.opVADR_PARAM, IL.opLLOAD32_PARAM:
+                pushm(ebp, param2 * 4)
 
-        |IL.opSAVEF, IL.opSAVEFI:
-            ASSERT(fr >= 0);
-            DEC(fr);
-            UnOp(reg1);
-            OutByte2(0DDH, 018H + reg1); (* fstp qword[reg1] *)
-            drop
+            |IL.opCONST_PARAM:
+                pushc(param2)
 
-        |IL.opADDF:
-            ASSERT(fr >= 1);
-            DEC(fr);
-            OutByte2(0DEH, 0C1H)  (* faddp st1, st *)
-
-        |IL.opSUBF:
-            ASSERT(fr >= 1);
-            DEC(fr);
-            OutByte2(0DEH, 0E9H)  (* fsubp st1, st *)
-
-        |IL.opSUBFI:
-            ASSERT(fr >= 1);
-            DEC(fr);
-            OutByte2(0DEH, 0E1H)  (* fsubrp st1, st *)
-
-        |IL.opMULF:
-            ASSERT(fr >= 1);
-            DEC(fr);
-            OutByte2(0DEH, 0C9H)  (* fmulp st1, st *)
-
-        |IL.opDIVF:
-            ASSERT(fr >= 1);
-            DEC(fr);
-            OutByte2(0DEH, 0F9H)  (* fdivp st1, st *)
-
-        |IL.opDIVFI:
-            ASSERT(fr >= 1);
-            DEC(fr);
-            OutByte2(0DEH, 0F1H)  (* fdivrp st1, st *)
-
-        |IL.opUMINF:
-            ASSERT(fr >= 0);
-            OutByte2(0D9H, 0E0H)  (* fchs *)
-
-        |IL.opFABS:
-            ASSERT(fr >= 0);
-            OutByte2(0D9H, 0E1H)  (* fabs *)
-
-        |IL.opFLT:
-            INC(fr);
-            IF fr > MAX_FR THEN
-                ERRORS.ErrorMsg(fname, param1, param2, FPR_ERR)
-            END;
-            UnOp(reg1);
-            push(reg1);
-            OutByte3(0DBH, 004H, 024H); (* fild dword[esp] *)
-            pop(reg1);
-            drop
+            |IL.opGLOAD32_PARAM:
+                IF pic THEN
+                    reg1 := GetAnyReg();
+                    Pic(reg1, BIN.PICBSS, param2);
+                    pushm(reg1, 0);
+                    drop
+                ELSE
+                    OutByte2(0FFH, 035H);  (* push dword[_bss + param2] *)
+                    Reloc(BIN.RBSS, param2)
+                END
 
-        |IL.opFLOOR:
-            ASSERT(fr >= 0);
-            DEC(fr);
-            subrc(esp, 8);
-            OutByte2(09BH, 0D9H); OutByte3(07CH, 024H, 004H);                   (* fstcw word[esp+4]                    *)
-            OutByte2(09BH, 0D9H); OutByte3(07CH, 024H, 006H);                   (* fstcw word[esp+6]                    *)
-            OutByte2(066H, 081H); OutByte3(064H, 024H, 004H); OutWord(0F3FFH);  (* and   word[esp+4], 1111001111111111b *)
-            OutByte2(066H, 081H); OutByte3(04CH, 024H, 004H); OutWord(00400H);  (* or    word[esp+4], 0000010000000000b *)
-            OutByte2(0D9H, 06CH); OutByte2(024H, 004H);                         (* fldcw word[esp+4]                    *)
-            OutByte2(0D9H, 0FCH);                                               (* frndint                              *)
-            OutByte3(0DBH, 01CH, 024H);                                         (* fistp dword[esp]                     *)
-            pop(GetAnyReg());
-            OutByte2(0D9H, 06CH); OutByte2(024H, 002H);                         (* fldcw word[esp+2]                    *)
-            addrc(esp, 4)
-
-        |IL.opEQF:
-            ASSERT(fr >= 1);
-            DEC(fr, 2);
-            fcmp;
-            OutByte2(07AH, 003H);       (* jp L *)
-            setcc(sete, al)
-                                        (* L: *)
-
-        |IL.opNEF:
-            ASSERT(fr >= 1);
-            DEC(fr, 2);
-            fcmp;
-            OutByte2(07AH, 003H);       (* jp L *)
-            setcc(setne, al)
-                                        (* L: *)
-
-        |IL.opLTF:
-            ASSERT(fr >= 1);
-            DEC(fr, 2);
-            fcmp;
-            OutByte2(07AH, 00EH);       (* jp L *)
-            setcc(setc, al);
-            setcc(sete, ah);
-            test(eax);
-            setcc(sete, al);
-            andrc(eax, 1)
-                                        (* L: *)
-
-        |IL.opGTF:
-            ASSERT(fr >= 1);
-            DEC(fr, 2);
-            fcmp;
-            OutByte2(07AH, 00FH);       (* jp L *)
-            setcc(setc, al);
-            setcc(sete, ah);
-            cmprc(eax, 1);
-            setcc(sete, al);
-            andrc(eax, 1)
-                                        (* L: *)
-
-        |IL.opLEF:
-            ASSERT(fr >= 1);
-            DEC(fr, 2);
-            fcmp;
-            OutByte2(07AH, 003H);       (* jp L *)
-            setcc(setnc, al)
-                                        (* L: *)
-
-        |IL.opGEF:
-            ASSERT(fr >= 1);
-            DEC(fr, 2);
-            fcmp;
-            OutByte2(07AH, 010H);       (* jp L *)
-            setcc(setc, al);
-            setcc(sete, ah);
-            OutByte2(000H, 0E0H);       (* add al, ah *)
-            OutByte2(03CH, 001H);       (* cmp al, 1 *)
-            setcc(sete, al);
-            andrc(eax, 1)
-                                        (* L: *)
-
-        |IL.opINF:
-            INC(fr);
-            IF fr > MAX_FR THEN
-                ERRORS.ErrorMsg(fname, param1, param2, FPR_ERR)
-            END;
-            LoadFltConst(UTILS.inf)
+            |IL.opLOAD32_PARAM:
+                UnOp(reg1);
+                pushm(reg1, 0);
+                drop
 
+            |IL.opGADR_SAVEC:
+                IF pic THEN
+                    reg1 := GetAnyReg();
+                    Pic(reg1, BIN.PICBSS, param1);
+                    OutByte2(0C7H, reg1);  (* mov dword[reg1], param2 *)
+                    OutInt(param2);
+                    drop
+                ELSE
+                    OutByte2(0C7H, 05H);  (* mov dword[_bss + param1], param2 *)
+                    Reloc(BIN.RBSS, param1);
+                    OutInt(param2)
+                END
 
-        |IL.opLADR_UNPK:
-            n := param2 * 4;
-            reg1 := GetAnyReg();
-            OutByte2(8DH, 45H + reg1 * 8 + long(n));  (* lea reg1, dword[ebp + n] *)
-            OutIntByte(n);
-            BinOp(reg1, reg2);
-            OutByte2(0DDH, reg1);         (* fld qword[reg1]   *)
-            OutByte2(0D9H, 0F4H);         (* fxtract           *)
-            OutByte2(0DDH, 018H + reg1);  (* fstp qword[reg1]  *)
-            OutByte2(0DBH, 018H + reg2);  (* fistp dword[reg2] *)
-            drop;
-            drop
+            |IL.opLADR_SAVEC:
+                n := param1 * 4;
+                OutByte2(0C7H, 45H + long(n));  (* mov dword[ebp + n], param2 *)
+                OutIntByte(n);
+                OutInt(param2)
 
-        |IL.opSADR_PARAM:
-            IF pic THEN
-                reg1 := GetAnyReg();
-                Pic(reg1, BIN.PICDATA, stroffs + param2);
-                push(reg1);
+            |IL.opLADR_SAVE:
+                UnOp(reg1);
+                movmr(ebp, param2 * 4, reg1);
                 drop
-            ELSE
-                OutByte(068H);  (* push _data + stroffs + param2 *)
-                Reloc(BIN.RDATA, stroffs + param2)
-            END
 
-        |IL.opVADR_PARAM, IL.opLLOAD32_PARAM:
-            pushm(ebp, param2 * 4)
+            |IL.opLADR_INCC:
+                n := param1 * 4;
+                IF ABS(param2) = 1 THEN
+                    OutByte2(0FFH, 45H + 8 * ORD(param2 = -1) + long(n));  (* inc/dec dword[ebp + n] *)
+                    OutIntByte(n)
+                ELSE
+                    OutByte2(81H + short(param2), 45H + long(n)); (* add dword[ebp + n], param2 *)
+                    OutIntByte(n);
+                    OutIntByte(param2)
+                END
 
-        |IL.opCONST_PARAM:
-            pushc(param2)
+            |IL.opLADR_INCCB, IL.opLADR_DECCB:
+                n := param1 * 4;
+                IF param2 = 1 THEN
+                    OutByte2(0FEH, 45H + 8 * ORD(opcode = IL.opLADR_DECCB) + long(n));  (* inc/dec byte[ebp + n] *)
+                    OutIntByte(n)
+                ELSE
+                    OutByte2(80H, 45H + 28H * ORD(opcode = IL.opLADR_DECCB) + long(n)); (* add/sub byte[ebp + n], param2 *)
+                    OutIntByte(n);
+                    OutByte(param2 MOD 256)
+                END
 
-        |IL.opGLOAD32_PARAM:
-            IF pic THEN
-                reg1 := GetAnyReg();
-                Pic(reg1, BIN.PICBSS, param2);
-                pushm(reg1, 0);
+            |IL.opLADR_INC, IL.opLADR_DEC:
+                n := param2 * 4;
+                UnOp(reg1);
+                OutByte2(01H + 28H * ORD(opcode = IL.opLADR_DEC), 45H + long(n) + reg1 * 8); (* add/sub dword[ebp + n], reg1 *)
+                OutIntByte(n);
                 drop
-            ELSE
-                OutByte2(0FFH, 035H);  (* push dword[_bss + param2] *)
-                Reloc(BIN.RBSS, param2)
-            END
-
-        |IL.opLOAD32_PARAM:
-            UnOp(reg1);
-            pushm(reg1, 0);
-            drop
 
-        |IL.opGADR_SAVEC:
-            IF pic THEN
-                reg1 := GetAnyReg();
-                Pic(reg1, BIN.PICBSS, param1);
-                OutByte2(0C7H, reg1);  (* mov dword[reg1], param2 *)
-                OutInt(param2);
+            |IL.opLADR_INCB, IL.opLADR_DECB:
+                n := param2 * 4;
+                UnOp(reg1);
+                OutByte2(28H * ORD(opcode = IL.opLADR_DECB), 45H + long(n) + reg1 * 8); (* add/sub byte[ebp + n], reg1 *)
+                OutIntByte(n);
                 drop
-            ELSE
-                OutByte2(0C7H, 05H);  (* mov dword[_bss + param1], param2 *)
-                Reloc(BIN.RBSS, param1);
-                OutInt(param2)
-            END
 
-        |IL.opLADR_SAVEC:
-            n := param1 * 4;
-            OutByte2(0C7H, 45H + long(n));  (* mov dword[ebp + n], param2 *)
-            OutIntByte(n);
-            OutInt(param2)
-
-        |IL.opLADR_SAVE:
-            UnOp(reg1);
-            movmr(ebp, param2 * 4, reg1);
-            drop
-
-        |IL.opLADR_INCC:
-            n := param1 * 4;
-            IF ABS(param2) = 1 THEN
-                OutByte2(0FFH, 45H + 8 * ORD(param2 = -1) + long(n));  (* inc/dec dword[ebp + n] *)
-                OutIntByte(n)
-            ELSE
-                OutByte2(81H + short(param2), 45H + long(n)); (* add dword[ebp + n], param2 *)
+            |IL.opLADR_INCL, IL.opLADR_EXCL:
+                n := param2 * 4;
+                UnOp(reg1);
+                cmprc(reg1, 32);
+                label := NewLabel();
+                jcc(jnb, label);
+                OutByte3(0FH, 0ABH + 8 * ORD(opcode = IL.opLADR_EXCL), 45H + long(n) + reg1 * 8); (* bts(r) dword[ebp + n], reg1 *)
                 OutIntByte(n);
-                OutIntByte(param2)
-            END
+                SetLabel(label);
+                drop
 
-        |IL.opLADR_INCCB, IL.opLADR_DECCB:
-            n := param1 * 4;
-            IF param2 = 1 THEN
-                OutByte2(0FEH, 45H + 8 * ORD(opcode = IL.opLADR_DECCB) + long(n));  (* inc/dec byte[ebp + n] *)
-                OutIntByte(n)
-            ELSE
-                OutByte2(80H, 45H + 28H * ORD(opcode = IL.opLADR_DECCB) + long(n)); (* add/sub byte[ebp + n], param2 *)
+            |IL.opLADR_INCLC, IL.opLADR_EXCLC:
+                n := param1 * 4;
+                OutByte3(0FH, 0BAH, 6DH + long(n) + 8 * ORD(opcode = IL.opLADR_EXCLC)); (* bts(r) dword[ebp + n], param2 *)
                 OutIntByte(n);
-                OutByte(param2 MOD 256)
-            END
-
-        |IL.opLADR_INC, IL.opLADR_DEC:
-            n := param2 * 4;
-            UnOp(reg1);
-            OutByte2(01H + 28H * ORD(opcode = IL.opLADR_DEC), 45H + long(n) + reg1 * 8); (* add/sub dword[ebp + n], reg1 *)
-            OutIntByte(n);
-            drop
-
-        |IL.opLADR_INCB, IL.opLADR_DECB:
-            n := param2 * 4;
-            UnOp(reg1);
-            OutByte2(28H * ORD(opcode = IL.opLADR_DECB), 45H + long(n) + reg1 * 8); (* add/sub byte[ebp + n], reg1 *)
-            OutIntByte(n);
-            drop
-
-        |IL.opLADR_INCL, IL.opLADR_EXCL:
-            n := param2 * 4;
-            UnOp(reg1);
-            cmprc(reg1, 32);
-            label := NewLabel();
-            jcc(jnb, label);
-            OutByte3(0FH, 0ABH + 8 * ORD(opcode = IL.opLADR_EXCL), 45H + long(n) + reg1 * 8); (* bts(r) dword[ebp + n], reg1 *)
-            OutIntByte(n);
-            SetLabel(label);
-            drop
+                OutByte(param2)
 
-        |IL.opLADR_INCLC, IL.opLADR_EXCLC:
-            n := param1 * 4;
-            OutByte3(0FH, 0BAH, 6DH + long(n) + 8 * ORD(opcode = IL.opLADR_EXCLC)); (* bts(r) dword[ebp + n], param2 *)
-            OutIntByte(n);
-            OutByte(param2)
+            |IL.opFNAME:
+                fname := cmd(IL.FNAMECMD).fname
 
-        |IL.opFNAME:
-            fname := cmd(IL.FNAMECMD).fname
+            END;
 
+            cmd := cmd.next(COMMAND)
         END;
 
-        cmd := cmd.next(COMMAND)
-    END;
-
-    ASSERT(R.pushed = 0);
-    ASSERT(R.top = -1);
-    ASSERT(fr = -1)
-END translate;
+        ASSERT(R.pushed = 0);
+        ASSERT(R.top = -1);
+        ASSERT(fr = -1)
+    END translate;
 
 
 PROCEDURE prolog (pic: BOOLEAN; target, stack, dllret: INTEGER): INTEGER;
-VAR
-    reg1, entry, L, dcount: INTEGER;
-
-BEGIN
-    entry := NewLabel();
-    SetLabel(entry);
-    dcount := CHL.Length(IL.codes.data);
-
-    push(ebp);
-    mov(ebp, esp);
-    SetLabel(NewLabel());
-    mainFltConstLabel := CodeList.last(LABEL);
-    FltConstLabel := mainFltConstLabel;
-    mainLocVarSize := 0;
-    LocVarSize := 0;
-
-    IF target IN {TARGETS.Win32DLL, TARGETS.KolibriOSDrv} THEN
-        IF target = TARGETS.Win32DLL THEN
-            pushm(ebp, 16)
+    VAR
+        reg1, entry, L, dcount: INTEGER;
+
+    BEGIN
+        entry := NewLabel();
+        SetLabel(entry);
+        dcount := CHL.Length(IL.codes.data);
+
+        push(ebp);
+        mov(ebp, esp);
+        SetLabel(NewLabel());
+        mainFltConstLabel := CodeList.last(LABEL);
+        FltConstLabel := mainFltConstLabel;
+        mainLocVarSize := 0;
+        LocVarSize := 0;
+
+        IF target IN {TARGETS.Win32DLL, TARGETS.KolibriOSDrv} THEN
+            IF target = TARGETS.Win32DLL THEN
+                pushm(ebp, 16)
+            ELSE
+                pushc(0)
+            END;
+            pushm(ebp, 12);
+            pushm(ebp, 8);
+            CallRTL(pic, IL._dllentry);
+            test(eax);
+            jcc(je, dllret);
+            pushc(0)
+        ELSIF target = TARGETS.KolibriOSDLL THEN
+            OutByte(68H);  (* push IMPORT *)
+            Reloc(BIN.IMPTAB, 0)
+        ELSIF target = TARGETS.KolibriOS THEN
+            reg1 := GetAnyReg();
+            Pic(reg1, BIN.IMPTAB, 0);
+            push(reg1);    (* push IMPORT *)
+            drop
+        ELSIF target = TARGETS.Linux32 THEN
+            mov(eax, ebp);
+            addrc(eax, 4);
+            push(eax)
         ELSE
             pushc(0)
         END;
-        pushm(ebp, 12);
-        pushm(ebp, 8);
-        CallRTL(pic, IL._dllentry);
-        test(eax);
-        jcc(je, dllret);
-        pushc(0)
-    ELSIF target = TARGETS.KolibriOSDLL THEN
-        OutByte(68H);  (* push IMPORT *)
-        Reloc(BIN.IMPTAB, 0)
-    ELSIF target = TARGETS.KolibriOS THEN
-        reg1 := GetAnyReg();
-        Pic(reg1, BIN.IMPTAB, 0);
-        push(reg1);    (* push IMPORT *)
-        drop
-    ELSIF target = TARGETS.Linux32 THEN
-        mov(eax, ebp);
-        addrc(eax, 4);
-        push(eax)
-    ELSE
-        pushc(0)
-    END;
 
-    IF pic THEN
-        reg1 := GetAnyReg();
-        Pic(reg1, BIN.PICCODE, entry);
-        push(reg1);    (* push CODE *)
-        Pic(reg1, BIN.PICDATA, 0);
-        push(reg1);    (* push _data *)
-        pushc(tcount);
-        Pic(reg1, BIN.PICDATA, tcount * 4 + dcount);
-        push(reg1);    (* push _data + tcount * 4 + dcount *)
-        drop
-    ELSE
-        OutByte(68H);  (* push CODE *)
-        Reloc(BIN.RCODE, entry);
-        OutByte(68H);  (* push _data *)
-        Reloc(BIN.RDATA, 0);
-        pushc(tcount);
-        OutByte(68H);  (* push _data + tcount * 4 + dcount *)
-        Reloc(BIN.RDATA, tcount * 4 + dcount)
-    END;
+        IF pic THEN
+            reg1 := GetAnyReg();
+            Pic(reg1, BIN.PICCODE, entry);
+            push(reg1);    (* push CODE *)
+            Pic(reg1, BIN.PICDATA, 0);
+            push(reg1);    (* push _data *)
+            pushc(tcount);
+            Pic(reg1, BIN.PICDATA, tcount * 4 + dcount);
+            push(reg1);    (* push _data + tcount * 4 + dcount *)
+            drop
+        ELSE
+            OutByte(68H);  (* push CODE *)
+            Reloc(BIN.RCODE, entry);
+            OutByte(68H);  (* push _data *)
+            Reloc(BIN.RDATA, 0);
+            pushc(tcount);
+            OutByte(68H);  (* push _data + tcount * 4 + dcount *)
+            Reloc(BIN.RDATA, tcount * 4 + dcount)
+        END;
 
-    CallRTL(pic, IL._init);
+        CallRTL(pic, IL._init);
 
-    IF target IN {TARGETS.Win32C, TARGETS.Win32GUI, TARGETS.Linux32} THEN
-        L := NewLabel();
-        pushc(0);
-        push(esp);
-        pushc(1024 * 1024 * stack);
-        pushc(0);
-        CallRTL(pic, IL._new);
-        pop(eax);
-        test(eax);
-        jcc(je, L);
-        addrc(eax, 1024 * 1024 * stack - 4);
-        mov(esp, eax);
-        SetLabel(L)
-    END
+        IF target IN {TARGETS.Win32C, TARGETS.Win32GUI, TARGETS.Linux32} THEN
+            L := NewLabel();
+            pushc(0);
+            push(esp);
+            pushc(1024 * 1024 * stack);
+            pushc(0);
+            CallRTL(pic, IL._new);
+            pop(eax);
+            test(eax);
+            jcc(je, L);
+            addrc(eax, 1024 * 1024 * stack - 4);
+            mov(esp, eax);
+            SetLabel(L)
+        END
 
-    RETURN entry
-END prolog;
+        RETURN entry
+    END prolog;
 
 
 PROCEDURE epilog (pic: BOOLEAN; modname: ARRAY OF CHAR; target, stack, ver, dllinit, dllret, sofinit: INTEGER);
-VAR
-    exp:  IL.EXPORT_PROC;
-    path, name, ext: PATHS.PATH;
+    VAR
+        exp:  IL.EXPORT_PROC;
+        path, name, ext: PATHS.PATH;
 
-    dcount, i: INTEGER;
+        dcount, i: INTEGER;
 
 
-    PROCEDURE _import (imp: LISTS.LIST);
-    VAR
-        lib:  IL.IMPORT_LIB;
-        proc: IL.IMPORT_PROC;
+        PROCEDURE _import (imp: LISTS.LIST);
+        VAR
+            lib:  IL.IMPORT_LIB;
+            proc: IL.IMPORT_PROC;
 
-    BEGIN
+        BEGIN
 
-        lib := imp.first(IL.IMPORT_LIB);
-        WHILE lib # NIL DO
-            BIN.Import(program, lib.name, 0);
-            proc := lib.procs.first(IL.IMPORT_PROC);
-            WHILE proc # NIL DO
-                BIN.Import(program, proc.name, proc.label);
-                proc := proc.next(IL.IMPORT_PROC)
-            END;
-            lib := lib.next(IL.IMPORT_LIB)
-        END
+            lib := imp.first(IL.IMPORT_LIB);
+            WHILE lib # NIL DO
+                BIN.Import(program, lib.name, 0);
+                proc := lib.procs.first(IL.IMPORT_PROC);
+                WHILE proc # NIL DO
+                    BIN.Import(program, proc.name, proc.label);
+                    proc := proc.next(IL.IMPORT_PROC)
+                END;
+                lib := lib.next(IL.IMPORT_LIB)
+            END
 
-    END _import;
-
-
-BEGIN
-
-    IF target IN {TARGETS.Win32C, TARGETS.Win32GUI, TARGETS.KolibriOS, TARGETS.Linux32} THEN
-        pushc(0);
-        CallRTL(pic, IL._exit);
-    ELSIF target = TARGETS.Win32DLL THEN
-        SetLabel(dllret);
-        movrc(eax, 1);
-        OutByte(0C9H); (* leave *)
-        OutByte3(0C2H, 0CH, 0) (* ret 12 *)
-    ELSIF target = TARGETS.KolibriOSDrv THEN
-        OutByte(0C9H); (* leave *)
-        ret;
-        SetLabel(dllret);
-        movrc(eax, 0);
-        OutByte(0C9H); (* leave *)
-        ret
-    ELSIF target = TARGETS.KolibriOSDLL THEN
-        movrc(eax, 1);
-        OutByte(0C9H); (* leave *)
-        ret
-    ELSIF target = TARGETS.KolibriOSKer THEN
-        OutByte(0C9H); (* leave *)
-        ret;
-    ELSIF target = TARGETS.Linux32SO THEN
-        OutByte(0C9H); (* leave *)
-        ret;
-        SetLabel(sofinit);
-        CallRTL(pic, IL._sofinit);
-        ret
-    END;
+        END _import;
 
-    fixup;
 
-    dcount := CHL.Length(IL.codes.data);
+    BEGIN
 
-    FOR i := 0 TO tcount - 1 DO
-        BIN.PutData32LE(program, CHL.GetInt(IL.codes.types, i))
-    END;
+        IF target IN {TARGETS.Win32C, TARGETS.Win32GUI, TARGETS.KolibriOS, TARGETS.Linux32} THEN
+            pushc(0);
+            CallRTL(pic, IL._exit);
+        ELSIF target = TARGETS.Win32DLL THEN
+            SetLabel(dllret);
+            movrc(eax, 1);
+            OutByte(0C9H); (* leave *)
+            OutByte3(0C2H, 0CH, 0) (* ret 12 *)
+        ELSIF target = TARGETS.KolibriOSDrv THEN
+            OutByte(0C9H); (* leave *)
+            ret;
+            SetLabel(dllret);
+            movrc(eax, 0);
+            OutByte(0C9H); (* leave *)
+            ret
+        ELSIF target = TARGETS.KolibriOSDLL THEN
+            movrc(eax, 1);
+            OutByte(0C9H); (* leave *)
+            ret
+        ELSIF target = TARGETS.KolibriOSKer THEN
+            OutByte(0C9H); (* leave *)
+            ret;
+        ELSIF target = TARGETS.Linux32SO THEN
+            OutByte(0C9H); (* leave *)
+            ret;
+            SetLabel(sofinit);
+            CallRTL(pic, IL._sofinit);
+            ret
+        END;
 
-    FOR i := 0 TO dcount - 1 DO
-        BIN.PutData(program, CHL.GetByte(IL.codes.data, i))
-    END;
+        fixup;
 
-    program.modname := CHL.Length(program.data);
+        dcount := CHL.Length(IL.codes.data);
 
-    PATHS.split(modname, path, name, ext);
-    BIN.PutDataStr(program, name);
-    BIN.PutDataStr(program, ext);
-    BIN.PutData(program, 0);
+        FOR i := 0 TO tcount - 1 DO
+            BIN.PutData32LE(program, CHL.GetInt(IL.codes.types, i))
+        END;
 
-    IF target = TARGETS.KolibriOSDLL THEN
-        BIN.Export(program, "lib_init", dllinit);
-    END;
+        FOR i := 0 TO dcount - 1 DO
+            BIN.PutData(program, CHL.GetByte(IL.codes.data, i))
+        END;
 
-    exp := IL.codes.export.first(IL.EXPORT_PROC);
-    WHILE exp # NIL DO
-        BIN.Export(program, exp.name, exp.label);
-        exp := exp.next(IL.EXPORT_PROC)
-    END;
+        program.modname := CHL.Length(program.data);
+
+        PATHS.split(modname, path, name, ext);
+        BIN.PutDataStr(program, name);
+        BIN.PutDataStr(program, ext);
+        BIN.PutData(program, 0);
+
+        IF target = TARGETS.KolibriOSDLL THEN
+            BIN.Export(program, "lib_init", dllinit);
+        END;
+
+        exp := IL.codes.export.first(IL.EXPORT_PROC);
+        WHILE exp # NIL DO
+            BIN.Export(program, exp.name, exp.label);
+            exp := exp.next(IL.EXPORT_PROC)
+        END;
 
-    _import(IL.codes._import);
+        _import(IL.codes._import);
 
-    IL.set_bss(MAX(IL.codes.bss, MAX(IL.codes.dmin - CHL.Length(IL.codes.data), 4)));
+        IL.set_bss(MAX(IL.codes.bss, MAX(IL.codes.dmin - CHL.Length(IL.codes.data), 4)));
 
-    BIN.SetParams(program, IL.codes.bss, stack * (1024 * 1024), WCHR(ver DIV 65536), WCHR(ver MOD 65536))
-END epilog;
+        BIN.SetParams(program, IL.codes.bss, stack * (1024 * 1024), WCHR(ver DIV 65536), WCHR(ver MOD 65536))
+    END epilog;
 
 
 PROCEDURE align16* (bit64: BOOLEAN);
-BEGIN
-    IF TARGETS.WinLin THEN
-        WHILE CHL.Length(IL.codes.data) MOD 16 # 0 DO
-            CHL.PushByte(IL.codes.data, 0)
-        END;
-        WHILE CHL.Length(IL.codes.types) MOD (4 - 2*ORD(bit64)) # 0 DO
-            CHL.PushInt(IL.codes.types, 0)
+    BEGIN
+        IF TARGETS.WinLin THEN
+            WHILE CHL.Length(IL.codes.data) MOD 16 # 0 DO
+                CHL.PushByte(IL.codes.data, 0)
+            END;
+            WHILE CHL.Length(IL.codes.types) MOD (4 - 2*ORD(bit64)) # 0 DO
+                CHL.PushInt(IL.codes.types, 0)
+            END
         END
-    END
-END align16;
+    END align16;
 
 
 PROCEDURE CodeGen* (outname: ARRAY OF CHAR; target: INTEGER; options: PROG.OPTIONS);
-VAR
-    dllret, dllinit, sofinit: INTEGER;
-    opt: PROG.OPTIONS;
-
-BEGIN
-    FR[0] := 0;
-    align16(FALSE);
-    tcount := CHL.Length(IL.codes.types);
-
-    opt := options;
-    CodeList := LISTS.create(NIL);
+    VAR
+        dllret, dllinit, sofinit: INTEGER;
+        opt: PROG.OPTIONS;
 
-    program := BIN.create(IL.codes.lcount);
+    BEGIN
+        FR[0] := 0;
+        align16(FALSE);
+        tcount := CHL.Length(IL.codes.types);
 
-    dllret  := NewLabel();
-    sofinit := NewLabel();
+        opt := options;
+        CodeList := LISTS.create(NIL);
 
-    IF target = TARGETS.KolibriOSDLL THEN
-        opt.pic := FALSE
-    END;
+        program := BIN.create(IL.codes.lcount);
 
-    IF target IN {TARGETS.KolibriOSKer, TARGETS.KolibriOSDrv} THEN
-        opt.pic := TRUE
-    END;
+        dllret  := NewLabel();
+        sofinit := NewLabel();
 
-    IF TARGETS.OS IN {TARGETS.osWIN32, TARGETS.osLINUX32} THEN
-        opt.pic := TRUE
-    END;
+        IF target = TARGETS.KolibriOSDLL THEN
+            opt.pic := FALSE
+        END;
 
-    REG.Init(R, push, pop, mov, xchg, {eax, ecx, edx});
+        IF target IN {TARGETS.KolibriOSKer, TARGETS.KolibriOSDrv} THEN
+            opt.pic := TRUE
+        END;
 
-    dllinit := prolog(opt.pic, target, opt.stack, dllret);
-    translate(opt.pic, tcount * 4, target);
-    epilog(opt.pic, outname, target, opt.stack, opt.version, dllinit, dllret, sofinit);
+        IF TARGETS.OS IN {TARGETS.osWIN32, TARGETS.osLINUX32} THEN
+            opt.pic := TRUE
+        END;
 
-    BIN.fixup(program);
-    IF TARGETS.OS = TARGETS.osWIN32 THEN
-        PE32.write(program, outname, target = TARGETS.Win32C, target = TARGETS.Win32DLL, FALSE, opt.PE32FileAlignment)
-    ELSIF target = TARGETS.KolibriOSDrv THEN
-        PE32.write(program, outname, FALSE, TRUE, FALSE, 512)
-    ELSIF target IN {TARGETS.KolibriOS, TARGETS.KolibriOSKer} THEN
-        KOS.write(program, outname, target = TARGETS.KolibriOSKer)
-    ELSIF target = TARGETS.KolibriOSDLL THEN
-        MSCOFF.write(program, outname, opt.version)
-    ELSIF TARGETS.OS = TARGETS.osLINUX32 THEN
-        ELF.write(program, outname, sofinit, target = TARGETS.Linux32SO, FALSE)
-    END
-END CodeGen;
+        REG.Init(R, push, pop, mov, xchg, {eax, ecx, edx});
+
+        dllinit := prolog(opt.pic, target, opt.stack, dllret);
+        translate(opt.pic, tcount * 4, target);
+        epilog(opt.pic, outname, target, opt.stack, opt.version, dllinit, dllret, sofinit);
+
+        BIN.fixup(program);
+        IF TARGETS.OS = TARGETS.osWIN32 THEN
+            PE32.write(program, outname, target = TARGETS.Win32C, target = TARGETS.Win32DLL, FALSE, opt.PE32FileAlignment)
+        ELSIF target = TARGETS.KolibriOSDrv THEN
+            PE32.write(program, outname, FALSE, TRUE, FALSE, 512)
+        ELSIF target IN {TARGETS.KolibriOS, TARGETS.KolibriOSKer} THEN
+            KOS.write(program, outname, target = TARGETS.KolibriOSKer)
+        ELSIF target = TARGETS.KolibriOSDLL THEN
+            MSCOFF.write(program, outname, opt.version)
+        ELSIF TARGETS.OS = TARGETS.osLINUX32 THEN
+            ELF.write(program, outname, sofinit, target = TARGETS.Linux32SO, FALSE)
+        END
+    END CodeGen;
 
 
 PROCEDURE SetProgram* (prog: BIN.PROGRAM);
-BEGIN
-    program := prog;
-    CodeList := LISTS.create(NIL)
-END SetProgram;
+    BEGIN
+        program := prog;
+        CodeList := LISTS.create(NIL)
+    END SetProgram;
 
 
 END X86.

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff