ld hl, $C000 ; CRAM address $0000 with top two bits set to indicate a CRAM write ld c, $BF ; writing to control port out (c), l ; output address out (c), h ; ld a, $FF ; lower byte of color data out ($BE), a ; data port write, CRAM unchanged, latch = $FF ld hl, $C021 ; CRAM address $0021 with top two bits set to indicate a CRAM write ld c, $BF ; writing to control port out (c), l ; output address out (c), h ; ld a, $0F ; upper byte of color data out ($BE), a ; CRAM word at $0020 is now $0FFF, and the data at $0000 is unchanged.