x86128: (Default)
[personal profile] x86128
Добавил компиляцию оператора IF.

MODULE Samples;
var t1 : integer;

begin

    t1 := 10;
    if t1 = 10 then
        writeint(10)
    elsif t1 < 0 then
        writeint(-5)
    else
        writeint(44)
    end

END Samples.



MODULE Samples
{'decls': {'consts': {}, 'procs': {}, 'vars': {'t1': (0, 'integer')}},
 'name': 'Samples',
 'text': [('CONST', '10'),
          ('STOR', 't1'),
          ('LOAD', 't1'),
          ('CONST', '10'),
          ('RELOP', '='),
          ('BR_ZERO', 'L0'),
          ('CONST', '10'),
          ('CALL', 'writeint'),
          ('BR', 'L3'),
          ('LABEL', 'L0'),
          ('LOAD', 't1'),
          ('CONST', '0'),
          ('RELOP', '<'),
          ('BR_ZERO', 'L1'),
          ('CONST', '5'),
          ('UNARY', '-'),
          ('CALL', 'writeint'),
          ('BR', 'L3'),
          ('LABEL', 'L1'),
          ('CONST', '44'),
          ('CALL', 'writeint'),
          ('LABEL', 'L3'),
          ('STOP', '')]}
10
STOP at 22
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

x86128: (Default)
x86128

April 2023

S M T W T F S
      1
2345678
9101112131415
16171819202122
232425 26272829
30      

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 22nd, 2025 07:02 am
Powered by Dreamwidth Studios