xbox-scene.com - your xbox news information source
Quick Links: Main Forums | Xbox360 Forums | Xbox1 Forums | PS3 Forums
Xbox-Scene Forum Help  Search Xbox-Scene Forums   Xbox-Scene Forum Members   Xbox-Scene Calendar

Giganews Usenet Offers: +1150 days binary retention, 99%+ Completion, and Unlimited Speed/Access!

360 ODD Emulators: X360 Key $99 | Wasabi360 FAT $99 | Wasabi360 Slim $99
C4E's iXtreme Burner MAX Drive: LiteOn iHAS124 DROPPED TO JUST $17


Welcome Guest ( Log In | Register )

 Forum Rules Rules
 
Reply to this topicStart new topic
> 80x86 Assembly Programming Gurus, Need Advice
mazir
post May 21 2003, 10:16 PM
Post #1


X-S Enthusiast


Group: Members
Posts: 24
Joined: 8-April 03
Member No.: 31068



I've been cracking my head for 6 hours unable to figure this out. Does anyone know why the following procedure would go into an endless loop? Assume startDisplay is defined outside the procedure and all compiles.


PROC WAIT_1 FAR
pusha
push es
mov dx, [word 40H:006EH]
mov [startDisplay], dx

continue:
mov dx, [word 40H:006EH]
sub dx, [startDisplay]
cmp dx, 12H
je return
jmp continue

return:
pop es
popa
ret 4
ENDP WAIT_1


Any help would be much appreciated. I feel like I'm going crazy here.

Thanks in advance.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
rjm2k
post May 21 2003, 10:44 PM
Post #2


X-S Freak
*****

Group: Members
Posts: 1120
Joined: 10-October 02
Member No.: 4910



It's been a long time since I had to do any assembler, so I might be on the wrong track here, but as far as I can remember:-

PROC WAIT_1 FAR
pusha
push es
mov dx, [word 40H:006EH] 'Move the word at this address into DX
mov [startDisplay], dx 'Move the contents of DX into the address startDisplay

continue:
mov dx, [word 40H:006EH] 'Move the word at this address into DX (nb, DX now = startDisplay
sub dx, [startDisplay] 'submit startDisplay from DX, which should give 0
cmp dx, 12H 'compare dx with 12h
je return 'if dx = 12 (which it can't because it's 0) goto return
jmp continue 'go back to continue, which performs EXACTLY the same steps again with the same outcome

return:
pop es
popa
ret 4
ENDP WAIT_1

This post has been edited by rjm2k: May 21 2003, 10:44 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
mazir
post May 21 2003, 11:05 PM
Post #3


X-S Enthusiast


Group: Members
Posts: 24
Joined: 8-April 03
Member No.: 31068



Maybe I should add that the address 40H:006EH gets one added to it ever 1/18.2 seconds. It's the real time clock interrupt.

Sorry I didn't mention this earlier. Thanks for the reply.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
rjm2k
post May 22 2003, 07:17 AM
Post #4


X-S Freak
*****

Group: Members
Posts: 1120
Joined: 10-October 02
Member No.: 4910



QUOTE (mazir @ May 22 2003, 12:05 AM)
Maybe I should add that the address 40H:006EH gets one added to it ever 1/18.2 seconds. It's the real time clock interrupt.

Sorry I didn't mention this earlier. Thanks for the reply.

Maybe it's a timing issue, it could be skipping 12. Try using jump greater if there is one.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post





Reply to this topicStart new topic

 

Lo-Fi Version Time is now: 18th June 2013 - 06:52 AM