>Hello everyone, ready for my third set of basic questions? I want to >thank everyone for ther help in my PIC education. I appreciate it, >especially for not being riducled for basic questions. These are relevant questions. Anything to other than constant discussion about various programmers is probably of use to someone. >1) What does two's complement in nature mean when used to describe >arthmetic computations in the ALU. Two's complement is a way of representing negative binary integers. The high bit of the number is the sign, if 1 the number is negative, 0 it is positive. Positve numbers are represented in simple binary, negative ones are, well, in two's complement. A number can be negated by complementing all the bits, then adding one. For example, with 8 bit two's complement, some numbers are represented: Decimal Hex 0 00 1 01 127 7F (largest positive number) -128 80 (largest negative number) -127 81 -2 FE -1 FF The range of 16-bit two's complement numbers is from -32768 to +32767. Many high-level languages offer this type of variable. The reason for this system is that the ordinary binary 'add' operation will work properly on a mixture of positive or negative numbers. A subtraction can be done by two's complementing the number to be subtracted, then adding. This is how the SUBWF instruction in the PIC works, though the complement is invisible and it works in one instruction cycle. Also note the COMF instruction only does the first step in the two's complement, to complete it use an INCF next. Or subtract the number to be complemented from 0. Multiple precision is a little more complicated. > >2) I am very confused about the format for the ASCII file to be >assembled by MPASM. In the MPASM manual, it says labels are in column 1, >mnemonics in 2, ..... But when I looked in the Embedded Control >Handbook, there listing have what I assume is a line nuber, 1,2,3,... at >the being of each line. It then list another hex number and then it uses >the MPASM manual format. What is the correct format? > The files printed in the books are .LST files, which are generated by the assembler from the .ASM file. The added columns show the line number, location, and hex code of each line assembled. Usually these files are only used for troubleshooting or finding errors. The *input* file to the assembler is the only one you need to edit. In general MPASM is quite forgiving of the input format. Any white space, either spaces or tabs, can seperate the columns. >3) How does everyone set up their columns in a text editor. I was >considering using windows notepad and a tab between each column. What >the criteria for a column? See above. DOS-compatible tabs, spaced every 8 colums, make the file a little more portable. But not much. Fortunately the assembler will still understand your file even if it looks terrible. >4) It would be nice if there was a program that sets up the columns and >at least check for correct syntax as you type the code in. Does such a >program exist? Not that I'm aware of. When you MPASM the file, it will tell you what lines were out of order and approximately what the problem was. When an error occurs, an extra line is added to the .LST file directly below the error location. An editor that lets you examine the .LST file while editing the .ASM file in another window is very useful. >5) Can I download the Picmaster software and use it with another >programer? Is it worth the trouble? No. The PICSTART and PICMASTER are controlled by the serial port using a high-level (proprietary) protocol. The other programmers use direct hardware links to the PIC and must be controlled with their respective software. -Mike