Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;What this skeleton COM file can currently do is:
- ;
- ; - Use Unreal Mode (enable it first somewhere, make a utility).
- ; - Return to DOS.
- ; - Use portable x86 registers and general-purpose instructions.
- ; - Define locations for the entry point and data/library bytes.
- ;;
- org 100h
- bits 16
- jmp skeleton_START
- ;Set the default mode of x86 Portable to work under
- ;386+ 16-bit Real/Unreal Mode (with access to 4GB of address space,
- ;if they are enabled, or at least to 32-bit CPU registers):
- ;;
- %ixdefine _x86_Portable__PLATFORMBITS_ 1632 ;386+ Real/Unreal Mode
- %include "arch/hw/CPU/x86/0000000__x86_Portable.asm"
- align 16
- skeleton_START:
- ;This is the entry point of the application:
- ;;
- ;Save any registers before starting:
- ;;
- pushf
- ;;;INIT
- ;;;INIT
- ;;;INIT
- ;;;INIT
- ;;;INIT
- ;;;INIT
- ;;;INIT
- ;;;INIT
- ; ;
- ;; Structure the main application driver entry point here. ;;
- ;;; ;;;
- ;;;END
- ;;;END
- ;;;END
- ;;;END
- ;;;END
- ;;;END
- ;;;END
- ;;;END
- ;Restore any registers before ending:
- ;;
- popf
- ;Exit to system (DOS). For normal raw COM files, we don't
- ;need INT 21h service AH=4Ch, just a normal RET instruction:
- ;;
- ret
- ;;;INIT
- ;;;INIT
- ;;;INIT: Data/library (right at the end of reachable code)
- ;;;END: Data/library (right at the end of reachable code)
- ;;;END
- ;;;END
- ;It's always nice to align the binary to 16 bytes.
- ;It's necessary for MZ EXEs. But this is a 65536-byte COM executable.
- ;;
- align 16
- ;EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement