acompiled

The catalog contains seeded project examples. Your workspace stores your own projects and conversations.

sizecoders/tunnel256

Public
Star7

A flight down a tunnel of light for DOS, in under 256 bytes. Every pixel asks the x87 for an angle and a depth.

History
36 lines·889 B·NASM Raw Blame
1; tunnel256: a flight down a tunnel of light, for DOS.
2;
3; Target: DOS .COM, 386+, VGA mode 13h (320x200, 256 colours).
4; Build: nasm -f bin tunnel.asm -o tunnel.com
5;
6; No tunnel yet: row xor column, scrolled by the frame counter in BP.
7
8 bits 16
9 cpu 386
10 org 0x100
12start:
13 mov ax, 0x0013 ; 320x200, 256 colours
14 int 0x10
15 push word 0xA000
16 pop es
17 cld
19frame:
20 xor di, di
21pixel:
22 mov ax, di
23 xor dx, dx
24 mov cx, 320
25 div cx ; ax = row, dx = column
26 xor ax, dx
27 add ax, bp
28 stosb
29 cmp di, 64000
32 inc bp ; next frame
33 in al, 0x60 ; Esc has scancode 1
34 dec al
35 jnz frame
36 ret