Slide 3.11: Boolean operations Slide 4.2: Assembling, linking, and running a program Home |
http://people.cs.und.edu/~userid/250/
.
gandalf> chmod 700 lab1.asm*where
lab1.asm
is the program name.
lab1.asm
.
Examples of Laboratory 1 Execution | |
---|---|
|
No. |
Operators/ Directives/ Commands |
Description |
Textbook Page Numbers |
---|---|---|---|
1 | BYTE |
Directive of defining byte | 66 – 67 |
2 | call Crlf |
Writes an end of line sequence to standard output. | 115 |
3 | call ReadChar |
Reads a single character from the keyboard and returns the character in the AL register. |
120 |
4 | call WriteChar |
Writes a single character to standard output. Place the character in AL before calling the procedure. |
123 |
5 | call WriteString |
Writes a null-terminated string to standard output. When calling it, place the string's offset in EDX register. |
124 |
6 | cmp |
Performs an implied subtraction of a source operand from a destination operand. | 156 |
7 | .code |
Marks the beginning of the code segment. | 55 |
8 | .data |
Marks the beginning of the data segment. | 55 |
9 | END |
Marks the last line of the program to be assembled. | 59 |
10 | ENDP |
Marks the end of a procedure. | 59 |
11 | exit |
Calls a predefined MS-Windows function that halts the program. | 59 |
12 | INCLUDE Irvine32.inc |
Copies necessary definitions and sets up information from a text file name Irvine32.inc , located in the assembler's INCLUDE directory. |
59 |
13 | je |
Jump if equal | 158 – 162 |
14 | jmp |
Causes an unconditional transfer to a target location inside the code segment. | 104 |
15 | jne |
Jump if not equal | 158 – 162 |
16 | mov |
Move | 81 – 82 |
17 | OFFSET |
Returns the offset of a data label. | 94 |
18 | PROC |
Identifies the beginning of a procedure. | 59 |
Start
menu of Windows:
Start ⇒ All Programs ⇒ Visual C++ 2008 Express Edition
⇒ Microsoft Visual C++ 2008 Express Edition
|
c:\Irvine\Examples\ch03\Project_Sample
to another folder such as c:\250\lab\1
.
File ⇒ Open ⇒ Project/Solution...
c:\250\lab\1\Project
.
Project
to expand it.
Double-click the file named main.asm
to open it in the Editor window.
Use this program, a template, as a starting point to write your own programs.
Build Solution
from the Build
menu of Visual C++ 2008 Express.
In the Output window at the bottom of the Visual C++ Express, you should see the messages indicating the build progress such as:
1>------ Rebuild All started: Project: Project, Configuration: Debug Win32 ------ 1>Deleting intermediate and output files for project 'Project', configuration 'Debug|Win32' 1>Assembling... 1> Assembling: .\main.asm 1>Linking... 1>Embedding manifest... 1>Build log was saved at "file://c:\250\lab\1\Debug\BuildLog.htm" 1>Project - 0 error(s), 0 warning(s) ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
Start Without Debugging
from the Debug
menu.
The console window should appear such as:
http://people.cs.und.edu/~userid/250/
or a CD is not submitted.
For security, perform the following operation:
gandalf> chmod 700 lab?.asm*to block all read/write accesses from others to the files
lab?.asm*
.
Firefox will be used to download code.
Be sure your system is working on Firefox 3.0 or above.