English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 17 March 2023, 22:25   #1
Rock'n Roll
German Translator
 
Rock'n Roll's Avatar
 
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 49
Posts: 194
conditional register breakpoint

How is this conditional register breakpoint really works?
fo <num> <reg> <oper> <val> [<mask> <val2>] Conditional register breakpoint.
reg=Dx,Ax,PC,USP,ISP,VBR,SR. oper:!=,==,<,>,>=,<=,-,!- (-=val to val2 range).

Code:
>fo 0 A0==$21000
Breakpoint added.
>fl
0: A0 == 00021000 [ffffffff 00000000]
>
LEA.L $00021000,A0
ok, that works.

but how is the function of the two 32Bit values in the square brackets?

Is it in a range? Or can I also break the program with a masked bit like:

Code:
>fo 0 d0==$00000004 $00000004
Breakpoint added.
>fl
0: D0 == 00000004 [00000004 00000000]

or
>fo 0 d0==$00000004 $00000004 $00000004
Breakpoint added.
>fl
0: D0 == 00000004 [00000004 00000004]

for move.w #$0004,d0
00c25956 303c 0004                move.w #$0004,d0
Next PC: 00c2595a
>t	
Cycles: 4 Chip, 8 CPU. (V=210 H=66 -> V=210 H=70)
  D0 00000004   D1 00000000   D2 00000000   D3 00000000
But in no case a Breakpoint 0 triggered.

Code:
>fd
All breakpoints removed.
>fo 0 d0==$00000004
Breakpoint added.
>fl
0: D0 == 00000004 [ffffffff 00000004]
The value in the brackets are not reset with >fd
Rock'n Roll is offline  
Old 18 March 2023, 16:21   #2
Rock'n Roll
German Translator
 
Rock'n Roll's Avatar
 
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 49
Posts: 194
I made a mistake. A breakpoint 0 triggered isn't shown with singlesteps.

I believe the formula for "fo <num> <reg> <oper> <val> [<mask> <val2>]" is:

Code:
f0 0 (reg.l & mask.l) == val2.l
eg.

fo 0 d0==$8000 $ff00 $8000
>fl
0: D0 == 00008000 [0000ff00 00008000]

or
>fo 0 d0==$11008000 $ff00 $8000
>fl
0: D0 == 11008000 [0000ff00 00008000]
it's the same and results in: fo 0 d0.l==$xxxx80xx

move.l #$11008000,d0 ; Breakpoint 0 triggered.
move.l #$00008000,d0 ; Breakpoint 0 triggered.
move.l #$00004010,d0 ; no breakpoint
move.l #$0000F011,d0 ; Breakpoint 0 triggered.

(I made only short tests.)
Rock'n Roll is offline  
Old 20 March 2023, 17:55   #3
Rock'n Roll
German Translator
 
Rock'n Roll's Avatar
 
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 49
Posts: 194
I checked again the fo-command and the result is, that the parameter 'val2' has no function.
I only checked with '=='.

Code:
1. if (reg & mask) == val1		; ok
>fo 0 d0==$8
Breakpoint added.
>fl				
0: D0 == 00000008 [ffffffff 00000000]	; Breakpoint only for certain value

2. if (reg & mask) == val1		; ok
>fo 0 d0==$13700 $000fff00 $00000000
Breakpoint added.
>fl
0: D0 == 00013700 [000fff00 00000000]	; Breakpoint for value on specific bits

>fo 0 d0==$13700 $0 $0			; ok
Breakpoint added.
>fl
0: D0 == 00013700 [00000000 00000000]	; Breakpoint every time

3.
>fo 0 d0==$13700 $ffffffff $10	
Breakpoint added.
>fl
0: D0 == 00013700 [ffffffff 00000010]	; I can not see any influence of the second parameter 'val2'

I suggest to look into this and maybe change to:
if (((reg & mask) >= (val1-val2)) && ((reg & mask) <= (val1+val2)))
or
if (((reg & mask) >= (val1)) && ((reg & mask) <= (val1+val2)))

Then the parameter 'val2' would specify a range.
The possible operations seems to be to much: oper: !=,==,<,>,>=,<=,-,!-
Maybe better would be only '==' or the oposite '!=' for inside or outside a range or value.
Rock'n Roll is offline  
Old 25 March 2023, 13:00   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,557
val2 is used in "range" tests (in-range "-": val1 <= x <= val2 and not-in-range "!-": x <= val1 OR x >= val2)
Toni Wilen is online now  
Old 02 April 2023, 20:29   #5
Rock'n Roll
German Translator
 
Rock'n Roll's Avatar
 
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 49
Posts: 194
ok, but for me it doesn't work. I need a short example, how to use it.
(but if I not unterstand this, it's also ok.)

I have a series with different move's and one with move.l #$808,d0

I want a break if "in-range":
800 <= x <= 810 with val1 = 800 and val2 = 810
>fo 0 d0<=$800 $ffffffff $810

Code:
>fd
All breakpoints removed.
>fo 0 d0<=$800 $ffffffff $810
Breakpoint added.
>fl
0: D0 <= 00000800 [ffffffff 00000810]

>g
Breakpoint 0 triggered.
Cycles: 6 Chip, 12 CPU. (V=105 H=50 -> V=105 H=56)
VPOS: 105 ($069) HPOS: 056 ($038) COP: $0002388c
  D0 00000000   D1 00000000   D2 00000000   D3 00000000
or

Code:
>fd
All breakpoints removed.
>fo 0 d0<=$800 $ffffff00 $810
Breakpoint added.
>g
Breakpoint 0 triggered.
Cycles: 6 Chip, 12 CPU. (V=105 H=56 -> V=105 H=62)
VPOS: 105 ($069) HPOS: 062 ($03e) COP: $0002388c
  D0 00000000   D1 00000000   D2 00000000   D3 00000000
Rock'n Roll is offline  
Old 12 June 2024, 20:29   #6
Rock'n Roll
German Translator
 
Rock'n Roll's Avatar
 
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 49
Posts: 194
I gave the conditional breakpoint a second chance and could inlight something. But I also dig some new questions and featue improvements. All my questions and featue improvements in blue.

help text WinUAE 5.3:
;fo <num> <reg> <oper> <val> [<mask> <val2>] Conditional register breakpoint [Nx] [Hx].
; reg=Dx,Ax,PC,USP,ISP,VBR,SR. oper:!=,==,<,>,>=,<=,-,!- (-=val to val2 range).

Code:
>fd
All breakpoints removed.
>fo 0 A0!=$21000
Breakpoint added.
>fo 1 A0==$21000
Breakpoint added.
>fo 2 A0<$21000
Breakpoint added.
>fo 3 A0>$21000
Breakpoint added.
>fo 4 A0>=$21000
Breakpoint added.
>fo 5 A0<=$21000
Breakpoint added.
>fo 6 A0-$21000
Breakpoint added.
>fo 7 A0!-$21000
Breakpoint added.
>fl
0: A0 != 00021000 [ffffffff 00000000]	; != ok							; better: 0: A0 != 00021000 [ffffffff]
1: A0 == 00021000 [ffffffff 00000000]	; == ok							; better: 1: A0 == 00021000 [ffffffff]
2: A0 <= 00021000 [ffffffff 00000000]	; <=  not ok choose <			; better: 2: A0 < 00021000 [ffffffff]
3: A0 >= 00021000 [ffffffff 00000000]	; >=  not ok choose >			; better: 3: A0 >= 00021000 [ffffffff]
4: A0 >= 00021000 [ffffffff 00000000]	; >=  ok						; better: 4: A0 >= 00021000 [ffffffff]
5: A0 <= 00021000 [ffffffff 00000000]	; <=  ok						; better: 5: A0 <= 00021000 [ffffffff]
6: A0 < 00021000 [ffffffff 00000000]	; '-' only with value2 of interest	; better: 6: A0 - 00021000 [ffffffff 00000000]		; in-range		"-" :		val1 <= x <= val2		; --> $21000 <= x <= $0  --> not possible 
7: A0 > 00021000 [ffffffff 00000000]	; '!-' only with value2 of interest	; better: 7: A0 !- 00021000 [ffffffff 00000000]		; not-in-range  "!-":	 x <= val1 OR x >= val2		; --> x <= $21000 OR x >= $0  --> would be ok
I interpret:
breakpoint number: register operation value1 [mask (value2)]

Operation with only one value: oper: !=,==,<,>,>=,<=
Operation with two values: oper: -,!-

Then [ffffffff 00000000] the mask and value2 better would be:
1: A0 == 00021000 [ffffffff] ; without this 00000000]
7: A0 !- 00021000 [ffffffff 00000000] ; only if oper in-range or not-in-range is set with value2

to delete only one of this breakpoints eg. >fo 4 it is not possible, only all with >fd

Then with the Option N
>fo 1 A0==$21000 N5
Breakpoint added.
>fl
0: A0 != 00021000 [ffffffff 00000000]
1: A0 == 00021000 [00000000 00000000] N=5
2: A0 <= 00021000 [ffffffff 00000000]

but it deletes the mask to zero?

>fo 1 A0==$21000 H5
Breakpoint added.
>fl
0: A0 != 00021000 [ffffffff 00000000]
1: A0 == 00021000 [00000000 00000000] H=5

What makes H ?
>fo 1 A0==$21000 N5 H5
Breakpoint added.
>fl
0: A0 != 00021000 [ffffffff 00000000]
1: A0 == 00021000 [00000000 00000000] N=5 H=5

;------------------------------------------------------------------------------
; change the mask

Code:
>fo 0 A0==$21000 $0000FFFF
Breakpoint added.
>?-2
$FFFFFFFE = %11111111`11111111`11111111`11111110 = 4294967294 = -2
>fo 1 A0==$21000 -2
Breakpoint added.
>fo 2 A0<$21000 $F
Breakpoint added.
>fo 3 A0>$21000 $FCBA1E00
Breakpoint added.

0: A0 == 00021000 [0000ffff 00000000]
1: A0 == 00020ffe [ffffffff 00000000]
2: A0 <= 00021000 [0000000f 00000000]
3: A0 >= 00021000 [fcba1e00 00000000]
Better would be to interpret the -2 as $FFFFFFFE

;------------------------------------------------------------------------------
; with Value2
; oper: -,!- (-=val to val2 range).

; val2 is used in "range" tests
; in-range "-" : val1 <= x <= val2
; not-in-range "!-": x <= val1 OR x >= val2

; in-range "-" : val1 <= x <= val2
>fo 0 A0-$21000 $FFFFFFFF $22000
Where a breakpoint triggers if any value from $21000 to $22000 comes in A0
but value2 has to be val2>=val1, otherwise it is not possible

; not-in-range "!-": x <= val1 OR x >= val2
>fo 0 A0!-$21000 $FFFFFFFF $22000
Where a value lower or equal as $21000 or greater or equal then $22000 triggers a break.

;------------------------------------------------------------------------------
Test:

Code:
loop:
	movea.l	#$0,A0
	movea.l #$1,A0			
	movea.l #$2,A0
	movea.l #$21010,A0
	movea.l #$10,A0
	movea.l #$20,A0
	movea.l #$21100,A0
	movea.l #$100,A0
	movea.l #$200,A0
	movea.l #$22000,A0
	movea.l #$1000,A0
	movea.l #$2000,A0
	bra loop
	rts
>fo 0 A0!=$21000 ; works fine
>fo 1 A0==$21010 ; works fine
>fo 4 A0>=$21000 ; works fine
>fo 1 A0 - $21000 $FFFFFFFF $22000 ; works fine
>fo 0 A0 !- $21000 $FFFFFFFF $22000 ; works fine
problems with N5 because the zeroed mask
Rock'n Roll is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional JSR and RTS DanScott Coders. Asm / Hardware 9 15 January 2021 02:56
nOOb needing help to understand Conditional Branching KONEY Coders. Asm / Hardware 2 25 October 2019 23:42
conditional breakpoints jotd request.UAE Wishlist 2 12 June 2016 19:36
Noobie Help (conditional branching) bodhi Coders. Asm / Hardware 7 03 January 2013 00:55

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:23.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.12300 seconds with 15 queries