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

  1.  PAGE    81,128
  2.  TITLE    XRHEDR    - Process THEADR 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.     PUBLIC    MNAMES,MNEND,MNCNT,MNPTR,MNCUR
  13. ;
  14. MNAMES    DB    9020 DUP (?)        ;Space for 1000    eight byte names
  15. MNEND    EQU    $
  16. MNCNT    DW    ?
  17. MNPTR    DW    MNAMES
  18. MNCUR    DW    ?
  19. ;
  20. ABTMSG    DB    13,10,'Over 1000 primary module names - Terminating$'
  21. ;
  22. DATA    ENDS
  23. ;
  24. CODE    SEGMENT    BYTE PUBLIC 'CODE'
  25.     ASSUME    CS:CODE,DS:DATA,ES:DATA
  26. ;
  27. ;==============================================================================
  28. ; Entry    Point    XRHEDR                                  |
  29. ;==============================================================================
  30. ;                                          |
  31. ; This module processes    the header record it expects to    find in    the input     |
  32. ; buffer.  It extracts the module name and adds    it to the module name          |
  33. ; stack.                                      |
  34. ;                                          |
  35. ; Entry    conventions:    DS:SI points to    record                      |
  36. ;            CX contains length of record                  |
  37. ;                                          |
  38. ; Returns:        None.                              |
  39. ;                                          |
  40. ;==============================================================================
  41. ;
  42.     EXTRN
  43. ;
  44.     PUBLIC    XRHEDR
  45. ;
  46. XRHEDR    PROC    NEAR
  47.     MOV    AL,BYTE    PTR [SI]    ;Get name length
  48.     XOR    AH,AH
  49.     DEC    CX
  50.     CMP    AX,CX
  51.     JA    OK            ;Use record length
  52.     MOV    CX,AX
  53.     INC    CX            ;Count length byte
  54. OK:    MOV    DI,MNPTR        ;Point to next name stack slot
  55.     MOV    MNCUR,DI        ;Save current pointer
  56.     REP    MOVSB            ;Move in name (prefixed    by length)
  57.     INC    MNCNT            ;Add name count
  58.     MOV    MNPTR,DI        ;Save next ptr
  59.     CMP    DI,OFFSET MNEND
  60.     JA    ABORT
  61.     RET
  62. ABORT:    MOV    DX,OFFSET ABTMSG
  63.     MOV    AH,9
  64.     INT    21H
  65.     MOV    AX,4C03H
  66.     INT    21H
  67. XRHEDR    ENDP
  68. ;
  69. CODE    ENDS
  70. ;
  71.     END
  72.