From the book C64 Machine Language for the Absolute Beginner by Danny Davis (Published by Melbourne House 1984, reissued in 2002)
If you picked up this book you'll quickly realize that it assumes working on the original hardware. Which is great if that's what you're after. The issue is however, that it gives most of its code examples in ALPA format.
ALPA is a BASIC program intended to help with being able to type the machine code program in in text, before executing it. It supports line numbers, which works like like in BASIC. It can watch memory adresses, disassemble and dump, so it's a simple assembler really. You can of course also save or load your programs to tape or disk.
Well, you see, that's the problem. I wasn't able to find the program anywhere. Luckily the book comes with the source code of it in Appendix 13. You just have to type it in! I was determined enough to do it. Because I wanted to experience how was it before the Internet and easy access to software. When for a brief period in time the most common way of getting new software was typing them in from magazines and books. As ALPA is pretty significant in size (8 pages), I wouldn't have considered it if it wouldn't have a checksum utility built in. Luckily it has, which can help you to find the lines you made mistakes in.
It's still a challenge. The printing of the book is not perfect, it can be hard to read at some places and it struggles with PETSCII characters. It's also confusing with the spaces being all over the place.
Here are my tips:
5110 JJ$=C$(J,1):GOSUB 20000:CJ=JJ ... 6070 V(I)=PEEK(G):H=INT(V(I)/16):L=V(I)-16*H
9323 DATA2,"LDA_($__,X)",2,LDX_#$,1,???,2,LDY_$,2,LDA_$,2,LDX_$,1,???
40005 RT=INT(ET/(16↑RR))
After you typed the whole thing in, type:
run 62000
You'll be asked if you want the output to a printer or not. If you don't have a printer (I didn't) you need a way to record the output as it will scroll out of the screen pretty quickly. I used a phone on a stand to record a video and watch back the output. Then check the total value. If it's different from what's in the book, go line-by-line and mark those lines that have a different checksum than what's in the book. Then you can do:
LIST line#
Go through that line again to fix any typing errors and press enter on the line to commit it. Repeat this, until you have a a checksom value that matches the book.
Oh, and of course save your program after everything matches, before running the program itself as it ends up in an infinite loop, you might not be able to run-stop it and you might lose your progress.