by Jim Krumm
Click here to go to the Computer Science Department Home Page for Casper College at www.caspercomsci.com.
We program in 32 bit assembly using Microsoft's MASM615 in our Computer Organization Course, COSC2150 and TextPad to edit, assemble, and run the source code. The following program is about as simple as it gets to write a program in assembly, making use of the Irvine library to display the traditional "hello" program using the Irvine functions WriteString and Crlf.
|
The following program shows how to add the two numbers, 5 and 17, using reverse polish notation and the stack.
|
The following program asks the user how many numbers they wish to enter, and determines the average of these values using arrays. It shows how to navigate up and down the values stored in the array, how to loop, and how to divide, add, and subtract.
|
The following program shows how to do a few simple comparisons of signed values with assembly. This program uses jle (jump if less than or equal to), jge (jump if greater than or equal to), jl (jump if less than), and jne (jump if not equal to).
|
©All rights reserved by James Krumm. Originally made available at www.caspercomsci.com. Materials here can be used, and redistributed, provided proper reference is made to the origin and author(s) of these materials. Please send any corrections or suggestions to jkrumm@caspercollege.edu. Last modified July 8, 2009.
To find out more about the Casper College Computer Science Program contact us at:
James Krumm |