Merge branch 'master' of git.teamfnd.ru:artem3213212/FasmOnDelphi

This commit is contained in:
2018-03-25 23:19:19 +03:00
2 changed files with 94 additions and 16 deletions

78
EN_DOC.MD Normal file
View File

@@ -0,0 +1,78 @@
# FasmOnDelphi functions description
### function FasmVersion:TFasmVersion;
Return assembler version in TFasmVersion structure.
### function FasmAssemble(const Source:AnsiString;cbMemorySize:cardinal=1024*1024;nPassesLimit:DWORD=100):TFasmResult;
Compiles the code.
Source - contains source code to compile.
cbMemorySize - amount of memory that compiler can use (may be rounded to kilobytes).
nPassesLimit - the maximum number of passes that the compiler can use.
Returns structure TFasmResult with information of error or compiled code.
### function FasmAssembleToFile(const Source,OutFile:AnsiString;cbMemorySize:cardinal=1024*1024*8;nPassesLimit:DWORD=100):TFasmResult;
Like FasmAssemble, but output will be in file provided in OutFile.
### function FasmAssembleFile(const Source:AnsiString;cbMemorySize:cardinal=1024*1024*8;nPassesLimit:DWORD=100):TFasmResult;
Like FasmAssemble, but input will be used from file provided in Source.
### function FasmAssembleFileToFile(const Source,OutFile:AnsiString;cbMemorySize:cardinal=1024*1024*8;nPassesLimit:DWORD=100):TFasmResult;
Like FasmAssembleFile, but output will be in file provided in OutFile.
### procedure OpenFASM(Location:string=FASMPath;AsDll:boolean=false);
Initializes the Flat Assembler.
Location - path to fasm.exe/fasm.dll (only Win32).
AsDll - set to True if using DLL version of compiler, else False (non Win32 targets ignored).
### procedure SetFasmTemp(Path:string);
Selects a directory for temp files.
**********************************************************
# Description of FasmOnDelphi types:
TFasmError=FASMERR_ASSERTION_FAILED ..FASM_ERROR;
Type for Fasm error codes.
TFasmVersion=packed record
V1,V2:word;
end;
Type for provide the assembler version.
V1 - the first number of the version (to the point).
V2 - the second version number (after the point).
TFasmResult=record
OutData:Pointer;
sb:integer;
Error:TFasmError;
OutStr:string;
Lines:array of TFasmLine;
end;
OutData - pointer to the result of assembling (nil on error or FasmAssembleToFile/FasmAssembleFileToFile).
sb - the size of the result of assembly (0 on error or FasmAssembleToFile/FasmAssembleFileToFile).
Error - error code (FASM_OK if everything went well).
OutStr - the string that compiler produces.
Lines - detailed information about errors (for more details see TFasmLine).
TFasmLine=record
Line:UInt32;
&File:string;
end;
Line - number of line with error.
File - name of file with error ('' or a file from the temp folder implies that this is the code passed to FasmAssembleFile or FasmAssembleFileToFile).

View File

@@ -1,12 +1,12 @@
#Описание функций FasmOnDelphi:
# Описание функций FasmOnDelphi:
###function FasmVersion:TFasmVersion;
### function FasmVersion:TFasmVersion;
Возвращает версию ассемблера в структуре TFasmVersion.
###function FasmAssemble(const Source:AnsiString;cbMemorySize:cardinal=1024*1024;nPassesLimit:DWORD=100):TFasmResult;
### function FasmAssemble(const Source:AnsiString;cbMemorySize:cardinal=1024*1024;nPassesLimit:DWORD=100):TFasmResult;
Компилирует код.
Source содержит исходный код для компиляции.
Source - содержит исходный код для компиляции.
cbMemorySize - количество памяти которую может использовать компилятор(может быть округлено до целого количества килобайт).
@@ -14,27 +14,27 @@ nPassesLimit - максимальное количество проходов к
Возвращает структуру TFasmResult с информацией об ошибке или скомпилированным кодом.
###function FasmAssembleToFile(const Source,OutFile:AnsiString;cbMemorySize:cardinal=1024*1024*8;nPassesLimit:DWORD=100):TFasmResult;
Эдентично FasmAssemble, но выход будет записан в файл(имя передаётся в OutFile).
### function FasmAssembleToFile(const Source,OutFile:AnsiString;cbMemorySize:cardinal=1024*1024*8;nPassesLimit:DWORD=100):TFasmResult;
Идентично FasmAssemble, но выход будет записан в файл(имя передаётся в OutFile).
###function FasmAssembleFile(const Source:AnsiString;cbMemorySize:cardinal=1024*1024*8;nPassesLimit:DWORD=100):TFasmResult;
Эдентично FasmAssemble, но код будет взят из файла(имя передаётся в Source).
### function FasmAssembleFile(const Source:AnsiString;cbMemorySize:cardinal=1024*1024*8;nPassesLimit:DWORD=100):TFasmResult;
Идентично FasmAssemble, но код будет взят из файла(имя передаётся в Source).
###function FasmAssembleFileToFile(const Source,OutFile:AnsiString;cbMemorySize:cardinal=1024*1024*8;nPassesLimit:DWORD=100):TFasmResult;
Эдентично FasmAssembleFile, но выход будет записан в файл(имя передаётся в OutFile).
### function FasmAssembleFileToFile(const Source,OutFile:AnsiString;cbMemorySize:cardinal=1024*1024*8;nPassesLimit:DWORD=100):TFasmResult;
Идентично FasmAssembleFile, но выход будет записан в файл(имя передаётся в OutFile).
###procedure OpenFASM(Location:string=FASMPath;AsDll:boolean=false);
### procedure OpenFASM(Location:string=FASMPath;AsDll:boolean=false);
Инициализирует Flat Assembler.
Location - путь до fasm.exe/fasm.dll (только Win32).
AsDll - установить в True если используется DLL версия компилятора иначе False (вне Win32 игнорируется).
###procedure SetFasmTemp(Path:string);
### procedure SetFasmTemp(Path:string);
Выбирает каталог для temp файлов.
**********************************************************
#Описание типов FasmOnDelphi:
# Описание типов FasmOnDelphi:
TFasmError=FASMERR_ASSERTION_FAILED ..FASM_ERROR;
@@ -66,7 +66,7 @@ Error - код ошибки(FASM_OK если всё прошло успешно)
OutStr - строка которую выдаёт компилятор.
Lines - подробная информашия об ошибках (подробнее см. TFasmLine).
Lines - подробная информация об ошибках (подробнее см. TFasmLine).
TFasmLine=record
Line:UInt32;
@@ -75,4 +75,4 @@ Lines - подробная информашия об ошибках (подро
Line - номер строки с ошибкой.
File - имя файла с ошибкой('' или файл из папки темпа подразумевает что это код реоеданный в FasmAssembleFile или FasmAssembleFileToFile).
File - имя файла с ошибкой('' или файл из папки темпа подразумевает что это код переданный в FasmAssembleFile или FasmAssembleFileToFile).