/[projet1]/public/pc/tools/osdk/main/Osdk/_final_/lib2/strnset.s
Defence Force logotype

Contents of /public/pc/tools/osdk/main/Osdk/_final_/lib2/strnset.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1154 - (show annotations)
Sun Aug 10 18:19:54 2014 UTC (5 years, 3 months ago) by dbug
File size: 979 byte(s)


1 ; char *strnset(char *s, char c, int n)
2
3 _strnset
4 ldy #5 ; get n
5 lda (sp),y
6 sta tmp
7 dey
8 lda (sp),y
9 tax
10
11 ldy #2
12 lda (sp),y
13 sta strnset1+6 ; low(c)
14 dey
15 lda (sp),y
16 sta strnset1+2 ; high(s)
17 sta strnset1+9 ; high(s)
18 sta strnset2+3 ; return value, high byte
19 dey
20 lda (sp),y
21 sta strnset1+1 ; low(s)
22 sta strnset1+8 ; high(s)
23 sta strnset2+1 ; return value, low byte
24
25 strnset0
26 dex ; decrease n
27 cpx #$ff
28 bne strnset1
29 dec tmp
30 lda tmp
31 cmp #$ff
32 beq strnset2 ; n<0?
33
34 strnset1
35 lda $2211,y
36 beq strnset2
37 lda #$66
38 sta $9988,y
39 iny
40 bne strnset0
41
42 inc strnset1+2
43 inc strnset1+9
44 jmp strnset0
45
46 strnset2
47 ldx #1
48 lda #3
49 rts
50

  ViewVC Help
Powered by ViewVC 1.1.26