http://www.microengineeringlabs.com/.../pbp/onint.bas perhaps?