6502 Subroutine To Return a Power of 2


/ Published in: Assembler
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ;returns power of 2 for arg in accumulator
  2. pow2
  3. tax
  4. lda Pow2Tab,x
  5. rts
  6.  
  7. Pow2Tab
  8. .byte 1
  9. .byte 2
  10. .byte 4
  11. .byte 8
  12. .byte 16
  13. .byte 32
  14. .byte 64
  15. .byte 128

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.