From a73c014ba02106fa8af05f8dc3412392df2a977a Mon Sep 17 00:00:00 2001 From: Ry Date: Sun, 26 May 2024 22:56:14 -0700 Subject: [PATCH] tcc: Initial commit --- README.md | 1 + boot/tcc.asm | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 boot/tcc.asm diff --git a/README.md b/README.md index 9b88af3..3ce0e00 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # fox32 Demos and Tutorials + - [boot](boot) - bootable demo programs - [demos](demos) - demo programs - [tutorials](tutorials) - getting started tutorials - [cputest](cputest) - CPU test suite diff --git a/boot/tcc.asm b/boot/tcc.asm new file mode 100644 index 0000000..d9826f2 --- /dev/null +++ b/boot/tcc.asm @@ -0,0 +1,29 @@ +; tiny code christmas in fox32 assembly. draws a little pattern to the screen +; run this as a boot sector (i.e. pass to fox32 as a bootable disk) + + opton + org 0x00000800 + + mov r11, 479 ; Y counter +y_loop: + mov r10, 639 ; X counter +x_loop: + mov r0, r10 + mov r1, r11 + add r1, 16 + mov r2, r10 + xor r2, r11 + rem r2, 3 + mul r2, 128 + or r2, 0xFF000000 + call [0xF004201C] ; draw_pixel_to_background + dec r10 + ifnz rjmp x_loop + dec r11 + ifnz rjmp y_loop + + rjmp 0 + + ; bootable magic bytes + org.pad 0x000009FC + data.32 0x523C334C