Heeeelp before I shoot myself 
Author Message
 Heeeelp before I shoot myself

I have worked on some code for a while when 3 days ago it started
crashing. I have started stripping code untill a new behaviour
developped. It started to work as expected on the first try, but
subsequent invocations do not print out the segment register value.
The computer must be reset or Windows run for it to work once again.
The message being printed is not correct since I stripped out the
interrupt code.

If anyone feels like playing detective I have posted it on my page at:
http://www.*-*-*.com/ ~samirw/files/filelist.htm

Let me know if perhaps it works right on your machine.
It enters PM prints out register value, then a message and returns to
DOS.

Thanks a lot.
Sambo.



Wed, 05 Sep 2001 03:00:00 GMT  
 Heeeelp before I shoot myself

Quote:

> subsequent invocations do not print out the segment register value.

  That was a very complex way to convert a number to hex ascii.
You should look at other people's code an see some simpler
ways.

  I didn't try to figure it all out, but I noticed something
questionable.  You use si and esi in a way that will fail if
previous code left the high order bits of esi nonzero.  You
should use esi consistently.

do_byte:
    mov     si, temp_buff
;    jmp dn_fin
    ;*****************************

    push    eax
    call    BIO_byte_to_hex
    xchg    al,ah                        ;must flip the bytes since we
are
                                         ;storing it to wysiwyg buffer
using
                                         ;word store which puts it in
memory
                                         ;in reverse order
    mov      [si],ax
    add     esi,2
    pop     eax
    cmp     cl,1
    je      display_str
    xchg    ah,al
    call    BIO_byte_to_hex
    xchg    al,ah
    mov      [esi],ax

--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/



Wed, 05 Sep 2001 03:00:00 GMT  
 Heeeelp before I shoot myself
Quote:


> > subsequent invocations do not print out the segment register value.

>   I didn't try to figure it all out, but I noticed something
> questionable.  You use si and esi in a way that will fail if
> previous code left the high order bits of esi nonzero.  You
> should use esi consistently.

Yes, it was bx/Ebx. Eventhough long time ago I put an instruction to
clear the high word ( or intended to ), at one point I was confused and
changed it to OR BX,0x00007FFF (not EBX). Later, I realized that the
register names are absolute, not relative to the bits setting ( EBX is
always request for 32 bits, ) but since then haven't payed attantion to
that part of code to fix it.

I have however come across an curious situation. In my code I had couple
of lines for debuging purposes.  

the code:
bits 32

con_word:
    cmp     cl, 2
    jne     short do_byte
    xchg    al, ah
do_byte:
    mov     esi, temp_buff
    mov     [si+9],eax
    push    eax

cv disassembles the instruction:
mov [si+9],eax   as mov [ecx+1*ecx+50],ax ( 67 89 44 09 50 )

It looks like a cv bug, but I thought I run it by you just in case.
Look like cv gets confused by the prefix ( either one, and both ) in
this particular case. If I tell it to disassemble one byte later it is
MOV [SI+9], ax. The register names are reversed since CV does not have
bits 32 setting ( that's probably what contributed to my confusion while
back as did a message from you. )



Fri, 07 Sep 2001 03:00:00 GMT  
 Heeeelp before I shoot myself

Quote:

> bits 32
. . .
>     mov     [si+9],eax
. . .
> cv disassembles the instruction:
> mov [si+9],eax   as mov [ecx+1*ecx+50],ax ( 67 89 44 09 50 )

> It looks like a cv bug, but I thought I run it by you just in case.

  Probably not a cv bug.  I assume you did nothing to let
cv know that it was 32-bit code.  (I don't use cv myself,
so I have no idea what you *should* do to let in know it
was 32-bit code).  In an address 32 vs. 16 changes a lot
more than just the register sizes.  If you assemble one
way and disassemble the other, you can expect exactly
the garbage you got.
--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/


Fri, 07 Sep 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Heeeelp :-)

2. Heeeelp :-)

3. heeeelp, how do I

4. heeeelp!!

5. bsr r1,r2 Heeeelp

6. HEEEELP ! Looking for a memory dumper

7. Heeeelp! Cobol, windows 95 and Novell

8. heeeelp!

9. heeeelp - socket problem

10. Tk on solaris 2.4 (Heeeelp !)

11. Modification to File Loaded List Template - Answered Myself

12. XML Parser : an explanation to myself !

 

 
Powered by phpBB® Forum Software