File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
llvm/lib/Target/Z80/MCTargetDesc Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -38,20 +38,28 @@ Z80MCAsmInfoELF::Z80MCAsmInfoELF(const Triple &T) {
3838
3939 // Common to both GAS and fasmg
4040 CommentString = " ;" ;
41+ AscizDirective = nullptr ;
4142 Code32Directive = Code64Directive = nullptr ;
4243 UseIntegratedAssembler = false ;
4344 AssemblerDialect = !Is16Bit;
4445 HasFunctionAlignment = false ;
4546 ExceptionsType = ExceptionHandling::SjLj;
4647
47- if (!Z80GasStyle) {
48+ if (Z80GasStyle) {
49+ Code16Directive = " .assume\t ADL = 0" ;
50+ Code24Directive = " .assume\t ADL = 1" ;
51+ AsciiDirective = ByteListDirective = Data8bitsDirective = " \t db\t " ;
52+ Data16bitsDirective = " \t dw\t " ;
53+ Data24bitsDirective = " \t d24\t " ;
54+ Data32bitsDirective = " \t d32\t " ;
55+ } else {
4856 Code16Directive = " assume\t adl = 0" ;
4957 Code24Directive = " assume\t adl = 1" ;
5058 DollarIsPC = true ;
5159 SeparatorString = nullptr ;
5260 PrivateGlobalPrefix = PrivateLabelPrefix = " " ;
5361 SupportsQuotedNames = false ;
54- ZeroDirective = AscizDirective = nullptr ;
62+ ZeroDirective = nullptr ;
5563 BlockSeparator = " dup " ;
5664 AsciiDirective = ByteListDirective = Data8bitsDirective = " \t db\t " ;
5765 NumberLiteralSyntax = ANLS_PlainDecimal;
Original file line number Diff line number Diff line change @@ -34,8 +34,13 @@ void Z80TargetAsmStreamer::emitLabel(MCSymbol *Symbol) {
3434}
3535
3636void Z80TargetAsmStreamer::emitAlign (Align Alignment) {
37- if (auto Mask = Alignment.value () - 1 )
38- Z80GasStyle ? OS << " \t .skip\t ($$ - $) and " << Mask << ' \n ' : OS << " \t rb\t ($$ - $) and " << Mask << ' \n ' ;
37+ if (auto Mask = Alignment.value () - 1 ) {
38+ if (Z80GasStyle) {
39+ OS << " \t .balign\t " << Alignment.value () << ' \n ' ;
40+ } else {
41+ OS << " \t rb\t ($$ - $) and " << Mask << ' \n ' ;
42+ }
43+ }
3944}
4045
4146void Z80TargetAsmStreamer::emitBlock (uint64_t NumBytes) {
You can’t perform that action at this time.
0 commit comments