you'll be less impressed to know that the reason it thinks it's out of memory is because TWIN allocates handles sequentially, they always go up, by the time this code runs TWIN's counter is at 0x4100 ish.
SKI.EXE then, to generate a 1 for CreateBitmap, does mov AL, 1 assuming AH is 0 because on windows the handles are lower, so it always IS 0.
So it then tries to create a bitmap with 0x4101 planes instead of 1.
Nice that it errors, not so nice that it uses uninitialized memory.