汇编学习(1)

 

输入数字显示对应的月份

DATA  SEGMENT
PA1 DB 
'January',10,13,'$'
PA2 DB 
'February',10,13,'$' 
PA3 DB 
'March',10,13,'$'
PA4 DB 
'April',10,13,'$'
PA5 DB 
'May',10,13,'$'
PA6 DB 
'June',10,13,'$'
PA7 DB 
'July',10,13,'$'
PA8 DB 
'August',10,13,'$'
PA9 DB 
'September',10,13,'$'
PA10 DB 
'October',10,13,'$'
PA11 DB 
'November',10,13,'$'
PA12 DB 
'December',10,13,'$'

PRO DW 
?,PA1,PA2,PA3,PA4,PA5,PA6,PA7,PA8,PA9,PA10
    dw PA11,PA12
buff db 
3
     db 
0
     db 
3 dup(0)
ctrl     db  
10,13,'$'
DATA  ENDS
CODE  SEGMENT
ASSUME  CS:CODE, DS:DATA
        
start:
        MOV  AX,DATA
        MOV  DS,AX
       
    lea dx,buff
    mov ah,0ah
    
int 21h
    
    cmp buff[
1],2
    je shiwei
    sub buff[
2],30h
    mov bl,buff[
2]
    jmp done
    
shiwei:
    sub buff[
2],30h
    mov cl,
10
    mov al,buff[
2]
    mul cl
    sub buff[
3],30h
    add al,buff[
3]
    mov bl,al
    
done:    
        lea dx,ctrl
    mov ah,09h
    
int 21h
    mov bh,
0
    shl bx,
1
    mov dx,PRO[bx]
    mov ah,09h
    
int 21h 

mov ax,4c00h
int 21h

end start
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值