Assembly Programming Using Commodore 64 Kernal Routines

  Рет қаралды 9,120

Josip Retro Bits

Josip Retro Bits

Күн бұрын

Пікірлер: 93
@macdaddyns
@macdaddyns 6 ай бұрын
Really like your style of teaching, thanks for sharing your knowledge and time!
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Thank You very much :) Cheers!
@jmp01a24
@jmp01a24 3 ай бұрын
@@JosipRetroBits What kind of assembler you use? Did you ever try Macro Assemblers, like Turbo Assembler, etc?
@jimmydandy9364
@jimmydandy9364 6 ай бұрын
When I did programming on my C--64, I used BASIC a lot, much faster to write software, but I also used assembler a lot too, because BASIC would be way too slow for certain things, so I mixed both, I did BASIC and assembly for some routines and embedded those routines in my BASIC program through the SYS command. I did some pretty impressive and fast BASIC stuff this way - It was very useful for BASIC programs with background stuff, through the use of interrupt routines in assembler.
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Oh Yes, that was the thing back then and still is, if You want to speed up some parts of the BASIC code, just inject that part in the memory (machine code) and call it with SYS. And Yes, BASIC couldn't handle interrupts so for that You would need to use assembly/machine code for sure :) Cool! Thank You for watching :)
@PeranMe
@PeranMe 6 ай бұрын
This is like ”stupid pet tricks”, except a generation or two later :-) Lots of fun stuff, thanks for this, I enjoyed it a lot!
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Ha Ha, something like that :) Thank You very much :) Cheers!
@Commodoreretro-programming
@Commodoreretro-programming 6 ай бұрын
Very interesting video. The Kernal contains indeed fun to use ready-to-go routines !
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Yes it does and what I show in the video is just a very small amount of those routines :) Thank You for watching :) Cheers!
@saganandroid4175
@saganandroid4175 6 ай бұрын
I imagine discovering RunStop/Restore is going to change your life. I can't imagine not having that available! It was essential in my experience. ProTip: sharp quick taps on the Restore key. It's weird that speed of tap can make a difference sometimes but it really does. Gotta be in how downside transition of the signal generates the NMI.
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
I think that will change my life tremendously :) Thank You for watching :) Cheers!
@CaptainCommodore
@CaptainCommodore 6 ай бұрын
Nice explanation as always, assembly for everyone.......
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Thank You :)
@AngryCVO
@AngryCVO 6 ай бұрын
As an ICT-professional, also very interested in retro-computing, I see many videos about different computer & network stuff on youtube and other media. I must say that this one is amazing. You explain this in a professional way. Lots of video's have lots of hesitating as if the teacher sees what appears on his screen for the first time. Not in your case. You master the knowledge perfectly. This video gave me lots of ideas and teached me stuff I was looking for. Thank you very much.
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Thank You very much :) Just to be clear, there are people in the retro community who have more knowledge and teaching capabilities than I do. I wish You the very best in Your retro journey and welcome aboard :) Cheers!
@RudysRetroIntel
@RudysRetroIntel 6 ай бұрын
Excellent video and work! Thanks for sharing all your knowledge
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Thank You Rudy :) I enjoy this stuff and I do hope I managed to share my enthusiasm with all of You :)
@ajarivas72
@ajarivas72 6 ай бұрын
​@@JosipRetroBits Great video. I had a Commodore 16 in 1985. My classmate had a Commodore 64. Any idea where I can find the user's manual. There were very good Basic codes in that book.
@jmp01a24
@jmp01a24 3 ай бұрын
Good Kernal & Basic from MC tutorial.
@JosipRetroBits
@JosipRetroBits Ай бұрын
Yes. Thank You for watching and sorry for my late respnse. Merry Christmas!
@WilcoGroothand
@WilcoGroothand 6 ай бұрын
nice examples on how assembly works. Thx
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Glad you liked it and thank You for watching :) Cheers!
@byteforever7829
@byteforever7829 6 ай бұрын
Excellent video! I like the Mikro assembler as well, i'm definitely going to try that soon
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Thank You very much :) Yes I like MA too, I know it's way easier to develop on a modern machine these days but this feels so natural to me :) Cheers!
@saganandroid4175
@saganandroid4175 6 ай бұрын
Does this basic assembler lack comment or rem features? If would be useful in these videos. Really useful. You know that tone left on at about 55:05? RunStop Restore fixes sound/noise too.
@JosipRetroBits
@JosipRetroBits Ай бұрын
Yes there are comments, just use REM statement like You would do in normal BASIC code. Sorry I didn't catch that at 55:05, apologies...
@HelloKittyFanMan
@HelloKittyFanMan 6 ай бұрын
Haha, wow, interesting way to write an ML assembly: using a BASIC listing as your playground (but then still having to have the underlying programmer assemble it).
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Yes, back then this was a very nice way to program/develop in assembly and compile/run on the same machine. Now it's way better to develop on a modern pc and then just test on C64, but I like this first method, don't know why, feels natural :) Thank You for watching :) Cheers!
@TheUtuber999
@TheUtuber999 6 ай бұрын
19:50 I would probably use JSR $FFE4, then BEQ LOOP. That way you can exit by pressing any key. 31:03 This effect only works on PAL C64s. On NTSC machines, it just displays somewhat random garbage.
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Thank You for your information, uuu, ok I need to check what is the problem with 31:03 on NTSC, to be honest, I didn't check if ti works on all systems. Cheers!
@8BitRetroReFix
@8BitRetroReFix 6 ай бұрын
Interesting stuff .. nicely explained, mate
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Thank You Steve :)
@twenty3_co_uk
@twenty3_co_uk Ай бұрын
I like how the colour change of background looks different due to 3 lines less of memory being used. Though the program is the same.
@JosipRetroBits
@JosipRetroBits 29 күн бұрын
Yes, it does :) Thank You for watching and have a Merry Christmas :)
@Ferrie123
@Ferrie123 6 ай бұрын
Very well explained 👍 enjoyable stuff ❤
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Glad you enjoyed it and thank You for watching:) Cheers!
@wadz668
@wadz668 6 ай бұрын
Programming definitely is a LOT of fun. I find it more fun than playing games
@JosipRetroBits
@JosipRetroBits Ай бұрын
Me too :) Thank You for watching and sorry for my late response. Have a Merry Christmas!
@saganandroid4175
@saganandroid4175 6 ай бұрын
16:00 You don't need to power off! Just hit RunStop/RESTORE and that should work.
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Hi, not with machine code (assembly code). That only works with BASIC code. But I've implemented that option later in the video. Thank You for watching :)
@saganandroid4175
@saganandroid4175 6 ай бұрын
@@JosipRetroBits that's weird because l remember RunStop/Restore working for ML unless it was specifically disabled. Hold down RunStop while you sharply tap RESTORE several times. I know the C64 needs a rapid transition on the restore key- usually several. Why, l don't know. But slow wrists were less successful. I suppose this could be a Mandela memory Effect since l haven't tried this is decades. But l could swear this triggered an interrupt that sends you back to the ready prompt. Try it and let me know.
@HelloKittyFanMan
@HelloKittyFanMan 6 ай бұрын
@@saganandroid4175: Yeah, that's what I remember as well. I wonder why he never bothered to try it. I have just set my 128/64 back up and I have just re-encountered ones that have _disabled_ the restore key for exiting; and in fact, they restart the programs instead; and you can even soft-reset from 64 back into 128, run something there, and then soft-reset or go64 back into 64 and that program immediately restarts! BUT... if I remember right, it had to be specifically programmed to do that; otherwise what you were saying would indeed happen. I'll have to go through my disks and make a count list of some sort to see if we're right: which is the exception or the rule. And yeah, on an original 64 you do have to hit "restore" fairly hard. I don't know about the C, but on the 128 in either mode you don't. Why don't you set your 64 back up now too?
@saganandroid4175
@saganandroid4175 6 ай бұрын
@@JosipRetroBits try it. Run your ML code. Hold down RunStop and nothing happens. Now while holding that key down, sharply smack the Restore key several times. That should generate a NMI. But on most C64s you need a quick sharp wrist action on the Restore key because only the trailing edge of that line is useful. Try it and report back.
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
@@saganandroid4175 Aaaa ok, got it! Thanks :)
@wolfman946
@wolfman946 6 ай бұрын
Interesante información sobre Commodore 64
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Thank You very much :) I really enjoy exploring C64 routines and I hope this video is interesting to watch :) Cheers!
@m0nde
@m0nde 6 ай бұрын
very well explained
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Thank You and thanks for watching :)
@Jemacaza
@Jemacaza 6 ай бұрын
Very nice video.
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Thank You very much and thank You for watching :) Cheers!
@Jemacaza
@Jemacaza 6 ай бұрын
@@JosipRetroBits if I just knew this back in the eighties.. those kernel routines are very useful. Back then it was really hard to get this kind of info and explanations. I only changed colors and did some sprites as an teenager in assembly. Could you even imagine what an impact it had if everybody had an assembler and this kind of kernel-routine info back then ..
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
@@Jemacaza Yes for sure. For comparison, the first time I used C64 was retyping some game from the magazine. I didn't understand anything :) Now it's so much easier to get information and to learn new stuff. And of course, You can develop and test your code on the modern PC before you run it on the real C64 and this much faster and easier way to do this. :)
@JayH_Norway
@JayH_Norway 6 ай бұрын
Really interesting stuff! One thing though: At 45:02 ... What is the reason for EOR $d012 and not simply LDA $d012 ? Am i missing something vital here?
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Thank You :) EOR to get more random values in A. Whatever is in A we EOR with D012 and that will give more random numbers than just loading D012 :)
@JayH_Norway
@JayH_Norway 6 ай бұрын
@@JosipRetroBits But the accumulator will always have the same value (255 / $ff) on each iteration due to your JSR to $FFE1, so I cannot see how that would increase randomness. Try adding STA $d020 in line 22 and you will see what I mean.
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Ok will try. I never checked value in A when returning from $FFE1, but yes You are probably right :) Thank You!
@saganandroid4175
@saganandroid4175 6 ай бұрын
21:12 there is a bad edit about PAL jiffy timing. Can't tell if you are saying is same 60Hz for PAL or 50Hz. I would read the text description onscreen but your PIP narration window blocks it.
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
It is the same on PAL and NTSC machines, 1/60th of a second. (60 times per second) Sorry, maybe I didn't explain that very well in the video :) Thank You for watching, Cheers!
@CDP1861
@CDP1861 6 ай бұрын
My first computer had a hex keypad and allowed to enter machine code directly. No assembler needed. A rough start, but after that you are afraid of nothing anymore 🙂
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Ha ha, that is awesome :) Oh, those are the first kit comp.? with just a numeric keyboard? Programming in machine code directly, You have my respect, Sir. :)
@CDP1861
@CDP1861 6 ай бұрын
@@JosipRetroBits Yes, it's a kit from the time when you could not buy a computer in stores yet. A Netronics Elf II. I still used ut until I bought a Atari ST and still have it. You should take a look at the processor (a CDP1802) if you are really interested in 8 bit computers. Not exactly mainstream, more like RISC before that was officially invented.
@HelloKittyFanMan
@HelloKittyFanMan 6 ай бұрын
You have to turn off the computer just to get out of that 4096 loop? Why won't the stop/restore key combo work, even though I've seen it stop plenty of ML programs before, without your having to look for a press of "stop" or "stop/restore"?
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Run/Stop key will not stop ML execution only execution of BASIC code. That is why I needed to implement STOP key detection to exit the program in my examples. Thank You for watching :) Cheers!
@hai.1820
@hai.1820 6 ай бұрын
I hope we had youtube back then ^^
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Yes, it is so much easier to find and share information these days :) Thank You for watching ;) Cheers!
@HelloKittyFanMan
@HelloKittyFanMan 6 ай бұрын
We didn't, so I've dashed your hope. Sorry.
@CityXen
@CityXen 6 ай бұрын
C64 4EVA!
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
4EVA & EVA :) Thank You for watching :) Cheers!
@HelloKittyFanMan
@HelloKittyFanMan 6 ай бұрын
JCR? What's that, especially when you typed "JSR" while saying it?
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
I did pronounce that incorrectly, sorry about that. JSR is "Jump to Subroutine", or "Jump to Routine". Cheers!
@nagyandras8857
@nagyandras8857 6 ай бұрын
why not jump to 20 ?
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Well, those numbers are part of a BASIC code. I used Mikro Assembler cartridge so that I could write on C64 and compile and run the assembly code on C64. But, You don't need those numbers if you use some other assembly compiler. You can compile the code on a modern PC and then just run it on C64. For assembly language the labels are important. ...and those labels are converted to memory addresses during the compile process.
@nagyandras8857
@nagyandras8857 6 ай бұрын
​@@JosipRetroBits I mean you had 10 loop lda $d020 20 adc #01 30 sta $d020 40 jmp loop Why not 20 loop adc #01 ?
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
@@nagyandras8857 Yes this is where I want to explain how lda and sta instructions work. This is not a good code :) A more efficient way would be to have a loop label on line 20, yes! But also, we have direct instruction if we want to increment by one, just direct "inc $d020". If we want a different increment value then we can use Your suggestion, Yes. Sorry, I didn't get what are you asking the first time :)
@ciclope8286
@ciclope8286 2 ай бұрын
Sorry but Kernal is to slow for our Demos, Intros aso
@JosipRetroBits
@JosipRetroBits Ай бұрын
Well Yes, using Kernal routines is still quite slow, but it is a fun way to explore Commodore 64 in asm :) Sorry for my late response Thank you and Merry Christmas!
@ehudgavron1
@ehudgavron1 6 ай бұрын
What's a kernal? Do tell.
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
KERNAL is Operating System on Commodore 64. Cheers!
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
@@Joel-qz6sd Yes, a bit more than that. but in general Yes. Kernal is simply an operating system on Commodore 64. It also takes care of all other operations on the system, like cursor, serial communication, time, etc.
@ehudgavron1
@ehudgavron1 6 ай бұрын
@@Joel-qz6sd No, really, there's no such thing as a kernal. Perhaps you're trying to explain "kernel."
@saganandroid4175
@saganandroid4175 6 ай бұрын
Always, ALWAYS show what the program does first, THEN the source.
@JosipRetroBits
@JosipRetroBits Ай бұрын
Ok, thank You for Your advice. To be honest I don't remember how I did it in this video :) Thank You for watching and sorry for my late response. Have a Merry Christmas!
@WillemSandfort
@WillemSandfort 5 ай бұрын
The right spelling is: Kernel
@JosipRetroBits
@JosipRetroBits Ай бұрын
Nope, it's Kernal on Commodore 64 :) Thank You for watching and sorry for my late response. Have a Merry Christmas!
@WillemSandfort
@WillemSandfort Ай бұрын
@@JosipRetroBits You're right.
@SpeccyMan
@SpeccyMan 6 ай бұрын
KERNEL, no A!
@JosipRetroBits
@JosipRetroBits 6 ай бұрын
Sorry. It's KERNAL :) Thank You for watching :)
@JayH_Norway
@JayH_Norway 6 ай бұрын
I suggest that you check your facts before offering such bombastic corrections. On the C64 it is and always has been spelled KERNAL. en.wikipedia.org/wiki/KERNAL
FOR BASIC TO ONE-LINERS - Book Review
16:52
Josip Retro Bits
Рет қаралды 858
How Does Epyx Fastload Make Loading Faster on a Commodore 64?
29:16
Commodore History
Рет қаралды 37 М.
ССЫЛКА НА ИГРУ В КОММЕНТАХ #shorts
0:36
Паша Осадчий
Рет қаралды 8 МЛН
I Sent a Subscriber to Disneyland
0:27
MrBeast
Рет қаралды 104 МЛН
요즘유행 찍는법
0:34
오마이비키 OMV
Рет қаралды 12 МЛН
Plasma Effect in BASIC on Commodore64
27:10
Josip Retro Bits
Рет қаралды 3,5 М.
A C64 Sprite Multiplexer - in BASIC!?
44:24
8-Bit Show And Tell
Рет қаралды 15 М.
Color Bars Effect in C64 BASIC
20:47
Josip Retro Bits
Рет қаралды 1,3 М.
Coding a plasma effect demo on the Commodore 64 (tutorial DIY)
12:30
Commodore 64 & 6510 retro-programming
Рет қаралды 3,6 М.
The Z80 CPU - 1976 to 2024
18:49
Al's Geek Lab
Рет қаралды 178 М.
RNG on the NES
9:48
NesHacker
Рет қаралды 127 М.
C64 - Hiding machine language in a REM statement
10:07
Retro Old Guy
Рет қаралды 16 М.
It's Official: The Real New COMMODORE® 64x is Finally Here!
39:28
Retro Recipes 🕹️ vintage tech + tv
Рет қаралды 820 М.
The PicoMEM is an amazing software defined ISA card
51:22
Adrian's Digital Basement
Рет қаралды 113 М.
Learn to program C on your Commodore 64 (C64) with Abacus Super-C.
49:38
My Developer Thoughts
Рет қаралды 19 М.