Ow, tricky. I'm imagining this is something a soldier might exclaim to his sergeant as the soldier stands to attention, no?
I think:
'Sir, yes, sir!'
Why?
We would say 'Yes, sir!'
We would say 'Sir,' before introductions.
Therefore, I'd combine the two:
'Sir, yes, sir!'
There is no need for a capital 'Sir' since you are not talking to Sir Ben Kingsley although he'd make a great, psychotic sergeant.