zoukankan      html  css  js  c++  java
  • 7.更灵活的定位内存地址的方法

    1.and指令:逻辑指令,按位进行与运算。与1不变,与0变0,可将对象相应位设为0.
    2.or指令:逻辑指令,按为进行或运算。或1变1,或0变0,可将对象位设为1.
    3.[BX+idata]的几种表现形式:
    (1)mov ax,[200+bx]
    (2)mov ax,200[bx]
    (3)mov ax,[bx].200
    4.[BX+idata]的数组处理案例
    assume CS:codesg,DS:datasg

    datasg SEGMENT
        DB 'BaSiC'
        DB 'MinIX'
    datasg ENDS

    codesg SEGMENT
      start:MOV AX,datasg
                  MOV DS,AX
                  MOV BX,0

                  MOV CX,5
          s:    MOV AL,0[BX]
                  AND AL,11011111b
                  MOV AL,5[BX]
                  OR  AL,00100000b
                  MOV 5[BX],AL
                  INC BX
                  LOOP s
    codesg ENDS
    END start
    5.SI和DI是8086CPU中和Bx功能相似的寄存器,只是不能分成两个8位的寄存器来用。
    6.[BX+SI]进行内存地址定位的几种形式:
    (1)mov ax,[bx][si]
    (2)mov ax,[bx+si]
    7.[BX+SI+idata]进行内存地址定位的几种形式:
    (1)mov ax,[bx+200+si]
    (2)mov ax,[200+bx+si]
    (3)mov ax,200[bx][si]
    (4)mov ax,[bx].200[si]
    (5)mov ax,[bx][si].200
    8.一般来说,需要暂存数据,我们都应该使用栈。
    9.使用栈暂存数据的案例
    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
  • 相关阅读:
    .net framework 3.5 dotNetFx35setup 能不需要网络支持吗? 
    Android API Differences Report
    Android用户版本分布更新 2.1版领先
    Adobe升级Flash回击批评:流畅播放手机视频
    iPhone OS4.0,Android 2.1和WP7对比分析
    Android 2.2数据共享功能开启与否将由运营商自主决定
    谷歌 Android 3.0计划四季度推出:代号姜饼
    谷歌称Android设备日激活量已达10万台
    iPod Touch也将支持运行Android系统
    Android2.2 SDK正式提供下载
  • 原文地址:https://www.cnblogs.com/zxj159/p/2811392.html
Copyright © 2011-2022 走看看