Is it possible to draw bitmaps using masks (AND with the black mask first and then OR with the image) in palettized color systems like mode 13h graphics?

Can't get my head around it.