Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indirect register access in examine/deposit commands ... possible? #343

Closed
AK6DN opened this issue Sep 21, 2016 · 2 comments
Closed

Indirect register access in examine/deposit commands ... possible? #343

AK6DN opened this issue Sep 21, 2016 · 2 comments

Comments

@AK6DN
Copy link

AK6DN commented Sep 21, 2016

In debugging some code on the PDP11, I have a need to examine memory at a variable location, whose address is in a register (ie, like SP).

Ideally I'd like to do something like: EX (SP) or even EX 4(SP)-12(SP)

Is there a way to do this using existing command syntax? I can't find any way.

Or would this be classified as a new feature?

I just started using the RWSX breakpoint feature (very nice!) but now need the above functionality.

markpizz added a commit that referenced this issue Sep 21, 2016
@markpizz
Copy link
Member

There currently is minimal (no) expression evaluation functionality.
However, there is:

sim> ; Display some register value
sim> EX SP
sim> ; Use the last displayed value as an address to examine now
sim> EX $

The $ (last value referenced) was added a while back but hasn't seen much use or your request would have come up earlier.

So, I've just added the extended the allowed syntax to now allow:

sim> ; Use the last displayed value as an address to examine now
sim> EX $/10

Which will use the last value displayed as the starting address and display that address thru N-1 beyond it (where in this example N is 10).

Additionally, you can combine both of these in a breakpoint action string:

sim> bre 100 ; ex sp ; ex $/12
sim> dep pc 100
sim> g

Breakpoint, PC: 000100 (HALT)
sim> ex sp
SP: 000000
sim> ex $/12
0: 000000
2: 000000
4: 000000
6: 000000
10: 000000
sim>

@AK6DN
Copy link
Author

AK6DN commented Sep 21, 2016

Thanks for the pointer, that seems to work. I tried this:

set break -sx 17777172 ; ex r0,$,r1,$,r2,$,r3,$,r4,$,r5,$,sp,$ ; cont

and it does what you might expect, where $ equates to the last value examined.

I don't need the length option just yet, I'll get that when I pull the next commit.

Thanks for the help!
Don

@AK6DN AK6DN closed this as completed Sep 21, 2016
dthittner pushed a commit to dthittner/simh that referenced this issue Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants