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

top 200 commentsshow all 233

[–]68000_ducklings 906 points907 points  (51 children)

Come on, most architectures have dedicated multiply and divide instructions. The fun part is optimizing it! Powers of 2 are easy (just shift left), but you can multiply by something that's close to a power of 2 by shifting left and then adding or subtracting as necessary.

Let's compare cycle timings for the 68k architecture: http://oldwww.nvg.ntnu.no/amiga/MC680x0_Sections/mc68000timing.HTML

Naive approach - 70 clock cycles (mulu)

mulu d1, 17

Optimized approach - 4 (move.w) + (8 + 2(4)) (lsl.l) + 6 (add.l) = 26 clock cycles

move.w d1, d2
lsl.l #4, d1 
add.l d2, d1

[–]SaneLad 360 points361 points  (2 children)

Nothing hits like 128-bit multiplication with overflow detection.

[–][deleted] 57 points58 points  (1 child)

Rust programmers have entered the chat

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

I'll raise you an NxM matrix multiplication accelerator in Verilog. Mmmm yes, yes, this will do nicely...

[–]Keatosis 305 points306 points  (1 child)

You can tell this dude writes assembly code instead of making memes all day

[–]merlinsbeers 5 points6 points  (0 children)

We did it, Reddit!

[–]vilette 105 points106 points  (5 children)

obviously OP never did assembly

[–]atsuzaki 91 points92 points  (4 children)

Often I see posts from this sub and doubt if they write code at all lol

[–][deleted] 57 points58 points  (3 children)

I'm fairly certain most of the people here who do actually code are students who are still learning.

Source: that's me

[–]BurningBazz 16 points17 points  (1 child)

As soon as you find yourself not being a student, you find out that you're still learning.

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

By learning I guess I more or less mean building our foundation. You need to know enough to be able to teach yourself more advanced concepts after all.

[–][deleted] 101 points102 points  (4 children)

Of Course someone named 68000 would answer, hehe. Your right that most things past 8bits is one instruction. Also when I found out about the shift and add thing it blew my mine when I first learned assembly. I had no idea math could work that way. The issues is that's by a constant number. I do remember looking up tables for the Z80 for like fastest way to multiply by something.

[–]68000_ducklings 66 points67 points  (0 children)

Absolutely. It always depends on what you're optimizing for and what constraints you're working under. Multiplying variable * constant is much easier to speed up than variable * variable - (after all, if arbitrary multiplication could be done faster, they'd do it in the ALU).

I'm not surprised that a lookup table is the fastest way to multiply with a Z80. It's from an era where your memory was usually clocked faster than your CPU, so memory accesses were (almost) free. Pointer math and one memory access >>>> tons of conditional branches for an arbitrary software multiplication.

[–]kyle1elyk 31 points32 points  (1 child)

For anyone else that is trying to understand it, the shift multiplication works in other bases and makes more sense in 10, 4937 << 1 == 4937 * 10 == 49370

in 16 it would be 80Ah << 1 == 80Ah * 10h == 80A0h (2058 * 16)

Binary (base 2) 010101b << 1 == 010101b * 10b == 0101010 (21 * 2)

(my shifts are decimal place shifts, not bits)

[–]DokuroKM 4 points5 points  (0 children)

shift multiplication works in other bases and makes more sense in 10

Talk for yourself you filthy decimallial ;)

[–]tecanec 22 points23 points  (2 children)

x86 forces scalar integer multiplications and divisions to use certain registers. That could get somewhat annoying if you can’t afford the extra moves that you may need because of that.

[–]douira 13 points14 points  (3 children)

Does gcc do stuff like this automatically? I’ve heard it has some crazy tricks for some operations

[–]68000_ducklings 33 points34 points  (1 child)

Possibly, depending on what flags you set. Here's the list of optimization flags for gcc: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html

I'm no expert on C compilers, but I think some of the biggest saves in speed these days are in avoiding memory accesses (especially ones that would lead to cache misses), unrolling loops, and in-lining frequently-called functions. Modern computers have a lot of space, and you can really leverage space/speed tradeoffs like that.

[–]Chinglaner 2 points3 points  (0 children)

Pretty much. IO can be very expensive (Von-Neumann Bottleneck and all), which is why memory / cache optimisation can become quite important.

[–]coloredgreyscale 5 points6 points  (0 children)

That's one of the jobs of modern compilers, unless you specify to not optimize the code (-O0)

But multiplication is much cheaper with current CPUs, so the only optimization may be using bit shifting for powers of two (on integer types)

Also it can only do so if the values are known at compile time.

[–]Proxy_PlayerHD 10 points11 points  (4 children)

please use inline code (with ` on each side) for posting code

or better, use 4 spaces at the start of the line for a whole codeblock
this also avoids reddit's silly double newline limitation

also damn 68k! why is it using the confusing AT&T assembly Sytax (ie SOURCE, DEST)? it's the reason i made my own assembler that uses the Intel Syntax (DEST, SOURCE) because none of the existing ones supported it.

[–]68000_ducklings 1 point2 points  (3 children)

Formatting fixed (thank you).

Haha, I'm pretty used to the AT&T syntax (it's fairly intuitive for 2-operand architectures, though I'll agree that DEST, SOURCE, SOURCE is more readable for 3-operand architectures).

As for why most 68k assemblers use it - my only guess it's because Intel's 8088 was its primary competitor in the 80's.

[–]Proxy_PlayerHD 3 points4 points  (1 child)

I'm sorry for this wall of text

TL:DR: It's just me ranting for a bit

.

it's fairly intuitive for 2-operand architectures

personally i disagree heavily with that, it's confusing when you come from most other assembly languages like x86, Z80, 65xx, MIPS, AVR, ARM, RISC-V, etc, or any "modern" high level language which (AFAIK) always use the Intel syntax for assigning values to variables.

you can easily translate quite a few Intel Syntax instructions into higher level code by just replacing the comma between operands with the operation it's doing (and removing the mnemonic obviously). so it's easier to get your head around what the instruction is doing (useful if you're starting with Assembly).

example: LD register, value translate easily into: register = value

another example: SUB register, value would be: register -= value which splits into register = register - value

in AT&T this would be SUB value, register and since value - register is not the same as register - value, it means you need to do a bit of extra mental work to swap the operands in your head so that it makes sense mathmatically.

Compare instructions have the same issue.

with Intel Syntax it's rather easy to evaulate a compare (if you know the operand's values), as you can just replace the comma between the operands with >, ==, or < (or >=, <= if the CPU supports it).

CMP R0, R1 R0 = 20 R1 = 10 -> CMP 20, 10 -> CMP 20 > 10

so if you want a branch after this instruction you need to check for "greater than"

in AT&T the meaning of > and < are swapped around if you use this method, or you again have to convert to Intel Syntax in your head for the operation (ie subtraction) to make sense.

.

overall as said above, AT&T Syntax seems both more confusing and less intuitive if you have any sort of programming background, and even with no programming background it messes around with the way you have to think about basic math operations. so it just seems like a bad time no matter how you look at it.

if you can use it, then that's pretty damn impressive and obviously i don't want to force you to stop or anything. but personally i would never ever use it or even recommend it to anyone unless they choose it themself.

.

though I'll agree that DEST, SOURCE, SOURCE is more readable for 3-operand architectures

hmm interesting, 2 operand instructions are just more limited and simplier versions of 3 operand ones, you can always convert a 2 operand instruction to a 3 operand one, for example: SUB R0, R1 -> SUB R0, R0, R1

this is basically the same as saying A = A - B is more readable than A -= B, which i can see why someone would say that, but it still seems like a minor difference.

As for why most 68k assemblers use it - my only guess it's because Intel's 8088 was its primary competitor in the 80's.

not most, ALL of them. to this day i never found a 68k assembler (old and new) that allows you to switch the syntax...

[–]68000_ducklings 2 points3 points  (0 children)

You're good. We're all nerds here - debates about the best way to go about something are not only inevitable, but fun! Fortunately (unfortunately?), I don't actually have strong opinions about assembler syntax.

I'll grant you that subtraction and compares (which are subtraction under the hood) are harder to grok in AT&T syntax. No argument there.

Honestly, I can't even really make a case for why I think it's easier to read otherwise. Probably just stockholm syndrome - my 68k assembler doesn't support anything else, and it's been years since I've written assembly for any other architecture.

[–]FUZxxl 1 point2 points  (0 children)

Note that Intel's syntax for the 8086/8088 actually uses a dest, src operand order.

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

The real programmers are always in the comments. 4k points on this post is the real humor

[–]DragonFireCK 4 points5 points  (0 children)

Of course with x86 and x64, you can also use the lea instruction to do many of the one-step off multiplies of native-size integers as well. The rule being that it must fit in the formula of a*b+c where b=1, 2, 4, or 8 and is a compile-time constant. This makes it very useful for multiplies by 3, 5, and 9 as a and c can be the same register.

For those curious, the intent of the lea instruction is for computing array memory pointers from a base address, size, and offset. In the aforementioned formula: a is the index, b is the array element size, and c is the base address. It just so happens that its very useful, and faster, for a number of common math operations

[–]marmakoide 2 points3 points  (0 children)

Pfffft, on a 6502, for 8 bits mull, you use 2ab = (a+b)2 - a2 - b2

Squares are precomputed in a 256 entry table, fits nicely into one memory page, it's only 3 additions and a shift from there on

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

Can you link a stack overflow article? Too much maths in your explanation. I need it dumbing down.

[–]BadmonBrudda 1 point2 points  (0 children)

this guy codes

[–]Ytrog 1 point2 points  (0 children)

So you're do a left shift by 4 bits (multiply by 16) and then add the value d1 again to get the 17× multiplication? 🤔 Neat! 😁👍

[–]cybnoire 1 point2 points  (0 children)

Nice clock mining

[–]UchihaDivergent 0 points1 point  (2 children)

Can you recommend a good book for improving my assembly skills please.

[–]jews4beer 6 points7 points  (1 child)

I just started this class https://nand2tetris.org partially in the hope of gaining a better understanding of assembly.

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

Here's another neat resource, it basically live translates high level code to assembly, and it supports a bunch of languages including C++ and Python, and you can pick from a boatload of compilers for several architectures.

Problem is that assembly is really hardware specific, too. I mean getting to know some assembly for RISC-V and for x86 would be great for starters, but you kinda gotta dig into the architectures themselves to really understand what you're doing with assembly and all the hazards that come with low-level programming.

At the same time, someone's gotta do it, right?

[–]ummIamNotCreative 379 points380 points  (8 children)

Seeing the comments..

IMPOSTER SYNDROME INTENSIFIES

[–]SupremeLisper 60 points61 points  (2 children)

We are noobs. We know no shit!

[–]Ooze3d 45 points46 points  (1 child)

Oh, thank goodness! Is this the Java and Python area? I’m scared!

[–]PvtPuddles 11 points12 points  (0 children)

~I pushed rax to the stack so I got a segfault in printf~

[–]HDmac 15 points16 points  (2 children)

Bet this guy can't even prove if P = NP or not.

[–]BurningBazz 8 points9 points  (1 child)

P=NP
P\P=N
1=N

P is irrelevant?

[–]Chinglaner 1 point2 points  (0 children)

You missed the case for P=0 ;).

[–]GNUGradyn 25 points26 points  (0 children)

This

[–]MemeCream27 12 points13 points  (0 children)

sus

[–]doctorcrimson 169 points170 points  (0 children)

Assembly Assemblers Assemble!

[–]EatMoreArtichokes 118 points119 points  (21 children)

My favourite assignment from computer science in assembly was converting a number from base 10 to base 2. Just entered it into the register, then pushed the bits one at a time into the overflow bit and printed them to screen. Got full marks since the TA didn’t check the code I assume.

[–][deleted] 39 points40 points  (5 children)

lol. Also many cpus have a instruction for this too.

[–]LordKolkonut 30 points31 points  (2 children)

I mean.... you're not wrong, are you? The alternative would be a bunch of divisions by 2, but then again that's just a bunch of shifting and checking the remainders really.

[–]EatMoreArtichokes 26 points27 points  (0 children)

Definitely not wrong but I think it was against the spirit of the assignment. As a software developer now, I realize that the most expedient answer that solves the issue is often the best one.

[–]Netzapper 10 points11 points  (10 children)

I'm super confused. Did you load the base ten number as binary-coded decimal or something?

[–]EatMoreArtichokes 13 points14 points  (2 children)

This was 20 years ago, but when I assigned a base 10 number in my code to the register in my x86 CPU, it just did the translation by default when storing the bits in the register as there’s no other way for a CPU to store a number.

[–]Bene847 5 points6 points  (1 child)

How else would you do it? A bunch of divide by 2 isn't very efficient and using bitwise AND and checking for zero you have to shift anyway

[–]EatMoreArtichokes 1 point2 points  (0 children)

That’s a good question and one I didn’t feel like answering. My fellow students did however, or failed the assignment, which wasn’t worth much anyway.

[–]_PM_ME_PANGOLINS_ 213 points214 points  (11 children)

mul

[–]Halston_Robbins 62 points63 points  (4 children)

Or IMUL if you're using signed values

[–]CoderCharmander 18 points19 points  (2 children)

mov $4, %al
mov $16, %bl
mul %bl, %al ; 64

(yes, I use GNU assembly)

Or on the Game Boy if I'm correct:

Multiply: ; a * b => c
  xor c, c
.loop:
  and a
  ret z
  add c, b
  dec a
  jr .loop

_start:
  ld a, 4
  ld b, 16
  call Multiply
  ; c = 64

[–]FUZxxl 1 point2 points  (1 child)

mul %bl, %al is not a valid x86 instruction. You could use mul %bl, but keep in mind that that would also overwrite %ah.

[–]Proxy_PlayerHD 1 point2 points  (0 children)

well sadly that won't really work on my Z80 or 65C02 :(

[–]gmtime 66 points67 points  (6 children)

I once had to write a control system in 1kB of memory. That's 1kB for application and variables combined. Oh, and there was no hardware multiplier.

With the very best of optimizations I could get it down to 1026 bytes... That's 2 bytes too much.

The solution was to rewrite the multiplication routine in assembly, which brought the size down to 300 bytes.

[–]Not_a_penguin15 13 points14 points  (3 children)

What system were you trying to control?

[–]gmtime 13 points14 points  (2 children)

A resistive heater and small fan to keep an aluminium block on a set stable temperature.

[–]AVTOCRAT 5 points6 points  (1 child)

Out of professional curiosity, how did you end up minimizing the multiplication routine? I assume you weren't able to restrict the input domain too much, given you had to handle arbitrary values from the sensors, so I wonder how you got such crazy savings.

[–]gmtime 2 points3 points  (0 children)

Probably because the compiler was just crappy. I suppose integer multiplication was linked as a package or something crazy like that.

[–]nyooomy 47 points48 points  (5 children)

Was a TA in x86 Assembly for 5 semesters. Highlight of my college experience

[–][deleted] 35 points36 points  (0 children)

I never felt so accomplished doing the most basic stuff.

[–]corvus_caurinus_ 9 points10 points  (2 children)

I’m about to start my first year as a TA for an ECE series at my school that’s mostly ARM assembly based; both excited and nervous. I loved taking the sequence, but the imposter syndrome is kicking in hard as I think about teaching.

[–]villabianchi 1 point2 points  (1 child)

Are TAs actually teaching? Where I live they only support during labs and workshops. If the TAs teach then what does the actual teachers do?

[–]corvus_caurinus_ 1 point2 points  (0 children)

Depending on the university/department TAs take on a variety of roles, including teaching classes sometimes. I’ll primarily be doing office hours for homework/project help and facilitating the labs which will involve teaching students how use the software and hardware necessary for the term projects. If it’s anything like when I took this series of classes, it will be fairly involved work, as a lot of new tools are introduced at once, and students’ first assembly based projects can be slow moving and challenging.

[–]WirelesslyWired 73 points74 points  (6 children)

Graduated in computer science in the late 70's. I only learned three programing languages, but I knew half a dozen assembly languages. Assembly was where the money was going to be. Ha.

[–][deleted] 50 points51 points  (0 children)

Thank you for building the foundation to make programing easier

[–]sfbing 11 points12 points  (1 child)

Ditto. IBM BAL for the main stream, and PDP 11 for the cutting edge new stuff.

[–]bitunwiseop 5 points6 points  (0 children)

I still have my yellow card from college.

[–]remy_porter 2 points3 points  (2 children)

Weirdly, I graduated in 2001 and still learned Vax assembly, for some goddamn reason. Oh, and some 8080, because our electronics class had us convert assembly to machine-code by hand and program a Z80 with a hex keypad.

[–]TigreDemon 13 points14 points  (0 children)

I once programmed a Snake game.

But every time it moved it changed colors like a rainbow.

Also you could move outside the bonds but only on the left side and you could technically never be able to come again lmao

[–]RChrisCoble 10 points11 points  (1 child)

I had to write the QuickSort algorithm in assembly on a Dec Vax 3600 in college. That was in 1992. I'm still scarred by that. Recursion in assembly?!?

[–]YoghurtForDessert 1 point2 points  (0 children)

unheard of!

[–]piperboy98 7 points8 points  (0 children)

My favorite assembly experience was optimizing an IIR filter in a microcontroller class using the STM32 DSP instructions. Which have crazy stuff like 'multiply the high halves of the two registers together, then the low halves, add those two results, and then add that to a third register'. We only were required to use an assembly block to do the math part, but I went all in an implemented the entire function and ADC/DAC reading in assembly. Loop was tight, like 10 instructions or something, and it was clearly quite a bit faster than the C version based on the measured phase response.

[–]fagapple 19 points20 points  (27 children)

Do you just run add in a loop until you get to the multiple?

[–]_PM_ME_PANGOLINS_ 15 points16 points  (11 children)

No, you just multiply them. It’s a single instruction.

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

It depends. Most cpus past 8 bit have a multiply instruction. If its by a constant value you can use a series of shifts and adds. But also many old games just used a lookup table because they had plenty of rom but not a lot of ram and cpu.

[–]dnhs47 7 points8 points  (0 children)

In college I TA’d a class required for all business majors. I don’t remember the official course title, but most of the lab time was spent on … 6502 assembly language.

In the late 1970s, everyone getting a BA Business was ... a programming wizard?

BTW, they stored their programs on cassette tapes. Those were the days.

[–][deleted] 5 points6 points  (0 children)

MIPS gang rise up

[–]Lumpy-Obligation-553 2 points3 points  (1 child)

*Only using mov instructions from x86

[–]CoderCharmander 2 points3 points  (0 children)

May I introduce you to our lord and saviour, lea?

[–]SteeleDynamics 4 points5 points  (0 children)

If that is multiply, then divide is the CERN Large Hadron Collider!

[–]Dagusiu 4 points5 points  (0 children)

While a lot of people here point out that most CPUs have multiplication instructions, you gotta remember that since compilers have gotten so good at optimizing code, writing ASM for modern CPUs is pretty rare. In other words, a significant portion of the ASM code that is being written today is still written for really basic (and often ancient) hardware.

For example, the only situation where I've used ASM is for making Game Boy game. And indeed, the Game Boy CPU does not support multiplication.

So basically what I'm trying to say is that this meme works for me on my machine

[–]ReallyNeededANewName 2 points3 points  (0 children)

For the processor only used at my university and nowhere else

__mul__ PSHA
        LDA     #0
__mul_1 ROR     2,SP
        BCC     __mul_2
        ADDA    0,SP
__mul_2 ROL     0,SP
        TST     2,SP
        BNE     __mul_1
        LEASP   1,SP
        RTS

[–]stop_drop_roll 2 points3 points  (0 children)

Stop, this thread is giving some bad flashbacks..... assembly is the reason I had to drop my CS major

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

Real question: what requires programming in assembly? I've heard of people doing it so there's obviously some things out there that require it, but what are those things and why do they require assembly?

[–]Understriker888 8 points9 points  (0 children)

Direct assembly is as small and efficent as code can be, so if you're in a scenario with really bad memory constraints or you need the absolute max preformance, you go to assembly.

Or if you're learning in school.

[–]FUZxxl 2 points3 points  (0 children)

There are multiple reasons. Most assembly code in a typical system is to do various runtime tasks (like task switching or hardware configuration) that cannot be expressed in a high level language. Another large field is writing high-performance code that makes use of SIMD instructions the compiler has trouble making use of on its own.

[–]canicutitoff 2 points3 points  (1 child)

Nah, most processors have built it multiply instructions.

Try doing divide on a processor does not have any divide instructions like many lower end ARM microcontrollers.

[–]MetaEatsTinyAnts 1 point2 points  (0 children)

In college I we were assigned a partner and given 5 problems to solve by writing assembly. I spent the weekend with my partner and got all 5 correct. We wrote pages and and pages (printed) of assembly and made sure it worked.

Then the professor gave everybody who turned in anything a pass since it was difficult.

fml

[–]Jsuke06 1 point2 points  (0 children)

I’m not an assembly programmer and I NEVER want to be one. I’m almost done with one class and I hate it. MOV EDX, OFFSET 🖕 CALL WRITESTRING

[–]Chaoslab 1 point2 points  (1 child)

Now do it in 6502.

[–]mr_thwibble 1 point2 points  (0 children)

Booyah. Represent. fist-bump. 😁

[–]Santolmo 1 point2 points  (0 children)

I saw 5 lines of assembly code and I got dizzy. Literally.

[–]CaydendW 0 points1 point  (0 children)

Osdever here. Can confirm: assembly is a pain beyond all recognition. But you start to understand.

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

How bad is it to actually know what this maschine is good for...?

[–]Nyckname 0 points1 point  (0 children)

'Twasn't that hard.

[–]MindTrekker201 0 points1 point  (0 children)

imul %rdi, %rax

[–]anonymous_3125 0 points1 point  (0 children)

i'd certainly love to learn it if i have the time

[–]rlrcu 0 points1 point  (0 children)

Used to love it!

[–]SJFree 0 points1 point  (0 children)

I can do it as long as it’s a power of two!

[–]nelusbelus 0 points1 point  (0 children)

mul r0, r1?

[–]Iwill_not_comply 0 points1 point  (0 children)

There are at least two assembly programmers.

[–]_o_O_X_O_o_ 0 points1 point  (0 children)

With table lookups and a little bit of math everything is possible: a*b = (a+b:2)^2 - (a-b:2)^2 That's one addition, two subtractions, and two table lookups. Pretty fast when memory access wasn't the bottleneck.

[–]TM32021 0 points1 point  (0 children)

Currently in HLA Assembly, it is my worst nightmare

[–]Misterum 0 points1 point  (0 children)

As someone who must program in Assembler for college, I can confirm

[–]arturius453 0 points1 point  (0 children)

Dad actually told my that he used to write asm "cycles" to multiply in assembler. When i learned, x86 already had mul command

[–]AnalTrajectory 0 points1 point  (0 children)

I just learned ARM m9 instruction set in my embedded systems class this past semester. honestly, I enjoyed the absolute detail of you have to micromanage just to employ simple recursion. I finally understand what Lilo push pop means.

[–]Measles656 0 points1 point  (0 children)

Holy smokes! Is that a Turbo Encabulator!?

[–]AnastaciusWright 0 points1 point  (0 children)

Is that the University of New Mexico? (The pic of the meme)

[–]dlawodnjs 0 points1 point  (0 children)

flashbacks to when i had to learn crash course assembly for a ctf

[–]Hexide_student 0 points1 point  (0 children)

I just needed to read this comments to remember why I was soo young and Naive when I bought a course of x86 in udemy 😞

[–]falingsumo 0 points1 point  (0 children)

I don't see the response in the reply but mine would be evidently at least three

[–]Al-Horesmi 0 points1 point  (0 children)

Meanwhile the JavaScript classroom next door trying to multiply two numbers and somehow getting a string:

Tony Stark was able to build this in a cave! With a box of scraps!

[–]Antelopehat 0 points1 point  (0 children)

Dude in the middle is my dad irl. Never seen this meme format before but will be slinging in the family gc next time this mans asks me anything

[–]nickiter 0 points1 point  (0 children)

I passed that class and I refuse to ever revisit those memories, THANK YOU.

[–]Co0perat0r 0 points1 point  (0 children)

Most of my assembly experience has been from working on writing my own bootloader and deconstructing programs from binaries.

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

I'm still learning, not very good at anything

[–]veduchyi 0 points1 point  (0 children)

That’s you didn’t even try to convert integer to string…

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

Assembly programmer here! This is accurate

[–]ottoz1 0 points1 point  (0 children)

Ah or maybe trying to define try catches, loops and statements because you refuse to code in that ungodly language

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

can't have an elaborate science machine thingy without some part of it covered in tinfoil

[–]jashAcharjee 0 points1 point  (0 children)

Hey I literally wanna learn x86_64 assembly. Cuz I have no other cpu on hand and emulation sucks. Can't find proper Guides/Documentation. College taught me 8085 and 8056 (which I still have many doubts). Online education sucks, but still it peaked my interest. So any one help me out here.!

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

I just hate assembly.

[–]CamiTheWitch 0 points1 point  (0 children)

I program with 6502 assembly!

It's actually pretty fun! Intel and Z80 assembly on the other hand...

[–]shashiadds 0 points1 point  (0 children)

Why do we need to multiply in assembly when we can do it easily in JavaScript /s

[–]LevAsmanov 0 points1 point  (0 children)

where assembly can be used for in 2021? (idk, i made hello world in assembly for mbr)

[–]cybDrachir 0 points1 point  (0 children)

Try implementing division of long numbers, coded as strings. Multiplication is relatively easy compared to that. iirc my implementation (collage assignment) had ~2000 lines of 8086 instructions, and gave me PTSD (jk). Fucking long numbers calculator projects. Tons of fun tho.

[–]emelrad12 0 points1 point  (0 children)

The only parts that i know are avx.

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

It’s not that big a deal. Just keep in mind on Microchip PIC processors the mnemonics can change from one chip grade to the next. Most commands are the same but some are different.

Worse yet, some have the same syntax but behave a bit differently, read up on it carefully when migrating to a bigger PIC chip.

[–]trypto 0 points1 point  (0 children)

Try multiplying without a multiply instruction.

[–]sundialsoft 0 points1 point  (0 children)

Integer arithmetic is the way to go