The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: ecube on June 06, 2007, 05:27:32 PM

Title: how does uses work exactly?
Post by: ecube on June 06, 2007, 05:27:32 PM
test proc uses ecx eax


?
Title: Re: how does uses work exactly?
Post by: hutch-- on June 06, 2007, 05:33:15 PM
cube,

The USES notation automates the preervation of registers in and out of a procedure including multiple exit locations in that procedure. If you have,


USES ESI EDI    ; in your procedure

push esi
push edi

; then anywhere where there is a RET

pop edi
pop esi


Personally I would recommend learning how to use them manually as you get cleaner exits and you can use a single exit as a collector to avoid duplication.