- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: 2's compliment 32-bit checksum in VAX MACRO As...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2005 09:33 AM
тАО08-02-2005 09:33 AM
Array(1) = 1234567890
Array(2) = 7738549221
.
.
Array(31) = Computed Checksum of this array
Array(32) = -987234561
What I understand is that 2's compliment is reverse all bits in the packet and add '1' to it. But I don't know how I can compute checksum of above package. Any help is highly appreciated. Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2005 06:57 PM
тАО08-02-2005 06:57 PM
Re: 2's compliment 32-bit checksum in VAX MACRO Assembler
welcome to the OpenVMS ITRC forum.
There are various possible algorithms available to build checksums. The easiest one would be to just build the sum of all values in the array. There also is the CRC MACRO instruction, which could even be called directory via LIB$CRC.
You probably need to figure out first, which checksum algorithm you need to use - depending on which piece of code is supposed to verify the checksum you're generating.
Volker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2005 08:29 PM
тАО08-02-2005 08:29 PM
Re: 2's compliment 32-bit checksum in VAX MACRO Assembler
are you sure of using macro?
You could write a simple c routine to solve.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2005 08:41 PM
тАО08-02-2005 08:41 PM
Re: 2's compliment 32-bit checksum in VAX MACRO Assembler
here there us c source code
3108: main(int argc, char *argv[])
3109: {
3110: int a;
3111:
3112: a = 10;
3113: a = !a;
3114: a = ~a;
3115: }
and same assembler code:
: GENTRAP
: BIS R31,R18,R16
Line 3110
: LDAH R1,#X7FF6(R31)
: LDA R1,#X8005(R1)
Line 3112
: BIS R31,#X0A,R1
Line 3113
: CMPEQ R1,R31,R1
Line 3114
: ORNOT R31,R1,R1
Line 3115
: BIS R31,#X01,R0
: BIS R31,R24,FP
: LDQ_U R31,(SP)
: RET R31,(R26)
HTH
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2005 10:19 PM
тАО08-02-2005 10:19 PM
SolutionEither a two's complement or a one's complement checksum is straightforward. The difference is when you a computing a one's complement checksum on a two's complement CPU, or vice versa. In this case, you have no problem because DIGITAL/COMPAQ/HP has always, as far as I can remember, used two's complement arithmetic.
The checksum is merely the sum of all the elements in the array, ignoring overflows. The code can be written in any language, including FORTRAN.
The one's complement/two's complement is to define a consistent result, regardless of the CPU's arithmetic. The two different possibilities will yield different results.
I hope that the above is helpful.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2005 04:01 AM
тАО08-03-2005 04:01 AM
Re: 2's compliment 32-bit checksum in VAX MACRO Assembler
I am not sure but guessing that Booth's algorithm will be used to verify the checksum. Also, I am open to use of either FORTRAN or VAX MACRO32 Assembler. I understand that C is a choice but but I want to be consistent with the rest of the language I used for the entire software. I am trying to add 32 bit (I*4) longwords in the array, but am not being able to get rid of integer overflow. Any help is always highly appreciated.
I will rate the answers later tonight. Thanks once again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-05-2005 03:37 AM
тАО08-05-2005 03:37 AM
Re: 2's compliment 32-bit checksum in VAX MACRO Assembler
because DCL has syntax like fortran, may be this can help you
$ array(1)=.not.array(1)
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-05-2005 05:01 AM
тАО08-05-2005 05:01 AM
Re: 2's compliment 32-bit checksum in VAX MACRO Assembler
if you want to do this in FORTRAN on a VAX (which does not support INTEGER*8), you could use the LIB$ADDX library routine.
http://h71000.www7.hp.com/doc/82final/5932/5932pro_001.html#addx
There is even a FORTRAN example in the manual.
I've also tried a simple example in FORTRAN using a condition handler to just ignore the SS$_INTOVF signal and return SS$_CONTINUE, but I'm not going to post this, as it's real ugly ;-)
Volker.