文字表情符號 匯編語言怎么實現一個字符串的輸入與輸出?
匯編語言怎么實現一個字符串的輸入與輸出?匯編語言實現了字符串的輸入和輸出,可以調用DOS函數中斷來完成。示例程序如下:匯編語言輸入字符串,可以調用DOS函數interrupt int 21h 06h函
匯編語言怎么實現一個字符串的輸入與輸出?
匯編語言實現了字符串的輸入和輸出,可以調用DOS函數中斷來完成。示例程序如下:匯編語言輸入字符串,可以調用DOS函數interrupt int 21h 06h函數。程序功能:輸入一串字符,以回車結束,輸入字符串的最大長度為200個字符,輸入后在下一行輸出該字符串。數據段STR DB 201 dup(0dh)Data endscode段帳戶CS:code,ds:datamain proc far start:mov ax,Data mov ds,ax lea Si,STR mov CX,200inpstr:mov ah,06h int,21h JNZ inpstr no character readable mov[Si],A1 Inc Si XOR Al,0dh JZ Endinp loop inpstrandip:mov Al,0dh mov[Si],A1 mov DL,0ah回車,換行mov ah,02hint 21h mov DL,0dh mov ah,02h int 21h lea Si,STR output string:mov DL,[Si]CMP DL,0dh JZ end out to the end of the string mov ah,02h int 21h Inc Si jmp outputendout:mov ah,4ch int 21h retmain endpcode ends end start