Subversion Repositories Spectranet

[/] [branches/] [gnubinutils/] [modules/] [snapman/] [utils.asm] - Rev 372

Go to most recent revision | Compare with Previous | Blame | View Log

;The MIT License
;
;Copyright (c) 2009 Dylan Smith
;
;Permission is hereby granted, free of charge, to any person obtaining a copy
;of this software and associated documentation files (the "Software"), to deal
;in the Software without restriction, including without limitation the rights
;to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
;copies of the Software, and to permit persons to whom the Software is
;furnished to do so, subject to the following conditions:
;
;The above copyright notice and this permission notice shall be included in
;all copies or substantial portions of the Software.
;
;THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
;IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
;AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
;LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
;THE SOFTWARE.

; Utility functions.
;-------------------------------------------------------------------------
; F_strcpy
; Copy a string from HL to DE
.globl F_strcpy
F_strcpy: 
        ld a, (hl)
        and a
        ldi
        ret z
        jr F_strcpy

;-------------------------------------------------------------------------
; F_strcmp
; Compare a string with another. Strings pointed to by HL and DE
.globl F_strcmp
F_strcmp: 
        ld a, (de)
        cpi
        ret nz
        and a                   ; at the null?
        ret z
        inc de
        jr F_strcmp

Go to most recent revision | Compare with Previous | Blame | View Log