Click here to Skip to main content
12,623,744 members (28,109 online)
Click here to Skip to main content

Tagged as

Stats

243K views
2.5K downloads
154 bookmarked
Posted

Bird Programming Language: Part 1

, 1 Jan 2013 GPL3
A new general purpose language that aims to be fast, high level and simple to use.
Bird
Archives
crt2.o
crtbegin.o
crtend.o
libadvapi32.a
libcomctl32.a
libcomdlg32.a
libgcc.a
libgdi32.a
libglu32.a
libkernel32.a
libmingw32.a
libmingwex.a
libmoldname.a
libmsvcrt.a
libopengl32.a
libshell32.a
libstdc++.a
libuser32.a
libwinmm.a
libwsock32.a
Libraries
BirdCore
Array.bird
BigInteger.bird
BinaryRW.bird
BirdCore.a
BirdCore.blib
CategoryData.dat
Console.bird
Convert.bird
Debug.bird
Entry.bird
Environment.bird
Exception.bird
Float.bird
LEB128.bird
Math.bird
Memory.bird
Object.bird
Random.bird
Reflection.bird
StandardC.bird
Stream.bird
String.bird
ToLowerData.dat
ToUpperData.dat
Types.bird
ValueType.bird
Win32.bird
x86Helper.bird
BlitzMax
.bmx
Launcher.bmx.gui.release.win32.x86.o
appstub.release.win32.x86.a
bank.release.win32.x86.a
bankstream.release.win32.x86.a
blitz.release.win32.x86.a
BlitzMax.a
BlitzMax.bird
BlitzMax.blib
d3d7max2d.release.win32.x86.a
d3d9max2d.release.win32.x86.a
directx.release.win32.x86.a
dxgraphics.release.win32.x86.a
event.release.win32.x86.a
filesystem.release.win32.x86.a
font.release.win32.x86.a
glgraphics.release.win32.x86.a
glmax2d.release.win32.x86.a
graphics.release.win32.x86.a
hook.release.win32.x86.a
keycodes.release.win32.x86.a
Launcher.bmx
libpng.release.win32.x86.a
linkedlist.release.win32.x86.a
math.release.win32.x86.a
max2d.release.win32.x86.a
opengl.release.win32.x86.a
pixmap.release.win32.x86.a
pngloader.release.win32.x86.a
polledinput.release.win32.x86.a
standardio.release.win32.x86.a
stdc.release.win32.x86.a
stream.release.win32.x86.a
system.release.win32.x86.a
textstream.release.win32.x86.a
win32.release.win32.x86.a
zlib.release.win32.x86.a
PrgLinec.bmx
Samples
Circles
Circles.bird
CppMain.bird
Fire
Fire.bird
Higher Order Functions
C#
Higher Order Functions.v11.suo
Properties
Test.bird
msvcrt.lib
Reflection
Reflection.bird
Squares
Squares.bird
Template
Template.bird
Source
Base
Bird.v11.suo
Expressions
Identifiers
Languages
NativeCode
Properties
Recognizers
Expressions
Scopes
x86
Thumbs.db
crt2.o
crtbegin.o
crtend.o
libadvapi32.a
libcomctl32.a
libcomdlg32.a
libgcc.a
libgdi32.a
libglu32.a
libkernel32.a
libmingw32.a
libmingwex.a
libmoldname.a
libmsvcrt.a
libopengl32.a
libshell32.a
libstdc++.a
libuser32.a
libwinmm.a
libwsock32.a
Binaries
ar.exe
Bird.exe
fasm.exe
ld.exe
libiconv-2.dll
libintl-8.dll
Array.bird
BigInteger.bird
BinaryRW.bird
BirdCore.a
BirdCore.blib
CategoryData.dat
Console.bird
Convert.bird
Debug.bird
Entry.bird
Environment.bird
Exception.bird
Float.bird
LEB128.bird
Math.bird
Memory.bird
Object.bird
Random.bird
Reflection.bird
StandardC.bird
Stream.bird
String.bird
ToLowerData.dat
ToUpperData.dat
Types.bird
ValueType.bird
Win32.bird
x86Helper.bird
Launcher.bmx.gui.release.win32.x86.o
appstub.release.win32.x86.a
bank.release.win32.x86.a
bankstream.release.win32.x86.a
blitz.release.win32.x86.a
BlitzMax.a
BlitzMax.bird
BlitzMax.blib
d3d7max2d.release.win32.x86.a
d3d9max2d.release.win32.x86.a
directx.release.win32.x86.a
dxgraphics.release.win32.x86.a
event.release.win32.x86.a
filesystem.release.win32.x86.a
font.release.win32.x86.a
glgraphics.release.win32.x86.a
glmax2d.release.win32.x86.a
graphics.release.win32.x86.a
hook.release.win32.x86.a
keycodes.release.win32.x86.a
Launcher.bmx
libpng.release.win32.x86.a
linkedlist.release.win32.x86.a
math.release.win32.x86.a
max2d.release.win32.x86.a
opengl.release.win32.x86.a
pixmap.release.win32.x86.a
pngloader.release.win32.x86.a
polledinput.release.win32.x86.a
standardio.release.win32.x86.a
stdc.release.win32.x86.a
stream.release.win32.x86.a
system.release.win32.x86.a
textstream.release.win32.x86.a
win32.release.win32.x86.a
zlib.release.win32.x86.a
PrgLinec.bmx
PrgLinec.exe
Circles.bird
CppMain.bird
Fire.bird
Higher Order Functions.v11.suo
Test.bird
msvcrt.lib
Reflection.bird
Squares.bird
Template.bird
Bird.v11.suo
Thumbs.db
Examples
As.exe
AsLibs.a
PerfTest
Launcher.bmx
Squares
.bmx
Launcher.bmx
Template
Launcher.bmx
Anonymus 7_1
Anonymus.csproj.user
Anonymus.idc
Anonymus.pidb
Anonymus.suo
Anonymus.userprefs
Base
Expressions
Lib
Long
LongDivTest.bmx
ULongConv.bmx
Math
MISZ
AsLibs.a
PerfTest
Launcher.bmx
Squares
Launcher.bmx
Template
Launcher.bmx
PrgLinec.bmx
PrgLinec.exe
Properties
Scopes
Txt
Asm.docx
Code.docx
Lib.aslib
~$Code.docx
x86
	format MS COFF
	public _ULongToFloat		; ascall
	public _LongShiftLeft		; ascall + cl
	public _LongShiftRight		; ascall + cl
	public _ULongShiftRight		; ascall + cl
	public _LongMul			; ascall

section ".code" code readable executable

;------------------------------------------------
_LongShiftRight:
	cmp cl, 64
	jae _LongShiftRight_1
	cmp cl, 32
	jbe _LongShiftRight_2
	and cl, 31
	mov eax, edx
	sar edx, 31
	sar eax, cl
	ret
_LongShiftRight_2:
	shrd eax, edx, cl
	sar edx, cl
	ret
_LongShiftRight_1:
	sar edx, 31
	mov eax, edx
	ret
	
	
;------------------------------------------------
_ULongShiftRight:
	cmp cl, 64
	jae _ULongShiftRight_1
	cmp cl, 32
	jbe _ULongShiftRight_2
	and cl, 31
	mov eax, edx
	xor edx, edx
	shr eax, cl
	ret
_ULongShiftRight_2:
	shrd eax, edx, cl
	shr edx, cl
	ret
_ULongShiftRight_1:
	xor edx, edx
	xor eax, eax
	ret
	
	
;------------------------------------------------
_LongShiftLeft:
	cmp cl, 64
	jae _LongShiftLeft_1
	cmp cl, 32
	jbe _LongShiftLeft_2
	and cl, 31
	mov edx, eax
	xor eax, eax
	shl edx, cl
	ret
_LongShiftLeft_2:
	shld edx, eax, cl
	shl eax, cl
	ret
_LongShiftLeft_1:
	xor edx, edx
	xor eax, eax
	ret
	
;------------------------------------------------
_ULongToFloat:
	mov eax, dword[esp + 8]
	and dword[esp + 8], 0x7FFFFFFF
	fild qword[esp + 4]
	and eax, 0x80000000
	mov dword[esp + 4], 0
	mov dword[esp + 8], eax
	fild qword[esp + 4]
	fchs
	faddp
	ret 8
	
	
;------------------------------------------------
_LongMul:
	mov eax, dword[esp + 4]
	mov edx, dword[esp + 8]
	push dword[esp + 12]
	push dword[esp + 16]
	call _LongMul_AsCall
	ret 16

_LongMul_AsCall:
	mov ecx, edx
	or ecx, dword[esp + 8]
	jnz _LongMul_1
	mul dword[esp + 4]
	ret 8
_LongMul_1:
	mov dword[esp - 4], edx
	mul dword[esp + 4]
	mov dword[esp - 8], eax
	mov ecx, edx

	mov eax, dword[esp - 4]
	mul dword[esp + 8]
	mov edx, eax
	add edx, ecx
	mov eax, dword[esp - 8]
	ret 8
	
	

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)

Share

About the Author

Dávid Kocsis
Software Developer
Hungary Hungary
No Biography provided

You may also be interested in...

Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161128.1 | Last Updated 1 Jan 2013
Article Copyright 2011 by Dávid Kocsis
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid