1 / 4

CS 206D Computer Organization Lab1

CS 206D Computer Organization Lab1. Exercise 1. Write assembly program that define two variables of type byte (BYTE1 initialized by ‘B’, and BYTE2 initialized by 22H) then try to swap the values of these tow variables. org 100h .MODEL SMALL .STACK 100H .Data

conor
Download Presentation

CS 206D Computer Organization Lab1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 206D Computer Organization Lab1 CS 111

  2. Exercise 1 CS 111 • Write assembly program that define two variables of type byte (BYTE1 initialized by ‘B’, and BYTE2 initialized by 22H) then try to swap the values of these tow variables.

  3. org 100h • .MODEL SMALL • .STACK 100H • .Data • BYTE1 DB 'B’ ; declare BYTE1 initialized by ‘B’ • BYTE2 DB 22H ; declare BYTE2 initialized by 22H • .CODE • ;initialize DS • MOV AX, @DATA • MOV DS, AX • MAIN PROC • ;Swap values between BYTE1 and BYTE2 • MOV BL,BYTE1 • XCHG BL,BYTE2 • MOV BYTE1 ,BL • MAIN ENDP • END MAIN CS 111

  4. CS 111

More Related