-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnotes
68 lines (56 loc) · 2.01 KB
/
notes
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
These are general things that I might need reminding of.
===============================================================================
Bochs Magic Breakpoint
-------------------------------------------------------------------------------
asm volatile ("xchgw %%bx, %%bx");
xchgw %bx, %bx
===============================================================================
GNU Assembler x86_32 CDEL
-------------------------------------------------------------------------------
The order function data is pushed onto the stack is, from bottom to top:
Last Argument,
...
Second Argument,
First Argument,
Return Address
This also applies to structs passed as arguments (the last member of the
struct is pushed first).
If a function's signature is f(int32_t a, int32_t b, int32_t c), then
- a can be accessed as 4(%esp),
- b can be accessed as 8(%esp)
- c can be accessed as 12(%esp)
%eax, %ecx, and %edx are the registers saved by the caller.
The returned value is expected to be in %eax.
===============================================================================
x86 Assembly
-------------------------------------------------------------------------------
Use pushf/popf to push/pop the flags register.
iret pops eip, cs, and eflags from the stack in that order.
===============================================================================
qemu-system-i386
-------------------------------------------------------------------------------
bus 0
device 2
function 0
VGA Controller
Vendor ID 1234
Device ID 1111
device 3
function 0
Enthernet Controller
Vendor ID 8086
Device ID 100E
device 0
function 0
PCI Host Bridge
Vendor ID 8086
Device ID 1237
device 1
function 0
PCI to ISA Bridge
Vendor ID 8086
Device ID 7000
function 1
IDE Controller
Vendor ID 8086
Device ID 7010