ΪʲôջûÓз¢ÉúÔ½½çдÈ룿
±¾Ìû×îºóÓÉ leader4 ÓÚ 2018-5-3 19:19 ±à¼Çó´ó´ó½â´ðÏÂÎÊÌ⣺
ÎÒ°ÑÍõˬ¡¶»ã±à¡·µÄµÚÁùÕÂʵÑé5µÄµÚ6¸öСʵÑé¸ü¸ÄÁËһϣ¬Ïë¿´¿´pushÔ½½çдÈë»á·¢Éúʲô¡£
µ«ÊDz¢Ã»Óз¢ÉúÔ½½çдÈ룬ÇëÎÊÕâÊÇΪʲô£¿
ÔÌâÄ¿ÒªÇó£ºÓÃpushÖ¸Á°Ña¶ÎÇ°8¸öÊý¾ÝÄæÐò´æ´¢ÔÚb¶ÎÖС£
¸ü¸Ä²¿·Ö£º°Ña¶Î16¸öÊý¾Ý£¬È«²¿Ð´Èëb¶Î¡£
²Ù×÷»·¾³£ºmacOS High Sierra 10.13.4
DOSBox masm5
Ô´´úÂ룺
assume cs:code,ss:b,ds:a
a segment
dw 1,2,3,4,5,6,7,8,9,0ah,0bh,0ch,0dh,0eh,0fh,0ffh
a ends
b segment
dw 0,0,0,0,0,0,0,0
b ends
code segment
start: mov ax,a
mov ds,ax
mov ax,b
mov ss,ax
mov sp,16
mov cx,16 //ÕâÀïÔ±¾Ñ»·8´Î£¬ÎҸijÉÁË16´Î
mov bx,0
s: push ds:
addbx,2
loop s
mov ax,4c00h
int 21h
code ends
end start
Ê×ÏÈ£¬ÄãÕâ¸ö»®·Ö·½Ê½ÍêÈ«²»¶Ô°É£¿ÄãÕâ¸öÒ»Ö±ÊôÓÚ´úÂë¶ÎµÄÄÚÈÝ£¬Æä´ÎÊÇ£¬
ÖÁÓÚ½á¹ûÊÇÔõôÑùÎÒ½¨ÒéÄãÔËÐкó¿´Ò»ÏÂspÖ¸ÕëµÄ±ä»¯¡£ ×ÔÎÊ×Ô´ðһϣºÕ»µÄÈ··¢ÉúÁËÔ½½ç£¬Ö»²»¹ýÊDZ»Ð´µ½µ×ÏÂÈ¥ÁË¡£¡£Ò²¾ÍÊÇ˵ss²»±ä£¬µ±sp=0ʱ£¬sp-2»á±»Ö¸Ïòfffe.¼´sp=fffe¡£Ö®ºó¼ÌÐø¸²¸ÇÊý¾Ý¡£¡£¡£¹Ø¼ü´Ê£ºss²»±ä£¡¼´¶ÎµØÖ·²»±ä¡£
Ò³:
[1]