; $Id: bs3-cpu-basic-2-template.mac 60088 2016-03-18 00:07:33Z vboxsync $ ;; @file ; BS3Kit - bs3-cpu-basic-2 assembly template. ; ; ; Copyright (C) 2007-2016 Oracle Corporation ; ; This file is part of VirtualBox Open Source Edition (OSE), as ; available from http://www.virtualbox.org. This file is free software; ; you can redistribute it and/or modify it under the terms of the GNU ; General Public License (GPL) as published by the Free Software ; Foundation, in version 2 as it comes in the "COPYING" file of the ; VirtualBox OSE distribution. VirtualBox OSE is distributed in the ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. ; ; The contents of this file may alternatively be used under the terms ; of the Common Development and Distribution License Version 1.0 ; (CDDL) only, as it comes in the "COPYING.CDDL" file of the ; VirtualBox OSE distribution, in which case the provisions of the ; CDDL are applicable instead of those of the GPL. ; ; You may elect to license modified versions of this file under the ; terms and conditions of either the GPL or the CDDL or both. ; %include "bs3kit-template-header.mac" ; setup environment %undef Bs3Printf BS3_EXTERN_CMN Bs3Printf BS3_PROC_BEGIN_MODE bs3CpuBasic2_iret BS3_CALL_CONV_PROLOG 1 push xBP mov xBP, xSP sub xSP, 20h %if TMPL_BITS == 64 %if TMPL_BITS == 16 xor ax, ax mov al, [xBP + xCB*2] push ax push cs push .szMsg wrt BS3TEXT16 call Bs3Printf add sp, 6 %else movzx xDX, byte [xBP + xCB*2] push xDX push .szMsg wrt FLAT BS3_CALL Bs3Printf, 2 add xSP, xCB * 2 %endif %endif ; Return xor al, al ;mov al, TMPL_MODE ; remove me mov xSP, xBP pop xBP BS3_CALL_CONV_EPILOG 1 ret .szMsg: db 'hello world %#x!', 13, 10, 0 BS3_PROC_END_MODE bs3CpuBasic2_iret BS3_PROC_BEGIN_MODE bs3CpuBasic2_TssGateEsp_IntXx int 80h nop BS3_PROC_END_MODE bs3CpuBasic2_TssGateEsp_IntXx %include "bs3kit-template-footer.mac" ; reset environment