News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

assembly error in MASM example

Started by Gonzo, November 05, 2005, 03:47:52 PM

Previous topic - Next topic

Gonzo

I edited STRIPCC.ASM in masm32\examples\example10\console, inserted a .nolist to avoid listing the includes, a .listall after that and made no other changes.  Assembly listing follows with excerpted relevant statements.  The code looks good to me, however, the error persists, and the value generated in the first lea looks bogus.  Any ideas/help?

                             
            read_disk_file    PROTO :DWORD,:DWORD
     

                                    LOCAL hInput$      :DWORD   ; input buffer handle
   
    LOCAL infile [260] :BYTE    ; input file name buffer
   

    invoke read_disk_file,ADDR infile,ADDR hInput$
C:\masm32\examples\EXAMPL10\CONSOLE\STRIPCC\STRIPCC.asm(82) : error A2137: too few arguments to INVOKE
000000A5  8D 45 FC    *     lea    eax, dword  ptr ss:[ebp]+0FFFFFFFCh
000000A8  50    *     push   eax
000000A9  8D 85 FFFFFEEC  *     lea    eax, byte  ptr ss:[ebp]+0ECh
000000AF  50    *     push   eax
000000B0  E8 000000BE    *     call   read_disk_file
000000B5  89 45 F4     mov lof, eax


Thanks for your help.

Gonzo

raymond

Look at the description of the read_disk_file function in the MASM32 library reference. You will notice that it requires 3 parameters. Also look at the description of those parameters. Then, if there is anything which is not clear enough, ask for more clarifications.

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

Gonzo

Quote from: raymond on November 05, 2005, 04:39:45 PM
Look at the description of the read_disk_file function in the MASM32 library reference. You will notice that it requires 3 parameters. Also look at the description of those parameters. Then, if there is anything which is not clear enough, ask for more clarifications.

Raymond


Raymond, thanks for the response.

I assumed (the great error) that the read-disk-file prototype statement within the program had precedence.  Actually, I didn't know there was a MASM32 function by the same name.  Is there therefore no need for the statement within the source code, or is it in error?  It looked to me like the intent of the author of the source was to define a proc only within the program by the name of read-disk-file since that proc opens the file and reads it into memory.  Should not that local proc have precedence?

Gonz

hutch--

Gonzo,

Thanks for finding this problem, I missed the name overlap when I added the library module later. To fix the problem just change the name of the function to "read_diskfile" so that it does not overlap with the library module and it builds correctly. I will have this fixed in the next version.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Gonzo

Quote from: hutch-- on November 05, 2005, 07:19:25 PM
Gonzo,

Thanks for finding this problem, I missed the name overlap when I added the library module later. To fix the problem just change the name of the function to "read_diskfile" so that it does not overlap with the library module and it builds correctly. I will have this fixed in the next version.

Hutch -

I changed the proc name to disk_read for symmetry with disk_write, same idea, and it compiled correctly.  Thanks.  I still have the question, however, that when a source defined procedure is the same name as a procedure defined elsewhere, if there is not some more explicit error message?  Or is it required to know the procedure names to avoid the conflict?

Regards
Gonzo