Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Basic symbols (procedure) recognition in ASM files
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

raff
New Member

4 Posts

Posted - Nov 15 2016 :  06:13:35 AM  Show Profile  Reply with Quote
Hi,

My project consists of many C++ files and several ASM source code files. I can see that I can jump to function definitions in C++ (with Goto command) so it's easy to navigate over the C++ files jumping from function to function.

My problem is that my ASM procedures are not recognized and I cannot jump from C++ to my defined ASM procedure. I'm using the MASM format to define my ASM procedures, example:

MyFunction proc Param1, Param2

   ; My code goes here 

MyFunction endp


Is it possible to add in VA that feature that at least it recognizes ASM procedures as symbols? So I can jump from C++ to my ASM procedures directly (like it can be done from C++ to C++ functions)

Thanks!

feline
Whole Tomato Software

United Kingdom
19025 Posts

Posted - Nov 15 2016 :  1:36:45 PM  Show Profile  Reply with Quote
At the risk of asking a silly question, is your ASM code in your cpp files, or in separate files? If the code is in cpp files, I am wondering if you could use macros to help define the functions, and perhaps use a "fake" macro definition that VA uses to generate something that VA can process and understand.

Alternatively, if you only have a small number of ASM functions, have you considered adding VA Hashtag comments to mark these functions, since you can jump to and search the hashtags:

http://docs.wholetomato.com/default.asp?W574

zen is the art of being at one with the two'ness
Go to Top of Page

raff
New Member

4 Posts

Posted - Nov 15 2016 :  3:11:35 PM  Show Profile  Reply with Quote
Thanks for your reply.

I'm using separate ASM source code files. First of all I think that tha hashtag is not recognized in ASM source code files. I have tried and they appear in the Hashtag list when appearing in a .CPP file, but not in an ASM file. I have put it as:

; // #MyAsmFunction
MyAsmFunction proc Param1

...

MyAsmFunction endp

Unfortunately, I have hundreds of ASM functions. Even if I have a Hashtag in each ASM function it won't jump from the CPP source code file with a "Goto" command (or similar) when I click on the ASM function name from my CPP source code file, correct? Anyway, the HashTag is not recognized when defined in a ASM source code file.

Any other solution or workaround to jump from my CPP to my ASM source code when I click on the function name or a goto-definition-key-combination?

Thanks!

Go to Top of Page

foxmuldr
Tomato Guru

USA
417 Posts

Posted - Dec 12 2016 :  09:03:04 AM  Show Profile  Reply with Quote
I second this as I use assembly often as well.

Perhaps provide an editbox where we could create a list of keywords to highlight in the various colors, one editbox per highlight color option.

Best regards,
Rick C. Hodgin
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Dec 13 2016 :  09:16:09 AM  Show Profile  Reply with Quote
I have added your votes to the feature request to support VA Hashtags in all text files.

case=94833

Once this implemented, you will be able to specify ASM files as text files and VA Hashtags will work:
https://docs.wholetomato.com/default.asp?W353

You will need to use the ExtPlainText registry entry.

foxmuldr: I didn't find a way to do this in asm or txt files, this is all I found: https://msdn.microsoft.com/en-us/library/zy61y8b8.aspx
Go to Top of Page

foxmuldr
Tomato Guru

USA
417 Posts

Posted - Dec 13 2016 :  09:39:24 AM  Show Profile  Reply with Quote
quote:
Originally posted by accord
foxmuldr: I didn't find a way to do this in asm or txt files, this is all I found: https://msdn.microsoft.com/en-us/library/zy61y8b8.aspx



Thanks. I also found this which already has assembly keywords:
http://kipirvine.com/asm/gettingStartedVS2013/index.htm

If you search for "usertype.dat" you will find one with MASM assembler keywords. It just needs saved to your "C:\Program Files\Microsoft Visual Studio <major.minor>\Common7\IDE\" folder.

The only downside is they're all one color. They also only work in source files recognized by Visual Studio. You can go into Tools -> Options and select File Exensions and add "asm" as a "Microsoft Visual C++" editor and it syntax highlights.

Best regards,
Rick C. Hodgin

Edited by - foxmuldr on Dec 13 2016 09:43:28 AM
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Dec 13 2016 :  10:33:22 AM  Show Profile  Reply with Quote
quote:
Originally posted by raff

Even if I have a Hashtag in each ASM function it won't jump from the CPP source code file with a "Goto" command (or similar) when I click on the ASM function name from my CPP source code file, correct?



Correct. You would need to add a hashtag to your C++ caller; then you could go from the hashtag in C++ to the hashtag in ASM.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19025 Posts

Posted - Dec 13 2016 :  4:08:50 PM  Show Profile  Reply with Quote
I am not sure what most of your MASM format code looks like, but based on your initial sample, the following VS2015 Regex find and replace will add a hashtag, using the function name, to each function in your ASM file:

Find string:
^\b(_\w+|[\w-[0-9_]]\w*)\b proc

Replace string:
; //#$1\n$1 proc

this won't update your C++ code, but should help quite a bit.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000