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


    一条指令实际上包括两种信息即操作码和地址码。操作码(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 }  
  • 相关阅读:
    家庭小账本——主函数以及其他方法的完善
    《梦断代码》读后感
    《梦断代码》读后感
    基本程序单元Activity
    数据库Dao层编增删改查写,数据库事务,数据库升级
    LeetCode Medium: 8. String to Integer (atoi)
    LeetCode Medium: 6. ZigZag Conversion
    LeetCode Medium:5. Longest Palindromic Substring
    LeetCode Easy: 100. Same Tree
    LeetCode Easy: 88. Merge Sorted Array
  • 原文地址:https://www.cnblogs.com/borter/p/9387617.html
Copyright © 2020-2023  润新知