nuclear war (Miscellaneous)
> > And only about 24 hours ago (part of the delay here)
> > I realized I didn't know (and still don't know) how
> > it is technically possible for compilers to support
> > the small memory model, given that a buffer can
> > reside on either the stack or in the data segment.
>
> "Small model" in x86-16 coding simply means that there are two program
> segments, one for code, and one for data — and stack! So within the
> program you have cs
? ds
=
> ss
: the stack segment is the same as the data segment.
Thanks for clearing up that mystery!!!
Does this look correct to you?
https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpclib/dosstart.asm#l72
; In tiny, small and medium memory models, you need to set
; ss to ds (MSDOS will have set them to different values
; when it loaded the executable).
if @DataSize
else
mov bx,ss
mov ax,ds
sub bx,ax
mov cl,4
shl bx,cl
endif
...
; It appears that in the tiny memory model, you are still required
; to set ds to the same as cs yourself, presumably because ds is
; pointing to the PSP while cs is probably pointing to the beginning
; of the executable. DGROUP may also get the correct value, presumably
; zero. es is set to ds a bit later. And you need to set ss to that
; value too
if @Model eq 1
push cs
pop ds
push cs
pop ax
mov bp, sp
sub bp, bx
mov ss, ax
mov sp, bp
; And that null PSP thing needs to be redone
mov ax, 0
push ax
else
mov ds,dx
; small and medium memory models have ds and ss the same so that
; near pointers can refer to either stack or data and still work
if @DataSize
else
mov bp, sp
sub bp, bx
mov ss, dx
mov sp, bp
; And that null PSP thing needs to be redone
mov ax, 0
push ax
endif
endif
Complete thread:
- nuclear war - kerravon, 07.11.2022, 00:31
- nuclear war - Rugxulo, 07.11.2022, 09:55
- nuclear war - kerravon, 09.11.2022, 07:35
- nuclear war - marcov, 07.11.2022, 13:28
- nuclear war - kerravon, 09.11.2022, 07:43
- nuclear war - marcov, 09.11.2022, 20:18
- nuclear war - kerravon, 09.11.2022, 23:25
- nuclear war - marcov, 10.11.2022, 11:19
- nuclear war - kerravon, 10.11.2022, 13:33
- nuclear war - tom, 10.11.2022, 14:50
- nuclear war - kerravon, 10.11.2022, 15:13
- nuclear war - tom, 10.11.2022, 15:55
- nuclear war - kerravon, 10.11.2022, 15:27
- nuclear war - tom, 10.11.2022, 15:58
- nuclear war - kerravon, 10.11.2022, 16:22
- nuclear war - tom, 10.11.2022, 15:58
- nuclear war - kerravon, 10.11.2022, 15:13
- nuclear war - marcov, 11.11.2022, 11:09
- nuclear war - kerravon, 12.11.2022, 07:11
- nuclear war - tom, 10.11.2022, 14:50
- nuclear war - kerravon, 10.11.2022, 13:33
- nuclear war - marcov, 10.11.2022, 11:19
- nuclear war - tkchia, 10.11.2022, 00:25
- nuclear war - kerravon, 09.11.2022, 23:25
- nuclear war - marcov, 09.11.2022, 20:18
- nuclear war - kerravon, 09.11.2022, 07:43
- nuclear war - DosWorld, 07.11.2022, 13:54
- nuclear war - tkchia, 07.11.2022, 15:33
- nuclear war - kerravon, 09.11.2022, 07:50
- nuclear war - tkchia, 09.11.2022, 17:55
- nuclear war - kerravon, 09.11.2022, 18:15
- nuclear war - tkchia, 09.11.2022, 18:35
- nuclear war - kerravon, 09.11.2022, 23:10
- nuclear war - tkchia, 10.11.2022, 00:07
- nuclear war - kerravon, 10.11.2022, 01:16
- nuclear war - marcov, 10.11.2022, 11:28
- nuclear war - tkchia, 10.11.2022, 17:51
- nuclear war - kerravon, 10.11.2022, 23:45
- nuclear war - Rugxulo, 11.11.2022, 09:18
- nuclear war - marcov, 11.11.2022, 13:12
- nuclear war - kerravon, 12.11.2022, 08:48
- nuclear war - tkchia, 12.11.2022, 08:20
- nuclear war - kerravon, 12.11.2022, 08:43
- nuclear war - tkchia, 12.11.2022, 08:56
- nuclear war - kerravon, 12.11.2022, 09:16
- nuclear war - tkchia, 12.11.2022, 09:39
- nuclear war - kerravon, 12.11.2022, 09:59
- nuclear war - tkchia, 12.11.2022, 10:20
- nuclear war - kerravon, 12.11.2022, 10:29
- nuclear war - glennmcc, 13.11.2022, 18:24
- nuclear war - DosWorld, 16.11.2022, 00:03
- nuclear war - kerravon, 16.11.2022, 03:24
- nuclear war - glennmcc, 13.11.2022, 18:24
- nuclear war - kerravon, 12.11.2022, 10:29
- nuclear war - marcov, 13.11.2022, 12:02
- nuclear war - kerravon, 16.11.2022, 03:19
- nuclear war - marcov, 16.11.2022, 21:52
- nuclear war - kerravon, 16.11.2022, 23:54
- nuclear war - tkchia, 17.11.2022, 00:52
- nuclear war - glennmcc, 17.11.2022, 18:42
- nuclear war - kerravon, 17.11.2022, 23:45
- nuclear war - kerravon, 17.11.2022, 23:51
- nuclear war - glennmcc, 17.11.2022, 18:42
- nuclear war - tom, 17.11.2022, 11:10
- nuclear war - kerravon, 17.11.2022, 23:55
- nuclear war - tkchia, 17.11.2022, 00:52
- nuclear war - kerravon, 16.11.2022, 23:54
- nuclear war - marcov, 16.11.2022, 21:52
- nuclear war - kerravon, 16.11.2022, 03:19
- nuclear war - tkchia, 12.11.2022, 10:20
- nuclear war - kerravon, 12.11.2022, 09:59
- nuclear war - tkchia, 12.11.2022, 09:39
- nuclear war - kerravon, 12.11.2022, 09:16
- nuclear war - tkchia, 12.11.2022, 08:56
- nuclear war - kerravon, 12.11.2022, 08:43
- nuclear war - Rugxulo, 11.11.2022, 09:18
- nuclear war - kerravon, 10.11.2022, 23:45
- nuclear war - tkchia, 10.11.2022, 18:06
- nuclear war - kerravon, 10.11.2022, 01:16
- nuclear war - tkchia, 10.11.2022, 00:07
- nuclear war - kerravon, 09.11.2022, 23:10
- nuclear war - tkchia, 09.11.2022, 18:35
- nuclear war - kerravon, 09.11.2022, 18:15
- nuclear war - tkchia, 09.11.2022, 17:55
- nuclear war - kerravon, 09.11.2022, 07:50
- nuclear war - glennmcc, 07.11.2022, 20:47
- nuclear war - kerravon, 09.11.2022, 07:58
- nuclear war - glennmcc, 09.11.2022, 16:06
- nuclear war - kerravon, 09.11.2022, 17:58
- nuclear war - glennmcc, 10.11.2022, 16:55
- nuclear war - kerravon, 10.11.2022, 17:18
- nuclear war - glennmcc, 10.11.2022, 20:58
- nuclear war - kerravon, 10.11.2022, 23:23
- nuclear war - glennmcc, 10.11.2022, 20:58
- nuclear war - kerravon, 10.11.2022, 17:18
- nuclear war - tkchia, 12.11.2022, 10:10
- nuclear war - kerravon, 12.11.2022, 10:25
- nuclear war - tkchia, 12.11.2022, 11:13
- nuclear war - kerravon, 12.11.2022, 11:30
- nuclear war - tkchia, 16.11.2022, 16:23
- nuclear war - kerravon, 16.11.2022, 17:26
- nuclear war - tkchia, 16.11.2022, 18:16
- nuclear war - kerravon, 17.11.2022, 23:40
- nuclear war - tkchia, 18.11.2022, 00:38
- nuclear war - kerravon, 18.11.2022, 01:33
- nuclear war - kerravon, 18.11.2022, 02:56
- nuclear war - kerravon, 21.11.2022, 13:49
- nuclear war - DosWorld, 21.11.2022, 16:40
- nuclear war - glennmcc, 21.11.2022, 17:41
- nuclear war - DosWorld, 21.11.2022, 19:09
- nuclear war - kerravon, 21.11.2022, 23:38
- nuclear war - DosWorld, 22.11.2022, 19:19
- nuclear war - kerravon, 23.11.2022, 01:10
- nuclear war - DosWorld, 23.11.2022, 12:00
- nuclear war - kerravon, 23.11.2022, 12:28
- nuclear war - DosWorld, 25.11.2022, 18:20
- nuclear war - kerravon, 25.11.2022, 19:38
- nuclear war - DosWorld, 25.11.2022, 22:27
- nuclear war - kerravon, 25.11.2022, 22:34
- nuclear war - DosWorld, 25.11.2022, 22:39
- nuclear war - kerravon, 26.11.2022, 09:31
- nuclear war - glennmcc, 26.11.2022, 17:24
- nuclear war - DosWorld, 26.11.2022, 22:53
- nuclear war - kerravon, 26.11.2022, 09:31
- nuclear war - DosWorld, 25.11.2022, 22:39
- nuclear war - kerravon, 25.11.2022, 22:34
- nuclear war - DosWorld, 25.11.2022, 22:27
- nuclear war - kerravon, 10.12.2022, 05:54
- nuclear war - kerravon, 25.11.2022, 19:38
- nuclear war - DosWorld, 25.11.2022, 18:20
- nuclear war - kerravon, 23.11.2022, 12:28
- nuclear war - DosWorld, 23.11.2022, 12:00
- nuclear war - kerravon, 23.11.2022, 01:10
- nuclear war - DosWorld, 22.11.2022, 19:19
- nuclear war - kerravon, 21.11.2022, 23:38
- nuclear war - DosWorld, 21.11.2022, 16:40
- nuclear war - kerravon, 18.11.2022, 01:33
- nuclear war - tkchia, 18.11.2022, 00:38
- nuclear war - kerravon, 17.11.2022, 23:40
- nuclear war - tkchia, 16.11.2022, 18:16
- nuclear war - kerravon, 16.11.2022, 17:26
- nuclear war - tkchia, 16.11.2022, 16:23
- nuclear war - kerravon, 12.11.2022, 11:34
- nuclear war - kerravon, 12.11.2022, 11:38
- nuclear war - kerravon, 12.11.2022, 11:43
- nuclear war - kerravon, 12.11.2022, 11:38
- nuclear war - kerravon, 12.11.2022, 11:30
- nuclear war - tkchia, 12.11.2022, 11:13
- nuclear war - DosWorld, 12.11.2022, 11:35
- nuclear war - kerravon, 12.11.2022, 10:25
- nuclear war - glennmcc, 10.11.2022, 16:55
- nuclear war - kerravon, 09.11.2022, 17:58
- nuclear war - glennmcc, 09.11.2022, 16:06
- nuclear war - kerravon, 09.11.2022, 07:58
- nuclear war - DosWorld, 10.11.2022, 19:43
- nuclear war - kerravon, 10.11.2022, 23:25
- nuclear war - Rugxulo, 07.11.2022, 09:55