Whenever any shot is fired or missile thrown at or upon any body of the National Guard in the performance of any duty under the provisions of this chapter, it shall forthwith be the duty of every person in the assemblage from which the shot is fired or missile thrown immediately to disperse or retire therefrom, without awaiting any orders to do so. Any person knowing or having reason to believe that a shot has been fired or missile thrown from any assemblage of which such person forms a part, or where he is present, and failing, without lawful excuse to retire immediately from such assemblage, is guilty of a misdemeanor. Any person so remaining in such assemblage after being duly commanded to disperse, is guilty of a felony, and must, on conviction, be imprisoned in the penitentiary for not less than one year, nor more than two years.