⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 3-9.asm

📁 华工电信系汇编习题的编程实现
💻 ASM
字号:
stack segment stack 'stack'
      dw 32 dup(?)
stack ends

data segment 
    input DB 'please input N:$'
    N     DB 3,0,3 dup(?)
    table DB '    0$    1$    8$   27$   64$'        
    DB '  125$  216$  343$  512$  729$ 1000$'
    DB ' 1331$ 1728$ 2197$ 2744$ 3375$ 4096$'
    DB ' 4913$ 5832$ 6859$ 8000$ 9261$' 
    DB '10648$12167$13824$15625$17576$19683$2195'
    DB '2$24389$27000$29791$32768$'
    DB '35937$39304$42875$46656$50653$54872$5931'
    DB '9$64000$' 
    
data ends

code segment 
begin proc far
      assume ss:stack,cs:code,ds:data
      push ds
      sub ax,ax
      push ax
      mov ax,data
      mov ds,ax

      mov dx,offset N
      mov ah,10
      int 21H
      
      mov al,N[2]
      sub al,30H
      mov cl,N[1]
      CMP cl,1
      JNZ TWO
      JMP NEXT      
TWO:
      mov dl,10
      mov ah,0
      mul dl
      mov cl,N[3]
      sub cl,30H
      add al,cl
NEXT:
      mov ah,0
      mov dh,0
      mov dl,6
      mul dl
      mov dx,offset table
      add dx,ax
      mov ah,9
      int 21h
            

      ret
                                 ;right
begin   endp
code    ends
      end begin

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -