From: Matthias T. <mt...@we...> - 2010-09-09 18:10:28
|
Pito, > Hi, I started with LP asm (amforth 4.0): > \ ----- Test AvrAsm ----- > : loadtos, 16 Y+ ld, 17 Y+ ld, ; \ define macro > : savetos, -Y 17 st, -Y 16 st, ; \ tosl=r22, tosh=r23 The assembler may use any register. But one has to be careful when changing registers used by amforth itself. The actual register allocation is in the macros.inc file. Its safe to use the registers labeled as temp, all others should not be changed at all. Some are seldom used, others only if special words are used (such as the extended vm registers from reg-a.asm). There is no way to use forth words from within the assembler code. For that you need to initialize a forth vm and call it. The only "guide" for that is the startup code itself (amforth.asm). Matthias |