Arithmetic Instructions on
Hardcode a 3 digit value into a variable. Display the number

An extra code that might help
section .data
hello: db 'Hello world!',10 ; 'Hello world!' plus a linefeed character
helloLen: equ $-hello ; Length of the 'Hello world!' string

section .bss
num: resb 1
q: resb 1
r: resb 1

section .text
global _start

_start:

mov [num],byte 34

mov ax,[num]
mov bl,10
div bl

add al,'0';
mov [q], al
add ah,'0';
mov [r], ah

mov eax,4
mov ebx,1
mov ecx,q
mov edx,1
int 80h

mov eax,4
mov ebx,1
mov ecx,r
mov edx,1
int 80h


mov eax,1
mov ebx,0
int 80h;

Answers

Answer 1

Name of the variable is hello. Its length is the  numeric constant 13. 12 + 1 for the linefeed. Stored in helloLen variable.

What is variable?

In a computer programme, information is stored in variables so that it may be accessed and changed. They also give us a means to give data a name that is descriptive, making it easier for us and the reader to understand our programmes.

It can be useful to conceive of variables as data storage units. They exist only to label and keep data in memory. Your software can then make use of this data.

.data

 hello2: db 'Hello World! G',10

 helloLen2: equ $-hello2

and in main

   int 80h;

   mov edx,helloLen2

Use the below option to generate a listing file, the hex values will display the length, look for the mov,edx,length_Var instruction line on the right hand side (RHS).

nasm -f elf myfile.asm -l myfile.lst

Learn more about variable

https://brainly.com/question/13437928

#SPJ1


Related Questions

Other Questions
If you were a strongly left wing or right wing person do you think this could lead to bias? Why or why not? Bias- Favouritism or prejudice towards one person or group, especially in a way considered to be unfair. Detamine which pair of functions are not inverseA.g(x)=2+9h(x) =1/2x-9 B. g(x)=x-1h(x)=x+1C. g(x)=3x-6h(x)=1/3x+2D. g(x)=3x+4h(x)=x-4/3 6 mol of KClO3 decomposes. How many mass of O2 will be produced? [8pts]KClO3 KCl + O2 HELP ME!!!!!!!!!!!!!!!!!!! The type of bond in which electrons are shared equally by two ormore atoms is an example of a(n) ___a. non-polar covalent bondb. ionic bond.c. hydrogen bondd. polar covale Vehicle manufactures crash test their new vehicles and measure the impact force Subaru's Crosstrek impact force measurements are normally distributed with a mean of 30 metric tons and a standard deviation of 2 metric tons. Suppose Subaru tests a random sample of 9 cars and calculates the sample mean impact force.a. What is the mean and standard deviation of the sampling distribution of the sample mean impact force?b. What is the probability of a sample mean impact force being less than 28.7 metric tons? Mars Inc. is considering the purchase of a new machine that costs $60,000. This machine will reduce manufacturing costs by $5,000 annually. Mars will use the MACRS accelerated method (shown below) to depreciate the machine, and it expects to sell the machine at the end of its 5-year life for $10,000. The firm expects to be able to reduce net operating working capital by $15,000 when the machine is installed, but the net working capital will return to the original level when the project is over (i.e., after 5 years). Mars's marginal tax rate is 40 percent, and it uses a 12 percent cost of capital to evaluate projects of this nature.Calculate the net cash flows of the project.YearMACRS Percentage10.2020.3230.1940.1250.1160.06 are there any structures on the lichens that might indicate thatthey are at least in part fungal? Aqua System Inc. expects to have $29,805,200 in credit sales during the coming year. Currently all checks are sent to the home office. A proposed lockbox system can eliminate 4 days of float, releasing funds which, when invested, will earn 12.02 percent per year. What annual savings can Aqua System expect if the system is implemented? Use a 365-day year.Round the answer to two decimal places. Adding rational expressions with denominators ax and bx : Basic Subtract. (3)/(4d)-(1)/(6d) Simplify. your answer as much as possible. (04.01 LC)Which of the following sequences represents an arithmetic sequence with a common difference d = -3?144, 48, 18, 6, 224, 21, 18, 15.5 3,-9, 27. -81, 24343,40,37,34,31 Calculate the Simpsons index value for an ecosystem with 5 beetles, 7 worms, 9 honey bees, and 3 dragonflies. Show your work and round your answer to two decimal places. How could you describe, in three different ways, the reaction that occurs when heating magnesium and oxygen to form magnesium oxide 1. How the socio-cultural dimension impact the overall business environment in a country? Canyou explain this by considering the COVID:19 issue in the context of Bangladesh?2. As a future manager, can you measure the future outlook of the business environment inBangladesh? Make your argumentative analysis with relevant examples. Read the excerpt from "Keep Things Stirring." I know that it is hard for one who has held the reins for so long to give upit cuts like a knife. It will feel all the better when it closes up again.Which best paraphrases the excerpt?A. The idea that giving women rights would hurt men shows just how important it is to create equality.B. While it is difficult to give up control over another person, it is better in the long run to cut those ties.C. For men, giving women rights is like cutting themselves with a knife. But remember: time heals all wounds.D. It is difficult and painful to give up power one has had for a long time, but that pain will heal in time. What was the effect of the new agricultural technology that led to the Great Migration? What labor practice ended due to this technology? Question 20 of 28A company can raise money by doing all but which of the following?A. Providing stock options to executivesOB. Taking a loanC. Conducting an initial public offeringOD. Issuing bondsSURMIT What is the area of the circle? Use pi = 22/7. A. 201 1/7 in2 B. 56 4/7 in2 C. 28 2/7 in2 D. 254 4/7 in2 What does a funambulist walk on? Most neighborhood banks are referred to as what?Brokerage firmsCommercial banks Savings and loan banks