This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches. git-svn-id: svn://svn.cc65.org/cc65/trunk@3 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
47
libsrc/common/zerobss.s
Normal file
47
libsrc/common/zerobss.s
Normal file
@@ -0,0 +1,47 @@
|
||||
;
|
||||
; Ullrich von Bassewitz, 17.09.1998
|
||||
;
|
||||
; Zero the bss segment.
|
||||
;
|
||||
|
||||
.export zerobss
|
||||
.import __BSS_RUN__, __BSS_SIZE__
|
||||
.importzp ptr1
|
||||
|
||||
|
||||
.code
|
||||
|
||||
zerobss:
|
||||
lda #<__BSS_RUN__
|
||||
sta ptr1
|
||||
lda #>__BSS_RUN__
|
||||
sta ptr1+1
|
||||
lda #0
|
||||
tay
|
||||
|
||||
; Clear full pages
|
||||
|
||||
L1: ldx #>__BSS_SIZE__
|
||||
beq L3
|
||||
L2: sta (ptr1),y
|
||||
iny
|
||||
bne L2
|
||||
inc ptr1+1
|
||||
dex
|
||||
bne L2
|
||||
|
||||
; Clear remaining page (y is zero on entry)
|
||||
|
||||
L3: ldx #<__BSS_SIZE__
|
||||
beq L5
|
||||
L4: sta (ptr1),y
|
||||
iny
|
||||
dex
|
||||
bne L4
|
||||
|
||||
; Done
|
||||
|
||||
L5: rts
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user