help my error

spkenn5's Avatar, Join Date: Dec 2006
Newbie Member
hi guys, im having problem in making my fibonacci sequence, so far i've had the code to do everything i wanted except when i try to add eax with ebx, 00000008 + 00000005 it resulted 0000000D instead of 00000013. i wonder what did i do wrong. this is my first time taking the course. here's the code

Code:
INCLUDE C:/Irvine/Irvine32.inc

.data
counter DWORD 12
int1 DWORD 0d
int2 DWORD 1d
nextNum DWORD ?


.code
main PROC
	
	mov		eax,int1		;
	call	DumpRegs		; showing F0 
	mov		eax,int2		;
	call	DumpRegs		; showing F1
	mov 	ecx,11		; setting the amount of loop

	
L1:
	mov eax,int1		; eax = 0
	mov ebx,int2		; ebx = 1
	add	eax,ebx			; eax = 1 + 0 
	mov nextNum,eax 	; nextNum = eax = 1
	mov int1,ebx		; eax = 1
	mov int2,eax	 	; ebx = 1
	call DumpRegs		; show the registers
	
	loop L1

			
	exit
main ENDP

END main
thanks
0
virxen's Avatar, Join Date: Nov 2009
Pro contributor
Quote:
Originally Posted by spkenn5 View Post

00000008 + 00000005 it resulted 0000000D instead of 00000013
8(hex)+5(hex)=0D(hex)
8(dec)+5(dec)=13(dec)
0
spkenn5's Avatar, Join Date: Dec 2006
Newbie Member
i noticed that, is it possible for the dumpregs to show it in decimal instead of hex?

thanks