Posts

Showing posts with the label Microprocessor Lab

Write 80387 ALP to obtain: i) Mean ii) Variance iii) Standard Deviation Also plot the histogram for the data set.

Second Year Computer Engineering Microprocessor Programs: Microprocessor Lab: Practical 12: Write 80387 ALP to obtain: i) Mean ii) Variance iii) Standard Deviation Also plot the histogram for the data set. ---------------------------------------------------------------------------------------------------------------------------------- %macro print 2     mov rax,01     mov rdi,01     mov rsi,%1     mov rdx,%2     syscall %endmacro section .data     m0 db 10,"Program to calculate mean, variance, standard deviation:"     l0:equ $-m0          m1 db 10,"Mean is"     l1:equ $-m1          m2 db 10,"Variance is"     l2:equ $-m2           m3 db 10,"Standard Deviation is"     l3:equ $-m3          m4 db 10,"Values are: 102.59, 198.21, 100.67" ...

Write 80387 ALP to plot Sine Wave, Cosine Wave and Sinc function. Access video memory directly for plotting

Second Year Computer Engineering Microprocessor Programs: Microprocessor Lab: Practical 11:              Write 80387 ALP to plot Sine Wave, Cosine Wave and Sinc function. Access video memory directly for plotting This program is performed using TASM on windows operating system. ---------------------------------------------------------------------------------------------------------------------------------- ;sin.asm ;Y=100-60 sin((pi/180)*x) ;Bit    7  6  5  4  3  2  1  0 ;Data   R  R  R  G  G  G  B  B .387 .model small .stack 100 .data msg db 10,13,'this is Sine wave$' one_eighty dw 180 scale dw 30 hundred dw 100 rint dw 0 x dw 0 .code main:  mov ax,@data            ; Initialize DS (needed for .exe-program)     mov ds, ax     mov ax, 0A000h  ...

Write 80387 ALP to find the roots of the quadratic equation.

Second Year Computer Engineering Microprocessor Programs: Microprocessor Lab: Practical 10: Write 80387 ALP to find the roots of the quadratic equation. All the possible cases must be considered in calculating the roots: Create three files : 1.Quad.asm 2.Rootmain.c 3.root.asm ---------------------------------------------------------------------------------------------------------------------------------- ;quad.asm section .data msg1 db "Complex Root",10 msglen1 equ $-msg1 msg2 db "Root1: " msglen2 equ $-msg2 msg3 db "Root2: " msglen3 equ $-msg3 a dd 1.00 b dd -6.00 c dd 8.00 four dd 4.00 two dd 2.00 hdec dq 100 point db "." section .bss root1 resd 1 root2 resd 1 resbuff rest 1 temp resb 2 disc resd 1 %macro write 2 ;macro for display mov rax,1 mov rdi,1 mov rsi,%1 mov rdx,%2 syscall %endmacro %macro read 2 ;macro for input mov rax,0 mov rdi,0 mov rsi,%1 m...

Write x86 ALP to find the factorial of a given integer number on a command line by using recursion.

Second Year Computer Engineering Microprocessor Programs: Microprocessor Lab: Practical 9: Write x86 ALP to find the factorial of a given integer number on a command line by using recursion. Explicit stack manipulation is expected in the code. ---------------------------------------------------------------------------------------------------------------------------------- %macro dispmsg 2 mov rax,1 mov rdi, 1 mov rsi, %1 mov rdx, %2 syscall %endmacro %macro exitprog 0 mov rax, 60 mov edi,0 syscall %endmacro %macro gtch 1 mov rax, 0 mov rdi, 0 mov rsi, %1 mov rdx, 1 syscall %endmacro section .data nwline db 10 m0 db 10,10,"Program to calculate factorial of a given number.",10,10 l0 equ $-m0 m2 db 10,"Enter Number (2 digit HEX no) : " l2 equ $-m2 m4 db 10,"The factorial is : " l4 equ $-m4 factorial  dq 1 section .bss no1 resq 1 input resb 1 output resb 1 section .text global _start _start : dispmsg m0...

Write X86 menu driven(ALP) to implement OS (DOS) commands TYPE, COPY and DELETE using file operations.

Second Year Computer Engineering Microprocessor Programs: Microprocessor Lab: Practical 7: Write X86 menu driven Assembly Language Program (ALP) to implement OS (DOS) commands TYPE, COPY and DELETE using file operations. User is supposed to provide command line arguments in all cases. ---------------------------------------------------------------------------------------------------------------------------------- %macro cmn 4 ;input/output mov rax,%1 mov rdi,%2 mov rsi,%3 mov rdx,%4 syscall %endmacro %macro fopen 1 mov rax,2 ;open mov rdi,%1 ;filename mov rsi,2 ;mode RW mov rdx,0777o ;File permissions syscall %endmacro %macro fread 3 mov rax,0 ;read mov rdi,%1 ;filehandle it means reference to the file it may a number,it is likr a filepointer mov rsi,%2 ;buf mov rdx,%3 ;buf_len syscall %endmacro %macro fwrite 3 mov rax,1 ;write/print mov rdi,%1 ;filehandle mov rsi,%2 ;...