C Screen Colors
We are learning creating an OS from scratch. Our lecturer gives us some codes and some of them contains some codes about colors but i cannot understand them. Please explain them for me...

    u8int  attributeByte = (backColour << 4) | (foreColour & 0x0F);
    u16int attribute = attributeByte << 8;

And he ask us a question last year in final exam. Question is

    u8int  attributeByte = (10 << 4) | (8 & 0x0F);
    u16int screenchar = 0x6B | (attributeByte<<8);

after execution of the above lines, what would screenchar variable become. Put your answer below.

    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
C Screen Colors
===

We are learning creating an OS from scratch. Our lecturer gives us some codes and some of them contains some codes about colors but i cannot understand them. Please explain them for me...

    u8int  attributeByte = (backColour << 4) | (foreColour & 0x0F);
    u16int attribute = attributeByte << 8;

And he ask us a question last year in final exam. Question is

    u8int  attributeByte = (10 << 4) | (8 & 0x0F);
    u16int screenchar = 0x6B | (attributeByte<<8);

after execution of the above lines, what would screenchar variable become. Put your answer below.

    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 