nz80mat.pas 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {
  2. Copyright (c) 1998-2002 by Florian Klaempfl
  3. Generate Z80 assembler for math nodes
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  15. ****************************************************************************
  16. }
  17. unit nz80mat;
  18. {$i fpcdefs.inc}
  19. interface
  20. uses
  21. node,nmat,ncgmat;
  22. type
  23. { tz80notnode }
  24. tz80notnode = class(tcgnotnode)
  25. protected
  26. procedure second_boolean;override;
  27. end;
  28. implementation
  29. uses
  30. globtype,systems,constexp,
  31. cutils,verbose,globals,
  32. symconst,symdef,aasmbase,aasmtai,aasmdata,aasmcpu,defutil,
  33. cgbase,pass_2,
  34. ncon,
  35. cpubase,cpuinfo,
  36. ncgutil,cgobj,cgutils,
  37. hlcgobj;
  38. {*****************************************************************************
  39. tz80notnode
  40. *****************************************************************************}
  41. procedure tz80notnode.second_boolean;
  42. begin
  43. if not handle_locjump then
  44. begin
  45. { the second pass could change the location of left }
  46. { if it is a register variable, so we've to do }
  47. { this before the case statement }
  48. secondpass(left);
  49. case left.location.loc of
  50. LOC_FLAGS :
  51. begin
  52. location_reset(location,LOC_FLAGS,OS_NO);
  53. location.resflags:=left.location.resflags;
  54. inverse_flags(location.resflags);
  55. end;
  56. else
  57. internalerror(2020042208);
  58. end;
  59. end;
  60. end;
  61. begin
  62. cnotnode:=tz80notnode;
  63. end.