MOV D,reg means: move content of the specified register (or M=memory addressed with HL) into register D
Suppose you want to add 11 and 12.instruction are : mvi a,11h mvi b ,12h mov d,b add b
org 100h .data str1 db "Computer" str2 db "computer" mes1 db "string are same $" mes2 db "string are different $" .code assume cs:code,ds:data start: mov ax,@data mov ds,ax mov es,ax mov si,offset str1 mov di,offset str2 cld mov cx,8 repe cmpsb mov ah,9 jz skip lea dx,mes2 jmp over skip: lea dx,mes1 over: int 21h mov ax,4c00h int 21h end start ret
.model small .stack 100 .data line1 db 03,12,15,14,01 avg db ? .code mov ax,@data mov ds,ax lea si,line1 mov cx,0005h mov al,00+1 l1:add al,[si] inc si loop l1 mov ah,00h mov bh,05h div bh mov [si],al mov ah,4ch int 21h end
Mov ax,data mov ds,ax mov dl,05h up2: lea si,ser1 mov cl,05h up1: mov al,ds:[si] mov ah,al inc si cmp al,ds:[si] jc down mov ah,ds:[si] mov ds:[si],al dec si mov ds:[si],ah inc si down:dec cl jnz up1 dec dl jnz up2 int 3h
title ascending order using bubble sort .model small .stack 64 .data a db 34h,78h,56h,47h si_ze dw $-a ;si_ze=no of elements .code bubsort: mov ax,@data mov ds,ax mov bx,si_ze dec bx ;bx=no of passes needed to complete sorting(n-1) outlup: mov cx,bx ;cx=no of comparisions to be performed in a pass mov si,0 inlup: mov al,a[si] inc si cmp al,a[si] jb go_on xchg al,a[si] mov a[si-1],al go_on: loop inlup ;dec cx,until cx=0 dec bx jnz outlup int 3 ;breakpoint interrupt align 16 end bubsort
mov
Mov ax,1234 mov bx,2345 add ax,bx mov @(some memory location ) say 2200,ax hlt
4000 lda 50003a,00,504003 mvi b 0206,024005 mov c,a4f4006 mov d,a574007loop2mvi a 003e,004009loop1add d82400a dcr c0d400b jnz loop1c2,09,40400e mov c,a4f400f dcr b054010 jnz loop2c2,07,404013 mov a,c794014 sta 500532,05,504017 hlt76 enjoy dear friends :) by abin james nellanikattu
Lxih, 2200 mov c,m inxh mov a,m inxh cmp m jc l1 mov a,m dcr c jnz l2 inhx mov m,a hlt
Lxi h, 2000h mov a,m mov b,a inx h mov a,m add b sta 2002h hlt
The root 'mov' means move.
Suppose you want to add 11 and 12.instruction are : mvi a,11h mvi b ,12h mov d,b add b
DCX D means decrement register pair DE by one
The MOV A,A instruction in the 8085 does nothing, not even change flags. It only consumes time, specifically four clock cycles plus applicable wait states.
.model small .stack .data m db 'the no is odd $' m1 db 'the no is even $' a db 04h b db 02h .code mov ax,@data mov ds,ax mov ah,0 mov al,a mov bl,b div bl cmp ah,00h je l1 mov dx,offset m jmp l l1: mov dx,offset m1 jmp l l: mov ah,09 int 21h mov ah,4ch int 21h end
1byte instruction = MOV A,B 2byte instruction = MVI A,01H 3byte instruction = STA 2030H
Lxi b, 0000h lhld 8000h xchg lhld 8002h dcx d l006: lda 8002h add l mov l, a lda 8003h adc h mov h, a jnc l013 l013: inx b dcx d mov a, d ora e jnz l006 shld 8006h mov l, c mov h, b shld 8004h hlt