1 / 1 / 0
Регистрация: 09.09.2017
Сообщений: 116
1
MASM32
Ошибка компиляции консольного приложения
25.04.2019, 20:03. Показов 2818. Ответов 5
Хочу создать готовое консольное приложение, при попытке ассемблировать файл выходит такая ошибка:
D:PROGSFASM64RadAsm2..masm32BinML.EXE /c /coff /Cp /nologo /I»D:PROGSFASM64RadAsm2..masm32Include» «Lab01.asm»
Assembling: Lab01.asm
Lab01.asm(1) : error A2088: END directive required at end of file
Make error(s) occured.
Total compile time 297 ms
Как исправить, просто есть готовый файл conapp.tpl, копирую его в Radasm и выходит такое. Сам код исходного файла:
Assembler | ||
|
__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь
0
Update for Visual Studio 2017:
1) I used the 1.0.2h openssl
source. I have not tried other versions.
2) Have perl installed and in your PATH
.
3) Install NASM and add it to your PATH
(e.g. to C:NASM and/or edit the PATH
setup below). The latest version (2.13.1
) worked fine for me.
4) Check and, if needed, edit the path to vcvarsall.bat
used below.
5) (optional) Edit the install folder in the command bellow (set via --prefix
).
6) Open Command Prompt in the root directory of the downloaded source, (edit and) execute the following commands:
set PATH=%PATH%;C:nasm
%comspec% /k ""C:Program Files (x86)Microsoft Visual Studio2017ProfessionalVCAuxiliaryBuildvcvarsall.bat"" amd64
perl Configure VC-WIN64A --prefix=C:openssl_x64 no-asm no-shared enable-tlsext enable-static-engine
msdo_win64a
nmake -f msntdll.mak
nmake -f msntdll.mak install
7) (Optional) In case you have multiple versions of VS installed, you might want to verify that the correct version of nmake
was executed (14.10.*
and not e.g. 14.0*
or 12.*
)
- Remove From My Forums
-
Question
-
Hi,
Trying to update ML64.exe from 10.0.40219.1 (works great) to 14.00.23506.0 (corrupted)
but noticed that the errors/warnings output are corrupted in VS 2015 v14.00.23506.0.
For example, open a console window:
C:UsersmyuserDownloadsTCPServiceBinTCPServicex64>make.bat
Microsoft (R) Macro Assembler (x64) Version 14.00.23506.0
Copyright (C) Microsoft Corporation. All rights reserved.ml64 /c /W3 /Sa /Zi /Zd /FlTCPService64.lst /FoTCPService64.obj make.txt
Assembling: make.txt
……Objectx64Subs.asm(12)ze
……Objectx64Subs.asm(12) : error A2008:syntax error :……Objectx64Subs.asm(50)ze
……Objectx64Subs.asm(50) : error A2008:syntax error :????F??♥……Objectx64Subs.asm(63
)ze
……Objectx64Subs.asm(63) : error A2008:syntax error :????F??♥……Objectx64Xeq.asm(68)
e
……Objectx64Xeq.asm(68) : warning A6004:procedure argument or local not referenced : unusedl
ocal2forcF??????>……Objectx64Xeq.asm(351)ze
……Objectx64Xeq.asm(351) : warning A6004:procedure argument or local not referenced : starze
r magnit????ô……Objectx64EventLogW.asm(150)ied size
……Objectx64EventLogW.asm(150) : warning A6004:procedure argument or local not referenced :
?F←……Objectx64Tcp.asm(4046)ize
……Objectx64Tcp.asm(4046) : warning A6004:procedure argument or local not referenced : te???
ôNotice all the weird characters and general text corruption.
A successful build using v10 instead of v14 looks like this:
Assembling: make.txt
……Objectx64Xeq.asm(68) : warning A6004:procedure argument or local not referenced : unusedlocal2forceEnter
……Objectx64Xeq.asm(351) : warning A6004:procedure argument or local not referenced : startupInfo
……Objectx64EventLogW.asm(150) : warning A6004:procedure argument or local not referenced : moduleNameEnd
……Objectx64Tcp.asm(4046) : warning A6004:procedure argument or local not referenced : tempbufferAny ideas?
Thanks.
-
Edited by
Friday, July 1, 2016 2:31 PM
-
Edited by
Answers
-
Hi cyber_flash,
thanks for posting here.
>>ml64 /c /W3 /Sa /Zi /Zd /FlTCPService64.lst /FoTCPService64.obj make.txt
According to the MSDN document of
ML and ML64 Command-Line Reference, some command-line options to ML and ML64 are placement-sensitive. For example, because ML and ML64 can accept several /c options, any corresponding /Fo options must be specified before /c.So I suggest you try to write like this:
ml64 /W3 /Sa /Zi /Zd /FlTCPService64.lst /FoTCPService64.obj /c make.txt
Best Regards,
Sera Yu
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
-
Proposed as answer by
Hart Wang
Wednesday, July 20, 2016 1:29 AM -
Marked as answer by
Hart Wang
Wednesday, July 20, 2016 1:29 AM
-
Proposed as answer by
-
>>ML64.exe output gets corrupted when dealing with directory traversal paths such as …… or relative and absolute paths too.
The pExt:QWORD you use means allocate and optionally initialize 8 bytes of storage for each initializer. Maybe because the length of the paths overflows.
Best Regards,
Sera Yu
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
-
Proposed as answer by
Hart Wang
Wednesday, July 20, 2016 1:29 AM -
Marked as answer by
Hart Wang
Wednesday, July 20, 2016 1:29 AM
-
Proposed as answer by
Страница 1 из 4
-
oxvlad
New Member
- Публикаций:
-
0
- Регистрация:
- 28 авг 2009
- Сообщения:
- 7
Есть куча asm файлов, как их собрать в одну dll библиотеку?
-
max7C4
New Member
- Публикаций:
-
0
- Регистрация:
- 17 мар 2008
- Сообщения:
- 1.203
оффтоп: копипастом
oxvlad
попробуйте слинковать вместе все obj, получающиеся после ассемблирования. подробнее см. командную строку link.exe -
wasm_test
wasm test user
- Публикаций:
-
0
- Регистрация:
- 24 ноя 2006
- Сообщения:
- 5.582
cкомпилировать в .obj каждый файл, потом слинковать все вместе линкером ms link, указав ему флаг /DLL и точку входа и другие необходимые для длл параметры.
-
n0name
New Member
- Публикаций:
-
0
- Регистрация:
- 5 июн 2004
- Сообщения:
- 4.336
- Адрес:
- Russia
-
oxvlad
New Member
- Публикаций:
-
0
- Регистрация:
- 28 авг 2009
- Сообщения:
- 7
И еще вопрос, что писать в модулях asm т.е. какой формат он должен иметь для masm?
PS. Если просто имплементации функций перечислить не собирается в объектники. -
wasm_test
wasm test user
- Публикаций:
-
0
- Регистрация:
- 24 ноя 2006
- Сообщения:
- 5.582
n0name
что это значит?oxvlad
не понял? приведи пример файлов. -
oxvlad
New Member
- Публикаций:
-
0
- Регистрация:
- 28 авг 2009
- Сообщения:
- 7
Great
Пример asm модуля:
;test.asm
foo proc
xor eax, eax
ret
foo endp -
oxvlad
New Member
- Публикаций:
-
0
- Регистрация:
- 28 авг 2009
- Сообщения:
- 7
Модуль основной dll:
.386
.model flat, stdcall
option casemap :none.data
.code
LibMain proc instance : DWORD, reason : DWORD, unused : DWORD
ret
LibMain endpend LibMain
-
max7C4
New Member
- Публикаций:
-
0
- Регистрация:
- 17 мар 2008
- Сообщения:
- 1.203
исчебы. тогда копипаст или include
-
oxvlad
New Member
- Публикаций:
-
0
- Регистрация:
- 28 авг 2009
- Сообщения:
- 7
max7C4
Как сделать, чтобы без копипаста и инклюда, чтобы объектники генерировались? Не хочется весь код писать в одном asm файле. -
max7C4
New Member
- Публикаций:
-
0
- Регистрация:
- 17 мар 2008
- Сообщения:
- 1.203
-
max7C4
New Member
- Публикаций:
-
0
- Регистрация:
- 17 мар 2008
- Сообщения:
- 1.203
а. да еще extern foo забыл, но это можно и в def файле указать
-
oxvlad
New Member
- Публикаций:
-
0
- Регистрация:
- 28 авг 2009
- Сообщения:
- 7
max7C4
Я все в def файле указывал. -
oxvlad
New Member
- Публикаций:
-
0
- Регистрация:
- 28 авг 2009
- Сообщения:
- 7
max7C4
Твой пример «Сегодня 10:32:05» при сборке выдает следующееAssembling: test.asm
test.asm(1) : error A2085: instruction or register not accepted in current CPU mode
test.asm(1) : error A2088: END directive required at end of fileОбъектник собирал так:
masm32binml /c /coff test.asmВидимо опять я что то жделаю не так ((
-
max7C4
New Member
- Публикаций:
-
0
- Регистрация:
- 17 мар 2008
- Сообщения:
- 1.203
ну так попробуйте другой CPU, .386P что ли напишите, какие проблемы (наверное незнание английского, translate.google.com Вам в помощь)
в конце файла нет end. А кто мешает поставить?
-
max7C4
New Member
- Публикаций:
-
0
- Регистрация:
- 17 мар 2008
- Сообщения:
- 1.203
Вот еще, уберите .data, с пустыми блоками, могут быть глюки, хотя я уже точно не помню, как там масм (сам фасмом пользуюсь, он лучше: 1 — удобнее, 2 — функциональнее (с его помощью компилятся хоть образы дисков, хоть 3D модельки, хоть … да в общем что угодно), 3 — легче (меньше по размеру и количеству файлов), 4 — без замут (с объектниками или какими-то типами процессоров) и 5 — с исходниками)
а пример лично у меня компилится в объектник нормально и в этом варианте и в исходном -
max7C4
New Member
- Публикаций:
-
0
- Регистрация:
- 17 мар 2008
- Сообщения:
- 1.203
-
wasm_test
wasm test user
- Публикаций:
-
0
- Регистрация:
- 24 ноя 2006
- Сообщения:
- 5.582
max7C4
Омг, зачем привилегированный набор инструкций? Автору уж точно нужен не драйвер. -
max7C4
New Member
- Публикаций:
-
0
- Регистрация:
- 17 мар 2008
- Сообщения:
- 1.203
Great
это значит любой другой, хоть с привилегированными инструкциями хоть без, на вкус и цвет товарищей нет (а я вообще эти ограничения не понимаю, по мне фасм и юзай че хочешь)
-
wasm_test
wasm test user
- Публикаций:
-
0
- Регистрация:
- 24 ноя 2006
- Сообщения:
- 5.582
Я тоже уважаю фасм =) Даешь фасм в массы!
Страница 1 из 4
First off, this is just a general question about MASM.
Still pretty new to Assembly, and have been wanting to create a custom macro file, but I’m having trouble getting the file to be included/work/I’m not sure what the problem is.
So a couple of things up front.
1) I’m using Visual Studio 2012.
2) I have a C++ file that calls the assembly file.
2) I have been googling for several hours and have not had any useful results. Googling «macro assembly» returns anything with «Microsoft Macro Assembler».
3) The program works just fine if I copy and paste the macros at the top of the file.
For simplicity, here’s one of the smallest macros.
muldiv macro reg1, reg2
mul reg1;
div reg2;
endm
I created a file called testmac.inc, and just pasted the macro in there, with nothing else. The codeblock above contains everything that was in the file.
In my .asm file that uses the macros, I put:
include testmac.inc
Right after .code (also tried it outside of .code, still didn’t work)
Assembler says:
error A2088: END directive required at end of file
So I put end at the end of the testmac.inc
;; testmac.inc
muldiv macro reg1, reg2
mul reg1;
div reg2;
endm
end
Compiler says:
error LNK2019: unresolved external symbol ….
It says that one of my C functions is unresolved, which, reminder, works just fine if I paste the macro at the top of the assembly file.
Figured maybe I needed .code in the macro file.
;; testmac.inc
.code
muldiv macro reg1, reg2
mul reg1;
div reg2;
endm
end
Same problem as last time, unresolved external symbol
I have no clue what I’m doing wrong.
Also, I have seen multiple tutorials online that talk about setting up macros, but I can’t find a single one that goes over creating a file with custom made macros, and using them in your project.
Any help would be greatly appreciated.
Jacob