Intel Code Table
Intel Code Table
Name
CodeTable 2/2
O D
Code
NOP
Comment
No operation
NOP
Operation
No operation
LEA
LEA Dest,Source
INT
Interrupt
INT Nr
Flags
T S Z A
Comment
Call subroutine
Code
CALL Proc
JMP
Jump
JMP Dest
JE
Jump if Equal
Jump if Zero
Jump if CX Zero
JE Dest
JP Dest
JPE Dest
JZ
JCXZ
JP
JPE
JZ Dest
JCXZ Dest
Jump if Below
JBE
JNA
JNAE
JNB
JNBE
JC
JNC
Name
RET
Comment
Return from subroutine
Code
RET
Operation
( JZ)
( JE)
JNE
JNZ
JECXZ
JNP
JPO
JNE Dest
JNZ Dest
JECXZ Dest
( JNZ)
( JNE)
( JPE)
( JP)
JNP Dest
JPO Dest
386
( JPO)
( JNP)
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
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
24 23
16 15
87
- - - -OD I T S
-A -P - C
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:
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