计算机系统结构:DLX指令集简介

上传人:夏** 文档编号:548147083 上传时间:2023-09-06 格式:DOC 页数:11 大小:61KB
返回 下载 相关 举报
计算机系统结构:DLX指令集简介_第1页
第1页 / 共11页
计算机系统结构:DLX指令集简介_第2页
第2页 / 共11页
计算机系统结构:DLX指令集简介_第3页
第3页 / 共11页
计算机系统结构:DLX指令集简介_第4页
第4页 / 共11页
计算机系统结构:DLX指令集简介_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《计算机系统结构:DLX指令集简介》由会员分享,可在线阅读,更多相关《计算机系统结构:DLX指令集简介(11页珍藏版)》请在金锄头文库上搜索。

1、A Neophytes Guide to DLXThe aim of this file is to provide an introduction to the DLX instruction set, created in Computer Architecture: A Quantitative Approach by Hennessy and Patterson. If you have some programming experience, but only in (relatively) high level languages like C/C+, understanding

2、basic DLX commands and code fragments is well within your realm, despite what you may think after trying to read Hennessy and Pattersons opaque tome. Unfortunately, shining a light through more than a few pages of that monstrosity is beyond the scope of this file, but if youve found Chapter 2 to pre

3、sent some hard slogging, then herein you have found your Mecca. Contents1. What makes up the basic DLX machine? l Registers and Data Types l Addressing Modes l DLX Instruction Format 2. DLX Commands: Explanations and Examples l A Few Words on Syntax and Notation l ALU Operations l Data Transfers l C

4、ontrol Commands: Branches and Jumps l Floating Point Operations 3. Some Sample Code l Multiply 2*4 and store result l Check array for value zero l Raise a Float to the nth power 4. Exercises and Questions for Review l Whats Wrong with this code? l Drop a line (or two) - write some code fragments l T

5、hings you should know: a partial list l Answers to code exercises What makes up the basic DLX machine? Of course, the machine based on the DLX instruction set is a total work of fiction. If one existed, however, it would be a 32 bit machine, i.e., each word would be four bytes. DLX is Big Endian, as

6、 opposed to Little Endian, which means that a DLX address first accesses the byte in the most significant position when its getting a word out of memory. Another issue, byte alignment, is beyond the scope of this web page, but is something you should probably worry about for exam purposes. Registers

7、 and Data Types The DLX machine is a general-purpose register (GPR) machine, and as such has at its core a bunch of registers. The ones you really need to worry about are the integer registers, R0, R1, . . . , R31, the GPRs, and the floating point registers, F0, F1, . . . , F31, the FPRs. Each kind

8、of register holds what youd expect from the name, with one twist: DLX handles floating point numbers of both single precision - 32 bits or four words - and double precision - up to 64 bits, i.e., two words. You know these data types as doubles and floats from C+. To accommodate double-precision floa

9、ts, you need to use two consecutive floating point registers, paired together, starting with one thats even-numbered and continuing with one thats odd-numbered. Warning: some operations, notably multiplication and division, can only be performed in the FP registers, even when the operands are intege

10、rs. Later, well see code fragments that move data from integer registers to FP registers, perform the desired operations, and move the data back. (This is a good thing to know how to do because it seems to attract professors looking for exam questions like you-know-what does flies.) To keep things c

11、onfusing (and to provide more exam fodder), besides the two FP data types, DLX has three integer data types: 8 bit (1 byte), 16 bit (2 byte, or half-word), and 32 bit (4 byte, or word), respectively. The confusing aspect arises when you load less that a word into a register, because you have to worr

12、y about the part of the register that doesnt contain the data you just loaded. For example, say youve loaded a word into a register. That word accounts for 8 bits, but the register holds 32 bits. Arithmetic comprehensible to even the dullest moron tells you that youve got another 24 bits floating ar

13、ound out there somewhere in la-la land to worry about. Fortunately, what you do with these left-over bits isnt too difficult, or surprising: you just fill them with 0s. Later, well see examples of commands that load data consisting of less than a word into memory. H&P tantalizingly tell you that DLX

14、 has a few other special registers. These arent things youll worry about too much; the one you really need to worry about is the first integer register, R0, because its value is always 0. Whats the purpose of R0? Well, DLX, as youre no doubt aware, is a RISC architecture. (If you didnt know this, yo

15、u might as well hang up your cleats right here and now.) When H&P (p.98) tell you that we can use this register to synthesize a variety of useful operations from a simple instruction set what they mean is that theyre going to use a few tricks to fake out some of the commands that DLX doesnt explicit

16、ly support. This leads us to our dear friend, R0. Most importantly, while there are a ton of different ways to access memory (thats what all those addressing modes on page 75 are), DLX only explicitly supports one, displacement. As well see below, a few of the others are effectively emulated with R0. Well also see examples of R0s usefulness when we look at jumps and branches (i.e., when implement

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 高等教育 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号