Skip to content

Assignment to constant with absolute

3.3.1 Oct 2024

1

Apparently missing documentation:

I don't think the below is correct (it crashes, but I don't think it should be compiled)

It isn't meant to do anything (just testing stuff)

"1 := 2" would be incorrect.

I found no docs that absolute may take an address (comments below point out the diagram has "integer expression").

As a side note => google doesn't make much out of that diagram. So mentioning it in text may be a good idea. But technically it would be fixed if documented in the diagram.

program Project1;

procedure foo(bar: integer);
var x: integer absolute 1;
begin
  x := 2;
  x := bar;
  write(x);
end;

begin
  foo(1);
  readln;
end.

2

On a related note

program Project1;

procedure foo(bar: integer);
var x: integer absolute 'aa';;
begin
  x := 2;
  x := bar;
  write(x);
end;

begin
  foo(1);
  readln;
end.

Without the 2nd ; it complains `semicolon expected.

As above it gives project1.lpr(15,1) Error: Undefined symbol: aa (first seen in project1.o)

3

Is there are reason why an identifier (another variable or typed-constant) can be but into brackets?

var
  a: byte;
  b: integer absolute (a);

() could be part of integer expression, but the above is not.

Edited by Martin
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information