New Microsoft Word Document



Comments



Description

Whats your name?(constan)_ printstring macro msg mov ah,09h mov dx,offset msg int 21h endm data segment msg1 db 'what is your name: $' data ends assume cs:code,ds:data code segment start:mov ax,data mov ds,ax printstring msg1 mov cx,9 l1:mov ah,01 int 21h loop l1 jmp l2 mov ah,4ch int 21h l2:code ends end start ;down counter program to count 99-00 DATA SEGMENT(deepthi) PA EQU 0E800H PB EQU 0E801H CP EQU 0E803H DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START:MOV AX,DATA MOV DS,AX MOV DX,CP MOV AL,82H OUT DX,AL MOV AL,63H L1:PUSH AX MOV DX,PA OUT DX,AL CALL DELAY POP AX SUB AL,1 CMP AL,00H JNZ L1 MOV DX,PA OUT DX,AL MOV AH,4CH INT 21H DELAY PROC MOV BX,8686H L3:MOV CX,9874H L2:DEC CX JNZ L2 DEC BX JNZ L3 RET ENDP CODE ENDS END START ;program to check whethaer the given code is 2 out of code or not(Clifton) printstring macro msg push ax push dx mov ah,09 mov dx,offset msg int 21h pop dx pop ax endm data segment msg1 db 'enter the number to be tested: $' msg2 db 13,10,10,'given number is 2-out-of-code $' msg3 db 13,10,10,'given number is not 2-ot-of code $' space db ' $' temp db 00 data ends assume cs:code,ds:data code segment start:mov ax,data mov ds,ax printstring msg1 call read mov dx,00 mov cx,05 again:shr al,01 jnc next inc dl next:loopnz again cmp dl,02 jnz notcode printstring msg2 jmp last notcode:printstring msg3 jmp last read proc near mov ah,01 int 21h cmp al,40h jc num sub al,07 01 int 21h and al.10.offset msg int 21h pop dx pop ax endm data segment msg1 db 'enter the value of n: $' msg2 db 13.num:sub al.al mov al.ax printstring msg1 mov ah.10.07 num1:sub al.04 ror al.30h mov cl.0fh mov bl.'the sum is: $' space db ' $' nums dw 50 dup(00) temp1 dw 00 temp2 dw 00 data ends code segment assume cs:code.01 .10.'enter the 16 bit number: $' msg3 db 13.cl mov temp.40h jc num1 sub al.30h add temp.temp ret read endp last:code ends end start to add N 16 bit numbers(Clifton) printstring macro msg push ax push dx mov ah.09 mov dx.ds:data start:mov ax.10.al mov ah.al mov ah.data mov ds.01 int 21h cmp al.0ah mul bl mov bl. 07 num:sub al.02 loopnz up2 printstring msg3 mov temp2.0fh and bl.bx call disp jmp last read proc near mov cx.[si] jnc down inc dx down:add si.dx call disp printstring space mov temp2.00 printstring msg2 mov cx.ax mov temp1.bx lea si.0ch mov ah.al mov bh.bx lea si.00 up2:add bx.00 again:push cx mov ah.30h mov cl.00 mov dx.int 21h and al.04 mov dx.temp1 mov [si].02 printstring space loopnz up1 mov cx.cl pop cx loopnz again ret read endp .nums mov bx.dx ror dx.00 or dx.40h jc num sub al.01 int 21h cmp al.nums up1:push cx call read pop cx mov ax.0fh add al.ax add si. 194fh .dx and dl.disp proc near mov cx.'day: $ month: $ year: $' day db ? month db ? year dw ? disp db 10 dup(?) data ends code segment assume cs:code.ds:data start:mov ax.10.2 mov bh.offset msg int 21h endm home macro mov ah.02 int 21h pop cx loopnz above ret disp endp last:code ends end start program to display date(Clifton) printstring macro msg mov ah.cl mov temp2.0fh cmp dl.04 above:push cx mov cl.0 int 10h endm data segment msg1 db 13.ax mov bh.0 mov dx.30h mov ah.0ah jc below add dl.data mov ds.temp2 rol dx.07 below:add dl.8 int 21h mov bl.04 mov dx.09h mov dx.0 mov ah.bh mov bh.ah mov cx.0 mov dx. 10 up1:mov dx.year call hextoascii printstring disp jmp last hextoascii proc near push ax push bx push cx push dx push si mov cx.00 div bx add dl.'$' mov [si].00 mov bx.day call hextoascii printstring disp printstring msg1 mov ah.al loop up2 inc si mov al.'0' mov [si].2 mov bh.00 mov al.00h mov ax.dl mov month.cx lea si.al up2:pop ax inc si mov [si].0 mov dx.00 mov al.2ah int 21h mov day.mov ax.al pop si pop dx .'0' push dx inc cx cmp ax.dh mov year.month call hextoascii printstring disp printstring msg1 mov ax.0 int 21h mov ah.6000h int 10h home mov ah.disp printstring msg1 mov ah.10 jge up1 add al. 82h out dx.pa out dx.al mov al.'$' .pop cx pop bx pop ax ret hextoascii endp last:code ends end start down counter(Clifton) data segment pa equ 0e800h pb equ 0e801h cp equ 0e803h data ends assume cs:code.pa out dx.ds:data code segment start:mov ax.ax mov dx.'the key pressed is :'.cp mov al.'$' keys db '0 1 2 3 4 5 6 7 8 9 a b c d e f '.1 cmp al.0h jnz l1 mov dx.0ffffh l3:mov dx.al mov ah.4ch int 21h delay proc mov bx.al call delay pop ax sub al.data mov ds.0ffffh l2:dec dx jnz l2 dec bx jnz l3 ret delay endp code ends end start matrix(Clifton) data segment msg db 13.9 l1:push ax mov dx. ds:data code segment start:mov ax.show db ?.al mov al.0fh mov dl.2 int 21h mov cx.ch and cl.0ffffh delay:mov ax.2 int 21h jmp l2 l1:add dl.0ffffh delay1:dec ax jnz delay1 loop delay .pa in al.dl cmp dl.ax getkey:mov bh.04h jnz check shl bh.57h mov ah.01h jz disp inc bl shr ch.01h cmp cl.? cr equ 0e803h pa equ 0e800h pb equ 0e801h pc equ 0e802h data ends assume cs:code.01h inc al cmp al.90h mov dx.2 int 21h l2:mov dl.dx mov ch.00h check:mov cl.30h mov ah.10h jnz scanlines jmp getkey disp:mov dh.01h mov bl.bl and dh.al mov dx.cr out dx.9 ja l1 add dl.ax mov ax.20h mov ah.data mov ds.pb out dx.00h scanlines:mov al.01h cmp bh.bh mov dx.dh or dl. 0fh mov bl.0f0h .pb in al.dx mov bh.al mov dx.cp mov al.pa out dx.82h out dx.al and bh.82h out dx.ax mov dx.ds:data code segment start:mov ax.cp mov al.jmp getkey mov ah.pb in al.bh mov ah.dx not al mov dx.ax mov dx.al and ah.al mov ah.data mov ds.al mov dx.ds:data code segment start:mov ax.4ch int 21h code ends end start or gate(Clifton) data segment pa equ 0e800h pb equ 0e801h cp equ 0e803h data ends assume cs:code.data mov ds.4ch int 21h code ends end start N gate(Clifton) data segment pa equ 0e800h pb equ 0e801h cp equ 0e803h data ends assume cs:code. al call delay ror al.pa out dx.mov cl.88h again: push ax mov dx.cl or bl.cp mov al.bl mov dx.al call delay ror al.1001h l1:dec bx jnz l1 loop l2 ret delay endp code ends end start .pa out dx.2345h l2:mov bx.pa out dx.4ch int 21h delay proc mov cx.4ch int 21h code ends end start ps(Clifton) data segment cp equ 0e803h pa equ 0e800h data ends assume cs:code.al mov al.1 mov dx.1 jmp again mov ah.ds:data code segment start:mov ax.4 ror ah.ax mov dx.data mov ds.80h out dx.pa out dx.1 mov dx.al mov ah.al call delay ror al.ah not bl mov al. cp mov al.al pop bx pop cx loop l1 inc si dec bh jnz l2 mov ah.ax mov dx.al mov dx.0A4h.ds:data code segment .1 push bx mov al.0 mov bh.pc mov al.4 l2:mov cx.0 out dx.pc mov al.0B0h.7 seg dis(Clifton) data segment pb equ 0e801h pc equ 0e802h cp equ 0e803h disp db 0F9h.data mov ds.disp[si] l1:push cx rol bl.pb out dx.80h out dx.4ch int 21h code ends end start stepper motor(clifton) data segment cp equ 0e803h pa equ 0e800h data ends assume cs:code.bl mov dx.1 out dx.99h data ends assume cs:code.ds:data code segment start:mov ax.8 mov bl.al mov si.al mov dx. 0 .09h mov dx.80h out dx.4ch int 21h delay proc mov cx.start:mov ax.20h again: push ax push cx mov dx.data mov ds.20h again1:push ax push cx mov dx.1 loop again mov cx.ax mov dx.0eeeeh l2:mov bx.0eeeeh l1:dec bx jnz l1 loop l2 ret delay endp code ends end start Time (clifton) printstring macro msg mov ah.al call delay pop cx pop ax rol al.al call delay pop cx pop ax ror al.88h mov cx.al mov al.cp mov al.1 loop again1 mov ah.offset msg int 21h endm home macro mov ah.2 mov bh.pa out dx.pa out dx. mov dx.0 mov dx.2ch int 21h mov hrs.cl mov sec.0 mov ah.0 int 21h mov ah.disp mov ah.194fh mov ax.ax mov bh.0 mov dx.00h mov al.bh mov bh.0 int 10h endm data segment msg1 db ':$' hrs db ? min db ? sec db ? disp db 20 dup(?) data ends code segment assume cs:code.data mov ds.8 int 21h mov bl.00h mov al.dh lea si.min call hextoascii printstring disp printstring msg1 mov ah.2 mov bh.00h mov al.ch mov min.sec call hextoascii printstring disp jmp last hextoascii proc near push ax push bx push cx push dx .hrs call hextoascii printstring disp printstring msg1 mov ah.ah mov cx.600h int 10h home mov ah.ds:data start:mov ax. 1 cmp al.al loop up2 inc si mov al.10 up1:mov dx.'0' mov [si].'$' mov [si].16 jnz l1 mov dx.al pop si pop dx pop cx pop bx pop ax ret hextoascii endp last:code ends end start up counter(Clifton) data segment pa equ 0e800h pb equ 0e801h cp equ 0e803h data ends assume cs:code.pa out dx.0 l1:push ax mov dx.ax mov dx.push si mov cx.'0' push dx inc cx cmp ax.cp mov al.pa .ds:data code segment start:mov ax.10 jge up1 add al.al mov al.82h out dx.00 div bx add dl.00 mov bx.al up2:pop ax inc si mov [si].data mov ds.al call delay pop ax add al. 80h out dx.0C6H.1 out dx.bl mov dx.0 out dx.al l7: mov si.88H disp2 db 89H. MOV CX.4 l2: mov cx.out dx.1 push bx mov al.8 .al mov ah.0 mov bh.cp mov al.4ch int 21h delay proc mov bx.al pop bx pop cx loop l1 inc si dec bh jnz l2 call delay .0c7H.disp1[si] l1: push cx rol bl.pc mov al.ax mov dx.pc mov al.pb out dx.92H.ds:data code segment start:mov ax.interface 7 segment display for ecsa and help data segment pb equ 0e801h pc equ 0e802h cp equ 0e803h disp1 db 86H.86H.al mov dx.8CH data ends assume cs:code.0ffffh l3:mov dx.al mov dx.0ffffh l2:dec dx jnz l2 dec bx jnz l3 ret delay endp code ends end start .08 mov bl.data mov ds. al mov dx.al mov dx. 0ffffh l5: mov dx.1 out dx..pc mov al.4ch int 21h delay proc push bx push dx mov bx.al pop bx pop cx loop l4 inc si dec bh jnz l3 call delay jmp l7 mov ah. MOV BL.08 mov bl.1 push bx mov al.0 out dx.ds:data code segment start:mov ax.bl mov dx.pc mov al. 0ffffh l6:dec dx jnz l6 dec bx jnz l5 pop dx pop bx ret delay endp code ends end start to count no.4 l3: mov cx.0 mov bh. JMP L1 mov si. of vowels data segment mem1 db 'engineer' mem2 db ? data ends assume cs:code.disp2[si] l4: push cx rol bl.pb out dx.data .DISP2[SI] . 9 MOV DI.'e' je next cmp al.0 BACK:MOV AL.DATA MOV DS.AX MOV SI.'i' je next inc si loop again jmp last next:inc bl inc si loop again last:mov mem2.0 mov cx.STR1[SI] CMP AL.bl mov ah.BL .STR2[DI] MOV BL.STR1[SI] MOV STR2[DI].ax mov si.mov ds.AL DEC SI INC DI LOOP BACK MOV SI.0 MOV CX.mem1[si] cmp al.8 MOV CX.0 mov bl.DS:DATA CODE SEGMENT START:MOV AX.8 again:mov al.9 AGAIN:MOV AL.0 MOV DI.4ch int 21h code ends end start string palindrome DATA SEGMENT STR1 DB 'MALAYALAM' STR2 DB 9 DUP(?) REQ DB ? DATA ENDS ASSUME CS:CODE. cl call fact mov res2.bx mov ax.bx mov al.res1 mov dx.ax mov ah.0FFH JMP END2 NOTCODE:MOV REQ.ax mov al.00 mov bx.res2 div bx mov res3.data mov ds.n mov cl.r sub al.4ch int 21h jmp last fact proc mov bh.n call fact mov res1.al .00H END2: MOV AH.ds:data code segment start:mov ax.JZ LAST JMP NOTCODE LAST:INC SI INC DI LOOP AGAIN MOV REQ.4CH INT 21H CODE ENDS END START Npr factorial data segment n db 5 r db 3 res1 dw ? res2 dw ? res3 dw ? data ends assume cs:code. 10.'column no= $' msg2 db 13.09H MOV DX.DATA MOV DS.10.ax ret fact endp last: code ends end start keyboard matrix n to find row n column no. PRINTSTRING MACRO MSG push ax push dx MOV AH.'the pressed key is= $' msg1 db 13.90H MOV DX.CR OUT DX.10.AX GETKEY: MOV BH.AX MOV AX.OFFSET MSG INT 21H pop dx pop ax ENDM DATA SEGMENT ROW DB 00 COLUMN DB 00 msg db 13.'row no= $' CR EQU 0E803H PA EQU 0E800H PB EQU 0E801H PC EQU 0E802H DATA ENDS ASSUME CS:CODE.back:dec bh mul bh cmp bh.DS:DATA CODE SEGMENT START: MOV AX.01H .10.01h jz next jmp back next:mov bx. 00H mov ah.01H CMP CL.01H JZ DISP INC BL SHR CH.00H CHECK: MOV CL.BH MOV DX. DL CMP DL. DH OR DL. 0FH MOV DL.01H INC AL cmp al.04h je n1 jmp n2 n1:mov column.01H inc ah cmp ah.00 jmp m3 m2:mov row.BL AND DH.CH AND CL.00 jmp n3 n2: mov column.ah m3: CMP BH.AL MOV DX.PB OUT DX.DX MOV CH.10H JNZ SCANLINES JMP GETKEY disp: MOV DH.AL MOV AL. 9 .PA IN AL.04H JNZ CHECK SHL BH.00h SCANLINES: MOV AL.MOV BL.al n3: CMP AL.04h je m1 jmp m2 m1:mov row. 6789H.JA L1 ADD DL. 37H printstring msg MOV AH.30h mov ah.N . 0FFFFH DELAY: MOV AX.02h int 21h printstring msg2 mov dl.DS:DATA CODE SEGMENT START:MOV AX. 20H MOV AH.02h int 21h MOV CX.4CH INT 21H CODE ENDS END START 16 bit binary search DATA SEGMENT ARRAY DW 1234H. 2 INT 21H printstring msg1 mov dl.30h mov ah. 2 INT 21H JMP L2 L1: ADD DL.0FFFFH DELAY1: DEC AX JNZ DELAY1 LOOP DELAY JMP GETKEY MOV AH.row add dl. 2 INT 21H L2: MOV DL.0ADE4H N DB 5H KEY DW 0ADE4H SEARCH DW ? DATA ENDS ASSUME CS:CODE.DATA MOV DS.7895H.column add dl.AX MOV DL. 30H printstring msg MOV AH.4567H. MOV CX.0FFH JMP END1 FAILURE:MOV SEARCH.SI CMP CX.AX ADD SI.01 MOV SI.4CH INT 21H CODE ENDS END START Binary search PRINTSTRING MACRO MSG PUSH AX PUSH DX MOV AH.DX SHR AX.3456H.00H END1: MOV AH.OFFSET MSG INT 21H POP DX POP AX ENDM DATA SEGMENT ARRAY DW 1234H.AX JMP AGAIN BIGGER:JE SUCCESS INC AX MOV BX.BX ADD AX.5678H KEY DW 3456H N DW 5 MSG_FOUND DB 'KEY IS FOUND AND IS AT POSITION: $' SPACE DB ' $ ' MSG_NOT DB 'KEY IS NOT FOUND :$' DATA ENDS .[SI] JAE BIGGER DEC AX MOV DX.1265H.'1' MOV SEARCH.KEY MOV BX.DX JA FAILURE MOV AX.09H MOV DX.00 DEC DX AGAIN:CMP BX.AX JMP AGAIN SUCCESS: ADD AL.4560H. ASSUME CS:CODE.BX ADD AX.DS:DATA CODE SEGMENT START:MOV AX.[SI] JAE BIGGER DEC AX MOV DX.AX ADD SI.00 MOV DX.DX JA FAILURE MOV AX.DATA MOV DS.AX MOV CX.'1' MOV SPACE.DX SHR AX.N DEC DX AGAIN:CMP BX.01 MOV SI.AL PRINTSTRING MSG_FOUND JMP END1 FAILURE:PRINTSTRING MSG_NOT END1:MOV AH.AX JMP AGAIN BIGGER:JE SUCCESS INC AX MOV BX.AX JMP AGAIN SUCCESS:ADD AL.4CH INT 21H CODE ENDS END START .SI CMP CX.KEY MOV BX.
Copyright © 2024 DOKUMEN.SITE Inc.