You are on page 1of 3

;program to find if a number is exist

jmp start
msg db '110193437'
res db ?
start:
cld
mov bl,00
mov di,offset msg
mov cx,09
mov al,'8'
repne scasb
jne over
inc bl
over:
mov res,bl
hlt

;program to find how many times a
number is repeated
jmp start
msg db '110193437'
res db ?
start:
cld
mov bl,00
mov di,offset msg
mov cx,09
mov al,'3'
again:
scasb
jne over
inc bl
over:
loop again
mov res,bl
hlt

;TO FIND HIGH TEMP
JMP START
TMP DB +13,-10,19,14,-19,-2,0
HI DB ?
START:
MOV SI,OFFSET TMP
MOV AL,[SI]
INC SI
if al is grater dont
MOV CX,6
change any thing
CM:
,increment the pointer
CMP AL,[SI]
JGE OVER
MOV AL,[SI]
;other wise if al is
OVER:
smaller then replace it
INC SI
with [si]
LOOP CM

;TO FIND low TEMP
JMP START
TMP DB +13,-10,19,14,-19,-2,0
HI DB ?
START:
MOV SI,OFFSET TMP
MOV AL,[SI]
INC SI
MOV CX,6
CM:
CMP AL,[SI]
JLE OVER
MOV AL,[SI ]
OVER:
INC SI
LOOP CM
MOV HI,AL
HLT
;THIS CODE IS TO CALCULATE THE
NUMBER OF 1S AND 0S IN A REG
;1 CODE 1 :
S1 DB ?
S0 DB ?
MOV AX,5478H
MOV BL,00
MOV DL,00
MOV CX,16
AGAIN:
SHL AX,1
JNC OVER
INC BL

MOV HI,AL
HLT
;P2 CH3
JMP START
X DW 1452H
Y DW 8523H
RES DB 2 DUP(?)
START:
MOV SI,OFFSET X
MOV DI,OFFSET Y
MOV BX,OFFSET RES
MOV CX,2
BACK:
MOV AL,BYTE PTR [SI]
SBB AL,BYTE PTR [DI]

00 MOV DL.00 MOV CX.BL HLT OVER: LOOP AGAIN MOV DL.[SI] JNE OVER INC BL OVER: INC SI LOOP COMP MOV MY.15.100. AL INC SI INC DI INC BX LOOP BACK HLT .1 JNC OVER INC BL LOOP AGAIN OVER: INC DL LOOP AGAIN MOV S0.47.BL SUB DL.CODE 2 S1 DB ? S0 DB ? MOV AX.00 MOV CX.16 JC COMP COMP: NOT DL INC DL MOV S0.105 HI DB 100 MY DB ? START: MOV SI.BL HLT .100.10 COMP: CMP AL.DL MOV S1.100.85.MOV BYTE PTR [BX].16 AGAIN: SHL AX.BL HLT .5478H MOV BL.HI MOV BL.23.THIS PROGRAM IS TO FIND THE HOW MANY NUMBER IS ARE EQUAL JMP START: N DB 54.200.DL MOV S1.OFFSET N MOV AL.