A

@aditya_nk11

exam

Assembly
4 years ago
%macro print 4 ;macro for printing data mov rax,%1 ;func num for outputting data mov rdi,%2 ;file descriptor ID for output device(monitor) mov rsi,%3 ;starting address of the string mov rdx,%4 ;number of bytes to be displayed syscall %endmacro section .data ;initialized variable declaration msg db "Addition of the numbers is: "

ADDITION IN ARRAY

Assembly
4 years ago
;WRITE ALP FOR ADDITION OF ARRAY ELEMENTS in HEX(ADDITION OF N HEX NUMBER) %macro print 2 ;macro to print mov rax,1 mov rdi,1 mov rsi,%1 mov rdx,%2 syscall %endmacro

Only gdtr

Assembly
4 years ago
%macro scall 4 mov rax, %1 mov rdi, %2 mov rsi, %3 mov rdx, %4 syscall %endmacro section .data msg1 db 10,"Contents of GDTR: " msg1len equ $-msg1

Addition of elements in the array(hard code)

Assembly
4 years ago
%macro s 4 mov rax,%1; mov rdi,%2; mov rsi,%3; mov rdx,%4; syscall %endmacro section .data msg db "Addition of numbers is "

MA LAB 3: GDTR, LDTR, MSW

Assembly
4 years ago
%macro scall 4 mov rax, %1 mov rdi, %2 mov rsi, %3 mov rdx, %4 syscall %endmacro section .data msg db "The processor is in protected mode",10 msglen equ $-msg

Name, panel and roll number

Assembly
4 years ago
%macro scall 4 mov rax,%1 mov rdi,%2 mov rsi,%3 mov rdx,%4 syscall %endmacro section .data m1 db 10d,"ENTER NAME: "

MA Lab 8

Assembly
4 years ago
%macro scall 4 ;macro with 4 parameters mov rax, %1 mov rdi, %2 mov rsi, %3 mov rdx, %4 syscall %endmacro section .data m1 db 10d,"The Vendor ID string is: "

MA Lab 8 Password

Assembly
4 years ago
%macro scall 4 mov rax,%1 mov rdi,%2 mov rsi,%3 mov rdx,%4 syscall %endmacro section .data password db "Adidas"

Sorting array MA5

Assembly
4 years ago
%macro print 2 ;macro for printing the o/p mov rax,1 mov rdi,1 mov rsi,%1 mov rdx,%2 syscall %endmacro section .data array db 22h,0a0h,82h,19h,0ffh

MA LAB 5: array of integers

Assembly
4 years ago
;WRITE ALP FOR ADDITION OF ARRAY ELEMENTS in HEX(ADDITION OF N HEX NUMBER) %macro print 2 ;macro to print mov rax,1 mov rdi,1 mov rsi,%1 mov rdx,%2 syscall %endmacro

MA LAB 1 final

Assembly
4 years ago
%macro scall 4 ;general macro with 4 parameters mov rax,%1 mov rdi,%2 mov rsi,%3 mov rdx,%4 syscall ;call the kernel (interrupt) %endmacro section .data menu db 10d,13d," MENU"

MA LAB 3 final

Assembly
4 years ago
%macro scall 4 mov rax, %1 ; func num for o/p data mov rdi, %2 ; file descriptor ID for monitor mov rsi, %3 ; starting address of string mov rdx, %4 ; number of bytes to be displayed syscall ; inbulit func %endmacro section .data msg db "The processor is in protected mode",10 msglen equ $-msg

MA LAB 3

Assembly
4 years ago
%macro scall 4 mov rax,%1 ; func num for o/p data mov rdi,%2 ; file descriptor ID for monitor mov rsi,%3 ; starting address of string mov rdx,%4 ; number of bytes to be displayed syscall ; inbulit func %endmacro section .data ;initialized variable declaration msg1 db "Machine is in Protected Mode" msg1len equ $-msg1

MA Lab 1: final

Assembly
4 years ago
%macro scall 4 mov rax,%1 ;function number for writing or o/p data mov rdi,%2 ;file descriptor id for monitor mov rsi,%3 ;starting address of string to be displayed mov rdx,%4 ;number of bytes to be displayed syscall %endmacro section .data ;initialized variable declaration menu db 10d,13d,"!!!!MENU!!!!" ;messages db 10d,"1.ENTER A STRING"

MA Lab 2(1): Hard coded factorial

Assembly
4 years ago
section .data num db 5 result db 0,0,0,0 section .text global _start _start: mov ax,1 mov bh,0 mov bl,[num] call fact

MA Lab 2(2): Factorial with user input

Assembly
4 years ago
%macro write 4 mov rax,%1 ; func num for o/p data mov rdi,%2 ; file descriptor ID for monitor mov rsi,%3 ; starting address of string mov rdx,%4 ; number of bytes to be displayed syscall ; inbulit func %endmacro section .bss ;uninitialized variable declaration input resb 1

MA Lab 1

Assembly
4 years ago
%macro scall 4 ;general macro with 4 parameters mov rax,%1 ;read syscall mov rdi,%2 ;keyboard mov rsi,%3 ;variable mov rdx,%4 ;variable lenght in bytes syscall ;call the kernel %endmacro section .data menu db 10d,13d,"--Menu--"

Factorial

Assembly
4 years ago
%macro rw 4 mov rax,%1 mov rdi,%2 mov rsi,%3 mov rdx,%4 syscall %endmacro section .data msg db "factorial of no=", 10

Printing a string using macro

Assembly
4 years ago
%macro disp 4 ;name of macro 4 parameters are used mov rax,%1 ;read syscall mov rdi,%2 ;keyboard mov rsi,%3 ;variable mov rdx,%4 ;variable length syscall %endmacro section .data msg db "Enter your name: ",10 msglen equ $-msg

Printing a given string

Assembly
4 years ago
section .data msg db "Enter your name: ",10 msglen equ $-msg newline db 10 section .bss name resb 1 temp resb 1 section .text global _start