Page 2 of 4

Re: ASMEDIT X16 - 65C02 Assembler and Editor Software

Posted: Tue Aug 08, 2023 1:42 pm
by Daedalus
voidstar wrote: Tue Aug 08, 2023 5:41 am Hey, I repeated your steps - not exactly sure what I did differently, but my resulting PRG is valid and running. (well, valid aside from the same issue you had as well)

So agreed, mostly-success!!

Is the PRG code mistake because after the "01 08" starting address, the next bytes after that are a regular 6502 instruction JMP, as opposed to being a BASIC tokenized equivalent of the SYS CALL? (the portion in red below -- 4C is an absolute jump?)

asmedit_example_bad.png

I tried manually patching it, but in the end just did the SYS $0810 like you.


Maybe the manual just needs a few brief simple examples. And maybe an overview of .sor and .s syntax differences? (and of course this PRG creation jump fixed)
Yeah! I think that's the case.. "as opposed to being a BASIC tokenized equivalent of the SYS CALL?" It looks like BASIC tried to put a line number in, or otherwise made assumptions. The best "fix" I found was to just start the program at $1000 with *=$1000 at the beginning and then run it with SYS $1000.

You could also byte-bang in a proper BASIC preamble, including the tokenized SYS call (Like ca65 does.) that way the RUN command would work.

Re: ASMEDIT X16 - 65C02 Assembler and Editor Software

Posted: Tue Aug 08, 2023 1:54 pm
by voidstar
Should these pass validation?

Re: ASMEDIT X16 - 65C02 Assembler and Editor Software

Posted: Tue Aug 08, 2023 2:37 pm
by Matherian
Yes, but the problem is that ASMEDIT only lets you create code above address $ff
if you specify, for example, *=$400 on the first line the assembly should not fail.

Re: ASMEDIT X16 - 65C02 Assembler and Editor Software

Posted: Tue Aug 08, 2023 3:03 pm
by Daedalus
I think the error is where it's trying to put them, not the instructions themselves... (The opocodes and the addresses associated with them are ok.)

But they seem to be trying to go into zero page. Did you forget the *=XXXX start point?

Re: ASMEDIT X16 - 65C02 Assembler and Editor Software

Posted: Tue Aug 08, 2023 5:00 pm
by TomXP411
Wow, thanks for being here. It's amazing to see old hands from the early Commodore days still interested and active in the community.

Re: ASMEDIT X16 - 65C02 Assembler and Editor Software

Posted: Tue Aug 08, 2023 5:03 pm
by voidstar
Yep, I forgot that line at the top, forgot we're back in 1980 again :P

Ok, I put " *=$0400" at the top. Now it passes validation. Yeehaw!

Also beware when you generate code, if the file already exists it might not overwrite it - not sure if a way to force overwrite. But I missed that warning and was running old PRG by accident (I had to manually delete it first).

BUT.. then I tried SYS $0408 and I'm not sure if the program is running correctly (not seeing values written back to $B000 like I expected). Will try again later, gotta drive for a bit :( [ tried $2000 instead, same issue - maybe instead of treating it as a PRG to LOAD we gotta treat is a .BIN and load it via the monitor? ]

Re: ASMEDIT X16 - 65C02 Assembler and Editor Software

Posted: Tue Aug 08, 2023 5:05 pm
by TomXP411
Matherian wrote: Tue Aug 08, 2023 11:16 am One criticism I have is that I cannot read the .LST files on the X16. At the moment I use WINDOWS NOTEPAD to scroll through them. My XAE.LST is 571 kb. I'm not sure if we have such software on the X16 yet, may be I'll look to writing one myself
X16Edit should work for you.

viewtopic.php?t=6290

The plan, as far as I know, is to incorporate this into the system ROM in a future release. So you'll be able to type EDIT or EDIT "filename" in BASIC and edit a file.

The Editor uses banked memory to hold the file, so you should be able to load up to 2MB.

Also, you can now seek within sequential files, so if you only need to view a listing, you can use the CMDR-DOS "P" command to read to a specific point in a file, then read the file to the display a screen at a time. (I suggest keeping an array of starting positions to allow you to seek in reverse.)

Re: ASMEDIT X16 - 65C02 Assembler and Editor Software

Posted: Tue Aug 08, 2023 5:07 pm
by TomXP411
voidstar wrote: Tue Aug 08, 2023 5:03 pm BUT.. then I tried SYS $0408 and I'm not sure if the program is running correctly (not seeing values written back to $B000 like I expected). Will try again later, gotta drive for a bit :( (maybe $0400 was a bad spot for a few bytes of code?)
Writing to $B000 is problematic, since that's banked memory. Are you setting the bank to $01 (or higher) in your program, and are you using the O command to set it in the monitor before reviewing the output?

Re: ASMEDIT X16 - 65C02 Assembler and Editor Software

Posted: Tue Aug 08, 2023 5:12 pm
by voidstar
Ah ok will try when back - change top line back to $0400, and the "output" writes to maybe $2000 ?
asmedit_random_prog.png
asmedit_random_prog.png (4.7 KiB) Viewed 5907 times

Re: ASMEDIT X16 - 65C02 Assembler and Editor Software

Posted: Tue Aug 08, 2023 5:28 pm
by Matherian
Thanks for the heads up on the Planned X16 Editor. The CMDR-DOS 'P' command sounds promising👍