Current location: Hot Scripts Forums » Programming Languages » Other Languages » Assembly Language Displaying in Dec format


Assembly Language Displaying in Dec format

Reply
  #1 (permalink)  
Old 04-20-09, 12:20 PM
chickevil666's Avatar
chickevil666 chickevil666 is offline
New Member
 
Join Date: Apr 2009
Location: Lancaster, CA
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Assembly Language Displaying in Dec format

Okay first and foremost yes this is homework, but no I'm not asking you to do it for me.

I am attempting to calculate a Fibonacci sequence stopping once the overflow flag has been set. I can display it with call DumpRegs and it does indeed stop once the overflow flag has been set. Telling me that my code (for the most part) is correct. But when I switch that command to WriteDec it just displays what appears to be random numbers never stopping. What can I do to correct this? What am I doing wrong to cause this? I have tapped out my resources and I don't know what to do .

Here is the code in question:



Code:
INCLUDE Irvine32.inc
.data
num1	DWORD	0b ;the first value of num1
num2	DWORD	1b ;the first value of num2

.code
main PROC

	mov	eax,0	;Sets eax to 0 so that no previous values cause misscalculations
	

	.REPEAT
	mov	eax,num1	;moves the value of num1 to eax
	add	eax,num2	;adds the value of num2 to eax
	xchg num2,eax	;switches eax with the value of num2 so that eax equals what num2 used to and num2 equals what eax used to
	xchg num1,eax	;switches eax with the value of num1 so that eax equals what num1 used to and num1 equals what eax used to
	call DumpRegs
	.UNTIL OVERFLOW?
	
	
	exit
main ENDP

calc PROC uses EAX

	
calc ENDP

END main
Reply With Quote
  #2 (permalink)  
Old 04-20-09, 01:06 PM
chickevil666's Avatar
chickevil666 chickevil666 is offline
New Member
 
Join Date: Apr 2009
Location: Lancaster, CA
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Also I am setting the commands call DumpRegs and Call WriteDec from Irvine32.inc that came with my book.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
assembly language easy, need help duke7575 Other Languages 0 04-07-09 10:38 PM
Assembly Language Help please nito28 Other Languages 0 02-05-09 09:58 PM
How to build a binary tree in assembly language? phingphing Other Languages 0 11-04-08 07:15 AM
Debounce switch using assembly language Laravinya Other Languages 0 04-29-07 03:37 PM
Assembly Language question jessicayan Other Languages 1 02-13-07 03:07 PM


All times are GMT -5. The time now is 03:45 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.