어셈블리 언어: 서브루틴 디자인 (문자열 대문자)

1044 단어
소개:
       : 
data segment
  db "Hello world"
  db 11 dup(0)
data ends
                     ,                
             ,                 

코드:
assume cs:code,ds:data,ss:stack

data segment
    db "HelloASM"
    db 8 dup(0)
data ends

stack segment
    db 16 dup(0)
stack ends

code segment

    start:
        ;          
        mov ax, data
        mov ds, ax
        ;         
        mov ax, stack
        mov ss, ax
        ;            
        mov sp, 00A0H
        ;      ,       
        mov cx, 0008H
        ;            
        mov si, 0
        mov di, 0
    my_loop:
        mov bl, ds:[si]
        call upper
        mov ds:[di + 8], bl
        inc si
        inc di
        loop my_loop ;                     finish   
        ;    upper        ,         
        jmp finish
    ;    :               
    ;    : bl
    ;    : bl
    upper:
        and bx, 11011111B ;    
        ret

    finish:
        mov ax,4cH
        int 21H

code ends

end start

좋은 웹페이지 즐겨찾기