Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ismael Venegas Castelló Ismael-VC

🎯
Focusing
View GitHub Profile
@Ismael-VC
Ismael-VC / fib-seq.tal
Created Jun 28, 2022
8-bit fibonacci sequence
View fib-seq.tal
%CALL { JSR2 }
%RTN { JMP2r }
%NOT { #01 EOR }
%DEBUG { #01 #0e DEO }
|0100 @main
#00
&while
DUPk
#0d GTH NOT ,&body JCN
@Ismael-VC
Ismael-VC / fib.tal
Created Jun 27, 2022
8-bit fibonacci in Uxntal.
View fib.tal
%CALL { JSR2 }
%RTN { JMP2r }
%NOT { #01 EOR }
%DEBUG { #01 #0e DEO }
|0100
( DEBUG )
#0d ;fib CALL
#e9 EQU
BRK
@Ismael-VC
Ismael-VC / pong.tal
Created Jun 26, 2022
Pong in Uxntal
View pong.tal
( pong.tal )
( devices )
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|20 @Screen [ &vector $2 &width $2 &height $2 &auto $1 &pad $1
&x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ]
|80 @Controller [ &vector $2 &button $1 &key $1 ]
( macros )
%RTN { JMP2r }
@Ismael-VC
Ismael-VC / spr.tal
Last active Jun 21, 2022
SPR Uxntal Macro
View spr.tal
(
SPR - Display a sprite to the screen.
Arguments:
@sprite (label)
x* (short) x coordinate
y* (short) y coordinate
mode (byte) display mode
View snake-top-bottom.tal
(
uxnasm projects/examples/demos/snake.tal bin/snake.rom && uxnemu bin/snake.rom
)
%CALL { JMP2 }
%+ { ADD } %- { SUB } %* { MUL } %/ { DIV }
%< { LTH } %> { GTH } %= { EQU } %! { NEQ }
%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
View snake.tal
(
uxnasm projects/examples/demos/snake.tal bin/snake.rom && uxnemu bin/snake.rom
)
%CALL { JMP2 }
%+ { ADD } %- { SUB } %* { MUL } %/ { DIV }
%< { LTH } %> { GTH } %= { EQU } %! { NEQ }
%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
@Ismael-VC
Ismael-VC / uxn64.c
Created Dec 18, 2021
Uxn 64x64 Icon
View uxn64.c
/* GIMP RGBA C-Source image dump (uxn64.c) */
static const struct {
unsigned int width;
unsigned int height;
unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
unsigned char pixel_data[64 * 64 * 4 + 1];
} uxn64 = {
64, 64, 4,
"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
View Julieta-mock.jl
_
_ _ _(_)_ _ | Un nuevo enfoque para la computación técnica
(_) | (_) (_)| | | Documentación: http://docs.julialang.es.org
_ _ _| |_ ___| |_ __ _ | Tecleé "?ayuda" para la ayuda.
| | | | | | |/ _ \ __| _' | |
| | |_| | | | __/ || (_| | | Versión 1.0 (201?-??-?? ??:?? UTC)
_/ |\__'_|_|_|\___|_| \__'_| | Commit ??????? (? días detrás de master)
|__/ | x86_64-w64-mingw32
View hello_world.tal
%EMIT { #18 DEO }
( init )
|0100 @program
;hello-word
&loop
( send ) LDAk EMIT
View uxn_extended_opcodes.jl
# more opcodes above...
function SFT(c::CPU, k::Bool, m::BytSht, r::Bool)::CPU
setmod(c, r, k)
a = pop(c.src, k, UInt8)
b = pop(c.src, k, m)
push(c.src, b >> (a & 0x0f) << ((a & 0xf0) >> 4))
end