Captured straight from the compiled binary. Slowed down for legibility.
please create dos intro in asm with binary size <= 256b that renders animated walking 3d flat-shaded spiders possibly with shadow and orthographic/isometric view
can you use some tricks to make legs appear thicker and flat-shaded too and some blinking eyes if you have space, and optionally also specular to make it pop
can it go in a loop left to right and right to left ? and at some point start shooting laser towards the camera? figure out the tricks to pack it, golf some existing code, you can do it
can you now generate full 20s gif and generate website showing this gif and describing key prompts I gave you and link to final asm result
; ARACHNO - 256-byte DOS intro (.COM, mode 13h)
; Flat-shaded spider pacing left-right-left, side-lit 2x2px legs,
; faceted body, specular, blinking eyes - and it fires a red laser
; cone toward the camera each time it crosses the center.
; Renders direct to VRAM; specify ~10000+ cycles in DOSBox (avoids tearing).
; One triangle-wave routine drives position, gait, foot lift (quadrature
; sample at x+8) and even the body silhouette. No data tables.
; release: nasm -f bin arachno.asm -o arachno.com
; debug : nasm -f bin -DDBG arachno.asm -o adbg.com
; (renders to a back buffer, appends every frame to ALL.BIN,
; exits after exactly one 256-frame patrol cycle)
org 100h
t equ 300h ; frame counter, scratch RAM past program image
hdl equ 302h ; debug-only: ALL.BIN file handle
start:
mov al,13h ; AX=0 at COM entry -> mode 13h
int 10h
%ifndef DBG
push 0a000h
pop es
%else
xor ax,ax
mov [t],ax ; explicit zero-init (debug only, size-free)
mov ah,3ch ; create ALL.BIN once, up front
xor cx,cx
mov dx,fname
int 21h
mov [hdl],ax
%endif
main:
%ifdef DBG
mov ax,cs ; back buffer segment = CS+1000h (DS stays = CS)
add ah,10h
mov es,ax
%else
mov dx,3dah ; wait for vertical retrace
.vs:in al,dx
test al,8
jz .vs
%endif
; --- ping-pong position: x = 160 + tri(T), spans 96..224 ---
inc word [t]
mov ax,[t]
call tri
add ax,160
xchg bp,ax
; --- background: black sky + gray ground ---
xor di,di
mov cx,16000
xor ax,ax
push cx
rep stosw
pop cx
mov ax,1414h
rep stosw
; --- 8 legs, 2x2px, lit from the left ---
mov cl,8
.lg:
imul si,cx,9 ; si = 9*i
lea ax,[bp+si+8]
call tri8 ; lift wave = stride wave of x+8 (quadrature)
mov bl,56 ; bh is 0 here (shin countdown / body loop)
sub bx,ax ; bx = shin length 48..64 (elliptical foot path)
lea ax,[bp+si]
call tri8 ; stride wave -8..8
add si,ax
lea si,[bp+si-40] ; si = knee/foot x
call thigh ; (kneex,88)->(bodyx,108)
lea di,[si+88*320] ; shin: vertical drop knee->foot
mov ax,181ah ; left column lit, right dark
.sh:stosw
add di,318
dec bx
jnz .sh
loop .lg
; --- body: flat-shaded octagon, lit cap over dark belly ---
mov bl,98 ; bh is 0 after the shin countdown
.bd:
mov al,bl
add al,22
call tri ; -> |y-106| - 64
neg ax
sub ax,47 ; half-width = 17-|y-106|
imul di,bx,320
add di,bp
sub di,ax
mov cx,ax
shl cx,1
mov al,27 ; lit facet
cmp bx,103
jb .f
mov al,22 ; dark facet
.f: rep stosb
inc bx
cmp bx,115
jnz .bd
; --- blinking eyes (closed while x & 38h == 0) ---
test bp,38h
jz .ns
lea di,[bp+101*320-3]
xor ax,ax ; black
stosw
inc di
inc di
stosw
.ns:
; --- specular strip on the lit cap ---
lea di,[bp+99*320-2]
mov ax,1f1fh ; white
stosw
stosw
; --- laser cone toward the camera while crossing the center ---
mov ax,bp
sub ax,144
cmp ax,32 ; fire while 144 <= x < 176
jae .nl
mov si,96
mov al,12 ; red
.cl:
imul di,si,319 ; row = 103+si, left edge = bp-si
lea di,[bp+di+32960]
mov cx,si
shl cx,1
rep stosb
dec si
jnz .cl
.nl:
%ifdef DBG
mov bx,[hdl] ; append this frame to the already-open ALL.BIN
push es
pop ds ; back buffer = data source
xor dx,dx
mov cx,64000
mov ah,40h
int 21h
push cs
pop ds
cmp byte [t],0 ; wrapped -> one full 256-frame cycle captured
jnz main
mov bx,[hdl]
mov ah,3eh
int 21h
int 20h
fname: db 'ALL.BIN',0
%else
jmp main
%endif
tri8: ; ax=v -> tri(v*8)/8 = -8..8
shl ax,3
call tri
sar ax,3
ret
tri: ; al=phase -> ax = triangle wave -64..64
sub al,128
jns .k
neg al
.k: sub al,64
cbw
ret
thigh: ; row-DDA line (si,88)->(bp,108), 2x2px side-lit
pusha
sub bp,si
imul bp,bp,13
sar bp,1 ; x step 9.7 (dx*6.5 ~ dx*128/20)
shl si,7 ; x accumulator
mov bx,88*320 ; row offset
mov cl,20
mov ax,181ah ; left column lit, right dark
.t: mov di,si
shr di,7
add di,bx
stosw
add di,318
stosw
add si,bp
add bx,320
loop .t
popa
ret