Coder Social home page Coder Social logo

brucehoult / lz4_rv32i_decode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from enthusi/lz4_rv32i_decode

0.0 1.0 0.0 46 KB

LZ4 decoder in assembly for RiscV RV32IC

License: BSD 3-Clause "New" or "Revised" License

Makefile 1.96% Python 17.96% Assembly 80.08%

lz4_rv32i_decode's Introduction

assembly RISCV RV32IC lz4 decoder

lz4 decoder for RISCV RV32I CPUs in assembly language
pointer to packed data in a0 on entry
pointer to depack destination in s0 on entry
used: a1,a2,a3,a4,a5,a6 for compliance with C-extension
size 116 Bytes for RV32IC
168 Bytes for RV32I

Code assumes a 2 byte header (little endian size) and then
the raw compressed BLOCK in lz4 format (up to 64 kB).
Compressed for example with lz4 -12 -B4 and header + tail cropped.
(See Makefile).

Now it is even listed on the official LZ4 page. ;-)
Another bare metal example is here: mandelbrot in under 1kb.

application in bare metal assembler

packedearth.asm is a bare metal assembly example for the Longan Nano.
It displays an lz4 compressed image (160x80) of the earth map in 565 format (25.6 KB).
Total size: 4624 Bytes.
screenshot

The decoder and example code assembles well with the wonderful bronzebeard.

usage

make
make flash

including in own code

You can of course either assemble the source as you need or even simply include the binary 'blob' lz4depack.bin at any arbitrary position (aligned to 16bit with C extention).

The routine uses only relative short jumps and is therefore fully relocatable even in binary form.
It simply requires a0 and s0 to be set before call. a1,a2,a3,a4,a5,a6 are used and NOT saved.

Licensed under the 3-Clause BSD License Copyright 2021, Martin Wendt

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.