mirror of
https://git.k-space.ee/arti/vt1200.git
synced 2026-10-31 12:05:05 +02:00
Andrew Morton's Unix-hosted assembler/linker for the TMS34010, fetched from the gsptools archive and patched to build on x86-64. The K&R sources silently truncate pointers there: implicit int parameter declarations and fixed-argument printf wrappers. The patch fixes those and the flex 2.6 yy_init mismatch. hello.as34.g is harness/hello-world/hello.asm in as34 syntax. as34/ld34 reproduce the GSPA-built payload byte-for-byte (82 bytes, md5 db91788991ebba476b55a11127a36475), and the MAME hello.lua run reports the same markers, the same 1024-word VRAM block and a byte-identical frame. build.sh downloads the upstream tarball at build time (sha256 pinned); the tree is not vendored.
48 lines
1.4 KiB
Plaintext
48 lines
1.4 KiB
Plaintext
; hello.as34.g -- hello.asm ported to Andrew Morton's as34 syntax.
|
|
;
|
|
; Differences from harness/hello-world/hello.asm (TI GSPA syntax):
|
|
; * hex constants use >DEAD, not 0DEADh
|
|
; * no L/W immediate-width suffix; as34's movi is always the 32-bit form,
|
|
; which is what the GSPA source asked for with ", L"
|
|
; * @absolute operands use the same @ syntax
|
|
; Everything else (labels, mnemonics, bit addresses, dsjs loops) is unchanged.
|
|
;
|
|
; Addresses in operands are BIT addresses, like every TMS34010 pointer.
|
|
|
|
.text
|
|
.globl _start
|
|
_start:
|
|
dint ; stay deterministic: no firmware ISR
|
|
setf 16, 0, 0 ; field 0 = 16 bits, zero-extended
|
|
setf 32, 0, 1 ; field 1 = 32 bits, zero-extended
|
|
|
|
; ---- channel 1: RAM markers -----------------------------------
|
|
movi >DEAD, a0
|
|
move a0, @>1810000, 0 ; MAGIC1 (bytes AD DE in a dump)
|
|
movi >BEEF, a0
|
|
move a0, @>1810010, 0 ; MAGIC2 (bytes EF BE)
|
|
|
|
; ---- channel 2: solid block in video RAM ----------------------
|
|
movi >4019040, a2 ; 04000000h + 100*1024 + 64
|
|
movi 64, a3 ; 64 rows
|
|
movi 16, a4 ; 16 words = 256 pixels per row
|
|
sub a1, a1 ; counter = 0
|
|
movi >FFFF, a0
|
|
row_loop:
|
|
move a4, a5
|
|
word_loop:
|
|
move a0, *a2+, 0 ; store word, postincrement by 16 bits
|
|
addiw 1, a1 ; count this store
|
|
dsjs a5, word_loop
|
|
addiw >300, a2 ; skip 768 bits to the next row
|
|
dsjs a3, row_loop
|
|
|
|
; The counter is 0400h only if all 64*16 stores executed.
|
|
move a1, @>1810020, 0 ; COUNT
|
|
|
|
spin:
|
|
nop
|
|
jruc spin
|
|
|
|
.end
|