Solved

How to (VAR regs: registers) in Delphi

Posted on 1997-08-09
2
402 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 100 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi...Split view - idea? 1 144
scroll down TListBox component in Delphi 1 42
Browsing a TTreeView in Delphi 5 47
Delphi Firemonkey : user drawing in window 3 56
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

732 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