Y86reference for tests and exams PDF

Title Y86reference for tests and exams
Author Anonymous User
Course Computer Hardware And Operating Systems
Institution The University of British Columbia
Pages 1
File Size 43.4 KB
File Type PDF
Total Downloads 39
Total Views 167

Summary

y86 reference sheet for assembly language...


Description

Y86-64 Instructions Encoding Byte 0 halt 0 0 nop 1 0 rrmovq rA, rB 2 0 cmovXX rA, rB 2 fn irmovq V, rB 3 0 rmmovq rA, D(rB) 4 0 mrmovq D(rB), rA 5 0 OPq rA, rB 6 fn jXX Dest call Dest ret pushq rA popq rA

Instruction rrmovq %rs, %rd cmovXX %rs, %rd irmovq $i, %rd rmmovq %rs, D(%rd) mrmovq D(%rs), %rd OPq %rs, %rd jmp D jXX D call D ret pushq %rs popq %rd

7 8 9 A B

fn 0 0 0 0

1

rA rA F rA rA rA

2

3

4

5

rB rB rB rB rB rB

6

7

8

V D D Dest Dest

rA rA

F F

Semantics r[rd] ← r[rs] r[rd] ← r[rs] if last ALU XX 0 (XX is le/l/e/ne/ge/g) r[rd] ← i m[D + r[rd]] ← r[rs] r[rd] ← m[D + r[rs]] r[rd] ← r[rd] OP r[rs] goto D goto D if last ALU result XX 0 (XX is le/l/e/ne/ge/g) pushq PC; jmp D popq PC m[r[rsp] - 8] ← r[rs]; r[rsp] = r[rsp] - 8 r[rd] ← m[r[rsp]]; r[rsp] = r[rsp] + 8

Hexadecimal conversions Hex Bin Hex Bin 0 0000 8 1000 1 0001 9 1001 2 0010 A 1010 3 0011 B 1011 4 0100 C 1100 5 0101 D 1101 6 0110 E 1110 7 0111 F 1111

9

ifun values ifun OPq 0 add 1 sub 2 and 3 xor 4 mul 5 div 6 mod

jXX/cmovXX no condition le l e ne ge g

Example rrmovq %rax, %rbx cmovle %rax, %rbx irmovq $100, %rax rmmovq %rax, 100(%rbx) mrmovq 100(%rbx), %rax addq %rax, %rbx jmp foo jle foo call foo ret pushq %rax popq %rax

Register Names # Name # 0 %rax 8 1 %rcx 9 2 %rdx A 3 %rbx B 4 %rsp C 5 %rbp D 6 %rsi E 7 %rdi F

Name %r8 %r9 %r10 %r11 %r12 %r13 %r14 NONE...


Similar Free PDFs