指令实际上包括两种信息即操作码和地址码

一条指令实际上包括两种信息即操作码和地址码。操作码(OperationCode,OP)用来表示该指令所要完成的操作(如加、减、乘、除、数据传送等),其长度取决于指令系统中的指令条数。

地址码用来描述该指令的操作对象,它或者直接给出操作数,或者指出操作数的存储器地址或寄存器地址(即寄存器名)。

 1 package Com.TableText;
 2 
 3 import java.io.BufferedInputStream;  
 4 import java.io.BufferedOutputStream;  
 5 import java.io.File;  
 6 import java.io.FileInputStream;  
 7 import java.io.FileOutputStream;  
 8 import java.util.zip.ZipEntry;  
 9 import java.util.zip.ZipOutputStream;  
10   
11   
12 public class TableText_04 {  
13     static final int BUFFER = 2048;  
14       
15     public static boolean zip( String[] filename ,String outname){  
16           
17         boolean test = true;  
18         try {  
19             BufferedInputStream origin = null;  
20             FileOutputStream dest = new FileOutputStream(outname);  
21             ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(  
22                     dest));  
23             byte data[] = new byte[BUFFER];  
24      
25               
26             for (int i = 0; i < filename.length; i++) {  
27                 File file = new File(filename[i]);  
28                 FileInputStream fi = new FileInputStream(file);  
29                 origin = new BufferedInputStream(fi, BUFFER);  
30                 ZipEntry entry = new ZipEntry(file.getName());  
31                 out.putNextEntry(entry);  
32                 int count;  
33                 while ((count = origin.read(data, 0, BUFFER)) != -1) {  
34                     out.write(data, 0, count);  
35                 }  
36                 origin.close();  
37             }  
38             out.close();  
39         } catch (Exception e) {  
40             test = false;  
41             e.printStackTrace();  
42         }  
43         return test;  
44     }  
45 
46       
47     public static void main(String argv[]) {   
48         String[] filenames = new String[]{"H:\\ch.doc"};  
49         zip(filenames,"H:/ch.zip");  
50     }  
51 }  

 

posted @ 2018-07-29 20:51  borter  阅读(5082)  评论(0编辑  收藏  举报