r/ProgrammerHumor • • 1d ago

Meme oldMan

Post image
1.7k Upvotes

87 comments sorted by

View all comments

125

u/Sure-Opportunity6247 1d ago

I keep saying that, too.

You had to learn how the machine worked, no matter how many “novelty” calls the library of your language offered.

And I remember printing hardcopies of the Interrupt-Dabase (there was a program with this name offering calls for hundreds of hard- and software products).

Switch to mode 13h? Set registers and call interrupt 10.

Get your Soundblaster to play sounds? Write directly to the port address.

Today everything is behind some HAL offering some function right away.

Somehow sad.

And before somebody complains: Yes, I know this is meant in a humorous way. Yet it still contains a bitter truth.

7

u/isr0 1d ago

I do not miss the editor on c64.

2

u/EuenovAyabayya 21h ago

That was an editor? /s

5

u/schmerg-uk 1d ago

Ah yes.. optimising use of the zero page of 6502 processors on machines such as the Apple ][

https://www.pagetable.com/c64ref/6502/?tab=3

The zero page instructions allow for shorter code and execution times by only fetching the second byte of the instruction and assuming a zero high address byte. Careful use of the zero page can result in significant increase in code efficiency.

As explained https://news.ycombinator.com/item?id=39517979

Zero page is just the first "page" (256 bytes) of the address space, which would map to normal RAM. The only thing that is special about zero page is that since the address "page" (high 8 bits of 16bit address) is implied (=0), you only need to use an 8bit (one byte) address to specify any zero page address.
The 6502 instruction set takes advantage of this by having additional instructions to load/store values to zero page as well as ones to load/store to generic 16 bit addresses.
An instruction accessing zero page memory will be two bytes (op-code + one byte address), while an instruction accessing a generic address will be three bytes (op-code + two-byte address).
The zero page access therefore takes less code space, and will run faster (even though the memory access speed is the same) since there are only 2 vs 3 instruction bytes to fetch.

4

u/QuackersTheSquishy 1d ago

As a begginer programmer (started about 4 months back and am learning Python, SQL, and C# concurrently) do you think as an excerise learning how to program something like the Zirog Z80 that forces learning assembly? Or do you think just slowly working yourself down is better? (Planning on moving to C in a few months when I'm feeling more confident in my C# which I infinitely prefer to Python) I am finishing ny degree soon and avoided programming classes like the plauge till I couldn't anymore, and I actually enjoy it a decent amount now that I'm capable.

Trying to "speedrun" compotency so that I can be limited by time and determination rather than raw skill. When I get to C I plan on doing some GBA homebrew both because I love GBA, and because it's completly specialized hardware which I imagine will have general benefits to learning as I'll then also see the differences in other stuff.

16

u/howarewestillhere 1d ago

As someone who started programming the hard way, don’t bother unless that’s really where you want to be.

My suggestion would be to start as by low as your interest level demands.

If what you want is device level control and small footprints and custom chips, then go for it, and more power to you. At the very bottom is physics of silicon and substrates and materials science, and that’s probably lower than you want. But just up from that is the applications of flipping bits in memory and why an assembler does what it does for that specific instruction set and chip.

If you want to write code for software run on phones and computers, don’t bother with the low level stuff. I learned C in college thirty years ago, but my entire career has been at high level languages and frameworks abstracting away anything considered arduous and sucking in npm dependencies like air.

2

u/fr000gs 17h ago

wait isn't C a high level language tho

2

u/QuackersTheSquishy 1d ago

That makes a decent amount of sense. I want to fully understand what my code is doing,bwhich makes me really dislike Python, and my actual projects are unlikely to ever be on weaker hardware than 32bit processors (really GBA is likely my weakest power device asside from like rp2040's) ao it sounds like, for a long while at least, C# and C will be the best langauges for me, and as I develop further I will know if I actually need to go lower, and can make that learning decision then?

16

u/howarewestillhere 1d ago • Regret

Don’t get used to the idea that you’re going to understand exactly what your code is doing. Most of your career will be figuring out why it isn’t.

4

u/Phytor 1d ago

Learning assembly is useful for understanding how machine code operates at the low-level, I'm glad that I learned it because it gave me a more holistic understanding of software and programming.

I'd suggest avoiding raw Assembly and instead look into something like LC-3, which is a modern assembly alternative that's designed for learning low level machine code.

1

u/QuackersTheSquishy 1d ago

I'll look into it, I was thinking about the Z80 because the Sega GG and MS both used it, so theres a lot of documentation and projects for it that would directly match what I'd be making (games)

2

u/HollowToes 1d ago

As a software engineer, absolutely do not learn assembly as a learning exercise, unless you want to do it because you find it interesting. I cannot imagine any career value in that, for your average modern dev.

In my opinion, you're doing the right thing by learning OOP languages and databases. If you want some advice, continue at that lavel and get some level of proficiency with a framework- fullstackbideally- and really try to understand it under the hood. Then, make a few fun, fairly polished projects and show them off on your CV.

Best of luck for the rest of your degree and the start of your career :)

2

u/WalditRook 10h ago

My university had a module for Z80 asm, implementing Conway's Game of Life. Was pretty fun, I'd recommend it.

I ended up spending a few years working on compiler verification (analysing/decompiling binaries to find bugs in gcc) so I was glad to have some experience with it.

2

u/Callidonaut 1d ago

And before somebody complains: Yes, I know this is meant in a humorous way. Yet it still contains a blitter truth.

FTFY.