home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / RiscOS / APP / DEVS / FORTH / BEETLE / BEETLE.ZIP / Beetle / excepts.c < prev    next >
Text File  |  1997-04-22  |  948b  |  26 lines

  1. /* EXCEPTS.C
  2.  
  3.     Vrsn  Date   Comment
  4.     ----|-------|---------------------------------------------------------------
  5.     0.00 24mar95 Code removed from execute.c v0.00. See that file for earlier
  6.                  history. Added code to handle division by zero exception.
  7.     0.01 25mar95 Added code to HALT if SP is unaligned. Removed division by zero
  8.                  code which properly belongs in execute.c. Corrected return code
  9.                  when SP unaligned.
  10.     0.02 20may96 Made MEMORY an invalid address (>MEMORY -> >=MEMORY).
  11.     0.03 26may96 Corrected return code for bad SP in aliadr to -258.
  12.  
  13.     Reuben Thomas
  14.  
  15.  
  16.     Deal with address exceptions during execution cycle. Included by step.c and
  17.     run.c.
  18.  
  19. */
  20.  
  21.  
  22. invadr:    SP--; if ((UCELL)((BYTE *)SP - M0) >= MEMORY || (unsigned int)SP & 3)
  23.         return -258; *SP = -9; goto throw;
  24. aliadr: SP--; if ((UCELL)((BYTE *)SP - M0) >= MEMORY || (unsigned int)SP & 3)
  25.         return -258; *SP = -23; goto throw;
  26.