[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to (VAR regs: registers) in Delphi

Posted on 1997-08-09
2
Medium Priority
?
431 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
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

834 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