text stringlengths 1 1.05M |
|---|
.386P
.model FLAT
;
; r_drawa.s
; x86 assembly-language edge clipping and emission code
;
include qasm.inc
include d_if.inc
if id386
; !!! if these are changed, they must be changed in r_draw.c too !!!
FULLY_CLIPPED_CACHED equ 080000000h
FRAMECOUNT_MASK equ 07FFFFFFFh
_DATA SEGMENT
Ld0 dd 0.0
Ld1 dd 0.0
Lstack dd 0
Lfp_near_clip dd NEAR_CLIP
Lceilv0 dd 0
Lv dd 0
Lu0 dd 0
Lv0 dd 0
Lzi0 dd 0
_DATA ENDS
_TEXT SEGMENT
;----------------------------------------------------------------------
; edge clipping code
;----------------------------------------------------------------------
pv0 equ 4+12
pv1 equ 8+12
clip equ 12+12
align 4
public _R_ClipEdge
_R_ClipEdge:
push esi ; preserve register variables
push edi
push ebx
mov ds:dword ptr[Lstack],esp ; for clearing the stack later
; float d0, d1, f;
; mvertex_t clipvert;
mov ebx,ds:dword ptr[clip+esp]
mov esi,ds:dword ptr[pv0+esp]
mov edx,ds:dword ptr[pv1+esp]
; if (clip)
; {
test ebx,ebx
jz Lemit
; do
; {
Lcliploop:
; d0 = DotProduct (pv0->position, clip->normal) - clip->dist;
; d1 = DotProduct (pv1->position, clip->normal) - clip->dist;
fld ds:dword ptr[mv_position+0+esi]
fmul ds:dword ptr[cp_normal+0+ebx]
fld ds:dword ptr[mv_position+4+esi]
fmul ds:dword ptr[cp_normal+4+ebx]
fld ds:dword ptr[mv_position+8+esi]
fmul ds:dword ptr[cp_normal+8+ebx]
fxch st(1)
faddp st(2),st(0) ; d0mul2 | d0add0
fld ds:dword ptr[mv_position+0+edx]
fmul ds:dword ptr[cp_normal+0+ebx]
fld ds:dword ptr[mv_position+4+edx]
fmul ds:dword ptr[cp_normal+4+ebx]
fld ds:dword ptr[mv_position+8+edx]
fmul ds:dword ptr[cp_normal+8+ebx]
fxch st(1)
faddp st(2),st(0) ; d1mul2 | d1add0 | d0mul2 | d0add0
fxch st(3) ; d0add0 | d1add0 | d0mul2 | d1mul2
faddp st(2),st(0) ; d1add0 | dot0 | d1mul2
faddp st(2),st(0) ; dot0 | dot1
fsub ds:dword ptr[cp_dist+ebx] ; d0 | dot1
fxch st(1) ; dot1 | d0
fsub ds:dword ptr[cp_dist+ebx] ; d1 | d0
fxch st(1)
fstp ds:dword ptr[Ld0]
fstp ds:dword ptr[Ld1]
; if (d0 >= 0)
; {
mov eax,ds:dword ptr[Ld0]
mov ecx,ds:dword ptr[Ld1]
or ecx,eax
js Lp2
; both points are unclipped
Lcontinue:
;
; R_ClipEdge (&clipvert, pv1, clip->next);
; return;
; }
; } while ((clip = clip->next) != NULL);
mov ebx,ds:dword ptr[cp_next+ebx]
test ebx,ebx
jnz Lcliploop
; }
;// add the edge
; R_EmitEdge (pv0, pv1);
Lemit:
;
; set integer rounding to ceil mode, set to single precision
;
; FIXME: do away with by manually extracting integers from floats?
; FIXME: set less often
fldcw ds:word ptr[_fpu_ceil_cw]
; edge_t *edge, *pcheck;
; int u_check;
; float u, u_step;
; vec3_t local, transformed;
; float *world;
; int v, v2, ceilv0;
; float scale, lzi0, u0, v0;
; int side;
; if (r_lastvertvalid)
; {
cmp ds:dword ptr[_r_lastvertvalid],0
jz LCalcFirst
; u0 = r_u1;
; v0 = r_v1;
; lzi0 = r_lzi1;
; ceilv0 = r_ceilv1;
mov eax,ds:dword ptr[_r_lzi1]
mov ecx,ds:dword ptr[_r_u1]
mov ds:dword ptr[Lzi0],eax
mov ds:dword ptr[Lu0],ecx
mov ecx,ds:dword ptr[_r_v1]
mov eax,ds:dword ptr[_r_ceilv1]
mov ds:dword ptr[Lv0],ecx
mov ds:dword ptr[Lceilv0],eax
jmp LCalcSecond
; }
LCalcFirst:
; else
; {
; world = &pv0->position[0];
call near ptr LTransformAndProject ; v0 | lzi0 | u0
fst ds:dword ptr[Lv0]
fxch st(2) ; u0 | lzi0 | v0
fstp ds:dword ptr[Lu0] ; lzi0 | v0
fstp ds:dword ptr[Lzi0] ; v0
; ceilv0 = (int)(v0 - 2000) + 2000; // ceil(v0);
fistp ds:dword ptr[Lceilv0]
; }
LCalcSecond:
; world = &pv1->position[0];
mov esi,edx
call near ptr LTransformAndProject ; v1 | lzi1 | u1
fld ds:dword ptr[Lu0] ; u0 | v1 | lzi1 | u1
fxch st(3) ; u1 | v1 | lzi1 | u0
fld ds:dword ptr[Lzi0] ; lzi0 | u1 | v1 | lzi1 | u0
fxch st(3) ; lzi1 | u1 | v1 | lzi0 | u0
fld ds:dword ptr[Lv0] ; v0 | lzi1 | u1 | v1 | lzi0 | u0
fxch st(3) ; v1 | lzi1 | u1 | v0 | lzi0 | u0
; r_ceilv1 = (int)(r_v1 - 2000) + 2000; // ceil(r_v1);
fist ds:dword ptr[_r_ceilv1]
fldcw ds:word ptr[_fpu_chop_cw] ; put back normal floating-point state
fst ds:dword ptr[_r_v1]
fxch st(4) ; lzi0 | lzi1 | u1 | v0 | v1 | u0
; if (r_lzi1 > lzi0)
; lzi0 = r_lzi1;
fcom st(1)
fnstsw ax
test ah,1
jz LP0
fstp st(0)
fld st(0)
LP0:
fxch st(1) ; lzi1 | lzi0 | u1 | v0 | v1 | u0
fstp ds:dword ptr[_r_lzi1] ; lzi0 | u1 | v0 | v1 | u0
fxch st(1)
fst ds:dword ptr[_r_u1]
fxch st(1)
; if (lzi0 > r_nearzi) // for mipmap finding
; r_nearzi = lzi0;
fcom ds:dword ptr[_r_nearzi]
fnstsw ax
test ah,045h
jnz LP1
fst ds:dword ptr[_r_nearzi]
LP1:
; // for right edges, all we want is the effect on 1/z
; if (r_nearzionly)
; return;
mov eax,ds:dword ptr[_r_nearzionly]
test eax,eax
jz LP2
LPop5AndDone:
mov eax,ds:dword ptr[_cacheoffset]
mov edx,ds:dword ptr[_r_framecount]
cmp eax,07FFFFFFFh
jz LDoPop
and edx,offset FRAMECOUNT_MASK
or edx,offset FULLY_CLIPPED_CACHED
mov ds:dword ptr[_cacheoffset],edx
LDoPop:
fstp st(0) ; u1 | v0 | v1 | u0
fstp st(0) ; v0 | v1 | u0
fstp st(0) ; v1 | u0
fstp st(0) ; u0
fstp st(0)
jmp Ldone
LP2:
; // create the edge
; if (ceilv0 == r_ceilv1)
; return; // horizontal edge
mov ebx,ds:dword ptr[Lceilv0]
mov edi,ds:dword ptr[_edge_p]
mov ecx,ds:dword ptr[_r_ceilv1]
mov edx,edi
mov esi,ds:dword ptr[_r_pedge]
add edx,offset et_size
cmp ebx,ecx
jz LPop5AndDone
mov eax,ds:dword ptr[_r_pedge]
mov ds:dword ptr[et_owner+edi],eax
; side = ceilv0 > r_ceilv1;
;
; edge->nearzi = lzi0;
fstp ds:dword ptr[et_nearzi+edi] ; u1 | v0 | v1 | u0
; if (side == 1)
; {
jc LSide0
LSide1:
; // leading edge (go from p2 to p1)
; u_step = ((u0 - r_u1) / (v0 - r_v1));
fsubp st(3),st(0) ; v0 | v1 | u0-u1
fsub st(0),st(1) ; v0-v1 | v1 | u0-u1
fdivp st(2),st(0) ; v1 | ustep
; r_emitted = 1;
mov ds:dword ptr[_r_emitted],1
; edge = edge_p++;
mov ds:dword ptr[_edge_p],edx
; pretouch next edge
mov eax,ds:dword ptr[edx]
; v2 = ceilv0 - 1;
; v = r_ceilv1;
mov eax,ecx
lea ecx,ds:dword ptr[-1+ebx]
mov ebx,eax
; edge->surfs[0] = 0;
; edge->surfs[1] = surface_p - surfaces;
mov eax,ds:dword ptr[_surface_p]
mov esi,ds:dword ptr[_surfaces]
sub edx,edx
sub eax,esi
shr eax,offset SURF_T_SHIFT
mov ds:dword ptr[et_surfs+edi],edx
mov ds:dword ptr[et_surfs+2+edi],eax
sub esi,esi
; u = r_u1 + ((float)v - r_v1) * u_step;
mov ds:dword ptr[Lv],ebx
fild ds:dword ptr[Lv] ; v | v1 | ustep
fsubrp st(1),st(0) ; v-v1 | ustep
fmul st(0),st(1) ; (v-v1)*ustep | ustep
fadd ds:dword ptr[_r_u1] ; u | ustep
jmp LSideDone
; }
LSide0:
; else
; {
; // trailing edge (go from p1 to p2)
; u_step = ((r_u1 - u0) / (r_v1 - v0));
fsub st(0),st(3) ; u1-u0 | v0 | v1 | u0
fxch st(2) ; v1 | v0 | u1-u0 | u0
fsub st(0),st(1) ; v1-v0 | v0 | u1-u0 | u0
fdivp st(2),st(0) ; v0 | ustep | u0
; r_emitted = 1;
mov ds:dword ptr[_r_emitted],1
; edge = edge_p++;
mov ds:dword ptr[_edge_p],edx
; pretouch next edge
mov eax,ds:dword ptr[edx]
; v = ceilv0;
; v2 = r_ceilv1 - 1;
dec ecx
; edge->surfs[0] = surface_p - surfaces;
; edge->surfs[1] = 0;
mov eax,ds:dword ptr[_surface_p]
mov esi,ds:dword ptr[_surfaces]
sub edx,edx
sub eax,esi
shr eax,offset SURF_T_SHIFT
mov ds:dword ptr[et_surfs+2+edi],edx
mov ds:dword ptr[et_surfs+edi],eax
mov esi,1
; u = u0 + ((float)v - v0) * u_step;
mov ds:dword ptr[Lv],ebx
fild ds:dword ptr[Lv] ; v | v0 | ustep | u0
fsubrp st(1),st(0) ; v-v0 | ustep | u0
fmul st(0),st(1) ; (v-v0)*ustep | ustep | u0
faddp st(2),st(0) ; ustep | u
fxch st(1) ; u | ustep
; }
LSideDone:
; edge->u_step = u_step*0x100000;
; edge->u = u*0x100000 + 0xFFFFF;
fmul ds:dword ptr[fp_1m] ; u*0x100000 | ustep
fxch st(1) ; ustep | u*0x100000
fmul ds:dword ptr[fp_1m] ; ustep*0x100000 | u*0x100000
fxch st(1) ; u*0x100000 | ustep*0x100000
fadd ds:dword ptr[fp_1m_minus_1] ; u*0x100000 + 0xFFFFF | ustep*0x100000
fxch st(1) ; ustep*0x100000 | u*0x100000 + 0xFFFFF
fistp ds:dword ptr[et_u_step+edi] ; u*0x100000 + 0xFFFFF
fistp ds:dword ptr[et_u+edi]
; // we need to do this to avoid stepping off the edges if a very nearly
; // horizontal edge is less than epsilon above a scan, and numeric error
; // causes it to incorrectly extend to the scan, and the extension of the
; // line goes off the edge of the screen
; // FIXME: is this actually needed?
; if (edge->u < r_refdef.vrect_x_adj_shift20)
; edge->u = r_refdef.vrect_x_adj_shift20;
; if (edge->u > r_refdef.vrectright_adj_shift20)
; edge->u = r_refdef.vrectright_adj_shift20;
mov eax,ds:dword ptr[et_u+edi]
mov edx,ds:dword ptr[_r_refdef+rd_vrect_x_adj_shift20]
cmp eax,edx
jl LP4
mov edx,ds:dword ptr[_r_refdef+rd_vrectright_adj_shift20]
cmp eax,edx
jng LP5
LP4:
mov ds:dword ptr[et_u+edi],edx
mov eax,edx
LP5:
; // sort the edge in normally
; u_check = edge->u;
;
; if (edge->surfs[0])
; u_check++; // sort trailers after leaders
add eax,esi
; if (!newedges[v] || newedges[v]->u >= u_check)
; {
mov esi,ds:dword ptr[_newedges+ebx*4]
test esi,esi
jz LDoFirst
cmp ds:dword ptr[et_u+esi],eax
jl LNotFirst
LDoFirst:
; edge->next = newedges[v];
; newedges[v] = edge;
mov ds:dword ptr[et_next+edi],esi
mov ds:dword ptr[_newedges+ebx*4],edi
jmp LSetRemove
; }
LNotFirst:
; else
; {
; pcheck = newedges[v];
;
; while (pcheck->next && pcheck->next->u < u_check)
; pcheck = pcheck->next;
LFindInsertLoop:
mov edx,esi
mov esi,ds:dword ptr[et_next+esi]
test esi,esi
jz LInsertFound
cmp ds:dword ptr[et_u+esi],eax
jl LFindInsertLoop
LInsertFound:
; edge->next = pcheck->next;
; pcheck->next = edge;
mov ds:dword ptr[et_next+edi],esi
mov ds:dword ptr[et_next+edx],edi
; }
LSetRemove:
; edge->nextremove = removeedges[v2];
; removeedges[v2] = edge;
mov eax,ds:dword ptr[_removeedges+ecx*4]
mov ds:dword ptr[_removeedges+ecx*4],edi
mov ds:dword ptr[et_nextremove+edi],eax
Ldone:
mov esp,ds:dword ptr[Lstack] ; clear temporary variables from stack
pop ebx ; restore register variables
pop edi
pop esi
ret
; at least one point is clipped
Lp2:
test eax,eax
jns Lp1
; else
; {
; // point 0 is clipped
; if (d1 < 0)
; {
mov eax,ds:dword ptr[Ld1]
test eax,eax
jns Lp3
; // both points are clipped
; // we do cache fully clipped edges
; if (!leftclipped)
mov eax,ds:dword ptr[_r_leftclipped]
mov ecx,ds:dword ptr[_r_pedge]
test eax,eax
jnz Ldone
; r_pedge->framecount = r_framecount;
mov eax,ds:dword ptr[_r_framecount]
and eax,offset FRAMECOUNT_MASK
or eax,offset FULLY_CLIPPED_CACHED
mov ds:dword ptr[_cacheoffset],eax
; return;
jmp Ldone
; }
Lp1:
; // point 0 is unclipped
; if (d1 >= 0)
; {
; // both points are unclipped
; continue;
; // only point 1 is clipped
; f = d0 / (d0 - d1);
fld ds:dword ptr[Ld0]
fld ds:dword ptr[Ld1]
fsubr st(0),st(1)
; // we don't cache partially clipped edges
mov ds:dword ptr[_cacheoffset],07FFFFFFFh
fdivp st(1),st(0)
sub esp,offset mv_size ; allocate space for clipvert
; clipvert.position[0] = pv0->position[0] +
; f * (pv1->position[0] - pv0->position[0]);
; clipvert.position[1] = pv0->position[1] +
; f * (pv1->position[1] - pv0->position[1]);
; clipvert.position[2] = pv0->position[2] +
; f * (pv1->position[2] - pv0->position[2]);
fld ds:dword ptr[mv_position+8+edx]
fsub ds:dword ptr[mv_position+8+esi]
fld ds:dword ptr[mv_position+4+edx]
fsub ds:dword ptr[mv_position+4+esi]
fld ds:dword ptr[mv_position+0+edx]
fsub ds:dword ptr[mv_position+0+esi] ; 0 | 1 | 2
; replace pv1 with the clip point
mov edx,esp
mov eax,ds:dword ptr[cp_leftedge+ebx]
test al,al
fmul st(0),st(3)
fxch st(1) ; 1 | 0 | 2
fmul st(0),st(3)
fxch st(2) ; 2 | 0 | 1
fmulp st(3),st(0) ; 0 | 1 | 2
fadd ds:dword ptr[mv_position+0+esi]
fxch st(1) ; 1 | 0 | 2
fadd ds:dword ptr[mv_position+4+esi]
fxch st(2) ; 2 | 0 | 1
fadd ds:dword ptr[mv_position+8+esi]
fxch st(1) ; 0 | 2 | 1
fstp ds:dword ptr[mv_position+0+esp] ; 2 | 1
fstp ds:dword ptr[mv_position+8+esp] ; 1
fstp ds:dword ptr[mv_position+4+esp]
; if (clip->leftedge)
; {
jz Ltestright
; r_leftclipped = true;
; r_leftexit = clipvert;
mov ds:dword ptr[_r_leftclipped],1
mov eax,ds:dword ptr[mv_position+0+esp]
mov ds:dword ptr[_r_leftexit+mv_position+0],eax
mov eax,ds:dword ptr[mv_position+4+esp]
mov ds:dword ptr[_r_leftexit+mv_position+4],eax
mov eax,ds:dword ptr[mv_position+8+esp]
mov ds:dword ptr[_r_leftexit+mv_position+8],eax
jmp Lcontinue
; }
Ltestright:
; else if (clip->rightedge)
; {
test ah,ah
jz Lcontinue
; r_rightclipped = true;
; r_rightexit = clipvert;
mov ds:dword ptr[_r_rightclipped],1
mov eax,ds:dword ptr[mv_position+0+esp]
mov ds:dword ptr[_r_rightexit+mv_position+0],eax
mov eax,ds:dword ptr[mv_position+4+esp]
mov ds:dword ptr[_r_rightexit+mv_position+4],eax
mov eax,ds:dword ptr[mv_position+8+esp]
mov ds:dword ptr[_r_rightexit+mv_position+8],eax
; }
;
; R_ClipEdge (pv0, &clipvert, clip->next);
; return;
; }
jmp Lcontinue
; }
Lp3:
; // only point 0 is clipped
; r_lastvertvalid = false;
mov ds:dword ptr[_r_lastvertvalid],0
; f = d0 / (d0 - d1);
fld ds:dword ptr[Ld0]
fld ds:dword ptr[Ld1]
fsubr st(0),st(1)
; // we don't cache partially clipped edges
mov ds:dword ptr[_cacheoffset],07FFFFFFFh
fdivp st(1),st(0)
sub esp,offset mv_size ; allocate space for clipvert
; clipvert.position[0] = pv0->position[0] +
; f * (pv1->position[0] - pv0->position[0]);
; clipvert.position[1] = pv0->position[1] +
; f * (pv1->position[1] - pv0->position[1]);
; clipvert.position[2] = pv0->position[2] +
; f * (pv1->position[2] - pv0->position[2]);
fld ds:dword ptr[mv_position+8+edx]
fsub ds:dword ptr[mv_position+8+esi]
fld ds:dword ptr[mv_position+4+edx]
fsub ds:dword ptr[mv_position+4+esi]
fld ds:dword ptr[mv_position+0+edx]
fsub ds:dword ptr[mv_position+0+esi] ; 0 | 1 | 2
mov eax,ds:dword ptr[cp_leftedge+ebx]
test al,al
fmul st(0),st(3)
fxch st(1) ; 1 | 0 | 2
fmul st(0),st(3)
fxch st(2) ; 2 | 0 | 1
fmulp st(3),st(0) ; 0 | 1 | 2
fadd ds:dword ptr[mv_position+0+esi]
fxch st(1) ; 1 | 0 | 2
fadd ds:dword ptr[mv_position+4+esi]
fxch st(2) ; 2 | 0 | 1
fadd ds:dword ptr[mv_position+8+esi]
fxch st(1) ; 0 | 2 | 1
fstp ds:dword ptr[mv_position+0+esp] ; 2 | 1
fstp ds:dword ptr[mv_position+8+esp] ; 1
fstp ds:dword ptr[mv_position+4+esp]
; replace pv0 with the clip point
mov esi,esp
; if (clip->leftedge)
; {
jz Ltestright2
; r_leftclipped = true;
; r_leftenter = clipvert;
mov ds:dword ptr[_r_leftclipped],1
mov eax,ds:dword ptr[mv_position+0+esp]
mov ds:dword ptr[_r_leftenter+mv_position+0],eax
mov eax,ds:dword ptr[mv_position+4+esp]
mov ds:dword ptr[_r_leftenter+mv_position+4],eax
mov eax,ds:dword ptr[mv_position+8+esp]
mov ds:dword ptr[_r_leftenter+mv_position+8],eax
jmp Lcontinue
; }
Ltestright2:
; else if (clip->rightedge)
; {
test ah,ah
jz Lcontinue
; r_rightclipped = true;
; r_rightenter = clipvert;
mov ds:dword ptr[_r_rightclipped],1
mov eax,ds:dword ptr[mv_position+0+esp]
mov ds:dword ptr[_r_rightenter+mv_position+0],eax
mov eax,ds:dword ptr[mv_position+4+esp]
mov ds:dword ptr[_r_rightenter+mv_position+4],eax
mov eax,ds:dword ptr[mv_position+8+esp]
mov ds:dword ptr[_r_rightenter+mv_position+8],eax
; }
jmp Lcontinue
; %esi = vec3_t point to transform and project
; %edx preserved
LTransformAndProject:
; // transform and project
; VectorSubtract (world, modelorg, local);
fld ds:dword ptr[mv_position+0+esi]
fsub ds:dword ptr[_modelorg+0]
fld ds:dword ptr[mv_position+4+esi]
fsub ds:dword ptr[_modelorg+4]
fld ds:dword ptr[mv_position+8+esi]
fsub ds:dword ptr[_modelorg+8]
fxch st(2) ; local[0] | local[1] | local[2]
; TransformVector (local, transformed);
;
; if (transformed[2] < NEAR_CLIP)
; transformed[2] = NEAR_CLIP;
;
; lzi0 = 1.0 / transformed[2];
fld st(0) ; local[0] | local[0] | local[1] | local[2]
fmul ds:dword ptr[_vpn+0] ; zm0 | local[0] | local[1] | local[2]
fld st(1) ; local[0] | zm0 | local[0] | local[1] |
; local[2]
fmul ds:dword ptr[_vright+0] ; xm0 | zm0 | local[0] | local[1] | local[2]
fxch st(2) ; local[0] | zm0 | xm0 | local[1] | local[2]
fmul ds:dword ptr[_vup+0] ; ym0 | zm0 | xm0 | local[1] | local[2]
fld st(3) ; local[1] | ym0 | zm0 | xm0 | local[1] |
; local[2]
fmul ds:dword ptr[_vpn+4] ; zm1 | ym0 | zm0 | xm0 | local[1] |
; local[2]
fld st(4) ; local[1] | zm1 | ym0 | zm0 | xm0 |
; local[1] | local[2]
fmul ds:dword ptr[_vright+4] ; xm1 | zm1 | ym0 | zm0 | xm0 |
; local[1] | local[2]
fxch st(5) ; local[1] | zm1 | ym0 | zm0 | xm0 |
; xm1 | local[2]
fmul ds:dword ptr[_vup+4] ; ym1 | zm1 | ym0 | zm0 | xm0 |
; xm1 | local[2]
fxch st(1) ; zm1 | ym1 | ym0 | zm0 | xm0 |
; xm1 | local[2]
faddp st(3),st(0) ; ym1 | ym0 | zm2 | xm0 | xm1 | local[2]
fxch st(3) ; xm0 | ym0 | zm2 | ym1 | xm1 | local[2]
faddp st(4),st(0) ; ym0 | zm2 | ym1 | xm2 | local[2]
faddp st(2),st(0) ; zm2 | ym2 | xm2 | local[2]
fld st(3) ; local[2] | zm2 | ym2 | xm2 | local[2]
fmul ds:dword ptr[_vpn+8] ; zm3 | zm2 | ym2 | xm2 | local[2]
fld st(4) ; local[2] | zm3 | zm2 | ym2 | xm2 | local[2]
fmul ds:dword ptr[_vright+8] ; xm3 | zm3 | zm2 | ym2 | xm2 | local[2]
fxch st(5) ; local[2] | zm3 | zm2 | ym2 | xm2 | xm3
fmul ds:dword ptr[_vup+8] ; ym3 | zm3 | zm2 | ym2 | xm2 | xm3
fxch st(1) ; zm3 | ym3 | zm2 | ym2 | xm2 | xm3
faddp st(2),st(0) ; ym3 | zm4 | ym2 | xm2 | xm3
fxch st(4) ; xm3 | zm4 | ym2 | xm2 | ym3
faddp st(3),st(0) ; zm4 | ym2 | xm4 | ym3
fxch st(1) ; ym2 | zm4 | xm4 | ym3
faddp st(3),st(0) ; zm4 | xm4 | ym4
fcom ds:dword ptr[Lfp_near_clip]
fnstsw ax
test ah,1
jz LNoClip
fstp st(0)
fld ds:dword ptr[Lfp_near_clip]
LNoClip:
fdivr ds:dword ptr[float_1] ; lzi0 | x | y
fxch st(1) ; x | lzi0 | y
; // FIXME: build x/yscale into transform?
; scale = xscale * lzi0;
; u0 = (xcenter + scale*transformed[0]);
fld ds:dword ptr[_xscale] ; xscale | x | lzi0 | y
fmul st(0),st(2) ; scale | x | lzi0 | y
fmulp st(1),st(0) ; scale*x | lzi0 | y
fadd ds:dword ptr[_xcenter] ; u0 | lzi0 | y
; if (u0 < r_refdef.fvrectx_adj)
; u0 = r_refdef.fvrectx_adj;
; if (u0 > r_refdef.fvrectright_adj)
; u0 = r_refdef.fvrectright_adj;
; FIXME: use integer compares of floats?
fcom ds:dword ptr[_r_refdef+rd_fvrectx_adj]
fnstsw ax
test ah,1
jz LClampP0
fstp st(0)
fld ds:dword ptr[_r_refdef+rd_fvrectx_adj]
LClampP0:
fcom ds:dword ptr[_r_refdef+rd_fvrectright_adj]
fnstsw ax
test ah,045h
jnz LClampP1
fstp st(0)
fld ds:dword ptr[_r_refdef+rd_fvrectright_adj]
LClampP1:
fld st(1) ; lzi0 | u0 | lzi0 | y
; scale = yscale * lzi0;
; v0 = (ycenter - scale*transformed[1]);
fmul ds:dword ptr[_yscale] ; scale | u0 | lzi0 | y
fmulp st(3),st(0) ; u0 | lzi0 | scale*y
fxch st(2) ; scale*y | lzi0 | u0
fsubr ds:dword ptr[_ycenter] ; v0 | lzi0 | u0
; if (v0 < r_refdef.fvrecty_adj)
; v0 = r_refdef.fvrecty_adj;
; if (v0 > r_refdef.fvrectbottom_adj)
; v0 = r_refdef.fvrectbottom_adj;
; FIXME: use integer compares of floats?
fcom ds:dword ptr[_r_refdef+rd_fvrecty_adj]
fnstsw ax
test ah,1
jz LClampP2
fstp st(0)
fld ds:dword ptr[_r_refdef+rd_fvrecty_adj]
LClampP2:
fcom ds:dword ptr[_r_refdef+rd_fvrectbottom_adj]
fnstsw ax
test ah,045h
jnz LClampP3
fstp st(0)
fld ds:dword ptr[_r_refdef+rd_fvrectbottom_adj]
LClampP3:
ret
_TEXT ENDS
endif ;id386
END
|
.386p
.387
include print.dat
assume cs:FLAT,ds:FLAT,es:FLAT,fs:FLAT,gs:FLAT,ss:FLAT
_TEXT segment para use32 public 'CODE'
include print.equ
ini_print proc near
mov dword ptr [iexpld],esi
mov dword ptr [obase],10
mov dword ptr [prmdp],100
mov dword ptr [prmlp],2000
mov dword ptr [prmln],2000
mov dword ptr [prmpk],50
mov dword ptr [nbleft],0
mov dword ptr [nbrig],78
mov ebp,dword ptr [nbrig]
mov dword ptr [maxpocou],ebp
mov eax,256
xor ebx,ebx
call near ptr makestrg
mov dword ptr [bufpn],eax
mov eax,3
mov ebx,offset FLAT:pnmac1436
mov ecx,offset FLAT:eol
mov edx,offset FLAT:zeol
push z_eol
call near ptr inisymb
mov eax,5
mov ebx,offset FLAT:pnmac1437
mov ecx,offset FLAT:llfflush
mov edx,offset FLAT:zllfflush
push z_llfflush
call near ptr inisymb
mov eax,6
mov ebx,offset FLAT:pnmac1438
mov ecx,offset FLAT:upratom
mov edx,offset FLAT:zupratom
push z_upratom
call near ptr inisymb
mov eax,4
mov ebx,offset FLAT:pnmac1439
mov ecx,offset FLAT:prin
mov edx,offset FLAT:zprin
push z_prin
call near ptr inisymb
mov eax,5
mov ebx,offset FLAT:pnmac1440
mov ecx,offset FLAT:print000
mov edx,offset FLAT:zprint000
push z_print000
call near ptr inisymb
mov eax,9
mov ebx,offset FLAT:pnmac1441
mov ecx,offset FLAT:prinflush
mov edx,offset FLAT:zprinflush
push z_prinflush
call near ptr inisymb
mov eax,6
mov ebx,offset FLAT:pnmac1442
mov ecx,offset FLAT:terpri
mov edx,offset FLAT:zterpri
push z_terpri
call near ptr inisymb
mov eax,6
mov ebx,offset FLAT:pnmac1443
mov ecx,offset FLAT:princh
mov edx,offset FLAT:zprinch
push z_princh
call near ptr inisymb
mov eax,6
mov ebx,offset FLAT:pnmac1444
mov ecx,offset FLAT:princod
mov edx,offset FLAT:zprincod
push z_princod
call near ptr inisymb
mov eax,5
mov ebx,offset FLAT:pnmac1445
mov ecx,offset FLAT:fptype
mov edx,offset FLAT:zfptype
push z_fptype
call near ptr inisymb
mov eax,9
mov ebx,offset FLAT:pnmac1446
mov ecx,offset FLAT:prline
mov edx,offset FLAT:zprline
push z_prline
call near ptr inisymb
mov eax,10
mov ebx,offset FLAT:pnmac1447
mov ecx,offset FLAT:prlevel
mov edx,offset FLAT:zprlevel
push z_prlevel
call near ptr inisymb
mov eax,11
mov ebx,offset FLAT:pnmac1448
mov ecx,offset FLAT:prlength
mov edx,offset FLAT:zprlength
push z_prlength
call near ptr inisymb
mov eax,5
mov ebx,offset FLAT:pnmac1449
mov ecx,offset FLAT:fobase
mov edx,offset FLAT:zfobase
push z_fobase
call near ptr inisymb
mov eax,7
mov ebx,offset FLAT:pnmac1450
mov ecx,offset FLAT:lmargin
mov edx,offset FLAT:zlmargin
push z_lmargin
call near ptr inisymb
mov eax,7
mov ebx,offset FLAT:pnmac1451
mov ecx,offset FLAT:rmargin
mov edx,offset FLAT:zrmargin
push z_rmargin
call near ptr inisymb
mov eax,6
mov ebx,offset FLAT:pnmac1452
mov ecx,offset FLAT:outpos
mov edx,offset FLAT:zoutpos
push z_outpos
call near ptr inisymb
mov eax,6
mov ebx,offset FLAT:pnmac1453
mov ecx,offset FLAT:outbuf
mov edx,offset FLAT:zoutbuf
push z_outbuf
call near ptr inisymb
mov eax,7
mov ebx,offset FLAT:pnmac1454
mov ecx,offset FLAT:explode
mov edx,offset FLAT:zexplode
push z_explode
call near ptr inisymb
mov eax,9
mov ebx,offset FLAT:pnmac1455
mov ecx,offset FLAT:explodech
mov edx,offset FLAT:zexplodech
push z_explodech
call near ptr inisymb
mov ebp,dword ptr [zllsystem]
mov dword ptr [cpkgc],ebp
mov eax,14
mov ebx,offset FLAT:pnmac1456
mov ecx,offset FLAT:zstatpr
call near ptr inicst
mov dword ptr [eax],esi
mov eax,15
mov ebx,offset FLAT:pnmac1457
mov ecx,offset FLAT:zstatpc
call near ptr inicst
mov dword ptr [eax],esi
mov eax,18
mov ebx,offset FLAT:pnmac1458
mov ecx,offset FLAT:zstatpk
call near ptr inicst
mov ebp,dword ptr [zt]
mov dword ptr [eax],ebp
mov dword ptr [cpkgc],esi
mov eax,3
mov ebx,offset FLAT:pnmac1459
mov ecx,offset FLAT:zudprs
call near ptr inicst
ret
prpopj label near
ret
prtrue label near
mov eax,dword ptr [zt]
ret
u_print label near
call near ptr probj
call near ptr fullin
ret
flulin label near
push eax
push ebx
push ecx
push edx
mov eax,dword ptr [zllfflush]
mov ebx,esi
call near ptr itsoft
pop edx
pop ecx
pop ebx
pop eax
ret
fullin label near
push eax
push ebx
push ecx
push edx
mov eax,dword ptr [zeol]
mov ebx,esi
call near ptr itsoft
pop edx
pop ecx
pop ebx
pop eax
ret
ini_print endp
eol proc near
call near ptr outlin
mov eax,esi
ret
eol endp
llfflush proc near
cmp dword ptr [iexpld],esi
jne near ptr prtrue
mov ebx,dword ptr [pocour]
or bx,bx
je near ptr prtrue
mov bp,word ptr [maxchan]
cmp word ptr [ostream],bp
jl near ptr fflush1
fflush0 label near
mov eax,dword ptr [bufout]
push ebx
mov dword ptr [pocour],0
call near ptr tystrg
pop dword ptr [pocour]
jmp near ptr fflush3
fflush1 label near
mov eax,dword ptr [pocour]
mov ebp,dword ptr [curoutch]
mov ebp,dword ptr [ebp]
mov ecx,dword ptr [ebp+12]
cmp cx,2
je near ptr fflush2
push ebp
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
add ebp,8
mov dword ptr [crwork],ebp
pop ebp
;; Prepare a C function call with 3 arguments.
push eax
push ebx
push ecx
push edx
push esi
push edi
push dword ptr [crwork]
push eax
push dword ptr [ostream]
call near ptr _outfl
mov dword ptr [crwork],eax
add esp,12
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop eax
;; We are back to Lisp!
mov ebp,dword ptr [crwork]
mov ebx,ebp
jmp near ptr fflush3
fflush2 label near
push ebp
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
add ebp,8
mov dword ptr [crwork],ebp
pop ebp
;; Prepare a C function call with 3 arguments.
push eax
push ebx
push ecx
push edx
push esi
push edi
push dword ptr [crwork]
push eax
push dword ptr [ostream]
call near ptr _outfl
mov dword ptr [crwork],eax
add esp,12
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop eax
;; We are back to Lisp!
mov ebp,dword ptr [crwork]
mov ebx,ebp
fflush3 label near
call near ptr outli2
mov dword ptr [pocour],0
ret
outlin label near
cmp dword ptr [iexpld],esi
jne near ptr expls
mov bp,word ptr [maxchan]
cmp word ptr [ostream],bp
jl near ptr outli1
mov eax,dword ptr [bufout]
mov ebx,dword ptr [pocour]
push ebx
mov dword ptr [pocour],0
call near ptr tystrg
call near ptr tynewln
pop dword ptr [pocour]
jmp near ptr outli2
outli1 label near
mov ebp,dword ptr [curoutch]
mov ebp,dword ptr [ebp]
mov ecx,dword ptr [ebp+12]
cmp cx,2
je near ptr outli11
push ebp
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
add ebp,8
mov dword ptr [crwork],ebp
pop ebp
;; Prepare a C function call with 3 arguments.
push eax
push ebx
push ecx
push edx
push esi
push edi
push dword ptr [crwork]
push dword ptr [pocour]
push dword ptr [ostream]
call near ptr _outfl
mov dword ptr [crwork],eax
add esp,12
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop eax
;; We are back to Lisp!
mov ebp,dword ptr [crwork]
mov ebx,ebp
jmp near ptr outli2
outli11 label near
push ebp
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
add ebp,8
mov dword ptr [crwork],ebp
pop ebp
;; Prepare a C function call with 3 arguments.
push eax
push ebx
push ecx
push edx
push esi
push edi
push dword ptr [crwork]
push dword ptr [pocour]
push dword ptr [ostream]
call near ptr _outf
mov dword ptr [crwork],eax
add esp,12
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop eax
;; We are back to Lisp!
mov ebp,dword ptr [crwork]
mov ebx,ebp
outli2 label near
mov ebx,dword ptr [pocour]
mov eax,dword ptr [bufout]
jmp near ptr outli4
outli3 label near
mov ebp,dword ptr [eax]
mov byte ptr [ebp+ebx+8],32
outli4 label near
dec bx
jge near ptr outli3
mov ebp,dword ptr [nbleft]
mov dword ptr [pocour],ebp
outlret label near
ret
chklp label near
mov bp,word ptr [nbrig]
cmp word ptr [maxpocou],bp
jne near ptr flulin
cmp word ptr [prclp],1
jne near ptr chklp1
mov eax,dword ptr [pocour]
sub ax,3
mov ebx,46
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
mov byte ptr [ebp+eax+8],bl
inc ax
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
mov byte ptr [ebp+eax+8],bl
inc ax
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
mov byte ptr [ebp+eax+8],bl
jmp near ptr probjend
chklp1 label near
dec word ptr [prclp]
jmp near ptr fullin
outch label near
cmp dword ptr [iexpld],esi
jne near ptr explch
push eax
mov eax,dword ptr [pocour]
cmp ax,word ptr [maxpocou]
jl near ptr outch1
call near ptr chklp
mov eax,dword ptr [pocour]
outch1 label near
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
mov byte ptr [ebp+eax+8],dl
inc word ptr [pocour]
pop eax
ret
outsp label near
cmp dword ptr [iexpld],esi
jne near ptr expls
push eax
mov eax,dword ptr [pocour]
cmp ax,word ptr [maxpocou]
jge near ptr outsp1
outsp0 label near
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
mov byte ptr [ebp+eax+8],32
inc word ptr [pocour]
pop eax
ret
outsp1 label near
mov bp,word ptr [nbrig]
cmp word ptr [maxpocou],bp
jne near ptr outsp2
call near ptr chklp
pop eax
ret
outsp2 label near
call near ptr chklp
mov eax,dword ptr [pocour]
jmp near ptr outsp0
outshrp label near
cmp dword ptr [iexpld],esi
jne near ptr explsh
push eax
mov eax,dword ptr [pocour]
inc ax
cmp ax,word ptr [maxpocou]
jl near ptr outshrp1
call near ptr chklp
mov eax,dword ptr [pocour]
inc ax
outshrp1 label near
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
mov byte ptr [ebp+eax+8],dl
dec ax
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
mov byte ptr [ebp+eax+8],35
add word ptr [pocour],2
pop eax
ret
outet label near
mov ebx,dword ptr [prcln]
or bx,bx
jl near ptr outet1
cmp bx,1
je near ptr outddd
outet1 label near
dec word ptr [prcln]
mov edx,38
jmp near ptr outch
outddd label near
mov edx,46
call near ptr outch
call near ptr outch
call near ptr outch
jmp near ptr probjend
pratom label near
mov ebx,dword ptr [prcln]
or bx,bx
jl near ptr pratom1
cmp bx,1
je near ptr outddd
dec word ptr [prcln]
pratom1 label near
push eax
call near ptr gettype
cmp eax,esi
jb near ptr pratom2
cmp eax,edi
jae near ptr pratom2
mov ebx,dword ptr [zprin]
mov ecx,esi
call near ptr getfns
cmp eax,esi
je near ptr pratom2
cmp eax,dword ptr [zprin]
je near ptr pratom2
mov edx,1
jmp near ptr ffuncall
pratom2 label near
pop eax
jmp near ptr upratom
llfflush endp
upratom proc near
cmp eax,esi
jb short lmac1460
cmp eax,edi
jb near ptr prsympk
lmac1460:
cmp dword ptr [bfloat],eax
ja near ptr prfix
cmp dword ptr [bfloat],eax
ja short lmac1461
cmp dword ptr [bvect],eax
ja near ptr prfloat
lmac1461:
cmp dword ptr [bstrg],eax
ja short lmac1462
cmp eax,esi
jb near ptr prstrg
lmac1462:
jmp near ptr prvect
prsympk label near
cmp eax,esi
je near ptr pratnil
mov dword ptr [prcpk],0
mov ecx,dword ptr [zstatpk]
cmp dword ptr [ecx],esi
je near ptr prsymb
prsympk0 label near
mov ecx,dword ptr [12+eax]
cmp ecx,esi
je near ptr prsymb
prsympk1 label near
push eax
mov eax,dword ptr [12+eax]
call near ptr prpkg
pop eax
jmp near ptr prsymb
prpkg label near
push dword ptr [prcpk]
mov ecx,offset FLAT:prpkg0
call near ptr sysprot
pop eax
pop dword ptr [prcpk]
jmp ecx
prpkg0 label near
mov edx,dword ptr [zstatpk]
cmp dword ptr [edx],0
jne near ptr prpkg1
mov edx,dword ptr [zsyscol]
cmp eax,dword ptr [edx]
jne near ptr prpkg1
mov edx,58
jmp near ptr outch
prpkg1 label near
inc word ptr [prcpk]
cmp word ptr [prmpk],0
je near ptr prpkg2
mov bp,word ptr [prmpk]
cmp word ptr [prcpk],bp
jle near ptr prpkg2
jmp near ptr outddd
prpkg2 label near
cmp eax,esi
jb short lmac1463
cmp eax,edi
jb near ptr prpkgsym
lmac1463:
mov edx,58
call near ptr outshrp
call near ptr probj0
mov edx,58
jmp near ptr outch
prpkgsym label near
cmp dword ptr [12+eax],esi
jne near ptr prsympk1
mov edx,58
push offset FLAT:prsymb
jmp near ptr outshrp
prsymb label near
mov ebx,dword ptr [zstatpr]
mov ebx,dword ptr [ebx]
cmp ebx,esi
je near ptr prat2
call near ptr chksymb
cmp ebx,esi
je near ptr prat2
add bx,2
cmp word ptr [prcpk],0
je near ptr prat0
inc bx
prat0 label near
add bx,word ptr [pocour]
cmp bx,word ptr [maxpocou]
jle near ptr prat1
call near ptr chklp
prat1 label near
mov edx,124
call near ptr outch
call near ptr strgsymb
mov dword ptr [savea1],eax
mov ebp,dword ptr [eax]
mov ebx,dword ptr [4+ebp]
xor ecx,ecx
jmp near ptr prat12
prat10 label near
mov ebp,dword ptr [savea1]
mov ebp,dword ptr [ebp]
movzx edx,byte ptr [ebp+ecx+8]
mov ebp,dword ptr [tabch]
mov ebp,dword ptr [ebp]
movzx eax,byte ptr [ebp+edx+8]
cmp ax,13
jne near ptr prat11
call near ptr outch
prat11 label near
call near ptr outch
inc cx
prat12 label near
cmp cx,bx
jne near ptr prat10
mov edx,124
cmp word ptr [prcpk],0
je near ptr outch
call near ptr outch
mov edx,58
jmp near ptr outch
prat2 label near
call near ptr strgsymb
mov ebp,dword ptr [eax]
mov ecx,dword ptr [4+ebp]
mov ebx,ecx
cmp word ptr [prcpk],0
je near ptr prat21
inc bx
prat21 label near
add bx,word ptr [pocour]
cmp bx,word ptr [maxpocou]
jle near ptr prat3
call near ptr chklp
prat3 label near
xor ebx,ebx
mov edx,dword ptr [zstatpc]
mov edx,dword ptr [edx]
cmp edx,esi
jne near ptr prat8
jmp near ptr prathb
prat5 label near
mov ebp,dword ptr [eax]
movzx edx,byte ptr [ebp+ebx+8]
cmp dx,97
jl near ptr prat6
cmp dx,122
jg near ptr prat6
sub edx,32
prat6 label near
call near ptr outch
inc bx
prat8 label near
dec cx
jge near ptr prat5
cmp word ptr [prcpk],0
je near ptr prpopj
mov edx,58
jmp near ptr outch
pratnil label near
mov edx,40
call near ptr outch
mov edx,41
jmp near ptr outch
chksymb label near
push eax
call near ptr strgsymb
mov ebp,dword ptr [eax]
mov ebx,dword ptr [4+ebp]
or bx,bx
je near ptr chksymb9
push ebx
mov ecx,esi
jmp near ptr chksymb3
chksymb0 label near
mov ebp,dword ptr [eax]
movzx edx,byte ptr [ebp+ebx+8]
cmp dx,43
je near ptr chksymb2
cmp dx,45
je near ptr chksymb2
cmp dx,101
je near ptr chksymb2
cmp dx,69
je near ptr chksymb2
cmp dx,48
jl near ptr chksymb1
cmp dx,57
jle near ptr chksymb2
chksymb1 label near
inc cx
chksymb2 label near
mov ebp,dword ptr [tabch]
mov ebp,dword ptr [ebp]
movzx edx,byte ptr [ebp+edx+8]
cmp dx,12
jne near ptr chksymb5
chksymb3 label near
dec bx
jge near ptr chksymb0
cmp ecx,esi
je near ptr chksymb4
add esp,4
mov ebx,esi
pop eax
ret
chksymb4 label near
pop ebx
pop eax
ret
chksymb5 label near
mov ecx,ebx
pop ebx
jmp near ptr chksymb7
chksymb6 label near
mov ebp,dword ptr [eax]
movzx edx,byte ptr [ebp+ecx+8]
mov ebp,dword ptr [tabch]
mov ebp,dword ptr [ebp]
movzx edx,byte ptr [ebp+edx+8]
chksymb7 label near
cmp dx,13
jne near ptr chksymb8
inc bx
chksymb8 label near
dec cx
jge near ptr chksymb6
chksymb9 label near
pop eax
ret
chkstrg label near
mov ebp,dword ptr [eax]
mov ecx,dword ptr [4+ebp]
mov ebx,ecx
or cx,cx
je near ptr chkstrg3
jmp near ptr chkstrg2
chkstrg1 label near
mov ebp,dword ptr [eax]
movzx edx,byte ptr [ebp+ecx+8]
mov ebp,dword ptr [tabch]
mov ebp,dword ptr [ebp]
movzx edx,byte ptr [ebp+edx+8]
cmp dx,11
jne near ptr chkstrg2
inc bx
chkstrg2 label near
dec cx
jge near ptr chkstrg1
chkstrg3 label near
ret
prtypvec label near
mov ebp,dword ptr [zvector]
cmp dword ptr [4+eax],ebp
je near ptr prpopj
mov ebp,dword ptr [zstring000]
cmp dword ptr [4+eax],ebp
je near ptr prpopj
push eax
mov eax,dword ptr [4+eax]
call near ptr prpkg
pop eax
ret
prstrg label near
call near ptr prtypvec
mov ebx,dword ptr [zstatpr]
mov ebx,dword ptr [ebx]
cmp ebx,esi
jne near ptr prstr5
mov ebp,dword ptr [eax]
mov ecx,dword ptr [4+ebp]
mov ebx,ecx
add bx,word ptr [pocour]
cmp bx,word ptr [maxpocou]
jle near ptr prathb
cmp dword ptr [iexpld],esi
jne near ptr prathb
call near ptr chklp
prathb label near
xor ebx,ebx
jmp near ptr prathb4
prathb2 label near
mov ebp,dword ptr [eax]
movzx edx,byte ptr [ebp+ebx+8]
call near ptr outch
inc bx
prathb4 label near
dec cx
jge near ptr prathb2
cmp word ptr [prcpk],0
je near ptr prpopj
mov edx,58
jmp near ptr outch
prstr5 label near
call near ptr chkstrg
add bx,2
add bx,word ptr [pocour]
add bx,2
cmp bx,word ptr [maxpocou]
jle near ptr prstr6
cmp dword ptr [iexpld],esi
jne near ptr prstrg
call near ptr chklp
prstr6 label near
mov edx,34
call near ptr outch
mov dword ptr [savea1],eax
mov ebp,dword ptr [eax]
mov eax,dword ptr [4+ebp]
xor ecx,ecx
prstr60 label near
cmp cx,ax
je near ptr prstr63
mov ebp,dword ptr [savea1]
mov ebp,dword ptr [ebp]
movzx edx,byte ptr [ebp+ecx+8]
mov ebp,dword ptr [tabch]
mov ebp,dword ptr [ebp]
movzx ebx,byte ptr [ebp+edx+8]
cmp bx,11
jne near ptr prstr61
call near ptr outch
prstr61 label near
call near ptr outch
inc cx
jmp near ptr prstr60
prstr63 label near
mov edx,34
jmp near ptr outch
prvect label near
mov ebx,dword ptr [prcdp]
or bx,bx
jle near ptr prvect11
cmp bx,1
jne near ptr prvect1
jmp near ptr outet
prvect1 label near
dec word ptr [prcdp]
prvect11 label near
call near ptr prtypvec
prvectv label near
mov edx,91
call near ptr outshrp
call near ptr prvectin
mov edx,93
jmp near ptr outch
prvectin label near
mov ebp,dword ptr [eax]
mov ebx,dword ptr [4+ebp]
xor ecx,ecx
jmp near ptr prvect6
prvect2 label near
push eax
push ecx
push ebx
mov ebp,dword ptr [eax]
mov eax,dword ptr [ebp+ecx*4+8]
call near ptr probj0
mov edx,dword ptr [esp]
or dx,dx
je near ptr prvect4
call near ptr outsp
prvect4 label near
pop ebx
pop ecx
inc cx
pop eax
prvect6 label near
dec bx
jge near ptr prvect2
prvect9 label near
cmp word ptr [prcdp],0
jle near ptr prvect91
inc word ptr [prcdp]
prvect91 label near
ret
prfloat label near
push eax
mov ecx,dword ptr [bufpn]
push ebp
mov ebp,dword ptr [ecx]
add ebp,8
mov dword ptr [crwork],ebp
pop ebp
;; Prepare a C function call with 1 arguments.
push eax
push ebx
push ecx
push edx
push esi
push edi
push dword ptr [crwork]
push [eax+4]
push [eax]
call near ptr _llrt_cvftoa
mov dword ptr [crwork],eax
add esp,12
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop eax
;; We are back to Lisp!
mov ebx,dword ptr [crwork]
jmp near ptr prnum0
prfix label near
push eax
mov ecx,dword ptr [bufpn]
xor ebx,ebx
push edx
call near ptr getnumi
pop edx
prnum0 label near
mov ecx,ebx
add cx,word ptr [pocour]
cmp cx,word ptr [maxpocou]
jle near ptr prnum1
call near ptr chklp
prnum1 label near
xor eax,eax
jmp near ptr prnum4
prnum3 label near
mov ebp,dword ptr [bufpn]
mov ebp,dword ptr [ebp]
movzx edx,byte ptr [ebp+eax+8]
call near ptr outch
inc ax
prnum4 label near
dec bx
jge near ptr prnum3
pop eax
ret
probj label near
push eax
push offset FLAT:probje
push dword ptr [zprin]
push dword ptr [dlink]
push offset FLAT:unbind3
mov dword ptr [dlink],esp
jmp near ptr probj01
probje label near
pop eax
ret
probjend label near
mov ebx,dword ptr [zprin]
jmp near ptr findtag
probj01 label near
mov ebp,dword ptr [prmlp]
mov dword ptr [prclp],ebp
mov ebx,dword ptr [prmln]
or bx,bx
je near ptr probj02
inc bx
probj02 label near
mov dword ptr [prcln],ebx
mov ebx,dword ptr [prmdp]
or bx,bx
je near ptr probj03
inc bx
probj03 label near
mov dword ptr [prcdp],ebx
probj0 label near
dec _itloop
jz near ptr l___1
l1___1:
cmp word ptr [itcount],0
je short l__1
cmp word ptr [itstate],0
je short l__1
call near ptr ithard
l__1:
cmp dword ptr [bfloat],eax
ja near ptr pratom
cmp dword ptr [bfloat],eax
ja short lmac1464
cmp dword ptr [bvect],eax
ja near ptr pratom
lmac1464:
cmp dword ptr [bfloat],eax
ja short lmac1465
cmp dword ptr [econs],eax
ja near ptr probj0t
lmac1465:
mov eax,dword ptr [zudprs]
jmp near ptr prsymb
probj0t label near
cmp eax,edi
jb near ptr pratom
mov ebx,dword ptr [prcdp]
or bx,bx
jle near ptr probj11
cmp bx,1
jne near ptr probj1
jmp near ptr outet
probj1 label near
dec word ptr [prcdp]
probj11 label near
mov ebp,eax
sub ebp,edi
shr ebp,3
push eax
mov eax,dword ptr [btbin]
bt dword ptr [eax],ebp
pop eax
jnc near ptr probj3
push eax
call near ptr gettype
cmp eax,esi
jb near ptr probj12
cmp eax,edi
jae near ptr probj12
mov ebx,dword ptr [zprin]
mov ecx,esi
call near ptr getfns
cmp eax,dword ptr [zprin]
je near ptr probj12
cmp eax,esi
je near ptr probj12
mov edx,1
jmp near ptr ffuncall
probj12 label near
pop eax
probj2 label near
mov edx,40
call near ptr outshrp
jmp near ptr probj7
probj3 label near
mov ebx,dword ptr [eax]
cmp ebx,dword ptr [zquote]
jne near ptr probj5
mov ebx,dword ptr [4+eax]
cmp ebx,edi
jb near ptr probj5
cmp dword ptr [4+ebx],esi
jne near ptr probj5
mov edx,39
call near ptr outch
mov eax,dword ptr [ebx]
cmp word ptr [prcdp],0
jle near ptr probj4
inc word ptr [prcdp]
probj4 label near
jmp near ptr probj0
probj5 label near
mov edx,40
call near ptr outch
jmp near ptr probj7
probjd label near
mov edx,46
jmp near ptr outch
probj6 label near
call near ptr outsp
probj7 label near
probj8 label near
cmp dword ptr [mstack],esp
ja near ptr errfsp
push dword ptr [4+eax]
mov eax,dword ptr [eax]
call near ptr probj0
pop eax
cmp eax,esi
je near ptr probj9
cmp eax,edi
jb near ptr probjk
mov ebp,eax
sub ebp,edi
shr ebp,3
push eax
mov eax,dword ptr [btbin]
bt dword ptr [eax],ebp
pop eax
jnc near ptr probj6
probjk label near
call near ptr outsp
call near ptr probjd
call near ptr outsp
call near ptr probj0
probj9 label near
mov edx,41
cmp word ptr [prcdp],0
jle near ptr probj91
inc word ptr [prcdp]
probj91 label near
jmp near ptr outch
probjt label near
push offset FLAT:chklp
jmp near ptr probj
upratom endp
prin proc near
call near ptr prinn
ret
prinn label near
or dx,dx
je near ptr prinnr
inc dx
push edx
jmp near ptr prinn1
prinn0 label near
mov eax,dword ptr [zstatpr]
mov eax,dword ptr [eax]
cmp eax,esi
je near ptr prinn1
push edx
push offset FLAT:prinn2
push dword ptr [zprin]
push dword ptr [dlink]
push offset FLAT:unbind3
mov dword ptr [dlink],esp
jmp near ptr outsp
prinn2 label near
pop edx
prinn1 label near
mov eax,dword ptr [esp+edx*4]
push edx
call near ptr probj
pop edx
dec dx
cmp dx,1
jg near ptr prinn0
mov ecx,dword ptr [esp+edx*4]
pop edx
lea esp,dword ptr [esp+edx*4]
jmp ecx
prinnr label near
mov eax,esi
ret
prin endp
print000 proc near
call near ptr prinn
jmp near ptr fullin
print000 endp
prinflush proc near
call near ptr prinn
jmp near ptr flulin
prinflush endp
terpri proc near
mov ebx,dword ptr [zterpri]
cmp dx,1
je near ptr terpr2
mov eax,1
or dx,dx
je near ptr terpr6
jmp near ptr errwna
terpr2 label near
pop eax
cmp dword ptr [bfloat],eax
ja near ptr terpr6
jmp near ptr errnia
terpr5 label near
call near ptr fullin
terpr6 label near
dec ax
jge near ptr terpr5
jmp near ptr prtrue
terpri endp
princh proc near
mov ebx,1
cmp dx,1
je near ptr princh1
cmp dx,2
je near ptr princh2
mov eax,2
mov ebx,dword ptr [zprinch]
jmp near ptr errwna
princh2 label near
pop ebx
princh1 label near
cmp dword ptr [bfloat],ebx
ja near ptr princh3
mov eax,ebx
mov ebx,dword ptr [zprinch]
jmp near ptr errnia
princh3 label near
mov eax,dword ptr [esp]
mov ebp,dword ptr [zprinch]
mov dword ptr [savea4],ebp
call near ptr stringa1
mov ebp,dword ptr [eax]
movzx edx,byte ptr [ebp+8]
call near ptr princr1
pop eax
ret
princr1 label near
mov ebp,dword ptr [prmlp]
mov dword ptr [prclp],ebp
push dword ptr [zprin]
push dword ptr [dlink]
push offset FLAT:unbind3
mov dword ptr [dlink],esp
jmp near ptr princr3
princr2 label near
push ebx
call near ptr outch
pop ebx
princr3 label near
dec bx
jge near ptr princr2
ret
princh endp
princod proc near
mov ebx,1
cmp dx,1
je near ptr princd1
cmp dx,2
je near ptr princd0
mov eax,2
mov ebx,dword ptr [zprincod]
jmp near ptr errwna
princd0 label near
pop ebx
cmp dword ptr [bfloat],ebx
ja near ptr princd1
mov eax,ebx
mov ebx,dword ptr [zprincod]
jmp near ptr errnia
princd1 label near
mov edx,dword ptr [esp]
cmp dword ptr [bfloat],edx
ja near ptr princd2
mov eax,edx
mov ebx,dword ptr [zprincod]
jmp near ptr errnia
princd2 label near
call near ptr princr1
pop eax
ret
princod endp
explode proc near
push dword ptr [lexpld]
push dword ptr [iexpld]
mov ecx,offset FLAT:explode1
call near ptr sysprot
pop eax
pop dword ptr [iexpld]
pop dword ptr [lexpld]
jmp ecx
explode1 label near
mov ebx,esi
cmp dword ptr [fcons],edi
jb near ptr l__2
l1__2:
mov ebp,dword ptr [fcons]
mov dword ptr [ebp],ebx
mov ebx,esi
xchg dword ptr [4+ebp],ebx
xchg dword ptr [fcons],ebx
push ebx
mov dword ptr [lexpld],ebx
mov ebp,dword ptr [zt]
mov dword ptr [iexpld],ebp
call near ptr probj
pop eax
mov eax,dword ptr [4+eax]
ret
explode endp
explodech proc near
call near ptr explode
mov ebx,eax
push eax
push eax
expldech1 label near
cmp ebx,edi
jb near ptr expldech2
mov eax,dword ptr [ebx]
mov dword ptr [esp],ebx
call near ptr fascii
mov ebx,dword ptr [esp]
mov dword ptr [ebx],eax
mov ebx,dword ptr [4+ebx]
jmp near ptr expldech1
expldech2 label near
add esp,4
pop eax
ret
expls label near
push edx
mov edx,32
jmp near ptr explch1
explsh label near
push edx
mov edx,35
call near ptr explch
mov edx,dword ptr [esp]
jmp near ptr explch1
explch label near
push edx
explch1 label near
push ebx
cmp dword ptr [fcons],edi
jb near ptr l__3
l1__3:
mov ebp,dword ptr [fcons]
mov dword ptr [ebp],edx
mov edx,esi
xchg dword ptr [4+ebp],edx
xchg dword ptr [fcons],edx
mov ebx,dword ptr [lexpld]
mov dword ptr [4+ebx],edx
mov dword ptr [lexpld],edx
pop ebx
pop edx
ret
explodech endp
fptype proc near
mov ebx,dword ptr [zfptype]
cmp dx,1
je near ptr ptyp1
cmp dx,2
je near ptr ptyp2
mov eax,2
jmp near ptr errwna
ptyp1 label near
pop eax
cmp eax,esi
jb near ptr ptyper1
cmp eax,edi
jae near ptr ptyper1
movzx eax,word ptr [26+eax]
ret
ptyp2 label near
pop eax
pop ecx
cmp ecx,esi
jb near ptr ptyper1
cmp ecx,edi
jae near ptr ptyper1
mov word ptr [26+ecx],ax
ret
ptyper1 label near
jmp near ptr errsym
ptyper2 label near
mov eax,ecx
jmp near ptr errnia
fptype endp
fobase proc near
mov ebx,dword ptr [zfobase]
mov ecx,dword ptr [obase]
push 2
push 36
call near ptr getsetn
mov dword ptr [obase],eax
ret
fobase endp
prline proc near
mov ebx,dword ptr [zprline]
mov ecx,dword ptr [prmlp]
push 0
push 32767
call near ptr getsetn
mov dword ptr [prmlp],eax
ret
prline endp
prlevel proc near
mov ebx,dword ptr [zprlevel]
mov ecx,dword ptr [prmdp]
push 0
push 32767
call near ptr getsetn
mov dword ptr [prmdp],eax
ret
prlevel endp
prlength proc near
mov ebx,dword ptr [zprlength]
mov ecx,dword ptr [prmln]
push 0
push 32767
call near ptr getsetn
mov dword ptr [prmln],eax
ret
tespos label near
cmp dword ptr [bfloat],eax
jbe near ptr poser2
or ax,ax
jl near ptr poser
cmp ax,word ptr [maxpocou]
jle near ptr prpopj
poser label near
mov ebx,edx
jmp near ptr erroob
poser2 label near
mov ebx,edx
jmp near ptr errnia
prlength endp
lmargin proc near
mov ebx,dword ptr [zlmargin]
mov ecx,dword ptr [nbleft]
push 0
push dword ptr [nbrig]
call near ptr getsetn
mov dword ptr [nbleft],eax
ret
lmargin endp
rmargin proc near
push 1
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
mov ebx,dword ptr [4+ebp]
inc bx
push ebx
mov ebx,dword ptr [zrmargin]
mov ecx,dword ptr [nbrig]
call near ptr getsetn
mov dword ptr [nbrig],eax
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
mov ebx,dword ptr [4+ebp]
cmp ax,bx
jle near ptr rmargin1
mov eax,ebx
rmargin1 label near
mov dword ptr [maxpocou],eax
mov eax,dword ptr [nbrig]
rmargin2 label near
ret
rmargin endp
outpos proc near
mov ebx,dword ptr [zoutpos]
mov ecx,dword ptr [pocour]
push 0
push dword ptr [maxpocou]
call near ptr getsetn
mov dword ptr [pocour],eax
ret
outpos endp
outbuf proc near
or dx,dx
je near ptr outbu1
mov ebx,esi
cmp dx,1
je near ptr outbu5
cmp dx,2
je near ptr outbu4
mov eax,1
mov ebx,dword ptr [zoutbuf]
jmp near ptr errwna
outbu1 label near
mov eax,dword ptr [bufout]
ret
outbu4 label near
pop ebx
outbu5 label near
pop eax
mov edx,dword ptr [zoutbuf]
call near ptr tespos
cmp ebx,esi
je near ptr outbu6
cmp dword ptr [bfloat],ebx
jbe near ptr outbuer
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
mov byte ptr [ebp+eax+8],bl
outbu6 label near
mov ebp,dword ptr [bufout]
mov ebp,dword ptr [ebp]
movzx eax,byte ptr [ebp+eax+8]
ret
outbuer label near
mov eax,ebx
mov ebx,edx
jmp near ptr errnia
l___1:
;; Prepare a C function call with 0 arguments.
push eax
push ebx
push ecx
push edx
push esi
push edi
call near ptr _ll_intest
pop edi
pop esi
pop edx
pop ecx
pop ebx
pop eax
;; We are back to Lisp!
jmp near ptr l1___1
l__3:
call near ptr gccons
jmp near ptr l1__3
l__2:
call near ptr gccons
jmp near ptr l1__2
outbuf endp
_TEXT ends
end
|
// Copyright 2015 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/installer/setup/installer_crash_reporting.h"
#include <iterator>
#include <vector>
#include "base/command_line.h"
#include "base/debug/crash_logging.h"
#include "base/debug/leak_annotations.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/version.h"
#include "base/win/registry.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/installer/setup/installer_crash_reporter_client.h"
#include "chrome/installer/setup/installer_state.h"
#include "chrome/installer/util/google_update_settings.h"
#include "components/crash/content/app/crash_keys_win.h"
#include "components/crash/content/app/crashpad.h"
#include "components/crash/core/common/crash_keys.h"
namespace installer {
namespace {
// Crash Keys
const char kCurrentVersion[] = "current-version";
const char kDistributionType[] = "dist-type";
const char kIsMultiInstall[] = "multi-install";
const char kIsSystemLevel[] = "system-level";
const char kOperation[] = "operation";
const char kStateKey[] = "state-key";
const char *DistributionTypeToString(BrowserDistribution::Type type) {
switch (type) {
case BrowserDistribution::CHROME_BROWSER:
return "chrome browser";
case BrowserDistribution::CHROME_FRAME:
return "chrome frame";
case BrowserDistribution::CHROME_BINARIES:
return "chrome binaries";
case BrowserDistribution::NUM_TYPES:
// Fall out of switch.
break;
}
NOTREACHED();
return "";
}
const char *OperationToString(InstallerState::Operation operation) {
switch (operation) {
case InstallerState::SINGLE_INSTALL_OR_UPDATE:
return "single-install-or-update";
case InstallerState::MULTI_INSTALL:
return "multi-install";
case InstallerState::MULTI_UPDATE:
return "multi-update";
case InstallerState::UNINSTALL:
return "uninstall";
case InstallerState::UNINITIALIZED:
// Fall out of switch.
break;
}
NOTREACHED();
return "";
}
// Retrieve the SYSTEM version of TEMP. We do this instead of GetTempPath so
// that both elevated and SYSTEM runs share the same directory.
bool GetSystemTemp(base::FilePath* temp) {
base::win::RegKey reg_key(
HKEY_LOCAL_MACHINE,
L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment",
KEY_READ);
std::wstring temp_wstring; // presubmit: allow wstring
bool success = reg_key.ReadValue(L"TEMP", &temp_wstring) == ERROR_SUCCESS;
if (success)
*temp = base::FilePath(temp_wstring); // presubmit: allow wstring
return success;
}
} // namespace
void ConfigureCrashReporting(const InstallerState& installer_state) {
// This is inspired by work done in various parts of Chrome startup to connect
// to the crash service. Since the installer does not split its work between
// a stub .exe and a main .dll, crash reporting can be configured in one place
// right here.
// Create the crash client and install it (a la MainDllLoader::Launch).
InstallerCrashReporterClient *crash_client =
new InstallerCrashReporterClient(!installer_state.system_install());
ANNOTATE_LEAKING_OBJECT_PTR(crash_client);
crash_reporter::SetCrashReporterClient(crash_client);
if (installer_state.system_install()) {
base::FilePath temp_dir;
if (GetSystemTemp(&temp_dir)) {
base::FilePath crash_dir = temp_dir.Append(FILE_PATH_LITERAL("Crashpad"));
PathService::OverrideAndCreateIfNeeded(chrome::DIR_CRASH_DUMPS, crash_dir,
true, true);
} else {
// Failed to get a temp dir, something's gone wrong.
return;
}
}
crash_reporter::InitializeCrashpadWithEmbeddedHandler(true,
"Chrome Installer");
// Set up the metrics client id (a la child_process_logging::Init()).
std::unique_ptr<metrics::ClientInfo> client_info =
GoogleUpdateSettings::LoadMetricsClientInfo();
if (client_info)
crash_keys::SetMetricsClientIdFromGUID(client_info->client_id);
}
size_t RegisterCrashKeys() {
const base::debug::CrashKey kFixedKeys[] = {
{ crash_keys::kMetricsClientId, crash_keys::kSmallSize },
{ kCurrentVersion, crash_keys::kSmallSize },
{ kDistributionType, crash_keys::kSmallSize },
{ kIsMultiInstall, crash_keys::kSmallSize },
{ kIsSystemLevel, crash_keys::kSmallSize },
{ kOperation, crash_keys::kSmallSize },
// This is a Windows registry key, which maxes out at 255 chars.
// (kMediumSize actually maxes out at 252 chars on Windows, but potentially
// truncating such a small amount is a fair tradeoff compared to using
// kLargeSize, which is wasteful.)
{ kStateKey, crash_keys::kMediumSize },
};
std::vector<base::debug::CrashKey> keys(std::begin(kFixedKeys),
std::end(kFixedKeys));
crash_keys::GetCrashKeysForCommandLineSwitches(&keys);
return base::debug::InitCrashKeys(keys.data(), keys.size(),
crash_keys::kChunkMaxLength);
}
void SetInitialCrashKeys(const InstallerState& state) {
using base::debug::SetCrashKeyValue;
SetCrashKeyValue(kDistributionType,
DistributionTypeToString(state.state_type()));
SetCrashKeyValue(kOperation, OperationToString(state.operation()));
SetCrashKeyValue(kIsMultiInstall,
state.is_multi_install() ? "true" : "false");
SetCrashKeyValue(kIsSystemLevel, state.system_install() ? "true" : "false");
const base::string16 state_key = state.state_key();
if (!state_key.empty())
SetCrashKeyValue(kStateKey, base::UTF16ToUTF8(state_key));
}
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
crash_keys::SetSwitchesFromCommandLine(command_line, nullptr);
}
void SetCurrentVersionCrashKey(const base::Version* current_version) {
if (current_version) {
base::debug::SetCrashKeyValue(kCurrentVersion,
current_version->GetString());
} else {
base::debug::ClearCrashKey(kCurrentVersion);
}
}
} // namespace installer
|
; A055032: Denominator of (Sum(m^(n-1),m=1..n-1)+1)/n.
; Submitted by Jamie Morken(w1)
; 1,1,1,4,1,3,1,8,9,5,1,12,1,7,15,16,1,9,1,20,7,11,1,24,25,13,27,28,1,15,1,32,33,17,35,36,1,19,13,40,1,21,1,44,45,23,1,48,49,25,51,52,1,27,55,56,19,29,1,60,1,31,63,64,65,33,1,68,69,35,1,72,1,37,25,76,77,39,1,80,81,41,1,84,85,43,87,88,1,45,91,92,31,47,95,96,1,49,99,100
mov $2,$0
seq $0,120490 ; 1 + Sum[ k^(n-1), {k,1,n}].
mov $1,$0
add $2,1
mov $0,$2
gcd $1,$2
div $0,$1
|
;
; Copyright (C) 2008-2020 Advanced Micro Devices, 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:
; 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.
;
include exp_tables.inc
include fm.inc
FN_PROTOTYPE_BAS64 vrda_exp
p_temp equ 0 ; temporary for get/put bits operation
p_temp1 equ 10h ; temporary for get/put bits operation
save_xmm10 equ 20h
save_rsi equ 30h
save_rbx equ 40h
save_rdi equ 50h
stack_size EQU 88h
StackAllocate MACRO size
sub rsp, size
.ALLOCSTACK size
ENDM
text SEGMENT EXECUTE
PUBLIC fname
fname PROC FRAME
StackAllocate stack_size
movdqa OWORD PTR [rsp+save_xmm10],xmm10 ; save save_xmm10
.SAVEXMM128 xmm10, save_xmm10
mov QWORD PTR [rsp+save_rsi],rsi ; save rsi
.SAVEREG rsi, save_rsi
mov QWORD PTR [rsp+save_rbx],rbx ; save rbx
.SAVEREG rbx, save_rbx
mov QWORD PTR [rsp+save_rdi],rdi ; save rdi
.SAVEREG rdi, save_rdi
.ENDPROLOG
mov rdi,rcx
mov rsi, rdx
mov rdx, r8
cmp edi ,00h
jle L__return
cmp rsi ,00h
je L__return
cmp rdx ,00h
je L__return
ALIGN 16
L__process_next2:
sub rdi,02h
cmp rdi,-1
jle L__process_first1
movdqu xmm0, XMMWORD PTR [ rsi + rdi * 8 ]
jmp L__start
ALIGN 16
L__process_first1:
jl L__return ;even all ,elementsare processed rdi == -2
mov rcx,00h
movsd xmm0,QWORD PTR [ rsi + rcx * 8 ]
ALIGN 16
L__start:
movdqa xmm10 ,xmm0; save for later use
; x * (64/ln(2))
movapd xmm1 ,xmm0
mulpd xmm1,L__real_64_by_log2
; n = int( x * (64/ln(2)) )
cvttpd2dq xmm2 ,xmm1;xmm2 = (int)n0,n1
cvtdq2pd xmm1 ,xmm2;xmm1 = (double)n0,n1
movd rcx ,xmm2;rcx = (int)n0,n1
movdqa xmm5 ,xmm2;rcx = (int)n0,n1
movapd xmm2 ,xmm1;xmm2 = (double)n0,n1
; r1 = x - n * ln(2)/64 head
mulpd xmm1,L__log2_by_64_mhead
;j = n & 03fh
mov rax,00000003f0000003fh
and rax ,rcx;rax = j0,j1
mov rbx,rax
shl rax,32
shr rax ,32;rax = j0
shr rbx ,32;rbx = j1
; m = (n - j) / 64
psrad xmm5 ,6;xmm5 = m0 ,m1
; r2 = - n * ln(2)/64 tail
mulpd xmm2 ,L__log2_by_64_mtail;xmm2 = r20,r21
addpd xmm0 ,xmm1
; r1+r2
addpd xmm2 ,xmm0;xmm2 = r
; q = r + r^2*1/2 + r^3*1/6 + r^4 *1/24 + r^5*1/120 + r^6*1/720
; q = r + r*r*(1/2 + r*(1/6+ r*(1/24 + r*(1/120 + r*(1/720)))))
movapd xmm3 ,L__real_1_by_720;xmm3 = 1/720
mulpd xmm3 ,xmm2;xmm3 = r*1/720
movapd xmm0 ,L__real_1_by_6;xmm0 = 1/6
movapd xmm1 ,xmm2;xmm1 = r
mulpd xmm0 ,xmm2;xmm0 = r*1/6
addpd xmm3 ,L__real_1_by_120;xmm3 = 1/120 + (r*1/720)
mulpd xmm1 ,xmm2;xmm1 = r*r
addpd xmm0 ,L__real_1_by_2;xmm0 = 1/2 + (r*1/6)
movapd xmm4 ,xmm1;xmm4 = r*r
mulpd xmm4 ,xmm1;xmm4 = (r*r) * (r*r)
mulpd xmm3 ,xmm2;xmm3 = r * (1/120 + (r*1/720))
mulpd xmm0 ,xmm1;xmm0 = (r*r)*(1/2 + (r*1/6))
addpd xmm3 ,L__real_1_by_24;xmm3 = 1/24 + (r * (1/120 + (r*1/720)))
addpd xmm0 ,xmm2;xmm0 = r + ((r*r)*(1/2 + (r*1/6)))
mulpd xmm3 ,xmm4;xmm3 = ((r*r) * (r*r)) * (1/24 + (r * (1/120 + (r*1/720))))
addpd xmm0 ,xmm3;xmm0 = r + ((r*r)*(1/2 + (r*1/6))) + ((r*r) * (r*r)) * (1/24 + (r * (1/120 + (r*1/720))))
; (f)*(q) + f2 + f1
lea rcx ,L__two_to_jby64_table
lea r11 ,L__two_to_jby64_tail_table
lea r10 ,L__two_to_jby64_head_table
movsd xmm1,QWORD PTR [ rcx + rax * 8 ]
movhpd xmm1,QWORD PTR [ rcx + rbx * 8 ]
mulpd xmm0,xmm1
movsd xmm1,QWORD PTR [ r11 + rax * 8 ]
movhpd xmm1,QWORD PTR [ r11 + rbx * 8 ]
addpd xmm0,xmm1
movsd xmm1,QWORD PTR [ r10 + rax * 8 ]
movhpd xmm1,QWORD PTR [ r10 + rbx * 8 ]
addpd xmm0 ,xmm1
movhlps xmm1 ,xmm0;save higher part
movd rcx ,xmm5;rcx = m0,m1
mov ebx,2;
L__denormal_check:
cmp ecx ,0fffffc02h; -1022
jle L__process_denormal
L__process_normal:
psllq xmm5 ,52
paddq xmm0,xmm5
dec ebx
jz L__ret ;completed processing of the two elements
shr rcx ,32;get m1 to ecx
movlhps xmm1 ,xmm0;save result0
movdqa xmm0 ,xmm1;put higer part for processing
movd xmm5 ,rcx;move m1 to xmm5
jmp L__denormal_check ;repeat for second input
ALIGN 16
L__process_denormal:
jl L__process_true_denormal
ucomisd xmm0,L__real_one
jae L__process_normal
L__process_true_denormal:
; here ( e^r < 1 and m = -1022 ) or m <= -1023
add ecx,1074
mov rax ,1
shl rax,cl
movd xmm2,rax
mulsd xmm0,xmm2
dec ebx
jz L__ret ;completed processing of the two elements
movd rcx,xmm5
shr rcx ,32;get m1 to ecx
movlhps xmm1 ,xmm0;save result0
movdqa xmm0 ,xmm1;put higer part for processing
movd xmm5 ,rcx;move m1 to xmm5
jmp L__denormal_check ;repeat for second input
ALIGN 16
L__ret:
movdqa xmm2 ,xmm0;save result1
movhlps xmm0 ,xmm1;get result0 to correct position
movlhps xmm0 ,xmm2;get result1 to correct position
;;special case for any x < min_exp_arg
;;remove this code if the above code takes care of this
movdqa xmm1 ,XMMWORD PTR L__min_exp_arg
cmpltpd xmm1,xmm10
pand xmm0 ,xmm1;make zeros to put in place of any x < min_exp2_arg
movdqa xmm2,XMMWORD PTR L__denormal_tiny_threshold
cmpltpd xmm2,xmm10
pandn xmm2,xmm1
movdqa xmm1,xmm2
pandn xmm1,xmm0
pand xmm2,XMMWORD PTR L__real_smallest_denormal
por xmm1,xmm2
movdqa xmm0,xmm1
;;special case for any x > max_exp_arg
;;remove this code if the above code takes care of this
movdqa xmm3 ,xmm10
movdqa xmm1 ,XMMWORD PTR L__max_exp_arg
cmpltpd xmm3,xmm1
pand xmm0 ,xmm3
movdqa xmm2 ,XMMWORD PTR L__real_inf;make inf to put in place of any x > max_exp_arg
pandn xmm3,xmm2
por xmm0 ,xmm3
;;special case for any x = nan
;;remove this code if the above code takes care of this
movdqa xmm1 ,xmm10
cmpeqpd xmm10,xmm10
pand xmm0 ,xmm10
addpd xmm1 ,xmm1;make qnan to put in place of any x =nan
pandn xmm10,xmm1
por xmm0,xmm10
cmp rdi,-1
je L__store1
movdqu XMMWORD PTR [ rdx + rdi * 8 ],xmm0
jmp L__process_next2
ALIGN 16
L__store1:
inc rdi
movsd QWORD PTR [ rdx + rdi * 8 ],xmm0
L__return:
movdqa xmm10,OWORD PTR [rsp+save_xmm10] ; restore xmm10
mov rsi,QWORD PTR [rsp+save_rsi] ; restore rsi
mov rbx,QWORD PTR [rsp+save_rbx] ; restore rbx
mov rdi,QWORD PTR [rsp+save_rdi] ; restore rdi
add rsp, stack_size
ret
fname endp
TEXT ENDS
data SEGMENT READ
CONST SEGMENT
ALIGN 16
L__max_exp_arg DQ 040862e42fefa39f0h
DQ 040862e42fefa39f0h ;40862e42fefa39ef40862e42fefa39ef
L__denormal_tiny_threshold DQ 0c0874046dfefd9d0h
DQ 0c0874046dfefd9d0h
L__min_exp_arg DQ 0c0874910d52d3051h
DQ 0c0874910d52d3051h
L__real_64_by_log2 DQ 040571547652b82feh
DQ 040571547652b82feh ; 64/ln(2)
L__log2_by_64_mhead DQ 0bf862e42fefa0000h
DQ 0bf862e42fefa0000h
L__log2_by_64_mtail DQ 0bd1cf79abc9e3b39h
DQ 0bd1cf79abc9e3b39h
L__real_one DQ 03ff0000000000000h
DQ 03ff0000000000000h
L__real_smallest_denormal DQ 00000000000000001h
DQ 00000000000000001h
L__real_inf DQ 07ff0000000000000h
DQ 07ff0000000000000h
CONST ENDS
data ENDS
END
|
; void *obstack_1grow_callee(struct obstack *ob, char c)
SECTION code_clib
SECTION code_alloc_obstack
PUBLIC _obstack_1grow_callee
EXTERN asm_obstack_1grow
_obstack_1grow_callee:
pop af
pop hl
pop bc
push af
jp asm_obstack_1grow
|
;
; Copyright (c) 2008-2012 Stefan Krah. 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 AUTHOR 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 AUTHOR 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.
;
PUBLIC _mpd_div_words
_TEXT SEGMENT
q$ = 8
r$ = 16
hi$ = 24
lo$ = 32
d$ = 40
_mpd_div_words PROC
mov r10, rdx
mov rdx, r8
mov rax, r9
div QWORD PTR d$[rsp]
mov QWORD PTR [r10], rdx
mov QWORD PTR [rcx], rax
ret 0
_mpd_div_words ENDP
_TEXT ENDS
END
|
org 100h
L1: NOP
L2: MOV DX, 0FFFFH
IN AL, DX
MOV CL, AL
L3: MOV DX, 0000H
IN AL, DX
MOV CH, AL
L4: ADD CL, CH
L5: MOV AL, CL
OUT 0FEH, AL
L6: HLT
ret
|
; size_t obstack_object_size(struct obstack *ob)
SECTION code_alloc_obstack
PUBLIC _obstack_object_size
EXTERN asm_obstack_object_size
_obstack_object_size:
pop af
pop hl
push hl
push af
jp asm_obstack_object_size
|
//
// Coypright (c) 2021 Singular Inversions Inc. (facegen.com)
// Use, modification and distribution is subject to the MIT License,
// see accompanying file LICENSE.txt or facegen.com/base_library_license.txt
//
#include "stdafx.h"
#include "FgMetaFormat.hpp"
#include "FgDiagnostics.hpp"
#include "FgTestUtils.hpp"
#include "FgCommand.hpp"
using namespace std;
namespace Fg {
struct AA
{
int a;
AA():a(0){}
template<typename Archive>
void serialize(Archive & ar, unsigned int)
{ ar & BOOST_SERIALIZATION_NVP(a); }
};
template<typename IArchive, typename OArchive>
void
fgTestArchive()
{
AA a;
FGASSERT(a.a == 0);
++a.a;
std::ostringstream os;
{
OArchive oa(os);
oa << BOOST_SERIALIZATION_NVP(a);
}
std::istringstream is(os.str());
{
IArchive ia(is);
ia >> BOOST_SERIALIZATION_NVP(a);
}
FGASSERT(a.a == 1);
}
void
testBoostSer(CLArgs const &)
{
using namespace boost::archive;
fgTestArchive<binary_iarchive,binary_oarchive>();
fgTestArchive<xml_iarchive,xml_oarchive>();
fgTestArchive<text_iarchive,text_oarchive>();
}
void
testMetaFormat(CLArgs const &)
{
TestDir td("MetaFormat");
int a = 42;
saveBsaBin("test.fgbin",a);
int b;
loadBsaBin("test.fgbin",b);
FGASSERT(a == b);
}
using namespace boost::archive;
struct A
{
size_t m0;
FG_SERIALIZE1(m0);
};
template<class ArIn,class ArOut>
struct B
{
size_t m0;
size_t m1;
FG_SER_MIGRATE1(ArIn,m0);
FG_SER_MIGRATE2(ArOut,m0,m1);
};
struct C
{
size_t m0;
size_t m1;
FG_SERIALIZE2(m0,m1);
};
void
testSerialize(CLArgs const &)
{
TestDir td("Serialize");
size_t sz = 5;
vector<A> va(sz);
vector<B<text_iarchive,text_oarchive> > vb;
vector<C> vc;
for (size_t ii=0; ii<sz; ++ii)
va[ii].m0 = ii*ii;
saveBsaText("t0",va);
loadBsaText("t0",vb);
saveBsaText("t1",vb);
loadBsaText("t1",vc);
for (size_t ii=0; ii<sz; ++ii)
FGASSERT(va[ii].m0 == vc[ii].m0);
}
}
// */
|
COMMENT @-----------------------------------------------------------------------
Copyright (c) GeoWorks 1988 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: UserInterface/Gen
FILE: genControl.asm
ROUTINES:
Name Description
---- -----------
GLB GenControlClass Control object
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 10/91 Initial version
DESCRIPTION:
This file contains routines to implement the Interaction class
Interaction with various GCN lists:
ATTACH
- <assert GCBF_IS_ON_ACTIVE_LIST is set>
- if GCBF_ALWAYS_INTERACTABLE then set interactability
- if GCBF_ALWAYS_ON_GCN_LIST then add to GCN lists
DETACH
- DestroyGeneratedUI
- Destroy normal/toolbox UI, remove from active list if on temporarily
SPEC_BUILD / GENERATE_{TOOLBOX}_UI
- Temporarily add to active list if not there already
SPEC_UNBUILD
- DestroyGeneratedUI
- Destroy normal/toolbox UI, remove from active list if on temporarily
SPEC_SET_USABLE
- add object to appropriate lists (active, self-load options, startup
load options)
SPEC_SET_NOT_USABLE
- DestroyGeneratedUI
- Destroy normal/toolbox UI, remove from active list if on temporarily
- remove object from appropriate lists (active, self-load options, startup
load options)
$Id: genControl.asm,v 1.1 97/04/07 11:44:46 newdeal Exp $
-------------------------------------------------------------------------------@
UserClassStructures segment resource
GenControlClass
UserClassStructures ends
;---------------------------------------------------
GCCommon segment resource
DerefVardata proc far uses ax
.enter
mov ax, TEMP_GEN_CONTROL_INSTANCE
call ObjVarDerefData
EC < test {word} ds:[bx].VEDP_dataType, mask VDF_SAVE_TO_STATE >
EC < ERROR_NZ TEMP_INSTANCE_IS_MARKED_SAVE_TO_STATE >
.leave
ret
DerefVardata endp
COMMENT @----------------------------------------------------------------------
FUNCTION: GetDupInfo
DESCRIPTION: Call self to get info
PASS:
*ds:si - gen control object
ss:bp - inherited variables
RETURN:
none
------------------------------------------------------------------------------@
GetDupInfo proc far uses ax, cx, dx, bp
dupinfo local GenControlBuildInfo
.enter inherit far
EC < mov cx, sp >
EC < cmp bp, cx >
EC < ERROR_BE GEN_CONTROL_INTERNAL_ERROR >
; call ourself to get the group to duplicate
mov cx, ss
lea dx, dupinfo ;cx:dx = structure to fill in
EC < push ds, si >
EC < movdw dssi, cxdx >
EC < call ECCheckBounds >
EC < add si, size GenControlBuildInfo-1 >
EC < call ECCheckBounds >
EC < pop ds, si >
mov ax, MSG_GEN_CONTROL_GET_INFO
call ObjCallInstanceNoLock
.leave
ret
GetDupInfo endp
COMMENT @----------------------------------------------------------------------
FUNCTION: LockTableESDI
DESCRIPTION: Lock the table block
PASS:
ss:bp - inherited variables
di - offset of fptr inside dupinfo
RETURN:
es - table block
di - child list
------------------------------------------------------------------------------@
LockTableESDI proc far uses ax, bx
dupinfo local GenControlBuildInfo
.enter inherit far
mov bx, ({dword} dupinfo[di]).segment
call MemLockFixedOrMovable
mov es, ax
mov di, ({dword} dupinfo[di]).offset
.leave
ret
LockTableESDI endp
;---
UnlockTableDI proc far uses bx
dupinfo local GenControlBuildInfo
.enter inherit far
mov bx, ({dword} dupinfo[di]).segment
call MemUnlockFixedOrMovable
.leave
ret
UnlockTableDI endp
;---
GC_SendToSuper proc far
mov di, segment GenControlClass
mov es, di
mov di, offset GenControlClass
GOTO ObjCallSuperNoLock
GC_SendToSuper endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlNotifyWithDataBlock -- MSG_META_NOTIFY_WITH_DATA_BLOCK
for GenControlClass
DESCRIPTION: Handle notification by doing some preprocessing for
the controller object
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
cx.dx - change type ID
bp - handle of block with NotifyTextChange structure
RETURN:
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 12/ 2/91 Initial version
------------------------------------------------------------------------------@
GenControlNotifyWithDataBlock method dynamic GenControlClass,
MSG_META_NOTIFY_WITH_DATA_BLOCK,
MSG_META_NOTIFY
dupinfo local GenControlBuildInfo
mov di, 800
call ThreadBorrowStackSpace
push di
.enter
; look for a recognized change type
push cx
push ax
mov_tr ax, cx ;ax = manufacturer ID
call GetDupInfo
mov cx, dupinfo.GCBI_notificationCount
jcxz sendToSuper
mov di, offset GCBI_notificationList
call LockTableESDI
searchLoop:
cmp ax, es:[di].NT_manuf
jnz next
cmp dx, es:[di].NT_type
jz found
next:
add di, size NotificationType
loop searchLoop
unlockSendToSuper:
mov di, offset GCBI_notificationList
call UnlockTableDI
sendToSuper:
pop ax
pop cx
.leave
pop di
call ThreadReturnStackSpace
GOTO GC_SendToSuper
found:
mov_tr cx, ax ;cx:dx = change type ID
; if this is a null notification from a list other than the list
; which gave us a null notification then ignore it
call DerefVardata
test dupinfo.GCBI_flags, mask GCBF_ALWAYS_UPDATE
jnz notNull
tst <{word} ss:[bp]>
jnz notNull
cmpdw dxcx, ds:[bx].TGCI_activeNotificationList
jnz unlockSendToSuper ;different list, bail out
notNull:
movdw ds:[bx].TGCI_activeNotificationList, dxcx
; OK, we're really updating. We need to update both enable/disable
; status, & the actual data. In the past, we always did this enable/
; disable first, then status. While this worked just fine, it resulted
; in unecessary work caused by enabling the gadgets & then mucking
; with them. By mucking first while disabled, we should be able to
; reduce the overall amount of work, as foucus, mouse grabs, etc
; don't have to be tampered with in this state . -- Doug 1/93
tst <{word} ss:[bp]>
jnz blockPresent
;blockNotPresent:
call EnableDisableCommon ; Disable first,
call UpdateCommon ; then update
jmp unlockSendToSuper
blockPresent:
; Incorrect assumption??? rmsg isn't happy...
; call UpdateCommon ; Update first,
; call EnableDisableCommon ; then enable
call EnableDisableCommon
call UpdateCommon
jmp unlockSendToSuper
GenControlNotifyWithDataBlock endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EnableDisableCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Perform enable/disable update portion of
GenControlNotifyWithDataBlock
CALLED BY: INTERNAL
GenControlNotifyWithDataBlock
PASS: *ds:si - GenControl object
ss:bp - GenControlBuildInfo
RETURN: nothing
DESTROYED: ax, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 1/93 Pulled out into seperate routine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
EnableDisableCommon proc near
class GenControlClass
.enter inherit GenControlNotifyWithDataBlock
push cx, dx
; set enabled or not depending of whether a block was passed
mov di, ds:[si]
add di, ds:[di].Gen_offset
mov al, ds:[di].GI_states ;not current enabled state
mov cx, MSG_GEN_SET_ENABLED
tst <{word} ss:[bp]>
jnz common
xor al, mask GS_ENABLED
mov cx, MSG_GEN_SET_NOT_ENABLED
common:
test dupinfo.GCBI_flags, mask GCBF_CUSTOM_ENABLE_DISABLE
jnz forceIt
test al, mask GS_ENABLED ;if no state change then
jnz afterEnable ;bail
forceIt:
mov dl, VUM_NOW
push bp
mov ax, MSG_GEN_CONTROL_ENABLE_DISABLE
call ObjCallInstanceNoLock
pop bp
afterEnable:
pop cx, dx
.leave
ret
EnableDisableCommon endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UpdateCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Description
CALLED BY: INTERNAL
GenControlNotifyWithDataBlock
PASS: *ds:si - GenControl object
ss:bp - GenControlBuildInfo
cx - manufacturer
dx - change type
RETURN: nothing
DESTROYED: ax, bx, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 1/93 Pulled out into seperate routine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UpdateCommon proc near
class GenControlClass
.enter inherit GenControlNotifyWithDataBlock
test dupinfo.GCBI_flags, mask GCBF_ALWAYS_UPDATE
jnz sendUpdate
tst <{word} ss:[bp]>
jz noUpdate
sendUpdate:
push cx, dx, bp
; push parameters for MSG_GEN_CONTROL_UPDATE_UI
call DerefVardata
; Save off state of interactableFlags at this update, so that
; we can avoid redundant updates should the gadgets become not
; interactable, then interactable again, before another update.
;
mov ax, ds:[bx].TGCI_interactableFlags
mov ds:[bx].TGCI_upToDate, ax
; Get GenControlInteractableFlags, so that we can figure out whether
; to pass actual features available, or NULL, indicating none of
; them need updating.
;
test dupinfo.GCBI_flags, mask GCBF_ALWAYS_UPDATE
jnz 10$
mov ax, ds:[bx].TGCI_childBlock
ornf ax, ds:[bx].TGCI_toolBlock
jz abortUpdate
10$:
mov di, ds:[bx].TGCI_interactableFlags
mov ax, ds:[bx].TGCI_toolboxFeatures ;toolbox features
test di, mask GCIF_TOOLBOX_UI
jnz haveToolBoxFeaturesToUpdate
clr ax
haveToolBoxFeaturesToUpdate:
test di, mask GCIF_NORMAL_UI
mov di, ds:[bx].TGCI_features ;toolbox features
jnz haveNormalFeaturesToUpdate
clr di
haveNormalFeaturesToUpdate:
test dupinfo.GCBI_flags, mask GCBF_ALWAYS_UPDATE
jnz doUpdate
tst ax ;if toolbox features visible
jnz doUpdate ;then update
tst di
jz abortUpdate
doUpdate:
push ds:[bx].TGCI_toolBlock
push ds:[bx].TGCI_childBlock ;child block
push ax ;toolbox features to update
push di ;normal features to update
push ss:[bp] ;data block
push dx ;change type
push cx ;manufacturer
mov bp, sp
mov ax, MSG_GEN_CONTROL_UPDATE_UI
call ObjCallInstanceNoLock
add sp, size GenControlUpdateUIParams
abortUpdate:
pop cx, dx, bp
noUpdate:
.leave
ret
UpdateCommon endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlEnableDisable -- MSG_GEN_CONTROL_ENABLE_DISABLE
for GenControlClass
DESCRIPTION: Enable or disable the controller pieces that are interactable
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
cx - message: MSG_GEN_SET_ENABLED or MSG_GEN_SET_NOT_ENABLED
dl - VisualUpdateMode
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/20/91 Initial version
------------------------------------------------------------------------------@
GenControlEnableDisable method dynamic GenControlClass,
MSG_GEN_CONTROL_ENABLE_DISABLE
; if this controller is marked as having custom enable/disable
; behavior then bail
push ax, cx, dx
call GetControllerFlags
test ax, mask GCBF_CUSTOM_ENABLE_DISABLE
jnz afterController
; get GenControlInteractableFlags, in di
call DerefVardata
mov di, ds:[bx].TGCI_interactableFlags
mov_tr ax, cx ; get enable/disable message in ax
; Update enable/disable status for controller object itself. Since
; enable/disable is hierarchical, and the normal UI is generically
; below the controller, we'll need to do this if either the
; controller itself or the normal UI is interactable. -- Doug
;
test di, mask GCIF_CONTROLLER or mask GCIF_NORMAL_UI \
or mask GCIF_TOOLBOX_UI
jz afterController
call ObjCallInstanceNoLock ; enable/disable ourself
afterController:
pop ax, cx, dx
call SendToSuperIfFlagSet
ret
GenControlEnableDisable endm
COMMENT @----------------------------------------------------------------------
FUNCTION: GenControlSendToOutputStack
DESCRIPTION: Utility routine to send a message to the output of a
controller.
CALLED BY: INTERNAL
PASS:
*ds:si - object
ax - message
ss:bp - data
dx - data size
bx:di - class
RETURN:
none
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/11/91 Initial version
------------------------------------------------------------------------------@
GenControlSendToOutputStack proc far
clc
jmp OutputStackCommon
GenControlSendToOutputStack endp
COMMENT @----------------------------------------------------------------------
FUNCTION: GenControlSendToOutputStack
DESCRIPTION: Utility routine to send a message to the output of a
controller.
CALLED BY: INTERNAL
PASS:
*ds:si - object
ax - message
cx, dx, bp - data
bx:di - class
RETURN:
none
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/11/91 Initial version
------------------------------------------------------------------------------@
GenControlSendToOutputRegs proc far
clc
jmp OutputRegsCommon
GenControlSendToOutputRegs endp
COMMENT @----------------------------------------------------------------------
FUNCTION: GenControlOutputActionStack
DESCRIPTION: Utility routine to call MSG_GEN_OUTPUT_ACTION. This is used
when a controller needs to send out an action. This handles
GenAttrs such as GA_SIGNAL_INTERACTION_COMPLETE,
GA_INITIATES_BUSY_STATE and GA_INITIATES_INPUT_HOLD_UP.
CALLED BY: INTERNAL
PASS:
*ds:si - object
ax - message
ss:bp - data
dx - data size
bx:di - class
RETURN:
none
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/11/91 Initial version
------------------------------------------------------------------------------@
GenControlOutputActionStack proc far
stc
OutputStackCommon label far
push di, bp
push si
mov si, di
mov di, mask MF_RECORD or mask MF_STACK
jmp OutputActionCommon
GenControlOutputActionStack endp
COMMENT @----------------------------------------------------------------------
FUNCTION: GenControlOutputActionRegs
DESCRIPTION: Utility routine to call MSG_GEN_OUTPUT_ACTION. This is used
when a controller needs to send out an action. This handles
GenAttrs such as GA_SIGNAL_INTERACTION_COMPLETE,
GA_INITIATES_BUSY_STATE and GA_INITIATES_INPUT_HOLD_UP.
CALLED BY: INTERNAL
PASS:
*ds:si - object
ax - message
cx, dx, bp - data
bx:di - class
RETURN:
none
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/11/91 Initial version
------------------------------------------------------------------------------@
GenControlOutputActionRegs proc far
stc
OutputRegsCommon label far
push di, bp
push si
mov si, di
mov di, mask MF_RECORD
; carry - set if action
OutputActionCommon label far
class GenControlClass
pushf
call ObjMessage ;di = event handle
popf
mov bp, di
pop si
EC < pushf >
EC < push es >
EC < mov di, segment GenControlClass >
EC < mov es, di >
EC < mov di, offset GenControlClass >
EC < call ObjIsObjectInClass >
EC < ERROR_NC ROUTINE_REQUIRES_GEN_CONTROL_OBJECT_AS_INPUT >
EC < pop es >
EC < popf >
push ax, cx, dx
pushf
jnc 10$
call GenProcessGenAttrsBeforeAction
10$:
mov di, ds:[si]
add di, ds:[di].Gen_offset
movdw cxdx, ds:[di].GCI_output
mov ax, MSG_GEN_OUTPUT_ACTION
call ObjCallInstanceNoLock
popf
jnc 20$
call GenProcessGenAttrsAfterAction
20$:
pop ax, cx, dx
pop di, bp
ret
GenControlOutputActionRegs endp
COMMENT @----------------------------------------------------------------------
FUNCTION: GetControllerFlags
DESCRIPTION: Get the controller flags for this controller
CALLED BY: INTERNAL
PASS:
*ds:si - GenControl object
RETURN:
ax - GenControlBuildFlags
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 10/27/92 Initial version
------------------------------------------------------------------------------@
GetControllerFlags proc far
dupinfo local GenControlBuildInfo
.enter
call GetDupInfo
mov ax, dupinfo.GCBI_flags
.leave
ret
GetControllerFlags endp
COMMENT @----------------------------------------------------------------------
FUNCTION: SendToSuperIfFlagSet
DESCRIPTION: Send the message to the superclass if needed
CALLED BY: INTERNAL
PASS:
*ds:si - GenControl object
ax - message
cx, dx, bp - data
RETURN:
from message
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 10/27/92 Initial version
------------------------------------------------------------------------------@
SendToSuperIfFlagSet proc far
push ax
call GetControllerFlags
test ax, mask GCBF_SPECIFIC_UI
pop ax
jz exit
call GC_SendToSuper
exit:
ret
SendToSuperIfFlagSet endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlPreApply -- MSG_GEN_PRE_APPLY for GenControlClass
DESCRIPTION: Handle pre-apply by sending a suspend if the controller
has the GCBF_SUSPEND_ON_APPLY flag set
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
carry - set to abort apply
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/23/92 Initial version
------------------------------------------------------------------------------@
GenControlPreApply method dynamic GenControlClass, MSG_GEN_PRE_APPLY
mov di, MSG_META_SUSPEND
FALL_THRU SuspendUnsuspendCommon
GenControlPreApply endm
;---
SuspendUnsuspendCommon proc far
dupinfo local GenControlBuildInfo
.enter
push ax
call GetDupInfo
test dupinfo.GCBI_flags, mask GCBF_SUSPEND_ON_APPLY
jz noSuspend
mov_tr ax, di
clrdw bxdi ;no class (Meta message)
call GenControlSendToOutputRegs
noSuspend:
pop ax
.leave
GOTO GC_SendToSuper
SuspendUnsuspendCommon endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlPostApply -- MSG_GEN_POST_APPLY for GenControlClass
DESCRIPTION: Handle post-apply by sending an unsuspend if the controller
has the GCBF_SUSPEND_ON_APPLY flag set
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/23/92 Initial version
------------------------------------------------------------------------------@
GenControlPostApply method dynamic GenControlClass, MSG_GEN_POST_APPLY
mov di, MSG_META_UNSUSPEND
GOTO SuspendUnsuspendCommon
GenControlPostApply endm
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlSetEnabled
-- MSG_GEN_SET_ENABLED for GenControlClass
-- MSG_GEN_SET_NOT_ENABLED for GenControlClass
DESCRIPTION: Handle the controller being set enabled/not enabled.
Performs default behavior, then deals with tool group
specially, by setting it enabled/not enabled based on
controller status. This is necessary because the tool group
is unrelated generically to the controller -- it is not a
direct child, & is not even a child having a one-way pointer
up to the controller -- it is just somewhere else in the
generic tree, so we control its enabled status directly.
-- Doug
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
dl - VisUpdateMode
dh - NotifyEnabledFlags
RETURN: carry set if visual change occurred
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/31/92 Initial version
Doug 12/29/92 Changed to base off fully enabled status
------------------------------------------------------------------------------@
GenControlSetEnabled method dynamic GenControlClass,
MSG_GEN_SET_ENABLED,
MSG_GEN_SET_NOT_ENABLED,
MSG_GEN_NOTIFY_NOT_ENABLED,
MSG_GEN_NOTIFY_ENABLED
; This is still not right - if becoming fully enabled becuase of
; something further up tree, won't get called.
;
push dx
mov di, offset GenControlClass
call ObjCallSuperNoLock
pop dx
pushf
call GenControlUpdateToolEnableStatus
popf
ret
GenControlSetEnabled endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlUpdateToolEnableStatus
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Description
CALLED BY: INTERNAL
PASS: *ds:si - GenControl object
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 9/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlUpdateToolEnableStatus proc near
uses ax, bx, cx, dx, bp, si, di
.enter
; If we have any tools, set them enabled/disabled now based on our own
; status.
;
;
call DerefVardata
mov di, ds:[bx].TGCI_toolParent.chunk
mov bx, ds:[bx].TGCI_toolParent.handle
tst bx
jz afterTools
mov cx, -1 ; no shortcuts
call GenCheckIfFullyEnabled ; are we fully enabled?
mov ax, MSG_GEN_SET_ENABLED
jc fullyEnabled
.assert (MSG_GEN_SET_NOT_ENABLED - MSG_GEN_SET_ENABLED) eq 1
inc ax ; if not fully enabled, use NOT msg
fullyEnabled:
mov_tr si, di ; get tool parent in ^lbx:si
clr di
call ObjMessage
afterTools:
.leave
ret
GenControlUpdateToolEnableStatus endp
GCCommon ends
;---
GCBuild segment resource
AddOrRemoveActiveListEntry proc far
mov cx, MANUFACTURER_ID_GEOWORKS
mov dx, MGCNLT_ACTIVE_LIST or mask GCNLTF_SAVE_TO_STATE
FALL_THRU AddOrRemoveListEntry
AddOrRemoveActiveListEntry endp
COMMENT @----------------------------------------------------------------------
FUNCTION: AddOrRemoveListEntry
DESCRIPTION: Add or remove an object to a GCN list
CALLED BY: INTERNAL
PASS:
ax - messsage (MSG_META_GCN_LIST_ADD or MSG_META_GCN_LIST_REMOVE)
bxsi - object
cxdx - GCN list
RETURN:
none
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 8/19/92 Initial version
------------------------------------------------------------------------------@
AddOrRemoveListEntry proc far uses ax, cx, dx, bp
.enter
sub sp, size GCNListParams
mov bp, sp
mov ss:[bp].GCNLP_ID.GCNLT_manuf, cx
mov ss:[bp].GCNLP_ID.GCNLT_type, dx
movdw ss:[bp].GCNLP_optr, bxsi
mov dx, size GCNListParams
call GenCallApplication
add sp, size GCNListParams
.leave
ret
AddOrRemoveListEntry endp
GC_ObjMessageFixupDS proc near
push di
mov di, mask MF_FIXUP_DS
call GC_ObjMessage
pop di
ret
GC_ObjMessageFixupDS endp
;---
GC_ObjMessage proc near
call ObjMessage
ret
GC_ObjMessage endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlAddToGCNLists
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Add ourselves to any GCN lists we should be on
PASS: *ds:si - instance data
ds:di - ptr to start of master instance data
es - segment of class
ax - MSG_GEN_CONTROL_ADD_TO_GCN_LISTS
RETURN: nothing
ALLOWED TO DESTROY:
bx, si, di, ds, es
PSEUDO CODE/STRATEGY/KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 11/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlAddToGCNLists method dynamic GenControlClass,
MSG_GEN_CONTROL_ADD_TO_GCN_LISTS
push ax, es
mov ax, MSG_META_GCN_LIST_ADD
call AddToGCNLists
pop ax, es
call SendToSuperIfFlagSet
ret
GenControlAddToGCNLists endm
;---
; ax = message
AddToGCNLists proc far
dupinfo local GenControlBuildInfo
.enter
call GetDupInfo
mov cx, dupinfo.GCBI_gcnCount
jcxz done
mov di, offset GCBI_gcnList
call LockTableESDI ;es = table
; es:di = list, cx = count, ax = message
push bp
sub sp, size GCNListParams ; create stack frame
mov bp, sp
gcnLoop:
push cx
mov cx, es:[di].GCNLT_manuf
mov dx, es:[di].GCNLT_type
mov bx, ds:[LMBH_handle]
call AddOrRemoveListEntry
pop cx
add di, size GCNListType
loop gcnLoop
add sp, size GCNListParams ; fix stack
pop bp
mov di, offset GCBI_gcnList
call UnlockTableDI
done:
.leave
ret
AddToGCNLists endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlAttach -- MSG_META_ATTACH for GenControlClass
DESCRIPTION: Load options saved in the .ini file
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/21/91 Initial version
------------------------------------------------------------------------------@
GenControlAttach method dynamic GenControlClass, MSG_META_ATTACH,
MSG_SPEC_SET_USABLE
dupinfo local GenControlBuildInfo
ForceRef dupinfo
EC < call EnsureOnAppropriateLists >
call EnsureOptionsLoaded
call GC_SendToSuper
.enter
call GetDupInfo
mov di, dupinfo.GCBI_flags
; if this controller always needs to get updates then add it to the
; GCN list
test di, mask GCBF_ALWAYS_INTERACTABLE
jz noGCN
push bp
mov ax, MSG_GEN_CONTROL_NOTIFY_INTERACTABLE
mov cx, mask GCIF_CONTROLLER
call ObjCallInstanceNoLock
pop bp
noGCN:
; if this controller always needs to be on the GCN lists then do so
test di, mask GCBF_ALWAYS_ON_GCN_LIST
jz notAlwaysGCN
push bp
mov ax, MSG_GEN_CONTROL_ADD_TO_GCN_LISTS
call ObjCallInstanceNoLock
pop bp
notAlwaysGCN:
.leave
ret
GenControlAttach endm
COMMENT @----------------------------------------------------------------------
ROUTINE: EnsureOptionsLoaded
DESCRIPTION: Load options saved in the .ini file
PASS:
*ds:si - instance data
es - segment of GenControlClass
RETURN:
DESTROYED:
nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 7/10/92 Initial version
doug 7/31/92 Pulled guts out to be handler for
MSG_META_LOAD_OPTIONS
------------------------------------------------------------------------------@
EnsureOptionsLoaded proc far uses ax, bx, cx, dx, bp
.enter
mov ax, TEMP_GEN_CONTROL_OPTIONS_LOADED or mask VDF_SAVE_TO_STATE
call ObjVarFindData
jc done
clr cx
call ObjVarAddData
mov ax, MSG_META_LOAD_OPTIONS
call ObjCallInstanceNoLock
done:
.leave
ret
EnsureOptionsLoaded endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlInteractable
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: One or more areas of the Controller have become
interactable. Add ourself to notification list(s)
PASS: *ds:si - instance data
ds:di - ptr to start of master instance data
es - segment of class
ax - MSG_GEN_CONTROL_NOTIFY_INTERACTABLE
cx - GenControlInteractableFlags indicating which area
has become interactable
RETURN: nothing
ALLOWED TO DESTROY:
bx, si, di, ds, es
PSEUDO CODE/STRATEGY/KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 11/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlInteractable method dynamic GenControlClass,
MSG_GEN_CONTROL_NOTIFY_INTERACTABLE
dupinfo local GenControlBuildInfo
.enter
call DerefVardata
; get "up to date" flags
mov ax, ds:[bx].TGCI_upToDate
not ax ; get areas NOT up to date
and ax, cx ; get bits representing new areas
; that need to be updated
tst ds:[bx].TGCI_interactableFlags
jnz alreadyOnActiveList
; The controller is becoming interactable, so add it to the active
; list.
call GetDupInfo
test dupinfo.GCBI_flags, mask GCBF_IS_ON_ACTIVE_LIST
jnz alreadyOnActiveList ; always on active list, no
; need to add it again
push ax, cx
mov ax, MSG_META_GCN_LIST_ADD
mov bx, ds:[LMBH_handle]
call AddOrRemoveActiveListEntry
pop ax, cx
call DerefVardata
alreadyOnActiveList:
tst ax ; see if any new areas to update
jz done
; Save new combined interactable flags for a moment while we fake the
; flags in order to update only those things that have just become
; interactable:
;
push ds:[bx].TGCI_interactableFlags
mov ds:[bx].TGCI_interactableFlags, ax
; Always add ourselves to the notification lists -- if we weren't on
; them before, we need to be now. If we were already on them, we
; still need to force a notification update, so that we can fix up
; the new UI areas to reflect current state. Re-adding an optr
; to a notification list results in the status for that list being
; sent out again to the optr.
push cx, bp
mov ax, MSG_GEN_CONTROL_ADD_TO_GCN_LISTS
call ObjCallInstanceNoLock
pop cx, bp
; Restore interactable flags to new, combined value, so that gadetry
; will correctly be updated next time the status changes for real.
;
call DerefVardata
pop ds:[bx].TGCI_interactableFlags
done:
or ds:[bx].TGCI_interactableFlags, cx
.leave
ret
GenControlInteractable endm
COMMENT @----------------------------------------------------------------------
FUNCTION: DestroyBXSI
DESCRIPTION: Destroy an object
CALLED BY: INTERNAL
PASS:
^lbx:si - object to destroy
ss:bp - inherited variables
RETURN:
none
DESTROYED:
si
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 4/24/92 Initial version
------------------------------------------------------------------------------@
DestroyBXSI proc near uses ax, cx, dx, di, ds
dupinfo local GenControlBuildInfo
class GenControlClass
.enter inherit far
tst si ;check for null object 10/29/93 cbh
jz exit
EC < call ECCheckLMemOD >
push bx
call ObjLockObjBlock
mov ds, ax
; first see if this object is linked to any others that are part of
; the same feature. We will follow the linked list, nuking features
; until
nukeLinkedFeatureLoop:
mov ax, ATTR_GEN_FEATURE_LINK
call ObjVarFindData
jnc noLinkedObjects
push ds:[bx] ;save link
call DestroyDSSIHereAndNow
pop si
jmp nukeLinkedFeatureLoop
noLinkedObjects:
call DestroyDSSIHereAndNow
pop bx
call MemUnlock
exit:
.leave
ret
DestroyBXSI endp
COMMENT @----------------------------------------------------------------------
FUNCTION: DestroyDSSIHereAndNow
DESCRIPTION: Destroy a object *FAST*
CALLED BY: INTERNAL
PASS:
*ds:si - object to destroy
ss:bp - inherited variables
RETURN:
none
DESTROYED:
ax, cx, dx, si, di
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 4/24/92 Initial version
------------------------------------------------------------------------------@
DestroyDSSIHereAndNow proc near
dupinfo local GenControlBuildInfo
class GenControlClass
.enter inherit far
push bp
; see if we're allowed to use our boffo optimized way of doing
; things
test dupinfo.GCBI_flags, mask GCBF_USE_GEN_DESTROY
jnz useGenDestroy
; can optimize, go for it -- Note that it is legal to push/pop ds
; here for two reasons:
; 1) All we do is LMemFree which does not move anything
; 2) DS points at a different block (the controller block)
; remove us from our parent -- we do it directly knowing that it
; is in the same block
mov cx, ds:[LMBH_handle]
mov dx, si ;cx:dx = ourself
mov bx, Gen_offset
mov di, offset GI_link
call ObjLinkFindParent ;bx:si = parent
tst si
jz noParent
EC < cmp bx, ds:[LMBH_handle] >
EC < ERROR_NZ GEN_CONTROL_INTERNAL_ERROR >
mov ax, offset GI_link
mov bx, Gen_offset
mov di, offset GI_comp
clr bp
call ObjCompRemoveChild
noParent:
mov si, dx ;*ds:si = object to nuke
call DestroyHereLow
done:
pop bp
.leave
ret
useGenDestroy:
; can't optimize, do it the slow, generic way
mov bx, ds:[LMBH_handle]
mov dl, VUM_NOW
clr bp ;don't bother marking dirty
mov ax, MSG_GEN_DESTROY
mov di, mask MF_FORCE_QUEUE ;destroy a litle later..
call GC_ObjMessage
mov dl, VUM_NOW
clr bp
mov ax, MSG_GEN_REMOVE ;not usable, remove now.
clr di
call GC_ObjMessage
jmp done
DestroyDSSIHereAndNow endp
COMMENT @----------------------------------------------------------------------
FUNCTION: DestroyHereLow
DESCRIPTION: Destroy this object and its children
CALLED BY: INTERNAL
PASS:
*ds:si - object
RETURN:
none
DESTROYED:
ax, cx, dx, si
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 4/24/92 Initial version
------------------------------------------------------------------------------@
DestroyHereLow proc near
class GenControlClass
; find destroy our moniker
mov di, ds:[si]
add di, ds:[di].Gen_offset
mov ax, ds:[di].GI_visMoniker
tst ax
jz afterMoniker
call LMemFree
afterMoniker:
; get the chunk of our first child and then nuke ourself
EC < push bx >
EC < mov bx, ds:[di].GI_comp.CP_firstChild.handle >
EC < tst bx >
EC < jz 10$ >
EC < cmp bx, ds:[LMBH_handle] >
EC < ERROR_NZ GEN_CONTROL_INTERNAL_ERROR >
EC <10$: >
EC < pop bx >
mov_tr ax, si
mov si, ds:[di].GI_comp.CP_firstChild.chunk ;*ds:si = first child
call LMemFree
; now destroy our children
childLoop:
tst si
jz afterChildren
mov di, ds:[si]
add di, ds:[di].Gen_offset
EC < push bx >
EC < mov bx, ds:[di].GI_link.LP_next.handle >
EC < tst bx >
EC < jz 20$ >
EC < cmp bx, ds:[LMBH_handle] >
EC < ERROR_NZ GEN_CONTROL_INTERNAL_ERROR >
EC <20$: >
EC < pop bx >
push ds:[di].GI_link.LP_next.chunk
call DestroyHereLow
pop si
test si, LP_IS_PARENT ;is this our parent?
jz childLoop ;done if we've reached parent
afterChildren:
ret
DestroyHereLow endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlInitializeVarData
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Initialize var data elements which we want to be
accessable via ObjVarDerefData
PASS: *ds:si - instance data
ds:di - ptr to start of master instance data
es - segment of class
ax - MSG_META_INITIALIZE_VAR_DATA
cx - data type
RETURN: ds:ax - ptr to data entry
cx, dx, bp - destroyed
ALLOWED TO DESTROY:
bx, si, di, ds, es
PSEUDO CODE/STRATEGY/KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 12/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlInitializeVarData method GenControlClass,
MSG_META_INITIALIZE_VAR_DATA
mov bx, size TempGenControlInstance
cmp cx, TEMP_GEN_CONTROL_INSTANCE
jz allocate
mov bx, size GenControlUserData
cmp cx, HINT_GEN_CONTROL_USER_MODIFIED_UI
jz allocateAsSaveToState
call GC_SendToSuper
ret
allocateAsSaveToState:
or cx, mask VDF_SAVE_TO_STATE
allocate:
mov_tr ax, cx ;AX <- entry type
mov cx, bx
call ObjVarAddData ; ds:bx = data
push bx
cmp ax, HINT_GEN_CONTROL_USER_MODIFIED_UI or mask VDF_SAVE_TO_STATE
jne exit
mov di, bx
mov ax, HINT_GEN_CONTROL_MODIFY_INITIAL_UI
call ObjVarFindData
jnc exit
; Copy over HINT_GEN_CONTROL_MODIFY_INITIAL_UI
segmov es, ds ;ES:DI <- ptr to dest for copy
mov si, bx ;DS:SI <- ptr to source for copy
mov cx, (size GenControlUserData / 2)
.assert (size GenControlUserData and 1) eq 0
rep movsw
exit:
pop ax
ret
GenControlInitializeVarData endm
COMMENT @----------------------------------------------------------------------
FUNCTION: GetUIFeatures
DESCRIPTION: Get the effective UI level for this controller
CALLED BY: INTERNAL
PASS:
*ds:si - UI controller
ss:bp - inherited vars
ax - GenControlUIType
RETURN:
ax - UI features
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/21/91 Initial version
------------------------------------------------------------------------------@
GetUIFeatures proc near uses bx, cx, dx
dupinfo local GenControlBuildInfo
scaninfo local GenControlScanInfo
.enter inherit far
call GenControlGetFeatures
.leave
ret
GetUIFeatures endp
COMMENT @----------------------------------------------------------------------
FUNCTION: GenControlGetFeatures
DESCRIPTION: Get the effective UI level for this controller
CALLED BY: INTERNAL
GetUIFeatures
PASS:
*ds:si - UI controller
ss:bp - inherited vars
ax - GenControlUIType
RETURN:
ax - current feature set
bx - features supported by controller
cx - application-required features
dx - application-prohibited features
DESTROYED:
none
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 1/3/91 Pulled out from GetUIFeatures
------------------------------------------------------------------------------@
GenControlGetFeatures proc near uses di
dupinfo local GenControlBuildInfo
scaninfo local GenControlScanInfo
.enter inherit far
; First, scan hints & get the full scoop
;
push bp, ax
mov cx, ax
lea bp, scaninfo
mov dx, ss ;dx:bp is GenControlScanInfo struct
mov ax, MSG_GEN_CONTROL_SCAN_FEATURE_HINTS
call ObjCallInstanceNoLock
pop bp, di
tst di
jz haveCorrectionOffset
mov di, offset GCBI_toolList - offset GCBI_childList
haveCorrectionOffset:
; Get controller default features
; Get controller default features
mov ax, dupinfo[di].GCBI_features
; Figure out mask of what features this controller supports, put in bx
;
clr bx
mov cx, dupinfo[di].GCBI_featuresCount ; Get # of features
jcxz haveSupportedMask
supportedLoop:
stc
rcl bx, 1
loop supportedLoop
haveSupportedMask:
or ax, scaninfo.GCSI_userAdded
mov dx, scaninfo.GCSI_userRemoved
not dx
and ax, dx
mov cx, scaninfo.GCSI_appRequired ; Override w/app's requests
or ax, cx
mov dx, scaninfo.GCSI_appProhibited
push dx
not dx
and ax, dx
pop dx
and ax, bx ; Take out any features not supported
; by controller
.leave
ret
GenControlGetFeatures endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlScanFeatureHints -- MSG_GEN_CONTROL_SCAN_FEATURE_HINTS
for GenControlClass
DESCRIPTION: Scan the hints for feature info
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
cx - GenControlUIType
dx:bp - ptr to GenControlScanInfo structure to fill in
RETURN:
dx:bp - structure filled out
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/21/91 Initial version
Doug 1/14/92 Modifications for toolbox
------------------------------------------------------------------------------@
GenControlScanFeatureHints method dynamic GenControlClass,
MSG_GEN_CONTROL_SCAN_FEATURE_HINTS
push ax, cx, dx, bp
movdw esdi, dxbp
call EnsureOptionsLoaded
clr ax
stosw ; init userAdded to 0
stosw ; init userRemoved to 0
clr ax
stosw ; init appRequired to 0
stosw ; init appProhibited to 0
mov bx, cx ; bx = GenControlUIType
clr ax
mov al, cs:[GEUIHintStart][bx]
add ax, offset GEUIHintTable
mov_tr di, ax ;cs:di = table
clr ax
mov al, cs:[GEUIHintCount][bx] ;ax = count
segmov es, cs
call ObjVarScanData
pop ax, cx, dx, bp
push cx, dx, bp
call SendToSuperIfFlagSet
pop cx, dx, bp
;
; mask out global controller features (stored in geos.ini) under
; associated field's category
;
call SetGlobalControllerFeatures
ret
GenControlScanFeatureHints endm
GEUIHintStart byte \
0 * (size VarDataHandler), ;GCUIT_NORMAL
3 * (size VarDataHandler) ;GCUIT_TOOLBOX
GEUIHintCount byte \
(length GEUIHintTable) - 2, ;GCUIT_NORMAL
(length GEUIHintTable) - 3 ;GCUIT_TOOLBOX
GEUIHintTable VarDataHandler \
; Hints for Normal UI only... \
<ATTR_GEN_CONTROL_REQUIRE_UI, offset GEUIRequireUI>,
<ATTR_GEN_CONTROL_PROHIBIT_UI, offset GEUIProhibitUI>,
<HINT_GEN_CONTROL_TOOLBOX_ONLY, offset GEUIToolboxOnly>,
; Hints for both Normal and Toolbox UI...
<HINT_GEN_CONTROL_MODIFY_INITIAL_UI, offset GEUIModifyInitialUI>,
<HINT_GEN_CONTROL_USER_MODIFIED_UI, offset GEUIUserModifiedUI>,
<HINT_GEN_CONTROL_SCALABLE_UI_DATA, offset GEUIScalableUI>,
; Hints for Toolbox UI only...
<ATTR_GEN_CONTROL_REQUIRE_TOOLBOX_UI, offset GEUIRequireUI>,
<ATTR_GEN_CONTROL_PROHIBIT_TOOLBOX_UI, offset GEUIProhibitUI>
; for callbacks:
; pass:
; *ds:si - object
; ds:bx - extra data with hints
; dx:bp - GenControlScanInfo
; cx - GenControlUIType (GCUIT_NORMAL or GCUIT_TOOLBOX)
GEUIRequireUI proc far
mov di, offset GCSI_appRequired
GOTO StoreWord
GEUIRequireUI endp
GEUIProhibitUI proc far
mov di, offset GCSI_appProhibited
FALL_THRU StoreWord
GEUIProhibitUI endp
StoreWord proc far
mov ax, ds:[bx]
push es
mov es, dx
or es:[di+bp], ax
pop es
ret
StoreWord endp
;---
GEUIToolboxOnly proc far
mov es, dx
or es:[bp].GCSI_appProhibited, -1
ret
GEUIToolboxOnly endp
;---
GEUIModifyInitialUI proc far
; if our version exists then skip this hint
push bx
mov ax, HINT_GEN_CONTROL_USER_MODIFIED_UI
call ObjVarFindData
pop bx
jc done
call GEUIUserModifiedUI
done:
ret
GEUIModifyInitialUI endp
;---
GEUIUserModifiedUI proc far
mov ax, ds:[bx].GCUD_flags
cmp cx, GCUIT_TOOLBOX
jz toolbox
test ax, mask GCUF_USER_UI
jz done
mov ax, ds:[bx].GCUD_userAddedUI
mov bx, ds:[bx].GCUD_userRemovedUI
jmp common
toolbox:
test ax, mask GCUF_USER_TOOLBOX_UI
jz done
mov ax, ds:[bx].GCUD_userAddedToolboxUI
mov bx, ds:[bx].GCUD_userRemovedToolboxUI
common:
mov es, dx
mov es:[bp].GCSI_userAdded, ax
mov es:[bp].GCSI_userRemoved, bx
done:
ret
GEUIUserModifiedUI endp
;---
GEUIScalableUI proc far
push dx
mov es, dx ;es:bp <- GenControlScanInfo
push cx, bp
mov ax, MSG_GEN_APPLICATION_GET_APP_FEATURES
call GenCallApplication ;ax = features, dx = UI level
pop cx, bp
VarDataSizePtr ds, bx, di ;di = size
;
; ax - features in the application
; dx - UIInteraceLevel
; ds:bx - ptr to current GenControlScalableUIEntry
; di - size of all GenControlScalableUIEntry for this hint
;
; es:bp - ptr to GenControlScanInfo
; cx - GenControlUIType (GCUIT_NORMAL or GCUIT_TOOLBOX)
;
clr es:[bp].GCSI_userAdded
clr es:[bp].GCSI_userRemoved
push si
scanloop:
push ax
;
; Is this the correct UI type? (normal vs. toolbox)
;
test ds:[bx].GCSUIE_command, 1
jnz toolbox
cmp cx, GCUIT_NORMAL
jmp 20$
toolbox:
cmp cx, GCUIT_TOOLBOX
20$:
jne next ;branch if not right type
;
; Figure out the command type and do the right thing
; NOTE: the "andnf si, 0x00fe" has two purposes:
; (1) throw away the garbage high byte, since the command is a byte
; (2) ignore the low bit, which is toolbox vs. menu
;
mov si, {word}ds:[bx].GCSUIE_command
andnf si, 0x00fe ;si <- ScalableUICommand
test ax, ds:[bx].GCSUIE_appFeature ;clear Z flag if feature ON
jmp cs:scaleUITable[si]
scaleUITable nptr \
setIfAppFeatureOn,
setIfAppFeatureOff,
setIfAppLevel,
addIfAppFeatureOn
;
; Add the controller features if the app feature is ON
;
addIfAppFeatureOn:
jz next ;branch if feature is OFF
;
; For adding, mark the features as added, and make sure they
; aren't removed.
;
mov ax, ds:[bx].GCSUIE_newFeatures
or es:[bp].GCSI_userAdded, ax
not ax
and es:[bp].GCSI_userRemoved, ax
jmp next
;
; Set the controller features if the app feature is ON
;
setIfAppFeatureOn:
jnz setFeatures
jmp next
;
; Set the controller features if the app feature is OFF
;
setIfAppFeatureOff:
jz setFeatures
jmp next
setIfAppLevel:
cmp dx, ds:[bx].GCSUIE_appFeature ;level high enough?
jb next ;branch if too low
setFeatures:
mov ax, ds:[bx].GCSUIE_newFeatures
mov es:[bp].GCSI_userAdded, ax
not ax
mov es:[bp].GCSI_userRemoved, ax
next:
pop ax
add bx, (size GenControlScalableUIEntry)
sub di, (size GenControlScalableUIEntry)
jnz scanloop
pop si
pop dx
ret
GEUIScalableUI endp
COMMENT @----------------------------------------------------------------------
ROUTINE: SetGlobalControllerFeatures
DESCRIPTION: Update global features for this controller
PASS:
*ds:si - instance data
es - segment of GenControlClass
cx - GenControlUIType
dx:bp - ptr to GenControlScanInfo structure to fill in
RETURN:
dx:bp - structure filled out
DESTROYED:
nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 1/6/98 Initial version
------------------------------------------------------------------------------@
SetGlobalControllerFeatures proc far
uses ax, bx, cx, dx, si, di, ds, es
dupInfo local GenControlBuildInfo
categoryBuffer local INI_CATEGORY_BUFFER_SIZE dup (char)
userData local GenControlUserData
features local fptr.GenControlScanInfo
uiType local GenControlUIType
ForceRef dupInfo
.enter
mov features.segment, dx
mov dx, ss:[bp] ; dx = saved bp = features offset
mov features.offset, dx
mov uiType, cx
;
; get .ini category for associated field
;
push bp
push si
mov bx, segment GenFieldClass
mov si, offset GenFieldClass
mov cx, ss
lea dx, categoryBuffer
mov di, dx
SBCS < mov {char}ss:[di], 0 >
DBCS < mov {wchar}ss:[di], 0 >
mov ax, MSG_META_GET_INI_CATEGORY
mov di, mask MF_RECORD
call ObjMessage ; di = event
pop si
mov cx, di
mov ax, MSG_GEN_GUP_CALL_OBJECT_OF_CLASS
call UserCallApplication
pop bp
lea di, categoryBuffer
SBCS < cmp {char}ss:[di], 0 >
DBCS < cmp {wchar}ss:[di], 0 >
je done
;
; get key for this controller
;
call GetDupInfo
call LoadCatAndKey
jcxz noKey
;
; read global feature set
;
push bp
mov bp, size GenControlUserData
call InitFileReadData
pop bp
jc noKey
;
; update features
;
mov ax, mask GCUF_USER_UI
mov bx, offset GCUD_userAddedUI
cmp uiType, GCUIT_NORMAL
je haveType
mov ax, mask GCUF_USER_TOOLBOX_UI
mov bx, offset GCUD_userAddedToolboxUI
haveType:
test ax, userData.GCUD_flags
jz noKey
lea ax, userData
add bx, ax
mov ax, ss:[bx] ; ax = added UI
mov bx, ss:[bx+(size word)] ; bx = removed UI
movdw dssi, features
ornf ds:[si].GCSI_appRequired, ax
ornf ds:[si].GCSI_appProhibited, bx
noKey:
call UnlockIniKey
done:
.leave
ret
SetGlobalControllerFeatures endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlLoadOptions -- MSG_META_LOAD_OPTIONS
for GenControlClass
DESCRIPTION: Load state of the features from the .ini file
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 7/31/91 Extracted from EnsureOptionsLoaded
------------------------------------------------------------------------------@
GenControlLoadOptions method dynamic GenControlClass, MSG_META_LOAD_OPTIONS
dupinfo local GenControlBuildInfo
categoryBuffer local INI_CATEGORY_BUFFER_SIZE dup (char)
userData local GenControlUserData
ForceRef dupinfo
; See note at end -- Doug 1/93
; push ds:[LMBH_handle], si
;
; Make sure controller is aware that options have been loaded, and
; don't have to be again. (Moved from EnsureOptionsLoaded 11/12/92
; cbh. Basically this would get called on startup, but the first
; time EnsureOptionsLoaded got called again, everything would be
; reloaded due to the lack of this hint being stored, causing everything
; to be reset usable.
;
mov ax, TEMP_GEN_CONTROL_OPTIONS_LOADED or mask VDF_SAVE_TO_STATE
clr cx
call ObjVarAddData
mov di, 900
call ThreadBorrowStackSpace
push di
.enter
call GetDupInfo
; get the category string
mov cx, ss
lea dx, categoryBuffer
call UserGetInitFileCategory ;get .ini category
; read in the data
push si, bp, ds
call LoadCatAndKey ;ds:si = cat, cx:dx = key
stc ;assume no key
jcxz noKey
mov bp, size GenControlUserData
call InitFileReadData
noKey:
pop si, bp, ds
jc done
; store the data
push si
mov ax, HINT_GEN_CONTROL_USER_MODIFIED_UI or mask VDF_SAVE_TO_STATE
mov cx, size GenControlUserData
call ObjVarAddData
push ds ;save updated ds
segmov es, ds
mov di, bx ;es:di = dest
segmov ds, ss
lea si, userData
mov cx, size GenControlUserData
rep movsb
pop ds
pop si
done:
call UnlockIniKey
.leave
pop di
call ThreadReturnStackSpace
; Optimization -- Do NOT call superclass. This prevents any superclass
; of GenControlClass from ever getting MSG_META_RESET_OPTIONS, but the need
; is not there, so we'll take it away in the name of speed. -- Doug 1/93
;
; pop bx, si
; call MemDerefDS
; mov ax, MSG_META_LOAD_OPTIONS
; call GC_SendToSuper
ret
GenControlLoadOptions endm
COMMENT @----------------------------------------------------------------------
FUNCTION: LoadCatAndKey
DESCRIPTION: Load the category and key pointers
CALLED BY: INTERNAL
PASS:
*ds:si - object
ss:bp - inherited vars
RETURN:
ds:si - category
es:di - data buffer
cx:dx - key
DESTROYED:
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 4/21/92 Initial version
------------------------------------------------------------------------------@
LoadCatAndKey proc far
.enter inherit GenControlLoadOptions
mov di, offset GCBI_initFileKey
call LockTableESDI
movdw cxdx, esdi ;cxdx = key
segmov ds, ss
lea si, categoryBuffer ;ds:si = category
segmov es, ss
lea di, userData
.leave
ret
LoadCatAndKey endp
COMMENT @----------------------------------------------------------------------
FUNCTION: DupTheBlock
DESCRIPTION: Duplicate the given block
PASS:
ds - object block
bx - block
RETURN:
carry - clear if block exists
bx - new block
------------------------------------------------------------------------------@
DupTheBlock proc near uses ax, cx
.enter
push bx
if 0 ;For new *thread* model
clr ax ; set owner to that of current thread
else
mov bx, ds:[LMBH_handle]
call MemOwner
mov_tr ax, bx ; set owner to that owning block at DS
endif
clr cx ; set to be run by current thread
pop bx
tst bx
stc
jz done
call ObjDuplicateResource ;bx = duplicated block
; Set the block output of the new object block to point to the
; controller object
push ax, bx, ds
call ObjLockObjBlock ;Don't call MemLock on obj blocks,
; hoser!
mov bx, ds:[LMBH_handle]
mov ds, ax
call ObjBlockSetOutput
pop ax, bx, ds
call MemUnlock
clc
done:
.leave
ret
DupTheBlock endp
COMMENT @----------------------------------------------------------------------
FUNCTION: UnlockTableDI
DESCRIPTION: Unlock the table block
PASS:
ss:bp - inherited variables
di - offset of fptr inside dupinfo
RETURN:
none
------------------------------------------------------------------------------@
UnlockIniKey proc far
mov di, offset GCBI_initFileKey
call UnlockTableDI
ret
UnlockIniKey endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlGenerateUI -- MSG_GEN_CONTROL_GENERATE_UI for
GenControlClass
DESCRIPTION: Generate the UI for a controller
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
none
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/20/91 Initial version
------------------------------------------------------------------------------@
GenControlGenerateUI method dynamic GenControlClass,
MSG_GEN_CONTROL_GENERATE_UI
mov di, 700
call ThreadBorrowStackSpace
push di
dupinfo local GenControlBuildInfo
scaninfo local GenControlScanInfo
childCount local word
featuresCount local word
featuresListOff local word
childListOff local word
parent local optr
ForceRef scaninfo
.enter
call GetDupInfo
mov bx, ds:[LMBH_handle]
movdw parent, bxsi
mov ax, dupinfo.GCBI_childCount
mov childCount, ax
mov ax, dupinfo.GCBI_featuresCount
mov featuresCount, ax
mov ax, GCUIT_NORMAL
call GetUIFeatures ;ax = features
mov bx, dupinfo.GCBI_dupBlock
call DupTheBlock
LONG jc none
push ax, bx, bp
mov dx, ax
mov cx, bx
mov ax, MSG_GEN_CONTROL_TWEAK_DUPLICATED_UI
call ObjCallInstanceNoLock
pop ax, bx, bp
mov featuresListOff, offset GCBI_featuresList
mov childListOff, offset GCBI_childList
call GenerateUICommon
done:
; store the handle (bx) and flags (ax)
push bx
call DerefVardata
pop ds:[bx].TGCI_childBlock
mov ds:[bx].TGCI_features, ax
; if this controller is implemented in the specific UI then pass
; on the generate UI
test dupinfo.GCBI_flags, mask GCBF_SPECIFIC_UI
jz notSpecificUI
push ax, bp
mov ax, MSG_GEN_CONTROL_GENERATE_UI
call GC_SendToSuper
pop ax, bp
notSpecificUI:
; We will add app ui if it exists even if there are no features. JS (11/21/92)
; tst ax
; jz noAddAppUI
mov ax, ATTR_GEN_CONTROL_APP_UI
mov dx, MSG_GEN_CONTROL_ADD_APP_UI
call AddAppUI
;noAddAppUI:
; check to see if we need to add a hint for help
mov di, ds:[si] ;only add the hint
add di, ds:[di].Gen_offset ;if this is a dialog
cmp ds:[di].GII_visibility, GIV_DIALOG
jnz afterHelp
movdw bxdi, dupinfo.GCBI_helpContext
tst bx
jz afterHelp
;
; See if a help context is defined externally (ie. by the app)
;
push bx
mov ax, ATTR_GEN_HELP_CONTEXT
call ObjVarFindData
pop bx
jc afterHelp ;branch if external help
;
; No external help context is defined -- add our default context
;
push bx ;save virtual segment
call MemLockFixedOrMovable
push di
mov es, ax ;es:di = context
mov cx, 0xffff
clr ax
repne scasb
pop di
not cx ;cx = length
EC < cmp cx, 30 >
EC < ERROR_A GEN_CONTROL_HELP_CONTEXT_TOO_LONG >
mov ax, ATTR_GEN_HELP_CONTEXT
call ObjVarAddData ;ds:bx = new data
push si, ds
segxchg ds, es
mov si, di ;ds:si = source
mov di, bx ;es:di = dest
rep movsb ;copy data
pop si, ds
pop bx
call MemUnlockFixedOrMovable
afterHelp:
.leave
pop di
call ThreadReturnStackSpace
ret
none:
clr ax
clr bx
jmp done
GenControlGenerateUI endm
COMMENT @----------------------------------------------------------------------
FUNCTION: GenerateUICommon
DESCRIPTION: Common code for generating UI
CALLED BY: INTERNAL
PASS:
*ds:si - control object
ss:bp - inherited variables
ax - mask of features to generate
bx - duplicated block
RETURN:
ax - feature flags
bx - handle
DESTROYED:
cx, dx, di
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 4/21/92 Initial version
------------------------------------------------------------------------------@
GenerateUICommon proc near
.enter inherit GenControlGenerateUI
; remove any children that are not usable in this UI setup
; es:di = features list
; bx = duplicated block
; *ds:si = controller
mov cx, featuresCount
jcxz noFeatures
mov di, featuresListOff
call LockTableESDI ;esdi = features list
; es:di = features list (GenControlFeaturesInfo)
; cx = count
; ax = flags
; bx = duplicated block
push ax, si
featuresLoop:
mov si, es:[di].GCFI_object ;bx:si = object
test ax, 1
jnz nextFeature
; this feature needs to be removed -- remove it from its parent now
; to prevent redundant geometry work, but queue the DESTROY to
; prevent in-use problems
call DestroyBXSI
nextFeature:
shr ax
add di, size GenControlFeaturesInfo
loop featuresLoop
pop ax, si
mov di, featuresListOff
call UnlockTableDI
noFeatures:
; loop to add the children (and set them usable)
; *ds:si = controller
; bx = duplicated block
; cx = count
; es:di = list
; parent = parent to add to
mov cx, childCount
jcxz kidsDone
call ProcessChildren
kidsDone:
; bx = duplicated block
; *ds:si = controller
if 0
;
; Moved this to be done when the controller is interactable, instead,
; as we always want to be on the active list as long as any part of
; the controller is interactable - 5/19/93 -atw
;
; Add this Controller to the active list as we have created some UI
; for it and we wish to received MSG_META_DETACH so we can destroy the
; created UI. We remove ourselves from the active list at that time,
; if we don't always need to be on it.
test dupinfo.GCBI_flags, mask GCBF_IS_ON_ACTIVE_LIST
jnz done ; always on active list, no
; need to add it again
push ax, bx ; save features flags
mov ax, MSG_META_GCN_LIST_ADD
mov bx, ds:[LMBH_handle]
call AddOrRemoveActiveListEntry
pop ax, bx ; retreive features flags
done:
endif
.leave
ret
GenerateUICommon endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ProcessChildren
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Process the child list, adding or destroying each of the
children mentioned in the array.
CALLED BY: (INTERNAL) GenerateUICommon
PASS: ss:bp = inherited frame
cx = # of children
RETURN: nothing
DESTROYED: es, di, cx
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/11/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ProcessChildren proc near
.enter inherit GenControlGenerateUI
mov di, childListOff
call LockTableESDI
childLoop:
push ax, bx, cx, si, di, bp
mov cx, bx
mov dx, es:[di].GCCI_object ;cx:dx = child to add
test es:[di].GCCI_flags, mask GCCF_ALWAYS_ADD
jnz usable
test ax, es:[di].GCCI_featureMask
jnz usable
; if the child is not usable and does not directly represent a
; feature then nuke the child
test es:[di].GCCI_flags, mask GCCF_IS_DIRECTLY_A_FEATURE
jnz nextChild
movdw bxsi, cxdx
call DestroyBXSI
jmp nextChild
usable:
; add child
test es:[di].GCCI_flags, mask GCCF_NOTIFY_WHEN_ADDING
; NOTE! If your code blows up here, check to make sure that the ordering of
; the features/tools in the controller dup info table matches the order of the
; bits as defined in the constant mask. Specifically, if the "features"
; list mismatches the "child" list, the child can end up being deleted above,
; & then attempted to be used below.
;
EC < pushf >
EC < xchg bx, cx >
EC < xchg si, dx >
EC < call ECCheckLMemOD >
EC < xchg bx, cx >
EC < xchg si, dx >
EC < popf >
jz afterNotify
push cx, dx, bp ;notification added 1/26/93 cbh
mov ax, MSG_GEN_CONTROL_NOTIFY_ADDING_FEATURE
call ObjCallInstanceNoLock
pop cx, dx, bp
afterNotify:
push cx, dx
movdw bxsi, parent
mov ax, MSG_GEN_ADD_CHILD
mov bp, CCO_LAST
mov di, mask MF_CALL or mask MF_FIXUP_DS
call GC_ObjMessage
pop bx, si ;bx:si = child added
mov dl, VUM_MANUAL
mov ax, MSG_GEN_SET_USABLE
call GC_ObjMessageFixupDS
nextChild:
pop ax, bx, cx, si, di, bp
add di, size GenControlChildInfo
loop childLoop
mov di, childListOff
call UnlockTableDI
.leave
ret
ProcessChildren endp
COMMENT @----------------------------------------------------------------------
FUNCTION: AddAppUI
DESCRIPTION: Add the additional UI specified by the app
CALLED BY: INTERNAL
PASS:
*ds:si - GenControl object
ax - ATTR
dx - message
RETURN:
none
DESTROYED:
ax, bx, cx, dx, di
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 5/20/92 Initial version
------------------------------------------------------------------------------@
AddAppUI proc near
; Add the app-specified UI and set it usable.
clr di ;di is pointer into the vardata
addUILoop:
call ObjVarFindData
jnc done
VarDataSizePtr ds, bx, cx
cmp cx, di
jz done
push ax, dx, si, bp
mov_tr ax, dx
movdw cxdx, ds:[bx][di]
pushdw cxdx
call ObjCallInstanceNoLock
popdw cxdx
movdw bxsi, cxdx
mov ax, MSG_GEN_SET_USABLE
mov dl, VUM_NOW
call GC_ObjMessageFixupDS
pop ax, dx, si, bp
add di, size optr
jmp addUILoop
done:
ret
AddAppUI endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlGenerateToolboxUI --
MSG_GEN_CONTROL_GENERATE_TOOLBOX_UI for GenControlClass
DESCRIPTION: Generate the toolbox UI for a controller
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
^lcx:dx - parent object for tools
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/20/91 Initial version
------------------------------------------------------------------------------@
GenControlGenerateToolboxUI method dynamic GenControlClass,
MSG_GEN_CONTROL_GENERATE_TOOLBOX_UI
dupinfo local GenControlBuildInfo
scaninfo local GenControlScanInfo
childCount local word
featuresCount local word
featuresListOff local word
childListOff local word
parent local optr
ForceRef scaninfo
EC < call EnsureOnAppropriateLists >
push cx
clr cx
call GenCheckIfFullyUsable
pop cx
jc usable
ret
usable:
.enter
EC < xchg bx, cx >
EC < xchg si, dx >
EC < call ECCheckLMemOD >
EC < xchg bx, cx >
EC < xchg si, dx >
call DerefVardata
call GetDupInfo
mov ax, dupinfo.GCBI_toolCount
mov childCount, ax
mov ax, dupinfo.GCBI_toolFeaturesCount
mov featuresCount, ax
mov featuresListOff, offset GCBI_toolFeaturesList
mov childListOff, offset GCBI_toolList
movdw parent, cxdx
mov ax, GCUIT_TOOLBOX
call GetUIFeatures ;ax = features
tst ax
jnz 10$
none:
clr ax
clr bx
jmp done
10$:
mov bx, dupinfo.GCBI_toolBlock
call DupTheBlock ; bx = duplicated block
jc none
push ax, bx, cx, dx, bp
mov dx, ax
mov cx, bx
mov ax, MSG_GEN_CONTROL_TWEAK_DUPLICATED_TOOLBOX_UI
call ObjCallInstanceNoLock
pop ax, bx, cx, dx, bp
mov di, ds:[si]
add di, ds:[di].Gen_offset
push bx ; save duplicated block
push ax ; save features
push ds:[LMBH_handle] ; save controller optr
push si ;
mov bx, cx ; get parent into ^lbx:si
mov si, dx
push cx, dx, bp ; save interaction optr, frame
; Save ENABLED status of controller on stack
;
test ds:[di].GI_states, mask GS_ENABLED
pushf
; now that we have created this new object we need to lock it so
; that we can add some hints to it and tweak its instance data
call ObjLockObjBlock
mov ds, ax ; *ds:si = object
mov ax, MSG_GEN_SET_ENABLED
popf
jnz haveEnableMsg
mov ax, MSG_GEN_SET_NOT_ENABLED
haveEnableMsg:
mov dl, VUM_MANUAL ; So geometry is only done once
call ObjCallInstanceNoLock ; set enabled status correctly
call MemUnlock
pop cx, dx, bp ; recover interaction optr
; add the interaction OD to our temp data
pop si ; restore controller optr
pop bx
call MemDerefDS ; ds:si = controller
pop ax ; recover features flags
pop bx ; bx = duplicated block
push ax, bx, si, cx, dx, bp
push cx, dx
call GenerateUICommon ; Create tools
pop bx, si
mov ax, MSG_GEN_UPDATE_VISUAL ; Do visual update
mov dl, VUM_DELAYED_VIA_UI_QUEUE ; delayed, so geometry is
; only done once
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop ax, bx, si, cx, dx, bp
done:
; store the handle (bx) and flags (ax)
push bx
call DerefVardata
pop ds:[bx].TGCI_toolBlock
mov ds:[bx].TGCI_toolboxFeatures, ax
mov ds:[bx].TGCI_toolParent.handle, cx
mov ds:[bx].TGCI_toolParent.chunk, dx
; if this controller is implemented in the specific UI then pass
; on the generate UI
test dupinfo.GCBI_flags, mask GCBF_SPECIFIC_UI
jz notSpecificUI
push ax
mov ax, MSG_GEN_CONTROL_GENERATE_TOOLBOX_UI
call GC_SendToSuper
pop ax
notSpecificUI:
tst ax
jz noAddAppUI
push ax
mov ax, ATTR_GEN_CONTROL_APP_TOOLBOX_UI
mov dx, MSG_GEN_CONTROL_ADD_APP_TOOLBOX_UI
call AddAppUI
pop ax
noAddAppUI:
.leave
tst ax
jz exit
mov ax, MSG_GEN_CONTROL_NOTIFY_INTERACTABLE
mov cx, mask GCIF_TOOLBOX_UI
GOTO ObjCallInstanceNoLock
exit:
ret
GenControlGenerateToolboxUI endm
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlGetNormalFeatures -- MSG_GEN_CONTROL_GET_NORMAL_FEATURES
DESCRIPTION: Returns masks indicating what features the controller supports,
what features the application requires & prohibits, and what the
current feature set is, taking into account all this info plus
controller & user preferences. Called by GenToolControl to get
info needed to be able to display current setup & control what
the user is allowed to change
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
ax - current normal feature set
cx - application-required normal features
dx - application-prohibited normal features
bp - normal features supported by controller
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 1/3/92 Initial version
------------------------------------------------------------------------------@
GenControlGetNormalFeatures method dynamic GenControlClass,
MSG_GEN_CONTROL_GET_NORMAL_FEATURES
mov ax, GCUIT_NORMAL
GOTO GetUIFeaturesForMessageCommon
GenControlGetNormalFeatures endm
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlGetToolboxFeatures -- MSG_GEN_CONTROL_GET_TOOLBOX_FEATURES
DESCRIPTION: Returns masks indicating what features the controller supports,
what features the application requires & prohibits, and what the
current feature set is, taking into account all this info plus
controller & user preferences. Called by GenToolControl to get
info needed to be able to display current setup & control what
the user is allowed to change
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
ax - current toolbox feature set
cx - application-required toolbox features
dx - applicaiton-prohibited toolbox features
bp - toolbox features supported by controller
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 1/3/92 Initial version
------------------------------------------------------------------------------@
GenControlGetToolboxFeatures method dynamic GenControlClass,
MSG_GEN_CONTROL_GET_TOOLBOX_FEATURES
mov ax, GCUIT_TOOLBOX
FALL_THRU GetUIFeaturesForMessageCommon
GenControlGetToolboxFeatures endm
GetUIFeaturesForMessageCommon proc far
dupinfo local GenControlBuildInfo
scaninfo local GenControlScanInfo
ForceRef dupinfo
ForceRef scaninfo
.enter
call GetDupInfo
call GenControlGetFeatures
.leave
mov bp, bx ; return supported featured in bp
ret
GetUIFeaturesForMessageCommon endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlNotifyObjBlockInteractible
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Handle notification that the UI object block we've created
has become interactible.
PASS: *ds:si - instance data
ds:di - ptr to start of master instance data
es - segment of class
ax - MSG_META_NOTIFY_OBJ_BLOCK_INTERACTIBLE
cx - block handle
RETURN: nothing
ALLOWED TO DESTROY:
bx, si, di, ds, es
PSEUDO CODE/STRATEGY/KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 12/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlNotifyObjBlockInteractible method dynamic GenControlClass, \
MSG_META_NOTIFY_OBJ_BLOCK_INTERACTIBLE
; Default handler can deal only with single block that GenControl
; has created.
;
call DerefVardata
cmp cx, ds:[bx].TGCI_childBlock
jne exit
; Children are busy, so let's bump our own interactible count to reflect
; this. Will ensure that if we are ourselves a child of a controller,
; it will know that we're busy & will continue to send us updates
; and not SPEC_UNBUILD us in the name of efficiency. (Would result
; in any child gadgets which become pinned menus or dialogs to
; come down, not a desirable thing)
;
call ObjIncInteractibleCount
; Send notification to ourselves that the normal UI has become
; interactable. If we're not yet on the notification lists, we'll add
; ourselves. If we already are, we'll update the flags indicating
; which things are interactable, & force an update of the UI
; gadgetry.
;
mov ax, MSG_GEN_CONTROL_NOTIFY_INTERACTABLE
mov cx, mask GCIF_NORMAL_UI
GOTO ObjCallInstanceNoLock
exit:
ret
GenControlNotifyObjBlockInteractible endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlNotifyObjBlockNotInteractible
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Handle notification that the UI object block we've created
has become not in-use.
PASS: *ds:si - instance data
ds:di - ptr to start of master instance data
es - segment of class
ax - MSG_META_NOTIFY_OBJ_BLOCK_NOT_INTERACTIBLE
cx - block handle
RETURN: nothing
ALLOWED TO DESTROY:
bx, si, di, ds, es
PSEUDO CODE/STRATEGY/KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 12/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlNotifyObjBlockNotInteractible method dynamic GenControlClass, \
MSG_META_NOTIFY_OBJ_BLOCK_NOT_INTERACTIBLE
; Default handler can deal only with single block that GenControl
; has created.
;
call DerefVardata
cmp cx, ds:[bx].TGCI_childBlock
jne exit
; Send notification to ourselves that the normal UI has become not
; interactable. This will cause the flags to be updated so that
; the normal UI will not be updated on changes, & if no areas of
; the controller are left interactable, the controller will be
; taken off the notification lists altogether.
;
push cx
mov ax, MSG_GEN_CONTROL_NOTIFY_NOT_INTERACTABLE
mov cx, mask GCIF_NORMAL_UI
call ObjCallInstanceNoLock
pop cx
; The following code placement, if activated, results in the created Normal UI
; block being unbuilt, if possible, anytime it becomes not visible to the
; user. This frequency may be excessive, & a different algorithm used to
; decided when to do the unbuild. In any case, the code is commmented out
; now, both because we don't want this behavior on normal machines, and
; because this behavior is not yet fully supported by the specific UI.
; See comments in MSG_GEN_CONTROL_UNBUILD_NORMAL_UI_IF_POSSIBLE handler.
; -- Doug 12/20/91
;
; A test! See if it is possible to not only quit updating, but
; to actually unbuild the normal UI component block at this time.
; Why? Because some machines (such as palmtops) may have very little
; swap space. Being able to actually nuke UI that isn't in use would
; be greatly beneficial.
;
mov ax, MSG_GEN_CONTROL_UNBUILD_NORMAL_UI_IF_POSSIBLE
mov bx, ds:[LMBH_handle]
; force on queue, since
; "NOT_INTERACTIBLE"
; notification is generally from the
; middle of a visual update, which would
; be a bad place to be destroying things
; mov di, mask MF_FORCE_QUEUE or mask MF_INSERT_AT_FRONT
; We force queue the message (don't insert it at the front) because
; there could be a queued message to bring up a child dialog box or
; something, so we don't want to nuke the block just yet.
mov di, mask MF_FORCE_QUEUE
call ObjMessage
; Dec in-use count when child block is no longer interactible to balance
; the Inc performed in GenControlNotifyObjBlockInteractible.
;
call ObjDecInteractibleCount
exit:
ret
GenControlNotifyObjBlockNotInteractible endm
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlSpecBuildBranch -- MSG_SPEC_BUILD_BRANCH
for GenControlClass
DESCRIPTION: Build the generic tree
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
bp - SpecBuildFlags
RETURN:
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 10/31/91 Initial version
------------------------------------------------------------------------------@
GenControlSpecBuildBranch method dynamic GenControlClass,
MSG_SPEC_BUILD_BRANCH
EC < call EnsureOnAppropriateLists >
push bp ;save build flags
; if this is a dual build object and this is not a win group
; build then don't do anything
mov di, ds:[si]
add di, ds:[di].Vis_offset
mov cx, 1 ;assume need to do no features
; check
test ds:[di].VI_specAttrs, mask SA_USES_DUAL_BUILD
jz noDualBuild
test bp, mask SBF_WIN_GROUP
LONG jz afterGenerateUI
dec cx
noDualBuild:
call DerefVardata
tst ds:[bx].TGCI_childBlock
jnz afterGenerateUI
; Can't do this. Command windows such as GeoFile's treasure chest have to
; be built out in SPEC_BUILD, so that the box actually contains something
; when it appears on screen. -- Doug 1/28/93
;
; mov di, ds:[si]
; add di, ds:[di].Gen_offset
; test ds:[di].GII_attrs, mask GIA_NOT_USER_INITIATABLE
; LONG jnz afterInteractable
; send a message to ourself to get the UI added, passing ourself
; as the object to add to
push cx
mov cx, ds:[bx].TGCI_toolParent.handle
mov dx, ds:[bx].TGCI_toolParent.chunk
mov ax, MSG_GEN_CONTROL_GENERATE_UI
call ObjCallInstanceNoLock
pop cx
afterGenerateUI:
; if needed then check for no features and set us "not user initiatable"
; if so
jcxz afterNoFeaturesCheck
mov ax, MSG_GEN_CONTROL_GET_NORMAL_FEATURES
call ObjCallInstanceNoLock ;ax = feature set
tst ax
jnz afterNoFeaturesCheck
mov ax, ATTR_GEN_CONTROL_APP_UI
call ObjVarFindData ;carry set if we have app ui
jc afterNoFeaturesCheck
mov cx, mask GIA_NOT_USER_INITIATABLE
mov ax, MSG_GEN_INTERACTION_SET_ATTRS
call ObjCallInstanceNoLock
afterNoFeaturesCheck:
; to finish - call our superclass
; On any spec-build, the controller itself becomes visible & may
; need to be enabled/disabled, so update interactable status to
; ensure we're on the gcn lists. -- Doug
; Optimization: If we are not user initiatable then we really don't
; need to be interactable -- Tony
; The GIA_NOT_USER_INITIATABLE bit only means something for dialogs.
; If the controller is not a dialog, then we want to mark it
; interactable.
mov di, ds:[si]
add di, ds:[di].Gen_offset
cmp ds:[di].GII_visibility, GIV_DIALOG
jnz interactable
test ds:[di].GII_attrs, mask GIA_NOT_USER_INITIATABLE
jnz afterInteractable
interactable:
mov ax, MSG_GEN_CONTROL_NOTIFY_INTERACTABLE
mov cx, mask GCIF_CONTROLLER
call ObjCallInstanceNoLock
afterInteractable:
pop bp
; The NOTIFY_INTERACTABLE may have set this object fully enabled, so
; we need to update our spec build flags appropriately.
andnf bp, not mask SBF_VIS_PARENT_FULLY_ENABLED
mov cx, -1 ; no optimizations -- do full check
call GenCheckIfFullyEnabled ; see if we're fully enabled
jnc doBuild ; no, branch
ornf bp, mask SBF_VIS_PARENT_FULLY_ENABLED
doBuild:
mov ax, MSG_SPEC_BUILD_BRANCH
call GC_SendToSuper
ret
GenControlSpecBuildBranch endm
;---
if ERROR_CHECK
EnsureOnAppropriateLists proc far
uses ax, bx, cx, dx, bp, si, di
dupinfo local GenControlBuildInfo
params local GCNListParams
.enter
call GetDupInfo
test dupinfo.GCBI_flags, mask GCBF_IS_ON_ACTIVE_LIST
jz notOnActive
mov ax, MGCNLT_ACTIVE_LIST
call checkActiveList
ERROR_C GEN_CONTROL_MUST_BE_ON_ACTIVE_LIST
jmp afterActive
notOnActive:
test dupinfo.GCBI_flags, mask GCBF_ALWAYS_INTERACTABLE
ERROR_NZ GEN_CONTROL_CANNOT_SET_ALWAYS_INTERACTABLE_IF_NOT_ON_ACTIVE_LIST
test dupinfo.GCBI_flags, mask GCBF_ALWAYS_ON_GCN_LIST
ERROR_NZ GEN_CONTROL_CANNOT_SET_ALWAYS_ON_GCN_LIST_IF_NOT_ON_ACTIVE_LIST
afterActive:
test dupinfo.GCBI_flags, mask GCBF_IS_ON_START_LOAD_OPTIONS_LIST
jnz startupList
test dupinfo.GCBI_flags,
mask GCBF_NOT_REQUIRED_TO_BE_ON_SELF_LOAD_OPTIONS_LIST
jnz common
mov ax, GAGCNLT_SELF_LOAD_OPTIONS
call checkActiveList
ERROR_C GEN_CONTROL_MUST_BE_ON_SELF_LOAD_OPTIONS_LIST
jmp common
startupList:
mov ax, GAGCNLT_STARTUP_LOAD_OPTIONS
call checkActiveList
ERROR_C GEN_CONTROL_MUST_BE_ON_STARTUP_LOAD_OPTIONS_LIST
common:
.leave
ret
checkActiveList:
push si
mov params.GCNLP_ID.GCNLT_manuf, MANUFACTURER_ID_GEOWORKS
mov params.GCNLP_ID.GCNLT_type, ax
mov ax, ds:[LMBH_handle]
mov params.GCNLP_optr.handle, ax
mov params.GCNLP_optr.chunk, si
clr bx
call GeodeGetAppObject
tst_clc bx
jz noApp
mov ax, MSG_META_GCN_LIST_ADD
mov dx, size GCNListParams
mov di, mask MF_CALL or mask MF_STACK or mask MF_FIXUP_DS
push bp
lea bp, params
call GC_ObjMessage
pop bp
noApp:
pop si
retn
EnsureOnAppropriateLists endp
endif
GCBuild ends
;---
ControlObject segment resource
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlDetach -- MSG_META_DETACH for GenControlClass
DESCRIPTION: Intercept detach and nuke our created UI
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
cx - caller's ID
dx:bp - ack OD
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/27/91 Initial version
------------------------------------------------------------------------------@
GenControlDetach method dynamic GenControlClass, MSG_META_DETACH
mov ax, 1 ;detaching
call DestroyGeneratedUI
push ax, cx, dx, bp
mov cx, mask GCIF_CONTROLLER or mask GCIF_NORMAL_UI or mask GCIF_TOOLBOX_UI
mov ax, MSG_GEN_CONTROL_NOTIFY_NOT_INTERACTABLE
call ObjCallInstanceNoLock
pop ax, cx, dx, bp
; pass DETACH to our superclass
mov ax, MSG_META_DETACH
call GC_SendToSuper
ret
GenControlDetach endm
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlSpecUnbuild -- MSG_SPEC_UNBUILD for GenControlClass
DESCRIPTION: Build the generic tree
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
bp - SpecBuildFlags
RETURN:
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 10/31/91 Initial version
Doug 12/17 New logic to allow dynamic unbuilding
------------------------------------------------------------------------------@
GenControlSpecUnbuild method dynamic GenControlClass, MSG_SPEC_UNBUILD
; See if generically or visibly unbuilding. If generic, we're being
; set NOT_USABLE, so we should go ahead & nuke everything. If
; just a visual unbuild, depends on some other logic to follow...
;
test bp, mask SBF_VIS_PARENT_UNBUILDING
jz destroyAll
; Split up single & dual build cases. If single, then the visible
; parent that the normal UI components are on is unbuilding, so they
; must be unbuilt as well. If dual build, more logic to follow...
;
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].VI_specAttrs, mask SA_USES_DUAL_BUILD
jz destroyAll
;dualBuild:
; If dual build, split up non-WIN_GROUP & WIN_GROUP cases. If
; WIN_GROUP, is like single-case in that visible parent of NORMAL UI
; gadgets is being unbuilt. Proceed to unbuild them.
;
test bp, mask SBF_WIN_GROUP
jz nonWinGroup
;;destroyNormalUI:
; Destroy JUST the Normal UI stuff
;
call DestroyNormalUI
jmp callSuper
destroyAll:
push ax
clr ax ;not detaching
call DestroyGeneratedUI
pop ax
nonWinGroup:
; Otherwise, if non-win group portion, then just affects button
; that leads to NORMAL UI window. call superclass to nuke the button
; after marking the controller not-interactable
push ax, cx, dx, bp
mov cx, mask GCIF_CONTROLLER
mov ax, MSG_GEN_CONTROL_NOTIFY_NOT_INTERACTABLE
call ObjCallInstanceNoLock
pop ax, cx, dx, bp
callSuper:
call GC_SendToSuper
ret
GenControlSpecUnbuild endm
COMMENT @----------------------------------------------------------------------
FUNCTION: DestroyGeneratedUI
DESCRIPTION: Destroy the generated UI for the controller and remove the
controller from thew active list if the controller was only
on the active list to get DETACH.
CALLED BY: INTERNAL
PASS:
ax - non-zero if detaching (are therefore can optimize)
*ds:si - GenControl object
RETURN:
none
DESTROYED:
bx, di
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 8/19/92 Initial version
------------------------------------------------------------------------------@
DestroyGeneratedUI proc far uses ax, cx, dx, bp
class GenControlClass
.enter
; if we are detaching try to optimize...
tst ax
LONG jz normalDestroy
; Since we are detaching there is really no need to do a whole lot
; of work (like destroying all the UI), so let's just nuke our
; children (and the tool interaction's children) and let it go at that
; -- tony 10/12/92
call DerefVardata ; get variable data
clr cx
xchg cx, ds:[bx].TGCI_childBlock ; have we created UI yet ??
jcxz afterNormalUI ; no, so do nothing
;
; We need to free the block, too, dude, not just unlink it...
; -- atw & jdashe 7/7/95
;
mov ax, MSG_GEN_CONTROL_FREE_OBJ_BLOCK
mov bx, ds:[LMBH_handle]
mov di, mask MF_FORCE_QUEUE
call ObjMessage
push cx
call removeAllFromWindowList
pop bx
; if the block is interactable then decrement our in-use count now
; since when we get a MSG_META_NOTIFY_OBJ_BLOCK_NOT_INTERACTIBLE
; we will no longer know that this is our block
push ds
call ObjLockObjBlock
mov ds, ax
tst ds:[OLMBH_interactibleCount]
call MemUnlock
pop ds
jz childBlockNotInteractable
call ObjDecInteractibleCount
childBlockNotInteractable:
mov ax, ATTR_GEN_CONTROL_APP_UI
call RemoveAppUI
mov di, ds:[si]
add di, ds:[di].Gen_offset
clr ax
clrdw ds:[di].GI_comp.CP_firstChild, ax
mov di, ds:[si]
tst ds:[di].Vis_offset ; built?
jz afterNormalUI ; no
EC < push es, di >
EC < segmov es, <segment VisCompClass>, di >
EC < mov di, offset VisCompClass >
EC < call ObjIsObjectInClass >
EC < ERROR_NC GEN_CONTROL_DIDNT_BUILD_TO_VIS_COMP >
EC < pop es, di >
add di, ds:[di].Vis_offset
clrdw ds:[di].VCI_comp.CP_firstChild, ax
afterNormalUI:
call DerefVardata ; get variable data
clr cx
xchg cx, ds:[bx].TGCI_toolBlock ; have we created toolbox yet ??
jcxz done ; no, so do nothing
;
; We need to free the block, too, dude, not just unlink it...
; -- atw & jdashe 7/7/95
;
mov ax, MSG_GEN_CONTROL_FREE_OBJ_BLOCK
mov bx, ds:[LMBH_handle]
mov di, mask MF_FORCE_QUEUE
call ObjMessage
call removeAllFromWindowList
mov ax, ATTR_GEN_CONTROL_APP_TOOLBOX_UI
call RemoveAppUI
push si
call DerefVardata
mov si, ds:[bx].TGCI_toolParent.chunk
mov bx, ds:[bx].TGCI_toolParent.handle
call ObjSwapLock
mov di, ds:[si]
add di, ds:[di].Gen_offset
clr ax
clrdw ds:[di].GI_comp.CP_firstChild
call ObjSwapUnlock
pop si
jmp done
normalDestroy:
; Destroy Normal & Toolbox created UI components
call DestroyNormalUI
call DestroyToolboxUI
if 0
; Moved this to GenControlNotInteractable, as we want to remain on
; the active list as long as any part of the controller is
; interactable (5/18/93 - atw)
; If Controller was added to active list to receive MSG_META_DETACH,
; remove it now, as we have destroyed created UI components (which is
; why we originally wanted to receieve MSG_META_DETACH).
test dupinfo.GCBI_flags, mask GCBF_IS_ON_ACTIVE_LIST or \
mask GCBF_MANUALLY_REMOVE_FROM_ACTIVE_LIST
jnz done ; if always on active list,
; leave it there
mov ax, MSG_META_GCN_LIST_REMOVE
mov bx, ds:[LMBH_handle]
call AddOrRemoveActiveListEntry
endif
done:
.leave
ret
;---
; cx = handle of child block or toolbox block that is about to
; be removed
;
; If any object in the block is on the GAGCNLT_WINDOWS list, remove it
removeAllFromWindowList:
push si, bp
mov dx, size GCNListParams
sub sp, dx
mov bp, sp
mov ss:[bp].GCNLP_optr.handle, cx
mov ss:[bp].GCNLP_optr.chunk, 0
mov ss:[bp].GCNLP_ID.GCNLT_manuf, MANUFACTURER_ID_GEOWORKS
mov ss:[bp].GCNLP_ID.GCNLT_type, GAGCNLT_WINDOWS
mov ax, MSG_META_GCN_LIST_REMOVE
clr bx ; use current thread
call GeodeGetAppObject ; ^lbx:si = app object
mov di, mask MF_CALL or mask MF_FIXUP_DS or mask MF_STACK
call ObjMessage
add sp, size GCNListParams
pop si, bp
retn
DestroyGeneratedUI endp
;---
DestroyNormalUI proc near uses ax, cx, dx, bp
.enter
mov cx, mask GCIF_NORMAL_UI
mov ax, MSG_GEN_CONTROL_NOTIFY_NOT_INTERACTABLE
call ObjCallInstanceNoLock
call SendDestroyUI
.leave
ret
DestroyNormalUI endp
SendDestroyUI proc near
.enter
call DerefVardata ; get variable data
tst ds:[bx].TGCI_childBlock ; have we created UI yet ??
jz done ; no, so do nothing
mov ax, MSG_GEN_CONTROL_DESTROY_UI
call ObjCallInstanceNoLock
done:
.leave
ret
SendDestroyUI endp
DestroyToolboxUI proc near uses ax, cx, dx, bp
.enter
mov cx, mask GCIF_TOOLBOX_UI
mov ax, MSG_GEN_CONTROL_NOTIFY_NOT_INTERACTABLE
call ObjCallInstanceNoLock
call SendDestroyToolboxUI
.leave
ret
DestroyToolboxUI endp
SendDestroyToolboxUI proc near
.enter
call DerefVardata ; get variable data
tst ds:[bx].TGCI_toolBlock ; have we created toolbox yet ??
jz done ; no, so do nothing
mov ax, MSG_GEN_CONTROL_DESTROY_TOOLBOX_UI
call ObjCallInstanceNoLock
done:
.leave
ret
SendDestroyToolboxUI endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlAddToUI -- MSG_GEN_CONTROL_ADD_TO_UI for
GenControlClass
DESCRIPTION: Add the controller to the GCN lists that it needs to be on
to fuction correctly (usually SELF_LOAD_OPTIONS or
STARTUP_LOAD_OPTIONS and occasionally ACTIVE)
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/31/92 Initial version
------------------------------------------------------------------------------@
GenControlAddToUI method dynamic GenControlClass,
MSG_GEN_CONTROL_ADD_TO_UI
; we need to add this object to all lists that it is supposed to be on
mov ax, MSG_META_GCN_LIST_ADD
GOTO AddOrRemoveSelfToAppropriateLists
GenControlAddToUI endm
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlRemoveFromUI -- MSG_GEN_CONTROL_REMOVE_FROM_UI for
GenControlClass
DESCRIPTION: Remove the controller from the GCN lists that it needs to
be on to fuction correctly (usually SELF_LOAD_OPTIONS or
STARTUP_LOAD_OPTIONS and occasionally ACTIVE)
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 3/31/92 Initial version
------------------------------------------------------------------------------@
GenControlFinalObjFree method dynamic GenControlClass,
MSG_META_FINAL_OBJ_FREE
mov ax, MSG_GEN_CONTROL_REMOVE_FROM_UI
call ObjCallInstanceNoLock
mov ax, MSG_META_FINAL_OBJ_FREE
mov di, offset GenControlClass
GOTO ObjCallSuperNoLock
GenControlFinalObjFree endm
GenControlRemoveFromUI method dynamic GenControlClass,
MSG_GEN_CONTROL_REMOVE_FROM_UI
mov ax, MSG_META_GCN_LIST_REMOVE
FALL_THRU AddOrRemoveSelfToAppropriateLists
GenControlRemoveFromUI endm
COMMENT @----------------------------------------------------------------------
FUNCTION: AddOrRemoveSelfToAppropriateLists
DESCRIPTION: Add or remove this object to appropriate GCN lists
CALLED BY: INTERNAL
PASS:
*ds:si - controller
ax - messsage (MSG_META_GCN_LIST_ADD or MSG_META_GCN_LIST_REMOVE)
RETURN:
none
DESTROYED:
ax, bx, cx, dx, di
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 8/19/92 Initial version
------------------------------------------------------------------------------@
AddOrRemoveSelfToAppropriateLists proc far
dupinfo local GenControlBuildInfo
.enter
call GetDupInfo
mov bx, ds:[LMBH_handle] ;bxsi = object to add/remove (ourself)
test dupinfo.GCBI_flags, mask GCBF_IS_ON_ACTIVE_LIST
jz afterActive
call AddOrRemoveActiveListEntry
afterActive:
test dupinfo.GCBI_flags,
mask GCBF_NOT_REQUIRED_TO_BE_ON_SELF_LOAD_OPTIONS_LIST
jnz done
mov cx, MANUFACTURER_ID_GEOWORKS
mov dx, GAGCNLT_STARTUP_LOAD_OPTIONS or mask GCNLTF_SAVE_TO_STATE
test dupinfo.GCBI_flags, mask GCBF_IS_ON_START_LOAD_OPTIONS_LIST
jnz gotOptionsList
mov dx, GAGCNLT_SELF_LOAD_OPTIONS or mask GCNLTF_SAVE_TO_STATE
gotOptionsList:
call AddOrRemoveListEntry
done:
.leave
ret
AddOrRemoveSelfToAppropriateLists endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlFindKbdAccelerator
DESCRIPTION: Make sure the UI's built out before looking further downward
for a keyboard accelerator. The default GenClass handler
for this will inc/dec the interactible count around the test
for usable + enabled + accelerator match, to ensure that
we've updated all of these states correctly before the test
is made.
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - MSG_GEN_FIND_KBD_ACCELERATOR
cx = character value
dl = CharFlags
dh = ShiftState (ModBits)
bp low = ToggleState
bp high = scan code
RETURN: carry - set if accelerator found
DESTROYED:
ax, cx, dx, bp
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 6/92 Initial version
------------------------------------------------------------------------------@
GenControlFindKbdAccelerator method dynamic GenControlClass,
MSG_GEN_FIND_KBD_ACCELERATOR
; We shouldn't bother generating UI for this controller if it is not
; usable. - Joon (6/22/93)
;
test ds:[di].GI_states, mask GS_USABLE
jz callSuper
push ax, cx, dx, bp
call DerefVardata
tst ds:[bx].TGCI_childBlock
jnz alreadyBuilt
mov ax, MSG_GEN_CONTROL_GENERATE_UI
call ObjCallInstanceNoLock
alreadyBuilt:
mov di, offset GenControlClass
call DerefVardata
test ds:[bx].TGCI_interactableFlags, mask GCIF_CONTROLLER
jnz goAhead
;
; If the controller is not interactable, make it so. This
; needs to happen so that the controller will become enabled
; appropriately, so that it's children can become enabled
; as well. -- eca 7/14/92
;
mov ax, MSG_GEN_CONTROL_NOTIFY_INTERACTABLE
mov cx, mask GCIF_CONTROLLER
call ObjCallInstanceNoLock
pop ax, cx, dx, bp
call ObjCallSuperNoLock
;
; Once we've checked the keyboard shortcuts, we can make the
; controller not interactable again.
;
pushf ;save carry from superclass
mov ax, MSG_GEN_CONTROL_NOTIFY_NOT_INTERACTABLE
mov cx, mask GCIF_CONTROLLER
call ObjCallInstanceNoLock
popf
ret
goAhead:
pop ax, cx, dx, bp
callSuper:
mov di, offset GenControlClass
GOTO ObjCallSuperNoLock
GenControlFindKbdAccelerator endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlReset
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Respond to a "reset" request
CALLED BY: GLOBAL (MSG_GEN_RESET)
PASS: *DS:SI = GenControlClass object
DS:DI = GenControlClassInstance
RETURN: Nothing
DESTROYED: AX, CX, DX
PSEUDO CODE/STRATEGY:
We simply re-add ourselves to the GCN list, which will
cause the cached data to be re-sent.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/12/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlReset method dynamic GenControlClass, MSG_GEN_RESET
; Only re-add ourselves to the GCN list if either:
; a) We are always on a GCN list, or
; b) We are currently interactible
;
call GetControllerFlags
test ax, mask GCBF_ALWAYS_INTERACTABLE
jnz addToList
mov ax, TEMP_GEN_CONTROL_INSTANCE
call ObjVarFindData
jnc exit
test ds:[bx].TGCI_interactableFlags, \
mask GCIF_CONTROLLER or \
mask GCIF_TOOLBOX_UI or \
mask GCIF_NORMAL_UI
jz exit
addToList:
mov ax, MSG_META_GCN_LIST_ADD
call AddToGCNLists
exit:
ret
GenControlReset endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlAddAppUI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This method adds the app UI as the last child of the
controller.
CALLED BY: GLOBAL
PASS: ^lCX:DX <- object to add
RETURN: nada
DESTROYED: bp
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 5/ 4/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlAddAppUI method GenControlClass, MSG_GEN_CONTROL_ADD_APP_UI
EC < xchg bx, cx >
EC < xchg si, dx >
EC < call ECCheckLMemOD >
EC < xchg bx, cx >
EC < xchg si, dx >
mov bp, CCO_LAST
mov ax, MSG_GEN_ADD_CHILD
GOTO ObjCallInstanceNoLock
GenControlAddAppUI endm
GenControlAddAppToolboxUI method GenControlClass,
MSG_GEN_CONTROL_ADD_APP_TOOLBOX_UI
EC < xchg bx, cx >
EC < xchg si, dx >
EC < call ECCheckLMemOD >
EC < xchg bx, cx >
EC < xchg si, dx >
call DerefVardata
mov si, ds:[bx].TGCI_toolParent.chunk
mov bx, ds:[bx].TGCI_toolParent.handle
mov bp, CCO_LAST
mov ax, MSG_GEN_ADD_CHILD
mov di, mask MF_CALL
GOTO ObjMessage
GenControlAddAppToolboxUI endm
COMMENT @----------------------------------------------------------------------
FUNCTION: RemoveAppUI
DESCRIPTION: Remove application specified UI
CALLED BY: INTERNAL
PASS:
*ds:si - GenControl object
ax - ATTR holding App UI elements (as list of optrs)
RETURN:
none
DESTROYED:
ax, bx, cx, dx, di
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 5/20/92 Initial version
------------------------------------------------------------------------------@
RemoveAppUI proc near uses bp
.enter
; Set the app-specified UI not usable and remove it.
mov bp, bx ;keep flag in bp
clr di ;di is pointer into the vardata
removeUILoop:
call ObjVarFindData
jnc done
VarDataSizePtr ds, bx, cx
cmp cx, di
jz done
; remove the application-specified ui (set it not usable, and remove
; it from the parent.
push ax, si, di, bp
mov si, ds:[bx][di].chunk ;^lcx:dx <- app-supplied object/tree
mov bx, ds:[bx][di].handle
mov ax, MSG_GEN_REMOVE
mov dl, VUM_NOW
clr bp
call CO_ObjMessageFixupDS
pop ax, si, di, bp
add di, size optr
jmp removeUILoop
done:
.leave
ret
RemoveAppUI endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlDestroyUI -- MSG_GEN_CONTROL_DESTROY_UI for
GenControlClass
DESCRIPTION: Destroy the UI for the controller
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/20/91 Initial version
------------------------------------------------------------------------------@
GenControlDestroyUI method dynamic GenControlClass,
MSG_GEN_CONTROL_DESTROY_UI
dupinfo local GenControlBuildInfo
.enter
mov ax, ATTR_GEN_CONTROL_APP_UI
call RemoveAppUI
; if no children then exit
call DerefVardata
mov ax, ds:[bx].TGCI_features
mov bx, ds:[bx].TGCI_childBlock
tst bx
LONG jz done
; call ourself to get the information
call GetDupInfo
mov dx, dupinfo.GCBI_childCount
tst dx
jz afterChildren
mov di, offset GCBI_childList
call LockTableESDI ;es:di = child list
; loop to remove the children (and set them not usable)
; *ds:si - controller
; ax - features flags
; bx - child block
; dx - count
; es:di - list
push si
childLoop:
test es:[di].GCCI_flags, mask GCCF_ALWAYS_ADD
jnz nukeIt
test ax, es:[di].GCCI_featureMask
jz nextChild
nukeIt:
push si, ax, dx, bp
mov si, es:[di].GCCI_object ;bx:si = child
mov dl, VUM_NOW
clr bp
mov ax, MSG_GEN_REMOVE
call CO_ObjMessageFixupDS
pop si, ax, dx, bp
nextChild:
add di, size GenControlChildInfo
dec dx
jnz childLoop
pop si
mov di, offset GCBI_childList
call UnlockTableDI
afterChildren:
; free the child block
; I THINK we can actually dispense w/all of this. We're
; nuking the block anyway, so the object block output will
; certainly be nuked at that point, & I can't think of
; any problems that will occur if we just wait to receive
; the MSG_META_NOTIFY_OBJ_BLOCK_NOT_INTERACTIBLE naturally,
; so let's give a shot at this simpler approach.
; -- Doug 5/11/92
; NO, we can't, because we clear out our child block pointer
; below, and MSG_META_NOTIFY_OBJ_BLOCK_NOT_INTERACTIBLE
; (if/when it ever comes in) will just exit, so we have to
; do this now - Drew 1/8/93
push ax, bx, si, ds
call ObjLockObjBlock
mov ds, ax
clr bx
clr si
call ObjBlockSetOutput
tst ds:[OLMBH_interactibleCount] ; check interactible count
pop ax, bx, si, ds
call MemUnlock ; preserves flags
; If in-use count is non-zero, we must fake a
; MSG_META_NOTIFY_OBJ_BLOCK_NOT_INTERACTIBLE so that various good stuff
; happens (like dec'ing *our* interactible count). Since we clear the
; TGCI_childBlock below, we can't rely on the normal sending of
; MSG_META_NOTIFY_OBJ_BLOCK_NOT_INTERACTIBLE when the child block's
; interactible count actually goes to zero, hence we clear the
; output above.
jz inUseZero ; we got the MSG normally
mov cx, bx ; cx = child block
mov ax, MSG_META_NOTIFY_OBJ_BLOCK_NOT_INTERACTIBLE
call ObjCallInstanceNoLock ; preserves bx, si
inUseZero:
;
; Send a message to free this block up via the queue, in case there
; is a message queued up for it (the problem we had was that the
; PenInputControl has a view/content in its child block, so a
; MSG_META_CONTENT_VIEW_WIN_OPENED is queued up for the content, so
; if we call ObjFreeObjBlock before that message comes in, the system
; will die trying to do a VisOpen when the block is being destroyed.
;
mov cx, bx ;CX <- handle of block
mov bx, ds:[LMBH_handle]
mov ax, MSG_GEN_CONTROL_FREE_OBJ_BLOCK
mov di, mask MF_FORCE_QUEUE
call ObjMessage
; update the vardata
call DerefVardata
clr ds:[bx].TGCI_childBlock
clr ds:[bx].TGCI_features
and ds:[bx].TGCI_upToDate, not mask GCIF_NORMAL_UI
; This is the second half of the check in MSG_GEN_CONTROL_NOTIFY_-
; NOT_INTERACTABLE for TGCI_childBlock being non-zero and remaining
; on the active list if so. If no part of the controller is interactible
; then we need to remove ourselves from the active list now the children
; are gone. -- ardeb 5/11/95
tst ds:[bx].TGCI_interactableFlags
jnz done ; some part is interactible, still
test dupinfo.GCBI_flags, mask GCBF_IS_ON_ACTIVE_LIST or \
mask GCBF_MANUALLY_REMOVE_FROM_ACTIVE_LIST
jnz done ; always on active list or let subclass handle
; removal
mov ax, MSG_META_GCN_LIST_REMOVE
mov bx, ds:[LMBH_handle]
call AddOrRemoveActiveListEntry
done:
.leave
ret
GenControlDestroyUI endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlFreeObjBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calls ObjFreeObjBlock with the passed block
CALLED BY: GLOBAL
PASS: cx - block to free
RETURN: nada
DESTROYED: ax, cx, dx, bp
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 3/11/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlFreeObjBlock method GenControlClass, MSG_GEN_CONTROL_FREE_OBJ_BLOCK
.enter
mov bx, cx
call ObjFreeObjBlock
Destroy ax, cx, dx, bp
.leave
ret
GenControlFreeObjBlock endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlDestroyToolboxUI -- MSG_GEN_CONTROL_DESTROY_TOOLBOX_UI
for GenControlClass
DESCRIPTION: Destroy the UI for the controller's toolbox
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/20/91 Initial version
------------------------------------------------------------------------------@
GenControlDestroyToolboxUI method dynamic GenControlClass,
MSG_GEN_CONTROL_DESTROY_TOOLBOX_UI
mov ax, ATTR_GEN_CONTROL_APP_TOOLBOX_UI
call RemoveAppUI
mov ax, MSG_GEN_CONTROL_NOTIFY_NOT_INTERACTABLE
mov cx, mask GCIF_TOOLBOX_UI
call ObjCallInstanceNoLock
; Fetch Tool Holder object & set all children not usable, remove them.
;
push si
call DerefVardata
mov si, ds:[bx].TGCI_toolParent.chunk
mov bx, ds:[bx].TGCI_toolParent.handle
call ObjSwapLock
nextChild:
mov di, ds:[si]
add di, ds:[di].Gen_offset
mov cx, ds:[di].GI_comp.CP_firstChild.handle
mov dx, ds:[di].GI_comp.CP_firstChild.chunk
tst cx
jz childrenGone
; ^lcx:dx = child object to set not usable & remove
push bx, si
mov bx, cx
mov si, dx
; mov ax, MSG_GEN_REMOVE
; mov dl, VUM_DELAYED_VIA_UI_QUEUE ; in case we're "re-doing" the
; ; toolbox, avoid doing geometry
; ; twice.
; clr bp
; call CO_ObjMessageFixupDS
;The above is insufficient -- the SET_NOT_USABLE in GEN_REMOVE may not cause
;unbuilding if the child object is not *fully* usable. It won't be fully
;usable if the toolbox UI is being destroyed because some object containing
;both the controller and the tool group (in that order) is being set not
;usable. The problem occurs because we are removing the children from the
;gen tree before the UNBUILD (from the original set not usable) can get to
;them. The side effect of this fix is that toolbox UI destruction may be
;slightly slower as SPEC_SET_NOT_USABLE may happen twice. - brianc 6/13/95
call ObjSwapLock ; *ds:si = child object
; bx = tool group handle
mov dl, VUM_DELAYED_VIA_UI_QUEUE
mov ax, MSG_GEN_SET_NOT_USABLE
call ObjCallInstanceNoLock
call GenCheckIfSpecGrown
jnc notGrown
mov dl, VUM_DELAYED_VIA_UI_QUEUE
mov ax, MSG_SPEC_SET_NOT_USABLE
call ObjCallInstanceNoLock
notGrown:
clr bp
mov cx, ds:[LMBH_handle]
mov dx, si
mov ax, MSG_GEN_REMOVE_CHILD
call GenCallParent
call ObjSwapUnlock
;end of change
pop bx, si
jmp short nextChild
childrenGone:
call ObjSwapUnlock
pop si
; Then, nuke the duplicated tool block, & clear out references to
; the tools.
;
call DerefVardata
clr cx
and ds:[bx].TGCI_upToDate, not mask GCIF_TOOLBOX_UI
mov ds:[bx].TGCI_toolParent.handle, cx
mov ds:[bx].TGCI_toolParent.chunk, cx
mov ds:[bx].TGCI_toolboxFeatures, cx
xchg cx, ds:[bx].TGCI_toolBlock ;CX <- child block to free
;
; Send a message to free this block up via the queue, in case there
; is a message queued up for it (the problem we had was that the
; PenInputControl has a view/content in its child block, so a
; MSG_META_CONTENT_VIEW_WIN_OPENED is queued up for the content, so
; if we call ObjFreeObjBlock before that message comes in, the system
; will die trying to do a VisOpen when the block is being destroyed.
;
mov bx, ds:[LMBH_handle]
mov ax, MSG_GEN_CONTROL_FREE_OBJ_BLOCK
mov di, mask MF_FORCE_QUEUE
GOTO ObjMessage
GenControlDestroyToolboxUI endm
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlAddFeature -- MSG_GEN_CONTROL_ADD_FEATURE
for GenControlClass
DESCRIPTION: Add a feature (allow the user to access it)
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
cx - flag for feature to add
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/21/91 Initial version
------------------------------------------------------------------------------@
GenControlAddFeature method dynamic GenControlClass,
MSG_GEN_CONTROL_ADD_FEATURE
; add the appropriate hint
clr dx
call AddUserFeatureHint
FALL_THRU GenControlRebuildNormalUI
GenControlAddFeature endm
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlRebuildNormalUI -- MSG_GEN_CONTROL_REBUILD_NORMAL_UI
for GenControlClass
DESCRIPTION: Rebuild the normal UI
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/15/92 Initial version
------------------------------------------------------------------------------@
GenControlRebuildNormalUI method GenControlClass,
MSG_GEN_CONTROL_REBUILD_NORMAL_UI
call SendToSuperIfFlagSet
; only rebuild in built currently
call DerefVardata
tst ds:[bx].TGCI_childBlock
jz done
call SendDestroyUI
mov ax, MSG_GEN_CONTROL_GENERATE_UI
call ObjCallInstanceNoLock
; Notify Toolbox of feature change
mov ax, mask GCSF_NORMAL_FEATURES_CHANGED
call ControlSendStatusChange
; MSG_GEN_CONTROL_GENERATE_UI uses VUM_MANUAL thinking it was
; initiated because of a visual update, however, that is not the
; case here, so we update ourselves
mov ax, MSG_GEN_UPDATE_VISUAL
mov dl, VUM_DELAYED_VIA_UI_QUEUE
call ObjCallInstanceNoLock
; if we are a dialog box then we want to reset our geometry
mov di, ds:[si]
add di, ds:[di].Gen_offset
cmp ds:[di].GII_visibility, GIV_DIALOG
jnz afterDialog
mov ax, MSG_GEN_RESET_TO_INITIAL_SIZE
mov dl, VUM_NOW
call ObjCallInstanceNoLock
afterDialog:
done:
ret
GenControlRebuildNormalUI endm
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlRemoveFeature -- MSG_GEN_CONTROL_REMOVE_FEATURE
for GenControlClass
DESCRIPTION: Remove a feature (don't allow the user to access it)
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
cx - flag for feature to remove
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/21/91 Initial version
------------------------------------------------------------------------------@
GenControlRemoveFeature method dynamic GenControlClass,
MSG_GEN_CONTROL_REMOVE_FEATURE
; add the appropriate hint
mov dx, cx
clr cx
call AddUserFeatureHint
GOTO GenControlRebuildNormalUI
GenControlRemoveFeature endm
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlAddToolboxFeature --
MSG_GEN_CONTROL_ADD_TOOLBOX_FEATURE for GenControlClass
DESCRIPTION: Add a feature (allow the user to access it)
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
cx - flag for features to add
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/21/91 Initial version
------------------------------------------------------------------------------@
GenControlAddToolboxFeature method dynamic GenControlClass,
MSG_GEN_CONTROL_ADD_TOOLBOX_FEATURE
; add the appropriate hint
clr dx
call AddUserToolboxFeatureHint
FALL_THRU GenControlRebuildToolboxUI
GenControlAddToolboxFeature endm
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlRebuildToolboxUI -- MSG_GEN_CONTROL_REBUILD_TOOLBOX_UI
for GenControlClass
DESCRIPTION: Rebuild the toolbox UI
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 5/15/92 Initial version
------------------------------------------------------------------------------@
GenControlRebuildToolboxUI method GenControlClass,
MSG_GEN_CONTROL_REBUILD_TOOLBOX_UI
call DerefVardata
tst ds:[bx].TGCI_toolParent.handle
jz done
;
; Nuked this check, as this can be called when adding a toolbox feature
; when none existed before (and hence, no toolbox was around).
;
; tst ds:[bx].TGCI_toolBlock
; jz done
pushdw ds:[bx].TGCI_toolParent ; Save parent of tools
; Destroy the existing UI, and regenerate it
;
call SendDestroyToolboxUI
popdw cxdx ; Get parent for tools
mov ax, MSG_GEN_CONTROL_GENERATE_TOOLBOX_UI
call ObjCallInstanceNoLock
; Notify Toolbox of toolbox feature change
;
mov ax, mask GCSF_TOOLBOX_FEATURES_CHANGED
call ControlSendStatusChange
done:
ret
GenControlRebuildToolboxUI endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlRemoveToolboxFeature --
MSG_GEN_CONTROL_REMOVE_TOOLBOX_FEATURE for GenControlClass
DESCRIPTION: Remove a feature (don't allow the user to access it)
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
cx - flag for features to remove
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/21/91 Initial version
------------------------------------------------------------------------------@
GenControlRemoveToolboxFeature method dynamic GenControlClass,
MSG_GEN_CONTROL_REMOVE_TOOLBOX_FEATURE
; add the appropriate hint
mov dx, cx
clr cx
call AddUserToolboxFeatureHint
GOTO GenControlRebuildToolboxUI
GenControlRemoveToolboxFeature endm
COMMENT @----------------------------------------------------------------------
FUNCTION: AddUserFeatureHint
DESCRIPTION: Add a hint for a given user feature
CALLED BY: INTERNAL
PASS:
*ds:si - controller
cx - bits to add
dx - bits to remove
RETURN:
none
DESTROYED:
ax, bx
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/21/91 Initial version
------------------------------------------------------------------------------@
AddUserToolboxFeatureHint proc near
mov di, mask GCUF_USER_TOOLBOX_UI
mov bx, offset GCUD_userAddedToolboxUI
GOTO FeatureHintCommon
AddUserToolboxFeatureHint endp
AddUserFeatureHint proc near
mov di, mask GCUF_USER_UI
mov bx, offset GCUD_userAddedUI
FALL_THRU FeatureHintCommon
AddUserFeatureHint endp
FeatureHintCommon proc near
call EnsureOptionsLoaded
push bx
mov ax, HINT_GEN_CONTROL_USER_MODIFIED_UI
call ObjVarDerefData
pop ax
or ds:[bx].GCUD_flags, di
add bx, ax
or ds:[bx], cx
or ds:[bx+2], dx
not cx
not dx
and ds:[bx], dx
and ds:[bx+2], cx
ret
FeatureHintCommon endp
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlSaveOptions -- MSG_META_SAVE_OPTIONS
for GenControlClass
DESCRIPTION: Save the state of the features in the .ini file
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/21/91 Initial version
------------------------------------------------------------------------------@
GenControlSaveOptions method dynamic GenControlClass, MSG_META_SAVE_OPTIONS
dupinfo local GenControlBuildInfo
categoryBuffer local INI_CATEGORY_BUFFER_SIZE dup (char)
userData local GenControlUserData
ForceRef dupinfo
; See note at end -- Doug 1/93
; push ds:[LMBH_handle], si
.enter
call EnsureOptionsLoaded
mov ax, HINT_GEN_CONTROL_USER_MODIFIED_UI
call ObjVarFindData
jnc done
push si
mov si, bx ;ds:si = source
segmov es, ss
lea di, userData ;es:di = dest
mov cx, size GenControlUserData
rep movsb
pop si
call GetDupInfo
; get the category string
mov cx, ss
lea dx, categoryBuffer
call UserGetInitFileCategory ; get .ini category
call LoadCatAndKey
jcxz noKey
push bp
mov bp, size GenControlUserData
call InitFileWriteData
pop bp
noKey:
call UnlockIniKey
done:
.leave
; Optimization -- Do NOT call superclass. This prevents any superclass
; of GenControlClass from ever getting MSG_META_RESET_OPTIONS, but the need
; is not there, so we'll take it away in the name of speed. -- Doug 1/93
;
; pop bx, si
; call MemDerefDS
; mov ax, MSG_META_SAVE_OPTIONS
; call GC_SendToSuper
ret
GenControlSaveOptions endm
COMMENT @----------------------------------------------------------------------
MESSAGE: GenControlResetOptions -- MSG_META_RESET_OPTIONS
for GenControlClass
DESCRIPTION: Reset options
PASS:
*ds:si - instance data
es - segment of GenControlClass
ax - The message
RETURN:
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Tony 11/16/92 Initial version
------------------------------------------------------------------------------@
GenControlResetOptions method dynamic GenControlClass, MSG_META_RESET_OPTIONS
mov ax, HINT_GEN_CONTROL_USER_MODIFIED_UI
call ObjVarFindData
jnc done
call ObjVarDeleteData
call GenControlRebuildNormalUI
call GenControlRebuildToolboxUI
done:
ret
GenControlResetOptions endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlNotInteractable
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: One or more areas of the Controller are no longer
interactable. If no areas left interactable, we can
remove ourselves from the notification list(s)
PASS: *ds:si - instance data
ds:di - ptr to start of master instance data
es - segment of class
ax - MSG_GEN_CONTROL_NOTIFY_NOT_INTERACTABLE
cx - bits to reset
RETURN: nothing
ALLOWED TO DESTROY:
bx, si, di, ds, es
PSEUDO CODE/STRATEGY/KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 11/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlNotInteractable method dynamic GenControlClass,
MSG_GEN_CONTROL_NOTIFY_NOT_INTERACTABLE
dupinfo local GenControlBuildInfo
.enter
call DerefVardata
not cx
and ds:[bx].TGCI_interactableFlags, cx
jnz done
; remove ourselves from the notification lists, since no portions
; of the controller need to know about updates.
call GetDupInfo
test dupinfo.GCBI_flags, mask GCBF_ALWAYS_ON_GCN_LIST
jnz alwaysOnGCNList
push bp
mov ax, MSG_GEN_CONTROL_REMOVE_FROM_GCN_LISTS
call ObjCallInstanceNoLock
pop bp
alwaysOnGCNList:
; If Controller was added to active list to receive MSG_META_DETACH,
; remove it now, as nothing is interactable anymore
test dupinfo.GCBI_flags, mask GCBF_IS_ON_ACTIVE_LIST or \
mask GCBF_MANUALLY_REMOVE_FROM_ACTIVE_LIST
jnz done ; if always on active list,
; leave it there
; If Controller has childBlock, then don't remove from active list.
; We need to remain on the active list so we'll get a detach to
; rid ourselves of the child block. - Joon (6/23/93)
call DerefVardata
tst ds:[bx].TGCI_childBlock
jnz done
mov ax, MSG_META_GCN_LIST_REMOVE
mov bx, ds:[LMBH_handle]
call AddOrRemoveActiveListEntry
done:
.leave
ret
GenControlNotInteractable endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlRemoveFromGCNLists
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: Remove ourselves from any GCN lists we're on.
PASS: *ds:si - instance data
ds:di - ptr to start of master instance data
es - segment of class
ax - MSG_GEN_CONTROL_REMOVE_FROM_GCN_LISTS
RETURN: nothing
ALLOWED TO DESTROY:
bx, si, di, ds, es
PSEUDO CODE/STRATEGY/KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 11/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlRemoveFromGCNLists method dynamic GenControlClass,
MSG_GEN_CONTROL_REMOVE_FROM_GCN_LISTS
; Since we're coming off the GCN lists, & won't know if any updates
; to it happen beyond this point, clear out the "up to date" flags
; we have, to reflect that these objects may be out of date past
; this point.
;
push ax, es
call DerefVardata
clr ds:[bx].TGCI_upToDate
mov ax, MSG_META_GCN_LIST_REMOVE
call AddToGCNLists
pop ax, es
call SendToSuperIfFlagSet
ret
GenControlRemoveFromGCNLists endm
COMMENT @----------------------------------------------------------------------
FUNCTION: ControlSendStatusChange
DESCRIPTION: Send out notice about a change in this controller itself, for
any toolboxes wishing to take note.
CALLED BY: INTERNAL
PASS: *ds:si - this object
ax - GenControlStatusChange
RETURN: nothing
DESTROYED: nothing
------------------------------------------------------------------------------@
ControlSendStatusChange proc far uses ax, bx, cx, dx, di, bp
.enter
push ax
mov ax, size NotifyGenControlStatusChange
mov cx, ALLOC_DYNAMIC_NO_ERR_LOCK or mask HF_SHARABLE \
or (mask HAF_ZERO_INIT shl 8)
call MemAlloc
mov es, ax
; Initialize Data block reference count to 1, for call to
; MSG_META_GCN_LIST_SEND, which will decrement the count once
; done.
mov ax, 1
call MemInitRefCount
mov ax, ds:[LMBH_handle]
mov es:[NGCS_controller].handle, ax
mov es:[NGCS_controller].chunk, si
pop es:[NGCS_statusChange]
call MemUnlock
; bx = handle of data block
mov ax, MSG_META_NOTIFY_WITH_DATA_BLOCK
mov cx, MANUFACTURER_ID_GEOWORKS
mov dx, GWNT_GEN_CONTROL_NOTIFY_STATUS_CHANGE
mov bp, bx
mov di, mask MF_RECORD
call ObjMessage ; get event to send in di
sub sp, size GCNListMessageParams
mov bp, sp
mov ss:[bp].GCNLMP_ID.GCNLT_manuf, MANUFACTURER_ID_GEOWORKS
mov ss:[bp].GCNLMP_ID.GCNLT_type, GAGCNLT_GEN_CONTROL_NOTIFY_STATUS_CHANGE
mov ss:[bp].GCNLMP_block, bx
mov ss:[bp].GCNLMP_event, di
mov ss:[bp].GCNLMP_flags, 0 ; just send, no cache
mov ax, MSG_META_GCN_LIST_SEND
call GenCallApplication
add sp, size GCNListMessageParams
.leave
ret
ControlSendStatusChange endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlUnbuildIfPossible
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: SPEC_UNBUILD the normal UI block of componentry, if this
is something that can be done. Would be useful to be
able to do on machines with low amounts of swap space,
such as palmtops.
CALLED BY: INTERNAL
GenControlNotifyObjBlockNotInteractible
PASS: *ds:si - GenControl object
es - segment of class
ax - MSG_GEN_CONTROL_UNBUILD_NORMAL_UI_IF_POSSIBLE
RETURN: nothing
ALLOWED TO DESTROY:
bx, si, di, ds, es
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
A refresher course on SPEC_BUILD/SPEC_UNBUILD:
WIN_GROUPs get spec built on demand, when usable,
attached & realizable. On become not realizable, they visibly close
only & give themselves a one-way upward link, setting a flag to
let themselves know they've got this funny setup.
(TREE_BUILT_BUT_NOT_REALIZED)
SPEC_UNBUILD generally only happens as a direct result of becoming
NOT_USABLE, but also can come an object's way if the visible object
they sit on becomes NOT_USABLE. In this case, the SPEC_UNBUILD
message has the flag SBF_VIS_PARENT_UNBUILDING set, & results in
only one of the non-WIN_GROUP/WIN_GROUP sides getting un-visbuilt.
As unbuilds are mostly looked at as being set not-usable & going away,
I'm not sure it clears the one-way upward link, figuring the vis
data is about to be nuked anyway -- a bug that would have to be
fixed if we were to attempt to SPEC_UNBUILD one side of a WIN_GROUP
only dynamically without the other.
Thoughts on dynamically unbuilding controllers:
In the case where a controller is dual build, it should be
possible to set children NOT_USABLE, remove them, & then fake
a SBF_VIS_PARENT_UNBUILDING on oneself to cleanly unbuild just
the WIN_GROUP side. The next time the button is clicked on, the
controller will become realizable again, & will be built out.
With regards to non-win group portions, or controllers that aren't
dual build, however, unbuilding means removing children from a
visual tree having already been sized by the geometry manager. As
the wingroup is not visible, however, geometry won't be done until
the window is asked to come back up. If the controller's vis
composite is at least left in the tree, then it will at least
get geometry requests & VIS_OPEN when the window is realizable
again. As SPEC_BUILD is an operation that is invoked on
generic trees, however, & this is a visual opening sequence, the
controller will not receive any kind of SPEC_BUILD request. The
best you could shoot for would be to respond to the UPDATE_GEOMETRY
message by visually building with VUM_MANUAL to avoid blowing up
with a recursive visual update. Might work...
I don't believe there is any hope whatsoever in attempting
to be able to visually unbuild the controller object itself, i.e.
its non-win group part or visual shell if not dual-build, specifically
because there is no message that would ever get to it that could
be used to trigger the SPEC_BUILD.
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
* Is currently NOT being used.
All specific UI gadets have not been required to deal with
SBF_VIS_PARENT_UNBUILDING in the past. If we do decide we want to
use this message (perhaps for Palmtop machines), we'll
have to put some work into some of the UI gadgets so that they
support this correctly.
* Has only been tested for the case of GenStyleControl becoming a menu.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 12/91 Initial version
------------------------------------------------------------------------------@
GenControlUnbuildIfPossible method dynamic GenControlClass, \
MSG_GEN_CONTROL_UNBUILD_NORMAL_UI_IF_POSSIBLE
dupInfo local GenControlBuildInfo
segmov es, dgroup, ax ; SH
tst es:[unbuildControllers]
jz exit
;
; If HINT_GEN_CONTROL_DESTROY_CHILDREN_WHEN_NOT_INTERACTABLE is
; present, unbuild the children even if the controller has
; ATTR_GEN_CONTROL_APP_UI present. This allows the app to provide
; extra UI, and still have the controller destroy the children when
; it is closed.
;
mov ax, HINT_GEN_CONTROL_DESTROY_CHILDREN_WHEN_NOT_INTERACTABLE
call ObjVarFindData
jc destroyIt
;
; If the controller has appUI that has been added, we have no way
; of knowing when this UI has been brought off-screen, so don't
; unbuild the children.
;
mov ax, ATTR_GEN_CONTROL_APP_UI
call ObjVarFindData
jc exit
destroyIt:
; Check to see if interactable (in-use). If so, it would be
; a bad idea to nuke it from the user's point of view. (Besides that,
; it's unclear that the approach used here would work or not)
;
call DerefVardata ;ds:bx = temp instance data
test ds:[bx].TGCI_interactableFlags, mask GCIF_NORMAL_UI
jnz exit
cmp cx, ds:[bx].TGCI_childBlock
jne exit
; Next check if this object dual-builds, i.e. has both a button
; & window part. If so, we should theoretically be able to
; unbuild the win-group part, If not, there's little hope of
; being able to unbuild.
;
mov di, ds:[si]
add di, ds:[di].Vis_offset
test ds:[di].VI_specAttrs, mask SA_USES_DUAL_BUILD
jnz dualBuild
;nonDualBuild:
test ds:[bx].TGCI_interactableFlags, mask GCIF_TOOLBOX_UI
jnz exit
; It is difficult (if not impossible) to unbuild this controller if it
; is not a dual build controller, as its children do not lie in a
; separate win group. It could be that this controller is the only
; child of a dialog, or is in some other fairly safe situation. If
; this is the case, the app can put the DESTROY_CHILDREN_WHEN_NOT_
; INTERACTABLE attribute on the controller, and we will unbuild the
; entire parent win group *of the controller*.
;
; We avoid various sticky situations (dealing with multiple controllers
; in a single win group, etc) by leaving the choice of behavior entirely
; up to the app - by definition, if unbuilding the parent is the wrong
; thing to do in a given situation, the app should not have put the
; attribute on the controller.
;
mov ax, HINT_GEN_CONTROL_DESTROY_CHILDREN_WHEN_NOT_INTERACTABLE
call ObjVarFindData
jnc exit
push si
mov ax, MSG_SPEC_UNBUILD_BRANCH
mov bx, segment VisClass
mov si, offset VisClass
mov bp, mask SBF_VIS_PARENT_UNBUILDING
mov di, mask MF_RECORD
call ObjMessage
mov cx, di ;CX <- ClassedEvent
pop si
mov ax, MSG_VIS_VUP_CALL_WIN_GROUP
GOTO ObjCallInstanceNoLock
exit:
ret
dualBuild:
; Make sure that the GCBF_DO_NOT_DESTROY_CHILDREN_WHEN_CLOSED bit
; is not set before unbuilding the children
.enter
call GetDupInfo
test dupInfo.GCBI_flags, mask GCBF_DO_NOT_DESTROY_CHILDREN_WHEN_CLOSED
.leave
jnz exit
; Instruct the specific UI to unbuild just the WIN_GROUP
; portion of the GenInteraction that the Controller comes off of.
;
mov ax, MSG_SPEC_UNBUILD_BRANCH
; Cheat -- use flag saying visible parent
; that the window was on is going away.
; Should unbuild window but leave button.
mov bp, mask SBF_VIS_PARENT_UNBUILDING
GOTO ObjCallInstanceNoLock
GenControlUnbuildIfPossible endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlOutputAction
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sends the passed event to the output of the controller
CALLED BY: GLOBAL
PASS: bp - event
RETURN: nada
DESTROYED: ax, cx, dx, bp
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 10/15/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlOutputAction method GenControlClass, MSG_GEN_CONTROL_OUTPUT_ACTION
mov di, ds:[si]
add di, ds:[di].GenControl_offset
movdw cxdx, ds:[di].GCI_output
mov ax, MSG_GEN_OUTPUT_ACTION
GOTO ObjCallInstanceNoLock
GenControlOutputAction endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlCheckIfInteractableObject
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This is called when a UserDoDialog is on the screen, to see
if the passed object can get events.
CALLED BY: GLOBAL
PASS: cx:dx - object
RETURN: carry set if in child block
DESTROYED: nada
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 1/22/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlCheckIfInteractableObject method GenControlClass,
MSG_META_CHECK_IF_INTERACTABLE_OBJECT
.enter
call DerefVardata
cmp cx, ds:[bx].TGCI_childBlock
stc
je exit
mov di, offset GenControlClass
call ObjCallSuperNoLock
exit:
.leave
ret
GenControlCheckIfInteractableObject endp
CO_ObjMessageFixupDS proc near
push di
mov di, mask MF_FIXUP_DS
call ObjMessage
pop di
ret
CO_ObjMessageFixupDS endp
ControlObject ends
HelpControlCode segment
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenControlGetHelpFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get help file for a controller
CALLED BY: MSG_META_GET_HELP_FILE
PASS: *ds:si - instance data
ds:di - *ds:si
es - seg addr of GenControlClass
ax - the message
cx:dx - buffer for help file name
RETURN: cx:dx - filled (NULL string for none)
carry - set if buffer filled
DESTROYED: bx, si, di, ds, es (method handler)
PSEUDO CODE/STRATEGY:
Normally objects check locally then gup to find the help file.
For controllers, we use the library name unless
ATTR_GEN_CONTROL_DO_NOT_USE_LIBRARY_NAME_FOR_HELP is present,
in which case the normal behavior is used.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
gene 11/ 3/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenControlGetHelpFile method dynamic GenControlClass,
MSG_META_GET_HELP_FILE
dupinfo local GenControlBuildInfo
ForceRef dupinfo
mov ax, ATTR_GEN_CONTROL_DO_NOT_USE_LIBRARY_NAME_FOR_HELP
call ObjVarFindData
jc callSuper ;branch if present
;
; Get the name of the library to use for the help file name
;
.enter
;
; Call ourself to get the controller info
;
push cx, dx, bp
mov cx, ss
lea dx, ss:dupinfo ;cx:dx = structure to fill in
mov ax, MSG_GEN_CONTROL_GET_INFO
call ObjCallInstanceNoLock
pop cx, dx, bp
;
; Get either the normal UI resource that is duplicated or the
; tool UI resource that is duplicated (whichever is non-NULL).
; From this we can get the library that defines the controller.
;
mov bx, ss:dupinfo.GCBI_dupBlock
tst bx ;any handle?
jnz gotHandle
mov bx, ss:dupinfo.GCBI_toolBlock
EC < tst bx ;>
EC < ERROR_Z GEN_CONTROL_NO_DUP_BLOCKS ;>
gotHandle:
;
; Get the owner of the duplicated block (the library)
;
mov ax, MGIT_OWNER_OR_VM_FILE_HANDLE ;ax <- MemGetInfoType
call MemGetInfo
;
; Get the permanent name of the library
;
mov bx, ax ;bx <- handle of library
mov ax, GGIT_PERM_NAME_ONLY ;ax <- GeodeGetInfoType
mov es, cx
mov di, dx ;es:di <- ptr to buffer
call GeodeGetInfo
;
; NULL-terminate the name
;
mov {char}es:[di+GEODE_NAME_SIZE], 0
call RemoveTrailingSpacesFromHelpFileName
stc ;carry <- filename found
.leave
ret
callSuper:
mov ax, MSG_META_GET_HELP_FILE
mov di, offset GenControlClass
GOTO ObjCallSuperNoLock
GenControlGetHelpFile endm
HelpControlCode ends
|
; A016937: a(n) = (6*n + 2)^5.
; 32,32768,537824,3200000,11881376,33554432,79235168,164916224,312500000,550731776,916132832,1453933568,2219006624,3276800000,4704270176,6590815232,9039207968,12166529024,16105100000,21003416576,27027081632,34359738368,43204003424,53782400000,66338290976,81136812032,98465804768,118636749824,141985700000,168874213376,199690286432,234849287168,274794888224,320000000000,370967703776,428232184832,492359665568,563949338624,643634300000,732082482176,829997587232,938120019968,1057227821024,1188137600000,1331705468576,1488827973632,1660443030368,1847530855424,2051114900000,2272262782976,2512087224032,2771746976768,3052447761824,3355443200000,3682035745376,4033577618432,4411471739168,4817172660224,5252187500000,5718076875776,6216455836832,6748994797568,7317420470624,7923516800000,8569125894176,9256148959232,9986547231968,10762342913024,11585620100000,12458525720576,13383270465632,14362129722368,15397444507424,16491622400000,17647138474976,18866536236032,20152428548768,21507498573824,22934500700000,24436261477376,26015680550432,27675731591168,29419463232224,31250000000000,33170543247776,35184372088832,37294844329568,39505397402624,41819549300000,44240899506176,46773129931232,49420005843968,52185376805024,55073177600000,58087429172576,61232239557632,64511804814368,67930409959424,71492429900000,75202330366976
mul $0,6
add $0,2
pow $0,5
|
// push constant 111
@111
D=A
@SP
A=M
M=D
@SP
M=M+1
// push constant 333
@333
D=A
@SP
A=M
M=D
@SP
M=M+1
// push constant 888
@888
D=A
@SP
A=M
M=D
@SP
M=M+1
// pop static 8
@16
D=A
@8
D=D+A
@R15
M=D
@SP
AM=M-1
D=M
@R15
A=M
M=D
// pop static 3
@16
D=A
@3
D=D+A
@R15
M=D
@SP
AM=M-1
D=M
@R15
A=M
M=D
// pop static 1
@16
D=A
@1
D=D+A
@R15
M=D
@SP
AM=M-1
D=M
@R15
A=M
M=D
// push static 3
@16
D=A
@3
A=D+A
D=M
@SP
A=M
M=D
@SP
M=M+1
// push static 1
@16
D=A
@1
A=D+A
D=M
@SP
A=M
M=D
@SP
M=M+1
// sub
@SP
AM=M-1
D=M
A=A-1
M=M-D
// push static 8
@16
D=A
@8
A=D+A
D=M
@SP
A=M
M=D
@SP
M=M+1
// add
@SP
AM=M-1
D=M
A=A-1
M=D+M
|
Music_MtMoon:
musicheader 4, 1, Music_MtMoon_Ch1
musicheader 1, 2, Music_MtMoon_Ch2
musicheader 1, 3, Music_MtMoon_Ch3
musicheader 1, 4, Music_MtMoon_Ch4
Music_MtMoon_Ch1:
tempo 208
volume $77
dutycycle $2
tone $0001
vibrato $8, $14
stereopanning $f0
notetype $c, $45
note __, 2
loopchannel 0, Music_MtMoon_branch_edb56
Music_MtMoon_Ch2:
vibrato $b, $15
dutycycle $2
notetype $c, $84
stereopanning $f
Music_MtMoon_branch_edb56:
octave 4
note D#, 6
note C#, 6
octave 3
note B_, 2
octave 4
note C#, 2
note D#, 2
note G_, 2
note D#, 2
note C#, 6
octave 3
note B_, 2
octave 4
note C#, 2
note D#, 2
note G_, 2
note D#, 2
note C#, 6
octave 3
note B_, 2
note A#, 2
note B_, 6
octave 4
note C#, 10
note G#, 6
note F#, 6
note E_, 2
note F#, 2
note G#, 2
octave 5
note C_, 2
octave 4
note G#, 2
note F#, 6
note E_, 2
note F#, 2
note G#, 2
octave 5
note C_, 2
octave 4
note G#, 2
note F#, 6
note E_, 2
note D#, 2
note E_, 6
note F#, 6
note E_, 4
loopchannel 0, Music_MtMoon_branch_edb56
Music_MtMoon_Ch3:
Music_MtMoon_branch_edb8a:
notetype $c, $28
Music_MtMoon_branch_edb8d:
octave 2
note B_, 2
octave 3
note D#, 2
note G_, 2
octave 2
note B_, 2
octave 3
note D#, 2
note G_, 2
octave 2
note B_, 2
octave 3
note D#, 2
loopchannel 3, Music_MtMoon_branch_edb8d
octave 2
note B_, 2
octave 3
note D#, 2
note G_, 2
octave 2
note B_, 2
octave 3
note D#, 2
note G_, 2
note D#, 2
note E_, 2
Music_MtMoon_branch_edbab:
note E_, 2
note G#, 2
octave 4
note C_, 2
octave 3
note E_, 2
note G#, 2
octave 4
note C_, 2
octave 3
note E_, 2
note G#, 2
loopchannel 4, Music_MtMoon_branch_edbab
loopchannel 0, Music_MtMoon_branch_edb8a
Music_MtMoon_Ch4:
togglenoise $5
notetype $c
Music_MtMoon_branch_edbc3:
stereopanning $f
note A#, 4
note A#, 8
note A#, 4
stereopanning $f0
note A#, 4
note A#, 4
note A#, 4
stereopanning $f
note A#, 4
note A#, 4
stereopanning $f0
note A#, 8
loopchannel 0, Music_MtMoon_branch_edbc3
|
/*****************************************************************************
*
* NXP Confidential Proprietary
*
* Copyright 2018 NXP
* All Rights Reserved
*
******************************************************************************
*
* THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED 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 NXP OR ITS 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 max_08u_proc_desc.hpp
* @brief Process description for max (unsigned 8 bit)
***********************************************************************************/
#ifndef MAX08UAPUPROCESSDESC_HPP
#define MAX08UAPUPROCESSDESC_HPP
#include <acf_process_desc_apu.hpp>
#include <acf_graph.hpp>
#include "graph_templates.h"
#include "arithmetic_acf.h"
GRAPH_CLASS_DEF_2In_1Out(MAX_08u_K)
#define MAX_08U_P_ID MAX_08U
#define MAX_08U_P_STR XSTR(MAX_08U_P_ID)
class max_08u_apu_process_desc : public ACF_Process_Desc_APU
{
public:
void Create()
{
Initialize(mGraph, MAX_08U_P_STR);
}
graphClassName(MAX_08u_K) mGraph;
};
#ifdef APEX2_EMULATE
REGISTER_PROCESS_TYPE(MAX_08U_P_ID, max_08u_apu_process_desc)
#endif
#endif /* MAX08UAPUPROCESSDESC_HPP */
|
dw $0040
track_12_08:
db $F5, $77, $86, $EF, $47, $1E, $4F, $1E, $F8, $77
db $EF, $47, $B1, $C3, $DF, $0F, $67, $99, $E3, $7B
db $DC, $0C, $0F, $FD, $E8, $E9, $C4, $BE, $EA, $A3
db $EE, $FD, $2F, $3F, $A8, $F6, $8C, $4B, $AC, $E1
db $D3, $48, $F9, $EF, $87, $AB, $BB, $AF, $BD, $EA
db $78, $F3, $EF, $72, $BB, $BB, $7B, $DD, $E7, $8E
db $DE, $F7, $4B, $BB, $87, $BD, $D2, $78, $E7, $EF
db $70, $BB, $B7, $BD, $C6, $78, $FD, $DE, $8E, $9C
db $4B, $E6, $AA, $3E, $AF, $D2, $F1, $FA, $8F, $58
db $C4, $BA, $4E, $1C, $F4, $8F, $DD, $E8, $E9, $C4
db $BE, $6A, $A3, $EA, $FD, $2F, $1F, $A8, $F5, $8C
db $4B, $A4, $E1, $CF, $48, $FF, $DE, $8E, $9C, $4B
db $EE, $AA, $3E, $EF, $D2, $F3, $FA, $8F, $68, $C4
db $BA, $CE, $1D, $34, $80 |
; A082766: Series ratios converge alternately to sqrt(2) and 1+sqrt(1/2).
; Submitted by Jamie Morken(s2)
; 1,1,2,3,4,7,10,17,24,41,58,99,140,239,338,577,816,1393,1970,3363,4756,8119,11482,19601,27720,47321,66922,114243,161564,275807,390050,665857,941664,1607521,2273378,3880899,5488420,9369319,13250218,22619537,31988856,54608393,77227930,131836323,186444716,318281039,450117362,768398401,1086679440,1855077841,2623476242,4478554083,6333631924,10812186007,15290740090,26102926097,36915112104,63018038201,89120964298,152139002499,215157040700,367296043199,519435045698,886731088897,1254027132096
mov $3,1
lpb $0
sub $0,1
add $1,$3
dif $2,2
add $2,$1
sub $1,$2
sub $3,$1
lpe
mov $0,$3
|
.nds
.relativeinclude on
.erroronwarning on
; This patch allows the front and back entrances of Kalidus to be unlocked separately from one another.
; Normally you'd need to unlock the front entrance first, then the back entrance.
; Trying to unlock the back entrance first would crash the game.
; With this patch you can make the separate unlocks as follows:
; * Unlock the front entrance with Var A = 6 and Var B = 3
; * Unlock the back entrance with Var A = 6 and Var B = 1 (same as vanilla)
@Overlay86Start equ 0x022EB1A0
@FreeSpace equ @Overlay86Start + 0xB0
.open "ftc/arm9.bin", 02000000h
; Don't try to add the hand pointing to the new entrance in Kalidus, since that causes a crash when the back entrance is unlocked before the normal entrance.
.org 0x02045A10
pop r3-r9, r15
.close
.open "ftc/overlay9_19", 021FFFC0h
; After checking if Var B is 1 or 2, also check if it's 3.
.org 0x0221D800
b @CheckIsKalidusFrontEntranceUnlock
; Remove the code that sets misc flag 0x31 when Var B is 1.
; That misc flag makes Kalidus be marked as NEW, and instead of that going away when the player enters Kalidus like a normal area, it would only go away after the player has unlocked more than one entrance into Kalidus and opens the screen to select which entrance to use.
.org 0x0221D81C
nop
.close
.open "ftc/overlay9_86", @Overlay86Start
.org @FreeSpace
@CheckIsKalidusFrontEntranceUnlock:
cmp r0, 3h ; Check if Var A is 3
bne 0x0221D844 ; It's not, so return
; If it is, unlock the front entrance by setting room 06-00-00 as explored.
mov r0, 6h
mov r1, 0h
mov r2, 0h
bl 02046144h ; MapSetRoomExplored
b 0x0221D844 ; Return
.close
|
###############################################################################
# Copyright 2018 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 cpAESEncryptXTS_AES_NI
.type cpAESEncryptXTS_AES_NI, @function
cpAESEncryptXTS_AES_NI:
push %ebp
mov %esp, %ebp
push %ebx
push %esi
push %edi
movl (12)(%ebp), %esi
movl (8)(%ebp), %edi
mov %esp, %eax
sub $(88), %esp
and $(-16), %esp
movl %eax, (84)(%esp)
movl (28)(%ebp), %eax
movdqu (%eax), %xmm4
movdqa %xmm4, %xmm7
mov $(135), %eax
mov $(1), %ecx
movd %eax, %xmm0
movd %ecx, %xmm1
punpcklqdq %xmm1, %xmm0
movl (20)(%ebp), %ecx
movl (16)(%ebp), %edx
movl (24)(%ebp), %eax
movdqa %xmm0, (%esp)
movl %eax, (80)(%esp)
sub $(4), %edx
jl .Lshort_inputgas_1
jmp .Lblks_loop_epgas_1
.Lblks_loopgas_1:
pxor %xmm1, %xmm1
movdqa %xmm7, %xmm4
pcmpgtq %xmm7, %xmm1
paddq %xmm4, %xmm4
palignr $(8), %xmm1, %xmm1
pand %xmm0, %xmm1
pxor %xmm1, %xmm4
.Lblks_loop_epgas_1:
movdqa %xmm4, (16)(%esp)
pxor %xmm1, %xmm1
movdqa %xmm4, %xmm5
pcmpgtq %xmm4, %xmm1
paddq %xmm5, %xmm5
palignr $(8), %xmm1, %xmm1
pand %xmm0, %xmm1
pxor %xmm1, %xmm5
movdqa %xmm5, (32)(%esp)
pxor %xmm1, %xmm1
movdqa %xmm5, %xmm6
pcmpgtq %xmm5, %xmm1
paddq %xmm6, %xmm6
palignr $(8), %xmm1, %xmm1
pand %xmm0, %xmm1
pxor %xmm1, %xmm6
movdqa %xmm6, (48)(%esp)
pxor %xmm1, %xmm1
movdqa %xmm6, %xmm7
pcmpgtq %xmm6, %xmm1
paddq %xmm7, %xmm7
palignr $(8), %xmm1, %xmm1
pand %xmm0, %xmm1
pxor %xmm1, %xmm7
movdqa %xmm7, (64)(%esp)
movdqu (%esi), %xmm0
movdqu (16)(%esi), %xmm1
movdqu (32)(%esi), %xmm2
movdqu (48)(%esi), %xmm3
add $(64), %esi
pxor %xmm4, %xmm0
pxor %xmm5, %xmm1
pxor %xmm6, %xmm2
pxor %xmm7, %xmm3
movdqa (%ecx), %xmm4
lea (16)(%ecx), %ebx
pxor %xmm4, %xmm0
pxor %xmm4, %xmm1
pxor %xmm4, %xmm2
pxor %xmm4, %xmm3
movdqa (%ebx), %xmm4
add $(16), %ebx
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
movdqa (16)(%esp), %xmm4
movdqa (32)(%esp), %xmm5
movdqa (48)(%esp), %xmm6
movdqa (64)(%esp), %xmm7
pxor %xmm4, %xmm0
pxor %xmm5, %xmm1
pxor %xmm6, %xmm2
pxor %xmm7, %xmm3
movdqu %xmm0, (%edi)
movdqu %xmm1, (16)(%edi)
movdqu %xmm2, (32)(%edi)
movdqu %xmm3, (48)(%edi)
add $(64), %edi
movdqa (%esp), %xmm0
movl (80)(%esp), %eax
sub $(4), %edx
jge .Lblks_loopgas_1
.Lshort_inputgas_1:
add $(4), %edx
jz .Lquitgas_1
movl (80)(%esp), %eax
lea (,%eax,4), %ebx
lea (-144)(%ecx,%ebx,4), %ebx
jmp .Lsingle_blk_loop_epgas_1
.Lsingle_blk_loopgas_1:
pxor %xmm1, %xmm1
movdqa %xmm7, %xmm7
pcmpgtq %xmm7, %xmm1
paddq %xmm7, %xmm7
palignr $(8), %xmm1, %xmm1
pand %xmm0, %xmm1
pxor %xmm1, %xmm7
.Lsingle_blk_loop_epgas_1:
movdqu (%esi), %xmm1
add $(16), %esi
pxor %xmm7, %xmm1
pxor (%ecx), %xmm1
cmp $(12), %eax
jl .Lkey_128_sgas_1
.Lkey_256_sgas_1:
aesenc (-64)(%ebx), %xmm1
aesenc (-48)(%ebx), %xmm1
aesenc (-32)(%ebx), %xmm1
aesenc (-16)(%ebx), %xmm1
.Lkey_128_sgas_1:
aesenc (%ebx), %xmm1
aesenc (16)(%ebx), %xmm1
aesenc (32)(%ebx), %xmm1
aesenc (48)(%ebx), %xmm1
aesenc (64)(%ebx), %xmm1
aesenc (80)(%ebx), %xmm1
aesenc (96)(%ebx), %xmm1
aesenc (112)(%ebx), %xmm1
aesenc (128)(%ebx), %xmm1
aesenclast (144)(%ebx), %xmm1
pxor %xmm7, %xmm1
movdqu %xmm1, (%edi)
add $(16), %edi
sub $(1), %edx
jnz .Lsingle_blk_loopgas_1
.Lquitgas_1:
movl (28)(%ebp), %eax
movdqu %xmm7, (%eax)
mov (84)(%esp), %esp
pop %edi
pop %esi
pop %ebx
pop %ebp
ret
.Lfe1:
.size cpAESEncryptXTS_AES_NI, .Lfe1-(cpAESEncryptXTS_AES_NI)
|
// Copyright (c) 2018-2019, NVIDIA CORPORATION. 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 NVIDIA 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 ``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 "src/backends/tensorrt/plan_backend.h"
#include <NvInfer.h>
#include <stdint.h>
#include <mutex>
#include "src/backends/tensorrt/loader.h"
#include "src/backends/tensorrt/plan_utils.h"
#include "src/core/constants.h"
#include "src/core/logging.h"
#include "src/core/model_config_cuda.h"
#include "src/core/model_config_utils.h"
#include "src/core/provider.h"
#include "src/core/server_status.h"
namespace nvidia { namespace inferenceserver {
PlanBackend::Context::Context(
const std::string& name, const int gpu_device, const int max_batch_size)
: BackendContext(name, gpu_device, max_batch_size), runtime_(nullptr),
engine_(nullptr), context_(nullptr), byte_sizes_(nullptr),
buffers_(nullptr)
{
stream_ = nullptr;
}
PlanBackend::Context::~Context()
{
LOG_VERBOSE(1) << "~PlanBackend::Context ";
if (byte_sizes_ != nullptr) {
delete[] byte_sizes_;
byte_sizes_ = nullptr;
}
if (buffers_ != nullptr) {
for (int i = 0; i < engine_->getNbBindings(); ++i) {
if (buffers_[i] != nullptr) {
cudaError_t err = cudaFree(buffers_[i]);
if (err != cudaSuccess) {
LOG_ERROR << "Failed to free cuda memory for '" << name_
<< "': " << cudaGetErrorString(err);
}
}
}
delete[] buffers_;
buffers_ = nullptr;
}
for (const auto& pr : cuda_graph_execs_) {
cudaError_t err = cudaGraphExecDestroy(pr.second);
if (err != cudaSuccess) {
LOG_ERROR << "Failed to destroy cuda graph exec: "
<< cudaGetErrorString(err);
}
}
cuda_graph_execs_.clear();
for (const auto& pr : cuda_graphs_) {
cudaError_t err = cudaGraphDestroy(pr.second);
if (err != cudaSuccess) {
LOG_ERROR << "Failed to destroy cuda graph exec: "
<< cudaGetErrorString(err);
}
}
cuda_graphs_.clear();
if (stream_ != nullptr) {
cudaError_t err = cudaStreamDestroy(stream_);
if (err != cudaSuccess) {
LOG_ERROR << "Failed to destroy cuda stream: " << cudaGetErrorString(err);
}
stream_ = nullptr;
}
if (context_ != nullptr) {
context_->destroy();
context_ = nullptr;
}
if (engine_ != nullptr) {
engine_->destroy();
engine_ = nullptr;
}
if (runtime_ != nullptr) {
runtime_->destroy();
runtime_ = nullptr;
}
}
Status
PlanBackend::Init(const std::string& path, const ModelConfig& config)
{
RETURN_IF_ERROR(ValidateModelConfig(config, kTensorRTPlanPlatform));
RETURN_IF_ERROR(SetModelConfig(path, config));
return Status::Success;
}
Status
PlanBackend::CreateExecutionContexts(
const std::unordered_map<std::string, std::vector<char>>& models)
{
// TensorRT engine creation is not thread-safe, so multiple creations
// are serialized with a global lock.
static std::mutex global_context_mu;
std::lock_guard<std::mutex> glock(global_context_mu);
uint32_t total_context_cnt = 0;
// Create a runtime/engine/context trifecta for each instance.
//
// TODO [DLIS-14] This can be optimized by sharing a runtime (across
// all instances?), and sharing an engine across instances that have
// access to the same GPU.
for (const auto& group : Config().instance_group()) {
// TensorRT requires that every context have a GPU.
if ((group.kind() != ModelInstanceGroup::KIND_GPU) ||
(group.gpus().size() == 0)) {
return Status(
RequestStatusCode::INVALID_ARG,
"instance group " + group.name() + " of model " + Name() +
" must be KIND_GPU and must specify at least one GPU id");
}
for (int c = 0; c < group.count(); c++) {
for (int gpu_device : group.gpus()) {
const std::string instance_name = group.name() + "_" +
std::to_string(c) + "_gpu" +
std::to_string(gpu_device);
RETURN_IF_ERROR(
CreateExecutionContext(instance_name, gpu_device, models));
total_context_cnt++;
}
}
}
// Create a scheduler with one thread for each context available for
// this model. Each runner is exclusively tied to the context.
RETURN_IF_ERROR(SetConfiguredScheduler(
total_context_cnt,
[](uint32_t runner_idx) -> Status { return Status::Success; },
[this](
uint32_t runner_idx, std::vector<Scheduler::Payload>* payloads,
std::function<void(Status)> func) {
Run(runner_idx, payloads, func);
}));
LOG_VERBOSE(1) << "plan backend for " << Name() << std::endl << *this;
return Status::Success;
}
Status
PlanBackend::CreateExecutionContext(
const std::string& instance_name, const int gpu_device,
const std::unordered_map<std::string, std::vector<char>>& models)
{
cudaError_t cuerr;
// Determine the model file to use for device compute capability
cudaDeviceProp cuprops;
cuerr = cudaGetDeviceProperties(&cuprops, gpu_device);
if (cuerr != cudaSuccess) {
return Status(
RequestStatusCode::INTERNAL,
"unable to get CUDA device properties for " + Name() + ": " +
cudaGetErrorString(cuerr));
}
const std::string cc =
std::to_string(cuprops.major) + "." + std::to_string(cuprops.minor);
const auto& cc_itr = Config().cc_model_filenames().find(cc);
const std::string& cc_model_filename =
(cc_itr == Config().cc_model_filenames().end())
? Config().default_model_filename()
: cc_itr->second;
const auto& mn_itr = models.find(cc_model_filename);
if (mn_itr == models.end()) {
return Status(
RequestStatusCode::INTERNAL,
"unable to find PLAN model '" + cc_model_filename + "' for " + Name());
}
LOG_INFO << "Creating instance " << instance_name << " on GPU " << gpu_device
<< " (" << cc << ") using " << cc_model_filename;
// Max batch size. A value of 0 in the config becomes NO_BATCHING.
const int mbs = (Config().max_batch_size() <= 0) ? Context::NO_BATCHING
: Config().max_batch_size();
contexts_.emplace_back(new Context(instance_name, gpu_device, mbs));
const std::unique_ptr<Context>& context = contexts_.back();
// Set the device before generating engine and context.
cuerr = cudaSetDevice(gpu_device);
if (cuerr != cudaSuccess) {
return Status(
RequestStatusCode::INTERNAL, "unable to set device for " + Name() +
": " + cudaGetErrorString(cuerr));
}
RETURN_IF_ERROR(
LoadPlan(mn_itr->second, &context->runtime_, &context->engine_));
if (context->max_batch_size_ > context->engine_->getMaxBatchSize()) {
return Status(
RequestStatusCode::INVALID_ARG,
"unexpected configuration maximum batch size " +
std::to_string(Config().max_batch_size()) + " for '" + Name() +
"', model maximum is " +
std::to_string(context->engine_->getMaxBatchSize()));
}
const int num_expected_bindings = context->engine_->getNbBindings();
// Collect all the expected input and allowed output tensor names
// and validate that the model configuration specifies only those.
std::set<std::string> allowed_inputs, allowed_outputs;
for (int i = 0; i < num_expected_bindings; ++i) {
if (context->engine_->bindingIsInput(i)) {
allowed_inputs.emplace(context->engine_->getBindingName(i));
} else {
allowed_outputs.emplace(context->engine_->getBindingName(i));
}
}
for (const auto& io : Config().input()) {
RETURN_IF_ERROR(CheckAllowedModelInput(io, allowed_inputs));
}
for (const auto& io : Config().output()) {
RETURN_IF_ERROR(CheckAllowedModelOutput(io, allowed_outputs));
}
RETURN_IF_ERROR(context->ValidateInputs(Config().input()));
RETURN_IF_ERROR(context->ValidateOutputs(Config().output()));
// Initialize the inputs and outputs. Make sure the model matches
// what is in the configuration. Allocate memory for the maximum
// possible batch size: min(engine maximum, config maximum)
context->byte_sizes_ = new uint64_t[num_expected_bindings];
context->buffers_ = new void*[num_expected_bindings](); // init to nullptr
RETURN_IF_ERROR(context->InitializeConfigInputBindings(Config().input()));
RETURN_IF_ERROR(context->InitializeSequenceControlInputBindings(Config()));
RETURN_IF_ERROR(context->InitializeConfigOutputBindings(Config().output()));
// Make sure every index is initialized.
for (int i = 0; i < num_expected_bindings; ++i) {
if (context->buffers_[i] == nullptr) {
return Status(
RequestStatusCode::INVALID_ARG,
"expected configuration for " +
std::string(
(context->engine_->bindingIsInput(i) ? "input" : "output")) +
" '" + context->engine_->getBindingName(i) + "' for " + Name());
}
}
// Now the TRT execution context
context->context_ = context->engine_->createExecutionContext();
if (context->context_ == nullptr) {
return Status(
RequestStatusCode::INTERNAL, "unable to create TensorRT context");
}
// Create CUDA stream associated with the execution context
const int cuda_stream_priority =
GetCudaStreamPriority(Config().optimization().priority());
RETURN_IF_ERROR(context->CreateCudaStream(cuda_stream_priority));
// CUDA 10.1 starts to support CUDA graphs.
// If enabled, build CUDA graphs for a default set of graph
// sizes. Graphs are most likely to help for small batch sizes so by
// default build for batch sizes 1, 2, 3, 4, 6, 8, 12, 16. If any
// build fails don't attempt for any larger batch sizes.
#ifdef TRTIS_ENABLE_CUDA_GRAPH
const bool use_cuda_graphs = Config().optimization().cuda().graphs();
if (use_cuda_graphs) {
if (context->BuildCudaGraph(1)) {
for (int bs : std::vector<int>{2, 3, 4, 6, 8, 12, 16}) {
if (bs <= Config().max_batch_size()) {
if (!context->BuildCudaGraph(bs)) {
break;
}
}
}
}
}
#endif
LOG_INFO << "Created instance " << instance_name << " on GPU " << gpu_device
<< " (" << cc << ") with stream priority " << cuda_stream_priority;
return Status::Success;
}
Status
PlanBackend::Context::ValidateInputs(
const ::google::protobuf::RepeatedPtrField<ModelInput>& ios)
{
for (const auto& io : ios) {
if (!ConvertDataTypeToTrtType(io.data_type()).first) {
return Status(
RequestStatusCode::INTERNAL,
"unsupported datatype " + DataType_Name(io.data_type()) +
" for input '" + io.name() + "' for model '" + name_ + "'");
}
}
return Status::Success;
}
Status
PlanBackend::Context::ValidateOutputs(
const ::google::protobuf::RepeatedPtrField<ModelOutput>& ios)
{
for (const auto& io : ios) {
if (!ConvertDataTypeToTrtType(io.data_type()).first) {
return Status(
RequestStatusCode::INTERNAL,
"unsupported datatype " + DataType_Name(io.data_type()) +
" for output '" + io.name() + "' for model '" + name_ + "'");
}
}
return Status::Success;
}
Status
PlanBackend::Context::InitializeInputBinding(
const std::string& input_name, const DataType input_datatype,
const DimsList& model_config_dims)
{
int index = engine_->getBindingIndex(input_name.c_str());
if (index < 0) {
return Status(
RequestStatusCode::NOT_FOUND,
"input '" + input_name + "' not found for " + name_);
}
if (buffers_[index] != nullptr) {
return Status(
RequestStatusCode::INVALID_ARG, "input '" + input_name +
"' has already appeared as an " +
"input or output for " + name_);
}
if (!engine_->bindingIsInput(index)) {
return Status(
RequestStatusCode::INVALID_ARG,
"input '" + input_name + "' is expected to be an output in model for " +
name_);
}
DataType dt = ConvertTrtTypeToDataType(engine_->getBindingDataType(index));
if (dt != input_datatype) {
return Status(
RequestStatusCode::INVALID_ARG,
"unexpected datatype " + DataType_Name(dt) + " for input '" +
input_name + "', expecting " + DataType_Name(input_datatype) +
" for " + name_);
}
nvinfer1::Dims engine_dims = engine_->getBindingDimensions(index);
if (!CompareDims(engine_dims, model_config_dims)) {
return Status(
RequestStatusCode::INVALID_ARG,
"unexpected shape for input '" + input_name +
"', model configuration shape is " +
DimsListToString(model_config_dims) + ", inference shape is " +
DimsDebugString(engine_dims) + " for " + name_);
}
const int64_t byte_size = GetByteSize(max_batch_size_, dt, model_config_dims);
if (byte_size == -1) {
return Status(
RequestStatusCode::INTERNAL,
"unable to calculate size for input '" + input_name + " for " + name_);
}
// Allocate CUDA memory. We rely on buffers_ being non-nullptr to
// indicate that the buffer has been correctly initalized so even
// for zero-sized tensors always allocate something.
void* buffer;
cudaError_t err = cudaMalloc(&buffer, std::max((int64_t)1, byte_size));
if (err != cudaSuccess) {
return Status(
RequestStatusCode::INTERNAL, "unable to allocate memory for input '" +
input_name + " for " + name_ + ": " +
cudaGetErrorString(err));
}
byte_sizes_[index] = byte_size;
buffers_[index] = buffer;
return Status::Success;
}
Status
PlanBackend::Context::InitializeSequenceControlInputBindings(
const ModelConfig& config)
{
if (config.has_sequence_batching()) {
std::vector<ModelSequenceBatching::Control::Kind> kinds{
ModelSequenceBatching::Control::CONTROL_SEQUENCE_START,
ModelSequenceBatching::Control::CONTROL_SEQUENCE_READY};
for (const ModelSequenceBatching::Control::Kind control_kind : kinds) {
std::string tensor_name;
DataType tensor_datatype;
RETURN_IF_ERROR(GetSequenceControlProperties(
config.sequence_batching(), config.name(), control_kind,
true /* required */, &tensor_name, &tensor_datatype, nullptr, nullptr,
nullptr, nullptr));
// Control tensors must have shape [1,1,1].
DimsList dims;
dims.Add(1);
dims.Add(1);
dims.Add(1);
RETURN_IF_ERROR(
InitializeInputBinding(tensor_name, tensor_datatype, dims));
}
}
return Status::Success;
}
Status
PlanBackend::Context::InitializeConfigInputBindings(
const ::google::protobuf::RepeatedPtrField<ModelInput>& ios)
{
for (const auto& io : ios) {
const DimsList& model_config_dims =
(io.has_reshape()) ? io.reshape().shape() : io.dims();
RETURN_IF_ERROR(
InitializeInputBinding(io.name(), io.data_type(), model_config_dims));
}
return Status::Success;
}
Status
PlanBackend::Context::InitializeConfigOutputBindings(
const ::google::protobuf::RepeatedPtrField<ModelOutput>& ios)
{
for (const auto& io : ios) {
int index = engine_->getBindingIndex(io.name().c_str());
if (index < 0) {
return Status(
RequestStatusCode::NOT_FOUND,
"output '" + io.name() + "' not found for " + name_);
}
if (buffers_[index] != nullptr) {
return Status(
RequestStatusCode::INVALID_ARG, "output '" + io.name() +
"' has already appeared as an " +
"input or output for " + name_);
}
if (engine_->bindingIsInput(index)) {
return Status(
RequestStatusCode::INVALID_ARG,
"output '" + io.name() +
"' is expected to be an input in model for " + name_);
}
DataType dt = ConvertTrtTypeToDataType(engine_->getBindingDataType(index));
if (dt != io.data_type()) {
return Status(
RequestStatusCode::INVALID_ARG,
"unexpected datatype " + DataType_Name(dt) +
" for inference output '" + io.name() + "', expecting " +
DataType_Name(io.data_type()) + " for " + name_);
}
const DimsList& model_config_dims =
(io.has_reshape()) ? io.reshape().shape() : io.dims();
nvinfer1::Dims engine_dims = engine_->getBindingDimensions(index);
if (!CompareDims(engine_dims, model_config_dims)) {
return Status(
RequestStatusCode::INVALID_ARG,
"unexpected shape for output '" + io.name() +
"', model configuration shape is " +
DimsListToString(model_config_dims) + ", inference shape is " +
DimsDebugString(engine_dims) + " for " + name_);
}
const int64_t byte_size =
GetByteSize(max_batch_size_, dt, model_config_dims);
if (byte_size == -1) {
return Status(
RequestStatusCode::INTERNAL, "unable to calculate size for output '" +
io.name() + " for " + name_);
}
// Allocate CUDA memory. We rely on buffers_ being non-nullptr to
// indicate that the buffer has been correctly initalized so even
// for zero-sized tensors always allocate something.
void* buffer;
cudaError_t err = cudaMalloc(&buffer, std::max((int64_t)1, byte_size));
if (err != cudaSuccess) {
return Status(
RequestStatusCode::INTERNAL,
"unable to allocate memory for input '" + io.name() + " for " +
name_ + ": " + std::string(cudaGetErrorString(err)));
}
byte_sizes_[index] = byte_size;
buffers_[index] = buffer;
}
return Status::Success;
}
void
PlanBackend::Run(
uint32_t runner_idx, std::vector<Scheduler::Payload>* payloads,
std::function<void(Status)> OnCompleteQueuedPayloads)
{
// Each runner executes using the corresponding context...
if (runner_idx >= contexts_.size()) {
OnCompleteQueuedPayloads(Status(
RequestStatusCode::INTERNAL,
"unexpected runner index" + std::to_string(runner_idx) +
", max allowed " + std::to_string(contexts_.size())));
return;
}
std::vector<ModelInferStats::ScopedTimer> compute_timers;
for (auto& payload : *payloads) {
// Stop queue timer when the payload is scheduled to run
if (payload.queue_timer_ != nullptr) {
payload.queue_timer_.reset();
}
if (payload.stats_ != nullptr) {
compute_timers.emplace_back();
payload.stats_->StartComputeTimer(&compute_timers.back());
payload.stats_->SetGPUDevice(contexts_[runner_idx]->gpu_device_);
}
}
Status status = contexts_[runner_idx]->Run(payloads);
// reset compute timers before calling OnComplete function
compute_timers.clear();
OnCompleteQueuedPayloads(status);
}
// CUDA 10.1 starts to support CUDA graphs.
#ifdef TRTIS_ENABLE_CUDA_GRAPH
bool
PlanBackend::Context::BuildCudaGraph(const int batch_size)
{
bool captured = true;
cudaError_t cuerr;
cudaGraph_t graph;
cuerr = cudaStreamBeginCapture(stream_, cudaStreamCaptureModeGlobal);
if (cuerr != cudaSuccess) {
LOG_ERROR << "unable to start CUDA graph for " << name_ << ": "
<< cudaGetErrorString(cuerr);
captured = false;
} else {
if (!context_->enqueue(batch_size, buffers_, stream_, nullptr)) {
LOG_WARNING << "unable to record CUDA graph for " << name_;
captured = false;
}
cuerr = cudaStreamEndCapture(stream_, &graph);
if (cuerr != cudaSuccess) {
LOG_ERROR << "unable to finish CUDA graph for " << name_ << ": "
<< cudaGetErrorString(cuerr);
captured = false;
}
if (captured) {
cudaGraphExec_t graph_exec;
cuerr = cudaGraphInstantiate(&graph_exec, graph, NULL, NULL, 0);
if (cuerr != cudaSuccess) {
LOG_ERROR << "unable to instantiate CUDA graph for " << name_ << ": "
<< cudaGetErrorString(cuerr);
captured = false;
} else {
cuda_graphs_.insert(std::make_pair(batch_size, graph));
cuda_graph_execs_.insert(std::make_pair(batch_size, graph_exec));
}
}
}
if (captured) {
LOG_VERBOSE(1) << "captured CUDA graph for " << name_ << ", batch size "
<< batch_size;
}
return captured;
}
#endif
Status
PlanBackend::Context::Run(std::vector<Scheduler::Payload>* payloads)
{
LOG_VERBOSE(1) << "Running " << name_ << " with " << payloads->size()
<< " request payloads";
cudaSetDevice(gpu_device_);
// For each request in 'payloads' collect the total batch size for
// this inference execution. The batch-size, number of inputs, and
// size of each input has already been checked by each payloads
// request provider so don't need to do that here.
size_t total_batch_size = 0;
for (auto& payload : *payloads) {
if (!payload.status_.IsOk()) {
return Status(
RequestStatusCode::INTERNAL,
"unexpected payload with non-OK status given to runner for '" +
name_ + "'");
}
total_batch_size += payload.request_provider_->RequestHeader().batch_size();
}
// If there are no valid payloads then no need to run the
// inference. The payloads will have their error status set so can
// just return.
if (total_batch_size == 0) {
return Status::Success;
}
// total_batch_size can be 1 for models that don't support batching
// (i.e. max_batch_size_ == 0).
if ((total_batch_size != 1) && (total_batch_size > (size_t)max_batch_size_)) {
return Status(
RequestStatusCode::INTERNAL,
"dynamic batch size " + std::to_string(total_batch_size) + " for '" +
name_ + "', max allowed is " + std::to_string(max_batch_size_));
}
// For each input, concatenate input values from each payload into
// the corresponding binding.
for (int bindex = 0; bindex < engine_->getNbBindings(); ++bindex) {
if (!engine_->bindingIsInput(bindex)) {
continue;
}
const std::string& name = engine_->getBindingName(bindex);
const size_t batch1_byte_size =
byte_sizes_[bindex] / std::max(1, max_batch_size_);
// Visit the payloads in order and copy the input tensors to
// GPU. Skip payloads that had errors since they are not included
// in the dynamic batch.
std::vector<size_t> expected_byte_sizes;
for (auto& payload : *payloads) {
const InferRequestHeader& request_header =
payload.request_provider_->RequestHeader();
expected_byte_sizes.push_back(
request_header.batch_size() * batch1_byte_size);
}
SetInputBuffer(
name, expected_byte_sizes, payloads, TRTSERVER_MEMORY_GPU,
static_cast<char*>(buffers_[bindex]));
}
// Async execute the inference using a CUDA graph if available for
// the batch-size, otherwise execution normally.
auto itr = cuda_graph_execs_.find(total_batch_size);
if (itr != cuda_graph_execs_.end()) {
cudaError_t err = cudaGraphLaunch(itr->second, stream_);
if (err != cudaSuccess) {
cudaStreamSynchronize(stream_);
return Status(
RequestStatusCode::INTERNAL,
"unable to execute graph for inference " + name_ + ": " +
cudaGetErrorString(err));
}
} else {
if (!context_->enqueue(total_batch_size, buffers_, stream_, nullptr)) {
cudaStreamSynchronize(stream_);
return Status(
RequestStatusCode::INTERNAL,
"unable to enqueue for inference " + name_);
}
}
// For each requested output verify that the output can accept the
// actual model output and then copy that output from the GPU
bool cuda_copy = false;
for (int bindex = 0; bindex < engine_->getNbBindings(); ++bindex) {
if (engine_->bindingIsInput(bindex)) {
continue;
}
const std::string& name = engine_->getBindingName(bindex);
const size_t batch1_byte_size =
(byte_sizes_[bindex] / std::max(1, max_batch_size_));
// Get the shape of the output. If model supports batching then
// prepend the batch dimension onto the output shape.
std::vector<int64_t> shape;
if (max_batch_size_ != NO_BATCHING) {
shape.push_back(total_batch_size);
}
nvinfer1::Dims dims = engine_->getBindingDimensions(bindex);
for (int i = 0; i < dims.nbDims; ++i) {
shape.push_back(dims.d[i]);
}
if (byte_sizes_[bindex] < (batch1_byte_size * total_batch_size)) {
return Status(
RequestStatusCode::INTERNAL,
"unexpected size for output '" + name + "', byte-size " +
std::to_string(byte_sizes_[bindex]) + " is less than " +
std::to_string(total_batch_size) + " * " +
std::to_string(batch1_byte_size));
}
cuda_copy |= SetFixedSizeOutputBuffer(
name, batch1_byte_size, static_cast<char*>(buffers_[bindex]), shape,
TRTSERVER_MEMORY_GPU /* src_memory_type */, payloads);
}
// Wait for the copy-out to complete
if (cuda_copy) {
cudaStreamSynchronize(stream_);
}
return Status::Success;
}
std::ostream&
operator<<(std::ostream& out, const PlanBackend& pb)
{
out << "name=" << pb.Name() << std::endl;
out << "contexts:" << std::endl;
for (const auto& context : pb.contexts_) {
out << " name=" << context->name_ << ", gpu="
<< ((context->gpu_device_ == PlanBackend::Context::NO_GPU_DEVICE)
? "<none>"
: std::to_string(context->gpu_device_))
<< ", max_batch_size="
<< ((context->max_batch_size_ == PlanBackend::Context::NO_BATCHING)
? "<none>"
: std::to_string(context->max_batch_size_))
<< std::endl
<< " bindings:" << std::endl;
for (int i = 0; i < context->engine_->getNbBindings(); ++i) {
out << " " << i << ": byte_size=" << context->byte_sizes_[i]
<< ", buffer=" << context->buffers_[i] << " ]" << std::endl;
}
}
return out;
}
}} // namespace nvidia::inferenceserver
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r14
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1cf9f, %rbp
nop
nop
nop
nop
nop
cmp %r14, %r14
mov $0x6162636465666768, %rax
movq %rax, (%rbp)
nop
nop
nop
and %r12, %r12
lea addresses_normal_ht+0x114ff, %rsi
lea addresses_D_ht+0x1187f, %rdi
clflush (%rdi)
nop
cmp %r10, %r10
mov $15, %rcx
rep movsb
nop
nop
nop
nop
nop
xor %rcx, %rcx
lea addresses_D_ht+0x198ff, %rcx
nop
nop
nop
mfence
movl $0x61626364, (%rcx)
nop
nop
nop
nop
sub $60744, %r12
lea addresses_A_ht+0x2bbf, %rsi
lea addresses_WT_ht+0xa49f, %rdi
nop
nop
nop
xor %r10, %r10
mov $23, %rcx
rep movsb
nop
nop
nop
and $56111, %rsi
lea addresses_WC_ht+0x1c0ff, %rcx
nop
nop
nop
and %r10, %r10
vmovups (%rcx), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $1, %xmm4, %rsi
nop
nop
nop
nop
add $17433, %rsi
lea addresses_A_ht+0x16e3f, %r12
nop
nop
nop
nop
nop
add %rdi, %rdi
vmovups (%r12), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %r10
nop
nop
nop
cmp %r10, %r10
lea addresses_WC_ht+0x128ff, %rsi
lea addresses_WT_ht+0x1592f, %rdi
nop
nop
xor $50006, %rax
mov $46, %rcx
rep movsl
nop
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_normal_ht+0x48ff, %r12
nop
nop
nop
nop
and $60121, %r14
movb (%r12), %al
nop
nop
mfence
lea addresses_WT_ht+0x180c7, %rsi
lea addresses_WT_ht+0xc04, %rdi
nop
nop
nop
nop
and $62371, %r12
mov $61, %rcx
rep movsl
nop
nop
nop
nop
nop
and $34690, %r14
lea addresses_UC_ht+0x108ff, %r12
and %rax, %rax
movb $0x61, (%r12)
nop
nop
nop
nop
nop
inc %rbp
lea addresses_WC_ht+0x1c22b, %rsi
lea addresses_D_ht+0x2c9f, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
and $59222, %r10
mov $11, %rcx
rep movsl
nop
nop
xor $44681, %rbp
lea addresses_UC_ht+0xc7ff, %rsi
lea addresses_WT_ht+0x1e8ff, %rdi
nop
nop
nop
nop
nop
xor $30050, %rax
mov $105, %rcx
rep movsq
nop
xor $21791, %r10
lea addresses_D_ht+0x1a9eb, %r10
nop
nop
nop
nop
cmp $57167, %rdi
vmovups (%r10), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $1, %xmm0, %r12
nop
nop
nop
nop
nop
sub $36332, %rsi
lea addresses_normal_ht+0x1da1b, %rbp
clflush (%rbp)
nop
xor %rax, %rax
mov $0x6162636465666768, %r10
movq %r10, (%rbp)
nop
nop
nop
sub %r14, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r8
push %r9
push %rbp
push %rdx
push %rsi
// Store
lea addresses_UC+0xc8ff, %rsi
nop
xor $12510, %r10
movb $0x51, (%rsi)
nop
and $58422, %rdx
// Store
lea addresses_A+0x107ff, %r9
nop
and $63535, %r14
movb $0x51, (%r9)
nop
inc %rbp
// Store
lea addresses_UC+0x12dff, %r10
nop
nop
nop
nop
sub $36496, %rdx
mov $0x5152535455565758, %r14
movq %r14, %xmm0
vmovups %ymm0, (%r10)
nop
nop
nop
nop
nop
sub %rsi, %rsi
// Store
lea addresses_UC+0x9c5f, %rbp
nop
nop
add $5116, %r14
movl $0x51525354, (%rbp)
nop
nop
nop
nop
nop
cmp $17520, %rsi
// Load
lea addresses_PSE+0x427f, %rsi
dec %rbp
movb (%rsi), %r9b
nop
xor %r8, %r8
// Faulty Load
lea addresses_A+0x28ff, %r10
clflush (%r10)
nop
nop
nop
nop
xor $58488, %r14
mov (%r10), %dx
lea oracles, %rsi
and $0xff, %rdx
shlq $12, %rdx
mov (%rsi,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_PSE', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 7}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_A_ht'}, 'dst': {'same': True, 'congruent': 3, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 0, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': True, 'congruent': 2, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 1}}
{'00': 1, '35': 21828}
00 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
|
;
;MEMORY MODEL : Interpretation when omitted
;When the -cpu=S1 option is specified, small is assumed.
;When the -cpu=S2 or -cpu=S3 option is specified, medium is assumed
;
; define this macro if you are using MEDIUM model otherwise comment it
$IFNDEF __RL78_MEDIUM__
__RL78_MEDIUM__ .EQU 0x01
$ENDIF
;.EXTERN _portSAVE_CONTEXT
.EXTERN _pxCurrentTCB
.EXTERN _usCriticalNesting
portRESTORE_CONTEXT .MACRO
MOVW AX, !_pxCurrentTCB ; Restore the Stack pointer.
MOVW HL, AX
MOVW AX, [HL]
MOVW SP, AX
POP AX ; Restore usCriticalNesting value.
MOVW !_usCriticalNesting, AX
POP BC ; Restore the necessary general purpose registers.
POP DE
$ifdef __RL78_MEDIUM__
POP AX ; Restore the ES register.
MOV ES, A
XCH A, X ; Restore the CS register.
MOV CS, A
$ELSE
POP AX
MOV CS, A ; Restore CS register.
$ENDIF
POP HL ; Restore general purpose register HL.
POP AX ; Restore AX.
;$IF (__RENESAS_VERSION__ >= 0x01010000)
; MOVW SP,#LOWW(__STACK_ADDR_START)
;$ELSE ; for CC-RL V1.00
; MOVW SP,#LOWW(_stacktop)
;$ENDIF
.ENDM
portSAVE_CONTEXT .MACRO
PUSH AX ; Save AX Register to stack.
PUSH HL
$ifdef __RL78_MEDIUM__
MOV A, CS ; Save CS register.
XCH A, X
MOV A, ES ; Save ES register.
PUSH AX
$ELSE
MOV A, CS ; Save CS register.
PUSH AX
$ENDIF
PUSH DE ; Save the remaining general purpose registers.
PUSH BC
MOVW AX, !_usCriticalNesting ; Save the usCriticalNesting value.
PUSH AX
MOVW AX, !_pxCurrentTCB ; Save the Stack pointer.
MOVW HL, AX
MOVW AX, SP
MOVW [HL], AX
.ENDM
_r_tau0_channel0_interrupt .vector 0x002C ;INTTM00
.section .text, TEXT ;Assumed to be the __near specification
;because the vector table is specified
_r_tau0_channel0_interrupt:
portSAVE_CONTEXT ; Save the context of the current task.
call !!_xTaskIncrementTick ; Call the timer tick function.
cmpw ax, #0x00
skz
call !!_vTaskSwitchContext ; Call the scheduler to select the next task.
portRESTORE_CONTEXT ; Restore the context of the next task to run.
reti
_vPortYield .vector 0x007E ;BRK
.SECTION .text, TEXT
_vPortYield:
portSAVE_CONTEXT ; Save the context of the current task.
call !!_vTaskSwitchContext ; Call the scheduler to select the next task.
portRESTORE_CONTEXT ; Restore the context of the next task to run.
retb
.PUBLIC _vPortStart
.SECTION .text, TEXT
_vPortStart:
portRESTORE_CONTEXT ; Restore the context of whichever task the ...
reti ; An interrupt stack frame is used so the task
; is started using a RETI instruction.
|
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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 "ClientImpl.h"
#include "ClientConfigurationImpl.h"
#include "LogUtils.h"
#include "ConsumerImpl.h"
#include "ProducerImpl.h"
#include "ReaderImpl.h"
#include "PartitionedProducerImpl.h"
#include "PartitionedConsumerImpl.h"
#include "MultiTopicsConsumerImpl.h"
#include "PatternMultiTopicsConsumerImpl.h"
#include "TimeUtils.h"
#include <pulsar/ConsoleLoggerFactory.h>
#include <boost/algorithm/string/predicate.hpp>
#include <sstream>
#include <stdexcept>
#include <lib/HTTPLookupService.h>
#include <lib/TopicName.h>
#include <algorithm>
#include <random>
#include <mutex>
#include <thread>
#ifdef USE_LOG4CXX
#include "Log4CxxLogger.h"
#endif
#ifdef PULSAR_USE_BOOST_REGEX
#include <boost/regex.hpp>
#define PULSAR_REGEX_NAMESPACE boost
#else
#include <regex>
#define PULSAR_REGEX_NAMESPACE std
#endif
DECLARE_LOG_OBJECT()
namespace pulsar {
static const char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
static std::uniform_int_distribution<> hexDigitsDist(0, sizeof(hexDigits) - 1);
static std::mt19937 randomEngine =
std::mt19937(std::chrono::high_resolution_clock::now().time_since_epoch().count());
std::string generateRandomName() {
const int randomNameLength = 10;
std::string randomName;
for (int i = 0; i < randomNameLength; ++i) {
randomName += hexDigits[hexDigitsDist(randomEngine)];
}
return randomName;
}
typedef std::unique_lock<std::mutex> Lock;
typedef std::vector<std::string> StringList;
static const std::string https("https");
static const std::string pulsarSsl("pulsar+ssl");
static const ClientConfiguration detectTls(const std::string& serviceUrl,
const ClientConfiguration& clientConfiguration) {
ClientConfiguration conf(clientConfiguration);
if (serviceUrl.compare(0, https.size(), https) == 0 ||
serviceUrl.compare(0, pulsarSsl.size(), pulsarSsl) == 0) {
conf.setUseTls(true);
}
return conf;
}
ClientImpl::ClientImpl(const std::string& serviceUrl, const ClientConfiguration& clientConfiguration,
bool poolConnections)
: mutex_(),
state_(Open),
serviceUrl_(serviceUrl),
clientConfiguration_(detectTls(serviceUrl, clientConfiguration)),
memoryLimitController_(clientConfiguration.getMemoryLimit()),
ioExecutorProvider_(std::make_shared<ExecutorServiceProvider>(clientConfiguration_.getIOThreads())),
listenerExecutorProvider_(
std::make_shared<ExecutorServiceProvider>(clientConfiguration_.getMessageListenerThreads())),
partitionListenerExecutorProvider_(
std::make_shared<ExecutorServiceProvider>(clientConfiguration_.getMessageListenerThreads())),
pool_(clientConfiguration_, ioExecutorProvider_, clientConfiguration_.getAuthPtr(), poolConnections),
producerIdGenerator_(0),
consumerIdGenerator_(0),
requestIdGenerator_(0),
closingError(ResultOk) {
std::unique_ptr<LoggerFactory> loggerFactory = clientConfiguration_.impl_->takeLogger();
if (!loggerFactory) {
#ifdef USE_LOG4CXX
if (!clientConfiguration_.getLogConfFilePath().empty()) {
// A log4cxx log file was passed through deprecated parameter. Use that to configure Log4CXX
loggerFactory = Log4CxxLoggerFactory::create(clientConfiguration_.getLogConfFilePath());
} else {
// Use default simple console logger
loggerFactory.reset(new ConsoleLoggerFactory);
}
#else
// Use default simple console logger
loggerFactory.reset(new ConsoleLoggerFactory);
#endif
}
LogUtils::setLoggerFactory(std::move(loggerFactory));
if (serviceUrl_.compare(0, 4, "http") == 0) {
LOG_DEBUG("Using HTTP Lookup");
lookupServicePtr_ =
std::make_shared<HTTPLookupService>(std::cref(serviceUrl_), std::cref(clientConfiguration_),
std::cref(clientConfiguration_.getAuthPtr()));
} else {
LOG_DEBUG("Using Binary Lookup");
lookupServicePtr_ = std::make_shared<BinaryProtoLookupService>(
std::ref(pool_), std::ref(serviceUrl), std::cref(clientConfiguration_.getListenerName()));
}
}
ClientImpl::~ClientImpl() { shutdown(); }
const ClientConfiguration& ClientImpl::conf() const { return clientConfiguration_; }
MemoryLimitController& ClientImpl::getMemoryLimitController() { return memoryLimitController_; }
ExecutorServiceProviderPtr ClientImpl::getIOExecutorProvider() { return ioExecutorProvider_; }
ExecutorServiceProviderPtr ClientImpl::getListenerExecutorProvider() { return listenerExecutorProvider_; }
ExecutorServiceProviderPtr ClientImpl::getPartitionListenerExecutorProvider() {
return partitionListenerExecutorProvider_;
}
LookupServicePtr ClientImpl::getLookup() { return lookupServicePtr_; }
void ClientImpl::createProducerAsync(const std::string& topic, ProducerConfiguration conf,
CreateProducerCallback callback) {
if (conf.isChunkingEnabled() && conf.getBatchingEnabled()) {
throw std::invalid_argument("Batching and chunking of messages can't be enabled together");
}
TopicNamePtr topicName;
{
Lock lock(mutex_);
if (state_ != Open) {
lock.unlock();
callback(ResultAlreadyClosed, Producer());
return;
} else if (!(topicName = TopicName::get(topic))) {
lock.unlock();
callback(ResultInvalidTopicName, Producer());
return;
}
}
lookupServicePtr_->getPartitionMetadataAsync(topicName).addListener(
std::bind(&ClientImpl::handleCreateProducer, shared_from_this(), std::placeholders::_1,
std::placeholders::_2, topicName, conf, callback));
}
void ClientImpl::handleCreateProducer(const Result result, const LookupDataResultPtr partitionMetadata,
TopicNamePtr topicName, ProducerConfiguration conf,
CreateProducerCallback callback) {
if (!result) {
ProducerImplBasePtr producer;
if (partitionMetadata->getPartitions() > 0) {
producer = std::make_shared<PartitionedProducerImpl>(shared_from_this(), topicName,
partitionMetadata->getPartitions(), conf);
} else {
producer = std::make_shared<ProducerImpl>(shared_from_this(), *topicName, conf);
}
producer->getProducerCreatedFuture().addListener(
std::bind(&ClientImpl::handleProducerCreated, shared_from_this(), std::placeholders::_1,
std::placeholders::_2, callback, producer));
Lock lock(mutex_);
producers_.push_back(producer);
lock.unlock();
producer->start();
} else {
LOG_ERROR("Error Checking/Getting Partition Metadata while creating producer on "
<< topicName->toString() << " -- " << result);
callback(result, Producer());
}
}
void ClientImpl::handleProducerCreated(Result result, ProducerImplBaseWeakPtr producerBaseWeakPtr,
CreateProducerCallback callback, ProducerImplBasePtr producer) {
callback(result, Producer(producer));
}
void ClientImpl::createReaderAsync(const std::string& topic, const MessageId& startMessageId,
const ReaderConfiguration& conf, ReaderCallback callback) {
TopicNamePtr topicName;
{
Lock lock(mutex_);
if (state_ != Open) {
lock.unlock();
callback(ResultAlreadyClosed, Reader());
return;
} else if (!(topicName = TopicName::get(topic))) {
lock.unlock();
callback(ResultInvalidTopicName, Reader());
return;
}
}
MessageId msgId(startMessageId);
lookupServicePtr_->getPartitionMetadataAsync(topicName).addListener(
std::bind(&ClientImpl::handleReaderMetadataLookup, shared_from_this(), std::placeholders::_1,
std::placeholders::_2, topicName, msgId, conf, callback));
}
void ClientImpl::handleReaderMetadataLookup(const Result result, const LookupDataResultPtr partitionMetadata,
TopicNamePtr topicName, MessageId startMessageId,
ReaderConfiguration conf, ReaderCallback callback) {
if (result != ResultOk) {
LOG_ERROR("Error Checking/Getting Partition Metadata while creating readeron "
<< topicName->toString() << " -- " << result);
callback(result, Reader());
return;
}
if (partitionMetadata->getPartitions() > 0) {
LOG_ERROR("Topic reader cannot be created on a partitioned topic: " << topicName->toString());
callback(ResultOperationNotSupported, Reader());
return;
}
ReaderImplPtr reader = std::make_shared<ReaderImpl>(shared_from_this(), topicName->toString(), conf,
getListenerExecutorProvider()->get(), callback);
reader->start(startMessageId);
Lock lock(mutex_);
consumers_.push_back(reader->getConsumer());
}
void ClientImpl::subscribeWithRegexAsync(const std::string& regexPattern, const std::string& subscriptionName,
const ConsumerConfiguration& conf, SubscribeCallback callback) {
TopicNamePtr topicNamePtr = TopicName::get(regexPattern);
Lock lock(mutex_);
if (state_ != Open) {
lock.unlock();
callback(ResultAlreadyClosed, Consumer());
return;
} else {
lock.unlock();
if (!topicNamePtr) {
LOG_ERROR("Topic pattern not valid: " << regexPattern);
callback(ResultInvalidTopicName, Consumer());
return;
}
}
NamespaceNamePtr nsName = topicNamePtr->getNamespaceName();
lookupServicePtr_->getTopicsOfNamespaceAsync(nsName).addListener(
std::bind(&ClientImpl::createPatternMultiTopicsConsumer, shared_from_this(), std::placeholders::_1,
std::placeholders::_2, regexPattern, subscriptionName, conf, callback));
}
void ClientImpl::createPatternMultiTopicsConsumer(const Result result, const NamespaceTopicsPtr topics,
const std::string& regexPattern,
const std::string& subscriptionName,
const ConsumerConfiguration& conf,
SubscribeCallback callback) {
if (result == ResultOk) {
ConsumerImplBasePtr consumer;
PULSAR_REGEX_NAMESPACE::regex pattern(regexPattern);
NamespaceTopicsPtr matchTopics =
PatternMultiTopicsConsumerImpl::topicsPatternFilter(*topics, pattern);
consumer = std::make_shared<PatternMultiTopicsConsumerImpl>(
shared_from_this(), regexPattern, *matchTopics, subscriptionName, conf, lookupServicePtr_);
consumer->getConsumerCreatedFuture().addListener(
std::bind(&ClientImpl::handleConsumerCreated, shared_from_this(), std::placeholders::_1,
std::placeholders::_2, callback, consumer));
Lock lock(mutex_);
consumers_.push_back(consumer);
lock.unlock();
consumer->start();
} else {
LOG_ERROR("Error Getting topicsOfNameSpace while createPatternMultiTopicsConsumer: " << result);
callback(result, Consumer());
}
}
void ClientImpl::subscribeAsync(const std::vector<std::string>& topics, const std::string& subscriptionName,
const ConsumerConfiguration& conf, SubscribeCallback callback) {
TopicNamePtr topicNamePtr;
Lock lock(mutex_);
if (state_ != Open) {
lock.unlock();
callback(ResultAlreadyClosed, Consumer());
return;
} else {
if (!topics.empty() && !(topicNamePtr = MultiTopicsConsumerImpl::topicNamesValid(topics))) {
lock.unlock();
callback(ResultInvalidTopicName, Consumer());
return;
}
}
if (topicNamePtr) {
std::string randomName = generateRandomName();
std::stringstream consumerTopicNameStream;
consumerTopicNameStream << topicNamePtr->toString() << "-TopicsConsumerFakeName-" << randomName;
topicNamePtr = TopicName::get(consumerTopicNameStream.str());
}
ConsumerImplBasePtr consumer = std::make_shared<MultiTopicsConsumerImpl>(
shared_from_this(), topics, subscriptionName, topicNamePtr, conf, lookupServicePtr_);
consumer->getConsumerCreatedFuture().addListener(std::bind(&ClientImpl::handleConsumerCreated,
shared_from_this(), std::placeholders::_1,
std::placeholders::_2, callback, consumer));
consumers_.push_back(consumer);
lock.unlock();
consumer->start();
}
void ClientImpl::subscribeAsync(const std::string& topic, const std::string& subscriptionName,
const ConsumerConfiguration& conf, SubscribeCallback callback) {
TopicNamePtr topicName;
{
Lock lock(mutex_);
if (state_ != Open) {
lock.unlock();
callback(ResultAlreadyClosed, Consumer());
return;
} else if (!(topicName = TopicName::get(topic))) {
lock.unlock();
callback(ResultInvalidTopicName, Consumer());
return;
} else if (conf.isReadCompacted() && (topicName->getDomain().compare("persistent") != 0 ||
(conf.getConsumerType() != ConsumerExclusive &&
conf.getConsumerType() != ConsumerFailover))) {
lock.unlock();
callback(ResultInvalidConfiguration, Consumer());
return;
}
}
lookupServicePtr_->getPartitionMetadataAsync(topicName).addListener(
std::bind(&ClientImpl::handleSubscribe, shared_from_this(), std::placeholders::_1,
std::placeholders::_2, topicName, subscriptionName, conf, callback));
}
void ClientImpl::handleSubscribe(const Result result, const LookupDataResultPtr partitionMetadata,
TopicNamePtr topicName, const std::string& subscriptionName,
ConsumerConfiguration conf, SubscribeCallback callback) {
if (result == ResultOk) {
// generate random name if not supplied by the customer.
if (conf.getConsumerName().empty()) {
conf.setConsumerName(generateRandomName());
}
ConsumerImplBasePtr consumer;
if (partitionMetadata->getPartitions() > 0) {
if (conf.getReceiverQueueSize() == 0) {
LOG_ERROR("Can't use partitioned topic if the queue size is 0.");
callback(ResultInvalidConfiguration, Consumer());
return;
}
consumer = std::make_shared<PartitionedConsumerImpl>(
shared_from_this(), subscriptionName, topicName, partitionMetadata->getPartitions(), conf);
} else {
auto consumerImpl = std::make_shared<ConsumerImpl>(shared_from_this(), topicName->toString(),
subscriptionName, conf);
consumerImpl->setPartitionIndex(topicName->getPartitionIndex());
consumer = consumerImpl;
}
consumer->getConsumerCreatedFuture().addListener(
std::bind(&ClientImpl::handleConsumerCreated, shared_from_this(), std::placeholders::_1,
std::placeholders::_2, callback, consumer));
Lock lock(mutex_);
consumers_.push_back(consumer);
lock.unlock();
consumer->start();
} else {
LOG_ERROR("Error Checking/Getting Partition Metadata while Subscribing on " << topicName->toString()
<< " -- " << result);
callback(result, Consumer());
}
}
void ClientImpl::handleConsumerCreated(Result result, ConsumerImplBaseWeakPtr consumerImplBaseWeakPtr,
SubscribeCallback callback, ConsumerImplBasePtr consumer) {
callback(result, Consumer(consumer));
}
Future<Result, ClientConnectionWeakPtr> ClientImpl::getConnection(const std::string& topic) {
Promise<Result, ClientConnectionWeakPtr> promise;
lookupServicePtr_->lookupAsync(topic).addListener(std::bind(&ClientImpl::handleLookup, shared_from_this(),
std::placeholders::_1, std::placeholders::_2,
promise));
return promise.getFuture();
}
void ClientImpl::handleLookup(Result result, LookupDataResultPtr data,
Promise<Result, ClientConnectionWeakPtr> promise) {
if (data) {
const std::string& logicalAddress =
clientConfiguration_.isUseTls() ? data->getBrokerUrlTls() : data->getBrokerUrl();
LOG_DEBUG("Getting connection to broker: " << logicalAddress);
const std::string& physicalAddress =
data->shouldProxyThroughServiceUrl() ? serviceUrl_ : logicalAddress;
Future<Result, ClientConnectionWeakPtr> future =
pool_.getConnectionAsync(logicalAddress, physicalAddress);
future.addListener(std::bind(&ClientImpl::handleNewConnection, shared_from_this(),
std::placeholders::_1, std::placeholders::_2, promise));
} else {
promise.setFailed(result);
}
}
void ClientImpl::handleNewConnection(Result result, const ClientConnectionWeakPtr& conn,
Promise<Result, ClientConnectionWeakPtr> promise) {
if (result == ResultOk) {
promise.setValue(conn);
} else {
promise.setFailed(ResultConnectError);
}
}
void ClientImpl::handleGetPartitions(const Result result, const LookupDataResultPtr partitionMetadata,
TopicNamePtr topicName, GetPartitionsCallback callback) {
if (result != ResultOk) {
LOG_ERROR("Error getting topic partitions metadata: " << result);
callback(result, StringList());
return;
}
StringList partitions;
if (partitionMetadata->getPartitions() > 0) {
for (unsigned int i = 0; i < partitionMetadata->getPartitions(); i++) {
partitions.push_back(topicName->getTopicPartitionName(i));
}
} else {
partitions.push_back(topicName->toString());
}
callback(ResultOk, partitions);
}
void ClientImpl::getPartitionsForTopicAsync(const std::string& topic, GetPartitionsCallback callback) {
TopicNamePtr topicName;
{
Lock lock(mutex_);
if (state_ != Open) {
lock.unlock();
callback(ResultAlreadyClosed, StringList());
return;
} else if (!(topicName = TopicName::get(topic))) {
lock.unlock();
callback(ResultInvalidTopicName, StringList());
return;
}
}
lookupServicePtr_->getPartitionMetadataAsync(topicName).addListener(
std::bind(&ClientImpl::handleGetPartitions, shared_from_this(), std::placeholders::_1,
std::placeholders::_2, topicName, callback));
}
void ClientImpl::closeAsync(CloseCallback callback) {
Lock lock(mutex_);
ProducersList producers(producers_);
ConsumersList consumers(consumers_);
if (state_ != Open && callback) {
lock.unlock();
callback(ResultAlreadyClosed);
return;
}
// Set the state to Closing so that no producers could get added
state_ = Closing;
lock.unlock();
memoryLimitController_.close();
SharedInt numberOfOpenHandlers = std::make_shared<int>(producers.size() + consumers.size());
LOG_INFO("Closing Pulsar client with " << producers.size() << " producers and " << consumers.size()
<< " consumers");
for (ProducersList::iterator it = producers.begin(); it != producers.end(); ++it) {
ProducerImplBasePtr producer = it->lock();
if (producer && !producer->isClosed()) {
producer->closeAsync(std::bind(&ClientImpl::handleClose, shared_from_this(),
std::placeholders::_1, numberOfOpenHandlers, callback));
} else {
// Since the connection is already closed
(*numberOfOpenHandlers)--;
}
}
for (ConsumersList::iterator it = consumers.begin(); it != consumers.end(); ++it) {
ConsumerImplBasePtr consumer = it->lock();
if (consumer && !consumer->isClosed()) {
consumer->closeAsync(std::bind(&ClientImpl::handleClose, shared_from_this(),
std::placeholders::_1, numberOfOpenHandlers, callback));
} else {
// Since the connection is already closed
(*numberOfOpenHandlers)--;
}
}
if (*numberOfOpenHandlers == 0 && callback) {
handleClose(ResultOk, numberOfOpenHandlers, callback);
}
}
void ClientImpl::handleClose(Result result, SharedInt numberOfOpenHandlers, ResultCallback callback) {
Result expected = ResultOk;
if (!closingError.compare_exchange_strong(expected, result)) {
LOG_DEBUG("Tried to updated closingError, but already set to "
<< expected << ". This means multiple errors have occurred while closing the client");
}
if (*numberOfOpenHandlers > 0) {
--(*numberOfOpenHandlers);
}
if (*numberOfOpenHandlers == 0) {
Lock lock(mutex_);
if (state_ == Closed) {
LOG_DEBUG("Client is already shutting down, possible race condition in handleClose");
return;
} else {
state_ = Closed;
lock.unlock();
}
LOG_DEBUG("Shutting down producers and consumers for client");
// handleClose() is called in ExecutorService's event loop, while shutdown() tried to wait the event
// loop exits. So here we use another thread to call shutdown().
auto self = shared_from_this();
std::thread shutdownTask{[this, self, callback] {
shutdown();
if (callback) {
if (closingError != ResultOk) {
LOG_DEBUG(
"Problem in closing client, could not close one or more consumers or producers");
}
callback(closingError);
}
}};
shutdownTask.detach();
}
}
void ClientImpl::shutdown() {
Lock lock(mutex_);
ProducersList producers;
ConsumersList consumers;
producers.swap(producers_);
consumers.swap(consumers_);
lock.unlock();
for (ProducersList::iterator it = producers.begin(); it != producers.end(); ++it) {
ProducerImplBasePtr producer = it->lock();
if (producer) {
producer->shutdown();
}
}
for (ConsumersList::iterator it = consumers.begin(); it != consumers.end(); ++it) {
ConsumerImplBasePtr consumer = it->lock();
if (consumer) {
consumer->shutdown();
}
}
if (producers.size() + consumers.size() > 0) {
LOG_DEBUG(producers.size() << " producers and " << consumers.size()
<< " consumers have been shutdown.");
}
if (!pool_.close()) {
// pool_ has already been closed. It means shutdown() has been called before.
return;
}
LOG_DEBUG("ConnectionPool is closed");
// 500ms as the timeout is long enough because ExecutorService::close calls io_service::stop() internally
// and waits until io_service::run() in another thread returns, which should be as soon as possible after
// stop() is called.
TimeoutProcessor<std::chrono::milliseconds> timeoutProcessor{500};
timeoutProcessor.tik();
ioExecutorProvider_->close(timeoutProcessor.getLeftTimeout());
timeoutProcessor.tok();
LOG_DEBUG("ioExecutorProvider_ is closed");
timeoutProcessor.tik();
listenerExecutorProvider_->close();
timeoutProcessor.tok();
LOG_DEBUG("listenerExecutorProvider_ is closed");
timeoutProcessor.tik();
partitionListenerExecutorProvider_->close();
timeoutProcessor.tok();
LOG_DEBUG("partitionListenerExecutorProvider_ is closed");
}
uint64_t ClientImpl::newProducerId() {
Lock lock(mutex_);
return producerIdGenerator_++;
}
uint64_t ClientImpl::newConsumerId() {
Lock lock(mutex_);
return consumerIdGenerator_++;
}
uint64_t ClientImpl::newRequestId() {
Lock lock(mutex_);
return requestIdGenerator_++;
}
uint64_t ClientImpl::getNumberOfProducers() {
Lock lock(mutex_);
uint64_t numberOfAliveProducers = 0;
for (const auto& producer : producers_) {
const auto& producerImpl = producer.lock();
if (producerImpl) {
numberOfAliveProducers += producerImpl->getNumberOfConnectedProducer();
}
}
return numberOfAliveProducers;
}
uint64_t ClientImpl::getNumberOfConsumers() {
Lock lock(mutex_);
uint64_t numberOfAliveConsumers = 0;
for (const auto& consumer : consumers_) {
const auto consumerImpl = consumer.lock();
if (consumerImpl) {
numberOfAliveConsumers += consumerImpl->getNumberOfConnectedConsumer();
}
}
return numberOfAliveConsumers;
}
const ClientConfiguration& ClientImpl::getClientConfig() const { return clientConfiguration_; }
} /* namespace pulsar */
|
.global s_prepare_buffers
s_prepare_buffers:
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %rbp
push %rcx
push %rdi
push %rdx
// Faulty Load
lea addresses_UC+0x3d11, %rbp
dec %r13
mov (%rbp), %cx
lea oracles, %rdi
and $0xff, %rcx
shlq $12, %rcx
mov (%rdi,%rcx,1), %rcx
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'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
*/
|
// Copyright 2020, Nathan Blane
#include "EngineStatView.hpp"
#include "Debugging/ProfilerStatistics.hpp"
#include "Visualization/ScreenTextItem.hpp"
#include "Engine/FrameData.hpp"
static void MoveMetricPositionDown(Vector2& currentScreenPos)
{
currentScreenPos.y += 20;
}
static void FormatAndAddTextItem(DynamicArray<ScreenTextItem>& textItems, Vector2& currentScreenPos, const char* metricName, f32 msTime)
{
constexpr u32 digitsPrecision = 3;
textItems.Add(ScreenTextItem{
String::Format("{}: {:.3f}ms", metricName, msTime/*, digitsPrecision*/),
Color32::White(),
currentScreenPos,
.15f
});
MoveMetricPositionDown(currentScreenPos);
}
void EngineStatView::ToggleStats()
{
statsVisible = !statsVisible;
}
bool EngineStatView::AreStatsVisible() const
{
return statsVisible;
}
void EngineStatView::PushStatsToView(DynamicArray<ScreenTextItem>& textItems)
{
if (statsVisible)
{
Vector2 currentScreenPos(2, 2);
const ProfiledFrameMark& frame = GetProfilingStatistics().GetPreviousFrame();
FormatAndAddTextItem(textItems, currentScreenPos, "Frame Time", Frame::GetTickTimeSeconds() * 1000.f);
MoveMetricPositionDown(currentScreenPos);
for (auto& frameMetric : frame.frameMetrics)
{
FormatAndAddTextItem(textItems, currentScreenPos, frameMetric.metricName, (f32)frameMetric.totalMetricTimeMS);
}
}
} |
; This is a comment.
;Since implementing the FizzBuzz game with Assembly is a bit complicated, this code just implements Hello World.
bits 64
global _start
;Program codes are written in this section.
section .text
_start:
;Calls `sys_write` system call.
mov rax, 1 ;specifies the system call
mov rdi, 1 ;specifies the input to the system call
mov rsi, str ;stores the data `str` to the register `rsi`
mov rdx, length ;ditto
syscall ;finally calls the system call
;Calls `sys_exit` system call.
mov rax, 60
mov rdi, 0
syscall
;Data is put in this section.
section .data
str: db "Hello, World!", 10 ;defines a string whose length is `10`
length equ $ - str ;???
|
; *******************************************************************************************
; *******************************************************************************************
;
; Name : skip.asm
; Purpose : Structure Skipping Code
; Date : 29th August 2019
; Review : 1st September 2019
; Author : Paul Robson (paul@robsons.org.uk)
;
; *******************************************************************************************
; *******************************************************************************************
;
; Note: Logically this should belong in structure ; however because of the two
; format IF it will be built in whether you add the new structures or not.
;
; *******************************************************************************************
;
; Scan forward for a structure-close looking for A or X/A, tracking open/close
; program structure forwards. On exit points to token.
;
; *******************************************************************************************
StructureSearchSingle:
ldx #0 ; we always search for XA. This disables X.
;
StructureSearchDouble:
sta zTemp1 ; save the targets in zTemp1,zTemp1+1
stx zTemp1+1
lda #0 ; set the structure depth to zero (zTemp2)
sta zTemp2
bra _SSWLoop ; jump in, start scanning from here.
;
; Start a new line, check if end of program, error if so.
;
_SSWNextLine:
#s_nextLine ; go to next line.
#s_startLine ; start of line.
#s_get ; get offset
cmp #0 ; if zero, fail.
beq _SSWFail
#s_next ; go to first character
#s_next ; (after all 3 s_next)
;
; Go to next character, simple one.
;
_SSWNextSimple:
#s_next
;
_SSWLoop:
#s_get ; look at token.
cmp #0 ; end of line ?
beq _SSWNextLine ; if so, then next line
bpl _SSWNextSimple ; needs to be a token, just skip char/number.
;
; Found a token.
;
ldx zTemp2 ; check structure count
bne _SSWCheckUpDown ; if it's non zero, then a match doesn't work.
;
cmp zTemp1 ; found the right keyword, either choice.
beq _SSWFound ; then exit.
cmp zTemp1+1
beq _SSWFound
;
; For token in A, see if it adjusts the keyword level count.
;
_SSWCheckUpDown:
cmp #firstKeywordPlus ; if < keyword +
bcc _SSWNext
cmp #firstKeywordMinus ; if < keyword - then as keyword +
bcc _SSWPlus
cmp #firstUnaryFunction ; if < first unary down as keyword -
bcs _SSWNext
dec zTemp2 ; reduce structure count.
dec zTemp2
_SSWPlus:
inc zTemp2
bmi _SSWUnder ; error if driven -ve
_SSWNext:
;
; Skip over token, print or whatever, and go round again.
;
#s_skipelement ; skip an element
bra _SSWLoop
;
_SSWFound:
rts
_SSWUnder: ; count has gone negative
#Fatal "Structure order"
_SSWFail: ; couldn't find it and ran off the end.
#Fatal "Can't find structure"
; *******************************************************************************************
;
; Advance pointer to end of command
;
; *******************************************************************************************
SkipEndOfCommand:
#s_get ; get next token
cmp #0 ; if zero, end of line, so exit
beq _SOCExit
cmp #token_Colon ; if colon, end of command
beq _SOCExit
#s_skipElement ; go forward
bra SkipEndOfCommand
_SOCExit:
rts
|
; A030978: Maximal number of non-attacking knights on an n X n board.
; 0,1,4,5,8,13,18,25,32,41,50,61,72,85,98,113,128,145,162,181,200,221,242,265,288,313,338,365,392,421,450,481,512,545,578,613,648,685,722,761,800,841,882,925,968,1013,1058,1105,1152,1201,1250,1301,1352,1405,1458,1513,1568,1625,1682,1741,1800,1861,1922,1985,2048,2113,2178,2245,2312,2381,2450,2521,2592,2665,2738,2813,2888,2965,3042,3121,3200,3281,3362,3445,3528,3613,3698,3785,3872,3961,4050,4141,4232,4325,4418,4513,4608,4705,4802,4901
pow $0,2
mov $1,$0
lpb $1
add $0,1
div $0,2
mod $1,5
lpe
|
#include "win.h"
#include "ui_win.h"
Win::Win(QWidget *parent) :
QDialog(parent),
ui(new Ui::Win)
{
ui->setupUi(this);
}
Win::~Win()
{
delete ui;
}
void Win::display(int level, int moves, int pushes)
{
if(level < 0)
ui->level->hide();
if(moves < 0)
ui->moves->hide();
if(pushes < 0)
ui->pushes->hide();
ui->level->setText("Level " + QString::number(level));
ui->moves->setText("Mario Moves Number " + QString::number(moves));
ui->pushes->setText("Box Push Number " + QString::number(pushes));
show();
}
void Win::on_next_clicked()
{
emit next_clicked();
hide();
}
void Win::on_retry_clicked()
{
emit retry_clicked();
hide();
}
void Win::on_home_clicked()
{
emit home_clicked();
hide();
}
|
//===-- SIFoldOperands.cpp - Fold operands --- ----------------------------===//
//
// 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
//
/// \file
//===----------------------------------------------------------------------===//
//
#include "AMDGPU.h"
#include "AMDGPUSubtarget.h"
#include "SIInstrInfo.h"
#include "SIMachineFunctionInfo.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#define DEBUG_TYPE "si-fold-operands"
using namespace llvm;
namespace {
struct FoldCandidate {
MachineInstr *UseMI;
union {
MachineOperand *OpToFold;
uint64_t ImmToFold;
int FrameIndexToFold;
};
int ShrinkOpcode;
unsigned char UseOpNo;
MachineOperand::MachineOperandType Kind;
bool Commuted;
FoldCandidate(MachineInstr *MI, unsigned OpNo, MachineOperand *FoldOp,
bool Commuted_ = false,
int ShrinkOp = -1) :
UseMI(MI), OpToFold(nullptr), ShrinkOpcode(ShrinkOp), UseOpNo(OpNo),
Kind(FoldOp->getType()),
Commuted(Commuted_) {
if (FoldOp->isImm()) {
ImmToFold = FoldOp->getImm();
} else if (FoldOp->isFI()) {
FrameIndexToFold = FoldOp->getIndex();
} else {
assert(FoldOp->isReg() || FoldOp->isGlobal());
OpToFold = FoldOp;
}
}
bool isFI() const {
return Kind == MachineOperand::MO_FrameIndex;
}
bool isImm() const {
return Kind == MachineOperand::MO_Immediate;
}
bool isReg() const {
return Kind == MachineOperand::MO_Register;
}
bool isGlobal() const { return Kind == MachineOperand::MO_GlobalAddress; }
bool isCommuted() const {
return Commuted;
}
bool needsShrink() const {
return ShrinkOpcode != -1;
}
int getShrinkOpcode() const {
return ShrinkOpcode;
}
};
class SIFoldOperands : public MachineFunctionPass {
public:
static char ID;
MachineRegisterInfo *MRI;
const SIInstrInfo *TII;
const SIRegisterInfo *TRI;
const GCNSubtarget *ST;
const SIMachineFunctionInfo *MFI;
void foldOperand(MachineOperand &OpToFold,
MachineInstr *UseMI,
int UseOpIdx,
SmallVectorImpl<FoldCandidate> &FoldList,
SmallVectorImpl<MachineInstr *> &CopiesToReplace) const;
void foldInstOperand(MachineInstr &MI, MachineOperand &OpToFold) const;
const MachineOperand *isClamp(const MachineInstr &MI) const;
bool tryFoldClamp(MachineInstr &MI);
std::pair<const MachineOperand *, int> isOMod(const MachineInstr &MI) const;
bool tryFoldOMod(MachineInstr &MI);
public:
SIFoldOperands() : MachineFunctionPass(ID) {
initializeSIFoldOperandsPass(*PassRegistry::getPassRegistry());
}
bool runOnMachineFunction(MachineFunction &MF) override;
StringRef getPassName() const override { return "SI Fold Operands"; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesCFG();
MachineFunctionPass::getAnalysisUsage(AU);
}
};
} // End anonymous namespace.
INITIALIZE_PASS(SIFoldOperands, DEBUG_TYPE,
"SI Fold Operands", false, false)
char SIFoldOperands::ID = 0;
char &llvm::SIFoldOperandsID = SIFoldOperands::ID;
// Wrapper around isInlineConstant that understands special cases when
// instruction types are replaced during operand folding.
static bool isInlineConstantIfFolded(const SIInstrInfo *TII,
const MachineInstr &UseMI,
unsigned OpNo,
const MachineOperand &OpToFold) {
if (TII->isInlineConstant(UseMI, OpNo, OpToFold))
return true;
unsigned Opc = UseMI.getOpcode();
switch (Opc) {
case AMDGPU::V_MAC_F32_e64:
case AMDGPU::V_MAC_F16_e64:
case AMDGPU::V_FMAC_F32_e64:
case AMDGPU::V_FMAC_F16_e64: {
// Special case for mac. Since this is replaced with mad when folded into
// src2, we need to check the legality for the final instruction.
int Src2Idx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::src2);
if (static_cast<int>(OpNo) == Src2Idx) {
bool IsFMA = Opc == AMDGPU::V_FMAC_F32_e64 ||
Opc == AMDGPU::V_FMAC_F16_e64;
bool IsF32 = Opc == AMDGPU::V_MAC_F32_e64 ||
Opc == AMDGPU::V_FMAC_F32_e64;
unsigned Opc = IsFMA ?
(IsF32 ? AMDGPU::V_FMA_F32 : AMDGPU::V_FMA_F16_gfx9) :
(IsF32 ? AMDGPU::V_MAD_F32 : AMDGPU::V_MAD_F16);
const MCInstrDesc &MadDesc = TII->get(Opc);
return TII->isInlineConstant(OpToFold, MadDesc.OpInfo[OpNo].OperandType);
}
return false;
}
default:
return false;
}
}
// TODO: Add heuristic that the frame index might not fit in the addressing mode
// immediate offset to avoid materializing in loops.
static bool frameIndexMayFold(const SIInstrInfo *TII,
const MachineInstr &UseMI,
int OpNo,
const MachineOperand &OpToFold) {
return OpToFold.isFI() &&
(TII->isMUBUF(UseMI) || TII->isFLATScratch(UseMI)) &&
OpNo == AMDGPU::getNamedOperandIdx(UseMI.getOpcode(), AMDGPU::OpName::vaddr);
}
FunctionPass *llvm::createSIFoldOperandsPass() {
return new SIFoldOperands();
}
static bool updateOperand(FoldCandidate &Fold,
const SIInstrInfo &TII,
const TargetRegisterInfo &TRI,
const GCNSubtarget &ST) {
MachineInstr *MI = Fold.UseMI;
MachineOperand &Old = MI->getOperand(Fold.UseOpNo);
assert(Old.isReg());
if (Fold.isImm()) {
if (MI->getDesc().TSFlags & SIInstrFlags::IsPacked &&
!(MI->getDesc().TSFlags & SIInstrFlags::IsMAI) &&
AMDGPU::isInlinableLiteralV216(static_cast<uint16_t>(Fold.ImmToFold),
ST.hasInv2PiInlineImm())) {
// Set op_sel/op_sel_hi on this operand or bail out if op_sel is
// already set.
unsigned Opcode = MI->getOpcode();
int OpNo = MI->getOperandNo(&Old);
int ModIdx = -1;
if (OpNo == AMDGPU::getNamedOperandIdx(Opcode, AMDGPU::OpName::src0))
ModIdx = AMDGPU::OpName::src0_modifiers;
else if (OpNo == AMDGPU::getNamedOperandIdx(Opcode, AMDGPU::OpName::src1))
ModIdx = AMDGPU::OpName::src1_modifiers;
else if (OpNo == AMDGPU::getNamedOperandIdx(Opcode, AMDGPU::OpName::src2))
ModIdx = AMDGPU::OpName::src2_modifiers;
assert(ModIdx != -1);
ModIdx = AMDGPU::getNamedOperandIdx(Opcode, ModIdx);
MachineOperand &Mod = MI->getOperand(ModIdx);
unsigned Val = Mod.getImm();
if ((Val & SISrcMods::OP_SEL_0) || !(Val & SISrcMods::OP_SEL_1))
return false;
// Only apply the following transformation if that operand requries
// a packed immediate.
switch (TII.get(Opcode).OpInfo[OpNo].OperandType) {
case AMDGPU::OPERAND_REG_IMM_V2FP16:
case AMDGPU::OPERAND_REG_IMM_V2INT16:
case AMDGPU::OPERAND_REG_INLINE_C_V2FP16:
case AMDGPU::OPERAND_REG_INLINE_C_V2INT16:
// If upper part is all zero we do not need op_sel_hi.
if (!isUInt<16>(Fold.ImmToFold)) {
if (!(Fold.ImmToFold & 0xffff)) {
Mod.setImm(Mod.getImm() | SISrcMods::OP_SEL_0);
Mod.setImm(Mod.getImm() & ~SISrcMods::OP_SEL_1);
Old.ChangeToImmediate((Fold.ImmToFold >> 16) & 0xffff);
return true;
}
Mod.setImm(Mod.getImm() & ~SISrcMods::OP_SEL_1);
Old.ChangeToImmediate(Fold.ImmToFold & 0xffff);
return true;
}
break;
default:
break;
}
}
}
if ((Fold.isImm() || Fold.isFI() || Fold.isGlobal()) && Fold.needsShrink()) {
MachineBasicBlock *MBB = MI->getParent();
auto Liveness = MBB->computeRegisterLiveness(&TRI, AMDGPU::VCC, MI, 16);
if (Liveness != MachineBasicBlock::LQR_Dead) {
LLVM_DEBUG(dbgs() << "Not shrinking " << MI << " due to vcc liveness\n");
return false;
}
MachineRegisterInfo &MRI = MBB->getParent()->getRegInfo();
int Op32 = Fold.getShrinkOpcode();
MachineOperand &Dst0 = MI->getOperand(0);
MachineOperand &Dst1 = MI->getOperand(1);
assert(Dst0.isDef() && Dst1.isDef());
bool HaveNonDbgCarryUse = !MRI.use_nodbg_empty(Dst1.getReg());
const TargetRegisterClass *Dst0RC = MRI.getRegClass(Dst0.getReg());
Register NewReg0 = MRI.createVirtualRegister(Dst0RC);
MachineInstr *Inst32 = TII.buildShrunkInst(*MI, Op32);
if (HaveNonDbgCarryUse) {
BuildMI(*MBB, MI, MI->getDebugLoc(), TII.get(AMDGPU::COPY), Dst1.getReg())
.addReg(AMDGPU::VCC, RegState::Kill);
}
// Keep the old instruction around to avoid breaking iterators, but
// replace it with a dummy instruction to remove uses.
//
// FIXME: We should not invert how this pass looks at operands to avoid
// this. Should track set of foldable movs instead of looking for uses
// when looking at a use.
Dst0.setReg(NewReg0);
for (unsigned I = MI->getNumOperands() - 1; I > 0; --I)
MI->RemoveOperand(I);
MI->setDesc(TII.get(AMDGPU::IMPLICIT_DEF));
if (Fold.isCommuted())
TII.commuteInstruction(*Inst32, false);
return true;
}
assert(!Fold.needsShrink() && "not handled");
if (Fold.isImm()) {
// FIXME: ChangeToImmediate should probably clear the subreg flags. It's
// reinterpreted as TargetFlags.
Old.setSubReg(0);
Old.ChangeToImmediate(Fold.ImmToFold);
return true;
}
if (Fold.isGlobal()) {
Old.ChangeToGA(Fold.OpToFold->getGlobal(), Fold.OpToFold->getOffset(),
Fold.OpToFold->getTargetFlags());
return true;
}
if (Fold.isFI()) {
Old.ChangeToFrameIndex(Fold.FrameIndexToFold);
return true;
}
MachineOperand *New = Fold.OpToFold;
Old.substVirtReg(New->getReg(), New->getSubReg(), TRI);
Old.setIsUndef(New->isUndef());
return true;
}
static bool isUseMIInFoldList(ArrayRef<FoldCandidate> FoldList,
const MachineInstr *MI) {
for (auto Candidate : FoldList) {
if (Candidate.UseMI == MI)
return true;
}
return false;
}
static void appendFoldCandidate(SmallVectorImpl<FoldCandidate> &FoldList,
MachineInstr *MI, unsigned OpNo,
MachineOperand *FoldOp, bool Commuted = false,
int ShrinkOp = -1) {
// Skip additional folding on the same operand.
for (FoldCandidate &Fold : FoldList)
if (Fold.UseMI == MI && Fold.UseOpNo == OpNo)
return;
LLVM_DEBUG(dbgs() << "Append " << (Commuted ? "commuted" : "normal")
<< " operand " << OpNo << "\n " << *MI << '\n');
FoldList.push_back(FoldCandidate(MI, OpNo, FoldOp, Commuted, ShrinkOp));
}
static bool tryAddToFoldList(SmallVectorImpl<FoldCandidate> &FoldList,
MachineInstr *MI, unsigned OpNo,
MachineOperand *OpToFold,
const SIInstrInfo *TII) {
if (!TII->isOperandLegal(*MI, OpNo, OpToFold)) {
// Special case for v_mac_{f16, f32}_e64 if we are trying to fold into src2
unsigned Opc = MI->getOpcode();
if ((Opc == AMDGPU::V_MAC_F32_e64 || Opc == AMDGPU::V_MAC_F16_e64 ||
Opc == AMDGPU::V_FMAC_F32_e64 || Opc == AMDGPU::V_FMAC_F16_e64) &&
(int)OpNo == AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::src2)) {
bool IsFMA = Opc == AMDGPU::V_FMAC_F32_e64 ||
Opc == AMDGPU::V_FMAC_F16_e64;
bool IsF32 = Opc == AMDGPU::V_MAC_F32_e64 ||
Opc == AMDGPU::V_FMAC_F32_e64;
unsigned NewOpc = IsFMA ?
(IsF32 ? AMDGPU::V_FMA_F32 : AMDGPU::V_FMA_F16_gfx9) :
(IsF32 ? AMDGPU::V_MAD_F32 : AMDGPU::V_MAD_F16);
// Check if changing this to a v_mad_{f16, f32} instruction will allow us
// to fold the operand.
MI->setDesc(TII->get(NewOpc));
bool FoldAsMAD = tryAddToFoldList(FoldList, MI, OpNo, OpToFold, TII);
if (FoldAsMAD) {
MI->untieRegOperand(OpNo);
return true;
}
MI->setDesc(TII->get(Opc));
}
// Special case for s_setreg_b32
if (Opc == AMDGPU::S_SETREG_B32 && OpToFold->isImm()) {
MI->setDesc(TII->get(AMDGPU::S_SETREG_IMM32_B32));
appendFoldCandidate(FoldList, MI, OpNo, OpToFold);
return true;
}
// If we are already folding into another operand of MI, then
// we can't commute the instruction, otherwise we risk making the
// other fold illegal.
if (isUseMIInFoldList(FoldList, MI))
return false;
unsigned CommuteOpNo = OpNo;
// Operand is not legal, so try to commute the instruction to
// see if this makes it possible to fold.
unsigned CommuteIdx0 = TargetInstrInfo::CommuteAnyOperandIndex;
unsigned CommuteIdx1 = TargetInstrInfo::CommuteAnyOperandIndex;
bool CanCommute = TII->findCommutedOpIndices(*MI, CommuteIdx0, CommuteIdx1);
if (CanCommute) {
if (CommuteIdx0 == OpNo)
CommuteOpNo = CommuteIdx1;
else if (CommuteIdx1 == OpNo)
CommuteOpNo = CommuteIdx0;
}
// One of operands might be an Imm operand, and OpNo may refer to it after
// the call of commuteInstruction() below. Such situations are avoided
// here explicitly as OpNo must be a register operand to be a candidate
// for memory folding.
if (CanCommute && (!MI->getOperand(CommuteIdx0).isReg() ||
!MI->getOperand(CommuteIdx1).isReg()))
return false;
if (!CanCommute ||
!TII->commuteInstruction(*MI, false, CommuteIdx0, CommuteIdx1))
return false;
if (!TII->isOperandLegal(*MI, CommuteOpNo, OpToFold)) {
if ((Opc == AMDGPU::V_ADD_I32_e64 ||
Opc == AMDGPU::V_SUB_I32_e64 ||
Opc == AMDGPU::V_SUBREV_I32_e64) && // FIXME
(OpToFold->isImm() || OpToFold->isFI() || OpToFold->isGlobal())) {
MachineRegisterInfo &MRI = MI->getParent()->getParent()->getRegInfo();
// Verify the other operand is a VGPR, otherwise we would violate the
// constant bus restriction.
unsigned OtherIdx = CommuteOpNo == CommuteIdx0 ? CommuteIdx1 : CommuteIdx0;
MachineOperand &OtherOp = MI->getOperand(OtherIdx);
if (!OtherOp.isReg() ||
!TII->getRegisterInfo().isVGPR(MRI, OtherOp.getReg()))
return false;
assert(MI->getOperand(1).isDef());
// Make sure to get the 32-bit version of the commuted opcode.
unsigned MaybeCommutedOpc = MI->getOpcode();
int Op32 = AMDGPU::getVOPe32(MaybeCommutedOpc);
appendFoldCandidate(FoldList, MI, CommuteOpNo, OpToFold, true, Op32);
return true;
}
TII->commuteInstruction(*MI, false, CommuteIdx0, CommuteIdx1);
return false;
}
appendFoldCandidate(FoldList, MI, CommuteOpNo, OpToFold, true);
return true;
}
// Check the case where we might introduce a second constant operand to a
// scalar instruction
if (TII->isSALU(MI->getOpcode())) {
const MCInstrDesc &InstDesc = MI->getDesc();
const MCOperandInfo &OpInfo = InstDesc.OpInfo[OpNo];
const SIRegisterInfo &SRI = TII->getRegisterInfo();
// Fine if the operand can be encoded as an inline constant
if (OpToFold->isImm()) {
if (!SRI.opCanUseInlineConstant(OpInfo.OperandType) ||
!TII->isInlineConstant(*OpToFold, OpInfo)) {
// Otherwise check for another constant
for (unsigned i = 0, e = InstDesc.getNumOperands(); i != e; ++i) {
auto &Op = MI->getOperand(i);
if (OpNo != i &&
TII->isLiteralConstantLike(Op, OpInfo)) {
return false;
}
}
}
}
}
appendFoldCandidate(FoldList, MI, OpNo, OpToFold);
return true;
}
// If the use operand doesn't care about the value, this may be an operand only
// used for register indexing, in which case it is unsafe to fold.
static bool isUseSafeToFold(const SIInstrInfo *TII,
const MachineInstr &MI,
const MachineOperand &UseMO) {
return !UseMO.isUndef() && !TII->isSDWA(MI);
//return !MI.hasRegisterImplicitUseOperand(UseMO.getReg());
}
// Find a def of the UseReg, check if it is a reg_seqence and find initializers
// for each subreg, tracking it to foldable inline immediate if possible.
// Returns true on success.
static bool getRegSeqInit(
SmallVectorImpl<std::pair<MachineOperand*, unsigned>> &Defs,
Register UseReg, uint8_t OpTy,
const SIInstrInfo *TII, const MachineRegisterInfo &MRI) {
MachineInstr *Def = MRI.getUniqueVRegDef(UseReg);
if (!Def || !Def->isRegSequence())
return false;
for (unsigned I = 1, E = Def->getNumExplicitOperands(); I < E; I += 2) {
MachineOperand *Sub = &Def->getOperand(I);
assert (Sub->isReg());
for (MachineInstr *SubDef = MRI.getUniqueVRegDef(Sub->getReg());
SubDef && Sub->isReg() && !Sub->getSubReg() &&
TII->isFoldableCopy(*SubDef);
SubDef = MRI.getUniqueVRegDef(Sub->getReg())) {
MachineOperand *Op = &SubDef->getOperand(1);
if (Op->isImm()) {
if (TII->isInlineConstant(*Op, OpTy))
Sub = Op;
break;
}
if (!Op->isReg())
break;
Sub = Op;
}
Defs.push_back(std::make_pair(Sub, Def->getOperand(I + 1).getImm()));
}
return true;
}
static bool tryToFoldACImm(const SIInstrInfo *TII,
const MachineOperand &OpToFold,
MachineInstr *UseMI,
unsigned UseOpIdx,
SmallVectorImpl<FoldCandidate> &FoldList) {
const MCInstrDesc &Desc = UseMI->getDesc();
const MCOperandInfo *OpInfo = Desc.OpInfo;
if (!OpInfo || UseOpIdx >= Desc.getNumOperands())
return false;
uint8_t OpTy = OpInfo[UseOpIdx].OperandType;
if (OpTy < AMDGPU::OPERAND_REG_INLINE_AC_FIRST ||
OpTy > AMDGPU::OPERAND_REG_INLINE_AC_LAST)
return false;
if (OpToFold.isImm() && TII->isInlineConstant(OpToFold, OpTy) &&
TII->isOperandLegal(*UseMI, UseOpIdx, &OpToFold)) {
UseMI->getOperand(UseOpIdx).ChangeToImmediate(OpToFold.getImm());
return true;
}
if (!OpToFold.isReg())
return false;
Register UseReg = OpToFold.getReg();
if (!Register::isVirtualRegister(UseReg))
return false;
if (llvm::find_if(FoldList, [UseMI](const FoldCandidate &FC) {
return FC.UseMI == UseMI; }) != FoldList.end())
return false;
MachineRegisterInfo &MRI = UseMI->getParent()->getParent()->getRegInfo();
SmallVector<std::pair<MachineOperand*, unsigned>, 32> Defs;
if (!getRegSeqInit(Defs, UseReg, OpTy, TII, MRI))
return false;
int32_t Imm;
for (unsigned I = 0, E = Defs.size(); I != E; ++I) {
const MachineOperand *Op = Defs[I].first;
if (!Op->isImm())
return false;
auto SubImm = Op->getImm();
if (!I) {
Imm = SubImm;
if (!TII->isInlineConstant(*Op, OpTy) ||
!TII->isOperandLegal(*UseMI, UseOpIdx, Op))
return false;
continue;
}
if (Imm != SubImm)
return false; // Can only fold splat constants
}
appendFoldCandidate(FoldList, UseMI, UseOpIdx, Defs[0].first);
return true;
}
void SIFoldOperands::foldOperand(
MachineOperand &OpToFold,
MachineInstr *UseMI,
int UseOpIdx,
SmallVectorImpl<FoldCandidate> &FoldList,
SmallVectorImpl<MachineInstr *> &CopiesToReplace) const {
const MachineOperand &UseOp = UseMI->getOperand(UseOpIdx);
if (!isUseSafeToFold(TII, *UseMI, UseOp))
return;
// FIXME: Fold operands with subregs.
if (UseOp.isReg() && OpToFold.isReg()) {
if (UseOp.isImplicit() || UseOp.getSubReg() != AMDGPU::NoSubRegister)
return;
}
// Special case for REG_SEQUENCE: We can't fold literals into
// REG_SEQUENCE instructions, so we have to fold them into the
// uses of REG_SEQUENCE.
if (UseMI->isRegSequence()) {
Register RegSeqDstReg = UseMI->getOperand(0).getReg();
unsigned RegSeqDstSubReg = UseMI->getOperand(UseOpIdx + 1).getImm();
MachineRegisterInfo::use_iterator Next;
for (MachineRegisterInfo::use_iterator
RSUse = MRI->use_begin(RegSeqDstReg), RSE = MRI->use_end();
RSUse != RSE; RSUse = Next) {
Next = std::next(RSUse);
MachineInstr *RSUseMI = RSUse->getParent();
if (tryToFoldACImm(TII, UseMI->getOperand(0), RSUseMI,
RSUse.getOperandNo(), FoldList))
continue;
if (RSUse->getSubReg() != RegSeqDstSubReg)
continue;
foldOperand(OpToFold, RSUseMI, RSUse.getOperandNo(), FoldList,
CopiesToReplace);
}
return;
}
if (tryToFoldACImm(TII, OpToFold, UseMI, UseOpIdx, FoldList))
return;
if (frameIndexMayFold(TII, *UseMI, UseOpIdx, OpToFold)) {
// Sanity check that this is a stack access.
// FIXME: Should probably use stack pseudos before frame lowering.
if (TII->getNamedOperand(*UseMI, AMDGPU::OpName::srsrc)->getReg() !=
MFI->getScratchRSrcReg())
return;
// Ensure this is either relative to the current frame or the current wave.
MachineOperand &SOff =
*TII->getNamedOperand(*UseMI, AMDGPU::OpName::soffset);
if ((!SOff.isReg() || SOff.getReg() != MFI->getStackPtrOffsetReg()) &&
(!SOff.isImm() || SOff.getImm() != 0))
return;
// A frame index will resolve to a positive constant, so it should always be
// safe to fold the addressing mode, even pre-GFX9.
UseMI->getOperand(UseOpIdx).ChangeToFrameIndex(OpToFold.getIndex());
// If this is relative to the current wave, update it to be relative to the
// current frame.
if (SOff.isImm())
SOff.ChangeToRegister(MFI->getStackPtrOffsetReg(), false);
return;
}
bool FoldingImmLike =
OpToFold.isImm() || OpToFold.isFI() || OpToFold.isGlobal();
if (FoldingImmLike && UseMI->isCopy()) {
Register DestReg = UseMI->getOperand(0).getReg();
// Don't fold into a copy to a physical register. Doing so would interfere
// with the register coalescer's logic which would avoid redundant
// initalizations.
if (DestReg.isPhysical())
return;
const TargetRegisterClass *DestRC = MRI->getRegClass(DestReg);
Register SrcReg = UseMI->getOperand(1).getReg();
if (SrcReg.isVirtual()) { // XXX - This can be an assert?
const TargetRegisterClass * SrcRC = MRI->getRegClass(SrcReg);
if (TRI->isSGPRClass(SrcRC) && TRI->hasVectorRegisters(DestRC)) {
MachineRegisterInfo::use_iterator NextUse;
SmallVector<FoldCandidate, 4> CopyUses;
for (MachineRegisterInfo::use_iterator
Use = MRI->use_begin(DestReg), E = MRI->use_end();
Use != E; Use = NextUse) {
NextUse = std::next(Use);
FoldCandidate FC = FoldCandidate(Use->getParent(),
Use.getOperandNo(), &UseMI->getOperand(1));
CopyUses.push_back(FC);
}
for (auto & F : CopyUses) {
foldOperand(*F.OpToFold, F.UseMI, F.UseOpNo,
FoldList, CopiesToReplace);
}
}
}
if (DestRC == &AMDGPU::AGPR_32RegClass &&
TII->isInlineConstant(OpToFold, AMDGPU::OPERAND_REG_INLINE_C_INT32)) {
UseMI->setDesc(TII->get(AMDGPU::V_ACCVGPR_WRITE_B32));
UseMI->getOperand(1).ChangeToImmediate(OpToFold.getImm());
CopiesToReplace.push_back(UseMI);
return;
}
// In order to fold immediates into copies, we need to change the
// copy to a MOV.
unsigned MovOp = TII->getMovOpcode(DestRC);
if (MovOp == AMDGPU::COPY)
return;
UseMI->setDesc(TII->get(MovOp));
MachineInstr::mop_iterator ImpOpI = UseMI->implicit_operands().begin();
MachineInstr::mop_iterator ImpOpE = UseMI->implicit_operands().end();
while (ImpOpI != ImpOpE) {
MachineInstr::mop_iterator Tmp = ImpOpI;
ImpOpI++;
UseMI->RemoveOperand(UseMI->getOperandNo(Tmp));
}
CopiesToReplace.push_back(UseMI);
} else {
if (UseMI->isCopy() && OpToFold.isReg() &&
UseMI->getOperand(0).getReg().isVirtual() &&
!UseMI->getOperand(1).getSubReg()) {
LLVM_DEBUG(dbgs() << "Folding " << OpToFold
<< "\n into " << *UseMI << '\n');
unsigned Size = TII->getOpSize(*UseMI, 1);
Register UseReg = OpToFold.getReg();
UseMI->getOperand(1).setReg(UseReg);
UseMI->getOperand(1).setSubReg(OpToFold.getSubReg());
UseMI->getOperand(1).setIsKill(false);
CopiesToReplace.push_back(UseMI);
OpToFold.setIsKill(false);
// That is very tricky to store a value into an AGPR. v_accvgpr_write_b32
// can only accept VGPR or inline immediate. Recreate a reg_sequence with
// its initializers right here, so we will rematerialize immediates and
// avoid copies via different reg classes.
SmallVector<std::pair<MachineOperand*, unsigned>, 32> Defs;
if (Size > 4 && TRI->isAGPR(*MRI, UseMI->getOperand(0).getReg()) &&
getRegSeqInit(Defs, UseReg, AMDGPU::OPERAND_REG_INLINE_C_INT32, TII,
*MRI)) {
const DebugLoc &DL = UseMI->getDebugLoc();
MachineBasicBlock &MBB = *UseMI->getParent();
UseMI->setDesc(TII->get(AMDGPU::REG_SEQUENCE));
for (unsigned I = UseMI->getNumOperands() - 1; I > 0; --I)
UseMI->RemoveOperand(I);
MachineInstrBuilder B(*MBB.getParent(), UseMI);
DenseMap<TargetInstrInfo::RegSubRegPair, Register> VGPRCopies;
SmallSetVector<TargetInstrInfo::RegSubRegPair, 32> SeenAGPRs;
for (unsigned I = 0; I < Size / 4; ++I) {
MachineOperand *Def = Defs[I].first;
TargetInstrInfo::RegSubRegPair CopyToVGPR;
if (Def->isImm() &&
TII->isInlineConstant(*Def, AMDGPU::OPERAND_REG_INLINE_C_INT32)) {
int64_t Imm = Def->getImm();
auto Tmp = MRI->createVirtualRegister(&AMDGPU::AGPR_32RegClass);
BuildMI(MBB, UseMI, DL,
TII->get(AMDGPU::V_ACCVGPR_WRITE_B32), Tmp).addImm(Imm);
B.addReg(Tmp);
} else if (Def->isReg() && TRI->isAGPR(*MRI, Def->getReg())) {
auto Src = getRegSubRegPair(*Def);
Def->setIsKill(false);
if (!SeenAGPRs.insert(Src)) {
// We cannot build a reg_sequence out of the same registers, they
// must be copied. Better do it here before copyPhysReg() created
// several reads to do the AGPR->VGPR->AGPR copy.
CopyToVGPR = Src;
} else {
B.addReg(Src.Reg, Def->isUndef() ? RegState::Undef : 0,
Src.SubReg);
}
} else {
assert(Def->isReg());
Def->setIsKill(false);
auto Src = getRegSubRegPair(*Def);
// Direct copy from SGPR to AGPR is not possible. To avoid creation
// of exploded copies SGPR->VGPR->AGPR in the copyPhysReg() later,
// create a copy here and track if we already have such a copy.
if (TRI->isSGPRReg(*MRI, Src.Reg)) {
CopyToVGPR = Src;
} else {
auto Tmp = MRI->createVirtualRegister(&AMDGPU::AGPR_32RegClass);
BuildMI(MBB, UseMI, DL, TII->get(AMDGPU::COPY), Tmp).add(*Def);
B.addReg(Tmp);
}
}
if (CopyToVGPR.Reg) {
Register Vgpr;
if (VGPRCopies.count(CopyToVGPR)) {
Vgpr = VGPRCopies[CopyToVGPR];
} else {
Vgpr = MRI->createVirtualRegister(&AMDGPU::VGPR_32RegClass);
BuildMI(MBB, UseMI, DL, TII->get(AMDGPU::COPY), Vgpr).add(*Def);
VGPRCopies[CopyToVGPR] = Vgpr;
}
auto Tmp = MRI->createVirtualRegister(&AMDGPU::AGPR_32RegClass);
BuildMI(MBB, UseMI, DL,
TII->get(AMDGPU::V_ACCVGPR_WRITE_B32), Tmp).addReg(Vgpr);
B.addReg(Tmp);
}
B.addImm(Defs[I].second);
}
LLVM_DEBUG(dbgs() << "Folded " << *UseMI << '\n');
return;
}
if (Size != 4)
return;
if (TRI->isAGPR(*MRI, UseMI->getOperand(0).getReg()) &&
TRI->isVGPR(*MRI, UseMI->getOperand(1).getReg()))
UseMI->setDesc(TII->get(AMDGPU::V_ACCVGPR_WRITE_B32));
else if (TRI->isVGPR(*MRI, UseMI->getOperand(0).getReg()) &&
TRI->isAGPR(*MRI, UseMI->getOperand(1).getReg()))
UseMI->setDesc(TII->get(AMDGPU::V_ACCVGPR_READ_B32));
return;
}
unsigned UseOpc = UseMI->getOpcode();
if (UseOpc == AMDGPU::V_READFIRSTLANE_B32 ||
(UseOpc == AMDGPU::V_READLANE_B32 &&
(int)UseOpIdx ==
AMDGPU::getNamedOperandIdx(UseOpc, AMDGPU::OpName::src0))) {
// %vgpr = V_MOV_B32 imm
// %sgpr = V_READFIRSTLANE_B32 %vgpr
// =>
// %sgpr = S_MOV_B32 imm
if (FoldingImmLike) {
if (execMayBeModifiedBeforeUse(*MRI,
UseMI->getOperand(UseOpIdx).getReg(),
*OpToFold.getParent(),
*UseMI))
return;
UseMI->setDesc(TII->get(AMDGPU::S_MOV_B32));
// FIXME: ChangeToImmediate should clear subreg
UseMI->getOperand(1).setSubReg(0);
if (OpToFold.isImm())
UseMI->getOperand(1).ChangeToImmediate(OpToFold.getImm());
else
UseMI->getOperand(1).ChangeToFrameIndex(OpToFold.getIndex());
UseMI->RemoveOperand(2); // Remove exec read (or src1 for readlane)
return;
}
if (OpToFold.isReg() && TRI->isSGPRReg(*MRI, OpToFold.getReg())) {
if (execMayBeModifiedBeforeUse(*MRI,
UseMI->getOperand(UseOpIdx).getReg(),
*OpToFold.getParent(),
*UseMI))
return;
// %vgpr = COPY %sgpr0
// %sgpr1 = V_READFIRSTLANE_B32 %vgpr
// =>
// %sgpr1 = COPY %sgpr0
UseMI->setDesc(TII->get(AMDGPU::COPY));
UseMI->getOperand(1).setReg(OpToFold.getReg());
UseMI->getOperand(1).setSubReg(OpToFold.getSubReg());
UseMI->getOperand(1).setIsKill(false);
UseMI->RemoveOperand(2); // Remove exec read (or src1 for readlane)
return;
}
}
const MCInstrDesc &UseDesc = UseMI->getDesc();
// Don't fold into target independent nodes. Target independent opcodes
// don't have defined register classes.
if (UseDesc.isVariadic() ||
UseOp.isImplicit() ||
UseDesc.OpInfo[UseOpIdx].RegClass == -1)
return;
}
if (!FoldingImmLike) {
tryAddToFoldList(FoldList, UseMI, UseOpIdx, &OpToFold, TII);
// FIXME: We could try to change the instruction from 64-bit to 32-bit
// to enable more folding opportunites. The shrink operands pass
// already does this.
return;
}
const MCInstrDesc &FoldDesc = OpToFold.getParent()->getDesc();
const TargetRegisterClass *FoldRC =
TRI->getRegClass(FoldDesc.OpInfo[0].RegClass);
// Split 64-bit constants into 32-bits for folding.
if (UseOp.getSubReg() && AMDGPU::getRegBitWidth(FoldRC->getID()) == 64) {
Register UseReg = UseOp.getReg();
const TargetRegisterClass *UseRC = MRI->getRegClass(UseReg);
if (AMDGPU::getRegBitWidth(UseRC->getID()) != 64)
return;
APInt Imm(64, OpToFold.getImm());
if (UseOp.getSubReg() == AMDGPU::sub0) {
Imm = Imm.getLoBits(32);
} else {
assert(UseOp.getSubReg() == AMDGPU::sub1);
Imm = Imm.getHiBits(32);
}
MachineOperand ImmOp = MachineOperand::CreateImm(Imm.getSExtValue());
tryAddToFoldList(FoldList, UseMI, UseOpIdx, &ImmOp, TII);
return;
}
tryAddToFoldList(FoldList, UseMI, UseOpIdx, &OpToFold, TII);
}
static bool evalBinaryInstruction(unsigned Opcode, int32_t &Result,
uint32_t LHS, uint32_t RHS) {
switch (Opcode) {
case AMDGPU::V_AND_B32_e64:
case AMDGPU::V_AND_B32_e32:
case AMDGPU::S_AND_B32:
Result = LHS & RHS;
return true;
case AMDGPU::V_OR_B32_e64:
case AMDGPU::V_OR_B32_e32:
case AMDGPU::S_OR_B32:
Result = LHS | RHS;
return true;
case AMDGPU::V_XOR_B32_e64:
case AMDGPU::V_XOR_B32_e32:
case AMDGPU::S_XOR_B32:
Result = LHS ^ RHS;
return true;
case AMDGPU::S_XNOR_B32:
Result = ~(LHS ^ RHS);
return true;
case AMDGPU::S_NAND_B32:
Result = ~(LHS & RHS);
return true;
case AMDGPU::S_NOR_B32:
Result = ~(LHS | RHS);
return true;
case AMDGPU::S_ANDN2_B32:
Result = LHS & ~RHS;
return true;
case AMDGPU::S_ORN2_B32:
Result = LHS | ~RHS;
return true;
case AMDGPU::V_LSHL_B32_e64:
case AMDGPU::V_LSHL_B32_e32:
case AMDGPU::S_LSHL_B32:
// The instruction ignores the high bits for out of bounds shifts.
Result = LHS << (RHS & 31);
return true;
case AMDGPU::V_LSHLREV_B32_e64:
case AMDGPU::V_LSHLREV_B32_e32:
Result = RHS << (LHS & 31);
return true;
case AMDGPU::V_LSHR_B32_e64:
case AMDGPU::V_LSHR_B32_e32:
case AMDGPU::S_LSHR_B32:
Result = LHS >> (RHS & 31);
return true;
case AMDGPU::V_LSHRREV_B32_e64:
case AMDGPU::V_LSHRREV_B32_e32:
Result = RHS >> (LHS & 31);
return true;
case AMDGPU::V_ASHR_I32_e64:
case AMDGPU::V_ASHR_I32_e32:
case AMDGPU::S_ASHR_I32:
Result = static_cast<int32_t>(LHS) >> (RHS & 31);
return true;
case AMDGPU::V_ASHRREV_I32_e64:
case AMDGPU::V_ASHRREV_I32_e32:
Result = static_cast<int32_t>(RHS) >> (LHS & 31);
return true;
default:
return false;
}
}
static unsigned getMovOpc(bool IsScalar) {
return IsScalar ? AMDGPU::S_MOV_B32 : AMDGPU::V_MOV_B32_e32;
}
/// Remove any leftover implicit operands from mutating the instruction. e.g.
/// if we replace an s_and_b32 with a copy, we don't need the implicit scc def
/// anymore.
static void stripExtraCopyOperands(MachineInstr &MI) {
const MCInstrDesc &Desc = MI.getDesc();
unsigned NumOps = Desc.getNumOperands() +
Desc.getNumImplicitUses() +
Desc.getNumImplicitDefs();
for (unsigned I = MI.getNumOperands() - 1; I >= NumOps; --I)
MI.RemoveOperand(I);
}
static void mutateCopyOp(MachineInstr &MI, const MCInstrDesc &NewDesc) {
MI.setDesc(NewDesc);
stripExtraCopyOperands(MI);
}
static MachineOperand *getImmOrMaterializedImm(MachineRegisterInfo &MRI,
MachineOperand &Op) {
if (Op.isReg()) {
// If this has a subregister, it obviously is a register source.
if (Op.getSubReg() != AMDGPU::NoSubRegister ||
!Register::isVirtualRegister(Op.getReg()))
return &Op;
MachineInstr *Def = MRI.getVRegDef(Op.getReg());
if (Def && Def->isMoveImmediate()) {
MachineOperand &ImmSrc = Def->getOperand(1);
if (ImmSrc.isImm())
return &ImmSrc;
}
}
return &Op;
}
// Try to simplify operations with a constant that may appear after instruction
// selection.
// TODO: See if a frame index with a fixed offset can fold.
static bool tryConstantFoldOp(MachineRegisterInfo &MRI,
const SIInstrInfo *TII,
MachineInstr *MI,
MachineOperand *ImmOp) {
unsigned Opc = MI->getOpcode();
if (Opc == AMDGPU::V_NOT_B32_e64 || Opc == AMDGPU::V_NOT_B32_e32 ||
Opc == AMDGPU::S_NOT_B32) {
MI->getOperand(1).ChangeToImmediate(~ImmOp->getImm());
mutateCopyOp(*MI, TII->get(getMovOpc(Opc == AMDGPU::S_NOT_B32)));
return true;
}
int Src1Idx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::src1);
if (Src1Idx == -1)
return false;
int Src0Idx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::src0);
MachineOperand *Src0 = getImmOrMaterializedImm(MRI, MI->getOperand(Src0Idx));
MachineOperand *Src1 = getImmOrMaterializedImm(MRI, MI->getOperand(Src1Idx));
if (!Src0->isImm() && !Src1->isImm())
return false;
if (MI->getOpcode() == AMDGPU::V_LSHL_OR_B32 ||
MI->getOpcode() == AMDGPU::V_LSHL_ADD_U32 ||
MI->getOpcode() == AMDGPU::V_AND_OR_B32) {
if (Src0->isImm() && Src0->getImm() == 0) {
// v_lshl_or_b32 0, X, Y -> copy Y
// v_lshl_or_b32 0, X, K -> v_mov_b32 K
// v_lshl_add_b32 0, X, Y -> copy Y
// v_lshl_add_b32 0, X, K -> v_mov_b32 K
// v_and_or_b32 0, X, Y -> copy Y
// v_and_or_b32 0, X, K -> v_mov_b32 K
bool UseCopy = TII->getNamedOperand(*MI, AMDGPU::OpName::src2)->isReg();
MI->RemoveOperand(Src1Idx);
MI->RemoveOperand(Src0Idx);
MI->setDesc(TII->get(UseCopy ? AMDGPU::COPY : AMDGPU::V_MOV_B32_e32));
return true;
}
}
// and k0, k1 -> v_mov_b32 (k0 & k1)
// or k0, k1 -> v_mov_b32 (k0 | k1)
// xor k0, k1 -> v_mov_b32 (k0 ^ k1)
if (Src0->isImm() && Src1->isImm()) {
int32_t NewImm;
if (!evalBinaryInstruction(Opc, NewImm, Src0->getImm(), Src1->getImm()))
return false;
const SIRegisterInfo &TRI = TII->getRegisterInfo();
bool IsSGPR = TRI.isSGPRReg(MRI, MI->getOperand(0).getReg());
// Be careful to change the right operand, src0 may belong to a different
// instruction.
MI->getOperand(Src0Idx).ChangeToImmediate(NewImm);
MI->RemoveOperand(Src1Idx);
mutateCopyOp(*MI, TII->get(getMovOpc(IsSGPR)));
return true;
}
if (!MI->isCommutable())
return false;
if (Src0->isImm() && !Src1->isImm()) {
std::swap(Src0, Src1);
std::swap(Src0Idx, Src1Idx);
}
int32_t Src1Val = static_cast<int32_t>(Src1->getImm());
if (Opc == AMDGPU::V_OR_B32_e64 ||
Opc == AMDGPU::V_OR_B32_e32 ||
Opc == AMDGPU::S_OR_B32) {
if (Src1Val == 0) {
// y = or x, 0 => y = copy x
MI->RemoveOperand(Src1Idx);
mutateCopyOp(*MI, TII->get(AMDGPU::COPY));
} else if (Src1Val == -1) {
// y = or x, -1 => y = v_mov_b32 -1
MI->RemoveOperand(Src1Idx);
mutateCopyOp(*MI, TII->get(getMovOpc(Opc == AMDGPU::S_OR_B32)));
} else
return false;
return true;
}
if (MI->getOpcode() == AMDGPU::V_AND_B32_e64 ||
MI->getOpcode() == AMDGPU::V_AND_B32_e32 ||
MI->getOpcode() == AMDGPU::S_AND_B32) {
if (Src1Val == 0) {
// y = and x, 0 => y = v_mov_b32 0
MI->RemoveOperand(Src0Idx);
mutateCopyOp(*MI, TII->get(getMovOpc(Opc == AMDGPU::S_AND_B32)));
} else if (Src1Val == -1) {
// y = and x, -1 => y = copy x
MI->RemoveOperand(Src1Idx);
mutateCopyOp(*MI, TII->get(AMDGPU::COPY));
stripExtraCopyOperands(*MI);
} else
return false;
return true;
}
if (MI->getOpcode() == AMDGPU::V_XOR_B32_e64 ||
MI->getOpcode() == AMDGPU::V_XOR_B32_e32 ||
MI->getOpcode() == AMDGPU::S_XOR_B32) {
if (Src1Val == 0) {
// y = xor x, 0 => y = copy x
MI->RemoveOperand(Src1Idx);
mutateCopyOp(*MI, TII->get(AMDGPU::COPY));
return true;
}
}
return false;
}
// Try to fold an instruction into a simpler one
static bool tryFoldInst(const SIInstrInfo *TII,
MachineInstr *MI) {
unsigned Opc = MI->getOpcode();
if (Opc == AMDGPU::V_CNDMASK_B32_e32 ||
Opc == AMDGPU::V_CNDMASK_B32_e64 ||
Opc == AMDGPU::V_CNDMASK_B64_PSEUDO) {
const MachineOperand *Src0 = TII->getNamedOperand(*MI, AMDGPU::OpName::src0);
const MachineOperand *Src1 = TII->getNamedOperand(*MI, AMDGPU::OpName::src1);
int Src1ModIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::src1_modifiers);
int Src0ModIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::src0_modifiers);
if (Src1->isIdenticalTo(*Src0) &&
(Src1ModIdx == -1 || !MI->getOperand(Src1ModIdx).getImm()) &&
(Src0ModIdx == -1 || !MI->getOperand(Src0ModIdx).getImm())) {
LLVM_DEBUG(dbgs() << "Folded " << *MI << " into ");
auto &NewDesc =
TII->get(Src0->isReg() ? (unsigned)AMDGPU::COPY : getMovOpc(false));
int Src2Idx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::src2);
if (Src2Idx != -1)
MI->RemoveOperand(Src2Idx);
MI->RemoveOperand(AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::src1));
if (Src1ModIdx != -1)
MI->RemoveOperand(Src1ModIdx);
if (Src0ModIdx != -1)
MI->RemoveOperand(Src0ModIdx);
mutateCopyOp(*MI, NewDesc);
LLVM_DEBUG(dbgs() << *MI << '\n');
return true;
}
}
return false;
}
void SIFoldOperands::foldInstOperand(MachineInstr &MI,
MachineOperand &OpToFold) const {
// We need mutate the operands of new mov instructions to add implicit
// uses of EXEC, but adding them invalidates the use_iterator, so defer
// this.
SmallVector<MachineInstr *, 4> CopiesToReplace;
SmallVector<FoldCandidate, 4> FoldList;
MachineOperand &Dst = MI.getOperand(0);
bool FoldingImm = OpToFold.isImm() || OpToFold.isFI() || OpToFold.isGlobal();
if (FoldingImm) {
unsigned NumLiteralUses = 0;
MachineOperand *NonInlineUse = nullptr;
int NonInlineUseOpNo = -1;
MachineRegisterInfo::use_iterator NextUse;
for (MachineRegisterInfo::use_iterator
Use = MRI->use_begin(Dst.getReg()), E = MRI->use_end();
Use != E; Use = NextUse) {
NextUse = std::next(Use);
MachineInstr *UseMI = Use->getParent();
unsigned OpNo = Use.getOperandNo();
// Folding the immediate may reveal operations that can be constant
// folded or replaced with a copy. This can happen for example after
// frame indices are lowered to constants or from splitting 64-bit
// constants.
//
// We may also encounter cases where one or both operands are
// immediates materialized into a register, which would ordinarily not
// be folded due to multiple uses or operand constraints.
if (OpToFold.isImm() && tryConstantFoldOp(*MRI, TII, UseMI, &OpToFold)) {
LLVM_DEBUG(dbgs() << "Constant folded " << *UseMI << '\n');
// Some constant folding cases change the same immediate's use to a new
// instruction, e.g. and x, 0 -> 0. Make sure we re-visit the user
// again. The same constant folded instruction could also have a second
// use operand.
NextUse = MRI->use_begin(Dst.getReg());
FoldList.clear();
continue;
}
// Try to fold any inline immediate uses, and then only fold other
// constants if they have one use.
//
// The legality of the inline immediate must be checked based on the use
// operand, not the defining instruction, because 32-bit instructions
// with 32-bit inline immediate sources may be used to materialize
// constants used in 16-bit operands.
//
// e.g. it is unsafe to fold:
// s_mov_b32 s0, 1.0 // materializes 0x3f800000
// v_add_f16 v0, v1, s0 // 1.0 f16 inline immediate sees 0x00003c00
// Folding immediates with more than one use will increase program size.
// FIXME: This will also reduce register usage, which may be better
// in some cases. A better heuristic is needed.
if (isInlineConstantIfFolded(TII, *UseMI, OpNo, OpToFold)) {
foldOperand(OpToFold, UseMI, OpNo, FoldList, CopiesToReplace);
} else if (frameIndexMayFold(TII, *UseMI, OpNo, OpToFold)) {
foldOperand(OpToFold, UseMI, OpNo, FoldList,
CopiesToReplace);
} else {
if (++NumLiteralUses == 1) {
NonInlineUse = &*Use;
NonInlineUseOpNo = OpNo;
}
}
}
if (NumLiteralUses == 1) {
MachineInstr *UseMI = NonInlineUse->getParent();
foldOperand(OpToFold, UseMI, NonInlineUseOpNo, FoldList, CopiesToReplace);
}
} else {
// Folding register.
SmallVector <MachineRegisterInfo::use_iterator, 4> UsesToProcess;
for (MachineRegisterInfo::use_iterator
Use = MRI->use_begin(Dst.getReg()), E = MRI->use_end();
Use != E; ++Use) {
UsesToProcess.push_back(Use);
}
for (auto U : UsesToProcess) {
MachineInstr *UseMI = U->getParent();
foldOperand(OpToFold, UseMI, U.getOperandNo(),
FoldList, CopiesToReplace);
}
}
MachineFunction *MF = MI.getParent()->getParent();
// Make sure we add EXEC uses to any new v_mov instructions created.
for (MachineInstr *Copy : CopiesToReplace)
Copy->addImplicitDefUseOperands(*MF);
for (FoldCandidate &Fold : FoldList) {
assert(!Fold.isReg() || Fold.OpToFold);
if (Fold.isReg() && Register::isVirtualRegister(Fold.OpToFold->getReg())) {
Register Reg = Fold.OpToFold->getReg();
MachineInstr *DefMI = Fold.OpToFold->getParent();
if (DefMI->readsRegister(AMDGPU::EXEC, TRI) &&
execMayBeModifiedBeforeUse(*MRI, Reg, *DefMI, *Fold.UseMI))
continue;
}
if (updateOperand(Fold, *TII, *TRI, *ST)) {
// Clear kill flags.
if (Fold.isReg()) {
assert(Fold.OpToFold && Fold.OpToFold->isReg());
// FIXME: Probably shouldn't bother trying to fold if not an
// SGPR. PeepholeOptimizer can eliminate redundant VGPR->VGPR
// copies.
MRI->clearKillFlags(Fold.OpToFold->getReg());
}
LLVM_DEBUG(dbgs() << "Folded source from " << MI << " into OpNo "
<< static_cast<int>(Fold.UseOpNo) << " of "
<< *Fold.UseMI << '\n');
tryFoldInst(TII, Fold.UseMI);
} else if (Fold.isCommuted()) {
// Restoring instruction's original operand order if fold has failed.
TII->commuteInstruction(*Fold.UseMI, false);
}
}
}
// Clamp patterns are canonically selected to v_max_* instructions, so only
// handle them.
const MachineOperand *SIFoldOperands::isClamp(const MachineInstr &MI) const {
unsigned Op = MI.getOpcode();
switch (Op) {
case AMDGPU::V_MAX_F32_e64:
case AMDGPU::V_MAX_F16_e64:
case AMDGPU::V_MAX_F64:
case AMDGPU::V_PK_MAX_F16: {
if (!TII->getNamedOperand(MI, AMDGPU::OpName::clamp)->getImm())
return nullptr;
// Make sure sources are identical.
const MachineOperand *Src0 = TII->getNamedOperand(MI, AMDGPU::OpName::src0);
const MachineOperand *Src1 = TII->getNamedOperand(MI, AMDGPU::OpName::src1);
if (!Src0->isReg() || !Src1->isReg() ||
Src0->getReg() != Src1->getReg() ||
Src0->getSubReg() != Src1->getSubReg() ||
Src0->getSubReg() != AMDGPU::NoSubRegister)
return nullptr;
// Can't fold up if we have modifiers.
if (TII->hasModifiersSet(MI, AMDGPU::OpName::omod))
return nullptr;
unsigned Src0Mods
= TII->getNamedOperand(MI, AMDGPU::OpName::src0_modifiers)->getImm();
unsigned Src1Mods
= TII->getNamedOperand(MI, AMDGPU::OpName::src1_modifiers)->getImm();
// Having a 0 op_sel_hi would require swizzling the output in the source
// instruction, which we can't do.
unsigned UnsetMods = (Op == AMDGPU::V_PK_MAX_F16) ? SISrcMods::OP_SEL_1
: 0u;
if (Src0Mods != UnsetMods && Src1Mods != UnsetMods)
return nullptr;
return Src0;
}
default:
return nullptr;
}
}
// We obviously have multiple uses in a clamp since the register is used twice
// in the same instruction.
static bool hasOneNonDBGUseInst(const MachineRegisterInfo &MRI, unsigned Reg) {
int Count = 0;
for (auto I = MRI.use_instr_nodbg_begin(Reg), E = MRI.use_instr_nodbg_end();
I != E; ++I) {
if (++Count > 1)
return false;
}
return true;
}
// FIXME: Clamp for v_mad_mixhi_f16 handled during isel.
bool SIFoldOperands::tryFoldClamp(MachineInstr &MI) {
const MachineOperand *ClampSrc = isClamp(MI);
if (!ClampSrc || !hasOneNonDBGUseInst(*MRI, ClampSrc->getReg()))
return false;
MachineInstr *Def = MRI->getVRegDef(ClampSrc->getReg());
// The type of clamp must be compatible.
if (TII->getClampMask(*Def) != TII->getClampMask(MI))
return false;
MachineOperand *DefClamp = TII->getNamedOperand(*Def, AMDGPU::OpName::clamp);
if (!DefClamp)
return false;
LLVM_DEBUG(dbgs() << "Folding clamp " << *DefClamp << " into " << *Def
<< '\n');
// Clamp is applied after omod, so it is OK if omod is set.
DefClamp->setImm(1);
MRI->replaceRegWith(MI.getOperand(0).getReg(), Def->getOperand(0).getReg());
MI.eraseFromParent();
return true;
}
static int getOModValue(unsigned Opc, int64_t Val) {
switch (Opc) {
case AMDGPU::V_MUL_F32_e64: {
switch (static_cast<uint32_t>(Val)) {
case 0x3f000000: // 0.5
return SIOutMods::DIV2;
case 0x40000000: // 2.0
return SIOutMods::MUL2;
case 0x40800000: // 4.0
return SIOutMods::MUL4;
default:
return SIOutMods::NONE;
}
}
case AMDGPU::V_MUL_F16_e64: {
switch (static_cast<uint16_t>(Val)) {
case 0x3800: // 0.5
return SIOutMods::DIV2;
case 0x4000: // 2.0
return SIOutMods::MUL2;
case 0x4400: // 4.0
return SIOutMods::MUL4;
default:
return SIOutMods::NONE;
}
}
default:
llvm_unreachable("invalid mul opcode");
}
}
// FIXME: Does this really not support denormals with f16?
// FIXME: Does this need to check IEEE mode bit? SNaNs are generally not
// handled, so will anything other than that break?
std::pair<const MachineOperand *, int>
SIFoldOperands::isOMod(const MachineInstr &MI) const {
unsigned Op = MI.getOpcode();
switch (Op) {
case AMDGPU::V_MUL_F32_e64:
case AMDGPU::V_MUL_F16_e64: {
// If output denormals are enabled, omod is ignored.
if ((Op == AMDGPU::V_MUL_F32_e64 && MFI->getMode().FP32OutputDenormals) ||
(Op == AMDGPU::V_MUL_F16_e64 && MFI->getMode().FP64FP16OutputDenormals))
return std::make_pair(nullptr, SIOutMods::NONE);
const MachineOperand *RegOp = nullptr;
const MachineOperand *ImmOp = nullptr;
const MachineOperand *Src0 = TII->getNamedOperand(MI, AMDGPU::OpName::src0);
const MachineOperand *Src1 = TII->getNamedOperand(MI, AMDGPU::OpName::src1);
if (Src0->isImm()) {
ImmOp = Src0;
RegOp = Src1;
} else if (Src1->isImm()) {
ImmOp = Src1;
RegOp = Src0;
} else
return std::make_pair(nullptr, SIOutMods::NONE);
int OMod = getOModValue(Op, ImmOp->getImm());
if (OMod == SIOutMods::NONE ||
TII->hasModifiersSet(MI, AMDGPU::OpName::src0_modifiers) ||
TII->hasModifiersSet(MI, AMDGPU::OpName::src1_modifiers) ||
TII->hasModifiersSet(MI, AMDGPU::OpName::omod) ||
TII->hasModifiersSet(MI, AMDGPU::OpName::clamp))
return std::make_pair(nullptr, SIOutMods::NONE);
return std::make_pair(RegOp, OMod);
}
case AMDGPU::V_ADD_F32_e64:
case AMDGPU::V_ADD_F16_e64: {
// If output denormals are enabled, omod is ignored.
if ((Op == AMDGPU::V_ADD_F32_e64 && MFI->getMode().FP32OutputDenormals) ||
(Op == AMDGPU::V_ADD_F16_e64 && MFI->getMode().FP64FP16OutputDenormals))
return std::make_pair(nullptr, SIOutMods::NONE);
// Look through the DAGCombiner canonicalization fmul x, 2 -> fadd x, x
const MachineOperand *Src0 = TII->getNamedOperand(MI, AMDGPU::OpName::src0);
const MachineOperand *Src1 = TII->getNamedOperand(MI, AMDGPU::OpName::src1);
if (Src0->isReg() && Src1->isReg() && Src0->getReg() == Src1->getReg() &&
Src0->getSubReg() == Src1->getSubReg() &&
!TII->hasModifiersSet(MI, AMDGPU::OpName::src0_modifiers) &&
!TII->hasModifiersSet(MI, AMDGPU::OpName::src1_modifiers) &&
!TII->hasModifiersSet(MI, AMDGPU::OpName::clamp) &&
!TII->hasModifiersSet(MI, AMDGPU::OpName::omod))
return std::make_pair(Src0, SIOutMods::MUL2);
return std::make_pair(nullptr, SIOutMods::NONE);
}
default:
return std::make_pair(nullptr, SIOutMods::NONE);
}
}
// FIXME: Does this need to check IEEE bit on function?
bool SIFoldOperands::tryFoldOMod(MachineInstr &MI) {
const MachineOperand *RegOp;
int OMod;
std::tie(RegOp, OMod) = isOMod(MI);
if (OMod == SIOutMods::NONE || !RegOp->isReg() ||
RegOp->getSubReg() != AMDGPU::NoSubRegister ||
!hasOneNonDBGUseInst(*MRI, RegOp->getReg()))
return false;
MachineInstr *Def = MRI->getVRegDef(RegOp->getReg());
MachineOperand *DefOMod = TII->getNamedOperand(*Def, AMDGPU::OpName::omod);
if (!DefOMod || DefOMod->getImm() != SIOutMods::NONE)
return false;
// Clamp is applied after omod. If the source already has clamp set, don't
// fold it.
if (TII->hasModifiersSet(*Def, AMDGPU::OpName::clamp))
return false;
LLVM_DEBUG(dbgs() << "Folding omod " << MI << " into " << *Def << '\n');
DefOMod->setImm(OMod);
MRI->replaceRegWith(MI.getOperand(0).getReg(), Def->getOperand(0).getReg());
MI.eraseFromParent();
return true;
}
bool SIFoldOperands::runOnMachineFunction(MachineFunction &MF) {
if (skipFunction(MF.getFunction()))
return false;
MRI = &MF.getRegInfo();
ST = &MF.getSubtarget<GCNSubtarget>();
TII = ST->getInstrInfo();
TRI = &TII->getRegisterInfo();
MFI = MF.getInfo<SIMachineFunctionInfo>();
// omod is ignored by hardware if IEEE bit is enabled. omod also does not
// correctly handle signed zeros.
//
// FIXME: Also need to check strictfp
bool IsIEEEMode = MFI->getMode().IEEE;
bool HasNSZ = MFI->hasNoSignedZerosFPMath();
for (MachineBasicBlock *MBB : depth_first(&MF)) {
MachineBasicBlock::iterator I, Next;
MachineOperand *CurrentKnownM0Val = nullptr;
for (I = MBB->begin(); I != MBB->end(); I = Next) {
Next = std::next(I);
MachineInstr &MI = *I;
tryFoldInst(TII, &MI);
if (!TII->isFoldableCopy(MI)) {
// Saw an unknown clobber of m0, so we no longer know what it is.
if (CurrentKnownM0Val && MI.modifiesRegister(AMDGPU::M0, TRI))
CurrentKnownM0Val = nullptr;
// TODO: Omod might be OK if there is NSZ only on the source
// instruction, and not the omod multiply.
if (IsIEEEMode || (!HasNSZ && !MI.getFlag(MachineInstr::FmNsz)) ||
!tryFoldOMod(MI))
tryFoldClamp(MI);
continue;
}
// Specially track simple redefs of m0 to the same value in a block, so we
// can erase the later ones.
if (MI.getOperand(0).getReg() == AMDGPU::M0) {
MachineOperand &NewM0Val = MI.getOperand(1);
if (CurrentKnownM0Val && CurrentKnownM0Val->isIdenticalTo(NewM0Val)) {
MI.eraseFromParent();
continue;
}
// We aren't tracking other physical registers
CurrentKnownM0Val = (NewM0Val.isReg() && NewM0Val.getReg().isPhysical()) ?
nullptr : &NewM0Val;
continue;
}
MachineOperand &OpToFold = MI.getOperand(1);
bool FoldingImm =
OpToFold.isImm() || OpToFold.isFI() || OpToFold.isGlobal();
// FIXME: We could also be folding things like TargetIndexes.
if (!FoldingImm && !OpToFold.isReg())
continue;
if (OpToFold.isReg() && !Register::isVirtualRegister(OpToFold.getReg()))
continue;
// Prevent folding operands backwards in the function. For example,
// the COPY opcode must not be replaced by 1 in this example:
//
// %3 = COPY %vgpr0; VGPR_32:%3
// ...
// %vgpr0 = V_MOV_B32_e32 1, implicit %exec
MachineOperand &Dst = MI.getOperand(0);
if (Dst.isReg() && !Register::isVirtualRegister(Dst.getReg()))
continue;
foldInstOperand(MI, OpToFold);
}
}
return true;
}
|
.model small
.data
.code
main proc
mov ax,1000H
mov bx,2000H
cmp ax,bx
endp
end main |
; A245093: Triangle read by rows in which row n lists the first n terms of A000203.
; 1,1,3,1,3,4,1,3,4,7,1,3,4,7,6,1,3,4,7,6,12,1,3,4,7,6,12,8,1,3,4,7,6,12,8,15,1,3,4,7,6,12,8,15,13,1,3,4,7,6,12,8,15,13,18,1,3,4,7,6,12,8,15,13,18,12,1,3,4,7,6,12,8,15,13,18,12,28,1,3,4,7,6,12,8,15,13,18,12,28,14,1,3,4,7,6,12,8,15,13
seq $0,25675 ; Exponent of 8 (value of j) in n-th number of form 7^i*8^j.
seq $0,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n).
|
// Copyright 2017 Polonite Authors. All rights reserved.
// Distributed under MIT license that can be found in the LICENSE file.
#include "Base/Memory/LinearAllocator.h"
#include "Base/Error/BasicExceptions.h"
#include "Base/Math/Alignment.h"
#include "Base/Memory/Allocate.h"
#include <stdlib.h>
namespace stp {
/**
* @class LinearAllocator
* An allocator that internally allocates multi-kbyte buffers for placing
* objects in. It avoids the overhead of malloc when many objects are allocated.
* It is most useful when creating many small objects with a similar lifetime,
* and doesn't add significant overhead for large allocations.
*
* Note: no constructors are called by this class, and no destructors are
* called also! The client must taske care of this if needed.
*/
struct LinearAllocator::Block {
Block* next;
byte_t* free_ptr;
int free_size;
// data[] follows
int getSize() { return free_size + (free_ptr - getData()); }
void reset() {
next = nullptr;
free_size = getSize();
free_ptr = getData();
}
const byte_t* getData() const { return reinterpret_cast<const byte_t*>(this + 1); }
byte_t* getData() { return reinterpret_cast<byte_t*>(this + 1); }
bool contains(const void* addr) const {
auto* ptr = reinterpret_cast<const byte_t*>(addr);
return getData() <= ptr && ptr < free_ptr;
}
};
LinearAllocator::LinearAllocator(int min_block_size) {
ASSERT(1 <= min_block_size && min_block_size <= MaxBlockSize);
if (min_block_size < MinBlockSize)
min_block_size = MinBlockSize;
block_list_ = nullptr;
min_block_size_ = min_block_size;
chunk_size_ = min_block_size_;
}
LinearAllocator::~LinearAllocator() {
freeChain(block_list_);
}
void LinearAllocator::freeChain(Block* block) {
while (block) {
Block* next = block->next;
freeMemory(block);
block = next;
}
};
/**
* Like @ref reset() but preserves largest block.
*/
void LinearAllocator::clear() {
validate();
Block* largest = block_list_;
if (largest) {
Block* next;
for (Block* cur = largest->next; cur; cur = next) {
next = cur->next;
if (cur->getSize() > largest->getSize()) {
freeMemory(largest);
largest = cur;
} else {
freeMemory(cur);
}
}
largest->reset();
total_capacity_ = largest->getSize();
#if ASSERT_IS_ON
block_count_ = 1;
#endif
} else {
total_capacity_ = 0;
#if ASSERT_IS_ON
block_count_ = 0;
#endif
}
block_list_ = largest;
chunk_size_ = min_block_size_; // Reset to our initial min_block_size_.
total_used_ = 0;
#if ASSERT_IS_ON
total_lost_ = 0;
#endif
validate();
}
/**
* Frees all blocks.
* All pointers allocated through @ref allocate() are invalidated (cannot be dereferenced).
*/
void LinearAllocator::reset() {
freeChain(block_list_);
block_list_ = nullptr;
chunk_size_ = min_block_size_; // Reset to our initial min_block_size_.
total_capacity_ = 0;
total_used_ = 0;
#if ASSERT_IS_ON
total_lost_ = 0;
block_count_ = 0;
#endif
}
void* LinearAllocator::tryAllocateWithinBlock(Block* block, int size, int alignment) {
int padding;
if (!alignForward(block->free_ptr, alignment, size, block->free_size, &padding))
return nullptr;
void* ptr = block->free_ptr;
block->free_ptr += size;
block->free_size -= size;
total_used_ += padding + size;
validate();
return ptr;
}
void* LinearAllocator::tryAllocate(int size, int alignment) {
validate();
void* rv = nullptr;
if (block_list_)
rv = tryAllocateWithinBlock(block_list_, size, alignment);
if (rv == nullptr) {
// Include alignment to guarantee further success.
Block* block = newBlock(size + alignment);
#if ASSERT_IS_ON
if (block_list_)
total_lost_ += block_list_->free_size;
#endif
block->next = block_list_;
block_list_ = block;
rv = tryAllocateWithinBlock(block_list_, size, alignment);
}
ASSERT(rv != nullptr);
return rv;
}
/**
* Call this to deallocate the most-recently allocated @a ptr by @ref allocate().
*
* This is a hint to the underlying allocator that
* the previous allocation may be reused, but the implementation is free
* to ignore this call (and return 0).
*
* @return the number of bytes freed is returned on success. 0 otherwise.
*/
int LinearAllocator::freeRecent(void* ptr) {
validate();
int bytes = 0;
Block* block = block_list_;
if (block) {
auto* c_ptr = reinterpret_cast<byte_t*>(ptr);
ASSERT(block->contains(ptr));
bytes = block->free_ptr - c_ptr;
total_used_ -= bytes;
block->free_size += bytes;
block->free_ptr = c_ptr;
}
validate();
return bytes;
}
LinearAllocator::Block* LinearAllocator::newBlock(int size) {
ASSERT(size > 0);
if (size < chunk_size_) {
size = chunk_size_;
} else if (size > MaxBlockSize) {
throw LengthException();
}
auto* block = (Block*)allocateMemory(isizeof(Block) + size);
block->free_size = size;
block->free_ptr = block->getData();
total_capacity_ += size;
#if ASSERT_IS_ON
block_count_ += 1;
#endif
// Increase chunk size for next block.
if (chunk_size_ < MaxBlockSize) {
int new_chunk_size = alignForward(chunk_size_ + (chunk_size_ >> 1), ialignof(max_align_t));
chunk_size_ = min(new_chunk_size, MaxBlockSize);
}
return block;
}
/**
* Returns true if the specified address is within one of the chunks, and
* has at least 1-byte following the address (i.e. if @a ptr points to the
* end of a chunk, then @ref contains() will return false).
*/
bool LinearAllocator::contains(const void* ptr) const {
for (const Block* block = block_list_; block; block = block->next) {
if (block->contains(ptr))
return true;
}
return false;
}
#if ASSERT_IS_ON
void LinearAllocator::validate() const {
int computed_block_count = 0;
int computed_total_capacity = 0;
int computed_total_used = 0;
int computed_total_lost = 0;
int computed_total_available = 0;
for (Block* block = block_list_; block; block = block->next) {
++computed_block_count;
computed_total_capacity += block->getSize();
computed_total_used += block->free_ptr - block->getData();
if (block == block_list_) {
computed_total_available += block->free_size;
} else {
computed_total_lost += block->free_size;
}
}
ASSERT(block_count_ == computed_block_count);
ASSERT(total_capacity_ == computed_total_capacity);
ASSERT(total_used_ == computed_total_used);
ASSERT(total_lost_ == computed_total_lost);
int total_capacity = computed_total_used + computed_total_lost + computed_total_available;
ASSERT(computed_total_capacity == total_capacity);
}
#endif // ASSERT_IS_ON
} // namespace stp
|
/**
Copyright 2009-2021 National Technology and Engineering Solutions of Sandia,
LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government
retains certain rights in this software.
Sandia National Laboratories is a multimission laboratory managed and operated
by National Technology and Engineering Solutions of Sandia, LLC., a wholly
owned subsidiary of Honeywell International, Inc., for the U.S. Department of
Energy's National Nuclear Security Administration under contract DE-NA0003525.
Copyright (c) 2009-2021, NTESS
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 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
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.
Questions? Contact sst-macro-help@sandia.gov
*/
#include <dlfcn.h>
#include <vector>
#include <string>
#include <cstring>
#include <sys/stat.h>
#include <sprockit/errors.h>
namespace sstmac {
static std::vector<std::string> split_path(const std::string& searchPath)
{
std::vector<std::string> paths;
char * pathCopy = new char [searchPath.length() + 1];
std::strcpy(pathCopy, searchPath.c_str());
char *brkb = NULL;
char *p = NULL;
for ( p = strtok_r(pathCopy, ":", &brkb); p ; p = strtok_r(NULL, ":", &brkb) ) {
paths.push_back(p);
}
delete [] pathCopy;
return paths;
}
std::string loadExternPathStr(){
const char* libpath_str = getenv("SST_LIB_PATH");
if (libpath_str){
return libpath_str;
} else {
return "";
}
}
void* loadExternLibrary(const std::string& libname, const std::string& searchPath)
{
struct stat sbuf;
int ret = stat(libname.c_str(), &sbuf);
std::string fullpath;
if (ret != 0){
std::vector<std::string> paths = split_path(searchPath);
//always include current directory
paths.push_back(".");
for (auto&& path : paths) {
fullpath = path + "/" + libname;
ret = stat(fullpath.c_str(), &sbuf);
if (ret == 0) break;
}
} else {
fullpath = libname;
}
if (ret != 0){
//didn't find it
spkt_abort_printf("%s not found in current directory or in path=%s",
libname.c_str(), searchPath.c_str());
}
//std::cerr << "Loading external library " << fullpath << std::endl;
// This is a little weird, but always try the last path - if we
// didn't succeed in the stat, we'll get a file not found error
// from dlopen, which is a useful error message for the user.
void* handle = dlopen(fullpath.c_str(), RTLD_NOW|RTLD_LOCAL);
if (NULL == handle) {
spkt_abort_printf("Opening library %s failed\n:%s", libname.c_str(), dlerror());
}
return handle;
}
void* loadExternLibrary(const std::string& libname)
{
return loadExternLibrary(libname, loadExternPathStr());
}
void unloadExternLibrary(void* handle)
{
// for sst-core parallel simulation, dlclosing causes segfault (GlobalVariableContext destructor)
//dlclose(handle);
}
}
|
/*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
*/
#include "hphp/runtime/vm/jit/region-prune-arcs.h"
#include <string>
#include <utility>
#include <vector>
#include <folly/Format.h>
#include "hphp/util/assertions.h"
#include "hphp/util/dataflow-worklist.h"
#include "hphp/util/trace.h"
#include "hphp/runtime/vm/jit/type.h"
#include "hphp/runtime/vm/jit/region-selection.h"
namespace HPHP { namespace jit {
TRACE_SET_MOD(pgo);
namespace {
//////////////////////////////////////////////////////////////////////
struct State {
bool initialized{false};
std::vector<Type> locals;
Type mbase{TGen};
};
struct BlockInfo {
RegionDesc::BlockId blockID;
State in;
State out;
};
//////////////////////////////////////////////////////////////////////
std::string DEBUG_ONLY show(const State& state) {
if (!state.initialized) return "<uninit>\n";
auto ret = std::string{};
for (auto locID = uint32_t{0}; locID < state.locals.size(); ++locID) {
auto const ty = state.locals[locID];
if (ty < TGen) folly::format(&ret, " L{}: {}\n", locID, ty.toString());
}
auto const ty = state.mbase;
if (ty < TGen) folly::format(&ret, " M{{}}: {}\n", ty.toString());
return ret;
}
State entry_state(const RegionDesc& region, std::vector<Type>* input) {
auto ret = State{};
ret.initialized = true;
if (input) ret.locals = *input;
auto const func = region.start().func();
ret.locals.resize(func->numLocals(), TGen);
return ret;
}
bool merge_type(Type& lhs, const Type& rhs) {
auto const old = lhs;
lhs |= rhs;
return lhs != old;
}
bool merge_into(State& dst, const State& src) {
if (!dst.initialized) {
dst = src;
return true;
}
auto changed = false;
always_assert(dst.locals.size() == src.locals.size());
for (auto i = uint32_t{0}; i < src.locals.size(); ++i) {
changed |= merge_type(dst.locals[i], src.locals[i]);
}
changed |= merge_type(dst.mbase, src.mbase);
return changed;
}
//////////////////////////////////////////////////////////////////////
bool is_tracked(Location l) {
switch (l.tag()) {
case LTag::Local:
case LTag::MBase:
return true;
case LTag::Stack:
case LTag::CSlotCls:
case LTag::CSlotTS:
return false;
}
not_reached();
}
Type& type_of(State& state, Location l) {
switch (l.tag()) {
case LTag::Local: {
auto const locID = l.localId();
assertx(locID < state.locals.size());
return state.locals[locID];
}
case LTag::Stack:
case LTag::CSlotCls:
case LTag::CSlotTS:
always_assert(false);
case LTag::MBase:
return state.mbase;
}
not_reached();
}
Type type_of(const State& state, Location l) {
return type_of(const_cast<State&>(state), l);
}
bool preconds_may_pass(const RegionDesc::Block& block,
const State& state) {
// Bail if any type is Bottom, which can only happen in unreachable paths.
for (auto const& ty : state.locals) {
if (ty == TBottom) return false;
}
auto const& preConds = block.typePreConditions();
for (auto const& p : preConds) {
if (!is_tracked(p.location)) continue;
auto const ty = type_of(state, p.location);
if (!ty.maybe(p.type)) {
FTRACE(6, " x B{}'s precond {} fails ({} is {})\n",
block.id(), show(p), show(p.location), ty);
return false;
}
}
return true;
}
/*
* PostConditions of a block are our local transfer functions.
*
* Changed types are overwritten, while refined types are intersected
* with the current type.
*/
void apply_transfer_function(State& dst, const PostConditions& postConds) {
for (auto& p : postConds.refined) {
if (!is_tracked(p.location)) continue;
auto& ty = type_of(dst, p.location);
ty &= p.type;
}
for (auto& p : postConds.changed) {
if (!is_tracked(p.location)) continue;
auto& ty = type_of(dst, p.location);
ty = p.type;
}
}
//////////////////////////////////////////////////////////////////////
}
void region_prune_arcs(RegionDesc& region, std::vector<Type>* input) {
FTRACE(4, "region_prune_arcs\n");
region.sortBlocks();
auto const sortedBlocks = region.blocks();
// Maps region block ids to their RPO ids.
auto blockToRPO = jit::fast_map<RegionDesc::BlockId,uint32_t>{};
auto blockInfos = std::vector<BlockInfo>(sortedBlocks.size());
auto workQ = dataflow_worklist<uint32_t>(sortedBlocks.size());
for (auto rpoID = uint32_t{0}; rpoID < sortedBlocks.size(); ++rpoID) {
auto const& b = sortedBlocks[rpoID];
auto& binfo = blockInfos[rpoID];
binfo.blockID = b->id();
blockToRPO[binfo.blockID] = rpoID;
}
workQ.push(0);
blockInfos[0].in = entry_state(region, input);
FTRACE(4, "Iterating:\n");
do {
auto const rpoID = workQ.pop();
auto& binfo = blockInfos[rpoID];
FTRACE(4, "B{}\n", binfo.blockID);
binfo.out = binfo.in;
apply_transfer_function(
binfo.out,
region.block(binfo.blockID)->postConds()
);
for (auto& succ : region.succs(binfo.blockID)) {
auto const succRPO = blockToRPO.find(succ);
assertx(succRPO != end(blockToRPO));
auto& succInfo = blockInfos[succRPO->second];
if (preconds_may_pass(*region.block(succInfo.blockID), binfo.out)) {
if (merge_into(succInfo.in, binfo.out)) {
FTRACE(5, " -> {}\n", succInfo.blockID);
workQ.push(succRPO->second);
}
}
}
} while (!workQ.empty());
FTRACE(2, "\nPostConds fixed point:\n{}\n",
[&] () -> std::string {
auto ret = std::string{};
for (auto& s : blockInfos) {
folly::format(&ret, "B{}:\n{}", s.blockID, show(s.in));
}
return ret;
}()
);
// Now remove any edge that looks like it will unconditionally fail type
// predictions, and completely remove any block that can't be reached.
using ArcIDs = std::pair<RegionDesc::BlockId,RegionDesc::BlockId>;
auto toRemove = std::vector<ArcIDs>{};
for (auto rpoID = uint32_t{0}; rpoID < sortedBlocks.size(); ++rpoID) {
auto const& binfo = blockInfos[rpoID];
for (auto& succ : region.succs(binfo.blockID)) {
auto const succRPO = blockToRPO.find(succ);
assertx(succRPO != end(blockToRPO));
auto const& succInfo = blockInfos[succRPO->second];
if (!binfo.in.initialized ||
!succInfo.in.initialized ||
!preconds_may_pass(*region.block(succInfo.blockID), binfo.out)) {
FTRACE(2, "Pruning arc: B{} -> B{}\n",
binfo.blockID,
succInfo.blockID);
toRemove.emplace_back(binfo.blockID, succInfo.blockID);
}
}
for (auto& r : toRemove) region.removeArc(r.first, r.second);
toRemove.clear();
}
// Get rid of the completely unreachable blocks, now that any arcs to/from
// them are gone.
for (auto rpoID = uint32_t{0}; rpoID < sortedBlocks.size(); ++rpoID) {
auto const& binfo = blockInfos[rpoID];
if (!binfo.in.initialized) {
FTRACE(2, "Pruning block: B{}\n", binfo.blockID);
region.deleteBlock(binfo.blockID);
}
}
FTRACE(2, "\n");
}
}}
|
; A004247: Multiplication table read by antidiagonals: T(i,j) = ij (i>=0, j>=0).
; 0,0,0,0,1,0,0,2,2,0,0,3,4,3,0,0,4,6,6,4,0,0,5,8,9,8,5,0,0,6,10,12,12,10,6,0,0,7,12,15,16,15,12,7,0,0,8,14,18,20,20,18,14,8,0,0,9,16,21,24,25,24,21,16,9,0,0,10,18,24,28,30,30,28,24,18,10,0,0,11,20,27,32,35,36,35,32,27,20,11,0,0,12,22,30,36,40,42,42,40
lpb $0
add $1,$2
trn $1,$0
mul $1,$0
add $2,1
trn $0,$2
lpe
mov $0,$1
|
// MusicXML Class Library
// Copyright (c) by Matthew James Briggs
// Distributed under the MIT License
#include "mxtest/control/CompileControl.h"
#ifdef MX_COMPILE_IMPORT_TESTS
#include "ImportTestImpl.h"
#include "ezxml/XFactory.h"
#include "mxtest/file/StupidFileFunctions.h"
#include "mxtest/file/Path.h"
#include "mxtest/import/ExpectedFiles.h"
#include "mxtest/import/SortAttributes.h"
#include <fstream>
using namespace ezxml;
using namespace mx::core;
namespace mxtest
{
std::string ImportRoundTripResult::getHeaderRow()
{
std::stringstream ss;
ss << "testName" << ",";
ss << "testResult" << ",";
ss << "percentMatch" << ",";
ss << "totalMs" << ",";
ss << "xdocLoadMs" << ",";
ss << "mxLoadMs" << ",";
ss << "mxSaveMs" << ",";
ss << "strCompareMs" << ",";
ss << "xdocSaveMs" << ",";
ss << "inputFileName" << ",";
ss << "message";
return ss.str();
}
std::string ImportRoundTripResult::getMessageNoCommas() const
{
std::stringstream ss;
for( auto c = message.cbegin(); c != message.cend(); ++c )
{
if( *c != ',' && *c != '\n' && *c != '\r' && *c != '\t' && *c != ';' )
{
ss << (*c);
}
else
{
ss << "_";
}
}
return ss.str().substr( 0, 128 );
}
void ImportRoundTripResult::writeRow( std::ostream& os ) const
{
os << testName << ",";
os << testResult << ",";
os.precision(4);
os << percentMatch << ",";
os << totalMs << ",";
os << xdocLoadMs << ",";
os << mxLoadMs << ",";
os << mxSaveMs << ",";
os << strCompareMs << ",";
os << xdocSaveMs << ",";
os << inputFileName << ",";
os << getMessageNoCommas() << std::endl;
}
ImportRoundTripTest::ImportRoundTripTest(
const char* const paramInputFileNamePart,
const char* const paramInputFileExtensionPart,
const char* const paramInputSuiteName,
const char* const paramTestCppFileName,
const int paramTestCppLineNum,
const char* const paramResourceDirectoryPath )
: myInputFileNamePart( paramInputFileNamePart )
, myInputFileExtensionPart( paramInputFileExtensionPart )
, myInputSuiteName( paramInputSuiteName )
, myTestCppFileName( paramTestCppFileName )
, myTestCppLineNum( paramTestCppLineNum )
, myResourceDirectoryPath( paramResourceDirectoryPath )
, myTestTimer()
, myXdocLoadTimer()
, myMxDeserializeTimer()
, myMxReserializeTimer()
, myTestCompareTimer()
, myXdocWriteTimer()
, myIsMxBypassed( false )
{
}
bool ImportRoundTripTest::runTest( std::stringstream& outMessage )
{
std::string inputFilePath = filePath( myInputSuiteName, getFileName() );
std::string expectedFilePath = getExpectedFileFullPath( myInputSuiteName, getFileName() );
auto inputXDoc = XFactory::makeXDoc();
auto expectedXDoc = XFactory::makeXDoc();
auto reserializedXDoc = XFactory::makeXDoc();
auto resultantMxDoc = makeDocument();
myTestTimer.start();
if( !loadTestFile( outMessage, inputXDoc, inputFilePath ) )
{
return false;
}
myXdocLoadTimer.start();
if( !loadExpectedFile( outMessage, expectedXDoc, expectedFilePath ) )
{
return false;
}
myXdocLoadTimer.stop();
myMxDeserializeTimer.start();
bool isLoadIntoMxClassesSuccessful = false;
isLoadIntoMxClassesSuccessful = loadIntoMxClasses( outMessage, inputXDoc, resultantMxDoc );
myMxDeserializeTimer.stop();
myMxReserializeTimer.start();
if( myIsMxBypassed )
{
loadExpectedFile( outMessage, reserializedXDoc, expectedFilePath );
}
else
{
if( !reserializeToXDoc( outMessage, resultantMxDoc, reserializedXDoc ) )
{
return false;
}
}
myMxReserializeTimer.stop();
myTestCompareTimer.start();
std::stringstream expectedSstr;
std::stringstream actualSstr;
expectedXDoc->saveStream( expectedSstr );
reserializedXDoc->saveStream( actualSstr );
std::string expected = expectedSstr.str();
std::string actual = actualSstr.str();
double percentMatch = 0.0;
auto isCheckEqualSuccessful = checkEqual( outMessage, expected, actual, percentMatch );
myTestCompareTimer.stop();
myXdocWriteTimer.start();
if( !writeErrorFiles( isCheckEqualSuccessful, expected, actual ) )
{
return false;
}
myXdocWriteTimer.stop();
auto resultInfo = createInfo( outMessage.str(), isCheckEqualSuccessful, percentMatch );
myTestTimer.stop();
if( !writeResultToOutputFile( resultInfo ) )
{
return false;
}
return isCheckEqualSuccessful && isLoadIntoMxClassesSuccessful;
}
std::string ImportRoundTripTest::getTestName() const
{
std::stringstream name;
name << myInputSuiteName << "_" << myInputFileNamePart;
return name.str();
}
std::string ImportRoundTripTest::getFileName() const
{
return myInputFileNamePart + "." + myInputFileExtensionPart;
}
std::ostream& ImportRoundTripTest::streamValues( std::ostream& os ) const
{
os << "inputFileNamePart: " << myInputFileNamePart << ", ";
os << "inputFileExtensionPart: " << myInputFileExtensionPart << ", ";
os << "inputSuiteName: " << myInputSuiteName << ", ";
os << "testCppFileName: " << myTestCppFileName << ", ";
os << "testCppLineNum: " << myTestCppLineNum << ", ";
os << "resourceDirectoryPath: " << myResourceDirectoryPath;
return os;
}
void ImportRoundTripTest::setIsMxBypassed( bool value )
{
myIsMxBypassed = value;
}
bool ImportRoundTripTest::loadTestFile( std::ostream& msg, ::ezxml::XDocPtr& outXDoc, const std::string& filepath )
{
try
{
outXDoc->loadFile( filepath );
auto root = outXDoc->getRoot();
for( auto it = root->attributesBegin(); it != root->attributesEnd(); ++it )
{
if( it->getName() == "version" )
{
it->setValue( "3.0" );
return true;
}
}
root->appendAttribute( "version" )->setValue( "3.0" );
}
catch ( std::exception& e )
{
msg << "exception occurred while loading xml file '" << filepath << "', exception message '" << e.what() << "'";
return false;
}
return true;
}
bool ImportRoundTripTest::loadExpectedFile( std::ostream& msg, ::ezxml::XDocPtr& outXDoc, const std::string& filepath )
{
try
{
outXDoc->loadFile( filepath );
}
catch ( std::exception& e )
{
msg << "exception occurred while loading xml file '" << filepath << "', exception message '" << e.what() << "'";
return false;
}
return true;
}
bool ImportRoundTripTest::loadIntoMxClasses( std::ostream& msg, const ::ezxml::XDocPtr& inXdoc, mx::core::DocumentPtr& outMx )
{
if( myIsMxBypassed )
{
return true;
}
std::stringstream xdocMsg;
bool isSuccess = false;
try
{
isSuccess = outMx->fromXDoc( xdocMsg, *inXdoc );
}
catch ( std::exception& e )
{
msg << "exception occurred in fromXDoc '" << e.what() << "' ";
msg << "additional messages from xdoc, if any '" << xdocMsg.str() << "'";
return false;
}
if( !isSuccess )
{
msg << xdocMsg.str();
}
return isSuccess;
}
bool ImportRoundTripTest::reserializeToXDoc( std::ostream& msg, const mx::core::DocumentPtr& inMx, ::ezxml::XDocPtr& outXDoc )
{
if( myIsMxBypassed )
{
return true;
}
try
{
inMx->toXDoc( *outXDoc );
// because attribute order doesn't matter in xml, we need to sort them alphabetically before and after round trip
sortAttributes( *outXDoc );
}
catch ( std::exception& e )
{
msg << "exception occurred in toXDoc '" << e.what() << "'";
const std::string filename = getTestOutputErrorFileFullPath( myInputSuiteName, getFileName() );
std::ofstream errorFile;
openOutputFile( errorFile, filename );
inMx->toStream( errorFile );
errorFile.close();
return false;
}
return true;
}
bool ImportRoundTripTest::checkEqual( std::ostream& msg, const std::string& inExpected, const std::string& inActual, double& outPercentMatch )
{
outPercentMatch = 0.0;
std::vector<std::pair<int, int>> failurePositions;
int charPosition = 1;
int lineNumber = 1;
int totalCharCount = 0;
int failedCharCount = 0;
int matchingCharCount = 0;
bool isEqual = true;
std::string::const_iterator eit = inExpected.cbegin();
std::string::const_iterator ait = inActual.cbegin();
std::string::const_iterator eend = inExpected.cend();
std::string::const_iterator aend = inActual.cend();
bool isExpectedLongerThanActual = false;
bool isActualLongerThanExpected = false;
for( ; ( eit != eend ) && ( ait != aend ); ++eit, ++ait )
{
bool eIsEnd = ( eit == eend );
bool aIsEnd = ( ait == aend );
if( !eIsEnd )
{
++totalCharCount;
}
if( eIsEnd && !aIsEnd )
{
++failedCharCount;
isEqual = false;
if( !isActualLongerThanExpected )
{
msg << "actual has more characters than expected ";
}
isActualLongerThanExpected = true;
continue;
}
if( !eIsEnd && aIsEnd )
{
++failedCharCount;
isEqual = false;
if( !isExpectedLongerThanActual )
{
msg << "actual has fewer characters than expected ";
}
isExpectedLongerThanActual = true;
continue;
}
if( eIsEnd || aIsEnd )
{
continue;
}
char e = *eit;
char a = *ait;
if( e == '\n' )
{
++lineNumber;
charPosition = 0;
}
else
{
++charPosition;
}
if( e != a )
{
isEqual = false;
failurePositions.push_back( std::pair<int,int>( lineNumber, charPosition ) );
if( failurePositions.size() == 1 )
{
msg << getTestName() << " ";
msg << "first non matching char found at lineNumber " << lineNumber;
msg << ", charPosition " << charPosition << ". expected '" << e << "' ";
msg << "but was '" << a << "' ";
}
++failedCharCount;
}
else
{
++matchingCharCount;
}
}
if( inExpected.size() > 0 )
{
outPercentMatch = ( static_cast<double>( matchingCharCount ) / static_cast<double>( inExpected.size() ) );
}
if( !isEqual || failurePositions.size() > 0 || failedCharCount > 0 )
{
msg << "total expected characters " << inExpected.size() << ", total matching characters " << matchingCharCount << ", ";
msg << "match percent " << outPercentMatch << " ";
}
return isEqual && failurePositions.size() == 0 && failedCharCount == 0;
}
ImportRoundTripResult ImportRoundTripTest::createInfo( const std::string& msg, bool success, const double percentMatch )
{
ImportRoundTripResult result;
result.testName = getTestName();
result.testResult = success ? "Passed" : "Failed";
result.percentMatch = percentMatch;
result.totalMs = myTestTimer.getMilliseconds();
result.xdocLoadMs = myXdocLoadTimer.getMilliseconds();
result.mxLoadMs = myMxDeserializeTimer.getMilliseconds();
result.mxSaveMs = myMxReserializeTimer.getMilliseconds();
result.strCompareMs = myTestCompareTimer.getMilliseconds();
result.xdocSaveMs = myXdocWriteTimer.getMilliseconds();
result.inputFileName = getFileName();
result.message = msg;
return result;
}
bool ImportRoundTripTest::writeResultToOutputFile( const ImportRoundTripResult& info )
{
std::ofstream ofile( getTestRecordFilepath(), std::ios::app );
if( !ofile.is_open() )
{
return false;
}
ofile.setf( std::ios::fixed, std:: ios::floatfield );
info.writeRow( ofile );
ofile.close();
return true;
}
bool ImportRoundTripTest::writeErrorFiles( bool isSuccess, const std::string& expectedContents, const std::string& actualContents )
{
if( isSuccess )
{
// no need to write the files
return true;
}
std::string testOutputErrorFilePath = getTestOutputErrorFileFullPath( myInputSuiteName, getFileName() );
std::string testOutputExpectedFilePath = getTestOutputExpectedFileFullPath( myInputSuiteName, getFileName() );
std::ofstream errorFile;
openOutputFile( errorFile, testOutputErrorFilePath );
errorFile << actualContents;
errorFile.close();
std::ofstream expectedFile;
openOutputFile( expectedFile, testOutputExpectedFilePath );
expectedFile << expectedContents;
expectedFile.close();
return true;
}
}
#endif
|
SECTION code_clib
SECTION code_fp_math48
PUBLIC ___fs2ulong_callee
EXTERN cm48_sdccixp_ds2ulong_callee
defc ___fs2ulong_callee = cm48_sdccixp_ds2ulong_callee
|
.global s_prepare_buffers
s_prepare_buffers:
push %r8
push %rax
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x114ff, %rsi
nop
nop
nop
nop
and %rbx, %rbx
and $0xffffffffffffffc0, %rsi
vmovntdqa (%rsi), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $0, %xmm5, %rcx
nop
sub $42530, %rbp
lea addresses_WC_ht+0x175df, %rsi
lea addresses_A_ht+0x19cdf, %rdi
nop
nop
nop
nop
and %rax, %rax
mov $81, %rcx
rep movsw
nop
nop
nop
xor $34065, %rax
lea addresses_WT_ht+0x657f, %rcx
nop
xor $57335, %r8
movb (%rcx), %al
nop
nop
nop
nop
nop
and $24709, %rcx
lea addresses_A_ht+0x1497f, %rax
nop
cmp %rcx, %rcx
movb (%rax), %bl
nop
add $49981, %rax
lea addresses_WC_ht+0x1b2f, %rsi
lea addresses_D_ht+0xc81, %rdi
nop
cmp %rdx, %rdx
mov $3, %rcx
rep movsq
nop
nop
nop
nop
nop
inc %rdi
lea addresses_UC_ht+0x57f, %rsi
lea addresses_WC_ht+0x16e7f, %rdi
nop
nop
nop
nop
nop
and %rdx, %rdx
mov $61, %rcx
rep movsw
nop
nop
nop
add $49115, %rax
lea addresses_UC_ht+0xdf7f, %rdi
nop
nop
nop
nop
nop
and %rcx, %rcx
mov $0x6162636465666768, %r8
movq %r8, %xmm3
movups %xmm3, (%rdi)
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_A_ht+0xe1a7, %rbx
nop
nop
nop
nop
cmp $31230, %rcx
movl $0x61626364, (%rbx)
nop
nop
nop
nop
nop
inc %rcx
lea addresses_WT_ht+0xfe7f, %rsi
lea addresses_WC_ht+0x191df, %rdi
nop
nop
cmp %rax, %rax
mov $77, %rcx
rep movsq
inc %rdi
lea addresses_WT_ht+0x1d90f, %r8
nop
nop
nop
nop
nop
cmp $18632, %rbx
movups (%r8), %xmm0
vpextrq $0, %xmm0, %rdx
nop
sub %rbx, %rbx
lea addresses_WT_ht+0x1eb3f, %rsi
nop
nop
nop
nop
nop
xor $57168, %rbx
mov $0x6162636465666768, %rax
movq %rax, (%rsi)
nop
nop
add $15386, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r8
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r8
push %r9
push %rbx
push %rsi
// Store
mov $0x2d9fd000000006db, %rbx
nop
nop
nop
nop
cmp $56777, %r9
mov $0x5152535455565758, %r10
movq %r10, %xmm5
vmovups %ymm5, (%rbx)
cmp %r10, %r10
// Faulty Load
mov $0x41e93d000000057f, %r9
nop
nop
nop
nop
xor $24772, %r12
mov (%r9), %r8d
lea oracles, %r9
and $0xff, %r8
shlq $12, %r8
mov (%r9,%r8,1), %r8
pop %rsi
pop %rbx
pop %r9
pop %r8
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_NC', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_NC', 'congruent': 2}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': True, 'AVXalign': False, 'size': 4, 'type': 'addresses_NC', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 5}}
{'dst': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WT_ht', 'congruent': 11}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A_ht', 'congruent': 10}}
{'dst': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}}
{'dst': {'same': True, 'congruent': 5, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC_ht', 'congruent': 9}, 'OP': 'STOR'}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_A_ht', 'congruent': 1}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT_ht', 'congruent': 3}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 6}, 'OP': 'STOR'}
{'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
*/
|
; A164131: Numbers n such that n^2 == 2 (mod 31).
; 8,23,39,54,70,85,101,116,132,147,163,178,194,209,225,240,256,271,287,302,318,333,349,364,380,395,411,426,442,457,473,488,504,519,535,550,566,581,597,612,628,643,659,674,690,705,721,736,752,767,783,798,814,829,845,860,876,891,907,922,938,953,969,984,1000,1015,1031,1046,1062,1077,1093,1108,1124,1139,1155,1170,1186,1201,1217,1232,1248,1263,1279,1294,1310,1325,1341,1356,1372,1387,1403,1418,1434,1449,1465,1480,1496,1511,1527,1542,1558,1573,1589,1604,1620,1635,1651,1666,1682,1697,1713,1728,1744,1759,1775,1790,1806,1821,1837,1852,1868,1883,1899,1914,1930,1945,1961,1976,1992,2007,2023,2038,2054,2069,2085,2100,2116,2131,2147,2162,2178,2193,2209,2224,2240,2255,2271,2286,2302,2317,2333,2348,2364,2379,2395,2410,2426,2441,2457,2472,2488,2503,2519,2534,2550,2565,2581,2596,2612,2627,2643,2658,2674,2689,2705,2720,2736,2751,2767,2782,2798,2813,2829,2844,2860,2875,2891,2906,2922,2937,2953,2968,2984,2999,3015,3030,3046,3061,3077,3092,3108,3123,3139,3154,3170,3185,3201,3216,3232,3247,3263,3278,3294,3309,3325,3340,3356,3371,3387,3402,3418,3433,3449,3464,3480,3495,3511,3526,3542,3557,3573,3588,3604,3619,3635,3650,3666,3681,3697,3712,3728,3743,3759,3774,3790,3805,3821,3836,3852,3867
mul $0,31
div $0,2
mov $1,$0
add $1,8
|
; A167381: The numbers read down the left-center column of an arrangement of the natural numbers in square blocks.
; 1,3,6,10,14,18,23,29,35,41,47,53,60,68,76,84,92,100,108,116,125,135,145,155,165,175,185,195,205,215,226,238,250,262,274,286,298,310,322,334,346,358,371,385,399,413,427,441,455,469,483,497,511,525,539,553,568,584,600,616,632,648,664,680,696,712,728,744,760,776,792,808,825,843,861,879,897,915,933,951,969,987,1005,1023,1041,1059,1077,1095,1113,1131,1150,1170,1190,1210,1230,1250,1270,1290,1310,1330
mul $0,2
add $0,1
lpb $0
add $1,$0
add $2,4
trn $0,$2
lpe
mov $0,$1
|
#include <iostream>
#include <time.h>
extern "C" {
// Too much of a headache and segfaults in unix
// tm gmtime_safe(const time_t time) {
// tm tm_snapshot;
// #if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
// gmtime_s(&tm_snapshot, &time);
// #else
// gmtime_r(&time, &tm_snapshot); // POSIX
// #endif
// return tm_snapshot;
// }
// tm localtime_safe(const time_t time) {
// tm tm_snapshot;
// #if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
// localtime_s(&tm_snapshot, &time);
// #else
// localtime_r(&time, &tm_snapshot); // POSIX
// #endif
// return tm_snapshot;
// }
char* Offset(char* ptr, long amount) {
return ptr + amount;
}
void i32_print(int val) {
std::cout << val;
}
void i64_print(long long int val) {
std::cout << val;
}
void f32_print(float val) {
std::cout << val;
}
void f64_print(double val) {
std::cout << val;
}
void i1_print(bool val) {
if (val) {
std::cout << "true";
} else {
std::cout << "false";
}
}
void str_print(char* val) {
std::cout << val;
}
void blob_print(char* val) {
std::cout << val;
}
void i32_println(int val) {
std::cout << val << std::endl;
}
void i64_println(long long int val) {
std::cout << val << std::endl;
}
void f32_println(float val) {
std::cout << val << std::endl;
}
void f64_println(double val) {
std::cout << val << std::endl;
}
void i1_println(bool val) {
if (val) {
std::cout << "true" << std::endl;
} else {
std::cout << "false" << std::endl;
}
}
void str_println(char* val) {
std::cout << val << std::endl;
}
void blob_println(char* val) {
std::cout << val << std::endl;
}
} |
;
; Fast background restore
;
; VZ200/300 version
;
;
; $Id: bkrestore.asm,v 1.4 2002/04/17 21:30:25 dom Exp $
;
XLIB bkrestore
LIB pixeladdress
.bkrestore
ld hl,2
add hl,sp
ld e,(hl)
inc hl
ld d,(hl) ;sprite address
push de
pop ix
ld h,(ix+2) ; restore sprite position
ld l,(ix+3)
ld a,(ix+0)
ld b,(ix+1)
cp 9
jr nc,bkrestore
._sloop
push bc
push hl
ld a,(ix+4)
and @10101010
ld (hl),a
inc hl
ld a,(ix+4)
and @01010101
rla
ld (hl),a
inc hl
ld a,(ix+5)
and @10101010
ld (hl),a
inc hl
ld a,(ix+5)
and @01010101
rla
ld (hl),a
inc hl
inc ix
inc ix
pop hl
ld bc,32 ;Go to next line
add hl,bc
pop bc
djnz _sloop
ret
.bkrestorew
push bc
ld a,(ix+4)
and @10101010
ld (hl),a
inc hl
ld a,(ix+4)
and @01010101
rla
ld (hl),a
inc hl
ld a,(ix+5)
and @10101010
ld (hl),a
inc hl
ld a,(ix+5)
and @01010101
rla
ld (hl),a
inc hl
ld a,(ix+6)
and @10101010
ld (hl),a
inc hl
ld a,(ix+6)
and @01010101
rla
ld (hl),a
inc ix
inc ix
inc ix
pop hl
ld bc,32 ;Go to next line
add hl,bc
pop bc
djnz bkrestorew
ret
|
;
; Copyright (c) 2020 Bitdefender
; SPDX-License-Identifier: Apache-2.0
;
section .text
%ifdef __YASM_MAJOR__
%include "cpu_state_defs.nasm"
%else
%include "kernel\cpu_state_defs.nasm"
%endif
%ifdef EFI_BUILD
%include "asmlib\loader_interface.nasm"
%else
%ifdef _CPU_STATE_ASM_USE_WINGUEST_PATH_
%include "..\..\asmlib\loader_interface.nasm"
%else
%include "loader_interface.nasm"
%endif
%endif
[bits 64]
IA32_VMX_BASIC equ 0x480
MSR_KERNELGSbase equ 0xC0000102
IA32_FS_BASE_MSR equ 0xC0000100
IA32_GS_BASE_MSR equ 0xC0000101
CPUID_01_ECX_XSAVE equ 0x04000000 ;; bit 26
global CpustateCaptureGuestFxState
global CpustateRestoreGuestFxState
global CpustateCaptureGuestXState
global CpustateRestoreGuestXState
global CpustateCaptureGuestState
; rcx - ptr to CPUSTATE_GUEST_STATE_INFO
; rdx - new value for RIP/RSP
global CpustateSetRIP
global CpustateSetRSP
global CpustateRestoreGuestState ; rcx = ptr to CPUSTATE_GUEST_STATE_INFO
global CpustateGetGdtLimit
global CpustateGetGdtBase
global CpustateGetCs
global CpustateGetTrFromSecondaryGdt ; used if we needed to rebuild gdt to add a valid tr
; rcx = guest info ptr; rdx = address of new descriptors table
global CpuStateLock
%macro SMSR64 2 ; example: SMSR64 rdi + CPUSTATE_HOST_STATE_INFO.Ia32Efer, 0x277
mov rcx, %2
rdmsr
mov [%1], eax
mov [%1 + 4], edx
%endmacro
%macro LMSR64 2 ; example: LMSR64 0x277, rdi + CPUSTATE_HOST_STATE_INFO.Ia32Efer,
mov rcx, %1
mov eax, [%2]
mov edx, [%2 + 4]
wrmsr
%endmacro
%define SAFE_CALL_C X64CALL
; enable fpu in CR0 (save old state on stack)
%macro ENTER_STACK_ENABLE_FPU 0
push rax
mov rax, cr0
push rax
and al, (255-4)
mov cr0, rax
%endmacro
; restore from stack enable/disable fpu state in CR0
%macro EXIT_STACK_ENABLE_FPU 0
pop rax
mov cr0, rax
pop rax
%endmacro
CpustateGetGdtBase:
sub rsp, 12
sgdt [rsp]
mov rax, [rsp+2]
add rsp, 12
ret
CpustateGetGdtLimit:
sub rsp, 12
sgdt [rsp]
xor rax, rax
mov ax, [rsp]
add rsp, 12
ret
CpustateGetCs:
xor rax, rax
mov ax, cs
ret
_getTableBaseAndLimitForSelector:
; rcx = pointer to a CPUSTATE_FULL_SELECTOR_DATA structure
; rdx = selector value
; get the GDT limit & base
sgdt [rcx]
test dx, 100b
jz .done ; pointing to a global descriptor, [rcx] is already filled
.local:
;
; Locate global descriptor for ldt and grab base&limit for ldt from there
;
push rdx
sldt rdx ; dx = ldt selector value pointing to a global descriptor
test dx, dx
jz .noLDT
push r8
SAFE_CALL_C CpustateGetDescriptorBaseAddress
mov r8, rax ; r8 = buffer for base address
SAFE_CALL_C CpustateGetDescriptorLimit
mov [rcx], ax ; prev. limit overwritten
mov [rcx+2],r8 ; prev. base overwritten
pop r8
pop rdx
.done:
; [rcx] now contains the structure
xor rax, rax
inc rax
ret
.noLDT:
pop rdx
xor rax, rax
ret
CpustateGetDescriptorBaseFromAx:
; returns 0 on error
push rcx
push rdx
sub rsp, 10
; locate the corresponding table
mov rcx, rsp
xor rdx, rdx
mov dx, ax
call _getTableBaseAndLimitForSelector
test rax, rax
jz .badSelector
; decode the base value
SAFE_CALL_C CpustateGetDescriptorBaseAddress
jmp .done
.badSelector:
xor rax, rax
.done:
add rsp, 10
pop rdx
pop rcx
ret
CpustateGetDescriptorLimitFromAx:
; returns 0 on error
push rcx
push rdx
sub rsp, 10
; locate the corresponding table
mov rcx, rsp
xor rdx, rdx
mov dx, ax
call _getTableBaseAndLimitForSelector
test rax, rax
jz .badSelector
; decode the base value
SAFE_CALL_C CpustateGetDescriptorLimit
jmp .done
.badSelector:
xor rax, rax
.done:
add rsp, 10
pop rdx
pop rcx
ret
CpustateGetDescriptorRightsFromAx:
push rcx
push rdx
sub rsp, 10
; locate the corresponding table
movzx rdx, ax
mov rcx, rsp
xor rdx, rdx
mov dx, ax
call _getTableBaseAndLimitForSelector
test rax, rax
jz .badSelector
; decode the base value
SAFE_CALL_C CpustateGetDescriptorRights
jmp .done
.badSelector:
mov rax, 0xCACA
.done:
add rsp, 10
pop rdx
pop rcx
ret
CpustateCaptureGuestState:
push rax
push rdx
push rdi
push rcx
;;; take care at [rsp + x] indexed values!!
mov rdi, rcx
;;mov [rdi + CPUSTATE_GUEST_STATE_INFO.UsingFakedTr], BYTE 0
mov [rdi + CPUSTATE_GUEST_STATE_INFO.UsingFakedTr], dl
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Rax], rax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Rbx], rbx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Rcx], rcx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Rdx], rdx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Rbp], rbp
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Rsi], rsi
push rax
mov rax, [rsp + 16] ; skip two values to get to the orig rdi
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Rdi], rax
pop rax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.R8 ], r8
mov [rdi + CPUSTATE_GUEST_STATE_INFO.R9 ], r9
mov [rdi + CPUSTATE_GUEST_STATE_INFO.R10], r10
mov [rdi + CPUSTATE_GUEST_STATE_INFO.R11], r11
mov [rdi + CPUSTATE_GUEST_STATE_INFO.R12], r12
mov [rdi + CPUSTATE_GUEST_STATE_INFO.R13], r13
mov [rdi + CPUSTATE_GUEST_STATE_INFO.R14], r14
mov [rdi + CPUSTATE_GUEST_STATE_INFO.R15], r15
mov [rdi + CPUSTATE_GUEST_STATE_INFO.IsStructureInitialized], byte 1
[bits 32] ; bits 32 + rdi=>edi = same encoding - fool the assembler to avoid warnings
mov [edi + CPUSTATE_GUEST_STATE_INFO.Es], es
mov [edi + CPUSTATE_GUEST_STATE_INFO.Cs], cs
mov [edi + CPUSTATE_GUEST_STATE_INFO.Ss], ss
mov [edi + CPUSTATE_GUEST_STATE_INFO.Ds], ds
mov [edi + CPUSTATE_GUEST_STATE_INFO.Fs], fs
mov [edi + CPUSTATE_GUEST_STATE_INFO.Gs], gs
[bits 64]
sldt ax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Ldtr], ax
mov byte [rdi + CPUSTATE_GUEST_STATE_INFO.Tr], 0
cmp [rdi + CPUSTATE_GUEST_STATE_INFO.UsingFakedTr], byte 1
je skip_tr1
str ax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Tr], ax
skip_tr1:
xor rax, rax
not rax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.LinkPointer], rax ; reserved, needs to be 0xFFFF....FF
SMSR64 rdi + CPUSTATE_GUEST_STATE_INFO.Ia32Debugctl, 0x1d9
SMSR64 rdi + CPUSTATE_GUEST_STATE_INFO.Ia32Pat, 0x277
SMSR64 rdi + CPUSTATE_GUEST_STATE_INFO.Ia32Efer, 0xC0000080
SMSR64 rdi + CPUSTATE_GUEST_STATE_INFO.Ia32PerfGlobalCtrl, 0x38F
; EPT disabled init values...
xor rax, rax
not rax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Pdpte0], rax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Pdpte1], rax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Pdpte2], rax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Pdpte3], rax
mov ax, es
call CpustateGetDescriptorLimitFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.EsLimit], eax
mov ax, cs
call CpustateGetDescriptorLimitFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.CsLimit], eax
mov ax, ss
call CpustateGetDescriptorLimitFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.SsLimit], eax
mov ax, ds
call CpustateGetDescriptorLimitFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.DsLimit], eax
mov ax, fs
call CpustateGetDescriptorLimitFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.FsLimit], eax
mov ax, gs
call CpustateGetDescriptorLimitFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.GsLimit], eax
sldt ax
call CpustateGetDescriptorLimitFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.LdtrLimit], eax
cmp byte [rdi + CPUSTATE_GUEST_STATE_INFO.UsingFakedTr], 1
je skip_tr2
str ax
call CpustateGetDescriptorLimitFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.TrLimit], eax
skip_tr2:
sub rsp, 10
sgdt [rsp]
movzx eax, WORD [rsp]
mov [rdi + CPUSTATE_GUEST_STATE_INFO.GdtrLimit], eax
sidt [rsp]
movzx eax, WORD [rsp]
mov [rdi + CPUSTATE_GUEST_STATE_INFO.IdtrLimit], eax
add rsp, 10
mov ax, es
call CpustateGetDescriptorRightsFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.EsAccessRights], eax
mov ax, cs
call CpustateGetDescriptorRightsFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.CsAccessRights], eax
mov ax, ss
call CpustateGetDescriptorRightsFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.SsAccessRights], eax
mov ax, ds
call CpustateGetDescriptorRightsFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.DsAccessRights], eax
mov ax, fs
call CpustateGetDescriptorRightsFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.FsAccessRights], eax
mov ax, gs
call CpustateGetDescriptorRightsFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.GsAccessRights], eax
sldt ax
call CpustateGetDescriptorRightsFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.LdtrAccessRights], eax
cmp byte [rdi + CPUSTATE_GUEST_STATE_INFO.UsingFakedTr], 1
je skip_tr3
str ax
call CpustateGetDescriptorRightsFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.TrAccessRights], eax
skip_tr3:
xor eax, eax ; TODO: make sure it's ok to set interruptibility 0 (no 'blocking' state)
mov [rdi + CPUSTATE_GUEST_STATE_INFO.InterruptibilityState], eax
xor eax, eax ; prevent effects from code changes to the above block
mov [rdi + CPUSTATE_GUEST_STATE_INFO.ActivityState], eax ; 0 means 'active'
mov [rdi + CPUSTATE_GUEST_STATE_INFO.SmBase], DWORD 0xA0000
sub rsp, 8 ; 64-bit buffer
SMSR64 rsp, 0x174
pop rax ; and the 64 bits from the stack are gone now
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Ia32SysenterCs], eax
xor eax, eax
not eax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.VmxPreemptionTimerValue], eax ; 0xFFFFFFFF timer value
mov rax, cr0
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Cr0], rax
mov rax, cr2
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Cr2], rax
mov rax, cr3
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Cr3], rax
mov rax, cr4
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Cr4], rax
mov rax, cr8
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Cr8], rax
mov ax, es
call CpustateGetDescriptorBaseFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.EsBase], rax
mov ax, cs
call CpustateGetDescriptorBaseFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.CsBase], rax
mov ax, ss
call CpustateGetDescriptorBaseFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.SsBase], rax
mov ax, ds
call CpustateGetDescriptorBaseFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.DsBase], rax
; set FsBase and GsBase to the corresponding MSR values
SMSR64 rdi + CPUSTATE_GUEST_STATE_INFO.FsBase, IA32_FS_BASE_MSR
SMSR64 rdi + CPUSTATE_GUEST_STATE_INFO.GsBase, IA32_GS_BASE_MSR
sldt ax
call CpustateGetDescriptorBaseFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.LdtrBase], rax
cmp byte [rdi + CPUSTATE_GUEST_STATE_INFO.UsingFakedTr], 1
je skip_tr4
str ax
call CpustateGetDescriptorBaseFromAx
mov [rdi + CPUSTATE_GUEST_STATE_INFO.TrBase], rax
skip_tr4:
sub rsp, 10
sgdt [rsp]
mov rax, [rsp + 2]
mov [rdi + CPUSTATE_GUEST_STATE_INFO.GdtrBase], rax
sidt [rsp]
mov rax, [rsp + 2]
mov [rdi + CPUSTATE_GUEST_STATE_INFO.IdtrBase], rax
add rsp, 10
mov rax, dr7
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Dr7], rax
lea rax, [rsp + (4*8 + 8)] ; 4 * 8 (regs backup) + 8 (retaddr)
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Rsp], rax ; rsp at function call
mov rax, [rsp + 24]
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Rip], rax ; rip set to the return address
pushf
pop rax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.Rflags], rax
xor rax, rax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.PendingDebugExceptions], rax
SMSR64 rdi + CPUSTATE_GUEST_STATE_INFO.Ia32SysenterEsp, 0x175
SMSR64 rdi + CPUSTATE_GUEST_STATE_INFO.Ia32SysenterEip, 0x176
SMSR64 rdi + CPUSTATE_GUEST_STATE_INFO.Ia32KernelGsBase, MSR_KERNELGSbase
SMSR64 rdi + CPUSTATE_GUEST_STATE_INFO.Star, 0xC0000081
SMSR64 rdi + CPUSTATE_GUEST_STATE_INFO.LStar, 0xC0000082
SMSR64 rdi + CPUSTATE_GUEST_STATE_INFO.CStar, 0xC0000083
; FPU + OTHER EXTENSIONS (align the address to 16)
mov rcx, rdi
add rcx, CPUSTATE_GUEST_STATE_INFO.Extensions
push rax
push rbx
push rcx
push rdx
mov rax, 0x01
cpuid
bt ecx, 26 ;; bit 26
pop rdx
pop rcx
pop rbx
pop rax
jnc xsave_not_supported
call CpustateCaptureGuestXState
jmp extended_context_saved
xsave_not_supported:
call CpustateCaptureGuestFxState
extended_context_saved:
pop rcx
pop rdi
pop rdx
pop rax
ret
CpustateRestoreGuestState:
mov rdi, rcx
sub rsp, 12 ; 10 + 2 for 'odd alignment'
mov ax, [rdi + CPUSTATE_GUEST_STATE_INFO.GdtrLimit]
mov [rsp], ax
mov rax, [rdi + CPUSTATE_GUEST_STATE_INFO.GdtrBase]
mov [rsp+2], rax
lgdt [rsp]
mov ax, [rdi + CPUSTATE_GUEST_STATE_INFO.IdtrLimit]
mov [rsp], ax
mov rax, [rdi + CPUSTATE_GUEST_STATE_INFO.IdtrBase]
mov [rsp+2], rax
lidt [rsp]
add rsp, 12
mov ax, [rdi + CPUSTATE_GUEST_STATE_INFO.Es]
mov es, ax
xor rax, rax
mov ax, [rdi + CPUSTATE_GUEST_STATE_INFO.Cs]
push rax
call .next
.next:
add qword [rsp], 7
o64 retf
mov ax, [rdi + CPUSTATE_GUEST_STATE_INFO.Ss]
mov ss, ax
mov ax, [rdi + CPUSTATE_GUEST_STATE_INFO.Ds]
mov ds, ax
mov ax, [rdi + CPUSTATE_GUEST_STATE_INFO.Fs]
mov fs, ax
mov ax, [rdi + CPUSTATE_GUEST_STATE_INFO.Gs]
mov gs, ax
; restore tr if it ain't a fake one (or zero..)
test [rdi + CPUSTATE_GUEST_STATE_INFO.UsingFakedTr], BYTE 0xFF
jnz .don_t_restore
mov ax, [rdi + CPUSTATE_GUEST_STATE_INFO.Tr]
test ax, ax
jz .don_t_restore
ltr ax
.don_t_restore:
LMSR64 0x1d9, rdi + CPUSTATE_GUEST_STATE_INFO.Ia32Debugctl
LMSR64 0x277, rdi + CPUSTATE_GUEST_STATE_INFO.Ia32Pat
LMSR64 0xC0000080, rdi + CPUSTATE_GUEST_STATE_INFO.Ia32Efer
LMSR64 0x38F, rdi + CPUSTATE_GUEST_STATE_INFO.Ia32PerfGlobalCtrl
LMSR64 0x174, rdi + CPUSTATE_GUEST_STATE_INFO.Ia32SysenterCs
LMSR64 IA32_FS_BASE_MSR, rdi + CPUSTATE_GUEST_STATE_INFO.FsBase
LMSR64 IA32_GS_BASE_MSR, rdi + CPUSTATE_GUEST_STATE_INFO.GsBase
LMSR64 0x175, rdi + CPUSTATE_GUEST_STATE_INFO.Ia32SysenterEsp
LMSR64 0x176, rdi + CPUSTATE_GUEST_STATE_INFO.Ia32SysenterEip
LMSR64 MSR_KERNELGSbase, rdi + CPUSTATE_GUEST_STATE_INFO.Ia32KernelGsBase
LMSR64 0xC0000081, rdi + CPUSTATE_GUEST_STATE_INFO.Star
LMSR64 0xC0000082, rdi + CPUSTATE_GUEST_STATE_INFO.LStar
LMSR64 0xC0000083, rdi + CPUSTATE_GUEST_STATE_INFO.CStar
mov rax, [rdi + CPUSTATE_GUEST_STATE_INFO.Cr0]
mov cr0, rax
mov rax, [rdi + CPUSTATE_GUEST_STATE_INFO.Cr2]
mov cr2, rax
mov rax, [rdi + CPUSTATE_GUEST_STATE_INFO.Cr4]
mov cr4, rax
mov rax, [rdi + CPUSTATE_GUEST_STATE_INFO.Cr8]
mov cr8, rax
mov rax, [rdi + CPUSTATE_GUEST_STATE_INFO.Dr7]
mov dr7, rax
; FPU + OTHER EXTENSIONS
mov rcx, rdi
add rcx, CPUSTATE_GUEST_STATE_INFO.Extensions
push rax
push rbx
push rcx
push rdx
mov rax, 0x01
cpuid
bt ecx, 26 ;; bit 26
pop rdx
pop rcx
pop rbx
pop rax
jnc xrestore_not_supported
call CpustateRestoreGuestXState
jmp extended_context_restored
xrestore_not_supported:
call CpustateRestoreGuestFxState
extended_context_restored:
mov rax, [rdi + CPUSTATE_GUEST_STATE_INFO.Rax]
mov rbx, [rdi + CPUSTATE_GUEST_STATE_INFO.Rbx]
mov rcx, [rdi + CPUSTATE_GUEST_STATE_INFO.Rcx]
mov rdx, [rdi + CPUSTATE_GUEST_STATE_INFO.Rdx]
mov rbp, [rdi + CPUSTATE_GUEST_STATE_INFO.Rbp]
mov rsi, [rdi + CPUSTATE_GUEST_STATE_INFO.Rsi]
mov r8, [rdi + CPUSTATE_GUEST_STATE_INFO.R8 ]
mov r9, [rdi + CPUSTATE_GUEST_STATE_INFO.R9 ]
mov r10, [rdi + CPUSTATE_GUEST_STATE_INFO.R10]
mov r11, [rdi + CPUSTATE_GUEST_STATE_INFO.R11]
mov r12, [rdi + CPUSTATE_GUEST_STATE_INFO.R12]
mov r13, [rdi + CPUSTATE_GUEST_STATE_INFO.R13]
mov r14, [rdi + CPUSTATE_GUEST_STATE_INFO.R14]
mov r15, [rdi + CPUSTATE_GUEST_STATE_INFO.R15]
mov rdi, [rdi + CPUSTATE_GUEST_STATE_INFO.Rdi]
.end:
ret
; rcx will contain a pointer to a linear memory area, 16-bytes aligned, of 512 bytes where
; the FX state (FPU/MMX & SSE) will be saved
;;;todo: !!! CHECK CPUID.(EAX=0D, ECX=0):EBX to find out HOW much memory the save operation uses !!!
CpustateCaptureGuestXState:
ENTER_STACK_ENABLE_FPU
; set to 0xFFF... both rax and rdx (capture ALL features)
push rax
push rdx
; align to 64 for xsave
add rcx, 63
mov rax, (0xFFFFFFFFFFFFFFFF - 63)
and rcx, rax
mov rax, cr0
push rax ; push CR0
and al, ~(1<<3) ; #NM If CR0.TS[bit 3] = 1.
mov cr0, rax
mov rax, cr4
push rax ; push CR4
or rax, 1<<18 ; #UD If CR4.OSXSAVE[bit 18] = 0.
mov cr4, rax
xor rax, rax
dec rax
mov rdx, rax
xsave [rcx]
skip:
pop rax
mov cr4, rax
pop rax
mov cr0, rax
pop rdx
pop rax
EXIT_STACK_ENABLE_FPU
ret
; rcx contains a pointer to a 512 bytes buffer containing the FX state
CpustateRestoreGuestXState:
CpustateRestoreCompleteGuestFxState:
ENTER_STACK_ENABLE_FPU
; set to 0xFFF... both rax and rdx (restore ALL features)
push rax
push rdx
; align to 64 for xrstor
add rcx, 63
mov rax, (0xFFFFFFFFFFFFFFFF - 63)
and rcx, rax
mov rax, cr0
push rax ; push CR0
and al, ~(1<<3) ; #NM If CR0.TS[bit 3] = 1.
mov cr0, rax
mov rax, cr4
push rax ; push CR4
or rax, 1<<18 ; #UD If CR4.OSXSAVE[bit 18] = 0.
mov cr4, rax
xor rax, rax
dec rax
mov rdx, rax
clts
xrstor [rcx]
pop rax
mov cr4, rax
pop rax
mov cr0, rax
pop rdx
pop rax
EXIT_STACK_ENABLE_FPU
ret
;;%if 0 ; DISABLED CODE...
; rcx will contain a pointer to a linear memory area, 16-bytes aligned, of 512 bytes where
; the FX state (FPU/MMX & SSE) will be saved
CpustateCaptureGuestFxState:
ENTER_STACK_ENABLE_FPU
; round-up rcx to align to 16
add rcx, 0xF
and cl, 0xF0
clts
fxsave [rcx]
EXIT_STACK_ENABLE_FPU
ret
; rcx contains a pointer to a 512 bytes buffer containing the FX state
CpustateRestoreGuestFxState:
ENTER_STACK_ENABLE_FPU
; round-up rcx to align to 16
add rcx, 0xF
and cl, 0xF0
clts
fxrstor [rcx]
EXIT_STACK_ENABLE_FPU
ret
;;%endif
; rcx - ptr to CPUSTATE_GUEST_STATE_INFO
; rdx - new value for RIP
CpustateSetRIP:
mov [rcx + CPUSTATE_GUEST_STATE_INFO.Rip], rdx
ret
; rcx - ptr to CPUSTATE_GUEST_STATE_INFO
; rdx - new value for RSP
CpustateSetRSP:
mov [rcx + CPUSTATE_GUEST_STATE_INFO.Rsp], rdx
ret
CpustateGetTrFromSecondaryGdt:
; rcx = guest state info ptr
; rdx = gdt descriptors address
push rcx
push rdx
push rdi
mov rdi, rcx
sub rsp, 10
mov [rsp], WORD 8*3 -1
mov [rsp+2], rdx
mov rcx, rsp
mov rdx, 8
SAFE_CALL_C CpustateGetDescriptorBaseAddress
mov [rdi + CPUSTATE_GUEST_STATE_INFO.TrBase], rax
SAFE_CALL_C CpustateGetDescriptorLimit
mov [rdi + CPUSTATE_GUEST_STATE_INFO.TrLimit], eax
;SAFE_CALL_C CpustateGetDescriptorRights
mov eax, 0x8b
mov [rdi + CPUSTATE_GUEST_STATE_INFO.TrAccessRights], eax
mov [rdi + CPUSTATE_GUEST_STATE_INFO.UsingFakedTr], BYTE 1
add rsp, 10
pop rdi
pop rdx
pop rcx
ret
CpuStateLock:
push r8
push rdx
push rax
xor edx, edx
inc edx
.spin:
nop
call .get
.lock:
dd 0
.get:
pop r8 ; r8 = lock variable
test rcx, rcx
jz .clear
xor eax, eax
lock cmpxchg [r8], edx ; if [rcx]==0 set to 1, eax = [rcx] when we get the lock
test eax, eax
jnz .spin
jmp .done
.clear:
mov DWORD[r8], 0
.done:
pop rax
pop rdx
pop r8
ret
global PortDelayMicroseconds
PortDelayMicroseconds: ; param = number of microseconds
push rax
push rcx
.here:
in al, 0x80
loop .here
pop rcx
pop rax
ret
CpustateGetDescriptorBaseAddress:
; rcx = __in CPUSTATE_FULL_SELECTOR_DATA *SelectorRegisterData
; rdx = __in WORD Selector
; returns QWORD
push rbx
test dx, (0xFFFF - 7)
jnz .isUsed
; this descriptor is not used
xor rax, rax
jmp .cleanup
.isUsed:
; make sure Selector doesn't overflow the corresponding table
; prepare (SelectorRegisterData->Length+1) into ax
mov ax, [rcx + CPUSTATE_FULL_SELECTOR_DATA.Length]
inc ax
; prepare ((Selector & (0xFFFF - 7)) + 8) into bx
xor rbx, rbx
mov bx, dx
and bx, (0xFFFF - 7)
add rbx, 8
; if (((Selector & (0xFFFF - 7)) + 8) > (SelectorRegisterData->Length+1)) return -1
cmp bx, ax
jna .enough8
xor rax, rax
dec rax
jmp .cleanup
.enough8:
sub rbx, 8 ; bx is now (Selector & (0xFFFF - 7))
mov rax, [rcx + CPUSTATE_FULL_SELECTOR_DATA.Base] ; rax is the table base
add rax, rbx ; rax now points to the 64 bits descriptor
push rax
; take the bits
push rdx ; temp usage for rdx
xor rbx, rbx ; rbx will cumulate the result
mov rdx, [rax] ; *Descriptor, make rdx = ((*Descriptor) >> 16) & 0xFFFFFF...
shr rdx, 16
and rdx, 0xFFFFFF
or rbx, rdx ; commit these bits (Base[23:0])
mov rdx, [rax] ; *Descriptor, make rdx = ((((*Descriptor) >> (QWORD) 56)) << (QWORD)24)
shr rdx, 56
shl rdx, 24
or rbx, rdx ; commit (Base[31:24])
; check the 'system' bit
mov rdx, [rax]
shr rdx, 32+8+4
test rdx, 1
pop rdx ; end temp usage for rdx
pop rax
jnz .notSystem
; system descriptor, validate if enough memory is reserved for its entry
; prepare (SelectorRegisterData->Length+1) into ax
push rax
xor ax, ax
mov ax, [rcx + CPUSTATE_FULL_SELECTOR_DATA.Length]
inc ax
; prepare ((Selector & (0xFFFF - 7)) + 16) into bx
push rbx
mov bx, dx
and bx, (0xFFFF - 7)
add bx, 16
; if (((Selector & (0xFFFF - 7)) + 16) > (SelectorRegisterData->Length+1)) return -1
cmp bx, ax
pop rbx
pop rax
jna .enough16
xor rax, rax
dec rax
jmp .cleanup
.enough16:
; result |= (Descriptor[1] << (QWORD)32);
mov rax, [rax + 8] ; take the second qword from descriptor
shl rax, 32
or rbx, rax
.notSystem: ; done, our result is ready (rbx)
mov rax, rbx
.cleanup:
pop rbx
ret
CpustateGetDescriptorLimit:
; rcx = __in CPUSTATE_FULL_SELECTOR_DATA *SelectorRegisterData
; rdx = __in WORD Selector
; returns QWORD
push rbx
test dx, (0xFFFF - 7)
jnz .isUsed
; this descriptor is not used
xor rax, rax
dec rax
jmp .cleanup
.isUsed:
; make sure Selector doesn't overflow the corresponding table
; prepare (SelectorRegisterData->Length+1) into ax
mov ax, [rcx + CPUSTATE_FULL_SELECTOR_DATA.Length]
inc ax
; prepare ((Selector & (0xFFFF - 7)) + 8) into bx
xor rbx, rbx
mov bx, dx
and bx, (0xFFFF - 7)
add rbx, 8
; if (((Selector & (0xFFFF - 7)) + 8) > (SelectorRegisterData->Length+1)) return -1
cmp bx, ax
jna .enough8
xor rax, rax
dec rax
jmp .cleanup
.enough8:
sub rbx, 8 ; bx is now (Selector & (0xFFFF - 7))
mov rax, [rcx + CPUSTATE_FULL_SELECTOR_DATA.Base] ; rax is the table base
add rax, rbx ; rax now points to the 64 bits descriptor
; take the bits
;(((*Descriptor)>>(QWORD)(3*16) & 0xF) << (QWORD)16); // higher 4 bits from Descriptor.high[19:16]
push rdx ; temp usage for rdx
xor rbx, rbx ; rbx will cumulate the result
mov rdx, [rax] ; *Descriptor, make rdx = ((*Descriptor) >> 16) & 0xFFFFFF...
shr rdx, 3*16
and rdx, 0xF
shl rdx, 16
or rbx, rdx ; commit the higher 4 bits from Descriptor.high[19:16]
mov rdx, [rax] ; *Descriptor, make rdx = ((((*Descriptor) >> (QWORD) 56)) << (QWORD)24)
and rdx, 0xFFFF
or rbx, rdx ; commit the lower 16 bits
pop rdx
; take the result
mov rax, rbx
.cleanup:
pop rbx
ret
CpustateDecodeDescriptor:
push rbx
; some validations
test rcx, rcx
jnz .rcx_ok
xor rax, rax
jmp .cleanup
.rcx_ok:
test r8, r8
jnz .r8_ok
xor rax, rax
jmp .cleanup
.r8_ok:
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.AccessAndFlags], DWORD CPUSTATE_BAD_SELECTOR_ACCESS_RIGHTS
test dx, (0xFFFF - 7)
jnz .isUsed
; not used, setup some default values
xor rax, rax
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.AccessAndFlags], DWORD CPUSTATE_BAD_SELECTOR_ACCESS_RIGHTS
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Available], BYTE 0
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Base], rax
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.BigOperands], BYTE 1
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Code64], BYTE 0
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Granularity], BYTE 1
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Limit], DWORD 0xFFFFF
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Present], BYTE 0
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.PrivilegeLevel], BYTE 0
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.System], BYTE 1
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Type], BYTE 3
jmp .cleanup
.isUsed:
; make sure Selector doesn't overflow the corresponding table
; prepare (SelectorRegisterData->Length+1) into ax
mov ax, [rcx + CPUSTATE_FULL_SELECTOR_DATA.Length]
inc ax
; prepare ((Selector & (0xFFFF - 7)) + 8) into bx
xor rbx, rbx
mov bx, dx
and bx, (0xFFFF - 7)
add rbx, 8
; if (((Selector & (0xFFFF - 7)) + 8) > (SelectorRegisterData->Length+1)) return -1
cmp bx, ax
jna .enough8
xor rax, rax
dec rax
jmp .cleanup
.enough8:
sub rbx, 8 ; bx is now (Selector & (0xFFFF - 7))
mov rax, [rcx + CPUSTATE_FULL_SELECTOR_DATA.Base] ; rax is the table base
add rax, rbx ; rax now points to the 64 bits descriptor
push rax
;
; Base address
;
push rdx ; temp usage for rdx
xor rbx, rbx ; rbx will cumulate the result
mov rdx, [rax] ; *Descriptor, make rdx = ((*Descriptor) >> 16) & 0xFFFFFF...
shr rdx, 16
and rdx, 0xFFFFFF
or rbx, rdx ; commit these bits (Base[23:0])
mov rdx, [rax] ; *Descriptor, make rdx = ((((*Descriptor) >> (QWORD) 56)) << (QWORD)24)
shr rdx, 56
shl rdx, 24
or rbx, rdx ; commit (Base[31:24])
; check the 'system' bit
mov rdx, [rax]
shr rdx, 32+8+4
test rdx, 1
pop rdx ; end temp usage for rdx
pop rax
jnz .notSystem
; system descriptor, validate if enough memory is reserved for its entry
; prepare (SelectorRegisterData->Length+1) into ax
push rax
xor ax, ax
mov ax, [rcx + CPUSTATE_FULL_SELECTOR_DATA.Length]
inc ax
; prepare ((Selector & (0xFFFF - 7)) + 16) into bx
push rbx
mov bx, dx
and bx, (0xFFFF - 7)
add bx, 16
; if (((Selector & (0xFFFF - 7)) + 16) > (SelectorRegisterData->Length+1)) return -1
cmp bx, ax
pop rbx
pop rax
jna .enough16
xor rax, rax
dec rax
jmp .cleanup
.enough16: ; validation succeeded
; result |= (Descriptor[1] << (QWORD)32);
push rax
mov rax, [rax + 8] ; take the second qword from descriptor
shl rax, 32
or rbx, rax
pop rax
.notSystem:
; save the base value
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Base], rbx
;
; Access and flags
;
mov rbx, [rax]
shr rbx, 40
and rbx, 0xF0FF ; clear the segment limit remains
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.AccessAndFlags], ebx
;
; Limit
;
mov rbx, [rax]
shr rbx, 3*16
and rbx, 0xF
shl rbx, 16 ; higher 4 bits from Descriptor.high[19:16]
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Limit], ebx ; (((*Descriptor)>>(QWORD)(3*16) & 0xF) << (QWORD)16)
mov ebx, [rax]
and ebx, 0xFFFF
or [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Limit], ebx ; result |= (*Descriptor & 0xFFFF);
; Type
mov rbx, [rax]
shr rbx, 32+8
and bl, 0xF
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Type], bl ; ((*Descriptor) >> (QWORD)(32 + 8)) & 0xF
; PrivilegeLevel
mov rbx, [rax]
shr rbx, 32+8+5
and bl, 0x3
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.PrivilegeLevel], bl ; ((*Descriptor) >> (QWORD)(32 + 8 + 5)) & 0x3
;
; Boolean flags (code is expanded to be more readable)
;
mov rbx, [rax]
shr rbx, 32 + 8 + 4
and bl, 1
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.System], bl ; 0 != (((*Descriptor) >> (QWORD)(32 + 8 + 4)) & 1)
mov rbx, [rax]
shr rbx, 32 + 8 + 7
and bl, 1
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Present], bl ; 0 != (((*Descriptor) >> (QWORD)(32 + 8 + 7)) & 1)
mov rbx, [rax]
shr rbx, 16*3 + 4
and bl, 1
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Available], bl ; 0 != (((*Descriptor) >> (QWORD)(16*3 + 4)) & 1);
mov rbx, [rax]
shr rbx, 16*3 + 5
and bl, 1
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Code64], bl ; 0 != (((*Descriptor) >> (QWORD)(16*3 + 5)) & 1);
mov rbx, [rax]
shr rbx, 16*3 + 6
and bl, 1
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.BigOperands], bl ; 0 != (((*Descriptor) >> (QWORD)(16*3 + 6)) & 1)
mov rbx, [rax]
shr rbx, 16*3 + 7
and bl, 1
mov [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.Granularity], bl ; 0 != (((*Descriptor) >> (QWORD)(16*3 + 7)) & 1)
xor rax, rax
inc rax
.cleanup:
pop rbx
ret
CpustateGetDescriptorRights:
push rbp
mov rbp, rsp
; reserve a buffer for a local CPUSTATE_UNPACKED_DESCRIPTOR_DATA structure
push r8
sub rsp, CPUSTATE_UNPACKED_DESCRIPTOR_DATA_size
mov r8, rsp ; address of local buffer
; preserve r8 for after-call
push r8
sub rsp, 0x20
call CpustateDecodeDescriptor
add rsp, 0x20
pop r8
; check results
test rax, rax
jz .failed
; just return the returned value
mov rax, [r8 + CPUSTATE_UNPACKED_DESCRIPTOR_DATA.AccessAndFlags]
jmp .cleanup
.failed:
mov rax, CPUSTATE_BAD_SELECTOR_ACCESS_RIGHTS
.cleanup:
add rsp, CPUSTATE_UNPACKED_DESCRIPTOR_DATA_size
pop r8
pop rbp
ret
|
// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually
#pragma once
#include <common/common.h>
#include <_RTL_CRITICAL_SECTION.hpp>
START_ATF_NAMESPACE
typedef _RTL_CRITICAL_SECTION *PCRITICAL_SECTION;
END_ATF_NAMESPACE
|
;------------------------------------------------------------------------------
;
; Copyright (c) 2006, 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:
;
; ReadDr2.Asm
;
; Abstract:
;
; AsmReadDr2 function
;
; Notes:
;
;------------------------------------------------------------------------------
SECTION .text
;------------------------------------------------------------------------------
; UINTN
; EFIAPI
; AsmReadDr2 (
; VOID
; );
;------------------------------------------------------------------------------
global ASM_PFX(AsmReadDr2)
ASM_PFX(AsmReadDr2):
mov eax, dr2
ret
|
inventory_check:
andi a0, a0, 0xFF
li t0, SAVE_CONTEXT
beq a0, 0x8C, @@return ; Deku Nuts (5)
lbu v0, 0x75 (t0)
beq a0, 0x8D, @@return ; Deku Nuts (10)
lbu v0, 0x75 (t0)
beq a0, 0x00, @@return ; Deku Stick
lbu v0, 0x74 (t0)
beq a0, 0x8A, @@return ; Deku Sticks (5)
lbu v0, 0x74 (t0)
beq a0, 0x8B, @@return ; Deku Sticks (10)
lbu v0, 0x74 (t0)
beq a0, 0x58, @@return ; Deku Seeds (5)
li v0, 0x00
beq a0, 0x78, @@return ; Small Magic Jar
li v0, 0x00
beq a0, 0x79, @@return ; Large Magic Jar
li v0, 0x00
li v0, 0xFF
@@return:
jr ra
nop
;==================================================================================================
; a1 = pointer to the skulltula token actor
override_skulltula_token:
addiu sp, sp, -0x20
sw ra, 0x10 (sp)
sw s0, 0x14 (sp)
jal lookup_override ; call lookup_override(_, actor)
; so that v0 = index of overwritten item
nop
bgez v0, @@in_table
nop
li v0, 0x5B ; default to giving a token
@@in_table:
; resolve the item if it is extended
move a0, v0
jal resolve_extended_item ; v0 = resolved item ID, v1 = ITEM_TABLE entry
nop
beqz v1, @@not_extended
sw v1, 0x1C (sp)
; check if item is for this player
li t0, PLAYER_OVERRIDE_DATA
lh t1, 0x02(t0)
beqz t1, @@extended_effect ; if item is pending player override
li t2, 0x01
b @@no_extended_effect
sh t2, 0x00(t0) ; set override collected flag
@@extended_effect:
; Run effect function
li a0, SAVE_CONTEXT
lbu a1, ITEM_ROW_EFFECT_ARG1 (v1)
lbu a2, ITEM_ROW_EFFECT_ARG2 (v1)
lw t1, ITEM_ROW_EFFECT_FN (v1)
jalr t1
nop
@@no_extended_effect:
; message id is in the extended item table
lw v1, 0x1C (sp)
lbu a1, ITEM_ROW_TEXT_ID (v1)
b @@display_message
@@not_extended:
; get the table entry in the get item table for this item
li t1, GET_ITEMTABLE ; t1 = base of get item table
li t2, 0x6 ; t2 = size of an element
mult v0, t2 ;
mflo t2 ; t2 = offset into get item table
addu s0, t1, t2 ; s0 = pointer to table entry
lb a1, 0x0 (s0) ; a1 = item id
; check if item is for this player
li t0, PLAYER_OVERRIDE_DATA
lh t1, 0x02(t0)
beqz t1, @@item_effect ; if item is pending player override
li t2, 0x01
sh t2, 0x00(t0) ; set override collected flag
li a1, 0x41 ; a1 = 0x41 (No item)
@@item_effect:
; give the item
jal 0x0006fdcc ; call ex_06fdcc(ctx, item); this gives link the item
move a0,s1 ; a0 = ctx
; message id is in the get item table
lbu a1, 0x3 (s0) ; a1 = text id
@@display_message:
move a0,s1
jal 0x000dce14 ; call ex_0dce14(ctx, text_id, 0)
move a2,zero
@@return:
lw ra, 0x10 (sp)
lw s0, 0x14 (sp)
addiu sp, sp, 0x20
jr ra
nop
;==================================================================================================
override_object_npc:
lw a2, 0x0030 (sp)
lh a1, 0x0004 (a2)
j override_object
nop
override_object_chest:
lw t9, 0x002C (sp)
lh a1, 0x0004 (t9)
j override_object
nop
override_object:
li t2, EXTENDED_ITEM_DATA
lw t3, ITEM_ROW_IS_EXTENDED (t2)
beqz t3, @@return
nop
; Override Object ID
lhu a1, ITEM_ROW_OBJECT_ID (t2)
@@return:
; Re-enable warping (disabled by pending item)
li t2, GLOBAL_CONTEXT + 0x104E4
sh r0, 0x00 (t2)
li t1, PENDING_SPECIAL_ITEM
lb t2, (PENDING_SPECIAL_ITEM_END - PENDING_SPECIAL_ITEM) (t1)
bltz t2, @@no_pending_clear
add t1, t1, t2
sb zero, 0x00 (t1)
@@no_pending_clear:
jr ra
nop
;==================================================================================================
override_graphic:
li t0, EXTENDED_ITEM_DATA
lw t1, ITEM_ROW_IS_EXTENDED (t0)
beqz t1, @@return
nop
; Override Graphic ID
lb v1, ITEM_ROW_GRAPHIC_ID (t0)
@@return:
; Displaced code
abs t0, v1
sb t0, 0x0852 (a0)
jr ra
nop
;==================================================================================================
override_text:
lbu a1, 0x03 (v0) ; Displaced code
li t0, EXTENDED_ITEM_DATA
lw t1, ITEM_ROW_IS_EXTENDED (t0)
beqz t1, @@return
nop
; Override Text ID
lbu a1, ITEM_ROW_TEXT_ID (t0)
@@return:
jr ra
nop
;==================================================================================================
override_action:
; Displaced code
lw v0, 0x24 (sp)
lbu a1, 0x0000 (v0)
li t0, PLAYER_OVERRIDE_DATA
lh t1, 0x02(t0)
beqz t1, @@no_player_override ; if item is pending player override
li t2, 0x01
sh t2, 0x00(t0) ; set override collected flag
b @@return
li a1, 0x41 ; set action to no action
@@no_player_override:
li t0, EXTENDED_ITEM_DATA
lw t1, ITEM_ROW_IS_EXTENDED (t0)
beqz t1, @@return
nop
; Override Action ID
lbu a1, ITEM_ROW_ACTION_ID (t0)
sw a0, 0x00 (sp)
sw a1, 0x04 (sp)
sw a2, 0x08 (sp)
addiu sp, sp, -0x18
sw ra, 0x10 (sp)
; Run effect function
li a0, SAVE_CONTEXT
lbu a1, ITEM_ROW_EFFECT_ARG1 (t0)
lbu a2, ITEM_ROW_EFFECT_ARG2 (t0)
lw t1, ITEM_ROW_EFFECT_FN (t0)
jalr t1
nop
lw ra, 0x10 (sp)
addiu sp, sp, 0x18
lw a0, 0x00 (sp)
lw a1, 0x04 (sp)
lw a2, 0x08 (sp)
@@return:
jr ra
nop
;==================================================================================================
store_item_data_hook:
sb a2, 0x0424 (a3) ; Displaced code
addiu sp, sp, -0x20
sw v0, 0x10 (sp)
sw v1, 0x14 (sp)
sw ra, 0x18 (sp)
jal store_item_data
nop
lw v0, 0x10 (sp)
lw v1, 0x14 (sp)
lw ra, 0x18 (sp)
addiu sp, sp, 0x20
jr ra
nop
;==================================================================================================
store_item_data:
addiu sp, sp, -0x18
sw ra, 0x10 (sp)
; Clear current item data
li t0, EXTENDED_ITEM_DATA
sw r0, 0x00 (t0)
sw r0, 0x04 (t0)
sw r0, 0x08 (t0)
sw r0, 0x0C (t0)
li t0, PLAYER_ACTOR
lb t1, 0x0424 (t0) ; t1 = item ID being received
beqz t1, @@return
nop
abs a0, t1
lw a1, 0x0428 (t0) ; a1 = actor giving the item
jal lookup_override ; v0 = new item ID from override
nop
bltz v0, @@return
nop
ori a0, v0, 0
jal resolve_extended_item ; v0 = resolved item ID, v1 = ITEM_TABLE entry
nop
beqz v1, @@update_base_game
nop
; Store extended item data
li t0, EXTENDED_ITEM_DATA
lw t1, 0x00 (v1)
sw t1, 0x00 (t0)
lw t1, 0x04 (v1)
sw t1, 0x04 (t0)
lw t1, 0x08 (v1)
sw t1, 0x08 (t0)
; Mark the extended item data as active
li t1, 1
sw t1, ITEM_ROW_IS_EXTENDED (t0)
; Load the base item to be stored back in the player actor / chest
lbu v0, ITEM_ROW_BASE_ITEM (v1)
@@update_base_game:
li t0, PLAYER_ACTOR
; If the giving actor is a chest, update it with new contents
lw t1, 0x0428 (t0)
lhu t2, 0x00 (t1)
bne t2, 0x000A, @@not_chest
nop
lhu t2, 0x1C (t1)
andi t2, t2, 0xF01F
sll t3, v0, 5
or t2, t2, t3
sh t2, 0x1C (t1)
@@not_chest:
; Update player actor
lb t1, 0x0424 (t0)
bgez t1, @@not_negative
nop
; The input was negative (item is in a nearby chest), so make the result negative
subu v0, r0, v0
@@not_negative:
sb v0, 0x0424 (t0)
@@return:
lw ra, 0x10 (sp)
addiu sp, sp, 0x18
jr ra
nop
;==================================================================================================
lookup_override:
; a0 = item ID being received
; a1 = actor giving the item
addiu sp, sp, -0x18
sw ra, 0x10 (sp)
jal get_override_search_key
nop
beq v0, -1, @@return
nop
ori a0, v0, 0
jal scan_override_table
nop
@@return:
lw ra, 0x10 (sp)
addiu sp, sp, 0x18
jr ra
nop
;==================================================================================================
get_override_search_key:
; a0 = item ID being received
; a1 = actor giving the item
; Load the current scene number
li v0, GLOBAL_CONTEXT
lhu v0, 0xA4 (v0) ; v0 = scene number
li t0, 0x00 ; t0 = override type
ori t1, a0, 0 ; t1 = override ID
lhu t2, 0x00 (a1) ; t2 = actor ID
bne t2, 0x019C, @@not_skulltula ; if not skulltula, try for other types
nop
li t0, 0x03 ; t0 = skulltula type
lhu t3, 0x1C (a1) ; t3 = skulltula token variable
andi t1, t3, 0x00FF ; t1 = skulltula flag (used for the lookup)
andi v0, t3, 0x1F00 ; v0 = skulltula scene (shifted)
srl v0, v0, 8 ; v0 = v0 >> 8 (skulltula scene)
b @@not_collectable ; create the id
nop
@@not_skulltula:
bne t2, 0x000A, @@not_chest
nop
lhu t3, 0x1C (a1)
bne v0, 0x10, @@valid_chest
nop
; Current scene is the treasure chest game.
; Don't apply the override if the chest contains 0x75 (Winner! purple rupee)
andi t4, t3, (0x7F << 5)
bne t4, (0x75 << 5), @@valid_chest
nop
li v0, -1
b @@return
nop
@@valid_chest:
li t0, 0x01
andi t1, t3, 0x1F ; t1 = chest flag
@@not_chest:
bne t2, 0x0015, @@not_collectable
nop
beq a0, 0x3E, @@valid_collectable
nop
beq a0, 0x42, @@valid_collectable
nop
li v0, -1
b @@return
nop
@@valid_collectable:
li t0, 0x02
lbu t1, 0x0141 (a1) ; t1 = collectable flag
@@not_collectable:
; Construct ID used to search the override table
; v0 = (scene << 16) | (override_type << 8) | override_id
sll v0, v0, 8
or v0, v0, t0
sll v0, v0, 8
or v0, v0, t1
@@return:
jr ra
nop
;==================================================================================================
scan_override_table:
; a0 = override search key
li v0, -1
; Look up override
li t0, (ITEM_OVERRIDES - 0x04)
@@lookup_loop:
addiu t0, t0, 0x04
lw t1, 0x00 (t0) ; t1 = override entry
beqz t1, @@return ; Reached end of override table
nop
srl t2, t1, 8 ; t2 = override key
andi t3, t2, 0xF800
srl t3, t3, 11 ; t3 = player id
lui t4, 0xFFFF
ori t4, t4, 0x03FF ;t4 = 0xFFFF07FF masks out the player id
and t2, t2, t4
bne t2, a0, @@lookup_loop
nop
andi v0, t1, 0xFF ; v0 = found item ID
li t0, SAVE_CONTEXT
sb t3, 0x1407(t0) ; set the point value to the player number
li t1, PLAYER_OVERRIDE_DATA
li t4, PLAYER_ID
lb t4, 0x00(t4)
beq t3, t4, @@return ; correct player for the item
sh zero, 0x02(t1) ; store no player override
sb t3, 0x02(t1) ; store player override id
sb v0, 0x03(t1) ; store item id
@@return:
jr ra
nop
;==================================================================================================
resolve_extended_item:
; a0 = input item ID
addiu sp, sp, -0x20
sw s0, 0x10 (sp)
sw s1, 0x14 (sp)
sw ra, 0x18 (sp)
ori v0, a0, 0 ; Return resolved item ID in v0
@@loop:
ori s0, v0, 0
addiu t0, s0, -0x80 ; t0 = index into extended ITEM_TABLE
bltz t0, @@not_extended ; Item IDs in range 0x00 - 0x7F are not extended
nop
; Load table entry
li s1, ITEM_TABLE
li t1, ITEM_TABLE_ROW_SIZE
mult t0, t1
mflo t0
addu s1, s1, t0 ; s1 = pointer to table entry
; Check whether this item will upgrade into another item
; Conventions for upgrade functions:
; - They receive a pointer to the save context in a0
; - They receive their item ID in a1
; - They store their result in v0
li a0, SAVE_CONTEXT
ori a1, s0, 0
lw t0, ITEM_ROW_UPGRADE_FN (s1)
jalr t0 ; v0 = upgraded item ID
nop
; If the upgrade function returned a new item ID, start resolution over again
bne v0, s0, @@loop
nop
ori v1, s1, 0 ; Return pointer to ITEM_TABLE entry in v1
b @@return
nop
@@not_extended:
li v1, 0
@@return:
lw s0, 0x10 (sp)
lw s1, 0x14 (sp)
lw ra, 0x18 (sp)
addiu sp, sp, 0x20
jr ra
nop
|
%ifdef CONFIG
{
"RegData": {
"MM0": ["0x0", "0x0"],
"MM1": ["0x0", "0x0"],
"MM2": ["0x1010101010101010", "0x0"]
},
"MemoryRegions": {
"0x100000000": "4096"
}
}
%endif
mov rdx, 0xe0000000
mov rax, 0xFFFFFFFFFFFFFFFF
mov [rdx + 8 * 0], rax
mov rax, 0x0
mov [rdx + 8 * 1], rax
mov rax, 0x1010101010101010
mov [rdx + 8 * 2], rax
mov rax, 0xFFFFFFFFFFFFFFFF
mov [rdx + 8 * 3], rax
movq mm0, [rdx]
pandn mm0, [rdx + 8 * 2]
movq mm1, [rdx]
movq mm2, [rdx + 8 * 2]
pandn mm1, mm2
hlt
|
; A178349: Partial sums of sum_{n=0...infinity} 1010^n.
; 1,1011,1021111,1031322111,1041635332111,1052051685432111,1062572202286432111,1073197924309296432111,1083929903552389396432111,1094769202587913290396432111,1105716894613792423300396432111,1116774063559930347533400396432111,1127941804195529651008734400396432111,1139221222237484947518821744400396432111,1150613434459859796994009961844400396432111,1162119568804458394963950061462844400396432111,1173740764492502978913589562077472844400396432111,1185478172137428008702725457698247572844400396432111
mov $2,1010
pow $2,$0
mov $0,$2
div $0,1009
mul $0,1010
add $0,1
|
;------------------------------------------------------------------------------
;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
; SPDX-License-Identifier: BSD-2-Clause-Patent
;
; Module Name:
;
; WriteMm1.Asm
;
; Abstract:
;
; AsmWriteMm1 function
;
; Notes:
;
;------------------------------------------------------------------------------
SECTION .text
;------------------------------------------------------------------------------
; VOID
; EFIAPI
; AsmWriteMm1 (
; IN UINT64 Value
; );
;------------------------------------------------------------------------------
global ASM_PFX(AsmWriteMm1)
ASM_PFX(AsmWriteMm1):
movq mm1, [esp + 4]
ret
|
#ifndef MAT_H
#define MAT_H
#include <iostream>
namespace ariel
{
std::string mat(int col, int row, char c1, char c2);
}
#endif |
; -----------------------------------------------------------------------------
; Call printf with seven parameters
; 4x of them are assigned to registers.
; 3x of them are assigned to stack spaces.
; -----------------------------------------------------------------------------
; Call printf with seven parameters
; -----------------------------------------------------------------------------
Invoke printf,$printString
|
object_const_def ; object_event constants
const TINTOWER8F_POKE_BALL1
const TINTOWER8F_POKE_BALL2
const TINTOWER8F_POKE_BALL3
TinTower8F_MapScripts:
db 0 ; scene scripts
db 0 ; callbacks
TinTower8FNugget:
itemball NUGGET
TinTower8FMaxElixer:
itemball MAX_ELIXER
TinTower8FFullRestore:
itemball FULL_RESTORE
TinTower8F_MapEvents:
db 0, 0 ; filler
db 6 ; warp events
warp_event 2, 5, TIN_TOWER_7F, 2
warp_event 2, 11, TIN_TOWER_9F, 1
warp_event 16, 7, TIN_TOWER_9F, 2
warp_event 10, 3, TIN_TOWER_9F, 3
warp_event 14, 15, TIN_TOWER_9F, 6
warp_event 6, 9, TIN_TOWER_9F, 7
db 0 ; coord events
db 0 ; bg events
db 3 ; object events
object_event 7, 13, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, TinTower8FNugget, EVENT_TIN_TOWER_8F_NUGGET
object_event 11, 6, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, TinTower8FMaxElixer, EVENT_TIN_TOWER_8F_MAX_ELIXER
object_event 3, 1, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, TinTower8FFullRestore, EVENT_TIN_TOWER_8F_FULL_RESTORE
|
.386p
;comment @
;include mymacro.asm
;comment
Kernel Segment public para use32
assume cs:Kernel
;param:string
__hexstr2int proc
push ebp
mov ebp,esp
push edx
push esi
sub esp,40h
push ss:[ebp + 8]
call __strlen
add esp,4
mov edx,0
cmp eax,8
ja _hexstr2intover
cmp eax,0
jbe _hexstr2intover
mov esi,ss:[ebp + 8]
cld
_hexstr2inextc:
lodsb
cmp al,0
jz _hexstr2intover
cmp al,'a'
jb _checkupper
cmp al ,'f'
ja _hexstr2intover
sub al,87
jmp _h2iKeepResult
_checkupper:
cmp al,'A'
jb _checknumber
cmp al,'F'
ja _hexstr2intover
sub al,55
jmp _h2iKeepResult
_checknumber:
cmp al , '0'
jb _hexstr2intover
cmp al , '9'
ja _hexstr2intover
sub al,30h
jmp _h2iKeepResult
_h2iKeepResult:
shl edx,4
or dl,al
jmp _hexstr2inextc
_hexstr2intover:
mov eax,edx
add esp,40h
pop esi
pop edx
mov esp,ebp
pop ebp
ret
__hexstr2int endp
;param:intvalue,uppercase,dstbuf
__int2hexstr proc
push ebp
mov ebp,esp
push ecx
push edx
push ebx
push edi
sub esp,40h
mov eax,ss:[ebp + 12]
cmp eax,0
jnz _uppercase
mov ebx,87
jmp _i2hStartMain
_uppercase:
mov ebx,55
_i2hStartMain:
mov edi,ss:[ebp + 16]
cld
mov eax,ss:[ebp + 8]
mov edx,eax
mov ecx,28
_i2hHex16:
shr eax,cl
and al,0fh
cmp al,9
jbe _i2hNumber
add al,bl
jmp _i2hKeepResult
_i2hNumber:
add al,30h
_i2hKeepResult:
stosb
mov eax,edx
sub ecx,4
;JNC也可以看成是加法没有进位,减法没有借位的时候转移
jnc _i2hHex16
add esp,40h
pop edi
pop ebx
pop edx
pop ecx
mov esp,ebp
pop ebp
ret
__int2hexstr endp
;param string
__strlen proc
push ebp
mov ebp,esp
push esi
sub esp,40h
mov esi,ss:[ebp + 8]
cld
_strlenNextByte:
lodsb
cmp al,0
jnz _strlenNextByte
mov eax,esi
dec eax
sub eax,dword ptr ss:[ebp + 8]
add esp,40h
pop esi
mov esp,ebp
pop ebp
ret
__strlen endp
;param:dst,src
__strcpy proc
push ebp
mov ebp,esp
push esi
push edi
sub esp,40h
mov esi,ss:[ebp + 12]
mov edi,ss:[ebp +8]
cld
_strcopybytes:
;movsb 不改变al的值
lodsb
stosb
cmp al,0
jnz _strcopybytes
mov eax,esi
dec eax
sub eax,dword ptr ss:[ebp +12]
add esp,40h
pop edi
pop esi
mov esp,ebp
pop ebp
ret
__strcpy endp
;param:dststr,srcstr
__strstr proc
push ebp
mov ebp,esp
push ecx
push edx
push ebx
push esi
push edi
sub esp,40h
push dword ptr ss:[ebp + 8]
call __strlen
add esp,4
mov ss:[ebp - 24],eax
push dword ptr ss:[ebp + 12]
call __strlen
add esp,4
mov ss:[ebp - 28],eax
cmp eax,ss:[ebp - 24]
ja _strstrFound
mov esi,ss:[ebp + 8]
mov edi,ss:[ebp + 12]
mov ecx,ss:[ebp - 24]
sub ecx,ss:[ebp - 28]
inc ecx
_getsubstr:
push esi
mov edx,ecx
mov ecx,ss:[ebp - 28]
mov edi,ss:[ebp + 12]
repe cmpsb
pop esi
jz _strstrFound
inc esi
mov ecx,edx
loop _getsubstr
mov eax,0
jmp _strstrOver
_strstrFound:
mov eax,esi
_strstrOver:
add esp,40h
pop edi
pop esi
pop ebx
pop edx
pop ecx
mov esp,ebp
pop ebp
ret
__strstr endp
;param:dststr,srcstr
__strcat proc
push ebp
mov ebp,esp
push edi
push dword ptr ss:[ebp + 8]
call __strlen
add esp,4
mov edi,dword ptr ss:[ebp + 8]
add edi,eax
push dword ptr ss:[ebp +12]
push edi
call __strcpy
add esp,8
pop edi
mov esp,ebp
pop ebp
ret
__strcat endp
;param:string,string
__strcmp proc
push ebp
mov ebp,esp
push ecx
push edx
push esi
push edi
sub esp,40h
push dword ptr ss:[ebp + 8]
call __strlen
add esp,4
mov ecx,eax
push dword ptr ss:[ebp + 12]
call __strlen
add esp,4
cmp eax,ecx
jz _strlenSame
mov eax,-1
jmp __strcmpEnd
_strlenSame:
mov esi,ss:[ebp + 8]
mov edi,ss:[ebp + 12]
repe cmpsb
jz _strCmpSame
mov eax,-1
jmp __strcmpEnd
_strCmpSame:
mov eax,0
__strcmpEnd:
add esp,40h
pop edi
pop esi
pop edx
pop ecx
mov esp,ebp
pop ebp
ret
__strcmp endp
;param: dst,src,len
__memcpy proc
push ebp
mov ebp,esp
push ecx
push esi
push edi
sub esp,40h
mov esi,ss:[ebp + 12]
mov edi,ss:[ebp +8]
mov ecx,ss:[ebp + 16]
cld
rep movsb
mov eax,ss:[ebp + 16]
add esp,40h
pop edi
pop esi
pop ecx
mov esp,ebp
pop ebp
ret
__memcpy endp
;param:dayOfWeek,dstdata
__int2Week proc
push ebp
mov ebp,esp
push ebx
sub esp,40h
mov ebx,KERNELData
shl ebx,4
mov eax,dword ptr ss:[ebp + 8]
cmp eax,1
jz _monday
cmp eax,2
jz _tuesday
cmp eax,3
jz _wednesday
cmp eax,4
jz _thursday
cmp eax,5
jz _friday
cmp eax,6
jz _saturday
cmp eax,7
jz _sunday
mov eax,0
jmp _int2WeekOver
_monday:
add ebx,offset _mondayStr
push ebx
push dword ptr ss:[ebp + 12]
call __strcpy
add esp,8
jmp _int2WeekOver
_tuesday:
add ebx,offset _tuesdayStr
push ebx
push dword ptr ss:[ebp + 12]
call __strcpy
add esp,8
jmp _int2WeekOver
_wednesday:
add ebx,offset _wednesdayStr
push ebx
push dword ptr ss:[ebp + 12]
call __strcpy
add esp,8
jmp _int2WeekOver
_thursday:
add ebx,offset _thursdayStr
push ebx
push dword ptr ss:[ebp + 12]
call __strcpy
add esp,8
jmp _int2WeekOver
_friday:
add ebx,offset _fridaystr
push ebx
push dword ptr ss:[ebp + 12]
call __strcpy
add esp,8
jmp _int2WeekOver
_saturday:
add ebx,offset _saturdayStr
push ebx
push dword ptr ss:[ebp + 12]
call __strcpy
add esp,8
jmp _int2WeekOver
_sunday:
add ebx,offset _sundayStr
push ebx
push dword ptr ss:[ebp + 12]
call __strcpy
add esp,8
_int2WeekOver:
add esp,40h
pop ebx
mov esp,ebp
pop ebp
ret
__int2Week endp
;year
__isLeapYear proc
push ebp
mov ebp,esp
push ecx
push edx
push ebx
push esi
push edi
sub esp,40h
mov eax,ss:[ebp + 8]
mov edx,0
mov ecx,100
div ecx
cmp edx,0
jz _notLeapYear
mov eax,ss:[ebp + 8]
mov edx,0
mov ecx,4
div ecx
cmp edx,0
jnz _notLeapYear
mov eax,1
jmp __isLeapYearEnd
_notLeapYear:
mov eax,0
__isLeapYearEnd:
add esp,40h
pop edi
pop esi
pop ebx
pop edx
pop ecx
mov esp,ebp
pop ebp
ret
__isLeapYear endp
__bcdb2b proc
push ebp
mov ebp,esp
push ecx
push edx
push ebx
push esi
push edi
sub esp,40h
mov eax,ss:[ebp + 8]
movzx eax,al
shr al,4
mov ecx,10
mul ecx
mov ecx,ss:[ebp + 8]
movzx ecx,cl
and ecx,0fh
add eax,ecx
add esp,40h
pop edi
pop esi
pop ebx
pop edx
pop ecx
mov esp,ebp
pop ebp
ret
__bcdb2b endp
__bcdw2b proc
push ebp
mov ebp,esp
push ecx
push edx
push ebx
push esi
push edi
sub esp,40h
mov eax,ss:[ebp + 8]
movzx eax,al
shr al,4
mov ecx,10
mul ecx
mov ecx,ss:[ebp + 8]
movzx ecx,cl
and ecx,0fh
add eax,ecx
push eax
mov eax,ss:[ebp + 8]
shr eax,8
movzx eax,al
shr al,4
mov ecx,10
mul ecx
mov ecx,ss:[ebp + 8]
shr ecx,8
movzx ecx,cl
and ecx,0fh
add eax,ecx
mov ecx,100
mul ecx
pop edx
mov al,dl
add esp,40h
pop edi
pop esi
pop ebx
pop edx
pop ecx
mov esp,ebp
pop ebp
ret
__bcdw2b endp
;year,month
__getDaysOfMonth proc
push ebp
mov ebp,esp
push ecx
push edx
push ebx
push esi
push edi
sub esp,40h
cmp dword ptr ss:[ebp + 12],2
jz _checkDaysOfFeb
mov al,byte ptr ss:[ebp + 12]
dec al
movzx esi,al
mov ebx,kerneldata
shl ebx,4
mov al,ds:[_gDateOfMonth + ebx + esi]
movzx eax,al
jmp __getDaysOfMonthEnd
_checkDaysOfFeb:
push dword ptr ss:[ebp + 8]
call __isLeapYear
add esp,4
cmp eax,0
jnz _leapYearFeb
mov eax,28
jmp __getDaysOfMonthEnd
_leapYearFeb:
mov eax,29
jmp __getDaysOfMonthEnd
__getDaysOfMonthEnd:
add esp,40h
pop edi
pop esi
pop ebx
pop edx
pop ecx
mov esp,ebp
pop ebp
ret
__getDaysOfMonth endp
Kernel Ends
|
; ---------------------------------------------------------------------------
; Sprite mappings - advancing wall of lava (MZ)
; ---------------------------------------------------------------------------
dc.w byte_F538-Map_obj4E
dc.w byte_F566-Map_obj4E
dc.w byte_F594-Map_obj4E
dc.w byte_F5C2-Map_obj4E
dc.w byte_F5F0-Map_obj4E
byte_F538: dc.b 9
dc.b $E0, $F, 0, $60, $20
dc.b 0, $F, 0, $70, $3C
dc.b 0, $F, $FF, $2A, $20
dc.b $E0, $F, $FF, $2A, 0
dc.b 0, $F, $FF, $2A, 0
dc.b $E0, $F, $FF, $2A, $E0
dc.b 0, $F, $FF, $2A, $E0
dc.b $E0, $F, $FF, $2A, $C0
dc.b 0, $F, $FF, $2A, $C0
byte_F566: dc.b 9
dc.b $E0, $F, 0, $70, $20
dc.b 0, $F, 0, $80, $3C
dc.b 0, $F, $FF, $2A, $20
dc.b $E0, $F, $FF, $2A, 0
dc.b 0, $F, $FF, $2A, 0
dc.b $E0, $F, $FF, $2A, $E0
dc.b 0, $F, $FF, $2A, $E0
dc.b $E0, $F, $FF, $2A, $C0
dc.b 0, $F, $FF, $2A, $C0
byte_F594: dc.b 9
dc.b $E0, $F, 0, $80, $20
dc.b 0, $F, 0, $70, $3C
dc.b 0, $F, $FF, $2A, $20
dc.b $E0, $F, $FF, $2A, 0
dc.b 0, $F, $FF, $2A, 0
dc.b $E0, $F, $FF, $2A, $E0
dc.b 0, $F, $FF, $2A, $E0
dc.b $E0, $F, $FF, $2A, $C0
dc.b 0, $F, $FF, $2A, $C0
byte_F5C2: dc.b 9
dc.b $E0, $F, 0, $70, $20
dc.b 0, $F, 0, $60, $3C
dc.b 0, $F, $FF, $2A, $20
dc.b $E0, $F, $FF, $2A, 0
dc.b 0, $F, $FF, $2A, 0
dc.b $E0, $F, $FF, $2A, $E0
dc.b 0, $F, $FF, $2A, $E0
dc.b $E0, $F, $FF, $2A, $C0
dc.b 0, $F, $FF, $2A, $C0
byte_F5F0: dc.b 8
dc.b $E0, $F, $FF, $2A, $20
dc.b 0, $F, $FF, $2A, $20
dc.b $E0, $F, $FF, $2A, 0
dc.b 0, $F, $FF, $2A, 0
dc.b $E0, $F, $FF, $2A, $E0
dc.b 0, $F, $FF, $2A, $E0
dc.b $E0, $F, $FF, $2A, $C0
dc.b 0, $F, $FF, $2A, $C0
even |
// ---------------------------------------------------------------------
//
// Copyright (c) 2014 - 2022 by the IBAMR developers
// All rights reserved.
//
// This file is part of IBAMR.
//
// IBAMR is free software and is distributed under the 3-clause BSD
// license. The full text of the license can be found in the file
// COPYRIGHT at the top level directory of IBAMR.
//
// ---------------------------------------------------------------------
/////////////////////////////// INCLUDES /////////////////////////////////////
#include "ibamr/CIBMobilitySolver.h"
#include "ibamr/CIBSaddlePointSolver.h"
#include "ibamr/CIBStaggeredStokesOperator.h"
#include "ibamr/CIBStrategy.h"
#include "ibamr/IBStrategy.h"
#include "ibamr/INSStaggeredHierarchyIntegrator.h"
#include "ibamr/StaggeredStokesBlockPreconditioner.h"
#include "ibamr/StaggeredStokesPhysicalBoundaryHelper.h"
#include "ibamr/StaggeredStokesSolver.h"
#include "ibamr/StaggeredStokesSolverManager.h"
#include "ibamr/StokesSpecifications.h"
#include "ibtk/CCPoissonSolverManager.h"
#include "ibtk/HierarchyGhostCellInterpolation.h"
#include "ibtk/IBTK_CHKERRQ.h"
#include "ibtk/KrylovLinearSolver.h"
#include "ibtk/LinearOperator.h"
#include "ibtk/LinearSolver.h"
#include "ibtk/NewtonKrylovSolver.h"
#include "ibtk/PETScSAMRAIVectorReal.h"
#include "ibtk/PoissonSolver.h"
#include "ibtk/SCPoissonSolverManager.h"
#include "ibtk/ibtk_utilities.h"
#include "ibtk/solver_utilities.h"
#include "ArrayData.h"
#include "CellVariable.h"
#include "CoarsenSchedule.h"
#include "HierarchyCellDataOpsReal.h"
#include "HierarchySideDataOpsReal.h"
#include "IntVector.h"
#include "MultiblockDataTranslator.h"
#include "Patch.h"
#include "PatchHierarchy.h"
#include "PatchLevel.h"
#include "PoissonSpecifications.h"
#include "RefineSchedule.h"
#include "SAMRAIVectorReal.h"
#include "SideData.h"
#include "SideVariable.h"
#include "Variable.h"
#include "VariableFillPattern.h"
#include "tbox/Database.h"
#include "tbox/MathUtilities.h"
#include "tbox/MemoryDatabase.h"
#include "tbox/PIO.h"
#include "tbox/Pointer.h"
#include "tbox/Timer.h"
#include "tbox/TimerManager.h"
#include "tbox/Utilities.h"
#include "petscksp.h"
#include "petscmat.h"
#include "petscpc.h"
#include "petscpctypes.h"
#include "petscvec.h"
#include <petsclog.h>
#include <petscsys.h>
#include <algorithm>
#include <ostream>
#include <string>
#include <vector>
#include "ibamr/app_namespaces.h" // IWYU pragma: keep
namespace SAMRAI
{
namespace solv
{
template <int DIM>
class RobinBcCoefStrategy;
} // namespace solv
} // namespace SAMRAI
namespace IBAMR
{
/////////////////////////////// STATIC ///////////////////////////////////////
namespace
{
// Types of refining and coarsening to perform prior to setting coarse-fine
// boundary and physical boundary ghost cell values.
static const std::string DATA_REFINE_TYPE = "NONE";
static const bool USE_CF_INTERPOLATION = true;
static const std::string DATA_COARSEN_TYPE = "CUBIC_COARSEN";
// Type of extrapolation to use at physical boundaries.
static const std::string BDRY_EXTRAP_TYPE = "LINEAR";
// Whether to enforce consistent interpolated values at Type 2 coarse-fine
// interface ghost cells.
static const bool CONSISTENT_TYPE_2_BDRY = false;
// Timers.
static Timer* t_solve_system;
static Timer* t_initialize_solver_state;
static Timer* t_deallocate_solver_state;
} // namespace
/////////////////////////////// PUBLIC ///////////////////////////////////////
CIBSaddlePointSolver::CIBSaddlePointSolver(std::string object_name,
Pointer<Database> input_db,
Pointer<INSStaggeredHierarchyIntegrator> navier_stokes_integrator,
Pointer<CIBStrategy> cib_strategy,
std::string default_options_prefix,
MPI_Comm petsc_comm)
: d_object_name(std::move(object_name)),
d_options_prefix(std::move(default_options_prefix)),
d_petsc_comm(petsc_comm),
d_ins_integrator(navier_stokes_integrator),
d_cib_strategy(cib_strategy),
d_num_rigid_parts(cib_strategy->getNumberOfRigidStructures())
{
// Get values from the input database.
if (input_db) getFromInput(input_db);
// Create the linear operator for the extended Stokes (Krylov) solver.
d_A = new CIBStaggeredStokesOperator(d_object_name + "CIBStaggeredStokesOperator",
d_cib_strategy,
/*homogeneous_bc*/ false);
d_A->setInterpScaleFactor(d_scale_interp);
d_A->setSpreadScaleFactor(d_scale_spread);
d_A->setRegularizeMobilityFactor(d_reg_mob_factor);
d_A->setNormalizeSpreadForce(d_normalize_spread_force);
// Create the mobility solver and pass-in some parameters.
d_mob_solver =
new CIBMobilitySolver(d_object_name + "CIBMobilitySolver", input_db, d_ins_integrator, d_cib_strategy);
d_mob_solver->setInterpScale(d_scale_interp);
d_mob_solver->setSpreadScale(d_scale_spread);
d_mob_solver->setRegularizeMobilityScale(d_reg_mob_factor);
d_mob_solver->setNormalizeSpreadForce(d_normalize_spread_force);
// Create the Stokes solver (LInv) for the preconditioner.
// Create databases for setting up LInv solver.
Pointer<Database> LInv_db = input_db->getDatabase("PCStokesSolver");
if (LInv_db->keyExists("normalize_pressure")) d_normalize_pressure = LInv_db->getBool("normalize_pressure");
if (LInv_db->keyExists("normalize_velocity")) d_normalize_velocity = LInv_db->getBool("normalize_velocity");
std::string stokes_solver_type = StaggeredStokesSolverManager::PETSC_KRYLOV_SOLVER;
Pointer<Database> stokes_solver_db = nullptr;
if (LInv_db->keyExists("stokes_solver_type"))
{
stokes_solver_type = LInv_db->getString("stokes_solver_type");
if (LInv_db->keyExists("stokes_solver_db")) stokes_solver_db = LInv_db->getDatabase("stokes_solver_db");
}
if (!stokes_solver_db)
{
stokes_solver_db = new MemoryDatabase("stokes_solver_db");
stokes_solver_db->putString("ksp_type", "fgmres");
}
std::string stokes_precond_type = StaggeredStokesSolverManager::DEFAULT_BLOCK_PRECONDITIONER;
Pointer<Database> stokes_precond_db = nullptr;
if (LInv_db->keyExists("stokes_precond_type"))
{
stokes_precond_type = LInv_db->getString("stokes_precond_type");
if (LInv_db->keyExists("stokes_precond_db")) stokes_precond_db = LInv_db->getDatabase("stokes_precond_db");
}
if (!stokes_precond_db)
{
stokes_precond_db = new MemoryDatabase("stokes_precond_db");
stokes_precond_db->putInteger("max_iterations", 1);
}
std::string velocity_solver_type = IBTK::SCPoissonSolverManager::PETSC_KRYLOV_SOLVER;
Pointer<Database> velocity_solver_db = nullptr;
if (LInv_db->keyExists("velocity_solver_type"))
{
velocity_solver_type = LInv_db->getString("velocity_solver_type");
if (LInv_db->keyExists("velocity_solver_db")) velocity_solver_db = LInv_db->getDatabase("velocity_solver_db");
}
if (!velocity_solver_db)
{
velocity_solver_db = new MemoryDatabase("velocity_solver_db");
velocity_solver_db->putString("ksp_type", "richardson");
velocity_solver_db->putInteger("max_iterations", 10);
velocity_solver_db->putDouble("rel_residual_tol", 1.0e-1);
}
std::string velocity_precond_type = IBTK::SCPoissonSolverManager::DEFAULT_FAC_PRECONDITIONER;
Pointer<Database> velocity_precond_db = nullptr;
if (LInv_db->keyExists("velocity_precond_type"))
{
velocity_precond_type = LInv_db->getString("velocity_precond_type");
if (LInv_db->keyExists("velocity_precond_db"))
velocity_precond_db = LInv_db->getDatabase("velocity_precond_db");
}
if (!velocity_precond_db)
{
velocity_precond_db = new MemoryDatabase("velocity_precond_db");
velocity_precond_db->putInteger("max_iterations", 1);
}
std::string pressure_solver_type = IBTK::CCPoissonSolverManager::PETSC_KRYLOV_SOLVER;
Pointer<Database> pressure_solver_db = nullptr;
if (LInv_db->keyExists("pressure_solver_type"))
{
pressure_solver_type = LInv_db->getString("pressure_solver_type");
if (LInv_db->keyExists("pressure_solver_db")) pressure_solver_db = LInv_db->getDatabase("pressure_solver_db");
}
if (!pressure_solver_db)
{
pressure_solver_db = new MemoryDatabase("pressure_solver_db");
pressure_solver_db->putString("ksp_type", "richardson");
pressure_solver_db->putInteger("max_iterations", 10);
pressure_solver_db->putDouble("rel_residual_tol", 1.0e-1);
}
std::string pressure_precond_type = IBTK::CCPoissonSolverManager::DEFAULT_FAC_PRECONDITIONER;
Pointer<Database> pressure_precond_db = nullptr;
if (LInv_db->keyExists("pressure_precond_type"))
{
pressure_precond_type = LInv_db->getString("pressure_precond_type");
if (LInv_db->keyExists("pressure_precond_db"))
pressure_precond_db = LInv_db->getDatabase("pressure_precond_db");
}
if (!pressure_precond_db)
{
pressure_precond_db = new MemoryDatabase("pressure_precond_db");
pressure_precond_db->putInteger("max_iterations", 1);
}
// Create LInv.
d_LInv = StaggeredStokesSolverManager::getManager()->allocateSolver(stokes_solver_type,
d_object_name + "::pc_stokes_solver",
stokes_solver_db,
"LInv_",
stokes_precond_type,
d_object_name + "::pc_stokes_precond",
stokes_precond_db,
"LInv_pc_");
// Create velocity solver.
d_velocity_solver = IBTK::SCPoissonSolverManager::getManager()->allocateSolver(velocity_solver_type,
d_object_name + "::velocity_solver",
velocity_solver_db,
"LInv_velocity_",
velocity_precond_type,
d_object_name + "::velocity_precond",
velocity_precond_db,
"LInv_velocity_pc_");
// Create pressure solver.
d_pressure_solver = IBTK::CCPoissonSolverManager::getManager()->allocateSolver(pressure_solver_type,
d_object_name + "::pressure_solver",
pressure_solver_db,
"LInv_pressure_",
pressure_precond_type,
d_object_name + "::pressure_precond",
pressure_precond_db,
"LInv_pressure_pc_");
// Register Poisson specification with pressure sub-domain solver.
const StokesSpecifications& stokes_spec = *d_ins_integrator->getStokesSpecifications();
const double rho = stokes_spec.getRho();
PoissonSpecifications P_problem_coefs(d_object_name + "::P_problem_coefs");
P_problem_coefs.setCZero();
P_problem_coefs.setDConstant(rho == 0.0 ? -1.0 : -1.0 / rho);
d_pressure_solver->setPoissonSpecifications(P_problem_coefs);
// Register velocity and pressure solvers with LInv.
Pointer<IBTK::LinearSolver> p_stokes_linear_solver = d_LInv;
if (!p_stokes_linear_solver)
{
Pointer<IBTK::NewtonKrylovSolver> p_stokes_newton_solver = d_LInv;
if (p_stokes_newton_solver) p_stokes_linear_solver = p_stokes_newton_solver->getLinearSolver();
}
if (p_stokes_linear_solver)
{
Pointer<StaggeredStokesBlockPreconditioner> p_stokes_block_pc = p_stokes_linear_solver;
if (!p_stokes_block_pc)
{
Pointer<IBTK::KrylovLinearSolver> p_stokes_krylov_solver = p_stokes_linear_solver;
if (p_stokes_krylov_solver) p_stokes_block_pc = p_stokes_krylov_solver->getPreconditioner();
}
if (p_stokes_block_pc)
{
if (p_stokes_block_pc->needsVelocitySubdomainSolver())
{
p_stokes_block_pc->setVelocitySubdomainSolver(d_velocity_solver);
}
if (p_stokes_block_pc->needsPressureSubdomainSolver())
{
p_stokes_block_pc->setPressureSubdomainSolver(d_pressure_solver);
p_stokes_block_pc->setPressurePoissonSpecifications(P_problem_coefs);
}
}
}
IBTK_DO_ONCE(t_solve_system = TimerManager::getManager()->getTimer("IBAMR::CIBSaddlePointSolver::solveSystem()");
t_initialize_solver_state =
TimerManager::getManager()->getTimer("IBAMR::CIBSaddlePointSolver::initializeSolverState()");
t_deallocate_solver_state =
TimerManager::getManager()->getTimer("IBAMR::CIBSaddlePointSolver::deallocateSolverState()"););
return;
} // CIBSaddlePointSolver
CIBSaddlePointSolver::~CIBSaddlePointSolver()
{
if (d_is_initialized) deallocateSolverState();
// Delete allocated PETSc solver components.
if (d_petsc_mat)
{
MatDestroy(&d_petsc_mat);
d_petsc_mat = nullptr;
}
if (d_petsc_ksp)
{
KSPDestroy(&d_petsc_ksp);
d_petsc_ksp = nullptr;
}
return;
} // ~CIBSaddlePointSolver
void
CIBSaddlePointSolver::setKSPType(const std::string& ksp_type)
{
d_ksp_type = ksp_type;
return;
} // setKSPType
void
CIBSaddlePointSolver::setOptionsPrefix(const std::string& options_prefix)
{
d_options_prefix = options_prefix;
return;
} // setOptionsPrefix
void
CIBSaddlePointSolver::setVelocityPoissonSpecifications(const PoissonSpecifications& u_problem_coefs)
{
d_A->setVelocityPoissonSpecifications(u_problem_coefs);
d_LInv->setVelocityPoissonSpecifications(u_problem_coefs);
d_velocity_solver->setPoissonSpecifications(u_problem_coefs);
d_mob_solver->setVelocityPoissonSpecifications(u_problem_coefs);
return;
} // setVelocityPoissonSpecifications
void
CIBSaddlePointSolver::setSolutionTime(double solution_time)
{
d_A->setSolutionTime(solution_time);
d_LInv->setSolutionTime(solution_time);
d_mob_solver->setSolutionTime(solution_time);
return;
} // setSolutionTime
void
CIBSaddlePointSolver::setTimeInterval(double current_time, double new_time)
{
d_current_time = current_time;
d_new_time = new_time;
const double half_time = 0.5 * (new_time + current_time);
d_A->setTimeInterval(current_time, new_time);
d_LInv->setTimeInterval(current_time, new_time);
d_mob_solver->setTimeInterval(current_time, new_time);
d_velocity_solver->setSolutionTime(new_time);
d_pressure_solver->setSolutionTime(half_time);
d_velocity_solver->setTimeInterval(current_time, new_time);
d_pressure_solver->setTimeInterval(current_time, new_time);
return;
} // setTimeInterval
void
CIBSaddlePointSolver::setPhysicalBcCoefs(const std::vector<RobinBcCoefStrategy<NDIM>*>& u_bc_coefs,
RobinBcCoefStrategy<NDIM>* p_bc_coef)
{
d_u_bc_coefs = u_bc_coefs;
d_A->setPhysicalBcCoefs(d_u_bc_coefs, p_bc_coef);
d_LInv->setPhysicalBcCoefs(d_u_bc_coefs, p_bc_coef);
d_velocity_solver->setPhysicalBcCoefs(d_ins_integrator->getIntermediateVelocityBoundaryConditions());
d_pressure_solver->setPhysicalBcCoef(d_ins_integrator->getProjectionBoundaryConditions());
d_mob_solver->setPhysicalBcCoefs(d_u_bc_coefs, p_bc_coef);
return;
} // setPhysicalBcCoefs
void
CIBSaddlePointSolver::setPhysicalBoundaryHelper(Pointer<StaggeredStokesPhysicalBoundaryHelper> bc_helper)
{
d_A->setPhysicalBoundaryHelper(bc_helper);
d_LInv->setPhysicalBoundaryHelper(bc_helper);
d_mob_solver->setPhysicalBoundaryHelper(bc_helper);
return;
} // setPhysicalBoundaryHelper
Pointer<IBTK::LinearOperator>
CIBSaddlePointSolver::getA() const
{
return d_A;
} // getA
Pointer<StaggeredStokesSolver>
CIBSaddlePointSolver::getStokesSolver() const
{
return d_LInv;
} // getStokesSolver
Pointer<CIBMobilitySolver>
CIBSaddlePointSolver::getCIBMobilitySolver() const
{
return d_mob_solver;
} // getCIBMobilitySolver
bool
CIBSaddlePointSolver::solveSystem(Vec x, Vec b)
{
IBTK_TIMER_START(t_solve_system);
// Initialize the solver, when necessary.
const bool deallocate_after_solve = !d_is_initialized;
if (deallocate_after_solve) initializeSolverState(x, b);
d_petsc_x = x;
VecCopy(b, d_petsc_b);
// Modify RHS for inhomogeneous Bcs.
d_A->setHomogeneousBc(false);
d_A->modifyRhsForBcs(d_petsc_b);
d_A->setHomogeneousBc(true);
// Solve the system.
KSPSolve(d_petsc_ksp, d_petsc_b, d_petsc_x);
KSPGetIterationNumber(d_petsc_ksp, &d_current_iterations);
KSPGetResidualNorm(d_petsc_ksp, &d_current_residual_norm);
// Impose Solution Bcs.
d_A->setHomogeneousBc(false);
d_A->imposeSolBcs(d_petsc_x);
// Determine the convergence reason.
KSPConvergedReason reason;
KSPGetConvergedReason(d_petsc_ksp, &reason);
const bool converged = (static_cast<int>(reason) > 0);
if (d_enable_logging) reportPETScKSPConvergedReason(d_object_name, reason, plog);
// Invalidate d_petsc_x Vec.
d_petsc_x = nullptr;
// Deallocate the solver, when necessary.
if (deallocate_after_solve) deallocateSolverState();
IBTK_TIMER_STOP(t_solve_system);
return converged;
} // solveSystem
void
CIBSaddlePointSolver::initializeSolverState(Vec x, Vec b)
{
IBTK_TIMER_START(t_initialize_solver_state);
// Deallocate the solver state if the solver is already initialized.
if (d_is_initialized)
{
d_reinitializing_solver = true;
deallocateSolverState();
}
// Create RHS Vec to be used in KSP object
VecDuplicate(b, &d_petsc_b);
// Get components of x and b.
Vec *vx, *vb;
VecNestGetSubVecs(x, nullptr, &vx);
VecNestGetSubVecs(b, nullptr, &vb);
Pointer<SAMRAIVectorReal<NDIM, double> > vx0, vb0;
IBTK::PETScSAMRAIVectorReal::getSAMRAIVectorRead(vx[0], &vx0);
IBTK::PETScSAMRAIVectorReal::getSAMRAIVectorRead(vb[0], &vb0);
d_hierarchy = vx0->getPatchHierarchy();
const int u_data_idx = vx0->getComponentDescriptorIndex(0);
const int coarsest_ln = vx0->getCoarsestLevelNumber();
const int finest_ln = vx0->getFinestLevelNumber();
// Initialize various operators and solvers.
d_A->initializeOperatorState(*vx0, *vb0);
initializeStokesSolver(*vx0, *vb0);
// Restore the SAMRAI vectors.
IBTK::PETScSAMRAIVectorReal::restoreSAMRAIVectorRead(vx[0], &vx0);
IBTK::PETScSAMRAIVectorReal::restoreSAMRAIVectorRead(vb[0], &vb0);
// Initialize the mobility solver.
d_mob_solver->initializeSolverState(x, b);
// Initialize the KSP.
initializeKSP();
// Setup the interpolation transaction information.
d_fill_pattern = nullptr;
using InterpolationTransactionComponent = IBTK::HierarchyGhostCellInterpolation::InterpolationTransactionComponent;
InterpolationTransactionComponent component(u_data_idx,
DATA_REFINE_TYPE,
USE_CF_INTERPOLATION,
DATA_COARSEN_TYPE,
BDRY_EXTRAP_TYPE,
CONSISTENT_TYPE_2_BDRY,
d_u_bc_coefs,
d_fill_pattern);
d_transaction_comps.push_back(component);
// Initialize the interpolation operators.
d_hier_bdry_fill = new IBTK::HierarchyGhostCellInterpolation();
d_hier_bdry_fill->initializeOperatorState(d_transaction_comps, d_hierarchy, coarsest_ln, finest_ln);
// Indicate that the solver is initialized.
d_reinitializing_solver = false;
d_is_initialized = true;
IBTK_TIMER_STOP(t_initialize_solver_state);
return;
} // initializeSolverState
void
CIBSaddlePointSolver::deallocateSolverState()
{
if (!d_is_initialized) return;
IBTK_TIMER_START(t_deallocate_solver_state);
// Deallocate the operator and preconditioner states only if we are not
// re-initializing the solver.
if (!d_reinitializing_solver)
{
d_A->deallocateOperatorState();
d_LInv->deallocateSolverState();
d_mob_solver->deallocateSolverState();
}
// Delete the solution and RHS vectors.
VecDestroy(&d_petsc_b);
d_petsc_x = nullptr;
d_petsc_b = nullptr;
// Destroy the KSP solver.
destroyKSP();
// Deallocate the interpolation operators.
d_hier_bdry_fill->deallocateOperatorState();
d_hier_bdry_fill.setNull();
d_transaction_comps.clear();
d_fill_pattern.setNull();
// Indicate that the solver is NOT initialized.
d_is_initialized = false;
IBTK_TIMER_STOP(t_deallocate_solver_state);
return;
} // deallocateSolverState
/////////////////////////////// PRIVATE //////////////////////////////////////
void
CIBSaddlePointSolver::getFromInput(Pointer<Database> input_db)
{
// Get some options.
if (input_db->keyExists("options_prefix")) d_options_prefix = input_db->getString("options_prefix");
if (input_db->keyExists("max_iterations")) d_max_iterations = input_db->getInteger("max_iterations");
if (input_db->keyExists("abs_residual_tol")) d_abs_residual_tol = input_db->getDouble("abs_residual_tol");
if (input_db->keyExists("rel_residual_tol")) d_rel_residual_tol = input_db->getDouble("rel_residual_tol");
if (input_db->keyExists("ksp_type")) d_ksp_type = input_db->getString("ksp_type");
if (input_db->keyExists("pc_type")) d_pc_type = input_db->getString("pc_type");
if (input_db->keyExists("initial_guess_nonzero"))
d_initial_guess_nonzero = input_db->getBool("initial_guess_nonzero");
if (input_db->keyExists("enable_logging")) d_enable_logging = input_db->getBool("enable_logging");
if (input_db->keyExists("scale_interp_operator")) d_scale_interp = input_db->getDouble("scale_interp_operator");
if (input_db->keyExists("scale_spread_operator")) d_scale_spread = input_db->getDouble("scale_spread_operator");
if (input_db->keyExists("regularize_mob_factor")) d_reg_mob_factor = input_db->getDouble("regularize_mob_factor");
if (input_db->keyExists("normalize_spread_force"))
d_normalize_spread_force = input_db->getBool("normalize_spread_force");
return;
} // getFromInput
void
CIBSaddlePointSolver::initializeKSP()
{
// Create the KSP solver.
KSPCreate(d_petsc_comm, &d_petsc_ksp);
resetKSPOptions();
resetKSPOperators();
resetKSPPC();
// Set the KSP options from the PETSc options database.
if (d_options_prefix != "")
{
KSPSetOptionsPrefix(d_petsc_ksp, d_options_prefix.c_str());
}
KSPSetFromOptions(d_petsc_ksp);
// Reset the member state variables to correspond to the values used by the
// KSP object. (Command-line options always take precedence.)
KSPType ksp_type;
KSPGetType(d_petsc_ksp, (const char**)&ksp_type);
d_ksp_type = ksp_type;
PetscBool initial_guess_nonzero;
KSPGetInitialGuessNonzero(d_petsc_ksp, &initial_guess_nonzero);
d_initial_guess_nonzero = (initial_guess_nonzero == PETSC_TRUE);
KSPGetTolerances(d_petsc_ksp, &d_rel_residual_tol, &d_abs_residual_tol, nullptr, &d_max_iterations);
return;
} // initializeKSP
void
CIBSaddlePointSolver::initializeStokesSolver(const SAMRAIVectorReal<NDIM, double>& sol_vec,
const SAMRAIVectorReal<NDIM, double>& rhs_vec)
{
Pointer<PatchHierarchy<NDIM> > patch_hier = sol_vec.getPatchHierarchy();
const int coarsest_ln = sol_vec.getCoarsestLevelNumber();
const int finest_ln = sol_vec.getFinestLevelNumber();
// Set the nullspace of the LInv and subdomain solvers
const double rho = d_ins_integrator->getStokesSpecifications()->getRho();
const bool has_velocity_nullspace = d_normalize_velocity && IBTK::abs_equal_eps(rho, 0.0);
const bool has_pressure_nullspace = d_normalize_pressure;
for (const auto& nul_vec : d_nul_vecs)
{
if (nul_vec) nul_vec->freeVectorComponents();
}
const int n_nul_vecs = (has_pressure_nullspace ? 1 : 0) + (has_velocity_nullspace ? NDIM : 0);
d_nul_vecs.resize(n_nul_vecs);
for (const auto& U_nul_vec : d_U_nul_vecs)
{
if (U_nul_vec) U_nul_vec->freeVectorComponents();
}
const int n_U_nul_vecs = (has_velocity_nullspace ? NDIM : 0);
d_U_nul_vecs.resize(n_U_nul_vecs);
if (has_velocity_nullspace)
{
for (unsigned int k = 0; k < NDIM; ++k)
{
d_nul_vecs[k] = sol_vec.cloneVector(d_object_name + "::nul_vec_U_" + std::to_string(k));
d_nul_vecs[k]->allocateVectorData(d_current_time);
d_nul_vecs[k]->setToScalar(0.0);
SAMRAIVectorReal<NDIM, double> svr_u(
d_object_name + "::U_nul_vec_U_" + std::to_string(k), patch_hier, coarsest_ln, finest_ln);
svr_u.addComponent(sol_vec.getComponentVariable(0),
sol_vec.getComponentDescriptorIndex(0),
sol_vec.getControlVolumeIndex(0));
d_U_nul_vecs[k] = svr_u.cloneVector(svr_u.getName());
d_U_nul_vecs[k]->allocateVectorData(d_current_time);
d_U_nul_vecs[k]->setToScalar(0.0);
for (int ln = coarsest_ln; ln <= finest_ln; ++ln)
{
Pointer<PatchLevel<NDIM> > level = patch_hier->getPatchLevel(ln);
for (PatchLevel<NDIM>::Iterator p(level); p; p++)
{
Pointer<Patch<NDIM> > patch = level->getPatch(p());
Pointer<SideData<NDIM, double> > nul_data =
patch->getPatchData(d_nul_vecs[k]->getComponentDescriptorIndex(0));
nul_data->getArrayData(k).fillAll(1.0);
Pointer<SideData<NDIM, double> > U_nul_data =
patch->getPatchData(d_U_nul_vecs[k]->getComponentDescriptorIndex(0));
U_nul_data->getArrayData(k).fillAll(1.0);
}
}
}
}
if (has_pressure_nullspace)
{
d_nul_vecs.back() = sol_vec.cloneVector(d_object_name + "::nul_vec_p");
d_nul_vecs.back()->allocateVectorData(d_current_time);
HierarchySideDataOpsReal<NDIM, double> side_ops(patch_hier);
HierarchyCellDataOpsReal<NDIM, double> cell_ops(patch_hier);
side_ops.setToScalar(d_nul_vecs.back()->getComponentDescriptorIndex(0), 0.0);
cell_ops.setToScalar(d_nul_vecs.back()->getComponentDescriptorIndex(1), 1.0);
}
// Initialize the velocity and pressure sub-domain solvers
const int x_u_idx = sol_vec.getComponentDescriptorIndex(0);
const int x_p_idx = sol_vec.getComponentDescriptorIndex(1);
const int b_u_idx = rhs_vec.getComponentDescriptorIndex(0);
const int b_p_idx = rhs_vec.getComponentDescriptorIndex(1);
Pointer<SideVariable<NDIM, double> > x_u_sc_var = sol_vec.getComponentVariable(0);
Pointer<CellVariable<NDIM, double> > x_p_cc_var = sol_vec.getComponentVariable(1);
Pointer<SideVariable<NDIM, double> > b_u_sc_var = rhs_vec.getComponentVariable(0);
Pointer<CellVariable<NDIM, double> > b_p_cc_var = rhs_vec.getComponentVariable(1);
SAMRAIVectorReal<NDIM, double> x_u_vec(d_object_name + "::x_u_vec", patch_hier, coarsest_ln, finest_ln);
SAMRAIVectorReal<NDIM, double> b_u_vec(d_object_name + "::b_u_vec", patch_hier, coarsest_ln, finest_ln);
SAMRAIVectorReal<NDIM, double> x_p_vec(d_object_name + "::x_p_vec", patch_hier, coarsest_ln, finest_ln);
SAMRAIVectorReal<NDIM, double> b_p_vec(d_object_name + "::b_p_vec", patch_hier, coarsest_ln, finest_ln);
x_u_vec.addComponent(x_u_sc_var, x_u_idx, sol_vec.getControlVolumeIndex(0));
b_u_vec.addComponent(b_u_sc_var, b_u_idx, rhs_vec.getControlVolumeIndex(0));
x_p_vec.addComponent(x_p_cc_var, x_p_idx, sol_vec.getControlVolumeIndex(1));
b_p_vec.addComponent(b_p_cc_var, b_p_idx, rhs_vec.getControlVolumeIndex(1));
auto p_velocity_solver = dynamic_cast<IBTK::LinearSolver*>(d_velocity_solver.getPointer());
if (p_velocity_solver)
{
p_velocity_solver->setInitialGuessNonzero(false);
if (has_velocity_nullspace) p_velocity_solver->setNullspace(false, d_U_nul_vecs);
}
auto p_pressure_solver = dynamic_cast<IBTK::LinearSolver*>(d_pressure_solver.getPointer());
if (p_pressure_solver)
{
p_pressure_solver->setInitialGuessNonzero(false);
if (has_pressure_nullspace) p_pressure_solver->setNullspace(true);
}
d_velocity_solver->initializeSolverState(x_u_vec, b_u_vec);
d_pressure_solver->initializeSolverState(x_p_vec, b_p_vec);
// Initialize LInv (Stokes solver for the preconditioner).
auto p_stokes_linear_solver = dynamic_cast<IBTK::LinearSolver*>(d_LInv.getPointer());
if (!p_stokes_linear_solver)
{
auto p_stokes_newton_solver = dynamic_cast<IBTK::NewtonKrylovSolver*>(d_LInv.getPointer());
if (p_stokes_newton_solver)
{
p_stokes_linear_solver = p_stokes_newton_solver->getLinearSolver().getPointer();
}
}
if (p_stokes_linear_solver)
{
auto p_stokes_block_pc = dynamic_cast<StaggeredStokesBlockPreconditioner*>(p_stokes_linear_solver);
if (!p_stokes_block_pc)
{
auto p_stokes_krylov_solver = dynamic_cast<IBTK::KrylovLinearSolver*>(p_stokes_linear_solver);
if (p_stokes_krylov_solver)
{
p_stokes_block_pc = dynamic_cast<StaggeredStokesBlockPreconditioner*>(
p_stokes_krylov_solver->getPreconditioner().getPointer());
}
}
if (p_stokes_block_pc)
{
p_stokes_block_pc->setPhysicalBcCoefs(d_ins_integrator->getIntermediateVelocityBoundaryConditions(),
d_ins_integrator->getProjectionBoundaryConditions());
}
p_stokes_linear_solver->setInitialGuessNonzero(false); // In preconditioner initial guess has to be zero.
if (has_velocity_nullspace || has_pressure_nullspace) p_stokes_linear_solver->setNullspace(false, d_nul_vecs);
p_stokes_linear_solver->initializeSolverState(sol_vec, rhs_vec);
}
return;
} // initializeStokesSolver
void
CIBSaddlePointSolver::destroyKSP()
{
int ierr = KSPDestroy(&d_petsc_ksp);
IBTK_CHKERRQ(ierr);
d_petsc_ksp = nullptr;
return;
} // destroyKSP
void
CIBSaddlePointSolver::resetKSPOptions()
{
if (!d_petsc_ksp) return;
const KSPType ksp_type = d_ksp_type.c_str();
KSPSetType(d_petsc_ksp, ksp_type);
std::string ksp_type_name(ksp_type);
if (ksp_type_name.find("gmres") != std::string::npos)
{
KSPGMRESSetOrthogonalization(d_petsc_ksp, KSPGMRESModifiedGramSchmidtOrthogonalization);
KSPGMRESSetCGSRefinementType(d_petsc_ksp, KSP_GMRES_CGS_REFINE_ALWAYS);
}
PetscBool initial_guess_nonzero = (d_initial_guess_nonzero ? PETSC_TRUE : PETSC_FALSE);
KSPSetInitialGuessNonzero(d_petsc_ksp, initial_guess_nonzero);
KSPSetTolerances(d_petsc_ksp, d_rel_residual_tol, d_abs_residual_tol, PETSC_DEFAULT, d_max_iterations);
// Set KSP monitor routine.
if (d_enable_logging)
{
KSPMonitorCancel(d_petsc_ksp);
KSPMonitorSet(
d_petsc_ksp,
reinterpret_cast<PetscErrorCode (*)(KSP, PetscInt, PetscReal, void*)>(CIBSaddlePointSolver::monitorKSP),
nullptr,
nullptr);
}
return;
} // resetKSPOptions
void
CIBSaddlePointSolver::resetKSPOperators()
{
// Create and configure the MatShell object.
if (d_petsc_mat)
{
MatDestroy(&d_petsc_mat);
d_petsc_mat = nullptr;
}
if (!d_petsc_mat)
{
int n;
VecGetLocalSize(d_petsc_b, &n);
MatCreateShell(d_petsc_comm, n, n, PETSC_DETERMINE, PETSC_DETERMINE, static_cast<void*>(this), &d_petsc_mat);
}
MatShellSetOperation(
d_petsc_mat, MATOP_MULT, reinterpret_cast<void (*)(void)>(CIBSaddlePointSolver::MatVecMult_SaddlePoint));
// Reset the configuration of the PETSc KSP object.
if (d_petsc_ksp)
{
KSPSetOperators(d_petsc_ksp, d_petsc_mat, d_petsc_mat);
KSPSetReusePreconditioner(d_petsc_ksp, PETSC_TRUE);
}
return;
} // resetKSPOperators
void
CIBSaddlePointSolver::resetKSPPC()
{
if (!d_petsc_ksp) return;
// Determine the preconditioner type to use.
static const size_t len = 255;
char pc_type_str[len];
PetscBool flg;
PetscOptionsGetString(nullptr, d_options_prefix.c_str(), "-pc_type", pc_type_str, len, &flg);
std::string pc_type = d_pc_type;
if (flg)
{
pc_type = std::string(pc_type_str);
}
if (!(pc_type == "none" || pc_type == "shell"))
{
TBOX_ERROR(d_object_name << "::resetKSPPC()\n"
<< " valid values for -" << d_options_prefix << "pc_type are: none, shell"
<< std::endl);
}
PC petsc_pc;
KSPGetPC(d_petsc_ksp, &petsc_pc);
if (pc_type == "none")
{
PCSetType(petsc_pc, PCNONE);
}
else if (pc_type == "shell")
{
PCSetType(petsc_pc, PCSHELL);
PCShellSetContext(petsc_pc, static_cast<void*>(this));
PCShellSetApply(petsc_pc, CIBSaddlePointSolver::PCApply_SaddlePoint);
}
else
{
TBOX_ERROR("CIBSaddlePointSolver::resetKSPPC() This statement should not be reached!\n");
}
return;
} // resetKSPPC
PetscErrorCode
CIBSaddlePointSolver::MatVecMult_SaddlePoint(Mat A, Vec x, Vec y)
{
void* p_ctx;
MatShellGetContext(A, &p_ctx);
auto solver = static_cast<CIBSaddlePointSolver*>(p_ctx);
#if !defined(NDEBUG)
TBOX_ASSERT(solver);
TBOX_ASSERT(solver->d_A);
#endif
solver->d_A->apply(x, y);
PetscFunctionReturn(0);
} // MatVecMult_SaddlePoint
// Exact-Schur Complement PC
PetscErrorCode
CIBSaddlePointSolver::PCApply_SaddlePoint(PC pc, Vec x, Vec y)
{
// Here we are solving the equation of the type : Py = x
// in which P is the preconditioner.
void* ctx;
PCShellGetContext(pc, &ctx);
auto solver = static_cast<CIBSaddlePointSolver*>(ctx);
Pointer<IBStrategy> ib_method_ops = solver->d_cib_strategy;
#if !defined(NDEBUG)
TBOX_ASSERT(solver);
TBOX_ASSERT(solver->d_LInv);
TBOX_ASSERT(solver->d_mob_solver);
TBOX_ASSERT(ib_method_ops);
#endif
// Get some constants
static const double gamma = solver->d_scale_spread;
static const double beta = solver->d_scale_interp;
const double half_time = 0.5 * (solver->d_new_time + solver->d_current_time);
int total_comps, free_comps = 0;
Vec *vx, *vy;
VecNestGetSubVecs(x, nullptr, &vx);
VecNestGetSubVecs(y, &total_comps, &vy);
VecGetSize(vx[2], &free_comps);
Pointer<SAMRAIVectorReal<NDIM, double> > vx0, vy0;
IBTK::PETScSAMRAIVectorReal::getSAMRAIVectorRead(vx[0], &vx0);
IBTK::PETScSAMRAIVectorReal::getSAMRAIVector(vy[0], &vy0);
// Get the individual components.
Pointer<SAMRAIVectorReal<NDIM, double> > g_h = vx0->cloneVector("");
g_h->allocateVectorData();
g_h->copyVector(vx0);
Pointer<SAMRAIVectorReal<NDIM, double> > u_p = vy0;
Vec W, Lambda, F_tilde;
W = vx[1];
Lambda = vy[1];
// Create temporary vectors for storage.
// U is the interpolated velocity and delU is the slip velocity.
Vec U, delU;
VecDuplicate(W, &U);
// 1) (u,p) = L^-1 (g,h)
dynamic_cast<IBTK::LinearSolver*>(solver->d_LInv.getPointer())->setInitialGuessNonzero(false);
dynamic_cast<IBTK::LinearSolver*>(solver->d_LInv.getPointer())->setHomogeneousBc(true);
solver->d_LInv->solveSystem(*u_p, *g_h);
// 2a) Fill ghost cells of u
int u_data_idx = u_p->getComponentDescriptorIndex(0);
using InterpolationTransactionComponent = IBTK::HierarchyGhostCellInterpolation::InterpolationTransactionComponent;
std::vector<InterpolationTransactionComponent> transaction_comps;
InterpolationTransactionComponent u_component(u_data_idx,
DATA_REFINE_TYPE,
USE_CF_INTERPOLATION,
DATA_COARSEN_TYPE,
BDRY_EXTRAP_TYPE,
CONSISTENT_TYPE_2_BDRY,
solver->d_u_bc_coefs,
solver->d_fill_pattern);
transaction_comps.push_back(u_component);
solver->d_hier_bdry_fill->resetTransactionComponents(transaction_comps);
static const bool homogeneous_bc = true;
solver->d_hier_bdry_fill->setHomogeneousBc(homogeneous_bc);
solver->d_hier_bdry_fill->fillData(half_time);
solver->d_hier_bdry_fill->resetTransactionComponents(solver->d_transaction_comps);
// 2b) U = J u + W.
solver->d_cib_strategy->setInterpolatedVelocityVector(U, half_time);
ib_method_ops->interpolateVelocity(u_data_idx,
std::vector<Pointer<CoarsenSchedule<NDIM> > >(),
std::vector<Pointer<RefineSchedule<NDIM> > >(),
half_time);
solver->d_cib_strategy->getInterpolatedVelocity(U, half_time, beta);
VecAXPY(U, 1.0, W);
// 3) Calculate the slip velocity
if (free_comps)
{
VecDuplicate(vx[2], &F_tilde);
VecDuplicate(W, &delU);
// 3a) lambda = M^-1(U)
solver->d_mob_solver->solveMobilitySystem(Lambda, U);
// 3b) F_tilde = F + T(lambda)
solver->d_cib_strategy->computeNetRigidGeneralizedForce(Lambda,
F_tilde,
/*only_free_dofs*/ true,
/*only_imposed_dofs*/ false);
VecAXPY(F_tilde, 1.0, vx[2]);
// 3c) U_rigid = N^-1(F_tilde)
solver->d_mob_solver->solveBodyMobilitySystem(vy[2], F_tilde);
// 3d) delU = T*(U_rigid) - U
VecSet(delU, 0.0);
solver->d_cib_strategy->setRigidBodyVelocity(vy[2], delU, /*only_free_dofs*/ true, /*only_imposed_dofs*/ false);
VecAXPY(delU, -1.0, U);
}
else
{
delU = U;
VecScale(delU, -1.0);
}
// 4) lambda = M^-1(delta_U)
solver->d_mob_solver->solveMobilitySystem(Lambda, delU);
// 5) (u,p) = L^-1(S[lambda]+g, h)
const int g_data_idx = g_h->getComponentDescriptorIndex(0);
solver->d_cib_strategy->setConstraintForce(Lambda, half_time, gamma);
ib_method_ops->spreadForce(g_data_idx, nullptr, std::vector<Pointer<RefineSchedule<NDIM> > >(), half_time);
if (solver->d_normalize_spread_force)
{
solver->d_cib_strategy->subtractMeanConstraintForce(Lambda, g_data_idx, gamma);
}
// Solve using previous u_p as a guess for Krylov solvers.
if (solver->d_ksp_type == "preonly")
{
dynamic_cast<IBTK::LinearSolver*>(solver->d_LInv.getPointer())->setInitialGuessNonzero(false);
}
else
{
dynamic_cast<IBTK::LinearSolver*>(solver->d_LInv.getPointer())->setInitialGuessNonzero(true);
}
dynamic_cast<IBTK::LinearSolver*>(solver->d_LInv.getPointer())->setHomogeneousBc(true);
solver->d_LInv->solveSystem(*u_p, *g_h);
// Destroy temporary vectors
g_h->resetLevels(g_h->getCoarsestLevelNumber(),
std::min(g_h->getFinestLevelNumber(), g_h->getPatchHierarchy()->getFinestLevelNumber()));
g_h->freeVectorComponents();
g_h.setNull();
VecDestroy(&U);
if (free_comps)
{
VecDestroy(&delU);
VecDestroy(&F_tilde);
}
IBTK::PETScSAMRAIVectorReal::restoreSAMRAIVectorRead(vx[0], &vx0);
IBTK::PETScSAMRAIVectorReal::restoreSAMRAIVector(vy[0], &vy0);
PetscFunctionReturn(0);
} // PCApply_SaddlePoint
// Routine to log output of CIBSaddlePointSolver
PetscErrorCode
CIBSaddlePointSolver::monitorKSP(KSP ksp, int it, PetscReal rnorm, void* /*mctx*/)
{
Vec resid, rhs;
PetscReal truenorm, bnorm;
char print_normtype[256];
KSPNormType ksp_normtype;
KSPBuildResidual(ksp, nullptr, nullptr, &resid);
VecNorm(resid, NORM_2, &truenorm);
VecDestroy(&resid);
KSPGetRhs(ksp, &rhs);
KSPGetNormType(ksp, &ksp_normtype);
VecNorm(rhs, NORM_2, &bnorm);
PetscStrncpy(print_normtype, KSPNormTypes[ksp_normtype], sizeof(print_normtype));
PetscStrtolower(print_normtype);
if (it == 0)
{
tbox::plog << "\n\n Residual norms for -SP_ksp" << std::endl;
}
std::streamsize old_precision = tbox::plog.precision(16);
tbox::plog << std::scientific << it << " SP_KSP " << print_normtype << " resid norm " << rnorm
<< " true resid norm " << truenorm << " ||r(i)||/||b|| " << truenorm / bnorm << std::endl;
tbox::plog.precision(old_precision);
PetscFunctionReturn(0);
} // monitorKSP
//////////////////////////////////////////////////////////////////////////////
} // namespace IBAMR
//////////////////////////////////////////////////////////////////////////////
|
; $Id: setjmp.asm $
;; @file
; IPRT - No-CRT setjmp & longjmp - AMD64 & X86.
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; The contents of this file may alternatively be used under the terms
; of the Common Development and Distribution License Version 1.0
; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
; VirtualBox OSE distribution, in which case the provisions of the
; CDDL are applicable instead of those of the GPL.
;
; You may elect to license modified versions of this file under the
; terms and conditions of either the GPL or the CDDL or both.
;
%include "iprt/asmdefs.mac"
BEGINCODE
;;
; @param x86:[esp+4] msc:rcx gcc:rdi The jump buffer pointer.
BEGINPROC RT_NOCRT(setjmp)
%ifdef RT_ARCH_AMD64
%ifndef ASM_CALL64_MSC
mov rcx, rdi
%endif
mov rax, [rsp]
mov [rcx + 0h*8], rax ; 0 - rip
lea rdx, [rsp + 8]
mov [rcx + 1h*8], rdx ; 1 - rsp
mov [rcx + 2h*8], rbp
mov [rcx + 3h*8], r15
mov [rcx + 4h*8], r14
mov [rcx + 5h*8], r13
mov [rcx + 6h*8], r12
mov [rcx + 7h*8], rbx
%ifdef ASM_CALL64_MSC
mov [rcx + 8h*8], rsi
mov [rcx + 9h*8], rdi
movdqa [rcx + 0ah*8], xmm6
movdqa [rcx + 0ch*8], xmm7
movdqa [rcx + 0eh*8], xmm8
movdqa [rcx + 10h*8], xmm9
movdqa [rcx + 12h*8], xmm10
movdqa [rcx + 14h*8], xmm11
movdqa [rcx + 16h*8], xmm12
movdqa [rcx + 18h*8], xmm13
movdqa [rcx + 1ah*8], xmm14
movdqa [rcx + 1ch*8], xmm15
%ifndef RT_OS_WINDOWS
%error "Fix setjmp.h"
%endif
%endif
%else
mov edx, [esp + 4h]
mov eax, [esp]
mov [edx + 0h*4], eax ; eip
lea ecx, [esp + 4h]
mov [edx + 1h*4], ecx ; esp
mov [edx + 2h*4], ebp
mov [edx + 3h*4], ebx
mov [edx + 4h*4], edi
mov [edx + 5h*4], esi
%endif
xor eax, eax
ret
ENDPROC RT_NOCRT(setjmp)
;;
; @param x86:[esp+4] msc:rcx gcc:rdi The jump buffer pointer.
; @param x86:[esp+8] msc:rdx gcc:rsi Return value.
BEGINPROC RT_NOCRT(longjmp)
%ifdef RT_ARCH_AMD64
%ifdef ASM_CALL64_MSC
mov eax, edx ; ret
%else
mov rcx, rdi ; jmp_buf
mov eax, esi ; ret
%endif
mov rbp, [rcx + 2h*8]
mov r15, [rcx + 3h*8]
mov r14, [rcx + 4h*8]
mov r13, [rcx + 5h*8]
mov r12, [rcx + 6h*8]
mov rbx, [rcx + 7h*8]
%ifdef ASM_CALL64_MSC
mov rsi, [rcx + 8h*8]
mov rdi, [rcx + 9h*8]
movdqa xmm6, [rcx + 0ah*8]
movdqa xmm7, [rcx + 0ch*8]
movdqa xmm8, [rcx + 0eh*8]
movdqa xmm9, [rcx + 10h*8]
movdqa xmm10, [rcx + 12h*8]
movdqa xmm11, [rcx + 14h*8]
movdqa xmm12, [rcx + 16h*8]
movdqa xmm13, [rcx + 18h*8]
movdqa xmm14, [rcx + 1ah*8]
movdqa xmm15, [rcx + 1ch*8]
%ifndef RT_OS_WINDOWS
%error "Fix setjmp.h"
%endif
%endif
test eax, eax
jnz .fine
inc al
.fine:
mov rsp, [rcx + 1h*8]
jmp qword [rcx + 0h*8]
%else
mov edx, [esp + 4h] ; jmp_buf
mov eax, [esp + 8h] ; ret
mov esi, [edx + 5h*4]
mov edi, [edx + 4h*4]
mov ebx, [edx + 3h*4]
mov ebp, [edx + 2h*4]
test eax, eax
jnz .fine
inc al
.fine:
mov esp, [edx + 1h*4]
jmp dword [edx+ 0h*4]
%endif
ENDPROC RT_NOCRT(longjmp)
|
; A099378: Denominators of the harmonic means of the divisors of the positive integers.
; Submitted by Jon Maiga
; 1,3,2,7,3,1,4,15,13,9,6,7,7,3,2,31,9,13,10,7,8,9,12,5,31,21,10,1,15,3,16,21,4,27,12,91,19,15,14,9,21,2,22,7,13,9,24,31,19,31,6,49,27,5,18,15,20,45,30,7,31,12,52,127,21,3,34,21,8,9,36,65,37,57,62,35,24,7,40,93,121,63,42,2,27,33,10,45,45,13,4,7,32,18,6,7,49,57,26,217
add $0,1
mov $2,$0
lpb $0
add $1,$4
mov $3,$2
dif $3,$0
sub $0,1
cmp $3,$2
cmp $3,0
add $4,$3
lpe
add $4,1
add $4,$1
mul $1,$2
gcd $1,$4
div $4,$1
mov $0,$4
|
f1:
PUSH %14
MOV %15,%14
@f1_body:
MOV $0,%13
JMP @f1_exit
@f1_exit:
MOV %14,%15
POP %14
RET
f2:
PUSH %14
MOV %15,%14
@f2_body:
MOV $0,%13
JMP @f2_exit
@f2_exit:
MOV %14,%15
POP %14
RET
f3:
PUSH %14
MOV %15,%14
@f3_body:
MOV $0,%13
JMP @f3_exit
@f3_exit:
MOV %14,%15
POP %14
RET
f4:
PUSH %14
MOV %15,%14
@f4_body:
MOV $0,%13
JMP @f4_exit
@f4_exit:
MOV %14,%15
POP %14
RET
f5:
PUSH %14
MOV %15,%14
@f5_body:
MOV $0,%13
JMP @f5_exit
@f5_exit:
MOV %14,%15
POP %14
RET
f6:
PUSH %14
MOV %15,%14
@f6_body:
MOV $0,%13
JMP @f6_exit
@f6_exit:
MOV %14,%15
POP %14
RET
f7:
PUSH %14
MOV %15,%14
@f7_body:
MOV $0,%13
JMP @f7_exit
@f7_exit:
MOV %14,%15
POP %14
RET
f8:
PUSH %14
MOV %15,%14
@f8_body:
MOV $0,%13
JMP @f8_exit
@f8_exit:
MOV %14,%15
POP %14
RET
main:
PUSH %14
MOV %15,%14
@main_body:
PUSH $-44
PUSH $77
PUSH $1
PUSH $-5
PUSH $0
PUSH $6
PUSH $5
PUSH $1
PUSH $6
PUSH $5
CALL f1
ADDS %15,$40,%15
MOV %13,%0
MOV $0,%13
JMP @main_exit
@main_exit:
MOV %14,%15
POP %14
RET |
#ifndef PYTHONIC_BUILTIN_DICT_UPDATE_HPP
#define PYTHONIC_BUILTIN_DICT_UPDATE_HPP
#include "pythonic/include/builtins/dict/update.hpp"
#include "pythonic/__dispatch__/update.hpp"
#endif
|
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "rpc/protocol.h"
#include "random.h"
#include "tinyformat.h"
#include "util.h"
#include "utilstrencodings.h"
#include "utiltime.h"
#include "version.h"
#include <fstream>
#include <stdint.h>
/**
* JSON-RPC protocol. DietBitcoin speaks version 1.0 for maximum compatibility,
* but uses JSON-RPC 1.1/2.0 standards for parts of the 1.0 standard that were
* unspecified (HTTP errors and contents of 'error').
*
* 1.0 spec: http://json-rpc.org/wiki/specification
* 1.2 spec: http://jsonrpc.org/historical/json-rpc-over-http.html
*/
UniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id)
{
UniValue request(UniValue::VOBJ);
request.push_back(Pair("method", strMethod));
request.push_back(Pair("params", params));
request.push_back(Pair("id", id));
return request;
}
UniValue JSONRPCReplyObj(const UniValue& result, const UniValue& error, const UniValue& id)
{
UniValue reply(UniValue::VOBJ);
if (!error.isNull())
reply.push_back(Pair("result", NullUniValue));
else
reply.push_back(Pair("result", result));
reply.push_back(Pair("error", error));
reply.push_back(Pair("id", id));
return reply;
}
std::string JSONRPCReply(const UniValue& result, const UniValue& error, const UniValue& id)
{
UniValue reply = JSONRPCReplyObj(result, error, id);
return reply.write() + "\n";
}
UniValue JSONRPCError(int code, const std::string& message)
{
UniValue error(UniValue::VOBJ);
error.push_back(Pair("code", code));
error.push_back(Pair("message", message));
return error;
}
/** Username used when cookie authentication is in use (arbitrary, only for
* recognizability in debugging/logging purposes)
*/
static const std::string COOKIEAUTH_USER = "__cookie__";
/** Default name for auth cookie file */
static const std::string COOKIEAUTH_FILE = ".cookie";
/** Get name of RPC authentication cookie file */
static fs::path GetAuthCookieFile(bool temp = false)
{
std::string arg = gArgs.GetArg("-rpccookiefile", COOKIEAUTH_FILE);
if (temp) {
arg += ".tmp";
}
fs::path path(arg);
if (!path.is_complete()) path = GetDataDir() / path;
return path;
}
bool GenerateAuthCookie(std::string* cookie_out)
{
const size_t COOKIE_SIZE = 32;
unsigned char rand_pwd[COOKIE_SIZE];
GetRandBytes(rand_pwd, COOKIE_SIZE);
std::string cookie = COOKIEAUTH_USER + ":" + HexStr(rand_pwd, rand_pwd + COOKIE_SIZE);
/** the umask determines what permissions are used to create this file -
* these are set to 077 in init.cpp unless overridden with -sysperms.
*/
std::ofstream file;
fs::path filepath_tmp = GetAuthCookieFile(true);
file.open(filepath_tmp.string().c_str());
if (!file.is_open()) {
LogPrintf("Unable to open cookie authentication file %s for writing\n", filepath_tmp.string());
return false;
}
file << cookie;
file.close();
fs::path filepath = GetAuthCookieFile(false);
if (!RenameOver(filepath_tmp, filepath)) {
LogPrintf("Unable to rename cookie authentication file %s to %s\n", filepath_tmp.string(), filepath.string());
return false;
}
LogPrintf("Generated RPC authentication cookie %s\n", filepath.string());
if (cookie_out)
*cookie_out = cookie;
return true;
}
bool GetAuthCookie(std::string* cookie_out)
{
std::ifstream file;
std::string cookie;
fs::path filepath = GetAuthCookieFile();
file.open(filepath.string().c_str());
if (!file.is_open())
return false;
std::getline(file, cookie);
file.close();
if (cookie_out)
*cookie_out = cookie;
return true;
}
void DeleteAuthCookie()
{
try {
fs::remove(GetAuthCookieFile());
} catch (const fs::filesystem_error& e) {
LogPrintf("%s: Unable to remove random auth cookie file: %s\n", __func__, e.what());
}
}
|
; ===============================================================
; Jan 2014
; ===============================================================
;
; char *_memstrcpy(void *p, char *s, size_t n)
;
; At most n chars from string s are copied to p. The terminating
; '\0' in s is not copied.
;
; ===============================================================
SECTION code_clib
SECTION code_string
PUBLIC asm__memstrcpy
asm__memstrcpy:
; enter : de = void *p = dst
; hl = char *s = src
; bc = size_n
;
; exit : de = void *p_ptr = addr of byte following last write
; hl = char *s_ptr = addr of byte following last read
; bc = n remaining
; carry reset
;
; uses : af, bc, de, hl
ld a,b
or c
ret Z ; if n == 0
IF __CPU_INTEL__ || __CPU_GBZ80__
loop:
xor a
cp (hl)
ret Z ; if '\0' met
ld a,(hl+)
ld (de+),a
dec bc
ld a,b
or c
jr NZ,loop
ELSE
xor a
loop:
cp (hl)
ret Z ; if '\0' met
ldi
jp PE,loop
ENDIF
or a
ret
|
; A103838: Complement of A001671.
; 2,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79
mul $0,2
mov $1,$0
lpb $1
add $0,2
sub $2,$1
add $2,$0
sub $1,$2
lpe
div $0,2
add $0,2
|
dnl ARM mpn_addlsh1_n and mpn_sublsh1_n
dnl Contributed to the GNU project by Torbjörn Granlund.
dnl Copyright 2012 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
dnl The GNU MP Library is free software; you can redistribute it and/or modify
dnl it under the terms of either:
dnl
dnl * the GNU Lesser General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl or
dnl
dnl * the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any
dnl later version.
dnl
dnl or both in parallel, as here.
dnl
dnl The GNU MP Library is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl You should have received copies of the GNU General Public License and the
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
include(`../config.m4')
C addlsh1_n sublsh1_n
C cycles/limb cycles/limb
C StrongARM ? ?
C XScale ? ?
C Cortex-A7 ? ?
C Cortex-A8 ? ?
C Cortex-A9 3.12 3.7
C Cortex-A15 ? ?
C TODO
C * The addlsh1_n code runs well, but is only barely faster than mpn_addmul_1.
C The sublsh1_n code could surely be tweaked, its REVCY slows down things
C very much. If two insns are really needed, it might help to separate them
C for better micro-parallelism.
define(`rp', `r0')
define(`up', `r1')
define(`vp', `r2')
define(`n', `r3')
ifdef(`OPERATION_addlsh1_n', `
define(`ADDSUB', adds)
define(`ADDSUBC', adcs)
define(`SETCY', `cmp $1, #1')
define(`RETVAL', `adc r0, $1, #2')
define(`SAVECY', `sbc $1, $2, #0')
define(`RESTCY', `cmn $1, #1')
define(`REVCY', `')
define(`INICYR', `mov $1, #0')
define(`r10r11', `r11')
define(`func', mpn_addlsh1_n)
define(`func_nc', mpn_addlsh1_nc)')
ifdef(`OPERATION_sublsh1_n', `
define(`ADDSUB', subs)
define(`ADDSUBC', sbcs)
define(`SETCY', `rsbs $1, $1, #0')
define(`RETVAL', `adc r0, $1, #1')
define(`SAVECY', `sbc $1, $1, $1')
define(`RESTCY', `cmn $1, #1')
define(`REVCY', `sbc $1, $1, $1
cmn $1, #1')
define(`INICYR', `mvn $1, #0')
define(`r10r11', `r10')
define(`func', mpn_sublsh1_n)
define(`func_nc', mpn_sublsh1_nc)')
MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_sublsh1_n)
ASM_START()
PROLOGUE(func)
push {r4-r10r11, r14}
ifdef(`OPERATION_addlsh1_n', `
mvn r11, #0
')
INICYR( r14)
subs n, n, #3
blt L(le2) C carry clear on branch path
cmn r0, #0 C clear carry
ldmia vp!, {r8, r9, r10}
b L(mid)
L(top): RESTCY( r14)
ADDSUBC r4, r4, r8
ADDSUBC r5, r5, r9
ADDSUBC r6, r6, r10
ldmia vp!, {r8, r9, r10}
stmia rp!, {r4, r5, r6}
REVCY(r14)
adcs r8, r8, r8
adcs r9, r9, r9
adcs r10, r10, r10
ldmia up!, {r4, r5, r6}
SAVECY( r14, r11)
subs n, n, #3
blt L(exi)
RESTCY( r12)
ADDSUBC r4, r4, r8
ADDSUBC r5, r5, r9
ADDSUBC r6, r6, r10
ldmia vp!, {r8, r9, r10}
stmia rp!, {r4, r5, r6}
REVCY(r12)
L(mid): adcs r8, r8, r8
adcs r9, r9, r9
adcs r10, r10, r10
ldmia up!, {r4, r5, r6}
SAVECY( r12, r11)
subs n, n, #3
bge L(top)
mov r7, r12 C swap alternating...
mov r12, r14 C ...carry-save...
mov r14, r7 C ...registers
L(exi): RESTCY( r12)
ADDSUBC r4, r4, r8
ADDSUBC r5, r5, r9
ADDSUBC r6, r6, r10
stmia rp!, {r4, r5, r6}
REVCY(r12)
L(le2): tst n, #1 C n = {-1,-2,-3} map to [2], [1], [0]
beq L(e1)
L(e02): tst n, #2
beq L(rt0)
ldm vp, {r8, r9}
adcs r8, r8, r8
adcs r9, r9, r9
ldm up, {r4, r5}
SAVECY( r12, r11)
RESTCY( r14)
ADDSUBC r4, r4, r8
ADDSUBC r5, r5, r9
stm rp, {r4, r5}
b L(rt1)
L(e1): ldr r8, [vp]
adcs r8, r8, r8
ldr r4, [up]
SAVECY( r12, r11)
RESTCY( r14)
ADDSUBC r4, r4, r8
str r4, [rp]
L(rt1): mov r14, r12
REVCY(r12)
L(rt0): RETVAL( r14)
pop {r4-r10r11, r14}
bx r14
EPILOGUE()
|
org 0x7c00
start:
push cs
pop ds
mov bx, string
repeat:
mov al, [bx]
test al, al
je end
push bx
mov ah, 0x0e
mov bx, 0x000f
int 0x10
pop bx
inc bx
jmp repeat
end:
jmp $
string:
db "Hello, world", 0
times 510 - ($-$$) db 0
db 0x55, 0xaa |
** = $0021
;
; Character look-up table. Frequently-used
; characters stored as 4-bit pointers
; into part of this table (FUTBL). In-
; frequently-used characters stored as
; 8-bit pointers into the other part
; (IUTBL). Note that the last two en-
; tries are variables, used for special
; program-controllable characters.
;
; Index Character
FUTBL: .BYTE $77 ; 2 A
.BYTE $39 ; 3 C
.BYTE $5E ; 4 D
.BYTE $79 ; 5 E
.BYTE $76 ; 6 H
.BYTE $06 ; 7 I
.BYTE $38 ; 8 L
.BYTE $54 ; 9 N
.BYTE $5C ; A O
.BYTE $50 ; B R
.BYTE $6D ; C S
.BYTE $78 ; D T
.BYTE $1C ; E U
.BYTE $00 ; F (blank)
IUTBL: .BYTE $40 ; 10 - (dash)
.BYTE $7C ; 11 B
.BYTE $71 ; 12 F
.BYTE $3D ; 13 G
; (continuation of IUTBL)
.BYTE $1E ; 14 J
.BYTE $37 ; 15 M
.BYTE $73 ; 16 P
.BYTE $3E ; 17 W
.BYTE $6E ; 18 Y
.BYTE $53 ; 19 ?
.BYTE $08 ; 1A . (period)
.BYTE $5B ; 1B 2
SGNPST: .BYTE $00 ; 1C Variable (signpost)
MBCODE: .BYTE $00 ; 1D Variable (? or magic
; button)
;
; Program variables (except for a very few
; located elsewhere)
NMBUTS: .BYTE $00 ; No. of magic button uses
BURDEN: .BYTE $00 ; Bit #n set if carrying object #n.
DLOBAD: .BYTE $00 ; Abs address of obj to be deleted.
DRAGON: .BYTE $FF ; FF=hungry; 0=dead; 1=full.
EGOLAD: .BYTE $EC ; Current address of EGO file.
LOCAD: .BYTE $00 ; Addr of current location file.
LINTAX: .BYTE $00 ; Pointer: 0=EGOLAD; 1=LOCAD
LOBJAD: .BYTE $00 ; Addr of last obj in file, or
; of object of interest.
LOCNUM: .BYTE $0B ; Number of current location.
MBUT: .BYTE $FF ; Current magic button (0 - F valid).
NOBCRY: .BYTE $00 ; No. of objects carried (0 - 4).
NOBS: .BYTE $00 ; No. of objs to be displayed (0 - 7).
OBJ: .BYTE $00 ; Object identifier (0 - 7).
POINTR: .BYTE $00 ; ADL of message
.BYTE >SOM ; ADH of message (Constant!)
; Changed from original to allow
; relocation of messages.
MOVES: .BYTE $00 ; L.S. Half of number of moves.
;
; Program constants
;
OBJMSK: .BYTE %00000010 ; (1) Bird When obj is
.BYTE %00000100 ; (2) Rope picked up (or is
.BYTE %00001000 ; (3) Rod dropped), the
.BYTE %00010000 ; (4) File proper bit is
.BYTE %00100000 ; (5) Cage ORed into (or is
.BYTE %01000000 ; (6) Pearls NANDed out of)
.BYTE %10000000 ; (7) Gold BURDEN.
;
; Message addresses. These are the ADL's of
; the messages, all of which are assumed
; to reside in page 3 (see POINTR+1).
; Order of this table is paramount!
; There is a variable thrown in here to
; separate ADOPGR and ADBRDG ...
ADOPGR: .BYTE $34 ; Open Grate
SCDU: .BYTE $00 ; -1,0,1,2 : Browse, Carry,
; Drop, Use
ADBRDG: .BYTE $2B ; Bridge Across Gully
OBMSAD: .BYTE $BE ; (0) Dragon
.BYTE $DC ; (1) Bird
.BYTE $43 ; (2) Rope
.BYTE $E4 ; (3) Rod
.BYTE $25 ; (4) File
.BYTE $22 ; (5) Cage
.BYTE $1C ; (6) Pearls
.BYTE $46 ; (7) Gold
UINMAD: .BYTE $8C ; You Are In
.BYTE $89 ; You Are At
.BYTE $B5 ; I See -
CYMSAD: .BYTE $E7 ; Carry -
.BYTE $D7 ; Drop -
.BYTE $AE ; Use -
LNAMAD: .BYTE $06 ; Cellar 0
.BYTE $09 ; Purple Oracle 1
.BYTE $11 ; Red Room 2
ADSSM: .BYTE $18 ; Stone Steps 3
.BYTE $D3 ; Blue Den 4
ADGRM: .BYTE $3C ; Steel Grate 5
.BYTE $4F ; Hole 6
ADGYM: .BYTE $38 ; Gully 7
ADRHM: .BYTE $7B ; Royal Hall 8
.BYTE $AB ; House 9
.BYTE $DB ; Bird Room A
.BYTE $70 ; Stream B
ADTSM: .BYTE $52 ; Tight Shaft C
.BYTE $93 ; N. Pit D
.BYTE $EF ; Grotto E
.BYTE $6A ; Oyster-bed F
.BYTE $28 ; Chute 10
.BYTE $73 ; E. Pit 11
.BYTE $9B ; Attic 12
.BYTE $EB ; S. Pit 13
.BYTE $56 ; Tunnel 14
.BYTE $5D ; 2-Inch Slit 15
.BYTE $82 ; Glen 16
.BYTE $F3 ; Forest 17
; CAVE MAP
; Format for file for each location in caves is as follows:
;
; Word # Contents
; 0 Bit 7 = 1, bit 6 = 0. Bit 5 = 1 if location has
; been visited during the game. Bits 4 - 0
; contain the location number of this file.
;
; 1 Bit 7 = 0. Bit 6 = 1 if magic button works
; in this location. bits 5,4,3,2,1,0 = 1 if
; you can leave this location in the D,U,W,S,
; E,N direction, respectively. This word is
; used as the "signpost" in the Cue message.
;
; next (up Bit 7 = 0, bit 6 = 1. Bits 5 - 0 specify a
; to) six location to which you may move from this
; words location.
; The first of these words specifies the
; destination for the lowest-numbered bit
; which is set in word 1; the second specifies
; the destination for the next-lowest bit set
; in word 1, etc.
; Therefore, there must be one of these words
; for each of the first six bits (5 - 0) set
; in word 1 of this file.
;
; next (up Bit 7 = 0, bit 6 = 0. Bits 5 - 0 specify the
; to) eight object number of an object at this location.
; words There may be as many as eight of these words,
; or there may be none at all.
;
RYHALL = $08
SOCM: .BYTE $88 ; LOCNUM = 8 Royal Hall
.BYTE $3F ; Directions: N,E,S,W,U,D
.BYTE $4E ; N to Grotto (E)
.BYTE $43 ; E to Stone Steps (3)
.BYTE $4C ; S to Tight Shaft (C)
.BYTE $4D ; W to N. Pit (D)
.BYTE $52 ; U to Attic (12)
.BYTE $50 ; D to Chute (10)
DRAGAD: .BYTE $00 ; Dragon
;
.BYTE $94 ; LOCNUM = 14 Tunnel
.BYTE $11 ; Directions: N,U
.BYTE $4A ; N to Bird Room (A)
.BYTE $45 ; U to Steel Grate (5)
.BYTE $03 ; Rod
;
.BYTE $95 ; LOCNUM = 15 2-Inch Slit
.BYTE $05 ; Directions: N,S
.BYTE $4B ; N to Stream (B)
.BYTE $45 ; S to Steel Grate (5)
;
.BYTE $96 ; LOCNUM = 16 Glen
.BYTE $02 ; Directions: E
.BYTE $4B ; E to Stream (B)
;
.BYTE $8F ; LOCNUM = F Oyster-Bed
.BYTE $10 ; Directions: U
.BYTE $44 ; U to Blue Den (4)
.BYTE $06 ; Pearls
;
.BYTE $80 ; LOCNUM = 0 Cellar
.BYTE $50 ; Directions: U, Magic
; (Magic to Stone Steps)
.BYTE $49 ; U to (at) House (9)
.BYTE $05 ; Cage
.BYTE $02 ; Rope
.BYTE $04 ; File
;
.BYTE $81 ; LOCNUM = 1 Purple Oracle
.BYTE $0A ; Directions: W,E
.BYTE $4A ; E to Bird Room (A)
.BYTE $43 ; W to Stone Steps (3)
;
.BYTE $82 ; LOCNUM = 2 Red Room
.BYTE $52 ; Directions: E,U,Magic
; (Magic to Cellar)
.BYTE $47 ; E to Gully (7)
.BYTE $52 ; U to Attic (12)
.BYTE $07 ; Gold
;
.BYTE $83 ; LOCNUM = 3 Stone Steps
.BYTE $70 ; Directions: U,D,Magic
; (Magic to Cellar)
.BYTE $41 ; U to Purple Oracle (1)
.BYTE $48 ; D to Royal Hall (8)
;
.BYTE $84 ; LOCNUM = 4 Blue Den
.BYTE $61 ; Directions: N,D,Magic
; (Magic to Cellar)
.BYTE $46 ; N to Hole (6)
.BYTE $4F ; D to Oyster-Bed (F)
;
STGRAT = $05
.BYTE $85 ; LOCNUM = 5 Steel Grate
.BYTE $21 ; Directions: N,D
.BYTE $55 ; N to 2-Inch Slit (15)
.BYTE $54 ; D to Tunnel (14)
;
HOLE = $06
.BYTE $86 ; LOCNUM = 6 Hole
.BYTE $00 ; Directions: None!
;
GULLY = $07
.BYTE $87 ; LOCNUM = 7 Gully
.BYTE $0C ; Directions: S,W
.BYTE $4E ; S to Grotto (E)
.BYTE $42 ; W to Red Room (2)
;
.BYTE $89 ; LOCNUM = 9 House
.BYTE $2E ; Directions: E,S,W,D
.BYTE $57 ; E to Forest (17)
.BYTE $4B ; S to Stream (B)
.BYTE $56 ; W to Glen (16)
.BYTE $40 ; D to Cellar (0)
;
.BYTE $8A ; LOCNUM = A Bird Room
.BYTE $0C ; Directions: S,W
.BYTE $54 ; S to Tunnel (14)
.BYTE $41 ; W to Purple Oracle (1)
.BYTE $01 ; Bird
;
.BYTE $8B ; LOCNUM = B Stream
.BYTE $0F ; Directions: N,E,S,W
.BYTE $49 ; N to House (9)
.BYTE $57 ; E to Forest (17)
.BYTE $55 ; S to 2-Inch Slit (15)
.BYTE $56 ; W to Glen (16)
;
.BYTE $8C ; LOCNUM = C Tight Shaft
.BYTE $30 ; Directions: U,D
.BYTE $52 ; U to Attic (12)
.BYTE $53 ; D to S. Pit (13)
;
NPIT = $0D
.BYTE $8D ; LOCNUM = D N. Pit
.BYTE $2A ; Directions: E,W,D
.BYTE $51 ; E to E. Pit (11)
.BYTE $50 ; W to Chute (10)
.BYTE $46 ; D to Hole (6)
;
.BYTE $8E ; LOCNUM = E Grotto
.BYTE $0D ; Directions: N,S,W
.BYTE $43 ; N to Stone Steps (3)
.BYTE $4D ; S to N. Pit (D)
.BYTE $47 ; W to Gully (7)
;
.BYTE $97 ; LOCNUM = 17 Forest
.BYTE $09 ; Directions: N,W
.BYTE $49 ; N to House (9)
.BYTE $4B ; W to Stream (B)
;
.BYTE $90 ; LOCNUM = 10 Chute
.BYTE $20 ; Directions: D
.BYTE $4C ; D to Tight Shaft (C)
;
.BYTE $91 ; LOCNUM = 11 E. Pit
.BYTE $35 ; Directions: N,S,U,D
.BYTE $4D ; N to N. Pit (D)
.BYTE $53 ; S to S. Pit (13)
.BYTE $4C ; U to Tight Shaft (C)
.BYTE $46 ; D to Hole (6)
;
.BYTE $92 ; LOCNUM = 12 Attic
.BYTE $20 ; Directions: D
.BYTE $48 ; D to Royal Hall (8)
;
.BYTE $93 ; LOCNUM = 13 S. Pit
.BYTE $33 ; Directions: N,E,U,D
.BYTE $4D ; N to N. Pit (D)
.BYTE $51 ; E to E. Pit (11)
.BYTE $52 ; U to Attic (12)
.BYTE $44 ; D to Blue Den (4)
;
; EGO File ("File of the self")
; Behaves like any other location, except that the
; "Directions" word is used for the Most Significant
; Half of the double precision MOVES counter. This
; file is initially empty; objects picked up by the
; adventurer are placed here until they are dropped.
;
.BYTE $9F ; LOCNUM = 1F EGO File
.BYTE $00 ; M.S.H. of MOVES
EOCM: .BYTE $9F ; End Of Cave Map Flag (a constant)
;
; KIM monitor locations used by KIM-VENTURE
;
YSAV: .BYTE $00 ; Used by LIGHT S/R to save Y-Reg.
; This location is destroyed each
; time ADDOBJ is called -- EOCM
; gets written here.
WINDO: .BYTE $00,$00,$00,$00,$00,$00,$00
; Display window for LIGHT S/R. Really
; only need six, but for the fact
; that FILMSG keeps unpacking msg's
; till it ends on a whole byte --
; thus clobbering 1 or 2 extras...
DIR: .BYTE $00 ; Direction moved. 0=N,....,5=D.
;
** = $00FC
TEMP: .BYTE $00 ; Used by LIGHT and monitor together.
LCTR: .BYTE $00 ; Letter-counter for FILMSG.
DISNXM: .BYTE $00 ; Display-next-message flag. If nonzero,
; FILMSG will add DISNXM to ADL of
; message (POINTR) and start over.
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright(c) 2011-2015 Intel Corporation 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 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.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; gf_2vect_mad_sse(len, vec, vec_i, mul_array, src, dest);
;;;
%include "reg_sizes.asm"
%define PS 8
%ifidn __OUTPUT_FORMAT__, win64
%define arg0 rcx
%define arg0.w ecx
%define arg1 rdx
%define arg2 r8
%define arg3 r9
%define arg4 r12
%define arg5 r15
%define tmp r11
%define tmp2 r10
%define return rax
%define return.w eax
%define stack_size 16*9 + 3*8
%define arg(x) [rsp + stack_size + PS + PS*x]
%define func(x) proc_frame x
%macro FUNC_SAVE 0
sub rsp, stack_size
movdqa [rsp+16*0],xmm6
movdqa [rsp+16*1],xmm7
movdqa [rsp+16*2],xmm8
movdqa [rsp+16*3],xmm9
movdqa [rsp+16*4],xmm10
movdqa [rsp+16*5],xmm11
movdqa [rsp+16*6],xmm12
movdqa [rsp+16*7],xmm13
movdqa [rsp+16*8],xmm14
save_reg r12, 9*16 + 0*8
save_reg r15, 9*16 + 1*8
end_prolog
mov arg4, arg(4)
mov arg5, arg(5)
%endmacro
%macro FUNC_RESTORE 0
movdqa xmm6, [rsp+16*0]
movdqa xmm7, [rsp+16*1]
movdqa xmm8, [rsp+16*2]
movdqa xmm9, [rsp+16*3]
movdqa xmm10, [rsp+16*4]
movdqa xmm11, [rsp+16*5]
movdqa xmm12, [rsp+16*6]
movdqa xmm13, [rsp+16*7]
movdqa xmm14, [rsp+16*8]
mov r12, [rsp + 9*16 + 0*8]
mov r15, [rsp + 9*16 + 1*8]
add rsp, stack_size
%endmacro
%elifidn __OUTPUT_FORMAT__, elf64
%define arg0 rdi
%define arg0.w edi
%define arg1 rsi
%define arg2 rdx
%define arg3 rcx
%define arg4 r8
%define arg5 r9
%define tmp r11
%define tmp2 r10
%define return rax
%define return.w eax
%define func(x) x:
%define FUNC_SAVE
%define FUNC_RESTORE
%endif
;;; gf_2vect_mad_sse(len, vec, vec_i, mul_array, src, dest)
%define len arg0
%define len.w arg0.w
%define vec arg1
%define vec_i arg2
%define mul_array arg3
%define src arg4
%define dest1 arg5
%define pos return
%define pos.w return.w
%define dest2 tmp2
%ifndef EC_ALIGNED_ADDR
;;; Use Un-aligned load/store
%define XLDR movdqu
%define XSTR movdqu
%else
;;; Use Non-temporal load/stor
%ifdef NO_NT_LDST
%define XLDR movdqa
%define XSTR movdqa
%else
%define XLDR movntdqa
%define XSTR movntdq
%endif
%endif
default rel
[bits 64]
section .text
%define xmask0f xmm14
%define xgft1_lo xmm13
%define xgft1_hi xmm12
%define xgft2_lo xmm11
%define xgft2_hi xmm10
%define x0 xmm0
%define xtmpa xmm1
%define xtmph1 xmm2
%define xtmpl1 xmm3
%define xtmph2 xmm4
%define xtmpl2 xmm5
%define xd1 xmm6
%define xd2 xmm7
%define xtmpd1 xmm8
%define xtmpd2 xmm9
align 16
global gf_2vect_mad_sse:function
func(gf_2vect_mad_sse)
FUNC_SAVE
sub len, 16
jl .return_fail
xor pos, pos
movdqa xmask0f, [mask0f] ;Load mask of lower nibble in each byte
sal vec_i, 5 ;Multiply by 32
sal vec, 5
lea tmp, [mul_array + vec_i]
movdqu xgft1_lo,[tmp] ;Load array Ax{00}, Ax{01}, Ax{02}, ...
movdqu xgft1_hi, [tmp+16] ; " Ax{00}, Ax{10}, Ax{20}, ... , Ax{f0}
movdqu xgft2_lo, [tmp+vec] ;Load array Bx{00}, Bx{01}, Bx{02}, ...
movdqu xgft2_hi, [tmp+vec+16] ; " Bx{00}, Bx{10}, Bx{20}, ... , Bx{f0}
mov dest2, [dest1+PS]
mov dest1, [dest1]
XLDR xtmpd1, [dest1+len] ;backup the last 16 bytes in dest
XLDR xtmpd2, [dest2+len] ;backup the last 16 bytes in dest
.loop16:
XLDR xd1, [dest1+pos] ;Get next dest vector
XLDR xd2, [dest2+pos] ;Get next dest vector
.loop16_overlap:
XLDR x0, [src+pos] ;Get next source vector
movdqa xtmph1, xgft1_hi ;Reload const array registers
movdqa xtmpl1, xgft1_lo
movdqa xtmph2, xgft2_hi ;Reload const array registers
movdqa xtmpl2, xgft2_lo
movdqa xtmpa, x0 ;Keep unshifted copy of src
psraw x0, 4 ;Shift to put high nibble into bits 4-0
pand x0, xmask0f ;Mask high src nibble in bits 4-0
pand xtmpa, xmask0f ;Mask low src nibble in bits 4-0
pshufb xtmph1, x0 ;Lookup mul table of high nibble
pshufb xtmpl1, xtmpa ;Lookup mul table of low nibble
pxor xtmph1, xtmpl1 ;GF add high and low partials
pxor xd1, xtmph1
pshufb xtmph2, x0 ;Lookup mul table of high nibble
pshufb xtmpl2, xtmpa ;Lookup mul table of low nibble
pxor xtmph2, xtmpl2 ;GF add high and low partials
pxor xd2, xtmph2
XSTR [dest1+pos], xd1 ;Store result
XSTR [dest2+pos], xd2 ;Store result
add pos, 16 ;Loop on 16 bytes at a time
cmp pos, len
jle .loop16
lea tmp, [len + 16]
cmp pos, tmp
je .return_pass
;; Tail len
mov pos, len ;Overlapped offset length-16
movdqa xd1, xtmpd1 ;Restore xd1
movdqa xd2, xtmpd2 ;Restore xd2
jmp .loop16_overlap ;Do one more overlap pass
.return_pass:
FUNC_RESTORE
mov return, 0
ret
.return_fail:
FUNC_RESTORE
mov return, 1
ret
endproc_frame
section .data
align 16
mask0f:
ddq 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f
;;; func core, ver, snum
slversion gf_2vect_mad_sse, 00, 01, 0203
|
#define BIORBD_API_EXPORTS
#include "s2mActuatorGauss6p.h"
#include "s2mGenCoord.h"
s2mActuatorGauss6p::s2mActuatorGauss6p(
int direction,
double Tmax,
double T0,
double wmax,
double wc,
double amin,
double wr,
double w1,
double r,
double qopt,
double facteur,
double r2,
double qopt2,
unsigned int dofIdx, const s2mString &jointName) :
s2mActuator(direction, dofIdx, jointName),
m_k(4.3), // Valeur par défaut
m_Tmax(Tmax),
m_T0(T0),
m_wmax(wmax),
m_wc(wc),
m_amax(1.0), // Valeur par défaut
m_amin(amin),
m_wr(wr),
m_w1(w1),
m_r(r),
m_qopt(qopt),
m_facteur(facteur),
m_r2(r2),
m_qopt2(qopt2)
{
}
s2mActuatorGauss6p::~s2mActuatorGauss6p()
{
}
double s2mActuatorGauss6p::torqueMax(const s2mGenCoord &Q, const s2mGenCoord &Qdot){
double pos(Q[m_dofIdx] * 180/M_PI);
double speed(Qdot[m_dofIdx] * 180/M_PI);
// Tetanic torque max
double Tc = m_T0*m_wc/m_wmax;
double C = Tc*(m_wmax+m_wc); // en concentrique
double we = ( (m_Tmax-m_T0) * m_wmax * m_wc ) / ( m_k * m_T0 * (m_wmax+m_wc) );
double E = -( m_Tmax - m_T0 ) * we; // en excentrique
double Tw; // Initiation d'une variable
if (speed >= 0)
Tw = C / ( m_wc + speed ) - Tc; // Pour le concentrique
else
Tw = E / ( we - speed ) + m_Tmax; // Pour l'excentrique
// Differential activation
double A = m_amin + ( m_amax - m_amin ) / ( 1 + exp( -(speed-m_w1) / m_wr ) );
// Torque angle
double Ta = exp( -(m_qopt -pos) * (m_qopt -pos) / (2*m_r *m_r ) )
+ m_facteur * exp( -(m_qopt2-pos) * (m_qopt2-pos) / (2*m_r2*m_r2) );
// Calcul du couple max
return Tw * A * Ta;
}
|
#include "audiorecorder.h"
#include <QApplication>
#include <QFile>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
/* 指定文件 */
QFile file(":/style.qss");
/* 判断文件是否存在 */
if (file.exists() ) {
/* 以只读的方式打开 */
file.open(QFile::ReadOnly);
/* 以字符串的方式保存读出的结果 */
QString styleSheet = QLatin1String(file.readAll());
/* 设置全局样式 */
qApp->setStyleSheet(styleSheet);
/* 关闭文件 */
file.close();
}
AudioRecorder w;
w.show();
return a.exec();
}
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
lea addresses_WC_ht+0x1c9d7, %r12
nop
nop
nop
nop
xor %r13, %r13
movups (%r12), %xmm3
vpextrq $1, %xmm3, %r10
nop
sub %r13, %r13
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r9
push %rbx
push %rcx
push %rsi
// Store
lea addresses_RW+0x22d7, %r13
nop
nop
nop
nop
nop
inc %rbx
movw $0x5152, (%r13)
nop
nop
nop
nop
nop
sub $30082, %rsi
// Load
lea addresses_UC+0x19fd7, %rcx
nop
nop
nop
nop
dec %r12
vmovups (%rcx), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $0, %xmm5, %rbx
nop
cmp $34907, %rsi
// Faulty Load
lea addresses_UC+0x19fd7, %r13
clflush (%r13)
nop
xor $24917, %r9
mov (%r13), %ebx
lea oracles, %rsi
and $0xff, %rbx
shlq $12, %rbx
mov (%rsi,%rbx,1), %rbx
pop %rsi
pop %rcx
pop %rbx
pop %r9
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 6, '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
*/
|
; PROLOGUE(mpn_addmul_1)
; Copyright 2011 The Code Cavern
;
; Windows Conversion Copyright 2008 Brian Gladman
;
; This file is part of the MPIR Library.
;
; The MPIR 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 MPIR 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 MPIR Library; see the file COPYING.LIB. If not, write
; to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
; Boston, MA 02110-1301, USA.
;
; mp_limb_t mpn_addmul_1(mp_ptr, mp_ptr, mp_size_t, mp_limb_t)
; mp_limb_t mpn_inclsh_n(mp_ptr, mp_ptr, mp_size_t, mp_uint)
; rax rdi rsi rdx rcx
; rax rcx rdx r8 r9d
%include "yasm_mac.inc"
CPU Athlon64
BITS 64
%define reg_save_list rsi, rdi, r12
xalign 16
LEAF_PROC mpn_inclsh_n
mov r10, rcx
mov ecx, r9d
mov r9, 1
shl r9, cl
mov rcx, r10
xalign 16
LEAF_PROC mpn_addmul_1
mov rax, [rdx]
cmp r8, 1
jnz .1
mul r9
add [rcx], rax
adc rdx, 0
mov rax, rdx
ret
xalign 16
.1: FRAME_PROC ?mpn_k8_addmul, 0, reg_save_list
mov r11, 5
lea rsi, [rdx+r8*8-40]
lea rdi, [rcx+r8*8-40]
mov rcx, r9
sub r11, r8
mul rcx
db 0x26
mov r8, rax
db 0x26
mov rax, [rsi+r11*8+8]
db 0x26
mov r9, rdx
db 0x26
cmp r11, 0
db 0x26
mov [rsp-8], r12
db 0x26
jge .3
.2: xor r10, r10
mul rcx
add [rdi+r11*8], r8
adc r9, rax
adc r10, rdx
mov rax, [rsi+r11*8+16]
mul rcx
add [rdi+r11*8+8], r9
adc r10, rax
mov r12d, 0
adc r12, rdx
mov rax, [rsi+r11*8+24]
xor r8, r8
xor r9, r9
mul rcx
add [rdi+r11*8+16], r10
adc r12, rax
adc r8, rdx
mov rax, [rsi+r11*8+32]
mul rcx
add [rdi+r11*8+24], r12
adc r8, rax
adc r9, rdx
add r11, 4
mov rax, [rsi+r11*8+8]
jnc .2
.3 xor r10, r10
mul rcx
add [rdi+r11*8], r8
adc r9, rax
adc r10, rdx
cmp r11, 2
ja .7
jz .6
jp .5
.4: mov rax, [rsi+16]
mul rcx
add [rdi+8], r9
adc r10, rax
mov r12d, 0
adc r12, rdx
mov rax, [rsi+24]
xor r8, r8
xor r9, r9
mul rcx
add [rdi+16], r10
adc r12, rax
adc r8, rdx
mov rax, [rsi+32]
mul rcx
add [rdi+24], r12
adc r8, rax
adc r9, rdx
add [rdi+32], r8
adc r9, 0
mov rax, r9
EXIT_PROC reg_save_list
.5: mov rax, [rsi+24]
mul rcx
add [rdi+16], r9
adc r10, rax
mov r12d, 0
adc r12, rdx
mov rax, [rsi+32]
xor r8, r8
mul rcx
add [rdi+24], r10
adc r12, rax
adc r8, rdx
add [rdi+32], r12
adc r8, 0
mov rax, r8
EXIT_PROC reg_save_list
align 16
.6: mov rax, [rsi+32]
mul rcx
add [rdi+24], r9
adc r10, rax
mov r12d, 0
adc r12, rdx
add [rdi+32], r10
adc r12, 0
mov rax, r12
EXIT_PROC reg_save_list
.7: add [rdi+32], r9
adc r10, 0
mov rax, r10
END_PROC reg_save_list
end
|
; A213508: The sequence Z(n) arising in the enumeration of balanced binary trees.
; 1,3,4,7,9,10,11,15,18,20,22,23,24,25,26,31,35,38,41,43,45,47,49,50,51,52,53,54,55,56,57,63,68,72,76,79,82,85,88,90,92,94,96,98,100,102,104,105,106,107
mov $16,$0
mov $18,$0
add $18,1
lpb $18
mov $0,$16
sub $18,1
sub $0,$18
add $0,1
mul $0,2
lpb $0
lpb $0,16
mov $8,$0
lpb $8
mov $3,5
add $6,3
sub $7,1
mod $7,$7
mov $1,$7
div $3,$6
sub $8,7
mod $8,2
lpb $8
sub $0,1
add $1,$6
mov $6,$7
trn $8,$0
lpe
lpe
lpe
div $0,2
sub $3,3
lpe
mov $1,$6
sub $1,6
div $1,3
add $1,1
add $17,$1
lpe
mov $1,$17
|
; A190954: a(n) = 10*a(n-1) + 4*a(n-2), with a(0)=0, a(1)=1.
; Submitted by Jamie Morken(s4)
; 0,1,10,104,1080,11216,116480,1209664,12562560,130464256,1354892800,14070785024,146127421440,1517557354496,15760083230720,163671061725184,1699750950174720,17652193748647936,183320941287178240,1903818187866374144,19771465643812454400,205329929189590040576,2132385154471150223360,22145171261469862395904,229981253232583224852480,2388393217371711698108416,24803857186647449880494080,257592144735961345597374464,2675136876106203255495720960,27781737340005877937346707456,288517920904483592395449958400
mov $1,1
lpb $0
sub $0,1
mov $2,$3
mul $2,4
mul $3,10
add $3,$1
mov $1,$2
lpe
mov $0,$3
|
#include "common/common/thread.h"
#include "common/event/libevent.h"
#include "test/test_common/simulated_time_system.h"
#include "event2/event.h"
#include "gtest/gtest.h"
namespace Envoy {
namespace Event {
namespace Test {
class SimulatedTimeSystemTest : public testing::Test {
protected:
SimulatedTimeSystemTest()
: event_system_(event_base_new()), scheduler_(time_system_.createScheduler(event_system_)),
start_monotonic_time_(time_system_.monotonicTime()),
start_system_time_(time_system_.systemTime()) {}
void addTask(int64_t delay_ms, char marker) {
std::chrono::milliseconds delay(delay_ms);
TimerPtr timer = scheduler_->createTimer([this, marker, delay]() {
output_.append(1, marker);
EXPECT_GE(time_system_.monotonicTime(), start_monotonic_time_ + delay);
});
timer->enableTimer(delay);
timers_.push_back(std::move(timer));
}
void sleepMsAndLoop(int64_t delay_ms) {
time_system_.sleep(std::chrono::milliseconds(delay_ms));
event_base_loop(event_system_.get(), EVLOOP_NONBLOCK);
}
void advanceSystemMsAndLoop(int64_t delay_ms) {
time_system_.setSystemTime(time_system_.systemTime() + std::chrono::milliseconds(delay_ms));
event_base_loop(event_system_.get(), EVLOOP_NONBLOCK);
}
SimulatedTimeSystem time_system_;
Libevent::BasePtr event_system_;
SchedulerPtr scheduler_;
std::string output_;
std::vector<TimerPtr> timers_;
MonotonicTime start_monotonic_time_;
SystemTime start_system_time_;
};
TEST_F(SimulatedTimeSystemTest, Sleep) {
EXPECT_EQ(start_monotonic_time_, time_system_.monotonicTime());
EXPECT_EQ(start_system_time_, time_system_.systemTime());
sleepMsAndLoop(5);
EXPECT_EQ(start_monotonic_time_ + std::chrono::milliseconds(5), time_system_.monotonicTime());
EXPECT_EQ(start_system_time_ + std::chrono::milliseconds(5), time_system_.systemTime());
}
TEST_F(SimulatedTimeSystemTest, WaitFor) {
EXPECT_EQ(start_monotonic_time_, time_system_.monotonicTime());
EXPECT_EQ(start_system_time_, time_system_.systemTime());
// Run an event loop in the background to activate timers.
std::atomic<bool> done(false);
auto thread = std::make_unique<Thread::Thread>([this, &done]() {
while (!done) {
event_base_loop(event_system_.get(), 0);
}
});
Thread::CondVar condvar;
Thread::MutexBasicLockable mutex;
TimerPtr timer = scheduler_->createTimer([&condvar, &mutex, &done]() {
Thread::LockGuard lock(mutex);
done = true;
condvar.notifyOne();
});
timer->enableTimer(std::chrono::seconds(60));
// Wait 50 simulated seconds of simulated time, which won't be enough to
// activate the alarm. We'll get a fast automatic timeout in waitFor because
// there are no pending timers.
{
Thread::LockGuard lock(mutex);
EXPECT_EQ(Thread::CondVar::WaitStatus::Timeout,
time_system_.waitFor(mutex, condvar, std::chrono::seconds(50)));
}
EXPECT_FALSE(done);
EXPECT_EQ(MonotonicTime(std::chrono::seconds(50)), time_system_.monotonicTime());
// Waiting another 20 simulated seconds will activate the alarm after 10,
// and the event-loop thread will call the corresponding callback quickly.
{
Thread::LockGuard lock(mutex);
EXPECT_EQ(Thread::CondVar::WaitStatus::NoTimeout,
time_system_.waitFor(mutex, condvar, std::chrono::seconds(10)));
}
EXPECT_TRUE(done);
EXPECT_EQ(MonotonicTime(std::chrono::seconds(60)), time_system_.monotonicTime());
// Waiting a third time, with no pending timeouts, will just sleep out for
// the max duration and return a timeout.
{
Thread::LockGuard lock(mutex);
EXPECT_EQ(Thread::CondVar::WaitStatus::Timeout,
time_system_.waitFor(mutex, condvar, std::chrono::seconds(20)));
}
EXPECT_EQ(MonotonicTime(std::chrono::seconds(80)), time_system_.monotonicTime());
thread->join();
}
TEST_F(SimulatedTimeSystemTest, Monotonic) {
// Setting time forward works.
time_system_.setMonotonicTime(start_monotonic_time_ + std::chrono::milliseconds(5));
EXPECT_EQ(start_monotonic_time_ + std::chrono::milliseconds(5), time_system_.monotonicTime());
// But going backward does not.
time_system_.setMonotonicTime(start_monotonic_time_ + std::chrono::milliseconds(3));
EXPECT_EQ(start_monotonic_time_ + std::chrono::milliseconds(5), time_system_.monotonicTime());
}
TEST_F(SimulatedTimeSystemTest, System) {
// Setting time forward works.
time_system_.setSystemTime(start_system_time_ + std::chrono::milliseconds(5));
EXPECT_EQ(start_system_time_ + std::chrono::milliseconds(5), time_system_.systemTime());
// And going backward works too.
time_system_.setSystemTime(start_system_time_ + std::chrono::milliseconds(3));
EXPECT_EQ(start_system_time_ + std::chrono::milliseconds(3), time_system_.systemTime());
}
TEST_F(SimulatedTimeSystemTest, Ordering) {
addTask(5, '5');
addTask(3, '3');
addTask(6, '6');
EXPECT_EQ("", output_);
sleepMsAndLoop(5);
EXPECT_EQ("35", output_);
sleepMsAndLoop(1);
EXPECT_EQ("356", output_);
}
TEST_F(SimulatedTimeSystemTest, SystemTimeOrdering) {
addTask(5, '5');
addTask(3, '3');
addTask(6, '6');
EXPECT_EQ("", output_);
advanceSystemMsAndLoop(5);
EXPECT_EQ("35", output_);
advanceSystemMsAndLoop(1);
EXPECT_EQ("356", output_);
time_system_.setSystemTime(start_system_time_ + std::chrono::milliseconds(1));
time_system_.setSystemTime(start_system_time_ + std::chrono::milliseconds(100));
EXPECT_EQ("356", output_); // callbacks don't get replayed.
}
TEST_F(SimulatedTimeSystemTest, DisableTimer) {
addTask(5, '5');
addTask(3, '3');
addTask(6, '6');
timers_[0]->disableTimer();
EXPECT_EQ("", output_);
sleepMsAndLoop(5);
EXPECT_EQ("3", output_);
sleepMsAndLoop(1);
EXPECT_EQ("36", output_);
}
TEST_F(SimulatedTimeSystemTest, IgnoreRedundantDisable) {
addTask(5, '5');
timers_[0]->disableTimer();
timers_[0]->disableTimer();
sleepMsAndLoop(5);
EXPECT_EQ("", output_);
}
TEST_F(SimulatedTimeSystemTest, OverrideEnable) {
addTask(5, '5');
timers_[0]->enableTimer(std::chrono::milliseconds(6));
sleepMsAndLoop(5);
EXPECT_EQ("", output_); // Timer didn't wake up because we overrode to 6ms.
sleepMsAndLoop(1);
EXPECT_EQ("5", output_);
}
TEST_F(SimulatedTimeSystemTest, DeleteTime) {
addTask(5, '5');
addTask(3, '3');
addTask(6, '6');
timers_[0].reset();
EXPECT_EQ("", output_);
sleepMsAndLoop(5);
EXPECT_EQ("3", output_);
sleepMsAndLoop(1);
EXPECT_EQ("36", output_);
}
} // namespace Test
} // namespace Event
} // namespace Envoy
|
// Demonstrates an array with a trailing comma
// Commodore 64 PRG executable file
.file [name="initializer-4.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.segment Code
main: {
.label SCREEN = $400
ldx #0
ldy #0
__b1:
// SCREEN[idx++] = chars[i]
lda chars,y
sta SCREEN,x
// SCREEN[idx++] = chars[i];
inx
// for( char i: 0..2)
iny
cpy #3
bne __b1
// }
rts
}
.segment Data
chars: .byte 1, 2, 3
|
; A271091: Number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 275", based on the 5-celled von Neumann neighborhood.
; Submitted by Jon Maiga
; 1,5,5,40,5,112,5,216,5,352,5,520,5,720,5,952,5,1216,5,1512,5,1840,5,2200,5,2592,5,3016,5,3472,5,3960,5,4480,5,5032,5,5616,5,6232,5,6880,5,7560,5,8272,5,9016,5,9792,5,10600,5,11440,5,12312,5,13216,5,14152,5,15120,5,16120,5,17152,5,18216,5,19312,5,20440,5,21600,5,22792,5,24016,5,25272,5,26560,5,27880,5,29232,5,30616,5,32032,5,33480,5,34960,5,36472,5,38016,5,39592
mov $1,$0
mul $0,2
sub $1,1
mod $1,2
mov $3,2
mov $4,2
mul $4,$0
lpb $1
mov $0,4
sub $1,1
mov $3,1
mov $4,0
lpe
pow $0,$3
mov $1,$4
add $1,1
mov $2,9
trn $2,$4
add $0,$2
add $0,$1
sub $0,9
|
/*
* Copyright (c) 2018 Samsung Electronics Co., Ltd. All 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.
*/
#include <NeuralNetworks.h>
#include <new>
#include "wrapper/ANeuralNetworksModel.h"
#include "wrapper/ANeuralNetworksCompilation.h"
#include "util/logging.h"
//
// NNAPI Implementation
//
int ANeuralNetworksCompilation_create(ANeuralNetworksModel *model,
ANeuralNetworksCompilation **compilation)
{
if ((model == nullptr) || (compilation == nullptr))
{
VERBOSE(NNAPI::Compilation) << "create: Incorrect null pointer parameter(s)" << std::endl;
return ANEURALNETWORKS_UNEXPECTED_NULL;
}
if (!model->isFinished())
{
VERBOSE(NNAPI::Compilation) << "create: Model define is not finished" << std::endl;
return ANEURALNETWORKS_BAD_STATE;
}
std::shared_ptr<onert::ir::Graph> internal;
model->release(internal);
*compilation = new (std::nothrow) ANeuralNetworksCompilation(internal);
if (*compilation == nullptr)
{
VERBOSE(NNAPI::Compilation) << "create: ail to create compilation object" << std::endl;
return ANEURALNETWORKS_OUT_OF_MEMORY;
}
return ANEURALNETWORKS_NO_ERROR;
}
int ANeuralNetworksCompilation_finish(ANeuralNetworksCompilation *compilation)
{
if (compilation == nullptr)
{
VERBOSE(NNAPI::Compilation) << "finish: Incorrect null pointer parameter" << std::endl;
return ANEURALNETWORKS_UNEXPECTED_NULL;
}
if (compilation->state() != ::onert::compiler::State::CREATED)
{
VERBOSE(NNAPI::Compilation) << "finish: Already finished" << std::endl;
return ANEURALNETWORKS_BAD_STATE;
}
if (!compilation->finish())
{
VERBOSE(NNAPI::Compilation) << "finish: Fail to compile" << std::endl;
return ANEURALNETWORKS_BAD_STATE;
}
return ANEURALNETWORKS_NO_ERROR;
}
void ANeuralNetworksCompilation_free(ANeuralNetworksCompilation *compilation)
{
delete compilation;
}
int ANeuralNetworksCompilation_setPreference(ANeuralNetworksCompilation *compilation,
int32_t preference)
{
if (compilation == nullptr)
{
VERBOSE(NNAPI::Compilation) << "setPreference: Incorrect null pointer parameter" << std::endl;
return ANEURALNETWORKS_UNEXPECTED_NULL;
}
if (compilation->state() != ::onert::compiler::State::CREATED)
{
VERBOSE(NNAPI::Compilation) << "setPreference: Already finished" << std::endl;
return ANEURALNETWORKS_BAD_STATE;
}
const PreferenceCode FIRST_PREFERENCE_CODE = ANEURALNETWORKS_PREFER_LOW_POWER;
const PreferenceCode LAST_PREFERENCE_CODE = ANEURALNETWORKS_PREFER_SUSTAINED_SPEED;
if ((preference < FIRST_PREFERENCE_CODE) || (preference > LAST_PREFERENCE_CODE))
{
VERBOSE(NNAPI::Compilation) << "setPreference: Incorrect preference code" << std::endl;
return ANEURALNETWORKS_BAD_DATA;
}
// NYI: nothing to set
return ANEURALNETWORKS_NO_ERROR;
}
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r8
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x25e4, %rdx
nop
add $40472, %r13
mov (%rdx), %bp
nop
nop
nop
cmp $285, %r8
lea addresses_WC_ht+0x1ae24, %rsi
lea addresses_A_ht+0x7058, %rdi
nop
nop
nop
nop
sub %rbp, %rbp
mov $110, %rcx
rep movsw
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_A_ht+0x78e4, %rdx
nop
nop
xor $11971, %rcx
movl $0x61626364, (%rdx)
nop
nop
nop
nop
sub $57107, %rcx
lea addresses_normal_ht+0x3302, %rdi
nop
cmp $51967, %rsi
mov (%rdi), %ecx
nop
and $22011, %rbp
lea addresses_UC_ht+0x16ce4, %rsi
lea addresses_D_ht+0x23e4, %rdi
nop
nop
nop
nop
nop
cmp %r12, %r12
mov $59, %rcx
rep movsq
nop
sub $50682, %r13
lea addresses_A_ht+0x190e4, %rdi
nop
nop
nop
nop
nop
dec %rdx
mov $0x6162636465666768, %rcx
movq %rcx, %xmm0
and $0xffffffffffffffc0, %rdi
vmovaps %ymm0, (%rdi)
nop
inc %r8
lea addresses_normal_ht+0x16e4, %rbp
nop
nop
nop
nop
nop
and %rsi, %rsi
mov $0x6162636465666768, %rdx
movq %rdx, (%rbp)
nop
nop
nop
nop
nop
dec %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %rax
push %rbp
push %rbx
push %rdi
push %rdx
// Faulty Load
lea addresses_normal+0x198e4, %rdx
clflush (%rdx)
nop
nop
nop
nop
dec %rdi
movups (%rdx), %xmm0
vpextrq $1, %xmm0, %rax
lea oracles, %rbx
and $0xff, %rax
shlq $12, %rax
mov (%rbx,%rax,1), %rax
pop %rdx
pop %rdi
pop %rbx
pop %rbp
pop %rax
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_normal', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 2, 'NT': True, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WC_ht', 'congruent': 3}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 2}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': True, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_UC_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 8}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': True, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 8}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
|
;;
;; Copyright (C) Manas Kamal Choudhury 2021
;;
;; _low_level.asm -- Machine Level assembly codes
;; for x86_64
;;
;; /PROJECT -- Aurora v1.0 {Xeneva}
;; /AUTHOR -- Manas Kamal Choudhury
;;
;; ===========================================================
;;
section .text
[BITS 64]
;----------------------------------------
; Port functions
;----------------------------------------
global x64_inportb
x64_inportb:
mov dx, cx
in al, dx
ret
global x64_inportw
x64_inportw:
mov dx, cx
in ax, dx
ret
global x64_inportd
x64_inportd:
mov dx, cx
in eax, dx
ret
global x64_outportb
x64_outportb:
mov al, dl
mov dx, cx
out dx, al
ret
global x64_outportw
x64_outportw:
mov ax, dx
mov dx, cx
out dx, ax
ret
global x64_outportd
x64_outportd:
mov eax, edx
mov dx, cx
out dx, eax
ret
;-------------------------------------------------------
; MSR functions
;-------------------------------------------------------
global x64_read_msr
x64_read_msr:
rdmsr
shl rdx, 32
or rax, rdx
ret
global x64_write_msr
x64_write_msr:
mov rax, rdx
shr rdx, 32
wrmsr
ret
;---------------------------------------------------------
; Control Register functions
;---------------------------------------------------------
global x64_read_cr0
x64_read_cr0:
mov rax, cr0
ret
global x64_write_cr0
x64_write_cr0:
mov cr0, rcx
ret
global x64_read_cr2
x64_read_cr2:
mov rax, cr2
ret
global x64_read_cr3
x64_read_cr3:
mov rax, cr3
ret
global x64_read_cr4
x64_read_cr4:
mov rax, cr4
ret
global x64_write_cr3
x64_write_cr3:
mov cr3, rcx
ret
;----------------------------------------------------------
; Segments functions
;----------------------------------------------------------
global x64_get_segment_register
x64_get_segment_register:
and rcx, 0x7
mov rdx, .jmp_tab
add rdx, rcx
add rdx, rcx
jmp rdx
.jmp_tab:
jmp short .cs
jmp short .ds
jmp short .es
jmp short .fs
jmp short .gs
jmp short .ss
jmp short .invalid
jmp short .invalid
.cs:
mov ax, cs
ret
.ds:
mov ax, ds
ret
.es:
mov ax, es
ret
.fs:
mov ax, fs
ret
.gs:
mov ax, gs
ret
.ss:
mov ax, ss
ret
.invalid:
xor ax, ax
ret
global x64_set_segment_register
x64_set_segment_register:
and rcx, 0x7
mov r8, .jmp_tab
add r8, rcx
add r8, rcx
jmp r8
.jmp_tab:
jmp short .cs
jmp short .ds
jmp short .es
jmp short .fs
jmp short .gs
jmp short .ss
jmp short .invalid
jmp short .invalid
.cs:
;mov cs, dx //that's too easy, isn't it?
pop rax
push rdx
push rax
db 0x48 ;REX.W
retf
.ds:
mov ds, dx
ret
.es:
mov es, dx
ret
.fs:
mov fs, dx
ret
.gs:
mov gs, dx
ret
.ss:
mov ss, dx
ret
.invalid:
xor ax, ax
ret
;--------------------------------------------------
; Interrupt flags
;--------------------------------------------------
global x64_cli
x64_cli:
cli
ret
global x64_sti
x64_sti:
sti
ret
;=====================================================
; GDT & IDT
;=====================================================
global x64_sgdt
x64_sgdt:
sgdt [rcx]
ret
global x64_lgdt
x64_lgdt:
lgdt [rcx]
ret
global x64_sidt
x64_sidt:
sidt [rcx]
ret
global x64_lidt
x64_lidt:
lidt [rcx]
ret
global x64_idt_test
x64_idt_test:
mov r12,0
syscall
ret
;======================================================
;; TSS
;;=====================================================
global x64_ltr
x64_ltr:
ltr cx
ret
;;=======================================================
; MFENCE
;;=======================================================
global x64_mfence
x64_mfence:
mfence
ret
;=========================================================
; CPUID
;=========================================================
global x64_cpuid
x64_cpuid:
push rbp
mov rbp, rsp
push rbx
mov rax, rcx
mov r10, rdx
mov rcx, [rbp+56]
cpuid
mov [r10], rax
mov [r8], rbx
mov [r9], rcx
mov r11, [rbp+48]
mov [r11], rdx
pop rbx
pop rbp
ret
;=====================================
; TLB FLUSH
;=====================================
global flush_tlb
flush_tlb:
invlpg [rcx]
ret
global cache_flush
cache_flush:
wbinvd
ret
;======================================
; STACK FUNCTIONS
;======================================
;global x64_get_stack
;x64_get_stack:
;mov rax, rsp
; ret
global x64_hlt
x64_hlt:
hlt
ret
global x64_atom_exchange
x64_atom_exchange:
xchg rcx, rdx
hlt
ret
global x64_sse_test
x64_sse_test:
mov rbx, 10
movaps xmm0, [rbx]
ret
|
#include "classifier.h"
#include <math.h>
#include <string>
#include <vector>
using Eigen::ArrayXd;
using std::string;
using std::vector;
// Initializes GNB
GNB::GNB() {
/**
* TODO: Initialize GNB, if necessary. May depend on your implementation.
*/
left_means = ArrayXd(4);
left_means << 0,0,0,0;
left_sds = ArrayXd(4);
left_sds << 0,0,0,0;
left_prior = 0;
keep_means = ArrayXd(4);
keep_means << 0,0,0,0;
keep_sds = ArrayXd(4);
keep_sds << 0,0,0,0;
keep_prior = 0;
right_means = ArrayXd(4);
right_means << 0,0,0,0;
right_sds = ArrayXd(4);
right_sds << 0,0,0,0;
right_prior = 0;
}
GNB::~GNB() {}
void GNB::train(const vector<vector<double>> &data,
const vector<string> &labels) {
/**
* Trains the classifier with N data points and labels.
* @param data - array of N observations
* - Each observation is a tuple with 4 values: s, d, s_dot and d_dot.
* - Example : [[3.5, 0.1, 5.9, -0.02],
* [8.0, -0.3, 3.0, 2.2],
* ...
* ]
* @param labels - array of N labels
* - Each label is one of "left", "keep", or "right".
*
* TODO: Implement the training function for your classifier.
*/
/*
From lecture: Training a Gaussian Naive Bayes classifier consists of computing and storing the mean and standard deviation from the data for each label/feature pair. For example, given the label "change lanes left” and the feature s_dot, it would be necessary to compute and store the mean and standard deviation of s_dot over all data points with the "change lanes left” label.
Planning:
- for each label/feature pair:
1. computing mean and stdDev
2. storing mean and stdDev
Steps
- group training data into three vectors: "left","keep","right"
- for each vecotor, the element will be a tuple with 4 values: s, d, s_dot and d_dot
- to use any libary functions to calcuate the mean and stdDev for each feature, respectively.
*/
// For each label, compute ArrayXd of means, one for each data class
// (s, d, s_dot, d_dot).
// These will be used later to provide distributions for conditional
// probabilites.
// Means are stored in an ArrayXd of size 4.
float left_size = 0;
float keep_size = 0;
float right_size = 0;
// For each label, compute the numerators of the means for each class
// and the total number of data points given with that label.
for (int i=0; i<labels.size(); ++i) {
if (labels[i] == "left") {
// conversion of data[i] to ArrayXd
left_means += ArrayXd::Map(data[i].data(), data[i].size());
left_size += 1;
} else if (labels[i] == "keep") {
keep_means += ArrayXd::Map(data[i].data(), data[i].size());
keep_size += 1;
} else if (labels[i] == "right") {
right_means += ArrayXd::Map(data[i].data(), data[i].size());
right_size += 1;
}
}
// Compute the means. Each result is a ArrayXd of means
// (4 means, one for each class)
left_means = left_means/left_size;
keep_means = keep_means/keep_size;
right_means = right_means/right_size;
// Begin computation of standard deviations for each class/label combination.
ArrayXd data_point;
// Compute numerators of the standard deviations.
for (int i=0; i<labels.size(); ++i) {
data_point = ArrayXd::Map(data[i].data(), data[i].size());
if (labels[i] == "left"){
left_sds += (data_point - left_means)*(data_point - left_means);
} else if (labels[i] == "keep") {
keep_sds += (data_point - keep_means)*(data_point - keep_means);
} else if (labels[i] == "right") {
right_sds += (data_point - right_means)*(data_point - right_means);
}
}
// compute standard deviations
left_sds = (left_sds/left_size).sqrt();
keep_sds = (keep_sds/keep_size).sqrt();
right_sds = (right_sds/right_size).sqrt();
//Compute the probability of each label
left_prior = left_size/labels.size();
keep_prior = keep_size/labels.size();
right_prior = right_size/labels.size();
}
string GNB::predict(const vector<double> &sample) {
/**
* Once trained, this method is called and expected to return
* a predicted behavior for the given observation.
* @param observation - a 4 tuple with s, d, s_dot, d_dot.
* - Example: [3.5, 0.1, 8.5, -0.2]
* @output A label representing the best guess of the classifier. Can
* be one of "left", "keep" or "right".
*
* TODO: Complete this function to return your classifier's prediction
*/
// Calculate product of conditional probabilities for each label.
double left_p = 1.0;
double keep_p = 1.0;
double right_p = 1.0;
for (int i=0; i<4; ++i) {
left_p *= (1.0/sqrt(2.0 * M_PI * pow(left_sds[i], 2)))
* exp(-0.5*pow(sample[i] - left_means[i], 2)/pow(left_sds[i], 2));
keep_p *= (1.0/sqrt(2.0 * M_PI * pow(keep_sds[i], 2)))
* exp(-0.5*pow(sample[i] - keep_means[i], 2)/pow(keep_sds[i], 2));
right_p *= (1.0/sqrt(2.0 * M_PI * pow(right_sds[i], 2)))
* exp(-0.5*pow(sample[i] - right_means[i], 2)/pow(right_sds[i], 2));
}
// Multiply each by the prior
left_p *= left_prior;
keep_p *= keep_prior;
right_p *= right_prior;
double probs[3] = {left_p, keep_p, right_p};
double max = left_p;
double max_index = 0;
for (int i=1; i<3; ++i) {
if (probs[i] > max) {
max = probs[i];
max_index = i;
}
}
return this -> possible_labels[max_index];
}
|
;;
;; Copyright (c) 2020-2021, 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 NUM_LANES 8
%define AES_CBC_ENC_X4 aes_cbc_enc_256_x8_sse
%define FLUSH_JOB_AES_ENC flush_job_aes256_enc_x8_sse
%include "sse/mb_mgr_aes128_cbc_enc_flush_x4_sse.asm"
|
/*=========================================================================
*
* Copyright NumFOCUS
*
* 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.txt
*
* 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.
*
*=========================================================================*/
// Software Guide : BeginLatex
//
// This example illustrates the use of the
// \doxygen{GaussianSpatialObjects} for composing complex smoothed shapes by
// aggregating them in a group. This process is equivalent to what is called
// ''MetaBalls'' in Computer Graphics.
//
// See http://en.wikipedia.org/wiki/Metaballs
//
//
// \index{itk::SpatialObjectToImageFilter|textbf}
//
// Software Guide : EndLatex
// Software Guide : BeginLatex
//
// We include the header file of the SpatialObjectToImageFilter since we will
// use it to rasterize the group of spatial objects into an image.
//
// \index{itk::SpatialObjectToImageFilter!header}
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
#include "itkSpatialObjectToImageFilter.h"
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Then we include the header of the GaussianSpatialObject that we will use
// as elementary shape.
//
// \index{itk::GaussianSpatialObject!header}
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
#include "itkGaussianSpatialObject.h"
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Then we include the header of the \doxygen{GroupSpatialObject} that will
// group together these instances of SpatialObjects.
//
// \index{itk::GroupSpatialObject!header}
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
#include "itkGroupSpatialObject.h"
// Software Guide : EndCodeSnippet
#include "itkImageFileWriter.h"
int
main(int argc, char * argv[])
{
if (argc != 2)
{
std::cerr << "Usage: " << argv[0] << " outputimagefile " << std::endl;
return EXIT_FAILURE;
}
// Software Guide : BeginLatex
//
// We declare the pixel type and dimension of the image to be produced as
// output.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
using PixelType = signed short;
constexpr unsigned int Dimension = 3;
using ImageType = itk::Image<PixelType, Dimension>;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Using the same dimension, we instantiate the types of the elementary
// SpatialObjects that we plan to group, and we instantiate as well the
// type of the SpatialObject that will hold the group together.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
using MetaBallType = itk::GaussianSpatialObject<Dimension>;
using GroupType = itk::GroupSpatialObject<Dimension>;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We instantiate the SpatialObjectToImageFilter type by using as template
// arguments the input SpatialObject and the output image types.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
using SpatialObjectToImageFilterType =
itk::SpatialObjectToImageFilter<GroupType, ImageType>;
auto imageFilter = SpatialObjectToImageFilterType::New();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The SpatialObjectToImageFilter requires that the user defines the grid
// parameters of the output image. This includes the number of pixels along
// each dimension, the pixel spacing, image direction and
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
ImageType::SizeType size;
size[0] = 50;
size[1] = 50;
size[2] = 200;
imageFilter->SetSize(size);
// Software Guide : EndCodeSnippet
// Software Guide : BeginCodeSnippet
ImageType::SpacingType spacing;
spacing[0] = 100.0 / size[0];
spacing[1] = 100.0 / size[1];
spacing[2] = 400.0 / size[2];
imageFilter->SetSpacing(spacing);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We create the elementary shapes that are going to be composed into the
// group spatial objects.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
auto metaBall1 = MetaBallType::New();
auto metaBall2 = MetaBallType::New();
auto metaBall3 = MetaBallType::New();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The Elementary shapes have internal parameters of their own. These
// parameters define the geometrical characteristics of the basic shapes.
// For example, a cylinder is defined by its radius and height.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
metaBall1->SetRadiusInObjectSpace(size[0] * spacing[0] * 0.2);
metaBall2->SetRadiusInObjectSpace(size[0] * spacing[0] * 0.2);
metaBall3->SetRadiusInObjectSpace(size[0] * spacing[0] * 0.2);
// Software Guide : EndCodeSnippet
metaBall1->SetMaximum(1000.0);
metaBall2->SetMaximum(1000.0);
metaBall3->SetMaximum(1000.0);
// Software Guide : BeginLatex
//
// Each one of these components will be placed in a different position and
// orientation. We define transforms in order to specify those relative
// positions and orientations.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
using TransformType = GroupType::TransformType;
auto transform1 = TransformType::New();
auto transform2 = TransformType::New();
auto transform3 = TransformType::New();
transform1->SetIdentity();
transform2->SetIdentity();
transform3->SetIdentity();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Then we set the specific values of the transform parameters, and we
// assign the transforms to the elementary shapes.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
TransformType::OutputVectorType translation;
translation[0] = size[0] * spacing[0] / 2.0;
translation[1] = size[1] * spacing[1] / 4.0;
translation[2] = size[2] * spacing[2] / 2.0;
transform1->Translate(translation, false);
translation[1] = size[1] * spacing[1] / 2.0;
translation[2] = size[2] * spacing[2] * 0.22;
transform2->Rotate(1, 2, itk::Math::pi / 2.0);
transform2->Translate(translation, false);
translation[2] = size[2] * spacing[2] * 0.78;
transform3->Rotate(1, 2, itk::Math::pi / 2.0);
transform3->Translate(translation, false);
metaBall1->SetObjectToParentTransform(transform1);
metaBall2->SetObjectToParentTransform(transform2);
metaBall3->SetObjectToParentTransform(transform3);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The elementary shapes are aggregated in a parent group, that in turn is
// passed as input to the filter.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
auto group = GroupType::New();
group->AddChild(metaBall1);
group->AddChild(metaBall2);
group->AddChild(metaBall3);
metaBall1->Update();
metaBall2->Update();
metaBall3->Update();
imageFilter->SetInput(group);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// By default, the filter will rasterize the aggregation of elementary
// shapes and will assign a pixel value to locations that fall inside of
// any of the elementary shapes, and a different pixel value to locations
// that fall outside of all of the elementary shapes. In this case, we
// actually want the values of the Gaussians (MetaBalls) to be used in
// order produce the equivalent of a smooth fusion effect among the shapes.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
const PixelType airHounsfieldUnits = -1000;
imageFilter->SetUseObjectValue(true);
imageFilter->SetOutsideValue(airHounsfieldUnits);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Finally we are ready to run the filter. We use the typical invocation of
// the \code{Update} method, and we instantiate an \code{ImageFileWriter}
// in order to save the generated image into a file.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
using WriterType = itk::ImageFileWriter<ImageType>;
auto writer = WriterType::New();
writer->SetFileName(argv[1]);
writer->SetInput(imageFilter->GetOutput());
try
{
imageFilter->Update();
writer->Update();
}
catch (const itk::ExceptionObject & excp)
{
std::cerr << excp << std::endl;
return EXIT_FAILURE;
}
// Software Guide : EndCodeSnippet
return EXIT_SUCCESS;
}
|
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1a7d1, %rsi
lea addresses_A_ht+0xad84, %rdi
nop
nop
nop
nop
nop
dec %r9
mov $43, %rcx
rep movsw
dec %rax
lea addresses_A_ht+0x1a94c, %r13
nop
nop
nop
nop
sub %r12, %r12
movw $0x6162, (%r13)
add $21942, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %r9
push %rbx
push %rcx
push %rdx
push %rsi
// Store
lea addresses_WT+0x131aa, %r15
add %rcx, %rcx
movw $0x5152, (%r15)
nop
nop
nop
nop
nop
and %r9, %r9
// Load
lea addresses_PSE+0x12d84, %rdx
nop
nop
nop
nop
cmp %rsi, %rsi
mov (%rdx), %cx
nop
nop
sub $32707, %r15
// Load
mov $0x318660000000904, %rsi
cmp $35, %rbx
movups (%rsi), %xmm7
vpextrq $1, %xmm7, %r10
sub %r9, %r9
// Store
lea addresses_WC+0x1b83c, %r9
nop
nop
nop
inc %rbx
movw $0x5152, (%r9)
nop
nop
nop
nop
and %r15, %r15
// Faulty Load
lea addresses_D+0x1304, %rcx
nop
dec %r9
mov (%rcx), %r15d
lea oracles, %rcx
and $0xff, %r15
shlq $12, %r15
mov (%rcx,%r15,1), %r15
pop %rsi
pop %rdx
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': True, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 1}}
{'src': {'type': 'addresses_PSE', 'AVXalign': False, 'size': 2, 'NT': True, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}}
[Faulty Load]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 4, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 3}}
{'36': 58}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
|
; A016954: a(n) = (6n+3)^10.
; 59049,3486784401,576650390625,16679880978201,205891132094649,1531578985264449,8140406085191601,34050628916015625,119042423827613001,362033331456891249,984930291881790849,2446194060654759801,5631351470947265625,12157665459056928801,24842341419143568849,48398230717929318249,90438207500880449001,162889462677744140625,283942098606901565601,480682838924478847449,792594609605189126649,1276136419117121619201,2010655586861806640625,3105926159393528563401,4711653532607691047049,7029336084596720096049,10326930237613180030401,14956826027973134765625,21377706189197971362201,30180933165649574087649,42122185590781554706449,58159148805327867842601,79496153175699228515625,107636749520976961802001,144445313087602911489249,192218876443582475037849,253770507618165375615801,332525673007965087890625,432633155225742562122801,559092234403032700371849,717897987691852588770249,916206716063318440310001,1162523670191533212890625,1466915418459008596964601,1841249380144573175455449,2299463235875612705183649,2857867125663008313285201,3535481752508703603515625,4354415726901861885367401,5340285714719489633060049,6522683188340621511158049,7935691828389105528301401,9618459881658113759765625,11615832049659154272771201,13979045762098993055105649,16766496980638930547173449,20044580980751735469518601,23888613873581638681640625,28383840955651551463016001,33626538312268515533112249,39725214450772735983309849,46801919102576812739496801,54993666708469390869140625,64453982490130814650341801,75354579412446914492199849,87887174756230199195247249,102265455449584888327196001,118727201748602820322265625,137536579314570730951388601,158986610205625133715088449,183401833786028468140265649,211141169056178733575976201,242600990421323914541015625,278218429446951548637196401,318474915694182209166098049,363899970289432891533245049,415075266459351724951597401,472638971854778498525390625,537290388096475613165205201,609794903600820667615148649,690989276385774377822665449,781787264216455333610219601,883185620125785634775390625,996270472039138140011255001,1122224105942936326061760249,1262332172765951010966606849,1417991339888823863766402801,1590717408962345123291015625,1782153922498441700301585801,1994081282499911259959052849,2228426405215887395008749249,2487272936950060023861107001,2772872056708023101572265625,3087653892348998035244837601,3434239577805805268237746449,3815453979855547759454372649,4234339123862247954529692201,4694168348871863744619140625,5198461223419918255364050401,5750999254412632523130161049
mul $0,6
add $0,3
pow $0,10
|
global _rotateLeft ; uint32_t rotateLeft(uint32_t value, uint32_t count)
global _rotateRight ; uint32_t rotateRight(uint32_t value, uint32_t count)
segment .text align=16
_rotateLeft:
mov eax, edi
mov ecx, esi
rol eax, cl
ret
_rotateRight:
mov eax, edi
mov ecx, esi
ror eax, cl
ret |
;; z28r asm
;; system font for MegaMicro
data font
;; \x80
0b00000000
0b00000000
0b00000000
0b00011000
0b00011000
0b00000000
0b00000000
0b00000000
;; \x81
0b00000000
0b00000000
0b00000000
0b00000000
0b00001111
0b00001111
0b00001111
0b00001111
;; \x82
0b00000000
0b00000000
0b00000000
0b00000000
0b11110000
0b11110000
0b11110000
0b11110000
;; \x83
0b00000000
0b00000000
0b00000000
0b00000000
0b11111111
0b11111111
0b11111111
0b11111111
;; \x84
0b00001111
0b00001111
0b00001111
0b00001111
0b00000000
0b00000000
0b00000000
0b00000000
;; \x85
0b00001111
0b00001111
0b00001111
0b00001111
0b00001111
0b00001111
0b00001111
0b00001111
;; \x86
0b00001111
0b00001111
0b00001111
0b00001111
0b11110000
0b11110000
0b11110000
0b11110000
;; \x87
0b11110000
0b11110000
0b11110000
0b11110000
0b00000000
0b00000000
0b00000000
0b00000000
;; \x88
0b00000000
0b00000000
0b00000000
0b00001111
0b00001111
0b00011000
0b00011000
0b00011000
;; \x89
0b00000000
0b00000000
0b00000000
0b11110000
0b11110000
0b00011000
0b00011000
0b00011000
;; \x8a
0b00011000
0b00011000
0b00011000
0b00011111
0b00001111
0b00000000
0b00000000
0b00000000
;; \x8b
0b00011000
0b00011000
0b00011000
0b11111000
0b11110000
0b00000000
0b00000000
0b00000000
;; \x8c
0b00011000
0b00011000
0b00011000
0b11111111
0b11100111
0b00000000
0b00000000
0b00000000
;; \x8d
0b00011000
0b00011000
0b00011000
0b00001111
0b00001111
0b00011000
0b00011000
0b00011000
;; \x8e
0b00000000
0b00000000
0b00000000
0b11100111
0b11111111
0b00011000
0b00011000
0b00011000
;; \x8f
0b00011000
0b00011000
0b00011000
0b11110000
0b11110000
0b00011000
0b00011000
0b00011000
;; \x90
0b00011000
0b00011000
0b00011000
0b00011000
0b00011000
0b00011000
0b00011000
0b00011000
;; \x91
0b00000000
0b00000000
0b00000000
0b11111111
0b11111111
0b00000000
0b00000000
0b00000000
;; \x92
0b00011000
0b00011000
0b00111100
0b11111111
0b11111111
0b00111100
0b00011000
0b00011000
;; \x93
0b11000011
0b11100111
0b01111110
0b00111100
0b00111100
0b01111110
0b11100111
0b11000011
;; \x94
0b00000011
0b00000111
0b00001110
0b00011100
0b00111000
0b01110000
0b11100000
0b11000000
;; \x95
0b11000000
0b11100000
0b01110000
0b00111000
0b00011100
0b00001110
0b00000111
0b00000011
;; \x96
0b00000001
0b00000011
0b00000111
0b00001111
0b00001111
0b00011111
0b00111111
0b01111111
;; \x97
0b10000000
0b11000000
0b11100000
0b11110000
0b11110000
0b11111000
0b11111100
0b11111110
;; \x98
0b01111100
0b10000010
0b10000010
0b10000010
0b10000010
0b10000010
0b01111100
0b00000000
;; \x99
0b00000000
0b00000110
0b00001100
0b00001100
0b11011000
0b01111000
0b00110000
0b00000000
;; \x9a
0b01111100
0b11010110
0b11010110
0b11111110
0b11101110
0b11010110
0b01111100
0b00000000
;; \x9b
0b01111100
0b11010110
0b11010110
0b11111110
0b10111010
0b11000110
0b01111100
0b00000000
;; \x9c
0b00000000
0b01101100
0b11111110
0b11111110
0b01111100
0b00111000
0b00010000
0b00000000
;; \x9d
0b00010000
0b00111000
0b01111100
0b11111110
0b01010100
0b00010000
0b00111000
0b00000000
;; \x9e
0b00010000
0b00111000
0b01111100
0b11111110
0b01111100
0b00111000
0b00010000
0b00000000
;; \x9f
0b00111000
0b00111000
0b00111000
0b11111110
0b11111110
0b00010000
0b00111000
0b00000000
;; space
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
;; !
0b00010000
0b00010000
0b00010000
0b00010000
0b00010000
0b00000000
0b00010000
0b00000000
;; "
0b01000100
0b01000100
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
;; #
0b00100100
0b01111110
0b00100100
0b00100100
0b00100100
0b01111110
0b00100100
0b00000000
;; $
0b00010000
0b00111100
0b01000000
0b00111000
0b00000100
0b01111000
0b00010000
0b00000000
;; %
0b01000010
0b10100100
0b01001000
0b00010000
0b00100100
0b01001010
0b10000100
0b00000000
;; &
0b00011100
0b00100010
0b00100100
0b00011000
0b00100101
0b01000010
0b00111101
0b00000000
;; '
0b00001000
0b00001000
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
;; (
0b00001000
0b00010000
0b00100000
0b00100000
0b00100000
0b00010000
0b00001000
0b00000000
;; )
0b00010000
0b00001000
0b00000100
0b00000100
0b00000100
0b00001000
0b00010000
0b00000000
;; *
0b00010000
0b01010100
0b00111000
0b01010100
0b00010000
0b00000000
0b00000000
0b00000000
;; +
0b00000000
0b00010000
0b00010000
0b01111100
0b00010000
0b00010000
0b00000000
0b00000000
;; ,
0b00000000
0b00000000
0b00000000
0b00000000
0b00001000
0b00001000
0b00010000
0b00000000
;; -
0b00000000
0b00000000
0b00000000
0b01111110
0b00000000
0b00000000
0b00000000
0b00000000
;; .
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
0b00010000
0b00000000
;; /
0b00000010
0b00000100
0b00001000
0b00010000
0b00100000
0b01000000
0b10000000
0b00000000
;; 0
0b00111000
0b01000100
0b01000100
0b01000100
0b01000100
0b01000100
0b00111000
0b00000000
;; 1
0b00010000
0b00110000
0b00010000
0b00010000
0b00010000
0b00010000
0b01111100
0b00000000
;; 2
0b00111000
0b01000100
0b00000100
0b00011000
0b00100000
0b01000000
0b01111100
0b00000000
;; 3
0b00111000
0b01000100
0b00000100
0b00011000
0b00000100
0b01000100
0b00111000
0b00000000
;; 4
0b00011000
0b00101000
0b01001000
0b01001000
0b01111100
0b00001000
0b00001000
0b00000000
;; 5
0b01111100
0b01000000
0b01111000
0b00000100
0b00000100
0b01000100
0b00111000
0b00000000
;; 6
0b00111000
0b01000100
0b01000000
0b01111000
0b01000100
0b01000100
0b00111000
0b00000000
;; 7
0b01111100
0b00000100
0b00001000
0b00010000
0b00010000
0b00010000
0b00010000
0b00000000
;; 8
0b00111000
0b01000100
0b01000100
0b00111000
0b01000100
0b01000100
0b00111000
0b00000000
;; 9
0b00111000
0b01000100
0b01000100
0b00111100
0b00000100
0b01000100
0b00111000
0b00000000
;; :
0b00000000
0b00010000
0b00000000
0b00000000
0b00010000
0b00000000
0b00000000
0b00000000
;; ;
0b00000000
0b00001000
0b00000000
0b00000000
0b00001000
0b00010000
0b00000000
0b00000000
;; <
0b00000100
0b00001000
0b00010000
0b00100000
0b00010000
0b00001000
0b00000100
0b00000000
;; =
0b00000000
0b00000000
0b01111110
0b00000000
0b01111110
0b00000000
0b00000000
0b00000000
;; >
0b00010000
0b00001000
0b00000100
0b00000010
0b00000100
0b00001000
0b00010000
0b00000000
;; ?
0b00111000
0b01000100
0b00000100
0b00011000
0b00010000
0b00000000
0b00010000
0b00000000
;; @
0b00111100
0b01000010
0b10011001
0b10100101
0b10100101
0b10011110
0b01000000
0b00111100
;; A
0b00010000
0b00101000
0b00101000
0b01000100
0b01111100
0b10000010
0b10000010
0b00000000
;; B
0b11111100
0b10000010
0b10000010
0b11111100
0b10000010
0b10000010
0b11111100
0b00000000
;; C
0b01111100
0b10000010
0b10000000
0b10000000
0b10000000
0b10000010
0b01111100
0b00000000
;; D
0b11111100
0b10000010
0b10000010
0b10000010
0b10000010
0b10000010
0b11111100
0b00000000
;; E
0b11111110
0b10000000
0b10000000
0b11111000
0b10000000
0b10000000
0b11111110
0b00000000
;; F
0b11111110
0b10000000
0b10000000
0b11111000
0b10000000
0b10000000
0b10000000
0b00000000
;; G
0b01111100
0b10000010
0b10000000
0b10001110
0b10000010
0b10000010
0b01111100
0b00000000
;; H
0b10000010
0b10000010
0b10000010
0b11111110
0b10000010
0b10000010
0b10000010
0b00000000
;; I
0b01111100
0b00010000
0b00010000
0b00010000
0b00010000
0b00010000
0b01111100
0b00000000
;; J
0b00000010
0b00000010
0b00000010
0b00000010
0b00000010
0b10000010
0b01111100
0b00000000
;; K
0b10000010
0b10000100
0b10001000
0b11110000
0b10001000
0b10000100
0b10000010
0b00000000
;; L
0b10000000
0b10000000
0b10000000
0b10000000
0b10000000
0b10000000
0b11111110
0b00000000
;; M
0b10000010
0b11000110
0b10101010
0b10010010
0b10000010
0b10000010
0b10000010
0b00000000
;; N
0b10000010
0b11000010
0b10100010
0b10010010
0b10001010
0b10000110
0b10000010
0b00000000
;; O
0b01111100
0b10000010
0b10000010
0b10000010
0b10000010
0b10000010
0b01111100
0b00000000
;; P
0b11111100
0b10000010
0b10000010
0b10000010
0b11111100
0b10000000
0b10000000
0b00000000
;; Q
0b01111100
0b10000010
0b10000010
0b10000010
0b10000010
0b10001010
0b01111100
0b00000010
;; R
0b11111100
0b10000010
0b10000010
0b11111100
0b10000100
0b10000010
0b10000010
0b00000000
;; S
0b01111100
0b10000010
0b10000000
0b01111100
0b00000010
0b10000010
0b01111100
0b00000000
;; T
0b11111110
0b00010000
0b00010000
0b00010000
0b00010000
0b00010000
0b00010000
0b00000000
;; U
0b10000010
0b10000010
0b10000010
0b10000010
0b10000010
0b10000010
0b01111100
0b00000000
;; V
0b10000010
0b10000010
0b10000010
0b10000010
0b01000100
0b00101000
0b00010000
0b00000000
;; W
0b10000010
0b10000010
0b10010010
0b10010010
0b10010010
0b01101100
0b01000100
0b00000000
;; X
0b10000010
0b01000100
0b00101000
0b00010000
0b00101000
0b01000100
0b10000010
0b00000000
;; Y
0b10000010
0b10000010
0b01000100
0b00101000
0b00010000
0b00010000
0b00010000
0b00000000
;; Z
0b11111110
0b00000100
0b00001000
0b00010000
0b00100000
0b01000000
0b11111110
0b00000000
;; [
0b00111000
0b00100000
0b00100000
0b00100000
0b00100000
0b00100000
0b00111000
0b00000000
;; \
0b10000000
0b01000000
0b00100000
0b00010000
0b00001000
0b00000100
0b00000010
0b00000000
;; ]
0b00011100
0b00000100
0b00000100
0b00000100
0b00000100
0b00000100
0b00011100
0b00000000
;; ^
0b00010000
0b00101000
0b01000100
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
;; _
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
0b11111111
;; `
0b00010000
0b00001000
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
0b00000000
;; a
0b00000000
0b00000000
0b00111100
0b00000010
0b00111110
0b01000010
0b00111110
0b00000000
;; b
0b01000000
0b01000000
0b01111100
0b01000010
0b01000010
0b01000010
0b01111100
0b00000000
;; c
0b00000000
0b00000000
0b00111100
0b01000010
0b01000000
0b01000010
0b00111100
0b00000000
;; d
0b00000010
0b00000010
0b00111110
0b01000010
0b01000010
0b01000010
0b00111110
0b00000000
;; e
0b00000000
0b00000000
0b00111100
0b01000010
0b01111100
0b01000000
0b00111110
0b00000000
;; f
0b00001100
0b00010000
0b00111000
0b00010000
0b00010000
0b00010000
0b00010000
0b00000000
;; g
0b00000000
0b00000000
0b00111110
0b01000010
0b01000010
0b00111110
0b00000010
0b00111100
;; h
0b01000000
0b01000000
0b01111100
0b01000010
0b01000010
0b01000010
0b01000010
0b00000000
;; i
0b00010000
0b00000000
0b00110000
0b00010000
0b00010000
0b00010000
0b00111000
0b00000000
;; j
0b00000100
0b00000000
0b00001100
0b00000100
0b00000100
0b00000100
0b01000100
0b00111000
;; k
0b01000000
0b01000000
0b01000010
0b01000100
0b01111000
0b01000100
0b01000010
0b00000000
;; l
0b00110000
0b00010000
0b00010000
0b00010000
0b00010000
0b00010000
0b00010000
0b00000000
;; m
0b00000000
0b00000000
0b11111100
0b10010010
0b10010010
0b10010010
0b10010010
0b00000000
;; n
0b00000000
0b00000000
0b01111100
0b01000010
0b01000010
0b01000010
0b01000010
0b00000000
;; o
0b00000000
0b00000000
0b00111100
0b01000010
0b01000010
0b01000010
0b00111100
0b00000000
;; p
0b00000000
0b00000000
0b01111100
0b01000010
0b01000010
0b01000010
0b01111100
0b01000000
;; q
0b00000000
0b00000000
0b00111110
0b01000010
0b01000010
0b01000010
0b00111110
0b00000010
;; r
0b00000000
0b00000000
0b01011110
0b01100000
0b01000000
0b01000000
0b01000000
0b00000000
;; s
0b00000000
0b00000000
0b00111110
0b01000000
0b00111100
0b00000010
0b01111100
0b00000000
;; t
0b00010000
0b00010000
0b00111000
0b00010000
0b00010000
0b00010000
0b00001100
0b00000000
;; u
0b00000000
0b00000000
0b01000010
0b01000010
0b01000010
0b01000010
0b00111110
0b00000000
;; v
0b00000000
0b00000000
0b01000010
0b01000010
0b01000010
0b00100100
0b00011000
0b00000000
;; w
0b00000000
0b00000000
0b01000001
0b01001001
0b01001001
0b01001001
0b00110110
0b00000000
;; x
0b00000000
0b00000000
0b01000100
0b00101000
0b00010000
0b00101000
0b01000100
0b00000000
;; y
0b00000000
0b00000000
0b01000010
0b01000010
0b01000010
0b00111110
0b00000010
0b00111100
;; z
0b00000000
0b00000000
0b01111100
0b00001000
0b00010000
0b00100000
0b01111100
0b00000000
;; {
0b00001000
0b00010000
0b00010000
0b00100000
0b00010000
0b00010000
0b00001000
0b00000000
;; |
0b00010000
0b00010000
0b00010000
0b00010000
0b00010000
0b00010000
0b00010000
0b00010000
;; }
0b00010000
0b00001000
0b00001000
0b00000100
0b00001000
0b00001000
0b00010000
0b00000000
;; ~
0b00000000
0b00000000
0b01100000
0b10010010
0b00001100
0b00000000
0b00000000
0b00000000
;; DEL
0b00010000
0b00101000
0b01000100
0b11000110
0b01000100
0b01000100
0b01111100
0b00000000
end
|
; A314754: Coordination sequence Gal.5.82.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; 1,5,9,13,19,23,27,33,37,41,46,51,55,59,65,69,73,79,83,87,92,97,101,105,111,115,119,125,129,133,138,143,147,151,157,161,165,171,175,179,184,189,193,197,203,207,211,217,221,225
mov $2,$0
mov $4,$0
lpb $0,1
mov $0,3
mul $0,$2
mov $2,$0
add $0,1
mov $6,$2
add $2,3
add $3,$6
add $6,$2
div $2,$6
add $2,$3
mod $2,10
add $2,3
sub $2,$0
sub $0,$2
div $0,10
lpe
mov $1,$0
add $1,1
mov $5,$4
mul $5,4
add $1,$5
|
rl c
rl b
rl e
rl d
rl l
rl h
rr b
rr c
rr d
rr e
rr h
rr l
sla c
rl b
sla e
rl d
add hl, hl
sli c
rl b
sli e
rl d
sli l
rl h
sli c
rl b
sli e
rl d
sli l
rl h
sra b
rr c
sra d
rr e
sra h
rr l
srl b
rr c
srl d
rr e
srl h
rr l
ld b, b
ld c, c
ld b, d
ld c, e
ld b, h
ld c, l
ld b, ixh
ld c, ixl
ld b, iyh
ld c, iyl
ld c, (hl)
inc hl
ld b, (hl)
dec hl
ld d, b
ld e, c
ld d, d
ld e, e
ld d, h
ld e, l
ld d, ixh
ld e, ixl
ld d, iyh
ld e, iyl
ld e, (hl)
inc hl
ld d, (hl)
dec hl
ld h, b
ld l, c
ld h, d
ld l, e
ld h, h
ld l, l
push ix
pop hl
push iy
pop hl
ld ixh, b
ld ixl, c
ld ixh, d
ld ixl, e
push hl
pop ix
ld ixh, ixh
ld ixl, ixl
push iy
pop ix
ld iyh, b
ld iyl, c
ld iyh, d
ld iyl, e
push hl
pop iy
push ix
pop iy
ld iyh, iyh
ld iyl, iyl
ld (hl), c
inc hl
ld (hl), b
dec hl
ld (hl), e
inc hl
ld (hl), d
dec hl
ld c, (hl)
inc hl
ld b, (hl)
inc hl
ld e, (hl)
inc hl
ld d, (hl)
inc hl
ld (hl), c
inc hl
ld (hl), b
inc hl
ld (hl), e
inc hl
ld (hl), d
inc hl
ld a, (bc)
inc bc
ld a, (de)
inc de
ld a, (hl)
inc hl
ld b, (hl)
inc hl
ld c, (hl)
inc hl
ld d, (hl)
inc hl
ld e, (hl)
inc hl
ld h, (hl)
inc hl
ld l, (hl)
inc hl
ld a, (bc)
dec bc
ld a, (de)
dec de
ld a, (hl)
dec hl
ld b, (hl)
dec hl
ld c, (hl)
dec hl
ld d, (hl)
dec hl
ld e, (hl)
dec hl
ld h, (hl)
dec hl
ld l, (hl)
dec hl
ld (bc), a
inc bc
ld (de), a
inc de
ld (hl), a
inc hl
ld (hl), b
inc hl
ld (hl), c
inc hl
ld (hl), d
inc hl
ld (hl), e
inc hl
ld (hl), h
inc hl
ld (hl), l
inc hl
ld (bc), a
dec bc
ld (de), a
dec de
ld (hl), a
dec hl
ld (hl), b
dec hl
ld (hl), c
dec hl
ld (hl), d
dec hl
ld (hl), e
dec hl
ld (hl), h
dec hl
ld (hl), l
dec hl
or a
sbc hl, bc
or a
sbc hl, de
or a
sbc hl, hl
or a
sbc hl, sp
ld c, (ix + 1)
ld b, (ix + 1 + 1)
ld c, (iy + 1)
ld b, (iy + 1 + 1)
ld e, (ix + 1)
ld d, (ix + 1 + 1)
ld e, (iy + 1)
ld d, (iy + 1 + 1)
ld l, (ix + 1)
ld h, (ix + 1 + 1)
ld l, (iy + 1)
ld h, (iy + 1 + 1)
ld (ix + 1), c
ld (ix + 1 + 1), b
ld (ix + 1), e
ld (ix + 1 + 1), d
ld (ix + 1), l
ld (ix + 1 + 1), h
ld (iy + 1), c
ld (iy + 1 + 1), b
ld (iy + 1), e
ld (iy + 1 + 1), d
ld (iy + 1), l
ld (iy + 1 + 1), h
ld c, (ix + 1)
inc ix
ld b, (ix + 1)
inc ix
ld c, (iy + 1)
inc iy
ld b, (iy + 1)
inc iy
ld e, (ix + 1)
inc ix
ld d, (ix + 1)
inc ix
ld e, (iy + 1)
inc iy
ld d, (iy + 1)
inc iy
ld l, (ix + 1)
inc ix
ld h, (ix + 1)
inc ix
ld l, (iy + 1)
inc iy
ld h, (iy + 1)
inc iy
ld (ix + 1), c
inc ix
ld (ix + 1), b
inc ix
ld (ix + 1), e
inc ix
ld (ix + 1), d
inc ix
ld (ix + 1), l
inc ix
ld (ix + 1), h
inc ix
ld (iy + 1), c
inc iy
ld (iy + 1), b
inc iy
ld (iy + 1), e
inc iy
ld (iy + 1), d
inc iy
ld (iy + 1), l
inc iy
ld (iy + 1), h
inc iy
ld a, (ix + 1)
inc ix
ld b, (ix + 1)
inc ix
ld c, (ix + 1)
inc ix
ld d, (ix + 1)
inc ix
ld e, (ix + 1)
inc ix
ld h, (ix + 1)
inc ix
ld l, (ix + 1)
inc ix
ld a, (iy + 1)
inc iy
ld b, (iy + 1)
inc iy
ld c, (iy + 1)
inc iy
ld d, (iy + 1)
inc iy
ld e, (iy + 1)
inc iy
ld h, (iy + 1)
inc iy
ld l, (iy + 1)
inc iy
ld a, (ix + 1)
dec ix
ld b, (ix + 1)
dec ix
ld c, (ix + 1)
dec ix
ld d, (ix + 1)
dec ix
ld e, (ix + 1)
dec ix
ld h, (ix + 1)
dec ix
ld l, (ix + 1)
dec ix
ld a, (iy + 1)
dec iy
ld b, (iy + 1)
dec iy
ld c, (iy + 1)
dec iy
ld d, (iy + 1)
dec iy
ld e, (iy + 1)
dec iy
ld h, (iy + 1)
dec iy
ld l, (iy + 1)
dec iy
ld (ix + 1), a
inc ix
ld (ix + 1), b
inc ix
ld (ix + 1), c
inc ix
ld (ix + 1), d
inc ix
ld (ix + 1), e
inc ix
ld (ix + 1), h
inc ix
ld (ix + 1), l
inc ix
ld (iy + 1), a
inc iy
ld (iy + 1), b
inc iy
ld (iy + 1), c
inc iy
ld (iy + 1), d
inc iy
ld (iy + 1), e
inc iy
ld (iy + 1), h
inc iy
ld (iy + 1), l
inc iy
ld (ix + 1), a
dec ix
ld (ix + 1), b
dec ix
ld (ix + 1), c
dec ix
ld (ix + 1), d
dec ix
ld (ix + 1), e
dec ix
ld (ix + 1), h
dec ix
ld (ix + 1), l
dec ix
ld (iy + 1), a
dec iy
ld (iy + 1), b
dec iy
ld (iy + 1), c
dec iy
ld (iy + 1), d
dec iy
ld (iy + 1), e
dec iy
ld (iy + 1), h
dec iy
ld (iy + 1), l
dec iy
ld (hl), 0
inc hl
ld (ix + 1), 0
inc ix
ld (iy + 1), 0
inc iy
ld (hl), 0
dec hl
ld (ix + 1), 0
dec ix
ld (iy + 1), 0
dec iy |
#include "script_component.hpp"
class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {
QGVAR(moduleAddIntel),
QGVAR(moduleAddIntel3den),
"keko_ModuleAddIntel3den"
};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {
"keko_common",
"ace_main",
"ace_modules"
};
author = "Schwaggot";
authors[] = {"Schwaggot"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgFactionClasses.hpp"
#include "CfgVehicles.hpp"
#include "defines.hpp"
#include "ui\dialog_intel.hpp"
|
; $Id: VBoxBiosAlternative.asm $
;; @file
; Auto Generated source file. Do not edit.
;
;
; Source file: post.c
;
; BIOS POST routines. Used only during initialization.
;
;
;
; Copyright (C) 2004-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; Source file: bios.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: print.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: ata.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: floppy.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: floppyt.c
;
; $Id: VBoxBiosAlternative.asm $
; Floppy drive tables.
;
;
;
; Copyright (C) 2011-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; Source file: eltorito.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: boot.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: keyboard.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: disk.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: serial.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: system.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: invop.c
;
; $Id: VBoxBiosAlternative.asm $
; Real mode invalid opcode handler.
;
;
;
; Copyright (C) 2013-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; Source file: timepci.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: ps2mouse.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: parallel.c
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
; Source file: logo.c
;
; $Id: VBoxBiosAlternative.asm $
; Stuff for drawing the BIOS logo.
;
;
;
; Copyright (C) 2004-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; Source file: scsi.c
;
; $Id: VBoxBiosAlternative.asm $
; SCSI host adapter driver to boot from SCSI disks
;
;
;
; Copyright (C) 2004-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; Source file: ahci.c
;
; $Id: VBoxBiosAlternative.asm $
; AHCI host adapter driver to boot from SATA disks.
;
;
;
; Copyright (C) 2011-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; Source file: apm.c
;
; $Id: VBoxBiosAlternative.asm $
; APM BIOS support. Implements APM version 1.2.
;
;
;
; Copyright (C) 2004-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; Source file: pcibios.c
;
; $Id: VBoxBiosAlternative.asm $
; PCI BIOS support.
;
;
;
; Copyright (C) 2004-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; Source file: pciutil.c
;
; Utility routines for calling the PCI BIOS.
;
;
;
; Copyright (C) 2011-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; Source file: vds.c
;
; Utility routines for calling the Virtual DMA Services.
;
;
;
; Copyright (C) 2011-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; Source file: support.asm
;
; $Id: VBoxBiosAlternative.asm $
; Compiler support routines.
;
;
;
; Copyright (C) 2012-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
;
; Source file: pcibio32.asm
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; --------------------------------------------------------------------
;
; Source file: apm_pm.asm
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; --------------------------------------------------------------------
;
; Protected-mode APM implementation.
;
;
; Source file: orgs.asm
;
;
; Copyright (C) 2006-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
; --------------------------------------------------------------------
;
; This code is based on:
;
; ROM BIOS for use with Bochs/Plex86/QEMU emulation environment
;
; Copyright (C) 2002 MandrakeSoft S.A.
;
; MandrakeSoft S.A.
; 43, rue d'Aboukir
; 75002 Paris - France
; http://www.linux-mandrake.com/
; http://www.mandrakesoft.com/
;
; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;
;
;
; Source file: pci32.c
;
; $Id: VBoxBiosAlternative.asm $
; 32-bit PCI BIOS wrapper.
;
;
;
; Copyright (C) 2004-2015 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
section _DATA progbits vstart=0x0 align=1 ; size=0xb0 class=DATA group=DGROUP
_fd_parm: ; 0xf0000 LB 0x5b
db 0dfh, 002h, 025h, 002h, 009h, 02ah, 0ffh, 050h, 0f6h, 00fh, 008h, 027h, 080h, 0dfh, 002h, 025h
db 002h, 009h, 02ah, 0ffh, 050h, 0f6h, 00fh, 008h, 027h, 040h, 0dfh, 002h, 025h, 002h, 00fh, 01bh
db 0ffh, 054h, 0f6h, 00fh, 008h, 04fh, 000h, 0dfh, 002h, 025h, 002h, 009h, 02ah, 0ffh, 050h, 0f6h
db 00fh, 008h, 04fh, 080h, 0afh, 002h, 025h, 002h, 012h, 01bh, 0ffh, 06ch, 0f6h, 00fh, 008h, 04fh
db 000h, 0afh, 002h, 025h, 002h, 024h, 01bh, 0ffh, 054h, 0f6h, 00fh, 008h, 04fh, 0c0h, 0afh, 002h
db 025h, 002h, 0ffh, 01bh, 0ffh, 054h, 0f6h, 00fh, 008h, 0ffh, 000h
_fd_map: ; 0xf005b LB 0xf
db 001h, 000h, 002h, 002h, 003h, 003h, 004h, 004h, 005h, 005h, 00eh, 006h, 00fh, 006h, 000h
_pktacc: ; 0xf006a LB 0xc
db 000h, 000h, 000h, 000h, 000h, 000h, 08fh, 028h, 089h, 07bh, 06bh, 089h
_softrst: ; 0xf0076 LB 0xc
db 000h, 000h, 000h, 000h, 000h, 000h, 077h, 02bh, 054h, 038h, 054h, 038h
_dskacc: ; 0xf0082 LB 0x2e
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0d8h, 027h, 052h, 028h, 000h, 000h, 000h, 000h
db 017h, 07ah, 0d0h, 07ah, 066h, 088h, 0f9h, 088h, 000h, 000h, 000h, 000h, 000h, 000h, 05fh, 033h
db 032h, 05fh, 000h, 0dah, 00fh, 000h, 000h, 001h, 0f3h, 000h, 000h, 000h, 000h, 000h
section CONST progbits vstart=0xb0 align=1 ; size=0xce0 class=DATA group=DGROUP
db 'NMI Handler called', 00ah, 000h
db 'INT18: BOOT FAILURE', 00ah, 000h
db '%s', 00ah, 000h, 000h
db 'FATAL: ', 000h
db 'bios_printf: unknown format', 00ah, 000h, 000h
db 'ata-detect: Failed to detect ATA device', 00ah, 000h
db 'ata%d-%d: PCHS=%u/%u/%u LCHS=%u/%u/%u', 00ah, 000h
db 'ata-detect: Failed to detect ATAPI device', 00ah, 000h
db ' slave', 000h
db 'master', 000h
db 'ata%d %s: ', 000h
db '%c', 000h
db ' ATA-%d Hard-Disk (%lu MBytes)', 00ah, 000h
db ' ATAPI-%d CD-ROM/DVD-ROM', 00ah, 000h
db ' ATAPI-%d Device', 00ah, 000h
db 'ata%d %s: Unknown device', 00ah, 000h
db 'ata_cmd_packet', 000h
db '%s: DATA_OUT not supported yet', 00ah, 000h
db 'set_diskette_current_cyl: drive > 1', 00ah, 000h
db 'int13_diskette_function', 000h
db '%s: drive>1 || head>1 ...', 00ah, 000h
db '%s: ctrl not ready', 00ah, 000h
db '%s: write error', 00ah, 000h
db '%s: bad floppy type', 00ah, 000h
db '%s: unsupported AH=%02x', 00ah, 000h, 000h
db 'int13_eltorito', 000h
db '%s: call with AX=%04x not implemented.', 00ah, 000h
db '%s: unsupported AH=%02x', 00ah, 000h
db 'int13_cdemu', 000h
db '%s: function %02x, emulation not active for DL= %02x', 00ah, 000h
db '%s: function %02x, error %02x !', 00ah, 000h
db '%s: function AH=%02x unsupported, returns fail', 00ah, 000h
db 'int13_cdrom', 000h
db '%s: function %02x, ELDL out of range %02x', 00ah, 000h
db '%s: function %02x, unmapped device for ELDL=%02x', 00ah, 000h
db '%s: function %02x. Can', 027h, 't use 64bits lba', 00ah, 000h
db '%s: function %02x, status %02x !', 00ah, 000h, 000h
db 'Booting from %s...', 00ah, 000h
db 'Boot from %s failed', 00ah, 000h
db 'Boot from %s %d failed', 00ah, 000h
db 'No bootable medium found! System halted.', 00ah, 000h
db 'Could not read from the boot medium! System halted.', 00ah, 000h
db 'CDROM boot failure code : %04x', 00ah, 000h
db 'Boot : bseqnr=%d, bootseq=%x', 00dh, 00ah, 000h, 000h
db 'Keyboard error:%u', 00ah, 000h
db 'KBD: int09 handler: AL=0', 00ah, 000h
db 'KBD: int09h_handler(): unknown scancode read: 0x%02x!', 00ah, 000h
db 'KBD: int09h_handler(): scancode & asciicode are zero?', 00ah, 000h
db 'KBD: int16h: out of keyboard input', 00ah, 000h
db 'KBD: unsupported int 16h function %02x', 00ah, 000h
db 'AX=%04x BX=%04x CX=%04x DX=%04x ', 00ah, 000h, 000h
db 'int13_harddisk', 000h
db '%s: function %02x, ELDL out of range %02x', 00ah, 000h
db '%s: function %02x, unmapped device for ELDL=%02x', 00ah, 000h
db '%s: function %02x, count out of range!', 00ah, 000h
db '%s: function %02x, disk %02x, parameters out of range %04x/%04x/%04x!', 00ah
db 000h
db '%s: function %02x, error %02x !', 00ah, 000h
db 'format disk track called', 00ah, 000h
db '%s: function %02xh unimplemented, returns success', 00ah, 000h
db '%s: function %02xh unsupported, returns fail', 00ah, 000h
db 'int13_harddisk_ext', 000h
db '%s: function %02x. Can', 027h, 't use 64bits lba', 00ah, 000h
db '%s: function %02x. LBA out of range', 00ah, 000h
db 'int15: Func 24h, subfunc %02xh, A20 gate control not supported', 00ah, 000h
db '*** int 15h function AH=bf not yet supported!', 00ah, 000h
db 'EISA BIOS not present', 00ah, 000h
db '*** int 15h function AX=%04x, BX=%04x not yet supported!', 00ah, 000h
db 'sendmouse', 000h
db 'setkbdcomm', 000h
db 'Mouse reset returned %02x (should be ack)', 00ah, 000h
db 'Mouse status returned %02x (should be ack)', 00ah, 000h
db 'INT 15h C2 AL=6, BH=%02x', 00ah, 000h
db 'INT 15h C2 default case entered', 00ah, 000h, 000h
db 'Key pressed: %x', 00ah, 000h
db 00ah, 00ah, ' AHCI controller:', 000h
db 00ah, ' %d) Hard disk', 000h
db 00ah, 00ah, ' SCSI controller:', 000h
db ' IDE controller:', 000h
db 00ah, 00ah, 'AHCI controller:', 00ah, 000h
db 00ah, ' %d) ', 000h
db 'Secondary ', 000h
db 'Primary ', 000h
db 'Slave', 000h
db 'Master', 000h
db 'No hard disks found', 000h
db 00ah, 000h
db 'Press F12 to select boot device.', 00ah, 000h
db 00ah, 'VirtualBox temporary boot device selection', 00ah, 00ah, 'Detected H'
db 'ard disks:', 00ah, 00ah, 000h
db 00ah, 'Other boot devices:', 00ah, ' f) Floppy', 00ah, ' c) CD-ROM', 00ah
db ' l) LAN', 00ah, 00ah, ' b) Continue booting', 00ah, 000h
db 'Delaying boot for %d seconds:', 000h
db ' %d', 000h, 000h
db 'scsi_read_sectors', 000h
db '%s: device_id out of range %d', 00ah, 000h
db 'scsi_write_sectors', 000h
db 'scsi_cmd_packet', 000h
db '%s: DATA_OUT not supported yet', 00ah, 000h
db 'scsi_enumerate_attached_devices', 000h
db '%s: SCSI_INQUIRY failed', 00ah, 000h
db '%s: SCSI_READ_CAPACITY failed', 00ah, 000h
db 'Disk %d has an unsupported sector size of %u', 00ah, 000h
db 'SCSI %d-ID#%d: LCHS=%u/%u/%u %lu sectors', 00ah, 000h
db 'SCSI %d-ID#%d: CD/DVD-ROM', 00ah, 000h, 000h
db 'ahci_read_sectors', 000h
db '%s: device_id out of range %d', 00ah, 000h
db 'ahci_write_sectors', 000h
db 'ahci_cmd_packet', 000h
db '%s: DATA_OUT not supported yet', 00ah, 000h
db 'AHCI %d-P#%d: PCHS=%u/%u/%u LCHS=%u/%u/%u %lu sectors', 00ah, 000h, 000h
db 'Standby', 000h
db 'Suspend', 000h
db 'Shutdown', 000h
db 'APM: Unsupported function AX=%04X BX=%04X called', 00ah, 000h, 000h
db 'PCI: Unsupported function AX=%04X BX=%04X called', 00ah, 000h
section CONST2 progbits vstart=0xd90 align=1 ; size=0x3fa class=DATA group=DGROUP
_bios_cvs_version_string: ; 0xf0d90 LB 0x12
db 'VirtualBox 5.0.0', 000h, 000h
_bios_prefix_string: ; 0xf0da2 LB 0x8
db 'BIOS: ', 000h, 000h
_isotag: ; 0xf0daa LB 0x6
db 'CD001', 000h
_eltorito: ; 0xf0db0 LB 0x18
db 'EL TORITO SPECIFICATION', 000h
_drivetypes: ; 0xf0dc8 LB 0x28
db 046h, 06ch, 06fh, 070h, 070h, 079h, 000h, 000h, 000h, 000h, 048h, 061h, 072h, 064h, 020h, 044h
db 069h, 073h, 06bh, 000h, 043h, 044h, 02dh, 052h, 04fh, 04dh, 000h, 000h, 000h, 000h, 04ch, 041h
db 04eh, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_scan_to_scanascii: ; 0xf0df0 LB 0x37a
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 01bh, 001h, 01bh, 001h, 01bh, 001h
db 000h, 001h, 000h, 000h, 031h, 002h, 021h, 002h, 000h, 000h, 000h, 078h, 000h, 000h, 032h, 003h
db 040h, 003h, 000h, 003h, 000h, 079h, 000h, 000h, 033h, 004h, 023h, 004h, 000h, 000h, 000h, 07ah
db 000h, 000h, 034h, 005h, 024h, 005h, 000h, 000h, 000h, 07bh, 000h, 000h, 035h, 006h, 025h, 006h
db 000h, 000h, 000h, 07ch, 000h, 000h, 036h, 007h, 05eh, 007h, 01eh, 007h, 000h, 07dh, 000h, 000h
db 037h, 008h, 026h, 008h, 000h, 000h, 000h, 07eh, 000h, 000h, 038h, 009h, 02ah, 009h, 000h, 000h
db 000h, 07fh, 000h, 000h, 039h, 00ah, 028h, 00ah, 000h, 000h, 000h, 080h, 000h, 000h, 030h, 00bh
db 029h, 00bh, 000h, 000h, 000h, 081h, 000h, 000h, 02dh, 00ch, 05fh, 00ch, 01fh, 00ch, 000h, 082h
db 000h, 000h, 03dh, 00dh, 02bh, 00dh, 000h, 000h, 000h, 083h, 000h, 000h, 008h, 00eh, 008h, 00eh
db 07fh, 00eh, 000h, 000h, 000h, 000h, 009h, 00fh, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h
db 071h, 010h, 051h, 010h, 011h, 010h, 000h, 010h, 040h, 000h, 077h, 011h, 057h, 011h, 017h, 011h
db 000h, 011h, 040h, 000h, 065h, 012h, 045h, 012h, 005h, 012h, 000h, 012h, 040h, 000h, 072h, 013h
db 052h, 013h, 012h, 013h, 000h, 013h, 040h, 000h, 074h, 014h, 054h, 014h, 014h, 014h, 000h, 014h
db 040h, 000h, 079h, 015h, 059h, 015h, 019h, 015h, 000h, 015h, 040h, 000h, 075h, 016h, 055h, 016h
db 015h, 016h, 000h, 016h, 040h, 000h, 069h, 017h, 049h, 017h, 009h, 017h, 000h, 017h, 040h, 000h
db 06fh, 018h, 04fh, 018h, 00fh, 018h, 000h, 018h, 040h, 000h, 070h, 019h, 050h, 019h, 010h, 019h
db 000h, 019h, 040h, 000h, 05bh, 01ah, 07bh, 01ah, 01bh, 01ah, 000h, 000h, 000h, 000h, 05dh, 01bh
db 07dh, 01bh, 01dh, 01bh, 000h, 000h, 000h, 000h, 00dh, 01ch, 00dh, 01ch, 00ah, 01ch, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 061h, 01eh, 041h, 01eh
db 001h, 01eh, 000h, 01eh, 040h, 000h, 073h, 01fh, 053h, 01fh, 013h, 01fh, 000h, 01fh, 040h, 000h
db 064h, 020h, 044h, 020h, 004h, 020h, 000h, 020h, 040h, 000h, 066h, 021h, 046h, 021h, 006h, 021h
db 000h, 021h, 040h, 000h, 067h, 022h, 047h, 022h, 007h, 022h, 000h, 022h, 040h, 000h, 068h, 023h
db 048h, 023h, 008h, 023h, 000h, 023h, 040h, 000h, 06ah, 024h, 04ah, 024h, 00ah, 024h, 000h, 024h
db 040h, 000h, 06bh, 025h, 04bh, 025h, 00bh, 025h, 000h, 025h, 040h, 000h, 06ch, 026h, 04ch, 026h
db 00ch, 026h, 000h, 026h, 040h, 000h, 03bh, 027h, 03ah, 027h, 000h, 000h, 000h, 000h, 000h, 000h
db 027h, 028h, 022h, 028h, 000h, 000h, 000h, 000h, 000h, 000h, 060h, 029h, 07eh, 029h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 05ch, 02bh
db 07ch, 02bh, 01ch, 02bh, 000h, 000h, 000h, 000h, 07ah, 02ch, 05ah, 02ch, 01ah, 02ch, 000h, 02ch
db 040h, 000h, 078h, 02dh, 058h, 02dh, 018h, 02dh, 000h, 02dh, 040h, 000h, 063h, 02eh, 043h, 02eh
db 003h, 02eh, 000h, 02eh, 040h, 000h, 076h, 02fh, 056h, 02fh, 016h, 02fh, 000h, 02fh, 040h, 000h
db 062h, 030h, 042h, 030h, 002h, 030h, 000h, 030h, 040h, 000h, 06eh, 031h, 04eh, 031h, 00eh, 031h
db 000h, 031h, 040h, 000h, 06dh, 032h, 04dh, 032h, 00dh, 032h, 000h, 032h, 040h, 000h, 02ch, 033h
db 03ch, 033h, 000h, 000h, 000h, 000h, 000h, 000h, 02eh, 034h, 03eh, 034h, 000h, 000h, 000h, 000h
db 000h, 000h, 02fh, 035h, 03fh, 035h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 02ah, 037h, 02ah, 037h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 020h, 039h, 020h, 039h, 020h, 039h
db 020h, 039h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 03bh
db 000h, 054h, 000h, 05eh, 000h, 068h, 000h, 000h, 000h, 03ch, 000h, 055h, 000h, 05fh, 000h, 069h
db 000h, 000h, 000h, 03dh, 000h, 056h, 000h, 060h, 000h, 06ah, 000h, 000h, 000h, 03eh, 000h, 057h
db 000h, 061h, 000h, 06bh, 000h, 000h, 000h, 03fh, 000h, 058h, 000h, 062h, 000h, 06ch, 000h, 000h
db 000h, 040h, 000h, 059h, 000h, 063h, 000h, 06dh, 000h, 000h, 000h, 041h, 000h, 05ah, 000h, 064h
db 000h, 06eh, 000h, 000h, 000h, 042h, 000h, 05bh, 000h, 065h, 000h, 06fh, 000h, 000h, 000h, 043h
db 000h, 05ch, 000h, 066h, 000h, 070h, 000h, 000h, 000h, 044h, 000h, 05dh, 000h, 067h, 000h, 071h
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, 047h, 037h, 047h, 000h, 077h, 000h, 000h, 020h, 000h
db 000h, 048h, 038h, 048h, 000h, 000h, 000h, 000h, 020h, 000h, 000h, 049h, 039h, 049h, 000h, 084h
db 000h, 000h, 020h, 000h, 02dh, 04ah, 02dh, 04ah, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 04bh
db 034h, 04bh, 000h, 073h, 000h, 000h, 020h, 000h, 000h, 04ch, 035h, 04ch, 000h, 000h, 000h, 000h
db 020h, 000h, 000h, 04dh, 036h, 04dh, 000h, 074h, 000h, 000h, 020h, 000h, 02bh, 04eh, 02bh, 04eh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 04fh, 031h, 04fh, 000h, 075h, 000h, 000h, 020h, 000h
db 000h, 050h, 032h, 050h, 000h, 000h, 000h, 000h, 020h, 000h, 000h, 051h, 033h, 051h, 000h, 076h
db 000h, 000h, 020h, 000h, 000h, 052h, 030h, 052h, 000h, 000h, 000h, 000h, 020h, 000h, 000h, 053h
db 02eh, 053h, 000h, 000h, 000h, 000h, 020h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 05ch, 056h, 07ch, 056h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 085h, 000h, 087h, 000h, 089h, 000h, 08bh, 000h, 000h
db 000h, 086h, 000h, 088h, 000h, 08ah, 000h, 08ch, 000h, 000h
_panic_msg_keyb_buffer_full: ; 0xf116a LB 0x20
db '%s: keyboard input buffer full', 00ah, 000h
; Padding 0x476 bytes at 0xf118a
times 1142 db 0
section _TEXT progbits vstart=0x1600 align=1 ; size=0x8235 class=CODE group=AUTO
rom_scan_: ; 0xf1600 LB 0x50
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push ax ; 50
push ax ; 50
mov bx, ax ; 89 c3
mov cx, dx ; 89 d1
cmp bx, cx ; 39 cb
jnc short 01648h ; 73 38
xor si, si ; 31 f6
mov dx, bx ; 89 da
mov es, bx ; 8e c3
cmp word [es:si], 0aa55h ; 26 81 3c 55 aa
jne short 01642h ; 75 25
mov word [bp-008h], bx ; 89 5e f8
mov word [bp-00ah], strict word 00003h ; c7 46 f6 03 00
call far [bp-00ah] ; ff 5e f6
cli ; fa
mov es, bx ; 8e c3
mov al, byte [es:si+002h] ; 26 8a 44 02
add AL, strict byte 003h ; 04 03
and AL, strict byte 0fch ; 24 fc
xor ah, ah ; 30 e4
cwd ; 99
sal dx, 002h ; c1 e2 02
db 01bh, 0c2h
; sbb ax, dx ; 1b c2
sar ax, 002h ; c1 f8 02
add bx, ax ; 01 c3
jmp short 0160ch ; eb ca
add bx, 00080h ; 81 c3 80 00
jmp short 0160ch ; eb c4
lea sp, [bp-006h] ; 8d 66 fa
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
read_byte_: ; 0xf1650 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_: ; 0xf165e 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_: ; 0xf166c 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_: ; 0xf167a 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_: ; 0xf1688 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_: ; 0xf169a LB 0x12
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
inb_cmos_: ; 0xf16ac LB 0x1d
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov AH, strict byte 070h ; b4 70
cmp AL, strict byte 080h ; 3c 80
jc short 016b8h ; 72 02
mov AH, strict byte 072h ; b4 72
movzx dx, ah ; 0f b6 d4
out DX, AL ; ee
movzx dx, ah ; 0f b6 d4
inc dx ; 42
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
outb_cmos_: ; 0xf16c9 LB 0x1f
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
mov ah, dl ; 88 d4
mov BL, strict byte 070h ; b3 70
cmp AL, strict byte 080h ; 3c 80
jc short 016d7h ; 72 02
mov BL, strict byte 072h ; b3 72
movzx dx, bl ; 0f b6 d3
out DX, AL ; ee
movzx dx, bl ; 0f b6 d3
inc dx ; 42
mov al, ah ; 88 e0
out DX, AL ; ee
lea sp, [bp-002h] ; 8d 66 fe
pop bx ; 5b
pop bp ; 5d
retn ; c3
_dummy_isr_function: ; 0xf16e8 LB 0x6b
push bp ; 55
mov bp, sp ; 89 e5
push ax ; 50
mov CL, strict byte 0ffh ; b1 ff
mov AL, strict byte 00bh ; b0 0b
mov dx, strict word 00020h ; ba 20 00
out DX, AL ; ee
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov bx, ax ; 89 c3
mov byte [bp-002h], al ; 88 46 fe
test al, al ; 84 c0
je short 01743h ; 74 43
mov AL, strict byte 00bh ; b0 0b
mov dx, 000a0h ; ba a0 00
out DX, AL ; ee
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov cx, ax ; 89 c1
test al, al ; 84 c0
je short 01725h ; 74 16
mov dx, 000a1h ; ba a1 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor ah, ah ; 30 e4
movzx bx, cl ; 0f b6 d9
or ax, bx ; 09 d8
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
mov dx, 000a0h ; ba a0 00
out DX, AL ; ee
jmp short 0173ah ; eb 15
mov dx, strict word 00021h ; ba 21 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and bl, 0fbh ; 80 e3 fb
mov byte [bp-002h], bl ; 88 5e fe
xor ah, ah ; 30 e4
movzx bx, byte [bp-002h] ; 0f b6 5e fe
or ax, bx ; 09 d8
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
mov dx, strict word 00020h ; ba 20 00
out DX, AL ; ee
mov cl, byte [bp-002h] ; 8a 4e fe
movzx bx, cl ; 0f b6 d9
mov dx, strict word 0006bh ; ba 6b 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 0f ff
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
_nmi_handler_msg: ; 0xf1753 LB 0x12
push bp ; 55
mov bp, sp ; 89 e5
push 000b0h ; 68 b0 00
push strict byte 00007h ; 6a 07
call 01972h ; e8 14 02
add sp, strict byte 00004h ; 83 c4 04
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
_int18_panic_msg: ; 0xf1765 LB 0x12
push bp ; 55
mov bp, sp ; 89 e5
push 000c4h ; 68 c4 00
push strict byte 00007h ; 6a 07
call 01972h ; e8 02 02
add sp, strict byte 00004h ; 83 c4 04
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
_log_bios_start: ; 0xf1777 LB 0x20
push bp ; 55
mov bp, sp ; 89 e5
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 ac 01
push 00d90h ; 68 90 0d
push 000d9h ; 68 d9 00
push strict byte 00004h ; 6a 04
call 01972h ; e8 e2 01
add sp, strict byte 00006h ; 83 c4 06
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
_print_bios_banner: ; 0xf1797 LB 0x2e
push bp ; 55
mov bp, sp ; 89 e5
mov dx, strict word 00072h ; ba 72 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 c9 fe
mov cx, ax ; 89 c1
xor bx, bx ; 31 db
mov dx, strict word 00072h ; ba 72 00
mov ax, strict word 00040h ; b8 40 00
call 0167ah ; e8 ca fe
cmp cx, 01234h ; 81 f9 34 12
jne short 017beh ; 75 08
mov AL, strict byte 003h ; b0 03
mov AH, strict byte 000h ; b4 00
int 010h ; cd 10
jmp short 017c1h ; eb 03
call 075fah ; e8 39 5e
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
send_: ; 0xf17c5 LB 0x3b
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
mov bx, ax ; 89 c3
mov cl, dl ; 88 d1
test AL, strict byte 008h ; a8 08
je short 017d8h ; 74 06
mov al, dl ; 88 d0
mov dx, 00403h ; ba 03 04
out DX, AL ; ee
test bl, 004h ; f6 c3 04
je short 017e3h ; 74 06
mov al, cl ; 88 c8
mov dx, 00504h ; ba 04 05
out DX, AL ; ee
test bl, 002h ; f6 c3 02
je short 017f9h ; 74 11
cmp cl, 00ah ; 80 f9 0a
jne short 017f3h ; 75 06
mov AL, strict byte 00dh ; b0 0d
mov AH, strict byte 00eh ; b4 0e
int 010h ; cd 10
mov al, cl ; 88 c8
mov AH, strict byte 00eh ; b4 0e
int 010h ; cd 10
lea sp, [bp-004h] ; 8d 66 fc
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
put_int_: ; 0xf1800 LB 0x5f
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov si, ax ; 89 c6
mov word [bp-008h], dx ; 89 56 f8
mov di, strict word 0000ah ; bf 0a 00
mov ax, dx ; 89 d0
cwd ; 99
idiv di ; f7 ff
mov word [bp-006h], ax ; 89 46 fa
test ax, ax ; 85 c0
je short 01825h ; 74 0a
dec bx ; 4b
mov dx, ax ; 89 c2
mov ax, si ; 89 f0
call 01800h ; e8 dd ff
jmp short 01840h ; eb 1b
dec bx ; 4b
test bx, bx ; 85 db
jle short 01834h ; 7e 0a
mov dx, strict word 00020h ; ba 20 00
mov ax, si ; 89 f0
call 017c5h ; e8 93 ff
jmp short 01825h ; eb f1
test cx, cx ; 85 c9
je short 01840h ; 74 08
mov dx, strict word 0002dh ; ba 2d 00
mov ax, si ; 89 f0
call 017c5h ; e8 85 ff
mov al, byte [bp-006h] ; 8a 46 fa
mov DL, strict byte 00ah ; b2 0a
mul dl ; f6 e2
mov dl, byte [bp-008h] ; 8a 56 f8
sub dl, al ; 28 c2
mov al, dl ; 88 d0
add AL, strict byte 030h ; 04 30
movzx dx, al ; 0f b6 d0
mov ax, si ; 89 f0
call 017c5h ; e8 6d ff
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
put_uint_: ; 0xf185f LB 0x60
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov si, ax ; 89 c6
mov word [bp-008h], dx ; 89 56 f8
mov ax, dx ; 89 d0
xor dx, dx ; 31 d2
mov di, strict word 0000ah ; bf 0a 00
div di ; f7 f7
mov word [bp-006h], ax ; 89 46 fa
test ax, ax ; 85 c0
je short 01885h ; 74 0a
dec bx ; 4b
mov dx, ax ; 89 c2
mov ax, si ; 89 f0
call 0185fh ; e8 dc ff
jmp short 018a0h ; eb 1b
dec bx ; 4b
test bx, bx ; 85 db
jle short 01894h ; 7e 0a
mov dx, strict word 00020h ; ba 20 00
mov ax, si ; 89 f0
call 017c5h ; e8 33 ff
jmp short 01885h ; eb f1
test cx, cx ; 85 c9
je short 018a0h ; 74 08
mov dx, strict word 0002dh ; ba 2d 00
mov ax, si ; 89 f0
call 017c5h ; e8 25 ff
mov al, byte [bp-006h] ; 8a 46 fa
mov DL, strict byte 00ah ; b2 0a
mul dl ; f6 e2
mov dl, byte [bp-008h] ; 8a 56 f8
sub dl, al ; 28 c2
mov al, dl ; 88 d0
add AL, strict byte 030h ; 04 30
movzx dx, al ; 0f b6 d0
mov ax, si ; 89 f0
call 017c5h ; e8 0d ff
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
put_luint_: ; 0xf18bf LB 0x72
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov si, ax ; 89 c6
mov word [bp-006h], bx ; 89 5e fa
mov di, dx ; 89 d7
mov ax, bx ; 89 d8
mov dx, cx ; 89 ca
mov bx, strict word 0000ah ; bb 0a 00
xor cx, cx ; 31 c9
call 09740h ; e8 67 7e
mov word [bp-008h], ax ; 89 46 f8
mov cx, dx ; 89 d1
mov dx, ax ; 89 c2
or dx, cx ; 09 ca
je short 018f3h ; 74 0f
push word [bp+004h] ; ff 76 04
lea dx, [di-001h] ; 8d 55 ff
mov bx, ax ; 89 c3
mov ax, si ; 89 f0
call 018bfh ; e8 ce ff
jmp short 01910h ; eb 1d
dec di ; 4f
test di, di ; 85 ff
jle short 01902h ; 7e 0a
mov dx, strict word 00020h ; ba 20 00
mov ax, si ; 89 f0
call 017c5h ; e8 c5 fe
jmp short 018f3h ; eb f1
cmp word [bp+004h], strict byte 00000h ; 83 7e 04 00
je short 01910h ; 74 08
mov dx, strict word 0002dh ; ba 2d 00
mov ax, si ; 89 f0
call 017c5h ; e8 b5 fe
mov al, byte [bp-008h] ; 8a 46 f8
mov DL, strict byte 00ah ; b2 0a
mul dl ; f6 e2
mov dl, byte [bp-006h] ; 8a 56 fa
sub dl, al ; 28 c2
mov al, dl ; 88 d0
add AL, strict byte 030h ; 04 30
movzx dx, al ; 0f b6 d0
mov ax, si ; 89 f0
call 017c5h ; e8 9d fe
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00002h ; c2 02 00
put_str_: ; 0xf1931 LB 0x21
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
push si ; 56
mov si, ax ; 89 c6
mov es, cx ; 8e c1
mov dl, byte [es:bx] ; 26 8a 17
test dl, dl ; 84 d2
je short 0194bh ; 74 0a
xor dh, dh ; 30 f6
mov ax, si ; 89 f0
call 017c5h ; e8 7d fe
inc bx ; 43
jmp short 01938h ; eb ed
lea sp, [bp-004h] ; 8d 66 fc
pop si ; 5e
pop dx ; 5a
pop bp ; 5d
retn ; c3
put_str_near_: ; 0xf1952 LB 0x20
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
mov cx, ax ; 89 c1
mov bx, dx ; 89 d3
mov dl, byte [bx] ; 8a 17
test dl, dl ; 84 d2
je short 0196bh ; 74 0a
xor dh, dh ; 30 f6
mov ax, cx ; 89 c8
call 017c5h ; e8 5d fe
inc bx ; 43
jmp short 0195bh ; eb f0
lea sp, [bp-004h] ; 8d 66 fc
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
bios_printf_: ; 0xf1972 LB 0x23b
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 00008h ; 83 ec 08
lea bx, [bp+008h] ; 8d 5e 08
mov word [bp-012h], bx ; 89 5e ee
mov [bp-010h], ss ; 8c 56 f0
xor cx, cx ; 31 c9
xor si, si ; 31 f6
mov ax, word [bp+004h] ; 8b 46 04
and ax, strict word 00007h ; 25 07 00
cmp ax, strict word 00007h ; 3d 07 00
jne short 019a0h ; 75 0b
push 000deh ; 68 de 00
push strict byte 00002h ; 6a 02
call 01972h ; e8 d5 ff
add sp, strict byte 00004h ; 83 c4 04
mov bx, word [bp+006h] ; 8b 5e 06
mov dl, byte [bx] ; 8a 17
test dl, dl ; 84 d2
je near 01b91h ; 0f 84 e6 01
cmp dl, 025h ; 80 fa 25
jne short 019b8h ; 75 08
mov cx, strict word 00001h ; b9 01 00
xor si, si ; 31 f6
jmp near 01b8bh ; e9 d3 01
test cx, cx ; 85 c9
je near 01b83h ; 0f 84 c5 01
cmp dl, 030h ; 80 fa 30
jc short 019d6h ; 72 13
cmp dl, 039h ; 80 fa 39
jnbe short 019d6h ; 77 0e
movzx ax, dl ; 0f b6 c2
imul si, si, strict byte 0000ah ; 6b f6 0a
sub ax, strict word 00030h ; 2d 30 00
add si, ax ; 01 c6
jmp near 01b8bh ; e9 b5 01
mov ax, word [bp-010h] ; 8b 46 f0
mov word [bp-010h], ax ; 89 46 f0
add word [bp-012h], strict byte 00002h ; 83 46 ee 02
les bx, [bp-012h] ; c4 5e ee
mov ax, word [es:bx-002h] ; 26 8b 47 fe
mov word [bp-00ch], ax ; 89 46 f4
cmp dl, 078h ; 80 fa 78
je short 019f4h ; 74 05
cmp dl, 058h ; 80 fa 58
jne short 01a3dh ; 75 49
test si, si ; 85 f6
jne short 019fbh ; 75 03
mov si, strict word 00004h ; be 04 00
cmp dl, 078h ; 80 fa 78
jne short 01a05h ; 75 05
mov di, strict word 00061h ; bf 61 00
jmp short 01a08h ; eb 03
mov di, strict word 00041h ; bf 41 00
lea bx, [si-001h] ; 8d 5c ff
test bx, bx ; 85 db
jl near 01b7fh ; 0f 8c 6e 01
mov cx, bx ; 89 d9
sal cx, 002h ; c1 e1 02
mov ax, word [bp-00ch] ; 8b 46 f4
shr ax, CL ; d3 e8
xor ah, ah ; 30 e4
and AL, strict byte 00fh ; 24 0f
cmp ax, strict word 00009h ; 3d 09 00
jnbe short 01a2bh ; 77 07
mov dx, ax ; 89 c2
add dx, strict byte 00030h ; 83 c2 30
jmp short 01a32h ; eb 07
mov dx, ax ; 89 c2
sub dx, strict byte 0000ah ; 83 ea 0a
add dx, di ; 01 fa
xor dh, dh ; 30 f6
mov ax, word [bp+004h] ; 8b 46 04
call 017c5h ; e8 8b fd
dec bx ; 4b
jmp short 01a0bh ; eb ce
cmp dl, 075h ; 80 fa 75
jne short 01a51h ; 75 0f
xor cx, cx ; 31 c9
mov bx, si ; 89 f3
mov dx, ax ; 89 c2
mov ax, word [bp+004h] ; 8b 46 04
call 0185fh ; e8 11 fe
jmp near 01b7fh ; e9 2e 01
lea bx, [si-001h] ; 8d 5c ff
cmp dl, 06ch ; 80 fa 6c
jne near 01b0dh ; 0f 85 b2 00
inc word [bp+006h] ; ff 46 06
mov di, word [bp+006h] ; 8b 7e 06
mov dl, byte [di] ; 8a 15
mov ax, word [bp-010h] ; 8b 46 f0
mov word [bp-010h], ax ; 89 46 f0
add word [bp-012h], strict byte 00002h ; 83 46 ee 02
les di, [bp-012h] ; c4 7e ee
mov ax, word [es:di-002h] ; 26 8b 45 fe
mov word [bp-00eh], ax ; 89 46 f2
cmp dl, 064h ; 80 fa 64
jne short 01aa9h ; 75 2d
test byte [bp-00dh], 080h ; f6 46 f3 80
je short 01a97h ; 74 15
push strict byte 00001h ; 6a 01
mov ax, word [bp-00ch] ; 8b 46 f4
mov cx, word [bp-00eh] ; 8b 4e f2
neg cx ; f7 d9
neg ax ; f7 d8
sbb cx, strict byte 00000h ; 83 d9 00
mov dx, bx ; 89 da
mov bx, ax ; 89 c3
jmp short 01aa0h ; eb 09
push strict byte 00000h ; 6a 00
mov bx, word [bp-00ch] ; 8b 5e f4
mov dx, si ; 89 f2
mov cx, ax ; 89 c1
mov ax, word [bp+004h] ; 8b 46 04
call 018bfh ; e8 19 fe
jmp near 01b7fh ; e9 d6 00
cmp dl, 075h ; 80 fa 75
jne short 01ab0h ; 75 02
jmp short 01a97h ; eb e7
cmp dl, 078h ; 80 fa 78
je short 01abch ; 74 07
cmp dl, 058h ; 80 fa 58
jne near 01b7fh ; 0f 85 c3 00
test si, si ; 85 f6
jne short 01ac3h ; 75 03
mov si, strict word 00008h ; be 08 00
cmp dl, 078h ; 80 fa 78
jne short 01acdh ; 75 05
mov di, strict word 00061h ; bf 61 00
jmp short 01ad0h ; eb 03
mov di, strict word 00041h ; bf 41 00
lea bx, [si-001h] ; 8d 5c ff
test bx, bx ; 85 db
jl near 01b7fh ; 0f 8c a6 00
mov ax, word [bp-00ch] ; 8b 46 f4
mov cx, bx ; 89 d9
sal cx, 002h ; c1 e1 02
mov dx, word [bp-00eh] ; 8b 56 f2
jcxz 01aech ; e3 06
shr dx, 1 ; d1 ea
rcr ax, 1 ; d1 d8
loop 01ae6h ; e2 fa
and ax, strict word 0000fh ; 25 0f 00
cmp ax, strict word 00009h ; 3d 09 00
jnbe short 01afbh ; 77 07
mov dx, ax ; 89 c2
add dx, strict byte 00030h ; 83 c2 30
jmp short 01b02h ; eb 07
mov dx, ax ; 89 c2
sub dx, strict byte 0000ah ; 83 ea 0a
add dx, di ; 01 fa
xor dh, dh ; 30 f6
mov ax, word [bp+004h] ; 8b 46 04
call 017c5h ; e8 bb fc
dec bx ; 4b
jmp short 01ad3h ; eb c6
cmp dl, 064h ; 80 fa 64
jne short 01b2fh ; 75 1d
test byte [bp-00bh], 080h ; f6 46 f5 80
je short 01b21h ; 74 09
mov dx, ax ; 89 c2
neg dx ; f7 da
mov cx, strict word 00001h ; b9 01 00
jmp short 01b27h ; eb 06
xor cx, cx ; 31 c9
mov bx, si ; 89 f3
mov dx, ax ; 89 c2
mov ax, word [bp+004h] ; 8b 46 04
call 01800h ; e8 d3 fc
jmp short 01b7fh ; eb 50
cmp dl, 073h ; 80 fa 73
jne short 01b40h ; 75 0c
mov cx, ds ; 8c d9
mov bx, ax ; 89 c3
mov ax, word [bp+004h] ; 8b 46 04
call 01931h ; e8 f3 fd
jmp short 01b7fh ; eb 3f
cmp dl, 053h ; 80 fa 53
jne short 01b63h ; 75 1e
mov word [bp-00eh], ax ; 89 46 f2
mov ax, word [bp-010h] ; 8b 46 f0
mov word [bp-010h], ax ; 89 46 f0
add word [bp-012h], strict byte 00002h ; 83 46 ee 02
les bx, [bp-012h] ; c4 5e ee
mov ax, word [es:bx-002h] ; 26 8b 47 fe
mov word [bp-00ch], ax ; 89 46 f4
mov bx, ax ; 89 c3
mov cx, word [bp-00eh] ; 8b 4e f2
jmp short 01b38h ; eb d5
cmp dl, 063h ; 80 fa 63
jne short 01b74h ; 75 0c
movzx dx, byte [bp-00ch] ; 0f b6 56 f4
mov ax, word [bp+004h] ; 8b 46 04
call 017c5h ; e8 53 fc
jmp short 01b7fh ; eb 0b
push 000e6h ; 68 e6 00
push strict byte 00007h ; 6a 07
call 01972h ; e8 f6 fd
add sp, strict byte 00004h ; 83 c4 04
xor cx, cx ; 31 c9
jmp short 01b8bh ; eb 08
xor dh, dh ; 30 f6
mov ax, word [bp+004h] ; 8b 46 04
call 017c5h ; e8 3a fc
inc word [bp+006h] ; ff 46 06
jmp near 019a0h ; e9 0f fe
xor ax, ax ; 31 c0
mov word [bp-012h], ax ; 89 46 ee
mov word [bp-010h], ax ; 89 46 f0
test byte [bp+004h], 001h ; f6 46 04 01
je short 01ba3h ; 74 04
cli ; fa
hlt ; f4
jmp short 01ba0h ; eb fd
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
_ata_init: ; 0xf1bad LB 0xc4
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 b2 fa
mov si, 00122h ; be 22 01
mov dx, ax ; 89 c2
xor al, al ; 30 c0
jmp short 01bc7h ; eb 04
cmp AL, strict byte 004h ; 3c 04
jnc short 01bebh ; 73 24
movzx bx, al ; 0f b6 d8
imul bx, bx, strict byte 00006h ; 6b db 06
mov es, dx ; 8e c2
add bx, si ; 01 f3
mov byte [es:bx+001c0h], 000h ; 26 c6 87 c0 01 00
db 066h, 026h, 0c7h, 087h, 0c2h, 001h, 000h, 000h, 000h, 000h
; mov dword [es:bx+001c2h], strict dword 000000000h ; 66 26 c7 87 c2 01 00 00 00 00
mov byte [es:bx+001c1h], 000h ; 26 c6 87 c1 01 00
db 0feh, 0c0h
; inc al ; fe c0
jmp short 01bc3h ; eb d8
xor al, al ; 30 c0
jmp short 01bf3h ; eb 04
cmp AL, strict byte 008h ; 3c 08
jnc short 01c3eh ; 73 4b
movzx bx, al ; 0f b6 d8
imul bx, bx, strict byte 00018h ; 6b db 18
mov es, dx ; 8e c2
add bx, si ; 01 f3
db 066h, 026h, 0c7h, 047h, 01eh, 000h, 000h, 000h, 000h
; mov dword [es:bx+01eh], strict dword 000000000h ; 66 26 c7 47 1e 00 00 00 00
mov byte [es:bx+022h], 000h ; 26 c6 47 22 00
mov word [es:bx+024h], 00200h ; 26 c7 47 24 00 02
mov byte [es:bx+023h], 000h ; 26 c6 47 23 00
db 066h, 026h, 0c7h, 047h, 026h, 000h, 000h, 000h, 000h
; mov dword [es:bx+026h], strict dword 000000000h ; 66 26 c7 47 26 00 00 00 00
db 066h, 026h, 0c7h, 047h, 02ah, 000h, 000h, 000h, 000h
; mov dword [es:bx+02ah], strict dword 000000000h ; 66 26 c7 47 2a 00 00 00 00
db 066h, 026h, 0c7h, 047h, 02eh, 000h, 000h, 000h, 000h
; mov dword [es:bx+02eh], strict dword 000000000h ; 66 26 c7 47 2e 00 00 00 00
db 066h, 026h, 0c7h, 047h, 032h, 000h, 000h, 000h, 000h
; mov dword [es:bx+032h], strict dword 000000000h ; 66 26 c7 47 32 00 00 00 00
db 0feh, 0c0h
; inc al ; fe c0
jmp short 01befh ; eb b1
xor al, al ; 30 c0
jmp short 01c46h ; eb 04
cmp AL, strict byte 010h ; 3c 10
jnc short 01c5dh ; 73 17
movzx bx, al ; 0f b6 d8
mov es, dx ; 8e c2
add bx, si ; 01 f3
mov byte [es:bx+0019fh], 010h ; 26 c6 87 9f 01 10
mov byte [es:bx+001b0h], 010h ; 26 c6 87 b0 01 10
db 0feh, 0c0h
; inc al ; fe c0
jmp short 01c42h ; eb e5
mov es, dx ; 8e c2
mov byte [es:si+0019eh], 000h ; 26 c6 84 9e 01 00
mov byte [es:si+001afh], 000h ; 26 c6 84 af 01 00
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn ; c3
ata_reset_: ; 0xf1c71 LB 0xde
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
push ax ; 50
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 e7 f9
mov word [bp-00eh], 00122h ; c7 46 f2 22 01
mov di, ax ; 89 c7
mov bx, word [bp-010h] ; 8b 5e f0
shr bx, 1 ; d1 eb
mov dl, byte [bp-010h] ; 8a 56 f0
and dl, 001h ; 80 e2 01
mov byte [bp-00ch], dl ; 88 56 f4
xor bh, bh ; 30 ff
imul bx, bx, strict byte 00006h ; 6b db 06
mov es, ax ; 8e c0
add bx, 00122h ; 81 c3 22 01
mov cx, word [es:bx+001c2h] ; 26 8b 8f c2 01
mov si, word [es:bx+001c4h] ; 26 8b b7 c4 01
lea dx, [si+006h] ; 8d 54 06
mov AL, strict byte 00eh ; b0 0e
out DX, AL ; ee
mov bx, 000ffh ; bb ff 00
dec bx ; 4b
test bx, bx ; 85 db
jbe short 01cc9h ; 76 0c
mov dx, cx ; 89 ca
add dx, strict byte 00007h ; 83 c2 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 080h ; a8 80
je short 01cb8h ; 74 ef
lea dx, [si+006h] ; 8d 54 06
mov AL, strict byte 00ah ; b0 0a
out DX, AL ; ee
imul bx, word [bp-010h], strict byte 00018h ; 6b 5e f0 18
mov es, di ; 8e c7
add bx, word [bp-00eh] ; 03 5e f2
cmp byte [es:bx+01eh], 000h ; 26 80 7f 1e 00
je short 01d2bh ; 74 4c
cmp byte [bp-00ch], 000h ; 80 7e f4 00
je short 01ceah ; 74 05
mov ax, 000b0h ; b8 b0 00
jmp short 01cedh ; eb 03
mov ax, 000a0h ; b8 a0 00
mov dx, cx ; 89 ca
add dx, strict byte 00006h ; 83 c2 06
out DX, AL ; ee
mov dx, cx ; 89 ca
inc dx ; 42
inc dx ; 42
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
add dx, strict byte 00003h ; 83 c2 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp bl, 001h ; 80 fb 01
jne short 01d2bh ; 75 22
cmp al, bl ; 38 d8
jne short 01d2bh ; 75 1e
mov bx, strict word 0ffffh ; bb ff ff
dec bx ; 4b
test bx, bx ; 85 db
jbe short 01d2bh ; 76 16
mov dx, cx ; 89 ca
add dx, strict byte 00007h ; 83 c2 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 080h ; a8 80
je short 01d2bh ; 74 0a
mov ax, strict word 0ffffh ; b8 ff ff
dec ax ; 48
test ax, ax ; 85 c0
jnbe short 01d24h ; 77 fb
jmp short 01d10h ; eb e5
mov bx, strict word 00010h ; bb 10 00
dec bx ; 4b
test bx, bx ; 85 db
jbe short 01d3fh ; 76 0c
mov dx, cx ; 89 ca
add dx, strict byte 00007h ; 83 c2 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 040h ; a8 40
je short 01d2eh ; 74 ef
lea dx, [si+006h] ; 8d 54 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; 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
ata_cmd_data_in_: ; 0xf1d4f LB 0x258
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0001ch ; 83 ec 1c
mov si, ax ; 89 c6
mov word [bp-00ah], dx ; 89 56 f6
mov word [bp-016h], bx ; 89 5e ea
mov word [bp-014h], cx ; 89 4e ec
mov es, dx ; 8e c2
movzx ax, byte [es:si+008h] ; 26 0f b6 44 08
mov dx, ax ; 89 c2
shr dx, 1 ; d1 ea
mov dh, al ; 88 c6
and dh, 001h ; 80 e6 01
mov byte [bp-008h], dh ; 88 76 f8
movzx di, dl ; 0f b6 fa
imul di, di, strict byte 00006h ; 6b ff 06
add di, si ; 01 f7
mov bx, word [es:di+001c2h] ; 26 8b 9d c2 01
mov dx, word [es:di+001c4h] ; 26 8b 95 c4 01
mov word [bp-01ch], dx ; 89 56 e4
imul ax, ax, strict byte 00018h ; 6b c0 18
mov di, si ; 89 f7
add di, ax ; 01 c7
mov al, byte [es:di+022h] ; 26 8a 45 22
mov byte [bp-006h], al ; 88 46 fa
mov ax, word [es:di+024h] ; 26 8b 45 24
mov word [bp-00ch], ax ; 89 46 f4
test ax, ax ; 85 c0
jne short 01db7h ; 75 14
cmp byte [bp-006h], 001h ; 80 7e fa 01
jne short 01db0h ; 75 07
mov word [bp-00ch], 04000h ; c7 46 f4 00 40
jmp short 01dc6h ; eb 16
mov word [bp-00ch], 08000h ; c7 46 f4 00 80
jmp short 01dc6h ; eb 0f
cmp byte [bp-006h], 001h ; 80 7e fa 01
jne short 01dc3h ; 75 06
shr word [bp-00ch], 002h ; c1 6e f4 02
jmp short 01dc6h ; eb 03
shr word [bp-00ch], 1 ; d1 6e f4
lea dx, [bx+007h] ; 8d 57 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 080h ; a8 80
je short 01ddfh ; 74 0f
mov dx, word [bp-01ch] ; 8b 56 e4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, strict word 00001h ; ba 01 00
jmp near 01f9eh ; e9 bf 01
mov es, [bp-00ah] ; 8e 46 f6
mov ax, word [es:si] ; 26 8b 04
mov word [bp-020h], ax ; 89 46 e0
mov ax, word [es:si+002h] ; 26 8b 44 02
mov word [bp-01eh], ax ; 89 46 e2
mov di, word [es:si+004h] ; 26 8b 7c 04
mov ax, word [es:si+006h] ; 26 8b 44 06
mov word [bp-00eh], ax ; 89 46 f2
mov ax, word [es:si+012h] ; 26 8b 44 12
mov word [bp-010h], ax ; 89 46 f0
mov ax, word [es:si+00eh] ; 26 8b 44 0e
mov word [bp-012h], ax ; 89 46 ee
mov ax, word [es:si+010h] ; 26 8b 44 10
mov word [bp-018h], ax ; 89 46 e8
mov ax, word [bp-010h] ; 8b 46 f0
test ax, ax ; 85 c0
jne short 01e7dh ; 75 67
mov dx, word [bp-020h] ; 8b 56 e0
add dx, word [bp-014h] ; 03 56 ec
adc ax, word [bp-01eh] ; 13 46 e2
cmp ax, 01000h ; 3d 00 10
jnbe short 01e26h ; 77 02
jne short 01e51h ; 75 2b
mov ax, word [bp-01eh] ; 8b 46 e2
xor al, al ; 30 c0
shr ax, 008h ; c1 e8 08
mov word [bp-010h], ax ; 89 46 f0
mov ax, word [bp-014h] ; 8b 46 ec
xor al, al ; 30 c0
shr ax, 008h ; c1 e8 08
lea dx, [bx+002h] ; 8d 57 02
out DX, AL ; ee
lea dx, [bx+003h] ; 8d 57 03
mov al, byte [bp-010h] ; 8a 46 f0
out DX, AL ; ee
lea dx, [bx+004h] ; 8d 57 04
xor al, al ; 30 c0
out DX, AL ; ee
lea dx, [bx+005h] ; 8d 57 05
out DX, AL ; ee
mov byte [bp-01dh], al ; 88 46 e3
mov ax, word [bp-020h] ; 8b 46 e0
xor ah, ah ; 30 e4
mov word [bp-010h], ax ; 89 46 f0
mov cx, strict word 00008h ; b9 08 00
shr word [bp-01eh], 1 ; d1 6e e2
rcr word [bp-020h], 1 ; d1 5e e0
loop 01e5ch ; e2 f8
mov ax, word [bp-020h] ; 8b 46 e0
mov word [bp-012h], ax ; 89 46 ee
mov ax, word [bp-01eh] ; 8b 46 e2
mov word [bp-020h], ax ; 89 46 e0
mov word [bp-01eh], strict word 00000h ; c7 46 e2 00 00
and ax, strict word 0000fh ; 25 0f 00
or AL, strict byte 040h ; 0c 40
mov word [bp-018h], ax ; 89 46 e8
mov dx, word [bp-01ch] ; 8b 56 e4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 00ah ; b0 0a
out DX, AL ; ee
lea dx, [bx+001h] ; 8d 57 01
xor al, al ; 30 c0
out DX, AL ; ee
lea dx, [bx+002h] ; 8d 57 02
mov al, byte [bp-014h] ; 8a 46 ec
out DX, AL ; ee
lea dx, [bx+003h] ; 8d 57 03
mov al, byte [bp-010h] ; 8a 46 f0
out DX, AL ; ee
mov ax, word [bp-012h] ; 8b 46 ee
lea dx, [bx+004h] ; 8d 57 04
out DX, AL ; ee
shr ax, 008h ; c1 e8 08
lea dx, [bx+005h] ; 8d 57 05
out DX, AL ; ee
cmp byte [bp-008h], 000h ; 80 7e f8 00
je short 01eb3h ; 74 05
mov ax, 000b0h ; b8 b0 00
jmp short 01eb6h ; eb 03
mov ax, 000a0h ; b8 a0 00
movzx dx, byte [bp-018h] ; 0f b6 56 e8
or ax, dx ; 09 d0
lea dx, [bx+006h] ; 8d 57 06
out DX, AL ; ee
lea dx, [bx+007h] ; 8d 57 07
mov al, byte [bp-016h] ; 8a 46 ea
out DX, AL ; ee
mov ax, word [bp-016h] ; 8b 46 ea
cmp ax, 000c4h ; 3d c4 00
je short 01ed4h ; 74 05
cmp ax, strict word 00029h ; 3d 29 00
jne short 01ee1h ; 75 0d
mov ax, word [bp-014h] ; 8b 46 ec
mov word [bp-01ah], ax ; 89 46 e6
mov word [bp-014h], strict word 00001h ; c7 46 ec 01 00
jmp short 01ee6h ; eb 05
mov word [bp-01ah], strict word 00001h ; c7 46 e6 01 00
lea dx, [bx+007h] ; 8d 57 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov dl, al ; 88 c2
test AL, strict byte 080h ; a8 80
jne short 01ee6h ; 75 f4
test AL, strict byte 001h ; a8 01
je short 01f05h ; 74 0f
mov dx, word [bp-01ch] ; 8b 56 e4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, strict word 00002h ; ba 02 00
jmp near 01f9eh ; e9 99 00
test dl, 008h ; f6 c2 08
jne short 01f19h ; 75 0f
mov dx, word [bp-01ch] ; 8b 56 e4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, strict word 00003h ; ba 03 00
jmp near 01f9eh ; e9 85 00
sti ; fb
cmp di, 0f800h ; 81 ff 00 f8
jc short 01f2dh ; 72 0d
sub di, 00800h ; 81 ef 00 08
mov ax, word [bp-00eh] ; 8b 46 f2
add ax, 00080h ; 05 80 00
mov word [bp-00eh], ax ; 89 46 f2
cmp byte [bp-006h], 001h ; 80 7e fa 01
jne short 01f40h ; 75 0d
mov dx, bx ; 89 da
mov cx, word [bp-00ch] ; 8b 4e f4
mov es, [bp-00eh] ; 8e 46 f2
db 0f3h, 066h, 06dh
; rep insd ; f3 66 6d
jmp short 01f4ah ; eb 0a
mov dx, bx ; 89 da
mov cx, word [bp-00ch] ; 8b 4e f4
mov es, [bp-00eh] ; 8e 46 f2
rep insw ; f3 6d
mov ax, word [bp-01ah] ; 8b 46 e6
mov es, [bp-00ah] ; 8e 46 f6
add word [es:si+014h], ax ; 26 01 44 14
dec word [bp-014h] ; ff 4e ec
lea dx, [bx+007h] ; 8d 57 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov dl, al ; 88 c2
test AL, strict byte 080h ; a8 80
jne short 01f57h ; 75 f4
cmp word [bp-014h], strict byte 00000h ; 83 7e ec 00
jne short 01f7dh ; 75 14
and AL, strict byte 0c9h ; 24 c9
cmp AL, strict byte 040h ; 3c 40
je short 01f93h ; 74 24
mov dx, word [bp-01ch] ; 8b 56 e4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, strict word 00004h ; ba 04 00
jmp short 01f9eh ; eb 21
mov al, dl ; 88 d0
and AL, strict byte 0c9h ; 24 c9
cmp AL, strict byte 048h ; 3c 48
je short 01f1ah ; 74 95
mov dx, word [bp-01ch] ; 8b 56 e4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, strict word 00005h ; ba 05 00
jmp short 01f9eh ; eb 0b
mov dx, word [bp-01ch] ; 8b 56 e4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
xor dx, dx ; 31 d2
mov ax, dx ; 89 d0
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
_ata_detect: ; 0xf1fa7 LB 0x617
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, 0025ch ; 81 ec 5c 02
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 b3 f6
mov word [bp-024h], ax ; 89 46 dc
mov di, 00122h ; bf 22 01
mov es, ax ; 8e c0
mov word [bp-028h], di ; 89 7e d8
mov word [bp-026h], ax ; 89 46 da
mov byte [es:di+001c0h], 000h ; 26 c6 85 c0 01 00
db 066h, 026h, 0c7h, 085h, 0c2h, 001h, 0f0h, 001h, 0f0h, 003h
; mov dword [es:di+001c2h], strict dword 003f001f0h ; 66 26 c7 85 c2 01 f0 01 f0 03
mov byte [es:di+001c1h], 00eh ; 26 c6 85 c1 01 0e
mov byte [es:di+001c6h], 000h ; 26 c6 85 c6 01 00
db 066h, 026h, 0c7h, 085h, 0c8h, 001h, 070h, 001h, 070h, 003h
; mov dword [es:di+001c8h], strict dword 003700170h ; 66 26 c7 85 c8 01 70 01 70 03
mov byte [es:di+001c7h], 00fh ; 26 c6 85 c7 01 0f
xor al, al ; 30 c0
mov byte [bp-00ah], al ; 88 46 f6
mov byte [bp-006h], al ; 88 46 fa
mov byte [bp-00eh], al ; 88 46 f2
jmp near 02549h ; e9 48 05
mov ax, 000a0h ; b8 a0 00
lea dx, [si+006h] ; 8d 54 06
out DX, AL ; ee
lea di, [si+002h] ; 8d 7c 02
mov AL, strict byte 055h ; b0 55
mov dx, di ; 89 fa
out DX, AL ; ee
lea bx, [si+003h] ; 8d 5c 03
mov AL, strict byte 0aah ; b0 aa
mov dx, bx ; 89 da
out DX, AL ; ee
mov dx, di ; 89 fa
out DX, AL ; ee
mov AL, strict byte 055h ; b0 55
mov dx, bx ; 89 da
out DX, AL ; ee
mov dx, di ; 89 fa
out DX, AL ; ee
mov AL, strict byte 0aah ; b0 aa
mov dx, bx ; 89 da
out DX, AL ; ee
mov dx, di ; 89 fa
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov cx, ax ; 89 c1
mov dx, bx ; 89 da
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp cl, 055h ; 80 f9 55
jne near 020fbh ; 0f 85 c0 00
cmp AL, strict byte 0aah ; 3c aa
jne near 020fbh ; 0f 85 ba 00
movzx ax, byte [bp-00eh] ; 0f b6 46 f2
imul ax, ax, strict byte 00018h ; 6b c0 18
les bx, [bp-028h] ; c4 5e d8
add bx, ax ; 01 c3
mov byte [es:bx+01eh], 001h ; 26 c6 47 1e 01
movzx ax, byte [bp-00eh] ; 0f b6 46 f2
call 01c71h ; e8 18 fc
cmp byte [bp-008h], 000h ; 80 7e f8 00
je short 02064h ; 74 05
mov ax, 000b0h ; b8 b0 00
jmp short 02067h ; eb 03
mov ax, 000a0h ; b8 a0 00
lea dx, [si+006h] ; 8d 54 06
out DX, AL ; ee
lea dx, [si+002h] ; 8d 54 02
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov bx, ax ; 89 c3
lea dx, [si+003h] ; 8d 54 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp bl, 001h ; 80 fb 01
jne near 020fbh ; 0f 85 7b 00
cmp al, bl ; 38 d8
jne near 020fbh ; 0f 85 75 00
lea dx, [si+004h] ; 8d 54 04
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov bx, ax ; 89 c3
mov bh, al ; 88 c7
lea dx, [si+005h] ; 8d 54 05
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov cx, ax ; 89 c1
mov byte [bp-00ch], al ; 88 46 f4
lea dx, [si+007h] ; 8d 54 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp bl, 014h ; 80 fb 14
jne short 020beh ; 75 18
cmp cl, 0ebh ; 80 f9 eb
jne short 020beh ; 75 13
movzx ax, byte [bp-00eh] ; 0f b6 46 f2
imul ax, ax, strict byte 00018h ; 6b c0 18
les bx, [bp-028h] ; c4 5e d8
add bx, ax ; 01 c3
mov byte [es:bx+01eh], 003h ; 26 c6 47 1e 03
jmp short 020fbh ; eb 3d
test bh, bh ; 84 ff
jne short 020e0h ; 75 1e
cmp byte [bp-00ch], 000h ; 80 7e f4 00
jne short 020e0h ; 75 18
test al, al ; 84 c0
je short 020e0h ; 74 14
movzx bx, byte [bp-00eh] ; 0f b6 5e f2
imul bx, bx, strict byte 00018h ; 6b db 18
mov es, [bp-026h] ; 8e 46 da
add bx, word [bp-028h] ; 03 5e d8
mov byte [es:bx+01eh], 002h ; 26 c6 47 1e 02
jmp short 020fbh ; eb 1b
cmp bh, 0ffh ; 80 ff ff
jne short 020fbh ; 75 16
cmp bh, byte [bp-00ch] ; 3a 7e f4
jne short 020fbh ; 75 11
movzx ax, byte [bp-00eh] ; 0f b6 46 f2
imul ax, ax, strict byte 00018h ; 6b c0 18
les bx, [bp-028h] ; c4 5e d8
add bx, ax ; 01 c3
mov byte [es:bx+01eh], 000h ; 26 c6 47 1e 00
mov dx, word [bp-02ch] ; 8b 56 d4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
movzx si, byte [bp-00eh] ; 0f b6 76 f2
imul si, si, strict byte 00018h ; 6b f6 18
mov es, [bp-026h] ; 8e 46 da
add si, word [bp-028h] ; 03 76 d8
mov al, byte [es:si+01eh] ; 26 8a 44 1e
mov byte [bp-010h], al ; 88 46 f0
cmp AL, strict byte 002h ; 3c 02
jne near 02321h ; 0f 85 03 02
mov byte [es:si+01fh], 0ffh ; 26 c6 44 1f ff
mov byte [es:si+022h], 000h ; 26 c6 44 22 00
lea dx, [bp-00260h] ; 8d 96 a0 fd
mov bx, word [bp-028h] ; 8b 5e d8
mov word [es:bx+004h], dx ; 26 89 57 04
mov [es:bx+006h], ss ; 26 8c 57 06
mov al, byte [bp-00eh] ; 8a 46 f2
mov byte [es:bx+008h], al ; 26 88 47 08
mov cx, strict word 00001h ; b9 01 00
mov bx, 000ech ; bb ec 00
mov ax, word [bp-028h] ; 8b 46 d8
mov dx, es ; 8c c2
call 01d4fh ; e8 03 fc
test ax, ax ; 85 c0
je short 0215bh ; 74 0b
push 00104h ; 68 04 01
push strict byte 00007h ; 6a 07
call 01972h ; e8 1a f8
add sp, strict byte 00004h ; 83 c4 04
test byte [bp-00260h], 080h ; f6 86 a0 fd 80
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
xor ah, ah ; 30 e4
mov byte [bp-014h], al ; 88 46 ec
cmp byte [bp-00200h], 000h ; 80 be 00 fe 00
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
xor ah, ah ; 30 e4
mov byte [bp-016h], al ; 88 46 ea
mov word [bp-022h], 00200h ; c7 46 de 00 02
mov ax, word [bp-0025eh] ; 8b 86 a2 fd
mov word [bp-01ah], ax ; 89 46 e6
mov ax, word [bp-0025ah] ; 8b 86 a6 fd
mov word [bp-01ch], ax ; 89 46 e4
mov ax, word [bp-00254h] ; 8b 86 ac fd
mov word [bp-01eh], ax ; 89 46 e2
mov ax, word [bp-001e8h] ; 8b 86 18 fe
mov word [bp-020h], ax ; 89 46 e0
mov si, word [bp-001e6h] ; 8b b6 1a fe
cmp si, 00fffh ; 81 fe ff 0f
jne short 021b0h ; 75 10
cmp ax, strict word 0ffffh ; 3d ff ff
jne short 021b0h ; 75 0b
mov ax, word [bp-00198h] ; 8b 86 68 fe
mov word [bp-020h], ax ; 89 46 e0
mov si, word [bp-00196h] ; 8b b6 6a fe
mov al, byte [bp-00eh] ; 8a 46 f2
cmp AL, strict byte 001h ; 3c 01
jc short 021c3h ; 72 0c
jbe short 021cbh ; 76 12
cmp AL, strict byte 003h ; 3c 03
je short 021d3h ; 74 16
cmp AL, strict byte 002h ; 3c 02
je short 021cfh ; 74 0e
jmp short 02210h ; eb 4d
test al, al ; 84 c0
jne short 02210h ; 75 49
mov BL, strict byte 01eh ; b3 1e
jmp short 021d5h ; eb 0a
mov BL, strict byte 026h ; b3 26
jmp short 021d5h ; eb 06
mov BL, strict byte 067h ; b3 67
jmp short 021d5h ; eb 02
mov BL, strict byte 070h ; b3 70
mov al, bl ; 88 d8
db 0feh, 0c0h
; inc al ; fe c0
xor ah, ah ; 30 e4
call 016ach ; e8 ce f4
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
sal dx, 008h ; c1 e2 08
movzx ax, bl ; 0f b6 c3
call 016ach ; e8 c1 f4
xor ah, ah ; 30 e4
add ax, dx ; 01 d0
mov word [bp-034h], ax ; 89 46 cc
mov al, bl ; 88 d8
add AL, strict byte 002h ; 04 02
xor ah, ah ; 30 e4
call 016ach ; e8 b1 f4
xor ah, ah ; 30 e4
mov word [bp-036h], ax ; 89 46 ca
mov al, bl ; 88 d8
add AL, strict byte 007h ; 04 07
xor ah, ah ; 30 e4
call 016ach ; e8 a3 f4
xor ah, ah ; 30 e4
mov word [bp-032h], ax ; 89 46 ce
jmp short 0221dh ; eb 0d
mov bx, word [bp-020h] ; 8b 5e e0
mov cx, si ; 89 f1
mov dx, ss ; 8c d2
lea ax, [bp-036h] ; 8d 46 ca
call 055b6h ; e8 99 33
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 09 f7
mov ax, word [bp-032h] ; 8b 46 ce
push ax ; 50
mov ax, word [bp-036h] ; 8b 46 ca
push ax ; 50
mov ax, word [bp-034h] ; 8b 46 cc
push ax ; 50
push word [bp-01eh] ; ff 76 e2
push word [bp-01ch] ; ff 76 e4
push word [bp-01ah] ; ff 76 e6
movzx ax, byte [bp-008h] ; 0f b6 46 f8
push ax ; 50
movzx ax, byte [bp-018h] ; 0f b6 46 e8
push ax ; 50
push 0012dh ; 68 2d 01
push strict byte 00004h ; 6a 04
call 01972h ; e8 23 f7
add sp, strict byte 00014h ; 83 c4 14
movzx ax, byte [bp-00eh] ; 0f b6 46 f2
imul ax, ax, strict byte 00018h ; 6b c0 18
les di, [bp-028h] ; c4 7e d8
add di, ax ; 01 c7
mov byte [es:di+01fh], 0ffh ; 26 c6 45 1f ff
mov al, byte [bp-014h] ; 8a 46 ec
mov byte [es:di+020h], al ; 26 88 45 20
mov al, byte [bp-016h] ; 8a 46 ea
mov byte [es:di+022h], al ; 26 88 45 22
mov ax, word [bp-022h] ; 8b 46 de
mov word [es:di+024h], ax ; 26 89 45 24
mov ax, word [bp-01ch] ; 8b 46 e4
mov word [es:di+02ch], ax ; 26 89 45 2c
mov ax, word [bp-01ah] ; 8b 46 e6
mov word [es:di+02eh], ax ; 26 89 45 2e
mov ax, word [bp-01eh] ; 8b 46 e2
mov word [es:di+030h], ax ; 26 89 45 30
mov ax, word [bp-020h] ; 8b 46 e0
mov word [es:di+032h], ax ; 26 89 45 32
mov word [es:di+034h], si ; 26 89 75 34
lea di, [di+026h] ; 8d 7d 26
push DS ; 1e
push SS ; 16
pop DS ; 1f
lea si, [bp-036h] ; 8d 76 ca
movsw ; a5
movsw ; a5
movsw ; a5
pop DS ; 1f
mov al, byte [bp-00eh] ; 8a 46 f2
cmp AL, strict byte 002h ; 3c 02
jnc short 0230ch ; 73 60
test al, al ; 84 c0
jne short 022b5h ; 75 05
mov di, strict word 0003dh ; bf 3d 00
jmp short 022b8h ; eb 03
mov di, strict word 0004dh ; bf 4d 00
mov dx, word [bp-024h] ; 8b 56 dc
mov ax, word [bp-034h] ; 8b 46 cc
mov es, dx ; 8e c2
mov word [es:di], ax ; 26 89 05
mov al, byte [bp-036h] ; 8a 46 ca
mov byte [es:di+002h], al ; 26 88 45 02
mov byte [es:di+003h], 0a0h ; 26 c6 45 03 a0
mov al, byte [bp-01eh] ; 8a 46 e2
mov byte [es:di+004h], al ; 26 88 45 04
mov ax, word [bp-01ah] ; 8b 46 e6
mov word [es:di+009h], ax ; 26 89 45 09
mov al, byte [bp-01ch] ; 8a 46 e4
mov byte [es:di+00bh], al ; 26 88 45 0b
mov al, byte [bp-01eh] ; 8a 46 e2
mov byte [es:di+00eh], al ; 26 88 45 0e
xor al, al ; 30 c0
xor ah, ah ; 30 e4
jmp short 022f6h ; eb 05
cmp ah, 00fh ; 80 fc 0f
jnc short 02304h ; 73 0e
movzx bx, ah ; 0f b6 dc
mov es, dx ; 8e c2
add bx, di ; 01 fb
add al, byte [es:bx] ; 26 02 07
db 0feh, 0c4h
; inc ah ; fe c4
jmp short 022f1h ; eb ed
neg al ; f6 d8
mov es, dx ; 8e c2
mov byte [es:di+00fh], al ; 26 88 45 0f
movzx bx, byte [bp-006h] ; 0f b6 5e fa
mov es, [bp-026h] ; 8e 46 da
add bx, word [bp-028h] ; 03 5e d8
mov al, byte [bp-00eh] ; 8a 46 f2
mov byte [es:bx+0019fh], al ; 26 88 87 9f 01
inc byte [bp-006h] ; fe 46 fa
cmp byte [bp-010h], 003h ; 80 7e f0 03
jne near 023c1h ; 0f 85 98 00
movzx ax, byte [bp-00eh] ; 0f b6 46 f2
imul ax, ax, strict byte 00018h ; 6b c0 18
les bx, [bp-028h] ; c4 5e d8
add bx, ax ; 01 c3
mov byte [es:bx+01fh], 005h ; 26 c6 47 1f 05
mov byte [es:bx+022h], 000h ; 26 c6 47 22 00
lea dx, [bp-00260h] ; 8d 96 a0 fd
mov bx, word [bp-028h] ; 8b 5e d8
mov word [es:bx+004h], dx ; 26 89 57 04
mov [es:bx+006h], ss ; 26 8c 57 06
mov al, byte [bp-00eh] ; 8a 46 f2
mov byte [es:bx+008h], al ; 26 88 47 08
mov cx, strict word 00001h ; b9 01 00
mov bx, 000a1h ; bb a1 00
mov ax, word [bp-028h] ; 8b 46 d8
mov dx, es ; 8c c2
call 01d4fh ; e8 ec f9
test ax, ax ; 85 c0
je short 02372h ; 74 0b
push 00154h ; 68 54 01
push strict byte 00007h ; 6a 07
call 01972h ; e8 03 f6
add sp, strict byte 00004h ; 83 c4 04
mov cl, byte [bp-0025fh] ; 8a 8e a1 fd
and cl, 01fh ; 80 e1 1f
test byte [bp-00260h], 080h ; f6 86 a0 fd 80
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
cmp byte [bp-00200h], 000h ; 80 be 00 fe 00
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
movzx ax, byte [bp-00eh] ; 0f b6 46 f2
imul ax, ax, strict byte 00018h ; 6b c0 18
les si, [bp-028h] ; c4 76 d8
add si, ax ; 01 c6
mov byte [es:si+01fh], cl ; 26 88 4c 1f
mov byte [es:si+020h], dl ; 26 88 54 20
mov byte [es:si+022h], bl ; 26 88 5c 22
mov word [es:si+024h], 00800h ; 26 c7 44 24 00 08
movzx bx, byte [bp-00ah] ; 0f b6 5e f6
add bx, word [bp-028h] ; 03 5e d8
mov al, byte [bp-00eh] ; 8a 46 f2
mov byte [es:bx+001b0h], al ; 26 88 87 b0 01
inc byte [bp-00ah] ; fe 46 f6
mov al, byte [bp-010h] ; 8a 46 f0
cmp AL, strict byte 003h ; 3c 03
je short 023f4h ; 74 2c
cmp AL, strict byte 002h ; 3c 02
jne near 02457h ; 0f 85 89 00
movzx bx, byte [bp-00eh] ; 0f b6 5e f2
imul bx, bx, strict byte 00018h ; 6b db 18
mov es, [bp-026h] ; 8e 46 da
add bx, word [bp-028h] ; 03 5e d8
mov ax, word [es:bx+032h] ; 26 8b 47 32
mov word [bp-030h], ax ; 89 46 d0
mov ax, word [es:bx+034h] ; 26 8b 47 34
mov word [bp-02eh], ax ; 89 46 d2
mov cx, strict word 0000bh ; b9 0b 00
shr word [bp-02eh], 1 ; d1 6e d2
rcr word [bp-030h], 1 ; d1 5e d0
loop 023ech ; e2 f8
movzx dx, byte [bp-001bfh] ; 0f b6 96 41 fe
sal dx, 008h ; c1 e2 08
movzx ax, byte [bp-001c0h] ; 0f b6 86 40 fe
or dx, ax ; 09 c2
mov byte [bp-012h], 00fh ; c6 46 ee 0f
jmp short 02412h ; eb 09
dec byte [bp-012h] ; fe 4e ee
cmp byte [bp-012h], 000h ; 80 7e ee 00
jbe short 0241fh ; 76 0d
movzx cx, byte [bp-012h] ; 0f b6 4e ee
mov ax, strict word 00001h ; b8 01 00
sal ax, CL ; d3 e0
test dx, ax ; 85 c2
je short 02409h ; 74 ea
xor di, di ; 31 ff
jmp short 02428h ; eb 05
cmp di, strict byte 00014h ; 83 ff 14
jnl short 0243dh ; 7d 15
mov si, di ; 89 fe
add si, di ; 01 fe
mov al, byte [bp+si-00229h] ; 8a 82 d7 fd
mov byte [bp+si-060h], al ; 88 42 a0
mov al, byte [bp+si-0022ah] ; 8a 82 d6 fd
mov byte [bp+si-05fh], al ; 88 42 a1
inc di ; 47
jmp short 02423h ; eb e6
mov byte [bp-038h], 000h ; c6 46 c8 00
mov di, strict word 00027h ; bf 27 00
jmp short 0244bh ; eb 05
dec di ; 4f
test di, di ; 85 ff
jle short 02457h ; 7e 0c
cmp byte [bp+di-060h], 020h ; 80 7b a0 20
jne short 02457h ; 75 06
mov byte [bp+di-060h], 000h ; c6 43 a0 00
jmp short 02446h ; eb ef
mov al, byte [bp-010h] ; 8a 46 f0
cmp AL, strict byte 003h ; 3c 03
je short 024bah ; 74 5c
cmp AL, strict byte 002h ; 3c 02
je short 0246bh ; 74 09
cmp AL, strict byte 001h ; 3c 01
je near 02521h ; 0f 84 b9 00
jmp near 02540h ; e9 d5 00
cmp byte [bp-008h], 000h ; 80 7e f8 00
je short 02476h ; 74 05
mov ax, 0017fh ; b8 7f 01
jmp short 02479h ; eb 03
mov ax, 00186h ; b8 86 01
push ax ; 50
movzx ax, byte [bp-018h] ; 0f b6 46 e8
push ax ; 50
push 0018dh ; 68 8d 01
push strict byte 00002h ; 6a 02
call 01972h ; e8 eb f4
add sp, strict byte 00008h ; 83 c4 08
xor di, di ; 31 ff
movzx ax, byte [bp+di-060h] ; 0f b6 43 a0
inc di ; 47
test ax, ax ; 85 c0
je short 024a3h ; 74 0e
push ax ; 50
push 00198h ; 68 98 01
push strict byte 00002h ; 6a 02
call 01972h ; e8 d4 f4
add sp, strict byte 00006h ; 83 c4 06
jmp short 0248ch ; eb e9
push dword [bp-030h] ; 66 ff 76 d0
movzx ax, byte [bp-012h] ; 0f b6 46 ee
push ax ; 50
push 0019bh ; 68 9b 01
push strict byte 00002h ; 6a 02
call 01972h ; e8 be f4
add sp, strict byte 0000ah ; 83 c4 0a
jmp near 02540h ; e9 86 00
cmp byte [bp-008h], 000h ; 80 7e f8 00
je short 024c5h ; 74 05
mov ax, 0017fh ; b8 7f 01
jmp short 024c8h ; eb 03
mov ax, 00186h ; b8 86 01
push ax ; 50
movzx ax, byte [bp-018h] ; 0f b6 46 e8
push ax ; 50
push 0018dh ; 68 8d 01
push strict byte 00002h ; 6a 02
call 01972h ; e8 9c f4
add sp, strict byte 00008h ; 83 c4 08
xor di, di ; 31 ff
movzx ax, byte [bp+di-060h] ; 0f b6 43 a0
inc di ; 47
test ax, ax ; 85 c0
je short 024f2h ; 74 0e
push ax ; 50
push 00198h ; 68 98 01
push strict byte 00002h ; 6a 02
call 01972h ; e8 85 f4
add sp, strict byte 00006h ; 83 c4 06
jmp short 024dbh ; eb e9
movzx ax, byte [bp-00eh] ; 0f b6 46 f2
imul ax, ax, strict byte 00018h ; 6b c0 18
les bx, [bp-028h] ; c4 5e d8
add bx, ax ; 01 c3
cmp byte [es:bx+01fh], 005h ; 26 80 7f 1f 05
jne short 0250fh ; 75 0a
movzx ax, byte [bp-012h] ; 0f b6 46 ee
push ax ; 50
push 001bbh ; 68 bb 01
jmp short 02517h ; eb 08
movzx ax, byte [bp-012h] ; 0f b6 46 ee
push ax ; 50
push 001d5h ; 68 d5 01
push strict byte 00002h ; 6a 02
call 01972h ; e8 56 f4
add sp, strict byte 00006h ; 83 c4 06
jmp short 02540h ; eb 1f
cmp byte [bp-008h], 000h ; 80 7e f8 00
je short 0252ch ; 74 05
mov ax, 0017fh ; b8 7f 01
jmp short 0252fh ; eb 03
mov ax, 00186h ; b8 86 01
push ax ; 50
movzx ax, byte [bp-018h] ; 0f b6 46 e8
push ax ; 50
push 001e7h ; 68 e7 01
push strict byte 00002h ; 6a 02
call 01972h ; e8 35 f4
add sp, strict byte 00008h ; 83 c4 08
inc byte [bp-00eh] ; fe 46 f2
cmp byte [bp-00eh], 008h ; 80 7e f2 08
jnc short 02597h ; 73 4e
movzx bx, byte [bp-00eh] ; 0f b6 5e f2
mov ax, bx ; 89 d8
cwd ; 99
db 02bh, 0c2h
; sub ax, dx ; 2b c2
sar ax, 1 ; d1 f8
mov word [bp-02ah], ax ; 89 46 d6
mov al, byte [bp-02ah] ; 8a 46 d6
mov byte [bp-018h], al ; 88 46 e8
mov ax, bx ; 89 d8
cwd ; 99
mov bx, strict word 00002h ; bb 02 00
idiv bx ; f7 fb
mov cx, dx ; 89 d1
mov byte [bp-008h], dl ; 88 56 f8
movzx ax, byte [bp-02ah] ; 0f b6 46 d6
imul ax, ax, strict byte 00006h ; 6b c0 06
les bx, [bp-028h] ; c4 5e d8
add bx, ax ; 01 c3
mov si, word [es:bx+001c2h] ; 26 8b b7 c2 01
mov ax, word [es:bx+001c4h] ; 26 8b 87 c4 01
mov word [bp-02ch], ax ; 89 46 d4
mov dx, ax ; 89 c2
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 00ah ; b0 0a
out DX, AL ; ee
test cl, cl ; 84 c9
je near 02001h ; 0f 84 70 fa
mov ax, 000b0h ; b8 b0 00
jmp near 02004h ; e9 6d fa
mov al, byte [bp-006h] ; 8a 46 fa
les bx, [bp-028h] ; c4 5e d8
mov byte [es:bx+0019eh], al ; 26 88 87 9e 01
mov al, byte [bp-00ah] ; 8a 46 f6
mov byte [es:bx+001afh], al ; 26 88 87 af 01
movzx bx, byte [bp-006h] ; 0f b6 5e fa
mov dx, strict word 00075h ; ba 75 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 a7 f0
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
ata_cmd_data_out_: ; 0xf25be LB 0x21a
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0001ah ; 83 ec 1a
mov di, ax ; 89 c7
mov word [bp-00ah], dx ; 89 56 f6
mov word [bp-01ah], bx ; 89 5e e6
mov word [bp-00eh], cx ; 89 4e f2
mov es, dx ; 8e c2
movzx ax, byte [es:di+008h] ; 26 0f b6 45 08
mov dx, ax ; 89 c2
shr dx, 1 ; d1 ea
mov dh, al ; 88 c6
and dh, 001h ; 80 e6 01
mov byte [bp-006h], dh ; 88 76 fa
movzx si, dl ; 0f b6 f2
imul si, si, strict byte 00006h ; 6b f6 06
add si, di ; 01 fe
mov bx, word [es:si+001c2h] ; 26 8b 9c c2 01
mov dx, word [es:si+001c4h] ; 26 8b 94 c4 01
mov word [bp-00ch], dx ; 89 56 f4
imul ax, ax, strict byte 00018h ; 6b c0 18
mov si, di ; 89 fe
add si, ax ; 01 c6
mov al, byte [es:si+022h] ; 26 8a 44 22
mov byte [bp-008h], al ; 88 46 f8
cmp AL, strict byte 001h ; 3c 01
jne short 02612h ; 75 07
mov word [bp-012h], 00080h ; c7 46 ee 80 00
jmp short 02617h ; eb 05
mov word [bp-012h], 00100h ; c7 46 ee 00 01
lea dx, [bx+007h] ; 8d 57 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 080h ; a8 80
je short 02630h ; 74 0f
mov dx, word [bp-00ch] ; 8b 56 f4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, strict word 00001h ; ba 01 00
jmp near 027cfh ; e9 9f 01
mov es, [bp-00ah] ; 8e 46 f6
mov ax, word [es:di] ; 26 8b 05
mov word [bp-01eh], ax ; 89 46 e2
mov ax, word [es:di+002h] ; 26 8b 45 02
mov word [bp-01ch], ax ; 89 46 e4
mov si, word [es:di+004h] ; 26 8b 75 04
mov ax, word [es:di+006h] ; 26 8b 45 06
mov word [bp-018h], ax ; 89 46 e8
mov ax, word [es:di+012h] ; 26 8b 45 12
mov word [bp-010h], ax ; 89 46 f0
mov ax, word [es:di+00eh] ; 26 8b 45 0e
mov word [bp-016h], ax ; 89 46 ea
mov ax, word [es:di+010h] ; 26 8b 45 10
mov word [bp-014h], ax ; 89 46 ec
mov ax, word [bp-010h] ; 8b 46 f0
test ax, ax ; 85 c0
jne short 026ceh ; 75 67
mov dx, word [bp-01eh] ; 8b 56 e2
add dx, word [bp-00eh] ; 03 56 f2
adc ax, word [bp-01ch] ; 13 46 e4
cmp ax, 01000h ; 3d 00 10
jnbe short 02677h ; 77 02
jne short 026a2h ; 75 2b
mov ax, word [bp-01ch] ; 8b 46 e4
xor al, al ; 30 c0
shr ax, 008h ; c1 e8 08
mov word [bp-010h], ax ; 89 46 f0
mov ax, word [bp-00eh] ; 8b 46 f2
xor al, al ; 30 c0
shr ax, 008h ; c1 e8 08
lea dx, [bx+002h] ; 8d 57 02
out DX, AL ; ee
lea dx, [bx+003h] ; 8d 57 03
mov al, byte [bp-010h] ; 8a 46 f0
out DX, AL ; ee
lea dx, [bx+004h] ; 8d 57 04
xor al, al ; 30 c0
out DX, AL ; ee
lea dx, [bx+005h] ; 8d 57 05
out DX, AL ; ee
mov byte [bp-01bh], al ; 88 46 e5
mov ax, word [bp-01eh] ; 8b 46 e2
xor ah, ah ; 30 e4
mov word [bp-010h], ax ; 89 46 f0
mov cx, strict word 00008h ; b9 08 00
shr word [bp-01ch], 1 ; d1 6e e4
rcr word [bp-01eh], 1 ; d1 5e e2
loop 026adh ; e2 f8
mov ax, word [bp-01eh] ; 8b 46 e2
mov word [bp-016h], ax ; 89 46 ea
mov ax, word [bp-01ch] ; 8b 46 e4
mov word [bp-01eh], ax ; 89 46 e2
mov word [bp-01ch], strict word 00000h ; c7 46 e4 00 00
and ax, strict word 0000fh ; 25 0f 00
or AL, strict byte 040h ; 0c 40
mov word [bp-014h], ax ; 89 46 ec
mov dx, word [bp-00ch] ; 8b 56 f4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 00ah ; b0 0a
out DX, AL ; ee
lea dx, [bx+001h] ; 8d 57 01
xor al, al ; 30 c0
out DX, AL ; ee
lea dx, [bx+002h] ; 8d 57 02
mov al, byte [bp-00eh] ; 8a 46 f2
out DX, AL ; ee
lea dx, [bx+003h] ; 8d 57 03
mov al, byte [bp-010h] ; 8a 46 f0
out DX, AL ; ee
mov ax, word [bp-016h] ; 8b 46 ea
lea dx, [bx+004h] ; 8d 57 04
out DX, AL ; ee
shr ax, 008h ; c1 e8 08
lea dx, [bx+005h] ; 8d 57 05
out DX, AL ; ee
cmp byte [bp-006h], 000h ; 80 7e fa 00
je short 02704h ; 74 05
mov ax, 000b0h ; b8 b0 00
jmp short 02707h ; eb 03
mov ax, 000a0h ; b8 a0 00
movzx dx, byte [bp-014h] ; 0f b6 56 ec
or ax, dx ; 09 d0
lea dx, [bx+006h] ; 8d 57 06
out DX, AL ; ee
lea dx, [bx+007h] ; 8d 57 07
mov al, byte [bp-01ah] ; 8a 46 e6
out DX, AL ; ee
lea dx, [bx+007h] ; 8d 57 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov dl, al ; 88 c2
test AL, strict byte 080h ; a8 80
jne short 02718h ; 75 f4
test AL, strict byte 001h ; a8 01
je short 02737h ; 74 0f
mov dx, word [bp-00ch] ; 8b 56 f4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, strict word 00002h ; ba 02 00
jmp near 027cfh ; e9 98 00
test dl, 008h ; f6 c2 08
jne short 0274bh ; 75 0f
mov dx, word [bp-00ch] ; 8b 56 f4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, strict word 00003h ; ba 03 00
jmp near 027cfh ; e9 84 00
sti ; fb
cmp si, 0f800h ; 81 fe 00 f8
jc short 0275fh ; 72 0d
sub si, 00800h ; 81 ee 00 08
mov ax, word [bp-018h] ; 8b 46 e8
add ax, 00080h ; 05 80 00
mov word [bp-018h], ax ; 89 46 e8
cmp byte [bp-008h], 001h ; 80 7e f8 01
jne short 02773h ; 75 0e
mov dx, bx ; 89 da
mov cx, word [bp-012h] ; 8b 4e ee
mov es, [bp-018h] ; 8e 46 e8
db 0f3h, 066h, 026h, 06fh
; rep es outsd ; f3 66 26 6f
jmp short 0277eh ; eb 0b
mov dx, bx ; 89 da
mov cx, word [bp-012h] ; 8b 4e ee
mov es, [bp-018h] ; 8e 46 e8
db 0f3h, 026h, 06fh
; rep es outsw ; f3 26 6f
mov es, [bp-00ah] ; 8e 46 f6
inc word [es:di+014h] ; 26 ff 45 14
dec word [bp-00eh] ; ff 4e f2
lea dx, [bx+007h] ; 8d 57 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov dl, al ; 88 c2
test AL, strict byte 080h ; a8 80
jne short 02788h ; 75 f4
cmp word [bp-00eh], strict byte 00000h ; 83 7e f2 00
jne short 027aeh ; 75 14
and AL, strict byte 0e9h ; 24 e9
cmp AL, strict byte 040h ; 3c 40
je short 027c4h ; 74 24
mov dx, word [bp-00ch] ; 8b 56 f4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, strict word 00006h ; ba 06 00
jmp short 027cfh ; eb 21
mov al, dl ; 88 d0
and AL, strict byte 0c9h ; 24 c9
cmp AL, strict byte 048h ; 3c 48
je short 0274ch ; 74 96
mov dx, word [bp-00ch] ; 8b 56 f4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, strict word 00007h ; ba 07 00
jmp short 027cfh ; eb 0b
mov dx, word [bp-00ch] ; 8b 56 f4
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
xor dx, dx ; 31 d2
mov ax, dx ; 89 d0
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
@ata_read_sectors: ; 0xf27d8 LB 0x7a
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 es, [bp+006h] ; 8e 46 06
mov bl, byte [es:si+008h] ; 26 8a 5c 08
mov cx, word [es:si+00ah] ; 26 8b 4c 0a
mov dx, cx ; 89 ca
sal dx, 009h ; c1 e2 09
mov ax, word [es:si+012h] ; 26 8b 44 12
test ax, ax ; 85 c0
je short 02806h ; 74 0d
movzx di, bl ; 0f b6 fb
imul di, di, strict byte 00018h ; 6b ff 18
mov [bp-006h], es ; 8c 46 fa
add di, si ; 01 f7
jmp short 02832h ; eb 2c
mov di, word [es:si] ; 26 8b 3c
add di, cx ; 01 cf
mov word [bp-006h], di ; 89 7e fa
adc ax, word [es:si+002h] ; 26 13 44 02
cmp ax, 01000h ; 3d 00 10
jnbe short 02819h ; 77 02
jne short 02825h ; 75 0c
mov bx, strict word 00024h ; bb 24 00
mov ax, si ; 89 f0
mov dx, es ; 8c c2
call 01d4fh ; e8 2c f5
jmp short 02849h ; eb 24
movzx ax, bl ; 0f b6 c3
imul ax, ax, strict byte 00018h ; 6b c0 18
mov [bp-006h], es ; 8c 46 fa
mov di, si ; 89 f7
add di, ax ; 01 c7
mov word [es:di+024h], dx ; 26 89 55 24
mov bx, 000c4h ; bb c4 00
mov ax, si ; 89 f0
mov dx, es ; 8c c2
call 01d4fh ; e8 0f f5
mov es, [bp-006h] ; 8e 46 fa
mov word [es:di+024h], 00200h ; 26 c7 45 24 00 02
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
@ata_write_sectors: ; 0xf2852 LB 0x3d
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
les si, [bp+004h] ; c4 76 04
mov cx, word [es:si+00ah] ; 26 8b 4c 0a
cmp word [es:si+012h], strict byte 00000h ; 26 83 7c 12 00
je short 02870h ; 74 0c
mov bx, strict word 00030h ; bb 30 00
mov ax, si ; 89 f0
mov dx, es ; 8c c2
call 025beh ; e8 50 fd
jmp short 02887h ; eb 17
xor ax, ax ; 31 c0
mov dx, word [es:si] ; 26 8b 14
add dx, cx ; 01 ca
adc ax, word [es:si+002h] ; 26 13 44 02
cmp ax, 01000h ; 3d 00 10
jnbe short 02882h ; 77 02
jne short 02864h ; 75 e2
mov bx, strict word 00034h ; bb 34 00
jmp short 02867h ; eb e0
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
ata_cmd_packet_: ; 0xf288f LB 0x2e8
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00014h ; 83 ec 14
push ax ; 50
mov byte [bp-008h], dl ; 88 56 f8
mov di, bx ; 89 df
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 c6 ed
mov word [bp-012h], 00122h ; c7 46 ee 22 01
mov word [bp-00eh], ax ; 89 46 f2
mov ax, word [bp-01ah] ; 8b 46 e6
shr ax, 1 ; d1 e8
mov ah, byte [bp-01ah] ; 8a 66 e6
and ah, 001h ; 80 e4 01
mov byte [bp-006h], ah ; 88 66 fa
cmp byte [bp+00ah], 002h ; 80 7e 0a 02
jne short 028e1h ; 75 1f
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 64 f0
push 00201h ; 68 01 02
push 00210h ; 68 10 02
push strict byte 00004h ; 6a 04
call 01972h ; e8 9a f0
add sp, strict byte 00006h ; 83 c4 06
mov dx, strict word 00001h ; ba 01 00
jmp near 02b6ch ; e9 8b 02
test byte [bp+004h], 001h ; f6 46 04 01
jne short 028dbh ; 75 f4
xor ah, ah ; 30 e4
imul ax, ax, strict byte 00006h ; 6b c0 06
mov es, [bp-00eh] ; 8e 46 f2
mov si, word [bp-012h] ; 8b 76 ee
add si, ax ; 01 c6
mov bx, word [es:si+001c2h] ; 26 8b 9c c2 01
mov ax, word [es:si+001c4h] ; 26 8b 84 c4 01
mov word [bp-010h], ax ; 89 46 f0
imul si, word [bp-01ah], strict byte 00018h ; 6b 76 e6 18
add si, word [bp-012h] ; 03 76 ee
mov al, byte [es:si+022h] ; 26 8a 44 22
mov byte [bp-00ah], al ; 88 46 f6
xor ax, ax ; 31 c0
mov word [bp-018h], ax ; 89 46 e8
mov word [bp-016h], ax ; 89 46 ea
mov al, byte [bp-008h] ; 8a 46 f8
cmp AL, strict byte 00ch ; 3c 0c
jnc short 02924h ; 73 06
mov byte [bp-008h], 00ch ; c6 46 f8 0c
jmp short 0292ah ; eb 06
jbe short 0292ah ; 76 04
mov byte [bp-008h], 010h ; c6 46 f8 10
shr byte [bp-008h], 1 ; d0 6e f8
mov es, [bp-00eh] ; 8e 46 f2
mov si, word [bp-012h] ; 8b 76 ee
db 066h, 026h, 0c7h, 044h, 014h, 000h, 000h, 000h, 000h
; mov dword [es:si+014h], strict dword 000000000h ; 66 26 c7 44 14 00 00 00 00
mov word [es:si+018h], strict word 00000h ; 26 c7 44 18 00 00
lea dx, [bx+007h] ; 8d 57 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 080h ; a8 80
je short 02952h ; 74 06
mov dx, strict word 00002h ; ba 02 00
jmp near 02b6ch ; e9 1a 02
mov dx, word [bp-010h] ; 8b 56 f0
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 00ah ; b0 0a
out DX, AL ; ee
lea dx, [bx+004h] ; 8d 57 04
mov AL, strict byte 0f0h ; b0 f0
out DX, AL ; ee
lea dx, [bx+005h] ; 8d 57 05
mov AL, strict byte 0ffh ; b0 ff
out DX, AL ; ee
cmp byte [bp-006h], 000h ; 80 7e fa 00
je short 02972h ; 74 05
mov ax, 000b0h ; b8 b0 00
jmp short 02975h ; eb 03
mov ax, 000a0h ; b8 a0 00
lea dx, [bx+006h] ; 8d 57 06
out DX, AL ; ee
lea dx, [bx+007h] ; 8d 57 07
mov AL, strict byte 0a0h ; b0 a0
out DX, AL ; ee
lea dx, [bx+007h] ; 8d 57 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov dl, al ; 88 c2
test AL, strict byte 080h ; a8 80
jne short 0297fh ; 75 f4
test AL, strict byte 001h ; a8 01
je short 0299eh ; 74 0f
mov dx, word [bp-010h] ; 8b 56 f0
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, strict word 00003h ; ba 03 00
jmp near 02b6ch ; e9 ce 01
test dl, 008h ; f6 c2 08
jne short 029b2h ; 75 0f
mov dx, word [bp-010h] ; 8b 56 f0
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, strict word 00004h ; ba 04 00
jmp near 02b6ch ; e9 ba 01
sti ; fb
mov ax, di ; 89 f8
shr ax, 004h ; c1 e8 04
add ax, cx ; 01 c8
mov si, di ; 89 fe
and si, strict byte 0000fh ; 83 e6 0f
movzx cx, byte [bp-008h] ; 0f b6 4e f8
mov dx, bx ; 89 da
mov es, ax ; 8e c0
db 0f3h, 026h, 06fh
; rep es outsw ; f3 26 6f
cmp byte [bp+00ah], 000h ; 80 7e 0a 00
jne short 029dbh ; 75 0b
lea dx, [bx+007h] ; 8d 57 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov dl, al ; 88 c2
jmp near 02b4dh ; e9 72 01
lea dx, [bx+007h] ; 8d 57 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov dl, al ; 88 c2
test AL, strict byte 080h ; a8 80
jne short 029dbh ; 75 f4
test AL, strict byte 088h ; a8 88
je near 02b4dh ; 0f 84 60 01
test AL, strict byte 001h ; a8 01
je short 029fch ; 74 0b
mov dx, word [bp-010h] ; 8b 56 f0
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
jmp short 02998h ; eb 9c
mov al, dl ; 88 d0
and AL, strict byte 0c9h ; 24 c9
cmp AL, strict byte 048h ; 3c 48
je short 02a0fh ; 74 0b
mov dx, word [bp-010h] ; 8b 56 f0
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
jmp short 029ach ; eb 9d
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 004h ; c1 e8 04
mov dx, word [bp+00eh] ; 8b 56 0e
add dx, ax ; 01 c2
mov ax, word [bp+00ch] ; 8b 46 0c
and ax, strict word 0000fh ; 25 0f 00
mov word [bp+00ch], ax ; 89 46 0c
mov word [bp+00eh], dx ; 89 56 0e
lea dx, [bx+005h] ; 8d 57 05
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov cx, ax ; 89 c1
sal cx, 008h ; c1 e1 08
lea dx, [bx+004h] ; 8d 57 04
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
add cx, ax ; 01 c1
mov word [bp-014h], cx ; 89 4e ec
mov ax, word [bp+004h] ; 8b 46 04
cmp ax, cx ; 39 c8
jbe short 02a4fh ; 76 0c
mov ax, cx ; 89 c8
sub word [bp+004h], cx ; 29 4e 04
xor ax, cx ; 31 c8
mov word [bp-014h], ax ; 89 46 ec
jmp short 02a59h ; eb 0a
mov cx, ax ; 89 c1
mov word [bp+004h], strict word 00000h ; c7 46 04 00 00
sub word [bp-014h], ax ; 29 46 ec
xor ax, ax ; 31 c0
cmp word [bp+008h], strict byte 00000h ; 83 7e 08 00
jne short 02a82h ; 75 21
mov dx, word [bp-014h] ; 8b 56 ec
cmp dx, word [bp+006h] ; 3b 56 06
jbe short 02a82h ; 76 19
mov ax, word [bp-014h] ; 8b 46 ec
sub ax, word [bp+006h] ; 2b 46 06
mov word [bp-00ch], ax ; 89 46 f4
mov ax, word [bp+006h] ; 8b 46 06
mov word [bp-014h], ax ; 89 46 ec
xor ax, ax ; 31 c0
mov word [bp+006h], ax ; 89 46 06
mov word [bp+008h], ax ; 89 46 08
jmp short 02a8eh ; eb 0c
mov word [bp-00ch], ax ; 89 46 f4
mov dx, word [bp-014h] ; 8b 56 ec
sub word [bp+006h], dx ; 29 56 06
sbb word [bp+008h], ax ; 19 46 08
mov si, word [bp-014h] ; 8b 76 ec
mov al, byte [bp-00ah] ; 8a 46 f6
test cl, 003h ; f6 c1 03
je short 02a9bh ; 74 02
xor al, al ; 30 c0
test byte [bp-014h], 003h ; f6 46 ec 03
je short 02aa3h ; 74 02
xor al, al ; 30 c0
test byte [bp-00ch], 003h ; f6 46 f4 03
je short 02aabh ; 74 02
xor al, al ; 30 c0
test byte [bp-014h], 001h ; f6 46 ec 01
je short 02ac3h ; 74 12
inc word [bp-014h] ; ff 46 ec
cmp word [bp-00ch], strict byte 00000h ; 83 7e f4 00
jbe short 02ac3h ; 76 09
test byte [bp-00ch], 001h ; f6 46 f4 01
je short 02ac3h ; 74 03
dec word [bp-00ch] ; ff 4e f4
cmp AL, strict byte 001h ; 3c 01
jne short 02ad4h ; 75 0d
shr word [bp-014h], 002h ; c1 6e ec 02
shr cx, 002h ; c1 e9 02
shr word [bp-00ch], 002h ; c1 6e f4 02
jmp short 02adch ; eb 08
shr word [bp-014h], 1 ; d1 6e ec
shr cx, 1 ; d1 e9
shr word [bp-00ch], 1 ; d1 6e f4
cmp AL, strict byte 001h ; 3c 01
jne short 02b0ch ; 75 2c
test cx, cx ; 85 c9
je short 02aeeh ; 74 0a
mov dx, bx ; 89 da
push eax ; 66 50
in eax, DX ; 66 ed
loop 02ae8h ; e2 fc
pop eax ; 66 58
mov dx, bx ; 89 da
mov cx, word [bp-014h] ; 8b 4e ec
les di, [bp+00ch] ; c4 7e 0c
db 0f3h, 066h, 06dh
; rep insd ; f3 66 6d
mov ax, word [bp-00ch] ; 8b 46 f4
test ax, ax ; 85 c0
je short 02b2bh ; 74 2b
mov cx, ax ; 89 c1
push eax ; 66 50
in eax, DX ; 66 ed
loop 02b04h ; e2 fc
pop eax ; 66 58
jmp short 02b2bh ; eb 1f
test cx, cx ; 85 c9
je short 02b15h ; 74 05
mov dx, bx ; 89 da
in ax, DX ; ed
loop 02b12h ; e2 fd
mov dx, bx ; 89 da
mov cx, word [bp-014h] ; 8b 4e ec
les di, [bp+00ch] ; c4 7e 0c
rep insw ; f3 6d
mov ax, word [bp-00ch] ; 8b 46 f4
test ax, ax ; 85 c0
je short 02b2bh ; 74 05
mov cx, ax ; 89 c1
in ax, DX ; ed
loop 02b28h ; e2 fd
add word [bp+00ch], si ; 01 76 0c
xor ax, ax ; 31 c0
add word [bp-018h], si ; 01 76 e8
adc word [bp-016h], ax ; 11 46 ea
mov ax, word [bp-018h] ; 8b 46 e8
mov es, [bp-00eh] ; 8e 46 f2
mov si, word [bp-012h] ; 8b 76 ee
mov word [es:si+016h], ax ; 26 89 44 16
mov ax, word [bp-016h] ; 8b 46 ea
mov word [es:si+018h], ax ; 26 89 44 18
jmp near 029dbh ; e9 8e fe
mov al, dl ; 88 d0
and AL, strict byte 0e9h ; 24 e9
cmp AL, strict byte 040h ; 3c 40
je short 02b61h ; 74 0c
mov dx, word [bp-010h] ; 8b 56 f0
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
jmp near 029ach ; e9 4b fe
mov dx, word [bp-010h] ; 8b 56 f0
add dx, strict byte 00006h ; 83 c2 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
xor dx, dx ; 31 d2
mov ax, dx ; 89 d0
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 0000ch ; c2 0c 00
ata_soft_reset_: ; 0xf2b77 LB 0x80
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push dx ; 52
push ax ; 50
mov bx, ax ; 89 c3
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 e3 ea
mov dx, bx ; 89 da
shr dx, 1 ; d1 ea
and bl, 001h ; 80 e3 01
mov byte [bp-008h], bl ; 88 5e f8
xor dh, dh ; 30 f6
imul bx, dx, strict byte 00006h ; 6b da 06
mov es, ax ; 8e c0
add bx, 00122h ; 81 c3 22 01
mov cx, word [es:bx+001c2h] ; 26 8b 8f c2 01
mov bx, word [es:bx+001c4h] ; 26 8b 9f c4 01
lea dx, [bx+006h] ; 8d 57 06
mov AL, strict byte 00ah ; b0 0a
out DX, AL ; ee
cmp byte [bp-008h], 000h ; 80 7e f8 00
je short 02bb9h ; 74 05
mov ax, 000b0h ; b8 b0 00
jmp short 02bbch ; eb 03
mov ax, 000a0h ; b8 a0 00
mov dx, cx ; 89 ca
add dx, strict byte 00006h ; 83 c2 06
out DX, AL ; ee
mov dx, cx ; 89 ca
add dx, strict byte 00007h ; 83 c2 07
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, cx ; 89 ca
add dx, strict byte 00007h ; 83 c2 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 080h ; a8 80
jne short 02bcah ; 75 f4
and AL, strict byte 0e9h ; 24 e9
cmp AL, strict byte 040h ; 3c 40
je short 02be7h ; 74 0b
lea dx, [bx+006h] ; 8d 57 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov ax, strict word 00001h ; b8 01 00
jmp short 02befh ; eb 08
lea dx, [bx+006h] ; 8d 57 06
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
xor ax, ax ; 31 c0
lea sp, [bp-006h] ; 8d 66 fa
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
set_diskette_ret_status_: ; 0xf2bf7 LB 0x18
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
movzx bx, al ; 0f b6 d8
mov dx, strict word 00041h ; ba 41 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 56 ea
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
set_diskette_current_cyl_: ; 0xf2c0f LB 0x2d
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
mov bl, al ; 88 c3
cmp AL, strict byte 001h ; 3c 01
jbe short 02c24h ; 76 0b
push 00230h ; 68 30 02
push strict byte 00007h ; 6a 07
call 01972h ; e8 51 ed
add sp, strict byte 00004h ; 83 c4 04
movzx ax, dl ; 0f b6 c2
movzx dx, bl ; 0f b6 d3
add dx, 00094h ; 81 c2 94 00
mov bx, ax ; 89 c3
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 28 ea
lea sp, [bp-002h] ; 8d 66 fe
pop bx ; 5b
pop bp ; 5d
retn ; c3
floppy_wait_for_interrupt_: ; 0xf2c3c LB 0x21
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
cli ; fa
mov dx, strict word 0003eh ; ba 3e 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 06 ea
test AL, strict byte 080h ; a8 80
je short 02c52h ; 74 04
and AL, strict byte 080h ; 24 80
jmp short 02c57h ; eb 05
sti ; fb
hlt ; f4
cli ; fa
jmp short 02c41h ; eb ea
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
floppy_wait_for_interrupt_or_timeout_: ; 0xf2c5d LB 0x46
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push dx ; 52
cli ; fa
mov dx, strict word 00040h ; ba 40 00
mov ax, dx ; 89 d0
call 01650h ; e8 e4 e9
test al, al ; 84 c0
jne short 02c75h ; 75 05
sti ; fb
xor cl, cl ; 30 c9
jmp short 02c99h ; eb 24
mov dx, strict word 0003eh ; ba 3e 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 d2 e9
mov cl, al ; 88 c1
test AL, strict byte 080h ; a8 80
je short 02c94h ; 74 10
and AL, strict byte 07fh ; 24 7f
movzx bx, al ; 0f b6 d8
mov dx, strict word 0003eh ; ba 3e 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 cc e9
jmp short 02c99h ; eb 05
sti ; fb
hlt ; f4
cli ; fa
jmp short 02c64h ; eb cb
mov al, cl ; 88 c8
lea sp, [bp-006h] ; 8d 66 fa
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
floppy_reset_controller_: ; 0xf2ca3 LB 0x2b
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov dx, 003f2h ; ba f2 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov bx, ax ; 89 c3
movzx ax, bl ; 0f b6 c3
and AL, strict byte 0fbh ; 24 fb
out DX, AL ; ee
mov al, bl ; 88 d8
or AL, strict byte 004h ; 0c 04
out DX, AL ; ee
mov dx, 003f4h ; ba f4 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and AL, strict byte 0c0h ; 24 c0
cmp AL, strict byte 080h ; 3c 80
jne short 02cbbh ; 75 f4
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
floppy_prepare_controller_: ; 0xf2cce LB 0x81
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push dx ; 52
push ax ; 50
mov cx, ax ; 89 c1
mov dx, strict word 0003eh ; ba 3e 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 70 e9
and AL, strict byte 07fh ; 24 7f
movzx bx, al ; 0f b6 d8
mov dx, strict word 0003eh ; ba 3e 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 70 e9
mov dx, 003f2h ; ba f2 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and AL, strict byte 004h ; 24 04
mov byte [bp-008h], al ; 88 46 f8
test cx, cx ; 85 c9
je short 02d01h ; 74 04
mov AL, strict byte 020h ; b0 20
jmp short 02d03h ; eb 02
mov AL, strict byte 010h ; b0 10
or AL, strict byte 00ch ; 0c 0c
or al, cl ; 08 c8
mov dx, 003f2h ; ba f2 03
out DX, AL ; ee
mov bx, strict word 00025h ; bb 25 00
mov dx, strict word 00040h ; ba 40 00
mov ax, dx ; 89 d0
call 0165eh ; e8 48 e9
mov dx, 0008bh ; ba 8b 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 31 e9
shr al, 006h ; c0 e8 06
mov dx, 003f7h ; ba f7 03
out DX, AL ; ee
mov dx, 003f4h ; ba f4 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and AL, strict byte 0c0h ; 24 c0
cmp AL, strict byte 080h ; 3c 80
jne short 02d26h ; 75 f4
cmp byte [bp-008h], 000h ; 80 7e f8 00
jne short 02d47h ; 75 0f
call 02c3ch ; e8 01 ff
movzx bx, al ; 0f b6 d8
mov dx, strict word 0003eh ; ba 3e 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 17 e9
lea sp, [bp-006h] ; 8d 66 fa
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
floppy_media_known_: ; 0xf2d4f LB 0x43
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bx, ax ; 89 c3
mov dx, strict word 0003eh ; ba 3e 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 f1 e8
mov ah, al ; 88 c4
test bx, bx ; 85 db
je short 02d67h ; 74 02
shr al, 1 ; d0 e8
and AL, strict byte 001h ; 24 01
jne short 02d6fh ; 75 04
xor ah, ah ; 30 e4
jmp short 02d8bh ; eb 1c
mov dx, 00090h ; ba 90 00
test bx, bx ; 85 db
je short 02d79h ; 74 03
mov dx, 00091h ; ba 91 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 d1 e8
xor ah, ah ; 30 e4
sar ax, 004h ; c1 f8 04
and AL, strict byte 001h ; 24 01
je short 02d6bh ; 74 e3
mov ax, strict word 00001h ; b8 01 00
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
floppy_read_id_: ; 0xf2d92 LB 0x40
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
push si ; 56
sub sp, strict byte 00008h ; 83 ec 08
mov bx, ax ; 89 c3
call 02cceh ; e8 2e ff
mov AL, strict byte 04ah ; b0 4a
mov dx, 003f5h ; ba f5 03
out DX, AL ; ee
mov al, bl ; 88 d8
out DX, AL ; ee
call 02c3ch ; e8 90 fe
xor si, si ; 31 f6
jmp short 02db5h ; eb 05
cmp si, strict byte 00007h ; 83 fe 07
jnl short 02dc1h ; 7d 0c
mov dx, 003f5h ; ba f5 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov byte [bp+si-00eh], al ; 88 42 f2
inc si ; 46
jmp short 02db0h ; eb ef
test byte [bp-00eh], 0c0h ; f6 46 f2 c0
db 00fh, 094h, 0c0h
; sete al ; 0f 94 c0
xor ah, ah ; 30 e4
lea sp, [bp-006h] ; 8d 66 fa
pop si ; 5e
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
floppy_drive_recal_: ; 0xf2dd2 LB 0x48
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push dx ; 52
mov bx, ax ; 89 c3
call 02cceh ; e8 f1 fe
mov AL, strict byte 007h ; b0 07
mov dx, 003f5h ; ba f5 03
out DX, AL ; ee
mov al, bl ; 88 d8
out DX, AL ; ee
call 02c3ch ; e8 53 fe
test bx, bx ; 85 db
je short 02df4h ; 74 07
or AL, strict byte 002h ; 0c 02
mov cx, 00095h ; b9 95 00
jmp short 02df9h ; eb 05
or AL, strict byte 001h ; 0c 01
mov cx, 00094h ; b9 94 00
movzx bx, al ; 0f b6 d8
mov dx, strict word 0003eh ; ba 3e 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 59 e8
xor bx, bx ; 31 db
mov dx, cx ; 89 ca
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 4f e8
mov ax, strict word 00001h ; b8 01 00
lea sp, [bp-006h] ; 8d 66 fa
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
floppy_media_sense_: ; 0xf2e1a LB 0xf0
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push dx ; 52
push si ; 56
push di ; 57
mov di, ax ; 89 c7
call 02dd2h ; e8 ab ff
test ax, ax ; 85 c0
jne short 02e30h ; 75 05
xor cx, cx ; 31 c9
jmp near 02efeh ; e9 ce 00
mov ax, strict word 00010h ; b8 10 00
call 016ach ; e8 76 e8
test di, di ; 85 ff
jne short 02e41h ; 75 07
mov cl, al ; 88 c1
shr cl, 004h ; c0 e9 04
jmp short 02e46h ; eb 05
mov cl, al ; 88 c1
and cl, 00fh ; 80 e1 0f
cmp cl, 001h ; 80 f9 01
jne short 02e54h ; 75 09
xor cl, cl ; 30 c9
mov CH, strict byte 015h ; b5 15
mov si, strict word 00001h ; be 01 00
jmp short 02e92h ; eb 3e
cmp cl, 002h ; 80 f9 02
jne short 02e5fh ; 75 06
xor cl, cl ; 30 c9
mov CH, strict byte 035h ; b5 35
jmp short 02e4fh ; eb f0
cmp cl, 003h ; 80 f9 03
jne short 02e6ah ; 75 06
xor cl, cl ; 30 c9
mov CH, strict byte 017h ; b5 17
jmp short 02e4fh ; eb e5
cmp cl, 004h ; 80 f9 04
jne short 02e75h ; 75 06
xor cl, cl ; 30 c9
mov CH, strict byte 017h ; b5 17
jmp short 02e4fh ; eb da
cmp cl, 005h ; 80 f9 05
jne short 02e80h ; 75 06
mov CL, strict byte 0cch ; b1 cc
mov CH, strict byte 0d7h ; b5 d7
jmp short 02e4fh ; eb cf
cmp cl, 00eh ; 80 f9 0e
je short 02e8ah ; 74 05
cmp cl, 00fh ; 80 f9 0f
jne short 02e8ch ; 75 02
jmp short 02e7ah ; eb ee
xor cl, cl ; 30 c9
xor ch, ch ; 30 ed
xor si, si ; 31 f6
movzx bx, cl ; 0f b6 d9
mov dx, 0008bh ; ba 8b 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 c0 e7
mov ax, di ; 89 f8
call 02d92h ; e8 ef fe
test ax, ax ; 85 c0
jne short 02ed9h ; 75 32
mov al, cl ; 88 c8
and AL, strict byte 0c0h ; 24 c0
cmp AL, strict byte 080h ; 3c 80
je short 02ed9h ; 74 2a
mov al, cl ; 88 c8
and AL, strict byte 0c0h ; 24 c0
cmp AL, strict byte 0c0h ; 3c c0
je short 02ec6h ; 74 0f
mov ah, cl ; 88 cc
and ah, 03fh ; 80 e4 3f
cmp AL, strict byte 040h ; 3c 40
je short 02ed2h ; 74 12
test al, al ; 84 c0
je short 02ecbh ; 74 07
jmp short 02e92h ; eb cc
and cl, 03fh ; 80 e1 3f
jmp short 02e92h ; eb c7
mov cl, ah ; 88 e1
or cl, 040h ; 80 c9 40
jmp short 02e92h ; eb c0
mov cl, ah ; 88 e1
or cl, 080h ; 80 c9 80
jmp short 02e92h ; eb b9
test di, di ; 85 ff
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
movzx di, al ; 0f b6 f8
add di, 00090h ; 81 c7 90 00
movzx bx, cl ; 0f b6 d9
mov dx, 0008bh ; ba 8b 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 6d e7
movzx bx, ch ; 0f b6 dd
mov dx, di ; 89 fa
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 62 e7
mov cx, si ; 89 f1
mov ax, cx ; 89 c8
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
floppy_drive_exists_: ; 0xf2f0a LB 0x24
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov dx, ax ; 89 c2
mov ax, strict word 00010h ; b8 10 00
call 016ach ; e8 96 e7
test dx, dx ; 85 d2
jne short 02f1fh ; 75 05
shr al, 004h ; c0 e8 04
jmp short 02f21h ; eb 02
and AL, strict byte 00fh ; 24 0f
test al, al ; 84 c0
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
xor ah, ah ; 30 e4
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
_int13_diskette_function: ; 0xf2f2e LB 0x8f7
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00016h ; 83 ec 16
mov bx, word [bp+016h] ; 8b 5e 16
shr bx, 008h ; c1 eb 08
mov byte [bp-006h], bl ; 88 5e fa
mov si, word [bp+016h] ; 8b 76 16
and si, 000ffh ; 81 e6 ff 00
mov al, byte [bp+00eh] ; 8a 46 0e
mov ah, byte [bp+014h] ; 8a 66 14
mov cl, byte [bp+016h] ; 8a 4e 16
mov dx, word [bp+014h] ; 8b 56 14
shr dx, 008h ; c1 ea 08
mov word [bp-010h], dx ; 89 56 f0
cmp bl, 008h ; 80 fb 08
jc short 02f95h ; 72 38
mov dx, word [bp+01ch] ; 8b 56 1c
or dl, 001h ; 80 ca 01
cmp bl, 008h ; 80 fb 08
jbe near 034ebh ; 0f 86 81 05
cmp bl, 016h ; 80 fb 16
jc short 02f8bh ; 72 1c
or si, 00100h ; 81 ce 00 01
cmp bl, 016h ; 80 fb 16
jbe near 0361fh ; 0f 86 a5 06
cmp bl, 018h ; 80 fb 18
je near 036b5h ; 0f 84 34 07
cmp bl, 017h ; 80 fb 17
je near 03643h ; 0f 84 bb 06
jmp near 03802h ; e9 77 08
cmp bl, 015h ; 80 fb 15
je near 035dbh ; 0f 84 49 06
jmp near 03802h ; e9 6d 08
cmp bl, 001h ; 80 fb 01
jc short 02fafh ; 72 15
jbe near 03028h ; 0f 86 8a 00
cmp bl, 005h ; 80 fb 05
je near 03365h ; 0f 84 c0 03
cmp bl, 004h ; 80 fb 04
jbe near 03046h ; 0f 86 9a 00
jmp near 03802h ; e9 53 08
test bl, bl ; 84 db
jne near 03802h ; 0f 85 4d 08
mov al, byte [bp+00eh] ; 8a 46 0e
mov byte [bp-008h], al ; 88 46 f8
cmp AL, strict byte 001h ; 3c 01
jbe short 02fd3h ; 76 14
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 001h ; 80 cc 01
mov word [bp+016h], ax ; 89 46 16
mov ax, strict word 00001h ; b8 01 00
call 02bf7h ; e8 27 fc
jmp near 03341h ; e9 6e 03
mov ax, strict word 00010h ; b8 10 00
call 016ach ; e8 d3 e6
cmp byte [bp-008h], 000h ; 80 7e f8 00
jne short 02fe6h ; 75 07
mov cl, al ; 88 c1
shr cl, 004h ; c0 e9 04
jmp short 02febh ; eb 05
mov cl, al ; 88 c1
and cl, 00fh ; 80 e1 0f
test cl, cl ; 84 c9
jne short 02fffh ; 75 10
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 080h ; 80 cc 80
mov word [bp+016h], ax ; 89 46 16
mov ax, 00080h ; b8 80 00
jmp short 02fcdh ; eb ce
xor bx, bx ; 31 db
mov dx, strict word 0003eh ; ba 3e 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 54 e6
xor al, al ; 30 c0
mov byte [bp+017h], al ; 88 46 17
xor ah, ah ; 30 e4
call 02bf7h ; e8 e3 fb
and byte [bp+01ch], 0feh ; 80 66 1c fe
movzx ax, byte [bp-008h] ; 0f b6 46 f8
xor dx, dx ; 31 d2
call 02c0fh ; e8 ee fb
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
and byte [bp+01ch], 0feh ; 80 66 1c fe
mov dx, 00441h ; ba 41 04
xor ax, ax ; 31 c0
call 01650h ; e8 1c e6
movzx dx, al ; 0f b6 d0
sal dx, 008h ; c1 e2 08
or si, dx ; 09 d6
mov word [bp+016h], si ; 89 76 16
test al, al ; 84 c0
je short 03021h ; 74 de
jmp near 03341h ; e9 fb 02
mov ch, cl ; 88 cd
mov dl, byte [bp-010h] ; 8a 56 f0
mov byte [bp-00ch], dl ; 88 56 f4
mov byte [bp-00ah], ah ; 88 66 f6
mov dx, word [bp+012h] ; 8b 56 12
shr dx, 008h ; c1 ea 08
mov byte [bp-00eh], dl ; 88 56 f2
mov byte [bp-008h], al ; 88 46 f8
cmp AL, strict byte 001h ; 3c 01
jnbe short 0306fh ; 77 0e
cmp dl, 001h ; 80 fa 01
jnbe short 0306fh ; 77 09
test cl, cl ; 84 c9
je short 0306fh ; 74 05
cmp cl, 048h ; 80 f9 48
jbe short 03099h ; 76 2a
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 b7 e8
push 00255h ; 68 55 02
push 0026dh ; 68 6d 02
push strict byte 00004h ; 6a 04
call 01972h ; e8 ed e8
add sp, strict byte 00006h ; 83 c4 06
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 001h ; 80 cc 01
mov word [bp+016h], ax ; 89 46 16
mov ax, strict word 00001h ; b8 01 00
jmp near 0310fh ; e9 76 00
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 02f0ah ; e8 6a fe
test ax, ax ; 85 c0
je near 031a2h ; 0f 84 fc 00
movzx dx, byte [bp-008h] ; 0f b6 56 f8
mov ax, dx ; 89 d0
call 02d4fh ; e8 a0 fc
test ax, ax ; 85 c0
jne short 030cch ; 75 19
mov ax, dx ; 89 d0
call 02e1ah ; e8 62 fd
test ax, ax ; 85 c0
jne short 030cch ; 75 10
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 00ch ; 80 cc 0c
mov word [bp+016h], ax ; 89 46 16
mov ax, strict word 0000ch ; b8 0c 00
jmp short 0310fh ; eb 43
cmp byte [bp-006h], 002h ; 80 7e fa 02
jne near 03234h ; 0f 85 60 01
mov ax, word [bp+006h] ; 8b 46 06
shr ax, 00ch ; c1 e8 0c
mov cl, al ; 88 c1
mov dx, word [bp+006h] ; 8b 56 06
sal dx, 004h ; c1 e2 04
mov bx, word [bp+010h] ; 8b 5e 10
add bx, dx ; 01 d3
mov word [bp-012h], bx ; 89 5e ee
cmp dx, bx ; 39 da
jbe short 030f0h ; 76 02
db 0feh, 0c1h
; inc cl ; fe c1
movzx bx, ch ; 0f b6 dd
sal bx, 009h ; c1 e3 09
dec bx ; 4b
mov ax, word [bp-012h] ; 8b 46 ee
add ax, bx ; 01 d8
cmp ax, word [bp-012h] ; 3b 46 ee
jnc short 03119h ; 73 18
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 009h ; 80 cc 09
mov word [bp+016h], ax ; 89 46 16
mov ax, strict word 00009h ; b8 09 00
call 02bf7h ; e8 e5 fa
mov byte [bp+016h], 000h ; c6 46 16 00
jmp near 03341h ; e9 28 02
mov AL, strict byte 006h ; b0 06
mov dx, strict word 0000ah ; ba 0a 00
out DX, AL ; ee
xor al, al ; 30 c0
mov dx, strict word 0000ch ; ba 0c 00
out DX, AL ; ee
mov al, byte [bp-012h] ; 8a 46 ee
mov dx, strict word 00004h ; ba 04 00
out DX, AL ; ee
mov ax, word [bp-012h] ; 8b 46 ee
shr ax, 008h ; c1 e8 08
out DX, AL ; ee
xor al, al ; 30 c0
mov dx, strict word 0000ch ; ba 0c 00
out DX, AL ; ee
mov al, bl ; 88 d8
mov dx, strict word 00005h ; ba 05 00
out DX, AL ; ee
mov ax, bx ; 89 d8
shr ax, 008h ; c1 e8 08
out DX, AL ; ee
mov AL, strict byte 046h ; b0 46
mov dx, strict word 0000bh ; ba 0b 00
out DX, AL ; ee
mov al, cl ; 88 c8
mov dx, 00081h ; ba 81 00
out DX, AL ; ee
mov AL, strict byte 002h ; b0 02
mov dx, strict word 0000ah ; ba 0a 00
out DX, AL ; ee
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 02cceh ; e8 70 fb
mov AL, strict byte 0e6h ; b0 e6
mov dx, 003f5h ; ba f5 03
out DX, AL ; ee
movzx dx, byte [bp-00eh] ; 0f b6 56 f2
sal dx, 002h ; c1 e2 02
movzx ax, byte [bp-008h] ; 0f b6 46 f8
or ax, dx ; 09 d0
mov dx, 003f5h ; ba f5 03
out DX, AL ; ee
mov al, byte [bp-00ch] ; 8a 46 f4
out DX, AL ; ee
mov al, byte [bp-00eh] ; 8a 46 f2
out DX, AL ; ee
mov al, byte [bp-00ah] ; 8a 46 f6
out DX, AL ; ee
mov AL, strict byte 002h ; b0 02
out DX, AL ; ee
movzx dx, byte [bp-00ah] ; 0f b6 56 f6
movzx ax, ch ; 0f b6 c5
add ax, dx ; 01 d0
dec ax ; 48
mov dx, 003f5h ; ba f5 03
out DX, AL ; ee
xor al, al ; 30 c0
out DX, AL ; ee
mov AL, strict byte 0ffh ; b0 ff
out DX, AL ; ee
call 02c5dh ; e8 c2 fa
test al, al ; 84 c0
jne short 031b3h ; 75 14
call 02ca3h ; e8 01 fb
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 080h ; 80 cc 80
mov word [bp+016h], ax ; 89 46 16
mov ax, 00080h ; b8 80 00
jmp near 0310fh ; e9 5c ff
mov dx, 003f4h ; ba f4 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and AL, strict byte 0c0h ; 24 c0
cmp AL, strict byte 0c0h ; 3c c0
je short 031cdh ; 74 0e
push 00255h ; 68 55 02
push 00288h ; 68 88 02
push strict byte 00007h ; 6a 07
call 01972h ; e8 a8 e7
add sp, strict byte 00006h ; 83 c4 06
xor si, si ; 31 f6
jmp short 031d6h ; eb 05
cmp si, strict byte 00007h ; 83 fe 07
jnl short 031eeh ; 7d 18
mov dx, 003f5h ; ba f5 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov byte [bp+si-01ah], al ; 88 42 e6
movzx bx, al ; 0f b6 d8
lea dx, [si+042h] ; 8d 54 42
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 73 e4
inc si ; 46
jmp short 031d1h ; eb e3
test byte [bp-01ah], 0c0h ; f6 46 e6 c0
je short 03205h ; 74 11
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 020h ; 80 cc 20
mov word [bp+016h], ax ; 89 46 16
mov ax, strict word 00020h ; b8 20 00
jmp near 0310fh ; e9 0a ff
movzx ax, ch ; 0f b6 c5
sal ax, 009h ; c1 e0 09
cwd ; 99
db 02bh, 0c2h
; sub ax, dx ; 2b c2
sar ax, 1 ; d1 f8
mov cx, ax ; 89 c1
mov si, word [bp+010h] ; 8b 76 10
mov dx, word [bp+006h] ; 8b 56 06
mov di, si ; 89 f7
mov es, dx ; 8e c2
push DS ; 1e
mov ds, dx ; 8e da
rep movsw ; f3 a5
pop DS ; 1f
movzx dx, byte [bp-00ch] ; 0f b6 56 f4
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 02c0fh ; e8 e2 f9
mov byte [bp+017h], 000h ; c6 46 17 00
jmp near 036aeh ; e9 7a 04
cmp byte [bp-006h], 003h ; 80 7e fa 03
jne near 0334fh ; 0f 85 13 01
mov ax, word [bp+006h] ; 8b 46 06
shr ax, 00ch ; c1 e8 0c
mov cl, al ; 88 c1
mov dx, word [bp+006h] ; 8b 56 06
sal dx, 004h ; c1 e2 04
mov bx, word [bp+010h] ; 8b 5e 10
add bx, dx ; 01 d3
mov word [bp-012h], bx ; 89 5e ee
cmp dx, bx ; 39 da
jbe short 03258h ; 76 02
db 0feh, 0c1h
; inc cl ; fe c1
movzx bx, ch ; 0f b6 dd
sal bx, 009h ; c1 e3 09
dec bx ; 4b
mov ax, word [bp-012h] ; 8b 46 ee
add ax, bx ; 01 d8
cmp ax, word [bp-012h] ; 3b 46 ee
jc near 03101h ; 0f 82 96 fe
mov AL, strict byte 006h ; b0 06
mov dx, strict word 0000ah ; ba 0a 00
out DX, AL ; ee
xor al, al ; 30 c0
mov dx, strict word 0000ch ; ba 0c 00
out DX, AL ; ee
mov al, byte [bp-012h] ; 8a 46 ee
mov dx, strict word 00004h ; ba 04 00
out DX, AL ; ee
mov ax, word [bp-012h] ; 8b 46 ee
shr ax, 008h ; c1 e8 08
out DX, AL ; ee
xor al, al ; 30 c0
mov dx, strict word 0000ch ; ba 0c 00
out DX, AL ; ee
mov al, bl ; 88 d8
mov dx, strict word 00005h ; ba 05 00
out DX, AL ; ee
mov ax, bx ; 89 d8
shr ax, 008h ; c1 e8 08
out DX, AL ; ee
mov AL, strict byte 04ah ; b0 4a
mov dx, strict word 0000bh ; ba 0b 00
out DX, AL ; ee
mov al, cl ; 88 c8
mov dx, 00081h ; ba 81 00
out DX, AL ; ee
mov AL, strict byte 002h ; b0 02
mov dx, strict word 0000ah ; ba 0a 00
out DX, AL ; ee
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 02cceh ; e8 1e fa
mov AL, strict byte 0c5h ; b0 c5
mov dx, 003f5h ; ba f5 03
out DX, AL ; ee
movzx dx, byte [bp-00eh] ; 0f b6 56 f2
sal dx, 002h ; c1 e2 02
movzx ax, byte [bp-008h] ; 0f b6 46 f8
or ax, dx ; 09 d0
mov dx, 003f5h ; ba f5 03
out DX, AL ; ee
mov al, byte [bp-00ch] ; 8a 46 f4
out DX, AL ; ee
mov al, byte [bp-00eh] ; 8a 46 f2
out DX, AL ; ee
mov al, byte [bp-00ah] ; 8a 46 f6
out DX, AL ; ee
mov AL, strict byte 002h ; b0 02
out DX, AL ; ee
movzx dx, byte [bp-00ah] ; 0f b6 56 f6
movzx ax, ch ; 0f b6 c5
add ax, dx ; 01 d0
dec ax ; 48
mov dx, 003f5h ; ba f5 03
out DX, AL ; ee
xor al, al ; 30 c0
out DX, AL ; ee
mov AL, strict byte 0ffh ; b0 ff
out DX, AL ; ee
call 02c5dh ; e8 70 f9
test al, al ; 84 c0
je near 0319fh ; 0f 84 ac fe
mov dx, 003f4h ; ba f4 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and AL, strict byte 0c0h ; 24 c0
cmp AL, strict byte 0c0h ; 3c c0
je short 0330dh ; 74 0e
push 00255h ; 68 55 02
push 00288h ; 68 88 02
push strict byte 00007h ; 6a 07
call 01972h ; e8 68 e6
add sp, strict byte 00006h ; 83 c4 06
xor si, si ; 31 f6
jmp short 03316h ; eb 05
cmp si, strict byte 00007h ; 83 fe 07
jnl short 0332eh ; 7d 18
mov dx, 003f5h ; ba f5 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov byte [bp+si-01ah], al ; 88 42 e6
movzx bx, al ; 0f b6 d8
lea dx, [si+042h] ; 8d 54 42
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 33 e3
inc si ; 46
jmp short 03311h ; eb e3
test byte [bp-01ah], 0c0h ; f6 46 e6 c0
je near 03222h ; 0f 84 ec fe
test byte [bp-019h], 002h ; f6 46 e7 02
je short 03348h ; 74 0c
mov word [bp+016h], 00300h ; c7 46 16 00 03
or byte [bp+01ch], 001h ; 80 4e 1c 01
jmp near 03021h ; e9 d9 fc
mov word [bp+016h], 00100h ; c7 46 16 00 01
jmp short 03341h ; eb f2
movzx dx, byte [bp-00ch] ; 0f b6 56 f4
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 02c0fh ; e8 b5 f8
and byte [bp+01ch], 0feh ; 80 66 1c fe
mov byte [bp+017h], 000h ; c6 46 17 00
jmp near 03021h ; e9 bc fc
mov ch, byte [bp+016h] ; 8a 6e 16
mov ax, word [bp+014h] ; 8b 46 14
shr ax, 008h ; c1 e8 08
mov byte [bp-00ch], al ; 88 46 f4
mov dx, word [bp+012h] ; 8b 56 12
shr dx, 008h ; c1 ea 08
mov byte [bp-00eh], dl ; 88 56 f2
mov bl, byte [bp+00eh] ; 8a 5e 0e
mov byte [bp-008h], bl ; 88 5e f8
cmp bl, 001h ; 80 fb 01
jnbe short 03397h ; 77 12
cmp dl, 001h ; 80 fa 01
jnbe short 03397h ; 77 0d
cmp AL, strict byte 04fh ; 3c 4f
jnbe short 03397h ; 77 09
test ch, ch ; 84 ed
je short 03397h ; 74 05
cmp ch, 012h ; 80 fd 12
jbe short 033ach ; 76 15
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 001h ; 80 cc 01
mov word [bp+016h], ax ; 89 46 16
mov ax, strict word 00001h ; b8 01 00
call 02bf7h ; e8 4f f8
or byte [bp+01ch], 001h ; 80 4e 1c 01
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 02f0ah ; e8 57 fb
test ax, ax ; 85 c0
je near 02fefh ; 0f 84 36 fc
movzx dx, byte [bp-008h] ; 0f b6 56 f8
mov ax, dx ; 89 d0
call 02d4fh ; e8 8d f9
test ax, ax ; 85 c0
jne short 033d1h ; 75 0b
mov ax, dx ; 89 d0
call 02e1ah ; e8 4f fa
test ax, ax ; 85 c0
je near 030bch ; 0f 84 eb fc
mov ax, word [bp+006h] ; 8b 46 06
shr ax, 00ch ; c1 e8 0c
mov cl, al ; 88 c1
mov dx, word [bp+006h] ; 8b 56 06
sal dx, 004h ; c1 e2 04
mov bx, word [bp+010h] ; 8b 5e 10
add bx, dx ; 01 d3
mov word [bp-012h], bx ; 89 5e ee
cmp dx, bx ; 39 da
jbe short 033edh ; 76 02
db 0feh, 0c1h
; inc cl ; fe c1
movzx bx, ch ; 0f b6 dd
sal bx, 002h ; c1 e3 02
dec bx ; 4b
mov ax, word [bp-012h] ; 8b 46 ee
add ax, bx ; 01 d8
cmp ax, word [bp-012h] ; 3b 46 ee
jc near 03101h ; 0f 82 01 fd
mov AL, strict byte 006h ; b0 06
mov dx, strict word 0000ah ; ba 0a 00
out DX, AL ; ee
xor al, al ; 30 c0
mov dx, strict word 0000ch ; ba 0c 00
out DX, AL ; ee
mov al, byte [bp-012h] ; 8a 46 ee
mov dx, strict word 00004h ; ba 04 00
out DX, AL ; ee
mov ax, word [bp-012h] ; 8b 46 ee
shr ax, 008h ; c1 e8 08
out DX, AL ; ee
xor al, al ; 30 c0
mov dx, strict word 0000ch ; ba 0c 00
out DX, AL ; ee
mov al, bl ; 88 d8
mov dx, strict word 00005h ; ba 05 00
out DX, AL ; ee
mov ax, bx ; 89 d8
shr ax, 008h ; c1 e8 08
out DX, AL ; ee
mov AL, strict byte 04ah ; b0 4a
mov dx, strict word 0000bh ; ba 0b 00
out DX, AL ; ee
mov al, cl ; 88 c8
mov dx, 00081h ; ba 81 00
out DX, AL ; ee
mov AL, strict byte 002h ; b0 02
mov dx, strict word 0000ah ; ba 0a 00
out DX, AL ; ee
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 02cceh ; e8 89 f8
mov AL, strict byte 00fh ; b0 0f
mov dx, 003f5h ; ba f5 03
out DX, AL ; ee
movzx bx, byte [bp-00eh] ; 0f b6 5e f2
sal bx, 002h ; c1 e3 02
movzx ax, byte [bp-008h] ; 0f b6 46 f8
or bx, ax ; 09 c3
mov al, bl ; 88 d8
out DX, AL ; ee
mov al, byte [bp-00ch] ; 8a 46 f4
out DX, AL ; ee
mov AL, strict byte 04dh ; b0 4d
out DX, AL ; ee
mov al, bl ; 88 d8
out DX, AL ; ee
mov AL, strict byte 002h ; b0 02
out DX, AL ; ee
mov al, ch ; 88 e8
out DX, AL ; ee
xor al, ch ; 30 e8
out DX, AL ; ee
mov AL, strict byte 0f6h ; b0 f6
out DX, AL ; ee
call 02c5dh ; e8 e9 f7
test al, al ; 84 c0
jne short 0347eh ; 75 06
call 02ca3h ; e8 28 f8
jmp near 02fefh ; e9 71 fb
mov dx, 003f4h ; ba f4 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and AL, strict byte 0c0h ; 24 c0
cmp AL, strict byte 0c0h ; 3c c0
je short 03498h ; 74 0e
push 00255h ; 68 55 02
push 00288h ; 68 88 02
push strict byte 00007h ; 6a 07
call 01972h ; e8 dd e4
add sp, strict byte 00006h ; 83 c4 06
xor si, si ; 31 f6
jmp short 034a1h ; eb 05
cmp si, strict byte 00007h ; 83 fe 07
jnl short 034b9h ; 7d 18
mov dx, 003f5h ; ba f5 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov byte [bp+si-01ah], al ; 88 42 e6
movzx bx, al ; 0f b6 d8
lea dx, [si+042h] ; 8d 54 42
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 a8 e1
inc si ; 46
jmp short 0349ch ; eb e3
test byte [bp-01ah], 0c0h ; f6 46 e6 c0
je short 034d5h ; 74 16
test byte [bp-019h], 002h ; f6 46 e7 02
jne near 0333ch ; 0f 85 75 fe
push 00255h ; 68 55 02
push 0029ch ; 68 9c 02
push strict byte 00007h ; 6a 07
call 01972h ; e8 a0 e4
add sp, strict byte 00006h ; 83 c4 06
xor al, al ; 30 c0
mov byte [bp+017h], al ; 88 46 17
xor ah, ah ; 30 e4
call 02bf7h ; e8 18 f7
movzx ax, byte [bp-008h] ; 0f b6 46 f8
xor dx, dx ; 31 d2
call 02c0fh ; e8 27 f7
jmp near 036aeh ; e9 c3 01
mov byte [bp-008h], al ; 88 46 f8
cmp AL, strict byte 001h ; 3c 01
jbe short 0350fh ; 76 1d
xor ax, ax ; 31 c0
mov word [bp+016h], ax ; 89 46 16
mov word [bp+010h], ax ; 89 46 10
mov word [bp+014h], ax ; 89 46 14
mov word [bp+012h], ax ; 89 46 12
mov word [bp+006h], ax ; 89 46 06
mov word [bp+008h], ax ; 89 46 08
movzx ax, ch ; 0f b6 c5
mov word [bp+012h], ax ; 89 46 12
jmp near 0362ch ; e9 1d 01
mov ax, strict word 00010h ; b8 10 00
call 016ach ; e8 97 e1
mov cl, al ; 88 c1
xor ch, ch ; 30 ed
test AL, strict byte 0f0h ; a8 f0
je short 0351fh ; 74 02
mov CH, strict byte 001h ; b5 01
test cl, 00fh ; f6 c1 0f
je short 03526h ; 74 02
db 0feh, 0c5h
; inc ch ; fe c5
cmp byte [bp-008h], 000h ; 80 7e f8 00
jne short 03531h ; 75 05
shr cl, 004h ; c0 e9 04
jmp short 03534h ; eb 03
and cl, 00fh ; 80 e1 0f
mov byte [bp+011h], 000h ; c6 46 11 00
movzx ax, cl ; 0f b6 c1
mov word [bp+010h], ax ; 89 46 10
mov word [bp+016h], strict word 00000h ; c7 46 16 00 00
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
movzx dx, ch ; 0f b6 d5
or ax, dx ; 09 d0
mov word [bp+012h], ax ; 89 46 12
xor ah, ah ; 30 e4
or ah, 001h ; 80 cc 01
mov word [bp+012h], ax ; 89 46 12
cmp cl, 003h ; 80 f9 03
jc short 03572h ; 72 15
jbe short 03599h ; 76 3a
cmp cl, 005h ; 80 f9 05
jc short 035a0h ; 72 3c
jbe short 035a7h ; 76 41
cmp cl, 00fh ; 80 f9 0f
je short 035b5h ; 74 4a
cmp cl, 00eh ; 80 f9 0e
je short 035aeh ; 74 3e
jmp short 035bch ; eb 4a
cmp cl, 002h ; 80 f9 02
je short 03592h ; 74 1b
cmp cl, 001h ; 80 f9 01
je short 0358bh ; 74 0f
test cl, cl ; 84 c9
jne short 035bch ; 75 3c
mov word [bp+014h], strict word 00000h ; c7 46 14 00 00
mov byte [bp+013h], 000h ; c6 46 13 00
jmp short 035cah ; eb 3f
mov word [bp+014h], 02709h ; c7 46 14 09 27
jmp short 035cah ; eb 38
mov word [bp+014h], 04f0fh ; c7 46 14 0f 4f
jmp short 035cah ; eb 31
mov word [bp+014h], 04f09h ; c7 46 14 09 4f
jmp short 035cah ; eb 2a
mov word [bp+014h], 04f12h ; c7 46 14 12 4f
jmp short 035cah ; eb 23
mov word [bp+014h], 04f24h ; c7 46 14 24 4f
jmp short 035cah ; eb 1c
mov word [bp+014h], 0fe3fh ; c7 46 14 3f fe
jmp short 035cah ; eb 15
mov word [bp+014h], 0feffh ; c7 46 14 ff fe
jmp short 035cah ; eb 0e
push 00255h ; 68 55 02
push 002adh ; 68 ad 02
push strict byte 00007h ; 6a 07
call 01972h ; e8 ab e3
add sp, strict byte 00006h ; 83 c4 06
mov word [bp+006h], 0f000h ; c7 46 06 00 f0
movzx ax, cl ; 0f b6 c1
call 03825h ; e8 50 02
mov word [bp+008h], ax ; 89 46 08
jmp near 036aeh ; e9 d3 00
mov byte [bp-008h], al ; 88 46 f8
cmp AL, strict byte 001h ; 3c 01
jbe short 035e7h ; 76 05
mov word [bp+016h], si ; 89 76 16
jmp short 0362ch ; eb 45
mov ax, strict word 00010h ; b8 10 00
call 016ach ; e8 bf e0
cmp byte [bp-008h], 000h ; 80 7e f8 00
jne short 035fah ; 75 07
mov cl, al ; 88 c1
shr cl, 004h ; c0 e9 04
jmp short 035ffh ; eb 05
mov cl, al ; 88 c1
and cl, 00fh ; 80 e1 0f
and byte [bp+01ch], 0feh ; 80 66 1c fe
mov dx, word [bp+016h] ; 8b 56 16
xor dh, dh ; 30 f6
test cl, cl ; 84 c9
je short 03619h ; 74 0d
cmp cl, 001h ; 80 f9 01
jbe short 03616h ; 76 05
or dh, 002h ; 80 ce 02
jmp short 03619h ; eb 03
or dh, 001h ; 80 ce 01
mov word [bp+016h], dx ; 89 56 16
jmp near 03021h ; e9 02 fa
cmp AL, strict byte 001h ; 3c 01
jbe short 03632h ; 76 0f
mov word [bp+016h], si ; 89 76 16
mov ax, strict word 00001h ; b8 01 00
call 02bf7h ; e8 cb f5
mov word [bp+01ch], dx ; 89 56 1c
jmp near 03021h ; e9 ef f9
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 006h ; 80 cc 06
mov word [bp+016h], ax ; 89 46 16
mov ax, strict word 00006h ; b8 06 00
jmp near 02fcdh ; e9 8a f9
mov byte [bp-008h], al ; 88 46 f8
mov bl, cl ; 88 cb
cmp AL, strict byte 001h ; 3c 01
jnbe short 03623h ; 77 d7
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 02f0ah ; e8 b7 f8
test ax, ax ; 85 c0
je near 02fefh ; 0f 84 96 f9
cmp byte [bp-008h], 000h ; 80 7e f8 00
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
movzx dx, al ; 0f b6 d0
add dx, 00090h ; 81 c2 90 00
mov word [bp-012h], dx ; 89 56 ee
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 e0 df
and AL, strict byte 00fh ; 24 0f
cmp bl, 002h ; 80 fb 02
jc short 03686h ; 72 0f
jbe short 03692h ; 76 19
cmp bl, 004h ; 80 fb 04
je short 0368eh ; 74 10
cmp bl, 003h ; 80 fb 03
je short 03696h ; 74 13
jmp near 02fbfh ; e9 39 f9
cmp bl, 001h ; 80 fb 01
je short 0368eh ; 74 03
jmp near 02fbfh ; e9 31 f9
or AL, strict byte 090h ; 0c 90
jmp short 03698h ; eb 06
or AL, strict byte 070h ; 0c 70
jmp short 03698h ; eb 02
or AL, strict byte 010h ; 0c 10
movzx bx, al ; 0f b6 d8
mov dx, word [bp-012h] ; 8b 56 ee
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 ba df
xor al, al ; 30 c0
mov byte [bp+017h], al ; 88 46 17
xor ah, ah ; 30 e4
call 02bf7h ; e8 49 f5
and byte [bp+01ch], 0feh ; 80 66 1c fe
jmp near 03021h ; e9 6c f9
mov byte [bp-008h], al ; 88 46 f8
mov ch, ah ; 88 e5
and ch, 03fh ; 80 e5 3f
movzx bx, ah ; 0f b6 dc
sar bx, 006h ; c1 fb 06
sal bx, 008h ; c1 e3 08
add bx, word [bp-010h] ; 03 5e f0
mov byte [bp-00ch], bl ; 88 5e f4
cmp AL, strict byte 001h ; 3c 01
jnbe near 03623h ; 0f 87 51 ff
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 02f0ah ; e8 31 f8
test ax, ax ; 85 c0
je near 02fefh ; 0f 84 10 f9
movzx dx, byte [bp-008h] ; 0f b6 56 f8
mov ax, dx ; 89 d0
call 02d4fh ; e8 67 f6
test ax, ax ; 85 c0
jne short 03706h ; 75 1a
mov ax, dx ; 89 d0
call 02e1ah ; e8 29 f7
test ax, ax ; 85 c0
jne short 03706h ; 75 11
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 00ch ; 80 cc 0c
mov word [bp+016h], ax ; 89 46 16
mov ax, strict word 0000ch ; b8 0c 00
jmp near 02fcdh ; e9 c7 f8
mov ax, strict word 00010h ; b8 10 00
call 016ach ; e8 a0 df
cmp byte [bp-008h], 000h ; 80 7e f8 00
jne short 03719h ; 75 07
mov cl, al ; 88 c1
shr cl, 004h ; c0 e9 04
jmp short 0371eh ; eb 05
mov cl, al ; 88 c1
and cl, 00fh ; 80 e1 0f
cmp byte [bp-008h], 000h ; 80 7e f8 00
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
movzx dx, al ; 0f b6 d0
add dx, 00090h ; 81 c2 90 00
mov word [bp-012h], dx ; 89 56 ee
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 1b df
and AL, strict byte 00fh ; 24 0f
cmp cl, 003h ; 80 f9 03
jc short 0375ah ; 72 1e
mov dl, al ; 88 c2
or dl, 090h ; 80 ca 90
cmp cl, 003h ; 80 f9 03
jbe short 03798h ; 76 52
mov ah, al ; 88 c4
or ah, 010h ; 80 cc 10
cmp cl, 005h ; 80 f9 05
je near 037bdh ; 0f 84 6b 00
cmp cl, 004h ; 80 f9 04
je short 037a7h ; 74 50
jmp near 037d8h ; e9 7e 00
cmp cl, 002h ; 80 f9 02
je short 0377ah ; 74 1b
cmp cl, 001h ; 80 f9 01
jne near 037d8h ; 0f 85 72 00
cmp byte [bp-00ch], 027h ; 80 7e f4 27
jne near 037d8h ; 0f 85 6a 00
cmp ch, 009h ; 80 fd 09
jne near 037d8h ; 0f 85 63 00
or AL, strict byte 090h ; 0c 90
jmp near 037d8h ; e9 5e 00
cmp byte [bp-00ch], 027h ; 80 7e f4 27
jne short 03789h ; 75 09
cmp ch, 009h ; 80 fd 09
jne short 03789h ; 75 04
or AL, strict byte 070h ; 0c 70
jmp short 037d8h ; eb 4f
cmp byte [bp-00ch], 04fh ; 80 7e f4 4f
jne short 037d8h ; 75 49
cmp ch, 00fh ; 80 fd 0f
jne short 037d8h ; 75 44
or AL, strict byte 010h ; 0c 10
jmp short 037d8h ; eb 40
cmp byte [bp-00ch], 04fh ; 80 7e f4 4f
jne short 037d8h ; 75 3a
cmp ch, 009h ; 80 fd 09
jne short 037d8h ; 75 35
mov al, dl ; 88 d0
jmp short 037d8h ; eb 31
cmp byte [bp-00ch], 04fh ; 80 7e f4 4f
jne short 037d8h ; 75 2b
cmp ch, 009h ; 80 fd 09
jne short 037b4h ; 75 02
jmp short 037a3h ; eb ef
cmp ch, 012h ; 80 fd 12
jne short 037d8h ; 75 1f
mov al, ah ; 88 e0
jmp short 037d8h ; eb 1b
cmp byte [bp-00ch], 04fh ; 80 7e f4 4f
jne short 037d8h ; 75 15
cmp ch, 009h ; 80 fd 09
jne short 037cah ; 75 02
jmp short 037a3h ; eb d9
cmp ch, 012h ; 80 fd 12
jne short 037d1h ; 75 02
jmp short 037b9h ; eb e8
cmp ch, 024h ; 80 fd 24
jne short 037d8h ; 75 02
or AL, strict byte 0d0h ; 0c d0
movzx dx, al ; 0f b6 d0
sar dx, 004h ; c1 fa 04
test dl, 001h ; f6 c2 01
je near 036f5h ; 0f 84 10 ff
movzx bx, al ; 0f b6 d8
mov dx, word [bp-012h] ; 8b 56 ee
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 6d de
mov word [bp+006h], 0f000h ; c7 46 06 00 f0
movzx ax, cl ; 0f b6 c1
call 03825h ; e8 29 00
mov word [bp+008h], ax ; 89 46 08
jmp near 036a4h ; e9 a2 fe
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 24 e1
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 00255h ; 68 55 02
push 002c2h ; 68 c2 02
push strict byte 00004h ; 6a 04
call 01972h ; e8 53 e1
add sp, strict byte 00008h ; 83 c4 08
jmp near 02fbfh ; e9 9a f7
get_floppy_dpt_: ; 0xf3825 LB 0x2f
push bx ; 53
push dx ; 52
push bp ; 55
mov bp, sp ; 89 e5
mov dl, al ; 88 c2
xor ax, ax ; 31 c0
jmp short 03836h ; eb 06
inc ax ; 40
cmp ax, strict word 00007h ; 3d 07 00
jnc short 0384dh ; 73 17
mov bx, ax ; 89 c3
add bx, ax ; 01 c3
cmp dl, byte [word bx+0005bh] ; 3a 97 5b 00
jne short 03830h ; 75 f0
movzx ax, byte [word bx+0005ch] ; 0f b6 87 5c 00
imul ax, ax, strict byte 0000dh ; 6b c0 0d
add ax, strict word 00000h ; 05 00 00
jmp short 03850h ; eb 03
mov ax, strict word 00041h ; b8 41 00
pop bp ; 5d
pop dx ; 5a
pop bx ; 5b
retn ; c3
dummy_soft_reset_: ; 0xf3854 LB 0x7
push bp ; 55
mov bp, sp ; 89 e5
xor ax, ax ; 31 c0
pop bp ; 5d
retn ; c3
_cdemu_init: ; 0xf385b LB 0x18
push bp ; 55
mov bp, sp ; 89 e5
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 05 de
xor bx, bx ; 31 db
mov dx, 00322h ; ba 22 03
call 0165eh ; e8 ef dd
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
_cdemu_isactive: ; 0xf3873 LB 0x16
push bp ; 55
mov bp, sp ; 89 e5
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 ed dd
mov dx, 00322h ; ba 22 03
call 01650h ; e8 cb dd
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
_cdemu_emulated_drive: ; 0xf3889 LB 0x16
push bp ; 55
mov bp, sp ; 89 e5
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 d7 dd
mov dx, 00324h ; ba 24 03
call 01650h ; e8 b5 dd
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
_int13_eltorito: ; 0xf389f LB 0x189
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 bf dd
mov si, 00322h ; be 22 03
mov di, ax ; 89 c7
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
cmp ax, strict word 0004bh ; 3d 4b 00
jc short 038c7h ; 72 0a
jbe short 038edh ; 76 2e
cmp ax, strict word 0004dh ; 3d 4d 00
jbe short 038ceh ; 76 0a
jmp near 039ech ; e9 25 01
cmp ax, strict word 0004ah ; 3d 4a 00
jne near 039ech ; 0f 85 1e 01
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 58 e0
push word [bp+016h] ; ff 76 16
push 002dch ; 68 dc 02
push 002ebh ; 68 eb 02
push strict byte 00004h ; 6a 04
call 01972h ; e8 8b e0
add sp, strict byte 00008h ; 83 c4 08
jmp near 03a07h ; e9 1a 01
mov dx, word [bp+00ah] ; 8b 56 0a
mov ax, word [bp+004h] ; 8b 46 04
mov bx, strict word 00013h ; bb 13 00
call 0165eh ; e8 65 dd
mov es, di ; 8e c7
movzx bx, byte [es:si+001h] ; 26 0f b6 5c 01
mov dx, word [bp+00ah] ; 8b 56 0a
inc dx ; 42
mov ax, word [bp+004h] ; 8b 46 04
call 0165eh ; e8 54 dd
mov es, di ; 8e c7
movzx bx, byte [es:si+002h] ; 26 0f b6 5c 02
mov dx, word [bp+00ah] ; 8b 56 0a
inc dx ; 42
inc dx ; 42
mov ax, word [bp+004h] ; 8b 46 04
call 0165eh ; e8 42 dd
mov es, di ; 8e c7
movzx bx, byte [es:si+003h] ; 26 0f b6 5c 03
mov dx, word [bp+00ah] ; 8b 56 0a
add dx, strict byte 00003h ; 83 c2 03
mov ax, word [bp+004h] ; 8b 46 04
call 0165eh ; e8 2f dd
mov es, di ; 8e c7
mov bx, word [es:si+008h] ; 26 8b 5c 08
mov cx, word [es:si+00ah] ; 26 8b 4c 0a
mov dx, word [bp+00ah] ; 8b 56 0a
add dx, strict byte 00004h ; 83 c2 04
mov ax, word [bp+004h] ; 8b 46 04
call 0169ah ; e8 55 dd
mov es, di ; 8e c7
mov bx, word [es:si+004h] ; 26 8b 5c 04
mov dx, word [bp+00ah] ; 8b 56 0a
add dx, strict byte 00008h ; 83 c2 08
mov ax, word [bp+004h] ; 8b 46 04
call 0167ah ; e8 23 dd
mov es, di ; 8e c7
mov bx, word [es:si+006h] ; 26 8b 5c 06
mov dx, word [bp+00ah] ; 8b 56 0a
add dx, strict byte 0000ah ; 83 c2 0a
mov ax, word [bp+004h] ; 8b 46 04
call 0167ah ; e8 11 dd
mov es, di ; 8e c7
mov bx, word [es:si+00ch] ; 26 8b 5c 0c
mov dx, word [bp+00ah] ; 8b 56 0a
add dx, strict byte 0000ch ; 83 c2 0c
mov ax, word [bp+004h] ; 8b 46 04
call 0167ah ; e8 ff dc
mov es, di ; 8e c7
mov bx, word [es:si+00eh] ; 26 8b 5c 0e
mov dx, word [bp+00ah] ; 8b 56 0a
add dx, strict byte 0000eh ; 83 c2 0e
mov ax, word [bp+004h] ; 8b 46 04
call 0167ah ; e8 ed dc
mov es, di ; 8e c7
movzx bx, byte [es:si+012h] ; 26 0f b6 5c 12
mov dx, word [bp+00ah] ; 8b 56 0a
add dx, strict byte 00010h ; 83 c2 10
mov ax, word [bp+004h] ; 8b 46 04
call 0165eh ; e8 be dc
mov es, di ; 8e c7
movzx bx, byte [es:si+014h] ; 26 0f b6 5c 14
mov dx, word [bp+00ah] ; 8b 56 0a
add dx, strict byte 00011h ; 83 c2 11
mov ax, word [bp+004h] ; 8b 46 04
call 0165eh ; e8 ab dc
mov es, di ; 8e c7
movzx bx, byte [es:si+010h] ; 26 0f b6 5c 10
mov dx, word [bp+00ah] ; 8b 56 0a
add dx, strict byte 00012h ; 83 c2 12
mov ax, word [bp+004h] ; 8b 46 04
call 0165eh ; e8 98 dc
test byte [bp+016h], 0ffh ; f6 46 16 ff
jne short 039d2h ; 75 06
mov es, di ; 8e c7
mov byte [es:si], 000h ; 26 c6 04 00
mov byte [bp+017h], 000h ; c6 46 17 00
xor bx, bx ; 31 db
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 7d dc
and byte [bp+01ch], 0feh ; 80 66 1c fe
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 3a df
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 002dch ; 68 dc 02
push 00313h ; 68 13 03
jmp near 038e2h ; e9 db fe
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 001h ; 80 cc 01
mov word [bp+016h], ax ; 89 46 16
mov bx, ax ; 89 c3
shr bx, 008h ; c1 eb 08
xor bh, bh ; 30 ff
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 3c dc
or byte [bp+01ch], 001h ; 80 4e 1c 01
jmp short 039e5h ; eb bd
device_is_cdrom_: ; 0xf3a28 LB 0x35
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bl, al ; 88 c3
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 34 dc
cmp bl, 010h ; 80 fb 10
jc short 03a41h ; 72 04
xor ax, ax ; 31 c0
jmp short 03a56h ; eb 15
xor bh, bh ; 30 ff
imul bx, bx, strict byte 00018h ; 6b db 18
mov es, ax ; 8e c0
add bx, 00122h ; 81 c3 22 01
cmp byte [es:bx+01fh], 005h ; 26 80 7f 1f 05
jne short 03a3dh ; 75 ea
mov ax, strict word 00001h ; b8 01 00
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
cdrom_boot_: ; 0xf3a5d LB 0x416
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, 0081ch ; 81 ec 1c 08
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 fa db
mov word [bp-018h], ax ; 89 46 e8
mov si, 00322h ; be 22 03
mov word [bp-010h], ax ; 89 46 f0
mov word [bp-014h], 00122h ; c7 46 ec 22 01
mov word [bp-012h], ax ; 89 46 ee
mov byte [bp-00ch], 000h ; c6 46 f4 00
jmp short 03a92h ; eb 09
inc byte [bp-00ch] ; fe 46 f4
cmp byte [bp-00ch], 010h ; 80 7e f4 10
jnc short 03a9dh ; 73 0b
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
call 03a28h ; e8 8f ff
test ax, ax ; 85 c0
je short 03a89h ; 74 ec
cmp byte [bp-00ch], 010h ; 80 7e f4 10
jc short 03aa9h ; 72 06
mov ax, strict word 00002h ; b8 02 00
jmp near 03e10h ; e9 67 03
mov cx, strict word 0000ch ; b9 0c 00
xor bx, bx ; 31 db
mov dx, ss ; 8c d2
lea ax, [bp-026h] ; 8d 46 da
call 097aah ; e8 f4 5c
mov word [bp-026h], strict word 00028h ; c7 46 da 28 00
mov ax, strict word 00011h ; b8 11 00
xor dx, dx ; 31 d2
xchg ah, al ; 86 c4
xchg dh, dl ; 86 d6
xchg dx, ax ; 92
mov word [bp-024h], ax ; 89 46 dc
mov word [bp-022h], dx ; 89 56 de
mov ax, strict word 00001h ; b8 01 00
xchg ah, al ; 86 c4
mov word [bp-01fh], ax ; 89 46 e1
les bx, [bp-014h] ; c4 5e ec
db 066h, 026h, 0c7h, 047h, 00ah, 001h, 000h, 000h, 008h
; mov dword [es:bx+00ah], strict dword 008000001h ; 66 26 c7 47 0a 01 00 00 08
mov byte [bp-00eh], 000h ; c6 46 f2 00
jmp short 03aeeh ; eb 09
inc byte [bp-00eh] ; fe 46 f2
cmp byte [bp-00eh], 004h ; 80 7e f2 04
jnbe short 03b25h ; 77 37
movzx di, byte [bp-00ch] ; 0f b6 7e f4
imul di, di, strict byte 00018h ; 6b ff 18
mov es, [bp-012h] ; 8e 46 ee
add di, word [bp-014h] ; 03 7e ec
movzx di, byte [es:di+01eh] ; 26 0f b6 7d 1e
add di, di ; 01 ff
lea dx, [bp-00826h] ; 8d 96 da f7
push SS ; 16
push dx ; 52
push strict byte 00001h ; 6a 01
push strict byte 00000h ; 6a 00
push 00800h ; 68 00 08
push strict byte 00000h ; 6a 00
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
mov cx, ss ; 8c d1
lea bx, [bp-026h] ; 8d 5e da
mov dx, strict word 0000ch ; ba 0c 00
call word [word di+0006ah] ; ff 95 6a 00
test ax, ax ; 85 c0
jne short 03ae5h ; 75 c0
test ax, ax ; 85 c0
je short 03b2fh ; 74 06
mov ax, strict word 00003h ; b8 03 00
jmp near 03e10h ; e9 e1 02
cmp byte [bp-00826h], 000h ; 80 be da f7 00
je short 03b3ch ; 74 06
mov ax, strict word 00004h ; b8 04 00
jmp near 03e10h ; e9 d4 02
xor di, di ; 31 ff
jmp short 03b46h ; eb 06
inc di ; 47
cmp di, strict byte 00005h ; 83 ff 05
jnc short 03b56h ; 73 10
mov al, byte [bp+di-00825h] ; 8a 83 db f7
cmp al, byte [di+00daah] ; 3a 85 aa 0d
je short 03b40h ; 74 f0
mov ax, strict word 00005h ; b8 05 00
jmp near 03e10h ; e9 ba 02
xor di, di ; 31 ff
jmp short 03b60h ; eb 06
inc di ; 47
cmp di, strict byte 00017h ; 83 ff 17
jnc short 03b70h ; 73 10
mov al, byte [bp+di-0081fh] ; 8a 83 e1 f7
cmp al, byte [di+00db0h] ; 3a 85 b0 0d
je short 03b5ah ; 74 f0
mov ax, strict word 00006h ; b8 06 00
jmp near 03e10h ; e9 a0 02
mov ax, word [bp-007dfh] ; 8b 86 21 f8
mov dx, word [bp-007ddh] ; 8b 96 23 f8
mov word [bp-026h], strict word 00028h ; c7 46 da 28 00
xchg ah, al ; 86 c4
xchg dh, dl ; 86 d6
xchg dx, ax ; 92
mov word [bp-024h], ax ; 89 46 dc
mov word [bp-022h], dx ; 89 56 de
mov ax, strict word 00001h ; b8 01 00
xchg ah, al ; 86 c4
mov word [bp-01fh], ax ; 89 46 e1
movzx di, byte [bp-00ch] ; 0f b6 7e f4
imul di, di, strict byte 00018h ; 6b ff 18
mov es, [bp-012h] ; 8e 46 ee
add di, word [bp-014h] ; 03 7e ec
movzx di, byte [es:di+01eh] ; 26 0f b6 7d 1e
add di, di ; 01 ff
lea dx, [bp-00826h] ; 8d 96 da f7
push SS ; 16
push dx ; 52
push strict byte 00001h ; 6a 01
push strict byte 00000h ; 6a 00
push 00800h ; 68 00 08
push strict byte 00000h ; 6a 00
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
mov cx, ss ; 8c d1
lea bx, [bp-026h] ; 8d 5e da
mov dx, strict word 0000ch ; ba 0c 00
call word [word di+0006ah] ; ff 95 6a 00
test ax, ax ; 85 c0
je short 03bcdh ; 74 06
mov ax, strict word 00007h ; b8 07 00
jmp near 03e10h ; e9 43 02
cmp byte [bp-00826h], 001h ; 80 be da f7 01
je short 03bdah ; 74 06
mov ax, strict word 00008h ; b8 08 00
jmp near 03e10h ; e9 36 02
cmp byte [bp-00825h], 000h ; 80 be db f7 00
je short 03be7h ; 74 06
mov ax, strict word 00009h ; b8 09 00
jmp near 03e10h ; e9 29 02
cmp byte [bp-00808h], 055h ; 80 be f8 f7 55
je short 03bf4h ; 74 06
mov ax, strict word 0000ah ; b8 0a 00
jmp near 03e10h ; e9 1c 02
cmp byte [bp-00807h], 0aah ; 80 be f9 f7 aa
jne short 03beeh ; 75 f3
cmp byte [bp-00806h], 088h ; 80 be fa f7 88
je short 03c08h ; 74 06
mov ax, strict word 0000bh ; b8 0b 00
jmp near 03e10h ; e9 08 02
mov al, byte [bp-00805h] ; 8a 86 fb f7
mov es, [bp-010h] ; 8e 46 f0
mov byte [es:si+001h], al ; 26 88 44 01
cmp byte [bp-00805h], 000h ; 80 be fb f7 00
jne short 03c21h ; 75 07
mov byte [es:si+002h], 0e0h ; 26 c6 44 02 e0
jmp short 03c34h ; eb 13
cmp byte [bp-00805h], 004h ; 80 be fb f7 04
jnc short 03c2fh ; 73 07
mov byte [es:si+002h], 000h ; 26 c6 44 02 00
jmp short 03c34h ; eb 05
mov byte [es:si+002h], 080h ; 26 c6 44 02 80
movzx di, byte [bp-00ch] ; 0f b6 7e f4
mov ax, di ; 89 f8
cwd ; 99
db 02bh, 0c2h
; sub ax, dx ; 2b c2
sar ax, 1 ; d1 f8
mov es, [bp-010h] ; 8e 46 f0
mov byte [es:si+003h], al ; 26 88 44 03
mov ax, di ; 89 f8
cwd ; 99
mov bx, strict word 00002h ; bb 02 00
idiv bx ; f7 fb
mov word [es:si+004h], dx ; 26 89 54 04
mov ax, word [bp-00804h] ; 8b 86 fc f7
mov word [bp-016h], ax ; 89 46 ea
test ax, ax ; 85 c0
jne short 03c62h ; 75 05
mov word [bp-016h], 007c0h ; c7 46 ea c0 07
mov ax, word [bp-016h] ; 8b 46 ea
mov es, [bp-010h] ; 8e 46 f0
mov word [es:si+00ch], ax ; 26 89 44 0c
mov word [es:si+006h], strict word 00000h ; 26 c7 44 06 00 00
mov di, word [bp-00800h] ; 8b be 00 f8
mov word [es:si+00eh], di ; 26 89 7c 0e
test di, di ; 85 ff
je short 03c84h ; 74 06
cmp di, 00400h ; 81 ff 00 04
jbe short 03c8ah ; 76 06
mov ax, strict word 0000ch ; b8 0c 00
jmp near 03e10h ; e9 86 01
mov ax, word [bp-007feh] ; 8b 86 02 f8
mov dx, word [bp-007fch] ; 8b 96 04 f8
mov word [es:si+008h], ax ; 26 89 44 08
mov word [es:si+00ah], dx ; 26 89 54 0a
mov word [bp-026h], strict word 00028h ; c7 46 da 28 00
xchg ah, al ; 86 c4
xchg dh, dl ; 86 d6
xchg dx, ax ; 92
mov word [bp-024h], ax ; 89 46 dc
mov word [bp-022h], dx ; 89 56 de
lea dx, [di-001h] ; 8d 55 ff
shr dx, 002h ; c1 ea 02
inc dx ; 42
mov ax, dx ; 89 d0
xchg ah, al ; 86 c4
mov word [bp-01fh], ax ; 89 46 e1
les bx, [bp-014h] ; c4 5e ec
mov word [es:bx+00ah], dx ; 26 89 57 0a
mov word [es:bx+00ch], 00200h ; 26 c7 47 0c 00 02
mov ax, di ; 89 f8
sal ax, 009h ; c1 e0 09
mov dx, 00800h ; ba 00 08
sub dx, ax ; 29 c2
mov ax, dx ; 89 d0
and ah, 007h ; 80 e4 07
mov word [es:bx+01ch], ax ; 26 89 47 1c
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
imul ax, ax, strict byte 00018h ; 6b c0 18
add bx, ax ; 01 c3
movzx ax, byte [es:bx+01eh] ; 26 0f b6 47 1e
add ax, ax ; 01 c0
mov word [bp-01ah], ax ; 89 46 e6
push word [bp-016h] ; ff 76 ea
push dword 000000001h ; 66 6a 01
mov ax, di ; 89 f8
xor di, di ; 31 ff
mov cx, strict word 00009h ; b9 09 00
sal ax, 1 ; d1 e0
rcl di, 1 ; d1 d7
loop 03cf8h ; e2 fa
push di ; 57
push ax ; 50
push strict byte 00000h ; 6a 00
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
mov cx, ss ; 8c d1
lea bx, [bp-026h] ; 8d 5e da
mov dx, strict word 0000ch ; ba 0c 00
mov di, word [bp-01ah] ; 8b 7e e6
call word [word di+0006ah] ; ff 95 6a 00
les bx, [bp-014h] ; c4 5e ec
mov word [es:bx+01ch], strict word 00000h ; 26 c7 47 1c 00 00
test ax, ax ; 85 c0
je short 03d28h ; 74 06
mov ax, strict word 0000dh ; b8 0d 00
jmp near 03e10h ; e9 e8 00
mov es, [bp-010h] ; 8e 46 f0
mov al, byte [es:si+001h] ; 26 8a 44 01
cmp AL, strict byte 002h ; 3c 02
jc short 03d40h ; 72 0d
jbe short 03d58h ; 76 23
cmp AL, strict byte 004h ; 3c 04
je short 03d6eh ; 74 35
cmp AL, strict byte 003h ; 3c 03
je short 03d63h ; 74 26
jmp near 03db9h ; e9 79 00
cmp AL, strict byte 001h ; 3c 01
jne short 03db9h ; 75 75
mov es, [bp-010h] ; 8e 46 f0
db 066h, 026h, 0c7h, 044h, 012h, 050h, 000h, 00fh, 000h
; mov dword [es:si+012h], strict dword 0000f0050h ; 66 26 c7 44 12 50 00 0f 00
mov word [es:si+010h], strict word 00002h ; 26 c7 44 10 02 00
jmp short 03db9h ; eb 61
db 066h, 026h, 0c7h, 044h, 012h, 050h, 000h, 012h, 000h
; mov dword [es:si+012h], strict dword 000120050h ; 66 26 c7 44 12 50 00 12 00
jmp short 03d50h ; eb ed
db 066h, 026h, 0c7h, 044h, 012h, 050h, 000h, 024h, 000h
; mov dword [es:si+012h], strict dword 000240050h ; 66 26 c7 44 12 50 00 24 00
jmp short 03d50h ; eb e2
mov dx, 001c4h ; ba c4 01
mov ax, word [bp-016h] ; 8b 46 ea
call 01650h ; e8 d9 d8
and AL, strict byte 03fh ; 24 3f
xor ah, ah ; 30 e4
mov es, [bp-010h] ; 8e 46 f0
mov word [es:si+014h], ax ; 26 89 44 14
mov dx, 001c4h ; ba c4 01
mov ax, word [bp-016h] ; 8b 46 ea
call 01650h ; e8 c5 d8
movzx bx, al ; 0f b6 d8
sal bx, 002h ; c1 e3 02
mov dx, 001c5h ; ba c5 01
mov ax, word [bp-016h] ; 8b 46 ea
call 01650h ; e8 b6 d8
xor ah, ah ; 30 e4
add ax, bx ; 01 d8
inc ax ; 40
mov es, [bp-010h] ; 8e 46 f0
mov word [es:si+012h], ax ; 26 89 44 12
mov dx, 001c3h ; ba c3 01
mov ax, word [bp-016h] ; 8b 46 ea
call 01650h ; e8 a1 d8
xor ah, ah ; 30 e4
inc ax ; 40
mov es, [bp-010h] ; 8e 46 f0
mov word [es:si+010h], ax ; 26 89 44 10
mov es, [bp-010h] ; 8e 46 f0
cmp byte [es:si+001h], 000h ; 26 80 7c 01 00
je short 03df7h ; 74 34
cmp byte [es:si+002h], 000h ; 26 80 7c 02 00
jne short 03de0h ; 75 16
mov dx, strict word 00010h ; ba 10 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 7d d8
or AL, strict byte 041h ; 0c 41
movzx bx, al ; 0f b6 d8
mov dx, strict word 00010h ; ba 10 00
mov ax, strict word 00040h ; b8 40 00
jmp short 03df4h ; eb 14
mov dx, 002c0h ; ba c0 02
mov ax, word [bp-018h] ; 8b 46 e8
call 01650h ; e8 67 d8
db 0feh, 0c0h
; inc al ; fe c0
movzx bx, al ; 0f b6 d8
mov dx, 002c0h ; ba c0 02
mov ax, word [bp-018h] ; 8b 46 e8
call 0165eh ; e8 67 d8
mov es, [bp-010h] ; 8e 46 f0
cmp byte [es:si+001h], 000h ; 26 80 7c 01 00
je short 03e05h ; 74 04
mov byte [es:si], 001h ; 26 c6 04 01
mov es, [bp-010h] ; 8e 46 f0
movzx ax, byte [es:si+002h] ; 26 0f b6 44 02
sal ax, 008h ; c1 e0 08
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
db 050h, 04eh, 049h, 048h, 047h, 046h, 045h, 044h, 043h, 042h, 041h, 018h, 016h, 015h, 014h, 011h
db 010h, 00dh, 00ch, 00bh, 00ah, 009h, 008h, 005h, 004h, 003h, 002h, 001h, 000h, 00bh, 042h, 019h
db 03fh, 063h, 03fh, 08bh, 03fh, 058h, 03fh, 08bh, 03fh, 058h, 03fh, 061h, 041h, 03eh, 03fh, 00bh
db 042h, 00bh, 042h, 03eh, 03fh, 03eh, 03fh, 03eh, 03fh, 03eh, 03fh, 03eh, 03fh, 002h, 042h, 03eh
db 03fh, 00bh, 042h, 00bh, 042h, 00bh, 042h, 00bh, 042h, 00bh, 042h, 00bh, 042h, 00bh, 042h, 00bh
db 042h, 00bh, 042h, 00bh, 042h, 00bh, 042h, 00bh, 042h
_int13_cdemu: ; 0xf3e73 LB 0x434
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0002ah ; 83 ec 2a
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 e8 d7
mov di, 00322h ; bf 22 03
mov cx, ax ; 89 c1
mov si, di ; 89 fe
mov word [bp-008h], ax ; 89 46 f8
mov word [bp-00eh], 00122h ; c7 46 f2 22 01
mov word [bp-00ch], ax ; 89 46 f4
mov es, ax ; 8e c0
mov al, byte [es:di+003h] ; 26 8a 45 03
add al, al ; 00 c0
mov byte [bp-006h], al ; 88 46 fa
mov al, byte [es:di+004h] ; 26 8a 45 04
add byte [bp-006h], al ; 00 46 fa
xor bx, bx ; 31 db
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 ab d7
mov es, cx ; 8e c1
cmp byte [es:di], 000h ; 26 80 3d 00
je short 03ec9h ; 74 0e
movzx dx, byte [es:di+002h] ; 26 0f b6 55 02
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
cmp dx, ax ; 39 c2
je short 03ef2h ; 74 29
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 5d da
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
push ax ; 50
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 0032ch ; 68 2c 03
push 00338h ; 68 38 03
push strict byte 00004h ; 6a 04
call 01972h ; e8 86 da
add sp, strict byte 0000ah ; 83 c4 0a
jmp near 0422bh ; e9 39 03
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
cmp ax, strict word 00050h ; 3d 50 00
jnbe near 0420bh ; 0f 87 0c 03
push CS ; 0e
pop ES ; 07
mov cx, strict word 0001eh ; b9 1e 00
mov di, 03e1ah ; bf 1a 3e
repne scasb ; f2 ae
sal cx, 1 ; d1 e1
mov di, cx ; 89 cf
mov ax, word [cs:di+03e37h] ; 2e 8b 85 37 3e
mov bx, word [bp+016h] ; 8b 5e 16
xor bh, bh ; 30 ff
jmp ax ; ff e0
movzx bx, byte [bp-006h] ; 0f b6 5e fa
imul bx, bx, strict byte 00018h ; 6b db 18
mov es, [bp-00ch] ; 8e 46 f4
add bx, word [bp-00eh] ; 03 5e f2
movzx bx, byte [es:bx+01eh] ; 26 0f b6 5f 1e
add bx, bx ; 01 db
cmp word [word bx+0006ah], strict byte 00000h ; 83 bf 6a 00 00
je near 03f3eh ; 0f 84 08 00
movzx ax, byte [bp-006h] ; 0f b6 46 fa
call word [word bx+00076h] ; ff 97 76 00
mov byte [bp+017h], 000h ; c6 46 17 00
xor bx, bx ; 31 db
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 11 d7
and byte [bp+01ch], 0feh ; 80 66 1c fe
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 003h ; 80 cc 03
jmp near 04233h ; e9 d0 02
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 e4 d6
mov cl, al ; 88 c1
movzx ax, cl ; 0f b6 c1
sal ax, 008h ; c1 e0 08
or bx, ax ; 09 c3
mov word [bp+016h], bx ; 89 5e 16
xor bx, bx ; 31 db
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 da d6
test cl, cl ; 84 c9
je short 03f42h ; 74 ba
jmp near 04247h ; e9 bc 02
mov es, [bp-008h] ; 8e 46 f8
mov di, word [es:si+014h] ; 26 8b 7c 14
mov dx, word [es:si+012h] ; 26 8b 54 12
mov bx, word [es:si+010h] ; 26 8b 5c 10
mov ax, word [es:si+008h] ; 26 8b 44 08
mov word [bp-014h], ax ; 89 46 ec
mov ax, word [es:si+00ah] ; 26 8b 44 0a
mov word [bp-012h], ax ; 89 46 ee
mov ax, word [bp+014h] ; 8b 46 14
and ax, strict word 0003fh ; 25 3f 00
mov word [bp-010h], ax ; 89 46 f0
mov cx, word [bp+014h] ; 8b 4e 14
and cx, 000c0h ; 81 e1 c0 00
sal cx, 002h ; c1 e1 02
mov ax, word [bp+014h] ; 8b 46 14
shr ax, 008h ; c1 e8 08
or ax, cx ; 09 c8
mov si, word [bp+012h] ; 8b 76 12
shr si, 008h ; c1 ee 08
mov cx, word [bp+016h] ; 8b 4e 16
xor ch, ch ; 30 ed
mov word [bp-00ah], cx ; 89 4e f6
test cx, cx ; 85 c9
jne short 03fd8h ; 75 03
jmp near 03f3eh ; e9 66 ff
cmp di, word [bp-010h] ; 3b 7e f0
jc near 0422bh ; 0f 82 4c 02
cmp ax, dx ; 39 d0
jnc near 0422bh ; 0f 83 46 02
cmp si, bx ; 39 de
jnc near 0422bh ; 0f 83 40 02
mov dx, word [bp+016h] ; 8b 56 16
shr dx, 008h ; c1 ea 08
cmp dx, strict byte 00004h ; 83 fa 04
jne short 03ff9h ; 75 03
jmp near 03f3eh ; e9 45 ff
mov dx, word [bp+010h] ; 8b 56 10
shr dx, 004h ; c1 ea 04
mov cx, word [bp+006h] ; 8b 4e 06
add cx, dx ; 01 d1
mov word [bp-016h], cx ; 89 4e ea
mov dx, word [bp+010h] ; 8b 56 10
and dx, strict byte 0000fh ; 83 e2 0f
mov word [bp-01ch], dx ; 89 56 e4
xor dl, dl ; 30 d2
xor cx, cx ; 31 c9
call 09779h ; e8 62 57
xor bx, bx ; 31 db
add ax, si ; 01 f0
adc dx, bx ; 11 da
mov bx, di ; 89 fb
xor cx, cx ; 31 c9
call 09779h ; e8 55 57
mov bx, ax ; 89 c3
mov ax, word [bp-010h] ; 8b 46 f0
dec ax ; 48
xor cx, cx ; 31 c9
add ax, bx ; 01 d8
adc dx, cx ; 11 ca
mov bx, word [bp+016h] ; 8b 5e 16
xor bl, bl ; 30 db
mov cx, word [bp-00ah] ; 8b 4e f6
or cx, bx ; 09 d9
mov word [bp+016h], cx ; 89 4e 16
mov si, ax ; 89 c6
mov di, dx ; 89 d7
shr di, 1 ; d1 ef
rcr si, 1 ; d1 de
shr di, 1 ; d1 ef
rcr si, 1 ; d1 de
mov word [bp-01eh], di ; 89 7e e2
mov di, ax ; 89 c7
and di, strict byte 00003h ; 83 e7 03
xor bh, bh ; 30 ff
add ax, word [bp-00ah] ; 03 46 f6
adc dx, bx ; 11 da
add ax, strict word 0ffffh ; 05 ff ff
adc dx, strict byte 0ffffh ; 83 d2 ff
mov word [bp-022h], ax ; 89 46 de
mov word [bp-020h], dx ; 89 56 e0
shr word [bp-020h], 1 ; d1 6e e0
rcr word [bp-022h], 1 ; d1 5e de
shr word [bp-020h], 1 ; d1 6e e0
rcr word [bp-022h], 1 ; d1 5e de
mov cx, strict word 0000ch ; b9 0c 00
mov dx, ss ; 8c d2
lea ax, [bp-02eh] ; 8d 46 d2
call 097aah ; e8 2f 57
mov word [bp-02eh], strict word 00028h ; c7 46 d2 28 00
mov ax, word [bp-014h] ; 8b 46 ec
add ax, si ; 01 f0
mov dx, word [bp-012h] ; 8b 56 ee
adc dx, word [bp-01eh] ; 13 56 e2
xchg ah, al ; 86 c4
xchg dh, dl ; 86 d6
xchg dx, ax ; 92
mov word [bp-02ch], ax ; 89 46 d4
mov word [bp-02ah], dx ; 89 56 d6
mov ax, word [bp-022h] ; 8b 46 de
sub ax, si ; 29 f0
inc ax ; 40
xchg ah, al ; 86 c4
mov word [bp-027h], ax ; 89 46 d9
mov ax, word [bp-00ah] ; 8b 46 f6
les bx, [bp-00eh] ; c4 5e f2
mov word [es:bx+00ah], ax ; 26 89 47 0a
mov word [es:bx+00ch], 00200h ; 26 c7 47 0c 00 02
mov ax, di ; 89 f8
sal ax, 009h ; c1 e0 09
mov word [es:bx+01ah], ax ; 26 89 47 1a
mov dx, word [bp-00ah] ; 8b 56 f6
xor dh, dh ; 30 f6
and dl, 003h ; 80 e2 03
mov bx, strict word 00004h ; bb 04 00
sub bx, dx ; 29 d3
mov dx, bx ; 89 da
sub dx, di ; 29 fa
sal dx, 009h ; c1 e2 09
and dh, 007h ; 80 e6 07
mov bx, word [bp-00eh] ; 8b 5e f2
mov word [es:bx+01ch], dx ; 26 89 57 1c
movzx dx, byte [bp-006h] ; 0f b6 56 fa
imul dx, dx, strict byte 00018h ; 6b d2 18
add bx, dx ; 01 d3
movzx dx, byte [es:bx+01eh] ; 26 0f b6 57 1e
add dx, dx ; 01 d2
mov word [bp-01ah], dx ; 89 56 e6
push word [bp-016h] ; ff 76 ea
push word [bp-01ch] ; ff 76 e4
push strict byte 00001h ; 6a 01
mov si, word [bp-00ah] ; 8b 76 f6
xor di, di ; 31 ff
mov cx, strict word 00009h ; b9 09 00
sal si, 1 ; d1 e6
rcl di, 1 ; d1 d7
loop 040fbh ; e2 fa
push di ; 57
push si ; 56
push ax ; 50
movzx ax, byte [bp-006h] ; 0f b6 46 fa
mov cx, ss ; 8c d1
lea bx, [bp-02eh] ; 8d 5e d2
mov dx, strict word 0000ch ; ba 0c 00
mov si, word [bp-01ah] ; 8b 76 e6
call word [word si+0006ah] ; ff 94 6a 00
mov dx, ax ; 89 c2
les bx, [bp-00eh] ; c4 5e f2
db 066h, 026h, 0c7h, 047h, 01ah, 000h, 000h, 000h, 000h
; mov dword [es:bx+01ah], strict dword 000000000h ; 66 26 c7 47 1a 00 00 00 00
test al, al ; 84 c0
je near 03f3eh ; 0f 84 13 fe
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 fb d7
movzx ax, dl ; 0f b6 c2
push ax ; 50
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 0032ch ; 68 2c 03
push 0036eh ; 68 6e 03
push strict byte 00004h ; 6a 04
call 01972h ; e8 26 d8
add sp, strict byte 0000ah ; 83 c4 0a
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 002h ; 80 cc 02
mov word [bp+016h], ax ; 89 46 16
mov byte [bp+016h], 000h ; c6 46 16 00
jmp near 04236h ; e9 d5 00
mov es, [bp-008h] ; 8e 46 f8
mov di, word [es:si+014h] ; 26 8b 7c 14
mov dx, word [es:si+012h] ; 26 8b 54 12
dec dx ; 4a
mov bx, word [es:si+010h] ; 26 8b 5c 10
dec bx ; 4b
mov byte [bp+016h], 000h ; c6 46 16 00
mov ax, word [bp+010h] ; 8b 46 10
xor al, al ; 30 c0
mov cx, word [bp+014h] ; 8b 4e 14
xor ch, ch ; 30 ed
mov word [bp-01ah], cx ; 89 4e e6
mov cx, dx ; 89 d1
xor ch, dh ; 30 f5
sal cx, 008h ; c1 e1 08
mov word [bp-018h], cx ; 89 4e e8
mov cx, word [bp-01ah] ; 8b 4e e6
or cx, word [bp-018h] ; 0b 4e e8
mov word [bp+014h], cx ; 89 4e 14
shr dx, 002h ; c1 ea 02
xor dh, dh ; 30 f6
and dl, 0c0h ; 80 e2 c0
and di, strict byte 0003fh ; 83 e7 3f
or dx, di ; 09 fa
xor cl, cl ; 30 c9
or cx, dx ; 09 d1
mov word [bp+014h], cx ; 89 4e 14
mov dx, word [bp+012h] ; 8b 56 12
xor dh, dh ; 30 f6
sal bx, 008h ; c1 e3 08
or dx, bx ; 09 da
mov word [bp+012h], dx ; 89 56 12
xor dl, dl ; 30 d2
or dl, 002h ; 80 ca 02
mov word [bp+012h], dx ; 89 56 12
mov dl, byte [es:si+001h] ; 26 8a 54 01
mov word [bp+010h], ax ; 89 46 10
cmp dl, 003h ; 80 fa 03
je short 041e5h ; 74 1a
cmp dl, 002h ; 80 fa 02
je short 041e1h ; 74 11
cmp dl, 001h ; 80 fa 01
jne short 041e9h ; 75 14
mov ax, word [bp+010h] ; 8b 46 10
xor al, al ; 30 c0
or AL, strict byte 002h ; 0c 02
mov word [bp+010h], ax ; 89 46 10
jmp short 041e9h ; eb 08
or AL, strict byte 004h ; 0c 04
jmp short 041dch ; eb f7
or AL, strict byte 005h ; 0c 05
jmp short 041dch ; eb f3
mov es, [bp-008h] ; 8e 46 f8
cmp byte [es:si+001h], 004h ; 26 80 7c 01 04
jnc near 03f3eh ; 0f 83 49 fd
mov word [bp+008h], 0efc7h ; c7 46 08 c7 ef
mov word [bp+006h], 0f000h ; c7 46 06 00 f0
jmp near 03f3eh ; e9 3c fd
or bh, 003h ; 80 cf 03
mov word [bp+016h], bx ; 89 5e 16
jmp near 03f42h ; e9 37 fd
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 1b d7
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 0032ch ; 68 2c 03
push 0038fh ; 68 8f 03
push strict byte 00004h ; 6a 04
call 01972h ; e8 4a d7
add sp, strict byte 00008h ; 83 c4 08
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 001h ; 80 cc 01
mov word [bp+016h], ax ; 89 46 16
mov bx, word [bp+016h] ; 8b 5e 16
shr bx, 008h ; c1 eb 08
xor bh, bh ; 30 ff
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 17 d4
or byte [bp+01ch], 001h ; 80 4e 1c 01
jmp near 03f51h ; e9 03 fd
db 050h, 04eh, 049h, 048h, 047h, 046h, 045h, 044h, 043h, 042h, 041h, 018h, 016h, 015h, 014h, 011h
db 010h, 00dh, 00ch, 00bh, 00ah, 009h, 008h, 005h, 004h, 003h, 002h, 001h, 000h, 0ech, 047h, 068h
db 045h, 054h, 043h, 0ech, 047h, 049h, 043h, 0ech, 047h, 049h, 043h, 0ech, 047h, 068h, 045h, 0ech
db 047h, 0ech, 047h, 068h, 045h, 068h, 045h, 068h, 045h, 068h, 045h, 068h, 045h, 07eh, 043h, 068h
db 045h, 0ech, 047h, 087h, 043h, 09ah, 043h, 049h, 043h, 09ah, 043h, 0c8h, 044h, 082h, 045h, 09ah
db 043h, 0a9h, 045h, 0a5h, 047h, 0adh, 047h, 0ech, 047h
_int13_cdrom: ; 0xf42a7 LB 0x562
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00028h ; 83 ec 28
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 b4 d3
mov word [bp-01ah], ax ; 89 46 e6
mov si, 00122h ; be 22 01
mov word [bp-00ch], ax ; 89 46 f4
xor bx, bx ; 31 db
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 92 d3
mov ax, word [bp+010h] ; 8b 46 10
xor ah, ah ; 30 e4
cmp ax, 000e0h ; 3d e0 00
jc short 042dbh ; 72 05
cmp ax, 000f0h ; 3d f0 00
jc short 042f9h ; 72 1e
mov ax, word [bp+010h] ; 8b 46 10
xor ah, ah ; 30 e4
push ax ; 50
mov ax, word [bp+018h] ; 8b 46 18
shr ax, 008h ; c1 e8 08
push ax ; 50
push 003bfh ; 68 bf 03
push 003cbh ; 68 cb 03
push strict byte 00004h ; 6a 04
call 01972h ; e8 7f d6
add sp, strict byte 0000ah ; 83 c4 0a
jmp near 047c9h ; e9 d0 04
mov ax, word [bp+010h] ; 8b 46 10
xor ah, ah ; 30 e4
mov es, [bp-00ch] ; 8e 46 f4
mov bx, si ; 89 f3
add bx, ax ; 01 c3
mov dl, byte [es:bx+000d0h] ; 26 8a 97 d0 00
mov byte [bp-008h], dl ; 88 56 f8
cmp dl, 010h ; 80 fa 10
jc short 04322h ; 72 10
push ax ; 50
mov ax, word [bp+018h] ; 8b 46 18
shr ax, 008h ; c1 e8 08
push ax ; 50
push 003bfh ; 68 bf 03
push 003f6h ; 68 f6 03
jmp short 042eeh ; eb cc
mov ax, word [bp+018h] ; 8b 46 18
shr ax, 008h ; c1 e8 08
cmp ax, strict word 00050h ; 3d 50 00
jnbe near 047ech ; 0f 87 bd 04
push CS ; 0e
pop ES ; 07
mov cx, strict word 0001eh ; b9 1e 00
mov di, 0424eh ; bf 4e 42
repne scasb ; f2 ae
sal cx, 1 ; d1 e1
mov di, cx ; 89 cf
mov ax, word [cs:di+0426bh] ; 2e 8b 85 6b 42
mov bx, word [bp+018h] ; 8b 5e 18
xor bh, bh ; 30 ff
jmp ax ; ff e0
mov ax, word [bp+018h] ; 8b 46 18
xor ah, ah ; 30 e4
or ah, 003h ; 80 cc 03
jmp near 047d1h ; e9 7d 04
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 f3 d2
mov cl, al ; 88 c1
movzx ax, cl ; 0f b6 c1
sal ax, 008h ; c1 e0 08
or bx, ax ; 09 c3
mov word [bp+018h], bx ; 89 5e 18
xor bx, bx ; 31 db
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 e9 d2
test cl, cl ; 84 c9
je near 0456ch ; 0f 84 f1 01
jmp near 047e5h ; e9 67 04
or bh, 002h ; 80 cf 02
mov word [bp+018h], bx ; 89 5e 18
jmp near 047d4h ; e9 4d 04
mov word [bp+012h], 0aa55h ; c7 46 12 55 aa
or bh, 030h ; 80 cf 30
mov word [bp+018h], bx ; 89 5e 18
mov word [bp+016h], strict word 00007h ; c7 46 16 07 00
jmp near 0456ch ; e9 d2 01
mov bx, word [bp+00ch] ; 8b 5e 0c
mov es, [bp+006h] ; 8e 46 06
mov word [bp-014h], bx ; 89 5e ec
mov [bp-012h], es ; 8c 46 ee
mov ax, word [es:bx+002h] ; 26 8b 47 02
mov word [bp-010h], ax ; 89 46 f0
mov ax, word [es:bx+006h] ; 26 8b 47 06
mov word [bp-01ch], ax ; 89 46 e4
mov ax, word [es:bx+004h] ; 26 8b 47 04
mov word [bp-020h], ax ; 89 46 e0
mov ax, word [es:bx+00ch] ; 26 8b 47 0c
mov word [bp-018h], ax ; 89 46 e8
mov di, word [es:bx+00eh] ; 26 8b 7f 0e
or di, ax ; 09 c7
je short 043e2h ; 74 18
mov ax, word [bp+018h] ; 8b 46 18
shr ax, 008h ; c1 e8 08
push ax ; 50
push 003bfh ; 68 bf 03
push 00428h ; 68 28 04
push strict byte 00007h ; 6a 07
call 01972h ; e8 96 d5
add sp, strict byte 00008h ; 83 c4 08
jmp near 047c9h ; e9 e7 03
les bx, [bp-014h] ; c4 5e ec
mov ax, word [es:bx+008h] ; 26 8b 47 08
mov word [bp-018h], ax ; 89 46 e8
mov di, bx ; 89 df
mov di, word [es:di+00ah] ; 26 8b 7d 0a
mov ax, word [bp+018h] ; 8b 46 18
shr ax, 008h ; c1 e8 08
mov word [bp-016h], ax ; 89 46 ea
cmp ax, strict word 00044h ; 3d 44 00
je near 04568h ; 0f 84 66 01
cmp ax, strict word 00047h ; 3d 47 00
je near 04568h ; 0f 84 5f 01
mov cx, strict word 0000ch ; b9 0c 00
xor bx, bx ; 31 db
mov dx, ss ; 8c d2
lea ax, [bp-02ch] ; 8d 46 d4
call 097aah ; e8 94 53
mov word [bp-02ch], strict word 00028h ; c7 46 d4 28 00
mov ax, word [bp-018h] ; 8b 46 e8
mov dx, di ; 89 fa
xchg ah, al ; 86 c4
xchg dh, dl ; 86 d6
xchg dx, ax ; 92
mov word [bp-02ah], ax ; 89 46 d6
mov word [bp-028h], dx ; 89 56 d8
mov ax, word [bp-010h] ; 8b 46 f0
xchg ah, al ; 86 c4
mov word [bp-025h], ax ; 89 46 db
mov ax, word [bp-010h] ; 8b 46 f0
mov es, [bp-00ch] ; 8e 46 f4
mov word [es:si+00ah], ax ; 26 89 44 0a
mov word [es:si+00ch], 00800h ; 26 c7 44 0c 00 08
movzx bx, byte [bp-008h] ; 0f b6 5e f8
imul bx, bx, strict byte 00018h ; 6b db 18
add bx, si ; 01 f3
movzx di, byte [es:bx+01eh] ; 26 0f b6 7f 1e
add di, di ; 01 ff
push word [bp-01ch] ; ff 76 e4
push word [bp-020h] ; ff 76 e0
push strict byte 00001h ; 6a 01
xor bx, bx ; 31 db
mov cx, strict word 0000bh ; b9 0b 00
sal ax, 1 ; d1 e0
rcl bx, 1 ; d1 d3
loop 04460h ; e2 fa
push bx ; 53
push ax ; 50
push strict byte 00000h ; 6a 00
movzx ax, byte [bp-008h] ; 0f b6 46 f8
mov cx, ss ; 8c d1
lea bx, [bp-02ch] ; 8d 5e d4
mov dx, strict word 0000ch ; ba 0c 00
call word [word di+0006ah] ; ff 95 6a 00
mov dx, ax ; 89 c2
mov es, [bp-00ch] ; 8e 46 f4
mov ax, word [es:si+016h] ; 26 8b 44 16
mov di, word [es:si+018h] ; 26 8b 7c 18
mov cx, strict word 0000bh ; b9 0b 00
shr di, 1 ; d1 ef
rcr ax, 1 ; d1 d8
loop 0448ah ; e2 fa
les bx, [bp-014h] ; c4 5e ec
mov word [es:bx+002h], ax ; 26 89 47 02
test dl, dl ; 84 d2
je near 04568h ; 0f 84 cb 00
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 89 d4
movzx ax, dl ; 0f b6 c2
push ax ; 50
push word [bp-016h] ; ff 76 ea
push 003bfh ; 68 bf 03
push 00451h ; 68 51 04
push strict byte 00004h ; 6a 04
call 01972h ; e8 b8 d4
add sp, strict byte 0000ah ; 83 c4 0a
mov ax, word [bp+018h] ; 8b 46 18
xor ah, ah ; 30 e4
or ah, 00ch ; 80 cc 0c
jmp near 047d1h ; e9 09 03
cmp bx, strict byte 00002h ; 83 fb 02
jnbe near 047c9h ; 0f 87 fa 02
movzx ax, byte [bp-008h] ; 0f b6 46 f8
imul ax, ax, strict byte 00018h ; 6b c0 18
mov es, [bp-00ch] ; 8e 46 f4
mov di, si ; 89 f7
add di, ax ; 01 c7
mov al, byte [es:di+021h] ; 26 8a 45 21
cmp bx, strict byte 00002h ; 83 fb 02
je short 04559h ; 74 73
cmp bx, strict byte 00001h ; 83 fb 01
je short 04526h ; 74 3b
test bx, bx ; 85 db
jne near 04568h ; 0f 85 77 00
cmp AL, strict byte 0ffh ; 3c ff
jne short 04507h ; 75 12
mov ax, word [bp+018h] ; 8b 46 18
xor ah, ah ; 30 e4
or ah, 0b4h ; 80 cc b4
mov word [bp+018h], ax ; 89 46 18
xor al, al ; 30 c0
or AL, strict byte 001h ; 0c 01
jmp near 047d1h ; e9 ca 02
movzx dx, byte [bp-008h] ; 0f b6 56 f8
imul dx, dx, strict byte 00018h ; 6b d2 18
db 0feh, 0c0h
; inc al ; fe c0
mov es, [bp-00ch] ; 8e 46 f4
add si, dx ; 01 d6
mov byte [es:si+021h], al ; 26 88 44 21
mov ax, word [bp+018h] ; 8b 46 18
xor al, al ; 30 c0
or AL, strict byte 001h ; 0c 01
mov word [bp+018h], ax ; 89 46 18
jmp near 04568h ; e9 42 00
test al, al ; 84 c0
jne short 04536h ; 75 0c
or bh, 0b0h ; 80 cf b0
mov word [bp+018h], bx ; 89 5e 18
mov byte [bp+018h], al ; 88 46 18
jmp near 047d4h ; e9 9e 02
movzx dx, byte [bp-008h] ; 0f b6 56 f8
imul dx, dx, strict byte 00018h ; 6b d2 18
db 0feh, 0c8h
; dec al ; fe c8
mov es, [bp-00ch] ; 8e 46 f4
add si, dx ; 01 d6
mov byte [es:si+021h], al ; 26 88 44 21
test al, al ; 84 c0
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
movzx dx, al ; 0f b6 d0
mov ax, word [bp+018h] ; 8b 46 18
xor al, al ; 30 c0
or ax, dx ; 09 d0
jmp short 04520h ; eb c7
test al, al ; 84 c0
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
xor ah, ah ; 30 e4
mov dx, word [bp+018h] ; 8b 56 18
mov dl, al ; 88 c2
mov word [bp+018h], dx ; 89 56 18
mov byte [bp+019h], 000h ; c6 46 19 00
xor bx, bx ; 31 db
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 e7 d0
and byte [bp+01eh], 0feh ; 80 66 1e fe
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
movzx ax, byte [bp-008h] ; 0f b6 46 f8
imul ax, ax, strict byte 00018h ; 6b c0 18
mov es, [bp-00ch] ; 8e 46 f4
add si, ax ; 01 c6
mov al, byte [es:si+021h] ; 26 8a 44 21
test al, al ; 84 c0
je short 0459ch ; 74 06
or bh, 0b1h ; 80 cf b1
jmp near 04381h ; e9 e5 fd
je short 04568h ; 74 ca
mov ax, word [bp+018h] ; 8b 46 18
xor ah, ah ; 30 e4
or ah, 0b1h ; 80 cc b1
jmp near 047d1h ; e9 28 02
mov dx, word [bp+00ch] ; 8b 56 0c
mov cx, word [bp+006h] ; 8b 4e 06
mov bx, dx ; 89 d3
mov word [bp-00ah], cx ; 89 4e f6
mov es, cx ; 8e c1
mov di, dx ; 89 d7
mov ax, word [es:di] ; 26 8b 05
mov word [bp-00eh], ax ; 89 46 f2
cmp ax, strict word 0001ah ; 3d 1a 00
jc near 047c9h ; 0f 82 04 02
jc short 04616h ; 72 4f
movzx ax, byte [bp-008h] ; 0f b6 46 f8
imul ax, ax, strict byte 00018h ; 6b c0 18
mov es, [bp-00ch] ; 8e 46 f4
mov di, si ; 89 f7
add di, ax ; 01 c7
mov ax, word [es:di+024h] ; 26 8b 45 24
mov es, cx ; 8e c1
mov di, dx ; 89 d7
db 066h, 026h, 0c7h, 005h, 01ah, 000h, 074h, 000h
; mov dword [es:di], strict dword 00074001ah ; 66 26 c7 05 1a 00 74 00
db 066h, 026h, 0c7h, 045h, 004h, 0ffh, 0ffh, 0ffh, 0ffh
; mov dword [es:di+004h], strict dword 0ffffffffh ; 66 26 c7 45 04 ff ff ff ff
db 066h, 026h, 0c7h, 045h, 008h, 0ffh, 0ffh, 0ffh, 0ffh
; mov dword [es:di+008h], strict dword 0ffffffffh ; 66 26 c7 45 08 ff ff ff ff
db 066h, 026h, 0c7h, 045h, 00ch, 0ffh, 0ffh, 0ffh, 0ffh
; mov dword [es:di+00ch], strict dword 0ffffffffh ; 66 26 c7 45 0c ff ff ff ff
mov word [es:di+018h], ax ; 26 89 45 18
db 066h, 026h, 0c7h, 045h, 010h, 0ffh, 0ffh, 0ffh, 0ffh
; mov dword [es:di+010h], strict dword 0ffffffffh ; 66 26 c7 45 10 ff ff ff ff
db 066h, 026h, 0c7h, 045h, 014h, 0ffh, 0ffh, 0ffh, 0ffh
; mov dword [es:di+014h], strict dword 0ffffffffh ; 66 26 c7 45 14 ff ff ff ff
cmp word [bp-00eh], strict byte 0001eh ; 83 7e f2 1e
jc near 046edh ; 0f 82 cf 00
mov es, [bp-00ah] ; 8e 46 f6
mov word [es:bx], strict word 0001eh ; 26 c7 07 1e 00
mov ax, word [bp-01ah] ; 8b 46 e6
mov word [es:bx+01ch], ax ; 26 89 47 1c
mov word [es:bx+01ah], 00312h ; 26 c7 47 1a 12 03
movzx cx, byte [bp-008h] ; 0f b6 4e f8
mov ax, cx ; 89 c8
cwd ; 99
db 02bh, 0c2h
; sub ax, dx ; 2b c2
sar ax, 1 ; d1 f8
movzx di, al ; 0f b6 f8
imul di, di, strict byte 00006h ; 6b ff 06
mov es, [bp-00ch] ; 8e 46 f4
add di, si ; 01 f7
mov ax, word [es:di+001c2h] ; 26 8b 85 c2 01
mov word [bp-01eh], ax ; 89 46 e2
mov dx, word [es:di+001c4h] ; 26 8b 95 c4 01
mov al, byte [es:di+001c1h] ; 26 8a 85 c1 01
mov byte [bp-006h], al ; 88 46 fa
imul cx, cx, strict byte 00018h ; 6b c9 18
mov di, si ; 89 f7
add di, cx ; 01 cf
mov al, byte [es:di+022h] ; 26 8a 45 22
cmp AL, strict byte 001h ; 3c 01
db 00fh, 094h, 0c0h
; sete al ; 0f 94 c0
xor ah, ah ; 30 e4
or AL, strict byte 070h ; 0c 70
mov di, ax ; 89 c7
mov ax, word [bp-01eh] ; 8b 46 e2
mov word [es:si+001f0h], ax ; 26 89 84 f0 01
mov word [es:si+001f2h], dx ; 26 89 94 f2 01
movzx ax, byte [bp-008h] ; 0f b6 46 f8
cwd ; 99
mov cx, strict word 00002h ; b9 02 00
idiv cx ; f7 f9
or dl, 00eh ; 80 ca 0e
mov ax, dx ; 89 d0
sal ax, 004h ; c1 e0 04
mov byte [es:si+001f4h], al ; 26 88 84 f4 01
mov byte [es:si+001f5h], 0cbh ; 26 c6 84 f5 01 cb
mov al, byte [bp-006h] ; 8a 46 fa
mov byte [es:si+001f6h], al ; 26 88 84 f6 01
mov word [es:si+001f7h], strict word 00001h ; 26 c7 84 f7 01 01 00
mov byte [es:si+001f9h], 000h ; 26 c6 84 f9 01 00
mov word [es:si+001fah], di ; 26 89 bc fa 01
mov word [es:si+001fch], strict word 00000h ; 26 c7 84 fc 01 00 00
mov byte [es:si+001feh], 011h ; 26 c6 84 fe 01 11
xor cl, cl ; 30 c9
xor ch, ch ; 30 ed
jmp short 046d0h ; eb 05
cmp ch, 00fh ; 80 fd 0f
jnc short 046e3h ; 73 13
movzx dx, ch ; 0f b6 d5
add dx, 00312h ; 81 c2 12 03
mov ax, word [bp-01ah] ; 8b 46 e6
call 01650h ; e8 73 cf
add cl, al ; 00 c1
db 0feh, 0c5h
; inc ch ; fe c5
jmp short 046cbh ; eb e8
neg cl ; f6 d9
mov es, [bp-00ch] ; 8e 46 f4
mov byte [es:si+001ffh], cl ; 26 88 8c ff 01
cmp word [bp-00eh], strict byte 00042h ; 83 7e f2 42
jc near 04568h ; 0f 82 73 fe
movzx ax, byte [bp-008h] ; 0f b6 46 f8
cwd ; 99
db 02bh, 0c2h
; sub ax, dx ; 2b c2
sar ax, 1 ; d1 f8
xor ah, ah ; 30 e4
imul ax, ax, strict byte 00006h ; 6b c0 06
mov es, [bp-00ch] ; 8e 46 f4
add si, ax ; 01 c6
mov al, byte [es:si+001c0h] ; 26 8a 84 c0 01
mov dx, word [es:si+001c2h] ; 26 8b 94 c2 01
mov es, [bp-00ah] ; 8e 46 f6
mov word [es:bx], strict word 00042h ; 26 c7 07 42 00
db 066h, 026h, 0c7h, 047h, 01eh, 0ddh, 0beh, 024h, 000h
; mov dword [es:bx+01eh], strict dword 00024beddh ; 66 26 c7 47 1e dd be 24 00
mov word [es:bx+022h], strict word 00000h ; 26 c7 47 22 00 00
test al, al ; 84 c0
jne short 04736h ; 75 09
db 066h, 026h, 0c7h, 047h, 024h, 049h, 053h, 041h, 020h
; mov dword [es:bx+024h], strict dword 020415349h ; 66 26 c7 47 24 49 53 41 20
mov es, [bp-00ah] ; 8e 46 f6
db 066h, 026h, 0c7h, 047h, 028h, 041h, 054h, 041h, 020h
; mov dword [es:bx+028h], strict dword 020415441h ; 66 26 c7 47 28 41 54 41 20
db 066h, 026h, 0c7h, 047h, 02ch, 020h, 020h, 020h, 020h
; mov dword [es:bx+02ch], strict dword 020202020h ; 66 26 c7 47 2c 20 20 20 20
test al, al ; 84 c0
jne short 04762h ; 75 13
mov word [es:bx+030h], dx ; 26 89 57 30
db 066h, 026h, 0c7h, 047h, 032h, 000h, 000h, 000h, 000h
; mov dword [es:bx+032h], strict dword 000000000h ; 66 26 c7 47 32 00 00 00 00
mov word [es:bx+036h], strict word 00000h ; 26 c7 47 36 00 00
mov al, byte [bp-008h] ; 8a 46 f8
and AL, strict byte 001h ; 24 01
xor ah, ah ; 30 e4
mov es, [bp-00ah] ; 8e 46 f6
mov word [es:bx+038h], ax ; 26 89 47 38
db 066h, 026h, 0c7h, 047h, 03ah, 000h, 000h, 000h, 000h
; mov dword [es:bx+03ah], strict dword 000000000h ; 66 26 c7 47 3a 00 00 00 00
mov word [es:bx+03eh], strict word 00000h ; 26 c7 47 3e 00 00
xor al, al ; 30 c0
mov AH, strict byte 01eh ; b4 1e
jmp short 0478ah ; eb 05
cmp ah, 040h ; 80 fc 40
jnc short 04799h ; 73 0f
movzx si, ah ; 0f b6 f4
mov es, [bp-00ah] ; 8e 46 f6
add si, bx ; 01 de
add al, byte [es:si] ; 26 02 04
db 0feh, 0c4h
; inc ah ; fe c4
jmp short 04785h ; eb ec
neg al ; f6 d8
mov es, [bp-00ah] ; 8e 46 f6
mov byte [es:bx+041h], al ; 26 88 47 41
jmp near 04568h ; e9 c3 fd
or bh, 006h ; 80 cf 06
mov word [bp+018h], bx ; 89 5e 18
jmp short 047e5h ; eb 38
cmp bx, strict byte 00006h ; 83 fb 06
je near 04568h ; 0f 84 b4 fd
cmp bx, strict byte 00001h ; 83 fb 01
jc short 047c9h ; 72 10
jbe near 04568h ; 0f 86 ab fd
cmp bx, strict byte 00003h ; 83 fb 03
jc short 047c9h ; 72 07
cmp bx, strict byte 00004h ; 83 fb 04
jbe near 04568h ; 0f 86 9f fd
mov ax, word [bp+018h] ; 8b 46 18
xor ah, ah ; 30 e4
or ah, 001h ; 80 cc 01
mov word [bp+018h], ax ; 89 46 18
mov bx, word [bp+018h] ; 8b 5e 18
shr bx, 008h ; c1 eb 08
xor bh, bh ; 30 ff
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 79 ce
or byte [bp+01eh], 001h ; 80 4e 1e 01
jmp near 0457bh ; e9 8f fd
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 3a d1
mov ax, word [bp+018h] ; 8b 46 18
shr ax, 008h ; c1 e8 08
push ax ; 50
push 003bfh ; 68 bf 03
push 00313h ; 68 13 03
push strict byte 00004h ; 6a 04
jmp near 043d9h ; e9 d0 fb
print_boot_device_: ; 0xf4809 LB 0x4b
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
test al, al ; 84 c0
je short 04816h ; 74 05
mov dx, strict word 00002h ; ba 02 00
jmp short 04830h ; eb 1a
test dl, dl ; 84 d2
je short 0481fh ; 74 05
mov dx, strict word 00003h ; ba 03 00
jmp short 04830h ; eb 11
test bl, 080h ; f6 c3 80
jne short 04828h ; 75 04
xor dh, dh ; 30 f6
jmp short 04830h ; eb 08
test bl, 080h ; f6 c3 80
je short 0484eh ; 74 21
mov dx, strict word 00001h ; ba 01 00
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 f6 d0
imul dx, dx, strict byte 0000ah ; 6b d2 0a
add dx, 00dc8h ; 81 c2 c8 0d
push dx ; 52
push 00474h ; 68 74 04
push strict byte 00004h ; 6a 04
call 01972h ; e8 27 d1
add sp, strict byte 00006h ; 83 c4 06
lea sp, [bp-002h] ; 8d 66 fe
pop cx ; 59
pop bp ; 5d
retn ; c3
print_boot_failure_: ; 0xf4854 LB 0x93
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
mov dh, cl ; 88 ce
mov ah, bl ; 88 dc
and ah, 07fh ; 80 e4 7f
movzx si, ah ; 0f b6 f4
test al, al ; 84 c0
je short 04881h ; 74 1b
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 c0 d0
push 00ddch ; 68 dc 0d
push 00488h ; 68 88 04
push strict byte 00004h ; 6a 04
call 01972h ; e8 f6 d0
add sp, strict byte 00006h ; 83 c4 06
jmp short 048c5h ; eb 44
test dl, dl ; 84 d2
je short 04895h ; 74 10
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 a1 d0
push 00de6h ; 68 e6 0d
jmp short 04874h ; eb df
test bl, 080h ; f6 c3 80
je short 048abh ; 74 11
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 8c d0
push si ; 56
push 00dd2h ; 68 d2 0d
jmp short 048bah ; eb 0f
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 7b d0
push si ; 56
push 00dc8h ; 68 c8 0d
push 0049dh ; 68 9d 04
push strict byte 00004h ; 6a 04
call 01972h ; e8 b0 d0
add sp, strict byte 00008h ; 83 c4 08
cmp byte [bp+004h], 001h ; 80 7e 04 01
jne short 048dfh ; 75 14
test dh, dh ; 84 f6
jne short 048d4h ; 75 05
push 004b5h ; 68 b5 04
jmp short 048d7h ; eb 03
push 004dfh ; 68 df 04
push strict byte 00007h ; 6a 07
call 01972h ; e8 96 d0
add sp, strict byte 00004h ; 83 c4 04
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn 00002h ; c2 02 00
print_cdromboot_failure_: ; 0xf48e7 LB 0x27
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push dx ; 52
mov dx, ax ; 89 c2
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 37 d0
push dx ; 52
push 00514h ; 68 14 05
push strict byte 00004h ; 6a 04
call 01972h ; e8 6f d0
add sp, strict byte 00006h ; 83 c4 06
lea sp, [bp-006h] ; 8d 66 fa
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
_int19_function: ; 0xf490e LB 0x256
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000eh ; 83 ec 0e
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 4d cd
mov bx, ax ; 89 c3
mov word [bp-00eh], ax ; 89 46 f2
mov byte [bp-008h], 000h ; c6 46 f8 00
mov ax, strict word 0003dh ; b8 3d 00
call 016ach ; e8 7e cd
movzx si, al ; 0f b6 f0
mov ax, strict word 00038h ; b8 38 00
call 016ach ; e8 75 cd
and AL, strict byte 0f0h ; 24 f0
xor ah, ah ; 30 e4
sal ax, 004h ; c1 e0 04
or si, ax ; 09 c6
mov ax, strict word 0003ch ; b8 3c 00
call 016ach ; e8 66 cd
and AL, strict byte 00fh ; 24 0f
xor ah, ah ; 30 e4
sal ax, 00ch ; c1 e0 0c
or si, ax ; 09 c6
mov dx, 00339h ; ba 39 03
mov ax, bx ; 89 d8
call 01650h ; e8 f9 cc
test al, al ; 84 c0
je short 04966h ; 74 0b
mov dx, 00339h ; ba 39 03
mov ax, bx ; 89 d8
call 01650h ; e8 ed cc
movzx si, al ; 0f b6 f0
cmp byte [bp+004h], 001h ; 80 7e 04 01
jne short 0497ch ; 75 10
mov ax, strict word 0003ch ; b8 3c 00
call 016ach ; e8 3a cd
and AL, strict byte 0f0h ; 24 f0
xor ah, ah ; 30 e4
sar ax, 004h ; c1 f8 04
call 0781eh ; e8 a2 2e
cmp byte [bp+004h], 002h ; 80 7e 04 02
jne short 04985h ; 75 03
shr si, 004h ; c1 ee 04
cmp byte [bp+004h], 003h ; 80 7e 04 03
jne short 0498eh ; 75 03
shr si, 008h ; c1 ee 08
cmp byte [bp+004h], 004h ; 80 7e 04 04
jne short 04997h ; 75 03
shr si, 00ch ; c1 ee 0c
cmp si, strict byte 00010h ; 83 fe 10
jnc short 049a0h ; 73 04
mov byte [bp-008h], 001h ; c6 46 f8 01
xor al, al ; 30 c0
mov byte [bp-006h], al ; 88 46 fa
mov byte [bp-00ah], al ; 88 46 f6
mov byte [bp-00ch], al ; 88 46 f4
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 7b cf
push si ; 56
movzx ax, byte [bp+004h] ; 0f b6 46 04
push ax ; 50
push 00534h ; 68 34 05
push strict byte 00004h ; 6a 04
call 01972h ; e8 ae cf
add sp, strict byte 00008h ; 83 c4 08
and si, strict byte 0000fh ; 83 e6 0f
cmp si, strict byte 00002h ; 83 fe 02
jc short 049ddh ; 72 0e
jbe short 049ech ; 76 1b
cmp si, strict byte 00004h ; 83 fe 04
je short 04a0ah ; 74 34
cmp si, strict byte 00003h ; 83 fe 03
je short 04a00h ; 74 25
jmp short 04a37h ; eb 5a
cmp si, strict byte 00001h ; 83 fe 01
jne short 04a37h ; 75 55
xor al, al ; 30 c0
mov byte [bp-006h], al ; 88 46 fa
mov byte [bp-00ah], al ; 88 46 f6
jmp short 04a4fh ; eb 63
mov dx, 00338h ; ba 38 03
mov ax, word [bp-00eh] ; 8b 46 f2
call 01650h ; e8 5b cc
add AL, strict byte 080h ; 04 80
mov byte [bp-006h], al ; 88 46 fa
mov byte [bp-00ah], 000h ; c6 46 f6 00
jmp short 04a4fh ; eb 4f
mov byte [bp-006h], 000h ; c6 46 fa 00
mov byte [bp-00ah], 001h ; c6 46 f6 01
jmp short 04a14h ; eb 0a
mov byte [bp-00ch], 001h ; c6 46 f4 01
cmp byte [bp-00ah], 000h ; 80 7e f6 00
je short 04a4fh ; 74 3b
call 03a5dh ; e8 46 f0
mov bx, ax ; 89 c3
test AL, strict byte 0ffh ; a8 ff
je short 04a3eh ; 74 21
call 048e7h ; e8 c7 fe
movzx ax, byte [bp-008h] ; 0f b6 46 f8
push ax ; 50
movzx bx, byte [bp-006h] ; 0f b6 5e fa
movzx dx, byte [bp-00ch] ; 0f b6 56 f4
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
mov cx, strict word 00001h ; b9 01 00
call 04854h ; e8 1d fe
xor ax, ax ; 31 c0
xor dx, dx ; 31 d2
jmp near 04b5dh ; e9 1f 01
mov dx, 0032eh ; ba 2e 03
mov ax, word [bp-00eh] ; 8b 46 f2
call 0166ch ; e8 25 cc
mov di, ax ; 89 c7
shr bx, 008h ; c1 eb 08
mov byte [bp-006h], bl ; 88 5e fa
cmp byte [bp-00ch], 001h ; 80 7e f4 01
jne near 04acbh ; 0f 85 74 00
xor si, si ; 31 f6
mov ax, 0e200h ; b8 00 e2
mov es, ax ; 8e c0
cmp word [es:si], 0aa55h ; 26 81 3c 55 aa
jne short 04a20h ; 75 bb
mov cx, ax ; 89 c1
mov si, word [es:si+01ah] ; 26 8b 74 1a
cmp word [es:si+002h], 0506eh ; 26 81 7c 02 6e 50
jne short 04a20h ; 75 ad
cmp word [es:si], 05024h ; 26 81 3c 24 50
jne short 04a20h ; 75 a6
mov di, word [es:si+00eh] ; 26 8b 7c 0e
mov dx, word [es:di] ; 26 8b 15
mov ax, word [es:di+002h] ; 26 8b 45 02
cmp ax, 06568h ; 3d 68 65
jne short 04aa9h ; 75 1f
cmp dx, 07445h ; 81 fa 45 74
jne short 04aa9h ; 75 19
movzx bx, byte [bp-006h] ; 0f b6 5e fa
movzx dx, byte [bp-00ch] ; 0f b6 56 f4
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
call 04809h ; e8 6a fd
mov word [bp-012h], strict word 00006h ; c7 46 ee 06 00
mov word [bp-010h], cx ; 89 4e f0
jmp short 04ac5h ; eb 1c
movzx bx, byte [bp-006h] ; 0f b6 5e fa
movzx dx, byte [bp-00ch] ; 0f b6 56 f4
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
call 04809h ; e8 51 fd
sti ; fb
mov word [bp-010h], cx ; 89 4e f0
mov es, cx ; 8e c1
mov ax, word [es:si+01ah] ; 26 8b 44 1a
mov word [bp-012h], ax ; 89 46 ee
call far [bp-012h] ; ff 5e ee
jmp near 04a20h ; e9 55 ff
cmp byte [bp-00ah], 000h ; 80 7e f6 00
jne short 04af7h ; 75 26
cmp byte [bp-00ch], 000h ; 80 7e f4 00
jne short 04af7h ; 75 20
mov di, 007c0h ; bf c0 07
mov es, di ; 8e c7
mov dl, byte [bp-006h] ; 8a 56 fa
mov ax, 00201h ; b8 01 02
mov DH, strict byte 000h ; b6 00
mov cx, strict word 00001h ; b9 01 00
db 033h, 0dbh
; xor bx, bx ; 33 db
int 013h ; cd 13
mov ax, strict word 00000h ; b8 00 00
sbb ax, strict byte 00000h ; 83 d8 00
test ax, ax ; 85 c0
jne near 04a20h ; 0f 85 29 ff
cmp byte [bp-006h], 000h ; 80 7e fa 00
db 00fh, 094h, 0c1h
; sete cl ; 0f 94 c1
cmp byte [bp-00ah], 000h ; 80 7e f6 00
je short 04b06h ; 74 02
mov CL, strict byte 001h ; b1 01
xor dx, dx ; 31 d2
mov ax, di ; 89 f8
call 0166ch ; e8 5f cb
mov bx, ax ; 89 c3
mov dx, strict word 00002h ; ba 02 00
mov ax, di ; 89 f8
call 0166ch ; e8 55 cb
cmp bx, ax ; 39 c3
je short 04b2ch ; 74 11
test cl, cl ; 84 c9
jne short 04b42h ; 75 23
mov dx, 001feh ; ba fe 01
mov ax, di ; 89 f8
call 0166ch ; e8 45 cb
cmp ax, 0aa55h ; 3d 55 aa
je short 04b42h ; 74 16
movzx ax, byte [bp-008h] ; 0f b6 46 f8
push ax ; 50
movzx bx, byte [bp-006h] ; 0f b6 5e fa
movzx dx, byte [bp-00ch] ; 0f b6 56 f4
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
xor cx, cx ; 31 c9
jmp near 04a34h ; e9 f2 fe
movzx bx, byte [bp-006h] ; 0f b6 5e fa
movzx dx, byte [bp-00ch] ; 0f b6 56 f4
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
call 04809h ; e8 b8 fc
movzx bx, byte [bp-006h] ; 0f b6 5e fa
xor dx, dx ; 31 d2
xor ax, ax ; 31 c0
add ax, di ; 01 f8
adc dx, bx ; 11 da
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
keyboard_panic_: ; 0xf4b64 LB 0x13
push bp ; 55
mov bp, sp ; 89 e5
push ax ; 50
push 00554h ; 68 54 05
push strict byte 00007h ; 6a 07
call 01972h ; e8 02 ce
add sp, strict byte 00006h ; 83 c4 06
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
_keyboard_init: ; 0xf4b77 LB 0x26a
push bp ; 55
mov bp, sp ; 89 e5
mov AL, strict byte 0aah ; b0 aa
mov dx, strict word 00064h ; ba 64 00
out DX, AL ; ee
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 002h ; a8 02
je short 04b9ah ; 74 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 04b9ah ; 76 08
xor al, al ; 30 c0
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04b83h ; eb e9
test bx, bx ; 85 db
jne short 04ba3h ; 75 05
xor ax, ax ; 31 c0
call 04b64h ; e8 c1 ff
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 04bbdh ; 75 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 04bbdh ; 76 08
mov AL, strict byte 001h ; b0 01
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04ba6h ; eb e9
test bx, bx ; 85 db
jne short 04bc7h ; 75 06
mov ax, strict word 00001h ; b8 01 00
call 04b64h ; e8 9d ff
mov dx, strict word 00060h ; ba 60 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp ax, strict word 00055h ; 3d 55 00
je short 04bd8h ; 74 06
mov ax, 003dfh ; b8 df 03
call 04b64h ; e8 8c ff
mov AL, strict byte 0abh ; b0 ab
mov dx, strict word 00064h ; ba 64 00
out DX, AL ; ee
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 002h ; a8 02
je short 04bf8h ; 74 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 04bf8h ; 76 08
mov AL, strict byte 010h ; b0 10
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04be1h ; eb e9
test bx, bx ; 85 db
jne short 04c02h ; 75 06
mov ax, strict word 0000ah ; b8 0a 00
call 04b64h ; e8 62 ff
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 04c1ch ; 75 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 04c1ch ; 76 08
mov AL, strict byte 011h ; b0 11
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04c05h ; eb e9
test bx, bx ; 85 db
jne short 04c26h ; 75 06
mov ax, strict word 0000bh ; b8 0b 00
call 04b64h ; e8 3e ff
mov dx, strict word 00060h ; ba 60 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test ax, ax ; 85 c0
je short 04c36h ; 74 06
mov ax, 003e0h ; b8 e0 03
call 04b64h ; e8 2e ff
mov AL, strict byte 0ffh ; b0 ff
mov dx, strict word 00060h ; ba 60 00
out DX, AL ; ee
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 002h ; a8 02
je short 04c56h ; 74 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 04c56h ; 76 08
mov AL, strict byte 020h ; b0 20
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04c3fh ; eb e9
test bx, bx ; 85 db
jne short 04c60h ; 75 06
mov ax, strict word 00014h ; b8 14 00
call 04b64h ; e8 04 ff
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 04c7ah ; 75 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 04c7ah ; 76 08
mov AL, strict byte 021h ; b0 21
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04c63h ; eb e9
test bx, bx ; 85 db
jne short 04c84h ; 75 06
mov ax, strict word 00015h ; b8 15 00
call 04b64h ; e8 e0 fe
mov dx, strict word 00060h ; ba 60 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp ax, 000fah ; 3d fa 00
je short 04c95h ; 74 06
mov ax, 003e1h ; b8 e1 03
call 04b64h ; e8 cf fe
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 04ca7h ; 75 08
mov AL, strict byte 031h ; b0 31
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04c95h ; eb ee
mov dx, strict word 00060h ; ba 60 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp ax, 000aah ; 3d aa 00
je short 04cc0h ; 74 0e
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp ax, 000aah ; 3d aa 00
je short 04cc0h ; 74 06
mov ax, 003e2h ; b8 e2 03
call 04b64h ; e8 a4 fe
mov AL, strict byte 0f5h ; b0 f5
mov dx, strict word 00060h ; ba 60 00
out DX, AL ; ee
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 002h ; a8 02
je short 04ce0h ; 74 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 04ce0h ; 76 08
mov AL, strict byte 040h ; b0 40
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04cc9h ; eb e9
test bx, bx ; 85 db
jne short 04ceah ; 75 06
mov ax, strict word 00028h ; b8 28 00
call 04b64h ; e8 7a fe
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 04d04h ; 75 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 04d04h ; 76 08
mov AL, strict byte 041h ; b0 41
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04cedh ; eb e9
test bx, bx ; 85 db
jne short 04d0eh ; 75 06
mov ax, strict word 00029h ; b8 29 00
call 04b64h ; e8 56 fe
mov dx, strict word 00060h ; ba 60 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp ax, 000fah ; 3d fa 00
je short 04d1fh ; 74 06
mov ax, 003e3h ; b8 e3 03
call 04b64h ; e8 45 fe
mov AL, strict byte 060h ; b0 60
mov dx, strict word 00064h ; ba 64 00
out DX, AL ; ee
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 002h ; a8 02
je short 04d3fh ; 74 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 04d3fh ; 76 08
mov AL, strict byte 050h ; b0 50
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04d28h ; eb e9
test bx, bx ; 85 db
jne short 04d49h ; 75 06
mov ax, strict word 00032h ; b8 32 00
call 04b64h ; e8 1b fe
mov AL, strict byte 065h ; b0 65
mov dx, strict word 00060h ; ba 60 00
out DX, AL ; ee
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 002h ; a8 02
je short 04d69h ; 74 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 04d69h ; 76 08
mov AL, strict byte 060h ; b0 60
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04d52h ; eb e9
test bx, bx ; 85 db
jne short 04d73h ; 75 06
mov ax, strict word 0003ch ; b8 3c 00
call 04b64h ; e8 f1 fd
mov AL, strict byte 0f4h ; b0 f4
mov dx, strict word 00060h ; ba 60 00
out DX, AL ; ee
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 002h ; a8 02
je short 04d93h ; 74 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 04d93h ; 76 08
mov AL, strict byte 070h ; b0 70
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04d7ch ; eb e9
test bx, bx ; 85 db
jne short 04d9dh ; 75 06
mov ax, strict word 00046h ; b8 46 00
call 04b64h ; e8 c7 fd
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 04db7h ; 75 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 04db7h ; 76 08
mov AL, strict byte 071h ; b0 71
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 04da0h ; eb e9
test bx, bx ; 85 db
jne short 04dc1h ; 75 06
mov ax, strict word 00046h ; b8 46 00
call 04b64h ; e8 a3 fd
mov dx, strict word 00060h ; ba 60 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp ax, 000fah ; 3d fa 00
je short 04dd2h ; 74 06
mov ax, 003e4h ; b8 e4 03
call 04b64h ; e8 92 fd
mov AL, strict byte 0a8h ; b0 a8
mov dx, strict word 00064h ; ba 64 00
out DX, AL ; ee
xor ax, ax ; 31 c0
call 060b6h ; e8 d9 12
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
enqueue_key_: ; 0xf4de1 LB 0x93
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
mov byte [bp-00ah], al ; 88 46 f6
mov bl, dl ; 88 d3
mov dx, strict word 0001ah ; ba 1a 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 75 c8
mov di, ax ; 89 c7
mov dx, strict word 0001ch ; ba 1c 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 6a c8
mov si, ax ; 89 c6
lea cx, [si+002h] ; 8d 4c 02
cmp cx, strict byte 0003eh ; 83 f9 3e
jc short 04e0fh ; 72 03
mov cx, strict word 0001eh ; b9 1e 00
cmp cx, di ; 39 f9
jne short 04e17h ; 75 04
xor ax, ax ; 31 c0
jmp short 04e3ch ; eb 25
xor bh, bh ; 30 ff
mov dx, si ; 89 f2
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 3d c8
movzx bx, byte [bp-00ah] ; 0f b6 5e f6
lea dx, [si+001h] ; 8d 54 01
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 30 c8
mov bx, cx ; 89 cb
mov dx, strict word 0001ch ; ba 1c 00
mov ax, strict word 00040h ; b8 40 00
call 0167ah ; e8 41 c8
mov ax, strict word 00001h ; b8 01 00
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
db 0c6h, 0c5h, 0bah
; mov ch, 0bah ; c6 c5 ba
mov ax, 0aab6h ; b8 b6 aa
popfw ; 9d
push bx ; 53
inc si ; 46
inc bp ; 45
cmp bh, byte [bx+si] ; 3a 38
sub bl, byte [ss:di] ; 36 2a 1d
fist word [bx+si+045h] ; df 50 45
dec di ; 4f
or ax, 00d4fh ; 0d 4f 0d
dec di ; 4f
ror word [bx-01dh], CL ; d3 4f e3
dec si ; 4e
push cx ; 51
push ax ; 50
mov word [0c550h], ax ; a3 50 c5
push ax ; 50
mov [bx+00dh], cs ; 8c 4f 0d
dec di ; 4f
or ax, 0124fh ; 0d 4f 12
push ax ; 50
dec word [bp-07ch] ; ff 4e 84
push ax ; 50
db 0beh
push ax ; 50
_int09_function: ; 0xf4e74 LB 0x3c7
push bp ; 55
mov bp, sp ; 89 e5
push di ; 57
sub sp, strict byte 0000eh ; 83 ec 0e
mov al, byte [bp+014h] ; 8a 46 14
mov byte [bp-008h], al ; 88 46 f8
test al, al ; 84 c0
jne short 04e9eh ; 75 19
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 a1 ca
push 00567h ; 68 67 05
push strict byte 00004h ; 6a 04
call 01972h ; e8 da ca
add sp, strict byte 00004h ; 83 c4 04
jmp near 05235h ; e9 97 03
mov dx, strict word 00017h ; ba 17 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 a9 c7
mov byte [bp-010h], al ; 88 46 f0
mov byte [bp-00ah], al ; 88 46 f6
mov dx, strict word 00018h ; ba 18 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 9a c7
mov byte [bp-00eh], al ; 88 46 f2
mov byte [bp-004h], al ; 88 46 fc
mov dx, 00096h ; ba 96 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 8b c7
mov byte [bp-006h], al ; 88 46 fa
mov byte [bp-00ch], al ; 88 46 f4
mov al, byte [bp-008h] ; 8a 46 f8
push CS ; 0e
pop ES ; 07
mov cx, strict word 00010h ; b9 10 00
mov di, 04e45h ; bf 45 4e
repne scasb ; f2 ae
sal cx, 1 ; d1 e1
mov di, cx ; 89 cf
mov ax, word [cs:di+04e54h] ; 2e 8b 85 54 4e
jmp ax ; ff e0
xor byte [bp-00ah], 040h ; 80 76 f6 40
movzx bx, byte [bp-00ah] ; 0f b6 5e f6
mov dx, strict word 00017h ; ba 17 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 6a c7
or byte [bp-004h], 040h ; 80 4e fc 40
movzx bx, byte [bp-004h] ; 0f b6 5e fc
jmp near 05097h ; e9 98 01
mov al, byte [bp-00eh] ; 8a 46 f2
and AL, strict byte 0bfh ; 24 bf
mov byte [bp-004h], al ; 88 46 fc
movzx bx, al ; 0f b6 d8
jmp near 05097h ; e9 8a 01
test byte [bp-00ch], 002h ; f6 46 f4 02
jne near 05217h ; 0f 85 02 03
mov al, byte [bp-008h] ; 8a 46 f8
and AL, strict byte 07fh ; 24 7f
cmp AL, strict byte 02ah ; 3c 2a
db 00fh, 094h, 0c0h
; sete al ; 0f 94 c0
movzx dx, al ; 0f b6 d0
inc dx ; 42
test byte [bp-008h], 080h ; f6 46 f8 80
je short 04f32h ; 74 09
mov al, dl ; 88 d0
not al ; f6 d0
and byte [bp-00ah], al ; 20 46 f6
jmp short 04f35h ; eb 03
or byte [bp-00ah], dl ; 08 56 f6
movzx bx, byte [bp-00ah] ; 0f b6 5e f6
mov dx, strict word 00017h ; ba 17 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 1c c7
jmp near 05217h ; e9 d2 02
test byte [bp-006h], 001h ; f6 46 fa 01
jne near 05217h ; 0f 85 ca 02
mov al, byte [bp-010h] ; 8a 46 f0
or AL, strict byte 004h ; 0c 04
mov byte [bp-00ah], al ; 88 46 f6
movzx bx, al ; 0f b6 d8
mov dx, strict word 00017h ; ba 17 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 fd c6
mov al, byte [bp-006h] ; 8a 46 fa
test AL, strict byte 002h ; a8 02
je short 04f75h ; 74 0d
or AL, strict byte 004h ; 0c 04
mov byte [bp-00ch], al ; 88 46 f4
movzx bx, al ; 0f b6 d8
mov dx, 00096h ; ba 96 00
jmp short 04f83h ; eb 0e
mov al, byte [bp-00eh] ; 8a 46 f2
or AL, strict byte 001h ; 0c 01
mov byte [bp-004h], al ; 88 46 fc
movzx bx, al ; 0f b6 d8
mov dx, strict word 00018h ; ba 18 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 d5 c6
jmp near 05217h ; e9 8b 02
test byte [bp-006h], 001h ; f6 46 fa 01
jne near 05217h ; 0f 85 83 02
mov al, byte [bp-010h] ; 8a 46 f0
and AL, strict byte 0fbh ; 24 fb
mov byte [bp-00ah], al ; 88 46 f6
movzx bx, al ; 0f b6 d8
mov dx, strict word 00017h ; ba 17 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 b6 c6
mov al, byte [bp-006h] ; 8a 46 fa
test AL, strict byte 002h ; a8 02
je short 04fbch ; 74 0d
and AL, strict byte 0fbh ; 24 fb
mov byte [bp-00ch], al ; 88 46 f4
movzx bx, al ; 0f b6 d8
mov dx, 00096h ; ba 96 00
jmp short 04fcah ; eb 0e
mov al, byte [bp-00eh] ; 8a 46 f2
and AL, strict byte 0feh ; 24 fe
mov byte [bp-004h], al ; 88 46 fc
movzx bx, al ; 0f b6 d8
mov dx, strict word 00018h ; ba 18 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 8e c6
jmp near 05217h ; e9 44 02
mov al, byte [bp-010h] ; 8a 46 f0
or AL, strict byte 008h ; 0c 08
mov byte [bp-00ah], al ; 88 46 f6
movzx bx, al ; 0f b6 d8
mov dx, strict word 00017h ; ba 17 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 77 c6
mov al, byte [bp-006h] ; 8a 46 fa
test AL, strict byte 002h ; a8 02
je short 04ffbh ; 74 0d
or AL, strict byte 008h ; 0c 08
mov byte [bp-00ch], al ; 88 46 f4
movzx bx, al ; 0f b6 d8
mov dx, 00096h ; ba 96 00
jmp short 05009h ; eb 0e
mov al, byte [bp-00eh] ; 8a 46 f2
or AL, strict byte 002h ; 0c 02
mov byte [bp-004h], al ; 88 46 fc
movzx bx, al ; 0f b6 d8
mov dx, strict word 00018h ; ba 18 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 4f c6
jmp near 05217h ; e9 05 02
mov al, byte [bp-010h] ; 8a 46 f0
and AL, strict byte 0f7h ; 24 f7
mov byte [bp-00ah], al ; 88 46 f6
movzx bx, al ; 0f b6 d8
mov dx, strict word 00017h ; ba 17 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 38 c6
mov al, byte [bp-006h] ; 8a 46 fa
test AL, strict byte 002h ; a8 02
je short 0503ah ; 74 0d
and AL, strict byte 0f7h ; 24 f7
mov byte [bp-00ch], al ; 88 46 f4
movzx bx, al ; 0f b6 d8
mov dx, 00096h ; ba 96 00
jmp short 05048h ; eb 0e
mov al, byte [bp-00eh] ; 8a 46 f2
and AL, strict byte 0fdh ; 24 fd
mov byte [bp-004h], al ; 88 46 fc
movzx bx, al ; 0f b6 d8
mov dx, strict word 00018h ; ba 18 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 10 c6
jmp near 05217h ; e9 c6 01
test byte [bp-006h], 003h ; f6 46 fa 03
jne near 05217h ; 0f 85 be 01
mov al, byte [bp-00eh] ; 8a 46 f2
or AL, strict byte 020h ; 0c 20
mov byte [bp-004h], al ; 88 46 fc
movzx bx, al ; 0f b6 d8
mov dx, strict word 00018h ; ba 18 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 f1 c5
mov al, byte [bp-010h] ; 8a 46 f0
xor AL, strict byte 020h ; 34 20
mov byte [bp-00ah], al ; 88 46 f6
movzx bx, al ; 0f b6 d8
mov dx, strict word 00017h ; ba 17 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 dd c5
jmp near 05217h ; e9 93 01
test byte [bp-006h], 003h ; f6 46 fa 03
jne near 05217h ; 0f 85 8b 01
mov al, byte [bp-00eh] ; 8a 46 f2
and AL, strict byte 0dfh ; 24 df
mov byte [bp-004h], al ; 88 46 fc
movzx bx, al ; 0f b6 d8
mov dx, strict word 00018h ; ba 18 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 be c5
jmp near 05217h ; e9 74 01
mov al, byte [bp-00eh] ; 8a 46 f2
or AL, strict byte 010h ; 0c 10
mov byte [bp-004h], al ; 88 46 fc
movzx bx, al ; 0f b6 d8
mov dx, strict word 00018h ; ba 18 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 a7 c5
mov al, byte [bp-010h] ; 8a 46 f0
xor AL, strict byte 010h ; 34 10
jmp short 05072h ; eb b4
mov al, byte [bp-00eh] ; 8a 46 f2
and AL, strict byte 0efh ; 24 ef
jmp short 05091h ; eb cc
mov al, byte [bp-010h] ; 8a 46 f0
and AL, strict byte 00ch ; 24 0c
cmp AL, strict byte 00ch ; 3c 0c
jne short 050dfh ; 75 11
mov bx, 01234h ; bb 34 12
mov dx, strict word 00072h ; ba 72 00
mov ax, strict word 00040h ; b8 40 00
call 0167ah ; e8 a0 c5
jmp far 0f000h:0e05bh ; ea 5b e0 00 f0
mov al, byte [bp-008h] ; 8a 46 f8
test AL, strict byte 080h ; a8 80
je short 0511dh ; 74 37
cmp AL, strict byte 0fah ; 3c fa
jne short 050fah ; 75 10
mov dx, 00097h ; ba 97 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 5d c5
mov dl, al ; 88 c2
or dl, 010h ; 80 ca 10
jmp short 0510eh ; eb 14
cmp AL, strict byte 0feh ; 3c fe
jne near 05217h ; 0f 85 17 01
mov dx, 00097h ; ba 97 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 47 c5
mov dl, al ; 88 c2
or dl, 020h ; 80 ca 20
movzx bx, dl ; 0f b6 da
mov dx, 00097h ; ba 97 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 44 c5
jmp near 05217h ; e9 fa 00
cmp byte [bp-008h], 058h ; 80 7e f8 58
jbe short 05141h ; 76 1e
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 03 c8
movzx ax, byte [bp-008h] ; 0f b6 46 f8
push ax ; 50
push 00581h ; 68 81 05
push strict byte 00004h ; 6a 04
call 01972h ; e8 37 c8
add sp, strict byte 00006h ; 83 c4 06
jmp near 05235h ; e9 f4 00
mov al, byte [bp-00ah] ; 8a 46 f6
test AL, strict byte 008h ; a8 08
je short 0515ah ; 74 12
movzx bx, byte [bp-008h] ; 0f b6 5e f8
imul bx, bx, strict byte 0000ah ; 6b db 0a
mov dl, byte [bx+00df6h] ; 8a 97 f6 0d
mov ax, word [bx+00df6h] ; 8b 87 f6 0d
jmp near 051e8h ; e9 8e 00
test AL, strict byte 004h ; a8 04
je short 05170h ; 74 12
movzx bx, byte [bp-008h] ; 0f b6 5e f8
imul bx, bx, strict byte 0000ah ; 6b db 0a
mov dl, byte [bx+00df4h] ; 8a 97 f4 0d
mov ax, word [bx+00df4h] ; 8b 87 f4 0d
jmp near 051e8h ; e9 78 00
mov al, byte [bp-00ch] ; 8a 46 f4
and AL, strict byte 002h ; 24 02
test al, al ; 84 c0
jbe short 0518eh ; 76 15
mov al, byte [bp-008h] ; 8a 46 f8
cmp AL, strict byte 047h ; 3c 47
jc short 0518eh ; 72 0e
cmp AL, strict byte 053h ; 3c 53
jnbe short 0518eh ; 77 0a
mov DL, strict byte 0e0h ; b2 e0
movzx bx, al ; 0f b6 d8
imul bx, bx, strict byte 0000ah ; 6b db 0a
jmp short 051e4h ; eb 56
test byte [bp-00ah], 003h ; f6 46 f6 03
je short 051c2h ; 74 2e
movzx bx, byte [bp-008h] ; 0f b6 5e f8
imul bx, bx, strict byte 0000ah ; 6b db 0a
movzx ax, byte [bx+00df8h] ; 0f b6 87 f8 0d
movzx dx, byte [bp-00ah] ; 0f b6 56 f6
test dx, ax ; 85 c2
je short 051b2h ; 74 0a
mov dl, byte [bx+00df0h] ; 8a 97 f0 0d
mov ax, word [bx+00df0h] ; 8b 87 f0 0d
jmp short 051bah ; eb 08
mov dl, byte [bx+00df2h] ; 8a 97 f2 0d
mov ax, word [bx+00df2h] ; 8b 87 f2 0d
shr ax, 008h ; c1 e8 08
mov byte [bp-008h], al ; 88 46 f8
jmp short 051eeh ; eb 2c
movzx bx, byte [bp-008h] ; 0f b6 5e f8
imul bx, bx, strict byte 0000ah ; 6b db 0a
movzx ax, byte [bx+00df8h] ; 0f b6 87 f8 0d
movzx dx, byte [bp-00ah] ; 0f b6 56 f6
test dx, ax ; 85 c2
je short 051e0h ; 74 0a
mov dl, byte [bx+00df2h] ; 8a 97 f2 0d
mov ax, word [bx+00df2h] ; 8b 87 f2 0d
jmp short 051e8h ; eb 08
mov dl, byte [bx+00df0h] ; 8a 97 f0 0d
mov ax, word [bx+00df0h] ; 8b 87 f0 0d
shr ax, 008h ; c1 e8 08
mov byte [bp-008h], al ; 88 46 f8
cmp byte [bp-008h], 000h ; 80 7e f8 00
jne short 0520eh ; 75 1a
test dl, dl ; 84 d2
jne short 0520eh ; 75 16
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 2e c7
push 005b8h ; 68 b8 05
push strict byte 00004h ; 6a 04
call 01972h ; e8 67 c7
add sp, strict byte 00004h ; 83 c4 04
xor dh, dh ; 30 f6
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 04de1h ; e8 ca fb
mov al, byte [bp-008h] ; 8a 46 f8
and AL, strict byte 07fh ; 24 7f
cmp AL, strict byte 01dh ; 3c 1d
je short 05224h ; 74 04
and byte [bp-00ch], 0feh ; 80 66 f4 fe
and byte [bp-00ch], 0fdh ; 80 66 f4 fd
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
mov dx, 00096h ; ba 96 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 29 c4
lea sp, [bp-002h] ; 8d 66 fe
pop di ; 5f
pop bp ; 5d
retn ; c3
dequeue_key_: ; 0xf523b LB 0x94
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov di, ax ; 89 c7
mov word [bp-006h], dx ; 89 56 fa
mov si, bx ; 89 de
mov word [bp-008h], cx ; 89 4e f8
mov dx, strict word 0001ah ; ba 1a 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 17 c4
mov bx, ax ; 89 c3
mov dx, strict word 0001ch ; ba 1c 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 0c c4
cmp bx, ax ; 39 c3
je short 052a1h ; 74 3d
mov dx, bx ; 89 da
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 e4 c3
mov cl, al ; 88 c1
lea dx, [bx+001h] ; 8d 57 01
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 d9 c3
mov es, [bp-008h] ; 8e 46 f8
mov byte [es:si], cl ; 26 88 0c
mov es, [bp-006h] ; 8e 46 fa
mov byte [es:di], al ; 26 88 05
cmp word [bp+004h], strict byte 00000h ; 83 7e 04 00
je short 0529ch ; 74 13
inc bx ; 43
inc bx ; 43
cmp bx, strict byte 0003eh ; 83 fb 3e
jc short 05293h ; 72 03
mov bx, strict word 0001eh ; bb 1e 00
mov dx, strict word 0001ah ; ba 1a 00
mov ax, strict word 00040h ; b8 40 00
call 0167ah ; e8 de c3
mov ax, strict word 00001h ; b8 01 00
jmp short 052a3h ; eb 02
xor ax, ax ; 31 c0
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00002h ; c2 02 00
mov byte [01292h], AL ; a2 92 12
adc word [bx+si], dx ; 11 10
or cl, byte [bx+di] ; 0a 09
add ax, 00102h ; 05 02 01
add byte [di+055h], ch ; 00 6d 55
adc word [bp+di-036h], strict byte 00053h ; 83 53 ca 53
push SS ; 16
push sp ; 54
db 026h, 054h
; es push sp ; 26 54
push ax ; 50
push sp ; 54
pop cx ; 59
push sp ; 54
retf 0fb54h ; ca 54 fb
push sp ; 54
sub byte [di+062h], dl ; 28 55 62
push bp ; 55
mov AL, strict byte 055h ; b0 55
_int16_function: ; 0xf52cf LB 0x2e7
push bp ; 55
mov bp, sp ; 89 e5
push di ; 57
sub sp, strict byte 00006h ; 83 ec 06
mov dx, strict word 00017h ; ba 17 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 71 c3
mov cl, al ; 88 c1
mov bh, al ; 88 c7
mov dx, 00097h ; ba 97 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 64 c3
mov bl, al ; 88 c3
movzx dx, cl ; 0f b6 d1
sar dx, 004h ; c1 fa 04
and dl, 007h ; 80 e2 07
and AL, strict byte 007h ; 24 07
xor ah, ah ; 30 e4
xor al, dl ; 30 d0
test ax, ax ; 85 c0
je short 05361h ; 74 60
cli ; fa
mov AL, strict byte 0edh ; b0 ed
mov dx, strict word 00060h ; ba 60 00
out DX, AL ; ee
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 0531ah ; 75 08
mov AL, strict byte 021h ; b0 21
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 05308h ; eb ee
mov dx, strict word 00060h ; ba 60 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp ax, 000fah ; 3d fa 00
jne short 05360h ; 75 3b
and bl, 0c8h ; 80 e3 c8
movzx ax, bh ; 0f b6 c7
sar ax, 004h ; c1 f8 04
and ax, strict word 00007h ; 25 07 00
movzx cx, bl ; 0f b6 cb
or cx, ax ; 09 c1
mov bl, cl ; 88 cb
mov al, cl ; 88 c8
and AL, strict byte 007h ; 24 07
out DX, AL ; ee
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 0534fh ; 75 08
mov AL, strict byte 021h ; b0 21
mov dx, 00080h ; ba 80 00
out DX, AL ; ee
jmp short 0533dh ; eb ee
mov dx, strict word 00060h ; ba 60 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor bh, bh ; 30 ff
mov dx, 00097h ; ba 97 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 fe c2
sti ; fb
mov ax, word [bp+012h] ; 8b 46 12
shr ax, 008h ; c1 e8 08
cmp ax, 000a2h ; 3d a2 00
jnbe near 0556dh ; 0f 87 ff 01
push CS ; 0e
pop ES ; 07
mov cx, strict word 0000ch ; b9 0c 00
mov di, 052ach ; bf ac 52
repne scasb ; f2 ae
sal cx, 1 ; d1 e1
mov di, cx ; 89 cf
mov ax, word [cs:di+052b7h] ; 2e 8b 85 b7 52
jmp ax ; ff e0
push strict byte 00001h ; 6a 01
mov cx, ss ; 8c d1
lea bx, [bp-008h] ; 8d 5e f8
mov dx, ss ; 8c d2
lea ax, [bp-006h] ; 8d 46 fa
call 0523bh ; e8 a9 fe
test ax, ax ; 85 c0
jne short 053a1h ; 75 0b
push 005efh ; 68 ef 05
push strict byte 00007h ; 6a 07
call 01972h ; e8 d4 c5
add sp, strict byte 00004h ; 83 c4 04
cmp byte [bp-006h], 000h ; 80 7e fa 00
je short 053adh ; 74 06
cmp byte [bp-008h], 0f0h ; 80 7e f8 f0
je short 053b3h ; 74 06
cmp byte [bp-008h], 0e0h ; 80 7e f8 e0
jne short 053b7h ; 75 04
mov byte [bp-008h], 000h ; c6 46 f8 00
movzx dx, byte [bp-006h] ; 0f b6 56 fa
sal dx, 008h ; c1 e2 08
movzx ax, byte [bp-008h] ; 0f b6 46 f8
or dx, ax ; 09 c2
mov word [bp+012h], dx ; 89 56 12
jmp near 055b0h ; e9 e6 01
or word [bp+01ch], 00200h ; 81 4e 1c 00 02
push strict byte 00000h ; 6a 00
mov cx, ss ; 8c d1
lea bx, [bp-008h] ; 8d 5e f8
mov dx, ss ; 8c d2
lea ax, [bp-006h] ; 8d 46 fa
call 0523bh ; e8 5d fe
test ax, ax ; 85 c0
jne short 053e9h ; 75 07
or word [bp+01ch], strict byte 00040h ; 83 4e 1c 40
jmp near 055b0h ; e9 c7 01
cmp byte [bp-006h], 000h ; 80 7e fa 00
je short 053f5h ; 74 06
cmp byte [bp-008h], 0f0h ; 80 7e f8 f0
je short 053fbh ; 74 06
cmp byte [bp-008h], 0e0h ; 80 7e f8 e0
jne short 053ffh ; 75 04
mov byte [bp-008h], 000h ; c6 46 f8 00
movzx dx, byte [bp-006h] ; 0f b6 56 fa
sal dx, 008h ; c1 e2 08
movzx ax, byte [bp-008h] ; 0f b6 46 f8
or dx, ax ; 09 c2
mov word [bp+012h], dx ; 89 56 12
and word [bp+01ch], strict byte 0ffbfh ; 83 66 1c bf
jmp near 055b0h ; e9 9a 01
mov dx, strict word 00017h ; ba 17 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 31 c2
mov dx, word [bp+012h] ; 8b 56 12
mov dl, al ; 88 c2
jmp short 053c4h ; eb 9e
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 04de1h ; e8 aa f9
test ax, ax ; 85 c0
jne short 05448h ; 75 0d
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 001h ; 0c 01
mov word [bp+012h], ax ; 89 46 12
jmp near 055b0h ; e9 68 01
and word [bp+012h], 0ff00h ; 81 66 12 00 ff
jmp near 055b0h ; e9 60 01
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 030h ; 0c 30
jmp short 05442h ; eb e9
mov byte [bp-004h], 002h ; c6 46 fc 02
xor cx, cx ; 31 c9
cli ; fa
mov AL, strict byte 0f2h ; b0 f2
mov dx, strict word 00060h ; ba 60 00
out DX, AL ; ee
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 05480h ; 75 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 05480h ; 76 08
mov dx, 00080h ; ba 80 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
jmp short 05469h ; eb e9
test bx, bx ; 85 db
jbe short 054c4h ; 76 40
mov dx, strict word 00060h ; ba 60 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp ax, 000fah ; 3d fa 00
jne short 054c4h ; 75 35
mov bx, strict word 0ffffh ; bb ff ff
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 054a9h ; 75 0d
dec bx ; 4b
test bx, bx ; 85 db
jbe short 054a9h ; 76 08
mov dx, 00080h ; ba 80 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
jmp short 05492h ; eb e9
test bx, bx ; 85 db
jbe short 054bbh ; 76 0e
shr cx, 008h ; c1 e9 08
mov dx, strict word 00060h ; ba 60 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
sal ax, 008h ; c1 e0 08
or cx, ax ; 09 c1
dec byte [bp-004h] ; fe 4e fc
cmp byte [bp-004h], 000h ; 80 7e fc 00
jnbe short 0548fh ; 77 cb
mov word [bp+00ch], cx ; 89 4e 0c
jmp near 055b0h ; e9 e6 00
push strict byte 00001h ; 6a 01
mov cx, ss ; 8c d1
lea bx, [bp-008h] ; 8d 5e f8
mov dx, ss ; 8c d2
lea ax, [bp-006h] ; 8d 46 fa
call 0523bh ; e8 62 fd
test ax, ax ; 85 c0
jne short 054e8h ; 75 0b
push 005efh ; 68 ef 05
push strict byte 00007h ; 6a 07
call 01972h ; e8 8d c4
add sp, strict byte 00004h ; 83 c4 04
cmp byte [bp-006h], 000h ; 80 7e fa 00
je near 053b7h ; 0f 84 c7 fe
cmp byte [bp-008h], 0f0h ; 80 7e f8 f0
je near 053b3h ; 0f 84 bb fe
jmp near 053b7h ; e9 bc fe
or word [bp+01ch], 00200h ; 81 4e 1c 00 02
push strict byte 00000h ; 6a 00
mov cx, ss ; 8c d1
lea bx, [bp-008h] ; 8d 5e f8
mov dx, ss ; 8c d2
lea ax, [bp-006h] ; 8d 46 fa
call 0523bh ; e8 2c fd
test ax, ax ; 85 c0
je near 053e2h ; 0f 84 cd fe
cmp byte [bp-006h], 000h ; 80 7e fa 00
je near 053ffh ; 0f 84 e2 fe
cmp byte [bp-008h], 0f0h ; 80 7e f8 f0
je near 053fbh ; 0f 84 d6 fe
jmp near 053ffh ; e9 d7 fe
mov dx, strict word 00017h ; ba 17 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 1f c1
mov dx, word [bp+012h] ; 8b 56 12
mov dl, al ; 88 c2
mov word [bp+012h], dx ; 89 56 12
mov dx, strict word 00018h ; ba 18 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 0e c1
mov bh, al ; 88 c7
and bh, 073h ; 80 e7 73
mov dx, 00096h ; ba 96 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 00 c1
and AL, strict byte 00ch ; 24 0c
or bh, al ; 08 c7
mov dx, word [bp+012h] ; 8b 56 12
xor dh, dh ; 30 f6
movzx ax, bh ; 0f b6 c7
sal ax, 008h ; c1 e0 08
jmp near 053c2h ; e9 60 fe
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
or ah, 080h ; 80 cc 80
jmp near 05442h ; e9 d5 fe
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 b9 c3
mov ax, word [bp+012h] ; 8b 46 12
shr ax, 008h ; c1 e8 08
push ax ; 50
push 00613h ; 68 13 06
push strict byte 00004h ; 6a 04
call 01972h ; e8 eb c3
add sp, strict byte 00006h ; 83 c4 06
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 9c c3
mov ax, word [bp+00eh] ; 8b 46 0e
push ax ; 50
mov ax, word [bp+010h] ; 8b 46 10
push ax ; 50
mov ax, word [bp+00ch] ; 8b 46 0c
push ax ; 50
mov ax, word [bp+012h] ; 8b 46 12
push ax ; 50
push 0063bh ; 68 3b 06
push strict byte 00004h ; 6a 04
call 01972h ; e8 c5 c3
add sp, strict byte 0000ch ; 83 c4 0c
lea sp, [bp-002h] ; 8d 66 fe
pop di ; 5f
pop bp ; 5d
retn ; c3
set_geom_lba_: ; 0xf55b6 LB 0x9e
push si ; 56
push di ; 57
enter 00004h, 000h ; c8 04 00 00
mov si, ax ; 89 c6
mov es, dx ; 8e c2
mov word [bp-004h], bx ; 89 5e fc
mov word [bp-002h], cx ; 89 4e fe
xor ax, ax ; 31 c0
mov dx, strict word 0007eh ; ba 7e 00
mov di, 000ffh ; bf ff 00
xor bx, bx ; 31 db
jmp short 055d7h ; eb 05
cmp bx, strict byte 00004h ; 83 fb 04
jnl short 055edh ; 7d 16
cmp dx, word [bp-002h] ; 3b 56 fe
jnbe short 055e3h ; 77 07
jne short 055e6h ; 75 08
cmp ax, word [bp-004h] ; 3b 46 fc
jc short 055e6h ; 72 03
inc di ; 47
shr di, 1 ; d1 ef
shr dx, 1 ; d1 ea
rcr ax, 1 ; d1 d8
inc bx ; 43
jmp short 055d2h ; eb e5
mov ax, di ; 89 f8
xor dx, dx ; 31 d2
mov bx, strict word 0003fh ; bb 3f 00
xor cx, cx ; 31 c9
call 09779h ; e8 80 41
mov bx, ax ; 89 c3
mov cx, dx ; 89 d1
mov ax, word [bp-004h] ; 8b 46 fc
mov dx, word [bp-002h] ; 8b 56 fe
call 09740h ; e8 3a 41
mov word [es:si+002h], ax ; 26 89 44 02
cmp ax, 00400h ; 3d 00 04
jbe short 05615h ; 76 06
mov word [es:si+002h], 00400h ; 26 c7 44 02 00 04
mov word [es:si], di ; 26 89 3c
mov word [es:si+004h], strict word 0003fh ; 26 c7 44 04 3f 00
leave ; c9
pop di ; 5f
pop si ; 5e
retn ; c3
ficom word [bp+004h] ; de 56 04
push di ; 57
xor word [bx+031h], dx ; 31 57 31
push di ; 57
xor word [bx+009h], dx ; 31 57 09
pop cx ; 59
aaa ; 37
pop dx ; 5a
aaa ; 37
pop dx ; 5a
and bl, byte [bx+di+014h] ; 22 59 14
pop dx ; 5a
aaa ; 37
pop dx ; 5a
aaa ; 37
pop dx ; 5a
adc AL, strict byte 05ah ; 14 5a
adc AL, strict byte 05ah ; 14 5a
aaa ; 37
pop dx ; 5a
aaa ; 37
pop dx ; 5a
cbw ; 98
pop cx ; 59
adc AL, strict byte 05ah ; 14 5a
aaa ; 37
pop dx ; 5a
aaa ; 37
pop dx ; 5a
adc AL, strict byte 05ah ; 14 5a
enter 03759h, 05ah ; c8 59 37 5a
aaa ; 37
pop dx ; 5a
aaa ; 37
pop dx ; 5a
_int13_harddisk: ; 0xf5654 LB 0x441
push bp ; 55
mov bp, sp ; 89 e5
sub sp, strict byte 00010h ; 83 ec 10
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 09 c0
mov si, 00122h ; be 22 01
mov word [bp-004h], ax ; 89 46 fc
xor bx, bx ; 31 db
mov dx, 0008eh ; ba 8e 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 ea bf
mov ax, word [bp+00eh] ; 8b 46 0e
xor ah, ah ; 30 e4
cmp ax, 00080h ; 3d 80 00
jc short 05683h ; 72 05
cmp ax, 00090h ; 3d 90 00
jc short 056a1h ; 72 1e
mov ax, word [bp+00eh] ; 8b 46 0e
xor ah, ah ; 30 e4
push ax ; 50
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 0065eh ; 68 5e 06
push 0066dh ; 68 6d 06
push strict byte 00004h ; 6a 04
call 01972h ; e8 d7 c2
add sp, strict byte 0000ah ; 83 c4 0a
jmp near 05a52h ; e9 b1 03
mov ax, word [bp+00eh] ; 8b 46 0e
xor ah, ah ; 30 e4
mov es, [bp-004h] ; 8e 46 fc
mov bx, si ; 89 f3
add bx, ax ; 01 c3
mov dl, byte [es:bx+0011fh] ; 26 8a 97 1f 01
mov byte [bp-002h], dl ; 88 56 fe
cmp dl, 010h ; 80 fa 10
jc short 056cah ; 72 10
push ax ; 50
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 0065eh ; 68 5e 06
push 00698h ; 68 98 06
jmp short 05696h ; eb cc
mov bx, word [bp+016h] ; 8b 5e 16
shr bx, 008h ; c1 eb 08
cmp bx, strict byte 00018h ; 83 fb 18
jnbe near 05a37h ; 0f 87 60 03
add bx, bx ; 01 db
jmp word [cs:bx+05622h] ; 2e ff a7 22 56
cmp byte [bp-002h], 008h ; 80 7e fe 08
jnc near 056edh ; 0f 83 07 00
movzx ax, byte [bp-002h] ; 0f b6 46 fe
call 01c71h ; e8 84 c5
mov byte [bp+017h], 000h ; c6 46 17 00
xor bx, bx ; 31 db
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 62 bf
and byte [bp+01ch], 0feh ; 80 66 1c fe
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 43 bf
mov cl, al ; 88 c1
mov dx, word [bp+016h] ; 8b 56 16
xor dh, dh ; 30 f6
movzx ax, cl ; 0f b6 c1
sal ax, 008h ; c1 e0 08
or dx, ax ; 09 c2
mov word [bp+016h], dx ; 89 56 16
xor bx, bx ; 31 db
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 34 bf
test cl, cl ; 84 c9
je short 056f1h ; 74 c3
jmp near 05a6eh ; e9 3d 03
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
mov word [bp-00ch], ax ; 89 46 f4
mov di, word [bp+014h] ; 8b 7e 14
shr di, 008h ; c1 ef 08
mov ax, word [bp+014h] ; 8b 46 14
xor ah, ah ; 30 e4
sal ax, 002h ; c1 e0 02
xor al, al ; 30 c0
and ah, 003h ; 80 e4 03
or di, ax ; 09 c7
mov ax, word [bp+014h] ; 8b 46 14
and ax, strict word 0003fh ; 25 3f 00
mov word [bp-006h], ax ; 89 46 fa
mov ax, word [bp+012h] ; 8b 46 12
shr ax, 008h ; c1 e8 08
mov word [bp-008h], ax ; 89 46 f8
mov ax, word [bp-00ch] ; 8b 46 f4
cmp ax, 00080h ; 3d 80 00
jnbe short 0576ch ; 77 04
test ax, ax ; 85 c0
jne short 0578fh ; 75 23
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 ba c1
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 0065eh ; 68 5e 06
push 006cah ; 68 ca 06
push strict byte 00004h ; 6a 04
call 01972h ; e8 e9 c1
add sp, strict byte 00008h ; 83 c4 08
jmp near 05a52h ; e9 c3 02
movzx ax, byte [bp-002h] ; 0f b6 46 fe
imul ax, ax, strict byte 00018h ; 6b c0 18
mov es, [bp-004h] ; 8e 46 fc
mov bx, si ; 89 f3
add bx, ax ; 01 c3
mov ax, word [es:bx+028h] ; 26 8b 47 28
mov cx, word [es:bx+026h] ; 26 8b 4f 26
mov dx, word [es:bx+02ah] ; 26 8b 57 2a
mov word [bp-00ah], dx ; 89 56 f6
cmp di, ax ; 39 c7
jnc short 057bch ; 73 0c
cmp cx, word [bp-008h] ; 3b 4e f8
jbe short 057bch ; 76 07
mov ax, word [bp-006h] ; 8b 46 fa
cmp ax, dx ; 39 d0
jbe short 057eah ; 76 2e
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 6a c1
push dword [bp-008h] ; 66 ff 76 f8
push di ; 57
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
push ax ; 50
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 0065eh ; 68 5e 06
push 006f2h ; 68 f2 06
push strict byte 00004h ; 6a 04
call 01972h ; e8 8e c1
add sp, strict byte 00010h ; 83 c4 10
jmp near 05a52h ; e9 68 02
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
cmp ax, strict word 00004h ; 3d 04 00
jne short 057f8h ; 75 03
jmp near 056edh ; e9 f5 fe
movzx bx, byte [bp-002h] ; 0f b6 5e fe
imul bx, bx, strict byte 00018h ; 6b db 18
mov es, [bp-004h] ; 8e 46 fc
add bx, si ; 01 f3
cmp cx, word [es:bx+02ch] ; 26 3b 4f 2c
jne short 05819h ; 75 0f
mov ax, word [es:bx+030h] ; 26 8b 47 30
cmp ax, word [bp-00ah] ; 3b 46 f6
jne short 05819h ; 75 06
cmp byte [bp-002h], 008h ; 80 7e fe 08
jc short 05849h ; 72 30
mov ax, di ; 89 f8
xor dx, dx ; 31 d2
mov bx, cx ; 89 cb
xor cx, cx ; 31 c9
call 09779h ; e8 55 3f
xor bx, bx ; 31 db
add ax, word [bp-008h] ; 03 46 f8
adc dx, bx ; 11 da
mov bx, word [bp-00ah] ; 8b 5e f6
xor cx, cx ; 31 c9
call 09779h ; e8 46 3f
xor bx, bx ; 31 db
add ax, word [bp-006h] ; 03 46 fa
adc dx, bx ; 11 da
add ax, strict word 0ffffh ; 05 ff ff
mov word [bp-010h], ax ; 89 46 f0
adc dx, strict byte 0ffffh ; 83 d2 ff
mov word [bp-00eh], dx ; 89 56 f2
mov word [bp-006h], bx ; 89 5e fa
mov es, [bp-004h] ; 8e 46 fc
db 066h, 026h, 0c7h, 044h, 014h, 000h, 000h, 000h, 000h
; mov dword [es:si+014h], strict dword 000000000h ; 66 26 c7 44 14 00 00 00 00
mov word [es:si+018h], strict word 00000h ; 26 c7 44 18 00 00
mov ax, word [bp-010h] ; 8b 46 f0
mov word [es:si], ax ; 26 89 04
mov ax, word [bp-00eh] ; 8b 46 f2
mov word [es:si+002h], ax ; 26 89 44 02
mov ax, word [bp+010h] ; 8b 46 10
mov dx, word [bp+006h] ; 8b 56 06
mov word [es:si+004h], ax ; 26 89 44 04
mov word [es:si+006h], dx ; 26 89 54 06
mov ax, word [bp-00ch] ; 8b 46 f4
mov word [es:si+00ah], ax ; 26 89 44 0a
mov word [es:si+00ch], 00200h ; 26 c7 44 0c 00 02
mov word [es:si+00eh], di ; 26 89 7c 0e
mov ax, word [bp-008h] ; 8b 46 f8
mov word [es:si+010h], ax ; 26 89 44 10
mov ax, word [bp-006h] ; 8b 46 fa
mov word [es:si+012h], ax ; 26 89 44 12
mov al, byte [bp-002h] ; 8a 46 fe
mov byte [es:si+008h], al ; 26 88 44 08
movzx ax, byte [bp-002h] ; 0f b6 46 fe
imul ax, ax, strict byte 00018h ; 6b c0 18
mov bx, si ; 89 f3
add bx, ax ; 01 c3
movzx ax, byte [es:bx+01eh] ; 26 0f b6 47 1e
mov bx, ax ; 89 c3
sal bx, 002h ; c1 e3 02
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
add ax, ax ; 01 c0
add bx, ax ; 01 c3
push ES ; 06
push si ; 56
call word [word bx+0007eh] ; ff 97 7e 00
mov dx, ax ; 89 c2
mov ax, word [bp+016h] ; 8b 46 16
xor al, al ; 30 c0
mov es, [bp-004h] ; 8e 46 fc
mov bx, word [es:si+014h] ; 26 8b 5c 14
or bx, ax ; 09 c3
mov word [bp+016h], bx ; 89 5e 16
test dl, dl ; 84 d2
je near 056edh ; 0f 84 13 fe
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 4c c0
movzx ax, dl ; 0f b6 c2
push ax ; 50
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 0065eh ; 68 5e 06
push 00739h ; 68 39 07
push strict byte 00004h ; 6a 04
call 01972h ; e8 77 c0
add sp, strict byte 0000ah ; 83 c4 0a
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 00ch ; 80 cc 0c
jmp near 05a5ah ; e9 51 01
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 1d c0
push 0075ah ; 68 5a 07
push strict byte 00004h ; 6a 04
call 01972h ; e8 56 c0
add sp, strict byte 00004h ; 83 c4 04
jmp near 056edh ; e9 cb fd
movzx ax, byte [bp-002h] ; 0f b6 46 fe
imul ax, ax, strict byte 00018h ; 6b c0 18
mov es, [bp-004h] ; 8e 46 fc
mov bx, si ; 89 f3
add bx, ax ; 01 c3
mov di, word [es:bx+028h] ; 26 8b 7f 28
mov cx, word [es:bx+026h] ; 26 8b 4f 26
mov ax, word [es:bx+02ah] ; 26 8b 47 2a
mov word [bp-00ah], ax ; 89 46 f6
movzx ax, byte [es:si+0019eh] ; 26 0f b6 84 9e 01
mov word [bp-00ch], ax ; 89 46 f4
mov byte [bp+016h], 000h ; c6 46 16 00
mov dx, word [bp+014h] ; 8b 56 14
xor dh, dh ; 30 f6
dec di ; 4f
mov ax, di ; 89 f8
xor ah, ah ; 30 e4
sal ax, 008h ; c1 e0 08
or dx, ax ; 09 c2
mov word [bp+014h], dx ; 89 56 14
shr di, 002h ; c1 ef 02
and di, 000c0h ; 81 e7 c0 00
mov ax, word [bp-00ah] ; 8b 46 f6
xor ah, ah ; 30 e4
and AL, strict byte 03fh ; 24 3f
or di, ax ; 09 c7
mov ax, dx ; 89 d0
xor al, dl ; 30 d0
or ax, di ; 09 f8
mov word [bp+014h], ax ; 89 46 14
mov dx, word [bp+012h] ; 8b 56 12
xor dh, dh ; 30 f6
mov ax, cx ; 89 c8
sal ax, 008h ; c1 e0 08
sub ax, 00100h ; 2d 00 01
or dx, ax ; 09 c2
mov word [bp+012h], dx ; 89 56 12
mov ax, dx ; 89 d0
xor al, dl ; 30 d0
mov dx, word [bp-00ch] ; 8b 56 f4
or dx, ax ; 09 c2
mov word [bp+012h], dx ; 89 56 12
jmp near 056edh ; e9 55 fd
movzx ax, byte [bp-002h] ; 0f b6 46 fe
cwd ; 99
db 02bh, 0c2h
; sub ax, dx ; 2b c2
sar ax, 1 ; d1 f8
imul ax, ax, strict byte 00006h ; 6b c0 06
mov es, [bp-004h] ; 8e 46 fc
add si, ax ; 01 c6
mov dx, word [es:si+001c2h] ; 26 8b 94 c2 01
add dx, strict byte 00007h ; 83 c2 07
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and AL, strict byte 0c0h ; 24 c0
cmp AL, strict byte 040h ; 3c 40
jne short 059bdh ; 75 03
jmp near 056edh ; e9 30 fd
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 0aah ; 80 cc aa
jmp near 05a5ah ; e9 92 00
movzx ax, byte [bp-002h] ; 0f b6 46 fe
imul ax, ax, strict byte 00018h ; 6b c0 18
mov es, [bp-004h] ; 8e 46 fc
add si, ax ; 01 c6
mov di, word [es:si+02eh] ; 26 8b 7c 2e
mov ax, word [es:si+02ch] ; 26 8b 44 2c
mov word [bp-008h], ax ; 89 46 f8
mov ax, word [es:si+030h] ; 26 8b 44 30
mov word [bp-006h], ax ; 89 46 fa
mov ax, di ; 89 f8
xor dx, dx ; 31 d2
mov bx, word [bp-008h] ; 8b 5e f8
xor cx, cx ; 31 c9
call 09779h ; e8 87 3d
mov bx, word [bp-006h] ; 8b 5e fa
xor cx, cx ; 31 c9
call 09779h ; e8 7f 3d
mov word [bp-010h], ax ; 89 46 f0
mov word [bp-00eh], dx ; 89 56 f2
mov word [bp+014h], dx ; 89 56 14
mov word [bp+012h], ax ; 89 46 12
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 003h ; 80 cc 03
mov word [bp+016h], ax ; 89 46 16
jmp near 056f1h ; e9 dd fc
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 12 bf
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 0065eh ; 68 5e 06
push 00774h ; 68 74 07
push strict byte 00004h ; 6a 04
call 01972h ; e8 41 bf
add sp, strict byte 00008h ; 83 c4 08
jmp near 056edh ; e9 b6 fc
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 ef be
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 0065eh ; 68 5e 06
push 007a7h ; 68 a7 07
jmp near 05784h ; e9 32 fd
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 001h ; 80 cc 01
mov word [bp+016h], ax ; 89 46 16
mov bx, word [bp+016h] ; 8b 5e 16
shr bx, 008h ; c1 eb 08
xor bh, bh ; 30 ff
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 f0 bb
or byte [bp+01ch], 001h ; 80 4e 1c 01
jmp near 05700h ; e9 8b fc
xor byte [bp+di+048h], bl ; 30 5b 48
pop bx ; 5b
dec ax ; 48
pop bx ; 5b
dec ax ; 48
pop bx ; 5b
neg word [bp-075h] ; f7 5e 8b
pop sp ; 5c
dec ax ; 48
pop bx ; 5b
xchg cx, ax ; 91
pop sp ; 5c
neg word [bp+046h] ; f7 5e 46
pop di ; 5f
inc si ; 46
pop di ; 5f
inc si ; 46
pop di ; 5f
inc si ; 46
pop di ; 5f
push CS ; 0e
pop di ; 5f
inc si ; 46
pop di ; 5f
inc si ; 46
pop di ; 5f
_int13_harddisk_ext: ; 0xf5a95 LB 0x4cc
push bp ; 55
mov bp, sp ; 89 e5
sub sp, strict byte 00028h ; 83 ec 28
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 c8 bb
mov word [bp-014h], ax ; 89 46 ec
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 bc bb
mov si, 00122h ; be 22 01
mov word [bp-026h], ax ; 89 46 da
xor bx, bx ; 31 db
mov dx, 0008eh ; ba 8e 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 9d bb
mov ax, word [bp+00eh] ; 8b 46 0e
xor ah, ah ; 30 e4
cmp ax, 00080h ; 3d 80 00
jc short 05ad0h ; 72 05
cmp ax, 00090h ; 3d 90 00
jc short 05aeeh ; 72 1e
mov ax, word [bp+00eh] ; 8b 46 0e
xor ah, ah ; 30 e4
push ax ; 50
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 007d5h ; 68 d5 07
push 0066dh ; 68 6d 06
push strict byte 00004h ; 6a 04
call 01972h ; e8 8a be
add sp, strict byte 0000ah ; 83 c4 0a
jmp near 05f24h ; e9 36 04
mov ax, word [bp+00eh] ; 8b 46 0e
xor ah, ah ; 30 e4
mov es, [bp-026h] ; 8e 46 da
mov bx, si ; 89 f3
add bx, ax ; 01 c3
mov cl, byte [es:bx+0011fh] ; 26 8a 8f 1f 01
cmp cl, 010h ; 80 f9 10
jc short 05b14h ; 72 10
push ax ; 50
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 007d5h ; 68 d5 07
push 00698h ; 68 98 06
jmp short 05ae3h ; eb cf
mov bx, word [bp+016h] ; 8b 5e 16
shr bx, 008h ; c1 eb 08
sub bx, strict byte 00041h ; 83 eb 41
cmp bx, strict byte 0000fh ; 83 fb 0f
jnbe near 05f46h ; 0f 87 22 04
add bx, bx ; 01 db
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
jmp word [cs:bx+05a75h] ; 2e ff a7 75 5a
mov word [bp+010h], 0aa55h ; c7 46 10 55 aa
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 030h ; 80 cc 30
mov word [bp+016h], ax ; 89 46 16
mov word [bp+014h], strict word 00007h ; c7 46 14 07 00
jmp near 05efbh ; e9 b3 03
mov bx, word [bp+00ah] ; 8b 5e 0a
mov es, [bp+004h] ; 8e 46 04
mov di, bx ; 89 df
mov [bp-010h], es ; 8c 46 f0
mov ax, word [es:bx+002h] ; 26 8b 47 02
mov word [bp-012h], ax ; 89 46 ee
mov ax, word [es:bx+006h] ; 26 8b 47 06
mov word [bp-018h], ax ; 89 46 e8
mov ax, word [es:bx+004h] ; 26 8b 47 04
mov word [bp-016h], ax ; 89 46 ea
mov ax, word [es:bx+00ch] ; 26 8b 47 0c
mov word [bp-00ah], ax ; 89 46 f6
mov ax, word [es:bx+00eh] ; 26 8b 47 0e
or ax, word [bp-00ah] ; 0b 46 f6
je short 05b89h ; 74 11
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 007d5h ; 68 d5 07
push 007e8h ; 68 e8 07
push strict byte 00007h ; 6a 07
jmp short 05bd3h ; eb 4a
mov es, [bp-010h] ; 8e 46 f0
mov ax, word [es:di+008h] ; 26 8b 45 08
mov word [bp-00ah], ax ; 89 46 f6
mov ax, word [es:di+00ah] ; 26 8b 45 0a
movzx dx, cl ; 0f b6 d1
imul dx, dx, strict byte 00018h ; 6b d2 18
mov es, [bp-026h] ; 8e 46 da
mov bx, si ; 89 f3
add bx, dx ; 01 d3
mov ch, byte [es:bx+01eh] ; 26 8a 6f 1e
cmp ax, word [es:bx+034h] ; 26 3b 47 34
jnbe short 05bb9h ; 77 0b
jne short 05bdch ; 75 2c
mov dx, word [bp-00ah] ; 8b 56 f6
cmp dx, word [es:bx+032h] ; 26 3b 57 32
jc short 05bdch ; 72 23
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 6d bd
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 007d5h ; 68 d5 07
push 00811h ; 68 11 08
push strict byte 00004h ; 6a 04
call 01972h ; e8 9c bd
add sp, strict byte 00008h ; 83 c4 08
jmp near 05f24h ; e9 48 03
mov dx, word [bp+016h] ; 8b 56 16
shr dx, 008h ; c1 ea 08
mov word [bp-00ch], dx ; 89 56 f4
cmp dx, strict byte 00044h ; 83 fa 44
je near 05ef7h ; 0f 84 0b 03
cmp dx, strict byte 00047h ; 83 fa 47
je near 05ef7h ; 0f 84 04 03
mov es, [bp-026h] ; 8e 46 da
db 066h, 026h, 0c7h, 044h, 014h, 000h, 000h, 000h, 000h
; mov dword [es:si+014h], strict dword 000000000h ; 66 26 c7 44 14 00 00 00 00
mov word [es:si+018h], strict word 00000h ; 26 c7 44 18 00 00
mov dx, word [bp-00ah] ; 8b 56 f6
mov word [es:si], dx ; 26 89 14
mov word [es:si+002h], ax ; 26 89 44 02
mov ax, word [bp-016h] ; 8b 46 ea
mov word [es:si+004h], ax ; 26 89 44 04
mov ax, word [bp-018h] ; 8b 46 e8
mov word [es:si+006h], ax ; 26 89 44 06
mov ax, word [bp-012h] ; 8b 46 ee
mov word [es:si+00ah], ax ; 26 89 44 0a
mov word [es:si+00ch], 00200h ; 26 c7 44 0c 00 02
mov word [es:si+012h], strict word 00000h ; 26 c7 44 12 00 00
mov byte [es:si+008h], cl ; 26 88 4c 08
mov bx, word [bp-00ch] ; 8b 5e f4
add bx, bx ; 01 db
movzx ax, ch ; 0f b6 c5
sal ax, 002h ; c1 e0 02
add bx, ax ; 01 c3
push ES ; 06
push si ; 56
call word [word bx-00002h] ; ff 97 fe ff
mov dx, ax ; 89 c2
mov es, [bp-026h] ; 8e 46 da
mov ax, word [es:si+014h] ; 26 8b 44 14
mov word [bp-012h], ax ; 89 46 ee
mov es, [bp-010h] ; 8e 46 f0
mov word [es:di+002h], ax ; 26 89 45 02
test dl, dl ; 84 d2
je near 05ef7h ; 0f 84 97 02
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 c6 bc
movzx ax, dl ; 0f b6 c2
push ax ; 50
push word [bp-00ch] ; ff 76 f4
push 007d5h ; 68 d5 07
push 00739h ; 68 39 07
push strict byte 00004h ; 6a 04
call 01972h ; e8 f5 bc
add sp, strict byte 0000ah ; 83 c4 0a
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 00ch ; 80 cc 0c
jmp near 05f2ch ; e9 a1 02
or ah, 0b2h ; 80 cc b2
jmp near 05f2ch ; e9 9b 02
mov bx, word [bp+00ah] ; 8b 5e 0a
mov ax, word [bp+004h] ; 8b 46 04
mov word [bp-006h], ax ; 89 46 fa
mov word [bp-004h], ax ; 89 46 fc
mov es, ax ; 8e c0
mov di, bx ; 89 df
mov ax, word [es:di] ; 26 8b 05
mov word [bp-00eh], ax ; 89 46 f2
cmp ax, strict word 0001ah ; 3d 1a 00
jc near 05f24h ; 0f 82 76 02
jc near 05d35h ; 0f 82 83 00
movzx ax, cl ; 0f b6 c1
imul ax, ax, strict byte 00018h ; 6b c0 18
mov es, [bp-026h] ; 8e 46 da
mov di, si ; 89 f7
add di, ax ; 01 c7
mov ax, word [es:di+02eh] ; 26 8b 45 2e
mov word [bp-028h], ax ; 89 46 d8
mov ax, word [es:di+02ch] ; 26 8b 45 2c
mov word [bp-01eh], ax ; 89 46 e2
mov ax, word [es:di+030h] ; 26 8b 45 30
mov word [bp-024h], ax ; 89 46 dc
mov ax, word [es:di+032h] ; 26 8b 45 32
mov word [bp-00ah], ax ; 89 46 f6
mov ax, word [es:di+034h] ; 26 8b 45 34
mov dx, word [es:di+024h] ; 26 8b 55 24
mov word [bp-022h], dx ; 89 56 de
mov es, [bp-006h] ; 8e 46 fa
mov di, bx ; 89 df
db 066h, 026h, 0c7h, 005h, 01ah, 000h, 002h, 000h
; mov dword [es:di], strict dword 00002001ah ; 66 26 c7 05 1a 00 02 00
mov dx, word [bp-028h] ; 8b 56 d8
mov word [es:di+004h], dx ; 26 89 55 04
mov word [es:di+006h], strict word 00000h ; 26 c7 45 06 00 00
mov dx, word [bp-01eh] ; 8b 56 e2
mov word [es:di+008h], dx ; 26 89 55 08
mov word [es:di+00ah], strict word 00000h ; 26 c7 45 0a 00 00
mov dx, word [bp-024h] ; 8b 56 dc
mov word [es:di+00ch], dx ; 26 89 55 0c
mov word [es:di+00eh], strict word 00000h ; 26 c7 45 0e 00 00
mov dx, word [bp-022h] ; 8b 56 de
mov word [es:di+018h], dx ; 26 89 55 18
mov dx, word [bp-00ah] ; 8b 56 f6
mov word [es:di+010h], dx ; 26 89 55 10
mov word [es:di+012h], ax ; 26 89 45 12
db 066h, 026h, 0c7h, 045h, 014h, 000h, 000h, 000h, 000h
; mov dword [es:di+014h], strict dword 000000000h ; 66 26 c7 45 14 00 00 00 00
cmp word [bp-00eh], strict byte 0001eh ; 83 7e f2 1e
jc near 05e41h ; 0f 82 04 01
mov es, [bp-004h] ; 8e 46 fc
mov word [es:bx], strict word 0001eh ; 26 c7 07 1e 00
mov ax, word [bp-014h] ; 8b 46 ec
mov word [es:bx+01ch], ax ; 26 89 47 1c
mov word [es:bx+01ah], 00312h ; 26 c7 47 1a 12 03
movzx ax, cl ; 0f b6 c1
mov word [bp-020h], ax ; 89 46 e0
cwd ; 99
db 02bh, 0c2h
; sub ax, dx ; 2b c2
sar ax, 1 ; d1 f8
movzx di, al ; 0f b6 f8
imul di, di, strict byte 00006h ; 6b ff 06
mov es, [bp-026h] ; 8e 46 da
add di, si ; 01 f7
mov ax, word [es:di+001c2h] ; 26 8b 85 c2 01
mov word [bp-01ah], ax ; 89 46 e6
mov ax, word [es:di+001c4h] ; 26 8b 85 c4 01
mov word [bp-01ch], ax ; 89 46 e4
mov ch, byte [es:di+001c1h] ; 26 8a ad c1 01
imul di, word [bp-020h], strict byte 00018h ; 6b 7e e0 18
add di, si ; 01 f7
mov ah, byte [es:di+022h] ; 26 8a 65 22
mov al, byte [es:di+023h] ; 26 8a 45 23
test al, al ; 84 c0
jne short 05d93h ; 75 04
xor dx, dx ; 31 d2
jmp short 05d96h ; eb 03
mov dx, strict word 00008h ; ba 08 00
or dl, 010h ; 80 ca 10
mov word [bp-008h], dx ; 89 56 f8
cmp ah, 001h ; 80 fc 01
db 00fh, 094h, 0c4h
; sete ah ; 0f 94 c4
movzx dx, ah ; 0f b6 d4
or word [bp-008h], dx ; 09 56 f8
cmp AL, strict byte 001h ; 3c 01
db 00fh, 094h, 0c4h
; sete ah ; 0f 94 c4
movzx dx, ah ; 0f b6 d4
or word [bp-008h], dx ; 09 56 f8
cmp AL, strict byte 003h ; 3c 03
jne short 05dbch ; 75 05
mov ax, strict word 00003h ; b8 03 00
jmp short 05dbeh ; eb 02
xor ax, ax ; 31 c0
or word [bp-008h], ax ; 09 46 f8
mov ax, word [bp-01ah] ; 8b 46 e6
mov es, [bp-026h] ; 8e 46 da
mov word [es:si+001f0h], ax ; 26 89 84 f0 01
mov ax, word [bp-01ch] ; 8b 46 e4
mov word [es:si+001f2h], ax ; 26 89 84 f2 01
movzx ax, cl ; 0f b6 c1
cwd ; 99
mov di, strict word 00002h ; bf 02 00
idiv di ; f7 ff
or dl, 00eh ; 80 ca 0e
sal dx, 004h ; c1 e2 04
mov byte [es:si+001f4h], dl ; 26 88 94 f4 01
mov byte [es:si+001f5h], 0cbh ; 26 c6 84 f5 01 cb
mov byte [es:si+001f6h], ch ; 26 88 ac f6 01
mov word [es:si+001f7h], strict word 00001h ; 26 c7 84 f7 01 01 00
mov byte [es:si+001f9h], 000h ; 26 c6 84 f9 01 00
mov ax, word [bp-008h] ; 8b 46 f8
mov word [es:si+001fah], ax ; 26 89 84 fa 01
mov word [es:si+001fch], strict word 00000h ; 26 c7 84 fc 01 00 00
mov byte [es:si+001feh], 011h ; 26 c6 84 fe 01 11
xor ch, ch ; 30 ed
mov byte [bp-002h], ch ; 88 6e fe
jmp short 05e22h ; eb 06
cmp byte [bp-002h], 00fh ; 80 7e fe 0f
jnc short 05e37h ; 73 15
movzx dx, byte [bp-002h] ; 0f b6 56 fe
add dx, 00312h ; 81 c2 12 03
mov ax, word [bp-014h] ; 8b 46 ec
call 01650h ; e8 20 b8
add ch, al ; 00 c5
inc byte [bp-002h] ; fe 46 fe
jmp short 05e1ch ; eb e5
neg ch ; f6 dd
mov es, [bp-026h] ; 8e 46 da
mov byte [es:si+001ffh], ch ; 26 88 ac ff 01
cmp word [bp-00eh], strict byte 00042h ; 83 7e f2 42
jc near 05ef7h ; 0f 82 ae 00
movzx ax, cl ; 0f b6 c1
cwd ; 99
db 02bh, 0c2h
; sub ax, dx ; 2b c2
sar ax, 1 ; d1 f8
xor ah, ah ; 30 e4
imul ax, ax, strict byte 00006h ; 6b c0 06
mov es, [bp-026h] ; 8e 46 da
add si, ax ; 01 c6
mov al, byte [es:si+001c0h] ; 26 8a 84 c0 01
mov dx, word [es:si+001c2h] ; 26 8b 94 c2 01
mov es, [bp-004h] ; 8e 46 fc
mov word [es:bx], strict word 00042h ; 26 c7 07 42 00
db 066h, 026h, 0c7h, 047h, 01eh, 0ddh, 0beh, 024h, 000h
; mov dword [es:bx+01eh], strict dword 00024beddh ; 66 26 c7 47 1e dd be 24 00
mov word [es:bx+022h], strict word 00000h ; 26 c7 47 22 00 00
test al, al ; 84 c0
jne short 05e89h ; 75 09
db 066h, 026h, 0c7h, 047h, 024h, 049h, 053h, 041h, 020h
; mov dword [es:bx+024h], strict dword 020415349h ; 66 26 c7 47 24 49 53 41 20
mov es, [bp-004h] ; 8e 46 fc
db 066h, 026h, 0c7h, 047h, 028h, 041h, 054h, 041h, 020h
; mov dword [es:bx+028h], strict dword 020415441h ; 66 26 c7 47 28 41 54 41 20
db 066h, 026h, 0c7h, 047h, 02ch, 020h, 020h, 020h, 020h
; mov dword [es:bx+02ch], strict dword 020202020h ; 66 26 c7 47 2c 20 20 20 20
test al, al ; 84 c0
jne short 05eb5h ; 75 13
mov word [es:bx+030h], dx ; 26 89 57 30
db 066h, 026h, 0c7h, 047h, 032h, 000h, 000h, 000h, 000h
; mov dword [es:bx+032h], strict dword 000000000h ; 66 26 c7 47 32 00 00 00 00
mov word [es:bx+036h], strict word 00000h ; 26 c7 47 36 00 00
mov al, cl ; 88 c8
and AL, strict byte 001h ; 24 01
xor ah, ah ; 30 e4
mov es, [bp-004h] ; 8e 46 fc
mov word [es:bx+038h], ax ; 26 89 47 38
db 066h, 026h, 0c7h, 047h, 03ah, 000h, 000h, 000h, 000h
; mov dword [es:bx+03ah], strict dword 000000000h ; 66 26 c7 47 3a 00 00 00 00
mov word [es:bx+03eh], strict word 00000h ; 26 c7 47 3e 00 00
xor cl, cl ; 30 c9
mov CH, strict byte 01eh ; b5 1e
jmp short 05edch ; eb 05
cmp ch, 040h ; 80 fd 40
jnc short 05eeeh ; 73 12
movzx dx, ch ; 0f b6 d5
add dx, word [bp+00ah] ; 03 56 0a
mov ax, word [bp+004h] ; 8b 46 04
call 01650h ; e8 68 b7
add cl, al ; 00 c1
db 0feh, 0c5h
; inc ch ; fe c5
jmp short 05ed7h ; eb e9
neg cl ; f6 d9
mov es, [bp-004h] ; 8e 46 fc
mov byte [es:bx+041h], cl ; 26 88 4f 41
mov byte [bp+017h], 000h ; c6 46 17 00
xor bx, bx ; 31 db
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 58 b7
and byte [bp+01ch], 0feh ; 80 66 1c fe
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
cmp ax, strict word 00006h ; 3d 06 00
je short 05ef7h ; 74 e4
cmp ax, strict word 00001h ; 3d 01 00
jc short 05f24h ; 72 0c
jbe short 05ef7h ; 76 dd
cmp ax, strict word 00003h ; 3d 03 00
jc short 05f24h ; 72 05
cmp ax, strict word 00004h ; 3d 04 00
jbe short 05ef7h ; 76 d3
mov ax, word [bp+016h] ; 8b 46 16
xor ah, ah ; 30 e4
or ah, 001h ; 80 cc 01
mov word [bp+016h], ax ; 89 46 16
mov bx, word [bp+016h] ; 8b 5e 16
shr bx, 008h ; c1 eb 08
xor bh, bh ; 30 ff
mov dx, strict word 00074h ; ba 74 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 1e b7
or byte [bp+01ch], 001h ; 80 4e 1c 01
jmp short 05f0ah ; eb c4
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 e0 b9
mov ax, word [bp+016h] ; 8b 46 16
shr ax, 008h ; c1 e8 08
push ax ; 50
push 007d5h ; 68 d5 07
push 007a7h ; 68 a7 07
jmp near 05bd1h ; e9 70 fc
_int14_function: ; 0xf5f61 LB 0x155
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
sti ; fb
mov dx, word [bp+00eh] ; 8b 56 0e
add dx, dx ; 01 d2
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 fb b6
mov si, ax ; 89 c6
mov bx, ax ; 89 c3
mov dx, word [bp+00eh] ; 8b 56 0e
add dx, strict byte 0007ch ; 83 c2 7c
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 cf b6
mov cl, al ; 88 c1
cmp word [bp+00eh], strict byte 00004h ; 83 7e 0e 04
jnc near 060ach ; 0f 83 21 01
test si, si ; 85 f6
jbe near 060ach ; 0f 86 1b 01
mov al, byte [bp+013h] ; 8a 46 13
cmp AL, strict byte 001h ; 3c 01
jc short 05fa9h ; 72 11
jbe short 05ffdh ; 76 63
cmp AL, strict byte 003h ; 3c 03
je near 06095h ; 0f 84 f5 00
cmp AL, strict byte 002h ; 3c 02
je near 0604bh ; 0f 84 a5 00
jmp near 060a6h ; e9 fd 00
test al, al ; 84 c0
jne near 060a6h ; 0f 85 f7 00
lea dx, [bx+003h] ; 8d 57 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
or AL, strict byte 080h ; 0c 80
out DX, AL ; ee
mov al, byte [bp+012h] ; 8a 46 12
and AL, strict byte 0e0h ; 24 e0
movzx cx, al ; 0f b6 c8
sar cx, 005h ; c1 f9 05
mov ax, 00600h ; b8 00 06
sar ax, CL ; d3 f8
mov dx, bx ; 89 da
out DX, AL ; ee
shr ax, 008h ; c1 e8 08
lea dx, [bx+001h] ; 8d 57 01
out DX, AL ; ee
mov al, byte [bp+012h] ; 8a 46 12
and AL, strict byte 01fh ; 24 1f
lea dx, [bx+003h] ; 8d 57 03
out DX, AL ; ee
lea dx, [bx+005h] ; 8d 57 05
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov byte [bp+013h], al ; 88 46 13
lea dx, [bx+006h] ; 8d 57 06
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov byte [bp+012h], al ; 88 46 12
jmp near 06087h ; e9 97 00
mov AL, strict byte 017h ; b0 17
mov dx, bx ; 89 da
out DX, AL ; ee
lea dx, [bx+001h] ; 8d 57 01
mov AL, strict byte 004h ; b0 04
out DX, AL ; ee
jmp short 05fd2h ; eb d5
mov dx, strict word 0006ch ; ba 6c 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 66 b6
mov si, ax ; 89 c6
lea dx, [bx+005h] ; 8d 57 05
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and ax, strict word 00060h ; 25 60 00
cmp ax, strict word 00060h ; 3d 60 00
je short 0602dh ; 74 17
test cl, cl ; 84 c9
je short 0602dh ; 74 13
mov dx, strict word 0006ch ; ba 6c 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 49 b6
cmp ax, si ; 39 f0
je short 06008h ; 74 e1
mov si, ax ; 89 c6
db 0feh, 0c9h
; dec cl ; fe c9
jmp short 06008h ; eb db
test cl, cl ; 84 c9
je short 06037h ; 74 06
mov al, byte [bp+012h] ; 8a 46 12
mov dx, bx ; 89 da
out DX, AL ; ee
lea dx, [bx+005h] ; 8d 57 05
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov byte [bp+013h], al ; 88 46 13
test cl, cl ; 84 c9
jne short 06087h ; 75 43
or AL, strict byte 080h ; 0c 80
mov byte [bp+013h], al ; 88 46 13
jmp short 06087h ; eb 3c
mov dx, strict word 0006ch ; ba 6c 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 18 b6
mov si, ax ; 89 c6
lea dx, [bx+005h] ; 8d 57 05
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 06077h ; 75 17
test cl, cl ; 84 c9
je short 06077h ; 74 13
mov dx, strict word 0006ch ; ba 6c 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 ff b5
cmp ax, si ; 39 f0
je short 06056h ; 74 e5
mov si, ax ; 89 c6
db 0feh, 0c9h
; dec cl ; fe c9
jmp short 06056h ; eb df
test cl, cl ; 84 c9
je short 0608dh ; 74 12
mov byte [bp+013h], 000h ; c6 46 13 00
mov dx, bx ; 89 da
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov byte [bp+012h], al ; 88 46 12
and byte [bp+01ch], 0feh ; 80 66 1c fe
jmp short 060b0h ; eb 23
lea dx, [bx+005h] ; 8d 57 05
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
jmp short 06046h ; eb b1
lea dx, [si+005h] ; 8d 54 05
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov byte [bp+013h], al ; 88 46 13
lea dx, [si+006h] ; 8d 54 06
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
jmp short 06084h ; eb de
or byte [bp+01ch], 001h ; 80 4e 1c 01
jmp short 060b0h ; eb 04
or byte [bp+01ch], 001h ; 80 4e 1c 01
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn ; c3
set_enable_a20_: ; 0xf60b6 LB 0x2c
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push dx ; 52
mov bx, ax ; 89 c3
mov dx, 00092h ; ba 92 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov cl, al ; 88 c1
test bx, bx ; 85 db
je short 060cfh ; 74 05
or AL, strict byte 002h ; 0c 02
out DX, AL ; ee
jmp short 060d2h ; eb 03
and AL, strict byte 0fdh ; 24 fd
out DX, AL ; ee
test cl, 002h ; f6 c1 02
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
xor ah, ah ; 30 e4
lea sp, [bp-006h] ; 8d 66 fa
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
set_e820_range_: ; 0xf60e2 LB 0x8c
push si ; 56
push bp ; 55
mov bp, sp ; 89 e5
mov es, ax ; 8e c0
mov si, dx ; 89 d6
mov word [es:si], bx ; 26 89 1c
mov word [es:si+002h], cx ; 26 89 4c 02
movzx ax, byte [bp+00ah] ; 0f b6 46 0a
mov word [es:si+004h], ax ; 26 89 44 04
mov word [es:si+006h], strict word 00000h ; 26 c7 44 06 00 00
sub word [bp+006h], bx ; 29 5e 06
sbb word [bp+008h], cx ; 19 4e 08
mov al, byte [bp+00ah] ; 8a 46 0a
sub byte [bp+00ch], al ; 28 46 0c
mov ax, word [bp+006h] ; 8b 46 06
mov word [es:si+008h], ax ; 26 89 44 08
mov ax, word [bp+008h] ; 8b 46 08
mov word [es:si+00ah], ax ; 26 89 44 0a
movzx ax, byte [bp+00ch] ; 0f b6 46 0c
mov word [es:si+00ch], ax ; 26 89 44 0c
mov word [es:si+00eh], strict word 00000h ; 26 c7 44 0e 00 00
mov ax, word [bp+00eh] ; 8b 46 0e
mov word [es:si+010h], ax ; 26 89 44 10
mov word [es:si+012h], strict word 00000h ; 26 c7 44 12 00 00
pop bp ; 5d
pop si ; 5e
retn 0000ah ; c2 0a 00
db 0ech, 0e9h, 0d8h, 0c1h, 0c0h, 0bfh, 091h, 090h, 089h, 088h, 087h, 083h, 052h, 04fh, 041h, 024h
db 000h, 00dh, 066h, 0adh, 061h, 0c0h, 061h, 055h, 062h, 05bh, 062h, 060h, 062h, 065h, 062h, 007h
db 063h, 0a4h, 064h, 0cah, 064h, 04eh, 062h, 04eh, 062h, 097h, 065h, 0bfh, 065h, 0d2h, 065h, 0e1h
db 065h, 055h, 062h, 0e8h, 065h
_int15_function: ; 0xf616e LB 0x4cd
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov ax, word [bp+012h] ; 8b 46 12
shr ax, 008h ; c1 e8 08
cmp ax, 000ech ; 3d ec 00
jnbe near 0660dh ; 0f 87 8b 04
push CS ; 0e
pop ES ; 07
mov cx, strict word 00012h ; b9 12 00
mov di, 06139h ; bf 39 61
repne scasb ; f2 ae
sal cx, 1 ; d1 e1
mov di, cx ; 89 cf
mov si, word [cs:di+0614ah] ; 2e 8b b5 4a 61
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
mov cx, word [bp+018h] ; 8b 4e 18
and cl, 0feh ; 80 e1 fe
mov bx, word [bp+018h] ; 8b 5e 18
or bl, 001h ; 80 cb 01
mov dx, ax ; 89 c2
or dh, 086h ; 80 ce 86
jmp si ; ff e6
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
cmp ax, 000c0h ; 3d c0 00
jne near 0660dh ; 0f 85 54 04
or byte [bp+018h], 001h ; 80 4e 18 01
jmp near 065b6h ; e9 f6 03
mov dx, ax ; 89 c2
cmp ax, strict word 00001h ; 3d 01 00
jc short 061d5h ; 72 0e
jbe short 061e9h ; 76 20
cmp ax, strict word 00003h ; 3d 03 00
je short 06216h ; 74 48
cmp ax, strict word 00002h ; 3d 02 00
je short 061f9h ; 74 26
jmp short 06223h ; eb 4e
test ax, ax ; 85 c0
jne short 06223h ; 75 4a
xor ax, ax ; 31 c0
call 060b6h ; e8 d8 fe
and byte [bp+018h], 0feh ; 80 66 18 fe
mov byte [bp+013h], 000h ; c6 46 13 00
jmp near 0624eh ; e9 65 00
mov ax, strict word 00001h ; b8 01 00
call 060b6h ; e8 c7 fe
and byte [bp+018h], 0feh ; 80 66 18 fe
mov byte [bp+013h], dh ; 88 76 13
jmp near 0624eh ; e9 55 00
mov dx, 00092h ; ba 92 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
shr ax, 1 ; d1 e8
and ax, strict word 00001h ; 25 01 00
mov dx, word [bp+012h] ; 8b 56 12
mov dl, al ; 88 c2
mov word [bp+012h], dx ; 89 56 12
and byte [bp+018h], 0feh ; 80 66 18 fe
mov byte [bp+013h], ah ; 88 66 13
jmp near 0624eh ; e9 38 00
and byte [bp+018h], 0feh ; 80 66 18 fe
mov byte [bp+013h], ah ; 88 66 13
mov word [bp+00ch], ax ; 89 46 0c
jmp near 0624eh ; e9 2b 00
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 03 b7
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
push ax ; 50
push 00836h ; 68 36 08
push strict byte 00004h ; 6a 04
call 01972h ; e8 36 b7
add sp, strict byte 00006h ; 83 c4 06
or byte [bp+018h], 001h ; 80 4e 18 01
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
or ah, 086h ; 80 cc 86
mov word [bp+012h], ax ; 89 46 12
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
mov word [bp+018h], bx ; 89 5e 18
jmp near 06301h ; e9 a6 00
mov word [bp+018h], bx ; 89 5e 18
jmp short 0624eh ; eb ee
mov word [bp+018h], cx ; 89 4e 18
jmp short 0624bh ; eb e6
test byte [bp+012h], 0ffh ; f6 46 12 ff
je short 062d7h ; 74 6c
mov dx, 000a0h ; ba a0 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 dc b3
test AL, strict byte 001h ; a8 01
jne near 065adh ; 0f 85 33 03
mov bx, strict word 00001h ; bb 01 00
mov dx, 000a0h ; ba a0 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 d8 b3
mov bx, word [bp+014h] ; 8b 5e 14
mov dx, 00098h ; ba 98 00
mov ax, strict word 00040h ; b8 40 00
call 0167ah ; e8 e8 b3
mov bx, word [bp+00ch] ; 8b 5e 0c
mov dx, 0009ah ; ba 9a 00
mov ax, strict word 00040h ; b8 40 00
call 0167ah ; e8 dc b3
mov bx, word [bp+00eh] ; 8b 5e 0e
mov dx, 0009ch ; ba 9c 00
mov ax, strict word 00040h ; b8 40 00
call 0167ah ; e8 d0 b3
mov bx, word [bp+010h] ; 8b 5e 10
mov dx, 0009eh ; ba 9e 00
mov ax, strict word 00040h ; b8 40 00
call 0167ah ; e8 c4 b3
and byte [bp+018h], 0feh ; 80 66 18 fe
mov dx, 000a1h ; ba a1 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and AL, strict byte 0feh ; 24 fe
out DX, AL ; ee
mov ax, strict word 0000bh ; b8 0b 00
call 016ach ; e8 e3 b3
or AL, strict byte 040h ; 0c 40
movzx dx, al ; 0f b6 d0
mov ax, strict word 0000bh ; b8 0b 00
call 016c9h ; e8 f5 b3
jmp near 0624eh ; e9 77 ff
cmp ax, strict word 00001h ; 3d 01 00
jne short 062f5h ; 75 19
xor bx, bx ; 31 db
mov dx, 000a0h ; ba a0 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 77 b3
and byte [bp+018h], 0feh ; 80 66 18 fe
mov ax, strict word 0000bh ; b8 0b 00
call 016ach ; e8 bb b3
and AL, strict byte 0bfh ; 24 bf
jmp short 062cbh ; eb d6
mov word [bp+018h], bx ; 89 5e 18
mov ax, dx ; 89 d0
xor ah, dh ; 30 f4
xor dl, dl ; 30 d2
dec ax ; 48
or dx, ax ; 09 c2
mov word [bp+012h], dx ; 89 56 12
jmp near 0624eh ; e9 47 ff
cli ; fa
mov ax, strict word 00001h ; b8 01 00
call 060b6h ; e8 a8 fd
mov di, ax ; 89 c7
mov ax, word [bp+014h] ; 8b 46 14
sal ax, 004h ; c1 e0 04
mov cx, word [bp+006h] ; 8b 4e 06
add cx, ax ; 01 c1
mov dx, word [bp+014h] ; 8b 56 14
shr dx, 00ch ; c1 ea 0c
mov byte [bp-006h], dl ; 88 56 fa
cmp cx, ax ; 39 c1
jnc short 0632dh ; 73 05
db 0feh, 0c2h
; inc dl ; fe c2
mov byte [bp-006h], dl ; 88 56 fa
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 00008h ; 83 c2 08
mov ax, word [bp+014h] ; 8b 46 14
mov bx, strict word 0002fh ; bb 2f 00
call 0167ah ; e8 3e b3
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 0000ah ; 83 c2 0a
mov ax, word [bp+014h] ; 8b 46 14
mov bx, cx ; 89 cb
call 0167ah ; e8 30 b3
movzx bx, byte [bp-006h] ; 0f b6 5e fa
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 0000ch ; 83 c2 0c
mov ax, word [bp+014h] ; 8b 46 14
call 0165eh ; e8 04 b3
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 0000dh ; 83 c2 0d
mov ax, word [bp+014h] ; 8b 46 14
mov bx, 00093h ; bb 93 00
call 0165eh ; e8 f5 b2
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 0000eh ; 83 c2 0e
mov ax, word [bp+014h] ; 8b 46 14
xor bx, bx ; 31 db
call 0167ah ; e8 03 b3
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 00020h ; 83 c2 20
mov ax, word [bp+014h] ; 8b 46 14
mov bx, strict word 0ffffh ; bb ff ff
call 0167ah ; e8 f4 b2
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 00022h ; 83 c2 22
mov ax, word [bp+014h] ; 8b 46 14
xor bx, bx ; 31 db
call 0167ah ; e8 e6 b2
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 00024h ; 83 c2 24
mov ax, word [bp+014h] ; 8b 46 14
mov bx, strict word 0000fh ; bb 0f 00
call 0165eh ; e8 bb b2
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 00025h ; 83 c2 25
mov ax, word [bp+014h] ; 8b 46 14
mov bx, 0009bh ; bb 9b 00
call 0165eh ; e8 ac b2
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 00026h ; 83 c2 26
mov ax, word [bp+014h] ; 8b 46 14
xor bx, bx ; 31 db
call 0167ah ; e8 ba b2
mov ax, ss ; 8c d0
mov cx, ax ; 89 c1
sal cx, 004h ; c1 e1 04
shr ax, 00ch ; c1 e8 0c
mov word [bp-008h], ax ; 89 46 f8
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 00028h ; 83 c2 28
mov ax, word [bp+014h] ; 8b 46 14
mov bx, strict word 0ffffh ; bb ff ff
call 0167ah ; e8 9e b2
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 0002ah ; 83 c2 2a
mov ax, word [bp+014h] ; 8b 46 14
mov bx, cx ; 89 cb
call 0167ah ; e8 90 b2
movzx bx, byte [bp-008h] ; 0f b6 5e f8
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 0002ch ; 83 c2 2c
mov ax, word [bp+014h] ; 8b 46 14
call 0165eh ; e8 64 b2
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 0002dh ; 83 c2 2d
mov ax, word [bp+014h] ; 8b 46 14
mov bx, 00093h ; bb 93 00
call 0165eh ; e8 55 b2
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 0002eh ; 83 c2 2e
mov ax, word [bp+014h] ; 8b 46 14
xor bx, bx ; 31 db
call 0167ah ; e8 63 b2
mov si, word [bp+006h] ; 8b 76 06
mov es, [bp+014h] ; 8e 46 14
mov cx, word [bp+010h] ; 8b 4e 10
push DS ; 1e
push eax ; 66 50
db 066h, 033h, 0c0h
; xor eax, eax ; 66 33 c0
mov ds, ax ; 8e d8
mov word [00467h], sp ; 89 26 67 04
mov [00469h], ss ; 8c 16 69 04
call 06433h ; e8 00 00
pop di ; 5f
add di, strict byte 0001bh ; 83 c7 1b
push strict byte 00020h ; 6a 20
push di ; 57
lgdt [es:si+008h] ; 26 0f 01 54 08
lidt [cs:0efe1h] ; 2e 0f 01 1e e1 ef
mov eax, cr0 ; 0f 20 c0
or AL, strict byte 001h ; 0c 01
mov cr0, eax ; 0f 22 c0
retf ; cb
mov ax, strict word 00028h ; b8 28 00
mov ss, ax ; 8e d0
mov ax, strict word 00010h ; b8 10 00
mov ds, ax ; 8e d8
mov ax, strict word 00018h ; b8 18 00
mov es, ax ; 8e c0
db 033h, 0f6h
; xor si, si ; 33 f6
db 033h, 0ffh
; xor di, di ; 33 ff
cld ; fc
rep movsw ; f3 a5
call 06467h ; e8 00 00
pop ax ; 58
push 0f000h ; 68 00 f0
add ax, strict byte 00018h ; 83 c0 18
push ax ; 50
mov ax, strict word 00028h ; b8 28 00
mov ds, ax ; 8e d8
mov es, ax ; 8e c0
mov eax, cr0 ; 0f 20 c0
and AL, strict byte 0feh ; 24 fe
mov cr0, eax ; 0f 22 c0
retf ; cb
lidt [cs:0efe7h] ; 2e 0f 01 1e e7 ef
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
mov es, ax ; 8e c0
lss sp, [00467h] ; 0f b2 26 67 04
pop eax ; 66 58
pop DS ; 1f
mov ax, di ; 89 f8
call 060b6h ; e8 1e fc
sti ; fb
mov byte [bp+013h], 000h ; c6 46 13 00
and byte [bp+018h], 0feh ; 80 66 18 fe
jmp near 0624eh ; e9 aa fd
mov ax, strict word 00031h ; b8 31 00
call 016ach ; e8 02 b2
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
sal dx, 008h ; c1 e2 08
mov ax, strict word 00030h ; b8 30 00
call 016ach ; e8 f5 b1
xor ah, ah ; 30 e4
or dx, ax ; 09 c2
mov word [bp+012h], dx ; 89 56 12
cmp dx, strict byte 0ffc0h ; 83 fa c0
jbe short 0649dh ; 76 da
mov word [bp+012h], strict word 0ffc0h ; c7 46 12 c0 ff
jmp short 0649dh ; eb d3
cli ; fa
mov ax, strict word 00001h ; b8 01 00
call 060b6h ; e8 e5 fb
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 00038h ; 83 c2 38
mov ax, word [bp+014h] ; 8b 46 14
mov bx, strict word 0ffffh ; bb ff ff
call 0167ah ; e8 9a b1
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 0003ah ; 83 c2 3a
mov ax, word [bp+014h] ; 8b 46 14
xor bx, bx ; 31 db
call 0167ah ; e8 8c b1
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 0003ch ; 83 c2 3c
mov ax, word [bp+014h] ; 8b 46 14
mov bx, strict word 0000fh ; bb 0f 00
call 0165eh ; e8 61 b1
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 0003dh ; 83 c2 3d
mov ax, word [bp+014h] ; 8b 46 14
mov bx, 0009bh ; bb 9b 00
call 0165eh ; e8 52 b1
mov dx, word [bp+006h] ; 8b 56 06
add dx, strict byte 0003eh ; 83 c2 3e
mov ax, word [bp+014h] ; 8b 46 14
xor bx, bx ; 31 db
call 0167ah ; e8 60 b1
mov AL, strict byte 011h ; b0 11
mov dx, strict word 00020h ; ba 20 00
out DX, AL ; ee
mov dx, 000a0h ; ba a0 00
out DX, AL ; ee
mov ax, word [bp+00ch] ; 8b 46 0c
shr ax, 008h ; c1 e8 08
mov dx, strict word 00021h ; ba 21 00
out DX, AL ; ee
mov ax, word [bp+00ch] ; 8b 46 0c
mov dx, 000a1h ; ba a1 00
out DX, AL ; ee
mov AL, strict byte 004h ; b0 04
mov dx, strict word 00021h ; ba 21 00
out DX, AL ; ee
mov AL, strict byte 002h ; b0 02
mov dx, 000a1h ; ba a1 00
out DX, AL ; ee
mov AL, strict byte 001h ; b0 01
mov dx, strict word 00021h ; ba 21 00
out DX, AL ; ee
mov dx, 000a1h ; ba a1 00
out DX, AL ; ee
mov AL, strict byte 0ffh ; b0 ff
mov dx, strict word 00021h ; ba 21 00
out DX, AL ; ee
mov dx, 000a1h ; ba a1 00
out DX, AL ; ee
mov si, word [bp+006h] ; 8b 76 06
call 0655bh ; e8 00 00
pop di ; 5f
add di, strict byte 00018h ; 83 c7 18
push strict byte 00038h ; 6a 38
push di ; 57
lgdt [es:si+008h] ; 26 0f 01 54 08
lidt [es:si+010h] ; 26 0f 01 5c 10
mov ax, strict word 00001h ; b8 01 00
lmsw ax ; 0f 01 f0
retf ; cb
mov ax, strict word 00028h ; b8 28 00
mov ss, ax ; 8e d0
mov ax, strict word 00018h ; b8 18 00
mov ds, ax ; 8e d8
mov ax, strict word 00020h ; b8 20 00
mov es, ax ; 8e c0
lea ax, [bp+004h] ; 8d 46 04
db 08bh, 0e0h
; mov sp, ax ; 8b e0
popaw ; 61
add sp, strict byte 00006h ; 83 c4 06
pop cx ; 59
pop ax ; 58
pop ax ; 58
mov ax, strict word 00030h ; b8 30 00
push ax ; 50
push cx ; 51
retf ; cb
jmp near 0624eh ; e9 b7 fc
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 8f b3
push 00876h ; 68 76 08
push strict byte 00004h ; 6a 04
call 01972h ; e8 c8 b3
add sp, strict byte 00004h ; 83 c4 04
or byte [bp+018h], 001h ; 80 4e 18 01
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
or ah, 086h ; 80 cc 86
mov word [bp+012h], ax ; 89 46 12
jmp near 0624eh ; e9 8f fc
mov word [bp+018h], cx ; 89 4e 18
mov word [bp+012h], ax ; 89 46 12
mov word [bp+00ch], 0e6f5h ; c7 46 0c f5 e6
mov word [bp+014h], 0f000h ; c7 46 14 00 f0
jmp near 0624eh ; e9 7c fc
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 91 b0
mov word [bp+014h], ax ; 89 46 14
jmp near 0649dh ; e9 bc fe
push 008a5h ; 68 a5 08
push strict byte 00008h ; 6a 08
jmp short 065a7h ; eb bf
test byte [bp+012h], 0ffh ; f6 46 12 ff
jne short 0660dh ; 75 1f
mov word [bp+012h], ax ; 89 46 12
mov ax, word [bp+00ch] ; 8b 46 0c
xor ah, ah ; 30 e4
cmp ax, strict word 00001h ; 3d 01 00
jc short 06606h ; 72 0b
cmp ax, strict word 00003h ; 3d 03 00
jnbe short 06606h ; 77 06
mov word [bp+018h], cx ; 89 4e 18
jmp near 0624eh ; e9 48 fc
or byte [bp+018h], 001h ; 80 4e 18 01
jmp near 0624eh ; e9 41 fc
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 19 b3
push word [bp+00ch] ; ff 76 0c
push word [bp+012h] ; ff 76 12
push 008bch ; 68 bc 08
push strict byte 00004h ; 6a 04
call 01972h ; e8 4c b3
add sp, strict byte 00008h ; 83 c4 08
jmp short 065adh ; eb 82
in AL, strict byte 067h ; e4 67
push ES ; 06
push 06829h ; 68 29 68
dec bx ; 4b
push 0686bh ; 68 6b 68
mov [bx+si-035h], gs ; 8c 68 cb
push 068f7h ; 68 f7 68
_int15_function32: ; 0xf663b LB 0x37e
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
sub sp, strict byte 00008h ; 83 ec 08
mov dx, word [bp+020h] ; 8b 56 20
shr dx, 008h ; c1 ea 08
mov bx, word [bp+028h] ; 8b 5e 28
and bl, 0feh ; 80 e3 fe
mov ax, word [bp+020h] ; 8b 46 20
xor ah, ah ; 30 e4
cmp dx, 000e8h ; 81 fa e8 00
je near 06708h ; 0f 84 ad 00
cmp dx, 000d0h ; 81 fa d0 00
je short 066a3h ; 74 42
cmp dx, 00086h ; 81 fa 86 00
jne near 06989h ; 0f 85 20 03
sti ; fb
mov ax, word [bp+01ch] ; 8b 46 1c
mov dx, word [bp+018h] ; 8b 56 18
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c2h
; mov ax, dx ; 8b c2
mov ebx, strict dword 00000000fh ; 66 bb 0f 00 00 00
db 066h, 033h, 0d2h
; xor edx, edx ; 66 33 d2
div ebx ; 66 f7 f3
db 066h, 08bh, 0c8h
; mov ecx, eax ; 66 8b c8
in AL, strict byte 061h ; e4 61
and AL, strict byte 010h ; 24 10
db 08ah, 0e0h
; mov ah, al ; 8a e0
db 066h, 00bh, 0c9h
; or ecx, ecx ; 66 0b c9
je near 066a0h ; 0f 84 0e 00
in AL, strict byte 061h ; e4 61
and AL, strict byte 010h ; 24 10
db 03ah, 0c4h
; cmp al, ah ; 3a c4
je short 06692h ; 74 f8
db 08ah, 0e0h
; mov ah, al ; 8a e0
dec ecx ; 66 49
jne short 06692h ; 75 f2
jmp near 069b3h ; e9 10 03
cmp ax, strict word 0004fh ; 3d 4f 00
jne near 06989h ; 0f 85 df 02
cmp word [bp+016h], 05052h ; 81 7e 16 52 50
jne near 06989h ; 0f 85 d6 02
cmp word [bp+014h], 04f43h ; 81 7e 14 43 4f
jne near 06989h ; 0f 85 cd 02
cmp word [bp+01eh], 04d4fh ; 81 7e 1e 4f 4d
jne near 06989h ; 0f 85 c4 02
cmp word [bp+01ch], 04445h ; 81 7e 1c 45 44
jne near 06989h ; 0f 85 bb 02
mov ax, word [bp+00ah] ; 8b 46 0a
or ax, word [bp+008h] ; 0b 46 08
jne near 06989h ; 0f 85 b1 02
mov ax, word [bp+006h] ; 8b 46 06
or ax, word [bp+004h] ; 0b 46 04
jne near 06989h ; 0f 85 a7 02
mov word [bp+028h], bx ; 89 5e 28
mov ax, word [bp+014h] ; 8b 46 14
mov word [bp+008h], ax ; 89 46 08
mov ax, word [bp+016h] ; 8b 46 16
mov word [bp+00ah], ax ; 89 46 0a
mov ax, word [bp+01ch] ; 8b 46 1c
mov word [bp+004h], ax ; 89 46 04
mov ax, word [bp+01eh] ; 8b 46 1e
mov word [bp+006h], ax ; 89 46 06
mov dword [bp+020h], strict dword 049413332h ; 66 c7 46 20 32 33 41 49
jmp near 069b3h ; e9 ab 02
cmp ax, strict word 00020h ; 3d 20 00
je short 06717h ; 74 0a
cmp ax, strict word 00001h ; 3d 01 00
je near 0693eh ; 0f 84 2a 02
jmp near 06989h ; e9 72 02
cmp word [bp+01ah], 0534dh ; 81 7e 1a 4d 53
jne near 06989h ; 0f 85 69 02
cmp word [bp+018h], 04150h ; 81 7e 18 50 41
jne near 06989h ; 0f 85 60 02
mov ax, strict word 00035h ; b8 35 00
call 016ach ; e8 7d af
movzx bx, al ; 0f b6 d8
xor dx, dx ; 31 d2
mov cx, strict word 00008h ; b9 08 00
sal bx, 1 ; d1 e3
rcl dx, 1 ; d1 d2
loop 06737h ; e2 fa
mov ax, strict word 00034h ; b8 34 00
call 016ach ; e8 69 af
xor ah, ah ; 30 e4
mov dx, bx ; 89 da
or dx, ax ; 09 c2
xor bx, bx ; 31 db
add bx, bx ; 01 db
adc dx, 00100h ; 81 d2 00 01
cmp dx, 00100h ; 81 fa 00 01
jc short 0675dh ; 72 06
jne short 0678ah ; 75 31
test bx, bx ; 85 db
jnbe short 0678ah ; 77 2d
mov ax, strict word 00031h ; b8 31 00
call 016ach ; e8 49 af
movzx bx, al ; 0f b6 d8
xor dx, dx ; 31 d2
mov cx, strict word 00008h ; b9 08 00
sal bx, 1 ; d1 e3
rcl dx, 1 ; d1 d2
loop 0676bh ; e2 fa
mov ax, strict word 00030h ; b8 30 00
call 016ach ; e8 35 af
xor ah, ah ; 30 e4
or bx, ax ; 09 c3
mov cx, strict word 0000ah ; b9 0a 00
sal bx, 1 ; d1 e3
rcl dx, 1 ; d1 d2
loop 0677eh ; e2 fa
add bx, strict byte 00000h ; 83 c3 00
adc dx, strict byte 00010h ; 83 d2 10
mov ax, strict word 00062h ; b8 62 00
call 016ach ; e8 1c af
xor ah, ah ; 30 e4
mov word [bp-00ah], ax ; 89 46 f6
xor al, al ; 30 c0
mov word [bp-008h], ax ; 89 46 f8
mov cx, strict word 00008h ; b9 08 00
sal word [bp-00ah], 1 ; d1 66 f6
rcl word [bp-008h], 1 ; d1 56 f8
loop 0679dh ; e2 f8
mov ax, strict word 00061h ; b8 61 00
call 016ach ; e8 01 af
xor ah, ah ; 30 e4
or word [bp-00ah], ax ; 09 46 f6
mov ax, word [bp-00ah] ; 8b 46 f6
mov word [bp-008h], ax ; 89 46 f8
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
mov ax, strict word 00063h ; b8 63 00
call 016ach ; e8 eb ae
mov byte [bp-004h], al ; 88 46 fc
mov byte [bp-006h], al ; 88 46 fa
mov ax, word [bp+014h] ; 8b 46 14
cmp ax, strict word 00007h ; 3d 07 00
jnbe near 06989h ; 0f 87 b8 01
mov si, ax ; 89 c6
add si, ax ; 01 c6
mov cx, bx ; 89 d9
add cx, strict byte 00000h ; 83 c1 00
mov ax, dx ; 89 d0
adc ax, strict word 0ffffh ; 15 ff ff
jmp word [cs:si+0662bh] ; 2e ff a4 2b 66
push strict byte 00001h ; 6a 01
push dword 000000000h ; 66 6a 00
push strict byte 00009h ; 6a 09
push 0fc00h ; 68 00 fc
mov dx, word [bp+004h] ; 8b 56 04
mov ax, word [bp+024h] ; 8b 46 24
xor bx, bx ; 31 db
xor cx, cx ; 31 c9
call 060e2h ; e8 e7 f8
mov dword [bp+014h], strict dword 000000001h ; 66 c7 46 14 01 00 00 00
jmp near 06928h ; e9 22 01
push strict byte 00002h ; 6a 02
push dword 000000000h ; 66 6a 00
push strict byte 0000ah ; 6a 0a
push strict byte 00000h ; 6a 00
mov dx, word [bp+004h] ; 8b 56 04
mov ax, word [bp+024h] ; 8b 46 24
mov bx, 0fc00h ; bb 00 fc
mov cx, strict word 00009h ; b9 09 00
call 060e2h ; e8 c4 f8
mov dword [bp+014h], strict dword 000000002h ; 66 c7 46 14 02 00 00 00
jmp near 06928h ; e9 ff 00
push strict byte 00002h ; 6a 02
push dword 000000000h ; 66 6a 00
push strict byte 00010h ; 6a 10
push strict byte 00000h ; 6a 00
mov dx, word [bp+004h] ; 8b 56 04
mov ax, word [bp+024h] ; 8b 46 24
xor bx, bx ; 31 db
mov cx, strict word 0000fh ; b9 0f 00
call 060e2h ; e8 a2 f8
mov dword [bp+014h], strict dword 000000003h ; 66 c7 46 14 03 00 00 00
jmp near 06928h ; e9 dd 00
push strict byte 00001h ; 6a 01
push dword 000000000h ; 66 6a 00
push ax ; 50
push cx ; 51
mov dx, word [bp+004h] ; 8b 56 04
mov ax, word [bp+024h] ; 8b 46 24
xor bx, bx ; 31 db
mov cx, strict word 00010h ; b9 10 00
call 060e2h ; e8 82 f8
mov dword [bp+014h], strict dword 000000004h ; 66 c7 46 14 04 00 00 00
jmp near 06928h ; e9 bd 00
push strict byte 00003h ; 6a 03
push dword 000000000h ; 66 6a 00
push dx ; 52
push bx ; 53
mov dx, word [bp+004h] ; 8b 56 04
mov si, word [bp+024h] ; 8b 76 24
mov bx, cx ; 89 cb
mov cx, ax ; 89 c1
mov ax, si ; 89 f0
call 060e2h ; e8 61 f8
mov dword [bp+014h], strict dword 000000005h ; 66 c7 46 14 05 00 00 00
jmp near 06928h ; e9 9c 00
push strict byte 00002h ; 6a 02
push dword 000000000h ; 66 6a 00
push dword 000000000h ; 66 6a 00
mov dx, word [bp+004h] ; 8b 56 04
mov ax, word [bp+024h] ; 8b 46 24
xor bx, bx ; 31 db
mov cx, strict word 0fffch ; b9 fc ff
call 060e2h ; e8 40 f8
cmp byte [bp-004h], 000h ; 80 7e fc 00
jne short 068afh ; 75 07
mov ax, word [bp-008h] ; 8b 46 f8
test ax, ax ; 85 c0
je short 068c3h ; 74 14
mov dword [bp+014h], strict dword 000000007h ; 66 c7 46 14 07 00 00 00
jmp short 06928h ; eb 6f
mov dword [bp+014h], strict dword 000000006h ; 66 c7 46 14 06 00 00 00
jmp short 06928h ; eb 65
mov word [bp+014h], ax ; 89 46 14
mov word [bp+016h], ax ; 89 46 16
jmp short 06928h ; eb 5d
push strict byte 00002h ; 6a 02
push dword 000000000h ; 66 6a 00
push dword 000000000h ; 66 6a 00
mov dx, word [bp+004h] ; 8b 56 04
mov ax, word [bp+024h] ; 8b 46 24
xor bx, bx ; 31 db
xor cx, cx ; 31 c9
call 060e2h ; e8 02 f8
cmp byte [bp-004h], 000h ; 80 7e fc 00
jne short 068edh ; 75 07
mov ax, word [bp-008h] ; 8b 46 f8
test ax, ax ; 85 c0
je short 068efh ; 74 02
jmp short 068afh ; eb c0
mov word [bp+014h], ax ; 89 46 14
mov word [bp+016h], ax ; 89 46 16
jmp short 06928h ; eb 31
cmp byte [bp-004h], 000h ; 80 7e fc 00
jne short 06903h ; 75 06
cmp word [bp-008h], strict byte 00000h ; 83 7e f8 00
je short 06928h ; 74 25
push strict byte 00001h ; 6a 01
mov al, byte [bp-006h] ; 8a 46 fa
db 0feh, 0c0h
; inc al ; fe c0
xor ah, ah ; 30 e4
push ax ; 50
push strict byte 00001h ; 6a 01
push dword [bp-00ah] ; 66 ff 76 f6
mov dx, word [bp+004h] ; 8b 56 04
mov ax, word [bp+024h] ; 8b 46 24
xor bx, bx ; 31 db
xor cx, cx ; 31 c9
call 060e2h ; e8 c2 f7
xor ax, ax ; 31 c0
mov word [bp+014h], ax ; 89 46 14
mov word [bp+016h], ax ; 89 46 16
mov dword [bp+020h], strict dword 0534d4150h ; 66 c7 46 20 50 41 4d 53
mov dword [bp+01ch], strict dword 000000014h ; 66 c7 46 1c 14 00 00 00
and byte [bp+028h], 0feh ; 80 66 28 fe
jmp short 069b3h ; eb 75
mov word [bp+028h], bx ; 89 5e 28
mov ax, strict word 00031h ; b8 31 00
call 016ach ; e8 65 ad
movzx dx, al ; 0f b6 d0
sal dx, 008h ; c1 e2 08
mov ax, strict word 00030h ; b8 30 00
call 016ach ; e8 59 ad
xor ah, ah ; 30 e4
or dx, ax ; 09 c2
mov word [bp+01ch], dx ; 89 56 1c
cmp dx, 03c00h ; 81 fa 00 3c
jbe short 06965h ; 76 05
mov word [bp+01ch], 03c00h ; c7 46 1c 00 3c
mov ax, strict word 00035h ; b8 35 00
call 016ach ; e8 41 ad
movzx dx, al ; 0f b6 d0
sal dx, 008h ; c1 e2 08
mov ax, strict word 00034h ; b8 34 00
call 016ach ; e8 35 ad
xor ah, ah ; 30 e4
or dx, ax ; 09 c2
mov word [bp+018h], dx ; 89 56 18
mov ax, word [bp+01ch] ; 8b 46 1c
mov word [bp+020h], ax ; 89 46 20
mov word [bp+014h], dx ; 89 56 14
jmp short 069b3h ; eb 2a
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 9d af
push word [bp+014h] ; ff 76 14
push word [bp+020h] ; ff 76 20
push 008bch ; 68 bc 08
push strict byte 00004h ; 6a 04
call 01972h ; e8 d0 af
add sp, strict byte 00008h ; 83 c4 08
or byte [bp+028h], 001h ; 80 4e 28 01
mov ax, word [bp+020h] ; 8b 46 20
xor al, al ; 30 c0
or AL, strict byte 086h ; 0c 86
mov word [bp+020h], ax ; 89 46 20
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn ; c3
_inv_op_handler: ; 0xf69b9 LB 0x195
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
les bx, [bp+018h] ; c4 5e 18
cmp byte [es:bx], 0f0h ; 26 80 3f f0
jne short 069cfh ; 75 06
inc word [bp+018h] ; ff 46 18
jmp near 06b47h ; e9 78 01
cmp word [es:bx], 0050fh ; 26 81 3f 0f 05
jne near 06b43h ; 0f 85 6b 01
mov si, 00800h ; be 00 08
xor ax, ax ; 31 c0
mov word [bp-006h], ax ; 89 46 fa
mov word [bp-008h], ax ; 89 46 f8
mov es, ax ; 8e c0
mov bx, word [es:si+02ch] ; 26 8b 5c 2c
sub bx, strict byte 00006h ; 83 eb 06
mov dx, word [es:si+020h] ; 26 8b 54 20
mov ax, word [es:si+01ah] ; 26 8b 44 1a
mov es, dx ; 8e c2
mov word [es:bx], ax ; 26 89 07
mov es, [bp-006h] ; 8e 46 fa
mov ax, word [es:si+022h] ; 26 8b 44 22
mov es, dx ; 8e c2
mov word [es:bx+002h], ax ; 26 89 47 02
mov es, [bp-006h] ; 8e 46 fa
mov ax, word [es:si+018h] ; 26 8b 44 18
mov es, dx ; 8e c2
mov word [es:bx+004h], ax ; 26 89 47 04
mov es, [bp-006h] ; 8e 46 fa
movzx bx, byte [es:si+038h] ; 26 0f b6 5c 38
mov di, word [es:si+036h] ; 26 8b 7c 36
mov ax, word [es:si+024h] ; 26 8b 44 24
xor dx, dx ; 31 d2
mov cx, strict word 00004h ; b9 04 00
sal ax, 1 ; d1 e0
rcl dx, 1 ; d1 d2
loop 06a28h ; e2 fa
cmp bx, dx ; 39 d3
jne short 06a36h ; 75 04
cmp di, ax ; 39 c7
je short 06a3bh ; 74 05
mov word [bp-008h], strict word 00001h ; c7 46 f8 01 00
mov es, [bp-006h] ; 8e 46 fa
movzx di, byte [es:si+04ah] ; 26 0f b6 7c 4a
mov bx, word [es:si+048h] ; 26 8b 5c 48
mov ax, word [es:si+01eh] ; 26 8b 44 1e
xor dx, dx ; 31 d2
mov cx, strict word 00004h ; b9 04 00
sal ax, 1 ; d1 e0
rcl dx, 1 ; d1 d2
loop 06a50h ; e2 fa
cmp di, dx ; 39 d7
jne short 06a5eh ; 75 04
cmp bx, ax ; 39 c3
je short 06a62h ; 74 04
or byte [bp-008h], 002h ; 80 4e f8 02
push strict byte 00000h ; 6a 00
push 00800h ; 68 00 08
push strict byte 0001fh ; 6a 1f
db 08bh, 0dch
; mov bx, sp ; 8b dc
lgdt [ss:bx] ; 36 0f 01 17
add sp, strict byte 00006h ; 83 c4 06
mov es, [bp-006h] ; 8e 46 fa
mov ax, word [es:si+03ah] ; 26 8b 44 3a
mov word [es:si+008h], ax ; 26 89 44 08
mov ax, word [es:si+036h] ; 26 8b 44 36
mov word [es:si+00ah], ax ; 26 89 44 0a
movzx dx, byte [es:si+039h] ; 26 0f b6 54 39
sal dx, 008h ; c1 e2 08
movzx ax, byte [es:si+038h] ; 26 0f b6 44 38
or dx, ax ; 09 c2
mov word [es:si+00ch], dx ; 26 89 54 0c
mov word [es:si+00eh], strict word 00000h ; 26 c7 44 0e 00 00
mov ax, word [es:si+04ch] ; 26 8b 44 4c
mov word [es:si], ax ; 26 89 04
mov ax, word [es:si+048h] ; 26 8b 44 48
mov word [es:si+002h], ax ; 26 89 44 02
movzx dx, byte [es:si+04bh] ; 26 0f b6 54 4b
sal dx, 008h ; c1 e2 08
movzx ax, byte [es:si+04ah] ; 26 0f b6 44 4a
or dx, ax ; 09 c2
mov word [es:si+004h], dx ; 26 89 54 04
movzx ax, byte [es:si+05ch] ; 26 0f b6 44 5c
mov dx, word [es:si+05ah] ; 26 8b 54 5a
push ax ; 50
push dx ; 52
push word [es:si+05eh] ; 26 ff 74 5e
db 08bh, 0dch
; mov bx, sp ; 8b dc
lidt [ss:bx] ; 36 0f 01 1f
add sp, strict byte 00006h ; 83 c4 06
mov cx, word [bp-008h] ; 8b 4e f8
mov ax, 00080h ; b8 80 00
mov ss, ax ; 8e d0
mov ax, word [ss:0001eh] ; 36 a1 1e 00
mov ds, ax ; 8e d8
mov ax, word [ss:00024h] ; 36 a1 24 00
mov es, ax ; 8e c0
smsw ax ; 0f 01 e0
inc ax ; 40
lmsw ax ; 0f 01 f0
mov ax, strict word 00008h ; b8 08 00
test cx, strict word 00001h ; f7 c1 01 00
je near 06b00h ; 0f 84 02 00
mov es, ax ; 8e c0
test cx, strict word 00002h ; f7 c1 02 00
je near 06b28h ; 0f 84 20 00
mov bx, word [word ss:00000h] ; 36 8b 1e 00 00
mov word [word ss:00008h], bx ; 36 89 1e 08 00
mov bx, word [word ss:00002h] ; 36 8b 1e 02 00
mov word [word ss:0000ah], bx ; 36 89 1e 0a 00
mov bx, word [word ss:00004h] ; 36 8b 1e 04 00
mov word [word ss:0000ch], bx ; 36 89 1e 0c 00
mov ds, ax ; 8e d8
mov eax, cr0 ; 0f 20 c0
dec ax ; 48
mov cr0, eax ; 0f 22 c0
mov sp, strict word 00026h ; bc 26 00
popaw ; 61
mov sp, word [word ss:0002ch] ; 36 8b 26 2c 00
sub sp, strict byte 00006h ; 83 ec 06
mov ss, [word ss:00020h] ; 36 8e 16 20 00
iret ; cf
jmp short 06b47h ; eb 04
sti ; fb
hlt ; f4
jmp short 06b44h ; eb fd
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
init_rtc_: ; 0xf6b4e LB 0x28
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov dx, strict word 00026h ; ba 26 00
mov ax, strict word 0000ah ; b8 0a 00
call 016c9h ; e8 6e ab
mov dx, strict word 00002h ; ba 02 00
mov ax, strict word 0000bh ; b8 0b 00
call 016c9h ; e8 65 ab
mov ax, strict word 0000ch ; b8 0c 00
call 016ach ; e8 42 ab
mov ax, strict word 0000dh ; b8 0d 00
call 016ach ; e8 3c ab
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
rtc_updating_: ; 0xf6b76 LB 0x21
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov dx, 061a8h ; ba a8 61
dec dx ; 4a
je short 06b8eh ; 74 0e
mov ax, strict word 0000ah ; b8 0a 00
call 016ach ; e8 26 ab
test AL, strict byte 080h ; a8 80
jne short 06b7dh ; 75 f3
xor ax, ax ; 31 c0
jmp short 06b91h ; eb 03
mov ax, strict word 00001h ; b8 01 00
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
_int70_function: ; 0xf6b97 LB 0xbe
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push ax ; 50
mov ax, strict word 0000bh ; b8 0b 00
call 016ach ; e8 0a ab
mov dl, al ; 88 c2
mov byte [bp-004h], al ; 88 46 fc
mov ax, strict word 0000ch ; b8 0c 00
call 016ach ; e8 ff aa
mov dh, al ; 88 c6
test dl, 060h ; f6 c2 60
je near 06c3ch ; 0f 84 86 00
test AL, strict byte 020h ; a8 20
je short 06bbeh ; 74 04
sti ; fb
int 04ah ; cd 4a
cli ; fa
test dh, 040h ; f6 c6 40
je near 06c3ch ; 0f 84 77 00
mov dx, 000a0h ; ba a0 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 82 aa
test al, al ; 84 c0
je short 06c3ch ; 74 6a
mov dx, 0009ch ; ba 9c 00
mov ax, strict word 00040h ; b8 40 00
call 01688h ; e8 ad aa
test dx, dx ; 85 d2
jne short 06c28h ; 75 49
cmp ax, 003d1h ; 3d d1 03
jnc short 06c28h ; 73 44
mov dx, 00098h ; ba 98 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 7f aa
mov si, ax ; 89 c6
mov dx, 0009ah ; ba 9a 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 74 aa
mov cx, ax ; 89 c1
xor bx, bx ; 31 db
mov dx, 000a0h ; ba a0 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 59 aa
mov al, byte [bp-004h] ; 8a 46 fc
and AL, strict byte 037h ; 24 37
movzx dx, al ; 0f b6 d0
mov ax, strict word 0000bh ; b8 0b 00
call 016c9h ; e8 b6 aa
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 01650h ; e8 36 aa
or AL, strict byte 080h ; 0c 80
movzx bx, al ; 0f b6 d8
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 0165eh ; e8 38 aa
jmp short 06c3ch ; eb 14
mov bx, ax ; 89 c3
add bx, 0fc2fh ; 81 c3 2f fc
mov cx, dx ; 89 d1
adc cx, strict byte 0ffffh ; 83 d1 ff
mov dx, 0009ch ; ba 9c 00
mov ax, strict word 00040h ; b8 40 00
call 0169ah ; e8 5e aa
call 0e030h ; e8 f1 73
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn ; c3
insb ; 6c
insb ; 6c
xchg bp, ax ; 95
insb ; 6c
mov dx, 0ec6ch ; ba 6c ec
insb ; 6c
cmp bp, word [di+073h] ; 3b 6d 73
insw ; 6d
mov DH, strict byte 06dh ; b6 6d
db 00dh
outsb ; 6e
_int1a_function: ; 0xf6c55 LB 0x1c8
push bp ; 55
mov bp, sp ; 89 e5
sti ; fb
mov al, byte [bp+013h] ; 8a 46 13
cmp AL, strict byte 007h ; 3c 07
jnbe near 06c91h ; 0f 87 2f 00
movzx bx, al ; 0f b6 d8
add bx, bx ; 01 db
jmp word [cs:bx+06c45h] ; 2e ff a7 45 6c
cli ; fa
mov bx, 0046eh ; bb 6e 04
xor ax, ax ; 31 c0
mov es, ax ; 8e c0
mov ax, word [es:bx] ; 26 8b 07
mov word [bp+010h], ax ; 89 46 10
mov bx, 0046ch ; bb 6c 04
mov ax, word [es:bx] ; 26 8b 07
mov word [bp+00eh], ax ; 89 46 0e
mov bx, 00470h ; bb 70 04
mov al, byte [es:bx] ; 26 8a 07
mov byte [bp+012h], al ; 88 46 12
mov byte [es:bx], 000h ; 26 c6 07 00
sti ; fb
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
cli ; fa
mov bx, 0046eh ; bb 6e 04
xor ax, ax ; 31 c0
mov es, ax ; 8e c0
mov ax, word [bp+010h] ; 8b 46 10
mov word [es:bx], ax ; 26 89 07
mov bx, 0046ch ; bb 6c 04
mov ax, word [bp+00eh] ; 8b 46 0e
mov word [es:bx], ax ; 26 89 07
mov bx, 00470h ; bb 70 04
mov byte [es:bx], 000h ; 26 c6 07 00
sti ; fb
mov byte [bp+013h], 000h ; c6 46 13 00
jmp short 06c91h ; eb d7
call 06b76h ; e8 b9 fe
test ax, ax ; 85 c0
je short 06cc3h ; 74 02
jmp short 06c91h ; eb ce
xor ax, ax ; 31 c0
call 016ach ; e8 e4 a9
mov byte [bp+00fh], al ; 88 46 0f
mov ax, strict word 00002h ; b8 02 00
call 016ach ; e8 db a9
mov byte [bp+010h], al ; 88 46 10
mov ax, strict word 00004h ; b8 04 00
call 016ach ; e8 d2 a9
mov bl, al ; 88 c3
mov byte [bp+011h], al ; 88 46 11
mov ax, strict word 0000bh ; b8 0b 00
call 016ach ; e8 c7 a9
and AL, strict byte 001h ; 24 01
mov byte [bp+00eh], al ; 88 46 0e
jmp short 06d31h ; eb 45
call 06b76h ; e8 87 fe
test ax, ax ; 85 c0
je short 06cf6h ; 74 03
call 06b4eh ; e8 58 fe
movzx dx, byte [bp+00fh] ; 0f b6 56 0f
xor ax, ax ; 31 c0
call 016c9h ; e8 ca a9
movzx dx, byte [bp+010h] ; 0f b6 56 10
mov ax, strict word 00002h ; b8 02 00
call 016c9h ; e8 c0 a9
movzx dx, byte [bp+011h] ; 0f b6 56 11
mov ax, strict word 00004h ; b8 04 00
call 016c9h ; e8 b6 a9
mov ax, strict word 0000bh ; b8 0b 00
call 016ach ; e8 93 a9
mov bl, al ; 88 c3
and bl, 060h ; 80 e3 60
or bl, 002h ; 80 cb 02
mov al, byte [bp+00eh] ; 8a 46 0e
and AL, strict byte 001h ; 24 01
or bl, al ; 08 c3
movzx dx, bl ; 0f b6 d3
mov ax, strict word 0000bh ; b8 0b 00
call 016c9h ; e8 98 a9
mov byte [bp+013h], 000h ; c6 46 13 00
mov byte [bp+012h], bl ; 88 5e 12
jmp near 06c91h ; e9 56 ff
mov byte [bp+013h], 000h ; c6 46 13 00
call 06b76h ; e8 34 fe
test ax, ax ; 85 c0
je short 06d49h ; 74 03
jmp near 06c91h ; e9 48 ff
mov ax, strict word 00009h ; b8 09 00
call 016ach ; e8 5d a9
mov byte [bp+010h], al ; 88 46 10
mov ax, strict word 00008h ; b8 08 00
call 016ach ; e8 54 a9
mov byte [bp+00fh], al ; 88 46 0f
mov ax, strict word 00007h ; b8 07 00
call 016ach ; e8 4b a9
mov byte [bp+00eh], al ; 88 46 0e
mov ax, strict word 00032h ; b8 32 00
call 016ach ; e8 42 a9
mov byte [bp+011h], al ; 88 46 11
mov byte [bp+012h], al ; 88 46 12
jmp near 06c91h ; e9 1e ff
call 06b76h ; e8 00 fe
test ax, ax ; 85 c0
je short 06d80h ; 74 06
call 06b4eh ; e8 d1 fd
jmp near 06c91h ; e9 11 ff
movzx dx, byte [bp+010h] ; 0f b6 56 10
mov ax, strict word 00009h ; b8 09 00
call 016c9h ; e8 3f a9
movzx dx, byte [bp+00fh] ; 0f b6 56 0f
mov ax, strict word 00008h ; b8 08 00
call 016c9h ; e8 35 a9
movzx dx, byte [bp+00eh] ; 0f b6 56 0e
mov ax, strict word 00007h ; b8 07 00
call 016c9h ; e8 2b a9
movzx dx, byte [bp+011h] ; 0f b6 56 11
mov ax, strict word 00032h ; b8 32 00
call 016c9h ; e8 21 a9
mov ax, strict word 0000bh ; b8 0b 00
call 016ach ; e8 fe a8
mov bl, al ; 88 c3
and bl, 07fh ; 80 e3 7f
jmp near 06d28h ; e9 72 ff
mov ax, strict word 0000bh ; b8 0b 00
call 016ach ; e8 f0 a8
mov bl, al ; 88 c3
mov word [bp+012h], strict word 00000h ; c7 46 12 00 00
test AL, strict byte 020h ; a8 20
je short 06dcah ; 74 03
jmp near 06c91h ; e9 c7 fe
call 06b76h ; e8 a9 fd
test ax, ax ; 85 c0
je short 06dd4h ; 74 03
call 06b4eh ; e8 7a fd
movzx dx, byte [bp+00fh] ; 0f b6 56 0f
mov ax, strict word 00001h ; b8 01 00
call 016c9h ; e8 eb a8
movzx dx, byte [bp+010h] ; 0f b6 56 10
mov ax, strict word 00003h ; b8 03 00
call 016c9h ; e8 e1 a8
movzx dx, byte [bp+011h] ; 0f b6 56 11
mov ax, strict word 00005h ; b8 05 00
call 016c9h ; e8 d7 a8
mov dx, 000a1h ; ba a1 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and AL, strict byte 0feh ; 24 fe
out DX, AL ; ee
mov al, bl ; 88 d8
and AL, strict byte 05fh ; 24 5f
or AL, strict byte 020h ; 0c 20
movzx dx, al ; 0f b6 d0
mov ax, strict word 0000bh ; b8 0b 00
call 016c9h ; e8 bf a8
jmp near 06c91h ; e9 84 fe
mov ax, strict word 0000bh ; b8 0b 00
call 016ach ; e8 99 a8
mov bl, al ; 88 c3
and AL, strict byte 057h ; 24 57
movzx dx, al ; 0f b6 d0
jmp near 06d2bh ; e9 0e ff
send_to_mouse_ctrl_: ; 0xf6e1d LB 0x34
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bl, al ; 88 c3
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 002h ; a8 02
je short 06e3ch ; 74 0e
push 008f6h ; 68 f6 08
push 0116ah ; 68 6a 11
push strict byte 00007h ; 6a 07
call 01972h ; e8 39 ab
add sp, strict byte 00006h ; 83 c4 06
mov AL, strict byte 0d4h ; b0 d4
mov dx, strict word 00064h ; ba 64 00
out DX, AL ; ee
mov al, bl ; 88 d8
mov dx, strict word 00060h ; ba 60 00
out DX, AL ; ee
xor al, bl ; 30 d8
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
get_mouse_data_: ; 0xf6e51 LB 0x3b
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
mov bx, ax ; 89 c3
mov es, dx ; 8e c2
mov cx, 02710h ; b9 10 27
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and ax, strict word 00021h ; 25 21 00
cmp ax, strict word 00021h ; 3d 21 00
je short 06e72h ; 74 07
test cx, cx ; 85 c9
je short 06e72h ; 74 03
dec cx ; 49
jmp short 06e5dh ; eb eb
test cx, cx ; 85 c9
jne short 06e7ah ; 75 04
mov AL, strict byte 001h ; b0 01
jmp short 06e85h ; eb 0b
mov dx, strict word 00060h ; ba 60 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov byte [es:bx], al ; 26 88 07
xor al, al ; 30 c0
lea sp, [bp-004h] ; 8d 66 fc
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
set_kbd_command_byte_: ; 0xf6e8c LB 0x32
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bl, al ; 88 c3
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 002h ; a8 02
je short 06eabh ; 74 0e
push 00900h ; 68 00 09
push 0116ah ; 68 6a 11
push strict byte 00007h ; 6a 07
call 01972h ; e8 ca aa
add sp, strict byte 00006h ; 83 c4 06
mov AL, strict byte 060h ; b0 60
mov dx, strict word 00064h ; ba 64 00
out DX, AL ; ee
mov al, bl ; 88 d8
mov dx, strict word 00060h ; ba 60 00
out DX, AL ; ee
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
_int74_function: ; 0xf6ebe LB 0xca
push bp ; 55
mov bp, sp ; 89 e5
sub sp, strict byte 00008h ; 83 ec 08
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 9f a7
mov cx, ax ; 89 c1
mov word [bp+004h], strict word 00000h ; c7 46 04 00 00
mov dx, strict word 00064h ; ba 64 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and AL, strict byte 021h ; 24 21
cmp AL, strict byte 021h ; 3c 21
jne near 06f74h ; 0f 85 92 00
mov dx, strict word 00060h ; ba 60 00
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov bl, al ; 88 c3
mov dx, strict word 00026h ; ba 26 00
mov ax, cx ; 89 c8
call 01650h ; e8 5e a7
mov byte [bp-006h], al ; 88 46 fa
mov dx, strict word 00027h ; ba 27 00
mov ax, cx ; 89 c8
call 01650h ; e8 53 a7
mov byte [bp-008h], al ; 88 46 f8
test AL, strict byte 080h ; a8 80
je short 06f74h ; 74 70
mov al, byte [bp-008h] ; 8a 46 f8
and AL, strict byte 007h ; 24 07
mov byte [bp-002h], al ; 88 46 fe
mov al, byte [bp-006h] ; 8a 46 fa
and AL, strict byte 007h ; 24 07
mov byte [bp-004h], al ; 88 46 fc
xor bh, bh ; 30 ff
movzx dx, al ; 0f b6 d0
add dx, strict byte 00028h ; 83 c2 28
mov ax, cx ; 89 c8
call 0165eh ; e8 3d a7
mov al, byte [bp-004h] ; 8a 46 fc
cmp al, byte [bp-002h] ; 3a 46 fe
jc short 06f65h ; 72 3c
mov dx, strict word 00028h ; ba 28 00
mov ax, cx ; 89 c8
call 01650h ; e8 1f a7
xor ah, ah ; 30 e4
mov word [bp+00ch], ax ; 89 46 0c
mov dx, strict word 00029h ; ba 29 00
mov ax, cx ; 89 c8
call 01650h ; e8 12 a7
xor ah, ah ; 30 e4
mov word [bp+00ah], ax ; 89 46 0a
mov dx, strict word 0002ah ; ba 2a 00
mov ax, cx ; 89 c8
call 01650h ; e8 05 a7
xor ah, ah ; 30 e4
mov word [bp+008h], ax ; 89 46 08
xor al, al ; 30 c0
mov word [bp+006h], ax ; 89 46 06
mov byte [bp-006h], ah ; 88 66 fa
test byte [bp-008h], 080h ; f6 46 f8 80
je short 06f68h ; 74 0a
mov word [bp+004h], strict word 00001h ; c7 46 04 01 00
jmp short 06f68h ; eb 03
inc byte [bp-006h] ; fe 46 fa
movzx bx, byte [bp-006h] ; 0f b6 5e fa
mov dx, strict word 00026h ; ba 26 00
mov ax, cx ; 89 c8
call 0165eh ; e8 ea a6
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
int3 ; cc
outsw ; 6f
inc dx ; 42
jo short 06f42h ; 70 c5
jo short 06fd5h ; 70 56
jno short 06f45h ; 71 c4
jno short 06f9bh ; 71 18
jo short 06f71h ; 70 ec
jno short 06f38h ; 71 b1
db 072h
_int15_function_mouse: ; 0xf6f88 LB 0x38b
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
sub sp, strict byte 00006h ; 83 ec 06
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 d4 a6
mov cx, ax ; 89 c1
cmp byte [bp+012h], 007h ; 80 7e 12 07
jbe short 06fabh ; 76 0b
or word [bp+018h], strict byte 00001h ; 83 4e 18 01
mov byte [bp+013h], 001h ; c6 46 13 01
jmp near 0730dh ; e9 62 03
mov ax, strict word 00065h ; b8 65 00
call 06e8ch ; e8 db fe
and word [bp+018h], strict byte 0fffeh ; 83 66 18 fe
mov byte [bp+013h], 000h ; c6 46 13 00
mov al, byte [bp+012h] ; 8a 46 12
cmp AL, strict byte 007h ; 3c 07
jnbe near 072f4h ; 0f 87 32 03
movzx si, al ; 0f b6 f0
add si, si ; 01 f6
jmp word [cs:si+06f78h] ; 2e ff a4 78 6f
cmp byte [bp+00dh], 001h ; 80 7e 0d 01
jnbe near 072ffh ; 0f 87 2b 03
mov dx, strict word 00027h ; ba 27 00
mov ax, cx ; 89 c8
call 01650h ; e8 74 a6
test AL, strict byte 080h ; a8 80
jne short 06febh ; 75 0b
or word [bp+018h], strict byte 00001h ; 83 4e 18 01
mov byte [bp+013h], 005h ; c6 46 13 05
jmp near 07307h ; e9 1c 03
cmp byte [bp+00dh], 000h ; 80 7e 0d 00
db 00fh, 094h, 0c0h
; sete al ; 0f 94 c0
add AL, strict byte 0f4h ; 04 f4
xor ah, ah ; 30 e4
call 06e1dh ; e8 24 fe
test al, al ; 84 c0
jne near 0728dh ; 0f 85 8e 02
mov dx, ss ; 8c d2
lea ax, [bp-008h] ; 8d 46 f8
call 06e51h ; e8 4a fe
test al, al ; 84 c0
je near 07307h ; 0f 84 fa 02
cmp byte [bp-008h], 0fah ; 80 7e f8 fa
jne near 0728dh ; 0f 85 78 02
jmp near 07307h ; e9 ef 02
mov al, byte [bp+00dh] ; 8a 46 0d
cmp AL, strict byte 001h ; 3c 01
jc short 07023h ; 72 04
cmp AL, strict byte 008h ; 3c 08
jbe short 07026h ; 76 03
jmp near 071b9h ; e9 93 01
mov dx, strict word 00027h ; ba 27 00
mov ax, cx ; 89 c8
call 01650h ; e8 22 a6
mov ah, byte [bp+00dh] ; 8a 66 0d
db 0feh, 0cch
; dec ah ; fe cc
and AL, strict byte 0f8h ; 24 f8
or al, ah ; 08 e0
movzx bx, al ; 0f b6 d8
mov dx, strict word 00027h ; ba 27 00
mov ax, cx ; 89 c8
call 0165eh ; e8 1c a6
mov dx, strict word 00026h ; ba 26 00
mov ax, cx ; 89 c8
call 01650h ; e8 06 a6
and AL, strict byte 0f8h ; 24 f8
movzx bx, al ; 0f b6 d8
mov dx, strict word 00026h ; ba 26 00
mov ax, cx ; 89 c8
call 0165eh ; e8 07 a6
mov ax, 000ffh ; b8 ff 00
call 06e1dh ; e8 c0 fd
test al, al ; 84 c0
jne near 0728dh ; 0f 85 2a 02
mov dx, ss ; 8c d2
lea ax, [bp-004h] ; 8d 46 fc
call 06e51h ; e8 e6 fd
mov cl, al ; 88 c1
cmp byte [bp-004h], 0feh ; 80 7e fc fe
jne short 0707eh ; 75 0b
or word [bp+018h], strict byte 00001h ; 83 4e 18 01
mov byte [bp+013h], 004h ; c6 46 13 04
jmp near 07307h ; e9 89 02
cmp byte [bp-004h], 0fah ; 80 7e fc fa
je short 07094h ; 74 10
movzx ax, byte [bp-004h] ; 0f b6 46 fc
push ax ; 50
push 0090bh ; 68 0b 09
push strict byte 00007h ; 6a 07
call 01972h ; e8 e1 a8
add sp, strict byte 00006h ; 83 c4 06
test cl, cl ; 84 c9
jne near 0728dh ; 0f 85 f3 01
mov dx, ss ; 8c d2
lea ax, [bp-008h] ; 8d 46 f8
call 06e51h ; e8 af fd
test al, al ; 84 c0
jne near 0728dh ; 0f 85 e5 01
mov dx, ss ; 8c d2
lea ax, [bp-006h] ; 8d 46 fa
call 06e51h ; e8 a1 fd
test al, al ; 84 c0
jne near 0728dh ; 0f 85 d7 01
mov al, byte [bp-008h] ; 8a 46 f8
mov byte [bp+00ch], al ; 88 46 0c
mov al, byte [bp-006h] ; 8a 46 fa
mov byte [bp+00dh], al ; 88 46 0d
jmp near 07307h ; e9 42 02
mov al, byte [bp+00dh] ; 8a 46 0d
cmp AL, strict byte 003h ; 3c 03
jc short 070dch ; 72 10
jbe short 070fah ; 76 2c
cmp AL, strict byte 006h ; 3c 06
je short 0710ch ; 74 3a
cmp AL, strict byte 005h ; 3c 05
je short 07106h ; 74 30
cmp AL, strict byte 004h ; 3c 04
je short 07100h ; 74 26
jmp short 07112h ; eb 36
cmp AL, strict byte 002h ; 3c 02
je short 070f4h ; 74 14
cmp AL, strict byte 001h ; 3c 01
je short 070eeh ; 74 0a
test al, al ; 84 c0
jne short 07112h ; 75 2a
mov byte [bp-008h], 00ah ; c6 46 f8 0a
jmp short 07116h ; eb 28
mov byte [bp-008h], 014h ; c6 46 f8 14
jmp short 07116h ; eb 22
mov byte [bp-008h], 028h ; c6 46 f8 28
jmp short 07116h ; eb 1c
mov byte [bp-008h], 03ch ; c6 46 f8 3c
jmp short 07116h ; eb 16
mov byte [bp-008h], 050h ; c6 46 f8 50
jmp short 07116h ; eb 10
mov byte [bp-008h], 064h ; c6 46 f8 64
jmp short 07116h ; eb 0a
mov byte [bp-008h], 0c8h ; c6 46 f8 c8
jmp short 07116h ; eb 04
mov byte [bp-008h], 000h ; c6 46 f8 00
cmp byte [bp-008h], 000h ; 80 7e f8 00
jbe short 0714bh ; 76 2f
mov ax, 000f3h ; b8 f3 00
call 06e1dh ; e8 fb fc
test al, al ; 84 c0
jne short 07140h ; 75 1a
mov dx, ss ; 8c d2
lea ax, [bp-006h] ; 8d 46 fa
call 06e51h ; e8 23 fd
movzx ax, byte [bp-008h] ; 0f b6 46 f8
call 06e1dh ; e8 e8 fc
mov dx, ss ; 8c d2
lea ax, [bp-006h] ; 8d 46 fa
call 06e51h ; e8 14 fd
jmp near 07307h ; e9 c7 01
or word [bp+018h], strict byte 00001h ; 83 4e 18 01
mov byte [bp+013h], 003h ; c6 46 13 03
jmp near 07307h ; e9 bc 01
or word [bp+018h], strict byte 00001h ; 83 4e 18 01
mov byte [bp+013h], 002h ; c6 46 13 02
jmp near 07307h ; e9 b1 01
cmp byte [bp+00dh], 004h ; 80 7e 0d 04
jnc short 071b9h ; 73 5d
mov ax, 000e8h ; b8 e8 00
call 06e1dh ; e8 bb fc
test al, al ; 84 c0
jne short 071aeh ; 75 48
mov dx, ss ; 8c d2
lea ax, [bp-008h] ; 8d 46 f8
call 06e51h ; e8 e3 fc
cmp byte [bp-008h], 0fah ; 80 7e f8 fa
je short 07184h ; 74 10
movzx ax, byte [bp-008h] ; 0f b6 46 f8
push ax ; 50
push 00936h ; 68 36 09
push strict byte 00007h ; 6a 07
call 01972h ; e8 f1 a7
add sp, strict byte 00006h ; 83 c4 06
movzx ax, byte [bp+00dh] ; 0f b6 46 0d
call 06e1dh ; e8 92 fc
mov dx, ss ; 8c d2
lea ax, [bp-008h] ; 8d 46 f8
call 06e51h ; e8 be fc
cmp byte [bp-008h], 0fah ; 80 7e f8 fa
je near 07307h ; 0f 84 6c 01
movzx ax, byte [bp-008h] ; 0f b6 46 f8
push ax ; 50
push 00936h ; 68 36 09
push strict byte 00007h ; 6a 07
call 01972h ; e8 ca a7
add sp, strict byte 00006h ; 83 c4 06
jmp near 07307h ; e9 59 01
or word [bp+018h], strict byte 00001h ; 83 4e 18 01
mov byte [bp+013h], 003h ; c6 46 13 03
jmp near 07307h ; e9 4e 01
or word [bp+018h], strict byte 00001h ; 83 4e 18 01
mov byte [bp+013h], 002h ; c6 46 13 02
jmp near 07307h ; e9 43 01
mov ax, 000f2h ; b8 f2 00
call 06e1dh ; e8 53 fc
test al, al ; 84 c0
jne short 071e1h ; 75 13
mov dx, ss ; 8c d2
lea ax, [bp-008h] ; 8d 46 f8
call 06e51h ; e8 7b fc
mov dx, ss ; 8c d2
lea ax, [bp-006h] ; 8d 46 fa
call 06e51h ; e8 73 fc
jmp near 070bch ; e9 db fe
or word [bp+018h], strict byte 00001h ; 83 4e 18 01
mov byte [bp+013h], 003h ; c6 46 13 03
jmp near 07307h ; e9 1b 01
mov al, byte [bp+00dh] ; 8a 46 0d
test al, al ; 84 c0
jbe short 071fah ; 76 07
cmp AL, strict byte 002h ; 3c 02
jbe short 07263h ; 76 6c
jmp near 07297h ; e9 9d 00
mov ax, 000e9h ; b8 e9 00
call 06e1dh ; e8 1d fc
test al, al ; 84 c0
jne near 0728dh ; 0f 85 87 00
mov dx, ss ; 8c d2
lea ax, [bp-008h] ; 8d 46 f8
call 06e51h ; e8 43 fc
mov cl, al ; 88 c1
cmp byte [bp-008h], 0fah ; 80 7e f8 fa
je short 07226h ; 74 10
movzx ax, byte [bp-008h] ; 0f b6 46 f8
push ax ; 50
push 00936h ; 68 36 09
push strict byte 00007h ; 6a 07
call 01972h ; e8 4f a7
add sp, strict byte 00006h ; 83 c4 06
test cl, cl ; 84 c9
jne short 0728dh ; 75 63
mov dx, ss ; 8c d2
lea ax, [bp-008h] ; 8d 46 f8
call 06e51h ; e8 1f fc
test al, al ; 84 c0
jne short 0728dh ; 75 57
mov dx, ss ; 8c d2
lea ax, [bp-006h] ; 8d 46 fa
call 06e51h ; e8 13 fc
test al, al ; 84 c0
jne short 0728dh ; 75 4b
mov dx, ss ; 8c d2
lea ax, [bp-004h] ; 8d 46 fc
call 06e51h ; e8 07 fc
test al, al ; 84 c0
jne short 0728dh ; 75 3f
mov al, byte [bp-008h] ; 8a 46 f8
mov byte [bp+00ch], al ; 88 46 0c
mov al, byte [bp-006h] ; 8a 46 fa
mov byte [bp+010h], al ; 88 46 10
mov al, byte [bp-004h] ; 8a 46 fc
mov byte [bp+00eh], al ; 88 46 0e
jmp near 07307h ; e9 a4 00
cmp AL, strict byte 001h ; 3c 01
jne short 0726ch ; 75 05
mov ax, 000e6h ; b8 e6 00
jmp short 0726fh ; eb 03
mov ax, 000e7h ; b8 e7 00
call 06e1dh ; e8 ab fb
mov cl, al ; 88 c1
test cl, cl ; 84 c9
jne short 07287h ; 75 0f
mov dx, ss ; 8c d2
lea ax, [bp-008h] ; 8d 46 f8
call 06e51h ; e8 d1 fb
cmp byte [bp-008h], 0fah ; 80 7e f8 fa
db 00fh, 095h, 0c1h
; setne cl ; 0f 95 c1
test cl, cl ; 84 c9
je near 07307h ; 0f 84 7a 00
or word [bp+018h], strict byte 00001h ; 83 4e 18 01
mov byte [bp+013h], 003h ; c6 46 13 03
jmp short 07307h ; eb 70
movzx ax, byte [bp+00dh] ; 0f b6 46 0d
push ax ; 50
push 00962h ; 68 62 09
push strict byte 00007h ; 6a 07
call 01972h ; e8 ce a6
add sp, strict byte 00006h ; 83 c4 06
or word [bp+018h], strict byte 00001h ; 83 4e 18 01
mov byte [bp+013h], 001h ; c6 46 13 01
jmp short 07307h ; eb 56
mov si, word [bp+00ch] ; 8b 76 0c
mov bx, si ; 89 f3
mov dx, strict word 00022h ; ba 22 00
mov ax, cx ; 89 c8
call 0167ah ; e8 bc a3
mov bx, word [bp+014h] ; 8b 5e 14
mov dx, strict word 00024h ; ba 24 00
mov ax, cx ; 89 c8
call 0167ah ; e8 b1 a3
mov dx, strict word 00027h ; ba 27 00
mov ax, cx ; 89 c8
call 01650h ; e8 7f a3
mov ah, al ; 88 c4
test si, si ; 85 f6
jne short 072e5h ; 75 0e
cmp word [bp+014h], strict byte 00000h ; 83 7e 14 00
jne short 072e5h ; 75 08
test AL, strict byte 080h ; a8 80
je short 072e7h ; 74 06
and AL, strict byte 07fh ; 24 7f
jmp short 072e7h ; eb 02
or AL, strict byte 080h ; 0c 80
movzx bx, al ; 0f b6 d8
mov dx, strict word 00027h ; ba 27 00
mov ax, cx ; 89 c8
call 0165eh ; e8 6c a3
jmp short 07307h ; eb 13
push 0097ch ; 68 7c 09
push strict byte 00007h ; 6a 07
call 01972h ; e8 76 a6
add sp, strict byte 00004h ; 83 c4 04
or word [bp+018h], strict byte 00001h ; 83 4e 18 01
mov byte [bp+013h], 001h ; c6 46 13 01
mov ax, strict word 00047h ; b8 47 00
call 06e8ch ; e8 7f fb
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn ; c3
_int17_function: ; 0xf7313 LB 0xb3
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push ax ; 50
sti ; fb
mov dx, word [bp+00eh] ; 8b 56 0e
add dx, dx ; 01 d2
add dx, strict byte 00008h ; 83 c2 08
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 45 a3
mov bx, ax ; 89 c3
mov si, ax ; 89 c6
cmp byte [bp+013h], 003h ; 80 7e 13 03
jnc near 073bch ; 0f 83 89 00
mov ax, word [bp+00eh] ; 8b 46 0e
cmp ax, strict word 00003h ; 3d 03 00
jnc near 073bch ; 0f 83 7f 00
test bx, bx ; 85 db
jbe near 073bch ; 0f 86 79 00
mov dx, ax ; 89 c2
add dx, strict byte 00078h ; 83 c2 78
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 02 a3
movzx cx, al ; 0f b6 c8
sal cx, 008h ; c1 e1 08
cmp byte [bp+013h], 000h ; 80 7e 13 00
jne short 07387h ; 75 2d
mov al, byte [bp+012h] ; 8a 46 12
mov dx, bx ; 89 da
out DX, AL ; ee
lea dx, [bx+002h] ; 8d 57 02
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-004h], ax ; 89 46 fc
mov al, byte [bp-004h] ; 8a 46 fc
or AL, strict byte 001h ; 0c 01
out DX, AL ; ee
movzx ax, byte [bp-004h] ; 0f b6 46 fc
and AL, strict byte 0feh ; 24 fe
out DX, AL ; ee
lea dx, [si+001h] ; 8d 54 01
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 040h ; a8 40
je short 07387h ; 74 07
test cx, cx ; 85 c9
je short 07387h ; 74 03
dec cx ; 49
jmp short 07376h ; eb ef
cmp byte [bp+013h], 001h ; 80 7e 13 01
jne short 073a3h ; 75 16
lea dx, [si+002h] ; 8d 54 02
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-004h], ax ; 89 46 fc
movzx ax, byte [bp-004h] ; 0f b6 46 fc
and AL, strict byte 0fbh ; 24 fb
out DX, AL ; ee
mov al, byte [bp-004h] ; 8a 46 fc
or AL, strict byte 004h ; 0c 04
out DX, AL ; ee
lea dx, [si+001h] ; 8d 54 01
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor AL, strict byte 048h ; 34 48
mov byte [bp+013h], al ; 88 46 13
test cx, cx ; 85 c9
jne short 073b6h ; 75 04
or byte [bp+013h], 001h ; 80 4e 13 01
and byte [bp+01ch], 0feh ; 80 66 1c fe
jmp short 073c0h ; eb 04
or byte [bp+01ch], 001h ; 80 4e 1c 01
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn ; c3
wait_: ; 0xf73c6 LB 0xb2
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
sub sp, strict byte 0000ah ; 83 ec 0a
mov si, ax ; 89 c6
mov byte [bp-00ch], dl ; 88 56 f4
mov byte [bp-00ah], 000h ; c6 46 f6 00
pushfw ; 9c
pop ax ; 58
mov word [bp-010h], ax ; 89 46 f0
sti ; fb
xor cx, cx ; 31 c9
mov dx, 0046ch ; ba 6c 04
xor ax, ax ; 31 c0
call 01688h ; e8 9f a2
mov word [bp-00eh], ax ; 89 46 f2
mov bx, dx ; 89 d3
hlt ; f4
mov dx, 0046ch ; ba 6c 04
xor ax, ax ; 31 c0
call 01688h ; e8 91 a2
mov word [bp-012h], ax ; 89 46 ee
mov di, dx ; 89 d7
cmp dx, bx ; 39 da
jnbe short 07407h ; 77 07
jne short 0740eh ; 75 0c
cmp ax, word [bp-00eh] ; 3b 46 f2
jbe short 0740eh ; 76 07
sub ax, word [bp-00eh] ; 2b 46 f2
sbb dx, bx ; 19 da
jmp short 07419h ; eb 0b
cmp dx, bx ; 39 da
jc short 07419h ; 72 07
jne short 0741dh ; 75 09
cmp ax, word [bp-00eh] ; 3b 46 f2
jnc short 0741dh ; 73 04
sub si, ax ; 29 c6
sbb cx, dx ; 19 d1
mov ax, word [bp-012h] ; 8b 46 ee
mov word [bp-00eh], ax ; 89 46 f2
mov bx, di ; 89 fb
mov ax, 00100h ; b8 00 01
int 016h ; cd 16
je near 07433h ; 0f 84 05 00
mov AL, strict byte 001h ; b0 01
jmp near 07435h ; e9 02 00
db 032h, 0c0h
; xor al, al ; 32 c0
test al, al ; 84 c0
je short 0745dh ; 74 24
db 033h, 0c0h
; xor ax, ax ; 33 c0
int 016h ; cd 16
xchg ah, al ; 86 c4
mov dl, al ; 88 c2
mov byte [bp-00ah], al ; 88 46 f6
movzx ax, dl ; 0f b6 c2
push ax ; 50
push 0099eh ; 68 9e 09
push strict byte 00004h ; 6a 04
call 01972h ; e8 22 a5
add sp, strict byte 00006h ; 83 c4 06
cmp byte [bp-00ch], 000h ; 80 7e f4 00
je short 0745dh ; 74 04
mov al, dl ; 88 d0
jmp short 0746fh ; eb 12
test cx, cx ; 85 c9
jnle short 073eeh ; 7f 8d
jne short 07467h ; 75 04
test si, si ; 85 f6
jnbe short 073eeh ; 77 87
mov ax, word [bp-010h] ; 8b 46 f0
push ax ; 50
popfw ; 9d
mov al, byte [bp-00ah] ; 8a 46 f6
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
read_logo_byte_: ; 0xf7478 LB 0x16
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
xor ah, ah ; 30 e4
or ah, 001h ; 80 cc 01
mov dx, 003b8h ; ba b8 03
out DX, ax ; ef
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
read_logo_word_: ; 0xf748e LB 0x14
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
xor ah, ah ; 30 e4
or ah, 001h ; 80 cc 01
mov dx, 003b8h ; ba b8 03
out DX, ax ; ef
in ax, DX ; ed
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
print_detected_harddisks_: ; 0xf74a2 LB 0x130
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 dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 b7 a1
mov si, ax ; 89 c6
mov byte [bp-00ch], 000h ; c6 46 f4 00
xor cl, cl ; 30 c9
xor ch, ch ; 30 ed
mov dx, 002c0h ; ba c0 02
call 01650h ; e8 8b a1
mov byte [bp-00eh], al ; 88 46 f2
xor bl, bl ; 30 db
cmp bl, byte [bp-00eh] ; 3a 5e f2
jnc near 075a4h ; 0f 83 d3 00
movzx dx, bl ; 0f b6 d3
add dx, 002c1h ; 81 c2 c1 02
mov ax, si ; 89 f0
call 01650h ; e8 73 a1
mov bh, al ; 88 c7
cmp AL, strict byte 00ch ; 3c 0c
jc short 07507h ; 72 24
test cl, cl ; 84 c9
jne short 074f4h ; 75 0d
push 009afh ; 68 af 09
push strict byte 00002h ; 6a 02
call 01972h ; e8 83 a4
add sp, strict byte 00004h ; 83 c4 04
mov CL, strict byte 001h ; b1 01
movzx ax, bl ; 0f b6 c3
inc ax ; 40
push ax ; 50
push 009c4h ; 68 c4 09
push strict byte 00002h ; 6a 02
call 01972h ; e8 71 a4
add sp, strict byte 00006h ; 83 c4 06
jmp near 0759fh ; e9 98 00
cmp AL, strict byte 008h ; 3c 08
jc short 0751eh ; 72 13
test ch, ch ; 84 ed
jne short 0751ch ; 75 0d
push 009d7h ; 68 d7 09
push strict byte 00002h ; 6a 02
call 01972h ; e8 5b a4
add sp, strict byte 00004h ; 83 c4 04
mov CH, strict byte 001h ; b5 01
jmp short 074f4h ; eb d6
cmp AL, strict byte 004h ; 3c 04
jnc short 07539h ; 73 17
cmp byte [bp-00ch], 000h ; 80 7e f4 00
jne short 07539h ; 75 11
push 009ech ; 68 ec 09
push strict byte 00002h ; 6a 02
call 01972h ; e8 42 a4
add sp, strict byte 00004h ; 83 c4 04
mov byte [bp-00ch], 001h ; c6 46 f4 01
jmp short 0754fh ; eb 16
cmp bh, 004h ; 80 ff 04
jc short 0754fh ; 72 11
test cl, cl ; 84 c9
jne short 0754fh ; 75 0d
push 009feh ; 68 fe 09
push strict byte 00002h ; 6a 02
call 01972h ; e8 28 a4
add sp, strict byte 00004h ; 83 c4 04
mov CL, strict byte 001h ; b1 01
movzx ax, bl ; 0f b6 c3
inc ax ; 40
push ax ; 50
push 00a12h ; 68 12 0a
push strict byte 00002h ; 6a 02
call 01972h ; e8 16 a4
add sp, strict byte 00006h ; 83 c4 06
cmp bh, 004h ; 80 ff 04
jc short 07567h ; 72 03
sub bh, 004h ; 80 ef 04
movzx ax, bh ; 0f b6 c7
cwd ; 99
db 02bh, 0c2h
; sub ax, dx ; 2b c2
sar ax, 1 ; d1 f8
test ax, ax ; 85 c0
je short 07578h ; 74 05
push 00a1ch ; 68 1c 0a
jmp short 0757bh ; eb 03
push 00a27h ; 68 27 0a
push strict byte 00002h ; 6a 02
call 01972h ; e8 f2 a3
add sp, strict byte 00004h ; 83 c4 04
movzx ax, bh ; 0f b6 c7
mov di, strict word 00002h ; bf 02 00
cwd ; 99
idiv di ; f7 ff
test dx, dx ; 85 d2
je short 07595h ; 74 05
push 00a30h ; 68 30 0a
jmp short 07598h ; eb 03
push 00a36h ; 68 36 0a
push di ; 57
call 01972h ; e8 d6 a3
add sp, strict byte 00004h ; 83 c4 04
db 0feh, 0c3h
; inc bl ; fe c3
jmp near 074cah ; e9 26 ff
cmp byte [bp-00ch], 000h ; 80 7e f4 00
jne short 075bdh ; 75 13
test cl, cl ; 84 c9
jne short 075bdh ; 75 0f
test ch, ch ; 84 ed
jne short 075bdh ; 75 0b
push 00a3dh ; 68 3d 0a
push strict byte 00002h ; 6a 02
call 01972h ; e8 b8 a3
add sp, strict byte 00004h ; 83 c4 04
push 00a51h ; 68 51 0a
push strict byte 00002h ; 6a 02
call 01972h ; e8 ad a3
add sp, strict byte 00004h ; 83 c4 04
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
get_boot_drive_: ; 0xf75d2 LB 0x28
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bl, al ; 88 c3
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 8a a0
mov dx, 002c0h ; ba c0 02
call 01650h ; e8 68 a0
sub bl, 002h ; 80 eb 02
cmp bl, al ; 38 c3
jc short 075f1h ; 72 02
mov BL, strict byte 0ffh ; b3 ff
mov al, bl ; 88 d8
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
show_logo_: ; 0xf75fa LB 0x224
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 0000ch ; 83 ec 0c
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 5e a0
mov si, ax ; 89 c6
xor cl, cl ; 30 c9
xor dx, dx ; 31 d2
mov AL, strict byte 034h ; b0 34
out strict byte 043h, AL ; e6 43
mov AL, strict byte 0d3h ; b0 d3
out strict byte 040h, AL ; e6 40
mov AL, strict byte 048h ; b0 48
out strict byte 040h, AL ; e6 40
movzx ax, dl ; 0f b6 c2
call 0748eh ; e8 68 fe
cmp ax, 066bbh ; 3d bb 66
jne near 076feh ; 0f 85 d1 00
push SS ; 16
pop ES ; 07
lea di, [bp-016h] ; 8d 7e ea
mov ax, 04f03h ; b8 03 4f
int 010h ; cd 10
mov word [es:di], bx ; 26 89 1d
cmp ax, strict word 0004fh ; 3d 4f 00
jne near 076feh ; 0f 85 bd 00
mov al, dl ; 88 d0
add AL, strict byte 004h ; 04 04
xor ah, ah ; 30 e4
call 07478h ; e8 2e fe
mov ch, al ; 88 c5
mov byte [bp-00ch], al ; 88 46 f4
mov al, dl ; 88 d0
add AL, strict byte 005h ; 04 05
xor ah, ah ; 30 e4
call 07478h ; e8 20 fe
mov dh, al ; 88 c6
mov byte [bp-010h], al ; 88 46 f0
mov al, dl ; 88 d0
add AL, strict byte 002h ; 04 02
xor ah, ah ; 30 e4
call 0748eh ; e8 28 fe
mov bx, ax ; 89 c3
mov word [bp-014h], ax ; 89 46 ec
mov al, dl ; 88 d0
add AL, strict byte 006h ; 04 06
xor ah, ah ; 30 e4
call 07478h ; e8 04 fe
mov byte [bp-012h], al ; 88 46 ee
test ch, ch ; 84 ed
jne short 07685h ; 75 0a
test dh, dh ; 84 f6
jne short 07685h ; 75 06
test bx, bx ; 85 db
je near 076feh ; 0f 84 79 00
mov bx, 00142h ; bb 42 01
mov ax, 04f02h ; b8 02 4f
int 010h ; cd 10
cmp byte [bp-00ch], 000h ; 80 7e f4 00
je short 076b6h ; 74 23
xor bx, bx ; 31 db
jmp short 0769dh ; eb 06
inc bx ; 43
cmp bx, strict byte 00010h ; 83 fb 10
jnbe short 076bdh ; 77 20
mov ax, bx ; 89 d8
or ah, 002h ; 80 cc 02
mov dx, 003b8h ; ba b8 03
out DX, ax ; ef
xor dx, dx ; 31 d2
mov ax, strict word 00001h ; b8 01 00
call 073c6h ; e8 18 fd
cmp AL, strict byte 086h ; 3c 86
jne short 07697h ; 75 e5
mov CL, strict byte 001h ; b1 01
jmp short 076bdh ; eb 07
mov ax, 00210h ; b8 10 02
mov dx, 003b8h ; ba b8 03
out DX, ax ; ef
test cl, cl ; 84 c9
jne short 076d3h ; 75 12
mov ax, word [bp-014h] ; 8b 46 ec
shr ax, 004h ; c1 e8 04
mov dx, strict word 00001h ; ba 01 00
call 073c6h ; e8 f9 fc
cmp AL, strict byte 086h ; 3c 86
jne short 076d3h ; 75 02
mov CL, strict byte 001h ; b1 01
cmp byte [bp-010h], 000h ; 80 7e f0 00
je short 076feh ; 74 25
test cl, cl ; 84 c9
jne short 076feh ; 75 21
mov bx, strict word 00010h ; bb 10 00
jmp short 076e7h ; eb 05
dec bx ; 4b
test bx, bx ; 85 db
jbe short 076feh ; 76 17
mov ax, bx ; 89 d8
or ah, 002h ; 80 cc 02
mov dx, 003b8h ; ba b8 03
out DX, ax ; ef
xor dx, dx ; 31 d2
mov ax, strict word 00001h ; b8 01 00
call 073c6h ; e8 ce fc
cmp AL, strict byte 086h ; 3c 86
jne short 076e2h ; 75 e6
mov CL, strict byte 001h ; b1 01
xor bx, bx ; 31 db
mov dx, 00339h ; ba 39 03
mov ax, si ; 89 f0
call 0165eh ; e8 56 9f
mov AL, strict byte 003h ; b0 03
mov AH, strict byte 000h ; b4 00
int 010h ; cd 10
cmp byte [bp-012h], 000h ; 80 7e ee 00
je near 077ffh ; 0f 84 e9 00
cmp byte [bp-00ch], 000h ; 80 7e f4 00
jne short 0774ch ; 75 30
cmp byte [bp-010h], 000h ; 80 7e f0 00
jne short 0774ch ; 75 2a
cmp word [bp-014h], strict byte 00000h ; 83 7e ec 00
jne short 0774ch ; 75 24
cmp byte [bp-012h], 002h ; 80 7e ee 02
jne short 07739h ; 75 0b
push 00a53h ; 68 53 0a
push strict byte 00002h ; 6a 02
call 01972h ; e8 3c a2
add sp, strict byte 00004h ; 83 c4 04
test cl, cl ; 84 c9
jne short 0774ch ; 75 0f
mov dx, strict word 00001h ; ba 01 00
mov ax, 000c0h ; b8 c0 00
call 073c6h ; e8 80 fc
cmp AL, strict byte 086h ; 3c 86
jne short 0774ch ; 75 02
mov CL, strict byte 001h ; b1 01
test cl, cl ; 84 c9
je near 077ffh ; 0f 84 ad 00
mov byte [bp-00eh], 000h ; c6 46 f2 00
mov ax, 00100h ; b8 00 01
mov cx, 01000h ; b9 00 10
int 010h ; cd 10
mov ax, 00700h ; b8 00 07
mov BH, strict byte 007h ; b7 07
db 033h, 0c9h
; xor cx, cx ; 33 c9
mov dx, 0184fh ; ba 4f 18
int 010h ; cd 10
mov ax, 00200h ; b8 00 02
db 033h, 0dbh
; xor bx, bx ; 33 db
db 033h, 0d2h
; xor dx, dx ; 33 d2
int 010h ; cd 10
push 00a75h ; 68 75 0a
push strict byte 00002h ; 6a 02
call 01972h ; e8 f7 a1
add sp, strict byte 00004h ; 83 c4 04
call 074a2h ; e8 21 fd
push 00ab9h ; 68 b9 0a
push strict byte 00002h ; 6a 02
call 01972h ; e8 e9 a1
add sp, strict byte 00004h ; 83 c4 04
mov dx, strict word 00001h ; ba 01 00
mov ax, strict word 00040h ; b8 40 00
call 073c6h ; e8 31 fc
mov bl, al ; 88 c3
test al, al ; 84 c0
je short 0778ch ; 74 f1
cmp AL, strict byte 030h ; 3c 30
je short 077edh ; 74 4e
cmp bl, 002h ; 80 fb 02
jc short 077c6h ; 72 22
cmp bl, 009h ; 80 fb 09
jnbe short 077c6h ; 77 1d
movzx ax, bl ; 0f b6 c3
call 075d2h ; e8 23 fe
cmp AL, strict byte 0ffh ; 3c ff
jne short 077b5h ; 75 02
jmp short 0778ch ; eb d7
movzx bx, al ; 0f b6 d8
mov dx, 00338h ; ba 38 03
mov ax, si ; 89 f0
call 0165eh ; e8 9e 9e
mov byte [bp-00eh], 002h ; c6 46 f2 02
jmp short 077edh ; eb 27
cmp bl, 02eh ; 80 fb 2e
je short 077dbh ; 74 10
cmp bl, 026h ; 80 fb 26
je short 077e1h ; 74 11
cmp bl, 021h ; 80 fb 21
jne short 077e7h ; 75 12
mov byte [bp-00eh], 001h ; c6 46 f2 01
jmp short 077edh ; eb 12
mov byte [bp-00eh], 003h ; c6 46 f2 03
jmp short 077edh ; eb 0c
mov byte [bp-00eh], 004h ; c6 46 f2 04
jmp short 077edh ; eb 06
cmp byte [bp-00eh], 000h ; 80 7e f2 00
je short 0778ch ; 74 9f
movzx bx, byte [bp-00eh] ; 0f b6 5e f2
mov dx, 00339h ; ba 39 03
mov ax, si ; 89 f0
call 0165eh ; e8 65 9e
mov AL, strict byte 003h ; b0 03
mov AH, strict byte 000h ; b4 00
int 010h ; cd 10
mov AL, strict byte 034h ; b0 34
out strict byte 043h, AL ; e6 43
db 033h, 0c0h
; xor ax, ax ; 33 c0
out strict byte 040h, AL ; e6 40
out strict byte 040h, AL ; e6 40
pushad ; 66 60
push DS ; 1e
mov ds, ax ; 8e d8
call 0edbfh ; e8 ae 75
pop DS ; 1f
popad ; 66 61
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
delay_boot_: ; 0xf781e LB 0x67
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov dx, ax ; 89 c2
test ax, ax ; 85 c0
je short 0787eh ; 74 55
mov AL, strict byte 034h ; b0 34
out strict byte 043h, AL ; e6 43
mov AL, strict byte 0d3h ; b0 d3
out strict byte 040h, AL ; e6 40
mov AL, strict byte 048h ; b0 48
out strict byte 040h, AL ; e6 40
push dx ; 52
push 00b03h ; 68 03 0b
push strict byte 00002h ; 6a 02
call 01972h ; e8 34 a1
add sp, strict byte 00006h ; 83 c4 06
mov bx, dx ; 89 d3
test bx, bx ; 85 db
jbe short 0785eh ; 76 17
push bx ; 53
push 00b21h ; 68 21 0b
push strict byte 00002h ; 6a 02
call 01972h ; e8 22 a1
add sp, strict byte 00006h ; 83 c4 06
xor dx, dx ; 31 d2
mov ax, strict word 00040h ; b8 40 00
call 073c6h ; e8 6b fb
dec bx ; 4b
jmp short 07843h ; eb e5
push 00a51h ; 68 51 0a
push strict byte 00002h ; 6a 02
call 01972h ; e8 0c a1
add sp, strict byte 00004h ; 83 c4 04
mov AL, strict byte 034h ; b0 34
out strict byte 043h, AL ; e6 43
db 033h, 0c0h
; xor ax, ax ; 33 c0
out strict byte 040h, AL ; e6 40
out strict byte 040h, AL ; e6 40
pushad ; 66 60
push DS ; 1e
mov ds, ax ; 8e d8
call 0edbfh ; e8 44 75
pop DS ; 1f
popad ; 66 61
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
scsi_cmd_data_in_: ; 0xf7885 LB 0xc9
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 byte [bp-006h], dl ; 88 56 fa
mov word [bp-008h], bx ; 89 5e f8
mov word [bp-00ah], cx ; 89 4e f6
mov bx, word [bp+00ah] ; 8b 5e 0a
mov dx, si ; 89 f2
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 0789bh ; 75 f7
mov ax, bx ; 89 d8
mov dx, word [bp+00ch] ; 8b 56 0c
mov cx, strict word 0000ch ; b9 0c 00
shr dx, 1 ; d1 ea
rcr ax, 1 ; d1 d8
loop 078ach ; e2 fa
and ax, 000f0h ; 25 f0 00
movzx cx, byte [bp+004h] ; 0f b6 4e 04
or cx, ax ; 09 c1
mov al, byte [bp-006h] ; 8a 46 fa
mov dx, si ; 89 f2
out DX, AL ; ee
xor al, al ; 30 c0
out DX, AL ; ee
mov al, cl ; 88 c8
out DX, AL ; ee
mov al, bl ; 88 d8
out DX, AL ; ee
mov ax, bx ; 89 d8
mov dx, word [bp+00ch] ; 8b 56 0c
mov cx, strict word 00008h ; b9 08 00
shr dx, 1 ; d1 ea
rcr ax, 1 ; d1 d8
loop 078d2h ; e2 fa
mov dx, si ; 89 f2
out DX, AL ; ee
xor cx, cx ; 31 c9
movzx ax, byte [bp+004h] ; 0f b6 46 04
cmp cx, ax ; 39 c1
jnc short 078f6h ; 73 11
mov es, [bp-00ah] ; 8e 46 f6
mov di, word [bp-008h] ; 8b 7e f8
add di, cx ; 01 cf
mov al, byte [es:di] ; 26 8a 05
mov dx, si ; 89 f2
out DX, AL ; ee
inc cx ; 41
jmp short 078ddh ; eb e7
mov dx, si ; 89 f2
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 078f6h ; 75 f7
test AL, strict byte 002h ; a8 02
je short 07911h ; 74 0e
lea dx, [si+003h] ; 8d 54 03
xor al, al ; 30 c0
out DX, AL ; ee
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov di, strict word 00004h ; bf 04 00
jmp short 07943h ; eb 32
lea dx, [si+001h] ; 8d 54 01
cmp word [bp+00ch], strict byte 00000h ; 83 7e 0c 00
jne short 07920h ; 75 06
cmp bx, 08000h ; 81 fb 00 80
jbe short 0793ah ; 76 1a
mov cx, 08000h ; b9 00 80
les di, [bp+006h] ; c4 7e 06
rep insb ; f3 6c
add bx, 08000h ; 81 c3 00 80
adc word [bp+00ch], strict byte 0ffffh ; 83 56 0c ff
mov ax, es ; 8c c0
add ax, 00800h ; 05 00 08
mov word [bp+008h], ax ; 89 46 08
jmp short 07911h ; eb d7
mov cx, bx ; 89 d9
les di, [bp+006h] ; c4 7e 06
rep insb ; f3 6c
xor di, di ; 31 ff
mov ax, di ; 89 f8
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 0000ah ; c2 0a 00
scsi_cmd_data_out_: ; 0xf794e LB 0xc9
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00006h ; 83 ec 06
mov di, ax ; 89 c7
mov byte [bp-006h], dl ; 88 56 fa
mov word [bp-008h], bx ; 89 5e f8
mov word [bp-00ah], cx ; 89 4e f6
mov bx, word [bp+00ah] ; 8b 5e 0a
mov dx, di ; 89 fa
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 07964h ; 75 f7
mov ax, bx ; 89 d8
mov dx, word [bp+00ch] ; 8b 56 0c
mov cx, strict word 0000ch ; b9 0c 00
shr dx, 1 ; d1 ea
rcr ax, 1 ; d1 d8
loop 07975h ; e2 fa
and ax, 000f0h ; 25 f0 00
movzx cx, byte [bp+004h] ; 0f b6 4e 04
or cx, ax ; 09 c1
mov al, byte [bp-006h] ; 8a 46 fa
mov dx, di ; 89 fa
out DX, AL ; ee
mov AL, strict byte 001h ; b0 01
out DX, AL ; ee
mov al, cl ; 88 c8
out DX, AL ; ee
mov al, bl ; 88 d8
out DX, AL ; ee
mov ax, bx ; 89 d8
mov dx, word [bp+00ch] ; 8b 56 0c
mov cx, strict word 00008h ; b9 08 00
shr dx, 1 ; d1 ea
rcr ax, 1 ; d1 d8
loop 0799bh ; e2 fa
mov dx, di ; 89 fa
out DX, AL ; ee
xor cx, cx ; 31 c9
movzx ax, byte [bp+004h] ; 0f b6 46 04
cmp cx, ax ; 39 c1
jnc short 079bfh ; 73 11
mov es, [bp-00ah] ; 8e 46 f6
mov si, word [bp-008h] ; 8b 76 f8
add si, cx ; 01 ce
mov al, byte [es:si] ; 26 8a 04
mov dx, di ; 89 fa
out DX, AL ; ee
inc cx ; 41
jmp short 079a6h ; eb e7
lea dx, [di+001h] ; 8d 55 01
cmp word [bp+00ch], strict byte 00000h ; 83 7e 0c 00
jne short 079ceh ; 75 06
cmp bx, 08000h ; 81 fb 00 80
jbe short 079e9h ; 76 1b
mov cx, 08000h ; b9 00 80
les si, [bp+006h] ; c4 76 06
db 0f3h, 026h, 06eh
; rep es outsb ; f3 26 6e
add bx, 08000h ; 81 c3 00 80
adc word [bp+00ch], strict byte 0ffffh ; 83 56 0c ff
mov ax, es ; 8c c0
add ax, 00800h ; 05 00 08
mov word [bp+008h], ax ; 89 46 08
jmp short 079bfh ; eb d6
mov cx, bx ; 89 d9
les si, [bp+006h] ; c4 76 06
db 0f3h, 026h, 06eh
; rep es outsb ; f3 26 6e
mov dx, di ; 89 fa
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 079f1h ; 75 f7
test AL, strict byte 002h ; a8 02
je short 07a0ch ; 74 0e
lea dx, [di+003h] ; 8d 55 03
xor al, al ; 30 c0
out DX, AL ; ee
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov ax, strict word 00004h ; b8 04 00
jmp short 07a0eh ; eb 02
xor ax, ax ; 31 c0
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 0000ah ; c2 0a 00
@scsi_read_sectors: ; 0xf7a17 LB 0xb9
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000eh ; 83 ec 0e
mov si, word [bp+004h] ; 8b 76 04
mov es, [bp+006h] ; 8e 46 06
mov bl, byte [es:si+008h] ; 26 8a 5c 08
sub bl, 008h ; 80 eb 08
cmp bl, 004h ; 80 fb 04
jbe short 07a43h ; 76 12
movzx ax, bl ; 0f b6 c3
push ax ; 50
push 00b26h ; 68 26 0b
push 00b38h ; 68 38 0b
push strict byte 00007h ; 6a 07
call 01972h ; e8 32 9f
add sp, strict byte 00008h ; 83 c4 08
mov es, [bp+006h] ; 8e 46 06
mov di, word [es:si+00ah] ; 26 8b 7c 0a
mov word [bp-012h], strict word 00028h ; c7 46 ee 28 00
mov ax, word [es:si] ; 26 8b 04
mov dx, word [es:si+002h] ; 26 8b 54 02
xchg ah, al ; 86 c4
xchg dh, dl ; 86 d6
xchg dx, ax ; 92
mov word [bp-010h], ax ; 89 46 f0
mov word [bp-00eh], dx ; 89 56 f2
mov byte [bp-00ch], 000h ; c6 46 f4 00
mov ax, di ; 89 f8
xchg ah, al ; 86 c4
mov word [bp-00bh], ax ; 89 46 f5
mov byte [bp-009h], 000h ; c6 46 f7 00
xor bh, bh ; 30 ff
sal bx, 002h ; c1 e3 02
add bx, si ; 01 f3
mov ax, word [es:bx+001d8h] ; 26 8b 87 d8 01
mov dl, byte [es:bx+001dah] ; 26 8a 97 da 01
mov word [bp-008h], di ; 89 7e f8
mov word [bp-006h], strict word 00000h ; c7 46 fa 00 00
mov cx, strict word 00009h ; b9 09 00
sal word [bp-008h], 1 ; d1 66 f8
rcl word [bp-006h], 1 ; d1 56 fa
loop 07a8ch ; e2 f8
push dword [bp-008h] ; 66 ff 76 f8
db 066h, 026h, 0ffh, 074h, 004h
; push dword [es:si+004h] ; 66 26 ff 74 04
push strict byte 0000ah ; 6a 0a
xor dh, dh ; 30 f6
mov cx, ss ; 8c d1
lea bx, [bp-012h] ; 8d 5e ee
call 07885h ; e8 dc fd
mov ah, al ; 88 c4
test al, al ; 84 c0
jne short 07ac4h ; 75 15
mov es, [bp+006h] ; 8e 46 06
mov word [es:si+014h], di ; 26 89 7c 14
mov dx, word [bp-008h] ; 8b 56 f8
mov word [es:si+016h], dx ; 26 89 54 16
mov dx, word [bp-006h] ; 8b 56 fa
mov word [es:si+018h], dx ; 26 89 54 18
movzx ax, ah ; 0f b6 c4
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
@scsi_write_sectors: ; 0xf7ad0 LB 0xb9
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000eh ; 83 ec 0e
mov si, word [bp+004h] ; 8b 76 04
mov es, [bp+006h] ; 8e 46 06
mov bl, byte [es:si+008h] ; 26 8a 5c 08
sub bl, 008h ; 80 eb 08
cmp bl, 004h ; 80 fb 04
jbe short 07afch ; 76 12
movzx ax, bl ; 0f b6 c3
push ax ; 50
push 00b57h ; 68 57 0b
push 00b38h ; 68 38 0b
push strict byte 00007h ; 6a 07
call 01972h ; e8 79 9e
add sp, strict byte 00008h ; 83 c4 08
mov es, [bp+006h] ; 8e 46 06
mov di, word [es:si+00ah] ; 26 8b 7c 0a
mov word [bp-012h], strict word 0002ah ; c7 46 ee 2a 00
mov ax, word [es:si] ; 26 8b 04
mov dx, word [es:si+002h] ; 26 8b 54 02
xchg ah, al ; 86 c4
xchg dh, dl ; 86 d6
xchg dx, ax ; 92
mov word [bp-010h], ax ; 89 46 f0
mov word [bp-00eh], dx ; 89 56 f2
mov byte [bp-00ch], 000h ; c6 46 f4 00
mov ax, di ; 89 f8
xchg ah, al ; 86 c4
mov word [bp-00bh], ax ; 89 46 f5
mov byte [bp-009h], 000h ; c6 46 f7 00
xor bh, bh ; 30 ff
sal bx, 002h ; c1 e3 02
add bx, si ; 01 f3
mov ax, word [es:bx+001d8h] ; 26 8b 87 d8 01
mov dl, byte [es:bx+001dah] ; 26 8a 97 da 01
mov word [bp-008h], di ; 89 7e f8
mov word [bp-006h], strict word 00000h ; c7 46 fa 00 00
mov cx, strict word 00009h ; b9 09 00
sal word [bp-008h], 1 ; d1 66 f8
rcl word [bp-006h], 1 ; d1 56 fa
loop 07b45h ; e2 f8
push dword [bp-008h] ; 66 ff 76 f8
db 066h, 026h, 0ffh, 074h, 004h
; push dword [es:si+004h] ; 66 26 ff 74 04
push strict byte 0000ah ; 6a 0a
xor dh, dh ; 30 f6
mov cx, ss ; 8c d1
lea bx, [bp-012h] ; 8d 5e ee
call 0794eh ; e8 ec fd
mov ah, al ; 88 c4
test al, al ; 84 c0
jne short 07b7dh ; 75 15
mov es, [bp+006h] ; 8e 46 06
mov word [es:si+014h], di ; 26 89 7c 14
mov dx, word [bp-008h] ; 8b 56 f8
mov word [es:si+016h], dx ; 26 89 54 16
mov dx, word [bp-006h] ; 8b 56 fa
mov word [es:si+018h], dx ; 26 89 54 18
movzx ax, ah ; 0f b6 c4
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
scsi_cmd_packet_: ; 0xf7b89 LB 0x166
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000ch ; 83 ec 0c
mov di, ax ; 89 c7
mov byte [bp-006h], dl ; 88 56 fa
mov word [bp-00ch], bx ; 89 5e f4
mov word [bp-00ah], cx ; 89 4e f6
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 c7 9a
mov si, 00122h ; be 22 01
mov word [bp-00eh], ax ; 89 46 f2
cmp byte [bp+00ah], 002h ; 80 7e 0a 02
jne short 07bd0h ; 75 1f
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 75 9d
push 00b6ah ; 68 6a 0b
push 00b7ah ; 68 7a 0b
push strict byte 00004h ; 6a 04
call 01972h ; e8 ab 9d
add sp, strict byte 00006h ; 83 c4 06
mov dx, strict word 00001h ; ba 01 00
jmp near 07ce4h ; e9 14 01
sub di, strict byte 00008h ; 83 ef 08
sal di, 002h ; c1 e7 02
sub byte [bp-006h], 002h ; 80 6e fa 02
mov es, [bp-00eh] ; 8e 46 f2
add di, si ; 01 f7
mov bx, word [es:di+001d8h] ; 26 8b 9d d8 01
mov al, byte [es:di+001dah] ; 26 8a 85 da 01
mov byte [bp-008h], al ; 88 46 f8
mov dx, bx ; 89 da
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 07bech ; 75 f7
xor ax, ax ; 31 c0
mov dx, word [bp+006h] ; 8b 56 06
add dx, word [bp+004h] ; 03 56 04
adc ax, word [bp+008h] ; 13 46 08
mov es, [bp-00eh] ; 8e 46 f2
mov cx, word [es:si+01ch] ; 26 8b 4c 1c
xor di, di ; 31 ff
add cx, dx ; 01 d1
mov word [bp-010h], cx ; 89 4e f0
adc di, ax ; 11 c7
mov ax, cx ; 89 c8
mov dx, di ; 89 fa
mov cx, strict word 0000ch ; b9 0c 00
shr dx, 1 ; d1 ea
rcr ax, 1 ; d1 d8
loop 07c17h ; e2 fa
and ax, 000f0h ; 25 f0 00
movzx cx, byte [bp-006h] ; 0f b6 4e fa
or cx, ax ; 09 c1
mov al, byte [bp-008h] ; 8a 46 f8
mov dx, bx ; 89 da
out DX, AL ; ee
xor al, al ; 30 c0
out DX, AL ; ee
mov al, cl ; 88 c8
out DX, AL ; ee
mov al, byte [bp-010h] ; 8a 46 f0
out DX, AL ; ee
mov ax, word [bp-010h] ; 8b 46 f0
mov dx, di ; 89 fa
mov cx, strict word 00008h ; b9 08 00
shr dx, 1 ; d1 ea
rcr ax, 1 ; d1 d8
loop 07c3eh ; e2 fa
mov dx, bx ; 89 da
out DX, AL ; ee
xor cx, cx ; 31 c9
movzx ax, byte [bp-006h] ; 0f b6 46 fa
cmp cx, ax ; 39 c1
jnc short 07c5fh ; 73 0e
les di, [bp-00ch] ; c4 7e f4
add di, cx ; 01 cf
mov al, byte [es:di] ; 26 8a 05
mov dx, bx ; 89 da
out DX, AL ; ee
inc cx ; 41
jmp short 07c49h ; eb ea
mov dx, bx ; 89 da
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
test AL, strict byte 001h ; a8 01
jne short 07c5fh ; 75 f7
test AL, strict byte 002h ; a8 02
je short 07c7ah ; 74 0e
lea dx, [bx+003h] ; 8d 57 03
xor al, al ; 30 c0
out DX, AL ; ee
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov dx, strict word 00003h ; ba 03 00
jmp short 07ce4h ; eb 6a
mov ax, word [bp+004h] ; 8b 46 04
test ax, ax ; 85 c0
je short 07c89h ; 74 08
lea dx, [bx+001h] ; 8d 57 01
mov cx, ax ; 89 c1
in AL, DX ; ec
loop 07c86h ; e2 fd
mov ax, word [bp+006h] ; 8b 46 06
mov es, [bp-00eh] ; 8e 46 f2
mov word [es:si+016h], ax ; 26 89 44 16
mov ax, word [bp+008h] ; 8b 46 08
mov word [es:si+018h], ax ; 26 89 44 18
lea ax, [bx+001h] ; 8d 47 01
cmp word [bp+008h], strict byte 00000h ; 83 7e 08 00
jne short 07caah ; 75 07
cmp word [bp+006h], 08000h ; 81 7e 06 00 80
jbe short 07cc7h ; 76 1d
mov dx, ax ; 89 c2
mov cx, 08000h ; b9 00 80
les di, [bp+00ch] ; c4 7e 0c
rep insb ; f3 6c
add word [bp+006h], 08000h ; 81 46 06 00 80
adc word [bp+008h], strict byte 0ffffh ; 83 56 08 ff
mov ax, es ; 8c c0
add ax, 00800h ; 05 00 08
mov word [bp+00eh], ax ; 89 46 0e
jmp short 07c9ah ; eb d3
mov dx, ax ; 89 c2
mov cx, word [bp+006h] ; 8b 4e 06
les di, [bp+00ch] ; c4 7e 0c
rep insb ; f3 6c
mov es, [bp-00eh] ; 8e 46 f2
cmp word [es:si+01ch], strict byte 00000h ; 26 83 7c 1c 00
je short 07ce2h ; 74 07
mov cx, word [es:si+01ch] ; 26 8b 4c 1c
in AL, DX ; ec
loop 07cdfh ; e2 fd
xor dx, dx ; 31 d2
mov ax, dx ; 89 d0
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 0000ch ; c2 0c 00
scsi_enumerate_attached_devices_: ; 0xf7cef LB 0x3e4
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, 0021eh ; 81 ec 1e 02
push ax ; 50
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 67 99
mov si, 00122h ; be 22 01
mov word [bp-018h], ax ; 89 46 e8
mov word [bp-00eh], strict word 00000h ; c7 46 f2 00 00
jmp near 08055h ; e9 42 03
cmp AL, strict byte 004h ; 3c 04
jnc near 080c9h ; 0f 83 b0 03
mov cx, strict word 0000ah ; b9 0a 00
xor bx, bx ; 31 db
mov dx, ss ; 8c d2
lea ax, [bp-028h] ; 8d 46 d8
call 097aah ; e8 84 1a
mov byte [bp-028h], 025h ; c6 46 d8 25
push dword 000000008h ; 66 6a 08
lea dx, [bp-00228h] ; 8d 96 d8 fd
push SS ; 16
push dx ; 52
push strict byte 0000ah ; 6a 0a
movzx dx, byte [bp-00eh] ; 0f b6 56 f2
mov cx, ss ; 8c d1
lea bx, [bp-028h] ; 8d 5e d8
mov ax, word [bp-0022ah] ; 8b 86 d6 fd
call 07885h ; e8 40 fb
test al, al ; 84 c0
je short 07d57h ; 74 0e
push 00b9ah ; 68 9a 0b
push 00bd3h ; 68 d3 0b
push strict byte 00007h ; 6a 07
call 01972h ; e8 1e 9c
add sp, strict byte 00006h ; 83 c4 06
movzx ax, byte [bp-00227h] ; 0f b6 86 d9 fd
movzx di, byte [bp-00228h] ; 0f b6 be d8 fd
sal di, 008h ; c1 e7 08
xor bx, bx ; 31 db
or di, ax ; 09 c7
movzx ax, byte [bp-00226h] ; 0f b6 86 da fd
xor dx, dx ; 31 d2
mov cx, strict word 00008h ; b9 08 00
sal ax, 1 ; d1 e0
rcl dx, 1 ; d1 d2
loop 07d72h ; e2 fa
or bx, ax ; 09 c3
or di, dx ; 09 d7
movzx ax, byte [bp-00225h] ; 0f b6 86 db fd
or bx, ax ; 09 c3
mov word [bp-014h], bx ; 89 5e ec
add word [bp-014h], strict byte 00001h ; 83 46 ec 01
adc di, strict byte 00000h ; 83 d7 00
movzx ax, byte [bp-00224h] ; 0f b6 86 dc fd
sal ax, 008h ; c1 e0 08
movzx dx, byte [bp-00223h] ; 0f b6 96 dd fd
xor bx, bx ; 31 db
or ax, dx ; 09 d0
mov word [bp-012h], ax ; 89 46 ee
movzx ax, byte [bp-00222h] ; 0f b6 86 de fd
xor dx, dx ; 31 d2
mov cx, strict word 00008h ; b9 08 00
sal ax, 1 ; d1 e0
rcl dx, 1 ; d1 d2
loop 07dabh ; e2 fa
or ax, bx ; 09 d8
or dx, word [bp-012h] ; 0b 56 ee
movzx bx, byte [bp-00221h] ; 0f b6 9e df fd
or ax, bx ; 09 d8
mov word [bp-010h], ax ; 89 46 f0
test dx, dx ; 85 d2
jne short 07dc9h ; 75 05
cmp ax, 00200h ; 3d 00 02
je short 07de9h ; 74 20
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 5d 9b
push dx ; 52
push word [bp-010h] ; ff 76 f0
push word [bp-00eh] ; ff 76 f2
push 00bf2h ; 68 f2 0b
push strict byte 00004h ; 6a 04
call 01972h ; e8 8f 9b
add sp, strict byte 0000ah ; 83 c4 0a
jmp near 0804ch ; e9 63 02
mov al, byte [bp-00ch] ; 8a 46 f4
cmp AL, strict byte 001h ; 3c 01
jc short 07dfch ; 72 0c
jbe short 07e04h ; 76 12
cmp AL, strict byte 003h ; 3c 03
je short 07e0ch ; 74 16
cmp AL, strict byte 002h ; 3c 02
je short 07e08h ; 74 0e
jmp short 07e5bh ; eb 5f
test al, al ; 84 c0
jne short 07e5bh ; 75 5b
mov BL, strict byte 090h ; b3 90
jmp short 07e0eh ; eb 0a
mov BL, strict byte 098h ; b3 98
jmp short 07e0eh ; eb 06
mov BL, strict byte 0a0h ; b3 a0
jmp short 07e0eh ; eb 02
mov BL, strict byte 0a8h ; b3 a8
mov al, bl ; 88 d8
add AL, strict byte 007h ; 04 07
movzx cx, al ; 0f b6 c8
mov ax, cx ; 89 c8
call 016ach ; e8 92 98
test al, al ; 84 c0
je short 07e5bh ; 74 3d
mov al, bl ; 88 d8
db 0feh, 0c0h
; inc al ; fe c0
xor ah, ah ; 30 e4
call 016ach ; e8 85 98
xor ah, ah ; 30 e4
sal ax, 008h ; c1 e0 08
mov word [bp-012h], ax ; 89 46 ee
movzx ax, bl ; 0f b6 c3
call 016ach ; e8 77 98
xor ah, ah ; 30 e4
add ax, word [bp-012h] ; 03 46 ee
cwd ; 99
mov word [bp-01eh], ax ; 89 46 e2
mov word [bp-016h], dx ; 89 56 ea
mov al, bl ; 88 d8
add AL, strict byte 002h ; 04 02
xor ah, ah ; 30 e4
call 016ach ; e8 62 98
xor ah, ah ; 30 e4
mov word [bp-01ch], ax ; 89 46 e4
mov ax, cx ; 89 c8
call 016ach ; e8 58 98
xor ah, ah ; 30 e4
mov word [bp-01ah], ax ; 89 46 e6
jmp short 07e9ch ; eb 41
cmp di, strict byte 00040h ; 83 ff 40
jnbe short 07e62h ; 77 02
jne short 07e6ch ; 75 0a
mov dword [bp-01ch], strict dword 0003f00ffh ; 66 c7 46 e4 ff 00 3f 00
jmp short 07e85h ; eb 19
cmp di, strict byte 00020h ; 83 ff 20
jnbe short 07e73h ; 77 02
jne short 07e7dh ; 75 0a
mov dword [bp-01ch], strict dword 000200080h ; 66 c7 46 e4 80 00 20 00
jmp short 07e85h ; eb 08
mov dword [bp-01ch], strict dword 000200040h ; 66 c7 46 e4 40 00 20 00
mov bx, word [bp-01ch] ; 8b 5e e4
imul bx, word [bp-01ah] ; 0f af 5e e6
mov ax, word [bp-014h] ; 8b 46 ec
mov dx, di ; 89 fa
xor cx, cx ; 31 c9
call 09740h ; e8 aa 18
mov word [bp-01eh], ax ; 89 46 e2
mov word [bp-016h], dx ; 89 56 ea
mov dl, byte [bp-00ch] ; 8a 56 f4
add dl, 008h ; 80 c2 08
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
sal bx, 002h ; c1 e3 02
mov es, [bp-018h] ; 8e 46 e8
add bx, si ; 01 f3
mov ax, word [bp-0022ah] ; 8b 86 d6 fd
mov word [es:bx+001d8h], ax ; 26 89 87 d8 01
mov al, byte [bp-00eh] ; 8a 46 f2
mov byte [es:bx+001dah], al ; 26 88 87 da 01
movzx ax, dl ; 0f b6 c2
imul ax, ax, strict byte 00018h ; 6b c0 18
mov bx, si ; 89 f3
add bx, ax ; 01 c3
db 066h, 026h, 0c7h, 047h, 01eh, 004h, 0ffh, 000h, 000h
; mov dword [es:bx+01eh], strict dword 00000ff04h ; 66 26 c7 47 1e 04 ff 00 00
mov ax, word [bp-010h] ; 8b 46 f0
mov word [es:bx+024h], ax ; 26 89 47 24
mov byte [es:bx+023h], 001h ; 26 c6 47 23 01
mov ax, word [bp-01ch] ; 8b 46 e4
mov word [es:bx+026h], ax ; 26 89 47 26
mov ax, word [bp-01ah] ; 8b 46 e6
mov word [es:bx+02ah], ax ; 26 89 47 2a
cmp word [bp-016h], strict byte 00000h ; 83 7e ea 00
jne short 07ef9h ; 75 07
cmp word [bp-01eh], 00400h ; 81 7e e2 00 04
jbe short 07f01h ; 76 08
mov word [es:bx+028h], 00400h ; 26 c7 47 28 00 04
jmp short 07f08h ; eb 07
mov ax, word [bp-01eh] ; 8b 46 e2
mov word [es:bx+028h], ax ; 26 89 47 28
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 1e 9a
push di ; 57
push word [bp-014h] ; ff 76 ec
push dword [bp-01ch] ; 66 ff 76 e4
push word [bp-01eh] ; ff 76 e2
push word [bp-00eh] ; ff 76 f2
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
push ax ; 50
push 00c20h ; 68 20 0c
push strict byte 00004h ; 6a 04
call 01972h ; e8 44 9a
add sp, strict byte 00012h ; 83 c4 12
movzx ax, dl ; 0f b6 c2
imul ax, ax, strict byte 00018h ; 6b c0 18
mov es, [bp-018h] ; 8e 46 e8
mov bx, si ; 89 f3
add bx, ax ; 01 c3
mov ax, word [bp-01ch] ; 8b 46 e4
mov word [es:bx+02ch], ax ; 26 89 47 2c
mov ax, word [bp-01ah] ; 8b 46 e6
mov word [es:bx+030h], ax ; 26 89 47 30
cmp word [bp-016h], strict byte 00000h ; 83 7e ea 00
jne short 07f59h ; 75 07
cmp word [bp-01eh], 00400h ; 81 7e e2 00 04
jbe short 07f61h ; 76 08
mov word [es:bx+02eh], 00400h ; 26 c7 47 2e 00 04
jmp short 07f68h ; eb 07
mov ax, word [bp-01eh] ; 8b 46 e2
mov word [es:bx+02eh], ax ; 26 89 47 2e
movzx ax, dl ; 0f b6 c2
imul ax, ax, strict byte 00018h ; 6b c0 18
mov es, [bp-018h] ; 8e 46 e8
mov bx, si ; 89 f3
add bx, ax ; 01 c3
mov ax, word [bp-014h] ; 8b 46 ec
mov word [es:bx+032h], ax ; 26 89 47 32
mov word [es:bx+034h], di ; 26 89 7f 34
mov al, byte [es:si+0019eh] ; 26 8a 84 9e 01
mov ah, byte [bp-00ch] ; 8a 66 f4
add ah, 008h ; 80 c4 08
movzx bx, al ; 0f b6 d8
add bx, si ; 01 f3
mov byte [es:bx+0019fh], ah ; 26 88 a7 9f 01
db 0feh, 0c0h
; inc al ; fe c0
mov byte [es:si+0019eh], al ; 26 88 84 9e 01
mov dx, strict word 00075h ; ba 75 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 ab 96
db 0feh, 0c0h
; inc al ; fe c0
movzx bx, al ; 0f b6 d8
mov dx, strict word 00075h ; ba 75 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 ab 96
inc byte [bp-00ch] ; fe 46 f4
jmp near 08041h ; e9 88 00
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 6d 99
push word [bp-00eh] ; ff 76 f2
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
push ax ; 50
push 00c4ah ; 68 4a 0c
push strict byte 00004h ; 6a 04
call 01972h ; e8 9e 99
add sp, strict byte 00008h ; 83 c4 08
mov dl, byte [bp-00ch] ; 8a 56 f4
add dl, 008h ; 80 c2 08
test byte [bp-00227h], 080h ; f6 86 d9 fd 80
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
xor ah, ah ; 30 e4
mov cx, ax ; 89 c1
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
sal ax, 002h ; c1 e0 02
mov es, [bp-018h] ; 8e 46 e8
mov bx, si ; 89 f3
add bx, ax ; 01 c3
mov ax, word [bp-0022ah] ; 8b 86 d6 fd
mov word [es:bx+001d8h], ax ; 26 89 87 d8 01
mov al, byte [bp-00eh] ; 8a 46 f2
mov byte [es:bx+001dah], al ; 26 88 87 da 01
movzx ax, dl ; 0f b6 c2
imul ax, ax, strict byte 00018h ; 6b c0 18
mov bx, si ; 89 f3
add bx, ax ; 01 c3
mov word [es:bx+01eh], 00504h ; 26 c7 47 1e 04 05
mov byte [es:bx+020h], cl ; 26 88 4f 20
mov word [es:bx+024h], 00800h ; 26 c7 47 24 00 08
mov al, byte [es:si+001afh] ; 26 8a 84 af 01
mov ah, byte [bp-00ch] ; 8a 66 f4
add ah, 008h ; 80 c4 08
movzx bx, al ; 0f b6 d8
add bx, si ; 01 f3
mov byte [es:bx+001b0h], ah ; 26 88 a7 b0 01
db 0feh, 0c0h
; inc al ; fe c0
mov byte [es:si+001afh], al ; 26 88 84 af 01
inc byte [bp-00ch] ; fe 46 f4
mov al, byte [bp-00ch] ; 8a 46 f4
mov es, [bp-018h] ; 8e 46 e8
mov byte [es:si+001e8h], al ; 26 88 84 e8 01
inc word [bp-00eh] ; ff 46 f2
cmp word [bp-00eh], strict byte 00010h ; 83 7e f2 10
jnl short 080c9h ; 7d 74
mov byte [bp-028h], 012h ; c6 46 d8 12
xor al, al ; 30 c0
mov byte [bp-027h], al ; 88 46 d9
mov byte [bp-026h], al ; 88 46 da
mov byte [bp-025h], al ; 88 46 db
mov byte [bp-024h], 005h ; c6 46 dc 05
mov byte [bp-023h], al ; 88 46 dd
push dword 000000005h ; 66 6a 05
lea dx, [bp-00228h] ; 8d 96 d8 fd
push SS ; 16
push dx ; 52
push strict byte 00006h ; 6a 06
movzx dx, byte [bp-00eh] ; 0f b6 56 f2
mov cx, ss ; 8c d1
lea bx, [bp-028h] ; 8d 5e d8
mov ax, word [bp-0022ah] ; 8b 86 d6 fd
call 07885h ; e8 ff f7
test al, al ; 84 c0
je short 08098h ; 74 0e
push 00b9ah ; 68 9a 0b
push 00bbah ; 68 ba 0b
push strict byte 00007h ; 6a 07
call 01972h ; e8 dd 98
add sp, strict byte 00006h ; 83 c4 06
mov es, [bp-018h] ; 8e 46 e8
mov al, byte [es:si+001e8h] ; 26 8a 84 e8 01
mov byte [bp-00ch], al ; 88 46 f4
test byte [bp-00228h], 0e0h ; f6 86 d8 fd e0
jne short 080b3h ; 75 09
test byte [bp-00228h], 01fh ; f6 86 d8 fd 1f
je near 07d13h ; 0f 84 60 fc
test byte [bp-00228h], 0e0h ; f6 86 d8 fd e0
jne short 08041h ; 75 87
mov al, byte [bp-00228h] ; 8a 86 d8 fd
and AL, strict byte 01fh ; 24 1f
cmp AL, strict byte 005h ; 3c 05
je near 07fb9h ; 0f 84 f3 fe
jmp near 08041h ; e9 78 ff
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
_scsi_init: ; 0xf80d3 LB 0x66
push bp ; 55
mov bp, sp ; 89 e5
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 8d 95
mov bx, 00122h ; bb 22 01
mov es, ax ; 8e c0
mov byte [es:bx+001e8h], 000h ; 26 c6 87 e8 01 00
mov AL, strict byte 055h ; b0 55
mov dx, 00432h ; ba 32 04
out DX, AL ; ee
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp AL, strict byte 055h ; 3c 55
jne short 08103h ; 75 0c
xor al, al ; 30 c0
mov dx, 00433h ; ba 33 04
out DX, AL ; ee
mov ax, 00430h ; b8 30 04
call 07cefh ; e8 ec fb
mov AL, strict byte 055h ; b0 55
mov dx, 00436h ; ba 36 04
out DX, AL ; ee
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp AL, strict byte 055h ; 3c 55
jne short 0811ch ; 75 0c
xor al, al ; 30 c0
mov dx, 00437h ; ba 37 04
out DX, AL ; ee
mov ax, 00434h ; b8 34 04
call 07cefh ; e8 d3 fb
mov AL, strict byte 055h ; b0 55
mov dx, 0043ah ; ba 3a 04
out DX, AL ; ee
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp AL, strict byte 055h ; 3c 55
jne short 08135h ; 75 0c
xor al, al ; 30 c0
mov dx, 0043bh ; ba 3b 04
out DX, AL ; ee
mov ax, 00438h ; b8 38 04
call 07cefh ; e8 ba fb
mov sp, bp ; 89 ec
pop bp ; 5d
retn ; c3
high_bits_save_: ; 0xf8139 LB 0x17
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
mov bx, ax ; 89 c3
shr eax, 010h ; 66 c1 e8 10
mov es, dx ; 8e c2
mov word [es:bx+00268h], ax ; 26 89 87 68 02
lea sp, [bp-002h] ; 8d 66 fe
pop bx ; 5b
pop bp ; 5d
retn ; c3
high_bits_restore_: ; 0xf8150 LB 0x17
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
mov bx, ax ; 89 c3
mov es, dx ; 8e c2
mov ax, word [es:bx+00268h] ; 26 8b 87 68 02
sal eax, 010h ; 66 c1 e0 10
lea sp, [bp-002h] ; 8d 66 fe
pop bx ; 5b
pop bp ; 5d
retn ; c3
ahci_ctrl_set_bits_: ; 0xf8167 LB 0x43
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
mov si, ax ; 89 c6
mov ax, dx ; 89 d0
mov word [bp-006h], bx ; 89 5e fa
mov di, cx ; 89 cf
xor cx, cx ; 31 c9
mov dx, si ; 89 f2
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea bx, [si+004h] ; 8d 5c 04
mov dx, bx ; 89 da
in eax, DX ; 66 ed
db 08bh, 0d0h
; mov dx, ax ; 8b d0
shr eax, 010h ; 66 c1 e8 10
xchg dx, ax ; 92
or ax, word [bp-006h] ; 0b 46 fa
mov cx, dx ; 89 d1
or cx, di ; 09 f9
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
ahci_ctrl_clear_bits_: ; 0xf81aa LB 0x47
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
mov si, ax ; 89 c6
mov ax, dx ; 89 d0
mov di, bx ; 89 df
mov word [bp-006h], cx ; 89 4e fa
xor cx, cx ; 31 c9
mov dx, si ; 89 f2
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea bx, [si+004h] ; 8d 5c 04
mov dx, bx ; 89 da
in eax, DX ; 66 ed
db 08bh, 0d0h
; mov dx, ax ; 8b d0
shr eax, 010h ; 66 c1 e8 10
xchg dx, ax ; 92
not di ; f7 d7
mov cx, word [bp-006h] ; 8b 4e fa
not cx ; f7 d1
and ax, di ; 21 f8
and cx, dx ; 21 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
ahci_ctrl_is_bit_set_: ; 0xf81f1 LB 0x39
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
mov si, ax ; 89 c6
mov ax, dx ; 89 d0
mov di, cx ; 89 cf
xor cx, cx ; 31 c9
mov dx, si ; 89 f2
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea dx, [si+004h] ; 8d 54 04
in eax, DX ; 66 ed
db 08bh, 0d0h
; mov dx, ax ; 8b d0
shr eax, 010h ; 66 c1 e8 10
xchg dx, ax ; 92
test dx, di ; 85 fa
jne short 0821dh ; 75 04
test ax, bx ; 85 d8
je short 08221h ; 74 04
mov AL, strict byte 001h ; b0 01
jmp short 08223h ; eb 02
xor al, al ; 30 c0
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
ahci_ctrl_extract_bits_: ; 0xf822a LB 0x1b
push si ; 56
push bp ; 55
mov bp, sp ; 89 e5
mov si, bx ; 89 de
and ax, bx ; 21 d8
and dx, cx ; 21 ca
movzx cx, byte [bp+006h] ; 0f b6 4e 06
jcxz 08240h ; e3 06
shr dx, 1 ; d1 ea
rcr ax, 1 ; d1 d8
loop 0823ah ; e2 fa
pop bp ; 5d
pop si ; 5e
retn 00002h ; c2 02 00
ahci_addr_to_phys_: ; 0xf8245 LB 0x1e
push bx ; 53
push cx ; 51
push bp ; 55
mov bp, sp ; 89 e5
mov bx, ax ; 89 c3
mov ax, dx ; 89 d0
xor dx, dx ; 31 d2
mov cx, strict word 00004h ; b9 04 00
sal ax, 1 ; d1 e0
rcl dx, 1 ; d1 d2
loop 08253h ; e2 fa
xor cx, cx ; 31 c9
add ax, bx ; 01 d8
adc dx, cx ; 11 ca
pop bp ; 5d
pop cx ; 59
pop bx ; 5b
retn ; c3
ahci_port_cmd_sync_: ; 0xf8263 LB 0xd5
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
mov si, ax ; 89 c6
mov word [bp-00ah], dx ; 89 56 f6
mov es, dx ; 8e c2
mov al, byte [es:si+00262h] ; 26 8a 84 62 02
mov byte [bp-008h], al ; 88 46 f8
mov di, word [es:si+00260h] ; 26 8b bc 60 02
cmp AL, strict byte 0ffh ; 3c ff
je near 08330h ; 0f 84 aa 00
movzx cx, byte [es:si+00263h] ; 26 0f b6 8c 63 02
xor dx, dx ; 31 d2
or dl, 080h ; 80 ca 80
movzx ax, bl ; 0f b6 c3
or dx, ax ; 09 c2
mov word [es:si], dx ; 26 89 14
mov word [es:si+002h], cx ; 26 89 4c 02
db 066h, 026h, 0c7h, 044h, 004h, 000h, 000h, 000h, 000h
; mov dword [es:si+004h], strict dword 000000000h ; 66 26 c7 44 04 00 00 00 00
lea ax, [si+00080h] ; 8d 84 80 00
mov dx, es ; 8c c2
call 08245h ; e8 96 ff
mov es, [bp-00ah] ; 8e 46 f6
mov word [es:si+008h], ax ; 26 89 44 08
mov word [es:si+00ah], dx ; 26 89 54 0a
movzx si, byte [bp-008h] ; 0f b6 76 f8
sal si, 007h ; c1 e6 07
lea dx, [si+00118h] ; 8d 94 18 01
mov bx, strict word 00011h ; bb 11 00
xor cx, cx ; 31 c9
mov ax, di ; 89 f8
call 08167h ; e8 98 fe
lea ax, [si+00138h] ; 8d 84 38 01
cwd ; 99
mov cx, dx ; 89 d1
mov dx, di ; 89 fa
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea dx, [di+004h] ; 8d 55 04
mov ax, strict word 00001h ; b8 01 00
xor cx, cx ; 31 c9
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
movzx ax, byte [bp-008h] ; 0f b6 46 f8
sal ax, 007h ; c1 e0 07
mov word [bp-00ch], ax ; 89 46 f4
mov si, ax ; 89 c6
add si, 00110h ; 81 c6 10 01
mov bx, strict word 00001h ; bb 01 00
mov cx, 04000h ; b9 00 40
mov dx, si ; 89 f2
mov ax, di ; 89 f8
call 081f1h ; e8 e2 fe
test al, al ; 84 c0
je short 082f2h ; 74 df
mov bx, strict word 00001h ; bb 01 00
xor cx, cx ; 31 c9
mov dx, si ; 89 f2
mov ax, di ; 89 f8
call 08167h ; e8 48 fe
mov dx, word [bp-00ch] ; 8b 56 f4
add dx, 00118h ; 81 c2 18 01
mov bx, strict word 00001h ; bb 01 00
xor cx, cx ; 31 c9
mov ax, di ; 89 f8
call 081aah ; e8 7a fe
lea sp, [bp-006h] ; 8d 66 fa
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
ahci_cmd_data_: ; 0xf8338 LB 0x1e4
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
push di ; 57
sub sp, strict byte 00010h ; 83 ec 10
mov di, ax ; 89 c7
mov word [bp-00ch], dx ; 89 56 f4
mov byte [bp-008h], bl ; 88 5e f8
xor si, si ; 31 f6
mov es, dx ; 8e c2
mov ax, word [es:di+001eeh] ; 26 8b 85 ee 01
mov word [bp-00ah], ax ; 89 46 f6
mov word [bp-010h], si ; 89 76 f0
mov word [bp-00eh], ax ; 89 46 f2
mov ax, word [es:di+00ah] ; 26 8b 45 0a
mov word [bp-016h], ax ; 89 46 ea
mov ax, word [es:di+00ch] ; 26 8b 45 0c
mov word [bp-012h], ax ; 89 46 ee
mov cx, strict word 00040h ; b9 40 00
xor bx, bx ; 31 db
mov ax, 00080h ; b8 80 00
mov dx, word [bp-00ah] ; 8b 56 f6
call 097aah ; e8 33 14
mov es, [bp-00ah] ; 8e 46 f6
mov word [es:si+00080h], 08027h ; 26 c7 84 80 00 27 80
mov al, byte [bp-008h] ; 8a 46 f8
mov byte [es:si+00082h], al ; 26 88 84 82 00
mov byte [es:si+00083h], 000h ; 26 c6 84 83 00 00
mov es, [bp-00ch] ; 8e 46 f4
mov al, byte [es:di] ; 26 8a 05
mov es, [bp-00ah] ; 8e 46 f6
mov byte [es:si+00084h], al ; 26 88 84 84 00
mov es, [bp-00ch] ; 8e 46 f4
mov ax, word [es:di] ; 26 8b 05
mov bx, word [es:di+002h] ; 26 8b 5d 02
mov cx, strict word 00008h ; b9 08 00
shr bx, 1 ; d1 eb
rcr ax, 1 ; d1 d8
loop 083aah ; e2 fa
mov es, [bp-00ah] ; 8e 46 f6
mov byte [es:si+00085h], al ; 26 88 84 85 00
mov es, [bp-00ch] ; 8e 46 f4
mov ax, word [es:di+002h] ; 26 8b 45 02
mov es, [bp-00ah] ; 8e 46 f6
mov byte [es:si+00086h], al ; 26 88 84 86 00
mov byte [es:si+00087h], 040h ; 26 c6 84 87 00 40
mov es, [bp-00ch] ; 8e 46 f4
mov ax, word [es:di+002h] ; 26 8b 45 02
shr ax, 008h ; c1 e8 08
mov es, [bp-00ah] ; 8e 46 f6
mov byte [es:si+00088h], al ; 26 88 84 88 00
mov word [es:si+00089h], strict word 00000h ; 26 c7 84 89 00 00 00
mov byte [es:si+0008bh], 000h ; 26 c6 84 8b 00 00
mov al, byte [bp-016h] ; 8a 46 ea
mov byte [es:si+0008ch], al ; 26 88 84 8c 00
mov ax, word [bp-016h] ; 8b 46 ea
shr ax, 008h ; c1 e8 08
mov byte [es:si+0008dh], al ; 26 88 84 8d 00
mov word [es:si+00276h], strict word 00010h ; 26 c7 84 76 02 10 00
mov ax, word [bp-016h] ; 8b 46 ea
xor dx, dx ; 31 d2
mov bx, word [bp-012h] ; 8b 5e ee
xor cx, cx ; 31 c9
call 09779h ; e8 66 13
push dx ; 52
push ax ; 50
mov es, [bp-00ch] ; 8e 46 f4
mov bx, word [es:di+004h] ; 26 8b 5d 04
mov cx, word [es:di+006h] ; 26 8b 4d 06
mov ax, 0026ah ; b8 6a 02
mov dx, word [bp-00ah] ; 8b 56 f6
call 09688h ; e8 5f 12
mov es, [bp-00ah] ; 8e 46 f6
movzx ax, byte [es:si+00263h] ; 26 0f b6 84 63 02
mov dx, word [es:si+0027eh] ; 26 8b 94 7e 02
add dx, strict byte 0ffffh ; 83 c2 ff
mov bx, word [es:si+00280h] ; 26 8b 9c 80 02
adc bx, strict byte 0ffffh ; 83 d3 ff
mov word [bp-014h], bx ; 89 5e ec
mov bx, ax ; 89 c3
sal bx, 004h ; c1 e3 04
mov word [es:bx+0010ch], dx ; 26 89 97 0c 01
mov dx, word [bp-014h] ; 8b 56 ec
mov word [es:bx+0010eh], dx ; 26 89 97 0e 01
mov dx, word [es:si+0027ah] ; 26 8b 94 7a 02
mov cx, word [es:si+0027ch] ; 26 8b 8c 7c 02
mov word [es:bx+00100h], dx ; 26 89 97 00 01
mov word [es:bx+00102h], cx ; 26 89 8f 02 01
inc ax ; 40
mov es, [bp-00ch] ; 8e 46 f4
cmp word [es:di+01ch], strict byte 00000h ; 26 83 7d 1c 00
je short 084a2h ; 74 2c
mov dx, word [es:di+01ch] ; 26 8b 55 1c
dec dx ; 4a
mov bx, ax ; 89 c3
sal bx, 004h ; c1 e3 04
mov es, [bp-00ah] ; 8e 46 f6
mov word [es:bx+0010ch], dx ; 26 89 97 0c 01
mov word [es:bx+0010eh], si ; 26 89 b7 0e 01
mov dx, word [es:si+00264h] ; 26 8b 94 64 02
mov cx, word [es:si+00266h] ; 26 8b 8c 66 02
mov word [es:bx+00100h], dx ; 26 89 97 00 01
mov word [es:bx+00102h], cx ; 26 89 8f 02 01
inc ax ; 40
les bx, [bp-010h] ; c4 5e f0
mov byte [es:bx+00263h], al ; 26 88 87 63 02
xor ax, ax ; 31 c0
les bx, [bp-010h] ; c4 5e f0
movzx dx, byte [es:bx+00263h] ; 26 0f b6 97 63 02
cmp ax, dx ; 39 d0
jnc short 084bch ; 73 03
inc ax ; 40
jmp short 084ach ; eb f0
mov al, byte [bp-008h] ; 8a 46 f8
cmp AL, strict byte 035h ; 3c 35
jne short 084c9h ; 75 06
mov byte [bp-008h], 040h ; c6 46 f8 40
jmp short 084ddh ; eb 14
cmp AL, strict byte 0a0h ; 3c a0
jne short 084d9h ; 75 0c
or byte [bp-008h], 020h ; 80 4e f8 20
or byte [es:bx+00083h], 001h ; 26 80 8f 83 00 01
jmp short 084ddh ; eb 04
mov byte [bp-008h], 000h ; c6 46 f8 00
or byte [bp-008h], 005h ; 80 4e f8 05
movzx bx, byte [bp-008h] ; 0f b6 5e f8
mov ax, word [bp-010h] ; 8b 46 f0
mov dx, word [bp-00eh] ; 8b 56 f2
call 08263h ; e8 75 fd
mov cx, word [bp-00eh] ; 8b 4e f2
mov bx, word [bp-010h] ; 8b 5e f0
add bx, 00240h ; 81 c3 40 02
mov ax, word [bp-010h] ; 8b 46 f0
add ax, 0026ah ; 05 6a 02
mov dx, cx ; 89 ca
call 09701h ; e8 fe 11
mov es, cx ; 8e c1
mov al, byte [es:bx+003h] ; 26 8a 47 03
test al, al ; 84 c0
je short 08512h ; 74 05
mov ax, strict word 00004h ; b8 04 00
jmp short 08514h ; eb 02
xor ah, ah ; 30 e4
lea sp, [bp-006h] ; 8d 66 fa
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
ahci_port_deinit_current_: ; 0xf851c LB 0x144
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
sub sp, strict byte 00006h ; 83 ec 06
mov di, ax ; 89 c7
mov word [bp-00ch], dx ; 89 56 f4
mov es, dx ; 8e c2
mov si, word [es:di+00260h] ; 26 8b b5 60 02
mov al, byte [es:di+00262h] ; 26 8a 85 62 02
mov byte [bp-00ah], al ; 88 46 f6
cmp AL, strict byte 0ffh ; 3c ff
je near 08657h ; 0f 84 17 01
movzx dx, al ; 0f b6 d0
sal dx, 007h ; c1 e2 07
add dx, 00118h ; 81 c2 18 01
mov bx, strict word 00011h ; bb 11 00
xor cx, cx ; 31 c9
mov ax, si ; 89 f0
call 081aah ; e8 56 fc
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
sal ax, 007h ; c1 e0 07
mov word [bp-00eh], ax ; 89 46 f2
mov dx, ax ; 89 c2
add dx, 00118h ; 81 c2 18 01
mov bx, 0c011h ; bb 11 c0
xor cx, cx ; 31 c9
mov ax, si ; 89 f0
call 081f1h ; e8 83 fc
cmp AL, strict byte 001h ; 3c 01
je short 08554h ; 74 e2
mov cx, strict word 00020h ; b9 20 00
xor bx, bx ; 31 db
mov ax, di ; 89 f8
mov dx, word [bp-00ch] ; 8b 56 f4
call 097aah ; e8 2b 12
lea ax, [di+00080h] ; 8d 85 80 00
mov cx, strict word 00040h ; b9 40 00
xor bx, bx ; 31 db
mov dx, word [bp-00ch] ; 8b 56 f4
call 097aah ; e8 1c 12
lea ax, [di+00200h] ; 8d 85 00 02
mov cx, strict word 00060h ; b9 60 00
xor bx, bx ; 31 db
mov dx, word [bp-00ch] ; 8b 56 f4
call 097aah ; e8 0d 12
mov ax, word [bp-00eh] ; 8b 46 f2
add ax, 00108h ; 05 08 01
cwd ; 99
mov cx, dx ; 89 d1
mov dx, si ; 89 f2
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea bx, [si+004h] ; 8d 5c 04
xor ax, ax ; 31 c0
xor cx, cx ; 31 c9
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov ax, word [bp-00eh] ; 8b 46 f2
add ax, 0010ch ; 05 0c 01
cwd ; 99
mov cx, dx ; 89 d1
mov dx, si ; 89 f2
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
xor ax, ax ; 31 c0
xor cx, cx ; 31 c9
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov ax, word [bp-00eh] ; 8b 46 f2
db 0feh, 0c4h
; inc ah ; fe c4
cwd ; 99
mov cx, dx ; 89 d1
mov dx, si ; 89 f2
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
xor ax, ax ; 31 c0
xor cx, cx ; 31 c9
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov ax, word [bp-00eh] ; 8b 46 f2
add ax, 00104h ; 05 04 01
cwd ; 99
mov cx, dx ; 89 d1
mov dx, si ; 89 f2
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
xor ax, ax ; 31 c0
xor cx, cx ; 31 c9
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov ax, word [bp-00eh] ; 8b 46 f2
add ax, 00114h ; 05 14 01
cwd ; 99
mov cx, dx ; 89 d1
mov dx, si ; 89 f2
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
xor ax, ax ; 31 c0
xor cx, cx ; 31 c9
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-00ch] ; 8e 46 f4
mov byte [es:di+00262h], 0ffh ; 26 c6 85 62 02 ff
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
ahci_port_init_: ; 0xf8660 LB 0x206
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
mov si, ax ; 89 c6
mov word [bp-00ah], dx ; 89 56 f6
mov byte [bp-008h], bl ; 88 5e f8
call 0851ch ; e8 a8 fe
movzx dx, bl ; 0f b6 d3
sal dx, 007h ; c1 e2 07
add dx, 00118h ; 81 c2 18 01
mov es, [bp-00ah] ; 8e 46 f6
mov ax, word [es:si+00260h] ; 26 8b 84 60 02
mov bx, strict word 00011h ; bb 11 00
xor cx, cx ; 31 c9
call 081aah ; e8 1c fb
movzx di, byte [bp-008h] ; 0f b6 7e f8
sal di, 007h ; c1 e7 07
lea dx, [di+00118h] ; 8d 95 18 01
mov es, [bp-00ah] ; 8e 46 f6
mov ax, word [es:si+00260h] ; 26 8b 84 60 02
mov bx, 0c011h ; bb 11 c0
xor cx, cx ; 31 c9
call 081f1h ; e8 48 fb
cmp AL, strict byte 001h ; 3c 01
je short 0868eh ; 74 e1
mov cx, strict word 00020h ; b9 20 00
xor bx, bx ; 31 db
mov ax, si ; 89 f0
mov dx, word [bp-00ah] ; 8b 56 f6
call 097aah ; e8 f0 10
lea ax, [si+00080h] ; 8d 84 80 00
mov cx, strict word 00040h ; b9 40 00
xor bx, bx ; 31 db
mov dx, word [bp-00ah] ; 8b 56 f6
call 097aah ; e8 e1 10
mov ax, si ; 89 f0
add ah, 002h ; 80 c4 02
mov word [bp-00ch], ax ; 89 46 f4
mov cx, strict word 00060h ; b9 60 00
xor bx, bx ; 31 db
mov dx, word [bp-00ah] ; 8b 56 f6
call 097aah ; e8 ce 10
lea ax, [di+00108h] ; 8d 85 08 01
cwd ; 99
mov es, [bp-00ah] ; 8e 46 f6
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov ax, word [bp-00ch] ; 8b 46 f4
mov dx, word [bp-00ah] ; 8b 56 f6
call 08245h ; e8 46 fb
mov es, [bp-00ah] ; 8e 46 f6
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
add bx, strict byte 00004h ; 83 c3 04
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea ax, [di+0010ch] ; 8d 85 0c 01
cwd ; 99
mov es, [bp-00ah] ; 8e 46 f6
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-00ah] ; 8e 46 f6
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
add dx, strict byte 00004h ; 83 c2 04
xor ax, ax ; 31 c0
xor cx, cx ; 31 c9
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea ax, [di+00100h] ; 8d 85 00 01
cwd ; 99
mov es, [bp-00ah] ; 8e 46 f6
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov ax, si ; 89 f0
mov dx, word [bp-00ah] ; 8b 56 f6
call 08245h ; e8 da fa
mov es, [bp-00ah] ; 8e 46 f6
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
add bx, strict byte 00004h ; 83 c3 04
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea ax, [di+00104h] ; 8d 85 04 01
cwd ; 99
mov es, [bp-00ah] ; 8e 46 f6
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-00ah] ; 8e 46 f6
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
add dx, strict byte 00004h ; 83 c2 04
xor ax, ax ; 31 c0
xor cx, cx ; 31 c9
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea ax, [di+00114h] ; 8d 85 14 01
cwd ; 99
mov es, [bp-00ah] ; 8e 46 f6
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-00ah] ; 8e 46 f6
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
add dx, strict byte 00004h ; 83 c2 04
xor ax, ax ; 31 c0
xor cx, cx ; 31 c9
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea ax, [di+00110h] ; 8d 85 10 01
cwd ; 99
mov es, [bp-00ah] ; 8e 46 f6
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-00ah] ; 8e 46 f6
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
add dx, strict byte 00004h ; 83 c2 04
mov ax, strict word 0ffffh ; b8 ff ff
mov cx, ax ; 89 c1
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea ax, [di+00130h] ; 8d 85 30 01
cwd ; 99
mov es, [bp-00ah] ; 8e 46 f6
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-00ah] ; 8e 46 f6
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
add dx, strict byte 00004h ; 83 c2 04
mov ax, strict word 0ffffh ; b8 ff ff
mov cx, ax ; 89 c1
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov al, byte [bp-008h] ; 8a 46 f8
mov es, [bp-00ah] ; 8e 46 f6
mov byte [es:si+00262h], al ; 26 88 84 62 02
mov byte [es:si+00263h], 000h ; 26 c6 84 63 02 00
lea sp, [bp-006h] ; 8d 66 fa
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
@ahci_read_sectors: ; 0xf8866 LB 0x93
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
les bx, [bp+004h] ; c4 5e 04
movzx bx, byte [es:bx+008h] ; 26 0f b6 5f 08
sub bx, strict byte 0000ch ; 83 eb 0c
cmp bx, strict byte 00004h ; 83 fb 04
jbe short 0888ah ; 76 0f
push bx ; 53
push 00c66h ; 68 66 0c
push 00c78h ; 68 78 0c
push strict byte 00007h ; 6a 07
call 01972h ; e8 eb 90
add sp, strict byte 00008h ; 83 c4 08
les di, [bp+004h] ; c4 7e 04
mov dx, word [es:di+001eeh] ; 26 8b 95 ee 01
xor ax, ax ; 31 c0
call 08139h ; e8 a2 f8
mov es, [bp+006h] ; 8e 46 06
add bx, di ; 01 fb
movzx bx, byte [es:bx+001e9h] ; 26 0f b6 9f e9 01
mov si, di ; 89 fe
mov dx, word [es:si+001eeh] ; 26 8b 94 ee 01
xor ax, ax ; 31 c0
call 08660h ; e8 b2 fd
mov bx, strict word 00025h ; bb 25 00
mov ax, di ; 89 f8
mov dx, word [bp+006h] ; 8b 56 06
call 08338h ; e8 7f fa
mov bx, ax ; 89 c3
mov es, [bp+006h] ; 8e 46 06
mov ax, word [es:di+00ah] ; 26 8b 45 0a
mov word [es:si+014h], ax ; 26 89 44 14
mov cx, ax ; 89 c1
sal cx, 009h ; c1 e1 09
shr cx, 1 ; d1 e9
mov di, word [es:di+004h] ; 26 8b 7d 04
mov ax, word [es:si+006h] ; 26 8b 44 06
mov si, di ; 89 fe
mov dx, ax ; 89 c2
mov es, ax ; 8e c0
push DS ; 1e
mov ds, dx ; 8e da
rep movsw ; f3 a5
pop DS ; 1f
les si, [bp+004h] ; c4 76 04
mov dx, word [es:si+001eeh] ; 26 8b 94 ee 01
xor ax, ax ; 31 c0
call 08150h ; e8 62 f8
mov ax, bx ; 89 d8
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
@ahci_write_sectors: ; 0xf88f9 LB 0x72
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
mov si, word [bp+004h] ; 8b 76 04
mov cx, word [bp+006h] ; 8b 4e 06
mov es, cx ; 8e c1
movzx bx, byte [es:si+008h] ; 26 0f b6 5c 08
sub bx, strict byte 0000ch ; 83 eb 0c
cmp bx, strict byte 00004h ; 83 fb 04
jbe short 08921h ; 76 0f
push bx ; 53
push 00c97h ; 68 97 0c
push 00c78h ; 68 78 0c
push strict byte 00007h ; 6a 07
call 01972h ; e8 54 90
add sp, strict byte 00008h ; 83 c4 08
mov es, cx ; 8e c1
mov dx, word [es:si+001eeh] ; 26 8b 94 ee 01
xor ax, ax ; 31 c0
call 08139h ; e8 0c f8
mov es, cx ; 8e c1
add bx, si ; 01 f3
movzx bx, byte [es:bx+001e9h] ; 26 0f b6 9f e9 01
mov dx, word [es:si+001eeh] ; 26 8b 94 ee 01
xor ax, ax ; 31 c0
call 08660h ; e8 1f fd
mov bx, strict word 00035h ; bb 35 00
mov ax, si ; 89 f0
mov dx, cx ; 89 ca
call 08338h ; e8 ed f9
mov bx, ax ; 89 c3
mov es, cx ; 8e c1
mov dx, word [es:si+00ah] ; 26 8b 54 0a
mov word [es:si+014h], dx ; 26 89 54 14
mov dx, word [es:si+001eeh] ; 26 8b 94 ee 01
xor ax, ax ; 31 c0
call 08150h ; e8 ef f7
mov ax, bx ; 89 d8
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
ahci_cmd_packet_: ; 0xf896b LB 0x173
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000eh ; 83 ec 0e
push ax ; 50
mov byte [bp-006h], dl ; 88 56 fa
mov word [bp-012h], bx ; 89 5e ee
mov word [bp-010h], cx ; 89 4e f0
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 e6 8c
mov si, 00122h ; be 22 01
mov word [bp-008h], ax ; 89 46 f8
cmp byte [bp+00ah], 002h ; 80 7e 0a 02
jne short 089b1h ; 75 1f
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 94 8f
push 00caah ; 68 aa 0c
push 00cbah ; 68 ba 0c
push strict byte 00004h ; 6a 04
call 01972h ; e8 ca 8f
add sp, strict byte 00006h ; 83 c4 06
mov ax, strict word 00001h ; b8 01 00
jmp near 08ad5h ; e9 24 01
test byte [bp+004h], 001h ; f6 46 04 01
jne short 089abh ; 75 f4
mov ax, word [bp+006h] ; 8b 46 06
mov dx, word [bp+008h] ; 8b 56 08
mov cx, strict word 00008h ; b9 08 00
sal ax, 1 ; d1 e0
rcl dx, 1 ; d1 d2
loop 089c0h ; e2 fa
mov es, [bp-008h] ; 8e 46 f8
mov word [es:si], ax ; 26 89 04
mov word [es:si+002h], dx ; 26 89 54 02
mov ax, word [bp+00ch] ; 8b 46 0c
mov word [es:si+004h], ax ; 26 89 44 04
mov ax, word [bp+00eh] ; 8b 46 0e
mov word [es:si+006h], ax ; 26 89 44 06
mov bx, word [es:si+00ch] ; 26 8b 5c 0c
mov ax, word [bp+006h] ; 8b 46 06
mov dx, word [bp+008h] ; 8b 56 08
xor cx, cx ; 31 c9
call 09740h ; e8 53 0d
mov word [es:si+00ah], ax ; 26 89 44 0a
xor di, di ; 31 ff
mov ax, word [es:si+001eeh] ; 26 8b 84 ee 01
mov word [bp-00ah], ax ; 89 46 f6
mov word [bp-00eh], di ; 89 7e f2
mov word [bp-00ch], ax ; 89 46 f4
sub word [bp-014h], strict byte 0000ch ; 83 6e ec 0c
xor ax, ax ; 31 c0
mov dx, word [bp-00ah] ; 8b 56 f6
call 08139h ; e8 2c f7
mov es, [bp-008h] ; 8e 46 f8
mov bx, word [bp-014h] ; 8b 5e ec
add bx, si ; 01 f3
movzx bx, byte [es:bx+001e9h] ; 26 0f b6 9f e9 01
mov dx, word [es:si+001eeh] ; 26 8b 94 ee 01
xor ax, ax ; 31 c0
call 08660h ; e8 3b fc
movzx ax, byte [bp-006h] ; 0f b6 46 fa
push ax ; 50
mov bx, word [bp-012h] ; 8b 5e ee
mov cx, word [bp-010h] ; 8b 4e f0
mov ax, 000c0h ; b8 c0 00
mov dx, word [bp-00ah] ; 8b 56 f6
call 097b7h ; e8 7e 0d
mov es, [bp-008h] ; 8e 46 f8
mov word [es:si+014h], di ; 26 89 7c 14
mov word [es:si+016h], di ; 26 89 7c 16
mov word [es:si+018h], di ; 26 89 7c 18
mov ax, word [es:si+01ah] ; 26 8b 44 1a
test ax, ax ; 85 c0
je short 08a77h ; 74 27
dec ax ; 48
mov es, [bp-00ah] ; 8e 46 f6
mov word [es:di+0010ch], ax ; 26 89 85 0c 01
mov word [es:di+0010eh], di ; 26 89 bd 0e 01
mov ax, word [es:di+00264h] ; 26 8b 85 64 02
mov dx, word [es:di+00266h] ; 26 8b 95 66 02
mov word [es:di+00100h], ax ; 26 89 85 00 01
mov word [es:di+00102h], dx ; 26 89 95 02 01
inc byte [es:di+00263h] ; 26 fe 85 63 02
mov bx, 000a0h ; bb a0 00
mov ax, si ; 89 f0
mov dx, word [bp-008h] ; 8b 56 f8
call 08338h ; e8 b6 f8
les bx, [bp-00eh] ; c4 5e f2
mov ax, word [es:bx+004h] ; 26 8b 47 04
mov dx, word [es:bx+006h] ; 26 8b 57 06
mov es, [bp-008h] ; 8e 46 f8
mov word [es:si+016h], ax ; 26 89 44 16
mov word [es:si+018h], dx ; 26 89 54 18
mov bx, word [es:si+016h] ; 26 8b 5c 16
mov cx, dx ; 89 d1
shr cx, 1 ; d1 e9
rcr bx, 1 ; d1 db
mov di, word [es:si+004h] ; 26 8b 7c 04
mov ax, word [es:si+006h] ; 26 8b 44 06
mov cx, bx ; 89 d9
mov si, di ; 89 fe
mov dx, ax ; 89 c2
mov es, ax ; 8e c0
push DS ; 1e
mov ds, dx ; 8e da
rep movsw ; f3 a5
pop DS ; 1f
mov ax, word [bp-00eh] ; 8b 46 f2
mov dx, word [bp-00ch] ; 8b 56 f4
call 08150h ; e8 8f f6
les bx, [bp-00eh] ; c4 5e f2
mov ax, word [es:bx+006h] ; 26 8b 47 06
or ax, word [es:bx+004h] ; 26 0b 47 04
jne short 08ad3h ; 75 05
mov ax, strict word 00004h ; b8 04 00
jmp short 08ad5h ; eb 02
xor ax, ax ; 31 c0
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 0000ch ; c2 0c 00
ahci_port_detect_device_: ; 0xf8ade LB 0x451
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
push di ; 57
sub sp, 00220h ; 81 ec 20 02
mov si, ax ; 89 c6
mov word [bp-012h], dx ; 89 56 ee
mov byte [bp-008h], bl ; 88 5e f8
movzx di, bl ; 0f b6 fb
mov bx, di ; 89 fb
call 08660h ; e8 68 fb
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 6b 8b
mov word [bp-010h], 00122h ; c7 46 f0 22 01
mov word [bp-00eh], ax ; 89 46 f2
sal di, 007h ; c1 e7 07
mov word [bp-020h], di ; 89 7e e0
lea ax, [di+0012ch] ; 8d 85 2c 01
cwd ; 99
mov di, ax ; 89 c7
mov bx, dx ; 89 d3
mov es, [bp-012h] ; 8e 46 ee
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
mov cx, bx ; 89 d9
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-012h] ; 8e 46 ee
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
add dx, strict byte 00004h ; 83 c2 04
mov ax, strict word 00001h ; b8 01 00
xor cx, cx ; 31 c9
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-012h] ; 8e 46 ee
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
mov ax, di ; 89 f8
mov cx, bx ; 89 d9
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-012h] ; 8e 46 ee
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
add dx, strict byte 00004h ; 83 c2 04
xor ax, ax ; 31 c0
xor cx, cx ; 31 c9
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov ax, word [bp-020h] ; 8b 46 e0
add ax, 00128h ; 05 28 01
cwd ; 99
mov es, [bp-012h] ; 8e 46 ee
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-012h] ; 8e 46 ee
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
add dx, strict byte 00004h ; 83 c2 04
in eax, DX ; 66 ed
db 08bh, 0d0h
; mov dx, ax ; 8b d0
shr eax, 010h ; 66 c1 e8 10
xchg dx, ax ; 92
push strict byte 00000h ; 6a 00
mov bx, strict word 0000fh ; bb 0f 00
xor cx, cx ; 31 c9
call 0822ah ; e8 7f f6
test ax, ax ; 85 c0
je near 08f27h ; 0f 84 76 03
movzx ax, byte [bp-008h] ; 0f b6 46 f8
sal ax, 007h ; c1 e0 07
mov word [bp-016h], ax ; 89 46 ea
add ax, 00128h ; 05 28 01
cwd ; 99
mov es, [bp-012h] ; 8e 46 ee
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-012h] ; 8e 46 ee
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
add dx, strict byte 00004h ; 83 c2 04
in eax, DX ; 66 ed
db 08bh, 0d0h
; mov dx, ax ; 8b d0
shr eax, 010h ; 66 c1 e8 10
xchg dx, ax ; 92
mov di, ax ; 89 c7
mov word [bp-01ah], dx ; 89 56 e6
push strict byte 00000h ; 6a 00
mov bx, strict word 0000fh ; bb 0f 00
xor cx, cx ; 31 c9
call 0822ah ; e8 33 f6
cmp ax, strict word 00001h ; 3d 01 00
je short 08bb1h ; 74 b5
push strict byte 00000h ; 6a 00
mov bx, strict word 0000fh ; bb 0f 00
xor cx, cx ; 31 c9
mov ax, di ; 89 f8
mov dx, word [bp-01ah] ; 8b 56 e6
call 0822ah ; e8 1f f6
cmp ax, strict word 00003h ; 3d 03 00
jne near 08f27h ; 0f 85 15 03
mov ax, word [bp-016h] ; 8b 46 ea
add ax, 00130h ; 05 30 01
cwd ; 99
mov es, [bp-012h] ; 8e 46 ee
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-012h] ; 8e 46 ee
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
add dx, strict byte 00004h ; 83 c2 04
mov ax, strict word 0ffffh ; b8 ff ff
mov cx, ax ; 89 c1
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
les bx, [bp-010h] ; c4 5e f0
mov al, byte [es:bx+001edh] ; 26 8a 87 ed 01
mov byte [bp-00ch], al ; 88 46 f4
cmp AL, strict byte 004h ; 3c 04
jnc near 08f27h ; 0f 83 cf 02
mov dx, word [bp-016h] ; 8b 56 ea
add dx, 00118h ; 81 c2 18 01
mov es, [bp-012h] ; 8e 46 ee
mov ax, word [es:si+00260h] ; 26 8b 84 60 02
mov bx, strict word 00010h ; bb 10 00
xor cx, cx ; 31 c9
call 08167h ; e8 f8 f4
mov ax, word [bp-016h] ; 8b 46 ea
add ax, 00124h ; 05 24 01
cwd ; 99
mov es, [bp-012h] ; 8e 46 ee
mov bx, word [es:si+00260h] ; 26 8b 9c 60 02
mov cx, dx ; 89 d1
mov dx, bx ; 89 da
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov es, [bp-012h] ; 8e 46 ee
mov dx, word [es:si+00260h] ; 26 8b 94 60 02
add dx, strict byte 00004h ; 83 c2 04
in eax, DX ; 66 ed
db 08bh, 0d0h
; mov dx, ax ; 8b d0
shr eax, 010h ; 66 c1 e8 10
xchg dx, ax ; 92
mov cl, byte [bp-00ch] ; 8a 4e f4
add cl, 00ch ; 80 c1 0c
test dx, dx ; 85 d2
jne near 08e83h ; 0f 85 d8 01
cmp ax, 00101h ; 3d 01 01
jne near 08e83h ; 0f 85 d1 01
les bx, [bp-010h] ; c4 5e f0
db 066h, 026h, 0c7h, 007h, 000h, 000h, 000h, 000h
; mov dword [es:bx], strict dword 000000000h ; 66 26 c7 07 00 00 00 00
lea dx, [bp-00226h] ; 8d 96 da fd
mov word [es:bx+004h], dx ; 26 89 57 04
mov [es:bx+006h], ss ; 26 8c 57 06
db 066h, 026h, 0c7h, 047h, 00ah, 001h, 000h, 000h, 002h
; mov dword [es:bx+00ah], strict dword 002000001h ; 66 26 c7 47 0a 01 00 00 02
mov bx, 000ech ; bb ec 00
mov ax, word [bp-010h] ; 8b 46 f0
mov dx, es ; 8c c2
call 08338h ; e8 5b f6
mov byte [bp-00ah], cl ; 88 4e f6
test byte [bp-00226h], 080h ; f6 86 da fd 80
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
xor ah, ah ; 30 e4
mov dl, al ; 88 c2
mov ax, word [bp-00224h] ; 8b 86 dc fd
mov word [bp-018h], ax ; 89 46 e8
mov ax, word [bp-00220h] ; 8b 86 e0 fd
mov word [bp-01eh], ax ; 89 46 e2
mov ax, word [bp-0021ah] ; 8b 86 e6 fd
mov word [bp-01ch], ax ; 89 46 e4
mov ax, word [bp-001aeh] ; 8b 86 52 fe
mov word [bp-014h], ax ; 89 46 ec
mov di, word [bp-001ach] ; 8b be 54 fe
cmp di, 00fffh ; 81 ff ff 0f
jne short 08d22h ; 75 10
cmp ax, strict word 0ffffh ; 3d ff ff
jne short 08d22h ; 75 0b
mov ax, word [bp-0015eh] ; 8b 86 a2 fe
mov word [bp-014h], ax ; 89 46 ec
mov di, word [bp-0015ch] ; 8b be a4 fe
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
mov es, [bp-00eh] ; 8e 46 f2
add bx, word [bp-010h] ; 03 5e f0
mov al, byte [bp-008h] ; 8a 46 f8
mov byte [es:bx+001e9h], al ; 26 88 87 e9 01
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
imul ax, ax, strict byte 00018h ; 6b c0 18
mov si, word [bp-010h] ; 8b 76 f0
add si, ax ; 01 c6
mov word [es:si+01eh], 0ff05h ; 26 c7 44 1e 05 ff
mov byte [es:si+020h], dl ; 26 88 54 20
mov byte [es:si+021h], 000h ; 26 c6 44 21 00
mov word [es:si+024h], 00200h ; 26 c7 44 24 00 02
mov byte [es:si+023h], 001h ; 26 c6 44 23 01
mov ax, word [bp-014h] ; 8b 46 ec
mov word [es:si+032h], ax ; 26 89 44 32
mov word [es:si+034h], di ; 26 89 7c 34
mov ax, word [bp-01eh] ; 8b 46 e2
mov word [es:si+02ch], ax ; 26 89 44 2c
mov ax, word [bp-018h] ; 8b 46 e8
mov word [es:si+02eh], ax ; 26 89 44 2e
mov ax, word [bp-01ch] ; 8b 46 e4
mov word [es:si+030h], ax ; 26 89 44 30
mov al, byte [bp-00ch] ; 8a 46 f4
cmp AL, strict byte 001h ; 3c 01
jc short 08d8dh ; 72 0c
jbe short 08d95h ; 76 12
cmp AL, strict byte 003h ; 3c 03
je short 08d9dh ; 74 16
cmp AL, strict byte 002h ; 3c 02
je short 08d99h ; 74 0e
jmp short 08de6h ; eb 59
test al, al ; 84 c0
jne short 08de6h ; 75 55
mov DL, strict byte 040h ; b2 40
jmp short 08d9fh ; eb 0a
mov DL, strict byte 048h ; b2 48
jmp short 08d9fh ; eb 06
mov DL, strict byte 050h ; b2 50
jmp short 08d9fh ; eb 02
mov DL, strict byte 058h ; b2 58
mov al, dl ; 88 d0
add AL, strict byte 007h ; 04 07
movzx bx, al ; 0f b6 d8
mov ax, bx ; 89 d8
call 016ach ; e8 01 89
test al, al ; 84 c0
je short 08de6h ; 74 37
mov al, dl ; 88 d0
db 0feh, 0c0h
; inc al ; fe c0
xor ah, ah ; 30 e4
call 016ach ; e8 f4 88
xor ah, ah ; 30 e4
mov si, ax ; 89 c6
sal si, 008h ; c1 e6 08
movzx ax, dl ; 0f b6 c2
call 016ach ; e8 e7 88
xor ah, ah ; 30 e4
add ax, si ; 01 f0
mov word [bp-024h], ax ; 89 46 dc
mov al, dl ; 88 d0
add AL, strict byte 002h ; 04 02
xor ah, ah ; 30 e4
call 016ach ; e8 d7 88
xor ah, ah ; 30 e4
mov word [bp-026h], ax ; 89 46 da
mov ax, bx ; 89 d8
call 016ach ; e8 cd 88
xor ah, ah ; 30 e4
mov word [bp-022h], ax ; 89 46 de
jmp short 08df3h ; eb 0d
mov bx, word [bp-014h] ; 8b 5e ec
mov cx, di ; 89 f9
mov dx, ss ; 8c d2
lea ax, [bp-026h] ; 8d 46 da
call 055b6h ; e8 c3 c7
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 33 8b
push di ; 57
push word [bp-014h] ; ff 76 ec
mov ax, word [bp-022h] ; 8b 46 de
push ax ; 50
mov ax, word [bp-026h] ; 8b 46 da
push ax ; 50
mov ax, word [bp-024h] ; 8b 46 dc
push ax ; 50
push dword [bp-01eh] ; 66 ff 76 e2
push word [bp-018h] ; ff 76 e8
movzx ax, byte [bp-008h] ; 0f b6 46 f8
push ax ; 50
movzx ax, byte [bp-00ch] ; 0f b6 46 f4
push ax ; 50
push 00cdah ; 68 da 0c
push strict byte 00004h ; 6a 04
call 01972h ; e8 4b 8b
add sp, strict byte 00018h ; 83 c4 18
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
imul ax, ax, strict byte 00018h ; 6b c0 18
mov di, word [bp-010h] ; 8b 7e f0
add di, ax ; 01 c7
mov es, [bp-00eh] ; 8e 46 f2
lea di, [di+026h] ; 8d 7d 26
push DS ; 1e
push SS ; 16
pop DS ; 1f
lea si, [bp-026h] ; 8d 76 da
movsw ; a5
movsw ; a5
movsw ; a5
pop DS ; 1f
mov bx, word [bp-010h] ; 8b 5e f0
mov al, byte [es:bx+0019eh] ; 26 8a 87 9e 01
mov ah, byte [bp-00ch] ; 8a 66 f4
add ah, 00ch ; 80 c4 0c
movzx bx, al ; 0f b6 d8
add bx, word [bp-010h] ; 03 5e f0
mov byte [es:bx+0019fh], ah ; 26 88 a7 9f 01
db 0feh, 0c0h
; inc al ; fe c0
mov bx, word [bp-010h] ; 8b 5e f0
mov byte [es:bx+0019eh], al ; 26 88 87 9e 01
mov dx, strict word 00075h ; ba 75 00
mov ax, strict word 00040h ; b8 40 00
call 01650h ; e8 de 87
db 0feh, 0c0h
; inc al ; fe c0
movzx bx, al ; 0f b6 d8
mov dx, strict word 00075h ; ba 75 00
mov ax, strict word 00040h ; b8 40 00
call 0165eh ; e8 de 87
jmp near 08f19h ; e9 96 00
cmp dx, 0eb14h ; 81 fa 14 eb
jne near 08f19h ; 0f 85 8e 00
cmp ax, 00101h ; 3d 01 01
jne near 08f19h ; 0f 85 87 00
les bx, [bp-010h] ; c4 5e f0
db 066h, 026h, 0c7h, 007h, 000h, 000h, 000h, 000h
; mov dword [es:bx], strict dword 000000000h ; 66 26 c7 07 00 00 00 00
lea dx, [bp-00226h] ; 8d 96 da fd
mov word [es:bx+004h], dx ; 26 89 57 04
mov [es:bx+006h], ss ; 26 8c 57 06
db 066h, 026h, 0c7h, 047h, 00ah, 001h, 000h, 000h, 002h
; mov dword [es:bx+00ah], strict dword 002000001h ; 66 26 c7 47 0a 01 00 00 02
mov bx, 000a1h ; bb a1 00
mov ax, word [bp-010h] ; 8b 46 f0
mov dx, es ; 8c c2
call 08338h ; e8 7b f4
test byte [bp-00226h], 080h ; f6 86 da fd 80
db 00fh, 095h, 0c0h
; setne al ; 0f 95 c0
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
mov es, [bp-00eh] ; 8e 46 f2
add bx, word [bp-010h] ; 03 5e f0
mov al, byte [bp-008h] ; 8a 46 f8
mov byte [es:bx+001e9h], al ; 26 88 87 e9 01
movzx ax, cl ; 0f b6 c1
imul ax, ax, strict byte 00018h ; 6b c0 18
mov si, word [bp-010h] ; 8b 76 f0
add si, ax ; 01 c6
mov word [es:si+01eh], 00505h ; 26 c7 44 1e 05 05
mov byte [es:si+020h], dl ; 26 88 54 20
mov word [es:si+024h], 00800h ; 26 c7 44 24 00 08
mov bx, word [bp-010h] ; 8b 5e f0
mov al, byte [es:bx+001afh] ; 26 8a 87 af 01
mov ah, byte [bp-00ch] ; 8a 66 f4
add ah, 00ch ; 80 c4 0c
movzx bx, al ; 0f b6 d8
add bx, word [bp-010h] ; 03 5e f0
mov byte [es:bx+001b0h], ah ; 26 88 a7 b0 01
db 0feh, 0c0h
; inc al ; fe c0
mov bx, word [bp-010h] ; 8b 5e f0
mov byte [es:bx+001afh], al ; 26 88 87 af 01
inc byte [bp-00ch] ; fe 46 f4
mov al, byte [bp-00ch] ; 8a 46 f4
les bx, [bp-010h] ; c4 5e f0
mov byte [es:bx+001edh], al ; 26 88 87 ed 01
lea sp, [bp-006h] ; 8d 66 fa
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
ahci_mem_alloc_: ; 0xf8f2f LB 0x43
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push dx ; 52
push si ; 56
push di ; 57
mov dx, 00413h ; ba 13 04
xor ax, ax ; 31 c0
call 0166ch ; e8 2d 87
test ax, ax ; 85 c0
je short 08f68h ; 74 25
dec ax ; 48
mov bx, ax ; 89 c3
xor dx, dx ; 31 d2
mov cx, strict word 0000ah ; b9 0a 00
sal ax, 1 ; d1 e0
rcl dx, 1 ; d1 d2
loop 08f4bh ; e2 fa
mov si, ax ; 89 c6
mov di, dx ; 89 d7
mov cx, strict word 00004h ; b9 04 00
shr di, 1 ; d1 ef
rcr si, 1 ; d1 de
loop 08f58h ; e2 fa
mov dx, 00413h ; ba 13 04
xor ax, ax ; 31 c0
call 0167ah ; e8 14 87
mov ax, si ; 89 f0
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
ahci_hba_init_: ; 0xf8f72 LB 0x125
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 00006h ; 83 ec 06
mov si, ax ; 89 c6
mov dx, strict word 0000eh ; ba 0e 00
mov ax, strict word 00040h ; b8 40 00
call 0166ch ; e8 e4 86
mov bx, 00122h ; bb 22 01
mov word [bp-010h], ax ; 89 46 f0
mov ax, strict word 00010h ; b8 10 00
xor cx, cx ; 31 c9
mov dx, si ; 89 f2
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea dx, [si+004h] ; 8d 54 04
in eax, DX ; 66 ed
db 08bh, 0d0h
; mov dx, ax ; 8b d0
shr eax, 010h ; 66 c1 e8 10
xchg dx, ax ; 92
call 08f2fh ; e8 82 ff
mov di, ax ; 89 c7
test ax, ax ; 85 c0
je near 09076h ; 0f 84 c1 00
mov es, [bp-010h] ; 8e 46 f0
mov word [es:bx+001eeh], di ; 26 89 bf ee 01
mov byte [es:bx+001edh], 000h ; 26 c6 87 ed 01 00
xor bx, bx ; 31 db
mov es, di ; 8e c7
mov byte [es:bx+00262h], 0ffh ; 26 c6 87 62 02 ff
mov word [es:bx+00260h], si ; 26 89 b7 60 02
db 066h, 026h, 0c7h, 087h, 064h, 002h, 000h, 0c0h, 00ch, 000h
; mov dword [es:bx+00264h], strict dword 0000cc000h ; 66 26 c7 87 64 02 00 c0 0c 00
mov bx, strict word 00001h ; bb 01 00
xor cx, cx ; 31 c9
mov dx, strict word 00004h ; ba 04 00
mov ax, si ; 89 f0
call 08167h ; e8 7e f1
mov ax, strict word 00004h ; b8 04 00
xor cx, cx ; 31 c9
mov dx, si ; 89 f2
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
lea bx, [si+004h] ; 8d 5c 04
mov dx, bx ; 89 da
in eax, DX ; 66 ed
db 08bh, 0d0h
; mov dx, ax ; 8b d0
shr eax, 010h ; 66 c1 e8 10
xchg dx, ax ; 92
test AL, strict byte 001h ; a8 01
jne short 08fe9h ; 75 de
xor ax, ax ; 31 c0
xor cx, cx ; 31 c9
mov dx, si ; 89 f2
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
mov dx, bx ; 89 da
in eax, DX ; 66 ed
db 08bh, 0d0h
; mov dx, ax ; 8b d0
shr eax, 010h ; 66 c1 e8 10
xchg dx, ax ; 92
push strict byte 00000h ; 6a 00
mov bx, strict word 0001fh ; bb 1f 00
xor cx, cx ; 31 c9
call 0822ah ; e8 fb f1
db 0feh, 0c0h
; inc al ; fe c0
mov byte [bp-00eh], al ; 88 46 f2
mov byte [bp-00ch], 000h ; c6 46 f4 00
jmp short 09043h ; eb 09
inc byte [bp-00ch] ; fe 46 f4
cmp byte [bp-00ch], 020h ; 80 7e f4 20
jnc short 09074h ; 73 31
movzx cx, byte [bp-00ch] ; 0f b6 4e f4
mov ax, strict word 00001h ; b8 01 00
xor dx, dx ; 31 d2
jcxz 09054h ; e3 06
sal ax, 1 ; d1 e0
rcl dx, 1 ; d1 d2
loop 0904eh ; e2 fa
mov bx, ax ; 89 c3
mov cx, dx ; 89 d1
mov dx, strict word 0000ch ; ba 0c 00
mov ax, si ; 89 f0
call 081f1h ; e8 91 f1
test al, al ; 84 c0
je short 0903ah ; 74 d6
movzx bx, byte [bp-00ch] ; 0f b6 5e f4
xor ax, ax ; 31 c0
mov dx, di ; 89 fa
call 08adeh ; e8 6f fa
dec byte [bp-00eh] ; fe 4e f2
jne short 0903ah ; 75 c6
xor ax, ax ; 31 c0
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
db 00bh, 005h, 004h, 003h, 002h, 001h, 000h, 066h, 091h, 044h, 091h, 04ah, 091h, 050h, 091h, 056h
db 091h, 05ch, 091h, 062h, 091h, 066h, 091h
_ahci_init: ; 0xf9097 LB 0xfe
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00006h ; 83 ec 06
mov ax, 00601h ; b8 01 06
mov dx, strict word 00001h ; ba 01 00
call 095b5h ; e8 0d 05
mov dx, ax ; 89 c2
cmp ax, strict word 0ffffh ; 3d ff ff
je near 0918eh ; 0f 84 dd 00
xor al, al ; 30 c0
shr ax, 008h ; c1 e8 08
mov byte [bp-00ah], al ; 88 46 f6
mov byte [bp-008h], dl ; 88 56 f8
xor dh, dh ; 30 f6
xor ah, ah ; 30 e4
mov bx, strict word 00034h ; bb 34 00
call 095e0h ; e8 1a 05
mov cl, al ; 88 c1
test cl, cl ; 84 c9
je short 090efh ; 74 23
movzx bx, cl ; 0f b6 d9
movzx di, byte [bp-008h] ; 0f b6 7e f8
movzx si, byte [bp-00ah] ; 0f b6 76 f6
mov dx, di ; 89 fa
mov ax, si ; 89 f0
call 095e0h ; e8 02 05
cmp AL, strict byte 012h ; 3c 12
je short 090efh ; 74 0d
mov al, cl ; 88 c8
db 0feh, 0c0h
; inc al ; fe c0
movzx bx, al ; 0f b6 d8
mov dx, di ; 89 fa
mov ax, si ; 89 f0
jmp short 090c3h ; eb d4
test cl, cl ; 84 c9
je near 0918eh ; 0f 84 99 00
add cl, 002h ; 80 c1 02
movzx bx, cl ; 0f b6 d9
movzx di, byte [bp-008h] ; 0f b6 7e f8
movzx si, byte [bp-00ah] ; 0f b6 76 f6
mov dx, di ; 89 fa
mov ax, si ; 89 f0
call 095e0h ; e8 d6 04
cmp AL, strict byte 010h ; 3c 10
jne near 0918eh ; 0f 85 7e 00
mov byte [bp-006h], 000h ; c6 46 fa 00
mov al, cl ; 88 c8
add AL, strict byte 002h ; 04 02
movzx bx, al ; 0f b6 d8
mov dx, di ; 89 fa
mov ax, si ; 89 f0
call 09604h ; e8 e2 04
mov dx, ax ; 89 c2
and ax, strict word 0000fh ; 25 0f 00
sub ax, strict word 00004h ; 2d 04 00
cmp ax, strict word 0000bh ; 3d 0b 00
jnbe short 09166h ; 77 37
push CS ; 0e
pop ES ; 07
mov cx, strict word 00008h ; b9 08 00
mov di, 09080h ; bf 80 90
repne scasb ; f2 ae
sal cx, 1 ; d1 e1
mov di, cx ; 89 cf
mov ax, word [cs:di-06f79h] ; 2e 8b 85 87 90
jmp ax ; ff e0
mov byte [bp-006h], 010h ; c6 46 fa 10
jmp short 09166h ; eb 1c
mov byte [bp-006h], 014h ; c6 46 fa 14
jmp short 09166h ; eb 16
mov byte [bp-006h], 018h ; c6 46 fa 18
jmp short 09166h ; eb 10
mov byte [bp-006h], 01ch ; c6 46 fa 1c
jmp short 09166h ; eb 0a
mov byte [bp-006h], 020h ; c6 46 fa 20
jmp short 09166h ; eb 04
mov byte [bp-006h], 024h ; c6 46 fa 24
mov si, dx ; 89 d6
shr si, 004h ; c1 ee 04
sal si, 002h ; c1 e6 02
mov al, byte [bp-006h] ; 8a 46 fa
test al, al ; 84 c0
je short 0918eh ; 74 19
movzx bx, al ; 0f b6 d8
movzx dx, byte [bp-008h] ; 0f b6 56 f8
movzx ax, byte [bp-00ah] ; 0f b6 46 f6
call 09626h ; e8 a3 04
test AL, strict byte 001h ; a8 01
je short 0918eh ; 74 07
and AL, strict byte 0f0h ; 24 f0
add ax, si ; 01 f0
call 08f72h ; e8 e4 fd
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
apm_out_str_: ; 0xf9195 LB 0x39
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
mov bx, ax ; 89 c3
cmp byte [bx], 000h ; 80 3f 00
je short 091aah ; 74 0a
mov al, byte [bx] ; 8a 07
out DX, AL ; ee
inc bx ; 43
mov al, byte [bx] ; 8a 07
db 00ah, 0c0h
; or al, al ; 0a c0
jne short 091a2h ; 75 f8
lea sp, [bp-002h] ; 8d 66 fe
pop bx ; 5b
pop bp ; 5d
retn ; c3
db 0f1h
xchg cx, ax ; 91
mov bp, 00392h ; bd 92 03
xchg dx, ax ; 92
push DS ; 1e
xchg dx, ax ; 92
mov bp, 04992h ; bd 92 49
xchg dx, ax ; 92
mov bp, 04e92h ; bd 92 4e
xchg dx, ax ; 92
xchg dx, ax ; 92
xchg dx, ax ; 92
xchg dx, ax ; 92
xchg dx, ax ; 92
xchg dx, ax ; 92
xchg dx, ax ; 92
lea dx, [bp+si-06d6eh] ; 8d 92 92 92
xchg dx, ax ; 92
xchg dx, ax ; 92
db 086h
xchg dx, ax ; 92
_apm_function: ; 0xf91ce LB 0xf5
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
and byte [bp+018h], 0feh ; 80 66 18 fe
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
cmp ax, strict word 0000eh ; 3d 0e 00
jnbe near 09292h ; 0f 87 b0 00
mov bx, ax ; 89 c3
add bx, ax ; 01 c3
mov dx, word [bp+018h] ; 8b 56 18
or dl, 001h ; 80 ca 01
jmp word [cs:bx-06e50h] ; 2e ff a7 b0 91
mov word [bp+012h], 00102h ; c7 46 12 02 01
mov word [bp+00ch], 0504dh ; c7 46 0c 4d 50
mov word [bp+010h], strict word 00003h ; c7 46 10 03 00
jmp near 092bdh ; e9 ba 00
mov word [bp+012h], 0f000h ; c7 46 12 00 f0
mov word [bp+00ch], 09824h ; c7 46 0c 24 98
mov word [bp+010h], 0f000h ; c7 46 10 00 f0
mov ax, strict word 0fff0h ; b8 f0 ff
mov word [bp+006h], ax ; 89 46 06
mov word [bp+004h], ax ; 89 46 04
jmp near 092bdh ; e9 9f 00
mov word [bp+012h], 0f000h ; c7 46 12 00 f0
mov word [bp+00ch], 0da40h ; c7 46 0c 40 da
mov ax, 0f000h ; b8 00 f0
mov word [bp+010h], ax ; 89 46 10
mov word [bp+00eh], ax ; 89 46 0e
mov ax, strict word 0fff0h ; b8 f0 ff
mov word [bp+006h], ax ; 89 46 06
mov word [bp+004h], ax ; 89 46 04
xor bx, bx ; 31 db
sal ebx, 010h ; 66 c1 e3 10
mov si, ax ; 89 c6
sal esi, 010h ; 66 c1 e6 10
jmp near 092bdh ; e9 74 00
sti ; fb
hlt ; f4
jmp near 092bdh ; e9 6f 00
cmp word [bp+010h], strict byte 00003h ; 83 7e 10 03
je short 09273h ; 74 1f
cmp word [bp+010h], strict byte 00002h ; 83 7e 10 02
je short 0926bh ; 74 11
cmp word [bp+010h], strict byte 00001h ; 83 7e 10 01
jne short 0927bh ; 75 1b
mov dx, 08900h ; ba 00 89
mov ax, 00d12h ; b8 12 0d
call 09195h ; e8 2c ff
jmp short 092bdh ; eb 52
mov dx, 08900h ; ba 00 89
mov ax, 00d1ah ; b8 1a 0d
jmp short 09266h ; eb f3
mov dx, 08900h ; ba 00 89
mov ax, 00d22h ; b8 22 0d
jmp short 09266h ; eb eb
or ah, 00ah ; 80 cc 0a
mov word [bp+012h], ax ; 89 46 12
mov word [bp+018h], dx ; 89 56 18
jmp short 092bdh ; eb 37
mov word [bp+012h], 00102h ; c7 46 12 02 01
jmp short 092bdh ; eb 30
or ah, 080h ; 80 cc 80
jmp short 0927eh ; eb ec
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 94 86
push word [bp+00ch] ; ff 76 0c
push word [bp+012h] ; ff 76 12
push 00d2bh ; 68 2b 0d
push strict byte 00004h ; 6a 04
call 01972h ; e8 c7 86
add sp, strict byte 00008h ; 83 c4 08
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
or ah, 00ch ; 80 cc 0c
mov word [bp+012h], ax ; 89 46 12
or byte [bp+018h], 001h ; 80 4e 18 01
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn ; c3
pci16_select_reg_: ; 0xf92c3 LB 0x24
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
and dl, 0fch ; 80 e2 fc
mov bx, dx ; 89 d3
mov dx, 00cf8h ; ba f8 0c
movzx eax, ax ; 66 0f b7 c0
sal eax, 008h ; 66 c1 e0 08
or eax, strict dword 080000000h ; 66 0d 00 00 00 80
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, eax ; 66 ef
lea sp, [bp-002h] ; 8d 66 fe
pop bx ; 5b
pop bp ; 5d
retn ; c3
pci16_find_device_: ; 0xf92e7 LB 0xf7
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000ch ; 83 ec 0c
push ax ; 50
push dx ; 52
mov si, bx ; 89 de
mov di, cx ; 89 cf
test cx, cx ; 85 c9
xor bx, bx ; 31 db
mov byte [bp-008h], 000h ; c6 46 f8 00
test bl, 007h ; f6 c3 07
jne short 0932fh ; 75 2d
mov dx, strict word 0000eh ; ba 0e 00
mov ax, bx ; 89 d8
call 092c3h ; e8 b9 ff
mov dx, 00cfeh ; ba fe 0c
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov byte [bp-006h], al ; 88 46 fa
cmp AL, strict byte 0ffh ; 3c ff
jne short 0931dh ; 75 06
add bx, strict byte 00008h ; 83 c3 08
jmp near 093b0h ; e9 93 00
test byte [bp-006h], 080h ; f6 46 fa 80
je short 0932ah ; 74 07
mov word [bp-00ah], strict word 00001h ; c7 46 f6 01 00
jmp short 0932fh ; eb 05
mov word [bp-00ah], strict word 00008h ; c7 46 f6 08 00
mov al, byte [bp-006h] ; 8a 46 fa
and AL, strict byte 007h ; 24 07
cmp AL, strict byte 001h ; 3c 01
jne short 09357h ; 75 1f
mov ax, bx ; 89 d8
shr ax, 008h ; c1 e8 08
test ax, ax ; 85 c0
jne short 09357h ; 75 16
mov dx, strict word 0001ah ; ba 1a 00
mov ax, bx ; 89 d8
call 092c3h ; e8 7a ff
mov dx, 00cfeh ; ba fe 0c
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp al, byte [bp-008h] ; 3a 46 f8
jbe short 09357h ; 76 03
mov byte [bp-008h], al ; 88 46 f8
test di, di ; 85 ff
je short 09360h ; 74 05
mov dx, strict word 00008h ; ba 08 00
jmp short 09362h ; eb 02
xor dx, dx ; 31 d2
mov ax, bx ; 89 d8
call 092c3h ; e8 5c ff
mov dx, 00cfch ; ba fc 0c
in eax, DX ; 66 ed
db 08bh, 0d0h
; mov dx, ax ; 8b d0
shr eax, 010h ; 66 c1 e8 10
xchg dx, ax ; 92
mov word [bp-00eh], ax ; 89 46 f2
mov word [bp-00ch], dx ; 89 56 f4
mov word [bp-010h], strict word 00000h ; c7 46 f0 00 00
test di, di ; 85 ff
je short 09391h ; 74 0f
mov cx, strict word 00008h ; b9 08 00
shr dx, 1 ; d1 ea
rcr ax, 1 ; d1 d8
loop 09385h ; e2 fa
mov word [bp-00eh], ax ; 89 46 f2
mov word [bp-00ch], dx ; 89 56 f4
mov ax, word [bp-00ch] ; 8b 46 f4
cmp ax, word [bp-014h] ; 3b 46 ec
jne short 093a1h ; 75 08
mov ax, word [bp-00eh] ; 8b 46 f2
cmp ax, word [bp-012h] ; 3b 46 ee
je short 093a7h ; 74 06
cmp word [bp-010h], strict byte 00000h ; 83 7e f0 00
je short 093adh ; 74 06
dec si ; 4e
cmp si, strict byte 0ffffh ; 83 fe ff
je short 093bfh ; 74 12
add bx, word [bp-00ah] ; 03 5e f6
mov dx, bx ; 89 da
shr dx, 008h ; c1 ea 08
movzx ax, byte [bp-008h] ; 0f b6 46 f8
cmp dx, ax ; 39 c2
jbe near 092fdh ; 0f 86 3e ff
cmp si, strict byte 0ffffh ; 83 fe ff
jne short 093c8h ; 75 04
mov ax, bx ; 89 d8
jmp short 093cbh ; eb 03
mov ax, strict word 0ffffh ; b8 ff ff
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
rcl byte [si-06b26h], 0edh ; c0 94 da 94 ed
xchg sp, ax ; 94
add dl, byte [di-06aebh] ; 02 95 15 95
db 028h
xchg bp, ax ; 95
_pci16_function: ; 0xf93de LB 0x1d7
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
and word [bp+020h], 000ffh ; 81 66 20 ff 00
and word [bp+02ch], strict byte 0fffeh ; 83 66 2c fe
mov bx, word [bp+020h] ; 8b 5e 20
xor bh, bh ; 30 ff
mov ax, word [bp+020h] ; 8b 46 20
xor ah, ah ; 30 e4
cmp bx, strict byte 00003h ; 83 fb 03
jc short 09417h ; 72 1a
jbe short 0946fh ; 76 70
cmp bx, strict byte 0000eh ; 83 fb 0e
je near 0953ch ; 0f 84 36 01
cmp bx, strict byte 00008h ; 83 fb 08
jc near 09581h ; 0f 82 74 01
cmp bx, strict byte 0000dh ; 83 fb 0d
jbe near 09494h ; 0f 86 80 00
jmp near 09581h ; e9 6a 01
cmp bx, strict byte 00002h ; 83 fb 02
je short 0943fh ; 74 23
cmp bx, strict byte 00001h ; 83 fb 01
jne near 09581h ; 0f 85 5e 01
mov word [bp+020h], strict word 00001h ; c7 46 20 01 00
mov word [bp+014h], 00210h ; c7 46 14 10 02
mov word [bp+01ch], strict word 00000h ; c7 46 1c 00 00
mov word [bp+018h], 04350h ; c7 46 18 50 43
mov word [bp+01ah], 02049h ; c7 46 1a 49 20
jmp near 095aeh ; e9 6f 01
cmp word [bp+018h], strict byte 0ffffh ; 83 7e 18 ff
jne short 0944bh ; 75 06
or ah, 083h ; 80 cc 83
jmp near 095a7h ; e9 5c 01
mov bx, word [bp+008h] ; 8b 5e 08
mov dx, word [bp+01ch] ; 8b 56 1c
mov ax, word [bp+018h] ; 8b 46 18
xor cx, cx ; 31 c9
call 092e7h ; e8 8e fe
cmp ax, strict word 0ffffh ; 3d ff ff
jne short 09469h ; 75 0b
mov ax, word [bp+020h] ; 8b 46 20
xor ah, ah ; 30 e4
or ah, 086h ; 80 cc 86
jmp near 095a7h ; e9 3e 01
mov word [bp+014h], ax ; 89 46 14
jmp near 095aeh ; e9 3f 01
mov bx, word [bp+008h] ; 8b 5e 08
mov ax, word [bp+01ch] ; 8b 46 1c
mov dx, word [bp+01eh] ; 8b 56 1e
mov cx, strict word 00001h ; b9 01 00
call 092e7h ; e8 69 fe
cmp ax, strict word 0ffffh ; 3d ff ff
jne short 0948eh ; 75 0b
mov ax, word [bp+020h] ; 8b 46 20
xor ah, ah ; 30 e4
or ah, 086h ; 80 cc 86
jmp near 095a7h ; e9 19 01
mov word [bp+014h], ax ; 89 46 14
jmp near 095aeh ; e9 1a 01
cmp word [bp+004h], 00100h ; 81 7e 04 00 01
jc short 094a1h ; 72 06
or ah, 087h ; 80 cc 87
jmp near 095a7h ; e9 06 01
mov dx, word [bp+004h] ; 8b 56 04
mov ax, word [bp+014h] ; 8b 46 14
call 092c3h ; e8 19 fe
mov bx, word [bp+020h] ; 8b 5e 20
xor bh, bh ; 30 ff
sub bx, strict byte 00008h ; 83 eb 08
cmp bx, strict byte 00005h ; 83 fb 05
jnbe near 095aeh ; 0f 87 f5 00
add bx, bx ; 01 db
jmp word [cs:bx-06c2eh] ; 2e ff a7 d2 93
mov bx, word [bp+01ch] ; 8b 5e 1c
xor bl, bl ; 30 db
mov dx, word [bp+004h] ; 8b 56 04
and dx, strict byte 00003h ; 83 e2 03
add dx, 00cfch ; 81 c2 fc 0c
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
or bx, ax ; 09 c3
mov word [bp+01ch], bx ; 89 5e 1c
jmp near 095aeh ; e9 d4 00
mov dx, word [bp+004h] ; 8b 56 04
xor dh, dh ; 30 f6
and dl, 002h ; 80 e2 02
add dx, 00cfch ; 81 c2 fc 0c
in ax, DX ; ed
mov word [bp+01ch], ax ; 89 46 1c
jmp near 095aeh ; e9 c1 00
mov dx, 00cfch ; ba fc 0c
in eax, DX ; 66 ed
db 08bh, 0d0h
; mov dx, ax ; 8b d0
shr eax, 010h ; 66 c1 e8 10
xchg dx, ax ; 92
mov word [bp+01ch], ax ; 89 46 1c
mov word [bp+01eh], dx ; 89 56 1e
jmp near 095aeh ; e9 ac 00
mov ax, word [bp+01ch] ; 8b 46 1c
mov dx, word [bp+004h] ; 8b 56 04
xor dh, dh ; 30 f6
and dl, 003h ; 80 e2 03
add dx, 00cfch ; 81 c2 fc 0c
out DX, AL ; ee
jmp near 095aeh ; e9 99 00
mov ax, word [bp+01ch] ; 8b 46 1c
mov dx, word [bp+004h] ; 8b 56 04
xor dh, dh ; 30 f6
and dl, 002h ; 80 e2 02
add dx, 00cfch ; 81 c2 fc 0c
out DX, ax ; ef
jmp near 095aeh ; e9 86 00
mov ax, word [bp+01ch] ; 8b 46 1c
mov cx, word [bp+01eh] ; 8b 4e 1e
mov dx, 00cfch ; ba fc 0c
xchg cx, ax ; 91
sal eax, 010h ; 66 c1 e0 10
db 08bh, 0c1h
; mov ax, cx ; 8b c1
out DX, eax ; 66 ef
jmp short 095aeh ; eb 72
mov bx, word [bp+004h] ; 8b 5e 04
mov es, [bp+026h] ; 8e 46 26
mov word [bp-008h], bx ; 89 5e f8
mov [bp-006h], es ; 8c 46 fa
mov cx, word [0f4a0h] ; 8b 0e a0 f4
cmp cx, word [es:bx] ; 26 3b 0f
jbe short 09562h ; 76 11
mov ax, word [bp+020h] ; 8b 46 20
xor ah, ah ; 30 e4
or ah, 089h ; 80 cc 89
mov word [bp+020h], ax ; 89 46 20
or word [bp+02ch], strict byte 00001h ; 83 4e 2c 01
jmp short 09576h ; eb 14
les di, [es:bx+002h] ; 26 c4 7f 02
mov si, 0f2c0h ; be c0 f2
mov dx, ds ; 8c da
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
mov word [bp+014h], 00a00h ; c7 46 14 00 0a
mov ax, word [0f4a0h] ; a1 a0 f4
les bx, [bp-008h] ; c4 5e f8
mov word [es:bx], ax ; 26 89 07
jmp short 095aeh ; eb 2d
mov bx, 00da2h ; bb a2 0d
mov cx, ds ; 8c d9
mov ax, strict word 00004h ; b8 04 00
call 01931h ; e8 a5 83
mov ax, word [bp+014h] ; 8b 46 14
push ax ; 50
mov ax, word [bp+020h] ; 8b 46 20
push ax ; 50
push 00d5eh ; 68 5e 0d
push strict byte 00004h ; 6a 04
call 01972h ; e8 d6 83
add sp, strict byte 00008h ; 83 c4 08
mov ax, word [bp+020h] ; 8b 46 20
xor ah, ah ; 30 e4
or ah, 081h ; 80 cc 81
mov word [bp+020h], ax ; 89 46 20
or word [bp+02ch], strict byte 00001h ; 83 4e 2c 01
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
pci_find_classcode_: ; 0xf95b5 LB 0x2b
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
mov cx, dx ; 89 d1
xor si, si ; 31 f6
mov dx, ax ; 89 c2
mov ax, 0b103h ; b8 03 b1
sal ecx, 010h ; 66 c1 e1 10
db 08bh, 0cah
; mov cx, dx ; 8b ca
int 01ah ; cd 1a
cmp ah, 000h ; 80 fc 00
je near 095d6h ; 0f 84 03 00
mov bx, strict word 0ffffh ; bb ff ff
mov ax, bx ; 89 d8
lea sp, [bp-006h] ; 8d 66 fa
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
pci_read_config_byte_: ; 0xf95e0 LB 0x24
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push di ; 57
movzx di, bl ; 0f b6 fb
movzx bx, al ; 0f b6 d8
sal bx, 008h ; c1 e3 08
movzx ax, dl ; 0f b6 c2
or bx, ax ; 09 c3
mov ax, 0b108h ; b8 08 b1
int 01ah ; cd 1a
movzx ax, cl ; 0f b6 c1
xor dx, dx ; 31 d2
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop cx ; 59
pop bp ; 5d
retn ; c3
pci_read_config_word_: ; 0xf9604 LB 0x22
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push di ; 57
movzx di, bl ; 0f b6 fb
xor ah, ah ; 30 e4
sal ax, 008h ; c1 e0 08
movzx bx, dl ; 0f b6 da
or bx, ax ; 09 c3
mov ax, 0b109h ; b8 09 b1
int 01ah ; cd 1a
mov ax, cx ; 89 c8
xor dx, dx ; 31 d2
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop cx ; 59
pop bp ; 5d
retn ; c3
pci_read_config_dword_: ; 0xf9626 LB 0x27
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push di ; 57
movzx di, bl ; 0f b6 fb
movzx bx, al ; 0f b6 d8
sal bx, 008h ; c1 e3 08
movzx ax, dl ; 0f b6 c2
or bx, ax ; 09 c3
mov ax, 0b10ah ; b8 0a b1
int 01ah ; cd 1a
db 08bh, 0c1h
; mov ax, cx ; 8b c1
shr ecx, 010h ; 66 c1 e9 10
mov dx, cx ; 89 ca
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop cx ; 59
pop bp ; 5d
retn ; c3
vds_is_present_: ; 0xf964d LB 0x1d
push bx ; 53
push bp ; 55
mov bp, sp ; 89 e5
mov bx, strict word 0007bh ; bb 7b 00
mov ax, strict word 00040h ; b8 40 00
mov es, ax ; 8e c0
test byte [es:bx], 020h ; 26 f6 07 20
je short 09665h ; 74 06
mov ax, strict word 00001h ; b8 01 00
pop bp ; 5d
pop bx ; 5b
retn ; c3
xor ax, ax ; 31 c0
pop bp ; 5d
pop bx ; 5b
retn ; c3
vds_real_to_lin_: ; 0xf966a LB 0x1e
push bx ; 53
push cx ; 51
push bp ; 55
mov bp, sp ; 89 e5
mov bx, ax ; 89 c3
mov ax, dx ; 89 d0
xor dx, dx ; 31 d2
mov cx, strict word 00004h ; b9 04 00
sal ax, 1 ; d1 e0
rcl dx, 1 ; d1 d2
loop 09678h ; e2 fa
xor cx, cx ; 31 c9
add ax, bx ; 01 d8
adc dx, cx ; 11 ca
pop bp ; 5d
pop cx ; 59
pop bx ; 5b
retn ; c3
vds_build_sg_list_: ; 0xf9688 LB 0x79
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
mov di, ax ; 89 c7
mov si, dx ; 89 d6
mov ax, bx ; 89 d8
mov dx, cx ; 89 ca
mov bx, word [bp+004h] ; 8b 5e 04
mov es, si ; 8e c6
mov word [es:di], bx ; 26 89 1d
mov bx, word [bp+006h] ; 8b 5e 06
mov word [es:di+002h], bx ; 26 89 5d 02
call 0966ah ; e8 c3 ff
mov es, si ; 8e c6
mov word [es:di+004h], ax ; 26 89 45 04
mov word [es:di+006h], dx ; 26 89 55 06
mov word [es:di+008h], strict word 00000h ; 26 c7 45 08 00 00
call 0964dh ; e8 93 ff
test ax, ax ; 85 c0
je short 096d1h ; 74 13
mov es, si ; 8e c6
mov ax, 08105h ; b8 05 81
mov dx, strict word 00000h ; ba 00 00
int 04bh ; cd 4b
jc near 096ceh ; 0f 82 02 00
db 032h, 0c0h
; xor al, al ; 32 c0
cbw ; 98
jmp short 096f8h ; eb 27
mov es, si ; 8e c6
mov word [es:di+00eh], strict word 00001h ; 26 c7 45 0e 01 00
mov dx, word [es:di+004h] ; 26 8b 55 04
mov ax, word [es:di+006h] ; 26 8b 45 06
mov word [es:di+010h], dx ; 26 89 55 10
mov word [es:di+012h], ax ; 26 89 45 12
mov ax, word [bp+004h] ; 8b 46 04
mov word [es:di+014h], ax ; 26 89 45 14
mov ax, bx ; 89 d8
mov word [es:di+016h], bx ; 26 89 5d 16
xor ax, bx ; 31 d8
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
vds_free_sg_list_: ; 0xf9701 LB 0x3f
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push di ; 57
mov bx, ax ; 89 c3
call 0964dh ; e8 42 ff
test ax, ax ; 85 c0
je short 09722h ; 74 13
mov di, bx ; 89 df
mov es, dx ; 8e c2
mov ax, 08106h ; b8 06 81
mov dx, strict word 00000h ; ba 00 00
int 04bh ; cd 4b
jc near 09721h ; 0f 82 02 00
db 032h, 0c0h
; xor al, al ; 32 c0
cbw ; 98
mov es, dx ; 8e c2
mov word [es:bx+00eh], strict word 00000h ; 26 c7 47 0e 00 00
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop bx ; 5b
pop bp ; 5d
retn ; c3
times 0xf db 0
__U4D: ; 0xf9740 LB 0x39
pushfw ; 9c
push eax ; 66 50
push edx ; 66 52
push ecx ; 66 51
rol eax, 010h ; 66 c1 c0 10
db 08bh, 0c2h
; mov ax, dx ; 8b c2
ror eax, 010h ; 66 c1 c8 10
db 066h, 033h, 0d2h
; xor edx, edx ; 66 33 d2
shr ecx, 010h ; 66 c1 e9 10
db 08bh, 0cbh
; mov cx, bx ; 8b cb
div ecx ; 66 f7 f1
db 08bh, 0dah
; mov bx, dx ; 8b da
pop ecx ; 66 59
shr edx, 010h ; 66 c1 ea 10
db 08bh, 0cah
; mov cx, dx ; 8b ca
pop edx ; 66 5a
ror eax, 010h ; 66 c1 c8 10
db 08bh, 0d0h
; mov dx, ax ; 8b d0
add sp, strict byte 00002h ; 83 c4 02
pop ax ; 58
rol eax, 010h ; 66 c1 c0 10
popfw ; 9d
retn ; c3
__U4M: ; 0xf9779 LB 0x31
pushfw ; 9c
push eax ; 66 50
push edx ; 66 52
push ecx ; 66 51
rol eax, 010h ; 66 c1 c0 10
db 08bh, 0c2h
; mov ax, dx ; 8b c2
ror eax, 010h ; 66 c1 c8 10
db 066h, 033h, 0d2h
; xor edx, edx ; 66 33 d2
shr ecx, 010h ; 66 c1 e9 10
db 08bh, 0cbh
; mov cx, bx ; 8b cb
mul ecx ; 66 f7 e1
pop ecx ; 66 59
pop edx ; 66 5a
ror eax, 010h ; 66 c1 c8 10
db 08bh, 0d0h
; mov dx, ax ; 8b d0
add sp, strict byte 00002h ; 83 c4 02
pop ax ; 58
rol eax, 010h ; 66 c1 c0 10
popfw ; 9d
retn ; c3
_fmemset_: ; 0xf97aa LB 0xd
push di ; 57
mov es, dx ; 8e c2
db 08bh, 0f8h
; mov di, ax ; 8b f8
xchg al, bl ; 86 d8
rep stosb ; f3 aa
xchg al, bl ; 86 d8
pop di ; 5f
retn ; c3
_fmemcpy_: ; 0xf97b7 LB 0x33
push bp ; 55
db 08bh, 0ech
; mov bp, sp ; 8b ec
push di ; 57
push DS ; 1e
push si ; 56
mov es, dx ; 8e c2
db 08bh, 0f8h
; mov di, ax ; 8b f8
mov ds, cx ; 8e d9
db 08bh, 0f3h
; mov si, bx ; 8b f3
mov cx, word [bp+004h] ; 8b 4e 04
rep movsb ; f3 a4
pop si ; 5e
pop DS ; 1f
pop di ; 5f
leave ; c9
retn ; c3
add byte [bx+si], al ; 00 00
cbw ; 98
add bl, byte [bx+si-067fah] ; 02 98 06 98
push ES ; 06
cbw ; 98
push ES ; 06
cbw ; 98
or byte [bx+si-067f8h], bl ; 08 98 08 98
or bl, byte [bx+si-067f2h] ; 0a 98 0e 98
push CS ; 0e
cbw ; 98
adc byte [bx+si-067ebh], bl ; 10 98 15 98
pop SS ; 17
cbw ; 98
apm_worker: ; 0xf97ea LB 0x3a
sti ; fb
push ax ; 50
db 032h, 0e4h
; xor ah, ah ; 32 e4
sub AL, strict byte 004h ; 2c 04
db 08bh, 0e8h
; mov bp, ax ; 8b e8
sal bp, 1 ; d1 e5
cmp AL, strict byte 00dh ; 3c 0d
pop ax ; 58
mov AH, strict byte 053h ; b4 53
jnc short 09820h ; 73 25
jmp word [cs:bp-06830h] ; 2e ff a6 d0 97
jmp short 0981eh ; eb 1c
sti ; fb
hlt ; f4
jmp short 0981eh ; eb 18
jmp short 0981eh ; eb 16
jmp short 09820h ; eb 16
mov AH, strict byte 080h ; b4 80
jmp short 09822h ; eb 14
jmp short 09820h ; eb 10
mov ax, 00102h ; b8 02 01
jmp short 0981eh ; eb 09
jmp short 0981eh ; eb 07
mov BL, strict byte 000h ; b3 00
mov cx, strict word 00000h ; b9 00 00
jmp short 0981eh ; eb 00
clc ; f8
retn ; c3
mov AH, strict byte 009h ; b4 09
stc ; f9
retn ; c3
apm_pm16_entry: ; 0xf9824 LB 0x11
mov AH, strict byte 002h ; b4 02
push DS ; 1e
push bp ; 55
push CS ; 0e
pop bp ; 5d
add bp, strict byte 00008h ; 83 c5 08
mov ds, bp ; 8e dd
call 097eah ; e8 b8 ff
pop bp ; 5d
pop DS ; 1f
retf ; cb
; Padding 0x41cb bytes at 0xf9835
times 16843 db 0
section BIOS32 progbits vstart=0xda00 align=1 ; size=0x3cb class=CODE group=AUTO
bios32_service: ; 0xfda00 LB 0x26
pushfw ; 9c
cmp bl, 000h ; 80 fb 00
jne short 0da22h ; 75 1c
cmp ax, 05024h ; 3d 24 50
inc bx ; 43
dec cx ; 49
mov AL, strict byte 080h ; b0 80
jne short 0da20h ; 75 11
mov bx, strict word 00000h ; bb 00 00
db 00fh
add byte [bx+di-01000h], bh ; 00 b9 00 f0
add byte [bx+si], al ; 00 00
mov dx, 0da26h ; ba 26 da
add byte [bx+si], al ; 00 00
db 032h, 0c0h
; xor al, al ; 32 c0
popfw ; 9d
retf ; cb
mov AL, strict byte 081h ; b0 81
jmp short 0da20h ; eb fa
pcibios32_entry: ; 0xfda26 LB 0x1a
pushfw ; 9c
cld ; fc
push ES ; 06
pushaw ; 60
call 0db78h ; e8 4b 01
add byte [bx+si], al ; 00 00
popaw ; 61
pop ES ; 07
popfw ; 9d
retf ; cb
times 0xd db 0
apm_pm32_entry: ; 0xfda40 LB 0x21
push bp ; 55
mov ebp, cs ; 66 8c cd
push ebp ; 66 55
mov bp, 0da5fh ; bd 5f da
add byte [bx+si], al ; 00 00
push ebp ; 66 55
push CS ; 0e
pop bp ; 5d
add bp, strict byte 00008h ; 83 c5 08
push ebp ; 66 55
mov bp, 09826h ; bd 26 98
add byte [bx+si], al ; 00 00
push ebp ; 66 55
mov AH, strict byte 003h ; b4 03
db 066h, 0cbh
; retf ; 66 cb
pop bp ; 5d
retf ; cb
pci32_select_reg_: ; 0xfda61 LB 0x22
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
and dl, 0fch ; 80 e2 fc
mov bx, dx ; 89 d3
mov dx, 00cf8h ; ba f8 0c
add byte [bx+si], al ; 00 00
db 00fh, 0b7h, 0c0h
; movzx ax, ax ; 0f b7 c0
sal ax, 008h ; c1 e0 08
or ax, strict word 00000h ; 0d 00 00
add byte [bx+si-03c76h], al ; 00 80 8a c3
out DX, ax ; ef
lea sp, [di-004h] ; 8d 65 fc
pop bx ; 5b
pop bp ; 5d
retn ; c3
pci32_find_device_: ; 0xfda83 LB 0xf7
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
push di ; 57
sub sp, strict byte 00014h ; 83 ec 14
push ax ; 50
mov cx, dx ; 89 d1
mov si, bx ; 89 de
test bx, bx ; 85 db
xor bx, bx ; 31 db
mov byte [di-010h], 000h ; c6 45 f0 00
test bl, 007h ; f6 c3 07
jne short 0dad4h ; 75 36
db 00fh, 0b7h, 0c3h
; movzx ax, bx ; 0f b7 c3
mov dx, strict word 0000eh ; ba 0e 00
add byte [bx+si], al ; 00 00
call 0da5fh ; e8 b6 ff
db 0ffh
db 0ffh
mov dx, 00cfeh ; ba fe 0c
add byte [bx+si], al ; 00 00
db 02bh, 0c0h
; sub ax, ax ; 2b c0
in AL, DX ; ec
mov byte [di-014h], al ; 88 45 ec
cmp AL, strict byte 0ffh ; 3c ff
jne short 0dac2h ; 75 08
add bx, strict byte 00008h ; 83 c3 08
jmp near 0db4ah ; e9 8a 00
add byte [bx+si], al ; 00 00
test byte [di-014h], 080h ; f6 45 ec 80
je short 0dacfh ; 74 07
mov di, strict word 00001h ; bf 01 00
add byte [bx+si], al ; 00 00
jmp short 0dad4h ; eb 05
mov di, strict word 00008h ; bf 08 00
add byte [bx+si], al ; 00 00
mov al, byte [di-014h] ; 8a 45 ec
and AL, strict byte 007h ; 24 07
cmp AL, strict byte 001h ; 3c 01
jne short 0db03h ; 75 26
db 00fh, 0b7h, 0c3h
; movzx ax, bx ; 0f b7 c3
mov dx, ax ; 89 c2
sar dx, 008h ; c1 fa 08
test dx, dx ; 85 d2
jne short 0db03h ; 75 1a
mov dx, strict word 0001ah ; ba 1a 00
add byte [bx+si], al ; 00 00
call 0da5fh ; e8 6e ff
db 0ffh
db 0ffh
mov dx, 00cfeh ; ba fe 0c
add byte [bx+si], al ; 00 00
db 02bh, 0c0h
; sub ax, ax ; 2b c0
in AL, DX ; ec
cmp al, byte [di-010h] ; 3a 45 f0
jbe short 0db03h ; 76 03
mov byte [di-010h], al ; 88 45 f0
test si, si ; 85 f6
je short 0db0eh ; 74 07
mov ax, strict word 00008h ; b8 08 00
add byte [bx+si], al ; 00 00
jmp short 0db10h ; eb 02
xor ax, ax ; 31 c0
db 00fh, 0b7h, 0d0h
; movzx dx, ax ; 0f b7 d0
db 00fh, 0b7h, 0c3h
; movzx ax, bx ; 0f b7 c3
call 0da5fh ; e8 46 ff
db 0ffh
db 0ffh
mov dx, 00cfch ; ba fc 0c
add byte [bx+si], al ; 00 00
in ax, DX ; ed
mov word [di-018h], ax ; 89 45 e8
mov word [di-020h], strict word 00000h ; c7 45 e0 00 00
add byte [bx+si], al ; 00 00
test si, si ; 85 f6
je short 0db35h ; 74 06
shr ax, 008h ; c1 e8 08
mov word [di-018h], ax ; 89 45 e8
mov ax, word [di-018h] ; 8b 45 e8
cmp ax, word [di-024h] ; 3b 45 dc
je short 0db43h ; 74 06
cmp word [di-020h], strict byte 00000h ; 83 7d e0 00
je short 0db4ah ; 74 07
dec cx ; 49
cmp ecx, strict byte 0ffffffffh ; 66 83 f9 ff
je short 0db62h ; 74 18
add bx, di ; 01 fb
db 00fh, 0b7h, 0c3h
; movzx ax, bx ; 0f b7 c3
sar ax, 008h ; c1 f8 08
mov word [di-01ch], ax ; 89 45 e4
movzx ax, byte [di-010h] ; 0f b6 45 f0
cmp ax, word [di-01ch] ; 3b 45 e4
jnl near 0da97h ; 0f 8d 37 ff
db 0ffh
jmp word [bp-07dh] ; ff 66 83
stc ; f9
push word [di+005h] ; ff 75 05
db 00fh, 0b7h, 0c3h
; movzx ax, bx ; 0f b7 c3
jmp short 0db72h ; eb 05
mov ax, strict word 0ffffh ; b8 ff ff
add byte [bx+si], al ; 00 00
lea sp, [di-00ch] ; 8d 65 f4
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
_pci32_function: ; 0xfdb7a LB 0x251
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
and dword [di+024h], strict dword 0658100ffh ; 66 81 65 24 ff 00 81 65
sub AL, strict byte 0feh ; 2c fe
inc word [bx+si] ; ff 00
add byte [bp+di+02445h], cl ; 00 8b 45 24
xor ah, ah ; 30 e4
cmp eax, strict dword 029720003h ; 66 3d 03 00 72 29
jbe near 0dc37h ; 0f 86 99 00
add byte [bx+si], al ; 00 00
cmp eax, strict dword 0840f000eh ; 66 3d 0e 00 0f 84
test ax, strict word 00001h ; a9 01 00
add byte [bp+03dh], ah ; 00 66 3d
or byte [bx+si], al ; 08 00
jc near 0ddb1h ; 0f 82 ff 01
add byte [bx+si], al ; 00 00
cmp eax, strict dword 0860f000dh ; 66 3d 0d 00 0f 86
test AL, strict byte 000h ; a8 00
add byte [bx+si], al ; 00 00
jmp near 0ddb1h ; e9 f0 01
add byte [bx+si], al ; 00 00
cmp eax, strict dword 028740002h ; 66 3d 02 00 74 28
cmp eax, strict dword 0850f0001h ; 66 3d 01 00 0f 85
loopne 0dbd2h ; e0 01
add byte [bx+si], al ; 00 00
mov dword [di+024h], strict dword 0c7660001h ; 66 c7 45 24 01 00 66 c7
inc bp ; 45
sbb byte [bx+si], dl ; 18 10
add dh, byte [bx+di] ; 02 31
sal byte [bp-077h], 045h ; c0 66 89 45
and bh, al ; 20 c7
inc bp ; 45
sbb AL, strict byte 050h ; 1c 50
inc bx ; 43
dec cx ; 49
and cl, ch ; 20 e9
rol byte [bx+di], CL ; d2 01
add byte [bx+si], al ; 00 00
cmp dword [di+01ch], strict byte 0ffffffffh ; 66 83 7d 1c ff
jne short 0dc05h ; 75 0d
mov ax, word [di+024h] ; 8b 45 24
xor ah, ah ; 30 e4
or ah, 083h ; 80 cc 83
jmp near 0ddb9h ; e9 b6 01
add byte [bx+si], al ; 00 00
xor bx, bx ; 31 db
db 00fh, 0b7h, 055h, 00ch
; movzx dx, [di+00ch] ; 0f b7 55 0c
db 00fh, 0b7h, 045h, 020h
; movzx ax, [di+020h] ; 0f b7 45 20
sal ax, 010h ; c1 e0 10
db 00fh, 0b7h, 04dh, 01ch
; movzx cx, [di+01ch] ; 0f b7 4d 1c
or ax, cx ; 09 c8
call 0da81h ; e8 66 fe
db 0ffh
jmp word [bp+03dh] ; ff 66 3d
db 0ffh
push word [di+00dh] ; ff 75 0d
mov ax, word [di+024h] ; 8b 45 24
xor ah, ah ; 30 e4
or ah, 086h ; 80 cc 86
jmp near 0ddb9h ; e9 8b 01
add byte [bx+si], al ; 00 00
mov dword [di+018h], eax ; 66 89 45 18
jmp near 0ddc1h ; e9 8a 01
add byte [bx+si], al ; 00 00
db 00fh, 0b7h, 055h, 00ch
; movzx dx, [di+00ch] ; 0f b7 55 0c
mov ax, word [di+020h] ; 8b 45 20
mov bx, strict word 00001h ; bb 01 00
add byte [bx+si], al ; 00 00
call 0da81h ; e8 39 fe
db 0ffh
jmp word [bp+03dh] ; ff 66 3d
db 0ffh
push word [di+00dh] ; ff 75 0d
mov ax, word [di+024h] ; 8b 45 24
xor ah, ah ; 30 e4
or ah, 086h ; 80 cc 86
jmp near 0ddb9h ; e9 5e 01
add byte [bx+si], al ; 00 00
mov dword [di+018h], eax ; 66 89 45 18
jmp near 0ddc1h ; e9 5d 01
add byte [bx+si], al ; 00 00
cmp dword [di+008h], strict dword 00d720100h ; 66 81 7d 08 00 01 72 0d
mov ax, word [di+024h] ; 8b 45 24
xor ah, ah ; 30 e4
or ah, 087h ; 80 cc 87
jmp near 0ddb9h ; e9 40 01
add byte [bx+si], al ; 00 00
db 00fh, 0b7h, 055h, 008h
; movzx dx, [di+008h] ; 0f b7 55 08
db 00fh, 0b7h, 045h, 018h
; movzx ax, [di+018h] ; 0f b7 45 18
call 0da5fh ; e8 d9 fd
db 0ffh
dec word [bp+di+02445h] ; ff 8b 45 24
xor ah, ah ; 30 e4
cmp eax, strict dword 02172000ah ; 66 3d 0a 00 72 21
jbe short 0dd04h ; 76 6f
cmp eax, strict dword 0840f000dh ; 66 3d 0d 00 0f 84
test ax, strict word 00000h ; a9 00 00
add byte [bp+03dh], ah ; 00 66 3d
or AL, strict byte 000h ; 0c 00
je near 0dd2ah ; 0f 84 83 00
add byte [bx+si], al ; 00 00
cmp eax, strict dword 06374000bh ; 66 3d 0b 00 74 63
jmp near 0ddc1h ; e9 0f 01
add byte [bx+si], al ; 00 00
cmp eax, strict dword 02d740009h ; 66 3d 09 00 74 2d
cmp eax, strict dword 0850f0008h ; 66 3d 08 00 0f 85
inc word [bx+si] ; ff 00
add byte [bx+si], al ; 00 00
mov bx, word [di+020h] ; 8b 5d 20
xor bl, bl ; 30 db
mov ax, word [di+008h] ; 8b 45 08
xor ah, ah ; 30 e4
and AL, strict byte 003h ; 24 03
db 00fh, 0b7h, 0d0h
; movzx dx, ax ; 0f b7 d0
add dx, 00cfch ; 81 c2 fc 0c
add byte [bx+si], al ; 00 00
db 02bh, 0c0h
; sub ax, ax ; 2b c0
in AL, DX ; ec
or bx, ax ; 09 c3
mov dword [di+020h], ebx ; 66 89 5d 20
jmp near 0ddc1h ; e9 dc 00
add byte [bx+si], al ; 00 00
mov ax, word [di+008h] ; 8b 45 08
xor ah, ah ; 30 e4
and AL, strict byte 002h ; 24 02
db 00fh, 0b7h, 0d0h
; movzx dx, ax ; 0f b7 d0
add dx, 00cfch ; 81 c2 fc 0c
add byte [bx+si], al ; 00 00
db 02bh, 0c0h
; sub ax, ax ; 2b c0
in eax, DX ; 66 ed
mov dword [di+020h], eax ; 66 89 45 20
jmp near 0ddc1h ; e9 bf 00
add byte [bx+si], al ; 00 00
mov dx, 00cfch ; ba fc 0c
add byte [bx+si], al ; 00 00
in ax, DX ; ed
mov word [di+020h], ax ; 89 45 20
jmp near 0ddc1h ; e9 b1 00
add byte [bx+si], al ; 00 00
mov ax, word [di+020h] ; 8b 45 20
mov dx, word [di+008h] ; 8b 55 08
xor dh, dh ; 30 f6
and dl, 003h ; 80 e2 03
db 00fh, 0b7h, 0d2h
; movzx dx, dx ; 0f b7 d2
add dx, 00cfch ; 81 c2 fc 0c
add byte [bx+si], al ; 00 00
out DX, AL ; ee
jmp near 0ddc1h ; e9 97 00
add byte [bx+si], al ; 00 00
db 00fh, 0b7h, 045h, 020h
; movzx ax, [di+020h] ; 0f b7 45 20
mov dx, word [di+008h] ; 8b 55 08
xor dh, dh ; 30 f6
and dl, 002h ; 80 e2 02
db 00fh, 0b7h, 0d2h
; movzx dx, dx ; 0f b7 d2
add dx, 00cfch ; 81 c2 fc 0c
add byte [bx+si], al ; 00 00
out DX, eax ; 66 ef
jmp near 0ddc1h ; e9 7b 00
add byte [bx+si], al ; 00 00
mov ax, word [di+020h] ; 8b 45 20
mov dx, 00cfch ; ba fc 0c
add byte [bx+si], al ; 00 00
out DX, ax ; ef
jmp short 0ddc3h ; eb 70
db 00fh, 0b7h, 045h, 008h
; movzx ax, [di+008h] ; 0f b7 45 08
mov es, [di+028h] ; 8e 45 28
mov [di-010h], es ; 8c 45 f0
mov bx, ax ; 89 c3
mov edx, dword [di] ; 66 8b 15
mov AL, byte [000f4h] ; a0 f4 00
add byte [bp+026h], ah ; 00 66 26
cmp dx, word [bx+si] ; 3b 10
jbe short 0dd7eh ; 76 12
mov ax, word [di+024h] ; 8b 45 24
xor ah, ah ; 30 e4
or ah, 089h ; 80 cc 89
mov dword [di+024h], eax ; 66 89 45 24
or word [di+02ch], strict byte 00001h ; 83 4d 2c 01
jmp short 0dda4h ; eb 26
db 00fh, 0b7h, 0cah
; movzx cx, dx ; 0f b7 ca
db 066h, 026h, 08bh, 050h, 006h
; mov edx, dword [es:bx+si+006h] ; 66 26 8b 50 06
mov word [di-014h], dx ; 89 55 ec
mov di, word [es:bx+si+002h] ; 26 8b 78 02
mov dx, ds ; 8c da
mov si, 0f2c0h ; be c0 f2
add byte [bx+si], al ; 00 00
mov es, [di-014h] ; 8e 45 ec
push DS ; 1e
db 066h, 08eh, 0dah
; mov ds, edx ; 66 8e da
rep movsb ; f3 a4
pop DS ; 1f
mov dword [di+018h], strict dword 0a1660a00h ; 66 c7 45 18 00 0a 66 a1
mov AL, byte [000f4h] ; a0 f4 00
add byte [bp-00fbbh], cl ; 00 8e 45 f0
db 066h, 026h, 089h, 003h
; mov dword [es:bp+di], eax ; 66 26 89 03
jmp short 0ddc3h ; eb 10
mov ax, word [di+024h] ; 8b 45 24
xor ah, ah ; 30 e4
or ah, 081h ; 80 cc 81
mov dword [di+024h], eax ; 66 89 45 24
or word [di+02ch], strict byte 00001h ; 83 4d 2c 01
lea sp, [di-00ch] ; 8d 65 f4
pop di ; 5f
pop si ; 5e
pop bx ; 5b
pop bp ; 5d
retn ; c3
; Padding 0x1 bytes at 0xfddcb
times 1 db 0
section BIOS32CONST progbits vstart=0xddcc align=1 ; size=0x0 class=FAR_DATA group=BIOS32_GROUP
section BIOS32CONST2 progbits vstart=0xddcc align=1 ; size=0x0 class=FAR_DATA group=BIOS32_GROUP
section BIOS32_DATA progbits vstart=0xddcc align=1 ; size=0x0 class=FAR_DATA group=BIOS32_GROUP
; Padding 0x234 bytes at 0xfddcc
times 564 db 0
section BIOSSEG progbits vstart=0xe000 align=1 ; size=0x2000 class=CODE group=AUTO
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, 058h, 04dh
eoi_both_pics: ; 0xfe030 LB 0x4
mov AL, strict byte 020h ; b0 20
out strict byte 0a0h, AL ; e6 a0
eoi_master_pic: ; 0xfe034 LB 0x5
mov AL, strict byte 020h ; b0 20
out strict byte 020h, AL ; e6 20
retn ; c3
set_int_vects: ; 0xfe039 LB 0xb
mov word [bx], ax ; 89 07
mov word [bx+002h], dx ; 89 57 02
add bx, strict byte 00004h ; 83 c3 04
loop 0e039h ; e2 f6
retn ; c3
eoi_jmp_post: ; 0xfe044 LB 0x17
call 0e030h ; e8 e9 ff
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
jmp far [00467h] ; ff 2e 67 04
times 0xa db 0
db 'XM'
post: ; 0xfe05b LB 0x65
cli ; fa
smsw ax ; 0f 01 e0
test ax, strict word 00001h ; a9 01 00
je short 0e06ah ; 74 06
mov AL, strict byte 001h ; b0 01
out strict byte 092h, AL ; e6 92
jmp short 0e068h ; eb fe
mov AL, strict byte 00fh ; b0 0f
out strict byte 070h, AL ; e6 70
in AL, strict byte 071h ; e4 71
xchg ah, al ; 86 c4
in AL, strict byte 064h ; e4 64
test AL, strict byte 004h ; a8 04
je short 0e089h ; 74 11
db 08ah, 0c4h
; mov al, ah ; 8a c4
db 00ah, 0c0h
; or al, al ; 0a c0
jne short 0e089h ; 75 0b
push strict byte 00040h ; 6a 40
pop DS ; 1f
cmp word [word 00072h], 01234h ; 81 3e 72 00 34 12
jne short 0e064h ; 75 db
mov AL, strict byte 00fh ; b0 0f
out strict byte 070h, AL ; e6 70
mov AL, strict byte 000h ; b0 00
out strict byte 071h, AL ; e6 71
db 08ah, 0c4h
; mov al, ah ; 8a c4
cmp AL, strict byte 009h ; 3c 09
je short 0e0a9h ; 74 12
cmp AL, strict byte 00ah ; 3c 0a
je short 0e0a9h ; 74 0e
db 032h, 0c0h
; xor al, al ; 32 c0
out strict byte 00dh, AL ; e6 0d
out strict byte 0dah, AL ; e6 da
mov AL, strict byte 0c0h ; b0 c0
out strict byte 0d6h, AL ; e6 d6
mov AL, strict byte 000h ; b0 00
out strict byte 0d4h, AL ; e6 d4
db 08ah, 0c4h
; mov al, ah ; 8a c4
cmp AL, strict byte 000h ; 3c 00
je short 0e0c0h ; 74 11
cmp AL, strict byte 00dh ; 3c 0d
jnc short 0e0c0h ; 73 0d
cmp AL, strict byte 009h ; 3c 09
jne short 0e0bah ; 75 03
jmp near 0e366h ; e9 ac 02
cmp AL, strict byte 005h ; 3c 05
je short 0e044h ; 74 86
jmp short 0e0c0h ; eb 00
normal_post: ; 0xfe0c0 LB 0x203
mov ax, 07800h ; b8 00 78
db 08bh, 0e0h
; mov sp, ax ; 8b e0
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
mov ss, ax ; 8e d0
mov es, ax ; 8e c0
db 033h, 0ffh
; xor di, di ; 33 ff
cld ; fc
mov cx, 00239h ; b9 39 02
rep stosw ; f3 ab
inc di ; 47
inc di ; 47
mov cx, 005c6h ; b9 c6 05
rep stosw ; f3 ab
db 033h, 0dbh
; xor bx, bx ; 33 db
add bx, 01000h ; 81 c3 00 10
cmp bx, 09000h ; 81 fb 00 90
jnc short 0e0f3h ; 73 0b
mov es, bx ; 8e c3
db 033h, 0ffh
; xor di, di ; 33 ff
mov cx, 08000h ; b9 00 80
rep stosw ; f3 ab
jmp short 0e0deh ; eb eb
mov es, bx ; 8e c3
db 033h, 0ffh
; xor di, di ; 33 ff
mov cx, 07ff8h ; b9 f8 7f
rep stosw ; f3 ab
db 033h, 0dbh
; xor bx, bx ; 33 db
push CS ; 0e
pop DS ; 1f
cld ; fc
call 01777h ; e8 73 36
call 0e8e0h ; e8 d9 07
db 033h, 0dbh
; xor bx, bx ; 33 db
mov ds, bx ; 8e db
mov cx, strict word 00060h ; b9 60 00
mov ax, 0ff53h ; b8 53 ff
mov dx, 0f000h ; ba 00 f0
call 0e039h ; e8 22 ff
mov bx, 001a0h ; bb a0 01
mov cx, strict word 00010h ; b9 10 00
call 0e039h ; e8 19 ff
mov ax, 0027fh ; b8 7f 02
mov word [00413h], ax ; a3 13 04
mov ax, 0e9dch ; b8 dc e9
mov word [00018h], ax ; a3 18 00
mov ax, 0f000h ; b8 00 f0
mov word [0001ah], ax ; a3 1a 00
mov ax, 0f84dh ; b8 4d f8
mov word [00044h], ax ; a3 44 00
mov ax, 0f000h ; b8 00 f0
mov word [00046h], ax ; a3 46 00
mov ax, 0f841h ; b8 41 f8
mov word [00048h], ax ; a3 48 00
mov ax, 0f000h ; b8 00 f0
mov word [0004ah], ax ; a3 4a 00
mov ax, 0f859h ; b8 59 f8
mov word [00054h], ax ; a3 54 00
mov ax, 0f000h ; b8 00 f0
mov word [00056h], ax ; a3 56 00
mov ax, 0efd4h ; b8 d4 ef
mov word [0005ch], ax ; a3 5c 00
mov ax, 0f000h ; b8 00 f0
mov word [0005eh], ax ; a3 5e 00
mov ax, 0f0a4h ; b8 a4 f0
mov word [00060h], ax ; a3 60 00
mov ax, 0f000h ; b8 00 f0
mov word [00062h], ax ; a3 62 00
mov ax, 0e6f2h ; b8 f2 e6
mov word [00064h], ax ; a3 64 00
mov ax, 0f000h ; b8 00 f0
mov word [00066h], ax ; a3 66 00
mov ax, 0efedh ; b8 ed ef
mov word [00070h], ax ; a3 70 00
mov ax, 0f000h ; b8 00 f0
mov word [00072h], ax ; a3 72 00
call 0e778h ; e8 ef 05
call 0f13ch ; e8 b0 0f
call 0f1c1h ; e8 32 10
mov ax, 0fe6eh ; b8 6e fe
mov word [00068h], ax ; a3 68 00
mov ax, 0f000h ; b8 00 f0
mov word [0006ah], ax ; a3 6a 00
mov ax, 0fea5h ; b8 a5 fe
mov word [00020h], ax ; a3 20 00
mov ax, 0f000h ; b8 00 f0
mov word [00022h], ax ; a3 22 00
mov AL, strict byte 034h ; b0 34
out strict byte 043h, AL ; e6 43
mov AL, strict byte 000h ; b0 00
out strict byte 040h, AL ; e6 40
out strict byte 040h, AL ; e6 40
mov ax, 0f065h ; b8 65 f0
mov word [00040h], ax ; a3 40 00
mov ax, 0f000h ; b8 00 f0
mov word [00042h], ax ; a3 42 00
mov ax, 0e987h ; b8 87 e9
mov word [00024h], ax ; a3 24 00
mov ax, 0f000h ; b8 00 f0
mov word [00026h], ax ; a3 26 00
mov ax, 0e82eh ; b8 2e e8
mov word [00058h], ax ; a3 58 00
mov ax, 0f000h ; b8 00 f0
mov word [0005ah], ax ; a3 5a 00
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
mov byte [00417h], AL ; a2 17 04
mov byte [00418h], AL ; a2 18 04
mov byte [00419h], AL ; a2 19 04
mov byte [00471h], AL ; a2 71 04
mov byte [00497h], AL ; a2 97 04
mov AL, strict byte 010h ; b0 10
mov byte [00496h], AL ; a2 96 04
mov bx, strict word 0001eh ; bb 1e 00
mov word [0041ah], bx ; 89 1e 1a 04
mov word [0041ch], bx ; 89 1e 1c 04
mov word [00480h], bx ; 89 1e 80 04
mov bx, strict word 0003eh ; bb 3e 00
mov word [00482h], bx ; 89 1e 82 04
mov AL, strict byte 014h ; b0 14
out strict byte 070h, AL ; e6 70
in AL, strict byte 071h ; e4 71
mov byte [00410h], AL ; a2 10 04
push DS ; 1e
push CS ; 0e
pop DS ; 1f
cld ; fc
mov ax, 0c000h ; b8 00 c0
mov dx, 0c800h ; ba 00 c8
call 01600h ; e8 e7 33
call 04b77h ; e8 5b 69
pop DS ; 1f
mov ax, 0ff53h ; b8 53 ff
mov word [0003ch], ax ; a3 3c 00
mov ax, 0f000h ; b8 00 f0
mov word [0003eh], ax ; a3 3e 00
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
db 033h, 0dbh
; xor bx, bx ; 33 db
mov CL, strict byte 014h ; b1 14
mov dx, 00378h ; ba 78 03
call 0ecedh ; e8 b6 0a
mov dx, 00278h ; ba 78 02
call 0ecedh ; e8 b0 0a
sal bx, 00eh ; c1 e3 0e
mov ax, word [00410h] ; a1 10 04
and ax, 03fffh ; 25 ff 3f
db 00bh, 0c3h
; or ax, bx ; 0b c3
mov word [00410h], ax ; a3 10 04
mov ax, 0e746h ; b8 46 e7
mov word [0002ch], ax ; a3 2c 00
mov ax, 0f000h ; b8 00 f0
mov word [0002eh], ax ; a3 2e 00
mov ax, 0e746h ; b8 46 e7
mov word [00030h], ax ; a3 30 00
mov ax, 0f000h ; b8 00 f0
mov word [00032h], ax ; a3 32 00
mov ax, 0e739h ; b8 39 e7
mov word [00050h], ax ; a3 50 00
mov ax, 0f000h ; b8 00 f0
mov word [00052h], ax ; a3 52 00
db 033h, 0dbh
; xor bx, bx ; 33 db
mov CL, strict byte 00ah ; b1 0a
mov dx, 003f8h ; ba f8 03
call 0ed0bh ; e8 92 0a
mov dx, 002f8h ; ba f8 02
call 0ed0bh ; e8 8c 0a
mov dx, 003e8h ; ba e8 03
call 0ed0bh ; e8 86 0a
mov dx, 002e8h ; ba e8 02
call 0ed0bh ; e8 80 0a
sal bx, 009h ; c1 e3 09
mov ax, word [00410h] ; a1 10 04
and ax, 0f1ffh ; 25 ff f1
db 00bh, 0c3h
; or ax, bx ; 0b c3
mov word [00410h], ax ; a3 10 04
mov ax, 0ff53h ; b8 53 ff
mov word [00128h], ax ; a3 28 01
mov ax, 0f000h ; b8 00 f0
mov word [0012ah], ax ; a3 2a 01
mov ax, 0fe8fh ; b8 8f fe
mov word [001c0h], ax ; a3 c0 01
mov ax, 0f000h ; b8 00 f0
mov word [001c2h], ax ; a3 c2 01
call 0edbfh ; e8 0b 0b
jmp short 0e31bh ; eb 65
times 0xb db 0
db 'XM'
nmi: ; 0xfe2c3 LB 0x7
push CS ; 0e
pop DS ; 1f
cld ; fc
call 01753h ; e8 8a 34
iret ; cf
int75_handler: ; 0xfe2ca LB 0x8
out strict byte 0f0h, AL ; e6 f0
call 0e030h ; e8 61 fd
int 002h ; cd 02
iret ; cf
hard_drive_post: ; 0xfe2d2 LB 0x12c
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
mov byte [00474h], AL ; a2 74 04
mov byte [00477h], AL ; a2 77 04
mov byte [0048ch], AL ; a2 8c 04
mov byte [0048dh], AL ; a2 8d 04
mov byte [0048eh], AL ; a2 8e 04
mov AL, strict byte 0c0h ; b0 c0
mov byte [00476h], AL ; a2 76 04
mov ax, 0e3feh ; b8 fe e3
mov word [0004ch], ax ; a3 4c 00
mov ax, 0f000h ; b8 00 f0
mov word [0004eh], ax ; a3 4e 00
mov ax, 0f8d7h ; b8 d7 f8
mov word [001d8h], ax ; a3 d8 01
mov ax, 0f000h ; b8 00 f0
mov word [001dah], ax ; a3 da 01
mov ax, strict word 0003dh ; b8 3d 00
mov word [00104h], ax ; a3 04 01
mov ax, 09fc0h ; b8 c0 9f
mov word [00106h], ax ; a3 06 01
mov ax, strict word 0004dh ; b8 4d 00
mov word [00118h], ax ; a3 18 01
mov ax, 09fc0h ; b8 c0 9f
mov word [0011ah], ax ; a3 1a 01
retn ; c3
mov ax, 0f8a9h ; b8 a9 f8
mov word [001d0h], ax ; a3 d0 01
mov ax, 0f000h ; b8 00 f0
mov word [001d2h], ax ; a3 d2 01
mov ax, 0e2cah ; b8 ca e2
mov word [001d4h], ax ; a3 d4 01
mov ax, 0f000h ; b8 00 f0
mov word [001d6h], ax ; a3 d6 01
call 0e753h ; e8 1d 04
push CS ; 0e
pop DS ; 1f
cld ; fc
call 01badh ; e8 71 38
call 01fa7h ; e8 68 3c
call 09097h ; e8 55 ad
call 080d3h ; e8 8e 9d
call 0ed2fh ; e8 e7 09
call 0e2d2h ; e8 87 ff
push CS ; 0e
pop DS ; 1f
cld ; fc
call 01797h ; e8 46 34
mov ax, 0c800h ; b8 00 c8
mov dx, 0f000h ; ba 00 f0
call 01600h ; e8 a6 32
call 0385bh ; e8 fe 54
sti ; fb
int 019h ; cd 19
sti ; fb
hlt ; f4
jmp short 0e361h ; eb fd
cli ; fa
hlt ; f4
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov ss, [word 00069h] ; 8e 16 69 00
mov sp, word [word 00067h] ; 8b 26 67 00
in AL, strict byte 092h ; e4 92
and AL, strict byte 0fdh ; 24 fd
out strict byte 092h, AL ; e6 92
lidt [cs:0efe7h] ; 2e 0f 01 1e e7 ef
pop DS ; 1f
pop ES ; 07
db 08bh, 0ech
; mov bp, sp ; 8b ec
in AL, strict byte 080h ; e4 80
mov byte [bp+00fh], al ; 88 46 0f
db 03ah, 0e0h
; cmp ah, al ; 3a e0
popaw ; 61
sti ; fb
retf 00002h ; ca 02 00
times 0x6d db 0
db 'XM'
int13_handler: ; 0xfe3fe LB 0x3
jmp near 0ec5bh ; e9 5a 08
rom_fdpt: ; 0xfe401 LB 0x2f1
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, 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, 058h
db 04dh
int19_handler: ; 0xfe6f2 LB 0x61
jmp near 0f0ach ; e9 b7 09
or word [bx+si], ax ; 09 00
cld ; fc
add byte [bx+di], al ; 00 01
je short 0e73ch ; 74 40
times 0x2b db 0
pop ax ; 58
dec bp ; 4d
times 0xe db 0
pop ax ; 58
dec bp ; 4d
push DS ; 1e
push ES ; 06
pushaw ; 60
push CS ; 0e
pop DS ; 1f
cld ; fc
call 05f61h ; e8 1f 78
popaw ; 61
pop ES ; 07
pop DS ; 1f
iret ; cf
push DS ; 1e
push ES ; 06
pushaw ; 60
push CS ; 0e
pop DS ; 1f
cld ; fc
call 016e8h ; e8 99 2f
popaw ; 61
pop ES ; 07
pop DS ; 1f
iret ; cf
init_pic: ; 0xfe753 LB 0x25
mov AL, strict byte 011h ; b0 11
out strict byte 020h, AL ; e6 20
out strict byte 0a0h, AL ; e6 a0
mov AL, strict byte 008h ; b0 08
out strict byte 021h, AL ; e6 21
mov AL, strict byte 070h ; b0 70
out strict byte 0a1h, AL ; e6 a1
mov AL, strict byte 004h ; b0 04
out strict byte 021h, AL ; e6 21
mov AL, strict byte 002h ; b0 02
out strict byte 0a1h, AL ; e6 a1
mov AL, strict byte 001h ; b0 01
out strict byte 021h, AL ; e6 21
out strict byte 0a1h, AL ; e6 a1
mov AL, strict byte 0b8h ; b0 b8
out strict byte 021h, AL ; e6 21
mov AL, strict byte 08fh ; b0 8f
out strict byte 0a1h, AL ; e6 a1
retn ; c3
ebda_post: ; 0xfe778 LB 0xec
mov ax, 0e746h ; b8 46 e7
mov word [00034h], ax ; a3 34 00
mov ax, 0f000h ; b8 00 f0
mov word [00036h], ax ; a3 36 00
mov ax, 0e746h ; b8 46 e7
mov word [0003ch], ax ; a3 3c 00
mov ax, 0f000h ; b8 00 f0
mov word [0003eh], ax ; a3 3e 00
mov ax, 0e746h ; b8 46 e7
mov word [001c8h], ax ; a3 c8 01
mov ax, 0f000h ; b8 00 f0
mov word [001cah], ax ; a3 ca 01
mov ax, 0e746h ; b8 46 e7
mov word [001dch], ax ; a3 dc 01
mov ax, 0f000h ; b8 00 f0
mov word [001deh], ax ; a3 de 01
mov ax, 09fc0h ; b8 c0 9f
mov ds, ax ; 8e d8
mov byte [word 00000h], 001h ; c6 06 00 00 01
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
mov word [0040eh], 09fc0h ; c7 06 0e 04 c0 9f
retn ; c3
times 0x6f db 0
pop ax ; 58
dec bp ; 4d
sti ; fb
push ES ; 06
push DS ; 1e
pushaw ; 60
cmp ah, 000h ; 80 fc 00
je short 0e846h ; 74 0f
cmp ah, 010h ; 80 fc 10
je short 0e846h ; 74 0a
push CS ; 0e
pop DS ; 1f
cld ; fc
call 052cfh ; e8 8d 6a
popaw ; 61
pop DS ; 1f
pop ES ; 07
iret ; cf
mov bx, strict word 00040h ; bb 40 00
mov ds, bx ; 8e db
cli ; fa
mov bx, word [word 0001ah] ; 8b 1e 1a 00
cmp bx, word [word 0001ch] ; 3b 1e 1c 00
jne short 0e85ah ; 75 04
sti ; fb
nop ; 90
jmp short 0e84bh ; eb f1
push CS ; 0e
pop DS ; 1f
cld ; fc
call 052cfh ; e8 6f 6a
popaw ; 61
pop DS ; 1f
pop ES ; 07
iret ; cf
pmode_enter: ; 0xfe864 LB 0x1b
push CS ; 0e
pop DS ; 1f
lgdt [cs:0e892h] ; 2e 0f 01 16 92 e8
mov eax, cr0 ; 0f 20 c0
or AL, strict byte 001h ; 0c 01
mov cr0, eax ; 0f 22 c0
jmp far 00020h:0e879h ; ea 79 e8 20 00
mov ax, strict word 00018h ; b8 18 00
mov ds, ax ; 8e d8
retn ; c3
pmode_exit: ; 0xfe87f LB 0x13
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov eax, cr0 ; 0f 20 c0
and AL, strict byte 0feh ; 24 fe
mov cr0, eax ; 0f 22 c0
jmp far 0f000h:0e891h ; ea 91 e8 00 f0
retn ; c3
pmbios_gdt_desc: ; 0xfe892 LB 0x6
db 047h, 000h, 098h, 0e8h, 00fh, 000h
pmbios_gdt: ; 0xfe898 LB 0x48
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 0ffh, 0ffh, 000h, 000h, 000h, 09bh, 0cfh, 000h, 0ffh, 0ffh, 000h, 000h, 000h, 093h, 0cfh, 000h
db 0ffh, 0ffh, 000h, 000h, 00fh, 09bh, 000h, 000h, 0ffh, 0ffh, 000h, 000h, 000h, 093h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 0ffh, 0ffh, 000h, 004h, 000h, 093h, 000h, 000h
pmode_setup: ; 0xfe8e0 LB 0x37b
push eax ; 66 50
push esi ; 66 56
pushfw ; 9c
cli ; fa
call 0e864h ; e8 7b ff
mov eax, cr0 ; 0f 20 c0
and eax, strict dword 09fffffffh ; 66 25 ff ff ff 9f
mov cr0, eax ; 0f 22 c0
mov esi, strict dword 0fee000f0h ; 66 be f0 00 e0 fe
mov eax, strict dword 00000010fh ; 66 b8 0f 01 00 00
mov dword [esi], eax ; 67 66 89 06
mov esi, strict dword 0fee00350h ; 66 be 50 03 e0 fe
mov eax, dword [esi] ; 67 66 8b 06
and eax, strict dword 0fffe00ffh ; 66 25 ff 00 fe ff
or ah, 007h ; 80 cc 07
mov dword [esi], eax ; 67 66 89 06
mov esi, strict dword 0fee00360h ; 66 be 60 03 e0 fe
mov eax, dword [esi] ; 67 66 8b 06
and eax, strict dword 0fffe00ffh ; 66 25 ff 00 fe ff
or ah, 004h ; 80 cc 04
mov dword [esi], eax ; 67 66 89 06
call 0e87fh ; e8 49 ff
popfw ; 9d
pop esi ; 66 5e
pop eax ; 66 58
retn ; c3
times 0x49 db 0
pop ax ; 58
dec bp ; 4d
cli ; fa
push ax ; 50
mov AL, strict byte 0adh ; b0 ad
out strict byte 064h, AL ; e6 64
mov AL, strict byte 00bh ; b0 0b
out strict byte 020h, AL ; e6 20
in AL, strict byte 020h ; e4 20
and AL, strict byte 002h ; 24 02
je short 0e9d6h ; 74 3f
in AL, strict byte 060h ; e4 60
push DS ; 1e
pushaw ; 60
cld ; fc
mov AH, strict byte 04fh ; b4 4f
stc ; f9
int 015h ; cd 15
jnc short 0e9d0h ; 73 2d
sti ; fb
cmp AL, strict byte 0e0h ; 3c e0
jne short 0e9b6h ; 75 0e
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
mov AL, byte [00496h] ; a0 96 04
or AL, strict byte 002h ; 0c 02
mov byte [00496h], AL ; a2 96 04
jmp short 0e9d0h ; eb 1a
cmp AL, strict byte 0e1h ; 3c e1
jne short 0e9c8h ; 75 0e
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
mov AL, byte [00496h] ; a0 96 04
or AL, strict byte 001h ; 0c 01
mov byte [00496h], AL ; a2 96 04
jmp short 0e9d0h ; eb 08
push ES ; 06
push CS ; 0e
pop DS ; 1f
cld ; fc
call 04e74h ; e8 a5 64
pop ES ; 07
popaw ; 61
pop DS ; 1f
cli ; fa
call 0e034h ; e8 5e f6
mov AL, strict byte 0aeh ; b0 ae
out strict byte 064h, AL ; e6 64
pop ax ; 58
iret ; cf
pushaw ; 60
push ES ; 06
push DS ; 1e
push CS ; 0e
pop DS ; 1f
cld ; fc
call 069b9h ; e8 d4 7f
pop DS ; 1f
pop ES ; 07
popaw ; 61
iret ; cf
times 0x26e db 0
pop ax ; 58
dec bp ; 4d
jmp short 0ecb0h ; eb 55
int13_relocated: ; 0xfec5b LB 0x55
cmp ah, 04ah ; 80 fc 4a
jc short 0ec71h ; 72 11
cmp ah, 04dh ; 80 fc 4d
jnbe short 0ec71h ; 77 0c
pushaw ; 60
push ES ; 06
push DS ; 1e
push CS ; 0e
pop DS ; 1f
cld ; fc
push 0ece9h ; 68 e9 ec
jmp near 0389fh ; e9 2e 4c
push ES ; 06
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
call 03873h ; e8 fa 4b
cmp AL, strict byte 000h ; 3c 00
je short 0ecabh ; 74 2e
call 03889h ; e8 09 4c
pop dx ; 5a
push dx ; 52
db 03ah, 0c2h
; cmp al, dl ; 3a c2
jne short 0ec97h ; 75 11
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
pop ES ; 07
pushaw ; 60
push ES ; 06
push DS ; 1e
push CS ; 0e
pop DS ; 1f
cld ; fc
push 0ece9h ; 68 e9 ec
jmp near 03e73h ; e9 dc 51
and dl, 0e0h ; 80 e2 e0
db 03ah, 0c2h
; cmp al, dl ; 3a c2
jne short 0ecabh ; 75 0d
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
pop ES ; 07
push ax ; 50
push cx ; 51
push dx ; 52
push bx ; 53
db 0feh, 0cah
; dec dl ; fe ca
jmp short 0ecb4h ; eb 09
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
pop ES ; 07
int13_noeltorito: ; 0xfecb0 LB 0x4
push ax ; 50
push cx ; 51
push dx ; 52
push bx ; 53
int13_legacy: ; 0xfecb4 LB 0x14
push dx ; 52
push bp ; 55
push si ; 56
push di ; 57
push ES ; 06
push DS ; 1e
push CS ; 0e
pop DS ; 1f
cld ; fc
test dl, 080h ; f6 c2 80
jne short 0ecc8h ; 75 06
push 0ece9h ; 68 e9 ec
jmp near 02f2eh ; e9 66 42
int13_notfloppy: ; 0xfecc8 LB 0x14
cmp dl, 0e0h ; 80 fa e0
jc short 0ecdch ; 72 0f
shr ebx, 010h ; 66 c1 eb 10
push bx ; 53
call 042a7h ; e8 d2 55
pop bx ; 5b
sal ebx, 010h ; 66 c1 e3 10
jmp short 0ece9h ; eb 0d
int13_disk: ; 0xfecdc LB 0xd
cmp ah, 040h ; 80 fc 40
jnbe short 0ece6h ; 77 05
call 05654h ; e8 70 69
jmp short 0ece9h ; eb 03
call 05a95h ; e8 ac 6d
int13_out: ; 0xfece9 LB 0x4
pop DS ; 1f
pop ES ; 07
popaw ; 61
iret ; cf
detect_parport: ; 0xfeced LB 0x1e
push dx ; 52
inc dx ; 42
inc dx ; 42
in AL, DX ; ec
and AL, strict byte 0dfh ; 24 df
out DX, AL ; ee
pop dx ; 5a
mov AL, strict byte 0aah ; b0 aa
out DX, AL ; ee
in AL, DX ; ec
cmp AL, strict byte 0aah ; 3c aa
jne short 0ed0ah ; 75 0d
push bx ; 53
sal bx, 1 ; d1 e3
mov word [bx+00408h], dx ; 89 97 08 04
pop bx ; 5b
mov byte [bx+00478h], cl ; 88 8f 78 04
inc bx ; 43
retn ; c3
detect_serial: ; 0xfed0b LB 0x24
push dx ; 52
inc dx ; 42
mov AL, strict byte 002h ; b0 02
out DX, AL ; ee
in AL, DX ; ec
cmp AL, strict byte 002h ; 3c 02
jne short 0ed2dh ; 75 18
inc dx ; 42
in AL, DX ; ec
cmp AL, strict byte 002h ; 3c 02
jne short 0ed2dh ; 75 12
dec dx ; 4a
db 032h, 0c0h
; xor al, al ; 32 c0
pop dx ; 5a
push bx ; 53
sal bx, 1 ; d1 e3
mov word [bx+00400h], dx ; 89 97 00 04
pop bx ; 5b
mov byte [bx+0047ch], cl ; 88 8f 7c 04
inc bx ; 43
retn ; c3
pop dx ; 5a
retn ; c3
floppy_post: ; 0xfed2f LB 0x87
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
mov AL, strict byte 000h ; b0 00
mov byte [0043eh], AL ; a2 3e 04
mov byte [0043fh], AL ; a2 3f 04
mov byte [00440h], AL ; a2 40 04
mov byte [00441h], AL ; a2 41 04
mov byte [00442h], AL ; a2 42 04
mov byte [00443h], AL ; a2 43 04
mov byte [00444h], AL ; a2 44 04
mov byte [00445h], AL ; a2 45 04
mov byte [00446h], AL ; a2 46 04
mov byte [00447h], AL ; a2 47 04
mov byte [00448h], AL ; a2 48 04
mov byte [0048bh], AL ; a2 8b 04
mov AL, strict byte 010h ; b0 10
out strict byte 070h, AL ; e6 70
in AL, strict byte 071h ; e4 71
db 08ah, 0e0h
; mov ah, al ; 8a e0
shr al, 004h ; c0 e8 04
je short 0ed6ah ; 74 04
mov BL, strict byte 007h ; b3 07
jmp short 0ed6ch ; eb 02
mov BL, strict byte 000h ; b3 00
db 08ah, 0c4h
; mov al, ah ; 8a c4
and AL, strict byte 00fh ; 24 0f
je short 0ed75h ; 74 03
or bl, 070h ; 80 cb 70
mov byte [0048fh], bl ; 88 1e 8f 04
mov AL, strict byte 000h ; b0 00
mov byte [00490h], AL ; a2 90 04
mov byte [00491h], AL ; a2 91 04
mov byte [00492h], AL ; a2 92 04
mov byte [00493h], AL ; a2 93 04
mov byte [00494h], AL ; a2 94 04
mov byte [00495h], AL ; a2 95 04
mov AL, strict byte 002h ; b0 02
out strict byte 00ah, AL ; e6 0a
mov ax, 0efc7h ; b8 c7 ef
mov word [00078h], ax ; a3 78 00
mov ax, 0f000h ; b8 00 f0
mov word [0007ah], ax ; a3 7a 00
mov ax, 0ec59h ; b8 59 ec
mov word [00100h], ax ; a3 00 01
mov ax, 0f000h ; b8 00 f0
mov word [00102h], ax ; a3 02 01
mov ax, 0ef57h ; b8 57 ef
mov word [00038h], ax ; a3 38 00
mov ax, 0f000h ; b8 00 f0
mov word [0003ah], ax ; a3 3a 00
retn ; c3
bcd_to_bin: ; 0xfedb6 LB 0x9
sal ax, 004h ; c1 e0 04
shr al, 004h ; c0 e8 04
aad 00ah ; d5 0a
retn ; c3
rtc_post: ; 0xfedbf LB 0x198
db 066h, 033h, 0c0h
; xor eax, eax ; 66 33 c0
mov AL, strict byte 000h ; b0 00
out strict byte 070h, AL ; e6 70
in AL, strict byte 071h ; e4 71
call 0edb6h ; e8 eb ff
mov edx, strict dword 00115cf2bh ; 66 ba 2b cf 15 01
mul edx ; 66 f7 e2
mov ebx, strict dword 0000f4240h ; 66 bb 40 42 0f 00
db 066h, 033h, 0d2h
; xor edx, edx ; 66 33 d2
div ebx ; 66 f7 f3
db 066h, 08bh, 0c8h
; mov ecx, eax ; 66 8b c8
db 066h, 033h, 0c0h
; xor eax, eax ; 66 33 c0
mov AL, strict byte 002h ; b0 02
out strict byte 070h, AL ; e6 70
in AL, strict byte 071h ; e4 71
call 0edb6h ; e8 c7 ff
mov edx, strict dword 000a6af80h ; 66 ba 80 af a6 00
mul edx ; 66 f7 e2
mov ebx, strict dword 000002710h ; 66 bb 10 27 00 00
db 066h, 033h, 0d2h
; xor edx, edx ; 66 33 d2
div ebx ; 66 f7 f3
db 066h, 003h, 0c8h
; add ecx, eax ; 66 03 c8
db 066h, 033h, 0c0h
; xor eax, eax ; 66 33 c0
mov AL, strict byte 004h ; b0 04
out strict byte 070h, AL ; e6 70
in AL, strict byte 071h ; e4 71
call 0edb6h ; e8 a3 ff
mov edx, strict dword 003e81d03h ; 66 ba 03 1d e8 03
mul edx ; 66 f7 e2
mov ebx, strict dword 0000003e8h ; 66 bb e8 03 00 00
db 066h, 033h, 0d2h
; xor edx, edx ; 66 33 d2
div ebx ; 66 f7 f3
db 066h, 003h, 0c8h
; add ecx, eax ; 66 03 c8
mov dword [0046ch], ecx ; 66 89 0e 6c 04
db 032h, 0c0h
; xor al, al ; 32 c0
mov byte [00470h], AL ; a2 70 04
retn ; c3
times 0x11f db 0
db 'XM'
int0e_handler: ; 0xfef57 LB 0x70
push ax ; 50
push dx ; 52
mov dx, 003f4h ; ba f4 03
in AL, DX ; ec
and AL, strict byte 0c0h ; 24 c0
cmp AL, strict byte 0c0h ; 3c c0
je short 0ef81h ; 74 1e
mov dx, 003f5h ; ba f5 03
mov AL, strict byte 008h ; b0 08
out DX, AL ; ee
mov dx, 003f4h ; ba f4 03
in AL, DX ; ec
and AL, strict byte 0c0h ; 24 c0
cmp AL, strict byte 0c0h ; 3c c0
jne short 0ef69h ; 75 f6
mov dx, 003f5h ; ba f5 03
in AL, DX ; ec
mov dx, 003f4h ; ba f4 03
in AL, DX ; ec
and AL, strict byte 0c0h ; 24 c0
cmp AL, strict byte 0c0h ; 3c c0
je short 0ef73h ; 74 f2
push DS ; 1e
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
call 0e034h ; e8 ab f0
or byte [0043eh], 080h ; 80 0e 3e 04 80
pop DS ; 1f
pop dx ; 5a
pop ax ; 58
iret ; cf
times 0x33 db 0
db 'XM'
_diskette_param_table: ; 0xfefc7 LB 0xd
scasw ; af
add ah, byte [di] ; 02 25
add dl, byte [bp+si] ; 02 12
db 01bh, 0ffh
; sbb di, di ; 1b ff
insb ; 6c
db 0f6h
invd ; 0f 08
jmp short 0efd4h ; eb 00
int17_handler: ; 0xfefd4 LB 0xd
push DS ; 1e
push ES ; 06
pushaw ; 60
push CS ; 0e
pop DS ; 1f
cld ; fc
call 07313h ; e8 36 83
popaw ; 61
pop ES ; 07
pop DS ; 1f
iret ; cf
_pmode_IDT: ; 0xfefe1 LB 0x6
db 000h, 000h, 000h, 000h, 00fh, 000h
_rmode_IDT: ; 0xfefe7 LB 0x6
db 0ffh, 003h, 000h, 000h, 000h, 000h
int1c_handler: ; 0xfefed LB 0x78
iret ; cf
times 0x55 db 0
pop ax ; 58
dec bp ; 4d
iret ; cf
times 0x1d db 0
db 'XM'
int10_handler: ; 0xff065 LB 0x47
iret ; cf
times 0x3c db 0
pop ax ; 58
dec bp ; 4d
push CS ; 0e
pop DS ; 1f
cld ; fc
call 01765h ; e8 bb 26
hlt ; f4
iret ; cf
int19_relocated: ; 0xff0ac LB 0x90
db 08bh, 0ech
; mov bp, sp ; 8b ec
mov ax, word [bp+002h] ; 8b 46 02
cmp ax, 0f000h ; 3d 00 f0
je short 0f0c3h ; 74 0d
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
mov ax, 01234h ; b8 34 12
mov word [001d8h], ax ; a3 d8 01
jmp near 0e05bh ; e9 98 ef
push CS ; 0e
pop DS ; 1f
cld ; fc
push bp ; 55
db 08bh, 0ech
; mov bp, sp ; 8b ec
mov ax, strict word 00001h ; b8 01 00
push ax ; 50
call 0490eh ; e8 3e 58
inc sp ; 44
inc sp ; 44
test ax, ax ; 85 c0
jne short 0f0feh ; 75 28
mov ax, strict word 00002h ; b8 02 00
push ax ; 50
call 0490eh ; e8 31 58
inc sp ; 44
inc sp ; 44
test ax, ax ; 85 c0
jne short 0f0feh ; 75 1b
mov ax, strict word 00003h ; b8 03 00
push strict byte 00003h ; 6a 03
call 0490eh ; e8 23 58
inc sp ; 44
inc sp ; 44
test ax, ax ; 85 c0
jne short 0f0feh ; 75 0d
mov ax, strict word 00004h ; b8 04 00
push ax ; 50
call 0490eh ; e8 16 58
inc sp ; 44
inc sp ; 44
test ax, ax ; 85 c0
je short 0f0a4h ; 74 a6
sal eax, 004h ; 66 c1 e0 04
mov word [bp+002h], ax ; 89 46 02
shr eax, 004h ; 66 c1 e8 04
and ax, 0f000h ; 25 00 f0
mov word [bp+004h], ax ; 89 46 04
db 033h, 0c0h
; xor ax, ax ; 33 c0
mov ds, ax ; 8e d8
mov es, ax ; 8e c0
mov word [byte bp+000h], ax ; 89 46 00
mov ax, 0aa55h ; b8 55 aa
pop bp ; 5d
iret ; cf
or cx, word [bp+si] ; 0b 0a
or word [bp+di], cx ; 09 0b
push eax ; 66 50
mov eax, strict dword 000800000h ; 66 b8 00 00 80 00
db 08bh, 0c3h
; mov ax, bx ; 8b c3
sal eax, 008h ; 66 c1 e0 08
and dl, 0fch ; 80 e2 fc
db 00ah, 0c2h
; or al, dl ; 0a c2
mov dx, 00cf8h ; ba f8 0c
out DX, eax ; 66 ef
pop eax ; 66 58
retn ; c3
pcibios_init_iomem_bases: ; 0xff13c LB 0x16
push bp ; 55
db 08bh, 0ech
; mov bp, sp ; 8b ec
mov eax, strict dword 0e0000000h ; 66 b8 00 00 00 e0
push eax ; 66 50
mov ax, 0d000h ; b8 00 d0
push ax ; 50
mov ax, strict word 00010h ; b8 10 00
push ax ; 50
mov bx, strict word 00008h ; bb 08 00
pci_init_io_loop1: ; 0xff152 LB 0xe
mov DL, strict byte 000h ; b2 00
call 0f121h ; e8 ca ff
mov dx, 00cfch ; ba fc 0c
in ax, DX ; ed
cmp ax, strict byte 0ffffh ; 83 f8 ff
je short 0f199h ; 74 39
enable_iomem_space: ; 0xff160 LB 0x39
mov DL, strict byte 004h ; b2 04
call 0f121h ; e8 bc ff
mov dx, 00cfch ; ba fc 0c
in AL, DX ; ec
or AL, strict byte 007h ; 0c 07
out DX, AL ; ee
mov DL, strict byte 000h ; b2 00
call 0f121h ; e8 b0 ff
mov dx, 00cfch ; ba fc 0c
in eax, DX ; 66 ed
cmp eax, strict dword 020001022h ; 66 3d 22 10 00 20
jne short 0f199h ; 75 1b
mov DL, strict byte 010h ; b2 10
call 0f121h ; e8 9e ff
mov dx, 00cfch ; ba fc 0c
in ax, DX ; ed
and ax, strict byte 0fffch ; 83 e0 fc
db 08bh, 0c8h
; mov cx, ax ; 8b c8
db 08bh, 0d1h
; mov dx, cx ; 8b d1
add dx, strict byte 00014h ; 83 c2 14
in ax, DX ; ed
db 08bh, 0d1h
; mov dx, cx ; 8b d1
add dx, strict byte 00018h ; 83 c2 18
in eax, DX ; 66 ed
next_pci_dev: ; 0xff199 LB 0xf
mov byte [bp-008h], 010h ; c6 46 f8 10
inc bx ; 43
cmp bx, 00100h ; 81 fb 00 01
jne short 0f152h ; 75 ae
db 08bh, 0e5h
; mov sp, bp ; 8b e5
pop bp ; 5d
retn ; c3
pcibios_init_set_elcr: ; 0xff1a8 LB 0xc
push ax ; 50
push cx ; 51
mov dx, 004d0h ; ba d0 04
test AL, strict byte 008h ; a8 08
je short 0f1b4h ; 74 03
inc dx ; 42
and AL, strict byte 007h ; 24 07
is_master_pic: ; 0xff1b4 LB 0xd
db 08ah, 0c8h
; mov cl, al ; 8a c8
mov BL, strict byte 001h ; b3 01
sal bl, CL ; d2 e3
in AL, DX ; ec
db 00ah, 0c3h
; or al, bl ; 0a c3
out DX, AL ; ee
pop cx ; 59
pop ax ; 58
retn ; c3
pcibios_init_irqs: ; 0xff1c1 LB 0x53
push DS ; 1e
push bp ; 55
mov ax, 0f000h ; b8 00 f0
mov ds, ax ; 8e d8
mov dx, 004d0h ; ba d0 04
mov AL, strict byte 000h ; b0 00
out DX, AL ; ee
inc dx ; 42
out DX, AL ; ee
mov si, 0f2a0h ; be a0 f2
mov bh, byte [si+008h] ; 8a 7c 08
mov bl, byte [si+009h] ; 8a 5c 09
mov DL, strict byte 000h ; b2 00
call 0f121h ; e8 43 ff
mov dx, 00cfch ; ba fc 0c
in eax, DX ; 66 ed
cmp eax, dword [si+00ch] ; 66 3b 44 0c
jne near 0f291h ; 0f 85 a6 00
mov dl, byte [si+022h] ; 8a 54 22
call 0f121h ; e8 30 ff
push bx ; 53
mov dx, 00cfch ; ba fc 0c
mov ax, 08080h ; b8 80 80
out DX, ax ; ef
add dx, strict byte 00002h ; 83 c2 02
out DX, ax ; ef
mov ax, word [si+006h] ; 8b 44 06
sub ax, strict byte 00020h ; 83 e8 20
shr ax, 004h ; c1 e8 04
db 08bh, 0c8h
; mov cx, ax ; 8b c8
add si, strict byte 00020h ; 83 c6 20
db 08bh, 0ech
; mov bp, sp ; 8b ec
mov ax, 0f11dh ; b8 1d f1
push ax ; 50
db 033h, 0c0h
; xor ax, ax ; 33 c0
push ax ; 50
pci_init_irq_loop1: ; 0xff214 LB 0x5
mov bh, byte [si] ; 8a 3c
mov bl, byte [si+001h] ; 8a 5c 01
pci_init_irq_loop2: ; 0xff219 LB 0x15
mov DL, strict byte 000h ; b2 00
call 0f121h ; e8 03 ff
mov dx, 00cfch ; ba fc 0c
in ax, DX ; ed
cmp ax, strict byte 0ffffh ; 83 f8 ff
jne short 0f22eh ; 75 07
test bl, 007h ; f6 c3 07
je short 0f285h ; 74 59
jmp short 0f27bh ; eb 4d
pci_test_int_pin: ; 0xff22e LB 0x3c
mov DL, strict byte 03ch ; b2 3c
call 0f121h ; e8 ee fe
mov dx, 00cfdh ; ba fd 0c
in AL, DX ; ec
and AL, strict byte 007h ; 24 07
je short 0f27bh ; 74 40
db 0feh, 0c8h
; dec al ; fe c8
mov DL, strict byte 003h ; b2 03
mul dl ; f6 e2
add AL, strict byte 002h ; 04 02
db 032h, 0e4h
; xor ah, ah ; 32 e4
db 08bh, 0d8h
; mov bx, ax ; 8b d8
mov al, byte [bx+si] ; 8a 00
db 08ah, 0d0h
; mov dl, al ; 8a d0
mov bx, word [byte bp+000h] ; 8b 5e 00
call 0f121h ; e8 d0 fe
mov dx, 00cfch ; ba fc 0c
and AL, strict byte 003h ; 24 03
db 002h, 0d0h
; add dl, al ; 02 d0
in AL, DX ; ec
cmp AL, strict byte 080h ; 3c 80
jc short 0f26ah ; 72 0d
mov bx, word [bp-002h] ; 8b 5e fe
mov al, byte [bx] ; 8a 07
out DX, AL ; ee
inc bx ; 43
mov word [bp-002h], bx ; 89 5e fe
call 0f1a8h ; e8 3e ff
pirq_found: ; 0xff26a LB 0x11
mov bh, byte [si] ; 8a 3c
mov bl, byte [si+001h] ; 8a 5c 01
add bl, byte [bp-003h] ; 02 5e fd
mov DL, strict byte 03ch ; b2 3c
call 0f121h ; e8 aa fe
mov dx, 00cfch ; ba fc 0c
out DX, AL ; ee
next_pci_func: ; 0xff27b LB 0xa
inc byte [bp-003h] ; fe 46 fd
db 0feh, 0c3h
; inc bl ; fe c3
test bl, 007h ; f6 c3 07
jne short 0f219h ; 75 94
next_pir_entry: ; 0xff285 LB 0xc
add si, strict byte 00010h ; 83 c6 10
mov byte [bp-003h], 000h ; c6 46 fd 00
loop 0f214h ; e2 86
db 08bh, 0e5h
; mov sp, bp ; 8b e5
pop bx ; 5b
pci_init_end: ; 0xff291 LB 0x2f
pop bp ; 5d
pop DS ; 1f
retn ; c3
db 089h, 0c0h, 089h, 0c0h, 089h, 0c0h, 089h, 0c0h, 089h, 0c0h, 089h, 0c0h, 024h, 050h, 049h, 052h
db 000h, 001h, 000h, 002h, 000h, 008h, 000h, 000h, 086h, 080h, 000h, 070h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 031h
_pci_routing_table: ; 0xff2c0 LB 0x1e0
db 000h, 008h, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 000h, 000h
db 000h, 010h, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 001h, 000h
db 000h, 018h, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 002h, 000h
db 000h, 020h, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 003h, 000h
db 000h, 028h, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 004h, 000h
db 000h, 030h, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 005h, 000h
db 000h, 038h, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 006h, 000h
db 000h, 040h, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 007h, 000h
db 000h, 048h, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 008h, 000h
db 000h, 050h, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 009h, 000h
db 000h, 058h, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 00ah, 000h
db 000h, 060h, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 00bh, 000h
db 000h, 068h, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 00ch, 000h
db 000h, 070h, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 00dh, 000h
db 000h, 078h, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 00eh, 000h
db 000h, 080h, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 00fh, 000h
db 000h, 088h, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 010h, 000h
db 000h, 090h, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 011h, 000h
db 000h, 098h, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 012h, 000h
db 000h, 0a0h, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 013h, 000h
db 000h, 0a8h, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 014h, 000h
db 000h, 0b0h, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 015h, 000h
db 000h, 0b8h, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 016h, 000h
db 000h, 0c0h, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 017h, 000h
db 000h, 0c8h, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 018h, 000h
db 000h, 0d0h, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 019h, 000h
db 000h, 0d8h, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 01ah, 000h
db 000h, 0e0h, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 01bh, 000h
db 000h, 0e8h, 060h, 0f8h, 0deh, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 01ch, 000h
db 000h, 0f0h, 061h, 0f8h, 0deh, 062h, 0f8h, 0deh, 063h, 0f8h, 0deh, 060h, 0f8h, 0deh, 01dh, 000h
_pci_routing_table_size: ; 0xff4a0 LB 0x3a1
loopne 0f4a3h ; e0 01
times 0x39d db 0
db 'XM'
int12_handler: ; 0xff841 LB 0xc
sti ; fb
push DS ; 1e
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov ax, word [00013h] ; a1 13 00
pop DS ; 1f
iret ; cf
int11_handler: ; 0xff84d LB 0xc
sti ; fb
push DS ; 1e
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov ax, word [00010h] ; a1 10 00
pop DS ; 1f
iret ; cf
int15_handler: ; 0xff859 LB 0x2e
pushfw ; 9c
push DS ; 1e
push ES ; 06
push CS ; 0e
pop DS ; 1f
cld ; fc
cmp ah, 086h ; 80 fc 86
je short 0f88ch ; 74 28
cmp ah, 0e8h ; 80 fc e8
je short 0f88ch ; 74 23
cmp ah, 0d0h ; 80 fc d0
je short 0f88ch ; 74 1e
pushaw ; 60
cmp ah, 053h ; 80 fc 53
je short 0f882h ; 74 0e
cmp ah, 0c2h ; 80 fc c2
je short 0f887h ; 74 0e
call 0616eh ; e8 f2 68
popaw ; 61
pop ES ; 07
pop DS ; 1f
popfw ; 9d
jmp short 0f895h ; eb 13
call 091ceh ; e8 49 99
jmp short 0f87ch ; eb f5
int15_handler_mouse: ; 0xff887 LB 0x5
call 06f88h ; e8 fe 76
jmp short 0f87ch ; eb f0
int15_handler32: ; 0xff88c LB 0x9
pushad ; 66 60
call 0663bh ; e8 aa 6d
popad ; 66 61
jmp short 0f87dh ; eb e8
iret_modify_cf: ; 0xff895 LB 0x14
jc short 0f8a0h ; 72 09
push bp ; 55
db 08bh, 0ech
; mov bp, sp ; 8b ec
and byte [bp+006h], 0feh ; 80 66 06 fe
pop bp ; 5d
iret ; cf
push bp ; 55
db 08bh, 0ech
; mov bp, sp ; 8b ec
or byte [bp+006h], 001h ; 80 4e 06 01
pop bp ; 5d
iret ; cf
int74_handler: ; 0xff8a9 LB 0x2e
sti ; fb
pushaw ; 60
push ES ; 06
push DS ; 1e
push strict byte 00000h ; 6a 00
push strict byte 00000h ; 6a 00
push strict byte 00000h ; 6a 00
push strict byte 00000h ; 6a 00
push strict byte 00000h ; 6a 00
push CS ; 0e
pop DS ; 1f
cld ; fc
call 06ebeh ; e8 01 76
pop cx ; 59
jcxz 0f8cch ; e3 0c
push strict byte 00000h ; 6a 00
pop DS ; 1f
push word [0040eh] ; ff 36 0e 04
pop DS ; 1f
call far [word 00022h] ; ff 1e 22 00
cli ; fa
call 0e030h ; e8 60 e7
add sp, strict byte 00008h ; 83 c4 08
pop DS ; 1f
pop ES ; 07
popaw ; 61
iret ; cf
int76_handler: ; 0xff8d7 LB 0x197
push ax ; 50
push DS ; 1e
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov byte [0008eh], 0ffh ; c6 06 8e 00 ff
call 0e030h ; e8 4a e7
pop DS ; 1f
pop ax ; 58
iret ; cf
times 0x183 db 0
db 'XM'
font8x8: ; 0xffa6e LB 0x421
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 080h, 0fch, 0b1h, 075h, 00fh, 006h, 01eh, 00eh, 01fh, 0fch, 066h, 060h, 0e8h, 061h, 095h, 066h
db 061h, 01fh, 007h, 0cfh, 006h, 01eh, 060h, 00eh, 01fh, 0fch, 0e8h, 0cah, 06dh, 061h, 01fh, 007h
db 0cfh
int70_handler: ; 0xffe8f LB 0x16
push ES ; 06
push DS ; 1e
pushaw ; 60
push CS ; 0e
pop DS ; 1f
cld ; fc
call 06b97h ; e8 ff 6c
popaw ; 61
pop DS ; 1f
pop ES ; 07
iret ; cf
add byte [bx+si], al ; 00 00
add byte [bx+si], al ; 00 00
add byte [bx+si], al ; 00 00
add byte [bx+si+04dh], bl ; 00 58 4d
int08_handler: ; 0xffea5 LB 0xae
sti ; fb
push eax ; 66 50
push DS ; 1e
push dx ; 52
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov eax, dword [0006ch] ; 66 a1 6c 00
inc eax ; 66 40
cmp eax, strict dword 0001800b0h ; 66 3d b0 00 18 00
jc short 0fec4h ; 72 07
db 066h, 033h, 0c0h
; xor eax, eax ; 66 33 c0
inc byte [word 00070h] ; fe 06 70 00
mov dword [0006ch], eax ; 66 a3 6c 00
mov AL, byte [00040h] ; a0 40 00
db 00ah, 0c0h
; or al, al ; 0a c0
je short 0feddh ; 74 0e
db 0feh, 0c8h
; dec al ; fe c8
mov byte [00040h], AL ; a2 40 00
jne short 0feddh ; 75 07
mov dx, 003f2h ; ba f2 03
in AL, DX ; ec
and AL, strict byte 0cfh ; 24 cf
out DX, AL ; ee
int 01ch ; cd 1c
cli ; fa
call 0e034h ; e8 51 e1
pop dx ; 5a
pop DS ; 1f
pop eax ; 66 58
iret ; cf
times 0x9 db 0
pop ax ; 58
dec bp ; 4d
times 0xb db 0
pop ax ; 58
dec bp ; 4d
dec di ; 4f
jc short 0ff64h ; 72 61
arpl [si+065h], bp ; 63 6c 65
and byte [bp+04dh], dl ; 20 56 4d
and byte [bp+069h], dl ; 20 56 69
jc short 0ff82h ; 72 74
jne short 0ff71h ; 75 61
insb ; 6c
inc dx ; 42
outsw ; 6f
js short 0ff35h ; 78 20
inc dx ; 42
dec cx ; 49
dec di ; 4f
push bx ; 53
times 0x38 db 0
db 'XM'
dummy_iret: ; 0xfff53 LB 0x9d
iret ; cf
iret ; cf
mov ax, ax ; 89 c0
mov ax, ax ; 89 c0
mov ax, ax ; 89 c0
mov ax, ax ; 89 c0
mov ax, ax ; 89 c0
cld ; fc
pop di ; 5f
push bx ; 53
dec bp ; 4d
pop di ; 5f
jnl short 0ff85h ; 7d 1f
add al, byte [di] ; 02 05
inc word [bx+si] ; ff 00
add byte [bx+si], al ; 00 00
add byte [bx+si], al ; 00 00
add byte [bx+si], al ; 00 00
pop di ; 5f
inc sp ; 44
dec bp ; 4d
dec cx ; 49
pop di ; 5f
and ax, strict word 00000h ; 25 00 00
add byte [bx+si], dl ; 00 10
push CS ; 0e
add byte [bx+si], al ; 00 00
add byte [di], ah ; 00 25
times 0x6f db 0
db 'XM'
cpu_reset: ; 0xffff0 LB 0x10
jmp far 0f000h:0e05bh ; ea 5b e0 00 f0
db 030h, 036h, 02fh, 032h, 033h, 02fh, 039h, 039h, 000h, 0fch, 083h
|
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r14
push %r8
push %rdx
lea addresses_D_ht+0x1ef4, %r14
clflush (%r14)
nop
nop
nop
add %rdx, %rdx
mov $0x6162636465666768, %r10
movq %r10, (%r14)
sub $32054, %r8
pop %rdx
pop %r8
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r9
push %rax
push %rdi
push %rdx
// Store
lea addresses_US+0x15d2, %r12
nop
nop
sub %rdx, %rdx
mov $0x5152535455565758, %rax
movq %rax, (%r12)
// Exception!!!
nop
nop
mov (0), %r9
nop
xor $61648, %rax
// Faulty Load
lea addresses_PSE+0xdef4, %rdi
nop
nop
nop
sub $39132, %r10
mov (%rdi), %eax
lea oracles, %rdi
and $0xff, %rax
shlq $12, %rax
mov (%rdi,%rax,1), %rax
pop %rdx
pop %rdi
pop %rax
pop %r9
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': True, 'size': 4}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_US', 'AVXalign': False, 'size': 8}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 11, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 8}}
{'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
*/
|
; A007758: a(n) = 2^n*n^2.
; 0,2,16,72,256,800,2304,6272,16384,41472,102400,247808,589824,1384448,3211264,7372800,16777216,37879808,84934656,189267968,419430400,924844032,2030043136,4437573632,9663676416,20971520000,45365592064,97844723712,210453397504,451508436992,966367641600,2063731785728,4398046511104,9354438770688,19859928776704,42090679500800,89060441849856,188153927303168,396923697627136,836178592923648,1759218604441600,3696558092582912,7758154045587456
mov $1,2
pow $1,$0
mul $1,$0
mul $1,$0
|
; A021814: Expansion of 1/((1-x)(1-4x)(1-6x)(1-8x)).
; Submitted by Jon Maiga
; 1,19,239,2519,24135,218343,1903783,16194343,135426599,1118993447,9166829607,74629521447,604827848743,4885462331431,39365093814311,316610553147431,2543028967600167,20405121901817895,163606407806611495,1311044224509177895,10501513034426642471,84091065569594470439,673202315778091806759,5388461367377742950439,43124748361239963529255,345100332924427703578663,2761416745607269103857703,22095018482148435694874663,176782255057005974793646119,1414390684039265901959344167,11315921335350664510144933927
add $0,2
lpb $0
sub $0,1
add $2,2
mul $2,6
sub $2,11
mul $3,8
add $3,$1
mul $1,4
add $1,$2
lpe
mov $0,$3
|
; #########################################################################
.386
.model flat, stdcall
option casemap :none
option dotname
; #########################################################################
include \masm32\include\windows.inc
include \masm32\include\masm32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\advapi32.inc
includelib \masm32\lib\masm32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\advapi32.lib
; #########################################################################
szText MACRO Name, Text:VARARG
LOCAL lbl
jmp lbl
Name db Text, 00000000h
lbl:
ENDM
m2m MACRO M1, M2
push M2
pop M1
ENDM
return MACRO arg
mov eax, arg
ret
ENDM
OCMOpen proto :DWORD
OCMClose proto
; ##########################################################################
.code
; ##########################################################################
DllMain proc hInstDLL:DWORD, fdwReason:DWORD, lpvReserved:DWORD
return TRUE
DllMain endp
; ##########################################################################
OCMOpen proc input:DWORD
return TRUE
OCMOpen endp
; ##########################################################################
OCMClose proc
return TRUE
OCMClose endp
; ##########################################################################
End DllMain
|
; A021491: Decimal expansion of 1/487.
; Submitted by Jon Maiga
; 0,0,2,0,5,3,3,8,8,0,9,0,3,4,9,0,7,5,9,7,5,3,5,9,3,4,2,9,1,5,8,1,1,0,8,8,2,9,5,6,8,7,8,8,5,0,1,0,2,6,6,9,4,0,4,5,1,7,4,5,3,7,9,8,7,6,7,9,6,7,1,4,5,7,9,0,5,5,4,4,1,4,7,8,4,3,9,4,2,5,0,5,1,3,3,4,7,0,2
add $0,1
mov $2,10
pow $2,$0
div $2,487
mov $0,$2
mod $0,10
|
; A081594: Let n = 10x + y where 0 <= y <= 9, x >= 0. Then a(n) = 2x+y.
; 0,1,2,3,4,5,6,7,8,9,2,3,4,5,6,7,8,9,10,11,4,5,6,7,8,9,10,11,12,13,6,7,8,9,10,11,12,13,14,15,8,9,10,11,12,13,14,15,16,17,10,11,12,13,14,15,16,17,18,19,12,13,14,15,16,17,18,19,20,21,14,15,16,17,18,19,20,21,22,23,16,17,18,19,20,21,22,23,24,25,18,19,20,21,22,23,24,25,26,27,20,21,22,23,24,25,26,27,28,29,22,23,24,25,26,27,28,29,30,31,24,25,26,27,28,29,30,31,32,33,26,27,28,29,30,31,32,33,34,35,28,29,30,31,32,33,34,35,36,37,30,31,32,33,34,35,36,37,38,39,32,33,34,35,36,37,38,39,40,41,34,35,36,37,38,39,40,41,42,43,36,37,38,39,40,41,42,43,44,45,38,39,40,41,42,43,44,45,46,47,40,41,42,43,44,45,46,47,48,49,42,43,44,45,46,47,48,49,50,51,44,45,46,47,48,49,50,51,52,53,46,47,48,49,50,51,52,53,54,55,48,49,50,51,52,53,54,55,56,57
mov $1,$0
mod $0,10
mul $0,4
add $1,$0
div $1,5
|
.global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r15
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1aacf, %rsi
lea addresses_WC_ht+0xd987, %rdi
add $20219, %rbx
mov $67, %rcx
rep movsw
nop
cmp %rax, %rax
lea addresses_normal_ht+0xd3cf, %r11
nop
nop
nop
nop
cmp %rdi, %rdi
movb $0x61, (%r11)
nop
nop
nop
cmp %r11, %r11
lea addresses_WC_ht+0x93cf, %rsi
lea addresses_WC_ht+0xb761, %rdi
and $55325, %r9
mov $107, %rcx
rep movsw
nop
nop
nop
nop
nop
xor $58873, %rax
lea addresses_A_ht+0x1284f, %rbx
clflush (%rbx)
nop
xor $13401, %rcx
movb $0x61, (%rbx)
nop
nop
nop
nop
dec %r11
lea addresses_A_ht+0x2497, %r11
nop
nop
nop
nop
nop
xor %rax, %rax
mov (%r11), %r9d
sub %rax, %rax
lea addresses_D_ht+0x1148f, %rsi
lea addresses_UC_ht+0x16cf7, %rdi
clflush (%rdi)
nop
nop
nop
nop
cmp $11776, %r15
mov $127, %rcx
rep movsw
nop
nop
add $45109, %r9
lea addresses_normal_ht+0x7cf, %r11
nop
nop
and $47780, %rax
mov $0x6162636465666768, %rdi
movq %rdi, %xmm4
vmovups %ymm4, (%r11)
sub %r11, %r11
lea addresses_normal_ht+0x1ac31, %rax
nop
nop
nop
nop
nop
add %r15, %r15
movb (%rax), %cl
xor $22552, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r15
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %r9
push %rax
push %rbp
push %rbx
push %rdi
push %rsi
// Store
lea addresses_A+0x19bcf, %rbp
nop
nop
nop
and $44154, %rbx
movl $0x51525354, (%rbp)
nop
nop
nop
nop
nop
sub $25218, %rdi
// Store
lea addresses_A+0x19bcf, %rbp
nop
nop
sub $46371, %rsi
movb $0x51, (%rbp)
nop
nop
nop
nop
add %rbp, %rbp
// Store
lea addresses_D+0xe30f, %r9
nop
inc %rbp
mov $0x5152535455565758, %rsi
movq %rsi, %xmm0
vmovups %ymm0, (%r9)
nop
inc %rax
// Store
lea addresses_WT+0x1e3cf, %rax
nop
nop
nop
nop
xor $45580, %rbx
movw $0x5152, (%rax)
nop
nop
nop
nop
nop
and $8736, %rbp
// Faulty Load
lea addresses_A+0x19bcf, %rdi
nop
cmp $5863, %rbx
mov (%rdi), %r15d
lea oracles, %rsi
and $0xff, %r15
shlq $12, %r15
mov (%rsi,%r15,1), %r15
pop %rsi
pop %rdi
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 9}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
{'51': 21829}
51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51 51
*/
|
#Mitch Guthrie
#Homework 1
# C code:
# a = 4*(b-c) + (d+e)/2
.data
a: .word 0 # a
b: .word 12 # b
c: .word 5 # c
d: .word 3 # d
e: .word 7 # e
newline: .byte '\n'
.text
lw $s0, a # load all data from RAM into registers
lw $s1, b
lw $s2, c
lw $s3, d
lw $s4, e
sub $t0, $s1, $s2
add $t1, $s3, $s4
sll $t2, $t0, 2
srl $t3, $t1, 1
add $s0, $t2, $t3
sw $s0, a
li $v0, 1 # Setup to call system for I/O
lw $a0, a # "load word" from RAM
syscall |
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20714
//
//
///
// Buffer Definitions:
//
// cbuffer cbPS
// {
//
// float4 g_param; // Offset: 0 Size: 16
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// PointSampler sampler NA NA 0 1
// LinearSampler sampler NA NA 1 1
// tex texture float4 2d 0 1
// bloom texture float4 2d 2 1
// cbPS cbuffer NA NA 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET 0 xyzw 0 TARGET float xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[1], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t2
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 3
add r0.x, cb0[0].x, l(0.001000)
div r0.x, l(0.720000), r0.x
sample_indexable(texture2d)(float,float,float,float) r0.yzw, v1.xyxx, t0.wxyz, s0
mul r0.xyz, r0.xxxx, r0.yzwy
mad r1.xyz, r0.xyzx, l(0.666667, 0.666667, 0.666667, 0.000000), l(1.000000, 1.000000, 1.000000, 0.000000)
mul r2.xyz, r0.xyzx, r1.xyzx
mad r0.xyz, r0.xyzx, r1.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
div r0.xyz, r2.xyzx, r0.xyzx
sample_indexable(texture2d)(float,float,float,float) r1.xyz, v1.xyxx, t2.xyzw, s1
mad o0.xyz, r1.xyzx, l(0.600000, 0.600000, 0.600000, 0.000000), r0.xyzx
mov o0.w, l(1.000000)
ret
// Approximately 12 instruction slots used
|
;;
;; Copyright (c) 2012-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.
;;
%include "include/os.asm"
%include "imb_job.asm"
%include "mb_mgr_datastruct.asm"
%include "include/reg_sizes.asm"
extern sha512_x2_sse
section .data
default rel
align 16
byteswap: ;ddq 0x08090a0b0c0d0e0f0001020304050607
dq 0x0001020304050607, 0x08090a0b0c0d0e0f
len_masks:
;ddq 0x0000000000000000000000000000FFFF
dq 0x000000000000FFFF, 0x0000000000000000
;ddq 0x000000000000000000000000FFFF0000
dq 0x00000000FFFF0000, 0x0000000000000000
one: dq 1
section .text
%ifndef FUNC
%define FUNC flush_job_hmac_sha_512_sse
%define SHA_X_DIGEST_SIZE 512
%endif
%if 1
%ifdef LINUX
%define arg1 rdi
%define arg2 rsi
%else
%define arg1 rcx
%define arg2 rdx
%endif
%define state arg1
%define job arg2
%define len2 arg2
; idx needs to be in rbx, rbp, r12-r15
%define idx rbp
%define unused_lanes rbx
%define lane_data rbx
%define tmp2 rbx
%define job_rax rax
%define tmp1 rax
%define size_offset rax
%define tmp rax
%define start_offset rax
%define tmp3 arg1
%define extra_blocks arg2
%define p arg2
%define tmp4 r8
%define tmp5 r9
%define tmp6 r10
%endif
; This routine clobbers rbx, rbp
struc STACK
_gpr_save: resq 2
_rsp_save: resq 1
endstruc
%define APPEND(a,b) a %+ b
; JOB* FUNC(MB_MGR_HMAC_SHA_512_OOO *state)
; arg 1 : rcx : state
MKGLOBAL(FUNC,function,internal)
FUNC:
mov rax, rsp
sub rsp, STACK_size
and rsp, -16
mov [rsp + _gpr_save + 8*0], rbx
mov [rsp + _gpr_save + 8*1], rbp
mov [rsp + _rsp_save], rax ; original SP
mov unused_lanes, [state + _unused_lanes_sha512]
bt unused_lanes, 16+7
jc return_null
; find a lane with a non-null job
xor idx, idx
cmp qword [state + _ldata_sha512 + 1 * _SHA512_LANE_DATA_size + _job_in_lane_sha512], 0
cmovne idx, [rel one]
copy_lane_data:
; copy good lane (idx) to empty lanes
movdqa xmm0, [state + _lens_sha512]
mov tmp, [state + _args_sha512 + _data_ptr_sha512 + PTR_SZ*idx]
%assign I 0
%rep 2
cmp qword [state + _ldata_sha512 + I * _SHA512_LANE_DATA_size + _job_in_lane_sha512], 0
jne APPEND(skip_,I)
mov [state + _args_sha512 + _data_ptr_sha512 + PTR_SZ*I], tmp
por xmm0, [rel len_masks + 16*I]
APPEND(skip_,I):
%assign I (I+1)
%endrep
movdqa [state + _lens_sha512], xmm0
phminposuw xmm1, xmm0
pextrw len2, xmm1, 0 ; min value
pextrw idx, xmm1, 1 ; min index (0...3)
cmp len2, 0
je len_is_0
pshuflw xmm1, xmm1, 0xA0
psubw xmm0, xmm1
movdqa [state + _lens_sha512], xmm0
; "state" and "args" are the same address, arg1
; len is arg2
call sha512_x2_sse
; state and idx are intact
len_is_0:
; process completed job "idx"
imul lane_data, idx, _SHA512_LANE_DATA_size
lea lane_data, [state + _ldata_sha512 + lane_data]
mov DWORD(extra_blocks), [lane_data + _extra_blocks_sha512]
cmp extra_blocks, 0
jne proc_extra_blocks
cmp dword [lane_data + _outer_done_sha512], 0
jne end_loop
proc_outer:
mov dword [lane_data + _outer_done_sha512], 1
mov DWORD(size_offset), [lane_data + _size_offset_sha512]
mov qword [lane_data + _extra_block_sha512 + size_offset], 0
mov word [state + _lens_sha512 + 2*idx], 1
lea tmp, [lane_data + _outer_block_sha512]
mov job, [lane_data + _job_in_lane_sha512]
mov [state + _args_data_ptr_sha512 + PTR_SZ*idx], tmp
%assign I 0
%rep (SHA_X_DIGEST_SIZE / (8*16))
movq xmm0, [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + (2*I)*SHA512_DIGEST_ROW_SIZE]
pinsrq xmm0, [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + (2*I + 1) *SHA512_DIGEST_ROW_SIZE], 1
pshufb xmm0, [rel byteswap]
movdqa [lane_data + _outer_block_sha512 + I*16], xmm0
%assign I (I+1)
%endrep
mov tmp, [job + _auth_key_xor_opad]
%assign I 0
%rep 4
movdqu xmm0, [tmp + I * 16]
movq [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 2*I*SHA512_DIGEST_ROW_SIZE], xmm0
pextrq [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + (2*I + 1)*SHA512_DIGEST_ROW_SIZE], xmm0, 1
%assign I (I+1)
%endrep
jmp copy_lane_data
align 16
proc_extra_blocks:
mov DWORD(start_offset), [lane_data + _start_offset_sha512]
mov [state + _lens_sha512 + 2*idx], WORD(extra_blocks)
lea tmp, [lane_data + _extra_block_sha512 + start_offset]
mov [state + _args_data_ptr_sha512 + PTR_SZ*idx], tmp
mov dword [lane_data + _extra_blocks_sha512], 0
jmp copy_lane_data
return_null:
xor job_rax, job_rax
jmp return
align 16
end_loop:
mov job_rax, [lane_data + _job_in_lane_sha512]
mov qword [lane_data + _job_in_lane_sha512], 0
or dword [job_rax + _status], STS_COMPLETED_HMAC
mov unused_lanes, [state + _unused_lanes_sha512]
shl unused_lanes, 8
or unused_lanes, idx
mov [state + _unused_lanes_sha512], unused_lanes
mov p, [job_rax + _auth_tag_output]
%if (SHA_X_DIGEST_SIZE != 384)
cmp qword [job_rax + _auth_tag_output_len_in_bytes], 32
jne copy_full_digest
%else
cmp qword [job_rax + _auth_tag_output_len_in_bytes], 24
jne copy_full_digest
%endif
;; copy 32 bytes for SHA512 // 24 bytes for SHA384
mov QWORD(tmp2), [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 0*SHA512_DIGEST_ROW_SIZE]
mov QWORD(tmp4), [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 1*SHA512_DIGEST_ROW_SIZE]
mov QWORD(tmp6), [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 2*SHA512_DIGEST_ROW_SIZE]
%if (SHA_X_DIGEST_SIZE != 384)
mov QWORD(tmp5), [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 3*SHA512_DIGEST_ROW_SIZE]
%endif
bswap QWORD(tmp2)
bswap QWORD(tmp4)
bswap QWORD(tmp6)
%if (SHA_X_DIGEST_SIZE != 384)
bswap QWORD(tmp5)
%endif
mov [p + 0*8], QWORD(tmp2)
mov [p + 1*8], QWORD(tmp4)
mov [p + 2*8], QWORD(tmp6)
%if (SHA_X_DIGEST_SIZE != 384)
mov [p + 3*8], QWORD(tmp5)
%endif
jmp clear_ret
copy_full_digest:
;; copy 32 bytes for SHA512 // 24 bytes for SHA384
mov QWORD(tmp2), [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 0*SHA512_DIGEST_ROW_SIZE]
mov QWORD(tmp4), [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 1*SHA512_DIGEST_ROW_SIZE]
mov QWORD(tmp6), [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 2*SHA512_DIGEST_ROW_SIZE]
mov QWORD(tmp5), [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 3*SHA512_DIGEST_ROW_SIZE]
bswap QWORD(tmp2)
bswap QWORD(tmp4)
bswap QWORD(tmp6)
bswap QWORD(tmp5)
mov [p + 0*8], QWORD(tmp2)
mov [p + 1*8], QWORD(tmp4)
mov [p + 2*8], QWORD(tmp6)
mov [p + 3*8], QWORD(tmp5)
mov QWORD(tmp2), [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 4*SHA512_DIGEST_ROW_SIZE]
mov QWORD(tmp4), [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 5*SHA512_DIGEST_ROW_SIZE]
%if (SHA_X_DIGEST_SIZE != 384)
mov QWORD(tmp6), [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 6*SHA512_DIGEST_ROW_SIZE]
mov QWORD(tmp5), [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*idx + 7*SHA512_DIGEST_ROW_SIZE]
%endif
bswap QWORD(tmp2)
bswap QWORD(tmp4)
%if (SHA_X_DIGEST_SIZE != 384)
bswap QWORD(tmp6)
bswap QWORD(tmp5)
%endif
mov [p + 4*8], QWORD(tmp2)
mov [p + 5*8], QWORD(tmp4)
%if (SHA_X_DIGEST_SIZE != 384)
mov [p + 6*8], QWORD(tmp6)
mov [p + 7*8], QWORD(tmp5)
%endif
clear_ret:
%ifdef SAFE_DATA
pxor xmm0, xmm0
;; Clear digest (48B/64B), outer_block (48B/64B) and extra_block (128B) of returned job
%assign I 0
%rep 2
cmp qword [state + _ldata_sha512 + (I*_SHA512_LANE_DATA_size) + _job_in_lane_sha512], 0
jne APPEND(skip_clear_,I)
;; Clear digest (48 bytes for SHA-384, 64 bytes for SHA-512 bytes)
%assign J 0
%rep 6
mov qword [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*I + J*SHA512_DIGEST_ROW_SIZE], 0
%assign J (J+1)
%endrep
%if (SHA_X_DIGEST_SIZE != 384)
mov qword [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*I + 6*SHA512_DIGEST_ROW_SIZE], 0
mov qword [state + _args_digest_sha512 + SHA512_DIGEST_WORD_SIZE*I + 7*SHA512_DIGEST_ROW_SIZE], 0
%endif
lea lane_data, [state + _ldata_sha512 + (I*_SHA512_LANE_DATA_size)]
;; Clear first 128 bytes of extra_block
%assign offset 0
%rep 8
movdqa [lane_data + _extra_block + offset], xmm0
%assign offset (offset + 16)
%endrep
;; Clear first 48 bytes (SHA-384) or 64 bytes (SHA-512) of outer_block
movdqa [lane_data + _outer_block], xmm0
movdqa [lane_data + _outer_block + 16], xmm0
movdqa [lane_data + _outer_block + 32], xmm0
%if (SHA_X_DIGEST_SIZE != 384)
movdqa [lane_data + _outer_block + 48], xmm0
%endif
APPEND(skip_clear_,I):
%assign I (I+1)
%endrep
%endif ;; SAFE_DATA
return:
mov rbx, [rsp + _gpr_save + 8*0]
mov rbp, [rsp + _gpr_save + 8*1]
mov rsp, [rsp + _rsp_save] ; original SP
ret
%ifdef LINUX
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.