Oct. 1st, 2021

x86128: (Default)
Добавил компиляцию оператора 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

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 10:52 am
Powered by Dreamwidth Studios