A

@Abhimasali

string operations

Assembly
4 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

Addition of two digit numbers

Assembly
4 years ago
;ALP for addition of 2 digit numbers section .data msg db 'Enter two digit Number::',0xa msg_len equ $-msg res db 10,'Addition of two digit numbers is:' res_len equ $-res section .bss num resb 03 num1 resb 01

HEX to BCD

Assembly
4 years ago
section .data m1 db 10,"Enter 4-digit Hex number: " l1 equ $- m1 m2 db 10,"Equivalent BCD number is: " l2 equ $- m2 emsg db 10,"You entered Invalid Data!!!", l3 equ $-emsg ;--------------------------------------------------------------------- section .bss buf resb 6

Accept Number and Display

Assembly
4 years ago
section .data ; Data section to declare constants, messages m1 db 10,"Enter the number:" ; message declaration with define byte(db) 10 for new line l1 equ $- m1 ; length of the message (l1) m2 db 10,"You have entered:" ; message declaration with define byte(db) 10 for new line l2 equ $- m1 ; length of the message (l2) section .bss temp resb 2 section .text ; main program section

Hello world with another string

Assembly
4 years ago
section .data ;Data section to declare constants , messages m1 db 10,"Hello world!" ;messge declaration with define byte(dp) 10 for new line m2 db 10,"I am Abhishek Masali" l1 equ $- m1 ;length of the message(l1) l2 equ $- m2 section .text ;main program section (code segment we can from outside) global _start _start:

Hello World Program

Assembly
4 years ago
section .data ;Data section to declare constants , messages m1 db 10,"Hello world!" ;messge declaration with define byte(dp) 10 for new line l1 equ $- m1 ;length of the message(l1) section .text ;main program section global _start _start: ;-----------------------------Print message code ----------------------

Write 64 – bit ALP to convert HEX 4 digit- input to BCD number.

Assembly
4 years ago
section .data m1 db 10,"Enter 4-digit Hex number: " l1 equ $- m1 m2 db 10,"Equivalent BCD number is: " l2 equ $- m2 emsg db 10,"You entered Invalid Data!!!", l3 equ $-emsg ;--------------------------------------------------------------------- section .bss buf resb 6

ALP program to accept number and display on screen

Assembly
4 years ago
section .data msg db "Hello world!", 0ah section .text global _start _start: mov rax, 1 mov rdi, 1 mov rsi, msg

Helloworld

Assembly
4 years ago
section .data ;Data section to declare constants, messages m1 db 10,"Hello World!" ;Hello Word" ; message declaration with define byte(db) 10 for new line l1 equ $- m1 m2 db 10,"I am Abhishek Masali" l2 equ $- m2 ; length of the message (l1) section .text ; main program section global _start _start: ;------------------------ print message code -------------------------------------------------