18 December 2015, 22:31 | #21 | |
Unregistered User
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 43
Posts: 4,190
|
Quote:
|
|
18 December 2015, 23:38 | #22 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
you could do that, but then it would be difficult to access any particular item, you'd have to iterate over all the objects until you got to the right one... my idea was to have a "data stack" and a "pointer stack" and then it would be easy but, wa wa wa,,,
|
19 December 2015, 02:38 | #23 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
That's just regular allocation on the heap, and giving the caller the responsibility of cleaning up.
|
19 December 2015, 22:03 | #24 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
it's only regular allocation on the heap, if you are calling "Allocate" and "Free", but it is simple to just reserve a big lump of memory for a second stack, afterall the main stack itself is allocated on the heap by the OS when it runs your program.
|
20 December 2015, 16:48 | #25 | |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Yes, but allocating on the heap has always been how you solve this, it's not a new problem.
Quote:
|
|
22 December 2015, 21:04 | #26 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
heap allocation is much slower, though. if you know you are going to construct and destroy in strict LIFO order it could be useful to use a second stack for performance benefits, and don't need to involve the operating system.
|
26 December 2015, 17:09 | #27 |
Registered User
Join Date: Oct 2010
Location: France
Posts: 99
|
Thanks for your enlightments guys...
While doing the "add.l #60,SP // sub.l #60,SP" worked OK under Devpac, it returned an error code when launching the executable file under the shell or from a bootable floppy disc (from scratch). The code is well executed, but going back to CLI returned a "39718" error, so I will stick with the usual "movem.l d0-d7/a0-a6,-(SP)" OUTSIDE the context saving subroutine... Last edited by sodapop; 26 December 2015 at 17:31. |
27 December 2015, 02:12 | #28 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Just return 0 in D0 and you'll get rid of the error message.
|
27 December 2015, 09:37 | #29 |
Registered User
Join Date: Oct 2010
Location: France
Posts: 99
|
@Leffmann: you're right !
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Inside the Amiga | Washac | support.Hardware | 14 | 19 February 2010 17:52 |
movem in debugger | Ratte | support.WinUAE | 2 | 15 August 2009 23:10 |
Movem Pickout Amiga fun issue 06 | AliasXZ | support.Games | 0 | 12 August 2009 00:32 |
Something like Movem | MarlboroMan | Looking for a game name ? | 2 | 10 October 2004 12:47 |
Movem & 3D Motorrad (Amiga Mania) | andreas | request.Old Rare Games | 6 | 26 September 2004 01:29 |
|
|