汇编输出前30个素数

[复制链接]
查看11 | 回复3 | 2013-6-15 16:14:46 | 显示全部楼层 |阅读模式
; 256以内的素数,显示输出前30个; 本程序通过编译,运行正确CodeSegment AssumeCS:Code,DS:Code; -------------------------------------; 判断素数; 入口参数:AL=256以内无符号整数; 返回参数:若AL是素数,进位标志置位;否则,清位EstimationProcNear pushsi
pushcx
pushax
lea si,PrimeLess
cmp al,1
jz
@@Not_Prime ;1不是素数
...
回复

使用道具 举报

千问 | 2013-6-15 16:14:46 | 显示全部楼层
code segment assume cs:codestart: mov cx,0 ;计数 mov ax,2 mov bx,2 next: cmp bx,ax jl continue inc cx call display cmp cx,30 jz exit jmp nextnum continue:...
回复

使用道具 举报

千问 | 2013-6-15 16:14:46 | 显示全部楼层
好高深啊,学习下了,做个标记不行吗大哥。。。pop dxadd dl,30hmov ah,2int 21h...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行