Ken Pergola wrote... >Would anyone want to share any object-oriented programming techniques they >use when programming PICs in assembly language? >I realize this is a pretty open-ended question -- but I thought it would >stir up some interesting dialog. For PIC assembly language, the closest you're likely to come to what are called "object-oriented" programming techniques is to take advantage of the encapsulation available with the linker. Check Microchip's MPLAB, MPASM, and MPLINK documentation for the [gory] details, particularly the sections in the MPASM manual on writing relocatable code. >Even though all PIC RAM is global, are there any good techniques to try to >simulate local variables in PIC assembly language? There's no "try to simulate" about it: that's precisely what the linker allows you to do. All symbols (for both code and variables) are local to the module (.asm file) in which they are defined, unless they are explicitly made visible to the code in other modules by using the GLOBAL directive. This makes it easy to break up your code into modules that are functionally coherent (e.g., math, serial comm, interrupts, initialization, main routine, etc.) and which contain both the variable definitions and the code which manipulates them- and with only as many of the details exposed to the outside world (i.e., the rest of the files in the project) as are necessary. About a year ago I put up a [very] small example project using MPLINK, at: http://mywebpages.comcast.net/dilatush/lnkdemo2.zip It doesn't amount to much, just a few modules, and the code itself doesn't do anything at all; but it illustrates the basic ideas. At first, after years of writing code in absolute mode, I had trouble getting used to the linker; but now, I find it makes life one heck of a lot easier. HTH... Dave -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body