EE 306 - LC3 Simulator Lab Manuel

EE 306 - LC3 Simulator Lab Manuel - Guide to Using the...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Guide to Using the Windows version of the LC-3 Simulator and LC3Edit by Kathy Buchheit The University of Texas at Austin 2001, 2003
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1 Guide to Using the Windows version of the LC-3 Simulator and LC3Edit The LC-3 is a piece of hardware, so you might be wondering why we need a simulator. The reason is that the LC-3 doesn’t actually exist (though it might one day). Right now it’s just a plan – an ISA and a microarchitecture which would implement that ISA. The simulator lets us watch what would happen in the registers and memory of a “real” LC-3 during the execution of a program. How this guide is arranged For those of you who like to dive in and try things out right away, the first section walks you through entering your first program, in machine language, into the text editor (known as LC3Edit). You’ll also find information about writing assembly language programs, but you’ll probably skip that part until you’ve learned the LC-3 assembly language later in the semester. The second section gives you a quick introduction to the simulator’s interface, and the third shows you how to use the simulator to watch the effects of the program you just wrote. The fourth section takes you through a couple of examples of debugging in the simulator. The last two sections are meant as reference material, for LC3Edit, and for the simulator itself. In other words, page Chapter 1 Creating a program for the simulator 2 Chapter 2 The simulator: what you see on the screen 7 Chapter 3 Running a program in the simulator 10 Chapter 4 Debugging programs in the simulator 15 Chapter 5 LC3Edit reference 24 Chapter 6 LC-3 Simulator reference, Windows version 28 Chapter 7 LC-3 Assembler Quick Reference 37
Background image of page 2
2 Chapter 1 Creating a program for the simulator This example is also in the textbook, Introduction to Computing Systems: From Bits and Gates to C and Beyond! You’ll find it in Chapter 6, beginning on page 166. The main difference here is that we’re going to examine the program with the error of line x3003 corrected. We’ll get to a debugging example once we’ve seen the “right way” to do things. The Problem Statement Our goal is to take the ten numbers which are stored in memory locations x3100 through x3109, and add them together, leaving the result in register 1. Using LC3Edit If you’re using Windows, there’s another program in the same folder as the simulator, called LC3Edit.exe. Start that program by double-clicking on its icon, and you’ll see a simple text editor with a few special additions. Entering your program in machine language You have the option to type your program into LC3Edit in one of three ways: binary, hex, or the LC-3 assembly language. Here’s what our little program looks like in binary: 0011000000000000 0101001001100000 0101100100100000 0001100100101010 1110010011111100 0110011010000000 0001010010100001 0001001001000011 0001100100111111 0000001111111011 1111000000100101 When you type this into LC3Edit, you’ll probably be looking at a chart which tells you
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 38

EE 306 - LC3 Simulator Lab Manuel - Guide to Using the...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online