assembly language in the microcomputer interface

Source: Internet
Author: User

The previous compilation was not very good. By this microcomputer interface to the assembly language is to fill up.


The following is a note of this time relative to the assembly language used in the microcomputer interface.




PTR

In the case where there is no register name, the length of the memory unit is indicated by the operator "x ptr", and X can be word or byte in the assembly instruction. For example:mov word ptr ds:[0],1inc Word PTR [BX]move byte ptr ds:[0],1Inc byte PTR [BX]In memory unit access directives that do not have register participation, you must explicitly tell the CPU whether the unit to be accessed is a word cell or a byte cell.



XLAT


Xlat for the Table command, which operates as [Bx]+[al]---->al

MOV
Assignment statement: MOV dx,key; key is Variable



out


typically used for write ports
MOV Dx,pa; PA is PortOut Dx,al; Al for specific commands such as 8255 initialization



inch




typically used to write CPU
In AL,DX, the value of the port can not be directly written in AL, need to first mov into DX and then in into the Al




OFFSET


Get offset Address
MOV dx,offset tab, tab array, Get tab offset address, this is the first address



SEG


Get segment Address
MOV dx,seg INSTR; here INSTR to interrupt the program, get the segment address of the interrupt program



Lea




Writes a near-address pointer to the specified register. Format: LEA REG16,MEM16 where reg16 must be a 16-bit general-purpose register, MEM16 must be a memory, and after executing this instruction, the 16-bit offset address referred to by MEM16 is transmitted reg16. For example, the LEA ax,buf is the transfer of the address referred to by BUF in memory to Microsoft Dynamics AX.
Difference mov transmission instructions:mov transmits the content that the address refers to, and the LEA is only the address.





about several common DOS calls:



dos call first mov into Ah, that is, the first deposit to execute the command, and then int 21H to execute the command
mov ah,4ch exit program
eg; mov ah,4chint 21h
mov ah,25hWrite Interrupt
mov ah,35hRead Interrupt
mov ah,02hwrite DL; commonly used in CRT


assembly language in the microcomputer interface

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.