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.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

TheFerrango , in Hi Ricardo

Someone has a Motorola! 😀

carpelbridgesyndrome OP , (edited )

Just got another. Seems they still haven’t caught their intern

ImpossibleRubiksCube ,

Exactly how many Ricardos work there?

30p87 ,

I only got one and accidentally swiped that away :(

Kolanaki , in Its not wrong though
@Kolanaki@yiffit.net avatar

I’ve wondered: Can you go deeper than assembly and code in straight binary, or does it even really matter because you’d be writing the assembly in binary anyway or what? In probably a less stupid way of putting it: Can you go deeper than assembly in terms of talking to the hardware and possibly just flip the transistors manually?

Even simpler: How do you one up someone who codes in assembly? Can you?

mrpants ,

Re: Coding in binary. It makes no difference. Your assembly is binary, just represented in a more human readable form when writing it in assembly.

Re: Manual interaction. Sure there’s plenty of old computers where you can flip switches to input instructions or manipulate registers (memory on the cpu). But this is not much different from using assembly instructions except you’re doing it live.

You can also create purpose built processors which might be what you mean? Generally this isn’t too useful but sometimes it is. FPGAs are an example of doing this type of thing but using software to do the programming of the processor.

Kolanaki ,
@Kolanaki@yiffit.net avatar

this isn’t too useful

The point isn’t to be good, practical or useful. It’s to be cool 😎

But this silly question still informed me of something I had misunderstood: I had thought assembly and machine code were the same thing.

cacheson ,
@cacheson@kbin.social avatar

Perhaps you'd like to build an 8-bit computer?

PipedLinkBot ,

Here is an alternative Piped link(s): piped.video/watch?v=HyznrdDSSGM&

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I’m open-source, check me out at GitHub.

CaptainBuckleroy ,

Yes, you can code in machine code. I did it as part of my CS Degree. In our textbook was the manual for the particular ARM processor we coded for, that had every processor-specific command. We did that for a few of the early projects in the course, then moved onto Assembly, then C.

thepianistfroggollum ,

That was a fun class. One of the last ones I took before recursion made me change majors.

jdaxe ,

Hand writing machine code and assembly was fine, but recursion is where you draw the line??

thepianistfroggollum ,

My brain just can’t write recursive code. I can read it, but not write it.

doggle ,

Assembly effectively is coding in binary. Been a long time since I’ve looked at it, but you’d basically just be recreating the basic assembly commands anyway.

I guess you could try flipping individual transistors with a magnet or an electron gun or something if you really want to make things difficult.

If you actually want to one-up assembly coders, then you can try designing your own processor on breadboard and writing your own machine code. Not a lot of easy ways to get into that, but there’s a couple of turbo dorks on YouTube. Or you could just try reading the RISC-V specification.

But even then, you’re following in someone else’s tracks. I’ve never seen someone try silicon micro-lithography in the home lab, so there’s an idea. Or you could always try to beat the big corps to the punch on quantum computing.

ylph ,

The first computer I used was a PDP-8 clone, which was a very primitive machine by today’s standards - it only had 4k words of RAM (hand-made magnetic core memory !) - you could actually do simple programming tasks (such as short sequences of code to load software from paper tape) by entering machine code directly into memory by flipping mechanical switches on the front panel of the machine for individual bits (for data and memory addresses)

You could also write assembly code on paper, and then convert it into machine code by hand, and manually punch the resulting code sequence onto paper tape to then load into the machine (we had a manual paper punching device for this purpose)

Even with only 4k words of RAM, there were actually multiple assemblers and even compilers and interpreters available for the PDP-8 (FOCAL, FORTRAN, PASCAL, BASIC) - we only had a teletype interface (that printed output on paper), no monitor/terminal, so editing code on the machine itself was challenging, although there was a line editor which you could use, generally to enter programs you wrote on paper beforehand.

Writing assembly code is not actually the same as writing straight machine code - assemblers actually do provide a very useful layer of abstraction, such as function calls, symbolic addressing, variables, etc. - instead of having to always specify memory locations, you could use names to refer to jump points/loops, variables, functions, etc. - the assembler would then convert those into specific addresses as needed, so a small change of code or data structures wouldn’t require huge manual process of recalculating all the memory locations as a result, it’s all done automatically by the assembler.

So yeah, writing assembly code is still a lot easier than writing direct machine code - even when assembling by hand, you would generally start with assembly code, and just do the extra work that an assembler would do, but by hand.

Lowered_lifted ,
@Lowered_lifted@lemmy.world avatar

You could like make a simple accumulator machine out of logic gates and enter binary instructions expressed in hexadecimal into its register to program it, yeah, but it’s not capable of all the operations of a computer. But yes the first programming was just op codes, switches flipped or punch cards, there was no assembly language. But assembly language is pretty much just mnemonics for operations and registers. Like I had to write a couple C programs in school and use GNU C compiler to disassemble them into x86 assembly and see what it was doing on that level, then we “wrote” some x86 assembly by copypasting a lot of instructions but its not that hard to make something that works in like x86 assembly or like Jasmin (Java virtual machine assembly language) if it’s simple enough.

gerryflap ,
@gerryflap@feddit.nl avatar

You can code in binary, but the only thing you’d be doing is frustrating yourself. We did it in the first week of computer science at the university. Assembly is basically just a human readable form of those instructions. Instead of some opcode in binary you can at least write “add”, which makes it easier to see what’s going on. The binary machine code is not some totally other language than what is written in the assembly code, so writing in binary doesn’t really provide any more control or benefit as far as I’m aware.

jadero ,

All those assembly language instructions are just mnemonics for the actual opcodes. IIRC, on the 6502 processor family, JSR (Jump to SubRoutine) was hex 20, decimal 32. So going deeper would be really limited to not having access to the various amenities provided by assembler software and writing the memory directly. For example:

I started programming using a VIC-20. It came with BASIC, but you could have larger programs if you used assembly. I couldn’t afford the assembler cartridge, so I POKED the decimal values of everything directly to memory. I ended up memorizing some of the more common opcodes. (I don’t know why I was working in decimal instead of hex. Maybe the text representation was, on average, smaller because there was no need of a hex symbol. Whatever, it doesn’t matter…)

VIC-BASIC had direct memory access via PEEK (retrieve value) and POKE (set value). It also had READ and DATA statements. READ retrieved values from the comma-delimited list of values following the DATA statement (usually just a big blob of values as the last line of your program).

I would write my program as a long comma-delimited list of decimal values in a DATA statement, READ and POKE those values in a loop, then execute the resulting program. For small programs, I just saved everything as that BASIC program. For larger programs, I wrote those decimal values to tape, then read them into memory. That let me do a kind of modular programming by loading common functions from tape instead of retyping them.

I was in the process of writing my own assembler so that I could use the mnemonics directly when I got my Apple //c. More memory and the availability of quite a few high level languages derailed me and I haven’t touched assembly since.

collegefurtrader ,

Assembly is binary

httpjames , in Who did this one
@httpjames@sh.itjust.works avatar

Someone forgot the back ticks 💀

ShroOmeric ,

debuggin already, aren’t we?

andrew ,
@andrew@lemmy.stuart.fun avatar

No back ticks helps prevent Lyme disease.

squaresinger ,

And Alpha-Gal (->red meat) allergy

threelonmusketeers ,
PipedLinkBot ,

Here is an alternative Piped link(s): piped.video/X6NJkWbM1xk

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I’m open-source, check me out at GitHub.

steltek , in single binary executable and dlls

No one seems to mention license considerations when talking about static linking. Even if your app is open source, your particular license may not be legally compatible with the GPL, for example. 3BSD, MIT, and Apache most likely don’t change in a single binary but it’s kind of a new thing that no one was really thinking of before when mixing licenses together.

I think this default okay assumption comes from most developers having a cloud-centric view where there’s technically no “distribution” to trigger copyright.

TechieDamien ,

Even in the cloud you need to consider licenses such as the AGPL. Personally I don’t get this almost apathetic approach many developers have towards licensing and abiding by licenses.

dylanTheDeveloper , in Its not wrong though
@dylanTheDeveloper@lemmy.world avatar

Yeah but which version of assembly

over_clox ,

Depends on the CPU. Either way there are cross-compilers and cross-disassmblers.

And even failing those options, there’s always hex editors for those really in the know.

makingStuffForFun ,
@makingStuffForFun@lemmy.ml avatar

Microsoft’s Assembly# of course. It’s new. It’s just different enough to extinguish assembly

yum13241 ,

6502 assembly.

jadero ,

The last assembly I could understand. Well, pretend to understand.

southernwolf , in Its not wrong though
@southernwolf@pawb.social avatar

It’s honestly remarkable how few people in the comments here seem to get the joke.

Never stop dissecting things, y’all.

stevedidWHAT ,
@stevedidWHAT@lemmy.world avatar

As above so below, the microscopic and the macroscopic

potoo22 , in unrolling loops is efficient, right?

In my first CS class, the professor announced an extra credit project due at the end of the semester. It was to create a formatted terminal calendar given a year from user input. I finished it after learning about condition but before I learned about classes… or functions… or loops… or searching the internet… partially. I searched how leap years worked, but didn’t bother to search for code (Stack Overflow didn’t exist yet)

Anyway, long ass program with each month hard-coded with 7 possible calendars for each month depending on the first day of the week. Lots of copy and paste. Professor was speechless, but accepted it.

ICastFist ,
@ICastFist@programming.dev avatar

“It’s not stupid if it works”

DNOS , in Linux Best Practices

As an Italian I will fall for that … We hate France

DzikiMarian , in Wow, what a comp for doing free consulting work ¯\_(ツ)_/¯

Would you prefer SO to be paid?

UlrikHD ,
@UlrikHD@programming.dev avatar

That would never be an option for Stackoverflow

DzikiMarian ,

Well guy complains about compensation for his “work”. I assume he’s ready to shell out a few dollars for when he’ll need it :-)

UlrikHD ,
@UlrikHD@programming.dev avatar

His “work” as you put it, is the only thing of value on the site. SO without users to provide answers are worth zero dollars, so I’m not sure why you put work in quotation mark.

DzikiMarian ,

Because if he’s able to help anyone on SO, he very likely profited many, many times from free access to knowledge there before he got to this point. Given activity of average user he probably gained orders of magnitude more than he given.

I find rambling about money and compensation in such context distasteful.

SO provided platform which, while not perfect is used by millions of people. They aren’t overloaded with ads and dark patterns as many of the clones. If it’s worthless, why people are using it instead self hosted blogs for example?

silent_water ,
@silent_water@hexbear.net avatar

the owners of SO make far more than the benefit provided to any single dev. if that were not true, they wouldn’t be in business.

DzikiMarian ,

if that were not true, they wouldn’t be in business.

Why? They are not loosing anything while developers are gaining time using their website.

They had 66 million dollars revenue in 2021. They have about 20 million registered users (and much more unregistered, and that’s revenue not income, but let’s forget that). Do you really, honestly feel, that SO doesn’t save you $3 worth of time per year?

silent_water ,
@silent_water@hexbear.net avatar

I use stackoverflow for minutes at a time and it almost never has answers to the questions I need answers to. if it has an answer, it’s usually “you can’t do that”. reference docs are 100% of the time more helpful. so no, I don’t think so.

DzikiMarian ,

Why do you go there then? If you don’t, they won’t get their $3 out of you and universe is in balance again :-)

silent_water ,
@silent_water@hexbear.net avatar

frustration, usually, hoping against hope that the answer is relevant.

ToxicWaste ,

You guys are funny. If you don’t want to see ads, use adblock. Now SO is a free platform for people that want to contribute.

silent_water ,
@silent_water@hexbear.net avatar

I don’t want Google to have my info. the ads are secondary.

Thorry84 , in Its not wrong though

For people interested in the difference between decompiled machine code and source code I would recommend looking at the Mario 64 Decomp project. They are attempting to turn a Mario 64 rom into source code and then back into that same rom. It’s really hard and they’ve been working on it for a long time. It’s come a long way but still isn’t done.

github.com/n64decomp/sm64

altima_neo ,
@altima_neo@lemmy.zip avatar

I thought they were done already?

Thorry84 ,

There is still some stuff that needs documenting, but the original goal of recompiling the created source code into the ROMs has been achieved. People are still actively working on it, so in that sense it’s maybe never done.

Nioxic , in Hallelujah

Dir?

SturgiesYrFase ,
@SturgiesYrFase@lemmy.ml avatar

Well that’s rude…

Nintendo ,

what did you say? say that again to my face, I dare you.

Nioxic ,

I apologize. I didnt mean to offend anyone!

lugal ,

Mir?

nodiet ,

Mir nichts, dir nichts

lugal ,

Achso, schade, aber kann man nichts machen

friendlymessage ,

Tja

AnUnusualRelic ,
@AnUnusualRelic@lemmy.world avatar

Why are DOS commands always so verbose?

SubArcticTundra ,
@SubArcticTundra@lemmy.ml avatar

Wait till I tell you about Pause

out , (edited )

deleted_by_author

  • Loading...
  • leviosa ,
    @leviosa@programming.dev avatar

    Old habits die hard, that’s the first alias on my list in .zshrc!

    mexicancartel ,

    ^L

    RaivoKulli ,

    Just makes the command prompt climb into a hole

    thepianistfroggollum ,

    Too many letters

    SpaceNoodle , in Its not wrong though

    No, it is wrong. Machine code is not source code.

    over_clox ,

    Never heard of a decompiler I see.

    seliaste ,
    @seliaste@lemmy.blahaj.zone avatar

    A decompiler doesnt give you access to the comments, variable names, which is an important part of every source code

    over_clox ,

    Meanwhile, AI is having a heyday with it…

    arxiv.org/abs/1909.09029

    BaroqueInMind ,
    @BaroqueInMind@kbin.social avatar

    What's cool is that you can interpret the var names yourself and rename them whatever you want.

    seliaste ,
    @seliaste@lemmy.blahaj.zone avatar

    But it is extremely time-consuming. Open source code makes it transparent and easy to read, that’s what it is about: transparency

    newIdentity ,

    A decompiler won’t give you the source code. Just some code that might not even necessarily work when compiled back.

    over_clox ,

    And? Decompilers aren’t for noobs. So what if it gives you variable and function names like A000, A001, etc?

    It can still lead a seasoned programmer where to go in the raw machine code to mod some things.

    over_clox ,

    You’re actually chatting with a hacker that made No-CD hacks.

    amki ,
    @amki@feddit.de avatar

    From the point of view of the decompiler machine code is indeed the source code though

    tastysnacks ,

    Try converting from English to Japanese and back to English.

    over_clox ,

    xor ax, ax

    amki ,
    @amki@feddit.de avatar

    A fancy way to say do nothing is not the same as translating back and forth. Example: Show me the intermediate translation.

    Also we live in a 64bit world now old man

    over_clox ,

    You’re right.

    xor rax, rax

    Karyoplasma ,
    
    <span style="color:#323232;">GF2P8AFFINEINVQB xmm1, xmm2, 10
    </span>
    
    over_clox ,

    Also that instruction does not do nothing, it resets the CPU register to zero without having to access RAM. Far from a NOP instruction.

    SpaceNoodle ,

    Still not the actual source code, bucko.

    over_clox ,

    No, it’s actually better when you can read the machine code.

    Most folks don’t care to recompile the whole thing when all they wanna do is bypass the activation and tracker shit.

    SpaceNoodle ,

    Having access to the source code actually makes reading machine code easier, so you’re also wrong on this entirely different thing you’re going on about.

    over_clox ,

    You’ve clearly never used a disassembler such as HIEW have you? You get the entire breakdown of the assembly code.

    SpaceNoodle ,

    I disassemble binaries daily for work. It’s still not the same as source code.

    over_clox ,

    I didn’t say it was. I just said loosely what the OG meme said, if you know how to read assembly, you know how to read (and write) what some of the code does.

    over_clox ,

    I never said disassembly or decompiling was easier in any way. I’ll agree with you on that, it’s way more difficult.

    Back to the point of the meme though, if you can read assembly, you can read it all.

    SpaceNoodle ,

    You’ve never actually compared source code to its compiled output, have you.

    over_clox ,

    I’ve written drivers in 65 bytes of code. I don’t tend to use high level languages that hide what’s going on behind the scenes.

    olorin99 ,
    @olorin99@artemis.camp avatar

    And even if you had the source code it may not necessarily qualify as open source.

    vox ,
    @vox@sopuli.xyz avatar

    well assembly is technically “source code” and can be 1:1 translated to and from binary, excluding “syntactic sugar” stuff like macros and labels added on top.

    Malfeasant ,

    But those things you’re excluding are the most important parts of the source code…

    257m ,

    By excluded he means macro assemblers which in my mind do qualify as an actual langauge as they have more complicated syntax than instruction arg1, arg2 …

    257m ,

    The code is produced by the compiler but they are not the original source. To qualify as source code it needs to be in the original language it was written in and a one for one copy. Calling compiler produced assembly source code is wrong as it isn’t what the author wrote and their could be many versions of it depending on architecture.

    joxese3341 , (edited ) in Its not wrong though

    deleted_by_author

  • Loading...
  • drcabbage ,

    Thank you. I almost forgot

    scottyjoe9 ,

    Who downvotes this? Chris Sawyer is the GOAT.

    Naomikho , (edited ) in Hours of work
    @Naomikho@monyet.cc avatar

    This literally happened in my meeting last week. Top position development manager was complaining the existing thing was shit. Basically means we have to build a new thing from scratch. And guess what? The deadline is 12 Sep.

    If you think it was shit why did you let them do what they did in the past?

    over_clox , in Hallelujah

    echo @dir %1 %2 %3>%windir%system32ls.bat

    Something like that should fix the problem, I think…

    hemko ,

    :puke:

    over_clox ,

    You’re no fun…

    %0|%0

    hemko ,

    Not gonna lie I love easily readable scripts. Powershell was my first, and as much pain it can be it’s for sure readable even for the most novice.

    Maybe that’s why I love Python too, but have hard time learning sh past very basics…

    Edit: oh lol that’s a fork bomb, curiosity won and had to ddg what that is. Love the simplicity of that

    over_clox ,

    Haha!

    Old-school fork bomb, at least it doesn’t do anything but bog the system down…

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