home bbs files messages ]

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,509 of 4,675   
   Paul Edwards to Alexei A. Frounze   
   Re: seg keyword   
   20 Nov 22 04:23:09   
   
   From: mutazilah@nospicedham.gmail.com   
      
   On Sunday, November 20, 2022 at 12:05:21 PM UTC+8, Alexei A. Frounze wrote:   
      
   > > How do I use a 32-bit physical address?   
   > >   
   > > Is it like above?   
      
   > Yes.   
      
   Thanks. I just went ahead and tried that, but it didn't seem to work.   
      
   Any idea what I did wrong?   
      
   Here is the old (working) code:   
      
    Released to the public domain by Matthew Parker on 4 December 1995   
    Mods by Paul Edwards, also public domain.   
    For different models just change the .model directive   
      
   % .model memodel, c   
      
   public instint   
      
   extrn int0:proc   
   extrn int1:proc   
   extrn int3:proc   
   extrn int20:proc   
   extrn int21:proc   
   extrn int25:proc   
   extrn int26:proc   
      
   public handler0   
   public handler1   
   public handler3   
   public handler20   
   public handler21   
   public handler25   
   public handler26   
      
           .code   
      
   instint proc uses bx es   
           mov bx, 0   
           push bx   
           pop es   
           cli   
           mov bx, offset handler0   
           mov es:[0h], bx   
           mov bx, seg handler0   
           mov es:[02h], bx   
           mov bx, offset handler1   
           mov es:[04h], bx   
           mov bx, seg handler1   
           mov es:[06h], bx   
           mov bx, offset handler3   
           mov es:[0ch], bx   
           mov bx, seg handler3   
           mov es:[0eh], bx   
           mov bx, offset handler20   
           mov es:[80h], bx   
           mov bx, seg handler20   
           mov es:[82h], bx   
           mov bx, offset handler21   
           mov es:[84h], bx   
           mov bx, seg handler21   
           mov es:[86h], bx   
           mov bx, offset handler25   
           mov es:[94h], bx   
           mov bx, seg handler25   
           mov es:[96h], bx   
           mov bx, offset handler26   
           mov es:[98h], bx   
           mov bx, seg handler26   
           mov es:[9Ah], bx   
           sti   
           ret   
   instint endp   
      
    the stack will already have   
    flags   
    cs   
    ip   
      
   handler0 proc   
           push bp   
           push ax   
           push ax   ; dummy, actually cflag storage   
           push bx   
           push cx   
           push dx   
           push si   
           push di   
           push ds   
           push es   
      
           mov dx, DGROUP   
           mov ds, dx   
           mov ax, sp   
           push ss   
           push ax   
           call int0   
           add sp, 4   
      
           pop es   
           pop ds   
           pop di   
           pop si   
           pop dx   
           pop cx   
           pop bx   
           pop ax   ; actually cflag   
      
           cmp ax, 0   
           je clear0   
           jmp notclear0   
   clear0:   
           pop ax   
           push bp   
           mov bp, sp   
           and word ptr [bp+6],0fffeh   
           pop bp   
           pop bp   
           iret   
   notclear0:   
           pop ax   
           push bp   
           mov bp, sp   
           or word ptr [bp+6],0001h   
           pop bp   
           pop bp   
           iret   
   handler0 endp   
      
   ...   
      
   And here is the new code, which is now preventing PDOS/86   
   from booting:   
      
    Released to the public domain by Matthew Parker on 4 December 1995   
    Mods by Paul Edwards, also public domain.   
    For different models just change the .model directive   
      
   % .model memodel, c   
      
   public instint   
      
   extrn int0:proc   
   extrn int1:proc   
   extrn int3:proc   
   extrn int20:proc   
   extrn int21:proc   
   extrn int25:proc   
   extrn int26:proc   
      
   public handler0   
   public handler1   
   public handler3   
   public handler20   
   public handler21   
   public handler25   
   public handler26   
      
   .data   
   addr0 dd handler0   
   addr1 dd handler1   
   addr3 dd handler3   
   addr20 dd handler20   
   addr21 dd handler21   
   addr25 dd handler25   
   addr26 dd handler26   
      
           .code   
      
   instint proc uses bx es ds   
           mov bx, 0   
           push bx   
           pop es   
           cli   
      
           lds bx, addr0   
           mov es:[0h], bx   
           mov es:[02h], ds   
      
           lds bx, addr1   
           mov es:[04h], bx   
           mov es:[06h], ds   
      
           lds bx, addr3   
           mov es:[0ch], bx   
           mov es:[0eh], ds   
      
           lds bx, addr20   
           mov es:[80h], bx   
           mov es:[82h], ds   
      
           lds bx, addr21   
           mov es:[84h], bx   
           mov es:[86h], ds   
      
           lds bx, addr25   
           mov es:[94h], bx   
           mov es:[96h], ds   
      
           lds bx, addr26   
           mov es:[98h], bx   
           mov es:[9Ah], ds   
      
           sti   
           ret   
   instint endp   
      
    the stack will already have   
    flags   
    cs   
    ip   
      
   handler0 proc   
           push bp   
           push ax   
           push ax   ; dummy, actually cflag storage   
      
   ...   
      
      
      
   Thanks. 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