-
Put subroutine into the library
Subroutine is an essential concept in programming. Advantages of using subroutines are quite clear - instead of doing a repetitive work, we define chunk of code once and “jump” to it any time we need it. It is a part of DRY principle (do not repeat yourself), which allows to keep our code compact and maintainable. It allows us to keep memory footprint of our code at reasonable level. With possibility of passing execution arguments as well as result, subroutines become fully blown procedures and functions as known from high level languages. How does MOS 6502 support subroutines? We essentially need two instructions: “Jump to SubRoutine” that does typical long jump to given memory address and “ReTurn from Subroutine” that...
-
Writing and using libraries in KickAssembler
It’s a long way I took from early times when I coded something for MOS 65XX family to now, when I actually code for money. What was really a joy or hobby, now becomes a rather routine work guided by corporate processes, software frameworks and project management methodologies. I do not want to complain, I fully understand that productivity is a key and live is hard. When I came back to C64 programming, and that was roughly two years ago (2016) I was just a little bit bored being sick listed because of backbone problems (something very common for programmers of my age). I jumped into very fast, watched bit of excellent 64bites, discovered a wonderful pair of KickAssembler and...
-
Review: New PSU for Commodore 64/128
Reliability of original C64 CPU has been disputed in community for long time. Commodore had problems with it in the past, plenty of houses were put on fire. Today, over 35 years after first Commodore 64 was produced another issue becomes especially painful: some of bricks decide now to ignore its spec and generate voltage that exceeds its nominal 5VDC thus frying most of precious chips. Original PSU is not easy to replace. Commodore decided that C64 must be powered with two types of voltages: 9VAC that is then rectified and regulated by circuit located inside computer and 5VDC that is rectified and regulated by circuit located inside power brick and is used directly to power most of C64 chips....