Hey.
Thanks to the developers of MAD Pascal!
I found out that there are problems in working with pointers.
For example:
program TestProgram;
var
PA, PB: ^Word;
begin
PA: = Pointer($1111);
PB: = @PA; // Error: PB = PA {=$1111}, but should be PB = Addr(PA)
end.
Similarly, the problem is when calling a procedure with a var parameter pointer:
program TestProgram;
procedure Tst(var P:Pointer);
var
TP: Pointer;
begin
TP:= Pointer(Word(P) + $123);
//Error: TP <> ($1111+$0123) since in this case "Word (P)" is executed as "Word (P ^)"
P:= TP;
end;
var
PA, PB: Pointer;
PC: Pointer;
begin
PA:= Pointer($1111);
PC:= PA;
Tst(PC);
//Error: PC = PA {$1111}, but should be PC = $1234
PB:= PC;
end.
If the type "pointer" is replaced by a "word", then the program runs correctly.