6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 9:23 am

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: W65C816SXB Editor
PostPosted: Mon Nov 23, 2015 5:42 pm 
Offline
User avatar

Joined: Fri Oct 30, 2015 9:49 pm
Posts: 54
Location: San Antonio, TX
Howdy...

I'm not fully happy with the WDC environment and tried to live with it for a while.

A few of the problems,
I have to run it as an Administrator or I get weird errors when saving the project, looks like default configurations are not saved.
When compiling/linking, no errors are visually displayed, you will have to scroll the little output window to see if there were any errors.
The recommended editor is UltraEditor which is not free, I tried the Atom editor but the WDC IDE launch the editor without open up my current .asm file.
The reason I tried the Atom editor is for the syntax highlights but the Atom editor didn't fit my needs otherwise...

So I was recommended to use the Notepad++ editor, I have actually been using it for a while but without customizing it.

I gave it a try specifically for 6502 Assembler and for me it's a step up from the WDC environment...
I was able to add syntax highlights for the 6502 Assembler and the WDC compiler pretty easily.
I downloaded the NppExec plugin and have been able to compile/Link/Debug my files from within Npp.
I can clearly see if there is a compilation/linking problem in the output window.

The debugger requires the WDCDB.INI file which I for now copy/paste from another project and then manually update to fit my needs.
However, it's a one time setup per project so it's not really a problem for me... :D

The WDC compiler fits my need and I decided to keep it, I had a little bit of frustration with it and the way it evaluates EQU statements.
Basically,
Code:
SID_BASE      EQU $7F20      ; base address of SID port on SXB
SID_FR1LO     EQU SID_BASE
SID_FR1HI     EQU SID_BASE + $01
does not work because there is a space after SID_BASE so SID_FR1HI ended up having the address of $7F20.
Code:
SID_BASE      EQU $7F20      ; base address of SID port on SXB
SID_FR1LO     EQU SID_BASE
SID_FR1HI     EQU SID_BASE+$01
works and SID_FR1HI is now $7F21.

Any suggestions for editor/compiler/linker/debugger for W65C816SXB.


Top
 Profile  
Reply with quote  
 Post subject: Re: W65C816SXB Editor
PostPosted: Mon Nov 23, 2015 6:01 pm 
Offline
User avatar

Joined: Thu Nov 27, 2014 7:07 pm
Posts: 47
Location: Ocala, Fl, USA
No suggestion for the editor, but as long as we're both here, did you set the NPP toolbar up with an icon for the NPP Exec console? That was actually one of the things I was going to write to you about. It's a one-clicker to run a batch file, and you can save multiple scripts in a very easy way.

Also, 64tass is an excellent open source 65xxx-family assembler (https://sourceforge.net/projects/tass64/) that I have used for years, with the only negative for me being how macros are called (a "#" or "." prefix). Not a major deal really and the assembler itself is fantastic and has many modern programming features that others don't. No need to write macros for instructions if you are programming '816. It's very fast. Written by Soci, who has been a generous c64 programmer (hardware & software) for a long time, 64tass is in my opinion the best 65xxx assembler ever. 64tass also comes with a complete syntax highlighter file for NPP, although the color scheme was something that I had to adjust.


Top
 Profile  
Reply with quote  
 Post subject: Re: W65C816SXB Editor
PostPosted: Mon Nov 23, 2015 9:29 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
I found the 'space in expressions' bugs a couple of months ago and reported it. WDC sent me some new executables but one of them is reported as infected by my anti-virus so I'm using the original versions and leaving the spaces out. Hopefully one day they will build and distribute a new install package.

I couldn't get TIDE to create a working project so at the moment I develop using Notepad++, the WDC assembler/linker/debugger, a Makefile and some batch files that invoke the Microsoft NMAKE. I keep a Windows folder open on the screen and double click the icons to run the batch files.

There are alternative assemblers for the 65C02 and 65C81, including my own, but I have to admit that the SXB's debugger is very useful you get used to it but you need to use the WDC tools.

Part of the reason for writing the hacking tool was to install a new boot ROM with a better monitor so I can switch back to my own assembler (and structured code) and use the USB connection as serial port (instead of the ACIA) to download the S19/S28 (or S37/HEX/BIN) files my linker generates.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject: Re: W65C816SXB Editor
PostPosted: Mon Nov 23, 2015 11:14 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
I am interested in piecing something together for software development, at no (or very low) cost, but there are a bewildering number of choices out there, and I would like some friendly advice from others here.

Right now, I'm composing and editing source in Notepad or Wordpad, and running sbasm from a DOSbox. For testing, I'm mostly using AppleWin, because it's a familiar environment. Not a recipe for productivity, I know, but it has suited my needs up to now. I feel like I'm missing out on the cool new IDE packages though.

I am not a prolific coder, but I like to play around with things, and it would help me to have an assembler that I can modify for my own needs, including custom processor targets. sbasm version 3 could be the answer for me, but I don't know Python, so I can't easily modify it yet.

Should I expend the effort to learn Python, due to it's usefulness in other contexts? I am going to be 50 years old in a couple of months, and I don't want to still be trying to fix broken cars when I'm 65 ... maybe I can pick up some hobby-related skills that would look good on a resumé. I got my computer engineering degree a quarter of a century ago, and that's not going to cut it.

Mike B.


Top
 Profile  
Reply with quote  
 Post subject: Re: W65C816SXB Editor
PostPosted: Tue Nov 24, 2015 2:53 am 
Offline
User avatar

Joined: Fri Oct 30, 2015 9:49 pm
Posts: 54
Location: San Antonio, TX
Yeah, the space bug was pretty bad but I learned to live with it and I'm going to stick with the WDC compiler for now...

I figure I'll attach the files and document what I did in Npp.
Unzip the attached file, it has the basic 6502 syntax highlights.
In Npp, select the Language menu, then Define your language...
Import the XML file, close the dialog box and restart Npp, "6502_fred" should show up in the menu.
Open up a .asm file and see if it works, 6502 syntax should now be highlighted.
If the background looks weird, try the Settings menu, Style Configurator... and check the "Enable Global Background Color".
Here comes the fun part, go to the Language menu, then Define your language... Select the "6502_fred" and then play around with the colors, add keywords etc...

When it looks OK to you, select Plugins, Plugin Manager and Show Plugins. Find NppExec and install it, restart Npp.
Select Plugins, NppExec and then select Follow $(current_Directory).
Hit F6 and copy paste the following in the dialog box,
C:\wdc\Tools\bin\wdc816as.exe -g -DUSING_816 -DM_SMALL -l $(FULL_CURRENT_PATH)
Save as Compile.
Paste the following,
C:\WDC\Tools\bin\WDCLN.exe -g -t -sz -HZ -o$(CURRENT_DIRECTORY)\$(NAME_PART).bin $(CURRENT_DIRECTORY)\$(NAME_PART).obj
Save as Link
Paste the following,
C:\WDC\Tools\bin\wdcdb.exe $(CURRENT_DIRECTORY)\$(NAME_PART).bin
Save as Debug.
Cancel out of the dialog box.
Select Plugins, NppExec and then select Advanced Options...
Bottom left corner, in the Menu Item section.
Type WDC-Compile in the Item name and select the Associated Script Compile, Add/Modify.
Type WDC-Link in the Item name and select the Associated Script Link, Add/Modify.
Type WDC-Debug in the Item name and select the Associated Script Debug, Add/Modify.
Arrange to your liking and click OK.
The menu items will show up under the Macro menu.

This worked for me, I like it since I can compile, link and debug from within Npp.
Let me know any other tips and tricks you can think of...


Attachments:
Npp.JPG
Npp.JPG [ 111.46 KiB | Viewed 2017 times ]
File comment: Unzip to 6502_fred.xml
6502_fred.zip [1.07 KiB]
Downloaded 133 times
Top
 Profile  
Reply with quote  
 Post subject: Re: W65C816SXB Editor
PostPosted: Tue Nov 24, 2015 8:25 am 
Offline
User avatar

Joined: Thu Nov 27, 2014 7:07 pm
Posts: 47
Location: Ocala, Fl, USA
Another quick and easy way to add instructions is to:
1. On the menu, navigate to Settings/Style Configurator/Language:Assembler-->CPU INSTRUCTION
2. You will see a box "Default keywords" which contains x86 instructions (for MASM). Next to that box is "User-defined keywords" and in this box you can copy/paste the list below. Basically the list is alphabetic separated by a space, and you can add or subtract to the list as you see fit. The examples below are used by 64tass.
3. REGISTER, DIRECTIVE, AND DIRECTIVE OPERAND can all be modified in the same way.
4. Click "Save & Close"

Code:
adc and asl bcc bcs beq bge bit blt bmi bne bpl bra brk brl bvc bvs clc cld cli clv cmp cop cpx cpy dea dec dex dey eor gcc gcs geq gge glt gmi gne gpl gra gvc gvs ina inc inx iny jml jmp jsl jsr lda ldx ldy lsr mvn mvp nop ora pea pei per pha phb phd phk php phx phy pla plb pld plp plx ply rep rol ror rti rtl rts sbc sec sed sei sep sta stp stx sty stz swa tad tas tax tay tcd tcs tdc trb tsb tsc tsx txa txs txy tya tyx xba xce wai wdm


Top
 Profile  
Reply with quote  
 Post subject: Re: W65C816SXB Editor
PostPosted: Tue Nov 24, 2015 8:42 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
On Python, Mike, I'd say go for it. It's quite a friendly language - it's derived from a teaching language, originally. Once you have the rudiments of Python you should be able to build that into a saleable skill. Being able to point at some projects on github which accepted patched from you (even documentation patches) is surely valuable in the job market. There are lots of online resources for learning it. And Mike N's py65 is a project you might find interesting.


Top
 Profile  
Reply with quote  
 Post subject: Re: W65C816SXB Editor
PostPosted: Tue Nov 24, 2015 2:23 pm 
Offline
User avatar

Joined: Fri Oct 30, 2015 9:49 pm
Posts: 54
Location: San Antonio, TX
Satpro,

Thanks for the tip about the CPU instructions etc..., it seem like an easier approach than User Defined Language...


Top
 Profile  
Reply with quote  
 Post subject: Re: W65C816SXB Editor
PostPosted: Tue Nov 24, 2015 5:36 pm 
Offline
User avatar

Joined: Thu Nov 27, 2014 7:07 pm
Posts: 47
Location: Ocala, Fl, USA
Alamorobotics wrote:
Satpro,

Thanks for the tip about the CPU instructions etc..., it seem like an easier approach than User Defined Language...

You're welcome. I've worked with the XML files, too, and outside of always forgetting what I did the last time ( :roll: ) never could seem to get it right twice in a row. User-defined language has given me grief before (would become the default and override your chosen language for a different page and was hard to undo) so I sort of just learned to avoid it. P.S. Thanks for a couple of those NPP Exec tips.

Other good plugins:
ScrollPastEOF. It allows you to wheel your mouse down below the end of an open file. It's one of those you can't do without after installing it.
XBracketsLite. Auto completes brackets of all types.
ToolBucket. Has a multi-line find & replace. Good for replacing a longer snippet.

BTW, NPP seems to have about the best editor functions I've ever used. It's on par with UltraEdit and quite a bit better than the others.
One last thing is the Run menu command. Good for setting up your .exe or whatever else to run straight from NPP.

Mike:
I'm don't remember if the Customize Toolbar plugin is native or third-party, but it's a good one because the NPP toolbar is really loaded to the point it becomes a distraction. This plugin makes it easy to thin things out up there. Also, try the Clone & Move to Other View feature (a right-click on a tab will bring it up). Look for two toolbar icons for tab synchronization (Horiz & Vert). This lets you move the same file independently in opposite tabs, and also creates a larger work space for you. In plugins, if you haven't already, get the new plugin manager plugin. It might be standard now anyway.

Ctrl-Select lets you edit text clips in different places at the same time. Cool when you need it and often times faster than Find/Replace.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: