Q:

What does mov bl do in assembly

Could you please explain how the following assembler code works?
xor ebx, ebx;
mov bl, byte ptr[ecx];
cmp ebx, 0;

I don't get it why you move byte to bl and afterwards you compare ebx and not bl.

A:

bl is the name of the low 8 bits (bits 7-0) in the ebx register. There is also bh which is the bits 15-8 of ebx, and bx is the low 16 bits (bits 15-0). There is no name for the higher 16 bits. 
This applies to all of the registers eax, ebx, ecx and edx. 
Given that ebx is first zero'd, the resulting code is probably the consenquence of the compiler doing compiling something like:
char ch;
const char str;
int i;
...
ch = str[i];
if (ch == 0) ... 

[Or possibly just if (ch)]. 
The extension to 32-bits would be caused by either "saves space" or "runs faster", or the fact that if (ch == 0) has an int on the right-hand side and needs to compare the value as int rather than as char = byte - I can't say which without seeing the original source code - and even then, the actual code-generation in the compiler quite a complex set of decisions, based on both "what runs fast on which processor" and "correctness according to the language".

