Помощь - Поиск - Пользователи - Календарь
Полная версия этой страницы: Отличия AvrAssembler2 от AvrAssembler
Форум разработчиков электроники ELECTRONIX.ru > Сайт и форум > В помощь начинающему > MCS51, AVR, PIC, STM8, 8bit
Alt.F4
Поиск по источникам на русском ничего конкретного не дал.
Может есть у кого подобные руководства на русском языке (директивы, команды), буду очень признателен!
Спасибо.
alexeyv
И без знания иностранного диалекта русского языка здесь все понятно:

CODE

Changes between Assembler 1 and Assembler 2
C-style preprocessor
AVRASM2 features directives modeled after the C preprocessor; see AVR Assembler 2
Preprocessor. Preprocessor symbols may be defined and undefined from the command line.

Tightened syntax
The assembler syntax has been tightened up a bit, assembler keywords (instructions, registers,
built-in functions) can no longer be used as user-defined symbols (labels, names in .def/.equ/.set
directives). Even though this breaks some existing code, it should help avoiding some nasty bugs
and generally cause programs to become more readable.

Unsupported instructions
The use of unsupported instructions will now generate an assembler error, not a warning.
This behaviour may be changed in the Studio assembler settings window, and with the
command-line option -W+iw.

New assembler directives
.undef symbol
Undefines a register definition created with the .def directive. Use this to avoid “already
defined by the .DEF directive” warnings.

.dd expression[, expression ...]
.dq expression[, expression ...]
These directives are similar to the .dw directive, except they are used to define doublewords
(32-bit) and quadwords (64-bit), respectively. The byte and word ordering is strictly little-endian.

.warning "<message>"
Print a warning message.

Improved expression evaluation
Constant expressions can be integer or floating point, and follow the C rules for operator
precedence and type propagation. Symbols and instruction operands are always integer, a
suitable conversion function should be used to convert before assignment (eg, int(), q7()
described below).

Implicit float->int conversion cause a warning and the fractional part is discarded. Both
integers and floating point numbers have 64-bit internal representation.

AVRASM2 supports the same operators as AVRASM, and additionally % (modulo/remainder).

In addition to the functions supported by AVRASM, the following new functions are
supported by AVRASM2:

int()
Truncates a floating point expression to integer (ie discards fractional part)

frac()
Extracts fractional part of a floating point expression (ie discards integer part).

q7()
Converts a fractional floating point expression to a form suitable for the FMUL/FMULS/FMULSU
instructions. (sign + 7-bit fraction)

q15()
Converts a fractional floating point to the form returned by the FMUL/FMULS/FMULSY
instructions (sign + 15-bit fraction).

abs()
Returns the absolute value of a constant expression.

Built-in “known place” for included files
Unlike AVRASM1, when AVRASM2 is installed as part of an AVR Studio installation,
it will know where the Appnotes (include) directory is, and doesn’t need to be told this
via a command line option like

-I “C:\Program Files\Atmel\AVR Tools\AvrAssembler2\Appnotes”

This is convenient when the assembler is invoked as a standalone program from
the command line.

Motorola hex for large files
A long-standing bug in AVRASM is fixed in AVRASM2: Motorola hex (S-record) output
format is now implemented for addresses above the 64kB limit, using S2 data records
when segment size exceeds 64 k bytes.

Macro improvements
The number of parameters to an assembler macro is unlimited in AVRASM2 (max 10
in AVRASM)

Nested macro calls (i.e., one macro calling another) is allowed in AVRASM2 - overuse
of this feature is not recommended, however.


А теперь немного по-русски:

1. Си-стиль препроцессора (т.е. #<directive>, а не .<directive>)
2. Усиленный синтаксис - слова зарезервированные ассемблером нельзя переопределять в своих целях
3. Неподдерживаемые инструкции выдают ошибку,а не предупреждение
4. Добавлены новые директивы :
  • .undef symbol
  • .dd expression[, expression ...]
  • .dq expression[, expression ...]
  • .warning "<message>"


5. Улучшено вычисление выражений и добавлены новые функции:
  • int()
  • frac()
  • q7()
  • q15()
  • abs()


6. Встроенное в ассемблер "место рассположения" инклудовских файлов
7. Поддержка формата Motorola-hex для больших файлов
8. Улучшение работы с макросами:
  • неограниченное количество параметров
  • разрешено (но не рекомендовано!!) использование вложенных макросов


Еще какие вопросы?
Alt.F4
Цитата
Поддержка формата Motorola-hex для больших файлов
А зачем это?
Цитата
разрешено (но не рекомендовано!!) использование вложенных макросов
А почему не рекомендовано, чем грозит?
Спасибо.
з.ы. alexeyv, Ваш приведенный код растянул страницу на максимум =))
alexeyv
Цитата
А зачем это?

Этот вопрос к Atmel Corporation.

Цитата
А почему не рекомендовано, чем грозит?

Кроме как фразы
Цитата
Nested macro calls (i.e., one macro calling another) is allowed in AVRASM2 - overuse
of this feature is not recommended, however.

ничего нет. Так что и этот вопрос к Atmel Corporation лично.
У меня по крайней мере двух-уровневая вложенность макросов отрабатывала без каких-либо замечаний/ошибок.

Цитата
Ваш приведенный код растянул страницу на максимум =))

Исправил немного
Alt.F4
alexeyv, все понятно. Спасибо большое.
Буду делать макросы одинарными, а то мало ли... Потом ошибку хрен найдешь.
Для просмотра полной версии этой страницы, пожалуйста, пройдите по ссылке.
Invision Power Board © 2001-2025 Invision Power Services, Inc.