Author Topic: Memory???  (Read 1759 times)

daydreamer

  • Member
  • *****
  • Posts: 1754
  • building nextdoor
Re: Memory???
« Reply #15 on: June 12, 2021, 04:49:48 AM »
How do I load a bitmap and controls which segment(s) it's loaded into?
On underpowered computers,it's common with premade Sprites/ tiles 
SIMD fan and macro fan
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."

daydreamer

  • Member
  • *****
  • Posts: 1754
  • building nextdoor
Re: Memory???
« Reply #16 on: September 10, 2021, 10:36:30 PM »
How do I get no stackframes or custom stack frame, so i can use most of 8 registers, I want to use BP as pointer for Ss segment /original cs segment where my variables are
Ds together with es is for copy backbuffer/screen memory, also copy part of landscape that I scroll thru
SIMD fan and macro fan
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."

FORTRANS

  • Member
  • *****
  • Posts: 1110
Re: Memory???
« Reply #17 on: September 11, 2021, 12:29:25 AM »
Hi,

How do I get no stackframes or custom stack frame, so i can use most of 8 registers,

   Code things directly to avoid any stack frame.  Use a different calling
convention that does not require passing parameters on the stack.  Most
of my code uses variables in the data segment to allow a called procedure
to directly use global data.

   Or write a macro to implement a custom stack frame.

Quote
I want to use BP as pointer for Ss segment /original cs segment where my variables are

   BP defaults to using SS for its segment access.  you can use a CS: or
DS: segment override to use those segments.  I do that fairly often as I
don't normally use a stack frame.  Thus BP is usable as a second base
register to access data in the DS or ES segments.

HTH,

Steve N.

daydreamer

  • Member
  • *****
  • Posts: 1754
  • building nextdoor
Re: Memory???
« Reply #18 on: September 15, 2021, 07:30:05 PM »
Thanks steve :thumbsup:
I started to use fs,gs too
Any way to use org to place variables in last 1536 bytes in a segment?
Remaining after using 320*200 bytes as backbuffer?
I am using. Com file,so strategy is to keep ss in original segment/variables using BP,forgetting point to right segment LUT is,breaks my code earlier
While changing ds,es to rep Movsd,rep stosd

I think I want to try tile engine approach instead of scroll thru loads of memory
So scroll down/up,first write a line of tiles before change pointer. To backbuffer
A map of tiles + several tiles less memory /cpu demanding

SIMD fan and macro fan
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."

FORTRANS

  • Member
  • *****
  • Posts: 1110
Re: Memory???
« Reply #19 on: September 15, 2021, 09:42:56 PM »
Hi,

Thanks steve

   You're welcome.

Quote
I started to use fs,gs too

   There should not be a problem using overrides for FS and GS.
However, unlike the other segment registers, they are not initialized
on program load.  Since you are creating *.COM programs, pushing
DS and popping FS, or GS, should work.

Quote
Any way to use org to place variables in last 1536 bytes in a segment?
Remaining after using 320*200 bytes as backbuffer?

Code: [Select]
        ORG     64000
        Back    DB      ?

Quote
I am using. Com file,so strategy is to keep ss in original segment/variables using BP,forgetting point to right segment LUT is,breaks my code earlier

   In a *.COM file, all segments should start out as the same.  Though
see above for FS and GS.  When you change a segment register, to
access video memory for instance,  you can use ASSUME to keep the
assembler happy.  Though that requires a segment declaration.  Thus
an optional program consideration.  Depends on your programming style.

   The stack segment is the same as the code and data segments on
program load. so using BP should not be difficult at all.

Cheers,

Steve N.