This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

a bug, or am I crazy

I fell into the below where a conditional in assembly did not 'take'. listing extract:

                      12
  0080                13     PACK_COUNT equ (OUTBUF_SZ/4)
  0080               852     JOE        equ   (PACK_COUNT AND 0ffh)
  0080               853     BILL       equ   (LOW PACK_COUNT)
  0080               854     aJOE        equ   PACK_COUNT AND 0ffh
  0080               855     aBILL       equ   LOW PACK_COUNT
                     858     IF (PACK_COUNT AND 0ffh)
                     859                inc   r6
                             ENDIF
                     866     IF (LOW PACK_COUNT)
                     867                inc   r6
                             ENDIF
you will note that the 'equ' statements behave as expected, but the IF does not.

Getting curious, I tried a small change (making PACK_COUNT a constant >0100h) and lo and behold it changes. listing extract:
  01F6                14     PACK_COUNT equ 01f6h
  00F6               853     JOE        equ   (PACK_COUNT AND 0ffh)
  00F6               854     BILL       equ   (LOW PACK_COUNT)
  00F6               855     aJOE        equ   PACK_COUNT AND 0ffh
  00F6               856     aBILL       equ   LOW PACK_COUNT
                     859     IF (PACK_COUNT AND 0ffh)
0052 0E              860                inc   r6
                     861     ENDIF
                     867     IF (LOW PACK_COUNT)
0053 0E              868                inc   r6
                     869     ENDIF
0054                 870     FB2rloop:

It is my belief that the IF should take in either case.

Erik

Parents
  • question answered:
    somehow the assemble manages to pick up PACK_COUNT

     0080                13     PACK_COUNT equ (OUTBUF_SZ/4)
    although OUTBUF_SZ is defined in an include in a lower line. However the assembler does not manage to extract derivatives thereof.

    make your own conclusion.

    Erik

Reply
  • question answered:
    somehow the assemble manages to pick up PACK_COUNT

     0080                13     PACK_COUNT equ (OUTBUF_SZ/4)
    although OUTBUF_SZ is defined in an include in a lower line. However the assembler does not manage to extract derivatives thereof.

    make your own conclusion.

    Erik

Children
No data