The cassette input and output is based on square wave signals. The cassette out is generating a square wave signal by switching the Q flag between 0 and 1. The cassette input is linked to the EF2 flag.
Every bit is generated either by a high or low square tone to represent a 0 or 1. Where the start tone is a long square wave with a high tone, followed directly by all program data.