News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

wired issue with fda.

Started by RastaMag, January 21, 2014, 02:59:37 AM

Previous topic - Next topic

RastaMag

when playing with masm32's fda i notice that i cannot get it to successfully generate a exe. with embedded data, with any file that is over 2k in bytes. if the file size is under 2k bytes it works fine for creation on exe with a embedded coff object .

any suggestions. ? 

hutch--

FDA is designed to produce an object module, not an executable.

Check out the technical data when you run it from the command line.


File Data Assembler 2.0 Copyright (c) The MASM32 Project 1998-2005

PARAMETERS
      1 source file
      2 target object file
      3 data label name
      4 data alignment [optional]

NOTES
      Source file MUST be an existing file
      Target file MUST have an "obj" extension
      The optional data aligment MUST be specified in powers of 2
      Alignment range is 1 to 8192 bytes, default is 4 bytes.
      Long names are supported but names with spaces MUST be
      enclosed in quotations.
OUTPUT
      fda.exe produces two (2) files,
      a. An object module file as named in the target.
      b. An INCLUDE file of the same name as the target
         which contains an EXTERNDEF for the data label
         name and an equate that contains the bytecount
         for the data in the object module.
EXAMPLE
      fda "My Source File.Ext" target.obj MyFile 16

RastaMag

yes i know it is made to link objects to a exe @ compile time but what im saying, is after using fda to make a obj.file  if the source file used to make obj is bigger the 2k bytes when i try to link data obj file with Polink it does not produce a exe with linked obj. now if data obj made with fda is smaller then 2K in bytes polink will link Obj and make a complied exe.

hutch--

There is something wrong with how you are doing it then as the object modules are effectively unlimited in size. The MASM32 installation uses a single object module made with FDA that is over 3.5 megabytes in size.

RastaMag

well im using this as a example

http://masm32.com/board/index.php?topic=551.0

but when i try to link obj to exe with said example file.

i cant generate exe

if someone could give me a example of how to correct link and call / use data .obj that would be nice.

as i said i cant get the Example in the above thread to working with a file More then in 2k bytes.

thanks Rm 

hutch--

I will come back to you a bit later, I am currently doing a very large partition backup to another machine so I can't safely use the file system at the moment.

dedndave

may we see the code you are using to load the resource data ?
the problem could be there

hutch--

The problem is simple, it would appear that you did not link the separate object module. The following batch file shows you how its done. The EXE is "fdatest.exe" and the object module created by FDA is win32.obj" which was created from the old 12.6 meg help file.


@echo off

if not exist rsrc.rc goto over1
\masm32\bin\rc /v rsrc.rc
\masm32\bin\cvtres /machine:ix86 rsrc.res
:over1

if exist "fdatest.obj" del "fdatest.obj"
if exist "fdatest.exe" del "fdatest.exe"

\masm32\bin\ml /c /coff "fdatest.asm"
if errorlevel 1 goto errasm

\masm32\bin\PoLink /SUBSYSTEM:CONSOLE /OPT:NOREF "fdatest.obj" "win32.obj"
if errorlevel 1 goto errlink
dir "fdatest.*"
goto TheEnd

:errlink
echo _
echo Link error
goto TheEnd

:errasm
echo _
echo Assembly Error
goto TheEnd

:TheEnd

pause


Here is the test piece that shows how it works.


IF 0  ; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
                      Build this template with "CONSOLE ASSEMBLE AND LINK"
ENDIF ; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    include \masm32\include\masm32rt.inc
    include win32.inc

    .code

start:
   
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    call main
    inkey
    exit

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

main proc

    LOCAL rval  :DWORD

;     EXTERNDEF win32:DWORD        << this is the content of the included win32.inc
;     ln_win32 equ <12607331>

  ; -----------------------------------------------------------
  ; write the data at OFFSET win32 at length "ln_win32" to disk.
  ; -----------------------------------------------------------
    mov rval, OutputFile("win32copy.hlp",OFFSET win32,ln_win32)

  ; ------------------------------
  ; display the written byte count
  ; ------------------------------
    print ustr$(rval),13,10

    ret

main endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

end start