GARTHWILSON wrote:
Quote:
* Wow, two actual Block Move Memory instructions.
which can also be used to fill
Yeppers. I use them in my POC's M/L monitor to handle the F (fill memory) and T (copy memory) features. Both are ridiculously fast, even at low Ø2 rates.
Quote:
Quote:
* Set or Reset any memory bit without loading the accumulator. [Editor: Wrong. A mask has to be in the accumulator so the '816 knows which bit(s) to twiddle.]
He probably meant that the number you're setting or clearing the bits in doesn't need to be brought in. It makes more difference if you want to toggle the same bit(s) repeatedly as you would in some I/O situations, or if you want to do two or more locations using the same mask since the mask is not destroyed each time. He's referring to TSB and TRB though, which are not new for the '816, since they are also in the 65c02 which he does not seem to be very aware of.
I'm not sure what was meant by "not loading the accumulator." Some kind of a mask is required, so at some point immediately before executing TRB or TSB, a load does have to occur. You're correct, of course, that the accumulator is preserved, so bit toggling (e.g., strobing a port's handshake line) would be pretty convenient.
Quote:
Quote:
* INC and DEC the accumulator.
also in the 65c02
Righto. It's apparent, as you noted, that the author was not familiar with the 65C02 and did not know that many supposedly new '816 instructions were actually retained from its older cousin.
Quote:
Quote:
However, as I'm sure Garth would quickly point out, writing beginners' articles in a clear and understandable manner, proof-reading and fact-checking, and then polishing the presentation so one won't later wince when s/he sees it in lights on the Internet is a painstaking and time-consuming process.
You're not kidding, and I can now appreciate the time the author of the '816 article put into it. I did most of the actual writing for mine about nine years ago, but now I had to scan old photos, take new ones, edit them (sharpen, fix contrast, size, etc.), draw and process diagrams, get links, html-ize, etc.. Then you go over it a hundred times and keep finding things that need fixing, and, when others finally see it, they'll point out a lot of things you didn't catch before, and they're usually right. I couldn't have gotten it done except that work has been super slow for nearly the last month. Actually, I'm still not done, but I'm awfully tired of it and want to move on to other projects.
Kind of like writing a non-trivial piece of software, eh?
Quote:
A non-trivial part of writing is making it so you get the reader's interest immediately. Otherwise they will probably move on even if your article is full of gems. Even wording a title that attracts the reader can take a lot of time.
You are so very right. The reader's interest should be captured in the first sentence. Starting an article with:
The W65C816S is an upgrade of the 6502.
probably wouldn't attract much interest—there's nothing quite like stating the obvious to turn off the reader. On the other hand:
The W65C816S will enable you to write shorter, faster and more elegant programs than possible with the 6502—and with less difficulty.
probably would pique the reader's curiosity. Of course, the following content would have to accurate and well organized.
Quote:
In an '816 primer, I would want to point out, up front, that the '816 gives a ton of benefits even if you only use the first 64K of memory map, that you don't have to latch, decode, or use the upper 8 address bits to run it, and that especially if you frequently handle 16-bit values, the '816 is much easier to program.
That's very true. My POC unit doesn't use or even refer to the multiplexed A16-A23 address component at all—I didn't want to complicate this first-try design. Yet in the realm of things like arithmetic and load-store operations, the '816's 16 bit operations shrank both the code and the time required to execute it. Plus the '816's stack instructions reduce the memory footprint and make subroutine and interrupt re-entrancy a simple matter. MVN and MVP reduced the monitor copy and fill functions to vanishingly small code, as a single move instruction does what multiple lines of code previously had to do (with an 8 MHz Ø2 clock, copying an 8 KB memory segment occurs in a hair more than 7 miliseconds).
As I developed the POC's BIOS ROM I retained all the old versions, and looking back at them, I can see where I could not have fit the entire BIOS plus the machine language monitor plus the Motorola S-record loader into the 8 KB ROM space had I stuck with "traditional" 6502 coding styles. In particular, the SCSI host adapter device driver (which is full of bit twiddling), along with the code that enumerates the SCSI bus and attempts an ISL from the boot disk, simply wouldn't have fit.
So there are significant advantages to using the '816 in native mode, even without taking advantage of the extended memory addressing. Once one gets over the initial hurdle of understanding the effects of 8 versus 16 bit operation, writing '816 code becomes substantially easier than accomplishing the same tasks solely with 8 bit operations.