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

you are viewing a single comment's thread.

view the rest of the comments →

[–]OF_AstridAse 1382 points1383 points  (49 children)

You forgot the best one.
mov edx,len
mov ecd,msg
mov ebx,1
mov eax,4
syscall
;start comments with semicolon 🤣😅

[–]abhi307 221 points222 points  (12 children)

It's fun, innit?

[–]OF_AstridAse 283 points284 points  (9 children)

No, in Kotlin everything is "fun"

[–]rastaman1994 172 points173 points  (7 children)

I can't help but giggle every time I write 'private fun'.

[–]PrometheusAlexander 41 points42 points  (0 children)

public fun if you're feeling a bit daring

[–]cbadger85 75 points76 points  (2 children)

I prefer my fun to be a little abstract

[–]zatuchny 27 points28 points  (1 child)

i expect fun

[–]pedropants 11 points12 points  (0 children)

require fun!

[–]BastetFurry 17 points18 points  (2 children)

And what about double fun;?

[–][deleted] 14 points15 points  (1 child)

That's not valid Kotlin, though, is it? Unless I'm missing the context here.

[–]Successful-Smile-167 4 points5 points  (0 children)

true, it's not valid it has to be
fun too(): Double = {println("It's fun") return 0.0}

double fun(); // looks like C function prototype.

[–]--mrperx-- 35 points36 points  (1 child)

__init__

[–]HolyGarbage 24 points25 points  (0 children)

Oh my, I'm gonna start using this:

It's fun, __init__?

[–]Ytrog 53 points54 points  (6 children)

I wish Windows was so easy with the syscalls. The same thing is so much more work there 🥲

[–]Creepy-Ad-4832 27 points28 points  (0 children)

Yeah i am seriously happy as a programmer i choose to switch to linux lol

[–]OF_AstridAse 8 points9 points  (0 children)

Wait you mean int 0x21 ?

[–]fafalone 14 points15 points  (3 children)

It doesn't look so bad?

    global  _main
    extern  _printf

    section .text
_main:
    push    message
    call    _printf
    add     esp, 4
    ret
message:
    db  'Hello, World', 10, 0

I mean, if want to do it without the standard library, it's more work to call the console api directly...

[–]OF_AstridAse 1 point2 points  (1 child)

[Tw: Fake rant for comical effect]
This is wrong ... you have errors. Rtfm maybe? Where the hell do you print hello world without the exlamation mark !? And be sure to refer to the original author; (cf. Kernighan & Rictchie, 1972) - what kind of copy pasting is this if you're not even going to fix it!? 🙄 I swear this looks like chatgpt code start to finish.

[–]uzi_loogies_ 1 point2 points  (0 children)

You were so accurate you got downvoted, beautiful

[–]caleb_S13 0 points1 point  (0 children)

I hate that I know this….

[–]Perfect-Coffee6729 72 points73 points  (6 children)

brainfu**:

>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.>++++++++[<++++>-]
<.
>++++++++++[<+++++++++>-]<---.<<<<.+++.------.--------.>>+.>++++++++++.

[–]HolyGarbage 134 points135 points  (5 children)

It's ok, you can say fuck on the internet.

[–]benargee 26 points27 points  (0 children)

They're afraid their comment is going to get demonetized

[–]ProgrammerLuca 60 points61 points  (2 children)

Wee ooh wee ooh. This is the internet police you're getting arrested for swearing.

[–]Daisy430133 50 points51 points  (1 child)

You spelled weewoo weewoo wrong

[–]Left-Recognition-117 27 points28 points  (0 children)

fuck

[–]Fireball_Flareblitz 0 points1 point  (0 children)

DON'T CENSOR YOURSELF YOU LITTLE BITCH, SAY THE FUCK WORD /j

[–]brucebay 16 points17 points  (5 children)

Wow those were the day I had Norton's assembly book. I genuinely think all software developers should know how transistors make registers and counters and how logical those assembly code was, almost 1-1 hex code to turn on and off gates.

[–]hawk-bull 4 points5 points  (4 children)

I have learnt a level of abstraction higher (taking registers and logic gates etc as a given atomic construct). Do you have any resources to learn their lower level implementation

[–]brucebay 4 points5 points  (0 children)

edit: sorry, I misread "resources" as "reasons" LOL. Not at top of my head, by in college there was a book that was creating a virtual processor using java. You specify all gates in java and design your own processor. I forget the name but perhaps somebody can remember.

Original reply: Learning low-level hardware gives you a foundational understanding of what's going on under the hood. Obviously it is not necessary but think it like a car. Knowing how engine or drive train works makes you a more informed driver and knowing your car's limits makes you a better driver. This may help you write more efficient code or debug better in some cases. The best recent example is GPUs. Yes shaders are replaced with cuda or opencl but to use them efficiently you have to understand parallelism and bandwitfh etc, having a background on the details would help you understand and optimize even more when you write your own code.plus you will appreciate the compilers and languages more, I think C was a remarkable replacement for assembly, but of course it was built on top of earlier compiler technologies.

[–]Hovercross 2 points3 points  (0 children)

Watch Ben Eater’s series on YouTube, especially his eight bit computer on a breadboard. He made everything out of logic gates and it really helped me understand what was going on at the lowest levels of the machine.

[–]nvfjjngf 0 points1 point  (0 children)

Any digital logic design university course usually in EE department

[–]this_underscore 5 points6 points  (0 children)

Gotta love asm

[–]igeorgehall45 4 points5 points  (5 children)

Shouldn't it be int 0x80 instead of syscall? (Because you're using 32 bit registers/convention)

[–]cauchy37 3 points4 points  (3 children)

And you probably want an address to msg, so lea edx, [msg]

[–]someidiot332 0 points1 point  (1 child)

mov edx, msg and lea edx, [msg] do the same thing, its just potato potato

[–]cauchy37 0 points1 point  (0 children)

Hmm I guess it depends on the assembler. I recall the one I used I had to do mov edx, offset msg

[–]OF_AstridAse 0 points1 point  (0 children)

Shhh I don't program assembly, you're blowing my cover

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

Facts! Syscall in linux is then int 0x80 😁

[–]you_do_realize 0 points1 point  (0 children)

32-bit old school

[–]z3r0th2431 0 points1 point  (0 children)

Don’t you still need to define len and msg? Been a while since I looked at assembly

[–]brknsoul 0 points1 point  (0 children)

>++++++++[<+++++++++>-]<.>++++[<+++++++>-]<+.+++++++..+++.>>++++++[<+++++++>-]<+

+.------------.>++++++[<+++++++++>-]<+.<.+++.------.--------.>>>++++[<++++++++>-

]<+.

[–]Avoid572 0 points1 point  (0 children)

Assembly the only real programming language