Top Tweets for #commandlinetools
I am addicted to micro optimizations so here is one:
This program gets a number and prints the HEX value:
```
; Compilation command (on Mac): TAHOE 26.1
; nasm -f macho64 mac_output.asm -o mac_output.o
; Or with debug info:
; nasm -f macho64 -g -F dwarf mac_output.asm -o mac_output.o
; Linking command (on Mac):
; ld -macos_version_min 10.7.0 -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem -o mac_output mac_output.o
global _main
section .data
codes: db '0123456789ABCDEF'
section .text
_main:
; number 1122... in hexadecimal format
mov rax, 0x1122334455667788
mov rdi, 1
mov rdx, 1
mov rcx, 64
; Each 4 bits should be output as one hexadecimal digit
; Use shift and bitwise AND to isolate them
; the result is the offset in 'codes' array
.loop:
push rax
sub rcx, 4
shr rax, cl
and rax, 0xf
; This is for MAC. On Unix I can do: lea rsi, [codes + rax]
lea rsi, [rel codes]
add rsi, rax
mov rax, 0x2000004 ;1 in unix
; syscall leaves rcx and r11 changed
push rcx
syscall
mov rdx, 1 ; The write syscall clobbered also rdx on mac
pop rcx
pop rax
; test can be used for the fastest 'is it a zero?' check
; see docs for 'test' command
test rcx, rcx
jnz .loop
mov rax, 0x2000001 ; 60 ; invoke 'exit' system call
xor rdi, rdi
syscall
```
But it has issues:
It constantly pushes and pops from the stacks rax, and it emits about 16 write syscalls. Not to mention the constantly pushing and poping of registers that get clobbered after the write syscall.
How to Monitor Remote Linux Systems with Glances #MonitoringTools #commandlinetools #linuxmonitoring https://t.co/VtdlZ0R6fi
6 Useful Tools to Remember Linux Commands Forever #LinuxCommands #commandlinetools #LinuxTricks https://t.co/8z1NkJbS3l
GPG - Encrypt and Decrypt Files with a Key on Linux. https://t.co/ZvvRJI7kzl This guide shows how to generate a GPG key pair, import & export keys, and encrypt & decrypt a file using GPG in Linux systems.... #CommandlineTools #EncryptionTools #Linuxsystems
Last Seen Hashtags on Sotwe
Trends for you
Most Popular Users

Elon Musk 
@elonmusk
239.3M followers

Barack Obama 
@barackobama
118.5M followers

Cristiano Ronaldo 
@cristiano
114.3M followers

Donald J. Trump 
@realdonaldtrump
111.7M followers

Narendra Modi 
@narendramodi
106.9M followers

Rihanna 
@rihanna
98.6M followers

NASA 
@nasa
92M followers

Justin Bieber 
@justinbieber
91.7M followers

KATY PERRY 
@katyperry
89.9M followers

Taylor Swift 
@taylorswift13
83.9M followers

Lady Gaga 
@ladygaga
75.4M followers

Virat Kohli 
@imvkohli
73.3M followers

Kim Kardashian 
@kimkardashian
70.8M followers

YouTube 
@youtube
68.6M followers

Neymar Jr 
@neymarjr
66.3M followers

Bill Gates 
@billgates
65.1M followers

Selena Gomez 
@selenagomez
63M followers

The Ellen Show
@theellenshow
62.1M followers

CNN 
@cnn
61.6M followers

X 
@x
60.6M followers


