Recent

Author Topic: constref and assembler x64  (Read 348 times)

Key-Real

  • Sr. Member
  • ****
  • Posts: 373
constref and assembler x64
« on: January 24, 2025, 10:38:32 pm »
letz assume I have this:

Code: Pascal  [Select][+][-]
  1. type
  2.        TImage = packed record
  3.                           data : pointer;
  4.                           width, height : dword;
  5.        end;
  6. function foo(constref pic: TImage);
  7. begin
  8. {do something in pascal...}
  9.  
  10.  asm
  11.         mov rax, [pic]    // to access pic.data
  12.  end;
  13.  
  14. end;
  15.  

this would not work :( as I understand

how to access pic.data from an assembler block?

ASerge

  • Hero Member
  • *****
  • Posts: 2376
Re: constref and assembler x64
« Reply #1 on: January 24, 2025, 11:50:46 pm »
Code: Pascal  [Select][+][-]
  1. procedure foo(constref pic: TImage);
  2. begin
  3.   {do something in pascal...}
  4.   asm
  5.       mov   rax, pic
  6.       mov   rax, TImage.Data[rax]
  7.   end;
  8. end;

 

TinyPortal © 2005-2018