Section 38A. Whoever obtains a building or construction loan, secured by a mortgage of real estate, for the payment for labor furnished or to be furnished and/or materials used and/or employed or to be used and/or employed in the construction, repair, removal or alteration of a building or other structure which is attached or is to be attached to such real estate, and, before payment in full for all labor furnished or to be furnished and/or materials used or to be used and/or employed or to be employed as aforesaid, applies the proceeds of such loan, or any part thereof, to any use other than payment for labor and/or materials as aforesaid, shall be punished by a fine of not more than five hundred dollars or by imprisonment in jail for not more than one year, or both.