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
(7) |
Sep
(9) |
Oct
|
Nov
(4) |
Dec
|
|
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 |
|
From: Marcin C. <sa...@sa...> - 2010-09-08 08:49:20
|
On Wed, 8 Sep 2010, Kalus Michael wrote: > Hi. > > Is there a readme.txt or so giving hints how to establish the > communicate via the USB of arduino board, after the > duemilanove.eep.hex and duemilanove.hex are flashed successfully? > > Friends keep complaining not getting the ok using it from the shelf > (ver4.1). > There are various Linux in use and Windows as well. It works just fine for me without any problems - connecting tip (or screen) to the USB serial port using speed 19200 (or 9600 if you use defaults). What needs to be observed are correct fuse settings - the AVR should start from $0000 and not from the bootloader. I am using http://www.engbedded.com/fusecalc to get fuses right and one needs to have Boot Reset vector Enabled (default address=$0000); [BOOTRST=0] unchecked. For ATmega328P I have: avrdude: Device signature = 0x1e950f avrdude: safemode: lfuse reads as FF avrdude: safemode: hfuse reads as D9 avrdude: safemode: efuse reads as 5 For ATmega168 I have: avrdude: Device signature = 0x1e9406 avrdude: safemode: lfuse reads as FF avrdude: safemode: hfuse reads as DD avrdude: safemode: efuse reads as 1 Hope this helps! --Marcin |
|
From: Kalus M. <mic...@on...> - 2010-09-08 04:38:37
|
Hi. Is there a readme.txt or so giving hints how to establish the communicate via the USB of arduino board, after the duemilanove.eep.hex and duemilanove.hex are flashed successfully? Friends keep complaining not getting the ok using it from the shelf (ver4.1). There are various Linux in use and Windows as well. Michael |
|
From: Marcin C. <sa...@sa...> - 2010-09-08 00:47:53
|
On Wed, 8 Sep 2010, pito wrote: > Marcin, thanks! So when I dump: > > 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. Why not? That's because that's the way loadtos and savetos macros are constructed. low byte goes to the low address (even). There is no requirement to align words on a word boundary. Which leads me to another point: 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 Maybe 16, 17 are wrong values for your CPU? --Marcin |
|
From: pito <pi...@vo...> - 2010-09-07 23:52:31
|
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. |
|
From: pito <pi...@vo...> - 2010-09-07 23:34:11
|
Marcin, thanks! So when I dump: > sp0 . 16383 ok > 111 222 333 444 ok > dump 0 16375 444 1 16377 333 2 16379 222 3 16381 111 4 16383 0 5 16385 51 ok > .s 0 16375 444 1 16377 333 2 16379 222 3 16381 111 ok > 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. |
|
From: Marcin C. <sa...@sa...> - 2010-09-07 22:10:19
|
Hello, This is just to announce that this very mailing list is available also via NNTP (newsreader) or HTTP (web browser) at gmane.org. Just point your newsreader to: nntp://news.gmane.org/gmane.comp.lang.forth.amforth or go to: http://dir.gmane.org/gmane.comp.lang.forth.amforth and pick one of the three web interfaces available. An archive of almost all previous post is there, so the context is (mostly) preseved. Have fun! --Marcin |
|
From: Marcin C. <sa...@sa...> - 2010-09-07 20:21:19
|
On Tue, 7 Sep 2010, pito wrote: > Hi Matthias, > not sure, but I think the >> 123 345 567 > ok >> .s > 0 16377 567 > 1 16379 345 > 2 16381 123 > ok >> sp0 . > 16383 ok > > shall be in following form (when assuming lower byte first). Am I > right? >> .s > 0 16378 567 > 1 16380 345 > 2 16382 123 Nope. 2223 ok > .s ok > 2 ok > 3 ok > 4 ok > sp0 . 2223 ok > .s 0 2217 4 <-- sp@ 1 2219 3 2 2221 2 (2223) <-- sp0 > sp@ . 2217 ok A cell is 2 bytes (a word) wide. --Marcin |
|
From: pito <pi...@vo...> - 2010-09-07 19:26:46
|
Hi Matthias, not sure, but I think the > 123 345 567 ok > .s 0 16377 567 1 16379 345 2 16381 123 ok > sp0 . 16383 ok shall be in following form (when assuming lower byte first). Am I right? > .s 0 16378 567 1 16380 345 2 16382 123 P. |
|
From: pito <pi...@vo...> - 2010-09-07 18:36:31
|
Hi, here is an utility which help you see the Rstack: \ based on .s, Pito 2010 marker -rstackdump : rdepth rp0 rp@ - 2/ 1- 1- ; \ ONE LINE SIGNED RSTACK : .rls rp@ 1- \ alignment vs. .s ??? ." [TOR> " rdepth 1- 0 ?do dup i 2* + @ 6 .r loop drop ." ]" ; ---------------------- Ex: : ? .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 ; > rtest [TOS> ] [TOR> 10748 10761 10770 1539 934] [TOS> -8888 -8888 -8888 -8888] [TOR> 10748 10761 10779 1539 934] [TOS> -8888 -8888 -8888] [TOR> 10748 10761 10781 -8888 1539 934] [TOS> -8888 -8888] [TOR> 10748 10761 10783 -8888 -8888 1539 934] [TOS> -8888] [TOR> 10748 10761 10785 -8888 -8888 -8888 1539 934] [TOS> ] [TOR> 10748 10761 10787 -8888 -8888 -8888 -8888 1539 934] [TOS> -8888] [TOR> 10748 10761 10789 -8888 -8888 -8888 1539 934] [TOS> -8888 -8888] [TOR> 10748 10761 10791 -8888 -8888 1539 934] [TOS> -8888 -8888 -8888] [TOR> 10748 10761 10793 -8888 1539 934] [TOS> -8888 -8888 -8888 -8888] [TOR> 10748 10761 10795 1539 934] [TOS> ] [TOR> 10748 10761 10800 1539 934] ok > .rls [TOR> 10748 1539 934] ok > rtest1 [TOR> 10748 10808 1539 934] ok > rtest2 [TOR> 10748 10808 10816 1539 934] ok > rtest3 [TOR> 10748 10808 10816 10824 1539 934] ok > |
|
From: pito <pi...@vo...> - 2010-09-07 06:51:28
|
10. how the local .asm variables (used in asm rouitne shall be handled (e.g. where in ram to place the local variables). ----- PŮVODNÍ ZPRÁVA ----- Od: "pito" <pi...@vo...> Komu: amf...@li... Předmět: HOW TO - Assembler in anmforth Datum: 7.9.2010 - 8:42:46 > Hi Matthias and co., > I'd like to ask how to start working with > assembler in amforth. This > might be of general interest, therefore HOW TO. > 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 > 1a. is there any recomemnded structure or frame > for writing > assembler interrupt handlers > 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 > 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 > 9. how the asm code shall be compiled (? via LP's > asm or via > avrasm.) > > Thanks, Pito > |