News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

binary zero in list file

Started by jimg, June 17, 2017, 01:15:18 AM

Previous topic - Next topic

jimg

Uasm occasionally puts a binary zero character in the output listing, which makes my editor think it's a binary file and it then goes into dump mode.

eg.

The following program-

.686
.model Flat, Stdcall
option Casemap :None   

t1 equ -1

.code
program:
    ret
end program


assembled with the options:    /nologo /c /coff /Cp /Fl /Sn /Sg

produces the listing that looks like -
UASM v2.36, Jun  8 2017
F:\WinAsm\Progs\AMiscTests\smalltest\tst.asm
                                .686
                                .model Flat, Stdcall
00000000                    *   _TEXT segment PARA FLAT PUBLIC 'CODE'
                            *   _TEXT ends
00000000                    *   _DATA segment PARA FLAT PUBLIC 'DATA'
                            *   _DATA ends
                            *   assume cs:flat,ds:flat,ss:flat,es:flat,fs:ERROR,gs:ERROR
                                option Casemap :None   

= FFFFFFFF                     t1 equ -1

                                .code
00000000                    *   _TEXT segment
                            *   assume cs:FLAT
00000000                        program:
00000000  C3                        ret
                                end program
00000001                    F:\WinAsm\Progs\AMiscTests\smalltest\tst.asm: 10 lines, 2 passes, 0 ms, 0 warnings, 0 errors


however, if you dump the .lst file, at byte 236h there is a binary zero

This is the way my editor sees the file
          00000200h: 20 20 20 6F 70 74 69 6F 6E 20 43 61 73 65 6D 61 ;    option Casema
          00000210h: 70 20 3A 4E 6F 6E 65 20 20 20 20 0D 0A 0D 0A 20 ; p :None    ....
          00000220h: 3D 20 46 46 46 46 46 46 46 46 20 20 20 20 20 20 ; = FFFFFFFF     
          00000230h: 20 20 20 20 20 20 00 20 20 20 20 20 20 20 20 74 ;       .        t
          00000240h: 31 20 65 71 75 20 2D 31 0D 0A 0D 0A 20 20 20 20 ; 1 equ -1....   
          00000250h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ;                 
          00000260h: 20 20 20 20 20 20 20 20 20 20 20 20 2E 63 6F 64 ;             .cod
          00000270h: 65 0D 0A 30 30 30 30 30 30 30 30 20 20 20 20 20 ; e..00000000     

habran

Hi jimg :biggrin:
Sorry, busy  :dazzled:
Good find :t
It looks like uasm skips first byte when starting constants
will look at it
Cod-Father

johnsa

Hi,

This is fixed in 2.37 which is now available for download.

jimg

Thank you.  Your quick support is much appreciated:)

jimg

Found more binary zeros  :(

.686
.model Flat, Stdcall
option Casemap :None   ; case sensitive

.data
db 1
LastBit  equ $

    maxsize=40
    chkstart=$
    nxt=$+maxsize
    mov edx,[eax]

.code
Program:
ret
end Program


produced 3 of them-  see bytes 120h, 182h and 1b2h

00000000h: 55 41 53 4D 20 76 32 2E 33 37 2C 20 4A 75 6E 20 | UASM v2.37, Jun
00000010h: 32 30 20 32 30 31 37 0D 0A 74 65 73 74 2E 61 73 | 20 2017..test.as
00000020h: 6D 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 | m..             
00000030h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                 
00000040h: 20 20 20 2E 36 38 36 0D 0A 20 20 20 20 20 20 20 |    .686..       
00000050h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                 
00000060h: 20 20 20 20 20 20 20 20 20 2E 6D 6F 64 65 6C 20 |          .model
00000070h: 46 6C 61 74 2C 20 53 74 64 63 61 6C 6C 0D 0A 20 | Flat, Stdcall..
00000080h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                 
00000090h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6F |                o
000000A0h: 70 74 69 6F 6E 20 43 61 73 65 6D 61 70 20 3A 4E | ption Casemap :N
000000B0h: 6F 6E 65 20 20 20 3B 20 63 61 73 65 20 73 65 6E | one   ; case sen
000000C0h: 73 69 74 69 76 65 0D 0A 0D 0A 20 20 20 20 20 20 | sitive....     
000000D0h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                 
000000E0h: 20 20 20 20 20 20 20 20 20 20 2E 64 61 74 61 0D |           .data.
000000F0h: 0A 30 30 30 30 30 30 30 30 20 20 30 31 20 20 20 | .00000000  01   
00000100h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                 
00000110h: 20 20 64 62 20 31 0D 0A 30 30 30 30 30 30 30 31 |   db 1..00000001
00000120h: 00 20 3D 20 31 20 20 20 20 20 20 20 20 20 20 20 | . = 1           
00000130h: 20 20 20 20 20 20 20 20 4C 61 73 74 42 69 74 20 |         LastBit
00000140h: 20 65 71 75 20 24 0D 0A 0D 0A 20 3D 20 32 38 20 |  equ $.... = 28
00000150h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                 
00000160h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6D 61 |               ma
00000170h: 78 73 69 7A 65 3D 34 30 0D 0A 30 30 30 30 30 30 | xsize=40..000000
00000180h: 30 31 00 20 3D 20 31 20 20 20 20 20 20 20 20 20 | 01. = 1         
00000190h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 68 |               ch
000001A0h: 6B 73 74 61 72 74 3D 24 0D 0A 30 30 30 30 30 30 | kstart=$..000000
000001B0h: 30 31 00 20 3D 20 32 39 20 20 20 20 20 20 20 20 | 01. = 29       
000001C0h: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6E 78 |               nx

jimg

oops.  picked up wrong file.  If you already read the preceding message, I updated it with the correct dump.  Only 3 binary zeros.

jj2007

Resurrecting old threads is a bad habit, I know, but it fits - UAsm inserts 0A  0D 0A before TmpFile.asm:
UASM v2.48, Feb 13 2019, Masm-compatible assembler.

Tmp_File.asm


65 72 2E 0A  0D 0A 54 6D  70 5F 46 69  6C 65 2E 61  er....Tmp_File.a

This happens exactly once, and it's normally not a problem, but it confused a routine to autodetect the end of line encoding:
13 10 Windows
13 Mac
10 Linux