tprec21.pp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. const
  2. RS_CR = $00;
  3. RS_CR0 = $01;
  4. RS_CR1 = $02;
  5. RS_CR2 = $03;
  6. RS_CR3 = $04;
  7. RS_CR4 = $05;
  8. RS_CR5 = $06;
  9. RS_CR6 = $07;
  10. RS_CR7 = $08;
  11. type
  12. TAsmCondFlag = (C_None { unconditional jumps },
  13. { conditions when not using ctr decrement etc }
  14. C_LT,C_LE,C_EQ,C_GE,C_GT,C_NL,C_NE,C_NG,C_SO,C_NS,C_UN,C_NU,
  15. { conditions when using ctr decrement etc }
  16. C_T,C_F,C_DNZ,C_DNZT,C_DNZF,C_DZ,C_DZT,C_DZF);
  17. TDirHint = (DH_None,DH_Minus,DH_Plus);
  18. type
  19. TAsmCond = bitpacked record
  20. dirhint : tdirhint;
  21. case simple: boolean of
  22. false: (BO, BI: 0..31);
  23. true: (
  24. cond: TAsmCondFlag;
  25. case byte of
  26. 0: ();
  27. { specifies in which part of the cr the bit has to be }
  28. { tested for blt,bgt,beq,..,bnu }
  29. 1: (cr: RS_CR0..RS_CR7);
  30. { specifies the bit to test for bt,bf,bdz,..,bdzf }
  31. 2: (crbit: 0..31)
  32. );
  33. end;
  34. const
  35. zerocond: tasmcond = (dirhint: DH_Plus;
  36. simple: true;
  37. cond:C_NE;
  38. cr: RS_CR1);
  39. begin
  40. with zerocond do
  41. if (dirhint <> DH_Plus) or
  42. not simple or
  43. (cond <> C_NE) or
  44. (cr <> RS_CR1) then
  45. halt(1);
  46. end.