Skip to content

Instantly share code, notes, and snippets.

@yanhaijing
Created April 12, 2013 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yanhaijing/5372577 to your computer and use it in GitHub Desktop.
Save yanhaijing/5372577 to your computer and use it in GitHub Desktop.
数制转
;颜海镜 2011.9.30
;3.17数制转换
.model small
.statck
.data
LEDtable db 0c0h,0f9h,0a4h,0b0h,99h,92h,82h,0f8h,80h,90h,88h,83h,0c6h,0c1h,86h,8eh
LEDnum db 01h,02h,03h,04h,05h,06h,07h,08h,09h,0ah,0bh,0ch,0dh,0eh,0fh
.code
start: mov ax,@data
mov ds,ax;初始化数据段基址
call inchr;输入字符
sub al,30h;讲输入的1转换为真值1
lea bx,LEDtable
mov dl,al
mov ax,4c00h;返回dos
int 21h
inchr pro;输入字符子程序
mov ah,01h
int 21h;调用输入字符中断,al中放输入字符
ret;返回
inchr endp
outchr pro;输出一个字符,输出字符位于dl
mov ah,02h
int 21h
ret
outchr endp
end start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment