CheckSlot: ld hl,$0000 ; look at ROM from $0000 ld bc,$003c ; loop 256 times, mask $3c ld a,(hl) ; get byte and c ; and with $3c = %00111100 ld e,a ; store in e Loop: ld a,(hl) ; get byte inc l ; pointer++ and c ; and with $3c cp e ; compare to first byte jp nz,$0000 ; if not equal, run slot djnz Loop ; repeat 256 times ret ; Nothing found