multiple far data segments? 
Author Message
 multiple far data segments?

Hi,
  I have been experimenting with embedding data inside my asm programs.
Basically, what I do is kind of a kludge.  I dump image data to raw format
(i.e. 768 bytes for palette,64000 bytes for 320x200 image).  Then I wrote a
short C program to generate some asm data declaration code from that.  The
end result is a huge (around 220k) text file like this:

        .fardata
image_data db 13,123,234,4,3,23......
db 34,34,65,67,76.....
        .
        .
        .

And so on.  I assemble and link with the code.  It works fine, I can dump
the pic to the screen no problem.  But, I would like to avoid having to go
through this laborious process.  How can I cut out the middle man and just
go straight from binary data to an obj file?

Also, since I have not yet done any work in the realm of data compression, I
would like to get by for the time being with multiple far data segments to
hold around 3 or four screens worth image data.  How do I go about
declaring a second or third far data segment?

I am using TASM 3.0 that came with BCC 3.1  I really dont like C as much as
asm, and hence have not explored much of the development package.  Is there
a utility somewhere in that huge 57 meg pile of junk on my HD that could
help?

Thanks,
Ivan....
--


     ivan pulleyn 268 susquehanna rd. rochester, ny 14618 (716) 442-3735
       hypereal group po box 18572 rochester, ny 14618 (716) 442-6231



Mon, 29 Apr 1996 13:29:19 GMT  
 multiple far data segments?

IP> Hi,
IP>   I have been experimenting with embedding data inside my asm programs.
IP> Basically, what I do is kind of a kludge.  I dump image data to raw format
IP> (i.e. 768 bytes for palette,64000 bytes for 320x200 image).  Then I wrote a
IP> short C program to generate some asm data declaration code from that.  The
IP> end result is a huge (around 220k) text file like this:

IP>  .fardata
IP> image_data db 13,123,234,4,3,23......
IP> db 34,34,65,67,76.....
IP>  .
IP>  .

IP> And so on.  I assemble and link with the code.  It works fine, I can dump
IP> the pic to the screen no problem.  But, I would like to avoid having to go
IP> through this laborious process.  How can I cut out the middle man and just
IP> go straight from binary data to an obj file?

To write an .OBJ file need know its structure. It consists of records,
each of them have structure: { byte record_type; word record_length;
byte record_data[record_length-1]; byte checksum; }. Most interesting
for you will be records: LNAMES (96h) which contain segment names as
counted strings (byte length 0-127 followed by name); SEGDEF (98h)
which contains byte segment_attribute (should be 60h, or 62h if 64kB
"big" segment) followed by segment length (you may wish to change it)
followed by 3 name indices; PUBDEF (90h) which should contain: byte 0,
segment index, name (preceded by byte length, >0), word offset, type
index (ignored by linker?, probably should use 0); LEDATA (A0h) which
contains: segment index, word offset (0 in first record), the data
(max 1024 bytes, use more LEDATA records for longer data).

IP> Also, since I have not yet done any work in the realm of data compression, I
IP> would like to get by for the time being with multiple far data segments to
IP> hold around 3 or four screens worth image data.  How do I go about
IP> declaring a second or third far data segment?

Suppose you can use different segment and public names for each.



Thu, 02 May 1996 03:42:43 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Multiple far data segments?

2. FAR data-segment

3. TASM and far jumps from 16-bit segment to 32-bit segment

4. Multiple data segments

5. Need help: Multiple Data Segments

6. Multiple data segments for C prog

7. data segment vs code segment

8. Multiple Browse - Further Explained

9. Sorting multiple-line data to single line data

10. Multiple Code Segments & Include Files

11. Multiple Code Segments

12. multiple segments

 

 
Powered by phpBB® Forum Software