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

Binary into char

Name: Anonymous 2009-02-08 20:18

/prog/,

I have traveled far and wide to seek your wisdom. I'm currently writing a program in assembly that involves some bit manipulation. Basically what I need to do figure out is how to store binary data into a char (8 bits). For example, how would I store 0000 0001 into a char variable?

Thank you kind /prog/

Name: Anonymous 2009-02-08 20:38


data:
    db "00001111", 0
_main:
    xor edx, edx
    mov ebx, data
    xor eax, eax
    mov al, [ebx]
.loop:
    cmp al, '0'
    je .over
    or  edx, 1
.over:
    shl edx, 1
    inc ebx
    mov al, [ebx]
    or  al, al
    jnz .loop

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