Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
xewl41716ySeems like it's tagged as "story", but I reckon it's "to be continued" too :p *subscribe for MOAR and hit the bell.. wait...*
-
@GMR516 vs code on linux, look at the programbar (the one with the "X" in the top right)
-
Man, assembly is fun, so long as there's not much code to write. But some of the logic can be mindbending at times :S
-
netctl2706yThis is a very basic program and its not to complicated. Basically what ive learn till now is that every assembly program is split in 3 sections.
The .data section is used to declare variables which will be used after compile and have a defined value. The .bss section is like .data section but for variables that will take the value after something happens on the program. The .text is where the code goes and it only tells the nasm compiler that the executon start at _start function.The start function calls 4 other functions that print the strings i have declared in .data section. The first instraction of the function tells that i am trying to use a x64 cpu registry called rax and the number setting the value of this registry after " , ". The 1 value is an instruction for x86_64 cpu`s using linux kernel which is tellin the cpu to write on this. Different cpu architectures and different kernels have different instruction numbers. Example on mac instruction for write is 0x2000004. -
@netctl please don't, AT&T syntax is retarded and should die already (sorry @ewpratten)
-
Create 512 byte file, use bios interrupts to print string, add 55AAh signature to the end. dd it to flash card's first sector and plug to computer and see your OS.
-
@netctl @RememberMe
At&t might look ugly, but the ordering of things actually makes sense, and it allows you to get even lower level with its mnemonic suffixes
For example:
movl
movq
These allow even more precise data handling. -
@ewpratten doesn't Intel syntax infer the size of the mov using the register/pointer sizes? At least, I've never come across this as a problem.
I agree that being explicit about it is nice in this case, but AT&T just looks so damn ugly. Pretty sure all the extra noise is because it makes it easier to parse, which should be a non-issue for modern parsers.
Also, I feel the intel syntax operand order (destination-first) is more intuitive because it's similar to an assignment (dest = source kind of thing).
Also, complex addresses are waaay cleaner in Intel than in AT&T (look at the attached image for a comparison). Intel makes perfect sense even if you don't know it, while AT&T is an absolute horror.
Besides, most resources I've used prefer the intel syntax. -
@ewpratten One thing I never managed to find out in AT&T that made me not want to convert was `jmp somelabel:thecodetoberan`, but I'd love to try again
-
LuxARTS16636yAnd when I thought that I was cool using Assembly to program Cortex CPU I see this...
Related Rants
-
Angry21The first time I realized I wasn't as good as I thought I was when I met the smartest dev I've ever known (to ...
-
Flink9122Professor: "Who here regularly backs up all their data?" *Some people raise their hands* Professor: "Who has a...
-
sagemaker32I was looking for about a month for a laptop. Then on this one magical day I open kijiji and see a Toshiba Thi...
First ever x86_64 program.
I feel like a rocket scientist lol
rant
story