Важная информация

User Tag List

Показано с 1 по 2 из 2

Тема: using macros in ALASM

  1. #1
    Member Аватар для hood
    Регистрация
    26.08.2008
    Адрес
    Czech Republic
    Сообщений
    154
    Спасибо Благодарностей отдано 
    4
    Спасибо Благодарностей получено 
    32
    Поблагодарили
    8 сообщений
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию using macros in ALASM

    Sorry, I can only write in English.

    Dear ALASM users,

    I plan to code in ALASM, and I want to solve the following problem and I hope that ALASM can solve it:

    I have a code on the address 5000, that is 20 bytes long, and have to be here for the correct function of the whole program. From address 0 I start to write the code, and of course, as I write, the code is growing towards the address 5000. And I of course do not want, that the code rewrites the 20 bytes on the address 5000. So, shortly before 5000 I make a jump to 5020 (JR 5020), and those 20 bytes is safe and not rewritten.

    The way, I am doing it now, is, that I have to watch all the time, if address 5000 is not rewritten, but as I am doing lot of changes in the code under 5000, I have to check all the time. And this is what I want to avoid.

    So, the question is, if ALASM and its macro can help me somehow. Is it possible, that during the assembly, some macro would be running and watch, if we are close to 5000? And if we are really close to 5000 (like 5000-2, or 5000-3 or 5000-4), the macro would place JR 5020 on the current address, and then would continue assembly on 5020.

    This solution would be great and automatic, and if I would do any change in the code under 5000, I would not have to check the address 5000 all the time.

    Would you be so kind and write here also some practicall examples of such macros, which would be doing what I have described here? I am completelly lost in the very brief ALASM manual (as far as macro usage is concerned), and have no previous experiance with macros. And studying ALASM sources of Alone Coder does not help me much.


    Thanks a lot

    Hood, Czech Republic

  2. #1
    С любовью к вам, Yandex.Direct
    Размещение рекламы на форуме способствует его дальнейшему развитию

  3. #2
    Vitamin C++ Аватар для Vitamin
    Регистрация
    14.01.2005
    Адрес
    Таганрог, Россия
    Сообщений
    4,254
    Спасибо Благодарностей отдано 
    9
    Спасибо Благодарностей получено 
    80
    Поблагодарили
    34 сообщений
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    По умолчанию

    You can use the next macro (I'm not sure about 'display' directive keys, but you can clarify it in manual):
    Код:
      macro safe_org
      if ($-\1)&#8000
      display "Warning! overwrite for ",\A,\1
      else
      org \1
      endif
      endm
    And use it like this:
    Код:
    ;some code
      ..
      safe_org 5000
      ;safe code
      ..
    When the code areas are not overlapped, you will get usual org directive, which just changes current compile address. In case of overlapping, you will get warning message.

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Похожие темы

  1. Alasm 507- help
    от hood в разделе Софт
    Ответов: 4
    Последнее: 13.04.2009, 14:56
  2. Помощь по ALASM
    от Zloy в разделе Программирование
    Ответов: 16
    Последнее: 01.04.2009, 19:29
  3. alasm vs atm2
    от homeness в разделе Программирование
    Ответов: 0
    Последнее: 22.01.2008, 08:35
  4. Народ! Поделитесь Alasm-ом
    от Retrograd в разделе Программирование
    Ответов: 14
    Последнее: 09.09.2007, 22:19

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •