Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
michidk
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
michidk
2y ago
okay, I didn't know that, thanks for the background. I wonder why the assembler would not optimize this though. I noticed that I then could also shave of one byte more by using lea esi, [rel msg] instead of lea rsi, [rel msg].
32.
▲
by
michidk
2y ago
Such a great explanation. Wish I would have had something like this back in my gamedev days.
33.
▲
by
michidk
2y ago
I think your statement might only apply to 32 bit (one of the constraints mentioned early in the blog post was 64 bit). But even if it was 32 bit, then we would't have to copy a 1, since the syscall number for sys_write would be 4 inst
34.
▲
by
michidk
2y ago
should be ... push 1 ; syscall: sys_write pop rax push 1 pop rdi of course
35.
▲
by
michidk
2y ago
Of course - you are completely right, an oversight in wanting to correct my mistake as quickly as possible. With that fixed, is there any reason not to use push here?
36.
▲
by
michidk
2y ago
Yeah I thought sth like this is possible, but (correct me if I'm wrong) this (ab)uses the ELF header and punts data in there, which goes against my requirement > It should be a ‘proper‘ executable binary according to the spec
37.
▲
by
michidk
2y ago
Hehe a nice idea. But then it would not always print Hello World and you cannot execute it directly.
38.
▲
by
michidk
2y ago
I was able to shave off one additional byte with this: ... xor rax, rax ; = 0 inc rax ; = 1 - syscall: sys_write mov rdi, rax ; copy 1 - file descriptor: stdout lea rsi, [rel msg] ; pointer to message mo
39.
▲
by
michidk
2y ago
Thanks, that makes total sense. I was so focused on the ELF part that I didn't even consider optimizing the initial assembly further. Will fix it and edit the article.
40.
▲
The smallest Hello World program
(blog.lohr.dev)
76 points
by
michidk
2y ago
|
49 comments
41.
▲
Talking to your mailserver is not as hard as you think
(blog.lohr.dev)
6 points
by
michidk
2y ago
|
2 comments
42.
▲
by
michidk
2y ago
A short introduction to the IMAP protocol.
43.
▲
Ask HN: Do you backup your Emails?
32 points
by
michidk
2y ago
|
76 comments
44.
▲
by
michidk
2y ago
There are actually IDE plugins which perform 'semantic line wrapping'. But that is besides the point. Of course, it can make sense to add manual line wraps, especially if the developer intends to make his intentions clearer by us
45.
▲
Are character count line limits stupid?
(blog.lohr.dev)
2 points
by
michidk
2y ago
|
3 comments
46.
▲
Embedded TypeScript on a ESP32
(blog.lohr.dev)
1 points
by
michidk
2y ago
|
0 comments
47.
▲
Embedded Rust in Production?
(blog.lohr.dev)
205 points
by
michidk
2y ago
|
287 comments
48.
▲
Reverse engineering Microsoft's dev container CLI (2023)
(blog.lohr.dev)
1 points
by
michidk
2y ago
|
0 comments
49.
▲
by
michidk
2y ago
It would perfectly if you enable line wrapping, which is basically a dynamic client-side character line limit!
50.
▲
Show HN: The Case Against Character Count Line Limit
(blog.lohr.dev)
2 points
by
michidk
2y ago
|
3 comments
51.
▲
German post office launches post stamp NFT
(deutschepost.de)
1 points
by
michidk
2y ago
|
0 comments
52.
▲
by
michidk
2y ago
https://github.com/michidk/vscli It allows me to launch vscode projects and devcontainers I often work on very quickly. Saves me so much time!
53.
▲
HashiCorp 2024 State of Cloud Strategy Survey Results
(hashicorp.com)
1 points
by
michidk
2y ago
|
0 comments
54.
▲
Show HN: The first 5 minutes on a Linux Server
(blog.lohr.dev)
6 points
by
michidk
2y ago
|
0 comments
55.
▲
by
michidk
2y ago
And I want it to be able to handle lots of connections. One server might not be enough, so it needs to scale. The process could also take a while, so I need a queue. Yeah I could setup, AWS API Gateway, SQS, ECS with Autoscaling etc. But th
56.
▲
Ask HN: Is there a service to quickly build APIs from Docker containers?
1 points
by
michidk
2y ago
|
3 comments
57.
▲
Embedded TypeScript: Hosting a Front End on a ESP32 with Rust
(blog.lohr.dev)
14 points
by
michidk
3y ago
|
3 comments
58.
▲
by
michidk
3y ago
https://www.reuters.com/world/us/16-mile-bridge-baltimore-co...
59.
▲
by
michidk
3y ago
I turned it on.
60.
▲
Show HN: Embedded TypeScript: Hosting a Front End on a ESP32 with Rust
(blog.lohr.dev)
2 points
by
michidk
3y ago
|
0 comments
More ›