]> git.sur5r.net Git - cc65/commitdiff
Optimize for size.
authorOliver Schmidt <ol.sc@web.de>
Sun, 19 Aug 2018 12:35:30 +0000 (14:35 +0200)
committerOliver Schmidt <ol.sc@web.de>
Sun, 19 Aug 2018 12:35:30 +0000 (14:35 +0200)
libsrc/common/time.s

index 9b297d4d350bbef25e42ed2771f6876bfa48c78b..40b470f5bafa47b435af5caf83955a0261c9d315 100644 (file)
@@ -6,7 +6,7 @@
 
         .export         _time
 
-        .import         decsp1
+        .import         decsp1, ldeaxi
         .importzp       ptr1, sreg, tmp1, tmp2
 
         .include        "time.inc"
         ldx     #>time
         jsr     _clock_gettime
         sta     tmp2
-        lda     time + timespec::tv_sec+2
-        ldx     time + timespec::tv_sec+3
-        sta     sreg
-        stx     sreg+1
-        lda     time + timespec::tv_sec
-        ldx     time + timespec::tv_sec+1
+        lda     #<time
+        ldx     #>time
+        .assert timespec::tv_sec = 0, error
+        jsr     ldeaxi
         sta     tmp1            ; Save low byte of result
 
 ; Restore timep and check if it is NULL