Files

160 lines
6.7 KiB
Plaintext

GSP COFF Assembler, Version 2.00, 87.300 Sun Oct 18 03:19:02 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 00000190'
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, @01840800h, 0 ; counter
00000120 01840800
0032 00000140 0580 move a0, @01840810h, 0 ; state (0 = black)
00000150 01840810
0033 00000170 01C0 popst
0034 00000180 0960 rets
0035
0036 ; ---- entry: point the interrupt's return at ret_hook,
0037 00000190 entry:
0038 00000190 0780 move a0, @01840860h, 1 ; save interrupted a0
000001A0 01840860
0039 000001C0 0740 setf 32, 0, 1
0040 000001D0 B7E0 move *sp(020h), a0, 1 ; saved PC (SP -> ST, +20h -> PC
000001E0 0020
0041 000001F0 0780 move a0, @01840820h, 1 ; orig_pc
00000200 01840820
0042 00000220 09E0 movi ret_hook, a0, L
00000230 000002D0'
0043 00000250 B20F move a0, *sp(020h), 1
00000260 0020
0044 00000270 07A0 move @01840860h, a0, 1
00000280 01840860
GSP COFF Assembler, Version 2.00, 87.300 Sun Oct 18 03:19:02 2026
(c) Copyright 1985, 1987, Texas Instruments Inc.
PAGE 2
0045 000002A0 C080 jauc 3F7146D0h ; stock OS display handler
000002B0 3F7146D0
0046
0047 ; ---- ret_hook: after the stock handler, draw, then re
0048 000002D0 ret_hook:
0049 000002D0 098F mmtm sp, a0,a1,a2,a3,a4,a5 ; field-independent A-reg s
000002E0 FC00
0050 000002F0 0180 getst a0
0051 00000300 0740 setf 32, 0, 1
0052 00000310 0780 move a0, @01840840h, 1 ; interrupted ST
00000320 01840840
0053 00000340 0360 dint
0054
0055 00000350 0550 setf 16, 0, 0
0056 00000360 0740 setf 32, 0, 1
0057 00000370 05A0 move @01840800h, a0, 0
00000380 01840800
0058 000003A0 1020 inc a0
0059 000003B0 0580 move a0, @01840800h, 0
000003C0 01840800
0060 000003E0 0B40 cmpi 0014h, a0
000003F0 FFEB
0061 00000400 CB10 jrne draw
0062 00000410 4400 sub a0, a0
0063 00000420 0580 move a0, @01840800h, 0
00000430 01840800
0064 00000450 05A1 move @01840810h, a1, 0
00000460 01840810
0065 00000480 0B41 cmpi 0, a1
00000490 FFFF
0066 000004A0 CB02 jrne was_white
0067 000004B0 1821 movk 1, a1
0068 000004C0 C001 jruc set_state
0069 000004D0 was_white:
0070 000004D0 4421 sub a1, a1
0071 000004E0 set_state:
0072 000004E0 0581 move a1, @01840810h, 0
000004F0 01840810
0073
0074 00000510 draw:
0075 00000510 05A1 move @01840810h, a1, 0
00000520 01840810
0076 00000540 0B41 cmpi 0, a1
00000550 FFFF
0077 00000560 CB02 jrne pat_white
0078 00000570 4442 sub a2, a2
0079 00000580 C003 jruc pat_ready
0080 00000590 pat_white:
0081 00000590 09E2 movi 0FFFFh, a2, L
000005A0 0000FFFF
0082 000005C0 pat_ready:
0083 000005C0 09E3 movi 04064100h, a3, L
000005D0 04064100
0084 000005F0 09E4 movi 64, a4, L
00000600 00000040
0085 00000620 09E5 movi 4, a5, L
GSP COFF Assembler, Version 2.00, 87.300 Sun Oct 18 03:19:02 2026
(c) Copyright 1985, 1987, Texas Instruments Inc.
PAGE 3
00000630 00000004
0086 00000650 drow:
0087 00000650 4CA1 move a5, a1
0088 00000660 dword:
0089 00000660 9043 move a2, *a3+, 0
0090 00000670 3C41 dsjs a1, dword
0091 00000680 0B03 addi 03C0h, a3
00000690 03C0
0092 000006A0 3CC4 dsjs a4, drow
0093
0094 ; restore the A registers (field 1 is still 32)
0095 000006B0 09AF mmfm sp, a0,a1,a2,a3,a4,a5
000006C0 003F
0096 ; leave with [ST][orig_pc] and the temporary a0 slot s
0097 000006D0 0740 setf 32, 0, 1
0098 000006E0 098F mmtm sp, a0 ; a0 slot at S-20h
000006F0 8000
0099 00000700 07A0 move @01840820h, a0, 1 ; orig_pc
00000710 01840820
0100 00000730 A20F move a0, -*sp, 1 ; orig_pc at S-40h
0101 00000740 B7E0 move *sp(020h), a0, 1 ; restore a0 from S-20h
00000750 0020
0102 00000760 07A0 move @01840840h, a0, 1 ; interrupted ST (temporarily i
00000770 01840840
0103 00000790 A20F move a0, -*sp, 1 ; ST at S-60h
0104 000007A0 B7E0 move *sp(040h), a0, 1 ; restore a0 from S-20h
000007B0 0040
0105 000007C0 01C0 popst ; restore interrupted ST/IE
0106 000007D0 0962 rets 2 ; pop orig_pc, skip the a0 slot
0107 .end
No Errors, No Warnings