PageRenderTime 26ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/support/z88/errors.fth

https://bitbucket.org/garryl/camelforth
Forth | 67 lines | 56 code | 11 blank | 0 comment | 2 complexity | 8505193e6f9750968ded1969029c55d3 MD5 | raw file
Possible License(s): GPL-3.0
  1. \ ****************************************************************************
  2. \ CamelForth for the Zilog Z80
  3. \ Copyright (c) 1994,1995 Bradford J. Rodriguez
  4. \ With contributions by Douglas Beattie Jr., 1998
  5. \ Widely extended and reorganised by Garry Lancaster, 1999-2014
  6. \ Z88, Sprinter, ZX Spectrum +3/+3e ports by Garry Lancaster, 1999-2014
  7. \
  8. \ This program is free software; you can redistribute it and/or modify
  9. \ it under the terms of the GNU General Public License as published by
  10. \ the Free Software Foundation; either version 3 of the License, or
  11. \ (at your option) any later version.
  12. \
  13. \ This program is distributed in the hope that it will be useful,
  14. \ but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. \ GNU General Public License for more details.
  17. \
  18. \ You should have received a copy of the GNU General Public License
  19. \ along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. \ ****************************************************************************
  21. CR .( Loading error reporting...)
  22. HEX
  23. CODE GN_ESP ( rc -- addr x )
  24. 79 C, \ ld a,c
  25. E7 C, 4C09 , \ call_oz(gn_esp)
  26. E5 C, \ push hl
  27. NEXT
  28. CODE GN_RBE ( addr x -- addr' x c )
  29. E1 C, \ pop hl (BHL=extended address)
  30. E7 C, 3E09 , \ call_oz(gn_rbe)
  31. 23 C, \ inc hl
  32. E5 C, \ push hl
  33. C5 C, \ push bc
  34. 4F C, \ ld c,a
  35. 06 C, 00 C, \ ld b,0 (TOS=char)
  36. NEXT
  37. DECIMAL
  38. : .OZERR ( rc -- )
  39. GN_ESP BEGIN GN_RBE ?DUP WHILE EMIT REPEAT 2DROP ;
  40. : .ANYERROR ( rc -- )
  41. CASE -35 OF ." Invalid block" ENDOF
  42. -49 OF ." Search-order overflow" ENDOF
  43. -4095 OF ." Non-fastable word: " ABORT"S 2@ TYPE ENDOF
  44. -4094 OF ." Input nesting error" ENDOF
  45. -4093 OF ." Region error" ENDOF
  46. -4092 OF ." Blocks already allocated" ENDOF
  47. DUP NEGATE 256 /MOD ( rc -rclo -rchi )
  48. CASE 1 OF .OZERR ENDOF
  49. 2 OF ." Package "
  50. BASE @ HEX SWAP . BASE !
  51. ." not found"
  52. ENDOF
  53. NIP OVER (.ERR)
  54. ENDCASE
  55. ENDCASE ;
  56. ' .ANYERROR IS .ERROR