5 Write Generic Assembly Function Display String Characters Q37291787

5. Write a generic assembly function that can display a string of characters.

5. Write a generic assembly function that can display a string of characters. Show transcribed image text 5. Write a generic assembly function that can display a string of characters.


Answer


org  0x100        ;.com files always start 256 bytes into the segment

    ; int 21h is going to want…

    mov  dx,msg      ; the address of or message indx
    mov  ah,9        ; ah=9 – “printstring” sub-function
    int  0x21         ;call dos services

    mov  dl,0x0d     ; put CR into dl
    mov  ah,2        ; ah=2 – “printcharacter” sub-function
    int  0x21         ;call dos services

    mov  dl,0x0a     ; put LF into dl
    mov  ah,2        ; ah=2 – “printcharacter” sub-function
    int  0x21         ;call dos services

    mov  ah,0x4c     ; “terminate program”sub-function
    int  0x21         ;call dos

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.