You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
(6) |
Mar
(41) |
Apr
(23) |
May
(11) |
Jun
(2) |
Jul
|
Aug
|
Sep
(9) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
2008 |
Jan
(6) |
Feb
(1) |
Mar
(23) |
Apr
(18) |
May
(21) |
Jun
(13) |
Jul
(34) |
Aug
(5) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(4) |
2009 |
Jan
|
Feb
(5) |
Mar
(5) |
Apr
(10) |
May
(1) |
Jun
(11) |
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(13) |
2010 |
Jan
(10) |
Feb
(4) |
Mar
(28) |
Apr
(3) |
May
(38) |
Jun
(22) |
Jul
(92) |
Aug
(154) |
Sep
(218) |
Oct
(45) |
Nov
(20) |
Dec
(1) |
2011 |
Jan
(33) |
Feb
(15) |
Mar
(32) |
Apr
(33) |
May
(48) |
Jun
(35) |
Jul
(7) |
Aug
|
Sep
(11) |
Oct
(5) |
Nov
|
Dec
(7) |
2012 |
Jan
(56) |
Feb
(11) |
Mar
(6) |
Apr
|
May
(128) |
Jun
(59) |
Jul
(21) |
Aug
(16) |
Sep
(24) |
Oct
(39) |
Nov
(12) |
Dec
(12) |
2013 |
Jan
(14) |
Feb
(61) |
Mar
(97) |
Apr
(46) |
May
(13) |
Jun
(23) |
Jul
(12) |
Aug
(25) |
Sep
(9) |
Oct
(81) |
Nov
(73) |
Dec
(45) |
2014 |
Jan
(36) |
Feb
(57) |
Mar
(20) |
Apr
(41) |
May
(43) |
Jun
(11) |
Jul
(14) |
Aug
(32) |
Sep
(9) |
Oct
(27) |
Nov
(21) |
Dec
(6) |
2015 |
Jan
(14) |
Feb
(23) |
Mar
(1) |
Apr
(19) |
May
(40) |
Jun
(11) |
Jul
(1) |
Aug
(2) |
Sep
(14) |
Oct
(10) |
Nov
(9) |
Dec
(13) |
2016 |
Jan
(4) |
Feb
(3) |
Mar
(7) |
Apr
|
May
(4) |
Jun
(13) |
Jul
(8) |
Aug
(3) |
Sep
(4) |
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
(6) |
Feb
(1) |
Mar
(1) |
Apr
(7) |
May
(10) |
Jun
(5) |
Jul
(7) |
Aug
(9) |
Sep
|
Oct
(1) |
Nov
(5) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
(3) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(54) |
Nov
(47) |
Dec
(53) |
2019 |
Jan
(23) |
Feb
(24) |
Mar
(19) |
Apr
(15) |
May
(5) |
Jun
(34) |
Jul
(9) |
Aug
(9) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(7) |
Apr
(7) |
May
(5) |
Jun
(15) |
Jul
(22) |
Aug
(28) |
Sep
(13) |
Oct
(9) |
Nov
(17) |
Dec
(13) |
2021 |
Jan
(5) |
Feb
(1) |
Mar
(1) |
Apr
(9) |
May
(21) |
Jun
(9) |
Jul
|
Aug
(6) |
Sep
(16) |
Oct
|
Nov
(1) |
Dec
(6) |
2022 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(11) |
Sep
(21) |
Oct
(5) |
Nov
(1) |
Dec
(1) |
2024 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
|
Nov
|
Dec
|
From: pito <pi...@vo...> - 2010-09-10 17:50:49
|
adiw xl, 1 DO_NEXT: brts DO_INTERRUPT movw zl, XL ; READ IP readflashcell wl, wh adiw XL, 1 ; INC IP DO_EXECUTE: movw zl, wl readflashcell temp0,temp1 movw zl, temp0 ijmp <<<<<<<<<<<<<<<< HERE CALLS AVRStudio usoft DO_INTERRUPT: ; here we deal with interrupts the forth way lds temp0, intcur ldi zl, LOW(intvec) ldi zh, HIGH > however after few steps the AVR Studio crashed (it > shots down the > simulator) - always on first "ijmp" instruction > (atmega1284p). |
From: pito <pi...@vo...> - 2010-09-10 17:42:36
|
Hi, I can imagine the headache, indeed. The experts may answer the simulator Q.. I've put the stuff into AVR Studio 4.18 SP2 (build 700 and 692)and I've tried to run amforth in simulator. IT WORKS, however after few steps the AVR Studio crashed (it shots down the simulator) - always on first "ijmp" instruction (atmega1284p). The other way is to simulate in VMLAB (this supports the smaller atmels only). You cannot compile to x86 as the amforth is written in ATMEGA AVR assembler. P. > hi, all > > I've got headache on debug the words on the board. > I need a simulator for amforth. > Does anyone know how to solve it? Or how to > compile the amForth to X86? Where are the forth > source of the core? > > |
From: pito <pi...@vo...> - 2010-09-10 17:06:52
|
Hi, is this correct behaviour in respect to comment content? P. : abcd1 ( n -- xx ) .s ; : abcd2 ( n -- (xx) ) <<<< .s ; > 1234 abcd1 0 12846 1234 ok > > .s ok > 1234 abcd2 0 12844 0 <<<< additional 0 on stack 1 12846 1234 ok > |
From: pito <pi...@vo...> - 2010-09-10 16:24:52
|
Hi, better code for stacks hexa vertical. Pito \ Some new .s \ by Pito 2010-09-10 \ v3 WITH TOS, TOR ON RIGHT SIDE \ PRINTED VERTICALLY !!! \ a little bit optimised marker -newdots : u.r ( s n -- ) 0 swap ud.r ; \ comment if installed : nibble ( n -- nth_nibbble ) 1- 2* 2* rshift $f and ; : ns@ ( n -- tos-n ) \ fetches n-th dstack position from tos 1+ 2* sp@ + @ ; \ ONELINE HEXA DSTACK VERTICAL : .svh hex sp@ base @ depth 1- 1- 4 0 do ." [" dup 0 ?do dup 1- i - 2* 3 ns@ + @ 4 j - nibble 1 u.r ." " loop ." <S]" cr loop drop \ drop depth base ! drop \ drop sp@ ; : rdepth rp0 rp@ - 2/ 1- 1- ; \ ONELINE HEXA RSTACK VERTICAL : .rvh hex rp@ 1- base @ rdepth 1- 1- 4 0 do ." [" dup 0 ?do dup 1- i - 2* 3 ns@ + @ 4 j - nibble 1 u.r ." " loop ." <R]" cr loop drop \ drop rdepth base ! drop \ drop rp@ ; : ? .svh .rvh cr ; : rtest ? $ABCD $BCDA ? >r ? >r ? r> ? r> ? drop drop ? ; \ -------------------------- EX: > $1122 $3344 $5566 $7788 $99FF ok > .svh [1 3 5 7 9 <S] [1 3 5 7 9 <S] [2 4 6 8 F <S] [2 4 6 8 F <S] ok > $1122 $3344 $5566 $7788 $99FF ok > .svh [1 3 5 7 9 1 3 5 7 9 <S] [1 3 5 7 9 1 3 5 7 9 <S] [2 4 6 8 F 2 4 6 8 F <S] [2 4 6 8 F 2 4 6 8 F <S] ok > .s 0 3FEB 99FF 1 3FED 7788 2 3FEF 5566 3 3FF1 3344 4 3FF3 1122 5 3FF5 99FF 6 3FF7 7788 7 3FF9 5566 8 3FFB 3344 9 3FFD 1122 ok > .rvh [0 1 <R] [6 E <R] [0 D <R] [3 E <R] ok > rtest [<S] [<S] [<S] [<S] [0 1 1 1 <R] [6 F F E <R] [0 1 0 D <R] [3 6 D E <R] [A B <S] [B C <S] [C D <S] [D A <S] [0 1 1 1 <R] [6 F F E <R] [0 1 0 D <R] [3 B D E <R] [A <S] [B <S] [C <S] [D <S] [0 B 1 1 1 <R] [6 C F F E <R] [0 D 1 0 D <R] [3 A D D E <R] [<S] [<S] [<S] [<S] [0 B A 1 1 1 <R] [6 C B F F E <R] [0 D C 1 0 D <R] [3 A D F D E <R] [A <S] [B <S] [C <S] [D <S] [0 B 1 1 1 <R] [6 C F F E <R] [0 D 2 0 D <R] [3 A 1 D E <R] [A B <S] [B C <S] [C D <S] [D A <S] [0 1 1 1 <R] [6 F F E <R] [0 2 0 D <R] [3 3 D E <R] [<S] [<S] [<S] [<S] [0 1 1 1 <R] [6 F F E <R] [0 2 0 D <R] [3 6 D E <R] ok > |
From: 李雪愚 <sno...@gm...> - 2010-09-10 13:02:11
|
hi, all I've got headache on debug the words on the board. I need a simulator for amforth. Does anyone know how to solve it? Or how to compile the amForth to X86? Where are the forth source of the core? Thnks and Best Regards. |
From: pito <pi...@vo...> - 2010-09-10 10:19:19
|
Hi, here is the data stack printed Vertically, TOS on rigt side. Currently HEX only, not optimised yet.. Pito \ Some new .s \ by Pito 2010-09-10 \ v3 WITH TOS ON RIGHT SIDE \ PRINTED VERTICALLY !!! \ not optimised yet marker -newdots : u.r ( s n -- ) 0 swap ud.r ; \ comment if installed variable temporary : num4 ( n -- n4th ) \ takes 4th nibble 8 rshift 4 rshift $f and ; \ WHY DOES SHIFT NOT WORK WITH WORD??? : num3 ( n -- n3rd ) \ takes 3rd nibble 8 rshift $f and ; \ WHY DOES SHIFT NOT WORK WITH WORD??? : num2 ( n -- n2nd ) \ takes 2nd nibble 4 rshift $f and ; \ WHY DOES SHIFT NOT WORK WITH WORD??? : num1 ( n -- n1st ) \ takes 1st nibble $f and ; \ WHY DOES SHIFT NOT WORK WITH WORD??? \ ONELINE HEXA STACK VERTICAL : .svh sp@ temporary ! ." [" depth dup 0 ?do dup 1- i - 2* temporary @ + base @ swap hex @ num4 1 u.r ." " base ! loop drop ." <T]" cr sp@ temporary ! ." [" depth dup 0 ?do dup 1- i - 2* temporary @ + base @ swap hex @ num3 1 u.r ." " base ! loop drop ." <O]" cr sp@ temporary ! ." [" depth dup 0 ?do dup 1- i - 2* temporary @ + base @ swap hex @ num2 1 u.r ." " base ! loop drop ." <S]" cr sp@ temporary ! ." [" depth dup 0 ?do dup 1- i - 2* temporary @ + base @ swap hex @ num1 1 u.r ." " base ! loop drop ." <H]" cr ; : stest1 .svh $ABCD .svh 20 0 do dup .svh cr loop 20 0 do drop .svh cr loop drop .svh cr ; ------------------------- ex: > stest1 [<T] [<O] [<S] [<H] [A <T] [B <O] [C <S] [D <H] [A A <T] [B B <O] [C C <S] [D D <H] [A A A <T] [B B B <O] [C C C <S] [D D D <H] [A A A A <T] [B B B B <O] [C C C C <S] [D D D D <H] [A A A A A <T] [B B B B B <O] [C C C C C <S] [D D D D D <H] [A A A A A A <T] [B B B B B B <O] [C C C C C C <S] [D D D D D D <H] [A A A A A A A <T] [B B B B B B B <O] [C C C C C C C <S] [D D D D D D D <H] [A A A A A A A A <T] [B B B B B B B B <O] [C C C C C C C C <S] [D D D D D D D D <H] [A A A A A A A A A <T] [B B B B B B B B B <O] [C C C C C C C C C <S] [D D D D D D D D D <H] [A A A A A A A A A A <T] [B B B B B B B B B B <O] [C C C C C C C C C C <S] [D D D D D D D D D D <H] [A A A A A A A A A A A <T] [B B B B B B B B B B B <O] [C C C C C C C C C C C <S] [D D D D D D D D D D D <H] [A A A A A A A A A A A A <T] [B B B B B B B B B B B B <O] [C C C C C C C C C C C C <S] [D D D D D D D D D D D D <H] [A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D D <H] [A A A A A A A A A A A A A <T] [B B B B B B B B B B B B B <O] [C C C C C C C C C C C C C <S] [D D D D D D D D D D D D D <H] [A A A A A A A A A A A A <T] [B B B B B B B B B B B B <O] [C C C C C C C C C C C C <S] [D D D D D D D D D D D D <H] [A A A A A A A A A A A <T] [B B B B B B B B B B B <O] [C C C C C C C C C C C <S] [D D D D D D D D D D D <H] [A A A A A A A A A A <T] [B B B B B B B B B B <O] [C C C C C C C C C C <S] [D D D D D D D D D D <H] [A A A A A A A A A <T] [B B B B B B B B B <O] [C C C C C C C C C <S] [D D D D D D D D D <H] [A A A A A A A A <T] [B B B B B B B B <O] [C C C C C C C C <S] [D D D D D D D D <H] [A A A A A A A <T] [B B B B B B B <O] [C C C C C C C <S] [D D D D D D D <H] [A A A A A A <T] [B B B B B B <O] [C C C C C C <S] [D D D D D D <H] [A A A A A <T] [B B B B B <O] [C C C C C <S] [D D D D D <H] [A A A A <T] [B B B B <O] [C C C C <S] [D D D D <H] [A A A <T] [B B B <O] [C C C <S] [D D D <H] [A A <T] [B B <O] [C C <S] [D D <H] [A <T] [B <O] [C <S] [D <H] [<T] [<O] [<S] [<H] ok > -12345 $FFE2 2200 0 -1 ok > .svh [C F 0 0 F <T] [F F 8 0 F <O] [C E 9 0 F <S] [7 2 8 0 F <H] ok > Pito |
From: pito <pi...@vo...> - 2010-09-10 00:35:27
|
Ni, based on Stefan's recommendation - everything in right->left and bottom-> up. Ufff! GRRRH! Pito \ Some new .s \ by Pito 2010-09-09 \ v2 WITH TOS AND TOR ON RIGHT SIDE \ WITH TOS AND TOR ON BOTTOM marker -newdots : u.r ( s n -- ) 0 swap ud.r ; \ comment if installed variable temporary : rdepth rp0 rp@ - 2/ 1- 1- ; \ ONELINE HEXA STACK : .slh sp@ temporary ! ." [" depth dup 0 ?do dup 1- i - 2* temporary @ + base @ swap hex @ 6 u.r base ! loop drop ." <TOSH]" ; \ ONELINE UNSIGNED STACK : .slu sp@ temporary ! ." [" depth dup 0 ?do dup 1- i - 2* temporary @ + base @ swap decimal @ 6 u.r base ! loop drop ." <TOSU]" ; \ ONELINE SIGNED STACK : .sls sp@ temporary ! ." [" depth dup 0 ?do dup 1- i - 2* temporary @ + base @ swap decimal @ 6 .r base ! loop drop ." <TOSS]" ; \ ONELINE SIGNED RSTACK : .rls rp@ 1- temporary ! \ alignment vs. .s ??? ." [" rdepth dup 0 ?do dup 1- i - 2* temporary @ + base @ swap decimal @ 6 .r base ! loop drop ." <TORS]" ; \ ONELINE UNSIGNED RSTACK : .rlu rp@ 1- temporary ! \ alignment vs. .s ??? ." [" rdepth dup 0 ?do dup 1- i - 2* temporary @ + base @ swap decimal @ 6 u.r base ! loop drop ." <TORU]" ; \ ONELINE HEXA RSTACK : .rlh rp@ 1- temporary ! \ alignment vs. .s ??? ." [" rdepth dup 0 ?do dup 1- i - 2* temporary @ + base @ swap hex @ 6 u.r base ! loop drop ." <TORH]" ; \ IN COLUMNS DSTACK ON BOTTOM NO ADDRR UNSIGNED SIGNED HEXA : .scb sp@ temporary ! depth dup 0 ?do dup 1- i - dup dup 0 = if ." TOS>|" drop else negate 4 .r ." |" then 2* temporary @ + \ dup 7 u.r ( prints the address ) dup dup base @ swap decimal @ 7 u.r base ! base @ swap decimal @ 7 .r base ! base @ swap hex @ 6 u.r base ! cr loop drop ; \ IN COLUMNS DSTACK ON BOTTOM WITH ADDRR UNSIGNED SIGNED HEXA : .sab sp@ temporary ! depth dup 0 ?do dup 1- i - dup dup 0 = if ." TOS>|" drop else negate 4 .r ." |" then 2* temporary @ + dup 7 u.r ." |" ( prints the address ) dup dup base @ swap decimal @ 7 u.r base ! base @ swap decimal @ 7 .r base ! base @ swap hex @ 6 u.r base ! cr loop drop ; \ IN COLUMNS RSTACK ON BOTTOM WITH ADDRR UNSIGNED SIGNED HEXA : .rcb rp@ 1- temporary ! rdepth dup 0 ?do dup 1- i - dup dup 0 = if ." TOR>|" drop else negate 4 .r ." |" then 2* temporary @ + \ dup 7 u.r ( prints the address ) dup dup base @ swap decimal @ 7 u.r base ! base @ swap decimal @ 7 .r base ! base @ swap hex @ 6 u.r base ! cr loop drop ; \ IN COLUMNS RSTACK ON BOTTOM WITH ADDRR UNSIGNED SIGNED HEXA : .rab rp@ 1- temporary ! rdepth dup 0 ?do dup 1- i - dup dup 0 = if ." TOR>|" drop else negate 4 .r ." |" then 2* temporary @ + dup 7 u.r ." |" ( prints the address ) dup dup base @ swap decimal @ 7 u.r base ! base @ swap decimal @ 7 .r base ! base @ swap hex @ 6 u.r base ! cr loop drop ; \ a quick test for oneline .s marker -testsdtot : .sla cr .sls cr .slu cr .slh ; : stest1 $AAAA .sla cr 5 0 do dup .sla cr loop 5 0 do drop .sla cr loop drop .sla cr ; : ? .sls cr .rls cr ; : rtest ? -8888 -8888 -8888 -8888 ? >r ? >r ? >r ? >r ? r> ? r> ? r> ? r> ? drop drop drop drop ? ; : rtest1 .rls ; : rtest2 rtest1 ; : rtest3 rtest2 ; : rtestc1 cr .rab ; : rtestc2 rtestc1 ; : rtestc3 rtestc2 ; --------------------------------------------- Examples: > stest1 [-21846<TOSS] [ 43690<TOSU] [ AAAA<TOSH] [-21846-21846<TOSS] [ 43690 43690<TOSU] [ AAAA AAAA<TOSH] [-21846-21846-21846<TOSS] [ 43690 43690 43690<TOSU] [ AAAA AAAA AAAA<TOSH] [-21846-21846-21846-21846<TOSS] [ 43690 43690 43690 43690<TOSU] [ AAAA AAAA AAAA AAAA<TOSH] [-21846-21846-21846-21846-21846<TOSS] [ 43690 43690 43690 43690 43690<TOSU] [ AAAA AAAA AAAA AAAA AAAA<TOSH] [-21846-21846-21846-21846-21846-21846<TOSS] [ 43690 43690 43690 43690 43690 43690<TOSU] [ AAAA AAAA AAAA AAAA AAAA AAAA<TOSH] [-21846-21846-21846-21846-21846<TOSS] [ 43690 43690 43690 43690 43690<TOSU] [ AAAA AAAA AAAA AAAA AAAA<TOSH] [-21846-21846-21846-21846<TOSS] [ 43690 43690 43690 43690<TOSU] [ AAAA AAAA AAAA AAAA<TOSH] [-21846-21846-21846<TOSS] [ 43690 43690 43690<TOSU] [ AAAA AAAA AAAA<TOSH] [-21846-21846<TOSS] [ 43690 43690<TOSU] [ AAAA AAAA<TOSH] [-21846<TOSS] [ 43690<TOSU] [ AAAA<TOSH] [<TOSS] [<TOSU] [<TOSH] ok > rtest [<TOSS] [ 0 934 1539 14535 14526 13987<TORS] [ -8888 -8888 -8888 -8888<TOSS] [ 0 934 1539 14544 14526 13987<TORS] [ -8888 -8888 -8888<TOSS] [ 0 934 1539 -8888 14546 14526 13987<TORS] [ -8888 -8888<TOSS] [ 0 934 1539 -8888 -8888 14548 14526 13987<TORS] [ -8888<TOSS] [ 0 934 1539 -8888 -8888 -8888 14550 14526 13987<TORS] [<TOSS] [ 0 934 1539 -8888 -8888 -8888 -8888 14552 14526 13987<TORS] [ -8888<TOSS] [ 0 934 1539 -8888 -8888 -8888 14554 14526 13987<TORS] [ -8888 -8888<TOSS] [ 0 934 1539 -8888 -8888 14556 14526 13987<TORS] [ -8888 -8888 -8888<TOSS] [ 0 934 1539 -8888 14558 14526 13987<TORS] [ -8888 -8888 -8888 -8888<TOSS] [ 0 934 1539 14560 14526 13987<TORS] [<TOSS] [ 0 934 1539 14565 14526 13987<TORS] ok > rtest1 [ 0 934 1539 14573 13987<TORS] ok > rtest2 [ 0 934 1539 14581 14573 13987<TORS] ok > rtest3 [ 0 934 1539 14589 14581 14573 13987<TORS] ok > rtestc1 -4| 16634| 0 0 0 -3| 16632| 934 934 3A6 -2| 16630| 1539 1539 603 -1| 16628| 14599 14599 3907 TOR>| 16626| 14427 14427 385B ok > rtestc2 -5| 16634| 0 0 0 -4| 16632| 934 934 3A6 -3| 16630| 1539 1539 603 -2| 16628| 14608 14608 3910 -1| 16626| 14599 14599 3907 TOR>| 16624| 14427 14427 385B ok > rtestc3 -6| 16634| 0 0 0 -5| 16632| 934 934 3A6 -4| 16630| 1539 1539 603 -3| 16628| 14617 14617 3919 -2| 16626| 14608 14608 3910 -1| 16624| 14599 14599 3907 TOR>| 16622| 14427 14427 385B ok > .s ok > 1 2 3 4 5 6 7 8 9 10 ok > .slh [ 1 2 3 4 5 6 7 8 9 A<TOSH] ok > .sls [ 1 2 3 4 5 6 7 8 9 10<TOSS] ok > .slu [ 1 2 3 4 5 6 7 8 9 10<TOSU] ok > .scb -9| 1 1 1 -8| 2 2 2 -7| 3 3 3 -6| 4 4 4 -5| 5 5 5 -4| 6 6 6 -3| 7 7 7 -2| 8 8 8 -1| 9 9 9 TOS>| 10 10 A ok > .sab -9| 16381| 1 1 1 -8| 16379| 2 2 2 -7| 16377| 3 3 3 -6| 16375| 4 4 4 -5| 16373| 5 5 5 -4| 16371| 6 6 6 -3| 16369| 7 7 7 -2| 16367| 8 8 8 -1| 16365| 9 9 9 TOS>| 16363| 10 10 A ok > |
From: Marcin C. <sa...@sa...> - 2010-09-10 00:18:12
|
Two quick remarks: >> 2. how the data from data stack (or from return stack) are passed to >> assembler - data stack (all elements EXCEPT top of the stack) are kept close to the end of RAM (end of RAM - 128), growing down. - TOP of the stack is kept in register pair (tosh:tosl) >> 3. how the data are passed from asm. back to data stack or return >> stack - if you just change top of the stack (say remove 1 parameter and put 1 cell of results) just change contents of tosh:tosl registers - "loadtos" macro fetches the second item on stack and loads it into the tosh:tosl, while moving stack pointer down - - so it effectively the same as DROP. Of course, if one needs to preserve top of stack another "ld" command can be used to load 2nd, 3rd, etc. elements into other registers. - "storetos" macro stores the TOS on to the stack, therefore it is how DUP is implemented. If you want just to push something on stack just "storetos" and modify tosh:tosl. - return stack is the machine stack. it starts at the end of RAM and grows downward (toward smaller addresses), the same direction as the data stack. It means you have 128 bytes (64 16-bit words) for the return stack available by default. - second item on a data stack is pointed by the YH:YL register pair - push, pop operate on the return stack then (see >r, r>, r@) - inner interpreter stores current Forth instruction pointer in the register pair XH:XL and pushes it/pops off the return stack as necessary. It's all in amforth.asm - first 87 lines --Marcin |
From: Kalus M. <mic...@on...> - 2010-09-09 18:49:55
|
Am 09.09.2010 um 20:10 schrieb Matthias Trute: ... > 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). and goes like this: <snip> sei ; global interupt enable. push XL push XH lds XL,0x5F ; status register push XL .. maybe you have to include even more registers push R22 ; tosl = r22 push R23 ; tosh = r23 push R24 ; wl push R25 ; wh push YL push YH push ZL push ZH ... <your code> ... ; switch to high level forth: : sei ldi XL,low(pfa_forthISR) ldi XH,high(pfa_forthISR) jmp DO_NEXT ; -- pointer to NEXT word: pfa_forthISR: .dw XT_MAINWORD ; -- come back to code: .dw PC+1 ; next IP .dw PC+1 ; next cfa ... <more of your code> ... pop ZH pop ZL pop YH pop YL pop R25 pop R24 pop R23 pop R22 .. maybe you have to include even more registers pop XL sts 0x5F,XL pop XH pop XL jmp DO_NEXT (or RTI if you are in an ISR) </snip> see examples in paper VD1/2010 http://www.forth-ev.de/filemgmt/ viewcat.php?cid=53 worked with amforth3.6 still good with 4.1? Michael |
From: Matthias T. <mt...@we...> - 2010-09-09 18:33:41
|
him > 10. how the local .asm variables (used in asm rouitne shall be > handled (e.g. where in ram to place the local variables). If you use Lubos assembler, you can allocate RAM and use the address. The assembler is, after all, forth code which compiles machine code. When using the avrasm, there are examples in the source tree: e.g. base.asm or any other variable. IMHO not trivial, but no real secrets. Matthias |
From: Matthias T. <mt...@we...> - 2010-09-09 18:29:59
|
Pito, > The example could be the timer int routine: > : tick_isr _one timer 2@ d+ timer 2! ; > which does "timer = timer + 1" where timer is double integer. I've > seen usart routines and Lubos' routines in asm, however generaly the > Q: > > 1. is there any recommended structure or frame for writing assembler > words Just look at Lubos' examples. He has written quite a lot (e.g. for sd card access via SPI or optimized bit level access) > 1a. is there any recomemnded structure or frame for writing > assembler interrupt handlers A definition starts with "code", which creates the dictionary entry. Everything else need to compile real machine code, the last instruction has to be end-code, which compiles the jump instruction back to forth. Everything in between is yours, completly. > 2. how the data from data stack (or from return stack) are passed to > assembler > 3. how the data are passed from asm. back to data stack or return > stack > 4. how the external variables (defined as words) are accessed from > assembler > 5. how the data stack is duped or droped from assembler The assembler has full control once the code is started. And the full responsibility to keep everything intact. If you modify vital registers, you may crash the system easily. > 6. what shall be poped and pushed in asm. routine (when entering and > leaving it) > 7. how the asm return stack is handled (imagine we need nested calls > in asm) > 8. how the ram, eprom can be accessed from asm RAM is easy: there are machine instruction like ld and st (with variants). I'd recommend studying the atmel assembler document (doc0856.pdf) from there website. There are >>100 different instructions available. Everything else is increasingly complex, you can read (and duplicate) the code from the words/*.asm files, there are some code words. > 9. how the asm code shall be compiled (? via LP's asm or via > avrasm.) I use the avrasm. Lubos' assembler has been checked to work correctly so I think its a matter of taste: flashing a completly new hex image or using the terminal prompt. YMMV Matthias |
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 |
From: Matthias T. <mt...@we...> - 2010-09-09 18:04:26
|
Pito, > > then I see at sp0 = 16383 is 0. Why the 111 is written to 16381 > (low) and 16382 (high) and not to 16382 (low) and 16383 (high)? Not > so important, only the alignment of words on odd addresses is > something unusual to see..P. That is a direct effect of placing the stacks at the last available address. You can change it by setting the stack start addresses in the template.asm (or whatever your application master file is). Your .s variants are interesting indeed, and a matter of personal taste which one to choose. I'll keep my version ;=) Matthias |
From: pito <pi...@vo...> - 2010-09-09 08:57:51
|
Stefan, thanks for the feedback! Both [TOS> ] and [TOR> ] are coded to have tos, tor on lefthandside. Of course the utility is for fun, so you may change that. For me is much more natural to see stack closer to the prompt as this is TOP. So you can see immediately what in on top of stack. Also the blowing stack from left to right is more natural for me. We even wright from left to right and read as well. I am playing golf left handed too, so I did not think a second where to place TOP. Frankly, I have to study the rules for writing the comment on stack e.g. I did in get.rtc ( -- tos> YY MM WD DD HH MM SS )...to be on safe side. Pito. > On the other hand, I must admit, it's somewhat > non-intuitive > to have the _top_ of the stack displayed at the > _bottom_ of > the screen. ;-) > > Stefan > |
From: pito <pi...@vo...> - 2010-09-09 08:46:08
|
A shorter get.rtc for the PCF8563 RTC library: : get.rtc ( -- tos> YY MM WD DD HH MM SS ) 2 \ start address 1 i2c_addr_rtc >i2c \ send > rtc 7 i2c_addr_rtc <i2c \ read 7 Bytes >r >r >r >r >r >r >r \ removes garbage r> $7f and \ SS r> $7f and \ MM r> $3f and \ HH r> $3f and \ DD r> $07 and \ WeekDay r> $1f and \ MONTH r> $ff and \ YY ; Ex: > printdate.rtc 2010/09/09-04-10:44:48 ok > p. |
From: pito <pi...@vo...> - 2010-09-08 23:54:30
|
Hi, enclosed pls find the driver for PCF8563 RTC. Enjoy, Pito. \ i2c_rtc_PCF8563.frt \ read/set time on PCF8563 real time clock \ Pito 9/2010 \ based on EW lib 2008 PCF8583, bcd>dec, needs i2c.frt, twi.frt \ words: get.rtc ( -- x0 .. x5 yy ) \ set.rtc ( Y m wd d H M S -- ) \ printdate.rtc ( Y m wd d H M S -- ) \ PCF8563: \ addr \ 0x00 control1 \ 0x01 control2 \ 0x02 6-0: sec.bcd \ 0x03 6-0: min.bcd \ 0x04 5-0: hour.bcd \ 0x05 5-0: day.bcd \ 0x06 2-1: weekday.bin \ 0x07 4-0: month.bcd \ 0x08 7-0: year.bcd / 00-99 marker -driverPCF8563 hex a2 constant i2c_addr_rtc decimal : bcd>dec ( n.bcd -- n.dec ) 255 and dup 4 rshift 10 * \ extract high nibble as 10s swap 15 and \ extract low nibble as 1s + \ add ; : dec>bcd ( n.dec -- n.bcd ) 100 mod \ 99 is largest for 8 bit bcd 10 /mod 4 lshift + 255 and \ truncate to 8 bit ; : get.rtc ( -- tos> YY MM WD DD HH MM SS ) 2 \ start address 1 i2c_addr_rtc >i2c \ send > rtc 6 i2c_addr_rtc <i2c \ read 6 Bytes 8 \ YEAR's address 1 i2c_addr_rtc >i2c \ send > rtc 1 i2c_addr_rtc <i2c \ read 1 Byte >r >r >r >r >r >r >r \ removes garbage r> $7f and \ SS r> $7f and \ MM r> $3f and \ HH r> $3f and \ DD r> $07 and \ WeekDay r> $1f and \ MONTH r> $ff and \ YY ; : u0.r ( u n -- ) \ uncomment when installed >r 0 <# r> 0 ?do # loop #> type ; \ > printdate.rtc \ 2010/09/08-03-23:25:49 ok \ 2010/09/08 23:18:18 ok : printdate.rtc ( SS MM HH DD WD MM YY -- ) get.rtc ." 20" bcd>dec 2 u0.r \ year 47 emit \ / bcd>dec 2 u0.r \ month 47 emit \ / swap \ WeekD <-> date bcd>dec 2 u0.r \ date 45 emit \ - 2 u0.r \ weekday 45 emit \ - \ drop ." " \ < comment this and uncomment out wd bcd>dec 2 u0.r \ hh 58 emit \ : bcd>dec 2 u0.r \ mm 58 emit \ : bcd>dec 2 u0.r \ ss ; \ convert human readable decimal numbers to expected \ BCD numbers : format2bcd.rtc ( dec: YY MM WD DD HH MM SS -- bcd: YY MM WD DD HH MM SS ) \ YY MM WD DD HH MM SS dec>bcd >r \ sec.bcd dec>bcd >r \ min.bcd dec>bcd >r \ hour.bcd dec>bcd >r \ day.bcd >r \ weekday.bin dec>bcd >r \ month.bcd dec>bcd >r \ year.bcd r> r> r> r> r> r> r> ; \ convert human unreadable packed BCD numbers to readable \ decimal numbers : format2dec.rtc ( bcd: YY MM WD DD HH MM SS -- dec: YY MM WD DD HH MM SS ) \ YY MM WD DD HH MM SS bcd>dec >r \ sec.bcd bcd>dec >r \ min.bcd bcd>dec >r \ hour.bcd bcd>dec >r \ day.bcd >r \ weekday.bin bcd>dec >r \ month.bcd bcd>dec >r \ year.bcd r> r> r> r> r> r> r> ; : set.rtc ( YY MM WD DD HH MM SS -- ) format2bcd.rtc 0 $20 0 \ stop rtc, bit5 = 1, CNTRL0 10 i2c_addr_rtc >i2c \ send all args 0 0 2 i2c_addr_rtc >i2c \ start rtc ; |
From: Stefan S. <ssc...@ss...> - 2010-09-08 21:05:24
|
Hi pito, Thanks for the stack printing words. I suggest to have the tos at the right or bottom end, for two reasons: - In case there are many values on the stack, having the tos at the end avoids scrolling the "top" value off the visible screen. - Having the tos at the right is consistent with the order in stack comments. On the other hand, I must admit, it's somewhat non-intuitive to have the _top_ of the stack displayed at the _bottom_ of the screen. ;-) Stefan |
From: pito <pi...@vo...> - 2010-09-08 16:56:24
|
.. and my not so elegant code, it works as well and is commented a little bit. Good for beginners who are not reading forth's sources.. Thanks a lot Marcin, your code is of course optimised to the bones..Pito \ Assembler demo \ ATmega 1284p, amforth 4.0 \ v68.0, Pito 9/2010 marker -asstest : loadtos, R24 Y+ ld, R25 Y+ ld, ; \ define macro : savetos, -Y R25 st, -Y R24 st, ; \ tosl=R24, tosh=R25 code ++_ \ ( x1 x2 x3 -- x4 ) \ R8 R6 - tmp reg. \ x3 already in tos R8 R24 mov, R6 R25 mov, \ tmp = x3 \ drop x3 loadtos, \ x2 in tos R8 R24 add, R6 R25 adc, \ add tmp = x3 + x2 \ drop x2 loadtos, \ x1 in tos R8 R24 add, R6 R25 adc, \ add tmp = x3 + x2 + x1 \ drop x1 loadtos, \ put x4 on tos, x4 = tmp R24 R8 mov, R25 R6 mov, savetos, end-code ---------------------------- Ex: > 1111 2222 3333 ++_ . .sls 6666 [TOS> ] ok > 30000 -28000 -4000 ++_ . .sls -2000 [TOS> ] ok > -30000 15000 15000 ++_ . .sls 0 [TOS> ] ok > |
From: Marcin C. <sa...@sa...> - 2010-09-08 12:09:47
|
On Wed, 8 Sep 2010, pito wrote: > A version with unused registers, crashes (anforth 4.0, > assembler.frt). > > \ Manual v 4.0 : The registers from R10 to R13 are currently unused, > > \ but may be used for the VM extended registers X and Y sometimes. > > code ++_ \ ( x1 x2 x3 -- x4 ) Looking at my assembly listing: .def temp0 = r16 .def temp1 = r17 .def tosl = r24 .def tosh = r25 PFA_PLUS: C:0039ab 9109 ld temp0, Y+ C:0039ac 9119 ld temp1, Y+ C:0039ad 0f80 add tosl, temp0 C:0039ae 1f91 adc tosh, temp1 C:0039af ce5e rjmp DO_NEXT So, that means that simple ld temp0, Y+ ld temp1, Y+ add tosl, temp0 adc tosh, temp1 ld temp0, Y+ ld temp1, Y+ add tosl, temp0 adc tosh, temp1 rjmp DO_NEXT should do the trick. Doing in Forth: R16 constant temp0 R17 constant temp1 R24 constant tosl R25 constant tosh code ++_ temp0 Y+ ld, temp1 Y+ ld, tosl temp0 add, tosh temp1 adc, temp0 Y+ ld, temp1 Y+ ld, tosl temp0 add, tosh temp1 adc, end-code hex 1000 100 10 ++_ . 1110 ok 1111 222 33 ++_ . 1366 ok It's really beneficial to study existing assembler code! It also is immediately clear that ++_ is the equivalent of + + - what I did is just + operation inlined twice. --Marcin |
From: Marcin C. <sa...@sa...> - 2010-09-08 11:13:13
|
Small tidbits from 4.1: avra complains with 2r>: [exec] ../../core/words/2r_from.asm(6) : Warning : A .DB segment with an odd number of bytes is detected. A zero byte is added. Fix: Index: 2r_from.asm =================================================================== --- 2r_from.asm (wersja 939) +++ 2r_from.asm (kopia robocza) @@ -3,7 +3,7 @@ ; move DTOR to TOS VE_2R_FROM: .dw $ff03 - .db "2r>" + .db "2r>",0 .dw VE_HEAD .set VE_HEAD = VE_2R_FROM XT_2R_FROM: I think that .include "words/2literal.asm" .include "words/2to_r.asm" .include "words/2r_from.asm" could go into some separate dict file for easy inclusion ("dict_2x.inc" ?). They use rjmp, so I include them in my high memory (dict_appl_core.inc) in "core/words" we have "d-invert.asm" (coded in assembler) and "dinvert.asm" (in Forth). I think we don't need the Forth one. I tried to add "tibsize.asm", but it complains that we have no EE_TIBSIZE. It seems that there is no such thing. --Marcin |
From: pito <pi...@vo...> - 2010-09-08 11:01:41
|
A version with unused registers, crashes (anforth 4.0, assembler.frt). \ Manual v 4.0 : The registers from R10 to R13 are currently unused, \ but may be used for the VM extended registers X and Y sometimes. code ++_ \ ( x1 x2 x3 -- x4 ) R10 push, \ save everything R11 push, R12 push, \ shall this be pushed and popped ? R13 push, R10 0 ldi, \ x4 - accumulates result, zero it R11 0 ldi, R12 Y+ ld, \ loadtos R13 Y+ ld, \ load data x3 from stack R10 R12 add, \ add x4 = x3 + 0 R11 R13 adc, R12 Y+ ld, R13 Y+ ld, \ load data x2 from stack R10 R12 add, \ add x4 = x2 + x3 + 0 R11 R13 adc, R12 Y+ ld, R13 Y+ ld, \ load data x1 from stack R10 R12 add, \ add x4 = x1 + x2 + x3 + 0 R11 R13 adc, R12 R10 mov, \ mov x4 to, R12 R10 movw, R13 R11 mov, -Y R13 st, \ savetos, save x4 to tos -Y R12 st, R13 pop, \ load back everything R12 pop, R11 pop, R10 pop, end-code |
From: pito <pi...@vo...> - 2010-09-08 10:27:10
|
Marcin, yes to study the manual is important! However, we do not do it quite often.. I've seen the manual and therefore I am using register allowed. loadtos and savetos works with 24 and 25(? as used in loadtos, savetos), and I used 10-13 and 14-21 for ++_ routine. However results differs. So my understanding is you shall be careful to use those registers so freely as described in manual. Maybe someone experienced helps with the bug in the ++_ routine, which crashes: code ++_ \ ( x1 x2 x3 -- x4 ) R10 push, \ save everything R11 push, R24 push, \ shall this be pushed and popped ? R25 push, R10 0 ldi, \ x4 - accumulates result, zero it R11 0 ldi, R24 Y+ ld, \ loadtos R25 Y+ ld, \ load data x3 from stack R10 R24 add, \ add x4 = x3 + 0 R11 R25 adc, R24 Y+ ld, R25 Y+ ld, \ load data x2 from stack R10 R24 add, \ add x4 = x2 + x3 + 0 R11 R25 adc, R24 Y+ ld, R25 Y+ ld, \ load data x1 from stack R10 R24 add, \ add x4 = x1 + x2 + x3 + 0 R11 R25 adc, R24 R10 mov, \ mov x4 to R25,24 R24 R10 movw, R25 R11 mov, \ R24 255 ldi, \ for testing purposes \ R25 128 ldi, -Y R25 st, \ savetos, save x4 to tos -Y R24 st, R25 pop, \ load back everything R24 pop, R11 pop, R10 pop, end-code |
From: Marcin C. <sa...@sa...> - 2010-09-08 09:41:00
|
On Wed, 8 Sep 2010, pito wrote: > Marcin, I am ansewering to you in this thread: No, R16 and R17 are > ok for my cpu, but not correct from OS prospecive. I've spent a > sleepless night with playing with registers against definitions in > macros.asm (it seems Registers 10,11,12,13, are not used by OS but > in reality code crashes) and the preliminary result is: pito, please please - study the Amforth 4.0 Technical Guide - part 4.2 describes the register usage. Second, please do study the assembler listing (the large file I told you once to generate) - it contains whole source of the amforth compiled *including* generated machine code - this is the best for debugging assembly. --Marcin |
From: pito <pi...@vo...> - 2010-09-08 09:29:24
|
Marcin, I am ansewering to you in this thread: No, R16 and R17 are ok for my cpu, but not correct from OS prospecive. I've spent a sleepless night with playing with registers against definitions in macros.asm (it seems Registers 10,11,12,13, are not used by OS but in reality code crashes) and the preliminary result is: \ ----- Test AvrAsm ----- \ : loadtos, 16 Y+ ld, 17 Y+ ld, ; \ define macro \ : savetos, -Y 17 st, -Y 16 st, ; \ tosl=r22, tosh=r23 : loadtos, 24 Y+ ld, 25 Y+ ld, ; \ define macro : savetos, -Y 25 st, -Y 24 st, ; \ tosl=r22, tosh=r23 code dup_ savetos, end-code \ insert asm code code drop_ loadtos, end-code code ++_ \ ( x1 x2 x3 -- x4 ) R18 push, R19 push, \ R24 push, \ R25 push, R18 0 ldi, R19 0 ldi, R24 Y+ ld, R25 Y+ ld, R18 R24 add, R19 R25 adc, R24 Y+ ld, R25 Y+ ld, R18 R24 add, R19 R25 adc, R24 Y+ ld, R25 Y+ ld, R18 R24 add, R19 R25 adc, R24 R18 mov, R25 R19 mov, \ R24 255 ldi, \ R25 128 ldi, -Y R25 st, -Y R24 st, \ R25 pop, \ R24 pop, R19 pop, R18 pop, end-code > 100 200 300 ++_ ok > .s 0 16381 28171 ok > 100 200 300 ++_ ok > .s 0 16379 28471 1 16381 28471 ok > > 100 dup_ ok > .s 0 16379 100 1 16381 100 ok > 300 dup_ ok > .s 0 16375 300 1 16377 300 2 16379 100 3 16381 100 ok > drop_ ok > .s 0 16377 300 1 16379 100 2 16381 100 ok > drop_ drop_ drop_ ok > .s ok > The loadtos and savetos works somehow, but I am not able to run ++_ My current understanding is something still overwrites registers used. Based on used set of registers the results vary. It would be nice to have a list (or a brief Guide) which Registers one may use in such assembler run within forth. Pito ----- PŮVODNÍ ZPRÁVA ----- Od: "pito" <pi...@vo...> Komu: sa...@sa..., amf...@li... Předmět: [Amforth-devel] Assembler - initial issues or bug Datum: 8.9.2010 - 1:52:22 > 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 > > code dup_ savetos, end-code \ insert asm code > code drop_ loadtos, end-code > > and I get: > > 10 dup_ > ok > > .s > 0 16379 10 > 1 16381 9546 > ok > > 20 dup_ > ok > > .s > 0 16375 20 > 1 16377 9546 > 2 16379 10 > 3 16381 9546 > ok > > drop_ drop_ > ok > > .s > 0 16379 20 > 1 16381 9546 > ok > > > > the ++_ demo crashes... Any help, new update, or I > did something > wrong (I loaded assembler.frt of course). P. > > > ------------------------------------------------------------------------------ > > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > Amforth-devel mailing list > Amf...@li... > https://lists.sourceforge.net/lists/listinfo/amforth-devel |
From: Marcin C. <sa...@sa...> - 2010-09-08 09:08:03
|
On Wed, 8 Sep 2010, pito wrote: > 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 > > code dup_ savetos, end-code \ insert asm code > code drop_ loadtos, end-code On my ATmegas (328P) this works fine: decimal : loadtos, 24 Y+ ld, 25 Y+ ld, ; : savetos, -Y 25 st, -Y 24 st, ; TOS is in r24/r25 (check your loadtos/storetos macro in your assembler listing). --Marcin |