The use of dup instructions, call and ret instructions in assembly language

One:

assume cs:codesg

stack segment
	db 16 dup(0)		;16个0
stack ends

codesg segment
	mov ax, 4C00H
	int 21H
start:
	mov ax, stack
	mov ss, ax
	mov sp, 16
	mov ax, 0
	
	push ax
	
	mov bx, 0
	ret		;相当于pop ip,所以ip值变为0,返回段首
codesg ends

end start

two:

assume cs:code

code segment
start:	mov ax, 1
		mov cx, 3
		call s
		mov bx, ax
		mov ax, 4C00H
		int 21H
	  s:add ax, ax
		loop s
		ret
	code ends
	end start
78 original articles published · Like 3 · Visits 5596

Guess you like

Origin blog.csdn.net/qq_43071318/article/details/105425885