當前位置:編程學習大全網 - 電腦編程 - 匯編語言程序 1加到10

匯編語言程序 1加到10

;匯編語言1加到10的程序

;顯示計算結果

code segment

assume cs:code,ds:code

org 100h

start:

mov ax,cs

mov ds,ax

mov dx,offset mes;顯示算式

mov ah,9

int 21h

xor ax, ax

mov cx, 0ah

next:add ax, cx; 求和

loop next

aam ;二化十

add ax,3030h;轉為ASCII

xchg ah,al

mov dx,ax;送入DX待顯示

mov ah,2

int 21h;顯示高位

mov dl,dh

int 21h;顯示低位

mov ah,1

int 21h;暫停

mov ax, 4c00h

int 21h ;結束

mes db '1+2+3+...+10=$'

code ends

end start

  • 上一篇:義烏商貿城裏有賣聯想充電器嗎
  • 下一篇:匯編語言程序分析
  • copyright 2024編程學習大全網