Skip to content

Instantly share code, notes, and snippets.

@adriweb
Last active May 21, 2017 18:27
Show Gist options
  • Save adriweb/94fcb867da2c82f6bcd04803611d3a71 to your computer and use it in GitHub Desktop.
Save adriweb/94fcb867da2c82f6bcd04803611d3a71 to your computer and use it in GitHub Desktop.
llvm test
_main:
call _prgm_cleanup
or a, a
sbc hl, hl
push hl
push hl
call _os_setcursorpos
ld hl, 6
add hl, sp
ld sp, hl
ld hl, _helloworld
push hl
call _os_putstrfull
pop hl
or a, a
sbc hl, hl
push hl
ld hl, 1
push hl
call _os_setcursorpos
ld hl, 6
add hl, sp
ld sp, hl
ld hl, l_.str
push hl
call _os_putstrfull
pop hl
lbb0_1:
call _os_getcsc
cp a, 0
jp z, lbb0_1
jp _prgm_cleanup
_printtext:
push ix
ld ix, 0
add ix, sp
ld e, (ix+9)
push de
ld l, (ix+12)
push hl
call _os_setcursorpos
ld sp, ix
pop ix
jp _os_putstrfull
_printtextsmall:
push ix
ld ix, 0
add ix, sp
pop ix
jp _os_fontdrawtext
segment text
_helloworld:
.asciz "hello world!"
l_.str:
.asciz "welcome to c!"
.extern _os_putstrfull
.extern _os_getcsc
.extern _prgm_cleanup
.extern _os_setcursorpos
.extern _os_fontdrawtext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment