D
D
Dokinacap2017-07-18 16:52:11
PHP
Dokinacap, 2017-07-18 16:52:11

How to learn assembler under linux?

Hello everyone. I wanted to learn assembler under linux. My work is not closely related to programming, but there is a tench at the workstation, he is also at home, there is no desire to learn something under Windows, and 0 practical use. Now the question itself is. Is there a normal Literature on programming in ASM under Linux? Everyone recommends Zubkov for ASM, opened it, and everything about DOS is a bit of venda, and a couple of dozen pages about UNIX. A couple of dozen pages are clearly not enough. There is also such a bookif anyone read it, tell me if it’s worth reading it? Is it possible to learn asma from scratch in Linux from scratch (not the basics of programming in general, but to him). Well, or for example, I know that there are 2 syntaxes AT & T and intel. Zubkov, as I understand it, uses in book two. They say that under Linux you can write in Intel syntax. In this case, is it possible to read Zubkov’s book and use Intel syntax under Linux. In short, guys, explain to a beginner in such a difficult task how to achieve success. What to read, which to use a dialect for learning and so on. In general, how to learn to write in asme EXACTLY under linux. Also, what is worth reading besides this. I think one assembler will not be enough. Some recommend reading of. docks from intel, but I think I’m not ready for this, is there anything simpler about the processor device. Not necessarily chewed, but for people, not dry documentation.
UPD:
I want to learn not only Just for Fun. As I said, my work is not closely related to programming. I work in the field of cinema, there are a lot of nodes in my combat software. Each node is a so library. For a better understanding of their work, it was it would not be bad to disassemble them and understand the algorithm of some especially important nodes. This is software for artists in fact, and in the office. docs infa only about its use, from the point of view of the artist. I want more. Add functionality if possible, etc.

Answer the question

In order to leave comments, you need to log in

9 answer(s)
A
Arthur K., 2019-01-30
@logpol32

I got the impression that you invented the wheel.
In general, there are many reasonable findings and conclusions in your text.
However, maybe it makes sense for you to choose some kind of framework? Yii, Laravel, Symfony, etc.
You will automatically receive both the structure and the order of work, and the separation and a bunch of everything that would make your life easier. M?

T
ThunderCat, 2019-01-30
@ThunderCat

Firstly - OOP, otherwise there is no point in bothering with a large project, and the functional approach today in general in projects is more than "one's own microblog" no one uses, this is not rational.
Also discover MVC and take some framework in which all this is already normally implemented, as a result, the time spent on reading the documentation and writing controllers and models for the project will be many times less than you spend on your nightmare bicycle building. In addition, the Titanic built according to your sketches and showing it to someone will be ashamed, and knowledge of any modern framework, on the contrary, will be a big plus.

By deleting the module and the database, we will affect the work of other modules. By changing the structure of the database, we will affect the work of other modules.
SOLID, DRY, KISS...PSR4 and many other scary abbreviations will help you)

A
Alex Wells, 2019-01-30
@Alex_Wells

TS has a framework called Nest. It initially uses a modular structure, and it is implemented quite well there. Look.
Further, as I do in a Laravel project:
- /vendor - composer dependencies, in the form of third-party libraries and symfony/laravel components. It has all the basic functionality, such as working with the database. In any case, such dependencies will be closely related to the application logic, and you should not think about removing them at all. The best you can do is build an abstraction layer over /vendor, but that's a BAD idea.
- /app/Ship - saw this in another framework called Apiato. By itself, he's crap, but I liked the idea. This "ship" is a layer of tweaks, temporary fixes, loaders and other, as for some basic, missing parts of the framework / libraries, and is used by all modules in the project. For example:
In general, everything that applies to the entire project as a whole. The structure is chaotic.
Thus, in the third, final layer, I have only pure business logic:
- /app/Containers - containers - a pathetic word to replace modules. The idea is the same. In each container, at the root, there is a class with the name of the container, which contains such things as: a short name for the auto-prefix of resources, a list of providers and migrations (let's call them "things from the framework", they do not belong to the structure).
The structure of each container:

  • API/ - everything related to http application api
    - Controllers/ - http controllers
    - Requests/ - form request http classes
    - Tests/ - functional tests of this api
    - routes.php - routes file
  • Broadcasting/ - everything related to broadcasting via sockets
    - Events/ - event classes themselves
    - channels.php - broadcast channel registration file
  • Configs/ - configs for this particular container (and NOT its dependencies)
  • Extra/ - sometimes there is something that is a little outside the scope of the container, but is not yet included in the Ship. Goes here.
  • Middlewares/ - http middlewares
  • Database/ - everything related to the database
    - Factories/ - php files registering laravel model factories
    - Migrations/ - migration classes
    - Seeders/ - database seeders
    - Setup/ - factory classes, cover over Factories
    Everything that I have indicated above is either part of the language itself (as traits), or part of the Laravel framework. Google it.
    Naturally, for different frameworks, the internal structure of each container can and will change.
    PS: There is only one database for the entire project. Why do you need different databases when there are different tables?)
    PS2: what you imagined is called a microservice. It performs some small set of tasks, has a separate base and is generally isolated from everything else. But since you are asking such questions, you definitely do not need them.

I
ipokos, 2019-01-30
@ipokos

Alternatively, use Symfony. Already has a modular structure (modules use the same database, but each can use its own tables and be independent of the others)

I
Igor Vorotnev, 2019-02-07
@HeadOnFire

And I would advise you to start by studying the concept of DDD - Domain Driven Design . This will allow you to put in your head the structure in terms of business logic and how to put it on the code. And the organization in a particular framework is a second matter.

D
devalone, 2017-07-18
@devalone

I read "Stolyarov A.V. - Programming in NASM assembly language for UNIX OS - 2011"

X
x67, 2017-07-18
@x67

And since when did the assembler become dependent on the OS?
Choose a convenient IDE for yourself on a convenient system. Here is a cross-platform IDE, for example, you won't like it - find "asm IDE linux" using a query in Google and learn. Actually, as a language, there is no need to study assembler, it is as simple as three pennies, but a physical understanding of how it works there is necessary. And the IDE will not affect the perception of this understanding in any way. I once studied assembler for ancient fujitsu microcontrollers, the native IDE there was almost no different from a notepad with a boring debugger.
Another question is, why do you need an assembler? For applied tasks, it is unlikely to be useful to you. As a hobby - not the most rational choice, as there are many more interesting options. Like something cool, standing at the foundations of the universe, to be proud of yourself - again by, assembler, it certainly stands somewhere at the foundations, but in the modern world without understanding the scope of its application, it is harmful - load the brain, generate heat, but use from this, no, respectively, in its "coolness" 0 (zero) coolness. Better then С/C++ to study. At least you can write anything for anything, if you suddenly want to.

A
Armenian Radio, 2017-07-18
@gbg

I'll give you a funny tip - WINE runs Windows programs on Linux without recompilation. It follows that the assembler is the same here and there, the only thing that changes is the order of pulling system calls, which is simple as a stick and learns in one evening.
The problem with assembly language programming for LARGE architectures is that, as a rule, a modern compiler does it better than you. And even if your x64 code works on your car, it might not work on your neighbor's car with AMD.

4
4X_Pro, 2017-07-18
@XXXXPro

Which syntax to use depends on the compiler. See fasm, yasm, etc., one of them definitely supports Intel syntax.
But in general, writing for modern OS on asm is not particularly interesting, since almost everything comes down to “push parameters onto the stack or registers and make a system call”, there is not much opportunity to work directly with the equipment. And the only plus is that you can get smaller executable files.
So now it makes sense to learn asm only in order to better understand how the processor works (but even then you don’t have to go deep), or if you are going to reverse engineer other people’s programs, or if you want to try your hand at writing your own OS (and then a special there is no point in this, it’s better to join the team of the same Kolibri OS).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question