section "home/math.asm", rom0 bits_swap:: ld c, $80 ld b, a xor a .loop rrc b jr nc, .skip or c .skip rrc c jr nc, .loop ret divide:: ld b, 0 .loop inc b sub c jr nc, .loop dec b add c ret