31 lines
373 B
ArmAsm
31 lines
373 B
ArmAsm
#code _CODE
|
|
;
|
|
;void __reverse(char *beg, char *end);
|
|
;
|
|
___strreverse::
|
|
pop bc
|
|
pop de
|
|
pop hl
|
|
push hl
|
|
push de
|
|
push bc
|
|
;
|
|
;in: HL - pointer to end of string (null symbol), DE - pointer to start of string
|
|
;
|
|
___strreverse_reg::
|
|
jr 110$
|
|
100$:
|
|
add hl, de
|
|
ld a, (de)
|
|
ld c, (hl)
|
|
ld (hl), a
|
|
ld a, c
|
|
ld (de), a
|
|
inc de
|
|
110$:
|
|
dec hl
|
|
or a, a
|
|
sbc hl, de
|
|
jr NC, 100$
|
|
ret
|