  gASM 
gASM -          gainOS.  gASM    assembler,      .   ,       .

    :
====================
1.| MODE #APPLICATION TYPE#
2.| $APP
3.| Start:
4.| hlt
====================
 1     .   3 :
	Console -  .      (Terminal) ,    
	Window  -  .       (Descktop) ,      
	Deamon  -     .      (Terminal),     (Desctop) .        
    .       ,    
====================
1.| #code parameter
====================
:
	# -  ,      
	code -  .     
	parameter -     ( )
   
	include -   ,      .     ,      .       "headers" . : #include winapi.h
 ,         $APP,    ,     .     ,     hlt

  !  gASM
      .    . :
=====================
1.| LabelName:
=====================
    .       Start,     , ..         .
        
=====================
1.| code par1, par2, ...
=====================
:
	code -   (   )
	par1, par2, ... -    .      
	
     2  #  $.  (#) -          ,  ($) -    .       ,       .      
=====================
1.| ...
2.| mov #myVar, $5
3.| ...
=====================
     #myVar        5.        .
   @     ,   .     :
=====================
1.| ...
2.| db a1,0,0
3.| db a2,0,2
4.| db a3,0,15
5.| mov #r0, @a1 ;   a1   
6.| add $r0, 5 ; add #a1, 5
7.| inc #r0
8.| add $r0, @a2 ; add #a2, @a2
9.| ...
=====================
     ,  ,     ,        ,      .        ,   2    .     .        1  0,  1 -  , 0 - .         1, 2, 3,  4  5   :
1) 10011111111 - ,    2   
2) 00111101101 -   
3) 11111111111 - , ..    
4) 01110011111 -  , ..     ,      a1  a2
5) 01010111101 -  , ..   
    gAsm        mg, mf (    ).
  ,   ,       ,   
   .    ,    -  ( ).     15 .        rN,  N -   ,      [0,14]
  gAsm  .     ;      . 
=====================
1.| ...
2.| ;This is comment
3.| mov #r0, $1 ;This is comment too
4.| mov #r1, "my ;This is comment too string"
5.|
=====================
    ,  ;   .   1     : my, ..    

	! 
   
	mov a1, a2 		-      a1,    a2   a2,    .        ,  @varName. !!!:       
	db a1, a2, a3 	-         a1,  a2 {0 - integer; 1 - real; 2 - string}     a3 ( ,    )
	uns a1			-       a1
	gm a1, a2, a3	-  a3  ,  a2 {0 - integer; 1 - real; 2 - string}      a1
	fm a1, a2		-   -   c   a1   a2
							:
							=====================
							1.| gm "my_array", 0, 10		; 10   Integer
							2.| db "my_array5", @my_array	;   1  
							3.| add #my_array5, 4			;  5 
							4.| mov $my_array5, #r0			;  5     
							5.| ...
							N | fm @my_array, 10			; 
							=====================
	call a1			-     a1 (   )
	jmp a1			-      -  \.          ^LabelName.    N     ,  N     . !!!:  a1   ,    .
							:
							=====================
							1.| jmp ^Start	;   
							2.| jmp 5		;  5  
							3.| jmp -3		;  3  
							=====================
	cmp a1, a2		-  2      a1  a2.       a1 a2.     0,     jnz.      jz. ( )
	jz a1			-  jmp,      ,  cmp  0
	jnz a1 			-  jmp,      ,  cmp     0
	jnp				-  jmp,      ,  cmp      [< 0]
	jp				-  jmp,      ,  cmp    [>= 0]
	goto a1 		-  jmp,        .   ret
	ret 			-      ,    .       .
							:
							=====================
							1.| MyFunction:
							2.| mov #r0, #r1 ;  
							3.| call debug
							4.| ret ;   
							5.| Start:
							6.| mov #r1, "Hello"
							7.| goto ^MyFunction
							=====================
	hlt				-   
	{          a1.       string}
	sub a1, a2		- a1 - a2
	add a1, a2		- a1 + a2
	div a1, a2		- a1 / a2 !!!:    a1    real
	idiv a1, a2		- a1 div a2 !!!:    a1  a2    integer
	mul a1, a2		- a1 * a2
	dec a1			- a1 - 1 !!!:    a1    integer
	inc a1			- a1 + 1 !!!:    a1    integer
	and a1, a2		- a1 and a2 !!!:    a1  a2    integer
	or a1, a2		- a1 or a2 !!!:    a1  a2    integer
	shl a1, a2		- a1 shl a2 (  )  !!!:    a1  a2    integer
	shr a1, a2		- a1 shr a2 (  ) !!!:    a1  a2    integer
	not a1			- not a1 !!!:    a1    integer
	neg a1			-       a1

	! 
     call .          .      
	      :
		write 			-   (r0)       
		writeln			-   (r0)       
		read			-   (r1)     (r0)     
		readln			-   (r1)     (r0)     
		clrscr			-   
	   (    ):
		fileexists		-      (r0).  (r1) 1 - ; 0 - 
		getdirlist		-  (r1)     (r0),   |
		getfilelist 	-  getdirlist,   
		getdisklist 	-  (r0)  ,   |
		sleep			-  (r0) 
		strpos			-  (r2)   (r1)   (r0).  Pos  MP
		strcop			-     r1  r2   r0     r3.  Copy  MP
		strdel			-  strcop,       
		strcmp			-  2  r0  r1,  (r2) 1 -    0 -  
		concat			-  2  r0  r1    r2
		cos				-  r0     r1
		sin				-  r0     r1
	{   0.2}
		FileOpen		-     r0   (r1) ID    -1   
		FileClose		-    ID   r0
		FileSeek		-      r1    ID   r0
		FileReset		-     0     ID r0
		FileFlush		-        ID r0
		FileWriteByte	-     c ID r0  r1
		FileWrite		-      ID r0 ,   r1
		FileRead		-   r2 r1 -     ID r0
		FileReadByte	-   r1      ID r0
		FileReadString	-     0A  r1    ID r0
		FileEOF			-   r1     ID r0 1 - 
	{   0.4}
		ScanKeyPress	-      ( GetKeyPressed  MP).     r0:
								0..9	-   0  9
								10		- 
								11		- 
								-1		-     

								
=======================================================================================
=																					  =
=																					  =
=				AGL - API      gainOS							  =
=									adding in version 0.5							  =
=																					  =
=======================================================================================
	 barsunduk    "imgs"
	
 AGL - Advanced Graphic Library
	   gASM,       
	        (MODE CONSOLE),     (MODE WINDOW)
	
 ! 
	AGL   ,    .       1  .     ,   .     2 . 1  -   ( ), 2  -  ( ).  ,     ,       .        ,      2 ,   .  ,        ,     .      2 :   .        ,               (Desctop) .
 !     AGL
	AGL_Init			-   
							 :
								r0 - hwnd,    (0,     )
								r1 - offsetX,      X (0  )
								r2 - offsetY,      Y (0  )
								r3 - swidth,  
								r4 - sheight,  
								r5 - isfullscreen,   (1 - , 0 - ).    
							 
								r6 -  
	AGL_ClearContext	-   
							 :
								r0 -  
	AGL_GetColor		-    ARGB 
							 :
								r0 - alpha
								r1 - red
								r2 - green
								r3 - blue
							 :
								r4 -  
	AGL_SetColor		-  
							 :
								r0 - ,   AGL_GetColor
							 :
								r1 -  
	AGL_Render2D		-  
							 :
								r0 -  
								r1 - 
								r2 - ,   |
							 :
								r3 -  
	AGL_Present			-     
							 :
								r0 -  
	AGL_Reset			-   
							 :
								r0 -  
	
 ! 
	E_OK                = 0 -  
	E_INIT_ISINIT       = 1 -  
	E_INIT_NOINIT       = 2 -   
	E_INIT_NOTFULL      = 3 -     ,     
	E_REND_NOCLASS      = 4 -    
	E_REND_NOMETHOD     = 5 -     
	E_REND_NOTARG       = 6 -   

 !    Render2D
	Rect
		Draw -  
			x|y|width|height
		Fill -  
			x|y|width|height
	Ellipse
		Draw -  
			x|y|width|height
		Fill -  
			x|y|width|height
	Line
		Draw -  
			x1|y1|x2|y2
		Arc -  
			x|y|width|height|a1|a2
		Bow -    3 
			x1|y1|x2|y2|x3|y3
		Bezier -   
			x1|y1|x2|y2|x3|y3								
			
	
	
=======================================================================================
=																					  =
=																					  =
=				WinAPI - API     Desctop  gainOS 					  =
=									adding in version 0.5							  =
=																					  =
=======================================================================================
	 YellowAfterLife    "yalj"    .

 WinApi -     gASM,        

 ! :
	CreateWindow	-  .  . :
								ClassName (r0)	-   
								Name (r1) 		-  
								Left (r2)		-    
								Top (r3)		-    
								Width (r4)		-  
								Height (r5)		-  
								Parent (r6)		-   .           0
								lpParam (r7)	-    
					 r8     .
					:
						ClassName -     UI .
						      ,    lpParam.
						        
						lpParam -  ,       .  "param1=value1&param2=value2"	
	SetWindowData	-   
								HWND (r0) 		-   
								dType (r1)		-   ("text" - , "int" - , "flag" -  (1\0), "byte" - )
								dataID (r2)		- ID   
								data (r3)		- 
	ShowWindow		-    
								Handle (r0) 	-   
								Show (r1)		-     (0 - , 1 - )
	GetMessage		-   
								Code (r0)		-  . (    )
								iParam (r1)		-    (int)
								lParam (r2)		-    (int)
								sParam (r3)		-    (str)
	CallMethod		-   .  r4  ,   .
								ClassName (r0)	-  ,   
								MethodName (r1) -  
								Handle (r2)		-   
								Data (r3)		-     .   |
	DestroyWindow	-    ,    r0.      
						
 !:
	WM_DOWN (7)		-      . iParam -      ( Sender)
	WM_UP (8)		-     . iParam - Sender
	WM_CLOSE (11)	-    . iParam - Sendre
	WM_SUSPEND (12) -    . iParam - Sender, lParam -   
	WM_DESTROY (14) -    . iParam - Sender
	WM_CREATE (15) 	-     . iParam - Sender
	WM_CLICK (16) 	-     . iParam - Sender
						
 ! :
	TForm			-  ,       .  2      .
					. :	caption -   
					ID 
						11 - caption: str
						13 - isDrawIcon: flag ;    
	TLabel			-  .    .
					. :	caption - 
					ID 
						11 - caption: str						
	TCheckBox		-  .
					. : caption -   
									checked -    (0 - , 1 - )
					ID 
						11 - caption: str
						12 - cheked: flag
	TRadioButton	-  TCheckBox,      TRadioButton    
					. : . TCheckBox
					ID 
						. TCheckBox
	TScrollBar		-  
					. :	min -  
									max -  
									value -      
									orientation -   (1 - , 0 - )
					ID 
						11 - min position: int
						12 - max position: int
						13 - position: int
						14 - orientation: flag ; 1 -  \ 0 - 
	TListBox		- .     TScrollBar   
					. : 
					 :
						Clear			-  . Data:  
						AddItem			-     . Data: {text -  ;}
						GetIndexItem	-  id  . Data:  
						GetItemText 	-      id. Data: {id -  }
					ID 
						13 - index item: int ;  
						15 - item count: int ; - 
	TEdit			-    
					. : text -  
					ID 
						11 - text: int ;  
	TPanel			-       .       TRadioButton
					. : 
					ID 
						11 - backcolor: int
						12 - border color: int
						13 - is draw border: flag
	TButton			- 
					. : caption -   
									color -  
									align -   (0 - left, 1 - center, 2 - rigth)
					ID 
						11 - caption: str
						12 - border color: int
						13 - back color: int
						15 - text align: int ; 0 - left, 1 - center, 2 - rigth
	TItem			-   .    TListBox  TPopupMenu
					 :
						GetText			-   
	
	
	
	


