Thread: Bitfields BFFFO
View Single Post
Old 21 November 2015, 16:41   #12
flype
Registered User

flype's Avatar
 
Join Date: Dec 2014
Location: France
Posts: 66
Quote:
Originally Posted by Toni Wilen View Post
using the testcase here, it reports no more error

Code:
    MACHINE MC68030

Start:
    clr.l   d5               ; error counter
    lea     values,a0        ; load values
    move.l  (a0)+,d7         ; number of rows
Loop:
    move.l  (a0)+,d0         ; load d0
    move.l  (a0)+,d1         ; load d1
    move.l  (a0)+,d2         ; load d2
    move.l  (a0)+,d3         ; load d3
    bfffo   d0{d1:d2},d4     ; bitfield operation
    sub.l   d3,d4            ; check result
    beq     Next1            ; d4 = 0 ?
    addi.l  #1,d5            ; else, increment error counter
Next1:
    dbf     d7,Loop          ; continue
Exit:
    stop    #-1              ; stop

values:
    dc.l    9
    ;              d0,       d1,       d2,       d3
    dc.l    $ffffff00,$ffffff00,$7fffffe0,$ffffff00 ; 
    dc.l    $00000000,$ffffffff,$7fffffe0,$0000001f ; 
    dc.l    $00000000,$00000000,$7fffffe0,$00000020 ; 
    dc.l    $00000000,$00000020,$7fffffe0,$00000040 ; 
    dc.l    $1badcafe,$000000ff,$000000ff,$00000103 ; 
    dc.l    $1badcafe,$0000007f,$0000007f,$00000083 ; 
    dc.l    $1badcafe,$00000020,$00000020,$00000023 ; 
    dc.l    $1badcafe,$00000020,$00000003,$00000023 ; 
    dc.l    $1badcafe,$00000020,$00000002,$00000022 ; 
    dc.l    $1badcafe,$00000020,$00000001,$00000021 ;
EDIT: also ok with another bigger testcase.
flype is offline  
 
Page generated in 0.04617 seconds with 9 queries