From 704ce5ae223ae799a45aec1e8577d507e75048c1 Mon Sep 17 00:00:00 2001 From: cuz Date: Tue, 12 Nov 2002 22:49:38 +0000 Subject: [PATCH] Added _systime for all platforms git-svn-id: svn://svn.cc65.org/cc65/trunk@1510 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/apple2/Makefile | 3 ++- libsrc/apple2/systime.s | 28 ++++++++++++++++++++++++++++ libsrc/atari/Makefile | 1 + libsrc/atari/systime.s | 28 ++++++++++++++++++++++++++++ libsrc/atmos/Makefile | 9 ++++++--- libsrc/atmos/systime.s | 28 ++++++++++++++++++++++++++++ libsrc/cbm/Makefile | 1 + libsrc/cbm/systime.s | 28 ++++++++++++++++++++++++++++ libsrc/geos/system/Makefile | 15 +++++++++++++-- libsrc/geos/system/systime.s | 28 ++++++++++++++++++++++++++++ 10 files changed, 163 insertions(+), 6 deletions(-) create mode 100644 libsrc/apple2/systime.s create mode 100644 libsrc/atari/systime.s create mode 100644 libsrc/atmos/systime.s create mode 100644 libsrc/cbm/systime.s create mode 100644 libsrc/geos/system/systime.s diff --git a/libsrc/apple2/Makefile b/libsrc/apple2/Makefile index c87d43661..248cfae8b 100644 --- a/libsrc/apple2/Makefile +++ b/libsrc/apple2/Makefile @@ -28,12 +28,13 @@ S_OBJS= _scrsize.o \ randomize.o \ read.o \ revers.o \ + systime.o \ where.o \ write.o all: $(C_OBJS) $(S_OBJS) clean: - @rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o + @rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) diff --git a/libsrc/apple2/systime.s b/libsrc/apple2/systime.s new file mode 100644 index 000000000..1d039e80e --- /dev/null +++ b/libsrc/apple2/systime.s @@ -0,0 +1,28 @@ +; +; Ullrich von Bassewitz, 12.11.2002 +; +; time_t _systime (void); +; /* Similar to time(), but: +; * - Is not ISO C +; * - Does not take the additional pointer +; * - Does not set errno when returning -1 +; */ +; + + .export __systime + + .importzp sreg + +.code + +.proc __systime + + lda #$FF + tax + sta sreg + sta sreg+1 + rts ; Return -1 + +.endproc + + diff --git a/libsrc/atari/Makefile b/libsrc/atari/Makefile index afc4e7c9c..e5a4095f3 100644 --- a/libsrc/atari/Makefile +++ b/libsrc/atari/Makefile @@ -61,6 +61,7 @@ OBJS = _scrsize.o \ scroll.o \ setcolor.o \ siocall.o \ + systime.o \ tvtype.o \ ucase_fn.o \ where.o \ diff --git a/libsrc/atari/systime.s b/libsrc/atari/systime.s new file mode 100644 index 000000000..1d039e80e --- /dev/null +++ b/libsrc/atari/systime.s @@ -0,0 +1,28 @@ +; +; Ullrich von Bassewitz, 12.11.2002 +; +; time_t _systime (void); +; /* Similar to time(), but: +; * - Is not ISO C +; * - Does not take the additional pointer +; * - Does not set errno when returning -1 +; */ +; + + .export __systime + + .importzp sreg + +.code + +.proc __systime + + lda #$FF + tax + sta sreg + sta sreg+1 + rts ; Return -1 + +.endproc + + diff --git a/libsrc/atmos/Makefile b/libsrc/atmos/Makefile index 454edd96a..b878d96c5 100644 --- a/libsrc/atmos/Makefile +++ b/libsrc/atmos/Makefile @@ -11,10 +11,13 @@ %.o: %.s @$(AS) -g -o $@ $(AFLAGS) $< -OBJS = crt0.o +C_OBJS = -all: $(OBJS) +S_OBJS = crt0.o \ + systime.o + +all: $(C_OBJS) $(S_OBJS) clean: - @rm -f $(OBJS) + @rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) diff --git a/libsrc/atmos/systime.s b/libsrc/atmos/systime.s new file mode 100644 index 000000000..1d039e80e --- /dev/null +++ b/libsrc/atmos/systime.s @@ -0,0 +1,28 @@ +; +; Ullrich von Bassewitz, 12.11.2002 +; +; time_t _systime (void); +; /* Similar to time(), but: +; * - Is not ISO C +; * - Does not take the additional pointer +; * - Does not set errno when returning -1 +; */ +; + + .export __systime + + .importzp sreg + +.code + +.proc __systime + + lda #$FF + tax + sta sreg + sta sreg+1 + rts ; Return -1 + +.endproc + + diff --git a/libsrc/cbm/Makefile b/libsrc/cbm/Makefile index 54e6c6314..b224d139b 100644 --- a/libsrc/cbm/Makefile +++ b/libsrc/cbm/Makefile @@ -50,6 +50,7 @@ S_OBJS = c_acptr.o \ oserrlist.o \ oserror.o \ revers.o \ + systime.o \ where.o all: $(C_OBJS) $(S_OBJS) diff --git a/libsrc/cbm/systime.s b/libsrc/cbm/systime.s new file mode 100644 index 000000000..1d039e80e --- /dev/null +++ b/libsrc/cbm/systime.s @@ -0,0 +1,28 @@ +; +; Ullrich von Bassewitz, 12.11.2002 +; +; time_t _systime (void); +; /* Similar to time(), but: +; * - Is not ISO C +; * - Does not take the additional pointer +; * - Does not set errno when returning -1 +; */ +; + + .export __systime + + .importzp sreg + +.code + +.proc __systime + + lda #$FF + tax + sta sreg + sta sreg+1 + rts ; Return -1 + +.endproc + + diff --git a/libsrc/geos/system/Makefile b/libsrc/geos/system/Makefile index e3508b4de..4389b8eba 100644 --- a/libsrc/geos/system/Makefile +++ b/libsrc/geos/system/Makefile @@ -8,8 +8,19 @@ @$(AS) -o $@ $(AFLAGS) $< -S_OBJS = ctype.o callroutine.o enterdesktop.o firstinit.o getrandom.o getserialnumber.o\ - initdoneio.o mainloop.o panic.o tobasic.o setdevice.o get_ostype.o +S_OBJS = ctype.o \ + callroutine.o \ + enterdesktop.o \ + firstinit.o \ + get_ostype.o \ + getrandom.o \ + getserialnumber.o \ + initdoneio.o \ + mainloop.o \ + panic.o \ + tobasic.o \ + setdevice.o \ + systime.o all: $(S_OBJS) diff --git a/libsrc/geos/system/systime.s b/libsrc/geos/system/systime.s new file mode 100644 index 000000000..1d039e80e --- /dev/null +++ b/libsrc/geos/system/systime.s @@ -0,0 +1,28 @@ +; +; Ullrich von Bassewitz, 12.11.2002 +; +; time_t _systime (void); +; /* Similar to time(), but: +; * - Is not ISO C +; * - Does not take the additional pointer +; * - Does not set errno when returning -1 +; */ +; + + .export __systime + + .importzp sreg + +.code + +.proc __systime + + lda #$FF + tax + sta sreg + sta sreg+1 + rts ; Return -1 + +.endproc + + -- 2.39.5