home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / datestmp / dsutil.lbr / SDTIME.PZN / SDTIME.PRN
Encoding:
Text File  |  1988-08-29  |  4.0 KB  |  129 lines

  1.  
  2.  
  3.  
  4.  CDL Z80 MACRO III Assembler C12012- 414X                                      Page 1
  5.  87/12/07 22:16:57
  6.  DateStamper Call from TurboPascal
  7.  -1    
  8.  
  9.  
  10.               2         .xlink
  11.               4         .phex
  12.               5         .pabs
  13.               6     
  14.               7         .remark "
  15.               8     Code for inclusion inline in TurboPascal function
  16.               9     Prefix    with /$2A/array    where array is six byte
  17.              10     array for return of BCD result.
  18.              11     
  19.              12     note that the .LADDR pseudo op    causes bytes of
  20.              13     words to be listed in memory order
  21.              14         "
  22.              15     
  23.              16     
  24.              17     
  25.    000C             18     getver     =     12     ;CP/M function    call
  26.    0005             19     BDOS     =     0005H
  27.              20     
  28.              21     
  29.              22     
  30.    0100             23         .loc     100H
  31.    0100             24     mainpatch:
  32.              25         
  33.              26     ;first    test for presence of DateStamper  -- method is
  34.              27     ;to use function 12 and test full returned value
  35.              28     ;
  36.              29     ;
  37.              30     ;Turbo    Pascal has loaded HL with pointer to array for
  38.              31     ;saving result
  39.              32     
  40.    0100     E5         33         push     h         ;save pointer to buffer
  41.    0101     0E0C         34         mvi     c,getversion
  42.    0103     1E00         35         mvi     e,0
  43.    0105     CD0500         36         call     BDOS         ;normal test for 2.2
  44.    0108     7D         37         mov     a,l
  45.    0109     FE22         38         cpi     22H
  46.    010B     2034         39         jrnz     exit1         ;DateStamper only runs    on 2.2
  47.    010D     7C         40         mov     a,h
  48.    010E     B7         41         ora     a
  49.    010F     2030         42         jrnz     exit1         ;not on MPM
  50.    0111     1E44         43         mvi     e,'D'         ;handshake character
  51.    0113     0E0C         44         mvi     c,getversion
  52.    0115     CD0500         45         call     BDOS
  53.    0118     7C         46         mov     a,h
  54.    0119     FE44         47         cpi     'D'         ;test for DS
  55.    011B     2024         48         jrnz     exit1
  56.              49         
  57.              50     ;
  58.              51     ;if we    get to here then DE now    points to standard clock routine
  59.              52     ;
  60.    0006             53     offset     =     clock - .
  61.    011D     ED532301    54         sded     . + offset     ;in line patch
  62.    0121     E1         55         pop     h         ;get pointer to buffer
  63.    0123             56     clock     equ     $+1
  64.  
  65.  
  66.  
  67.  CDL Z80 MACRO III Assembler C12012- 414X                                      Page 2
  68.  87/12/07 22:16:57
  69.  DateStamper Call from TurboPascal
  70.  -2    
  71.  
  72.  
  73.    0122     CD0000         57         call     0
  74.              58     
  75.    0125     5D         59         mov     e,l         ;get copy of final pointer
  76.    0126     54         60         mov     d,h
  77.    0127     1B         61         dcx     d
  78.    0128     1B         62         dcx     d         ;point    to hours byte
  79.    0129     1A         63         ldax     d         ;get it
  80.              64     
  81.    012A     11FBFF         65         lxi     d,-5         ;get HL pointing to start
  82.    012D     EB         66         xchg
  83.    012E     19         67         dad     d         ;DE to    tail
  84.              68     
  85.    012F     07         69         rlc             ;test for relative clock
  86.    0130     E5         70         push     h         ;save pointer for null    fill
  87.    0131     380E         71         jrc     exit1
  88.    0133     E1         72         pop     h
  89.              73     ;*****************************************
  90.              74     ; for TBBS only
  91.              75     ;now reverse order of array
  92.    0134     0603         76         mvi     b,3
  93.    0136             77     ..loop:
  94.    0136     4E         78         mov     c,m         ;get front number
  95.    0137     1A         79         ldax     d         ;get tail number
  96.    0138     77         80         mov     m,a         ;swap
  97.    0139     79         81         mov     a,c
  98.    013A     12         82         stax     d
  99.    013B     23         83         inx     h
  100.    013C     1B         84         dcx     d
  101.    013D     10F7         85         djnz     ..loop     
  102.              86     ;*****************************************
  103.              87     
  104.    013F     1808         88         jmpr     exit2
  105.              89     
  106.              90     ;fill array with zeros    if DS not present
  107.    0141     E1         91     exit1:     pop     h
  108.    0142     0606         92         mvi     b,6
  109.    0144     AF         93         xra     a
  110.    0145     77         94     ..loop: mov     m,a
  111.    0146     23         95         inx     h
  112.    0147     10FC         96         djnz     ..loop     
  113.              97     
  114.    0149             98     exit2:     
  115.              99     
  116.             100     
  117.             101         .end
  118.  
  119.  
  120.  
  121.  CDL Z80 MACRO III Assembler C12012- 414X                                      Page 3
  122.  87/12/07 22:16:57
  123.  DateStamper Call from TurboPascal
  124.  -3    +++++ Symbol Table +++++
  125.  
  126.  
  127.    BDOS      0005           CLOCK  0123       EXIT1  0141           EXIT2  0149       GETVER 000C        
  128.    MAINPA 0100           OFFSET 0006       
  129.