Linux kernel annotation-1/boot/bootsect. s

Source: Internet
Author: User
Linux kernel annotation-1/boot/bootsect. s. the code is from the kernel code/boot/bootsect of linux0.11. s this code uses the asm assembly format to start the code. the reason why AT & amp; T is not used is that AT & amp; T assembly AT that time does not support 16-bit mode .www.2cto.com assembly knowledge: string operation command :...
Linux kernel annotation-1/boot/bootsect. s. the code is from the kernel code/boot/bootsect of linux0.11. s this code uses the asm assembly format to start the code. the reason why AT&T is not used is that the AT&T assembly at that time did not support the 16-bit mode. www.2cto.com assembly knowledge: String operation commands: the operands of String operation commands are data strings continuously stored in the primary storage-that is, in the continuous primary storage area, the operation object of the byte or word sequence string operation instruction is a string in the unit of word (W), or a byte string addressing in the unit of byte (B: the source operand is addressed by the Register SI. the default value is in the data segment DS, but the allowed segment goes beyond: DS: [SI] destination operand uses the register DI addressing. the default value is in the additional segment ES, segment exceeded: ES: [DI] each time the string operation command is executed, SI and DI will automatically Add (subtract) the string transmission command MOVW, MOVB bytes (B) or the number of words (W) is transmitted from the source address of the primary storage to the destination address. the repeated prefix Command REP: each time a string command is executed, CX minus 1, Until CX = 0, repeated execution ends 1 BOOTSEG = 0x07c0 2 INITSEG = 0x9000 3 ....... 4 entry start 5 start: 6 mov ax, # BOOTSEG 7 mov ds, ax! Ds = 0x07c0 8 mov ax, # INITSEG 9 mov es, ax! Es = 0x900010 mov cx, #256! Cx = 256 for cyclic counting 11 sub si, si! Si = si-si means si = 0 12! Ds: si = 0x07c0: 0x0000 = 0x7c0013 sub di, di! Di = di-di means di = 014! Ds: si = 0x9000: 0x0000 = 0x9000015 rep! Start loop operation until cx = 016 movw! Move 1 word each time and execute 256 times. implementation: 17! The first 256 words (word) starting from 0x7c00 are 512 bytes of data at 0 X! Moving bootsect. s to 0x9000 19 jmpi go, INITSEG! Jump to 0x90000 and start execution. the following code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.