Without seeing soms code it's not clear what you want to do.
Something like this ?
Code:
#include <stdio.h>

int main() {
    int x = -128;
    printf("=%2X\n", x & 0xff);
}
Kurt