Fixed up assembly files. If they had "|" in them, then the comment would get rid of the rest of the function.

Fixed up prototypes for amiga lib functions.
This commit is contained in:
jshepher 2004-09-12 01:16:36 +00:00
parent f8848586fd
commit e42dc803ec
26 changed files with 222 additions and 221 deletions

View File

@ -10,7 +10,7 @@ STATIC int stub(struct Isrvstr *intr asm("a1"))
(*intr->ccode)(intr->Carg); return 0;
}
VOID AddTOF(struct Isrvstr *intr,LONG (*code)(),LONG arg)
VOID AddTOF(struct Isrvstr *intr,LONG (*code)(APTR),APTR arg)
{ APTR SysBase = *(APTR *)4L;
intr->Iptr = intr;

View File

@ -60,7 +60,7 @@ LONG ArgInt(UBYTE **tt, STRPTR entry, long defval)
return defval;
}
#ifdef 0 /* only a example ??? */
#if 0 /* only a example ??? */
CxObj *UserFilter(UBYTE **tt, STRPTR entry, STRPTR defstr)
{

View File

@ -3,8 +3,8 @@
#include <exec/devices.h>
void BeginIO(struct IORequest *iorequest)
{ register struct IORequest *a1 asm("a1")=iorequest;
register struct Device *a6 asm("a6")=iorequest->io_Device;
__asm __volatile ("jsr a6@(-30:W)"::"r"(a1),"r"(a6):"a0","a1","d0","d1");
{ register struct IORequest *a1 __asm("a1")=iorequest;
register struct Device *a6 __asm("a6")=iorequest->io_Device;
__asm volatile ("jsr a6@(-30:W)" :: "r" (a1), "r" (a6));
}
#endif

View File

@ -1,23 +1,23 @@
asm("
.text
asm(
" .text;"
.globl _CallHook
.globl _CallHookA
" .globl _CallHook;"
" .globl _CallHookA;"
_CallHook: lea sp@(12:W),a1
jra L_CallHook
"_CallHook: lea sp@(12:W),a1;"
" jra L_CallHook;"
_CallHookA: movel sp@(12:W),a1
"_CallHookA: movel sp@(12:W),a1;"
L_CallHook: movel a6,sp@-
movel a2,sp@-
movel sp@(12:W),a0
movel sp@(16:W),a2
jbsr L_callit
movel sp@+,a2
movel sp@+,a6
rts
"L_CallHook: movel a6,sp@-;"
" movel a2,sp@-;"
" movel sp@(12:W),a0;"
" movel sp@(16:W),a2;"
" jbsr L_callit;"
" movel sp@+,a2;"
" movel sp@+,a6;"
" rts;"
L_callit: movel a0@(8:W),sp@-
rts
");
"L_callit: movel a0@(8:W),sp@-;"
" rts;"
);

View File

@ -1,24 +1,24 @@
asm("
.text
asm(
" .text;"
.globl _CoerceMethod
.globl _CoerceMethodA
" .globl _CoerceMethod;"
" .globl _CoerceMethodA;"
_CoerceMethod: lea sp@(12:W),a1
jra L_CoerceMethod
"_CoerceMethod: lea sp@(12:W),a1;"
" jra L_CoerceMethod;"
_CoerceMethodA: movel sp@(12:W),a1
"_CoerceMethodA: movel sp@(12:W),a1;"
L_CoerceMethod: movel a2,sp@-
moveml sp@(8:W),a0/a2
movel a0,d0
beqs L_Null
movel a2,d0
beqs L_Null
jbsr L_Invoke
L_Null: movel sp@+,a2
rts
"L_CoerceMethod: movel a2,sp@-;"
" moveml sp@(8:W),a0/a2;"
" movel a0,d0;"
" beqs L_Null;"
" movel a2,d0;"
" beqs L_Null;"
" jbsr L_Invoke;"
"L_Null: movel sp@+,a2;"
" rts;"
L_Invoke: movel a0@(8:W),sp@-
rts
");
"L_Invoke: movel a0@(8:W),sp@-;"
" rts;"
);

View File

@ -4,7 +4,7 @@
#include <proto/exec.h>
#include "stabs.h"
struct IORequest *CreateExtIO(struct MsgPort *port,LONG iosize)
struct IORequest *CreateExtIO(CONST struct MsgPort *port,LONG iosize)
{ APTR SysBase = *(APTR *)4L;
struct IORequest *ioreq = NULL;
@ -16,7 +16,7 @@ struct IORequest *CreateExtIO(struct MsgPort *port,LONG iosize)
return ioreq;
}
struct IOStdReq *CreateStdIO(struct MsgPort *port)
struct IOStdReq *CreateStdIO(CONST struct MsgPort *port)
{
return (struct IOStdReq *)CreateExtIO(port,sizeof(struct IOStdReq));
}

View File

@ -7,7 +7,7 @@
/*(l)->lh_Tail = NULL,*/ \
(l)->lh_TailPred = (struct Node *)&(l)->lh_Head)
struct MsgPort *CreatePort(STRPTR name,LONG pri)
struct MsgPort *CreatePort(CONST_STRPTR name,LONG pri)
{ APTR SysBase = *(APTR *)4L;
struct MsgPort *port = NULL;
UBYTE portsig;

View File

@ -1,23 +1,23 @@
asm("
.text
asm(
" .text;"
.globl _DoMethod
.globl _DoMethodA
" .globl _DoMethod;"
" .globl _DoMethodA;"
_DoMethod: lea sp@(8:W),a1
jra L_DoMethod
"_DoMethod: lea sp@(8:W),a1;"
" jra L_DoMethod;"
_DoMethodA: movel sp@(8:W),a1
L_DoMethod: movel sp@(4:W),d0
beqs L_Null
movel a2,sp@-
movel d0,a2
movel a2@(-4:W),a0
jbsr L_Invoke
movel sp@+,a2
L_Null: rts
"_DoMethodA: movel sp@(8:W),a1;"
"L_DoMethod: movel sp@(4:W),d0;"
" beqs L_Null;"
" movel a2,sp@-;"
" movel d0,a2;"
" movel a2@(-4:W),a0;"
" jbsr L_Invoke;"
" movel sp@+,a2;"
"L_Null: rts;"
L_Invoke: movel a0@(8:W),sp@-
rts
");
"L_Invoke: movel a0@(8:W),sp@-;"
" rts;"
);

View File

@ -1,28 +1,28 @@
asm("
.text
asm(
" .text;"
.globl _DoSuperMethod
.globl _DoSuperMethodA
" .globl _DoSuperMethod;"
" .globl _DoSuperMethodA;"
_DoSuperMethod: lea sp@(12:W),a1
jra L_DoSuperMethod
"_DoSuperMethod: lea sp@(12:W),a1;"
" jra L_DoSuperMethod;"
_DoSuperMethodA:
movel sp@(12:W),a1
"_DoSuperMethodA:"
" movel sp@(12:W),a1;"
L_DoSuperMethod:
movel a2,sp@-
moveml sp@(8:W),a0/a2
movel a2,d0
beqs L_Null
movel a0,d0
beqs L_Null
movel a0@(24:W),a0
jbsr L_Invoke
L_Null: movel sp@+,a2
rts
"L_DoSuperMethod:"
" movel a2,sp@-;"
" moveml sp@(8:W),a0/a2;"
" movel a2,d0;"
" beqs L_Null;"
" movel a0,d0;"
" beqs L_Null;"
" movel a0@(24:W),a0;"
" jbsr L_Invoke;"
"L_Null: movel sp@+,a2;"
" rts;"
L_Invoke: movel a0@(8:W),sp@-
rts
");
"L_Invoke: movel a0@(8:W),sp@-;"
" rts;"
);

View File

@ -9,18 +9,18 @@ ULONG HookEntry(struct Hook *hook asm("a0"),APTR obj asm("a2"),APTR msg asm("a1"
#else
asm("
.text
asm(
" .text;"
.globl _HookEntry
" .globl _HookEntry;"
_HookEntry: movel a1,sp@-
movel a2,sp@-
movel a0,sp@-
movel a0@(12:W),a0
jsr a0@
lea sp@(12:W),sp
rts
");
"_HookEntry: movel a1,sp@-;"
" movel a2,sp@-;"
" movel a0,sp@-;"
" movel a0@(12:W),a0;"
" jsr a0@;"
" lea sp@(12:W),sp;"
" rts;"
);
#endif

View File

@ -1,24 +1,24 @@
asm("
.text
asm(
" .text;"
.globl _SetSuperAttrs
" .globl _SetSuperAttrs;"
_SetSuperAttrs: movel a2,sp@-
moveml sp@(8:W),a0/a2
movel a2,d0
beqs L_Null
movel a0,d0
beqs L_Null
clrl sp@-
pea sp@(20:W)
pea 259:W
movel sp,a1
movel sp@(24:W),a0
jbsr L_Invoke
lea sp@(12:W),sp
L_Null: movel sp@+,a2
rts
"_SetSuperAttrs: movel a2,sp@-;"
" moveml sp@(8:W),a0/a2;"
" movel a2,d0;"
" beqs L_Null;"
" movel a0,d0;"
" beqs L_Null;"
" clrl sp@-;"
" pea sp@(20:W);"
" pea 259:W;"
" movel sp,a1;"
" movel sp@(24:W),a0;"
" jbsr L_Invoke;"
" lea sp@(12:W),sp;"
"L_Null: movel sp@+,a2;"
" rts;"
L_Invoke: movel a0@(8:W),sp@-
rts
");
"L_Invoke: movel a0@(8:W),sp@-;"
" rts;"
);

View File

@ -6,17 +6,17 @@ asm(
" .globl ___modsi3;"
" .globl ___divsi3;"
"| D1.L = D0.L % D1.L signed"
/* D1.L = D0.L % D1.L signed */
"___modsi3: moveml sp@(4:W),d0/d1;"
" jbsr ___divsi4;"
" movel d1,d0;"
" rts;"
"| D0.L = D0.L / D1.L signed"
/* D0.L = D0.L / D1.L signed */
"_div:;"
"_ldiv:;"
"_div:"
"_ldiv:"
"___divsi3: moveml sp@(4:W),d0/d1;"
"___divsi4: movel "A4(_UtilityBase)",a0;"
" jmp a0@(-150:W);"

View File

@ -3,7 +3,7 @@
asm(
" .globl ___mulsi3;"
"| D0 = D0 * D1;"
/* D0 = D0 * D1 */
"___mulsi3: moveml sp@(4),d0/d1;"
" movel "A4(_UtilityBase)",a0;"

View File

@ -4,14 +4,14 @@ asm(
" .globl ___umodsi3;"
" .globl ___udivsi3;"
"| D1.L = D0.L % D1.L unsigned;"
/* D1.L = D0.L % D1.L unsigned */
"___umodsi3: moveml sp@(4:W),d0/d1;"
" jbsr ___udivsi4;"
" movel d1,d0;"
" rts;"
"| D0.L = D0.L / D1.L unsigned;"
/* D0.L = D0.L / D1.L unsigned */
"___udivsi3: moveml sp@(4:W),d0/d1;"
"___udivsi4: movel "A4(_UtilityBase)",a0;"

View File

@ -19,20 +19,20 @@ asm(
" moveml #0x3832,sp@-;"
" movel 4:W,a6;"
" subal a1,a1;"
" jsr a6@(-0x126); | FindTask(a1:nam)"
" jsr a6@(-0x126);" /* FindTask(a1:nam) */
" movel d0,a1;"
" moveq #-1,d1;"
" cmpl a1@(0xb8:W),d1;"
" jeq l_fail; | Dont put requesters up"
" jeq l_fail;" /* Dont put requesters up */
" lea "A4(___intuitionname)",a1;"
" moveq #0,d0;"
" jsr a6@(-0x228); | OpenLibrary(a1:nam,d0:ver)"
" jsr a6@(-0x228);" /* OpenLibrary(a1:nam,d0:ver) */
" movel d0,d4;"
" jeq l_fail;"
" lea "A4(ok)",a3;"
" lea "A4(body)",a1;"
" subl a2,a2;"
" movel sp@(2;8),a1@(12:W);"
" movel sp@(28),a1@(12:W);"
" subl a0,a0;"
" moveq #0,d0;"
" moveq #0,d1;"
@ -40,10 +40,10 @@ asm(
" lslw #4,d2;"
" moveq #72,d3;"
" exg d4,a6;"
" jsr a6@(-0x15c); | AutoRequest(a0,a1,a2,a3,d0,d1,d2,d3)"
" jsr a6@(-0x15c);" /* AutoRequest(a0,a1,a2,a3,d0,d1,d2,d3) */
" movel a6,a1;"
" movel d4,a6;"
" jsr a6@(-0x19e); | CloseLibrary(a1:lib)"
" jsr a6@(-0x19e);" /* CloseLibrary(a1:lib) */
"l_fail: moveml sp@+,#0x4c1c;"
" rts;"
);

View File

@ -4,13 +4,13 @@ asm(
" .globl _longjmp;"
"_longjmp:;"
" addql #4,sp | returns to another address;"
" movel sp@+,a0 | get address of jmp_buf;"
" movel sp@+,d0 | get returncode;"
" jne l0 | != 0 -> ok;"
" addql #4,sp;" /* returns to another address */
" movel sp@+,a0;" /* get address of jmp_buf */
" movel sp@+,d0;" /* get returncode */
" jne l0;" /* != 0 -> ok */
" moveql #1,d0;"
"l0: movel a0@(48:W),sp | restore sp;"
" movel a0@+,sp@ | set returnaddress;"
" moveml a0@,d2-d7/a2-a6 | restore all registers except scratch and sp;"
"l0: movel a0@(48:W),sp;" /* restore sp */
" movel a0@+,sp@;" /* set returnaddress */
" moveml a0@,d2-d7/a2-a6;" /* restore all registers except scratch and sp */
" rts;"
);

View File

@ -3,10 +3,10 @@ asm(
" .even;"
" .globl _setjmp;"
"_setjmp:;"
" movel sp@(4),a0 | get address of jmp_buf;"
" movel sp@,a0@+ | store returnaddress;"
" moveml d2-d7/a2-a6/sp,a0@ | store all registers except scratch;"
" moveql #0,d0 | return 0;"
"_setjmp:"
" movel sp@(4),a0;" /* get address of jmp_buf */
" movel sp@,a0@+;" /* store returnaddress */
" moveml d2-d7/a2-a6/sp,a0@;" /* store all registers except scratch */
" moveql #0,d0;" /* return 0 */
" rts;"
);

View File

@ -4,14 +4,14 @@ asm(
" .globl ___modsi3;"
" .globl ___divsi3;"
" | D1.L = D0.L % D1.L signed;"
/* D1.L = D0.L % D1.L signed */
"___modsi3: moveml sp@(4:W),d0/d1;"
" jbsr ___divsi4;"
" movel d1,d0;"
" rts;"
"| D0.L = D0.L / D1.L signed;"
/* D0.L = D0.L / D1.L signed */
"_div:;"
"_ldiv:;"

View File

@ -1,7 +1,7 @@
asm(
" .globl ___mulsi3;"
"| D0 = D0 * D1;"
/* D0 = D0 * D1 */
"___mulsi3: moveml sp@(4),d0/d1;"
" movel d3,sp@-;"

View File

@ -3,14 +3,14 @@ asm(
" .globl ___udivsi3;"
" .globl ___udivsi4;"
"| D1.L = D0.L % D1.L unsigned;"
/* D1.L = D0.L % D1.L unsigned */
"___umodsi3: moveml sp@(4:W),d0/d1;"
" jbsr ___udivsi4;"
" movel d1,d0;"
" rts;"
"| D0.L = D0.L / D1.L unsigned;"
/* D0.L = D0.L / D1.L unsigned */
"___udivsi3: moveml sp@(4:W),d0/d1;"
"___udivsi4: movel d3,sp@-;"

View File

@ -4,15 +4,15 @@ asm(
" .globl _longjmp;"
"_longjmp:"
" addql #4,sp | returns to another address"
" movel sp@+,a0 | get address of jmp_buf"
" movel sp@+,d2 | get returncode"
" addql #4,sp;" /* returns to another address */
" movel sp@+,a0;" /* get address of jmp_buf */
" movel sp@+,d2;" /* get returncode */
" movel a0@(48:W),d0;"
" jbsr ___stkrst | restore sp"
" jbsr ___stkrst;" /* restore sp */
" movel d2,d0;"
" jne l0 | != 0 -> ok"
" jne l0;" /* != 0 -> ok */
" moveql #1,d0;"
"l0: movel a0@+,sp@ | set returnaddress"
" moveml a0@,#0x7cfc | restore all registers except scratch and sp"
"l0: movel a0@+,sp@;" /* set returnaddress */
" moveml a0@,#0x7cfc;" /* restore all registers except scratch and sp */
" rts"
);

View File

@ -11,32 +11,32 @@ asm(
"___stkext_f:;"
" movel a0,sp@-;"
" movel sp,a0 | memorize sp;"
" moveml #0xc062,sp@- | preserves all registers;"
" movel sp,a2 | memorize sp;"
" addl #28:W,d1 | Used by this function itself;"
" movel "A4(___stackborders)",a1| get upper border of stack in a1;"
" movel sp,a0;" /* memorize sp*/
" moveml #0xc062,sp@-;" /* preserves all registers*/
" movel sp,a2;" /* memorize sp*/
" addl #28:W,d1;" /* Used by this function itself*/
" movel "A4(___stackborders)",a1;"/* get upper border of stack in a1*/
" movel a1@(4:W),a1;"
" tstl "A4(___used_stack)";"
" bne l0;"
" movel "A4(___SaveSP)",a1;"
"l0: jbsr ___stkext | change to a stackframe with d0 bytes;"
" movel "A4(___used_stack)",a6 | fix stored sp;"
"l0: jbsr ___stkext;" /* change to a stackframe with d0 bytes*/
" movel "A4(___used_stack)",a6;" /* fix stored sp*/
" addl d1,a6@(12:W);"
" movel a2,d0 | calculate number of bytes to copy;"
" addl "A4(___stk_argbytes)",d0| to new stackframe in d0;"
" movel a2,d0;" /* calculate number of bytes to copy*/
" addl "A4(___stk_argbytes)",d0;"/* to new stackframe in d0*/
" addl d1,d0;"
" cmpl a1,d0 | never copy over the bottom of the stack;"
" cmpl a1,d0;" /* never copy over the bottom of the stack*/
" jls l1;"
" movel a1,d0;"
"l1: subl a0,d0 | copy;"
"l1: subl a0,d0;" /* copy*/
" subl d0,sp;"
" movel sp,a1;"
" movel "A4(_SysBase)",a6;"
" jsr a6@(-0x270) | CopyMem(src:a0,dst:a1,siz:d0);"
" jsr a6@(-0x270);" /* CopyMem(src:a0,dst:a1,siz:d0)*/
" movel a2,a0;"
" moveml a0@+,#0x4603;"
" movel sp,a0 | Prepare cleanup;"
" movel sp,a0;" /* Prepare cleanup*/
" addl d1,a0;"
" movel #___stkrst_f,a0@(8:W);"
" movel sp@+,a0;"
@ -44,7 +44,7 @@ asm(
"___stkext:;"
" movel a0,sp@-;"
" moveml #0xf072,sp@- | preserves all registers;"
" moveml #0xf072,sp@-;" /* preserves all registers*/
" movel "A4(___stk_safezone)",d3;"
" lea "A4(___stk_limit)",a2;"
" lea "A4(___used_stack)",a3;"
@ -52,53 +52,53 @@ asm(
" movel "A4(_SysBase)",a6;"
" movel d0,d2;"
" addl d3,d2;"
" addl "A4(___stk_argbytes)",d2| required stack;"
" movel a3@,d0 | Look for a spare stackframe;"
" addl "A4(___stk_argbytes)",d2;"/* required stack*/
" movel a3@,d0;" /* Look for a spare stackframe*/
" jeq l4;"
"l3: movel d0,a0;"
" movel a0@,a3@ | Remove spare stackframe from list;"
" movel a0@(8:W),d0 | Test spare stackframe;"
" movel a0@,a3@;" /* Remove spare stackframe from list*/
" movel a0@(8:W),d0;" /* Test spare stackframe*/
" subl a0@(4:W),d0;"
" cmpl d0,d2;"
" jls l7;"
" moveq #20,d1 | Not big enough;"
" moveq #20,d1;" /* Not big enough*/
" addl d1,d0;"
" movel a0,a1;"
" jsr a6@(-0xd2) | FreeMem(mem:a1,siz:d0);"
" jsr a6@(-0xd2);" /* FreeMem(mem:a1,siz:d0)*/
" movel a3@,d0;"
" jne l3;"
"l4: moveq #20,d0;"
" addl d0,d2 | no more stackframes - allocate a new one;"
" addl d0,d2;" /* no more stackframes - allocate a new one*/
" movel "A4(___stk_minframe)",d0;"
" cmpl d0,d2;"
" jge l5;"
" movel d0,d2;"
"l5: movel d2,d0;"
" moveql #1,d1 | MEMF_PUBLIC;"
" jsr a6@(-0xc6) | AllocMem(siz:d0,typ:d1);"
" moveql #1,d1;" /* MEMF_PUBLIC*/
" jsr a6@(-0xc6);" /* AllocMem(siz:d0,typ:d1) */
" movel d0,a0;"
" movel a0,d0;"
" jne l6;"
" jbsr ___stkovf | allocation failed;"
" jbsr ___stkovf;" /* allocation failed*/
"l6: moveq #20,d0;"
" addl a0,d0;"
" movel d0,a0@(4:W);"
" addl a0,d2 | prepare new frame for use;"
" addl a0,d2;" /* prepare new frame for use*/
" movel d2,a0@(8:W);"
"l7: movel a3@-,a0@ | Add it to the used list;"
"l7: movel a3@-,a0@;" /* Add it to the used list*/
" movel a0,a3@;"
" addql #4,a0;"
" movel a2@,a0@(12:W);"
" movel a0@,a2@ | Prepare ___top_of_stackframe variable;"
" movel a0@,a2@;" /* Prepare ___top_of_stackframe variable*/
" addl d3,a2@;"
" lea a0@(4:W),a2;"
" movel a2@+,a2@ | Prepare target sp;"
" jsr a6@(-0x2dc) | StackSwap(sss:a0);"
" movel a2@+,a2@;" /* Prepare target sp*/
" jsr a6@(-0x2dc);" /* StackSwap(sss:a0)*/
" moveq #40,d0;"
" movel a2@,a0;"
" addl d0,a2@ | Fix stored sp;"
" addl d0,a2@;" /* Fix stored sp*/
" moveml a0@+,#0x4e0f;"
" movel a0@(4:W),sp@- | prepare returnaddress;"
" movel a0@(4:W),sp@-;" /* prepare returnaddress*/
" movel a0@,a0;"
" rts;"
@ -106,29 +106,29 @@ asm(
" tstl "A4(___used_stack)";"
" jeq ___stk_free;"
" lea sp@(12:W),a0;"
" movel "A4(___SaveSP)",d0 | Go back to first stackframe;"
" movel "A4(___SaveSP)",d0;" /* Go back to first stackframe*/
" jbsr ___stkrst;"
" movel a0@,sp@- | restore argument of exit();"
" movel a0@-,sp@- | returnaddress for exit();"
" movel a0@-,sp@- | returnaddress for callfuncs();"
" movel a0@-,sp@- | our returnaddress;"
"| jbsr ___stk_free;"
"| rts;"
" movel a0@,sp@-;" /* restore argument of exit()*/
" movel a0@-,sp@-;" /* returnaddress for exit()*/
" movel a0@-,sp@-;" /* returnaddress for callfuncs()*/
" movel a0@-,sp@-;" /* our returnaddress */
" jbsr ___stk_free;"
" rts;"
"___stk_free:;"
" movel a2,sp@-;"
" movel a6,sp@- | Free all unused stackframes;"
" movel a6,sp@-;" /* Free all unused stackframes*/
" movel "A4(_SysBase)",a6;"
" lea "A4(___used_stack)",a2;"
" addql #4,a2;"
" movel a2@,d0 | Remove spare stackframe from list;"
" movel a2@,d0;" /* Remove spare stackframe from list*/
" jeq l9;"
"l8: movel d0,a1;"
" movel a1@,a2@;"
" moveq #20,d0;"
" addl a1@(8:W),d0 | Calculate size;"
" addl a1@(8:W),d0;" /* Calculate size*/
" subl a1@(4:W),d0;"
" jsr a6@(-0xd2) | FreeMem(mem:a1,siz:d0);"
" jsr a6@(-0xd2);" /* FreeMem(mem:a1,siz:d0)*/
" movel a2@,d0;"
" jne l8;"
"l9: movel sp@+,a6;"

View File

@ -6,6 +6,6 @@ asm(
" .globl ___stkovf;"
"___stkovf:;"
" clrl "A4(___stk_limit)" | generate no more stackoverflows;"
" clrl "A4(___stk_limit)";" /* generate no more stackoverflows */
" jra __XCOVF;"
);

View File

@ -20,26 +20,26 @@ asm(
"| the current register set on top of the free stack. NEVER set a sp higher"
"| than the location of important data."
"|"
" .comm ___used_stack,8 | pointer to used stackframes,"
" | pointer to unused stackframes"
" .comm ___used_stack,8;" /* pointer to used stackframes */
/* pointer to unused stackframes */
" .text;"
" .even;"
" .globl ___stkrst;"
"__stkrst:;"
" exg d0,a3 | better use an address register;"
" exg d0,a3;" /* better use an address register*/
" movel a2,sp@-;"
" moveml d0/d1/a0/a1/a5/a6,sp@-;"
" movel sp,a2;"
" lea "A4(___used_stack)",a5;"
" tstl a5@;"
" jeq l0 | No previous stackframe;"
" jeq l0;" /* No previous stackframe*/
"l2: movel "A4(___stackborders)",a0;"
" cmpl a0@,a3;"
" jcs l1;"
" cmpl a0@(4:W),a3;"
" jle l0 | Stackpointer points to current frame;"
"l1: movel "A4(_SysBase)",a6 | Go to previous stack;"
" jle l0;" /* Stackpointer points to current frame*/
"l1: movel "A4(_SysBase)",a6;" /* Go to previous stack*/
" movel a5,a1;"
" movel a1@,a0;"
" movel a0@,a1@+;"
@ -47,20 +47,21 @@ asm(
" movel a0,a1@;"
" addql #4,a0;"
" movel a0@(12:W),"A4(___stk_limit)";"
" jsr a6@(-0x2dc) | StackSwap(sss:a0);"
" jsr a6@(-0x2dc);" /* StackSwap(sss:a0)*/
" tstl a5@;"
" jne l2;"
"l0: moveml a2@+,d0/d1/a0/a1/a5/a6 | Restore registers;"
" movel a2@(4:W),sp@- | preserve returnaddress on current stackframe;"
" movel a2@,a2 | be careful to not clobber any registers now;"
" cmpl sp,a3 | Depending on whether sp moves up or down;"
" jls l3 | use one of two possible routines;"
" movel sp@,a3@- | moves up (pop): copy returnaddress first;"
" movel a3,sp | then set sp;"
"l0: moveml a2@+,d0/d1/a0/a1/a5/a6;" /* Restore registers*/
" movel a2@(4:W),sp@-;" /* preserve returnaddress on current stackframe*/
" movel a2@,a2;" /* be careful to not clobber any registers now*/
" cmpl sp,a3;" /* Depending on whether sp moves up or down*/
" jls l3;" /* use one of two possible routines*/
" movel sp@,a3@-;" /* moves up (pop): copy returnaddress first*/
" movel a3,sp;" /* then set sp*/
" jra l4;"
"l3: exg a3,sp | moves down (push): set sp first;"
" movel a3@,sp@- | then copy returnaddress;"
" movel sp,a3;" "l4: exg d0,a3 | move back;"
" addql #4,d0 | compensate for returnaddress;"
"l3: exg a3,sp;" /* moves down (push): set sp first*/
" movel a3@,sp@-;" /* then copy returnaddress*/
" movel sp,a3;"
"l4: exg d0,a3;" /* move back*/
" addql #4,d0;" /* compensate for returnaddress*/
" rts;"
);

View File

@ -7,17 +7,17 @@ asm(
"___stkrst_f:;"
" movel a2,sp@-;"
" moveml #0xc0c2,sp@- | Preserve all registers;"
" moveml #0xc0c2,sp@-;" /* Preserve all registers; */
" movel sp,a2;"
" lea "A4(___used_stack)",a1 | Move current stackframe to the spares list;"
" lea "A4(___used_stack)",a1;" /* Move current stackframe to the spares list */
" movel a1@,a0;"
" movel a0@,a1@+;"
" movel a1@,a0@;"
" movel a0,a1@;"
" addql #4,a0 | Return to old stackframe;"
" addql #4,a0;" /* Return to old stackframe */
" movel a0@(12:W),"A4(___stk_limit)";"
" movel "A4(_SysBase)",a6;"
" jsr a6@(-0x2dc) | StackSwap(sss:a0);"
" jsr a6@(-0x2dc);" /* StackSwap(sss:a0) */
" moveml a2@+,#0x4303;"
" movel a2@,a2;"
" rts;"

View File

@ -38,9 +38,9 @@ asm(
" rts;"
"error:"
" movel a0,sp@-;"
" jsr ___request; | jbsr translates to jra which doesn't work on 68000;"
" jsr ___request;" /* jbsr translates to jra which doesn't work on 68000 */
" pea 20:W;"
" jsr _exit; | dito"
" jsr _exit;" /* dito */
);
ADD2INIT(__cpucheck,-80); /* Highest priority */