Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Bitwise operation

Name: Anonymous 2010-06-09 5:28

How are simple operations like adding and subtraction represented using only bitwise operators such as &, |, ^, >>, ~, and <<?

Also, do each of the bitwise operators perform at the same rate, or are some faster than others?

Name: Anonymous 2010-06-09 14:33

Here's some code I just saw that does a multiplication by 10 using shifts and an addition:

  x = (x << 1) + (x << 3)

Or in the original language:

  asl a
  sta $38
  asl a
  asl a
  clc
  adc $38
  sta $38

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List