As a quick solution - this works (optimal?) - led0 shows do_next and
led1 shows do_interrupt activities (amforth-interpreter.asm):

; the inner interpreter.
DO_DODOES:
savetos
movw tosl, wl
adiw tosl, 1
; the following takes the address from a real uC-call
.if (pclen==3)
pop wh ; some 128K Flash devices use 3 cells for call/ret
.endif
pop wh
pop wl

push XH
push XL
movw XL, wl
rjmp DO_NEXT

DO_COLON:
push XH
push XL          ; PUSH IP
movw XL, wl
adiw xl, 1       ; >BODY
DO_NEXT:
; ### Pito, portb0 cbi = led_off
sbi DDRB, 0
cbi PORTB, 0
; ###
; ### Pito, portb1 cbi = led_off
sbi DDRB, 1
cbi PORTB, 1
; ###
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
; ### Pito, portb0 sbi = led_on
sbi DDRB, 0
sbi PORTB, 0
; ###
ijmp

DO_INTERRUPT:
; here we deal with interrupts the forth way
; ### Pito, portb1 sbi = led_on
sbi DDRB, 1
sbi PORTB, 1
; ###
clt
ldi wl, LOW(XT_ISREXEC)
ldi wh, HIGH(XT_ISREXEC)
rjmp DO_EXECUTE



-------------------------

----- PŮVODNÍ ZPRÁVA -----
Od: "pito" <p...@volna.cz>
Komu: amforth-devel@lists.sourceforge.net
Předmět: [Amforth] Interpreter activity monitor
Datum: 4.6.2011 - 11:22:51

> Hi, for debugging/educative purposes I'd like to
> monitor the
> activity of the inner interpreter. The idea is it
> to have an led
> switched on/off when running through the
> interpreter, so I can see
> the interpreter interprets words and the program
> is running.
> Moreover, I can maesure the processes with oscope.
> Now the Q: where is the best place to place the
> led_on and led_off
> within the inner interpreter to get as much as
> possible info? P.
> 
> 
> -- 
> IHNED.cz je nový, přehlednější a rychlejší.
> Přesvědčte se na:
> www.ihned.cz
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> > Simplify data backup and recovery for your virtual
> environment with vRanger.
> Installation's a snap, and flexible recovery
> options mean your data is safe,
> secure and there when you need it. Discover what
> all the cheering's about.
> Get your free trial download today. 
> http://p.sf.net/sfu/quest-dev2dev2 
> _______________________________________________
> Amforth-devel mailing list
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel
> 


------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Amforth-devel mailing list
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to