云南大学软件学院实验报告

合集下载

云南大学--软件学院--数据库实验4

云南大学--软件学院--数据库实验4

云南大学软件学院实验报告课程:数据库原理与实用技术实验学期: 2012-2013学年第二学期任课教师:专业:学号:姓名:成绩:实验4 数据查询一、实验目的理解T-SQL语言的使用;熟练掌握数据查询语句;掌握合计函数的使用。

二、实验内容1、CAP数据库的查询(记录每个查询的SQL语句和查询结果)(1)建立CAP数据库,输入C、A、P、O四张表;图表 1 创建cap数据库图表 2创建四个表图表 3向表中插入数据图表 4表的内容(2)完成课后习题[3.2]b、[3.5]、[3.8]a,b、[3.11]b,f,j,l[3.2] (b)Retrieve aid values of agents who receive the maximum percent commission.图表 5最高佣金百分率[3.5] Consider the problem to find all (cid, aid) pairs where the customer does not place an order through the agent. This can be accomplished with the Select statementselect cid, aidfrom customers c. agents awhere not exists(select * from orders x where x.cid = c.cid and x.aid =a.aid) ;Is it possible to achieve this result using the NOT IN predicate in place of the NOT EXISTS predicate with a single Subquery? With more than one Subquery? Explain your answer and demonstrate any equivalent form by execution.图表 6 3.5 not in[3.8](a) Write a Select statement with no WHERE clause to retrieve all customer cids and the maximum money each spends on any product. Label the columns of the resulting table: eid, MAXSPENT.图表 7 3.8(b) Write a query to retrieve the AVERAGE value (over all customers) of the MAXSPENT of query (a)图表 8 3.8(b)[3.11] (b) We say that a customer x orders a product y in an average quantity A if A is avg(qty) for all orders rows with cid = x and pid = y. Is it possible in a single SQL statement to retrieve cid values of customers who order all the products that they receive in average quantities (by product) of at least 300?图表 9 3.11 (b)(f) Get pid values of products that are ordered by all customers in Dallas.图表 10 3.11 (f)(j) Use a single Update statement to raise the prices of all products warehoused in Duluth or Dallas by 10%. Then restore the original values byrerunning the procedure that you originally used to create and load the products table.图表 11 3.11 (j)(l) Write an SQL query to get aid and percent values of agents who take orders from all customers who live in Duluth. The aid values should be reported in order by decreasing percent. (Note that if percent is not retrieved in the select list, we cannot order by these values.)图表 12 3.11 (i)2、Employee数据库的查询(记录每个查询的SQL语句和查询结果)(1)向表中插入数据。

云南大学软件学院数据结构实验二实验报告——多项式计算器

云南大学软件学院数据结构实验二实验报告——多项式计算器

云南大学软件学院数据结构实验报告2010秋季学期(本实验项目方案受“教育部人才培养模式创新实验区(X3108005)”项目资助)学号:姓名:专业:指导老师:实验难度A□B□ C □承担任务(难度为C时填写)指导教师评分(签名)【实验题目】实验2. 线性表及其应用【问题描述】用C或C++语言设计并实现一个一元稀疏多项式的简单计算器。

【基本要求】一元稀疏多项式简单计算器的基本功能是:1、输入并建立多项式2、输出多项式,序列按指数降序排列3、多项式A(x)和B(x)相加,并建立多项式A(x)+B(x)4、多项式A(x)和B(x)相减,并建立多项式A(x)-B(x)5、给定 x 的值,计算多项式6、多项式A(x)和B(x)相乘,建立多项式A(x)*B(x) (* 选做,作为难度B的操作)【CDIO项目要求】1、有完整的CDIO四个阶段描述2、有友好美观的操作界面3、有软件使用说明或帮助文档4、项目成员分工明确,团结协作【实现提示】一、【实验构思(Conceive)】(10%)本实验通过C语言实现了多项式加法、减法、乘法、多项式求导、多项式积分的功能。

利用了冒泡排序的算法作为排序的核心算法。

运用了高等数学中多项式的求导积分的知识。

二、【实验设计(Design)】(15%)本程序定义了抽象数据结构listnode,用于存储多项式的系数和指数并存储指向下一个listnode的指针来构成链表。

本程序包含如下*个函数:Main函数:调用input函数—>调用bubble_sort函数—>调用operplus函数—>调用oper_minus函数—>调用oper_mul函数—>调用oper_dy函数—>调用oper_jifen 函数。

Oper_plus函数:将两个链表的相应项系数相加,指数不同项不操作,存入新链表,再调用排序算法,使之为降序排列。

Oper_minus函数:将两个链表的相应项系数相减,指数不同项不操作,存入新链表,再调用排序算法,使之为降序排列。

云南大学软件学院报告

云南大学软件学院报告

课程:数据结构实验学期:2014-2015学年第一学期任课教师:专业:信息安全学号:姓名:成绩:实验5 图基础实验一、实验目的1.掌握图的存储结构及其遍历。

二、实验软硬件环境(CPU、OS、IDE):三、实验任务(要求写出核心代码,并对运行结果截图)1)使用邻接矩阵和邻接表储表示分别实现如下给定的图1、图2、图3所示图的物理存储结构。

2)在1)所建立的图形存储结构上分别实现深度优先搜索遍历和广度优先搜索遍历,并给出遍历结果(序列)。

图3 有向图实验代码:#include<stdio.h>#include<stdlib.h>#define MAXVEX 20#define OK 1#define ERROR 0#define OVERFLOW -1#define INFINITY 65535#define QueueSize 20 //队列中最大元素个数typedef int QElemType; //队列的元素的类型typedef int VertexType;typedef int EdgeType;typedef enum{False,True}Boolean; //Boolean是布尔类型,其值是ture或false Boolean visited[MAXVEX]; //访问标志的数组。

typedef struct{VertexType vexs[MAXVEX];EdgeType arc[MAXVEX][MAXVEX];int numVertexes,numEdges;} MGraph; //邻接矩阵。

typedef struct EdgeNode //边表结点。

{int adjvex;struct EdgeNode *next;}EdgeNode;typedef struct VertexNode //顶点表结点。

{int data;EdgeNode *firstedge;}VertexNode,AdjList[MAXVEX];typedef struct{AdjList adjlist;int numVertexes,numEdges; //图中当前顶点数边数。

云南大学 软件学院 数据库实验3

云南大学  软件学院  数据库实验3

云南大学软件学院实验报告课程:数据库原理与实用技术实验学期:2011-2012学年第二学期任课教师:专业:学号:姓名:成绩:实验3使用SQL语句创建并管理数据库、数据表一、实验目的掌握查询分析器的使用方法。

掌握T-SQL语句的基本使用。

熟练掌握DDL语句。

熟练掌握DML(Insert, Delete, Update)语句。

二、实验内容1、用T-SQL语句创建并管理数据库“Employee数据库”,数据库要求见实验二。

记录创建数据库的SQL语句。

2、修改数据库:将“Employee数据库”的数据库最大容量更改为无限制(UNLIMITED),然后将“Employee数据库”的日志文件增长方式改为2MB。

记录SQL语句。

3、用T-SQL语句在“Employee数据库”创建数据表,数据表的结构见实验二。

记录创建表的SQL 语句。

4、修改表结构:将雇员信息表person中,Prof的字段长度改为15。

记录SQL语句。

5、向表中添加记录,使用Insert Into 语句分别向四张表中添加符合表结构属性的数据记录,要求每张表至少4条记录,并显示所添加的记录数据。

6、向雇员信息表person中添加记录完成如下操作:(1)、修改表中记录:将“王辉”的部门修改为“003”;(2)、删除记录:删除表中性别为“女”的员工记录;(3)、删除表:将“person”从“Employee数据库”中删除。

三、思考题如数据库表中存在如下记录:表person中的数据现执行:DELETE FROM department WHERE Depton=“001”,执行结果如何?为什么?。

云南大学软件学院综合技能实践-常用数据库的安装与调试实验报告模板

云南大学软件学院综合技能实践-常用数据库的安装与调试实验报告模板

云南大学软件学院实验报告课程:综合技能实践2——常用数据库的安装与调试学期: 2015秋季学期任课教师:朱艳萍金鑫专业:软件工程学号:姓名:成绩:综合技能实践2——常用数据库的安装与调试第一部分MySQL数据库的安装和使用一、实验目的:1.掌握MySQL数据库环境搭建的具体步骤和操作方法。

2.掌握启动和运行MySQL的方法。

3.掌握使用SQL语句创建数据库、表及向表中插入记录的方法。

二、实验内容和步骤1、首先,查看本台机器的C盘根目录下是否有mysql的文件夹,如果没有,请到(FTP服务器上) 下载mysql-4.0.20a-win.zip或者mysql-5.1.51-win32文件,解压后进行安装。

2、进入安装目录,然后切换到bin文件夹下,双击运行命令mysqld.exe:3、打开命令窗口,然后切换到C:\mysql\bin文件夹下,并输入如下命令:C:\mysql\bin>mysql -u root -p回车后出现Enter password: 提示信息,继续敲入回车符,就进入到MySQL的工作界面:mysql>。

成功地连接后,可以在mysql>提示下输入QUIT (或\q)随时退出:mysql> QUITBye3、在mysql>提示符输入select version(), current_date();命令,系统将显示什么信息?4、下面,在mysql>提示下输入命令SHOW DATABASES; 系统将显示什么信息?(该命令用来显示MySQL中已创建的数据库名称)5、在mysql>提示下输入命令use test; ,系统给出提示信息Database changed,表示已经转到数据库test中。

6、在mysql>提示下输入命令show tables; ,系统给出的提示信息是什么?7、下面,将创建我们实验用的数据库、表和表中的记录。

数据库名称:stud+自己学号的最后4位,如:stud1011。

实验报告模板—汇编语言

实验报告模板—汇编语言

指导教师 (签名):一.实验原理(基本知识简单介绍、算法、流程)二.实验结果(截图,提供实验测试/调试的结果等,在空白地方手写注释)Student strucm_sName db 6 dup(' ')m_sNum db 8 dup(' ')m_sScore db 3 dup(' ')Student endsstsg segment stack 's'dw 32 dup(?)stsg endsanykey macromov ah,7int 21hendmanykeyback macroanykeyshowmsg backendmcrlfm macropush axpush dxmov ah,9lea dx,crlfint 21hpop dxpop axendmexchange macro i,jpush cxpush sipush dimov cx,17;t=[i],即t=前项mov si,ilea di,stutemprep movsbmov cx,17;i=j,si->后项,即前项=后项mov di,i ;rep movsbmov cx,17;j=t,di->后项,即后项=tlea si,stutemprep movsbmov swapped,1pop dipop sipop cxendmspace macropush dxpush axlea dx,gapmov ah,9int 21hpop axpop dxendmshowmsg macro npush axpush dxmov ah,9lea dx,msg&nint 21hpop dxpop axendmmovitem macro dst,srcpush cxpush dipush sicldmov cx,17lea di,[dst]lea si,[src]rep movsbpop sipop dipop cxendmdata segmentstudentx student 30 dup(<>)stutemp db 17 dup (0),'$'studisp db 19 dup(0),'$'namepar LABEL BYTEmaxnlen db 7namelen db ?namefld db 7 dup(?)numpar label bytemaxmlen db 9numlen db ?numfld db 9 dup(?)scopar label bytemaxsco db 4scolen db ?scofld db 4 dup(?);输入文件路径缓冲区pathpar label bytepathmax db 40pathlen db ?pathnam db 40 dup(?)ae90 db 0ae80 db 0ae70 db 0ae60 db 0b60 db 0msg_b60 db 9,9,'Scores<60:$'msg_ae60 db 9,9,'Scores>=60:$'msg_ae70 db 9,9,'Scores>=70:$'msg_ae80 db 9,9,'Scores>=80:$'msg_ae90 db 9,9,'Scores>=90:$'cur_i dw ?crlf db 13,10,'$'titl db ' Students Management System',0DH,0AH,' ',0DH,0AH,0DH,0AHmenu1 db ' I(Insert the data of the students)',0dh,0ah ;menumenu2 db ' L(Browse the data of the students)',0dh, 0ahmenu3 db ' Q(Query the data of the students)',0dh, 0ahmenu4 db ' D(Delete the data of the students)',0dh, 0ahmenu5 db ' M(Modify the data of the students)',0dh,0ahmenu7 db ' P(Print the data of the students)',0dh, 0ahmenu8 db ' C(Statistics the data of the students)',0dh, 0ahmenu9 db ' E(Exit the System)',0dh, 0ah,'$'msgmenu5_1 db 0DH,0AH,'1-----Modify name',0DH,0AHmsgmenu5_2 db '2-----Modify number',0DH,0AHmsgmenu5_3 db '3-----Modify score',0DH,0AH,'$'msgmenu3_1 db 0DH,0AH,'1-----Search name',0DH,0AHmsgmenu3_2 db '2-----Search number',0DH,0AHmsgmenu3_3 db '3-----Search score',0DH,0AH,'$'mmenutip db ' choose a number from the menu above',0DH,0AH,'$'msgprinttitle db 0DH,0AH,0DH,0AH,' sno sname score ',0DH,0AH,'$'gap db ' $'stu dw ?stustored dw 0swapped db 0sav_cnt dw ?stusaved dw 0saveflag db 1errcde db 0endcde db 0endaddr dw ?filehandle dw ?msg_titleln db ' ------------------------------------',13,10,'$'msgsepln db '--------------------------------',0DH,0AH,'$'msg02 db 'Please input the new student info.',13,10,'$'msg03 db 'Name:','$'msg04 db 'ID:','$'msg05 db 'Score:','$'msg07 db 'Successly Saved!',13,10,'$'msgdeled db 'Successly Deleted a item!',13,10,'$'msgmoded db 'Successly Modified a item content!',13,10,'$'msginsed db 'Successly Inserted item(s)!',13,10,'$'msgqforins db 'Insert this item?(y/n):',13,10,'$'msgback db 'Press any key to back.$'msgexit db 'Press any key to exit.$'msg09 db 'students out of 30.',13,10,'$'msg20 db 'There are more than 30 students.',13,10,'$'msg21 db 'Save as:',13,10,'$'msg22 db 'Please input the file you want to operate:',13,10,'$'msg23 db 'Read successly!',13,10,'$'msg27 db 'There isn',27h,'t any student.',13,10,'$'msgnoext db 'There is no such item!',13,10,'$'msgnaminfid db 'Please input a name to find:',13,10,'$'msgnuminfid db 'Please input a number to find:',13,10,'$'msgscoinfid db 'Please input a score to find:',13,10,'$'msgstattit db 9,9,'The result of statistics is listed as follow:',13,10,'$'msg_nname db 'Please input a new one:',13,10,'$'msg_nnum db 'Please input a new num.:','$'msg_nsco db 'Please input a new score.:','$'msgqsave db 'The ducoment have not saved.Do you want to save it now(y/n)?','$'msg_delnamin db 'Please input the name you want to delete:',13,10,'$'msg_modname db 'Please input the name field you want to modify:',13,10,'$' msg_modnum db 'Please input the number field you want to modify:',13,10,'$'msg_modsco db 'Please input the score field you want to modify:',13,10,'$' opnmsg db '***Error occured while opening file***',13,10,'$' wrtmsg db '***Error occured while writing file***',13,10,'$' readmsg db '***Error occured while reading file***',13,10,'$' routemsg db '***Path name is invalid***',13,10,'$'data endscode segmentassume cs:code,ds:data,ss:stsg,es:datamain proc farstart:mov ax,datamov ds,axmov es,axmainmenu:mov AX,0600Hmov CX,0000Hmov DX,174FHmov BH,07int 10Hmov AH,02 ;set cursormov BH,0mov DX,0100Hint 10Hlea DX,titl ;display menumov AH,9int 21Hshowmsg _titlelnlea DX,mmenutipmov AH,9int 21Hcase:mov ah,0int 16hcmp ah,17h;'i'je addonecmp ah,26h;'l'je browsecmp ah,19h;'p'je displaycmp ah,10h;'q'je querycmp ah,20h;'d'je del_intermcmp ah,2eh;'c'je statiscmp ah,32h;'m'je changecmp ah,12h;'e'je exitdisplay:call display_inanykeybackjmp mainmenuquery:call query_inanykeybackjmp mainmenubrowse:call browse_inanykeybackjmp mainmenuaddone:call insert_inanykeybackjmp mainmenuexit:call quitstatis:call stat_inanykeybackjmp mainmenudel_interm:jmp deletechange:call mod_inanykeybackjmp mainmenudelete:call del_inanykeybackjmp mainmenubeep:mov AH,14mov AL,7mov BH,0int 10Hjmp mainmenumain endp;------------------------------------------------------------------------ browse_in proc nearcall near ptr clearcall near ptr cursorcall near ptr readallcall name_sortcall near ptr printretbrowse_in endp;------------------------------------------------------------------------ del_in proc nearcall clearcall cursorcall delete_inretdel_in endp;------------------------------------------------------------------------ query_in proc nearcall clearcall cursorcall bg_searchretquery_in endp;------------------------------------------------------------------------ stat_in proc nearcall clearcall cursorcall near ptr statretstat_in endp;------------------------------------------------------------------------ insert_in proc nearcall clearcall cursorcall near ptr inputcall name_sortretinsert_in endp;------------------------------------------------------------------------ display_in proc nearcall clearcall cursorcall near ptr printretdisplay_in endp;------------------------------------------------------------------------ mod_in proc nearcall clearcall cursorcall printcall bg_modifycall name_sortretmod_in endp;------------------------------------------------------------------------ delete_in proc nearpush axpush dxcall printcrlfmmov ah,9lea dx,msg_delnaminint 21hcall near ptr inputnamecall near ptr delshowmsg deledqdel:pop dxpop axretdelete_in endp;------------------------------------------------------------------------ bg_search proc nearshowmsg menu3_1mov ah,1int 21h;getch()crlfmcmp al,'1'je q1cmp al,'2'je q2showmsg scoinfidlea bx,studentx+14mov dx,3jmp bgsearq1:showmsg naminfidcall near ptr inputnamelea bx,studentxmov dx,1jmp bgsearq2:showmsg numinfidcall near ptr inputnumlea bx,studentx+6mov dx,2bgsear:push bxpush dxcall near ptr search;search(studentx,1)cmp ax,-1je qinsshowmsg printtitleshowmsg seplnpush simov si,axcall near ptr printlinepop sijmp qqueqins:showmsg qforinsmov ah,01int 21hcrlfmcall inputnumcall inputscocall storshowmsg insedmov saveflag,0qque:retbg_search endp;------------------------------------------------------------------------ bg_modify proc nearpush axpush bxpush dxshowmsg menu5_1;display modify submenumov ah,1int 21h;getch()crlfmcmp al,'1'je t1cmp al,'2'je t2mov bx,3call inputscojmp cint1:call inputnamemov bx,1jmp cint2:mov bx,2call inputnumcin:push bxcall near ptr modifycmp ax,-1je qmodicrlfmshowmsg modedqmodi:pop dxpop bxpop axretbg_modify endp;------------------------------------------------------------------------ quit proc nearcmp saveflag,0je qforsavjmp qsysqforsav:call clearcall cursorshowmsg qsavemov ah,1int 21hcmp al,'y'je savitjmp qsyssavit:call savemov ah,3eh;close filemov bx,filehandleint 21hqsys:mov ax,4c00hint 21hretquit endp;------------------------------------------------------------------------ search proc nearpush bpmov bp,sppush dipush bxpush sipush cxpush dxmov di,[bp+6]mov dx,stustoredmov bx,[bp+4];bx:typemov bp,dicmp bx,1je snamcmp bx,2je snummov cx,3mov bx,cxlea ax,scofldjmp loop1snam:mov cx,6mov bx,cxlea ax,namefldjmp loop1snum:mov cx,8mov bx,cxlea ax,numfldloop1:mov si,axrepe cmpsbje foundadd bp,17mov di,bpdec dhjnz loop1mov ax,-1showmsg noextjmp qsearchfound:mov ax,bpmov dx,stustoredsub dx,bxmov cur_i,dxqsearch:pop dxpop cxpop sipop bxpop dipop bpret 4search endp;------------------------------------------------------------------------ name_sort proc nearpush sipush dipush axpush bxpush dxpush cxcmp stustored,1je qsortlea bx,studentxpush bxmov ax,stustoredsub ax,1mov bl,17mul blpop bxadd bx,axmov dx,stustoredsub dx,1 ;dx:il1:mov swapped,0sub bx,17mov endaddr,bxpush bxlea si,studentx;si:j,j=0l2:mov di,siadd di,17mov bx,dimov ax,sirepe cmpsbjbe s3exchange ax,bxs3:mov si,axadd si,17;j++cmp si,endaddrjbe l2pop bxcmp swapped,0je qsortdec dxjnz l1qsort:pop cxpop dxpop bxpop axpop dipop siretname_sort endp;------------------------------------------------------------------------ del proc nearpush bxpush dipush sipush cxlea bx,studentxpush bxmov bx,1;search(studentx,name)push bxcall near ptr searchcmp ax,-1je nomatchmov di,axmov si,diadd si,17;si:j,di:imov cx,stustoredsub cx,cur_imovit:movitem di,simov di,si;si:j+1 ,di:jmov dx,diadd dx,17mov si,dxloop movitmov ax,1mov saveflag,0sub stustored,1nomatch:pop cxpop sipop dipop bxretdel endp;------------------------------------------------------------------------ insert proc nearpush sipush dipush axpush bxpush cxcmp stustored,0je exilea si,stutemplea di,studentxmov ax,stustoredmov bl,17mul bladd di,axmov cx,17;rep movsbinc stustoredexi:pop cxpop bxpop axpop dipop siretinsert endp;------------------------------------------------------------------------ stor proc nearpush axpush bxpush dxpush dipush sipush cxcmp namelen,0je qstocldmov ax,stustoredmov bl,17mul bllea dx,studentxmov stu,dxadd stu,axmov di,stulea si,namefldmov cx,6rep movsblea si,numfldmov cx,8rep movsbmov cx,3lea si,scofldrep movsbinc stustoredqsto:pop cxpop sipop dipop dxpop bxpop axretstor endp;------------------------------------------------------------------------ modify proc nearpush bpmov bp,sppush bxpush dxpush dipush cxmov bx,[bp+4]cmp bx,1je mdnamcmp bx,2je mdnumlea dx,studentx+14jmp findmdnam:lea dx,studentxjmp findmdnum:lea dx,studentx+6find:push dxpush bxcall near ptr searchcmp ax,-1je qu_modmov di,ax;cmp bx,1je mnamcmp bx,2je mnumlea dx,msg_nscomov ah,9int 21hlea dx,scoparmov ah,0ahint 21hmov cx,3lea si,scofldjmp mfymnam:lea dx,msg_nnamemov ah,9int 21hcall inputnamemov cx,6lea si,namefldjmp mfymnum:lea dx,msg_nnummov ah,9int 21hlea dx,numparmov ah,0ahint 21hmov cx,8lea si,numfldmfy:rep movsbmov saveflag,0mov ax,1qu_mod:pop cxpop dipop dxpop bxpop bpret 2modify endp;------------------------------------------------------------------------ stat proc nearpush cxpush bxpush dxpush axmov cx,stustoredlea bx,[studentx+14]sta:mov dx,[bx]mov ah,[bx+2]cmp dl,'1'je a90cmp dh,'9'jae a90cmp dh,'8'jae a80cmp dh,'7'jae a70cmp dh,'6'jae a60add b60,1jmp repeata90:add ae90,1jmp repeata80:add ae80,1jmp repeata70:add ae70,1jmp repeata60:add ae60,1repeat:add bx,17loop stashowmsg stattitshowmsg _titlelnshowmsg _b60mov bl,byte ptr b60call deciasccrlfmshowmsg _titlelnshowmsg _ae60mov bl,byte ptr ae60call deciasccrlfmshowmsg _titlelnshowmsg _ae70mov bl,byte ptr ae70call deciasccrlfmshowmsg _titlelnshowmsg _ae80mov bl,byte ptr ae80call deciasccrlfmshowmsg _titlelnshowmsg _ae90mov bl,byte ptr ae90call deciasccrlfmshowmsg _titlelnmov ae90,0mov ae80,0mov ae70,0mov ae60,0mov b60,0pop axpop dxpop bxpop cxretstat endp;------------------------------------------------------------------- errm proc nearpush axmov ah,9int 21hmov errcde,01pop axreterrm endp;------------------------------------------------------------------- input proc nearpush axpush dxcall near ptr clearcall near ptr cursorcmp stustored,29ja i1mov ah,09lea dx,msg02;display promptint 21hiloop:cmp stustored,29ja i1call near ptr inputnamecmp namelen,0je i2call near ptr inputnumcall near ptr inputscocall near ptr storjmp iloopmov saveflag,0jmp i2i1:mov ah,9lea dx,msg20;'There are more than 30 students.' int 21hi2:showmsg back;'Press any key to back.'i3:mov saveflag,0pop dxpop axretinput endp;---------------------------------------------------------------------- inputname proc nearpush axpush dxpush bxpush cxshowmsg 03mov ah,0ahlea dx,nameparint 21hcrlfmmov bh,0mov bl,namelenmov cx,7sub cx,bxn10:mov namefld[bx],20hinc bxloop n10pop cxpop bxpop dxpop axretinputname endp;----------------------------------------------------------------------- inputnum proc nearpush axpush dxpush bxpush cxshowmsg 04mov ah,0ahlea dx,numparint 21hcrlfmmov bh,0mov bl,numlenmov cx,9sub cx,bxn20:mov numfld[bx]inc bxloop n20pop cxpop bxpop dxpop axretinputnum endp;---------------------------------------------------------------------- inputsco proc nearpush axpush dxpush bxpush cxshowmsg 05mov ah,0ahlea dx,scoparint 21hcrlfmmov bh,0mov bl,scolenmov cx,4sub cx,bxn21:mov scofld[bx],20hinc bxloop n21pop cxpop bxpop dxpop axretinputsco endp;------------------------------------------------------------------------ print proc nearpush sipush cxpush dxpush axcmp stustored,0je qprintcrlfmcrlfmshowmsg printtitleshowmsg seplnlea si,studentxmov cx,stustoredpline: call near ptr printlineloop plinepop axpop dxpop cxpop siqprint:retprint endp;------------------------------------------------------------------------ printline proc nearpush dipush cxpush dxpush axlea di,studisp;stutemp=studentx[i]mov cx,6rep movsbmov [studisp+6],9add di,1mov cx,8rep movsbmov [studisp+15],9add di,1mov cx,3rep movsbmov ah,9lea dx,studispint 21hcrlfmshowmsg seplnpop axpop dxpop cxpop diretprintline endp;------------------------------------------------------------------------ deciasc proc nearmov ch,100dmov cl,10dre:cmp ch,0je qdecimov al,bl;cbwdiv ch;mov bl,ahcall near ptr printitmov al,chcbwdiv clmov ch,aljmp reqdeci:retdeciasc endp;--------------------------------------------------------------------printit proc nearadd al,30hmov dl,almov ah,2int 21hretprintit endp;-------------------------------------------------------------------- stor2 proc nearpush sipush dipush axpush bxpush cxcmp stutemp,0je exittlea si,stutemplea di,studentxmov ax,stustoredmov bl,17mul bladd di,axmov cx,17;rep movsbinc stustoredpop cxpop bxpop axpop dipop siexitt: retstor2 endp;------------------------------------------------------------------------ get_path proc nearpush axpush bxpush dxshowmsg 22;'Please input the file you want to operate:' mov ah,0ahlea dx,pathparint 21h;crlfmmov bl,pathlenmov bh,0mov pathnam[bx],0pop dxpop bxpop axretget_path endp;--------------------------------------------------------------------openh proc nearpush axpush cxpush dxcall near ptr get_pathmov ah,3dhmov cx,0lea dx,pathnamint 21hjc o1mov filehandle,axpop dxpop cxpop axreto1:mov endcde,01lea dx,opnmsgcall near ptr errmpop dxpop cxpop axretopenh endp;-------------------------------------------------------------------- readall proc nearpush axmov endcde,0call near ptr openhcmp endcde,0jne rexit;endcde=1mov stustored,0contin:call near ptr readhcmp endcde,0jne r20;endcde=1call near ptr stor2cmp stustored,30ja oexitjmp continr20:call near ptr clsehcall clearcall cursorshowmsg 23jmp rexitoexit:call near ptr clsehmov saveflag,0showmsg 09;rexit:showmsg back;pop axretreadall endp;----------------------------------------------------------------------- readh proc nearpush axpush bxpush cxpush dxmov ah,3fh;read filemov bx,filehandlemov cx,17lea dx,stutempint 21hjc c1cmp ax,0je c2;ax=0,end of file,quitcmp stutemp,1ah;EOF Marker?je c2pop dxpop cxpop bxpop axretc1:lea dx,readmsgcall near ptr errmc2:mov endcde,1pop dxpop cxpop bxpop axretreadh endp;----------------------------------------------------------------------- save proc nearpush cxpush axmov errcde,0call near ptr clearcall near ptr cursorcall near ptr creathcmp errcde,0jne s2sloop:mov cx,stustoredcmp stusaved,cxje sexitcall near ptr writhcmp errcde,0jne sexitjmp sloopsexit:call near ptr clsehmov saveflag,1showmsg 07s2:showmsg exitanykeymov stusaved,0pop axpop cxretsave endp;------------------------------------------------------------------------ creath proc nearpush axpush cxpush dxshowmsg 21call near ptr get_pathcrlfmmov ah,3chmov cx,0lea dx,pathnamint 21hjc a1mov filehandle,axpop dxpop cxpop axreta1:lea dx,opnmsgcall errmpop dxpop cxpop axretcreath endp;------------------------------------------------------------------------ clseh proc nearpush axpush bxmov ah,3ehmov bx,filehandleint 21hpop bxpop axretclseh endp;------------------------------------------------------------------------ writh proc nearmov ax,stusavedmov bl,17mul bllea dx,studentxadd dx,ax;dxmov ah,40hmov bx,filehandlemov cx,17;cxint 21hinc stusavedjnc d1lea dx,wrtmsgcall near ptr errmd1:retwrith endp;------------------------------------------------------------------------ clear proc nearpush axpush bxpush cxpush dxmov AX,0600H ;clear screenmov CX,0mov DX,174FHmov BH,07int 10Hpop dxpop cxpop bxpop axretclear endp;------------------------------------------------------------------------ cursor proc nearpush axpush bxpush dxmov ah,2mov bh,0mov dx,0;dh:row,dl:columnint 10hpop dxpop bxpop axretcursor endpcode endsend start三.实验总结(心得、体会、实验设计不足之处)。

云南大学软件学院汇编语言实验报告五

云南大学软件学院汇编语言实验报告五

练习:多字节的二进制加法程序实验
1.实验内容
将两个4字节长的二进制数相加,运算结果存放在相应结果单元中。

2.说明
首先应安排程序的结构,其中代码段和数据段是必须有的。

代码段里实现数的相加,可用带进位的加法指令;数据段中存放被加数、加数和结果单元这些数据。

考虑到编程的方便,在定义加数和被加数时,将低位字节放到低地址,高位字节放在高地址。

进行加法运算时,按照由低地址到高地址的顺序取得数据,而每一步运算的结果也按照低位放在低地,高位放在高地址的方式进行存储。

源程序:
DATAS SEGMENT
DATA1 DD AB464431H
DATA2 DDAC5434H
DATA3 DW 2 DUP(0);
DATAS ENDS
STACKS SEGMENT
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
MOV BP,0
LEA SI,DATA1 ;
LEA DI,DATA2
MOV AX,[SI]
ADD AX,[DI] ;
JC L ;
MOV 4[DATA3],AX ;
MOV AX,0
LOOP1: MOV AX,4[SI] ;
ADD AX,4[DI]
JMP LOOP3
LOOP2: MOV AX,1 ;
JMP LOOP3
LOOP3: MOV [DATA3],AX ;
MOV AH,4CH
INT 21H
CODES ENDS
END START。

云南大学软件学院大学物理实验报告六

云南大学软件学院大学物理实验报告六

云南大学软件学院 实验报告课程: 大学物理实验 学期: 2012-2013学年 第一学期 任课教师: 张德海 专业: 数字媒体技术 学号: 20111120248 姓名: 赵云涛 成绩:实验6 示波器一、 实验目的1.学会使用信号发生器。

2.学会用示波器观察波形以及测量电压、周期和频率。

二、 实验内容1.观察信号发生器波形2.测量正弦波电压在示波器上调节出大小适中、稳定的正弦波形,选择其中一个完整的波形,先测算出正弦波电压峰—峰值U p-p ,即:U p-p =(垂直距离DIV )×(档位V/DIV )×(探头衰减率)= 20.0v然后求出正弦波电压有效值U 为2U 71.0U p p -⨯== 7.1v3.测量正弦波周期和频率在示波器上调节出大小适中、稳定的正弦波形,选择其中一个完整的波形,先测算出正弦波的周期T ,即T =(水平距离DIV )×(档位t/DIV )= 150.0s然后求出正弦波的频率T f 1= = 0.0067 Hz 。

4.观察李萨如图形(1)将示波器的显示模式切换为A/B ,A 通道接到如图电路的位置1,调节信号发生器输出电压的频率为50Hz ;信号发生器2的输出端接到示波器B 通道,分别调节输出正弦波的频率为50Hz 、75Hz 、100Hz 、150Hz ,观察并记录各种李萨如图形。

(2)将示波器的显示模式切换为A/B ,A 通道接到如图电路的位置2,调节信号发生器输出电压的频率为50Hz ;信号发生器2的输出端接到示波器B 通道,分别调节输出正弦波的频率为50Hz 、75Hz 、100Hz 、150Hz ,观察并记录各种李萨如图形。

思考题1. 信号的幅值对李萨如图形有影响么?答:会影响到,李萨如图的形状会随两个信号的幅值以及位相不同而变化。

2. 要获得稳定的李萨如图形,两个信号的频率应符合什么样的关系?答:李萨如图上的每一个点都可以用以下的公式进行表示:X=A1sin(ω1t+ψ1) ,Y=A2sin(ω2t+ψ2) 。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
2、在配置完上述基本设置后,进入登录界面,如图5所示,输入TSO,回车(键盘上的CTRL键),进入如图6所示的屏幕,输入自己的用户名。
3、修改密码
4、成功登录后应该会看到TSO的主屏,输入ISPF,进入如图8所示界面。
5、创建数据集
在TSO主屏,如图9所示,在红色方框处输入3.2(也可以依次输入3、2)回车(键盘的右CTRL键)。
(5)输入运行的JCL程序,并运行编译结果
(6)控制台方式运行编译程序
一、实验原理
1、大型机数据集的建立
2、COBOL源程序的设计与输入大型机
3、JCL程序的设计与输入大型机
4、编译程序
5、以不同方式运行程序
二、实验目的
1.熟悉PCOM及ISPF环境;
2.熟悉在大机系统编译连接与运行基本COBOL程序的方法;
3.掌握基本是输入输出语句的使用。
三、实验内容
1、连接主机
安装PCOMM软件,点击通信菜单中的配置选项,如图1所示;在定制通信图像界面中,如图2所示,点击链路参数,配置服务器地址:202.115.7.252,端口23,如图3所示;点击会话参数,在主机代码选项中,选择037美国。
6、接下来会进入数据集工具屏,如图10所示,要求输入数据集名称和所在卷标,创建数据集YNTE03.COBOL.SOURCE。注意:YNTE03是我的账号。
如法炮制,使用相同的流程和参数创建数据集YNTE03.COBOL.JCL,其作用存放编译COBOL程序和运行结果程序的JCL程序。
最后,创建存ቤተ መጻሕፍቲ ባይዱ编译结果的数据集YNTE03.COBOL.LOAD,图11是数据集的参数配置图,注意其记录格式为U。
云南大学软件学院实验报告
———————————————————————————————— 作者:
———————————————————————————————— 日期:

云南大学软件学院实验报告
序号:01实验老师:代飞实验时间:2011/10/17姓名:袁秀梅
实验名称:COBOL程序的编译与运行学号:20091120107
3、设计并输入COBOL源程序
在Option处输入4,回车(键盘的右CTRL键),进入数据集查看界面,如图13所示。
图在Option处输入回车,进入如图14所示,并在YNTE03.COBOL.SOURCE中建立一个TEST1的MEMBER,如图中红色方框所示输入,完毕后回车。
图5选择应用程序终端
图6输入用户名
在接下来的屏幕中按提示输入自己的口令,如图7。如果是第一次登陆,必须修改密码。
(1)首先使用由老师分配的IBM的主机用户名和密码登陆大型机
(2)建立相应数据集
建立用于存放COBOL源程序的分区数据集
建立用于存放JCL程序的分区数据集
再根据建立存放编译结果的数据集
(3)设计并输入COBOL源程序
(4)输入编译JCL程序,并编译源程序为目标文件
相关文档
最新文档