[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to (VAR regs: registers) in Delphi

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

Technology Partners: 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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

656 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