更靈活的定位記憶體位址的方法(學習彙編)

來源:互聯網
上載者:User

標籤:des   使用   資料   art   ar   div   學習   ad   

1.and指令:邏輯與指令,按位進行與運算。與1不變,與0變0,可將對象相應位設為0。 2.or指令:邏輯或指令,按為進行或運算。或1變1,或0變0,可將對象位設為1。 3.[BX+idata]的幾種表現形式:mov ax,[200+bx]mov ax,200[bx]mov ax,[bx].200 4.SI和DI是8086CPU中和Bx功能相似的寄存器,只是不能分成兩個8位的寄存器來用。 5.[BX+SI]進行記憶體位址定位的幾種形式:mov ax,[bx][si]mov ax,[bx+si] 6.[BX+SI+idata]進行記憶體位址定位的幾種形式: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.一般來說,需要暫存資料,我們都應該使用棧。也可以考慮將需要暫存的資料放到記憶體單元中。 8.使用棧暫存資料的案例: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,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 21h
codesg ends 
end start

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.