Skip to content

Instantly share code, notes, and snippets.

@learosema
Last active December 30, 2023 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save learosema/bdb688e9fdf4309676e4efb08cb896a4 to your computer and use it in GitHub Desktop.
Save learosema/bdb688e9fdf4309676e4efb08cb896a4 to your computer and use it in GitHub Desktop.
VCCC 2023 x86 assembly

My non-optimized past-deadline attempt for VCCC 2023

  • Author: Lea Rosema
  • Platform: MS-DOS
  • Length Source: 568 bytes
  • Length Code: 83 bytes

Instructions

  • Turn on your vintage computer running DOS or use DOSBox
  • Download NASM for DOS
  • Compile via nasm.exe pattern.asm -fbin -o pattern.com
  • run pattern.com
org 100h
LINES equ 25
COLS equ 40
section .text
entry: mov ax,0x01
int 0x10
mov di, 0xb800
mov es, di
xor di,di
mov ax, 0x1e20
mov cx, LINES * COLS
rep stosw
xor di, di
mov dx,18
loopy: mov cx,18
loopx: mov ax,cx
mul al
mov bx,ax
mov ax,dx
mul al
add bx,3
sub bx,ax
mov ax,bx
mov bx,6
idiv bl
cmp ah,0
jnz skip
mov byte es:[di],'*'
skip: add di,2
dec cx
jns loopx
add di,(COLS-19)*2 ; new line
dec dx
jns loopy
mov ax,0
int 0x16
mov ax,3
int 0x10
int 0x20
section .data
section .bss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment