mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 15:05:53 +00:00
ICU-22210 toolutil: Add NASM generator
This commit is contained in:
parent
2c46fb7f61
commit
167f8855a2
1 changed files with 22 additions and 1 deletions
|
@ -228,6 +228,16 @@ static const struct AssemblyType {
|
|||
},
|
||||
/* align 16 bytes */
|
||||
/* http://msdn.microsoft.com/en-us/library/dwa9fwef.aspx */
|
||||
{"nasm",
|
||||
"global %s\n"
|
||||
#if defined(_WIN32)
|
||||
"section .rdata align=16\n"
|
||||
#else
|
||||
"section .rodata align=16\n"
|
||||
#endif
|
||||
"%s:\n",
|
||||
" dd ","",HEX_0X
|
||||
},
|
||||
{ "masm",
|
||||
"\tTITLE %s\n"
|
||||
"; generated by genccode\n"
|
||||
|
@ -294,6 +304,17 @@ writeAssemblyCode(
|
|||
exit(U_FILE_ACCESS_ERROR);
|
||||
}
|
||||
|
||||
const char* newSuffix = nullptr;
|
||||
|
||||
if (uprv_strcmp(assemblyHeader[assemblyHeaderIndex].name, "masm") == 0) {
|
||||
newSuffix = ".masm";
|
||||
}
|
||||
else if (uprv_strcmp(assemblyHeader[assemblyHeaderIndex].name, "nasm") == 0) {
|
||||
newSuffix = ".asm";
|
||||
} else {
|
||||
newSuffix = ".S";
|
||||
}
|
||||
|
||||
getOutFilename(
|
||||
filename,
|
||||
destdir,
|
||||
|
@ -301,7 +322,7 @@ writeAssemblyCode(
|
|||
sizeof(buffer.chars),
|
||||
entry,
|
||||
sizeof(entry),
|
||||
".S",
|
||||
newSuffix,
|
||||
optFilename);
|
||||
out=T_FileStream_open(buffer.chars, "w");
|
||||
if(out==nullptr) {
|
||||
|
|
Loading…
Add table
Reference in a new issue