Skip to content

Instantly share code, notes, and snippets.

; CRC-16 calculation
; Polynomial x^16 + x^12 + x^5 + 1
; Based on description at https://www.ccsinfo.com/forum/viewtopic.php?t=24977
; Intel 8080 assembly version by Lukas Petru, 2020
; HL points to input data
; DE is CRC
; de=0
LXI D,0
@lukq
lukq / epromgen.jsh
Created February 8, 2020 22:02
Eprom contents generator
//jshell epromgen.jsh >eprom-list.txt
// Generates Eprom contents with basic 4-bit ALU functions.
// Programmed by Lukas Petru, 2020
void main(){
var tableOutput=false;
var s="; Address format: ffff c bbbb aaaa, f is function, c is carry,"+
" b, a are operands"+
"\n; Value format: e l z c rrrr"+
"\n; e is A=B, l is A<B, z is zero flag, c is carry flag, r is result";
@lukq
lukq / lines.htm
Last active October 14, 2019 21:19
Lines animation
<!DOCTYPE html>
<svg width=640 height=400 viewbox=-.5,-.5,320,200 stroke=#000 stroke-width=.71 fill=none style=border:solid>
<path id=g d=''/><use href=#g x=-319 transform=scale(-1,1) /></svg>
<script>
f=[]
s=t=u=v=0
ds=dt=du=dv=-1
,(paint=_=>{
var n=[0,0,0,0]
@lukq
lukq / gist:0e9de4604694b5b5b806602794a3e39d
Created February 8, 2019 18:06
Solving Edge matching tile puzzle and estimating difficulty
50 REM EDGE MATCHING TILE PUZZLE
51 REM SEE WWW.REDDIT.COM/R/DAILYPROGRAMMER #183
52 REM SOLUTION BY LUKZ
53 REM PROGRAM AVAILABLE UNDER MIT LICENSE (EXPAT)
54 REM TESTED ON WWW.CALORMEN.COM/JSBASIC
56 DATA CYMk,CmKm,cKyM,cYkY,CMky,ckyM,CYMK,CMKy,CkmY
63 REM COLORS, 8 CHARACTERS (4 COLORS X 2 VARIANTS)
64 REM MATCHING PAIRS MUST BE NESTED (I.E. Xx INSIDE Y..y)
@lukq
lukq / GenDsk800.htm
Created January 25, 2017 09:44
CP/M dsk generator for Sharp MZ-800
<!DOCTYPE html>
<title>Gen Dsk 800</title>
<style>
body{font:caption}
input{margin-top:.3em}
td{padding:0 .5em 0 0}
#all{color:#666}
</style>
<div style="float:left;padding:2px 3px;border:.8px solid">