### Author Topic: Having a look to asmc  (Read 2512 times)

#### caballero

• Member
• Posts: 1166
##### Having a look to asmc
« on: September 16, 2018, 07:09:07 PM »
Hello, I have been having a look to asmc. It seems to have everything to unzip and go: compiler, linker, includes, libraries, etc. Good looking. But, when I check an example, "directx/0" for example, I don't see any batch file to click and see the results, only a makefile that I don't know how to handle... Just my thoughts, that you can send to the bin.

Good job, anyway :t
The logic of the error is hidden among the most unexpected lines of the program

#### Vortex

• Member
• Posts: 1989
##### Re: Having a look to asmc
« Reply #1 on: September 16, 2018, 07:31:41 PM »
Hi caballero,

Extract the content of asmc-master.zip to your root partition. Now, you can execute \asmc-master\bin\dz.exe, the DosZip Commander. From DosZip's client area ( the left pane ) , run install.bat to build the libraries. dz.exe and install.bat are in the bin folder. Navigate to the folder \asmc-master\source\test\directx\0 and run the file makefile. It will build the executable test.exe

#### caballero

• Member
• Posts: 1166
##### Re: Having a look to asmc
« Reply #2 on: September 16, 2018, 07:46:24 PM »
Oh, I see, everything has to be made inside Doszip Commander. Thank you Vortex :t
The logic of the error is hidden among the most unexpected lines of the program

#### Vortex

• Member
• Posts: 1989
##### Re: Having a look to asmc
« Reply #3 on: September 16, 2018, 07:49:02 PM »
Hi caballero,

You can also use batch files to build executables.

#### caballero

• Member
• Posts: 1166
##### Re: Having a look to asmc
« Reply #4 on: September 16, 2018, 07:51:40 PM »
I have tried it without much success
The logic of the error is hidden among the most unexpected lines of the program

#### Vortex

• Member
• Posts: 1989
##### Re: Having a look to asmc
« Reply #5 on: September 16, 2018, 07:58:44 PM »
Here is my batch file :

Code: [Select]
`set INCLUDE=\asmc-master\includeset LIB=\asmc-master\lib\asmc-master\bin\asmc test.asm\asmc-master\bin\linkw format windows nt runtime windows file test.obj`
The linker reports some errors :

Code: [Select]
`\asmc-master\bin\asmc test.asmAsmc Macro Assembler Version 2.28.07Copyright (C) The Asmc Contributors. All Rights Reserved. Assembling: test.asm\asmc-master\bin\linkw format windows nt runtime windows file test.objLINKW Version 2.0Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.Source code is available under the Sybase Open Watcom Public License.loading object filessearching librariesWarning! W1008: cannot open uuid.lib : No such file or directoryError! E2028: XMConvertVectorFloatToInt@@20 is an undefined referenceWarning! W1023: no starting address found, using 00401000creating a PE executablefile test.obj(test.asm): undefined symbol XMConvertVectorFloatToInt@@20`

#### caballero

• Member
• Posts: 1166
##### Re: Having a look to asmc
« Reply #6 on: September 16, 2018, 08:07:23 PM »
Yes, with a batch file, there are some libraries that the linker doesn't find. I didn't use the setpaths, just include the paths in the source and try to tell the linker where are the libraries with "linkw sys con_64 file test_ Library ..\..\..\..\lib\libc.lib" In my case it didn't find the library "libc.lib".
The logic of the error is hidden among the most unexpected lines of the program

#### Vortex

• Member
• Posts: 1989
##### Re: Having a look to asmc
« Reply #7 on: September 16, 2018, 08:30:06 PM »
Hello,

I copied uuid.lib from Win7 SDK to the \asmc-master\lib folder :

Code: [Select]
`LINKW Version 2.0Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.Source code is available under the Sybase Open Watcom Public License.loading object filessearching librariesError! E2028: XMConvertVectorFloatToInt@@20 is an undefined referenceWarning! W1023: no starting address found, using 00401000creating a PE executablefile test.obj(test.asm): undefined symbol XMConvertVectorFloatToInt@@20`

#### caballero

• Member
• Posts: 1166
##### Re: Having a look to asmc
« Reply #8 on: September 16, 2018, 09:11:42 PM »
I don't have W7 SDK. I have copied it from PoASM/Lib to "asmc/lib" and doesn't work neither. Never mind. Thank you for your time, Vortex.
The logic of the error is hidden among the most unexpected lines of the program

#### Vortex

• Member
• Posts: 1989
##### Re: Having a look to asmc
« Reply #9 on: September 16, 2018, 09:13:04 PM »
The asmc example should be built as a console application, my fault.

Code: [Select]
`include stdio.incinclude directxmath.incincludelib kernel32.libincludelib libc.libincludelib msvcrt.libincludelib uuid.libincludelib d3dx9.lib.codemain proc  local x:XMFLOAT4, value:UINT, result:UINT    mov value,2    mov x.x,5.0    ;mov x.y,5.0    ;mov x.z,5.0    ;mov x.w,5.0    XMConvertVectorFloatToInt(x, value)    movd eax,xmm0    printf("result: %d\n", eax)    xor eax,eax    retmain endp    end`
Code: [Select]
`set INCLUDE=\asmc-master\includeset LIB=\asmc-master\lib\asmc-master\bin\asmc /c /coff test.asmH:\masm32\bin\polink /SUBSYSTEM:CONSOLE test.obj`
Code: [Select]
`H:\masm32\bin\polink /SUBSYSTEM:CONSOLE test.objPOLINK: fatal error: File not found: 'd3dx9.lib'.`
Never worked on directx so could you help me to specify the correct import libs for directx?

#### nidud

• Member
• Posts: 1717
##### Re: Having a look to asmc
« Reply #10 on: September 16, 2018, 11:33:03 PM »
Hi caballero,

Normally you just run DZ.EXE and hit enter on the makefiles to build the samples. Some of the samples need uuid.lib so this may also be build in that case. There is a install.bat in the ./bin directory. This builds the import libraries and libc for 32 and 64-bit. The manual way is to browse to the directory and hit enter on the makefile in:

./lib
./lib/amd64
./source/lib32
./source/lib64
./source/uuid -- not build by install.bat!

DZ do the following:
SET PATH=C:\asmc-master\bin;%PATH%
SET INCLUDE=C:\asmc-master\include
SET ASMCDIR=C:\asmc-master

You may also use DZ in batch mode:
C:\asmc-master\bin\dz.exe <command>
This will set the environment, run <command> and exit (see install.bat).

However, there was a bug in v2.28.07 added in v2.28.01 effecting .COMDEF so a new version is uploaded.

#### caballero

• Member
• Posts: 1166
##### Re: Having a look to asmc
« Reply #11 on: September 16, 2018, 11:45:32 PM »
Hello, Vortex, I don't have much experience on DirectX programming. There are some examples by Siekmanski here on this subject.
The logic of the error is hidden among the most unexpected lines of the program

#### nidud

• Member
• Posts: 1717
##### Re: Having a look to asmc
« Reply #12 on: September 17, 2018, 12:11:19 AM »
A batch file for the ./source/test/directx/0 sample.
Code: [Select]
`SET ASMCDIR=\asmc-master\asmc-master\bin\asmc64 -I\asmc-master\include test.asm\asmc-master\bin\linkw sys con_64 file test`
Or simply:
Code: [Select]
`\asmc-master\bin\dz make.exe`

#### caballero

• Member
• Posts: 1166
##### Re: Having a look to asmc
« Reply #13 on: September 17, 2018, 02:03:00 AM »
Hi, nidud, didn't work none of two options. Don't worry, surely I did something wrong, no time to check it. :t
Code: [Select]
`C:\Compila\asmc\source\test\directx\0>c:\compila\asmc\bin\dz make.exeAsmc Make Version 1.6 Copyright (c) 2017 GNU General Public Licensetest.exe:        asmc64 test.asm        linkw sys con_64 file test        test.exe        pauseAsmc Macro Assembler (x64) Version 2.28.08Copyright (C) The Asmc Contributors. All Rights Reserved. Assembling: test.asmWarning! W1008: cannot open directxmath.lib : No such file or directoryWarning! W1008: cannot open uuid.lib : No such file or directoryError! E2028: XMConvertVectorFloatToInt@@24 is an undefined referencefile test.obj(test.asm): undefined symbol XMConvertVectorFloatToInt@@24"test.exe" no se reconoce como un comando interno o externo,programa o archivo por lotes ejecutable.`
The logic of the error is hidden among the most unexpected lines of the program

#### nidud

• Member
• Posts: 1717
##### Re: Having a look to asmc
« Reply #14 on: September 17, 2018, 03:30:42 AM »

Maybe better to delete the whole thing and try again. The sample do not need uuid.lib so there must be some external libraries or other things added there. The directx source is now moved out of lib64 and thus separated from libc as it should be. The library needs to be built in order to use it.