GSP COFF Assembler, Version 2.00, 87.300 Sun Oct 18 03:15:05 2026 (c) Copyright 1985, 1987, Texas Instruments Inc. PAGE 1 0001 ; blinkpc.asm -- resident blink that draws AFTER the st 0002 ; 0003 ; Hook: the firmware's DI RAM trampoline at bit 00000DB 0004 ; (RLONG(0xFFFFFEA0) = 00000DB0h, stub `JA 3F7146D0h`). 0005 ; 0006 ; entry saves the interrupt's saved PC, replaces i 0007 ; tail-jumps to the stock handler 3F7146D0h; 0008 ; ret_hook runs when the stock handler `reti`s, draws 0009 ; to the original PC with `rets 2` (the 2 sk 0010 ; slot and keeps the interrupted stack balan 0011 ; 0012 ; Drawing after the handler matters: a draw before it i 0013 ; own screen work (measured: blink.asm counter runs, no 0014 ; 0015 ; Box: framebuffer (256,400), 64x64, white Terminal Man 0016 ; State toggles every 0014h invocations (~20 frames at 0017 ; 0018 ; Linked at bit 01840000h by dwt/visual/build.sh. 0019 0020 00000000 .text 0021 00000000 _start: ; install, called by rdebug `jump` 0022 00000000 01E0 pushst 0023 00000010 0360 dint 0024 00000020 0540 setf 32, 0, 0 0025 00000030 09E0 movi entry, a0, L 00000040 000001F0' 0026 00000060 0580 move a0, @00000DC0h, 0 00000070 00000DC0 0027 00000090 0550 setf 16, 0, 0 0028 000000A0 09E0 movi 0C080h, a0, L 000000B0 0000C080 0029 000000D0 0580 move a0, @00000DB0h, 0 000000E0 00000DB0 0030 00000100 4400 sub a0, a0 0031 00000110 0580 move a0, @01840E00h, 0 ; counter 00000120 01840E00 0032 00000140 0580 move a0, @01840E10h, 0 ; state (0 = black) 00000150 01840E10 0033 00000170 09E0 movi 0Ah, a0, L 00000180 0000000A 0034 000001A0 0580 move a0, @01840E30h, 0 ; skip the first 10 DI entries 000001B0 01840E30 0035 000001D0 01C0 popst 0036 000001E0 0960 rets 0037 0038 ; ---- entry: point the interrupt's return at ret_hook, 0039 000001F0 entry: 0040 000001F0 0780 move a0, @01840E60h, 1 ; save interrupted a0 00000200 01840E60 0041 00000220 0550 setf 16, 0, 0 0042 00000230 05A0 move @01840E30h, a0, 0 ; settle counter 00000240 01840E30 0043 00000260 0B40 cmpi 0, a0 00000270 FFFF 0044 00000280 CA0B jreq active 0045 00000290 1420 dec a0 GSP COFF Assembler, Version 2.00, 87.300 Sun Oct 18 03:15:05 2026 (c) Copyright 1985, 1987, Texas Instruments Inc. PAGE 2 0046 000002A0 0580 move a0, @01840E30h, 0 000002B0 01840E30 0047 000002D0 0740 setf 32, 0, 1 0048 000002E0 07A0 move @01840E60h, a0, 1 000002F0 01840E60 0049 00000310 C080 jauc 3F7146D0h ; still settling: stock handler only 00000320 3F7146D0 0050 00000340 active: 0051 00000340 0740 setf 32, 0, 1 0052 00000350 B7E0 move *sp(020h), a0, 1 ; saved PC (SP -> ST, +20h -> PC 00000360 0020 0053 00000370 0780 move a0, @01840E20h, 1 ; orig_pc 00000380 01840E20 0054 000003A0 09E0 movi ret_hook, a0, L 000003B0 00000450' 0055 000003D0 B20F move a0, *sp(020h), 1 000003E0 0020 0056 000003F0 07A0 move @01840E60h, a0, 1 00000400 01840E60 0057 00000420 C080 jauc 3F7146D0h ; stock OS display handler 00000430 3F7146D0 0058 0059 ; ---- ret_hook: after the stock handler, draw, then re 0060 00000450 ret_hook: 0061 00000450 0360 dint ; first instruction: close the reti->hook race 0062 00000460 098F mmtm sp, a0,a1,a2,a3,a4,a5 ; field-independent A-reg s 00000470 FC00 0063 00000480 0180 getst a0 0064 00000490 0740 setf 32, 0, 1 0065 000004A0 0780 move a0, @01840E40h, 1 ; interrupted ST 000004B0 01840E40 0066 0067 000004D0 0550 setf 16, 0, 0 0068 000004E0 0740 setf 32, 0, 1 0069 000004F0 05A0 move @01840E00h, a0, 0 00000500 01840E00 0070 00000520 1020 inc a0 0071 00000530 0580 move a0, @01840E00h, 0 00000540 01840E00 0072 00000560 0B40 cmpi 0014h, a0 00000570 FFEB 0073 00000580 CB10 jrne draw 0074 00000590 4400 sub a0, a0 0075 000005A0 0580 move a0, @01840E00h, 0 000005B0 01840E00 0076 000005D0 05A1 move @01840E10h, a1, 0 000005E0 01840E10 0077 00000600 0B41 cmpi 0, a1 00000610 FFFF 0078 00000620 CB02 jrne was_white 0079 00000630 1821 movk 1, a1 0080 00000640 C001 jruc set_state 0081 00000650 was_white: 0082 00000650 4421 sub a1, a1 0083 00000660 set_state: 0084 00000660 0581 move a1, @01840E10h, 0 GSP COFF Assembler, Version 2.00, 87.300 Sun Oct 18 03:15:05 2026 (c) Copyright 1985, 1987, Texas Instruments Inc. PAGE 3 00000670 01840E10 0085 0086 00000690 draw: 0087 00000690 05A1 move @01840E10h, a1, 0 000006A0 01840E10 0088 000006C0 0B41 cmpi 0, a1 000006D0 FFFF 0089 000006E0 CB02 jrne pat_white 0090 000006F0 4442 sub a2, a2 0091 00000700 C003 jruc pat_ready 0092 00000710 pat_white: 0093 00000710 09E2 movi 0FFFFh, a2, L 00000720 0000FFFF 0094 00000740 pat_ready: 0095 00000740 09E3 movi 04064100h, a3, L 00000750 04064100 0096 00000770 09E4 movi 64, a4, L 00000780 00000040 0097 000007A0 09E5 movi 4, a5, L 000007B0 00000004 0098 000007D0 drow: 0099 000007D0 4CA1 move a5, a1 0100 000007E0 dword: 0101 000007E0 9043 move a2, *a3+, 0 0102 000007F0 3C41 dsjs a1, dword 0103 00000800 0B03 addi 03C0h, a3 00000810 03C0 0104 00000820 3CC4 dsjs a4, drow 0105 0106 ; restore the A registers (field 1 is still 32) 0107 00000830 09AF mmfm sp, a0,a1,a2,a3,a4,a5 00000840 003F 0108 ; leave with [ST][orig_pc] and the temporary a0 slot s 0109 00000850 0740 setf 32, 0, 1 0110 00000860 098F mmtm sp, a0 ; a0 slot at S-20h 00000870 8000 0111 00000880 07A0 move @01840E20h, a0, 1 ; orig_pc 00000890 01840E20 0112 000008B0 A20F move a0, -*sp, 1 ; orig_pc at S-40h 0113 000008C0 B7E0 move *sp(020h), a0, 1 ; restore a0 from S-20h 000008D0 0020 0114 000008E0 07A0 move @01840E40h, a0, 1 ; interrupted ST (temporarily i 000008F0 01840E40 0115 00000910 A20F move a0, -*sp, 1 ; ST at S-60h 0116 00000920 B7E0 move *sp(040h), a0, 1 ; restore a0 from S-20h 00000930 0040 0117 00000940 01C0 popst ; restore interrupted ST/IE 0118 00000950 0962 rets 2 ; pop orig_pc, skip the a0 slot 0119 .end No Errors, No Warnings