Slide 6.9: Direct-offset operands Slide 7.2: INC and DEC instructions Home |
http://people.cs.und.edu/~userid/250/
.
lab3.asm
.
+
: string concatenation.
For example, "abc" + "xyz" = "abcxyz" .
/
: string removal.
It removes the first occurrence of the pattern from the string.
For example, "abcxyz" / "cx" = "abyz" and "xabyabz" / "ab" = "xyabz" .
Examples of Laboratory 3 Execution | |
---|---|
|
No. | Operators/ Directives/ Commands |
Description | Textbook Page Numbers |
---|---|---|---|
1 | add |
Addition | 87 – 88 |
2 | BYTE |
Directive of defining byte | 66 – 67 |
3 | call |
Calls a procedure by directing the processor to begin execution at a new memory location. | 136 |
4 | call Crlf |
Writes an end of line sequence to standard output. | 115 |
5 | call ReadString |
Reads a string from the keyboard, stopping when the user presses the Enter key. |
122 |
6 | call StrLength |
Returns the length of a string in EAX .
Pass the string's offset in EDX . |
123 |
7 | call WriteChar |
Writes a single character to standard output. Place the character in AL before calling the procedure. |
123 |
8 | call WriteString |
Writes a null-terminated string to standard output. When calling it, place the string's offset in EDX register. |
124 |
9 | cmp |
Performs an implied subtraction of a source operand from a destination operand. | 156 |
10 | .code |
Marks the beginning of the code segment. | 55 |
11 | .data |
Marks the beginning of the data segment. | 55 |
12 | dec |
Decrement | 87 |
13 | DUP |
Generates a repeated storage allocation, using a constant expression as a counter. | 67 |
14 | DWORD |
Directive of defining doubleword | 68 |
15 | END |
Marks the last line of the program to be assembled. | 59 |
16 | ENDP |
Marks the end of a procedure. | 59 |
17 | exit |
Calls a predefined MS-Windows function that halts the program. | 59 |
18 | .IF |
IF statement |
184 – 186 |
19 | inc |
Increment | 87 |
20 | 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 |
21 | je |
Jumps if equal | 158 – 162 |
22 | jmp |
Causes an unconditional transfer to a target location inside the code segment. | 104 |
23 | jne |
Jump if not equal | 158 – 162 |
24 | loop |
Loop. ECX is automatically used as a counter and is decremented each time the loop repeats. |
105 – 106 |
25 | mov |
Move | 81 – 82 |
26 | OFFSET |
Returns the offset of a data label. | 94 |
27 | PROC |
Identifies the beginning of a procedure. | 59 |
28 | PROC ... USES |
Lists the names of all registers modified within a procedure. | 140 – 142 |
29 | PTR |
Overrides the declared size of an operand. | 95 – 96 |
30 | ret |
Pops the return address from the stack into the instruction pointer. | 135 – 136 |
31 | SIZEOF |
Size of a data item | 97 |
32 | sub |
Subtraction | 88 |
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.