Always a good day when Robin breaks out the assembler :D
@AnnatarTheMaia3 жыл бұрын
Always.
@cybermodo Жыл бұрын
I keep in mind this SYS parameters thing for decades, it was actually published in some computer magazine article back in the 80's. And I keep returning to it when I roll some C64 ideas in my head. However, I always think about the next step - and that would be easing these things for existing basic v2 COMPILERS! But unfortunately I believe this elegant trick won't cut it for a compiled code. So it might be better to stick to some workarounds, poking parameters to some dedicated set of memory locations (doing so before SYS command), and have machine routines pick them from there, or write back into them. Basic V2 really miss PTR function - providing working with pointers to variables. That thing is powerful, and even more so if compiler supports it properly. Providing access to variables from machine code, both in interpreting or compiled code.
@mikeloewen6123 ай бұрын
You know what? I know how to do just about everything you can, Robin, yet I find myself constantly watching your content. Must be a very reasonable explanation for this.
@G.B...3 жыл бұрын
Very educative. I never thought of using SYS for that purpose. Normally I used to extend Basic with my own commands (the easiest and fastest way is by adding a special character in the beginning of all new commands, like "!"), then each new command had its own code to read command parameter, if any. In the end, I could type, e.g., !PLOT X,Y,C. This video actually shows a faster way to extend Basic , and without even making it harder to read, e.g. PLOT=828, then SYS PLOT,X,Y,C.
@talideon3 жыл бұрын
Oh, this explains a lot! I spent years (actually technically decades) thinking SYS only took a single 8-bit number. I can't recall it being used with anything else that I pulled apart when I was tearing apart type-ins.
@alexandermaasland34943 жыл бұрын
Thanks for the explanation Robin!, I am feeling an itch to do something with my breadbin once more :)
@sammy611873 жыл бұрын
Watched your podcast so glad to put a face to the voice not what i was expecting honestly thought you were a middle aged dude but your a beastly bearded legend!!!
@BitcoinmeetupsOrg1233 жыл бұрын
The initial shock when anyone sees the face behind the voice for the first time : )
@MS-ho9wq3 жыл бұрын
Hey Robin, you're my favorite C64 KZbinr, I love you, man, keep it up always
@StevenWalter3 жыл бұрын
You can shave off a few cycles if you replace "dec len+1" with "dex" after "decrement length remaining." You already loaded len+1 into X before the loop. I believe that will save 4 cycles per page of memory.
@TheXJ122 жыл бұрын
and the "ldy #0" could be done after the "beq remain" test
@GrowlyBear9173 жыл бұрын
I think the C128 had a native routine that allowed SYS to have parameters. Could you explain the 128's routine, and is it similar to what is happening in this example of code?
@wayneandrews173811 ай бұрын
This opens up new possibilities Robin. Great use of the sys command. Copying ram to a different location is one possibility. Now, if I could do a bsave on the C64 like the 128 has, to save memory to disk would be great. Something like: sys 828,"screen dump",8,1024,2023 to disk would be useful.
@theannoyedmrfloyd39983 жыл бұрын
Atari BASIC also has a way to call machine language from inside a BASIC program. The address of the string can be inside the call itself or stored somewhere in RAM like Page 6. It looks like this: X=USR(1536, 100, 20, 3000, PLR1, MEMTOP-10) Well, it can look like that when passing parameters. There can be up to 255! And generally the value returned doesn't matter, but I used it in my Push It! conversion of Sokoban when it counted the number of boxes in the final position. USR is very handy.
@8_Bit3 жыл бұрын
Looks very useful. Commodore BASIC has USR() as well, but only accepts one parameter (though maybe it can be extended in the same way as SYS) and annoyingly needs a couple POKEs to point the USR function to the 16-bit address of the machine language routine. If you want to call a different machine language routine with USR, you need to POKE a new address again. So USR() usually gets ignored in favour of SYS on Commodore machines.
@christiancarassai95403 жыл бұрын
Today, 99% of people with 12gb ram and i9, do a lot less things than you with a C64!!! Always amazing
@klif_n Жыл бұрын
This is just awesome. I recently installed the VICE emulator and started playing around with C64 programming. Back in my college days I had an Apple II+ and of course was looking for all that graphics stuff in the C64. It's a might more complicated, but it's all just for fun so that's ok. I was a bit of an Apple snob at the time (since I had one), but I'm realizing that I sort of missed out on a whole world of fun with the C64. Keep an open mind :). Anyway, I was messing with the bit mapped mode and was thinking about writing a screen clear function... and wouldn't you know.. there it is all nicely written up for me to learn from. Thank you so much for all the wonderful C64 videos. You are making me a believer.
@merman19743 жыл бұрын
Enjoyed that, geeky but well explained. It made sense of a few things I have used other the years, including Mr. Mouse from Loadstar (which relied on SYS calls from BASIC).
@Shmbler3 жыл бұрын
Thats a very neat way to do it. Looks like Sid Meier didn't know about it, too ;-) The memcpy/memset routines in Pirates! 64ksupport.prg get their args from POKEs to cassette/serial bus registers at $A3+. That also applies to all machine language routines for the "window handling" in this game. It is basically always a combo of POKEs with a bare SYS... there.
@FadkinsDiet10 ай бұрын
SYS does load some memory locations into the a, x, and y registers-- is that what's happening?
@quantass3 жыл бұрын
ASK ROBIN ~ I recommend an episode on a C64 "cracking group"-like Intro coding session. When growing up I would see your typical ☠ Cracktro ☠: x smooth scrolling text -- usually running along a wave-like path x text gradually fading in and out x an animating shiny glimmer at random spots on the text during the scrolling ?? Could you show us how this is coded in Assembly, and as a challenge, how close you can get using only C= BASIC ??
@BitcoinmeetupsOrg1233 жыл бұрын
I second this. This is what I would have wanted to know when I was 10 years old.
@thadoctorreturns299910 ай бұрын
Alot of BBS software uses parameter-passing to the ML components. That was one thing I always struggled with while modding.
@DenizTurkmen3 жыл бұрын
I had 2 tape turbos that can be called by SYS708
@radman9993 жыл бұрын
Didn't know you had a podcast! I subscribed. 😀
@Barldon3 жыл бұрын
On the topic of assemblers, I would love to see a video on how to go about, and the logic behind, loading an assembly program from basic (to allow the user to run it without knowing the memory address). I assume you have used this technique in your previous games? If not, what would the alternative be?
@8_Bit3 жыл бұрын
Hi! Do you mean you'd like to determine the correct address to SYS when loading a program? In most (but not all) programs that's the same as the load address, which I show how to figure out a few different ways in this video: kzbin.info/www/bejne/mGTNZp5np9Gbpdk (if you don't want to watch the whole thing, look at the index for the sections starting with "Finding...". For BASIC code that calculates the load address, check out the "LOAD ADDRESS" program on the Model 1541 Test/Demo Diskette which I mention (but don't examine) at 23:31 in that video.
@Centar19643 жыл бұрын
You should try this in Abacus Fortran...it is what BASIC was based on...you can add your own intrinsic or external functions and libraries to it easy (in Fortran) and it compiles to M/L code...it has the EXEC function (same as SYS but passes register values with it) and commands for PEEK and POKE (MEM)...I'd like to get or write libraries for graphics, sound, and disk functions. Oh and gives 50k space for programs. Have sorta started on such...
@AndyHewco3 жыл бұрын
Great video Robin.
@poorman-trending3 жыл бұрын
Can you do a deep dive into using the SS Pro v5?
@huntabadday26633 жыл бұрын
You should make a video on opening files and accessing devices in assembly
@superx96193 жыл бұрын
I'd like too see more Growing up 80s material of reviewing and playing games.
@VulpisFoxfire3 жыл бұрын
So the next step from this is to instead of wedging this into the routine that processes the SYS command, create your own custom tokens so you can have things like a 'FILL' command?
@GeoffSeeley3 жыл бұрын
Quack quack!
@chromosundrift3 жыл бұрын
So skipcomma etc. read and update a pointer to the current token of the basic execution?
@diegochazan11253 жыл бұрын
Hi, a while ago you made a video about IRQ-Driver SID Playback using Machine Language ... I have been experimenting with this but I haven't been able to fade out the sid volumen, even though it has a volume control that theoretically goes from 0 to 15. But I have seen in many demos that they fade out the sound and I was wondering how they did it. cheers
@8_Bit3 жыл бұрын
Yes, it should be possible by gradually going from 15 to 0 in the volume register ($D418). It's possible the music player updates $D418 every time it's called, which would likely prevent the fading from working. I'd suggest right after you make the call to the music player, then update the volume register right afterwards.
@AnnatarTheMaia3 жыл бұрын
Still no version of Turbo Macro Pro running from ROM, then? Is that even being worked on by Style?
@dannyepstein Жыл бұрын
I think you could use "BIT len+1" rather than "LDX len+1" since you're only trying to set the Z status bit. This wouldn't make it any faster, but it'd be a bit clearer.
@standupmackan3 жыл бұрын
Really cool! Thank you!
@BitcoinmeetupsOrg1233 жыл бұрын
Front end programmers: -He's a wizard.
@JohnDoe-tn3tx3 жыл бұрын
I wish i had KZbin back in 1990 lol...
@D3cker13 жыл бұрын
Drones .. .DEACTIVATED.
@PaulHockerOnEarth3 жыл бұрын
Great vid.
@michaelbarry80053 жыл бұрын
I apologize to Robin (and anyone else who might have briefly seen it) for a comment I just deleted that addressed a non-existent "bug". It's way past my bedtime ...
@rev.davemoorman38833 жыл бұрын
Now add a Jump table, and you have a real tool box!
@BojarskyLeGrand3 жыл бұрын
Is it possible to use only zeros and ones to code something? Did someone try to write a code using only zeros and ones?
@8_Bit3 жыл бұрын
It's not really possible on the C64 to only use zeros and ones unless someone deliberately wrote a program (maybe on a cartridge) to deliberately "downgrade" the C64 that much. But on earlier computers, like the Altair 8800, those were literally programmed with zeros and ones unless you paid a lot of money for upgrades like a keyboard!