14 May 2019, 13:05 | #1 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Macros for debugging in VASM
Hi,
I'm trying to setup some macros for debugging information that I can use in VASM. Here's an example: Code:
DEBUG_FUNC MACRO IFNE ENABLE_DEBUG move.l #\1,DEBUG_SUBID ENDC ENDM Code:
ROUTINE1: SUBID = $10000000 DEBUG_FUNC SUBID+$2000 rts Routine 2: Code:
ROUTINE2: SUBID = $20000000 DEBUG_FUNC SUBID+$5000 rts Effectively I want to assign every subroutine a SUBID, and then within that sub routine have a checkpoints/positions to monitor how far the program counter got before something happened and caused a crash. The ability to see the contents of DEBUG_SUBID is handle via interrupts so as long as the interrupt handler is running then I can see what went on quite quickly. Any help appreciated. Geezer |
14 May 2019, 13:32 | #2 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
From memory: doesn't the SET directive allow you to change the value of a symbol after setting it initially?
If the above is correct that may help you do this. |
14 May 2019, 13:45 | #3 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Roondar's hint is spot on, SET is your friend.
|
14 May 2019, 14:01 | #4 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
I initially looked at SET but I can't get the syntax right for some reason.
The VASM manual states...under the general section: Code:
.set <symbol>,<expression> Create a new program symbol with the name <symbol> and assign to it the value of <expression>. If <symbol> is already assigned, it will contain a new value from now on. So I've tried... set SUBID,$20000000 .set SUBID,$20000000 set SUBID = $20000000 and various combinations of indentation too.. Does anyone have an example I can look at please? |
14 May 2019, 14:05 | #5 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
It should be (again, from memory):
SUBID SET $20000000 Edit: I checked the manual (Motorola syntax section) and the above should work. Quote:
|
|
14 May 2019, 14:08 | #6 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
|
14 May 2019, 14:18 | #7 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Make sure not to mix EQU and SET for the same symbol. When using a symbol with SET only, then there should never be a redefinition error.
|
14 May 2019, 14:23 | #8 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
It seems any combination of set I get an unknown instruction, I could really use a working example on this one..??? For example, this fails. Code:
.set SUBID $10000000 DEBUG_FUNC SUBID+$2000 nop nop DEBUG_FUNC SUBID+$5000 |
|
14 May 2019, 14:40 | #9 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Code:
SUBID SET $12345 .... SUBID SET SUBID+20 .... SUBID SET $abdc |
14 May 2019, 14:43 | #10 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
|
14 May 2019, 15:09 | #11 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
|
14 May 2019, 15:27 | #12 | |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Quote:
Code:
<symbol> set <expression> Create a new symbol with the name <symbol> and assign the value of <expression>. If <symbol> is already assigned, it will contain a new value from now on. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macros in imagefx | source | support.Apps | 3 | 10 August 2018 03:30 |
Debugging help | mop | Coders. C/C++ | 5 | 20 April 2018 08:37 |
Devpac Macros etc. | Galahad/FLT | Coders. Asm / Hardware | 15 | 18 April 2016 23:59 |
Creating Macros | Lonewolf10 | Coders. Tutorials | 3 | 18 June 2013 22:12 |
Keyboard Input Options > macros/key combinations ? | Konrad | support.WinUAE | 3 | 23 May 2007 17:22 |
|
|