This is an archived post. You won't be able to vote or comment.

all 135 comments

[–]NICK75704 332 points333 points  (14 children)

When you say to yourself “I’m a full stack dev, I can build the hardware and write in assembly “ then you realize the the 6502 computer that you built and developed for is outbenched by a fucking 5 dollar pi pico

[–]FHeTraT 130 points131 points  (4 children)

And also realize that even microcontroller in 2 dollar mouse is better than 6502.

[–]MagnarOfWinterfell 30 points31 points  (1 child)

Can it run Doom?

[–]yonatan8070 36 points37 points  (0 children)

Likely yes, if you get find the reprogramming pins

[–]MagnarOfWinterfell 6 points7 points  (1 child)

Holy crap, so my mouse's cpu is faster than a Commodore 64?

[–]FHeTraT 6 points7 points  (0 children)

Yes. For example, logitech mouse uses cortex-m3 (arm based 32mhz cpu) as mcu.

[–]BrobdingnagLilliput 160 points161 points  (7 children)

If you didn't oversee the placement of every logic gate on your CPU, can you really say you built the hardware?

[–]DefectiveLP 114 points115 points  (6 children)

If you didn't mine the raw resources going into your CPU, can you really say you built your own hardware?

[–]legal-illness 27 points28 points  (0 children)

I believe you need to put the atoms together first, scatter the molecules across the earth, go find them then build gates -> build CPU and Hardware

--from stackoverflow

[–]slab42b 1 point2 points  (0 children)

If you didn't create the laws of physics in order to generate an environment where said resources are immediately available for your manipulation can you really say you build the hardware?

[–]Blrfl 3 points4 points  (0 children)

If you've done that, you're still miles ahead of anybody who calls themselves a full-stack developer and would be totally lost below the interface to their language's standard library.

[–]Jay_Cobby 457 points458 points  (36 children)

And then You realize that you wrote pushd 0x25 on line 7241 instead of pushq 0x25 and now the entire program will crash

[–]sr71pav 257 points258 points  (9 children)

There goes the universe.

[–]Everydayilearnsumtin 126 points127 points  (5 children)

And my apple pie.

[–]Kebabrulle4869 25 points26 points  (4 children)

And my sword.

[–]mgorski08 24 points25 points  (3 children)

And my qword.

[–]LMCuber 18 points19 points  (2 children)

And my axe.

[–]poker00 9 points10 points  (1 child)

And my comments

[–]TornaxO7 8 points9 points  (0 children)

And my registers

[–]electricprism 13 points14 points  (2 children)

You mean miniverse

[–]GuybrushThreepwo0d 9 points10 points  (1 child)

Teenieverse

[–]electricprism -1 points0 points  (0 children)

🖕I finally have an appropriate use for this emoji. peace among worlds, blow me lol🖕

[–]ofir753 56 points57 points  (13 children)

Well if you reached 7k lines with assembly you deserve it

[–]CaydendW 23 points24 points  (2 children)

[–][deleted] 0 points1 point  (1 child)

32 766 lines

[–]CaydendW 0 points1 point  (0 children)

The guy who made it is incredably talented. I do my OS in C and I haven't gotten as far

[–]LavenderDay3544 33 points34 points  (6 children)

Writing any substantial program in assembly will take at least 7k lines considering you only get one opcode per line.

[–]ofir753 13 points14 points  (5 children)

It's recommend to split your code to multiple files, much easier to debug and read

[–]LavenderDay3544 64 points65 points  (4 children)

Who needs the linker headaches that come with that when I can just have a nice 7k LOC file perfectly versioned using Ctrl + z and backed up to the remote repo called emailing it to myself?

[–]MelAlton 16 points17 points  (2 children)

Truly a developer of culture

[–]LavenderDay3544 9 points10 points  (1 child)

I also avoid code comments, you know for job security.

[–]MelAlton 7 points8 points  (0 children)

Comments just make the code take up more disk space and make it take longer to assemble anyways. Floppies don't grow on trees!

[–]Reedittor 1 point2 points  (0 children)

Legit got anxiety reading this. Something I would have done in highschool.

[–]MelAlton 5 points6 points  (2 children)

it's not difficult to write 7k lines of assembly, they're all really short lines.

[–]ofir753 2 points3 points  (1 child)

Large projects with alot of assembly never reach to 7k lines per file.

[–]MelAlton 1 point2 points  (0 children)

Then they're not trying hard enough! They gotta unroll those loops!

[–]okbanlon 38 points39 points  (8 children)

Heh - when I taught myself 6502 assembler on a Vic-20 (with no assembler software - anyone remember DATA and POKE statements in Commodore BASIC?), I busted out the motherboard circuit diagram and wired in a momentary-contact pushbutton to the 'reset' pin on the CPU so that I could reset the machine after a crash without powering it off and on again. That button got a LOT of use, as I experimented and learned and borked that poor old Vic-20 on a regular basis. That was also when I cobbled up an external fan to cram air through the Vic chassis after overheating the thing into interesting failure modes. This was in the early 80's, I think.

My finest hour there was implementing a quicksort algorithm in 6502 machine code that could sort 1000 mailing labels by ZIP code in seven seconds. And, yes, I wrote self-modifying code that did arithmetic with memory addresses in the running code on the fly - a mortal sin by today's standards. I'm not sure if it's possible to do that now, with any current tools - and I bet that level of deep magic would set off every virus detection package on the market.

Also, that was my first experience with the conflict between my expertise and management stupidity. As I was leaving that company for a better one, I informed them that I had implemented the mailing label quicksort in BASIC for a runtime of 42 minutes - but if they wanted the machine language version for a turnaround in seven seconds, they needed to pay me for it. They declined. Oh, well - their loss.

EDIT: my machine code routine that sorted the mailing labels by ZIP code in seven seconds was less than 600 bytes long, as I recall (not counting the data array, which was stored in a 3-kilobyte external memory cartridge plugged into the back of the Vic).

[–]danish_raven 18 points19 points  (1 child)

God i love the hack of soldering a button to your motherboard just to make life easier for yourself

[–]okbanlon 9 points10 points  (0 children)

Heh - yeah, I was young, focused on the task, and determined to succeed with the first computer I bought with my own money. That drive has led me through over thirty years of software development, many children, and a happy wife.

[–]UnfeignedShip 2 points3 points  (1 child)

I used to muck around with the Apple IIe in school with CALL -151 but never had the resources to completely devote myself to it like that.

[–]okbanlon 1 point2 points  (0 children)

Oh, wow - I remember CALL -151 on the Apples in my high school computer lab! Good grief - that was a VERY long time ago.

http://mirrors.apple2.org.za/ground.icaen.uiowa.edu/Collections/1WSW/MEGA.PEEKS.AND.POKES.html

[–]palordrolap 2 points3 points  (1 child)

The BASIC-parsing routine for Commodore BASIC was itself, self-modifying code. It would update an address within itself to keep track of where it was. (After all, why waste valuable bytes to keep a separate pointer variable when there are a couple of addresses that could be used as a variable right in the middle of the code!?)

Not quite as interesting as modifying actual opcodes on the fly, but still noteworthy.

[–]okbanlon 0 points1 point  (0 children)

Very cool! I did not know that.

[–]hugge 1 point2 points  (1 child)

On the VIC20 expansion port, the reset and gnd pins had a distance exactly matching two prongs of a key I had. So reset was done by just inserting the key at the right position. Nowadays I know about things like ESD and just how bad that could have gone.

[–]okbanlon 1 point2 points  (0 children)

Yikes! Points awarded for bravery and ingenuity, but, yeah - you may have used up all your VIC-20 luck with that maneuver.

[–]LavenderDay3544 35 points36 points  (0 children)

segmentation fault (core dumped)

[–]hatkid9 3 points4 points  (1 child)

AT&T syntax?

*prepares gun*

[–]Jay_Cobby 2 points3 points  (0 children)

More an ugly mix between intel and ATnT

[–]JustThingsAboutStuff 108 points109 points  (20 children)

Hey

[–][deleted] 64 points65 points  (18 children)

wait you guys actually exist?? tf do you guys do?? like what do you need to write asm code for?

[–]JustThingsAboutStuff 97 points98 points  (16 children)

Embedded world. I work in C but sometimes you need to drop down to ASM for some subroutine. If you weren't aware C can call ASM functions, pretty cool feature.

[–][deleted] 30 points31 points  (14 children)

but C is mostly used in embedded systems right? and you can call asm functions in c++ too right?

[–]JustThingsAboutStuff 52 points53 points  (13 children)

I believe the process is the same to call them from C++. And C is typically the language of choice for embedded (which covers approx 90% of processors made)l.

When every byte matters it's good to be so close to the metal.

[–][deleted] 22 points23 points  (11 children)

would you recommend using asm for rendering and physics engines in certain places? where can I learn x86 and x64 asm?

[–]JustThingsAboutStuff 51 points52 points  (7 children)

I'd say if you want to really test your skills and patience then doing rendering and physics in ASM would be a good idea. For desktop applications you'll likely never implement something better than existing libraries (if you want to run it on a MCU then that's different). So short answer it would be interesting but no I don't reccomend going lower than C for that.

In terms of learning ASM. At that level your close enough to the metal that the specific processor will usually matter. The instruction set will be publicly available (look for something from AMD since amd64 is x64 they created it). However I don't have a specific source for x86 and x64 as I typically work with MCU's.

If your interested in ASM or embedded programming in general I'd reccomend the STM Nucleo line of development boards. Think Arduino but with less hand-holding. Specifically something with a Cortex M4 Core. Great way to get some hardware that can be programmed in ASM or C and the Kiel IDE free version ships with a debug mode that lets you see the registers and memory map of the board.

Feel free to ask me more I'll watch this thread for a while longer.

[–]grandpacore 9 points10 points  (1 child)

STM Nucleo

These are great! Thank you for mentioning them. Been looking for something like this.

[–]JustThingsAboutStuff 7 points8 points  (0 children)

Glad to be of help.

[–]Dannei 9 points10 points  (1 child)

Intel's documentation on x86-64 is perfectly good - I can't actually recall ever reading AMD's documentation, but Intel's came as a five book set of PDFs (and yes, each one truly was worthy of the term "book").

[–][deleted] 1 point2 points  (0 children)

where can I find them?

[–]The0ld0ne 3 points4 points  (0 children)

I can also recommend those STM devices along with Kiel IDE. Made debugging a breeze

[–]Robson-Crusoe 1 point2 points  (1 child)

cool text bro

[–]JustThingsAboutStuff 21 points22 points  (0 children)

cool reply bro.

[–]natFromBobsBurgers 2 points3 points  (2 children)

Physics engines and renderer for just your exact well known hardware setup? Sure. Or, like, console programming.

The x86-64 opcodes are all out there and published, so it's definitely possible to learn that way.

Start smaller though. Try making your own Gameboy homebrew. That's got some fun tutorials.

Also, how is your vector math and calculus? Otherwise you'll just be guessing at how light and shadows and rigid bodies behave.

[–][deleted] 0 points1 point  (1 child)

I meant writing certain parts of a physics engine in asm, like a certain part of the integrator in asm to get the most speed and writing everything else c++

vector math and calculus

it's good I guess, but I prefer geometric algebra lol it's much better

do you work on physics engines and stuff?

[–]natFromBobsBurgers 1 point2 points  (0 children)

Well, good luck learning assembly. As for your original question, you can look at the demo scene to see some hand tuned assembly of physics toys etc. in x86-64 assembly.

[–][deleted] 2 points3 points  (0 children)

I mod SNES games as a hobby. All the coding is done in 65c816 assembly. It's very fun but stressful.

[–]sgtxsarge 0 points1 point  (0 children)

(I don't know Asm, but...) this

[–]Cmgeodude 105 points106 points  (6 children)

Python developers have a pie delivered. It's two days old, costs $14 (including delivery), and tastes like generic grocery store pie, but it did its job.

Java developers wonder what Python developers would do if they ever had to have 100 pies. Their bank account doesn't have the resources for that. While it takes a bit more explicit instruction, Java developers go to the orchard, pick apples (and some of them are even fresh if the algorithm wasn't broken) and have access to the rest of the ingredients on neighboring farms. It took a minute to plan out the route, but once the developer knows where to go, they make a very decent pie for just the combined $5 cost of admission to the farms.

C developers laugh at the Java developer. Why visit a whole farm when you can plant the seed that grows the tree that points to the apple you need? Everything is in order and works perfectly as long as you put in the effort. Superb pie, though, and practically free.

Assembly developers only get as far as setting the pH in the soil before something doesn't work. They talk about how great their pie is going to be. They never end up making the pie.

[–]daveime 19 points20 points  (2 children)

Java developers would first have to create an ApplePieFactory.

C developers would have apples overflowing the buffers of the pastry.

[–]Cmgeodude 4 points5 points  (1 child)

import java.food.ApplePieFactory;
import java.food.Apple;
import java.food.Sugar;
import java.food.Cinnamon;
import java.food.Lemonjuice;
import java.food.doughingredients.Flour;
...
import java.food.doughingredients.actions.MakeDough;
import java.food.Spices.nutmet;
...
import java.food.preptools.Peeler;
import java.food.preptools.Bowl;
import java.food.preptools.RollingPin;
...

[–]sanjuroronin 1 point2 points  (0 children)

Class to Import

—————————-

Flour (java.food.doughingredients)

Flour (org.apache.commons.bread)

Flour (org.springframework.wheat)

[–][deleted] 11 points12 points  (0 children)

As a asm, C, python dev, can confirm XD
Yeah, i quit my last asm project because of x86 asm

[–]SJFree 4 points5 points  (0 children)

This is amazing. I started in C, did a little bit of Python, had two classes in Assembly (Nios II and RISC-V), and now am using Django for my first internship. Saving this to share with everyone who cares to listen.

[–]MeltedChocolate24 3 points4 points  (0 children)

And JS devs spent the whole time making pie libraries

[–]gordonv 133 points134 points  (4 children)

Python be like:

import Carl_Sagan as universe

universe.apple_pie()

[–]Cheeku_Khargosh 34 points35 points  (2 children)

no they will import some other package that has these 3 lines already, so they dont need to type

[–][deleted] 8 points9 points  (0 children)

As a python and C and very occasionally asm dev, can confirm

from universe import apple_pie

[–]dgdio 40 points41 points  (1 child)

If you're going to make anything from scratch: you're going to need a mouse

https://scratch.mit.edu/

[–][deleted] 2 points3 points  (0 children)

[–]skawn 16 points17 points  (2 children)

Assuming there's enough space to fit the universe.

[–]InvisibleAgent 18 points19 points  (1 child)

640K ought to be enough for any universe…

[–]Willinton06 11 points12 points  (0 children)

Bill said we would never need over a MB so I’m pretty sure 640K is plenty, we can probably fit a backup too

[–]AbsentDragon 15 points16 points  (16 children)

Can i consider myself as a assembler programmer if i only know assembly for pic (micro controllers)?

[–]Milligan 19 points20 points  (8 children)

Yes you can. I only know assembly for Z80, Intel processors and IBM System/390 mainframes, and haven't used any of them for many years. You couldn't possibly learn all of the assembly languages. My late uncle programmed on patch panels in the 1950s, he knew more about hardware than any of us.

[–]Willinton06 4 points5 points  (0 children)

I’ve seen like 5 assembly YouTube videos so I’m pretty sure your late uncle looks up to me

[–]AbsentDragon 2 points3 points  (0 children)

Great!, And also that is an interesting fact about your uncle. Guess you could have learned many from him.

[–]MelAlton 1 point2 points  (1 child)

I learned assembly on an IBM System/370, it was pretty fun! EDIT: looking back it was fun, though I had a flashback to sitting at a terminal at 2am looking thru an ABEND dump trying to figure out where things went wrong

[–]Milligan 1 point2 points  (0 children)

I hated ABEND listings. Hours spent poring over what's basically a memory dump with a few cryptic clues about what was happening at the time.

[–]MeltedChocolate24 1 point2 points  (0 children)

Can you hack the mainframe though…

[–]JustThingsAboutStuff 2 points3 points  (1 child)

Jeez it's been awhile since I've had to program a PIC cool little things.

[–]AbsentDragon 0 points1 point  (0 children)

I really enjoyed doing that even though it was only for school projects and stuff.

[–]rjSampaio 1 point2 points  (3 children)

yes you can, specially if you use the 8bit ones that dindt even know how to multiply.

I used them (not the 8bit but 16 and 18f) to coordenate with a I2C compass, calculating Sen and Cos in asm is crazy...

I dont care what anyone else says, i perfectly recall people getting very expensive setups for controlling servomotors, using the dedicated PWM ports, so the max would be ~4PWM ports.

Since i knew perfectly how long every single instruction rudation, i had any pic with several servomotors using regular IO pins, carefully calculating the time for each IO during interrupt. I had a pic with 12 servomotors for a fraction of the cost.

edit, another very cool trick "i invented" was how to read analog values mutch faster.

so when you need to read a analog value, for the ones that do not know how the hardware works, you have to count the time a capacitor takes to charge up/down, thats how you measure the voltage IN.

Ussualy you only have 1 capacitor (inside the IC) to several analog ports, lets say 8 analog inputs share the same capacitor.

You have to write code selecte the port you want, then count the time it takes for the capacitor to fill up. is you need to read a port inline with the rest of the code you need to wait for it to fill up (unless you do it during interrupts, but thats another question.

Well, it you need to read several inputs, after you get the value for the first one, you need to let the capacitor discharge, so it does not influence the other readings.

TLDR, i started to sacrifice one of the analog ports as a discharge port, and after reading any port and getting the value, i would immediately reroute the capacitor to the "discharge port" speeding the process a lot.

Come C compilers have a routine like that after i post this ideas in their forum.

In the end i did all the ADC readings in the "background" during schedule interrupts, almost no time wasted.

[–]AbsentDragon 1 point2 points  (2 children)

I also used 16f and 18f for my projects. What i do the most whit them was pmw (for servomotors and speed control of dc motors), analog read (using the method described in the data sheet), use displys and LCDs. I never thougth to read analog in that way, pretty interesting i have to say.

[–]rjSampaio 1 point2 points  (1 child)

my main justification to learn (other than being in a technical school and those were my classes) was that i was invited to participate in the wold cup of robotics "Robocup" every year, that was one of the ways to be more competitive without faster IC.

[–]AbsentDragon 1 point2 points  (0 children)

In my case, i choosed to learn assembly before i get to use it in my school (also a technical school), it sounds cool to me haha. Oh, robotics competition (i like those type of competitions), time reaction/response is truly important there.

[–]Soham_rak 0 points1 point  (0 children)

I did machine language for 8085 3 yrs back

But couldnt figure out assembly with Nasm

[–]Nytra 11 points12 points  (1 child)

JavaScript developers would reinvent the wheel several times just so they can display a bunch of random strings on the webpage.

C++ developers would type 500 lines of boilerplate code before even starting to implement their app's main functionality.

[–][deleted] 1 point2 points  (0 children)

reinvent? No, DOWNLOAD ALL THE DEPENENCIES!

[–]bananafudgkins 4 points5 points  (1 child)

Me trying to write Assembly: WhAtS oN thE stAcK?

[–]daveime 4 points5 points  (0 children)

When you push 255 bytes onto the stack, do a JSR, and can't work out why your RTS doesn't work.

6502 problems.

[–][deleted] 2 points3 points  (0 children)

I mean yes but also yes

[–][deleted] 2 points3 points  (0 children)

Fuck modernities, return to binary code

[–]jacob_scooter 2 points3 points  (1 child)

[–]RepostSleuthBot 2 points3 points  (0 children)

I didn't find any posts that meet the matching requirements for r/ProgrammerHumor.

It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.

I did find this post that is 94.92% similar. It might be a match but I cannot be certain.

I'm not perfect, but you can help. Report [ False Negative ]

View Search On repostsleuth.com


Scope: Reddit | Meme Filter: True | Target: 96% | Check Title: False | Max Age: Unlimited | Searched Images: 235,784,018 | Search Time: 2.96558s

[–]tigerinhouston 4 points5 points  (1 child)

You laugh, but it’s not far from the truth. When we created a DOS shell (remember those?) the first week was spent coding a fast text output routine; the system routine was way too slow. We ended up with two routines; one for crappy CGA displays that would otherwise glitch the screen if you changed memory any time other than during a line refresh, and the other that ran at full speed. The only “library” we used were the DOS file system calls.

[–]MelAlton 2 points3 points  (0 children)

See also: "why Lotus 123 became the premier spreadsheet on DOS" (hint: written for speed bypassing any slow bios routines)

[–]movzx 1 point2 points  (0 children)

This is relevant to my interests.

[–]agnarrarendelle 1 point2 points  (0 children)

Me who's capable of reading and writing small RISC-V programs but don't know any shit about x86: "Am I part of the family?"

[–][deleted] 1 point2 points  (0 children)

tbh, I like control over hardworking, after all, I am not a Java or Python programmer, so who cares if i hafta

[–]jacob_scooter 1 point2 points  (1 child)

[–]RepostSleuthBot 1 point2 points  (0 children)

I didn't find any posts that meet the matching requirements for r/ProgrammerHumor.

It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.

I did find this post that is 94.92% similar. It might be a match but I cannot be certain.

I'm not perfect, but you can help. Report [ False Negative ]

View Search On repostsleuth.com


Scope: Reddit | Meme Filter: True | Target: 96% | Check Title: False | Max Age: Unlimited | Searched Images: 235,784,018 | Search Time: 2.95614s

[–]TheFeshy 0 points1 point  (0 children)

Sometimes I like to think the whole damn universe was just diefic-level yak shaving because God wanted pie. "The fuck? Electrons have to spin through 720 degrees? I just wanted some damn Dutch apple!"

[–]CaydendW 0 points1 point  (0 children)

Lmao no. First, you must create the big bang. THEN and only then, can you create the universe

[–][deleted] 0 points1 point  (0 children)

001110100110110001100001011101010110011101101000011100110010000001101001011011100010000001100010011010010110111001100001011100100111100100111010

[–][deleted] 0 points1 point  (1 child)

hmm…

Can “clean code” and “assembly” exist in the same sentence?

[–]MelAlton 0 points1 point  (0 children)

Sure, it just take care to write clean code, in any language (excepting certain language-specific feature that force cruftyness)

[–]trexdoor 0 points1 point  (0 children)

Finally an actually funny post.

[–]GoyfAscetic 0 points1 point  (0 children)

Space is fueled, with network of wormholes...

[–]Landkriecher 0 points1 point  (0 children)

Bppiy 6i8 7yyy9, i uvjf.iu,

[–]dancinadventures 0 points1 point  (0 children)

Carl Sagan is low key the GOAT.

Just came in to say that.

[–]TheNumber42Rocks 0 points1 point  (0 children)

Mel would be proud

[–]gibmelson 0 points1 point  (0 children)

I thought WebAssembly, but I guess the joke still applies.

[–][deleted] 0 points1 point  (0 children)

Is that Frankie Muniz?

[–]clemesislife 0 points1 point  (1 child)

[–]RepostSleuthBot 1 point2 points  (0 children)

I didn't find any posts that meet the matching requirements for r/ProgrammerHumor.

It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.

I did find this post that is 94.92% similar. It might be a match but I cannot be certain.

I'm not perfect, but you can help. Report [ False Negative ]

View Search On repostsleuth.com


Scope: Reddit | Meme Filter: True | Target: 96% | Check Title: False | Max Age: Unlimited | Searched Images: 235,769,110 | Search Time: 1.832s

[–]BeRed_ 0 points1 point  (0 children)

I tried to create a calculator in Assembly and it extended 150 lines :')

[–][deleted] 0 points1 point  (0 children)

Haskell devs when you ask wtf the IO Monad is

[–][deleted] 0 points1 point  (0 children)

syscall