{"id":15594074,"url":"https://github.com/rodolfobandeira/assembly-linux-studies","last_synced_at":"2025-06-20T20:39:47.401Z","repository":{"id":83795650,"uuid":"63026993","full_name":"rodolfobandeira/assembly-linux-studies","owner":"rodolfobandeira","description":null,"archived":false,"fork":false,"pushed_at":"2017-12-08T02:30:38.000Z","size":4,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T06:28:49.259Z","etag":null,"topics":["assembly","nasm","ubuntu"],"latest_commit_sha":null,"homepage":null,"language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rodolfobandeira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-11T01:25:43.000Z","updated_at":"2018-06-06T23:09:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"3861d154-3ff4-44b5-90c3-056c55cefd8a","html_url":"https://github.com/rodolfobandeira/assembly-linux-studies","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rodolfobandeira/assembly-linux-studies","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodolfobandeira%2Fassembly-linux-studies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodolfobandeira%2Fassembly-linux-studies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodolfobandeira%2Fassembly-linux-studies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodolfobandeira%2Fassembly-linux-studies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rodolfobandeira","download_url":"https://codeload.github.com/rodolfobandeira/assembly-linux-studies/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rodolfobandeira%2Fassembly-linux-studies/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261013844,"owners_count":23097120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assembly","nasm","ubuntu"],"created_at":"2024-10-03T00:23:16.434Z","updated_at":"2025-06-20T20:39:42.381Z","avatar_url":"https://github.com/rodolfobandeira.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### Assembly Linux Studies (64 bits arquitecture)\n\n`nasm -f elf64 -o nasm_64_bits_hello_world.o nasm_64_bits_hello_world.asm`\n\n`ld -o nasm_64_bits_hello_world nasm_64_bits_hello_world.o`\n\n\n```\nsection .data\n    msg db 'Rodolfo Bandeira', 0xA  ; our string\n    len equ $ - msg                 ; length of our string\n\nsection .text\n    global _start\n; -----------------------------------------\n; 64 bit registers:\n; -----------------------------------------\n; rax, rbx, rcx, rdx,\n; rsi, rdi,\n; rsp,\n; r8, r9, r10, r11, r12, r13, r14, r15, r16\n; -----------------------------------------\n;\n; We're going to use the system call bellow:\n; ssize_t sys_write(unsigned int fd, const char * buf, size_t count)\n;\n; This is the registers used for the parameters\n; -------------------------------------------------------------------------------\n; System Call    |          rdi        |         rsi         |        rdx       |\n; -------------------------------------------------------------------------------\n; sys_write (1)  |   unsigned int fd   |   const char *buf   |   size_t count   |\n; sys_exit (60)  |   int error_code    |                     |                  |\n; -------------------------------------------------------------------------------\n_start:\n    mov     rax, 0x01              ; system call number (sys_write)\n    mov     rdi, 0x01              ; file descriptor\n    mov     rsi, msg               ; message\n    mov     rdx, len               ; message length\n    syscall                        ; call kernel\n\n    mov     rax, 0x3C              ; system call (sys_exit) 60 = 0x3C\n    mov     rdi, 0x00              ; 0 means no error\n    syscall                        ; call kernel\n\n\n; To compile:\n;\n; nasm -f elf64 -o nasm_64_bits_hello_world.o nasm_64_bits_hello_world.asm\n; ld -o nasm_64_bits_hello_world nasm_64_bits_hello_world.o\n; ./nasm_64_bits_hello_world\n```\n\n\n#### Reference:\n\n- http://0xax.blogspot.ca/2014/08/say-hello-to-x64-assembly-part-1.html\n- Free Assembly 64 bits + Ubuntu E-book: http://www.egr.unlv.edu/~ed/x86.html\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodolfobandeira%2Fassembly-linux-studies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodolfobandeira%2Fassembly-linux-studies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodolfobandeira%2Fassembly-linux-studies/lists"}