In SX Microcontrollers, SX/B Compiler and SX-Key Tool, peterverkaik wrote: Hi, The attached program simply increments a 32bit timer in the interrupt. I noticed that in SxSim 2.08.05 that on a snz instruction with Z=0 that rtcc increments by 3. Datasheet says a skip takes 2 cycles. [code] device SX48,OSCHS2 freq 25000000 reset _reset org $30 dvpTimer1 ds 1 dvpTimer2 ds 1 dvpTimer3 ds 1 dvpTimer4 ds 1 ;first isr run should take 4([url=jmp@)+3(call)+10(sub)+1(mov]jmp@)+3(call)+10(sub)+1(mov[/url] w)+3(retiw) = 21 cycles ;first run ORG $000 jmp @dvpTMR_vector ; 4 4 _reset mov fsr,#dvpTimer1 clr ind mov w,#$88 mov !option,w mov w,#$F8 mov rtcc,w jmp $ dvpTMR_vector call dvpTMR_S0 ; 3 3 mov w,#(-217)&255 ; 1 1 retiw ; 3 3 dvpTMR_S0 inc dvpTimer1 ; 1 1 snz ; 1/2 2 (NZ) inc dvpTimer2 ; 1 snz ; 1/2 2 inc dvpTimer3 ; 1 snz ; 1/2 2 inc dvpTimer4 ; 1 retp ; 3 3 [/code] SxSim bug? regards peter ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=328089 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)