
192 Cal.App.3d 504 (1987)
237 Cal. Rptr. 452
THE PEOPLE, Plaintiff and Appellant,
v.
DONALD ROBERT HEISLER, Defendant and Respondent.
Docket No. B023395.
Court of Appeals of California, Second District, Division Five.
June 5, 1987.
*505 COUNSEL
Ira Reiner, District Attorney, Harry B. Sondheim and Eugene D. Tavris, Deputy District Attorneys, for Plaintiff and Appellant.
No appearance on behalf of Defendant and Respondent.
OPINION
HASTINGS, J.
This is an appeal by the People (Pen. Code, § 1238, subds. (a)(5), (a)(6)) from an order waiving the penalty assessment on a $10,000 fine which was levied against defendant.
Defendant pleaded guilty to possessing cocaine for sale (count I  Health & Saf. Code, § 11351); to possessing methamphetamine for sale (count II  Health & Saf. Code, § 11378); and to possessing a pen gun in violation of Penal Code section 12020, subdivision (a) (count III). As to count I he was sentenced to state prison for the upper base term of four years; however, the sentence was suspended. As to counts II and III, the proceedings were suspended without imposition of sentence and probation was granted upon certain terms and conditions including that he pay a "fine of $10,000.00 plus assessment...."
Later, defendant admitted violating probation. The court revoked probation and reinstated it with the following modifications: "The defendant is ordered to serve nine months in county jail instead of the original six months that he was ordered to serve. [¶] In addition thereto, the court will waive the penalty assessment on the $10,000 fine...."
During the hearing the following colloquy occurred:
"MR. HOFMAN [deputy district attorney]: Your Honor, I would like to make one comment. [¶] It is my belief the court does not have the power to excuse *506 the payment of the penalty assessment because that is automatically imposed.
"MR. DE SALES [defense counsel]: Well, if that is the case, then I would make a motion to modify the terms of probation by reducing the substantive fine so that the penalty assessment would be included. [¶] Then, if the court were to impose a fine of $3000 or $4000, I think it would bring it up to about ten grand, but I think that is what the court had contemplated in the first place. [¶] If that's the People's position, and the court is inclined to agree, that would be my request.
"THE COURT: I don't agree with that.
"MR. DE SALES: In terms of 
"THE COURT: I don't agree with his statement."
(1a) The People now argue that "the assessment is mandatory and therefore that the trial court has no jurisdiction to waive it."
Under Penal Code section 1464, subdivision (a) "... there shall be levied an assessment in an amount equal to five dollars ($5) for every ten dollars ($10) or fraction thereof, upon every fine, penalty, or forfeiture imposed and collected by the courts for criminal offenses.... [¶](d) In any case where a person convicted of any offense, to which this section applies, is in prison until the fine is satisfied, the judge may waive all or any part of the assessment, the payment of which would work a hardship on the person convicted or his immediate family.... [¶](e) After a determination by the court of the amount due, the clerk of the court shall collect the same and transmit it to the county treasury...."
Here, the words of the statute, "there shall be levied an assessment" (Pen. Code, § 1464) are reasonably clear. (2a) "The word `shall' is ordinarily `used in laws, regulations, or directives to express what is mandatory.' [Citations.] `May,' on the other hand, is usually permissive." (Hogya v. Superior Court (1977) 75 Cal. App.3d 122, 133.) (1b) The Legislature is very aware of this distinction and used the word "shall" in levying the assessment. If the Legislature had intended that the court have discretion in the amount of assessment levied, it should have used the word "may."
(2b) It is true the word "shall" has sometimes been judicially construed as directory or permissive (see Governing Board v. Felt(1976) 55 Cal. App.3d 156, 161-163), however, in most cases "shall" imparts that its provisions are mandatory. (People v. Municipal Court (1956) 145 Cal. App.2d 767, 775.)
*507 "The test is this: `If to construe it as directory would render it ineffective and meaningless it should not receive that construction.' [Citations.] Thus, a statute was held to be mandatory where `to construe this provision of the section as directory merely would be to defeat the very purpose of its enactment.' [Citation.] `... [I]t appears that if public policy is in favor of the imperative meaning, the words referred to will be held mandatory.' [Citation.] `In construing a statute matters of substance are to be construed as mandatory.' [Citation.]" (People v. Municipal Court, supra, 145 Cal. App.2d 767, 776.)
It is also to be noted that where the Legislature has used both "shall" and "may" in the same section it must be presumed to have attached to them their ordinary meanings. (Cannizzo v. Guarantee Ins. Co. (1966) 245 Cal. App.2d 70 73; Hogya v. Superior Court, supra, 75 Cal. App.3d 122, 133, fn. 8.)
(1c) Here, section 1464, subdivision (a) provides that the assessment "shall be levied" while section 1464, subdivision (d) identifies a situation where the trial court "may waive ... the assessment."
Thus, it appears that the word "shall" was used in a mandatory sense. Otherwise, subdivision (d) would be meaningless since if the court could waive the assessment in the first instance there would be no need of an enactment specifically stating that it "may" do so in a certain situation.
Since the mandatory nature of the word "shall" precluded the superior court from waiving the penalty assessment on the fine imposed, the order of July 16, 1986, deleting the assessment must be reversed.
The order of July 16, 1986, is reversed and the cause remanded to the trial court for an appropriate determination consistent with this opinion.
Feinerman, P.J., and Ashby, J., concurred.
