There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

abcd ,

IMHO assembly isn’t hard. When you gain enough experience you start to see „visual patterns“ in your code. For example jumping over some lines often equals to a if/else statement or jumping back is often a loop etc. Then you are able to skim code without the necessity to read each line.

The most difficult part is to keep track of the big picture because it is so verbose. Otherwise it’s a handful or two of instructions you use 90+% of the time.

I needed it often in the past in the PLC world but it is dying out slowly. Nonetheless, when I encounter 30+ year old software I’m happy to be able to get along. And your experience transitions to other architectures like changing from one higher language to another.

Nonetheless, if I’m able to choose, I’ll take Go. Please and thank you 😊

hanrahan ,
@hanrahan@slrpnk.net avatar

Not since the 1980s on a Commodore 64.

SYS64738

Presi300 ,
@Presi300@lemmy.world avatar

Nah, I don’t hate myself that much.

geekworking ,

Look at mister fancy pants with and assembler.

How about entering straight opcode, operand with only a hex keypad and two pairs of 7 segment LEDs. You can only see one set of numbers at a time. You had to write it out on paper to be able to keep track and count positions so you don’t use your spot.

I had to do this as a project in school. Two 8088 units that we breadboarded to a UART that we used to drive a fiber optic link to communicate with each other with a basic protocol. All descrete components hand wired and coded.

It made you tie all of skills together into a full system of hardware and software.

nobleshift ,
@nobleshift@lemmy.world avatar

NASM FTW

NauticalNoodle ,

I’ve been studying Arm Aarch32 lately. I have a software development academic background but I have always been interested in Architecture.

darklamer ,
@darklamer@lemmy.dbzer0.com avatar

It’s now been 18 years since the last time an employer paid me to write assembly, but it’s only been a year or so since the last time I had to read assembly at work (in order to verify what the compiler really was doing).

jaybone ,

Assembly used to be a required course for CS undergrads in the 90s. Is that no longer the case?

Also we had to take something called Computer Architecture, which was like an EE class designing circuits with gates and shit.

CanadaPlus ,

Which target did you use? Having to learn even a fraction of modern x86 would be ridiculous, but SPARC or something could be good to know, just to reduce the “magic box” effect.

jaybone ,

This was a long time ago. I’m pretty sure it was 8086.

0x0 ,

I learned MIPS as an undergrad. Pretty neat little RISC architecture.

trolololol ,

I learned mips as graduate. In undergrad had to build with logic gates for things like 2 digit decimal counter and my architecture classes were diagram blocks for a simple CPU. But by that time we knew how to do moderate complexity circuits in VHDL simulation, and we had to make a simple VHDL circuit run for real in FPGA.

LodeMike ,

Its still a thing

czardestructo ,
@czardestructo@lemmy.world avatar

Required course work for electrical engineers in the early 2000s.

trolololol ,

I had to learn assembly but was one topic of many we handled in architecture. Like one question of one exam. That was one of the toughest professors we had, class was about 2001

TunaCowboy ,

Syscalls are sitting right there, and you can always just link libc…

r00ty Admin ,
r00ty avatar

I used to write z80 asm without an assembler back when I was a LOT younger. The ZX spectrum manual I had, had the full instruction list with the byte values.

I think it was oddly easier than some higher level languages for some tasks.

But, making changes was an utter nightmare.

AFKBRBChocolate ,

I had an assembly class in college. I didn’t love of at all. Got my first job after graduating and it was writing space shuttle engine control software, which was in assembly. I was kind of surprised at how fast it became natural after dealing with it full time. Still, it felt luxurious when we upgraded the controller and could do the software in C.

leisesprecher ,

“oh no, I had to do literal rocket science”

leo85811nardo ,

From my understanding, one of the actual use case of assembly is for cyber security engineers to dump assembly instructions from a compiled program, so they can check for any potential vulnerability. I’ve also seen assembly included in an embedded codebase (the overall project is in C), which I assume is for more optimized performance and deterministic behavior

skullgiver ,
@skullgiver@popplesburger.hilciferous.nl avatar

Assembly isn’t that hard. It’s the same imperative programming, but more verbose, more work, and more random names and patterns to remember. If you can understand “x += 3 is the same as x = x + 3”, you can understand how the add instruction works.

I wouldn’t be able to write Rollercoaster Tycoon in assembly because keeping track of all that code in assembly files must be hell, but people pretending like you need to be some kind of wizard to write assembly code are exaggerating.

These days, you won’t be able to beat the compiler even if you wrote your code in assembly, maybe with the exception of bespoke SIMD algorithms. Writing assembly is something only kernel developers and microcontroller developers may need to do in their day to day life.

Reading assembly is still a valuable skill, though, especially if you come anywhere near native code. What you think you wrote and what the CPU is actually trying to do may not be the same, and a small bit of manual debugging work can help you get started resolving crashes that make no sense whatsoever. No need to remember thousands of instructions either, 99% of assembly code is just variations of copying memory, checking equality and jumping anyway. Look up the weird assembly instructions your disassembler spits out, they’re documented very well.

leisesprecher ,

Assembly is hard, because you need to understand your problem on multiple levels and get absolute zero guidance by compilers.

Even C guides you a tiny bit and takes away some of the low level details, so you have more mental capacity to actually solve your problem.

Oh, and you have a standard library. Assembly seems to involve solving everything yourself. No simple function call to truncate a string or turn a char array to uppercase.

gens ,

Missing “;” on line 148.

skullgiver ,
@skullgiver@popplesburger.hilciferous.nl avatar

Unless you’re developing an OS or something, you’ll probably be using the C standard library and maybe a bunch of other libraries provided by most distros. Just because you’re doing assembly doesn’t mean you need to program syscalls manually.

Modern assemblers also come with plenty of macros to prevent common mistakes and provide common methods. For instance. NASM comes with things like %strcat to do string concatenation.

I suppose the lack of compiler warnings can be a challenge, but most low-level compilers don’t exactly provide guidance for when you design your program wrong.

No doubt Assembly is harder than Java or Python, but compared to languages like C, I don’t think it’s as hard as people pretend to it to be.

CanadaPlus ,

I wouldn’t be able to write Rollercoaster Tycoon in assembly because keeping track of all that code in assembly files must be hell, but people pretending like you need to be some kind of wizard to write assembly code are exaggerating.

Well, they’ve got a point for the bigger machine codes. Just the barebones specification for x86 is a doorstopper IIRC.

From what I’ve heard, writing big stuff in assembly comes down to play-acting the compiler yourself on paper, essentially.

skullgiver ,
@skullgiver@popplesburger.hilciferous.nl avatar

From what I’ve heard, writing big stuff in assembly comes down to play-acting the compiler yourself on paper, essentially.

I think that’s true for just about any programming languages, though the program you’re “compiling” is a human understanding of what you’re trying to accomplish. Things like val bar = foo.let { it.widget?.frub() ?: FrubFactory::defaultFrub(it) } don’t come naturally to the human mind, you’re already working through the logic required before you start typing.

As for the x86 instruction count: you don’t need to know all of them. For instance, here’s a quick graph of all of the instructions in systemctl on my system:

https://popplesburger.hilciferous.nl/pictrs/image/a35a14ee-93fa-45c7-ae88-95119c39cd2c.png

With the top 15 or maybe to 25 of these instructions, you can probably write any program you can think of, and what’s missing will probably be easily found (just search for “multiply” or “divide”). You don’t need to know punpckldq to write a program.

Cysioland ,
@Cysioland@lemmygrad.ml avatar

Assembly was easier to me than C/C++.

NocturnalMorning ,

I learned assembly for a few weeks when I first started a new job once (didn’t even have anything to do with my job), and I always felt like my brain was tired after trying to write in assembly. Just took so much more mental concentration than writing in c for example.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • lifeLocal
  • goranko
  • All magazines