Yes. Direct contempt does not necessarily require the court to instruct a party to refrain from some action, though most judges would probably give you a warning. Telling the prosecutor to fuck himself is likely to land you in jail even if nobody has expressly told you not to say that.