Logic gates - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Logic gates

Hello, how can I use logic gates in assembly? for example, apply an AND in a byte that I have defined. For example, if I have the following variable:

variable db ?

This is a 8 bit element, supposing that it have the following content:

11001111

What I want to do is a apply the AND gate to that bit chain, in this way:

11001111//content of my variable
00000001//I want to apply AND with this bit chain

How can I code that in assembly?

Best regards

Comments

  • anthrax11anthrax11 Posts: 511Member
  • CsehCseh Posts: 4Member
    : Hello, how can I use logic gates in assembly? for example, apply an
    : AND in a byte that I have defined. For example, if I have the
    : following variable:
    :
    : variable db ?
    :
    : This is a 8 bit element, supposing that it have the following
    : content:
    :
    : 11001111
    :
    : What I want to do is a apply the AND gate to that bit chain, in this
    : way:
    :
    : 11001111//content of my variable
    : 00000001//I want to apply AND with this bit chain
    :
    : How can I code that in assembly?
    :
    : Best regards
    :
    Dear Karma,
    The assembly programme in case of PIC 16FXXX microcontrollers goes like this:
    movlw B'11001111' ;move binary value 11001111 to w
    andlw B'00000001' ;and binary value 00000001 to w, Result is in w
    Best Regards
    J. Cseh
Sign In or Register to comment.