.MODEL SMALL
.STACK 100H
.DATA
;from the data segment
DAT_DIC DB 'Europe'
DAT_TYPED DB 'Euorope'
MESSAGE1 DB 'The spelling is correct$'
MESSAGE2 DB 'Wrong spelling$'
;from code segment:
.CODE
MAIN PROC
MOV AX, @DATA
MOV DS, AX
CLD ;DF=0 for increment
MOV SI,OFFSET DAT_DIC ;SI=offset of DAT_DIC
MOV DI,OFFSET DAT_TYPED ;DI=offset of DAT_TYPED
MOV CX,06 ;load the counter
REPE CMPSB ;repeat as long as equal or until CX=0
JE OVER ;if ZF=1 then display MESSAGE1
MOV DX,OFFSET MESSAGE2 ;if ZF=0 then display MESSAGE2
JMP DISPLAY
OVER:
MOV DX,OFFSET MESSAGE1
DISPLAY:
MOV AH,09
INT 21H
MOV AH, 4CH
INT 21H
MAIN ENDP
END MAIN
.STACK 100H
.DATA
;from the data segment
DAT_DIC DB 'Europe'
DAT_TYPED DB 'Euorope'
MESSAGE1 DB 'The spelling is correct$'
MESSAGE2 DB 'Wrong spelling$'
;from code segment:
.CODE
MAIN PROC
MOV AX, @DATA
MOV DS, AX
CLD ;DF=0 for increment
MOV SI,OFFSET DAT_DIC ;SI=offset of DAT_DIC
MOV DI,OFFSET DAT_TYPED ;DI=offset of DAT_TYPED
MOV CX,06 ;load the counter
REPE CMPSB ;repeat as long as equal or until CX=0
JE OVER ;if ZF=1 then display MESSAGE1
MOV DX,OFFSET MESSAGE2 ;if ZF=0 then display MESSAGE2
JMP DISPLAY
OVER:
MOV DX,OFFSET MESSAGE1
DISPLAY:
MOV AH,09
INT 21H
MOV AH, 4CH
INT 21H
MAIN ENDP
END MAIN
This comment has been removed by the author.
ReplyDeleteThe Best of the Blogs You have Mentioned here
ReplyDeleteFull Stack Online Training
This comment has been removed by the author.
ReplyDeleteHire Full Stack Developers Texas
ReplyDeleteHire Full Stack Developer
https://www.inwizards.com/hire-full-stack-developer.php
I am a regular reader of your blog. I found that your all blogs are quite informative, interesting and helpful. Thank You for sharing with users such a useful information and guide a different techniques.