From: Matthias T. <mt...@we...> - 2007-04-05 08:12:51
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello Maciej, > I have narrowed the problem to the start of COLD codeword that first > calls SP0 to fetch the address of the stack (that should be > stackstart) and then SP! to store the top of stack value to Y > register. > > The problem is that SP0 returns its value on the stack while Y > register is still uninitialized and contains XT_NOOP address (from > reset routine). In the SVN this problem may be a bit hidden because > top of stack is kept in a register pair, but the execution will start > with savetos macro that uses Y register anyway and might corrupt the > RAM anyway. > > I think that this could be solved by adding word SP0! that just loads > Y with stackstart value or by moving in amsforth.asm, reset routine > the parameter stack pointer initialization just before the jump to > Forth machine so that Y register will have the value of stackstart. There is a much simpler bugfix, that does not need any additional code: Move the code block for the data stack pointer in amforth.asm to the proper postion (at the end). Just fixed in svn.. Thank you! Bye Matthias -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iD8DBQFGFK9vLo3irIddFw4RAsnJAJ42OeMDdBgrNLT75tyikwmlQ56bQgCfRKi6 CpWrXWIcHC1HkKOBMzOMz4I= =uTW4 -----END PGP SIGNATURE----- |