@Zahra

LAB4 final

January 14, 2021 · Assembly
%macro rw 4
    mov rax, %1
    mov rdi, %2
    mov rsi, %3
    mov rdx, %4
    syscall
%endmacro

section .data
    menu db 13d, "----Menu----"
         db 10d, "1.Enter a string"

LAB 3

January 04, 2021 · Assembly
section .data
Num_Array db 11h,12h,13h,14h,15h,16h,17h,18h,19h,20h

msg db "Result of array addition is", 10
msglen equ $-msg

newline db 10

section .bss
sum resw 1
temp resw 2 

LAB 4

January 04, 2021 · Assembly
%macro scall 4
     mov rax,%1
     mov rdi,%2
     mov rsi,%3
     mov rdx,%4
     syscall 
%endmacro
section .data 
   menu db 10d, 13d,
    db 10d, "1. Enter the string"
    db 10d, "2. Calculate length of the string"

LAB 2

January 03, 2021 · Assembly
%macro scall 4
   mov rax,%1
   mov rdi,%2
   mov rsi,%3
   mov rdx,%4
   syscall
%endmacro

section .data
    Number dw 0FFFFH
    msg db 10d, 13d,"Equivalent BCD Number: "
    msglen equ $-msg
    
section .bss
	
	num resb 5


section .code
    global _start

  _start:
        
        mov ax,word[Number]
            mov bx,0AH
            mov rdi,num+4
            
        
    loop3:
           mov dx,0
           div bx  ; divide ax by bx
           add dl,30h
           mov [rdi],dl
     

LAB 1

January 03, 2021 · Assembly
section .data
    msg db "Hello A1 Batch!", 0ah
    msg1 db "My name is Zahra Shergadwala", 0ah
    msg2 db "My roll num is PA14", 0ah

section .text
    global _start

_start:
    mov rax, 1
    mov rdi, 1
    mov rsi, msg
    mov rdx, 16
    syscall
    mov rax, 1
    mov rdi, 1
    mov rsi, msg1
    mov rdx, 32
    syscall
    mov rax, 1
    mov rdi, 1
    mov rsi, msg2
    mov rdx, 23
    syscall
    mov rax, 60
    mov rdi, 0
    syscall