2 # Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the OpenSSL license (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
9 # Copyright IBM Corp. 2018-2019
10 # Author: Patrick Steuer <patrick.steuer@de.ibm.com>
12 package perlasm::s390x;
18 use Exporter qw(import);
20 our @EXPORT=qw(PERLASM_BEGIN PERLASM_END);
21 our @EXPORT_OK=qw(AUTOLOAD LABEL INCLUDE stfle);
23 # long-displacement facility
25 # general-instruction-extension facility
27 # extended-immediate facility
29 # miscellaneous-instruction-extensions facility 1
31 # message-security assist
32 MSA => [qw(kmac km kmc kimd klmd)],
33 # message-security-assist extension 4
34 MSA4 => [qw(kmf kmo pcc kmctr)],
35 # message-security-assist extension 5
36 MSA5 => [qw(ppno prno)],
37 # message-security-assist extension 8
40 VX => [qw(vgef vgeg vgbm vzero vone vgm vgmb vgmh vgmf vgmg
41 vl vlr vlrep vlrepb vlreph vlrepf vlrepg vleb vleh vlef vleg vleib
42 vleih vleif vleig vlgv vlgvb vlgvh vlgvf vlgvg vllez vllezb vllezh
43 vllezf vllezg vlm vlbb vlvg vlvgb vlvgh vlvgf vlvgg vlvgp
44 vll vmrh vmrhb vmrhh vmrhf vmrhg vmrl vmrlb vmrlh vmrlf vmrlg vpk
45 vpkh vpkf vpkg vpks vpksh vpksf vpksg vpkshs vpksfs vpksgs vpkls
46 vpklsh vpklsf vpklsg vpklshs vpklsfs vpklsgs vperm vpdi vrep vrepb
47 vreph vrepf vrepg vrepi vrepib vrepih vrepif vrepig vscef vsceg
48 vsel vseg vsegb vsegh vsegf vst vsteb vsteh vstef vsteg vstm vstl
49 vuph vuphb vuphh vuphf vuplh vuplhb vuplhh vuplhf vupl vuplb vuplhw
50 vuplf vupll vupllb vupllh vupllf va vab vah vaf vag vaq vacc vaccb
51 vacch vaccf vaccg vaccq vac vacq vaccc vacccq vn vnc vavg vavgb
52 vavgh vavgf vavgg vavgl vavglb vavglh vavglf vavglg vcksm vec_ vecb
53 vech vecf vecg vecl veclb veclh veclf veclg vceq vceqb vceqh vceqf
54 vceqg vceqbs vceqhs vceqfs vceqgs vch vchb vchh vchf vchg vchbs
55 vchhs vchfs vchgs vchl vchlb vchlh vchlf vchlg vchlbs vchlhs vchlfs
56 vchlgs vclz vclzb vclzh vclzf vclzg vctz vctzb vctzh vctzf vctzg
57 vx vgfm vgfmb vgfmh vgfmf vgfmg vgfma vgfmab vgfmah vgfmaf vgfmag
58 vlc vlcb vlch vlcf vlcg vlp vlpb vlph vlpf vlpg vmx vmxb vmxh vmxf
59 vmxg vmxl vmxlb vmxlh vmxlf vmxlg vmn vmnb vmnh vmnf vmng vmnl
60 vmnlb vmnlh vmnlf vmnlg vmal vmalb vmalhw vmalf vmah vmahb vmahh
61 vmahf vmalh vmalhb vmalhh vmalhf vmae vmaeb vmaeh vmaef vmale
62 vmaleb vmaleh vmalef vmao vmaob vmaoh vmaof vmalo vmalob vmaloh
63 vmalof vmh vmhb vmhh vmhf vmlh vmlhb vmlhh vmlhf vml vmlb vmlhw
64 vmlf vme vmeb vmeh vmef vmle vmleb vmleh vmlef vmo vmob vmoh vmof
65 vmlo vmlob vmloh vmlof vno vnot vo vpopct verllv verllvb verllvh
66 verllvf verllvg verll verllb verllh verllf verllg verim verimb
67 verimh verimf verimg veslv veslvb veslvh veslvf veslvg vesl veslb
68 veslh veslf veslg vesrav vesravb vesravh vesravf vesravg vesra
69 vesrab vesrah vesraf vesrag vesrlv vesrlvb vesrlvh vesrlvf vesrlvg
70 vesrl vesrlb vesrlh vesrlf vesrlg vsl vslb vsldb vsra vsrab vsrl
71 vsrlb vs vsb vsh vsf vsg vsq vscbi vscbib vscbih vscbif vscbig
72 vscbiq vsbi vsbiq vsbcbi vsbcbiq vsumg vsumgh vsumgf vsumq vsumqf
73 vsumqg vsum vsumb vsumh vtm vfae vfaeb vfaeh vfaef vfaebs vfaehs
74 vfaefs vfaezb vfaezh vfaezf vfaezbs vfaezhs vfaezfs vfee vfeeb
75 vfeeh vfeef vfeebs vfeehs vfeefs vfeezb vfeezh vfeezf vfeezbs
76 vfeezhs vfeezfs vfene vfeneb vfeneh vfenef vfenebs vfenehs vfenefs
77 vfenezb vfenezh vfenezf vfenezbs vfenezhs vfenezfs vistr vistrb
78 vistrh vistrf vistrbs vistrhs vistrfs vstrc vstrcb vstrch vstrcf
79 vstrcbs vstrchs vstrcfs vstrczb vstrczh vstrczf vstrczbs vstrczhs
80 vstrczfs vfa vfadb wfadb wfc wfcdb wfk wfkdb vfce vfcedb wfcedb
81 vfcedbs wfcedbs vfch vfchdb wfchdb vfchdbs wfchdbs vfche vfchedb
82 wfchedb vfchedbs wfchedbs vcdg vcdgb wcdgb vcdlg vcdlgb wcdlgb vcgd
83 vcgdb wcgdb vclgd vclgdb wclgdb vfd vfddb wfddb vfi vfidb wfidb
84 vlde vldeb wldeb vled vledb wledb vfm vfmdb wfmdb vfma vfmadb
85 wfmadb vfms vfmsdb wfmsdb vfpso vfpsodb wfpsodb vflcdb wflcdb
86 vflndb wflndb vflpdb wflpdb vfsq vfsqdb wfsqdb vfs vfsdb wfsdb
87 vftci vftcidb wftcidb)],
88 # vector-enhancements facility 1
89 VXE => [qw(vbperm vllezlf vmsl vmslg vnx vnn voc vpopctb vpopcth
90 vpopctf vpopctg vfasb wfasb wfaxb wfcsb wfcxb wfksb wfkxb vfcesb
91 vfcesbs wfcesb wfcesbs wfcexb wfcexbs vfchsb vfchsbs wfchsb wfchsbs
92 wfchxb wfchxbs vfchesb vfchesbs wfchesb wfchesbs wfchexb wfchexbs
93 vfdsb wfdsb wfdxb vfisb wfisb wfixb vfll vflls wflls wflld vflr
94 vflrd wflrd wflrx vfmax vfmaxsb vfmaxdb wfmaxsb wfmaxdb wfmaxxb
95 vfmin vfminsb vfmindb wfminsb wfmindb wfminxb vfmsb wfmsb wfmxb
96 vfnma vfnms vfmasb wfmasb wfmaxb vfmssb wfmssb wfmsxb vfnmasb
97 vfnmadb wfnmasb wfnmadb wfnmaxb vfnmssb vfnmsdb wfnmssb wfnmsdb
98 wfnmsxb vfpsosb wfpsosb vflcsb wflcsb vflnsb wflnsb vflpsb wflpsb
99 vfpsoxb wfpsoxb vflcxb wflcxb vflnxb wflnxb vflpxb wflpxb vfsqsb
100 wfsqsb wfsqxb vfssb wfssb wfsxb vftcisb wftcisb wftcixb)],
101 # vector-packed-decimal facility
102 VXD => [qw(vlrlr vlrl vstrlr vstrl vap vcp vcvb vcvbg vcvd vcvdg vdp
103 vlip vmp vmsp vpkz vpsop vrp vsdp vsrp vsp vtp vupkz)],
105 Exporter::export_ok_tags(qw(LD GE EI MI1 MSA MSA4 MSA5 MSA8 VX VXE VXD));
109 my $GR='(?:%r)?([0-9]|1[0-5])';
110 my $VR='(?:%v)?([0-9]|1[0-9]|2[0-9]|3[0-1])';
116 ($file,$out)=(shift,"");
120 if (defined($file)) {
121 open(my $fd,'>',$file)||die("can't open $file: $!");
130 confess(err("PARSE")) if (grep(!defined($_),@_));
133 $token=".$1" if (/^.*::([A-Z_]+)$/); # uppercase: directive
134 $token="\t$1" if (/^.*::([a-z]+)$/); # lowercase: mnemonic
135 confess(err("PARSE")) if (!defined($token));
137 $token.="\t" if ($#_>=0);
138 $out.=$token.join(',',@_)."\n";
141 sub LABEL { # label directive
142 confess(err("ARGNUM")) if ($#_!=0);
148 confess(err("ARGNUM")) if ($#_!=0);
150 $out.="#include \"$file\"\n";
158 confess(err("ARGNUM")) if ($#_!=0);
165 confess(err("ARGNUM")) if ($#_!=1);
170 confess(err("ARGNUM")) if ($#_!=1);
175 confess(err("ARGNUM")) if ($#_<3||$#_>4);
180 confess(err("ARGNUM")) if ($#_<3||$#_>4);
187 confess(err("ARGNUM")) if ($#_!=1);
192 confess(err("ARGNUM")) if ($#_!=1);
197 confess(err("ARGNUM")) if ($#_!=1);
202 confess(err("ARGNUM")) if ($#_!=1);
207 confess(err("ARGNUM")) if ($#_!=1);
214 confess(err("ARGNUM")) if ($#_!=1);
219 confess(err("ARGNUM")) if ($#_!=1);
224 confess(err("ARGNUM")) if ($#_!=-1);
229 confess(err("ARGNUM")) if ($#_!=2);
239 sub ppno { # deprecated, use prno
240 confess(err("ARGNUM")) if ($#_!=1);
247 confess(err("ARGNUM")) if ($#_!=2);
251 # VX - Support Instructions
254 confess(err("ARGNUM")) if ($#_!=2);
258 confess(err("ARGNUM")) if ($#_!=2);
263 confess(err("ARGNUM")) if ($#_!=1);
274 confess(err("ARGNUM")) if ($#_!=3);
291 confess(err("ARGNUM")) if ($#_<1||$#_>2);
296 confess(err("ARGNUM")) if ($#_!=1);
301 confess(err("ARGNUM")) if ($#_!=2);
318 confess(err("ARGNUM")) if ($#_!=2);
322 confess(err("ARGNUM")) if ($#_!=2);
326 confess(err("ARGNUM")) if ($#_!=2);
330 confess(err("ARGNUM")) if ($#_!=2);
335 confess(err("ARGNUM")) if ($#_!=2);
339 confess(err("ARGNUM")) if ($#_!=2);
343 confess(err("ARGNUM")) if ($#_!=2);
347 confess(err("ARGNUM")) if ($#_!=2);
352 confess(err("ARGNUM")) if ($#_!=3);
369 confess(err("ARGNUM")) if ($#_!=2);
386 confess(err("ARGNUM")) if ($#_<2||$#_>3);
391 confess(err("ARGNUM")) if ($#_!=2);
396 confess(err("ARGNUM")) if ($#_!=3);
413 confess(err("ARGNUM")) if ($#_!=2);
418 confess(err("ARGNUM")) if ($#_!=2);
423 confess(err("ARGNUM")) if ($#_!=3);
440 confess(err("ARGNUM")) if ($#_!=3);
457 confess(err("ARGNUM")) if ($#_!=3);
471 confess(err("ARGNUM")) if ($#_!=4);
494 confess(err("ARGNUM")) if ($#_!=4);
517 confess(err("ARGNUM")) if ($#_!=3);
522 confess(err("ARGNUM")) if ($#_!=3);
527 confess(err("ARGNUM")) if ($#_!=3);
544 confess(err("ARGNUM")) if ($#_!=2);
561 confess(err("ARGNUM")) if ($#_!=2);
565 confess(err("ARGNUM")) if ($#_!=2);
570 confess(err("ARGNUM")) if ($#_!=3);
575 confess(err("ARGNUM")) if ($#_!=2);
589 confess(err("ARGNUM")) if ($#_<1||$#_>2);
594 confess(err("ARGNUM")) if ($#_!=2);
598 confess(err("ARGNUM")) if ($#_!=2);
602 confess(err("ARGNUM")) if ($#_!=2);
606 confess(err("ARGNUM")) if ($#_!=2);
611 confess(err("ARGNUM")) if ($#_<2||$#_>3);
616 confess(err("ARGNUM")) if ($#_!=2);
621 confess(err("ARGNUM")) if ($#_!=2);
635 confess(err("ARGNUM")) if ($#_!=2);
649 confess(err("ARGNUM")) if ($#_!=2);
663 confess(err("ARGNUM")) if ($#_!=2);
676 # VX - Integer Instructions
679 confess(err("ARGNUM")) if ($#_!=3);
699 confess(err("ARGNUM")) if ($#_!=3);
719 confess(err("ARGNUM")) if ($#_!=4);
727 confess(err("ARGNUM")) if ($#_!=4);
735 confess(err("ARGNUM")) if ($#_!=2);
740 confess(err("ARGNUM")) if ($#_!=2);
745 confess(err("ARGNUM")) if ($#_!=3);
762 confess(err("ARGNUM")) if ($#_!=3);
779 confess(err("ARGNUM")) if ($#_!=2);
784 confess(err("ARGNUM")) if ($#_!=2);
801 confess(err("ARGNUM")) if ($#_!=2);
818 confess(err("ARGNUM")) if ($#_!=4);
847 confess(err("ARGNUM")) if ($#_!=4);
876 confess(err("ARGNUM")) if ($#_!=4);
905 confess(err("ARGNUM")) if ($#_!=2);
922 confess(err("ARGNUM")) if ($#_!=2);
939 confess(err("ARGNUM")) if ($#_!=2);
944 confess(err("ARGNUM")) if ($#_!=3);
961 confess(err("ARGNUM")) if ($#_!=4);
978 confess(err("ARGNUM")) if ($#_!=2);
995 confess(err("ARGNUM")) if ($#_!=2);
1012 confess(err("ARGNUM")) if ($#_!=3);
1029 confess(err("ARGNUM")) if ($#_!=3);
1046 confess(err("ARGNUM")) if ($#_!=3);
1063 confess(err("ARGNUM")) if ($#_!=3);
1080 confess(err("ARGNUM")) if ($#_!=4);
1094 confess(err("ARGNUM")) if ($#_!=4);
1108 confess(err("ARGNUM")) if ($#_!=4);
1122 confess(err("ARGNUM")) if ($#_!=4);
1136 confess(err("ARGNUM")) if ($#_!=4);
1150 confess(err("ARGNUM")) if ($#_!=4);
1164 confess(err("ARGNUM")) if ($#_!=4);
1178 confess(err("ARGNUM")) if ($#_!=3);
1192 confess(err("ARGNUM")) if ($#_!=3);
1206 confess(err("ARGNUM")) if ($#_!=3);
1220 confess(err("ARGNUM")) if ($#_!=3);
1234 confess(err("ARGNUM")) if ($#_!=3);
1248 confess(err("ARGNUM")) if ($#_!=3);
1262 confess(err("ARGNUM")) if ($#_!=3);
1276 confess(err("ARGNUM")) if ($#_!=2);
1284 confess(err("ARGNUM")) if ($#_!=2);
1289 confess(err("ARGNUM")) if ($#_!=2);
1294 confess(err("ARGNUM")) if ($#_!=3);
1311 confess(err("ARGNUM")) if ($#_!=3);
1328 confess(err("ARGNUM")) if ($#_!=4);
1345 confess(err("ARGNUM")) if ($#_!=3);
1362 confess(err("ARGNUM")) if ($#_!=3);
1379 confess(err("ARGNUM")) if ($#_!=3);
1396 confess(err("ARGNUM")) if ($#_!=3);
1413 confess(err("ARGNUM")) if ($#_!=3);
1430 confess(err("ARGNUM")) if ($#_!=3);
1447 confess(err("ARGNUM")) if ($#_!=2);
1452 confess(err("ARGNUM")) if ($#_!=2);
1457 confess(err("ARGNUM")) if ($#_!=3);
1462 confess(err("ARGNUM")) if ($#_!=2);
1467 confess(err("ARGNUM")) if ($#_!=2);
1472 confess(err("ARGNUM")) if ($#_!=2);
1477 confess(err("ARGNUM")) if ($#_!=2);
1482 confess(err("ARGNUM")) if ($#_!=3);
1502 confess(err("ARGNUM")) if ($#_!=3);
1522 confess(err("ARGNUM")) if ($#_!=4);
1530 confess(err("ARGNUM")) if ($#_!=4);
1538 confess(err("ARGNUM")) if ($#_!=3);
1549 confess(err("ARGNUM")) if ($#_!=3);
1560 confess(err("ARGNUM")) if ($#_!=3);
1571 confess(err("ARGNUM")) if ($#_!=1);
1575 # VX - String Instructions
1578 confess(err("ARGNUM")) if ($#_<3||$#_>4);
1582 vfae(@_[0..2],0,$_[3]);
1585 vfae(@_[0..2],1,$_[3]);
1588 vfae(@_[0..2],2,$_[3]);
1591 $_[3]=0 if (!defined($_[3]));
1592 vfae(@_[0..2],0,0x1|$_[3]);
1595 $_[3]=0 if (!defined($_[3]));
1596 vfae(@_[0..2],1,0x1|$_[3]);
1599 $_[3]=0 if (!defined($_[3]));
1600 vfae(@_[0..2],2,0x1|$_[3]);
1603 $_[3]=0 if (!defined($_[3]));
1604 vfae(@_[0..2],0,0x2|$_[3]);
1607 $_[3]=0 if (!defined($_[3]));
1608 vfae(@_[0..2],1,0x2|$_[3]);
1611 $_[3]=0 if (!defined($_[3]));
1612 vfae(@_[0..2],2,0x2|$_[3]);
1615 $_[3]=0 if (!defined($_[3]));
1616 vfae(@_[0..2],0,0x3|$_[3]);
1619 $_[3]=0 if (!defined($_[3]));
1620 vfae(@_[0..2],1,0x3|$_[3]);
1623 $_[3]=0 if (!defined($_[3]));
1624 vfae(@_[0..2],2,0x3|$_[3]);
1628 confess(err("ARGNUM")) if ($#_<3||$#_>4);
1632 vfee(@_[0..2],0,$_[3]);
1635 vfee(@_[0..2],1,$_[3]);
1638 vfee(@_[0..2],2,$_[3]);
1669 confess(err("ARGNUM")) if ($#_<3||$#_>4);
1673 vfene(@_[0..2],0,$_[3]);
1676 vfene(@_[0..2],1,$_[3]);
1679 vfene(@_[0..2],2,$_[3]);
1710 confess(err("ARGNUM")) if ($#_<2||$#_>3);
1711 VRRa(0xe75c,@_[0..2],0,$_[3]);
1714 vistr(@_[0..1],0,$_[2]);
1717 vistr(@_[0..1],1,$_[2]);
1720 vistr(@_[0..1],2,$_[2]);
1733 confess(err("ARGNUM")) if ($#_<4||$#_>5);
1737 vstrc(@_[0..3],0,$_[4]);
1740 vstrc(@_[0..3],1,$_[4]);
1743 vstrc(@_[0..3],2,$_[4]);
1746 $_[4]=0 if (!defined($_[4]));
1747 vstrc(@_[0..3],0,0x1|$_[4]);
1750 $_[4]=0 if (!defined($_[4]));
1751 vstrc(@_[0..3],1,0x1|$_[4]);
1754 $_[4]=0 if (!defined($_[4]));
1755 vstrc(@_[0..3],2,0x1|$_[4]);
1758 $_[4]=0 if (!defined($_[4]));
1759 vstrc(@_[0..3],0,0x2|$_[4]);
1762 $_[4]=0 if (!defined($_[4]));
1763 vstrc(@_[0..3],1,0x2|$_[4]);
1766 $_[4]=0 if (!defined($_[4]));
1767 vstrc(@_[0..3],2,0x2|$_[4]);
1770 $_[4]=0 if (!defined($_[4]));
1771 vstrc(@_[0..3],0,0x3|$_[4]);
1774 $_[4]=0 if (!defined($_[4]));
1775 vstrc(@_[0..3],1,0x3|$_[4]);
1778 $_[4]=0 if (!defined($_[4]));
1779 vstrc(@_[0..3],2,0x3|$_[4]);
1782 # VX - Floating-point Instructions
1785 confess(err("ARGNUM")) if ($#_!=4);
1796 confess(err("ARGNUM")) if ($#_!=3);
1804 confess(err("ARGNUM")) if ($#_!=3);
1818 confess(err("ARGNUM")) if ($#_!=5);
1835 confess(err("ARGNUM")) if ($#_!=5);
1852 confess(err("ARGNUM")) if ($#_!=5);
1869 confess(err("ARGNUM")) if ($#_!=4);
1873 vcdg(@_[0..1],3,@_[2..3]);
1876 vcdg(@_[0..1],3,0x8|$_[2],$_[3]);
1880 confess(err("ARGNUM")) if ($#_!=4);
1884 vcdlg(@_[0..1],3,@_[2..3]);
1887 vcdlg(@_[0..1],3,0x8|$_[2],$_[3]);
1891 confess(err("ARGNUM")) if ($#_!=4);
1895 vcgd(@_[0..1],3,@_[2..3]);
1898 vcgd(@_[0..1],3,0x8|$_[2],$_[3]);
1902 confess(err("ARGNUM")) if ($#_!=4);
1906 vclgd(@_[0..1],3,@_[2..3]);
1909 vclgd(@_[0..1],3,0x8|$_[2],$_[3]);
1913 confess(err("ARGNUM")) if ($#_!=4);
1924 confess(err("ARGNUM")) if ($#_!=4);
1928 vfi(@_[0..1],3,@_[2..3]);
1931 vfi(@_[0..1],3,0x8|$_[2],$_[3]);
1934 sub vlde { # deprecated, use vfll
1935 confess(err("ARGNUM")) if ($#_!=3);
1938 sub vldeb { # deprecated, use vflls
1941 sub wldeb { # deprecated, use wflls
1945 sub vled { # deprecated, use vflr
1946 confess(err("ARGNUM")) if ($#_!=4);
1949 sub vledb { # deprecated, use vflrd
1950 vled(@_[0..1],3,@_[2..3]);
1952 sub wledb { # deprecated, use wflrd
1953 vled(@_[0..1],3,0x8|$_[2],$_[3]);
1957 confess(err("ARGNUM")) if ($#_!=4);
1968 confess(err("ARGNUM")) if ($#_!=5);
1979 confess(err("ARGNUM")) if ($#_!=5);
1990 confess(err("ARGNUM")) if ($#_!=4);
1994 vfpso(@_[0..1],3,0,$_[2]);
1997 vfpso(@_[0..1],3,8,$_[2]);
2019 confess(err("ARGNUM")) if ($#_!=3);
2030 confess(err("ARGNUM")) if ($#_!=4);
2041 confess(err("ARGNUM")) if ($#_!=4);
2051 # VXE - Support Instructions
2054 confess(err("ARGNUM")) if ($#_!=2);
2062 # VXE - Integer Instructions
2065 confess(err("ARGNUM")) if ($#_!=5);
2069 vmsl(@_[0..3],3,$_[4]);
2073 confess(err("ARGNUM")) if ($#_!=2);
2078 confess(err("ARGNUM")) if ($#_!=2);
2083 confess(err("ARGNUM")) if ($#_!=2);
2100 # VXE - Floating-Point Instructions
2187 vfi(@_[0..1],2,@_[2..3]);
2190 vfi(@_[0..1],2,0x8|$_[2],$_[3]);
2193 vfi(@_[0..1],4,0x8|$_[2],$_[3]);
2213 vflr(@_[0..1],3,@_[2..3]);
2216 vflr(@_[0..1],3,0x8|$_[2],$_[3]);
2219 vflr(@_[0..1],4,0x8|$_[2],$_[3]);
2223 confess(err("ARGNUM")) if ($#_!=5);
2227 vfmax(@_[0..2],2,0,$_[3]);
2230 vfmax(@_[0..2],3,0,$_[3]);
2233 vfmax(@_[0..2],2,8,$_[3]);
2236 vfmax(@_[0..2],3,8,$_[3]);
2239 vfmax(@_[0..2],4,8,$_[3]);
2243 confess(err("ARGNUM")) if ($#_!=5);
2247 vfmin(@_[0..2],2,0,$_[5]);
2250 vfmin(@_[0..2],3,0,$_[5]);
2253 vfmin(@_[0..2],2,8,$_[5]);
2256 vfmin(@_[0..2],3,8,$_[5]);
2259 vfmin(@_[0..2],4,8,$_[5]);
2293 confess(err("ARGNUM")) if ($#_!=5);
2313 confess(err("ARGNUM")) if ($#_!=5);
2333 vfpso(@_[0..1],2,0,$_[2]);
2336 vfpso(@_[0..1],2,8,$_[2]);
2357 vfpso(@_[0..1],4,0,$_[2]);
2360 vfpso(@_[0..1],4,8,$_[2]);
2411 # VXD - Support Instructions
2414 confess(err("ARGNUM")) if ($#_!=2);
2419 confess(err("ARGNUM")) if ($#_!=2);
2424 confess(err("ARGNUM")) if ($#_!=2);
2429 confess(err("ARGNUM")) if ($#_!=2);
2434 confess(err("ARGNUM")) if ($#_!=4);
2439 confess(err("ARGNUM")) if ($#_!=2);
2444 confess(err("ARGNUM")) if ($#_!=2);
2449 confess(err("ARGNUM")) if ($#_!=2);
2454 confess(err("ARGNUM")) if ($#_!=3);
2459 confess(err("ARGNUM")) if ($#_!=3);
2464 confess(err("ARGNUM")) if ($#_!=4);
2469 confess(err("ARGNUM")) if ($#_!=2);
2474 confess(err("ARGNUM")) if ($#_!=4);
2479 confess(err("ARGNUM")) if ($#_!=4);
2484 confess(err("ARGNUM")) if ($#_!=2);
2489 confess(err("ARGNUM")) if ($#_!=4);
2494 confess(err("ARGNUM")) if ($#_!=4);
2499 confess(err("ARGNUM")) if ($#_!=4);
2504 confess(err("ARGNUM")) if ($#_!=4);
2509 confess(err("ARGNUM")) if ($#_!=4);
2514 confess(err("ARGNUM")) if ($#_!=0);
2519 confess(err("ARGNUM")) if ($#_!=2);
2524 # Instruction Formats
2528 confess(err("ARGNUM")) if ($#_<4||5<$#_);
2529 my $ops=join(',',@_[1..$#_]);
2530 my $memn=(caller(1))[3];
2532 my ($opcode,$r1,$r2,$i3,$i4,$i5)=(shift,get_R(shift),get_R(shift),
2533 get_I(shift,8),get_I(shift,8),
2537 $out.=sprintf("%#06x",(($opcode>>8)<<8|$r1<<4|$r2)).",";
2538 $out.=sprintf("%#06x",($i3<<8)|$i4).",";
2539 $out.=sprintf("%#06x",($i5<<8)|($opcode&0xff));
2540 $out.="\t# $memn\t$ops\n"
2544 confess(err("ARGNUM")) if ($#_!=2);
2545 my $ops=join(',',@_[1..$#_]);
2546 my $memn=(caller(1))[3];
2548 my ($opcode,$r1,$i2)=(shift,get_R(shift),get_I(shift,32));
2551 $out.=sprintf("%#06x",(($opcode>>4)<<8|$r1<<4|($opcode&0xf))).",";
2552 $out.=sprintf("%#06x",($i2>>16)).",";
2553 $out.=sprintf("%#06x",($i2&0xffff));
2554 $out.="\t# $memn\t$ops\n"
2558 confess(err("ARGNUM")) if ($#_<0||2<$#_);
2559 my $ops=join(',',@_[1..$#_]);
2560 my $memn=(caller(1))[3];
2562 my ($opcode,$r1,$r2)=(shift,get_R(shift),get_R(shift));
2564 $out.="\t.long\t".sprintf("%#010x",($opcode<<16|$r1<<4|$r2));
2565 $out.="\t# $memn\t$ops\n"
2569 confess(err("ARGNUM")) if ($#_<3||4<$#_);
2570 my $ops=join(',',@_[1..$#_]);
2571 my $memn=(caller(1))[3];
2573 my ($opcode,$r1,$r3,$r2,$m4)=(shift,get_R(shift),get_R(shift)
2574 ,get_R(shift),get_M(shift));
2577 .sprintf("%#010x",($opcode<<16|$r3<<12|$m4<<8|$r1<<4|$r2));
2578 $out.="\t# $memn\t$ops\n"
2582 confess(err("ARGNUM")) if ($#_!=2);
2583 my $ops=join(',',@_[1..$#_]);
2584 my $memn=(caller(1))[3];
2586 my ($opcode,$r1,$d2,$x2,$b2)=(shift,get_R(shift),get_DXB(shift));
2589 $out.=sprintf("%#06x",(($opcode>>8)<<8|$r1<<4|$x2)).",";
2590 $out.=sprintf("%#06x",($b2<<12|($d2&0xfff))).",";
2591 $out.=sprintf("%#06x",(($d2>>12)<<8|$opcode&0xff));
2592 $out.="\t# $memn\t$ops\n"
2596 confess(err("ARGNUM")) if ($#_<0||1<$#_);
2597 my $ops=join(',',@_[1..$#_]);
2598 my $memn=(caller(1))[3];
2600 my ($opcode,$d2,$b2)=(shift,get_DB(shift));
2602 $out.="\t.long\t".sprintf("%#010x",($opcode<<16|$b2<<12|$d2));
2603 $out.="\t# $memn\t$ops\n"
2607 confess(err("ARGNUM")) if ($#_<2||3<$#_);
2608 my $ops=join(',',@_[1..$#_]);
2609 my $memn=(caller(1))[3];
2611 my ($opcode,$v1,$i2,$m3)=(shift,get_V(shift),get_I(shift,16),
2615 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4)).",";
2616 $out.=sprintf("%#06x",$i2).",";
2617 $out.=sprintf("%#06x",($m3<<12|RXB($v1)<<8|$opcode&0xff));
2618 $out.="\t# $memn\t$ops\n"
2622 confess(err("ARGNUM")) if ($#_!=4);
2623 my $ops=join(',',@_[1..$#_]);
2624 my $memn=(caller(1))[3];
2626 my ($opcode,$v1,$i2,$i3,$m4)=(shift,get_V(shift),get_I(shift,8),
2627 ,get_I(shift,8),get_M(shift));
2630 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4)).",";
2631 $out.=sprintf("%#06x",($i2<<8|$i3)).",";
2632 $out.=sprintf("%#06x",($m4<<12|RXB($v1)<<8|$opcode&0xff));
2633 $out.="\t# $memn\t$ops\n"
2637 confess(err("ARGNUM")) if ($#_!=4);
2638 my $ops=join(',',@_[1..$#_]);
2639 my $memn=(caller(1))[3];
2641 my ($opcode,$v1,$v3,$i2,$m4)=(shift,get_V(shift),get_V(shift),
2642 ,get_I(shift,16),get_M(shift));
2645 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4)|($v3&0xf)).",";
2646 $out.=sprintf("%#06x",$i2).",";
2647 $out.=sprintf("%#06x",($m4<<12|RXB($v1,$v3)<<8|$opcode&0xff));
2648 $out.="\t# $memn\t$ops\n"
2652 confess(err("ARGNUM")) if ($#_<4||$#_>5);
2653 my $ops=join(',',@_[1..$#_]);
2654 my $memn=(caller(1))[3];
2656 my ($opcode,$v1,$v2,$v3,$i4,$m5)=(shift,get_V(shift),get_V(shift),
2657 ,get_V(shift),get_I(shift,8),get_M(shift));
2660 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4)|($v2&0xf)).",";
2661 $out.=sprintf("%#06x",(($v3&0xf)<<12|$i4)).",";
2662 $out.=sprintf("%#06x",($m5<<12|RXB($v1,$v2,$v3)<<8|$opcode&0xff));
2663 $out.="\t# $memn\t$ops\n"
2667 confess(err("ARGNUM")) if ($#_!=5);
2668 my $ops=join(',',@_[1..$#_]);
2669 my $memn=(caller(1))[3];
2671 my ($opcode,$v1,$v2,$i3,$m4,$m5)=(shift,get_V(shift),get_V(shift),
2672 ,get_I(shift,12),get_M(shift),get_M(shift));
2675 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4)|($v2&0xf)).",";
2676 $out.=sprintf("%#06x",($i3<<4|$m5)).",";
2677 $out.=sprintf("%#06x",($m4<<12|RXB($v1,$v2)<<8|$opcode&0xff));
2678 $out.="\t# $memn\t$ops\n"
2682 confess(err("ARGNUM")) if ($#_!=5);
2683 my $ops=join(',',@_[1..$#_]);
2684 my $memn=(caller(1))[3];
2686 my ($opcode,$v1,$v2,$v3,$i4,$m5)=(shift,get_V(shift),get_V(shift),
2687 ,get_V(shift),get_I(shift,8),get_M(shift));
2690 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4)|($v2&0xf)).",";
2691 $out.=sprintf("%#06x",(($v3&0xf)<<12|$m5<<4)|$i4>>4).",";
2692 $out.=sprintf("%#06x",(($i4&0xf)<<12|RXB($v1,$v2,$v3)<<8|$opcode&0xff));
2693 $out.="\t# $memn\t$ops\n"
2697 confess(err("ARGNUM")) if ($#_!=5);
2698 my $ops=join(',',@_[1..$#_]);
2699 my $memn=(caller(1))[3];
2701 my ($opcode,$v1,$v2,$i3,$i4,$m5)=(shift,get_V(shift),get_V(shift),
2702 ,get_I(shift,8),get_I(shift,8),get_M(shift));
2705 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4)|($v2&0xf)).",";
2706 $out.=sprintf("%#06x",($i4<<8|$m5<<4|$i3>>4)).",";
2707 $out.=sprintf("%#06x",(($i3&0xf)<<12|RXB($v1,$v2)<<8|$opcode&0xff));
2708 $out.="\t# $memn\t$ops\n"
2712 confess(err("ARGNUM")) if ($#_!=3);
2713 my $ops=join(',',@_[1..$#_]);
2714 my $memn=(caller(1))[3];
2716 my ($opcode,$v1,$i2,$i3)=(shift,get_V(shift),get_I(shift,16),
2720 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4)).",";
2721 $out.=sprintf("%#06x",$i2).",";
2722 $out.=sprintf("%#06x",($i3<<12|RXB($v1)<<8|$opcode&0xff));
2723 $out.="\t# $memn\t$ops\n"
2727 confess(err("ARGNUM")) if ($#_!=4);
2728 my $ops=join(',',@_[1..$#_]);
2729 my $memn=(caller(1))[3];
2731 my ($opcode,$v1,$r2,$i3,$m4)=(shift,get_V(shift),get_R(shift),
2732 ,get_I(shift,8),get_M(shift));
2735 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4)|$r2).",";
2736 $out.=sprintf("%#06x",($m4<<4|$i3>>4)).",";
2737 $out.=sprintf("%#06x",(($i3&0xf)<<12|RXB($v1)<<8|$opcode&0xff));
2738 $out.="\t# $memn\t$ops\n"
2742 confess(err("ARGNUM")) if ($#_<2||5<$#_);
2743 my $ops=join(',',@_[1..$#_]);
2744 my $memn=(caller(1))[3];
2746 my ($opcode,$v1,$v2,$m3,$m4,$m5)=(shift,get_V(shift),get_V(shift),
2747 get_M(shift),get_M(shift),get_M(shift));
2750 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4|($v2&0xf))).",";
2751 $out.=sprintf("%#06x",($m5<<4|$m4)).",";
2752 $out.=sprintf("%#06x",($m3<<12|RXB($v1,$v2)<<8|$opcode&0xff));
2753 $out.="\t# $memn\t$ops\n"
2757 confess(err("ARGNUM")) if ($#_<3||5<$#_);
2758 my $ops=join(',',@_[1..$#_]);
2759 my $memn=(caller(1))[3];
2761 my ($opcode,$v1,$v2,$v3,$m4,$m5)=(shift,get_V(shift),get_V(shift),
2762 get_V(shift),get_M(shift),get_M(shift));
2765 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4|($v2&0xf))).",";
2766 $out.=sprintf("%#06x",(($v3&0xf)<<12|$m5<<4)).",";
2767 $out.=sprintf("%#06x",($m4<<12|RXB($v1,$v2,$v3)<<8|$opcode&0xff));
2768 $out.="\t# $memn\t$ops\n"
2772 confess(err("ARGNUM")) if ($#_<3||6<$#_);
2773 my $ops=join(',',@_[1..$#_]);
2774 my $memn=(caller(1))[3];
2776 my ($opcode,$v1,$v2,$v3,$m4,$m5,$m6)=(shift,get_V(shift),get_V(shift),
2777 get_V(shift),get_M(shift),get_M(shift),get_M(shift));
2780 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4|($v2&0xf))).",";
2781 $out.=sprintf("%#06x",(($v3&0xf)<<12|$m6<<4|$m5)).",";
2782 $out.=sprintf("%#06x",($m4<<12|RXB($v1,$v2,$v3)<<8|$opcode&0xff));
2783 $out.="\t# $memn\t$ops\n"
2787 confess(err("ARGNUM")) if ($#_<4||6<$#_);
2788 my $ops=join(',',@_[1..$#_]);
2789 my $memn=(caller(1))[3];
2791 my ($opcode,$v1,$v2,$v3,$v4,$m5,$m6)=(shift,get_V(shift),get_V(shift),
2792 get_V(shift),get_V(shift),get_M(shift),get_M(shift));
2795 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4|($v2&0xf))).",";
2796 $out.=sprintf("%#06x",(($v3&0xf)<<12|$m5<<8|$m6<<4)).",";
2797 $out.=sprintf("%#06x",(($v4&0xf)<<12|RXB($v1,$v2,$v3,$v4)<<8|$opcode&0xff));
2798 $out.="\t# $memn\t$ops\n"
2802 confess(err("ARGNUM")) if ($#_<4||6<$#_);
2803 my $ops=join(',',@_[1..$#_]);
2804 my $memn=(caller(1))[3];
2806 my ($opcode,$v1,$v2,$v3,$v4,$m5,$m6)=(shift,get_V(shift),get_V(shift),
2807 get_V(shift),get_V(shift),get_M(shift),get_M(shift));
2810 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4|($v2&0xf))).",";
2811 $out.=sprintf("%#06x",(($v3&0xf)<<12|$m6<<8|$m5)).",";
2812 $out.=sprintf("%#06x",(($v4&0xf)<<12|RXB($v1,$v2,$v3,$v4)<<8|$opcode&0xff));
2813 $out.="\t# $memn\t$ops\n"
2817 confess(err("ARGNUM")) if ($#_!=3);
2818 my $ops=join(',',@_[1..$#_]);
2819 my $memn=(caller(1))[3];
2821 my ($opcode,$v1,$r2,$r3)=(shift,get_V(shift),get_R(shift),
2825 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4|$r2)).",";
2826 $out.=sprintf("%#06x",($r3<<12)).",";
2827 $out.=sprintf("%#06x",(RXB($v1)<<8|$opcode&0xff));
2828 $out.="\t# $memn\t$ops\n"
2832 confess(err("ARGNUM")) if ($#_!=1);
2833 my $ops=join(',',@_[1..$#_]);
2834 my $memn=(caller(1))[3];
2836 my ($opcode,$v1)=(shift,get_V(shift));
2839 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf))).",";
2840 $out.=sprintf("%#06x",0x0000).",";
2841 $out.=sprintf("%#06x",(RXB(0,$v1)<<8|$opcode&0xff));
2842 $out.="\t# $memn\t$ops\n"
2846 confess(err("ARGNUM")) if ($#_<2||$#_>3);
2847 my $ops=join(',',@_[1..$#_]);
2848 my $memn=(caller(1))[3];
2850 my ($opcode,$v1,$v2,$m3)=(shift,get_V(shift),get_V(shift),
2854 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf))).",";
2855 $out.=sprintf("%#06x",(($v2&0xf)<<12|$m3<<4)).",";
2856 $out.=sprintf("%#06x",(RXB(0,$v1,$v2)<<8|$opcode&0xff));
2857 $out.="\t# $memn\t$ops\n"
2861 confess(err("ARGNUM")) if ($#_!=3);
2862 my $ops=join(',',@_[1..$#_]);
2863 my $memn=(caller(1))[3];
2865 my ($opcode,$r1,$v2,$m3)=(shift,get_R(shift),get_V(shift),
2869 $out.=sprintf("%#06x",($opcode&0xff00|$r1<<4|($v2&0xf))).",";
2870 $out.=sprintf("%#06x",($m3<<4))."\,";
2871 $out.=sprintf("%#06x",(RXB(0,$v2)<<8|$opcode&0xff));
2872 $out.="\t# $memn\t$ops\n"
2876 confess(err("ARGNUM")) if ($#_<3||$#_>4);
2877 my $ops=join(',',@_[1..$#_]);
2878 my $memn=(caller(1))[3];
2880 my ($opcode,$v1,$v3,$d2,$b2,$m4)=(shift,get_V(shift),get_V(shift),
2881 get_DB(shift),get_M(shift));
2884 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4|($v3&0xf))).",";
2885 $out.=sprintf("%#06x",($b2<<12|$d2)).",";
2886 $out.=sprintf("%#06x",($m4<<12|RXB($v1,$v3)<<8|$opcode&0xff));
2887 $out.="\t# $memn\t$ops\n"
2891 confess(err("ARGNUM")) if ($#_<3||$#_>4);
2892 my $ops=join(',',@_[1..$#_]);
2893 my $memn=(caller(1))[3];
2895 my ($opcode,$v1,$r3,$d2,$b2,$m4)=(shift,get_V(shift),get_R(shift),
2896 get_DB(shift),get_M(shift));
2899 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4|$r3)).",";
2900 $out.=sprintf("%#06x",($b2<<12|$d2)).",";
2901 $out.=sprintf("%#06x",($m4<<12|RXB($v1)<<8|$opcode&0xff));
2902 $out.="\t# $memn\t$ops\n"
2906 confess(err("ARGNUM")) if ($#_!=4);
2907 my $ops=join(',',@_[1..$#_]);
2908 my $memn=(caller(1))[3];
2910 my ($opcode,$r1,$v3,$d2,$b2,$m4)=(shift,get_R(shift),get_V(shift),
2911 get_DB(shift),get_M(shift));
2914 $out.=sprintf("%#06x",($opcode&0xff00|$r1<<4|($v3&0xf))).",";
2915 $out.=sprintf("%#06x",($b2<<12|$d2)).",";
2916 $out.=sprintf("%#06x",($m4<<12|RXB(0,$v3)<<8|$opcode&0xff));
2917 $out.="\t# $memn\t$ops\n"
2921 confess(err("ARGNUM")) if ($#_!=3);
2922 my $ops=join(',',@_[1..$#_]);
2923 my $memn=(caller(1))[3];
2925 my ($opcode,$v1,$r3,$d2,$b2)=(shift,get_V(shift),get_R(shift),
2929 $out.=sprintf("%#06x",($opcode&0xff00|$r3)).",";
2930 $out.=sprintf("%#06x",($b2<<12|$d2)).",";
2931 $out.=sprintf("%#06x",(($v1&0xf)<<12|RXB(0,0,0,$v1)<<8|$opcode&0xff));
2932 $out.="\t# $memn\t$ops\n"
2936 confess(err("ARGNUM")) if ($#_<2||$#_>3);
2937 my $ops=join(',',@_[1..$#_]);
2938 my $memn=(caller(1))[3];
2940 my ($opcode,$v1,$d2,$v2,$b2,$m3)=(shift,get_V(shift),get_DVB(shift),
2944 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4|($v2&0xf))).",";
2945 $out.=sprintf("%#06x",($b2<<12|$d2)).",";
2946 $out.=sprintf("%#06x",($m3<<12|RXB($v1,$v2)<<8|$opcode&0xff));
2947 $out.="\t# $memn\t$ops\n"
2951 confess(err("ARGNUM")) if ($#_<2||$#_>3);
2952 my $ops=join(',',@_[1..$#_]);
2953 my $memn=(caller(1))[3];
2955 my ($opcode,$v1,$d2,$x2,$b2,$m3)=(shift,get_V(shift),get_DXB(shift),
2959 $out.=sprintf("%#06x",($opcode&0xff00|($v1&0xf)<<4|($x2))).",";
2960 $out.=sprintf("%#06x",($b2<<12|$d2)).",";
2961 $out.=sprintf("%#06x",($m3<<12|RXB($v1)<<8|$opcode&0xff));
2962 $out.="\t# $memn\t$ops\n"
2966 confess(err("ARGNUM")) if ($#_!=3);
2967 my $ops=join(',',@_[1..$#_]);
2968 my $memn=(caller(1))[3];
2970 my ($opcode,$v1,$d2,$b2,$i3)=(shift,get_V(shift),get_DB(shift),
2974 $out.=sprintf("%#06x",($opcode&0xff00|$i3)).",";
2975 $out.=sprintf("%#06x",($b2<<12|$d2)).",";
2976 $out.=sprintf("%#06x",(($v1&0xf)<<12|RXB(0,0,0,$v1)<<8|$opcode&0xff));
2977 $out.="\t# $memn\t$ops\n"
2985 confess(err("ARGNUM")) if ($#_!=0);
2994 confess(err("PARSE"));
2997 confess(err("ARGRANGE")) if ($r&~0xf);
3003 confess(err("ARGNUM")) if ($#_!=0);
3012 confess(err("PARSE"));
3015 confess(err("ARGRANGE")) if ($v&~0x1f);
3021 confess(err("ARGNUM")) if ($#_!=1);
3022 my ($i,$bits)=(shift,shift);
3024 $i=defined($i)?(eval($i)):(0);
3025 confess(err("PARSE")) if (!defined($i));
3026 confess(err("ARGRANGE")) if (abs($i)&~(2**$bits-1));
3028 return $i&(2**$bits-1);
3032 confess(err("ARGNUM")) if ($#_!=0);
3035 $m=defined($m)?(eval($m)):(0);
3036 confess(err("PARSE")) if (!defined($m));
3037 confess(err("ARGRANGE")) if ($m&~0xf);
3044 confess(err("ARGNUM")) if ($#_!=0);
3050 } elsif (/^(.+)\($GR\)$/) {
3051 ($d,$b)=(eval($1),$2);
3052 confess(err("PARSE")) if (!defined($d));
3053 } elsif (/^(.+)$/) {
3054 ($d,$b)=(eval($1),0);
3055 confess(err("PARSE")) if (!defined($d));
3057 confess(err("PARSE"));
3060 confess(err("ARGRANGE")) if ($d&~0xfff||$b&~0xf);
3067 confess(err("ARGNUM")) if ($#_!=0);
3073 } elsif (/^(.+)\($VR,$GR\)$/) {
3074 ($d,$v,$b)=(eval($1),$2,$3);
3075 confess(err("PARSE")) if (!defined($d));
3076 } elsif (/^(.+)\($GR\)$/) {
3077 ($d,$v,$b)=(eval($1),0,$2);
3078 confess(err("PARSE")) if (!defined($d));
3079 } elsif (/^(.+)$/) {
3080 ($d,$v,$b)=(eval($1),0,0);
3081 confess(err("PARSE")) if (!defined($d));
3083 confess(err("PARSE"));
3086 confess(err("ARGRANGE")) if ($d&~0xfff||$v&~0x1f||$b&~0xf);
3093 confess(err("ARGNUM")) if ($#_!=0);
3099 } elsif (/^(.+)\($GR,$GR\)$/) {
3100 ($d,$x,$b)=(eval($1),$2,$3);
3101 confess(err("PARSE")) if (!defined($d));
3102 } elsif (/^(.+)\($GR\)$/) {
3103 ($d,$x,$b)=(eval($1),0,$2);
3104 confess(err("PARSE")) if (!defined($d));
3105 } elsif (/^(.+)$/) {
3106 ($d,$x,$b)=(eval($1),0,0);
3107 confess(err("PARSE")) if (!defined($d));
3109 confess(err("PARSE"));
3112 confess(err("ARGRANGE")) if ($d&~0xfff||$x&~0xf||$b&~0xf);
3119 confess(err("ARGNUM")) if ($#_<0||3<$#_);
3122 $rxb|=0x08 if (defined($_[0])&&($_[0]&0x10));
3123 $rxb|=0x04 if (defined($_[1])&&($_[1]&0x10));
3124 $rxb|=0x02 if (defined($_[2])&&($_[2]&0x10));
3125 $rxb|=0x01 if (defined($_[3])&&($_[3]&0x10));
3133 ARGNUM => 'Wrong number of arguments',
3134 ARGRANGE=> 'Argument out of range',
3135 PARSE => 'Parse error',
3137 confess($ERR{ARGNUM}) if ($#_!=0);