; $Id: bs3-cpu-basic-2-template.mac 60445 2016-04-12 08:35:53Z 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 ;********************************************************************************************************************************* ;* External Symbols * ;********************************************************************************************************************************* %undef Bs3Printf BS3_EXTERN_CMN Bs3Printf TMPL_BEGIN_TEXT %if 0 ; Will be doing the testing in C, I think. 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 %endif BS3_PROC_BEGIN_MODE bs3CpuBasic2_Int80 int 80h .again: ud2 jmp .again BS3_PROC_END_MODE bs3CpuBasic2_Int80 BS3_PROC_BEGIN_MODE bs3CpuBasic2_Int81 int 81h .again: ud2 jmp .again BS3_PROC_END_MODE bs3CpuBasic2_Int81 BS3_PROC_BEGIN_MODE bs3CpuBasic2_Int82 int 82h .again: ud2 jmp .again BS3_PROC_END_MODE bs3CpuBasic2_Int82 BS3_PROC_BEGIN_MODE bs3CpuBasic2_Int83 int 83h .again: ud2 jmp .again BS3_PROC_END_MODE bs3CpuBasic2_Int83 BS3_PROC_BEGIN_MODE bs3CpuBasic2_sidt_bx_ud2 sidt [xBX] .again: ud2 jmp .again BS3_PROC_END_MODE bs3CpuBasic2_sidt_bx_ud2 BS3_PROC_BEGIN_MODE bs3CpuBasic2_lidt_bx_ud2 lidt [xBX] .again: ud2 jmp .again BS3_PROC_END_MODE bs3CpuBasic2_lidt_bx_ud2 %include "bs3kit-template-footer.mac" ; reset environment