有一过程中的几句我不理解,请高手指教!!!
procedure swapvar(var A1P,A2P;size:integer);
type
a:array[1..maxint] of byte;
var
A1:A absolute A1P;
A2:A absolute A2P;
我就是不理解A1:A absolute A1P;
A2:A absolute A2P;是什么意思?
procedure swapvar(var A1P,A2P;size:integer);
type
a:array[1..maxint] of byte;
var
A1:A absolute A1P;
A2:A absolute A2P;
我就是不理解A1:A absolute A1P;
A2:A absolute A2P;是什么意思?
可以用Absolute声明一个变量的绝对地址!
例如:
var
str:string;
i:byte Absolute str;
上面声明的这种方式可靠,str这个变量可以不用,只做为i取地址用,
这样比用绝对地址(如:var i:byte Absolute $0040:0040)声明可靠。
Str: string[32];
StrLen: Byte absolute Str;specifies that the variable StrLen should start at the same address as Str. Since the first byte of a short string contains the string's length, the value of StrLen is the length of Str.You cannot initialize a variable in an absolute declaration or combine absolute with any other directives.