Merge pull request #2737 from mrdudz/asmversion

fix version in sysuname for all targets
This commit is contained in:
Bob Andrews
2025-06-26 01:47:47 +02:00
committed by GitHub
22 changed files with 122 additions and 80 deletions

37
libsrc/agat/sysuname.s Normal file
View File

@@ -0,0 +1,37 @@
;
; Ullrich von Bassewitz, 2003-08-12
;
; unsigned char __fastcall__ _sysuname (struct utsname* buf);
;
.export __sysuname, utsdata
.import utscopy
__sysuname = utscopy
;--------------------------------------------------------------------------
; Data. We define a fixed utsname struct here and just copy it.
.rodata
utsdata:
; sysname
.asciiz "cc65"
; nodename
.asciiz ""
; release
.byte .string (>.version)
.byte '.'
.byte .string (<.version)
.byte $00
; version
.byte '0' ; unused
.byte $00
; machine
.asciiz "Agat"

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,23 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.if ((.VERSION >> 4) & $0F) > 9 .byte .string (<.version)
.byte ((.VERSION >> 4) & $0F) / 10 + '0'
.byte ((.VERSION >> 4) & $0F) .MOD 10 + '0'
.else
.byte ((.VERSION >> 4) & $0F) + '0'
.endif
.byte $00 .byte $00
; version ; version
.if (.VERSION & $0F) > 9 .byte '0' ; unused
.byte (.VERSION & $0F) / 10 + '0'
.byte (.VERSION & $0F) .MOD 10 + '0'
.else
.byte (.VERSION & $0F) + '0'
.endif
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -24,13 +24,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -22,13 +22,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,23 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.if ((.VERSION >> 4) & $0F) > 9 .byte .string (<.version)
.byte ((.VERSION >> 4) & $0F) / 10 + '0'
.byte ((.VERSION >> 4) & $0F) .MOD 10 + '0'
.else
.byte ((.VERSION >> 4) & $0F) + '0'
.endif
.byte $00 .byte $00
; version ; version
.if (.VERSION & $0F) > 9 .byte '0' ; unused
.byte (.VERSION & $0F) / 10 + '0'
.byte (.VERSION & $0F) .MOD 10 + '0'
.else
.byte (.VERSION & $0F) + '0'
.endif
.byte $00 .byte $00
; machine ; machine

View File

@@ -23,13 +23,13 @@ utsdata:
.asciiz "" .asciiz ""
; release ; release
.byte ((.VERSION >> 8) & $0F) + '0' .byte .string (>.version)
.byte '.' .byte '.'
.byte ((.VERSION >> 4) & $0F) + '0' .byte .string (<.version)
.byte $00 .byte $00
; version ; version
.byte (.VERSION & $0F) + '0' .byte '0' ; unused
.byte $00 .byte $00
; machine ; machine

View File

@@ -213,6 +213,9 @@ EXELIST_atari2600 = \
EXELIST_atari5200 = \ EXELIST_atari5200 = \
notavailable notavailable
EXELIST_atari7800 = \
notavailable
EXELIST_atmos = \ EXELIST_atmos = \
ascii \ ascii \
checkversion \ checkversion \
@@ -299,9 +302,7 @@ EXELIST_gamate = \
hello hello
EXELIST_geos-cbm = \ EXELIST_geos-cbm = \
ascii \ ascii
checkversion \
diodemo
EXELIST_geos-apple = \ EXELIST_geos-apple = \
ascii ascii
@@ -347,6 +348,9 @@ EXELIST_sim6502 = \
EXELIST_sim65c02 = $(EXELIST_sim6502) EXELIST_sim65c02 = $(EXELIST_sim6502)
EXELIST_rp6502 = \
notavailable
EXELIST_supervision = \ EXELIST_supervision = \
notavailable notavailable
@@ -413,6 +417,7 @@ TARGETS := \
atarixl \ atarixl \
atari2600 \ atari2600 \
atari5200 \ atari5200 \
atari7800 \
atmos \ atmos \
bbc \ bbc \
c128 \ c128 \
@@ -423,6 +428,8 @@ TARGETS := \
creativision \ creativision \
cx16 \ cx16 \
gamate \ gamate \
geos-apple \
geos-cbm \
kim1 \ kim1 \
lunix \ lunix \
lynx \ lynx \
@@ -431,6 +438,7 @@ TARGETS := \
pce \ pce \
pet \ pet \
plus4 \ plus4 \
rp6502 \
sim6502 \ sim6502 \
sim65c02 \ sim65c02 \
supervision \ supervision \
@@ -438,12 +446,14 @@ TARGETS := \
telestrat \ telestrat \
vic20 vic20
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Rule to make the binaries for every platform # Rule to make the binaries for every platform
define TARGET_recipe define TARGET_recipe
@echo making samples for: $(T) @echo making samples for: $(T)
@$(MAKE) --no-print-directory clean SYS:=$(T)
@$(MAKE) -j2 SYS:=$(T) @$(MAKE) -j2 SYS:=$(T)
@$(MAKE) --no-print-directory clean SYS:=$(T) @$(MAKE) --no-print-directory clean SYS:=$(T)

View File

@@ -9,6 +9,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/utsname.h>
#if ((__CC65__ >> 8) > 3) || ((__CC65__ & 0x000f) > 0) #if ((__CC65__ >> 8) > 3) || ((__CC65__ & 0x000f) > 0)
/* compiler version is 2.19-git or higher */ /* compiler version is 2.19-git or higher */
@@ -29,6 +30,17 @@
int main(void) int main(void)
{ {
#if !defined(__SIM6502__) && !defined(__SIM65C02__) && !defined(__AGAT__)
struct utsname buf;
uname (&buf);
printf("utsname.sysname: %s\n", buf.sysname);
printf("utsname.nodename: %s\n", buf.nodename);
printf("utsname.release: %s\n", buf.release);
printf("utsname.version: %s\n", buf.version);
printf("utsname.machine: %s\n", buf.machine);
#endif
printf("__CC65__ defined as %04x\n", __CC65__); printf("__CC65__ defined as %04x\n", __CC65__);
printf("compiler version is %u.%u\n", VER_MAJOR, VER_MINOR); printf("compiler version is %u.%u\n", VER_MAJOR, VER_MINOR);
if (__CC65__ == VERSION) { if (__CC65__ == VERSION) {

View File

@@ -43,6 +43,9 @@ EXELIST_atari2600 = \
EXELIST_atari5200 = \ EXELIST_atari5200 = \
notavailable notavailable
EXELIST_atari7800 = \
notavailable
EXELIST_bbc = \ EXELIST_bbc = \
notavailable notavailable