--- In lpc2000@yahoogroups.com, "dave_albert" <david_albert@h...> wrote: > Here's a snippet of code I use to call C++ constructors in crt0.S > I call it after clearing .bss and initializing .data: > > > /* Call global C++ object constructors */ > > ldr r4, =__CTOR_LIST__ @ Null terminated list of ctors > Ctor_Loop: > ldr r5, [r4], #+4 @ Fetch constructor address > cmp r5, #0 @ Test for end of list > addne lr, pc, #4 @ Save return address > movne pc, r5 @ Call constructor > bne Ctor_Loop @ Continue for all constructors > Won't the called constructor likely modify the zero flag so that the "bne Ctor_Loop" might terminate the loop prematurely? Karl Olsen
Message
Re: Constructors
2004-09-22 by Karl Olsen
Attachments
- No local attachments were found for this message.