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 / SIMTEL / CPMUG / CPMUG008.ARK / WYLECON2.LIB < prev    next >
Text File  |  1984-04-29  |  2KB  |  79 lines

  1.  
  2. ;++++++++++++++++++++++++++++++++++++++++++++++
  3. ;
  4. ; WYLE KEYBOARD CODE CONVERSION
  5. ; WITH LOWER CASE 
  6. ;
  7. ; WYLECON2.LIB  -  Version 2.0 -  11 OCT 77
  8. ;
  9. ; J.W. SHOOK, P.O. BOX 185, ROCKY POINT, NY 11778
  10. ;
  11. ;++++++++++++++++++++++++++++++++++++++++++++++
  12.  
  13.  
  14. ; Convert codes from Wyle Computer keyboard
  15. ; to ASCII codes by use of a lookup table
  16. ; and then convert alphabetic characters
  17. ; to lower case if shift lock is off and
  18. ; shift key not depressed.
  19.  
  20.  
  21. WYLECON:
  22.  
  23.     PUSH    B    ; Save register contents
  24.     PUSH    H
  25.     MOV    C,A    ; Save bit 7 (shift key)
  26.     MVI    B,TABLEN+1    ; Set table length
  27.     LXI    H,TABLST-1    ; Conversion table start
  28. WYLEC1:    DCR    B    ; Decrement table entry count
  29.     JZ    WYLEC2    ; Done?
  30.     INX    H    ; Move pointer to test value
  31.     CMP    M    ; Compare character to entry
  32.     INX    H    ; Move pointer to replacement char
  33.     JNZ    WYLEC1    ; Same?
  34.     MOV    A,M
  35. WYLEC2:    ANI    7FH    ; Delete shift bit
  36.     MOV    B,A    ; Save converted char
  37.     CPI    'A'    ; Test for alpha char
  38.     JC    WYLEC3    ; Non alpha?
  39.     CPI    'Z'+1    ;
  40.     JNC    WYLEC3    ; Non alpha?
  41.     INR    C    ; Test shift bit
  42.     DCR    C
  43.     JM    WYLEC3    ; Shift key pressed?
  44.     IN    SENSW    ; Test shift lock switch
  45.     ANI    SHFTLK    ; Mask bit
  46.     MOV    A,B    ; Restore char to A
  47.     JNZ    WYLEC3    ; Switch on?
  48.     ADI    20H    ; Convert to lower case
  49. WYLEC3:    POP    H    ; Restore registers
  50.     POP    B
  51.     RET
  52.  
  53.  
  54. TABLST:    DB    0B7H,21H
  55.     DB    03DH,59H
  56.     DB    023H,55H
  57.     DB    05CH,49H
  58.     DB    05EH,4FH
  59.     DB    01FH,3DH
  60.     DB    09FH,22H
  61.     DB    00CH,23H
  62.     DB    08EH,0AH
  63.     DB    00EH,7FH
  64.     DB    08FH,7BH
  65.     DB    00FH,1BH
  66.     DB    09AH,7DH
  67.     DB    01DH,15H
  68.     DB    09EH,7CH
  69.     DB    01EH,16H
  70.     DB    09BH,10H
  71.     DB    01BH,13H
  72.     DB    00BH,03H
  73.     DB    089H,5EH
  74.     DB    021H,08H
  75.     DB    0A1H,5CH
  76. TABLND:
  77.  
  78. TABLEN:    EQU    (TABLND-TABLST)/2    ; Number of entries
  79.