flat assembler
Message board for the users of flat assembler.

Index > DOS > I have some strange results compiling in MZ with use32

Author
Thread Post new topic Reply to topic
defter



Joined: 01 May 2005
Posts: 2
defter 01 May 2005, 06:37
I have some strange error on compiling some simple code(there is only part):
Code:
format MZ
...
use32
mov edi,8
push ax
mov ax,dx
sal eax,16
pop ax
xor edx,edx
_trans_mul_next:
div edi
add dl,'0'
mov [bx],byte dl
xor dl,dl
dec bx
inc cx
or eax,eax
jnz _trans_mul_next
use16
    

In all disassemblers(TD, HexIt, BIEW, etc.) i get something like this(part that must be equivalent to one above):
Code:
000000DD  BF0800                        mov     di,08   ; ' •'
000000E0  0000                          add     [bx+si],al
000000E2  6650                          push    eax
000000E4  6689D0                        mov     eax,edx
000000E7  C1E010                        shl     ax,010
000000EA  6658                          pop     eax
000000EC  31D2                          xor     dx,dx
000000EE  F7F7                          div     di
000000F0  80C230                        add     dl,030  ; '0'
000000F3  678817                        mov     [edi],dl
000000F6  30D2                          xor     dl,dl
000000F8  664B                          dec     ebx
000000FA  6641                          inc     ecx
000000FC  09C0                          or      ax,ax
000000FE  75EE                          jnz     short 0000000EE
    

Can you explain me is there some my mistake in code or fasm somehow incorrect compiles 32-bit instructions in MZ format or may be i must use some different disassembler/debugger?
P.S. Compiled file gives incorrect results.


Last edited by defter on 01 May 2005, 08:01; edited 1 time in total
Post 01 May 2005, 06:37
View user's profile Send private message Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen 01 May 2005, 07:11
It is your mistake. Just remove use32 directive and it should work.

Under MS-DOS, the code is always executed as 16-bit, but you can, of course, use 32-bit registers.

BTW, the documentation says that we can use "use32" also with MZ executable, but I really don't know when it could be useful Sad

_________________
x86asm.net
Post 01 May 2005, 07:11
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 01 May 2005, 08:00
it could be useful when 32-bit dos extenders used. to compiler it tells default sizes for call/jmp/push/pop operands.
Post 01 May 2005, 08:00
View user's profile Send private message Visit poster's website Reply with quote
defter



Joined: 01 May 2005
Posts: 2
defter 01 May 2005, 08:02
Thank you MazeGen, now it works right.
Post 01 May 2005, 08:02
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8353
Location: Kraków, Poland
Tomasz Grysztar 01 May 2005, 08:11
MazeGen: see the USEDPMI example in the DOS package.
Post 01 May 2005, 08:11
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen 01 May 2005, 08:38
Yeah, thanks for explanation Smile
Post 01 May 2005, 08:38
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.