1 / 6

Lab 7

Lab 7. Array, Addressing. Register Indirect Mode. BX → DS SI → DS DI → DS BP → SS. Example 1. suppose that SI contains 0100h, and the word at 0100h contains 1234h. MOV AX, SI. MOV AX, [SI]. Example 1. Sum the elements in array DEC and display the result.

lyris
Download Presentation

Lab 7

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 7 Array, Addressing

  2. Register Indirect Mode • BX → DS • SI → DS • DI → DS • BP → SS

  3. Example 1 • suppose that SI contains 0100h, and the word at 0100h contains 1234h. MOV AX, SI MOV AX, [SI]

  4. Example 1 Sum the elements in array DEC and display the result. DECM DW 10, 20, 30 org 100h XOR AX,AX LEA SI,DECM MOV CX,3 ADDS: ADD AX,[SI] ADD SI,2 LOOP ADDS CALL OUTDEC ret DECM DW 10,20,30 INCLUDE 'C:\emu8086\MySource\PGM9_1.ASM' END

  5. Example 2 Replace each lower case letter with its upper case. Msgdb “this is a message” org 100h MOV CX,17 ; NO of chars in string XOR SI, SI ; clear SI indexes a char TOP: CMP MSG[SI]," " ;BLANK ? JE NEXT ; yes skip over AND MSG[SI],0DFH ; convert to upper case NEXT: INC SI ;Index next byte LOOP TOP mov ah,9 lea dx,msg int 21h ret msg DB "this is a message"

  6. Exercise • Enter a word or a sentence and save it in an array, then print this word or sentence in a newline.

More Related