1 / 13

Lab 2

Lab 2. Registers, Data Transfer Instruction, Basic Arithmetic Instruction, INT Instruction. Data Registers – General Purpose Registers. AX Accumulator Register BX Base Register CX Count Register DX Data Register. Segment Registers. CS Code Segment DS Data Segment SS Stack Segment

misu
Télécharger la présentation

Lab 2

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. Lab 2 Registers, Data Transfer Instruction, Basic Arithmetic Instruction, INT Instruction

  2. Data Registers – General Purpose Registers • AX Accumulator Register • BX Base Register • CX Count Register • DX Data Register

  3. Segment Registers • CS Code Segment • DS Data Segment • SS Stack Segment • ES Extra Segment

  4. Pointer and Index Registers • SP Stack Pointer • BP Base Pointer • IP Instruction Pointer • SI Source Index • DI Destination Index

  5. Data Transfer Instruction • MOV

  6. Data Transfer Instruction • XCHG

  7. Basic Arithmetic Instruction • ADD

  8. Basic Arithmetic Instruction • SUB

  9. Basic Arithmetic Instruction • INC • DEC

  10. INT Instruction • INT interrupt_number

  11. Exercises • Move 50h to AL and display it on screen. • org 100h • MOV AL,50H • MOV AH,2 • MOV DL,AL • INT 21H • ret • Declare a variable named word2 as a word, which contains 55h then display it on screen. • org 100h • MOV AH,2 • MOV DX,WORD2 • INT 21H • ret • WORD2 DW 55H

  12. Cont. Exercises • Add two numbers 5, 6 and move the result to CX. • org 100h • MOV AX,2 • MOV DX,3 • ADD AX,DX • MOV CX,AX • ret • Input a number (7) then move it to register BX • org 100h • MOV AH,1 • INT 21H • MOV BX,AX • ret

  13. Cont. Exercises • Input number 2 then add it to number 5 that is located in BL register then show the result on screen. • org 100h • MOV AH,1 • INT 21H • MOV BL,5 • ADD BL,AL • MOV AH,2 • MOV DL,BL • INT 21H • ret

More Related