We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search


+ Link For Assignments, GDBs & Online Quizzes Solution


+ Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

[org 100h]

jmp Cube  ; jump at Label Start

String: db "This Program Calculates the Cube of Number 5 in the AX and Store the Results in DX By Shifting and ADD INSTRUCTIONS$"

Num: dw 5            ; Number to find the Cube

Variable: dw 0         ; Variable to store a copy of the Number

Result: dw 0           ; To store 5*5's result

Result2: dw 0         ; to store Result* variable


  mov ah, 9            ; Printf function just like C, printing String

  mov dx, String 

  int 0x21



  mov ax, 0x4c00     ; Terminating program

  int 0x21




Cube:  call Printf


  mov cx, 8         ; loop to run 8 time

  mov ax, [Num]  ; Moving Entered number to AX Register

  mov dx, [Num]  ; Moving copy of the Number in DX register for Later Multiplication


  mov [Variable], dx       ; and then DX to the Spare Variable to store the copy of the Num



  shr dx, 1      ; checking least significant bit by shifting right

  jnc Skip

  add [Result], bx    ; Adding result with the help of ADD instruction



  shl bx, 1               ; checking most significant bit

  dec cx 

jnz CheckBit    ; going back and repeat if bit not zero



  ; complation of 5*5 (but without MUL)

  ; Now going to multiply Result * 5 again to find the Cube (by shifting process again)

  mov cx, 8

  mov bx, [Result]

  mov dx, [Variable]



  shr dx, 1

  jnc Skip2


  add [Result2], bx


  add dx, [Result2]      ; Adding results of Cube in the DX register



  shl bx, 1

  dec cx


  jnz CheckBit2

  call Exit

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

See Your Saved Posts Timeline

Views: 144


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Latest Activity

ρяιηcε replied to + M.Tariq Malik's discussion MGT301 GDB Fall 2019 Solution & Discussion in the group MGT301 Principles of Marketing
4 minutes ago
Profile Iconρяιηcε and Alisha Noor joined + M.Tariq Malik's group
4 minutes ago
+ ! ! Şĩɳℊℯℛ ⋆⭐️⋆ replied to +! ! ❝A̳n̳o̳n̳y̳m̳o̳u̳s̳❞ ! !+'s discussion HapPy BiRtHdaY To.. Hopuuuuuuuuuu :-* <3
5 minutes ago
Amir sohail commented on + M.Tariq Malik's group STA630 Research Methods
21 minutes ago
Amir sohail joined + M.Tariq Malik's group
22 minutes ago
Anu Malik mcs3 liked +! ! ❝A̳n̳o̳n̳y̳m̳o̳u̳s̳❞ ! !+'s discussion HapPy BiRtHdaY To.. Hopuuuuuuuuuu :-* <3
25 minutes ago
Profile IconSarmad Ali, Saddi, Muhammad Hassan Akbar and 9 more joined Virtual University of Pakistan
35 minutes ago
Rome replied to +! ! ❝A̳n̳o̳n̳y̳m̳o̳u̳s̳❞ ! !+'s discussion HapPy BiRtHdaY To.. Hopuuuuuuuuuu :-* <3
35 minutes ago
+ ! ! ! ❣ Sanam ❣ !+ replied to +! ! ❝A̳n̳o̳n̳y̳m̳o̳u̳s̳❞ ! !+'s discussion HapPy BiRtHdaY To.. Hopuuuuuuuuuu :-* <3
1 hour ago
+! ! ❝A̳n̳o̳n̳y̳m̳o̳u̳s̳❞ ! !+ replied to +! ! ❝A̳n̳o̳n̳y̳m̳o̳u̳s̳❞ ! !+'s discussion HapPy BiRtHdaY To.. Hopuuuuuuuuuu :-* <3
1 hour ago
+ " Нσρε" replied to +! ! ❝A̳n̳o̳n̳y̳m̳o̳u̳s̳❞ ! !+'s discussion HapPy BiRtHdaY To.. Hopuuuuuuuuuu :-* <3
1 hour ago
Muhammad Sarfraz added a discussion to the group MGT601 SME Management
1 hour ago

© 2020   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service