From 67d25d837ac55f28a366c0a3b262e439a6e75fc3 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 19 Aug 2017 12:15:28 +0200 Subject: Add AmForth --- amforth-6.5/avr8/words/store-i_big.asm | 129 +++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 amforth-6.5/avr8/words/store-i_big.asm (limited to 'amforth-6.5/avr8/words/store-i_big.asm') diff --git a/amforth-6.5/avr8/words/store-i_big.asm b/amforth-6.5/avr8/words/store-i_big.asm new file mode 100644 index 0000000..422da39 --- /dev/null +++ b/amforth-6.5/avr8/words/store-i_big.asm @@ -0,0 +1,129 @@ +; ( n addr -- ) Memory +; R( -- ) +; writes a cell in flash +VE_DO_STOREI_BIG: + .dw $ff04 + .db "(i!)" + .dw VE_HEAD + .set VE_HEAD = VE_DO_STOREI_BIG +XT_DO_STOREI: + .dw PFA_DO_STOREI_BIG +PFA_DO_STOREI_BIG: + movw temp2, tosl ; save the (word) address + loadtos ; get the new value for the flash cell + push xl + push xh + push yl + push yh + ldi zl, byte3(DO_STOREI_atmega) + out_ rampz, zl + ldi zh, byte2(DO_STOREI_atmega) + ldi zl, byte1(DO_STOREI_atmega) + eicall + pop yh + pop yl + pop xh + pop xl + ; finally clear the stack + loadtos + jmp_ DO_NEXT + +; +.set _pc = pc +.org NRWW_START_ADDR +DO_STOREI_atmega: + ; write data to temp page buffer + ; use the values in tosl/tosh at the + ; appropiate place + rcall pageload + + ; erase page if needed + ; it is needed if a bit goes from 0 to 1 + com temp4 + com temp5 + and tosl, temp4 + and tosh, temp5 + or tosh, tosl + breq DO_STOREI_writepage + + movw zl, temp2 + ldi temp0,(1<