You can compare two values in memory using the CMPSD instruction.
Op wants to do something equivalent to:
cmpl -4(%ebp), 4(%ebp)
He can do that by placing the addresses of the memory locations of interest in ESI and EDI respectively, and then using the CMPSD memory-to-memory string-compare instruction:
lea -4(%ebp), %esi
lea 4(%ebp), %edi
cmpsd
(forgive my non-expert abuse of AT&T syntax).
That's different than anybody would do this in practice. The other answers provided here (load a value into a register and compare) are much more practical. If nothing else, those solutions only burn one register, and this hack burns two.
Lesson: in assembler, there's almost always more than one way to skin a cat.