
588 S.W.2d 226 (1979)
Fred J. HART, Appellant,
v.
STATE of Missouri, Respondent.
No. KCD 30371.
Missouri Court of Appeals, Western District.
October 1, 1979.
*227 Clifford A. Cohen, Public Defender, Kansas City, for appellant.
John D. Ashcroft, Atty. Gen., Jefferson City, Hope E. Thurrott, Sp. Asst. Atty. Gen., Kansas City, for respondent.
Before SHANGLER, P. J., and SWOFFORD and CLARK, JJ.
SHANGLER, Presiding Judge.
The petitioner, in forma pauperis, brought a pro se Motion to Modify Court Order. The motion was without further designation. The pleading alleged that upon indictment by the Grand Jury he was let to bail on condition that he submit for admission to the Research Hospital in Kansas City [for what purpose does not appear] and that he not leave that confinement "until approved by the court." Thereupon, the pleading continues, he was "admitted to this hospital and placed on 7-wing west, a locked ward." The petitioner was thereafter sentenced by the court and committed to the Division of Corrections. The pleading concludes with the prayer that the petitioner be given credit for the 60 days of confinement in the locked ward at Research Hospital ordered by the court as a condition of bail.
The court entered a summary denial of the motion, without hearing, or statement of reason or legal ground. The pleading was dismissed without determination of the affidavit of poverty, option for amendment or appointment of counsel.
The petitioner was sentenced [according to allegation] on February 23, 1977, and the motion was brought on June 26, 1978, so the action was for post-conviction, not post-trial, relief. The form was not as sanctioned by Rule 27.26(c) but that the remedy sought was the mandatory effect of § 546.615, which accords to a convicted felon credit on the sentence for "all time spent by him in prison or jail . . . awaiting trial," seems clear enough. Nor does there seem doubt that the Rule 27.26 procedure, fashioned as the inclusive post-conviction remedy [Wiglesworth v. Wyrick, 531 S.W.2d 713, 715[1] (Mo. banc 1976)], accommodates the contention the motion pleads. Shepherd v. State, 529 S.W.2d 943, 948[10] (Mo. App.1975); Gregg v. Wyrick, 449 F.Supp. 969, 971[3, 4] (W.D.Mo.1978).[1]
The question remains whether the allegations of the motion, by whatever designation, pleads a cause of action for post-conviction relief so as to entitle the petitioner to pose the claim by an acceptable form, an appointment of counsel and an adjudication according to the method of the rule.
A salient purpose of the enactment of § 546.615 is to ensure that an indigent accused who awaits trial shall not serve a longer term for the same sentence than an accused able to meet bail to avoid confinement before trial and sentence. Gregg v. Wyrick, supra. Thus, the provisions of § 546.615 do not apply to credit sentence during the time the accused is free at bail. Beaver v. State, 543 S.W.2d 787, 788 (Mo.App.1976); State v. Carr, 567 S.W.2d 422, 423 (Mo.App.1978).
The contention of the petitioner for credit on sentence for the time spent in hospital confinement during the pretrial [presumably, mental] examination regimen, *228 [2] therefore, depends upon whether the conditions for that confinement amounted to a suspension of bail. The allegations, taken as true, plead that he was admitted to bail on condition "that he be admitted to Research Hospital . . . and that he not be permitted to leave until approved by the court." The motion pleads further that the petitioner was admitted to the hospital, kept in a locked ward, and after stay, was permitted to leave only on compliance with an increase in bail from $10,000 to $40,000 as ordered by the court.[3] These conditions of confinement, assumed as true, describe that serious curtailment of freedom of movement and personal liberty to which persons under the regulation of a "prison or jail" must submit.
The authorities agree that the nature of the confinement rather than the place determines whether the time of the accused has been spent in "prison or jail" under comparable statutes. See: Annot., 77 A.L. R.3d 260: Time Credit for Preconviction Custody (1977). The ancient perception of Lord Coke that "[h]e that is in the stockes, or under lawful arrest, is said to be in prison, although he be not infra parietes carceris" [Second Institutes, p. 589] has been given effect to credit the pretrial stay by an accused in a hospital. People v. Noble, 26 Misc.2d 903, 207 N.Y.S.2d 467, 468[1] (1960); People v. Cowsar, 40 Cal.App.3d 578, 115 Cal.Rptr. 160, 161 (1974). A virtually unanimous opinion accords to "prison or jail" under statutes of the purpose of § 546.615 a meaning to include time spent in a hospital to determine unfitness to proceed or incapacity for criminal conduct from mental condition. Re Estate of Schneider, 130 Ill.App.2d 440, 264 N.E.2d 805 (1970); People v. Gravlin, 52 Mich.App. 467, 217 N.W.2d 404 (1974) and other cases cited in the 77 A.L.R.3d 260 Annotation, at 262.
The case of Harkins v. Wyrick, 589 F.2d 387 (8th Cir. 1979) cited by the State does not alter the effect or sense of these precedents. That court merely denied the claim that constitutional protection of the laws entitled him to jail time credit on a Missouri sentence for time spent in a federal hospital awaiting trial on a federal charge. The contention of the motion, however, pleads a claim for credit to jail time under the terms of the Missouri statute on a Missouri sentence, and not under claim of constitutional right. The terms "prison or jail" as used in § 546.615 describe places of confinement and do not preclude other lawful places of detention by comparable means.
The motion pleads a cause of action for Rule 27.26 relief, but not in a form a court need entertain. The dismissal of the Motion to Modify Court Order is affirmed but without prejudice to a motion under Rule 27.26 to correct judgment on the cause of action previously alleged. The petitioner upon such a formal motion pleaded shall be entitled to appointment of counsel to adjudicate that question of law. Fields v. State, 572 S.W.2d 477 (Mo. banc 1978); Rule 27.26(h).
All concur.
NOTES
[1]  These cases assumequite correctlybut without reference to specific rule language that the claim for credit for jail time served before sentence falls within the purview of Rule 27.26. The provision of rule which allows a prisoner in custody under sentence the post-conviction procedure for such a claim is, most aptly, the clause: "that [the] sentence [was in excess of the maximum sentence authorized by law] or is otherwise subject to collateral attack." The complaint of the petitioner relates, not to the trial process, but to the legality of the judgment imposed, and so falls within the literal enablement of Rule 27.26(a) and outside the exclusions of Rule 27.26(b).
[2]  The motion pleads a sixty-day hospital confinement, but the interval alleged amounts to only forty-eight days by actual count.
[3]  A court, of course, may order commitment of an accused to a hospital, under conditions, for a mental examination under § 552.020. Neither the record nor the briefs describe the purpose of the hospital confinement, but we assume, from the very conditions pleaded, that the order of the court proceeded under § 552.020.
