Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/overhertz/domains/codeziron.com/public_html/ziron/ziron.db.connector.php on line 13
code:zIRON - Get the latest releases plus source-codes and tutorials - Simplifed Assembly Programming Language.
Register | Login
Forum Index > Requests and Feedback > using structure member inside if
Author Message
Pages: 1
Emil_halim
Ziron Beta Tester

avatar

(send private message)

Posts: 638
Topics: 103

Location:
Alex, Egypt
[1242] using structure member inside if - posted: 2012-06-05 21:19:57

Hi Mr Colin.

i want ziron support this
Code:
#define  I386MAGIC      0x14c
#define I386AIXMAGIC   0x175

block filehdr
{
  word  f_magic;     /* magic number             */
  word  f_nscns;     /* number of sections       */
  dword f_timdat;    /* time & date stamp         */
  dword f_symptr;    /* file pointer to symtab   */
  dword f_nsyms;     /* number of symtab entries */
  word  f_opthdr;    /* sizeof(optional hdr)     */
  word  f_flags;     /* flags                    */
}

edi = @obj as filehdr;

if( (edi.f_magic!=I386MAGIC) and (edi.f_magic!=I386AIXMAGIC) )
{
  print('this is not obj file');
} 


also this wanted
Code:
  cmp word[edi.f_magic],I386MAGIC


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

avatar

(send private message)

Posts: 925
Topics: 54

Location:
OverHertz Studio
[1245] - posted: 2012-09-20 19:58:59
not sure i understand this request, could you explain? what is var obj also?

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
0CodErr
Ziron Guru
(send private message)

Posts: 197
Topics: 37

Location:
[1794] - posted: 2015-02-26 16:28:33
Maybe it was intended that it includes binary file into output file 'as is'? It would be useful i think smile

For example:
Code:
block FILEHDR {
 word  f_magic; 
 word  f_nscns; 
 dword f_timdat;
 dword f_symptr;
 dword f_nsyms; 
 word  f_opthdr;
 word  f_flags; 
}

FILEHDR MyFile = $incbin('myfile.obj'); 


Also it is possible to include not all file but only some part of it, like this:
Code:
FILEHDR MyFile = $incbin('myfile.obj', 0x100);        // includes data from file only from 0x100 offset 
FILEHDR MyFile = $incbin('myfile.obj', 0x100, 0x200); // includes 0x200 bytes from file from 0x100 offset 


For example we can directly include graphics by this way:
Code:
byte MyPicture[] = $incbin('mypicture.dat');
sysword PicSize = sizeof MyPicture; // get size of picture
Admin
Site Admin

avatar

(send private message)

Posts: 925
Topics: 54

Location:
OverHertz Studio
[1795] - posted: 2015-02-26 16:56:20
Ziron 1 supported something similar, but I intended this features to be a plugin for Ziron 2, I will get around to writing a plugin to support this.

Download Ziron
Get free hosting for Ziron related fan-sites and Ziron projects, contact me in private message.
Pages: 1
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 999, May 11, 2018, 10:01 am.


Statistics:
Threads: 223 | Posts: 1837 | Members: 50 | Active Members: 50
Welcome to our newest member, NobodyAtWork
const Copyright = '2011-2018 © OverHertz Ltd. All rights reserved.';
Web development by OverHertz Ltd