home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s199 / 1.img / LCUCROM.ABL < prev    next >
Encoding:
Text File  |  1986-02-04  |  912 b   |  42 lines

  1. module lcUCrom  flag '-d83'
  2. title 'lower case to  upper case ascii converter
  3. Walter Bright  Data I/O Corp Redmond WA   16 Mar 1984'
  4.  
  5.     lc1    device    'RA8P8';
  6.  
  7.     OE        pin 15;
  8.     a0,a1,a2,a3,a4,a5,a6,a7    pin 1,2,3,4,5,17,18,19;
  9.     d1,d2,d3,d4,d5,d6,d7,d8 pin 6,7,8,9,11,12,13,14;
  10.  
  11.     inp    = [a7,a6,a5,a4,a3,a2,a1,a0];
  12.     out    = [d8,d7,d6,d5,d4,d3,d2,d1];
  13.  
  14.     H,L,Z,X    = 1, 0, .Z., .X.;
  15.  
  16.     toupper macro (c)
  17.     {@if (?c<'a')#(?c>'z') {?c}@if (?c>='a')&(?c<='z') {(?c-('a'-'A'))}};
  18.  
  19. equations
  20.  
  21.     out =      ((inp <  'a') # (inp >  'z')) & inp
  22.         #((inp >= 'a') & (inp <= 'z')) & (inp - ('a' - 'A'));
  23.  
  24. test_vectors
  25.     ([OE,inp] -> out)
  26.      [ L,'{'] -> '{';
  27.      [ L,'A'] -> 'A';
  28.      [ L,'b'] -> 'B';
  29.      [ L,'l'] -> 'L';
  30.      [ L,'e'] -> 'E';
  31.      [ L,'}'] -> '}';
  32.      [ H, X ] ->  Z ;
  33.  
  34. test_vectors
  35.     ([OE,inp] -> out)
  36.      @const ch = 32;
  37.      @repeat 96
  38. {    [ L, @expr ch;] -> toupper(ch);  @const ch = ch + 1;
  39. }
  40.  
  41. end lcUCrom
  42.