指令系统是指计算机所能执行的全部指令的集合

指令系统是指计算机所能执行的全部指令的集合,它描述了计算机内全部的控制信息和“逻辑判断”能力。不同计算机的指令系统包含的指令种类和数目也不同。一般均包含算术运算型、逻辑运算型、数据传送型、判定和控制型、移位操作型、位(位串)操作型、输入和输出型等指令。指令系统是表征一台计算机性能的重要因素,它的格式与功能不仅直接影响到机器的硬件结构,而且也直接影响到系统软件,影响到机器的适用范围。

一条指令就是机器语言的一个语句,它是一组有意义的二进制代码,指令的基本格式如:操作码字段+地址码字段,其中操作码指明了指令的操作性质及功能,地址码则给出了操作数或操作数的地址。

 

 1 package Com.TableText;
 2 
 3 import java.io.File;
 4 import java.io.FileInputStream;
 5 import java.io.FileNotFoundException;
 6 import java.io.FileOutputStream;
 7 import java.io.IOException;
 8 import java.io.InputStream;
 9 import java.io.OutputStream;
10 import java.text.DateFormat;
11 import java.util.Date;
12 
13 public class TableText_01 {
14     /** 
15      * 功能描述:列出某文件夹及其子文件夹下面的文件,并可根据扩展名过滤 
16      * @param path 
17      * 文件夹 
18      */  
19     public static void list(File path) {  
20         if (!path.exists()) {  
21             System.out.println("文件名称不存在!");  
22         } else {  
23             if (path.isFile()) {  
24                 if (path.getName().toLowerCase().endsWith(".pdf")  
25                         || path.getName().toLowerCase().endsWith(".doc")  
26                         || path.getName().toLowerCase().endsWith(".chm")  
27                         || path.getName().toLowerCase().endsWith(".html")  
28                         || path.getName().toLowerCase().endsWith(".htm")) {// 文件格式  
29                     System.out.println(path);  
30                     System.out.println(path.getName());  
31                 }  
32             } else {  
33                 File[] files = path.listFiles();  
34                 for (int i = 0; i < files.length; i++) {  
35                     list(files[i]);  
36                 }  
37             }  
38         }  
39     }  
40   
41     /** 
42      * 功能描述:拷贝一个目录或者文件到指定路径下,即把源文件拷贝到目标文件路径下 
43      *  
44      * @param source 
45      *            源文件 
46      * @param target 
47      *            目标文件路径 
48      * @return void 
49      */  
50     public static void copy(File source, File target) {  
51           
52         File tarpath = new File(target, source.getName());  
53         if (source.isDirectory()) {  
54             tarpath.mkdir();  
55             File[] dir = source.listFiles();  
56             for (int i = 0; i < dir.length; i++) {  
57                 copy(dir[i], tarpath);  
58             }  
59         } else {  
60             try {  
61                 InputStream is = new FileInputStream(source); // 用于读取文件的原始字节流  
62                 OutputStream os = new FileOutputStream(tarpath); // 用于写入文件的原始字节的流  
63                 byte[] buf = new byte[1024];// 存储读取数据的缓冲区大小  
64                 int len = 0;  
65                 while ((len = is.read(buf)) != -1) {  
66                     os.write(buf, 0, len);  
67                 }  
68                 is.close();  
69                 os.close();  
70             } catch (FileNotFoundException e) {  
71                 e.printStackTrace();  
72             } catch (IOException e) {  
73                 e.printStackTrace();  
74             }  
75         }  
76     }  
77   
78     /** 
79      * @param args 
80      */  
81     public static void main(String[] args) {  
82         // TODO Auto-generated method stub  
83         File file = new File("H://JavaFiles/ch.doc");
84         File file2 = new File("H://");
85         list(file);  
86         copy(file,file2);
87         Date myDate = new Date();   
88         DateFormat df = DateFormat.getDateInstance();  
89         System.out.println(df.format(myDate));   
90     }  
91   
92 }
原文地址:https://www.cnblogs.com/borter/p/9387059.html