[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

why isnt there some kind of a program where you write C-like

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 25
Thread images: 6

File: Zstr_count_x86_assembly.png (133KB, 945x467px) Image search: [Google]
Zstr_count_x86_assembly.png
133KB, 945x467px
why isnt there some kind of a program where you write C-like code and it translates it to Assembly? Assembly is simple enough that it can be covered by pseudo-C code.
>>
What is gcc's -S flag?
>>
>>55997083
gcc -S
>>
>>55997083
>C-like code and it translates it to Assembly?


It's called C
>>
That is literally what C is for.
>>
nigga its literally C
>>
Now that's a retarded question
>>
>>55997083
Have you ever heard of this thing called "compiler"? They're pretty useful.
>>
Why did you post this?
>>
>>55997083
>code to assembly

That happens to every compiled languages
>>
File: 1457374727766.jpg (28KB, 354x313px) Image search: [Google]
1457374727766.jpg
28KB, 354x313px
>>
File: 1470405930548.png (894KB, 838x838px) Image search: [Google]
1470405930548.png
894KB, 838x838px
>>55997083
This belongs in "/g/ humour thread".
>>
File: 1466816121592.gif (2MB, 240x180px) Image search: [Google]
1466816121592.gif
2MB, 240x180px
>>55997083
>>
>>55997149
>>55997171
>>55997190
>>55997485
>>55997574
then why do people use assembly?
>>
>>55998247
I asked this a while before and the answer was that humans can write more compact assembly code than compilers which i cant believe.
>>
File: dandilion.gif (2MB, 300x300px) Image search: [Google]
dandilion.gif
2MB, 300x300px
>>55998247
/thread
>>
>>55998392
>Automated compiling is always better than the hands of a seasoned programmer with a good understanding of hardware and technique
Is this what you believe instead?
>>
>>55998247
function call overhead, compilers used to suck (running on slow machines with limited memory, they couldn't/didn't do the optimizations found in modern compilers), not-quite optimal use of registers

back when clock speeds were single digit MHz, hand-optimized asm really mattered
in modern times, it's not nearly that important, and it's a lot harder to optimize code by hand better than a modern C compiler can
>>
>>55998247
Microcontrollers and sheit.
>>
>>55998247
- to write more efficient programs. With Compilers and Hardware becoming better and programmers becoming worse, this is rarely the case anymore. Example here might be Bleem!
- to access platform specific features that C wont let you access; writing to ports, switching between protected and real mode, modifying the interrupt descriptor table etc (mostly stuff you need when you write your own OS or very specific optimizations for small tasks)
- if you want to modify other software and need control over what registers your functions are modifying or rescuing. Game Trainers or No-Cd-Cracks come to mind
>>
File: Rct-box.jpg (151KB, 332x400px) Image search: [Google]
Rct-box.jpg
151KB, 332x400px
>>55998247
So this mofo could run on my toaster.
>>
>>55998247
Most people don't, they just use C.
>>
>>55998247
Few people do these days. You'd use it when talking to physical hardware especial in embedded work and in operating system kernels but most software is high level code. Even in operating system kernels a lot of the code will be in something high level like C but there might be inline assembly code for some time sensitive parts.

Compilers are usually good enough but for some things its preferable to look over the generated assembly code for any areas that the compiler couldn't optimize.
>>
>>55998392
Sometimes the compiler gets stumped and it generates redundant code which can waste cycles and degrade performance a little. If you can read and write assembly you can correct these small mistakes.

Aside from what was already said in the thread the other main use of assembly these days is debugging.
>>
>>55998247
the only reason I've found for using assembly or learning assembly is for reverse engineering. And even then it's used mostly in association with C code.

I don't think too many people waste the time to actually write out large programs in assembly.
Thread posts: 25
Thread images: 6


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.