home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_asm / objxref / xrpubl.asm < prev    next >
Encoding:
Assembly Source File  |  1986-04-26  |  2.3 KB  |  102 lines

  1.  PAGE    81,128
  2.  TITLE    XRPUBL    - Process PUBDEF record
  3.  SUBTTL    V1.0 - May 1986    - Cross    Reference Facility
  4. ;
  5. ;=============================================================================|
  6. ;         Copyright 1986 - Dan Daetwyler - Springdale, AR 72764          |
  7. ;=============================================================================|
  8.     .SALL
  9. ;
  10. DATA    SEGMENT    BYTE PUBLIC 'DATA'
  11. ;
  12.     EXTRN    MNCUR:WORD
  13. ;
  14.     PUBLIC    MPUBN,MPEND,MPCNT,MPPTR
  15. ;
  16. MPUBN    DB    16000 DUP (?)        ;Space for 1000    names
  17. MPEND    EQU    $
  18. MPCNT    DW    0
  19. MPPTR    DW    MPUBN
  20. ;
  21. ABTMSG    DB    13,10,'Over 1000 public symbols - Terminating$'
  22. ;
  23. DATA    ENDS
  24. ;
  25. CODE    SEGMENT    BYTE PUBLIC 'CODE'
  26.     ASSUME    CS:CODE,DS:DATA,ES:DATA
  27. ;
  28. ;==============================================================================
  29. ; Entry    Point    XRPUBL                                  |
  30. ;==============================================================================
  31. ;                                          |
  32. ; This procedure processes the PUBDEF record, adding the public    names it      |
  33. ; finds    to the public stack, along with    a pointer to the current module          |
  34. ; and a    type flag (indicating data or code).                      |
  35. ;                                          |
  36. ; Entry    conventions:    DS:SI points to    record                      |
  37. ;            CX contains record length                  |
  38. ;                                          |
  39. ; Returns:        None.                              |
  40. ;                                          |
  41. ;==============================================================================
  42. ;
  43.     EXTRN
  44. ;
  45.     PUBLIC    XRPUBL
  46. ;
  47. XRPUBL    PROC    NEAR
  48.     DEC    CX        ;Discard checksum length
  49. LP:    CALL    STKNAM        ;Stack public name
  50.     LOOP    LP        ;Discard type byte
  51.     RET
  52. XRPUBL    ENDP
  53. ;
  54. STKNAM    PROC    NEAR
  55.     PUSH    BX
  56.     MOV    BX,CX
  57.     MOV    DI,MPPTR    ;Load address of next stack entry
  58.     INC    SI        ;Discard group index
  59.     LODSB            ;Load segment index
  60.     SUB    BX,2
  61.     JC    EXIT        ;Out of    data
  62.     MOV    CL,BYTE    PTR [SI]
  63.     XOR    CH,CH
  64.     MOV    DX,13
  65.     JCXZ    EXIT
  66.     INC    CX        ;Add in    length byte
  67.     SUB    DX,CX
  68.     SUB    BX,CX
  69.     REP    MOVSB        ;Move in name
  70.     OR    DX,DX
  71.     JZ    NOPAD
  72.     MOV    CX,DX
  73.     PUSH    AX
  74.     MOV    AL,' '
  75.     REP    STOSB        ;Blank pad
  76.     POP    AX
  77. NOPAD:    STOSB            ;Save segment index
  78.     MOV    AX,MNCUR    ;Get current name pointer
  79.     STOSW
  80.     ADD    MPPTR,16    ;Save ptr to next position
  81.     CMP    DI,OFFSET MPEND
  82.     JA    ABORT
  83.     INC    MPCNT        ;  and count names in stack
  84.     SUB    BX,3        ;Discard the offset and    type length
  85.     JC    EXIT
  86.     MOV    CX,BX
  87.     POP    BX
  88.     RET
  89. EXIT:    MOV    CX,1
  90.     POP    BX
  91.     RET
  92. ABORT:    MOV    DX,OFFSET ABTMSG
  93.     MOV    AH,9
  94.     INT    21H
  95.     MOV    AX,4C02H
  96.     INT    21H
  97. STKNAM    ENDP
  98. ;
  99. CODE    ENDS
  100. ;
  101.     END
  102.