From: Fred M. <fr...@mo...> - 1999-12-14 20:03:14
|
"Noeth, Jim" wrote: > Glen (and others who commented on the move routines) > > Thanks for the feedback. I am using a 7 by 7 matrix to determine which > type of move to generate (The compiler doesn't currently support all > possible data types, but it probably will in the future). This results > in 49 possible move types, although a number of them are illogical > (such as moving an numeric edited field to a packed decimal field). I > have started by defining each of this in a large case statement, so > each of the move types does stand alone, but is all inline code as > opposed to individual routines. Making individual routines out of them > is a good idea, though, I will pursue that. > > My intent was to build the code for the move verb inline, as opposed > to calling a routine to execute the move. This will result in a larger > executable, but will not incur the overhead of pushing arguments onto > the stack and calling a subroutine. > > By the way, the matrix is made up of the following source/destination > types (although not all are currently supported): > > Alpha/Alpha Numeric (no distinction is made) > Binary Integer > Display (numeric) > Editted Alpha > Editted Numeric > Floating Point > Packed Decimal Perhaps it's pointed out before here, but because I don't know I'll do it again. The packed decimal format, which is still used on mainframes because it saves memory and instruction cycles. It's not so fast as Integer binary arithmetic but faster than Display numeric arithmetic. So programmers should choose binary fields over packed decimal fields. But because of the very old Cobol standard in those days they didn't : the binary integer fields didn't have the possibility of the assumed decimal point, which is really needed in business practice. Over the years I've met two version of the packed decimal format. Most common is the packed decimal format, where the right-hand end nibble contains the code for the sign. In the sign nibble the F and C codes indicate a positive value, the B and D codes a negative value. Zero was in general coded as positive, but tests revealed me that a negative zero didn't influence the results. A less common format was the BCD format. The difference with the packed decimal format is the absence of the sign nibble. So a BCD format numeric field of n bytes contains 2*n numeric positions, where a field with packed decimal format of n bytes contains 2*n-1 numeric positions. I don't know if you intend to code the move for the BCD code fields in the same routines as the packed decimal fields. If you do, fine. Otherwise you might consider to make a 8 by 8 matrix. Regards, Fred Mobach |