moved address manipulation functions from bsnip to bam