Learning by the book – part 3

Debunking The Machine Language Book Of The Commodore 64 – part 3

So the author’s last post was in February and your correspondent was beginning to wonder what had happened to him… article 50 has been triggered, we’ve had a general election and your correspondent has got married in that time and, whilst that third event won’t have made the author’s radar, the lack of coverage for the other two comes as a surprise. It’s presumably a strange coincidence that the author reappears just a few days after your correspondent posts something.

We’re now really getting down to understanding how the Commodore 64 works and how some people managed to program it, in spite of its totally crappy built in Commodore BASIC V2 language, which had no dedicated commands for colour, graphics, or sound, and didn’t support the Hexadecimal numbering system either

The author has forgotten once again that other BASIC dialects didn’t support hexadecimal numbers as well; this isn’t something specific to berate the C64 over since many other dialects including some the author has “championed” also omit this feature.

as well as Commodore’s crappy manuals totally leading people off track by telling them to PEEK and POKE to 5 digit decimal memory locations, instead of having the locations stored in files as hex labelled by EQU directives.

That’ll be the same C64 manual that actually assigns the variable V as 53248 and then POKEs to two digit offsets from that point[1] for its sample programs dear reader; the author is either ignorant of what the C64 manual actually says (which is fairly hard to believe since it’s been debunked previously in a post the author has replied to) or deliberately misleading his readers at this point.

And let’s just pause to reiterate dear reader, the same process of POKEing five digit numbers is required to handle hardware sprites on the Atari 8-bit but that machine’s manual doesn’t tell people to use hexadecimal (because that BASIC dialect doesn’t support it either) and in fact doesn’t actually cover the subject at all!

This year (2017) marks the 35th anniversary of the C64 being released. It also marks the 35th anniversary of me and my Mum running away from the home my Dad had turned into a slum with lots of unfinished DIY jobs and hoarding. Neither of these events is anything to celebrate, especially as my Mum and me ended up having to return to that slum after only about six months.

Only one of these events is really relevant to the stated topic of the author’s blog dear reader. Your correspondent also doesn’t want to comment on the author’s personal situation because the opportunities for cheap jokes are incredibly strong.

The book is about Assembly Language, but not on any specific computer. The Introduction/Preface mentions Commodore, Apple, and Atari computers as being 6502 based and that it applies to all those computers as well as to any other 6502 based computer, so it wouldn’t enable you to write any C64 demos.

Of course it won’t dear reader, a general purpose 6502 assembly language book won’t specifically teach a would-be programmer how to write demos, games or utilities on any of the platforms with a 6502, but saying that rather than targeting the C64 specifically a above would of course go against the author’s childish, bile-laden narrative! A book like the one described sets out to teach the base language before handing off to other works for the platform-specific information.

But it’s worth noting that, once a programmer understands the language, it isn’t particularly hard to pick up the first steps of demo programming such as moving sprites or scrolling messages and, since demos usually aren’t interactive and small ones don’t need to deal with things like I/O, demos are actually easier to program than games or utilities and just as useful as example code.

This book has a chapter called “Extending BASIC”, but actually there are no extended BASIC commands in the book. All it shows you is how to pass parameters to a SYS command.

Just because it lacks the extra programming required to add more commands to the BASIC interpreter that doesn’t mean it somehow stops being an extension dear reader; your correspondent is vaguely aware of quite a few similar examples for other 8-bits which work in a similar way whilst still being classified thus.

Finally, here’s some artwork I did in the C64 lores screen mode. No programming was required at all, I just used some software called Multipaint, which runs on Linux, Windows, and Mac OSX. I didn’t spend all that long working on it. It gives you a rough impression of the slum I grew up in, which was in stark contrast to the semi detached house next door.

The lack of detail and some rather jarring changes in perspective between the house itself and the vehicles parked around it all stand out with this particular piece; granted the author is remembering a childhood memory, but there wasn’t any requirement to draw the picture in the style of a key stage 1 student.

It is telling, however, that this picture is still the most involved graphical work that the author has produced since his blog went live nearly five years ago and significantly more substantial than anything he’s produced with any dialect of BASIC since that time as well?

I found I couldn’t convert the original graphics file from .bin or .ocp (Advanced Art Studio) to GIF, JPG, or even BMP, so in the end I had to take a pic of it with my Android phone.

It is apparently beyond the author’s wit to grab a screenshot with his PC, crop out the surrounding desktop and merely upload that to his blog…

[1] It doesn’t do the same for SID registers however; these are given as specific five digit values but, as has been noted by commenters on the Author’s posts, there aren’t that many values to actually remember.

Advertisements
Posted in Debunking | Tagged , , , , ,

Release Notes – WannaClone

Goodness dear reader, it’s been a very long time since the last C64CD demo release so here’s a new one for the C64 called WannaClone. There are a couple of inspirations for this release, with the primary one being a thread at the Atari Age forums called “screwing with pirates” where the initial post from user 2600problems features a BASIC-driven password protection for the C64 which… well, let’s charitably say it wouldn’t work, in part because the password can be found or overridden simply by looking through the program.

But the subject of encryption came up in said discussion and, since your correspondent has experimented with this a little in the past, that seemed like a good enough excuse to write a little practical example. The text for the scrolling message in WannaClone has actually been encrypted in a reasonably loose sense of the term; each character is exclusive ORed with a byte from the first 256 in the music routine before a “seed” value is added to it, neatly turning plain text into guacamole when looked at in memory. The result from each pass is then used as the seed value for the next one, so changing the encrypted text itself, the initial seed value or that block of the music being used will completely garble things. The text is stored as raw data in the binary directory for those wanting to examine it further, there might even be something extra in there…

WannaClone (C64)This exercise shouldn’t be taken anywhere near seriously of course because it wouldn’t require ridiculous amounts of work to circumvent the encryption (especially since the source code containing the “magic number” $6A which is used to set things rolling is readily available[1]) but the principle could at least be expanded to perhaps using the characters of a password as initial seed values instead.

We haven’t even approached the question of why such a “protection” would actually be required on 8- or 16-bit software and, although your correspondent asked within the thread, he didn’t receive an answer so will instead leave it to the reader to ponder. This demo does at least serve as a questionable excuse to do the WannaCrypt joke again and a couple of small but potentially useful Windows-based tools for processing data were written so that’s… something?

[1] The number $6A wasn’t chosen at random, it’s 106 in decimal and your correspondent is a fan of Jeff Minter’s 8-bit games; shooting a camel in some of those titles would award the player with 106 points, a reference to an American radio station.

Posted in Programming | Tagged , , , , , , , , , , , ,

Knowing me, knowing EU

Debunking The Commodore 64 the EU and Brexit

The author’s latest little missive is something of a stretch considering the author’s self-stated topic of “explaining why the Commodore 64’s BASIC V2 was crap and how some people managed to program the C64”; the post being examined here completely ignores the stated aim (although that hardly comes as a surprise) and steps well outside of the author’s self-imposed 1984 to 1985 window at the same time! And, considering how inaccurate his posts are generally, it’s hard to believe that anybody sensible would take notice of his political commentary without at the very least double checking the facts.[1]

Unfortunately, things didn’t go entirely according to plan. Lots of foreign computers were widely sold in the EEC and at one stage Commodore was the largest supplier. Of course, there were also lots of computer manufacturers native to the EEC, including Sinclair, Acorn, Tangerine with their Oric and Microtan computers, Thomson, and Olivetti.

And, because the C64 and other Commodore hardware for the EU was manufactured within the EU, we have to include Commodore on that list as well dear reader, unless we’re holding some kind of pathetic, childish grudge of course.

 I remember Ian McNaught-Davis (RIP) on the BBC’s Micro Live TV series presenting some charts which showed how there was a lot of trade protectionism in the USA

It’s probably fun for the author to throw terms like “trade protectionism” around but actually demonstrating it is far more difficult since there are so many factors in play. For example, the American home computer market had a significant head start on the UK so taking a 48K system like the Sinclair Spectrum over as the Timex Sinclair 2068 in 1983 when companies like Apple and Atari had been doing the same general kind of computer since the late 1970s and were already moving beyond even the expanded machine’s specifications was, even if we’re being charitable, a questionable idea at best.

Obviously, the EEC should have blocked Commodore from ever setting up a subsidiary inside the EEC, then set up some kind of quality control or non tariff barrier to stop Commodore computers from entering the EEC, but they failed to do either of those things.

No dear reader, obviously they were right not to block Commodore in that way because these rules aren’t made for a single company and the same “logic” would also have applied to the UK arm of American company Timex who manufactured the Spectrum for Sinclair or indeed other companies whose headquarters were outside the ECC like Atari or indeed the MSX consortium.

The EEC could have made up some rules such as that foreign computers sold in the EEC would have to have a minimum spec before getting a permit to be sold. Computers made by companies in the EEC all seemed to have quite advanced versions of BASIC, so Commodore and Sharp (whose MZ80K had NO language on ROM), could have been required to have the same. Unfortunately, they weren’t.

That net would also catch a lot of other hardware on sale which didn’t come with BASIC in ROM or didn’t match the author’s requirements; remember dear reader that, even if we ignore all of the non-consumer systems such as mainframes or minicomputers, a ruling such as this would also have outlawed sales of the Jupiter Ace, earlier models of the Atari 8-bit series (where BASIC was on cartridge), blocked the Atari ST and Commodore Amiga… some of which are machines the author has previously championed for one reason or another!

And companies are endlessly resourceful when it comes to finding work-arounds for these rules anyway, look at Amstrad’s Spanish distributor Indescomp who released the “72K” CPC472 simply to get around tariffs aplied to systems not meeting certain criteria which had 64K or less; that extra 8K of RAM was a single chip that wasn’t electrically connected to the computer and therefore useless!

In Sweden there was a quite well thought out computer called the ABC80 https://en.wikipedia.org/wiki/ABC_80  , which came out in 1978. This was based round the Z80 CPU and had its own type of BASIC, which was self compiling, so ran much faster than other dialects of BASIC, at a similar speed to Assembly Language/Machine Code.

Natively compiled BASIC (or, as the linked Wikipedia article describes it in the case of the ABC80, semi-compiling) will be faster than the original, fully interpreted BASIC program but simply can’t be expected to produce machine code execution speeds. It’s also worth remembering that compilation has memory overheads, reducing the available memory for programs as well.

Unfortunately, this computer wasn’t very successful outside Sweden, which was probably due to Sweden only being part of EFTA instead of the EEC.

There is no “probably” here and the author is merely guessing once more. But since we’re on the subject of the ABC80, here’s video of a recent demo called Hires Invasion created by members of Genesis Project which uses precise timing to create high resolution graphics on a machine not equipped for them:

(Genesis Project are primarily a C64 group dating back to the 1980s, hence the link above to their profile at the C64 Scene Database.)

After this, there might actually be a lot of manufacturing in Britain by cottage industries, making copies of foreign computers because most people wouldn’t be able to afford the real thing, the same as happened in the USSR, where there were lots of Sinclair Spectrum clones. Of course, no other countries would buy these goods.

This merely demonstrates a lack of understanding as regards what goes into a modern computer, dear reader; home computer development and manufacture wasn’t a small scale, cottage-style industry in the 1980s and now things are in a completely and utterly different league.

Of course, I advise everyone against subscribing to Sky TV, or to unsubscribe if they already do, because it’s owned by Rupert Murdoch, who brainwashed lots of people in the UK into voting Leave, because “When I go to Downing Street they do as I say. When I go to Brussels they usually take no notice”.

Your correspondent wouldn’t head anywhere near as far down the tinfoil-hat-wearing path as the author does by suggesting that the media broadcast by Murdoch-owned companies “may contain brainwashing and even subliminal messages”[2] (because everything is broadcast digitally and conclusive proof of such shenanigans couldn’t remain concealed for any extended period) but, generally speaking at least, your correspondent actually agrees that Murdoch’s influence on the United Kingdom isn’t a positive one.

Just imagine what a difference it would have made! If the Commodore 64 had been banned in the EEC.

We can easily imagine some of the effects dear reader; Commodore employed a huge number of people in those territories who would otherwise have not been in work and their computers were the starting point for an equally large percentage of the home grown game development and other IT-related industries throughout Europe. Taking them and other US influences (as we’ve previously noted, the author’s suggestion of an ECC “rule” to remove Commodore would also have impacted on Atari, Sinclair, the MSX consortium and others) out of the economy without anything else to fill those voids would have been a complete and utter disaster.

[1] Your correspondent may also be offering a personal commentary on socio-political matters, but doesn’t expect to be taken seriously or avoid being fact checked where appropriate, even in the current “post truth” environment.

[2] The author rather subversively suggests using illegal means to watch the Fox productions he feels may contain subliminal messages but, if that were actually true, obtaining said media outside of Fox’s control wouldn’t remove said subliminals so they’d still be a danger to the viewer!

Posted in Debunking | Tagged , , , , , , , , , ,