implement macro record

implement macro record in memory