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

Forums > C64 Coding > Writing breakpoints and other commands
2020-07-12 01:31

Registered: Sep 2003
Posts: 446
Writing breakpoints and other commands

Quoting Frantic
Just downloaded the mac binary which was also there. It seems to work fine. A feature request would be to add a keyword of some kind that will include a breakpoint in the output of vicelabels, so you can just type "!vicebreak" in the source, and have the breakpoint(s) added to that file.

Quoting Krill
Workaround: .byte 2 =)

Quoting oziphantom
yeah but that changes the code layout which can be bad. I have it in 64TASS, I made a VBS script that did tass -> Vice as I did this before 64tass actually added native vice output. I just filter all the labels with BREAK in them and convert them to break statements. WATCH etc
It would be nice to have build in, but a post pass is not that much work to do on the labels file.

I didn't wanted to hijack the other thread so I fork it here ;) Even if it'll be short lived.

It's probably not intuitive but it's possible to "assemble" such breakpoints and other commands to an additional text file:
    .virtual 0  ; virtual section for command file
    .dsection monitor_commands

breakpoint .function bplocation
    .section monitor_commands ; write breakpoint command
    .text format("break %x", bplocation), 10 ; and maybe ,13


     .breakpoint * ; set breakpoint here
The monitor_commands section may be written as:
64tass a.asm -o a.prg --output-section monitor_commands --nostart -o moncommand.txt
Of course the actual text encoding should be something sane so that it won't end up as binary. Petscii is fine as uppercase commands are accepted by VICE. Labels might be combined through stdout (hack):
64tass a.asm -o a.prg --vice-labels --labels - --output-section monitor_commands --nostart -o - >label.txt
However since r2237 there's an --output-append option:
64tass a.asm -o a.prg --vice-labels --labels vice.txt --output-section monitor_commands --nostart --output-append vice.txt
2020-07-12 08:58

Registered: Oct 2014
Posts: 409
or you could just add say

.labels <anything here get evaulated and added to the labels output file> ;)

so you can do

.labels attach "myfile.d64"
.labels break *
.labels break * if A>$80
.labels watch store * *+$400
2020-07-12 11:18

Registered: Sep 2003
Posts: 446
It's a bit more complicated than that as a single compilation can result in several label files limited to specific scopes and in different formats. E.g. all labels for VICE testing and a few specifically exported symbols for another compilation which includes them.

Such directive would be somewhat specific to VICE and some day it'll turn out that it'd be better if such output would not go into a label file.

Instead I prefer the ability to implement a variant manually relatively easily over a hard-coded specific implementation:
    .virtual 0  ; virtual section for command file
    .dsection monitor_commands

labels .function *parameters
    .section monitor_commands ; write custom command
    .text format(*parameters), 10 ; and maybe ,13

     *= $1000

     .labels 'attach "myfile.d64"'

     .labels 'break %x', *
     .labels 'break %x if a>$80', *
     .labels 'watch store %x %x', *, *+$400

Which works most of the time but is not bullet proof yet.

While currently it's possible to change the encoding to ASCII before the .text directive in the function to ensure correct ASCII output but doing so will cause side effects past the call site unless it's changed back to what it needs to be. Choosing the default encoding "none" is often a good choice but not every time.

But that's not the only shortcoming of the current encoding design and I keep in mind that there's more work left to do.
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
Users Online
Freakin Frankie
Guests online: 38
Top Demos
1 Coma Light 13  (9.7)
2 Uncensored  (9.6)
3 Edge of Disgrace  (9.6)
4 Comaland 100%  (9.6)
5 Unboxed  (9.6)
6 The Shores of Reflec..  (9.6)
7 Lunatico  (9.5)
8 Remains  (9.5)
9 NGC 1277 100%  (9.5)
10 C=Bit 18  (9.5)
Top onefile Demos
1 Smile to the Sky  (9.5)
2 Listen to Your Eyes  (9.5)
3 Cuarentenauta  (9.5)
4 MD202006 - Get Well ..  (9.5)
5 Dawnfall V1.1  (9.5)
6 Rewind  (9.5)
7 Instinct  (9.5)
8 Crystal Gazer  (9.5)
9 The Tuneful Eight [u..  (9.5)
10 Bad Boy  (9.5)
Top Groups
1 PriorArt  (9.6)
2 Performers  (9.5)
3 Booze Design  (9.4)
4 Censor Design  (9.4)
5 Fossil  (9.4)
Top Mega Swappers
1 Aslive  (9.4)
2 Calypso  (9.3)
3 Dishy  (9.2)
4 Nightshade  (9.2)
5 R.C.S.  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2020
Page generated in: 0.032 sec.