Instructions
Requirements and Specifications
Source Code
; Name: ????
; CWU ID: ????
; Honor code: ????
segment .data
a db 1100b ; multiplicand
b db 0110b ; multiplier
size db 7 ; size of multiplier
result dw 0 ; result
segment .text
global main
main:
mov word [result], 0 ; result = 0
movzx bx, byte [b] ; load multiplier number2
movzx cx, [size] ; i = 7
forloop:
bt bx, cx ; test bit(number2,i)
jnc endif ; if not 1, go to next bit
movzx ax, byte [a] ; else load number1
shl ax, cl ; shift to multiply by 2^i
add [result],ax ; result = result + number1*2^i
endif:
dec cl ; i--
jge forloop ; repeat while i>=0
ret
Related Samples
Explore our Assembly Language Assignment Samples for precise solutions to low-level programming challenges. These examples elucidate concepts such as registers, memory management, and bitwise operations, ensuring clarity and educational depth. Perfect for students aiming to master assembly language programming and excel in their coursework with practical, insightful guidance.
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language
Assembly Language