Assembly code snippets

Back to the snippets overview

Details

TitleMeasure size of a code piece
AuthorThomas
Submitted by:Thomas
Date added:2003-03-22 12:15:20
Date modified:2003-03-22 12:15:20

Comments

These macros show the size of a code piece at assemble time.. Usage:
MCS_START <Piece 1>
xor eax, eax
MCS_END

Snippet

MCS_START macro name:REQ
local mcsLabelName
    MCS_CUR_NAME textequ <name>
    MCS_CUR_START_LABEL textequ <mcsLabelName>
mcsLabelName:
endm

MCS_END macro
local mcsCodeSize
%   mcsCodeSize textequ %(- MCS_CUR_START_LABEL)
%   echo MCS_CUR_NAME: mcsCodeSize byte(s)
endm