This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REBOL [ | |
Title: "Red/System ELF format emitter" | |
Author: "Nenad Rakocevic" | |
File: %ELF.r | |
Rights: "Copyright (C) 2011 Nenad Rakocevic. All rights reserved." | |
License: "BSD-3 - https://github.com/dockimbel/Red/blob/master/BSD-3-License.txt" | |
] | |
context [ | |
defs: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REBOL [ | |
Title: "Red/System ELF format emitter" | |
Author: "Andreas Bolka, Nenad Rakocevic" | |
File: %ELF.r | |
Rights: "Copyright (C) 2011 Andreas Bolka, Nenad Rakocevic. All rights reserved." | |
License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt" | |
] | |
context [ | |
defs: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red/System [] | |
#import [ | |
"msvcrt.dll" cdecl [ ; Windows | |
calloc: "calloc" [ ; Allocate zero-filled memory. | |
chunks [integer!] | |
size [integer!] | |
return: [c-string!] | |
] | |
memcpy: "memcpy" [ ; Copy memory range. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
overlong: charset "^(C0)^(C1)" | |
invalid-bytes: union overlong charset [#"^(F5)" - #"^(FF)"] | |
cont-byte: charset [#"^(80)" - #"^(BF)"] | |
one-byte-codepoint: charset [#"^(00)" - #"^(7F)"] | |
two-bytes-codepoint: reduce [ | |
charset [#"^(C2)" - #"^(DF)"] | |
cont-byte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red/System [ | |
Title: "Lazy Sunday Afternoon Browser" | |
Author: "Kaj de Vos" | |
] | |
#include %GTK-WebKit.reds | |
home: "http://www.red-lang.org/" | |
address: function [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red/System [] | |
#import [ | |
"libc.so.6" cdecl [ | |
quit: "exit" [ | |
status [integer!] | |
] | |
] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Division routine | |
93c4: e3510000 cmp r1, #0 | |
93c8: 0a000014 beq 0x9420 | |
93cc: e1b02001 movs r2, r1 ; r2: divisor | |
93d0: e212c102 ands ip, r2, #-2147483648 ; 0x80000000 | |
93d4: 40225fc2 eormi r5, r2, r2, asr #31 | |
93d8: 40452fc2 submi r2, r5, r2, asr #31 | |
93dc: e1b01000 movs r1, r0 ; r1: dividend | |
93e0: e03cc041 eors ip, ip, r1, asr #32 | |
93e4: 40215fc1 eormi r5, r1, r1, asr #31 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red/System [] | |
#import [ | |
LIBC-file cdecl [ | |
sin: "sin" [ | |
x [float!] | |
return: [float!] | |
] | |
] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red/System [] | |
int64!: alias struct! [high [integer!] low [integer!]] | |
sub64: func [ | |
a [int64!] | |
b [int64!] | |
return: [int64!] | |
/local | |
diff [int64!] offset [integer!] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red/System [ | |
Title: "Float32! to integer! conversion routine" | |
Author: "Nenad Rakocevic" | |
Rights: "Copyright (C) 2011 Nenad Rakocevic. All rights reserved." | |
License: "BSD-3 - https://github.com/dockimbel/Red/blob/origin/BSD-3-License.txt" | |
Note: "Thanks to François Jouen for providing me the C code for ftoi()" | |
] | |
float-to-integer: func [ | |
f [float32!] ;-- float 32-bit value to convert |
OlderNewer