Professional Documents
Culture Documents
CMSC 216 - Slides developed by Wood, Sussman, Herman, Plane, and other UMCP CS faculty.
Announcements
Start reading Bryant and OHallaron Chapter 3 (IA-32 instruction set architecture) and 4.1 (Y86 subset)
Effect
Reg[D] Reg[D] + Reg[S] Reg[D] Reg[D] - Reg[S] Reg[D] Reg[D] & Reg[S] Reg[D] Reg[D] ^ Reg[S] Reg[D] Reg[D] * Reg[S] Reg[D] Reg[D] / Reg[S] Reg[D] Reg[D] % Reg[S]
Description
Addition Subtract Bitwise AND Bitwise XOR Multiplication* Integer division* Remainder*
Example
addl %eax,%ebx subl %eax,%ebx andl %eax,%ebx xor %eax,%ebx multl %eax,%ebx divl %eax,%ebx modl %eax,%ebx
All these instructions operate on two integers, and set the condition code flags appropriately Example: irmovl $2,%eax irmovl $8,%ebx divl %eax, %ebx # %ebx will have 4 Notice that only registers are used Instructions marked with an asterisk (*) are extensions to Y86 we've added to the ones in the book
3
Notice these instructions are destructive; they overwrite the second operand Need to make copies if you need old values
4
Condition codes
Performing integer operations causes various flags to be set, describing the attributes of the result of the operation These are used by other, subsequent instructions to perform conditional branching The three we are concerned with are: OF: overflow flag; did the operation overflow? SF: sign flag; is the result negative? ZF: zero flag; is the result zero?
Branch instructions
These are used to perform the effect of if statements, loops, and switches When encountered, if a certain condition is true, control flow will then go to the address specified, rather than advancing to the next instruction The address of the next instruction to be executed is held in the program counter; in many architectures, this is held in an accessible register (not so with Y86). Labels We use labels (name followed by colon) to represent target addresses When the assembler encounters a label (e.g., Loop:), the address of the labeled instruction is used by the assembler to replace all references to that label in the program Labels do not need to be declared before use
6
Each instruction relies on the condition codes set by the most recent integer instruction
Translating branches
Since assembly has no else statements, we need to use branching + code reorganization to get if/else Consider the following C code: if (a == b) printf(Y"); else printf(N"); printf("\n"); if (a == b) goto Equal; printf(N"); goto EndIf; Equal: printf(Y"); EndIf: printf("\n");
Branch Example
Example: If2.ys if (a >= b) print a else print b Assembler output:
0x000: 0x002: 0x004: 0x006: 0x008: 0x00d: 0x00f: 0x014: 0x016: 0x01c: 0x01e: f208 f238 2001 6131 7514000000 f338 7016000000 f308 30820a000000 f128 10 | rdint %eax | rdint %ebx | rrmovl %eax, %ecx | subl %ebx, %ecx | jge Equal | wrint %ebx | jmp EndIf | Equal: wrint %eax | EndIf: irmovl $10, %edx | wrch %edx | halt # # # # reading a reading b making copy of %eax no longer overwriting %eax
Simulator output:
4 3 4 Stopped in 9 steps at PC = 0x1f. Exception 'HLT', CC Z=0 S=0 O=0
10
Translating C to Y86
This process is not always straightforward Even simple statements like c = a * b;" can require several instructions:
mrmovl A, %eax mrmovl B, %ebx multl %eax, %ebx rmmovl %ebx, C
11
Register spilling
We only have a limited number of registers What happens if we need to keep more than 8 values around at once? If we run out of registers to store our data, we need to use memory to store values We can use the stack or define static arrays (as we'll see later)
12
Translating loops
What about C code like this? do { ... } while (condition); This can be translated simply: Loop: # begin loop body # evaluate condition jumpCondition Loop # jump back if true Note that you can use whatever jumpCondition (e.g., jle, je, etc.) instruction/condition is appropriate Example: doWhile.ys
13
do While Example
Example: doWhile.ys Assembler output:
0x000: f208 | 0x002: 308301000000 | 0x008: 308101000000 | | 0x00e: f338 | Loop: 0x010: 308220000000 | 0x016: f128 | | 0x018: 6013 | 0x01a: 2032 | 0x01c: 6102 | 0x01e: 710e000000 | | 0x023: 30820a000000 | EndLoop: 0x029: f128 | 0x02b: 10 | rdint %eax irmovl $1, %ebx irmovl $1, %ecx
wrint %ebx irmovl $32, %edx wrch %edx addl %ecx, %ebx rrmovl %ebx, %edx subl %eax, %edx jle Loop irmovl $10, %edx wrch %edx halt
Simulator output:
Exception 'HLT', CC Z=0 S=0 O=0
14
eval cond jump EndLoop if !cond Loop: task() eval cond jump to Loop if cond EndLoop:
while Example
Example: while.ys Assembler output:
0x000: f208 | 0x002: 308301000000 | 0x008: 308101000000 | | 0x00e: 2032 | 0x010: 6102 | 0x012: 762c000000 | | 0x017: f338 | Loop: 0x019: 308620000000 | 0x01f: f168 | | 0x021: 6013 | 0x023: 2032 | 0x025: 6102 | 0x027: 7117000000 | | 0x02c: 30810a000000 | EndLoop: 0x032: f118 | 0x034: 10 |
Simulator output: 3 1 2 3 Stopped in 30 steps at PC = 0x35.
rdint %eax irmovl $1, %ebx irmovl $1, %ecx rrmovl %ebx, %edx subl %eax, %edx jg EndLoop
# incrementing by 1
# newline character
16
17
Examples
Example: sum.ys Example: arraySum.ys
18
Factorial example
Consider the following program:
#include <stdio.h> int main() { int i, f, n; scanf("%d", &n); f = 1; i = 1; while (i <= n) f *= i++; printf("%d\n", f); return 0; }
20
24
Beginning "compilation"
We'll map registers to variables: %eax for i, %ebx for f, and %ecx for n Remember why we can do this here? Now, let's translate all the non-branches into the assembly code we know.
25
Starting compilation
#include <stdio.h> int main() { int i, f, n; scanf("%d", &n); f = 1; i = 1; if (i > n) goto EndWhile; Loop: f = f * i; i = i + 1; if (i <= n) goto Loop; EndWhile: printf("%d\n", f); return 0; } rdint %ecx irmovl $1,%ebx irmovl $1,%eax if (%eax > %ecx) goto EndWhile; Loop: multl %eax,%ebx irmovl $1,%edi addl %edi,%eax if (%eax <= %ecx) goto Loop;
26
Writing branches
To change the conditional jumps, we'll have to remember a few things: we'll need to operate on copies of our data; this means we'll need to use an extra register we'll need to perform an arithmetic operation before the jump we need to select the correct jump instruction to operate correctly
27
Starting compilation
rdint %ecx irmovl $1,%ebx irmovl $1,%eax if (%eax > %ecx) goto EndWhile; Loop: multl %eax,%ebx irmovl $1,%edi addl %edi,%eax if (%eax <= %ecx) goto Loop; rdint irmovl irmovl rrmovl subl jg %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi EndWhile
Loop:
multl %eax,%ebx irmovl $1,%edi addl %edi,%eax if (%eax <= %ecx) goto Loop;
28
Starting compilation
rdint %ecx irmovl $1,%ebx irmovl $1,%eax if (%eax > %ecx) goto EndWhile; Loop: multl %eax,%ebx irmovl $1,%edi addl %edi,%eax if (%eax <= %ecx) goto Loop; rdint irmovl irmovl rrmovl subl jg %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi EndWhile
Loop:
30
Assembly
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: | | | | | | | 0x017: 6403 | Loop: 0x019: 308701000000 | 0x01f: 6070 | 0x021: 2007 | 0x023: 6117 | 0x025: 7117000000 | | 0x02a: f338 | EndWhile: 0x02c: 30870a000000 | 0x032: f178 | 0x034: 10 | f218 308301000000 308001000000 2007 6117 762a000000 rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi EndWhile %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi Loop
31
32
Assembly
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: | | | | | | | 0x017: 6403 | Loop: 0x019: 308701000000 | 0x01f: 6070 | 0x021: 2007 | 0x023: 6117 | 0x025: 7117000000 | | 0x02a: f338 | EndWhile: 0x02c: 30870a000000 | 0x032: f178 | 0x034: 10 | f218 308301000000 308001000000 2007 6117 762a000000 rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi EndWhile %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi Loop
33
Assembly
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | Loop: | | | | | | | EndWhile: | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi EndWhile %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi Loop
34
Label Translation
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | Loop: | | | | | | | EndWhile: | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17
35
36
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
0
0 0 0 0 0 0 0 PC 0x000 CC: ZF 0 CC: SF 0 CC: OF 0
37
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
0
0 0 0 0 0 0 0 PC 0x002 CC: ZF 0 CC: SF 0 CC: OF 0
38
Input is: 4
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
0
4 0 0 0 0 0 0 PC 0x002 CC: ZF 0 CC: SF 0 CC: OF 0
39
Input is: 4
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
0
4 0 0 0 0 0 0 PC 0x008 CC: ZF 0 CC: SF 0 CC: OF 0
40
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
0
4 0 1 0 0 0 0 PC 0x008 CC: ZF 0 CC: SF 0 CC: OF 0
41
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
0
4 0 1 0 0 0 0 PC 0x00e CC: ZF 0 CC: SF 0 CC: OF 0
42
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
1
4 0 1 0 0 0 0 PC 0x00e CC: ZF 0 CC: SF 0 CC: OF 0
43
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
1
4 0 1 0 0 0 0 PC 0x010 CC: ZF 0 CC: SF 0 CC: OF 0
44
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
1
4 0 1 0 0 0 1 PC 0x010 CC: ZF 0 CC: SF 0 CC: OF 0
45
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
1
4 0 1 0 0 0 1 PC 0x012 CC: ZF 0 CC: SF 0 CC: OF 0
46
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
1
4 0 1 0 0 0 -3 PC 0x012 CC: ZF 0 CC: SF 1 CC: OF 0
47
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
1
4 0 1 0 0 0 -3 PC 0x017 CC: ZF 0 CC: SF 1 CC: OF 0
48
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
1
4 0 1 0 0 0 -3 PC 0x017 CC: ZF 0 CC: SF 1 CC: OF 0
49
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
1
4 0 1 0 0 0 -3 PC 0x019 CC: ZF 0 CC: SF 1 CC: OF 0
50
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
1
4 0 1 0 0 0 -3 PC 0x019 CC: ZF 0 CC: SF 0 CC: OF 0
51
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
1
4 0 1 0 0 0 -3 PC 0x01f CC: ZF 0 CC: SF 0 CC: OF 0
52
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
1
4 0 1 0 0 0 1 PC 0x01f CC: ZF 0 CC: SF 0 CC: OF 0
53
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
1
4 0 1 0 0 0 1 PC 0x021 CC: ZF 0 CC: SF 0 CC: OF 0
54
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
2
4 0 1 0 0 0 1 PC 0x021 CC: ZF 0 CC: SF 0 CC: OF 0
55
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
2
4 0 1 0 0 0 1 PC 0x023 CC: ZF 0 CC: SF 0 CC: OF 0
56
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
2
4 0 1 0 0 0 2 PC 0x023 CC: ZF 0 CC: SF 0 CC: OF 0
57
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
2
4 0 1 0 0 0 2 PC 0x025 CC: ZF 0 CC: SF 0 CC: OF 0
58
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
2
4 0 1 0 0 0 -2 PC 0x025 CC: ZF 0 CC: SF 1 CC: OF 0
59
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
2
4 0 1 0 0 0 -2 PC 0x02a CC: ZF 0 CC: SF 1 CC: OF 0
60
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
2
4 0 1 0 0 0 -2 PC 0x017 CC: ZF 0 CC: SF 1 CC: OF 0
61
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
2
4 0 1 0 0 0 -2 PC 0x019 CC: ZF 0 CC: SF 1 CC: OF 0
62
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
2
4 0 2 0 0 0 -2 PC 0x019 CC: ZF 0 CC: SF 0 CC: OF 0
63
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
2
4 0 2 0 0 0 -2 PC 0x01f CC: ZF 0 CC: SF 0 CC: OF 0
64
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
2
4 0 2 0 0 0 1 PC 0x01f CC: ZF 0 CC: SF 0 CC: OF 0
65
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
2
4 0 2 0 0 0 1 PC 0x021 CC: ZF 0 CC: SF 0 CC: OF 0
66
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
3
4 0 2 0 0 0 1 PC 0x021 CC: ZF 0 CC: SF 0 CC: OF 0
67
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
3
4 0 2 0 0 0 1 PC 0x023 CC: ZF 0 CC: SF 0 CC: OF 0
68
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
3
4 0 2 0 0 0 3 PC 0x023 CC: ZF 0 CC: SF 0 CC: OF 0
69
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
3
4 0 2 0 0 0 3 PC 0x025 CC: ZF 0 CC: SF 0 CC: OF 0
70
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
3
4 0 2 0 0 0 -1 PC 0x025 CC: ZF 0 CC: SF 1 CC: OF 0
71
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
3
4 0 2 0 0 0 -1 PC 0x02a CC: ZF 0 CC: SF 1 CC: OF 0
72
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
3
4 0 2 0 0 0 -1 PC 0x017 CC: ZF 0 CC: SF 1 CC: OF 0
73
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
3
4 0 2 0 0 0 -1 PC 0x019 CC: ZF 0 CC: SF 1 CC: OF 0
74
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
3
4 0 6 0 0 0 -1 PC 0x019 CC: ZF 0 CC: SF 0 CC: OF 0
75
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
3
4 0 6 0 0 0 -1 PC 0x01f CC: ZF 0 CC: SF 0 CC: OF 0
76
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
3
4 0 6 0 0 0 1 PC 0x01f CC: ZF 0 CC: SF 0 CC: OF 0
77
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
3
4 0 6 0 0 0 1 PC 0x021 CC: ZF 0 CC: SF 0 CC: OF 0
78
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
4
4 0 6 0 0 0 1 PC 0x021 CC: ZF 0 CC: SF 0 CC: OF 0
79
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
4
4 0 6 0 0 0 1 PC 0x023 CC: ZF 0 CC: SF 0 CC: OF 0
80
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
4
4 0 6 0 0 0 4 PC 0x023 CC: ZF 0 CC: SF 0 CC: OF 0
81
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
4
4 0 6 0 0 0 4 PC 0x025 CC: ZF 0 CC: SF 0 CC: OF 0
82
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
4
4 0 6 0 0 0 0 PC 0x025 CC: ZF 1 CC: SF 0 CC: OF 0
83
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
4
4 0 6 0 0 0 0 PC 0x02a CC: ZF 1 CC: SF 0 CC: OF 0
84
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
4
4 0 6 0 0 0 0 PC 0x017 CC: ZF 1 CC: SF 0 CC: OF 0
85
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
4
4 0 6 0 0 0 0 PC 0x019 CC: ZF 0 CC: SF 1 CC: OF 0
86
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
4
4 0 24 0 0 0 0 PC 0x019 CC: ZF 0 CC: SF 0 CC: OF 0
87
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
4
4 0 24 0 0 0 0 PC 0x01f CC: ZF 0 CC: SF 0 CC: OF 0
88
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
4
4 0 24 0 0 0 1 PC 0x01f CC: ZF 0 CC: SF 0 CC: OF 0
89
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
4
4 0 24 0 0 0 1 PC 0x021 CC: ZF 0 CC: SF 0 CC: OF 0
90
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
5
4 0 24 0 0 0 1 PC 0x021 CC: ZF 0 CC: SF 0 CC: OF 0
91
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
5
4 0 24 0 0 0 1 PC 0x023 CC: ZF 0 CC: SF 0 CC: OF 0
92
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
5
4 0 24 0 0 0 5 PC 0x023 CC: ZF 0 CC: SF 0 CC: OF 0
93
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
5
4 0 24 0 0 0 5 PC 0x025 CC: ZF 0 CC: SF 0 CC: OF 0
94
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
5
4 0 24 0 0 0 1 PC 0x025 CC: ZF 0 CC: SF 0 CC: OF 0
95
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
5
4 0 24 0 0 0 1 PC 0x02a CC: ZF 0 CC: SF 0 CC: OF 0
96
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
5
4 0 24 0 0 0 1 PC 0x02a CC: ZF 0 CC: SF 0 CC: OF 0
97
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
5
4 0 24 0 0 0 1 PC 0x02c CC: ZF 0 CC: SF 0 CC: OF 0
98
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx Register $1,%ebx name Value $1,%eax %eax 5 %eax,%edi %ecx 4 %ecx,%edi %edx 0 0x2a %ebx 24 %eax,%ebx $1,%edi %esp 0 %edi,%eax %ebp 0 %eax,%edi %esi 0 %ecx,%edi %edi 1 0x17 %ebx PC 0x02c $10,%edi Output is: 24 CC: ZF 0 %edi
CC: SF 0 CC: OF 0
99
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx Register $1,%ebx name Value $1,%eax %eax 5 %eax,%edi %ecx 4 %ecx,%edi %edx 0 0x2a %ebx 24 %eax,%ebx $1,%edi %esp 0 %edi,%eax %ebp 0 %eax,%edi %esi 0 %ecx,%edi %edi 1 0x17 %ebx PC 0x032 $10,%edi Output is: 24 CC: ZF 0 %edi
CC: SF 0 CC: OF 0
100
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx Register $1,%ebx name Value $1,%eax %eax 5 %eax,%edi %ecx 4 %ecx,%edi %edx 0 0x2a %ebx 24 %eax,%ebx $1,%edi %esp 0 %edi,%eax %ebp 0 %eax,%edi %esi 0 %ecx,%edi %edi 10 0x17 %ebx PC 0x032 $10,%edi Output is: 24 CC: ZF 0 %edi
CC: SF 0 CC: OF 0
101
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx Register $1,%ebx name Value $1,%eax %eax 5 %eax,%edi %ecx 4 %ecx,%edi %edx 0 0x2a %ebx 24 %eax,%ebx $1,%edi %esp 0 %edi,%eax %ebp 0 %eax,%edi %esi 0 %ecx,%edi %edi 10 0x17 %ebx PC 0x034 $10,%edi Output is: 24 CC: ZF 0 %edi
CC: SF 0 CC: OF 0
102
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx Register $1,%ebx name Value $1,%eax %eax 5 %eax,%edi %ecx 4 %ecx,%edi %edx 0 0x2a %ebx 24 %eax,%ebx $1,%edi %esp 0 %edi,%eax %ebp 0 %eax,%edi %esi 0 %ecx,%edi %edi 10 0x17 %ebx PC 0x034 $10,%edi Output is: 24 CC: ZF 0 %edi
CC: SF 0 CC: OF 0
103
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
5
4 0 24 0 0 0 10 PC 0x035 CC: ZF 0 CC: SF 0 CC: OF 0
104
Execution
0x000: 0x002: 0x008: 0x00e: 0x010: 0x012: 0x017: 0x019: 0x01f: 0x021: 0x023: 0x025: 0x02a: 0x02c: 0x032: 0x034: | | | | | | | | | | | | | | | | rdint irmovl irmovl rrmovl subl jg multl irmovl addl rrmovl subl jle wrint irmovl wrch halt %ecx $1,%ebx $1,%eax %eax,%edi %ecx,%edi 0x2a %eax,%ebx $1,%edi %edi,%eax %eax,%edi %ecx,%edi 0x17 %ebx $10,%edi %edi
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
5
4 0 24 0 0 0 10 PC 0x035 CC: ZF 0
Done!
CC: SF 0 CC: OF 0
105
Execution
These are the final states of the PC, CC, and all the registers. Does this agree with what yis tells us? Remember, numbers are printed in hex, so 1010 = a16, 2410 = 1816
Register name Value
%eax
%ecx %edx %ebx %esp %ebp %esi %edi
5
4 0 24 0 0 0 10 PC 0x035 CC: ZF 0 CC: SF 0 CC: OF 0
106
Execution
Yes:
$ echo 4 | yis factorial.yo 24 Stopped in 34 steps at PC = 0x35. Exception 'HLT', CC Z=0 S=0 O=0 Changes to registers: %eax: 0x00000000 0x00000005 %ecx: 0x00000000 0x00000004 %ebx: 0x00000000 0x00000018 %edi: 0x00000000 0x0000000a Changes to memory:
107
108
Program efficiency
Our assembly program was not as efficient as it could be we could have optimized away the need for the variable i by simply decrementing n until n was 0 we also could have been smarter with our registers, and not overwritten the constant value we used repeatedly (1) These things need to be taken into consideration by compilers, and by you in the assembly code youre writing for the project...
109