User Tag List

Results 1 to 3 of 3

Thread: Or, Xor, & And command tutorial

  1. #1
    Or, Xor, & And command tutorial

    User Info Menu

    Or, Xor, & And command tutorial

    Tutorial by TheEliteOne aka -LeetGamer-
    ================================================== ========

    Commands: Or, Xor, And

    First you need to know what Binary is. Binary is another form of counting, like normal numbers (Decimal), and hex numbers (Hexadecimal). But Binary only can use 0 and 1. This is needed to learn these commands, now here is a decimal (Normal number) to Binary converter:

    Code:
    http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html
    First what the command does is converts the hex value into Binary. So if we had 8 and 2 in hex here will be are binary values:

    1000 (This is 8)
    10 (This is 2)

    Now we need them to be equal, so we add zeros:

    1000 (This is 8)
    0010 (This is 2)

    Now they are equal size. These two binary numbers are what I will be using for all three commands. When I say each set, I mean that the first set is 1 and 0, the second is 0 and 0, the third is 0 and 1, and the last is 0 and 0. Basically each diget in the Binary number.

    Or:
    Or

    1000
    0010

    In each set, the result is 1 if the top diget is one OR the bottom diget is one OR both digets are one, if none of those are true the result is zero.

    1000
    0010
    ------
    1010 (This is are result, in decimal it is 10 and in hex it is A)

    So 8 || 2 = 10 and in hex: 0x8 || 0x2 = 0xA. The symbol for Or is two of these: ||

    Xor:
    Exclusive Or

    1000
    0010

    In each set, the result is 1 if the two digets are different, and the result is 0 if they are the same.

    1000
    0010
    -----
    1010 (This is are result, same as last time, but do not think that Or and Xor do the same thing!)

    So 8 ^^ 2 = 10 and in hex: 0x8 ^^ 0x2 = 0xA. The symbol for Xor is two of these: ^^

    And:
    And

    1000
    0010

    In each set, the result is 1 if the first AND the second diget are 1, if that is not true the result is 0.

    1000
    0010
    ------
    0000 (This is are answer, in dec and hex it is zero)

    So 8 && 2 = 0 and in hex: 0x8 && 0x2 = 0x0. The symbol for And is two of these: &&

    ================================================== ===================================
    Ori, Xori, & Andi are the same thing, but they take a immediate value that you give and a register, and not two register contents.

    Please +Rep / Donate / Give Me a Medal (I would rather have a medal :) ) if it helped or you thought it was a good guide.

    If you have an idea on a PSP related program that is ran on Windows PM me with some information on your idea please.

  2. #2
    Or, Xor, & And command tutorial

    User Info Menu

    Re: Or, Xor, & And command tutorial

    Digit is spelled with an 'I' and not an 'E' as in "diget".
    Quote Originally Posted by Epic of HITB
    get... 1) a mini fridge | 2) A toilet installed in your room | 3) a closet full of non-perishable foods | 4) Lyscol ( who needs showers anyway?) | 5) tons of books articles lectures zines etc etc

    Dont leave your room...EVER... AND I MEAN EVER
    Damned six line limit! *NERD RAGE*

  3. #3
    Or, Xor, & And command tutorial

    User Info Menu

    Exclamation Re: Or, Xor, & And command tutorial

    Quote Originally Posted by S2h6699 View Post
    Digit is spelled with an 'I' and not an 'E' as in "diget".
    lmao ok, I should add in some typos in my tut to see if people actually read them :)

    If you have an idea on a PSP related program that is ran on Windows PM me with some information on your idea please.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •