The 8051 Microcontroller and Embedded

(lily) #1
Department of Computer Scien

ce and Information Engineering

National Cheng Kung University, TAIWAN
HANEL

INSIDE THE


8051 MOV Instruction (cont’)


‰Notes on programming


¾Value (proceeded with #) can be loaded directly to registers A, B, or R0 – R7


ƒMOV A,


#23H
ƒMOV R5, #

0F9H


¾If values 0 to F moved into an 8-bit register, the rest of the bits are assumed all zeros


ƒ“MOV A, #5


”, the result will be A=05; i.e., A


= 00000101 in binary


¾Moving a value that is too large into a register will cause an error


ƒMOV A, #7F2H


If it’s not preceded with #, it means to load from a memory location ; ILLEGAL: 7F2H>8 bits (FFH)


Add a 0 to indicate that F is a hex number and not a letter
Free download pdf