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

daydreamer

  • Member
  • *****
  • Posts: 1850
  • green elevator
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: 1850
  • green elevator
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: 1136
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: 1850
  • green elevator
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: 1136
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.

daydreamer

  • Member
  • *****
  • Posts: 1850
  • green elevator
Re: Memory???
« Reply #20 on: November 28, 2021, 01:10:39 AM »
Thanks steve  :thumbsup:
Best Memory copy,should that better use fpu load/store 10bytes and write tiles below sprites? Fill 8 bytes x 8 fp regs to write background pattern?
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: 1136
Re: Memory???
« Reply #21 on: November 28, 2021, 02:30:06 AM »
Hi,

Best Memory copy,should that better use fpu load/store 10bytes and write tiles below sprites? Fill 8 bytes x 8 fp regs to write background pattern?

   The best copy routine will vary based on your system, CPU, and
memory.  So you will have to test a number of different copy
routines and select the one you like best.  Using the FPU frees up
the general registers, so it may be useful even if it's not otherwise
the best.  See past postings in the Laboratory subforum discussing
copy routines.  And, of course, let us know what you find out.

Regards,

Steve M.

daydreamer

  • Member
  • *****
  • Posts: 1850
  • green elevator
Re: Memory???
« Reply #22 on: November 29, 2021, 07:45:39 AM »
Hi,

Best Memory copy,should that better use fpu load/store 10bytes and write tiles below sprites? Fill 8 bytes x 8 fp regs to write background pattern?

   The best copy routine will vary based on your system, CPU, and
memory.  So you will have to test a number of different copy
routines and select the one you like best.  Using the FPU frees up
the general registers, so it may be useful even if it's not otherwise
the best.  See past postings in the Laboratory subforum discussing
copy routines.  And, of course, let us know what you find out.

Regards,

Steve M.
nice to use extra registers,I more expect emulator act as old cpu timings to not break old retrogames and lowbandwidth requirements compared to modern games on moderen computers
just curious how fast emulated mhz would be when emulator runs on 4.9ghz ryzen?
SIMD fan and macro fan
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."

Gunther

  • Member
  • *****
  • Posts: 3830
  • Forgive your enemies, but never forget their names
Re: Memory???
« Reply #23 on: November 30, 2021, 07:25:48 PM »
nice to use extra registers,I more expect emulator act as old cpu timings to not break old retrogames and lowbandwidth requirements compared to modern games on moderen computers
just curious how fast emulated mhz would be when emulator runs on 4.9ghz ryzen?

Well, it is and remains emulated software. Everything has to be virtualized and that takes time. For correct timings I always start a native DOS from the USB stick.
Get your facts first, and then you can distort them.

daydreamer

  • Member
  • *****
  • Posts: 1850
  • green elevator
Re: Memory???
« Reply #24 on: December 04, 2021, 01:32:26 AM »
nice to use extra registers,I more expect emulator act as old cpu timings to not break old retrogames and lowbandwidth requirements compared to modern games on moderen computers
just curious how fast emulated mhz would be when emulator runs on 4.9ghz ryzen?

Well, it is and remains emulated software. Everything has to be virtualized and that takes time. For correct timings I always start a native DOS from the USB stick.
still most people will run dos on emulator
SIMD fan and macro fan
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."

TimoVJL

  • Member
  • ****
  • Posts: 878
Re: Memory???
« Reply #25 on: December 04, 2021, 01:45:06 AM »
Also industrial use DosBox with handbrake to use old MS-DOS programs, as it's hard to find a slow PC-MB anymore.
Also when ever, virtual PC can be used to control machines using COMports/UARTS.
Special cards are a real problem, like try to find ISA / PCI MB for those.
May the source be with you

daydreamer

  • Member
  • *****
  • Posts: 1850
  • green elevator
Re: Memory???
« Reply #26 on: December 05, 2021, 07:03:58 AM »
Also industrial use DosBox with handbrake to use old MS-DOS programs, as it's hard to find a slow PC-MB anymore.
Also when ever, virtual PC can be used to control machines using COMports/UARTS.
Special cards are a real problem, like try to find ISA / PCI MB for those.
I have old AMD 2ghz with XP,never use it so use it instead for dos?
When I started with assembly, many Algos could be done with fewer bits than 32bit,also fun to make smallest. Com file which is wysiwyg

So algo that works only with 16bit is suitable for fast SIMD version
Also I made. Inc file for all vk_codes constants, so keyboard control can be reused in 32bit


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

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 8879
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Memory???
« Reply #27 on: December 05, 2021, 07:21:45 AM »
I have seen in the past, industrial spec motherboards that use a 486 dx and they were mainly for process control where you could not have the vaguries of a consumer operating system, so MS-DOS was often used because it was a real mode OS that was much simpler and could use instructions that were not allowed in protected mode consumer OS versions.

Industrial tasks rarely ever needed much memory so a whopping 640k was overkill but if you needed more, you could use HIMEM.SYS to get VGA memory by setting B7FF hex as the top limit as you rarely ever used VGA display in industrial applications.

I learnt this one long ago with Norton SpeedDisk if it spat the dummy in terms of memory.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

TimoVJL

  • Member
  • ****
  • Posts: 878
Re: Memory???
« Reply #28 on: December 05, 2021, 08:07:18 AM »
A vintage MB
GIGABYTE GA-686LX3
May the source be with you

daydreamer

  • Member
  • *****
  • Posts: 1850
  • green elevator
Re: Memory???
« Reply #29 on: December 12, 2021, 06:18:43 AM »
A vintage MB
GIGABYTE GA-686LX3
had one when it was new,later used a 451mhz k2 for linux
industrial ISO programming looks similar to opcodes,so might be possible to use switch/case or jumptable to different drawing functions and collision detection for ISO emulator
Hutch I am checking dosbox configure file to see how its possible to change to max B7FFh usage,but I am clueless
640kb is much compared to few assembly proc's


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