Skip to content

Commit

Permalink
Merge pull request #3 from below/main
Browse files Browse the repository at this point in the history
Merge pull request below#42 from skrrb/fix-entrypoint
  • Loading branch information
fengjixuchui authored Jan 10, 2023
2 parents cdf79bb + 9fc970d commit cf34909
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Chapter 01/HelloWorld.s
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
// X16 - Mach System Call function number
//

.global start // Provide program starting address to linker
.global _start // Provide program starting address to linker
.align 2 // Make sure everything is aligned properly

// Setup the parameters to print hello world
// and then call the Kernel to do it.
start: mov X0, #1 // 1 = StdOut
_start: mov X0, #1 // 1 = StdOut
adr X1, helloworld // string to print
mov X2, #13 // length of our string
mov X16, #4 // Unix write system call
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ As [Chapter 10](https://github.com/below/HelloSilicon#chapter-10) focusses on bu

Be aware that the function numbers are not only different, but on Darwin, they are considered private and subject to change.

## Chapter 4: Controlling Programm Flow
## Chapter 4: Controlling Program Flow

Besides the common changes, we face a new issue which is described in the book in Chapter 5: Darwin does not like `LDR X1, =symbol`, it will produce the error `ld: Absolute addressing not allowed in arm64 code`. If we use `ASR X1, symbol`, as suggested in Chapter 3 of the book, our data has to be in the read-only `.text` section. In this sample however, we want writable data.

Expand Down

0 comments on commit cf34909

Please sign in to comment.