1 Replies - 234 Views - Last Post: 21 July 2014 - 02:57 PM

#1 Foxxy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-July 14

TEST edx,edx and JNS jumps a variable amount of times?

Posted 21 July 2014 - 01:49 AM

Hello, I am having a very strange problem. I am attempting to write a CRC32 program in assembly. However, I need to check the result of the
test edx,edx
instruction, I am using the JNS (jump not sign) to determine if
if(remainder & (1 << 31) 
was 'successful'. This seems to me to be a very strange way of doing things, but I disassembled the program I am basing this one off of, and that was what the compiler generated. However, just to make sure, I manually did
test remainder, 80000000h
. However, the amount of times it would pass through the jump changed almost every time the program was run. The results are always close to each other, and are usually off by 1-5. On a side note, on smaller files, it is never off. Please help me find and eradicate this annoying bug.

The rest of my code is located here: http://pastebin.com/NKheU0Bt
(I am aware it is a mess)

Is This A Good Question/Topic? 0
  • +

Replies To: TEST edx,edx and JNS jumps a variable amount of times?

#2 Foxxy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-July 14

Re: TEST edx,edx and JNS jumps a variable amount of times?

Posted 21 July 2014 - 02:57 PM

Solved, loaded wrong register.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1