Page 1 of 1
Use VICE 3.6.1 monitor to check a memory location
Posted: Wed Jun 15, 2022 7:27 am
by nbla000
Sometime it's useful to use the VICE monitor to set checkpoint and debug the code on the fly, normally by using his manual, it's easy to understand how to use it but this time, I'm not able to find the right command for the VICE monitor.
What I wish is that when a specific location has a specific value, stop and go to the debugger window.
Supposing the location is $1000 and the value to check is $80 how to do?
I've tried these commands with no success:
Code: Select all
w store $1000 if $80
w store $1000 if $1000==$80
By typing this command from the Vic+8K prompt, nothing happens except the char on the top\left corner

:
Some other similar working examples that I may use but is not exactly what I need:
Stop if any value is written to $1000:
Stop if any value is written to $1000 and Accumulator is $80:
Stop if any value is written to $1000 and Register X is $80:
Stop if any value is written to $1000 and Register Y is $80:
Any idea?
Re: Use VICE 3.6.1 monitor to check a memory location
Posted: Wed Jun 15, 2022 7:54 am
by beamrider
Shouldn't a combination of the A, X & Y commands work?
How else would $80 get into that memory location (other than inc/dec) which perhaps you also want to catch?
+suppose you would also get false hits with x&y being set to $80 by chance e.g. for indexing
Re: Use VICE 3.6.1 monitor to check a memory location
Posted: Wed Jun 15, 2022 9:59 am
by nbla000
By using these 3 commands:
Code: Select all
w store $1000 if A==$80
w store $1000 if X==$80
w store $1000 if Y==$80
I have some "false" stops that I may tolerate but I will not catch INC DEC without a specific command that check a specific value in a memory location...
Re: Use VICE 3.6.1 monitor to check a memory location
Posted: Wed Jun 15, 2022 10:37 am
by beamrider
I would raise it as a bug for VICE as from my reading of the documentation I agree "w store $1000 if $1000==$80" should work.
btw, it also doesn't seem to work for the x64.exe
edit: For anyone else reading this that can't get the monitor to work also, figured out you have to uncheck Settings|Host|Monitor|Use native monitor interface (this is checked by default)!
Re: Use VICE 3.6.1 monitor to check a memory location
Posted: Wed Jun 15, 2022 2:17 pm
by thegg
I believe the Vice help for 'condition' specifies a memory location in a specified bank is required. Try:
watch store $1000 if @:default:$1000 == (value)
Works for me on winvice 3.6.1
Re: Use VICE 3.6.1 monitor to check a memory location
Posted: Wed Jun 15, 2022 4:26 pm
by beamrider
Didn't seem to work on older versions.
On 3.6 I can't even seem to open the monitor, just does nothing in response to "Activate Monitor".
Re: Use VICE 3.6.1 monitor to check a memory location
Posted: Thu Jun 16, 2022 6:02 am
by thegg
Using Bank in xvic monitor gives 2 possible banknames default and cpu. So following the syntax described in 'help conditions':
Watch store $1000 if @default:$1000 == value
Watch store $1000 if @cpu:$1000 == value
Sorry my previous post had an erroneous : after the @. Note that the vice monitor displays @:bankname:location in its readout.
This works for me in WinVice 3.6.1.
Re: Use VICE 3.6.1 monitor to check a memory location
Posted: Thu Jun 16, 2022 9:01 am
by nbla000
thegg wrote: ↑Thu Jun 16, 2022 6:02 am
Code: Select all
Watch store $1000 if @default:$1000 == value
Watch store $1000 if @cpu:$1000 == value
Both methods work fine with Vice 3.6.1, thanks.
Anyway I'm curious to know what this command does:
Code: Select all
Watch store $1000 if $1000 == value
The monitor accepts this command but it never stops on $1000 with any value...
Re: Use VICE 3.6.1 monitor to check a memory location
Posted: Thu Jun 16, 2022 10:16 am
by beamrider
nbla000 wrote: ↑Thu Jun 16, 2022 9:01 am
Anyway I'm curious to know what this command does:
Code: Select all
Watch store $1000 if $1000 == value
The monitor accepts this command but it never stops on $1000 with any value...
I believe it's just evaluating it as a Boolean expression as:
w store $1000 if $1 == $0 : never stops
w store $1000 if $1 == $1 : always stops
Re: Use VICE 3.6.1 monitor to check a memory location
Posted: Thu Jun 16, 2022 10:20 am
by beamrider
also further to my previous post, the monitor doesn't work out of the box unless you uncheck Preferences|Settings|Host|UseNativeMonitorInterfce