2 ; Ullrich von Bassewitz, 2003-08-12
4 ; This module contains a utility function for the machine dependent parts
5 ; of uname (__sysuname): It copies a packed struct utsname (just the strings
6 ; without padding) into a struct utsname. The source of the data is an
7 ; external symbol named "utsdata", the target is passed in a/x.
8 ; The function is written so that it is a direct replacement for __sysuname
9 ; for systems where utsdata is fixed. It may also be called via jump or
10 ; subroutine on systems where utsdata must be changed at runtime.
18 .include "utsname.inc"
22 ;--------------------------------------------------------------------------
27 ; Table with offsets into struct utsname
30 .byte utsname_nodename
35 ;--------------------------------------------------------------------------
45 stx tmp1 ; Field number
48 cpy #utsname_fieldcount
50 inc tmp1 ; Bump field counter
51 lda fieldoffs,y ; Get next field offset
52 tay ; Field offset -> y
56 inx ; Next char in utsdata
57 cmp #$00 ; Check for end of string
58 beq next ; Jump for next field
59 iny ; Next char in utsname struct
60 bne loop ; Copy string
62 done: lda #$00 ; Always successful