Question: I need help changing the assembly code below ASAP so that it works using Atmel Studio 7 an assembly code for the AVR ATMEGA328p microcontroller.

I need help changing the assembly code below ASAP so that it works using Atmel Studio 7 an assembly code for the AVR ATMEGA328p microcontroller.

I also want to change so that it performs a multiplication of a 32-bit multiplicand with a 32-bit multiplier using registers R19-16 to hold the 32-bit multiplicand, R23-20 to hold 32-bit multiplier, and R31-24 should hold the result.

.model small .data a db 11H b db 10H .code mov ax, @data ; Initialize data section mov ds, ax mov al, a ; Load number1 in al mov bl, b ; Load number2 in bl mov ah, 0 mov dl, 04h ; initialize counter ad: add ax, ax ; add numbers. Result in dx rcl bl, 01 jnc skip add ax, bx skip: dec dl ; dec number jnz ad mov ch, 04h ; Count of digits to be ; displayed mov cl, 04h ; Count to roll by 4 bits mov bx, ax ; Result in reg bx l2: rol bx, cl ; roll bl so that msb ; comes to lsb mov dl, bl ; load dl with data to be ; displayed and dl, 0fH ; get only lsb cmp dl, 09 ; check if digit is 0-9 or ; letter A-F jbe l4 add dl, 07 ; if letter add 37H else only ; add 30H l4: add dl, 30H mov ah, 02 ; Function 2 under INT 21H ; (Display character) int 21H dec ch ; Decrement Count jnz l2 mov ah, 4cH ; Terminate Program int 21H end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!