• [汇编] 2数相加极简单版


    >_<:低位相加:

     1 ; multi-segment executable file template.
     2 
     3 data segment
     4     datax   dw      0148H,2316H
     5     datay   dw      0237H,4052H  
     6 ends
     7 
     8 stack segment
     9     dw   128  dup(0)
    10 ends
    11 
    12 code segment
    13 start:
    14 ; set segment registers: 
    15     mov ax,data
    16     mov ds,ax
    17     mov es,ax
    18     
    19     ; add your code here
    20     mov ax, datax
    21     add datay, ax     
    22     ; wait for any key....  
    23     mov dl, 03H
    24     mov ah, 2
    25     int 21h  
    26       
    27     mov dl, 7FH
    28     mov ah, 2
    29     int 21h   
    30     mov ah, 1
    31     int 21h
    32     
    33     mov ax, 4c00h ; exit to operating system.
    34     int 21h    
    35 ends
    36 
    37 end start ; set entry point and stop the assembler.

    >_<:带进位2位相加

    ; multi-segment executable file template.
    
    data segment
        datax   dw      0148H,2316H
        datay   dw      0237H,4052H  
    ends
    
    stack segment
        dw   128  dup(0)
    ends
    
    code segment
    start:
    ; set segment registers: 
        mov ax,data
        mov ds,ax
        mov es,ax
        
        ; add your code here
        mov ax, datax
        add datay, ax    
        mov ax,datax+2 
        adc datay+2,ax 
        ; wait for any key....  
        mov dl, 03H
        mov ah, 2
        int 21h  
          
        mov dl, 7FH
        mov ah, 2
        int 21h   
        mov ah, 1
        int 21h
        
        mov ax, 4c00h ; exit to operating system.
        int 21h    
    ends
    
    end start ; set entry point and stop the assembler.
  • 相关阅读:
    关于使用READ TABLE语句
    excel中CTRL+E的用法
    SAP查找用户的登录记录及修改记录
    PI接口开发之调java WS接口(转)
    ALV-TREE -转
    LOOP AT GROUP语法熟悉
    SAP库龄表(转)
    SAP RANG语法
    数据对象与数据类型
    Nginx 安装、配置及相关介绍
  • 原文地址:https://www.cnblogs.com/zjutlitao/p/3643010.html
Copyright © 2020-2023  润新知