• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

8052 N00B question

Status
Not open for further replies.

munisgtm

Senior member
Hi

I'm u-controller N00B ,i have just built a 89S52 programmer now i'm trying to implement a 2-input XOR gate on it using XRL instruction, but i cant do it because the instruction requires reading latches and stuff! If there is someone with 8052 assembly experience please help me!

Thanks in advance!

I guess i'm posting in the right section
 
I never use asm on 8051, so bear with me..

say our inputs are port0.0 and port0.1 and the output is port1.0
so we mask port 0 to copy bits 0 and 1 to two different registers. then we shift the register with the bit in the 1's space to 0.
reg0 xxxx xxxN <- port 0 pin 0 value copied
reg1 xxxx xxNx <- port 0 pin 1 value copied,
reg1 xxxx xxxN <- port 0 pin 1 val shifted

then copy the reg1 to the accumulator, then XRL A, R0.
then the result will be stored in accumulator.. copy it to some other reg, compare it with zero. if nonzero, set port1 pin0.

something like that. do you have to use assembly? this is an assignment or something?
 
Status
Not open for further replies.
Back
Top