Last active
December 22, 2015 01:59
-
-
Save mikesmullin/6400075 to your computer and use it in GitHub Desktop.
moar_fun_language_experimentation
This file contains hidden or 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
#include <GL/glfw.h> | |
#include <iostream> | |
#define GLFW_INCLUDE_GLU | |
using namespace std; | |
int main() | |
{ | |
int running = GL_TRUE; | |
glfwInit(); | |
if( !glfwOpenWindow( 640,480, 0,0,0,0,0,0, GLFW_WINDOW ) ) | |
{ | |
glfwTerminate(); | |
return 0; | |
} | |
while( running ) | |
{ | |
//GL Code here | |
glLoadIdentity(); | |
glClearColor(0.0, 0.0, 0.0, 0.0); | |
glClearDepth(1.0); | |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | |
glColor3f(1.0, 1.0, 1.0); | |
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); | |
glBegin(GL_POLYGON); | |
glVertex3f(0.25, 0.25, 0.0); | |
glVertex3f(0.75, 0.25, 0.0); | |
glVertex3f(0.75, 0.75, 0.0); | |
glVertex3f(0.25, 0.75, 0.0); | |
glEnd(); | |
glFlush(); | |
glfwSwapBuffers(); | |
// Check if ESC key was pressed or window was closed | |
running = !glfwGetKey( GLFW_KEY_ESC ) && | |
glfwGetWindowParam( GLFW_OPENED ); | |
} | |
glfwTerminate(); | |
return 0; | |
} | |
This file contains hidden or 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
include GL/glfw.h | |
include iostream | |
define GLFW_INCLUDE_GLU | |
_start: | |
def int running setLiteral GL_TRUE | |
call glfwInit | |
unless glfwOpenWindow 640, 480, 0, 0, 0, 0, 0, 0, GLFW_WINDOW | |
return call glfwTerminate | |
while running | |
call glLoadIdentity | |
call glClearColor 0, 0, 0, 0 | |
call glClearDepth 1 | |
call glClear GL_COLOR_BUFFER_BIT bitOr GL_DEPTH_BUFFER_BIT | |
call glColor3f 1, 1, 1 | |
call glOrtho 0, 1, 0, 1, -1, 1 | |
call glBegin GL_POLYGON | |
call glVertex3f .25, .25, 0 | |
call glVertex3f .75, .25, .0 | |
call glVertex3f .75, .75, 0 | |
call glVertex3f .25, .75, 0 | |
call glEnd | |
call glFlush | |
call glfwSwapBuffers | |
set running equalsLiteral not glfwGetKey(GLFW_KEY_ESC) trueIfBothTrueOrBothFalse glfwGetWindowParam GLFW_OPENED | |
call glfwTerminate | |
call process_exit 0 |
This file contains hidden or 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
include GL/glfw.h | |
include iostream | |
define GLFW_INCLUDE_GLU | |
_start: | |
def int running setLiteral GL_TRUE | |
jumpTo glfwInit | |
unless jumpToAndPassReturning glfwOpenWindow 640, 480, 0, 0, 0, 0, 0, 0, GLFW_WINDOW | |
return jumpToReturning glfwTerminate | |
while running | |
jumpTo glLoadIdentity | |
jumpToAndPass glClearColor 0, 0, 0, 0 | |
jumpToAndPass glClearDepth 1 | |
jumpToAndPass glClear GL_COLOR_BUFFER_BIT bitOr GL_DEPTH_BUFFER_BIT | |
jumpToAndPass glColor3f 1, 1, 1 | |
jumpToAndPass glOrtho 0, 1, 0, 1, -1, 1 | |
jumpToAndPass glBegin GL_POLYGON | |
jumpToAndPass glVertex3f .25, .25, 0 | |
jumpToAndPass glVertex3f .75, .25, .0 | |
jumpToAndPass glVertex3f .75, .75, 0 | |
jumpToAndPass glVertex3f .25, .75, 0 | |
jumpTo glEnd | |
jumpTo glFlush | |
jumpTo glfwSwapBuffers | |
set running equalsLiteral not glfwGetKey(GLFW_KEY_ESC) trueIfBothTrueOrBothFalse glfwGetWindowParam GLFW_OPENED | |
jumpTo glfwTerminate | |
jumpToAndPass process_exit 0 |
This file contains hidden or 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
push = decrementStackPointerAutoBitsAndCopyAutoBitsFrom | |
LocalStack = decrementStackPointerAutoBits | |
Stack = base pointer | |
pushLocalStack | |
unit32 = size of data 2^32 | |
use x86_64 | |
!!!ELF | |
#_start | |
pushLocalStack uint32 a 1 | |
jumpTo b | |
#b | |
jumpToAndPass c, 1, 2, "abc" | |
#c (uint32 a,b, string c) | |
jumpToAndPassReturning d, 1 | |
exit 0 | |
#d (unit32 a) | |
0x01 _start: | |
movq $0x000001, -4(%rbp) | |
call 0x04 | |
0x04 b: | |
; cmds to insert variables before stack and into appropriate registers by type | |
call 0x08 | |
0x08 c: | |
; cmds to insert variables before stack and into appropriate registers by type | |
call 0x0a | |
0x09: | |
; set args for exit | |
syscall | |
0x0a d: | |
ret | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://en.wikipedia.org/wiki/Parser
http://en.wikipedia.org/wiki/Lexical_analysis
https://github.com/LearnBoost/stylus/blob/master/lib/token.js
https://github.com/LearnBoost/stylus/blob/master/lib/lexer.js
https://github.com/LearnBoost/stylus/blob/master/lib/parser.js
http://gcc.gnu.org/svn.html
http://assembly.ynh.io/
http://en.wikipedia.org/wiki/BIOS_interrupt_call
http://en.wikipedia.org/wiki/Boot_sector
https://github.com/ReturnInfinity/Pure64/blob/master/src/bootsectors/bmfs_mbr.asm
https://github.com/ReturnInfinity/Pure64/blob/master/src/pure64.asm
https://github.com/ReturnInfinity/BareMetal-OS/blob/master/os/kernel64.asm
http://stackoverflow.com/questions/980999/what-does-multicore-assembly-language-look-like
http://developer.intel.com/design/pentium/datashts/24201606.pdf
http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-3a-part-1-manual.pdf