Professional Documents
Culture Documents
Chap 3
Chap 3
1
INTEGER DATA TYPES
2
INTEGER DATA TYPES
3
INTEGER DATA TYPES
4
BOOLEAN DATA TYPES
5
MIXING DATA TYPES
The condition in the if statement above may at first appear to always be true .
In fact, however, the condition is always false
6
MIXING DATA TYPES
7
MANIPULATING BITS IN MEMORY
8
MANIPULATING BITS IN MEMORY
9
MANIPULATING BITS IN MEMORY
10
Testing Bits
11
Setting, Clearing, and Inverting Bits
12
Setting, Clearing, and Inverting Bits
13
Extracting Bits
14
Inserting Bits
15
MANIPULATING BITS IN INPUT/OUTPUT PORTS
16
Write-Only I/O Devices
17
I/O Devices Differentiated by Reads Versus Writes
18
I/O Devices Differentiated by Sequential Access
19
I/O Devices Differentiated by Sequential Access
20
I/O Devices Differentiated by Bits in the Written Data
21
ACCESSING MEMORY-MAPPED I/O DEVICES
22
Accessing Data Using a Pointer
23
Arrays, Pointers, and the “Address of” Operator
24
Arrays, Pointers, and the “Address of” Operator
We can access our display buffer as an array by initializing a pointer to the base
address of the display buffer and then applying subscripting:
25
Arrays, Pointers, and the “Address of” Operator
It would be nicer to use one subscript for row, a second for column, and a third to
differentiate between the ASCII and attribute bytes of the character cell.
26
STRUCTURES
27
STRUCTURES
28
Packed Structures
The compiler may align structure members on word boundaries for faster access
time.
29
Packed Structures
30
Packed Structures
31
Bit Fields
32
Bit Fields
33
VARIANT ACCESS
34
Using Unions
35