Author Topic: sudoku sequence generator  (Read 2419 times)

NoCforMe

  • Member
  • *****
  • Posts: 1124
Re: sudoku sequence generator
« Reply #30 on: January 07, 2023, 09:26:57 AM »
Dunno why you think 16-bit (DOS) code is so mysterious; it's not. Basically the same as what we're doing here in 32-bit land. The main difference is how you do DOS system calls. F'rinstance, to "print" a message to the display, you do this:

Code: [Select]
LEA DX, IDMsg ;Announce ourselves.
MOV AH, $I21_PRINT_STRING
INT 21H

is pretty much how you do everything, system-wise, unless you're doing ROM BIOS calls, in which case it's

Code: [Select]
MOV AH, 3
XOR BH, BH
INT 10H ;Get current cursor pos.

(Y'see, everything's done through interrupts)

And of course program structure is different. I used to write mostly .COM programs, reeeeely compact li'l jobbies. Program start is always @ 100H, and all segment registers (CS, DS, ES, SS) point to your code, so it's really easy to deal with data and the stack.

But it ain't rocket surgery.

zedd151

  • Member
  • *****
  • Posts: 1942
Re: sudoku sequence generator
« Reply #31 on: January 07, 2023, 09:43:38 AM »
But it ain't rocket surgery.
For me, it may as well be.  :tongue:  I do try to understand it, but apparently I have some form of mental block preventing me from comprehending it. So, I don't even really try anymore. Interrupts, segments, segment overrides, yuck.  I try to understand some of it though. But I really don't understand.  :sad:
Regards, zedd.
:tongue:

NoCforMe

  • Member
  • *****
  • Posts: 1124
Re: sudoku sequence generator
« Reply #32 on: January 07, 2023, 11:08:35 AM »
Yeah, segments, that's the other big difference.

Usually you don't have to give a crap about segments. If everything in your program fits into 64K, you're fine. You might have to do a tiny bit of segment initialization at the start of your program (if your program is an .exe; not needed for .com program), but that's about it.

Think of a segment as just a chunk of memory that's exactly 64K (65,536 bytes) long. Which happens to be the limit of addressing you can do with a 16-bit variable or register. Now of course, there's more memory than that in the computer. To access a different segment, you just "point" the segment register (CS, DS, ES or SS) to that segment. (Not the same as a pointer in 32-bit code; since the total address space in DOS-land is 20 bits, the segment address is essentially the top 4 bits of the physical address, on top of the 16-bit offset. Each increment of a segment register points you to the next 16-byte "paragraph".)

Once you learn the quirks of segmentation, it's easy, believe me. Not rocket science.

What's more of a pain in the butt is extended and expanded memory, where you have special memory installed in the system that has to be accessed through its own API. I used to write code for that; not pretty, but it does get you a lot more memory.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: sudoku sequence generator
« Reply #33 on: January 07, 2023, 01:41:03 PM »
 :biggrin:

Bad habits of old.  :tongue:

Com compressor where you could put more COM files into a can that 64k.

Tangle a loop and get to see almost all of your BIOS settings before it crashed.

Tun off VGA memory and CGA memory so you could load bigger programs, Norton Speedisk for example.

Floppy disk boot sector code that displayed the full binary content of COMMAND.COM. It was a reminder for folks who left floppies in the drive when they started MS-DOS.

My trashcan directory back then was full of some truly dangerous code.  :skrewy:
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

daydreamer

  • Member
  • *****
  • Posts: 2393
  • my kind of REAL10 Blonde
Re: sudoku sequence generator
« Reply #34 on: January 07, 2023, 03:33:10 PM »
Nocforme
Different Segment doesnt need to be fixed place=thinking inside box, i realized 320 byte scanline in mode 13h evenly divided by 16, which is ds, es changes segment adress by
So i have tried scroll thru several 64k pages this way (actually copy to a000 segment)
. Com file Is in 16bit dos thread about memory
Yet another memory is svga memory pages int call to which pages show , another int call to choose where a000 page is mapped to in vram
my none asm creations
http://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

zedd151

  • Member
  • *****
  • Posts: 1942
Re: sudoku sequence generator
« Reply #35 on: January 08, 2023, 02:23:30 AM »
This last series of posts is all FORTRANS fault.  :tongue:  I assume no responsibility.  :biggrin:   Well, maybe a little of it as should jj.  :cool:

Anyway, I will probably not be working on anything sudoku related for a while. I am finishing up another project and don't want to leave it, without finishing it first. (Unless I get stuck) After which I will resume the sudoku stuff.
Regards, zedd.
:tongue:

raymond

  • Member
  • ***
  • Posts: 327
    • Raymond's page
Re: sudoku sequence generator
« Reply #36 on: January 08, 2023, 06:38:08 AM »
[I'd still like to try my hand at Z80 programming; one of the most underrated machines ever create by man in my opinion.

That's where I got my feet wet in assembly almost 35 years ago!
I certainly can't remember all the details but a very useful one was that the Z80 had two sets of 8-bit registers which you could use alternatively without loosing the data in either set whenever switching between them. There was one common 16-bit register for both of them.

Whenever you assume something, you risk being wrong half the time.
http://www.ray.masmcode.com/

Gunther

  • Member
  • *****
  • Posts: 4196
  • Forgive your enemies, but never forget their names
Re: sudoku sequence generator
« Reply #37 on: January 08, 2023, 12:28:06 PM »
Raymond,

I certainly can't remember all the details but a very useful one was that the Z80 had two sets of 8-bit registers which you could use alternatively without loosing the data in either set whenever switching between them.
these were the so-called shadow registers. The Z80 also had very rudimentary 16 bit arithmetic. It was possible to connect two 8 bit registers to one 16 bit register - BC, DE and HL. The address bus was 16 bit wide,
so that 64 KB could be addressed. There were compilers for FORTRAN and PASCAL and of course a BASIC interpreter. The Z80 was the killer for the Intel 8080.
You have to know the facts before you can distort them.

zedd151

  • Member
  • *****
  • Posts: 1942
Re: sudoku sequence generator
« Reply #38 on: January 08, 2023, 01:31:32 PM »
I might as well jump on the Z80/68000 bandwagon. Reading the first post, how would one do it on the Z80, or the MC68000?   :badgrin:   Results don't need to be displayed, or even ascii for that matter.  :tongue:
Regards, zedd.
:tongue:

Gunther

  • Member
  • *****
  • Posts: 4196
  • Forgive your enemies, but never forget their names
Re: sudoku sequence generator
« Reply #39 on: January 08, 2023, 02:18:59 PM »
zedd151,

I might as well jump on the Z80/68000 bandwagon. Reading the first post, how would one do it on the Z80, or the MC68000?   :badgrin:
what a question? The Motorola 68000 was already a dream processor back then. A 32 bit instruction set, 32 bit registers and a linear address space. What more do you want? But I would use a Motorola 68020
with full 32-bit ALUs and full 32-bit address and data buses. But hey, what do I know?
You have to know the facts before you can distort them.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: sudoku sequence generator
« Reply #40 on: January 08, 2023, 04:09:44 PM »
I remember z80 as my mum got one from Honeywell where she worked. I forget the brand but it looked like military issue, strong metal case and the lid folded out for the keyboard. I got a floppy with BASIC on it and played with it on and off but I got too busy to play with it while running my business and it was only after I closed it that I had time for computers.

I started stone cold on x86 with MASM, BASIC and C in 1990.

68k ? MAC SCHMAK !  :tongue:
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

Gunther

  • Member
  • *****
  • Posts: 4196
  • Forgive your enemies, but never forget their names
Re: sudoku sequence generator
« Reply #41 on: January 08, 2023, 05:43:05 PM »
Steve,

68k ? MAC SCHMAK !  :tongue:

by the way, the Apple II had the 6502 as CPU. Not exactly my favorite as a processor. The 68000 series was already another world. Intel could only dream of this for a long time.
Just remember the 80186, a processor with brain damage. How long did the 80286 dominate the market? Motorola and Texas Instruments were well into the 32 bit world by then.
Not everything that prevails on the market is state of the art. But that's another story.
You have to know the facts before you can distort them.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: sudoku sequence generator
« Reply #42 on: January 08, 2023, 06:25:04 PM »
 :biggrin:

My very first x86 was a 286 that I had for about 2 weeks then I forked a fortune at the time for a 486DX, a 300 meg ESDI drive and a gig of memory. Cost a fortune at the time but was then hot stuff.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

zedd151

  • Member
  • *****
  • Posts: 1942
Re: sudoku sequence generator
« Reply #43 on: January 08, 2023, 06:59:55 PM »

what a question?
It was really more a rhetorical question rather than a serious one.   :tongue:
If the old farts want to reminisce, who am I to stop them.   :biggrin:   I'm a member myself, of the "old farts club" btw.  :toothy:
Regards, zedd.
:tongue:

jj2007

  • Member
  • *****
  • Posts: 13932
  • Assembly is fun ;-)
    • MasmBasic
Re: sudoku sequence generator
« Reply #44 on: January 08, 2023, 08:21:08 PM »
68k ? MAC SCHMAK !  :tongue:

You obviouly missed the Atari against Amiga war :biggrin: