SkillAgentSearch skills...

Sasm

Simple Assembler for SIMPLE Architecture

Install / Use

/learn @ymyzk/Sasm
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

sasm

Build Status Coverage Status PyPI version

Simple Assembler for SIMPLE Architecture

Requirements

  • Python 2.7+
  • Python 3.3+
  • PyPy
  • PyPy3

Installation

  1. git clone https://github.com/ymyzk/sasm.git
  2. cd sasm
  3. pip install .

Assemble

  1. Write .sasm file
  2. sasm -o test.mif test.sasm

Sample

Input .sasm file

option(address_radix, HEX)
option(data_radix, HEX)
option(depth, 4096)

li(r1, 1)
li(r2, 0x10)

label(loop)
  add(r0, r1)
  cmp(r0, r2)
blt(loop)

hlt()

Output .mif file

-- SASM generated Memory Initialization File (.mif)

WIDTH=16;
DEPTH=4096;
ADDRESS_RADIX=HEX;
DATA_RADIX=HEX;

CONTENT BEGIN
         000 : 8101;
         001 : 8210;
         002 : c800;
         003 : d050;
         004 : b9fd;
         005 : c0f0;
         006 : 0000;
         007 : 0000;
         008 : 0000;
         009 : 0000;

See sample files.

Related Skills

View on GitHub
GitHub Stars5
CategoryDevelopment
Updated1y ago
Forks0

Languages

Python

Security Score

70/100

Audited on Dec 26, 2024

No findings