Click here to Skip to main content
15,881,882 members
Articles / High Performance Computing / Vectorization

Bird Programming Language: Part 1

Rate me:
Please Sign up or sign in to vote.
4.92/5 (129 votes)
1 Jan 2013GPL312 min read 373.1K   2.7K   153  
A new general purpose language that aims to be fast, high level and simple to use.
	format MS COFF
	extrn _brl_graphics_Graphics
	extrn _brl_graphics_Flip
	extrn _brl_polledinput_KeyHit
	extrn _brl_polledinput_MouseX
	extrn _brl_polledinput_MouseY
	extrn _brl_max2d_Cls
	extrn _brl_max2d_DrawRect
	extrn _brl_max2d_SetColor
	public _AsEntry
	
section "code" code readable executable

_AsEntry:
	push ebx
	push esi
	push edi
	push 0
	push 60
	push 0
	push 600
	push 800
	call _brl_graphics_Graphics
	add esp, 20
	push 27
	call _brl_polledinput_KeyHit
	add esp, 4
	cmp al, 0
	jne _3
_9:
	call _brl_max2d_Cls
	xor edi, edi
_12:
	xor esi, esi
_14:
	mov eax, edi
	imul eax, 110
	add eax, 10
	mov edx, esi
	imul edx, 110
	add edx, 10
	push 100
	mov ecx, 100
	call _Square
	inc esi
	cmp esi, 3
	jl _14
	inc edi
	cmp edi, 3
	jl _12
	push -1
	call _brl_graphics_Flip
	add esp, 4
	push 27
	call _brl_polledinput_KeyHit
	add esp, 4
	cmp al, 0
	je _9
_3:
	pop edi
	pop esi
	pop ebx
	ret

_Square:
	push esi
	push edi
	sub esp, 4
	mov ebx, eax
	mov esi, edx
	mov edi, ecx
	call _brl_polledinput_MouseX
	mov edx, ebx
	add edx, edi
	cmp edx, eax
	jl _21
	cmp ebx, eax
	jg _21
	call _brl_polledinput_MouseY
	mov edx, esi
	add edx, dword[esp + 16]
	cmp edx, eax
	jl _21
	cmp esi, eax
	jg _21
	push 255
	push 255
	push 255
	call _brl_max2d_SetColor
	add esp, 12
	jmp _19
_21:
	push 150
	push 150
	push 150
	call _brl_max2d_SetColor
	add esp, 12
_19:
	sub esp, 16
	fild dword[esp + 32]
	fstp dword[esp + 12]
	mov dword[esp + 16], edi
	fild dword[esp + 16]
	fstp dword[esp + 8]
	mov dword[esp + 16], esi
	fild dword[esp + 16]
	fstp dword[esp + 4]
	mov dword[esp + 16], ebx
	fild dword[esp + 16]
	fstp dword[esp]
	call _brl_max2d_DrawRect
	add esp, 16
	add esp, 4
	pop edi
	pop esi
	ret 4

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer
Hungary Hungary
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions