?
Solved

How to (VAR regs: registers) in Delphi

Posted on 1997-08-09
2
Medium Priority
?
420 Views
Last Modified: 2010-04-04
There a procedure I want to translate..


PROCEDURE GetPhysical(VAR lw:Byte);
VAR regs : registers;
  BEGIN
    WITH regs DO BEGIN
      GetIntVec($58,old58);
      GetIntVec($13,old13);
      SetIntVec($58,@Help58);
      SetIntVec($13,@GetPhys);
      al:=lw; cx:=1; dx:=0;
      ds:=Seg(buffer); bx:=Ofs(buffer);
      intr($58,regs);
      SetIntVec($58,old58);
      SetIntVec($13,old13);
      lw:=Mem[$40:$41];
    END;
  END;

How can we use registers in Delphi.
0
Comment
Question by:Quartz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
mirek071497 earned 300 total points
ID: 1341063
You mast do this with SimulateRealModeInt.
Here is example:

type
  TRealModeRegisters = record
    case integer of
      0:(EDI,ESI,EBP,EXX,EBX,EDX,ECX,EAX:Longint;
          Flags,ES,DS,FS,GS,IP,CS,SP,SS:Word);
      1:(DI,DIH,SI,SIH,BP,BPH,XX,XXH:Word;
       case integer of
         0 :(BX,BXH,DX,DXH,CX,CXH,AX,AXH:Word);
         1:(BL,BH,BLH,BHH,DL,DH,DLH,DHH,CL,CH,CLH,CHH,AL,AH,ALH,AHH:Byte));
  end;

function RealModeInterrupt( Int:Byte; var Regs:TRealModeRegsisters):boolean;
var
  Error : boolean;
begin
  asm
    mov Error,0
    mov ax,0300h
    mov bl,Int
    mov bh,0
    mov cx,0
    les di,Regs
    int 31h
    jnc @@End
    @@Err:
    mov Error,1
    @@End:
  end
  Result := not Error;
end;

procedure YourProc;
var Reg : TRealModeRegisters;
begin
  with Reg do
  begin
     { set you'r AX,BL,DX ..... }
     if RealModeInterrupt( $13{you'r int nr}, Reg ) then;
  end;
end;


0
 

Author Comment

by:Quartz
ID: 1341064
Ok, I try your answer then i give you your points soon...

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month9 days, 4 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question