C

@C3_Gaurav

string operations

Assembly
2 years ago
%macro print 2 mov rax,1 ; Function 1 - write mov rdi,1 ; To stdout mov rsi,%1 ; String address mov rdx,%2 ; String size syscall ; invoke operating system to WRITE %endmacro %macro read 2 mov rax,0 ; Function 0 - Read

hex to bcd

Assembly
2 years ago
%macro scall 4 mov rax, %1 mov rdi, %2 mov rsi, %3 mov rdx, %4 syscall %endmacro section .data m1 db 10, "Enter 4 digit hex no."

String Length

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

Reverse String

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

Menu driven String operations

Assembly
2 years ago
%macro scall 4 mov rax, %1 mov rdi, %2 mov rsi, %3 mov rdx, %4 Syscall %endmacro section .data menumsg db "Menu for string operations", 10d, 13d menumsg_len equ $-menumsg

Array Addition

Assembly
2 years ago
%macro scall 4 mov rax, %1 mov rdi, %2 mov rsi, %3 mov rdx, %4 syscall %endmacro section .data m1 db "Enter how many numbers you want to store : ",10 l1 equ $-m1

HEX to BCD

Assembly
2 years ago
%macro scall 4 mov rax,%1 mov rdi,%2 mov rsi,%3 mov rdx,%4 syscall %endmacro section .data m1 db 10,"Enter 4 digit Hex no.:"

accept and display 2-digit number

Assembly
2 years ago
%macro scall 4 mov rax,%1 mov rdi,%2 mov rsi,%3 mov rdx,%4 syscall %endmacro section .bss num resb 20

add 2 digit number

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

64 bit number display

Assembly
2 years ago
%macro scall 4 mov rax,%1 mov rdi,%2 mov rsi,%3 mov rdx,%4 syscall %endmacro section .bss buf resb 4

Hello World

Assembly
2 years ago
%macro display 4 mov rax,%1 mov rdi,%2 mov rsi,%3 mov rdx,%4 syscall %endmacro section .data m1 db "Hello World",10d,13d