Below you will find pages that utilize the taxonomy term “How-To”
April 19, 2024
wAx the VIC-20
Wax Over the years, I’ve looked for an Assembler for the VIC-20. Sure, there are great cross-assemblers like Kick Assembler, but I wanted something that would run on the VIC-20 itself.
Is the VIC-20 a good machine on which to write assembly? Maybe not ON the machine. The 22-column screen is a bit limiting, but after spending so much time in Turbo Macro Pro on the C64, I wanted to see what I could do on the VIC-20 natively.
April 5, 2024
10 PRINT on the HP-42s
Over the years, I’ve been on a silly quest to do 10PRINT on as many things as I can. They end up on X, here, or sometimes both.
I hadn’t considered it before because I just figured I couldn’t print the "/" and "\" characters on the HP-42s.
I was wrong. It’s pretty easy. After a few minutes in the manual, I figured it out.
00 { 45-Byte Prgm } 01▸LBL "TEN" 02 RAN 03 RAN 04 X>Y?
March 21, 2024
The McNuggets Problem
My son, now 25, was a McNuggets fan. Can you blame him? They’re delicious. He’s always been into numbers and puzzles, so I introduced him to the McNuggets problem when he was about 10.
This classic puzzle was a fun way to keep him occupied and teach him programming. The problem is simple: McDonald’s used to sell Chicken McNuggets in 6, 9, and 20 packs. What is the largest number of McNuggets you cannot buy using these package sizes?
March 13, 2024
Back to the basics with BASIC (and Python): Binary Search
Back to the basics with basic Let’s say for a moment that we’ve got an ordered list of numbers.
1,3,5,7,9,11,13,15,17,19,21,23,25 There are 13 values here and we want to check if the number 25 is in this list.
One way to do this would be to loop over each element in the list and check to see if it matches what we’re looking for.
In BASIC, we’d do something like
January 11, 2024
Machine Language: Count Faster on 6502
I’ve done a lot of silly math, ciphers and asked a lot of my vintage hardware on this site over the years. But I’ve not talked a ton about optimizing code for faster results.
Today, we will count from 0 to 2^24-1 (16,777,215). Nothing else. Count, time it, and see how fast we can get it to go.
Rust In Rust on my 2020 MacBook Pro:
use std::time::{Instant}; fn main() { // Start timing let start = Instant::now(); // Loop from 0 to 16777215 for _i in 0.
January 3, 2024
Visualize and verify the reverse engineered Commodore 64 SID LFSR
Recently, we looked at a simple LFSR and how it works.
Shift the bits XOR some of the bits together; we call these the taps Replace a bit with the XORed value. Repeat Easy peasy.
I’ve long been fascinated by the Sound Interface Device (SID) in the Commodore 64, mostly because you can use it to get random numbers.
But how does it work?
The Commodore 64 SID LFSR is 23-bits.
December 21, 2023
A Gentle Introduction to LFSRs
What is an LFSR? An LFSR is a Linear Feedback Shift Register. It’s a simple way of generating a sequence of numbers that look random.
Used in cryptography and in generating pseudo-random numbers, they are interesting because they are so simple. Shift bits and feed a few of them back into the sequence. That’s it.
Important note: LFSRs are not cryptographically secure on their own. ESPECIALLY 8-bit LFSRs. More on that in the next post on this topic.
December 19, 2023
Quick Post: Printing binary numbers in Commodore BASIC 2.0
Commodore BASIC 2.0 A lot of fun with binary numbers can be had by printing them to the screen. This is a quick post to show how to do that with Commodore BASIC 2.0. This is a follow up to Quick Post: XOR in Commodore BASIC 2.0.
We’ll be using both of these in upcoming posts, so it’s good to have them handy.
5 REM PRINT ALL 8 BIT NUMBERS IN BINARY 10 FOR N= 0 TO 255 20 FORI=7 TO 0 STEP-1 25 B=0 30 IF N AND 2^I THEN B=1 40 PRINTMID$(STR$(B),2); 50 NEXT 60 PRINTN 70 NEXT This prints all the numbers from 0 to 255 in binary.
November 30, 2023
10 Print on the TI-92
The “famous” 10PRINT program on vintage computers was a delight for many in the 70s and 80s. It’s fun to port to other platforms and machines.
I’m always looking for calculators that can do it. It requires both a slash - ASCII character 47, and a backslash - ASCII character 92. Most calculators can print the forward slash, but the backslash is only sometimes implemented.
No one is surprised; calculators have limited space, and printing random patterns isn’t a primary function for standard use cases.
November 21, 2023
A gentle introduction to two's complement
I was recently on a video call with a friend, throwing around some ideas for a new product. I mentioned adding large signed numbers in assembly and using two’s complement. He asked me what two’s complement was. I was a little surprised that he didn’t know. He’s been a Java programmer for more than 30 years. Java and Python programmers (and others like gasp Commodore / MicroSoft BASIC) don’t have a native unsigned integer type.
October 12, 2023
N-Queens problem
N-Queens Problem The N-Queens problem is a classic in computer science. Place N queens on an NxN chessboard such that no queen can attack another queen.
Wut.
Imagine you’ve got a chessboard and a bunch of queen pieces. Your mission is to place these queens on the board so that none of them can attack each other. That means no two queens can be in the same row, column, or diagonal.
September 8, 2023
Rail Fence Cipher on Commoodore 64 and TI 99/4A
I have a BUNCH of nieces and nephews. Over the years, doing some secret message passing with them around birthdays and holidays has been fun.
The “secret” location of hidden Christmas presents is a favorite.
Traditionally, we’ve used a transposition cipher like the Shift or Ceasar Cipher
For something different, we’re going to use another transposition cipher called the Rail Fence Cipher. It is easy to implement and understand. Plus easy to break, so it’s a good teaching tool.
June 28, 2023
10 PRINT on the Rockwell AIM 65
Rockwell International was a powerhouse of the 1970s and 80s.
The Rockwell AIM 65 computer, also known as the Advanced Interactive Microcomputer 65, is an early microcomputer produced by Rockwell International in the late 1970s. It was essentially a development system, intended primarily for engineers, educators, and hobbyists, and was named for its built-in alphanumeric keyboard and LED display.
The AIM 65 was built around the 6502 microprocessor, the same chip used in popular systems like the Apple II, Commodore PET, and Atari 2600.
May 5, 2023
Building a software serial bridge
Modern and retro mix One of my favorite peices of retro clone hardware is Bob Corsham’s KIM-1 Clone. I’ve featured it many places like the 6502 speed series.
I have the latest model of this board, and he made an interesting design choice. It actually has an FTDI chip on board and you use that via USB to connect via a modern computer with an FTDI driver. This is very convenient for working with a modern computer, but then eliminates the ability to use a real serial port.
March 2, 2023
Blinkenlights
In the world of tech, including vintage tech, the lure of the blinkenlight is strong.
And if you don’t like blinkenlights, can we even be friends?
My PiDP-8 might be the ultimate in blinkenlight flexing, BUT we can probably do some other fun stuff if we use math. And science!
Vicarious excitement is not as good as the real thing, he finds. - Cryptonomicon Neal Stephenson, 1999
Let’s make some 8 bit computer equipment output some stuff “in the real world” shall we?
January 26, 2023
40 years on, this is still the best maze algorithm
My friend Robin’s favorite demo is 10 print. And what’s not to love about 10 print? After all, there’s even a book about it.
My Favorite Demo My favorite demo is more complex but still simple enough to understand. The Maze Generator, from Compute! December 1981 by Charles Bond has been a favorite of mine since it came out. In the filing cabinet of my mind, I even remember it as the “Page 54 Maze”.
December 1, 2022
Validating Pilish
Have you ever sat down at your old Olympia typewriter and felt compelled to write poetry in which each word is the same length as successive digits of Pi?
Me too!!!
This is called a Pilish:
The idea of writing a sentence (or longer piece of poetry or prose) in which the lengths of successive words represent the digits of the number π (=3.14159265358979…) has been around since the early 1900’s.
October 21, 2022
My mostly retro writing platform contenders in National Novel Writing Month for 2022 NaNoWriMo
I’ve participated in National Novel Writing Month for the last two years. While I don’t have aspirations of being a fiction author, I think there is a ton of value in writing 1500 words daily. Good writing or bad, 45000 words in a month is worth the effort.
In 2021, I used a DOS 386 with Wordperfect 6.22 to complete the writing for the month and produced a pretty terrible Techno/Wilderness thriller that no one should be subjected to reading.
July 15, 2022
Adding very large integers in 8 Bit BASIC
As we’ve discussed, large integer math is a pretty interesting problem, even for modern computers.
What if we wanted to add very, very, very large integers without using scientific notation, but this time let’s do it extra slowly. Extra slow… this seems like a job for BASIC!!
Strings We’re going to need to use strings. On the Commodore BASICs of the 80s, strings have a max length of 255, so the largest sum we’ll be able to represent is:
July 7, 2022
MOS paper tape format
I built the world’s worst paper tape reader some weeks ago. It works pretty okay on anything with a USR-style port like a KIM-1 clone or a VIC-20.
It at least attempts to live up to the world’s worst name. Paper tape was (and is) an interesting medium. Sure it’s hard to work with and fragile, but it also has the advantage of being slow. I mean, what’s not to like?
June 22, 2022
A little more speed from the 6502
Can we get a little more speed from a 6502 than we did last week? Almost certainly.
The memory test we used was a general-purpose one. It’s flexible and reusable. The price is some speed. Let’s try and make it faster.
The test machine for this one I’m going to rerun the test on a Corsham KIM-1 Clone for a couple of reasons:
It’s still on my desk from last time It’s clocked at EXACTLY 1Mhz It has a large block of contiguous memory available if we want it without ROMs , etc.
June 14, 2022
How fast can a 6502 transfer memory
The amazing Gregorio Naçu posted the article title graphic this week to bring attention to the venerable 6502 processor and poke fun at Apple’s M2 chip marketing slides. He’s doing probably the most ambitious single-person Commodore 64 project I know of and has a fantastic blog.
Apple claims the new M2 chip has the following specs. M2 features Image by Apple via Youtube We all know that these numbers are probably a little fluffy.
May 25, 2022
Almost primes with TinyBASIC on the KIM-1 clone: PAL-1
Bill Gates has been a controversial figure in the Computer World for 50 years now.
Back in 1976, he famously (infamously?) wrote a letter bemoaning what he saw as rampant piracy of BASIC. Micro Soft was selling their version of BASIC, which is quite good for a whopping $150. This was fine for a company, but to a “tinker in your garage” person, $150 ($760 or so in 2022) was pretty steep.
May 15, 2022
VIC’s Revenge, the drop-in replacement for the VIC-20 VIC chip Part 1: Introduction, design goals, and FAQs
I’m doing a year-long project to reverse engineer the output and functionality of a VIC-20’s video chip, and create a drop-in replacement. At the start of this project (a few days ago), I only actually know how to do a percentage of the things I’ll need to complete this project. Writing a long series on how things work as I learn will help the project along. Plus, maybe having all of this information in one place would be nice, right?
May 10, 2022
64 Bit Addition and Products on Commodore: The Wheat and Chessboard problem
Dealing with large numbers in computing has been an attractive problem area for a long time. Using an average calculator might lead you to believe that it’s too tricky for most applications.
But it’s not that difficult. And to prove it, we’re going to implement this calculation on machines with 8 Bit registers (I mean, cmon, on this site, you can’t even pretend to be shocked).
Big numbers with the wheat and chessboard problem A classic math exercise is called the wheat and chessboard problem.
May 5, 2022
Vicky-20 S Video Mod Results
I’m very pleased with my PAL VIC-20 replica, the Vicky-20. It’s almost a year old and the VIC-20 that sits on my desk all the time.
I’ve wanted the absolute best video out of this thing I could muster. This board is fortunately VERY easy to modify.
Connections Sure, you need an S-Video Cable for this. You can use a 5 Pin DIN to RCA jack from the Amazonies for a few bucks.
May 4, 2022
Yet another version of the 100 door problem; this time, let's extend Commodore BASIC to add PRINT @, shall we?
I stumbled across a ZX Spectrum version of the 100 Door problem that got me thinking. Wouldn’t it be nice to have PRINT AT in Commodore BASIC?
We do this in Assembly all the time. We already know from several previous articles that moving the cursor is pretty straightforward using a Kernal routine:
Load the row number in X, the column number to Y, clear carry, and jump to $fff0. Simple.
March 24, 2022
Fibonacci 1-10 on the KIM-1 (and clones)
Sometimes there’s an absolute joy in doing something the hard way to REALLY understand what’s happening.
I struggled (still struggle) with wrapping my mind around using the display on the KIM-1. The best way (for me anyway) to be motivated to learn something is to have an outcome in mind of what I want to see and work towards that.
Most people who started on the KIM-1 probably spent a fair amount of time in an early book called “The First Book of KIM.
March 21, 2022
The terrible random number generation in the Commodore 64 (and 128)
Quite a while ago, I started playing with random numbers on 8 Bit machines. I don’t think anyone is doing “serious” work on these machines, but playing with Ciphers and Crypto got me at least curious about how a Commodore 64 generates random numbers.
There are many ways to determine randomness. Humans are pretty good at picking out patterns in visual representations. Luckily our beloved machines have easy screen memory access.
March 16, 2022
Getting green and amber screens from a MiniPET 40/80
In mid-2021, I built a MiniPET 40/80. It’s one of the best replica kits I’ve ever seen. Even the keyboard is wonderfully awkward to use, just like a real Chicklet PET keyboard is.
Switching between ROM versions with DIP switches has been great for learning and experimenting with internals.
My only wish is that I could occasionally get a green screen out of it. I use the composite output, which is black and white (just like many original PETs), but the 7-year-old in me just loves a Green Screen PET.
February 28, 2022
Simple splitting the screen with two colors on the Commodore 64
Someone asked me yesterday how to very simply split the Commodore 64 screen to display two solid colors.
The screen is 1000 “blocks”(character cells) starting at Hex $0400 (1024 decimal). It’s 40 characters wide and 25 rows.
25 rows don’t divide evenly, so we can tell the VIC register to hide a small part of the screen to display 24 rows instead. Register $d011 needs bit 3 toggled to zero to set the screen to 24 rows.
January 11, 2022
A visual 100 Door Problem solution in Python
Last year, we did the 100 door problem on many platforms in BASIC and Assembly language.
The 100 door problem is:
There are 100 closed doors in a row. You walk past the doors 100 times (100 passes) The first time, visit every door. If the door is closed, open it. If it is open, close it. In programming, you’d probably call this toggling the door so let’s call it that.
December 20, 2021
Permutations of 1 to 9 in Python, BASIC, and 6502 Assembly
Someone asked me this week if I would help him with a graph theory problem on 8-Bit machines. The first task was to get all permutations of 1 to 9. Since the total permutations is 9! (362,880) I knew this would take a while.
Learning without learning, the standard library problem There are no shortcuts to pretty much anything worth doing. If you fail to learn the basics, then when you get to more advanced things, the basics will feel like black magic, and the thing you’re working on will only make sense on the surface.
December 14, 2021
Can you do Advent of Code on 8-Bit Machines?
There’s a wonderful yearly online event called Advent Of Code (#adventofcode). Each day there are two code challenges that follow a holiday narrative. Some of them are easy, and some of them are quite difficult.
This year I’ve attempted to do as much of it as I can on 8-Bit Machines. Mostly Commodore 64 because it’s what I know the best, and also what I like most to actually code on.
October 28, 2021
Dice frequency
I’ve been obsessed with the Random number generator on the Commodore computers for a LONG time, and I’m not the only one who is, to be sure.
We’ve used this random function in many of the Cipher series articles before, both via BASIC and directly getting randomness from the SID oscillator 3.
Let’s try a “practical” example we might code into a game that throws dice and tests the frequency distribution.
October 8, 2021
A week of diving a little deeper into my Atari 800XL
I’m a Commodore guy through and through. This isn’t tribalism, it’s what was in my room from 1983 to when I graduated High School in 1993.
After my sorta failed attempt at spending the month of September with my Coco 2, I decided for October to try spending a week at a time with a particularly less familiar computer.
So starting on October 1st, and ending on the 7th, I spent my free time with the Atari Systems that I have.
October 6, 2021
Two weeks with a Coco 2 in September
In the inside baseball realm of vintage computer enthusiasts, a few hashtags have emerged to support one’s favorite retro computers.
The main one in September is #SepTandy
While I’ve had this Tandy Color Computer 2 for many years, I’ve almost never used it. Out of all of my vintage systems, it’s the one I know the least about. I happened to have upgraded the video circuitry on it this year. It can now produce a composite signal.
September 9, 2021
Slot Game On Tandy TRS-80 Pocket Computer PC-4
One of my first ever real programs was a blackjack game I made in BASIC on a Sharp 9300 calculator to impress my Adv. Algebra teacher. I have seen the handwritten copy of this somewhere around here recently, but I’ll be darned if I can’t find it now.
Slot Game on PC-4 Since it’s #septandy (as if that were an actual thing), here’s a slot machine on a “Tandy TRS-80” PC-4 ;-)
September 3, 2021
Calculating Pi via the Gregory-Leibniz series in BASIC on the Tandy Color Computer 2
Back in March, we did a simple set of programs to brute force calculate Pi using a simple and well-known series. It works, even if it’s inefficient.
Speaking of inefficient, it’s September and that means it’s time for #Septandy! I have a Tandy Color Computer 2 - 16k of RAM version. There are versions of this machine with more RAM and an enhanced version of BASIC called “Extended BASIC”, but I’ve had this machine since the 80s and it is the most entry-level version Tandy made.
August 5, 2021
Just for fun, the 100 door problem on several different systems
What’s the 100 door problem? It’s a just for fun problem in “beginning” math and computer courses. The idea is simple:
There are 100 closed doors in a row.
You walk past the doors 100 times (100 passes)
The first time, visit every door. If the door is closed, open it. If it is open, close it. In programming, you’d probably call this toggling the door so let’s call it that.
July 18, 2021
Running Commodore 64 BASIC Programs on a PET
The Commodore 64 and PET are fairly similar systems. Other than a few memory location differences, many BASIC programs written for the Commodore 64 that don’t use graphics can run on a PET.
There is one caveat. The PET doesn’t relocate a saved BASIC program to the beginning of BASIC, like all of the Commodore lines after it. So if you find yourself trying to load a program on your PET written on one of its younger siblings, you may wonder why it loads, but you can’t find it.
July 9, 2021
The CERBERUS 2080
A few months ago, I stumbled on a project that really caught my attention. Mr. Bernardo Kastrup, aka TheByteAttic finished a video series on a computer he designed and built “by hand.”
It’s an impressive amount of information. Clocking in at more than 12 HOURS.
Total time of his videos
3 Headed Dog Like the guardian of the gates of Hades, the board is a three-headed dog because it has 3 main processors.
June 9, 2021
Making and breaking Ciphers on the Commodore 64, er VIC-20 - Lagged Fibonacci Sequence and a little Monte Carlo while embracing contraints
We’re on ANOTHER random number generation technique today. Let’s work on the Lagged Fibonacci Sequence, a fun way to use the Fibonacci Sequence on itself to generate pseudo-random numbers.
One of our long term goals is to add a bunch of tools to our toolbox. Making reusable components makes doing more complicated things easier. You can rifle through your toolbox in hopes of an “Oh, I already have something we can use for this part!
May 19, 2021
Running the 8 Bit Show and Tell VIC-20 Super Expander Programming Challenge on the Commodore 64
One of my favorite videos on the whole internet lately is this hidden gem by Robin. In it, he executes a programming challenge he found on Twitter to draw a pattern without using IF statements.
His approach is one of my favorite math tricks of all time, and I was excited to see him use it in practice. I’ve only used it for you know… math tests.
Here’s the video if you’ve not seen it.
May 13, 2021
Making and breaking Ciphers on the Commodore 64 Part 12 - Pontifex - Solitaire from Cryptonomicon
Cryptonomicon Pontifex/Solitaire We’re back to my favorite book for another round. We’ve done quite a bit with Cryptonomicon so far. One of my favorite moments is when Enoch Root introduces a cipher that two prisoners used to communicate using just a humble playing card deck.
Drawing of the mine in the book
Bruce Schneier Pontifex is an encryption method you can do with another person using a deck of cards. It was invented for “Cryptonomicon” for Neal Stephenson by Bruce Schneier.
May 10, 2021
Making and breaking Ciphers on the Commodore 64 Part 11 - One time pads on a Commodore 64, probably a bad idea
A while ago, I explained in detail how to generate one time pad sheets and use them to encrypt and decrypt messages.
It turned out to be doable, only requiring a pencil and a way to create random numbers, but it’s slow, error prone and tedious.
Why The one time pad article was born out of my annual reading of Cryptonomicon. I wanted to learn how to make these pads, which if used correctly are mathematically unbreakable.
April 28, 2021
Making and breaking Ciphers on the Commodore 64 Part 10 - Finding hash collisions with a type in game from 1984
Hashes We did an implementation of a once popular hashing function in Part 8 on RC4 without really going into why.
A hash function is any function that is used to map data of an arbitrary size (input) to a fixed size output. An algorithm is applied to the input and results in a fixed length output called the hash.
In cryptography it’s important to get a repeatable output for a given input, but ideally NO information about the input that created it.
April 26, 2021
Making and Breaking Ciphers with Commodore 64 Part 9 - Finding Smallish Primes
Recap So far we’ve
Reversed a string Shifted bits left and right (mostly right) Brute forced a known simple cipher Channeled our inner John Connor by cracking ATM machines Searched through a large number looking for matches Learned how to use XOR to recover data Created a Linear Feedback Shift Register to generate better random numbers Implemented a “real” but outdated cipher: RC4 Disclaimer: I’m sure I’ll get an angry email from a mathematician about this, but we’re going for understanding here.
April 22, 2021
Quick Post: Slow text on the Commodore
An “almost teenager”, Josh, sent me an email yesterday asking how I do slow text on the Commodore. He is just starting assembly at 12 which is pretty impressive. He’s been using KickAssembler, but wants to try it “on hardware”.
It’s not difficult really. There are probably a lot of ways to do this, here’s how I do it in Turbo Macro Pro.
Let’s start with some text: ARE YOU KEEPING UP?
April 21, 2021
The Commodore 64 N.O.O.C.U.L.A.R. futbal project
Concept Cyberdeck I’m fortunate to have a number of vintage computers I’ve collected over the years. Some were fun finds, others donated. One I’ve had since 1983 (we think) and it’s one of my most prized possessions.
I travel a fair bit and not long ago I was looking for something for my “TheC64” to do. It’s technically an emulator, but with it’s accurate Breadbin keyboard and REU support it makes a pretty decent development platform for some things.
April 19, 2021
Making and breaking Ciphers on the Commodore 64 Part 8 - RC4
Recap So far in this 8 part series on doing weird things with Ciphers on old computers we’ve:
Reversed a string Shifted bits left and right (mostly right) Brute forced a known simple cipher Channeled our inner John Connor by cracking ATM machines Searched through a large number looking for matches Learned how to use XOR to recover data Created a Linear Feedback Shift Register to generate better random numbers The warning “In September, 1994 someone posted source code to the Cyberpunks mailing list-anonymously.
April 14, 2021
Repairing a Commodore 128 and DIY Chris's RAM tester review
I have several items from DIY Chris that we’ll review over the next week including a GAL PLA and flash-able ROM drop in that can hold kernal, character or BASIC ROMs.
First on the list is the RAM tester.
The problem child 128 I have a Commodore 128 which developed a bad RAM issue a few weeks ago. These old computers just sometimes sacrifice a part to the component gods.
April 6, 2021
Making and breaking Ciphers on the Commodore 64 Part 7 - Pseudo Random with Linear Congruential Generators
So far in this 7 part (shocked I’ve made it through 7!) series on doing weird things with Ciphers on old computers we’ve:
Reversed a string Shifted bits left and right (mostly right) Brute forced a known simple cipher Channeled our inner John Connor by cracking ATM machines Searched through a large number looking for matches Learned how to use XOR to recover data Author’s Note: This one stretched my skills quite a bit, but I kept it under 2000 words (by 89).
April 1, 2021
Making and Breaking Ciphers with a Commodore 64 - Part 6: XOR is Magical - Data recovery
Review So far we’ve:
Reversed a string Shifted bits left and right (mostly right) Brute forced a known simple cipher Faked it, but then looking for a 4 digit known pin Searched through a large number looking for matches We now have most of the basic skills in Assembly to start doing some real work. Let’s tackle what is arguably the most important of the bitwise operators for ciphers and encryption: The exclusive OR.
March 18, 2021
Jiffies in Assembly
Many of you know that you can use a “Jiffy” on a Commodore as a measure of time. Sorta.
The short short version is that we have a 3 byte clock that increments once every interrupt, so 1/60th of a second. It’s not considered reliable as a real time clock, but it IS useful for benchmarking.
According to “Compute’s Complete Guide to the C64” p. 156:
“TI equals PEEK(162) + 256PEEK(161) + 256256*PEEK(160); for TI$, the value of TI (in jiffies) is converted into hours, minutes, and seconds.
March 16, 2021
Making and Breaking Ciphers with a Commodore 64 - Part 5: Wargames
Let’s recap a little So far we’ve:
Reversed a string Shifted bits left and right (mostly right) Brute forced a known simple cipher Faked it, but then looking for a 4 digit known pin What we need next in our toolbox is to be able to search through a large number of values to look for something. This will build on the previous skills and also reinforce working with tables and 24 bit math on an 8Bit Processor.
March 13, 2021
Calculating Pi via the Gregory-Leibniz series in BASIC on the VIC-20
It’s Pi day tomorrow, and you know what that means!
Cherry is favorite. Apple is second favorite.
There is a well known and easy to understand method for calculating Pi with the Gregory Leibniz series. Leibniz built on the work on Gregory.
It has the added benefit of being pretty inefficient to implement on computers. This seems like a job for the Commodore VIC-20!
Our outcome repeats a variation of:
March 13, 2021
Quick Post: Commodore 64 Simple Addition Efficiency
There are many hacks you can do in Assembly language on the Commodore.
Here’s a very easy one with impressive results according to my analog stopwatch.
We want to count to $ffffff or 2563 (224) which is 16,777,216
We wont print to the screen to save a lot of time, and just put an “a” in the top right corner when we’re done.
One way (and yes, I want to know all the other ways you know of to do this) would be:
March 10, 2021
c0pperdragon verdict
Ahh, the quest for a better Vintage computer picture never ends. I’m having fun with it anyway.
Side thought: At what point does a computer cross over from old: no one wants that 2007 Windows tower you built in your basement, to OMG, it’s Vintage, let’s drive up the eBay bids to the stratosphere!!!!
How bad was it? Original picture from my 64C PAL Machine. Muddy with jailbars, but I’ve gotten used to this over the years
March 8, 2021
Making and Breaking Ciphers with a Commodore 64 - Part 4: The PIN Program from Terminator 2
A few minutes into Terminator 2, the young John Connor takes his Atari Portfolio out of his bag and inserts a foil covered card into an ATM machine and proceeds to crack a pin number and steal some cash from an unsuspecting account.
This is a movie prop and doesn’t really appear to do anything useful. It’s almost certainly just a script that runs on the Atari Portfolio, and just counts down some strings to make a “cool” effect.
March 1, 2021
Making and Breaking Ciphers with Python, er Commodore- Part 2: The Shift Cipher
In Part 1 we did a simple reverse of a string. While simple, these software steps will help build the skills we need going forward in Assembly without feeling like I skipped right to a 300 line after doing a short one. One foot in front of the other and all that.
The Shift Cipher For Christmas, my wife and I bought my sister’s kids this code wheel. It implements a simple shift cipher to be transposed by hand.
February 26, 2021
Replacing an RF Modulator on a Commodore 64C
The output on my newest Commodore 64 (1989) is pretty marginal. The colors are okay(ish) but the text lines are clearly bleeding and the picture is very muddy. Most vintage computers don’t do red text on blue very well, but this one is particularly painful.
Red on dark blue is too much to ask almost any vintage computer
My non-expert electronics assessment of the signal is that there are probably a couple capacitors on the board that need to be replaced, particularly in the RF Modulator.
February 24, 2021
Making and Breaking Ciphers with Python, er, a Commodore- Part 1: The Reverse Cipher
Sometime during my weeklong exploration of SHA-256 on a Commodore realized that there was a whole world of exploration that could be explored. Just because a Computer system is old, doesn’t mean it’s not interesting or useful.
I had expected it to take months to figure out the SHA-256 implementation, but it only took me a week or so. This was pretty surprising to me and is an excellent demonstration of what might be possible on a Commodore 64
February 10, 2021
Simple, 'unbreakable' encryption with a pencil
Last week, at this bat-time on this bat-channel, I talked about checking off one of my 35 year old bucket list items by learning Commodore assembly language. (shut up, you’re old too.) Coincidentally, I picked this up at the time I was re-reading Cryptonomicon by Neal Stephenson for the ump-teenth time. There are a few books that I consider so good that they’re worth re-visiting, and this is one of them.
January 26, 2021
Getting started with Native Commodore 64 Assembly
Some time in the month of September 2020 I dug out the old Commodore 64 that my Dad bought for himself in 1983. It quickly migrated its way into my room and stayed there until 1993 when I joined the Navy. Someone in my family, probably Mom, carefully packed it back into its original box and put it into storage. Despite its many years of use/ abuse by a messy teenager, it’s in surprisingly good condition, 38 years later.
January 21, 2021
Switching to 64 bit Raspbian Linux is a snap
Have you been itching to do 64 Bit ARM assembly program like I have on your Raspberry Pi? I’ll bet you have.
I mean, the thing has to be useful for SOMETHING right?
Most Raspbian installs are still on 32 bits, but switching is easy. Make backups and all that and then do:
rpi-update Then edit /boot/config.txt and add:
[pi] arm_64bit=1 Reboot
That’s all there is to it.
Of you do a