English Amiga Board


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

 
 
Thread Tools
Old 27 April 2012, 23:56   #1
hypnoshock
 
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)



Cheers,
Jim

P.S should I be using an action reply type of rom?
 
Old 28 April 2012, 00:16   #2
WayneK
Registered User
 
Join Date: May 2004
Location: Somewhere secret
Age: 50
Posts: 364
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).

.mousewait
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, 00:26   #3
hypnoshock
 
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.

Legend
 
Old 28 April 2012, 19:20   #4
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
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, 00:08   #5
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
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, 01:55   #6
hypnoshock
 
Posts: n/a
Quote:
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 20 06 September 2020 21:16
Debugging and JIT issues copse support.WinUAE 4 01 April 2012 05:50
Remote GDB debugging copse support.WinUAE 6 31 August 2011 01:05
Help debugging a faulty CD32 UberFreak support.Hardware 0 23 October 2009 03: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 15:24.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08029 seconds with 13 queries