You are on page 1of 4

Rabino, Eliza Marie C.

CPE-3 / COE119-C1
Homework #2
Conditional and Unconditional JMP
instructions:

Unconditional jump:
This is performed by the JMP instruction.
Conditional execution often involves a
transfer of control to the address of an
instruction that does not follow the
currently executing instruction. Transfer
may be forward, executing a new set of
instructions or backward, to re-execute the
same steps.

unsigned data used for logical


operations :

instructions have special uses and


check the value of flags

Conditional jump:
This is performed by a set of jump
instructions j<condition> depending upon
the condition. The conditional instructions
transfer the control by breaking the
sequential flow and they do it by changing
the offset value in IP.
If some specified condition is satisfied in
conditional jump, the control flow is
transferred to a target instruction.
Following are the conditional jump
instructions used on signed data used for
arithmetic operations:

Syntax
The JMP instruction provides a
where the flow of control is
immediately. The syntax of
instruction is : JMP Label (the
tabulated above)

label name
transferred
the JMP
commands

Flow Charting :
An Example of a decision Flowchart

Flowcharts were introduced by Frank Gilberth


in 1921, and they were called Process Flow
Charts at the beginning . Allan H. Mogensen
is credited with training business people on the
use of Flowcharts.

An Example of a Looping Flowchart

These flowcharts will loop until the said


condition has been achieved. Can be used for
repetitive counting and so on.

The flowchart has decisions which will lead


the program into doing certain functions for
whichever decision the function fits in. This
could be used for segregation and separation.
Example of a sequential Flowchart

A sequential
flowchart follows
a strict step-bystep process. One
cannot
skip
immediately to
the end.

X86 OP CODES

1. Notations and Format used in this


Document
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.

AAA - Ascii Adjust for Addition


AAD - Ascii Adjust for Division
AAM - Ascii Adjust for Multiplication
AAS - Ascii Adjust for Subtraction
ADC - Add With Carry
ADD - Arithmetic Addition
AND - Logical And
ARPL - Adjusted Requested Privilege
Level of Selector
BOUND - Array Index Bound Check
BSF - Bit Scan Forward
BSR - Bit Scan Reverse
BSWAP - Byte Swap
BT - Bit Test
BTC - Bit Test with Compliment
BTR - Bit Test with Reset
BTS - Bit Test and Set
CALL - Procedure Call
CBW - Convert Byte to Word
CDQ - Convert Double to Quad
CLC - Clear Carry
CLD - Clear Direction Flag
CLI - Clear Interrupt Flag
CLTS - Clear Task Switched Flag
CMC - Complement Carry Flag
CMP - Compare
CMPS - Compare String
CMPXCHG - Compare and Exchange
CWD - Convert Word to Doubleword
CWDE - Convert Word to Extended
Doubleword
DAA - Decimal Adjust for Addition
DAS - Decimal Adjust for Subtraction
DEC - Decrement
DIV - Divide
ENTER - Make Stack Frame
ESC - Escape
Floating point instuctions - no
descriptions
HLT - Halt CPU
IDIV - Signed Integer Division
IMUL - Signed Multiply
IN - Input Byte or Word From Port
INC - Increment
INS - Input String from Port
INT - Interrupt
INTO - Interrupt on Overflow
INVD - Invalidate Cache
INVLPG - Invalidate Translation LookAside Buffer Entry

47. IRET/IRETD - Interrupt Return


48. JA/JNBE - Jump Above / Jump Not
Below or Equal
49. JAE/JNB - Jump Above or Equal / Jump
on Not Below
50. JB/JNAE - Jump Below / Jump Not
Above or Equal
51. JBE/JNA - Jump Below or Equal / Jump
Not Above
52. JC - Jump on Carry
53. JCXZ/JECXZ - Jump if Register (E)CX
is Zero
54. JE/JZ - Jump Equal / Jump Zero
55. JG/JNLE - Jump Greater / Jump Not
Less or Equal
56. JGE/JNL - Jump Greater or Equal /
Jump Not Less
57. JL/JNGE - Jump Less / Jump Not
Greater or Equal
58. JLE/JNG - Jump Less or Equal / Jump
Not Greater
59. JMP - Unconditional Jump
60. JNC - Jump Not Carry
61. JNE/JNZ - Jump Not Equal / Jump Not
Zero
62. JNO - Jump Not Overflow
63. JNS - Jump Not Signed
64. JNP/JPO - Jump Not Parity / Jump
Parity Odd
65. JO - Jump on Overflow
66. JP/JPE - Jump on Parity / Jump on
Parity Even
67. JS - Jump Signed
68. LAHF - Load Register AH From Flags
69. LAR - Load Access Rights
70. LDS - Load Pointer Using DS
71. LEA - Load Effective Address
72. LEAVE - Restore Stack for Procedure
Exit
73. LES - Load Pointer Using ES
74. LFS - Load Pointer Using FS
75. LGDT - Load Global Descriptor Table
76. LIDT - Load Interrupt Descriptor Table
77. LGS - Load Pointer Using GS
78. LLDT - Load Local Descriptor Table
79. LMSW - Load Machine Status Word
80. LOCK - Lock Bus
81. LODS - Load String
82. LOOP - Decrement CX and Loop if CX
Not Zero
83. LOOPE/LOOPZ - Loop While Equal /
Loop While Zero
84. LOOPNZ/LOOPNE - Loop While Not
Zero / Loop While Not Equal
85. LSL - Load Segment Limit
86. LSS - Load Pointer Using SS

87. LTR - Load Task Register


88. MOV - Move Byte or Word
89. MOVS - Move String
90. MOVSX - Move with Sign Extend
91. MOVZX - Move with Zero Extend
92. MUL - Unsigned Multiply
93. NEG - Two's Complement Negation
94. NOP - No Operation
95. NOT - One's Compliment Negation
96. OR - Inclusive Logical OR
97. OUT - Output Data to Port
98. OUTS - Output String to Port
99. POP - Pop Word off Stack
100.
POPA/POPAD - Pop All
Registers onto Stack
101.
POPF/POPFD - Pop Flags off
Stack
102.
PUSH - Push Word onto Stack
103.
PUSHA/PUSHAD - Push All
Registers onto Stack
104.
PUSHF/PUSHFD - Push Flags
onto Stack
105.
RCL - Rotate Through Carry
Left
106.
RCR - Rotate Through Carry
Right
107.
REP - Repeat String Operation
108.
REPE/REPZ - Repeat Equal /
Repeat Zero
109.
REPNE/REPNZ - Repeat Not
Equal / Repeat Not Zero
110.
RET/RETF - Return From
Procedure
111.
ROL - Rotate Left
112.
ROR - Rotate Right
113.
SAHF - Store AH Register into
FLAGS
114.
SAL/SHL - Shift Arithmetic Left /
Shift Logical Left
115.
SAR - Shift Arithmetic Right
116.
SBB - Subtract with Borrow
117.
SCAS - Scan String
118.
SETAE/SETNB - Set if Above
or Equal / Set if Not Below
119.
SETB/SETNAE - Set if Below /
Set if Not Above or Equal
120.
SETBE/SETNA - Set if Below or
Equal / Set if Not Above
121.
SETE/SETZ - Set if Equal / Set
if Zero
122.
SETNE/SETNZ - Set if Not
Equal / Set if Not Zero
123.
SETL/SETNGE - Set if Less /
Set if Not Greater or Equal
124.
SETGE/SETNL - Set if Greater
or Equal / Set if Not Less

125.
SETLE/SETNG - Set if Less or
Equal / Set if Not greater or Equal
126.
SETG/SETNLE - Set if Greater /
Set if Not Less or Equal
127.
SETS - Set if Signed
128.
SETNS - Set if Not Signed
129.
SETC - Set if Carry
130.
SETNC - Set if Not Carry
131.
SETO - Set if Overflow
132.
SETNO - Set if Not Overflow
133.
SETP/SETPE - Set if Parity /
Set if Parity Even
134.
SETNP/SETPO - Set if No
Parity / Set if Parity Odd
135.
SGDT - Store Global Descriptor
Table
136.
SIDT - Store Interrupt Descriptor
Table
137.
SHR - Shift Logical Right
138.
SHLD/SHRD - Double Precision
Shift
139.
SLDT - Store Local Descriptor
Table
140.
SMSW - Store Machine Status
Word
141.
STC - Set Carry
142.
STD - Set Direction Flag
143.
STI - Set Interrupt Flag
144.
STOS - Store String
145.
STR - Store Task Register
146.
SUB - Subtract
147.
TEST - Test For Bit Pattern
148.
VERR - Verify Read
149.
VERW - Verify Write
150.
WAIT/FWAIT - Event Wait
151.
WBINVD - Write-Back and
Invalidate Cache
152.
XCHG - Exchange
153.
XLAT/XLATB - Translate
154.
XOR - Exclusive OR

SOURCES :
https://www.tutorialspoint.com/assembly_progra
mming/assembly_conditions.htm
http://creately.com/blog/diagrams/flowchartguide-flowcharttutorial/#HowToDrawFlowchart
http://www.mathemainzel.info/files/x86asmref.h
tml

You might also like