Re: 8051 Programming
- From: "petrus bitbyter" <pieterkraltlaatditweg@xxxxxxxxxxxxxxxxx>
- Date: Mon, 13 Nov 2006 01:34:53 +0100
<luisdanielsilva@xxxxxxxxx> schreef in bericht
news:1163360427.487718.18100@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I need to convert a 32 bit binary number to gray code. i know how to do
it bit by bit, but i need to do a function to do it, so that i don't
need to repeat code 32 times. Can anybody help me?
Thanks
LDS
Mmm... It's quite some time I wrote 8051 assembler, but if memory serves
it's done like this:
num1 equ 64
num2 equ 65
num3 equ 66
num4 equ 67
clr c
mov a,num1
rlc a
xrl a,num1
mov a,num2
rlc a
xrl a,num2
mov a,num3
rlc a
xrl a,num3
mov a,num4
rlc a
xrl a,num4
end
petrus bitbyter
.
- Follow-Ups:
- Re: 8051 Programming
- From: petrus bitbyter
- Re: 8051 Programming
- References:
- 8051 Programming
- From: luisdanielsilva
- 8051 Programming
- Prev by Date: Re: soldering to nichrome wire
- Next by Date: Re: Benefits of LED lighting -efforts by Kwality in India
- Previous by thread: Re: 8051 Programming
- Next by thread: Re: 8051 Programming
- Index(es):
Relevant Pages
|