Re: C version of ADDLC on very long variables

Gene_Gaunt-GDFlLPZ4eRKEK/[email protected] Thu, 5 Oct 2006 13:44:35 -0400
Newsgroups gmane.comp.lang.as400.mi
Message-ID <[email protected]>
Algebra example on 3-byte strings:

DCL DD A CHAR(3) INIT(X"876543");
DCL DD B CHAR(3) INIT(X"CCCCCC");
DCL DD C CHAR(3);
ADDLC C, A, B;

C is now X"54302F"

Ignore any carry out of the leftmost bit position,
although an optional extender can test if carry out occured:

ADDLC(I) C, A, B / ZC(FLAG);     // zero with carry
ADDLC(I) C, A, B / NTZNTC(FLAG); // not-zero with no carry
ADDLC(I) C, A, B / ZNTC(FLAG);   // zero with no carry
ADDLC(I) C, A, B / NTZC(FLAG);   // not-zero with carry

_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mi400
or email: MI400-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.