Professional Documents
Culture Documents
Address
- the number, assigned to a byte that indicates its position in the memory
- the first byte has an address of 0
Low end of memory
- those bytes close to byte 0
high end of memory
- those bytes close to the byte with the highest address
Most significant bits
- the leftmost bits within a byte
- aka high order bits
least significant bits
- the rightmost bits within a byte
- aka low order bits
word boundary
- an address that is a multiple of 2
doubleword boundary
- an address that is multiple of 4
quadword boundary
- an address that is multiple of 8
paragraph boundary
- an address that is multiple of 16
primary memory
- RAM
- Memory that the processor can work with directly
Secondary memory
- resides on the disks
- memory that the processor cannot work with directly
Memory Addresses
- computer memory is organized by bytes.
- All the bytes are numbered, starting from 0
- When the processor needs to read a byte (data saved in a byte) it sends the address to the memory
- The memory then sends the data found in the specified address to the processor
- When the processor needs to write a byte, it sends two signals to the memory, the address of the byte
and the data to be written.
- The memory then copies the data to the specified byte.
- Ex. If the processor wants to store the letter D (44h) in the byte with the address 64AB1h. The processor
sends the address 64AB1h and the data 44h to the memory.
- Bytes are stored in order, one on top of the other with the byte at address 0 being on the bottom
- You refer to a byte by its address
- When you refer to a word, doubleword, quadword or paragraph you use the address of its first byte
Boundaries
- sometimes data needs to be stored so that it starts at a particular type of address, called a boundary
- boundary is an address that is a multiple of a specific number
- all the addresses that are multiples of 2 are said to be word boundaries
- starting with address 0h every second byte in the memory is on a word boundary (every even hex
numbers)
- Ex. 0h, 2h, 4h, 6h etc
- If the first byte of some data has such address, we say that the data is aligned to a word boundary that
means it starts on a word boundary.
- Ex. Data that starts at address 108A6h is aligned to a word boundary and data that starts at address
108A7h is not aligned to a word boundary
- Similarly, every fourth byte starting from 0h is said to be a doubleword boundary
- Summary of Boundary Alignments
Boundary Definition All Addresses that Ends in…
Word Every 2nd byte 0h, 2h, 4h, 6h, 8h, Ah, Ch, Eh
th
DoubleWord Every 4 byte 0h, 4h, 8h, Ch
QuadWord Every 8th byte 0h, 8h
th
Paragraph Every 16 byte 0h
Registers
- There is a small amount of memory built in to the processor
- This memory consists of 14 (28 bytes) words of RAM
- Each of these word is called a register
- Each register has its own name and own purpose
- When you program refer to each register using their abbreviation
Name Abbreviation Category
Accumulator AX(AH, AL) General Register
Base Register BX(BH, BL) General Register
Count Register CX(CH, CL) General Register
Data Register DX (DH, CL) General Register
Base Pointer BP Offset Register
Instruction Pointer IP Offset Register
Stack Pointer SP Offset Register
Destination Index DI Offset Register
Source Index SI Offset Register
Data Segment Register DS Segment Register
Extra Segment Register ES Segment Register
Stack Segment Register SS Segment Register
Code Segment Register CS Segment Register
Flags Register none none