汇编命令详解(Assembly command detailed)_第1页
汇编命令详解(Assembly command detailed)_第2页
汇编命令详解(Assembly command detailed)_第3页
汇编命令详解(Assembly command detailed)_第4页
汇编命令详解(Assembly command detailed)_第5页
已阅读5页,还剩34页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、汇编命令详解(Assembly command detailed)Name interpretation formatA (Assemble) assemble a address by line by lineC (Compare) compares two memory blocks C, range, addressD (Dump) memory 16 hexadecimal display D address or D rangeE (Enter) modifies the memory byte e addressF (fin) preset a period of memory F

2、, range, listG (Go) executing program g =addressaddress.H (Hexavithmetic) arithmetic operations, h, value, valueI (Input) enters I pataddress from the specified port addressL (Load) read disk L, address, driver, seetorM (Move) memory block transfer m range addressN (Name) sets the filename n, filesp

3、ec, filespec.O (Output) outputs the o portadress byte from the specified port addressQ (Quit) ends QR (Register) display and modify registers R, register, nameS (Search) lookup byte string s, range, listT (Trace) tracking executes t =address valueU (Unassemble) disassemble u address or rangeW (Write

4、) save W, addressdriver, sector, secnumOnline help?Debug small assembler a commandDebug small assembly a command is a very useful function, many small programs are required to do it.Compiling some small programs is more convenient than assembly, quick cleaning.In Debug, interrupts are very useful. F

5、irst, lets look at interrupts.The so-called interruption, in fact, is that when you do something, someone comes to look for you, there are other things, you first put down your hands (computer, called the protection of the scene)Go and work with the man who calls you, and wait till you are done. You

6、 go back and do what you just did. This is a very popular argument.This happens when the computer is running, so we call it interrupts.Here are some of his frequently used interrupt vectors for entry values: (remember, oh, very useful. Ha ha)IBM PC interrupts int10OoH screen mode settingsEntrance: A

7、H = 0, AL = display mode code (06)0:40*25 black and white1:40*25 color2:80*25 black and white3:80*25 color text4:320*200 color5:320*200 black and white6:640*200 black and white graphics mode7:80*25 monochrome character (monochrome display)0BH color settingsEntry: AH = 0B, BL = 0, set background colo

8、r, BH = 0 - 15, BL = 1, set color code, BH = 0 - 10CH writes graphic pointsEntry: AH = 0C, CX:DX = column number: line number, AL = colorODH read graphics pointsEntry: AH = 0D, CX:DX = column number: line numberReturns: AL = color0EH writes characters at the current page and at the current cursorEnt

9、ry: AH = 0E, AL = character ASCII code, BL = foregroundOFH display statusEntrance: AH = 0FReturns: AL = current display mode, AH = screen column number, BH = current page number01H cursor settingsEntrance: AH = 1, CH = cursor start line number (000C),CL = cursor ending (000C)Note: CH CL02H cursor po

10、sitioningEntry: AH = 2, BH = page number, DH:DL = start line: column03H read cursor positionEntry: AH = 3, BH = page number.Returns: DH:DL = start row: column06H Window RollupThe goods: AH = 6, AL = Window Rollup line number, CH:CL - DH:DL window coordinatesNote: AL = 0 scrolls the entire window07H

11、window downEntrance: AH = 7, AL = window down the number of lines, CH:CLDH:DL window coordinates08H reads characters and attributes at the current cursorEntry: AH = 8, BH = page number.Returns: AH:AL = character color: ASCII code for charactersNote: the color code is shown in the following table09H:

12、 write characters and attributes at the current cursorNote: cursor does not move downEntry: AH = 9, BH = page number, BL:AL = character color: character ASCII code, CX = repetition number12345678BL, R, G, B, I, R, G, BFlashing character background with bright character colorInterrupt vector tableInt

13、errupt number explanation, interrupt number explanationThe 0 divisor is 0 wrong 19 bootstrap loaderCall 1 foot interrupt 1A day2 non blocking interrupt NMI 1B keyboard control when blocking3 power interruption (CCH), 1C clock interrupt control4 overflow interrupt 1D pointing to the CRT initial param

14、eter table5 screen printing to interrupt the 1E cassette parameter table6-7 keep 1F 1KB graphics mode8 timer interrupt (18.2 seconds) 20 end DOS program9 keyboard interrupt 21 DOS function callA-D reserves the end address of 22 (meaning EXEC)E floppy disk interrupt 23 DOS Crtl-Break exit addressF re

15、tains 24 DOS fatal error vectors10 screen I/O call 25 DOS absolute disk read11 device check call 26 DOS absolute disk write12 memory check, call the 27 end of the program, and stay (use 31h)13 floppy disk machine I/O call 28-3F DOS reserved14 RS-233I/O calling 40-7F is not used15 I/O call 80-85 BASI

16、C reserved cassette16 keyboard I/O call 86-F0 BASIC interpreter use17 printer I/O calling F1-FF is not used18 ROMBASIC entranceInstruction name detailCall instruction (process call) (control instruction long shift)Detailed explanation:Direct call within segmentAn indirect call (register) within a se

17、gmentIndirect call (memory) in segmentDirect call between segmentsIndirect call between segmentsInstruction nameJMP instruction (unconditional transfer instruction) (control instruction long shift)Detailed explanation:Direct jump in segmentDirect jump in short segmentIndirect jump in section (regist

18、er)Indirect jump in section (memory)Direct jump between segmentsIndirect jump between segmentsInstruction nameRET instruction (process return) (control instruction long shift)Detailed explanation:Return within paragraphReturns to spReturn between segmentsReturns between segments are immediately impo

19、sed on SPNa/jnbe instruction (control instruction short transfer) is not less than or equal to zeroJae/jnb instruction (control instruction short transfer) greater than or equal toThe jb/jnae instruction (control instruction short shift) is smaller than the transferJbe/jna instruction (control instr

20、uction short transfer) less than or equal to transferThe jg/jnle instruction (control instruction short shift) is greater than the transferJge/jnl instruction (control instruction short transfer) greater than or equal toThe jl/jnge instruction (control instruction short shift) is smaller than the tr

21、ansferJle/jng instruction (control instruction short transfer) less than or equal to transferThe je/jz instruction (control instruction short shift) is equal to transferThe jne/jnz instruction (control instruction short shift) is not equal to transferThe JC instruction (control instruction short tra

22、nsfer) has carry time transferJNC instruction (control instruction short transfer) transfer when carry is carriedThe jno instruction (control instruction short transfer) does not overflow when it is transferredThe jnp/jpo instruction (control instruction short transition) transfers odd even numbers

23、to odd numbersJNS instruction (control instruction short transfer) symbol bit 0 transferJo instruction (control instruction short transfer) overflow transferThe jp/jpe instruction (control instruction short transition) transfers even if the parity is evenThe JS instruction (control instruction short

24、 transition) is shifted when the symbol bit is 1 Loop instruction (loop control instruction short transfer) CX is not 0 - time loopThe loope/loopz instruction (loop control instruction short transfer) CX is not 0 and marks z = 1 when it is loopingThe loopne/loopnz instruction (loop control instructi

25、on short transfer) CX is not 0 and marks the z=0 cycleJcxz instruction (loop control instruction short transfer) CX transfers at 0Int (interrupt) instruction interrupt instruction (after detailed)Into instruction (interrupt instruction) overflow interruptThe IRET instruction (interrupt instruction)

26、interrupts the returnInstruction nameSHL instruction (logical left shift)Sal instruction (arithmetic left shift)SHR instruction (logical right shift)SAR instruction (arithmetic right shift) register, 1Rol instruction (loop left shift) register, ClRor instruction (loop right shift) memory, 1RCL instr

27、uction (left loop left by carry), ClThe RCR instruction (shifted right by the carry round) (logical operation)Not instruction (take reverse operation) register inversion(logic operation) memory inversionAnd instructions (and operations) (logical operations)Register and registerRegister and memory re

28、gisterMemory and register memoryImmediate number of and memory storesImmediate number and accumulator accumulatorOr instruction (or operation) (logical operation)Register or registerRegister or memory registerMemory or register memoryImmediate number of or memory storesImmediate number or accumulato

29、r accumulatorTest instruction (test) (logical operation)Register test registerRegister test memoryRegister test immediate count存储器 test 立即数累加器 test 立即数movs 指令 (串传送) (字符串操作指令)单个传送重复传送cmps 指令 (串比较) (字符串操作指令)单个比较重复比较scas 指令 (串扫描) (字符串操作指令)单个搜索重复搜索lods 指令 (装入串)(字符串操作指令)单个装载重复装载pile 指令 (保存串) (字符串操作指令)单个存

30、储重复存储mov 指令 (传送字或字节) (数据传送命令)寄存器与寄存器间传送存储器与寄存器间传送立即数传送给存储器立即数传送给寄存器存储器传送给累加器累加器传送存储器寄存器传送给段寄存器存储器传送给段寄存器段寄存器传送给寄存器段寄存器传送给存储存器pop 指令 (把字弹出堆栈) (数据传送命令)push 指令 (把字压入堆栈)存储器寄存器段寄器xchg 指令 (交换字或字节) (数据传送命令)寄存器与寄存器交换存储器与寄存器交换寄存器与累加器交换in 指令 (端口输入) (数据传送命令)直接输入间接输入out 指令 (端口输出) (数据传送指令)直接输出间接输出add 指令 (加法) (算术

31、指令)adc 指令 (带进位加法)寄存器寄存器 寄存器寄存器存储器 寄存器存储器寄存器 存储器立即数存储器 存储器立即数累加器 累加器inc. 指令 (加1) (算术指令)存储器增量寄存器增量sub 指令 (减法) (算术指令)bss 指令 (带借位减法)寄存器寄存器 寄存器寄存器存储器 寄存器存储器寄存器 存储器立即数存储器 存储器立即数累加器 累加器dec 指令 (减1) (算术指令)存储器减量寄存器减量nec 指令 (求反, 以0减之)寄存器求补存储器求补cmp 指令 (比较) (算术指令)寄存器与寄存器比较寄存器与存储器比较寄存器与立即数比较存储器与立即数比较累加器与立即数比较silt

32、 指令 (无符号乘法) (算术指令)imul 指令 (整数乘法)与8位寄存器相乘与16位寄存器相乘与8位存储单元相乘与16位存储单元相乘div 指令 (无符号除法) (算术指令)idiv 指令 (整数除法)被8位寄存器除被16位寄存器除被8位存储单元除被16位存储单元除debug实战1.查看主板的生产日期, 版本d ffff: 05d fe00: 0e2.模拟休息键功能一:100 JMP FFFF:0000:105G3。快速格式化软盘l 100 0 0 *插入一张己格式化软盘W 100 0 0 *放入一张欲格式化软盘注:*分别为:720k E | 1.2m ID | 1.44M 214。硬盘格

33、式化两种方法(1)G = c800:05(2)100MOV AX,0703MOV CX,0001mov dx,0080INT 13INT 3G 1005。加速键盘一MOV AX,0305MOV BX,0000INT 16INT 20RCX十N WQ6。关闭显示器(恢复时,按任意键)一MOV AX,1201MOV BL,36INT 10MOV啊,0INT 16MOV AX,1200INT 10RCX十N crt-WQ7。硬盘DOS引导记录的修复在软驱中放入一张己格式化软盘调试- L 100 2 0 1- W 100 0 50 1把软盘放入故障机软驱中调试- L 100 0 50 1- W 100

34、 2 0 1Q8。清中口令COMS设置调试-MOV BX,0038MOV CX,0000MOV AX,BX70,al公司CXCMP CX,0006锦州0106INT 20- RCX:20-wQ注:以上适合超级与DTK机,对于AST机,因为他的口令放在COMS的4ch-51h地址处,只要将:bx 0038改为:MOVBX,004c即可9。取消COMS的密码(将COMS数据清为初始化)O 70,10O 71,10- GQ10。将硬盘主引导记录保存到文件中调试-MOV AX,0201MOV BX,0200MOV CX,0001mov dx,0080MOV INT 13INT 3- RCX:200-n

35、boot.datwQ11调用中断实现重启计算机(可以成文件)。调试-INT 19INT 20- RCX:2-wQ调试主要命令调试是为汇编语言设计的一种高度工具,它通过单步、设置断点等方式为汇编语言程序员提供了非常有效的调试手段。一、调试程序的调用在DOS的提示符下,可键入命令:C:调试 D 路径 文件名 。分机 parm1 parm2 其中,文件名是被调试文件的名字。如用户键入文件,则调试将指定的文件装入存储器中,用户可对其进行调试。如果未键入文件名,则用户可以用当前存储器的内容工作,或者用调试命令N和L把需要的文件装入存储器后再进行调试。命令中的D指定驱动器路径为路径,parm1和parm2

36、则为运行被调试文件时所需要的命令参数。在调试程序调入后,将出现提示符,此时就可用调试命令来调试程序。二、调试的主要命令1. Display the command D (DUMP) of the memory cell, in the form of:_Daddress or _DrangeFor example, the method of displaying the content of a storage cell according to a specified range is:-d100 12018E4:0100 C7 0604023801, C7 06-06 020002, C

37、7 060802, G. 8.G.G.18E$: 01100202, BB, 0402, E8, 02, 00-CD, 2050515657, 8B, 37.H.M PQVW.Seven18E4:0120 8B0100 to 0120 is the unit content displayed by DEBUG, and each byte on the left is represented by sixteen decimal, and each byte on the right is represented by the ASCII character, and the charact

38、er that is not displayed. There is no section address specified here, and the D command automatically displays the contents of the DS segment. If only the first address is specified, the contents of the 80 bytes starting from the first address are displayed. If no address is specified at all, the co

39、ntents of the last element displayed on the previous D command are displayed.2, there are two commands for modifying the contents of a storage unit.Enter the command E (ENTER) in two formats as follows: the first format can use a given content table instead of the specified range of memory cell cont

40、ents. Command format as:-E addressFor example, -E DS:100 F3XYZ8DIn which F3,X,Y,Z, and each take one byte, the command can use these five bytes instead of the original contents of the storage cell DS:0100 to 0104The second format is the method of successive modification by unit by unit. Command form

41、at as:-E addressFor example, -E DS:100May display as:18E4:0100 89.-If you want to change the content of the unit to 78, the user can type 78 directly, and then press the space key to display the contents of the next unit, as follows:18E4:0100 89.78, 1B.-In this way, the user can continually modify t

42、he contents of successive units until the command is ended with the ENTER key.Fill in the command F (FILL), in the form of:-F range listFor example: -F 4BA:0100 5 F3XYZ8DMake the 04BA:01000104 unit contain the contents of the specified five bytes. If the number of bytes in the list exceeds the speci

43、fied range, more than the item is ignored; if the number of bytes in the list is less than the specified range, the list is repeated until all the specified units are filled.3) check and modify the contents of the register command R (register), it has three formats, as follows:Show all register cont

44、ents and flag bit status in CPU:-RFor example, -rAX=0000, BX=0000, CX=010A, DX=0000, SP=FFFE, BP=0000, SI=0000, DI=0000DS=18E4, ES=18E4, SS=18E4, CS=18E4, IP=0100, NV, UP, DI, PL, NZ, NA, PO, NC18E4:0100, C70604023801, MOV, WORD, PTR, 0204, 0138, DS:0204=0000Display and modify the contents of a regi

45、ster:-R register nameFor example, type-R AXThe system will respond as follows:AX F1F4:That is, the current content of the AX register is F1F4, if not modified, press the ENTER key, otherwise, you can type the content you want to modify, such as:-R BXBX 0369: 059FThe contents of the BX register are m

46、odified to 059F.Displays and modifies flag bit status, and the command format is:The -RF system will respond, as:OV, DN, EI, NG, ZR, AC, PE, CY-At this point, if you do not modify its contents, press the ENTER key, otherwise you can type the content you want to modify, such as:OV, DN, EI, NG, ZR, AC

47、, PE, CY-PONZDINVYou can see that the order in which you type can be arbitrary.4) run command G, which is formatted as:-G=address1address2address3. Where address 1 specifies the start address of the operation, if not specified, it starts from the current CS:IP. The address behind is the breakpoint a

48、ddress. When the instruction is executed to the breakpoint, it stops execution and displays the contents of all the registers and flags at present, and the next instruction to be executed.5) the trace command T (Trace) has two formats:Point by point instruction tracking-T =addressStops after executi

49、ng an instruction from the specified address, displaying the contents of all registers and the value of the flag bit. If no address is specified, execution begins with the current CS:IP.Multiple instruction following-T =addressvalueStops from the specified address after the execution of the N instru

50、ction, and the n is specified by the value.6) assembler command A (Assemble), in the form of:-AaddressThis command allows you to type in assembly language statements and assemble them into machine code, which are stored sequentially in a storage area starting from the specified address. It is import

51、ant to note that DEBUG treats the numbers as sixteen decimal numbers, so if you want to type decimal numbers, you should follow them, such as 100D.7) the disassembly command U (Unassemble) has two formats.Starting from the specified address, disassemble 32 bytes, formatted as:-UaddressSuch as:-u1001

52、8E4:0100, C70604023801, MOV, WORD, PTR0204, 013818E4:0106, C70606020002, MOV, WORD, PTR0206, 020018E4:010C, C70606020202, MOV, WORD, PTR0208, 020218E4:0112, BBO4O2, MOV, BX, 020418E4:0115 E80200 CALL 011A18E4:0118 CD20 INT 2018E4:011A 50, PUSH, AX18E4:011B 51, PUSH, CX18E4:011C 56, PUSH, SI18E4:011D

53、 57, PUSH, DI18E4:011E, 8B37, MOV, SI, BXIf the address is omitted, the 32 byte is displayed from the next cell of the last instruction of the previous U command.? disassemble the storage units within the specified range, in the form of:-UrangeSuch as:-u100 10C18E4:0100, C70604023801, MOV, WORD, PTR0204, 013818E4:0106, C70606020002, MOV, WORD, PTR0206, 020018E4:010C, C70606020202, MOV, WORD, PTR0208, 0202or-u100 11218E4:0100, C7060402

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论