tailieunhanh - Java™ How to Program ( Deitel - Deitel) - Phần 14

Tham khảo sách 'java™ how to program ( deitel - deitel) - phần 14', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | PREV NEXT Page 350 continued Special Section Building Your Own Computer In the next several problems we take a temporary diversion from the world of high-level language programming. To peel open a computer and look at its internal structure. We introduce machinelanguage programming and write several machine-language programs. To make this an especially valuable experience we then build a computer through the technique of software-based simulation on which you can execute your machine-language programs. Page 351 Machine-Language Programming Let us create a computer called the Simpletron. As its name implies it is a simple but powerful machine. The Simpletron runs programs written in the only language it directly understands Simpletron Machine Language or SML for short. The Simpletron contains an accumulatora special register in which information is put before the Simpletron uses that information in calculations or examines it in various ways. All the information in the Simpletron is handled in terms of words. A word is a signed four-digit decimal number such as 3364 -1293 0007 and -0001. The Simpletron is equipped with a 100-word memory and these words are referenced by their location numbers 00 01 . 99. Before running an SML program we must load or place the program into memory. The first instruction or statement of every SML program is always placed in location 00. The simulator will start executing at this location. Each instruction written in SML occupies one word of the Simpletron s memory and hence instructions are signed four-digit decimal numbers . We shall assume that the sign of an SML instruction is always plus but the sign of a data word may be either plus or minus. Each location in the Simpletron s memory may contain an instruction a data value used by a program or an unused and hence undefined area of memory. The first two digits of each SML instruction are the operation code specifying the operation to be performed. SML operation codes are .

TỪ KHÓA LIÊN QUAN