home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / PROGRAMS / LIST / EP-SRC.ARK / WADJUST.MAC < prev   
Text File  |  1988-05-21  |  1KB  |  67 lines

  1.  
  2. ;receive percentage adjustment in A (50-200%)
  3. ;return HL = stretch, DE = shrink
  4. wadjust::
  5.     cpi    50
  6.     jnc    $+5
  7.     mvi    a,50
  8.     cpi    200+1
  9.     jc    $+5
  10.     mvi    a,200
  11.     mov    e,a
  12.     mvi    d,0
  13.     lxi    h,wftab-50
  14.     dad    d
  15.     mov    e,m
  16. ;stretch is in low nibble
  17.     mov    a,e
  18.     ani    0fh
  19.     mov    l,a
  20.     mov    h,d
  21. ;shrink in high one
  22.     mov    a,e
  23.     rar
  24.     rar
  25.     rar
  26.     rar
  27.     ani    0fh
  28. ;we don't use sh = 1, so non-0 in tab were shifted down 1
  29.     ora    a
  30.     jz    $+4
  31.     inr    a
  32.     mov    e,a
  33.     ret
  34.  
  35. wftab:
  36. ;50-57
  37.     db    010H,010H,010H,01DH,01DH,01AH,019H,018H
  38.     db    017H,016H,015H,015H,015H,014H,014H,014H
  39. ;66
  40.     db    020H,020H,020H,020H,020H,02FH,02FH,02DH
  41.     db    02AH,030H,028H,028H,027H,026H,040H,025H
  42. ;82
  43.     db    03CH,03AH,050H,038H,060H,037H,070H,080H
  44.     db    023H,0A0H,0B0H,0C0H,034H,058H,045H,057H
  45. ;98
  46.     db    068H,056H,000H,000H,000H,076H,065H,054H
  47.     db    075H,085H,043H,00CH,00AH,0B5H,009H,032H
  48. ;114
  49.     db    0A4H,007H,063H,006H,073H,073H,005H,093H
  50.     db    0A3H,0A3H,0B3H,004H,052H,052H,052H,062H
  51. ;130
  52.     db    062H,062H,072H,072H,021H,092H,092H,0A2H
  53.     db    0B2H,0B2H,0C2H,0E2H,0E2H,0E2H,0E2H,0E2H
  54. ;146
  55.     db    0E2H,002H,002H,002H,002H,002H,002H,002H
  56.     db    002H,002H,041H,041H,041H,041H,041H,041H
  57. ;162
  58.     db    041H,041H,041H,051H,051H,051H,051H,051H
  59.     db    051H,061H,061H,061H,061H,071H,071H,071H
  60. ;178
  61.     db    081H,081H,091H,091H,0A1H,0A1H,0B1H,0B1H
  62.     db    0C1H,0C1H,0E1H,0E1H,0E1H,0E1H,0E1H,0E1H
  63. ;194
  64.     db    001H,001H,001H,001H,001H,001H,001H
  65.  
  66.     end
  67.