Move 02 into the BL register. [O2] is the RAM address of the start of the data table. BL is used as a pointer to the data table.
MOV AL,[BL]
[BL] points to the data table. This line copies a value from the data table into the AL register.
OUT 01
Send the contents of the AL register to port 01. Port 01 is connected to the traffic lights.
CMP AL,58
58 is the last entry in the data table. If AL contains 58, it is necessary to reset BL to point back to the start of the table ready to repeat the sequence. If AL is equal to 58, the 'Z' flag in the CPU will be set.