6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed Sep 25, 2024 7:21 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Mon Aug 16, 2021 9:14 am 
Offline

Joined: Mon Aug 16, 2021 8:50 am
Posts: 4
Hope this is the correct forum for this question. I have some issues with debugging my assembler code in the C64Debugger when started from Sublime Text. I am new at writing assembler for the C64 (back when I had one as kid I never got beyond changing the background/border-colors). So now I am trying again with Sublime Text, Kick Assembler, C64Debugger/VICE, and once finished I plan to move my programs to (Retrogames) "The C64" which I just got.

To get started I followed a tutorial explaining how to install/setup Vice, Sublime Text, Kick Assembler, and C64Debugger. However when I write a simple assembler program (e.g. only writing a single letter in the upper/left corner of the screen or similar) and I choose "Build and Run" (F7) in Sublime Text, the program is build and it starts fine in Vice. However if I in stead choose "Build in Debug" (Shift-F7) it will launch the C64Debugger, but then it shows it running code at ffxx, and I don't see the C64 screen in the upper/right corner (however it does display the fading text "Loaded from $0801 to $081E"). If I manually scroll to 080e I can see the assembler instructions I put into Sublime. So it appears the compile program is loaded "correctly" into the C64Debugger, however it appears it begins execution at another address !?

I have put a ".break" in this small assembler program, and when scrolling to 08xx I can see the appropriate "address-line" is marked red (indicating that there is a break) but it never gets to execute these lines at 08xx. Any ideas whats wrong? how to fix this issue?

Pelle


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 16, 2021 12:24 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10938
Location: England
Welcome Pelle! Sorry, I don't have the info to help you, but surely somebody will.


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 16, 2021 1:09 pm 
Offline

Joined: Sun Nov 08, 2009 1:56 am
Posts: 396
Location: Minnesota
Since your program is quite short, it might help to post the source code. It's not clear from your description exactly why you expect your code to do something different than what it's actually doing.


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 16, 2021 1:16 pm 
Offline

Joined: Mon Aug 16, 2021 8:50 am
Posts: 4
This is all:
Code:
BasicUpstart2(entry)
entry:
      lda #$01
      .break
      sta $0400
      rts


Running it with F7 from Sublime Text (loaded into VICE) it works as I expect (writing an "A" in the upper/left corner). However running it with SHIFT-F7 (loaded into C64Debugger) I can see the debugger never execute these lines, even though they are there (I can see them when I scroll to $0x0801).

I found out that I can force the debugger to run my code if I press CTRL-R (soft reset), and then CTRL-L (to lanuch the program). But its my understanding that it should run it when I start the debugger from Sublime


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 16, 2021 3:05 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8395
Location: Midwestern USA
pellelil wrote:
Code:
BasicUpstart2(entry)
entry:
      lda #$01
      .break
      sta $0400
      rts

What is that .BREAK pseudo-op (?) supposed to do?

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 16, 2021 5:05 pm 
Offline

Joined: Mon Aug 16, 2021 8:50 am
Posts: 4
.break is at breakpoint that make the execution of the program stop. If running it in VICE, the VICE Monitor opens when it reaches the breakpoint and you can press "G" an hit enter, and it will continue with the rest. In the debugger (when it runs the code) it will also stop the execution and you can then press F11 to make it continue execution.

It's not something you want in your final program, but while developing you can make it stop at a place where you want to see what is going on at that point in the software.


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 19, 2021 5:00 pm 
Offline

Joined: Mon Aug 16, 2021 8:50 am
Posts: 4
I asked elsewhere and was told to add the following line to the KickAssembler preferences in Sublime, and this works for me at least:

Code:
"kickass_debug_command_c64debugger": "\"${kickass_debug_path}\" -autojmp -layout 10 -breakpoints \"${kickass_output_path}/${kickass_breakpoint_filename}\" -symbols \"${kickass_output_path}/${build_file_base_name}.vs\" -wait 2999 -prg \"${kickass_output_path}/${start_filename}\"",


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 29, 2021 5:09 am 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1228
Location: Soddy-Daisy, TN USA
I use Visual Studio Code with Kick Assembler and there is an excellent extension for it too (search for Kick Assembler).

I gave up on Sublime years ago but I know some people still use it. VSC seems really good (for me) doing C64 development.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: AndrewP and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: