View Single Post
Old 01-22-2005, 06:14 AM   #1 (permalink)
toblerone
Registered User
 
toblerone's Avatar
 
Join Date: Jul 2004
Posts: 11
toblerone is on a distinguished road
Assembelly code register addressing

dunno if anyone here does embedded programming, if ya do Ive a little knot I need some help with
Im working with a 87C552, an 8051 derivative, and am reading a number from a keypad to use as an Id to select a servo motor to run PWM to.
1) I have the keypad scan function saving the kay value to the accumulator.
2) I have the current PWM value for each of the 5 motors stored in registers 1 to 5

How do I use the number in the accumulator to select the information in the relevant register?
IE
if A = 3
then
move data from R3 to PWM0.
toblerone is offline   Reply With Quote