News for hackers. Stuff that matters.
Re:A quick start guide to Commodore 64 assembly programming ... by panic on Friday April 14, 2017 @10:39AM (#14114701)
There's something uniquely satisfying about writing code in a limited environment like the C64. No libraries or operating systems -- just you and the hardware!
Re:A quick start guide to Commodore 64 assembly programming ... by ajross on Friday April 14, 2017 @11:32AM (#14115031)
You can still do this! The register interface for the peripherals on modern microcontrollers is only a tiny bit more complicated (and in some ways significantly easier) than what we had on 8 bit PCs.

You can absolutely grab a generic gcc/binutils cross toolchain for an ARM Cortex-M, an AVR, or even an Intel Quark board and start writing simple to-the-metal code today. It's not hard, or at least it's not meaningfully harder than Apple II or C64 hacking.

It's just that no one does it. All the vendors ship integration libraries and fancy IDEs for all these boards, so what everyone chooses in practice is one of these, or an RTOS that provides an even more abstracted view. And that's not a bad idea either of course.

But the hardware is still there, and still fun, and still useful for real tasks in the modern world. Start hacking.

Re:A quick start guide to Commodore 64 assembly programming ... by david-given on Friday April 14, 2017 @12:05PM (#14115236)
I've never hacked assembly on an AVR, but I have on the MSP430, and it's a really elegant architecture to work on; expressive enough to let you get stuff done without hurling your development board at the wall, but constrained enough to make figuring out a neat optimisation both satisfying and useful.

Also, the MSP430X has 20-bit registers, just for that added level of surreality.

However, even I have limits: stay clear of PIC12. It's just... bizarre, and not in a good way.

(Somewhere I have 2/3 of an 8080 emulator for the MSP430, written in machine code. It ran on the basic Launchpad, with 2kB of RAM, and booted CP/M using an SD card for storage and an external serial SRAM device for memory swap. Sadly, while I got it talking to an AT keyboard, I never got a screen to work, and I've since broken up the hardware for other projects. The emulator core was 1kloc of assembly. The 8080 is surprisingly orthogonal.)

Re:A quick start guide to Commodore 64 assembly programming ... by Gracana on Friday April 14, 2017 @01:59PM (#14115944)
Those vendor libraries are super ugly and take the fun out of a project.. I absolutely hate the tedious "work" programming where you plug bits of pre-built technology together without actually doing much of anything on your own.

A while back I had an STM32F7 (ST cortex M7) board that I wrote some assembly code for. Getting correct clock signals and power to all the peripherals and bringing up RAM and configuring devices sure was complex (and it's not explained by the datasheet in a particularly straightforward way), but doing it that way is certainly enlightening and interesting, compared to fiddling with a vendor-supplied toolchain.

However... I would recommend not using a Cortex M device if you decide to go the ARM route. Pick a full classic-arm-ISA device so you can use the more human-oriented instruction set. You can stills witch to THUMB if you want, but you won't be forced to deal with its quirks and limitations.

Re:A quick start guide to Commodore 64 assembly programming ... by corysama on Friday April 14, 2017 @11:42AM (#14115082)
The GameBoy Advance was very similar. If GBA happenes to be more interesting to anyone here, https://www.reddit.com/user/fuzzylumpkinsclassic/submitted/ is in the process of creating some nice GBA homebrew tutorials.
Re:A quick start guide to Commodore 64 assembly programming ... by Zancarius on Monday April 17, 2017 @03:37PM (#14133772)
Did you ever see this link [1] regarding the GBA anti-emulation features some time back? It's a bit tangential and slightly off-topic, but it might be of interest if you haven't!

[1] https://mgba.io//2014/12/28/classic-nes/

Re:A quick start guide to Commodore 64 assembly programming ... by corysama on Monday April 17, 2017 @04:43PM (#14134251)
I have not seen that :) They'd probably like it over in https://www.reddit.com/r/ReverseEngineering/
Re:A quick start guide to Commodore 64 assembly programming ... by ddingus on Friday April 14, 2017 @11:59AM (#14115192)
A Parallax Propeller offers this experience.

Beautiful assembly language, and a software assisted video system combine to make a lot of fun. It's possible to output video that closely matches the 8 bit era and then add sprites, etc...

I had a lot of fun duplicating old school effects, displaying images with artifacts, etc...

You can get a dev board, or just wire one up on a breadboard. Easy.

There are 6502 and Z80 emulations done too.

The real fun part is this chip is a concurrent multiprocessor. Makes combining a 6502, say video system and sound easy and fun.

I ended up learning a ton and have sense used the chip for some industrial R&D. Nice spiff, for having a play.

Re:A quick start guide to Commodore 64 assembly programming ... by mmjaa on Friday April 14, 2017 @01:07PM (#14115617)
Indeed, it is ultimately satisfying! It is also very fun to have one of these old machines, and still see new software being written for it (http://oric.org/)

Apropos amazing things on limited environments, here is a working 3D modelling environment, with Blender model import, running on .. the PICO-8 fantasy console:

http://imgur.com/a/VORAB

The software world is full of cute treats!

Re:A quick start guide to Commodore 64 assembly programming ... by tyingq on Friday April 14, 2017 @10:57AM (#14114811)
Easy 6502 is pretty fun as well: http://skilldrick.github.io/easy6502/

Since it's a javascript 6502 emulator, you get maybe 60% of the fun of programming for a C64, but just by visiting a web page. On a single page, they take you from making 3 colored pixels to a functioning snake game with explanations of what's happening along the way.

Re:A quick start guide to Commodore 64 assembly programming ... by arundelo on Friday April 14, 2017 @11:53AM (#14115155)
Ah, last time I looked at this I thought, "This is cool but it's too bad it doesn't have EQU or some other way to give symbolic names to constants."

Now it does!

  define appleL  $00 ; screen location of apple, low byte
(Looks like the feature was added in November 2014.)
Re:A quick start guide to Commodore 64 assembly programming ... by jackhack on Friday April 14, 2017 @11:12AM (#14114906)
Impressive!!

Though I've never seen the Accumulator referred to as the "A register"...

LDA #$c0 ;Load the hex value $c0 into the A register

Re:A quick start guide to Commodore 64 assembly programming ... by tyingq on Friday April 14, 2017 @11:27AM (#14114990)
It is referred to that way in old datasheets: http://imgur.com/a/GlDiz
Re:A quick start guide to Commodore 64 assembly programming ... by tyingq on Saturday April 15, 2017 @12:22AM (#14119384)
Interesting blog post that explains why one of the GP registers (EAX/RAX) in x86/x64 is also referred to as an accumulator: http://noeffclue.blogspot.com/2016/02/the-accumulator-regist...
Re:A quick start guide to Commodore 64 assembly programming ... by ddingus on Friday April 14, 2017 @11:52AM (#14115152)
Older docs made this reference. I see someone else noted it too.

In my peer group back then, it was "load A" for LDA, not "load accumulator"

Re:A quick start guide to Commodore 64 assembly programming ... by dep_b on Friday April 14, 2017 @11:39AM (#14115071)
I remember doing an assembler class where you needed to load something in A and B before you were able to perform an operation on it.
Re:A quick start guide to Commodore 64 assembly programming ... by pcwalton on Friday April 14, 2017 @12:48PM (#14115490)
Sometimes A appears explicitly in the syntax of the INC instruction, depending on the assembler.
Re:A quick start guide to Commodore 64 assembly programming ... by digi_owl on Friday April 14, 2017 @01:49PM (#14115875)
Also a stark reminder that when it comes to "brass tacks" a CPU is inherently procedural (or should i say imperative?).