Direct addressing mode
There are 128 bytes of RAM in the 8051.
The RAM has been assigned address 00 - 7FH.
00-1FH: the register banks and stack
20-2FH: bit-addressable space to save single-bit data
30-7FH: scratch pad RAM
for some RAM locations
so we need
to use direct address mode to access them; e.g.,
scratch pad RAM
If a number begins
a pound sign, „#
assembler thinks it as the RAM address.
In direct addressing mode, the data is in a RAM
memory location whose address is known, and this
address is given as a part of the instruction.
We can use the direct addressing mode to access
128-byte on chip RAM
Special Function Registers (they have RAM addresses too.)
MOV R0, 40H
MOV 56H, A