Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user maak ! (Registered 2024-04-18) You are not logged in - nap
CSDb User Forums


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

Registered: Sep 2003
Posts: 473
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
    .endv

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

     *=$1000

     nop
     .breakpoint * ; set breakpoint here
     nop
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
oziphantom

Registered: Oct 2014
Posts: 478
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
soci

Registered: Sep 2003
Posts: 473
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
    .endv

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

     *= $1000

     .labels 'attach "myfile.d64"'

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

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
Advanced
Users Online
Dymo/G★P
CA$H/TRiAD
iceout/Avatar/HF
Exile/Anubis
kbs/Pht/Lxt
iAN CooG/HVSC
goerp/F4CG
Frostbyte/Artline De..
Guests online: 100
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 The Ghost  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 Wafer Demo  (9.5)
7 TRSAC, Gabber & Pebe..  (9.5)
8 Onscreen 5k  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.5)
2 Black Beard  (9.4)
3 hedning  (9.2)
4 Baracuda  (9.1)
5 Irata  (8.5)

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