Question on VM RISC Markers

Post here any topics that related to Enigma Protector, its functionality, your misunderstanding, offers to improvements etc etc etc
Post Reply
ljhowell
Posts: 9
Joined: Mon Dec 27, 2010 11:06 pm

Question on VM RISC Markers

Post by ljhowell » Tue Mar 11, 2014 1:08 am

Hello

I just need some clarification on when to use VM Markers within routines in Delphi.

Example:

Code: Select all


function Test2 : boolean;
var 
 y,x : integer;
begin
{$I vm_risc_begin.inc}
 y := 1
 x := 1;
  result := False;

  if y=x then  result := True;
{$I vm_risc_end.inc}
end;

function Test1 : boolean;
begin
{$I vm_risc_begin.inc}
  result := False;

  if Test2 then result := True;
{$I vm_risc_end.inc}
end;
Are the VM RISC Marker working correctly in BOTH functions?

What I mean is, Test1 calls Test2 but is within VM RiSC Marker. Then Test2 is executes and starts another VM RISC marker. A VM Marker inside another. Is this legal?

May help would be great.

Thanks

Les

Alec
Posts: 82
Joined: Thu Feb 20, 2014 9:35 am

Re: Question on VM RISC Markers

Post by Alec » Tue Mar 11, 2014 8:12 am

Yes, it will work correctly. The only thing that is not allowed is to literally include one marker into another, so between vm_risc_begin and vm_risc_end there can be no other markers.

ljhowell
Posts: 9
Joined: Mon Dec 27, 2010 11:06 pm

Re: Question on VM RISC Markers

Post by ljhowell » Wed Mar 12, 2014 12:33 am

Thanks Alec for the quick reply.

I have only one more question.

In function Test1, if I have a logic "if X=0 then Exit;" that causes me to use the EXIT statement, will the VM Marker still work. Meaning I exit the function before the vm_risc_end marker.

I know it is a dumb question, but I just need to understand the VM RISC a little better.

Regards

Les

Code: Select all

function Test2 : boolean;
var 
 y,x : integer;
begin
{$I vm_risc_begin.inc}
 y := 1
 x := 1;
  result := False;

  if y=x then  result := True;
{$I vm_risc_end.inc}
end;

function Test1 : boolean;
var
  X : integer;
begin
{$I vm_risc_begin.inc}
  result := False;
  X := 0;

  if X=0 then Exit;

  if Test2 then result := True;
{$I vm_risc_end.inc}
end;

Alec
Posts: 82
Joined: Thu Feb 20, 2014 9:35 am

Re: Question on VM RISC Markers

Post by Alec » Wed Mar 12, 2014 7:38 am

Statements like Exit or return which lead code flow out of the marker are supported, so the answer to your question is yes.

ljhowell
Posts: 9
Joined: Mon Dec 27, 2010 11:06 pm

Re: Question on VM RISC Markers

Post by ljhowell » Thu Mar 13, 2014 12:28 pm

Thanks Alec!

Post Reply