Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > 6502 Static Analyser
2016-08-07 15:53
oziphantom

Registered: Oct 2014
Posts: 490
6502 Static Analyser

I've been working on a python script that I can run over 64tass's output to help me track bugs. At the moment it has the concept of a function, trashing a register or variable or modifying it. This then allows me to put in commands to verify that a function does not trash something.
pressA	
;&&trashes a,x,y,Pointer1,Pointer1+1,Pointer2,Pointer2+1
;&&modifies CursorX
	lda CursorX	
	beq KeyboardRoutine._exitPLA
	clc 
	adc #24
	tay
	jsr restoreVerticalDigitsBar ;&&preserve y
	dey
	jsr setVerticalDigitsBarToCurrent	
	dec CursorX
	rts

So here the system knows what is trashed. What is modified and assets that `restoreVerticalDigitsBar` does not trash or modify y.
When I wrote `restoreVerticalDigitsBar` it didn't but at some point I might add a feature, re factor the code to save a clock or so, and then trash y, which will give me a really hard to track down bug. Here the Build will catch and error for me.

The system will parse the code and report anything that is trashed that is not reported. It is a little annoying in that a parent function must also list everything its child functions trash, but this keeps it simple and allows you to see the whole tree when you look at just one function. The script also spits out a single HTML file which kind of acts like documentation. It will list name, address, size, what it calls,trashes and modifies. Handy for when you need to look up a function in the Win Vice debugger.

What else do you think would be useful?
 
... 10 posts hidden. Click here to view all posts....
 
2016-08-08 10:36
Stone

Registered: Oct 2006
Posts: 172
Quoting JackAsser
help cond

Syntax: condition <checknum> if <cond_expr>
Abbreviation: cond
...

Just saying...

Yes, I'm aware of conditional breakpoints in vice.

TODO:
"The assembler (or preprocessor) would generate a breakpoint at the ASSERT line and a corresponding breakpoint handler"
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
csabanw
Alakran_64
Durandal
Jammer
heavymett
Guests online: 110
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.046 sec.