home *** CD-ROM | disk | FTP | other *** search
- module lcUCrom flag '-d83'
- title 'lower case to upper case ascii converter
- Walter Bright Data I/O Corp Redmond WA 16 Mar 1984'
-
- lc1 device 'RA8P8';
-
- OE pin 15;
- a0,a1,a2,a3,a4,a5,a6,a7 pin 1,2,3,4,5,17,18,19;
- d1,d2,d3,d4,d5,d6,d7,d8 pin 6,7,8,9,11,12,13,14;
-
- inp = [a7,a6,a5,a4,a3,a2,a1,a0];
- out = [d8,d7,d6,d5,d4,d3,d2,d1];
-
- H,L,Z,X = 1, 0, .Z., .X.;
-
- toupper macro (c)
- {@if (?c<'a')#(?c>'z') {?c}@if (?c>='a')&(?c<='z') {(?c-('a'-'A'))}};
-
- equations
-
- out = ((inp < 'a') # (inp > 'z')) & inp
- #((inp >= 'a') & (inp <= 'z')) & (inp - ('a' - 'A'));
-
- test_vectors
- ([OE,inp] -> out)
- [ L,'{'] -> '{';
- [ L,'A'] -> 'A';
- [ L,'b'] -> 'B';
- [ L,'l'] -> 'L';
- [ L,'e'] -> 'E';
- [ L,'}'] -> '}';
- [ H, X ] -> Z ;
-
- test_vectors
- ([OE,inp] -> out)
- @const ch = 32;
- @repeat 96
- { [ L, @expr ch;] -> toupper(ch); @const ch = ch + 1;
- }
-
- end lcUCrom
-