アセンブラなしでプログラミングするのがつらくなってきたのでプリプロセッサでこんなのを作りました。
#include "osecpu_asm.h"
/* 0から1万までの和を100万回繰り返す */
OSECPU_HEADER(1);
#define sum R00
#define i R01
#define j R02
#define const0 R30
#define const1 R31
#define const10001 R32
#define const1000000 R33
LOADINT(const0, 0);
LOADINT(const1, 1);
LOADINT(const10001, 10001);
LOADINT(const1000000, 1000000);
FOR(0, j, const0); /* label:0, conter:j, init:const0 */
COPYINT(sum, const0);
FOR(1, i, const0);
ADDINT2(sum, i);
NEXT(1, i, const1, const10001); /* label:1, conter:i, step:const1, end:const10001 */
NEXT(0, j, const1, const1000000);
#if 0 /* 以下のように書いてもよい */
COPYINT(j, const0);
LABEL(0);
COPYINT(sum, const0);
COPYINT(i, const0);
LABEL(1);
ADDINT2(sum, i);
ADDINT2(i, const1);
CMPJNE(i, const10001, 1); /* if (i != const10001) goto label_1; */
ADDINT2(j, const1);
CMPJNE(j, const1000000, 0); /* if (j != const1000000) goto label_0; */
#endif