Skip to content

Instantly share code, notes, and snippets.

@AdamJHowell
Created December 11, 2018 19:04
Show Gist options
  • Save AdamJHowell/149758060f8b5cb61fc4c34762505d1e to your computer and use it in GitHub Desktop.
Save AdamJHowell/149758060f8b5cb61fc4c34762505d1e to your computer and use it in GitHub Desktop.
A simple example of multi-threading with "mishmoosh".
; threadtest.asm
H .BYT 'H'
e .BYT 'e'
l .BYT 'l'
o .BYT 'o'
space .BYT 32
W .BYT 'W'
r .BYT 'r'
d .BYT 'd'
mutex .INT -1
MAIN LCK mutex
RUN R3 THREAD
TRP 1
RUN R3 THREAD
TRP 1
RUN R3 THREAD
TRP 1
RUN R3 THREAD
TRP 1
ULK mutex
BLK
TRP 0
THREAD LCK mutex
ULK mutex
LDB R3 H
TRP 3
LDB R3 e
TRP 3
LDB R3 l
TRP 3
TRP 3
LDB R3 o
TRP 3
LCK mutex
LDB R3 W
TRP 3
LDB R3 o
TRP 3
LDB R3 r
TRP 3
LDB R3 l
TRP 3
LDB R3 d
TRP 3
ULK mutex
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment