Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve first chapter #27

Merged
merged 15 commits into from
Nov 28, 2024
Merged

Improve first chapter #27

merged 15 commits into from
Nov 28, 2024

Conversation

0xAX
Copy link
Owner

@0xAX 0xAX commented Jun 9, 2024

This PR provides significant rework for the first chapter.

@0xAX 0xAX requested a review from klaudiagrz as a code owner June 9, 2024 11:32
@0xAX 0xAX self-assigned this Jun 9, 2024
@0xAX 0xAX force-pushed the chapter-1-update branch 2 times, most recently from 42a39fc to ce606fa Compare June 16, 2024 15:49
@Deckloins
Copy link

Hi ! I started working on rewording the first article, but then saw you already had a big head start.
If you want we could work together to fine-tune the translation

0xAX added 7 commits July 17, 2024 17:04
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
@0xAX 0xAX force-pushed the chapter-1-update branch 3 times, most recently from eb6f132 to 4b8ead1 Compare July 17, 2024 12:14
@0xAX 0xAX force-pushed the chapter-1-update branch from 4b8ead1 to e6f9279 Compare July 17, 2024 12:23
content/asm_1.md Outdated
Yes, it doesn't look like printf("Hello world"). Let's try to understand what is it and how it works. Take a look 1-2 lines. We defined data section and put there msg constant with Hello world value. Now we can use this constant in our code. Next is declaration text section and entry point of program. Program will start to execute from 7 line. Now starts the most interesting part. We already know what is it mov instruction, it gets 2 operands and put value of second to first. But what is it these rax, rdi and etc... As we can read in the wikipedia:
Looks quite long in a comparison to our usual well known `hello world` program. Let's try to figure our what is going on here and how it works.

Take a look first 4 lines of the program. We defined the data section and put there the `msg` constant with the `hello world!` value. Since the constant is defined in the `data` section, it could be used in the code of the program. The next is the declaration of the `text` section and the `_start` entry point of the program. After we will run the program, it will start to execute from the `_start` line.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can introduce bullet points here? Something like:

Look at the first few lines of the program. Here, we define two sections:

  • data section - This is where we place the msg constant with the value hello, world!. Since this constant is in the data section, we can use it in the program's code.
  • text section - This section contains the _start entry point of the program. When you run the program, it will start execution from the _start line.

0xAX added 4 commits November 26, 2024 02:51
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Copy link
Collaborator

@klaudiagrz klaudiagrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestions regarding sub-section naming

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
@0xAX 0xAX merged commit 2eb4bd4 into master Nov 28, 2024
1 check passed
@0xAX 0xAX deleted the chapter-1-update branch November 28, 2024 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants