• retf

    From muta...@gmail.com@mutazilah@gmail.com to comp.os.msdos.programmer on Sun Nov 6 14:16:28 2022
    From Newsgroup: comp.os.msdos.programmer

    I thought I only needed to code "ret", and the memory
    model would take care of converting that to either
    retf or retn, as required.

    But I found under both wasm and masm I need to put
    retf. Any idea why?

    .model medium

    .code

    public two
    two:

    push dx
    mov ah,2
    mov dl,41h
    int 21h
    pop dx

    retf

    db 40000 dup(?)


    end



    Thanks. Paul.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From muta...@gmail.com@mutazilah@gmail.com to comp.os.msdos.programmer on Sun Nov 6 15:23:02 2022
    From Newsgroup: comp.os.msdos.programmer

    On Monday, November 7, 2022 at 6:23:52 AM UTC+8, muta...@gmail.com wrote:
    I thought I only needed to code "ret", and the memory
    model would take care of converting that to either
    retf or retn, as required.

    But I found under both wasm and masm I need to put
    retf. Any idea why?

    .model medium

    .code

    public two
    two:

    push dx
    mov ah,2
    mov dl,41h
    int 21h
    pop dx

    retf

    db 40000 dup(?)


    end



    Thanks. Paul.

    I found that if I put it in a proc, it behaves as expected.

    .model medium

    .code

    public two
    two proc

    push dx
    mov ah,2
    mov dl,41h
    int 21h
    pop dx

    ret

    two endp

    db 40000 dup(?)

    end
    --- Synchronet 3.21d-Linux NewsLink 1.2