0 Members and 3 Guests are viewing this topic.
;##########################################;search for a user;input: de = ptr to start of appvar data, (including size bytes); hl = ptr to username;ouput: de = ptr to start of user section; carry set if not foundsearchForUser: ld a, 8 ld bc, 5 jr realSearch;##########################################;search for a coordinate;input: de = ptr to start of appvar data, (including size bytes); hl = ptr to coordinate;output: de = ptr to start of user section; carry set if not foundsearchForCoordinate: ld a, 12 ld bc, 13 jr realSearch;##########################################;search for an ID;input: de = ptr to start of appvar data, (including size bytes); hl = ptr to coordinate;ouput: de = ptr to start of user section; carry set if not foundsearchForAnId: ld a, 5 ld bc, 0; jr realSearch; fall through;#######realSearch: push bc push hl ex de, hl ld e, (hl) inc hl ld d, (hl) inc hl add hl, bc push hl ex de, hl push af ld a, 25 bcall(_divHLbyA) pop bc ld c, l pop hl pop de actualFindLoop: push bc push de push hlcheckMatchLoop: ld a, (de) cp (hl) jr nz, isntMatch inc hl inc de djnz checkMatchLoop pop hl pop af pop af pop de or a sbc hl, de ex de, hl ret isntMatch: pop hl ld de, 25 add hl, de pop de pop bc dec c jr nz, actualFindLoop pop af scf ret
;##########################################;search for a user;input: de = ptr to start of appvar data, (including size bytes); hl = ptr to username;ouput: de = ptr to start of user section; carry set if not foundsearchForUser: ld a, 8 ld bc, 5 jr realSearch;##########################################;search for a coordinate;input: de = ptr to start of appvar data, (including size bytes); hl = ptr to coordinate;output: de = ptr to start of user section; carry set if not foundsearchForCoordinate: ld a, 12 ld bc, 13 jr realSearch;##########################################;search for an ID;input: de = ptr to start of appvar data, (including size bytes); hl = ptr to coordinate;ouput: de = ptr to start of user section; carry set if not foundsearchForAnId: ld a, 5 ld bc, 0
;############################################;input: a = field length; bc = field offset from start of data; de = start of appvar; hl = ptr to field to match
or a sbc hl, de
Nice. Ok, another question. Is there a (_DeleteMem) command, like there is an (_InsertMem) command? Or if not, is there a work around?Also, is there a two-byte subtract command?
As I said earlier on IRC, yes there is.You can find a list of all BCalls here.