三九宝宝网宝宝教育教学论文

减乘除阶乘平方立方平方根系统的的汇编程序!

12月27日 编辑 39baobao.com

[对数的加减乘除运算规则]对数的加减乘除运算规则: 1、a^(log(a)(b))=b 2、log(a)(a^b)=b 3、log(a)(MN)=log(a)(M)+log(a)(N); 4、log(a)(M÷N)=log(a)(M)-log(a)(N); 5、log(a)(M^n)=nlog(a)(M) 6、...+阅读

你的问题也太多了吧,我这个学期学习微机原理,编了进制之间的转换程序,现在给你参考下吧,不过我想其他的程序你应该参考书来做一下,试试一定可以的!;Binary to Hex;二进制向十六进制转换 data segment t1 db 10 dup(?) data ends stack segment t2 db 10 dup(?) stack ends code segment assume cs:code,ss:stack,ds:data main proc start:mov ax,stack mov ss,ax mov ax,data mov ds,ax mov al,10011111b mov bl,al mov dl,al mov cl,4 ror dl,cl and dl,0fh cmp dl ,10 jnl change back:add dl,30h mov ah,2 int 21h mov al,bl mov dl,al and dl,0fh cmp dl,10 jnl change2 back2:add dl,30h mov ah,2 int 21h mov ah,4ch int 21h change:add dl,7 jmp back change2:add dl,7 jmp back2 main endp code ends end start;十进制向二进制转换;chang Decimall to binary;the number is put in ax data segment t1 db 100 dup(?) data ends stack segment t2 db 100 dup(?) top label byte stack ends code segment assume cs:code,ss:stack,ds:data main proc start:mov ax,stack mov ss,ax mov ax,data mov ds,ax mov ax,12 mov bx,2 mov cx,0 decloop:xor dx,dx div bx ;(dx=reminder,ax=quotient) inc cx push dx cmp ax,0 jnz decloop poploop:pop dx add dl,30h mov ah,2 int 21h dec cx jnz poploop mov ah,4ch int 21h main endp code ends end start;十进制向十六进制转换; change decimal to hex;the number is put in ax data segment t1 db 100 dup(?) data ends stack segment t2 db 100 dup(?) top label byte stack ends code segment assume cs:code,ss:stack,ds:data main proc start:mov ax,stack mov ss,ax mov ax,data mov ds,ax mov ax,3456 mov cx,0 mov bx,16 decloop:xor dx,dx div bx ;(dx=reminder,ax=quotient) cmp dx,10 jnl change push dx putto:inc cx cmp ax,0 jnz decloop poploop:pop dx add dl,30h mov ah,2 int 21h dec cx jnz poploop mov ah,4ch int 21h change:add dx,7 push dx jmp putto main endp code ends end start;十六进制向十进制转化;chang H to D;the number is put in ax data segment t1 db 100 dup(?) data ends stack segment t2 db 100 dup(?) top label byte stack ends code segment assume cs:code,ss:stack,ds:data main proc start:mov ax,stack mov ss,ax mov ax,data mov ds,ax mov ax,1234h xor cx,cx mov bx,10 decloop:xor dx,dx div bx ;(dx=reminder,ax=quotient) inc cx push dx cmp ax,0 jnz decloop;output poploop:pop dx add dl,'0' mov ah,2 int 21h dec cx jnz poploop;return to dos mov ah,4ch int 21h main endp code ends end start

以下为关联文档:

用汇编编写5的阶乘的程序;汇编语言实现计算SUM=5! DATAS SEGMENT ;此处输入数据段代码 NUM DW 5 ;最高阶数 SUN DW 0 ;计算结果 DATAS ENDS STACKS SEGMENT ;此处输入堆栈段代码 STACKS ENDS CODES SEGME...

推荐阅读
图文推荐