Professional Documents
Culture Documents
Tugas AOK Instruction Set - Berlian Ishma Zhafira Sujana - 225150207111008
Tugas AOK Instruction Set - Berlian Ishma Zhafira Sujana - 225150207111008
Tugas AOK Instruction Set - Berlian Ishma Zhafira Sujana - 225150207111008
NIM: 225150207111008
Kelas: A
Program Studi: Teknik Informatika
Mata Kuliah: Arsitektur dan Organisasi Komputer
Instructi
Meaning Notes Opcode
on
Instructi
Meaning Notes Opcode
on
0x38… 0x3D
,
CMP Compare operands
0x80/7… 0x8
3/7
Convert word to
CW D 0x99
doubleword
Instructi
Meaning Notes Opcode
on
0x48,
DEC Decrement by 1 0xFE/1,
0xFF/1
0x69, 0x6B,
(1) DX:AX = AX * r/m; (2) AX = 0xF6/5,
IMUL Signed multiply
AL * r/ m 0xF7/5,
0x0FAF
0x40,
INC Increment by 1 0xFE/0,
0xFF/0
Instructi
Meaning Notes Opcode
on
0xE 9… 0xEB
JMP Jump , 0xFF/4,
0xFF/5
Instructi
Meaning Notes Opcode
on
if ( DF==0)
*( byte*) DI++ =
*(byte*)SI++;
Move byte from string to
MOVSB else 0xA 4
string
*( byte*) DI-- = *( byte*) SI-
-;
if ( DF==0)
*( word*) DI++ =
*(word*)SI++;
Move word from string to
MOVSW else 0xA 5
string
*( word*) DI-- = *( word*) SI-
-;
Two's complement
NEG r/m *= -1;
negation
opcode equivalent to XCHG EAX,
NOP No operation 0x90
EAX
Original 8086/8088 instruction set
Instructi
Meaning Notes Opcode
on
Negate the
NOT r/m ^= -1;
operand, logical NO T
(1) port[imm] =
OUT Output to port AL; (2) port[ DX] =
AL; (3) port[ DX] = AX;
Instructi
Meaning Notes Opcode
on
r : = : r / m; A spinlock typically
XCHG Exchange data uses xchg as an atomic operation.
(coma bug).
XLAT Table look-up translation behaves like MOV AL, [ BX+AL] 0xD7
(1) r/m ^= r/imm; (2) r ^=
XOR Exclusive OR
m/imm;
Added in specific processors
Added w ith 80186 /80188
Check array
raises software interrupt 5 if
BOUND index against
test fails
bounds
equivalent to
IN ( E)AX, DX
Input from port to
INS MOV ES:[(E)DI], (E) AX
string
; adjust ( E)DI
according to operand
size and DF
equivalent to
POP DI
Pop all general
purpose POP SI
POPA
registers from POP BP
stack POP AX ;no POP SP here,
only ADD SP,2
POP BX
POP DX
POP CX
POP AX
equivalent to
PUSH AX
PUSH CX
PUSH DX
Push all general PUSH BX
purpose
PUSHA PUSH SP ; The value
registers onto
stack stored is the initial
SP value
PUSH BP
PUSH SI
PUSH DI
equivalent to
Push an
immediate
PUSH immediate PUSH 12 h
byte/word value
onto the stack PUSH 1200h
equivalent to
IMUL BX,12 h
IMUL DX,1200h
Signed IMUL CX, DX, 12h
multiplication of
IMUL immediate IMUL BX, SI, 1200h
immediate
byte/word value IMUL DI, word ptr
[BX+SI], 12h
IMUL SI, word ptr [ BP-
4], 1200h
equivalent to
Rotate/shift bits
SHL/SHR/SAL/SAR/ROL/ROR/RCL/RCR with an
ROL AX, 3
immediate immediate value
greater than 1 SHR BL, 3
Load all CPU registers, including internal ones Undocumented, 80286 and
LOADALL
such as GDT 80386 only
BT Bit test
Interrupt return;
IRETx D suffix means Use IRETD rather than IRET in 32 -bit situations
32-bit return, F
suffix means do
not generate
epilogue code
(i.e. LEAVE
instruction)
Jump if ECX is
JECXZ
zero
Load stack
LSS
segment
MOV
Move to/from CR=control registers, DR=debug registers, TR=test registers
to/from
special registers (up to 80486)
CR/DR/TR
Output to port
OUTSD from string port[DX] = *( long*) ESI±±; (±± depends on DF)
double-word
Pop all double-
word (32-bit)
POPAD Does not pop register ESP off of stack
registers from
stack
Push EFLAGS
PUSHFD register onto
stack
Instructi
Meaning Notes
on
Invalidate
INVD Flush internal caches
Internal Caches
Invalidate TLB E
INVLPG Invalidate TLB Entry for page that contains data specified
ntry
Write Back and Writes back all modified cache lines in the process or's internal
WBINVD
Invalidate Cache cache to main memory and invalidates the internal caches.
eXchange and Exchanges the first operand with the second operand, then
XADD
ADD loads the sum of the two values into the destination operand.
CoMPare and Compare EDX:EAX with m64. If equal, set ZF and load
CMPXCHG8B eXCHanGe 8 ECX:EBX into m64 . Else, clear ZF and load m64 into
bytes EDX:EAX.
ReaD
RDMSR from Model- Load MSR specified by ECX into EDX:EAX
specific register
Returns the number of processor ticks since the
ReaD Time
RDTSC processor being "ONLINE" (since the last power on of
Stamp Counter
system)
WRite to Model-
W RMSR Write the value in EDX:EAX to MSR specified by ECX
Specific Register
Resume from
This was introduced by the i386SL and later and is also in
System
RSM[2] the i486SL and later. Resumes from System
Management
Management Mode (SMM)
Mode
Also MMX registers and MMX support instructions were added. They are usable for both integer
and floating point operations, see below .
Added w ith A MD K6
AMD changed the CPUID detection bit for this feature from the K 6 -II on.
Added w ith Pentium Pro
SYStem
SYSEXIT
call EXIT
Move Quadword
MOVNTQ m64 ,
0F E 7 /r Using Non-Temporal
mm
Hint
NOP r/m16
Multi-byte no-
0F 1F /0
operation instruction.
NOP r/m32
0F AE
LFENCE Load Fence Serializes load operations.
E8
Move
MOVNTI Move doubleword from r32 to m32 , minimizing
0F C3 /r Doubleword Non-
m32, r32 pollution in the cache hierarchy.
Temporal
Setup
Sets up a linear address range to be monitored by
MONITOR EAX, ECX, EDX Monitor
hardware and activates the monitor.
Address
CRC32 r32, F2 0F 38
r/m8 F0 /r
F2 REX
CRC32 r32,
0F 38 F0
r/m8
/r
CRC32 r32, F2 0F 38
r/m16 F1 /r
F2
CRC32 r64, REX.W
r/m64 0F 38 F1
/r
CRC32 r32, F2 0F 38
r/m8 F0 /r
Added w ith x86-64
Clear Global
CLGI Clears the GIF 0x0F 0x01 0xDD
Interrupt Flag
Set Global
STGI Sets the G IF. 0x0F 0x01 0xDC
Interrupt Flag
Run virtual
VMRUN Performs a switch to the guest OS. 0x0F 0x01 0xD8
machine
Save state To
VMSAVE Saves additional guest state to VMCB. 0x0F 0x01 0xDB
VMCB
Added w ith Intel VT-x
Load Pointer to
Loads the current VMCS pointer from
VMPTRLD Virtual-Machine 0x0F 0xC7/6
memory.
Control Structure
Clear Virtual-
VMCLEAR Machine Control Writes any cached data to the VMCS 0x66 0x0F 0xC7/6
Structure
Write Field to
VMWRITE Virtual-Machine Modifies a field in the VMCS 0x0F 0x79
Control Structure
Added w ith TB M
BEXTR, BLCFILL, BLCI, BLCIC, BLCMASK, BLCS, BLSFILL, BLSIC, T1 MSKC, TZMSK
Contoh implementasi bahasa pemrograman Assembly
1 PAGE ,132
2 TITLE CALC
3 CGROUP GROUP CODESEG
4 CODESEG SEGMENT PARA PUBLIC 'CODE'
5 ASSUME CS:CGROUP,DS:CGROUP,ES:CGROUP
6 PUBLIC CALC
7 ORG 100H
12 SCREEN_HANDLE DW 0001h
15 TAG DB 'PEMATH'
16 TAG_LEN EQU $-TAG
17 START:
18 SUB AX,AX
19 MOV ES,AX
20 SUB BH,BH
21 MOV BL,INT_NUMBER
22 SHL BX,1
23 SHL BX,1
24 MOV DI,ES:[BX]
25 MOV ES,ES:[BX+2]
26 ADD DI,4
27 LEA SI,TAG
28 MOV CX,TAG_LEN
29 REPE CMPSB
30 JE CALL_CALC
31 MOV BX,SCREEN_HANDLE
32 MOV CX,MESSAGE_LEN
33 LEA DX,MESSAGE
34 MOV AH,40h
35 INT 21h
36 JMP SHORT CALC_EXIT
37 CALL_CALC:
38 MOV AL,INT_NUMBER
39 MOV BYTE PTR INT_CODE,AL
40 DB 0CDh ; INT
41 INT_CODE:
42 DB 00h
43 NOP
44 NOP
45 CALC_EXIT:
46 INT 20h
47 CALC ENDP
48 CODESEG ENDS
49 END CALC