home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / TASMSWAN.ZIP / BOXCHAR.ASM < prev    next >
Assembly Source File  |  1989-07-17  |  806b  |  52 lines

  1. %TITLE  "Converts ALT-digit keys into box drawing characters"
  2.  
  3.     IDEAL
  4.     DOSSEG
  5.     MODEL    small
  6.     STACK    256
  7.  
  8. cr        EQU    13
  9. lf        EQU    10
  10. Fn10        EQU    100
  11. LowIndex    EQU    152
  12. HighIndex    EQU    161
  13.  
  14.     DATASEG
  15. message    db    cr,lf, 'Sample Character TABLE translation'
  16.     db    cr,lf, 'Press Alt-1 to Alt-0 to display characters'
  17.     db    cr,lf    '>>>>  Press F10 to end  <<<<', cr,lf,lf,0
  18.  
  19. table    db    179,180,191,192,193,194,195,196,217,218
  20.  
  21.     CODESEG
  22.  
  23.     EXTRN    StrWrite:proc, GetCh:proc
  24.  
  25. Start:
  26.     mov    ax,@data
  27.     mov    ds,ax
  28.     mov    es,ax
  29.     mov    di,offset message
  30.     call    StrWrite
  31. @@10:
  32.     call    GetCh
  33.     jnz    @@10
  34.     cmp    al,Fn10
  35.     je    Exit
  36.     cmp    al,LowIndex
  37.     jb    @@10
  38.     cmp    al,HighIndex
  39.     ja    @@10
  40.     sub    al,LowIndex
  41.     mov    bx, offset table
  42.     xlat
  43.     mov    dl,al
  44.     mov    ah,2
  45.     int    21h
  46.     jmp    @@10
  47. Exit:
  48.     mov    ax,04C00h
  49.     int    21h
  50.  
  51.     END    Start
  52.