@Jack41EL

It actually doesn't divide 23 by zero, but it actually divides rdx:rax by zero where rdx:rax is the 128-bit concatenation of the two registers with rax occupying the least significant 64 bits. In any case, dividing by zero causes the processor to raise a #DE exception which the kernel handles. If you don't divide by zero, the quotient is stored in rax, and the remainder is stored in rdx. If the quotient is too big for rax, the processor raises a #DE exception as well.

Also don't use mov r64, 0 since it's slow and the 64-bit immediate takes up more space. You can reduce the space by using xor r64, r64, and modern processors recognize this as a zeroing idiom, so it doesn't get sent to any execution units, and it's really fast. Another improvement is changing it to xor r32, r32 since this version doesn't require a REX prefix, and writing to only the lower 32 bits of a register implicitly zeros the upper 32 bits (this helps with out-of-order execution), so xor r32, r32 does it in one byte. This version is also recognized as a zeroing idiom, so it is the best. The same thing applies for storing unsigned constants that fit in 32 bits: mov r32, imm32 takes up less space.

@kxuydhj

ngl that very first "phtyon" actually working and the comic mono font are probably the best "background" jokes i've ever seen.

@sequelz

Welcome to Assembly Being Bruh: Episode 94739291019475262948282

@hdufort

Good thing that I only program in 6809 ASM, where there is no division opcode 😅

But then again I can call the undocumented halt & catch fire (HCF) opcode 0x14. Or I can flip the cassette player motor on and off real fast and melt the relay.

@zwatotem

It hurted when you didn't end with an exit syscall.

@hazed69

I love that ending edit

@Garfield_Minecraft

no safety nets for you

@coffee-is-power

no it just makes the cpu fire a division by 0 interrupt, and the OS shuts it down.

@TavartDukod

I don't know about x86 assembly, but in Arm division by zero either traps if a certain flag is set, or returns zero otherwise. On AArch64 it always returns zero. I also played around with RISC-V, and it always returns the value with all bits set to one, i.e. either the greatest unsigned number or -1, depending on how you interpret it.

@ruria_coda

[Execution complete with exit code -8]

@_Elvyra._

I saw the phtyon typo, you can't hide from me!

@dakata2416

Ah yes! Phtyon

@stareintoabyss

Hey Virbox, I am not familiar with Linux distors nor Macs. What kinda OS are you using? It looks pretty dope and basic. Thanks.

@hafillathief3613

You could say never code on assembly

@mathenjoy

General Protection Fault will prevent it.

@nxone9903

You're console is extremely cursed bro

@neoplumes

Ok, but what actually happens?

@eronalves100

Wait wait!!!!!!
Phtyon???????

@tandex3414

it probably seg faults as I know

@komiljonqosimov4002

What font is this?
I want to use it, after watching this video!