Welcome, Guest. Please login or register.

Author Topic: execbase in assembler question  (Read 5081 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline DisplacerTopic starter

  • Newbie
  • *
  • Join Date: Apr 2011
  • Posts: 4
    • Show all replies
execbase in assembler question
« on: May 02, 2011, 06:32:54 PM »
I have several books on programming the Amiga, and I'm learning to code in assembler on it. Question I have is something that is confusing about the exec library. I've looked at some assembly code that refers to the CoolCapture vector. In the code that I looked at, its absolute address is (assuming A6 holds offset 0)

$2E(A6)

But looking in the docs I have, specifically execbase.h the structure is listed as:

Code: [Select]
   UWORD    SoftVer;    /* kickstart release number (obs.) */
    WORD    LowMemChkSum;    /* checksum of 68000 trap vectors */
    ULONG    ChkBase;    /* system base pointer complement */
    APTR    ColdCapture;    /* coldstart soft capture vector */
    APTR    CoolCapture;    /* coolstart soft capture vector */
    APTR    WarmCapture;    /* warmstart soft capture vector */
    APTR    SysStkUpper;    /* system stack base   (upper bound) */
    APTR    SysStkLower;    /* top of system stack (lower bound) */
    ULONG    MaxLocMem;    /* top of chip memory */
    APTR    DebugEntry;    /* global debugger entry point */
    APTR    DebugData;    /* global debugger data segment */
    APTR    AlertData;    /* alert data segment */
    APTR    MaxExtMem;    /* top of extended mem, or null if none */

    UWORD    ChkSum;    /* for all of the above (minus 2) */
Which puts the offset at 0C from the start of this structure, so what am I missing?

Thanks!
 

Offline DisplacerTopic starter

  • Newbie
  • *
  • Join Date: Apr 2011
  • Posts: 4
    • Show all replies
Re: execbase in assembler question
« Reply #1 on: May 02, 2011, 08:39:54 PM »
OK, I missed the Library struct. I went back and counted the bytes again, and still can't come up with the right number. I think it's the NODE struct in the Library struct that's messing me up. It has the comment that it's word aligned so what is the size exactly of the NODE struct? Sorry for all the questions and I hope it's the alignment that's messing me up instead of just not being able to count ;)
 

Offline DisplacerTopic starter

  • Newbie
  • *
  • Join Date: Apr 2011
  • Posts: 4
    • Show all replies
Re: execbase in assembler question
« Reply #2 on: May 02, 2011, 10:45:49 PM »
Ah, there's the problem. The node struct I have is:

Code: [Select]
struct Node {
    struct  Node *ln_Succ;
    struct  Node *ln_Pred;
    UBYTE   ln_Type;        
    BYTE    ln_Pri;
    char    *ln_Name;
};
 

Offline DisplacerTopic starter

  • Newbie
  • *
  • Join Date: Apr 2011
  • Posts: 4
    • Show all replies
Re: execbase in assembler question
« Reply #3 on: May 02, 2011, 11:43:48 PM »
I know it is, sorry I wasn't clear. What I meant is the char is what messed me up. I was treating that entry as a char (single byte) instead of APTR (4 bytes) and that's exactly how far my count was off. My own fault

Thanks for the help!