Thanks for query.
As you passed black stool
means there is some bleeding from your GI tract and you have got severe pain
in upper stomach,it seems that you might be having Acute Gastritis
or gastric ulcer.
Go for stool test and ultra sound
You are advised to go to ER.
Mean while you can take anti spasmodic medicine and Omiprazole or Pentaprazole.
Ok and bye.