?? strncat.s
字號:
.area text
;
; char *strncat(char *dst, char *src, size_t bytes)
;
_strncat::
ldd R24,Y+0 ; load length
ldd R25,Y+1
cpi R24,0
cpc R25,R24
breq strncatx ; length == 0
mov R27,R17 ; move pointers
mov R26,R16
mov R31,R19
mov R30,R18
strncat1: ; find end of dst
ld R18,X+
tst R18
brne strncat1 ; dst has more ...
sbiw R26,1 ; let X point to 0-byte
strncat2: ; copy
ld R18,Z+
st X+,R18
tst R18
breq strncatx ; no more ...
sbiw R24,1
brne strncat2 ; there is more ...
ldi R18,0 ; or not
st X,R18 ;
strncatx:
ret
;
;<eof; 2003-07-31 ja>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -