computer organization & assembly language...
TRANSCRIPT
1
CSE 2312
Assembler Installation and Usage
Computer Organization &
Assembly Language Programming
2
Introduction to Assembler
• From source code to executable
. We will use the Tanenbaum Assembler from the textbook
3
Essential tools
4
File formats
5
The tracer (t88)
6
The tracer (t88)
7
Tracer (t88) Commands
8
For more guideline
● All the previous information can be found in the textbook
● Refer to Appendix “C.5 Assembler” for more information
9
Install your telnet Client and Log in
▪ Download and install putty from
http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.ht
ml
▪ Use the following information to login to the server:
address: 141.217.24.182
port: 8001
username: <your-NetID>
password: <your-NetID>
▪ After you log in, immediately use “passwd” command to
change your password.
10
Assemble and Run
▪ There are several sample assembly files in the example
directory
$ cd 8088
$ cd examples
$ ls
▪ Assemble helloworld (the .s suffix should be omitted):
$ as88 HlloWrld
This will generate a few new files, in which HlloWrld.88 is the
executable
▪ Run the assembled code with s88 (also omitting its suffix)
$ s88 HlloWrld
11
Step-by-step Run
$ t88 HlloWrld
The CPU registers and the source code will be shown in a
window. An arrow will point to the next instruction to be
executed.
Hit “Enter” key to execute the pointed instruction. You can
continue the steps until the execution is complete. To terminate
the execution at any time, type “q” and hit “Enter”.
12
Edit
To edit a source code:
$ nano HlloWrld.s
Use “Ctrl + X” to exit editing. Other commands are listed at the
bottom of the screen. Note that “^X” means “Ctrl + X”.
You may also install WinSCP
(https://winscp.net/eng/download.php) and login to the server,
so you can edit programs locally and then upload/download
to/from the server.
13
Organize your Directories
To make your code and files well organized, please create a few directories
at your home directory:
$ cd
$ mkdir Practice
$ mkdir Lab1
$ mkdir Lab2
$ ls
8088 Lab1 Lab2 Practice
Now you have separate directories for different lab projects and one for you
to practice your coding and debugging skills
$ cp 8088/examples/HlloWrld.s Practice/
$ cd Practice
$ as88 HlloWrld
$ s88 HlloWrld