MASM error 202 argument out of range


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: MASM error 202 argument out of range

    Quote Originally Posted by Dave View Post
    Trying to pass. Yes it could make for some unintended operation....
    Trying to pass?

    I don't have any assembler routines in my basic code.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: MASM error 202 argument out of range

    The error seems to relate to this code.

    Code:
     HChkSum = $E4 + $06 + $02 + ImaMem + RL        'Calculate Read Chksum
    HChkSum = $100 - HChkSum                    'Calculate two's complement
    HChkSum is a byte variable and I assume must be overflowing as the additions take place or when we try to subtract 100H from it.

  3. #3
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    704


    Did you find this post helpful? Yes | No

    Default Re: MASM error 202 argument out of range

    Try using decimal 255 in your formula instead of $100. The hex number $100 is equal to decimal 0001 0000 000. This might be a problem with your byte variable.

    Robert
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  4. #4
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    704


    Did you find this post helpful? Yes | No

    Default Re: MASM error 202 argument out of range

    Quote Originally Posted by rsocor01 View Post
    Try using decimal 255 in your formula instead of $100. The hex number $100 is equal to decimal 0001 0000 000. This might be a problem with your byte variable.

    Robert
    I meant $100 equal to decimal 0001 0000 0000. Missed a zero.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: MASM error 202 argument out of range

    100H = 256 though not 255 so won't that give the wrong checksum?

    It's two's complement asfaik. Not that means a great deal to me anyway Doh!

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: MASM error 202 argument out of range

    Here is an example checksum with correct result. $04,$06,$04,$FF,$00,($F3 = CS)

  7. #7
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    704


    Did you find this post helpful? Yes | No

    Default Re: MASM error 202 argument out of range

    Oh, I see what you mean. Anyways, I'm almost sure (I haven't tested it though) that combining your 9 bit number ($100) with your byte variable is what is causing the overflow problem. You might need to find a workaround.

    Good luck.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts