"Assembly Language 3rd Edition Wang Shuang"-Reference Answer: Experiment 11 Writing subroutines @20210226

Reference answer

assume cs:codeseg 

dataseg segment 
    db "Beginner's All-purpose Symbolic Instruction Code.",0 
dataseg ends 

codeseg segment 
start: 
	mov ax, dataseg 
	mov ds, ax 
	mov si, 0 
	call letterc 
	mov ax, 4c00H 
	int 21H 

letterc: 
	push cx 
	push si 

	_letterc_start: 
		mov cl, ds:[si]; read the letters 
		mov ch, 0; determine whether the current character is zero 
		jcxz _letterc_end; if it is zero, directly end 
		cmp cl, 97; determine whether it is lowercase [97, 122] 
		jb _letterc_next_char; skip to 
		cmp cl, 122 
		ja _letterc_next_char 
		sub cl, 20H; convert letters to uppercase 
		mov ds:[si], cl 
	_letterc_next_char: 
		inc si
		jmp short _letterc_start
	_letterc_end:

	pop si
	pop cx
	ret

codeseg ends

end start

related articles

"Assembly Language 3rd Edition Wang Shuang"-Reference Answer: Experiment 15 Install a new int 9 interrupt routine
"Assembly Language 3rd Edition Wang Shuang"-Reference Answer: Course Design 1
"Assembly Language 3rd Edition Wang Shuang"-Reference Answer: Experiment 14 Access to CMOS RAM
"Assembly Language 3rd Edition Wang Shuang"-Reference Answer: Experiment 10 Writing Subroutines
"Assembly Language 3rd Edition Wang Shuang"-Reference Answer: Check Point 11.3
"Assembly Language 3rd Edition Wang Shuang" -Reference answer: Check point 13.1
"Assembly language third edition Wang Shuang"-Reference answer: Check point 16.2
"Assembly language third edition Wang Shuang"-Reference answer: Experiment 16 Writing an interrupt routine containing multiple functional subroutines

references

CSDN/Assembly Language Wang Shuang Third Edition Answers
Baidu Library/Assembly Language Experimental Answers (Wang Shuang)

Guess you like

Origin blog.csdn.net/u013670453/article/details/114114045