What went wrong?

Programming, for all ages and all languages.
Post Reply
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

What went wrong?

Post by quanganht »

I have a piece of code...

Code: Select all

	lea     si, [kernelname]
        lea     di, [name2]

        mov ecx, 10

CmpStrs:
        cld
        repe    cmpsb
        jne     StrsNotEqual

	lea  si,[msg2]
	CALL print
	
	jmp $

StrsNotEqual:
	lea  si,[msg3]
	CALL print
	jmp $

msg2 DB "equal!",10,13,0
msg3 DB "not equal!",10,13,0
kernelname DB "kernel.bin"
name2 DB "kernel.bin"
Althought it is supposed to print "equal!", it just keeps print "not equal!". Can anybody point out the wrong part?

EDIT: can someone move this thread to the correct place?
"Programmers are tools for converting caffeine into code."
Gigasoft
Member
Member
Posts: 855
Joined: Sat Nov 21, 2009 5:11 pm

Re: What went wrong?

Post by Gigasoft »

A possible reason could be that ES does not point to the correct segment.
bitshifter
Member
Member
Posts: 50
Joined: Sun Sep 20, 2009 4:03 pm

Re: What went wrong?

Post by bitshifter »

les
lds
Gigasoft
Member
Member
Posts: 855
Joined: Sat Nov 21, 2009 5:11 pm

Re: What went wrong?

Post by Gigasoft »

No, LES and LDS don't work that way.
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Re: What went wrong?

Post by quanganht »

yeah. I'll try clearing both ES and DS

EDIT: Worked
"Programmers are tools for converting caffeine into code."
Post Reply