Sign in Join
Wiki copytemporary

Absolute/fi: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-` Absolute` [[modifier/fi|modifoija]] aiheuttaa [[Variable/fi|muuttujan]] tallentamisen samaan muistialueeseen kuin toinen muuttuja.
2-```
1+`Absolute` [[modifier/fi|modifoija]] aiheuttaa [[Variable/fi|muuttujan]] tallentamisen samaan muistialueeseen kuin toinen muuttuja.
2+
3+``` pascal
34// Esimerkki little endian x64 prosessori
4- Uses SysUtils;
5-
6- Var
7- anInt : Integer;
8- anotherInt : Integer absolute anInt;
9- firstByte : Byte absolute anInt;
10-
11- begin
12- // Kun molemmat integer-muuttujat ovat samassa muistipaikassa niin muutos heijastuu
13- // myös toisessakin
14- anInt := 20;
15-
16- WriteLn(IntToStr(anInt) + ' ' + IntToStr(anotherInt)); // Tulostuu: 20 20
17-
18- // Lukuarvo 20 sopii tavun kokoiseen muistipaikkaan
19-
20- WriteLn('firstByte: ' + IntToStr(firstByte)); // Tulostuu: firstByte: 20
21-
22- anotherInt := 333;
23-
24- WriteLn(IntToStr(anInt) + ' ' + IntToStr(anotherInt)); // Tulostuu: 333 333
25-
26- // Luku 333 on liian iso sopiakseen tavun kokoiseen muistipaikkaan
27- // little-endian x64 - vähiten merkitsevä tavu on ensimmäisenä muistissa:
28- // 333 = 101001101 = 01001101 00000001 muistissa = $4D $01 = desimaalisena: 77 1
29-
30- WriteLn('firstByte: ' + IntToStr(firstByte)); // Tulostuu: firstByte: 77
31- end.
5+Uses SysUtils;
6+
7+Var
8+ anInt : Integer;
9+ anotherInt : Integer absolute anInt;
10+ firstByte : Byte absolute anInt;
11+
12+begin
13+ // Kun molemmat integer-muuttujat ovat samassa muistipaikassa niin muutos heijastuu
14+ // myös toisessakin
15+ anInt := 20;
16+
17+ WriteLn(IntToStr(anInt) + ' ' + IntToStr(anotherInt)); // Tulostuu: 20 20
18+
19+ // Lukuarvo 20 sopii tavun kokoiseen muistipaikkaan
20+
21+ WriteLn('firstByte: ' + IntToStr(firstByte)); // Tulostuu: firstByte: 20
22+
23+ anotherInt := 333;
24+
25+ WriteLn(IntToStr(anInt) + ' ' + IntToStr(anotherInt)); // Tulostuu: 333 333
26+
27+ // Luku 333 on liian iso sopiakseen tavun kokoiseen muistipaikkaan
28+ // little-endian x64 - vähiten merkitsevä tavu on ensimmäisenä muistissa:
29+ // 333 = 101001101 = 01001101 00000001 muistissa = $4D $01 = desimaalisena: 77 1
30+
31+ WriteLn('firstByte: ' + IntToStr(firstByte)); // Tulostuu: firstByte: 77
32+end.
3233```
3334
3435---
35-*From the Free Pascal wiki, page "Absolute/fi", as the Internet Archive kept it on 2025-05-12. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
36+*From the Free Pascal wiki, page "Absolute/fi", as it stood on 2022-08-06 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history