使用如下方式定义栈段,可消除这个提示:
stacksg segment stack
...
stacksg ends
注意segment后的stack,这是关键,代表把这个段作为stack使用。
而且如此定义栈段后,DOS加载程序加载完程序后,会自动设置SS、SP为正确适宜的值。
如一个程序中包含如下stack定义
aa segment stack
db 180h dup(0feh)
aa ends
加载后有,
(sp)=180h,(ss)=aa段的段地址...
[2011-02-26 01:47] 解决waring :no stack segment
阅读全文 |
评论次数(1) |
浏览次数(415) |
所属类型(默认类型)
[2011-02-26 01:18] 实验十一——编写子程序,大写转小写
assume cs:codesg
datasg segment
db "Beginner's All-purpose Symbolic Instruction Code.",0," Hello World!!!"
datasg ends
stacksg segment stack
db 180h dup(0feh)
stacksg ends
codesg segment
start:
mov ax, datasg
mov ds, ax
mov si, 0
;显示转换前的字符串
mov dl, 0
mov dh, 5
mov ...
datasg segment
db "Beginner's All-purpose Symbolic Instruction Code.",0," Hello World!!!"
datasg ends
stacksg segment stack
db 180h dup(0feh)
stacksg ends
codesg segment
start:
mov ax, datasg
mov ds, ax
mov si, 0
;显示转换前的字符串
mov dl, 0
mov dh, 5
mov ...
阅读全文 |
评论次数(0) |
浏览次数(344) |
所属类型(汇编作业)
[2011-02-21 00:36] 课程设计一(解决方案1——使用一层循环解决该问题)
;Title: Curriculum Design One
;File: cd1.asm
;Function: Display the data of Power Idea in the form of Table Under DOS
;Note: A Concise Looking Solution, Solve this Question in One Layer of Loop, but have to be Careful When Dealing with Registers.
;Author: Chao Zhou
;Date: 02-21...
;File: cd1.asm
;Function: Display the data of Power Idea in the form of Table Under DOS
;Note: A Concise Looking Solution, Solve this Question in One Layer of Loop, but have to be Careful When Dealing with Registers.
;Author: Chao Zhou
;Date: 02-21...
阅读全文 |
评论次数(0) |
浏览次数(366) |
所属类型(汇编作业)
[2011-02-20 23:57] 实验10——编写子程序
1.显示字符串
;说明: 在指定的位置,用指定的颜色,显示一个用0结束的字符串
;参数: (dh) = 行号(取值范围0-24),(dl)=列号(取值范围0-79),(cl)=颜色,ds:si指向字符串的首地址
;结果: 没有返回值
show_str:
push ax
push bx
push cx
push es
push si
mov ax, 0B800H
mov es, ax
;计算缓存首地址
mov bx, 0
mov al, 160
mul dh
add bx, ax
mov al, 2
mul dl
...
;说明: 在指定的位置,用指定的颜色,显示一个用0结束的字符串
;参数: (dh) = 行号(取值范围0-24),(dl)=列号(取值范围0-79),(cl)=颜色,ds:si指向字符串的首地址
;结果: 没有返回值
show_str:
push ax
push bx
push cx
push es
push si
mov ax, 0B800H
mov es, ax
;计算缓存首地址
mov bx, 0
mov al, 160
mul dh
add bx, ax
mov al, 2
mul dl
...
阅读全文 |
评论次数(0) |
浏览次数(371) |
所属类型(汇编作业)
[2011-02-18 20:01] 汇编资料汇总(待补充)
《Intel Architecture Software Developer’s Manual》
Volume 2: Instruction Set Reference
该卷包含关于指令的详细说明
Volume 3: System Programming
该卷包含关于CPU结构的详细说明...
Volume 2: Instruction Set Reference
该卷包含关于指令的详细说明
Volume 3: System Programming
该卷包含关于CPU结构的详细说明...
阅读全文 |
评论次数(0) |
浏览次数(344) |
所属类型(默认类型)
[2011-02-18 19:58] 各种移位总结
SHL 逻辑左移:SHift logical Left
SAL 算术左移(=SHL):Shift Arithmetic Left
SHR 逻辑右移:SHift logical Right
SAR 算术右移(=SHR): Shift Arithmetic Right
ROL 循环左移:ROtate Left
ROR 循环右移:ROtate Right
RCL 通过进位的循环左移: Rotate Left through Carry
RCR 通过进位的循环右移:Rotate Right through Carry
细节补充:
(CF:Carry Flag 进位标志)
SH...
SAL 算术左移(=SHL):Shift Arithmetic Left
SHR 逻辑右移:SHift logical Right
SAR 算术右移(=SHR): Shift Arithmetic Right
ROL 循环左移:ROtate Left
ROR 循环右移:ROtate Right
RCL 通过进位的循环左移: Rotate Left through Carry
RCR 通过进位的循环右移:Rotate Right through Carry
细节补充:
(CF:Carry Flag 进位标志)
SH...
阅读全文 |
评论次数(0) |
浏览次数(286) |
所属类型(默认类型)
[2011-02-18 19:47] 检测点11.3-11.4
检测点11.3
(1)
jb s0
ja s0
(2)
jna s0
jnb s0
检测点11.4
(AX) = 0045H
mov ax, 0
push ax
popf
;上述为PSW清零
mov ax, 0fff0h
add ax, 0010h
;经过该运算,有OF=0, SF=0, ZF=1, PF=1, CF=1
pushf
pop ax
;PSW拷贝至AX,AX中各BIT对应PSW中各BIT,其余各位的值不确定,使用DEBUG调试时,有AX = 3047,有TF=1、IF=1, BIT1位为1(根据资料该位未占用,为何会被修改?) ...
(1)
jb s0
ja s0
(2)
jna s0
jnb s0
检测点11.4
(AX) = 0045H
mov ax, 0
push ax
popf
;上述为PSW清零
mov ax, 0fff0h
add ax, 0010h
;经过该运算,有OF=0, SF=0, ZF=1, PF=1, CF=1
pushf
pop ax
;PSW拷贝至AX,AX中各BIT对应PSW中各BIT,其余各位的值不确定,使用DEBUG调试时,有AX = 3047,有TF=1、IF=1, BIT1位为1(根据资料该位未占用,为何会被修改?) ...
阅读全文 |
评论次数(0) |
浏览次数(348) |
所属类型(汇编作业)
[2011-02-14 11:59] 检测点11.2
11.2 CF OF SF ZF PF
SUB AL,AL 0 0 0 1 1
MOV AL,10H 0 0 0 1 1
ADD AL,90H 0 0 1 0 1
MOV AL,80H 0 0 1 0 1
ADD AL,80H 1 1 0 1 1
MOV AL,0FCH 1 1 0 1 1
ADD AL,05H 1 0 0 0 0
MOV AL,7DH 1 0 0 0 0
ADD AL,0BH 0 1...
SUB AL,AL 0 0 0 1 1
MOV AL,10H 0 0 0 1 1
ADD AL,90H 0 0 1 0 1
MOV AL,80H 0 0 1 0 1
ADD AL,80H 1 1 0 1 1
MOV AL,0FCH 1 1 0 1 1
ADD AL,05H 1 0 0 0 0
MOV AL,7DH 1 0 0 0 0
ADD AL,0BH 0 1...
阅读全文 |
评论次数(0) |
浏览次数(345) |
所属类型(汇编作业)
[2011-02-14 10:07] 实验九——显存编程
assume cs:codesg, ss:stacksg, ds:datasg
ATTR_BLUEF EQU 00000010B ;绿色
ATTR_REDF_GREENB EQU 00100100B ;绿底红色
ATTR_BLUEF_WHITEB EQU 01110001B ;白底蓝色
datasg segment
db 'welcome to masm!'
db ATTR_BLUEF
db ATTR_REDF_GREENB
db ATTR_BLUEF_WHITEB
datasg ends
stacksg segment
dw ...
ATTR_BLUEF EQU 00000010B ;绿色
ATTR_REDF_GREENB EQU 00100100B ;绿底红色
ATTR_BLUEF_WHITEB EQU 01110001B ;白底蓝色
datasg segment
db 'welcome to masm!'
db ATTR_BLUEF
db ATTR_REDF_GREENB
db ATTR_BLUEF_WHITEB
datasg ends
stacksg segment
dw ...
阅读全文 |
评论次数(0) |
浏览次数(357) |
所属类型(汇编作业)
[2011-02-13 18:36] 实验八——分析一个奇怪的程序
assume cs:codesg
codesg segment
mov ax, 4c00h
int 21h
start: mov ax, 0
s: nop
nop
mov di, offset s
mov si, offset s2
mov ax, cs:[si]
mov cs:[di], ax
s0: jmp short s
s1: mov ax,0
int 21h
mov ax,0
s2: jmp short s1
nop
codesg ends
end start
如上的程序可以正确返回。
...
codesg segment
mov ax, 4c00h
int 21h
start: mov ax, 0
s: nop
nop
mov di, offset s
mov si, offset s2
mov ax, cs:[si]
mov cs:[di], ax
s0: jmp short s
s1: mov ax,0
int 21h
mov ax,0
s2: jmp short s1
nop
codesg ends
end start
如上的程序可以正确返回。
...
阅读全文 |
评论次数(0) |
浏览次数(372) |
所属类型(汇编作业)
『 查看更多文章 』