0

**Hi i need to squared result of a variable (number) . lets say i have a that is equal to 77 can you use the multiple function register itself?

MOV AX,77
MUL AX,AX
MOV NUM,AX

if not, then what should i be doing the get the correct answer? thank you!**

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Soske
  • 541
  • 1
  • 4
  • 10
  • 1
    read the manual for `mul`. – Peter Cordes Apr 01 '20 at 19:10
  • What architecture are you programming for? If this is x86, what instructions are you allowed to use? Just 8086 instructions? Or are you allowed to use 80186 or 80386 instructions? – fuz Apr 01 '20 at 19:11
  • My bad for not adding, were only at the start TBH, we only learned about MUL DIV so far and were on the 8086 – Soske Apr 01 '20 at 19:17
  • @Soske Then do as Peter Cordes said and refer to the manual. It tells you how to use the `mul` instruction. You should always look into the manual when you are unsure how to use an instruction. If reading the manual leaves any questions, feel free to ask specific questions! – fuz Apr 01 '20 at 19:18
  • I didnt even know a manual existed! thank you guys very much! – Soske Apr 01 '20 at 19:21
  • 1
    @Soske Ah, I see. That happens. A good reference to use is this one: https://c9x.me/x86/. It's a bit older so it doesn't have a lot of the confusing modern stuff you don't need anyway. – fuz Apr 01 '20 at 19:27

0 Answers0