Git Product home page Git Product logo

libasm's Introduction

libasm

Title libasm

Photo by Andreas M on Unsplash

Tiny library written on assembly language

Includes:

And tests: main.c

Install

git clone https://github.com/kukinpower/libasm.git && cd

make

Compile and run with tests: make main

Research

x86-64 64bit Registers: Usage Conventions

rax     ; Return value
rbx     ; Callee saved
rcx     ; Arg 4
rdx     ; Arg 3
rsi     ; Arg 2
rdi     ; Arg 1
rsp     ; Stack ptr
rbp     ; Callee saved
r8      ; Arg 5
r9      ; Arg 6
r10     ; Caller saved
r11     ; Caller saved
r12     ; Callee saved
r13     ; Callee saved
r14     ; Callee saved
r15     ; Callee saved

Jumps

jmp     ; Unconditional Jump
je      ; Jump if Equal
jne     ; Jump if Not Equal
jg      ; Jump if Greater
jge     ; Jump if Greater or Equal
ja      ; Jump if Above (unsigned comparison)
jae     ; Jump if Above or Equal (unsigned comparison)
jl      ; Jump if Lesser
jle     ; Jump if Less or Equal
jb      ; Jump if Below (unsigned comparison)
jz      ; Jump if Zero
jnz     ; Jump if Not Zero
jc      ; Jump if carry set (C == 1)
jnc     ; Jump if carry is not set (C == 0)

Little endian and big endian
Little endian and big endian

Скриншот книги Введение в программирование, Столяров.

NASM Tutorial

x86_64 NASM Assembly Quick Reference ("Cheat Sheet")

strlen() implementation in NASM

Difference between JE/JNE and JZ/JNZ

Assembly - Conditions

Mac OS X 64 bit Assembly System Calls

How to compile assembly code

nasm -f macho64 hello.s
ld -e start -macosx_version_min 10.13.0 -static -o hello hello.o
./hello

libasm's People

Contributors

imgbotapp avatar romanwrites avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.