data transfer instruction in assembly language

Status
Not open for further replies.

Parth86

Member
I know the data transfer instruction is used to move data. data can be move between memory, register and accumulator
different movement of data in assembly

accumulator to register mov R0, A
register to accumulator mov A, R0

how to write instruction for memory ( which memory is used for this)
memory to accumulator ?
memory to register ?
 
You can load directly..
Code:
counter equ 0x30

mov A, counter
inc A
mov counter, A

Or indirectly using one of the registers
Code:
counter equ 0x30

mov R0,#counter

mov A, @R0
inc A
mov @R0, A

Oh yeah! the '#' means data without it will be location... In my example I load the value of counter into A
In the second, I load the actual location number into R0.
 
Last edited:
hi,
From your two 'MOV' instructions, I would say yes.
This Link explains the MOV instructions in detail.
**broken link removed**
E
 
If you have downloaded MPU51IDE... Just play with the commands to see them working for yourself...

The simulator is brilliant!!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…