For example,We have a DWORD = $12345678
Which of the instructions would be faster - absolute or Move()?
var a:DWORD = $12345678;
b:Array[0..3] of byte absolute a;
var a:DWORD = $12345678;b:Array[0..3] of Byte
begin
Move(a,b,4);
end;
Specifically,I'm asking what exactly 'absolute' does,because if it doesn't use additional memory to write that byteArray then I have no reason to use Move instead of absolute in that case so how does 'absolute' work?
absolute does not perform any operation; it declares the address of a var to be the same as another var.
Move() performs a copy operation, which takes some time.
With absolute, both vars are stored at the same address, your second declaration stores the vars at different locations.
The 'absolute' directive points to the same memory as the specified variable. No code is executed, so yes it is faster than Move or any other code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With