I cannot write Assembly code to save myself can someone write this for me please
I want to make a fast case statement as a standard case statement is way too slow for my project.
my project hangs on this centail peice of code.
Hear below I see how to do what I need and others may use the result too.
Procedure Procedure1;
begin
//..............
end;
Procedure Procedure2;
begin
//..............
end;
Procedure Procedure3;
begin
//..............
end;
Procedure Procedure4;
begin
//..............
end;
Procedure Procedure5;
begin
//..............
end;
const
Prolist: {packed} array [1..5{500}] of Pointer =
(@Procedure1, @Procedure2, @Procedure3, @Procedure4, @Procedure5);
ASMCase(Prolist: array of Pointer; No: Word; Var InRange: Boolean);}
ASMCase takes size of Prolist <= (No * 4) and sets InRange accordingly
If valid, takes No * 4 + @Prolist[0] and runs procedure out of Prolist;
This saves time processing a ‘If’ Statement for every procedure.
The case statement may identify a Nil value in Prolist instead of a procedure call and not execute it;
I expect to have about 500 procedures from this case statement;
I do not think the code would be too big to write.