In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: Bill, Do give PASM a try -- it's a lot of fun and the ability to control the C and Z flags use is a joy an allows one to program with fewer jumps -- nearly an if-then-else construct. For example, here's a bit of code from an RGB LED controller: [code]red test rlevel, rlevel wz ' test level for zero if_z andn outa, rmask ' if 0, turn led off if_z jmp #green cmp cycle, rlevel wc ' check pwm level if_b or outa, rmask ' if still on, enable led if_ae andn outa, rmask ' else disable[/code] Translating to BASIC: [code]Red: IF rlevel = 0 THEN RedLed = IsOff ELSE IF rlevel < cycle RedLed = IsOn ELSE RedLed = IsOff ENDIF ENDIF Green:[/code] -- in my mind, the PASM code is cleaner than the "nice" BASIC! ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=373927#m374311 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)