Skip to content

Instantly share code, notes, and snippets.

@chengsun
chengsun / munch.dasm16
Created April 10, 2012 21:55
DCPU-16 munching squares
:loop
set j, 0
:loopn
set y, 0
set i, 0x8000
:loopy
set x, 0
:loopx
xor x, y
set [i], [charoff]
@chengsun
chengsun / README
Created December 17, 2012 18:09
ST f3 discovery usart
You need to recompile newlib with --disable-newlib-supplied-syscalls
If you get a hard fault exception when printf'ing a %d number bigger than 10, you have to re-configure and recompile both gcc and newlib with hard floats:
--with-cpu=cortex-m4
--with-float=hard
--with-fpu=fpv4-sp-d16
--with-mode=thumb
One issue is that printf ignores everything after the first newline you enter in it. so printf("a\nb\n") would only print "a\n". Also, setting the buffer mode seems to make it quite buggy.