CSCI 235 — Machine-Level Programming

Machine-Level Programming

This is a quick look at Chapter 3 which builds on the two pre-assembly labs.

The Basics

5Intel x86
62015 Intel i7
864-bit computers
12Assembly/Machine code view
15Assembly data types
16Assembly operations
23x86-64 integer registers (new)
24IA32 integer registers (old)
26instruction addressing (movq 1)
27instruction addressing (movq 2)
29swap examples
35“simple” addressing
36“complex” addressing
39leaq (yikes!)
40usual C/Java operations
43an example (illustrated)

Control

3condition codes (flags)
4condition code — implicit
4condition code — explicit
7C/Java comparisions
9returning more
11jump instructions
12difference example
13did it in lab
16conditional move
22did it in lab
27did it in lab
32jump table for switch

Procedures

2procedure mechanisms
5push
6pop
8examples — leaf (green) and non-leaf (yellow)
15passing data (cf the lab)
18stack-based languages
20stack frame
25recursion example
32linux stack frame
33–38long example (think of Java bytecode in lab)
41–42who saves the registers

Data

3array allocation
7array access
8nested array allocation
12nested array access
16nested vs multi-level
24structure allocation with alignment
34XMM/SSE registers