Mp Manual

The Eduladder is a community of students, teachers, and programmers just interested to make you pass any exams. So we solve previous year question papers for you.
See Our team
Wondering how we keep quality?
Got unsolved questions?

Ask Questions


You are here:Open notes-->VTU-->Mp-Manual

Mp Manual

1a) Search a key element in a list of ‘n’ 16-bit numbers using the Binary search algorithm

.model small

.stack 64

.data array dw 0010h, 0020h, 0030h, 0040h, 0050h N db 5 key dw 0070h msg1 db 'successfull$' msg2 db 'un-sucessfull$' .code mov ax,@data ;Initialization of data segment mov ds,ax mov cl,key ;Direct memory accessing mov dl,N ;High mov bl,00 ;Low Back:cmp bl,dl ;Low/high jg exit mov al,bl ;AX=low add al,dl ;Low+high/2=mid shr ax,01 mov ah,00 mov si,ax ; add si,si ;Doubles the value cmp cl,array[si]; ;Key with mid jae down dec al ;Mid-1 mov dl,al jmp back Down:je disp inc al mov bl,al ;Low=mid+1 jmp back Exit:lea dx,msg2 jmp skip Disp:lea dx,msg1 Skip:mov ah,09; int 21h; mov ah,4ch; int 21h END 2. a) Write ALP macros: i. To read a character from the keyboard in the module (1) (in a different file) ii. To display a character in module(2) (from different file) iii. Use the above two modules to read a string of characters from the keyboard terminated by the carriage return and print the string on the display in the next line. .model small .stack 64 INCLUDE read.asm INCLUDE display.asm .data input db 10 dup(?) msg1 db 'Input the string: $' msg2 db 'The entered string: $' .code mov ax,@data ;Initialization of data segment mov ds,ax lea dx,msg1 mov ah,09h int 21h mov si,00 Again:READ mov input[si],al inc si cmp al,13 jnz Again DISPLAY 13 ;New line DISPLAY 10 lea dx,msg2 mov ah,09h int 21h mov si,00 Back:DISPLAY input[si] inc si cmp input[si],13 jnz Back mov ah,4ch int 21h END /* Type in a new asm file :display.asm*/ DISPLAY MACRO CHAR mov dl,char mov ah,02h int 21h ENDM /* Type in a new asm file :read.asm*/ READ MACRO mov ah,01h int 21h ENDM 3 a) Sort a given set of ‘n’ numbers in ascending and descending orders using the Bubble Sort algorithm. .model small .stack 64 .data A db 10h,05h,01h,09h,09h D db 10h,05h,01h,06h,09h N dw ($-D) ;Counts the number of elements .code mov ax,@data ;Initialization of data segment mov ds,ax ;Direct memory addressing mov cx,n dec cx ;Outer loop Up:mov si,00 mov di,00 mov bx,cx ;Inner loop Again:mov al,A[si] inc si mov dl,D[di] inc di cmp al,A[si] JB skip mov ah,A[si] mov A[si],al mov A[si-1],ah Skip:cmp dl,D[di] JA exit mov dh,D[di] mov D[di],dl mov D[di-1],dh Exit:dec bx JNZ again loop up mov ah,4ch int 21h end 4a) Read an alphanumeric character and display its equivalent ASCII code at the center of the screen .mode small .stack 64 .data msg1 db 'Enter the alphanumeric character',10,13,'$' msg2 db 'Invalid Input',10,13,'$' .code mov ax,@data ;Initialization of data ;segment mov ds,ax lea dx,msg1 mov ah,09h int 21h mov ah,01h int 21h cmp al,30h jb Fail cmp al,3Ah jb Disp cmp al,41h jb Fail cmp al,5bh jb Disp cmp al,61h jb Fail cmp al,7bh jb Disp Disp:push ax mov ah,06h ;Clears the screen mov al,30h mov bh,07h mov cx,00 mov dx,184Fh int 10h mov ah,02h ;Sets the cursor position mov bh,00 mov dx,0C28h int 10h pop ax mov bl,al and al,0F0h mov cl,04h shr al,cl add al,30h mov dl,al mov ah,02h int 21h and bl,0Fh cmp bl,0ah jb Skip add bl,07h Skip:add bl,30h mov dl,bl mov ah,02h int 21h jmp exit Fail:lea dx,msg2 mov ah,09h int 21h Exit:mov ah,4ch int 21h END 5a. Reverse a given string and check whether it is a palindrome or not. .model small .stack 64 .data str1 db 'KSIT' len EQU ($-str1) ;Computing the length of the string str2 db 07 dup(?) msg1 db 'Palindrome$' msg2 db 'Not Palindrome$' .code mov ax,@data ;Initialization of data segment mov ds,ax mov es,ax ;Initialization of extra segment mov cx,len lea si,str1 add si,len dec si lea di,str2 Again:STD ;set DF=1 LODSB ;Load string byte to AL CLD ;clear DF=0 STOSB ;Store AL to ES:[DI] loop Again lea si,str1 lea di,str2 mov cx,len CLD REPE CMPSB jnz fail lea dx,msg1 jmp EXIT Fail:lea dx,msg2 EXIT:mov ah,09h int 21h mov ah,4ch int 21h END 6a.Read two strings, store them in locations STR1 and STR2.Check whether they are equal or not and display appropriate messages. Also dislpay the length of the stored strings. READ MACRO Local Back Back:mov ah,01h int 21h mov [si],al inc si inc cl cmp al,13 jne Back ENDM DISPLAY MACRO msg lea dx,msg mov ah,09h int 21h ENDM DISP_LEN MACRO len local skip,skip1 mov dl,len and dl,0f0h mov cl,04h shr dl,cl cmp dl,0ah jb Skip add dl,07h Skip:add dl,30h mov ah,02h int 21h mov dl,len and dl,0fh cmp dl,0Ah jb Skip1 add dl,07h Skip1:add dl,30h mov ah,02h int 21h ENDM .model small .stack 64 .data str1 db 20 dup(?) str2 db 20 dup(?) msg1 db 10,13,'Enter the 1st string',10,13,'$' msg2 db 10,13,'Enter the 2nd string',10,13,'$' msg3 db 10,13,'Strings are equal',10,13,'$' msg4 db 10,13,'Strings are not equal',10,13,'$' msg5 db 10,13,'length of 1st string is:$' msg6 db 10,13,'length of 2nd string is:$' count1 db ? count2 db ? .code mov ax,@data ;Initialization of data segment mov ds,ax mov es,ax ;Initialization of extra segment lea si,str1 DISPLAY msg1 mov cl,00 READ dec cl mov count1,cl lea si,str2 DISPLAY msg2 mov cl,00 READ dec cl mov count2,cl DISPLAY msg5 DISP_LEN count1 DISPLAY msg6 DISP_LEN count2 mov cl,count1 cmp count2,cl jne Fail lea si,str1 lea di,str2 REPZ CMPSB jnz Fail DISPLAY msg3 jmp Stop Fail:DISPLAY msg4 Stop:mov ah,4ch int 21h END 7a.Read your name from the keyboard and display it at the specified location on the screen in the front of the message 'WHAT IS YOUR NAME?' You must clear the entire screen before display. .model small .stack 64 .data str db 10 dup(?) msg1 db 'Enter your name: $' msg2 db 'WHAT IS YOUR NAME? $' .code mov ax,@data ;Initialization of data segment mov ds,ax lea dx,msg1 mov ah,09h int 21h lea si,str Back:mov ah,01h int 21h mov str[si],al inc si cmp al,13 JNE Back mov str[si],'$' ;Copies last position as $ mov ah,06h ;Clear the screen mov al,30h mov bh,07h mov cx,00 mov dx,1850h int 10h mov ah,02h ;Set the cursor position mov bh,00 mov dx,0c15h int 10h mov dx,00 lea dx,msg2 mov ah,09h int 21h lea dx,str mov ah,09h int 21h mov ah,4ch int 21h END 8a.Compute ncr usingrecursive procedure.Assume that n and r are non-negative integers. .model small .stack 64 .data n dw 04 r dw 03 ncr1 dw 0 .code Start:mov ax,@data ;Initialization of data segment mov ds,ax mov ax,n mov bx,r call ncr pro ;Calling the procedure NCR mov ah,4ch int 21h ncrpro proc cmp bx,ax je down1 cmp bx,01h je resn dec ax cmp bx,ax je back push ax push bx call ncrpro ;Calling the procedure NCR pop bx pop ax dec bx push ax push bx call ncrpro ;Calling the procedure NCR pop bx pop ax ret down1: inc ncr1 ret back: Inc ncr1 resn: add ncr1,ax ret ncrpro endp end start 9a.Read the current time from the system and display it in the standard format on the screen. .model small .stack 64 disp macro char push ax push dx mov dl,char mov ah,02h int 21h pop dx pop ax endm .code start: mov ah,2ch ;Getting the system time int 21h mov ah,0 call con disp ‘:’ mov al,cl call con disp ‘:’ mov al,dh call con mov ah,4ch int 21h con proc mov ah,0 aam add ax,3030h push ax disp ah pop ax disp al ret con endp end start 10a. Write a program to simulate a decimal up-counter to display 00-99. .model small .stack 64 .data Cnt db 64 Msg db “BCD up counter” Cr db 13,10,’$’ .code Start: mov ax,@data mov ds,ax lea dx,msg mov ah,09h int 21h mov cl,cnt mov al,00h LP1: call disp Loop LP1 mov ah,4ch int 21h disp proc mov al,64h sub al,cl mov bl,0ah mov ah,00h div bl xchg al,ah mov dl,ah add dl,’0’ mov ah,02h push ax int 21h pop ax mov dl,al add dl,’0’ int 21h mov dl,0dh int 21h push cx mov cx,0025h LP: loop LP Dec bx Jnz LP Pop cx Ret Disp endp End start 11a. Read a pair of input co-ordinates in BCD and move the cursor to the specified location on the screen. DISP MACRO msg lea dx,msg mov ah,09h int 21h ENDM CURSOR MACRO x,y mov ah,02h mov bh,00 mov dh,x mov dl,y int 10h ENDM Readnum MACRO N mov ah,01h int 21h sub al,30h mov n,al ENDM .model small .stack 64 .data msg1 db 'Enter the X coordinate: $' msg2 db 'Enter the Y coordinate: $' msg3 db 10,13,'$' x db ? x1 db ? x2 db ? y db ? y1 db ? y2 db ? .code mov ax,@data ;Initialization of data segment mov ds,ax DISP msg1 Readnum x1 Readnum x2 mov al,x1 mov bl,10 Mul bl add al,x2 mov x,al DISP msg3 DISP msg2 Readnum y1 Readnum y2 mov al,y1 mov bl,10 mul bl add al,y2 mov y,al CURSOR x,y mov ah,01h int 21h mov ah,4ch int 21h END 12a. Program to create a file(input file) and to delete an existing file. .model small .stack 64 .data str1 db 10 dup(?) str2 db 10 dup(?) msg1 db 'Enter the filename to be created',10,13,'$' msg2 db 'The file is created',10,13,'$' msg3 db 'File is not created',10,13,'$' msg4 db 'Enter the filename to be deleted',10,13,'$' msg5 db 'File is deleted',10,13,'$' msg6 db 'File cannot be deleted',10,13,'$' .code mov ax,@data ;Initialization of data segment mov ds,ax lea dx,msg1 mov ah,09h int 21h lea si,str1 Up:mov ah,01h int 21h cmp al,13 je Skip mov [si],al inc si jmp up Skip:lea dx,str1 mov cx,00 mov ah,3ch ;Creating a file int 21h jc Fail lea dx,msg2 jmp exit Fail:lea dx,msg3 Exit:mov ah,09h int 21h lea dx,msg4 mov ah,09h int 21h lea si,str2 Up1:mov ah,01h int 21h cmp al,13 je Skip1 mov [si],al inc si jmp up1 Skip1:lea dx,str2 mov ah,41h ;Deleting a file int 21h jc Fail1 lea dx,msg5 jmp Exit1 Fail1:lea dx,msg6 Exit1:mov ah,09h int 21h mov ah,4ch int 21h END 1b) Read the status of eight input bits from the Logic Controller Interface and display ‘FF’ if it is even parity bits otherwise display 00. Also display number of 1’s in the input data .model small .stack 64 .code mov al,82h mov dx,0ffe3h OUT dx,al mov dx,0ffe1h IN al,dx mov bl,al cmp al,00 JP Disp mov al,00 jmp Skip Disp:mov al,0ffh Skip:mov dx,0ffe0h OUT dx,al mov ah,02h Int 21h mov ah,4ch Int 21h END 2b) Perform the following using the Logic Controller Interface. i. BCD up-down Counter .model small .stack 64 .code mov al,82h mov dx,0ffe3h OUT dx,al CALL BCD mov ah,4ch int 21h BCD PROC push bx push ax mov dx,0ffe0h mov ah,00 Outloop:mov bh,00 Inloop:mov al,ah mov cl,04 SHL al,cl OR al,bh OUT dx,al CALL DELAY Call delay Call delay inc bh cmp bh,09 JBE Inloop inc ah cmp ah,09h JBE Outloop mov ah,09 Outloop1:mov bh,09 Inloop1:mov al,ah mov cl,04 SHL al,cl OR al,bh OUT dx,al CALL DELAY Call delay Call delay dec bh cmp bh,00 JGE Inloop1 pop cx pop bx RET BCD ENDP DELAY PROC push cx push bx mov cx,0fffh Again1:mov bx,0ffffh Again: Dec bx JNZ Again Loop again1 pop bx pop cx RET DELAY ENDP END 3b) Read the status of two 8-bit inputs (X & Y ) from the Logic Controller Interface and display X*Y. .model small .stack 64 .data x db ? y db ? .code mov ax,@data mov ds,ax mov al,82h mov dx,0ffe3h OUT dx,al mov dx, 0ffe1h IN al,dx mov x,al Up:mov ah,01h Int 16h JZ Up IN al,dx mov y,al MUL x mov dx,0ffe0h OUT dx,al Up1: mov ax,01h Int 16h JZ Up1 Mov al,bl OUT dx,al mov ah,4ch Int 21h END 4b) Display messages FIRE and HELP alternately with flickering effects on a 7-segment display interface for a suitable period of time. Ensure a flashing rate that makes it easy to read both the messages (Examiner does not specify these delay values nor it is necessary for the student to compute these values) .model small .stack 64 .data FIRE db 8eh,0f9h,88h,86h HELP db 89h,86h,0c3h,8ch .code mov ax,@data mov ds,ax mov al,80h mov dx,0ffe3h OUT dx,al Back:lea si,FIRE CALL disp CALL delay CALL delay lea si,HELP CALL disp CALL delay CALL delay mov ah,01h Int 16h JZ Back mov ah,4ch Int 21h Disp PROC mov cl,04 add si,03 Again1:mov bl,08 mov al,[si] Again:ROL al,01 mov dx,0ffe1h OUT dx,al push ax mov dx,0ffe2h mov al,00 OUT dx,al mov al,0ffh OUT dx,al pop ax dec bl JNZ Again dec si loop Again1 RET disp ENDP delay PROC push cx push bx mov cx,0fffh Again2:mov bx,0fff1h Again3: dec bx JNZ Again3 Loop Again2 pop bx pop cx RET delay ENDP END 5b) Assume any suitable message of 12 characters length and display it in the rolling fashion on a 7-segment display interface for a suitable period of time. Ensure a flashing rate that makes it easy to read both the messages. (Examiner does not specify these delay values nor it is necessary forthe student to compute these values). .model small .stack 64 .data msg db 8eh,0f9h,88h,86h,0ffh,0c6h,88h,0c7h,0c7h,0ffh,89h,86h,0c7h,8ch cw equ 0ffe3h pa equ 0ffe0h pb equ 0ffe1h pc equ 0ffe2h .code mov ax,@data mov ds,ax mov al,80h mov dx,cw OUT dx,al Back:mov cl,11 lea si,msg Again4:PUSH cx call disp call delay inc si inc si pop cx loop again4 mov ah,01h int 16h jz back mov ah,4ch int 21h Disp PROC mov cl,04 add si,03 Again1:mov bl,08 mov al,[si] Again:ROL al,01 mov dx,pb OUT dx,al push ax mov dx,pc mov al,00 OUT dx,al mov al,0ffh OUT dx,al pop ax dec bl JNZ Again dec si loop Again1 RET disp ENDP ; mov cl,04 ; mov si,03 delay PROC push cx push bx mov cx,0ffffh Again2:mov bx,0ffffh Again3: dec bx JNZ Again3 Loop Again2 pop bx pop cx RET delay ENDP END 6b) Convert a 16-bit binary value (assumed to be an unsigned integer) to BCD and display it from left to right and right to left for specified number of times on a 7-segment display interface. .model small .stack 64 .data Table db 0c0h,0f9h,0a4h,0b0h,99h,92h,82h,0f8h,80h,90h BIN dw 0016h BCD db 04 dup(?) SSC db 04 dup(?) REV db 04 dup(?) cw equ 09c03h pa equ 09c00h pb equ 09c01h pc equ 09c02h .code mov ax,@data mov ds,ax mov al,80h mov dx,cw OUT dx,al lea si,bcd mov ax,bin mov bx,1000 CALL conversion mov bx,100 CALL conversion mov bx,10 CALL conversion mov [si],dx lea bx,table mov cl,04 lea si,ssc lea di,bcd Back:mov al,[di] xlat mov [si],al inc si inc di loop back lea si,ssc+3 lea di,rev mov cl,04 Up:mov al,[si] mov [di],al inc di dec si Loop up Agn:lea si,ssc CALL disp CALL delay lea si,rev CALL disp CALL delay mov ah,01h int 16h JZ Agn mov ah,4ch int 21h conversion PROC mov dx,00 DIV bx mov [si],ax inc si mov ax,dx ret conversion endp Disp PROC mov cl,04 add si,03 Again1:mov bl,08 mov al,[si] Again:ROL al,01 mov dx,09c01h OUT dx,al push ax mov dx,09c02h mov al,00 OUT dx,al mov al,0ffh OUT dx,al pop ax dec bl JNZ Again dec si loop Again1 RET disp ENDP delay PROC push cx push bx mov cx,0ffffh Again2:mov bx,0ffffh Again3: dec bx JNZ Again3 Loop Again2 pop bx pop cx RET delay ENDP END 7b) Scan a 8 x 3 keypad for key closure and to store the code of the key pressed in a memory location or display on screen. Also display row and column numbers of the key pressed .model small .stack 5000h .data Msg3 db ‘this program is running’ 13,10 ‘press any key to EXIT’ Msg4 db ‘the key you pressed is : row : col’,’$’ Keys db ‘0 1 2 3 4 5 6 7 8 9 A B C D E F’,’$’ Show db ‘0 1’,’$’ Row db ‘1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 ‘, ‘$’ Col db ‘1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4’, ‘$’ Cr equ 0ffe3h Pa equ 0ffe0h Pb equ 0ffe1h Pc equ 0ffe2h .code Mov ax, @data Mov ds, ax Mov ah, 09h Mov dx, offset msg3 Int 21h Mov ax, 90h Mov dx, cr Out dx, al Lea si, row Mov di, 01h Mov row, 01h Getkey: mov dh, 01h Mov bl, 00h Scanlines: Mov al, bh Mov dx, pb Out dx, al Mov dx, pa In al, dx Mov ch, al Mov al, 00h Check: mov cl, ch And cl, 01h Cmp cl, 01h Jz display Inc al ; inc byte ptr[si] Cmp al, 04h Jnz check SHL bh, 01h Cmp bh, 10h Jnz scanlines Jmp loopout Display:mov ah, 09h Mov dx, offset msg4 Int 21h Mov ax, 0000h Mov al, bl Mov bl, 02h Mul bl Mov bx, ax Mov al, keys[bx] Mov show[0h], al Mov al, keys[bx + 1h] Mov show[1h], al Mov ah, 09h Mov dx, offset show Int 21h Mov al, row[bx + 1h] Mov show[0h], al Mov dx, offset show Mov ah, 09h Int 21h Mov al, col[bx + 1h] Mov show[0h], al Mov dx, offset show Mov ah, 09h Int 21h Loopout:mov ah, 01h Int 16h Jz getkey Mov ah, 4ch Int 21h end 8b) Drive a stepper motor interface to rotate the motor in clock wise or anti-clockwise direction by N steps (N is specified by the examiner). Introduce suitable delay between successive steps ( Any arbitrary value for he delay may be assumed by the student). .model small .stack 64 .data N db 10 .code mov ax,@data mov ds,ax mov al,80h mov dx,0ffe3h OUT dx,al mov cl,N mov al,88h mov dx,0ffe0h Up: OUT dx,al CALL DELAY rol al,01 Loop up mov ah,4ch Int 21h DELAY PROC PUSH cx PUSH bx mov cx,0fffh Again1:mov bx,0fffh Again: NOP NOP dec bx JNZ Again Loop Again1 POP bx POP cx RET DELAY ENDP END 9b) Generate the Sine Wave using DAC interface (The output of the DAC is to be displayed on the CRO). .model small .stack 64 .data Table db 0h,16h,2bh,3fh,51h,61h,6dh,77h,7dh,7fh,7dh,77h,6dh,61h,51h,3fh,2bh,16h,0h cw equ 0ffe3h pa equ 0ffe0h pb equ 0ffe1h pc equ 0ffe2h .code mov ax,@data mov ds,ax mov al,80h mov dx,cw OUT dx,al Again:mov cl,20 mov dx,pb lea si,table Up:mov al,[si] add al,7fh OUT dx,al CALL delay inc si loop Up mov cl,20 lea si,Table Up1:mov al,[si] add al,7fh NEG al OUT dx,al CALL delay inc si Loop Up1 mov ah,01h int 16h JZ Again mov ah,4ch int 21h delay PROC push cx push bx mov cx,0ffh Again2:mov bx,0ffh Again3: dec bx JNZ Again3 Loop Again2 pop bx pop cx RET delay ENDP END 10 b) Generate a Half Rectified Sine wave form using the DAC interface. (The output of the DAC is to be displayed on the CRO). .model small .stack 64 .data Table db 00,22,43,63,82,97,110,119,125,127,125,119, 110,97,82,63,43,22,00 cw equ 0ffe3h pa equ 0ffe0h pb equ 0ffe1h pc equ 0ffe2h .code mov ax,@data mov ds,ax mov al,80h mov dx,cw OUT dx,al Again:mov cl,20 mov dx,pb lea si,table Up:mov al,[si] add al,7fh OUT dx,al CALL delay inc si loop Up mov cl,20 Up1:CALL delay Loop Up1 mov ah,01h int 16h JZ Again mov ah,4ch int 21h delay PROC push cx push bx mov cx,0ffh Again2:mov bx,0ffh Again3: dec bx JNZ Again3 Loop Again2 pop bx pop cx RET delay ENDP END 11b) Generate a Fully Rectified Sine waveform using the DAC interface. (The output of the DAC is to be displayed on the CRO). .model small .stack 64 .data Table db 00,22,43,63,82,97,110,119,125,127,125,119, 110,97,82,63,43,22,00 cw equ 0ffeh pa equ 0ffeh pb equ 0ffe1h pc equ 0ffe2h .code mov ax,@data mov ds,ax mov al,80h mov dx,cw OUT dx,al Again:mov cl,20 mov dx,pb lea si,table Up:mov al,[si] add al,7fh OUT dx,al CALL delay inc si loop Up mov ah,01h int 16h JZ Again mov ah,4ch int 21h delay PROC push cx push bx mov cx,0ffh Again2:mov bx,0ffh Again3: dec bx JNZ Again3 Loop Again2 pop bx pop cx RET delay ENDP END 12b) Drive an elevator interface in the following way: i. Initially the elevator should be in the ground floor, with all requests in OFF state. ii. When a request is made from a floor, the elevator should move to that floor, wait there for a couples of seconds, and then come down to ground floor and stop. If some requests occur during going up or coming down they should be ignored. 15b. .model small .stack 64 .data table db 0e0h,0d3h,0b6h,79h cw equ 0ffe3h pa equ 0ffe0h pb equ 0ffe1h pc equ 0ffe2h .code mov ax,@data mov ds,ax mov al,82h mov dx,cw out dx,al lea si,table mov al,0f0h mov dx,pa out dx,al Back:CALL request JZ Back shr al,01 JNC Gfloor shr al,01 JNC Ffloor shr al,01 JNC Sfloor shr al,01 JNC Tfloor Gfloor:CALL delay CALL delay CALL reset mov ah,4ch int 21h Ffloor:mov cl,03 mov al,0f0h CALL moveup CALL delay CALL delay inc si CALL reset mov cl,03 CALL movedown mov ah,4ch int 21h Sfloor:mov cl,06 mov al,0f0h CALL moveup CALL delay CALL delay add si,02 CALL reset mov cl,06 CALL movedown mov ah,4ch int 21h Tfloor:mov cl,09 mov al,0f0h CALL moveup CALL delay CALL delay add si,03 CALL reset mov cl,09 CALL movedown mov ah,4ch int 21h Request PROC mov dx,pb IN al,dx and al,0fh cmp al,0fh RET request endp moveup PROC mov dx,pa up:inc al OUT dx,al CALL delay loop up RET moveup endp movedown PROC mov dx,pa or al,cl OUT dx,al dec al call delay down:OUT dx,al CALL delay dec al loop down RET movedown endp reset PROC mov dx,pa mov al,[si] OUT dx,al RET reset endp delay PROC push cx push bx mov cx,0fffh Again2:mov bx,0ffffh Again3:NOP NOP dec bx JNZ Again3 Loop Again2 pop bx pop cx RET delay ENDP END

Editors

scribed


Join eduladder!