MISC
Name
1996-2003 by Roger Jegerlehner, Switzerland
V 2.3 English. Also available in Spanish
CodeTable 2/2
Intel Assembler 80186 and higher
O D
Code
NOP
Comment
No operation
NOP
Operation
No operation
LEA
Load effective address
LEA Dest,Source
Dest := address of Source
INT
Interrupt
INT Nr
interrupts current program, runs spec. int-program
Flags
T S Z A
JUMPS (flags remain unchanged)
Name
CALL
Comment
Call subroutine
Code
CALL Proc
JMP
Jump
JMP Dest
JE
Jump if Equal
Jump if Zero
Jump if CX Zero
JE Dest
Jump if Parity (Parity Even)
Jump if Parity Even
JP Dest
JPE Dest
JZ
JCXZ
JP
JPE
JZ Dest
JCXZ Dest
Jump if Below
JBE
Jump if Below or Equal
Jump if not Above
Jump if not Above or Equal
Jump if not Below
Jump if not Below or Equal
Jump if Carry
Jump if no Carry
JNA
JNAE
JNB
JNBE
JC
JNC
Name
RET
Comment
Return from subroutine
Code
RET
Operation
( JZ)
( JE)
JNE
JNZ
JECXZ
JNP
JPO
Jump if not Equal
Jump if not Zero
Jump if ECX Zero
JNE Dest
JNZ Dest
JECXZ Dest
( JNZ)
( JNE)
( JPE)
( JP)
Jump if no Parity (Parity Odd)
Jump if Parity Odd
JNP Dest
JPO Dest
386
( JPO)
( JNP)
JUMPS Signed (Integer)
JUMPS
JUMPSUnsigned
Unsigned(Cardinal)
JA
Jump if Above
JAE
Jump if Above or Equal
JB
Operation
JA Dest
JAE Dest
JB Dest
JBE Dest
JNA Dest
JNAE Dest
JNB Dest
JNBE Dest
JC Dest
JNC Dest
( JNBE)
( JNB JNC)
(
(
(
(
(
(
JNAE JC)
JNA)
JBE)
JB JC)
JAE JNC)
JA)
JUMPS Signed
Jump if Greater
Jump if Greater or Equal
Jump if Less
Jump if Less or Equal
Jump if not Greater
Jump if not Greater or Equal
JNL
Jump if not Less
JNLE
Jump if not Less or Equal
JG
JGE
JL
JLE
JNG
JNGE
JO
JNO
JS
JNS
JG Dest
JGE Dest
JL Dest
JLE Dest
JNG Dest
JNGE Dest
JNL Dest
JNLE Dest
Jump if Overflow
JO Dest
Jump if no Overflow
Jump if Sign (= negative)
Jump if no Sign (= positive)
JS Dest
( JNLE)
( JNL)
( JNGE)
( JNG)
( JLE)
( JL)
( JGE)
( JG)
JNO Dest
JNS Dest
Example:
EAX 386
Instructiuni pe siruri:AX
AH
FUNCTII
BIOS:
.DOSSEG
; Demo program
AL
.MODEL SMALL
INT 10h:
MOVSB
DS:[SI] => ES:[DI], SI++, DI++
Selectare
Accumulator
.STACKmod
1024 video: AH=0, AL=1: mod text 40x25 /
LODSB
DS:[SI] => AL, SI++
mod2 text 80x25; ; Const
TwoAL=2: EQU
31 24 23 16 15 8 7
0
STOSB
AL => ES:[DI], DI++
Pozitionare
cursor: AH=2, BH=nr. pagina, DH=rnd,
.DATA
DL=coloana;
CMPSB
~ ES:[DI], SI++, DI++; set VarB
EDX DS:[SI]
386
DB ?
; define Byte, any value
Scriere
la pozitia
status flags
VarW
DWcaractere
1010b
; definecursorului:
Word, binary AH=0Ah, AL=cod
DX
ASCII DW
caracter,
BH=nr. pagina,
CX=nr.
caractere;
DH~ ES:[DI],
VarW2
DL
257
; define Word,
decimal
SCASB
AL
DI++; set status flags
Scriere
caracter
n
mod
Teletype:
AH=0Eh, AL=cod
Data mul, instr;
div, IOCX-VarD
DD 0AFFFFh
; define Doubleword, hex
REP instr
while (CX#0) execute
ASCII
caracter,
BH=nr.
pagina.
31 instr
24 23 16 15
DB "Hello !",0
; define String
REPZ
while8 7(CX#00 and ZF=1) execute instr; S
.CODE
CX-INT 16h:
386
MOV AX,DGROUP
; resolved by linker
REPNZ instr ECX while
(CX#0 and ZF=0) execute instr; main:
Citire MOV
caracter
de la; inittastatura
fara ecou: AH=0,
DS,AX
datasegment reg
CX
CX-returneaza:
AL=cod
ASCII
caracter.
CH
CL
MOV [VarB],42
; init VarB
Count loop, shift
Tabele de conversie:
31
24 23
16 15
87
XLAT
BX= table offset, AL= offset inside
EBX 386
table; DS:[BX+AL] =>BX
AL
BH
BL
BaseX data ptr
31
Flags:
24 23
16 15
87
- - - -OD I T S
-A -P - C
Control Flags (how instructions are carried out):
D: Direction 1 = string op's process down from high to low address
I: Interrupt whether interrupts can occur. 1= enabled
T: Trap
single step for debugging
MOV [VarD],-7
; set VarD
MOV BX,Offset[S]
; addr of "H" of "Hello !"
INT 21h:
MOV AX,[VarW]
; get value into accumulator
Citire ADD
caracter
AX,[VarW2] de la
; addtastatura
VarW2 to AX cu ecou: AH=1,
returneaza:
AL=cod ASCII
caracter.
MOV [VarW2],AX
; store
AX in VarW2
Afisare
sirAX,4C00h
de caractere:; back
AH=9,
DS:DX=Adresa sir.
MOV
to system
INT 21h
END main
FUNCTII DOS:
Status Flags (result of operations):
C: Carry
result of unsigned op. is too large or below zero. 1 = carry/borrow
O: Overflow result of signed op. is too large or small. 1 = overflow/underflow
S: Sign
sign of result. Reasonable for Integer only. 1 = neg. / 0 = pos.
Z: Zero
result of operation is zero. 1 = zero
A: Aux. carry similar to Carry but restricted to the low nibble only
P: Parity
1 = result has even number of set bits
Download latest version free of charge from www.jegerlehner.ch/intel This page may be freely distributed without cost provided it is not changed. All rights reserved