Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.asm.x86    |    Ahh, the lost art of x86 assembly    |    4,675 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 4,502 of 4,675    |
|    Paul Edwards to Terje Mathisen    |
|    Re: error for small data model    |
|    19 Nov 22 08:32:58    |
      From: mutazilah@nospicedham.gmail.com              On Saturday, November 19, 2022 at 11:37:49 PM UTC+8, Terje Mathisen wrote:              > > if @DataSize       > > else       > >       > > mov bx,ss       > > mov ax,ds       > > sub bx,ax       > > mov cl,4       > > shl bx,cl       > >       > > mov bp, sp       > > sub bp, bx              This should have been an add, not a subtract. :-)              > > mov ss, dx       > > mov sp, bp       > > ; And that null PSP thing needs to be redone       > > mov ax, 0       > > push ax       > >       > > endif       > >       > >       > > My testing suggests that there is a problem with tiny memory       > > model, but the other memory models seem to work.              > Tiny is the one used by all .COM files, in those the binary has no       > relocation info, it is just block copied into a newly allocated 64KB       > block of memory, at offset 100h, and with those first 256 bytes (the       > PSP) initialized by the OS.       >       > In this model all segment registers are the same, i.e. CS=DS=ES=SS       > because the OS and CPU are pretending to be a Z80 with no support for       > extended/segmented memory addressing.              That's only if you deliberately choose to produce a COM file,       and also you need an org 100h in the startup code.              Otherwise, tiny memory model produces a perfectly fine       normal MSDOS executable, and the entry point can be       anywhere.              My hello world program, linking in the whole C library       in tiny memory model is this size:              Memory size: e110 (57616.)              _TEXT CODE DGROUP 0000:0000 000053c6       CONST DATA DGROUP 053c:0006 000002be       CONST2 DATA DGROUP 0568:0004 00000000       _DATA DATA DGROUP 0569:0000 00000668       _BSS BSS DGROUP 05cf:0008 00006412       STACK STACK DGROUP 0c11:0000 00002000              Entry point address: 0000:02fa              Which is cool.              I have a lot of BSS because of 6144-byte buffers for files which       gave a great speedup on a real XT in the 1990s.              My tiny mode doesn't support malloc though, so you can't       do much. Doesn't support parameters either. :-) Large is       fine though. It was interesting to see.              PDOS/86 now has INT 3 and INT 1 support as a result of       debugging that.              BFN. Paul.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca