English Amiga Board

Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

Thread Tools
Old 28 April 2012, 00:56   #1
Posts: n/a
Debugging my dodgy asm!

Hey guys,

I've been lurking on this board for a while now trying to learn 64k ASM and so far enjoying the challenge! :-D

I'm using WinUAE (sorry hardwareophiles!) and assembling using the WinUAE Demo Toolchain (vasmm68k)

I'm basically after a bit of advice generally about how to debug code.

I was wondering if there is a way to trace out debug information to a console whilst my program is running?

Also what's the best tool to use to step through code? I've tried using WinUAE's built in debugger but I'm unsure how to hone in on my code. I guess I should google how to add break points but I'm unsure what address my code would start from as isn't the memory assigned dynamically?

Any help, tips or tricks would be most appreciated and apologies if this has been answered somewhere else already (I'll have another blast at searching through the forum)


P.S should I be using an action reply type of rom?
Old 28 April 2012, 01:16   #2
Registered User
Join Date: May 2004
Location: Somewhere secret
Age: 44
Posts: 266
Well probably the fastest/easiest way to solve your problem is...stick a "mousewait" before the bits that are troubling you, this way you can run your program, be confident it's waiting for a LMB press (maybe set the background colour to RED for stop, to be sure), open the WinUAE debugger and you'll see your mousewait loop, with the problematic code following it and you can then set your breakpoints accordingly ("f <address>" in the debugger).

btst #6,$bfe001
bne.s .mousewait
<code giving you problems>

There are a million better ways (probably more!), but this should get you started at least
WayneK is offline  
Old 28 April 2012, 01:26   #3
Posts: n/a
Move.l #palm, $F4CE ; Groan

I should have thought of that haha

Cheers Wayne! (And quite a speedy response too)

From there I'll know where my code is in memory and should be able to poke about using WinUAE.

Old 28 April 2012, 20:20   #4
Join Date: Jul 2008
Location: Sweden
Posts: 2,201
Another good way is to insert bogus instructions like "move.l A0, A0" in your code and telling the WinUAE debugger to break on this OP-code. This way it works like a real breakpoint, with no effect on registers or condition codes, and you get to see the complete machine state in the exact instant the breakpoint is reached.
Leffmann is offline  
Old 29 April 2012, 01:08   #5
Photon's Avatar
Join Date: Nov 2004
Location: Hult / Sweden
Posts: 4,591
Hypnoshock, take advantage of the forum structure to let frequents find new threads and give help quicker. (I found this via Today's Posts.) I moved it to the asm forum for you.

Top tip: You can subscribe to this or any forum if you want to follow it via your inbox.

I use the Asm-One debugger with an option to not turn off 2 of the interrupts when I code demos.
Photon is offline  
Old 01 May 2012, 02:55   #6
Posts: n/a
Originally Posted by Leffmann View Post
Another good way is to insert bogus instructions like "move.l A0, A0" in your code and telling the WinUAE debugger to break on this OP-code.....
Nice tip Leffmann, I didn't even know the WinUAE debugger could do that! I'm going to try that right now.

I recognise your avatar so it's nice to finally get to say hi to someone whose posts I must have learnt from recently.

When I get a bit better at ASM I'll have a proper look through your Quartex cracktro remake. It would probably be a bit wasted on me at the moment as I have only just learnt how to set up copper lists but still completely clueless on setting up playfields and using the blitter.

@Photon, Thanks for moving my post into this part of the forum. I think I've now found my home away from home ;-D

I'll have to give that ASM-One debugger a look at some point... I've got a real 1200 gathering dust so it'll be nice when I get a bit better at this to migrate my coding efforts to a real Amiga. For now it's easier to use the tool chain alongside the internet.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Basics of debugging ASM in WinUAE? bodhi Coders. Asm / Hardware 14 05 December 2017 07:50
Debugging and JIT issues copse support.WinUAE 4 01 April 2012 06:50
Remote GDB debugging copse support.WinUAE 6 31 August 2011 02:05
Help debugging a faulty CD32 UberFreak support.Hardware 0 23 October 2009 04:29

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 14:50.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06591 seconds with 12 queries