Recent

Author Topic: PXSC  (Read 995 times)

kjteng

  • Sr. Member
  • ****
  • Posts: 259
PXSC
« on: February 28, 2024, 06:40:16 am »
Extract from freePascal wiki: "...In PXSC, the loc function is the same as addr presented here....". Can someone tell me what is PXSC and how is it relates to freepascal?

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Re: PXSC
« Reply #1 on: February 28, 2024, 06:54:59 am »
What page of the wiki?

see info here:
http://www2.math.uni-wuppertal.de/wrswt/xsc/pxsc.html

kjteng

  • Sr. Member
  • ****
  • Posts: 259
Re: PXSC
« Reply #2 on: February 28, 2024, 06:59:58 am »
https://wiki.freepascal.org/Addr#:~:text=Addr%20is%20a%20compiler%20intrinsic,0).

P/S: ok. I found part of the answer: PXSC = PASCAL for Extended Scientific Computing but I am still interested to find more about it.

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Re: PXSC
« Reply #3 on: February 28, 2024, 07:09:37 am »
Added dummy page
https://wiki.freepascal.org/PXSC
and changed all Wiki mentions 'pxsc' to the wiki link.

kjteng

  • Sr. Member
  • ****
  • Posts: 259
Re: PXSC
« Reply #4 on: February 28, 2024, 08:11:19 am »
Thanks for your reply and information.
BTW, since you are updating the wiki page, can you look into the following statement (in the same wiki page) which I think may not be valid now:-
Quote
Also, in {$mode FPC} and {$mode objFPC} the @‑address operator has to be used to assign values to procedural values (unless {$modeSwitch classicalProcVars+} is set). In {$mode TP} and {$mode Delphi}, however, no operator at all may be used.
Based on my testing result, the mainly difference between addr and @ is: @(x) returns typed pointer when {$T} switch is on while addr(x) always return an untyped pointer.
Thank you.

AlexTP

  • Hero Member
  • *****
  • Posts: 2402
    • UVviewsoft
Re: PXSC
« Reply #5 on: February 28, 2024, 08:34:01 am »
Such wiki change must be made not by me.
sorry. i don't know if @ and addr() work the same or not.
need to check it...

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: PXSC
« Reply #6 on: February 28, 2024, 09:07:08 am »
Thanks for your reply and information.
BTW, since you are updating the wiki page, can you look into the following statement (in the same wiki page) which I think may not be valid now:-
Quote
Also, in {$mode FPC} and {$mode objFPC} the @‑address operator has to be used to assign values to procedural values (unless {$modeSwitch classicalProcVars+} is set). In {$mode TP} and {$mode Delphi}, however, no operator at all may be used.
Based on my testing result, the mainly difference between addr and @ is: @(x) returns typed pointer when {$T} switch is on while addr(x) always return an untyped pointer.
Thank you.

This is for procedure variables specifically. There @ can, in the case of methods, return two pointers.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: PXSC
« Reply #7 on: February 28, 2024, 09:12:15 am »
Extract from freePascal wiki: "...In PXSC, the loc function is the same as addr presented here....". Can someone tell me what is PXSC and how is it relates to freepascal?

What does the language reference manual have to say about it? You should not be relying on the wiki as a source of authoritative information.

https://www.freepascal.org/docs.html

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

kjteng

  • Sr. Member
  • ****
  • Posts: 259
Re: PXSC
« Reply #8 on: February 28, 2024, 09:47:21 am »

What does the language reference manual have to say about it? You should not be relying on the wiki as a source of authoritative information.

https://www.freepascal.org/docs.html

MarkMLl
I am not relying the wiki. I just happened to landed on that wiki page via some weblinks. I think some of the info might be outdated and should be changed so that it wont misslead other reader. However I m not 100% sure. That's the reason why I requested the more experience expert here to have a look at that page.

nanobit

  • Full Member
  • ***
  • Posts: 160
Re: PXSC
« Reply #9 on: February 28, 2024, 10:17:21 am »
Based on my testing result, the mainly difference between addr and @ is: @(x) returns typed pointer when {$T} switch is on while addr(x) always return an untyped pointer.

Beware, {$T+} has also effects on pointermath (eg. on (@someDWord + 1)),
increases the increment from untyped to typed pointer.

Kays

  • Hero Member
  • *****
  • Posts: 575
  • Whasup!?
    • KaiBurghardt.de
Re: PXSC
« Reply #10 on: February 28, 2024, 10:46:53 pm »
[…] Can someone tell me what is PXSC and how is it relates to freepascal?
Occasionally there are statement regarding foreign Pascal dialects in order to ease transition to the FreePascal dialect.
[…] can you look into the following statement (in the same wiki page) which I think may not be valid now:-
Quote
Also, in {$mode FPC} and {$mode objFPC} the @‑address operator has to be used to assign values to procedural values (unless {$modeSwitch classicalProcVars+} is set). In {$mode TP} and {$mode Delphi}, however, no operator at all may be used.
Based on my testing result, the mainly difference between addr and @ is: @(x) returns typed pointer when {$T} switch is on while addr(x) always return an untyped pointer. […]
It’s this: Example program
Code: Pascal  [Select][+][-]
  1. program routinePointerTest(output);
  2.         procedure foo;
  3.                 begin
  4.                         writeLn('Hello world!');
  5.                 end;
  6.         var
  7.                 p: procedure;
  8.         begin
  9.                 p := foo; { or @foo }
  10.                 p;
  11.         end.
foo@foo
{$mode FPC} ↯  ✔ 
{$mode objFPC} ↯  ✔ 
{$mode TP} ✔  ↯ 
{$mode Delphi} ✔  ✔ 
{$mode macPas} ✔  ↯ 

Added dummy page
https://wiki.freepascal.org/PXSC
and changed all Wiki mentions 'pxsc' to the wiki link.
Aaaand flagged as copyright infringement.
« Last Edit: February 28, 2024, 10:52:30 pm by Kays »
Yours Sincerely
Kai Burghardt

 

TinyPortal © 2005-2018