Simple assembly programs, Computer Engineering

Assignment Help:

Data Transfer

Two most fundamental data transfer instructions in 8086 microprocessor are XCHG and MOV. Let's give illustrations of the use of these instructions.

Program 1: This program displays the difference of XCHG and MOV instructions:

DATA SEGMENT

                                    VAL    DB      5678H                         ; initialize variable VAL

DATA ENDS

CODE SEGMENT

                                    ASSUME        CS:      CODE, DS: DATA

MAINP:                      MOV               AX, 1234H                 ; AH=12 & AL=34

                                    XCHG            AH, AL                       ; AH=34 & AL=12

                                    MOV               AX, 1234H                 ; AH=12 & AL=34

                                    MOV               BX, VAL                    ; BH=56 & BL=78

                                    XCHG            AX, BX                      ; AX=5678 & BX=1234

                                    XCHG            AH, BL                       ;AH=34,AL=78,BH=12,&BL=56

                                    MOV               AX, 4C00H                ; Halt using INT 21h

                                    INT                 21H

CODE ENDS

END MAINP


Related Discussions:- Simple assembly programs

Explain about the prepurchase interaction activity, Explain about the Prepu...

Explain about the Prepurchase Interaction activity. Prepurchase Interaction: This interaction for consumers comprises three activities: • Product or service search and di

Recursion, Ask qurecurrion for short noteestion

Ask qurecurrion for short noteestion

Explain about programmer visible registers, Q. Explain about Programmer Vis...

Q. Explain about Programmer Visible Registers? Programmer Visible Registers: These registers can be employed by machine or assembly language programmers to minimize reference

Explain what logic gets synthesized , What logic gets synthesized when I us...

What logic gets synthesized when I use an integer instead of a reg variable as a storage element? Is use of integer recommended? An  integer  can  take  place  of  a  reg  as

Symbol for the new euro currency in my spreadsheet, How can I go in the sym...

How can I go in the symbol for the new Euro currency in my spreadsheet? Ans) Microsoft suggestted a new Tahoma font with the Euro symbol.

Differentiate between $display and $strobe, Differentiate between $display ...

Differentiate between $display and $strobe These commands have similar syntax, and display text on screen during simulation. $display and $strobe display once every time they a

Explain about data registers, Q. Explain about data registers? The data...

Q. Explain about data registers? The data registers are used just for storing intermediate results or data and not for operand address calculation. Some dedicated address re

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd