Author Topic: Commodore C64 - 1982  (Read 2406 times)

0 Members and 1 Guest are viewing this topic.

Offline Homer J SimpsonTopic starter

  • Super Contributor
  • ***
  • Posts: 1224
  • Country: us
Commodore C64 - 1982
« on: June 19, 2018, 06:22:42 am »


 
The following users thanked this post: ChunkyPastaSauce

Offline GlennSprigg

  • Super Contributor
  • ***
  • Posts: 1259
  • Country: au
  • Medically retired Tech. Old School / re-learning !
Re: Commodore C64 - 1982
« Reply #1 on: June 21, 2018, 01:28:34 pm »
195 views, but 0 replies/comments !!!!
I thought it was great when it came out !!!!!!!!   As a tech-head, I fully embraced it for what
it was, pre- 'PC's.....   YES it played 'games', but I immediately looked into & developed some
software for small businesses with it!!!  Mainly in the realm of 'Databases', using "Superbase".
I wrote software & macros for  neat graphical interfaces for all that !!!!!  (Was all we had!).
(Interestingly more powerful than the initial spacecraft computers on 1st moon missions!).

I designed Cartridge Interfaces, wrote headers/boot-loaders, and custom 1541 drive software.
Then the 'World' collapsed !!! hahaha....  'PC's came along !!!!!!!!....   ok.....
Re-write software using 'Ashton-Tate's "D-Base", and new graphical interfaces !!!  (Fun times).
It's all MOOT today :-), but the again..... it was SIMPLE then !!!!!!!!!!!!

These days, using 'modern' packages, 'one' creates numerous megabytes of 'coding', for the
most simplest of things.... that used to be done in '2k', or '10k'......................
Diagonal of 1x1 square = Root-2. Ok.
Diagonal of 1x1x1 cube = Root-3 !!!  Beautiful !!
 

Offline BillB

  • Supporter
  • ****
  • Posts: 615
  • Country: us
Re: Commodore C64 - 1982
« Reply #2 on: June 21, 2018, 03:19:47 pm »
I have fond memories of the C64.  :)  The early pre/PC days were a great time to be a computer tinkerer.
 

Offline GlennSprigg

  • Super Contributor
  • ***
  • Posts: 1259
  • Country: au
  • Medically retired Tech. Old School / re-learning !
Re: Commodore C64 - 1982
« Reply #3 on: June 23, 2018, 02:41:37 pm »
I have fond memories of the C64.  :)  The early pre/PC days were a great time to be a computer tinkerer.

Yea mate...  It's what we "Cut or teeth on" in the 'computing' field !
A new 'whipper-snapper' these days starts at Uni, learning 'C++' of what ever :-)
(And of course 'HTML5'/Javascript/CSS)...
But do they know about 'Machine-Code' !!!!!!!  hahaha.....
        LD R1, xOOF         ; load address of data
        AND R4, R4, #0      ; set even-counter to 0
        AND R5, R5, #0      ; set odd-counter to 0
        ;
        ; begin loop to process numbers
        ;
x3003   LDR R2, R1, #0      ; load next number
        BRz xOOC            ; branch to end if zero
        ;
        ; check for even or odd
        ;
        AND R3, R2, #1      ; use mask to check bit-0
        BRz xOO9            ; branch if even
        ADD R5, R5, #1      ; increment odd-count
        BRnzp xOOA          ; branch to get next number
x3009   ADD R4, R4, #1      ; increment even-count
        ;
        ; get next number

        ;

Not to mention for which 'Processor'.....
It was Fun, (though sometimes complex), but 'Tight' !!!
Diagonal of 1x1 square = Root-2. Ok.
Diagonal of 1x1x1 cube = Root-3 !!!  Beautiful !!
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21658
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Commodore C64 - 1982
« Reply #4 on: June 23, 2018, 04:37:29 pm »
Yea mate...  It's what we "Cut or teeth on" in the 'computing' field !
A new 'whipper-snapper' these days starts at Uni, learning 'C++' of what ever :-)
(And of course 'HTML5'/Javascript/CSS)...
But do they know about 'Machine-Code' !!!!!!!  hahaha.....

Hardly forgotten -- there's a thing called WebAssembly now.  You load a Uint8Array with various specific bytes, then execute it in a virtual machine (which, I don't know what instruction sets are available, or if it's specific to x86).  What's old is now new again! ;D

C and friends are rather useful shortcuts.  There are so many things you encounter in assembler that are pure tedium, that you don't need to be wasting your time writing.  Especially on RISC instruction sets.  Far better to have the compiler do it for you.  Learn the inner workings of C -- inspect the assembler output it generates! -- and treat the compiler as an assembler generator.

This is a valuable perspective in VHDL too, though there the instantiation is more direct: you're describing gates, latches, state machines and so on.  The key is you're doing it far quicker than you could write a schematic, and you're doing it at scale, and optionally with parameterization, too!

Which is not to say, abuse the compiler to generate whatever assembly you think you want.  Respect its semantics.  Don't force it to do something special-case and fragile; talk nicely to it, work within its semantics to generate code that is both robust and efficient.

I was just telling someone about the inner workings of object-oriented programming (OOP) -- if you're having trouble working with the abstraction, then consider a concrete example.

I don't know if all OOP languages follow this design, internally.  After all, it shouldn't matter, and doesn't -- that's the point of the abstraction, not needing to know!  But at the very least, this is still one possible implementation of it, and where a concrete example is needed, it's perfectly fine!

Anyway: what is an "object"?

An object is a structure, a block of memory organized as a set of parameters, given special (object-specific) meaning.  In C, a struct.

The special thing about an "object" is the struct contains function pointers, to functions that operate on the object.

So, an OOP implementation in C would add function pointers to the struct, which are initialized to whatever functions operate on that struct.  (The initialization is called "construction".)

When you say "object.doStuff()", you're actually calling "object.doStuff(&object);" -- the object itself is passed in, implicitly, as a parameter to the function.  In the function, the object appears as the variable: "this".

When every object of that type is constructed, the same functions are bound to it.  So the functions are all the same, across objects.  Same code, residing at the same address, but able to serve any object of that type, anywhere in memory.

This is very apparent once you study C++ -- there, the whole process is explicit, all exposed for you.  Most of the time, you don't want to touch that, you want to stick with the default behavior and harness the simple, powerful syntax of OOP.  But the option is there, for the expert programmer, to control all of these internals.  It is likewise their responsibility to make sure references don't get screwed up in the process!

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online ebastler

  • Super Contributor
  • ***
  • Posts: 6422
  • Country: de
Re: Commodore C64 - 1982
« Reply #5 on: June 23, 2018, 05:29:03 pm »
        AND R3, R2, #1      ; use mask to check bit-0
        BRz xOO9               ; branch if even
        ADD R5, R5, #1      ; increment odd-count
        BRnzp xOOA           ; branch to get next number

Not to mention for which 'Processor'.....

Hmm, why would one learn assembly language for an "educational" non-existing processor, rather than a real one? I had not come across the LC-3 before -- I'm curious, where did you encounter it?
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21658
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Commodore C64 - 1982
« Reply #6 on: June 23, 2018, 06:25:33 pm »
Hmm, why would one learn assembly language for an "educational" non-existing processor, rather than a real one? I had not come across the LC-3 before -- I'm curious, where did you encounter it?

These come to mind:
https://store.steampowered.com/bundle/2000/The_Hacking_Bundle/

I've heard of TIS-100 before, it's a VM like that I think.  Hack'n'Slash is well drawn with a nice story, though it's not based on VMs, but Lua instead.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline chris_leyson

  • Super Contributor
  • ***
  • Posts: 1541
  • Country: wales
Re: Commodore C64 - 1982
« Reply #7 on: June 24, 2018, 03:02:02 am »
Quote
Yea mate...  It's what we "Cut or teeth on" in the 'computing' field !
Cool  :-+ I was an Atari guy, had an Atari 800. Cloned the 810 disk drive but used a surplus 80 track 8" disk drive because they were cheaper than the newer 4.5" drives. I even found a local stationary store that sold boxes of 8" disks single sided disks, punch a hole in the disk "wallet" and now you've got twice the storage !! Can't remember which WD controller it used but it was well "tweekable" and I managed a few Mbytes storage on a single disk, it was way better than cassette tape. Atari published the compltete assembler software listings for their computers and peripherals, I had the Atari 800 operating system printed on fanfold paper in two cardboard boxes !!
Never owned a C64 but I remember fixing them and having to replace the video chips, they ran really hot, I don't think the springy heatsink thing worked too well, not enough contact area.
 

Offline GlennSprigg

  • Super Contributor
  • ***
  • Posts: 1259
  • Country: au
  • Medically retired Tech. Old School / re-learning !
Re: Commodore C64 - 1982
« Reply #8 on: June 25, 2018, 12:04:31 pm »
        AND R3, R2, #1      ; use mask to check bit-0
        BRz xOO9               ; branch if even
        ADD R5, R5, #1      ; increment odd-count
        BRnzp xOOA           ; branch to get next number

Not to mention for which 'Processor'.....

Hmm, why would one learn assembly language for an "educational" non-existing processor, rather than a real one? I had not come across the LC-3 before -- I'm curious, where did you encounter it?

I'm sorry mate....  the 'sample' coding depicted was a 5-sec 'grab' of something 'Mc' like, to
demonstrate the 'difference' between that, and modern coding methods/looks.......
It was NOT meant to represent ANYTHING 'specific', such as a Commodore-64 '6510' microprocessor,
or for in around the days, a 'Z80' microprocessor....  It wasn't an 'example' to depict/explain anything.

In those days, primitive & "Educational" was all we had to use ! but we took it beyond the original 'toy'.
Diagonal of 1x1 square = Root-2. Ok.
Diagonal of 1x1x1 cube = Root-3 !!!  Beautiful !!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf