News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Memory???

Started by daydreamer, April 23, 2021, 05:26:11 PM

Previous topic - Next topic

daydreamer

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 
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

daydreamer

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
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

FORTRANS

Hi,

Quote from: daydreamer 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,

   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.

QuoteI 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

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

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

FORTRANS

Hi,

Quote from: daydreamer on September 15, 2021, 07:30:05 PM
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.

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

        ORG     64000
        Back    DB      ?


QuoteI 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

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?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

FORTRANS

Hi,

Quote from: daydreamer on November 28, 2021, 01:10:39 AM
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

Quote from: FORTRANS on November 28, 2021, 02:30:06 AM
Hi,

Quote from: daydreamer on November 28, 2021, 01:10:39 AM
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?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Gunther

Quote from: daydreamer on November 29, 2021, 07:45:39 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.
You have to know the facts before you can distort them.

daydreamer

Quote from: Gunther on November 30, 2021, 07:25:48 PM
Quote from: daydreamer on November 29, 2021, 07:45:39 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
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

TimoVJL

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

Quote from: TimoVJL 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.
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


my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

hutch--

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.

TimoVJL

May the source be with you

daydreamer

Quote from: TimoVJL on December 05, 2021, 08:07:18 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


my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding