home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Du Jour
/
SoftwareDuJour.iso
/
BUSINESS
/
DBASE
/
DBAPG.ARC
/
LEADZERO.ASM
< prev
next >
Wrap
Assembly Source File
|
1984-08-05
|
640b
|
26 lines
; Subroutine.: LEADZERO.ASM
; Author.....: Luis A. Castro
; Date.......: 1982
; Notice.....: Copyright 1982, Ashton-Tate, All Rights Reserved
; Notes......: Replace leading blanks with leading zeroes.
;
;
ORG 42000 ; LOAD IN dBASE FREE AREA
SHLD SAVEHL ; SAVE HL REGISTERS
MOV B,M ; STORE LENGTH OF STRING TO COUNTER
;
LOOP:
INX H ; SKIP TO NEXT CHARACTER
MOV A,M ; FETCH CHARACTER
CPI ' ' ; IS IT A SPACE?
JNZ DONE ; YES, DONE
MVI M,'0' ; REPLACE SPACE WITH ZERO
DCR B ; DECREMENT COUNTER
JNZ LOOP ; REPEAT UNTIL DONE
DONE:
LHLD SAVEHL ; RESTORE HL REGISTERS
RET
;
SAVEHL DB 0,0
END