home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / lan / critical / extenda2.mac < prev    next >
Text File  |  1988-07-15  |  2KB  |  71 lines

  1. ;           Added support for __PARCLEN, __PARCSIZ, __RETCLEN
  2. ;
  3.      EXTRN    __PARCLEN:FAR
  4.      EXTRN    __PARCSIZ:FAR
  5.      EXTRN    __RETCLEN:FAR
  6.  
  7.     ;---------------------------------------------------------------------
  8.     ; This macro is used to obtain the string length of a requested parameter
  9.     ; The syntax is.......: GET_CLEN <expN>
  10.     ; Length returned in..: AX
  11.     ;
  12.     ; Example.............: GET_CLEN 1 (get string length of 1st para)
  13.     ;---------------------------------------------------------------------
  14.     GET_CLEN MACRO N
  15.         MOV      AX,N
  16.         PUSH     AX
  17.         CALL     __PARCLEN
  18.         ADD      SP,2
  19.         ENDM
  20.  
  21.     ;---------------------------------------------------------------------
  22.     ; This macro is used to obtain the size of memory allocated to a string
  23.     ; The syntax is.......: GET_CSIZ <expN>
  24.     ; Length returned in..: AX
  25.     ;
  26.     ; Example.............: GET_CSIZ 1 (get memory allocated to 1st para)
  27.     ;---------------------------------------------------------------------
  28.     GET_CSIZ MACRO N
  29.         MOV      AX,N
  30.         PUSH     AX
  31.         CALL     __PARCSIZ
  32.         ADD      SP,2
  33.         ENDM
  34.  
  35.     ;---------------------------------------------------------------------
  36.     ; This macro is used to return a STRING. (Embedded CHR(0)'s)
  37.     ; The syntax is.....: RET_CLEN <seg_reg>,<off_reg>,<len_reg>
  38.     ;
  39.     ; Example...........: RET_CLEN ax,bx,cx
  40.     ;                     where: ax = segment
  41.     ;                            bx = offset
  42.     ;                            cx = length of string
  43.     ;---------------------------------------------------------------------
  44.     RET_CLEN  MACRO  REG1,REG2,REG3
  45.         PUSH  REG1
  46.         PUSH  REG2
  47.         PUSH  REG3
  48.         CALL  __RETCLEN
  49.         ADD   SP,6
  50.         ENDM
  51.  
  52. PUSHREGS    MACRO
  53.         push  bp
  54.         mov   bp,sp
  55.         push  ds
  56.         push  es
  57.         push  si
  58.         push  di
  59.         ENDM
  60.  
  61. POPREGS     MACRO
  62.         pop   di
  63.         pop   si
  64.         pop   es
  65.         pop   ds
  66.         pop   bp
  67.         ENDM
  68.  
  69. ;
  70. ;** EOF: EXTENDA2.MAC
  71.