



;CODESUB--Changes string to "coded" string
;Adds 1 to every character in the string
;For use with BASIC programs
;**********************************************************
codesub segment			;defint code segment
;----------------------------------------------------------
main	proc	far		;main part of program

	assume cs:codesub

; check that argument is really a string
	cmp	al,3		;3 is code for string
	jne	exit		;  wrong argument
;get address of string descriptor from DX
	mov	bx,dx		;descriptor into BX
	mov	ch,0		;clear hi half length
	mov	cl,[bx]		;length of string
	cmp	cx,0		;if length is zero
	je	exit		;  then exit
	mov	si,[bx+1]	;address of string
;add 1 to every character in string
newchar:
	add	byte ptr[si],1	;add 1 to char
	inc	si		;point to next char
	loop	newchar		;loop until done
exit:	
	ret			;return to DOS

main	endp			;end of main part of program
;----------------------------------------------------------
codesub ends			;end of code segment
;**********************************************************

	end	main		;end assembly


