home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pasos2c1.zip / include / macros.inc next >
Text File  |  1993-11-30  |  3KB  |  122 lines

  1. ;*
  2. ;* FileName:   macros.inc
  3. ;* $Source: E:/usr/src/c-code/pascal/RCS/LIB/macros.inc,v $
  4. ;* $Author: wjw $
  5. ;* $Date: 1993/11/03 15:54:54 $
  6. ;* $Locker: wjw $
  7. ;* $State: Exp $
  8. ;* $Revision: 1.1 $
  9. ;* Description:
  10. ;*      Part of the runtime library which comes with PASCAL for OS/2
  11. ;*      
  12. ;*
  13. ;* History:
  14. ;*      First created by Willem Jan Withagen ( wjw@eb.ele.tue.nl ),
  15. ;*                    on Mon July 26 23:30:03 MET 1993
  16. ;* Copyright:
  17. ;*      Copyright (c) 1993 by Willem Jan Withagen and 
  18. ;*                      Digital Information Systems group, TUE
  19. ;*      For copying and distribution information see the file COPYRIGHT.
  20. ;*
  21. ;* 
  22. ;
  23. ;      Macros used for boolean logical operations
  24. ;      Note that a boolean true is everything which is not ZERO
  25. ;
  26. @@LXOR        MACRO   ea_op,reg,lreg
  27.       LOCAL   @@jump1,@@jump2
  28.       OR      reg,reg
  29.       JNZ SHORT       @@jump1
  30.       cmp     ea_op,0
  31.       SETZ    lreg
  32.       JMP SHORT       @@jump2
  33. @@jump1:
  34.       cmp     ea_op,0
  35.       SETNZ   lreg
  36. @@jump2:
  37.       ENDM
  38. ;
  39. ;     Set the resulting register if both operands are TRUE
  40. @@LAND        MACRO   ea_op,reg,lreg
  41.       LOCAL   @@jump
  42.       OR      reg,reg
  43.       JZ SHORT       @@jump
  44.       CMP     ea_op,0
  45. @@jump:
  46.       SETNZ   lreg
  47.       ENDM
  48.       
  49. ;
  50. ;     Set the resulting register if either operand is TRUE
  51. @@LOR MACRO   ea_op,reg,lreg
  52.       LOCAL   @@jump
  53.       OR      reg,ea_op
  54.       JNZ SHORT       @@jump
  55.       CMP     reg,0
  56. @@jump:
  57.       SETNZ   lreg
  58.       ENDM
  59. ;
  60. ;     Jump to the 'cond_l' label if (ea_op OR reg)
  61. ;     Test both operands in sucession and act on each of the tests.
  62. @@COND_LOR    MACRO   ea_op,reg,cond_l
  63.       OR      reg,ea_op
  64.       JZ     cond_l
  65.       ENDM
  66.  
  67. ;
  68. ;     Jump to the 'cond_l' label if NOT (ea_op OR reg)
  69. @@COND_LNOR    MACRO   ea_op,reg,cond_l
  70.       LOCAL   @@jump
  71.       OR      reg,reg
  72.       JNZ SHORT       @@jump   ; Short circuit the next test.
  73.       CMP     ea_op,0
  74.       JZ     cond_l
  75. @@jump:
  76.       ENDM
  77.  
  78. ;
  79. ;     Jump to the 'cond_l' label if (ea_op AND reg)
  80. ;     Test both operands in sucession and act on each of the tests.
  81. @@COND_LAND    MACRO   ea_op,reg,cond_l
  82.       LOCAL   @@jump
  83.       OR      reg,reg
  84.       JZ SHORT       @@jump   ; Short circuit the next test.
  85.       CMP     ea_op,0
  86.       JNZ     cond_l
  87. @@jump:
  88.       ENDM
  89.  
  90. ;
  91. ;     Jump to the 'cond_l' label if NOT (ea_op AND reg)
  92. ;     Test both operands in sucession and act on each of the tests.
  93. @@COND_LNAND    MACRO   ea_op,reg,cond_l
  94.       OR      reg,reg
  95.       JZ      cond_l   ; Short circuit the next test.
  96.       CMP     ea_op,0
  97.       JZ     cond_l
  98.       ENDM
  99.  
  100. @@COND_LXOR   MACRO   ea_op,reg,cond_l
  101.       LOCAL   @@jump1,@@jump2
  102.       OR      reg,reg
  103.       JZ SHORT        @@jump1
  104.       CMP     ea_op,0
  105.       JZ      cond_l
  106.       JMP SHORT       @@jump2
  107. @@jump1:
  108.       CMP     ea_op,0
  109.       JNZ     cond_l
  110. @@jump2:
  111.       ENDM
  112.  
  113. ;*
  114. ;* $Log: macros.inc,v $
  115. ;*     Revision 1.1  1993/11/03  15:54:54  wjw
  116. ;*     Started adminstration for the RUNTIME LIB
  117. ;*
  118. ;*
  119. ;*      First created by Willem Jan Withagen ( wjw@eb.ele.tue.nl ),
  120. ;*                    on Mon July 26 23:30:03 MET 1993
  121. ;* 
  122.