Search found 44 matches

by 65LUN02
Sun Dec 03, 2023 10:03 pm
Forum: Emulation and Simulation
Topic: Yet another 65xxx bit of wishful thinking...
Replies: 25
Views: 24058

Re: Yet another 65xxx bit of wishful thinking...

Circling back on this idea... documenting can be as fund as coding if you similarly do it in the style of a 1980 book from Apple.

https://www.lunarmobiscuit.com/inside-the-apple-ii4/ has a summary
and https://www.lunarmobiscuit.com/wp-content/uploads/2023/12/Inside-the-Apple-II4-with-cover.pdf is ...
by 65LUN02
Fri Oct 07, 2022 3:18 am
Forum: General Discussions
Topic: OT: what's the oldest software you use often?
Replies: 18
Views: 2406

Re: OT: what's the oldest software you use often?

I wonder how many lines of original code still exist in Word, Excel, or PowerPoint?

Given how software tends to last next to forever, I wouldn't be surprised if some part of each of those programs has survived rewrites, refactors, and "improvements" for decades.

If by "use" we include behaviors as ...
by 65LUN02
Fri Oct 07, 2022 2:56 am
Forum: Programming
Topic: A %%n.n syntax for passing parameters
Replies: 7
Views: 1487

Re: A %%n.n syntax for passing parameters

Still, you'd have to reserve the maximum number of bytes each level might require, because there's no chance of re-assigning it at runtime like a stack does continually.
Yes. But with a typical stack you have to reserve the maximum number of bytes you think you'll need, as pushing past the end (or ...
by 65LUN02
Mon Sep 26, 2022 11:03 pm
Forum: Programming
Topic: Zero page as registers or globals?
Replies: 28
Views: 6214

Re: Zero page as registers or globals?

Thanks @WillisBlackburn. Yes, I considered passing args through zp, but came to the same conclusion, that 256 locations wasn't enough if those precious addresses should also be used like registers, plus a few more for the most common of globals.

Over on http://forum.6502.org/viewtopic.php?f=2&t ...
by 65LUN02
Sun Sep 25, 2022 4:23 pm
Forum: Programming
Topic: A %%n.n syntax for passing parameters
Replies: 7
Views: 1487

Re: A %%n.n syntax for passing parameters

It sounds like you'd run into the problem that a subroutine doesn't know how many levels of subroutines deep it is, meaning it wouldn't know which set of address variables to use. One time it's called, it might be only the second one down, and another time, it might be the fourth one, etc..
I’m ...
by 65LUN02
Sat Sep 24, 2022 7:22 pm
Forum: General Discussions
Topic: The 65M202 road map that could have been
Replies: 58
Views: 14814

Re: The 65M202 road map that could have been

Turns out all that is needed is LDA XY.
LDA XY is the same as LDA (zp),Y but without the need to STA into zp.

Any further need of indirection can be done by LDA XY, TAX, and another LDA XY
But mostly the pattern I need is LDX from, LDA X followed by LDX to, STA X to move a sequence of bytes from ...
by 65LUN02
Sat Sep 24, 2022 7:11 pm
Forum: Programming
Topic: A %%n.n syntax for passing parameters
Replies: 7
Views: 1487

A %%n.n syntax for passing parameters

Over on http://forum.6502.org/viewtopic.php?f=2&t=7304 I asked whether syntax would have more assembly coders think of zero page as registers instead of byte-saving global. That %Rnnn syntax led me to another syntax-based solution to another common 6502 coding question, how best to pass parameters ...
by 65LUN02
Sat Sep 24, 2022 6:49 pm
Forum: Programming
Topic: Zero page as registers or globals?
Replies: 28
Views: 6214

Re: Zero page as registers or globals?

I think it's a false dichotomy, recall that this was a time when hand assembly was still commonplace. Regardless of what the tools, or even the documentation called something, in the end what mattered to competent low-level programmers were the capabilities, affordances, and tradeoffs on offer from ...
by 65LUN02
Wed Sep 07, 2022 12:13 am
Forum: General Discussions
Topic: The 65M202 road map that could have been
Replies: 58
Views: 14814

Re: The 65M202 road map that could have been

On the 65020, I have the index registers always adding 32 bits regardless of everything else. And I very often turn the 6502 indexed addressing upside-down: instead of adding a small variable offset (the index register) to a fixed base address, it's adding a small constant offset to a variable ...
by 65LUN02
Tue Sep 06, 2022 8:55 pm
Forum: General Discussions
Topic: The 65M202 road map that could have been
Replies: 58
Views: 14814

Re: The 65M202 road map that could have been

After coding a few thousand lines of assembly for an emulated 652402, I've found one oddity that could use some advice.

LDA.w $(zp),Y does what you would expect, loading a 16-bit value from the indirect indexed address. There is no question that having 16-bit and 24-bit values makes coding ...
by 65LUN02
Tue Aug 30, 2022 7:27 pm
Forum: Programming
Topic: Zero page as registers or globals?
Replies: 28
Views: 6214

Re: Zero page as registers or globals?

you need a multi-byte zero test at the end, because the sign of the MSB of the result is right, but it could be zero without the whole subtraction coming out zero. That's painful because the multi-byte zero test needs information to be preserved across the whole process.

Exactly. Z = Z1 & Z2 ...
by 65LUN02
Sat Aug 27, 2022 7:42 pm
Forum: General Discussions
Topic: The 65M202 road map that could have been
Replies: 58
Views: 14814

Re: The 65M202 road map that could have been

Over on http://forum.6502.org/viewtopic.php?f=2&t=7304 we're talking about whether zero page would be treated more like addressable registers if the assembly mnemonics treated them like registers instead of 8-bit addressable memory. In testing out those ideas, I whipped up a bubble sort that sorts ...
by 65LUN02
Sat Aug 27, 2022 1:42 am
Forum: Programming
Topic: Zero page as registers or globals?
Replies: 28
Views: 6214

Re: Zero page as registers or globals?

Let's try bubble sort as a nice simple benchmark. Sufficient complex that it takes two pages of code, and in this case, I'm using 24-bit values, too big for even SWEET16 but not too big. The following traditional 6502 asm isn't optimized for size or speed, but it works:
; 10x 24-bit values are ...
by 65LUN02
Fri Aug 26, 2022 4:26 am
Forum: Programming
Topic: Zero page as registers or globals?
Replies: 28
Views: 6214

Re: Zero page as registers or globals?

LDR0 $1234 loads a byte from Address $1234 into R0
LDW0 $1234 loads 2 bytes, one from Address $1234 into R0 , and the other from $1235 into R1
Nice! This is a great example of what can be trivially done with a half-step-up assembler (or easy enough for an assembler macro too in this specific ...
by 65LUN02
Fri Aug 26, 2022 4:14 am
Forum: Programming
Topic: Zero page as registers or globals?
Replies: 28
Views: 6214

Re: Zero page as registers or globals?

I have to read this entire thread, but it seems like you want to implement a virtual machine in the new assembler over and above the native 6502 capabilities WRT registers. Am I close?

Sort of. My particular testbed is a the iz6502 emulator, which is written in Go, and my own assembler+ also ...