code segment
     assume cs:code,ds:code,es:nothing,ss:nothing
     org 100H
start: mov ax,code
       mov ds,ax
       jmp begin
begin:    CLI
          MOV DX,NUMCYC
          IN  AL,PORT_B
          AND AL,11111110B
NEXT  :   OR AL,00000010B
          OUT PORT_B,AL
          MOV CX,FRE1
FIRST :   LOOP FIRST
          AND AL,11111101B
          OUT PORT_B,AL
          MOV CX,FRE2
SECOND:   LOOP SECOND
          DEC DX
          JNZ NEXT
          STI
 NumCyc    EQU  300
 Fre1      EQU  50
 Fre2      EQU  3200
 PORT_B    EQU  61H
code  ends
      end start