ImageVerifierCode 换一换
格式:PPT , 页数:18 ,大小:40.50KB ,
文档编号:2477228      下载积分:18 文币
快捷下载
登录下载
邮箱/手机:
温馨提示:
系统将以此处填写的邮箱或者手机号生成账号和密码,方便再次下载。 如填写123,账号和密码都是123。
支付方式: 支付宝    微信支付   
验证码:   换一换

优惠套餐
 

温馨提示:若手机下载失败,请复制以下地址【https://www.163wenku.com/d-2477228.html】到电脑浏览器->登陆(账号密码均为手机号或邮箱;不要扫码登陆)->重新下载(不再收费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录  
下载须知

1: 试题类文档的标题没说有答案,则无答案;主观题也可能无答案。PPT的音视频可能无法播放。 请谨慎下单,一旦售出,概不退换。
2: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
3: 本文为用户(三亚风情)主动上传,所有收益归该用户。163文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(点击联系客服),我们立即给予删除!。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

1,本文(Binary-Number-Output-Electrical-and-Computer-Engineering二进制数输出的电气和计算机工程课件.ppt)为本站会员(三亚风情)主动上传,163文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。
2,用户下载本文档,所消耗的文币(积分)将全额增加到上传者的账号。
3, 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(发送邮件至3464097650@qq.com或直接QQ联系客服),我们立即给予删除!

Binary-Number-Output-Electrical-and-Computer-Engineering二进制数输出的电气和计算机工程课件.ppt

1、Binary Number Output To display a number in binary format, a program looks at each bit in the number and sends the ASCII equivalent of a 1 (31h) or a 0 (30h) to the screen using the DOS single character Int 21h function 2. The 8-bit value E6h (1110 0110) would have 31h,31h,31h,30h,30h,31h,31h,30h He

2、x Number Output To display the 8-bit value E6h as a HEX number, the ASCII codes for E(45h) and 6(36h) would be sent using Int 21h, function 2.Procedure to Display Hex DigitInput: AL Clear upper 4-bits of AL (should only have values 0-F) Check AL for 0-9 (CMP AL,9) (Add AL,30h if 0-9) Must be Char if

3、 above 9 (Add AL, 37h if char; 37h + 10d = 41h(A) Use Int21h, function 2 to display char (DL holds char)Procedure to Display 1 Hex DigitInput: ALOut1hexprocAndal,0fh ;only want lower 4 bits of ALCmpal,9 ;is 4 bit value above 9?JaischarAddal,30h ;convert to ascii digit 0 to 9JmpprintitIschar: addal,3

4、7h ;convert to ascii digit A to FPrintit: Movdl,alMovah,2Int21h ;print it using DOS single char outputRetOut1hexendpProcedure for CRLF Use Int 21h, function 2 to display ASCII values for CR (0Dh), LF (0Ah).Pcrlfproc;print carriage return/line feedMovdl,0Dh ;carriage returnMovah,2;function # goes int

5、o AHInt21h;print itMovdl,0Ah ;line feedMovah,2;function #Int21hRetPcrlfendpIrvine Library Procedures Writeint writes an unsigned 16-bit integer to standard output in ASCII binary, decimal, octal, or hexadecimal format. Input: AX=integer, BX=radix(2,8,10,or 16) Writeint_signed writes a 16-bit integer

6、 to standard output in signed decimal ASCII format. Input: AX=integer.Irvine Library Procedures Writelong - writes an unsigned 32-bit integer to standard output in ASCII binary, decimal, octal, or hexadecimal format. Input: EAX=integer, BX=radix(2,8,10,or 16) Writebcd writes an 8-bit binary coded de

7、cimal byte to standard output. Input: AL=byte. Crlf Writes a carriage return and line feed to standard output.Irvine Library Procedures Clrscr Clears the screen and locates the cursor at the upper left corner. No input. Works only on video page 0, and only in text mode. Writestring Writes a null ter

8、minated string to standard output. Input: DX points to the string. Readint Reads a signed ASCII decimal string from standard input and stores it as a 16-bit binary integer. Input: none. Output: AX contains the value.Changing Model Size Using a small model size requires that procedures must be within

9、 the code segment (within 256 bytes). Therefore only the offset address is needed in the call instruction. Using a Medium model size allows larger differences in placement of procedures. Therefore the value of CS must also be saved when going to the procedure. CS and IP are both pushed onto the stac

10、k.Lab6A- Question C Writing 16 different characters (0-F) as a most significant digit and 16 different characters as a least significant digit results in a total of 256 different values. Want to have two loops with the inner loop changing the LSD and the outer loop changing the MSD. Can use a shr in

11、struction to get upper 4 bits into lower 4 bits.Lab 6B Using Irvine Library Procedures to Display Integers in Different Bases Writeint uses BX to determine desired radix. BX=2 ;display in binary BX=8 ;display in octal BX=10 ;display in decimal BX=16 ;display in hex AX=integer Writeint_signed display

12、s signed 16-bit value as a signed decimal ASCII format.More on Lab6B Irvine Libraries Note that with Writestring, strings can finally be null-terminated. (much more common than DOS $) What is maximum value that can be represented with 16 bits using 2s complement format (216 = ?)More on Lab6B Irvine

13、Libraries What directive is needed to access the Irvine libraries? Extrn Clrscr:proc, Crlf:proc, Readint:proc When linking must have complete path of irvine libraries unless the irvine.lib is the current directory.Unsigned Decimal Number Output To display the 8-bit value E6h as an unsigned decimal n

14、umber, first a conversion must occur. E6h = (14*16)+6=230(decimal) The ASCII codes for 2(32h), 3(33h), 0(30h) would be sent using Int21h, function 2.Signed Decimal Number Output To display the 8-bit value E6h as a signed decimal number (2s complement representation), first a conversion must occur. E

15、6h = 11100110b = -1Ah= -26(decimal) The ASCII codes for -(2Dh),2(32h), 6(36h), would be sent using Int21h, function 2.Lab6C Number Input Uses Irvine library procedure to Writestring to output. Uses Readstring to read in data as a string Readstring Reads a string of characters from standard output an

16、d stores them in a null terminated string. Input: DX=string pointer. CX= maximum string count. Output: AX=number of characters typed.Lab 6C- What to do? Call to dec2hex has BX pointing to ASCII string. Expects converted results in AX. Each string is 2 bytes long (excluding null char). First byte is ASCII representation of MSD. Second byte is LSD.Procedure for Lab6C-Question 4 Subtract 30h to convert from ASCII to decimal. Multiply by 10. Save value Put LSD in AL. Subtract 30h to convert Add value to 10s value.

侵权处理QQ:3464097650--上传资料QQ:3464097650

【声明】本站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是网络空间服务平台,本站所有原创文档下载所得归上传人所有,如您发现上传作品侵犯了您的版权,请立刻联系我们并提供证据,我们将在3个工作日内予以改正。


163文库-Www.163Wenku.Com |网站地图|