Write an assembly program that implements the following expression in assembly language :
AX= ( -val2 + BX ) –val4

notes:
- Use data definition directives to store the values of val2 and val4
- val2 and val4 are valuables with the following values
Val2= 2000h , val4 = 20A0h where BX and AX are registers with the following values
BX = 8000h , AX= result.

any one help me to solve this question >>
:(

sergent commented: -1 +0

Recommended Answers

All 2 Replies

You'll probably need a data. or a text. that stores some constants. Then you'll need to use the sub command, add command. You should look up the x86 calling convention. Then eventually you'll pass your answer into eax and return it using ret. And maybe instead of data. or a text. you'll use DWORD PTRs or something along those lines.

Do your own homework. If you tried to do this and got stuck, we will help you but you will have to do the work yourself!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.