Jump to content
    

Keil. Передать адрес си функции в file.ASM

Други! Нужно подменить адрес возврата перед RETI.

Как передать адрес си функции в ассемблерный файл?

Документацию читал. 
Заранее спасибо.

Share this post


Link to post
Share on other sites

Сам спросил сам ответил

EXTRN CODE (c_foo)
    POP ACC
    POP ACC
    MOV ACC,#LOW (c_foo)
    PUSH ACC
    MOV ACC,#HIGH (c_foo)
    PUSH ACC
    RETI
    END
	

Share this post


Link to post
Share on other sites

Не надо так делать. Таким способом вы обеспечите только чудесные глюки со стеком и с испорченными регистрами...

Теоретически так можно, если код c_foo - это последнее, что выполнит процессор перед перезагрузкой, но в этом случае надо перед RETI добавить CLR EA

Edited by Intel4004

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...