Files
arti 0075e57c0d m7.2: add object/debug end-to-end gates
- oracle.sh: link the M5 native objects with GSPLNK and tms-link, require
  identical allocated bytes/public symbols through the independent reader,
  then run the tms-link image in MAME and decode _native_value with dis34.
- cinit.sh: a C TI .cinit record table (packed u16 count/u32 destination/
  data words) linked by tms-link, the termtris copy loop in MAME, cinit at
  the .cinit origin, the destination resolved to a bit address, and
  bytes/placement equal to GSPLNK.
- longname.sh: a 44-character public function defined in one TU and called
  from another, linked by tms-link, full name in the map, runs in MAME.
- debug.sh: tms-clang -g -> TI-COFF -> tms-link --keep-debug, .debug_*
  wrapped in a minimal ELF32 container and validated with llvm-dwarfdump
  (debug.c, line rows, low PC 0x314000, high_pc byte size, string names),
  plus the stripped image loading in MAME.
- tms-clang: pass -g through to clang; the bit-pointer passes preserve !dbg.
- tms-link: accept GSPA's .text/.data/.bss/.cinit order as well as llc's
  .text/.data/.cinit/.bss order (the real startup cinit.asm shape).
2026-11-14 22:21:03 +00:00

52 lines
1.3 KiB
NASM

; cinit-entry.asm -- M7.2 `.cinit` gate entry, linked at bit 018A0000.
;
; The `.cinit` loop is byte-for-byte the termtris `_start` loop from
; vendor/vt1200-termtris/apps/termtris/src/vt1200/entry.asm:
;
; movi cinit,a9
; move *a9+,count ; u16 data-word count
; jrz done
; move *a9+,dest,1 ; u32 destination (a TMS34010 bit address)
; move *a9+,*dest+ ; copy `count` words
;
; The public `cinit` symbol is defined at offset 0 of this object's empty
; `.cinit` section (the termtris cinit.asm shape), so the linker places it at
; the `.cinit` origin and the C table (concatenated after this zero-size input
; section) is the record the loop reads. GSPA emits this object's sections in
; the order .text/.data/.bss/.cinit; tms-link accepts that GSPA order as well
; as the llc .text/.data/.cinit/.bss order.
;
; After the copy loop the entry calls cinit_probe(), which returns the sum of
; the three copied words; that value is the 018A8000 marker.
.ref _cinit_probe
.text
.globl _start
_start:
setf 32,0,1
movi _cstack,a14
move a14,a13
movi cinit,a9
ci_loop:
setf 16,0,0
move *a9+,a11
jrz ci_done
move *a9+,a10,1
ci_copy:
move *a9+,*a10+
dsjs a11,ci_copy
jruc ci_loop
ci_done:
setf 32,0,1
move a13,a14
calla _cinit_probe
move a8,@018A8000h,1
rets
.sect ".cinit"
.globl cinit
cinit:
.bss _cstack,32768,16
.end