GetRegsCommand

Purpose

Copies the processor registers.

Syntax

GetRegs

Description

GetRegs copies the content of the processor registers to the pseudo register variables _EAX, _EBX, etc.

The pseudo register variables are used to inspect processor registers and to pass values to assembler routines.

_EAX, _EBX, _ECX, _EDX, _ESI, _EDI, _EBP, _ESP, _EFL, _EIP

_AX, _BX, _CX, _DX, _SI, _DI, _BP, _SP, _FL, _IP

_CS, _DS, _ES, _FS, _GS, _SS

_AH, _AL, _BH, _BL, _CH, _CL, _DH, _DL

The top eight are the pseudo register variables of GFA-BASIC 32. They can be filled using the GetRegs command. GetRegs copies the values and state of each register processor in its corresponding variable. The value of the eax register is copied to _EAX, the ecx register to _ECX, etc.

For four registers, eax, ebx, ecx, and edx, the LoWord, and the LoByte and HiByte of the LoWord can be read and set individually. The table below shows the meaning and the relationship of the pseudo register variables.

Register Lo Byte 8 bit Hi Byte 8 bit Lo Word 16 bit Register 32 bit
accumulations register _AL _AH _AX _EAX
base register _BL _BH _BX _EBX
count register _CL _CH _CX _ECX
data register _DL _DH _DX _EDX
source index register     _SI _ESI
destination index register     _DI _EDI
base pointer register     _BP _EBP
stack register     _SP _ESP
flag register     _FL _EFL
extended instruction pointer       _EIP
only for the 16 bit operating     _IP  
code segment register     _CS  
data segment register     _DS  
extra segment register     _ES  
extra segment register     _FS  
extra segment register     _GS  
stack segment register     _SS  
carry flag     _CY  

When an assembler routine is invoked, the registers can be initialized at the calling. The Call(X) command allows passing values by pseudo register variable.

Call(addr) ( _EAX = 1, _ECX = 2)

Further more, some GFA-BASIC 32 commands return values in a pseudo variable. For instance Dlg Font returns the size in point in _DX and the font type in _SI. All Dlg-common dialog commands return an error condition in _AX.

Example

Dim cur As Currency

cur = 1000

GetRegs : Print _EAX, _EDX

output of two register after addition to one Currency variable

Remarks

You are free to use the pseudo variables as (global) variables to store temporarily information.

See Also

Tron, Call, CallX

{Created by Sjouke Hamstra; Last updated: 01/09/2021 by James Gaite; Other Contributors: Jean-Marie Melanson}