Renan
Compilation steps of (some) modern programming languages:
High level code » C code » Assembly » Binary
Renan
Renan
Renan
So, that is why they say: If you can not code it in assembly then it can not be coded. 🤔
Then why people are not coding modern applications using just assembly language then?! 🤔
There are some valid reasons:
1. Not portable. Write once, rewrite forever.
2. Development time. As an example, writing a simple mathematical equation in a high level language takes some seconds, doing the same in assembly you will take minutes.
3. Bug prone. The slightest detail you get wrong and your code will not run as intended, it will assemble fine though.
And these are just a few (valid) reasons most people are not writing modern applications purely in assembly language nowadays. 🙂
olli
why not mov ? writing to memory to read from it again seems inefficient. the isa seems inconsistent as well... add seems to use registers where as div provided the value to be divided (?)
su
Mark Hi
Anonymous
Hi guy's
Anonymous
Pls I have a question
Dima
read the rules first
Anonymous
Pls where are them
Anonymous
@dima Hy
Anonymous
Any programmer here working on a project?
Alex
why its output is 1 2 3
That means the local auto variable "sum" uses the same stack location for every each loop. The initial value of "sum" can be any random number in a normal system.
Alex
Or the sum is compiled as a register (after optimization, most likely)
olli
This depends on the architecture, anyway you usually provide the register you divide by not the one to be divided
Also when it comes to constants, you can move them to registers while you have them
olli
That was a wild guess, hence the initial (?) because you specified the dividend
Anonymous
I am having some errors in my C code... In graphics.h, I first initialized the graphics and then tried this function:
initwindow(100, 100, "Hello World");
But this gave an error of
graphics.h dont have a function initwindow?
Anonymous
Anonymous
Then how do I make graphics??
Anonymous
Any other library??
V01D
Note that SDL is based off of OpenGL, and tailored towards 2D game development.
ɴꙩᴍᴀᴅ
ncurses
Vlad
ncurses
ncurses is for terminal gfx
Vlad
SDL or SFML is a lot more robust in that regard
Francisco
V01D
kartik
Anyone using vscode
kartik
Any one using visual studio code
V01D
Me, why?
kartik
Getting erro
kartik
During execution
kartik
Anyone help here
V01D
Did you download vs code for 32 or 64 bit / does it comply with your architecture
kartik
Any one via screen sharing
kartik
Let me paste
V01D
kartik
Getch error
V01D
What were you doing when this occured
Harsh
Harsh
Harsh
Even works fine on my 2GB 1.86GHz dual core
Harsha [M]
Harsha [M]
Harsh
kartik
Okay
Marián
class, abstract class, interface, enum…
what is some kind of „term“ that groups all these words? I’ve got it on my tongue but can’t hella remember, i need it to name my variable properly 😄
Anonymous
Marián
naaaah
Marián
it’s not object, blueprint, datastructure…i have different word in the back of my mind
Anonymous
Marián
not a C++ question xd sry for that
Anonymous
Anonymous
Read about what macros are in the internet
Anonymous
So?
Anonymous
Macros are not callable
Anonymous
They are not called that way
Anonymous
I call them "shit code"
Anonymous
Read C++ core guidelines' section about macros
Alex
cause in the place Macro is called we get simple substitution Macro body(instead of actual call like function)
Anonymous
Anonymous
I don't think that read outdated literature is good for you education
Anonymous
Using macros to write inline function considered bad practice even in C since C11
Vlad
Harsh
Inline substitution they mean maybe?
Harsh
Not like vars ofcourse
Anonymous
You already git an answer
https://t.me/programminginc/327403
Anonymous
Anonymous
Using macros is a bad practice for making inline functions