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 / MODEMS / MODEM / BAUD.MAC < prev    next >
Text File  |  2000-06-30  |  2KB  |  86 lines

  1. ; BAUD.MAC
  2. ; This program is intended for use on remote systems
  3. ; to enable the caller to change baud rates.
  4. ; This program is written for a PMMI and makes use
  5. ; of Richard L. Conn's SYSLIB calls.
  6. ;
  7. ; Note that this program puts the RATE FACTOR into the
  8. ; MSPEED location. This assumes that BYE also enters the
  9. ; rate factor there and XMODEM is capable of interpreting
  10. ; it for transmit time estimate. Changing BYE to do that
  11. ; is trivial; XMODEM is a different story. I am using
  12. ; Bill Earnest's BDS C version of XMODEM, which was written
  13. ; to recognize the rate factor at MSPEED.
  14. ;
  15. pmmi    equ    0e0h        ;pmmi base port
  16. port2    equ    pmmi+2
  17. port3    equ    pmmi+3
  18. lt300    equ    7fh        ;filter switch value < 300 baud
  19. gt300    equ    5fh        ;filter switch value >=300 baud
  20. wboot    equ    0
  21. fcb    equ    5ch
  22. mspeed    equ    3dh        ;where to put the rate factor
  23. cr    equ    0dh
  24. lf    equ    0ah
  25. ;
  26. ; SYSLIB external declarations
  27. ;
  28.     ext    eval10        ;evaluate decimal ascii
  29.     ext    divhd        ; hl = hl / de
  30.     ext    print        ;print string
  31.     ext    pause        ;delay routine
  32.     ext    comphd        ;compare hl and de
  33. ;
  34. start:    lxi    h,fcb+1
  35.     mov    a,m
  36.     cpi    ' '
  37.     jz    error
  38.     push    h
  39. loop:    mov    a,m
  40.     inx    h
  41.     cpi    '0'
  42.     jc    lexit
  43.     cpi    '9'+1
  44.     jc    loop
  45. lexit:    dcx    h
  46.     mvi    m,0
  47.     pop    h
  48.     call    eval10
  49.     lxi    h,60
  50.     call    comphd
  51.     jnc    error
  52.     lxi    h,710
  53.     call    comphd
  54.     jc    error
  55.     lxi    h,15625
  56.     call    divhd
  57.     mov    a,l
  58.     sta    mspeed
  59.     cpi    53
  60.     jc    high
  61.     mvi    a,lt300
  62.     out    port3
  63.     jmp    setrate
  64. ;
  65. high:    mvi    a,gt300
  66.     out    port3
  67. setrate:lxi    h,20        ;2 seconds...
  68.     mvi    b,4        ;.. at 4mhz
  69.     call    pause
  70.     lda    mspeed
  71.     out    port2
  72.     jmp    wboot
  73. ;
  74. ; come here if
  75. ; - invalid baud rate (too high or too low)
  76. ; - no baud rate specified
  77. ;
  78. error:    call    print
  79.     db    'Use the BAUD command to change the '
  80.     db    'baud rate to any speed',cr,lf
  81.     db    'between 61 and 710 baud. Enter BAUD xxx, '
  82.     db    'where xxx is the new rate.',cr,lf,lf,0
  83.     jmp    wboot
  84. ;
  85.     end
  86.