Assignment 01: Ques1) Write Program To Print "Hello World"
Assignment 01: Ques1) Write Program To Print "Hello World"
Yash Rughwani
ASSIGNMENT 01
section .data
Output:
Ques2) Write a program to print hello, this is my first program using two sections
Program:
section .text
global _start ;must be declared for linker (gcc)
_start: ;tell linker entry point
section .data
msg db 'Hello World, ',0xa ;a message
len equ $ - msg ;length of message
section .data
msg1 db 'This is my first program ',0xa ;a message
len1 equ $ - msg ;length of message
Output:
0801IT211098
Yash Rughwani
ASSIGNMENT 02
section .data
msg db '9 stars are',0xa ;a message
len equ $ - msg ;length of message
s2 times 9 db '*'
Output:
0801IT211098
Yash Rughwani
ASSIGNMENT 03
Ques1) Write program to read a number from the keyboard and display it on the screen.
Program:
section .data ;Data segment
userMsg db 'Please enter a number: ' ;Ask the user to enter a number
lenUserMsg equ $-userMsg ;The length of the message
dispMsg db 'You have entered: '
lenDispMsg equ $-dispMsg
Output:
0801IT211098
Yash Rughwani
ASSIGNMENT 04
Ques1) 1. Write a program to store a number in the data section of the memory, then
change its value to another number programmatically and displays both the numbers.
Program:
section .text
global _start ;must be declared for linker (ld)
_start: ;tell linker entry point
section .data
num db '35 '
Output: