To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.pbforthOpen lugnet.robotics.rcx.pbforth in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / pbFORTH / 402
401  |  403
Subject: 
A reset key for pbforth
Newsgroups: 
lugnet.robotics.rcx.pbforth
Date: 
Mon, 30 Oct 2000 20:35:44 GMT
Viewed: 
1510 times
  
Hi all,

as I am one of those people who cannot remember the order of the arguments to
DUMP, I wrote a simple interrupt handler to use RUN as a reset key (like
ctrl-alt-del on a PC). Comments are welcome here, or by email.

Ernst

Include the following code h8hforth.asm:
------------------------------------------
irq0handler:
        push r0
        push r1
        push r2
        push r3
        push r4
        push r5
        push r6
        mov.w #irq0_buttons, rTOS
        push rTOS
        mov.w #0x3000, rTOS
        jsr 0x1fb6                      ; get buttons into irq0_buttons
        pop rTOS
        mov.w @irq0_buttons, r1
        mov.w #RESET_BUTTONS, r0
        cmp.w r0, r1
        bne irq0_rts
        mov.w #COLD, r0                 ; Make IRQ return to COLD
        push r0
        mov.w #0, r0
        push r0
        rte
irq0_rts:
        pop r6
        pop r5
        pop r4
        pop r3
        pop r2
        pop r1
        pop r0
        rts
irq0_buttons:
        .word 0
;------------------------------------------------------------------------------
; : RESET_INIT   BUTTON_INIT ' irq0handler FD94 ! ;

M_COLON(10,``"RESET_INIT"'',RESET_INIT,_SLINK)
        .word BUTTON_INIT, DoLIT, irq0handler, DoLIT, 0xfd94, Store, EXIT



Message has 1 Reply:
  RE: A reset key for pbforth
 
(...) Ersnt, Thanks for this tip. I was contemplating using some kind of interrupting switch to the batteries, this is much better. I might make it accept a parameter which is a mask of the keys to press for the reset function. I'll integrate this (...) (24 years ago, 31-Oct-00, to lugnet.robotics.rcx.pbforth)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR