Giter Site home page Giter Site logo

doricredpanda / yanel Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 25 KB

Yet Another Nasm Educational Library. Functions and macros for input and output written in assembly using just syscalls for Linux (amd64).

License: GNU General Public License v3.0

Makefile 2.57% C 4.26% Assembly 93.16%

yanel's Introduction

YANEL - Yet Another NASM Educational Library
__   __ _    _   _ _____ _
\ \ / // \  | \ | | ____| |
 \ V // _ \ |  \| |  _| | |
  | |/ ___ \| |\  | |___| |___
  |_/_/   \_\_| \_|_____|_____|

	This library provides functions and macros for reading and writing. It's
written in NASM and only uses systemcalls without calling functions from libc.
Linux(amd64) is supported.

	Functions follow System V AMD64 ABI, so it's possible to link yanel.o
as a module and call the functions using other languages (C for example). More
about calling conventions you can read here:
https://github.com/hjl-tools/x86-psABI/wiki/X86-psABI

Usage
1) Functions:
_print_udec - Print unsigned decimal number from first argument. On success,
the number of bytes written is returned.  On error, -1 is returned.
_print_dec - same, but for signed decimal number.
_print_hex - same, but output is hexadecimal.
_print_bin - same, but output is binary.
_get_dec - Read decimal number from stdin and return it.
_get_hex - same but for hexadecimal.
_getchar - read 1 character from stdin with bufferization. On error, -1 is
returned, otherwise the character.
_putchar - print char (first argument) to stdout. On error, -1 is returned,
otherwise number of bytes written. It's not bufferized.
_strlen - returns length of the string ending by '\0'. Address of the first character passed
as first argument. This function is not safe.

2) Macros:

NAME; ARGUMENTS; DESCRIPTION
PRINT_UDEC ; register; Prints unsigned decimal number.
PRINT_DEC ; register; Prints signed decimal number.
PRINT_CHAR ; byte register/Immediate/Memory; Prints character.
PRINT_STRING ; Label; Print string that ends with terminating character.
NEWLINE ; - ; Prints new line symbol.
GET_DEC (GET_HEX) ; register; Places decimal (hexadecimal) integer from stdin
to the argument.
GET_CHAR ; byte register; Read 1 character to the argument
GET_STRING ; Label; Read string from stdin, ends string with '\0'.

yanel's People

Contributors

doricredpanda 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.