Commit Graph

5 Commits

Author SHA1 Message Date
Martin Storsjo
1521eb8ba9 ads2armasm_ms: Match the indentation of the previous line
Instead of hardcoding a certain indentation, use the regexp to
provide similar indentation for the new line as well.

Change-Id: Iacb2621b35ce7e1aa3980c1603b8e3ab02d98a35
2014-03-20 08:13:07 +02:00
Martin Storsjo
5182befa49 ads2armasm_ms: Add an ALIGN 4 after ENDP
This makes sure that labels for data symbols directly after
functions get properly 4-byte-aligned (when the source is assembled
in thumb mode).

Previously, if declaring a data symbol directly after a function, the
symbol could end up pointing to the unaligned address (if the total
size of the thumb function didn't end up being a multiple of 4). The
data in the symbol itself ended up aligned, but the symbol pointed to
the preceding unaligned position.

That is, a source file looking like this:
---
   ...
   ENDP

symbol
   DCD 0x12345678
---

could end up being assembled into
symbol:
  xxxxx2: 0000
  xxxxx4: 5678
  xxxxx6: 1234

(This doesn't happen if the symbol label is on the same line as the
DCD directive.)

By adding an ALIGN 4 directly after the ENDP we make sure the symbol
itself gets aligned properly.

This isn't an issue with the original, untranslated arm source,
since it only is built in arm mode where all instructions are 4 byte,
and since the gnu assembler automatically adds the padding before the
symbol even in thumb mode.

Change-Id: Iadbeebd656b0197e423e79a12a7d3ef8859cf445
2014-03-19 21:53:44 +02:00
James Zern
b6941849cb normalize perl shebangs
don't require perl to be in a fixed location

Change-Id: Icc8b6113a2a3626f847fe46409334a03f1db5c85
2014-02-28 11:56:14 -08:00
Martin Storsjo
6b9a7b3333 thumb: Add a parameter for specifying a shift offset for the pc addition conversion
The branch instructions are encoded as 16 bit instructions
by the microsoft assembler, while they are encoded as 32 bit
instructions by gnu binutils.

Change-Id: I622b9025df3520c08eef8447df078f5517fb4b67
2013-05-22 01:50:57 +03:00
Martin Storsjo
a83db43632 Add a script for converting ads arm assembly to microsoft armasm format
The formats are basically the same, but a few minor details need
to be adjusted. Addiitonally, when building for the WinRT/Windows
Phone 8 platforms, one has to build for thumb, so convert instructions
accordingly.

Change-Id: I3c3902aa20fd3bfc29168d3a1bf17111e5481dcb
2013-05-21 09:57:24 +03:00