Tuesday, May 6, 2008

206 lab cancelled!

This afternoon's experiment has to be cancelled: it just hasn't gelled in time. Click here for the version without the code.

Tuesday, April 22, 2008

Final assignment

Our last programming assignment is based on the string-processing program given by Dandamudi in Chapter 10. Click here for another copy of the asssignment.

The class will not meet on Tuesday, April 29. Students are encouraged to attend the Alive Day showing in AA 158 (across from the computer lab) at 5:30 p.m. on that day. Marine Michael Jernigan, one of the wounded Iraq veterans featured in the HBO program, is a student on this campus, and he will be speaking at this event.

We will meet in the computer lab AA 156 at the scheduled time for our final exam, which is Tuesday, May 6, at 4:30 p.m. We will run some experiments to compare computer performance for high-level language versus assembly language. Be there!

Tuesday, April 15, 2008

arguments on the command line

Examples in Java, C shell, in C, and in C as shown in class.

Here is the site to which Mr. Kangas referred us.

Friday, April 11, 2008

Programming assignment

Three programs:

dotprod.asm, the dot product of two vectors in 3-space, so that
<a, b, c> • <x, y, z> = ax + by + cz

matmult2.asm, the product of two 2 x 2 matrices

matmult3.asm, the product of two 3 x 3 matrices

All inputs will be integers in the range [-9, 9].

Any intelligible interface routine is acceptable.

Tuesday, April 1, 2008

Instruction set reference

My concise spiral manual is from 1987. This Intel Pentium manual is from 1997 (tempus fugit!) — section 3.2 is the part that interests me. Although it gives microcode, it does not give clock cycles. And here's the overwhelming 2008 version. Still no clocks.

Who uses BCD nowadays?

I was wondering. A search on the IEEE web page yielded these abstracts one, two which indicate that BCD is still useful in commercial apps.

Most computer architecture / organization books give nuts-and-bolts information on how arithmetic is carried out, including BCD arithmetic when it's in special circuitry — complex, admirable.

Tuesday, February 26, 2008

Quiz 1 - 4 plus Appendices A and B

We will have a double-weight one-hour quiz at the beginning of our meeting on Tuesday, March 4. Topics:

  • integer representation and other Appendix A topics that we covered
  • assembly "by hand," i.e., what would the result in a machine-language listing be? and what does machine language in a given listing mean?
  • all topics discussed in architecture, memory organization, registers, etc.
  • basic assembly language statements for arithmetic and logic
You should understand all of the program examples in Appendix B and Chapters 1 to 4. In the exercises, you should be able to answer all of the following readily:

  • A-1 to A-8, A-11, A-12, A-13
  • 1-1, 1-3, 1-4
  • 2-1, 2-2, 2-4, 2-7, 2-8, 2-9
  • 3-3, 3-4, 3-78, 3-12, 3-15, 3-16
  • 4 all
There are a few topics we haven't discussed even a little, such as floating-point representation and some Pentium internals. Don't worry about those.

You may have all the hand-written notes you like, provided that you produced them yourself. Keep in mind that a passing grade is 65, and that passing averages on both programs and quizzes are required to pass the course.

Tuesday, February 19, 2008

skeleton program

I have found it convenient to have known-good code on file. Here's a very simple program that can serve as a starting place for your work (click for text version):


; skeleton assembly-language program SKEL.ASM
; for use with NASM and Dandamudi macros
;
; References:
; NASM at http://nasm.sourcegorge.net
; macros at http://www.scs.carleton.ca/~sivarama
; (see ASM book on this site)
;
; to assemble on Linux:
;
; nasm -f elf skel.asm
; ld -s -o skel skel.o io.o
;
; (files io.mac and io.o are assumed available)
;
; to run:
;
; ./skel
;
; input: any
; output: messages on screen
;
%include "io.mac"

.DATA
; -------------
; initialized data
;
; ascii 10 and 9 produce whitespace
; with CR and HT
;
strBegin db 10, 9, 'Skeleton program ---', 10, 0
strPrompt db 10, 9, 'Press a key: ', 0
strEnd db 10, 9, 'Program ending.', 10, 10, 0

.UDATA
; -------------
; uninitialized data
;
byteResponse resb 1

.CODE
.STARTUP

PutStr strBegin ; welcome message
PutStr strPrompt ; ask user for response

GetCh [byteResponse] ; get response
; but don't do anything with it

PutStr strEnd ; end program
.EXIT

Sample .bashrc

Check this sample .bashrc file for how many things are done. It will be executed (interpreted, actually, because it's a script) every time you log on if you put it in your home directory.

many, many instructions

For more information about NASM instructions:
  • Appendix E of the textbook names and describes "selected instructions," including the flags affected
  • Appendix B of current (v2) NASM instructions only lists the instructions that it assembles for each IA-32-type CPU,
    but without descriptions
  • old NASM docs have an Appendix B that includes descriptions of the actions of the instructions;
    no flags information there, though
  • Intel docs have more details than you can imagine about every instruction — there are hundreds more than we will ever use...

Tuesday, January 29, 2008

in-lab objectives for the day, and homework

Things we need to do today:

  • check out SSH to get to wocsc
  • run a simple program with simple changes from weblog
  • copy author's I/O routines from his site to wocsc accounts, via Windows desktop
  • run author's sample program from Appendix B

All of this will require careful consideration of our desired directory structure.

Homework: send a new .asm program based on Dandamudi's sample.asm by e-mail to vfitton on wocsc.

submitting homework

Please send listings to my wocsc address, which is vfitton at wocsc.nvcc.edu. Expect new instructions as I figure out which servers are complaining about what.

some hello to cut and paste

Click for Windows hello and for Linux hello.

decent ASCII chart

from Unicode.org — click here

Tuesday, January 22, 2008

206 week two

Discussion topics for the day:
  • binary numeration
  • overview of assembly langauge
  • assembly instruction types
  • practice on Windows version of Hello

Here's the handout I couldn't print for class.
Assignment:
  • Reading:
    • Appendix A on number representation, pp 529 to 551
    • Character representation, pp 561 to 563
    • Chapter 1, pp 3 to 14
    • Chapter 2, pp 19 to 21, then lightly through the rest
    • Chapter 3, pp 47 to 53
  • Problems: A-1 to A-14, pp 564 to 565
  • Practical: run Hello, world both on a Windows machine and on the Linux server. Send the instructor a listing file (either platform) by e-mail when you have finished.

Friday, January 18, 2008

hello on Linux or Windows?

The hello program below won't work on Windows, not as currently written, though it's fine on Linux as demonstrated in class. A Windows version will be provided over the weekend, and in class on Tuesday, we'll talk about both. And, I hope, practice both.

Thursday, January 17, 2008

206 assignment, week one

Assignment: Get nasm running wherever you plan to do your homework. At home, you can use Windows for development, then transfer everything to Linux. Or you can use SecureShell client and do all your work directly on Linux. (Here are downloads.) If you want to use an X client, possibly on Cygwin, with our Linux server, go for it.

Check out the following resources, at a minimum:

NASM home click
http://nasm.sourceforge.net/

samples at UMBC click
http://www.csee.umbc.edu/help/nasm/sample.shtml

samples at Loyola Marymount click
http://www.cs.lmu.edu/~ray/notes/nasmexamples/

Appendix B of the textbook (Dandamudi)

We will be doing most of Chapters 1 to 10 and selections from other chapters.

Here is the hello.asm discussed in class.

206 first day documents

Here find: