Joined: 24 Aug 2004
Location: Misner space
If your goal is optimisation: The most optimal instruction is TEST. This is because there is no write back register resource allocated. With AND and OR each require a register to be written back. CMP requires more bytes to encode and thus pollutes the cache.
If your goal is something else: Use whichever instruction you are most comfortable with.
Last edited by revolution on 19 Dec 2006, 23:09; edited 1 time in total
some values are simplier and better tested with bitwise-operations -> *test* is considered the best way to test on zero val, also if we need to know is there some submask in val we cannot just use cmp. Wast variety of methods there are -> test on (-1= 0F...Fh) =
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum