Press enter to see results or esc to cancel.

System Procedures Break, Continue and Exit

This short function takes care for three system procedures for loop control: Break, Continue and Exit.The parameter contains offset to one of jump linked list variables: jumps to program block exit (Exit), jumps out of block (Break) or jumps to next block iteration (Continue). All loop control statements and program blocks create labels to these points so these system procedures simply add one jump to the list.

Function Proc_BREAK_CONTINUE_Exit: Word; Far;
begin
  If PWord (Ptr (DSeg, ProcParameter))^ = $FFFF then Error (NoEnclosing_FOR_WHILE_or_REPEAT_statement);
  GenerateCodeForNearJump (PWord (Ptr (DSeg, ProcParameter))^, JMP_ShortDirect);
  Proc_BREAK_CONTINUE_Exit := EndSubroutine;
end;