FilterChars
Synopsis
FilterChars(address, len, lo_range, hi_range, Rchar)
A0 D0 D1 D2 D3C Prototype
void FilterChars(STRPTR address, ULONG len, ULONG lo_range, ULONG hi_range, ULONG Rchar);Description
Performs the basic function of ChangeChar(), but instead of replacing a single character, it operates on a range of codes. All characters outside the range defined by lo_range and hi_range are replaced with the character Rchar.
Inputs
- address — Pointer to the memory area to filter.
- len — Number of bytes to filter.
- lo_range — Minimum value below which codes will be replaced.
- hi_range — Maximum value above which codes will be replaced.
- Rchar — ASCII code that will be placed in position of those outside the range.
Result
None.
See Also
Implementation
The original 68020 assembly implementation:
; (25-Feb-1995) --- FilterChars()
_LVOFilterChars
movem.l d4/a0,-(sp)
subq.w #1,d0
moveq #0,d4
FC_Start
move.b (a0),d4
cmp.b d1,d4
bmi.s FC_Replace
cmp.b d2,d4
bhi.s FC_Replace
bra.s FC_Repeat
FC_Replace
move.b d3,(a0)
FC_Repeat
addq.w #1,a0
dbf d0,FC_Start
movem.l (sp)+,d4/a0
rtsLast updated on