hexsha stringlengths 40 40 | size int64 6 1.05M | ext stringclasses 3 values | lang stringclasses 1 value | max_stars_repo_path stringlengths 4 232 | max_stars_repo_name stringlengths 7 106 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 7 | max_stars_count int64 1 33.5k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 232 | max_issues_repo_name stringlengths 7 106 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 7 | max_issues_count int64 1 37.5k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 232 | max_forks_repo_name stringlengths 7 106 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 7 | max_forks_count int64 1 12.6k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 6 1.05M | avg_line_length float64 1.16 19.7k | max_line_length int64 2 938k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d3c7f5f59b97a5dff0786c23b8871e2957000192 | 381 | asm | Assembly | programs/oeis/204/A204125.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/204/A204125.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/204/A204125.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A204125: Symmetric matrix based on f(i,j)=(i if i=j and 1 otherwise), by antidiagonals.
; 1,1,1,1,2,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,6,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1
lpb $0,1
add $1,4
sub $0,$1
lpe
lpb $0,1
div $0,8
mov $1,$2
lpe
div $1,4
add $1,1
| 27.214286 | 199 | 0.551181 |
fe9a72f3096b00bacf9c73d9da799295cb187097 | 919 | asm | Assembly | Kernel/asm/libasm.asm | tdorado/so-tp2 | a3cee8b454a741815efb60d0c067f368313e31d7 | [
"BSD-3-Clause"
] | null | null | null | Kernel/asm/libasm.asm | tdorado/so-tp2 | a3cee8b454a741815efb60d0c067f368313e31d7 | [
"BSD-3-Clause"
] | null | null | null | Kernel/asm/libasm.asm | tdorado/so-tp2 | a3cee8b454a741815efb60d0c067f368313e31d7 | [
"BSD-3-Clause"
] | null | null | null | GLOBAL cpuVendor
GLOBAL getTimeRTC
SECTION .text
; cpuVendor -- Writes information of the cpu on the buffer
; IN: RDI = pointer to buffer
; OUT: RAX = pointer of the buffer with the information
cpuVendor:
push rbp
mov rbp, rsp
push rbx
mov rax, 0
cpuid
mov [rdi], ebx
mov [rdi + 4], edx
mov [rdi + 8], ecx
mov byte [rdi+13], 0
mov rax, rdi
pop rbx
mov rsp, rbp
pop rbp
ret
; getTimeRTC -- Gets the corresponding actual unit of time requested
; IN: RDI = 0 for seconds, 2 for minutes, 4 for hours, 6 for weekday,
; 7 for days, 8 for months, 9 for years
; OUT: RAX = corresponding unit of time requested
getTimeRTC:
push rbp
mov rbp, rsp
mov al,0x0B ; RTC Status Register B Para el formato 24 horas
out 70h,al
in al, 71h
or al, 0x04 ; Second bit = 1
out 71h, al ; Overwrite config
mov rax, rdi
out 70h,al
in al,71h
movzx rax, al
mov rsp, rbp
pop rbp
ret | 17.339623 | 70 | 0.670294 |
b2bf9dfeb806ae0bfdc8145588f636e5740c6e56 | 1,545 | asm | Assembly | programs/oeis/192/A192955.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/192/A192955.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/192/A192955.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A192955: Coefficient of x in the reduction by x^2 -> x+1 of the polynomial p(n,x) defined at Comments.
; 0,1,2,7,18,41,84,161,294,519,894,1513,2528,4185,6882,11263,18370,29889,48548,78761,127670,206831,334942,542257,877728,1420561,2298914,3720151,6019794,9740729,15761364,25502993,41265318,66769335,108035742,174806233,282843200,457650729,740495298,1198147471,1938644290,3136793361,5075439332,8212234457,13287675638,21499912031,34787589694,56287503841,91075095744,147362601889,238437700034,385800304423,624238007058,1010038314185,1634276324052,2644314641153,4278590968230,6922905612519,11201496583998,18124402199881,29325898787360,47450300990841,76776199781922,124226500776607,201002700562498,325229201343201,526231901909924,851461103257481,1377693005171894,2229154108433999,3606847113610654,5836001222049553,9442848335665248,15278849557719985,24721697893390562,40000547451116023,64722245344512210,104722792795634009,169445038140152148,274167830935792241,443612869075950630,717780700011749271,1161393569087706462,1879174269099462457,3040567838187175808,4919742107286645321,7960309945473828354,12880052052760481071,20840361998234316994,33720414050994805809,54560776049229130724,88281190100223944633,142841966149453083638,231123156249677036735,373965122399130129022,605088278648807174593,979053401047937312640,1584141679696744496449,2563195080744681818498,4147336760441426324551
lpb $0
sub $0,1
seq $2,192954 ; Constant term of the reduction by x^2 -> x+1 of the polynomial p(n,x) defined at Comments.
add $1,$2
mov $2,$0
lpe
mov $0,$1
| 140.454545 | 1,273 | 0.875081 |
a570e3b51f128eaf9c9bc0f8fd1d192d0e0446da | 403 | asm | Assembly | programs/oeis/133/A133989.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/133/A133989.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/133/A133989.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A133989: Define fu(1,1) = 0. Then a(n) = fu(1,n) = smallest number t such that an n X 1 strip of n squares can be cut into n squares using p_1, p_2, ..., p_t cuts where p_t is a prime number or p_t = 1.
; 0,1,1,1,2,1,2,1,2,2,2,3,2
mov $3,$0
mul $3,5
lpb $3
mov $6,$2
mul $2,$3
mov $5,$6
sub $6,$0
sub $2,$6
div $5,3
mov $4,$5
cmp $4,0
add $5,$4
div $2,$5
sub $3,1
lpe
mov $0,$5
| 20.15 | 204 | 0.563275 |
8f0f3107fd8655da1f0ca3970dba3673765e87fc | 485 | asm | Assembly | unittests/ASM/Primary/Primary_AB_word_REP.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 628 | 2020-03-06T14:01:32.000Z | 2022-03-31T06:35:14.000Z | unittests/ASM/Primary/Primary_AB_word_REP.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 576 | 2020-03-06T08:25:12.000Z | 2022-03-30T04:05:29.000Z | unittests/ASM/Primary/Primary_AB_word_REP.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 38 | 2020-03-07T06:10:00.000Z | 2022-03-29T09:27:36.000Z | %ifdef CONFIG
{
"RegData": {
"RAX": "0xF1F2F1F2F1F2F1F2",
"RDX": "0x0",
"RDI": "0xE0000018"
},
"MemoryRegions": {
"0x100000000": "4096"
}
}
%endif
mov rdx, 0xe0000000
mov rax, 0x4142434445464748
mov [rdx + 8 * 0], rax
mov rax, 0x5152535455565758
mov [rdx + 8 * 1], rax
mov rax, 0x0
mov [rdx + 8 * 2], rax
mov [rdx + 8 * 3], rax
lea rdi, [rdx + 8 * 2]
cld
mov rcx, 0x4
mov rax, 0xF1F2
rep stosw ; rdi <- ax
mov rax, [rdx + 8 * 2]
mov rdx, [rdx + 8 * 3]
hlt
| 14.264706 | 32 | 0.579381 |
0983021e70ae282d79fd863d685f5a9a65c9d220 | 3,118 | asm | Assembly | iod/iob/io.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | iod/iob/io.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | iod/iob/io.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; Buffering IO V2.00 1989 Tony Tebby QJUMP
section iou
xdef iob_io
xdef iob_iohdr
xref iob_tbyt
xref iob_gbyt
xref iob_glin
xref iob_gmul
xref iob_pbyt
xref iob_pmul
include 'dev8_keys_err'
include 'dev8_keys_sys'
include 'dev8_keys_qdos_io'
include 'dev8_keys_buf'
;+++
; This routine does standard serial IO.
;
; d0 cr IO key / status
; d1 cr IO parameter
; d2 c IO parameter (could be extended or set to 15)
; a1 cr IO parameter
; a2 c p pointer to pointers to IO queues
; a6 c p pointer to sysvar
;
; status returns standard, except end of file is +1
;
;---
iob_io
cmp.b #iob.smul,d0 ; simple byte io?
bhi.s ibio_fs ; ... no, try filing system
move.b ibio_btab(pc,d0.w),d0
jmp ibio_btab(pc,d0.w)
ibio_btab
dc.b ibio_tbyt-ibio_btab
dc.b ibio_fbyt-ibio_btab
dc.b ibio_flin-ibio_btab
dc.b ibio_fmul-ibio_btab
dc.b ibio_ipar-ibio_btab
dc.b ibio_sbyt-ibio_btab
dc.b ibio_smul-ibio_btab
dc.b ibio_smul-ibio_btab
;+++
; This is the entry point to header IO
;
; d0 cr IO key / status
; d1 cr IO parameter
; d2 c IO parameter (could be extended or set to 15)
; a1 cr IO parameter
; a2 c p pointer to pointers to IO queues
; a6 c p pointer to sysvar
;
; status returns standard, except end of file is +1
;
;---
iob_iohdr
ibio_fs
sub.b #iof.shdr,d0 ; set header
beq.s ibio_shdr
subq.b #iof.rhdr-iof.shdr,d0 ; read header
beq.s ibio_rhdr
subq.b #iof.load-iof.rhdr,d0 ; load file
beq.s ibio_load
subq.b #iof.save-iof.load,d0 ; save file
beq.s ibio_save
ibio_ipar
moveq #err.ipar,d0
ibio_rts
rts
ibio_rhdr ; read header
moveq #15,d2 ; read fifteen bytes
tst.w d1 ; any read yet
bne.s ibio_load ; ... yes, fetch multiple
bsr.s ibio_tbyt ; test for $ff
bne.s ibio_rts
addq.b #1,d1 ; was it $ff
bne.s ibio_ipar ; ... no, not header
bsr.s ibio_gbyt ; ... yes, fetch byte (and ignore it)
moveq #1,d1 ; one read
jmp iob_gmul ; get the rest
ibio_shdr ; set header
moveq #15,d2 ; send 15 bytes
tst.w d1 ; any sent yet?
bne.s ibio_save ; ... yes, carry on
st d1
bsr.s ibio_sbyt ; send flag byte
sf d1
bne.s ibio_rts
moveq #1,d1 ; one byte gone now
jmp iob_pmul ; send the rest
ibio_tbyt ; test byte
move.l bio_ibuf(a2),d0 ; get buffer/queue pointer
beq.s ibio_ipar ; ... none
move.l d0,a2
jmp iob_tbyt ; test for byte
ibio_fbyt ; fetch byte
move.l bio_ibuf(a2),d0 ; get buffer/queue pointer
beq.s ibio_ipar ; ... none
move.l d0,a2
ibio_gbyt
jmp iob_gbyt ; get byte
ibio_flin ; fetch line
ext.l d2
move.l bio_ibuf(a2),d0 ; get buffer/queue pointer
beq.s ibio_ipar ; ... none
move.l d0,a2
jmp iob_glin
ibio_fmul ; fetch multiple / load
ext.l d2
ibio_load
move.l bio_ibuf(a2),d0 ; get buffer/queue pointer
beq.s ibio_ipar ; ... none
move.l d0,a2
jmp iob_gmul
ibio_sbyt ; send byte
move.l bio_obuf(a2),d0 ; get buffer/queue pointer
beq.s ibio_ipar ; ... none
move.l d0,a2
jmp iob_pbyt
ibio_smul ; send multiple / save
ext.l d2
ibio_save
move.l bio_obuf(a2),d0 ; get buffer/queue pointer
beq.s ibio_ipar ; ... none
move.l d0,a2
jmp iob_pmul
end
| 21.957746 | 56 | 0.689545 |
62e4991daee2dc007f1e2aa7bbd4927ac0759f00 | 144 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver2/sfc/ys_w51.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver2/sfc/ys_w51.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver2/sfc/ys_w51.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: ys_w51.asm
Type: file
Size: 19867
Last-Modified: '2016-05-13T04:51:45Z'
SHA-1: 5CF4C2E21C91A94AA098CBF36C4E486A1A78FE46
Description: null
| 20.571429 | 47 | 0.8125 |
65a69370817b95927e56404a0321f8150dda65be | 361 | asm | Assembly | libsrc/_DEVELOPMENT/sound/bit/c/sdcc_iy/bit_synth_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/sound/bit/c/sdcc_iy/bit_synth_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/sound/bit/c/sdcc_iy/bit_synth_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; void bit_synth_callee(int dur, int freq_1, int freq_2, int freq_3, int freq_4)
SECTION code_clib
SECTION smc_sound_bit
PUBLIC _bit_synth_callee, l0_bit_synth_callee
EXTERN asm_bit_synth
_bit_synth_callee:
pop af
pop de
pop bc
ld d,c
pop hl
pop bc
ld h,c
pop bc
push af
l0_bit_synth_callee:
ld a,c
jp asm_bit_synth
| 12.892857 | 80 | 0.714681 |
1c6e2e220bdbee2a3bf83fb503cb3203d99c4974 | 1,188 | asm | Assembly | programs/oeis/001/A001654.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/001/A001654.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/001/A001654.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A001654: Golden rectangle numbers: F(n)*F(n+1), where F(n) = A000045(n) (Fibonacci numbers).
; 0,1,2,6,15,40,104,273,714,1870,4895,12816,33552,87841,229970,602070,1576239,4126648,10803704,28284465,74049690,193864606,507544127,1328767776,3478759200,9107509825,23843770274,62423800998,163427632719,427859097160,1120149658760,2932589879121,7677619978602,20100270056686,52623190191455,137769300517680,360684711361584,944284833567073,2472169789339634,6472224534451830
mov $18,$0
mov $20,$0
lpb $20
clr $0,18
mov $0,$18
sub $20,1
sub $0,$20
mov $15,$0
mov $17,$0
lpb $17
mov $0,$15
sub $17,1
sub $0,$17
mov $11,$0
mov $13,2
lpb $13
mov $0,$11
sub $13,1
add $0,$13
mov $1,3
mov $5,-2
mov $8,3
lpb $0
sub $0,1
sub $3,$8
add $5,$1
mov $1,$3
mov $3,$5
add $3,6
mov $8,1
lpe
pow $1,2
div $1,36
mul $1,3
mov $3,3
mov $14,$13
lpb $14
mov $12,$1
sub $14,1
lpe
lpe
lpb $11
mov $11,0
sub $12,$1
lpe
mov $1,$12
div $1,3
add $16,$1
lpe
add $19,$16
lpe
mov $1,$19
| 21.214286 | 369 | 0.56229 |
9705ce7908d5ff76a5c3a2f9bb0bde567fe4dddb | 1,864 | asm | Assembly | programs/oeis/179/A179904.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/179/A179904.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/179/A179904.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A179904: a(n) = A056520(n)+1 for n>0, a(0)=1.
; 1,3,7,16,32,57,93,142,206,287,387,508,652,821,1017,1242,1498,1787,2111,2472,2872,3313,3797,4326,4902,5527,6203,6932,7716,8557,9457,10418,11442,12531,13687,14912,16208,17577,19021,20542,22142,23823,25587,27436,29372,31397,33513,35722,38026,40427,42927,45528,48232,51041,53957,56982,60118,63367,66731,70212,73812,77533,81377,85346,89442,93667,98023,102512,107136,111897,116797,121838,127022,132351,137827,143452,149228,155157,161241,167482,173882,180443,187167,194056,201112,208337,215733,223302,231046,238967,247067,255348,263812,272461,281297,290322,299538,308947,318551,328352,338352,348553,358957,369566,380382,391407,402643,414092,425756,437637,449737,462058,474602,487371,500367,513592,527048,540737,554661,568822,583222,597863,612747,627876,643252,658877,674753,690882,707266,723907,740807,757968,775392,793081,811037,829262,847758,866527,885571,904892,924492,944373,964537,984986,1005722,1026747,1048063,1069672,1091576,1113777,1136277,1159078,1182182,1205591,1229307,1253332,1277668,1302317,1327281,1352562,1378162,1404083,1430327,1456896,1483792,1511017,1538573,1566462,1594686,1623247,1652147,1681388,1710972,1740901,1771177,1801802,1832778,1864107,1895791,1927832,1960232,1992993,2026117,2059606,2093462,2127687,2162283,2197252,2232596,2268317,2304417,2340898,2377762,2415011,2452647,2490672,2529088,2567897,2607101,2646702,2686702,2727103,2767907,2809116,2850732,2892757,2935193,2978042,3021306,3064987,3109087,3153608,3198552,3243921,3289717,3335942,3382598,3429687,3477211,3525172,3573572,3622413,3671697,3721426,3771602,3822227,3873303,3924832,3976816,4029257,4082157,4135518,4189342,4243631,4298387,4353612,4409308,4465477,4522121,4579242,4636842,4694923,4753487,4812536,4872072,4932097,4992613,5053622,5115126,5177127
lpb $0,1
mov $2,$0
add $3,$0
sub $0,1
add $1,$3
lpe
add $1,1
add $1,$2
| 155.333333 | 1,735 | 0.830472 |
d31d844332698ac3ef7be717ffccd4d3fd77d9cb | 331 | asm | Assembly | unittests/ASM/TwoByte/0F_84.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 628 | 2020-03-06T14:01:32.000Z | 2022-03-31T06:35:14.000Z | unittests/ASM/TwoByte/0F_84.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 576 | 2020-03-06T08:25:12.000Z | 2022-03-30T04:05:29.000Z | unittests/ASM/TwoByte/0F_84.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 38 | 2020-03-07T06:10:00.000Z | 2022-03-29T09:27:36.000Z | %ifdef CONFIG
{
"RegData": {
"RAX": "0x1",
"RBX": "0x0"
},
"MemoryRegions": {
"0x100000000": "4096"
}
}
%endif
mov r15, 0xe0000000
mov r10, 0x1
mov r11, 0x0
mov r12, 0x1
cmp r10d, r12d
mov rax, 0
mov rbx, 0
jz .tgt_1
jnz .tgt_2
jmp .end
.tgt_1:
mov rax, 1
jmp .end
.tgt_2:
mov rbx, 1
jmp .end
.end:
hlt
| 8.710526 | 25 | 0.586103 |
edb787e1caba1a33bb186664c96e39f328661f0a | 939 | asm | Assembly | boot/src/gd_table.asm | aryan-gupta/OS_2 | 50f7deb573fa50fead42bb748a8ff4743701cc67 | [
"MIT"
] | null | null | null | boot/src/gd_table.asm | aryan-gupta/OS_2 | 50f7deb573fa50fead42bb748a8ff4743701cc67 | [
"MIT"
] | null | null | null | boot/src/gd_table.asm | aryan-gupta/OS_2 | 50f7deb573fa50fead42bb748a8ff4743701cc67 | [
"MIT"
] | null | null | null |
; Honest to god have no idea what this is doing. Help me please
; http://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf#page=36
; https://github.com/cfenollosa/os-tutorial/tree/master/09-32bit-gdt
gdt_start:
gdt_null: ; kinda redundant, might remove
dq 0x00
gdt_code:
dw 0xffff ; segment length, bits 0-15
dw 0x0 ; segment base, bits 0-15
db 0x0 ; segment base, bits 16-23
db 0b1001_1010 ; flags (8 bits)
db 0b1100_1111 ; flags (4 bits) + segment length, bits 16-19
db 0x0 ; segment base, bits 24-31
gdt_data:
dw 0xffff
dw 0x0
db 0x0
db 10010010b
db 11001111b
db 0x0
gdt_end:
; GDT descriptor
gdt_descriptor:
dw gdt_end - gdt_start - 1 ; size (16 bit), always one less of its true size
dd gdt_start ; address (32 bit)
; define some constants for later use
CODE_SEG equ gdt_code - gdt_start
DATA_SEG equ gdt_data - gdt_start | 24.710526 | 80 | 0.675186 |
51a9c4db6b85ce4c737f72a39d6e075cc9c52c95 | 2,492 | asm | Assembly | 3d/globvars.asm | osgcc/descent-pc | 819ed672e9fde6eddea634154306c5154230b84d | [
"Unlicense"
] | 3 | 2016-03-22T12:32:01.000Z | 2017-11-07T12:14:28.000Z | 3d/globvars.asm | osgcc/descent-pc | 819ed672e9fde6eddea634154306c5154230b84d | [
"Unlicense"
] | null | null | null | 3d/globvars.asm | osgcc/descent-pc | 819ed672e9fde6eddea634154306c5154230b84d | [
"Unlicense"
] | 1 | 2021-03-30T07:34:36.000Z | 2021-03-30T07:34:36.000Z | ;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
;
; $Source: f:/miner/source/3d/rcs/globvars.asm $
; $Revision: 1.6 $
; $Author: matt $
; $Date: 1994/11/19 17:25:27 $
;
; Global variables for 3d system
;
; $Log: globvars.asm $
; Revision 1.6 1994/11/19 17:25:27 matt
; Took out unneeded var define
;
; Revision 1.5 1994/07/25 00:00:03 matt
; Made 3d no longer deal with point numbers, but only with pointers.
;
; Revision 1.4 1994/01/28 15:23:23 matt
; Added _Matrix_scale so C can get at those vars
;
; Revision 1.3 1994/01/13 15:38:29 mike
; rename Frame_count to _Frame_count, can you guess why?
;
; Revision 1.2 1993/11/04 18:49:16 matt
; Added system to only rotate points once per frame
;
; Revision 1.1 1993/10/29 22:20:27 matt
; Initial revision
;
;
;
.386
option oldstructs
.nolist
include types.inc
include psmacros.inc
include 3d.inc
.list
assume ds:_DATA
_DATA segment dword public USE32 'DATA'
rcsid db "$Id: globvars.asm 1.6 1994/11/19 17:25:27 matt Exp $"
align 4
View_position vms_vector <>
View_zoom fix ?
Unscaled_matrix vms_matrix <> ;before scaling
View_matrix vms_matrix <>
Window_scale vms_vector <> ;scaling for window aspect
Matrix_scale vms_vector <> ;how the matrix is scaled
;window_scale * zoom
Canvas_width dd ? ;the actual width
Canvas_height dd ? ;the actual height
Canv_w2 fix ? ;fixed-point width/2
Canv_h2 fix ? ;fixed-point height/2
;vertex buffers for polygon drawing and clipping
Vbuf0 dd MAX_POINTS_IN_POLY dup (?)
Vbuf1 dd MAX_POINTS_IN_POLY dup (?)
;list of 2d coords
Vertex_list fix MAX_POINTS_IN_POLY*2 dup (?)
;;;used for determining whether to rotate a frame
;;_Frame_count dw -1 ;first frame will inc to 0
_DATA ends
end
| 28.976744 | 77 | 0.717496 |
1dc85e9c93d1d319c891c77b84bbd9578f65bfe0 | 1,036 | asm | Assembly | Silicon/BroxtonSoC/BroxtonSiPkg/Cpu/ResetVector/Vtf1/Main.asm | bcran/edk2-platforms | 7c914946bd014dc1f3cf0a0ef189e7c2d33d382f | [
"BSD-2-Clause"
] | null | null | null | Silicon/BroxtonSoC/BroxtonSiPkg/Cpu/ResetVector/Vtf1/Main.asm | bcran/edk2-platforms | 7c914946bd014dc1f3cf0a0ef189e7c2d33d382f | [
"BSD-2-Clause"
] | null | null | null | Silicon/BroxtonSoC/BroxtonSiPkg/Cpu/ResetVector/Vtf1/Main.asm | bcran/edk2-platforms | 7c914946bd014dc1f3cf0a0ef189e7c2d33d382f | [
"BSD-2-Clause"
] | null | null | null | ;; @file
; Main routine of the pre-SEC code up through the jump into SEC.
;
; Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>
;
; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at
; http://opensource.org/licenses/bsd-license.php.
;
; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED
;
;;
BITS 32
Main32:
;
; Search for the SEC entry point
;
OneTimeCall Flat32SearchForSecEntryPoint
;
; ESI - SEC Core entry point
; EBP - Start of BFV
;
;
; Restore initial EAX value into the EAX register
;
mov eax, esp
;
; Jump to the 32-bit SEC entry point
;
jmp esi
ALIGN 16
out 0x80, ax
jmp short Main32
ALIGN 16
Gigabytes:
| 23.545455 | 86 | 0.649614 |
bb5d9cb12c08b0f05a592041f15b998e566c7ec5 | 24,724 | asm | Assembly | core/zxtable.asm | freemanix/zxemul | c3915b7c9c83df9a0d3c656877eccf8335aa89f2 | [
"MIT"
] | 4 | 2018-12-25T22:09:34.000Z | 2022-02-11T08:15:36.000Z | core/zxtable.asm | freemanix/zxemul | c3915b7c9c83df9a0d3c656877eccf8335aa89f2 | [
"MIT"
] | null | null | null | core/zxtable.asm | freemanix/zxemul | c3915b7c9c83df9a0d3c656877eccf8335aa89f2 | [
"MIT"
] | null | null | null |
; ZX Spectrum emulator
; Opcode tables
; (c) Freeman, August 2000, Prague
; -----------------------------------------------------------------------------
ALIGN
OpTable: DW nop_ ; 00 opcodes
DW ld_bc_nn
DW ld_ibc_a
DW inc_bc
DW inc_b
DW dec_b
DW ld_b_n
DW rlca
DW ex_af_af
DW add_hl_bc
DW ld_a_ibc
DW dec_bc
DW inc_c
DW dec_c
DW ld_c_n
DW rrca
DW djnz_e ; 10 opcodes
DW ld_de_nn
DW ld_ide_a
DW inc_de
DW inc_d
DW dec_d
DW ld_d_n
DW rla
DW jr_e
DW add_hl_de
DW ld_a_ide
DW dec_de
DW inc_e
DW dec_e
DW ld_e_n
DW rra
DW jr_nz_e ; 20 opcodes
DW ld_hl_nn
DW ld_inn_hl
DW inc_hl
DW inc_h
DW dec_h
DW ld_h_n
DW daa_
DW jr_z_e
DW add_hl_hl
DW ld_hl_inn
DW dec_hl
DW inc_l
DW dec_l
DW ld_l_n
DW cpl
DW jr_nc_e ; 30 opcodes
DW ld_sp_nn
DW ld_inn_a
DW inc_sp
DW inc_ihl
DW dec_ihl
DW ld_ihl_n
DW scf
DW jr_c_e
DW add_hl_sp
DW ld_a_inn
DW dec_sp
DW inc_a
DW dec_a
DW ld_a_n
DW ccf
DW nop_ ; 40 opcodes
DW ld_b_c
DW ld_b_d
DW ld_b_e
DW ld_b_h
DW ld_b_l
DW ld_b_ihl
DW ld_b_a
DW ld_c_b
DW nop_
DW ld_c_d
DW ld_c_e
DW ld_c_h
DW ld_c_l
DW ld_c_ihl
DW ld_c_a
DW ld_d_b ; 50 opcodes
DW ld_d_c
DW nop_
DW ld_d_e
DW ld_d_h
DW ld_d_l
DW ld_d_ihl
DW ld_d_a
DW ld_e_b
DW ld_e_c
DW ld_e_d
DW nop_
DW ld_e_h
DW ld_e_l
DW ld_e_ihl
DW ld_e_a
DW ld_h_b ; 60 opcodes
DW ld_h_c
DW ld_h_d
DW ld_h_e
DW nop_
DW ld_h_l
DW ld_h_ihl
DW ld_h_a
DW ld_l_b
DW ld_l_c
DW ld_l_d
DW ld_l_e
DW ld_l_h
DW nop_
DW ld_l_ihl
DW ld_l_a
DW ld_ihl_b ; 70 opcodes
DW ld_ihl_c
DW ld_ihl_d
DW ld_ihl_e
DW ld_ihl_h
DW ld_ihl_l
DW halt
DW ld_ihl_a
DW ld_a_b
DW ld_a_c
DW ld_a_d
DW ld_a_e
DW ld_a_h
DW ld_a_l
DW ld_a_ihl
DW nop_
DW add_a_b ; 80 opcodes
DW add_a_c
DW add_a_d
DW add_a_e
DW add_a_h
DW add_a_l
DW add_a_ihl
DW add_a_a
DW adc_a_b
DW adc_a_c
DW adc_a_d
DW adc_a_e
DW adc_a_h
DW adc_a_l
DW adc_a_ihl
DW adc_a_a
DW sub_b ; 90 opcodes
DW sub_c
DW sub_d
DW sub_e
DW sub_h
DW sub_l
DW sub_ihl
DW sub_a
DW sbc_a_b
DW sbc_a_c
DW sbc_a_d
DW sbc_a_e
DW sbc_a_h
DW sbc_a_l
DW sbc_a_ihl
DW sbc_a_a
DW and_b ; A0 opcodes
DW and_c
DW and_d
DW and_e
DW and_h
DW and_l
DW and_ihl
DW and_a
DW xor_b
DW xor_c
DW xor_d
DW xor_e
DW xor_h
DW xor_l
DW xor_ihl
DW xor_a
DW or_b ; B0 opcodes
DW or_c
DW or_d
DW or_e
DW or_h
DW or_l
DW or_ihl
DW or_a
DW cp_b
DW cp_c
DW cp_d
DW cp_e
DW cp_h
DW cp_l
DW cp_ihl
DW cp_a
DW ret_nz ; C0 opcodes
DW pop_bc
DW jp_nz_nn
DW jp_nn
DW call_nz_nn
DW push_bc
DW add_a_n
DW rst_00
DW ret_z
DW ret_
DW jp_z_nn
DW prefix_cb
DW call_z_nn
DW call_nn
DW adc_a_n
DW rst_08
DW ret_nc ; D0 opcodes
DW pop_de
DW jp_nc_nn
DW out_in_a
DW call_nc_nn
DW push_de
DW sub_n
DW rst_10
DW ret_c
DW exx
DW jp_c_nn
DW in_a_in
DW call_c_nn
DW prefix_dd
DW sbc_a_n
DW rst_18
DW ret_po ; E0 opcodes
DW pop_hl
DW jp_po_nn
DW ex_isp_hl
DW call_po_nn
DW push_hl
DW and_n
DW rst_20
DW ret_pe
DW jp_hl
DW jp_pe_nn
DW ex_de_hl
DW call_pe_nn
DW prefix_ed
DW xor_n
DW rst_28
DW ret_p ; F0 opcodes
DW pop_af
DW jp_p_nn
DW di_
DW call_p_nn
DW push_af
DW or_n
DW rst_30
DW ret_m
DW ld_sp_hl
DW jp_m_nn
DW ei_
DW call_m_nn
DW prefix_fd
DW cp_n
DW rst_38
; -----------------------------------------------------------------------------
ALIGN
CbTable: DW rlc_b ; 00 opcodes
DW rlc_c
DW rlc_d
DW rlc_e
DW rlc_h
DW rlc_l
DW rlc_ihl
DW rlc_a
DW rrc_b
DW rrc_c
DW rrc_d
DW rrc_e
DW rrc_h
DW rrc_l
DW rrc_ihl
DW rrc_a
DW rl_b ; 10 opcodes
DW rl_c
DW rl_d
DW rl_e
DW rl_h
DW rl_l
DW rl_ihl
DW rl_a
DW rr_b
DW rr_c
DW rr_d
DW rr_e
DW rr_h
DW rr_l
DW rr_ihl
DW rr_a
DW sla_b ; 20 opcodes
DW sla_c
DW sla_d
DW sla_e
DW sla_h
DW sla_l
DW sla_ihl
DW sla_a
DW sra_b
DW sra_c
DW sra_d
DW sra_e
DW sra_h
DW sra_l
DW sra_ihl
DW sra_a
DW sll_b ; 30 opcodes
DW sll_c
DW sll_d
DW sll_e
DW sll_h
DW sll_l
DW sll_ihl
DW sll_a
DW srl_b
DW srl_c
DW srl_d
DW srl_e
DW srl_h
DW srl_l
DW srl_ihl
DW srl_a
DW bit_0_b ; 40 opcodes
DW bit_0_c
DW bit_0_d
DW bit_0_e
DW bit_0_h
DW bit_0_l
DW bit_0_ihl
DW bit_0_a
DW bit_1_b
DW bit_1_c
DW bit_1_d
DW bit_1_e
DW bit_1_h
DW bit_1_l
DW bit_1_ihl
DW bit_1_a
DW bit_2_b ; 50 opcodes
DW bit_2_c
DW bit_2_d
DW bit_2_e
DW bit_2_h
DW bit_2_l
DW bit_2_ihl
DW bit_2_a
DW bit_3_b
DW bit_3_c
DW bit_3_d
DW bit_3_e
DW bit_3_h
DW bit_3_l
DW bit_3_ihl
DW bit_3_a
DW bit_4_b ; 60 opcodes
DW bit_4_c
DW bit_4_d
DW bit_4_e
DW bit_4_h
DW bit_4_l
DW bit_4_ihl
DW bit_4_a
DW bit_5_b
DW bit_5_c
DW bit_5_d
DW bit_5_e
DW bit_5_h
DW bit_5_l
DW bit_5_ihl
DW bit_5_a
DW bit_6_b ; 70 opcodes
DW bit_6_c
DW bit_6_d
DW bit_6_e
DW bit_6_h
DW bit_6_l
DW bit_6_ihl
DW bit_6_a
DW bit_7_b
DW bit_7_c
DW bit_7_d
DW bit_7_e
DW bit_7_h
DW bit_7_l
DW bit_7_ihl
DW bit_7_a
DW res_0_b ; 80 opcodes
DW res_0_c
DW res_0_d
DW res_0_e
DW res_0_h
DW res_0_l
DW res_0_ihl
DW res_0_a
DW res_1_b
DW res_1_c
DW res_1_d
DW res_1_e
DW res_1_h
DW res_1_l
DW res_1_ihl
DW res_1_a
DW res_2_b ; 90 opcodes
DW res_2_c
DW res_2_d
DW res_2_e
DW res_2_h
DW res_2_l
DW res_2_ihl
DW res_2_a
DW res_3_b
DW res_3_c
DW res_3_d
DW res_3_e
DW res_3_h
DW res_3_l
DW res_3_ihl
DW res_3_a
DW res_4_b ; A0 opcodes
DW res_4_c
DW res_4_d
DW res_4_e
DW res_4_h
DW res_4_l
DW res_4_ihl
DW res_4_a
DW res_5_b
DW res_5_c
DW res_5_d
DW res_5_e
DW res_5_h
DW res_5_l
DW res_5_ihl
DW res_5_a
DW res_6_b ; B0 opcodes
DW res_6_c
DW res_6_d
DW res_6_e
DW res_6_h
DW res_6_l
DW res_6_ihl
DW res_6_a
DW res_7_b
DW res_7_c
DW res_7_d
DW res_7_e
DW res_7_h
DW res_7_l
DW res_7_ihl
DW res_7_a
DW set_0_b ; C0 opcodes
DW set_0_c
DW set_0_d
DW set_0_e
DW set_0_h
DW set_0_l
DW set_0_ihl
DW set_0_a
DW set_1_b
DW set_1_c
DW set_1_d
DW set_1_e
DW set_1_h
DW set_1_l
DW set_1_ihl
DW set_1_a
DW set_2_b ; D0 opcodes
DW set_2_c
DW set_2_d
DW set_2_e
DW set_2_h
DW set_2_l
DW set_2_ihl
DW set_2_a
DW set_3_b
DW set_3_c
DW set_3_d
DW set_3_e
DW set_3_h
DW set_3_l
DW set_3_ihl
DW set_3_a
DW set_4_b ; E0 opcodes
DW set_4_c
DW set_4_d
DW set_4_e
DW set_4_h
DW set_4_l
DW set_4_ihl
DW set_4_a
DW set_5_b
DW set_5_c
DW set_5_d
DW set_5_e
DW set_5_h
DW set_5_l
DW set_5_ihl
DW set_5_a
DW set_6_b ; F0 opcodes
DW set_6_c
DW set_6_d
DW set_6_e
DW set_6_h
DW set_6_l
DW set_6_ihl
DW set_6_a
DW set_7_b
DW set_7_c
DW set_7_d
DW set_7_e
DW set_7_h
DW set_7_l
DW set_7_ihl
DW set_7_a
; -----------------------------------------------------------------------------
ALIGN
EdTable: DW bad_ed ; 00 opcodes
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed ; 10 opcodes
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed ; 20 opcodes
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed ; 30 opcodes
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW in_b_ic ; 40 opcodes
DW out_ic_b
DW sbc_hl_bc
DW ld_inn_bc
DW neg_
DW retn_
DW im_0
DW ld_i_a
DW in_c_ic
DW out_ic_c
DW adc_hl_bc
DW ld_bc_inn
DW neg_
DW reti_
DW im_0
DW ld_r_a
DW in_d_ic ; 50 opcodes
DW out_ic_d
DW sbc_hl_de
DW ld_inn_de
DW neg_
DW retn_
DW im_1
DW ld_a_i
DW in_e_ic
DW out_ic_e
DW adc_hl_de
DW ld_de_inn
DW neg_
DW retn_
DW im_2
DW ld_a_r
DW in_h_ic ; 60 opcodes
DW out_ic_h
DW sbc_hl_hl
DW ld_inn_hl
DW neg_
DW retn_
DW im_0
DW rrd
DW in_l_ic
DW out_ic_l
DW adc_hl_hl
DW ld_hl_inn
DW neg_
DW retn_
DW im_0
DW rld
DW in_ic ; 70 opcodes
DW out_ic_0
DW sbc_hl_sp
DW ld_inn_sp
DW neg_
DW retn_
DW im_1
DW bad_ed
DW in_a_ic
DW out_ic_a
DW adc_hl_sp
DW ld_sp_inn
DW neg_
DW retn_
DW im_2
DW bad_ed
DW bad_ed ; 80 opcodes
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed ; 90 opcodes
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW ldi ; A0 opcodes
DW cpi
DW ini
DW outi
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW ldd
DW cpd
DW ind
DW outd
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW ldir ; B0 opcodes
DW cpir
DW inir
DW otir
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW lddr
DW cpdr
DW indr
DW otdr
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed ; C0 opcodes
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed ; D0 opcodes
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed ; E0 opcodes
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed ; F0 opcodes
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
DW bad_ed
; -----------------------------------------------------------------------------
ALIGN
DdTable: DW nop_ ; 00 opcodes
DW ld_bc_nn
DW ld_ibc_a
DW inc_bc
DW inc_b
DW dec_b
DW ld_b_n
DW rlca
DW ex_af_af
DW add_ix_bc
DW ld_a_ibc
DW dec_bc
DW inc_c
DW dec_c
DW ld_c_n
DW rrca
DW djnz_e ; 10 opcodes
DW ld_de_nn
DW ld_ide_a
DW inc_de
DW inc_d
DW dec_d
DW ld_d_n
DW rla
DW jr_e
DW add_ix_de
DW ld_a_ide
DW dec_de
DW inc_e
DW dec_e
DW ld_e_n
DW rra
DW jr_nz_e ; 20 opcodes
DW ld_ix_nn
DW ld_inn_ix
DW inc_ix
DW inc_ixh
DW dec_ixh
DW ld_ixh_n
DW daa_
DW jr_z_e
DW add_ix_ix
DW ld_ix_inn
DW dec_ix
DW inc_ixl
DW dec_ixl
DW ld_ixl_n
DW cpl
DW jr_nc_e ; 30 opcodes
DW ld_sp_nn
DW ld_inn_a
DW inc_sp
DW inc_iix
DW dec_iix
DW ld_iix_n
DW scf
DW jr_c_e
DW add_ix_sp
DW ld_a_inn
DW dec_sp
DW inc_a
DW dec_a
DW ld_a_n
DW ccf
DW nop_ ; 40 opcodes
DW ld_b_c
DW ld_b_d
DW ld_b_e
DW ld_b_ixh
DW ld_b_ixl
DW ld_b_iix
DW ld_b_a
DW ld_c_b
DW nop_
DW ld_c_d
DW ld_c_e
DW ld_c_ixh
DW ld_c_ixl
DW ld_c_iix
DW ld_c_a
DW ld_d_b ; 50 opcodes
DW ld_d_c
DW nop_
DW ld_d_e
DW ld_d_ixh
DW ld_d_ixl
DW ld_d_iix
DW ld_d_a
DW ld_e_b
DW ld_e_c
DW ld_e_d
DW nop_
DW ld_e_ixh
DW ld_e_ixl
DW ld_e_iix
DW ld_e_a
DW ld_ixh_b ; 60 opcodes
DW ld_ixh_c
DW ld_ixh_d
DW ld_ixh_e
DW nop_
DW ld_ixh_ixl
DW ld_h_iix
DW ld_ixh_a
DW ld_ixl_b
DW ld_ixl_c
DW ld_ixl_d
DW ld_ixl_e
DW ld_ixl_ixh
DW nop_
DW ld_l_iix
DW ld_ixl_a
DW ld_iix_b ; 70 opcodes
DW ld_iix_c
DW ld_iix_d
DW ld_iix_e
DW ld_iix_h
DW ld_iix_l
DW halt
DW ld_iix_a
DW ld_a_b
DW ld_a_c
DW ld_a_d
DW ld_a_e
DW ld_a_ixh
DW ld_a_ixl
DW ld_a_iix
DW nop_
DW add_a_b ; 80 opcodes
DW add_a_c
DW add_a_d
DW add_a_e
DW add_a_ixh
DW add_a_ixl
DW add_a_iix
DW add_a_a
DW adc_a_b
DW adc_a_c
DW adc_a_d
DW adc_a_e
DW adc_a_ixh
DW adc_a_ixl
DW adc_a_iix
DW adc_a_a
DW sub_b ; 90 opcodes
DW sub_c
DW sub_d
DW sub_e
DW sub_ixh
DW sub_ixl
DW sub_iix
DW sub_a
DW sbc_a_b
DW sbc_a_c
DW sbc_a_d
DW sbc_a_e
DW sbc_a_ixh
DW sbc_a_ixl
DW sbc_a_iix
DW sbc_a_a
DW and_b ; A0 opcodes
DW and_c
DW and_d
DW and_e
DW and_ixh
DW and_ixl
DW and_iix
DW and_a
DW xor_b
DW xor_c
DW xor_d
DW xor_e
DW xor_ixh
DW xor_ixl
DW xor_iix
DW xor_a
DW or_b ; B0 opcodes
DW or_c
DW or_d
DW or_e
DW or_ixh
DW or_ixl
DW or_iix
DW or_a
DW cp_b
DW cp_c
DW cp_d
DW cp_e
DW cp_ixh
DW cp_ixl
DW cp_iix
DW cp_a
DW ret_nz ; C0 opcodes
DW pop_bc
DW jp_nz_nn
DW jp_nn
DW call_nz_nn
DW push_bc
DW add_a_n
DW rst_00
DW ret_z
DW ret_
DW jp_z_nn
DW prefix_dd_cb
DW call_z_nn
DW call_nn
DW adc_a_n
DW rst_08
DW ret_nc ; D0 opcodes
DW pop_de
DW jp_nc_nn
DW out_in_a
DW call_nc_nn
DW push_de
DW sub_n
DW rst_10
DW ret_c
DW exx
DW jp_c_nn
DW in_a_in
DW call_c_nn
DW prefix_dd
DW sbc_a_n
DW rst_18
DW ret_po ; E0 opcodes
DW pop_ix
DW jp_po_nn
DW ex_isp_ix
DW call_po_nn
DW push_ix
DW and_n
DW rst_20
DW ret_pe
DW jp_ix
DW jp_pe_nn
DW ex_de_hl
DW call_pe_nn
DW prefix_ed
DW xor_n
DW rst_28
DW ret_p ; F0 opcodes
DW pop_af
DW jp_p_nn
DW di_
DW call_p_nn
DW push_af
DW or_n
DW rst_30
DW ret_m
DW ld_sp_ix
DW jp_m_nn
DW ei_
DW call_m_nn
DW prefix_fd
DW cp_n
DW rst_38
; -----------------------------------------------------------------------------
ALIGN
FdTable: DW nop_ ; 00 opcodes
DW ld_bc_nn
DW ld_ibc_a
DW inc_bc
DW inc_b
DW dec_b
DW ld_b_n
DW rlca
DW ex_af_af
DW add_iy_bc
DW ld_a_ibc
DW dec_bc
DW inc_c
DW dec_c
DW ld_c_n
DW rrca
DW djnz_e ; 10 opcodes
DW ld_de_nn
DW ld_ide_a
DW inc_de
DW inc_d
DW dec_d
DW ld_d_n
DW rla
DW jr_e
DW add_iy_de
DW ld_a_ide
DW dec_de
DW inc_e
DW dec_e
DW ld_e_n
DW rra
DW jr_nz_e ; 20 opcodes
DW ld_iy_nn
DW ld_inn_iy
DW inc_iy
DW inc_iyh
DW dec_iyh
DW ld_iyh_n
DW daa_
DW jr_z_e
DW add_iy_iy
DW ld_iy_inn
DW dec_iy
DW inc_iyl
DW dec_iyl
DW ld_iyl_n
DW cpl
DW jr_nc_e ; 30 opcodes
DW ld_sp_nn
DW ld_inn_a
DW inc_sp
DW inc_iiy
DW dec_iiy
DW ld_iiy_n
DW scf
DW jr_c_e
DW add_iy_sp
DW ld_a_inn
DW dec_sp
DW inc_a
DW dec_a
DW ld_a_n
DW ccf
DW nop_ ; 40 opcodes
DW ld_b_c
DW ld_b_d
DW ld_b_e
DW ld_b_iyh
DW ld_b_iyl
DW ld_b_iiy
DW ld_b_a
DW ld_c_b
DW nop_
DW ld_c_d
DW ld_c_e
DW ld_c_iyh
DW ld_c_iyl
DW ld_c_iiy
DW ld_c_a
DW ld_d_b ; 50 opcodes
DW ld_d_c
DW nop_
DW ld_d_e
DW ld_d_iyh
DW ld_d_iyl
DW ld_d_iiy
DW ld_d_a
DW ld_e_b
DW ld_e_c
DW ld_e_d
DW nop_
DW ld_e_iyh
DW ld_e_iyl
DW ld_e_iiy
DW ld_e_a
DW ld_iyh_b ; 60 opcodes
DW ld_iyh_c
DW ld_iyh_d
DW ld_iyh_e
DW nop_
DW ld_iyh_iyl
DW ld_h_iiy
DW ld_iyh_a
DW ld_iyl_b
DW ld_iyl_c
DW ld_iyl_d
DW ld_iyl_e
DW ld_iyl_iyh
DW nop_
DW ld_l_iiy
DW ld_iyl_a
DW ld_iiy_b ; 70 opcodes
DW ld_iiy_c
DW ld_iiy_d
DW ld_iiy_e
DW ld_iiy_h
DW ld_iiy_l
DW halt
DW ld_iiy_a
DW ld_a_b
DW ld_a_c
DW ld_a_d
DW ld_a_e
DW ld_a_iyh
DW ld_a_iyl
DW ld_a_iiy
DW nop_
DW add_a_b ; 80 opcodes
DW add_a_c
DW add_a_d
DW add_a_e
DW add_a_iyh
DW add_a_iyl
DW add_a_iiy
DW add_a_a
DW adc_a_b
DW adc_a_c
DW adc_a_d
DW adc_a_e
DW adc_a_iyh
DW adc_a_iyl
DW adc_a_iiy
DW adc_a_a
DW sub_b ; 90 opcodes
DW sub_c
DW sub_d
DW sub_e
DW sub_iyh
DW sub_iyl
DW sub_iiy
DW sub_a
DW sbc_a_b
DW sbc_a_c
DW sbc_a_d
DW sbc_a_e
DW sbc_a_iyh
DW sbc_a_iyl
DW sbc_a_iiy
DW sbc_a_a
DW and_b ; A0 opcodes
DW and_c
DW and_d
DW and_e
DW and_iyh
DW and_iyl
DW and_iiy
DW and_a
DW xor_b
DW xor_c
DW xor_d
DW xor_e
DW xor_iyh
DW xor_iyl
DW xor_iiy
DW xor_a
DW or_b ; B0 opcodes
DW or_c
DW or_d
DW or_e
DW or_iyh
DW or_iyl
DW or_iiy
DW or_a
DW cp_b
DW cp_c
DW cp_d
DW cp_e
DW cp_iyh
DW cp_iyl
DW cp_iiy
DW cp_a
DW ret_nz ; C0 opcodes
DW pop_bc
DW jp_nz_nn
DW jp_nn
DW call_nz_nn
DW push_bc
DW add_a_n
DW rst_00
DW ret_z
DW ret_
DW jp_z_nn
DW prefix_fd_cb
DW call_z_nn
DW call_nn
DW adc_a_n
DW rst_08
DW ret_nc ; D0 opcodes
DW pop_de
DW jp_nc_nn
DW out_in_a
DW call_nc_nn
DW push_de
DW sub_n
DW rst_10
DW ret_c
DW exx
DW jp_c_nn
DW in_a_in
DW call_c_nn
DW prefix_dd
DW sbc_a_n
DW rst_18
DW ret_po ; E0 opcodes
DW pop_iy
DW jp_po_nn
DW ex_isp_iy
DW call_po_nn
DW push_iy
DW and_n
DW rst_20
DW ret_pe
DW jp_iy
DW jp_pe_nn
DW ex_de_hl
DW call_pe_nn
DW prefix_ed
DW xor_n
DW rst_28
DW ret_p ; F0 opcodes
DW pop_af
DW jp_p_nn
DW di_
DW call_p_nn
DW push_af
DW or_n
DW rst_30
DW ret_m
DW ld_sp_iy
DW jp_m_nn
DW ei_
DW call_m_nn
DW prefix_fd
DW cp_n
DW rst_38
; -----------------------------------------------------------------------------
ALIGN
XxCbTable: DW bad_xxcb ; 00 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW rlc_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW rrc_ixy
DW bad_xxcb
DW bad_xxcb ; 10 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW rl_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW rr_ixy
DW bad_xxcb
DW bad_xxcb ; 20 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW sla_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW sra_ixy
DW bad_xxcb
DW bad_xxcb ; 30 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW sll_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW srl_ixy
DW bad_xxcb
DW bad_xxcb ; 40 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bit_0_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bit_1_ixy
DW bad_xxcb
DW bad_xxcb ; 50 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bit_2_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bit_3_ixy
DW bad_xxcb
DW bad_xxcb ; 60 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bit_4_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bit_5_ixy
DW bad_xxcb
DW bad_xxcb ; 70 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bit_6_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bit_7_ixy
DW bad_xxcb
DW bad_xxcb ; 80 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW res_0_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW res_1_ixy
DW bad_xxcb
DW bad_xxcb ; 90 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW res_2_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW res_3_ixy
DW bad_xxcb
DW bad_xxcb ; A0 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW res_4_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW res_5_ixy
DW bad_xxcb
DW bad_xxcb ; B0 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW res_6_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW res_7_ixy
DW bad_xxcb
DW bad_xxcb ; C0 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW set_0_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW set_1_ixy
DW bad_xxcb
DW bad_xxcb ; D0 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW set_2_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW set_3_ixy
DW bad_xxcb
DW bad_xxcb ; E0 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW set_4_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW set_5_ixy
DW bad_xxcb
DW bad_xxcb ; F0 opcodes
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW set_6_ixy
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW bad_xxcb
DW set_7_ixy
DW bad_xxcb
; -----------------------------------------------------------------------------
| 14.822542 | 79 | 0.578588 |
7ba4019cb1ac38fececbc003789b9a95f8599441 | 559 | asm | Assembly | oeis/158/A158769.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/158/A158769.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/158/A158769.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A158769: a(n) = 78*n^2 + 1.
; 1,79,313,703,1249,1951,2809,3823,4993,6319,7801,9439,11233,13183,15289,17551,19969,22543,25273,28159,31201,34399,37753,41263,44929,48751,52729,56863,61153,65599,70201,74959,79873,84943,90169,95551,101089,106783,112633,118639,124801,131119,137593,144223,151009,157951,165049,172303,179713,187279,195001,202879,210913,219103,227449,235951,244609,253423,262393,271519,280801,290239,299833,309583,319489,329551,339769,350143,360673,371359,382201,393199,404353,415663,427129,438751,450529,462463,474553
pow $0,2
mul $0,78
add $0,1
| 79.857143 | 499 | 0.80322 |
29a714871999d14ae6dbf083a8f6e2eab5636a81 | 7,103 | asm | Assembly | kernel/hal/remap.asm | phaubertin/jinue | 98ecc33c6c60d6323eb5f965dd2247b6fa6daf5c | [
"BSD-3-Clause"
] | 2 | 2021-01-04T20:00:35.000Z | 2022-01-09T23:35:53.000Z | kernel/hal/remap.asm | phaubertin/jinue | 98ecc33c6c60d6323eb5f965dd2247b6fa6daf5c | [
"BSD-3-Clause"
] | null | null | null | kernel/hal/remap.asm | phaubertin/jinue | 98ecc33c6c60d6323eb5f965dd2247b6fa6daf5c | [
"BSD-3-Clause"
] | null | null | null | ; Copyright (C) 2021 Philippe Aubertin.
; 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 author nor the names of other contributors
; may be used to endorse or promote products derived from this software
; without specific prior written permission.
;
; 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.
#include <hal/asm/memory.h>
#include <hal/asm/vm.h>
bits 32
; ------------------------------------------------------------------------------
; FUNCTION: move_and_remap_kernel
; C PROTOTYPE:
; void move_and_remap_kernel(
; addr_t end_addr,
; addr_t pte,
; uint32_t cr3_value)
; DESCRIPTION:
; Copy the kernel image and boot stack/heap from its original location at
; 0x100000 (1MB) to 0x1000000 (16MB), then map the copy at KLIMIT where the
; original is intially mapped. In more detail:
;
; 1. Copy the kernel image and a few allocated pages that immediately
; follow the kernel image and contain the boot stack and heap from
; 0x100000 (1MB) to 0x1000000 (16MB). (The initial page tables, which
; are also allocated following the kernel image, are *not* part of the
; contiguous range that is copied.
; 2. Modify the initial page tables so the virtual memory range at KLIMIT
; points to the copy, not the original.
; 3. Reload CR3 to flush the TLB.
;
; +=======================================+
; | initial page directory |
; +---------------------------------------+
; | initial page tables |
; | (PAE disabled) | This range is copied.
; +---------------------------------------+ <--+-
; | kernel stack (boot) | |
; +-----v---------------------------v-----+ <<< Stack pointer |
; | | |
; | . . . | |
; | | |
; +-----^---------------------------^-----+ |
; | kernel heap allocations (boot) | |
; | kernel physical memory map | |
; +---------------------------------------+ |
; | kernel command line | |
; | BIOS physical memory map | Start of page allocations |
; +=======================================+ End of kernel image |
; | | |
; | process manager (ELF) | |
; | | |
; +---------------------------------------+ |
; | | |
; | microkernel (ELF) | |
; | | |
; +---------------------------------------+ |
; | 32-bit setup code | |
; +---------------------------------------+ 0x100000 mapped at KLIMIT <--+-
;
; We have to be careful while doing this because it has the side effect of
; snapshotting the stack and then using the snapshot as the current stack. We
; don't want to modify the stack between the moment the snapshot is taken and
; when we start using the copy.
; ------------------------------------------------------------------------------
global move_and_remap_kernel:function (move_and_remap_kernel.end - move_and_remap_kernel)
move_and_remap_kernel:
; Be careful with the calling convention: we must preserve ebx, esi, edi,
; ebp and esp
push esi
push edi
; esp+20: third argument: cr3_value
; esp+16: second argument: pte
; esp+12: first argument: end_addr
; esp+8: esi
; esp+4: edi
; --------------------------------------------------------------------------
; Step 1: copy
; --------------------------------------------------------------------------
mov esi, MEMORY_ADDR_1MB ; start address
mov edi, MEMORY_ADDR_16MB ; destination address
mov ecx, [esp+12] ; first argument: end_addr
sub ecx, MEMORY_ADDR_1MB ; compute size to copy
mov edx, ecx ; remember copied size for later (edx)
shr ecx, 2 ; divide by 4 for number of DWORDs
rep movsd ; copy
; --------------------------------------------------------------------------
; Step 2: update page tables
; --------------------------------------------------------------------------
mov edi, [esp+16] ; second argument: address of first PTE
mov ecx, edx ; copied size
shr ecx, 12 ; divide by 4096 for number of pages and PTEs
; value for first page table entry (PTE)
mov eax, MEMORY_ADDR_16MB | VM_FLAG_READ_WRITE | VM_FLAG_PRESENT
.loop:
; store eax in PTE pointed to by edi, then add 4 to edi to point to the next
; entry
stosd
; update physical address
add eax, PAGE_SIZE
; decrement ecx, we are done when it reaches 0, otherwise loop
loop .loop
; --------------------------------------------------------------------------
; Step 3: reload CR3
; --------------------------------------------------------------------------
mov eax, [esp+20] ; third argument: cr3_value
mov cr3, eax ; set CR3 to flush TLB
pop edi
pop esi
ret
.end:
| 48.319728 | 93 | 0.465156 |
a6eb74f63437e3764cf122fd9bbf9d3e8be86482 | 2,351 | asm | Assembly | Scrollable HDMA Gradients/ScrollMacros.asm | MarioFanGamer/HDMA-Libraries | 75e5e69c9b0a50a1c69a1c3ebaf734793d2e59ce | [
"CC0-1.0"
] | null | null | null | Scrollable HDMA Gradients/ScrollMacros.asm | MarioFanGamer/HDMA-Libraries | 75e5e69c9b0a50a1c69a1c3ebaf734793d2e59ce | [
"CC0-1.0"
] | 3 | 2022-02-19T13:24:01.000Z | 2022-02-19T15:56:52.000Z | Scrollable HDMA Gradients/ScrollMacros.asm | MarioFanGamer/HDMA-Libraries | 75e5e69c9b0a50a1c69a1c3ebaf734793d2e59ce | [
"CC0-1.0"
] | null | null | null | ; Default addresses for scrollable HDMA gradients.
!ScrollDefBank = $7F ; The bank of the HDMA data tables
!ScrollDefRedGreen = $1343 ; The address for the red-green table
!ScrollDefBlue = $1943 ; The address for the blue table
; Initialises the gradient by decompressing it and sets up HDMA table.
; gradient_ptr is the address of the compressed HDMA table.
macro ScrollHdmaInit(gradient_ptr)
PHP ; Preserve register sizes
REP #$10 ; XY = 16-bit
LDX.w #<gradient_ptr> ; Get address of gradient
STX $00 ;
LDA.b #<gradient_ptr>>>16 ; Get bank of gradient
STA $02 ;
;
LDA.b #!ScrollDefBank ; Load bank of data tables
LDX.w #!ScrollDefRedGreen ; Load address of red-green table
LDY.w #!ScrollDefBlue ; Load address of blue table
;
JSL ScrollHDMA_init ; Decompress and set up HDMA!
PLP ; Restore register sizes
endmacro
; Calls the main code of the HDMA table
macro ScrollHdmaMain(layer, offset, factor)
PHP ; Preserve register sizes
REP #$20 ; A = 16-bit
;
LDA #!ScrollDefRedGreen ; Get address of red-green table
STA $00 ;
LDA #!ScrollDefBlue ; Get address of blue table
STA $02 ;
;
if <layer> ;
LDA bgof2addr(<layer>, 0) ; Get layer offset
CLC : ADC.w #<offset> ; Add it with offset
if <factor> > 0 ;
LSR #<factor> ; Shift by N bytes
elseif < 0 ;
ASL #-<factor> ; Shift by N bytes
endif ;
else ;
LDA.w #<offset> ; Get direct offset.
endif ;
JSL ScrollHDMA_main ; Change pointers
PLP ; Restore register sizes
endmacro
; Mostly the same as above with the difference that the speed
; can be divided by any value and not just powers of two.
macro ScrollHdmaDiv(layer, offset, divisor)
PHP ; Preserve register sizes
REP #$20 ; A = 16-bit
;
LDA bgof2addr(<layer>, 0) ; Get layer offset
CLC : ADC.w #<offset> ; Add it with offset
STA $4204 ; Dividend
LDX.b #<divisor> ; Now divide it by a value!
STX $4206 ;
;
LDA.w #!ScrollDefRedGreen ; Get address of red-green table (+ 3 cycles)
STA $00 ; (+ 4 cycles)
LDA.w #!ScrollDefBlue ; Get address of blue table (+ 3 cycles)
STA $02 ; (+ 4 cycles)
;
LDA $4214 ; Get new offset! (+ 3 cycles)
JSL ScrollHDMA_main ; Change pointers
PLP ; Restore register sizes
endmacro
| 32.652778 | 72 | 0.650787 |
c929f600ad313b8ffcee0e0615224bd7325c782e | 886 | asm | Assembly | programs/oeis/097/A097784.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/097/A097784.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/097/A097784.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A097784: Partial sums of Chebyshev sequence S(n,10) = U(n,5) = A004189(n+1).
; 1,11,110,1090,10791,106821,1057420,10467380,103616381,1025696431,10153347930,100507782870,994924480771,9848737024841,97492445767640,965075720651560,9553264760747961,94567571886828051,936122454107532550,9266656969188497450,91730447237777441951,908037815408585922061,8988647706848081778660,88978439253072231864540,880795744823874236866741,8718979008985670136802871,86308994345032827131161970,854370964441342601174816830,8457400650068393184617006331,83719635536242589244995246481,828738954712357499265335458480,8203669911587332403408359338320,81207960161160966534818257924721,803875931700022332944774219908891,7957551356839062362912923941164190,78771637636690601296184465191733010,779758825010066950598931727976165911
add $0,1
seq $0,31138 ; Numbers k such that 1^5 + 2^5 + ... + k^5 is a square.
div $0,12
| 126.571429 | 716 | 0.882619 |
4bd730ff723b765fbd2181aa44d95ad61518b494 | 377 | asm | Assembly | oeis/075/A075668.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/075/A075668.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/075/A075668.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A075668: Sum of next n 7th powers.
; Submitted by Jon Maiga
; 1,2315,374445,17703664,394340375,5265954441,48574262275,338837482880,1900477947429,8950536157375,36536761179281,132397570996560,433806511149115,1303971065324669,3637715990646375,9507513902672896
add $0,1
mov $2,7
mov $5,$0
bin $5,2
lpb $0
mov $4,$0
sub $0,1
add $4,$5
pow $4,$2
add $3,$4
lpe
mov $0,$3
| 22.176471 | 196 | 0.745358 |
c2844c7f8e43e91dc91cce9a0fe0286c606e210b | 428 | asm | Assembly | programs/oeis/253/A253175.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/253/A253175.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/253/A253175.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A253175: Indices of hexagonal numbers (A000384) which are also centered hexagonal numbers (A003215).
; 1,7,67,661,6541,64747,640927,6344521,62804281,621698287,6154178587,60920087581,603046697221,5969546884627,59092422149047,584954674605841,5790454323909361
mov $2,2
mov $1,2
lpb $0,1
sub $1,1
add $1,$2
add $2,$1
add $1,$2
add $2,$1
add $2,$1
sub $2,2
add $2,$1
sub $2,1
sub $0,1
sub $2,$1
lpe
sub $1,1
| 21.4 | 155 | 0.693925 |
9cfa406e93d6f03725edf3f5cd4233d4c7fc5032 | 5,183 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_21829_461.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_21829_461.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0xca.log_21829_461.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x9ff0, %rsi
lea addresses_normal_ht+0x134d, %rdi
and $61425, %r14
mov $45, %rcx
rep movsw
nop
nop
nop
xor $10265, %r9
lea addresses_A_ht+0x6d6d, %rsi
lea addresses_A_ht+0x177c9, %rdi
nop
nop
nop
nop
nop
add $20035, %r13
mov $12, %rcx
rep movsw
nop
and $65116, %r9
lea addresses_UC_ht+0x1956d, %r13
and $3473, %rax
mov $0x6162636465666768, %r9
movq %r9, %xmm1
vmovups %ymm1, (%r13)
nop
nop
nop
nop
nop
and %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %rax
push %rbp
push %rcx
push %rdx
// Store
lea addresses_UC+0x147cd, %rbp
nop
nop
nop
nop
sub $43928, %r10
movl $0x51525354, (%rbp)
nop
nop
add %r10, %r10
// Store
lea addresses_WC+0x17b1d, %rcx
clflush (%rcx)
nop
cmp $45650, %r13
movb $0x51, (%rcx)
inc %rcx
// Faulty Load
mov $0x4caad0000000016d, %rcx
nop
nop
nop
nop
nop
xor %rax, %rax
mov (%rcx), %bp
lea oracles, %rax
and $0xff, %rbp
shlq $12, %rbp
mov (%rax,%rbp,1), %rbp
pop %rdx
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_UC'}}
{'OP': 'STOR', 'dst': {'congruent': 4, 'AVXalign': True, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC'}}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': True, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 0, 'same': True, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_UC_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 43.923729 | 2,999 | 0.660235 |
a288ff517131d390bc6d2b65e4f739b498532226 | 480 | asm | Assembly | programs/oeis/159/A159715.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/159/A159715.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/159/A159715.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A159715: Number of permutations of 2 indistinguishable copies of 1..n arranged in a circle with exactly 1 local maximum.
; 4,18,72,270,972,3402,11664,39366,131220,433026,1417176,4605822,14880348,47829690,153055008,487862838,1549681956,4907326194,15496819560,48814981614,153418513644,481176247338,1506290861232,4707158941350,14686335897012,45753584909922,142344486386424,442284654129246,1372607547297660,4255083396622746
mov $1,$0
add $1,2
mov $2,3
pow $2,$0
mul $1,$2
mul $1,2
| 48 | 298 | 0.822917 |
e875550dfff3a2643676a9d091227e03427b5941 | 1,774 | asm | Assembly | src/ppu/m3_scy_change2.asm | gb-archive/mealybug-tearoom-tests | 70e88fb90b59d19dfbb9c3ac36c64105202bb1f4 | [
"MIT"
] | 37 | 2018-04-26T17:45:01.000Z | 2022-03-19T16:11:08.000Z | src/ppu/m3_scy_change2.asm | gb-archive/mealybug-tearoom-tests | 70e88fb90b59d19dfbb9c3ac36c64105202bb1f4 | [
"MIT"
] | 1 | 2020-09-26T23:49:49.000Z | 2020-09-26T23:49:49.000Z | src/ppu/m3_scy_change2.asm | gb-archive/mealybug-tearoom-tests | 70e88fb90b59d19dfbb9c3ac36c64105202bb1f4 | [
"MIT"
] | 6 | 2019-04-18T20:13:56.000Z | 2022-02-15T04:22:09.000Z | ; Copyright (C) 2019 Matt Currie <me@mattcurrie.com>
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
; Toggles the value of the SCY register during mode 3.
; Sprites are positioned to cause the write to occur on different T-cycles of
; the background tile fetch, showing when the change to the bit takes effect.
; Initiated by LCD STAT mode 2 interrupt in a field of NOPs.
init_lcdc_stat_int_test: MACRO
call init_bg_maps_alphabetical_9800
ld a, LCDCF_ON | LCDCF_WIN9C00 | LCDCF_WINOFF | LCDCF_BG8000 | LCDCF_BG9800 | LCDCF_OBJ8 | LCDCF_OBJON | LCDCF_BGON
ldh [rLCDC], a
ld d, 0
ld e, 4
ld hl, rSCY
ld [hl], d
ENDM
lcdc_stat_int: MACRO
nops 9
ld [hl], e
ld [hl], d
ENDM
INCLUDE "inc/lcdc_stat_int_base.asm"
| 36.958333 | 119 | 0.750282 |
8e979beadc94614d6fcf56423e62db2713f6ee3e | 1,965 | asm | Assembly | programs/oeis/048/A048479.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/048/A048479.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/048/A048479.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A048479: a(n) = T(7,n), array T given by A048472.
; 1,9,33,97,257,641,1537,3585,8193,18433,40961,90113,196609,425985,917505,1966081,4194305,8912897,18874369,39845889,83886081,176160769,369098753,771751937,1610612737,3355443201,6979321857,14495514625,30064771073,62277025793,128849018881,266287972353,549755813889,1133871366145,2336462209025,4810363371521,9895604649985,20340965113857,41781441855489,85761906966529,175921860444161,360639813910529,738871813865473,1512927999819777,3096224743817217,6333186975989761,12947848928690177,26458647810801665,54043195528445953,110338190870577153,225179981368524801,459367161991790593,936748722493063169,1909526242005090305,3891110078048108545,7926335344172072961,16140901064495857665,32858262881295138817,66869447267197124609,136044737543607943169,276701161105643274241,562625694248141324289,1143698132569992200193,2324289753287403503617,4722366482869645213697,9592306918328966840321,19479761741837286506497,39549819294033278664705,80280230208783968632833,162921643659002759872513,330565653800875164958721,670576040567489620344833,1360041547066457821544449,2757862025995872804798465,5591281915717659933016065,11333679558887148512870401,22969590572677954319417345,46543644055163223226187777,94296213929941075627081729,191010279499111409603575809,386856262276681335905976321,783383931110279705209602049,1586110675334393477214502913,3210906976896455088019603457,6499185206248246443220402177,13153112917407165420803194881,26615710844635675910331170817,53850391708914041958111903745,108938723457113464191122931713,220353326992797688932044111873,445658414142736898963684720641,901220348599756840126562435073,1822247737828079764651510857729,3684109556913291698099793690625,7447447276340847733793131331585,15053350877710224142773350563841,30423614405477505635920876929025,61481054111069125972590105460737,124229758822366481346676914126849,250994818845189421496347234664449
mov $1,2
pow $1,$0
mul $1,4
mul $1,$0
add $1,1
mov $0,$1
| 196.5 | 1,854 | 0.923664 |
098509233bb2c4a9b1f344c27b42b7672ecb9247 | 6,567 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_766.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_766.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_766.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x15753, %rsi
lea addresses_normal_ht+0x109d3, %rdi
nop
nop
nop
inc %rbp
mov $0, %rcx
rep movsq
nop
nop
nop
add $5825, %rbp
lea addresses_UC_ht+0x7ca7, %rdi
nop
nop
nop
xor %r13, %r13
mov (%rdi), %r12
nop
nop
nop
nop
nop
add %rdi, %rdi
lea addresses_WT_ht+0x5a53, %rbp
xor %rdx, %rdx
mov (%rbp), %edi
lfence
lea addresses_A_ht+0x15bf5, %rsi
lea addresses_normal_ht+0x45b, %rdi
nop
dec %rbp
mov $1, %rcx
rep movsb
nop
sub $37661, %rbp
lea addresses_WT_ht+0xfb53, %rsi
lea addresses_WT_ht+0x17f53, %rdi
nop
add %r9, %r9
mov $30, %rcx
rep movsq
nop
nop
nop
nop
nop
sub %rcx, %rcx
lea addresses_UC_ht+0x191a3, %rbp
nop
nop
nop
sub %rcx, %rcx
movups (%rbp), %xmm4
vpextrq $0, %xmm4, %rdx
nop
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_D_ht+0x1d153, %rsi
lea addresses_UC_ht+0x1a2f7, %rdi
nop
nop
add %r12, %r12
mov $28, %rcx
rep movsl
nop
sub $38648, %rcx
lea addresses_WT_ht+0x1e0f1, %r12
nop
nop
nop
nop
nop
add $21130, %r9
vmovups (%r12), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $0, %xmm2, %rsi
nop
nop
nop
nop
cmp $43190, %r12
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r14
push %rbp
push %rcx
push %rdx
// Load
lea addresses_RW+0xdf53, %rbp
nop
nop
cmp $28509, %r11
mov (%rbp), %rdx
cmp $7254, %r10
// Store
lea addresses_UC+0x9f53, %r14
nop
nop
nop
nop
xor %rcx, %rcx
mov $0x5152535455565758, %rdx
movq %rdx, %xmm6
vmovups %ymm6, (%r14)
nop
nop
nop
nop
nop
xor %r11, %r11
// Faulty Load
lea addresses_RW+0xdf53, %r11
nop
nop
nop
nop
nop
inc %rcx
movups (%r11), %xmm1
vpextrq $1, %xmm1, %r13
lea oracles, %rdx
and $0xff, %r13
shlq $12, %r13
mov (%rdx,%r13,1), %r13
pop %rdx
pop %rcx
pop %rbp
pop %r14
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_UC', 'size': 32, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_RW', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}}
{'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 8, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}}
{'src': {'same': False, 'congruent': 3, 'NT': False, 'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}}
{'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 35.690217 | 2,999 | 0.658596 |
4849c43af8aaa049ac966dc1c9c0c48b5853436a | 7,807 | asm | Assembly | examples/e06-scroll.asm | c64lib/copper64 | 060653db04d9eb824347f4ba73c588ba654f4efe | [
"MIT"
] | 5 | 2019-05-29T08:23:28.000Z | 2022-03-01T14:09:05.000Z | examples/e06-scroll.asm | c64lib/copper64 | 060653db04d9eb824347f4ba73c588ba654f4efe | [
"MIT"
] | 18 | 2018-04-06T14:13:05.000Z | 2019-12-27T09:54:17.000Z | examples/e06-scroll.asm | c64lib/copper64 | 060653db04d9eb824347f4ba73c588ba654f4efe | [
"MIT"
] | null | null | null | /*
* c64lib/copper64/examples/e06-scroll.asm
*
* Demo program for copper64 routine.
*
* Author: Maciej Malecki
* License: MIT
* (c): 2018
* GIT repo: https://github.com/c64lib/copper64
*/
// #define VISUAL_DEBUG
#import "chipset/lib/mos6510.asm"
#import "chipset/lib/vic2-global.asm"
#import "chipset/lib/cia.asm"
#import "text/lib/text-global.asm"
#import "text/lib/scroll1x1-global.asm"
#import "common/lib/mem-global.asm"
#import "common/lib/invoke-global.asm"
#import "../lib/copper64-global.asm"
// zero page addresses
.label DISPLAY_LIST_PTR_LO = $02
.label DISPLAY_LIST_PTR_HI = $03
.label LIST_PTR = $04
.label ANIMATION_IDX = $05
.label BAR_DEFS_IDX = $06
.label SCROLL_TEMP = $07 // and $08
.label SCROLL_OFFSET = $09
.label CYCLE_CNTR = $0A
// constants
.label SCREEN_PTR = 1024
.label LOGO_POSITION = 4
.label LOGO_LINE = LOGO_POSITION * 8 + $33 - 4
.label TECH_TECH_WIDTH = 5*8
.label CREDITS_POSITION = 16
.label CREDITS_COLOR_BARS_LINE = CREDITS_POSITION * 8 + $33 - 3
.label SCROLL_POSITION = 23
.label SCROLL_POSITION_OFFSET = SCROLL_POSITION * 40
.label SCROLL_COLOR_BARS_LINE = SCROLL_POSITION * 8 + $33 - 2
.label SCROLL_HSCROLL_LINE_START = SCROLL_COLOR_BARS_LINE - 5
.label SCROLL_HSCROLL_LINE_END = SCROLL_HSCROLL_LINE_START + 10 + 8
.var music = LoadSid("Noisy_Pillars_tune_1.sid")
*=$0801 "Basic Upstart"
BasicUpstart(start) // Basic start routine
// Main program
*=$080d "Program"
start:
sei
.namespace c64lib {
// reconfigure C64 memory
configureMemory(RAM_IO_RAM)
// disable NMI interrupt in a lame way
disableNMI()
// disable CIA as interrupt sources
disableCIAInterrupts()
}
cli
jsr unpack
jsr initSound
jsr initScreen
jsr initCopper
jsr initScroll
// initialize internal data structures
lda #00
sta ANIMATION_IDX
sta BAR_DEFS_IDX
sta CYCLE_CNTR
// initialize copper64 routine
jsr startCopper
block:
// go to infinite loop, rest will be done in interrupts
jmp block
initScreen:
.namespace c64lib {
// set up colors
lda #BLACK
sta BORDER_COL
sta BG_COL_0
// clear screen
pushParamW(SCREEN_PTR)
lda #($20 + 128)
jsr fillScreen
pushParamW(COLOR_RAM)
lda #BLACK
jsr fillScreen
// tech tech logo
pushParamW(logoLine1)
pushParamW(SCREEN_PTR + getTextOffset(0, LOGO_POSITION))
jsr outText
pushParamW(COLOR_RAM + getTextOffset(0, LOGO_POSITION))
ldx #(5*40)
lda #WHITE
jsr fillMem
// -- credits --
pushParamW(creditsText1)
pushParamW(SCREEN_PTR + getTextOffset(0, CREDITS_POSITION))
jsr outText
pushParamW(creditsText2)
pushParamW(SCREEN_PTR + getTextOffset(0, CREDITS_POSITION + 2))
jsr outText
// -- scroll --
// narrow screen to enable scrolling
lda CONTROL_2
and #neg(CONTROL_2_CSEL)
sta CONTROL_2
rts
}
initCopper: {
// set up address of display list
lda #<copperList
sta DISPLAY_LIST_PTR_LO
lda #>copperList
sta DISPLAY_LIST_PTR_HI
rts
}
initScroll: {
lda #$00
sta SCROLL_OFFSET
rts
}
playMusic: {
c64lib_debugBorderStart()
jsr music.play
c64lib_debugBorderEnd()
rts
}
initSound: {
ldx #0
ldy #0
lda #music.startSong-1
jsr music.init
rts
}
doScroll: {
c64lib_debugBorderStart()
lda SCROLL_OFFSET
cmp #$00
bne decOffset
lda #7
sta SCROLL_OFFSET
c64lib_pushParamW(SCREEN_PTR + SCROLL_POSITION_OFFSET)
c64lib_pushParamW(scrollText)
c64lib_pushParamWInd(scrollPtr)
jsr scroll
c64lib_pullParamW(scrollPtr)
jmp fineScroll
decOffset:
sbc #1
sta SCROLL_OFFSET
fineScroll:
lda SCROLL_OFFSET
sta hscroll + 2
c64lib_debugBorderEnd()
rts
}
doColorCycle: {
c64lib_debugBorderStart()
// tech tech
c64lib_pushParamW(hscrollMapDef)
ldx #(TECH_TECH_WIDTH-1)
jsr rotateMemRight
// font effects via raster bars
inc CYCLE_CNTR
lda CYCLE_CNTR
cmp #4
beq doCycle
c64lib_debugBorderEnd()
rts
doCycle:
lda #0
sta CYCLE_CNTR
c64lib_pushParamW(colorCycleDef + 1)
ldx #6
jsr rotateMemRight
c64lib_debugBorderEnd()
rts
}
unpack: {
c64lib_pushParamW(musicData)
c64lib_pushParamW(music.location)
c64lib_pushParamW(music.size)
jsr copyLargeMemForward
rts
}
endOfCode:
.align $100
copperList:
c64lib_copperEntry(0, c64lib.IRQH_JSR, <doScroll, >doScroll)
c64lib_copperEntry(25, c64lib.IRQH_JSR, <doColorCycle, >doColorCycle)
c64lib_copperEntry(LOGO_LINE, c64lib.IRQH_HSCROLL_MAP, <hscrollMapDef, >hscrollMapDef)
c64lib_copperEntry(CREDITS_COLOR_BARS_LINE, c64lib.IRQH_BG_RASTER_BAR, <colorCycleDef, >colorCycleDef)
c64lib_copperEntry(CREDITS_COLOR_BARS_LINE + 16, c64lib.IRQH_BG_RASTER_BAR, <colorCycleDef, >colorCycleDef)
hscroll: c64lib_copperEntry(SCROLL_HSCROLL_LINE_START, c64lib.IRQH_HSCROLL, 5, 0)
c64lib_copperEntry(SCROLL_COLOR_BARS_LINE, c64lib.IRQH_BG_RASTER_BAR, <scrollBarDef, >scrollBarDef)
c64lib_copperEntry(SCROLL_HSCROLL_LINE_END, c64lib.IRQH_HSCROLL, 0, 0)
c64lib_copperEntry(257, c64lib.IRQH_JSR, <playMusic, >playMusic)
c64lib_copperLoop()
// library hosted functions
startCopper: c64lib_startCopper(
DISPLAY_LIST_PTR_LO,
LIST_PTR,
List().add(c64lib.IRQH_BG_RASTER_BAR, c64lib.IRQH_HSCROLL, c64lib.IRQH_JSR, c64lib.IRQH_HSCROLL_MAP).lock())
scroll: c64lib_scroll1x1(SCROLL_TEMP)
outHex:
#import "text/lib/sub/out-hex.asm"
outText:
#import "text/lib/sub/out-text.asm"
fillMem:
#import "common/lib/sub/fill-mem.asm"
rotateMemRight:
#import "common/lib/sub/rotate-mem-right.asm"
fillScreen:
#import "common/lib/sub/fill-screen.asm"
copyLargeMemForward:
#import "common/lib/sub/copy-large-mem-forward.asm"
endOfLibs:
// variables
screenPtr: .word SCREEN_PTR
scrollText: c64lib_incText(
" 3... 2... 1... go! "
+"hi folks! this simple intro has been written to demonstrate capabilities of copper64 library "
+"which is a part of c64lib project. there's little tech tech animation of ascii logo, some old shool "
+"font effect and lame 1x1 scroll that you're reading right now. c64lib is freely available on "
+"https://github.com/c64lib that's all for now, i don't have any more ideas for this text. ",
128)
.byte $ff
creditsText1: c64lib_incText(" code by maciek malecki", 128); .byte $ff
creditsText2: c64lib_incText(" music by jeroen tel", 128); .byte $ff
logoLine1: .text " ---===--- ---===--- ---===--- ---===- "
.text " ccc 666 4 4 l i bbb ddd eee mmm ooo "
.text " c 6 6 444 l i b b d d e m m o o "
.text " ccc 666 4 lll i bbb ddd eee m m ooo "
.text " -===--- ---===--- ---===--- ---===--- "; .byte $ff
scrollPtr: .word scrollText
scrollBarDef: .byte GREY, LIGHT_GREY, WHITE, WHITE, LIGHT_GREY, GREY, GREY, BLACK, $ff
colorCycleDef: .byte BLACK, RED, RED, BROWN, RED, LIGHT_RED, YELLOW, WHITE, BLACK, $ff
hscrollMapDef: .fill TECH_TECH_WIDTH, round(3.5 + 3.5*sin(toRadians(i*360/TECH_TECH_WIDTH))) ; .byte 0; .byte $ff
endOfVars:
//*=music.location "Music"
musicData:
.fill music.size, music.getData(i)
endOfProg:
.print "End of code = " + toHexString(endOfCode)
.print "Copper list = " + toHexString(copperList)
.print "Size of vars = " + (endOfVars - screenPtr)
.print "Size of libs = " + (endOfLibs - startCopper)
.print "Size of all = " + (endOfProg - start)
| 27.202091 | 148 | 0.665941 |
646fb3064979b2d09352d88c6a633b35f60ff225 | 475 | asm | Assembly | programs/oeis/132/A132367.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/132/A132367.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/132/A132367.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A132367: Period 6: repeat [1, 1, 2, -1, -1, -2].
; 1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2,1,1,2,-1,-1,-2
mul $0,2
div $0,3
mod $0,4
mov $1,4
mov $2,$0
sub $2,1
add $0,$2
mul $0,$2
lpb $0,1
sub $3,5
add $3,$1
div $3,3
mov $0,$3
mov $1,2
sub $1,$2
lpe
sub $1,2
| 22.619048 | 256 | 0.444211 |
301ce61d668ede2541059ae13ab5b20e2c753427 | 3,382 | asm | Assembly | ts2060/instructions.asm | nagydani/zx-rom-mods | a06cfb2e936c145025c4f3d6f3282cce15ad5f56 | [
"MIT"
] | 15 | 2018-09-07T15:49:44.000Z | 2021-09-21T20:47:14.000Z | ts2060/instructions.asm | nagydani/zx-rom-mods | a06cfb2e936c145025c4f3d6f3282cce15ad5f56 | [
"MIT"
] | 6 | 2020-05-24T08:43:07.000Z | 2020-05-26T22:02:36.000Z | ts2060/instructions.asm | nagydani/zx-rom-mods | a06cfb2e936c145025c4f3d6f3282cce15ad5f56 | [
"MIT"
] | 3 | 2020-08-03T06:28:34.000Z | 2021-12-29T00:27:50.000Z | OFFS: EQU 50
INST_TAB:
DEFB LABEL_T+OFFS
DEFB P_LABEL - $ ; 2' @ / LABEL
DEFB DPOKE_T+OFFS
DEFB P_DPOKE - $ ; Ex + L' DPOKE
DEFB FPOKE_T+OFFS
DEFB P_FPOKE - $ ; X' FPOKE
DEFB SOUND_T+OFFS
DEFB P_SOUND - $ ; SOUND
DEFB USR_T+OFFS
DEFB P_USR - $
DEFB PLAY_T+OFFS
DEFB P_PLAY - $ ; PLAY
DEFB DELETE_T+OFFS
DEFB P_DELETE - $ ; DELETE
DEFB ONERR_T+OFFS
DEFB P_ONERR - $ ; ON ERR
DEFB SCREEN_T+OFFS
DEFB P_DISPLAY - $ ; Ex + K' DISPLAY
DEFB RESET_T+OFFS
DEFB P_RESET - $ ; RESET
DEFB SPECTRUM_T+OFFS
DEFB P_SPECTRUM - $ ; SPECTRUM
DEFB 0
P_LABEL:DEFB $05
DEFW LABEL
P_ONERR:DEFB GOTO_T,$06,$00
DEFW ON_ERR
P_DPOKE:DEFB $08,$00
DEFW DPOKE
P_FPOKE:DEFB $08,$00
DEFW FPOKE
P_SOUND:DEFB $05
DEFW SOUND
P_USR: DEFB $06,$00
DEFW USR
P_DELETE:
DEFB $05
DEFW DELETE
P_DISPLAY:
DEFB $03
DEFW DISPLAY
P_PLAY: DEFB $05
DEFW PLAY
P_SPECTRUM:
DEFB $00
DEFW SPECTRUM
P_RESET:DEFB $07,$00
DEFW RESET_I
CHECK_END:
CALL SYNTAX_Z
RET NZ
END05_E:POP BC ; SCAN-LOOP
END05: POP BC ; STMT-RET
STMT_NEXT:
RST $18
CP $0D ; CR
JR Z,LINE_END
CP ":"
JR Z,STMT_LOOP
JR ERROR_C_I
STMT_LOOP:
LD HL,L1B28 ; STMT-LOOP
PUSH HL
RST $10
LINE_END:
BIT 7,(IY+$01)
JR Z,LE_SWAP
LD HL,(NXTLIN)
LD A,$C0
AND (HL)
JR NZ,LE_SWAP ; program finished
PUSH HL
LD HL,L1BBF - 1 ; XOR A, LINE-USE
EX (SP),HL
LE_SWAP:RST $10
CMDCLASS2:
DEFB CLASS2_00 - $ ; parameterless instruction
DEFB CLASS2_01 - $ ; do something to a variable
DEFB CLASS2_02 - $ ; prepare value for assignment
DEFB CLASS2_03 - $ ; one numeric parameter, defaults to zero
DEFB CLASS2_04 - $ ; used by FOR & NEXT -- TODO: may be worth replacing
DEFB CLASS2_05 - $ ; list of items
DEFB CLASS2_06 - $ ; evaluate single numeric expression
DEFB CLASS2_07 - $ ; optionally open stream before execution
DEFB CLASS2_08 - $ ; two numeric expressions, separated by comma
CLASS2_03:
CALL FETCH_NUM
CLASS2_00:
CP A
CLASS2_05:
POP BC
CALL Z,CHECK_END
EX DE,HL
LD HL,(T_ADDR)
LD C,(HL)
INC HL
LD B,(HL)
EX DE,HL
PUSH BC
RET
CLASS2_01:
RST $30
DEFW L1C1F ; CLASS_01
RET
CLASS2_02:
RST $30
DEFW L1C4E ; CLASS_02
RET
CLASS2_04:
RST $30
DEFW L1C6C ; CLASS_04
RET
NEXT_2NUM:
RST $20
CLASS2_08:
CALL CLASS2_06
CP ","
JR NZ,ERROR_C_I
NEXT_1NUM:
RST $20
CLASS2_06:
RST $30
DEFW L24FB ; SCANNING
BIT 6,(IY+$01)
RET NZ
ERROR_C_I:
JP ERROR_C
FETCH_NUM:
CP $0D
JR Z,USE_ZERO
CP ":"
JR NZ,CLASS2_06
USE_ZERO:
RST $30
DEFW L1CE6 ; USE-ZERO
RET
CLASS2_07:
RST $30
DEFW L2070 ; STR-ALTER
RET NC
LD HL,(T_ADDR)
LD A,(HL)
OR A
JR Z,CL7_E
INC HL
LD (T_ADDR),HL
CL7_E: CALL UNSTACK_Z
LD (IY+CURCHL+1-ERR_NR),$00
RET
DELIM: DEFB $0D
DEFM ":,;)"
DELIM_E:
FROM_1: CALL SYNTAX_Z
JR Z,FROM_1R
RST $30
DEFW L1CE6 + 4 ; USE-ZERO + 4
INC HL
INC HL
LD (HL),$01 ; ONE
JR FROM_1R
CLASS2_0A:
RST $18
CP TO_T
JR Z,FROM_1
CALL CLASS2_06 ; beginning
CP TO_T
JR NZ,TO_SAME
FROM_1R:RST $20
LD HL,DELIM
LD BC,DELIM_E - DELIM
CPIR
JR NZ,CLASS2_06
CALL UNSTACK_Z
RST $28
DEFB $A1 ; stk-one
DEFB $1B ; negate
DEFB $38 ; end
RET
TO_SAME:CALL UNSTACK_Z
RST $28
DEFB $31 ; duplicate
DEFB $38 ; end
RET
; instruction routines
INCLUDE "display.asm"
INCLUDE "spectrum.asm"
INCLUDE "play.asm"
INCLUDE "sound.asm"
INCLUDE "poke.asm"
INCLUDE "onerr.asm"
INCLUDE "label.asm"
INCLUDE "delete.asm"
INCLUDE "reset.asm"
INCLUDE "usr.asm"
| 14.768559 | 72 | 0.68628 |
086253962e26dbb588d0503d841f22dd3866f89e | 28 | asm | Assembly | pkgs/tools/yasm/src/modules/preprocs/nasm/tests/noinclude-err.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | pkgs/tools/yasm/src/modules/preprocs/nasm/tests/noinclude-err.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | pkgs/tools/yasm/src/modules/preprocs/nasm/tests/noinclude-err.asm | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | %include "doesnotexist.inc"
| 14 | 27 | 0.785714 |
ac384193e539e6a508ac39ce49bc1ca6fff52f83 | 11,062 | nasm | Assembly | Linux/x86/msncsi.nasm | tobyoxborrow/msncsiasm | 3fcfff9a6779cae22da9dba48dff1201a262fc7b | [
"BSD-3-Clause"
] | null | null | null | Linux/x86/msncsi.nasm | tobyoxborrow/msncsiasm | 3fcfff9a6779cae22da9dba48dff1201a262fc7b | [
"BSD-3-Clause"
] | null | null | null | Linux/x86/msncsi.nasm | tobyoxborrow/msncsiasm | 3fcfff9a6779cae22da9dba48dff1201a262fc7b | [
"BSD-3-Clause"
] | null | null | null | ; Microsoft Network Connectivity Status Indicator
; Makes GET request for http://www.msftncsi.com/ncsi.txt
; Exits 0 if GET request succeeds (full connectivity)
; If GET request fails, performs DNS lookup on dns.msftncsi.com, expecting the
; result 131.107.255.255
; Exits 1 if DNS request succeeds (partial connectivity)
; Otherwise, exits -1 (no connectivity)
; Exits -2 for internal processing errors, though that may be due to some
; network reason
;
global _start
section .text
exit:
mov eax, __NR_exit
int 0x80
exit_0:
mov ebx, 0x0
jmp exit
; Partial connectivity
exit_1:
mov ebx, 0x1
jmp exit
; Network error
exit_neg1:
mov ebx, -1
jmp exit
; Internal error
exit_neg2:
mov ebx, -2
jmp exit
; prepare [socket_args] before calling
sys_socket:
; int socketcall(int call, unsigned long *args);
; int socket(int domain, int type, int protocol);
mov eax, __NR_socketcall
mov ebx, SYS_SOCKET ; int call
mov ecx, socket_args ; unsigned long *args
int 0x80
; save the socket file descriptor
mov esi, eax
ret
; arguments:
; ebx - file descriptor
sys_close:
; int close(int fd);
mov eax, __NR_close
int 0x80
ret
; arguments:
; eax - sin_addr in network byte order
; ebx - sin_port in network byte order
sys_connect:
; int socketcall(int call, unsigned long *args);
; int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
mov [connect_struct], word AF_INET ; sin_family
mov [connect_struct+2], word bx ; sin_port
mov [connect_struct+4], dword eax ; sin_addr
mov [connect_args], esi
mov [connect_args+4], dword connect_struct
mov [connect_args+8], dword __SOCK_SIZE__
mov eax, __NR_socketcall
mov ebx, SYS_CONNECT ; int call
mov ecx, connect_args ; *args
int 0x80
ret
; arguments:
; ebx - file handle
; ecx - message
; edx - message length
sys_write:
; ssize_t write(int fd, const void *buf, size_t count);
mov eax, __NR_write
int 0x80
ret
; arguments:
; ebx - file handle
; ecx - buffer
; edx - buffer length
sys_read:
; ssize_t read(int fd, void *buf, size_t count);
mov eax, __NR_read
int 0x80
ret
; simple domain name resolver
; requires a recursive server to answer our queries (e.g. 8.8.8.8)
; prepare [packet_buffer] with a valid dns query packet before calling
resolve_name:
; ecx - *args for socketcall() / socket()
mov [socket_args], dword PF_INET ; int domain
mov [socket_args+4], dword SOCK_DGRAM ; int type
mov [socket_args+8], dword IPPROTO_IP ; int protocol
call sys_socket
cmp eax, 0x0
jl exit_neg2
mov eax, addr_8888
mov ebx, port_domain
call sys_connect
cmp eax, 0x0
jnz exit_neg1
; send question
mov ebx, esi
mov ecx, packet_buffer
mov edx, dns_query_packet_len
call sys_write
cmp eax, 0x0
jl exit_neg2
; receive answer
mov ebx, esi
mov ecx, packet_buffer
mov edx, packet_buffer_len
call sys_read
cmp eax, 0x0
jl exit_neg2
;mov ecx, eax ; save size of answer
; close socket
mov ebx, esi
call sys_close
; parse answer
mov eax, packet_buffer
; sanity check: verify ID
cmp word [eax], 0x77B0
jne exit_neg1
add eax, 0x2 ; skip over ID
; TODO: check rcode flags for errors (e.g. servfail)
; TODO: check RA bit is set (server is recursive)?
nop
; get number of resource records in the answer
add eax, 0x4 ; skip over flags, query count
mov ecx, 0x0
mov cx, word [eax]
bswap ecx
shr ecx, 0x10
add eax, 0x2 ; skip answer count
; skip to first answer
add eax, 0x4 ; skip auth rr, additional rr
add eax, 0x12 ; skip question labels
; the two domains we will query are the same length, so we
; can hard-code the value here.
add eax, 0x4 ; skip answer QTYPE, QCLASS
; go through each answer
; stop on the first A record
; ignore other types
mov edi, 0x0 ; IP address will be stored here
rr_loop:
; is the name a label or pointer?
cmp word [eax], 0xC000
jge rr_loop_pointer
jmp rr_loop_label
rr_loop_post_name: ; return here after processing the name
mov bx, word [eax] ; resource record type
cmp ebx, QTYPE_A ; is it an A record?
je rr_loop_handle_a
add eax, 0x8 ; skip type, class, ttl
mov ebx, 0x0 ; read rdata length
mov bx, word [eax]
bswap ebx
shr ebx, 0x10
add eax, 0x2 ; skip rdata length
add eax, ebx ; skip rdata
loop rr_loop
jmp rr_loop_end
rr_loop_pointer:
add eax, 0x2 ; skip over the pointer
jmp rr_loop_post_name
rr_loop_label:
cmp byte [eax], 0x0
je rr_loop_post_name
mov ebx, 0
mov bl, byte [eax]
inc eax ; skip label length
add eax, ebx ; skip label value
jmp rr_loop_label
rr_loop_handle_a:
add eax, 0x8 ; skip type, class, ttl
mov ebx, 0x0 ; read rdata length
mov bx, word [eax]
bswap ebx
shr ebx, 0x10
cmp ebx, 0x4 ; sanity check: IPv4 should be 4 bytes... right?
jne exit_neg2
add eax, 0x2 ; skip rdata length
mov edi, [eax]
rr_loop_end:
cmp edi, 0x0 ; did we find an A record?
je exit_neg2
ret
; arguments:
; edi - IP address
http_request:
; ecx - *args for socketcall() / socket()
mov [socket_args], dword PF_INET ; int domain
mov [socket_args+4], dword SOCK_STREAM ; int type
mov [socket_args+8], dword IPPROTO_IP ; int protocol
call sys_socket
cmp eax, 0x0
jl exit_neg2
mov eax, edi
mov ebx, port_http
call sys_connect
cmp eax, 0x0
jnz exit_neg1
; send request
mov ebx, esi
mov ecx, http_request_request
mov edx, http_request_request_len
call sys_write
cmp eax, 0x0
jl exit_neg2
; receive response
mov ebx, esi
mov ecx, packet_buffer
mov edx, packet_buffer_len
call sys_read
cmp eax, 0x0
jl exit_neg2
mov ecx, eax ; save size of response
; close socket
mov ebx, esi
call sys_close
; parse response
; TODO: check HTTP response code - redirect or OK or other?
mov eax, packet_buffer
cmp dword [eax], "HTTP" ; sanity check: looks like a HTTP response
jne exit_neg1
; we could scan through the packet looking for "NCSI" but we know it'll be
; the last four bytes (there is not even CRLF) so we can just check there
; ecx is still the size of the response from sys_read
sub ecx, 0x4
add eax, ecx
cmp dword [eax], "NCSI"
je exit_0 ; if the text was found, we are done
ret
resolve_www_name:
mov eax, www_msftncsi_com_label
mov ebx, www_msftncsi_com_label_len
call craft_dns_query_packet
call resolve_name
ret
resolve_dns_name:
mov eax, dns_msftncsi_com_label
mov ebx, dns_msftncsi_com_label_len
call craft_dns_query_packet
call resolve_name
ret
; arguments:
; eax - pointer to label string
; ebx - length of label string
craft_dns_query_packet:
; if we needed to calculate the dns query packet length, something like
; this would be needed. however, since both domains are the same length, we
; can hard code the value.
;mov [dns_query_packet_len], word dns_query_header_len
;add [dns_query_packet_len], bx
;add [dns_query_packet_len], word 0x4 ; trailing params
; HEADER
mov ecx, dns_query_header_len
mov esi, dns_query_header
mov edi, packet_buffer
;cld
rep movsb
; QUESTION
mov ecx, ebx
mov esi, eax
; edi is at the right spot
;cld
rep movsb
; trailing params
mov [edi], word QTYPE_A ; QTYPE (1 - A, a host name)
mov [edi+2], word QCLASS_IN ; QCLASS (1 - IN, the Internet)
ret
_start:
; method 1. GET request for www.msftncsi.com/ncsi.txt
call resolve_www_name
call http_request
; method 2. DNS query for dns.msftncsi.com
call resolve_dns_name
cmp edi, addr_131107255255
je exit_1 ; correct result
jmp exit_neg1 ; otherwise, bad result and fail
section .data
; asm/unistd_32.h
__NR_exit: equ 1
__NR_read: equ 3
__NR_write: equ 4
__NR_close: equ 6
__NR_socketcall: equ 102
; /usr/include/linux/net.h
SYS_SOCKET: equ 1 ; sys_socket(2)
SYS_CONNECT: equ 3 ; sys_connect(2)
; /usr/include/linux/in.h
IPPROTO_IP: equ 0 ; Dummy protocol for TCP
__SOCK_SIZE__: equ 16 ; sizeof(struct sockaddr)
; /usr/include/.../bits/socket.h
PF_INET: equ 2 ; IP protocol family.
AF_INET: equ PF_INET
; /usr/include/.../bits/socket_type.h
SOCK_STREAM: equ 1 ; Sequenced, reliable, connection-based
SOCK_DGRAM: equ 2 ; Connectionless, unreliable datagrams
; /etc/services - in network byte order
port_domain: equ 0x3500 ; decimal: 53
port_http: equ 0x5000 ; decimal: 80
addr_8888: equ 0x08080808 ; 8.8.8.8
addr_131107255255: equ 0xFFFF6B83 ; 131.107.255.255
; https://tools.ietf.org/html/rfc1035#section-3.2.2
;QTYPE_A: equ 0x1 ; A, 1 a host address
;QCLASS_IN: equ 0x1 ; 1 - IN, the Internet
; word size, in network byte order
QTYPE_A: equ 0x100
QCLASS_IN: equ 0x100
; Domain name message header section format
; https://tools.ietf.org/html/rfc1035#section-4.1.1
; Z bits that were reserved then gained usage: The AD and CD header bits
; https://tools.ietf.org/html/rfc2065#section-6
dns_query_header:
; HEADER
db 0xB0, 0x77, ; ID
db 0x01, 0x00, ; QR (0), Opcode (0), AA (0), TC (0), RD (1)
; RA (0), Z (0), AD (0), CD (0), RCODE (0)
db 0x00, 0x01, ; QDCOUNT (1)
db 0x00, 0x00, ; ANCOUNT (0)
db 0x00, 0x00, ; NSCOUNT (0)
db 0x00, 0x00, ; ARCOUNT (0)
dns_query_header_len: equ $-dns_query_header
dns_query_packet_len: equ 0x22
dns_msftncsi_com_label: db 0x3, "dns", 0x8, "msftncsi", 0x3, "com", 0x0
dns_msftncsi_com_label_len: equ $-dns_msftncsi_com_label
www_msftncsi_com_label: db 0x3, "www", 0x8, "msftncsi", 0x3, "com", 0x0
www_msftncsi_com_label_len: equ $-www_msftncsi_com_label
; use \r\n because we are all one big happy family
http_request_request: db "GET /ncsi.txt HTTP/1.1", 0xD, 0xA, "Host: www.msftncsi.com", 0xD, 0xA, 0xD, 0xA
http_request_request_len: equ $-http_request_request
packet_buffer_len: equ 512 ; udp packet max
; also sufficient for ncsi.txt http response
; (headers+body: ~180 bytes)
section .bss
socket_args: resb 12
connect_args: resb 12
connect_struct: resb __SOCK_SIZE__
packet_buffer: resb packet_buffer_len
| 25.665893 | 109 | 0.641385 |
5e786270c34e59375a4c52bc660870e813b313d1 | 415 | asm | Assembly | oeis/236/A236583.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/236/A236583.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/236/A236583.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A236583: The number of tilings of an 8 X (3n) floor with 2 X 3 hexominoes.
; Submitted by Christian Krause
; 1,1,4,11,33,96,281,821,2400,7015,20505,59936,175193,512089,1496836,4375251,12788857,37381824,109267057,319387565,933569728,2728823951,7976351345,23314871872,68149361393
add $0,1
mov $3,1
lpb $0
sub $0,1
add $1,$2
sub $4,$2
add $2,$3
add $1,$2
mul $3,-1
add $4,$1
add $3,$4
lpe
mov $0,$2
| 23.055556 | 170 | 0.691566 |
f84acf04246fa0d462a92220e978bf75b8eed616 | 499,791 | asm | Assembly | third_party/virtualbox/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative8086.asm | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 1 | 2020-06-04T20:31:13.000Z | 2020-06-04T20:31:13.000Z | third_party/virtualbox/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative8086.asm | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | null | null | null | third_party/virtualbox/src/VBox/Devices/Graphics/BIOS/VBoxVgaBiosAlternative8086.asm | Fimbure/icebox-1 | 0b81992a53e1b410955ca89bdb6f8169d6f2da86 | [
"MIT"
] | 1 | 2020-03-06T10:39:37.000Z | 2020-03-06T10:39:37.000Z | ; $Id: VBoxVgaBiosAlternative8086.asm $
;; @file
; Auto Generated source file. Do not edit.
;
;
; Source file: vgarom.asm
;
; ============================================================================================
;
; Copyright (C) 2001,2002 the LGPL VGABios developers Team
;
; This library is free software; you can redistribute it and/or
; modify it under the terms of the GNU Lesser General Public
; License as published by the Free Software Foundation; either
; version 2 of the License, or (at your option) any later version.
;
; This library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public
; License along with this library; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;
; ============================================================================================
;
; This VGA Bios is specific to the plex86/bochs Emulated VGA card.
; You can NOT drive any physical vga card with it.
;
; ============================================================================================
;
;
; Source file: vberom.asm
;
; ============================================================================================
;
; Copyright (C) 2002 Jeroen Janssen
;
; This library is free software; you can redistribute it and/or
; modify it under the terms of the GNU Lesser General Public
; License as published by the Free Software Foundation; either
; version 2 of the License, or (at your option) any later version.
;
; This library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Lesser General Public License for more details.
;
; You should have received a copy of the GNU Lesser General Public
; License along with this library; if not, write to the Free Software
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;
; ============================================================================================
;
; This VBE is part of the VGA Bios specific to the plex86/bochs Emulated VGA card.
; You can NOT drive any physical vga card with it.
;
; ============================================================================================
;
; This VBE Bios is based on information taken from :
; - VESA BIOS EXTENSION (VBE) Core Functions Standard Version 3.0 located at www.vesa.org
;
; ============================================================================================
;
; Source file: vgabios.c
;
; // ============================================================================================
;
; vgabios.c
;
; // ============================================================================================
; //
; // Copyright (C) 2001,2002 the LGPL VGABios developers Team
; //
; // This library is free software; you can redistribute it and/or
; // modify it under the terms of the GNU Lesser General Public
; // License as published by the Free Software Foundation; either
; // version 2 of the License, or (at your option) any later version.
; //
; // This library is distributed in the hope that it will be useful,
; // but WITHOUT ANY WARRANTY; without even the implied warranty of
; // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; // Lesser General Public License for more details.
; //
; // You should have received a copy of the GNU Lesser General Public
; // License along with this library; if not, write to the Free Software
; // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
; //
; // ============================================================================================
; //
; // This VGA Bios is specific to the plex86/bochs Emulated VGA card.
; // You can NOT drive any physical vga card with it.
; //
; // ============================================================================================
; //
; // This file contains code ripped from :
; // - rombios.c of plex86
; //
; // This VGA Bios contains fonts from :
; // - fntcol16.zip (c) by Joseph Gil avalable at :
; // ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip
; // These fonts are public domain
; //
; // This VGA Bios is based on information taken from :
; // - Kevin Lawton's vga card emulation for bochs/plex86
; // - Ralf Brown's interrupts list available at http://www.cs.cmu.edu/afs/cs/user/ralf/pub/WWW/files.html
; // - Finn Thogersons' VGADOC4b available at http://home.worldonline.dk/~finth/
; // - Michael Abrash's Graphics Programming Black Book
; // - Francois Gervais' book "programmation des cartes graphiques cga-ega-vga" edited by sybex
; // - DOSEMU 1.0.1 source code for several tables values and formulas
; //
; // Thanks for patches, comments and ideas to :
; // - techt@pikeonline.net
; //
; // ============================================================================================
;
; Source file: vbe.c
;
; // ============================================================================================
; //
; // Copyright (C) 2002 Jeroen Janssen
; //
; // This library is free software; you can redistribute it and/or
; // modify it under the terms of the GNU Lesser General Public
; // License as published by the Free Software Foundation; either
; // version 2 of the License, or (at your option) any later version.
; //
; // This library is distributed in the hope that it will be useful,
; // but WITHOUT ANY WARRANTY; without even the implied warranty of
; // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; // Lesser General Public License for more details.
; //
; // You should have received a copy of the GNU Lesser General Public
; // License along with this library; if not, write to the Free Software
; // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
; //
; // ============================================================================================
; //
; // This VBE is part of the VGA Bios specific to the plex86/bochs Emulated VGA card.
; // You can NOT drive any physical vga card with it.
; //
; // ============================================================================================
; //
; // This VBE Bios is based on information taken from :
; // - VESA BIOS EXTENSION (VBE) Core Functions Standard Version 3.0 located at www.vesa.org
; //
; // ============================================================================================
;
; Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
; other than GPL or LGPL is available it will apply instead, Oracle elects to use only
; the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
; a choice of LGPL license versions is made available with the language indicating
; that LGPLv2 or any later version may be used, or where a choice of which version
; of the LGPL is applied is otherwise unspecified.
;
section VGAROM progbits vstart=0x0 align=1 ; size=0x942 class=CODE group=AUTO
db 055h, 0aah, 040h, 0e9h, 064h, 00ah, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 049h, 042h
db 04dh, 000h
vgabios_int10_handler: ; 0xc0022 LB 0x56e
pushfw ; 9c
cmp ah, 00fh ; 80 fc 0f
jne short 0002eh ; 75 06
call 00189h ; e8 5e 01
jmp near 000f9h ; e9 cb 00
cmp ah, 01ah ; 80 fc 1a
jne short 00039h ; 75 06
call 0055ch ; e8 26 05
jmp near 000f9h ; e9 c0 00
cmp ah, 00bh ; 80 fc 0b
jne short 00044h ; 75 06
call 000fbh ; e8 ba 00
jmp near 000f9h ; e9 b5 00
cmp ax, 01103h ; 3d 03 11
jne short 0004fh ; 75 06
call 00450h ; e8 04 04
jmp near 000f9h ; e9 aa 00
cmp ah, 012h ; 80 fc 12
jne short 00093h ; 75 3f
cmp bl, 010h ; 80 fb 10
jne short 0005fh ; 75 06
call 0045dh ; e8 01 04
jmp near 000f9h ; e9 9a 00
cmp bl, 030h ; 80 fb 30
jne short 0006ah ; 75 06
call 00480h ; e8 19 04
jmp near 000f9h ; e9 8f 00
cmp bl, 031h ; 80 fb 31
jne short 00075h ; 75 06
call 004d3h ; e8 61 04
jmp near 000f9h ; e9 84 00
cmp bl, 032h ; 80 fb 32
jne short 0007fh ; 75 05
call 004f8h ; e8 7b 04
jmp short 000f9h ; eb 7a
cmp bl, 033h ; 80 fb 33
jne short 00089h ; 75 05
call 00516h ; e8 8f 04
jmp short 000f9h ; eb 70
cmp bl, 034h ; 80 fb 34
jne short 000ddh ; 75 4f
call 0053ah ; e8 a9 04
jmp short 000f9h ; eb 66
cmp ax, 0101bh ; 3d 1b 10
je short 000ddh ; 74 45
cmp ah, 010h ; 80 fc 10
jne short 000a2h ; 75 05
call 001b0h ; e8 10 01
jmp short 000f9h ; eb 57
cmp ah, 04fh ; 80 fc 4f
jne short 000ddh ; 75 36
cmp AL, strict byte 003h ; 3c 03
jne short 000b0h ; 75 05
call 007fbh ; e8 4d 07
jmp short 000f9h ; eb 49
cmp AL, strict byte 005h ; 3c 05
jne short 000b9h ; 75 05
call 00820h ; e8 69 07
jmp short 000f9h ; eb 40
cmp AL, strict byte 007h ; 3c 07
jne short 000c2h ; 75 05
call 0084dh ; e8 8d 07
jmp short 000f9h ; eb 37
cmp AL, strict byte 008h ; 3c 08
jne short 000cbh ; 75 05
call 00881h ; e8 b8 07
jmp short 000f9h ; eb 2e
cmp AL, strict byte 009h ; 3c 09
jne short 000d4h ; 75 05
call 008b8h ; e8 e6 07
jmp short 000f9h ; eb 25
cmp AL, strict byte 00ah ; 3c 0a
jne short 000ddh ; 75 05
call 0092bh ; e8 50 08
jmp short 000f9h ; eb 1c
push ES ; 06
push DS ; 1e
push ax ; 50
push cx ; 51
push dx ; 52
push bx ; 53
push sp ; 54
push bp ; 55
push si ; 56
push di ; 57
mov bx, 0c000h ; bb 00 c0
mov ds, bx ; 8e db
call 0329eh ; e8 af 31
pop di ; 5f
pop si ; 5e
pop bp ; 5d
pop bx ; 5b
pop bx ; 5b
pop dx ; 5a
pop cx ; 59
pop ax ; 58
pop DS ; 1f
pop ES ; 07
popfw ; 9d
iret ; cf
cmp bh, 000h ; 80 ff 00
je short 00106h ; 74 06
cmp bh, 001h ; 80 ff 01
je short 00157h ; 74 52
retn ; c3
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
push DS ; 1e
mov dx, strict word 00040h ; ba 40 00
mov ds, dx ; 8e da
mov dx, 003dah ; ba da 03
in AL, DX ; ec
cmp byte [word 00049h], 003h ; 80 3e 49 00 03
jbe short 0014ah ; 76 2f
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 000h ; b0 00
out DX, AL ; ee
db 08ah, 0c3h
; mov al, bl ; 8a c3
and AL, strict byte 00fh ; 24 0f
test AL, strict byte 008h ; a8 08
je short 0012bh ; 74 02
add AL, strict byte 008h ; 04 08
out DX, AL ; ee
mov CL, strict byte 001h ; b1 01
and bl, 010h ; 80 e3 10
mov dx, 003c0h ; ba c0 03
db 08ah, 0c1h
; mov al, cl ; 8a c1
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
and AL, strict byte 0efh ; 24 ef
db 00ah, 0c3h
; or al, bl ; 0a c3
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
db 0feh, 0c1h
; inc cl ; fe c1
cmp cl, 004h ; 80 f9 04
jne short 00131h ; 75 e7
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop DS ; 1f
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov CL, strict byte 001h ; b1 01
and bl, 001h ; 80 e3 01
mov dx, 003c0h ; ba c0 03
db 08ah, 0c1h
; mov al, cl ; 8a c1
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
and AL, strict byte 0feh ; 24 fe
db 00ah, 0c3h
; or al, bl ; 0a c3
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
db 0feh, 0c1h
; inc cl ; fe c1
cmp cl, 004h ; 80 f9 04
jne short 00164h ; 75 e7
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
retn ; c3
push DS ; 1e
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
push bx ; 53
mov bx, strict word 00062h ; bb 62 00
mov al, byte [bx] ; 8a 07
pop bx ; 5b
db 08ah, 0f8h
; mov bh, al ; 8a f8
push bx ; 53
mov bx, 00087h ; bb 87 00
mov ah, byte [bx] ; 8a 27
and ah, 080h ; 80 e4 80
mov bx, strict word 00049h ; bb 49 00
mov al, byte [bx] ; 8a 07
db 00ah, 0c4h
; or al, ah ; 0a c4
mov bx, strict word 0004ah ; bb 4a 00
mov ah, byte [bx] ; 8a 27
pop bx ; 5b
pop DS ; 1f
retn ; c3
cmp AL, strict byte 000h ; 3c 00
jne short 001b6h ; 75 02
jmp short 00217h ; eb 61
cmp AL, strict byte 001h ; 3c 01
jne short 001bch ; 75 02
jmp short 00235h ; eb 79
cmp AL, strict byte 002h ; 3c 02
jne short 001c2h ; 75 02
jmp short 0023dh ; eb 7b
cmp AL, strict byte 003h ; 3c 03
jne short 001c9h ; 75 03
jmp near 0026eh ; e9 a5 00
cmp AL, strict byte 007h ; 3c 07
jne short 001d0h ; 75 03
jmp near 0029bh ; e9 cb 00
cmp AL, strict byte 008h ; 3c 08
jne short 001d7h ; 75 03
jmp near 002c3h ; e9 ec 00
cmp AL, strict byte 009h ; 3c 09
jne short 001deh ; 75 03
jmp near 002d1h ; e9 f3 00
cmp AL, strict byte 010h ; 3c 10
jne short 001e5h ; 75 03
jmp near 00316h ; e9 31 01
cmp AL, strict byte 012h ; 3c 12
jne short 001ech ; 75 03
jmp near 0032fh ; e9 43 01
cmp AL, strict byte 013h ; 3c 13
jne short 001f3h ; 75 03
jmp near 00357h ; e9 64 01
cmp AL, strict byte 015h ; 3c 15
jne short 001fah ; 75 03
jmp near 003aah ; e9 b0 01
cmp AL, strict byte 017h ; 3c 17
jne short 00201h ; 75 03
jmp near 003c5h ; e9 c4 01
cmp AL, strict byte 018h ; 3c 18
jne short 00208h ; 75 03
jmp near 003edh ; e9 e5 01
cmp AL, strict byte 019h ; 3c 19
jne short 0020fh ; 75 03
jmp near 003f8h ; e9 e9 01
cmp AL, strict byte 01ah ; 3c 1a
jne short 00216h ; 75 03
jmp near 00403h ; e9 ed 01
retn ; c3
cmp bl, 014h ; 80 fb 14
jnbe short 00234h ; 77 18
push ax ; 50
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
db 08ah, 0c7h
; mov al, bh ; 8a c7
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop ax ; 58
retn ; c3
push bx ; 53
mov BL, strict byte 011h ; b3 11
call 00217h ; e8 dc ff
pop bx ; 5b
retn ; c3
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
db 08bh, 0dah
; mov bx, dx ; 8b da
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov CL, strict byte 000h ; b1 00
mov dx, 003c0h ; ba c0 03
db 08ah, 0c1h
; mov al, cl ; 8a c1
out DX, AL ; ee
mov al, byte [es:bx] ; 26 8a 07
out DX, AL ; ee
inc bx ; 43
db 0feh, 0c1h
; inc cl ; fe c1
cmp cl, 010h ; 80 f9 10
jne short 0024ch ; 75 f1
mov AL, strict byte 011h ; b0 11
out DX, AL ; ee
mov al, byte [es:bx] ; 26 8a 07
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 010h ; b0 10
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
and AL, strict byte 0f7h ; 24 f7
and bl, 001h ; 80 e3 01
sal bl, 1 ; d0 e3
sal bl, 1 ; d0 e3
sal bl, 1 ; d0 e3
db 00ah, 0c3h
; or al, bl ; 0a c3
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop bx ; 5b
pop ax ; 58
retn ; c3
cmp bl, 014h ; 80 fb 14
jnbe short 002c2h ; 77 22
push ax ; 50
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
db 08ah, 0f8h
; mov bh, al ; 8a f8
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
mov BL, strict byte 011h ; b3 11
call 0029bh ; e8 d1 ff
db 08ah, 0c7h
; mov al, bh ; 8a c7
pop bx ; 5b
db 08ah, 0f8h
; mov bh, al ; 8a f8
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
db 08bh, 0dah
; mov bx, dx ; 8b da
mov CL, strict byte 000h ; b1 00
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
db 08ah, 0c1h
; mov al, cl ; 8a c1
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
mov byte [es:bx], al ; 26 88 07
inc bx ; 43
db 0feh, 0c1h
; inc cl ; fe c1
cmp cl, 010h ; 80 f9 10
jne short 002d9h ; 75 e7
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 011h ; b0 11
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
mov byte [es:bx], al ; 26 88 07
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003c8h ; ba c8 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
mov dx, 003c9h ; ba c9 03
pop ax ; 58
push ax ; 50
db 08ah, 0c4h
; mov al, ah ; 8a c4
out DX, AL ; ee
db 08ah, 0c5h
; mov al, ch ; 8a c5
out DX, AL ; ee
db 08ah, 0c1h
; mov al, cl ; 8a c1
out DX, AL ; ee
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
mov dx, 003c8h ; ba c8 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
pop dx ; 5a
push dx ; 52
db 08bh, 0dah
; mov bx, dx ; 8b da
mov dx, 003c9h ; ba c9 03
mov al, byte [es:bx] ; 26 8a 07
out DX, AL ; ee
inc bx ; 43
mov al, byte [es:bx] ; 26 8a 07
out DX, AL ; ee
inc bx ; 43
mov al, byte [es:bx] ; 26 8a 07
out DX, AL ; ee
inc bx ; 43
dec cx ; 49
jne short 00340h ; 75 ee
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 010h ; b0 10
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
and bl, 001h ; 80 e3 01
jne short 00385h ; 75 18
and AL, strict byte 07fh ; 24 7f
sal bh, 1 ; d0 e7
sal bh, 1 ; d0 e7
sal bh, 1 ; d0 e7
sal bh, 1 ; d0 e7
sal bh, 1 ; d0 e7
sal bh, 1 ; d0 e7
sal bh, 1 ; d0 e7
db 00ah, 0c7h
; or al, bh ; 0a c7
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
jmp short 0039fh ; eb 1a
push ax ; 50
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 014h ; b0 14
out DX, AL ; ee
pop ax ; 58
and AL, strict byte 080h ; 24 80
jne short 00399h ; 75 04
sal bh, 1 ; d0 e7
sal bh, 1 ; d0 e7
and bh, 00fh ; 80 e7 0f
db 08ah, 0c7h
; mov al, bh ; 8a c7
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop bx ; 5b
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003c7h ; ba c7 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
pop ax ; 58
db 08ah, 0e0h
; mov ah, al ; 8a e0
mov dx, 003c9h ; ba c9 03
in AL, DX ; ec
xchg al, ah ; 86 e0
push ax ; 50
in AL, DX ; ec
db 08ah, 0e8h
; mov ch, al ; 8a e8
in AL, DX ; ec
db 08ah, 0c8h
; mov cl, al ; 8a c8
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push bx ; 53
push cx ; 51
push dx ; 52
mov dx, 003c7h ; ba c7 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
pop dx ; 5a
push dx ; 52
db 08bh, 0dah
; mov bx, dx ; 8b da
mov dx, 003c9h ; ba c9 03
in AL, DX ; ec
mov byte [es:bx], al ; 26 88 07
inc bx ; 43
in AL, DX ; ec
mov byte [es:bx], al ; 26 88 07
inc bx ; 43
in AL, DX ; ec
mov byte [es:bx], al ; 26 88 07
inc bx ; 43
dec cx ; 49
jne short 003d6h ; 75 ee
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003c6h ; ba c6 03
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003c6h ; ba c6 03
in AL, DX ; ec
db 08ah, 0d8h
; mov bl, al ; 8a d8
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 010h ; b0 10
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
db 08ah, 0d8h
; mov bl, al ; 8a d8
shr bl, 1 ; d0 eb
shr bl, 1 ; d0 eb
shr bl, 1 ; d0 eb
shr bl, 1 ; d0 eb
shr bl, 1 ; d0 eb
shr bl, 1 ; d0 eb
shr bl, 1 ; d0 eb
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 014h ; b0 14
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
db 08ah, 0f8h
; mov bh, al ; 8a f8
and bh, 00fh ; 80 e7 0f
test bl, 001h ; f6 c3 01
jne short 0043fh ; 75 04
shr bh, 1 ; d0 ef
shr bh, 1 ; d0 ef
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003c4h ; ba c4 03
db 08ah, 0e3h
; mov ah, bl ; 8a e3
mov AL, strict byte 003h ; b0 03
out DX, ax ; ef
pop dx ; 5a
pop ax ; 58
retn ; c3
push DS ; 1e
push ax ; 50
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
db 032h, 0edh
; xor ch, ch ; 32 ed
mov bx, 00088h ; bb 88 00
mov cl, byte [bx] ; 8a 0f
and cl, 00fh ; 80 e1 0f
mov bx, strict word 00063h ; bb 63 00
mov ax, word [bx] ; 8b 07
mov bx, strict word 00003h ; bb 03 00
cmp ax, 003b4h ; 3d b4 03
jne short 0047dh ; 75 02
mov BH, strict byte 001h ; b7 01
pop ax ; 58
pop DS ; 1f
retn ; c3
push DS ; 1e
push bx ; 53
push dx ; 52
db 08ah, 0d0h
; mov dl, al ; 8a d0
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov bx, 00089h ; bb 89 00
mov al, byte [bx] ; 8a 07
mov bx, 00088h ; bb 88 00
mov ah, byte [bx] ; 8a 27
cmp dl, 001h ; 80 fa 01
je short 004aeh ; 74 15
jc short 004b8h ; 72 1d
cmp dl, 002h ; 80 fa 02
je short 004a2h ; 74 02
jmp short 004cch ; eb 2a
and AL, strict byte 07fh ; 24 7f
or AL, strict byte 010h ; 0c 10
and ah, 0f0h ; 80 e4 f0
or ah, 009h ; 80 cc 09
jne short 004c2h ; 75 14
and AL, strict byte 06fh ; 24 6f
and ah, 0f0h ; 80 e4 f0
or ah, 009h ; 80 cc 09
jne short 004c2h ; 75 0a
and AL, strict byte 0efh ; 24 ef
or AL, strict byte 080h ; 0c 80
and ah, 0f0h ; 80 e4 f0
or ah, 008h ; 80 cc 08
mov bx, 00089h ; bb 89 00
mov byte [bx], al ; 88 07
mov bx, 00088h ; bb 88 00
mov byte [bx], ah ; 88 27
mov ax, 01212h ; b8 12 12
pop dx ; 5a
pop bx ; 5b
pop DS ; 1f
retn ; c3
push DS ; 1e
push bx ; 53
push dx ; 52
db 08ah, 0d0h
; mov dl, al ; 8a d0
and dl, 001h ; 80 e2 01
sal dl, 1 ; d0 e2
sal dl, 1 ; d0 e2
sal dl, 1 ; d0 e2
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov bx, 00089h ; bb 89 00
mov al, byte [bx] ; 8a 07
and AL, strict byte 0f7h ; 24 f7
db 00ah, 0c2h
; or al, dl ; 0a c2
mov byte [bx], al ; 88 07
mov ax, 01212h ; b8 12 12
pop dx ; 5a
pop bx ; 5b
pop DS ; 1f
retn ; c3
push bx ; 53
push dx ; 52
db 08ah, 0d8h
; mov bl, al ; 8a d8
and bl, 001h ; 80 e3 01
xor bl, 001h ; 80 f3 01
sal bl, 1 ; d0 e3
mov dx, 003cch ; ba cc 03
in AL, DX ; ec
and AL, strict byte 0fdh ; 24 fd
db 00ah, 0c3h
; or al, bl ; 0a c3
mov dx, 003c2h ; ba c2 03
out DX, AL ; ee
mov ax, 01212h ; b8 12 12
pop dx ; 5a
pop bx ; 5b
retn ; c3
push DS ; 1e
push bx ; 53
push dx ; 52
db 08ah, 0d0h
; mov dl, al ; 8a d0
and dl, 001h ; 80 e2 01
xor dl, 001h ; 80 f2 01
sal dl, 1 ; d0 e2
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov bx, 00089h ; bb 89 00
mov al, byte [bx] ; 8a 07
and AL, strict byte 0fdh ; 24 fd
db 00ah, 0c2h
; or al, dl ; 0a c2
mov byte [bx], al ; 88 07
mov ax, 01212h ; b8 12 12
pop dx ; 5a
pop bx ; 5b
pop DS ; 1f
retn ; c3
push DS ; 1e
push bx ; 53
push dx ; 52
db 08ah, 0d0h
; mov dl, al ; 8a d0
and dl, 001h ; 80 e2 01
xor dl, 001h ; 80 f2 01
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov bx, 00089h ; bb 89 00
mov al, byte [bx] ; 8a 07
and AL, strict byte 0feh ; 24 fe
db 00ah, 0c2h
; or al, dl ; 0a c2
mov byte [bx], al ; 88 07
mov ax, 01212h ; b8 12 12
pop dx ; 5a
pop bx ; 5b
pop DS ; 1f
retn ; c3
cmp AL, strict byte 000h ; 3c 00
je short 00565h ; 74 05
cmp AL, strict byte 001h ; 3c 01
je short 0057ah ; 74 16
retn ; c3
push DS ; 1e
push ax ; 50
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov bx, 0008ah ; bb 8a 00
mov al, byte [bx] ; 8a 07
db 08ah, 0d8h
; mov bl, al ; 8a d8
db 032h, 0ffh
; xor bh, bh ; 32 ff
pop ax ; 58
db 08ah, 0c4h
; mov al, ah ; 8a c4
pop DS ; 1f
retn ; c3
push DS ; 1e
push ax ; 50
push bx ; 53
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
db 08bh, 0c3h
; mov ax, bx ; 8b c3
mov bx, 0008ah ; bb 8a 00
mov byte [bx], al ; 88 07
pop bx ; 5b
pop ax ; 58
db 08ah, 0c4h
; mov al, ah ; 8a c4
pop DS ; 1f
retn ; c3
times 0x1 db 0
do_out_dx_ax: ; 0xc0590 LB 0x7
xchg ah, al ; 86 c4
out DX, AL ; ee
xchg ah, al ; 86 c4
out DX, AL ; ee
retn ; c3
do_in_ax_dx: ; 0xc0597 LB 0x43
in AL, DX ; ec
xchg ah, al ; 86 c4
in AL, DX ; ec
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
test AL, strict byte 008h ; a8 08
je short 005a1h ; 74 fb
pop dx ; 5a
pop ax ; 58
retn ; c3
push ax ; 50
push dx ; 52
mov dx, 003dah ; ba da 03
in AL, DX ; ec
test AL, strict byte 008h ; a8 08
jne short 005aeh ; 75 fb
pop dx ; 5a
pop ax ; 58
retn ; c3
push dx ; 52
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00003h ; b8 03 00
call 00590h ; e8 d0 ff
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 d1 ff
cmp AL, strict byte 004h ; 3c 04
jbe short 005d8h ; 76 0e
db 08ah, 0e0h
; mov ah, al ; 8a e0
shr ah, 1 ; d0 ec
shr ah, 1 ; d0 ec
shr ah, 1 ; d0 ec
test AL, strict byte 007h ; a8 07
je short 005d8h ; 74 02
db 0feh, 0c4h
; inc ah ; fe c4
pop dx ; 5a
retn ; c3
_dispi_get_max_bpp: ; 0xc05da LB 0x26
push dx ; 52
push bx ; 53
call 00614h ; e8 35 00
db 08bh, 0d8h
; mov bx, ax ; 8b d8
or ax, strict byte 00002h ; 83 c8 02
call 00600h ; e8 19 00
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00003h ; b8 03 00
call 00590h ; e8 a0 ff
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 a1 ff
push ax ; 50
db 08bh, 0c3h
; mov ax, bx ; 8b c3
call 00600h ; e8 04 00
pop ax ; 58
pop bx ; 5b
pop dx ; 5a
retn ; c3
dispi_set_enable_: ; 0xc0600 LB 0x26
push dx ; 52
push ax ; 50
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00004h ; b8 04 00
call 00590h ; e8 85 ff
pop ax ; 58
mov dx, 001cfh ; ba cf 01
call 00590h ; e8 7e ff
pop dx ; 5a
retn ; c3
push dx ; 52
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00004h ; b8 04 00
call 00590h ; e8 72 ff
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 73 ff
pop dx ; 5a
retn ; c3
dispi_set_bank_: ; 0xc0626 LB 0x26
push dx ; 52
push ax ; 50
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00005h ; b8 05 00
call 00590h ; e8 5f ff
pop ax ; 58
mov dx, 001cfh ; ba cf 01
call 00590h ; e8 58 ff
pop dx ; 5a
retn ; c3
push dx ; 52
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00005h ; b8 05 00
call 00590h ; e8 4c ff
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 4d ff
pop dx ; 5a
retn ; c3
_dispi_set_bank_farcall: ; 0xc064c LB 0xac
cmp bx, 00100h ; 81 fb 00 01
je short 00676h ; 74 24
db 00bh, 0dbh
; or bx, bx ; 0b db
jne short 00688h ; 75 32
db 08bh, 0c2h
; mov ax, dx ; 8b c2
push dx ; 52
push ax ; 50
mov ax, strict word 00005h ; b8 05 00
mov dx, 001ceh ; ba ce 01
call 00590h ; e8 2d ff
pop ax ; 58
mov dx, 001cfh ; ba cf 01
call 00590h ; e8 26 ff
call 00597h ; e8 2a ff
pop dx ; 5a
db 03bh, 0d0h
; cmp dx, ax ; 3b d0
jne short 00688h ; 75 16
mov ax, strict word 0004fh ; b8 4f 00
retf ; cb
mov ax, strict word 00005h ; b8 05 00
mov dx, 001ceh ; ba ce 01
call 00590h ; e8 11 ff
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 12 ff
db 08bh, 0d0h
; mov dx, ax ; 8b d0
retf ; cb
mov ax, 0014fh ; b8 4f 01
retf ; cb
push dx ; 52
push ax ; 50
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00008h ; b8 08 00
call 00590h ; e8 f9 fe
pop ax ; 58
mov dx, 001cfh ; ba cf 01
call 00590h ; e8 f2 fe
pop dx ; 5a
retn ; c3
push dx ; 52
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00008h ; b8 08 00
call 00590h ; e8 e6 fe
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 e7 fe
pop dx ; 5a
retn ; c3
push dx ; 52
push ax ; 50
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00009h ; b8 09 00
call 00590h ; e8 d3 fe
pop ax ; 58
mov dx, 001cfh ; ba cf 01
call 00590h ; e8 cc fe
pop dx ; 5a
retn ; c3
push dx ; 52
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00009h ; b8 09 00
call 00590h ; e8 c0 fe
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 c1 fe
pop dx ; 5a
retn ; c3
push ax ; 50
push bx ; 53
push dx ; 52
db 08bh, 0d8h
; mov bx, ax ; 8b d8
call 005b6h ; e8 d6 fe
cmp AL, strict byte 004h ; 3c 04
jnbe short 006e6h ; 77 02
shr bx, 1 ; d1 eb
shr bx, 1 ; d1 eb
shr bx, 1 ; d1 eb
shr bx, 1 ; d1 eb
mov dx, 003d4h ; ba d4 03
db 08ah, 0e3h
; mov ah, bl ; 8a e3
mov AL, strict byte 013h ; b0 13
out DX, ax ; ef
pop dx ; 5a
pop bx ; 5b
pop ax ; 58
retn ; c3
_vga_compat_setup: ; 0xc06f8 LB 0xf0
push ax ; 50
push dx ; 52
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00001h ; b8 01 00
call 00590h ; e8 8d fe
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 8e fe
push ax ; 50
mov dx, 003d4h ; ba d4 03
mov ax, strict word 00011h ; b8 11 00
out DX, ax ; ef
pop ax ; 58
push ax ; 50
shr ax, 1 ; d1 e8
shr ax, 1 ; d1 e8
shr ax, 1 ; d1 e8
dec ax ; 48
db 08ah, 0e0h
; mov ah, al ; 8a e0
mov AL, strict byte 001h ; b0 01
out DX, ax ; ef
pop ax ; 58
call 006d8h ; e8 b5 ff
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00002h ; b8 02 00
call 00590h ; e8 64 fe
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 65 fe
dec ax ; 48
push ax ; 50
mov dx, 003d4h ; ba d4 03
db 08ah, 0e0h
; mov ah, al ; 8a e0
mov AL, strict byte 012h ; b0 12
out DX, ax ; ef
pop ax ; 58
mov AL, strict byte 007h ; b0 07
out DX, AL ; ee
inc dx ; 42
in AL, DX ; ec
and AL, strict byte 0bdh ; 24 bd
test ah, 001h ; f6 c4 01
je short 0074bh ; 74 02
or AL, strict byte 002h ; 0c 02
test ah, 002h ; f6 c4 02
je short 00752h ; 74 02
or AL, strict byte 040h ; 0c 40
out DX, AL ; ee
mov dx, 003d4h ; ba d4 03
mov ax, strict word 00009h ; b8 09 00
out DX, AL ; ee
mov dx, 003d5h ; ba d5 03
in AL, DX ; ec
and AL, strict byte 060h ; 24 60
out DX, AL ; ee
mov dx, 003d4h ; ba d4 03
mov AL, strict byte 017h ; b0 17
out DX, AL ; ee
mov dx, 003d5h ; ba d5 03
in AL, DX ; ec
or AL, strict byte 003h ; 0c 03
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 010h ; b0 10
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
or AL, strict byte 001h ; 0c 01
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003ceh ; ba ce 03
mov ax, 00506h ; b8 06 05
out DX, ax ; ef
mov dx, 003c4h ; ba c4 03
mov ax, 00f02h ; b8 02 0f
out DX, ax ; ef
mov dx, 001ceh ; ba ce 01
mov ax, strict word 00003h ; b8 03 00
call 00590h ; e8 f4 fd
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 f5 fd
cmp AL, strict byte 008h ; 3c 08
jc short 007e6h ; 72 40
mov dx, 003d4h ; ba d4 03
mov AL, strict byte 014h ; b0 14
out DX, AL ; ee
mov dx, 003d5h ; ba d5 03
in AL, DX ; ec
or AL, strict byte 040h ; 0c 40
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
mov dx, 003c0h ; ba c0 03
mov AL, strict byte 010h ; b0 10
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
or AL, strict byte 040h ; 0c 40
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
out DX, AL ; ee
mov dx, 003c4h ; ba c4 03
mov AL, strict byte 004h ; b0 04
out DX, AL ; ee
mov dx, 003c5h ; ba c5 03
in AL, DX ; ec
or AL, strict byte 008h ; 0c 08
out DX, AL ; ee
mov dx, 003ceh ; ba ce 03
mov AL, strict byte 005h ; b0 05
out DX, AL ; ee
mov dx, 003cfh ; ba cf 03
in AL, DX ; ec
and AL, strict byte 09fh ; 24 9f
or AL, strict byte 040h ; 0c 40
out DX, AL ; ee
pop dx ; 5a
pop ax ; 58
_vbe_has_vbe_display: ; 0xc07e8 LB 0x13
push DS ; 1e
push bx ; 53
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
mov bx, 000b9h ; bb b9 00
mov al, byte [bx] ; 8a 07
and AL, strict byte 001h ; 24 01
db 032h, 0e4h
; xor ah, ah ; 32 e4
pop bx ; 5b
pop DS ; 1f
retn ; c3
vbe_biosfn_return_current_mode: ; 0xc07fb LB 0x25
push DS ; 1e
mov ax, strict word 00040h ; b8 40 00
mov ds, ax ; 8e d8
call 00614h ; e8 10 fe
and ax, strict byte 00001h ; 83 e0 01
je short 00812h ; 74 09
mov bx, 000bah ; bb ba 00
mov ax, word [bx] ; 8b 07
db 08bh, 0d8h
; mov bx, ax ; 8b d8
jne short 0081bh ; 75 09
mov bx, strict word 00049h ; bb 49 00
mov al, byte [bx] ; 8a 07
db 08ah, 0d8h
; mov bl, al ; 8a d8
db 032h, 0ffh
; xor bh, bh ; 32 ff
mov ax, strict word 0004fh ; b8 4f 00
pop DS ; 1f
retn ; c3
vbe_biosfn_display_window_control: ; 0xc0820 LB 0x2d
cmp bl, 000h ; 80 fb 00
jne short 00849h ; 75 24
cmp bh, 001h ; 80 ff 01
je short 00840h ; 74 16
jc short 00830h ; 72 04
mov ax, 00100h ; b8 00 01
retn ; c3
db 08bh, 0c2h
; mov ax, dx ; 8b c2
call 00626h ; e8 f1 fd
call 0063ah ; e8 02 fe
db 03bh, 0c2h
; cmp ax, dx ; 3b c2
jne short 00849h ; 75 0d
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
call 0063ah ; e8 f7 fd
db 08bh, 0d0h
; mov dx, ax ; 8b d0
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
mov ax, 0014fh ; b8 4f 01
retn ; c3
vbe_biosfn_set_get_display_start: ; 0xc084d LB 0x34
cmp bl, 080h ; 80 fb 80
je short 0085dh ; 74 0b
cmp bl, 001h ; 80 fb 01
je short 00871h ; 74 1a
jc short 00863h ; 72 0a
mov ax, 00100h ; b8 00 01
retn ; c3
call 005a9h ; e8 49 fd
call 0059ch ; e8 39 fd
db 08bh, 0c1h
; mov ax, cx ; 8b c1
call 0068ch ; e8 24 fe
db 08bh, 0c2h
; mov ax, dx ; 8b c2
call 006b2h ; e8 45 fe
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
call 006a0h ; e8 2c fe
db 08bh, 0c8h
; mov cx, ax ; 8b c8
call 006c6h ; e8 4d fe
db 08bh, 0d0h
; mov dx, ax ; 8b d0
db 032h, 0ffh
; xor bh, bh ; 32 ff
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
vbe_biosfn_set_get_dac_palette_format: ; 0xc0881 LB 0x37
cmp bl, 001h ; 80 fb 01
je short 008a4h ; 74 1e
jc short 0088ch ; 72 04
mov ax, 00100h ; b8 00 01
retn ; c3
call 00614h ; e8 85 fd
cmp bh, 006h ; 80 ff 06
je short 0089eh ; 74 0a
cmp bh, 008h ; 80 ff 08
jne short 008b4h ; 75 1b
or ax, strict byte 00020h ; 83 c8 20
jne short 008a1h ; 75 03
and ax, strict byte 0ffdfh ; 83 e0 df
call 00600h ; e8 5c fd
mov BH, strict byte 006h ; b7 06
call 00614h ; e8 6b fd
and ax, strict byte 00020h ; 83 e0 20
je short 008b0h ; 74 02
mov BH, strict byte 008h ; b7 08
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
mov ax, 0014fh ; b8 4f 01
retn ; c3
vbe_biosfn_set_get_palette_data: ; 0xc08b8 LB 0x73
test bl, bl ; 84 db
je short 008cbh ; 74 0f
cmp bl, 001h ; 80 fb 01
je short 008f9h ; 74 38
cmp bl, 003h ; 80 fb 03
jbe short 00927h ; 76 61
cmp bl, 080h ; 80 fb 80
jne short 00923h ; 75 58
push ax ; 50
push cx ; 51
push dx ; 52
push bx ; 53
push sp ; 54
push bp ; 55
push si ; 56
push di ; 57
push DS ; 1e
push ES ; 06
pop DS ; 1f
db 08ah, 0c2h
; mov al, dl ; 8a c2
mov dx, 003c8h ; ba c8 03
out DX, AL ; ee
inc dx ; 42
db 08bh, 0f7h
; mov si, di ; 8b f7
lodsw ; ad
db 08bh, 0d8h
; mov bx, ax ; 8b d8
lodsw ; ad
out DX, AL ; ee
db 08ah, 0c7h
; mov al, bh ; 8a c7
out DX, AL ; ee
db 08ah, 0c3h
; mov al, bl ; 8a c3
out DX, AL ; ee
loop 008dfh ; e2 f3
pop DS ; 1f
pop di ; 5f
pop si ; 5e
pop bp ; 5d
pop bx ; 5b
pop bx ; 5b
pop dx ; 5a
pop cx ; 59
pop ax ; 58
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
push ax ; 50
push cx ; 51
push dx ; 52
push bx ; 53
push sp ; 54
push bp ; 55
push si ; 56
push di ; 57
db 08ah, 0c2h
; mov al, dl ; 8a c2
mov dx, 003c7h ; ba c7 03
out DX, AL ; ee
add dl, 002h ; 80 c2 02
db 033h, 0dbh
; xor bx, bx ; 33 db
in AL, DX ; ec
db 08ah, 0d8h
; mov bl, al ; 8a d8
in AL, DX ; ec
db 08ah, 0e0h
; mov ah, al ; 8a e0
in AL, DX ; ec
stosw ; ab
db 08bh, 0c3h
; mov ax, bx ; 8b c3
stosw ; ab
loop 0090ch ; e2 f3
pop di ; 5f
pop si ; 5e
pop bp ; 5d
pop bx ; 5b
pop bx ; 5b
pop dx ; 5a
pop cx ; 59
pop ax ; 58
jmp short 008f5h ; eb d2
mov ax, 0014fh ; b8 4f 01
retn ; c3
mov ax, 0024fh ; b8 4f 02
retn ; c3
vbe_biosfn_return_protected_mode_interface: ; 0xc092b LB 0x17
test bl, bl ; 84 db
jne short 0093eh ; 75 0f
mov di, 0c000h ; bf 00 c0
mov es, di ; 8e c7
mov di, 04400h ; bf 00 44
mov cx, 00115h ; b9 15 01
mov ax, strict word 0004fh ; b8 4f 00
retn ; c3
mov ax, 0014fh ; b8 4f 01
retn ; c3
; Padding 0xbe bytes at 0xc0942
times 190 db 0
section _TEXT progbits vstart=0xa00 align=1 ; size=0x32df class=CODE group=AUTO
set_int_vector_: ; 0xc0a00 LB 0x1c
push bx ; 53
push bp ; 55
mov bp, sp ; 89 e5
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
sal bx, 1 ; d1 e3
sal bx, 1 ; d1 e3
xor ax, ax ; 31 c0
mov es, ax ; 8e c0
mov word [es:bx], dx ; 26 89 17
mov word [es:bx+002h], 0c000h ; 26 c7 47 02 00 c0
pop bp ; 5d
pop bx ; 5b
retn ; c3
init_vga_card_: ; 0xc0a1c LB 0x1c
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov AL, strict byte 0c3h ; b0 c3
mov dx, 003c2h ; ba c2 03
out DX, AL ; ee
mov AL, strict byte 004h ; b0 04
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov AL, strict byte 002h ; b0 02
mov dx, 003c5h ; ba c5 03
out DX, AL ; ee
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
init_bios_area_: ; 0xc0a38 LB 0x32
push bx ; 53
push bp ; 55
mov bp, sp ; 89 e5
xor bx, bx ; 31 db
mov ax, strict word 00040h ; b8 40 00
mov es, ax ; 8e c0
mov al, byte [es:bx+010h] ; 26 8a 47 10
and AL, strict byte 0cfh ; 24 cf
or AL, strict byte 020h ; 0c 20
mov byte [es:bx+010h], al ; 26 88 47 10
mov byte [es:bx+00085h], 010h ; 26 c6 87 85 00 10
mov word [es:bx+00087h], 0f960h ; 26 c7 87 87 00 60 f9
mov byte [es:bx+00089h], 051h ; 26 c6 87 89 00 51
mov byte [es:bx+065h], 009h ; 26 c6 47 65 09
pop bp ; 5d
pop bx ; 5b
retn ; c3
_vgabios_init_func: ; 0xc0a6a LB 0x22
inc bp ; 45
push bp ; 55
mov bp, sp ; 89 e5
call 00a1ch ; e8 ab ff
call 00a38h ; e8 c4 ff
call 0371ah ; e8 a3 2c
mov dx, strict word 00022h ; ba 22 00
mov ax, strict word 00010h ; b8 10 00
call 00a00h ; e8 80 ff
mov ax, strict word 00003h ; b8 03 00
db 032h, 0e4h
; xor ah, ah ; 32 e4
int 010h ; cd 10
mov sp, bp ; 89 ec
pop bp ; 5d
dec bp ; 4d
retf ; cb
vga_get_cursor_pos_: ; 0xc0a8c LB 0x46
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
mov cl, al ; 88 c1
mov si, dx ; 89 d6
cmp AL, strict byte 007h ; 3c 07
jbe short 00aa7h ; 76 0e
push SS ; 16
pop ES ; 07
mov word [es:si], strict word 00000h ; 26 c7 04 00 00
mov word [es:bx], strict word 00000h ; 26 c7 07 00 00
jmp short 00acbh ; eb 24
mov dx, strict word 00060h ; ba 60 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 2a 27
push SS ; 16
pop ES ; 07
mov word [es:si], ax ; 26 89 04
mov al, cl ; 88 c8
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
sal dx, 1 ; d1 e2
add dx, strict byte 00050h ; 83 c2 50
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 14 27
push SS ; 16
pop ES ; 07
mov word [es:bx], ax ; 26 89 07
lea sp, [bp-004h] ; 8d 66 fc
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
vga_read_char_attr_: ; 0xc0ad2 LB 0xaf
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 ch, al ; 88 c5
mov si, dx ; 89 d6
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 d5 26
xor ah, ah ; 30 e4
call 03193h ; e8 a5 26
mov cl, al ; 88 c1
cmp AL, strict byte 0ffh ; 3c ff
je short 00b68h ; 74 74
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
lea bx, [bp-012h] ; 8d 5e ee
lea dx, [bp-010h] ; 8d 56 f0
call 00a8ch ; e8 8b ff
mov al, byte [bp-012h] ; 8a 46 ee
mov byte [bp-00ah], al ; 88 46 f6
mov ax, word [bp-012h] ; 8b 46 ee
mov al, ah ; 88 e0
xor ah, ah ; 30 e4
mov word [bp-00eh], ax ; 89 46 f2
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 a4 26
xor ah, ah ; 30 e4
inc ax ; 40
mov word [bp-00ch], ax ; 89 46 f4
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 b1 26
mov di, ax ; 89 c7
mov bl, cl ; 88 cb
xor bh, bh ; 30 ff
mov CL, strict byte 003h ; b1 03
sal bx, CL ; d3 e3
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
jne short 00b68h ; 75 2e
mul word [bp-00ch] ; f7 66 f4
sal ax, 1 ; d1 e0
or AL, strict byte 0ffh ; 0c ff
mov cl, ch ; 88 e9
xor ch, ch ; 30 ed
inc ax ; 40
mul cx ; f7 e1
mov cx, ax ; 89 c1
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
mul di ; f7 e7
mov dx, ax ; 89 c2
mov al, byte [bp-00ah] ; 8a 46 f6
xor ah, ah ; 30 e4
add dx, ax ; 01 c2
sal dx, 1 ; d1 e2
add dx, cx ; 01 ca
mov ax, word [bx+04633h] ; 8b 87 33 46
call 031dah ; e8 75 26
mov word [ss:si], ax ; 36 89 04
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
xchg si, ax ; 96
db 00bh, 0d4h
; or dx, sp ; 0b d4
db 00bh, 0d9h
; or bx, cx ; 0b d9
db 00bh, 0e1h
; or sp, cx ; 0b e1
db 00bh, 0e6h
; or sp, si ; 0b e6
db 00bh, 0ebh
; or bp, bx ; 0b eb
db 00bh, 0f0h
; or si, ax ; 0b f0
db 00bh, 0f5h
; or si, bp ; 0b f5
db 00bh
vga_get_font_info_: ; 0xc0b81 LB 0x7b
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
mov si, dx ; 89 d6
cmp ax, strict word 00007h ; 3d 07 00
jnbe short 00bcbh ; 77 3e
mov di, ax ; 89 c7
sal di, 1 ; d1 e7
jmp word [cs:di+00b71h] ; 2e ff a5 71 0b
mov dx, strict word 0007ch ; ba 7c 00
xor ax, ax ; 31 c0
call 031f6h ; e8 58 26
push SS ; 16
pop ES ; 07
mov word [es:bx], ax ; 26 89 07
mov word [es:si], dx ; 26 89 14
mov dx, 00085h ; ba 85 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 0f 26
xor ah, ah ; 30 e4
push SS ; 16
pop ES ; 07
mov bx, cx ; 89 cb
mov word [es:bx], ax ; 26 89 07
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 fd 25
xor ah, ah ; 30 e4
push SS ; 16
pop ES ; 07
mov bx, word [bp+004h] ; 8b 5e 04
mov word [es:bx], ax ; 26 89 07
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00002h ; c2 02 00
mov dx, 0010ch ; ba 0c 01
jmp short 00b99h ; eb c0
mov ax, 05bedh ; b8 ed 5b
mov dx, 0c000h ; ba 00 c0
jmp short 00b9eh ; eb bd
mov ax, 053edh ; b8 ed 53
jmp short 00bdch ; eb f6
mov ax, 057edh ; b8 ed 57
jmp short 00bdch ; eb f1
mov ax, 079edh ; b8 ed 79
jmp short 00bdch ; eb ec
mov ax, 069edh ; b8 ed 69
jmp short 00bdch ; eb e7
mov ax, 07b1ah ; b8 1a 7b
jmp short 00bdch ; eb e2
jmp short 00bcbh ; eb cf
vga_read_pixel_: ; 0xc0bfc LB 0x143
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00006h ; 83 ec 06
mov si, dx ; 89 d6
mov word [bp-00ah], bx ; 89 5e f6
mov di, cx ; 89 cf
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 aa 25
xor ah, ah ; 30 e4
call 03193h ; e8 7a 25
mov ch, al ; 88 c5
cmp AL, strict byte 0ffh ; 3c ff
je short 00c2eh ; 74 0f
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
mov CL, strict byte 003h ; b1 03
sal bx, CL ; d3 e3
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
jne short 00c31h ; 75 03
jmp near 00d38h ; e9 07 01
mov bl, byte [bx+04631h] ; 8a 9f 31 46
cmp bl, cl ; 38 cb
jc short 00c48h ; 72 0f
jbe short 00c50h ; 76 15
cmp bl, 005h ; 80 fb 05
je short 00ca8h ; 74 68
cmp bl, 004h ; 80 fb 04
je short 00c50h ; 74 0b
jmp near 00d33h ; e9 eb 00
cmp bl, 002h ; 80 fb 02
je short 00cadh ; 74 60
jmp near 00d33h ; e9 e3 00
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 81 25
mov bx, ax ; 89 c3
mov ax, word [bp-00ah] ; 8b 46 f6
mul bx ; f7 e3
mov CL, strict byte 003h ; b1 03
mov bx, si ; 89 f3
shr bx, CL ; d3 eb
add bx, ax ; 01 c3
mov cx, si ; 89 f1
and cx, strict byte 00007h ; 83 e1 07
mov ax, 00080h ; b8 80 00
sar ax, CL ; d3 f8
mov byte [bp-008h], al ; 88 46 f8
mov byte [bp-006h], ch ; 88 6e fa
jmp short 00c80h ; eb 06
cmp byte [bp-006h], 004h ; 80 7e fa 04
jnc short 00caah ; 73 2a
mov ah, byte [bp-006h] ; 8a 66 fa
xor al, al ; 30 c0
or AL, strict byte 004h ; 0c 04
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov dx, bx ; 89 da
mov ax, 0a000h ; b8 00 a0
call 031beh ; e8 2b 25
and al, byte [bp-008h] ; 22 46 f8
test al, al ; 84 c0
jbe short 00ca3h ; 76 09
mov cl, byte [bp-006h] ; 8a 4e fa
mov AL, strict byte 001h ; b0 01
sal al, CL ; d2 e0
or ch, al ; 08 c5
inc byte [bp-006h] ; fe 46 fa
jmp short 00c7ah ; eb d2
jmp short 00d13h ; eb 69
jmp near 00d35h ; e9 88 00
mov ax, word [bp-00ah] ; 8b 46 f6
shr ax, 1 ; d1 e8
mov bx, strict word 00050h ; bb 50 00
mul bx ; f7 e3
mov bx, si ; 89 f3
shr bx, 1 ; d1 eb
shr bx, 1 ; d1 eb
add bx, ax ; 01 c3
test byte [bp-00ah], 001h ; f6 46 f6 01
je short 00cc8h ; 74 03
add bh, 020h ; 80 c7 20
mov dx, bx ; 89 da
mov ax, 0b800h ; b8 00 b8
call 031beh ; e8 ee 24
mov bl, ch ; 88 eb
xor bh, bh ; 30 ff
mov CL, strict byte 003h ; b1 03
sal bx, CL ; d3 e3
cmp byte [bx+04632h], 002h ; 80 bf 32 46 02
jne short 00cfah ; 75 1b
mov cx, si ; 89 f1
xor ch, ch ; 30 ed
and cl, 003h ; 80 e1 03
mov bx, strict word 00003h ; bb 03 00
sub bx, cx ; 29 cb
mov cx, bx ; 89 d9
sal cx, 1 ; d1 e1
xor ah, ah ; 30 e4
sar ax, CL ; d3 f8
mov ch, al ; 88 c5
and ch, 003h ; 80 e5 03
jmp short 00d35h ; eb 3b
mov cx, si ; 89 f1
xor ch, ch ; 30 ed
and cl, 007h ; 80 e1 07
mov bx, strict word 00007h ; bb 07 00
sub bx, cx ; 29 cb
mov cx, bx ; 89 d9
xor ah, ah ; 30 e4
sar ax, CL ; d3 f8
mov ch, al ; 88 c5
and ch, 001h ; 80 e5 01
jmp short 00d35h ; eb 22
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 be 24
mov bx, ax ; 89 c3
sal bx, CL ; d3 e3
mov ax, word [bp-00ah] ; 8b 46 f6
mul bx ; f7 e3
mov dx, si ; 89 f2
add dx, ax ; 01 c2
mov ax, 0a000h ; b8 00 a0
call 031beh ; e8 8f 24
mov ch, al ; 88 c5
jmp short 00d35h ; eb 02
xor ch, ch ; 30 ed
mov byte [ss:di], ch ; 36 88 2d
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
biosfn_perform_gray_scale_summing_: ; 0xc0d3f LB 0x9f
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov bx, ax ; 89 c3
mov di, dx ; 89 d7
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor al, al ; 30 c0
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
xor si, si ; 31 f6
cmp si, di ; 39 fe
jnc short 00dc3h ; 73 65
mov al, bl ; 88 d8
mov dx, 003c7h ; ba c7 03
out DX, AL ; ee
mov dx, 003c9h ; ba c9 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov cx, ax ; 89 c1
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-00ah], ax ; 89 46 f6
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-00ch], ax ; 89 46 f4
mov al, cl ; 88 c8
xor ah, ah ; 30 e4
mov cx, strict word 0004dh ; b9 4d 00
imul cx ; f7 e9
mov cx, ax ; 89 c1
mov al, byte [bp-00ah] ; 8a 46 f6
xor ah, ah ; 30 e4
mov dx, 00097h ; ba 97 00
imul dx ; f7 ea
add cx, ax ; 01 c1
mov word [bp-00ah], cx ; 89 4e f6
mov cl, byte [bp-00ch] ; 8a 4e f4
xor ch, ch ; 30 ed
mov ax, cx ; 89 c8
mov dx, strict word 0001ch ; ba 1c 00
imul dx ; f7 ea
add ax, word [bp-00ah] ; 03 46 f6
add ax, 00080h ; 05 80 00
mov al, ah ; 88 e0
cbw ; 98
mov cx, ax ; 89 c1
cmp ax, strict word 0003fh ; 3d 3f 00
jbe short 00db1h ; 76 03
mov cx, strict word 0003fh ; b9 3f 00
mov al, bl ; 88 d8
mov dx, 003c8h ; ba c8 03
out DX, AL ; ee
mov al, cl ; 88 c8
mov dx, 003c9h ; ba c9 03
out DX, AL ; ee
out DX, AL ; ee
out DX, AL ; ee
inc bx ; 43
inc si ; 46
jmp short 00d5ah ; eb 97
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov AL, strict byte 020h ; b0 20
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_set_cursor_shape_: ; 0xc0dde LB 0xb3
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov byte [bp-00ah], al ; 88 46 f6
mov ch, dl ; 88 d5
and byte [bp-00ah], 03fh ; 80 66 f6 3f
and ch, 01fh ; 80 e5 1f
mov al, byte [bp-00ah] ; 8a 46 f6
xor ah, ah ; 30 e4
mov word [bp-00ch], ax ; 89 46 f4
mov bh, byte [bp-00ch] ; 8a 7e f4
mov al, ch ; 88 e8
mov si, ax ; 89 c6
mov bl, ch ; 88 eb
mov dx, strict word 00060h ; ba 60 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 db 23
mov dx, 00089h ; ba 89 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 a8 23
mov cl, al ; 88 c1
mov dx, 00085h ; ba 85 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 b9 23
mov bx, ax ; 89 c3
mov di, ax ; 89 c7
test cl, 001h ; f6 c1 01
je short 00e65h ; 74 3b
cmp ax, strict word 00008h ; 3d 08 00
jbe short 00e65h ; 76 36
cmp ch, 008h ; 80 fd 08
jnc short 00e65h ; 73 31
cmp byte [bp-00ah], 020h ; 80 7e f6 20
jnc short 00e65h ; 73 2b
mov ax, word [bp-00ch] ; 8b 46 f4
inc ax ; 40
cmp si, ax ; 39 c6
je short 00e4bh ; 74 09
mul bx ; f7 e3
mov CL, strict byte 003h ; b1 03
shr ax, CL ; d3 e8
dec ax ; 48
jmp short 00e54h ; eb 09
inc ax ; 40
mul bx ; f7 e3
mov CL, strict byte 003h ; b1 03
shr ax, CL ; d3 e8
dec ax ; 48
dec ax ; 48
mov byte [bp-00ah], al ; 88 46 f6
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
inc ax ; 40
mul di ; f7 e7
mov CL, strict byte 003h ; b1 03
shr ax, CL ; d3 e8
dec ax ; 48
mov ch, al ; 88 c5
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 6c 23
mov bx, ax ; 89 c3
mov AL, strict byte 00ah ; b0 0a
mov dx, bx ; 89 da
out DX, AL ; ee
lea si, [bx+001h] ; 8d 77 01
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, si ; 89 f2
out DX, AL ; ee
mov AL, strict byte 00bh ; b0 0b
mov dx, bx ; 89 da
out DX, AL ; ee
mov al, ch ; 88 e8
mov dx, si ; 89 f2
out DX, AL ; ee
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_set_cursor_pos_: ; 0xc0e91 LB 0xa3
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push ax ; 50
mov byte [bp-008h], al ; 88 46 f8
mov cx, dx ; 89 d1
cmp AL, strict byte 007h ; 3c 07
jbe short 00ea4h ; 76 03
jmp near 00f2ch ; e9 88 00
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
sal dx, 1 ; d1 e2
add dx, strict byte 00050h ; 83 c2 50
mov bx, cx ; 89 cb
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 33 23
mov dx, strict word 00062h ; ba 62 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 00 23
cmp al, byte [bp-008h] ; 3a 46 f8
jne short 00f2ch ; 75 69
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 0e 23
mov bx, ax ; 89 c3
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 e7 22
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
inc dx ; 42
mov ax, bx ; 89 d8
mul dx ; f7 e2
or AL, strict byte 0ffh ; 0c ff
mov dx, ax ; 89 c2
mov al, byte [bp-008h] ; 8a 46 f8
xor ah, ah ; 30 e4
mov si, ax ; 89 c6
mov ax, dx ; 89 d0
inc ax ; 40
mul si ; f7 e6
mov dl, cl ; 88 ca
xor dh, dh ; 30 f6
mov si, ax ; 89 c6
add si, dx ; 01 d6
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
mul bx ; f7 e3
add si, ax ; 01 c6
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 d1 22
mov bx, ax ; 89 c3
mov AL, strict byte 00eh ; b0 0e
mov dx, bx ; 89 da
out DX, AL ; ee
mov cx, si ; 89 f1
mov cl, ch ; 88 e9
xor ch, ch ; 30 ed
mov ax, cx ; 89 c8
lea cx, [bx+001h] ; 8d 4f 01
mov dx, cx ; 89 ca
out DX, AL ; ee
mov AL, strict byte 00fh ; b0 0f
mov dx, bx ; 89 da
out DX, AL ; ee
and si, 000ffh ; 81 e6 ff 00
mov ax, si ; 89 f0
mov dx, cx ; 89 ca
out DX, AL ; ee
lea sp, [bp-006h] ; 8d 66 fa
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_set_active_page_: ; 0xc0f34 LB 0xe5
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 ch, al ; 88 c5
cmp AL, strict byte 007h ; 3c 07
jnbe short 00f58h ; 77 14
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 71 22
xor ah, ah ; 30 e4
call 03193h ; e8 41 22
mov cl, al ; 88 c1
cmp AL, strict byte 0ffh ; 3c ff
jne short 00f5bh ; 75 03
jmp near 0100fh ; e9 b4 00
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
lea bx, [bp-00eh] ; 8d 5e f2
lea dx, [bp-00ch] ; 8d 56 f4
call 00a8ch ; e8 24 fb
mov bl, cl ; 88 cb
xor bh, bh ; 30 ff
mov CL, strict byte 003h ; b1 03
mov si, bx ; 89 de
sal si, CL ; d3 e6
cmp byte [si+04630h], 000h ; 80 bc 30 46 00
jne short 00fc0h ; 75 47
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 58 22
mov bx, ax ; 89 c3
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 31 22
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
inc dx ; 42
mov ax, bx ; 89 d8
mul dx ; f7 e2
mov si, ax ; 89 c6
mov dx, ax ; 89 c2
sal dx, 1 ; d1 e2
or dl, 0ffh ; 80 ca ff
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
mov di, ax ; 89 c7
mov ax, dx ; 89 d0
inc ax ; 40
mul di ; f7 e7
mov bx, ax ; 89 c3
mov dx, strict word 0004eh ; ba 4e 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 33 22
or si, 000ffh ; 81 ce ff 00
lea ax, [si+001h] ; 8d 44 01
mul di ; f7 e7
jmp short 00fd0h ; eb 10
mov bl, byte [bx+046afh] ; 8a 9f af 46
mov CL, strict byte 006h ; b1 06
sal bx, CL ; d3 e3
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
mul word [bx+046c6h] ; f7 a7 c6 46
mov bx, ax ; 89 c3
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 ff 21
mov si, ax ; 89 c6
mov AL, strict byte 00ch ; b0 0c
mov dx, si ; 89 f2
out DX, AL ; ee
mov ax, bx ; 89 d8
mov al, bh ; 88 f8
lea di, [si+001h] ; 8d 7c 01
mov dx, di ; 89 fa
out DX, AL ; ee
mov AL, strict byte 00dh ; b0 0d
mov dx, si ; 89 f2
out DX, AL ; ee
mov al, bl ; 88 d8
mov dx, di ; 89 fa
out DX, AL ; ee
mov al, ch ; 88 e8
xor ah, bh ; 30 fc
mov si, ax ; 89 c6
mov bx, ax ; 89 c3
mov dx, strict word 00062h ; ba 62 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 c5 21
mov dx, word [bp-00eh] ; 8b 56 f2
mov ax, si ; 89 f0
call 00e91h ; e8 82 fe
lea sp, [bp-00ah] ; 8d 66 f6
pop di ; 5f
pop si ; 5e
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_set_video_mode_: ; 0xc1019 LB 0x3ea
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 00014h ; 83 ec 14
mov byte [bp-00ch], al ; 88 46 f4
and AL, strict byte 080h ; 24 80
mov byte [bp-012h], al ; 88 46 ee
call 007e8h ; e8 b9 f7
test ax, ax ; 85 c0
je short 0103fh ; 74 0c
mov AL, strict byte 007h ; b0 07
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
xor al, al ; 30 c0
mov dx, 003c5h ; ba c5 03
out DX, AL ; ee
and byte [bp-00ch], 07fh ; 80 66 f4 7f
cmp byte [bp-00ch], 007h ; 80 7e f4 07
jne short 0104dh ; 75 04
mov byte [bp-00ch], 000h ; c6 46 f4 00
mov al, byte [bp-00ch] ; 8a 46 f4
xor ah, ah ; 30 e4
call 03193h ; e8 3e 21
mov byte [bp-010h], al ; 88 46 f0
cmp AL, strict byte 0ffh ; 3c ff
jne short 0105fh ; 75 03
jmp near 013f9h ; e9 9a 03
mov byte [bp-014h], al ; 88 46 ec
mov byte [bp-013h], 000h ; c6 46 ed 00
mov bx, word [bp-014h] ; 8b 5e ec
mov al, byte [bx+046afh] ; 8a 87 af 46
mov byte [bp-00eh], al ; 88 46 f2
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
mov CL, strict byte 006h ; b1 06
sal bx, CL ; d3 e3
mov al, byte [bx+046c3h] ; 8a 87 c3 46
xor ah, ah ; 30 e4
mov word [bp-016h], ax ; 89 46 ea
mov al, byte [bx+046c4h] ; 8a 87 c4 46
mov word [bp-01ch], ax ; 89 46 e4
mov al, byte [bx+046c5h] ; 8a 87 c5 46
mov word [bp-018h], ax ; 89 46 e8
mov dx, 00087h ; ba 87 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 26 21
mov dx, 00088h ; ba 88 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 1d 21
mov dx, 00089h ; ba 89 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 14 21
mov ch, al ; 88 c5
test AL, strict byte 008h ; a8 08
jne short 010f5h ; 75 45
mov CL, strict byte 003h ; b1 03
mov bx, word [bp-014h] ; 8b 5e ec
sal bx, CL ; d3 e3
mov al, byte [bx+04635h] ; 8a 87 35 46
mov dx, 003c6h ; ba c6 03
out DX, AL ; ee
xor al, al ; 30 c0
mov dx, 003c8h ; ba c8 03
out DX, AL ; ee
mov bl, byte [bx+04636h] ; 8a 9f 36 46
cmp bl, 001h ; 80 fb 01
jc short 010dbh ; 72 0d
jbe short 010e4h ; 76 14
cmp bl, cl ; 38 cb
je short 010eeh ; 74 1a
cmp bl, 002h ; 80 fb 02
je short 010e9h ; 74 10
jmp short 010f1h ; eb 16
test bl, bl ; 84 db
jne short 010f1h ; 75 12
mov di, 04e43h ; bf 43 4e
jmp short 010f1h ; eb 0d
mov di, 04f03h ; bf 03 4f
jmp short 010f1h ; eb 08
mov di, 04fc3h ; bf c3 4f
jmp short 010f1h ; eb 03
mov di, 05083h ; bf 83 50
xor bx, bx ; 31 db
jmp short 010fdh ; eb 08
jmp short 01149h ; eb 52
cmp bx, 00100h ; 81 fb 00 01
jnc short 0113ch ; 73 3f
mov al, byte [bp-010h] ; 8a 46 f0
xor ah, ah ; 30 e4
mov CL, strict byte 003h ; b1 03
mov si, ax ; 89 c6
sal si, CL ; d3 e6
mov al, byte [si+04636h] ; 8a 84 36 46
mov si, ax ; 89 c6
mov al, byte [si+046bfh] ; 8a 84 bf 46
cmp bx, ax ; 39 c3
jnbe short 01131h ; 77 1b
mov ax, bx ; 89 d8
mov dx, strict word 00003h ; ba 03 00
mul dx ; f7 e2
mov si, di ; 89 fe
add si, ax ; 01 c6
mov al, byte [si] ; 8a 04
mov dx, 003c9h ; ba c9 03
out DX, AL ; ee
mov al, byte [si+001h] ; 8a 44 01
out DX, AL ; ee
mov al, byte [si+002h] ; 8a 44 02
out DX, AL ; ee
jmp short 01139h ; eb 08
xor al, al ; 30 c0
mov dx, 003c9h ; ba c9 03
out DX, AL ; ee
out DX, AL ; ee
out DX, AL ; ee
inc bx ; 43
jmp short 010f7h ; eb bb
test ch, 002h ; f6 c5 02
je short 01149h ; 74 08
mov dx, 00100h ; ba 00 01
xor ax, ax ; 31 c0
call 00d3fh ; e8 f6 fb
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor bx, bx ; 31 db
jmp short 01158h ; eb 05
cmp bx, strict byte 00013h ; 83 fb 13
jnbe short 01173h ; 77 1b
mov al, bl ; 88 d8
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
mov CL, strict byte 006h ; b1 06
mov si, ax ; 89 c6
sal si, CL ; d3 e6
add si, bx ; 01 de
mov al, byte [si+046e6h] ; 8a 84 e6 46
out DX, AL ; ee
inc bx ; 43
jmp short 01153h ; eb e0
mov AL, strict byte 014h ; b0 14
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
xor al, al ; 30 c0
out DX, AL ; ee
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov AL, strict byte 003h ; b0 03
mov dx, 003c5h ; ba c5 03
out DX, AL ; ee
mov bx, strict word 00001h ; bb 01 00
jmp short 01190h ; eb 05
cmp bx, strict byte 00004h ; 83 fb 04
jnbe short 011aeh ; 77 1e
mov al, bl ; 88 d8
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
mov CL, strict byte 006h ; b1 06
mov si, ax ; 89 c6
sal si, CL ; d3 e6
add si, bx ; 01 de
mov al, byte [si+046c7h] ; 8a 84 c7 46
mov dx, 003c5h ; ba c5 03
out DX, AL ; ee
inc bx ; 43
jmp short 0118bh ; eb dd
xor bx, bx ; 31 db
jmp short 011b7h ; eb 05
cmp bx, strict byte 00008h ; 83 fb 08
jnbe short 011d5h ; 77 1e
mov al, bl ; 88 d8
mov dx, 003ceh ; ba ce 03
out DX, AL ; ee
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
mov CL, strict byte 006h ; b1 06
mov si, ax ; 89 c6
sal si, CL ; d3 e6
add si, bx ; 01 de
mov al, byte [si+046fah] ; 8a 84 fa 46
mov dx, 003cfh ; ba cf 03
out DX, AL ; ee
inc bx ; 43
jmp short 011b2h ; eb dd
mov bl, byte [bp-010h] ; 8a 5e f0
xor bh, bh ; 30 ff
mov CL, strict byte 003h ; b1 03
sal bx, CL ; d3 e3
cmp byte [bx+04631h], 001h ; 80 bf 31 46 01
jne short 011eah ; 75 05
mov dx, 003b4h ; ba b4 03
jmp short 011edh ; eb 03
mov dx, 003d4h ; ba d4 03
mov si, dx ; 89 d6
mov ax, strict word 00011h ; b8 11 00
out DX, ax ; ef
xor bx, bx ; 31 db
jmp short 011fch ; eb 05
cmp bx, strict byte 00018h ; 83 fb 18
jnbe short 0121bh ; 77 1f
mov al, bl ; 88 d8
mov dx, si ; 89 f2
out DX, AL ; ee
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
mov CL, strict byte 006h ; b1 06
sal ax, CL ; d3 e0
mov cx, ax ; 89 c1
mov di, ax ; 89 c7
add di, bx ; 01 df
lea dx, [si+001h] ; 8d 54 01
mov al, byte [di+046cdh] ; 8a 85 cd 46
out DX, AL ; ee
inc bx ; 43
jmp short 011f7h ; eb dc
mov bx, cx ; 89 cb
mov al, byte [bx+046cch] ; 8a 87 cc 46
mov dx, 003c2h ; ba c2 03
out DX, AL ; ee
mov AL, strict byte 020h ; b0 20
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
cmp byte [bp-012h], 000h ; 80 7e ee 00
jne short 01298h ; 75 61
mov bl, byte [bp-010h] ; 8a 5e f0
xor bh, ch ; 30 ef
mov CL, strict byte 003h ; b1 03
sal bx, CL ; d3 e3
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
jne short 0125ah ; 75 13
mov es, [bx+04633h] ; 8e 87 33 46
mov cx, 04000h ; b9 00 40
mov ax, 00720h ; b8 20 07
xor di, di ; 31 ff
cld ; fc
jcxz 01258h ; e3 02
rep stosw ; f3 ab
jmp short 01298h ; eb 3e
cmp byte [bp-00ch], 00dh ; 80 7e f4 0d
jnc short 01272h ; 73 12
mov es, [bx+04633h] ; 8e 87 33 46
mov cx, 04000h ; b9 00 40
xor ax, ax ; 31 c0
xor di, di ; 31 ff
cld ; fc
jcxz 01270h ; e3 02
rep stosw ; f3 ab
jmp short 01298h ; eb 26
mov AL, strict byte 002h ; b0 02
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov dx, 003c5h ; ba c5 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-01eh], ax ; 89 46 e2
mov AL, strict byte 00fh ; b0 0f
out DX, AL ; ee
mov es, [bx+04633h] ; 8e 87 33 46
mov cx, 08000h ; b9 00 80
xor ax, ax ; 31 c0
xor di, di ; 31 ff
cld ; fc
jcxz 01294h ; e3 02
rep stosw ; f3 ab
mov al, byte [bp-01eh] ; 8a 46 e2
out DX, AL ; ee
mov al, byte [bp-00ch] ; 8a 46 f4
mov byte [bp-01ah], al ; 88 46 e6
mov byte [bp-019h], 000h ; c6 46 e7 00
mov bx, word [bp-01ah] ; 8b 5e e6
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 1e 1f
mov bx, word [bp-016h] ; 8b 5e ea
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 2e 1f
mov bl, byte [bp-00eh] ; 8a 5e f2
xor bh, bh ; 30 ff
mov CL, strict byte 006h ; b1 06
sal bx, CL ; d3 e3
mov bx, word [bx+046c6h] ; 8b 9f c6 46
mov dx, strict word 0004ch ; ba 4c 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 18 1f
mov bx, si ; 89 f3
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 0d 1f
mov bl, byte [bp-01ch] ; 8a 5e e4
xor bh, bh ; 30 ff
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 e3 1e
mov bx, word [bp-018h] ; 8b 5e e8
mov dx, 00085h ; ba 85 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 f3 1e
mov bl, byte [bp-012h] ; 8a 5e ee
or bl, 060h ; 80 cb 60
xor bh, bh ; 30 ff
mov dx, 00087h ; ba 87 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 c6 1e
mov bx, 000f9h ; bb f9 00
mov dx, 00088h ; ba 88 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 ba 1e
mov dx, 00089h ; ba 89 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 a3 1e
mov bl, al ; 88 c3
and bl, 07fh ; 80 e3 7f
xor bh, bh ; 30 ff
mov dx, 00089h ; ba 89 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 a1 1e
mov bx, strict word 00008h ; bb 08 00
mov dx, 0008ah ; ba 8a 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 95 1e
mov cx, ds ; 8c d9
mov bx, 053d1h ; bb d1 53
mov dx, 000a8h ; ba a8 00
mov ax, strict word 00040h ; b8 40 00
call 03208h ; e8 c3 1e
cmp byte [bp-00ch], 007h ; 80 7e f4 07
jnbe short 01376h ; 77 2b
mov bx, word [bp-01ah] ; 8b 5e e6
mov bl, byte [bx+07c5eh] ; 8a 9f 5e 7c
xor bh, bh ; 30 ff
mov dx, strict word 00065h ; ba 65 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 6f 1e
cmp byte [bp-00ch], 006h ; 80 7e f4 06
jne short 01368h ; 75 05
mov bx, strict word 0003fh ; bb 3f 00
jmp short 0136bh ; eb 03
mov bx, strict word 00030h ; bb 30 00
xor bh, bh ; 30 ff
mov dx, strict word 00066h ; ba 66 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 56 1e
mov bl, byte [bp-010h] ; 8a 5e f0
xor bh, bh ; 30 ff
mov CL, strict byte 003h ; b1 03
sal bx, CL ; d3 e3
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
jne short 0138fh ; 75 09
mov dx, strict word 00007h ; ba 07 00
mov ax, strict word 00006h ; b8 06 00
call 00ddeh ; e8 4f fa
xor bx, bx ; 31 db
jmp short 01398h ; eb 05
cmp bx, strict byte 00008h ; 83 fb 08
jnc short 013a4h ; 73 0c
mov al, bl ; 88 d8
xor ah, ah ; 30 e4
xor dx, dx ; 31 d2
call 00e91h ; e8 f0 fa
inc bx ; 43
jmp short 01393h ; eb ef
xor ax, ax ; 31 c0
call 00f34h ; e8 8b fb
mov bl, byte [bp-010h] ; 8a 5e f0
xor bh, bh ; 30 ff
mov CL, strict byte 003h ; b1 03
sal bx, CL ; d3 e3
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
jne short 013c9h ; 75 10
xor bl, bl ; 30 db
mov AL, strict byte 004h ; b0 04
mov AH, strict byte 011h ; b4 11
int 010h ; cd 10
xor bl, bl ; 30 db
mov al, cl ; 88 c8
mov AH, strict byte 011h ; b4 11
int 010h ; cd 10
mov dx, 057edh ; ba ed 57
mov ax, strict word 0001fh ; b8 1f 00
call 00a00h ; e8 2e f6
mov ax, word [bp-018h] ; 8b 46 e8
cmp ax, strict word 00010h ; 3d 10 00
je short 013f4h ; 74 1a
cmp ax, strict word 0000eh ; 3d 0e 00
je short 013efh ; 74 10
cmp ax, strict word 00008h ; 3d 08 00
jne short 013f9h ; 75 15
mov dx, 053edh ; ba ed 53
mov ax, strict word 00043h ; b8 43 00
call 00a00h ; e8 13 f6
jmp short 013f9h ; eb 0a
mov dx, 05bedh ; ba ed 5b
jmp short 013e7h ; eb f3
mov dx, 069edh ; ba ed 69
jmp short 013e7h ; eb ee
lea sp, [bp-00ah] ; 8d 66 f6
pop di ; 5f
pop si ; 5e
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
vgamem_copy_pl4_: ; 0xc1403 LB 0x8f
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000ah ; 83 ec 0a
mov byte [bp-008h], al ; 88 46 f8
mov al, dl ; 88 d0
mov byte [bp-00ah], bl ; 88 5e f6
mov byte [bp-006h], cl ; 88 4e fa
xor ah, ah ; 30 e4
mov dl, byte [bp+006h] ; 8a 56 06
xor dh, dh ; 30 f6
mov cx, dx ; 89 d1
imul dx ; f7 ea
mov dl, byte [bp+004h] ; 8a 56 04
xor dh, dh ; 30 f6
mov si, dx ; 89 d6
imul dx ; f7 ea
mov dl, byte [bp-008h] ; 8a 56 f8
xor dh, dh ; 30 f6
mov bx, dx ; 89 d3
add ax, dx ; 01 d0
mov word [bp-00eh], ax ; 89 46 f2
mov al, byte [bp-00ah] ; 8a 46 f6
xor ah, ah ; 30 e4
imul cx ; f7 e9
imul si ; f7 ee
add ax, bx ; 01 d8
mov word [bp-00ch], ax ; 89 46 f4
mov ax, 00105h ; b8 05 01
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
xor bl, bl ; 30 db
cmp bl, byte [bp+006h] ; 3a 5e 06
jnc short 01482h ; 73 30
mov al, byte [bp-006h] ; 8a 46 fa
xor ah, ah ; 30 e4
mov cx, ax ; 89 c1
mov al, bl ; 88 d8
mov dx, ax ; 89 c2
mov al, byte [bp+004h] ; 8a 46 04
mov si, ax ; 89 c6
mov ax, dx ; 89 d0
imul si ; f7 ee
mov si, word [bp-00eh] ; 8b 76 f2
add si, ax ; 01 c6
mov di, word [bp-00ch] ; 8b 7e f4
add di, ax ; 01 c7
mov dx, 0a000h ; ba 00 a0
mov es, dx ; 8e c2
cld ; fc
jcxz 0147eh ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
db 0feh, 0c3h
; inc bl ; fe c3
jmp short 0144dh ; eb cb
mov ax, strict word 00005h ; b8 05 00
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
vgamem_fill_pl4_: ; 0xc1492 LB 0x7c
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00006h ; 83 ec 06
mov byte [bp-008h], al ; 88 46 f8
mov al, dl ; 88 d0
mov byte [bp-006h], bl ; 88 5e fa
mov bh, cl ; 88 cf
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
mov al, byte [bp+004h] ; 8a 46 04
mov cx, ax ; 89 c1
mov ax, dx ; 89 d0
imul cx ; f7 e9
mov dl, bh ; 88 fa
xor dh, dh ; 30 f6
imul dx ; f7 ea
mov dx, ax ; 89 c2
mov al, byte [bp-008h] ; 8a 46 f8
xor ah, ah ; 30 e4
add dx, ax ; 01 c2
mov word [bp-00ah], dx ; 89 56 f6
mov ax, 00205h ; b8 05 02
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
xor bl, bl ; 30 db
cmp bl, byte [bp+004h] ; 3a 5e 04
jnc short 014feh ; 73 2d
mov cl, byte [bp-006h] ; 8a 4e fa
xor ch, ch ; 30 ed
mov al, byte [bp+006h] ; 8a 46 06
xor ah, ah ; 30 e4
mov si, ax ; 89 c6
mov al, bl ; 88 d8
mov dx, ax ; 89 c2
mov al, bh ; 88 f8
mov di, ax ; 89 c7
mov ax, dx ; 89 d0
imul di ; f7 ef
mov di, word [bp-00ah] ; 8b 7e f6
add di, ax ; 01 c7
mov ax, si ; 89 f0
mov dx, 0a000h ; ba 00 a0
mov es, dx ; 8e c2
cld ; fc
jcxz 014fah ; e3 02
rep stosb ; f3 aa
db 0feh, 0c3h
; inc bl ; fe c3
jmp short 014cch ; eb ce
mov ax, strict word 00005h ; b8 05 00
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
vgamem_copy_cga_: ; 0xc150e LB 0xc2
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00008h ; 83 ec 08
mov byte [bp-006h], al ; 88 46 fa
mov al, dl ; 88 d0
mov bh, cl ; 88 cf
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
mov al, byte [bp+006h] ; 8a 46 06
mov cx, ax ; 89 c1
mov ax, dx ; 89 d0
imul cx ; f7 e9
mov dl, byte [bp+004h] ; 8a 56 04
xor dh, dh ; 30 f6
mov di, dx ; 89 d7
imul dx ; f7 ea
mov dx, ax ; 89 c2
sar dx, 1 ; d1 fa
mov al, byte [bp-006h] ; 8a 46 fa
xor ah, ah ; 30 e4
mov si, ax ; 89 c6
add dx, ax ; 01 c2
mov word [bp-008h], dx ; 89 56 f8
mov al, bl ; 88 d8
imul cx ; f7 e9
imul di ; f7 ef
sar ax, 1 ; d1 f8
add ax, si ; 01 f0
mov word [bp-00ah], ax ; 89 46 f6
xor bl, bl ; 30 db
cmp bl, byte [bp+006h] ; 3a 5e 06
jnc short 015c7h ; 73 70
test bl, 001h ; f6 c3 01
je short 01593h ; 74 37
mov cl, bh ; 88 f9
xor ch, ch ; 30 ed
mov al, bl ; 88 d8
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
sar dx, 1 ; d1 fa
mov al, byte [bp+004h] ; 8a 46 04
mov si, ax ; 89 c6
mov ax, dx ; 89 d0
imul si ; f7 ee
mov si, word [bp-008h] ; 8b 76 f8
add si, 02000h ; 81 c6 00 20
add si, ax ; 01 c6
mov di, word [bp-00ah] ; 8b 7e f6
add di, 02000h ; 81 c7 00 20
add di, ax ; 01 c7
mov dx, 0b800h ; ba 00 b8
mov es, dx ; 8e c2
cld ; fc
jcxz 01591h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
jmp short 015c3h ; eb 30
mov al, bh ; 88 f8
xor ah, ah ; 30 e4
mov cx, ax ; 89 c1
mov al, bl ; 88 d8
sar ax, 1 ; d1 f8
mov dl, byte [bp+004h] ; 8a 56 04
mov byte [bp-00ch], dl ; 88 56 f4
mov byte [bp-00bh], ch ; 88 6e f5
mov dx, word [bp-00ch] ; 8b 56 f4
imul dx ; f7 ea
mov si, word [bp-008h] ; 8b 76 f8
add si, ax ; 01 c6
mov di, word [bp-00ah] ; 8b 7e f6
add di, ax ; 01 c7
mov dx, 0b800h ; ba 00 b8
mov es, dx ; 8e c2
cld ; fc
jcxz 015c3h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
db 0feh, 0c3h
; inc bl ; fe c3
jmp short 01552h ; eb 8b
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
vgamem_fill_cga_: ; 0xc15d0 LB 0xa8
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00006h ; 83 ec 06
mov byte [bp-006h], al ; 88 46 fa
mov al, dl ; 88 d0
mov byte [bp-008h], bl ; 88 5e f8
mov bh, cl ; 88 cf
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
mov al, byte [bp+004h] ; 8a 46 04
mov cx, ax ; 89 c1
mov ax, dx ; 89 d0
imul cx ; f7 e9
mov dl, bh ; 88 fa
xor dh, dh ; 30 f6
imul dx ; f7 ea
mov dx, ax ; 89 c2
sar dx, 1 ; d1 fa
mov al, byte [bp-006h] ; 8a 46 fa
xor ah, ah ; 30 e4
add dx, ax ; 01 c2
mov word [bp-00ah], dx ; 89 56 f6
xor bl, bl ; 30 db
cmp bl, byte [bp+004h] ; 3a 5e 04
jnc short 0166fh ; 73 65
test bl, 001h ; f6 c3 01
je short 01640h ; 74 31
mov al, byte [bp-008h] ; 8a 46 f8
xor ah, ah ; 30 e4
mov cx, ax ; 89 c1
mov al, byte [bp+006h] ; 8a 46 06
mov si, ax ; 89 c6
mov al, bl ; 88 d8
mov dx, ax ; 89 c2
sar dx, 1 ; d1 fa
mov al, bh ; 88 f8
mov di, ax ; 89 c7
mov ax, dx ; 89 d0
imul di ; f7 ef
mov di, word [bp-00ah] ; 8b 7e f6
add di, 02000h ; 81 c7 00 20
add di, ax ; 01 c7
mov ax, si ; 89 f0
mov dx, 0b800h ; ba 00 b8
mov es, dx ; 8e c2
cld ; fc
jcxz 0163eh ; e3 02
rep stosb ; f3 aa
jmp short 0166bh ; eb 2b
mov al, byte [bp-008h] ; 8a 46 f8
xor ah, ah ; 30 e4
mov cx, ax ; 89 c1
mov al, byte [bp+006h] ; 8a 46 06
mov si, ax ; 89 c6
mov al, bl ; 88 d8
mov dx, ax ; 89 c2
sar dx, 1 ; d1 fa
mov al, bh ; 88 f8
mov di, ax ; 89 c7
mov ax, dx ; 89 d0
imul di ; f7 ef
mov di, word [bp-00ah] ; 8b 7e f6
add di, ax ; 01 c7
mov ax, si ; 89 f0
mov dx, 0b800h ; ba 00 b8
mov es, dx ; 8e c2
cld ; fc
jcxz 0166bh ; e3 02
rep stosb ; f3 aa
db 0feh, 0c3h
; inc bl ; fe c3
jmp short 01605h ; eb 96
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
biosfn_scroll_: ; 0xc1678 LB 0x576
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0001eh ; 83 ec 1e
mov byte [bp-00ah], al ; 88 46 f6
mov byte [bp-008h], dl ; 88 56 f8
mov byte [bp-00eh], bl ; 88 5e f2
mov byte [bp-00ch], cl ; 88 4e f4
mov ch, byte [bp+006h] ; 8a 6e 06
cmp bl, byte [bp+004h] ; 3a 5e 04
jnbe short 016adh ; 77 19
cmp ch, cl ; 38 cd
jc short 016adh ; 72 15
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 1d 1b
xor ah, ah ; 30 e4
call 03193h ; e8 ed 1a
mov byte [bp-010h], al ; 88 46 f0
cmp AL, strict byte 0ffh ; 3c ff
jne short 016b0h ; 75 03
jmp near 01be5h ; e9 35 05
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 05 1b
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
inc bx ; 43
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 13 1b
mov word [bp-018h], ax ; 89 46 e8
cmp byte [bp+008h], 0ffh ; 80 7e 08 ff
jne short 016dch ; 75 0c
mov dx, strict word 00062h ; ba 62 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 e5 1a
mov byte [bp+008h], al ; 88 46 08
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
cmp ax, bx ; 39 d8
jc short 016ech ; 72 07
mov al, bl ; 88 d8
db 0feh, 0c8h
; dec al ; fe c8
mov byte [bp+004h], al ; 88 46 04
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
cmp ax, word [bp-018h] ; 3b 46 e8
jc short 016fah ; 72 05
mov ch, byte [bp-018h] ; 8a 6e e8
db 0feh, 0cdh
; dec ch ; fe cd
mov al, byte [bp-00ah] ; 8a 46 f6
xor ah, ah ; 30 e4
cmp ax, bx ; 39 d8
jbe short 01706h ; 76 03
mov byte [bp-00ah], ah ; 88 66 f6
mov al, ch ; 88 e8
sub al, byte [bp-00ch] ; 2a 46 f4
db 0feh, 0c0h
; inc al ; fe c0
mov byte [bp-006h], al ; 88 46 fa
mov al, byte [bp-010h] ; 8a 46 f0
xor ah, ah ; 30 e4
mov si, ax ; 89 c6
mov CL, strict byte 003h ; b1 03
mov di, ax ; 89 c7
sal di, CL ; d3 e7
mov ax, word [bp-018h] ; 8b 46 e8
dec ax ; 48
mov word [bp-01ch], ax ; 89 46 e4
lea ax, [bx-001h] ; 8d 47 ff
mov word [bp-01eh], ax ; 89 46 e2
mov ax, word [bp-018h] ; 8b 46 e8
mul bx ; f7 e3
mov word [bp-01ah], ax ; 89 46 e6
cmp byte [di+04630h], 000h ; 80 bd 30 46 00
jne short 01789h ; 75 50
sal ax, 1 ; d1 e0
or AL, strict byte 0ffh ; 0c ff
mov bx, ax ; 89 c3
mov al, byte [bp+008h] ; 8a 46 08
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
lea ax, [bx+001h] ; 8d 47 01
mul dx ; f7 e2
mov bx, ax ; 89 c3
cmp byte [bp-00ah], 000h ; 80 7e f6 00
jne short 0178ch ; 75 39
cmp byte [bp-00eh], 000h ; 80 7e f2 00
jne short 0178ch ; 75 33
cmp byte [bp-00ch], 000h ; 80 7e f4 00
jne short 0178ch ; 75 2d
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
cmp ax, word [bp-01eh] ; 3b 46 e2
jne short 0178ch ; 75 23
mov al, ch ; 88 e8
cmp ax, word [bp-01ch] ; 3b 46 e4
jne short 0178ch ; 75 1c
mov ah, byte [bp-008h] ; 8a 66 f8
xor al, ch ; 30 e8
add ax, strict word 00020h ; 05 20 00
mov es, [di+04633h] ; 8e 85 33 46
mov cx, word [bp-01ah] ; 8b 4e e6
mov di, bx ; 89 df
cld ; fc
jcxz 01786h ; e3 02
rep stosw ; f3 ab
jmp near 01be5h ; e9 5c 04
jmp near 0191ah ; e9 8e 01
cmp byte [bp+00ah], 001h ; 80 7e 0a 01
jne short 017fah ; 75 68
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
mov word [bp-016h], ax ; 89 46 ea
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
cmp ax, word [bp-016h] ; 3b 46 ea
jc short 017fch ; 72 56
mov al, byte [bp-00ah] ; 8a 46 f6
add ax, word [bp-016h] ; 03 46 ea
cmp ax, dx ; 39 d0
jnbe short 017b6h ; 77 06
cmp byte [bp-00ah], 000h ; 80 7e f6 00
jne short 017ffh ; 75 49
mov al, byte [bp-006h] ; 8a 46 fa
xor ah, ah ; 30 e4
mov word [bp-022h], ax ; 89 46 de
mov ah, byte [bp-008h] ; 8a 66 f8
xor al, al ; 30 c0
mov di, ax ; 89 c7
add di, strict byte 00020h ; 83 c7 20
mov ax, word [bp-016h] ; 8b 46 ea
mul word [bp-018h] ; f7 66 e8
mov dx, ax ; 89 c2
mov al, byte [bp-00ch] ; 8a 46 f4
xor ah, ah ; 30 e4
add ax, dx ; 01 d0
sal ax, 1 ; d1 e0
mov dx, bx ; 89 da
add dx, ax ; 01 c2
mov al, byte [bp-010h] ; 8a 46 f0
xor ah, ah ; 30 e4
mov CL, strict byte 003h ; b1 03
mov si, ax ; 89 c6
sal si, CL ; d3 e6
mov es, [si+04633h] ; 8e 84 33 46
mov cx, word [bp-022h] ; 8b 4e de
mov ax, di ; 89 f8
mov di, dx ; 89 d7
cld ; fc
jcxz 017f8h ; e3 02
rep stosw ; f3 ab
jmp short 0184ah ; eb 50
jmp short 01850h ; eb 54
jmp near 01be5h ; e9 e6 03
mov dl, byte [bp-006h] ; 8a 56 fa
mov di, dx ; 89 d7
mul word [bp-018h] ; f7 66 e8
mov dl, byte [bp-00ch] ; 8a 56 f4
xor dh, dh ; 30 f6
mov word [bp-014h], dx ; 89 56 ec
add ax, dx ; 01 d0
sal ax, 1 ; d1 e0
mov word [bp-020h], ax ; 89 46 e0
mov al, byte [bp-010h] ; 8a 46 f0
xor ah, ah ; 30 e4
mov CL, strict byte 003h ; b1 03
mov si, ax ; 89 c6
sal si, CL ; d3 e6
mov ax, word [si+04633h] ; 8b 84 33 46
mov word [bp-022h], ax ; 89 46 de
mov ax, word [bp-016h] ; 8b 46 ea
mul word [bp-018h] ; f7 66 e8
add ax, word [bp-014h] ; 03 46 ec
sal ax, 1 ; d1 e0
add ax, bx ; 01 d8
mov cx, di ; 89 f9
mov si, word [bp-020h] ; 8b 76 e0
mov dx, word [bp-022h] ; 8b 56 de
mov di, ax ; 89 c7
mov es, dx ; 8e c2
cld ; fc
jcxz 0184ah ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsw ; f3 a5
pop DS ; 1f
inc word [bp-016h] ; ff 46 ea
jmp near 0179ah ; e9 4a ff
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
mov word [bp-016h], ax ; 89 46 ea
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
cmp ax, word [bp-016h] ; 3b 46 ea
jnbe short 017fch ; 77 9a
mov dx, ax ; 89 c2
mov al, byte [bp-00ah] ; 8a 46 f6
add ax, dx ; 01 d0
cmp ax, word [bp-016h] ; 3b 46 ea
jnbe short 01874h ; 77 06
cmp byte [bp-00ah], 000h ; 80 7e f6 00
jne short 018b3h ; 75 3f
mov al, byte [bp-006h] ; 8a 46 fa
xor ah, ah ; 30 e4
mov di, ax ; 89 c7
mov ah, byte [bp-008h] ; 8a 66 f8
mov AL, strict byte 020h ; b0 20
mov word [bp-022h], ax ; 89 46 de
mov ax, word [bp-016h] ; 8b 46 ea
mul word [bp-018h] ; f7 66 e8
mov dx, ax ; 89 c2
mov al, byte [bp-00ch] ; 8a 46 f4
xor ah, ah ; 30 e4
add dx, ax ; 01 c2
sal dx, 1 ; d1 e2
add dx, bx ; 01 da
mov al, byte [bp-010h] ; 8a 46 f0
mov CL, strict byte 003h ; b1 03
mov si, ax ; 89 c6
sal si, CL ; d3 e6
mov si, word [si+04633h] ; 8b b4 33 46
mov cx, di ; 89 f9
mov ax, word [bp-022h] ; 8b 46 de
mov di, dx ; 89 d7
mov es, si ; 8e c6
cld ; fc
jcxz 018b1h ; e3 02
rep stosw ; f3 ab
jmp short 0190ah ; eb 57
mov al, byte [bp-006h] ; 8a 46 fa
xor ah, ah ; 30 e4
mov di, ax ; 89 c7
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, word [bp-016h] ; 8b 56 ea
sub dx, ax ; 29 c2
mov ax, dx ; 89 d0
mul word [bp-018h] ; f7 66 e8
mov dx, ax ; 89 c2
mov al, byte [bp-00ch] ; 8a 46 f4
xor ah, ah ; 30 e4
mov word [bp-022h], ax ; 89 46 de
add dx, ax ; 01 c2
sal dx, 1 ; d1 e2
mov word [bp-020h], dx ; 89 56 e0
mov al, byte [bp-010h] ; 8a 46 f0
mov CL, strict byte 003h ; b1 03
mov si, ax ; 89 c6
sal si, CL ; d3 e6
mov ax, word [si+04633h] ; 8b 84 33 46
mov word [bp-014h], ax ; 89 46 ec
mov ax, word [bp-016h] ; 8b 46 ea
mul word [bp-018h] ; f7 66 e8
add ax, word [bp-022h] ; 03 46 de
sal ax, 1 ; d1 e0
add ax, bx ; 01 d8
mov cx, di ; 89 f9
mov si, word [bp-020h] ; 8b 76 e0
mov dx, word [bp-014h] ; 8b 56 ec
mov di, ax ; 89 c7
mov es, dx ; 8e c2
cld ; fc
jcxz 0190ah ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsw ; f3 a5
pop DS ; 1f
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
cmp ax, word [bp-016h] ; 3b 46 ea
jc short 0193dh ; 72 29
dec word [bp-016h] ; ff 4e ea
jmp near 01858h ; e9 3e ff
mov al, byte [si+046afh] ; 8a 84 af 46
xor ah, ah ; 30 e4
mov CL, strict byte 006h ; b1 06
mov si, ax ; 89 c6
sal si, CL ; d3 e6
mov al, byte [si+046c5h] ; 8a 84 c5 46
mov byte [bp-012h], al ; 88 46 ee
mov al, byte [di+04631h] ; 8a 85 31 46
cmp AL, strict byte 004h ; 3c 04
je short 01940h ; 74 0b
cmp AL, strict byte 003h ; 3c 03
je short 01940h ; 74 07
cmp AL, strict byte 002h ; 3c 02
je short 0196eh ; 74 31
jmp near 01be5h ; e9 a5 02
cmp byte [bp-00ah], 000h ; 80 7e f6 00
jne short 019ach ; 75 66
cmp byte [bp-00eh], 000h ; 80 7e f2 00
jne short 019ach ; 75 60
cmp byte [bp-00ch], 000h ; 80 7e f4 00
jne short 019ach ; 75 5a
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
lea ax, [bx-001h] ; 8d 47 ff
cmp dx, ax ; 39 c2
jne short 019ach ; 75 4c
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
mov dx, word [bp-018h] ; 8b 56 e8
dec dx ; 4a
cmp ax, dx ; 39 d0
je short 01971h ; 74 05
jmp short 019ach ; eb 3e
jmp near 01aa8h ; e9 37 01
mov ax, 00205h ; b8 05 02
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov ax, bx ; 89 d8
mul word [bp-018h] ; f7 66 e8
mov dl, byte [bp-012h] ; 8a 56 ee
xor dh, dh ; 30 f6
mul dx ; f7 e2
mov dl, byte [bp-008h] ; 8a 56 f8
xor dh, dh ; 30 f6
mov bl, byte [bp-010h] ; 8a 5e f0
xor bh, bh ; 30 ff
mov CL, strict byte 003h ; b1 03
sal bx, CL ; d3 e3
mov bx, word [bx+04633h] ; 8b 9f 33 46
mov cx, ax ; 89 c1
mov ax, dx ; 89 d0
xor di, di ; 31 ff
mov es, bx ; 8e c3
cld ; fc
jcxz 019a3h ; e3 02
rep stosb ; f3 aa
mov ax, strict word 00005h ; b8 05 00
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
jmp short 0193dh ; eb 91
cmp byte [bp+00ah], 001h ; 80 7e 0a 01
jne short 019f7h ; 75 45
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
mov word [bp-016h], ax ; 89 46 ea
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
cmp ax, word [bp-016h] ; 3b 46 ea
jc short 01a28h ; 72 62
mov al, byte [bp-00ah] ; 8a 46 f6
add ax, word [bp-016h] ; 03 46 ea
cmp ax, dx ; 39 d0
jnbe short 019d6h ; 77 06
cmp byte [bp-00ah], 000h ; 80 7e f6 00
jne short 019f9h ; 75 23
mov al, byte [bp-008h] ; 8a 46 f8
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp-012h] ; 8a 46 ee
push ax ; 50
mov al, byte [bp-018h] ; 8a 46 e8
mov cx, ax ; 89 c1
mov bl, byte [bp-006h] ; 8a 5e fa
xor bh, bh ; 30 ff
mov al, byte [bp-016h] ; 8a 46 ea
mov dx, ax ; 89 c2
mov al, byte [bp-00ch] ; 8a 46 f4
call 01492h ; e8 9d fa
jmp short 01a23h ; eb 2c
jmp short 01a2bh ; eb 32
mov al, byte [bp-012h] ; 8a 46 ee
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp-018h] ; 8a 46 e8
push ax ; 50
mov al, byte [bp-006h] ; 8a 46 fa
mov cx, ax ; 89 c1
mov al, byte [bp-016h] ; 8a 46 ea
mov bx, ax ; 89 c3
add al, byte [bp-00ah] ; 02 46 f6
mov dl, byte [bp-00ch] ; 8a 56 f4
mov byte [bp-014h], dl ; 88 56 ec
mov byte [bp-013h], ah ; 88 66 ed
mov si, word [bp-014h] ; 8b 76 ec
mov dx, ax ; 89 c2
mov ax, si ; 89 f0
call 01403h ; e8 e0 f9
inc word [bp-016h] ; ff 46 ea
jmp short 019bah ; eb 92
jmp near 01be5h ; e9 ba 01
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
mov word [bp-016h], ax ; 89 46 ea
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
cmp ax, word [bp-016h] ; 3b 46 ea
jnbe short 01a28h ; 77 eb
mov dx, ax ; 89 c2
mov al, byte [bp-00ah] ; 8a 46 f6
add dx, ax ; 01 c2
cmp dx, word [bp-016h] ; 3b 56 ea
jnbe short 01a4dh ; 77 04
test al, al ; 84 c0
jne short 01a6eh ; 75 21
mov al, byte [bp-008h] ; 8a 46 f8
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp-012h] ; 8a 46 ee
push ax ; 50
mov cl, byte [bp-018h] ; 8a 4e e8
xor ch, ch ; 30 ed
mov al, byte [bp-006h] ; 8a 46 fa
mov bx, ax ; 89 c3
mov al, byte [bp-016h] ; 8a 46 ea
mov dx, ax ; 89 c2
mov al, byte [bp-00ch] ; 8a 46 f4
call 01492h ; e8 26 fa
jmp short 01a99h ; eb 2b
mov al, byte [bp-012h] ; 8a 46 ee
push ax ; 50
mov al, byte [bp-018h] ; 8a 46 e8
push ax ; 50
mov al, byte [bp-006h] ; 8a 46 fa
mov cx, ax ; 89 c1
mov al, byte [bp-016h] ; 8a 46 ea
sub al, byte [bp-00ah] ; 2a 46 f6
mov bx, ax ; 89 c3
mov al, byte [bp-016h] ; 8a 46 ea
mov dl, byte [bp-00ch] ; 8a 56 f4
mov byte [bp-014h], dl ; 88 56 ec
mov byte [bp-013h], ah ; 88 66 ed
mov si, word [bp-014h] ; 8b 76 ec
mov dx, ax ; 89 c2
mov ax, si ; 89 f0
call 01403h ; e8 6a f9
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
cmp ax, word [bp-016h] ; 3b 46 ea
jc short 01aefh ; 72 4c
dec word [bp-016h] ; ff 4e ea
jmp short 01a33h ; eb 8b
mov bl, byte [di+04632h] ; 8a 9d 32 46
cmp byte [bp-00ah], 000h ; 80 7e f6 00
jne short 01af2h ; 75 40
cmp byte [bp-00eh], 000h ; 80 7e f2 00
jne short 01af2h ; 75 3a
cmp byte [bp-00ch], 000h ; 80 7e f4 00
jne short 01af2h ; 75 34
mov al, byte [bp+004h] ; 8a 46 04
cmp ax, word [bp-01eh] ; 3b 46 e2
jne short 01af2h ; 75 2c
mov al, ch ; 88 e8
cmp ax, word [bp-01ch] ; 3b 46 e4
jne short 01af2h ; 75 25
mov al, byte [bp-012h] ; 8a 46 ee
mov dx, ax ; 89 c2
mov ax, word [bp-01ah] ; 8b 46 e6
mul dx ; f7 e2
xor bh, bh ; 30 ff
mul bx ; f7 e3
mov dl, byte [bp-008h] ; 8a 56 f8
xor dh, dh ; 30 f6
mov es, [di+04633h] ; 8e 85 33 46
mov cx, ax ; 89 c1
mov ax, dx ; 89 d0
xor di, di ; 31 ff
cld ; fc
jcxz 01aefh ; e3 02
rep stosb ; f3 aa
jmp near 01be5h ; e9 f3 00
cmp bl, 002h ; 80 fb 02
jne short 01b00h ; 75 09
sal byte [bp-00ch], 1 ; d0 66 f4
sal byte [bp-006h], 1 ; d0 66 fa
sal word [bp-018h], 1 ; d1 66 e8
cmp byte [bp+00ah], 001h ; 80 7e 0a 01
jne short 01b6fh ; 75 69
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
mov word [bp-016h], ax ; 89 46 ea
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
cmp ax, word [bp-016h] ; 3b 46 ea
jc short 01aefh ; 72 d5
mov al, byte [bp-00ah] ; 8a 46 f6
add ax, word [bp-016h] ; 03 46 ea
cmp ax, dx ; 39 d0
jnbe short 01b2ah ; 77 06
cmp byte [bp-00ah], 000h ; 80 7e f6 00
jne short 01b4bh ; 75 21
mov al, byte [bp-008h] ; 8a 46 f8
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp-012h] ; 8a 46 ee
push ax ; 50
mov al, byte [bp-018h] ; 8a 46 e8
mov cx, ax ; 89 c1
mov al, byte [bp-006h] ; 8a 46 fa
mov bx, ax ; 89 c3
mov al, byte [bp-016h] ; 8a 46 ea
mov dx, ax ; 89 c2
mov al, byte [bp-00ch] ; 8a 46 f4
call 015d0h ; e8 87 fa
jmp short 01b6ah ; eb 1f
mov al, byte [bp-012h] ; 8a 46 ee
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp-018h] ; 8a 46 e8
push ax ; 50
mov al, byte [bp-006h] ; 8a 46 fa
mov cx, ax ; 89 c1
mov al, byte [bp-016h] ; 8a 46 ea
mov bx, ax ; 89 c3
add al, byte [bp-00ah] ; 02 46 f6
mov dx, ax ; 89 c2
mov al, byte [bp-00ch] ; 8a 46 f4
call 0150eh ; e8 a4 f9
inc word [bp-016h] ; ff 46 ea
jmp short 01b0eh ; eb 9f
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
mov word [bp-016h], ax ; 89 46 ea
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
cmp ax, word [bp-016h] ; 3b 46 ea
jnbe short 01be5h ; 77 64
mov dx, ax ; 89 c2
mov al, byte [bp-00ah] ; 8a 46 f6
add ax, dx ; 01 d0
cmp ax, word [bp-016h] ; 3b 46 ea
jnbe short 01b93h ; 77 06
cmp byte [bp-00ah], 000h ; 80 7e f6 00
jne short 01bb4h ; 75 21
mov al, byte [bp-008h] ; 8a 46 f8
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp-012h] ; 8a 46 ee
push ax ; 50
mov al, byte [bp-018h] ; 8a 46 e8
mov cx, ax ; 89 c1
mov al, byte [bp-006h] ; 8a 46 fa
mov bx, ax ; 89 c3
mov al, byte [bp-016h] ; 8a 46 ea
mov dx, ax ; 89 c2
mov al, byte [bp-00ch] ; 8a 46 f4
call 015d0h ; e8 1e fa
jmp short 01bd6h ; eb 22
mov al, byte [bp-012h] ; 8a 46 ee
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp-018h] ; 8a 46 e8
push ax ; 50
mov al, byte [bp-006h] ; 8a 46 fa
mov cx, ax ; 89 c1
mov al, byte [bp-016h] ; 8a 46 ea
sub al, byte [bp-00ah] ; 2a 46 f6
mov bx, ax ; 89 c3
mov al, byte [bp-016h] ; 8a 46 ea
mov dx, ax ; 89 c2
mov al, byte [bp-00ch] ; 8a 46 f4
call 0150eh ; e8 38 f9
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
cmp ax, word [bp-016h] ; 3b 46 ea
jc short 01be5h ; 72 05
dec word [bp-016h] ; ff 4e ea
jmp short 01b77h ; eb 92
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00008h ; c2 08 00
write_gfx_char_pl4_: ; 0xc1bee LB 0xf8
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000eh ; 83 ec 0e
mov byte [bp-00ch], al ; 88 46 f4
mov byte [bp-006h], dl ; 88 56 fa
mov byte [bp-00ah], bl ; 88 5e f6
mov al, cl ; 88 c8
cmp byte [bp+006h], 010h ; 80 7e 06 10
je short 01c12h ; 74 0b
cmp byte [bp+006h], 00eh ; 80 7e 06 0e
jne short 01c17h ; 75 0a
mov di, 05bedh ; bf ed 5b
jmp short 01c1ah ; eb 08
mov di, 069edh ; bf ed 69
jmp short 01c1ah ; eb 03
mov di, 053edh ; bf ed 53
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov al, byte [bp+006h] ; 8a 46 06
mov si, ax ; 89 c6
mov ax, bx ; 89 d8
imul si ; f7 ee
mov bl, byte [bp+004h] ; 8a 5e 04
imul bx ; f7 eb
mov bx, ax ; 89 c3
mov al, byte [bp-00ah] ; 8a 46 f6
xor ah, ah ; 30 e4
add ax, bx ; 01 d8
mov word [bp-010h], ax ; 89 46 f0
mov al, byte [bp-00ch] ; 8a 46 f4
xor ah, ah ; 30 e4
imul si ; f7 ee
mov word [bp-00eh], ax ; 89 46 f2
mov ax, 00f02h ; b8 02 0f
mov dx, 003c4h ; ba c4 03
out DX, ax ; ef
mov ax, 00205h ; b8 05 02
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
test byte [bp-006h], 080h ; f6 46 fa 80
je short 01c5ch ; 74 06
mov ax, 01803h ; b8 03 18
out DX, ax ; ef
jmp short 01c60h ; eb 04
mov ax, strict word 00003h ; b8 03 00
out DX, ax ; ef
xor ch, ch ; 30 ed
cmp ch, byte [bp+006h] ; 3a 6e 06
jnc short 01cceh ; 73 67
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
mov bl, byte [bp+004h] ; 8a 5e 04
xor bh, bh ; 30 ff
imul bx ; f7 eb
mov si, word [bp-010h] ; 8b 76 f0
add si, ax ; 01 c6
mov byte [bp-008h], bh ; 88 7e f8
jmp short 01c8fh ; eb 13
xor bx, bx ; 31 db
mov dx, si ; 89 f2
mov ax, 0a000h ; b8 00 a0
call 031cch ; e8 46 15
inc byte [bp-008h] ; fe 46 f8
cmp byte [bp-008h], 008h ; 80 7e f8 08
jnc short 01ccah ; 73 3b
mov cl, byte [bp-008h] ; 8a 4e f8
mov ax, 00080h ; b8 80 00
sar ax, CL ; d3 f8
xor ah, ah ; 30 e4
mov word [bp-012h], ax ; 89 46 ee
mov ah, byte [bp-012h] ; 8a 66 ee
xor al, al ; 30 c0
or AL, strict byte 008h ; 0c 08
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov dx, si ; 89 f2
mov ax, 0a000h ; b8 00 a0
call 031beh ; e8 0f 15
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
mov bx, word [bp-00eh] ; 8b 5e f2
add bx, ax ; 01 c3
add bx, di ; 01 fb
mov al, byte [bx] ; 8a 07
test word [bp-012h], ax ; 85 46 ee
je short 01c7ch ; 74 bb
mov al, byte [bp-006h] ; 8a 46 fa
and AL, strict byte 00fh ; 24 0f
mov bx, ax ; 89 c3
jmp short 01c7eh ; eb b4
db 0feh, 0c5h
; inc ch ; fe c5
jmp short 01c62h ; eb 94
mov ax, 0ff08h ; b8 08 ff
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov ax, strict word 00005h ; b8 05 00
out DX, ax ; ef
mov ax, strict word 00003h ; b8 03 00
out DX, ax ; ef
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
write_gfx_char_cga_: ; 0xc1ce6 LB 0x13a
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000ah ; 83 ec 0a
mov byte [bp-008h], al ; 88 46 f8
mov byte [bp-00ah], dl ; 88 56 f6
mov si, 053edh ; be ed 53
xor bh, bh ; 30 ff
mov al, byte [bp+006h] ; 8a 46 06
xor ah, ah ; 30 e4
mov di, ax ; 89 c7
mov ax, bx ; 89 d8
imul di ; f7 ef
mov bx, ax ; 89 c3
mov al, cl ; 88 c8
xor ah, ah ; 30 e4
mov cx, 00140h ; b9 40 01
imul cx ; f7 e9
add bx, ax ; 01 c3
mov word [bp-00eh], bx ; 89 5e f2
mov al, byte [bp-008h] ; 8a 46 f8
xor ah, ah ; 30 e4
mov CL, strict byte 003h ; b1 03
mov di, ax ; 89 c7
sal di, CL ; d3 e7
mov byte [bp-006h], ah ; 88 66 fa
jmp near 01d77h ; e9 52 00
xor al, al ; 30 c0
xor ah, ah ; 30 e4
jmp short 01d36h ; eb 0b
or al, bl ; 08 d8
shr ch, 1 ; d0 ed
db 0feh, 0c4h
; inc ah ; fe c4
cmp ah, 008h ; 80 fc 08
jnc short 01d61h ; 73 2b
mov bl, byte [bp-006h] ; 8a 5e fa
xor bh, bh ; 30 ff
add bx, di ; 01 fb
add bx, si ; 01 f3
mov bl, byte [bx] ; 8a 1f
xor bh, bh ; 30 ff
mov dx, bx ; 89 da
mov bl, ch ; 88 eb
test dx, bx ; 85 da
je short 01d2dh ; 74 e2
mov CL, strict byte 007h ; b1 07
sub cl, ah ; 28 e1
mov bl, byte [bp-00ah] ; 8a 5e f6
and bl, 001h ; 80 e3 01
sal bl, CL ; d2 e3
test byte [bp-00ah], 080h ; f6 46 f6 80
je short 01d2bh ; 74 ce
xor al, bl ; 30 d8
jmp short 01d2dh ; eb cc
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, word [bp-00ch] ; 8b 56 f4
mov ax, 0b800h ; b8 00 b8
call 031cch ; e8 5e 14
inc byte [bp-006h] ; fe 46 fa
cmp byte [bp-006h], 008h ; 80 7e fa 08
jnc short 01dc9h ; 73 52
mov al, byte [bp-006h] ; 8a 46 fa
xor ah, ah ; 30 e4
sar ax, 1 ; d1 f8
mov bx, strict word 00050h ; bb 50 00
imul bx ; f7 eb
mov dx, word [bp-00eh] ; 8b 56 f2
add dx, ax ; 01 c2
mov word [bp-00ch], dx ; 89 56 f4
test byte [bp-006h], 001h ; f6 46 fa 01
je short 01d95h ; 74 04
add byte [bp-00bh], 020h ; 80 46 f5 20
mov CH, strict byte 080h ; b5 80
cmp byte [bp+006h], 001h ; 80 7e 06 01
jne short 01daeh ; 75 11
test byte [bp-00ah], ch ; 84 6e f6
je short 01d25h ; 74 83
mov dx, word [bp-00ch] ; 8b 56 f4
mov ax, 0b800h ; b8 00 b8
call 031beh ; e8 13 14
jmp near 01d27h ; e9 79 ff
test ch, ch ; 84 ed
jbe short 01d6eh ; 76 bc
test byte [bp-00ah], 080h ; f6 46 f6 80
je short 01dc3h ; 74 0b
mov dx, word [bp-00ch] ; 8b 56 f4
mov ax, 0b800h ; b8 00 b8
call 031beh ; e8 fd 13
jmp short 01dc5h ; eb 02
xor al, al ; 30 c0
xor ah, ah ; 30 e4
jmp short 01dd0h ; eb 07
jmp short 01e17h ; eb 4c
cmp ah, 004h ; 80 fc 04
jnc short 01e05h ; 73 35
mov bl, byte [bp-006h] ; 8a 5e fa
xor bh, bh ; 30 ff
add bx, di ; 01 fb
add bx, si ; 01 f3
mov bl, byte [bx] ; 8a 1f
xor bh, bh ; 30 ff
mov dx, bx ; 89 da
mov bl, ch ; 88 eb
test dx, bx ; 85 da
je short 01dffh ; 74 1a
mov CL, strict byte 003h ; b1 03
sub cl, ah ; 28 e1
mov bl, byte [bp-00ah] ; 8a 5e f6
and bl, 003h ; 80 e3 03
sal cl, 1 ; d0 e1
sal bl, CL ; d2 e3
test byte [bp-00ah], 080h ; f6 46 f6 80
je short 01dfdh ; 74 04
xor al, bl ; 30 d8
jmp short 01dffh ; eb 02
or al, bl ; 08 d8
shr ch, 1 ; d0 ed
db 0feh, 0c4h
; inc ah ; fe c4
jmp short 01dcbh ; eb c6
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, word [bp-00ch] ; 8b 56 f4
mov ax, 0b800h ; b8 00 b8
call 031cch ; e8 ba 13
inc word [bp-00ch] ; ff 46 f4
jmp short 01daeh ; eb 97
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00004h ; c2 04 00
write_gfx_char_lin_: ; 0xc1e20 LB 0xac
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000ch ; 83 ec 0c
mov byte [bp-00ah], al ; 88 46 f6
mov byte [bp-00ch], dl ; 88 56 f4
mov byte [bp-006h], bl ; 88 5e fa
mov al, cl ; 88 c8
mov si, 053edh ; be ed 53
xor ah, ah ; 30 e4
mov bl, byte [bp+004h] ; 8a 5e 04
xor bh, bh ; 30 ff
imul bx ; f7 eb
mov CL, strict byte 006h ; b1 06
sal ax, CL ; d3 e0
mov bl, byte [bp-006h] ; 8a 5e fa
mov CL, strict byte 003h ; b1 03
mov dx, bx ; 89 da
sal dx, CL ; d3 e2
add dx, ax ; 01 c2
mov word [bp-00eh], dx ; 89 56 f2
mov bl, byte [bp-00ah] ; 8a 5e f6
mov di, bx ; 89 df
sal di, CL ; d3 e7
xor ch, ch ; 30 ed
jmp short 01ea0h ; eb 44
cmp cl, 008h ; 80 f9 08
jnc short 01e99h ; 73 38
xor dl, dl ; 30 d2
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
add ax, di ; 01 f8
mov bx, si ; 89 f3
add bx, ax ; 01 c3
mov al, byte [bx] ; 8a 07
xor ah, ah ; 30 e4
mov bl, byte [bp-008h] ; 8a 5e f8
xor bh, bh ; 30 ff
test ax, bx ; 85 d8
je short 01e7dh ; 74 03
mov dl, byte [bp-00ch] ; 8a 56 f4
mov bl, dl ; 88 d3
xor bh, bh ; 30 ff
mov ax, bx ; 89 d8
mov bl, cl ; 88 cb
mov dx, word [bp-010h] ; 8b 56 f0
add dx, bx ; 01 da
mov bx, ax ; 89 c3
mov ax, 0a000h ; b8 00 a0
call 031cch ; e8 3a 13
shr byte [bp-008h], 1 ; d0 6e f8
db 0feh, 0c1h
; inc cl ; fe c1
jmp short 01e5ch ; eb c3
db 0feh, 0c5h
; inc ch ; fe c5
cmp ch, 008h ; 80 fd 08
jnc short 01ec3h ; 73 23
mov bl, ch ; 88 eb
xor bh, bh ; 30 ff
mov al, byte [bp+004h] ; 8a 46 04
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
mov ax, bx ; 89 d8
imul dx ; f7 ea
mov CL, strict byte 003h ; b1 03
sal ax, CL ; d3 e0
mov dx, word [bp-00eh] ; 8b 56 f2
add dx, ax ; 01 c2
mov word [bp-010h], dx ; 89 56 f0
mov byte [bp-008h], 080h ; c6 46 f8 80
xor cl, cl ; 30 c9
jmp short 01e61h ; eb 9e
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00002h ; c2 02 00
biosfn_write_char_attr_: ; 0xc1ecc LB 0x192
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0001ah ; 83 ec 1a
mov byte [bp-008h], al ; 88 46 f8
mov byte [bp-012h], dl ; 88 56 ee
mov byte [bp-006h], bl ; 88 5e fa
mov si, cx ; 89 ce
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 d6 12
xor ah, ah ; 30 e4
call 03193h ; e8 a6 12
mov cl, al ; 88 c1
mov byte [bp-014h], al ; 88 46 ec
cmp AL, strict byte 0ffh ; 3c ff
jne short 01ef9h ; 75 03
jmp near 02057h ; e9 5e 01
mov al, byte [bp-012h] ; 8a 46 ee
xor ah, ah ; 30 e4
lea bx, [bp-01eh] ; 8d 5e e2
lea dx, [bp-01ch] ; 8d 56 e4
call 00a8ch ; e8 85 eb
mov al, byte [bp-01eh] ; 8a 46 e2
mov byte [bp-00ch], al ; 88 46 f4
mov ax, word [bp-01eh] ; 8b 46 e2
mov byte [bp-00eh], ah ; 88 66 f2
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 a2 12
xor ah, ah ; 30 e4
inc ax ; 40
mov word [bp-01ah], ax ; 89 46 e6
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 af 12
mov bx, ax ; 89 c3
mov word [bp-016h], ax ; 89 46 ea
mov al, cl ; 88 c8
xor ah, ah ; 30 e4
mov CL, strict byte 003h ; b1 03
mov di, ax ; 89 c7
sal di, CL ; d3 e7
cmp byte [di+04630h], 000h ; 80 bd 30 46 00
jne short 01f8ah ; 75 49
mov ax, bx ; 89 d8
mul word [bp-01ah] ; f7 66 e6
sal ax, 1 ; d1 e0
or AL, strict byte 0ffh ; 0c ff
mov cx, ax ; 89 c1
mov al, byte [bp-012h] ; 8a 46 ee
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
mov ax, cx ; 89 c8
inc ax ; 40
mul dx ; f7 e2
mov cx, ax ; 89 c1
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
mul bx ; f7 e3
mov bl, byte [bp-00ch] ; 8a 5e f4
xor bh, bh ; 30 ff
mov dx, ax ; 89 c2
add dx, bx ; 01 da
sal dx, 1 ; d1 e2
add dx, cx ; 01 ca
mov bh, byte [bp-006h] ; 8a 7e fa
mov bl, byte [bp-008h] ; 8a 5e f8
mov word [bp-01ch], bx ; 89 5e e4
mov ax, word [bp-01ch] ; 8b 46 e4
mov es, [di+04633h] ; 8e 85 33 46
mov cx, si ; 89 f1
mov di, dx ; 89 d7
cld ; fc
jcxz 01f87h ; e3 02
rep stosw ; f3 ab
jmp near 02057h ; e9 cd 00
mov bx, ax ; 89 c3
mov al, byte [bx+046afh] ; 8a 87 af 46
mov CL, strict byte 006h ; b1 06
mov bx, ax ; 89 c3
sal bx, CL ; d3 e3
mov al, byte [bx+046c5h] ; 8a 87 c5 46
mov byte [bp-010h], al ; 88 46 f0
mov al, byte [di+04632h] ; 8a 85 32 46
mov byte [bp-00ah], al ; 88 46 f6
dec si ; 4e
cmp si, strict byte 0ffffh ; 83 fe ff
je short 01fb4h ; 74 0a
mov al, byte [bp-00ch] ; 8a 46 f4
xor ah, ah ; 30 e4
cmp ax, word [bp-016h] ; 3b 46 ea
jc short 01fb7h ; 72 03
jmp near 02057h ; e9 a0 00
mov al, byte [bp-014h] ; 8a 46 ec
mov CL, strict byte 003h ; b1 03
mov bx, ax ; 89 c3
sal bx, CL ; d3 e3
mov al, byte [bx+04631h] ; 8a 87 31 46
cmp al, cl ; 38 c8
jc short 01fd5h ; 72 0d
jbe short 01fdbh ; 76 11
cmp AL, strict byte 005h ; 3c 05
je short 02030h ; 74 62
cmp AL, strict byte 004h ; 3c 04
je short 01fdbh ; 74 09
jmp near 02051h ; e9 7c 00
cmp AL, strict byte 002h ; 3c 02
je short 02004h ; 74 2b
jmp short 02051h ; eb 76
mov bl, byte [bp-010h] ; 8a 5e f0
xor bh, bh ; 30 ff
push bx ; 53
mov bl, byte [bp-016h] ; 8a 5e ea
push bx ; 53
mov bl, byte [bp-00eh] ; 8a 5e f2
mov cx, bx ; 89 d9
mov al, byte [bp-00ch] ; 8a 46 f4
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
mov al, byte [bp-006h] ; 8a 46 fa
mov di, ax ; 89 c7
mov bl, byte [bp-008h] ; 8a 5e f8
mov ax, bx ; 89 d8
mov bx, dx ; 89 d3
mov dx, di ; 89 fa
call 01beeh ; e8 ec fb
jmp short 02051h ; eb 4d
mov al, byte [bp-00ah] ; 8a 46 f6
push ax ; 50
mov al, byte [bp-016h] ; 8a 46 ea
push ax ; 50
mov al, byte [bp-00eh] ; 8a 46 f2
mov cx, ax ; 89 c1
mov al, byte [bp-00ch] ; 8a 46 f4
mov bl, byte [bp-006h] ; 8a 5e fa
xor bh, bh ; 30 ff
mov dx, bx ; 89 da
mov bl, byte [bp-008h] ; 8a 5e f8
mov byte [bp-018h], bl ; 88 5e e8
mov byte [bp-017h], ah ; 88 66 e9
mov di, word [bp-018h] ; 8b 7e e8
mov bx, ax ; 89 c3
mov ax, di ; 89 f8
call 01ce6h ; e8 b8 fc
jmp short 02051h ; eb 21
mov bl, byte [bp-016h] ; 8a 5e ea
xor bh, bh ; 30 ff
push bx ; 53
mov bl, byte [bp-00eh] ; 8a 5e f2
mov cx, bx ; 89 d9
mov al, byte [bp-00ch] ; 8a 46 f4
mov dx, ax ; 89 c2
mov bl, byte [bp-006h] ; 8a 5e fa
mov di, bx ; 89 df
mov bl, byte [bp-008h] ; 8a 5e f8
mov ax, bx ; 89 d8
mov bx, dx ; 89 d3
mov dx, di ; 89 fa
call 01e20h ; e8 cf fd
inc byte [bp-00ch] ; fe 46 f4
jmp near 01fa4h ; e9 4d ff
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
biosfn_write_char_only_: ; 0xc205e LB 0x193
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00018h ; 83 ec 18
mov byte [bp-006h], al ; 88 46 fa
mov byte [bp-008h], dl ; 88 56 f8
mov byte [bp-00ah], bl ; 88 5e f6
mov si, cx ; 89 ce
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 44 11
xor ah, ah ; 30 e4
call 03193h ; e8 14 11
mov cl, al ; 88 c1
mov byte [bp-00ch], al ; 88 46 f4
cmp AL, strict byte 0ffh ; 3c ff
jne short 0208bh ; 75 03
jmp near 021eah ; e9 5f 01
mov bl, byte [bp-008h] ; 8a 5e f8
xor bh, bh ; 30 ff
mov ax, bx ; 89 d8
lea bx, [bp-01ch] ; 8d 5e e4
lea dx, [bp-01ah] ; 8d 56 e6
call 00a8ch ; e8 f1 e9
mov al, byte [bp-01ch] ; 8a 46 e4
mov byte [bp-00eh], al ; 88 46 f2
mov ax, word [bp-01ch] ; 8b 46 e4
mov byte [bp-014h], ah ; 88 66 ec
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 0e 11
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
inc bx ; 43
mov word [bp-018h], bx ; 89 5e e8
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 19 11
mov di, ax ; 89 c7
mov word [bp-016h], ax ; 89 46 ea
mov bl, cl ; 88 cb
xor bh, bh ; 30 ff
mov ax, bx ; 89 d8
mov CL, strict byte 003h ; b1 03
sal bx, CL ; d3 e3
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
jne short 02125h ; 75 4e
mov ax, di ; 89 f8
mul word [bp-018h] ; f7 66 e8
sal ax, 1 ; d1 e0
or AL, strict byte 0ffh ; 0c ff
mov bl, byte [bp-008h] ; 8a 5e f8
xor bh, bh ; 30 ff
inc ax ; 40
mul bx ; f7 e3
mov cx, ax ; 89 c1
mov bl, byte [bp-014h] ; 8a 5e ec
mov ax, bx ; 89 d8
mul di ; f7 e7
mov dl, byte [bp-00eh] ; 8a 56 f2
xor dh, dh ; 30 f6
add ax, dx ; 01 d0
sal ax, 1 ; d1 e0
mov di, cx ; 89 cf
add di, ax ; 01 c7
dec si ; 4e
cmp si, strict byte 0ffffh ; 83 fe ff
je short 02088h ; 74 84
mov dl, byte [bp-006h] ; 8a 56 fa
xor dh, dh ; 30 f6
mov ax, dx ; 89 d0
mov dl, byte [bp-00ch] ; 8a 56 f4
mov CL, strict byte 003h ; b1 03
mov bx, dx ; 89 d3
sal bx, CL ; d3 e3
mov cx, word [bx+04633h] ; 8b 8f 33 46
mov bx, ax ; 89 c3
mov dx, di ; 89 fa
mov ax, cx ; 89 c8
call 031cch ; e8 ab 10
inc di ; 47
inc di ; 47
jmp short 020feh ; eb d9
mov di, ax ; 89 c7
mov dl, byte [di+046afh] ; 8a 95 af 46
xor dh, dh ; 30 f6
mov CL, strict byte 006h ; b1 06
mov di, dx ; 89 d7
sal di, CL ; d3 e7
mov al, byte [di+046c5h] ; 8a 85 c5 46
mov byte [bp-012h], al ; 88 46 ee
mov al, byte [bx+04632h] ; 8a 87 32 46
mov byte [bp-010h], al ; 88 46 f0
dec si ; 4e
cmp si, strict byte 0ffffh ; 83 fe ff
je short 0219ch ; 74 55
mov dl, byte [bp-00eh] ; 8a 56 f2
xor dh, dh ; 30 f6
cmp dx, word [bp-016h] ; 3b 56 ea
jnc short 0219ch ; 73 4b
mov dl, byte [bp-00ch] ; 8a 56 f4
mov CL, strict byte 003h ; b1 03
mov bx, dx ; 89 d3
sal bx, CL ; d3 e3
mov bl, byte [bx+04631h] ; 8a 9f 31 46
cmp bl, cl ; 38 cb
jc short 02170h ; 72 0e
jbe short 02177h ; 76 13
cmp bl, 005h ; 80 fb 05
je short 021c3h ; 74 5a
cmp bl, 004h ; 80 fb 04
je short 02177h ; 74 09
jmp short 021e4h ; eb 74
cmp bl, 002h ; 80 fb 02
je short 0219eh ; 74 29
jmp short 021e4h ; eb 6d
mov dl, byte [bp-012h] ; 8a 56 ee
xor dh, dh ; 30 f6
push dx ; 52
mov bl, byte [bp-016h] ; 8a 5e ea
xor bh, bh ; 30 ff
push bx ; 53
mov bl, byte [bp-014h] ; 8a 5e ec
mov cx, bx ; 89 d9
mov bl, byte [bp-00eh] ; 8a 5e f2
mov dl, byte [bp-00ah] ; 8a 56 f6
mov di, dx ; 89 d7
mov dl, byte [bp-006h] ; 8a 56 fa
mov ax, dx ; 89 d0
mov dx, di ; 89 fa
call 01beeh ; e8 54 fa
jmp short 021e4h ; eb 48
jmp short 021eah ; eb 4c
mov bl, byte [bp-010h] ; 8a 5e f0
xor bh, bh ; 30 ff
push bx ; 53
mov bl, byte [bp-016h] ; 8a 5e ea
push bx ; 53
mov bl, byte [bp-014h] ; 8a 5e ec
mov cx, bx ; 89 d9
mov dl, byte [bp-00eh] ; 8a 56 f2
mov bl, byte [bp-00ah] ; 8a 5e f6
mov di, bx ; 89 df
mov al, byte [bp-006h] ; 8a 46 fa
xor ah, ah ; 30 e4
mov bx, dx ; 89 d3
mov dx, di ; 89 fa
call 01ce6h ; e8 25 fb
jmp short 021e4h ; eb 21
mov bl, byte [bp-016h] ; 8a 5e ea
xor bh, bh ; 30 ff
push bx ; 53
mov bl, byte [bp-014h] ; 8a 5e ec
mov cx, bx ; 89 d9
mov al, byte [bp-00eh] ; 8a 46 f2
xor ah, ah ; 30 e4
mov di, ax ; 89 c7
mov bl, byte [bp-00ah] ; 8a 5e f6
mov dx, bx ; 89 da
mov bl, byte [bp-006h] ; 8a 5e fa
mov ax, bx ; 89 d8
mov bx, di ; 89 fb
call 01e20h ; e8 3c fc
inc byte [bp-00eh] ; fe 46 f2
jmp near 02141h ; e9 57 ff
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
biosfn_write_pixel_: ; 0xc21f1 LB 0x17f
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
sub sp, strict byte 00008h ; 83 ec 08
mov byte [bp-004h], dl ; 88 56 fc
mov word [bp-008h], bx ; 89 5e f8
mov word [bp-00ah], cx ; 89 4e f6
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 b4 0f
xor ah, ah ; 30 e4
call 03193h ; e8 84 0f
mov ch, al ; 88 c5
cmp AL, strict byte 0ffh ; 3c ff
je short 0223ch ; 74 27
xor ah, ah ; 30 e4
mov CL, strict byte 003h ; b1 03
mov bx, ax ; 89 c3
sal bx, CL ; d3 e3
cmp byte [bx+04630h], 000h ; 80 bf 30 46 00
je short 0223ch ; 74 18
mov al, byte [bx+04631h] ; 8a 87 31 46
cmp al, cl ; 38 c8
jc short 02238h ; 72 0c
jbe short 02242h ; 76 14
cmp AL, strict byte 005h ; 3c 05
je short 0223fh ; 74 0d
cmp AL, strict byte 004h ; 3c 04
je short 02242h ; 74 0c
jmp short 0223ch ; eb 04
cmp AL, strict byte 002h ; 3c 02
je short 022adh ; 74 71
jmp near 02341h ; e9 02 01
jmp near 02347h ; e9 05 01
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 8f 0f
mov bx, ax ; 89 c3
mov ax, word [bp-00ah] ; 8b 46 f6
mul bx ; f7 e3
mov CL, strict byte 003h ; b1 03
mov bx, word [bp-008h] ; 8b 5e f8
shr bx, CL ; d3 eb
add bx, ax ; 01 c3
mov word [bp-006h], bx ; 89 5e fa
mov cx, word [bp-008h] ; 8b 4e f8
and cl, 007h ; 80 e1 07
mov ax, 00080h ; b8 80 00
sar ax, CL ; d3 f8
mov ah, al ; 88 c4
xor al, al ; 30 c0
or AL, strict byte 008h ; 0c 08
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov ax, 00205h ; b8 05 02
out DX, ax ; ef
mov dx, bx ; 89 da
mov ax, 0a000h ; b8 00 a0
call 031beh ; e8 3f 0f
test byte [bp-004h], 080h ; f6 46 fc 80
je short 0228ch ; 74 07
mov ax, 01803h ; b8 03 18
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov al, byte [bp-004h] ; 8a 46 fc
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, word [bp-006h] ; 8b 56 fa
mov ax, 0a000h ; b8 00 a0
call 031cch ; e8 30 0f
mov ax, 0ff08h ; b8 08 ff
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov ax, strict word 00005h ; b8 05 00
out DX, ax ; ef
mov ax, strict word 00003h ; b8 03 00
out DX, ax ; ef
jmp short 0223ch ; eb 8f
mov ax, word [bp-00ah] ; 8b 46 f6
shr ax, 1 ; d1 e8
mov si, strict word 00050h ; be 50 00
mul si ; f7 e6
cmp byte [bx+04632h], 002h ; 80 bf 32 46 02
jne short 022c7h ; 75 09
mov bx, word [bp-008h] ; 8b 5e f8
shr bx, 1 ; d1 eb
shr bx, 1 ; d1 eb
jmp short 022cch ; eb 05
mov bx, word [bp-008h] ; 8b 5e f8
shr bx, CL ; d3 eb
add bx, ax ; 01 c3
mov word [bp-006h], bx ; 89 5e fa
test byte [bp-00ah], 001h ; f6 46 f6 01
je short 022dbh ; 74 04
add byte [bp-005h], 020h ; 80 46 fb 20
mov dx, word [bp-006h] ; 8b 56 fa
mov ax, 0b800h ; b8 00 b8
call 031beh ; e8 da 0e
mov bl, al ; 88 c3
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
mov CL, strict byte 003h ; b1 03
mov si, ax ; 89 c6
sal si, CL ; d3 e6
cmp byte [si+04632h], 002h ; 80 bc 32 46 02
jne short 02311h ; 75 1a
mov al, byte [bp-008h] ; 8a 46 f8
and al, cl ; 20 c8
mov ah, cl ; 88 cc
sub ah, al ; 28 c4
mov al, ah ; 88 e0
sal al, 1 ; d0 e0
mov bh, byte [bp-004h] ; 8a 7e fc
and bh, cl ; 20 cf
mov cl, al ; 88 c1
sal bh, CL ; d2 e7
mov AL, strict byte 003h ; b0 03
jmp short 02324h ; eb 13
mov al, byte [bp-008h] ; 8a 46 f8
and AL, strict byte 007h ; 24 07
mov CL, strict byte 007h ; b1 07
sub cl, al ; 28 c1
mov bh, byte [bp-004h] ; 8a 7e fc
and bh, 001h ; 80 e7 01
sal bh, CL ; d2 e7
mov AL, strict byte 001h ; b0 01
sal al, CL ; d2 e0
test byte [bp-004h], 080h ; f6 46 fc 80
je short 02330h ; 74 04
xor bl, bh ; 30 fb
jmp short 02336h ; eb 06
not al ; f6 d0
and bl, al ; 20 c3
or bl, bh ; 08 fb
xor bh, bh ; 30 ff
mov dx, word [bp-006h] ; 8b 56 fa
mov ax, 0b800h ; b8 00 b8
call 031cch ; e8 8b 0e
lea sp, [bp-002h] ; 8d 66 fe
pop si ; 5e
pop bp ; 5d
retn ; c3
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 8a 0e
mov bx, ax ; 89 c3
sal bx, CL ; d3 e3
mov ax, word [bp-00ah] ; 8b 46 f6
mul bx ; f7 e3
mov bx, word [bp-008h] ; 8b 5e f8
add bx, ax ; 01 c3
mov word [bp-006h], bx ; 89 5e fa
mov al, byte [bp-004h] ; 8a 46 fc
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, word [bp-006h] ; 8b 56 fa
mov ax, 0a000h ; b8 00 a0
jmp short 0233eh ; eb ce
biosfn_write_teletype_: ; 0xc2370 LB 0x25f
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0001ah ; 83 ec 1a
mov byte [bp-016h], al ; 88 46 ea
mov byte [bp-014h], dl ; 88 56 ec
mov byte [bp-00eh], bl ; 88 5e f2
mov byte [bp-00ch], cl ; 88 4e f4
cmp dl, 0ffh ; 80 fa ff
jne short 02395h ; 75 0c
mov dx, strict word 00062h ; ba 62 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 2c 0e
mov byte [bp-014h], al ; 88 46 ec
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 20 0e
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
mov ax, bx ; 89 d8
call 03193h ; e8 ec 0d
mov byte [bp-00ah], al ; 88 46 f6
cmp AL, strict byte 0ffh ; 3c ff
je short 02411h ; 74 63
mov bl, byte [bp-014h] ; 8a 5e ec
mov ax, bx ; 89 d8
lea bx, [bp-01eh] ; 8d 5e e2
lea dx, [bp-01ch] ; 8d 56 e4
call 00a8ch ; e8 d0 e6
mov al, byte [bp-01eh] ; 8a 46 e2
mov byte [bp-006h], al ; 88 46 fa
mov bx, word [bp-01eh] ; 8b 5e e2
mov byte [bp-008h], bh ; 88 7e f8
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 ed 0d
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
inc bx ; 43
mov word [bp-018h], bx ; 89 5e e8
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 f8 0d
mov word [bp-01ah], ax ; 89 46 e6
mov al, byte [bp-016h] ; 8a 46 ea
cmp AL, strict byte 008h ; 3c 08
jc short 023f8h ; 72 0c
jbe short 023ffh ; 76 11
cmp AL, strict byte 00dh ; 3c 0d
je short 0240ah ; 74 18
cmp AL, strict byte 00ah ; 3c 0a
je short 02414h ; 74 1e
jmp short 02417h ; eb 1f
cmp AL, strict byte 007h ; 3c 07
jne short 02417h ; 75 1b
jmp near 0250dh ; e9 0e 01
cmp byte [bp-006h], 000h ; 80 7e fa 00
jbe short 0240eh ; 76 09
dec byte [bp-006h] ; fe 4e fa
jmp short 0240eh ; eb 04
mov byte [bp-006h], 000h ; c6 46 fa 00
jmp near 0250dh ; e9 fc 00
jmp near 025c8h ; e9 b4 01
jmp near 0250ah ; e9 f3 00
mov bl, byte [bp-00ah] ; 8a 5e f6
xor bh, bh ; 30 ff
mov CL, strict byte 003h ; b1 03
mov si, bx ; 89 de
sal si, CL ; d3 e6
cmp byte [si+04630h], 000h ; 80 bc 30 46 00
jne short 0246fh ; 75 46
mov ax, word [bp-01ah] ; 8b 46 e6
mul word [bp-018h] ; f7 66 e8
sal ax, 1 ; d1 e0
or AL, strict byte 0ffh ; 0c ff
mov bl, byte [bp-014h] ; 8a 5e ec
inc ax ; 40
mul bx ; f7 e3
mov cx, ax ; 89 c1
mov bl, byte [bp-008h] ; 8a 5e f8
mov ax, bx ; 89 d8
mul word [bp-01ah] ; f7 66 e6
mov bl, byte [bp-006h] ; 8a 5e fa
add ax, bx ; 01 d8
sal ax, 1 ; d1 e0
add cx, ax ; 01 c1
mov bl, byte [bp-016h] ; 8a 5e ea
mov ax, word [si+04633h] ; 8b 84 33 46
mov dx, cx ; 89 ca
call 031cch ; e8 74 0d
cmp byte [bp-00ch], 003h ; 80 7e f4 03
jne short 024b5h ; 75 57
mov bl, byte [bp-00eh] ; 8a 5e f2
xor bh, bh ; 30 ff
mov dx, cx ; 89 ca
inc dx ; 42
mov ax, word [si+04633h] ; 8b 84 33 46
call 031cch ; e8 5f 0d
jmp short 024b5h ; eb 46
mov bl, byte [bx+046afh] ; 8a 9f af 46
mov CL, strict byte 006h ; b1 06
sal bx, CL ; d3 e3
mov bl, byte [bx+046c5h] ; 8a 9f c5 46
mov ah, byte [si+04632h] ; 8a a4 32 46
mov al, byte [si+04631h] ; 8a 84 31 46
cmp AL, strict byte 003h ; 3c 03
jc short 02493h ; 72 0c
jbe short 02499h ; 76 10
cmp AL, strict byte 005h ; 3c 05
je short 024d7h ; 74 4a
cmp AL, strict byte 004h ; 3c 04
je short 02499h ; 74 08
jmp short 024fah ; eb 67
cmp AL, strict byte 002h ; 3c 02
je short 024b7h ; 74 20
jmp short 024fah ; eb 61
xor bh, bh ; 30 ff
push bx ; 53
mov al, byte [bp-01ah] ; 8a 46 e6
xor ah, ah ; 30 e4
push ax ; 50
mov cl, byte [bp-008h] ; 8a 4e f8
xor ch, ch ; 30 ed
mov bl, byte [bp-006h] ; 8a 5e fa
mov al, byte [bp-00eh] ; 8a 46 f2
mov dx, ax ; 89 c2
mov al, byte [bp-016h] ; 8a 46 ea
call 01beeh ; e8 39 f7
jmp short 024fah ; eb 43
mov al, ah ; 88 e0
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp-01ah] ; 8a 46 e6
push ax ; 50
mov cl, byte [bp-008h] ; 8a 4e f8
xor ch, ch ; 30 ed
mov al, byte [bp-006h] ; 8a 46 fa
mov bx, ax ; 89 c3
mov al, byte [bp-00eh] ; 8a 46 f2
mov dx, ax ; 89 c2
mov al, byte [bp-016h] ; 8a 46 ea
call 01ce6h ; e8 11 f8
jmp short 024fah ; eb 23
mov al, byte [bp-01ah] ; 8a 46 e6
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp-008h] ; 8a 46 f8
mov bl, byte [bp-006h] ; 8a 5e fa
xor bh, bh ; 30 ff
mov si, bx ; 89 de
mov bl, byte [bp-00eh] ; 8a 5e f2
mov dx, bx ; 89 da
mov bl, byte [bp-016h] ; 8a 5e ea
mov di, bx ; 89 df
mov cx, ax ; 89 c1
mov bx, si ; 89 f3
mov ax, di ; 89 f8
call 01e20h ; e8 26 f9
inc byte [bp-006h] ; fe 46 fa
mov bl, byte [bp-006h] ; 8a 5e fa
xor bh, bh ; 30 ff
cmp bx, word [bp-01ah] ; 3b 5e e6
jne short 0250dh ; 75 06
mov byte [bp-006h], bh ; 88 7e fa
inc byte [bp-008h] ; fe 46 f8
mov bl, byte [bp-008h] ; 8a 5e f8
xor bh, bh ; 30 ff
mov ax, word [bp-018h] ; 8b 46 e8
cmp bx, ax ; 39 c3
jne short 0258ah ; 75 71
mov bl, byte [bp-00ah] ; 8a 5e f6
xor bh, ah ; 30 e7
mov CL, strict byte 003h ; b1 03
mov si, bx ; 89 de
sal si, CL ; d3 e6
mov al, byte [bp-018h] ; 8a 46 e8
db 0feh, 0c8h
; dec al ; fe c8
mov byte [bp-010h], al ; 88 46 f0
mov al, byte [bp-01ah] ; 8a 46 e6
db 0feh, 0c8h
; dec al ; fe c8
mov byte [bp-012h], al ; 88 46 ee
cmp byte [si+04630h], 000h ; 80 bc 30 46 00
jne short 0258ch ; 75 51
mov ax, word [bp-01ah] ; 8b 46 e6
mul word [bp-018h] ; f7 66 e8
sal ax, 1 ; d1 e0
or AL, strict byte 0ffh ; 0c ff
mov bl, byte [bp-014h] ; 8a 5e ec
xor bh, bh ; 30 ff
inc ax ; 40
mul bx ; f7 e3
mov cx, ax ; 89 c1
mov dl, byte [bp-008h] ; 8a 56 f8
xor dh, dh ; 30 f6
mov ax, dx ; 89 d0
dec ax ; 48
mul word [bp-01ah] ; f7 66 e6
mov bl, byte [bp-006h] ; 8a 5e fa
add ax, bx ; 01 d8
sal ax, 1 ; d1 e0
mov dx, cx ; 89 ca
add dx, ax ; 01 c2
inc dx ; 42
mov ax, word [si+04633h] ; 8b 84 33 46
call 031beh ; e8 51 0c
mov dx, strict word 00001h ; ba 01 00
push dx ; 52
mov bl, byte [bp-014h] ; 8a 5e ec
push bx ; 53
mov bl, byte [bp-012h] ; 8a 5e ee
push bx ; 53
mov bl, byte [bp-010h] ; 8a 5e f0
push bx ; 53
mov bl, al ; 88 c3
mov dx, bx ; 89 da
xor cx, cx ; 31 c9
xor bl, al ; 30 c3
mov ax, strict word 00001h ; b8 01 00
jmp short 025a4h ; eb 1a
jmp short 025aah ; eb 1e
mov ax, strict word 00001h ; b8 01 00
push ax ; 50
mov bl, byte [bp-014h] ; 8a 5e ec
xor bh, bh ; 30 ff
push bx ; 53
mov bl, byte [bp-012h] ; 8a 5e ee
push bx ; 53
mov bl, byte [bp-010h] ; 8a 5e f0
push bx ; 53
xor cx, cx ; 31 c9
xor bl, bl ; 30 db
xor dx, dx ; 31 d2
call 01678h ; e8 d1 f0
dec byte [bp-008h] ; fe 4e f8
mov bl, byte [bp-008h] ; 8a 5e f8
xor bh, bh ; 30 ff
mov word [bp-01eh], bx ; 89 5e e2
mov CL, strict byte 008h ; b1 08
sal word [bp-01eh], CL ; d3 66 e2
mov bl, byte [bp-006h] ; 8a 5e fa
add word [bp-01eh], bx ; 01 5e e2
mov dx, word [bp-01eh] ; 8b 56 e2
mov bl, byte [bp-014h] ; 8a 5e ec
mov ax, bx ; 89 d8
call 00e91h ; e8 c9 e8
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
get_font_access_: ; 0xc25cf LB 0x2c
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov ax, 00100h ; b8 00 01
mov dx, 003c4h ; ba c4 03
out DX, ax ; ef
mov ax, 00402h ; b8 02 04
out DX, ax ; ef
mov ax, 00704h ; b8 04 07
out DX, ax ; ef
mov ax, 00300h ; b8 00 03
out DX, ax ; ef
mov ax, 00204h ; b8 04 02
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov ax, strict word 00005h ; b8 05 00
out DX, ax ; ef
mov ax, 00406h ; b8 06 04
out DX, ax ; ef
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
release_font_access_: ; 0xc25fb LB 0x3f
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov ax, 00100h ; b8 00 01
mov dx, 003c4h ; ba c4 03
out DX, ax ; ef
mov ax, 00302h ; b8 02 03
out DX, ax ; ef
mov ax, 00304h ; b8 04 03
out DX, ax ; ef
mov ax, 00300h ; b8 00 03
out DX, ax ; ef
mov dx, 003cch ; ba cc 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and ax, strict word 00001h ; 25 01 00
sal ax, 1 ; d1 e0
sal ax, 1 ; d1 e0
mov ah, al ; 88 c4
or ah, 00ah ; 80 cc 0a
xor al, al ; 30 c0
or AL, strict byte 006h ; 0c 06
mov dx, 003ceh ; ba ce 03
out DX, ax ; ef
mov ax, strict word 00004h ; b8 04 00
out DX, ax ; ef
mov ax, 01005h ; b8 05 10
out DX, ax ; ef
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
set_scan_lines_: ; 0xc263a LB 0xc8
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push dx ; 52
push si ; 56
push ax ; 50
mov bl, al ; 88 c3
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 8d 0b
mov dx, ax ; 89 c2
mov si, ax ; 89 c6
mov AL, strict byte 009h ; b0 09
out DX, AL ; ee
inc dx ; 42
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov ah, al ; 88 c4
and ah, 0e0h ; 80 e4 e0
mov al, bl ; 88 d8
db 0feh, 0c8h
; dec al ; fe c8
or al, ah ; 08 e0
out DX, AL ; ee
cmp bl, 008h ; 80 fb 08
jne short 02671h ; 75 08
mov dx, strict word 00007h ; ba 07 00
mov ax, strict word 00006h ; b8 06 00
jmp short 0267eh ; eb 0d
mov dl, bl ; 88 da
sub dl, 003h ; 80 ea 03
xor dh, dh ; 30 f6
mov al, bl ; 88 d8
sub AL, strict byte 004h ; 2c 04
xor ah, ah ; 30 e4
call 00ddeh ; e8 5d e7
mov byte [bp-00ah], bl ; 88 5e f6
mov byte [bp-009h], 000h ; c6 46 f7 00
mov bx, word [bp-00ah] ; 8b 5e f6
mov dx, 00085h ; ba 85 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 54 0b
mov AL, strict byte 012h ; b0 12
mov dx, si ; 89 f2
out DX, AL ; ee
lea cx, [si+001h] ; 8d 4c 01
mov dx, cx ; 89 ca
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov bx, ax ; 89 c3
mov AL, strict byte 007h ; b0 07
mov dx, si ; 89 f2
out DX, AL ; ee
mov dx, cx ; 89 ca
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov dl, al ; 88 c2
and dl, 002h ; 80 e2 02
xor dh, ch ; 30 ee
mov CL, strict byte 007h ; b1 07
sal dx, CL ; d3 e2
and AL, strict byte 040h ; 24 40
xor ah, ah ; 30 e4
mov CL, strict byte 003h ; b1 03
sal ax, CL ; d3 e0
add ax, dx ; 01 d0
inc ax ; 40
add ax, bx ; 01 d8
xor dx, dx ; 31 d2
div word [bp-00ah] ; f7 76 f6
mov cx, ax ; 89 c1
mov bl, al ; 88 c3
db 0feh, 0cbh
; dec bl ; fe cb
xor bh, bh ; 30 ff
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 f1 0a
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 f6 0a
mov dx, ax ; 89 c2
mov al, cl ; 88 c8
xor ah, ah ; 30 e4
mul dx ; f7 e2
mov bx, ax ; 89 c3
sal bx, 1 ; d1 e3
mov dx, strict word 0004ch ; ba 4c 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 ef 0a
lea sp, [bp-008h] ; 8d 66 f8
pop si ; 5e
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_load_text_user_pat_: ; 0xc2702 LB 0x85
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000ah ; 83 ec 0a
mov byte [bp-006h], al ; 88 46 fa
mov word [bp-00eh], dx ; 89 56 f2
mov word [bp-00ah], bx ; 89 5e f6
mov word [bp-00ch], cx ; 89 4e f4
call 025cfh ; e8 b6 fe
mov al, byte [bp+006h] ; 8a 46 06
and AL, strict byte 003h ; 24 03
xor ah, ah ; 30 e4
mov CL, strict byte 00eh ; b1 0e
mov bx, ax ; 89 c3
sal bx, CL ; d3 e3
mov al, byte [bp+006h] ; 8a 46 06
and AL, strict byte 004h ; 24 04
mov CL, strict byte 00bh ; b1 0b
sal ax, CL ; d3 e0
add bx, ax ; 01 c3
mov word [bp-008h], bx ; 89 5e f8
xor bx, bx ; 31 db
cmp bx, word [bp-00ch] ; 3b 5e f4
jnc short 0276dh ; 73 32
mov al, byte [bp+008h] ; 8a 46 08
xor ah, ah ; 30 e4
mov si, ax ; 89 c6
mov ax, bx ; 89 d8
mul si ; f7 e6
add ax, word [bp-00ah] ; 03 46 f6
mov di, word [bp+004h] ; 8b 7e 04
add di, bx ; 01 df
mov CL, strict byte 005h ; b1 05
sal di, CL ; d3 e7
add di, word [bp-008h] ; 03 7e f8
mov cx, si ; 89 f1
mov si, ax ; 89 c6
mov dx, word [bp-00eh] ; 8b 56 f2
mov ax, 0a000h ; b8 00 a0
mov es, ax ; 8e c0
cld ; fc
jcxz 0276ah ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
inc bx ; 43
jmp short 02736h ; eb c9
call 025fbh ; e8 8b fe
cmp byte [bp-006h], 010h ; 80 7e fa 10
jc short 0277eh ; 72 08
mov al, byte [bp+008h] ; 8a 46 08
xor ah, ah ; 30 e4
call 0263ah ; e8 bc fe
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00006h ; c2 06 00
biosfn_load_text_8_14_pat_: ; 0xc2787 LB 0x76
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov byte [bp-00ah], al ; 88 46 f6
call 025cfh ; e8 39 fe
mov al, dl ; 88 d0
and AL, strict byte 003h ; 24 03
xor ah, ah ; 30 e4
mov CL, strict byte 00eh ; b1 0e
mov bx, ax ; 89 c3
sal bx, CL ; d3 e3
mov al, dl ; 88 d0
and AL, strict byte 004h ; 24 04
mov CL, strict byte 00bh ; b1 0b
sal ax, CL ; d3 e0
add bx, ax ; 01 c3
mov word [bp-00ch], bx ; 89 5e f4
xor bx, bx ; 31 db
jmp short 027b9h ; eb 06
cmp bx, 00100h ; 81 fb 00 01
jnc short 027e5h ; 73 2c
mov ax, bx ; 89 d8
mov si, strict word 0000eh ; be 0e 00
mul si ; f7 e6
mov CL, strict byte 005h ; b1 05
mov di, bx ; 89 df
sal di, CL ; d3 e7
add di, word [bp-00ch] ; 03 7e f4
mov si, 05bedh ; be ed 5b
add si, ax ; 01 c6
mov cx, strict word 0000eh ; b9 0e 00
mov dx, 0c000h ; ba 00 c0
mov ax, 0a000h ; b8 00 a0
mov es, ax ; 8e c0
cld ; fc
jcxz 027e2h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
inc bx ; 43
jmp short 027b3h ; eb ce
call 025fbh ; e8 13 fe
cmp byte [bp-00ah], 010h ; 80 7e f6 10
jc short 027f4h ; 72 06
mov ax, strict word 0000eh ; b8 0e 00
call 0263ah ; e8 46 fe
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_load_text_8_8_pat_: ; 0xc27fd LB 0x74
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov byte [bp-00ah], al ; 88 46 f6
call 025cfh ; e8 c3 fd
mov al, dl ; 88 d0
and AL, strict byte 003h ; 24 03
xor ah, ah ; 30 e4
mov CL, strict byte 00eh ; b1 0e
mov bx, ax ; 89 c3
sal bx, CL ; d3 e3
mov al, dl ; 88 d0
and AL, strict byte 004h ; 24 04
mov CL, strict byte 00bh ; b1 0b
sal ax, CL ; d3 e0
add bx, ax ; 01 c3
mov word [bp-00ch], bx ; 89 5e f4
xor bx, bx ; 31 db
jmp short 0282fh ; eb 06
cmp bx, 00100h ; 81 fb 00 01
jnc short 02859h ; 73 2a
mov CL, strict byte 003h ; b1 03
mov si, bx ; 89 de
sal si, CL ; d3 e6
mov CL, strict byte 005h ; b1 05
mov di, bx ; 89 df
sal di, CL ; d3 e7
add di, word [bp-00ch] ; 03 7e f4
add si, 053edh ; 81 c6 ed 53
mov cx, strict word 00008h ; b9 08 00
mov dx, 0c000h ; ba 00 c0
mov ax, 0a000h ; b8 00 a0
mov es, ax ; 8e c0
cld ; fc
jcxz 02856h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
inc bx ; 43
jmp short 02829h ; eb d0
call 025fbh ; e8 9f fd
cmp byte [bp-00ah], 010h ; 80 7e f6 10
jc short 02868h ; 72 06
mov ax, strict word 00008h ; b8 08 00
call 0263ah ; e8 d2 fd
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_load_text_8_16_pat_: ; 0xc2871 LB 0x74
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
mov byte [bp-00ah], al ; 88 46 f6
call 025cfh ; e8 4f fd
mov al, dl ; 88 d0
and AL, strict byte 003h ; 24 03
xor ah, ah ; 30 e4
mov CL, strict byte 00eh ; b1 0e
mov bx, ax ; 89 c3
sal bx, CL ; d3 e3
mov al, dl ; 88 d0
and AL, strict byte 004h ; 24 04
mov CL, strict byte 00bh ; b1 0b
sal ax, CL ; d3 e0
add bx, ax ; 01 c3
mov word [bp-00ch], bx ; 89 5e f4
xor bx, bx ; 31 db
jmp short 028a3h ; eb 06
cmp bx, 00100h ; 81 fb 00 01
jnc short 028cdh ; 73 2a
mov CL, strict byte 004h ; b1 04
mov si, bx ; 89 de
sal si, CL ; d3 e6
mov CL, strict byte 005h ; b1 05
mov di, bx ; 89 df
sal di, CL ; d3 e7
add di, word [bp-00ch] ; 03 7e f4
add si, 069edh ; 81 c6 ed 69
mov cx, strict word 00010h ; b9 10 00
mov dx, 0c000h ; ba 00 c0
mov ax, 0a000h ; b8 00 a0
mov es, ax ; 8e c0
cld ; fc
jcxz 028cah ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
inc bx ; 43
jmp short 0289dh ; eb d0
call 025fbh ; e8 2b fd
cmp byte [bp-00ah], 010h ; 80 7e f6 10
jc short 028dch ; 72 06
mov ax, strict word 00010h ; b8 10 00
call 0263ah ; e8 5e fd
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_load_gfx_8_8_chars_: ; 0xc28e5 LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_load_gfx_user_chars_: ; 0xc28ea LB 0x7
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn 00002h ; c2 02 00
biosfn_load_gfx_8_14_chars_: ; 0xc28f1 LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_load_gfx_8_8_dd_chars_: ; 0xc28f6 LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_load_gfx_8_16_chars_: ; 0xc28fb LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_alternate_prtsc_: ; 0xc2900 LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_switch_video_interface_: ; 0xc2905 LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_enable_video_refresh_control_: ; 0xc290a LB 0x5
push bp ; 55
mov bp, sp ; 89 e5
pop bp ; 5d
retn ; c3
biosfn_write_string_: ; 0xc290f LB 0x96
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000ah ; 83 ec 0a
mov byte [bp-008h], al ; 88 46 f8
mov byte [bp-00ah], dl ; 88 56 f6
mov byte [bp-006h], bl ; 88 5e fa
mov si, cx ; 89 ce
mov di, word [bp+00ah] ; 8b 7e 0a
mov al, dl ; 88 d0
xor ah, ah ; 30 e4
lea bx, [bp-00eh] ; 8d 5e f2
lea dx, [bp-00ch] ; 8d 56 f4
call 00a8ch ; e8 5a e1
cmp byte [bp+004h], 0ffh ; 80 7e 04 ff
jne short 02944h ; 75 0c
mov al, byte [bp-00eh] ; 8a 46 f2
mov byte [bp+006h], al ; 88 46 06
mov ax, word [bp-00eh] ; 8b 46 f2
mov byte [bp+004h], ah ; 88 66 04
mov dh, byte [bp+004h] ; 8a 76 04
mov dl, byte [bp+006h] ; 8a 56 06
xor ah, ah ; 30 e4
mov al, byte [bp-00ah] ; 8a 46 f6
call 00e91h ; e8 3f e5
dec si ; 4e
cmp si, strict byte 0ffffh ; 83 fe ff
je short 0298bh ; 74 33
mov dx, di ; 89 fa
inc di ; 47
mov ax, word [bp+008h] ; 8b 46 08
call 031beh ; e8 5d 08
mov cl, al ; 88 c1
test byte [bp-008h], 002h ; f6 46 f8 02
je short 02975h ; 74 0c
mov dx, di ; 89 fa
inc di ; 47
mov ax, word [bp+008h] ; 8b 46 08
call 031beh ; e8 4c 08
mov byte [bp-006h], al ; 88 46 fa
mov al, byte [bp-006h] ; 8a 46 fa
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, ax ; 89 c2
mov al, cl ; 88 c8
mov cx, strict word 00003h ; b9 03 00
call 02370h ; e8 e7 f9
jmp short 02952h ; eb c7
test byte [bp-008h], 001h ; f6 46 f8 01
jne short 0299ch ; 75 0b
mov dx, word [bp-00eh] ; 8b 56 f2
mov al, byte [bp-00ah] ; 8a 46 f6
xor ah, ah ; 30 e4
call 00e91h ; e8 f5 e4
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00008h ; c2 08 00
biosfn_read_state_info_: ; 0xc29a5 LB 0x102
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
push di ; 57
push dx ; 52
push bx ; 53
mov cx, ds ; 8c d9
mov bx, 05383h ; bb 83 53
mov dx, word [bp-00ah] ; 8b 56 f6
mov ax, word [bp-008h] ; 8b 46 f8
call 03208h ; e8 4d 08
mov di, word [bp-00ah] ; 8b 7e f6
add di, strict byte 00004h ; 83 c7 04
mov cx, strict word 0001eh ; b9 1e 00
mov si, strict word 00049h ; be 49 00
mov dx, strict word 00040h ; ba 40 00
mov es, [bp-008h] ; 8e 46 f8
cld ; fc
jcxz 029d6h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
mov di, word [bp-00ah] ; 8b 7e f6
add di, strict byte 00022h ; 83 c7 22
mov cx, strict word 00003h ; b9 03 00
mov si, 00084h ; be 84 00
mov dx, strict word 00040h ; ba 40 00
mov es, [bp-008h] ; 8e 46 f8
cld ; fc
jcxz 029f1h ; e3 06
push DS ; 1e
mov ds, dx ; 8e da
rep movsb ; f3 a4
pop DS ; 1f
mov dx, 0008ah ; ba 8a 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 c4 07
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00025h ; 83 c2 25
mov ax, word [bp-008h] ; 8b 46 f8
call 031cch ; e8 c2 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00026h ; 83 c2 26
xor bx, bx ; 31 db
mov ax, word [bp-008h] ; 8b 46 f8
call 031cch ; e8 b4 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00027h ; 83 c2 27
mov bx, strict word 00010h ; bb 10 00
mov ax, word [bp-008h] ; 8b 46 f8
call 031cch ; e8 a5 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00028h ; 83 c2 28
xor bx, bx ; 31 db
mov ax, word [bp-008h] ; 8b 46 f8
call 031cch ; e8 97 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00029h ; 83 c2 29
mov bx, strict word 00008h ; bb 08 00
mov ax, word [bp-008h] ; 8b 46 f8
call 031cch ; e8 88 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 0002ah ; 83 c2 2a
mov bx, strict word 00002h ; bb 02 00
mov ax, word [bp-008h] ; 8b 46 f8
call 031cch ; e8 79 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 0002bh ; 83 c2 2b
xor bx, bx ; 31 db
mov ax, word [bp-008h] ; 8b 46 f8
call 031cch ; e8 6b 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 0002ch ; 83 c2 2c
xor bx, bx ; 31 db
mov ax, word [bp-008h] ; 8b 46 f8
call 031cch ; e8 5d 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00031h ; 83 c2 31
mov bx, strict word 00003h ; bb 03 00
mov ax, word [bp-008h] ; 8b 46 f8
call 031cch ; e8 4e 07
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, strict byte 00032h ; 83 c2 32
xor bx, bx ; 31 db
mov ax, word [bp-008h] ; 8b 46 f8
call 031cch ; e8 40 07
mov di, word [bp-00ah] ; 8b 7e f6
add di, strict byte 00033h ; 83 c7 33
mov cx, strict word 0000dh ; b9 0d 00
xor ax, ax ; 31 c0
mov es, [bp-008h] ; 8e 46 f8
cld ; fc
jcxz 02a9fh ; e3 02
rep stosb ; f3 aa
lea sp, [bp-006h] ; 8d 66 fa
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
biosfn_read_video_state_size2_: ; 0xc2aa7 LB 0x23
push dx ; 52
push bp ; 55
mov bp, sp ; 89 e5
mov dx, ax ; 89 c2
xor ax, ax ; 31 c0
test dl, 001h ; f6 c2 01
je short 02ab7h ; 74 03
mov ax, strict word 00046h ; b8 46 00
test dl, 002h ; f6 c2 02
je short 02abfh ; 74 03
add ax, strict word 0002ah ; 05 2a 00
test dl, 004h ; f6 c2 04
je short 02ac7h ; 74 03
add ax, 00304h ; 05 04 03
pop bp ; 5d
pop dx ; 5a
retn ; c3
vga_get_video_state_size_: ; 0xc2aca LB 0x12
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
mov bx, dx ; 89 d3
call 02aa7h ; e8 d4 ff
mov word [ss:bx], ax ; 36 89 07
lea sp, [bp-002h] ; 8d 66 fe
pop bx ; 5b
pop bp ; 5d
retn ; c3
biosfn_save_video_state_: ; 0xc2adc LB 0x381
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
push ax ; 50
mov si, dx ; 89 d6
mov cx, bx ; 89 d9
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 e8 06
mov di, ax ; 89 c7
test byte [bp-00ch], 001h ; f6 46 f4 01
je short 02b68h ; 74 6e
mov dx, 003c4h ; ba c4 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 c1 06
inc cx ; 41
mov dx, di ; 89 fa
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 b0 06
inc cx ; 41
mov dx, 003ceh ; ba ce 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 9e 06
inc cx ; 41
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov dx, 003c0h ; ba c0 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-008h], ax ; 89 46 f8
mov al, byte [bp-008h] ; 8a 46 f8
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 80 06
inc cx ; 41
mov dx, 003cah ; ba ca 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 6e 06
mov ax, strict word 00001h ; b8 01 00
mov word [bp-00ah], ax ; 89 46 f6
add cx, ax ; 01 c1
jmp short 02b71h ; eb 09
jmp near 02c6ch ; e9 01 01
cmp word [bp-00ah], strict byte 00004h ; 83 7e f6 04
jnbe short 02b8fh ; 77 1e
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov dx, 003c5h ; ba c5 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 43 06
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02b6bh ; eb dc
xor al, al ; 30 c0
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov dx, 003c5h ; ba c5 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 26 06
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
inc cx ; 41
jmp short 02bb4h ; eb 06
cmp word [bp-00ah], strict byte 00018h ; 83 7e f6 18
jnbe short 02bd1h ; 77 1d
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, di ; 89 fa
out DX, AL ; ee
lea dx, [di+001h] ; 8d 55 01
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 01 06
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02baeh ; eb dd
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
jmp short 02bdeh ; eb 06
cmp word [bp-00ah], strict byte 00013h ; 83 7e f6 13
jnbe short 02c08h ; 77 2a
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov ax, word [bp-008h] ; 8b 46 f8
and ax, strict word 00020h ; 25 20 00
or ax, word [bp-00ah] ; 0b 46 f6
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov dx, 003c1h ; ba c1 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 ca 05
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02bd8h ; eb d0
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
jmp short 02c1bh ; eb 06
cmp word [bp-00ah], strict byte 00008h ; 83 7e f6 08
jnbe short 02c39h ; 77 1e
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, 003ceh ; ba ce 03
out DX, AL ; ee
mov dx, 003cfh ; ba cf 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 99 05
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02c15h ; eb dc
mov bx, di ; 89 fb
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031e8h ; e8 a6 05
inc cx ; 41
inc cx ; 41
xor bx, bx ; 31 db
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 7f 05
inc cx ; 41
xor bx, bx ; 31 db
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 75 05
inc cx ; 41
xor bx, bx ; 31 db
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 6b 05
inc cx ; 41
xor bx, bx ; 31 db
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 61 05
inc cx ; 41
test byte [bp-00ch], 002h ; f6 46 f4 02
jne short 02c75h ; 75 03
jmp near 02de2h ; e9 6d 01
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 40 05
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 43 05
inc cx ; 41
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 47 05
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031e8h ; e8 4c 05
inc cx ; 41
inc cx ; 41
mov dx, strict word 0004ch ; ba 4c 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 33 05
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031e8h ; e8 38 05
inc cx ; 41
inc cx ; 41
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 1f 05
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031e8h ; e8 24 05
inc cx ; 41
inc cx ; 41
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 ef 04
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 f2 04
inc cx ; 41
mov dx, 00085h ; ba 85 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 f6 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031e8h ; e8 fb 04
inc cx ; 41
inc cx ; 41
mov dx, 00087h ; ba 87 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 c6 04
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 c9 04
inc cx ; 41
mov dx, 00088h ; ba 88 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 b1 04
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 b4 04
inc cx ; 41
mov dx, 00089h ; ba 89 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 9c 04
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 9f 04
inc cx ; 41
mov dx, strict word 00060h ; ba 60 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 a3 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031e8h ; e8 a8 04
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
inc cx ; 41
inc cx ; 41
jmp short 02d4fh ; eb 06
cmp word [bp-00ah], strict byte 00008h ; 83 7e f6 08
jnc short 02d6dh ; 73 1e
mov dx, word [bp-00ah] ; 8b 56 f6
sal dx, 1 ; d1 e2
add dx, strict byte 00050h ; 83 c2 50
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 7d 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031e8h ; e8 82 04
inc cx ; 41
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02d49h ; eb dc
mov dx, strict word 0004eh ; ba 4e 00
mov ax, strict word 00040h ; b8 40 00
call 031dah ; e8 64 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031e8h ; e8 69 04
inc cx ; 41
inc cx ; 41
mov dx, strict word 00062h ; ba 62 00
mov ax, strict word 00040h ; b8 40 00
call 031beh ; e8 34 04
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 37 04
inc cx ; 41
mov dx, strict word 0007ch ; ba 7c 00
xor ax, ax ; 31 c0
call 031dah ; e8 3c 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031e8h ; e8 41 04
inc cx ; 41
inc cx ; 41
mov dx, strict word 0007eh ; ba 7e 00
xor ax, ax ; 31 c0
call 031dah ; e8 29 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031e8h ; e8 2e 04
inc cx ; 41
inc cx ; 41
mov dx, 0010ch ; ba 0c 01
xor ax, ax ; 31 c0
call 031dah ; e8 16 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031e8h ; e8 1b 04
inc cx ; 41
inc cx ; 41
mov dx, 0010eh ; ba 0e 01
xor ax, ax ; 31 c0
call 031dah ; e8 03 04
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031e8h ; e8 08 04
inc cx ; 41
inc cx ; 41
test byte [bp-00ch], 004h ; f6 46 f4 04
je short 02e53h ; 74 6b
mov dx, 003c7h ; ba c7 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 d3 03
inc cx ; 41
mov dx, 003c8h ; ba c8 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 c1 03
inc cx ; 41
mov dx, 003c6h ; ba c6 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 af 03
inc cx ; 41
xor al, al ; 30 c0
mov dx, 003c8h ; ba c8 03
out DX, AL ; ee
xor ah, ah ; 30 e4
mov word [bp-00ah], ax ; 89 46 f6
jmp short 02e32h ; eb 07
cmp word [bp-00ah], 00300h ; 81 7e f6 00 03
jnc short 02e49h ; 73 17
mov dx, 003c9h ; ba c9 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 89 03
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02e2bh ; eb e2
xor bx, bx ; 31 db
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031cch ; e8 7a 03
inc cx ; 41
mov ax, cx ; 89 c8
lea sp, [bp-006h] ; 8d 66 fa
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
biosfn_restore_video_state_: ; 0xc2e5d LB 0x336
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
push di ; 57
sub sp, strict byte 00006h ; 83 ec 06
push ax ; 50
mov si, dx ; 89 d6
mov cx, bx ; 89 d9
test byte [bp-00eh], 001h ; f6 46 f2 01
je short 02ec8h ; 74 57
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
lea dx, [bx+040h] ; 8d 57 40
mov ax, si ; 89 f0
call 031dah ; e8 5b 03
mov di, ax ; 89 c7
mov word [bp-00ah], strict word 00001h ; c7 46 f6 01 00
lea cx, [bx+005h] ; 8d 4f 05
jmp short 02e91h ; eb 06
cmp word [bp-00ah], strict byte 00004h ; 83 7e f6 04
jnbe short 02ea9h ; 77 18
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 1f 03
mov dx, 003c5h ; ba c5 03
out DX, AL ; ee
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02e8bh ; eb e2
xor al, al ; 30 c0
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 08 03
mov dx, 003c5h ; ba c5 03
out DX, AL ; ee
inc cx ; 41
mov ax, strict word 00011h ; b8 11 00
mov dx, di ; 89 fa
out DX, ax ; ef
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
jmp short 02ed1h ; eb 09
jmp near 02fbeh ; e9 f3 00
cmp word [bp-00ah], strict byte 00018h ; 83 7e f6 18
jnbe short 02eeeh ; 77 1d
cmp word [bp-00ah], strict byte 00011h ; 83 7e f6 11
je short 02ee8h ; 74 11
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, di ; 89 fa
out DX, AL ; ee
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 da 02
lea dx, [di+001h] ; 8d 55 01
out DX, AL ; ee
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02ecbh ; eb dd
mov dx, 003cch ; ba cc 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
and AL, strict byte 0feh ; 24 fe
mov word [bp-008h], ax ; 89 46 f8
cmp di, 003d4h ; 81 ff d4 03
jne short 02f03h ; 75 04
or byte [bp-008h], 001h ; 80 4e f8 01
mov al, byte [bp-008h] ; 8a 46 f8
mov dx, 003c2h ; ba c2 03
out DX, AL ; ee
mov AL, strict byte 011h ; b0 11
mov dx, di ; 89 fa
out DX, AL ; ee
mov dx, cx ; 89 ca
add dx, strict byte 0fff9h ; 83 c2 f9
mov ax, si ; 89 f0
call 031beh ; e8 a5 02
lea dx, [di+001h] ; 8d 55 01
out DX, AL ; ee
lea dx, [bx+003h] ; 8d 57 03
mov ax, si ; 89 f0
call 031beh ; e8 99 02
xor ah, ah ; 30 e4
mov word [bp-00ch], ax ; 89 46 f4
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
jmp short 02f3dh ; eb 06
cmp word [bp-00ah], strict byte 00013h ; 83 7e f6 13
jnbe short 02f5bh ; 77 1e
mov ax, word [bp-00ch] ; 8b 46 f4
and ax, strict word 00020h ; 25 20 00
or ax, word [bp-00ah] ; 0b 46 f6
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 6d 02
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02f37h ; eb dc
mov al, byte [bp-00ch] ; 8a 46 f4
mov dx, 003c0h ; ba c0 03
out DX, AL ; ee
mov dx, 003dah ; ba da 03
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
jmp short 02f75h ; eb 06
cmp word [bp-00ah], strict byte 00008h ; 83 7e f6 08
jnbe short 02f8dh ; 77 18
mov al, byte [bp-00ah] ; 8a 46 f6
mov dx, 003ceh ; ba ce 03
out DX, AL ; ee
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 3b 02
mov dx, 003cfh ; ba cf 03
out DX, AL ; ee
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 02f6fh ; eb e2
add cx, strict byte 00006h ; 83 c1 06
mov dx, bx ; 89 da
mov ax, si ; 89 f0
call 031beh ; e8 27 02
mov dx, 003c4h ; ba c4 03
out DX, AL ; ee
inc bx ; 43
mov dx, bx ; 89 da
mov ax, si ; 89 f0
call 031beh ; e8 1b 02
mov dx, di ; 89 fa
out DX, AL ; ee
inc bx ; 43
mov dx, bx ; 89 da
mov ax, si ; 89 f0
call 031beh ; e8 10 02
mov dx, 003ceh ; ba ce 03
out DX, AL ; ee
lea dx, [bx+002h] ; 8d 57 02
mov ax, si ; 89 f0
call 031beh ; e8 04 02
lea dx, [di+006h] ; 8d 55 06
out DX, AL ; ee
test byte [bp-00eh], 002h ; f6 46 f2 02
jne short 02fc7h ; 75 03
jmp near 0313ch ; e9 75 01
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 f0 01
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, strict word 00049h ; ba 49 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 f1 01
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031dah ; e8 f7 01
mov bx, ax ; 89 c3
mov dx, strict word 0004ah ; ba 4a 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 fa 01
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031dah ; e8 e3 01
mov bx, ax ; 89 c3
mov dx, strict word 0004ch ; ba 4c 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 e6 01
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031dah ; e8 cf 01
mov bx, ax ; 89 c3
mov dx, strict word 00063h ; ba 63 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 d2 01
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 9f 01
xor ah, ah ; 30 e4
mov bx, ax ; 89 c3
mov dx, 00084h ; ba 84 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 a0 01
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031dah ; e8 a6 01
mov bx, ax ; 89 c3
mov dx, 00085h ; ba 85 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 a9 01
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 76 01
mov dl, al ; 88 c2
xor dh, dh ; 30 f6
mov bx, dx ; 89 d3
mov dx, 00087h ; ba 87 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 75 01
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 5f 01
mov dl, al ; 88 c2
xor dh, dh ; 30 f6
mov bx, dx ; 89 d3
mov dx, 00088h ; ba 88 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 5e 01
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 48 01
mov dl, al ; 88 c2
xor dh, dh ; 30 f6
mov bx, dx ; 89 d3
mov dx, 00089h ; ba 89 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 47 01
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031dah ; e8 4d 01
mov bx, ax ; 89 c3
mov dx, strict word 00060h ; ba 60 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 50 01
mov word [bp-00ah], strict word 00000h ; c7 46 f6 00 00
inc cx ; 41
inc cx ; 41
jmp short 030a7h ; eb 06
cmp word [bp-00ah], strict byte 00008h ; 83 7e f6 08
jnc short 030c5h ; 73 1e
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031dah ; e8 2c 01
mov bx, ax ; 89 c3
mov dx, word [bp-00ah] ; 8b 56 f6
sal dx, 1 ; d1 e2
add dx, strict byte 00050h ; 83 c2 50
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 2a 01
inc cx ; 41
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 030a1h ; eb dc
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031dah ; e8 0e 01
mov bx, ax ; 89 c3
mov dx, strict word 0004eh ; ba 4e 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 11 01
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 de 00
mov dl, al ; 88 c2
xor dh, dh ; 30 f6
mov bx, dx ; 89 d3
mov dx, strict word 00062h ; ba 62 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 dd 00
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031dah ; e8 e3 00
mov bx, ax ; 89 c3
mov dx, strict word 0007ch ; ba 7c 00
xor ax, ax ; 31 c0
call 031e8h ; e8 e7 00
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031dah ; e8 d0 00
mov bx, ax ; 89 c3
mov dx, strict word 0007eh ; ba 7e 00
xor ax, ax ; 31 c0
call 031e8h ; e8 d4 00
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031dah ; e8 bd 00
mov bx, ax ; 89 c3
mov dx, 0010ch ; ba 0c 01
xor ax, ax ; 31 c0
call 031e8h ; e8 c1 00
inc cx ; 41
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031dah ; e8 aa 00
mov bx, ax ; 89 c3
mov dx, 0010eh ; ba 0e 01
xor ax, ax ; 31 c0
call 031e8h ; e8 ae 00
inc cx ; 41
inc cx ; 41
test byte [bp-00eh], 004h ; f6 46 f2 04
je short 03189h ; 74 47
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 74 00
xor ah, ah ; 30 e4
mov word [bp-008h], ax ; 89 46 f8
inc cx ; 41
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 67 00
mov dx, 003c6h ; ba c6 03
out DX, AL ; ee
inc cx ; 41
xor al, al ; 30 c0
mov dx, 003c8h ; ba c8 03
out DX, AL ; ee
xor ah, ah ; 30 e4
mov word [bp-00ah], ax ; 89 46 f6
jmp short 03170h ; eb 07
cmp word [bp-00ah], 00300h ; 81 7e f6 00 03
jnc short 03181h ; 73 11
mov dx, cx ; 89 ca
mov ax, si ; 89 f0
call 031beh ; e8 47 00
mov dx, 003c9h ; ba c9 03
out DX, AL ; ee
inc cx ; 41
inc word [bp-00ah] ; ff 46 f6
jmp short 03169h ; eb e8
inc cx ; 41
mov al, byte [bp-008h] ; 8a 46 f8
mov dx, 003c8h ; ba c8 03
out DX, AL ; ee
mov ax, cx ; 89 c8
lea sp, [bp-006h] ; 8d 66 fa
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
find_vga_entry_: ; 0xc3193 LB 0x2b
push bx ; 53
push cx ; 51
push dx ; 52
push bp ; 55
mov bp, sp ; 89 e5
mov dl, al ; 88 c2
mov AH, strict byte 0ffh ; b4 ff
xor al, al ; 30 c0
jmp short 031a7h ; eb 06
db 0feh, 0c0h
; inc al ; fe c0
cmp AL, strict byte 00fh ; 3c 0f
jnbe short 031b7h ; 77 10
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
mov CL, strict byte 003h ; b1 03
sal bx, CL ; d3 e3
cmp dl, byte [bx+0462fh] ; 3a 97 2f 46
jne short 031a1h ; 75 ec
mov ah, al ; 88 c4
mov al, ah ; 88 e0
pop bp ; 5d
pop dx ; 5a
pop cx ; 59
pop bx ; 5b
retn ; c3
read_byte_: ; 0xc31be 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_: ; 0xc31cc 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_: ; 0xc31da 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_: ; 0xc31e8 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_: ; 0xc31f6 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_: ; 0xc3208 LB 0x96
push si ; 56
push bp ; 55
mov bp, sp ; 89 e5
mov si, dx ; 89 d6
mov es, ax ; 8e c0
mov word [es:si], bx ; 26 89 1c
mov word [es:si+002h], cx ; 26 89 4c 02
pop bp ; 5d
pop si ; 5e
retn ; c3
dec di ; 4f
sbb AL, strict byte 01bh ; 1c 1b
adc dx, word [bp+si] ; 13 12
adc word [bx+si], dx ; 11 10
push CS ; 0e
or ax, 00a0ch ; 0d 0c 0a
or word [bx+si], cx ; 09 08
pop ES ; 07
push ES ; 06
add ax, 00304h ; 05 04 03
add al, byte [bx+di] ; 02 01
add bh, bl ; 00 df
xor ax, 032ceh ; 35 ce 32
or si, word [bp+di] ; 0b 33
sbb word [bp+di], si ; 19 33
and AL, strict byte 033h ; 24 33
xor dh, byte [bp+di] ; 32 33
inc dx ; 42
xor cx, word [bx+di+033h] ; 33 49 33
jc short 03274h ; 72 33
jbe short 03276h ; 76 33
xor word [bp+di], 03396h ; 81 33 96 33
lodsb ; ac
db 033h, 0c5h
; xor ax, bp ; 33 c5
db 033h, 0d7h
; xor dx, di ; 33 d7
db 033h, 0ebh
; xor bp, bx ; 33 eb
db 033h, 0f7h
; xor si, di ; 33 f7
xor bp, word [bp+si-020cch] ; 33 aa 34 df
xor AL, strict byte 006h ; 34 06
xor ax, 0351bh ; 35 1b 35
pop ax ; 58
xor ax, 02430h ; 35 30 24
and sp, word [bp+si] ; 23 22
and word [bx+si], sp ; 21 20
adc AL, strict byte 012h ; 14 12
adc word [bx+si], dx ; 11 10
add AL, strict byte 002h ; 04 02
add word [bx+si], ax ; 01 00
fbstp [di] ; df 35
adc AL, strict byte 034h ; 14 34
xor dh, byte [si] ; 32 34
inc cx ; 41
xor AL, strict byte 050h ; 34 50
xor AL, strict byte 014h ; 34 14
xor AL, strict byte 032h ; 34 32
xor AL, strict byte 041h ; 34 41
xor AL, strict byte 050h ; 34 50
xor AL, strict byte 05fh ; 34 5f
xor AL, strict byte 06bh ; 34 6b
xor AL, strict byte 084h ; 34 84
xor AL, strict byte 089h ; 34 89
xor AL, strict byte 08eh ; 34 8e
xor AL, strict byte 093h ; 34 93
xor AL, strict byte 00ah ; 34 0a
or word [00204h], ax ; 09 06 04 02
add word [bx+si], ax ; 01 00
db 0d3h, 035h
; sal word [di], CL ; d3 35
jle short 032c7h ; 7e 35
mov si, word [di] ; 8b 35
wait ; 9b
xor ax, 035abh ; 35 ab 35
db 0c0h, 035h, 0d3h
; sal byte [di], 0d3h ; c0 35 d3
xor ax, 035d3h ; 35 d3 35
_int10_func: ; 0xc329e LB 0x348
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 al, byte [bp+013h] ; 8a 46 13
xor ah, ah ; 30 e4
cmp ax, strict word 0004fh ; 3d 4f 00
jnbe short 03316h ; 77 65
push CS ; 0e
pop ES ; 07
mov cx, strict word 00016h ; b9 16 00
mov di, 0321ah ; bf 1a 32
repne scasb ; f2 ae
sal cx, 1 ; d1 e1
mov di, cx ; 89 cf
mov bx, word [cs:di+0322fh] ; 2e 8b 9d 2f 32
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
mov dl, byte [bp+012h] ; 8a 56 12
jmp bx ; ff e3
mov al, byte [bp+012h] ; 8a 46 12
xor ah, ah ; 30 e4
call 01019h ; e8 43 dd
mov ax, word [bp+012h] ; 8b 46 12
and ax, strict word 0007fh ; 25 7f 00
cmp ax, strict word 00007h ; 3d 07 00
je short 032f6h ; 74 15
cmp ax, strict word 00006h ; 3d 06 00
je short 032edh ; 74 07
cmp ax, strict word 00005h ; 3d 05 00
jbe short 032f6h ; 76 0b
jmp short 032ffh ; eb 12
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 03fh ; 0c 3f
jmp short 03306h ; eb 10
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 030h ; 0c 30
jmp short 03306h ; eb 07
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 020h ; 0c 20
mov word [bp+012h], ax ; 89 46 12
jmp short 03316h ; eb 0b
mov al, byte [bp+010h] ; 8a 46 10
mov dx, ax ; 89 c2
mov al, byte [bp+011h] ; 8a 46 11
call 00ddeh ; e8 c8 da
jmp near 035dfh ; e9 c6 02
mov dx, word [bp+00eh] ; 8b 56 0e
mov al, byte [bp+00dh] ; 8a 46 0d
call 00e91h ; e8 6f db
jmp short 03316h ; eb f2
lea bx, [bp+00eh] ; 8d 5e 0e
lea dx, [bp+010h] ; 8d 56 10
mov al, byte [bp+00dh] ; 8a 46 0d
call 00a8ch ; e8 5c d7
jmp short 03316h ; eb e4
xor al, al ; 30 c0
mov word [bp+012h], ax ; 89 46 12
mov word [bp+00ch], ax ; 89 46 0c
mov word [bp+010h], ax ; 89 46 10
mov word [bp+00eh], ax ; 89 46 0e
jmp short 03316h ; eb d4
mov al, dl ; 88 d0
call 00f34h ; e8 ed db
jmp short 03316h ; eb cd
mov ax, strict word 00001h ; b8 01 00
push ax ; 50
mov ax, 000ffh ; b8 ff 00
push ax ; 50
mov al, byte [bp+00eh] ; 8a 46 0e
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp+00fh] ; 8a 46 0f
push ax ; 50
mov al, byte [bp+010h] ; 8a 46 10
mov cx, ax ; 89 c1
mov al, byte [bp+011h] ; 8a 46 11
mov bx, ax ; 89 c3
mov al, byte [bp+00dh] ; 8a 46 0d
mov dx, ax ; 89 c2
mov al, byte [bp+012h] ; 8a 46 12
call 01678h ; e8 08 e3
jmp short 03316h ; eb a4
xor al, al ; 30 c0
jmp short 0334ch ; eb d6
lea dx, [bp+012h] ; 8d 56 12
mov al, byte [bp+00dh] ; 8a 46 0d
call 00ad2h ; e8 53 d7
jmp short 03316h ; eb 95
mov cx, word [bp+010h] ; 8b 4e 10
mov al, byte [bp+00ch] ; 8a 46 0c
mov bx, ax ; 89 c3
mov al, byte [bp+00dh] ; 8a 46 0d
mov dx, ax ; 89 c2
mov al, byte [bp+012h] ; 8a 46 12
call 01ecch ; e8 38 eb
jmp short 03316h ; eb 80
mov cx, word [bp+010h] ; 8b 4e 10
mov al, byte [bp+00ch] ; 8a 46 0c
mov bx, ax ; 89 c3
mov al, byte [bp+00dh] ; 8a 46 0d
mov dx, ax ; 89 c2
mov al, byte [bp+012h] ; 8a 46 12
call 0205eh ; e8 b5 ec
jmp near 035dfh ; e9 33 02
mov cx, word [bp+00eh] ; 8b 4e 0e
mov bx, word [bp+010h] ; 8b 5e 10
mov al, dl ; 88 d0
mov dx, ax ; 89 c2
mov al, byte [bp+00dh] ; 8a 46 0d
mov word [bp-006h], ax ; 89 46 fa
mov al, byte [bp-006h] ; 8a 46 fa
call 021f1h ; e8 2f ee
jmp near 035dfh ; e9 1a 02
lea cx, [bp+012h] ; 8d 4e 12
mov bx, word [bp+00eh] ; 8b 5e 0e
mov dx, word [bp+010h] ; 8b 56 10
mov al, byte [bp+00dh] ; 8a 46 0d
call 00bfch ; e8 28 d8
jmp near 035dfh ; e9 08 02
mov cx, strict word 00002h ; b9 02 00
mov al, byte [bp+00ch] ; 8a 46 0c
mov bx, ax ; 89 c3
mov dx, 000ffh ; ba ff 00
mov al, byte [bp+012h] ; 8a 46 12
call 02370h ; e8 88 ef
jmp near 035dfh ; e9 f4 01
mov dx, word [bp+010h] ; 8b 56 10
mov ax, word [bp+00ch] ; 8b 46 0c
call 00d3fh ; e8 4b d9
jmp near 035dfh ; e9 e8 01
cmp ax, strict word 00030h ; 3d 30 00
jnbe short 03468h ; 77 6c
push CS ; 0e
pop ES ; 07
mov cx, strict word 0000fh ; b9 0f 00
mov di, 0325bh ; bf 5b 32
repne scasb ; f2 ae
sal cx, 1 ; d1 e1
mov di, cx ; 89 cf
mov dx, word [cs:di+03269h] ; 2e 8b 95 69 32
mov al, byte [bp+00ch] ; 8a 46 0c
jmp dx ; ff e2
mov al, byte [bp+00dh] ; 8a 46 0d
xor ah, ah ; 30 e4
push ax ; 50
mov al, byte [bp+00ch] ; 8a 46 0c
push ax ; 50
push word [bp+00eh] ; ff 76 0e
mov al, byte [bp+012h] ; 8a 46 12
mov cx, word [bp+010h] ; 8b 4e 10
mov bx, word [bp+008h] ; 8b 5e 08
mov dx, word [bp+016h] ; 8b 56 16
call 02702h ; e8 d2 f2
jmp short 03468h ; eb 36
mov dl, byte [bp+00ch] ; 8a 56 0c
xor dh, dh ; 30 f6
mov al, byte [bp+012h] ; 8a 46 12
xor ah, ah ; 30 e4
call 02787h ; e8 48 f3
jmp short 03468h ; eb 27
mov al, byte [bp+00ch] ; 8a 46 0c
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
mov al, byte [bp+012h] ; 8a 46 12
call 027fdh ; e8 af f3
jmp short 03468h ; eb 18
mov al, byte [bp+00ch] ; 8a 46 0c
xor ah, ah ; 30 e4
mov dx, ax ; 89 c2
mov al, byte [bp+012h] ; 8a 46 12
call 02871h ; e8 14 f4
jmp short 03468h ; eb 09
mov dx, word [bp+008h] ; 8b 56 08
mov ax, word [bp+016h] ; 8b 46 16
call 028e5h ; e8 7d f4
jmp near 035dfh ; e9 74 01
mov al, byte [bp+00eh] ; 8a 46 0e
push ax ; 50
mov al, byte [bp+00ch] ; 8a 46 0c
mov bx, word [bp+010h] ; 8b 5e 10
mov dx, word [bp+008h] ; 8b 56 08
mov si, word [bp+016h] ; 8b 76 16
mov cx, ax ; 89 c1
mov ax, si ; 89 f0
call 028eah ; e8 68 f4
jmp short 03468h ; eb e4
call 028f1h ; e8 6a f4
jmp short 03468h ; eb df
call 028f6h ; e8 6a f4
jmp short 03468h ; eb da
call 028fbh ; e8 6a f4
jmp short 03468h ; eb d5
lea ax, [bp+00eh] ; 8d 46 0e
push ax ; 50
mov al, byte [bp+00dh] ; 8a 46 0d
xor ah, ah ; 30 e4
lea cx, [bp+010h] ; 8d 4e 10
lea bx, [bp+008h] ; 8d 5e 08
lea dx, [bp+016h] ; 8d 56 16
call 00b81h ; e8 d9 d6
jmp short 03468h ; eb be
mov ax, word [bp+00ch] ; 8b 46 0c
xor ah, ah ; 30 e4
cmp ax, strict word 00036h ; 3d 36 00
je short 034d8h ; 74 24
cmp ax, strict word 00035h ; 3d 35 00
je short 034c3h ; 74 0a
cmp ax, strict word 00020h ; 3d 20 00
jne short 03503h ; 75 45
call 02900h ; e8 3f f4
jmp short 03503h ; eb 40
mov al, dl ; 88 d0
mov bx, word [bp+00eh] ; 8b 5e 0e
mov dx, word [bp+016h] ; 8b 56 16
call 02905h ; e8 37 f4
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 012h ; 0c 12
jmp near 03306h ; e9 2e fe
mov al, dl ; 88 d0
call 0290ah ; e8 2d f4
jmp short 034ceh ; eb ef
push word [bp+008h] ; ff 76 08
push word [bp+016h] ; ff 76 16
mov al, byte [bp+00eh] ; 8a 46 0e
push ax ; 50
mov al, byte [bp+00fh] ; 8a 46 0f
push ax ; 50
mov al, byte [bp+00ch] ; 8a 46 0c
mov bx, ax ; 89 c3
mov al, byte [bp+00dh] ; 8a 46 0d
xor dh, dh ; 30 f6
mov si, dx ; 89 d6
mov cx, word [bp+010h] ; 8b 4e 10
mov dx, ax ; 89 c2
mov ax, si ; 89 f0
call 0290fh ; e8 0c f4
jmp near 035dfh ; e9 d9 00
mov bx, si ; 89 f3
mov dx, word [bp+016h] ; 8b 56 16
mov ax, word [bp+00ch] ; 8b 46 0c
call 029a5h ; e8 94 f4
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 01bh ; 0c 1b
jmp near 03306h ; e9 eb fd
cmp ax, strict word 00002h ; 3d 02 00
je short 03542h ; 74 22
cmp ax, strict word 00001h ; 3d 01 00
je short 03534h ; 74 0f
test ax, ax ; 85 c0
jne short 0354eh ; 75 25
lea dx, [bp+00ch] ; 8d 56 0c
mov ax, word [bp+010h] ; 8b 46 10
call 02acah ; e8 98 f5
jmp short 0354eh ; eb 1a
mov bx, word [bp+00ch] ; 8b 5e 0c
mov dx, word [bp+016h] ; 8b 56 16
mov ax, word [bp+010h] ; 8b 46 10
call 02adch ; e8 9c f5
jmp short 0354eh ; eb 0c
mov bx, word [bp+00ch] ; 8b 5e 0c
mov dx, word [bp+016h] ; 8b 56 16
mov ax, word [bp+010h] ; 8b 46 10
call 02e5dh ; e8 0f f9
mov ax, word [bp+012h] ; 8b 46 12
xor al, al ; 30 c0
or AL, strict byte 01ch ; 0c 1c
jmp near 03306h ; e9 ae fd
call 007e8h ; e8 8d d2
test ax, ax ; 85 c0
je short 035d1h ; 74 72
mov ax, word [bp+012h] ; 8b 46 12
xor ah, ah ; 30 e4
cmp ax, strict word 0000ah ; 3d 0a 00
jnbe short 035d3h ; 77 6a
push CS ; 0e
pop ES ; 07
mov cx, strict word 00008h ; b9 08 00
mov di, 03287h ; bf 87 32
repne scasb ; f2 ae
sal cx, 1 ; d1 e1
mov di, cx ; 89 cf
mov ax, word [cs:di+0328eh] ; 2e 8b 85 8e 32
jmp ax ; ff e0
mov bx, si ; 89 f3
mov dx, word [bp+016h] ; 8b 56 16
lea ax, [bp+012h] ; 8d 46 12
call 0379bh ; e8 12 02
jmp short 035dfh ; eb 54
mov cx, si ; 89 f1
mov bx, word [bp+016h] ; 8b 5e 16
mov dx, word [bp+010h] ; 8b 56 10
lea ax, [bp+012h] ; 8d 46 12
call 038cah ; e8 31 03
jmp short 035dfh ; eb 44
mov cx, si ; 89 f1
mov bx, word [bp+016h] ; 8b 5e 16
mov dx, word [bp+00ch] ; 8b 56 0c
lea ax, [bp+012h] ; 8d 46 12
call 03987h ; e8 de 03
jmp short 035dfh ; eb 34
lea ax, [bp+00ch] ; 8d 46 0c
push ax ; 50
mov cx, word [bp+016h] ; 8b 4e 16
mov bx, word [bp+00eh] ; 8b 5e 0e
mov dx, word [bp+010h] ; 8b 56 10
lea ax, [bp+012h] ; 8d 46 12
call 03b70h ; e8 b2 05
jmp short 035dfh ; eb 1f
lea cx, [bp+00eh] ; 8d 4e 0e
lea bx, [bp+010h] ; 8d 5e 10
lea dx, [bp+00ch] ; 8d 56 0c
lea ax, [bp+012h] ; 8d 46 12
call 03bfdh ; e8 2e 06
jmp short 035dfh ; eb 0e
jmp short 035dah ; eb 07
mov word [bp+012h], 00100h ; c7 46 12 00 01
jmp short 035dfh ; eb 05
mov word [bp+012h], 00100h ; c7 46 12 00 01
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
dispi_set_xres_: ; 0xc35e6 LB 0x1f
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bx, ax ; 89 c3
mov ax, strict word 00001h ; b8 01 00
mov dx, 001ceh ; ba ce 01
call 00590h ; e8 9a cf
mov ax, bx ; 89 d8
mov dx, 001cfh ; ba cf 01
call 00590h ; e8 92 cf
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
dispi_set_yres_: ; 0xc3605 LB 0x1f
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bx, ax ; 89 c3
mov ax, strict word 00002h ; b8 02 00
mov dx, 001ceh ; ba ce 01
call 00590h ; e8 7b cf
mov ax, bx ; 89 d8
mov dx, 001cfh ; ba cf 01
call 00590h ; e8 73 cf
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
dispi_get_yres_: ; 0xc3624 LB 0x19
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov ax, strict word 00002h ; b8 02 00
mov dx, 001ceh ; ba ce 01
call 00590h ; e8 5f cf
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 60 cf
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
dispi_set_bpp_: ; 0xc363d LB 0x1f
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bx, ax ; 89 c3
mov ax, strict word 00003h ; b8 03 00
mov dx, 001ceh ; ba ce 01
call 00590h ; e8 43 cf
mov ax, bx ; 89 d8
mov dx, 001cfh ; ba cf 01
call 00590h ; e8 3b cf
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
dispi_get_bpp_: ; 0xc365c LB 0x19
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov ax, strict word 00003h ; b8 03 00
mov dx, 001ceh ; ba ce 01
call 00590h ; e8 27 cf
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 28 cf
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
dispi_set_virt_width_: ; 0xc3675 LB 0x1f
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bx, ax ; 89 c3
mov ax, strict word 00006h ; b8 06 00
mov dx, 001ceh ; ba ce 01
call 00590h ; e8 0b cf
mov ax, bx ; 89 d8
mov dx, 001cfh ; ba cf 01
call 00590h ; e8 03 cf
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
dispi_get_virt_width_: ; 0xc3694 LB 0x19
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov ax, strict word 00006h ; b8 06 00
mov dx, 001ceh ; ba ce 01
call 00590h ; e8 ef ce
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 f0 ce
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
dispi_get_virt_height_: ; 0xc36ad LB 0x19
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
mov ax, strict word 00007h ; b8 07 00
mov dx, 001ceh ; ba ce 01
call 00590h ; e8 d6 ce
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 d7 ce
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
in_word_: ; 0xc36c6 LB 0x12
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
mov bx, ax ; 89 c3
mov ax, dx ; 89 d0
mov dx, bx ; 89 da
out DX, ax ; ef
in ax, DX ; ed
lea sp, [bp-002h] ; 8d 66 fe
pop bx ; 5b
pop bp ; 5d
retn ; c3
in_byte_: ; 0xc36d8 LB 0x14
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
mov bx, ax ; 89 c3
mov ax, dx ; 89 d0
mov dx, bx ; 89 da
out DX, ax ; ef
in AL, DX ; ec
db 02ah, 0e4h
; sub ah, ah ; 2a e4
lea sp, [bp-002h] ; 8d 66 fe
pop bx ; 5b
pop bp ; 5d
retn ; c3
dispi_get_id_: ; 0xc36ec LB 0x14
push bp ; 55
mov bp, sp ; 89 e5
push dx ; 52
xor ax, ax ; 31 c0
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, 001cfh ; ba cf 01
in ax, DX ; ed
lea sp, [bp-002h] ; 8d 66 fe
pop dx ; 5a
pop bp ; 5d
retn ; c3
dispi_set_id_: ; 0xc3700 LB 0x1a
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov bx, ax ; 89 c3
xor ax, ax ; 31 c0
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov ax, bx ; 89 d8
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
vbe_init_: ; 0xc371a LB 0x2c
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push dx ; 52
mov ax, 0b0c0h ; b8 c0 b0
call 03700h ; e8 db ff
call 036ech ; e8 c4 ff
cmp ax, 0b0c0h ; 3d c0 b0
jne short 0373fh ; 75 12
mov bx, strict word 00001h ; bb 01 00
mov dx, 000b9h ; ba b9 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 93 fa
mov ax, 0b0c4h ; b8 c4 b0
call 03700h ; e8 c1 ff
lea sp, [bp-004h] ; 8d 66 fc
pop dx ; 5a
pop bx ; 5b
pop bp ; 5d
retn ; c3
mode_info_find_mode_: ; 0xc3746 LB 0x55
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
mov di, ax ; 89 c7
mov si, dx ; 89 d6
xor dx, dx ; 31 d2
mov ax, 003b6h ; b8 b6 03
call 036c6h ; e8 6d ff
cmp ax, 077cch ; 3d cc 77
jne short 03790h ; 75 32
mov bx, strict word 00004h ; bb 04 00
mov dx, bx ; 89 da
mov ax, 003b6h ; b8 b6 03
call 036c6h ; e8 5d ff
mov cx, ax ; 89 c1
cmp cx, strict byte 0ffffh ; 83 f9 ff
je short 03790h ; 74 20
lea dx, [bx+002h] ; 8d 57 02
mov ax, 003b6h ; b8 b6 03
call 036c6h ; e8 4d ff
lea dx, [bx+044h] ; 8d 57 44
cmp cx, di ; 39 f9
jne short 0378ch ; 75 0c
test si, si ; 85 f6
jne short 03788h ; 75 04
mov ax, bx ; 89 d8
jmp short 03792h ; eb 0a
test AL, strict byte 080h ; a8 80
jne short 03784h ; 75 f8
mov bx, dx ; 89 d3
jmp short 03763h ; eb d3
xor ax, ax ; 31 c0
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
vbe_biosfn_return_controller_information_: ; 0xc379b LB 0x12f
push bp ; 55
mov bp, sp ; 89 e5
push cx ; 51
push si ; 56
push di ; 57
sub sp, strict byte 0000ah ; 83 ec 0a
mov si, ax ; 89 c6
mov di, dx ; 89 d7
mov word [bp-00ah], bx ; 89 5e f6
mov word [bp-00ch], strict word 00022h ; c7 46 f4 22 00
call 005dah ; e8 27 ce
mov word [bp-010h], ax ; 89 46 f0
mov bx, word [bp-00ah] ; 8b 5e f6
mov word [bp-008h], di ; 89 7e f8
xor dx, dx ; 31 d2
mov ax, 003b6h ; b8 b6 03
call 036c6h ; e8 02 ff
cmp ax, 077cch ; 3d cc 77
je short 037d3h ; 74 0a
push SS ; 16
pop ES ; 07
mov word [es:si], 00100h ; 26 c7 04 00 01
jmp near 038c2h ; e9 ef 00
mov cx, strict word 00004h ; b9 04 00
mov word [bp-00eh], strict word 00000h ; c7 46 f2 00 00
mov es, [bp-008h] ; 8e 46 f8
cmp word [es:bx+002h], 03245h ; 26 81 7f 02 45 32
jne short 037edh ; 75 07
cmp word [es:bx], 04256h ; 26 81 3f 56 42
je short 037fch ; 74 0f
cmp word [es:bx+002h], 04153h ; 26 81 7f 02 53 41
jne short 03801h ; 75 0c
cmp word [es:bx], 04556h ; 26 81 3f 56 45
jne short 03801h ; 75 05
mov word [bp-00eh], strict word 00001h ; c7 46 f2 01 00
mov es, [bp-008h] ; 8e 46 f8
mov word [es:bx], 04556h ; 26 c7 07 56 45
mov word [es:bx+002h], 04153h ; 26 c7 47 02 53 41
mov word [es:bx+004h], 00200h ; 26 c7 47 04 00 02
mov word [es:bx+006h], 07c66h ; 26 c7 47 06 66 7c
mov [es:bx+008h], ds ; 26 8c 5f 08
mov word [es:bx+00ah], strict word 00001h ; 26 c7 47 0a 01 00
mov word [es:bx+00ch], strict word 00000h ; 26 c7 47 0c 00 00
mov word [es:bx+010h], di ; 26 89 7f 10
mov ax, word [bp-00ah] ; 8b 46 f6
add ax, strict word 00022h ; 05 22 00
mov word [es:bx+00eh], ax ; 26 89 47 0e
mov dx, strict word 0ffffh ; ba ff ff
mov ax, 003b6h ; b8 b6 03
call 036c6h ; e8 84 fe
mov es, [bp-008h] ; 8e 46 f8
mov word [es:bx+012h], ax ; 26 89 47 12
cmp word [bp-00eh], strict byte 00000h ; 83 7e f2 00
je short 03873h ; 74 24
mov word [es:bx+014h], strict word 00003h ; 26 c7 47 14 03 00
mov word [es:bx+016h], 07c7bh ; 26 c7 47 16 7b 7c
mov [es:bx+018h], ds ; 26 8c 5f 18
mov word [es:bx+01ah], 07c8eh ; 26 c7 47 1a 8e 7c
mov [es:bx+01ch], ds ; 26 8c 5f 1c
mov word [es:bx+01eh], 07cafh ; 26 c7 47 1e af 7c
mov [es:bx+020h], ds ; 26 8c 5f 20
mov dx, cx ; 89 ca
add dx, strict byte 0001bh ; 83 c2 1b
mov ax, 003b6h ; b8 b6 03
call 036d8h ; e8 5a fe
xor ah, ah ; 30 e4
cmp ax, word [bp-010h] ; 3b 46 f0
jnbe short 0389eh ; 77 19
mov dx, cx ; 89 ca
mov ax, 003b6h ; b8 b6 03
call 036c6h ; e8 39 fe
mov bx, ax ; 89 c3
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, word [bp-00ch] ; 03 56 f4
mov ax, di ; 89 f8
call 031e8h ; e8 4e f9
add word [bp-00ch], strict byte 00002h ; 83 46 f4 02
add cx, strict byte 00044h ; 83 c1 44
mov dx, cx ; 89 ca
mov ax, 003b6h ; b8 b6 03
call 036c6h ; e8 1d fe
mov bx, ax ; 89 c3
cmp ax, strict word 0ffffh ; 3d ff ff
jne short 03873h ; 75 c3
mov dx, word [bp-00ah] ; 8b 56 f6
add dx, word [bp-00ch] ; 03 56 f4
mov ax, di ; 89 f8
call 031e8h ; e8 2d f9
push SS ; 16
pop ES ; 07
mov word [es:si], strict word 0004fh ; 26 c7 04 4f 00
lea sp, [bp-006h] ; 8d 66 fa
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bp ; 5d
retn ; c3
vbe_biosfn_return_mode_information_: ; 0xc38ca LB 0xbd
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
push ax ; 50
push ax ; 50
mov ax, dx ; 89 d0
mov si, bx ; 89 de
mov word [bp-006h], cx ; 89 4e fa
test dh, 040h ; f6 c6 40
je short 038e3h ; 74 05
mov dx, strict word 00001h ; ba 01 00
jmp short 038e5h ; eb 02
xor dx, dx ; 31 d2
and ah, 001h ; 80 e4 01
call 03746h ; e8 5b fe
mov word [bp-008h], ax ; 89 46 f8
test ax, ax ; 85 c0
je short 03928h ; 74 36
mov cx, 00100h ; b9 00 01
xor ax, ax ; 31 c0
mov di, word [bp-006h] ; 8b 7e fa
mov es, si ; 8e c6
cld ; fc
jcxz 03901h ; e3 02
rep stosb ; f3 aa
xor cx, cx ; 31 c9
jmp short 0390ah ; eb 05
cmp cx, strict byte 00042h ; 83 f9 42
jnc short 0392ah ; 73 20
mov dx, word [bp-008h] ; 8b 56 f8
inc dx ; 42
inc dx ; 42
add dx, cx ; 01 ca
mov ax, 003b6h ; b8 b6 03
call 036d8h ; e8 c1 fd
mov bl, al ; 88 c3
xor bh, bh ; 30 ff
mov dx, word [bp-006h] ; 8b 56 fa
add dx, cx ; 01 ca
mov ax, si ; 89 f0
call 031cch ; e8 a7 f8
inc cx ; 41
jmp short 03905h ; eb dd
jmp short 03975h ; eb 4b
mov dx, word [bp-006h] ; 8b 56 fa
inc dx ; 42
inc dx ; 42
mov ax, si ; 89 f0
call 031beh ; e8 8a f8
test AL, strict byte 001h ; a8 01
je short 03954h ; 74 1c
mov dx, word [bp-006h] ; 8b 56 fa
add dx, strict byte 0000ch ; 83 c2 0c
mov bx, 0064ch ; bb 4c 06
mov ax, si ; 89 f0
call 031e8h ; e8 a2 f8
mov dx, word [bp-006h] ; 8b 56 fa
add dx, strict byte 0000eh ; 83 c2 0e
mov bx, 0c000h ; bb 00 c0
mov ax, si ; 89 f0
call 031e8h ; e8 94 f8
mov ax, strict word 0000bh ; b8 0b 00
mov dx, 001ceh ; ba ce 01
call 00590h ; e8 33 cc
mov dx, 001cfh ; ba cf 01
call 00597h ; e8 34 cc
mov dx, word [bp-006h] ; 8b 56 fa
add dx, strict byte 0002ah ; 83 c2 2a
mov bx, ax ; 89 c3
mov ax, si ; 89 f0
call 031e8h ; e8 78 f8
mov ax, strict word 0004fh ; b8 4f 00
jmp short 03978h ; eb 03
mov ax, 00100h ; b8 00 01
push SS ; 16
pop ES ; 07
mov bx, word [bp-00ah] ; 8b 5e f6
mov word [es:bx], ax ; 26 89 07
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
vbe_biosfn_set_mode_: ; 0xc3987 LB 0xeb
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 00006h ; 83 ec 06
mov si, ax ; 89 c6
mov word [bp-00ah], dx ; 89 56 f6
test byte [bp-009h], 040h ; f6 46 f7 40
je short 0399fh ; 74 05
mov ax, strict word 00001h ; b8 01 00
jmp short 039a1h ; eb 02
xor ax, ax ; 31 c0
mov dx, ax ; 89 c2
test ax, ax ; 85 c0
je short 039aah ; 74 03
mov ax, strict word 00040h ; b8 40 00
mov byte [bp-006h], al ; 88 46 fa
test byte [bp-009h], 080h ; f6 46 f7 80
je short 039b8h ; 74 05
mov ax, 00080h ; b8 80 00
jmp short 039bah ; eb 02
xor ax, ax ; 31 c0
mov byte [bp-008h], al ; 88 46 f8
and byte [bp-009h], 001h ; 80 66 f7 01
cmp word [bp-00ah], 00100h ; 81 7e f6 00 01
jnc short 039dbh ; 73 13
xor ax, ax ; 31 c0
call 00600h ; e8 33 cc
mov al, byte [bp-00ah] ; 8a 46 f6
xor ah, ah ; 30 e4
call 01019h ; e8 44 d6
mov ax, strict word 0004fh ; b8 4f 00
jmp near 03a68h ; e9 8d 00
mov ax, word [bp-00ah] ; 8b 46 f6
call 03746h ; e8 65 fd
mov bx, ax ; 89 c3
test ax, ax ; 85 c0
jne short 039eah ; 75 03
jmp near 03a65h ; e9 7b 00
lea dx, [bx+014h] ; 8d 57 14
mov ax, 003b6h ; b8 b6 03
call 036c6h ; e8 d3 fc
mov cx, ax ; 89 c1
lea dx, [bx+016h] ; 8d 57 16
mov ax, 003b6h ; b8 b6 03
call 036c6h ; e8 c8 fc
mov di, ax ; 89 c7
lea dx, [bx+01bh] ; 8d 57 1b
mov ax, 003b6h ; b8 b6 03
call 036d8h ; e8 cf fc
mov bl, al ; 88 c3
mov dl, al ; 88 c2
xor ax, ax ; 31 c0
call 00600h ; e8 ee cb
cmp bl, 004h ; 80 fb 04
jne short 03a1dh ; 75 06
mov ax, strict word 0006ah ; b8 6a 00
call 01019h ; e8 fc d5
mov al, dl ; 88 d0
xor ah, ah ; 30 e4
call 0363dh ; e8 19 fc
mov ax, cx ; 89 c8
call 035e6h ; e8 bd fb
mov ax, di ; 89 f8
call 03605h ; e8 d7 fb
xor ax, ax ; 31 c0
call 00626h ; e8 f3 cb
mov al, byte [bp-008h] ; 8a 46 f8
or AL, strict byte 001h ; 0c 01
xor ah, ah ; 30 e4
mov dl, byte [bp-006h] ; 8a 56 fa
or al, dl ; 08 d0
call 00600h ; e8 be cb
call 006f8h ; e8 b3 cc
mov bx, word [bp-00ah] ; 8b 5e f6
mov dx, 000bah ; ba ba 00
mov ax, strict word 00040h ; b8 40 00
call 031e8h ; e8 97 f7
mov bl, byte [bp-008h] ; 8a 5e f8
or bl, 060h ; 80 cb 60
xor bh, bh ; 30 ff
mov dx, 00087h ; ba 87 00
mov ax, strict word 00040h ; b8 40 00
call 031cch ; e8 6a f7
jmp near 039d5h ; e9 70 ff
mov ax, 00100h ; b8 00 01
mov word [ss:si], ax ; 36 89 04
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
vbe_biosfn_read_video_state_size_: ; 0xc3a72 LB 0x8
push bp ; 55
mov bp, sp ; 89 e5
mov ax, strict word 00012h ; b8 12 00
pop bp ; 5d
retn ; c3
vbe_biosfn_save_video_state_: ; 0xc3a7a LB 0x5b
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push di ; 57
push ax ; 50
mov di, ax ; 89 c7
mov cx, dx ; 89 d1
mov ax, strict word 00004h ; b8 04 00
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, 001cfh ; ba cf 01
in ax, DX ; ed
mov word [bp-00ah], ax ; 89 46 f6
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, di ; 89 f8
call 031e8h ; e8 4b f7
inc cx ; 41
inc cx ; 41
test byte [bp-00ah], 001h ; f6 46 f6 01
je short 03acch ; 74 27
mov si, strict word 00001h ; be 01 00
jmp short 03aafh ; eb 05
cmp si, strict byte 00009h ; 83 fe 09
jnbe short 03acch ; 77 1d
cmp si, strict byte 00004h ; 83 fe 04
je short 03ac9h ; 74 15
mov ax, si ; 89 f0
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, 001cfh ; ba cf 01
in ax, DX ; ed
mov bx, ax ; 89 c3
mov dx, cx ; 89 ca
mov ax, di ; 89 f8
call 031e8h ; e8 21 f7
inc cx ; 41
inc cx ; 41
inc si ; 46
jmp short 03aaah ; eb de
lea sp, [bp-008h] ; 8d 66 f8
pop di ; 5f
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
vbe_biosfn_restore_video_state_: ; 0xc3ad5 LB 0x9b
push bp ; 55
mov bp, sp ; 89 e5
push bx ; 53
push cx ; 51
push si ; 56
push ax ; 50
mov cx, ax ; 89 c1
mov bx, dx ; 89 d3
call 031dah ; e8 f7 f6
mov word [bp-008h], ax ; 89 46 f8
inc bx ; 43
inc bx ; 43
test byte [bp-008h], 001h ; f6 46 f8 01
jne short 03afeh ; 75 10
mov ax, strict word 00004h ; b8 04 00
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov ax, word [bp-008h] ; 8b 46 f8
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
jmp short 03b68h ; eb 6a
mov ax, strict word 00001h ; b8 01 00
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, bx ; 89 da
mov ax, cx ; 89 c8
call 031dah ; e8 ce f6
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
inc bx ; 43
inc bx ; 43
mov ax, strict word 00002h ; b8 02 00
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, bx ; 89 da
mov ax, cx ; 89 c8
call 031dah ; e8 ba f6
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
inc bx ; 43
inc bx ; 43
mov ax, strict word 00003h ; b8 03 00
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, bx ; 89 da
mov ax, cx ; 89 c8
call 031dah ; e8 a6 f6
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
inc bx ; 43
inc bx ; 43
mov ax, strict word 00004h ; b8 04 00
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov ax, word [bp-008h] ; 8b 46 f8
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
mov si, strict word 00005h ; be 05 00
jmp short 03b52h ; eb 05
cmp si, strict byte 00009h ; 83 fe 09
jnbe short 03b68h ; 77 16
mov ax, si ; 89 f0
mov dx, 001ceh ; ba ce 01
out DX, ax ; ef
mov dx, bx ; 89 da
mov ax, cx ; 89 c8
call 031dah ; e8 7b f6
mov dx, 001cfh ; ba cf 01
out DX, ax ; ef
inc bx ; 43
inc bx ; 43
inc si ; 46
jmp short 03b4dh ; eb e5
lea sp, [bp-006h] ; 8d 66 fa
pop si ; 5e
pop cx ; 59
pop bx ; 5b
pop bp ; 5d
retn ; c3
vbe_biosfn_save_restore_state_: ; 0xc3b70 LB 0x8d
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
push ax ; 50
mov si, ax ; 89 c6
mov word [bp-006h], dx ; 89 56 fa
mov ax, bx ; 89 d8
mov bx, word [bp+004h] ; 8b 5e 04
mov di, strict word 0004fh ; bf 4f 00
xor ah, ah ; 30 e4
cmp ax, strict word 00002h ; 3d 02 00
je short 03bd0h ; 74 46
cmp ax, strict word 00001h ; 3d 01 00
je short 03bb4h ; 74 25
test ax, ax ; 85 c0
jne short 03bech ; 75 59
mov ax, word [bp-006h] ; 8b 46 fa
call 02aa7h ; e8 0e ef
mov cx, ax ; 89 c1
test byte [bp-006h], 008h ; f6 46 fa 08
je short 03ba6h ; 74 05
call 03a72h ; e8 ce fe
add ax, cx ; 01 c8
add ax, strict word 0003fh ; 05 3f 00
mov CL, strict byte 006h ; b1 06
shr ax, CL ; d3 e8
push SS ; 16
pop ES ; 07
mov word [es:bx], ax ; 26 89 07
jmp short 03befh ; eb 3b
push SS ; 16
pop ES ; 07
mov bx, word [es:bx] ; 26 8b 1f
mov dx, cx ; 89 ca
mov ax, word [bp-006h] ; 8b 46 fa
call 02adch ; e8 1b ef
test byte [bp-006h], 008h ; f6 46 fa 08
je short 03befh ; 74 28
mov dx, ax ; 89 c2
mov ax, cx ; 89 c8
call 03a7ah ; e8 ac fe
jmp short 03befh ; eb 1f
push SS ; 16
pop ES ; 07
mov bx, word [es:bx] ; 26 8b 1f
mov dx, cx ; 89 ca
mov ax, word [bp-006h] ; 8b 46 fa
call 02e5dh ; e8 80 f2
test byte [bp-006h], 008h ; f6 46 fa 08
je short 03befh ; 74 0c
mov dx, ax ; 89 c2
mov ax, cx ; 89 c8
call 03ad5h ; e8 eb fe
jmp short 03befh ; eb 03
mov di, 00100h ; bf 00 01
push SS ; 16
pop ES ; 07
mov word [es:si], di ; 26 89 3c
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn 00002h ; c2 02 00
vbe_biosfn_get_set_scanline_length_: ; 0xc3bfd LB 0xe2
push bp ; 55
mov bp, sp ; 89 e5
push si ; 56
push di ; 57
sub sp, strict byte 0000ah ; 83 ec 0a
push ax ; 50
mov di, dx ; 89 d7
mov word [bp-006h], bx ; 89 5e fa
mov si, cx ; 89 ce
call 0365ch ; e8 4c fa
cmp AL, strict byte 00fh ; 3c 0f
jne short 03c19h ; 75 05
mov cx, strict word 00010h ; b9 10 00
jmp short 03c1dh ; eb 04
xor ah, ah ; 30 e4
mov cx, ax ; 89 c1
mov ch, cl ; 88 cd
call 03694h ; e8 72 fa
mov word [bp-00ah], ax ; 89 46 f6
mov word [bp-00ch], strict word 0004fh ; c7 46 f4 4f 00
push SS ; 16
pop ES ; 07
mov bx, word [bp-006h] ; 8b 5e fa
mov bx, word [es:bx] ; 26 8b 1f
mov al, byte [es:di] ; 26 8a 05
cmp AL, strict byte 002h ; 3c 02
je short 03c44h ; 74 0b
cmp AL, strict byte 001h ; 3c 01
je short 03c6dh ; 74 30
test al, al ; 84 c0
je short 03c68h ; 74 27
jmp near 03cc8h ; e9 84 00
cmp ch, 004h ; 80 fd 04
jne short 03c4fh ; 75 06
mov CL, strict byte 003h ; b1 03
sal bx, CL ; d3 e3
jmp short 03c68h ; eb 19
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
cwd ; 99
mov CL, strict byte 003h ; b1 03
sal dx, CL ; d3 e2
db 01bh, 0c2h
; sbb ax, dx ; 1b c2
sar ax, CL ; d3 f8
mov word [bp-00eh], ax ; 89 46 f2
mov ax, bx ; 89 d8
xor dx, dx ; 31 d2
div word [bp-00eh] ; f7 76 f2
mov bx, ax ; 89 c3
mov ax, bx ; 89 d8
call 03675h ; e8 08 fa
call 03694h ; e8 24 fa
mov word [bp-008h], ax ; 89 46 f8
push SS ; 16
pop ES ; 07
mov bx, word [bp-006h] ; 8b 5e fa
mov word [es:bx], ax ; 26 89 07
cmp ch, 004h ; 80 fd 04
jne short 03c88h ; 75 08
mov CL, strict byte 003h ; b1 03
mov bx, ax ; 89 c3
shr bx, CL ; d3 eb
jmp short 03c9eh ; eb 16
mov al, ch ; 88 e8
xor ah, ah ; 30 e4
cwd ; 99
mov CL, strict byte 003h ; b1 03
sal dx, CL ; d3 e2
db 01bh, 0c2h
; sbb ax, dx ; 1b c2
sar ax, CL ; d3 f8
mov bx, ax ; 89 c3
mov ax, word [bp-008h] ; 8b 46 f8
mul bx ; f7 e3
mov bx, ax ; 89 c3
add bx, strict byte 00003h ; 83 c3 03
and bl, 0fch ; 80 e3 fc
push SS ; 16
pop ES ; 07
mov word [es:di], bx ; 26 89 1d
call 036adh ; e8 01 fa
push SS ; 16
pop ES ; 07
mov word [es:si], ax ; 26 89 04
call 03624h ; e8 70 f9
push SS ; 16
pop ES ; 07
cmp ax, word [es:si] ; 26 3b 04
jbe short 03ccdh ; 76 12
mov ax, word [bp-00ah] ; 8b 46 f6
call 03675h ; e8 b4 f9
mov word [bp-00ch], 00200h ; c7 46 f4 00 02
jmp short 03ccdh ; eb 05
mov word [bp-00ch], 00100h ; c7 46 f4 00 01
push SS ; 16
pop ES ; 07
mov ax, word [bp-00ch] ; 8b 46 f4
mov bx, word [bp-010h] ; 8b 5e f0
mov word [es:bx], ax ; 26 89 07
lea sp, [bp-004h] ; 8d 66 fc
pop di ; 5f
pop si ; 5e
pop bp ; 5d
retn ; c3
; Padding 0x721 bytes at 0xc3cdf
times 1825 db 0
section VBE32 progbits vstart=0x4400 align=1 ; size=0x115 class=CODE group=AUTO
vesa_pm_start: ; 0xc4400 LB 0x114
sbb byte [bx+si], al ; 18 00
dec di ; 4f
add byte [bx+si], dl ; 00 10
add word [bx+si], cx ; 01 08
add dh, cl ; 00 ce
add di, cx ; 01 cf
add di, cx ; 01 cf
add ax, dx ; 01 d0
add word [bp-048fdh], si ; 01 b6 03 b7
db 003h, 0ffh
; add di, di ; 03 ff
db 0ffh
db 0ffh
jmp word [bp-07dh] ; ff 66 83
sti ; fb
add byte [si+005h], dh ; 00 74 05
mov eax, strict dword 066c30100h ; 66 b8 00 01 c3 66
db 08bh, 0c2h
; mov ax, dx ; 8b c2
push edx ; 66 52
push eax ; 66 50
mov edx, strict dword 0b86601ceh ; 66 ba ce 01 66 b8
add ax, 06600h ; 05 00 66
out DX, ax ; ef
pop eax ; 66 58
mov edx, strict dword 0ef6601cfh ; 66 ba cf 01 66 ef
in eax, DX ; 66 ed
pop edx ; 66 5a
db 066h, 03bh, 0d0h
; cmp edx, eax ; 66 3b d0
jne short 0444ah ; 75 05
mov eax, strict dword 066c3004fh ; 66 b8 4f 00 c3 66
mov ax, 0014fh ; b8 4f 01
retn ; c3
cmp bl, 080h ; 80 fb 80
je short 0445eh ; 74 0a
cmp bl, 000h ; 80 fb 00
je short 0446eh ; 74 15
mov eax, strict dword 052c30100h ; 66 b8 00 01 c3 52
mov edx, strict dword 0a8ec03dah ; 66 ba da 03 ec a8
or byte [di-005h], dh ; 08 75 fb
in AL, DX ; ec
test AL, strict byte 008h ; a8 08
je short 04468h ; 74 fb
pop dx ; 5a
push ax ; 50
push cx ; 51
push dx ; 52
push si ; 56
push di ; 57
sal dx, 010h ; c1 e2 10
and cx, strict word 0ffffh ; 81 e1 ff ff
add byte [bx+si], al ; 00 00
db 00bh, 0cah
; or cx, dx ; 0b ca
sal cx, 002h ; c1 e1 02
db 08bh, 0c1h
; mov ax, cx ; 8b c1
push ax ; 50
mov edx, strict dword 0b86601ceh ; 66 ba ce 01 66 b8
push ES ; 06
add byte [bp-011h], ah ; 00 66 ef
mov edx, strict dword 0ed6601cfh ; 66 ba cf 01 66 ed
db 00fh, 0b7h, 0c8h
; movzx cx, ax ; 0f b7 c8
mov edx, strict dword 0b86601ceh ; 66 ba ce 01 66 b8
add ax, word [bx+si] ; 03 00
out DX, eax ; 66 ef
mov edx, strict dword 0ed6601cfh ; 66 ba cf 01 66 ed
db 00fh, 0b7h, 0f0h
; movzx si, ax ; 0f b7 f0
pop ax ; 58
cmp si, strict byte 00004h ; 83 fe 04
je short 044c7h ; 74 17
add si, strict byte 00007h ; 83 c6 07
shr si, 003h ; c1 ee 03
imul cx, si ; 0f af ce
db 033h, 0d2h
; xor dx, dx ; 33 d2
div cx ; f7 f1
db 08bh, 0f8h
; mov di, ax ; 8b f8
db 08bh, 0c2h
; mov ax, dx ; 8b c2
db 033h, 0d2h
; xor dx, dx ; 33 d2
div si ; f7 f6
jmp short 044d3h ; eb 0c
shr cx, 1 ; d1 e9
db 033h, 0d2h
; xor dx, dx ; 33 d2
div cx ; f7 f1
db 08bh, 0f8h
; mov di, ax ; 8b f8
db 08bh, 0c2h
; mov ax, dx ; 8b c2
sal ax, 1 ; d1 e0
push edx ; 66 52
push eax ; 66 50
mov edx, strict dword 0b86601ceh ; 66 ba ce 01 66 b8
or byte [bx+si], al ; 08 00
out DX, eax ; 66 ef
pop eax ; 66 58
mov edx, strict dword 0ef6601cfh ; 66 ba cf 01 66 ef
pop edx ; 66 5a
db 066h, 08bh, 0c7h
; mov eax, edi ; 66 8b c7
push edx ; 66 52
push eax ; 66 50
mov edx, strict dword 0b86601ceh ; 66 ba ce 01 66 b8
or word [bx+si], ax ; 09 00
out DX, eax ; 66 ef
pop eax ; 66 58
mov edx, strict dword 0ef6601cfh ; 66 ba cf 01 66 ef
pop edx ; 66 5a
pop di ; 5f
pop si ; 5e
pop dx ; 5a
pop cx ; 59
pop ax ; 58
mov eax, strict dword 066c3004fh ; 66 b8 4f 00 c3 66
mov ax, 0014fh ; b8 4f 01
vesa_pm_end: ; 0xc4514 LB 0x1
retn ; c3
; Padding 0xeb bytes at 0xc4515
times 235 db 0
section _DATA progbits vstart=0x4600 align=1 ; size=0x3727 class=DATA group=DGROUP
_msg_vga_init: ; 0xc4600 LB 0x2f
db 'Oracle VM VirtualBox Version 5.2.35 VGA BIOS', 00dh, 00ah, 000h
_vga_modes: ; 0xc462f LB 0x80
db 000h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 001h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h
db 002h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h, 003h, 000h, 000h, 004h, 000h, 0b8h, 0ffh, 002h
db 004h, 001h, 002h, 002h, 000h, 0b8h, 0ffh, 001h, 005h, 001h, 002h, 002h, 000h, 0b8h, 0ffh, 001h
db 006h, 001h, 002h, 001h, 000h, 0b8h, 0ffh, 001h, 007h, 000h, 001h, 004h, 000h, 0b0h, 0ffh, 000h
db 00dh, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 001h, 00eh, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 001h
db 00fh, 001h, 003h, 001h, 000h, 0a0h, 0ffh, 000h, 010h, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h
db 011h, 001h, 003h, 001h, 000h, 0a0h, 0ffh, 002h, 012h, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h
db 013h, 001h, 005h, 008h, 000h, 0a0h, 0ffh, 003h, 06ah, 001h, 004h, 004h, 000h, 0a0h, 0ffh, 002h
_line_to_vpti: ; 0xc46af LB 0x10
db 017h, 017h, 018h, 018h, 004h, 005h, 006h, 007h, 00dh, 00eh, 011h, 012h, 01ah, 01bh, 01ch, 01dh
_dac_regs: ; 0xc46bf LB 0x4
dd 0ff3f3f3fh
_video_param_table: ; 0xc46c3 LB 0x780
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 028h, 018h, 008h, 000h, 008h, 009h, 003h, 000h, 002h, 063h, 02dh, 027h, 028h, 090h, 02bh, 080h
db 0bfh, 01fh, 000h, 0c1h, 000h, 000h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 014h, 000h, 096h
db 0b9h, 0a2h, 0ffh, 000h, 013h, 015h, 017h, 002h, 004h, 006h, 007h, 010h, 011h, 012h, 013h, 014h
db 015h, 016h, 017h, 001h, 000h, 003h, 000h, 000h, 000h, 000h, 000h, 000h, 030h, 00fh, 00fh, 0ffh
db 028h, 018h, 008h, 000h, 008h, 009h, 003h, 000h, 002h, 063h, 02dh, 027h, 028h, 090h, 02bh, 080h
db 0bfh, 01fh, 000h, 0c1h, 000h, 000h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 014h, 000h, 096h
db 0b9h, 0a2h, 0ffh, 000h, 013h, 015h, 017h, 002h, 004h, 006h, 007h, 010h, 011h, 012h, 013h, 014h
db 015h, 016h, 017h, 001h, 000h, 003h, 000h, 000h, 000h, 000h, 000h, 000h, 030h, 00fh, 00fh, 0ffh
db 050h, 018h, 008h, 000h, 010h, 001h, 001h, 000h, 006h, 063h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 0bfh, 01fh, 000h, 0c1h, 000h, 000h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 000h, 096h
db 0b9h, 0c2h, 0ffh, 000h, 017h, 017h, 017h, 017h, 017h, 017h, 017h, 017h, 017h, 017h, 017h, 017h
db 017h, 017h, 017h, 001h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 00dh, 00fh, 0ffh
db 050h, 018h, 010h, 000h, 010h, 000h, 003h, 000h, 002h, 066h, 05fh, 04fh, 050h, 082h, 055h, 081h
db 0bfh, 01fh, 000h, 04fh, 00dh, 00eh, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 00fh, 096h
db 0b9h, 0a3h, 0ffh, 000h, 008h, 008h, 008h, 008h, 008h, 008h, 008h, 010h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 00eh, 000h, 00fh, 008h, 000h, 000h, 000h, 000h, 000h, 010h, 00ah, 00fh, 0ffh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 028h, 018h, 008h, 000h, 020h, 009h, 00fh, 000h, 006h, 063h, 02dh, 027h, 028h, 090h, 02bh, 080h
db 0bfh, 01fh, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 014h, 000h, 096h
db 0b9h, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h, 010h, 011h, 012h, 013h, 014h
db 015h, 016h, 017h, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
db 050h, 018h, 008h, 000h, 040h, 001h, 00fh, 000h, 006h, 063h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 0bfh, 01fh, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 000h, 096h
db 0b9h, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h, 010h, 011h, 012h, 013h, 014h
db 015h, 016h, 017h, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 050h, 018h, 00eh, 000h, 080h, 001h, 00fh, 000h, 006h, 0a3h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 0bfh, 01fh, 000h, 040h, 000h, 000h, 000h, 000h, 000h, 000h, 083h, 085h, 05dh, 028h, 00fh, 063h
db 0bah, 0e3h, 0ffh, 000h, 008h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 008h, 000h, 000h, 000h
db 018h, 000h, 000h, 001h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
db 050h, 018h, 00eh, 000h, 080h, 001h, 00fh, 000h, 006h, 0a3h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 0bfh, 01fh, 000h, 040h, 000h, 000h, 000h, 000h, 000h, 000h, 083h, 085h, 05dh, 028h, 00fh, 063h
db 0bah, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch
db 03dh, 03eh, 03fh, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 050h, 018h, 00eh, 000h, 010h, 000h, 003h, 000h, 002h, 067h, 05fh, 04fh, 050h, 082h, 055h, 081h
db 0bfh, 01fh, 000h, 04fh, 00dh, 00eh, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 01fh, 096h
db 0b9h, 0a3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch
db 03dh, 03eh, 03fh, 00ch, 000h, 00fh, 008h, 000h, 000h, 000h, 000h, 000h, 010h, 00eh, 00fh, 0ffh
db 028h, 018h, 010h, 000h, 008h, 008h, 003h, 000h, 002h, 067h, 02dh, 027h, 028h, 090h, 02bh, 0a0h
db 0bfh, 01fh, 000h, 04fh, 00dh, 00eh, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 014h, 01fh, 096h
db 0b9h, 0a3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch
db 03dh, 03eh, 03fh, 00ch, 000h, 00fh, 008h, 000h, 000h, 000h, 000h, 000h, 010h, 00eh, 00fh, 0ffh
db 050h, 018h, 010h, 000h, 010h, 000h, 003h, 000h, 002h, 067h, 05fh, 04fh, 050h, 082h, 055h, 081h
db 0bfh, 01fh, 000h, 04fh, 00dh, 00eh, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 01fh, 096h
db 0b9h, 0a3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch
db 03dh, 03eh, 03fh, 00ch, 000h, 00fh, 008h, 000h, 000h, 000h, 000h, 000h, 010h, 00eh, 00fh, 0ffh
db 050h, 018h, 010h, 000h, 010h, 000h, 003h, 000h, 002h, 066h, 05fh, 04fh, 050h, 082h, 055h, 081h
db 0bfh, 01fh, 000h, 04fh, 00dh, 00eh, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 00fh, 096h
db 0b9h, 0a3h, 0ffh, 000h, 008h, 008h, 008h, 008h, 008h, 008h, 008h, 010h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 00eh, 000h, 00fh, 008h, 000h, 000h, 000h, 000h, 000h, 010h, 00ah, 00fh, 0ffh
db 050h, 01dh, 010h, 000h, 000h, 001h, 00fh, 000h, 006h, 0e3h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 00bh, 03eh, 000h, 040h, 000h, 000h, 000h, 000h, 000h, 000h, 0eah, 08ch, 0dfh, 028h, 000h, 0e7h
db 004h, 0e3h, 0ffh, 000h, 03fh, 000h, 03fh, 000h, 03fh, 000h, 03fh, 000h, 03fh, 000h, 03fh, 000h
db 03fh, 000h, 03fh, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
db 050h, 01dh, 010h, 000h, 000h, 001h, 00fh, 000h, 006h, 0e3h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 00bh, 03eh, 000h, 040h, 000h, 000h, 000h, 000h, 000h, 000h, 0eah, 08ch, 0dfh, 028h, 000h, 0e7h
db 004h, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch
db 03dh, 03eh, 03fh, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
db 028h, 018h, 008h, 000h, 000h, 001h, 00fh, 000h, 00eh, 063h, 05fh, 04fh, 050h, 082h, 054h, 080h
db 0bfh, 01fh, 000h, 041h, 000h, 000h, 000h, 000h, 000h, 000h, 09ch, 08eh, 08fh, 028h, 040h, 096h
db 0b9h, 0a3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 006h, 007h, 008h, 009h, 00ah, 00bh, 00ch
db 00dh, 00eh, 00fh, 041h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 040h, 005h, 00fh, 0ffh
db 064h, 024h, 010h, 000h, 000h, 001h, 00fh, 000h, 006h, 0e3h, 07fh, 063h, 063h, 083h, 06bh, 01bh
db 072h, 0f0h, 000h, 060h, 000h, 000h, 000h, 000h, 000h, 000h, 059h, 08dh, 057h, 032h, 000h, 057h
db 073h, 0e3h, 0ffh, 000h, 001h, 002h, 003h, 004h, 005h, 014h, 007h, 038h, 039h, 03ah, 03bh, 03ch
db 03dh, 03eh, 03fh, 001h, 000h, 00fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 005h, 00fh, 0ffh
_palette0: ; 0xc4e43 LB 0xc0
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah
db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah
db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah
db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh
db 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah
db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah
db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah
db 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 02ah, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh
db 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh, 03fh
_palette1: ; 0xc4f03 LB 0xc0
db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah
db 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah
db 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah, 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah
db 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh, 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh
db 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh
db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh
db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah
db 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah
db 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah, 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah
db 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh, 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh
db 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh
db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh
_palette2: ; 0xc4fc3 LB 0xc0
db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah
db 000h, 02ah, 02ah, 02ah, 000h, 02ah, 02ah, 02ah, 000h, 000h, 015h, 000h, 000h, 03fh, 000h, 02ah
db 015h, 000h, 02ah, 03fh, 02ah, 000h, 015h, 02ah, 000h, 03fh, 02ah, 02ah, 015h, 02ah, 02ah, 03fh
db 000h, 015h, 000h, 000h, 015h, 02ah, 000h, 03fh, 000h, 000h, 03fh, 02ah, 02ah, 015h, 000h, 02ah
db 015h, 02ah, 02ah, 03fh, 000h, 02ah, 03fh, 02ah, 000h, 015h, 015h, 000h, 015h, 03fh, 000h, 03fh
db 015h, 000h, 03fh, 03fh, 02ah, 015h, 015h, 02ah, 015h, 03fh, 02ah, 03fh, 015h, 02ah, 03fh, 03fh
db 015h, 000h, 000h, 015h, 000h, 02ah, 015h, 02ah, 000h, 015h, 02ah, 02ah, 03fh, 000h, 000h, 03fh
db 000h, 02ah, 03fh, 02ah, 000h, 03fh, 02ah, 02ah, 015h, 000h, 015h, 015h, 000h, 03fh, 015h, 02ah
db 015h, 015h, 02ah, 03fh, 03fh, 000h, 015h, 03fh, 000h, 03fh, 03fh, 02ah, 015h, 03fh, 02ah, 03fh
db 015h, 015h, 000h, 015h, 015h, 02ah, 015h, 03fh, 000h, 015h, 03fh, 02ah, 03fh, 015h, 000h, 03fh
db 015h, 02ah, 03fh, 03fh, 000h, 03fh, 03fh, 02ah, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh
db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh
_palette3: ; 0xc5083 LB 0x300
db 000h, 000h, 000h, 000h, 000h, 02ah, 000h, 02ah, 000h, 000h, 02ah, 02ah, 02ah, 000h, 000h, 02ah
db 000h, 02ah, 02ah, 015h, 000h, 02ah, 02ah, 02ah, 015h, 015h, 015h, 015h, 015h, 03fh, 015h, 03fh
db 015h, 015h, 03fh, 03fh, 03fh, 015h, 015h, 03fh, 015h, 03fh, 03fh, 03fh, 015h, 03fh, 03fh, 03fh
db 000h, 000h, 000h, 005h, 005h, 005h, 008h, 008h, 008h, 00bh, 00bh, 00bh, 00eh, 00eh, 00eh, 011h
db 011h, 011h, 014h, 014h, 014h, 018h, 018h, 018h, 01ch, 01ch, 01ch, 020h, 020h, 020h, 024h, 024h
db 024h, 028h, 028h, 028h, 02dh, 02dh, 02dh, 032h, 032h, 032h, 038h, 038h, 038h, 03fh, 03fh, 03fh
db 000h, 000h, 03fh, 010h, 000h, 03fh, 01fh, 000h, 03fh, 02fh, 000h, 03fh, 03fh, 000h, 03fh, 03fh
db 000h, 02fh, 03fh, 000h, 01fh, 03fh, 000h, 010h, 03fh, 000h, 000h, 03fh, 010h, 000h, 03fh, 01fh
db 000h, 03fh, 02fh, 000h, 03fh, 03fh, 000h, 02fh, 03fh, 000h, 01fh, 03fh, 000h, 010h, 03fh, 000h
db 000h, 03fh, 000h, 000h, 03fh, 010h, 000h, 03fh, 01fh, 000h, 03fh, 02fh, 000h, 03fh, 03fh, 000h
db 02fh, 03fh, 000h, 01fh, 03fh, 000h, 010h, 03fh, 01fh, 01fh, 03fh, 027h, 01fh, 03fh, 02fh, 01fh
db 03fh, 037h, 01fh, 03fh, 03fh, 01fh, 03fh, 03fh, 01fh, 037h, 03fh, 01fh, 02fh, 03fh, 01fh, 027h
db 03fh, 01fh, 01fh, 03fh, 027h, 01fh, 03fh, 02fh, 01fh, 03fh, 037h, 01fh, 03fh, 03fh, 01fh, 037h
db 03fh, 01fh, 02fh, 03fh, 01fh, 027h, 03fh, 01fh, 01fh, 03fh, 01fh, 01fh, 03fh, 027h, 01fh, 03fh
db 02fh, 01fh, 03fh, 037h, 01fh, 03fh, 03fh, 01fh, 037h, 03fh, 01fh, 02fh, 03fh, 01fh, 027h, 03fh
db 02dh, 02dh, 03fh, 031h, 02dh, 03fh, 036h, 02dh, 03fh, 03ah, 02dh, 03fh, 03fh, 02dh, 03fh, 03fh
db 02dh, 03ah, 03fh, 02dh, 036h, 03fh, 02dh, 031h, 03fh, 02dh, 02dh, 03fh, 031h, 02dh, 03fh, 036h
db 02dh, 03fh, 03ah, 02dh, 03fh, 03fh, 02dh, 03ah, 03fh, 02dh, 036h, 03fh, 02dh, 031h, 03fh, 02dh
db 02dh, 03fh, 02dh, 02dh, 03fh, 031h, 02dh, 03fh, 036h, 02dh, 03fh, 03ah, 02dh, 03fh, 03fh, 02dh
db 03ah, 03fh, 02dh, 036h, 03fh, 02dh, 031h, 03fh, 000h, 000h, 01ch, 007h, 000h, 01ch, 00eh, 000h
db 01ch, 015h, 000h, 01ch, 01ch, 000h, 01ch, 01ch, 000h, 015h, 01ch, 000h, 00eh, 01ch, 000h, 007h
db 01ch, 000h, 000h, 01ch, 007h, 000h, 01ch, 00eh, 000h, 01ch, 015h, 000h, 01ch, 01ch, 000h, 015h
db 01ch, 000h, 00eh, 01ch, 000h, 007h, 01ch, 000h, 000h, 01ch, 000h, 000h, 01ch, 007h, 000h, 01ch
db 00eh, 000h, 01ch, 015h, 000h, 01ch, 01ch, 000h, 015h, 01ch, 000h, 00eh, 01ch, 000h, 007h, 01ch
db 00eh, 00eh, 01ch, 011h, 00eh, 01ch, 015h, 00eh, 01ch, 018h, 00eh, 01ch, 01ch, 00eh, 01ch, 01ch
db 00eh, 018h, 01ch, 00eh, 015h, 01ch, 00eh, 011h, 01ch, 00eh, 00eh, 01ch, 011h, 00eh, 01ch, 015h
db 00eh, 01ch, 018h, 00eh, 01ch, 01ch, 00eh, 018h, 01ch, 00eh, 015h, 01ch, 00eh, 011h, 01ch, 00eh
db 00eh, 01ch, 00eh, 00eh, 01ch, 011h, 00eh, 01ch, 015h, 00eh, 01ch, 018h, 00eh, 01ch, 01ch, 00eh
db 018h, 01ch, 00eh, 015h, 01ch, 00eh, 011h, 01ch, 014h, 014h, 01ch, 016h, 014h, 01ch, 018h, 014h
db 01ch, 01ah, 014h, 01ch, 01ch, 014h, 01ch, 01ch, 014h, 01ah, 01ch, 014h, 018h, 01ch, 014h, 016h
db 01ch, 014h, 014h, 01ch, 016h, 014h, 01ch, 018h, 014h, 01ch, 01ah, 014h, 01ch, 01ch, 014h, 01ah
db 01ch, 014h, 018h, 01ch, 014h, 016h, 01ch, 014h, 014h, 01ch, 014h, 014h, 01ch, 016h, 014h, 01ch
db 018h, 014h, 01ch, 01ah, 014h, 01ch, 01ch, 014h, 01ah, 01ch, 014h, 018h, 01ch, 014h, 016h, 01ch
db 000h, 000h, 010h, 004h, 000h, 010h, 008h, 000h, 010h, 00ch, 000h, 010h, 010h, 000h, 010h, 010h
db 000h, 00ch, 010h, 000h, 008h, 010h, 000h, 004h, 010h, 000h, 000h, 010h, 004h, 000h, 010h, 008h
db 000h, 010h, 00ch, 000h, 010h, 010h, 000h, 00ch, 010h, 000h, 008h, 010h, 000h, 004h, 010h, 000h
db 000h, 010h, 000h, 000h, 010h, 004h, 000h, 010h, 008h, 000h, 010h, 00ch, 000h, 010h, 010h, 000h
db 00ch, 010h, 000h, 008h, 010h, 000h, 004h, 010h, 008h, 008h, 010h, 00ah, 008h, 010h, 00ch, 008h
db 010h, 00eh, 008h, 010h, 010h, 008h, 010h, 010h, 008h, 00eh, 010h, 008h, 00ch, 010h, 008h, 00ah
db 010h, 008h, 008h, 010h, 00ah, 008h, 010h, 00ch, 008h, 010h, 00eh, 008h, 010h, 010h, 008h, 00eh
db 010h, 008h, 00ch, 010h, 008h, 00ah, 010h, 008h, 008h, 010h, 008h, 008h, 010h, 00ah, 008h, 010h
db 00ch, 008h, 010h, 00eh, 008h, 010h, 010h, 008h, 00eh, 010h, 008h, 00ch, 010h, 008h, 00ah, 010h
db 00bh, 00bh, 010h, 00ch, 00bh, 010h, 00dh, 00bh, 010h, 00fh, 00bh, 010h, 010h, 00bh, 010h, 010h
db 00bh, 00fh, 010h, 00bh, 00dh, 010h, 00bh, 00ch, 010h, 00bh, 00bh, 010h, 00ch, 00bh, 010h, 00dh
db 00bh, 010h, 00fh, 00bh, 010h, 010h, 00bh, 00fh, 010h, 00bh, 00dh, 010h, 00bh, 00ch, 010h, 00bh
db 00bh, 010h, 00bh, 00bh, 010h, 00ch, 00bh, 010h, 00dh, 00bh, 010h, 00fh, 00bh, 010h, 010h, 00bh
db 00fh, 010h, 00bh, 00dh, 010h, 00bh, 00ch, 010h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_static_functionality: ; 0xc5383 LB 0x10
db 0ffh, 0e0h, 00fh, 000h, 000h, 000h, 000h, 007h, 002h, 008h, 0e7h, 00ch, 000h, 000h, 000h, 000h
_dcc_table: ; 0xc5393 LB 0x24
db 010h, 001h, 007h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h
_secondary_save_area: ; 0xc53b7 LB 0x1a
db 01ah, 000h, 093h, 053h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_video_save_pointer_table: ; 0xc53d1 LB 0x1c
db 0c3h, 046h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 0b7h, 053h, 000h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_vgafont8: ; 0xc53ed LB 0x800
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07eh, 081h, 0a5h, 081h, 0bdh, 099h, 081h, 07eh
db 07eh, 0ffh, 0dbh, 0ffh, 0c3h, 0e7h, 0ffh, 07eh, 06ch, 0feh, 0feh, 0feh, 07ch, 038h, 010h, 000h
db 010h, 038h, 07ch, 0feh, 07ch, 038h, 010h, 000h, 038h, 07ch, 038h, 0feh, 0feh, 07ch, 038h, 07ch
db 010h, 010h, 038h, 07ch, 0feh, 07ch, 038h, 07ch, 000h, 000h, 018h, 03ch, 03ch, 018h, 000h, 000h
db 0ffh, 0ffh, 0e7h, 0c3h, 0c3h, 0e7h, 0ffh, 0ffh, 000h, 03ch, 066h, 042h, 042h, 066h, 03ch, 000h
db 0ffh, 0c3h, 099h, 0bdh, 0bdh, 099h, 0c3h, 0ffh, 00fh, 007h, 00fh, 07dh, 0cch, 0cch, 0cch, 078h
db 03ch, 066h, 066h, 066h, 03ch, 018h, 07eh, 018h, 03fh, 033h, 03fh, 030h, 030h, 070h, 0f0h, 0e0h
db 07fh, 063h, 07fh, 063h, 063h, 067h, 0e6h, 0c0h, 099h, 05ah, 03ch, 0e7h, 0e7h, 03ch, 05ah, 099h
db 080h, 0e0h, 0f8h, 0feh, 0f8h, 0e0h, 080h, 000h, 002h, 00eh, 03eh, 0feh, 03eh, 00eh, 002h, 000h
db 018h, 03ch, 07eh, 018h, 018h, 07eh, 03ch, 018h, 066h, 066h, 066h, 066h, 066h, 000h, 066h, 000h
db 07fh, 0dbh, 0dbh, 07bh, 01bh, 01bh, 01bh, 000h, 03eh, 063h, 038h, 06ch, 06ch, 038h, 0cch, 078h
db 000h, 000h, 000h, 000h, 07eh, 07eh, 07eh, 000h, 018h, 03ch, 07eh, 018h, 07eh, 03ch, 018h, 0ffh
db 018h, 03ch, 07eh, 018h, 018h, 018h, 018h, 000h, 018h, 018h, 018h, 018h, 07eh, 03ch, 018h, 000h
db 000h, 018h, 00ch, 0feh, 00ch, 018h, 000h, 000h, 000h, 030h, 060h, 0feh, 060h, 030h, 000h, 000h
db 000h, 000h, 0c0h, 0c0h, 0c0h, 0feh, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h
db 000h, 018h, 03ch, 07eh, 0ffh, 0ffh, 000h, 000h, 000h, 0ffh, 0ffh, 07eh, 03ch, 018h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 030h, 078h, 078h, 030h, 030h, 000h, 030h, 000h
db 06ch, 06ch, 06ch, 000h, 000h, 000h, 000h, 000h, 06ch, 06ch, 0feh, 06ch, 0feh, 06ch, 06ch, 000h
db 030h, 07ch, 0c0h, 078h, 00ch, 0f8h, 030h, 000h, 000h, 0c6h, 0cch, 018h, 030h, 066h, 0c6h, 000h
db 038h, 06ch, 038h, 076h, 0dch, 0cch, 076h, 000h, 060h, 060h, 0c0h, 000h, 000h, 000h, 000h, 000h
db 018h, 030h, 060h, 060h, 060h, 030h, 018h, 000h, 060h, 030h, 018h, 018h, 018h, 030h, 060h, 000h
db 000h, 066h, 03ch, 0ffh, 03ch, 066h, 000h, 000h, 000h, 030h, 030h, 0fch, 030h, 030h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 030h, 030h, 060h, 000h, 000h, 000h, 0fch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 030h, 030h, 000h, 006h, 00ch, 018h, 030h, 060h, 0c0h, 080h, 000h
db 07ch, 0c6h, 0ceh, 0deh, 0f6h, 0e6h, 07ch, 000h, 030h, 070h, 030h, 030h, 030h, 030h, 0fch, 000h
db 078h, 0cch, 00ch, 038h, 060h, 0cch, 0fch, 000h, 078h, 0cch, 00ch, 038h, 00ch, 0cch, 078h, 000h
db 01ch, 03ch, 06ch, 0cch, 0feh, 00ch, 01eh, 000h, 0fch, 0c0h, 0f8h, 00ch, 00ch, 0cch, 078h, 000h
db 038h, 060h, 0c0h, 0f8h, 0cch, 0cch, 078h, 000h, 0fch, 0cch, 00ch, 018h, 030h, 030h, 030h, 000h
db 078h, 0cch, 0cch, 078h, 0cch, 0cch, 078h, 000h, 078h, 0cch, 0cch, 07ch, 00ch, 018h, 070h, 000h
db 000h, 030h, 030h, 000h, 000h, 030h, 030h, 000h, 000h, 030h, 030h, 000h, 000h, 030h, 030h, 060h
db 018h, 030h, 060h, 0c0h, 060h, 030h, 018h, 000h, 000h, 000h, 0fch, 000h, 000h, 0fch, 000h, 000h
db 060h, 030h, 018h, 00ch, 018h, 030h, 060h, 000h, 078h, 0cch, 00ch, 018h, 030h, 000h, 030h, 000h
db 07ch, 0c6h, 0deh, 0deh, 0deh, 0c0h, 078h, 000h, 030h, 078h, 0cch, 0cch, 0fch, 0cch, 0cch, 000h
db 0fch, 066h, 066h, 07ch, 066h, 066h, 0fch, 000h, 03ch, 066h, 0c0h, 0c0h, 0c0h, 066h, 03ch, 000h
db 0f8h, 06ch, 066h, 066h, 066h, 06ch, 0f8h, 000h, 0feh, 062h, 068h, 078h, 068h, 062h, 0feh, 000h
db 0feh, 062h, 068h, 078h, 068h, 060h, 0f0h, 000h, 03ch, 066h, 0c0h, 0c0h, 0ceh, 066h, 03eh, 000h
db 0cch, 0cch, 0cch, 0fch, 0cch, 0cch, 0cch, 000h, 078h, 030h, 030h, 030h, 030h, 030h, 078h, 000h
db 01eh, 00ch, 00ch, 00ch, 0cch, 0cch, 078h, 000h, 0e6h, 066h, 06ch, 078h, 06ch, 066h, 0e6h, 000h
db 0f0h, 060h, 060h, 060h, 062h, 066h, 0feh, 000h, 0c6h, 0eeh, 0feh, 0feh, 0d6h, 0c6h, 0c6h, 000h
db 0c6h, 0e6h, 0f6h, 0deh, 0ceh, 0c6h, 0c6h, 000h, 038h, 06ch, 0c6h, 0c6h, 0c6h, 06ch, 038h, 000h
db 0fch, 066h, 066h, 07ch, 060h, 060h, 0f0h, 000h, 078h, 0cch, 0cch, 0cch, 0dch, 078h, 01ch, 000h
db 0fch, 066h, 066h, 07ch, 06ch, 066h, 0e6h, 000h, 078h, 0cch, 0e0h, 070h, 01ch, 0cch, 078h, 000h
db 0fch, 0b4h, 030h, 030h, 030h, 030h, 078h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 0fch, 000h
db 0cch, 0cch, 0cch, 0cch, 0cch, 078h, 030h, 000h, 0c6h, 0c6h, 0c6h, 0d6h, 0feh, 0eeh, 0c6h, 000h
db 0c6h, 0c6h, 06ch, 038h, 038h, 06ch, 0c6h, 000h, 0cch, 0cch, 0cch, 078h, 030h, 030h, 078h, 000h
db 0feh, 0c6h, 08ch, 018h, 032h, 066h, 0feh, 000h, 078h, 060h, 060h, 060h, 060h, 060h, 078h, 000h
db 0c0h, 060h, 030h, 018h, 00ch, 006h, 002h, 000h, 078h, 018h, 018h, 018h, 018h, 018h, 078h, 000h
db 010h, 038h, 06ch, 0c6h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh
db 030h, 030h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 078h, 00ch, 07ch, 0cch, 076h, 000h
db 0e0h, 060h, 060h, 07ch, 066h, 066h, 0dch, 000h, 000h, 000h, 078h, 0cch, 0c0h, 0cch, 078h, 000h
db 01ch, 00ch, 00ch, 07ch, 0cch, 0cch, 076h, 000h, 000h, 000h, 078h, 0cch, 0fch, 0c0h, 078h, 000h
db 038h, 06ch, 060h, 0f0h, 060h, 060h, 0f0h, 000h, 000h, 000h, 076h, 0cch, 0cch, 07ch, 00ch, 0f8h
db 0e0h, 060h, 06ch, 076h, 066h, 066h, 0e6h, 000h, 030h, 000h, 070h, 030h, 030h, 030h, 078h, 000h
db 00ch, 000h, 00ch, 00ch, 00ch, 0cch, 0cch, 078h, 0e0h, 060h, 066h, 06ch, 078h, 06ch, 0e6h, 000h
db 070h, 030h, 030h, 030h, 030h, 030h, 078h, 000h, 000h, 000h, 0cch, 0feh, 0feh, 0d6h, 0c6h, 000h
db 000h, 000h, 0f8h, 0cch, 0cch, 0cch, 0cch, 000h, 000h, 000h, 078h, 0cch, 0cch, 0cch, 078h, 000h
db 000h, 000h, 0dch, 066h, 066h, 07ch, 060h, 0f0h, 000h, 000h, 076h, 0cch, 0cch, 07ch, 00ch, 01eh
db 000h, 000h, 0dch, 076h, 066h, 060h, 0f0h, 000h, 000h, 000h, 07ch, 0c0h, 078h, 00ch, 0f8h, 000h
db 010h, 030h, 07ch, 030h, 030h, 034h, 018h, 000h, 000h, 000h, 0cch, 0cch, 0cch, 0cch, 076h, 000h
db 000h, 000h, 0cch, 0cch, 0cch, 078h, 030h, 000h, 000h, 000h, 0c6h, 0d6h, 0feh, 0feh, 06ch, 000h
db 000h, 000h, 0c6h, 06ch, 038h, 06ch, 0c6h, 000h, 000h, 000h, 0cch, 0cch, 0cch, 07ch, 00ch, 0f8h
db 000h, 000h, 0fch, 098h, 030h, 064h, 0fch, 000h, 01ch, 030h, 030h, 0e0h, 030h, 030h, 01ch, 000h
db 018h, 018h, 018h, 000h, 018h, 018h, 018h, 000h, 0e0h, 030h, 030h, 01ch, 030h, 030h, 0e0h, 000h
db 076h, 0dch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 000h
db 078h, 0cch, 0c0h, 0cch, 078h, 018h, 00ch, 078h, 000h, 0cch, 000h, 0cch, 0cch, 0cch, 07eh, 000h
db 01ch, 000h, 078h, 0cch, 0fch, 0c0h, 078h, 000h, 07eh, 0c3h, 03ch, 006h, 03eh, 066h, 03fh, 000h
db 0cch, 000h, 078h, 00ch, 07ch, 0cch, 07eh, 000h, 0e0h, 000h, 078h, 00ch, 07ch, 0cch, 07eh, 000h
db 030h, 030h, 078h, 00ch, 07ch, 0cch, 07eh, 000h, 000h, 000h, 078h, 0c0h, 0c0h, 078h, 00ch, 038h
db 07eh, 0c3h, 03ch, 066h, 07eh, 060h, 03ch, 000h, 0cch, 000h, 078h, 0cch, 0fch, 0c0h, 078h, 000h
db 0e0h, 000h, 078h, 0cch, 0fch, 0c0h, 078h, 000h, 0cch, 000h, 070h, 030h, 030h, 030h, 078h, 000h
db 07ch, 0c6h, 038h, 018h, 018h, 018h, 03ch, 000h, 0e0h, 000h, 070h, 030h, 030h, 030h, 078h, 000h
db 0c6h, 038h, 06ch, 0c6h, 0feh, 0c6h, 0c6h, 000h, 030h, 030h, 000h, 078h, 0cch, 0fch, 0cch, 000h
db 01ch, 000h, 0fch, 060h, 078h, 060h, 0fch, 000h, 000h, 000h, 07fh, 00ch, 07fh, 0cch, 07fh, 000h
db 03eh, 06ch, 0cch, 0feh, 0cch, 0cch, 0ceh, 000h, 078h, 0cch, 000h, 078h, 0cch, 0cch, 078h, 000h
db 000h, 0cch, 000h, 078h, 0cch, 0cch, 078h, 000h, 000h, 0e0h, 000h, 078h, 0cch, 0cch, 078h, 000h
db 078h, 0cch, 000h, 0cch, 0cch, 0cch, 07eh, 000h, 000h, 0e0h, 000h, 0cch, 0cch, 0cch, 07eh, 000h
db 000h, 0cch, 000h, 0cch, 0cch, 07ch, 00ch, 0f8h, 0c3h, 018h, 03ch, 066h, 066h, 03ch, 018h, 000h
db 0cch, 000h, 0cch, 0cch, 0cch, 0cch, 078h, 000h, 018h, 018h, 07eh, 0c0h, 0c0h, 07eh, 018h, 018h
db 038h, 06ch, 064h, 0f0h, 060h, 0e6h, 0fch, 000h, 0cch, 0cch, 078h, 0fch, 030h, 0fch, 030h, 030h
db 0f8h, 0cch, 0cch, 0fah, 0c6h, 0cfh, 0c6h, 0c7h, 00eh, 01bh, 018h, 03ch, 018h, 018h, 0d8h, 070h
db 01ch, 000h, 078h, 00ch, 07ch, 0cch, 07eh, 000h, 038h, 000h, 070h, 030h, 030h, 030h, 078h, 000h
db 000h, 01ch, 000h, 078h, 0cch, 0cch, 078h, 000h, 000h, 01ch, 000h, 0cch, 0cch, 0cch, 07eh, 000h
db 000h, 0f8h, 000h, 0f8h, 0cch, 0cch, 0cch, 000h, 0fch, 000h, 0cch, 0ech, 0fch, 0dch, 0cch, 000h
db 03ch, 06ch, 06ch, 03eh, 000h, 07eh, 000h, 000h, 038h, 06ch, 06ch, 038h, 000h, 07ch, 000h, 000h
db 030h, 000h, 030h, 060h, 0c0h, 0cch, 078h, 000h, 000h, 000h, 000h, 0fch, 0c0h, 0c0h, 000h, 000h
db 000h, 000h, 000h, 0fch, 00ch, 00ch, 000h, 000h, 0c3h, 0c6h, 0cch, 0deh, 033h, 066h, 0cch, 00fh
db 0c3h, 0c6h, 0cch, 0dbh, 037h, 06fh, 0cfh, 003h, 018h, 018h, 000h, 018h, 018h, 018h, 018h, 000h
db 000h, 033h, 066h, 0cch, 066h, 033h, 000h, 000h, 000h, 0cch, 066h, 033h, 066h, 0cch, 000h, 000h
db 022h, 088h, 022h, 088h, 022h, 088h, 022h, 088h, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah
db 0dbh, 077h, 0dbh, 0eeh, 0dbh, 077h, 0dbh, 0eeh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 0f8h, 018h, 018h, 018h, 018h, 018h, 0f8h, 018h, 0f8h, 018h, 018h, 018h
db 036h, 036h, 036h, 036h, 0f6h, 036h, 036h, 036h, 000h, 000h, 000h, 000h, 0feh, 036h, 036h, 036h
db 000h, 000h, 0f8h, 018h, 0f8h, 018h, 018h, 018h, 036h, 036h, 0f6h, 006h, 0f6h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h, 0feh, 006h, 0f6h, 036h, 036h, 036h
db 036h, 036h, 0f6h, 006h, 0feh, 000h, 000h, 000h, 036h, 036h, 036h, 036h, 0feh, 000h, 000h, 000h
db 018h, 018h, 0f8h, 018h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0f8h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 01fh, 000h, 000h, 000h, 018h, 018h, 018h, 018h, 0ffh, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 01fh, 018h, 018h, 018h
db 000h, 000h, 000h, 000h, 0ffh, 000h, 000h, 000h, 018h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h
db 018h, 018h, 01fh, 018h, 01fh, 018h, 018h, 018h, 036h, 036h, 036h, 036h, 037h, 036h, 036h, 036h
db 036h, 036h, 037h, 030h, 03fh, 000h, 000h, 000h, 000h, 000h, 03fh, 030h, 037h, 036h, 036h, 036h
db 036h, 036h, 0f7h, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 0f7h, 036h, 036h, 036h
db 036h, 036h, 037h, 030h, 037h, 036h, 036h, 036h, 000h, 000h, 0ffh, 000h, 0ffh, 000h, 000h, 000h
db 036h, 036h, 0f7h, 000h, 0f7h, 036h, 036h, 036h, 018h, 018h, 0ffh, 000h, 0ffh, 000h, 000h, 000h
db 036h, 036h, 036h, 036h, 0ffh, 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 0ffh, 018h, 018h, 018h
db 000h, 000h, 000h, 000h, 0ffh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 03fh, 000h, 000h, 000h
db 018h, 018h, 01fh, 018h, 01fh, 000h, 000h, 000h, 000h, 000h, 01fh, 018h, 01fh, 018h, 018h, 018h
db 000h, 000h, 000h, 000h, 03fh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0ffh, 036h, 036h, 036h
db 018h, 018h, 0ffh, 018h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0f8h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 01fh, 018h, 018h, 018h, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
db 000h, 000h, 000h, 000h, 0ffh, 0ffh, 0ffh, 0ffh, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h
db 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 0ffh, 0ffh, 0ffh, 0ffh, 000h, 000h, 000h, 000h
db 000h, 000h, 076h, 0dch, 0c8h, 0dch, 076h, 000h, 000h, 078h, 0cch, 0f8h, 0cch, 0f8h, 0c0h, 0c0h
db 000h, 0fch, 0cch, 0c0h, 0c0h, 0c0h, 0c0h, 000h, 000h, 0feh, 06ch, 06ch, 06ch, 06ch, 06ch, 000h
db 0fch, 0cch, 060h, 030h, 060h, 0cch, 0fch, 000h, 000h, 000h, 07eh, 0d8h, 0d8h, 0d8h, 070h, 000h
db 000h, 066h, 066h, 066h, 066h, 07ch, 060h, 0c0h, 000h, 076h, 0dch, 018h, 018h, 018h, 018h, 000h
db 0fch, 030h, 078h, 0cch, 0cch, 078h, 030h, 0fch, 038h, 06ch, 0c6h, 0feh, 0c6h, 06ch, 038h, 000h
db 038h, 06ch, 0c6h, 0c6h, 06ch, 06ch, 0eeh, 000h, 01ch, 030h, 018h, 07ch, 0cch, 0cch, 078h, 000h
db 000h, 000h, 07eh, 0dbh, 0dbh, 07eh, 000h, 000h, 006h, 00ch, 07eh, 0dbh, 0dbh, 07eh, 060h, 0c0h
db 038h, 060h, 0c0h, 0f8h, 0c0h, 060h, 038h, 000h, 078h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 000h
db 000h, 0fch, 000h, 0fch, 000h, 0fch, 000h, 000h, 030h, 030h, 0fch, 030h, 030h, 000h, 0fch, 000h
db 060h, 030h, 018h, 030h, 060h, 000h, 0fch, 000h, 018h, 030h, 060h, 030h, 018h, 000h, 0fch, 000h
db 00eh, 01bh, 01bh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0d8h, 0d8h, 070h
db 030h, 030h, 000h, 0fch, 000h, 030h, 030h, 000h, 000h, 076h, 0dch, 000h, 076h, 0dch, 000h, 000h
db 038h, 06ch, 06ch, 038h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 000h, 000h, 000h, 00fh, 00ch, 00ch, 00ch, 0ech, 06ch, 03ch, 01ch
db 078h, 06ch, 06ch, 06ch, 06ch, 000h, 000h, 000h, 070h, 018h, 030h, 060h, 078h, 000h, 000h, 000h
db 000h, 000h, 03ch, 03ch, 03ch, 03ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_vgafont14: ; 0xc5bed LB 0xe00
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 07eh, 081h, 0a5h, 081h, 081h, 0bdh, 099h, 081h, 07eh, 000h, 000h, 000h, 000h, 000h, 07eh, 0ffh
db 0dbh, 0ffh, 0ffh, 0c3h, 0e7h, 0ffh, 07eh, 000h, 000h, 000h, 000h, 000h, 000h, 06ch, 0feh, 0feh
db 0feh, 0feh, 07ch, 038h, 010h, 000h, 000h, 000h, 000h, 000h, 000h, 010h, 038h, 07ch, 0feh, 07ch
db 038h, 010h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 03ch, 03ch, 0e7h, 0e7h, 0e7h, 018h, 018h
db 03ch, 000h, 000h, 000h, 000h, 000h, 018h, 03ch, 07eh, 0ffh, 0ffh, 07eh, 018h, 018h, 03ch, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 03ch, 03ch, 018h, 000h, 000h, 000h, 000h, 000h
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0e7h, 0c3h, 0c3h, 0e7h, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 000h, 000h
db 000h, 000h, 03ch, 066h, 042h, 042h, 066h, 03ch, 000h, 000h, 000h, 000h, 0ffh, 0ffh, 0ffh, 0ffh
db 0c3h, 099h, 0bdh, 0bdh, 099h, 0c3h, 0ffh, 0ffh, 0ffh, 0ffh, 000h, 000h, 01eh, 00eh, 01ah, 032h
db 078h, 0cch, 0cch, 0cch, 078h, 000h, 000h, 000h, 000h, 000h, 03ch, 066h, 066h, 066h, 03ch, 018h
db 07eh, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 03fh, 033h, 03fh, 030h, 030h, 030h, 070h, 0f0h
db 0e0h, 000h, 000h, 000h, 000h, 000h, 07fh, 063h, 07fh, 063h, 063h, 063h, 067h, 0e7h, 0e6h, 0c0h
db 000h, 000h, 000h, 000h, 018h, 018h, 0dbh, 03ch, 0e7h, 03ch, 0dbh, 018h, 018h, 000h, 000h, 000h
db 000h, 000h, 080h, 0c0h, 0e0h, 0f8h, 0feh, 0f8h, 0e0h, 0c0h, 080h, 000h, 000h, 000h, 000h, 000h
db 002h, 006h, 00eh, 03eh, 0feh, 03eh, 00eh, 006h, 002h, 000h, 000h, 000h, 000h, 000h, 018h, 03ch
db 07eh, 018h, 018h, 018h, 07eh, 03ch, 018h, 000h, 000h, 000h, 000h, 000h, 066h, 066h, 066h, 066h
db 066h, 066h, 000h, 066h, 066h, 000h, 000h, 000h, 000h, 000h, 07fh, 0dbh, 0dbh, 0dbh, 07bh, 01bh
db 01bh, 01bh, 01bh, 000h, 000h, 000h, 000h, 07ch, 0c6h, 060h, 038h, 06ch, 0c6h, 0c6h, 06ch, 038h
db 00ch, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 0feh, 0feh, 000h
db 000h, 000h, 000h, 000h, 018h, 03ch, 07eh, 018h, 018h, 018h, 07eh, 03ch, 018h, 07eh, 000h, 000h
db 000h, 000h, 018h, 03ch, 07eh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 018h, 018h, 018h, 018h, 07eh, 03ch, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 00ch, 0feh, 00ch, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 030h, 060h
db 0feh, 060h, 030h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0c0h, 0c0h, 0c0h
db 0feh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 028h, 06ch, 0feh, 06ch, 028h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 010h, 038h, 038h, 07ch, 07ch, 0feh, 0feh, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0feh, 0feh, 07ch, 07ch, 038h, 038h, 010h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 03ch, 03ch, 03ch, 018h, 018h, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 066h, 066h, 066h
db 024h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 06ch, 06ch, 0feh, 06ch
db 06ch, 06ch, 0feh, 06ch, 06ch, 000h, 000h, 000h, 018h, 018h, 07ch, 0c6h, 0c2h, 0c0h, 07ch, 006h
db 086h, 0c6h, 07ch, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 0c2h, 0c6h, 00ch, 018h, 030h, 066h
db 0c6h, 000h, 000h, 000h, 000h, 000h, 038h, 06ch, 06ch, 038h, 076h, 0dch, 0cch, 0cch, 076h, 000h
db 000h, 000h, 000h, 030h, 030h, 030h, 060h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 00ch, 018h, 030h, 030h, 030h, 030h, 030h, 018h, 00ch, 000h, 000h, 000h, 000h, 000h
db 030h, 018h, 00ch, 00ch, 00ch, 00ch, 00ch, 018h, 030h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 066h, 03ch, 0ffh, 03ch, 066h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h
db 07eh, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 018h, 030h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h
db 000h, 000h, 000h, 000h, 002h, 006h, 00ch, 018h, 030h, 060h, 0c0h, 080h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0ceh, 0deh, 0f6h, 0e6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h
db 018h, 038h, 078h, 018h, 018h, 018h, 018h, 018h, 07eh, 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h
db 006h, 00ch, 018h, 030h, 060h, 0c6h, 0feh, 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 006h, 006h
db 03ch, 006h, 006h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 00ch, 01ch, 03ch, 06ch, 0cch, 0feh
db 00ch, 00ch, 01eh, 000h, 000h, 000h, 000h, 000h, 0feh, 0c0h, 0c0h, 0c0h, 0fch, 006h, 006h, 0c6h
db 07ch, 000h, 000h, 000h, 000h, 000h, 038h, 060h, 0c0h, 0c0h, 0fch, 0c6h, 0c6h, 0c6h, 07ch, 000h
db 000h, 000h, 000h, 000h, 0feh, 0c6h, 006h, 00ch, 018h, 030h, 030h, 030h, 030h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 07ch, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h
db 07ch, 0c6h, 0c6h, 0c6h, 07eh, 006h, 006h, 00ch, 078h, 000h, 000h, 000h, 000h, 000h, 000h, 018h
db 018h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h
db 000h, 000h, 018h, 018h, 030h, 000h, 000h, 000h, 000h, 000h, 006h, 00ch, 018h, 030h, 060h, 030h
db 018h, 00ch, 006h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07eh, 000h, 000h, 07eh, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 060h, 030h, 018h, 00ch, 006h, 00ch, 018h, 030h, 060h, 000h
db 000h, 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 00ch, 018h, 018h, 000h, 018h, 018h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 0deh, 0deh, 0deh, 0dch, 0c0h, 07ch, 000h, 000h, 000h, 000h, 000h
db 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h, 000h, 0fch, 066h
db 066h, 066h, 07ch, 066h, 066h, 066h, 0fch, 000h, 000h, 000h, 000h, 000h, 03ch, 066h, 0c2h, 0c0h
db 0c0h, 0c0h, 0c2h, 066h, 03ch, 000h, 000h, 000h, 000h, 000h, 0f8h, 06ch, 066h, 066h, 066h, 066h
db 066h, 06ch, 0f8h, 000h, 000h, 000h, 000h, 000h, 0feh, 066h, 062h, 068h, 078h, 068h, 062h, 066h
db 0feh, 000h, 000h, 000h, 000h, 000h, 0feh, 066h, 062h, 068h, 078h, 068h, 060h, 060h, 0f0h, 000h
db 000h, 000h, 000h, 000h, 03ch, 066h, 0c2h, 0c0h, 0c0h, 0deh, 0c6h, 066h, 03ah, 000h, 000h, 000h
db 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h, 000h
db 03ch, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 000h, 01eh, 00ch
db 00ch, 00ch, 00ch, 00ch, 0cch, 0cch, 078h, 000h, 000h, 000h, 000h, 000h, 0e6h, 066h, 06ch, 06ch
db 078h, 06ch, 06ch, 066h, 0e6h, 000h, 000h, 000h, 000h, 000h, 0f0h, 060h, 060h, 060h, 060h, 060h
db 062h, 066h, 0feh, 000h, 000h, 000h, 000h, 000h, 0c6h, 0eeh, 0feh, 0feh, 0d6h, 0c6h, 0c6h, 0c6h
db 0c6h, 000h, 000h, 000h, 000h, 000h, 0c6h, 0e6h, 0f6h, 0feh, 0deh, 0ceh, 0c6h, 0c6h, 0c6h, 000h
db 000h, 000h, 000h, 000h, 038h, 06ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 06ch, 038h, 000h, 000h, 000h
db 000h, 000h, 0fch, 066h, 066h, 066h, 07ch, 060h, 060h, 060h, 0f0h, 000h, 000h, 000h, 000h, 000h
db 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0d6h, 0deh, 07ch, 00ch, 00eh, 000h, 000h, 000h, 000h, 0fch, 066h
db 066h, 066h, 07ch, 06ch, 066h, 066h, 0e6h, 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 060h
db 038h, 00ch, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 07eh, 07eh, 05ah, 018h, 018h, 018h
db 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h
db 07ch, 000h, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 06ch, 038h, 010h, 000h
db 000h, 000h, 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0d6h, 0d6h, 0feh, 07ch, 06ch, 000h, 000h, 000h
db 000h, 000h, 0c6h, 0c6h, 06ch, 038h, 038h, 038h, 06ch, 0c6h, 0c6h, 000h, 000h, 000h, 000h, 000h
db 066h, 066h, 066h, 066h, 03ch, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 000h, 0feh, 0c6h
db 08ch, 018h, 030h, 060h, 0c2h, 0c6h, 0feh, 000h, 000h, 000h, 000h, 000h, 03ch, 030h, 030h, 030h
db 030h, 030h, 030h, 030h, 03ch, 000h, 000h, 000h, 000h, 000h, 080h, 0c0h, 0e0h, 070h, 038h, 01ch
db 00eh, 006h, 002h, 000h, 000h, 000h, 000h, 000h, 03ch, 00ch, 00ch, 00ch, 00ch, 00ch, 00ch, 00ch
db 03ch, 000h, 000h, 000h, 010h, 038h, 06ch, 0c6h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh, 000h
db 030h, 030h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 000h, 0e0h, 060h
db 060h, 078h, 06ch, 066h, 066h, 066h, 07ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch
db 0c6h, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 01ch, 00ch, 00ch, 03ch, 06ch, 0cch
db 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c6h
db 07ch, 000h, 000h, 000h, 000h, 000h, 038h, 06ch, 064h, 060h, 0f0h, 060h, 060h, 060h, 0f0h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 076h, 0cch, 0cch, 0cch, 07ch, 00ch, 0cch, 078h, 000h
db 000h, 000h, 0e0h, 060h, 060h, 06ch, 076h, 066h, 066h, 066h, 0e6h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 000h, 038h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 000h, 006h, 006h
db 000h, 00eh, 006h, 006h, 006h, 006h, 066h, 066h, 03ch, 000h, 000h, 000h, 0e0h, 060h, 060h, 066h
db 06ch, 078h, 06ch, 066h, 0e6h, 000h, 000h, 000h, 000h, 000h, 038h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ech, 0feh, 0d6h, 0d6h, 0d6h
db 0c6h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0dch, 066h, 066h, 066h, 066h, 066h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0dch, 066h, 066h, 066h, 07ch, 060h, 060h, 0f0h, 000h, 000h, 000h
db 000h, 000h, 000h, 076h, 0cch, 0cch, 0cch, 07ch, 00ch, 00ch, 01eh, 000h, 000h, 000h, 000h, 000h
db 000h, 0dch, 076h, 066h, 060h, 060h, 0f0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch
db 0c6h, 070h, 01ch, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 010h, 030h, 030h, 0fch, 030h, 030h
db 030h, 036h, 01ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch
db 076h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 066h, 066h, 066h, 066h, 03ch, 018h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 0d6h, 0d6h, 0feh, 06ch, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0c6h, 06ch, 038h, 038h, 06ch, 0c6h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 07eh, 006h, 00ch, 0f8h, 000h, 000h, 000h, 000h, 000h
db 000h, 0feh, 0cch, 018h, 030h, 066h, 0feh, 000h, 000h, 000h, 000h, 000h, 00eh, 018h, 018h, 018h
db 070h, 018h, 018h, 018h, 00eh, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 018h, 018h, 000h, 018h
db 018h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 070h, 018h, 018h, 018h, 00eh, 018h, 018h, 018h
db 070h, 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 066h, 0c2h, 0c0h, 0c0h, 0c2h, 066h, 03ch, 00ch, 006h, 07ch, 000h, 000h, 000h
db 0cch, 0cch, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 00ch, 018h, 030h
db 000h, 07ch, 0c6h, 0feh, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 010h, 038h, 06ch, 000h, 078h
db 00ch, 07ch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 000h, 0cch, 0cch, 000h, 078h, 00ch, 07ch
db 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 060h, 030h, 018h, 000h, 078h, 00ch, 07ch, 0cch, 0cch
db 076h, 000h, 000h, 000h, 000h, 038h, 06ch, 038h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 076h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 03ch, 066h, 060h, 066h, 03ch, 00ch, 006h, 03ch, 000h, 000h
db 000h, 010h, 038h, 06ch, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h
db 0cch, 0cch, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 060h, 030h, 018h
db 000h, 07ch, 0c6h, 0feh, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 066h, 066h, 000h, 038h
db 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 018h, 03ch, 066h, 000h, 038h, 018h, 018h
db 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 060h, 030h, 018h, 000h, 038h, 018h, 018h, 018h, 018h
db 03ch, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 000h
db 000h, 000h, 038h, 06ch, 038h, 000h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 000h, 000h, 000h
db 018h, 030h, 060h, 000h, 0feh, 066h, 060h, 07ch, 060h, 066h, 0feh, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 0cch, 076h, 036h, 07eh, 0d8h, 0d8h, 06eh, 000h, 000h, 000h, 000h, 000h, 03eh, 06ch
db 0cch, 0cch, 0feh, 0cch, 0cch, 0cch, 0ceh, 000h, 000h, 000h, 000h, 010h, 038h, 06ch, 000h, 07ch
db 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 000h, 07ch, 0c6h, 0c6h
db 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 060h, 030h, 018h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h
db 07ch, 000h, 000h, 000h, 000h, 030h, 078h, 0cch, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h
db 000h, 000h, 000h, 060h, 030h, 018h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 0c6h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 07eh, 006h, 00ch, 078h, 000h, 000h, 0c6h
db 0c6h, 038h, 06ch, 0c6h, 0c6h, 0c6h, 0c6h, 06ch, 038h, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 000h
db 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 018h, 018h, 03ch, 066h, 060h
db 060h, 066h, 03ch, 018h, 018h, 000h, 000h, 000h, 000h, 038h, 06ch, 064h, 060h, 0f0h, 060h, 060h
db 060h, 0e6h, 0fch, 000h, 000h, 000h, 000h, 000h, 066h, 066h, 03ch, 018h, 07eh, 018h, 07eh, 018h
db 018h, 000h, 000h, 000h, 000h, 0f8h, 0cch, 0cch, 0f8h, 0c4h, 0cch, 0deh, 0cch, 0cch, 0c6h, 000h
db 000h, 000h, 000h, 00eh, 01bh, 018h, 018h, 018h, 07eh, 018h, 018h, 018h, 018h, 0d8h, 070h, 000h
db 000h, 018h, 030h, 060h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 00ch
db 018h, 030h, 000h, 038h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 018h, 030h, 060h
db 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 018h, 030h, 060h, 000h, 0cch
db 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 000h, 0dch, 066h, 066h
db 066h, 066h, 066h, 000h, 000h, 000h, 076h, 0dch, 000h, 0c6h, 0e6h, 0f6h, 0feh, 0deh, 0ceh, 0c6h
db 0c6h, 000h, 000h, 000h, 000h, 03ch, 06ch, 06ch, 03eh, 000h, 07eh, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 038h, 06ch, 06ch, 038h, 000h, 07ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 030h, 030h, 000h, 030h, 030h, 060h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 0feh, 0c0h, 0c0h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 0feh, 006h, 006h, 006h, 000h, 000h, 000h, 000h, 000h, 0c0h, 0c0h, 0c6h, 0cch, 0d8h
db 030h, 060h, 0dch, 086h, 00ch, 018h, 03eh, 000h, 000h, 0c0h, 0c0h, 0c6h, 0cch, 0d8h, 030h, 066h
db 0ceh, 09eh, 03eh, 006h, 006h, 000h, 000h, 000h, 018h, 018h, 000h, 018h, 018h, 03ch, 03ch, 03ch
db 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 036h, 06ch, 0d8h, 06ch, 036h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 0d8h, 06ch, 036h, 06ch, 0d8h, 000h, 000h, 000h, 000h, 000h
db 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 055h, 0aah
db 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 0ddh, 077h, 0ddh, 077h
db 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0f8h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0f8h, 018h, 0f8h, 018h, 018h
db 018h, 018h, 018h, 018h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0f6h, 036h, 036h, 036h, 036h
db 036h, 036h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 036h, 036h, 036h, 036h, 036h, 036h
db 000h, 000h, 000h, 000h, 000h, 0f8h, 018h, 0f8h, 018h, 018h, 018h, 018h, 018h, 018h, 036h, 036h
db 036h, 036h, 036h, 0f6h, 006h, 0f6h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h, 000h, 000h, 000h, 0feh
db 006h, 0f6h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0f6h, 006h, 0feh
db 000h, 000h, 000h, 000h, 000h, 000h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0feh, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 018h, 018h, 018h, 018h, 0f8h, 018h, 0f8h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0f8h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 01fh, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 01fh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh
db 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0ffh, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 01fh, 018h, 01fh, 018h, 018h, 018h, 018h
db 018h, 018h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 037h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 037h, 030h, 03fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 03fh, 030h, 037h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 0f7h, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh
db 000h, 0f7h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 037h, 030h, 037h
db 036h, 036h, 036h, 036h, 036h, 036h, 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 0ffh, 000h, 000h
db 000h, 000h, 000h, 000h, 036h, 036h, 036h, 036h, 036h, 0f7h, 000h, 0f7h, 036h, 036h, 036h, 036h
db 036h, 036h, 018h, 018h, 018h, 018h, 018h, 0ffh, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 0ffh, 000h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 0ffh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 03fh, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 018h, 018h, 018h, 01fh, 018h, 01fh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 01fh, 018h, 01fh, 018h, 018h
db 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 03fh, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0ffh, 036h, 036h, 036h, 036h, 036h, 036h
db 018h, 018h, 018h, 018h, 018h, 0ffh, 018h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 01fh, 018h, 018h, 018h, 018h, 018h, 018h, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h
db 0f0h, 0f0h, 0f0h, 0f0h, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh
db 00fh, 00fh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 0d8h, 0d8h, 0dch, 076h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0fch, 0c6h, 0c6h, 0fch, 0c0h, 0c0h, 040h, 000h, 000h, 000h, 0feh, 0c6h
db 0c6h, 0c0h, 0c0h, 0c0h, 0c0h, 0c0h, 0c0h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 06ch
db 06ch, 06ch, 06ch, 06ch, 06ch, 000h, 000h, 000h, 000h, 000h, 0feh, 0c6h, 060h, 030h, 018h, 030h
db 060h, 0c6h, 0feh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07eh, 0d8h, 0d8h, 0d8h, 0d8h
db 070h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 066h, 066h, 066h, 066h, 07ch, 060h, 060h, 0c0h
db 000h, 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h
db 000h, 000h, 07eh, 018h, 03ch, 066h, 066h, 066h, 03ch, 018h, 07eh, 000h, 000h, 000h, 000h, 000h
db 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 06ch, 038h, 000h, 000h, 000h, 000h, 000h, 038h, 06ch
db 0c6h, 0c6h, 0c6h, 06ch, 06ch, 06ch, 0eeh, 000h, 000h, 000h, 000h, 000h, 01eh, 030h, 018h, 00ch
db 03eh, 066h, 066h, 066h, 03ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07eh, 0dbh, 0dbh
db 07eh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 003h, 006h, 07eh, 0dbh, 0dbh, 0f3h, 07eh, 060h
db 0c0h, 000h, 000h, 000h, 000h, 000h, 01ch, 030h, 060h, 060h, 07ch, 060h, 060h, 030h, 01ch, 000h
db 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h
db 000h, 000h, 000h, 0feh, 000h, 000h, 0feh, 000h, 000h, 0feh, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 018h, 018h, 07eh, 018h, 018h, 000h, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 030h, 018h
db 00ch, 006h, 00ch, 018h, 030h, 000h, 07eh, 000h, 000h, 000h, 000h, 000h, 00ch, 018h, 030h, 060h
db 030h, 018h, 00ch, 000h, 07eh, 000h, 000h, 000h, 000h, 000h, 00eh, 01bh, 01bh, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0d8h, 0d8h
db 070h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h, 07eh, 000h, 018h, 018h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 000h, 076h, 0dch, 000h, 000h, 000h, 000h, 000h
db 000h, 038h, 06ch, 06ch, 038h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 00fh, 00ch, 00ch, 00ch, 00ch
db 00ch, 0ech, 06ch, 03ch, 01ch, 000h, 000h, 000h, 000h, 0d8h, 06ch, 06ch, 06ch, 06ch, 06ch, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 070h, 0d8h, 030h, 060h, 0c8h, 0f8h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_vgafont16: ; 0xc69ed LB 0x1000
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 07eh, 081h, 0a5h, 081h, 081h, 0bdh, 099h, 081h, 081h, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 07eh, 0ffh, 0dbh, 0ffh, 0ffh, 0c3h, 0e7h, 0ffh, 0ffh, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 06ch, 0feh, 0feh, 0feh, 0feh, 07ch, 038h, 010h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 010h, 038h, 07ch, 0feh, 07ch, 038h, 010h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 018h, 03ch, 03ch, 0e7h, 0e7h, 0e7h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 018h, 03ch, 07eh, 0ffh, 0ffh, 07eh, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 018h, 03ch, 03ch, 018h, 000h, 000h, 000h, 000h, 000h, 000h
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0e7h, 0c3h, 0c3h, 0e7h, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
db 000h, 000h, 000h, 000h, 000h, 03ch, 066h, 042h, 042h, 066h, 03ch, 000h, 000h, 000h, 000h, 000h
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0c3h, 099h, 0bdh, 0bdh, 099h, 0c3h, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
db 000h, 000h, 01eh, 00eh, 01ah, 032h, 078h, 0cch, 0cch, 0cch, 0cch, 078h, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 066h, 066h, 066h, 066h, 03ch, 018h, 07eh, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 03fh, 033h, 03fh, 030h, 030h, 030h, 030h, 070h, 0f0h, 0e0h, 000h, 000h, 000h, 000h
db 000h, 000h, 07fh, 063h, 07fh, 063h, 063h, 063h, 063h, 067h, 0e7h, 0e6h, 0c0h, 000h, 000h, 000h
db 000h, 000h, 000h, 018h, 018h, 0dbh, 03ch, 0e7h, 03ch, 0dbh, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 080h, 0c0h, 0e0h, 0f0h, 0f8h, 0feh, 0f8h, 0f0h, 0e0h, 0c0h, 080h, 000h, 000h, 000h, 000h
db 000h, 002h, 006h, 00eh, 01eh, 03eh, 0feh, 03eh, 01eh, 00eh, 006h, 002h, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 03ch, 07eh, 018h, 018h, 018h, 07eh, 03ch, 018h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 066h, 066h, 066h, 066h, 066h, 066h, 066h, 000h, 066h, 066h, 000h, 000h, 000h, 000h
db 000h, 000h, 07fh, 0dbh, 0dbh, 0dbh, 07bh, 01bh, 01bh, 01bh, 01bh, 01bh, 000h, 000h, 000h, 000h
db 000h, 07ch, 0c6h, 060h, 038h, 06ch, 0c6h, 0c6h, 06ch, 038h, 00ch, 0c6h, 07ch, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 0feh, 0feh, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 03ch, 07eh, 018h, 018h, 018h, 07eh, 03ch, 018h, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 03ch, 07eh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 07eh, 03ch, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 018h, 00ch, 0feh, 00ch, 018h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 030h, 060h, 0feh, 060h, 030h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 0c0h, 0c0h, 0c0h, 0feh, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 010h, 038h, 038h, 07ch, 07ch, 0feh, 0feh, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 0feh, 0feh, 07ch, 07ch, 038h, 038h, 010h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 03ch, 03ch, 03ch, 018h, 018h, 018h, 000h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 066h, 066h, 066h, 024h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 06ch, 06ch, 0feh, 06ch, 06ch, 06ch, 0feh, 06ch, 06ch, 000h, 000h, 000h, 000h
db 018h, 018h, 07ch, 0c6h, 0c2h, 0c0h, 07ch, 006h, 006h, 086h, 0c6h, 07ch, 018h, 018h, 000h, 000h
db 000h, 000h, 000h, 000h, 0c2h, 0c6h, 00ch, 018h, 030h, 060h, 0c6h, 086h, 000h, 000h, 000h, 000h
db 000h, 000h, 038h, 06ch, 06ch, 038h, 076h, 0dch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 030h, 030h, 030h, 060h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 00ch, 018h, 030h, 030h, 030h, 030h, 030h, 030h, 018h, 00ch, 000h, 000h, 000h, 000h
db 000h, 000h, 030h, 018h, 00ch, 00ch, 00ch, 00ch, 00ch, 00ch, 018h, 030h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 066h, 03ch, 0ffh, 03ch, 066h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 018h, 018h, 07eh, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 018h, 030h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 002h, 006h, 00ch, 018h, 030h, 060h, 0c0h, 080h, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 066h, 0c3h, 0c3h, 0dbh, 0dbh, 0c3h, 0c3h, 066h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 038h, 078h, 018h, 018h, 018h, 018h, 018h, 018h, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 006h, 00ch, 018h, 030h, 060h, 0c0h, 0c6h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 006h, 006h, 03ch, 006h, 006h, 006h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 00ch, 01ch, 03ch, 06ch, 0cch, 0feh, 00ch, 00ch, 00ch, 01eh, 000h, 000h, 000h, 000h
db 000h, 000h, 0feh, 0c0h, 0c0h, 0c0h, 0fch, 006h, 006h, 006h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 038h, 060h, 0c0h, 0c0h, 0fch, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0feh, 0c6h, 006h, 006h, 00ch, 018h, 030h, 030h, 030h, 030h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 07eh, 006h, 006h, 006h, 00ch, 078h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 018h, 018h, 030h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 006h, 00ch, 018h, 030h, 060h, 030h, 018h, 00ch, 006h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07eh, 000h, 000h, 07eh, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 060h, 030h, 018h, 00ch, 006h, 00ch, 018h, 030h, 060h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 00ch, 018h, 018h, 018h, 000h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 0deh, 0deh, 0deh, 0dch, 0c0h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 000h, 000h, 0fch, 066h, 066h, 066h, 07ch, 066h, 066h, 066h, 066h, 0fch, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 066h, 0c2h, 0c0h, 0c0h, 0c0h, 0c0h, 0c2h, 066h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0f8h, 06ch, 066h, 066h, 066h, 066h, 066h, 066h, 06ch, 0f8h, 000h, 000h, 000h, 000h
db 000h, 000h, 0feh, 066h, 062h, 068h, 078h, 068h, 060h, 062h, 066h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 0feh, 066h, 062h, 068h, 078h, 068h, 060h, 060h, 060h, 0f0h, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 066h, 0c2h, 0c0h, 0c0h, 0deh, 0c6h, 0c6h, 066h, 03ah, 000h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 01eh, 00ch, 00ch, 00ch, 00ch, 00ch, 0cch, 0cch, 0cch, 078h, 000h, 000h, 000h, 000h
db 000h, 000h, 0e6h, 066h, 066h, 06ch, 078h, 078h, 06ch, 066h, 066h, 0e6h, 000h, 000h, 000h, 000h
db 000h, 000h, 0f0h, 060h, 060h, 060h, 060h, 060h, 060h, 062h, 066h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 0e7h, 0ffh, 0ffh, 0dbh, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 000h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 0e6h, 0f6h, 0feh, 0deh, 0ceh, 0c6h, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0fch, 066h, 066h, 066h, 07ch, 060h, 060h, 060h, 060h, 0f0h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0d6h, 0deh, 07ch, 00ch, 00eh, 000h, 000h
db 000h, 000h, 0fch, 066h, 066h, 066h, 07ch, 06ch, 066h, 066h, 066h, 0e6h, 000h, 000h, 000h, 000h
db 000h, 000h, 07ch, 0c6h, 0c6h, 060h, 038h, 00ch, 006h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0ffh, 0dbh, 099h, 018h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 0dbh, 0dbh, 0ffh, 066h, 066h, 000h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 0c3h, 066h, 03ch, 018h, 018h, 03ch, 066h, 0c3h, 0c3h, 000h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0ffh, 0c3h, 086h, 00ch, 018h, 030h, 060h, 0c1h, 0c3h, 0ffh, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 030h, 030h, 030h, 030h, 030h, 030h, 030h, 030h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 080h, 0c0h, 0e0h, 070h, 038h, 01ch, 00eh, 006h, 002h, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 00ch, 00ch, 00ch, 00ch, 00ch, 00ch, 00ch, 00ch, 03ch, 000h, 000h, 000h, 000h
db 010h, 038h, 06ch, 0c6h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 000h
db 030h, 030h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 0e0h, 060h, 060h, 078h, 06ch, 066h, 066h, 066h, 066h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0c0h, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 01ch, 00ch, 00ch, 03ch, 06ch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 038h, 06ch, 064h, 060h, 0f0h, 060h, 060h, 060h, 060h, 0f0h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 076h, 0cch, 0cch, 0cch, 0cch, 0cch, 07ch, 00ch, 0cch, 078h, 000h
db 000h, 000h, 0e0h, 060h, 060h, 06ch, 076h, 066h, 066h, 066h, 066h, 0e6h, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 018h, 000h, 038h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 006h, 006h, 000h, 00eh, 006h, 006h, 006h, 006h, 006h, 006h, 066h, 066h, 03ch, 000h
db 000h, 000h, 0e0h, 060h, 060h, 066h, 06ch, 078h, 078h, 06ch, 066h, 0e6h, 000h, 000h, 000h, 000h
db 000h, 000h, 038h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0e6h, 0ffh, 0dbh, 0dbh, 0dbh, 0dbh, 0dbh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0dch, 066h, 066h, 066h, 066h, 066h, 066h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0dch, 066h, 066h, 066h, 066h, 066h, 07ch, 060h, 060h, 0f0h, 000h
db 000h, 000h, 000h, 000h, 000h, 076h, 0cch, 0cch, 0cch, 0cch, 0cch, 07ch, 00ch, 00ch, 01eh, 000h
db 000h, 000h, 000h, 000h, 000h, 0dch, 076h, 066h, 060h, 060h, 060h, 0f0h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07ch, 0c6h, 060h, 038h, 00ch, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 010h, 030h, 030h, 0fch, 030h, 030h, 030h, 030h, 036h, 01ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0c3h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0c3h, 0c3h, 0c3h, 0dbh, 0dbh, 0ffh, 066h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0c3h, 066h, 03ch, 018h, 03ch, 066h, 0c3h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07eh, 006h, 00ch, 0f8h, 000h
db 000h, 000h, 000h, 000h, 000h, 0feh, 0cch, 018h, 030h, 060h, 0c6h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 00eh, 018h, 018h, 018h, 070h, 018h, 018h, 018h, 018h, 00eh, 000h, 000h, 000h, 000h
db 000h, 000h, 018h, 018h, 018h, 018h, 000h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 070h, 018h, 018h, 018h, 00eh, 018h, 018h, 018h, 018h, 070h, 000h, 000h, 000h, 000h
db 000h, 000h, 076h, 0dch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 010h, 038h, 06ch, 0c6h, 0c6h, 0c6h, 0feh, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 03ch, 066h, 0c2h, 0c0h, 0c0h, 0c0h, 0c2h, 066h, 03ch, 00ch, 006h, 07ch, 000h, 000h
db 000h, 000h, 0cch, 000h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 00ch, 018h, 030h, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 010h, 038h, 06ch, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 0cch, 000h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 060h, 030h, 018h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 038h, 06ch, 038h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 03ch, 066h, 060h, 060h, 066h, 03ch, 00ch, 006h, 03ch, 000h, 000h, 000h
db 000h, 010h, 038h, 06ch, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 000h, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 060h, 030h, 018h, 000h, 07ch, 0c6h, 0feh, 0c0h, 0c0h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 066h, 000h, 000h, 038h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 018h, 03ch, 066h, 000h, 038h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 060h, 030h, 018h, 000h, 038h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 0c6h, 000h, 010h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 038h, 06ch, 038h, 000h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 018h, 030h, 060h, 000h, 0feh, 066h, 060h, 07ch, 060h, 060h, 066h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 06eh, 03bh, 01bh, 07eh, 0d8h, 0dch, 077h, 000h, 000h, 000h, 000h
db 000h, 000h, 03eh, 06ch, 0cch, 0cch, 0feh, 0cch, 0cch, 0cch, 0cch, 0ceh, 000h, 000h, 000h, 000h
db 000h, 010h, 038h, 06ch, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 060h, 030h, 018h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 030h, 078h, 0cch, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 060h, 030h, 018h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 0c6h, 000h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07eh, 006h, 00ch, 078h, 000h
db 000h, 0c6h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 0c6h, 000h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 018h, 018h, 07eh, 0c3h, 0c0h, 0c0h, 0c0h, 0c3h, 07eh, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 038h, 06ch, 064h, 060h, 0f0h, 060h, 060h, 060h, 060h, 0e6h, 0fch, 000h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 066h, 03ch, 018h, 0ffh, 018h, 0ffh, 018h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 0fch, 066h, 066h, 07ch, 062h, 066h, 06fh, 066h, 066h, 066h, 0f3h, 000h, 000h, 000h, 000h
db 000h, 00eh, 01bh, 018h, 018h, 018h, 07eh, 018h, 018h, 018h, 018h, 018h, 0d8h, 070h, 000h, 000h
db 000h, 018h, 030h, 060h, 000h, 078h, 00ch, 07ch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 00ch, 018h, 030h, 000h, 038h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h
db 000h, 018h, 030h, 060h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 018h, 030h, 060h, 000h, 0cch, 0cch, 0cch, 0cch, 0cch, 0cch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 076h, 0dch, 000h, 0dch, 066h, 066h, 066h, 066h, 066h, 066h, 000h, 000h, 000h, 000h
db 076h, 0dch, 000h, 0c6h, 0e6h, 0f6h, 0feh, 0deh, 0ceh, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 000h, 03ch, 06ch, 06ch, 03eh, 000h, 07eh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 038h, 06ch, 06ch, 038h, 000h, 07ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 030h, 030h, 000h, 030h, 030h, 060h, 0c0h, 0c6h, 0c6h, 07ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 0c0h, 0c0h, 0c0h, 0c0h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 006h, 006h, 006h, 006h, 000h, 000h, 000h, 000h, 000h
db 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 060h, 0ceh, 09bh, 006h, 00ch, 01fh, 000h, 000h
db 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 066h, 0ceh, 096h, 03eh, 006h, 006h, 000h, 000h
db 000h, 000h, 018h, 018h, 000h, 018h, 018h, 018h, 03ch, 03ch, 03ch, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 036h, 06ch, 0d8h, 06ch, 036h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0d8h, 06ch, 036h, 06ch, 0d8h, 000h, 000h, 000h, 000h, 000h, 000h
db 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h, 011h, 044h
db 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah, 055h, 0aah
db 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h, 0ddh, 077h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0f8h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 0f8h, 018h, 0f8h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0f6h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0feh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 000h, 000h, 000h, 000h, 000h, 0f8h, 018h, 0f8h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 036h, 036h, 036h, 036h, 036h, 0f6h, 006h, 0f6h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 000h, 000h, 000h, 000h, 000h, 0feh, 006h, 0f6h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 0f6h, 006h, 0feh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0feh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 018h, 018h, 018h, 0f8h, 018h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0f8h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 01fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 01fh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 01fh, 018h, 01fh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 037h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 037h, 030h, 03fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 03fh, 030h, 037h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 0f7h, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 0f7h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 037h, 030h, 037h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 036h, 036h, 036h, 036h, 036h, 0f7h, 000h, 0f7h, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 018h, 018h, 018h, 018h, 018h, 0ffh, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 0ffh, 000h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 03fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 018h, 018h, 018h, 018h, 018h, 01fh, 018h, 01fh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 01fh, 018h, 01fh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 03fh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 036h, 036h, 036h, 036h, 036h, 036h, 036h, 0ffh, 036h, 036h, 036h, 036h, 036h, 036h, 036h, 036h
db 018h, 018h, 018h, 018h, 018h, 0ffh, 018h, 0ffh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 01fh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh
db 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h, 0f0h
db 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh, 00fh
db 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 0d8h, 0d8h, 0d8h, 0dch, 076h, 000h, 000h, 000h, 000h
db 000h, 000h, 078h, 0cch, 0cch, 0cch, 0d8h, 0cch, 0c6h, 0c6h, 0c6h, 0cch, 000h, 000h, 000h, 000h
db 000h, 000h, 0feh, 0c6h, 0c6h, 0c0h, 0c0h, 0c0h, 0c0h, 0c0h, 0c0h, 0c0h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 0feh, 06ch, 06ch, 06ch, 06ch, 06ch, 06ch, 06ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 0feh, 0c6h, 060h, 030h, 018h, 030h, 060h, 0c6h, 0feh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07eh, 0d8h, 0d8h, 0d8h, 0d8h, 0d8h, 070h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 066h, 066h, 066h, 066h, 066h, 07ch, 060h, 060h, 0c0h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 076h, 0dch, 018h, 018h, 018h, 018h, 018h, 018h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 07eh, 018h, 03ch, 066h, 066h, 066h, 03ch, 018h, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 038h, 06ch, 0c6h, 0c6h, 0feh, 0c6h, 0c6h, 06ch, 038h, 000h, 000h, 000h, 000h
db 000h, 000h, 038h, 06ch, 0c6h, 0c6h, 0c6h, 06ch, 06ch, 06ch, 06ch, 0eeh, 000h, 000h, 000h, 000h
db 000h, 000h, 01eh, 030h, 018h, 00ch, 03eh, 066h, 066h, 066h, 066h, 03ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 07eh, 0dbh, 0dbh, 0dbh, 07eh, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 003h, 006h, 07eh, 0dbh, 0dbh, 0f3h, 07eh, 060h, 0c0h, 000h, 000h, 000h, 000h
db 000h, 000h, 01ch, 030h, 060h, 060h, 07ch, 060h, 060h, 060h, 030h, 01ch, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 07ch, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 0c6h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 0feh, 000h, 000h, 0feh, 000h, 000h, 0feh, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 018h, 07eh, 018h, 018h, 000h, 000h, 0ffh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 030h, 018h, 00ch, 006h, 00ch, 018h, 030h, 000h, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 00ch, 018h, 030h, 060h, 030h, 018h, 00ch, 000h, 07eh, 000h, 000h, 000h, 000h
db 000h, 000h, 00eh, 01bh, 01bh, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h
db 018h, 018h, 018h, 018h, 018h, 018h, 018h, 018h, 0d8h, 0d8h, 0d8h, 070h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 018h, 018h, 000h, 07eh, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 076h, 0dch, 000h, 076h, 0dch, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 038h, 06ch, 06ch, 038h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 018h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 00fh, 00ch, 00ch, 00ch, 00ch, 00ch, 0ech, 06ch, 06ch, 03ch, 01ch, 000h, 000h, 000h, 000h
db 000h, 0d8h, 06ch, 06ch, 06ch, 06ch, 06ch, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 070h, 0d8h, 030h, 060h, 0c8h, 0f8h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 07ch, 000h, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h
_vgafont14alt: ; 0xc79ed LB 0x12d
db 01dh, 000h, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h, 000h, 000h, 000h, 022h
db 000h, 063h, 063h, 063h, 022h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 02bh, 000h
db 000h, 000h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h, 000h, 000h, 000h, 000h, 02dh, 000h, 000h
db 000h, 000h, 000h, 000h, 0ffh, 000h, 000h, 000h, 000h, 000h, 000h, 000h, 04dh, 000h, 000h, 0c3h
db 0e7h, 0ffh, 0dbh, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 000h, 000h, 000h, 054h, 000h, 000h, 0ffh, 0dbh
db 099h, 018h, 018h, 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 056h, 000h, 000h, 0c3h, 0c3h, 0c3h
db 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h, 000h, 000h, 000h, 057h, 000h, 000h, 0c3h, 0c3h, 0c3h, 0c3h
db 0dbh, 0dbh, 0ffh, 066h, 066h, 000h, 000h, 000h, 058h, 000h, 000h, 0c3h, 0c3h, 066h, 03ch, 018h
db 03ch, 066h, 0c3h, 0c3h, 000h, 000h, 000h, 059h, 000h, 000h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h
db 018h, 018h, 03ch, 000h, 000h, 000h, 05ah, 000h, 000h, 0ffh, 0c3h, 086h, 00ch, 018h, 030h, 061h
db 0c3h, 0ffh, 000h, 000h, 000h, 06dh, 000h, 000h, 000h, 000h, 000h, 0e6h, 0ffh, 0dbh, 0dbh, 0dbh
db 0dbh, 000h, 000h, 000h, 076h, 000h, 000h, 000h, 000h, 000h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h
db 000h, 000h, 000h, 077h, 000h, 000h, 000h, 000h, 000h, 0c3h, 0c3h, 0dbh, 0dbh, 0ffh, 066h, 000h
db 000h, 000h, 091h, 000h, 000h, 000h, 000h, 06eh, 03bh, 01bh, 07eh, 0d8h, 0dch, 077h, 000h, 000h
db 000h, 09bh, 000h, 018h, 018h, 07eh, 0c3h, 0c0h, 0c0h, 0c3h, 07eh, 018h, 018h, 000h, 000h, 000h
db 09dh, 000h, 000h, 0c3h, 066h, 03ch, 018h, 0ffh, 018h, 0ffh, 018h, 018h, 000h, 000h, 000h, 09eh
db 000h, 0fch, 066h, 066h, 07ch, 062h, 066h, 06fh, 066h, 066h, 0f3h, 000h, 000h, 000h, 0f1h, 000h
db 000h, 018h, 018h, 018h, 0ffh, 018h, 018h, 018h, 000h, 0ffh, 000h, 000h, 000h, 0f6h, 000h, 000h
db 018h, 018h, 000h, 000h, 0ffh, 000h, 000h, 018h, 018h, 000h, 000h, 000h, 000h
_vgafont16alt: ; 0xc7b1a LB 0x144
db 01dh, 000h, 000h, 000h, 000h, 000h, 024h, 066h, 0ffh, 066h, 024h, 000h, 000h, 000h, 000h, 000h
db 000h, 030h, 000h, 000h, 03ch, 066h, 0c3h, 0c3h, 0dbh, 0dbh, 0c3h, 0c3h, 066h, 03ch, 000h, 000h
db 000h, 000h, 04dh, 000h, 000h, 0c3h, 0e7h, 0ffh, 0ffh, 0dbh, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 000h
db 000h, 000h, 000h, 054h, 000h, 000h, 0ffh, 0dbh, 099h, 018h, 018h, 018h, 018h, 018h, 018h, 03ch
db 000h, 000h, 000h, 000h, 056h, 000h, 000h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 066h, 03ch
db 018h, 000h, 000h, 000h, 000h, 057h, 000h, 000h, 0c3h, 0c3h, 0c3h, 0c3h, 0c3h, 0dbh, 0dbh, 0ffh
db 066h, 066h, 000h, 000h, 000h, 000h, 058h, 000h, 000h, 0c3h, 0c3h, 066h, 03ch, 018h, 018h, 03ch
db 066h, 0c3h, 0c3h, 000h, 000h, 000h, 000h, 059h, 000h, 000h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h
db 018h, 018h, 018h, 03ch, 000h, 000h, 000h, 000h, 05ah, 000h, 000h, 0ffh, 0c3h, 086h, 00ch, 018h
db 030h, 060h, 0c1h, 0c3h, 0ffh, 000h, 000h, 000h, 000h, 06dh, 000h, 000h, 000h, 000h, 000h, 0e6h
db 0ffh, 0dbh, 0dbh, 0dbh, 0dbh, 0dbh, 000h, 000h, 000h, 000h, 076h, 000h, 000h, 000h, 000h, 000h
db 0c3h, 0c3h, 0c3h, 0c3h, 066h, 03ch, 018h, 000h, 000h, 000h, 000h, 077h, 000h, 000h, 000h, 000h
db 000h, 0c3h, 0c3h, 0c3h, 0dbh, 0dbh, 0ffh, 066h, 000h, 000h, 000h, 000h, 078h, 000h, 000h, 000h
db 000h, 000h, 0c3h, 066h, 03ch, 018h, 03ch, 066h, 0c3h, 000h, 000h, 000h, 000h, 091h, 000h, 000h
db 000h, 000h, 000h, 06eh, 03bh, 01bh, 07eh, 0d8h, 0dch, 077h, 000h, 000h, 000h, 000h, 09bh, 000h
db 018h, 018h, 07eh, 0c3h, 0c0h, 0c0h, 0c0h, 0c3h, 07eh, 018h, 018h, 000h, 000h, 000h, 000h, 09dh
db 000h, 000h, 0c3h, 066h, 03ch, 018h, 0ffh, 018h, 0ffh, 018h, 018h, 018h, 000h, 000h, 000h, 000h
db 09eh, 000h, 0fch, 066h, 066h, 07ch, 062h, 066h, 06fh, 066h, 066h, 066h, 0f3h, 000h, 000h, 000h
db 000h, 0abh, 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 060h, 0ceh, 09bh, 006h, 00ch, 01fh
db 000h, 000h, 0ach, 000h, 0c0h, 0c0h, 0c2h, 0c6h, 0cch, 018h, 030h, 066h, 0ceh, 096h, 03eh, 006h
db 006h, 000h, 000h, 000h
_cga_msr: ; 0xc7c5e LB 0x8
db 02ch, 028h, 02dh, 029h, 02ah, 02eh, 01eh, 029h
_vbebios_copyright: ; 0xc7c66 LB 0x15
db 'VirtualBox VESA BIOS', 000h
_vbebios_vendor_name: ; 0xc7c7b LB 0x13
db 'Oracle Corporation', 000h
_vbebios_product_name: ; 0xc7c8e LB 0x21
db 'Oracle VM VirtualBox VBE Adapter', 000h
_vbebios_product_revision: ; 0xc7caf LB 0x24
db 'Oracle VM VirtualBox Version 5.2.35', 000h
_vbebios_info_string: ; 0xc7cd3 LB 0x2b
db 'VirtualBox VBE Display Adapter enabled', 00dh, 00ah, 00dh, 00ah, 000h
_no_vbebios_info_string: ; 0xc7cfe LB 0x29
db 'No VirtualBox VBE support available!', 00dh, 00ah, 00dh, 00ah, 000h
; Padding 0x1 bytes at 0xc7d27
db 001h
section CONST progbits vstart=0x7d28 align=1 ; size=0x0 class=DATA group=DGROUP
section CONST2 progbits vstart=0x7d28 align=1 ; size=0x0 class=DATA group=DGROUP
; Padding 0x2d8 bytes at 0xc7d28
db 000h, 000h, 000h, 000h, 001h, 000h, 000h, 000h, 000h, 000h, 000h, 044h, 03ah, 05ch, 052h, 065h
db 070h, 06fh, 073h, 069h, 074h, 06fh, 072h, 079h, 05ch, 062h, 072h, 061h, 06eh, 063h, 068h, 065h
db 073h, 05ch, 056h, 042h, 06fh, 078h, 02dh, 035h, 02eh, 032h, 05ch, 06fh, 075h, 074h, 05ch, 077h
db 069h, 06eh, 02eh, 061h, 06dh, 064h, 036h, 034h, 05ch, 072h, 065h, 06ch, 065h, 061h, 073h, 065h
db 05ch, 06fh, 062h, 06ah, 05ch, 056h, 042h, 06fh, 078h, 056h, 067h, 061h, 042h, 069h, 06fh, 073h
db 038h, 030h, 038h, 036h, 05ch, 056h, 042h, 06fh, 078h, 056h, 067h, 061h, 042h, 069h, 06fh, 073h
db 038h, 030h, 038h, 036h, 02eh, 073h, 079h, 06dh, 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, 0bdh
| 58.979349 | 109 | 0.352469 |
93d0d4b56242e965bd6fa625d4f0f15fc8de5841 | 438 | asm | Assembly | programs/oeis/130/A130632.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/130/A130632.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/130/A130632.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A130632: Number of natural numbers between d(n) and d(n+1), where d(n) denotes the number of divisors of n.
; 0,0,0,0,1,1,1,0,0,1,3,3,1,0,0,2,3,3,3,1,0,1,5,4,0,0,1,3,5,5,3,1,0,0,4,6,1,0,3,5,5,5,3,0,1,1,7,6,2,1,1,3,5,3,3,3,0,1,9,9,1,1,0,2,3,5,3,1,3,5,9,9,1,1,0,1,3,5,7,4,0,1,9,7,0,0,3,5,9,7,1,1,0,0,7,9,3,0,2,6
seq $0,51950 ; Differences between values of tau(n) (A000005): a(n) = tau(n)-tau(n-1).
mov $1,$0
cmp $0,0
gcd $0,$1
sub $0,1
| 48.666667 | 201 | 0.586758 |
339ef0b298df2b0a90d8359f9129f64369089ed0 | 1,548 | asm | Assembly | Assembly/power.asm | prynix/learning-programming | 85aea40a61fb824a2b4e142331d9ac7971fef263 | [
"MIT"
] | 2 | 2017-03-14T16:02:08.000Z | 2017-05-02T13:48:18.000Z | Assembly/power.asm | CajetanP/learning-programming | 85aea40a61fb824a2b4e142331d9ac7971fef263 | [
"MIT"
] | 4 | 2021-05-20T21:10:13.000Z | 2022-02-26T09:50:19.000Z | Assembly/power.asm | CajetanP/learning-programming | 85aea40a61fb824a2b4e142331d9ac7971fef263 | [
"MIT"
] | 1 | 2021-06-18T01:31:24.000Z | 2021-06-18T01:31:24.000Z | ; A 64-bit command line application to compute x^y.
; nasm -felf64 power.asm && gcc -o power power.o
; Syntax: power x y
global main
extern printf
extern puts
extern atoi
section .text
main:
push r12 ; save callee-save registers
push r13
push r14
;; Stack already aligned for calls
cmp rdi, 3 ; we need exactly 2 arguments
jne error1
mov r12, rsi ; argv
;; ecx - countdown to 0
;; esi - base value
;; eax - running product
mov rdi, [r12 + 8*2] ; argv[2]
call atoi WRT ..plt ; y in eax
cmp eax, 0 ; disallow negative exponents
jl error2
mov r13d, eax ; y in r13d
mov rdi, [r12 + 8] ; argv[1]
call atoi WRT ..plt ; x in eax
mov r14d, eax ; x in r14d
mov eax, 1 ; start with result = 1
check:
test r13d, r13d ; counting y down to 0
jz gotit
imul eax, r14d
dec r13d
jmp check
gotit:
lea rdi, [rel answer]
movsxd rsi, eax
xor rax, rax
call printf WRT ..plt
jmp done
error1:
lea edi, [rel badArgumentCount]
call puts WRT ..plt
jmp done
error2:
lea edi, [rel negativeExponent]
call puts WRT ..plt
done:
pop r14
pop r13
pop r12
xor rax, rax
ret
answer:
db "%d", 10, 0
badArgumentCount:
db "Requires exactly two arguments", 10, 0
negativeExponent:
db "The exponent may not be negative", 10, 0
| 21.205479 | 61 | 0.546512 |
af1eb67624188c769449a3e80dd96bf7754b3124 | 44,364 | asm | Assembly | rm.asm | lzckira/CS153-lab3 | d7c535fd189fa3444372c1fa639b19c4dca73908 | [
"MIT-0"
] | null | null | null | rm.asm | lzckira/CS153-lab3 | d7c535fd189fa3444372c1fa639b19c4dca73908 | [
"MIT-0"
] | null | null | null | rm.asm | lzckira/CS153-lab3 | d7c535fd189fa3444372c1fa639b19c4dca73908 | [
"MIT-0"
] | null | null | null |
_rm: file format elf32-i386
Disassembly of section .text:
00001000 <main>:
#include "stat.h"
#include "user.h"
int
main(int argc, char *argv[])
{
1000: 55 push %ebp
1001: 89 e5 mov %esp,%ebp
1003: 57 push %edi
1004: 56 push %esi
int i;
if(argc < 2){
1005: be 01 00 00 00 mov $0x1,%esi
{
100a: 53 push %ebx
100b: 83 e4 f0 and $0xfffffff0,%esp
100e: 83 ec 10 sub $0x10,%esp
1011: 8b 7d 08 mov 0x8(%ebp),%edi
1014: 8b 45 0c mov 0xc(%ebp),%eax
if(argc < 2){
1017: 83 ff 01 cmp $0x1,%edi
101a: 8d 58 04 lea 0x4(%eax),%ebx
101d: 7e 3a jle 1059 <main+0x59>
101f: 90 nop
printf(2, "Usage: rm files...\n");
exit();
}
for(i = 1; i < argc; i++){
if(unlink(argv[i]) < 0){
1020: 8b 03 mov (%ebx),%eax
1022: 89 04 24 mov %eax,(%esp)
1025: e8 c8 02 00 00 call 12f2 <unlink>
102a: 85 c0 test %eax,%eax
102c: 78 0f js 103d <main+0x3d>
for(i = 1; i < argc; i++){
102e: 83 c6 01 add $0x1,%esi
1031: 83 c3 04 add $0x4,%ebx
1034: 39 fe cmp %edi,%esi
1036: 75 e8 jne 1020 <main+0x20>
printf(2, "rm: %s failed to delete\n", argv[i]);
break;
}
}
exit();
1038: e8 65 02 00 00 call 12a2 <exit>
printf(2, "rm: %s failed to delete\n", argv[i]);
103d: 8b 03 mov (%ebx),%eax
103f: c7 44 24 04 b5 17 00 movl $0x17b5,0x4(%esp)
1046: 00
1047: c7 04 24 02 00 00 00 movl $0x2,(%esp)
104e: 89 44 24 08 mov %eax,0x8(%esp)
1052: e8 a9 03 00 00 call 1400 <printf>
break;
1057: eb df jmp 1038 <main+0x38>
printf(2, "Usage: rm files...\n");
1059: c7 44 24 04 a1 17 00 movl $0x17a1,0x4(%esp)
1060: 00
1061: c7 04 24 02 00 00 00 movl $0x2,(%esp)
1068: e8 93 03 00 00 call 1400 <printf>
exit();
106d: e8 30 02 00 00 call 12a2 <exit>
1072: 66 90 xchg %ax,%ax
1074: 66 90 xchg %ax,%ax
1076: 66 90 xchg %ax,%ax
1078: 66 90 xchg %ax,%ax
107a: 66 90 xchg %ax,%ax
107c: 66 90 xchg %ax,%ax
107e: 66 90 xchg %ax,%ax
00001080 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
1080: 55 push %ebp
1081: 89 e5 mov %esp,%ebp
1083: 8b 45 08 mov 0x8(%ebp),%eax
1086: 8b 4d 0c mov 0xc(%ebp),%ecx
1089: 53 push %ebx
char *os;
os = s;
while((*s++ = *t++) != 0)
108a: 89 c2 mov %eax,%edx
108c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1090: 83 c1 01 add $0x1,%ecx
1093: 0f b6 59 ff movzbl -0x1(%ecx),%ebx
1097: 83 c2 01 add $0x1,%edx
109a: 84 db test %bl,%bl
109c: 88 5a ff mov %bl,-0x1(%edx)
109f: 75 ef jne 1090 <strcpy+0x10>
;
return os;
}
10a1: 5b pop %ebx
10a2: 5d pop %ebp
10a3: c3 ret
10a4: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
10aa: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
000010b0 <strcmp>:
int
strcmp(const char *p, const char *q)
{
10b0: 55 push %ebp
10b1: 89 e5 mov %esp,%ebp
10b3: 8b 55 08 mov 0x8(%ebp),%edx
10b6: 53 push %ebx
10b7: 8b 4d 0c mov 0xc(%ebp),%ecx
while(*p && *p == *q)
10ba: 0f b6 02 movzbl (%edx),%eax
10bd: 84 c0 test %al,%al
10bf: 74 2d je 10ee <strcmp+0x3e>
10c1: 0f b6 19 movzbl (%ecx),%ebx
10c4: 38 d8 cmp %bl,%al
10c6: 74 0e je 10d6 <strcmp+0x26>
10c8: eb 2b jmp 10f5 <strcmp+0x45>
10ca: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
10d0: 38 c8 cmp %cl,%al
10d2: 75 15 jne 10e9 <strcmp+0x39>
p++, q++;
10d4: 89 d9 mov %ebx,%ecx
10d6: 83 c2 01 add $0x1,%edx
while(*p && *p == *q)
10d9: 0f b6 02 movzbl (%edx),%eax
p++, q++;
10dc: 8d 59 01 lea 0x1(%ecx),%ebx
while(*p && *p == *q)
10df: 0f b6 49 01 movzbl 0x1(%ecx),%ecx
10e3: 84 c0 test %al,%al
10e5: 75 e9 jne 10d0 <strcmp+0x20>
10e7: 31 c0 xor %eax,%eax
return (uchar)*p - (uchar)*q;
10e9: 29 c8 sub %ecx,%eax
}
10eb: 5b pop %ebx
10ec: 5d pop %ebp
10ed: c3 ret
10ee: 0f b6 09 movzbl (%ecx),%ecx
while(*p && *p == *q)
10f1: 31 c0 xor %eax,%eax
10f3: eb f4 jmp 10e9 <strcmp+0x39>
10f5: 0f b6 cb movzbl %bl,%ecx
10f8: eb ef jmp 10e9 <strcmp+0x39>
10fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
00001100 <strlen>:
uint
strlen(char *s)
{
1100: 55 push %ebp
1101: 89 e5 mov %esp,%ebp
1103: 8b 4d 08 mov 0x8(%ebp),%ecx
int n;
for(n = 0; s[n]; n++)
1106: 80 39 00 cmpb $0x0,(%ecx)
1109: 74 12 je 111d <strlen+0x1d>
110b: 31 d2 xor %edx,%edx
110d: 8d 76 00 lea 0x0(%esi),%esi
1110: 83 c2 01 add $0x1,%edx
1113: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1)
1117: 89 d0 mov %edx,%eax
1119: 75 f5 jne 1110 <strlen+0x10>
;
return n;
}
111b: 5d pop %ebp
111c: c3 ret
for(n = 0; s[n]; n++)
111d: 31 c0 xor %eax,%eax
}
111f: 5d pop %ebp
1120: c3 ret
1121: eb 0d jmp 1130 <memset>
1123: 90 nop
1124: 90 nop
1125: 90 nop
1126: 90 nop
1127: 90 nop
1128: 90 nop
1129: 90 nop
112a: 90 nop
112b: 90 nop
112c: 90 nop
112d: 90 nop
112e: 90 nop
112f: 90 nop
00001130 <memset>:
void*
memset(void *dst, int c, uint n)
{
1130: 55 push %ebp
1131: 89 e5 mov %esp,%ebp
1133: 8b 55 08 mov 0x8(%ebp),%edx
1136: 57 push %edi
}
static inline void
stosb(void *addr, int data, int cnt)
{
asm volatile("cld; rep stosb" :
1137: 8b 4d 10 mov 0x10(%ebp),%ecx
113a: 8b 45 0c mov 0xc(%ebp),%eax
113d: 89 d7 mov %edx,%edi
113f: fc cld
1140: f3 aa rep stos %al,%es:(%edi)
stosb(dst, c, n);
return dst;
}
1142: 89 d0 mov %edx,%eax
1144: 5f pop %edi
1145: 5d pop %ebp
1146: c3 ret
1147: 89 f6 mov %esi,%esi
1149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00001150 <strchr>:
char*
strchr(const char *s, char c)
{
1150: 55 push %ebp
1151: 89 e5 mov %esp,%ebp
1153: 8b 45 08 mov 0x8(%ebp),%eax
1156: 53 push %ebx
1157: 8b 55 0c mov 0xc(%ebp),%edx
for(; *s; s++)
115a: 0f b6 18 movzbl (%eax),%ebx
115d: 84 db test %bl,%bl
115f: 74 1d je 117e <strchr+0x2e>
if(*s == c)
1161: 38 d3 cmp %dl,%bl
1163: 89 d1 mov %edx,%ecx
1165: 75 0d jne 1174 <strchr+0x24>
1167: eb 17 jmp 1180 <strchr+0x30>
1169: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
1170: 38 ca cmp %cl,%dl
1172: 74 0c je 1180 <strchr+0x30>
for(; *s; s++)
1174: 83 c0 01 add $0x1,%eax
1177: 0f b6 10 movzbl (%eax),%edx
117a: 84 d2 test %dl,%dl
117c: 75 f2 jne 1170 <strchr+0x20>
return (char*)s;
return 0;
117e: 31 c0 xor %eax,%eax
}
1180: 5b pop %ebx
1181: 5d pop %ebp
1182: c3 ret
1183: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1189: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
00001190 <gets>:
char*
gets(char *buf, int max)
{
1190: 55 push %ebp
1191: 89 e5 mov %esp,%ebp
1193: 57 push %edi
1194: 56 push %esi
int i, cc;
char c;
for(i=0; i+1 < max; ){
1195: 31 f6 xor %esi,%esi
{
1197: 53 push %ebx
1198: 83 ec 2c sub $0x2c,%esp
cc = read(0, &c, 1);
119b: 8d 7d e7 lea -0x19(%ebp),%edi
for(i=0; i+1 < max; ){
119e: eb 31 jmp 11d1 <gets+0x41>
cc = read(0, &c, 1);
11a0: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
11a7: 00
11a8: 89 7c 24 04 mov %edi,0x4(%esp)
11ac: c7 04 24 00 00 00 00 movl $0x0,(%esp)
11b3: e8 02 01 00 00 call 12ba <read>
if(cc < 1)
11b8: 85 c0 test %eax,%eax
11ba: 7e 1d jle 11d9 <gets+0x49>
break;
buf[i++] = c;
11bc: 0f b6 45 e7 movzbl -0x19(%ebp),%eax
for(i=0; i+1 < max; ){
11c0: 89 de mov %ebx,%esi
buf[i++] = c;
11c2: 8b 55 08 mov 0x8(%ebp),%edx
if(c == '\n' || c == '\r')
11c5: 3c 0d cmp $0xd,%al
buf[i++] = c;
11c7: 88 44 1a ff mov %al,-0x1(%edx,%ebx,1)
if(c == '\n' || c == '\r')
11cb: 74 0c je 11d9 <gets+0x49>
11cd: 3c 0a cmp $0xa,%al
11cf: 74 08 je 11d9 <gets+0x49>
for(i=0; i+1 < max; ){
11d1: 8d 5e 01 lea 0x1(%esi),%ebx
11d4: 3b 5d 0c cmp 0xc(%ebp),%ebx
11d7: 7c c7 jl 11a0 <gets+0x10>
break;
}
buf[i] = '\0';
11d9: 8b 45 08 mov 0x8(%ebp),%eax
11dc: c6 04 30 00 movb $0x0,(%eax,%esi,1)
return buf;
}
11e0: 83 c4 2c add $0x2c,%esp
11e3: 5b pop %ebx
11e4: 5e pop %esi
11e5: 5f pop %edi
11e6: 5d pop %ebp
11e7: c3 ret
11e8: 90 nop
11e9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi
000011f0 <stat>:
int
stat(char *n, struct stat *st)
{
11f0: 55 push %ebp
11f1: 89 e5 mov %esp,%ebp
11f3: 56 push %esi
11f4: 53 push %ebx
11f5: 83 ec 10 sub $0x10,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
11f8: 8b 45 08 mov 0x8(%ebp),%eax
11fb: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
1202: 00
1203: 89 04 24 mov %eax,(%esp)
1206: e8 d7 00 00 00 call 12e2 <open>
if(fd < 0)
120b: 85 c0 test %eax,%eax
fd = open(n, O_RDONLY);
120d: 89 c3 mov %eax,%ebx
if(fd < 0)
120f: 78 27 js 1238 <stat+0x48>
return -1;
r = fstat(fd, st);
1211: 8b 45 0c mov 0xc(%ebp),%eax
1214: 89 1c 24 mov %ebx,(%esp)
1217: 89 44 24 04 mov %eax,0x4(%esp)
121b: e8 da 00 00 00 call 12fa <fstat>
close(fd);
1220: 89 1c 24 mov %ebx,(%esp)
r = fstat(fd, st);
1223: 89 c6 mov %eax,%esi
close(fd);
1225: e8 a0 00 00 00 call 12ca <close>
return r;
122a: 89 f0 mov %esi,%eax
}
122c: 83 c4 10 add $0x10,%esp
122f: 5b pop %ebx
1230: 5e pop %esi
1231: 5d pop %ebp
1232: c3 ret
1233: 90 nop
1234: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
return -1;
1238: b8 ff ff ff ff mov $0xffffffff,%eax
123d: eb ed jmp 122c <stat+0x3c>
123f: 90 nop
00001240 <atoi>:
int
atoi(const char *s)
{
1240: 55 push %ebp
1241: 89 e5 mov %esp,%ebp
1243: 8b 4d 08 mov 0x8(%ebp),%ecx
1246: 53 push %ebx
int n;
n = 0;
while('0' <= *s && *s <= '9')
1247: 0f be 11 movsbl (%ecx),%edx
124a: 8d 42 d0 lea -0x30(%edx),%eax
124d: 3c 09 cmp $0x9,%al
n = 0;
124f: b8 00 00 00 00 mov $0x0,%eax
while('0' <= *s && *s <= '9')
1254: 77 17 ja 126d <atoi+0x2d>
1256: 66 90 xchg %ax,%ax
n = n*10 + *s++ - '0';
1258: 83 c1 01 add $0x1,%ecx
125b: 8d 04 80 lea (%eax,%eax,4),%eax
125e: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax
while('0' <= *s && *s <= '9')
1262: 0f be 11 movsbl (%ecx),%edx
1265: 8d 5a d0 lea -0x30(%edx),%ebx
1268: 80 fb 09 cmp $0x9,%bl
126b: 76 eb jbe 1258 <atoi+0x18>
return n;
}
126d: 5b pop %ebx
126e: 5d pop %ebp
126f: c3 ret
00001270 <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
1270: 55 push %ebp
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
1271: 31 d2 xor %edx,%edx
{
1273: 89 e5 mov %esp,%ebp
1275: 56 push %esi
1276: 8b 45 08 mov 0x8(%ebp),%eax
1279: 53 push %ebx
127a: 8b 5d 10 mov 0x10(%ebp),%ebx
127d: 8b 75 0c mov 0xc(%ebp),%esi
while(n-- > 0)
1280: 85 db test %ebx,%ebx
1282: 7e 12 jle 1296 <memmove+0x26>
1284: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
*dst++ = *src++;
1288: 0f b6 0c 16 movzbl (%esi,%edx,1),%ecx
128c: 88 0c 10 mov %cl,(%eax,%edx,1)
128f: 83 c2 01 add $0x1,%edx
while(n-- > 0)
1292: 39 da cmp %ebx,%edx
1294: 75 f2 jne 1288 <memmove+0x18>
return vdst;
}
1296: 5b pop %ebx
1297: 5e pop %esi
1298: 5d pop %ebp
1299: c3 ret
0000129a <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
129a: b8 01 00 00 00 mov $0x1,%eax
129f: cd 40 int $0x40
12a1: c3 ret
000012a2 <exit>:
SYSCALL(exit)
12a2: b8 02 00 00 00 mov $0x2,%eax
12a7: cd 40 int $0x40
12a9: c3 ret
000012aa <wait>:
SYSCALL(wait)
12aa: b8 03 00 00 00 mov $0x3,%eax
12af: cd 40 int $0x40
12b1: c3 ret
000012b2 <pipe>:
SYSCALL(pipe)
12b2: b8 04 00 00 00 mov $0x4,%eax
12b7: cd 40 int $0x40
12b9: c3 ret
000012ba <read>:
SYSCALL(read)
12ba: b8 05 00 00 00 mov $0x5,%eax
12bf: cd 40 int $0x40
12c1: c3 ret
000012c2 <write>:
SYSCALL(write)
12c2: b8 10 00 00 00 mov $0x10,%eax
12c7: cd 40 int $0x40
12c9: c3 ret
000012ca <close>:
SYSCALL(close)
12ca: b8 15 00 00 00 mov $0x15,%eax
12cf: cd 40 int $0x40
12d1: c3 ret
000012d2 <kill>:
SYSCALL(kill)
12d2: b8 06 00 00 00 mov $0x6,%eax
12d7: cd 40 int $0x40
12d9: c3 ret
000012da <exec>:
SYSCALL(exec)
12da: b8 07 00 00 00 mov $0x7,%eax
12df: cd 40 int $0x40
12e1: c3 ret
000012e2 <open>:
SYSCALL(open)
12e2: b8 0f 00 00 00 mov $0xf,%eax
12e7: cd 40 int $0x40
12e9: c3 ret
000012ea <mknod>:
SYSCALL(mknod)
12ea: b8 11 00 00 00 mov $0x11,%eax
12ef: cd 40 int $0x40
12f1: c3 ret
000012f2 <unlink>:
SYSCALL(unlink)
12f2: b8 12 00 00 00 mov $0x12,%eax
12f7: cd 40 int $0x40
12f9: c3 ret
000012fa <fstat>:
SYSCALL(fstat)
12fa: b8 08 00 00 00 mov $0x8,%eax
12ff: cd 40 int $0x40
1301: c3 ret
00001302 <link>:
SYSCALL(link)
1302: b8 13 00 00 00 mov $0x13,%eax
1307: cd 40 int $0x40
1309: c3 ret
0000130a <mkdir>:
SYSCALL(mkdir)
130a: b8 14 00 00 00 mov $0x14,%eax
130f: cd 40 int $0x40
1311: c3 ret
00001312 <chdir>:
SYSCALL(chdir)
1312: b8 09 00 00 00 mov $0x9,%eax
1317: cd 40 int $0x40
1319: c3 ret
0000131a <dup>:
SYSCALL(dup)
131a: b8 0a 00 00 00 mov $0xa,%eax
131f: cd 40 int $0x40
1321: c3 ret
00001322 <getpid>:
SYSCALL(getpid)
1322: b8 0b 00 00 00 mov $0xb,%eax
1327: cd 40 int $0x40
1329: c3 ret
0000132a <sbrk>:
SYSCALL(sbrk)
132a: b8 0c 00 00 00 mov $0xc,%eax
132f: cd 40 int $0x40
1331: c3 ret
00001332 <sleep>:
SYSCALL(sleep)
1332: b8 0d 00 00 00 mov $0xd,%eax
1337: cd 40 int $0x40
1339: c3 ret
0000133a <uptime>:
SYSCALL(uptime)
133a: b8 0e 00 00 00 mov $0xe,%eax
133f: cd 40 int $0x40
1341: c3 ret
00001342 <shm_open>:
SYSCALL(shm_open)
1342: b8 16 00 00 00 mov $0x16,%eax
1347: cd 40 int $0x40
1349: c3 ret
0000134a <shm_close>:
SYSCALL(shm_close)
134a: b8 17 00 00 00 mov $0x17,%eax
134f: cd 40 int $0x40
1351: c3 ret
1352: 66 90 xchg %ax,%ax
1354: 66 90 xchg %ax,%ax
1356: 66 90 xchg %ax,%ax
1358: 66 90 xchg %ax,%ax
135a: 66 90 xchg %ax,%ax
135c: 66 90 xchg %ax,%ax
135e: 66 90 xchg %ax,%ax
00001360 <printint>:
write(fd, &c, 1);
}
static void
printint(int fd, int xx, int base, int sgn)
{
1360: 55 push %ebp
1361: 89 e5 mov %esp,%ebp
1363: 57 push %edi
1364: 56 push %esi
1365: 89 c6 mov %eax,%esi
1367: 53 push %ebx
1368: 83 ec 4c sub $0x4c,%esp
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
136b: 8b 5d 08 mov 0x8(%ebp),%ebx
136e: 85 db test %ebx,%ebx
1370: 74 09 je 137b <printint+0x1b>
1372: 89 d0 mov %edx,%eax
1374: c1 e8 1f shr $0x1f,%eax
1377: 84 c0 test %al,%al
1379: 75 75 jne 13f0 <printint+0x90>
neg = 1;
x = -xx;
} else {
x = xx;
137b: 89 d0 mov %edx,%eax
neg = 0;
137d: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp)
1384: 89 75 c0 mov %esi,-0x40(%ebp)
}
i = 0;
1387: 31 ff xor %edi,%edi
1389: 89 ce mov %ecx,%esi
138b: 8d 5d d7 lea -0x29(%ebp),%ebx
138e: eb 02 jmp 1392 <printint+0x32>
do{
buf[i++] = digits[x % base];
1390: 89 cf mov %ecx,%edi
1392: 31 d2 xor %edx,%edx
1394: f7 f6 div %esi
1396: 8d 4f 01 lea 0x1(%edi),%ecx
1399: 0f b6 92 d5 17 00 00 movzbl 0x17d5(%edx),%edx
}while((x /= base) != 0);
13a0: 85 c0 test %eax,%eax
buf[i++] = digits[x % base];
13a2: 88 14 0b mov %dl,(%ebx,%ecx,1)
}while((x /= base) != 0);
13a5: 75 e9 jne 1390 <printint+0x30>
if(neg)
13a7: 8b 55 c4 mov -0x3c(%ebp),%edx
buf[i++] = digits[x % base];
13aa: 89 c8 mov %ecx,%eax
13ac: 8b 75 c0 mov -0x40(%ebp),%esi
if(neg)
13af: 85 d2 test %edx,%edx
13b1: 74 08 je 13bb <printint+0x5b>
buf[i++] = '-';
13b3: 8d 4f 02 lea 0x2(%edi),%ecx
13b6: c6 44 05 d8 2d movb $0x2d,-0x28(%ebp,%eax,1)
while(--i >= 0)
13bb: 8d 79 ff lea -0x1(%ecx),%edi
13be: 66 90 xchg %ax,%ax
13c0: 0f b6 44 3d d8 movzbl -0x28(%ebp,%edi,1),%eax
13c5: 83 ef 01 sub $0x1,%edi
write(fd, &c, 1);
13c8: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
13cf: 00
13d0: 89 5c 24 04 mov %ebx,0x4(%esp)
13d4: 89 34 24 mov %esi,(%esp)
13d7: 88 45 d7 mov %al,-0x29(%ebp)
13da: e8 e3 fe ff ff call 12c2 <write>
while(--i >= 0)
13df: 83 ff ff cmp $0xffffffff,%edi
13e2: 75 dc jne 13c0 <printint+0x60>
putc(fd, buf[i]);
}
13e4: 83 c4 4c add $0x4c,%esp
13e7: 5b pop %ebx
13e8: 5e pop %esi
13e9: 5f pop %edi
13ea: 5d pop %ebp
13eb: c3 ret
13ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
x = -xx;
13f0: 89 d0 mov %edx,%eax
13f2: f7 d8 neg %eax
neg = 1;
13f4: c7 45 c4 01 00 00 00 movl $0x1,-0x3c(%ebp)
13fb: eb 87 jmp 1384 <printint+0x24>
13fd: 8d 76 00 lea 0x0(%esi),%esi
00001400 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
1400: 55 push %ebp
1401: 89 e5 mov %esp,%ebp
1403: 57 push %edi
char *s;
int c, i, state;
uint *ap;
state = 0;
1404: 31 ff xor %edi,%edi
{
1406: 56 push %esi
1407: 53 push %ebx
1408: 83 ec 3c sub $0x3c,%esp
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
140b: 8b 5d 0c mov 0xc(%ebp),%ebx
ap = (uint*)(void*)&fmt + 1;
140e: 8d 45 10 lea 0x10(%ebp),%eax
{
1411: 8b 75 08 mov 0x8(%ebp),%esi
ap = (uint*)(void*)&fmt + 1;
1414: 89 45 d4 mov %eax,-0x2c(%ebp)
for(i = 0; fmt[i]; i++){
1417: 0f b6 13 movzbl (%ebx),%edx
141a: 83 c3 01 add $0x1,%ebx
141d: 84 d2 test %dl,%dl
141f: 75 39 jne 145a <printf+0x5a>
1421: e9 c2 00 00 00 jmp 14e8 <printf+0xe8>
1426: 66 90 xchg %ax,%ax
c = fmt[i] & 0xff;
if(state == 0){
if(c == '%'){
1428: 83 fa 25 cmp $0x25,%edx
142b: 0f 84 bf 00 00 00 je 14f0 <printf+0xf0>
write(fd, &c, 1);
1431: 8d 45 e2 lea -0x1e(%ebp),%eax
1434: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
143b: 00
143c: 89 44 24 04 mov %eax,0x4(%esp)
1440: 89 34 24 mov %esi,(%esp)
state = '%';
} else {
putc(fd, c);
1443: 88 55 e2 mov %dl,-0x1e(%ebp)
write(fd, &c, 1);
1446: e8 77 fe ff ff call 12c2 <write>
144b: 83 c3 01 add $0x1,%ebx
for(i = 0; fmt[i]; i++){
144e: 0f b6 53 ff movzbl -0x1(%ebx),%edx
1452: 84 d2 test %dl,%dl
1454: 0f 84 8e 00 00 00 je 14e8 <printf+0xe8>
if(state == 0){
145a: 85 ff test %edi,%edi
c = fmt[i] & 0xff;
145c: 0f be c2 movsbl %dl,%eax
if(state == 0){
145f: 74 c7 je 1428 <printf+0x28>
}
} else if(state == '%'){
1461: 83 ff 25 cmp $0x25,%edi
1464: 75 e5 jne 144b <printf+0x4b>
if(c == 'd'){
1466: 83 fa 64 cmp $0x64,%edx
1469: 0f 84 31 01 00 00 je 15a0 <printf+0x1a0>
printint(fd, *ap, 10, 1);
ap++;
} else if(c == 'x' || c == 'p'){
146f: 25 f7 00 00 00 and $0xf7,%eax
1474: 83 f8 70 cmp $0x70,%eax
1477: 0f 84 83 00 00 00 je 1500 <printf+0x100>
printint(fd, *ap, 16, 0);
ap++;
} else if(c == 's'){
147d: 83 fa 73 cmp $0x73,%edx
1480: 0f 84 a2 00 00 00 je 1528 <printf+0x128>
s = "(null)";
while(*s != 0){
putc(fd, *s);
s++;
}
} else if(c == 'c'){
1486: 83 fa 63 cmp $0x63,%edx
1489: 0f 84 35 01 00 00 je 15c4 <printf+0x1c4>
putc(fd, *ap);
ap++;
} else if(c == '%'){
148f: 83 fa 25 cmp $0x25,%edx
1492: 0f 84 e0 00 00 00 je 1578 <printf+0x178>
write(fd, &c, 1);
1498: 8d 45 e6 lea -0x1a(%ebp),%eax
149b: 83 c3 01 add $0x1,%ebx
149e: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
14a5: 00
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
14a6: 31 ff xor %edi,%edi
write(fd, &c, 1);
14a8: 89 44 24 04 mov %eax,0x4(%esp)
14ac: 89 34 24 mov %esi,(%esp)
14af: 89 55 d0 mov %edx,-0x30(%ebp)
14b2: c6 45 e6 25 movb $0x25,-0x1a(%ebp)
14b6: e8 07 fe ff ff call 12c2 <write>
putc(fd, c);
14bb: 8b 55 d0 mov -0x30(%ebp),%edx
write(fd, &c, 1);
14be: 8d 45 e7 lea -0x19(%ebp),%eax
14c1: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
14c8: 00
14c9: 89 44 24 04 mov %eax,0x4(%esp)
14cd: 89 34 24 mov %esi,(%esp)
putc(fd, c);
14d0: 88 55 e7 mov %dl,-0x19(%ebp)
write(fd, &c, 1);
14d3: e8 ea fd ff ff call 12c2 <write>
for(i = 0; fmt[i]; i++){
14d8: 0f b6 53 ff movzbl -0x1(%ebx),%edx
14dc: 84 d2 test %dl,%dl
14de: 0f 85 76 ff ff ff jne 145a <printf+0x5a>
14e4: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
}
}
}
14e8: 83 c4 3c add $0x3c,%esp
14eb: 5b pop %ebx
14ec: 5e pop %esi
14ed: 5f pop %edi
14ee: 5d pop %ebp
14ef: c3 ret
state = '%';
14f0: bf 25 00 00 00 mov $0x25,%edi
14f5: e9 51 ff ff ff jmp 144b <printf+0x4b>
14fa: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 16, 0);
1500: 8b 45 d4 mov -0x2c(%ebp),%eax
1503: b9 10 00 00 00 mov $0x10,%ecx
state = 0;
1508: 31 ff xor %edi,%edi
printint(fd, *ap, 16, 0);
150a: c7 04 24 00 00 00 00 movl $0x0,(%esp)
1511: 8b 10 mov (%eax),%edx
1513: 89 f0 mov %esi,%eax
1515: e8 46 fe ff ff call 1360 <printint>
ap++;
151a: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
151e: e9 28 ff ff ff jmp 144b <printf+0x4b>
1523: 90 nop
1524: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
s = (char*)*ap;
1528: 8b 45 d4 mov -0x2c(%ebp),%eax
ap++;
152b: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
s = (char*)*ap;
152f: 8b 38 mov (%eax),%edi
s = "(null)";
1531: b8 ce 17 00 00 mov $0x17ce,%eax
1536: 85 ff test %edi,%edi
1538: 0f 44 f8 cmove %eax,%edi
while(*s != 0){
153b: 0f b6 07 movzbl (%edi),%eax
153e: 84 c0 test %al,%al
1540: 74 2a je 156c <printf+0x16c>
1542: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
1548: 88 45 e3 mov %al,-0x1d(%ebp)
write(fd, &c, 1);
154b: 8d 45 e3 lea -0x1d(%ebp),%eax
s++;
154e: 83 c7 01 add $0x1,%edi
write(fd, &c, 1);
1551: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
1558: 00
1559: 89 44 24 04 mov %eax,0x4(%esp)
155d: 89 34 24 mov %esi,(%esp)
1560: e8 5d fd ff ff call 12c2 <write>
while(*s != 0){
1565: 0f b6 07 movzbl (%edi),%eax
1568: 84 c0 test %al,%al
156a: 75 dc jne 1548 <printf+0x148>
state = 0;
156c: 31 ff xor %edi,%edi
156e: e9 d8 fe ff ff jmp 144b <printf+0x4b>
1573: 90 nop
1574: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
write(fd, &c, 1);
1578: 8d 45 e5 lea -0x1b(%ebp),%eax
state = 0;
157b: 31 ff xor %edi,%edi
write(fd, &c, 1);
157d: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
1584: 00
1585: 89 44 24 04 mov %eax,0x4(%esp)
1589: 89 34 24 mov %esi,(%esp)
158c: c6 45 e5 25 movb $0x25,-0x1b(%ebp)
1590: e8 2d fd ff ff call 12c2 <write>
1595: e9 b1 fe ff ff jmp 144b <printf+0x4b>
159a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
printint(fd, *ap, 10, 1);
15a0: 8b 45 d4 mov -0x2c(%ebp),%eax
15a3: b9 0a 00 00 00 mov $0xa,%ecx
state = 0;
15a8: 66 31 ff xor %di,%di
printint(fd, *ap, 10, 1);
15ab: c7 04 24 01 00 00 00 movl $0x1,(%esp)
15b2: 8b 10 mov (%eax),%edx
15b4: 89 f0 mov %esi,%eax
15b6: e8 a5 fd ff ff call 1360 <printint>
ap++;
15bb: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
15bf: e9 87 fe ff ff jmp 144b <printf+0x4b>
putc(fd, *ap);
15c4: 8b 45 d4 mov -0x2c(%ebp),%eax
state = 0;
15c7: 31 ff xor %edi,%edi
putc(fd, *ap);
15c9: 8b 00 mov (%eax),%eax
write(fd, &c, 1);
15cb: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
15d2: 00
15d3: 89 34 24 mov %esi,(%esp)
putc(fd, *ap);
15d6: 88 45 e4 mov %al,-0x1c(%ebp)
write(fd, &c, 1);
15d9: 8d 45 e4 lea -0x1c(%ebp),%eax
15dc: 89 44 24 04 mov %eax,0x4(%esp)
15e0: e8 dd fc ff ff call 12c2 <write>
ap++;
15e5: 83 45 d4 04 addl $0x4,-0x2c(%ebp)
15e9: e9 5d fe ff ff jmp 144b <printf+0x4b>
15ee: 66 90 xchg %ax,%ax
000015f0 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
15f0: 55 push %ebp
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
15f1: a1 94 1a 00 00 mov 0x1a94,%eax
{
15f6: 89 e5 mov %esp,%ebp
15f8: 57 push %edi
15f9: 56 push %esi
15fa: 53 push %ebx
15fb: 8b 5d 08 mov 0x8(%ebp),%ebx
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
15fe: 8b 08 mov (%eax),%ecx
bp = (Header*)ap - 1;
1600: 8d 53 f8 lea -0x8(%ebx),%edx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
1603: 39 d0 cmp %edx,%eax
1605: 72 11 jb 1618 <free+0x28>
1607: 90 nop
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
1608: 39 c8 cmp %ecx,%eax
160a: 72 04 jb 1610 <free+0x20>
160c: 39 ca cmp %ecx,%edx
160e: 72 10 jb 1620 <free+0x30>
1610: 89 c8 mov %ecx,%eax
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
1612: 39 d0 cmp %edx,%eax
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
1614: 8b 08 mov (%eax),%ecx
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
1616: 73 f0 jae 1608 <free+0x18>
1618: 39 ca cmp %ecx,%edx
161a: 72 04 jb 1620 <free+0x30>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
161c: 39 c8 cmp %ecx,%eax
161e: 72 f0 jb 1610 <free+0x20>
break;
if(bp + bp->s.size == p->s.ptr){
1620: 8b 73 fc mov -0x4(%ebx),%esi
1623: 8d 3c f2 lea (%edx,%esi,8),%edi
1626: 39 cf cmp %ecx,%edi
1628: 74 1e je 1648 <free+0x58>
bp->s.size += p->s.ptr->s.size;
bp->s.ptr = p->s.ptr->s.ptr;
} else
bp->s.ptr = p->s.ptr;
162a: 89 4b f8 mov %ecx,-0x8(%ebx)
if(p + p->s.size == bp){
162d: 8b 48 04 mov 0x4(%eax),%ecx
1630: 8d 34 c8 lea (%eax,%ecx,8),%esi
1633: 39 f2 cmp %esi,%edx
1635: 74 28 je 165f <free+0x6f>
p->s.size += bp->s.size;
p->s.ptr = bp->s.ptr;
} else
p->s.ptr = bp;
1637: 89 10 mov %edx,(%eax)
freep = p;
1639: a3 94 1a 00 00 mov %eax,0x1a94
}
163e: 5b pop %ebx
163f: 5e pop %esi
1640: 5f pop %edi
1641: 5d pop %ebp
1642: c3 ret
1643: 90 nop
1644: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
bp->s.size += p->s.ptr->s.size;
1648: 03 71 04 add 0x4(%ecx),%esi
164b: 89 73 fc mov %esi,-0x4(%ebx)
bp->s.ptr = p->s.ptr->s.ptr;
164e: 8b 08 mov (%eax),%ecx
1650: 8b 09 mov (%ecx),%ecx
1652: 89 4b f8 mov %ecx,-0x8(%ebx)
if(p + p->s.size == bp){
1655: 8b 48 04 mov 0x4(%eax),%ecx
1658: 8d 34 c8 lea (%eax,%ecx,8),%esi
165b: 39 f2 cmp %esi,%edx
165d: 75 d8 jne 1637 <free+0x47>
p->s.size += bp->s.size;
165f: 03 4b fc add -0x4(%ebx),%ecx
freep = p;
1662: a3 94 1a 00 00 mov %eax,0x1a94
p->s.size += bp->s.size;
1667: 89 48 04 mov %ecx,0x4(%eax)
p->s.ptr = bp->s.ptr;
166a: 8b 53 f8 mov -0x8(%ebx),%edx
166d: 89 10 mov %edx,(%eax)
}
166f: 5b pop %ebx
1670: 5e pop %esi
1671: 5f pop %edi
1672: 5d pop %ebp
1673: c3 ret
1674: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
167a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi
00001680 <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
1680: 55 push %ebp
1681: 89 e5 mov %esp,%ebp
1683: 57 push %edi
1684: 56 push %esi
1685: 53 push %ebx
1686: 83 ec 1c sub $0x1c,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
1689: 8b 45 08 mov 0x8(%ebp),%eax
if((prevp = freep) == 0){
168c: 8b 1d 94 1a 00 00 mov 0x1a94,%ebx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
1692: 8d 48 07 lea 0x7(%eax),%ecx
1695: c1 e9 03 shr $0x3,%ecx
if((prevp = freep) == 0){
1698: 85 db test %ebx,%ebx
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
169a: 8d 71 01 lea 0x1(%ecx),%esi
if((prevp = freep) == 0){
169d: 0f 84 9b 00 00 00 je 173e <malloc+0xbe>
16a3: 8b 13 mov (%ebx),%edx
16a5: 8b 7a 04 mov 0x4(%edx),%edi
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
if(p->s.size >= nunits){
16a8: 39 fe cmp %edi,%esi
16aa: 76 64 jbe 1710 <malloc+0x90>
16ac: 8d 04 f5 00 00 00 00 lea 0x0(,%esi,8),%eax
if(nu < 4096)
16b3: bb 00 80 00 00 mov $0x8000,%ebx
16b8: 89 45 e4 mov %eax,-0x1c(%ebp)
16bb: eb 0e jmp 16cb <malloc+0x4b>
16bd: 8d 76 00 lea 0x0(%esi),%esi
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
16c0: 8b 02 mov (%edx),%eax
if(p->s.size >= nunits){
16c2: 8b 78 04 mov 0x4(%eax),%edi
16c5: 39 fe cmp %edi,%esi
16c7: 76 4f jbe 1718 <malloc+0x98>
16c9: 89 c2 mov %eax,%edx
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
16cb: 3b 15 94 1a 00 00 cmp 0x1a94,%edx
16d1: 75 ed jne 16c0 <malloc+0x40>
if(nu < 4096)
16d3: 8b 45 e4 mov -0x1c(%ebp),%eax
16d6: 81 fe 00 10 00 00 cmp $0x1000,%esi
16dc: bf 00 10 00 00 mov $0x1000,%edi
16e1: 0f 43 fe cmovae %esi,%edi
16e4: 0f 42 c3 cmovb %ebx,%eax
p = sbrk(nu * sizeof(Header));
16e7: 89 04 24 mov %eax,(%esp)
16ea: e8 3b fc ff ff call 132a <sbrk>
if(p == (char*)-1)
16ef: 83 f8 ff cmp $0xffffffff,%eax
16f2: 74 18 je 170c <malloc+0x8c>
hp->s.size = nu;
16f4: 89 78 04 mov %edi,0x4(%eax)
free((void*)(hp + 1));
16f7: 83 c0 08 add $0x8,%eax
16fa: 89 04 24 mov %eax,(%esp)
16fd: e8 ee fe ff ff call 15f0 <free>
return freep;
1702: 8b 15 94 1a 00 00 mov 0x1a94,%edx
if((p = morecore(nunits)) == 0)
1708: 85 d2 test %edx,%edx
170a: 75 b4 jne 16c0 <malloc+0x40>
return 0;
170c: 31 c0 xor %eax,%eax
170e: eb 20 jmp 1730 <malloc+0xb0>
if(p->s.size >= nunits){
1710: 89 d0 mov %edx,%eax
1712: 89 da mov %ebx,%edx
1714: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
if(p->s.size == nunits)
1718: 39 fe cmp %edi,%esi
171a: 74 1c je 1738 <malloc+0xb8>
p->s.size -= nunits;
171c: 29 f7 sub %esi,%edi
171e: 89 78 04 mov %edi,0x4(%eax)
p += p->s.size;
1721: 8d 04 f8 lea (%eax,%edi,8),%eax
p->s.size = nunits;
1724: 89 70 04 mov %esi,0x4(%eax)
freep = prevp;
1727: 89 15 94 1a 00 00 mov %edx,0x1a94
return (void*)(p + 1);
172d: 83 c0 08 add $0x8,%eax
}
}
1730: 83 c4 1c add $0x1c,%esp
1733: 5b pop %ebx
1734: 5e pop %esi
1735: 5f pop %edi
1736: 5d pop %ebp
1737: c3 ret
prevp->s.ptr = p->s.ptr;
1738: 8b 08 mov (%eax),%ecx
173a: 89 0a mov %ecx,(%edx)
173c: eb e9 jmp 1727 <malloc+0xa7>
base.s.ptr = freep = prevp = &base;
173e: c7 05 94 1a 00 00 98 movl $0x1a98,0x1a94
1745: 1a 00 00
base.s.size = 0;
1748: ba 98 1a 00 00 mov $0x1a98,%edx
base.s.ptr = freep = prevp = &base;
174d: c7 05 98 1a 00 00 98 movl $0x1a98,0x1a98
1754: 1a 00 00
base.s.size = 0;
1757: c7 05 9c 1a 00 00 00 movl $0x0,0x1a9c
175e: 00 00 00
1761: e9 46 ff ff ff jmp 16ac <malloc+0x2c>
1766: 66 90 xchg %ax,%ax
1768: 66 90 xchg %ax,%ax
176a: 66 90 xchg %ax,%ax
176c: 66 90 xchg %ax,%ax
176e: 66 90 xchg %ax,%ax
00001770 <uacquire>:
#include "uspinlock.h"
#include "x86.h"
void
uacquire(struct uspinlock *lk)
{
1770: 55 push %ebp
xchg(volatile uint *addr, uint newval)
{
uint result;
// The + in "+m" denotes a read-modify-write operand.
asm volatile("lock; xchgl %0, %1" :
1771: b9 01 00 00 00 mov $0x1,%ecx
1776: 89 e5 mov %esp,%ebp
1778: 8b 55 08 mov 0x8(%ebp),%edx
177b: 90 nop
177c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi
1780: 89 c8 mov %ecx,%eax
1782: f0 87 02 lock xchg %eax,(%edx)
// The xchg is atomic.
while(xchg(&lk->locked, 1) != 0)
1785: 85 c0 test %eax,%eax
1787: 75 f7 jne 1780 <uacquire+0x10>
;
// Tell the C compiler and the processor to not move loads or stores
// past this point, to ensure that the critical section's memory
// references happen after the lock is acquired.
__sync_synchronize();
1789: 0f ae f0 mfence
}
178c: 5d pop %ebp
178d: c3 ret
178e: 66 90 xchg %ax,%ax
00001790 <urelease>:
void urelease (struct uspinlock *lk) {
1790: 55 push %ebp
1791: 89 e5 mov %esp,%ebp
1793: 8b 45 08 mov 0x8(%ebp),%eax
__sync_synchronize();
1796: 0f ae f0 mfence
// Release the lock, equivalent to lk->locked = 0.
// This code can't use a C assignment, since it might
// not be atomic. A real OS would use C atomics here.
asm volatile("movl $0, %0" : "+m" (lk->locked) : );
1799: c7 00 00 00 00 00 movl $0x0,(%eax)
}
179f: 5d pop %ebp
17a0: c3 ret
| 35.74859 | 70 | 0.412249 |
7617d50bbe4249e9639ca9524f9ee49709ce15e5 | 24,664 | asm | Assembly | engine/save.asm | ISSOtm/Aevilia-GB | 9b4e233bac6fbf175ca9ae7e4c0a8f16c8222275 | [
"Apache-2.0"
] | 53 | 2017-08-25T01:27:33.000Z | 2021-08-30T19:55:57.000Z | engine/save.asm | ISSOtm/Aevilia-GB | 9b4e233bac6fbf175ca9ae7e4c0a8f16c8222275 | [
"Apache-2.0"
] | 6 | 2017-08-24T19:40:33.000Z | 2018-05-14T19:37:34.000Z | engine/save.asm | ISSOtm/Aevilia-GB | 9b4e233bac6fbf175ca9ae7e4c0a8f16c8222275 | [
"Apache-2.0"
] | 10 | 2017-08-24T18:37:35.000Z | 2019-10-02T04:35:39.000Z |
HIGHLIGHT_LENGTH equ 14
SECTION "File select", ROMX,ALIGN[4]
FileSelectHeights::
db $7C, $7C, $7D, $7E, $7F, $80, $81, $82
db $82, $82, $82, $81, $80, $7F, $7E, $7D
FileSelectHighlight::
ld b, 3
.highlightLoop
ld c, HIGHLIGHT_LENGTH
call FillVRAMLite
ld de, VRAM_ROW_SIZE - HIGHLIGHT_LENGTH
add hl, de
dec b
jr nz, .highlightLoop
ret
FileSelectOptionStrings::
dstr "MANAGE FILES"
dstr "COPY FILE..."
dstr "ERASE FILE..."
FileSelectOptionsReset::
ld hl, wTextboxTileMap
ld c, SCREEN_WIDTH * 6
xor a
rst fill
inc a
ld hl, wTransferRows
ld c, 6
rst fill
ld [rVBK], a
xor a
ld hl, vTextboxTileMap
ld c, VRAM_ROW_SIZE * 6
call FillVRAMLite
ld [rVBK], a
jr FileSelectOptions.reset
FileSelectOptions::
ld c, LOW(hWY)
ld a, LY_VBLANK - 2
ld [c], a
inc c
ld a, 7
ld [c], a
inc c
; ld a, 1
ld [c], a
ld a, 1
ld [rVBK], a
ld hl, vTileMap1
ld c, VRAM_ROW_SIZE
ld a, $40
call FillVRAMLite
ld c, VRAM_ROW_SIZE
xor a
call FillVRAMLite
ld c, 14
ld a, $42
call FillVRAMLite
ld a, 1
ld bc, $186
call FillVRAM
xor a
ld [rVBK], a
ld hl, $9C00
ld c, VRAM_ROW_SIZE
ld a, "_"
call FillVRAMLite
xor a
ld c, VRAM_ROW_SIZE + 1
call FillVRAMLite
ld c, 13
ld a, "_"
call FillVRAMLite
xor a
ld bc, VRAM_ROW_SIZE * 12 - 14
call FillVRAM
.reset
ld hl, FileSelectOptionStrings
ld de, $9C21
call CopyStrToVRAM
ld e, $84
call CopyStrToVRAM
ld e, $C4
call CopyStrToVRAM
ld c, LOW(hWY)
ld hl, rLCDC
.riseOptions
rst waitVBlank
ld a, [c]
ld b, a
.waitWindowLY
ld a, [rLY]
cp b
jr nz, .waitWindowLY
res 1, [hl]
ld a, b
sub 4
ld [c], a
cp $1E + 1
jr nc, .riseOptions
ld a, $1E
ld [c], a
ld hl, CursorTile
ld de, $8010
ld bc, VRAM_TILE_SIZE
ld a, BANK(CursorTile)
call CopyAcrossToVRAM
ld hl, wVirtualOAM
ld a, $50
ld [hli], a
ld a, $48
ld [hli], a
ld a, 1
ld [hli], a
ld [hl], a
ld [wNumOfSprites], a
ld [wTransferSprites], a
ld a, $40
ld [wYPos], a
ld [wXPos], a
; Clear the area under the window
xor a
ld hl, $98C0
ld bc, 14 * VRAM_ROW_SIZE
call FillVRAM
; Returns with a = 0 !
inc a ; ld a, 1
ld [rVBK], a
ld hl, $98C0
ld bc, 14 * VRAM_ROW_SIZE
call FillVRAM
xor a
ld [rVBK], a
ld bc, 10
call DelayBCFrames
.mainloop
rst waitVBlank
ldh a, [hPressedButtons]
ld b, a
and $06
jp nz, FileSelectOptionsEnd
ldh a, [hHeldButtons]
and $F0
jr z, .dontMove
; Use keys to move sprite on-screen
rlca
jr nc, .notDown
rlca
ld c, a
ld a, [wYPos]
cp $8F
jr z, .noVertMovement
inc a
ld [wYPos], a
jr .noVertMovement
.notDown
rlca
jr nc, .noVertMovement + 1
ld c, a
ld a, [wYPos]
and a
jr z, .noVertMovement
dec a
ld [wYPos], a
.noVertMovement
ld a, c
rlca
jr nc, .noLeft
ld a, [wXPos]
and a
jr z, .noHorizMovement
dec a
ld [wXPos], a
jr .noHorizMovement
.noLeft
rlca
jr nc, .noHorizMovement
ld a, [wXPos]
cp $9F
jr z, .noHorizMovement
inc a
ld [wXPos], a
.noHorizMovement
ld hl, wVirtualOAM
ld a, [wYPos]
add a, $10
ld [hli], a
ld a, [wXPos]
add a, 8
ld [hl], a
ld a, 1
ld [wTransferSprites], a
.dontMove
bit 0, b
jr z, .mainloop
; Perform A button action depending on position
ld a, [wYPos]
cp $3B
jr c, .mainloop
cp $58
jr nc, .mainloop
ld b, a
; This may be either "Copy file" or "Erase file"
ld a, [wXPos]
cp $1C
jr c, .mainloop
cp $85
jr nc, .mainloop
; This is either "Copy" or "Erase"
; Perform common operations
xor a
ld [wXPos + 1], a
ld [wNumOfSprites], a
dec a ; ld a, $FF
ld [wTransferSprites], a
ld de, $9922
ld [de], a
inc de
ld hl, FileIDsStr
call CopyStrToVRAM
ld de, $9901
; Determine which one has been selected
ld a, b
cp $4B
jp c, FileSelectOptions_Copy
FileSelectOptions_Erase:
ld hl, EraseWhichFileStr
call CopyStrToVRAM
ld c, LOW(hWY)
.moveWindowDown
rst waitVBlank
ld a, [c]
inc a
inc a
ld [c], a
cp $60
jr nz, .moveWindowDown
ld hl, $9922
.mainloop
rst waitVBlank
ldh a, [hPressedButtons]
bit 1, a ; B
jr nz, .done
ld c, a ; Save keys
.waitVRAM1
rst isVRAMOpen
jr nz, .waitVRAM1
ld [hl], 0
bit 5, c
jr nz, .left
bit 4, c
jr z, .dontmove
; Go right
ld a, l
add a, 3
cp $22 + 9
jr nz, .moved
ld a, $22
jr .moved
.left
ld a, l
cp $22
jr nz, .noleftwrap
ld a, $22 + 9
.noleftwrap
sub a, 3
.moved
ld l, a
.dontmove
.waitVRAM2
rst isVRAMOpen
jr nz, .waitVRAM2
ld [hl], $7F
ld a, c
and $0D
jr z, .mainloop
push hl
ld c, BANK(ConfirmDeletionText)
ld de, ConfirmDeletionText
callacross ProcessText_Hook
ld hl, wTextFlags
bit 4, [hl] ; Will be set if the first option has been selected
pop hl
jr nz, .done
; So, it's time to erase the file, huh.
ld a, l
sub $22
jr z, .gotDaID
; 03 or 06
dec a ; 02 or 05
rrca ; 01 or 02!
.gotDaID
add a, LOW(sNonVoidSaveFiles)
ld l, a
ld h, HIGH(sNonVoidSaveFiles)
ld a, SRAM_UNLOCK
ld [SRAMEnable], a
ld a, BANK(sNonVoidSaveFiles)
ld [SRAMBank], a
xor a
ld [hl], a ; Mark save file as empty
; xor a
ld [SRAMBank], a
ld [SRAMEnable], a
.done
jp FileSelectOptions.reset
FileSelectOptions_Copy:
jp FileSelectOptions
ld hl, CopyWhichFileStr
call CopyStrToVRAM
ld c, LOW(hWY)
.moveWindowDown
rst waitVBlank
ld a, [c]
inc a
inc a
ld [c], a
cp $60
jr nz, .moveWindowDown
ld hl, $9922
.mainloop
rst waitVBlank
ldh a, [hPressedButtons]
bit 1, a ; B
jr nz, .done
ld c, a ; Save keys
.waitVRAM1
rst isVRAMOpen
jr nz, .waitVRAM1
ld [hl], 0
bit 5, c
jr nz, .left
bit 4, c
jr z, .dontmove
; Go right
ld a, l
add a, 3
cp $22 + 9
jr nz, .moved
ld a, $22
jr .moved
.left
ld a, l
cp $22
jr nz, .noleftwrap
ld a, $22 + 9
.noleftwrap
sub a, 3
.moved
ld l, a
.dontmove
.waitVRAM2
rst isVRAMOpen
jr nz, .waitVRAM2
ld [hl], $7F
ld a, c
and $0D
jr z, .mainloop
push hl
ld c, BANK(ConfirmCopyText)
ld de, ConfirmCopyText
xor a
ldh [hEnableWindow], a
callacross ProcessText_Hook
ld hl, wTextFlags
bit 4, [hl] ; Will be set if the first option has been selected
pop hl
jr nz, .done
; So, it's time to erase the file, huh.
ld a, l
sub $22
jr z, .gotDaID
; 03 or 06
dec a ; 02 or 05
rrca ; 01 or 02!
.gotDaID
add a, LOW(sNonVoidSaveFiles)
ld l, a
ld h, HIGH(sNonVoidSaveFiles)
ld a, SRAM_UNLOCK
ld [SRAMEnable], a
ld a, BANK(sNonVoidSaveFiles)
ld [SRAMBank], a
xor a
ld [hl], a ; Mark save file as empty
ld [SRAMBank], a
ld [SRAMEnable], a
.done
jp FileSelectOptions
FileSelectOptionsEnd:
DrawFileSelect::
; Clean up
ld c, $81
callacross LoadFont
ld c, 0
callacross LoadFont
ld a, 1
ld [rVBK], a
ld hl, vAttrMap0
ld bc, VRAM_ROW_SIZE * (SCREEN_HEIGHT + 5)
call FillVRAM
xor a
ld [rVBK], a
ld hl, v0Tiles2
ld c, VRAM_TILE_SIZE
call FillVRAMLite
; xor a
ld [wNumOfSprites], a
inc a
ld [wTransferSprites], a
call ClearMovableMap
; Do last to avoid displaying anything
ld c, 0
ld de, GrayPalette
callacross LoadBGPalette_Hook
ld c, 1
ld de, DefaultPalette
callacross LoadBGPalette_Hook
xor a
ld [wSaveA], a ; Reset Konami cheat
ld a, $10
ldh [hSCY], a
ld de, InvertedPalette + 3
ld c, 0
callacross LoadOBJPalette_Hook ; Load the palette for the sprites
; Print the "save file" texts
ld de, $9904
ldh a, [hSRAM32kCompat]
and a
jr z, .printSaveFiles
; SRAM32k has only one file
inc de
ld hl, SaveFileStr
call CopyStrToVRAM
jr .donePrinting
.printSaveFiles
ld bc, (3 << 8) | "1"
.printSaveFilesLoop
ld hl, SaveFileStr
call CopyStrToVRAM
.printIDWaitLoop
rst isVRAMOpen
jr nz, .printIDWaitLoop
ld a, c ; Write ID
ld [de], a
inc c
ld hl, $55 ; Offset from one ID to the next start (3 lines - 11 chars)
add hl, de
ld d, h
ld e, l
dec b
jr nz, .printSaveFilesLoop
.donePrinting
; Copy tile used for corners
ld hl, SaveFileCornerTile
ld de, vFileSelectCornerTile
ld bc, 16
call CopyToVRAM
; Copy sprites to virtual OAM
; hl is correctly positioned
ld de, wVirtualOAM
ld c, 4 * (4 + 9)
rst copy
; Draw the console strings on-screen
ldh a, [hConsoleType]
add a, a
ld hl, ConsoleTypes
add a, l ; Assumed not to overflow (if needed move the pointer array around)
ld l, a
ld a, [hli]
ld h, [hl]
ld l, a
ld de, $9A24
call CopyStrToVRAM
ld de, $9A45
call CopyStrToVRAM
ld a, 1
ld [rVBK], a ; Load VRAM bank 1
; Highlight first save file
xor a
ld hl, $98E3
call FileSelectHighlight
; Make both console lines black instead of grey
ld hl, $9A24
ld a, 2
ld c, $30
call FillVRAMLite
ld c, a ; ld c, 2
ld de, DarkTextPalette
callacross LoadBGPalette_Hook
; Zero cursor position
xor a
ld [wYPos], a
ldh [hFrameCounter], a
; Transfer sprites
ld a, 4 + 9
ld [wNumOfSprites], a
; Wait until the options window is down, if it was displayed
ld c, LOW(hEnableWindow)
ld a, [c]
and a
jr z, .notOptions
dec c
dec c
ld hl, rLCDC
.removeWindow
rst waitVBlank
ld a, [c]
ld [wTransferSprites], a
ld b, a
.waitWindowLY
ld a, [rLY]
cp b
jr nz, .waitWindowLY
res 1, [hl]
ld a, b
add a, 4
ld [c], a
cp LY_VBLANK
jr c, .removeWindow
inc c
inc c
xor a
ld [c], a
.notOptions
ld a, 1
ld [wTransferSprites], a
ldh a, [hSRAM32kCompat]
and a
jr z, SelectFile ; Don't display the text if this isn't SRAM32k
; Display the message only at first boot
ld a, BANK(sSRAM32kMessageDisplayed)
ld [SRAMBank], a
ld a, SRAM_UNLOCK
ld [SRAMEnable], a
ld hl, sSRAM32kMessageDisplayed
ld a, [hl]
and a
ld [hl], 1
ld a, 0
ld [SRAMEnable], a
ld [SRAMBank], a
jr nz, SelectFile
ldh a, [hHeldButtons] ; Skip the message if Select and B are held
cp DPAD_UP | BUTTON_B | BUTTON_A
jr z, SelectFile
ld c, BANK(CompatExplanationText)
ld de, CompatExplanationText
callacross ProcessText_Hook
SelectFile:
; Move console up and down
ldh a, [hFrameCounter]
rrca
rrca
rrca
and $0F
ld hl, FileSelectHeights
add a, l
ld l, a
ld a, [hl]
ld hl, wVirtualOAM + 4 * 4
ld b, 3
.moveSpritesLoop
ld c, 3
.moveColumnLoop
ld [hli], a
inc hl
inc hl
inc hl
add a, 8
dec c
jr nz, .moveColumnLoop
sub $18
dec b
jr nz, .moveSpritesLoop
ld a, 1
ld [wTransferSprites], a ; Schedule transfer
rst waitVBlank
ldh a, [hPressedButtons]
ld b, a
; In SRAM32k mode, only thing you're allowed to do is load the file.
ldh a, [hSRAM32kCompat]
and a
ld a, b
jr z, .notCompat
and $0D ; Only allow A, SELECT and START
; This prevents moving, acessing options, and outright performing the Konami Code (only the last input can be performed...)
.notCompat
and a
jr z, SelectFile ; Skip everything if no button is pressed
and $04 ; Filter SELECT button
jp nz, FileSelectOptions
ld a, [wSaveA]
ld d, KonamiCheatKeys >> 8
ld e, a
ld a, [de] ; Get expected button
cp b
ld a, 0 ; Reset cheat if incorrect button
jr nz, .noCheat
ld a, e
inc a
.noCheat
ld [wSaveA], a
ld a, b ; Restore keys
and $C0 ; Filter next keys
jr z, .noScreenUpdate
push af
; Clear currently highlighted file
ld hl, $98E3
ld a, [wYPos]
ld b, a
add a, a
add a, b ; *3
swap a ; *16
add a, a
jr nc, .noCarry1
inc h
.noCarry1
add a, l
ld l, a
jr nc, .noCarry2
inc h
.noCarry2
ld a, 1
call FileSelectHighlight
pop bc
.moveAgain
ld a, b
rlca
ld a, [wYPos]
jr nc, .moveUp
inc a
inc a
.moveUp
dec a
and 3
ld [wYPos], a
cp 3
jr z, .moveAgain
.moved
; Highlight new file
ld hl, $98E3
ld b, a
add a, a
add a, b ; *3
ld b, a
swap a ; *16
add a, a
jr nc, .noCarry3
inc h
.noCarry3
add a, l
ld l, a
jr nc, .noCarry4
inc h
.noCarry4
ld a, b
add a, a
add a, a
add a, a
add a, $38
ld [wVirtualOAM], a
ld [wVirtualOAM + 4], a
add a, 16
ld [wVirtualOAM + 8], a
ld [wVirtualOAM + 12], a
ld a, 1
ld [wTransferSprites], a
rst waitVBlank
xor a
call FileSelectHighlight
; Play a little SFX (also served as a test)
push bc
ld c,SFX_TEXT_SELECT
callacross FXHammer_Trig
pop bc
.noScreenUpdate
ld a, b
and $09
jp z, SelectFile ; Too far
FileSelected:
xor a
ld [wNumOfSprites], a
inc a
ld [wTransferSprites], a
; A file has been selected!
rst waitVBlank
ld a, 1
ld [rVBK], a
ld hl, $98E3
ld c, $AE
call FillVRAMLite
ld l, $A3
ld c, $AE
call FillVRAMLite
xor a
ld [rVBK], a
ld hl, $9865
ld c, 10
call FillVRAMLite
; a = 0
ld hl, $9A24
ld c, $30
call FillVRAMLite
ld hl, $9904
ld a, [wSaveA]
cp 10
jr z, .konamiCheatOn ; Put an absurd number instead
ld a, [wYPos]
.konamiCheatOn
ld e, a
inc e
ld b, 3
.clearFilesLoop
dec e
jr z, .skipThisFile
xor a
ld c, 12
call FillVRAMLite
.skipThisFile
ld a, l
and $E0
add a, $64
ld l, a
jr nc, .noCarry
inc h
.noCarry
dec b
jr nz, .clearFilesLoop
ld a, [wSaveA] ; Check Konami cheat progression
cp 10
jr nz, .notKonamiCode
ld hl, DLCName
ld de, $9866
call CopyStrToVRAM
ld hl, DLCUnavailableText
ret
.notKonamiCode
xor a
ld [wSaveA], a ; Clear Konami cheat
; Scroll text in the right place
; Don't ask how it works. I made it a bit... randomly.
REPT 3
inc e
ENDR
ld b, (8 * 3) * 2 + 1
xor a
ldh [hFrameCounter], a
.scrollLoop
rst waitVBlank
dec b
jr z, .loadFile
ldh a, [hFrameCounter]
and 3
sub e
jr nc, .scrollLoop
ldh a, [hSCY]
inc a
inc a
ldh [hSCY], a
jr .scrollLoop
.loadFile
ld a, BANK(sNonVoidSaveFiles)
ld [SRAMBank], a
ld a, SRAM_UNLOCK
ld [SRAMEnable], a
ld hl, sNonVoidSaveFiles - 1
ld a, l
add a, e ; Get file's voidness ptr in array
ld l, a
ld a, [hl] ; Get voidness
and a ; Check if void
ld a, e ; Get back file ID
ld [wSaveFileID], a ; Store it
ld hl, EmptyFileText
ret z ; It's void
ldh a, [hSRAM32kCompat]
and a
jr z, .notSRAM32k
ld a, 2
jr .gotBank
.notSRAM32k
ld a, e
add a, a ; Still equals file ID
add a, a
.gotBank
call VerifyChecksums
jr nz, .fileValid
ld a, 1 ; Let the loader know the file is corrupted
ld [wSaveA], a
ldh a, [hSRAM32kCompat]
and a
ld hl, CorruptedFileText
ret z
ld hl, CompatFileCorruptedText ; SRAM32k doesn't have backups, thus uses a different text
ret
.fileValid
ld hl, ConfirmLoadText
ret
; Call with a = 1st bank of save file
; Returns a = 0 if file invalid (also Z set)
; Otherwise file is valid
VerifyChecksums::
ld c, a ; Save that bank
ld [SRAMBank], a ; Set SRAM bank
; Calculate save file #e's validity
ld hl, sFile1MagicString0
ld de, MagicString
.compareMagicStrings
ld a, [de]
and a ; If we reached the end of the magic string
jr z, .checkVersion
inc de
cp [hl]
jr nz, .endTests
inc hl
jr .compareMagicStrings
.checkVersion
ld a, [ROMVersion]
cp [hl]
jr nz, .endTests
ld a, c ; Get back bank
.calcOneBankSums
ld [SRAMBank], a
push af
ld hl, sFile1Data0Start
ld de, sFile1Checksums0
.nextBlock
ld bc, 0
.checksumOneBlock
ld a, [hl]
add a, b
rrca ; Add in a little bit of asymmetry...
ld b, a
ld a, [hli]
xor c
rlca
ld c, a
ld a, l
and $3F
jr nz, .checksumOneBlock
ld a, [de]
cp b
jr nz, .popAndEndTests
inc de
ld a, [de]
cp c
jr nz, .popAndEndTests
inc de
ld a, e
and a
jr nz, .nextBlock
pop af
inc a
bit 1, a
jr nz, .calcOneBankSums
and a ; Should be non-zero
ret
.popAndEndTests
pop af
.endTests
xor a
ret
SaveFileCornerTile::
dw $F0F0, $C0C0, $8080, $8080, $0000, $0000, $0000, $0000
; These two must follow each other!
SaveFileSprites::
dspr 40, 24 , 1, $00
dspr 40, 128, 1, $20
dspr 56, 24 , 1, $40
dspr 56, 128, 1, $60
dspr $70, 2, 2, 1
dspr $78, 2, 3, 1
dspr $80, 2, 4, 1
dspr $70, 10, 5, 1
dspr $78, 10, 6, 1
dspr $80, 10, 7, 1
dspr $70, 18, 8, 1
dspr $78, 18, 9, 1
dspr $80, 18, 10, 1
ConsoleTypes::
dw .crap
dw .vc
dw .decent
dw .awesome
dw .gbc
dw .gba
.crap
dstr "EMULATOR:"
dstr "CRAP"
.vc
dstr "CONSOLE:"
dstr "3DS"
.decent
dstr "EMULATOR:"
dstr "DECENT"
.awesome
dstr "EMULATOR:"
dstr "AWESOME"
.gbc
dstr "CONSOLE:"
dstr "GBC"
.gba
dstr "CONSOLE:"
dstr "GBA"
; DO NOT CHANGE THE LENGTH OF THIS STRING
; Also make sure it matches `DefaultSaveMagicString0/1`
MagicString::
dstr "Aevilia"
SaveFileStr::
dstr "Save file "
EraseWhichFileStr::
dstr "ERASE WHICH FILE?"
CopyWhichFileStr::
dstr "COPY WHICH FILE?"
FileIDsStr::
dstr "1 2 3"
DLCName::
dstr "DLC MENU"
SECTION "File select text", ROMX
set_text_prefix CompatExplanationText
CompatExplanationText::
print_name TechCrewName
print_line_id 0
print_line_id 1
print_line_id 2
wait_user
print_line_id 3
print_line_id 4
print_line_id 5
wait_user
clear_box
print_line_id 6
print_line_id 7
delay 30
print_line_id 8
wait_user
clear_box
print_line_id 9
wait_user
print_line_id 10
print_line_id 11
delay 120
print_line_id 12
wait_user
clear_box
print_line_id 13
print_line_id 14
print_line_id 15
wait_user
print_line_id 16
print_line_id 17
print_line_id 18
wait_user
clear_box
print_line_id 19
delay 60
print_line_id 20
print_line_id 21
delay 120
wait_user
clear_box
print_line_id 22
print_line_id 23
wait_user
print_line_id 24
print_line_id 25
wait_user
print_line_id 26
print_line_id 27
wait_user
clear_box
print_line_id 28
print_line_id 29
print_line_id 30
wait_user
clear_box
print_line_id 31
print_line_id 32
wait_user
done
set_text_prefix CompatFileCorruptedText
CompatFileCorruptedText::
text_lda_imm SRAM_UNLOCK
text_sta SRAMEnable
text_lda_imm BANK(sNonVoidSaveFiles)
text_sta SRAMBank
text_lda_imm 0
text_sta sNonVoidSaveFiles
text_sta SRAMEnable
text_sta SRAMBank
print_name TechCrewName
print_line_id 0
print_line_id 1
wait_user
print_line_id 2
print_line_id 3
print_line_id 4
wait_user
clear_box
print_line_id 5
print_line_id 6
wait_user
print_line_id 7
wait_user
done
set_text_prefix ConfirmDeletionText
ConfirmDeletionText::
print_pic GameTiles
print_name GameName
print_line_id 0
print_line_id 1
wait_user
clear_box
print_line_id 2
print_line_id 3
fake_choice NoDeleteChoiceText
done
set_text_prefix ConfirmCopyText
ConfirmCopyText::
print_pic GameTiles
print_name GameName
text_lda_imm 0
text_sta hEnableWindow
print_line_id 0
print_line_id 1
wait_user
clear_box
print_line_id 2
print_line_id 3
fake_choice NoCopyChoiceText
done
set_text_prefix ConfirmLoadText
ConfirmLoadText::
print_pic GameTiles
print_name GameName
print_line_id 0
print_line_id 1
fake_b_choice YesNoCapsChoice
done
set_text_prefix CorruptedFileText
CorruptedFileText::
print_pic GameTiles
print_name GameName
print_line_id 0
print_line_id 1
wait_user
clear_box
print_line_id 2
print_line_id 3
wait_user
print_line_id 4
print_line_id 5
wait_user
clear_box
print_line_id 6
empty_line
fake_b_choice YesNoCapsChoice
done
set_text_prefix BackupCorruptedText
BackupCorruptedText::
print_pic GameTiles
print_name GameName
print_line_id 0
print_line_id 1
print_line_id 2
wait_user
clear_box
print_line_id 3
print_line_id 4
print_line_id 5
wait_user
clear_box
print_line_id 6
print_line_id 7
wait_user
print_line_id 8
wait_user
done
set_text_prefix EmptyFileText
EmptyFileText::
print_pic GameTiles
print_name GameName
print_line_id 0
print_line_id 1
print_line_id 2
wait_user
print_line_id 3
print_line_id 4
empty_line
fake_b_choice YesNoCapsChoice
done
set_text_prefix DLCUnavailableText
DLCUnavailableText::
print_pic GameTiles
print_name GameName
print_line_id 0
print_line_id 1
print_line_id 2
wait_user
clear_box
print_line_id 3
wait_user
done
SECTION "Save file management", ROMX
LoadFile::
ld bc, SaveBlocks
ld a, SRAM_UNLOCK
ld [SRAMEnable], a
ldh a, [hSRAM32kCompat]
and a
jr nz, .compatMode
ld a, [wSaveFileID]
add a, a
add a, a
db $11
.compatMode
ld a, 2
.copyOneBank
push af
ld [SRAMBank], a
ld hl, sFile1Data0Start
.copyLoop
ld a, [bc]
inc bc
ld e, a
ld a, [bc]
inc bc
and a
jr z, .doneCopying
ld d, a
bit 4, a
jr z, .toWRAM0
and $E0
jr z, .toHRAM
rlca
rlca
rlca
call SwitchRAMBanks
.toWRAM0
ld a, d
and $1F
or $C0
ld d, a
.highByteDone
ld a, [bc]
inc bc
push bc
ld c, a
rst copy ; Copy block
pop bc
jr .copyLoop
.toHRAM
ld d, $FF
jr .highByteDone
.doneCopying
pop af
inc a
bit 0, a ; See next function
jr nz, .copyOneBank
ret
SaveFile::
ld a, SRAM_UNLOCK
ld [SRAMEnable], a
ldh a, [hSRAM32kCompat]
and a
jr nz, .compatMode
ld a, [wSaveFileID]
add a, a
add a, a
db $11
.compatMode
ld a, 2
ld [SRAMBank], a
ld hl, sFile1MagicString0
ld [hl], 0 ; Make file invalid to prevent making bad saves 'cause of resets
ld bc, SaveBlocks
.copyOneBank
push af
ld [SRAMBank], a
ld de, sFile1Data0Start
.copyLoop
ld a, [bc]
inc bc
ld l, a
ld a, [bc]
inc bc
and a
jr z, .doneCopying
ld h, a
bit 4, a
jr z, .fromWRAM0
and $E0
jr z, .fromHRAM
rlca
rlca
rlca
call SwitchRAMBanks
.fromWRAM0
ld a, h
and $1F
or $C0
ld h, a
.highByteDone
ld a, [bc]
inc bc
push bc
ld c, a
rst copy ; Copy block
pop bc
jr .copyLoop
.fromHRAM
ld h, $FF
jr .highByteDone
.doneCopying
pop af
inc a
bit 0, a ; We start at the even bank, so only re-loop if we have to process the odd bank
jr nz, .copyOneBank
dec a ; That pointed to the bank following the odd one, we need one less
CalculateFileChecksums:
; Calculate header checksums
; Call with a = bank right after both "main" banks
.calcOneBankSums
push af
ld [SRAMBank], a
ld hl, sFile1Data0Start
ld de, sFile1Checksums0
.nextBlock
ld bc, 0
.checksumOneBlock
ld a, [hl]
add a, b
rrca
ld b, a
ld a, [hli]
xor c
rlca
ld c, a
ld a, l
and $3F
jr nz, .checksumOneBlock
ld a, b
ld [de], a
inc de
ld a, c
ld [de], a
inc de
ld a, e
and a
jr nz, .nextBlock
pop af
dec a
bit 0, a ; We started with the odd bank, re-loop for the even bank
jr z, .calcOneBankSums
; Finally, make file (potentially) valid by re-writing the string in the even bank
; This is done last, so no cheating is possible... :)
ld b, BANK(DefaultSaveMagicString0)
ld hl, DefaultSaveMagicString0
ld de, sFile1MagicString0
call CopyStrAcross
xor a
ld [SRAMEnable], a
ld [SRAMBank], a
ret
CalculateFileChecksums_Hook::
ldh a, [hSRAM32kCompat]
and a
jr z, .notCompatMode
ld a, 3 ; The second used bank
jr .compatMode
.notCompatMode
ld a, [wSaveFileID]
add a, a
add a, a
inc a
.compatMode
call CalculateFileChecksums
ld a, SRAM_UNLOCK
ld [SRAMEnable], a
ret
wram0_block: MACRO
dw (\1 & $1FFF) | $8000
db \2
ENDM
wramx_block: MACRO
dw (\1 & $1FFF) | (BANK(\1) << 13)
db \2
ENDM
hram_block: MACRO
dw $1000 | LOW(\1)
db \2
ENDM
flags_block: MACRO
dw (wFlags & $1FFF + 256 * \1) | (BANK(wFlags) << 13)
db 0 ; 256 bytes
ENDM
SaveBlocks::
; Bank 0
wram0_block wTargetWarpID, 2
wram0_block wYPos, (wCameraXPos + 2 - wYPos)
hram_block hOverworldButtonFilter, 1
hram_block hRandInt, 2
wramx_block wWalkingInteractions, 0
wramx_block wWalkingLoadZones, 0
wramx_block wButtonInteractions, 0
wramx_block wButtonLoadZones, 0
wramx_block wWalkInterCount, 7
wramx_block wNPCArray, $90
wramx_block wEmoteGfxID, 3
wram0_block wAnimationSlots, 8 * 8
wram0_block wAnimationStacks, 8 * 8
wram0_block wActiveAnimations, 9 + 8 + 8 ; Also wAnimationTargetNPCs and wTextAnimationSlots
wramx_block wExtendedOAM, $A0 + 3
hram_block hOAMMode, 1
wramx_block wAnimationGfxHooks, 8 * 8
enum_start
REPT $10
flags_block enum_value
enum_skip
ENDR
dw 0 ; Terminate
; Bank 1
dw 0 ; Terminate
| 16.541918 | 125 | 0.649408 |
8a6ae1ca1d025e62754ec0060ddee37345859339 | 274 | asm | Assembly | data/mapHeaders/silphcoelevator.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 16 | 2018-08-28T21:47:01.000Z | 2022-02-20T20:29:59.000Z | data/mapHeaders/silphcoelevator.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 5 | 2019-04-03T19:53:11.000Z | 2022-03-11T22:49:34.000Z | data/mapHeaders/silphcoelevator.asm | adhi-thirumala/EvoYellow | 6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c | [
"Unlicense"
] | 2 | 2019-12-09T19:46:02.000Z | 2020-12-05T21:36:30.000Z | SilphCoElevator_h:
db LOBBY ; tileset
db SILPH_CO_ELEVATOR_HEIGHT, SILPH_CO_ELEVATOR_WIDTH ; dimensions (y, x)
dw SilphCoElevatorBlocks, SilphCoElevatorTextPointers, SilphCoElevatorScript ; blocks, texts, scripts
db $00 ; connections
dw SilphCoElevatorObject ; objects
| 39.142857 | 102 | 0.824818 |
01fd8bfda8493b757a835b825af09b25305a13ef | 1,103 | asm | Assembly | programs/oeis/200/A200905.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/200/A200905.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/200/A200905.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A200905: 3*phi(n), where phi (A000010) is the Euler totient function.
; 3,3,6,6,12,6,18,12,18,12,30,12,36,18,24,24,48,18,54,24,36,30,66,24,60,36,54,36,84,24,90,48,60,48,72,36,108,54,72,48,120,36,126,60,72,66,138,48,126,60,96,72,156,54,120,72,108,84,174,48,180,90,108,96,144,60,198,96,132,72,210,72,216,108,120,108,180,72,234,96,162,120,246,72,192,126,168,120,264,72,216,132,180,138,216,96,288,126,180,120,300,96,306,144,144,156,318,108,324,120,216,144,336,108,264,168,216,174,288,96,330,180,240,180,300,108,378,192,252,144,390,120,324,198,216,192,408,132,414,144,276,210,360,144,336,216,252,216,444,120,450,216,288,180,360,144,468,234,312,192,396,162,486,240,240,246,498,144,468,192,324,252,516,168,360,240,348,264,534,144,540,216,360,264,432,180,480,276,324,216,570,192,576,288,288,252,588,180,594,240,396,300,504,192,480,306,396,288,540,144,630,312,420,318,504,216,540,324,432,240,576,216,666,288,360,336,678,216,684,264,360,336,696,216,552,348,468,288,714,192,720,330,486,360,504,240,648,360,492,300
cal $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
mov $1,$0
mul $1,3
| 157.571429 | 932 | 0.722575 |
b6efc894e5d92a7ef09c8fccf06090489f3b41d2 | 519 | asm | Assembly | oeis/111/A111175.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/111/A111175.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/111/A111175.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A111175: Numbers n such that 30*n + 1 is prime.
; Submitted by Jon Maiga
; 1,2,5,6,7,8,9,11,14,18,19,20,21,22,23,25,27,33,34,35,39,40,41,43,44,46,49,51,54,58,60,61,62,65,67,71,72,74,75,76,77,78,79,84,85,89,91,93,95,99,100,102,104,106,109,110,111,112,113,117,118,119,121,123,131,134,135
mov $2,$0
pow $2,2
lpb $2
add $1,30
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
lpe
mov $0,$1
div $0,30
add $0,1
| 24.714286 | 212 | 0.628131 |
71c977462117841fd2152c580dc42e65cd4d8c2a | 6,151 | asm | Assembly | 5/5.asm | Ukasz09/Assembly | 95f78281aee33e64e9ef241820a92e03c8b0266f | [
"MIT"
] | null | null | null | 5/5.asm | Ukasz09/Assembly | 95f78281aee33e64e9ef241820a92e03c8b0266f | [
"MIT"
] | null | null | null | 5/5.asm | Ukasz09/Assembly | 95f78281aee33e64e9ef241820a92e03c8b0266f | [
"MIT"
] | null | null | null | .data
howManyNumbersMsg: .asciiz "Podaj ilosc liczb: "
inputNumberMsg: .asciiz "Podaj liczbe: "
menuMsg: .asciiz "\nWybierz z menu: \n1 => Dodawanie, \n2 => Odejmowanie \n3 => Mnozenie: \n4 => Dzielenie \n5 => NWD \n\nDecyzja: "
resultMsg: .asciiz "Wynik: "
wrongDecisionMsg: .asciiz "\nWybrano niewlasciwa liczbe!"
tooLittleArgMsg: .asciiz "Podano niewlasciwa liczbe parametrow"
closeDecisionMsg: .asciiz "\nCzy chcesz zakonczyc program (0-nie): "
divByZeroMsg: .asciiz "Nie mozna dzielic przez 0"
zero: .double 0.0
.text
.macro print(%comunicate)
li $v0, 4
la $a0, %comunicate
syscall
.end_macro
_main:
li $s1, 1
li $s2, 2
li $s3, 3
li $s4, 4
li $s5, 5
print(menuMsg) #s0 - wybor z menu
jal _readInt
move $s0, $v0
bgt $s0, $s5, _wrongDecision
blt $s0, $s1, _wrongDecision
beq $s0, $s5, _NWDprocess
inputNumbers:
print(howManyNumbersMsg)
jal _readInt
move $s6, $v0 #s6 - ilosc liczb
checkIsMoreThanOne:
blt $s6, 2, _invalidParameter
j _doOperation
################################################################################
_doOperation:
li $t2,1 #iterator
ldc1 $f12, zero
print(inputNumberMsg)
jal _readDouble
add.d $f12, $f12, $f0
operationWhile:
print(inputNumberMsg)
jal _readDouble
jal doOperation
add $t2, $t2,1
blt $t2,$s6,operationWhile
print(resultMsg)
jal _showFloatResult
j _closeProgramDecision
doOperation:
beq $s0, $s1, addition
beq $s0, $s2, subtract
beq $s0, $s3, multiplication
beq $s0, $s4, divide
addition:
add.d $f12, $f12, $f0
jr $ra
subtract:
sub.d $f12, $f12, $f0
jr $ra
multiplication:
mul.d $f12, $f12, $f0
jr $ra
divide:
ldc1 $f2, zero
c.eq.d $f2, $f0
bc1t _divByZero
div.d $f12, $f12, $f0
jr $ra
_NWDprocess:
print(inputNumberMsg)
jal _readInt
move $t1, $v0 # $t1 - a
print(inputNumberMsg)
jal _readInt
move $t2, $v0 # $t2 - b
nwdLoop:
bgt $t1, $t2, decA
decB:
sub $t2, $t2, $t1
bne $t1, $t2, nwdLoop
j nwdResult
decA:
sub $t1, $t1, $t2
bne $t1, $t2, nwdLoop
j nwdResult
nwdResult:
print(resultMsg)
move $a0, $t1
jal _showIntResult
j _closeProgramDecision
################################################################33
_wrongDecision:
print(wrongDecisionMsg)
j _closeProgramDecision
_invalidParameter:
print(tooLittleArgMsg)
j _closeProgramDecision
_divByZero:
print(divByZeroMsg)
j _closeProgramDecision
# $f0
_readDouble:
li $v0, 7
syscall
jr $ra
# $v0
_readInt:
li $v0, 5
syscall
jr $ra
# $f12
_showFloatResult:
li $v0, 3
syscall
jr $ra
_showIntResult:
li $v0, 1
syscall
jr $ra
_closeProgramDecision:
print(closeDecisionMsg)
jal _readInt
beq $v0, 0, _main
j _endProcess
_endProcess:
li $v0, 10
syscall
###############################################################################
.kdata
arithmeticOverflowMsg: .asciiz "==== Arithmetic Overflow ===="
unhandledExceptionMsg: .asciiz "==== Unhandled Exception ===="
syscallExceptionMsg: .asciiz "==== Syscall Exception ====="
floatingPointExceptionMsg:.asciiz "==== FloatingPoint Exception ====="
.ktext 0x80000180
.macro print(%comunicate)
li $v0, 4
la $a0, %comunicate
syscall
.end_macro
mfc0 $k0, $13
andi $k1, $k0, 0x00007c
srl $k1, $k1, 2
beq $k1, 12, _arithmeticOverflow
beq $k1, 8, _syscallException
beq $k1, 14, _floatingPointException
_unhandledException:
print(unhandledExceptionMsg)
j _endProcessKDATA
_arithmeticOverflow:
print(arithmeticOverflowMsg)
j _endProcessKDATA
_syscallException:
print(syscallExceptionMsg)
j _endProcessKDATA
_floatingPointException:
print(floatingPointExceptionMsg)
j _endProcessKDATA
_endProcessKDATA:
li $v0, 10
syscall
| 30.450495 | 1,832 | 0.393269 |
abb8e690b4815ea891bde5efaf99d808e7d4ec19 | 137 | asm | Assembly | src/main/fragment/mos6502-common/vdum1=vdum2_plus_pduc1_derefidx_vbuyy.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vdum1=vdum2_plus_pduc1_derefidx_vbuyy.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vdum1=vdum2_plus_pduc1_derefidx_vbuyy.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | clc
lda {m2}
adc {c1},y
sta {m1}
lda {m2}+1
adc {c1}+1,y
sta {m1}+1
lda {m2}+2
adc {c1}+2,y
sta {m1}+2
lda {m2}+3
adc {c1}+3,y
sta {m1}+3 | 10.538462 | 12 | 0.554745 |
db4e702b0bbbe813f2c4c3ed391d6ed94645a8b7 | 477 | asm | Assembly | oeis/093/A093560.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/093/A093560.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/093/A093560.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A093560: (3,1) Pascal triangle.
; Submitted by Christian Krause
; 1,3,1,3,4,1,3,7,5,1,3,10,12,6,1,3,13,22,18,7,1,3,16,35,40,25,8,1,3,19,51,75,65,33,9,1,3,22,70,126,140,98,42,10,1,3,25,92,196,266,238,140,52,11,1,3,28,117,288,462,504,378,192,63,12,1,3,31,145,405,750,966,882,570,255,75,13,1,3,34,176,550,1155,1716,1848,1452,825,330,88,14,1,3,37,210,726,1705,2871,3564,3300,2277
lpb $0
add $2,$1
add $1,1
sub $0,$1
bin $2,$0
lpe
bin $1,$0
add $1,$2
add $2,$1
mov $0,$2
| 31.8 | 311 | 0.641509 |
ce4d9ea01b309d01da218b77d4cb67d8d0fe3e56 | 1,098 | asm | Assembly | programs/oeis/061/A061008.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/061/A061008.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/061/A061008.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A061008: a(n) = Sum_{j=1..n} (-(n-1)! mod n).
; 0,1,2,4,5,5,6,6,6,6,7,7,8,8,8,8,9,9,10,10,10,10,11,11,11,11,11,11,12,12,13,13,13,13,13,13,14,14,14,14,15,15,16,16,16,16,17,17,17,17,17,17,18,18,18,18,18,18,19,19,20,20,20,20,20,20,21,21,21,21,22,22,23,23,23,23,23,23,24,24,24,24,25,25,25,25,25,25,26,26,26,26,26,26,26,26,27,27,27,27,28,28,29,29,29,29,30,30,31,31,31,31,32,32,32,32,32,32,32,32,32,32,32,32,32,32,33,33,33,33,34,34,34,34,34,34,35,35,36,36,36,36,36,36,36,36,36,36,37,37,38,38,38,38,38,38,39,39,39,39,39,39,40,40,40,40,41,41,41,41,41,41,42,42,42,42,42,42,43,43,44,44,44,44,44,44,44,44,44,44,45,45,46,46,46,46,47,47,48,48,48,48,48,48,48,48,48,48,48,48,49,49,49,49,49,49,49,49,49,49,49,49,50,50,50,50,51,51,52,52,52,52,53,53,53,53,53,53,54,54,55,55,55,55,55,55,55,55,55,55
mov $2,$0
mov $5,$0
lpb $2
mov $0,$5
sub $2,1
sub $0,$2
sub $0,1
add $3,2
bin $3,$0
mov $4,$0
add $0,1
cmp $6,0
add $4,$6
mod $3,$4
add $3,1
cal $0,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
mul $3,2
add $0,$3
cmp $3,0
mov $4,$0
sub $4,2
add $1,$4
lpe
| 40.666667 | 733 | 0.606557 |
28b101f3d8259b3df2f20ea1fe544b0e468f00b5 | 351 | asm | Assembly | programs/oeis/061/A061462.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/061/A061462.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/061/A061462.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A061462: The exact power of 2 that divides the n-th Bell number (A000110). Has period 12.
; 1,1,2,1,1,4,1,1,4,1,1,2,1,1,2,1,1,4,1,1,4,1,1,2,1,1,2,1,1,4,1,1,4,1,1,2,1,1,2,1,1,4,1,1,4,1,1,2,1,1,2,1,1,4,1,1,4,1,1,2,1,1,2,1,1,4,1,1,4,1,1,2,1,1,2,1,1,4,1,1,4,1,1,2,1,1,2,1,1,4,1,1,4,1,1,2,1,1,2,1
mov $2,$0
pow $0,2
sub $0,$2
add $0,4
div $0,3
gcd $0,4
| 35.1 | 201 | 0.564103 |
61dfdd4f71ba404dfef08a57c67758703f0e3f78 | 4,020 | asm | Assembly | thirdparty/ffmpeg/libavcodec/x86/jpeg2000dsp.asm | yashrajsingh1998/ApraPipes1 | ec93095613f4345d6044c7012f2d8c3b99f65f03 | [
"MIT"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | thirdparty/ffmpeg/libavcodec/x86/jpeg2000dsp.asm | yashrajsingh1998/ApraPipes1 | ec93095613f4345d6044c7012f2d8c3b99f65f03 | [
"MIT"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | thirdparty/ffmpeg/libavcodec/x86/jpeg2000dsp.asm | yashrajsingh1998/ApraPipes1 | ec93095613f4345d6044c7012f2d8c3b99f65f03 | [
"MIT"
] | 353 | 2017-05-08T01:33:31.000Z | 2022-03-12T05:57:16.000Z | ;******************************************************************************
;* SIMD-optimized JPEG2000 DSP functions
;* Copyright (c) 2014 Nicolas Bertrand
;* Copyright (c) 2015 James Almer
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86util.asm"
SECTION_RODATA 32
pf_ict0: times 8 dd 1.402
pf_ict1: times 8 dd 0.34413
pf_ict2: times 8 dd 0.71414
pf_ict3: times 8 dd 1.772
SECTION .text
;***********************************************************************
; ff_ict_float_<opt>(float *src0, float *src1, float *src2, int csize)
;***********************************************************************
%macro ICT_FLOAT 1
cglobal ict_float, 4, 4, %1, src0, src1, src2, csize
shl csized, 2
add src0q, csizeq
add src1q, csizeq
add src2q, csizeq
neg csizeq
movaps m6, [pf_ict0]
movaps m7, [pf_ict1]
%define ICT0 m6
%define ICT1 m7
%if ARCH_X86_64
movaps m8, [pf_ict2]
%define ICT2 m8
%if cpuflag(avx)
movaps m3, [pf_ict3]
%define ICT3 m3
%else
movaps m9, [pf_ict3]
%define ICT3 m9
%endif
%else ; ARCH_X86_32
%define ICT2 [pf_ict2]
%if cpuflag(avx)
movaps m3, [pf_ict3]
%define ICT3 m3
%else
%define ICT3 [pf_ict3]
%endif
%endif ; ARCH
align 16
.loop:
movaps m0, [src0q+csizeq]
movaps m1, [src1q+csizeq]
movaps m2, [src2q+csizeq]
%if cpuflag(fma4) || cpuflag(fma3)
%if cpuflag(fma4)
fnmaddps m5, m1, ICT1, m0
fmaddps m4, m2, ICT0, m0
%else ; fma3
movaps m5, m1
movaps m4, m2
fnmaddps m5, m5, ICT1, m0
fmaddps m4, m4, ICT0, m0
%endif
fmaddps m0, m1, ICT3, m0
fnmaddps m5, m2, ICT2, m5
%else ; non FMA
%if cpuflag(avx)
mulps m5, m1, ICT1
mulps m4, m2, ICT0
mulps m1, m1, ICT3
mulps m2, m2, ICT2
subps m5, m0, m5
%else ; sse
movaps m3, m1
movaps m4, m2
movaps m5, m0
mulps m3, ICT1
mulps m4, ICT0
mulps m1, ICT3
mulps m2, ICT2
subps m5, m3
%endif
addps m4, m4, m0
addps m0, m0, m1
subps m5, m5, m2
%endif
movaps [src0q+csizeq], m4
movaps [src2q+csizeq], m0
movaps [src1q+csizeq], m5
add csizeq, mmsize
jl .loop
REP_RET
%endmacro
INIT_XMM sse
ICT_FLOAT 10
INIT_YMM avx
ICT_FLOAT 9
%if HAVE_FMA4_EXTERNAL
INIT_XMM fma4
ICT_FLOAT 9
%endif
INIT_YMM fma3
ICT_FLOAT 9
;***************************************************************************
; ff_rct_int_<opt>(int32_t *src0, int32_t *src1, int32_t *src2, int csize)
;***************************************************************************
%macro RCT_INT 0
cglobal rct_int, 4, 4, 4, src0, src1, src2, csize
shl csized, 2
add src0q, csizeq
add src1q, csizeq
add src2q, csizeq
neg csizeq
align 16
.loop:
mova m1, [src1q+csizeq]
mova m2, [src2q+csizeq]
mova m0, [src0q+csizeq]
paddd m3, m1, m2
psrad m3, 2
psubd m0, m3
paddd m1, m0
paddd m2, m0
mova [src1q+csizeq], m0
mova [src2q+csizeq], m1
mova [src0q+csizeq], m2
add csizeq, mmsize
jl .loop
REP_RET
%endmacro
INIT_XMM sse2
RCT_INT
%if HAVE_AVX2_EXTERNAL
INIT_YMM avx2
RCT_INT
%endif
| 24.363636 | 79 | 0.576119 |
fb0d4bfb4a6257829aacbb0d693520ba994a64c6 | 769 | asm | Assembly | programs/oeis/135/A135036.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/135/A135036.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/135/A135036.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A135036: Sums of the products of n consecutive pairs of numbers.
; 0,6,26,68,140,250,406,616,888,1230,1650,2156,2756,3458,4270,5200,6256,7446,8778,10260,11900,13706,15686,17848,20200,22750,25506,28476,31668,35090,38750,42656,46816,51238,55930,60900,66156,71706,77558,83720,90200,97006,104146,111628,119460,127650,136206,145136,154448,164150,174250,184756,195676,207018,218790,231000,243656,256766,270338,284380,298900,313906,329406,345408,361920,378950,396506,414596,433228,452410,472150,492456,513336,534798,556850,579500,602756,626626,651118,676240,702000,728406,755466,783188,811580,840650,870406,900856,932008,963870,996450,1029756,1063796,1098578,1134110,1170400,1207456,1245286,1283898,1323300
mov $1,$0
mul $1,4
add $1,5
bin $1,2
mul $0,$1
div $0,12
mul $0,2
| 69.909091 | 634 | 0.807542 |
c33cf99a3440c21e1865dafe3fc33649c82afbd1 | 378 | asm | Assembly | libsrc/target/fp1100/graphics/getmaxy.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/fp1100/graphics/getmaxy.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/fp1100/graphics/getmaxy.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | INCLUDE "graphics/grafix.inc"
MODULE fp1100_getmaxy
SECTION code_clib
PUBLIC getmaxy
PUBLIC _getmaxy
EXTERN __fp1100_mode
EXTERN __console_h
.getmaxy
._getmaxy
ld hl,199
ld a,(__fp1100_mode)
bit 1,a
ret z
ld a,(__console_h)
add a
dec a
ld l,a
ld h,0
ret | 18 | 30 | 0.537037 |
a14f198b1819fd979640067937f82c04cf647005 | 155 | asm | Assembly | libsrc/_DEVELOPMENT/z80/c/sdcc_ix/z80_inp_fastcall.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/z80/c/sdcc_ix/z80_inp_fastcall.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/z80/c/sdcc_ix/z80_inp_fastcall.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z |
; uint8_t z80_inp(uint16_t port)
SECTION code_clib
SECTION code_z80
PUBLIC _z80_inp_fastcall
EXTERN asm_z80_inp
defc _z80_inp_fastcall = asm_z80_inp
| 12.916667 | 37 | 0.832258 |
c7c69402cdf00d9ff0b8e95b9a99064951a5f7d9 | 470 | asm | Assembly | programs/oeis/233/A233273.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/233/A233273.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/233/A233273.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A233273: Bisection of A233272: a(n) = A233272(2n+1).
; 2,4,7,8,12,13,15,16,21,22,24,25,28,29,31,32,38,39,41,42,45,46,48,49,53,54,56,57,60,61,63,64,71,72,74,75,78,79,81,82,86,87,89,90,93,94,96,97,102,103,105,106,109,110,112,113,117,118,120,121,124,125,127,128,136,137,139,140,143,144,146,147,151,152,154,155,158,159,161,162,167,168,170,171,174,175,177,178,182,183,185,186,189,190,192,193,199,200,202,203
mov $1,2
lpb $0
add $1,$0
div $0,2
add $1,1
lpe
mov $0,$1
| 42.727273 | 349 | 0.674468 |
c710662eebff48feaaf694a6cdd535e291f5cc83 | 5,406 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_129_1581.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_129_1581.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_129_1581.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x5998, %r9
nop
nop
nop
nop
cmp $56708, %rdi
and $0xffffffffffffffc0, %r9
vmovaps (%r9), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %r14
nop
nop
nop
nop
cmp $29951, %r10
lea addresses_A_ht+0x198, %rsi
lea addresses_WT_ht+0x12688, %rdi
clflush (%rsi)
nop
nop
nop
dec %rax
mov $0, %rcx
rep movsb
nop
nop
nop
lfence
lea addresses_A_ht+0x13cb8, %rsi
lea addresses_WC_ht+0x15e6, %rdi
cmp %rax, %rax
mov $116, %rcx
rep movsq
nop
nop
nop
nop
nop
dec %r10
lea addresses_D_ht+0x5b58, %r14
xor %rdi, %rdi
mov $0x6162636465666768, %rsi
movq %rsi, %xmm5
vmovups %ymm5, (%r14)
nop
nop
nop
sub $52645, %r9
lea addresses_A_ht+0xd6cc, %rcx
nop
nop
add %rsi, %rsi
mov $0x6162636465666768, %r14
movq %r14, %xmm2
movups %xmm2, (%rcx)
nop
nop
nop
add $22535, %rcx
lea addresses_normal_ht+0x178f8, %rax
nop
nop
nop
nop
add $34344, %r10
movups (%rax), %xmm3
vpextrq $1, %xmm3, %rsi
nop
cmp $17088, %r9
lea addresses_A_ht+0xc198, %rax
add $32339, %rsi
mov (%rax), %r14
xor $58160, %r10
lea addresses_normal_ht+0x18a8, %r14
nop
nop
nop
lfence
mov (%r14), %eax
and $7225, %rsi
lea addresses_D_ht+0xfe60, %rcx
nop
nop
nop
xor $64383, %r14
movw $0x6162, (%rcx)
nop
nop
nop
nop
nop
xor %rcx, %rcx
lea addresses_UC_ht+0x3498, %rsi
lea addresses_A_ht+0x170f8, %rdi
nop
nop
nop
dec %r11
mov $55, %rcx
rep movsb
nop
and $736, %rcx
lea addresses_normal_ht+0x3d18, %r11
clflush (%r11)
nop
nop
sub $34323, %r10
movb $0x61, (%r11)
nop
nop
cmp %rdi, %rdi
lea addresses_normal_ht+0x1a1e4, %r11
cmp $16887, %rdi
movw $0x6162, (%r11)
nop
nop
nop
inc %rsi
lea addresses_D_ht+0x8114, %rsi
nop
nop
nop
nop
cmp $46999, %rcx
mov (%rsi), %r11w
sub $21730, %rdi
lea addresses_UC_ht+0x18598, %rsi
lea addresses_normal_ht+0x11618, %rdi
nop
and %r9, %r9
mov $55, %rcx
rep movsl
nop
nop
and %r11, %r11
lea addresses_WC_ht+0x1cd5c, %r14
nop
nop
nop
sub %rax, %rax
mov $0x6162636465666768, %rcx
movq %rcx, %xmm5
vmovups %ymm5, (%r14)
nop
nop
xor %r14, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r15
push %r8
push %rax
push %rbx
// Store
lea addresses_A+0x1c348, %r15
nop
nop
sub $40979, %rax
movb $0x51, (%r15)
nop
nop
nop
dec %rax
// Faulty Load
lea addresses_D+0x3998, %r11
nop
nop
nop
nop
nop
xor $30493, %r8
mov (%r11), %r15w
lea oracles, %r12
and $0xff, %r15
shlq $12, %r15
mov (%r12,%r15,1), %r15
pop %rbx
pop %rax
pop %r8
pop %r15
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': True, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 4, 'AVXalign': True, 'NT': False, 'congruent': 3, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'36': 129}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 22.90678 | 386 | 0.652608 |
3769409816b5ca2e53ccb3043dadc01e8d8a5b8c | 520 | asm | Assembly | programs/oeis/082/A082907.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/082/A082907.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/082/A082907.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A082907: A modified Pascal's triangle, read by rows, and modified as follows: binomial(n,j) is replaced by gcd(2^n, binomial(n,j)), i.e., the largest power of 2 dividing binomial(n,j).
; 1,1,1,1,2,1,1,1,1,1,1,4,2,4,1,1,1,2,2,1,1,1,2,1,4,1,2,1,1,1,1,1,1,1,1,1,1,8,4,8,2,8,4,8,1,1,1,4,4,2,2,4,4,1,1,1,2,1,8,2,4,2,8,1,2,1,1,1,1,1,2,2,2,2,1,1,1,1,1,4,2,4,1,8,4,8,1,4,2,4,1,1,1,2,2,1,1,4,4,1
seq $0,7318 ; Pascal's triangle read by rows: C(n,k) = binomial(n,k) = n!/(k!*(n-k)!), 0 <= k <= n.
mov $1,32
gcd $1,$0
mov $0,$1
| 65 | 201 | 0.586538 |
a5b7143357ff102cfcc322a3a02422f8f7eca7be | 537 | asm | Assembly | oeis/193/A193895.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/193/A193895.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/193/A193895.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A193895: Triangular array: the fusion of (p(n,x)) by (q(n,x)), where p(n,x)=sum{(k+1)*x^(n-k) : 0<=k<=n} and q(n,x)=sum{(k+1)*x^k : 0<=k<=n}.
; Submitted by Jamie Morken(w1)
; 1,2,1,6,6,3,12,15,12,6,20,28,27,20,10,30,45,48,42,30,15,42,66,75,72,60,42,21,56,91,108,110,100,81,56,28,72,120,147,156,150,132,105,72,36,90,153,192,210,210,195,168,132,90,45,110,190,243,272,280,270
lpb $0
add $1,1
sub $0,$1
add $2,1
lpe
add $1,2
sub $2,$0
add $0,1
sub $1,2
add $1,$2
mul $1,$0
mul $2,$1
sub $1,1
add $2,$1
mov $0,$2
div $0,2
add $0,1
| 24.409091 | 199 | 0.594041 |
0160789f53f926c38df8a16c684d149193de558c | 585 | asm | Assembly | oeis/082/A082067.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/082/A082067.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/082/A082067.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A082067: Smallest prime that divides n and phi(n)=A000010(n), or 1 if n and phi(n) are relatively prime.
; 1,1,1,2,1,2,1,2,3,2,1,2,1,2,1,2,1,2,1,2,3,2,1,2,5,2,3,2,1,2,1,2,1,2,1,2,1,2,3,2,1,2,1,2,3,2,1,2,7,2,1,2,1,2,5,2,3,2,1,2,1,2,3,2,1,2,1,2,1,2,1,2,1,2,5,2,1,2,1,2,3,2,1,2,1,2,1,2,1,2,1,2,3,2,1,2,1,2,3,2
mov $1,1
add $1,$0
seq $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
gcd $1,$0
mov $0,$1
lpb $0
sub $0,1
seq $0,20639 ; Lpf(n): least prime dividing n (when n > 1); a(1) = 1. Or, smallest prime factor of n, or smallest prime divisor of n.
lpe
| 45 | 201 | 0.605128 |
fbc06e9726d80e0f692f6073e65667eb6f95e9f7 | 20,641 | asm | Assembly | examples/test_function.asm | clayne/asm2cfg | 4d9089185ec8efb0bf82aa525762f5af84cc0c6d | [
"MIT"
] | 24 | 2021-02-08T17:27:40.000Z | 2022-03-29T11:29:03.000Z | examples/test_function.asm | clayne/asm2cfg | 4d9089185ec8efb0bf82aa525762f5af84cc0c6d | [
"MIT"
] | 23 | 2021-03-02T18:18:18.000Z | 2022-03-27T15:13:04.000Z | examples/test_function.asm | clayne/asm2cfg | 4d9089185ec8efb0bf82aa525762f5af84cc0c6d | [
"MIT"
] | 2 | 2021-11-14T11:14:43.000Z | 2022-01-27T21:54:30.000Z | Dump of assembler code for function test_function:
=> 0x00007ffff7fbf0e0 <+0>: push %rbp
0x00007ffff7fbf0e1 <+1>: push %r15
0x00007ffff7fbf0e3 <+3>: push %r14
0x00007ffff7fbf0e5 <+5>: push %r13
0x00007ffff7fbf0e7 <+7>: push %r12
0x00007ffff7fbf0e9 <+9>: push %rbx
0x00007ffff7fbf0ea <+10>: sub $0x18,%rsp
0x00007ffff7fbf0ee <+14>: movslq 0x1c(%rdi),%rdx
0x00007ffff7fbf0f2 <+18>: mov 0x58(%rdi),%rax
0x00007ffff7fbf0f6 <+22>: mov (%rsi),%rbp
0x00007ffff7fbf0f9 <+25>: imul %rax,%rbp
0x00007ffff7fbf0fd <+29>: add 0x28(%rdi),%rbp
0x00007ffff7fbf101 <+33>: movslq 0x18(%rdi),%rcx
0x00007ffff7fbf105 <+37>: add %rbp,%rax
0x00007ffff7fbf108 <+40>: cmp %rcx,%rax
0x00007ffff7fbf10b <+43>: mov %rcx,%rsi
0x00007ffff7fbf10e <+46>: cmovle %rax,%rsi
0x00007ffff7fbf112 <+50>: test %rcx,%rcx
0x00007ffff7fbf115 <+53>: cmovs %rax,%rsi
0x00007ffff7fbf119 <+57>: mov %rdx,%rax
0x00007ffff7fbf11c <+60>: mov %rax,-0x78(%rsp)
0x00007ffff7fbf121 <+65>: test %rdx,%rdx
0x00007ffff7fbf124 <+68>: jle 0x7ffff7fbf7c2 <test_function+1762>
0x00007ffff7fbf12a <+74>: sub %rbp,%rsi
0x00007ffff7fbf12d <+77>: mov %rsi,%rax
0x00007ffff7fbf130 <+80>: test %rsi,%rsi
0x00007ffff7fbf133 <+83>: jle 0x7ffff7fbf7c2 <test_function+1762>
0x00007ffff7fbf139 <+89>: mov %rbp,-0x70(%rsp)
0x00007ffff7fbf13e <+94>: mov (%rdi),%rcx
0x00007ffff7fbf141 <+97>: mov %rcx,-0x80(%rsp)
0x00007ffff7fbf146 <+102>: mov 0x8(%rdi),%rsi
0x00007ffff7fbf14a <+106>: mov 0x10(%rdi),%rdi
0x00007ffff7fbf14e <+110>: mov %rax,%rcx
0x00007ffff7fbf151 <+113>: sar $0x3,%rcx
0x00007ffff7fbf155 <+117>: mov %rax,%r12
0x00007ffff7fbf158 <+120>: and $0xfffffffffffffff8,%r12
0x00007ffff7fbf15c <+124>: sub %r12,%rax
0x00007ffff7fbf15f <+127>: mov %rax,-0x68(%rsp)
0x00007ffff7fbf164 <+132>: mov %rcx,-0x38(%rsp)
0x00007ffff7fbf169 <+137>: test %rcx,%rcx
0x00007ffff7fbf16c <+140>: je 0x7ffff7fbf660 <test_function+1408>
0x00007ffff7fbf172 <+146>: mov -0x78(%rsp),%r11
0x00007ffff7fbf177 <+151>: vmovd %r11d,%xmm0
0x00007ffff7fbf17c <+156>: vpbroadcastd %xmm0,%ymm0
0x00007ffff7fbf181 <+161>: lea -0x1(%r11),%rcx
0x00007ffff7fbf185 <+165>: mov %rcx,-0x48(%rsp)
0x00007ffff7fbf18a <+170>: mov %r11d,%ecx
0x00007ffff7fbf18d <+173>: and $0x7,%ecx
0x00007ffff7fbf190 <+176>: mov %rcx,-0x58(%rsp)
0x00007ffff7fbf195 <+181>: sub %rcx,%r11
0x00007ffff7fbf198 <+184>: mov -0x70(%rsp),%rdx
0x00007ffff7fbf19d <+189>: vmovd %edx,%xmm1
0x00007ffff7fbf1a1 <+193>: vpbroadcastd %xmm1,%ymm1
0x00007ffff7fbf1a6 <+198>: movabs $0x7ffff7fbe000,%rax
0x00007ffff7fbf1b0 <+208>: vpaddd (%rax),%ymm1,%ymm1
0x00007ffff7fbf1b4 <+212>: vpmulld %ymm1,%ymm0,%ymm0
0x00007ffff7fbf1b9 <+217>: vmovd %xmm0,%eax
0x00007ffff7fbf1bd <+221>: vpextrd $0x1,%xmm0,%ecx
0x00007ffff7fbf1c3 <+227>: sub %eax,%ecx
0x00007ffff7fbf1c5 <+229>: shl $0x3,%ecx
0x00007ffff7fbf1c8 <+232>: vmovd %ecx,%xmm1
0x00007ffff7fbf1cc <+236>: vpbroadcastd %xmm1,%ymm1
0x00007ffff7fbf1d1 <+241>: mov -0x80(%rsp),%rax
0x00007ffff7fbf1d6 <+246>: lea 0x1c(%rax),%rax
0x00007ffff7fbf1da <+250>: mov %rax,-0x60(%rsp)
0x00007ffff7fbf1df <+255>: xor %ecx,%ecx
0x00007ffff7fbf1e1 <+257>: mov %r12,-0x40(%rsp)
0x00007ffff7fbf1e6 <+262>: mov %r11,-0x50(%rsp)
0x00007ffff7fbf1eb <+267>: nopl 0x0(%rax,%rax,1)
0x00007ffff7fbf1f0 <+272>: vmovq %xmm0,%rax
0x00007ffff7fbf1f5 <+277>: movslq %eax,%r15
0x00007ffff7fbf1f8 <+280>: mov %rax,%r10
0x00007ffff7fbf1fb <+283>: sar $0x20,%r10
0x00007ffff7fbf1ff <+287>: vpextrq $0x1,%xmm0,%rax
0x00007ffff7fbf205 <+293>: movslq %eax,%r8
0x00007ffff7fbf208 <+296>: mov %rax,%r12
0x00007ffff7fbf20b <+299>: sar $0x20,%r12
0x00007ffff7fbf20f <+303>: vextracti128 $0x1,%ymm0,%xmm2
0x00007ffff7fbf215 <+309>: vmovq %xmm2,%rax
0x00007ffff7fbf21a <+314>: movslq %eax,%r9
0x00007ffff7fbf21d <+317>: mov %rax,%rbx
0x00007ffff7fbf220 <+320>: sar $0x20,%rbx
0x00007ffff7fbf224 <+324>: vpextrq $0x1,%xmm2,%rax
0x00007ffff7fbf22a <+330>: movslq %eax,%r14
0x00007ffff7fbf22d <+333>: sar $0x20,%rax
0x00007ffff7fbf231 <+337>: movslq %edx,%rbp
0x00007ffff7fbf234 <+340>: cmpq $0x7,-0x48(%rsp)
0x00007ffff7fbf23a <+346>: mov %rcx,0x10(%rsp)
0x00007ffff7fbf23f <+351>: mov %rdx,0x8(%rsp)
0x00007ffff7fbf244 <+356>: mov %r15,(%rsp)
0x00007ffff7fbf248 <+360>: mov %r10,-0x8(%rsp)
0x00007ffff7fbf24d <+365>: mov %r8,-0x10(%rsp)
0x00007ffff7fbf252 <+370>: mov %r12,-0x18(%rsp)
0x00007ffff7fbf257 <+375>: mov %r9,-0x20(%rsp)
0x00007ffff7fbf25c <+380>: mov %rbx,-0x28(%rsp)
0x00007ffff7fbf261 <+385>: mov %r14,-0x30(%rsp)
0x00007ffff7fbf266 <+390>: jae 0x7ffff7fbf270 <test_function+400>
0x00007ffff7fbf268 <+392>: xor %r12d,%r12d
0x00007ffff7fbf26b <+395>: jmp 0x7ffff7fbf55d <test_function+1149>
0x00007ffff7fbf270 <+400>: vmovups (%rdi,%rbp,4),%ymm2
0x00007ffff7fbf275 <+405>: mov %rbx,%rdx
0x00007ffff7fbf278 <+408>: mov -0x60(%rsp),%rbx
0x00007ffff7fbf27d <+413>: lea (%rbx,%rax,4),%r13
0x00007ffff7fbf281 <+417>: lea (%rbx,%r14,4),%r14
0x00007ffff7fbf285 <+421>: mov %r9,%rcx
0x00007ffff7fbf288 <+424>: lea (%rbx,%rdx,4),%r9
0x00007ffff7fbf28c <+428>: lea (%rbx,%rcx,4),%rdx
0x00007ffff7fbf290 <+432>: lea (%rbx,%r12,4),%rcx
0x00007ffff7fbf294 <+436>: lea (%rbx,%r8,4),%r8
0x00007ffff7fbf298 <+440>: lea (%rbx,%r10,4),%r10
0x00007ffff7fbf29c <+444>: lea (%rbx,%r15,4),%r15
0x00007ffff7fbf2a0 <+448>: xor %r12d,%r12d
0x00007ffff7fbf2a3 <+451>: data16 data16 data16 nopw %cs:0x0(%rax,%rax,1)
0x00007ffff7fbf2b0 <+464>: vmovss -0x1c(%rdx,%r12,4),%xmm3
0x00007ffff7fbf2b7 <+471>: vinsertps $0x10,-0x1c(%r9,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf2bf <+479>: vinsertps $0x20,-0x1c(%r14,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf2c7 <+487>: vinsertps $0x30,-0x1c(%r13,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf2cf <+495>: vmovss -0x1c(%r15,%r12,4),%xmm4
0x00007ffff7fbf2d6 <+502>: vinsertps $0x10,-0x1c(%r10,%r12,4),%xmm4,%xmm4
0x00007ffff7fbf2de <+510>: vinsertps $0x20,-0x1c(%r8,%r12,4),%xmm4,%xmm4
0x00007ffff7fbf2e6 <+518>: vinsertps $0x30,-0x1c(%rcx,%r12,4),%xmm4,%xmm4
0x00007ffff7fbf2ee <+526>: vinsertf128 $0x1,%xmm3,%ymm4,%ymm3
0x00007ffff7fbf2f4 <+532>: vbroadcastss (%rsi,%r12,4),%ymm4
0x00007ffff7fbf2fa <+538>: vfmadd213ps %ymm2,%ymm3,%ymm4
0x00007ffff7fbf2ff <+543>: vmovups %ymm4,(%rdi,%rbp,4)
0x00007ffff7fbf304 <+548>: vmovss -0x18(%rdx,%r12,4),%xmm2
0x00007ffff7fbf30b <+555>: vinsertps $0x10,-0x18(%r9,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf313 <+563>: vinsertps $0x20,-0x18(%r14,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf31b <+571>: vinsertps $0x30,-0x18(%r13,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf323 <+579>: vmovss -0x18(%r15,%r12,4),%xmm3
0x00007ffff7fbf32a <+586>: vinsertps $0x10,-0x18(%r10,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf332 <+594>: vinsertps $0x20,-0x18(%r8,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf33a <+602>: vinsertps $0x30,-0x18(%rcx,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf342 <+610>: vinsertf128 $0x1,%xmm2,%ymm3,%ymm2
0x00007ffff7fbf348 <+616>: vbroadcastss 0x4(%rsi,%r12,4),%ymm3
0x00007ffff7fbf34f <+623>: vfmadd213ps %ymm4,%ymm2,%ymm3
0x00007ffff7fbf354 <+628>: vmovups %ymm3,(%rdi,%rbp,4)
0x00007ffff7fbf359 <+633>: vmovss -0x14(%rdx,%r12,4),%xmm2
0x00007ffff7fbf360 <+640>: vinsertps $0x10,-0x14(%r9,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf368 <+648>: vinsertps $0x20,-0x14(%r14,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf370 <+656>: vinsertps $0x30,-0x14(%r13,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf378 <+664>: vmovss -0x14(%r15,%r12,4),%xmm4
0x00007ffff7fbf37f <+671>: vinsertps $0x10,-0x14(%r10,%r12,4),%xmm4,%xmm4
0x00007ffff7fbf387 <+679>: vinsertps $0x20,-0x14(%r8,%r12,4),%xmm4,%xmm4
0x00007ffff7fbf38f <+687>: vinsertps $0x30,-0x14(%rcx,%r12,4),%xmm4,%xmm4
0x00007ffff7fbf397 <+695>: vinsertf128 $0x1,%xmm2,%ymm4,%ymm2
0x00007ffff7fbf39d <+701>: vbroadcastss 0x8(%rsi,%r12,4),%ymm4
0x00007ffff7fbf3a4 <+708>: vfmadd213ps %ymm3,%ymm2,%ymm4
0x00007ffff7fbf3a9 <+713>: vmovups %ymm4,(%rdi,%rbp,4)
0x00007ffff7fbf3ae <+718>: vmovss -0x10(%rdx,%r12,4),%xmm2
0x00007ffff7fbf3b5 <+725>: vinsertps $0x10,-0x10(%r9,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf3bd <+733>: vinsertps $0x20,-0x10(%r14,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf3c5 <+741>: vinsertps $0x30,-0x10(%r13,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf3cd <+749>: vmovss -0x10(%r15,%r12,4),%xmm3
0x00007ffff7fbf3d4 <+756>: vinsertps $0x10,-0x10(%r10,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf3dc <+764>: vinsertps $0x20,-0x10(%r8,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf3e4 <+772>: vinsertps $0x30,-0x10(%rcx,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf3ec <+780>: vinsertf128 $0x1,%xmm2,%ymm3,%ymm2
0x00007ffff7fbf3f2 <+786>: vbroadcastss 0xc(%rsi,%r12,4),%ymm3
0x00007ffff7fbf3f9 <+793>: vfmadd213ps %ymm4,%ymm2,%ymm3
0x00007ffff7fbf3fe <+798>: vmovups %ymm3,(%rdi,%rbp,4)
0x00007ffff7fbf403 <+803>: vmovss -0xc(%rdx,%r12,4),%xmm2
0x00007ffff7fbf40a <+810>: vinsertps $0x10,-0xc(%r9,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf412 <+818>: vinsertps $0x20,-0xc(%r14,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf41a <+826>: vinsertps $0x30,-0xc(%r13,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf422 <+834>: vmovss -0xc(%r15,%r12,4),%xmm4
0x00007ffff7fbf429 <+841>: vinsertps $0x10,-0xc(%r10,%r12,4),%xmm4,%xmm4
0x00007ffff7fbf431 <+849>: vinsertps $0x20,-0xc(%r8,%r12,4),%xmm4,%xmm4
0x00007ffff7fbf439 <+857>: vinsertps $0x30,-0xc(%rcx,%r12,4),%xmm4,%xmm4
0x00007ffff7fbf441 <+865>: vinsertf128 $0x1,%xmm2,%ymm4,%ymm2
0x00007ffff7fbf447 <+871>: vbroadcastss 0x10(%rsi,%r12,4),%ymm4
0x00007ffff7fbf44e <+878>: vfmadd213ps %ymm3,%ymm2,%ymm4
0x00007ffff7fbf453 <+883>: vmovups %ymm4,(%rdi,%rbp,4)
0x00007ffff7fbf458 <+888>: vmovss -0x8(%rdx,%r12,4),%xmm2
0x00007ffff7fbf45f <+895>: vinsertps $0x10,-0x8(%r9,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf467 <+903>: vinsertps $0x20,-0x8(%r14,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf46f <+911>: vinsertps $0x30,-0x8(%r13,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf477 <+919>: vmovss -0x8(%r15,%r12,4),%xmm3
0x00007ffff7fbf47e <+926>: vinsertps $0x10,-0x8(%r10,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf486 <+934>: vinsertps $0x20,-0x8(%r8,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf48e <+942>: vinsertps $0x30,-0x8(%rcx,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf496 <+950>: vinsertf128 $0x1,%xmm2,%ymm3,%ymm2
0x00007ffff7fbf49c <+956>: vbroadcastss 0x14(%rsi,%r12,4),%ymm3
0x00007ffff7fbf4a3 <+963>: vfmadd213ps %ymm4,%ymm2,%ymm3
0x00007ffff7fbf4a8 <+968>: vmovups %ymm3,(%rdi,%rbp,4)
0x00007ffff7fbf4ad <+973>: vmovss -0x4(%rdx,%r12,4),%xmm2
0x00007ffff7fbf4b4 <+980>: vinsertps $0x10,-0x4(%r9,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf4bc <+988>: vinsertps $0x20,-0x4(%r14,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf4c4 <+996>: vinsertps $0x30,-0x4(%r13,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf4cc <+1004>: vmovss -0x4(%r15,%r12,4),%xmm4
0x00007ffff7fbf4d3 <+1011>: vinsertps $0x10,-0x4(%r10,%r12,4),%xmm4,%xmm4
0x00007ffff7fbf4db <+1019>: vinsertps $0x20,-0x4(%r8,%r12,4),%xmm4,%xmm4
0x00007ffff7fbf4e3 <+1027>: vinsertps $0x30,-0x4(%rcx,%r12,4),%xmm4,%xmm4
0x00007ffff7fbf4eb <+1035>: vinsertf128 $0x1,%xmm2,%ymm4,%ymm2
0x00007ffff7fbf4f1 <+1041>: vbroadcastss 0x18(%rsi,%r12,4),%ymm4
0x00007ffff7fbf4f8 <+1048>: vfmadd213ps %ymm3,%ymm2,%ymm4
0x00007ffff7fbf4fd <+1053>: vmovups %ymm4,(%rdi,%rbp,4)
0x00007ffff7fbf502 <+1058>: vmovss (%rdx,%r12,4),%xmm2
0x00007ffff7fbf508 <+1064>: vinsertps $0x10,(%r9,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf50f <+1071>: vinsertps $0x20,(%r14,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf516 <+1078>: vinsertps $0x30,0x0(%r13,%r12,4),%xmm2,%xmm2
0x00007ffff7fbf51e <+1086>: vmovss (%r15,%r12,4),%xmm3
0x00007ffff7fbf524 <+1092>: vinsertps $0x10,(%r10,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf52b <+1099>: vinsertps $0x20,(%r8,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf532 <+1106>: vinsertps $0x30,(%rcx,%r12,4),%xmm3,%xmm3
0x00007ffff7fbf539 <+1113>: vinsertf128 $0x1,%xmm2,%ymm3,%ymm3
0x00007ffff7fbf53f <+1119>: vbroadcastss 0x1c(%rsi,%r12,4),%ymm2
0x00007ffff7fbf546 <+1126>: vfmadd213ps %ymm4,%ymm3,%ymm2
0x00007ffff7fbf54b <+1131>: vmovups %ymm2,(%rdi,%rbp,4)
0x00007ffff7fbf550 <+1136>: add $0x8,%r12
0x00007ffff7fbf554 <+1140>: cmp %r12,%r11
0x00007ffff7fbf557 <+1143>: jne 0x7ffff7fbf2b0 <test_function+464>
0x00007ffff7fbf55d <+1149>: mov -0x58(%rsp),%r11
0x00007ffff7fbf562 <+1154>: test %r11,%r11
0x00007ffff7fbf565 <+1157>: je 0x7ffff7fbf635 <test_function+1365>
0x00007ffff7fbf56b <+1163>: vmovups (%rdi,%rbp,4),%ymm2
0x00007ffff7fbf570 <+1168>: lea (%rsi,%r12,4),%r8
0x00007ffff7fbf574 <+1172>: add %r12,%rax
0x00007ffff7fbf577 <+1175>: mov -0x80(%rsp),%rcx
0x00007ffff7fbf57c <+1180>: lea (%rcx,%rax,4),%r9
0x00007ffff7fbf580 <+1184>: mov -0x30(%rsp),%rax
0x00007ffff7fbf585 <+1189>: add %r12,%rax
0x00007ffff7fbf588 <+1192>: lea (%rcx,%rax,4),%r10
0x00007ffff7fbf58c <+1196>: mov -0x28(%rsp),%rax
0x00007ffff7fbf591 <+1201>: add %r12,%rax
0x00007ffff7fbf594 <+1204>: lea (%rcx,%rax,4),%r14
0x00007ffff7fbf598 <+1208>: mov -0x20(%rsp),%rax
0x00007ffff7fbf59d <+1213>: add %r12,%rax
0x00007ffff7fbf5a0 <+1216>: lea (%rcx,%rax,4),%r15
0x00007ffff7fbf5a4 <+1220>: mov -0x18(%rsp),%rax
0x00007ffff7fbf5a9 <+1225>: add %r12,%rax
0x00007ffff7fbf5ac <+1228>: lea (%rcx,%rax,4),%r13
0x00007ffff7fbf5b0 <+1232>: mov -0x10(%rsp),%rax
0x00007ffff7fbf5b5 <+1237>: add %r12,%rax
0x00007ffff7fbf5b8 <+1240>: lea (%rcx,%rax,4),%rax
0x00007ffff7fbf5bc <+1244>: mov -0x8(%rsp),%rdx
0x00007ffff7fbf5c1 <+1249>: add %r12,%rdx
0x00007ffff7fbf5c4 <+1252>: lea (%rcx,%rdx,4),%rbx
0x00007ffff7fbf5c8 <+1256>: mov (%rsp),%rdx
0x00007ffff7fbf5cc <+1260>: add %r12,%rdx
0x00007ffff7fbf5cf <+1263>: lea (%rcx,%rdx,4),%rcx
0x00007ffff7fbf5d3 <+1267>: xor %edx,%edx
0x00007ffff7fbf5d5 <+1269>: data16 nopw %cs:0x0(%rax,%rax,1)
0x00007ffff7fbf5e0 <+1280>: vmovss (%r15,%rdx,4),%xmm3
0x00007ffff7fbf5e6 <+1286>: vinsertps $0x10,(%r14,%rdx,4),%xmm3,%xmm3
0x00007ffff7fbf5ed <+1293>: vinsertps $0x20,(%r10,%rdx,4),%xmm3,%xmm3
0x00007ffff7fbf5f4 <+1300>: vinsertps $0x30,(%r9,%rdx,4),%xmm3,%xmm3
0x00007ffff7fbf5fb <+1307>: vmovss (%rcx,%rdx,4),%xmm4
0x00007ffff7fbf600 <+1312>: vinsertps $0x10,(%rbx,%rdx,4),%xmm4,%xmm4
0x00007ffff7fbf607 <+1319>: vinsertps $0x20,(%rax,%rdx,4),%xmm4,%xmm4
0x00007ffff7fbf60e <+1326>: vinsertps $0x30,0x0(%r13,%rdx,4),%xmm4,%xmm4
0x00007ffff7fbf616 <+1334>: vinsertf128 $0x1,%xmm3,%ymm4,%ymm3
0x00007ffff7fbf61c <+1340>: vbroadcastss (%r8,%rdx,4),%ymm4
0x00007ffff7fbf622 <+1346>: vfmadd231ps %ymm4,%ymm3,%ymm2
0x00007ffff7fbf627 <+1351>: vmovups %ymm2,(%rdi,%rbp,4)
0x00007ffff7fbf62c <+1356>: add $0x1,%rdx
0x00007ffff7fbf630 <+1360>: cmp %rdx,%r11
0x00007ffff7fbf633 <+1363>: jne 0x7ffff7fbf5e0 <test_function+1280>
0x00007ffff7fbf635 <+1365>: mov 0x10(%rsp),%rcx
0x00007ffff7fbf63a <+1370>: add $0x1,%rcx
0x00007ffff7fbf63e <+1374>: mov 0x8(%rsp),%rdx
0x00007ffff7fbf643 <+1379>: add $0x8,%rdx
0x00007ffff7fbf647 <+1383>: vpaddd %ymm1,%ymm0,%ymm0
0x00007ffff7fbf64b <+1387>: cmp -0x38(%rsp),%rcx
0x00007ffff7fbf650 <+1392>: mov -0x40(%rsp),%r12
0x00007ffff7fbf655 <+1397>: mov -0x50(%rsp),%r11
0x00007ffff7fbf65a <+1402>: jne 0x7ffff7fbf1f0 <test_function+272>
0x00007ffff7fbf660 <+1408>: cmpq $0x0,-0x68(%rsp)
0x00007ffff7fbf666 <+1414>: mov -0x70(%rsp),%rax
0x00007ffff7fbf66b <+1419>: je 0x7ffff7fbf7c2 <test_function+1762>
0x00007ffff7fbf671 <+1425>: add %rax,%r12
0x00007ffff7fbf674 <+1428>: mov -0x78(%rsp),%rcx
0x00007ffff7fbf679 <+1433>: mov %ecx,%eax
0x00007ffff7fbf67b <+1435>: and $0x7,%eax
0x00007ffff7fbf67e <+1438>: lea -0x1(%rcx),%r9
0x00007ffff7fbf682 <+1442>: mov %rcx,%r15
0x00007ffff7fbf685 <+1445>: sub %rax,%r15
0x00007ffff7fbf688 <+1448>: mov -0x80(%rsp),%rdx
0x00007ffff7fbf68d <+1453>: lea 0x1c(%rdx),%r8
0x00007ffff7fbf691 <+1457>: mov %r12d,%r11d
0x00007ffff7fbf694 <+1460>: imul %ecx,%r11d
0x00007ffff7fbf698 <+1464>: xor %r14d,%r14d
0x00007ffff7fbf69b <+1467>: nopl 0x0(%rax,%rax,1)
0x00007ffff7fbf6a0 <+1472>: movslq %r11d,%r10
0x00007ffff7fbf6a3 <+1475>: movslq %r12d,%rcx
0x00007ffff7fbf6a6 <+1478>: cmp $0x7,%r9
0x00007ffff7fbf6aa <+1482>: jae 0x7ffff7fbf6c0 <test_function+1504>
0x00007ffff7fbf6ac <+1484>: xor %ebx,%ebx
0x00007ffff7fbf6ae <+1486>: test %rax,%rax
0x00007ffff7fbf6b1 <+1489>: jne 0x7ffff7fbf771 <test_function+1681>
0x00007ffff7fbf6b7 <+1495>: jmp 0x7ffff7fbf7aa <test_function+1738>
0x00007ffff7fbf6bc <+1500>: nopl 0x0(%rax)
0x00007ffff7fbf6c0 <+1504>: lea (%r8,%r10,4),%rbp
0x00007ffff7fbf6c4 <+1508>: vmovss (%rdi,%rcx,4),%xmm0
0x00007ffff7fbf6c9 <+1513>: xor %ebx,%ebx
0x00007ffff7fbf6cb <+1515>: nopl 0x0(%rax,%rax,1)
0x00007ffff7fbf6d0 <+1520>: vmovss -0x1c(%rbp,%rbx,4),%xmm1
0x00007ffff7fbf6d6 <+1526>: vfmadd132ss (%rsi,%rbx,4),%xmm0,%xmm1
0x00007ffff7fbf6dc <+1532>: vmovss %xmm1,(%rdi,%rcx,4)
0x00007ffff7fbf6e1 <+1537>: vmovss -0x18(%rbp,%rbx,4),%xmm0
0x00007ffff7fbf6e7 <+1543>: vfmadd132ss 0x4(%rsi,%rbx,4),%xmm1,%xmm0
0x00007ffff7fbf6ee <+1550>: vmovss %xmm0,(%rdi,%rcx,4)
0x00007ffff7fbf6f3 <+1555>: vmovss -0x14(%rbp,%rbx,4),%xmm1
0x00007ffff7fbf6f9 <+1561>: vfmadd132ss 0x8(%rsi,%rbx,4),%xmm0,%xmm1
0x00007ffff7fbf700 <+1568>: vmovss %xmm1,(%rdi,%rcx,4)
0x00007ffff7fbf705 <+1573>: vmovss -0x10(%rbp,%rbx,4),%xmm0
0x00007ffff7fbf70b <+1579>: vfmadd132ss 0xc(%rsi,%rbx,4),%xmm1,%xmm0
0x00007ffff7fbf712 <+1586>: vmovss %xmm0,(%rdi,%rcx,4)
0x00007ffff7fbf717 <+1591>: vmovss -0xc(%rbp,%rbx,4),%xmm1
0x00007ffff7fbf71d <+1597>: vfmadd132ss 0x10(%rsi,%rbx,4),%xmm0,%xmm1
0x00007ffff7fbf724 <+1604>: vmovss %xmm1,(%rdi,%rcx,4)
0x00007ffff7fbf729 <+1609>: vmovss -0x8(%rbp,%rbx,4),%xmm0
0x00007ffff7fbf72f <+1615>: vfmadd132ss 0x14(%rsi,%rbx,4),%xmm1,%xmm0
0x00007ffff7fbf736 <+1622>: vmovss %xmm0,(%rdi,%rcx,4)
0x00007ffff7fbf73b <+1627>: vmovss -0x4(%rbp,%rbx,4),%xmm1
0x00007ffff7fbf741 <+1633>: vfmadd132ss 0x18(%rsi,%rbx,4),%xmm0,%xmm1
0x00007ffff7fbf748 <+1640>: vmovss %xmm1,(%rdi,%rcx,4)
0x00007ffff7fbf74d <+1645>: vmovss 0x0(%rbp,%rbx,4),%xmm0
0x00007ffff7fbf753 <+1651>: vfmadd132ss 0x1c(%rsi,%rbx,4),%xmm1,%xmm0
0x00007ffff7fbf75a <+1658>: vmovss %xmm0,(%rdi,%rcx,4)
0x00007ffff7fbf75f <+1663>: add $0x8,%rbx
0x00007ffff7fbf763 <+1667>: cmp %rbx,%r15
0x00007ffff7fbf766 <+1670>: jne 0x7ffff7fbf6d0 <test_function+1520>
0x00007ffff7fbf76c <+1676>: test %rax,%rax
0x00007ffff7fbf76f <+1679>: je 0x7ffff7fbf7aa <test_function+1738>
0x00007ffff7fbf771 <+1681>: vmovss (%rdi,%rcx,4),%xmm0
0x00007ffff7fbf776 <+1686>: lea (%rsi,%rbx,4),%rbp
0x00007ffff7fbf77a <+1690>: add %rbx,%r10
0x00007ffff7fbf77d <+1693>: mov -0x80(%rsp),%rdx
0x00007ffff7fbf782 <+1698>: lea (%rdx,%r10,4),%rbx
0x00007ffff7fbf786 <+1702>: xor %edx,%edx
0x00007ffff7fbf788 <+1704>: nopl 0x0(%rax,%rax,1)
0x00007ffff7fbf790 <+1712>: vmovss (%rbx,%rdx,4),%xmm1
0x00007ffff7fbf795 <+1717>: vfmadd231ss 0x0(%rbp,%rdx,4),%xmm1,%xmm0
0x00007ffff7fbf79c <+1724>: vmovss %xmm0,(%rdi,%rcx,4)
0x00007ffff7fbf7a1 <+1729>: add $0x1,%rdx
0x00007ffff7fbf7a5 <+1733>: cmp %rdx,%rax
0x00007ffff7fbf7a8 <+1736>: jne 0x7ffff7fbf790 <test_function+1712>
0x00007ffff7fbf7aa <+1738>: add $0x1,%r14
0x00007ffff7fbf7ae <+1742>: add $0x1,%r12
0x00007ffff7fbf7b2 <+1746>: add -0x78(%rsp),%r11d
0x00007ffff7fbf7b7 <+1751>: cmp -0x68(%rsp),%r14
0x00007ffff7fbf7bc <+1756>: jne 0x7ffff7fbf6a0 <test_function+1472>
0x00007ffff7fbf7c2 <+1762>: add $0x18,%rsp
0x00007ffff7fbf7c6 <+1766>: pop %rbx
0x00007ffff7fbf7c7 <+1767>: pop %r12
0x00007ffff7fbf7c9 <+1769>: pop %r13
0x00007ffff7fbf7cb <+1771>: pop %r14
0x00007ffff7fbf7cd <+1773>: pop %r15
0x00007ffff7fbf7cf <+1775>: pop %rbp
0x00007ffff7fbf7d0 <+1776>: vzeroupper
0x00007ffff7fbf7d3 <+1779>: ret
End of assembler dump.
| 58.143662 | 76 | 0.674628 |
03f466512151710834409e019b76779c333700c8 | 52 | asm | Assembly | src/main/fragment/mos6502-common/vwum1=vwum1_minus_vbum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vwum1=vwum1_minus_vbum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vwum1=vwum1_minus_vbum2.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | sec
lda {m1}
sbc {m2}
sta {m1}
bcs !+
dec {m1}+1
!:
| 6.5 | 10 | 0.519231 |
9d783fed2addc755dbe010bba1306f285485fc0c | 658 | asm | Assembly | oeis/167/A167056.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/167/A167056.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/167/A167056.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A167056: Numbers n such that 12*n + 7 is prime.
; Submitted by Jamie Morken(s4)
; 0,1,2,3,5,6,8,10,11,12,13,16,17,18,22,23,25,27,30,31,36,38,40,41,43,45,47,50,51,52,53,57,60,61,62,65,67,68,71,73,75,76,80,82,86,87,88,90,93,97,102,106,107,108,110,116,118,120,121,122,123,127,128,130,131,135,138,141,143,145,146,148,152,155,156,162,165,166,167,173,177,178,181,183,186,187,190,192,195,197,198,205,208,211,212,220,221,222,223,225
mov $1,6
mov $2,$0
pow $2,2
lpb $2
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,12
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
lpe
mov $0,$1
div $0,12
| 31.333333 | 344 | 0.653495 |
97d877daa5c7f110443824e8106c16237ea90077 | 482 | asm | Assembly | programs/oeis/153/A153367.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/153/A153367.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/153/A153367.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A153367: Number of zig-zag paths from top to bottom of a rectangle of width 9 with 2n-1 rows whose color is not that of the top right corner.
; 4,14,50,180,650,2350,8500,30750,111250,402500,1456250,5268750,19062500,68968750,249531250,902812500,3266406250,11817968750,42757812500,154699218750,559707031250,2025039062500,7326660156250,26508105468750
add $0,1
mov $1,2
mov $2,2
lpb $0
sub $0,1
sub $2,$1
mul $1,5
sub $2,1
add $1,$2
lpe
sub $1,5
div $1,5
mul $1,2
add $1,4
| 26.777778 | 205 | 0.740664 |
7a56d62d0832de162a67b62add857bd7e9c8e2d5 | 1,589 | asm | Assembly | question3.asm | AlexSoldin/CSC2002S-Assignment-5 | cf6933ff2493dac345617b6ddeb6aa802389a95a | [
"MIT"
] | null | null | null | question3.asm | AlexSoldin/CSC2002S-Assignment-5 | cf6933ff2493dac345617b6ddeb6aa802389a95a | [
"MIT"
] | null | null | null | question3.asm | AlexSoldin/CSC2002S-Assignment-5 | cf6933ff2493dac345617b6ddeb6aa802389a95a | [
"MIT"
] | null | null | null | .data
prompt_string1: .asciiz "Enter the first number:\n"
prompt_string2: .asciiz "Enter the second number:\n"
output_stringYes: .asciiz "The two numbers are relatively prime"
output_stringNo: .asciiz "The two numbers are not relatively prime"
.text
main:
li $v0, 4
la $a0, prompt_string1
syscall
li $v0, 5
syscall
move $t0, $v0 #$t0 stores first number
li $v0, 4
la $a0, prompt_string2
syscall
li $v0, 5
syscall
move $t1, $v0 #$t1 stores second number
li $t2, 1 #number to be incremented in $t0
bgt $t0, $t1, setFinal
move $t3, $t0 #number to stop at in $t0
b endCounterIf
endCounterIf:
setFinal:
move $t3, $t1 #number to stop at in $t1
Loop:
beq $t2, $t3, endLoop #if t0==t1, endLoop
add $t2, $t2, 1
div $t0, $t2
mfhi $t4
div $t1, $t2
mfhi $t5
add $t6, $t4, $t5
beq $t6, 0, remainderZero #if $t6==0, remainderZero
b endif
remainderZero:
li $t7, 1
endif:
b Loop
endLoop:
bne $t7, 1, OutputYes
la $a0, output_stringNo
li $v0, 4
syscall
b endOutputIf
OutputYes:
la $a0, output_stringYes
li $v0, 4
syscall
endOutputIf:
# 10 is the exit syscall
li $v0, 10
syscall | 21.472973 | 68 | 0.480176 |
9e7d52e34915afcabe0c7c2497de2885bcef095d | 1,635 | asm | Assembly | programs/oeis/033/A033113.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/033/A033113.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/033/A033113.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A033113: Base-3 digits are, in order, the first n terms of the periodic sequence with initial period 1,0.
; 1,3,10,30,91,273,820,2460,7381,22143,66430,199290,597871,1793613,5380840,16142520,48427561,145282683,435848050,1307544150,3922632451,11767897353,35303692060,105911076180,317733228541,953199685623,2859599056870,8578797170610,25736391511831,77209174535493,231627523606480,694882570819440,2084647712458321,6253943137374963,18761829412124890,56285488236374670,168856464709124011,506569394127372033,1519708182382116100,4559124547146348300,13677373641439044901,41032120924317134703,123096362772951404110,369289088318854212330,1107867264956562636991,3323601794869687910973,9970805384609063732920,29912416153827191198760,89737248461481573596281,269211745384444720788843,807635236153334162366530,2422905708460002487099590,7268717125380007461298771,21806151376140022383896313,65418454128420067151688940,196255362385260201455066820,588766087155780604365200461,1766298261467341813095601383,5298894784402025439286804150,15896684353206076317860412450,47690053059618228953581237351,143070159178854686860743712053,429210477536564060582231136160,1287631432609692181746693408480,3862894297829076545240080225441,11588682893487229635720240676323,34766048680461688907160722028970,104298146041385066721482166086910,312894438124155200164446498260731,938683314372465600493339494782193,2816049943117396801480018484346580,8448149829352190404440055453039740,25344449488056571213320166359119221,76033348464169713639960499077357663,228100045392509140919881497232072990,684300136177527422759644491696218970
add $0,2
mov $1,3
pow $1,$0
div $1,8
mov $0,$1
| 181.666667 | 1,478 | 0.922324 |
c3d12383293c87c8f680b052e5374bdac4f9aabd | 187 | asm | Assembly | externals/skia/third_party/externals/yasm/source/patched-yasm/modules/objfmts/elf/tests/amd64/gotpcrel.asm | terrajobst/linux-packaging-skiasharp | 47dbb2ff9ae01305b190f409ccea00b3b4f0bc79 | [
"MIT"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | externals/skia/third_party/externals/yasm/source/patched-yasm/modules/objfmts/elf/tests/amd64/gotpcrel.asm | terrajobst/linux-packaging-skiasharp | 47dbb2ff9ae01305b190f409ccea00b3b4f0bc79 | [
"MIT"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | externals/skia/third_party/externals/yasm/source/patched-yasm/modules/objfmts/elf/tests/amd64/gotpcrel.asm | terrajobst/linux-packaging-skiasharp | 47dbb2ff9ae01305b190f409ccea00b3b4f0bc79 | [
"MIT"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | var:
mov rax, [var wrt ..got]
mov rax, [var wrt ..gotpcrel] ; should be error/warning?
mov rax, [rel var wrt ..got] ; automatic promotion to GOTPCREL
mov rax, [rel var wrt ..gotpcrel]
| 26.714286 | 63 | 0.679144 |
f65161f1f0621e02f11b5e7f0e4cfeeb542d1f27 | 367 | asm | Assembly | tests/abi/host/abi.asm | jbdelcuv/openenclave | c2e9cfabd788597f283c8dd39edda5837b1b1339 | [
"MIT"
] | 617 | 2019-06-19T22:08:04.000Z | 2022-03-25T09:21:03.000Z | tests/abi/host/abi.asm | jbdelcuv/openenclave | c2e9cfabd788597f283c8dd39edda5837b1b1339 | [
"MIT"
] | 2,545 | 2019-06-18T21:46:10.000Z | 2022-03-31T23:26:51.000Z | tests/abi/host/abi.asm | jbdelcuv/openenclave | c2e9cfabd788597f283c8dd39edda5837b1b1339 | [
"MIT"
] | 292 | 2019-07-02T15:40:35.000Z | 2022-03-27T13:27:10.000Z | ;; Copyright (c) Open Enclave SDK contributors.
;; Licensed under the MIT License.
.CODE
PUBLIC oe_dummy_mmx_add
oe_dummy_mmx_add PROC
pxor mm0, mm0
paddd mm0, mm0
ret
oe_dummy_mmx_add ENDP
PUBLIC oe_dummy_fpu_loads
oe_dummy_fpu_loads PROC
fldz
fldz
fldz
fldz
fldz
fldz
fldz
fldz
ret
oe_dummy_fpu_loads ENDP
END
| 12.233333 | 47 | 0.702997 |
42bb479b9b4f3f2e2f0131e3e9e5a4fa5322ef52 | 80,567 | asm | Assembly | externals/ffmpeg/libavcodec/x86/vp8dsp.asm | vuece/vuece-libjingle | 3216d495a60d6afbc885a237e077381788288d5e | [
"MIT"
] | null | null | null | externals/ffmpeg/libavcodec/x86/vp8dsp.asm | vuece/vuece-libjingle | 3216d495a60d6afbc885a237e077381788288d5e | [
"MIT"
] | null | null | null | externals/ffmpeg/libavcodec/x86/vp8dsp.asm | vuece/vuece-libjingle | 3216d495a60d6afbc885a237e077381788288d5e | [
"MIT"
] | 1 | 2020-01-20T07:10:26.000Z | 2020-01-20T07:10:26.000Z | ;******************************************************************************
;* VP8 MMXEXT optimizations
;* Copyright (c) 2010 Ronald S. Bultje <rsbultje@gmail.com>
;* Copyright (c) 2010 Jason Garrett-Glaser <darkshikari@gmail.com>
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%include "libavutil/x86/x86inc.asm"
%include "libavutil/x86/x86util.asm"
SECTION_RODATA
fourtap_filter_hw_m: times 4 dw -6, 123
times 4 dw 12, -1
times 4 dw -9, 93
times 4 dw 50, -6
times 4 dw -6, 50
times 4 dw 93, -9
times 4 dw -1, 12
times 4 dw 123, -6
sixtap_filter_hw_m: times 4 dw 2, -11
times 4 dw 108, 36
times 4 dw -8, 1
times 4 dw 3, -16
times 4 dw 77, 77
times 4 dw -16, 3
times 4 dw 1, -8
times 4 dw 36, 108
times 4 dw -11, 2
fourtap_filter_hb_m: times 8 db -6, 123
times 8 db 12, -1
times 8 db -9, 93
times 8 db 50, -6
times 8 db -6, 50
times 8 db 93, -9
times 8 db -1, 12
times 8 db 123, -6
sixtap_filter_hb_m: times 8 db 2, 1
times 8 db -11, 108
times 8 db 36, -8
times 8 db 3, 3
times 8 db -16, 77
times 8 db 77, -16
times 8 db 1, 2
times 8 db -8, 36
times 8 db 108, -11
fourtap_filter_v_m: times 8 dw -6
times 8 dw 123
times 8 dw 12
times 8 dw -1
times 8 dw -9
times 8 dw 93
times 8 dw 50
times 8 dw -6
times 8 dw -6
times 8 dw 50
times 8 dw 93
times 8 dw -9
times 8 dw -1
times 8 dw 12
times 8 dw 123
times 8 dw -6
sixtap_filter_v_m: times 8 dw 2
times 8 dw -11
times 8 dw 108
times 8 dw 36
times 8 dw -8
times 8 dw 1
times 8 dw 3
times 8 dw -16
times 8 dw 77
times 8 dw 77
times 8 dw -16
times 8 dw 3
times 8 dw 1
times 8 dw -8
times 8 dw 36
times 8 dw 108
times 8 dw -11
times 8 dw 2
bilinear_filter_vw_m: times 8 dw 1
times 8 dw 2
times 8 dw 3
times 8 dw 4
times 8 dw 5
times 8 dw 6
times 8 dw 7
bilinear_filter_vb_m: times 8 db 7, 1
times 8 db 6, 2
times 8 db 5, 3
times 8 db 4, 4
times 8 db 3, 5
times 8 db 2, 6
times 8 db 1, 7
%ifdef PIC
%define fourtap_filter_hw picregq
%define sixtap_filter_hw picregq
%define fourtap_filter_hb picregq
%define sixtap_filter_hb picregq
%define fourtap_filter_v picregq
%define sixtap_filter_v picregq
%define bilinear_filter_vw picregq
%define bilinear_filter_vb picregq
%define npicregs 1
%else
%define fourtap_filter_hw fourtap_filter_hw_m
%define sixtap_filter_hw sixtap_filter_hw_m
%define fourtap_filter_hb fourtap_filter_hb_m
%define sixtap_filter_hb sixtap_filter_hb_m
%define fourtap_filter_v fourtap_filter_v_m
%define sixtap_filter_v sixtap_filter_v_m
%define bilinear_filter_vw bilinear_filter_vw_m
%define bilinear_filter_vb bilinear_filter_vb_m
%define npicregs 0
%endif
filter_h2_shuf: db 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8
filter_h4_shuf: db 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10
filter_h6_shuf1: db 0, 5, 1, 6, 2, 7, 3, 8, 4, 9, 5, 10, 6, 11, 7, 12
filter_h6_shuf2: db 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9
filter_h6_shuf3: db 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11
pw_256: times 8 dw 256
pw_20091: times 4 dw 20091
pw_17734: times 4 dw 17734
pb_27_63: times 8 db 27, 63
pb_18_63: times 8 db 18, 63
pb_9_63: times 8 db 9, 63
cextern pb_1
cextern pw_3
cextern pb_3
cextern pw_4
cextern pb_4
cextern pw_9
cextern pw_18
cextern pw_27
cextern pw_63
cextern pw_64
cextern pb_80
cextern pb_F8
cextern pb_FE
SECTION .text
;-----------------------------------------------------------------------------
; subpel MC functions:
;
; void put_vp8_epel<size>_h<htap>v<vtap>_<opt>(uint8_t *dst, int deststride,
; uint8_t *src, int srcstride,
; int height, int mx, int my);
;-----------------------------------------------------------------------------
%macro FILTER_SSSE3 1
cglobal put_vp8_epel%1_h6, 6, 6 + npicregs, 8, dst, dststride, src, srcstride, height, mx, picreg
lea mxd, [mxq*3]
mova m3, [filter_h6_shuf2]
mova m4, [filter_h6_shuf3]
%ifdef PIC
lea picregq, [sixtap_filter_hb_m]
%endif
mova m5, [sixtap_filter_hb+mxq*8-48] ; set up 6tap filter in bytes
mova m6, [sixtap_filter_hb+mxq*8-32]
mova m7, [sixtap_filter_hb+mxq*8-16]
.nextrow
movu m0, [srcq-2]
mova m1, m0
mova m2, m0
%if mmsize == 8
; For epel4, we need 9 bytes, but only 8 get loaded; to compensate, do the
; shuffle with a memory operand
punpcklbw m0, [srcq+3]
%else
pshufb m0, [filter_h6_shuf1]
%endif
pshufb m1, m3
pshufb m2, m4
pmaddubsw m0, m5
pmaddubsw m1, m6
pmaddubsw m2, m7
paddsw m0, m1
paddsw m0, m2
pmulhrsw m0, [pw_256]
packuswb m0, m0
movh [dstq], m0 ; store
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
cglobal put_vp8_epel%1_h4, 6, 6 + npicregs, 7, dst, dststride, src, srcstride, height, mx, picreg
shl mxd, 4
mova m2, [pw_256]
mova m3, [filter_h2_shuf]
mova m4, [filter_h4_shuf]
%ifdef PIC
lea picregq, [fourtap_filter_hb_m]
%endif
mova m5, [fourtap_filter_hb+mxq-16] ; set up 4tap filter in bytes
mova m6, [fourtap_filter_hb+mxq]
.nextrow
movu m0, [srcq-1]
mova m1, m0
pshufb m0, m3
pshufb m1, m4
pmaddubsw m0, m5
pmaddubsw m1, m6
paddsw m0, m1
pmulhrsw m0, m2
packuswb m0, m0
movh [dstq], m0 ; store
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
cglobal put_vp8_epel%1_v4, 7, 7, 8, dst, dststride, src, srcstride, height, picreg, my
shl myd, 4
%ifdef PIC
lea picregq, [fourtap_filter_hb_m]
%endif
mova m5, [fourtap_filter_hb+myq-16]
mova m6, [fourtap_filter_hb+myq]
mova m7, [pw_256]
; read 3 lines
sub srcq, srcstrideq
movh m0, [srcq]
movh m1, [srcq+ srcstrideq]
movh m2, [srcq+2*srcstrideq]
add srcq, srcstrideq
.nextrow
movh m3, [srcq+2*srcstrideq] ; read new row
mova m4, m0
mova m0, m1
punpcklbw m4, m1
mova m1, m2
punpcklbw m2, m3
pmaddubsw m4, m5
pmaddubsw m2, m6
paddsw m4, m2
mova m2, m3
pmulhrsw m4, m7
packuswb m4, m4
movh [dstq], m4
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
cglobal put_vp8_epel%1_v6, 7, 7, 8, dst, dststride, src, srcstride, height, picreg, my
lea myd, [myq*3]
%ifdef PIC
lea picregq, [sixtap_filter_hb_m]
%endif
lea myq, [sixtap_filter_hb+myq*8]
; read 5 lines
sub srcq, srcstrideq
sub srcq, srcstrideq
movh m0, [srcq]
movh m1, [srcq+srcstrideq]
movh m2, [srcq+srcstrideq*2]
lea srcq, [srcq+srcstrideq*2]
add srcq, srcstrideq
movh m3, [srcq]
movh m4, [srcq+srcstrideq]
.nextrow
movh m5, [srcq+2*srcstrideq] ; read new row
mova m6, m0
punpcklbw m6, m5
mova m0, m1
punpcklbw m1, m2
mova m7, m3
punpcklbw m7, m4
pmaddubsw m6, [myq-48]
pmaddubsw m1, [myq-32]
pmaddubsw m7, [myq-16]
paddsw m6, m1
paddsw m6, m7
mova m1, m2
mova m2, m3
pmulhrsw m6, [pw_256]
mova m3, m4
packuswb m6, m6
mova m4, m5
movh [dstq], m6
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
%endmacro
INIT_MMX ssse3
FILTER_SSSE3 4
INIT_XMM ssse3
FILTER_SSSE3 8
; 4x4 block, H-only 4-tap filter
INIT_MMX mmx2
cglobal put_vp8_epel4_h4, 6, 6 + npicregs, 0, dst, dststride, src, srcstride, height, mx, picreg
shl mxd, 4
%ifdef PIC
lea picregq, [fourtap_filter_hw_m]
%endif
movq mm4, [fourtap_filter_hw+mxq-16] ; set up 4tap filter in words
movq mm5, [fourtap_filter_hw+mxq]
movq mm7, [pw_64]
pxor mm6, mm6
.nextrow
movq mm1, [srcq-1] ; (ABCDEFGH) load 8 horizontal pixels
; first set of 2 pixels
movq mm2, mm1 ; byte ABCD..
punpcklbw mm1, mm6 ; byte->word ABCD
pshufw mm0, mm2, 9 ; byte CDEF..
punpcklbw mm0, mm6 ; byte->word CDEF
pshufw mm3, mm1, 0x94 ; word ABBC
pshufw mm1, mm0, 0x94 ; word CDDE
pmaddwd mm3, mm4 ; multiply 2px with F0/F1
movq mm0, mm1 ; backup for second set of pixels
pmaddwd mm1, mm5 ; multiply 2px with F2/F3
paddd mm3, mm1 ; finish 1st 2px
; second set of 2 pixels, use backup of above
punpckhbw mm2, mm6 ; byte->word EFGH
pmaddwd mm0, mm4 ; multiply backed up 2px with F0/F1
pshufw mm1, mm2, 0x94 ; word EFFG
pmaddwd mm1, mm5 ; multiply 2px with F2/F3
paddd mm0, mm1 ; finish 2nd 2px
; merge two sets of 2 pixels into one set of 4, round/clip/store
packssdw mm3, mm0 ; merge dword->word (4px)
paddsw mm3, mm7 ; rounding
psraw mm3, 7
packuswb mm3, mm6 ; clip and word->bytes
movd [dstq], mm3 ; store
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
; 4x4 block, H-only 6-tap filter
INIT_MMX mmx2
cglobal put_vp8_epel4_h6, 6, 6 + npicregs, 0, dst, dststride, src, srcstride, height, mx, picreg
lea mxd, [mxq*3]
%ifdef PIC
lea picregq, [sixtap_filter_hw_m]
%endif
movq mm4, [sixtap_filter_hw+mxq*8-48] ; set up 4tap filter in words
movq mm5, [sixtap_filter_hw+mxq*8-32]
movq mm6, [sixtap_filter_hw+mxq*8-16]
movq mm7, [pw_64]
pxor mm3, mm3
.nextrow
movq mm1, [srcq-2] ; (ABCDEFGH) load 8 horizontal pixels
; first set of 2 pixels
movq mm2, mm1 ; byte ABCD..
punpcklbw mm1, mm3 ; byte->word ABCD
pshufw mm0, mm2, 0x9 ; byte CDEF..
punpckhbw mm2, mm3 ; byte->word EFGH
punpcklbw mm0, mm3 ; byte->word CDEF
pshufw mm1, mm1, 0x94 ; word ABBC
pshufw mm2, mm2, 0x94 ; word EFFG
pmaddwd mm1, mm4 ; multiply 2px with F0/F1
pshufw mm3, mm0, 0x94 ; word CDDE
movq mm0, mm3 ; backup for second set of pixels
pmaddwd mm3, mm5 ; multiply 2px with F2/F3
paddd mm1, mm3 ; add to 1st 2px cache
movq mm3, mm2 ; backup for second set of pixels
pmaddwd mm2, mm6 ; multiply 2px with F4/F5
paddd mm1, mm2 ; finish 1st 2px
; second set of 2 pixels, use backup of above
movd mm2, [srcq+3] ; byte FGHI (prevent overreads)
pmaddwd mm0, mm4 ; multiply 1st backed up 2px with F0/F1
pmaddwd mm3, mm5 ; multiply 2nd backed up 2px with F2/F3
paddd mm0, mm3 ; add to 2nd 2px cache
pxor mm3, mm3
punpcklbw mm2, mm3 ; byte->word FGHI
pshufw mm2, mm2, 0xE9 ; word GHHI
pmaddwd mm2, mm6 ; multiply 2px with F4/F5
paddd mm0, mm2 ; finish 2nd 2px
; merge two sets of 2 pixels into one set of 4, round/clip/store
packssdw mm1, mm0 ; merge dword->word (4px)
paddsw mm1, mm7 ; rounding
psraw mm1, 7
packuswb mm1, mm3 ; clip and word->bytes
movd [dstq], mm1 ; store
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
INIT_XMM sse2
cglobal put_vp8_epel8_h4, 6, 6 + npicregs, 10, dst, dststride, src, srcstride, height, mx, picreg
shl mxd, 5
%ifdef PIC
lea picregq, [fourtap_filter_v_m]
%endif
lea mxq, [fourtap_filter_v+mxq-32]
pxor m7, m7
mova m4, [pw_64]
mova m5, [mxq+ 0]
mova m6, [mxq+16]
%ifdef m8
mova m8, [mxq+32]
mova m9, [mxq+48]
%endif
.nextrow
movq m0, [srcq-1]
movq m1, [srcq-0]
movq m2, [srcq+1]
movq m3, [srcq+2]
punpcklbw m0, m7
punpcklbw m1, m7
punpcklbw m2, m7
punpcklbw m3, m7
pmullw m0, m5
pmullw m1, m6
%ifdef m8
pmullw m2, m8
pmullw m3, m9
%else
pmullw m2, [mxq+32]
pmullw m3, [mxq+48]
%endif
paddsw m0, m1
paddsw m2, m3
paddsw m0, m2
paddsw m0, m4
psraw m0, 7
packuswb m0, m7
movh [dstq], m0 ; store
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
INIT_XMM sse2
cglobal put_vp8_epel8_h6, 6, 6 + npicregs, 14, dst, dststride, src, srcstride, height, mx, picreg
lea mxd, [mxq*3]
shl mxd, 4
%ifdef PIC
lea picregq, [sixtap_filter_v_m]
%endif
lea mxq, [sixtap_filter_v+mxq-96]
pxor m7, m7
mova m6, [pw_64]
%ifdef m8
mova m8, [mxq+ 0]
mova m9, [mxq+16]
mova m10, [mxq+32]
mova m11, [mxq+48]
mova m12, [mxq+64]
mova m13, [mxq+80]
%endif
.nextrow
movq m0, [srcq-2]
movq m1, [srcq-1]
movq m2, [srcq-0]
movq m3, [srcq+1]
movq m4, [srcq+2]
movq m5, [srcq+3]
punpcklbw m0, m7
punpcklbw m1, m7
punpcklbw m2, m7
punpcklbw m3, m7
punpcklbw m4, m7
punpcklbw m5, m7
%ifdef m8
pmullw m0, m8
pmullw m1, m9
pmullw m2, m10
pmullw m3, m11
pmullw m4, m12
pmullw m5, m13
%else
pmullw m0, [mxq+ 0]
pmullw m1, [mxq+16]
pmullw m2, [mxq+32]
pmullw m3, [mxq+48]
pmullw m4, [mxq+64]
pmullw m5, [mxq+80]
%endif
paddsw m1, m4
paddsw m0, m5
paddsw m1, m2
paddsw m0, m3
paddsw m0, m1
paddsw m0, m6
psraw m0, 7
packuswb m0, m7
movh [dstq], m0 ; store
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
%macro FILTER_V 1
; 4x4 block, V-only 4-tap filter
cglobal put_vp8_epel%1_v4, 7, 7, 8, dst, dststride, src, srcstride, height, picreg, my
shl myd, 5
%ifdef PIC
lea picregq, [fourtap_filter_v_m]
%endif
lea myq, [fourtap_filter_v+myq-32]
mova m6, [pw_64]
pxor m7, m7
mova m5, [myq+48]
; read 3 lines
sub srcq, srcstrideq
movh m0, [srcq]
movh m1, [srcq+ srcstrideq]
movh m2, [srcq+2*srcstrideq]
add srcq, srcstrideq
punpcklbw m0, m7
punpcklbw m1, m7
punpcklbw m2, m7
.nextrow
; first calculate negative taps (to prevent losing positive overflows)
movh m4, [srcq+2*srcstrideq] ; read new row
punpcklbw m4, m7
mova m3, m4
pmullw m0, [myq+0]
pmullw m4, m5
paddsw m4, m0
; then calculate positive taps
mova m0, m1
pmullw m1, [myq+16]
paddsw m4, m1
mova m1, m2
pmullw m2, [myq+32]
paddsw m4, m2
mova m2, m3
; round/clip/store
paddsw m4, m6
psraw m4, 7
packuswb m4, m7
movh [dstq], m4
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
; 4x4 block, V-only 6-tap filter
cglobal put_vp8_epel%1_v6, 7, 7, 8, dst, dststride, src, srcstride, height, picreg, my
shl myd, 4
lea myq, [myq*3]
%ifdef PIC
lea picregq, [sixtap_filter_v_m]
%endif
lea myq, [sixtap_filter_v+myq-96]
pxor m7, m7
; read 5 lines
sub srcq, srcstrideq
sub srcq, srcstrideq
movh m0, [srcq]
movh m1, [srcq+srcstrideq]
movh m2, [srcq+srcstrideq*2]
lea srcq, [srcq+srcstrideq*2]
add srcq, srcstrideq
movh m3, [srcq]
movh m4, [srcq+srcstrideq]
punpcklbw m0, m7
punpcklbw m1, m7
punpcklbw m2, m7
punpcklbw m3, m7
punpcklbw m4, m7
.nextrow
; first calculate negative taps (to prevent losing positive overflows)
mova m5, m1
pmullw m5, [myq+16]
mova m6, m4
pmullw m6, [myq+64]
paddsw m6, m5
; then calculate positive taps
movh m5, [srcq+2*srcstrideq] ; read new row
punpcklbw m5, m7
pmullw m0, [myq+0]
paddsw m6, m0
mova m0, m1
mova m1, m2
pmullw m2, [myq+32]
paddsw m6, m2
mova m2, m3
pmullw m3, [myq+48]
paddsw m6, m3
mova m3, m4
mova m4, m5
pmullw m5, [myq+80]
paddsw m6, m5
; round/clip/store
paddsw m6, [pw_64]
psraw m6, 7
packuswb m6, m7
movh [dstq], m6
; go to next line
add dstq, dststrideq
add srcq, srcstrideq
dec heightd ; next row
jg .nextrow
REP_RET
%endmacro
INIT_MMX mmx2
FILTER_V 4
INIT_XMM sse2
FILTER_V 8
%macro FILTER_BILINEAR 1
cglobal put_vp8_bilinear%1_v, 7, 7, 7, dst, dststride, src, srcstride, height, picreg, my
shl myd, 4
%ifdef PIC
lea picregq, [bilinear_filter_vw_m]
%endif
pxor m6, m6
mova m5, [bilinear_filter_vw+myq-1*16]
neg myq
mova m4, [bilinear_filter_vw+myq+7*16]
.nextrow
movh m0, [srcq+srcstrideq*0]
movh m1, [srcq+srcstrideq*1]
movh m3, [srcq+srcstrideq*2]
punpcklbw m0, m6
punpcklbw m1, m6
punpcklbw m3, m6
mova m2, m1
pmullw m0, m4
pmullw m1, m5
pmullw m2, m4
pmullw m3, m5
paddsw m0, m1
paddsw m2, m3
psraw m0, 2
psraw m2, 2
pavgw m0, m6
pavgw m2, m6
%if mmsize == 8
packuswb m0, m0
packuswb m2, m2
movh [dstq+dststrideq*0], m0
movh [dstq+dststrideq*1], m2
%else
packuswb m0, m2
movh [dstq+dststrideq*0], m0
movhps [dstq+dststrideq*1], m0
%endif
lea dstq, [dstq+dststrideq*2]
lea srcq, [srcq+srcstrideq*2]
sub heightd, 2
jg .nextrow
REP_RET
cglobal put_vp8_bilinear%1_h, 6, 6 + npicregs, 7, dst, dststride, src, srcstride, height, mx, picreg
shl mxd, 4
%ifdef PIC
lea picregq, [bilinear_filter_vw_m]
%endif
pxor m6, m6
mova m5, [bilinear_filter_vw+mxq-1*16]
neg mxq
mova m4, [bilinear_filter_vw+mxq+7*16]
.nextrow
movh m0, [srcq+srcstrideq*0+0]
movh m1, [srcq+srcstrideq*0+1]
movh m2, [srcq+srcstrideq*1+0]
movh m3, [srcq+srcstrideq*1+1]
punpcklbw m0, m6
punpcklbw m1, m6
punpcklbw m2, m6
punpcklbw m3, m6
pmullw m0, m4
pmullw m1, m5
pmullw m2, m4
pmullw m3, m5
paddsw m0, m1
paddsw m2, m3
psraw m0, 2
psraw m2, 2
pavgw m0, m6
pavgw m2, m6
%if mmsize == 8
packuswb m0, m0
packuswb m2, m2
movh [dstq+dststrideq*0], m0
movh [dstq+dststrideq*1], m2
%else
packuswb m0, m2
movh [dstq+dststrideq*0], m0
movhps [dstq+dststrideq*1], m0
%endif
lea dstq, [dstq+dststrideq*2]
lea srcq, [srcq+srcstrideq*2]
sub heightd, 2
jg .nextrow
REP_RET
%endmacro
INIT_MMX mmx2
FILTER_BILINEAR 4
INIT_XMM sse2
FILTER_BILINEAR 8
%macro FILTER_BILINEAR_SSSE3 1
cglobal put_vp8_bilinear%1_v, 7, 7, 5, dst, dststride, src, srcstride, height, picreg, my
shl myd, 4
%ifdef PIC
lea picregq, [bilinear_filter_vb_m]
%endif
pxor m4, m4
mova m3, [bilinear_filter_vb+myq-16]
.nextrow
movh m0, [srcq+srcstrideq*0]
movh m1, [srcq+srcstrideq*1]
movh m2, [srcq+srcstrideq*2]
punpcklbw m0, m1
punpcklbw m1, m2
pmaddubsw m0, m3
pmaddubsw m1, m3
psraw m0, 2
psraw m1, 2
pavgw m0, m4
pavgw m1, m4
%if mmsize==8
packuswb m0, m0
packuswb m1, m1
movh [dstq+dststrideq*0], m0
movh [dstq+dststrideq*1], m1
%else
packuswb m0, m1
movh [dstq+dststrideq*0], m0
movhps [dstq+dststrideq*1], m0
%endif
lea dstq, [dstq+dststrideq*2]
lea srcq, [srcq+srcstrideq*2]
sub heightd, 2
jg .nextrow
REP_RET
cglobal put_vp8_bilinear%1_h, 6, 6 + npicregs, 5, dst, dststride, src, srcstride, height, mx, picreg
shl mxd, 4
%ifdef PIC
lea picregq, [bilinear_filter_vb_m]
%endif
pxor m4, m4
mova m2, [filter_h2_shuf]
mova m3, [bilinear_filter_vb+mxq-16]
.nextrow
movu m0, [srcq+srcstrideq*0]
movu m1, [srcq+srcstrideq*1]
pshufb m0, m2
pshufb m1, m2
pmaddubsw m0, m3
pmaddubsw m1, m3
psraw m0, 2
psraw m1, 2
pavgw m0, m4
pavgw m1, m4
%if mmsize==8
packuswb m0, m0
packuswb m1, m1
movh [dstq+dststrideq*0], m0
movh [dstq+dststrideq*1], m1
%else
packuswb m0, m1
movh [dstq+dststrideq*0], m0
movhps [dstq+dststrideq*1], m0
%endif
lea dstq, [dstq+dststrideq*2]
lea srcq, [srcq+srcstrideq*2]
sub heightd, 2
jg .nextrow
REP_RET
%endmacro
INIT_MMX ssse3
FILTER_BILINEAR_SSSE3 4
INIT_XMM ssse3
FILTER_BILINEAR_SSSE3 8
INIT_MMX mmx
cglobal put_vp8_pixels8, 5, 5, 0, dst, dststride, src, srcstride, height
.nextrow:
movq mm0, [srcq+srcstrideq*0]
movq mm1, [srcq+srcstrideq*1]
lea srcq, [srcq+srcstrideq*2]
movq [dstq+dststrideq*0], mm0
movq [dstq+dststrideq*1], mm1
lea dstq, [dstq+dststrideq*2]
sub heightd, 2
jg .nextrow
REP_RET
%if ARCH_X86_32
INIT_MMX mmx
cglobal put_vp8_pixels16, 5, 5, 0, dst, dststride, src, srcstride, height
.nextrow:
movq mm0, [srcq+srcstrideq*0+0]
movq mm1, [srcq+srcstrideq*0+8]
movq mm2, [srcq+srcstrideq*1+0]
movq mm3, [srcq+srcstrideq*1+8]
lea srcq, [srcq+srcstrideq*2]
movq [dstq+dststrideq*0+0], mm0
movq [dstq+dststrideq*0+8], mm1
movq [dstq+dststrideq*1+0], mm2
movq [dstq+dststrideq*1+8], mm3
lea dstq, [dstq+dststrideq*2]
sub heightd, 2
jg .nextrow
REP_RET
%endif
INIT_XMM sse
cglobal put_vp8_pixels16, 5, 5, 2, dst, dststride, src, srcstride, height
.nextrow:
movups xmm0, [srcq+srcstrideq*0]
movups xmm1, [srcq+srcstrideq*1]
lea srcq, [srcq+srcstrideq*2]
movaps [dstq+dststrideq*0], xmm0
movaps [dstq+dststrideq*1], xmm1
lea dstq, [dstq+dststrideq*2]
sub heightd, 2
jg .nextrow
REP_RET
;-----------------------------------------------------------------------------
; void vp8_idct_dc_add_<opt>(uint8_t *dst, DCTELEM block[16], int stride);
;-----------------------------------------------------------------------------
%macro ADD_DC 4
%4 m2, [dst1q+%3]
%4 m3, [dst1q+strideq+%3]
%4 m4, [dst2q+%3]
%4 m5, [dst2q+strideq+%3]
paddusb m2, %1
paddusb m3, %1
paddusb m4, %1
paddusb m5, %1
psubusb m2, %2
psubusb m3, %2
psubusb m4, %2
psubusb m5, %2
%4 [dst1q+%3], m2
%4 [dst1q+strideq+%3], m3
%4 [dst2q+%3], m4
%4 [dst2q+strideq+%3], m5
%endmacro
INIT_MMX mmx
cglobal vp8_idct_dc_add, 3, 3, 0, dst, block, stride
; load data
movd m0, [blockq]
; calculate DC
paddw m0, [pw_4]
pxor m1, m1
psraw m0, 3
movd [blockq], m1
psubw m1, m0
packuswb m0, m0
packuswb m1, m1
punpcklbw m0, m0
punpcklbw m1, m1
punpcklwd m0, m0
punpcklwd m1, m1
; add DC
DEFINE_ARGS dst1, dst2, stride
lea dst2q, [dst1q+strideq*2]
ADD_DC m0, m1, 0, movh
RET
INIT_XMM sse4
cglobal vp8_idct_dc_add, 3, 3, 6, dst, block, stride
; load data
movd m0, [blockq]
pxor m1, m1
; calculate DC
paddw m0, [pw_4]
movd [blockq], m1
DEFINE_ARGS dst1, dst2, stride
lea dst2q, [dst1q+strideq*2]
movd m2, [dst1q]
movd m3, [dst1q+strideq]
movd m4, [dst2q]
movd m5, [dst2q+strideq]
psraw m0, 3
pshuflw m0, m0, 0
punpcklqdq m0, m0
punpckldq m2, m3
punpckldq m4, m5
punpcklbw m2, m1
punpcklbw m4, m1
paddw m2, m0
paddw m4, m0
packuswb m2, m4
movd [dst1q], m2
pextrd [dst1q+strideq], m2, 1
pextrd [dst2q], m2, 2
pextrd [dst2q+strideq], m2, 3
RET
;-----------------------------------------------------------------------------
; void vp8_idct_dc_add4y_<opt>(uint8_t *dst, DCTELEM block[4][16], int stride);
;-----------------------------------------------------------------------------
%if ARCH_X86_32
INIT_MMX mmx
cglobal vp8_idct_dc_add4y, 3, 3, 0, dst, block, stride
; load data
movd m0, [blockq+32*0] ; A
movd m1, [blockq+32*2] ; C
punpcklwd m0, [blockq+32*1] ; A B
punpcklwd m1, [blockq+32*3] ; C D
punpckldq m0, m1 ; A B C D
pxor m6, m6
; calculate DC
paddw m0, [pw_4]
movd [blockq+32*0], m6
movd [blockq+32*1], m6
movd [blockq+32*2], m6
movd [blockq+32*3], m6
psraw m0, 3
psubw m6, m0
packuswb m0, m0
packuswb m6, m6
punpcklbw m0, m0 ; AABBCCDD
punpcklbw m6, m6 ; AABBCCDD
movq m1, m0
movq m7, m6
punpcklbw m0, m0 ; AAAABBBB
punpckhbw m1, m1 ; CCCCDDDD
punpcklbw m6, m6 ; AAAABBBB
punpckhbw m7, m7 ; CCCCDDDD
; add DC
DEFINE_ARGS dst1, dst2, stride
lea dst2q, [dst1q+strideq*2]
ADD_DC m0, m6, 0, mova
ADD_DC m1, m7, 8, mova
RET
%endif
INIT_XMM sse2
cglobal vp8_idct_dc_add4y, 3, 3, 6, dst, block, stride
; load data
movd m0, [blockq+32*0] ; A
movd m1, [blockq+32*2] ; C
punpcklwd m0, [blockq+32*1] ; A B
punpcklwd m1, [blockq+32*3] ; C D
punpckldq m0, m1 ; A B C D
pxor m1, m1
; calculate DC
paddw m0, [pw_4]
movd [blockq+32*0], m1
movd [blockq+32*1], m1
movd [blockq+32*2], m1
movd [blockq+32*3], m1
psraw m0, 3
psubw m1, m0
packuswb m0, m0
packuswb m1, m1
punpcklbw m0, m0
punpcklbw m1, m1
punpcklbw m0, m0
punpcklbw m1, m1
; add DC
DEFINE_ARGS dst1, dst2, stride
lea dst2q, [dst1q+strideq*2]
ADD_DC m0, m1, 0, mova
RET
;-----------------------------------------------------------------------------
; void vp8_idct_dc_add4uv_<opt>(uint8_t *dst, DCTELEM block[4][16], int stride);
;-----------------------------------------------------------------------------
INIT_MMX mmx
cglobal vp8_idct_dc_add4uv, 3, 3, 0, dst, block, stride
; load data
movd m0, [blockq+32*0] ; A
movd m1, [blockq+32*2] ; C
punpcklwd m0, [blockq+32*1] ; A B
punpcklwd m1, [blockq+32*3] ; C D
punpckldq m0, m1 ; A B C D
pxor m6, m6
; calculate DC
paddw m0, [pw_4]
movd [blockq+32*0], m6
movd [blockq+32*1], m6
movd [blockq+32*2], m6
movd [blockq+32*3], m6
psraw m0, 3
psubw m6, m0
packuswb m0, m0
packuswb m6, m6
punpcklbw m0, m0 ; AABBCCDD
punpcklbw m6, m6 ; AABBCCDD
movq m1, m0
movq m7, m6
punpcklbw m0, m0 ; AAAABBBB
punpckhbw m1, m1 ; CCCCDDDD
punpcklbw m6, m6 ; AAAABBBB
punpckhbw m7, m7 ; CCCCDDDD
; add DC
DEFINE_ARGS dst1, dst2, stride
lea dst2q, [dst1q+strideq*2]
ADD_DC m0, m6, 0, mova
lea dst1q, [dst1q+strideq*4]
lea dst2q, [dst2q+strideq*4]
ADD_DC m1, m7, 0, mova
RET
;-----------------------------------------------------------------------------
; void vp8_idct_add_<opt>(uint8_t *dst, DCTELEM block[16], int stride);
;-----------------------------------------------------------------------------
; calculate %1=mul_35468(%1)-mul_20091(%2); %2=mul_20091(%1)+mul_35468(%2)
; this macro assumes that m6/m7 have words for 20091/17734 loaded
%macro VP8_MULTIPLY_SUMSUB 4
mova %3, %1
mova %4, %2
pmulhw %3, m6 ;20091(1)
pmulhw %4, m6 ;20091(2)
paddw %3, %1
paddw %4, %2
paddw %1, %1
paddw %2, %2
pmulhw %1, m7 ;35468(1)
pmulhw %2, m7 ;35468(2)
psubw %1, %4
paddw %2, %3
%endmacro
; calculate x0=%1+%3; x1=%1-%3
; x2=mul_35468(%2)-mul_20091(%4); x3=mul_20091(%2)+mul_35468(%4)
; %1=x0+x3 (tmp0); %2=x1+x2 (tmp1); %3=x1-x2 (tmp2); %4=x0-x3 (tmp3)
; %5/%6 are temporary registers
; we assume m6/m7 have constant words 20091/17734 loaded in them
%macro VP8_IDCT_TRANSFORM4x4_1D 6
SUMSUB_BA w, %3, %1, %5 ;t0, t1
VP8_MULTIPLY_SUMSUB m%2, m%4, m%5,m%6 ;t2, t3
SUMSUB_BA w, %4, %3, %5 ;tmp0, tmp3
SUMSUB_BA w, %2, %1, %5 ;tmp1, tmp2
SWAP %4, %1
SWAP %4, %3
%endmacro
%macro VP8_IDCT_ADD 0
cglobal vp8_idct_add, 3, 3, 0, dst, block, stride
; load block data
movq m0, [blockq+ 0]
movq m1, [blockq+ 8]
movq m2, [blockq+16]
movq m3, [blockq+24]
movq m6, [pw_20091]
movq m7, [pw_17734]
%if cpuflag(sse)
xorps xmm0, xmm0
movaps [blockq+ 0], xmm0
movaps [blockq+16], xmm0
%else
pxor m4, m4
movq [blockq+ 0], m4
movq [blockq+ 8], m4
movq [blockq+16], m4
movq [blockq+24], m4
%endif
; actual IDCT
VP8_IDCT_TRANSFORM4x4_1D 0, 1, 2, 3, 4, 5
TRANSPOSE4x4W 0, 1, 2, 3, 4
paddw m0, [pw_4]
VP8_IDCT_TRANSFORM4x4_1D 0, 1, 2, 3, 4, 5
TRANSPOSE4x4W 0, 1, 2, 3, 4
; store
pxor m4, m4
DEFINE_ARGS dst1, dst2, stride
lea dst2q, [dst1q+2*strideq]
STORE_DIFFx2 m0, m1, m6, m7, m4, 3, dst1q, strideq
STORE_DIFFx2 m2, m3, m6, m7, m4, 3, dst2q, strideq
RET
%endmacro
%if ARCH_X86_32
INIT_MMX mmx
VP8_IDCT_ADD
%endif
INIT_MMX sse
VP8_IDCT_ADD
;-----------------------------------------------------------------------------
; void vp8_luma_dc_wht_mmxext(DCTELEM block[4][4][16], DCTELEM dc[16])
;-----------------------------------------------------------------------------
%macro SCATTER_WHT 3
movd dc1d, m%1
movd dc2d, m%2
mov [blockq+2*16*(0+%3)], dc1w
mov [blockq+2*16*(1+%3)], dc2w
shr dc1d, 16
shr dc2d, 16
psrlq m%1, 32
psrlq m%2, 32
mov [blockq+2*16*(4+%3)], dc1w
mov [blockq+2*16*(5+%3)], dc2w
movd dc1d, m%1
movd dc2d, m%2
mov [blockq+2*16*(8+%3)], dc1w
mov [blockq+2*16*(9+%3)], dc2w
shr dc1d, 16
shr dc2d, 16
mov [blockq+2*16*(12+%3)], dc1w
mov [blockq+2*16*(13+%3)], dc2w
%endmacro
%macro HADAMARD4_1D 4
SUMSUB_BADC w, %2, %1, %4, %3
SUMSUB_BADC w, %4, %2, %3, %1
SWAP %1, %4, %3
%endmacro
%macro VP8_DC_WHT 0
cglobal vp8_luma_dc_wht, 2, 3, 0, block, dc1, dc2
movq m0, [dc1q]
movq m1, [dc1q+8]
movq m2, [dc1q+16]
movq m3, [dc1q+24]
%if cpuflag(sse)
xorps xmm0, xmm0
movaps [dc1q+ 0], xmm0
movaps [dc1q+16], xmm0
%else
pxor m4, m4
movq [dc1q+ 0], m4
movq [dc1q+ 8], m4
movq [dc1q+16], m4
movq [dc1q+24], m4
%endif
HADAMARD4_1D 0, 1, 2, 3
TRANSPOSE4x4W 0, 1, 2, 3, 4
paddw m0, [pw_3]
HADAMARD4_1D 0, 1, 2, 3
psraw m0, 3
psraw m1, 3
psraw m2, 3
psraw m3, 3
SCATTER_WHT 0, 1, 0
SCATTER_WHT 2, 3, 2
RET
%endmacro
%if ARCH_X86_32
INIT_MMX mmx
VP8_DC_WHT
%endif
INIT_MMX sse
VP8_DC_WHT
;-----------------------------------------------------------------------------
; void vp8_h/v_loop_filter_simple_<opt>(uint8_t *dst, int stride, int flim);
;-----------------------------------------------------------------------------
; macro called with 7 mm register indexes as argument, and 4 regular registers
;
; first 4 mm registers will carry the transposed pixel data
; the other three are scratchspace (one would be sufficient, but this allows
; for more spreading/pipelining and thus faster execution on OOE CPUs)
;
; first two regular registers are buf+4*stride and buf+5*stride
; third is -stride, fourth is +stride
%macro READ_8x4_INTERLEAVED 11
; interleave 8 (A-H) rows of 4 pixels each
movd m%1, [%8+%10*4] ; A0-3
movd m%5, [%9+%10*4] ; B0-3
movd m%2, [%8+%10*2] ; C0-3
movd m%6, [%8+%10] ; D0-3
movd m%3, [%8] ; E0-3
movd m%7, [%9] ; F0-3
movd m%4, [%9+%11] ; G0-3
punpcklbw m%1, m%5 ; A/B interleaved
movd m%5, [%9+%11*2] ; H0-3
punpcklbw m%2, m%6 ; C/D interleaved
punpcklbw m%3, m%7 ; E/F interleaved
punpcklbw m%4, m%5 ; G/H interleaved
%endmacro
; macro called with 7 mm register indexes as argument, and 5 regular registers
; first 11 mean the same as READ_8x4_TRANSPOSED above
; fifth regular register is scratchspace to reach the bottom 8 rows, it
; will be set to second regular register + 8*stride at the end
%macro READ_16x4_INTERLEAVED 12
; transpose 16 (A-P) rows of 4 pixels each
lea %12, [r0+8*r2]
; read (and interleave) those addressable by %8 (=r0), A/C/D/E/I/K/L/M
movd m%1, [%8+%10*4] ; A0-3
movd m%3, [%12+%10*4] ; I0-3
movd m%2, [%8+%10*2] ; C0-3
movd m%4, [%12+%10*2] ; K0-3
movd m%6, [%8+%10] ; D0-3
movd m%5, [%12+%10] ; L0-3
movd m%7, [%12] ; M0-3
add %12, %11
punpcklbw m%1, m%3 ; A/I
movd m%3, [%8] ; E0-3
punpcklbw m%2, m%4 ; C/K
punpcklbw m%6, m%5 ; D/L
punpcklbw m%3, m%7 ; E/M
punpcklbw m%2, m%6 ; C/D/K/L interleaved
; read (and interleave) those addressable by %9 (=r4), B/F/G/H/J/N/O/P
movd m%5, [%9+%10*4] ; B0-3
movd m%4, [%12+%10*4] ; J0-3
movd m%7, [%9] ; F0-3
movd m%6, [%12] ; N0-3
punpcklbw m%5, m%4 ; B/J
punpcklbw m%7, m%6 ; F/N
punpcklbw m%1, m%5 ; A/B/I/J interleaved
punpcklbw m%3, m%7 ; E/F/M/N interleaved
movd m%4, [%9+%11] ; G0-3
movd m%6, [%12+%11] ; O0-3
movd m%5, [%9+%11*2] ; H0-3
movd m%7, [%12+%11*2] ; P0-3
punpcklbw m%4, m%6 ; G/O
punpcklbw m%5, m%7 ; H/P
punpcklbw m%4, m%5 ; G/H/O/P interleaved
%endmacro
; write 4 mm registers of 2 dwords each
; first four arguments are mm register indexes containing source data
; last four are registers containing buf+4*stride, buf+5*stride,
; -stride and +stride
%macro WRITE_4x2D 8
; write out (2 dwords per register)
movd [%5+%7*4], m%1
movd [%5+%7*2], m%2
movd [%5], m%3
movd [%6+%8], m%4
punpckhdq m%1, m%1
punpckhdq m%2, m%2
punpckhdq m%3, m%3
punpckhdq m%4, m%4
movd [%6+%7*4], m%1
movd [%5+%7], m%2
movd [%6], m%3
movd [%6+%8*2], m%4
%endmacro
; write 4 xmm registers of 4 dwords each
; arguments same as WRITE_2x4D, but with an extra register, so that the 5 regular
; registers contain buf+4*stride, buf+5*stride, buf+12*stride, -stride and +stride
; we add 1*stride to the third regular registry in the process
; the 10th argument is 16 if it's a Y filter (i.e. all regular registers cover the
; same memory region), or 8 if they cover two separate buffers (third one points to
; a different memory region than the first two), allowing for more optimal code for
; the 16-width case
%macro WRITE_4x4D 10
; write out (4 dwords per register), start with dwords zero
movd [%5+%8*4], m%1
movd [%5], m%2
movd [%7+%8*4], m%3
movd [%7], m%4
; store dwords 1
psrldq m%1, 4
psrldq m%2, 4
psrldq m%3, 4
psrldq m%4, 4
movd [%6+%8*4], m%1
movd [%6], m%2
%if %10 == 16
movd [%6+%9*4], m%3
%endif
movd [%7+%9], m%4
; write dwords 2
psrldq m%1, 4
psrldq m%2, 4
%if %10 == 8
movd [%5+%8*2], m%1
movd %5d, m%3
%endif
psrldq m%3, 4
psrldq m%4, 4
%if %10 == 16
movd [%5+%8*2], m%1
%endif
movd [%6+%9], m%2
movd [%7+%8*2], m%3
movd [%7+%9*2], m%4
add %7, %9
; store dwords 3
psrldq m%1, 4
psrldq m%2, 4
psrldq m%3, 4
psrldq m%4, 4
%if %10 == 8
mov [%7+%8*4], %5d
movd [%6+%8*2], m%1
%else
movd [%5+%8], m%1
%endif
movd [%6+%9*2], m%2
movd [%7+%8*2], m%3
movd [%7+%9*2], m%4
%endmacro
; write 4 or 8 words in the mmx/xmm registers as 8 lines
; 1 and 2 are the registers to write, this can be the same (for SSE2)
; for pre-SSE4:
; 3 is a general-purpose register that we will clobber
; for SSE4:
; 3 is a pointer to the destination's 5th line
; 4 is a pointer to the destination's 4th line
; 5/6 is -stride and +stride
%macro WRITE_2x4W 6
movd %3d, %1
punpckhdq %1, %1
mov [%4+%5*4], %3w
shr %3, 16
add %4, %6
mov [%4+%5*4], %3w
movd %3d, %1
add %4, %5
mov [%4+%5*2], %3w
shr %3, 16
mov [%4+%5 ], %3w
movd %3d, %2
punpckhdq %2, %2
mov [%4 ], %3w
shr %3, 16
mov [%4+%6 ], %3w
movd %3d, %2
add %4, %6
mov [%4+%6 ], %3w
shr %3, 16
mov [%4+%6*2], %3w
add %4, %5
%endmacro
%macro WRITE_8W 5
%if cpuflag(sse4)
pextrw [%3+%4*4], %1, 0
pextrw [%2+%4*4], %1, 1
pextrw [%3+%4*2], %1, 2
pextrw [%3+%4 ], %1, 3
pextrw [%3 ], %1, 4
pextrw [%2 ], %1, 5
pextrw [%2+%5 ], %1, 6
pextrw [%2+%5*2], %1, 7
%else
movd %2d, %1
psrldq %1, 4
mov [%3+%4*4], %2w
shr %2, 16
add %3, %5
mov [%3+%4*4], %2w
movd %2d, %1
psrldq %1, 4
add %3, %4
mov [%3+%4*2], %2w
shr %2, 16
mov [%3+%4 ], %2w
movd %2d, %1
psrldq %1, 4
mov [%3 ], %2w
shr %2, 16
mov [%3+%5 ], %2w
movd %2d, %1
add %3, %5
mov [%3+%5 ], %2w
shr %2, 16
mov [%3+%5*2], %2w
%endif
%endmacro
%macro SPLATB_REG 2-3
%if cpuflag(ssse3)
movd %1, %2d
pshufb %1, %3
%elif cpuflag(sse2)
movd %1, %2d
punpcklbw %1, %1
pshuflw %1, %1, 0x0
punpcklqdq %1, %1
%elif cpuflag(mmx2)
movd %1, %2d
punpcklbw %1, %1
pshufw %1, %1, 0x0
%else
movd %1, %2d
punpcklbw %1, %1
punpcklwd %1, %1
punpckldq %1, %1
%endif
%endmacro
%macro SIMPLE_LOOPFILTER 2
cglobal vp8_%1_loop_filter_simple, 3, %2, 8, dst, stride, flim, cntr
%if mmsize == 8 ; mmx/mmxext
mov cntrq, 2
%endif
%if cpuflag(ssse3)
pxor m0, m0
%endif
SPLATB_REG m7, flim, m0 ; splat "flim" into register
; set up indexes to address 4 rows
%if mmsize == 8
DEFINE_ARGS dst1, mstride, stride, cntr, dst2
%else
DEFINE_ARGS dst1, mstride, stride, dst3, dst2
%endif
mov strideq, mstrideq
neg mstrideq
%ifidn %1, h
lea dst1q, [dst1q+4*strideq-2]
%endif
%if mmsize == 8 ; mmx / mmxext
.next8px
%endif
%ifidn %1, v
; read 4 half/full rows of pixels
mova m0, [dst1q+mstrideq*2] ; p1
mova m1, [dst1q+mstrideq] ; p0
mova m2, [dst1q] ; q0
mova m3, [dst1q+ strideq] ; q1
%else ; h
lea dst2q, [dst1q+ strideq]
%if mmsize == 8 ; mmx/mmxext
READ_8x4_INTERLEAVED 0, 1, 2, 3, 4, 5, 6, dst1q, dst2q, mstrideq, strideq
%else ; sse2
READ_16x4_INTERLEAVED 0, 1, 2, 3, 4, 5, 6, dst1q, dst2q, mstrideq, strideq, dst3q
%endif
TRANSPOSE4x4W 0, 1, 2, 3, 4
%endif
; simple_limit
mova m5, m2 ; m5=backup of q0
mova m6, m1 ; m6=backup of p0
psubusb m1, m2 ; p0-q0
psubusb m2, m6 ; q0-p0
por m1, m2 ; FFABS(p0-q0)
paddusb m1, m1 ; m1=FFABS(p0-q0)*2
mova m4, m3
mova m2, m0
psubusb m3, m0 ; q1-p1
psubusb m0, m4 ; p1-q1
por m3, m0 ; FFABS(p1-q1)
mova m0, [pb_80]
pxor m2, m0
pxor m4, m0
psubsb m2, m4 ; m2=p1-q1 (signed) backup for below
pand m3, [pb_FE]
psrlq m3, 1 ; m3=FFABS(p1-q1)/2, this can be used signed
paddusb m3, m1
psubusb m3, m7
pxor m1, m1
pcmpeqb m3, m1 ; abs(p0-q0)*2+abs(p1-q1)/2<=flim mask(0xff/0x0)
; filter_common (use m2/p1-q1, m4=q0, m6=p0, m5/q0-p0 and m3/mask)
mova m4, m5
pxor m5, m0
pxor m0, m6
psubsb m5, m0 ; q0-p0 (signed)
paddsb m2, m5
paddsb m2, m5
paddsb m2, m5 ; a=(p1-q1) + 3*(q0-p0)
pand m2, m3 ; apply filter mask (m3)
mova m3, [pb_F8]
mova m1, m2
paddsb m2, [pb_4] ; f1<<3=a+4
paddsb m1, [pb_3] ; f2<<3=a+3
pand m2, m3
pand m1, m3 ; cache f2<<3
pxor m0, m0
pxor m3, m3
pcmpgtb m0, m2 ; which values are <0?
psubb m3, m2 ; -f1<<3
psrlq m2, 3 ; +f1
psrlq m3, 3 ; -f1
pand m3, m0
pandn m0, m2
psubusb m4, m0
paddusb m4, m3 ; q0-f1
pxor m0, m0
pxor m3, m3
pcmpgtb m0, m1 ; which values are <0?
psubb m3, m1 ; -f2<<3
psrlq m1, 3 ; +f2
psrlq m3, 3 ; -f2
pand m3, m0
pandn m0, m1
paddusb m6, m0
psubusb m6, m3 ; p0+f2
; store
%ifidn %1, v
mova [dst1q], m4
mova [dst1q+mstrideq], m6
%else ; h
inc dst1q
SBUTTERFLY bw, 6, 4, 0
%if mmsize == 16 ; sse2
%if cpuflag(sse4)
inc dst2q
%endif
WRITE_8W m6, dst2q, dst1q, mstrideq, strideq
lea dst2q, [dst3q+mstrideq+1]
%if cpuflag(sse4)
inc dst3q
%endif
WRITE_8W m4, dst3q, dst2q, mstrideq, strideq
%else ; mmx/mmxext
WRITE_2x4W m6, m4, dst2q, dst1q, mstrideq, strideq
%endif
%endif
%if mmsize == 8 ; mmx/mmxext
; next 8 pixels
%ifidn %1, v
add dst1q, 8 ; advance 8 cols = pixels
%else ; h
lea dst1q, [dst1q+strideq*8-1] ; advance 8 rows = lines
%endif
dec cntrq
jg .next8px
REP_RET
%else ; sse2
RET
%endif
%endmacro
%if ARCH_X86_32
INIT_MMX mmx
SIMPLE_LOOPFILTER v, 4
SIMPLE_LOOPFILTER h, 5
INIT_MMX mmx2
SIMPLE_LOOPFILTER v, 4
SIMPLE_LOOPFILTER h, 5
%endif
INIT_XMM sse2
SIMPLE_LOOPFILTER v, 3
SIMPLE_LOOPFILTER h, 5
INIT_XMM ssse3
SIMPLE_LOOPFILTER v, 3
SIMPLE_LOOPFILTER h, 5
INIT_XMM sse4
SIMPLE_LOOPFILTER h, 5
;-----------------------------------------------------------------------------
; void vp8_h/v_loop_filter<size>_inner_<opt>(uint8_t *dst, [uint8_t *v,] int stride,
; int flimE, int flimI, int hev_thr);
;-----------------------------------------------------------------------------
%macro INNER_LOOPFILTER 2
%if %2 == 8 ; chroma
cglobal vp8_%1_loop_filter8uv_inner, 6, 6, 13, dst, dst8, stride, flimE, flimI, hevthr
%else ; luma
cglobal vp8_%1_loop_filter16y_inner, 5, 5, 13, dst, stride, flimE, flimI, hevthr
%endif
%if cpuflag(ssse3)
pxor m7, m7
%endif
%ifndef m8 ; stack layout: [0]=E, [1]=I, [2]=hev_thr
%ifidn %1, v ; [3]=hev() result
%assign pad 16 + mmsize * 4 - gprsize - (stack_offset & 15)
%else ; h ; extra storage space for transposes
%assign pad 16 + mmsize * 5 - gprsize - (stack_offset & 15)
%endif
; splat function arguments
SPLATB_REG m0, flimEq, m7 ; E
SPLATB_REG m1, flimIq, m7 ; I
SPLATB_REG m2, hevthrq, m7 ; hev_thresh
SUB rsp, pad
%define m_flimE [rsp]
%define m_flimI [rsp+mmsize]
%define m_hevthr [rsp+mmsize*2]
%define m_maskres [rsp+mmsize*3]
%define m_p0backup [rsp+mmsize*3]
%define m_q0backup [rsp+mmsize*4]
mova m_flimE, m0
mova m_flimI, m1
mova m_hevthr, m2
%else
%define m_flimE m9
%define m_flimI m10
%define m_hevthr m11
%define m_maskres m12
%define m_p0backup m12
%define m_q0backup m8
; splat function arguments
SPLATB_REG m_flimE, flimEq, m7 ; E
SPLATB_REG m_flimI, flimIq, m7 ; I
SPLATB_REG m_hevthr, hevthrq, m7 ; hev_thresh
%endif
%if %2 == 8 ; chroma
DEFINE_ARGS dst1, dst8, mstride, stride, dst2
%elif mmsize == 8
DEFINE_ARGS dst1, mstride, stride, dst2, cntr
mov cntrq, 2
%else
DEFINE_ARGS dst1, mstride, stride, dst2, dst8
%endif
mov strideq, mstrideq
neg mstrideq
%ifidn %1, h
lea dst1q, [dst1q+strideq*4-4]
%if %2 == 8 ; chroma
lea dst8q, [dst8q+strideq*4-4]
%endif
%endif
%if mmsize == 8
.next8px:
%endif
; read
lea dst2q, [dst1q+strideq]
%ifidn %1, v
%if %2 == 8 && mmsize == 16
%define movrow movh
%else
%define movrow mova
%endif
movrow m0, [dst1q+mstrideq*4] ; p3
movrow m1, [dst2q+mstrideq*4] ; p2
movrow m2, [dst1q+mstrideq*2] ; p1
movrow m5, [dst2q] ; q1
movrow m6, [dst2q+ strideq*1] ; q2
movrow m7, [dst2q+ strideq*2] ; q3
%if mmsize == 16 && %2 == 8
movhps m0, [dst8q+mstrideq*4]
movhps m2, [dst8q+mstrideq*2]
add dst8q, strideq
movhps m1, [dst8q+mstrideq*4]
movhps m5, [dst8q]
movhps m6, [dst8q+ strideq ]
movhps m7, [dst8q+ strideq*2]
add dst8q, mstrideq
%endif
%elif mmsize == 8 ; mmx/mmxext (h)
; read 8 rows of 8px each
movu m0, [dst1q+mstrideq*4]
movu m1, [dst2q+mstrideq*4]
movu m2, [dst1q+mstrideq*2]
movu m3, [dst1q+mstrideq ]
movu m4, [dst1q]
movu m5, [dst2q]
movu m6, [dst2q+ strideq ]
; 8x8 transpose
TRANSPOSE4x4B 0, 1, 2, 3, 7
mova m_q0backup, m1
movu m7, [dst2q+ strideq*2]
TRANSPOSE4x4B 4, 5, 6, 7, 1
SBUTTERFLY dq, 0, 4, 1 ; p3/p2
SBUTTERFLY dq, 2, 6, 1 ; q0/q1
SBUTTERFLY dq, 3, 7, 1 ; q2/q3
mova m1, m_q0backup
mova m_q0backup, m2 ; store q0
SBUTTERFLY dq, 1, 5, 2 ; p1/p0
mova m_p0backup, m5 ; store p0
SWAP 1, 4
SWAP 2, 4
SWAP 6, 3
SWAP 5, 3
%else ; sse2 (h)
%if %2 == 16
lea dst8q, [dst1q+ strideq*8]
%endif
; read 16 rows of 8px each, interleave
movh m0, [dst1q+mstrideq*4]
movh m1, [dst8q+mstrideq*4]
movh m2, [dst1q+mstrideq*2]
movh m5, [dst8q+mstrideq*2]
movh m3, [dst1q+mstrideq ]
movh m6, [dst8q+mstrideq ]
movh m4, [dst1q]
movh m7, [dst8q]
punpcklbw m0, m1 ; A/I
punpcklbw m2, m5 ; C/K
punpcklbw m3, m6 ; D/L
punpcklbw m4, m7 ; E/M
add dst8q, strideq
movh m1, [dst2q+mstrideq*4]
movh m6, [dst8q+mstrideq*4]
movh m5, [dst2q]
movh m7, [dst8q]
punpcklbw m1, m6 ; B/J
punpcklbw m5, m7 ; F/N
movh m6, [dst2q+ strideq ]
movh m7, [dst8q+ strideq ]
punpcklbw m6, m7 ; G/O
; 8x16 transpose
TRANSPOSE4x4B 0, 1, 2, 3, 7
%ifdef m8
SWAP 1, 8
%else
mova m_q0backup, m1
%endif
movh m7, [dst2q+ strideq*2]
movh m1, [dst8q+ strideq*2]
punpcklbw m7, m1 ; H/P
TRANSPOSE4x4B 4, 5, 6, 7, 1
SBUTTERFLY dq, 0, 4, 1 ; p3/p2
SBUTTERFLY dq, 2, 6, 1 ; q0/q1
SBUTTERFLY dq, 3, 7, 1 ; q2/q3
%ifdef m8
SWAP 1, 8
SWAP 2, 8
%else
mova m1, m_q0backup
mova m_q0backup, m2 ; store q0
%endif
SBUTTERFLY dq, 1, 5, 2 ; p1/p0
%ifdef m12
SWAP 5, 12
%else
mova m_p0backup, m5 ; store p0
%endif
SWAP 1, 4
SWAP 2, 4
SWAP 6, 3
SWAP 5, 3
%endif
; normal_limit for p3-p2, p2-p1, q3-q2 and q2-q1
mova m4, m1
SWAP 4, 1
psubusb m4, m0 ; p2-p3
psubusb m0, m1 ; p3-p2
por m0, m4 ; abs(p3-p2)
mova m4, m2
SWAP 4, 2
psubusb m4, m1 ; p1-p2
psubusb m1, m2 ; p2-p1
por m1, m4 ; abs(p2-p1)
mova m4, m6
SWAP 4, 6
psubusb m4, m7 ; q2-q3
psubusb m7, m6 ; q3-q2
por m7, m4 ; abs(q3-q2)
mova m4, m5
SWAP 4, 5
psubusb m4, m6 ; q1-q2
psubusb m6, m5 ; q2-q1
por m6, m4 ; abs(q2-q1)
%if notcpuflag(mmx2)
mova m4, m_flimI
pxor m3, m3
psubusb m0, m4
psubusb m1, m4
psubusb m7, m4
psubusb m6, m4
pcmpeqb m0, m3 ; abs(p3-p2) <= I
pcmpeqb m1, m3 ; abs(p2-p1) <= I
pcmpeqb m7, m3 ; abs(q3-q2) <= I
pcmpeqb m6, m3 ; abs(q2-q1) <= I
pand m0, m1
pand m7, m6
pand m0, m7
%else ; mmxext/sse2
pmaxub m0, m1
pmaxub m6, m7
pmaxub m0, m6
%endif
; normal_limit and high_edge_variance for p1-p0, q1-q0
SWAP 7, 3 ; now m7 is zero
%ifidn %1, v
movrow m3, [dst1q+mstrideq ] ; p0
%if mmsize == 16 && %2 == 8
movhps m3, [dst8q+mstrideq ]
%endif
%elifdef m12
SWAP 3, 12
%else
mova m3, m_p0backup
%endif
mova m1, m2
SWAP 1, 2
mova m6, m3
SWAP 3, 6
psubusb m1, m3 ; p1-p0
psubusb m6, m2 ; p0-p1
por m1, m6 ; abs(p1-p0)
%if notcpuflag(mmx2)
mova m6, m1
psubusb m1, m4
psubusb m6, m_hevthr
pcmpeqb m1, m7 ; abs(p1-p0) <= I
pcmpeqb m6, m7 ; abs(p1-p0) <= hev_thresh
pand m0, m1
mova m_maskres, m6
%else ; mmxext/sse2
pmaxub m0, m1 ; max_I
SWAP 1, 4 ; max_hev_thresh
%endif
SWAP 6, 4 ; now m6 is I
%ifidn %1, v
movrow m4, [dst1q] ; q0
%if mmsize == 16 && %2 == 8
movhps m4, [dst8q]
%endif
%elifdef m8
SWAP 4, 8
%else
mova m4, m_q0backup
%endif
mova m1, m4
SWAP 1, 4
mova m7, m5
SWAP 7, 5
psubusb m1, m5 ; q0-q1
psubusb m7, m4 ; q1-q0
por m1, m7 ; abs(q1-q0)
%if notcpuflag(mmx2)
mova m7, m1
psubusb m1, m6
psubusb m7, m_hevthr
pxor m6, m6
pcmpeqb m1, m6 ; abs(q1-q0) <= I
pcmpeqb m7, m6 ; abs(q1-q0) <= hev_thresh
mova m6, m_maskres
pand m0, m1 ; abs([pq][321]-[pq][210]) <= I
pand m6, m7
%else ; mmxext/sse2
pxor m7, m7
pmaxub m0, m1
pmaxub m6, m1
psubusb m0, m_flimI
psubusb m6, m_hevthr
pcmpeqb m0, m7 ; max(abs(..)) <= I
pcmpeqb m6, m7 ; !(max(abs..) > thresh)
%endif
%ifdef m12
SWAP 6, 12
%else
mova m_maskres, m6 ; !(abs(p1-p0) > hev_t || abs(q1-q0) > hev_t)
%endif
; simple_limit
mova m1, m3
SWAP 1, 3
mova m6, m4 ; keep copies of p0/q0 around for later use
SWAP 6, 4
psubusb m1, m4 ; p0-q0
psubusb m6, m3 ; q0-p0
por m1, m6 ; abs(q0-p0)
paddusb m1, m1 ; m1=2*abs(q0-p0)
mova m7, m2
SWAP 7, 2
mova m6, m5
SWAP 6, 5
psubusb m7, m5 ; p1-q1
psubusb m6, m2 ; q1-p1
por m7, m6 ; abs(q1-p1)
pxor m6, m6
pand m7, [pb_FE]
psrlq m7, 1 ; abs(q1-p1)/2
paddusb m7, m1 ; abs(q0-p0)*2+abs(q1-p1)/2
psubusb m7, m_flimE
pcmpeqb m7, m6 ; abs(q0-p0)*2+abs(q1-p1)/2 <= E
pand m0, m7 ; normal_limit result
; filter_common; at this point, m2-m5=p1-q1 and m0 is filter_mask
%ifdef m8 ; x86-64 && sse2
mova m8, [pb_80]
%define m_pb_80 m8
%else ; x86-32 or mmx/mmxext
%define m_pb_80 [pb_80]
%endif
mova m1, m4
mova m7, m3
pxor m1, m_pb_80
pxor m7, m_pb_80
psubsb m1, m7 ; (signed) q0-p0
mova m6, m2
mova m7, m5
pxor m6, m_pb_80
pxor m7, m_pb_80
psubsb m6, m7 ; (signed) p1-q1
mova m7, m_maskres
pandn m7, m6
paddsb m7, m1
paddsb m7, m1
paddsb m7, m1 ; 3*(q0-p0)+is4tap?(p1-q1)
pand m7, m0
mova m1, [pb_F8]
mova m6, m7
paddsb m7, [pb_3]
paddsb m6, [pb_4]
pand m7, m1
pand m6, m1
pxor m1, m1
pxor m0, m0
pcmpgtb m1, m7
psubb m0, m7
psrlq m7, 3 ; +f2
psrlq m0, 3 ; -f2
pand m0, m1
pandn m1, m7
psubusb m3, m0
paddusb m3, m1 ; p0+f2
pxor m1, m1
pxor m0, m0
pcmpgtb m0, m6
psubb m1, m6
psrlq m6, 3 ; +f1
psrlq m1, 3 ; -f1
pand m1, m0
pandn m0, m6
psubusb m4, m0
paddusb m4, m1 ; q0-f1
%ifdef m12
SWAP 6, 12
%else
mova m6, m_maskres
%endif
%if notcpuflag(mmx2)
mova m7, [pb_1]
%else ; mmxext/sse2
pxor m7, m7
%endif
pand m0, m6
pand m1, m6
%if notcpuflag(mmx2)
paddusb m0, m7
pand m1, [pb_FE]
pandn m7, m0
psrlq m1, 1
psrlq m7, 1
SWAP 0, 7
%else ; mmxext/sse2
psubusb m1, [pb_1]
pavgb m0, m7 ; a
pavgb m1, m7 ; -a
%endif
psubusb m5, m0
psubusb m2, m1
paddusb m5, m1 ; q1-a
paddusb m2, m0 ; p1+a
; store
%ifidn %1, v
movrow [dst1q+mstrideq*2], m2
movrow [dst1q+mstrideq ], m3
movrow [dst1q], m4
movrow [dst1q+ strideq ], m5
%if mmsize == 16 && %2 == 8
movhps [dst8q+mstrideq*2], m2
movhps [dst8q+mstrideq ], m3
movhps [dst8q], m4
movhps [dst8q+ strideq ], m5
%endif
%else ; h
add dst1q, 2
add dst2q, 2
; 4x8/16 transpose
TRANSPOSE4x4B 2, 3, 4, 5, 6
%if mmsize == 8 ; mmx/mmxext (h)
WRITE_4x2D 2, 3, 4, 5, dst1q, dst2q, mstrideq, strideq
%else ; sse2 (h)
lea dst8q, [dst8q+mstrideq +2]
WRITE_4x4D 2, 3, 4, 5, dst1q, dst2q, dst8q, mstrideq, strideq, %2
%endif
%endif
%if mmsize == 8
%if %2 == 8 ; chroma
%ifidn %1, h
sub dst1q, 2
%endif
cmp dst1q, dst8q
mov dst1q, dst8q
jnz .next8px
%else
%ifidn %1, h
lea dst1q, [dst1q+ strideq*8-2]
%else ; v
add dst1q, 8
%endif
dec cntrq
jg .next8px
%endif
%endif
%ifndef m8 ; sse2 on x86-32 or mmx/mmxext
ADD rsp, pad
%endif
RET
%endmacro
%if ARCH_X86_32
INIT_MMX mmx
INNER_LOOPFILTER v, 16
INNER_LOOPFILTER h, 16
INNER_LOOPFILTER v, 8
INNER_LOOPFILTER h, 8
INIT_MMX mmx2
INNER_LOOPFILTER v, 16
INNER_LOOPFILTER h, 16
INNER_LOOPFILTER v, 8
INNER_LOOPFILTER h, 8
%endif
INIT_XMM sse2
INNER_LOOPFILTER v, 16
INNER_LOOPFILTER h, 16
INNER_LOOPFILTER v, 8
INNER_LOOPFILTER h, 8
INIT_XMM ssse3
INNER_LOOPFILTER v, 16
INNER_LOOPFILTER h, 16
INNER_LOOPFILTER v, 8
INNER_LOOPFILTER h, 8
;-----------------------------------------------------------------------------
; void vp8_h/v_loop_filter<size>_mbedge_<opt>(uint8_t *dst, [uint8_t *v,] int stride,
; int flimE, int flimI, int hev_thr);
;-----------------------------------------------------------------------------
%macro MBEDGE_LOOPFILTER 2
%if %2 == 8 ; chroma
cglobal vp8_%1_loop_filter8uv_mbedge, 6, 6, 15, dst1, dst8, stride, flimE, flimI, hevthr
%else ; luma
cglobal vp8_%1_loop_filter16y_mbedge, 5, 5, 15, dst1, stride, flimE, flimI, hevthr
%endif
%if cpuflag(ssse3)
pxor m7, m7
%endif
%ifndef m8 ; stack layout: [0]=E, [1]=I, [2]=hev_thr
%if mmsize == 16 ; [3]=hev() result
; [4]=filter tmp result
; [5]/[6] = p2/q2 backup
; [7]=lim_res sign result
%assign pad 16 + mmsize * 7 - gprsize - (stack_offset & 15)
%else ; 8 ; extra storage space for transposes
%assign pad 16 + mmsize * 8 - gprsize - (stack_offset & 15)
%endif
; splat function arguments
SPLATB_REG m0, flimEq, m7 ; E
SPLATB_REG m1, flimIq, m7 ; I
SPLATB_REG m2, hevthrq, m7 ; hev_thresh
SUB rsp, pad
%define m_flimE [rsp]
%define m_flimI [rsp+mmsize]
%define m_hevthr [rsp+mmsize*2]
%define m_maskres [rsp+mmsize*3]
%define m_limres [rsp+mmsize*4]
%define m_p0backup [rsp+mmsize*3]
%define m_q0backup [rsp+mmsize*4]
%define m_p2backup [rsp+mmsize*5]
%define m_q2backup [rsp+mmsize*6]
%if mmsize == 16
%define m_limsign [rsp]
%else
%define m_limsign [rsp+mmsize*7]
%endif
mova m_flimE, m0
mova m_flimI, m1
mova m_hevthr, m2
%else ; sse2 on x86-64
%define m_flimE m9
%define m_flimI m10
%define m_hevthr m11
%define m_maskres m12
%define m_limres m8
%define m_p0backup m12
%define m_q0backup m8
%define m_p2backup m13
%define m_q2backup m14
%define m_limsign m9
; splat function arguments
SPLATB_REG m_flimE, flimEq, m7 ; E
SPLATB_REG m_flimI, flimIq, m7 ; I
SPLATB_REG m_hevthr, hevthrq, m7 ; hev_thresh
%endif
%if %2 == 8 ; chroma
DEFINE_ARGS dst1, dst8, mstride, stride, dst2
%elif mmsize == 8
DEFINE_ARGS dst1, mstride, stride, dst2, cntr
mov cntrq, 2
%else
DEFINE_ARGS dst1, mstride, stride, dst2, dst8
%endif
mov strideq, mstrideq
neg mstrideq
%ifidn %1, h
lea dst1q, [dst1q+strideq*4-4]
%if %2 == 8 ; chroma
lea dst8q, [dst8q+strideq*4-4]
%endif
%endif
%if mmsize == 8
.next8px:
%endif
; read
lea dst2q, [dst1q+ strideq ]
%ifidn %1, v
%if %2 == 8 && mmsize == 16
%define movrow movh
%else
%define movrow mova
%endif
movrow m0, [dst1q+mstrideq*4] ; p3
movrow m1, [dst2q+mstrideq*4] ; p2
movrow m2, [dst1q+mstrideq*2] ; p1
movrow m5, [dst2q] ; q1
movrow m6, [dst2q+ strideq ] ; q2
movrow m7, [dst2q+ strideq*2] ; q3
%if mmsize == 16 && %2 == 8
movhps m0, [dst8q+mstrideq*4]
movhps m2, [dst8q+mstrideq*2]
add dst8q, strideq
movhps m1, [dst8q+mstrideq*4]
movhps m5, [dst8q]
movhps m6, [dst8q+ strideq ]
movhps m7, [dst8q+ strideq*2]
add dst8q, mstrideq
%endif
%elif mmsize == 8 ; mmx/mmxext (h)
; read 8 rows of 8px each
movu m0, [dst1q+mstrideq*4]
movu m1, [dst2q+mstrideq*4]
movu m2, [dst1q+mstrideq*2]
movu m3, [dst1q+mstrideq ]
movu m4, [dst1q]
movu m5, [dst2q]
movu m6, [dst2q+ strideq ]
; 8x8 transpose
TRANSPOSE4x4B 0, 1, 2, 3, 7
mova m_q0backup, m1
movu m7, [dst2q+ strideq*2]
TRANSPOSE4x4B 4, 5, 6, 7, 1
SBUTTERFLY dq, 0, 4, 1 ; p3/p2
SBUTTERFLY dq, 2, 6, 1 ; q0/q1
SBUTTERFLY dq, 3, 7, 1 ; q2/q3
mova m1, m_q0backup
mova m_q0backup, m2 ; store q0
SBUTTERFLY dq, 1, 5, 2 ; p1/p0
mova m_p0backup, m5 ; store p0
SWAP 1, 4
SWAP 2, 4
SWAP 6, 3
SWAP 5, 3
%else ; sse2 (h)
%if %2 == 16
lea dst8q, [dst1q+ strideq*8 ]
%endif
; read 16 rows of 8px each, interleave
movh m0, [dst1q+mstrideq*4]
movh m1, [dst8q+mstrideq*4]
movh m2, [dst1q+mstrideq*2]
movh m5, [dst8q+mstrideq*2]
movh m3, [dst1q+mstrideq ]
movh m6, [dst8q+mstrideq ]
movh m4, [dst1q]
movh m7, [dst8q]
punpcklbw m0, m1 ; A/I
punpcklbw m2, m5 ; C/K
punpcklbw m3, m6 ; D/L
punpcklbw m4, m7 ; E/M
add dst8q, strideq
movh m1, [dst2q+mstrideq*4]
movh m6, [dst8q+mstrideq*4]
movh m5, [dst2q]
movh m7, [dst8q]
punpcklbw m1, m6 ; B/J
punpcklbw m5, m7 ; F/N
movh m6, [dst2q+ strideq ]
movh m7, [dst8q+ strideq ]
punpcklbw m6, m7 ; G/O
; 8x16 transpose
TRANSPOSE4x4B 0, 1, 2, 3, 7
%ifdef m8
SWAP 1, 8
%else
mova m_q0backup, m1
%endif
movh m7, [dst2q+ strideq*2]
movh m1, [dst8q+ strideq*2]
punpcklbw m7, m1 ; H/P
TRANSPOSE4x4B 4, 5, 6, 7, 1
SBUTTERFLY dq, 0, 4, 1 ; p3/p2
SBUTTERFLY dq, 2, 6, 1 ; q0/q1
SBUTTERFLY dq, 3, 7, 1 ; q2/q3
%ifdef m8
SWAP 1, 8
SWAP 2, 8
%else
mova m1, m_q0backup
mova m_q0backup, m2 ; store q0
%endif
SBUTTERFLY dq, 1, 5, 2 ; p1/p0
%ifdef m12
SWAP 5, 12
%else
mova m_p0backup, m5 ; store p0
%endif
SWAP 1, 4
SWAP 2, 4
SWAP 6, 3
SWAP 5, 3
%endif
; normal_limit for p3-p2, p2-p1, q3-q2 and q2-q1
mova m4, m1
SWAP 4, 1
psubusb m4, m0 ; p2-p3
psubusb m0, m1 ; p3-p2
por m0, m4 ; abs(p3-p2)
mova m4, m2
SWAP 4, 2
psubusb m4, m1 ; p1-p2
mova m_p2backup, m1
psubusb m1, m2 ; p2-p1
por m1, m4 ; abs(p2-p1)
mova m4, m6
SWAP 4, 6
psubusb m4, m7 ; q2-q3
psubusb m7, m6 ; q3-q2
por m7, m4 ; abs(q3-q2)
mova m4, m5
SWAP 4, 5
psubusb m4, m6 ; q1-q2
mova m_q2backup, m6
psubusb m6, m5 ; q2-q1
por m6, m4 ; abs(q2-q1)
%if notcpuflag(mmx2)
mova m4, m_flimI
pxor m3, m3
psubusb m0, m4
psubusb m1, m4
psubusb m7, m4
psubusb m6, m4
pcmpeqb m0, m3 ; abs(p3-p2) <= I
pcmpeqb m1, m3 ; abs(p2-p1) <= I
pcmpeqb m7, m3 ; abs(q3-q2) <= I
pcmpeqb m6, m3 ; abs(q2-q1) <= I
pand m0, m1
pand m7, m6
pand m0, m7
%else ; mmxext/sse2
pmaxub m0, m1
pmaxub m6, m7
pmaxub m0, m6
%endif
; normal_limit and high_edge_variance for p1-p0, q1-q0
SWAP 7, 3 ; now m7 is zero
%ifidn %1, v
movrow m3, [dst1q+mstrideq ] ; p0
%if mmsize == 16 && %2 == 8
movhps m3, [dst8q+mstrideq ]
%endif
%elifdef m12
SWAP 3, 12
%else
mova m3, m_p0backup
%endif
mova m1, m2
SWAP 1, 2
mova m6, m3
SWAP 3, 6
psubusb m1, m3 ; p1-p0
psubusb m6, m2 ; p0-p1
por m1, m6 ; abs(p1-p0)
%if notcpuflag(mmx2)
mova m6, m1
psubusb m1, m4
psubusb m6, m_hevthr
pcmpeqb m1, m7 ; abs(p1-p0) <= I
pcmpeqb m6, m7 ; abs(p1-p0) <= hev_thresh
pand m0, m1
mova m_maskres, m6
%else ; mmxext/sse2
pmaxub m0, m1 ; max_I
SWAP 1, 4 ; max_hev_thresh
%endif
SWAP 6, 4 ; now m6 is I
%ifidn %1, v
movrow m4, [dst1q] ; q0
%if mmsize == 16 && %2 == 8
movhps m4, [dst8q]
%endif
%elifdef m8
SWAP 4, 8
%else
mova m4, m_q0backup
%endif
mova m1, m4
SWAP 1, 4
mova m7, m5
SWAP 7, 5
psubusb m1, m5 ; q0-q1
psubusb m7, m4 ; q1-q0
por m1, m7 ; abs(q1-q0)
%if notcpuflag(mmx2)
mova m7, m1
psubusb m1, m6
psubusb m7, m_hevthr
pxor m6, m6
pcmpeqb m1, m6 ; abs(q1-q0) <= I
pcmpeqb m7, m6 ; abs(q1-q0) <= hev_thresh
mova m6, m_maskres
pand m0, m1 ; abs([pq][321]-[pq][210]) <= I
pand m6, m7
%else ; mmxext/sse2
pxor m7, m7
pmaxub m0, m1
pmaxub m6, m1
psubusb m0, m_flimI
psubusb m6, m_hevthr
pcmpeqb m0, m7 ; max(abs(..)) <= I
pcmpeqb m6, m7 ; !(max(abs..) > thresh)
%endif
%ifdef m12
SWAP 6, 12
%else
mova m_maskres, m6 ; !(abs(p1-p0) > hev_t || abs(q1-q0) > hev_t)
%endif
; simple_limit
mova m1, m3
SWAP 1, 3
mova m6, m4 ; keep copies of p0/q0 around for later use
SWAP 6, 4
psubusb m1, m4 ; p0-q0
psubusb m6, m3 ; q0-p0
por m1, m6 ; abs(q0-p0)
paddusb m1, m1 ; m1=2*abs(q0-p0)
mova m7, m2
SWAP 7, 2
mova m6, m5
SWAP 6, 5
psubusb m7, m5 ; p1-q1
psubusb m6, m2 ; q1-p1
por m7, m6 ; abs(q1-p1)
pxor m6, m6
pand m7, [pb_FE]
psrlq m7, 1 ; abs(q1-p1)/2
paddusb m7, m1 ; abs(q0-p0)*2+abs(q1-p1)/2
psubusb m7, m_flimE
pcmpeqb m7, m6 ; abs(q0-p0)*2+abs(q1-p1)/2 <= E
pand m0, m7 ; normal_limit result
; filter_common; at this point, m2-m5=p1-q1 and m0 is filter_mask
%ifdef m8 ; x86-64 && sse2
mova m8, [pb_80]
%define m_pb_80 m8
%else ; x86-32 or mmx/mmxext
%define m_pb_80 [pb_80]
%endif
mova m1, m4
mova m7, m3
pxor m1, m_pb_80
pxor m7, m_pb_80
psubsb m1, m7 ; (signed) q0-p0
mova m6, m2
mova m7, m5
pxor m6, m_pb_80
pxor m7, m_pb_80
psubsb m6, m7 ; (signed) p1-q1
mova m7, m_maskres
paddsb m6, m1
paddsb m6, m1
paddsb m6, m1
pand m6, m0
%ifdef m8
mova m_limres, m6 ; 3*(qp-p0)+(p1-q1) masked for filter_mbedge
pand m_limres, m7
%else
mova m0, m6
pand m0, m7
mova m_limres, m0
%endif
pandn m7, m6 ; 3*(q0-p0)+(p1-q1) masked for filter_common
mova m1, [pb_F8]
mova m6, m7
paddsb m7, [pb_3]
paddsb m6, [pb_4]
pand m7, m1
pand m6, m1
pxor m1, m1
pxor m0, m0
pcmpgtb m1, m7
psubb m0, m7
psrlq m7, 3 ; +f2
psrlq m0, 3 ; -f2
pand m0, m1
pandn m1, m7
psubusb m3, m0
paddusb m3, m1 ; p0+f2
pxor m1, m1
pxor m0, m0
pcmpgtb m0, m6
psubb m1, m6
psrlq m6, 3 ; +f1
psrlq m1, 3 ; -f1
pand m1, m0
pandn m0, m6
psubusb m4, m0
paddusb m4, m1 ; q0-f1
; filter_mbedge (m2-m5 = p1-q1; lim_res carries w)
%if cpuflag(ssse3)
mova m7, [pb_1]
%else
mova m7, [pw_63]
%endif
%ifdef m8
SWAP 1, 8
%else
mova m1, m_limres
%endif
pxor m0, m0
mova m6, m1
pcmpgtb m0, m1 ; which are negative
%if cpuflag(ssse3)
punpcklbw m6, m7 ; interleave with "1" for rounding
punpckhbw m1, m7
%else
punpcklbw m6, m0 ; signed byte->word
punpckhbw m1, m0
%endif
mova m_limsign, m0
%if cpuflag(ssse3)
mova m7, [pb_27_63]
%ifndef m8
mova m_limres, m1
%endif
%ifdef m10
SWAP 0, 10 ; don't lose lim_sign copy
%endif
mova m0, m7
pmaddubsw m7, m6
SWAP 6, 7
pmaddubsw m0, m1
SWAP 1, 0
%ifdef m10
SWAP 0, 10
%else
mova m0, m_limsign
%endif
%else
mova m_maskres, m6 ; backup for later in filter
mova m_limres, m1
pmullw m6, [pw_27]
pmullw m1, [pw_27]
paddw m6, m7
paddw m1, m7
%endif
psraw m6, 7
psraw m1, 7
packsswb m6, m1 ; a0
pxor m1, m1
psubb m1, m6
pand m1, m0 ; -a0
pandn m0, m6 ; +a0
%if cpuflag(ssse3)
mova m6, [pb_18_63] ; pipelining
%endif
psubusb m3, m1
paddusb m4, m1
paddusb m3, m0 ; p0+a0
psubusb m4, m0 ; q0-a0
%if cpuflag(ssse3)
SWAP 6, 7
%ifdef m10
SWAP 1, 10
%else
mova m1, m_limres
%endif
mova m0, m7
pmaddubsw m7, m6
SWAP 6, 7
pmaddubsw m0, m1
SWAP 1, 0
%ifdef m10
SWAP 0, 10
%endif
mova m0, m_limsign
%else
mova m6, m_maskres
mova m1, m_limres
pmullw m6, [pw_18]
pmullw m1, [pw_18]
paddw m6, m7
paddw m1, m7
%endif
mova m0, m_limsign
psraw m6, 7
psraw m1, 7
packsswb m6, m1 ; a1
pxor m1, m1
psubb m1, m6
pand m1, m0 ; -a1
pandn m0, m6 ; +a1
%if cpuflag(ssse3)
mova m6, [pb_9_63]
%endif
psubusb m2, m1
paddusb m5, m1
paddusb m2, m0 ; p1+a1
psubusb m5, m0 ; q1-a1
%if cpuflag(ssse3)
SWAP 6, 7
%ifdef m10
SWAP 1, 10
%else
mova m1, m_limres
%endif
mova m0, m7
pmaddubsw m7, m6
SWAP 6, 7
pmaddubsw m0, m1
SWAP 1, 0
%else
%ifdef m8
SWAP 6, 12
SWAP 1, 8
%else
mova m6, m_maskres
mova m1, m_limres
%endif
pmullw m6, [pw_9]
pmullw m1, [pw_9]
paddw m6, m7
paddw m1, m7
%endif
%ifdef m9
SWAP 7, 9
%else
mova m7, m_limsign
%endif
psraw m6, 7
psraw m1, 7
packsswb m6, m1 ; a1
pxor m0, m0
psubb m0, m6
pand m0, m7 ; -a1
pandn m7, m6 ; +a1
%ifdef m8
SWAP 1, 13
SWAP 6, 14
%else
mova m1, m_p2backup
mova m6, m_q2backup
%endif
psubusb m1, m0
paddusb m6, m0
paddusb m1, m7 ; p1+a1
psubusb m6, m7 ; q1-a1
; store
%ifidn %1, v
movrow [dst2q+mstrideq*4], m1
movrow [dst1q+mstrideq*2], m2
movrow [dst1q+mstrideq ], m3
movrow [dst1q], m4
movrow [dst2q], m5
movrow [dst2q+ strideq ], m6
%if mmsize == 16 && %2 == 8
add dst8q, mstrideq
movhps [dst8q+mstrideq*2], m1
movhps [dst8q+mstrideq ], m2
movhps [dst8q], m3
add dst8q, strideq
movhps [dst8q], m4
movhps [dst8q+ strideq ], m5
movhps [dst8q+ strideq*2], m6
%endif
%else ; h
inc dst1q
inc dst2q
; 4x8/16 transpose
TRANSPOSE4x4B 1, 2, 3, 4, 0
SBUTTERFLY bw, 5, 6, 0
%if mmsize == 8 ; mmx/mmxext (h)
WRITE_4x2D 1, 2, 3, 4, dst1q, dst2q, mstrideq, strideq
add dst1q, 4
WRITE_2x4W m5, m6, dst2q, dst1q, mstrideq, strideq
%else ; sse2 (h)
lea dst8q, [dst8q+mstrideq+1]
WRITE_4x4D 1, 2, 3, 4, dst1q, dst2q, dst8q, mstrideq, strideq, %2
lea dst1q, [dst2q+mstrideq+4]
lea dst8q, [dst8q+mstrideq+4]
%if cpuflag(sse4)
add dst2q, 4
%endif
WRITE_8W m5, dst2q, dst1q, mstrideq, strideq
%if cpuflag(sse4)
lea dst2q, [dst8q+ strideq ]
%endif
WRITE_8W m6, dst2q, dst8q, mstrideq, strideq
%endif
%endif
%if mmsize == 8
%if %2 == 8 ; chroma
%ifidn %1, h
sub dst1q, 5
%endif
cmp dst1q, dst8q
mov dst1q, dst8q
jnz .next8px
%else
%ifidn %1, h
lea dst1q, [dst1q+ strideq*8-5]
%else ; v
add dst1q, 8
%endif
dec cntrq
jg .next8px
%endif
%endif
%ifndef m8 ; sse2 on x86-32 or mmx/mmxext
ADD rsp, pad
%endif
RET
%endmacro
%if ARCH_X86_32
INIT_MMX mmx
MBEDGE_LOOPFILTER v, 16
MBEDGE_LOOPFILTER h, 16
MBEDGE_LOOPFILTER v, 8
MBEDGE_LOOPFILTER h, 8
INIT_MMX mmx2
MBEDGE_LOOPFILTER v, 16
MBEDGE_LOOPFILTER h, 16
MBEDGE_LOOPFILTER v, 8
MBEDGE_LOOPFILTER h, 8
%endif
INIT_XMM sse2
MBEDGE_LOOPFILTER v, 16
MBEDGE_LOOPFILTER h, 16
MBEDGE_LOOPFILTER v, 8
MBEDGE_LOOPFILTER h, 8
INIT_XMM ssse3
MBEDGE_LOOPFILTER v, 16
MBEDGE_LOOPFILTER h, 16
MBEDGE_LOOPFILTER v, 8
MBEDGE_LOOPFILTER h, 8
INIT_XMM sse4
MBEDGE_LOOPFILTER h, 16
MBEDGE_LOOPFILTER h, 8
| 28.75339 | 100 | 0.483821 |
991e37570d5e10af200c0d0c2421510ecbf67c57 | 577 | asm | Assembly | libsrc/msx/svi_gttrig.asm | andydansby/z88dk-mk2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | 1 | 2020-09-15T08:35:49.000Z | 2020-09-15T08:35:49.000Z | libsrc/msx/svi_gttrig.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | libsrc/msx/svi_gttrig.asm | andydansby/z88dk-MK2 | 51c15f1387293809c496f5eaf7b196f8a0e9b66b | [
"ClArtistic"
] | null | null | null | ;
; Spectravideo SVI specific routines
; by Stefano Bodrato
; MSX emulation layer
;
; GTTRIG
;
;
; $Id: svi_gttrig.asm,v 1.4 2009/06/22 21:44:17 dom Exp $
;
XLIB GTTRIG
LIB svi_slstick
INCLUDE "svi.def"
GTTRIG:
dec a
jp m,getspace
push af
and 1
call svi_slstick
pop bc
dec b
dec b
ld b,$10
jp m,trig1
ld b,' '
trig1: and b
trig2: sub 1 ; 255 if a=0, otherwise 0
sbc a,a
ret
getspace:
di
in a,(PPI_C)
and $f0
ld c,a
add 8 ; keyboard row #8
out (PPI_COUT),a
in a,(PPI_B) ; bits: RDULxxxF Fire is the SPACE key
ei
and 1
jr trig2
| 10.886792 | 57 | 0.637782 |
39191f06b08c740730236dfc49a3dcd2a723202c | 29 | asm | Assembly | src/main/fragment/mos6502-common/_deref_qvoc1=_inc__deref_qvoc1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/_deref_qvoc1=_inc__deref_qvoc1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/_deref_qvoc1=_inc__deref_qvoc1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | inc {c1}
bne !+
inc {c1}+1
!: | 7.25 | 10 | 0.482759 |
14bf789e6e0540e7bae0e43e25a7857148d7750c | 356 | asm | Assembly | oeis/032/A032196.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/032/A032196.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/032/A032196.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A032196: Number of necklaces with 11 black beads and n-11 white beads.
; Submitted by Jamie Morken(s2)
; 1,1,6,26,91,273,728,1768,3978,8398,16796,32066,58786,104006,178296,297160,482885,766935,1193010,1820910,2731365,4032015,5864750,8414640,11920740,16689036,23107896,31666376,42975796
sub $1,$0
sub $1,1
bin $1,10
sub $1,1
div $1,11
mov $0,$1
add $0,1
| 29.666667 | 182 | 0.755618 |
61547138e0d6163b6a7f1fa2f8d414acacfda56c | 3,298 | asm | Assembly | decreasoner.macosx/software/relsat-dist/gmp-3.1/mpn/sparc64/sub_n.asm | problem-frames/openpf | 55100bd9cca61a182fc00cd3818bd59a6343ae6e | [
"BSD-3-Clause"
] | 1 | 2019-05-03T20:03:11.000Z | 2019-05-03T20:03:11.000Z | decreasoner.x86/software/relsat-dist/gmp-3.1/mpn/sparc64/sub_n.asm | problem-frames/openpf | 55100bd9cca61a182fc00cd3818bd59a6343ae6e | [
"BSD-3-Clause"
] | null | null | null | decreasoner.x86/software/relsat-dist/gmp-3.1/mpn/sparc64/sub_n.asm | problem-frames/openpf | 55100bd9cca61a182fc00cd3818bd59a6343ae6e | [
"BSD-3-Clause"
] | null | null | null | ! SPARC v9 __gmpn_sub_n -- Subtract two limb vectors of the same length > 0 and
! store difference in a third limb vector.
! Copyright (C) 1999, 2000 Free Software Foundation, Inc.
! This file is part of the GNU MP Library.
! The GNU MP Library is free software; you can redistribute it and/or modify
! it under the terms of the GNU Lesser General Public License as published by
! the Free Software Foundation; either version 2.1 of the License, or (at your
! option) any later version.
! The GNU MP Library is distributed in the hope that it will be useful, but
! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
! or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
! License for more details.
! You should have received a copy of the GNU Lesser General Public License
! along with the GNU MP Library; see the file COPYING.LIB. If not, write to
! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
! MA 02111-1307, USA.
! INPUT PARAMETERS
! res_ptr %o0
! s1_ptr %o1
! s2_ptr %o2
! size %o3
include(`../config.m4')
ASM_START()
.register %g2,#scratch
.register %g3,#scratch
PROLOGUE(mpn_sub_n)
! 12 mem ops >= 12 cycles
! 8 shift insn >= 8 cycles
! 8 addccc, executing alone, +8 cycles
! Unrolling not mandatory...perhaps 2-way is best?
! Put one ldx/stx and one s?lx per issue tuple, fill with pointer arith and loop ctl
! All in all, it runs at 5 cycles/limb
save %sp,-160,%sp
addcc %g0,%g0,%g0
add %i3,-4,%i3
brlz,pn %i3,L(there)
nop
ldx [%i1+0],%l0
ldx [%i2+0],%l4
ldx [%i1+8],%l1
ldx [%i2+8],%l5
ldx [%i1+16],%l2
ldx [%i2+16],%l6
ldx [%i1+24],%l3
ldx [%i2+24],%l7
add %i1,32,%i1
add %i2,32,%i2
add %i3,-4,%i3
brlz,pn %i3,L(skip)
nop
b L(loop1) ! jump instead of executing many NOPs
nop
ALIGN(32)
!--------- Start main loop ---------
L(loop1):
subccc %l0,%l4,%g1
!-
srlx %l0,32,%o0
ldx [%i1+0],%l0
!-
srlx %l4,32,%o4
ldx [%i2+0],%l4
!-
subccc %o0,%o4,%g0
!-
subccc %l1,%l5,%g2
!-
srlx %l1,32,%o1
ldx [%i1+8],%l1
!-
srlx %l5,32,%o5
ldx [%i2+8],%l5
!-
subccc %o1,%o5,%g0
!-
subccc %l2,%l6,%g3
!-
srlx %l2,32,%o2
ldx [%i1+16],%l2
!-
srlx %l6,32,%g5 ! asymmetry
ldx [%i2+16],%l6
!-
subccc %o2,%g5,%g0
!-
subccc %l3,%l7,%g4
!-
srlx %l3,32,%o3
ldx [%i1+24],%l3
add %i1,32,%i1
!-
srlx %l7,32,%o7
ldx [%i2+24],%l7
add %i2,32,%i2
!-
subccc %o3,%o7,%g0
!-
stx %g1,[%i0+0]
!-
stx %g2,[%i0+8]
!-
stx %g3,[%i0+16]
add %i3,-4,%i3
!-
stx %g4,[%i0+24]
add %i0,32,%i0
brgez,pt %i3,L(loop1)
nop
!--------- End main loop ---------
L(skip):
subccc %l0,%l4,%g1
srlx %l0,32,%o0
srlx %l4,32,%o4
subccc %o0,%o4,%g0
subccc %l1,%l5,%g2
srlx %l1,32,%o1
srlx %l5,32,%o5
subccc %o1,%o5,%g0
subccc %l2,%l6,%g3
srlx %l2,32,%o2
srlx %l6,32,%g5 ! asymmetry
subccc %o2,%g5,%g0
subccc %l3,%l7,%g4
srlx %l3,32,%o3
srlx %l7,32,%o7
subccc %o3,%o7,%g0
stx %g1,[%i0+0]
stx %g2,[%i0+8]
stx %g3,[%i0+16]
stx %g4,[%i0+24]
add %i0,32,%i0
L(there):
add %i3,4,%i3
brz,pt %i3,L(end)
nop
L(loop2):
ldx [%i1+0],%l0
add %i1,8,%i1
ldx [%i2+0],%l4
add %i2,8,%i2
srlx %l0,32,%g2
srlx %l4,32,%g3
subccc %l0,%l4,%g1
subccc %g2,%g3,%g0
stx %g1,[%i0+0]
add %i0,8,%i0
add %i3,-1,%i3
brgz,pt %i3,L(loop2)
nop
L(end): addc %g0,%g0,%i0
ret
restore
EPILOGUE(mpn_sub_n)
| 19.063584 | 84 | 0.62644 |
59e9dceae9d9dce73c4fbd1cf2a4110df2294e02 | 577 | asm | Assembly | oeis/078/A078836.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/078/A078836.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/078/A078836.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A078836: a(n) = n*2^(n-6).
; 6,14,32,72,160,352,768,1664,3584,7680,16384,34816,73728,155648,327680,688128,1441792,3014656,6291456,13107200,27262976,56623104,117440512,243269632,503316480,1040187392,2147483648,4429185024,9126805504,18790481920,38654705664,79456894976,163208757248,335007449088,687194767360,1408749273088,2886218022912,5909874999296,12094627905536,24739011624960,50577534877696,103354093010944,211106232532992,431008558088192,879609302220800,1794402976530432,3659174697238528,7459086882832384,15199648742375424
mov $1,2
pow $1,$0
add $0,6
mul $1,$0
mov $0,$1
| 64.111111 | 498 | 0.842288 |
ab760bc99119e48ca3d025c6f2c0c572de1d5966 | 207 | asm | Assembly | MAS4.asm | Nurglureddo/AssemblerForKai | 54d88944fea3a4c6f4dfa22f3a194205ce80d473 | [
"MIT"
] | null | null | null | MAS4.asm | Nurglureddo/AssemblerForKai | 54d88944fea3a4c6f4dfa22f3a194205ce80d473 | [
"MIT"
] | null | null | null | MAS4.asm | Nurglureddo/AssemblerForKai | 54d88944fea3a4c6f4dfa22f3a194205ce80d473 | [
"MIT"
] | null | null | null | code segment
assume cs:code, ds:code
N: push cs
pop ds
xor ax,ax
xor bx,bx
mov cx,5
M: cmp A[bx],0
jl K
add ax,A[bx]
K: inc bx
inc bx
loop M
mov ax,4c00h
int 21h
A dw 1,-2,-3,-4,5
code ends
end N | 11.5 | 24 | 0.637681 |
b271c86c06a6be735d6108ebae3af9abfe646228 | 153 | asm | Assembly | SystemProg/7-01-IP-03-Baran.asm | samurai-of-honor/my-labs-1 | 111a9302093b1ad6a358560bd926544aa2479d80 | [
"MIT"
] | 1 | 2022-01-30T11:26:23.000Z | 2022-01-30T11:26:23.000Z | SystemProg/7-01-IP-03-Baran.asm | samurai-of-honor/my-labs-1 | 111a9302093b1ad6a358560bd926544aa2479d80 | [
"MIT"
] | 6 | 2022-01-20T16:59:03.000Z | 2022-02-12T22:30:55.000Z | SystemProg/7-01-IP-03-Baran.asm | samurai-of-honor/my-labs-1 | 111a9302093b1ad6a358560bd926544aa2479d80 | [
"MIT"
] | null | null | null | .386
.model flat, stdcall
option casemap :none
include \masm32\include\masm32rt.inc
.data
.code
main:
end main
| 13.909091 | 40 | 0.562092 |
01788fcfcdef12de83e88e1d686897c862528b0c | 8,804 | asm | Assembly | Lab 1/Caden_Verzino_and_Felipe_OrricoScognamiglio_Lab1_challengecode.asm | felipeorrico/ECE375-Assembly | 68438b9b00778d158f7673fee742f1460cee1bb0 | [
"MIT"
] | null | null | null | Lab 1/Caden_Verzino_and_Felipe_OrricoScognamiglio_Lab1_challengecode.asm | felipeorrico/ECE375-Assembly | 68438b9b00778d158f7673fee742f1460cee1bb0 | [
"MIT"
] | null | null | null | Lab 1/Caden_Verzino_and_Felipe_OrricoScognamiglio_Lab1_challengecode.asm | felipeorrico/ECE375-Assembly | 68438b9b00778d158f7673fee742f1460cee1bb0 | [
"MIT"
] | null | null | null | ;***********************************************************
;*
;* BasicBumpBot.asm - V2.0
;*
;* This program contains the neccessary code to enable the
;* the TekBot to behave in the traditional BumpBot fashion.
;* It is written to work with the latest TekBots platform.
;* If you have an earlier version you may need to modify
;* your code appropriately.
;*
;* The behavior is very simple. Get the TekBot moving
;* forward and poll for whisker inputs. If the right
;* whisker is activated, the TekBot backs up for a second,
;* turns left for a second, and then moves forward again.
;* If the left whisker is activated, the TekBot backs up
;* for a second, turns right for a second, and then
;* continues forward.
;*
;***********************************************************
;*
;* Author: Felipe Orrico Scognamiglio and Caden Verzino
;* Date: January 14, 2021
;* Company: Oregon State University - EECS
;* Version: 2.0
;*
;***********************************************************
.include "m128def.inc" ; Include definition file
;************************************************************
;* Variable and Constant Declarations
;************************************************************
.def mpr = r16 ; Multi-Purpose Register
.def waitcnt = r17 ; Wait Loop Counter
.def ilcnt = r18 ; Inner Loop Counter
.def olcnt = r19 ; Outer Loop Counter
.equ WTime = 100 ; Time to wait in wait loop
.equ WskrR = 0 ; Right Whisker Input Bit
.equ WskrL = 1 ; Left Whisker Input Bit
.equ EngEnR = 4 ; Right Engine Enable Bit
.equ EngEnL = 7 ; Left Engine Enable Bit
.equ EngDirR = 5 ; Right Engine Direction Bit
.equ EngDirL = 6 ; Left Engine Direction Bit
;/////////////////////////////////////////////////////////////
;These macros are the values to make the TekBot Move.
;/////////////////////////////////////////////////////////////
.equ MovFwd = (1<<EngDirR|1<<EngDirL) ; Move Forward Command
.equ MovBck = $00 ; Move Backward Command
.equ TurnR = (1<<EngDirL) ; Turn Right Command
.equ TurnL = (1<<EngDirR) ; Turn Left Command
.equ Halt = (1<<EngEnR|1<<EngEnL) ; Halt Command
;============================================================
; NOTE: Let me explain what the macros above are doing.
; Every macro is executing in the pre-compiler stage before
; the rest of the code is compiled. The macros used are
; left shift bits (<<) and logical or (|). Here is how it
; works:
; Step 1. .equ MovFwd = (1<<EngDirR|1<<EngDirL)
; Step 2. substitute constants
; .equ MovFwd = (1<<5|1<<6)
; Step 3. calculate shifts
; .equ MovFwd = (b00100000|b01000000)
; Step 4. calculate logical or
; .equ MovFwd = b01100000
; Thus MovFwd has a constant value of b01100000 or $60 and any
; instance of MovFwd within the code will be replaced with $60
; before the code is compiled. So why did I do it this way
; instead of explicitly specifying MovFwd = $60? Because, if
; I wanted to put the Left and Right Direction Bits on different
; pin allocations, all I have to do is change thier individual
; constants, instead of recalculating the new command and
; everything else just falls in place.
;==============================================================
;**************************************************************
;* Beginning of code segment
;**************************************************************
.cseg
;--------------------------------------------------------------
; Interrupt Vectors
;--------------------------------------------------------------
.org $0000 ; Reset and Power On Interrupt
rjmp INIT ; Jump to program initialization
.org $0046 ; End of Interrupt Vectors
;--------------------------------------------------------------
; Program Initialization
;--------------------------------------------------------------
INIT:
; Initialize the Stack Pointer (VERY IMPORTANT!!!!)
ldi mpr, low(RAMEND)
out SPL, mpr ; Load SPL with low byte of RAMEND
ldi mpr, high(RAMEND)
out SPH, mpr ; Load SPH with high byte of RAMEND
; Initialize Port B for output
ldi mpr, $FF ; Set Port B Data Direction Register
out DDRB, mpr ; for output
ldi mpr, $00 ; Initialize Port B Data Register
out PORTB, mpr ; so all Port B outputs are low
; Initialize Port D for input
ldi mpr, $00 ; Set Port D Data Direction Register
out DDRD, mpr ; for input
ldi mpr, $FF ; Initialize Port D Data Register
out PORTD, mpr ; so all Port D inputs are Tri-State
; Initialize TekBot Forward Movement
ldi mpr, MovFwd ; Load Move Forward Command
out PORTB, mpr ; Send command to motors
;---------------------------------------------------------------
; Main Program
;---------------------------------------------------------------
MAIN:
in mpr, PIND ; Get whisker input from Port D
andi mpr, (1<<WskrR|1<<WskrL)
cpi mpr, (1<<WskrL) ; Check for Right Whisker input (Recall Active Low)
brne NEXT ; Continue with next check
rcall HitRight ; Call the subroutine HitRight
rjmp MAIN ; Continue with program
NEXT: cpi mpr, (1<<WskrR) ; Check for Left Whisker input (Recall Active)
brne MAIN ; No Whisker input, continue program
rcall HitLeft ; Call subroutine HitLeft
rjmp MAIN ; Continue through main
;****************************************************************
;* Subroutines and Functions
;****************************************************************
;----------------------------------------------------------------
; Sub: HitRight
; Desc: Handles functionality of the TekBot when the right whisker
; is triggered.
;----------------------------------------------------------------
HitRight:
push mpr ; Save mpr register
push waitcnt ; Save wait register
in mpr, SREG ; Save program state
push mpr ;
; Move Backwards for a second
ldi mpr, MovBck ; Load Move Backward command
out PORTB, mpr ; Send command to port
ldi waitcnt, WTime ; Wait for 1 second
rcall Wait ; Call wait function
rcall Wait ; Call wait function
; Turn left for a second
ldi mpr, TurnL ; Load Turn Left Command
out PORTB, mpr ; Send command to port
ldi waitcnt, WTime ; Wait for 1 second
rcall Wait ; Call wait function
; Move Forward again
ldi mpr, MovFwd ; Load Move Forward command
out PORTB, mpr ; Send command to port
pop mpr ; Restore program state
out SREG, mpr ;
pop waitcnt ; Restore wait register
pop mpr ; Restore mpr
ret ; Return from subroutine
;----------------------------------------------------------------
; Sub: HitLeft
; Desc: Handles functionality of the TekBot when the left whisker
; is triggered.
;----------------------------------------------------------------
HitLeft:
push mpr ; Save mpr register
push waitcnt ; Save wait register
in mpr, SREG ; Save program state
push mpr ;
; Move Backwards for a second
ldi mpr, MovBck ; Load Move Backward command
out PORTB, mpr ; Send command to port
ldi waitcnt, WTime ; Wait for 1 second
rcall Wait ; Call wait function
rcall Wait ; Call wait function
; Turn right for a second
ldi mpr, TurnR ; Load Turn Left Command
out PORTB, mpr ; Send command to port
ldi waitcnt, WTime ; Wait for 1 second
rcall Wait ; Call wait function
; Move Forward again
ldi mpr, MovFwd ; Load Move Forward command
out PORTB, mpr ; Send command to port
pop mpr ; Restore program state
out SREG, mpr ;
pop waitcnt ; Restore wait register
pop mpr ; Restore mpr
ret ; Return from subroutine
;----------------------------------------------------------------
; Sub: Wait
; Desc: A wait loop that is 16 + 159975*waitcnt cycles or roughly
; waitcnt*10ms. Just initialize wait for the specific amount
; of time in 10ms intervals. Here is the general eqaution
; for the number of clock cycles in the wait loop:
; ((3 * ilcnt + 3) * olcnt + 3) * waitcnt + 13 + call
;----------------------------------------------------------------
Wait:
push waitcnt ; Save wait register
push ilcnt ; Save ilcnt register
push olcnt ; Save olcnt register
Loop: ldi olcnt, 224 ; load olcnt register
OLoop: ldi ilcnt, 237 ; load ilcnt register
ILoop: dec ilcnt ; decrement ilcnt
brne ILoop ; Continue Inner Loop
dec olcnt ; decrement olcnt
brne OLoop ; Continue Outer Loop
dec waitcnt ; Decrement wait
brne Loop ; Continue Wait loop
pop olcnt ; Restore olcnt register
pop ilcnt ; Restore ilcnt register
pop waitcnt ; Restore wait register
ret ; Return from subroutine | 38.278261 | 75 | 0.552249 |
4b017245dd8fcc35a1eaf5d9982d5676f36a1783 | 768 | asm | Assembly | oeis/321/A321030.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/321/A321030.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/321/A321030.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A321030: Number of integers x such that 1 <= x <= n and gcd(x,n) = gcd(x+4,n) = gcd(x+6,n) = gcd(x+10,n) = gcd(x+12,n) = gcd(x+16,n) = 1.
; Submitted by Jon Maiga
; 1,1,1,2,1,1,1,4,3,1,5,2,7,1,1,8,11,3,13,2,1,5,17,4,5,7,9,2,23,1,25,16,5,11,1,6,31,13,7,4,35,1,37,10,3,17,41,8,7,5,11,14,47,9,5,4,13,23,53,2,55,25,3,32,7,5,61,22,17,1,65,12,67,31,5,26,5,7,73,8,27,35,77,2,11,37,23,20,83,3,7,34,25,41,13,16,91,7,15,10
add $0,1
mov $1,1
lpb $0
mov $3,$0
lpb $3
mov $4,$0
mov $6,$2
cmp $6,0
add $2,$6
mod $4,$2
cmp $4,0
cmp $4,0
mov $5,$2
add $2,1
cmp $5,1
max $4,$5
sub $3,$4
lpe
mov $5,1
lpb $0
dif $0,$2
mul $5,$2
lpe
dif $5,$2
mul $1,$5
sub $2,2
trn $2,5
add $2,1
mul $1,$2
lpe
mov $0,$1
| 21.333333 | 249 | 0.507813 |
1436bc09b5627741542fe7f33fe3a9d8672cb159 | 1,355 | asm | Assembly | Assignment/a2q2.asm | chintamanand/Embedded-Systems-Project | 8e5651ad699dce8b4c962edb492c910200e00f36 | [
"MIT"
] | null | null | null | Assignment/a2q2.asm | chintamanand/Embedded-Systems-Project | 8e5651ad699dce8b4c962edb492c910200e00f36 | [
"MIT"
] | null | null | null | Assignment/a2q2.asm | chintamanand/Embedded-Systems-Project | 8e5651ad699dce8b4c962edb492c910200e00f36 | [
"MIT"
] | null | null | null | ;ASSIGNMENT 2 QUESTION 2
;WALP TO ADD 2, 8 DIGIT BCD NUMBERS IN THE UNPACKED ASCII
;FORM AVAILABLE IN THE CODE MEMORY, AND STORE THE BCD RESULT IN THE ASCII FORM IN THE RAM
AREA RESET, DATA, READONLY
EXPORT __Vectors
__Vectors
DCD 0x40000000
DCD Reset_Handler
ALIGN
AREA mycode, CODE, READONLY
ENTRY
EXPORT Reset_Handler
Reset_Handler
LDR R0, =SRC1
ADD R0, #32
LDR R1, =SRC2
ADD R1, #32
LDR R7, =DEST
ADD R7, #8 ;for packed ASCII, store in each byte for a total of 8 bytes
MOV R2, #08 ;8 LDRH OPERATIONS WILL BE THERE
MOV R9, #0X00
MSR XPSR, R9
LOOP
LDRH R3, [R0, #-4]!
LDRH R4, [R1, #-4]!
AND R3, R3, #0X0F
AND R4, R4, #0X0F
ADC R3, R4
CMP R3, #09
BLS DOWN1
ADD R3, #06
AND R3, #0X0F
LDR R9, =0X20000000
B DOWN2
DOWN1
LDR R9, =0X00000000
DOWN2
MSR XPSR, R9
LDR R8, =0X00000030 ;SINCE THE QUESTION SAYS "in the ASCII form in RAM"; if result had to be in "unpacked ASCII" load 0x0300 here
ADD R8, R3
STRB R8, [R7, #-1]!
SUB R2, #01
TEQ R2, #00
BNE LOOP
STOP B STOP
SRC1 DCD 0X0305, 0X0309, 0X0301, 0X0304, 0X0304, 0X0309, 0X0308, 0X0302 ; THERE IS NO DCH, THE NUMBERS WILL GET STORED IN LITTLE ENDIAN AND PADDED
SRC2 DCD 0X0301, 0X0303, 0X0304, 0X0309, 0X0301, 0X0303, 0X0304, 0X0309
AREA myarea, DATA, READWRITE
DEST DCB 0
END | 22.213115 | 151 | 0.663469 |
8d672d2ad0479fe973b52d840f2ddfd0d16bbf5f | 442 | asm | Assembly | moving_data/moving_data.asm | swapravo/AA-and-me | f4d149e259a5c0adbbff2a0fd381f7ec32160592 | [
"MIT"
] | null | null | null | moving_data/moving_data.asm | swapravo/AA-and-me | f4d149e259a5c0adbbff2a0fd381f7ec32160592 | [
"MIT"
] | null | null | null | moving_data/moving_data.asm | swapravo/AA-and-me | f4d149e259a5c0adbbff2a0fd381f7ec32160592 | [
"MIT"
] | null | null | null | global _start
section .text
_start:
; moving literals
mov eax, 0xdeadbeef
; memory address -> register
mov eax, [label1]
; memory -> register
mov eax, label1
; loading effective address of label1
lea eax, [label1]
; swapping values
mov eax, 0xdead
mov ebx, 0xbeef
xchg eax, ebx
; register -> another register
mov eax, ebx
; exiting the program now
mov eax, 1
mov ebx, 0
int 0x80
section .data
label1: db 0xffff
| 12.277778 | 38 | 0.69457 |
23d062150402a5a24405cc4cb05c9e6f541bc038 | 4,909 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_21829_160.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_21829_160.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2.log_21829_160.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r8
push %r9
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x290a, %rsi
lea addresses_A_ht+0x867a, %rdi
nop
nop
add $25045, %r14
mov $23, %rcx
rep movsb
nop
nop
nop
nop
nop
add %r8, %r8
lea addresses_UC_ht+0x74a6, %rsi
lea addresses_WC_ht+0x1550a, %rdi
nop
nop
nop
dec %r9
mov $4, %rcx
rep movsw
nop
nop
nop
nop
sub $55323, %rcx
lea addresses_normal_ht+0x10d0a, %r9
nop
nop
nop
nop
nop
sub %r8, %r8
movw $0x6162, (%r9)
nop
nop
nop
sub %r8, %r8
pop %rsi
pop %rdi
pop %rcx
pop %r9
pop %r8
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r15
push %r9
push %rax
push %rbp
push %rdx
// Load
lea addresses_UC+0x55aa, %r14
nop
nop
nop
nop
xor $1290, %rdx
mov (%r14), %r15d
nop
nop
nop
nop
cmp $11305, %rbp
// Faulty Load
lea addresses_normal+0x4d0a, %r12
nop
nop
cmp $42379, %rax
mov (%r12), %rbp
lea oracles, %r9
and $0xff, %rbp
shlq $12, %rbp
mov (%r9,%rbp,1), %rbp
pop %rdx
pop %rbp
pop %rax
pop %r9
pop %r15
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'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
*/
| 43.830357 | 2,999 | 0.661846 |
409a6e4fe5de3dad0b173c1955ba2aeb8b6b3c88 | 418 | asm | Assembly | programs/oeis/176/A176100.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/176/A176100.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/176/A176100.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A176100: Even numbers that are not semiprimes, or, twice the nonprimes.
; 0,2,8,12,16,18,20,24,28,30,32,36,40,42,44,48,50,52,54,56,60,64,66,68,70,72,76,78,80,84,88,90,92,96,98,100,102,104,108,110,112,114,116,120,124,126,128,130,132,136,138,140,144,148,150,152,154,156,160,162,164
mov $1,$0
seq $1,65090 ; Natural numbers which are not odd primes: composites plus 1 and 2.
lpb $1
mov $0,$1
mod $1,4
lpe
mul $0,2
| 38 | 207 | 0.696172 |
80a773a454bfb6d0612cb61502aa0136fa01aec5 | 340 | asm | Assembly | pwnlib/shellcraft/templates/thumb/linux/waitpid.asm | zaratec/pwntools | 8793decd1c9b8c822e3db6c27b9cbf6e8cddfeba | [
"MIT"
] | 5 | 2018-05-15T13:00:56.000Z | 2020-02-09T14:29:00.000Z | pwnlib/shellcraft/templates/thumb/linux/waitpid.asm | FDlucifer/binjitsu | 999ad632004bfc3e623eead20eb11de98fc1f4dd | [
"MIT"
] | null | null | null | pwnlib/shellcraft/templates/thumb/linux/waitpid.asm | FDlucifer/binjitsu | 999ad632004bfc3e623eead20eb11de98fc1f4dd | [
"MIT"
] | 6 | 2017-09-07T02:31:11.000Z | 2021-07-05T16:59:18.000Z |
<%
from pwnlib.shellcraft.thumb.linux import syscall
%>
<%page args="pid, stat_loc, options"/>
<%docstring>
Invokes the syscall waitpid. See 'man 2 waitpid' for more information.
Arguments:
pid(pid_t): pid
stat_loc(int): stat_loc
options(int): options
</%docstring>
${syscall('SYS_waitpid', pid, stat_loc, options)}
| 21.25 | 71 | 0.691176 |
2c0b99e5851f23db7ec0f6c186698531b4f29d22 | 1,915 | nasm | Assembly | modules/libc/xopen/xopen.nasm | r-tty/radios | fdfaaadd256564ea3ed1b7fc408e7aecf648ae2b | [
"BSD-3-Clause"
] | null | null | null | modules/libc/xopen/xopen.nasm | r-tty/radios | fdfaaadd256564ea3ed1b7fc408e7aecf648ae2b | [
"BSD-3-Clause"
] | null | null | null | modules/libc/xopen/xopen.nasm | r-tty/radios | fdfaaadd256564ea3ed1b7fc408e7aecf648ae2b | [
"BSD-3-Clause"
] | null | null | null | ;-------------------------------------------------------------------------------
; xopen.nasm - various routines described by X/Open specification.
;-------------------------------------------------------------------------------
module libc.xopen
%include "rmk.ah"
%include "time.ah"
%include "tm/procmsg.ah"
; Exports and publics
exportproc _usleep, _waitid, _poll
publicdata _environ
; Imports
externproc _clock_nanosleep
externproc _MsgSendv
; Variables
section .bss
_environ RESD 1
; Code
section .text
; int usleep(ulong usec);
proc _usleep
arg usec
locauto ts, tTimeSpec_size
prologue
mpush ecx,edx
mov eax,[%$usec]
mov ecx,1000000
xor edx,edx
div ecx
mov [%$ts+tTimeSpec.Seconds],eax
mov eax,edx
mov ecx,1000
mul ecx
mov [%$ts+tTimeSpec.Nanoseconds],eax
lea edx,[%$ts]
Ccall _clock_nanosleep, CLOCK_REALTIME, 0, edx, 0
mpop edx,ecx
epilogue
ret
endp ;---------------------------------------------------------------
; int waitid(idtype_t idtype, id_t id, siginfo_t *infop,
; int options);
proc _waitid
arg idtype, id, infop, opts
locauto msg, tMsg_ProcWait_size
locauto iov, 2*tIOV_size
prologue
savereg ebx,edx
lea ebx,[%$msg]
mov word [ebx+tProcWaitRequest.Type],PROC_WAIT
Mov16 ebx+tProcWaitRequest.IDtype,%$idtype
Mov32 ebx+tProcWaitRequest.ID,%$id
Mov32 ebx+tProcWaitRequest.Options,%$opts
lea edx,[%$iov]
mSetIOV edx, 0, ebx, tProcWaitRequest_size
mov eax,[%$infop]
mSetIOV edx, 1, eax, tSigInfo_size
lea ebx,[edx+tIOV_size]
or eax,eax
jz .1
xor eax,eax
inc eax
.1: Ccall _MsgSendv, PROCMGR_COID, edx, byte 1, ebx, eax
epilogue
ret
endp ;---------------------------------------------------------------
; int poll(struct pollfd *ufds, uint nfds, int timeout);
proc _poll
arg ufds, nfds, timeout
prologue
epilogue
ret
endp ;---------------------------------------------------------------
| 21.043956 | 80 | 0.581201 |
8459694abbb163353250074bd776568cdbbd55c4 | 212,627 | asm | Assembly | lib/avx512/gcm_vaes_avx512.asm | dalekzhangdong/intel-ipsec-mb | 33323ac995f273cd6a66d0a5df2210331baabb06 | [
"BSD-3-Clause"
] | 1 | 2021-03-15T09:26:31.000Z | 2021-03-15T09:26:31.000Z | lib/avx512/gcm_vaes_avx512.asm | dalekzhangdong/intel-ipsec-mb | 33323ac995f273cd6a66d0a5df2210331baabb06 | [
"BSD-3-Clause"
] | null | null | null | lib/avx512/gcm_vaes_avx512.asm | dalekzhangdong/intel-ipsec-mb | 33323ac995f273cd6a66d0a5df2210331baabb06 | [
"BSD-3-Clause"
] | null | null | null | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Copyright(c) 2018-2020, 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.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Authors:
; Erdinc Ozturk
; Vinodh Gopal
; James Guilford
; Tomasz Kantecki
;
;
; References:
; This code was derived and highly optimized from the code described in paper:
; Vinodh Gopal et. al. Optimized Galois-Counter-Mode Implementation on Intel Architecture Processors. August, 2010
; The details of the implementation is explained in:
; Erdinc Ozturk et. al. Enabling High-Performance Galois-Counter-Mode on Intel Architecture Processors. October, 2012.
;
;
;
;
; Assumptions:
;
;
;
; iv:
; 0 1 2 3
; 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
; | Salt (From the SA) |
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
; | Initialization Vector |
; | (This is the sequence number from IPSec header) |
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
; | 0x1 |
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
;
;
;
; AAD:
; AAD will be padded with 0 to the next 16byte multiple
; for example, assume AAD is a u32 vector
;
; if AAD is 8 bytes:
; AAD[3] = {A0, A1};
; padded AAD in xmm register = {A1 A0 0 0}
;
; 0 1 2 3
; 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
; | SPI (A1) |
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
; | 32-bit Sequence Number (A0) |
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
; | 0x0 |
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
;
; AAD Format with 32-bit Sequence Number
;
; if AAD is 12 bytes:
; AAD[3] = {A0, A1, A2};
; padded AAD in xmm register = {A2 A1 A0 0}
;
; 0 1 2 3
; 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
; | SPI (A2) |
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
; | 64-bit Extended Sequence Number {A1,A0} |
; | |
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
; | 0x0 |
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
;
; AAD Format with 64-bit Extended Sequence Number
;
;
; aadLen:
; Must be a multiple of 4 bytes and from the definition of the spec.
; The code additionally supports any aadLen length.
;
; TLen:
; from the definition of the spec, TLen can only be 8, 12 or 16 bytes.
;
; poly = x^128 + x^127 + x^126 + x^121 + 1
; throughout the code, one tab and two tab indentations are used. one tab is for GHASH part, two tabs is for AES part.
;
%include "include/os.asm"
%include "include/reg_sizes.asm"
%include "include/clear_regs.asm"
%include "include/gcm_defines.asm"
%include "include/gcm_keys_vaes_avx512.asm"
%include "include/memcpy.asm"
%include "include/aes_common.asm"
%include "include/cet.inc"
%ifndef GCM128_MODE
%ifndef GCM192_MODE
%ifndef GCM256_MODE
%error "No GCM mode selected for gcm_avx512.asm!"
%endif
%endif
%endif
;; Decide on AES-GCM key size to compile for
%ifdef GCM128_MODE
%define NROUNDS 9
%define FN_NAME(x,y) aes_gcm_ %+ x %+ _128 %+ y %+ vaes_avx512
%define GMAC_FN_NAME(x) imb_aes_gmac_ %+ x %+ _128_ %+ vaes_avx512
%endif
%ifdef GCM192_MODE
%define NROUNDS 11
%define FN_NAME(x,y) aes_gcm_ %+ x %+ _192 %+ y %+ vaes_avx512
%define GMAC_FN_NAME(x) imb_aes_gmac_ %+ x %+ _192_ %+ vaes_avx512
%endif
%ifdef GCM256_MODE
%define NROUNDS 13
%define FN_NAME(x,y) aes_gcm_ %+ x %+ _256 %+ y %+ vaes_avx512
%define GMAC_FN_NAME(x) imb_aes_gmac_ %+ x %+ _256_ %+ vaes_avx512
%endif
section .text
default rel
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Stack frame definition
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%ifidn __OUTPUT_FORMAT__, win64
%define XMM_STORAGE (10*16) ; space for 10 XMM registers
%define GP_STORAGE ((9*8) + 24) ; space for 9 GP registers + 24 bytes for 64 byte alignment
%else
%define XMM_STORAGE 0
%define GP_STORAGE (8*8) ; space for 7 GP registers + 1 for alignment
%endif
%define LOCAL_STORAGE (48*16) ; space for up to 48 AES blocks
;;; sequence is (bottom-up): GP, XMM, local
%define STACK_GP_OFFSET 0
%define STACK_XMM_OFFSET (STACK_GP_OFFSET + GP_STORAGE)
%define STACK_LOCAL_OFFSET (STACK_XMM_OFFSET + XMM_STORAGE)
%define STACK_FRAME_SIZE (STACK_LOCAL_OFFSET + LOCAL_STORAGE)
;; for compatibility with stack argument definitions in gcm_defines.asm
%define STACK_OFFSET 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Utility Macros
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ===========================================================================
;;; ===========================================================================
;;; Horizontal XOR - 4 x 128bits xored together
%macro VHPXORI4x128 2
%define %%REG %1 ; [in/out] ZMM with 4x128bits to xor; 128bit output
%define %%TMP %2 ; [clobbered] ZMM temporary register
vextracti64x4 YWORD(%%TMP), %%REG, 1
vpxorq YWORD(%%REG), YWORD(%%REG), YWORD(%%TMP)
vextracti32x4 XWORD(%%TMP), YWORD(%%REG), 1
vpxorq XWORD(%%REG), XWORD(%%REG), XWORD(%%TMP)
%endmacro ; VHPXORI4x128
;;; ===========================================================================
;;; ===========================================================================
;;; Horizontal XOR - 2 x 128bits xored together
%macro VHPXORI2x128 2
%define %%REG %1 ; [in/out] YMM/ZMM with 2x128bits to xor; 128bit output
%define %%TMP %2 ; [clobbered] XMM/YMM/ZMM temporary register
vextracti32x4 XWORD(%%TMP), %%REG, 1
vpxorq XWORD(%%REG), XWORD(%%REG), XWORD(%%TMP)
%endmacro ; VHPXORI2x128
;;; ===========================================================================
;;; ===========================================================================
;;; schoolbook multiply - 1st step
%macro VCLMUL_STEP1 6-7
%define %%KP %1 ; [in] key pointer
%define %%HI %2 ; [in] previous blocks 4 to 7
%define %%TMP %3 ; [clobbered] ZMM/YMM/XMM temporary
%define %%TH %4 ; [out] high product
%define %%TM %5 ; [out] medium product
%define %%TL %6 ; [out] low product
%define %%HKEY %7 ; [in/optional] hash key for multiplication
%if %0 == 6
vmovdqu64 %%TMP, [%%KP + HashKey_4]
%else
vmovdqa64 %%TMP, %%HKEY
%endif
vpclmulqdq %%TH, %%HI, %%TMP, 0x11 ; %%T5 = a1*b1
vpclmulqdq %%TL, %%HI, %%TMP, 0x00 ; %%T7 = a0*b0
vpclmulqdq %%TM, %%HI, %%TMP, 0x01 ; %%T6 = a1*b0
vpclmulqdq %%TMP, %%HI, %%TMP, 0x10 ; %%T4 = a0*b1
vpxorq %%TM, %%TM, %%TMP ; [%%TH : %%TM : %%TL]
%endmacro ; VCLMUL_STEP1
;;; ===========================================================================
;;; ===========================================================================
;;; schoolbook multiply - 2nd step
%macro VCLMUL_STEP2 9-11
%define %%KP %1 ; [in] key pointer
%define %%HI %2 ; [out] ghash high 128 bits
%define %%LO %3 ; [in/out] cipher text blocks 0-3 (in); ghash low 128 bits (out)
%define %%TMP0 %4 ; [clobbered] ZMM/YMM/XMM temporary
%define %%TMP1 %5 ; [clobbered] ZMM/YMM/XMM temporary
%define %%TMP2 %6 ; [clobbered] ZMM/YMM/XMM temporary
%define %%TH %7 ; [in] high product
%define %%TM %8 ; [in] medium product
%define %%TL %9 ; [in] low product
%define %%HKEY %10 ; [in/optional] hash key for multiplication
%define %%HXOR %11 ; [in/optional] type of horizontal xor (4 - 4x128; 2 - 2x128; 1 - none)
%if %0 == 9
vmovdqu64 %%TMP0, [%%KP + HashKey_8]
%else
vmovdqa64 %%TMP0, %%HKEY
%endif
vpclmulqdq %%TMP1, %%LO, %%TMP0, 0x10 ; %%TMP1 = a0*b1
vpclmulqdq %%TMP2, %%LO, %%TMP0, 0x11 ; %%TMP2 = a1*b1
vpxorq %%TH, %%TH, %%TMP2
vpclmulqdq %%TMP2, %%LO, %%TMP0, 0x00 ; %%TMP2 = a0*b0
vpxorq %%TL, %%TL, %%TMP2
vpclmulqdq %%TMP0, %%LO, %%TMP0, 0x01 ; %%TMP0 = a1*b0
vpternlogq %%TM, %%TMP1, %%TMP0, 0x96 ; %%TM = TM xor TMP1 xor TMP0
;; finish multiplications
vpsrldq %%TMP2, %%TM, 8
vpxorq %%HI, %%TH, %%TMP2
vpslldq %%TMP2, %%TM, 8
vpxorq %%LO, %%TL, %%TMP2
;; xor 128bit words horizontally and compute [(X8*H1) + (X7*H2) + ... ((X1+Y0)*H8]
;; note: (X1+Y0) handled elsewhere
%if %0 < 11
VHPXORI4x128 %%HI, %%TMP2
VHPXORI4x128 %%LO, %%TMP1
%else
%if %%HXOR == 4
VHPXORI4x128 %%HI, %%TMP2
VHPXORI4x128 %%LO, %%TMP1
%elif %%HXOR == 2
VHPXORI2x128 %%HI, %%TMP2
VHPXORI2x128 %%LO, %%TMP1
%endif ; HXOR
;; for HXOR == 1 there is nothing to be done
%endif ; !(%0 < 11)
;; HIx holds top 128 bits
;; LOx holds low 128 bits
;; - further reductions to follow
%endmacro ; VCLMUL_STEP2
;;; ===========================================================================
;;; ===========================================================================
;;; AVX512 reduction macro
%macro VCLMUL_REDUCE 6
%define %%OUT %1 ; [out] zmm/ymm/xmm: result (must not be %%TMP1 or %%HI128)
%define %%POLY %2 ; [in] zmm/ymm/xmm: polynomial
%define %%HI128 %3 ; [in] zmm/ymm/xmm: high 128b of hash to reduce
%define %%LO128 %4 ; [in] zmm/ymm/xmm: low 128b of hash to reduce
%define %%TMP0 %5 ; [in] zmm/ymm/xmm: temporary register
%define %%TMP1 %6 ; [in] zmm/ymm/xmm: temporary register
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; first phase of the reduction
vpclmulqdq %%TMP0, %%POLY, %%LO128, 0x01
vpslldq %%TMP0, %%TMP0, 8 ; shift-L 2 DWs
vpxorq %%TMP0, %%LO128, %%TMP0 ; first phase of the reduction complete
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; second phase of the reduction
vpclmulqdq %%TMP1, %%POLY, %%TMP0, 0x00
vpsrldq %%TMP1, %%TMP1, 4 ; shift-R only 1-DW to obtain 2-DWs shift-R
vpclmulqdq %%OUT, %%POLY, %%TMP0, 0x10
vpslldq %%OUT, %%OUT, 4 ; shift-L 1-DW to obtain result with no shifts
vpternlogq %%OUT, %%TMP1, %%HI128, 0x96 ; OUT/GHASH = OUT xor TMP1 xor HI128
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%endmacro
;;; ===========================================================================
;;; ===========================================================================
;;; schoolbook multiply (1 to 8 blocks) - 1st step
%macro VCLMUL_1_TO_8_STEP1 8
%define %%KP %1 ; [in] key pointer
%define %%HI %2 ; [in] ZMM ciphered blocks 4 to 7
%define %%TMP1 %3 ; [clobbered] ZMM temporary
%define %%TMP2 %4 ; [clobbered] ZMM temporary
%define %%TH %5 ; [out] ZMM high product
%define %%TM %6 ; [out] ZMM medium product
%define %%TL %7 ; [out] ZMM low product
%define %%NBLOCKS %8 ; [in] number of blocks to ghash (0 to 8)
%if %%NBLOCKS == 8
VCLMUL_STEP1 %%KP, %%HI, %%TMP1, %%TH, %%TM, %%TL
%elif %%NBLOCKS == 7
vmovdqu64 %%TMP2, [%%KP + HashKey_3]
vmovdqa64 %%TMP1, [rel mask_out_top_block]
vpandq %%TMP2, %%TMP1
vpandq %%HI, %%TMP1
VCLMUL_STEP1 NULL, %%HI, %%TMP1, %%TH, %%TM, %%TL, %%TMP2
%elif %%NBLOCKS == 6
vmovdqu64 YWORD(%%TMP2), [%%KP + HashKey_2]
VCLMUL_STEP1 NULL, YWORD(%%HI), YWORD(%%TMP1), \
YWORD(%%TH), YWORD(%%TM), YWORD(%%TL), YWORD(%%TMP2)
%elif %%NBLOCKS == 5
vmovdqu64 XWORD(%%TMP2), [%%KP + HashKey_1]
VCLMUL_STEP1 NULL, XWORD(%%HI), XWORD(%%TMP1), \
XWORD(%%TH), XWORD(%%TM), XWORD(%%TL), XWORD(%%TMP2)
%else
vpxorq %%TH, %%TH
vpxorq %%TM, %%TM
vpxorq %%TL, %%TL
%endif
%endmacro ; VCLMUL_1_TO_8_STEP1
;;; ===========================================================================
;;; ===========================================================================
;;; schoolbook multiply (1 to 8 blocks) - 2nd step
%macro VCLMUL_1_TO_8_STEP2 10
%define %%KP %1 ; [in] key pointer
%define %%HI %2 ; [out] ZMM ghash high 128bits
%define %%LO %3 ; [in/out] ZMM ciphered blocks 0 to 3 (in); ghash low 128bits (out)
%define %%TMP0 %4 ; [clobbered] ZMM temporary
%define %%TMP1 %5 ; [clobbered] ZMM temporary
%define %%TMP2 %6 ; [clobbered] ZMM temporary
%define %%TH %7 ; [in/clobbered] ZMM high sum
%define %%TM %8 ; [in/clobbered] ZMM medium sum
%define %%TL %9 ; [in/clobbered] ZMM low sum
%define %%NBLOCKS %10 ; [in] number of blocks to ghash (0 to 8)
%if %%NBLOCKS == 8
VCLMUL_STEP2 %%KP, %%HI, %%LO, %%TMP0, %%TMP1, %%TMP2, %%TH, %%TM, %%TL
%elif %%NBLOCKS == 7
vmovdqu64 %%TMP2, [%%KP + HashKey_7]
VCLMUL_STEP2 NULL, %%HI, %%LO, %%TMP0, %%TMP1, %%TMP2, %%TH, %%TM, %%TL, %%TMP2, 4
%elif %%NBLOCKS == 6
vmovdqu64 %%TMP2, [%%KP + HashKey_6]
VCLMUL_STEP2 NULL, %%HI, %%LO, %%TMP0, %%TMP1, %%TMP2, %%TH, %%TM, %%TL, %%TMP2, 4
%elif %%NBLOCKS == 5
vmovdqu64 %%TMP2, [%%KP + HashKey_5]
VCLMUL_STEP2 NULL, %%HI, %%LO, %%TMP0, %%TMP1, %%TMP2, %%TH, %%TM, %%TL, %%TMP2, 4
%elif %%NBLOCKS == 4
vmovdqu64 %%TMP2, [%%KP + HashKey_4]
VCLMUL_STEP2 NULL, %%HI, %%LO, %%TMP0, %%TMP1, %%TMP2, %%TH, %%TM, %%TL, %%TMP2, 4
%elif %%NBLOCKS == 3
vmovdqu64 %%TMP2, [%%KP + HashKey_3]
vmovdqa64 %%TMP1, [rel mask_out_top_block]
vpandq %%TMP2, %%TMP1
vpandq %%LO, %%TMP1
VCLMUL_STEP2 NULL, %%HI, %%LO, %%TMP0, %%TMP1, %%TMP2, %%TH, %%TM, %%TL, %%TMP2, 4
%elif %%NBLOCKS == 2
vmovdqu64 YWORD(%%TMP2), [%%KP + HashKey_2]
VCLMUL_STEP2 NULL, YWORD(%%HI), YWORD(%%LO), \
YWORD(%%TMP0), YWORD(%%TMP1), YWORD(%%TMP2), \
YWORD(%%TH), YWORD(%%TM), YWORD(%%TL), YWORD(%%TMP2), 2
%elif %%NBLOCKS == 1
vmovdqu64 XWORD(%%TMP2), [%%KP + HashKey_1]
VCLMUL_STEP2 NULL, XWORD(%%HI), XWORD(%%LO), \
XWORD(%%TMP0), XWORD(%%TMP1), XWORD(%%TMP2), \
XWORD(%%TH), XWORD(%%TM), XWORD(%%TL), XWORD(%%TMP2), 1
%else
vpxorq %%HI, %%HI
vpxorq %%LO, %%LO
%endif
%endmacro ; VCLMUL_1_TO_8_STEP2
;;; ===========================================================================
;;; ===========================================================================
;;; GHASH 1 to 16 blocks of cipher text
;;; - performs reduction at the end
%macro GHASH_1_TO_16 18-24
%define %%KP %1 ; [in] pointer to expanded keys
%define %%GHASH %2 ; [out] ghash output
%define %%T1 %3 ; [clobbered] temporary ZMM
%define %%T2 %4 ; [clobbered] temporary ZMM
%define %%T3 %5 ; [clobbered] temporary ZMM
%define %%T4 %6 ; [clobbered] temporary ZMM
%define %%T5 %7 ; [clobbered] temporary ZMM
%define %%T6 %8 ; [clobbered] temporary ZMM
%define %%T7 %9 ; [clobbered] temporary ZMM
%define %%T8 %10 ; [clobbered] temporary ZMM
%define %%T9 %11 ; [clobbered] temporary ZMM
%define %%AAD_HASH_IN %12 ; [in] input hash value
%define %%CIPHER_IN0 %13 ; [in] ZMM with cipher text blocks 0-3
%define %%CIPHER_IN1 %14 ; [in] ZMM with cipher text blocks 4-7
%define %%CIPHER_IN2 %15 ; [in] ZMM with cipher text blocks 8-11
%define %%CIPHER_IN3 %16 ; [in] ZMM with cipher text blocks 12-15
%define %%NUM_BLOCKS %17 ; [in] numerical value, number of blocks
%define %%INSTANCE_TYPE %18 ; [in] multi_call or single_call
%define %%ROUND %19 ; [in] Round number (for multi_call): "first", "mid", "last"
%define %%HKEY_START %20 ; [in] Hash subkey to start from (for multi_call): 48, 32, 16
%define %%PREV_H %21 ; [in/out] In: High result from previous call, Out: High result of this call
%define %%PREV_L %22 ; [in/out] In: Low result from previous call, Out: Low result of this call
%define %%PREV_M1 %23 ; [in/out] In: Medium 1 result from previous call, Out: Medium 1 result of this call
%define %%PREV_M2 %24 ; [in/out] In: Medium 2 result from previous call, Out: Medium 2 result of this call
%define %%T0H %%T1
%define %%T0L %%T2
%define %%T0M1 %%T3
%define %%T0M2 %%T4
%define %%T1H %%T5
%define %%T1L %%T6
%define %%T1M1 %%T7
%define %%T1M2 %%T8
%define %%HK %%T9
%assign reg_idx 0
%assign blocks_left %%NUM_BLOCKS
%ifidn %%INSTANCE_TYPE, single_call
%assign hashk HashKey_ %+ %%NUM_BLOCKS
%assign first_result 1
%assign reduce 1
vpxorq %%CIPHER_IN0, %%CIPHER_IN0, %%AAD_HASH_IN
%else ; %%INSTANCE_TYPE == multi_call
%assign hashk HashKey_ %+ %%HKEY_START
%ifidn %%ROUND, first
%assign first_result 1
%assign reduce 0
vpxorq %%CIPHER_IN0, %%CIPHER_IN0, %%AAD_HASH_IN
%elifidn %%ROUND, mid
%assign first_result 0
%assign reduce 0
vmovdqa64 %%T0H, %%PREV_H
vmovdqa64 %%T0L, %%PREV_L
vmovdqa64 %%T0M1, %%PREV_M1
vmovdqa64 %%T0M2, %%PREV_M2
%else ; %%ROUND == last
%assign first_result 0
%assign reduce 1
vmovdqa64 %%T0H, %%PREV_H
vmovdqa64 %%T0L, %%PREV_L
vmovdqa64 %%T0M1, %%PREV_M1
vmovdqa64 %%T0M2, %%PREV_M2
%endif ; %%ROUND
%endif ; %%INSTANCE_TYPE
%rep (blocks_left / 4)
%xdefine %%REG_IN %%CIPHER_IN %+ reg_idx
vmovdqu64 %%HK, [%%KP + hashk]
%if first_result == 1
vpclmulqdq %%T0H, %%REG_IN, %%HK, 0x11 ; H = a1*b1
vpclmulqdq %%T0L, %%REG_IN, %%HK, 0x00 ; L = a0*b0
vpclmulqdq %%T0M1, %%REG_IN, %%HK, 0x01 ; M1 = a1*b0
vpclmulqdq %%T0M2, %%REG_IN, %%HK, 0x10 ; TM2 = a0*b1
%assign first_result 0
%else
vpclmulqdq %%T1H, %%REG_IN, %%HK, 0x11 ; H = a1*b1
vpclmulqdq %%T1L, %%REG_IN, %%HK, 0x00 ; L = a0*b0
vpclmulqdq %%T1M1, %%REG_IN, %%HK, 0x01 ; M1 = a1*b0
vpclmulqdq %%T1M2, %%REG_IN, %%HK, 0x10 ; M2 = a0*b1
vpxorq %%T0H, %%T0H, %%T1H
vpxorq %%T0L, %%T0L, %%T1L
vpxorq %%T0M1, %%T0M1, %%T1M1
vpxorq %%T0M2, %%T0M2, %%T1M2
%endif
%undef %%REG_IN
%assign reg_idx (reg_idx + 1)
%assign hashk (hashk + 64)
%assign blocks_left (blocks_left - 4)
%endrep
%if blocks_left > 0
;; There are 1, 2 or 3 blocks left to process.
;; It may also be that they are the only blocks to process.
%xdefine %%REG_IN %%CIPHER_IN %+ reg_idx
%if first_result == 1
;; Case where %%NUM_BLOCKS = 1, 2 or 3
%xdefine %%OUT_H %%T0H
%xdefine %%OUT_L %%T0L
%xdefine %%OUT_M1 %%T0M1
%xdefine %%OUT_M2 %%T0M2
%else
%xdefine %%OUT_H %%T1H
%xdefine %%OUT_L %%T1L
%xdefine %%OUT_M1 %%T1M1
%xdefine %%OUT_M2 %%T1M2
%endif
%if blocks_left == 1
vmovdqu64 XWORD(%%HK), [%%KP + hashk]
vpclmulqdq XWORD(%%OUT_H), XWORD(%%REG_IN), XWORD(%%HK), 0x11 ; %%TH = a1*b1
vpclmulqdq XWORD(%%OUT_L), XWORD(%%REG_IN), XWORD(%%HK), 0x00 ; %%TL = a0*b0
vpclmulqdq XWORD(%%OUT_M1), XWORD(%%REG_IN), XWORD(%%HK), 0x01 ; %%TM1 = a1*b0
vpclmulqdq XWORD(%%OUT_M2), XWORD(%%REG_IN), XWORD(%%HK), 0x10 ; %%TM2 = a0*b1
%elif blocks_left == 2
vmovdqu64 YWORD(%%HK), [%%KP + hashk]
vpclmulqdq YWORD(%%OUT_H), YWORD(%%REG_IN), YWORD(%%HK), 0x11 ; %%TH = a1*b1
vpclmulqdq YWORD(%%OUT_L), YWORD(%%REG_IN), YWORD(%%HK), 0x00 ; %%TL = a0*b0
vpclmulqdq YWORD(%%OUT_M1), YWORD(%%REG_IN), YWORD(%%HK), 0x01 ; %%TM1 = a1*b0
vpclmulqdq YWORD(%%OUT_M2), YWORD(%%REG_IN), YWORD(%%HK), 0x10 ; %%TM2 = a0*b1
%else ; blocks_left == 3
vmovdqu64 YWORD(%%HK), [%%KP + hashk]
vinserti64x2 %%HK, [%%KP + hashk + 32], 2
vpclmulqdq %%OUT_H, %%REG_IN, %%HK, 0x11 ; %%TH = a1*b1
vpclmulqdq %%OUT_L, %%REG_IN, %%HK, 0x00 ; %%TL = a0*b0
vpclmulqdq %%OUT_M1, %%REG_IN, %%HK, 0x01 ; %%TM1 = a1*b0
vpclmulqdq %%OUT_M2, %%REG_IN, %%HK, 0x10 ; %%TM2 = a0*b1
%endif ; blocks_left
%undef %%REG_IN
%undef %%OUT_H
%undef %%OUT_L
%undef %%OUT_M1
%undef %%OUT_M2
%if first_result != 1
vpxorq %%T0H, %%T0H, %%T1H
vpxorq %%T0L, %%T0L, %%T1L
vpxorq %%T0M1, %%T0M1, %%T1M1
vpxorq %%T0M2, %%T0M2, %%T1M2
%endif
%endif ; blocks_left > 0
%if reduce == 1
;; integrate TM into TH and TL
vpxorq %%T0M1, %%T0M1, %%T0M2
vpsrldq %%T1M1, %%T0M1, 8
vpslldq %%T1M2, %%T0M1, 8
vpxorq %%T0H, %%T0H, %%T1M1
vpxorq %%T0L, %%T0L, %%T1M2
;; add TH and TL 128-bit words horizontally
VHPXORI4x128 %%T0H, %%T1M1
VHPXORI4x128 %%T0L, %%T1M2
;; reduction
vmovdqa64 XWORD(%%HK), [rel POLY2]
VCLMUL_REDUCE XWORD(%%GHASH), XWORD(%%HK), \
XWORD(%%T0H), XWORD(%%T0L), XWORD(%%T0M1), XWORD(%%T0M2)
%else ;; reduce == 0
vmovdqa64 %%PREV_H, %%T0H
vmovdqa64 %%PREV_L, %%T0L
vmovdqa64 %%PREV_M1, %%T0M1
vmovdqa64 %%PREV_M2, %%T0M2
%endif
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; GHASH_MUL MACRO to implement: Data*HashKey mod (128,127,126,121,0)
;;; Input: A and B (128-bits each, bit-reflected)
;;; Output: C = A*B*x mod poly, (i.e. >>1 )
;;; To compute GH = GH*HashKey mod poly, give HK = HashKey<<1 mod poly as input
;;; GH = GH * HK * x mod poly which is equivalent to GH*HashKey mod poly.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro GHASH_MUL 7
%define %%GH %1 ;; [in/out] xmm/ymm/zmm with multiply operand(s) (128-bits)
%define %%HK %2 ;; [in] xmm/ymm/zmm with hash key value(s) (128-bits)
%define %%T1 %3 ;; [clobbered] xmm/ymm/zmm
%define %%T2 %4 ;; [clobbered] xmm/ymm/zmm
%define %%T3 %5 ;; [clobbered] xmm/ymm/zmm
%define %%T4 %6 ;; [clobbered] xmm/ymm/zmm
%define %%T5 %7 ;; [clobbered] xmm/ymm/zmm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
vpclmulqdq %%T1, %%GH, %%HK, 0x11 ; %%T1 = a1*b1
vpclmulqdq %%T2, %%GH, %%HK, 0x00 ; %%T2 = a0*b0
vpclmulqdq %%T3, %%GH, %%HK, 0x01 ; %%T3 = a1*b0
vpclmulqdq %%GH, %%GH, %%HK, 0x10 ; %%GH = a0*b1
vpxorq %%GH, %%GH, %%T3
vpsrldq %%T3, %%GH, 8 ; shift-R %%GH 2 DWs
vpslldq %%GH, %%GH, 8 ; shift-L %%GH 2 DWs
vpxorq %%T1, %%T1, %%T3
vpxorq %%GH, %%GH, %%T2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;first phase of the reduction
vmovdqu64 %%T3, [rel POLY2]
vpclmulqdq %%T2, %%T3, %%GH, 0x01
vpslldq %%T2, %%T2, 8 ; shift-L %%T2 2 DWs
vpxorq %%GH, %%GH, %%T2 ; first phase of the reduction complete
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;second phase of the reduction
vpclmulqdq %%T2, %%T3, %%GH, 0x00
vpsrldq %%T2, %%T2, 4 ; shift-R only 1-DW to obtain 2-DWs shift-R
vpclmulqdq %%GH, %%T3, %%GH, 0x10
vpslldq %%GH, %%GH, 4 ; Shift-L 1-DW to obtain result with no shifts
; second phase of the reduction complete, the result is in %%GH
vpternlogq %%GH, %%T1, %%T2, 0x96 ; GH = GH xor T1 xor T2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; In PRECOMPUTE, the commands filling Hashkey_i_k are not required for avx512
;;; functions, but are kept to allow users to switch cpu architectures between calls
;;; of pre, init, update, and finalize.
%macro PRECOMPUTE 10
%define %%GDATA %1 ;; [in/out] GPR, pointer to GCM key data structure, content updated
%define %%HK %2 ;; [in] xmm, hash key
%define %%T1 %3 ;; [clobbered] xmm
%define %%T2 %4 ;; [clobbered] xmm
%define %%T3 %5 ;; [clobbered] xmm
%define %%T4 %6 ;; [clobbered] xmm
%define %%T5 %7 ;; [clobbered] xmm
%define %%T6 %8 ;; [clobbered] xmm
%define %%T7 %9 ;; [clobbered] xmm
%define %%T8 %10 ;; [clobbered] xmm
%xdefine %%ZT1 ZWORD(%%T1)
%xdefine %%ZT2 ZWORD(%%T2)
%xdefine %%ZT3 ZWORD(%%T3)
%xdefine %%ZT4 ZWORD(%%T4)
%xdefine %%ZT5 ZWORD(%%T5)
%xdefine %%ZT6 ZWORD(%%T6)
%xdefine %%ZT7 ZWORD(%%T7)
%xdefine %%ZT8 ZWORD(%%T8)
vmovdqa64 %%T5, %%HK
vinserti64x2 %%ZT7, %%HK, 3
;; calculate HashKey^2<<1 mod poly
GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2
vmovdqu64 [%%GDATA + HashKey_2], %%T5
vinserti64x2 %%ZT7, %%T5, 2
;; calculate HashKey^3<<1 mod poly
GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2
vmovdqu64 [%%GDATA + HashKey_3], %%T5
vinserti64x2 %%ZT7, %%T5, 1
;; calculate HashKey^4<<1 mod poly
GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2
vmovdqu64 [%%GDATA + HashKey_4], %%T5
vinserti64x2 %%ZT7, %%T5, 0
;; switch to 4x128-bit computations now
vshufi64x2 %%ZT5, %%ZT5, %%ZT5, 0x00 ;; broadcast HashKey^4 across all ZT5
vmovdqa64 %%ZT8, %%ZT7 ;; save HashKey^4 to HashKey^1 in ZT8
;; calculate HashKey^5<<1 mod poly, HashKey^6<<1 mod poly, ... HashKey^8<<1 mod poly
GHASH_MUL %%ZT7, %%ZT5, %%ZT1, %%ZT3, %%ZT4, %%ZT6, %%ZT2
vmovdqu64 [%%GDATA + HashKey_8], %%ZT7 ;; HashKey^8 to HashKey^5 in ZT7 now
vshufi64x2 %%ZT5, %%ZT7, %%ZT7, 0x00 ;; broadcast HashKey^8 across all ZT5
;; calculate HashKey^9<<1 mod poly, HashKey^10<<1 mod poly, ... HashKey^48<<1 mod poly
;; use HashKey^8 as multiplier against ZT8 and ZT7 - this allows deeper ooo execution
%assign i 12
%rep ((48 - 8) / 8)
;; compute HashKey^(4 + n), HashKey^(3 + n), ... HashKey^(1 + n)
GHASH_MUL %%ZT8, %%ZT5, %%ZT1, %%ZT3, %%ZT4, %%ZT6, %%ZT2
vmovdqu64 [%%GDATA + HashKey_ %+ i], %%ZT8
%assign i (i + 4)
;; compute HashKey^(8 + n), HashKey^(7 + n), ... HashKey^(5 + n)
GHASH_MUL %%ZT7, %%ZT5, %%ZT1, %%ZT3, %%ZT4, %%ZT6, %%ZT2
vmovdqu64 [%%GDATA + HashKey_ %+ i], %%ZT7
%assign i (i + 4)
%endrep
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; READ_SMALL_DATA_INPUT
;;; Packs xmm register with data when data input is less or equal to 16 bytes
;;; Returns 0 if data has length 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro READ_SMALL_DATA_INPUT 5
%define %%OUTPUT %1 ; [out] xmm register
%define %%INPUT %2 ; [in] buffer pointer to read from
%define %%LENGTH %3 ; [in] number of bytes to read
%define %%TMP1 %4 ; [clobbered]
%define %%MASK %5 ; [out] k1 to k7 register to store the partial block mask
cmp %%LENGTH, 16
jge %%_read_small_data_ge16
lea %%TMP1, [rel byte_len_to_mask_table]
%ifidn __OUTPUT_FORMAT__, win64
add %%TMP1, %%LENGTH
add %%TMP1, %%LENGTH
kmovw %%MASK, [%%TMP1]
%else
kmovw %%MASK, [%%TMP1 + %%LENGTH*2]
%endif
vmovdqu8 %%OUTPUT{%%MASK}{z}, [%%INPUT]
jmp %%_read_small_data_end
%%_read_small_data_ge16:
VX512LDR %%OUTPUT, [%%INPUT]
mov %%TMP1, 0xffff
kmovq %%MASK, %%TMP1
%%_read_small_data_end:
%endmacro ; READ_SMALL_DATA_INPUT
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; CALC_AAD_HASH: Calculates the hash of the data which will not be encrypted.
; Input: The input data (A_IN), that data's length (A_LEN), and the hash key (HASH_KEY).
; Output: The hash of the data (AAD_HASH).
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro CALC_AAD_HASH 26
%define %%A_IN %1 ; [in] AAD text pointer
%define %%A_LEN %2 ; [in] AAD length
%define %%AAD_HASH %3 ; [in/out] xmm ghash value
%define %%GDATA_KEY %4 ; [in] pointer to keys
%define %%ZT0 %5 ; [clobbered] ZMM register
%define %%ZT1 %6 ; [clobbered] ZMM register
%define %%ZT2 %7 ; [clobbered] ZMM register
%define %%ZT3 %8 ; [clobbered] ZMM register
%define %%ZT4 %9 ; [clobbered] ZMM register
%define %%ZT5 %10 ; [clobbered] ZMM register
%define %%ZT6 %11 ; [clobbered] ZMM register
%define %%ZT7 %12 ; [clobbered] ZMM register
%define %%ZT8 %13 ; [clobbered] ZMM register
%define %%ZT9 %14 ; [clobbered] ZMM register
%define %%ZT10 %15 ; [clobbered] ZMM register
%define %%ZT11 %16 ; [clobbered] ZMM register
%define %%ZT12 %17 ; [clobbered] ZMM register
%define %%ZT13 %18 ; [clobbered] ZMM register
%define %%ZT14 %19 ; [clobbered] ZMM register
%define %%ZT15 %20 ; [clobbered] ZMM register
%define %%ZT16 %21 ; [clobbered] ZMM register
%define %%ZT17 %22 ; [clobbered] ZMM register
%define %%T1 %23 ; [clobbered] GP register
%define %%T2 %24 ; [clobbered] GP register
%define %%T3 %25 ; [clobbered] GP register
%define %%MASKREG %26 ; [clobbered] mask register
%define %%SHFMSK %%ZT13
mov %%T1, %%A_IN ; T1 = AAD
mov %%T2, %%A_LEN ; T2 = aadLen
or %%T2, %%T2
jz %%_CALC_AAD_done
vmovdqa64 %%SHFMSK, [rel SHUF_MASK]
%%_get_AAD_loop48x16:
cmp %%T2, (48*16)
jl %%_exit_AAD_loop48x16
vmovdqu64 %%ZT1, [%%T1 + 64*0] ; Blocks 0-3
vmovdqu64 %%ZT2, [%%T1 + 64*1] ; Blocks 4-7
vmovdqu64 %%ZT3, [%%T1 + 64*2] ; Blocks 8-11
vmovdqu64 %%ZT4, [%%T1 + 64*3] ; Blocks 12-15
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
vpshufb %%ZT4, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, %%ZT4, \
16, multi_call, first, 48, %%ZT14, %%ZT15, %%ZT16, %%ZT17
vmovdqu64 %%ZT1, [%%T1 + 16*16 + 64*0] ; Blocks 16-19
vmovdqu64 %%ZT2, [%%T1 + 16*16 + 64*1] ; Blocks 20-23
vmovdqu64 %%ZT3, [%%T1 + 16*16 + 64*2] ; Blocks 24-27
vmovdqu64 %%ZT4, [%%T1 + 16*16 + 64*3] ; Blocks 28-31
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
vpshufb %%ZT4, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, %%ZT4, \
16, multi_call, mid, 32, %%ZT14, %%ZT15, %%ZT16, %%ZT17
vmovdqu64 %%ZT1, [%%T1 + 32*16 + 64*0] ; Blocks 32-35
vmovdqu64 %%ZT2, [%%T1 + 32*16 + 64*1] ; Blocks 36-39
vmovdqu64 %%ZT3, [%%T1 + 32*16 + 64*2] ; Blocks 40-43
vmovdqu64 %%ZT4, [%%T1 + 32*16 + 64*3] ; Blocks 44-47
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
vpshufb %%ZT4, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, %%ZT4, \
16, multi_call, last, 16, %%ZT14, %%ZT15, %%ZT16, %%ZT17
sub %%T2, (48*16)
je %%_CALC_AAD_done
add %%T1, (48*16)
jmp %%_get_AAD_loop48x16
%%_exit_AAD_loop48x16:
; Less than 48x16 bytes remaining
cmp %%T2, (32*16)
jl %%_less_than_32x16
; Get next 16 blocks
vmovdqu64 %%ZT1, [%%T1 + 64*0]
vmovdqu64 %%ZT2, [%%T1 + 64*1]
vmovdqu64 %%ZT3, [%%T1 + 64*2]
vmovdqu64 %%ZT4, [%%T1 + 64*3]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
vpshufb %%ZT4, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, %%ZT4, \
16, multi_call, first, 32, %%ZT14, %%ZT15, %%ZT16, %%ZT17
vmovdqu64 %%ZT1, [%%T1 + 16*16 + 64*0]
vmovdqu64 %%ZT2, [%%T1 + 16*16 + 64*1]
vmovdqu64 %%ZT3, [%%T1 + 16*16 + 64*2]
vmovdqu64 %%ZT4, [%%T1 + 16*16 + 64*3]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
vpshufb %%ZT4, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, %%ZT4, \
16, multi_call, last, 16, %%ZT14, %%ZT15, %%ZT16, %%ZT17
sub %%T2, (32*16)
je %%_CALC_AAD_done
add %%T1, (32*16)
jmp %%_less_than_16x16
%%_less_than_32x16:
cmp %%T2, (16*16)
jl %%_less_than_16x16
; Get next 16 blocks
vmovdqu64 %%ZT1, [%%T1 + 64*0]
vmovdqu64 %%ZT2, [%%T1 + 64*1]
vmovdqu64 %%ZT3, [%%T1 + 64*2]
vmovdqu64 %%ZT4, [%%T1 + 64*3]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
vpshufb %%ZT4, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, %%ZT4, \
16, single_call
sub %%T2, (16*16)
je %%_CALC_AAD_done
add %%T1, (16*16)
; Less than 16x16 bytes remaining
%%_less_than_16x16:
;; prep mask source address
lea %%T3, [rel byte64_len_to_mask_table]
lea %%T3, [%%T3 + %%T2*8]
;; calculate number of blocks to ghash (including partial bytes)
add %%T2, 15
and %%T2, -16 ; 1 to 16 blocks possible here
shr %%T2, 4
cmp %%T2, 1
je %%_AAD_blocks_1
cmp %%T2, 2
je %%_AAD_blocks_2
cmp %%T2, 3
je %%_AAD_blocks_3
cmp %%T2, 4
je %%_AAD_blocks_4
cmp %%T2, 5
je %%_AAD_blocks_5
cmp %%T2, 6
je %%_AAD_blocks_6
cmp %%T2, 7
je %%_AAD_blocks_7
cmp %%T2, 8
je %%_AAD_blocks_8
cmp %%T2, 9
je %%_AAD_blocks_9
cmp %%T2, 10
je %%_AAD_blocks_10
cmp %%T2, 11
je %%_AAD_blocks_11
cmp %%T2, 12
je %%_AAD_blocks_12
cmp %%T2, 13
je %%_AAD_blocks_13
cmp %%T2, 14
je %%_AAD_blocks_14
cmp %%T2, 15
je %%_AAD_blocks_15
;; fall through for 16 blocks
;; The flow of each of these cases is identical:
;; - load blocks plain text
;; - shuffle loaded blocks
;; - xor in current hash value into block 0
;; - perform up multiplications with ghash keys
;; - jump to reduction code
%%_AAD_blocks_16:
; Adjust address to range of byte64_len_to_mask_table
sub %%T3, (64 * 3 * 8)
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1, [%%T1 + 64*0]
vmovdqu8 %%ZT2, [%%T1 + 64*1]
vmovdqu8 %%ZT3, [%%T1 + 64*2]
vmovdqu8 %%ZT4{%%MASKREG}{z}, [%%T1 + 64*3]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
vpshufb %%ZT4, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, %%ZT4, \
16, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_15:
sub %%T3, (64 * 3 * 8)
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1, [%%T1 + 64*0]
vmovdqu8 %%ZT2, [%%T1 + 64*1]
vmovdqu8 %%ZT3, [%%T1 + 64*2]
vmovdqu8 %%ZT4{%%MASKREG}{z}, [%%T1 + 64*3]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
vpshufb %%ZT4, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, %%ZT4, \
15, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_14:
sub %%T3, (64 * 3 * 8)
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1, [%%T1 + 64*0]
vmovdqu8 %%ZT2, [%%T1 + 64*1]
vmovdqu8 %%ZT3, [%%T1 + 64*2]
vmovdqu8 %%ZT4{%%MASKREG}{z}, [%%T1 + 64*3]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
vpshufb %%ZT4, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, %%ZT4, \
14, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_13:
sub %%T3, (64 * 3 * 8)
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1, [%%T1 + 64*0]
vmovdqu8 %%ZT2, [%%T1 + 64*1]
vmovdqu8 %%ZT3, [%%T1 + 64*2]
vmovdqu8 %%ZT4{%%MASKREG}{z}, [%%T1 + 64*3]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
vpshufb %%ZT4, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, %%ZT4, \
13, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_12:
sub %%T3, (64 * 2 * 8)
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1, [%%T1 + 64*0]
vmovdqu8 %%ZT2, [%%T1 + 64*1]
vmovdqu8 %%ZT3{%%MASKREG}{z}, [%%T1 + 64*2]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, no_zmm, \
12, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_11:
sub %%T3, (64 * 2 * 8)
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1, [%%T1 + 64*0]
vmovdqu8 %%ZT2, [%%T1 + 64*1]
vmovdqu8 %%ZT3{%%MASKREG}{z}, [%%T1 + 64*2]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, no_zmm, \
11, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_10:
sub %%T3, (64 * 2 * 8)
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1, [%%T1 + 64*0]
vmovdqu8 %%ZT2, [%%T1 + 64*1]
vmovdqu8 %%ZT3{%%MASKREG}{z}, [%%T1 + 64*2]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, no_zmm, \
10, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_9:
sub %%T3, (64 * 2 * 8)
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1, [%%T1 + 64*0]
vmovdqu8 %%ZT2, [%%T1 + 64*1]
vmovdqu8 %%ZT3{%%MASKREG}{z}, [%%T1 + 64*2]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
vpshufb %%ZT3, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT5, %%ZT6, %%ZT7, %%ZT8, \
%%ZT9, %%ZT10, %%ZT11, %%ZT12, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, %%ZT3, no_zmm, \
9, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_8:
sub %%T3, (64 * 8)
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1, [%%T1 + 64*0]
vmovdqu8 %%ZT2{%%MASKREG}{z}, [%%T1 + 64*1]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT3, %%ZT4, %%ZT5, %%ZT6, \
%%ZT7, %%ZT8, %%ZT9, %%ZT10, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, no_zmm, no_zmm, \
8, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_7:
sub %%T3, (64 * 8)
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1, [%%T1 + 64*0]
vmovdqu8 %%ZT2{%%MASKREG}{z}, [%%T1 + 64*1]
vpshufb %%ZT1, %%SHFMSK
vpshufb %%ZT2, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT3, %%ZT4, %%ZT5, %%ZT6, \
%%ZT7, %%ZT8, %%ZT9, %%ZT10, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, no_zmm, no_zmm, \
7, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_6:
sub %%T3, (64 * 8)
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1, [%%T1 + 64*0]
vmovdqu8 YWORD(%%ZT2){%%MASKREG}{z}, [%%T1 + 64*1]
vpshufb %%ZT1, %%SHFMSK
vpshufb YWORD(%%ZT2), YWORD(%%SHFMSK)
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT3, %%ZT4, %%ZT5, %%ZT6, \
%%ZT7, %%ZT8, %%ZT9, %%ZT10, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, no_zmm, no_zmm, \
6, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_5:
sub %%T3, (64 * 8)
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1, [%%T1 + 64*0]
vmovdqu8 XWORD(%%ZT2){%%MASKREG}{z}, [%%T1 + 64*1]
vpshufb %%ZT1, %%SHFMSK
vpshufb XWORD(%%ZT2), XWORD(%%SHFMSK)
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT3, %%ZT4, %%ZT5, %%ZT6, \
%%ZT7, %%ZT8, %%ZT9, %%ZT10, \
ZWORD(%%AAD_HASH), %%ZT1, %%ZT2, no_zmm, no_zmm, \
5, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_4:
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1{%%MASKREG}{z}, [%%T1 + 64*0]
vpshufb %%ZT1, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT3, %%ZT4, %%ZT5, %%ZT6, \
%%ZT7, %%ZT8, %%ZT9, %%ZT10, \
ZWORD(%%AAD_HASH), %%ZT1, no_zmm, no_zmm, no_zmm, \
4, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_3:
kmovq %%MASKREG, [%%T3]
vmovdqu8 %%ZT1{%%MASKREG}{z}, [%%T1 + 64*0]
vpshufb %%ZT1, %%SHFMSK
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT3, %%ZT4, %%ZT5, %%ZT6, \
%%ZT7, %%ZT8, %%ZT9, %%ZT10, \
ZWORD(%%AAD_HASH), %%ZT1, no_zmm, no_zmm, no_zmm, \
3, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_2:
kmovq %%MASKREG, [%%T3]
vmovdqu8 YWORD(%%ZT1){%%MASKREG}{z}, [%%T1 + 64*0]
vpshufb YWORD(%%ZT1), YWORD(%%SHFMSK)
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT3, %%ZT4, %%ZT5, %%ZT6, \
%%ZT7, %%ZT8, %%ZT9, %%ZT10, \
ZWORD(%%AAD_HASH), %%ZT1, no_zmm, no_zmm, no_zmm, \
2, single_call
jmp %%_CALC_AAD_done
%%_AAD_blocks_1:
kmovq %%MASKREG, [%%T3]
vmovdqu8 XWORD(%%ZT1){%%MASKREG}{z}, [%%T1 + 64*0]
vpshufb XWORD(%%ZT1), XWORD(%%SHFMSK)
GHASH_1_TO_16 %%GDATA_KEY, ZWORD(%%AAD_HASH), \
%%ZT0, %%ZT3, %%ZT4, %%ZT5, %%ZT6, \
%%ZT7, %%ZT8, %%ZT9, %%ZT10, \
ZWORD(%%AAD_HASH), %%ZT1, no_zmm, no_zmm, no_zmm, \
1, single_call
%%_CALC_AAD_done:
;; result in AAD_HASH
%endmacro ; CALC_AAD_HASH
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; PARTIAL_BLOCK
;;; Handles encryption/decryption and the tag partial blocks between
;;; update calls.
;;; Requires the input data be at least 1 byte long.
;;; Output:
;;; A cipher/plain of the first partial block (CYPH_PLAIN_OUT),
;;; AAD_HASH and updated GDATA_CTX
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro PARTIAL_BLOCK 22
%define %%GDATA_KEY %1 ; [in] key pointer
%define %%GDATA_CTX %2 ; [in] context pointer
%define %%CYPH_PLAIN_OUT %3 ; [in] output buffer
%define %%PLAIN_CYPH_IN %4 ; [in] input buffer
%define %%PLAIN_CYPH_LEN %5 ; [in] buffer length
%define %%DATA_OFFSET %6 ; [in/out] data offset (gets updated)
%define %%AAD_HASH %7 ; [out] updated GHASH value
%define %%ENC_DEC %8 ; [in] cipher direction
%define %%GPTMP0 %9 ; [clobbered] GP temporary register
%define %%GPTMP1 %10 ; [clobbered] GP temporary register
%define %%GPTMP2 %11 ; [clobbered] GP temporary register
%define %%ZTMP0 %12 ; [clobbered] ZMM temporary register
%define %%ZTMP1 %13 ; [clobbered] ZMM temporary register
%define %%ZTMP2 %14 ; [clobbered] ZMM temporary register
%define %%ZTMP3 %15 ; [clobbered] ZMM temporary register
%define %%ZTMP4 %16 ; [clobbered] ZMM temporary register
%define %%ZTMP5 %17 ; [clobbered] ZMM temporary register
%define %%ZTMP6 %18 ; [clobbered] ZMM temporary register
%define %%ZTMP7 %19 ; [clobbered] ZMM temporary register
%define %%ZTMP8 %20 ; [clobbered] ZMM temporary register
%define %%ZTMP9 %21 ; [clobbered] ZMM temporary register
%define %%MASKREG %22 ; [clobbered] mask temporary register
%define %%XTMP0 XWORD(%%ZTMP0)
%define %%XTMP1 XWORD(%%ZTMP1)
%define %%XTMP2 XWORD(%%ZTMP2)
%define %%XTMP3 XWORD(%%ZTMP3)
%define %%XTMP4 XWORD(%%ZTMP4)
%define %%XTMP5 XWORD(%%ZTMP5)
%define %%XTMP6 XWORD(%%ZTMP6)
%define %%XTMP7 XWORD(%%ZTMP7)
%define %%XTMP8 XWORD(%%ZTMP8)
%define %%XTMP9 XWORD(%%ZTMP9)
%define %%LENGTH %%GPTMP0
%define %%IA0 %%GPTMP1
%define %%IA1 %%GPTMP2
mov %%LENGTH, [%%GDATA_CTX + PBlockLen]
or %%LENGTH, %%LENGTH
je %%_partial_block_done ;Leave Macro if no partial blocks
READ_SMALL_DATA_INPUT %%XTMP0, %%PLAIN_CYPH_IN, %%PLAIN_CYPH_LEN, %%IA0, %%MASKREG
;; XTMP1 = my_ctx_data.partial_block_enc_key
vmovdqu64 %%XTMP1, [%%GDATA_CTX + PBlockEncKey]
vmovdqu64 %%XTMP2, [%%GDATA_KEY + HashKey]
;; adjust the shuffle mask pointer to be able to shift right %%LENGTH bytes
;; (16 - %%LENGTH) is the number of bytes in plaintext mod 16)
lea %%IA0, [rel SHIFT_MASK]
add %%IA0, %%LENGTH
vmovdqu64 %%XTMP3, [%%IA0] ; shift right shuffle mask
vpshufb %%XTMP1, %%XTMP3
%ifidn %%ENC_DEC, DEC
;; keep copy of cipher text in %%XTMP4
vmovdqa64 %%XTMP4, %%XTMP0
%endif
vpxorq %%XTMP1, %%XTMP0 ; Cyphertext XOR E(K, Yn)
;; Set %%IA1 to be the amount of data left in CYPH_PLAIN_IN after filling the block
;; Determine if partial block is not being filled and shift mask accordingly
mov %%IA1, %%PLAIN_CYPH_LEN
add %%IA1, %%LENGTH
sub %%IA1, 16
jge %%_no_extra_mask
sub %%IA0, %%IA1
%%_no_extra_mask:
;; get the appropriate mask to mask out bottom %%LENGTH bytes of %%XTMP1
;; - mask out bottom %%LENGTH bytes of %%XTMP1
vmovdqu64 %%XTMP0, [%%IA0 + ALL_F - SHIFT_MASK]
vpand %%XTMP1, %%XTMP0
%ifidn %%ENC_DEC, DEC
vpand %%XTMP4, %%XTMP0
vpshufb %%XTMP4, [rel SHUF_MASK]
vpshufb %%XTMP4, %%XTMP3
vpxorq %%AAD_HASH, %%XTMP4
%else
vpshufb %%XTMP1, [rel SHUF_MASK]
vpshufb %%XTMP1, %%XTMP3
vpxorq %%AAD_HASH, %%XTMP1
%endif
cmp %%IA1, 0
jl %%_partial_incomplete
;; GHASH computation for the last <16 Byte block
GHASH_MUL %%AAD_HASH, %%XTMP2, %%XTMP5, %%XTMP6, %%XTMP7, %%XTMP8, %%XTMP9
mov qword [%%GDATA_CTX + PBlockLen], 0
;; Set %%IA1 to be the number of bytes to write out
mov %%IA0, %%LENGTH
mov %%LENGTH, 16
sub %%LENGTH, %%IA0
jmp %%_enc_dec_done
%%_partial_incomplete:
%ifidn __OUTPUT_FORMAT__, win64
mov %%IA0, %%PLAIN_CYPH_LEN
add [%%GDATA_CTX + PBlockLen], %%IA0
%else
add [%%GDATA_CTX + PBlockLen], %%PLAIN_CYPH_LEN
%endif
mov %%LENGTH, %%PLAIN_CYPH_LEN
%%_enc_dec_done:
;; output encrypted Bytes
lea %%IA0, [rel byte_len_to_mask_table]
kmovw %%MASKREG, [%%IA0 + %%LENGTH*2]
vmovdqu64 [%%GDATA_CTX + AadHash], %%AAD_HASH
%ifidn %%ENC_DEC, ENC
;; shuffle XTMP1 back to output as ciphertext
vpshufb %%XTMP1, [rel SHUF_MASK]
vpshufb %%XTMP1, %%XTMP3
%endif
vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET]{%%MASKREG}, %%XTMP1
add %%DATA_OFFSET, %%LENGTH
%%_partial_block_done:
%endmacro ; PARTIAL_BLOCK
%macro GHASH_SINGLE_MUL 9
%define %%GDATA %1
%define %%HASHKEY %2
%define %%CIPHER %3
%define %%STATE_11 %4
%define %%STATE_00 %5
%define %%STATE_MID %6
%define %%T1 %7
%define %%T2 %8
%define %%FIRST %9
vmovdqu %%T1, [%%GDATA + %%HASHKEY]
%ifidn %%FIRST, first
vpclmulqdq %%STATE_11, %%CIPHER, %%T1, 0x11 ; %%T4 = a1*b1
vpclmulqdq %%STATE_00, %%CIPHER, %%T1, 0x00 ; %%T4_2 = a0*b0
vpclmulqdq %%STATE_MID, %%CIPHER, %%T1, 0x01 ; %%T6 = a1*b0
vpclmulqdq %%T2, %%CIPHER, %%T1, 0x10 ; %%T5 = a0*b1
vpxor %%STATE_MID, %%STATE_MID, %%T2
%else
vpclmulqdq %%T2, %%CIPHER, %%T1, 0x11
vpxor %%STATE_11, %%STATE_11, %%T2
vpclmulqdq %%T2, %%CIPHER, %%T1, 0x00
vpxor %%STATE_00, %%STATE_00, %%T2
vpclmulqdq %%T2, %%CIPHER, %%T1, 0x01
vpxor %%STATE_MID, %%STATE_MID, %%T2
vpclmulqdq %%T2, %%CIPHER, %%T1, 0x10
vpxor %%STATE_MID, %%STATE_MID, %%T2
%endif
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; This macro is used to "warm-up" pipeline for GHASH_8_ENCRYPT_8_PARALLEL
;;; macro code. It is called only for data lengths 128 and above.
;;; The flow is as follows:
;;; - encrypt the initial %%num_initial_blocks blocks (can be 0)
;;; - encrypt the next 8 blocks and stitch with
;;; GHASH for the first %%num_initial_blocks
;;; - the last 8th block can be partial (lengths between 129 and 239)
;;; - partial block ciphering is handled within this macro
;;; - top bytes of such block are cleared for
;;; the subsequent GHASH calculations
;;; - PBlockEncKey needs to be setup in case of multi-call
;;; - top bytes of the block need to include encrypted counter block so that
;;; when handling partial block case text is read and XOR'ed against it.
;;; This needs to be in un-shuffled format.
%macro INITIAL_BLOCKS 26-27
%define %%GDATA_KEY %1 ; [in] pointer to GCM keys
%define %%GDATA_CTX %2 ; [in] pointer to GCM context
%define %%CYPH_PLAIN_OUT %3 ; [in] output buffer
%define %%PLAIN_CYPH_IN %4 ; [in] input buffer
%define %%LENGTH %5 ; [in/out] number of bytes to process
%define %%DATA_OFFSET %6 ; [in/out] data offset
%define %%num_initial_blocks %7 ; [in] can be 0, 1, 2, 3, 4, 5, 6 or 7
%define %%CTR %8 ; [in/out] XMM counter block
%define %%AAD_HASH %9 ; [in/out] ZMM with AAD hash
%define %%ZT1 %10 ; [out] ZMM cipher blocks 0-3 for GHASH
%define %%ZT2 %11 ; [out] ZMM cipher blocks 4-7 for GHASH
%define %%ZT3 %12 ; [clobbered] ZMM temporary
%define %%ZT4 %13 ; [clobbered] ZMM temporary
%define %%ZT5 %14 ; [clobbered] ZMM temporary
%define %%ZT6 %15 ; [clobbered] ZMM temporary
%define %%ZT7 %16 ; [clobbered] ZMM temporary
%define %%ZT8 %17 ; [clobbered] ZMM temporary
%define %%ZT9 %18 ; [clobbered] ZMM temporary
%define %%ZT10 %19 ; [clobbered] ZMM temporary
%define %%ZT11 %20 ; [clobbered] ZMM temporary
%define %%ZT12 %21 ; [clobbered] ZMM temporary
%define %%IA0 %22 ; [clobbered] GP temporary
%define %%IA1 %23 ; [clobbered] GP temporary
%define %%ENC_DEC %24 ; [in] ENC/DEC selector
%define %%MASKREG %25 ; [clobbered] mask register
%define %%SHUFMASK %26 ; [in] ZMM with BE/LE shuffle mask
%define %%PARTIAL_PRESENT %27 ; [in] "no_partial_block" option can be passed here (if length is guaranteed to be > 15*16 bytes)
%define %%T1 XWORD(%%ZT1)
%define %%T2 XWORD(%%ZT2)
%define %%T3 XWORD(%%ZT3)
%define %%T4 XWORD(%%ZT4)
%define %%T5 XWORD(%%ZT5)
%define %%T6 XWORD(%%ZT6)
%define %%T7 XWORD(%%ZT7)
%define %%T8 XWORD(%%ZT8)
%define %%T9 XWORD(%%ZT9)
%define %%TH %%ZT10
%define %%TM %%ZT11
%define %%TL %%ZT12
;; determine if partial block code needs to be added
%assign partial_block_possible 1
%if %0 > 26
%ifidn %%PARTIAL_PRESENT, no_partial_block
%assign partial_block_possible 0
%endif
%endif
%if %%num_initial_blocks > 0
;; prepare AES counter blocks
%if %%num_initial_blocks == 1
vpaddd %%T3, %%CTR, [rel ONE]
%elif %%num_initial_blocks == 2
vshufi64x2 YWORD(%%ZT3), YWORD(%%CTR), YWORD(%%CTR), 0
vpaddd YWORD(%%ZT3), YWORD(%%ZT3), [rel ddq_add_1234]
%else
vshufi64x2 ZWORD(%%CTR), ZWORD(%%CTR), ZWORD(%%CTR), 0
vpaddd %%ZT3, ZWORD(%%CTR), [rel ddq_add_1234]
vpaddd %%ZT4, ZWORD(%%CTR), [rel ddq_add_5678]
%endif
;; extract new counter value (%%T3)
;; shuffle the counters for AES rounds
%if %%num_initial_blocks <= 4
vextracti32x4 %%CTR, %%ZT3, (%%num_initial_blocks - 1)
%else
vextracti32x4 %%CTR, %%ZT4, (%%num_initial_blocks - 5)
%endif
ZMM_OPCODE3_DSTR_SRC1R_SRC2R_BLOCKS_0_16 %%num_initial_blocks, vpshufb, \
%%ZT3, %%ZT4, no_zmm, no_zmm, \
%%ZT3, %%ZT4, no_zmm, no_zmm, \
%%SHUFMASK, %%SHUFMASK, %%SHUFMASK, %%SHUFMASK
;; load plain/cipher text
ZMM_LOAD_BLOCKS_0_16 %%num_initial_blocks, %%PLAIN_CYPH_IN, %%DATA_OFFSET, \
%%ZT5, %%ZT6, no_zmm, no_zmm
;; AES rounds and XOR with plain/cipher text
%assign j 0
%rep (NROUNDS + 2)
vbroadcastf64x2 %%ZT1, [%%GDATA_KEY + (j * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT3, %%ZT4, no_zmm, no_zmm, \
%%ZT1, j, \
%%ZT5, %%ZT6, no_zmm, no_zmm, \
%%num_initial_blocks, NROUNDS
%assign j (j + 1)
%endrep
;; write cipher/plain text back to output and
;; zero bytes outside the mask before hashing
ZMM_STORE_BLOCKS_0_16 %%num_initial_blocks, %%CYPH_PLAIN_OUT, %%DATA_OFFSET, \
%%ZT3, %%ZT4, no_zmm, no_zmm
;; Shuffle the cipher text blocks for hashing part
;; ZT5 and ZT6 are expected outputs with blocks for hashing
%ifidn %%ENC_DEC, DEC
;; Decrypt case
;; - cipher blocks are in ZT5 & ZT6
ZMM_OPCODE3_DSTR_SRC1R_SRC2R_BLOCKS_0_16 %%num_initial_blocks, vpshufb, \
%%ZT5, %%ZT6, no_zmm, no_zmm, \
%%ZT5, %%ZT6, no_zmm, no_zmm, \
%%SHUFMASK, %%SHUFMASK, %%SHUFMASK, %%SHUFMASK
%else
;; Encrypt case
;; - cipher blocks are in ZT3 & ZT4
ZMM_OPCODE3_DSTR_SRC1R_SRC2R_BLOCKS_0_16 %%num_initial_blocks, vpshufb, \
%%ZT5, %%ZT6, no_zmm, no_zmm, \
%%ZT3, %%ZT4, no_zmm, no_zmm, \
%%SHUFMASK, %%SHUFMASK, %%SHUFMASK, %%SHUFMASK
%endif ; Encrypt
;; adjust data offset and length
sub %%LENGTH, (%%num_initial_blocks * 16)
add %%DATA_OFFSET, (%%num_initial_blocks * 16)
;; At this stage
;; - ZT5:ZT6 include cipher blocks to be GHASH'ed
%endif ; %%num_initial_blocks > 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; - cipher of %%num_initial_blocks is done
;; - prepare counter blocks for the next 8 blocks (ZT3 & ZT4)
;; - save the last block in %%CTR
;; - shuffle the blocks for AES
;; - stitch encryption of the new blocks with
;; GHASHING the previous blocks
vshufi64x2 ZWORD(%%CTR), ZWORD(%%CTR), ZWORD(%%CTR), 0
vpaddd %%ZT3, ZWORD(%%CTR), [rel ddq_add_1234]
vpaddd %%ZT4, ZWORD(%%CTR), [rel ddq_add_5678]
vextracti32x4 %%CTR, %%ZT4, 3
vpshufb %%ZT3, %%SHUFMASK
vpshufb %%ZT4, %%SHUFMASK
%if partial_block_possible != 0
;; get text load/store mask (assume full mask by default)
mov %%IA0, 0xffff_ffff_ffff_ffff
%if %%num_initial_blocks > 0
;; NOTE: 'jge' is always taken for %%num_initial_blocks = 0
;; This macro is executed for length 128 and up,
;; zero length is checked in GCM_ENC_DEC.
;; We know there is partial block if:
;; LENGTH - 16*num_initial_blocks < 128
cmp %%LENGTH, 128
jge %%_initial_partial_block_continue
mov %%IA1, rcx
mov rcx, 128
sub rcx, %%LENGTH
shr %%IA0, cl
mov rcx, %%IA1
%%_initial_partial_block_continue:
%endif
kmovq %%MASKREG, %%IA0
;; load plain or cipher text (masked)
ZMM_LOAD_MASKED_BLOCKS_0_16 8, %%PLAIN_CYPH_IN, %%DATA_OFFSET, \
%%ZT1, %%ZT2, no_zmm, no_zmm, %%MASKREG
%else
;; load plain or cipher text
ZMM_LOAD_BLOCKS_0_16 8, %%PLAIN_CYPH_IN, %%DATA_OFFSET, \
%%ZT1, %%ZT2, no_zmm, no_zmm
%endif ;; partial_block_possible
;; === AES ROUND 0
%assign aes_round 0
vbroadcastf64x2 %%ZT8, [%%GDATA_KEY + (aes_round * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT3, %%ZT4, no_zmm, no_zmm, \
%%ZT8, aes_round, \
%%ZT1, %%ZT2, no_zmm, no_zmm, \
8, NROUNDS
%assign aes_round (aes_round + 1)
;; === GHASH blocks 4-7
%if (%%num_initial_blocks > 0)
;; Hash in AES state
vpxorq %%ZT5, %%ZT5, %%AAD_HASH
VCLMUL_1_TO_8_STEP1 %%GDATA_KEY, %%ZT6, %%ZT8, %%ZT9, \
%%TH, %%TM, %%TL, %%num_initial_blocks
%endif
;; === [1/3] of AES rounds
%rep ((NROUNDS + 1) / 3)
vbroadcastf64x2 %%ZT8, [%%GDATA_KEY + (aes_round * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT3, %%ZT4, no_zmm, no_zmm, \
%%ZT8, aes_round, \
%%ZT1, %%ZT2, no_zmm, no_zmm, \
8, NROUNDS
%assign aes_round (aes_round + 1)
%endrep ; %rep ((NROUNDS + 1) / 2)
;; === GHASH blocks 0-3 and gather
%if (%%num_initial_blocks > 0)
VCLMUL_1_TO_8_STEP2 %%GDATA_KEY, %%ZT6, %%ZT5, \
%%ZT7, %%ZT8, %%ZT9, \
%%TH, %%TM, %%TL, %%num_initial_blocks
%endif
;; === [2/3] of AES rounds
%rep ((NROUNDS + 1) / 3)
vbroadcastf64x2 %%ZT8, [%%GDATA_KEY + (aes_round * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT3, %%ZT4, no_zmm, no_zmm, \
%%ZT8, aes_round, \
%%ZT1, %%ZT2, no_zmm, no_zmm, \
8, NROUNDS
%assign aes_round (aes_round + 1)
%endrep ; %rep ((NROUNDS + 1) / 2)
;; === GHASH reduction
%if (%%num_initial_blocks > 0)
;; [out] AAD_HASH - hash output
;; [in] T8 - polynomial
;; [in] T6 - high, T5 - low
;; [clobbered] T9, T7 - temporary
vmovdqu64 %%T8, [rel POLY2]
VCLMUL_REDUCE XWORD(%%AAD_HASH), %%T8, %%T6, %%T5, %%T7, %%T9
%endif
;; === [3/3] of AES rounds
%rep (((NROUNDS + 1) / 3) + 2)
%if aes_round < (NROUNDS + 2)
vbroadcastf64x2 %%ZT8, [%%GDATA_KEY + (aes_round * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT3, %%ZT4, no_zmm, no_zmm, \
%%ZT8, aes_round, \
%%ZT1, %%ZT2, no_zmm, no_zmm, \
8, NROUNDS
%assign aes_round (aes_round + 1)
%endif
%endrep ; %rep ((NROUNDS + 1) / 2)
%if partial_block_possible != 0
;; write cipher/plain text back to output and
;; zero bytes outside the mask before hashing
ZMM_STORE_MASKED_BLOCKS_0_16 8, %%CYPH_PLAIN_OUT, %%DATA_OFFSET, \
%%ZT3, %%ZT4, no_zmm, no_zmm, %%MASKREG
;; check if there is partial block
cmp %%LENGTH, 128
jl %%_initial_save_partial
;; adjust offset and length
add %%DATA_OFFSET, 128
sub %%LENGTH, 128
jmp %%_initial_blocks_done
%%_initial_save_partial:
;; partial block case
;; - save the partial block in unshuffled format
;; - ZT4 is partially XOR'ed with data and top bytes contain
;; encrypted counter block only
;; - save number of bytes process in the partial block
;; - adjust offset and zero the length
;; - clear top bytes of the partial block for subsequent GHASH calculations
vextracti32x4 [%%GDATA_CTX + PBlockEncKey], %%ZT4, 3
add %%DATA_OFFSET, %%LENGTH
sub %%LENGTH, (128 - 16)
mov [%%GDATA_CTX + PBlockLen], %%LENGTH
xor %%LENGTH, %%LENGTH
vmovdqu8 %%ZT4{%%MASKREG}{z}, %%ZT4
%%_initial_blocks_done:
%else
ZMM_STORE_BLOCKS_0_16 8, %%CYPH_PLAIN_OUT, %%DATA_OFFSET, \
%%ZT3, %%ZT4, no_zmm, no_zmm
add %%DATA_OFFSET, 128
sub %%LENGTH, 128
%endif ;; partial_block_possible
;; Shuffle AES result for GHASH.
%ifidn %%ENC_DEC, DEC
;; Decrypt case
;; - cipher blocks are in ZT1 & ZT2
vpshufb %%ZT1, %%SHUFMASK
vpshufb %%ZT2, %%SHUFMASK
%else
;; Encrypt case
;; - cipher blocks are in ZT3 & ZT4
vpshufb %%ZT1, %%ZT3, %%SHUFMASK
vpshufb %%ZT2, %%ZT4, %%SHUFMASK
%endif ; Encrypt
;; Current hash value is in AAD_HASH
;; Combine GHASHed value with the corresponding ciphertext
vpxorq %%ZT1, %%ZT1, %%AAD_HASH
%endmacro ; INITIAL_BLOCKS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; INITIAL_BLOCKS_PARTIAL macro with support for a partial final block.
;;; It may look similar to INITIAL_BLOCKS but its usage is different:
;;; - first encrypts/decrypts required number of blocks and then
;;; ghashes these blocks
;;; - Small packets or left over data chunks (<256 bytes)
;;; - single or multi call
;;; - Remaining data chunks below 256 bytes (multi buffer code)
;;;
;;; num_initial_blocks is expected to include the partial final block
;;; in the count.
%macro INITIAL_BLOCKS_PARTIAL 38
%define %%GDATA_KEY %1 ; [in] key pointer
%define %%GDATA_CTX %2 ; [in] context pointer
%define %%CYPH_PLAIN_OUT %3 ; [in] text out pointer
%define %%PLAIN_CYPH_IN %4 ; [in] text out pointer
%define %%LENGTH %5 ; [in/clobbered] length in bytes
%define %%DATA_OFFSET %6 ; [in/out] current data offset (updated)
%define %%num_initial_blocks %7 ; [in] can only be 1, 2, 3, 4, 5, ..., 15 or 16 (not 0)
%define %%CTR %8 ; [in/out] current counter value
%define %%HASH_IN_OUT %9 ; [in/out] XMM ghash in/out value
%define %%ENC_DEC %10 ; [in] cipher direction (ENC/DEC)
%define %%INSTANCE_TYPE %11 ; [in] multi_call or single_call
%define %%ZT0 %12 ; [clobbered] ZMM temporary
%define %%ZT1 %13 ; [clobbered] ZMM temporary
%define %%ZT2 %14 ; [clobbered] ZMM temporary
%define %%ZT3 %15 ; [clobbered] ZMM temporary
%define %%ZT4 %16 ; [clobbered] ZMM temporary
%define %%ZT5 %17 ; [clobbered] ZMM temporary
%define %%ZT6 %18 ; [clobbered] ZMM temporary
%define %%ZT7 %19 ; [clobbered] ZMM temporary
%define %%ZT8 %20 ; [clobbered] ZMM temporary
%define %%ZT9 %21 ; [clobbered] ZMM temporary
%define %%ZT10 %22 ; [clobbered] ZMM temporary
%define %%ZT11 %23 ; [clobbered] ZMM temporary
%define %%ZT12 %24 ; [clobbered] ZMM temporary
%define %%ZT13 %25 ; [clobbered] ZMM temporary
%define %%ZT14 %26 ; [clobbered] ZMM temporary
%define %%ZT15 %27 ; [clobbered] ZMM temporary
%define %%ZT16 %28 ; [clobbered] ZMM temporary
%define %%ZT17 %29 ; [clobbered] ZMM temporary
%define %%ZT18 %30 ; [clobbered] ZMM temporary
%define %%ZT19 %31 ; [clobbered] ZMM temporary
%define %%ZT20 %32 ; [clobbered] ZMM temporary
%define %%ZT21 %33 ; [clobbered] ZMM temporary
%define %%ZT22 %34 ; [clobbered] ZMM temporary
%define %%IA0 %35 ; [clobbered] GP temporary
%define %%IA1 %36 ; [clobbered] GP temporary
%define %%MASKREG %37 ; [clobbered] mask register
%define %%SHUFMASK %38 ; [in] ZMM with BE/LE shuffle mask
%define %%T1 XWORD(%%ZT1)
%define %%T2 XWORD(%%ZT2)
%define %%T7 XWORD(%%ZT7)
%define %%CTR0 %%ZT3
%define %%CTR1 %%ZT4
%define %%CTR2 %%ZT8
%define %%CTR3 %%ZT9
%define %%DAT0 %%ZT5
%define %%DAT1 %%ZT6
%define %%DAT2 %%ZT10
%define %%DAT3 %%ZT11
;; Copy ghash to temp reg
vmovdqa64 %%T2, %%HASH_IN_OUT
;; prepare AES counter blocks
%if %%num_initial_blocks == 1
vpaddd XWORD(%%CTR0), %%CTR, [rel ONE]
%elif %%num_initial_blocks == 2
vshufi64x2 YWORD(%%CTR0), YWORD(%%CTR), YWORD(%%CTR), 0
vpaddd YWORD(%%CTR0), YWORD(%%CTR0), [rel ddq_add_1234]
%else
vshufi64x2 ZWORD(%%CTR), ZWORD(%%CTR), ZWORD(%%CTR), 0
vpaddd %%CTR0, ZWORD(%%CTR), [rel ddq_add_1234]
%if %%num_initial_blocks > 4
vpaddd %%CTR1, ZWORD(%%CTR), [rel ddq_add_5678]
%endif
%if %%num_initial_blocks > 8
vpaddd %%CTR2, %%CTR0, [rel ddq_add_8888]
%endif
%if %%num_initial_blocks > 12
vpaddd %%CTR3, %%CTR1, [rel ddq_add_8888]
%endif
%endif
;; get load/store mask
lea %%IA0, [rel byte64_len_to_mask_table]
mov %%IA1, %%LENGTH
%if %%num_initial_blocks > 12
sub %%IA1, 3 * 64
%elif %%num_initial_blocks > 8
sub %%IA1, 2 * 64
%elif %%num_initial_blocks > 4
sub %%IA1, 64
%endif
kmovq %%MASKREG, [%%IA0 + %%IA1*8]
;; extract new counter value
;; shuffle the counters for AES rounds
%if %%num_initial_blocks <= 4
vextracti32x4 %%CTR, %%CTR0, (%%num_initial_blocks - 1)
%elif %%num_initial_blocks <= 8
vextracti32x4 %%CTR, %%CTR1, (%%num_initial_blocks - 5)
%elif %%num_initial_blocks <= 12
vextracti32x4 %%CTR, %%CTR2, (%%num_initial_blocks - 9)
%else
vextracti32x4 %%CTR, %%CTR3, (%%num_initial_blocks - 13)
%endif
ZMM_OPCODE3_DSTR_SRC1R_SRC2R_BLOCKS_0_16 %%num_initial_blocks, vpshufb, \
%%CTR0, %%CTR1, %%CTR2, %%CTR3, \
%%CTR0, %%CTR1, %%CTR2, %%CTR3, \
%%SHUFMASK, %%SHUFMASK, %%SHUFMASK, %%SHUFMASK
;; load plain/cipher text
ZMM_LOAD_MASKED_BLOCKS_0_16 %%num_initial_blocks, %%PLAIN_CYPH_IN, %%DATA_OFFSET, \
%%DAT0, %%DAT1, %%DAT2, %%DAT3, %%MASKREG
;; AES rounds and XOR with plain/cipher text
%assign j 0
%rep (NROUNDS + 2)
vbroadcastf64x2 %%ZT1, [%%GDATA_KEY + (j * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%CTR0, %%CTR1, %%CTR2, %%CTR3, \
%%ZT1, j, \
%%DAT0, %%DAT1, %%DAT2, %%DAT3, \
%%num_initial_blocks, NROUNDS
%assign j (j + 1)
%endrep
;; retrieve the last cipher counter block (partially XOR'ed with text)
;; - this is needed for partial block cases
%if %%num_initial_blocks <= 4
vextracti32x4 %%T1, %%CTR0, (%%num_initial_blocks - 1)
%elif %%num_initial_blocks <= 8
vextracti32x4 %%T1, %%CTR1, (%%num_initial_blocks - 5)
%elif %%num_initial_blocks <= 12
vextracti32x4 %%T1, %%CTR2, (%%num_initial_blocks - 9)
%else
vextracti32x4 %%T1, %%CTR3, (%%num_initial_blocks - 13)
%endif
;; write cipher/plain text back to output and
ZMM_STORE_MASKED_BLOCKS_0_16 %%num_initial_blocks, %%CYPH_PLAIN_OUT, %%DATA_OFFSET, \
%%CTR0, %%CTR1, %%CTR2, %%CTR3, %%MASKREG
;; zero bytes outside the mask before hashing
%if %%num_initial_blocks <= 4
vmovdqu8 %%CTR0{%%MASKREG}{z}, %%CTR0
%elif %%num_initial_blocks <= 8
vmovdqu8 %%CTR1{%%MASKREG}{z}, %%CTR1
%elif %%num_initial_blocks <= 12
vmovdqu8 %%CTR2{%%MASKREG}{z}, %%CTR2
%else
vmovdqu8 %%CTR3{%%MASKREG}{z}, %%CTR3
%endif
;; Shuffle the cipher text blocks for hashing part
;; ZT5 and ZT6 are expected outputs with blocks for hashing
%ifidn %%ENC_DEC, DEC
;; Decrypt case
;; - cipher blocks are in ZT5 & ZT6
ZMM_OPCODE3_DSTR_SRC1R_SRC2R_BLOCKS_0_16 %%num_initial_blocks, vpshufb, \
%%DAT0, %%DAT1, %%DAT2, %%DAT3, \
%%DAT0, %%DAT1, %%DAT2, %%DAT3, \
%%SHUFMASK, %%SHUFMASK, %%SHUFMASK, %%SHUFMASK
%else
;; Encrypt case
;; - cipher blocks are in CTR0-CTR3
ZMM_OPCODE3_DSTR_SRC1R_SRC2R_BLOCKS_0_16 %%num_initial_blocks, vpshufb, \
%%DAT0, %%DAT1, %%DAT2, %%DAT3, \
%%CTR0, %%CTR1, %%CTR2, %%CTR3, \
%%SHUFMASK, %%SHUFMASK, %%SHUFMASK, %%SHUFMASK
%endif ; Encrypt
;; Extract the last block for partials and multi_call cases
%if %%num_initial_blocks <= 4
vextracti32x4 %%T7, %%DAT0, %%num_initial_blocks - 1
%elif %%num_initial_blocks <= 8
vextracti32x4 %%T7, %%DAT1, %%num_initial_blocks - 5
%elif %%num_initial_blocks <= 12
vextracti32x4 %%T7, %%DAT2, %%num_initial_blocks - 9
%else
vextracti32x4 %%T7, %%DAT3, %%num_initial_blocks - 13
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Hash all but the last block of data
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; update data offset
%if %%num_initial_blocks > 1
;; The final block of data may be <16B
add %%DATA_OFFSET, 16 * (%%num_initial_blocks - 1)
sub %%LENGTH, 16 * (%%num_initial_blocks - 1)
%endif
%if %%num_initial_blocks < 16
;; NOTE: the 'jl' is always taken for num_initial_blocks = 16.
;; This is run in the context of GCM_ENC_DEC_SMALL for length < 256.
cmp %%LENGTH, 16
jl %%_small_initial_partial_block
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Handle a full length final block - encrypt and hash all blocks
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
sub %%LENGTH, 16
add %%DATA_OFFSET, 16
mov [%%GDATA_CTX + PBlockLen], %%LENGTH
;; Hash all of the data
;; ZT2 - incoming AAD hash (low 128bits)
;; ZT12-ZT20 - temporary registers
GHASH_1_TO_16 %%GDATA_KEY, %%HASH_IN_OUT, \
%%ZT12, %%ZT13, %%ZT14, %%ZT15, %%ZT16, \
%%ZT17, %%ZT18, %%ZT19, %%ZT20, \
%%ZT2, %%DAT0, %%DAT1, %%DAT2, %%DAT3, \
%%num_initial_blocks, single_call
jmp %%_small_initial_compute_done
%endif ; %if %%num_initial_blocks < 16
%%_small_initial_partial_block:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Handle ghash for a <16B final block
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; In this case if it's a single call to encrypt we can
;; hash all of the data but if it's an init / update / finalize
;; series of call we need to leave the last block if it's
;; less than a full block of data.
mov [%%GDATA_CTX + PBlockLen], %%LENGTH
;; %%T1 is ciphered counter block
vmovdqu64 [%%GDATA_CTX + PBlockEncKey], %%T1
%ifidn %%INSTANCE_TYPE, multi_call
%assign k (%%num_initial_blocks - 1)
%assign last_block_to_hash 1
%else
%assign k (%%num_initial_blocks)
%assign last_block_to_hash 0
%endif
%if (%%num_initial_blocks > last_block_to_hash)
;; ZT12-ZT20 - temporary registers
GHASH_1_TO_16 %%GDATA_KEY, %%HASH_IN_OUT, \
%%ZT12, %%ZT13, %%ZT14, %%ZT15, %%ZT16, \
%%ZT17, %%ZT18, %%ZT19, %%ZT20, \
%%ZT2, %%DAT0, %%DAT1, %%DAT2, %%DAT3, k, single_call
;; just fall through no jmp needed
%else
;; Record that a reduction is not needed -
;; In this case no hashes are computed because there
;; is only one initial block and it is < 16B in length.
;; We only need to check if a reduction is needed if
;; initial_blocks == 1 and init/update/final is being used.
;; In this case we may just have a partial block, and that
;; gets hashed in finalize.
;; The hash should end up in HASH_IN_OUT.
;; The only way we should get here is if there is
;; a partial block of data, so xor that into the hash.
vpxorq %%HASH_IN_OUT, %%T2, %%T7
;; The result is in %%HASH_IN_OUT
jmp %%_after_reduction
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; After GHASH reduction
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%%_small_initial_compute_done:
%ifidn %%INSTANCE_TYPE, multi_call
;; If using init/update/finalize, we need to xor any partial block data
;; into the hash.
%if %%num_initial_blocks > 1
;; NOTE: for %%num_initial_blocks = 0 the xor never takes place
%if %%num_initial_blocks != 16
;; NOTE: for %%num_initial_blocks = 16, %%LENGTH, stored in [PBlockLen] is never zero
or %%LENGTH, %%LENGTH
je %%_after_reduction
%endif ; %%num_initial_blocks != 16
vpxorq %%HASH_IN_OUT, %%HASH_IN_OUT, %%T7
%endif ; %%num_initial_blocks > 1
%endif ; %%INSTANCE_TYPE, multi_call
%%_after_reduction:
;; Final hash is now in HASH_IN_OUT
%endmacro ; INITIAL_BLOCKS_PARTIAL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Main GCM macro stitching cipher with GHASH
;;; - operates on single stream
;;; - encrypts 8 blocks at a time
;;; - ghash the 8 previously encrypted ciphertext blocks
;;; For partial block case and multi_call , AES_PARTIAL_BLOCK on output
;;; contains encrypted counter block.
%macro GHASH_8_ENCRYPT_8_PARALLEL 34-37
%define %%GDATA %1 ; [in] key pointer
%define %%CYPH_PLAIN_OUT %2 ; [in] pointer to output buffer
%define %%PLAIN_CYPH_IN %3 ; [in] pointer to input buffer
%define %%DATA_OFFSET %4 ; [in] data offset
%define %%CTR1 %5 ; [in/out] ZMM counter blocks 0 to 3
%define %%CTR2 %6 ; [in/out] ZMM counter blocks 4 to 7
%define %%GHASHIN_AESOUT_B03 %7 ; [in/out] ZMM ghash in / aes out blocks 0 to 3
%define %%GHASHIN_AESOUT_B47 %8 ; [in/out] ZMM ghash in / aes out blocks 4 to 7
%define %%AES_PARTIAL_BLOCK %9 ; [out] XMM partial block (AES)
%define %%loop_idx %10 ; [in] counter block prep selection "add+shuffle" or "add"
%define %%ENC_DEC %11 ; [in] cipher direction
%define %%FULL_PARTIAL %12 ; [in] last block type selection "full" or "partial"
%define %%IA0 %13 ; [clobbered] temporary GP register
%define %%IA1 %14 ; [clobbered] temporary GP register
%define %%LENGTH %15 ; [in] length
%define %%INSTANCE_TYPE %16 ; [in] 'single_call' or 'multi_call' selection
%define %%GH4KEY %17 ; [in] ZMM with GHASH keys 4 to 1
%define %%GH8KEY %18 ; [in] ZMM with GHASH keys 8 to 5
%define %%SHFMSK %19 ; [in] ZMM with byte swap mask for pshufb
%define %%ZT1 %20 ; [clobbered] temporary ZMM (cipher)
%define %%ZT2 %21 ; [clobbered] temporary ZMM (cipher)
%define %%ZT3 %22 ; [clobbered] temporary ZMM (cipher)
%define %%ZT4 %23 ; [clobbered] temporary ZMM (cipher)
%define %%ZT5 %24 ; [clobbered] temporary ZMM (cipher)
%define %%ZT10 %25 ; [clobbered] temporary ZMM (ghash)
%define %%ZT11 %26 ; [clobbered] temporary ZMM (ghash)
%define %%ZT12 %27 ; [clobbered] temporary ZMM (ghash)
%define %%ZT13 %28 ; [clobbered] temporary ZMM (ghash)
%define %%ZT14 %29 ; [clobbered] temporary ZMM (ghash)
%define %%ZT15 %30 ; [clobbered] temporary ZMM (ghash)
%define %%ZT16 %31 ; [clobbered] temporary ZMM (ghash)
%define %%ZT17 %32 ; [clobbered] temporary ZMM (ghash)
%define %%MASKREG %33 ; [clobbered] mask register for partial loads/stores
%define %%DO_REDUCTION %34 ; [in] "reduction", "no_reduction", "final_reduction"
%define %%TO_REDUCE_L %35 ; [in/out] ZMM for low 4x128-bit in case of "no_reduction"
%define %%TO_REDUCE_H %36 ; [in/out] ZMM for hi 4x128-bit in case of "no_reduction"
%define %%TO_REDUCE_M %37 ; [in/out] ZMM for medium 4x128-bit in case of "no_reduction"
%define %%GH1H %%ZT10
%define %%GH1L %%ZT11
%define %%GH1M1 %%ZT12
%define %%GH1M2 %%ZT13
%define %%GH2H %%ZT14
%define %%GH2L %%ZT15
%define %%GH2M1 %%ZT16
%define %%GH2M2 %%ZT17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; populate counter blocks for cipher part
%ifidn %%loop_idx, in_order
;; %%CTR1 & %%CTR2 are shuffled outside the scope of this macro
;; it has to be kept in unshuffled format
vpshufb %%ZT1, %%CTR1, %%SHFMSK
vpshufb %%ZT2, %%CTR2, %%SHFMSK
%else
vmovdqa64 %%ZT1, %%CTR1
vmovdqa64 %%ZT2, %%CTR2
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; stitch AES rounds with GHASH
%assign aes_round 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AES round 0 - ARK
vbroadcastf64x2 %%ZT3, [%%GDATA + (aes_round * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT1, %%ZT2, no_zmm, no_zmm, \
%%ZT3, aes_round, \
%%ZT4, %%ZT5, no_zmm, no_zmm, \
8, NROUNDS
%assign aes_round (aes_round + 1)
;;==================================================
;; GHASH 4 blocks
vpclmulqdq %%GH1H, %%GHASHIN_AESOUT_B47, %%GH4KEY, 0x11 ; a1*b1
vpclmulqdq %%GH1L, %%GHASHIN_AESOUT_B47, %%GH4KEY, 0x00 ; a0*b0
vpclmulqdq %%GH1M1, %%GHASHIN_AESOUT_B47, %%GH4KEY, 0x01 ; a1*b0
vpclmulqdq %%GH1M2, %%GHASHIN_AESOUT_B47, %%GH4KEY, 0x10 ; a0*b1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 3 AES rounds
%rep 3
vbroadcastf64x2 %%ZT3, [%%GDATA + (aes_round * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT1, %%ZT2, no_zmm, no_zmm, \
%%ZT3, aes_round, \
%%ZT4, %%ZT5, no_zmm, no_zmm, \
8, NROUNDS
%assign aes_round (aes_round + 1)
%endrep ; 3 x AES ROUND
;; =================================================
;; GHASH 4 blocks
vpclmulqdq %%GH2M1, %%GHASHIN_AESOUT_B03, %%GH8KEY, 0x10 ; a0*b1
vpclmulqdq %%GH2M2, %%GHASHIN_AESOUT_B03, %%GH8KEY, 0x01 ; a1*b0
vpclmulqdq %%GH2H, %%GHASHIN_AESOUT_B03, %%GH8KEY, 0x11 ; a1*b1
vpclmulqdq %%GH2L, %%GHASHIN_AESOUT_B03, %%GH8KEY, 0x00 ; a0*b0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 3 AES rounds
%rep 3
vbroadcastf64x2 %%ZT3, [%%GDATA + (aes_round * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT1, %%ZT2, no_zmm, no_zmm, \
%%ZT3, aes_round, \
%%ZT4, %%ZT5, no_zmm, no_zmm, \
8, NROUNDS
%assign aes_round (aes_round + 1)
%endrep ; 3 x AES ROUND
;; =================================================
;; gather GHASH in GH1L (low) and GH1H (high)
%ifidn %%DO_REDUCTION, no_reduction
vpternlogq %%GH1M1, %%GH1M2, %%GH2M1, 0x96 ; TM: GH1M1 ^= GH1M2 ^ GH2M1
vpternlogq %%TO_REDUCE_M, %%GH1M1, %%GH2M2, 0x96 ; TM: TO_REDUCE_M ^= GH1M1 ^ GH2M2
vpternlogq %%TO_REDUCE_H, %%GH1H, %%GH2H, 0x96 ; TH: TO_REDUCE_H ^= GH1H ^ GH2H
vpternlogq %%TO_REDUCE_L, %%GH1L, %%GH2L, 0x96 ; TL: TO_REDUCE_L ^= GH1L ^ GH2L
%endif
%ifidn %%DO_REDUCTION, do_reduction
;; phase 1: add mid products together
vpternlogq %%GH1M1, %%GH1M2, %%GH2M1, 0x96 ; TM: GH1M1 ^= GH1M2 ^ GH2M1
vpxorq %%GH1M1, %%GH1M1, %%GH2M2
vpsrldq %%GH2M1, %%GH1M1, 8
vpslldq %%GH1M1, %%GH1M1, 8
%endif
%ifidn %%DO_REDUCTION, final_reduction
;; phase 1: add mid products together
vpternlogq %%GH1M1, %%GH1M2, %%GH2M1, 0x96 ; TM: GH1M1 ^= GH1M2 ^ GH2M1
vpternlogq %%GH1M1, %%TO_REDUCE_M, %%GH2M2, 0x96 ; TM: GH1M1 ^= TO_REDUCE_M ^ GH2M2
vpsrldq %%GH2M1, %%GH1M1, 8
vpslldq %%GH1M1, %%GH1M1, 8
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 2 AES rounds
%rep 2
vbroadcastf64x2 %%ZT3, [%%GDATA + (aes_round * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT1, %%ZT2, no_zmm, no_zmm, \
%%ZT3, aes_round, \
%%ZT4, %%ZT5, no_zmm, no_zmm, \
8, NROUNDS
%assign aes_round (aes_round + 1)
%endrep ; 2 x AES ROUND
;; =================================================
;; Add mid product to high and low then
;; horizontal xor of low and high 4x128
%ifidn %%DO_REDUCTION, final_reduction
vpternlogq %%GH1H, %%GH2H, %%GH2M1, 0x96 ; TH = TH1 + TH2 + TM>>64
vpxorq %%GH1H, %%TO_REDUCE_H
vpternlogq %%GH1L, %%GH2L, %%GH1M1, 0x96 ; TL = TL1 + TL2 + TM<<64
vpxorq %%GH1L, %%TO_REDUCE_L
%endif
%ifidn %%DO_REDUCTION, do_reduction
vpternlogq %%GH1H, %%GH2H, %%GH2M1, 0x96 ; TH = TH1 + TH2 + TM>>64
vpternlogq %%GH1L, %%GH2L, %%GH1M1, 0x96 ; TL = TL1 + TL2 + TM<<64
%endif
%ifnidn %%DO_REDUCTION, no_reduction
VHPXORI4x128 %%GH1H, %%GH2H
VHPXORI4x128 %%GH1L, %%GH2L
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 2 AES rounds
%rep 2
%if (aes_round < (NROUNDS + 1))
vbroadcastf64x2 %%ZT3, [%%GDATA + (aes_round * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT1, %%ZT2, no_zmm, no_zmm, \
%%ZT3, aes_round, \
%%ZT4, %%ZT5, no_zmm, no_zmm, \
8, NROUNDS
%assign aes_round (aes_round + 1)
%endif ; aes_round < (NROUNDS + 1)
%endrep
;; =================================================
;; first phase of reduction
%ifnidn %%DO_REDUCTION, no_reduction
vmovdqu64 XWORD(%%GH2M2), [rel POLY2]
vpclmulqdq XWORD(%%ZT15), XWORD(%%GH2M2), XWORD(%%GH1L), 0x01
vpslldq XWORD(%%ZT15), XWORD(%%ZT15), 8 ; shift-L 2 DWs
vpxorq XWORD(%%ZT15), XWORD(%%GH1L), XWORD(%%ZT15) ; first phase of the reduct
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 2 AES rounds
%rep 2
%if (aes_round < (NROUNDS + 1))
vbroadcastf64x2 %%ZT3, [%%GDATA + (aes_round * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT1, %%ZT2, no_zmm, no_zmm, \
%%ZT3, aes_round, \
%%ZT4, %%ZT5, no_zmm, no_zmm, \
8, NROUNDS
%assign aes_round (aes_round + 1)
%endif ; aes_round < (NROUNDS + 1)
%endrep
;; =================================================
;; second phase of the reduction
%ifnidn %%DO_REDUCTION, no_reduction
vpclmulqdq XWORD(%%ZT16), XWORD(%%GH2M2), XWORD(%%ZT15), 0x00
vpsrldq XWORD(%%ZT16), XWORD(%%ZT16), 4 ; shift-R 1-DW to obtain 2-DWs shift-R
vpclmulqdq XWORD(%%ZT13), XWORD(%%GH2M2), XWORD(%%ZT15), 0x10
vpslldq XWORD(%%ZT13), XWORD(%%ZT13), 4 ; shift-L 1-DW for result without shifts
;; ZT13 = ZT13 xor ZT16 xor GH1H
vpternlogq XWORD(%%ZT13), XWORD(%%ZT16), XWORD(%%GH1H), 0x96
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; all remaining AES rounds but the last
%rep (NROUNDS + 2)
%if (aes_round < (NROUNDS + 1))
vbroadcastf64x2 %%ZT3, [%%GDATA + (aes_round * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT1, %%ZT2, no_zmm, no_zmm, \
%%ZT3, aes_round, \
%%ZT4, %%ZT5, no_zmm, no_zmm, \
8, NROUNDS
%assign aes_round (aes_round + 1)
%endif ; aes_round < (NROUNDS + 1)
%endrep
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; load/store mask (partial case) and load the text data
%ifidn %%FULL_PARTIAL, full
vmovdqu8 %%ZT4, [%%PLAIN_CYPH_IN + %%DATA_OFFSET]
vmovdqu8 %%ZT5, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 64]
%else
lea %%IA0, [rel byte64_len_to_mask_table]
mov %%IA1, %%LENGTH
sub %%IA1, 64
kmovq %%MASKREG, [%%IA0 + 8*%%IA1]
vmovdqu8 %%ZT4, [%%PLAIN_CYPH_IN + %%DATA_OFFSET]
vmovdqu8 %%ZT5{%%MASKREG}{z}, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 64]
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; the last AES round (NROUNDS + 1) and XOR against plain/cipher text
vbroadcastf64x2 %%ZT3, [%%GDATA + (aes_round * 16)]
ZMM_AESENC_ROUND_BLOCKS_0_16 %%ZT1, %%ZT2, no_zmm, no_zmm, \
%%ZT3, aes_round, \
%%ZT4, %%ZT5, no_zmm, no_zmm, \
8, NROUNDS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; store the cipher/plain text data
%ifidn %%FULL_PARTIAL, full
vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%ZT1
vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 64], %%ZT2
%else
vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%ZT1
vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 64]{%%MASKREG}, %%ZT2
%endif
;; =================================================
;; prep cipher text blocks for the next ghash round
%ifnidn %%FULL_PARTIAL, full
%ifidn %%INSTANCE_TYPE, multi_call
;; for partial block & multi_call we need encrypted counter block
vpxorq %%ZT3, %%ZT2, %%ZT5
vextracti32x4 %%AES_PARTIAL_BLOCK, %%ZT3, 3
%endif
;; for GHASH computation purpose clear the top bytes of the partial block
%ifidn %%ENC_DEC, ENC
vmovdqu8 %%ZT2{%%MASKREG}{z}, %%ZT2
%else
vmovdqu8 %%ZT5{%%MASKREG}{z}, %%ZT5
%endif
%endif ; %ifnidn %%FULL_PARTIAL, full
;; =================================================
;; shuffle cipher text blocks for GHASH computation
%ifidn %%ENC_DEC, ENC
vpshufb %%GHASHIN_AESOUT_B03, %%ZT1, %%SHFMSK
vpshufb %%GHASHIN_AESOUT_B47, %%ZT2, %%SHFMSK
%else
vpshufb %%GHASHIN_AESOUT_B03, %%ZT4, %%SHFMSK
vpshufb %%GHASHIN_AESOUT_B47, %%ZT5, %%SHFMSK
%endif
%ifidn %%DO_REDUCTION, do_reduction
;; =================================================
;; XOR current GHASH value (ZT13) into block 0
vpxorq %%GHASHIN_AESOUT_B03, %%ZT13
%endif
%ifidn %%DO_REDUCTION, final_reduction
;; =================================================
;; Return GHASH value (ZT13) in TO_REDUCE_L
vmovdqa64 %%TO_REDUCE_L, %%ZT13
%endif
%endmacro ; GHASH_8_ENCRYPT_8_PARALLEL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Main GCM macro stitching cipher with GHASH
;;; - operates on single stream
;;; - encrypts 16 blocks at a time
;;; - ghash the 16 previously encrypted ciphertext blocks
;;; - no partial block or multi_call handling here
%macro GHASH_16_ENCRYPT_16_PARALLEL 42
%define %%GDATA %1 ; [in] key pointer
%define %%CYPH_PLAIN_OUT %2 ; [in] pointer to output buffer
%define %%PLAIN_CYPH_IN %3 ; [in] pointer to input buffer
%define %%DATA_OFFSET %4 ; [in] data offset
%define %%CTR_BE %5 ; [in/out] ZMM counter blocks (last 4) in big-endian
%define %%CTR_CHECK %6 ; [in/out] GP with 8-bit counter for overflow check
%define %%HASHKEY_OFFSET %7 ; [in] numerical offset for the highest hash key
%define %%AESOUT_BLK_OFFSET %8 ; [in] numerical offset for AES-CTR out
%define %%GHASHIN_BLK_OFFSET %9 ; [in] numerical offset for GHASH blocks in
%define %%SHFMSK %10 ; [in] ZMM with byte swap mask for pshufb
%define %%ZT1 %11 ; [clobbered] temporary ZMM (cipher)
%define %%ZT2 %12 ; [clobbered] temporary ZMM (cipher)
%define %%ZT3 %13 ; [clobbered] temporary ZMM (cipher)
%define %%ZT4 %14 ; [clobbered] temporary ZMM (cipher)
%define %%ZT5 %15 ; [clobbered/out] temporary ZMM or GHASH OUT (final_reduction)
%define %%ZT6 %16 ; [clobbered] temporary ZMM (cipher)
%define %%ZT7 %17 ; [clobbered] temporary ZMM (cipher)
%define %%ZT8 %18 ; [clobbered] temporary ZMM (cipher)
%define %%ZT9 %19 ; [clobbered] temporary ZMM (cipher)
%define %%ZT10 %20 ; [clobbered] temporary ZMM (ghash)
%define %%ZT11 %21 ; [clobbered] temporary ZMM (ghash)
%define %%ZT12 %22 ; [clobbered] temporary ZMM (ghash)
%define %%ZT13 %23 ; [clobbered] temporary ZMM (ghash)
%define %%ZT14 %24 ; [clobbered] temporary ZMM (ghash)
%define %%ZT15 %25 ; [clobbered] temporary ZMM (ghash)
%define %%ZT16 %26 ; [clobbered] temporary ZMM (ghash)
%define %%ZT17 %27 ; [clobbered] temporary ZMM (ghash)
%define %%ZT18 %28 ; [clobbered] temporary ZMM (ghash)
%define %%ZT19 %29 ; [clobbered] temporary ZMM
%define %%ZT20 %30 ; [clobbered] temporary ZMM
%define %%ZT21 %31 ; [clobbered] temporary ZMM
%define %%ZT22 %32 ; [clobbered] temporary ZMM
%define %%ZT23 %33 ; [clobbered] temporary ZMM
%define %%ADDBE_4x4 %34 ; [in] ZMM with 4x128bits 4 in big-endian
%define %%ADDBE_1234 %35 ; [in] ZMM with 4x128bits 1, 2, 3 and 4 in big-endian
%define %%TO_REDUCE_L %36 ; [in/out] ZMM for low 4x128-bit GHASH sum
%define %%TO_REDUCE_H %37 ; [in/out] ZMM for hi 4x128-bit GHASH sum
%define %%TO_REDUCE_M %38 ; [in/out] ZMM for medium 4x128-bit GHASH sum
%define %%DO_REDUCTION %39 ; [in] "no_reduction", "final_reduction", "first_time"
%define %%ENC_DEC %40 ; [in] cipher direction
%define %%DATA_DISPL %41 ; [in] fixed numerical data displacement/offset
%define %%GHASH_IN %42 ; [in] current GHASH value or "no_ghash_in"
%define %%B00_03 %%ZT1
%define %%B04_07 %%ZT2
%define %%B08_11 %%ZT3
%define %%B12_15 %%ZT4
%define %%GH1H %%ZT5 ; @note: do not change this mapping
%define %%GH1L %%ZT6
%define %%GH1M %%ZT7
%define %%GH1T %%ZT8
%define %%GH2H %%ZT9
%define %%GH2L %%ZT10
%define %%GH2M %%ZT11
%define %%GH2T %%ZT12
%define %%RED_POLY %%GH2T
%define %%RED_P1 %%GH2L
%define %%RED_T1 %%GH2H
%define %%RED_T2 %%GH2M
%define %%GH3H %%ZT13
%define %%GH3L %%ZT14
%define %%GH3M %%ZT15
%define %%GH3T %%ZT16
%define %%DATA1 %%ZT13
%define %%DATA2 %%ZT14
%define %%DATA3 %%ZT15
%define %%DATA4 %%ZT16
%define %%AESKEY1 %%ZT17
%define %%AESKEY2 %%ZT18
%define %%GHKEY1 %%ZT19
%define %%GHKEY2 %%ZT20
%define %%GHDAT1 %%ZT21
%define %%GHDAT2 %%ZT22
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; prepare counter blocks
cmp BYTE(%%CTR_CHECK), (256 - 16)
jae %%_16_blocks_overflow
vpaddd %%B00_03, %%CTR_BE, %%ADDBE_1234
vpaddd %%B04_07, %%B00_03, %%ADDBE_4x4
vpaddd %%B08_11, %%B04_07, %%ADDBE_4x4
vpaddd %%B12_15, %%B08_11, %%ADDBE_4x4
jmp %%_16_blocks_ok
%%_16_blocks_overflow:
vpshufb %%CTR_BE, %%CTR_BE, %%SHFMSK
vmovdqa64 %%B12_15, [rel ddq_add_4444]
vpaddd %%B00_03, %%CTR_BE, [rel ddq_add_1234]
vpaddd %%B04_07, %%B00_03, %%B12_15
vpaddd %%B08_11, %%B04_07, %%B12_15
vpaddd %%B12_15, %%B08_11, %%B12_15
vpshufb %%B00_03, %%SHFMSK
vpshufb %%B04_07, %%SHFMSK
vpshufb %%B08_11, %%SHFMSK
vpshufb %%B12_15, %%SHFMSK
%%_16_blocks_ok:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; pre-load constants
vbroadcastf64x2 %%AESKEY1, [%%GDATA + (16 * 0)]
%ifnidn %%GHASH_IN, no_ghash_in
vpxorq %%GHDAT1, %%GHASH_IN, [rsp + %%GHASHIN_BLK_OFFSET + (0*64)]
%else
vmovdqa64 %%GHDAT1, [rsp + %%GHASHIN_BLK_OFFSET + (0*64)]
%endif
vmovdqu64 %%GHKEY1, [%%GDATA + %%HASHKEY_OFFSET + (0*64)]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; save counter for the next round
;; increment counter overflow check register
vshufi64x2 %%CTR_BE, %%B12_15, %%B12_15, 1111_1111b
add BYTE(%%CTR_CHECK), 16
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; pre-load constants
vbroadcastf64x2 %%AESKEY2, [%%GDATA + (16 * 1)]
vmovdqu64 %%GHKEY2, [%%GDATA + %%HASHKEY_OFFSET + (1*64)]
vmovdqa64 %%GHDAT2, [rsp + %%GHASHIN_BLK_OFFSET + (1*64)]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; stitch AES rounds with GHASH
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AES round 0 - ARK
vpxorq %%B00_03, %%AESKEY1
vpxorq %%B04_07, %%AESKEY1
vpxorq %%B08_11, %%AESKEY1
vpxorq %%B12_15, %%AESKEY1
vbroadcastf64x2 %%AESKEY1, [%%GDATA + (16 * 2)]
;;==================================================
;; GHASH 4 blocks (15 to 12)
vpclmulqdq %%GH1H, %%GHDAT1, %%GHKEY1, 0x11 ; a1*b1
vpclmulqdq %%GH1L, %%GHDAT1, %%GHKEY1, 0x00 ; a0*b0
vpclmulqdq %%GH1M, %%GHDAT1, %%GHKEY1, 0x01 ; a1*b0
vpclmulqdq %%GH1T, %%GHDAT1, %%GHKEY1, 0x10 ; a0*b1
vmovdqu64 %%GHKEY1, [%%GDATA + %%HASHKEY_OFFSET + (2*64)]
vmovdqa64 %%GHDAT1, [rsp + %%GHASHIN_BLK_OFFSET + (2*64)]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AES round 1
vaesenc %%B00_03, %%B00_03, %%AESKEY2
vaesenc %%B04_07, %%B04_07, %%AESKEY2
vaesenc %%B08_11, %%B08_11, %%AESKEY2
vaesenc %%B12_15, %%B12_15, %%AESKEY2
vbroadcastf64x2 %%AESKEY2, [%%GDATA + (16 * 3)]
;; =================================================
;; GHASH 4 blocks (11 to 8)
vpclmulqdq %%GH2M, %%GHDAT2, %%GHKEY2, 0x10 ; a0*b1
vpclmulqdq %%GH2T, %%GHDAT2, %%GHKEY2, 0x01 ; a1*b0
vpclmulqdq %%GH2H, %%GHDAT2, %%GHKEY2, 0x11 ; a1*b1
vpclmulqdq %%GH2L, %%GHDAT2, %%GHKEY2, 0x00 ; a0*b0
vmovdqu64 %%GHKEY2, [%%GDATA + %%HASHKEY_OFFSET + (3*64)]
vmovdqa64 %%GHDAT2, [rsp + %%GHASHIN_BLK_OFFSET + (3*64)]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AES round 2
vaesenc %%B00_03, %%B00_03, %%AESKEY1
vaesenc %%B04_07, %%B04_07, %%AESKEY1
vaesenc %%B08_11, %%B08_11, %%AESKEY1
vaesenc %%B12_15, %%B12_15, %%AESKEY1
vbroadcastf64x2 %%AESKEY1, [%%GDATA + (16 * 4)]
;; =================================================
;; GHASH 4 blocks (7 to 4)
vpclmulqdq %%GH3M, %%GHDAT1, %%GHKEY1, 0x10 ; a0*b1
vpclmulqdq %%GH3T, %%GHDAT1, %%GHKEY1, 0x01 ; a1*b0
vpclmulqdq %%GH3H, %%GHDAT1, %%GHKEY1, 0x11 ; a1*b1
vpclmulqdq %%GH3L, %%GHDAT1, %%GHKEY1, 0x00 ; a0*b0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AES rounds 3
vaesenc %%B00_03, %%B00_03, %%AESKEY2
vaesenc %%B04_07, %%B04_07, %%AESKEY2
vaesenc %%B08_11, %%B08_11, %%AESKEY2
vaesenc %%B12_15, %%B12_15, %%AESKEY2
vbroadcastf64x2 %%AESKEY2, [%%GDATA + (16 * 5)]
;; =================================================
;; Gather (XOR) GHASH for 12 blocks
vpternlogq %%GH1H, %%GH2H, %%GH3H, 0x96
vpternlogq %%GH1L, %%GH2L, %%GH3L, 0x96
vpternlogq %%GH1T, %%GH2T, %%GH3T, 0x96
vpternlogq %%GH1M, %%GH2M, %%GH3M, 0x96
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AES rounds 4
vaesenc %%B00_03, %%B00_03, %%AESKEY1
vaesenc %%B04_07, %%B04_07, %%AESKEY1
vaesenc %%B08_11, %%B08_11, %%AESKEY1
vaesenc %%B12_15, %%B12_15, %%AESKEY1
vbroadcastf64x2 %%AESKEY1, [%%GDATA + (16 * 6)]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; load plain/cipher text (recycle GH3xx registers)
VX512LDR %%DATA1, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + %%DATA_DISPL + (0 * 64)]
VX512LDR %%DATA2, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + %%DATA_DISPL + (1 * 64)]
VX512LDR %%DATA3, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + %%DATA_DISPL + (2 * 64)]
VX512LDR %%DATA4, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + %%DATA_DISPL + (3 * 64)]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AES rounds 5
vaesenc %%B00_03, %%B00_03, %%AESKEY2
vaesenc %%B04_07, %%B04_07, %%AESKEY2
vaesenc %%B08_11, %%B08_11, %%AESKEY2
vaesenc %%B12_15, %%B12_15, %%AESKEY2
vbroadcastf64x2 %%AESKEY2, [%%GDATA + (16 * 7)]
;; =================================================
;; GHASH 4 blocks (3 to 0)
vpclmulqdq %%GH2M, %%GHDAT2, %%GHKEY2, 0x10 ; a0*b1
vpclmulqdq %%GH2T, %%GHDAT2, %%GHKEY2, 0x01 ; a1*b0
vpclmulqdq %%GH2H, %%GHDAT2, %%GHKEY2, 0x11 ; a1*b1
vpclmulqdq %%GH2L, %%GHDAT2, %%GHKEY2, 0x00 ; a0*b0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AES round 6
vaesenc %%B00_03, %%B00_03, %%AESKEY1
vaesenc %%B04_07, %%B04_07, %%AESKEY1
vaesenc %%B08_11, %%B08_11, %%AESKEY1
vaesenc %%B12_15, %%B12_15, %%AESKEY1
vbroadcastf64x2 %%AESKEY1, [%%GDATA + (16 * 8)]
;; =================================================
;; gather GHASH in GH1L (low) and GH1H (high)
%ifidn %%DO_REDUCTION, first_time
vpternlogq %%GH1M, %%GH1T, %%GH2T, 0x96 ; TM
vpxorq %%TO_REDUCE_M, %%GH1M, %%GH2M ; TM
vpxorq %%TO_REDUCE_H, %%GH1H, %%GH2H ; TH
vpxorq %%TO_REDUCE_L, %%GH1L, %%GH2L ; TL
%endif
%ifidn %%DO_REDUCTION, no_reduction
vpternlogq %%GH1M, %%GH1T, %%GH2T, 0x96 ; TM
vpternlogq %%TO_REDUCE_M, %%GH1M, %%GH2M, 0x96 ; TM
vpternlogq %%TO_REDUCE_H, %%GH1H, %%GH2H, 0x96 ; TH
vpternlogq %%TO_REDUCE_L, %%GH1L, %%GH2L, 0x96 ; TL
%endif
%ifidn %%DO_REDUCTION, final_reduction
;; phase 1: add mid products together
;; also load polynomial constant for reduction
vpternlogq %%GH1M, %%GH1T, %%GH2T, 0x96 ; TM
vpternlogq %%GH1M, %%TO_REDUCE_M, %%GH2M, 0x96
vpsrldq %%GH2M, %%GH1M, 8
vpslldq %%GH1M, %%GH1M, 8
vmovdqa64 XWORD(%%RED_POLY), [rel POLY2]
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AES round 7
vaesenc %%B00_03, %%B00_03, %%AESKEY2
vaesenc %%B04_07, %%B04_07, %%AESKEY2
vaesenc %%B08_11, %%B08_11, %%AESKEY2
vaesenc %%B12_15, %%B12_15, %%AESKEY2
vbroadcastf64x2 %%AESKEY2, [%%GDATA + (16 * 9)]
;; =================================================
;; Add mid product to high and low
%ifidn %%DO_REDUCTION, final_reduction
vpternlogq %%GH1H, %%GH2H, %%GH2M, 0x96 ; TH = TH1 + TH2 + TM>>64
vpxorq %%GH1H, %%TO_REDUCE_H
vpternlogq %%GH1L, %%GH2L, %%GH1M, 0x96 ; TL = TL1 + TL2 + TM<<64
vpxorq %%GH1L, %%TO_REDUCE_L
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AES round 8
vaesenc %%B00_03, %%B00_03, %%AESKEY1
vaesenc %%B04_07, %%B04_07, %%AESKEY1
vaesenc %%B08_11, %%B08_11, %%AESKEY1
vaesenc %%B12_15, %%B12_15, %%AESKEY1
vbroadcastf64x2 %%AESKEY1, [%%GDATA + (16 * 10)]
;; =================================================
;; horizontal xor of low and high 4x128
%ifidn %%DO_REDUCTION, final_reduction
VHPXORI4x128 %%GH1H, %%GH2H
VHPXORI4x128 %%GH1L, %%GH2L
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AES round 9
vaesenc %%B00_03, %%B00_03, %%AESKEY2
vaesenc %%B04_07, %%B04_07, %%AESKEY2
vaesenc %%B08_11, %%B08_11, %%AESKEY2
vaesenc %%B12_15, %%B12_15, %%AESKEY2
%if (NROUNDS >= 11)
vbroadcastf64x2 %%AESKEY2, [%%GDATA + (16 * 11)]
%endif
;; =================================================
;; first phase of reduction
%ifidn %%DO_REDUCTION, final_reduction
vpclmulqdq XWORD(%%RED_P1), XWORD(%%RED_POLY), XWORD(%%GH1L), 0x01
vpslldq XWORD(%%RED_P1), XWORD(%%RED_P1), 8 ; shift-L 2 DWs
vpxorq XWORD(%%RED_P1), XWORD(%%GH1L), XWORD(%%RED_P1) ; first phase of the reduct
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; AES rounds up to 11 (AES192) or 13 (AES256)
;; AES128 is done
%if (NROUNDS >= 11)
vaesenc %%B00_03, %%B00_03, %%AESKEY1
vaesenc %%B04_07, %%B04_07, %%AESKEY1
vaesenc %%B08_11, %%B08_11, %%AESKEY1
vaesenc %%B12_15, %%B12_15, %%AESKEY1
vbroadcastf64x2 %%AESKEY1, [%%GDATA + (16 * 12)]
vaesenc %%B00_03, %%B00_03, %%AESKEY2
vaesenc %%B04_07, %%B04_07, %%AESKEY2
vaesenc %%B08_11, %%B08_11, %%AESKEY2
vaesenc %%B12_15, %%B12_15, %%AESKEY2
%if (NROUNDS == 13)
vbroadcastf64x2 %%AESKEY2, [%%GDATA + (16 * 13)]
vaesenc %%B00_03, %%B00_03, %%AESKEY1
vaesenc %%B04_07, %%B04_07, %%AESKEY1
vaesenc %%B08_11, %%B08_11, %%AESKEY1
vaesenc %%B12_15, %%B12_15, %%AESKEY1
vbroadcastf64x2 %%AESKEY1, [%%GDATA + (16 * 14)]
vaesenc %%B00_03, %%B00_03, %%AESKEY2
vaesenc %%B04_07, %%B04_07, %%AESKEY2
vaesenc %%B08_11, %%B08_11, %%AESKEY2
vaesenc %%B12_15, %%B12_15, %%AESKEY2
%endif ; GCM256 / NROUNDS = 13 (15 including the first and the last)
%endif ; GCM192 / NROUNDS = 11 (13 including the first and the last)
;; =================================================
;; second phase of the reduction
%ifidn %%DO_REDUCTION, final_reduction
vpclmulqdq XWORD(%%RED_T1), XWORD(%%RED_POLY), XWORD(%%RED_P1), 0x00
vpsrldq XWORD(%%RED_T1), XWORD(%%RED_T1), 4 ; shift-R 1-DW to obtain 2-DWs shift-R
vpclmulqdq XWORD(%%RED_T2), XWORD(%%RED_POLY), XWORD(%%RED_P1), 0x10
vpslldq XWORD(%%RED_T2), XWORD(%%RED_T2), 4 ; shift-L 1-DW for result without shifts
;; GH1H = GH1H x RED_T1 x RED_T2
vpternlogq XWORD(%%GH1H), XWORD(%%RED_T2), XWORD(%%RED_T1), 0x96
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; the last AES round
vaesenclast %%B00_03, %%B00_03, %%AESKEY1
vaesenclast %%B04_07, %%B04_07, %%AESKEY1
vaesenclast %%B08_11, %%B08_11, %%AESKEY1
vaesenclast %%B12_15, %%B12_15, %%AESKEY1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; XOR against plain/cipher text
vpxorq %%B00_03, %%B00_03, %%DATA1
vpxorq %%B04_07, %%B04_07, %%DATA2
vpxorq %%B08_11, %%B08_11, %%DATA3
vpxorq %%B12_15, %%B12_15, %%DATA4
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; store cipher/plain text
VX512STR [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + %%DATA_DISPL + (0 * 64)], %%B00_03
VX512STR [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + %%DATA_DISPL + (1 * 64)], %%B04_07
VX512STR [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + %%DATA_DISPL + (2 * 64)], %%B08_11
VX512STR [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + %%DATA_DISPL + (3 * 64)], %%B12_15
;; =================================================
;; shuffle cipher text blocks for GHASH computation
%ifidn %%ENC_DEC, ENC
vpshufb %%B00_03, %%B00_03, %%SHFMSK
vpshufb %%B04_07, %%B04_07, %%SHFMSK
vpshufb %%B08_11, %%B08_11, %%SHFMSK
vpshufb %%B12_15, %%B12_15, %%SHFMSK
%else
vpshufb %%B00_03, %%DATA1, %%SHFMSK
vpshufb %%B04_07, %%DATA2, %%SHFMSK
vpshufb %%B08_11, %%DATA3, %%SHFMSK
vpshufb %%B12_15, %%DATA4, %%SHFMSK
%endif
;; =================================================
;; store shuffled cipher text for ghashing
vmovdqa64 [rsp + %%AESOUT_BLK_OFFSET + (0*64)], %%B00_03
vmovdqa64 [rsp + %%AESOUT_BLK_OFFSET + (1*64)], %%B04_07
vmovdqa64 [rsp + %%AESOUT_BLK_OFFSET + (2*64)], %%B08_11
vmovdqa64 [rsp + %%AESOUT_BLK_OFFSET + (3*64)], %%B12_15
%ifidn %%DO_REDUCTION, final_reduction
;; =================================================
;; Return GHASH value through %%GH1H
%endif
%endmacro ; GHASH_16_ENCRYPT_16_PARALLEL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; GHASH the last 8 ciphertext blocks.
;;; - optionally accepts GHASH product sums as input
%macro GHASH_LAST_8 10-13
%define %%GDATA %1 ; [in] key pointer
%define %%BL47 %2 ; [in/clobbered] ZMM AES blocks 4 to 7
%define %%BL03 %3 ; [in/cloberred] ZMM AES blocks 0 to 3
%define %%ZTH %4 ; [cloberred] ZMM temporary
%define %%ZTM %5 ; [cloberred] ZMM temporary
%define %%ZTL %6 ; [cloberred] ZMM temporary
%define %%ZT01 %7 ; [cloberred] ZMM temporary
%define %%ZT02 %8 ; [cloberred] ZMM temporary
%define %%ZT03 %9 ; [cloberred] ZMM temporary
%define %%AAD_HASH %10 ; [out] XMM hash value
%define %%GH %11 ; [in/optional] ZMM with GHASH high product sum
%define %%GL %12 ; [in/optional] ZMM with GHASH low product sum
%define %%GM %13 ; [in/optional] ZMM with GHASH mid product sum
VCLMUL_STEP1 %%GDATA, %%BL47, %%ZT01, %%ZTH, %%ZTM, %%ZTL
%if %0 > 10
;; add optional sums before step2
vpxorq %%ZTH, %%ZTH, %%GH
vpxorq %%ZTL, %%ZTL, %%GL
vpxorq %%ZTM, %%ZTM, %%GM
%endif
VCLMUL_STEP2 %%GDATA, %%BL47, %%BL03, %%ZT01, %%ZT02, %%ZT03, %%ZTH, %%ZTM, %%ZTL
vmovdqa64 XWORD(%%ZT03), [rel POLY2]
VCLMUL_REDUCE %%AAD_HASH, XWORD(%%ZT03), XWORD(%%BL47), XWORD(%%BL03), \
XWORD(%%ZT01), XWORD(%%ZT02)
%endmacro ; GHASH_LAST_8
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; GHASH the last 7 cipher text blocks.
;;; - it uses same GHASH macros as GHASH_LAST_8 but with some twist
;;; - it loads GHASH keys for each of the data blocks, so that:
;;; - blocks 4, 5 and 6 will use GHASH keys 3, 2, 1 respectively
;;; - code ensures that unused block 7 and corresponding GHASH key are zeroed
;;; (clmul product is zero this way and will not affect the result)
;;; - blocks 0, 1, 2 and 3 will use USE GHASH keys 7, 6, 5 and 4 respectively
;;; - optionally accepts GHASH product sums as input
%macro GHASH_LAST_7 13-16
%define %%GDATA %1 ; [in] key pointer
%define %%BL47 %2 ; [in/clobbered] ZMM AES blocks 4 to 7
%define %%BL03 %3 ; [in/cloberred] ZMM AES blocks 0 to 3
%define %%ZTH %4 ; [cloberred] ZMM temporary
%define %%ZTM %5 ; [cloberred] ZMM temporary
%define %%ZTL %6 ; [cloberred] ZMM temporary
%define %%ZT01 %7 ; [cloberred] ZMM temporary
%define %%ZT02 %8 ; [cloberred] ZMM temporary
%define %%ZT03 %9 ; [cloberred] ZMM temporary
%define %%ZT04 %10 ; [cloberred] ZMM temporary
%define %%AAD_HASH %11 ; [out] XMM hash value
%define %%MASKREG %12 ; [clobbered] mask register to use for loads
%define %%IA0 %13 ; [clobbered] GP temporary register
%define %%GH %14 ; [in/optional] ZMM with GHASH high product sum
%define %%GL %15 ; [in/optional] ZMM with GHASH low product sum
%define %%GM %16 ; [in/optional] ZMM with GHASH mid product sum
vmovdqa64 XWORD(%%ZT04), [rel POLY2]
VCLMUL_1_TO_8_STEP1 %%GDATA, %%BL47, %%ZT01, %%ZT02, %%ZTH, %%ZTM, %%ZTL, 7
%if %0 > 13
;; add optional sums before step2
vpxorq %%ZTH, %%ZTH, %%GH
vpxorq %%ZTL, %%ZTL, %%GL
vpxorq %%ZTM, %%ZTM, %%GM
%endif
VCLMUL_1_TO_8_STEP2 %%GDATA, %%BL47, %%BL03, \
%%ZT01, %%ZT02, %%ZT03, \
%%ZTH, %%ZTM, %%ZTL, 7
VCLMUL_REDUCE %%AAD_HASH, XWORD(%%ZT04), XWORD(%%BL47), XWORD(%%BL03), \
XWORD(%%ZT01), XWORD(%%ZT02)
%endmacro ; GHASH_LAST_7
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Encryption of a single block
%macro ENCRYPT_SINGLE_BLOCK 2
%define %%GDATA %1
%define %%XMM0 %2
vpxorq %%XMM0, %%XMM0, [%%GDATA+16*0]
%assign i 1
%rep NROUNDS
vaesenc %%XMM0, [%%GDATA+16*i]
%assign i (i+1)
%endrep
vaesenclast %%XMM0, [%%GDATA+16*i]
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Save register content for the caller
%macro FUNC_SAVE 0
;; Required for Update/GMC_ENC
;the number of pushes must equal STACK_OFFSET
mov rax, rsp
sub rsp, STACK_FRAME_SIZE
and rsp, ~63
mov [rsp + STACK_GP_OFFSET + 0*8], r12
mov [rsp + STACK_GP_OFFSET + 1*8], r13
mov [rsp + STACK_GP_OFFSET + 2*8], r14
mov [rsp + STACK_GP_OFFSET + 3*8], r15
mov [rsp + STACK_GP_OFFSET + 4*8], rax ; stack
mov r14, rax ; r14 is used to retrieve stack args
mov [rsp + STACK_GP_OFFSET + 5*8], rbp
mov [rsp + STACK_GP_OFFSET + 6*8], rbx
%ifidn __OUTPUT_FORMAT__, win64
mov [rsp + STACK_GP_OFFSET + 7*8], rdi
mov [rsp + STACK_GP_OFFSET + 8*8], rsi
%endif
%ifidn __OUTPUT_FORMAT__, win64
; xmm6:xmm15 need to be maintained for Windows
vmovdqu [rsp + STACK_XMM_OFFSET + 0*16], xmm6
vmovdqu [rsp + STACK_XMM_OFFSET + 1*16], xmm7
vmovdqu [rsp + STACK_XMM_OFFSET + 2*16], xmm8
vmovdqu [rsp + STACK_XMM_OFFSET + 3*16], xmm9
vmovdqu [rsp + STACK_XMM_OFFSET + 4*16], xmm10
vmovdqu [rsp + STACK_XMM_OFFSET + 5*16], xmm11
vmovdqu [rsp + STACK_XMM_OFFSET + 6*16], xmm12
vmovdqu [rsp + STACK_XMM_OFFSET + 7*16], xmm13
vmovdqu [rsp + STACK_XMM_OFFSET + 8*16], xmm14
vmovdqu [rsp + STACK_XMM_OFFSET + 9*16], xmm15
%endif
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Restore register content for the caller
%macro FUNC_RESTORE 0
%ifdef SAFE_DATA
clear_scratch_gps_asm
clear_scratch_zmms_asm
%else
vzeroupper
%endif
%ifidn __OUTPUT_FORMAT__, win64
vmovdqu xmm15, [rsp + STACK_XMM_OFFSET + 9*16]
vmovdqu xmm14, [rsp + STACK_XMM_OFFSET + 8*16]
vmovdqu xmm13, [rsp + STACK_XMM_OFFSET + 7*16]
vmovdqu xmm12, [rsp + STACK_XMM_OFFSET + 6*16]
vmovdqu xmm11, [rsp + STACK_XMM_OFFSET + 5*16]
vmovdqu xmm10, [rsp + STACK_XMM_OFFSET + 4*16]
vmovdqu xmm9, [rsp + STACK_XMM_OFFSET + 3*16]
vmovdqu xmm8, [rsp + STACK_XMM_OFFSET + 2*16]
vmovdqu xmm7, [rsp + STACK_XMM_OFFSET + 1*16]
vmovdqu xmm6, [rsp + STACK_XMM_OFFSET + 0*16]
%endif
;; Required for Update/GMC_ENC
mov rbp, [rsp + STACK_GP_OFFSET + 5*8]
mov rbx, [rsp + STACK_GP_OFFSET + 6*8]
%ifidn __OUTPUT_FORMAT__, win64
mov rdi, [rsp + STACK_GP_OFFSET + 7*8]
mov rsi, [rsp + STACK_GP_OFFSET + 8*8]
%endif
mov r12, [rsp + STACK_GP_OFFSET + 0*8]
mov r13, [rsp + STACK_GP_OFFSET + 1*8]
mov r14, [rsp + STACK_GP_OFFSET + 2*8]
mov r15, [rsp + STACK_GP_OFFSET + 3*8]
mov rsp, [rsp + STACK_GP_OFFSET + 4*8] ; stack
%endmacro
%macro CALC_J0 26
%define %%KEY %1 ;; [in] Pointer to GCM KEY structure
%define %%IV %2 ;; [in] Pointer to IV
%define %%IV_LEN %3 ;; [in] IV length
%define %%J0 %4 ;; [out] XMM reg to contain J0
%define %%ZT0 %5 ;; [clobbered] ZMM register
%define %%ZT1 %6 ;; [clobbered] ZMM register
%define %%ZT2 %7 ;; [clobbered] ZMM register
%define %%ZT3 %8 ;; [clobbered] ZMM register
%define %%ZT4 %9 ;; [clobbered] ZMM register
%define %%ZT5 %10 ;; [clobbered] ZMM register
%define %%ZT6 %11 ;; [clobbered] ZMM register
%define %%ZT7 %12 ;; [clobbered] ZMM register
%define %%ZT8 %13 ;; [clobbered] ZMM register
%define %%ZT9 %14 ;; [clobbered] ZMM register
%define %%ZT10 %15 ;; [clobbered] ZMM register
%define %%ZT11 %16 ;; [clobbered] ZMM register
%define %%ZT12 %17 ;; [clobbered] ZMM register
%define %%ZT13 %18 ;; [clobbered] ZMM register
%define %%ZT14 %19 ;; [clobbered] ZMM register
%define %%ZT15 %20 ;; [clobbered] ZMM register
%define %%ZT16 %21 ;; [clobbered] ZMM register
%define %%ZT17 %22 ;; [clobbered] ZMM register
%define %%T1 %23 ;; [clobbered] GP register
%define %%T2 %24 ;; [clobbered] GP register
%define %%T3 %25 ;; [clobbered] GP register
%define %%MASKREG %26 ;; [clobbered] mask register
%define %%POLY %%ZT8
%define %%TH %%ZT7
%define %%TM %%ZT6
%define %%TL %%ZT5
;; J0 = GHASH(IV || 0s+64 || len(IV)64)
;; s = 16 * RoundUp(len(IV)/16) - len(IV) */
;; Calculate GHASH of (IV || 0s)
vpxor %%J0, %%J0
CALC_AAD_HASH %%IV, %%IV_LEN, %%J0, %%KEY, %%ZT0, %%ZT1, %%ZT2, %%ZT3, \
%%ZT4, %%ZT5, %%ZT6, %%ZT7, %%ZT8, %%ZT9, %%ZT10, %%ZT11, \
%%ZT12, %%ZT13, %%ZT14, %%ZT15, %%ZT16, %%ZT17, \
%%T1, %%T2, %%T3, %%MASKREG
;; Calculate GHASH of last 16-byte block (0 || len(IV)64)
mov %%T1, %%IV_LEN
shl %%T1, 3 ;; IV length in bits
vmovq XWORD(%%ZT2), %%T1
;; Might need shuffle of ZT2
vpxorq %%ZT2, ZWORD(%%J0)
VCLMUL_1_TO_8_STEP1 %%KEY, %%ZT1, %%ZT0, %%ZT3, %%TH, %%TM, %%TL, 1
VCLMUL_1_TO_8_STEP2 %%KEY, %%ZT1, %%ZT2, \
%%ZT0, %%ZT3, %%ZT4, \
%%TH, %%TM, %%TL, 1
;; Multiplications have been done. Do the reduction now
vmovdqa64 XWORD(%%POLY), [rel POLY2]
VCLMUL_REDUCE %%J0, XWORD(%%POLY), XWORD(%%ZT1), XWORD(%%ZT2), \
XWORD(%%ZT0), XWORD(%%ZT3)
vpshufb %%J0, [rel SHUF_MASK] ; perform a 16Byte swap
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; GCM_INIT initializes a gcm_context_data struct to prepare for encoding/decoding.
;;; Input: gcm_key_data * (GDATA_KEY), gcm_context_data *(GDATA_CTX), IV,
;;; Additional Authentication data (A_IN), Additional Data length (A_LEN).
;;; Output: Updated GDATA_CTX with the hash of A_IN (AadHash) and initialized other parts of GDATA_CTX.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro GCM_INIT 29-30
%define %%GDATA_KEY %1 ; [in] GCM expanded keys pointer
%define %%GDATA_CTX %2 ; [in] GCM context pointer
%define %%IV %3 ; [in] IV pointer
%define %%A_IN %4 ; [in] AAD pointer
%define %%A_LEN %5 ; [in] AAD length in bytes
%define %%GPR1 %6 ; [clobbered] GP register
%define %%GPR2 %7 ; [clobbered] GP register
%define %%GPR3 %8 ; [clobbered] GP register
%define %%MASKREG %9 ; [clobbered] mask register
%define %%AAD_HASH %10 ; [out] XMM for AAD_HASH value (xmm14)
%define %%CUR_COUNT %11 ; [out] XMM with current counter (xmm2)
%define %%ZT0 %12 ; [clobbered] ZMM register
%define %%ZT1 %13 ; [clobbered] ZMM register
%define %%ZT2 %14 ; [clobbered] ZMM register
%define %%ZT3 %15 ; [clobbered] ZMM register
%define %%ZT4 %16 ; [clobbered] ZMM register
%define %%ZT5 %17 ; [clobbered] ZMM register
%define %%ZT6 %18 ; [clobbered] ZMM register
%define %%ZT7 %19 ; [clobbered] ZMM register
%define %%ZT8 %20 ; [clobbered] ZMM register
%define %%ZT9 %21 ; [clobbered] ZMM register
%define %%ZT10 %22 ; [clobbered] ZMM register
%define %%ZT11 %23 ; [clobbered] ZMM register
%define %%ZT12 %24 ; [clobbered] ZMM register
%define %%ZT13 %25 ; [clobbered] ZMM register
%define %%ZT14 %26 ; [clobbered] ZMM register
%define %%ZT15 %27 ; [clobbered] ZMM register
%define %%ZT16 %28 ; [clobbered] ZMM register
%define %%ZT17 %29 ; [clobbered] ZMM register
%define %%IV_LEN %30 ; [in] IV length
vpxor %%AAD_HASH, %%AAD_HASH
CALC_AAD_HASH %%A_IN, %%A_LEN, %%AAD_HASH, %%GDATA_KEY, \
%%ZT0, %%ZT1, %%ZT2, %%ZT3, %%ZT4, %%ZT5, %%ZT6, %%ZT7, %%ZT8, %%ZT9, \
%%ZT10, %%ZT11, %%ZT12, %%ZT13, %%ZT14, %%ZT15, %%ZT16, %%ZT17, \
%%GPR1, %%GPR2, %%GPR3, %%MASKREG
mov %%GPR1, %%A_LEN
vmovdqu64 [%%GDATA_CTX + AadHash], %%AAD_HASH ; ctx.aad hash = aad_hash
mov [%%GDATA_CTX + AadLen], %%GPR1 ; ctx.aad_length = aad_length
xor %%GPR1, %%GPR1
mov [%%GDATA_CTX + InLen], %%GPR1 ; ctx.in_length = 0
mov [%%GDATA_CTX + PBlockLen], %%GPR1 ; ctx.partial_block_length = 0
%if %0 == 30 ;; IV is different than 12 bytes
CALC_J0 %%GDATA_KEY, %%IV, %%IV_LEN, %%CUR_COUNT, \
%%ZT0, %%ZT1, %%ZT2, %%ZT3, %%ZT4, %%ZT5, %%ZT6, %%ZT7, \
%%ZT8, %%ZT9, %%ZT10, %%ZT11, %%ZT12, %%ZT13, \
%%ZT14, %%ZT15, %%ZT16, %%ZT17, %%GPR1, %%GPR2, %%GPR3, %%MASKREG
%else ;; IV is 12 bytes
;; read 12 IV bytes and pad with 0x00000001
vmovdqu8 %%CUR_COUNT, [rel ONEf]
mov %%GPR2, %%IV
mov %%GPR1, 0x0000_0000_0000_0fff
kmovq %%MASKREG, %%GPR1
vmovdqu8 %%CUR_COUNT{%%MASKREG}, [%%GPR2] ; ctr = IV | 0x1
%endif
vmovdqu64 [%%GDATA_CTX + OrigIV], %%CUR_COUNT ; ctx.orig_IV = iv
;; store IV as counter in LE format
vpshufb %%CUR_COUNT, [rel SHUF_MASK]
vmovdqu [%%GDATA_CTX + CurCount], %%CUR_COUNT ; ctx.current_counter = iv
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Cipher and ghash of payloads shorter than 256 bytes
;;; - number of blocks in the message comes as argument
;;; - depending on the number of blocks an optimized variant of
;;; INITIAL_BLOCKS_PARTIAL is invoked
%macro GCM_ENC_DEC_SMALL 39
%define %%GDATA_KEY %1 ; [in] key pointer
%define %%GDATA_CTX %2 ; [in] context pointer
%define %%CYPH_PLAIN_OUT %3 ; [in] output buffer
%define %%PLAIN_CYPH_IN %4 ; [in] input buffer
%define %%PLAIN_CYPH_LEN %5 ; [in] buffer length
%define %%ENC_DEC %6 ; [in] cipher direction
%define %%DATA_OFFSET %7 ; [in] data offset
%define %%LENGTH %8 ; [in] data length
%define %%NUM_BLOCKS %9 ; [in] number of blocks to process 1 to 16
%define %%CTR %10 ; [in/out] XMM counter block
%define %%HASH_IN_OUT %11 ; [in/out] XMM GHASH value
%define %%INSTANCE_TYPE %12 ; [in] single or multi call
%define %%ZTMP0 %13 ; [clobbered] ZMM register
%define %%ZTMP1 %14 ; [clobbered] ZMM register
%define %%ZTMP2 %15 ; [clobbered] ZMM register
%define %%ZTMP3 %16 ; [clobbered] ZMM register
%define %%ZTMP4 %17 ; [clobbered] ZMM register
%define %%ZTMP5 %18 ; [clobbered] ZMM register
%define %%ZTMP6 %19 ; [clobbered] ZMM register
%define %%ZTMP7 %20 ; [clobbered] ZMM register
%define %%ZTMP8 %21 ; [clobbered] ZMM register
%define %%ZTMP9 %22 ; [clobbered] ZMM register
%define %%ZTMP10 %23 ; [clobbered] ZMM register
%define %%ZTMP11 %24 ; [clobbered] ZMM register
%define %%ZTMP12 %25 ; [clobbered] ZMM register
%define %%ZTMP13 %26 ; [clobbered] ZMM register
%define %%ZTMP14 %27 ; [clobbered] ZMM register
%define %%ZTMP15 %28 ; [clobbered] ZMM register
%define %%ZTMP16 %29 ; [clobbered] ZMM register
%define %%ZTMP17 %30 ; [clobbered] ZMM register
%define %%ZTMP18 %31 ; [clobbered] ZMM register
%define %%ZTMP19 %32 ; [clobbered] ZMM register
%define %%ZTMP20 %33 ; [clobbered] ZMM register
%define %%ZTMP21 %34 ; [clobbered] ZMM register
%define %%ZTMP22 %35 ; [clobbered] ZMM register
%define %%IA0 %36 ; [clobbered] GP register
%define %%IA1 %37 ; [clobbered] GP register
%define %%MASKREG %38 ; [clobbered] mask register
%define %%SHUFMASK %39 ; [in] ZMM with BE/LE shuffle mask
cmp %%NUM_BLOCKS, 8
je %%_small_initial_num_blocks_is_8
jl %%_small_initial_num_blocks_is_7_1
cmp %%NUM_BLOCKS, 12
je %%_small_initial_num_blocks_is_12
jl %%_small_initial_num_blocks_is_11_9
;; 16, 15, 14 or 13
cmp %%NUM_BLOCKS, 16
je %%_small_initial_num_blocks_is_16
cmp %%NUM_BLOCKS, 15
je %%_small_initial_num_blocks_is_15
cmp %%NUM_BLOCKS, 14
je %%_small_initial_num_blocks_is_14
jmp %%_small_initial_num_blocks_is_13
%%_small_initial_num_blocks_is_11_9:
;; 11, 10 or 9
cmp %%NUM_BLOCKS, 11
je %%_small_initial_num_blocks_is_11
cmp %%NUM_BLOCKS, 10
je %%_small_initial_num_blocks_is_10
jmp %%_small_initial_num_blocks_is_9
%%_small_initial_num_blocks_is_7_1:
cmp %%NUM_BLOCKS, 4
je %%_small_initial_num_blocks_is_4
jl %%_small_initial_num_blocks_is_3_1
;; 7, 6 or 5
cmp %%NUM_BLOCKS, 7
je %%_small_initial_num_blocks_is_7
cmp %%NUM_BLOCKS, 6
je %%_small_initial_num_blocks_is_6
jmp %%_small_initial_num_blocks_is_5
%%_small_initial_num_blocks_is_3_1:
;; 3, 2 or 1
cmp %%NUM_BLOCKS, 3
je %%_small_initial_num_blocks_is_3
cmp %%NUM_BLOCKS, 2
je %%_small_initial_num_blocks_is_2
;; for %%NUM_BLOCKS == 1, just fall through and no 'jmp' needed
;; Use rep to generate different block size variants
;; - one block size has to be the first one
%assign num_blocks 1
%rep 16
%%_small_initial_num_blocks_is_ %+ num_blocks :
INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \
%%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, num_blocks, \
%%CTR, %%HASH_IN_OUT, %%ENC_DEC, %%INSTANCE_TYPE, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, \
%%ZTMP5, %%ZTMP6, %%ZTMP7, %%ZTMP8, %%ZTMP9, \
%%ZTMP10, %%ZTMP11, %%ZTMP12, %%ZTMP13, %%ZTMP14, \
%%ZTMP15, %%ZTMP16, %%ZTMP17, %%ZTMP18, %%ZTMP19, \
%%ZTMP20, %%ZTMP21, %%ZTMP22, \
%%IA0, %%IA1, %%MASKREG, %%SHUFMASK
%if num_blocks != 16
jmp %%_small_initial_blocks_encrypted
%endif
%assign num_blocks (num_blocks + 1)
%endrep
%%_small_initial_blocks_encrypted:
%endmacro ; GCM_ENC_DEC_SMALL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; GCM_ENC_DEC Encodes/Decodes given data. Assumes that the passed gcm_context_data struct
; has been initialized by GCM_INIT
; Requires the input data be at least 1 byte long because of READ_SMALL_INPUT_DATA.
; Input: gcm_key_data struct* (GDATA_KEY), gcm_context_data *(GDATA_CTX), input text (PLAIN_CYPH_IN),
; input text length (PLAIN_CYPH_LEN) and whether encoding or decoding (ENC_DEC).
; Output: A cypher of the given plain text (CYPH_PLAIN_OUT), and updated GDATA_CTX
; Clobbers rax, r10-r15, and zmm0-zmm31, k1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro GCM_ENC_DEC 7
%define %%GDATA_KEY %1 ; [in] key pointer
%define %%GDATA_CTX %2 ; [in] context pointer
%define %%CYPH_PLAIN_OUT %3 ; [in] output buffer pointer
%define %%PLAIN_CYPH_IN %4 ; [in] input buffer pointer
%define %%PLAIN_CYPH_LEN %5 ; [in] buffer length
%define %%ENC_DEC %6 ; [in] cipher direction
%define %%INSTANCE_TYPE %7 ; [in] 'single_call' or 'multi_call' selection
%define %%IA0 r10
%define %%IA1 r12
%define %%IA2 r13
%define %%IA3 r15
%define %%IA4 r11
%define %%IA5 rax
%define %%LENGTH %%IA2
%define %%CTR_CHECK %%IA3
%define %%DATA_OFFSET %%IA4
%define %%HASHK_PTR %%IA5
%define %%GCM_INIT_CTR_BLOCK xmm2 ; hardcoded in GCM_INIT for now
%define %%AES_PARTIAL_BLOCK xmm8
%define %%CTR_BLOCK2z zmm18
%define %%CTR_BLOCKz zmm9
%define %%CTR_BLOCKx xmm9
%define %%AAD_HASHz zmm14
%define %%AAD_HASHx xmm14
;;; ZTMP0 - ZTMP12 - used in by8 code, by128/48 code and GCM_ENC_DEC_SMALL
%define %%ZTMP0 zmm0
%define %%ZTMP1 zmm3
%define %%ZTMP2 zmm4
%define %%ZTMP3 zmm5
%define %%ZTMP4 zmm6
%define %%ZTMP5 zmm7
%define %%ZTMP6 zmm10
%define %%ZTMP7 zmm11
%define %%ZTMP8 zmm12
%define %%ZTMP9 zmm13
%define %%ZTMP10 zmm15
%define %%ZTMP11 zmm16
%define %%ZTMP12 zmm17
;;; ZTMP13 - ZTMP22 - used in by128/48 code and GCM_ENC_DEC_SMALL
;;; - some used by8 code as well through TMPxy names
%define %%ZTMP13 zmm19
%define %%ZTMP14 zmm20
%define %%ZTMP15 zmm21
%define %%ZTMP16 zmm30 ; can be used in very/big_loop part
%define %%ZTMP17 zmm31 ; can be used in very/big_loop part
%define %%ZTMP18 zmm1
%define %%ZTMP19 zmm2
%define %%ZTMP20 zmm8
%define %%ZTMP21 zmm22
%define %%ZTMP22 zmm23
;;; Free to use: zmm24 - zmm29
;;; - used by by128/48 and by8
%define %%GH zmm24
%define %%GL zmm25
%define %%GM zmm26
%define %%SHUF_MASK zmm29
%define %%CTR_BLOCK_SAVE zmm28
;;; - used by by128/48 code only
%define %%ADDBE_4x4 zmm27
%define %%ADDBE_1234 zmm28 ; conflicts with CTR_BLOCK_SAVE
;; used by8 code only
%define %%GH4KEY %%ZTMP17
%define %%GH8KEY %%ZTMP16
%define %%BLK0 %%ZTMP18
%define %%BLK1 %%ZTMP19
%define %%ADD8BE zmm27
%define %%ADD8LE %%ZTMP13
%define %%MASKREG k1
;; reduction every 48 blocks, depth 32 blocks
;; @note 48 blocks is the maximum capacity of the stack frame
%assign big_loop_nblocks 48
%assign big_loop_depth 32
;;; Macro flow:
;;; - for message size bigger than very_big_loop_nblocks process data
;;; with "very_big_loop" parameters
;;; - for message size bigger than big_loop_nblocks process data
;;; with "big_loop" parameters
;;; - calculate the number of 16byte blocks in the message
;;; - process (number of 16byte blocks) mod 8
;;; '%%_initial_num_blocks_is_# .. %%_initial_blocks_encrypted'
;;; - process 8 16 byte blocks at a time until all are done in %%_encrypt_by_8_new
%ifidn __OUTPUT_FORMAT__, win64
cmp %%PLAIN_CYPH_LEN, 0
%else
or %%PLAIN_CYPH_LEN, %%PLAIN_CYPH_LEN
%endif
je %%_enc_dec_done
xor %%DATA_OFFSET, %%DATA_OFFSET
;; Update length of data processed
%ifidn __OUTPUT_FORMAT__, win64
mov %%IA0, %%PLAIN_CYPH_LEN
add [%%GDATA_CTX + InLen], %%IA0
%else
add [%%GDATA_CTX + InLen], %%PLAIN_CYPH_LEN
%endif
vmovdqu64 %%AAD_HASHx, [%%GDATA_CTX + AadHash]
%ifidn %%INSTANCE_TYPE, multi_call
;; NOTE: partial block processing makes only sense for multi_call here.
;; Used for the update flow - if there was a previous partial
;; block fill the remaining bytes here.
PARTIAL_BLOCK %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \
%%PLAIN_CYPH_LEN, %%DATA_OFFSET, %%AAD_HASHx, %%ENC_DEC, \
%%IA0, %%IA1, %%IA2, %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, \
%%ZTMP5, %%ZTMP6, %%ZTMP7, %%ZTMP8, %%ZTMP9, %%MASKREG
%endif
;; lift counter block from GCM_INIT to here
%ifidn %%INSTANCE_TYPE, single_call
vmovdqu64 %%CTR_BLOCKx, %%GCM_INIT_CTR_BLOCK
%else
vmovdqu64 %%CTR_BLOCKx, [%%GDATA_CTX + CurCount]
%endif
;; Save the amount of data left to process in %%LENGTH
mov %%LENGTH, %%PLAIN_CYPH_LEN
%ifidn %%INSTANCE_TYPE, multi_call
;; NOTE: %%DATA_OFFSET is zero in single_call case.
;; Consequently PLAIN_CYPH_LEN will never be zero after
;; %%DATA_OFFSET subtraction below.
;; There may be no more data if it was consumed in the partial block.
sub %%LENGTH, %%DATA_OFFSET
je %%_enc_dec_done
%endif ; %%INSTANCE_TYPE, multi_call
vmovdqa64 %%SHUF_MASK, [rel SHUF_MASK]
vmovdqa64 %%ADDBE_4x4, [rel ddq_addbe_4444]
cmp %%LENGTH, (big_loop_nblocks * 16)
jl %%_message_below_big_nblocks
;; overwritten above by CTR_BLOCK_SAVE
vmovdqa64 %%ADDBE_1234, [rel ddq_addbe_1234]
INITIAL_BLOCKS_Nx16 %%PLAIN_CYPH_IN, %%CYPH_PLAIN_OUT, %%GDATA_KEY, %%DATA_OFFSET, \
%%AAD_HASHz, %%CTR_BLOCKz, %%CTR_CHECK, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, \
%%ZTMP4, %%ZTMP5, %%ZTMP6, %%ZTMP7, \
%%ZTMP8, %%ZTMP9, %%ZTMP10, %%ZTMP11, \
%%ZTMP12, %%ZTMP13, %%ZTMP14, %%ZTMP15, \
%%ZTMP16, %%ZTMP17, %%ZTMP18, %%ZTMP19, \
%%ZTMP20, %%ZTMP21, %%ZTMP22, \
%%GH, %%GL, %%GM, \
%%ADDBE_4x4, %%ADDBE_1234, \
%%SHUF_MASK, %%ENC_DEC, big_loop_nblocks, big_loop_depth
sub %%LENGTH, (big_loop_nblocks * 16)
cmp %%LENGTH, (big_loop_nblocks * 16)
jl %%_no_more_big_nblocks
%%_encrypt_big_nblocks:
GHASH_ENCRYPT_Nx16_PARALLEL \
%%PLAIN_CYPH_IN, %%CYPH_PLAIN_OUT, %%GDATA_KEY, %%DATA_OFFSET, \
%%CTR_BLOCKz, %%SHUF_MASK, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, \
%%ZTMP4, %%ZTMP5, %%ZTMP6, %%ZTMP7, \
%%ZTMP8, %%ZTMP9, %%ZTMP10, %%ZTMP11, \
%%ZTMP12, %%ZTMP13, %%ZTMP14, %%ZTMP15, \
%%ZTMP16, %%ZTMP17, %%ZTMP18, %%ZTMP19, \
%%ZTMP20, %%ZTMP21, %%ZTMP22, \
%%GH, %%GL, %%GM, \
%%ADDBE_4x4, %%ADDBE_1234, %%AAD_HASHz, \
%%ENC_DEC, big_loop_nblocks, big_loop_depth, %%CTR_CHECK
sub %%LENGTH, (big_loop_nblocks * 16)
cmp %%LENGTH, (big_loop_nblocks * 16)
jge %%_encrypt_big_nblocks
%%_no_more_big_nblocks:
vpshufb %%CTR_BLOCKx, XWORD(%%SHUF_MASK)
vmovdqa64 XWORD(%%CTR_BLOCK_SAVE), %%CTR_BLOCKx
GHASH_LAST_Nx16 %%GDATA_KEY, %%AAD_HASHz, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, \
%%ZTMP4, %%ZTMP5, %%ZTMP6, %%ZTMP7, \
%%ZTMP8, %%ZTMP9, %%ZTMP10, %%ZTMP11, \
%%ZTMP12, %%ZTMP13, %%ZTMP14, %%ZTMP15, \
%%GH, %%GL, %%GM, big_loop_nblocks, big_loop_depth
or %%LENGTH, %%LENGTH
jz %%_ghash_done
%%_message_below_big_nblocks:
;; Less than 256 bytes will be handled by the small message code, which
;; can process up to 16 x blocks (16 bytes each)
cmp %%LENGTH, (16 * 16)
jge %%_large_message_path
;; Determine how many blocks to process
;; - process one additional block if there is a partial block
mov %%IA1, %%LENGTH
add %%IA1, 15
shr %%IA1, 4
;; %%IA1 can be in the range from 0 to 16
GCM_ENC_DEC_SMALL \
%%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \
%%PLAIN_CYPH_LEN, %%ENC_DEC, %%DATA_OFFSET, \
%%LENGTH, %%IA1, %%CTR_BLOCKx, %%AAD_HASHx, %%INSTANCE_TYPE, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, \
%%ZTMP4, %%ZTMP5, %%ZTMP6, %%ZTMP7, \
%%ZTMP8, %%ZTMP9, %%ZTMP10, %%ZTMP11, \
%%ZTMP12, %%ZTMP13, %%ZTMP14, %%ZTMP15, \
%%ZTMP16, %%ZTMP17, %%ZTMP18, %%ZTMP19, \
%%ZTMP20, %%ZTMP21, %%ZTMP22, \
%%IA0, %%IA3, %%MASKREG, %%SHUF_MASK
vmovdqa64 XWORD(%%CTR_BLOCK_SAVE), %%CTR_BLOCKx
jmp %%_ghash_done
%%_large_message_path:
;; Determine how many blocks to process in INITIAL
;; - process one additional block in INITIAL if there is a partial block
mov %%IA1, %%LENGTH
and %%IA1, 0xff
add %%IA1, 15
shr %%IA1, 4
;; Don't allow 8 INITIAL blocks since this will
;; be handled by the x8 partial loop.
and %%IA1, 7
je %%_initial_num_blocks_is_0
cmp %%IA1, 1
je %%_initial_num_blocks_is_1
cmp %%IA1, 2
je %%_initial_num_blocks_is_2
cmp %%IA1, 3
je %%_initial_num_blocks_is_3
cmp %%IA1, 4
je %%_initial_num_blocks_is_4
cmp %%IA1, 5
je %%_initial_num_blocks_is_5
cmp %%IA1, 6
je %%_initial_num_blocks_is_6
%assign number_of_blocks 7
%rep 8
%%_initial_num_blocks_is_ %+ number_of_blocks:
INITIAL_BLOCKS %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \
%%LENGTH, %%DATA_OFFSET, number_of_blocks, %%CTR_BLOCKx, %%AAD_HASHz, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, \
%%ZTMP5, %%ZTMP6, %%ZTMP7, %%ZTMP8, %%ZTMP9, %%ZTMP10, %%ZTMP11, \
%%IA0, %%IA1, %%ENC_DEC, %%MASKREG, %%SHUF_MASK, no_partial_block
%if number_of_blocks != 0
jmp %%_initial_blocks_encrypted
%endif
%assign number_of_blocks (number_of_blocks - 1)
%endrep
%%_initial_blocks_encrypted:
vmovdqa64 XWORD(%%CTR_BLOCK_SAVE), %%CTR_BLOCKx
;; move cipher blocks from initial blocks to input of by8 macro
;; and for GHASH_LAST_8/7
;; - ghash value already xor'ed into block 0
vmovdqa64 %%BLK0, %%ZTMP0
vmovdqa64 %%BLK1, %%ZTMP1
;; The entire message cannot get processed in INITIAL_BLOCKS
;; - GCM_ENC_DEC_SMALL handles up to 16 blocks
;; - INITIAL_BLOCKS processes up to 15 blocks
;; - no need to check for zero length at this stage
;; In order to have only one reduction at the end
;; start HASH KEY pointer needs to be determined based on length and
;; call type.
;; - note that 8 blocks are already ciphered in INITIAL_BLOCKS and
;; subtracted from LENGTH
lea %%IA1, [%%LENGTH + (8 * 16)]
add %%IA1, 15
and %%IA1, 0x3f0
%ifidn %%INSTANCE_TYPE, multi_call
;; if partial block and multi_call then change hash key start by one
mov %%IA0, %%LENGTH
and %%IA0, 15
add %%IA0, 15
and %%IA0, 16
sub %%IA1, %%IA0
%endif
lea %%HASHK_PTR, [%%GDATA_KEY + HashKey + 16]
sub %%HASHK_PTR, %%IA1
;; HASHK_PTR
;; - points at the first hash key to start GHASH with
;; - needs to be updated as the message is processed (incremented)
;; pre-load constants
vmovdqa64 %%ADD8BE, [rel ddq_addbe_8888]
vmovdqa64 %%ADD8LE, [rel ddq_add_8888]
vpxorq %%GH, %%GH
vpxorq %%GL, %%GL
vpxorq %%GM, %%GM
;; prepare counter 8 blocks
vshufi64x2 %%CTR_BLOCKz, %%CTR_BLOCKz, %%CTR_BLOCKz, 0
vpaddd %%CTR_BLOCK2z, %%CTR_BLOCKz, [rel ddq_add_5678]
vpaddd %%CTR_BLOCKz, %%CTR_BLOCKz, [rel ddq_add_1234]
vpshufb %%CTR_BLOCKz, %%SHUF_MASK
vpshufb %%CTR_BLOCK2z, %%SHUF_MASK
;; Process 7 full blocks plus a partial block
cmp %%LENGTH, 128
jl %%_encrypt_by_8_partial
%%_encrypt_by_8_parallel:
;; in_order vs. out_order is an optimization to increment the counter
;; without shuffling it back into little endian.
;; %%CTR_CHECK keeps track of when we need to increment in order so
;; that the carry is handled correctly.
vmovq %%CTR_CHECK, XWORD(%%CTR_BLOCK_SAVE)
%%_encrypt_by_8_new:
and WORD(%%CTR_CHECK), 255
add WORD(%%CTR_CHECK), 8
vmovdqu64 %%GH4KEY, [%%HASHK_PTR + (4 * 16)]
vmovdqu64 %%GH8KEY, [%%HASHK_PTR + (0 * 16)]
GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \
%%DATA_OFFSET, %%CTR_BLOCKz, %%CTR_BLOCK2z,\
%%BLK0, %%BLK1, %%AES_PARTIAL_BLOCK, \
out_order, %%ENC_DEC, full, %%IA0, %%IA1, %%LENGTH, %%INSTANCE_TYPE, \
%%GH4KEY, %%GH8KEY, %%SHUF_MASK, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \
%%ZTMP7, %%ZTMP8, %%ZTMP9, %%ZTMP10, %%ZTMP11, %%ZTMP12, \
%%MASKREG, no_reduction, %%GL, %%GH, %%GM
add %%HASHK_PTR, (8 * 16)
add %%DATA_OFFSET, 128
sub %%LENGTH, 128
jz %%_encrypt_done
cmp WORD(%%CTR_CHECK), (256 - 8)
jae %%_encrypt_by_8
vpaddd %%CTR_BLOCKz, %%ADD8BE
vpaddd %%CTR_BLOCK2z, %%ADD8BE
cmp %%LENGTH, 128
jl %%_encrypt_by_8_partial
jmp %%_encrypt_by_8_new
%%_encrypt_by_8:
vpshufb %%CTR_BLOCKz, %%SHUF_MASK
vpshufb %%CTR_BLOCK2z, %%SHUF_MASK
vpaddd %%CTR_BLOCKz, %%ADD8LE
vpaddd %%CTR_BLOCK2z, %%ADD8LE
vpshufb %%CTR_BLOCKz, %%SHUF_MASK
vpshufb %%CTR_BLOCK2z, %%SHUF_MASK
cmp %%LENGTH, 128
jge %%_encrypt_by_8_new
%%_encrypt_by_8_partial:
;; Test to see if we need a by 8 with partial block. At this point
;; bytes remaining should be either zero or between 113-127.
;; 'in_order' shuffle needed to align key for partial block xor.
;; 'out_order' is a little faster because it avoids extra shuffles.
;; - counter blocks for the next 8 blocks are prepared and in BE format
;; - we can go ahead with out_order scenario
vmovdqu64 %%GH4KEY, [%%HASHK_PTR + (4 * 16)]
vmovdqu64 %%GH8KEY, [%%HASHK_PTR + (0 * 16)]
GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \
%%DATA_OFFSET, %%CTR_BLOCKz, %%CTR_BLOCK2z, \
%%BLK0, %%BLK1, %%AES_PARTIAL_BLOCK, \
out_order, %%ENC_DEC, partial, %%IA0, %%IA1, %%LENGTH, %%INSTANCE_TYPE, \
%%GH4KEY, %%GH8KEY, %%SHUF_MASK, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \
%%ZTMP7, %%ZTMP8, %%ZTMP9, %%ZTMP10, %%ZTMP11, %%ZTMP12, \
%%MASKREG, no_reduction, %%GL, %%GH, %%GM
add %%HASHK_PTR, (8 * 16)
add %%DATA_OFFSET, (128 - 16)
sub %%LENGTH, (128 - 16)
%ifidn %%INSTANCE_TYPE, multi_call
mov [%%GDATA_CTX + PBlockLen], %%LENGTH
vmovdqu64 [%%GDATA_CTX + PBlockEncKey], %%AES_PARTIAL_BLOCK
%endif
%%_encrypt_done:
;; Extract the last counter block in LE format
vextracti32x4 XWORD(%%CTR_BLOCK_SAVE), %%CTR_BLOCK2z, 3
vpshufb XWORD(%%CTR_BLOCK_SAVE), XWORD(%%SHUF_MASK)
;; GHASH last cipher text blocks in xmm1-xmm8
;; - if block 8th is partial in a multi-call path then skip the block
%ifidn %%INSTANCE_TYPE, multi_call
cmp qword [%%GDATA_CTX + PBlockLen], 0
jz %%_hash_last_8
;; save the 8th partial block as GHASH_LAST_7 will clobber %%BLK1
vextracti32x4 XWORD(%%ZTMP7), %%BLK1, 3
GHASH_LAST_7 %%GDATA_KEY, %%BLK1, %%BLK0, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \
%%AAD_HASHx, %%MASKREG, %%IA0, %%GH, %%GL, %%GM
;; XOR the partial word into the hash
vpxorq %%AAD_HASHx, %%AAD_HASHx, XWORD(%%ZTMP7)
jmp %%_ghash_done
%%_hash_last_8:
%endif
GHASH_LAST_8 %%GDATA_KEY, %%BLK1, %%BLK0, \
%%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%AAD_HASHx, \
%%GH, %%GL, %%GM
%%_ghash_done:
vmovdqu64 [%%GDATA_CTX + CurCount], XWORD(%%CTR_BLOCK_SAVE)
vmovdqu64 [%%GDATA_CTX + AadHash], %%AAD_HASHx
%%_enc_dec_done:
%endmacro ; GCM_ENC_DEC
;;; ===========================================================================
;;; ===========================================================================
;;; Encrypt/decrypt the initial 16 blocks
%macro INITIAL_BLOCKS_16 22
%define %%IN %1 ; [in] input buffer
%define %%OUT %2 ; [in] output buffer
%define %%KP %3 ; [in] pointer to expanded keys
%define %%DATA_OFFSET %4 ; [in] data offset
%define %%GHASH %5 ; [in] ZMM with AAD (low 128 bits)
%define %%CTR %6 ; [in] ZMM with CTR BE blocks 4x128 bits
%define %%CTR_CHECK %7 ; [in/out] GPR with counter overflow check
%define %%ADDBE_4x4 %8 ; [in] ZMM 4x128bits with value 4 (big endian)
%define %%ADDBE_1234 %9 ; [in] ZMM 4x128bits with values 1, 2, 3 & 4 (big endian)
%define %%T0 %10 ; [clobered] temporary ZMM register
%define %%T1 %11 ; [clobered] temporary ZMM register
%define %%T2 %12 ; [clobered] temporary ZMM register
%define %%T3 %13 ; [clobered] temporary ZMM register
%define %%T4 %14 ; [clobered] temporary ZMM register
%define %%T5 %15 ; [clobered] temporary ZMM register
%define %%T6 %16 ; [clobered] temporary ZMM register
%define %%T7 %17 ; [clobered] temporary ZMM register
%define %%T8 %18 ; [clobered] temporary ZMM register
%define %%SHUF_MASK %19 ; [in] ZMM with BE/LE shuffle mask
%define %%ENC_DEC %20 ; [in] ENC (encrypt) or DEC (decrypt) selector
%define %%BLK_OFFSET %21 ; [in] stack frame offset to ciphered blocks
%define %%DATA_DISPL %22 ; [in] fixed numerical data displacement/offset
%define %%B00_03 %%T5
%define %%B04_07 %%T6
%define %%B08_11 %%T7
%define %%B12_15 %%T8
%assign stack_offset (%%BLK_OFFSET)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; prepare counter blocks
cmp BYTE(%%CTR_CHECK), (256 - 16)
jae %%_next_16_overflow
vpaddd %%B00_03, %%CTR, %%ADDBE_1234
vpaddd %%B04_07, %%B00_03, %%ADDBE_4x4
vpaddd %%B08_11, %%B04_07, %%ADDBE_4x4
vpaddd %%B12_15, %%B08_11, %%ADDBE_4x4
jmp %%_next_16_ok
%%_next_16_overflow:
vpshufb %%CTR, %%CTR, %%SHUF_MASK
vmovdqa64 %%B12_15, [rel ddq_add_4444]
vpaddd %%B00_03, %%CTR, [rel ddq_add_1234]
vpaddd %%B04_07, %%B00_03, %%B12_15
vpaddd %%B08_11, %%B04_07, %%B12_15
vpaddd %%B12_15, %%B08_11, %%B12_15
vpshufb %%B00_03, %%SHUF_MASK
vpshufb %%B04_07, %%SHUF_MASK
vpshufb %%B08_11, %%SHUF_MASK
vpshufb %%B12_15, %%SHUF_MASK
%%_next_16_ok:
vshufi64x2 %%CTR, %%B12_15, %%B12_15, 1111_1111b
add BYTE(%%CTR_CHECK), 16
;; === load 16 blocks of data
VX512LDR %%T0, [%%IN + %%DATA_OFFSET + %%DATA_DISPL + (64*0)]
VX512LDR %%T1, [%%IN + %%DATA_OFFSET + %%DATA_DISPL + (64*1)]
VX512LDR %%T2, [%%IN + %%DATA_OFFSET + %%DATA_DISPL + (64*2)]
VX512LDR %%T3, [%%IN + %%DATA_OFFSET + %%DATA_DISPL + (64*3)]
;; move to AES encryption rounds
%assign i 0
vbroadcastf64x2 %%T4, [%%KP + (16*i)]
vpxorq %%B00_03, %%B00_03, %%T4
vpxorq %%B04_07, %%B04_07, %%T4
vpxorq %%B08_11, %%B08_11, %%T4
vpxorq %%B12_15, %%B12_15, %%T4
%assign i (i + 1)
%rep NROUNDS
vbroadcastf64x2 %%T4, [%%KP + (16*i)]
vaesenc %%B00_03, %%B00_03, %%T4
vaesenc %%B04_07, %%B04_07, %%T4
vaesenc %%B08_11, %%B08_11, %%T4
vaesenc %%B12_15, %%B12_15, %%T4
%assign i (i + 1)
%endrep
vbroadcastf64x2 %%T4, [%%KP + (16*i)]
vaesenclast %%B00_03, %%B00_03, %%T4
vaesenclast %%B04_07, %%B04_07, %%T4
vaesenclast %%B08_11, %%B08_11, %%T4
vaesenclast %%B12_15, %%B12_15, %%T4
;; xor against text
vpxorq %%B00_03, %%B00_03, %%T0
vpxorq %%B04_07, %%B04_07, %%T1
vpxorq %%B08_11, %%B08_11, %%T2
vpxorq %%B12_15, %%B12_15, %%T3
;; store
VX512STR [%%OUT + %%DATA_OFFSET + %%DATA_DISPL + (64*0)], %%B00_03
VX512STR [%%OUT + %%DATA_OFFSET + %%DATA_DISPL + (64*1)], %%B04_07
VX512STR [%%OUT + %%DATA_OFFSET + %%DATA_DISPL + (64*2)], %%B08_11
VX512STR [%%OUT + %%DATA_OFFSET + %%DATA_DISPL + (64*3)], %%B12_15
%ifidn %%ENC_DEC, DEC
;; decryption - cipher text needs to go to GHASH phase
vpshufb %%B00_03, %%T0, %%SHUF_MASK
vpshufb %%B04_07, %%T1, %%SHUF_MASK
vpshufb %%B08_11, %%T2, %%SHUF_MASK
vpshufb %%B12_15, %%T3, %%SHUF_MASK
%else
;; encryption
vpshufb %%B00_03, %%B00_03, %%SHUF_MASK
vpshufb %%B04_07, %%B04_07, %%SHUF_MASK
vpshufb %%B08_11, %%B08_11, %%SHUF_MASK
vpshufb %%B12_15, %%B12_15, %%SHUF_MASK
%endif
%ifnidn %%GHASH, no_ghash
;; === xor cipher block 0 with GHASH for the next GHASH round
vpxorq %%B00_03, %%B00_03, %%GHASH
%endif
vmovdqa64 [rsp + stack_offset + (0 * 64)], %%B00_03
vmovdqa64 [rsp + stack_offset + (1 * 64)], %%B04_07
vmovdqa64 [rsp + stack_offset + (2 * 64)], %%B08_11
vmovdqa64 [rsp + stack_offset + (3 * 64)], %%B12_15
%endmacro ;INITIAL_BLOCKS_16
;;; ===========================================================================
;;; ===========================================================================
;;; Encrypt the initial N x 16 blocks
;;; - A x 16 blocks are encrypted/decrypted first (pipeline depth)
;;; - B x 16 blocks are encrypted/decrypted and previous A x 16 are ghashed
;;; - A + B = N
%macro INITIAL_BLOCKS_Nx16 39
%define %%IN %1 ; [in] input buffer
%define %%OUT %2 ; [in] output buffer
%define %%KP %3 ; [in] pointer to expanded keys
%define %%DATA_OFFSET %4 ; [in/out] data offset
%define %%GHASH %5 ; [in] ZMM with AAD (low 128 bits)
%define %%CTR %6 ; [in/out] ZMM with CTR: in - LE & 128b; out - BE & 4x128b
%define %%CTR_CHECK %7 ; [in/out] GPR with counter overflow check
%define %%T0 %8 ; [clobered] temporary ZMM register
%define %%T1 %9 ; [clobered] temporary ZMM register
%define %%T2 %10 ; [clobered] temporary ZMM register
%define %%T3 %11 ; [clobered] temporary ZMM register
%define %%T4 %12 ; [clobered] temporary ZMM register
%define %%T5 %13 ; [clobered] temporary ZMM register
%define %%T6 %14 ; [clobered] temporary ZMM register
%define %%T7 %15 ; [clobered] temporary ZMM register
%define %%T8 %16 ; [clobered] temporary ZMM register
%define %%T9 %17 ; [clobered] temporary ZMM register
%define %%T10 %18 ; [clobered] temporary ZMM register
%define %%T11 %19 ; [clobered] temporary ZMM register
%define %%T12 %20 ; [clobered] temporary ZMM register
%define %%T13 %21 ; [clobered] temporary ZMM register
%define %%T14 %22 ; [clobered] temporary ZMM register
%define %%T15 %23 ; [clobered] temporary ZMM register
%define %%T16 %24 ; [clobered] temporary ZMM register
%define %%T17 %25 ; [clobered] temporary ZMM register
%define %%T18 %26 ; [clobered] temporary ZMM register
%define %%T19 %27 ; [clobered] temporary ZMM register
%define %%T20 %28 ; [clobered] temporary ZMM register
%define %%T21 %29 ; [clobered] temporary ZMM register
%define %%T22 %30 ; [clobered] temporary ZMM register
%define %%GH %31 ; [out] ZMM ghash sum (high)
%define %%GL %32 ; [out] ZMM ghash sum (low)
%define %%GM %33 ; [out] ZMM ghash sum (middle)
%define %%ADDBE_4x4 %34 ; [in] ZMM 4x128bits with value 4 (big endian)
%define %%ADDBE_1234 %35 ; [in] ZMM 4x128bits with values 1, 2, 3 & 4 (big endian)
%define %%SHUF_MASK %36 ; [in] ZMM with BE/LE shuffle mask
%define %%ENC_DEC %37 ; [in] ENC (encrypt) or DEC (decrypt) selector
%define %%NBLOCKS %38 ; [in] number of blocks: multiple of 16
%define %%DEPTH_BLK %39 ; [in] pipline depth, number of blocks (multiple of 16)
%assign aesout_offset (STACK_LOCAL_OFFSET + (0 * 16))
%assign ghashin_offset (STACK_LOCAL_OFFSET + (0 * 16))
%assign hkey_offset HashKey_ %+ %%NBLOCKS
%assign data_in_out_offset 0
;; set up CTR_CHECK
vmovd DWORD(%%CTR_CHECK), XWORD(%%CTR)
and DWORD(%%CTR_CHECK), 255
;; in LE format after init, convert to BE
vshufi64x2 %%CTR, %%CTR, %%CTR, 0
vpshufb %%CTR, %%CTR, %%SHUF_MASK
;; ==== AES lead in
;; first 16 blocks - just cipher
INITIAL_BLOCKS_16 %%IN, %%OUT, %%KP, %%DATA_OFFSET, \
%%GHASH, %%CTR, %%CTR_CHECK, %%ADDBE_4x4, %%ADDBE_1234, \
%%T0, %%T1, %%T2, %%T3, %%T4, \
%%T5, %%T6, %%T7, %%T8, \
%%SHUF_MASK, %%ENC_DEC, aesout_offset, data_in_out_offset
%assign aesout_offset (aesout_offset + (16 * 16))
%assign data_in_out_offset (data_in_out_offset + (16 * 16))
%if (%%DEPTH_BLK > 16)
%rep ((%%DEPTH_BLK - 16) / 16)
INITIAL_BLOCKS_16 %%IN, %%OUT, %%KP, %%DATA_OFFSET, \
no_ghash, %%CTR, %%CTR_CHECK, %%ADDBE_4x4, %%ADDBE_1234, \
%%T0, %%T1, %%T2, %%T3, %%T4, \
%%T5, %%T6, %%T7, %%T8, \
%%SHUF_MASK, %%ENC_DEC, aesout_offset, data_in_out_offset
%assign aesout_offset (aesout_offset + (16 * 16))
%assign data_in_out_offset (data_in_out_offset + (16 * 16))
%endrep
%endif
;; ==== GHASH + AES follows
;; first 16 blocks stitched
GHASH_16_ENCRYPT_16_PARALLEL %%KP, %%OUT, %%IN, %%DATA_OFFSET, \
%%CTR, %%CTR_CHECK, \
hkey_offset, aesout_offset, ghashin_offset, %%SHUF_MASK, \
%%T0, %%T1, %%T2, %%T3, \
%%T4, %%T5, %%T6, %%T7, \
%%T8, %%T9, %%T10, %%T11,\
%%T12, %%T13, %%T14, %%T15,\
%%T16, %%T17, %%T18, %%T19, \
%%T20, %%T21, %%T22, \
%%ADDBE_4x4, %%ADDBE_1234, \
%%GL, %%GH, %%GM, \
first_time, %%ENC_DEC, data_in_out_offset, no_ghash_in
%if ((%%NBLOCKS - %%DEPTH_BLK) > 16)
%rep ((%%NBLOCKS - %%DEPTH_BLK - 16) / 16)
%assign ghashin_offset (ghashin_offset + (16 * 16))
%assign hkey_offset (hkey_offset + (16 * 16))
%assign aesout_offset (aesout_offset + (16 * 16))
%assign data_in_out_offset (data_in_out_offset + (16 * 16))
;; mid 16 blocks - stitched
GHASH_16_ENCRYPT_16_PARALLEL %%KP, %%OUT, %%IN, %%DATA_OFFSET, \
%%CTR, %%CTR_CHECK, \
hkey_offset, aesout_offset, ghashin_offset, %%SHUF_MASK, \
%%T0, %%T1, %%T2, %%T3, \
%%T4, %%T5, %%T6, %%T7, \
%%T8, %%T9, %%T10, %%T11,\
%%T12, %%T13, %%T14, %%T15,\
%%T16, %%T17, %%T18, %%T19, \
%%T20, %%T21, %%T22, \
%%ADDBE_4x4, %%ADDBE_1234, \
%%GL, %%GH, %%GM, \
no_reduction, %%ENC_DEC, data_in_out_offset, no_ghash_in
%endrep
%endif
add %%DATA_OFFSET, (%%NBLOCKS * 16)
%endmacro ;INITIAL_BLOCKS_Nx16
;;; ===========================================================================
;;; ===========================================================================
;;; GHASH the last 16 blocks of cipher text (last part of by 32/64/128 code)
%macro GHASH_LAST_Nx16 23
%define %%KP %1 ; [in] pointer to expanded keys
%define %%GHASH %2 ; [out] ghash output
%define %%T1 %3 ; [clobbered] temporary ZMM
%define %%T2 %4 ; [clobbered] temporary ZMM
%define %%T3 %5 ; [clobbered] temporary ZMM
%define %%T4 %6 ; [clobbered] temporary ZMM
%define %%T5 %7 ; [clobbered] temporary ZMM
%define %%T6 %8 ; [clobbered] temporary ZMM
%define %%T7 %9 ; [clobbered] temporary ZMM
%define %%T8 %10 ; [clobbered] temporary ZMM
%define %%T9 %11 ; [clobbered] temporary ZMM
%define %%T10 %12 ; [clobbered] temporary ZMM
%define %%T11 %13 ; [clobbered] temporary ZMM
%define %%T12 %14 ; [clobbered] temporary ZMM
%define %%T13 %15 ; [clobbered] temporary ZMM
%define %%T14 %16 ; [clobbered] temporary ZMM
%define %%T15 %17 ; [clobbered] temporary ZMM
%define %%T16 %18 ; [clobbered] temporary ZMM
%define %%GH %19 ; [in/cloberred] ghash sum (high)
%define %%GL %20 ; [in/cloberred] ghash sum (low)
%define %%GM %21 ; [in/cloberred] ghash sum (medium)
%define %%LOOP_BLK %22 ; [in] numerical number of blocks handled by the loop
%define %%DEPTH_BLK %23 ; [in] numerical number, pipeline depth (ghash vs aes)
%define %%T0H %%T1
%define %%T0L %%T2
%define %%T0M1 %%T3
%define %%T0M2 %%T4
%define %%T1H %%T5
%define %%T1L %%T6
%define %%T1M1 %%T7
%define %%T1M2 %%T8
%define %%T2H %%T9
%define %%T2L %%T10
%define %%T2M1 %%T11
%define %%T2M2 %%T12
%define %%BLK1 %%T13
%define %%BLK2 %%T14
%define %%HK1 %%T15
%define %%HK2 %%T16
%assign hashk HashKey_ %+ %%DEPTH_BLK
%assign cipher_blk (STACK_LOCAL_OFFSET + ((%%LOOP_BLK - %%DEPTH_BLK) * 16))
;; load cipher blocks and ghash keys
vmovdqa64 %%BLK1, [rsp + cipher_blk]
vmovdqa64 %%BLK2, [rsp + cipher_blk + 64]
vmovdqu64 %%HK1, [%%KP + hashk]
vmovdqu64 %%HK2, [%%KP + hashk + 64]
;; ghash blocks 0-3
vpclmulqdq %%T0H, %%BLK1, %%HK1, 0x11 ; %%TH = a1*b1
vpclmulqdq %%T0L, %%BLK1, %%HK1, 0x00 ; %%TL = a0*b0
vpclmulqdq %%T0M1, %%BLK1, %%HK1, 0x01 ; %%TM1 = a1*b0
vpclmulqdq %%T0M2, %%BLK1, %%HK1, 0x10 ; %%TM2 = a0*b1
;; ghash blocks 4-7
vpclmulqdq %%T1H, %%BLK2, %%HK2, 0x11 ; %%TTH = a1*b1
vpclmulqdq %%T1L, %%BLK2, %%HK2, 0x00 ; %%TTL = a0*b0
vpclmulqdq %%T1M1, %%BLK2, %%HK2, 0x01 ; %%TTM1 = a1*b0
vpclmulqdq %%T1M2, %%BLK2, %%HK2, 0x10 ; %%TTM2 = a0*b1
vpternlogq %%T0H, %%T1H, %%GH, 0x96 ; T0H = T0H + T1H + GH
vpternlogq %%T0L, %%T1L, %%GL, 0x96 ; T0L = T0L + T1L + GL
vpternlogq %%T0M1, %%T1M1, %%GM, 0x96 ; T0M1 = T0M1 + T1M1 + GM
vpxorq %%T0M2, %%T0M2, %%T1M2 ; T0M2 = T0M2 + T1M2
%rep ((%%DEPTH_BLK - 8) / 8)
%assign hashk (hashk + 128)
%assign cipher_blk (cipher_blk + 128)
;; remaining blocks
;; load next 8 cipher blocks and corresponding ghash keys
vmovdqa64 %%BLK1, [rsp + cipher_blk]
vmovdqa64 %%BLK2, [rsp + cipher_blk + 64]
vmovdqu64 %%HK1, [%%KP + hashk]
vmovdqu64 %%HK2, [%%KP + hashk + 64]
;; ghash blocks 0-3
vpclmulqdq %%T1H, %%BLK1, %%HK1, 0x11 ; %%TH = a1*b1
vpclmulqdq %%T1L, %%BLK1, %%HK1, 0x00 ; %%TL = a0*b0
vpclmulqdq %%T1M1, %%BLK1, %%HK1, 0x01 ; %%TM1 = a1*b0
vpclmulqdq %%T1M2, %%BLK1, %%HK1, 0x10 ; %%TM2 = a0*b1
;; ghash blocks 4-7
vpclmulqdq %%T2H, %%BLK2, %%HK2, 0x11 ; %%TTH = a1*b1
vpclmulqdq %%T2L, %%BLK2, %%HK2, 0x00 ; %%TTL = a0*b0
vpclmulqdq %%T2M1, %%BLK2, %%HK2, 0x01 ; %%TTM1 = a1*b0
vpclmulqdq %%T2M2, %%BLK2, %%HK2, 0x10 ; %%TTM2 = a0*b1
;; update sums
vpternlogq %%T0H, %%T1H, %%T2H, 0x96 ; TH = T0H + T1H + T2H
vpternlogq %%T0L, %%T1L, %%T2L, 0x96 ; TL = T0L + T1L + T2L
vpternlogq %%T0M1, %%T1M1, %%T2M1, 0x96 ; TM1 = T0M1 + T1M1 xor T2M1
vpternlogq %%T0M2, %%T1M2, %%T2M2, 0x96 ; TM2 = T0M2 + T1M1 xor T2M2
%endrep
;; integrate TM into TH and TL
vpxorq %%T0M1, %%T0M1, %%T0M2
vpsrldq %%T1M1, %%T0M1, 8
vpslldq %%T1M2, %%T0M1, 8
vpxorq %%T0H, %%T0H, %%T1M1
vpxorq %%T0L, %%T0L, %%T1M2
;; add TH and TL 128-bit words horizontally
VHPXORI4x128 %%T0H, %%T2M1
VHPXORI4x128 %%T0L, %%T2M2
;; reduction
vmovdqa64 %%HK1, [rel POLY2]
VCLMUL_REDUCE %%GHASH, %%HK1, %%T0H, %%T0L, %%T0M1, %%T0M2
%endmacro
;;; ===========================================================================
;;; ===========================================================================
;;; Encrypt & ghash multiples of 16 blocks
%macro GHASH_ENCRYPT_Nx16_PARALLEL 39
%define %%IN %1 ; [in] input buffer
%define %%OUT %2 ; [in] output buffer
%define %%GDATA_KEY %3 ; [in] pointer to expanded keys
%define %%DATA_OFFSET %4 ; [in/out] data offset
%define %%CTR_BE %5 ; [in/out] ZMM last counter block
%define %%SHFMSK %6 ; [in] ZMM with byte swap mask for pshufb
%define %%ZT0 %7 ; [clobered] temporary ZMM register
%define %%ZT1 %8 ; [clobered] temporary ZMM register
%define %%ZT2 %9 ; [clobered] temporary ZMM register
%define %%ZT3 %10 ; [clobered] temporary ZMM register
%define %%ZT4 %11 ; [clobered] temporary ZMM register
%define %%ZT5 %12 ; [clobered] temporary ZMM register
%define %%ZT6 %13 ; [clobered] temporary ZMM register
%define %%ZT7 %14 ; [clobered] temporary ZMM register
%define %%ZT8 %15 ; [clobered] temporary ZMM register
%define %%ZT9 %16 ; [clobered] temporary ZMM register
%define %%ZT10 %17 ; [clobered] temporary ZMM register
%define %%ZT11 %18 ; [clobered] temporary ZMM register
%define %%ZT12 %19 ; [clobered] temporary ZMM register
%define %%ZT13 %20 ; [clobered] temporary ZMM register
%define %%ZT14 %21 ; [clobered] temporary ZMM register
%define %%ZT15 %22 ; [clobered] temporary ZMM register
%define %%ZT16 %23 ; [clobered] temporary ZMM register
%define %%ZT17 %24 ; [clobered] temporary ZMM register
%define %%ZT18 %25 ; [clobered] temporary ZMM register
%define %%ZT19 %26 ; [clobered] temporary ZMM register
%define %%ZT20 %27 ; [clobered] temporary ZMM register
%define %%ZT21 %28 ; [clobered] temporary ZMM register
%define %%ZT22 %29 ; [clobered] temporary ZMM register
%define %%GTH %30 ; [in/out] ZMM GHASH sum (high)
%define %%GTL %31 ; [in/out] ZMM GHASH sum (low)
%define %%GTM %32 ; [in/out] ZMM GHASH sum (medium)
%define %%ADDBE_4x4 %33 ; [in] ZMM 4x128bits with value 4 (big endian)
%define %%ADDBE_1234 %34 ; [in] ZMM 4x128bits with values 1, 2, 3 & 4 (big endian)
%define %%GHASH %35 ; [clobbered] ZMM with intermediate GHASH value
%define %%ENC_DEC %36 ; [in] ENC (encrypt) or DEC (decrypt) selector
%define %%NUM_BLOCKS %37 ; [in] number of blocks to process in the loop
%define %%DEPTH_BLK %38 ; [in] pipeline depth in blocks
%define %%CTR_CHECK %39 ; [in/out] counter to check byte overflow
%assign aesout_offset (STACK_LOCAL_OFFSET + (0 * 16))
%assign ghashin_offset (STACK_LOCAL_OFFSET + ((%%NUM_BLOCKS - %%DEPTH_BLK) * 16))
%assign hkey_offset HashKey_ %+ %%DEPTH_BLK
%assign data_in_out_offset 0
;; mid 16 blocks
%if (%%DEPTH_BLK > 16)
%rep ((%%DEPTH_BLK - 16) / 16)
GHASH_16_ENCRYPT_16_PARALLEL %%GDATA_KEY, %%OUT, %%IN, %%DATA_OFFSET, \
%%CTR_BE, %%CTR_CHECK, \
hkey_offset, aesout_offset, ghashin_offset, %%SHFMSK, \
%%ZT0, %%ZT1, %%ZT2, %%ZT3, \
%%ZT4, %%ZT5, %%ZT6, %%ZT7, \
%%ZT8, %%ZT9, %%ZT10, %%ZT11,\
%%ZT12, %%ZT13, %%ZT14, %%ZT15,\
%%ZT16, %%ZT17, %%ZT18, %%ZT19, \
%%ZT20, %%ZT21, %%ZT22, \
%%ADDBE_4x4, %%ADDBE_1234, \
%%GTL, %%GTH, %%GTM, \
no_reduction, %%ENC_DEC, data_in_out_offset, no_ghash_in
%assign aesout_offset (aesout_offset + (16 * 16))
%assign ghashin_offset (ghashin_offset + (16 * 16))
%assign hkey_offset (hkey_offset + (16 * 16))
%assign data_in_out_offset (data_in_out_offset + (16 * 16))
%endrep
%endif
;; 16 blocks with reduction
GHASH_16_ENCRYPT_16_PARALLEL %%GDATA_KEY, %%OUT, %%IN, %%DATA_OFFSET, \
%%CTR_BE, %%CTR_CHECK, \
HashKey_16, aesout_offset, ghashin_offset, %%SHFMSK, \
%%ZT0, %%ZT1, %%ZT2, %%ZT3, \
%%ZT4, %%ZT5, %%ZT6, %%ZT7, \
%%ZT8, %%ZT9, %%ZT10, %%ZT11,\
%%ZT12, %%ZT13, %%ZT14, %%ZT15,\
%%ZT16, %%ZT17, %%ZT18, %%ZT19, \
%%ZT20, %%ZT21, %%ZT22, \
%%ADDBE_4x4, %%ADDBE_1234, \
%%GTL, %%GTH, %%GTM, \
final_reduction, %%ENC_DEC, data_in_out_offset, no_ghash_in
%assign aesout_offset (aesout_offset + (16 * 16))
%assign data_in_out_offset (data_in_out_offset + (16 * 16))
%assign ghashin_offset (STACK_LOCAL_OFFSET + (0 * 16))
%assign hkey_offset HashKey_ %+ %%NUM_BLOCKS
;; === xor cipher block 0 with GHASH (ZT4)
vmovdqa64 %%GHASH, %%ZT4
;; start the pipeline again
GHASH_16_ENCRYPT_16_PARALLEL %%GDATA_KEY, %%OUT, %%IN, %%DATA_OFFSET, \
%%CTR_BE, %%CTR_CHECK, \
hkey_offset, aesout_offset, ghashin_offset, %%SHFMSK, \
%%ZT0, %%ZT1, %%ZT2, %%ZT3, \
%%ZT4, %%ZT5, %%ZT6, %%ZT7, \
%%ZT8, %%ZT9, %%ZT10, %%ZT11,\
%%ZT12, %%ZT13, %%ZT14, %%ZT15,\
%%ZT16, %%ZT17, %%ZT18, %%ZT19, \
%%ZT20, %%ZT21, %%ZT22, \
%%ADDBE_4x4, %%ADDBE_1234, \
%%GTL, %%GTH, %%GTM, \
first_time, %%ENC_DEC, data_in_out_offset, %%GHASH
%if ((%%NUM_BLOCKS - %%DEPTH_BLK) > 16)
%rep ((%%NUM_BLOCKS - %%DEPTH_BLK - 16 ) / 16)
%assign aesout_offset (aesout_offset + (16 * 16))
%assign data_in_out_offset (data_in_out_offset + (16 * 16))
%assign ghashin_offset (ghashin_offset + (16 * 16))
%assign hkey_offset (hkey_offset + (16 * 16))
GHASH_16_ENCRYPT_16_PARALLEL %%GDATA_KEY, %%OUT, %%IN, %%DATA_OFFSET, \
%%CTR_BE, %%CTR_CHECK, \
hkey_offset, aesout_offset, ghashin_offset, %%SHFMSK, \
%%ZT0, %%ZT1, %%ZT2, %%ZT3, \
%%ZT4, %%ZT5, %%ZT6, %%ZT7, \
%%ZT8, %%ZT9, %%ZT10, %%ZT11,\
%%ZT12, %%ZT13, %%ZT14, %%ZT15,\
%%ZT16, %%ZT17, %%ZT18, %%ZT19, \
%%ZT20, %%ZT21, %%ZT22, \
%%ADDBE_4x4, %%ADDBE_1234, \
%%GTL, %%GTH, %%GTM, \
no_reduction, %%ENC_DEC, data_in_out_offset, no_ghash_in
%endrep
%endif
add %%DATA_OFFSET, (%%NUM_BLOCKS * 16)
%endmacro ;GHASH_ENCRYPT_Nx16_PARALLEL
;;; ===========================================================================
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; GCM_COMPLETE Finishes Encryption/Decryption of last partial block after GCM_UPDATE finishes.
; Input: A gcm_key_data * (GDATA_KEY), gcm_context_data (GDATA_CTX).
; Output: Authorization Tag (AUTH_TAG) and Authorization Tag length (AUTH_TAG_LEN)
; Clobbers rax, r10-r12, and xmm0-xmm2, xmm5-xmm6, xmm9-xmm11, xmm13-xmm15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro GCM_COMPLETE 5
%define %%GDATA_KEY %1
%define %%GDATA_CTX %2
%define %%AUTH_TAG %3
%define %%AUTH_TAG_LEN %4
%define %%INSTANCE_TYPE %5
%define %%PLAIN_CYPH_LEN rax
vmovdqu xmm13, [%%GDATA_KEY + HashKey]
;; Start AES as early as possible
vmovdqu xmm9, [%%GDATA_CTX + OrigIV] ; xmm9 = Y0
ENCRYPT_SINGLE_BLOCK %%GDATA_KEY, xmm9 ; E(K, Y0)
%ifidn %%INSTANCE_TYPE, multi_call
;; If the GCM function is called as a single function call rather
;; than invoking the individual parts (init, update, finalize) we
;; can remove a write to read dependency on AadHash.
vmovdqu xmm14, [%%GDATA_CTX + AadHash]
;; Encrypt the final partial block. If we did this as a single call then
;; the partial block was handled in the main GCM_ENC_DEC macro.
mov r12, [%%GDATA_CTX + PBlockLen]
cmp r12, 0
je %%_partial_done
GHASH_MUL xmm14, xmm13, xmm0, xmm10, xmm11, xmm5, xmm6 ;GHASH computation for the last <16 Byte block
vmovdqu [%%GDATA_CTX + AadHash], xmm14
%%_partial_done:
%endif
mov r12, [%%GDATA_CTX + AadLen] ; r12 = aadLen (number of bytes)
mov %%PLAIN_CYPH_LEN, [%%GDATA_CTX + InLen]
shl r12, 3 ; convert into number of bits
vmovq xmm15, r12 ; len(A) in xmm15
shl %%PLAIN_CYPH_LEN, 3 ; len(C) in bits (*128)
vmovq xmm1, %%PLAIN_CYPH_LEN
vpslldq xmm15, xmm15, 8 ; xmm15 = len(A)|| 0x0000000000000000
vpxor xmm15, xmm15, xmm1 ; xmm15 = len(A)||len(C)
vpxor xmm14, xmm15
GHASH_MUL xmm14, xmm13, xmm0, xmm10, xmm11, xmm5, xmm6
vpshufb xmm14, [rel SHUF_MASK] ; perform a 16Byte swap
vpxor xmm9, xmm9, xmm14
%%_return_T:
mov r10, %%AUTH_TAG ; r10 = authTag
mov r11, %%AUTH_TAG_LEN ; r11 = auth_tag_len
cmp r11, 16
je %%_T_16
cmp r11, 12
je %%_T_12
cmp r11, 8
je %%_T_8
simd_store_avx_15 r10, xmm9, r11, r12, rax
jmp %%_return_T_done
%%_T_8:
vmovq rax, xmm9
mov [r10], rax
jmp %%_return_T_done
%%_T_12:
vmovq rax, xmm9
mov [r10], rax
vpsrldq xmm9, xmm9, 8
vmovd eax, xmm9
mov [r10 + 8], eax
jmp %%_return_T_done
%%_T_16:
vmovdqu [r10], xmm9
%%_return_T_done:
%ifdef SAFE_DATA
;; Clear sensitive data from context structure
vpxor xmm0, xmm0
vmovdqu [%%GDATA_CTX + AadHash], xmm0
vmovdqu [%%GDATA_CTX + PBlockEncKey], xmm0
%endif
%endmacro ; GCM_COMPLETE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void aes_gcm_precomp_128_vaes_avx512 /
; aes_gcm_precomp_192_vaes_avx512 /
; aes_gcm_precomp_256_vaes_avx512
; (struct gcm_key_data *key_data)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(FN_NAME(precomp,_),function,)
FN_NAME(precomp,_):
endbranch64
;; Parameter is passed through register
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_precomp
%endif
FUNC_SAVE
vpxor xmm6, xmm6
ENCRYPT_SINGLE_BLOCK arg1, xmm6 ; xmm6 = HashKey
vpshufb xmm6, [rel SHUF_MASK]
;;;;;;;;;;;;;;; PRECOMPUTATION of HashKey<<1 mod poly from the HashKey;;;;;;;;;;;;;;;
vmovdqa xmm2, xmm6
vpsllq xmm6, xmm6, 1
vpsrlq xmm2, xmm2, 63
vmovdqa xmm1, xmm2
vpslldq xmm2, xmm2, 8
vpsrldq xmm1, xmm1, 8
vpor xmm6, xmm6, xmm2
;reduction
vpshufd xmm2, xmm1, 00100100b
vpcmpeqd xmm2, [rel TWOONE]
vpand xmm2, xmm2, [rel POLY]
vpxor xmm6, xmm6, xmm2 ; xmm6 holds the HashKey<<1 mod poly
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
vmovdqu [arg1 + HashKey], xmm6 ; store HashKey<<1 mod poly
PRECOMPUTE arg1, xmm6, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm7, xmm8
FUNC_RESTORE
exit_precomp:
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void aes_gcm_init_128_vaes_avx512 / aes_gcm_init_192_vaes_avx512 / aes_gcm_init_256_vaes_avx512
; (const struct gcm_key_data *key_data,
; struct gcm_context_data *context_data,
; u8 *iv,
; const u8 *aad,
; u64 aad_len);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(FN_NAME(init,_),function,)
FN_NAME(init,_):
endbranch64
FUNC_SAVE
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_init
;; Check context_data != NULL
cmp arg2, 0
jz exit_init
;; Check IV != NULL
cmp arg3, 0
jz exit_init
;; Check if aad_len == 0
cmp arg5, 0
jz skip_aad_check_init
;; Check aad != NULL (aad_len != 0)
cmp arg4, 0
jz exit_init
skip_aad_check_init:
%endif
GCM_INIT arg1, arg2, arg3, arg4, arg5, r10, r11, r12, k1, xmm14, xmm2, \
zmm1, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, zmm9, zmm10, zmm11, \
zmm12, zmm13, zmm15, zmm16, zmm17, zmm18, zmm19, zmm20
exit_init:
FUNC_RESTORE
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void aes_gcm_init_var_iv_128_vaes_avx512 / aes_gcm_init_var_iv_192_vaes_avx512 /
; aes_gcm_init_var_iv_256_vaes_avx512
; (const struct gcm_key_data *key_data,
; struct gcm_context_data *context_data,
; u8 *iv,
; const u64 iv_len,
; const u8 *aad,
; const u64 aad_len);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(FN_NAME(init_var_iv,_),function,)
FN_NAME(init_var_iv,_):
endbranch64
FUNC_SAVE
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_init_IV
;; Check context_data != NULL
cmp arg2, 0
jz exit_init_IV
;; Check IV != NULL
cmp arg3, 0
jz exit_init_IV
;; Check iv_len != 0
cmp arg4, 0
jz exit_init_IV
;; Check if aad_len == 0
cmp arg6, 0
jz skip_aad_check_init_IV
;; Check aad != NULL (aad_len != 0)
cmp arg5, 0
jz exit_init_IV
skip_aad_check_init_IV:
%endif
cmp arg4, 12
je iv_len_12_init_IV
GCM_INIT arg1, arg2, arg3, arg5, arg6, r10, r11, r12, k1, xmm14, xmm2, \
zmm1, zmm11, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, zmm9, zmm10, \
zmm12, zmm13, zmm15, zmm16, zmm17, zmm18, zmm19, zmm20, arg4
jmp skip_iv_len_12_init_IV
iv_len_12_init_IV:
GCM_INIT arg1, arg2, arg3, arg5, arg6, r10, r11, r12, k1, xmm14, xmm2, \
zmm1, zmm11, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, zmm9, zmm10, \
zmm12, zmm13, zmm15, zmm16, zmm17, zmm18, zmm19, zmm20
skip_iv_len_12_init_IV:
%ifdef SAFE_DATA
clear_scratch_gps_asm
clear_scratch_zmms_asm
%endif
exit_init_IV:
FUNC_RESTORE
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void aes_gcm_enc_128_update_vaes_avx512 / aes_gcm_enc_192_update_vaes_avx512 /
; aes_gcm_enc_256_update_vaes_avx512
; (const struct gcm_key_data *key_data,
; struct gcm_context_data *context_data,
; u8 *out,
; const u8 *in,
; u64 plaintext_len);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(FN_NAME(enc,_update_),function,)
FN_NAME(enc,_update_):
endbranch64
FUNC_SAVE
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_update_enc
;; Check context_data != NULL
cmp arg2, 0
jz exit_update_enc
;; Check if plaintext_len == 0
cmp arg5, 0
jz skip_in_out_check_update_enc
;; Check out != NULL (plaintext_len != 0)
cmp arg3, 0
jz exit_update_enc
;; Check in != NULL (plaintext_len != 0)
cmp arg4, 0
jz exit_update_enc
skip_in_out_check_update_enc:
%endif
GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, ENC, multi_call
exit_update_enc:
FUNC_RESTORE
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void aes_gcm_dec_128_update_vaes_avx512 / aes_gcm_dec_192_update_vaes_avx512 /
; aes_gcm_dec_256_update_vaes_avx512
; (const struct gcm_key_data *key_data,
; struct gcm_context_data *context_data,
; u8 *out,
; const u8 *in,
; u64 plaintext_len);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(FN_NAME(dec,_update_),function,)
FN_NAME(dec,_update_):
endbranch64
FUNC_SAVE
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_update_dec
;; Check context_data != NULL
cmp arg2, 0
jz exit_update_dec
;; Check if plaintext_len == 0
cmp arg5, 0
jz skip_in_out_check_update_dec
;; Check out != NULL (plaintext_len != 0)
cmp arg3, 0
jz exit_update_dec
;; Check in != NULL (plaintext_len != 0)
cmp arg4, 0
jz exit_update_dec
skip_in_out_check_update_dec:
%endif
GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, DEC, multi_call
exit_update_dec:
FUNC_RESTORE
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void aes_gcm_enc_128_finalize_vaes_avx512 / aes_gcm_enc_192_finalize_vaes_avx512 /
; aes_gcm_enc_256_finalize_vaes_avx512
; (const struct gcm_key_data *key_data,
; struct gcm_context_data *context_data,
; u8 *auth_tag,
; u64 auth_tag_len);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(FN_NAME(enc,_finalize_),function,)
FN_NAME(enc,_finalize_):
endbranch64
;; All parameters are passed through registers
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_enc_fin
;; Check context_data != NULL
cmp arg2, 0
jz exit_enc_fin
;; Check auth_tag != NULL
cmp arg3, 0
jz exit_enc_fin
;; Check auth_tag_len == 0 or > 16
cmp arg4, 0
jz exit_enc_fin
cmp arg4, 16
ja exit_enc_fin
%endif
FUNC_SAVE
GCM_COMPLETE arg1, arg2, arg3, arg4, multi_call
FUNC_RESTORE
exit_enc_fin:
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void aes_gcm_dec_128_finalize_vaes_avx512 / aes_gcm_dec_192_finalize_vaes_avx512
; aes_gcm_dec_256_finalize_vaes_avx512
; (const struct gcm_key_data *key_data,
; struct gcm_context_data *context_data,
; u8 *auth_tag,
; u64 auth_tag_len);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(FN_NAME(dec,_finalize_),function,)
FN_NAME(dec,_finalize_):
endbranch64
;; All parameters are passed through registers
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_dec_fin
;; Check context_data != NULL
cmp arg2, 0
jz exit_dec_fin
;; Check auth_tag != NULL
cmp arg3, 0
jz exit_dec_fin
;; Check auth_tag_len == 0 or > 16
cmp arg4, 0
jz exit_dec_fin
cmp arg4, 16
ja exit_dec_fin
%endif
FUNC_SAVE
GCM_COMPLETE arg1, arg2, arg3, arg4, multi_call
FUNC_RESTORE
exit_dec_fin:
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void aes_gcm_enc_128_vaes_avx512 / aes_gcm_enc_192_vaes_avx512 / aes_gcm_enc_256_vaes_avx512
; (const struct gcm_key_data *key_data,
; struct gcm_context_data *context_data,
; u8 *out,
; const u8 *in,
; u64 plaintext_len,
; u8 *iv,
; const u8 *aad,
; u64 aad_len,
; u8 *auth_tag,
; u64 auth_tag_len);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(FN_NAME(enc,_),function,)
FN_NAME(enc,_):
endbranch64
FUNC_SAVE
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_enc
;; Check context_data != NULL
cmp arg2, 0
jz exit_enc
;; Check IV != NULL
cmp arg6, 0
jz exit_enc
;; Check auth_tag != NULL
cmp arg9, 0
jz exit_enc
;; Check auth_tag_len == 0 or > 16
cmp arg10, 0
jz exit_enc
cmp arg10, 16
ja exit_enc
;; Check if plaintext_len == 0
cmp arg5, 0
jz skip_in_out_check_enc
;; Check out != NULL (plaintext_len != 0)
cmp arg3, 0
jz exit_enc
;; Check in != NULL (plaintext_len != 0)
cmp arg4, 0
jz exit_enc
skip_in_out_check_enc:
;; Check if aad_len == 0
cmp arg8, 0
jz skip_aad_check_enc
;; Check aad != NULL (aad_len != 0)
cmp arg7, 0
jz exit_enc
skip_aad_check_enc:
%endif
GCM_INIT arg1, arg2, arg6, arg7, arg8, r10, r11, r12, k1, xmm14, xmm2, \
zmm1, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, zmm9, zmm10, zmm11, \
zmm12, zmm13, zmm15, zmm16, zmm17, zmm18, zmm19, zmm20
GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, ENC, single_call
GCM_COMPLETE arg1, arg2, arg9, arg10, single_call
exit_enc:
FUNC_RESTORE
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void aes_gcm_dec_128_vaes_avx512 / aes_gcm_dec_192_vaes_avx512 / aes_gcm_dec_256_vaes_avx512
; (const struct gcm_key_data *key_data,
; struct gcm_context_data *context_data,
; u8 *out,
; const u8 *in,
; u64 plaintext_len,
; u8 *iv,
; const u8 *aad,
; u64 aad_len,
; u8 *auth_tag,
; u64 auth_tag_len);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(FN_NAME(dec,_),function,)
FN_NAME(dec,_):
endbranch64
FUNC_SAVE
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_dec
;; Check context_data != NULL
cmp arg2, 0
jz exit_dec
;; Check IV != NULL
cmp arg6, 0
jz exit_dec
;; Check auth_tag != NULL
cmp arg9, 0
jz exit_dec
;; Check auth_tag_len == 0 or > 16
cmp arg10, 0
jz exit_dec
cmp arg10, 16
ja exit_dec
;; Check if plaintext_len == 0
cmp arg5, 0
jz skip_in_out_check_dec
;; Check out != NULL (plaintext_len != 0)
cmp arg3, 0
jz exit_dec
;; Check in != NULL (plaintext_len != 0)
cmp arg4, 0
jz exit_dec
skip_in_out_check_dec:
;; Check if aad_len == 0
cmp arg8, 0
jz skip_aad_check_dec
;; Check aad != NULL (aad_len != 0)
cmp arg7, 0
jz exit_dec
skip_aad_check_dec:
%endif
GCM_INIT arg1, arg2, arg6, arg7, arg8, r10, r11, r12, k1, xmm14, xmm2, \
zmm1, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, zmm9, zmm10, zmm11, \
zmm12, zmm13, zmm15, zmm16, zmm17, zmm18, zmm19, zmm20
GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, DEC, single_call
GCM_COMPLETE arg1, arg2, arg9, arg10, single_call
exit_dec:
FUNC_RESTORE
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void aes_gcm_enc_var_iv_128_vaes_avx512 / aes_gcm_enc_var_iv_192_vaes_avx512 /
; aes_gcm_enc_var_iv_256_vaes_avx512
; (const struct gcm_key_data *key_data,
; struct gcm_context_data *context_data,
; u8 *out,
; const u8 *in,
; u64 plaintext_len,
; u8 *iv,
; const u64 iv_len,
; const u8 *aad,
; const u64 aad_len,
; u8 *auth_tag,
; const u64 auth_tag_len);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(FN_NAME(enc_var_iv,_),function,)
FN_NAME(enc_var_iv,_):
endbranch64
FUNC_SAVE
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_enc_IV
;; Check context_data != NULL
cmp arg2, 0
jz exit_enc_IV
;; Check IV != NULL
cmp arg6, 0
jz exit_enc_IV
;; Check IV len != 0
cmp arg7, 0
jz exit_enc_IV
;; Check auth_tag != NULL
cmp arg10, 0
jz exit_enc_IV
;; Check auth_tag_len == 0 or > 16
cmp arg11, 0
jz exit_enc_IV
cmp arg11, 16
ja exit_enc_IV
;; Check if plaintext_len == 0
cmp arg5, 0
jz skip_in_out_check_enc_IV
;; Check out != NULL (plaintext_len != 0)
cmp arg3, 0
jz exit_enc_IV
;; Check in != NULL (plaintext_len != 0)
cmp arg4, 0
jz exit_enc_IV
skip_in_out_check_enc_IV:
;; Check if aad_len == 0
cmp arg9, 0
jz skip_aad_check_enc_IV
;; Check aad != NULL (aad_len != 0)
cmp arg8, 0
jz exit_enc_IV
skip_aad_check_enc_IV:
%endif
cmp arg7, 12
je iv_len_12_enc_IV
GCM_INIT arg1, arg2, arg6, arg8, arg9, r10, r11, r12, k1, xmm14, xmm2, \
zmm1, zmm11, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, zmm9, zmm10, \
zmm12, zmm13, zmm15, zmm16, zmm17, zmm18, zmm19, zmm20, arg7
jmp skip_iv_len_12_enc_IV
iv_len_12_enc_IV:
GCM_INIT arg1, arg2, arg6, arg8, arg9, r10, r11, r12, k1, xmm14, xmm2, \
zmm1, zmm11, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, zmm9, zmm10, \
zmm12, zmm13, zmm15, zmm16, zmm17, zmm18, zmm19, zmm20
skip_iv_len_12_enc_IV:
GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, ENC, single_call
GCM_COMPLETE arg1, arg2, arg10, arg11, single_call
exit_enc_IV:
FUNC_RESTORE
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void aes_gcm_dec_128_vaes_avx512 / aes_gcm_dec_192_vaes_avx512 /
; aes_gcm_dec_256_vaes_avx512
; (const struct gcm_key_data *key_data,
; struct gcm_context_data *context_data,
; u8 *out,
; const u8 *in,
; u64 plaintext_len,
; u8 *iv,
; const u64 iv_len,
; const u8 *aad,
; const u64 aad_len,
; u8 *auth_tag,
; const u64 auth_tag_len);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(FN_NAME(dec_var_iv,_),function,)
FN_NAME(dec_var_iv,_):
endbranch64
FUNC_SAVE
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_dec_IV
;; Check context_data != NULL
cmp arg2, 0
jz exit_dec_IV
;; Check IV != NULL
cmp arg6, 0
jz exit_dec_IV
;; Check IV len != 0
cmp arg7, 0
jz exit_dec_IV
;; Check auth_tag != NULL
cmp arg10, 0
jz exit_dec_IV
;; Check auth_tag_len == 0 or > 16
cmp arg11, 0
jz exit_dec_IV
cmp arg11, 16
ja exit_dec_IV
;; Check if plaintext_len == 0
cmp arg5, 0
jz skip_in_out_check_dec_IV
;; Check out != NULL (plaintext_len != 0)
cmp arg3, 0
jz exit_dec_IV
;; Check in != NULL (plaintext_len != 0)
cmp arg4, 0
jz exit_dec_IV
skip_in_out_check_dec_IV:
;; Check if aad_len == 0
cmp arg9, 0
jz skip_aad_check_dec_IV
;; Check aad != NULL (aad_len != 0)
cmp arg8, 0
jz exit_dec_IV
skip_aad_check_dec_IV:
%endif
cmp arg7, 12
je iv_len_12_dec_IV
GCM_INIT arg1, arg2, arg6, arg8, arg9, r10, r11, r12, k1, xmm14, xmm2, \
zmm1, zmm11, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, zmm9, zmm10, zmm12, \
zmm13, zmm15, zmm16, zmm17, zmm18, zmm19, zmm20, arg7
jmp skip_iv_len_12_dec_IV
iv_len_12_dec_IV:
GCM_INIT arg1, arg2, arg6, arg8, arg9, r10, r11, r12, k1, xmm14, xmm2, \
zmm1, zmm11, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, zmm9, zmm10, \
zmm12, zmm13, zmm15, zmm16, zmm17, zmm18, zmm19, zmm20
skip_iv_len_12_dec_IV:
GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, DEC, single_call
GCM_COMPLETE arg1, arg2, arg10, arg11, single_call
exit_dec_IV:
FUNC_RESTORE
ret
%ifdef GCM128_MODE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void ghash_pre_avx512
; (const void *key, struct gcm_key_data *key_data)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(ghash_pre_vaes_avx512,function,)
ghash_pre_vaes_avx512:
endbranch64
;; Parameter is passed through register
%ifdef SAFE_PARAM
;; Check key != NULL
cmp arg1, 0
jz exit_ghash_pre
;; Check key_data != NULL
cmp arg2, 0
jz exit_ghash_pre
%endif
FUNC_SAVE
vmovdqu xmm6, [arg1]
vpshufb xmm6, [rel SHUF_MASK]
;;;;;;;;;;;;;;; PRECOMPUTATION of HashKey<<1 mod poly from the HashKey;;;;;;;;;;;;;;;
vmovdqa xmm2, xmm6
vpsllq xmm6, xmm6, 1
vpsrlq xmm2, xmm2, 63
vmovdqa xmm1, xmm2
vpslldq xmm2, xmm2, 8
vpsrldq xmm1, xmm1, 8
vpor xmm6, xmm6, xmm2
;reduction
vpshufd xmm2, xmm1, 00100100b
vpcmpeqd xmm2, [rel TWOONE]
vpand xmm2, xmm2, [rel POLY]
vpxor xmm6, xmm6, xmm2 ; xmm6 holds the HashKey<<1 mod poly
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
vmovdqu [arg2 + HashKey], xmm6 ; store HashKey<<1 mod poly
PRECOMPUTE arg2, xmm6, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm7, xmm8
FUNC_RESTORE
exit_ghash_pre:
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void ghash_vaes_avx512
; const struct gcm_key_data *key_data,
; const void *in,
; const u64 in_len,
; void *io_tag,
; const u64 tag_len);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(ghash_vaes_avx512,function,)
ghash_vaes_avx512:
endbranch64
FUNC_SAVE
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_ghash
;; Check in != NULL
cmp arg2, 0
jz exit_ghash
;; Check in_len != 0
cmp arg3, 0
jz exit_ghash
;; Check tag != NULL
cmp arg4, 0
jz exit_ghash
;; Check tag_len != 0
cmp arg5, 0
jz exit_ghash
%endif
;; copy tag to xmm0
vmovdqu xmm0, [arg4]
vpshufb xmm0, [rel SHUF_MASK] ; perform a 16Byte swap
CALC_AAD_HASH arg2, arg3, xmm0, arg1, zmm1, zmm2, zmm3, zmm4, zmm5, \
zmm6, zmm7, zmm8, zmm9, zmm10, zmm11, zmm12, zmm13, \
zmm15, zmm16, zmm17, zmm18, zmm19, r10, r11, r12, k1
vpshufb xmm0, [rel SHUF_MASK] ; perform a 16Byte swap
simd_store_avx arg4, xmm0, arg5, r12, rax
exit_ghash:
FUNC_RESTORE
ret
%endif
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; PARTIAL_BLOCK_GMAC
;;; Handles the tag partial blocks between update calls.
;;; Requires the input data be at least 1 byte long.
;;; Output:
;;; Updated AAD_HASH, DATA_OFFSET and GDATA_CTX
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%macro PARTIAL_BLOCK_GMAC 20
%define %%GDATA_KEY %1 ; [in] Key pointer
%define %%GDATA_CTX %2 ; [in] context pointer
%define %%PLAIN_IN %3 ; [in] input buffer
%define %%PLAIN_LEN %4 ; [in] buffer length
%define %%DATA_OFFSET %5 ; [out] data offset
%define %%AAD_HASH %6 ; [out] updated GHASH value
%define %%GPTMP0 %7 ; [clobbered] GP temporary register
%define %%GPTMP1 %8 ; [clobbered] GP temporary register
%define %%GPTMP2 %9 ; [clobbered] GP temporary register
%define %%ZTMP0 %10 ; [clobbered] ZMM temporary register
%define %%ZTMP1 %11 ; [clobbered] ZMM temporary register
%define %%ZTMP2 %12 ; [clobbered] ZMM temporary register
%define %%ZTMP3 %13 ; [clobbered] ZMM temporary register
%define %%ZTMP4 %14 ; [clobbered] ZMM temporary register
%define %%ZTMP5 %15 ; [clobbered] ZMM temporary register
%define %%ZTMP6 %16 ; [clobbered] ZMM temporary register
%define %%ZTMP7 %17 ; [clobbered] ZMM temporary register
%define %%ZTMP8 %18 ; [clobbered] ZMM temporary register
%define %%ZTMP9 %19 ; [clobbered] ZMM temporary register
%define %%MASKREG %20 ; [clobbered] mask temporary register
%define %%XTMP0 XWORD(%%ZTMP0)
%define %%XTMP1 XWORD(%%ZTMP1)
%define %%XTMP2 XWORD(%%ZTMP2)
%define %%XTMP3 XWORD(%%ZTMP3)
%define %%XTMP4 XWORD(%%ZTMP4)
%define %%XTMP5 XWORD(%%ZTMP5)
%define %%XTMP6 XWORD(%%ZTMP6)
%define %%XTMP7 XWORD(%%ZTMP7)
%define %%XTMP8 XWORD(%%ZTMP8)
%define %%XTMP9 XWORD(%%ZTMP9)
%define %%LENGTH %%GPTMP0
%define %%IA0 %%GPTMP1
%define %%IA1 %%GPTMP2
mov %%LENGTH, [%%GDATA_CTX + PBlockLen]
or %%LENGTH, %%LENGTH
je %%_partial_block_done ;Leave Macro if no partial blocks
READ_SMALL_DATA_INPUT %%XTMP4, %%PLAIN_IN, %%PLAIN_LEN, %%IA0, %%MASKREG
vmovdqu64 %%XTMP2, [%%GDATA_KEY + HashKey]
;; adjust the shuffle mask pointer to be able to shift right %%LENGTH bytes
;; (16 - %%LENGTH) is the number of bytes in plaintext mod 16)
lea %%IA0, [rel SHIFT_MASK]
add %%IA0, %%LENGTH
vmovdqu64 %%XTMP3, [%%IA0] ; shift right shuffle mask
;; Determine if partial block is not being filled and shift mask accordingly
mov %%IA1, %%PLAIN_LEN
add %%IA1, %%LENGTH
sub %%IA1, 16
jge %%_no_extra_mask
sub %%IA0, %%IA1
%%_no_extra_mask:
;; get the appropriate mask to mask out bottom %%LENGTH bytes of %%XTMP1
;; - mask out bottom %%LENGTH bytes of %%XTMP1
vmovdqu64 %%XTMP0, [%%IA0 + ALL_F - SHIFT_MASK]
vpand %%XTMP4, %%XTMP0
vpshufb %%XTMP4, [rel SHUF_MASK]
vpshufb %%XTMP4, %%XTMP3
vpxorq %%AAD_HASH, %%XTMP4
cmp %%IA1, 0
jl %%_partial_incomplete
;; GHASH computation for the last <16 Byte block
GHASH_MUL %%AAD_HASH, %%XTMP2, %%XTMP5, %%XTMP6, %%XTMP7, %%XTMP8, %%XTMP9
mov qword [%%GDATA_CTX + PBlockLen], 0
;; Set %%LENGTH to be the number of bytes to skip after this macro
mov %%IA0, %%LENGTH
mov %%LENGTH, 16
sub %%LENGTH, %%IA0
jmp %%_ghash_done
%%_partial_incomplete:
%ifidn __OUTPUT_FORMAT__, win64
mov %%IA0, %%PLAIN_LEN
add [%%GDATA_CTX + PBlockLen], %%IA0
%else
add [%%GDATA_CTX + PBlockLen], %%PLAIN_LEN
%endif
mov %%LENGTH, %%PLAIN_LEN
%%_ghash_done:
vmovdqu64 [%%GDATA_CTX + AadHash], %%AAD_HASH
mov %%DATA_OFFSET, %%LENGTH
%%_partial_block_done:
%endmacro ; PARTIAL_BLOCK_GMAC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;void imb_aes_gmac_update_128_vaes_avx512 /
; imb_aes_gmac_update_192_vaes_avx512 /
; imb_aes_gmac_update_256_vaes_avx512
; const struct gcm_key_data *key_data,
; struct gcm_context_data *context_data,
; const u8 *in,
; const u64 plaintext_len);
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MKGLOBAL(GMAC_FN_NAME(update),function,)
GMAC_FN_NAME(update):
endbranch64
FUNC_SAVE
;; Check if plaintext_len == 0
cmp arg4, 0
je exit_gmac_update
%ifdef SAFE_PARAM
;; Check key_data != NULL
cmp arg1, 0
jz exit_gmac_update
;; Check context_data != NULL
cmp arg2, 0
jz exit_gmac_update
;; Check in != NULL (plaintext_len != 0)
cmp arg3, 0
jz exit_gmac_update
%endif
; Increment size of "AAD length" for GMAC
add [arg2 + AadLen], arg4
;; Deal with previous partial block
xor r11, r11
vmovdqu64 xmm8, [arg2 + AadHash]
PARTIAL_BLOCK_GMAC arg1, arg2, arg3, arg4, r11, xmm8, r10, r12, rax, \
zmm0, zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, \
zmm9, zmm10, k1
; CALC_AAD_HASH needs to deal with multiple of 16 bytes
sub arg4, r11
add arg3, r11
vmovq xmm14, arg4 ; Save remaining length
and arg4, -16 ; Get multiple of 16 bytes
or arg4, arg4
jz no_full_blocks
;; Calculate GHASH of this segment
CALC_AAD_HASH arg3, arg4, xmm8, arg1, zmm1, zmm2, zmm3, zmm4, zmm5, \
zmm6, zmm7, zmm9, zmm10, zmm11, zmm12, zmm13, zmm15, \
zmm16, zmm17, zmm18, zmm19, zmm20, r10, r11, r12, k1
vmovdqu64 [arg2 + AadHash], xmm8 ; ctx_data.aad hash = aad_hash
no_full_blocks:
add arg3, arg4 ; Point at partial block
vmovq arg4, xmm14 ; Restore original remaining length
and arg4, 15
jz exit_gmac_update
; Save next partial block
mov [arg2 + PBlockLen], arg4
READ_SMALL_DATA_INPUT xmm1, arg3, arg4, r11, k1
vpshufb xmm1, [rel SHUF_MASK]
vpxorq xmm8, xmm1
vmovdqu64 [arg2 + AadHash], xmm8
exit_gmac_update:
FUNC_RESTORE
ret
%ifdef LINUX
section .note.GNU-stack noalloc noexec nowrite progbits
%endif
| 41.847471 | 137 | 0.495638 |
9daf43df9b861a78ab0eeb2383ba8eb74988dcf2 | 6,013 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_342.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_342.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_342.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x7091, %rsi
lea addresses_WT_ht+0x13d11, %rdi
nop
nop
nop
and $55506, %r11
mov $11, %rcx
rep movsl
nop
cmp $37717, %rax
lea addresses_D_ht+0x1a939, %rsi
lea addresses_UC_ht+0x1e91, %rdi
clflush (%rsi)
nop
nop
add %r10, %r10
mov $86, %rcx
rep movsq
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_A_ht+0x1dcdf, %rdi
nop
nop
nop
nop
nop
add %r8, %r8
movb $0x61, (%rdi)
cmp %r8, %r8
lea addresses_A_ht+0xbb91, %rax
clflush (%rax)
nop
cmp %rdi, %rdi
mov (%rax), %r10d
nop
nop
nop
xor $1068, %r10
lea addresses_A_ht+0x9511, %r8
and $2511, %rcx
and $0xffffffffffffffc0, %r8
movaps (%r8), %xmm2
vpextrq $0, %xmm2, %rsi
nop
nop
nop
nop
inc %rsi
lea addresses_WT_ht+0x4871, %r11
cmp $24830, %rdi
vmovups (%r11), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $1, %xmm1, %r10
nop
nop
inc %r10
lea addresses_WC_ht+0x15d91, %rsi
clflush (%rsi)
nop
nop
inc %r10
movups (%rsi), %xmm1
vpextrq $1, %xmm1, %r11
nop
nop
dec %rax
lea addresses_UC_ht+0x14a7b, %r8
nop
nop
nop
nop
sub %r11, %r11
mov $0x6162636465666768, %r10
movq %r10, %xmm5
and $0xffffffffffffffc0, %r8
vmovntdq %ymm5, (%r8)
nop
nop
nop
xor $3908, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r8
push %rcx
push %rdx
// Faulty Load
lea addresses_WT+0x16691, %rdx
nop
nop
nop
nop
sub $7835, %rcx
movups (%rdx), %xmm2
vpextrq $0, %xmm2, %r8
lea oracles, %r11
and $0xff, %r8
shlq $12, %r8
mov (%r11,%r8,1), %r8
pop %rdx
pop %rcx
pop %r8
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WT', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}}
{'dst': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 2, 'type': 'addresses_D_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A_ht', 'congruent': 1}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_A_ht', 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 16, 'type': 'addresses_A_ht', 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_WT_ht', 'congruent': 5}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_WC_ht', 'congruent': 7}}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC_ht', 'congruent': 1}, 'OP': 'STOR'}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 40.086667 | 2,999 | 0.658407 |
33ffbaa778e7f6cf9e83001e2eabf549f41905c1 | 693 | asm | Assembly | oeis/098/A098248.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/098/A098248.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/098/A098248.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A098248: Chebyshev polynomials S(n,291).
; Submitted by Jamie Morken(s4)
; 1,291,84680,24641589,7170617719,2086625114640,607200737742521,176693328057958971,51417151264128318040,14962214324533282590669,4353952951287921105566639,1266985346610460508437301280,368688381910692720034149105841,107287052150664971069428952498451,31220163487461595888483791027943400,9084960287799173738577713760179030949,2643692223586072096330226220421070062759,769305352103259180858357252428771209231920,223865213769824835557685630230552000816425961,65144007901666923888105660039838203466370722731
add $0,1
mul $0,2
mov $3,1
lpb $0
sub $0,1
mov $2,$3
mul $3,17
add $3,$1
mov $1,$2
lpe
mov $0,$1
div $0,17
| 40.764706 | 499 | 0.8557 |
d9959ffb37884bcb1a2b935a598cd21b96264980 | 1,189 | asm | Assembly | programs/oeis/001/A001160.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/001/A001160.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/001/A001160.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A001160: sigma_5(n), the sum of the 5th powers of the divisors of n.
; 1,33,244,1057,3126,8052,16808,33825,59293,103158,161052,257908,371294,554664,762744,1082401,1419858,1956669,2476100,3304182,4101152,5314716,6436344,8253300,9768751,12252702,14408200,17766056,20511150,25170552,28629152,34636833,39296688,46855314,52541808,62672701,69343958,81711300,90595736,105736950,115856202,135338016,147008444,170231964,185349918,212399352,229345008,264105844,282492057,322368783,346445352,392457758,418195494,475470600,503448552,568530600,604168400,676867950,714924300,806220408,844596302,944762016,996596744,1108378657,1160665044,1296790704,1350125108,1500789906,1570467936,1733879664,1804229352,2005585725,2073071594,2288350614,2383575244,2617237700,2706962016,2989659288,3077056400,3383585526,3501192601,3823254666,3939040644,4334917664,4438476108,4851278652,5004720600,5447583900,5584059450,6116547294,6240709552,6803215608,6985513088,7568385264,7740288600,8451387252,8587340258,9322237881,9549256236,10325569807
add $0,1
mov $2,$0
lpb $0
mov $3,$2
mov $4,$0
cmp $4,0
add $0,$4
dif $3,$0
cmp $3,$2
cmp $3,0
mul $3,$0
sub $0,1
pow $3,5
add $1,$3
lpe
add $1,1
mov $0,$1
| 56.619048 | 939 | 0.816653 |
76dcfa0a22cb97441ab4300e4546e215622482a0 | 540 | asm | Assembly | src/gfx/Rectangle.asm | beckadamtheinventor/BOSos | 42471126eb47517fc1beec15960b72a9cb76601b | [
"BSD-3-Clause"
] | 1 | 2019-07-21T20:51:38.000Z | 2019-07-21T20:51:38.000Z | src/gfx/Rectangle.asm | beckadamtheinventor/BOSos | 42471126eb47517fc1beec15960b72a9cb76601b | [
"BSD-3-Clause"
] | null | null | null | src/gfx/Rectangle.asm | beckadamtheinventor/BOSos | 42471126eb47517fc1beec15960b72a9cb76601b | [
"BSD-3-Clause"
] | null | null | null | ;@DOES draws a rectangle outline to the back buffer
;@INPUT BC rectangle width
;@INPUT HL rectangle X coordinate
;@INPUT E rectangle Y coordinate
;@INPUT D rectangle height
;@DESTROYS HL,DE,BC,AF
gfx_Rectangle:
.computed:
ld a,(color_primary) ; always use primary color
push bc
push hl
push de
call gfx_HorizLine ; top horizontal line
pop bc
push bc
call gfx_VertLine.computed ; left vertical line
pop bc
pop hl
ld e,c
call gfx_VertLine ; right vertical line
pop bc
jp gfx_HorizLine.computed ; bottom horizontal line
| 21.6 | 52 | 0.755556 |
a4c848ff35cb4130520ffa57ecd2a892080f2c47 | 960 | asm | Assembly | oeis/019/A019551.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/019/A019551.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/019/A019551.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A019551: a(n) is the concatenation of n and 3n.
; Submitted by Jon Maiga
; 13,26,39,412,515,618,721,824,927,1030,1133,1236,1339,1442,1545,1648,1751,1854,1957,2060,2163,2266,2369,2472,2575,2678,2781,2884,2987,3090,3193,3296,3399,34102,35105,36108,37111,38114,39117,40120,41123,42126,43129,44132,45135,46138,47141,48144,49147,50150,51153,52156,53159,54162,55165,56168,57171,58174,59177,60180,61183,62186,63189,64192,65195,66198,67201,68204,69207,70210,71213,72216,73219,74222,75225,76228,77231,78234,79237,80240,81243,82246,83249,84252,85255,86258,87261,88264,89267,90270
mov $2,$0
mov $4,$0
lpb $2
mov $0,$4
sub $2,1
sub $0,$2
mov $6,2
mov $7,0
mov $8,$0
lpb $6
mov $0,$8
sub $6,1
add $0,$6
trn $0,1
seq $0,248038 ; 3n concatenated with itself.
mul $0,2
mov $5,$6
mul $5,$0
add $7,$5
lpe
min $8,1
mul $8,$0
mov $0,$7
sub $0,$8
sub $0,66
div $0,6
add $0,13
add $3,$0
lpe
mov $0,$3
add $0,13
| 26.666667 | 496 | 0.666667 |
305aadadf8782d779e372bb73a19b81de117bf44 | 1,836 | asm | Assembly | mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/strcpy.asm | gb-archive/really-old-stuff | ffb39a518cad47e23353b3420b88e2f3521fd3d7 | [
"Apache-2.0"
] | 10 | 2016-10-27T20:46:02.000Z | 2021-11-01T15:49:13.000Z | mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/strcpy.asm | gb-archive/really-old-stuff | ffb39a518cad47e23353b3420b88e2f3521fd3d7 | [
"Apache-2.0"
] | null | null | null | mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/strcpy.asm | gb-archive/really-old-stuff | ffb39a518cad47e23353b3420b88e2f3521fd3d7 | [
"Apache-2.0"
] | 2 | 2015-03-11T14:28:08.000Z | 2017-11-02T10:57:57.000Z | #include once <realloc.asm>
; String library
__STRASSIGN: ; Performs a$ = b$ (HL = address of a$; DE = Address of b$)
PROC
LOCAL __STRREALLOC
LOCAL __STRCONTINUE
LOCAL __B_IS_NULL
LOCAL __NOTHING_TO_COPY
ld b, d
ld c, e
ld a, b
or c
jr z, __B_IS_NULL
ex de, hl
ld c, (hl)
inc hl
ld b, (hl)
dec hl ; BC = LEN(b$)
ex de, hl ; DE = &b$
__B_IS_NULL: ; Jumps here if B$ pointer is NULL
inc bc
inc bc ; BC = BC + 2 ; (LEN(b$) + 2 bytes for storing length)
push de
push hl
ld a, h
or l
jr z, __STRREALLOC
dec hl
ld d, (hl)
dec hl
ld e, (hl) ; DE = MEMBLOCKSIZE(a$)
dec de
dec de ; DE = DE - 2 ; (Membloksize takes 2 bytes for memblock length)
ld h, b
ld l, c ; HL = LEN(b$) + 2 => Minimum block size required
ex de, hl ; Now HL = BLOCKSIZE(a$), DE = LEN(b$) + 2
or a ; Prepare to subtract BLOCKSIZE(a$) - LEN(b$)
sbc hl, de ; Carry if len(b$) > Blocklen(a$)
jr c, __STRREALLOC ; No need to realloc
; Need to reallocate at least to len(b$) + 2
ex de, hl ; DE = Remaining bytes in a$ mem block.
ld hl, 4
sbc hl, de ; if remaining bytes < 4 we can continue
jr nc,__STRCONTINUE ; Otherwise, we realloc, to free some bytes
__STRREALLOC:
pop hl
call __REALLOC ; Returns in HL a new pointer with BC bytes allocated
push hl
__STRCONTINUE: ; Pops hl and de SWAPPED
pop de ; DE = &a$
pop hl ; HL = &b$
ld a, d ; Return if not enough memory for new length
or e
ret z ; Return if DE == NULL (0)
__STRCPY: ; Copies string pointed by HL into string pointed by DE
; Returns DE as HL (new pointer)
ld a, h
or l
jr z, __NOTHING_TO_COPY
ld c, (hl)
inc hl
ld b, (hl)
dec hl
inc bc
inc bc
push de
ldir
pop hl
ret
__NOTHING_TO_COPY:
ex de, hl
ld (hl), e
inc hl
ld (hl), d
dec hl
ret
ENDP
| 18.927835 | 74 | 0.612745 |
e235fb18dfc087596058a9e06fed5844d27215c8 | 492 | asm | Assembly | programs/oeis/278/A278481.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/278/A278481.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/278/A278481.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A278481: Number of neighbors of the n-th term in a full isosceles triangle read by rows.
; 2,4,4,4,6,4,4,6,6,4,4,6,6,6,4,4,6,6,6,6,4,4,6,6,6,6,6,4,4,6,6,6,6,6,6,4,4,6,6,6,6,6,6,6,4,4,6,6,6,6,6,6,6,6,4,4,6,6,6,6,6,6,6,6,6,4,4,6,6,6,6,6,6,6,6,6,6,4,4,6,6,6,6,6,6,6,6,6,6,6,4
mov $2,$0
mov $3,$0
mov $0,1
add $2,1
lpb $2,1
lpb $4,1
trn $1,$2
sub $3,$1
sub $4,$4
lpe
sub $2,$0
add $0,1
add $3,3
div $3,2
mov $1,$3
trn $2,1
add $4,3
lpe
sub $1,1
mul $1,2
add $1,2
| 19.68 | 183 | 0.53252 |
8202d226861cdb87180c64cdd971a03379501d7b | 6,286 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_4k_/i7-7700_9_0x48.log_2759_2006.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_4k_/i7-7700_9_0x48.log_2759_2006.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_4k_/i7-7700_9_0x48.log_2759_2006.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r14
push %r15
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x49dd, %r15
nop
cmp $28871, %r14
movl $0x61626364, (%r15)
nop
nop
nop
nop
and %rax, %rax
lea addresses_normal_ht+0x165dd, %rsi
lea addresses_D_ht+0x1e571, %rdi
nop
add $23629, %r10
mov $120, %rcx
rep movsl
nop
cmp $19636, %rax
lea addresses_A_ht+0x1c963, %rsi
lea addresses_D_ht+0x1e5dd, %rdi
nop
nop
nop
nop
nop
cmp %r15, %r15
mov $50, %rcx
rep movsw
nop
nop
nop
add %r10, %r10
lea addresses_WC_ht+0xdd5d, %rsi
lea addresses_UC_ht+0x18add, %rdi
nop
nop
dec %rax
mov $124, %rcx
rep movsq
nop
nop
nop
add $50786, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r14
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r9
push %rbx
push %rdi
push %rdx
// Store
lea addresses_RW+0x5dd, %rbx
clflush (%rbx)
nop
nop
nop
nop
nop
and $16010, %r10
movl $0x51525354, (%rbx)
nop
nop
nop
cmp $49323, %rbx
// Store
lea addresses_A+0x8e9d, %rdx
nop
sub $52340, %r9
mov $0x5152535455565758, %r10
movq %r10, (%rdx)
nop
nop
add %rdx, %rdx
// Store
lea addresses_RW+0x17fdd, %rbx
cmp %r13, %r13
mov $0x5152535455565758, %r9
movq %r9, %xmm2
vmovaps %ymm2, (%rbx)
nop
nop
nop
nop
nop
sub %rdx, %rdx
// Store
lea addresses_PSE+0xda5d, %r10
nop
nop
nop
nop
and %r14, %r14
mov $0x5152535455565758, %rdx
movq %rdx, %xmm6
vmovaps %ymm6, (%r10)
nop
nop
nop
nop
nop
xor $17736, %rbx
// Load
lea addresses_D+0xfcb9, %rdi
nop
nop
inc %r10
mov (%rdi), %r9
nop
nop
sub %r10, %r10
// Faulty Load
lea addresses_A+0xffdd, %rdi
nop
nop
nop
nop
and $18125, %r9
movb (%rdi), %bl
lea oracles, %r9
and $0xff, %rbx
shlq $12, %rbx
mov (%r9,%rbx,1), %rbx
pop %rdx
pop %rdi
pop %rbx
pop %r9
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': True, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 8, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 4, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': True, 'congruent': 11, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'AVXalign': True, 'congruent': 5, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 2, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': True, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 8, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}}
{'58': 2759}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 35.314607 | 2,999 | 0.657334 |
ffab8c7cbeff40d42daa60da3cd97ad8b5aed814 | 290 | asm | Assembly | programs/oeis/057/A057077.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/057/A057077.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/057/A057077.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A057077: Periodic sequence 1,1,-1,-1; expansion of (1+x)/(1+x^2).
; 1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1
bin $0,2
mov $1,-1
pow $1,$0
mov $0,$1
| 36.25 | 181 | 0.465517 |
d924f388c3533370864150065b4097b8cdcd45dd | 606 | asm | Assembly | programs/oeis/263/A263084.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/263/A263084.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/263/A263084.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A263084: a(n) = A263086(n) - A263085(n).
; 1,2,4,6,7,11,13,14,18,22,22,28,29,31,37,41,41,46,48,52,58,62,60,68,71,73,79,83,83,93,95,96,100,104,108,118,120,120,124,132,131,141,141,145,155,157,157,165,169,172,178,184,180,190,196,202,208,210,208,220,221,223,231,237,241,251,251,251,257,267,267,278,278,278,288,294,296,304,306,314,320,324,320,334,339,339,345,349,349,365,371,375,379,381,381,393,395,396,406,416
mov $2,$0
add $2,1
mov $3,$0
lpb $2
mov $0,$3
sub $2,1
sub $0,$2
mul $0,2
seq $0,51950 ; Differences between values of tau(n) (A000005): a(n) = tau(n)-tau(n-1).
add $1,$0
lpe
mov $0,$1
| 37.875 | 364 | 0.655116 |
7a9637c5eb15a247ea72a27817ae3ad0f580013f | 381 | asm | Assembly | libsrc/_DEVELOPMENT/l/z80/integer/l_ltu_bc_de.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/l/z80/integer/l_ltu_bc_de.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/l/z80/integer/l_ltu_bc_de.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
SECTION code_l
PUBLIC l_ltu_bc_de
l_ltu_bc_de:
; bc < de ?
; enter : de = unsigned int
; bc = unsigned int
;
; exit : carry set if bc<de, a<0
; z set if bc=de, a=0
; p,nc set if bc>=de, a>=0
; a>0 if bc>de
;
; uses : af
ld a,b
sub d
ret nz
ld a,c
sub e
ret
| 13.607143 | 38 | 0.461942 |
bfd1e59639454ffd96e9f5216e2ccd5850de6be8 | 328 | asm | Assembly | libsrc/stdio/svi/fputc_cons.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | 1 | 2018-09-04T23:07:24.000Z | 2018-09-04T23:07:24.000Z | libsrc/stdio/svi/fputc_cons.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | libsrc/stdio/svi/fputc_cons.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | ;
; Spectravideo SVI C Library
;
; Fputc_cons
;
; Stefano Bodrato - Apr. 2000
;
;
; $Id: fputc_cons.asm,v 1.2 2001/04/13 14:14:00 stefano Exp $
;
XLIB fputc_cons
;
; Entry: hl = points to char
;
.fputc_cons
ld hl,2
add hl,sp
ld a,(hl)
cp 13
jr nz,nocrlf
rst $18
ld a,10
.nocrlf
jp $18
| 10.933333 | 61 | 0.579268 |
7b579132bc2ce32f7b4a09a71d70f42966362a3d | 3,298 | asm | Assembly | externals/mpir-3.0.0/mpn/x86_64/nehalem/sumdiff_n.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | 1 | 2018-08-14T03:52:21.000Z | 2018-08-14T03:52:21.000Z | externals/mpir-3.0.0/mpn/x86_64/nehalem/sumdiff_n.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | null | null | null | externals/mpir-3.0.0/mpn/x86_64/nehalem/sumdiff_n.asm | JaminChan/eos_win | c03e57151cfe152d0d3120abb13226f4df74f37e | [
"MIT"
] | null | null | null | dnl mpn_sumdiff
dnl Copyright 2011 The Code Cavern
dnl This file is part of the MPIR Library.
dnl The MPIR Library is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU Lesser General Public License as published
dnl by the Free Software Foundation; either version 2.1 of the License, or (at
dnl your option) any later version.
dnl The MPIR 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 Lesser General Public
dnl License for more details.
dnl You should have received a copy of the GNU Lesser General Public License
dnl along with the MPIR Library; see the file COPYING.LIB. If not, write
dnl to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
dnl Boston, MA 02110-1301, USA.
include(`../config.m4')
ASM_START()
PROLOGUE(mpn_sumdiff_n)
push %rbx
xor %r9,%r9
push %rbp
xor %rax,%rax
push %r12
mov $3,%r10d
push %r13
lea -24(%rdi,%r8,8),%rdi
push %r14
lea -24(%rsi,%r8,8),%rsi
push %r15
sub %r8,%r10
lea -24(%rdx,%r8,8),%rdx
lea -24(%rcx,%r8,8),%rcx
jnc skiplp
.align 16
lp: .byte 0x9e # sahf
mov (%rdx,%r10,8),%r8
mov 24(%rdx,%r10,8),%r12
mov %r8,%r11
adc (%rcx,%r10,8),%r8
mov 8(%rdx,%r10,8),%rbx
mov %rbx,%r13
adc 8(%rcx,%r10,8),%rbx
mov 16(%rdx,%r10,8),%rbp
mov %rbp,%r14
adc 16(%rcx,%r10,8),%rbp
mov %r12,%r15
adc 24(%rcx,%r10,8),%r12
.byte 0x9f # lahf
add $255,%r9b
sbb (%rcx,%r10,8),%r11
mov %r11,(%rsi,%r10,8)
sbb 8(%rcx,%r10,8),%r13
sbb 16(%rcx,%r10,8),%r14
sbb 24(%rcx,%r10,8),%r15
setc %r9b
add $4,%r10
mov %r8,-32(%rdi,%r10,8)
mov %rbp,16-32(%rdi,%r10,8)
mov %r13,8-32(%rsi,%r10,8)
mov %r15,24-32(%rsi,%r10,8)
mov %r12,24-32(%rdi,%r10,8)
mov %r14,16-32(%rsi,%r10,8)
mov %rbx,8-32(%rdi,%r10,8)
jnc lp
skiplp:
cmp $2,%r10
jg case0
je case1
jp case2
case3: .byte 0x9e # sahf
mov (%rdx),%r8
mov %r8,%r11
adc (%rcx),%r8
mov 8(%rdx),%rbx
mov %rbx,%r13
adc 8(%rcx),%rbx
mov 16(%rdx),%rbp
mov %rbp,%r14
adc 16(%rcx),%rbp
.byte 0x9f # lahf
add $255,%r9b
sbb (%rcx),%r11
mov %r11,(%rsi)
sbb 8(%rcx),%r13
sbb 16(%rcx),%r14
setc %r9b
mov %r8,(%rdi)
mov %rbp,16(%rdi)
mov %r13,8(%rsi)
mov %r14,16(%rsi)
mov %rbx,8(%rdi)
.byte 0x9e # sahf
mov $0,%rax
adc $0,%rax
add $255,%r9b
rcl $1,%rax
pop %r15
pop %r14
pop %r13
pop %r12
pop %rbp
pop %rbx
ret
case2: .byte 0x9e # sahf
mov 8(%rdx),%r8
mov %r8,%r11
adc 8(%rcx),%r8
mov 16(%rdx),%rbx
mov %rbx,%r13
adc 16(%rcx),%rbx
.byte 0x9f # lahf
add $255,%r9b
sbb 8(%rcx),%r11
mov %r11,8(%rsi)
sbb 16(%rcx),%r13
setc %r9b
mov %r8,8(%rdi)
mov %r13,16(%rsi)
mov %rbx,16(%rdi)
.byte 0x9e # sahf
mov $0,%rax
adc $0,%rax
add $255,%r9b
rcl $1,%rax
pop %r15
pop %r14
pop %r13
pop %r12
pop %rbp
pop %rbx
ret
case1: .byte 0x9e # sahf
mov 16(%rdx),%r8
mov %r8,%r11
adc 16(%rcx),%r8
.byte 0x9f # lahf
add $255,%r9b
sbb 16(%rcx),%r11
mov %r11,16(%rsi)
setc %r9b
mov %r8,16(%rdi)
case0: .byte 0x9e # sahf
mov $0,%rax
adc $0,%rax
add $255,%r9b
rcl $1,%rax
pop %r15
pop %r14
pop %r13
pop %r12
pop %rbp
pop %rbx
ret
EPILOGUE()
| 20.358025 | 79 | 0.623408 |
bdbf16b7a1d3398f16eb4e747e2a24f3956ddc1f | 85 | asm | Assembly | processor/arch/c64/loopBegin.asm | HakierGrzonzo/bfc64 | edd4bea27c08f0a1f868601ae36a1ab1bc099896 | [
"MIT"
] | 1 | 2020-12-18T09:38:46.000Z | 2020-12-18T09:38:46.000Z | processor/arch/c64/loopBegin.asm | HakierGrzonzo/bfc64 | edd4bea27c08f0a1f868601ae36a1ab1bc099896 | [
"MIT"
] | null | null | null | processor/arch/c64/loopBegin.asm | HakierGrzonzo/bfc64 | edd4bea27c08f0a1f868601ae36a1ab1bc099896 | [
"MIT"
] | null | null | null | loopBegin():
lda ($fb),y
cmp #$00
bne label()
jmp loopEnd()
label():
| 12.142857 | 17 | 0.505882 |
da49635ecb6295b090f13be5a71b32af14c65373 | 531 | asm | Assembly | oeis/062/A062873.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/062/A062873.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/062/A062873.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A062873: Nearest integer to arithmetic mean of n! and n^n.
; Submitted by Jamie Morken(s2)
; 1,1,3,17,140,1623,23688,414292,8408768,193891685,5001814400,142675793706,4458289724928,151440666806527,5556047001924608,218947599027613688,9223382498249719808,413620308786882430089,19673207238835121651712,989209888652706998977990,52428801216451004088320000
mov $1,$0
pow $1,$0
seq $0,142 ; Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters).
add $1,1
add $1,$0
div $1,2
mov $0,$1
| 44.25 | 258 | 0.787194 |
e9aae412f1b1c5fc7219446765e33154d70f9c0a | 3,076 | asm | Assembly | lib/shift.asm | Kylogias/jdh-8 | 3c17c9faee49b18e20818cbf1379ac73e22760e0 | [
"MIT"
] | 1 | 2021-06-17T23:57:03.000Z | 2021-06-17T23:57:03.000Z | lib/shift.asm | alexshcer/jdh-8 | f253853e740bd4bfa83041fbf73568a0d32b1141 | [
"MIT"
] | null | null | null | lib/shift.asm | alexshcer/jdh-8 | f253853e740bd4bfa83041fbf73568a0d32b1141 | [
"MIT"
] | null | null | null | ; SHIFT (LEFT/RIGHT) OPS
; tables generated by the following python code (replace shift op appropriately)
; xs = [(x >> 1) & 0xFF for x in range(0, 256)]
; chunk = lambda xs, n: [xs[i:i+n] for i in range(0, len(xs), n)]
; print('\n'.join(list(map(lambda ys: '@db ' + ', '.join([hex(y) for y in ys]),\
; chunk(xs, 16)))))
; index is 7 LSBs
shltab:
@db 0x0, 0x2, 0x4, 0x6, 0x8, 0xa, 0xc, 0xe, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e
@db 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e
@db 0x40, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e
@db 0x60, 0x62, 0x64, 0x66, 0x68, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7a, 0x7c, 0x7e
@db 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e, 0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e
@db 0xa0, 0xa2, 0xa4, 0xa6, 0xa8, 0xaa, 0xac, 0xae, 0xb0, 0xb2, 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe
@db 0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde
; index is 7 MSBs
; TODO: shrink this table, all entries are duplicated >:(
shrtab:
@db 0x0, 0x0, 0x1, 0x1, 0x2, 0x2, 0x3, 0x3, 0x4, 0x4, 0x5, 0x5, 0x6, 0x6, 0x7, 0x7
@db 0x8, 0x8, 0x9, 0x9, 0xa, 0xa, 0xb, 0xb, 0xc, 0xc, 0xd, 0xd, 0xe, 0xe, 0xf, 0xf
@db 0x10, 0x10, 0x11, 0x11, 0x12, 0x12, 0x13, 0x13, 0x14, 0x14, 0x15, 0x15, 0x16, 0x16, 0x17, 0x17
@db 0x18, 0x18, 0x19, 0x19, 0x1a, 0x1a, 0x1b, 0x1b, 0x1c, 0x1c, 0x1d, 0x1d, 0x1e, 0x1e, 0x1f, 0x1f
@db 0x20, 0x20, 0x21, 0x21, 0x22, 0x22, 0x23, 0x23, 0x24, 0x24, 0x25, 0x25, 0x26, 0x26, 0x27, 0x27
@db 0x28, 0x28, 0x29, 0x29, 0x2a, 0x2a, 0x2b, 0x2b, 0x2c, 0x2c, 0x2d, 0x2d, 0x2e, 0x2e, 0x2f, 0x2f
@db 0x30, 0x30, 0x31, 0x31, 0x32, 0x32, 0x33, 0x33, 0x34, 0x34, 0x35, 0x35, 0x36, 0x36, 0x37, 0x37
@db 0x38, 0x38, 0x39, 0x39, 0x3a, 0x3a, 0x3b, 0x3b, 0x3c, 0x3c, 0x3d, 0x3d, 0x3e, 0x3e, 0x3f, 0x3f
@db 0x40, 0x40, 0x41, 0x41, 0x42, 0x42, 0x43, 0x43, 0x44, 0x44, 0x45, 0x45, 0x46, 0x46, 0x47, 0x47
@db 0x48, 0x48, 0x49, 0x49, 0x4a, 0x4a, 0x4b, 0x4b, 0x4c, 0x4c, 0x4d, 0x4d, 0x4e, 0x4e, 0x4f, 0x4f
@db 0x50, 0x50, 0x51, 0x51, 0x52, 0x52, 0x53, 0x53, 0x54, 0x54, 0x55, 0x55, 0x56, 0x56, 0x57, 0x57
@db 0x58, 0x58, 0x59, 0x59, 0x5a, 0x5a, 0x5b, 0x5b, 0x5c, 0x5c, 0x5d, 0x5d, 0x5e, 0x5e, 0x5f, 0x5f
@db 0x60, 0x60, 0x61, 0x61, 0x62, 0x62, 0x63, 0x63, 0x64, 0x64, 0x65, 0x65, 0x66, 0x66, 0x67, 0x67
@db 0x68, 0x68, 0x69, 0x69, 0x6a, 0x6a, 0x6b, 0x6b, 0x6c, 0x6c, 0x6d, 0x6d, 0x6e, 0x6e, 0x6f, 0x6f
@db 0x70, 0x70, 0x71, 0x71, 0x72, 0x72, 0x73, 0x73, 0x74, 0x74, 0x75, 0x75, 0x76, 0x76, 0x77, 0x77
@db 0x78, 0x78, 0x79, 0x79, 0x7a, 0x7a, 0x7b, 0x7b, 0x7c, 0x7c, 0x7d, 0x7d, 0x7e, 0x7e, 0x7f, 0x7f
; SHIFT LEFT
; a: number to shift
; b: number of times to shift
shl:
jz b, [.done]
push b
clb
.shift:
and a, 0x7F
lda [shltab]
add16 h, l, a
lw a
dec b
jnz b, [.shift]
pop b
.done:
ret
; SHIFT RIGHT
; a: number to shift
; b: number of times to shift
shr:
jz b, [.done]
push b
clb
.shift:
lda [shrtab]
add16 h, l, a
lw a
dec b
jnz b, [.shift]
pop b
.done:
ret
| 42.136986 | 98 | 0.644343 |
7bb2c760fc14e4a4fea0c389c8ee1d653404a00b | 1,223 | asm | Assembly | programs/oeis/207/A207452.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/207/A207452.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/207/A207452.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A207452: Number of n X 7 0..1 arrays avoiding 0 0 0 and 0 0 1 horizontally and 0 0 1 and 1 0 1 vertically.
; 42,1764,10710,36456,92610,196812,370734,640080,1034586,1588020,2338182,3326904,4600050,6207516,8203230,10645152,13595274,17119620,21288246,26175240,31858722,38420844,45947790,54529776,64261050,75239892,87568614,101353560,116705106,133737660,152569662,173323584,196125930,221107236,248402070,278149032,310490754,345573900,383549166,424571280,468799002,516395124,567526470,622363896,681082290,743860572,810881694,882332640,958404426,1039292100,1125194742,1216315464,1312861410,1415043756,1523077710,1637182512,1757581434,1884501780,2018174886,2158836120,2306724882,2462084604,2625162750,2796210816,2975484330,3163242852,3359749974,3565273320,3780084546,4004459340,4238677422,4483022544,4737782490,5003249076,5279718150,5567489592,5866867314,6178159260,6501677406,6837737760,7186660362,7548769284,7924392630,8313862536,8717515170,9135690732,9568733454,10016991600,10480817466,10960567380,11456601702,11969284824,12498985170,13046075196,13610931390,14193934272,14795468394,15415922340,16055688726,16715164200
mov $2,$0
add $2,1
mul $2,2
mov $1,$2
bin $1,2
add $0,$1
mul $1,$0
sub $1,1
mul $1,42
add $1,42
mov $0,$1
| 81.533333 | 1,006 | 0.84955 |
fe3e5ef9a5e9a455f63a9598362da6b59b8c31b4 | 667 | asm | Assembly | oeis/064/A064948.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/064/A064948.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/064/A064948.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A064948: a(n) = Sum_{i|n, j|n} max(i,j).
; Submitted by Jamie Morken(s1)
; 1,7,10,27,16,64,22,83,55,102,34,236,40,140,140,227,52,343,58,372,192,216,70,708,141,254,244,510,88,866,94,579,296,330,296,1241,112,368,348,1104,124,1184,130,786,728,444,142,1908,267,877,452,924,160,1504,456,1506,504,558,178,3116,184,596,990,1411,536,1824,202,1200,608,1830,214,3663,220,710,1190,1338,616,2144,238,2952,973,786,250,4250,696,824,764,2316,268,4456,724,1614,816,900,776,4820,292,1659,1518,3147
add $0,1
mov $1,$0
lpb $1
mov $2,$0
mov $5,$1
lpb $2
dif $2,$5
add $3,$1
add $4,$5
add $4,$1
add $3,$4
mov $5,$0
lpe
sub $1,1
lpe
mov $0,$3
add $0,1
| 30.318182 | 407 | 0.646177 |
f9b8733e2cc408e45f0d277333c6f7a563ea5989 | 55 | asm | Assembly | audio/sfx/cymbal3_1.asm | AmateurPanda92/pokemon-rby-dx | f7ba1cc50b22d93ed176571e074a52d73360da93 | [
"MIT"
] | 9 | 2020-07-12T19:44:21.000Z | 2022-03-03T23:32:40.000Z | audio/sfx/cymbal3_1.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | audio/sfx/cymbal3_1.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2021-03-28T18:33:43.000Z | 2021-05-06T13:12:09.000Z | SFX_Cymbal3_1_Ch7:
noisenote 0, 10, 2, 80
endchannel
| 13.75 | 23 | 0.763636 |
b33722e51cd2ec9e0a48c7a809d4bc6de89837d9 | 975 | asm | Assembly | ASM/src/bunny_hood.asm | Triaphlax/OoT-Randomizer | d6755f8e4b1c6b5d5612e583f8f91fa303f1669b | [
"MIT"
] | 344 | 2018-07-07T07:36:26.000Z | 2022-03-27T22:48:10.000Z | ASM/src/bunny_hood.asm | Triaphlax/OoT-Randomizer | d6755f8e4b1c6b5d5612e583f8f91fa303f1669b | [
"MIT"
] | 1,076 | 2018-07-09T04:01:39.000Z | 2022-03-31T17:18:22.000Z | ASM/src/bunny_hood.asm | Triaphlax/OoT-Randomizer | d6755f8e4b1c6b5d5612e583f8f91fa303f1669b | [
"MIT"
] | 320 | 2018-07-02T01:19:41.000Z | 2022-03-25T01:28:30.000Z | .definelabel PLAYER_WALK_RUN, 0x80398BC0 ; Function called when Link is walking or running
SPEED_MULTIPLIER:
.float 1.0
bunny_hood :
ori t0, r0, 0x04
la t1, GLOBAL_CONTEXT
lw t1, 0x1C44(t1) ; Player in actor instance table
beqz t1, @@return
nop
l.s f22, SPEED_MULTIPLIER
nop
mul.s f12, f12, f22
lbu a3, 0x14f(t1) ; Worn Mask
bne t0, a3, @@return
mtc1 t7, f4 ; Displaced
la a3, PLAYER_WALK_RUN
lw t0, 0x0664(t1) ; Link State function pointer
bne t0, a3, @@return ; Branch if Link is not walking or running forward
nop
la t0, FAST_BUNNY_HOOD_ENABLED
lbu t0, 0x00(t0)
beqz t0, @@return
nop
lui t0, 0x3fc0
mtc1 t0, f22 ; f22 = 1.5
nop
mul.s f12, f12, f22 ; f12 = 1.5 * horizontal velocity
@@return:
nop
mfc1 a1, f12 ; Displaced
jr ra
nop
| 23.780488 | 90 | 0.553846 |
39a92875322d9aea4a99e09b356291775a6b9dc3 | 696 | asm | Assembly | oeis/246/A246884.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/246/A246884.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/246/A246884.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A246884: G.f.: Sum_{n>=0} x^n * Sum_{k=0..n} C(n,k)^2 * x^(4*k).
; Submitted by Christian Krause
; 1,1,1,1,1,2,5,10,17,26,38,59,101,182,326,564,945,1566,2622,4476,7750,13455,23231,39837,68101,116611,200526,346137,598438,1034227,1785400,3080418,5317009,9187567,15893830,27515434,47647774,82513447,142902640,247553410,429020710,743846284,1290184567,2238400147,3884271967,6741582845,11703231509,20321426684,35294788853,61315179476,106540482351,185157220080,321840929294,559520665419,972895269813,1691962157220,2942978722902,5119783188732,8907999168507,15501371832084,26978621323096,46959970273150
lpb $0
sub $0,4
add $2,1
mov $3,$0
bin $3,$2
pow $3,2
add $1,$3
lpe
add $1,1
mov $0,$1
| 46.4 | 496 | 0.771552 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.