home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / RTANKASM.ZIP / EXPLAIN1.ASM < prev    next >
Assembly Source File  |  1989-01-07  |  3KB  |  102 lines

  1. ; EXPLAIN1.ASM
  2. ; ------------
  3. ; Please explain why the data in this SEPDATA segment get's used as
  4. ; MALLOC() space when included in a TC program.
  5. ;
  6. ; Therefore, how can I get another 64k segment to use as a storage
  7. ; area for my graphics driver code.
  8. ; (Without going into HUGE or LARGE memory models!
  9. ;
  10.  
  11.  
  12.                 ASSUME          cs:_TEXT, DS:SEPDATA
  13.  
  14. SEPDATA         SEGMENT WORD 'SDATA'
  15.                 public  overwrite, notile
  16.  
  17. ;
  18. ; This data following gets overwritten when TURBO-C uses
  19. ; MALLOC()'ed data
  20. ;
  21. ;  Why?? it's in a different segment, isn't this all I have to do?
  22. ;
  23.  
  24.  
  25. overwrite       db              123
  26. notile          db              000h, 000h, 000h, 000h
  27.                 db              000h, 000h, 000h, 000h
  28.                 db              000h, 000h, 000h, 000h
  29.                 db              000h, 000h, 000h, 000h
  30.  
  31. corner          db              055h, 055h, 040h, 000h
  32.                 db              040h, 000h, 040h, 000h
  33.                 db              040h, 000h, 040h, 000h
  34.                 db              040h, 000h, 040h, 000h
  35.  
  36. allwhite        db              0FFh, 0FFh, 0FFh, 0FFh
  37.                 db              0FFh, 0FFh, 0FFh, 0FFh
  38.                 db              0FFh, 0FFh, 0FFh, 0FFh
  39.                 db              0FFh, 0FFh, 0FFh, 0FFh
  40.  
  41. imagelist       dw              notile      ; pointers to images
  42.                 dw              corner
  43.                 dw              allwhite
  44.                 dw              0
  45.  
  46. map             db              9000 dup(?) ; Map array, lists which tile
  47.                                             ; appears where.
  48.                                             ; Each entry is an index into
  49.                                             ; the imagelist file
  50.  
  51. scrbuf          db              16200 dup(?) ; Screen swap buffer
  52.  
  53. SEPDATA ENDS
  54.  
  55. _TEXT           SEGMENT BYTE PUBLIC 'CODE'
  56.  
  57.                 PUBLIC _refreshscr
  58.  
  59. ;
  60. ; This is a sample procedure called from TURBO-C which should make use
  61. ; of the new data segment
  62. ;
  63.  
  64. ;
  65. ; Ignore what this procedure actually does ... it's just for example.
  66. ;
  67.  
  68. _refreshscr     proc
  69.                 push            bp
  70.                 mov             bp,sp
  71.                 push            ds
  72.                 push            es
  73.                 push            si
  74.                 push            di
  75.                 push            cx
  76.  
  77.                 cli
  78.                 mov             ax,SEPDATA
  79.                 mov             ds,ax
  80.  
  81.                 mov             ax,0B800h
  82.                 mov             es,ax
  83.                 mov             si,OFFSET scrbuf
  84.                 mov             cx,16192
  85.                 mov             di,0
  86.                 rep             movsb
  87.                 sti
  88.  
  89.                 pop             cx
  90.                 pop             di
  91.                 pop             si
  92.                 pop             es
  93.                 pop             ds
  94.                 pop             bp
  95.                 ret
  96.  
  97. _refreshscr     endp
  98.  
  99. _TEXT            ENDS
  100.  
  101.                  END
  102.