Welcome, Guest. Please login or register.

Author Topic: Couple asm questions (Subr parameter passing, return codes and errors, and register preservation)  (Read 1019 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline tormedhammaren

  • Full Member
  • ***
  • Join Date: Mar 2003
  • Posts: 153
    • Show all replies
Answers:

1. I don't know

2. It's probably the same as return 0; in C. 0 is a RETURN_OK (edited). You have the answer yourself... 78 was stored in your d0, and everything returned to DOS (via d0) except 0 is considered a fail code. So just return 0.

3. All other registers than A0, A1, D0 and D1 must have the same value on program exit as they had on entry. So it's a must to restore these registers (a2-a7 and d2-d7)!
tormedhammaren/toddi ||==
 

Offline tormedhammaren

  • Full Member
  • ***
  • Join Date: Mar 2003
  • Posts: 153
    • Show all replies
Hi

It's good that someone can correct me. I based my third answer on what I found on the subject in the "Amiga Guru Book" which covers the AmigaOS up to ROM 2.04. Is the automatic register preservation a feature of AmigaOS > 2.04?

Regards,
tormedhammaren/toddi ||==