[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Embedded thread Microcontrollers, microprocessors, ARM, x86,
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 28
Thread images: 5
File: Screenshot_2016-06-01_18-17-17.png (188 KB, 1920x1080) Image search: [Google]
Screenshot_2016-06-01_18-17-17.png
188 KB, 1920x1080
Embedded thread
Microcontrollers, microprocessors, ARM, x86, MIPS, AVRs, 8051s, 8080s, Z80s, everything goes!
Get in here faggots, and post what you're working on

>currently learning 8051 assembly
>tfw no one told me assembly was so darn efficient
>tfw now feel C is kinda bloated
>>
>>54873266
Looks like your compiler might be shit, either that or you're really good at writing assembly.

I can never get my assembly output to be shorter than compiled C.
>>
>>54873795
Well, his code barely does a big work so ASM code is shorter here.
>>
>>54873266
Your C compiler produces better assembly from your C code than the assembly you write.
>>
Did some MIPS on the last leg of one of my engineering courses. I really liked it, especially since I could see how each operation directly corresponded to the CPU model we were working with in class.

Does /g/ have any recommended places to start learning x86 assembly? I've started setting up a development environment for it, but now I need to find some good tutorials / reference reading. Any suggestions?
>>
>>54873869
This, it's a good thing to learn assembly, but don't delude yourself into thinking you are better than an established compiler like gcc. Lots of people much smarter than anyone of us worked on that thing for decades.
>>
File: noarm.png (78 KB, 1601x799) Image search: [Google]
noarm.png
78 KB, 1601x799
Who /owncpu/ here?
>>
>>54873986
No amount of smartness in the world can magically make general purpose compilers better than humans because of the simple fact that domain specific knowledge trumps all.
>>
>>54874070
Decades of optimizations are not magic. C is a very simple language in itself, so it is relatively easy to optimize the process from C to assembly, compared to other languages.

GCC as it is today produces extremely optimized assembly code. There's just nothing left to optimize there. Maybe 30 years ago you would have a point. Not today.
>>
>>54874405
GCC produces very good code ON SOME PLATFORMS.
For example, try having it generate code for Cortex sometime. The code it spits out is garbage.
>>
>>54874537
Ok, I will give you that one, should have clarified that I mean for widespread architectures like x86 and x86-64. Niche stuff you either need a compiler made by whoever made that processor or write your own assembly if you want good performance.
>>
>>54874060
Worked on something similar for the NAND2Tetris course, but then in some odd HDL language.
Shit was an absolute blast.
>>
>>54874610
>ARM Cortex
>niche
son...
>>
>>54874654
Were you implementing an existing architecture or rolling yor own?
>>
>>54874720
It was an architecture made up by the guys that made up the NAND2Tetris course. The fun part was that really all you started with was a NAND gate and the constants 1 and 0.

It couldn't do anything fancy though, it was just a basic CPU capable of very basic stuff like addition, substraction, OR, AND, etc. (No things like multiplication or division, those are made in assembly)
>>
>>54874703
>>54874610
In cortex's defense, its not too old hence it hasn't had enough time for fine tuning and optimization
Plus its RISC so that process is even harder
>>
>>54874788
Which Uni had you do that?
>>
>>54874952
None, did it for [spoiler]fun[/spoiler] in my free time.

Although I do think that it would've been good to do this this at my uni's computer architecture classes (I'm studying computer engineering).
>>
>>54874804
>Plus its RISC so that process is even harder
lmao, on the contrary
CISC is much more of a bitch to optimize for
>>
>>54875042
Ah k k, my Computer Systems course at Uni was basically that course
>>
>>54874804
>Plus its RISC so that process is even harder
>>
>>54874788
That's pretty cool. My own core is going to use the Thumb ISA, so I can target it with gcc.
The worst parts (LDM/STM) are done, so now I just have to implement the rest of ALU ops and flags, add a simple interrupt system, some peripherals and hopefully it'll still fit on the 8k-LE Cyclone II (and run at a decent speed).
>>
File: modul.webm (2 MB, 1920x1080) Image search: [Google]
modul.webm
2 MB, 1920x1080
I made this in uni.

Ain't got it at home right now, cause I still have to get muh mark on it.
>>
>>54876038
Nice. More than what 90% of /g/ will ever achieve, for sure.
/diy/ is a much better board for electronics discussion t b h.
>>
File: IMG_20160602_194855.jpg (910 KB, 2285x1714) Image search: [Google]
IMG_20160602_194855.jpg
910 KB, 2285x1714
>>54876038
here's the sketch
>>
>>54876075
sadly /diy/ is bretty ded and on /g/ desktop and battlestation threads werk way better.
I have also tried a few diy threads here, they never really work though
>>
>>54876038
Does it do anything apart from the fancy lights?
>>
>>54876371
it can beep and has a poti as analog input
that's enuff to learn quite a few programming shits.
Thread replies: 28
Thread images: 5

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.