]> git.sur5r.net Git - cc65/blobdiff - libsrc/runtime/subysp.s
no TGI_ERR_NO_MEM or TGI_ERR_NO_IOCB anymore: replaced by TGI_ERR_NO_RES
[cc65] / libsrc / runtime / subysp.s
index e2bbd5fc6d73ee9a2a515eca476816e713c721fb..9d1a2c69160b7bba975b973dd06e9f58de170a51 100644 (file)
@@ -1,26 +1,24 @@
 ;
-; Ullrich von Bassewitz, 25.10.2000
+; Piotr Fusik, 24.10.2003
+; originally by Ullrich von Bassewitz
 ;
 ; CC65 runtime: Decrement the stackpointer by value in y
 ;
 
-               .export         subysp
-       .importzp       sp, tmp1
+       .export         subysp
+       .importzp       sp
 
 .proc  subysp
 
-               sty     tmp1            ; Save the value
-       lda     sp              ; Get lo byte
+       tya
+       eor     #$ff
        sec
-       sbc     tmp1            ; Subtract y value
-       sta     sp              ; Put result back
+       adc     sp
+       sta     sp
        bcs     @L1
        dec     sp+1
-@L1:           rts                     ; Done
+@L1:   rts
 
 .endproc
 
 
-
-
-