More flexible method for locating memory addresses (learning Assembly)

Source: Internet
Author: User
1. and command: logic and command, bitwise, and operation. And 1 unchanged, and 0 changed to 0, the corresponding bit of the object can be set to 0. 2. Or command: logic or command, or operation. Or 1 to 1, or 0 to 0, you can set the object bit to 1. 3. several manifestations of [bx + idata]: mov ax, [200 + BX] mov ax, 200 [BX] mov ax, [BX]. 200 4. si and Di are registers with similar functions in 8086cpu and BX, but they cannot be used in two octal registers. 5. [bx + Si] memory address locating methods: mov ax, [BX] [Si] mov ax, [bx + Si] 6. [bx + Si + idata] memory address location methods: mov ax, [bx + 200 + Si] mov ax, [200 + bx + Si] mov ax, 200 [BX] [Si] mov ax, [BX]. 200 [Si] mov ax, [BX] [Si]. 200 7. generally, we should use stacks to store temporary data. You can also consider placing the data to be saved to the memory unit. 8. Use the stack to temporarily store data: Assume Cs: codesg, DS: datasg

Datasg segment
DB 'ibm'
DB 'dec'
DB 'dso'
DB 'vax'
Datasg ends

Stacksg segment
DW 0, 0, 0, 0, 0, 0
Stacksg ends

Codesg segment
Start: mov ax, datasg
MoV ds, ax
MoV dx, stacksg
MoV SS, DX
MoV sp, 16
MoV BX, 0
MoV CX, 4
S0: Push CX
MoV Si, 0
MoV CX, 3
S: mov Al, [bx + Si]
And ax, 11011110b
MoV [bx + Si], Al
INC Si
Loop s
Add Bx, 16
Pop CX
INC BX
Loop S0
MoV ax, 4c00h
Int 21 h
Codesg ends
End start

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.