What's the difference between TEST and CMP ?

From: sugaray (ruicui_at_sohu.com)
Date: 02/28/04


Date: Fri, 27 Feb 2004 23:00:05 +0000 (UTC)

Hi, I'm a rookie in assembly language, this
question just came up my mind, so I post it
here in the hope that someone would explain
more details about the topic.

when test to see if a variable contains
a zero value, people ususally use

 TEST reg,reg
 JZ Lable1

alternatively,

 CMP reg,0
 JE Label1

is also correct,
So, what's the difference ?
and any other important things which pertinent
is also welcome here. thanx in advance :))))