First post, by DieJay
Hi everyone!
I wanted to do some classic DOS programming in assembly but since I'm stuck with Windows 7, I can't run TASM, TLINK or TD. Thanks to DosBox though, I could run them again without having to switch OSes or PCs.
However, I noticed something weird; if I define the program model as TINY, it makes the DIV and MUL operators crash the program. So in a nutshell, somehow, having the same segment for the code and data screws up the multiplication and division operators when running the program in DosBox (it runs just fine on the real thing). I don't get it.
Does anyone knows what may be causing this?
Here's an example program to show you what I mean.
.MODEL SMALL; ".MODEL TINY" will make the program crash somewhere between line 21 and 30..STACK 256.8086.DATAlabelStart DB "Program started.", 10, 13, '$'labelDivision DB "A division was made.", 10, 13, '$'someWord DW 03C8h.CODEmain PROCmov ax, @datamov ds, ax; display "Program started."mov ax, 0900hlea dx, labelStartint 21h; test simple divisionmov ah, 0mov al, BYTE PTR [someWord]mov bx, 2div bx; display "A division was made."mov ax, 0900hlea dx, labelDivisionint 21h; wait for a keymov ah, 07hint 21h; end program with code 0mov ah, 04Chmov al, 0int 21hmain ENDPEND main
Edit: Yeah, I realize this is a pretty far fetched issue, but I'd be curious if the topic has been brought up before or, god forbid, there's an actual reason why this is happening.