Skip to content

Instantly share code, notes, and snippets.

@Longlius
Last active December 14, 2015 09:19
Show Gist options
  • Save Longlius/5063783 to your computer and use it in GitHub Desktop.
Save Longlius/5063783 to your computer and use it in GitHub Desktop.
an example of absolute madness for Wes (assembly programming)
ORG 0
START RWD . Read input
STA START . Some men just want to watch the world burn
LDA ZERO . Init ACC to 0
LDX START,2
SQRE LDX START,1 . START = number to square
MULT ADD START . Add START to itself START times
TDX MULT,1 . errbody in the club gettin' tipsy
RSUM TDX CSUM,2 . Decrement ir2. When ir2 == 0, gratz.
WWD . DELICIOUS I/O OM NOM NOM
ZERO HLT . HLT required by assembler. Adam rejects the black arts.
CSUM STX START,2 . START = START - 1
BRU SQRE . Don't forget. You're here forever.
END START
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment