Experimental Assembler Features

Basic and Machine Language

Moderator: Moderators

Post Reply
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Experimental Assembler Features

Post by chysn »

Sometimes when I'm disassembling code, I imagine that it would be cool to "drill down" into a subroutine or jump destination, just to review what's there. For example, say you're disassembling the VIC-20's startup routine:
Screen Shot 2023-09-30 at 10.48.38 PM.png
You see this JSR $FE91 line and say to yourself, "I wonder what that is?" So you cursor up to it and type "V" (the Follow Tool) and hit ENTER:
Screen Shot 2023-09-30 at 10.49.21 PM.png
The tool disassembles 16 lines of the subroutine called at that line and presents a new prompt. When you hit ENTER again:
Screen Shot 2023-09-30 at 10.50.22 PM.png
Disassembly picks up from the original subroutine call.

Now, this is an interesting feature, and I might get some use out of it in real life. But right now I'm leaning against including it in a future wAx release. It's the kind of feature I'd like to see in a GUI-based cross disassembler, though, where multiple panes or windows are available. As a native assembler feature, it feels like it's missing elegance. There's not much hardship to typing in addresses.

But it's also possible that there's something here, and it could be worthwhile with some implementation improvement.
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Experimental Assembler Features

Post by Mike »

chysn wrote:It's the kind of feature I'd like to see in a GUI-based cross disassembler, though, where multiple panes or windows are available.
That pretty much nails it.

On later 8-Bit-CBMs, the improved screen editor allows to define windows. These windows can be used to 'lock' parts of a disassembly listing, so they remain on screen while the user inspects other parts of the program. Insertion of instructions while programming is helped by the ESC-I editor command, which inserts a blank line at the cursor position: after the missing instruction(s) have been entered, the auto address prompt automagically shifts the following instructions to their new place.

In short, the handling of any monitor can be improved by providing an enhanced screen editor. For example, one could have one or more buffers that store away a screen line - say four line buffers filled with f1, f3, f5 and f7; and recalling a screen line works with f2, f4, f6 and f8.

The Programmer's Aid cartridge features such an enhanced screen editor. Maybe some functions could be leveraged from it.
furroy
Vic 20 Drifter
Posts: 20
Joined: Sun Aug 27, 2023 5:03 am

Re: Experimental Assembler Features

Post by furroy »

what if additionally f1/f3/f5/f7 function keys each saved a bookmark and f2/f4/f6/f8 switch back to where you were? or if Y jumps ahead, SHIFT Y takes you back maintaining a stack of bookmarks
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Experimental Assembler Features

Post by chysn »

There's already a mechanism that can be leveraged to function as "bookmarks," and that's BASIC variable replacement:
Screen Shot 2023-10-01 at 12.52.42 PM.png
Right now, numeric variables must be used for this purpose because string variables are internally surrounded by double quotation marks when expanded. This makes code more compact when using strings in code, and wards off the need to escape the apostrophe. I realized at the time that this decision would reduce the power of BASIC integration a little bit. For example, non-quoted replacement allows stuff like this (from a non-production feature branch):
Screen Shot 2023-10-01 at 12.45.13 PM.png
But, really, who's going to do that? Nobody, that's who. Variables for operands are good enough, is still my judgment.

I like the bookmarking idea, though, and there might be ways to make that idea easier. Listening for function keys is sort of off the table for me.

If I make the hex parser ignore double quotation marks, then:
Screen Shot 2023-10-01 at 1.34.02 PM.png
Last edited by chysn on Sun Oct 01, 2023 11:36 am, edited 3 times in total.
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: Experimental Assembler Features

Post by chysn »

Mike wrote: Sun Oct 01, 2023 5:09 am The Programmer's Aid cartridge features such an enhanced screen editor. Maybe some functions could be leveraged from it.
This is one thing I don't have, and it's probably a good time for me to start shopping for it. You know, for the collection!
Post Reply