0

Hi,
What is the problem of this program ? It should print intertech systems, but it doesn't do . This program must convert all letters of the string to lowercase character .

Page   60 , 132
TITLE  A08CASE  (COM) Change uppercase to lowercase
       .MODEL  SMALL
       .CODE
       ORG  100H
BEGIN: JMP  A10MAIN
;----------------------------------
CONAME   DB   'INTERTECH SYSTEM','$'
;----------------------------------
A10MAIN  PROC  NEAR 
	 LEA  BX , CONAME+1       ; 1st char to change
         MOV  CX , 15             ; No. of chars to change
A20:
	 MOV  AH , [BX]           ; character for CONAME
	 CMP  AH , 41H            ; is it
	 JB   A30                 ;   upper
	 CMP  AH , 5AH            ;   case
	 JA   A30                 ;   letter?
	 XOR  AH , 00100000B      ; yes, convert
	 MOV  [BX] , AH           ; restore in CONAME
A30:
	 INC  BX                  ; search for next char
	 LOOP A20                 ; loop 16 times
                                  ; done,
	 MOV  AH , 09H            ;   display
	 LEA  DX , CONAME         ;   CONAME
	 INT  21H
	 MOV  AX , 4C00H          ; end processing
	 INT  21H
A10MAIN  ENDP
         END  BEGIN
1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Behi Jon
0

My problem is solved .
This program will work .

Page   60 , 132
TITLE  Change uppercase to lowercase
       .MODEL  SMALL
       .STACK 64
       .DATA
CONAME DB 'INTERTECH SYSTEM', '$'
       .CODE
A10MAIN  PROC  FAR
	 MOV AX, @data
	 MOV DS, AX
	 MOV ES, AX
	 LEA  BX , CONAME         ; 1st char to change
     MOV  CX , 16             ; No. of chars to change
A20:
	 MOV  AH , [BX]           ; character for CONAME
	 CMP  AH , 41H            ; is it
	 JB   A30                 ;   upper
	 CMP  AH , 5AH            ;   case
	 JA   A30                 ;   letter?
	 XOR  AH , 00100000B      ; yes, convert
	 MOV  [BX] , AH           ; restore in CONAME
A30:
	 INC  BX                  ; search for next char
	 LOOP A20                 ; loop 16 times
                                  ; done,
	 MOV  AH , 09H            ;   display
	 LEA  DX , CONAME         ;   CONAME
	 INT  21H
	 MOV  AX , 4C00H          ; end processing
	 INT  21H
A10MAIN  ENDP
         END  A10MAIN

I converted it to EXE .

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.