Register | Login
Forum Index > Plugins > PlugIn Example in C
Author Message
Pages: 1 2 3 4 5 6 7 8 9 10 11
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[795] - posted: 2011-11-22 19:53:56

yes of course , it a Little lines that allows all ziron data type understood

here is a part that allow it
Code:
 // get DB or DW or DD or DQ or (data type)
      DWord dt = Ziron_GetNextToken(); 
      boolean  _db, _dw, _dd, _dq;        
      char* strTemp = strLower(Ziron_GetStringValue());
      _db = strCmp('db',strTemp);
      if (_db)
       {
            H_strcpy(@dtype,'byte ');     // found DB
       } 
      else
       {
           _dw = strCmp('dw',strTemp); //  
            if (_dw) 
             {
                  H_strcpy(@dtype,'word '); // found DW
             }
            else 
             {
                  _dd = strCmp('dd', strTemp);     
                  if (_dd) 
                   {
                        H_strcpy(@dtype,'DWord '); // found DD
                   } 
                  else 
                   {
                        _dq = strCmp('dq', strTemp);    
                        if (_dq) 
                         {
                              H_strcpy(@dtype,'qword '); // found DQ
                         }
                        else
                         {
                           if(dt == zirData_Type)  // found data type
                             {
                                H_strcpy(@dtype,Ziron_GetStringValue()); 
                                H_strcat(@dtype,' '); 
                             }
                            else
                             {          
                               // there is no DB or DW or DD or DQ or (data type) so fire error 
                               Ziron_FatalError('Expected DB or DW or DD or DQ symple');
                               return true;
                             }
                         }
                  }
            }
      }





http://www.freewebs.com/ogremagic/index.htm
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[796] - posted: 2011-11-22 19:58:38

this is not understood
Code:
svar  single  1.5


but this okay
Code:
svar  single  1


http://www.freewebs.com/ogremagic/index.htm
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[797] - posted: 2011-11-22 20:09:24

to make things going well i need ziron support that
Code:
single myVar = 1.5; 


this is already supported
Code:
byte b = 1;



http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[798] - posted: 2011-11-22 21:19:44
1 is detected as zirNumber

but

1.5 is deteceted as zirFloat smile

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[799] - posted: 2011-11-22 21:26:28

ok , i have already add the needed code but it does not work because ziron do not understand that
Code:
single svar = 1.5;


here is the part that understand float
Code:
case (eax) {
        // var DB 0x0f 
        state zirHEXADECIMAL:
          edx = indx; imul edx, stp; eax = @right; edx += eax;
          H_strcpy(edx,'0x');            
          H_strcat(edx,Ziron_GetStringValue());
          break; 
        // var Db 1  
        state zirNUMBER:
          edx = indx; imul edx, stp; eax = @right; edx += eax;            
          H_strcpy(edx,Ziron_GetStringValue());                 
          break;   
        // str  DB 'hello',0  
        state zirConstString:
              char str1[2048];
              H_strcpy(@str1,Ziron_GetStringValue());
              ecx = H_strlen(@str1);
              while(ecx > 0)
               {      
                 esi = @str1;
                 edx = indx; bl = [esi+edx]; imul edx, stp; eax = @right; edx += eax; 
                 char[edx] = ord('"');
                 char[edx+1] = bl;
                 char[edx+2] = ord('"');
                 char[edx+3] = 0;
                 indx++;
                 ecx--; 
               } 
               indx--;  
          break;
          state zirFLOAT:
              edx = indx; imul edx, stp; eax = @right; edx += eax;            
              H_strcpy(edx,Ziron_GetStringValue());         
              //Ziron_ShowMessage(Ziron_GetStringValue());
          break;     
        default:
          Ziron_FatalError('Expected number');
          return true;
      }


http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[800] - posted: 2011-11-22 22:12:22
you will need to do a mov var, 1.5

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 639
Topics: 104

Location:
Alex, Egypt
[801] - posted: 2011-11-22 22:41:00

i think that is good for single var so you can use mov instruction , but if you have an array
of floating type how could you initializing them.

is it hard to allow that 'single svar =1.5' just like integer types , or what.

http://www.freewebs.com/ogremagic/index.htm
Admin
Site Admin

avatar

(send private message)

Posts: 933
Topics: 55

Location:
OverHertz Studio
[802] - posted: 2011-11-22 23:07:56
no, but as i've said in a previous post, i need to rewrite some of the float handlers, so it is not worth to spend time on them when i will rewrite them.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1 2 3 4 5 6 7 8 9 10 11
create new reply


Quick reply:

Message:



Currently Active Users:
There are currently 2 user(s) online. 0 member(s) and 2 guest(s)
Most users ever online was 1046, January 28, 2022, 2:08 pm.


Statistics:
Threads: 225 | Posts: 1848 | Members: 51 | Active Members: 51
Welcome to our newest member, yecate
const Copyright = '2011-2024 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd