Thank you for your help.
Maybe I wasn't specific enough - the following test code is OK for the first call, but not for other consecutive calls:
uses crt;
function xyz():word;
var
val:word=0;
val1:word=0;
begin
repeat
writeln('0. val1=',val1, ' val=', val);
val1 := 10;
Readkey;
writeln('1. val1=',val1, ' val=', val);
if (val1 <> 0) then val := 10;
Readkey;
writeln('2. val1=',val1, ' val=', val);
until (val = val1);
Readkey;
writeln('3. val1=',val1, ' val=', val);
xyz:=val;
end;
program test_local_vars_mp;
var
k:byte;
begin
for k:=0 to 255 do
xyz();
repeat until keypressed;
end.
Am I doing something wrong? I haven't tried yet to analyze a65 or xex files.
I am using Mad Pascal 1.6.4 with mads 2.1.0 build 8 (23 Dec 19).
mp.exe test_local_vars_mp.pas
mads.exe test_local_vars_mp.a65 -x -i:"c:\Mad-Pascal-1.6.4\base\" -o:test_local_vars_mp.xex -l:test_local_vars_mp.lst
test_local_vars_mp.lst
test_local_vars_mp.xex
test_local_vars_mp.a65
test_local_vars_mp.pas