Debugging 6502 code for Oric

Questions, bug reports, features requests, ... about the Oric Software Development Kit. Please indicate clearly in the title the related element (OSDK for generic questions, PictConv, FilePack, XA, Euphoric, etc...) to make it easy to locate messages.

Bub
Private
Posts: 3
Joined: Fri May 30, 2025 7:50 pm

Debugging 6502 code for Oric

Post by Bub »

I recently came back to my first retro-computers I started with in early 80's, ZX81 and Oric 1 and Atmos. I mainly code in assembly language, Z80 and 6502.

For the ZX81 I found a great Visual Code extension, which allows to develop and debug the Z80 code and in the same time generates a BASIC program I can execute either in the EightyOne emulator or on the ZX itself.

For the Orics I tested the Oricutron emulator et l'OSDK but the debugger in the OSDK Monitor window is very limited.
I also tested CC65, the C and assembly compilator, it's great. For debugging I tested DB65.

The problem I face is that I didn't not found the compilator / linker instructions and 6502 assembly code to generate a tape file and which can be debugged with DB65.
- For generating a tape file I use the following instructions:

Code: Select all

ca65.exe -g --cpu 6502 -l TestDom.lst  -o TestDom.o  TestDom.s
ld65.exe -t atmos -m TestDom.map -Ln TestDom.sym --dbgfile TestDom.dbg -o TestDom.tap TestDom.o atmos.lib
and at the beginning of TestDom.s I must add

Code: Select all

.forceimport __STARTUP__ 
- For debugging with DB65 I use the following instructions:

Code: Select all

ca65.exe -g --cpu 6502 -l TestDom.lst  -o TestDom.o  TestDom.s
ld65.exe -m TestDom.map -Ln TestDom.sym --dbgfile TestDom.dbg -C TestDom.cfg -o TestDom.bin TestDom.o
and in TestDom.s I must declare the VECTORS segment and a "reset" label to tell DB65 where to start.
The .cfg file is the same than this DB65 example: https://github.com/tmr4/db65xx_projects ... _world.cfg
All the 6502 code I write in the .s file can be the same in both configurations.

Is there another way of doing or other 6502 development and debugging tools which can generate a tape file and can be debugged with great tools like Visual Code or Studio?
Thanks a lot
User avatar
Dbug
Site Admin
Posts: 5063
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Debugging 6502 code for Oric

Post by Dbug »

Is there another way of doing or other 6502 development and debugging tools which can generate a tape file and can be debugged with great tools like Visual Code or Studio?
There's been discussions about that, but nothing has gone very far.

Ideally, emulators would implement a standardized API for debugger (I know there are a few that exist) to do things like read and write memory, access CPU flags and registers, trace and run, put breakpoints, etc... which would allow a proper external tool running on a big machine to be used instead of a cramped UI in text mode.

While working on Encounter I've been struggling with quite a few limitations on the Oricutron monitor, like the lack of dynamic view (give an expression, and it automatically refreshes the content by reevaluating continuously the expression and reloading the data) or lack of indirect memory access (if I have a pointer, I generally want to see the content pointed to the address I indicate, not the pointer itself).

Ideally such an API could also be implemented with a micro debugger kernel on the actual Oric machines, and using modern devices such as LOCI or OCULA allow debugging the actual physical Oric remotely from a PC.
Bub
Private
Posts: 3
Joined: Fri May 30, 2025 7:50 pm

Re: Debugging 6502 code for Oric

Post by Bub »

Thanks for your reply.
I will continue with the double compilation configuration, that's not straightforward but it seems to work.
Dominique
User avatar
Dbug
Site Admin
Posts: 5063
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Debugging 6502 code for Oric

Post by Dbug »

Is that the VS code extension you are using?
https://marketplace.visualstudio.com/it ... son.db65xx
Bub
Private
Posts: 3
Joined: Fri May 30, 2025 7:50 pm

Re: Debugging 6502 code for Oric

Post by Bub »

Yes, it is this extension.
Post Reply