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.

First light: mode 13h and an XOR pattern

Browse files
isoldecommitted first commit commit 6309eef73439971e4e1ac2432f1ca7eb6a7edf91
failing 1 step in 1 ms
3 files changed +59−0
added README.md +9−0
@@ -0,0 +1,9 @@
1+# tunnel256
2+
3+A flight down a tunnel of light for DOS, in under 256 bytes. So far the flight is a scrolling XOR pattern.
4+
5+```
6+nasm -f bin tunnel.asm -o tunnel.com
7+```
8+
9+Esc leaves.
added acompiled.toml +14−0
@@ -0,0 +1,14 @@
1+# Verified builds for tunnel256. The intro has to fit in 256 bytes.
2+
3+[project]
4+isa = "x86-16"
5+assembler = "nasm"
6+target = "DOS .COM, 386 with x87, VGA mode 13h"
7+
8+[[step]]
9+name = "assemble"
10+run = ["nasm", "-f", "bin", "-o", "build/tunnel.com", "tunnel.asm"]
11+
12+[artifact]
13+path = "build/tunnel.com"
14+max_size = 256
added tunnel.asm +36−0
@@ -0,0 +1,36 @@
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
11+
12+start:
13+ mov ax, 0x0013 ; 320x200, 256 colours
14+ int 0x10
15+ push word 0xA000
16+ pop es
17+ cld
18+
19+frame:
20+ xor di, di
21+pixel:
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
30+ jb pixel
31+
32+ inc bp ; next frame
33+ in al, 0x60 ; Esc has scancode 1
34+ dec al
35+ jnz frame
36+ ret