Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Support For Data Mining Applications Discovering Knowledge With Inductive Queries Lnai 2682

Authors: Rosa Meo ,Pier L. Lanzi ,Mika Klemettinen

2004th Edition

3540224793, 978-3540224792

More Books

Students also viewed these Databases questions