注册 登录
编程论坛 汇编论坛

有没有大神用汇编语言帮忙写一个 奥运五环的代码 每个环有个颜色就行!!

li932975468 发布于 2015-12-23 19:48, 8206 次点击
谢谢啦  急用!!!!!!
8 回复
#2
八画小子2015-12-23 20:01
这个需求太模糊了吧?
#3
li9329754682015-12-23 20:03
回复 2楼 八画小子
额     就是用asm 运行出一个奥运五环 的图形 就行   每个圆要有个颜色
#4
hu9jj2015-12-23 20:38
张嘴等食呢
#5
hjxlj2015-12-24 17:35
饭来张口?
#6
wmf20142015-12-25 09:11
用汇编画图相当复杂哦,Dos模式下要进入图形模式逐个画点,windows下要调用GDI API作图,有这方面经验的业余人士不多。
#7
yuanqun2015-12-28 00:35
用一张五环位图作资源,那不是也行嘛
#8
yuanqun2016-01-05 04:01
[attach]83037[/attach]
           
程序代码:
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
;
  程序名称:
;
  程序功能:
;
  程序作者:
;
  制作时间:
;
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        .386
        .model flat,stdcall
        option casemap:none
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;
Include 文件定义
;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include        \masm32\include\windows.inc
include        \masm32\include\gdi32.inc
includelib    \masm32\lib\gdi32.lib
include        \masm32\include\user32.inc
includelib    \masm32\lib\user32.lib
include        \masm32\include\kernel32.inc
includelib    \masm32\lib\kernel32.lib
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;
数据段
;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        .data?

hInstance    dd        ?
hWinMain    dd        ?

        .const

szClassName    db    'MyClass',0
szCaptionMain    db    'My first Window !',0
szText        db    'Win32 Assembly, Simple and powerful !',0
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;
代码段
;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        .code
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;
窗口过程
;
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_ProcWinMain    proc    uses ebx edi esi,hWnd,uMsg,wParam,lParam
        local    @stPs:PAINTSTRUCT
        local    @stRect:RECT
        local    @hDc

        mov    eax,uMsg
;*************************************************************
        .if    eax ==    WM_PAINT
            invoke    BeginPaint,hWnd,addr @stPs
            mov    @hDc,eax
            invoke CreatePen,PS_SOLID,10,16744576
            invoke SelectObject,@hDc,eax
            invoke GetStockObject,5
            invoke SelectObject,@hDc,eax
            invoke DeleteObject,eax
            invoke Ellipse,@hDc,100,100,200,200  

            invoke CreatePen,PS_SOLID,10,0
            invoke SelectObject,@hDc,eax
            invoke DeleteObject,eax
            invoke Ellipse,@hDc,210,100,310,200  

            invoke CreatePen,PS_SOLID,10,255
            invoke SelectObject,@hDc,eax
            invoke DeleteObject,eax
            invoke Ellipse,@hDc,320,100,420,200

 

            invoke CreatePen,PS_SOLID,10,65535
            invoke SelectObject,@hDc,eax
            invoke DeleteObject,eax
            invoke Ellipse,@hDc,150,150,250,250
            
            invoke CreatePen,PS_SOLID,10,65280
            invoke SelectObject,@hDc,eax
            invoke DeleteObject,eax
            invoke Ellipse,@hDc,270,160,370,250

            invoke    EndPaint,hWnd,addr @stPs
;*************************************************************
        .elseif    eax ==    WM_CLOSE
            invoke    DestroyWindow,hWinMain
            invoke    PostQuitMessage,NULL
;*************************************************************
        .else
            invoke    DefWindowProc,hWnd,uMsg,wParam,lParam
            ret
        .endif
;*************************************************************
        xor    eax,eax
        ret

_ProcWinMain    endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
_WinMain    proc
        local    @stWndClass:WNDCLASSEX
        local    @stMsg:MSG

        invoke    GetModuleHandle,NULL
        mov    hInstance,eax
        invoke    RtlZeroMemory,addr @stWndClass,sizeof @stWndClass
;************************************************************
;
注册窗口类
;
*************************************************************
        invoke    LoadCursor,0,IDC_ARROW
        mov    @stWndClass.hCursor,eax
        push    hInstance
        pop    @stWndClass.hInstance
        mov    @stWndClass.cbSize,sizeof WNDCLASSEX
        mov    @stWndClass.style,CS_HREDRAW or CS_VREDRAW
        mov    @stWndClass.lpfnWndProc,offset _ProcWinMain
        mov    @stWndClass.hbrBackground,COLOR_WINDOW + 1
        mov    @stWndClass.lpszClassName,offset szClassName
        invoke    RegisterClassEx,addr @stWndClass
;*************************************************************
;
建立并显示窗口
;
*************************************************************
        invoke    CreateWindowEx,WS_EX_CLIENTEDGE,offset szClassName,offset szCaptionMain,\
            WS_OVERLAPPEDWINDOW,\
            100,100,600,400,\
            NULL,NULL,hInstance,NULL
        mov    hWinMain,eax
        invoke    ShowWindow,hWinMain,SW_SHOWNORMAL
        invoke    UpdateWindow,hWinMain
;*************************************************************
;
消息循环
;
*************************************************************
        .while    TRUE
            invoke    GetMessage,addr @stMsg,NULL,0,0
            .break    .if eax    == 0
            invoke    TranslateMessage,addr @stMsg
            invoke    DispatchMessage,addr @stMsg
        .endw
        ret

_WinMain    endp
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
start:
        call    _WinMain
        invoke    ExitProcess,NULL
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        end    start


[此贴子已经被作者于2016-1-5 04:05编辑过]

#9
yuanqun2016-01-05 20:46
只有本站会员才能查看附件,请 登录
1