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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cfe9642838c5ed8fd0b4235cedd4c136128f842d | 2,445 | asm | Assembly | constants.asm | MaxLeiter/KIMP | 312c3a57d431674ac4a2c91e949dc0c54d23edc4 | [
"MIT"
] | 3 | 2015-10-12T17:59:04.000Z | 2015-11-12T14:48:40.000Z | constants.asm | MaxLeiter/KIMP | 312c3a57d431674ac4a2c91e949dc0c54d23edc4 | [
"MIT"
] | 11 | 2015-10-12T21:29:58.000Z | 2015-10-17T00:27:27.000Z | constants.asm | MaxLeiter/KIMP | 312c3a57d431674ac4a2c91e949dc0c54d23edc4 | [
"MIT"
] | null | null | null |
corelibPath:
.db "/lib/core", 0
windowTitle:
.db "KIMP: Welcome", 0
newImageTitle:
.db "KIMP: New Image", 0
newImageStr:
.db "New Image\n", 0
loadImageStr:
.db "Load Image\n", 0
backStr:
.db "Back", 0
quitStr:
.db "Exit", 0
size: ;Image size, will need to be configurable with new image screen at some point, currently unused
.db 20
item:
.db 0
caretIcon: ;Just a line atm, maybe go back to the 'default' cursor?
.db 0b00000000
.db 0b00000000
.db 0b11111000
.db 0b00000000
cursor_y:
.db 0
cursor_x:
.db 0
menu:
.db 3
.db "New", 0
.db "Open", 0
.db "Exit", 0
menu_functions:
.dw new_image
.dw load_image
.dw exit
file_buffer:
.dw 0
file_buffer_length:
.dw 0
file_name:
.dw 0
file_length:
.dw 0
index:
.dw 0
current:
.dw 1
cursorPos: ;Really shouldn't hardcode this...
;x
.db 29, 55
.db 33, 55
.db 37, 55
.db 41, 55
.db 45, 55
.db 49, 55
.db 53, 55
.db 57, 55
.db 61, 55
.db 65, 55
.db 29, 51
.db 33, 51
.db 37, 51
.db 41, 51
.db 45, 51
.db 49, 51
.db 53, 51
.db 57, 51
.db 61, 51
.db 65, 51
.db 29, 47
.db 33, 47
.db 37, 47
.db 41, 47
.db 45, 47
.db 49, 47
.db 53, 47
.db 57, 47
.db 61, 47
.db 65, 47
.db 29, 43
.db 33, 43
.db 37, 43
.db 41, 43
.db 45, 43
.db 49, 43
.db 53, 43
.db 57, 43
.db 61, 43
.db 65, 43
.db 29, 39
.db 33, 39
.db 37, 39
.db 41, 39
.db 45, 39
.db 49, 39
.db 53, 39
.db 57, 39
.db 61, 39
.db 65, 39
.db 29, 35
.db 33, 35
.db 37, 35
.db 41, 35
.db 45, 35
.db 49, 35
.db 53, 35
.db 57, 35
.db 61, 35
.db 65, 35
.db 29, 31
.db 33, 31
.db 37, 31
.db 41, 31
.db 45, 31
.db 49, 31
.db 53, 31
.db 57, 31
.db 61, 31
.db 65, 31
.db 29, 27
.db 33, 27
.db 37, 27
.db 41, 27
.db 45, 27
.db 49, 27
.db 53, 27
.db 57, 27
.db 61, 27
.db 65, 27
.db 29, 23
.db 33, 23
.db 37, 23
.db 41, 23
.db 45, 23
.db 49, 23
.db 53, 23
.db 57, 23
.db 61, 23
.db 65, 23
.db 29, 19
.db 33, 19
.db 37, 19
.db 41, 19
.db 45, 19
.db 49, 19
.db 53, 19
.db 57, 19
.db 61, 19
.db 65, 19
cursorPos_end:
.db 0
| 15 | 101 | 0.475665 |
a36ae4209ad24a28ca9a3c432e1acc2fe28da06a | 1,164 | asm | Assembly | binary16/fbld.asm | DW0RKiN/Floating-point-Library-for-Z80 | 494add6bc20922f4a634fbbacb32d8bd4dd185a7 | [
"MIT"
] | 12 | 2020-02-17T09:07:02.000Z | 2022-02-09T22:15:34.000Z | binary16/fbld.asm | DW0RKiN/Floating-point-Library-for-Z80 | 494add6bc20922f4a634fbbacb32d8bd4dd185a7 | [
"MIT"
] | null | null | null | binary16/fbld.asm | DW0RKiN/Floating-point-Library-for-Z80 | 494add6bc20922f4a634fbbacb32d8bd4dd185a7 | [
"MIT"
] | 1 | 2021-06-21T23:30:28.000Z | 2021-06-21T23:30:28.000Z | if not defined @FBLD
; Load Byte. Convert unsigned 8-bit integer into floating-point number
; In: A = Byte to convert
; Out: DE = floating point representation, zero flag if DE = 0
; Pollutes: AF
@FBLD:
if not defined FBLD
; *****************************************
FBLD ; *
; *****************************************
endif
FBLD_D EQU BIAS/EXP_PLUS_ONE+8 ;
LD D, FBLD_D ; 2:7
FBLD_X:
OR A ; 1:4
JR z, FBLD_OUT_ZERO ; 2:12/7 zero converted to positive epsilon
EX DE, HL ; 1:4 save HL
FBLD_LOOP:
ADD A, A ; 1:4
DEC H ; 1:4
JR nc, FBLD_LOOP ; 2:12/7
LD L, A ; 1:4
ADD HL, HL ; 1:11
ADD HL, HL ; 1:11
EX DE, HL ; 1:4 load HL
RET ; 1:10
FBLD_OUT_ZERO:
LD D, A ; 1:4
LD E, A ; 1:4
RET ; 1:10
endif
| 34.235294 | 82 | 0.348797 |
7decb07c9d6f5fc2db209c4505dd4c6e3c42e90d | 994 | asm | Assembly | programs/oeis/052/A052787.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/052/A052787.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/052/A052787.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A052787: A simple grammar. Product of 5 consecutive integers.
; 0,0,0,0,0,120,720,2520,6720,15120,30240,55440,95040,154440,240240,360360,524160,742560,1028160,1395360,1860480,2441880,3160080,4037880,5100480,6375600,7893600,9687600,11793600,14250600,17100720,20389320,24165120,28480320,33390720,38955840,45239040,52307640,60233040,69090840,78960960,89927760,102080160,115511760,130320960,146611080,164490480,184072680,205476480,228826080,254251200,281887200,311875200,344362200,379501200,417451320,458377920,502452720,549853920,600766320,655381440,713897640,776520240,843461640,914941440,991186560,1072431360,1158917760,1250895360,1348621560,1452361680,1562389080,1678985280,1802440080,1933051680,2071126800,2216980800,2370937800,2533330800,2704501800,2884801920,3074591520,3274240320,3484127520,3704641920,3936182040,4179156240,4433982840,4701090240,4980917040,5273912160,5580534960,5901255360,6236553960,6586922160,6952862280,7334887680,7733522880,8149303680,8582777280
bin $0,5
mul $0,120
| 165.666667 | 908 | 0.874245 |
1305cb22da88115e8f0eaf3f576cf8cbd8c20f91 | 400 | asm | Assembly | libsrc/graphics/eg2000/clsgraph.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/graphics/eg2000/clsgraph.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/graphics/eg2000/clsgraph.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; Colour Genie EG2000 graphics routines
;
; clsgraph () -- clear screen
;
; Stefano Bodrato - 2015
;
;
; $Id: clsgraph.asm $
;
SECTION code_clib
PUBLIC clsgraph
PUBLIC _clsgraph
INCLUDE "graphics/grafix.inc"
.clsgraph
._clsgraph
call $38a9 ; FGR
ld hl,$4800
ld bc,$FF0
.clsloop
ld (hl),0
inc hl
dec bc
ld a,b
or c
jr nz,clsloop
ret
| 12.5 | 45 | 0.595 |
a7cb9958c6682a4e7dde633c90d01a73cbf59f5a | 5,163 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_ht_/i7-8650U_0xd2.log_3324_761.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_ht_/i7-8650U_0xd2.log_3324_761.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_ht_/i7-8650U_0xd2.log_3324_761.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 %r13
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x1e69f, %rbx
nop
nop
nop
nop
xor %rax, %rax
mov $0x6162636465666768, %rsi
movq %rsi, %xmm0
movups %xmm0, (%rbx)
nop
nop
sub $23815, %rsi
lea addresses_WT_ht+0x1a7e7, %rcx
nop
and %r13, %r13
and $0xffffffffffffffc0, %rcx
movntdqa (%rcx), %xmm6
vpextrq $0, %xmm6, %rax
nop
inc %rax
lea addresses_D_ht+0xc89f, %rsi
lea addresses_A_ht+0x1352f, %rdi
nop
sub %r10, %r10
mov $47, %rcx
rep movsl
cmp $21135, %rbx
lea addresses_D_ht+0x909f, %rax
nop
nop
nop
add %rbx, %rbx
movb $0x61, (%rax)
and %rbx, %rbx
lea addresses_D_ht+0x116e0, %rcx
nop
nop
nop
nop
xor %rdi, %rdi
mov $0x6162636465666768, %rbx
movq %rbx, (%rcx)
and %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r15
push %r8
push %rax
push %rdx
// Faulty Load
mov $0x5de6940000000a9f, %r8
nop
nop
nop
nop
xor $54098, %rdx
vmovntdqa (%r8), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %r11
lea oracles, %r15
and $0xff, %r11
shlq $12, %r11
mov (%r15,%r11,1), %r11
pop %rdx
pop %rax
pop %r8
pop %r15
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False, 'NT': True, 'congruent': 3, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'46': 3324}
46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46
*/
| 48.707547 | 2,999 | 0.660469 |
e6e98ae6ed5f759b4d34e5afde38cff3119239c1 | 1,191 | asm | Assembly | programs/oeis/008/A008671.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/008/A008671.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/008/A008671.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A008671: Expansion of 1/((1-x^2)*(1-x^3)*(1-x^7)).
; 1,0,1,1,1,1,2,2,2,3,3,3,4,4,5,5,6,6,7,7,8,9,9,10,11,11,12,13,14,14,16,16,17,18,19,20,21,22,23,24,25,26,28,28,30,31,32,33,35,36,37,39,40,41,43,44,46,47,49,50,52,53,55,57,58,60,62,63,65,67,69,70,73,74,76,78,80,82,84,86,88,90,92,94,97,98,101,103,105,107,110,112,114,117,119,121,124,126,129,131,134,136,139,141,144,147,149,152,155,157,160,163,166,168,172,174,177,180,183,186,189,192,195,198,201,204,208,210,214,217,220,223,227,230,233,237,240,243,247,250,254,257,261,264,268,271,275,279,282,286,290,293,297,301,305,308,313,316,320,324,328,332,336,340,344,348,352,356,361,364,369,373,377,381,386,390,394,399,403,407,412,416,421,425,430,434,439,443,448,453,457,462,467,471,476,481,486,490,496,500,505,510,515,520,525,530,535,540,545,550,556,560,566,571,576,581,587,592,597,603,608,613,619,624,630,635,641,646,652,657,663,669,674,680,686,691,697,703,709,714,721,726,732,738,744,750,756,762,768,774
mov $3,2
mov $5,$0
lpb $3,1
mov $0,$5
sub $3,1
add $0,$3
sub $0,1
cal $0,29001 ; Expansion of 1/((1-x)(1-x^2)(1-x^3)(1-x^7)).
mov $2,$3
mov $4,$0
lpb $2,1
mov $1,$4
sub $2,1
lpe
lpe
lpb $5,1
sub $1,$4
mov $5,0
lpe
| 51.782609 | 892 | 0.65911 |
4162d4d1e040349bd3c323042d654e32d2a3310b | 6,080 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca.log_21829_1078.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_0xca.log_21829_1078.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_0xca.log_21829_1078.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 %r15
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x1e0d6, %r15
clflush (%r15)
nop
cmp %r9, %r9
movb (%r15), %cl
nop
nop
nop
nop
and %r14, %r14
lea addresses_WC_ht+0x1a0f6, %rbx
nop
cmp %rbp, %rbp
movw $0x6162, (%rbx)
nop
nop
cmp $5199, %rcx
lea addresses_D_ht+0x6ffe, %rsi
lea addresses_UC_ht+0x1a6f6, %rdi
sub $61935, %rbp
mov $126, %rcx
rep movsl
nop
nop
sub %rbx, %rbx
lea addresses_A_ht+0x15936, %r9
sub $1022, %rdi
mov $0x6162636465666768, %rbp
movq %rbp, %xmm5
vmovups %ymm5, (%r9)
nop
nop
nop
nop
cmp $36333, %rdi
lea addresses_A_ht+0x1b5b6, %r15
nop
nop
nop
add $39945, %r14
movb $0x61, (%r15)
nop
nop
nop
nop
inc %rbp
lea addresses_UC_ht+0x9d76, %r9
nop
nop
nop
nop
nop
cmp %rcx, %rcx
mov (%r9), %ebx
nop
nop
nop
nop
add $55292, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r15
push %r9
push %rbp
push %rsi
// Store
mov $0xf05, %rbp
nop
and %r14, %r14
movw $0x5152, (%rbp)
nop
nop
nop
nop
xor $38749, %r10
// Store
mov $0xf6, %r10
nop
nop
nop
nop
nop
cmp $7497, %r9
movw $0x5152, (%r10)
nop
xor $46636, %r14
// Load
mov $0x480e0b00000000f6, %r10
nop
nop
nop
nop
and %r9, %r9
vmovups (%r10), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $0, %xmm7, %r13
nop
nop
nop
nop
sub $16155, %r14
// Faulty Load
lea addresses_RW+0x28f6, %r9
cmp %r14, %r14
mov (%r9), %bp
lea oracles, %rsi
and $0xff, %rbp
shlq $12, %rbp
mov (%rsi,%rbp,1), %rbp
pop %rsi
pop %rbp
pop %r9
pop %r15
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_P'}}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_P'}}
{'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 2, 'NT': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 11, 'AVXalign': False, 'same': False, 'size': 2, 'NT': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 32, 'NT': False, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 7, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_UC_ht'}, '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
*/
| 36.848485 | 2,999 | 0.652138 |
e55d0e3dc8fbd005eff88f650f480eed6410e79e | 2,126 | asm | Assembly | Modul 3/latih11fixed.asm | hyuwah/fu-praktikum-smd | a06fe109a42aa96e75f9a425a0905d6bfbfdfc7e | [
"MIT"
] | null | null | null | Modul 3/latih11fixed.asm | hyuwah/fu-praktikum-smd | a06fe109a42aa96e75f9a425a0905d6bfbfdfc7e | [
"MIT"
] | null | null | null | Modul 3/latih11fixed.asm | hyuwah/fu-praktikum-smd | a06fe109a42aa96e75f9a425a0905d6bfbfdfc7e | [
"MIT"
] | null | null | null | ;--------------------------------------------------------------------
; Praktikum SMD 2015
; M.Wahyudin (140310120031)
;
; Name : LATIH11.ASM Penyesuaian
; Desc : Membaca penekanan keypad 4x3 (7pin)
; Metode polling dan scanning kolom
; Input : Keypad di P3
; Output: LED di P1
; 4-display segmen di P2
;--------------------------------------------------------------------
;mov P0,#0h/#fh; pada mcu8051ide untuk menyalakan multi 7segmen ca/cc
mulai:
mov P3, #01111111b ; penetapan port 3 untuk keypad
polls: ;metode polling untuk mendeteksi tombol yang ditekan
;scanning kolom 1
clr p3.0
setb p3.1
setb p3.2
jnb p3.3, dapat ; tombol 1 (76h)
jnb p3.4, dapat ; tombol 4 (6eh)
jnb p3.5, dapat ; tombol 7 (5eh)
jnb p3.6, dapat ; tombol * (3eh)
setb p3.0
;scanning kolom 2
setb p3.0
clr p3.1
setb p3.2
jnb p3.3, dapat ; tombol 2 (75h)
jnb p3.4, dapat ; tombol 5 (6dh)
jnb p3.5, dapat ; tombol 8 (5dh)
jnb p3.6, dapat ; tombol 0 (3dh)
setb p3.1
;scanning kolom 3
setb p3.0
setb p3.1
clr p3.2
jnb p3.3, dapat ; tombol 3 (73h)
jnb p3.4, dapat ; tombol 6 (6bh)
jnb p3.5, dapat ; tombol 9 (5bh)
jnb p3.6, dapat ; tombol # (3bh)
setb p3.2
jmp polls ;terus loop sampai dapat tombol yang ditekan
dapat: mov A, P3 ; Menyalin kondisi P3 saat tombol terdeteksi
mov 30h, A ; Menyalin data dari P3 ke register 30h
mov P1, A ; Menyalin ke display led
lcall konversi
mov P2, A ; Menyalin A konversi ke display multi 7segmen
jmp mulai
konversi:
mov R0, #255 ; Set R0 awal agar dibawah mulai dari 0
putar:
inc R0
cjne R0, #12, lanjut ; Sebelum R0 = 12 loncat ke lanjut
ret
lanjut:
mov A, R0
add A, #5
movc A, @A+pc ; proses lookup table
cjne A, 30h, putar ; Sebelum A = nilai di 30h, ke putar
mov A, R0 ; R0 akan berisi 0 - 12, disalin ke A
ret ; kembali ke pemanggilan konversi
tabel: db 3Dh, 76h, 75h, 73h, 6Eh, 6Dh, 6Bh, 5Eh, 5Dh, 5Bh, 3Eh, 3Bh
;perubahan 63h menjadi 6Eh
end
| 29.527778 | 69 | 0.574318 |
8a27ded92012f43b7adb5b5e14050213d01c1eaa | 375 | asm | Assembly | programs/oeis/164/A164985.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/164/A164985.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/164/A164985.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A164985: Denominators of ternary BBP-type series for log(5)
; 1,6,27,405,1458,5103,59049,196830,649539,6908733,22320522,71744535,731794257,2324522934,7360989291,73222472421,230127770466,721764371007,7060738412025,22029503845518,68630377364883,663426981193869
add $0,1
mul $0,49
div $0,37
mov $1,3
pow $1,$0
mul $1,$0
div $1,3
mul $1,4
sub $1,4
div $1,4
add $1,1
mov $0,$1
| 23.4375 | 198 | 0.76 |
f9e095bc56a3eea5ad408cddafcfbf0a27518881 | 1,795 | asm | Assembly | src/test/ref/examples/c64/linking/linking.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/test/ref/examples/c64/linking/linking.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/test/ref/examples/c64/linking/linking.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | // Example showing how to perform linking using a linker-file
// The linker file is created using KickAssembler segments.
// See the KickAssembler manual for description of the format http://theweb.dk/KickAssembler/
// Specifying the linker script file is done using the #pragma link(<file>)
// It can also be specified using kickc command line option -T <file>
.file [name="linking.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data, CodeHigh, DataHigh"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$0810]
.segmentdef Data [startAfter="Code"]
.segmentdef CodeHigh [start=$4000]
.segmentdef DataHigh [startAfter="CodeHigh"]
.segment Basic
:BasicUpstart(main)
.segment Code
.label BG_COLOR = $d021
.label SCREEN = $400
.segment Code
main: {
ldx #0
__b1:
// base[i] = i
txa
sta base,x
// for(char i:0..255)
inx
cpx #0
bne __b1
__b2:
// fillscreen(*BG_COLOR)
lda BG_COLOR
sta.z fillscreen.c
jsr fillscreen
// (*BG_COLOR)++;
inc BG_COLOR
jmp __b2
}
.segment CodeHigh
// void fillscreen(__zp(4) char c)
fillscreen: {
.label c = 4
.label screen = 2
ldx #0
lda #<SCREEN
sta.z screen
lda #>SCREEN
sta.z screen+1
__b1:
// for( char *screen = SCREEN; screen<SCREEN+1000; screen++)
lda.z screen+1
cmp #>SCREEN+$3e8
bcc __b2
bne !+
lda.z screen
cmp #<SCREEN+$3e8
bcc __b2
!:
// }
rts
__b2:
// c+base[i++]
lda base,x
clc
adc.z c
// *screen = c+base[i++]
ldy #0
sta (screen),y
// *screen = c+base[i++];
inx
// for( char *screen = SCREEN; screen<SCREEN+1000; screen++)
inc.z screen
bne !+
inc.z screen+1
!:
jmp __b1
}
.segment DataHigh
base: .fill $100, 0
| 22.160494 | 93 | 0.625627 |
6c4ac9525cd041d28527cf61dd72e1d76d4a1ec2 | 210 | asm | Assembly | src/zx-spec.asm | rhargreaves/zx-spec | 5df6c8428339e0f1a35a2f8d00dc65995102f2cf | [
"MIT"
] | 34 | 2017-10-25T04:29:37.000Z | 2021-08-29T15:33:27.000Z | src/zx-spec.asm | rhargreaves/zx-spec | 5df6c8428339e0f1a35a2f8d00dc65995102f2cf | [
"MIT"
] | 2 | 2017-10-20T22:49:29.000Z | 2017-11-28T12:42:22.000Z | src/zx-spec.asm | rhargreaves/zx-spec | 5df6c8428339e0f1a35a2f8d00dc65995102f2cf | [
"MIT"
] | 1 | 2019-09-20T17:55:35.000Z | 2019-09-20T17:55:35.000Z | jp _zxspec_init
include includes/config.asm
include includes/structure.asm
include includes/screen.asm
include includes/asserts.asm
include includes/state.asm
include includes/strings.asm
_zxspec_init equ $ | 26.25 | 30 | 0.842857 |
c458f57129372b238d36cf7a1c947dff4af5199d | 1,404 | asm | Assembly | Assembly/OS/INPUT.asm | p-rivero/CESC16 | f07305e49bf46a6218bfea806a43950cad0be0b9 | [
"MIT"
] | 2 | 2022-03-03T02:30:14.000Z | 2022-03-04T15:55:19.000Z | Assembly/OS/INPUT.asm | p-rivero/CESC16 | f07305e49bf46a6218bfea806a43950cad0be0b9 | [
"MIT"
] | null | null | null | Assembly/OS/INPUT.asm | p-rivero/CESC16 | f07305e49bf46a6218bfea806a43950cad0be0b9 | [
"MIT"
] | null | null | null | ; ========================
; Keyboard Input library
; ========================
#bank program
INPUT:
; Constants:
.ACK = 0x06
.RDY = 0x07
.BACKSPACE = 0x08
.TAB = 0x09
.ENTER = 0x0A
.PAGEUP = 0x0B
.PAGEDOWN = 0x0C
.HOME = 0x0D
.INSERT = 0x0E
; F1-F12 mapped to 0x0F-0x1A
.ESC = 0x1B
.LEFT = 0x1C
.RIGHT = 0x1D
.DOWN = 0x1E
.UP = 0x1F
.DEL = 0x7F
; Attach an interrupt handler (jump address) to a keypress
; WARNING: Those syscalls make use of the stack, and so they should be called in the correct order
; as if they were push/pop instructions.
.AttachInterrupt:
swap a0, [HANDLERS.KEYPRESS] ; Attach new interrupt and retrieve old one
swap a0, [sp] ; Simultaneously pop return address and push old interrupt handler
jmp a0 ; Jump to return address
.DetachInterrupt:
pop a0 ; Pop return address
pop a1 ; Pop old interrupt handler
mov [HANDLERS.KEYPRESS], a1 ; Attach old interrupt handler
jmp a0 ; Jump to return address
; INTERRUPT HANDLER: it gets called when a key is pressed
.Key_Handler:
cmp a0, INPUT.ESC
je ..keyboard_int ; Keyboard interrupt
movf t0, [HANDLERS.KEYPRESS] ; Load the address of the user interrupt handler
jnz t0 ; If it's not zero, jump to the user handler
ret ; If it's zero, don't do anything
..keyboard_int:
mov [TMR_ACTIVE], zero ; Disable timer
jmp STARTUP.Reset ; Reset computer (placeholder)
| 25.527273 | 98 | 0.673077 |
84ecc7756bf989ec1df24ffbc75fb25e59306480 | 4,981 | asm | Assembly | vp8/encoder/ppc/sad_altivec.asm | mrchapp/libvpx | c2a8d8b54c7ebefd1cd9c55f53b9e8378f088e8b | [
"BSD-3-Clause"
] | 1 | 2015-05-03T19:25:39.000Z | 2015-05-03T19:25:39.000Z | vp8/encoder/ppc/sad_altivec.asm | mrchapp/libvpx | c2a8d8b54c7ebefd1cd9c55f53b9e8378f088e8b | [
"BSD-3-Clause"
] | null | null | null | vp8/encoder/ppc/sad_altivec.asm | mrchapp/libvpx | c2a8d8b54c7ebefd1cd9c55f53b9e8378f088e8b | [
"BSD-3-Clause"
] | null | null | null | ;
; Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
;
; Use of this source code is governed by a BSD-style license
; that can be found in the LICENSE file in the root of the source
; tree. An additional intellectual property rights grant can be found
; in the file PATENTS. All contributing project authors may
; be found in the AUTHORS file in the root of the source tree.
;
.globl vp8_sad16x16_ppc
.globl vp8_sad16x8_ppc
.globl vp8_sad8x16_ppc
.globl vp8_sad8x8_ppc
.globl vp8_sad4x4_ppc
.macro load_aligned_16 V R O
lvsl v3, 0, \R ;# permutate value for alignment
lvx v1, 0, \R
lvx v2, \O, \R
vperm \V, v1, v2, v3
.endm
.macro prologue
mfspr r11, 256 ;# get old VRSAVE
oris r12, r11, 0xffc0
mtspr 256, r12 ;# set VRSAVE
stwu r1, -32(r1) ;# create space on the stack
li r10, 16 ;# load offset and loop counter
vspltisw v8, 0 ;# zero out total to start
.endm
.macro epilogue
addi r1, r1, 32 ;# recover stack
mtspr 256, r11 ;# reset old VRSAVE
.endm
.macro SAD_16
;# v6 = abs (v4 - v5)
vsububs v6, v4, v5
vsububs v7, v5, v4
vor v6, v6, v7
;# v8 += abs (v4 - v5)
vsum4ubs v8, v6, v8
.endm
.macro sad_16_loop loop_label
lvsl v3, 0, r5 ;# only needs to be done once per block
;# preload a line of data before getting into the loop
lvx v4, 0, r3
lvx v1, 0, r5
lvx v2, r10, r5
add r5, r5, r6
add r3, r3, r4
vperm v5, v1, v2, v3
.align 4
\loop_label:
;# compute difference on first row
vsububs v6, v4, v5
vsububs v7, v5, v4
;# load up next set of data
lvx v9, 0, r3
lvx v1, 0, r5
lvx v2, r10, r5
;# perform abs() of difference
vor v6, v6, v7
add r3, r3, r4
;# add to the running tally
vsum4ubs v8, v6, v8
;# now onto the next line
vperm v5, v1, v2, v3
add r5, r5, r6
lvx v4, 0, r3
;# compute difference on second row
vsububs v6, v9, v5
lvx v1, 0, r5
vsububs v7, v5, v9
lvx v2, r10, r5
vor v6, v6, v7
add r3, r3, r4
vsum4ubs v8, v6, v8
vperm v5, v1, v2, v3
add r5, r5, r6
bdnz \loop_label
vspltisw v7, 0
vsumsws v8, v8, v7
stvx v8, 0, r1
lwz r3, 12(r1)
.endm
.macro sad_8_loop loop_label
.align 4
\loop_label:
;# only one of the inputs should need to be aligned.
load_aligned_16 v4, r3, r10
load_aligned_16 v5, r5, r10
;# move onto the next line
add r3, r3, r4
add r5, r5, r6
;# only one of the inputs should need to be aligned.
load_aligned_16 v6, r3, r10
load_aligned_16 v7, r5, r10
;# move onto the next line
add r3, r3, r4
add r5, r5, r6
vmrghb v4, v4, v6
vmrghb v5, v5, v7
SAD_16
bdnz \loop_label
vspltisw v7, 0
vsumsws v8, v8, v7
stvx v8, 0, r1
lwz r3, 12(r1)
.endm
.align 2
;# r3 unsigned char *src_ptr
;# r4 int src_stride
;# r5 unsigned char *ref_ptr
;# r6 int ref_stride
;#
;# r3 return value
vp8_sad16x16_ppc:
prologue
li r9, 8
mtctr r9
sad_16_loop sad16x16_loop
epilogue
blr
.align 2
;# r3 unsigned char *src_ptr
;# r4 int src_stride
;# r5 unsigned char *ref_ptr
;# r6 int ref_stride
;#
;# r3 return value
vp8_sad16x8_ppc:
prologue
li r9, 4
mtctr r9
sad_16_loop sad16x8_loop
epilogue
blr
.align 2
;# r3 unsigned char *src_ptr
;# r4 int src_stride
;# r5 unsigned char *ref_ptr
;# r6 int ref_stride
;#
;# r3 return value
vp8_sad8x16_ppc:
prologue
li r9, 8
mtctr r9
sad_8_loop sad8x16_loop
epilogue
blr
.align 2
;# r3 unsigned char *src_ptr
;# r4 int src_stride
;# r5 unsigned char *ref_ptr
;# r6 int ref_stride
;#
;# r3 return value
vp8_sad8x8_ppc:
prologue
li r9, 4
mtctr r9
sad_8_loop sad8x8_loop
epilogue
blr
.macro transfer_4x4 I P
lwz r0, 0(\I)
add \I, \I, \P
lwz r7, 0(\I)
add \I, \I, \P
lwz r8, 0(\I)
add \I, \I, \P
lwz r9, 0(\I)
stw r0, 0(r1)
stw r7, 4(r1)
stw r8, 8(r1)
stw r9, 12(r1)
.endm
.align 2
;# r3 unsigned char *src_ptr
;# r4 int src_stride
;# r5 unsigned char *ref_ptr
;# r6 int ref_stride
;#
;# r3 return value
vp8_sad4x4_ppc:
prologue
transfer_4x4 r3, r4
lvx v4, 0, r1
transfer_4x4 r5, r6
lvx v5, 0, r1
vspltisw v8, 0 ;# zero out total to start
;# v6 = abs (v4 - v5)
vsububs v6, v4, v5
vsububs v7, v5, v4
vor v6, v6, v7
;# v8 += abs (v4 - v5)
vsum4ubs v7, v6, v8
vsumsws v7, v7, v8
stvx v7, 0, r1
lwz r3, 12(r1)
epilogue
blr
| 17.917266 | 71 | 0.561333 |
bb8be697f0320fb5b18a258c3d76984572ad20d2 | 1,013 | asm | Assembly | unittests/ASM/OpSize/66_D0.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 628 | 2020-03-06T14:01:32.000Z | 2022-03-31T06:35:14.000Z | unittests/ASM/OpSize/66_D0.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 576 | 2020-03-06T08:25:12.000Z | 2022-03-30T04:05:29.000Z | unittests/ASM/OpSize/66_D0.asm | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 38 | 2020-03-07T06:10:00.000Z | 2022-03-29T09:27:36.000Z | %ifdef CONFIG
{
"RegData": {
"XMM0": ["0xbff0000000000000", "0x4008000000000000"],
"XMM1": ["0xbff0000000000000", "0x4008000000000000"],
"XMM2": ["0x3ff0000000000000", "0x4008000000000000"],
"XMM3": ["0x3ff0000000000000", "0x4008000000000000"]
},
"MemoryRegions": {
"0x100000000": "4096"
}
}
%endif
mov rdx, 0xe0000000
mov rax, 0x3FF0000000000000
mov [rdx + 8 * 0], rax
mov rax, 0x3FF0000000000000
mov [rdx + 8 * 1], rax
mov rax, 0x4000000000000000
mov [rdx + 8 * 2], rax
mov rax, 0x4000000000000000
mov [rdx + 8 * 3], rax
mov rax, 0x4000000000000000
mov [rdx + 8 * 4], rax
mov rax, 0x4000000000000000
mov [rdx + 8 * 5], rax
mov rax, 0x3FF0000000000000
mov [rdx + 8 * 6], rax
mov rax, 0x3FF0000000000000
mov [rdx + 8 * 7], rax
movapd xmm0, [rdx]
addsubpd xmm0, [rdx + 8 * 2]
movapd xmm1, [rdx]
movapd xmm2, [rdx + 8 * 2]
addsubpd xmm1, xmm2
movapd xmm2, [rdx + 8 * 4]
addsubpd xmm2, [rdx + 8 * 6]
movapd xmm3, [rdx + 8 * 4]
movapd xmm4, [rdx + 8 * 6]
addsubpd xmm3, xmm4
hlt
| 19.480769 | 57 | 0.653504 |
ffb3f99a7ab19bc999667c3764e26d0aef92865b | 8,573 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_10.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_0xca_notsx.log_21829_10.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_0xca_notsx.log_21829_10.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 %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0xf8b, %rdi
nop
nop
nop
nop
nop
sub $53282, %r10
mov (%rdi), %r11d
nop
add %rax, %rax
lea addresses_UC_ht+0x3173, %rcx
nop
sub %rdx, %rdx
movb $0x61, (%rcx)
add %r10, %r10
lea addresses_WT_ht+0x5973, %rdi
nop
nop
and $54400, %r11
movw $0x6162, (%rdi)
nop
nop
nop
nop
nop
add $8638, %rdi
lea addresses_A_ht+0x53, %r10
clflush (%r10)
nop
nop
nop
nop
add %r9, %r9
vmovups (%r10), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %rdi
and %r9, %r9
lea addresses_normal_ht+0x173, %rdx
nop
nop
nop
nop
cmp %r10, %r10
movb (%rdx), %r9b
add %rcx, %rcx
lea addresses_normal_ht+0x7833, %rcx
clflush (%rcx)
nop
nop
nop
add $24528, %r10
movups (%rcx), %xmm2
vpextrq $0, %xmm2, %r11
nop
nop
nop
nop
nop
cmp %rax, %rax
lea addresses_WC_ht+0xbaf3, %rax
nop
nop
nop
nop
nop
add %rdi, %rdi
movl $0x61626364, (%rax)
nop
sub $18494, %rdi
lea addresses_UC_ht+0x6af3, %rsi
lea addresses_UC_ht+0x1acfb, %rdi
and %rax, %rax
mov $77, %rcx
rep movsl
nop
nop
nop
nop
mfence
lea addresses_normal_ht+0x9973, %r9
nop
nop
nop
nop
nop
sub $64367, %rsi
mov $0x6162636465666768, %rdi
movq %rdi, %xmm5
vmovups %ymm5, (%r9)
nop
nop
nop
nop
and $23038, %rax
lea addresses_normal_ht+0xb173, %rsi
lea addresses_normal_ht+0x1ed73, %rdi
nop
nop
nop
nop
add $31260, %r9
mov $125, %rcx
rep movsl
nop
dec %r9
lea addresses_A_ht+0x1a413, %r11
nop
nop
nop
and $20396, %r10
mov (%r11), %edx
nop
cmp %rdx, %rdx
lea addresses_UC_ht+0x14c1b, %r9
nop
nop
nop
nop
nop
inc %r10
movw $0x6162, (%r9)
nop
nop
nop
nop
cmp %rdx, %rdx
lea addresses_D_ht+0x47b3, %rax
clflush (%rax)
nop
nop
nop
nop
nop
add %rdx, %rdx
mov $0x6162636465666768, %rcx
movq %rcx, %xmm2
vmovups %ymm2, (%rax)
nop
nop
nop
nop
add $23013, %rdx
lea addresses_UC_ht+0x9c0d, %rsi
lea addresses_WC_ht+0xa973, %rdi
nop
inc %r9
mov $19, %rcx
rep movsq
nop
nop
nop
nop
sub %r10, %r10
lea addresses_WT_ht+0x17573, %rdx
nop
and $35737, %rax
mov (%rdx), %cx
nop
nop
nop
nop
sub %r11, %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r9
push %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_PSE+0x188a3, %rsi
lea addresses_D+0x1a573, %rdi
clflush (%rsi)
nop
nop
nop
inc %r9
mov $105, %rcx
rep movsb
nop
sub %r9, %r9
// Store
lea addresses_WC+0x287b, %rdx
nop
nop
xor %rcx, %rcx
movl $0x51525354, (%rdx)
nop
nop
nop
nop
nop
and $21600, %rsi
// Store
lea addresses_WT+0x4e19, %rsi
nop
nop
nop
nop
nop
inc %rbp
mov $0x5152535455565758, %rdi
movq %rdi, (%rsi)
nop
nop
nop
and %rbp, %rbp
// Faulty Load
lea addresses_D+0xa173, %r9
clflush (%r9)
nop
nop
nop
sub %rcx, %rcx
mov (%r9), %rbp
lea oracles, %rbx
and $0xff, %rbp
shlq $12, %rbp
mov (%rbx,%rbp,1), %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r9
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_PSE'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_D'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 3, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 30.293286 | 2,999 | 0.65508 |
0ed682e039457af3ef9cdc7df87d17c749c02273 | 6,264 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_921.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.log_21829_921.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.log_21829_921.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 %r15
push %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x71f7, %r14
nop
nop
nop
nop
nop
and $57786, %rdi
mov (%r14), %rax
add %r8, %r8
lea addresses_WT_ht+0x1896b, %rsi
lea addresses_normal_ht+0x1bf14, %rdi
nop
nop
nop
nop
xor %rbx, %rbx
mov $117, %rcx
rep movsw
nop
dec %rax
lea addresses_D_ht+0x1d4bb, %rsi
lea addresses_A_ht+0x12a83, %rdi
nop
nop
nop
nop
mfence
mov $59, %rcx
rep movsb
nop
nop
nop
xor %r15, %r15
lea addresses_WT_ht+0x1912b, %rcx
nop
nop
nop
add $43314, %rax
mov $0x6162636465666768, %r15
movq %r15, %xmm0
movups %xmm0, (%rcx)
nop
nop
nop
nop
add $57748, %rdi
lea addresses_WT_ht+0x996b, %r8
nop
nop
nop
nop
nop
and %rbx, %rbx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm2
vmovups %ymm2, (%r8)
nop
nop
add %r14, %r14
lea addresses_UC_ht+0xa6a5, %rsi
and %r15, %r15
movw $0x6162, (%rsi)
nop
add $28282, %rbx
lea addresses_D_ht+0x1c96b, %rax
add $65299, %r15
mov $0x6162636465666768, %rbx
movq %rbx, %xmm3
vmovups %ymm3, (%rax)
nop
nop
xor %r8, %r8
lea addresses_WC_ht+0x13461, %rsi
lea addresses_UC_ht+0xb56b, %rdi
nop
nop
nop
nop
xor %rax, %rax
mov $93, %rcx
rep movsb
nop
dec %rax
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r14
push %r15
push %r9
push %rcx
push %rsi
// Store
lea addresses_RW+0xa02b, %r15
nop
nop
nop
nop
nop
xor %r14, %r14
mov $0x5152535455565758, %r13
movq %r13, (%r15)
sub $25343, %r15
// Faulty Load
lea addresses_D+0x1856b, %r14
xor %rcx, %rcx
mov (%r14), %si
lea oracles, %rcx
and $0xff, %rsi
shlq $12, %rsi
mov (%rcx,%rsi,1), %rsi
pop %rsi
pop %rcx
pop %r9
pop %r15
pop %r14
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 5, 'size': 8, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 2, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 9, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 38.666667 | 2,999 | 0.660441 |
f9a039a88ba347390804a29e1a6addfeaf3305c5 | 34 | asm | Assembly | Assembly Microbenchmarks/sltuTest.asm | idn0971/HLS_Benchmarking | 1dccf2c83d8e7bb4f2a50bc2b7e464bb7c270f65 | [
"MIT"
] | null | null | null | Assembly Microbenchmarks/sltuTest.asm | idn0971/HLS_Benchmarking | 1dccf2c83d8e7bb4f2a50bc2b7e464bb7c270f65 | [
"MIT"
] | null | null | null | Assembly Microbenchmarks/sltuTest.asm | idn0971/HLS_Benchmarking | 1dccf2c83d8e7bb4f2a50bc2b7e464bb7c270f65 | [
"MIT"
] | null | null | null | li t0, 3
li t1, -1
sltu s6, t0 ,t1 | 11.333333 | 15 | 0.588235 |
cebc2776d4c58e8c272bf9aa0d489d5a35e8f4cd | 179 | asm | Assembly | libsrc/_DEVELOPMENT/stdio/c/sccz80/ferror_unlocked.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/c/sccz80/ferror_unlocked.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/c/sccz80/ferror_unlocked.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; int ferror_unlocked(FILE *stream)
SECTION code_stdio
PUBLIC ferror_unlocked
EXTERN asm_ferror_unlocked
ferror_unlocked:
push hl
pop ix
jp asm_ferror_unlocked
| 11.1875 | 35 | 0.77095 |
bf18f9f49e5f4b7470552baf45bae7e81605acc3 | 3,974 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_743.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_0x48.log_21829_743.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_0x48.log_21829_743.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:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r15
push %r8
push %rcx
push %rdi
// Store
lea addresses_UC+0x1e6f4, %r12
clflush (%r12)
nop
nop
nop
nop
and $53816, %rcx
movw $0x5152, (%r12)
nop
nop
nop
nop
cmp $43040, %r10
// Faulty Load
lea addresses_WT+0x154b0, %r13
nop
nop
add $7746, %rdi
mov (%r13), %r10d
lea oracles, %r8
and $0xff, %r10
shlq $12, %r10
mov (%r8,%r10,1), %r10
pop %rdi
pop %rcx
pop %r8
pop %r15
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': True}}
<gen_prepare_buffer>
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 66.233333 | 2,999 | 0.66155 |
0e6049347126260d1134880d854e5d0fc9f9bed6 | 719 | asm | Assembly | oeis/291/A291005.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/291/A291005.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/291/A291005.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A291005: p-INVERT of (1,1,1,1,1,...), where p(S) = 1 - 2 S - 2 S^3.
; Submitted by Christian Krause
; 2,6,20,68,230,774,2600,8732,29330,98526,330980,1111868,3735110,12547374,42150440,141596132,475664450,1597901526,5367837140,18032197268,60575633990,203491974774,683591422280,2296391457932,7714277207570,25914602943726,87055031555300,292444323208268,982409409872870,3300211944682974,11086415470346120,37242640788314132,125109355372562690,420280368696345126,1411849559815357460,4742831995065184868,15932614900100147750,53522498334121231974,179798347345231049960,603997322887807364732
add $0,1
mov $3,1
lpb $0
sub $0,1
add $1,$2
sub $4,$2
add $2,$3
add $2,$3
mov $3,$2
add $4,$1
add $3,$4
lpe
mov $0,$3
| 39.944444 | 481 | 0.781641 |
19be969905710198153df189097c5c8037c10a08 | 142 | asm | Assembly | libsrc/_DEVELOPMENT/compress/zx1/z80/asm_dzx1_mega_back.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/compress/zx1/z80/asm_dzx1_mega_back.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/compress/zx1/z80/asm_dzx1_mega_back.asm | C-Chads/z88dk | a4141a8e51205c6414b4ae3263b633c4265778e6 | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
IF !__CPU_INTEL__ && !__CPU_GBZ80__
SECTION smc_compress
PUBLIC asm_dzx1_mega_back
asm_dzx1_mega_back:
INCLUDE "dzx1_mega_back.asm"
ENDIF
| 12.909091 | 35 | 0.830986 |
2277533110c9868078bc553a560e71f87c9e3922 | 710 | asm | Assembly | oeis/042/A042762.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/042/A042762.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/042/A042762.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A042762: Numerators of continued fraction convergents to sqrt(912).
; Submitted by Jon Maiga
; 30,151,9090,45601,2745150,13771351,829026210,4158902401,250363170270,1255974753751,75608848395330,379300216730401,22833621852219390,114547409477827351,6895678190521860450,34592938362087129601,2082471979915749636510,10446952837940835312151,628899642256365868365570,3154945164119770177140001,189925609489442576496765630,952782992611332652660968151,57356905166169401736154854690,287737308823458341333435241601,17321595434573669881742269350750,86895714481691807750044781995351
add $0,1
mov $3,1
lpb $0
sub $0,1
add $2,$3
mov $3,$1
mov $1,$2
dif $2,12
mul $2,60
lpe
add $2,$3
add $3,$2
mov $0,$3
div $0,2
| 37.368421 | 474 | 0.832394 |
97347a34b7acd09332c0fb9eaa04da7fa9f2496c | 19,440 | asm | Assembly | src/sound/hartmanns_youkai_girl/channel1.asm | Gegel85/KESP | a317e0f00193c10cd4850c224d9731ca6950dca3 | [
"MIT"
] | null | null | null | src/sound/hartmanns_youkai_girl/channel1.asm | Gegel85/KESP | a317e0f00193c10cd4850c224d9731ca6950dca3 | [
"MIT"
] | null | null | null | src/sound/hartmanns_youkai_girl/channel1.asm | Gegel85/KESP | a317e0f00193c10cd4850c224d9731ca6950dca3 | [
"MIT"
] | null | null | null | musicChan1KoishiTheme::
setRegisters $00, $46, $F3, $00, $00
.loop::
repeat 2
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_D * 2, $80
wait DOTTED_QUAVER
setFrequency NOTE_C * 2, $80
wait DOTTED_QUAVER
setFrequency NOTE_D * 2, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_Bb, $80
wait QUAVER
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_Eb, $80
wait QUAVER
setFrequency NOTE_Bb, $80
wait QUAVER
continue
; change volume
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_C, $80
wait QUAVER
setFrequency NOTE_B, $80
wait DOTTED_QUAVER
setFrequency NOTE_A, $80
wait DOTTED_QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_C, $80
wait QUAVER
setFrequency NOTE_F_SHARP, $80
wait QUAVER
setFrequency NOTE_D_SHARP, $80
wait QUAVER
setFrequency NOTE_A_SHARP / 2, $80
wait QUAVER
setFrequency NOTE_F_SHARP, $80
wait QUAVER
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_C, $80
wait QUAVER
setFrequency NOTE_B, $80
wait DOTTED_QUAVER
setFrequency NOTE_A, $80
wait DOTTED_QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_C, $80
wait QUAVER
; change volume
setFrequency NOTE_F_SHARP, $80
wait QUAVER
setFrequency NOTE_D_SHARP, $80
wait QUAVER
setFrequency NOTE_Bb / 2, $80
wait QUAVER
setFrequency NOTE_D_SHARP, $80
wait QUAVER
repeat 2
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_D * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_D_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_F_SHARP * 2, $80
wait QUAVER
continue
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_D_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_F_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_A_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_D_SHARP * 4, $80
wait QUAVER
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_D_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_F_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_A_SHARP * 2, $80
wait SEMIQUAVER
setFrequency NOTE_F_SHARP * 2, $80
wait SEMIQUAVER
setFrequency NOTE_D_SHARP * 2, $80
wait QUAVER
repeat 2
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait CROTCHET
setFrequency NOTE_F, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait CROTCHET
continue
repeat 2
setFrequency NOTE_F_SHARP, $80
wait QUAVER
setFrequency NOTE_C_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_F_SHARP * 2, $80
wait CROTCHET
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_C_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait CROTCHET
continue
repeat 2
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait CROTCHET
setFrequency NOTE_F, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait CROTCHET
continue
setFrequency NOTE_F_SHARP, $80
wait QUAVER
setFrequency NOTE_C_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_F_SHARP * 2, $80
wait CROTCHET
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_C_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait CROTCHET
setFrequency NOTE_G_SHARP, $80
wait QUAVER
setFrequency NOTE_D_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_G_SHARP * 2, $80
wait CROTCHET
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_D * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait CROTCHET
setFrequency NOTE_A_SHARP * 2, $80
wait MINIM + DOTTED_CROTCHET * 2
setFrequency NOTE_A * 2, $80
wait MINIM
setFrequency NOTE_A_SHARP * 2, $80
wait MINIM + DOTTED_CROTCHET * 2
setFrequency NOTE_A * 2, $80
wait MINIM
setFrequency NOTE_F_SHARP * 2, $80
wait MINIM + DOTTED_CROTCHET * 2
setFrequency NOTE_E * 2, $80
wait MINIM
setFrequency NOTE_F_SHARP * 2, $80
wait MINIM + DOTTED_CROTCHET * 2
setFrequency NOTE_E * 2, $80
wait MINIM
repeat 2
setFrequency NOTE_Eb, $80
wait QUAVER
setFrequency NOTE_Bb, $80
wait QUAVER
setFrequency NOTE_Ab, $80
wait QUAVER
setFrequency NOTE_Ab, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait QUAVER
setFrequency NOTE_Ab, $80
wait QUAVER
setFrequency NOTE_Gb, $80
wait QUAVER
setFrequency NOTE_Bb, $80
wait QUAVER
setFrequency NOTE_Ab, $80
wait QUAVER
setFrequency NOTE_Gb, $80
wait QUAVER
setFrequency NOTE_Bb, $80
wait QUAVER
setFrequency NOTE_D * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
continue
setFrequency NOTE_Eb, $80
wait QUAVER
setFrequency NOTE_Bb, $80
wait QUAVER
setFrequency NOTE_Ab, $80
wait QUAVER
setFrequency NOTE_Ab, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait QUAVER
setFrequency NOTE_Ab * 2, $80
wait QUAVER
setFrequency NOTE_Eb * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_D * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_D * 4, $80
wait QUAVER
setFrequency NOTE_Eb, $80
wait QUAVER
setFrequency NOTE_Bb, $80
wait QUAVER
setFrequency NOTE_Ab, $80
wait QUAVER
setFrequency NOTE_Ab, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait QUAVER
setFrequency NOTE_Ab * 2, $80
wait QUAVER
setFrequency NOTE_Eb * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_D * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait SEMIQUAVER
setFrequency NOTE_F * 2, $80
wait SEMIQUAVER
setFrequency NOTE_D * 2, $80
wait QUAVER
repeat 2
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_Gb * 2, $80
wait QUAVER
setFrequency NOTE_Eb * 2, $80
wait QUAVER
setFrequency NOTE_Db * 4, $80
wait DOTTED_QUAVER
setFrequency NOTE_B * 2, $80
wait DOTTED_QUAVER
setFrequency NOTE_Db * 4, $80
wait QUAVER
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_Gb * 2, $80
wait QUAVER
setFrequency NOTE_Eb * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_Gb * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
continue
repeat 2
setFrequency NOTE_Gb * 2, $80
wait QUAVER
setFrequency NOTE_Eb * 2, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_Bb * 2, $80
wait DOTTED_QUAVER
setFrequency NOTE_Ab * 2, $80
wait DOTTED_QUAVER
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_Eb * 2, $80
wait QUAVER
setFrequency NOTE_Gb * 2, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_Eb * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_D * 4, $80
wait QUAVER
continue
repeat 2
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait CROTCHET
setFrequency NOTE_F, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait CROTCHET
continue
repeat 2
setFrequency NOTE_F_SHARP, $80
wait QUAVER
setFrequency NOTE_C_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_F_SHARP * 2, $80
wait CROTCHET
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_C_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait CROTCHET
continue
repeat 2
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait CROTCHET
setFrequency NOTE_F, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait CROTCHET
continue
setFrequency NOTE_F_SHARP, $80
wait QUAVER
setFrequency NOTE_C_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_F_SHARP * 2, $80
wait CROTCHET
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_C_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait CROTCHET
setFrequency NOTE_G_SHARP, $80
wait QUAVER
setFrequency NOTE_D_SHARP * 2, $80
wait QUAVER
setFrequency NOTE_G_SHARP * 2, $80
wait CROTCHET
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_D * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait CROTCHET
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_A, $80
wait SEMIQUAVER
setFrequency NOTE_B, $80
wait SEMIQUAVER
setFrequency NOTE_C * 2, $80
wait CROTCHET
setFrequency NOTE_C * 4, $80
wait CROTCHET
setFrequency NOTE_B * 2, $80
wait CROTCHET
setFrequency NOTE_G * 2, $80
wait CROTCHET
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_E * 4, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait CROTCHET
setFrequency NOTE_G * 2, $80
wait CROTCHET
setFrequency NOTE_A * 2, $80
wait DOTTED_CROTCHET
setFrequency NOTE_E * 2, $80
wait SEMIQUAVER
setFrequency NOTE_G * 2, $80
wait SEMIQUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_D * 4, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait CROTCHET
setFrequency NOTE_B, $80
wait CROTCHET
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_E, $80
wait QUAVER
setFrequency NOTE_G, $80
wait QUAVER
setFrequency NOTE_A, $80
wait CROTCHET
setFrequency NOTE_B, $80
wait CROTCHET
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_A, $80
wait SEMIQUAVER
setFrequency NOTE_B, $80
wait SEMIQUAVER
setFrequency NOTE_C * 2, $80
wait CROTCHET
setFrequency NOTE_C * 4, $80
wait CROTCHET
setFrequency NOTE_B * 2, $80
wait CROTCHET
setFrequency NOTE_G * 2, $80
wait CROTCHET
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_E * 4, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait CROTCHET
setFrequency NOTE_G * 2, $80
wait CROTCHET
setFrequency NOTE_A * 2, $80
wait DOTTED_CROTCHET
setFrequency NOTE_E * 2, $80
wait SEMIQUAVER
setFrequency NOTE_G * 2, $80
wait SEMIQUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_D * 4, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait CROTCHET
setFrequency NOTE_B, $80
wait CROTCHET
setFrequency NOTE_A, $80
wait QUAVER
setFrequency NOTE_B, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait QUAVER
setFrequency NOTE_B * 2, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait QUAVER
setFrequency NOTE_E * 2, $80
wait QUAVER
setFrequency NOTE_G * 2, $80
wait QUAVER
setFrequency NOTE_A * 2, $80
wait CROTCHET
setFrequency NOTE_A * 2, $80
wait SEMIQUAVER
setFrequency NOTE_E * 2, $80
wait SEMIQUAVER
setFrequency NOTE_C * 2, $80
wait SEMIQUAVER
setFrequency NOTE_A, $80
wait SEMIQUAVER
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_Ab * 2, $80
wait QUAVER
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait QUAVER
setFrequency NOTE_Bb, $80
wait SEMIQUAVER
setFrequency NOTE_C * 2, $80
wait SEMIQUAVER
setFrequency NOTE_Db * 2, $80
wait CROTCHET
setFrequency NOTE_Db * 4, $80
wait CROTCHET
setFrequency NOTE_C * 4, $80
wait CROTCHET
setFrequency NOTE_Ab * 2, $80
wait CROTCHET
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Db * 4, $80
wait QUAVER
setFrequency NOTE_F * 4, $80
wait QUAVER
setFrequency NOTE_Db * 4, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Ab * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait CROTCHET
setFrequency NOTE_Ab * 2, $80
wait CROTCHET
setFrequency NOTE_Bb * 2, $80
wait DOTTED_CROTCHET
setFrequency NOTE_F * 2, $80
wait SEMIQUAVER
setFrequency NOTE_Ab * 2, $80
wait SEMIQUAVER
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_Ab * 2, $80
wait QUAVER
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Db * 4, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Eb * 4, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Db * 4, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_Ab * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait CROTCHET
setFrequency NOTE_C * 2, $80
wait CROTCHET
setFrequency NOTE_Bb, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_Bb, $80
wait QUAVER
setFrequency NOTE_Ab, $80
wait QUAVER
setFrequency NOTE_F, $80
wait QUAVER
setFrequency NOTE_Ab, $80
wait QUAVER
setFrequency NOTE_Bb, $80
wait CROTCHET
setFrequency NOTE_C * 2, $80
wait CROTCHET
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_Ab * 2, $80
wait QUAVER
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait QUAVER
setFrequency NOTE_Bb, $80
wait SEMIQUAVER
setFrequency NOTE_C * 2, $80
wait SEMIQUAVER
setFrequency NOTE_Db * 2, $80
wait CROTCHET
setFrequency NOTE_Db * 4, $80
wait CROTCHET
setFrequency NOTE_C * 4, $80
wait CROTCHET
setFrequency NOTE_Ab * 2, $80
wait CROTCHET
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Db * 4, $80
wait QUAVER
setFrequency NOTE_F * 4, $80
wait QUAVER
setFrequency NOTE_Db * 4, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Ab * 2, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait CROTCHET
setFrequency NOTE_Ab * 2, $80
wait CROTCHET
setFrequency NOTE_Bb * 2, $80
wait DOTTED_CROTCHET
setFrequency NOTE_F * 2, $80
wait SEMIQUAVER
setFrequency NOTE_Ab * 2, $80
wait SEMIQUAVER
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_Ab * 2, $80
wait QUAVER
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Db * 4, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Eb * 4, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Db * 4, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_Ab * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait CROTCHET
setFrequency NOTE_C * 2, $80
wait CROTCHET
setFrequency NOTE_Bb, $80
wait QUAVER
setFrequency NOTE_C * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_Db * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_C * 4, $80
wait QUAVER
setFrequency NOTE_Db * 4, $80
wait QUAVER
setFrequency NOTE_Bb * 2, $80
wait QUAVER
setFrequency NOTE_Ab * 2, $80
wait QUAVER
setFrequency NOTE_F * 2, $80
wait QUAVER
setFrequency NOTE_Ab * 2, $80
wait QUAVER
setFrequency NOTE_Bb * 2, $80
wait MINIM
stopMusic
jump .loop | 19.958932 | 37 | 0.741409 |
1de761edf212a3d97616006ad016aa89b2fe5d05 | 7,772 | asm | Assembly | src/Native/Runtime/i386/PInvoke.asm | ZZHGit/corert | 367ec5addb0a80bfbbda339d6add3ce3b99ddc75 | [
"MIT"
] | null | null | null | src/Native/Runtime/i386/PInvoke.asm | ZZHGit/corert | 367ec5addb0a80bfbbda339d6add3ce3b99ddc75 | [
"MIT"
] | null | null | null | src/Native/Runtime/i386/PInvoke.asm | ZZHGit/corert | 367ec5addb0a80bfbbda339d6add3ce3b99ddc75 | [
"MIT"
] | 1 | 2019-09-17T21:10:15.000Z | 2019-09-17T21:10:15.000Z | ;;
;; Copyright (c) Microsoft. All rights reserved.
;; Licensed under the MIT license. See LICENSE file in the project root for full license information.
;;
.586
.model flat
option casemap:none
.code
include AsmMacros.inc
extern RhpReversePInvokeBadTransition : proc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; RhpWaitForSuspend -- rare path for RhpPInvoke and RhpReversePInvokeReturn
;;
;;
;; INPUT: none
;;
;; TRASHES: none
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
_RhpWaitForSuspend proc public
push ebp
mov ebp, esp
push eax
push ecx
push edx
; passing Thread pointer in ecx, trashes eax
INLINE_GETTHREAD ecx, eax
call RhpPInvokeWaitEx
pop edx
pop ecx
pop eax
pop ebp
ret
_RhpWaitForSuspend endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; RhpWaitForGC
;;
;;
;; INPUT: ECX: transition frame
;;
;; OUTPUT:
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
_RhpWaitForGC proc public
push ebp
mov ebp, esp
push eax
push edx
push ebx
push esi
mov ebx, ecx
mov esi, [ebx + OFFSETOF__PInvokeTransitionFrame__m_pThread]
test dword ptr [esi + OFFSETOF__Thread__m_ThreadStateFlags], TSF_DoNotTriggerGc
jnz Done
RetryWaitForGC:
; EBX: transition frame
; ESI: thread
mov [esi + OFFSETOF__Thread__m_pTransitionFrame], ebx
mov ecx, esi ; passing Thread pointer in ecx
call @RhpPInvokeReturnWaitEx@4
mov dword ptr [esi + OFFSETOF__Thread__m_pTransitionFrame], 0
cmp [RhpTrapThreads], 0
jne RetryWaitForGC
Done:
pop esi
pop ebx
pop edx
pop eax
pop ebp
ret
_RhpWaitForGC endp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; RhpReversePInvoke2
;;
;; INCOMING: ECX -- address of reverse pinvoke frame
;;
;; This is useful for calling with a standard calling convention for code generators that don't insert this in
;; the prolog.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
FASTCALL_FUNC RhpReversePInvoke2, 0
mov eax, ecx
jmp @RhpReversePInvoke@0
FASTCALL_ENDFUNC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; RhpReversePInvoke
;;
;; IN: EAX: address of reverse pinvoke frame
;; 0: save slot for previous M->U transition frame
;; 4: save slot for thread pointer to avoid re-calc in epilog sequence
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
FASTCALL_FUNC RhpReversePInvoke, 0
push ecx ; save arg regs -- we could omit this if we knew the calling convention wasn't fastcall.
push edx ; ...
;; edx = GetThread(), TRASHES ecx
INLINE_GETTHREAD edx, ecx
mov [eax + 4], edx ; save thread pointer for RhpReversePInvokeReturn
; edx = thread
; eax = prev save slot
; ecx = scratch
test dword ptr [edx + OFFSETOF__Thread__m_ThreadStateFlags], TSF_Attached
jz AttachThread
ThreadAttached:
;;
;; Check for the correct mode. This is accessible via various odd things that we cannot completely
;; prevent such as :
;; 1) Registering a reverse pinvoke entrypoint as a vectored exception handler
;; 2) Performing a managed delegate invoke on a reverse pinvoke delegate.
;;
cmp dword ptr [edx + OFFSETOF__Thread__m_pTransitionFrame], 0
jne ValidTransition
;; Allow 'bad transitions' in when the TSF_DoNotTriggerGc mode is set. This allows us to have
;; [NativeCallable] methods that are called via the "restricted GC callouts" as well as from native,
;; which is necessary because the methods are CCW vtable methods on interfaces passed to native.
test dword ptr [edx + OFFSETOF__Thread__m_ThreadStateFlags], TSF_DoNotTriggerGc
jz BadTransition
;; zero-out our 'previous transition frame' save slot
mov dword ptr [eax], 0
;; nothing more to do
jmp AllDone
ValidTransition:
; Save previous TransitionFrame prior to making the mode transition so that it is always valid
; whenever we might attempt to hijack this thread.
mov ecx, [edx + OFFSETOF__Thread__m_pTransitionFrame]
mov [eax], ecx
ReverseRetry:
mov dword ptr [edx + OFFSETOF__Thread__m_pTransitionFrame], 0
cmp [RhpTrapThreads], 0
jne ReverseTrapReturningThread
AllDone:
pop edx ; restore arg reg
pop ecx ; restore arg reg
ret
AttachThread:
;;
;; Thread attach is done here to avoid taking the ThreadStore lock while in DllMain. The lock is
;; avoided for DllMain thread attach notifications, but not process attach notifications because
;; our managed DllMain does work during process attach, so it needs to reverse pinvoke.
;;
; edx = thread
; eax = prev save slot
; ecx = scratch
push eax
push edx
call THREADSTORE__ATTACHCURRENTTHREAD
pop edx
pop eax
jmp ThreadAttached
ReverseTrapReturningThread:
; edx = thread
; eax = prev save slot
; ecx = scratch
mov ecx, [eax]
mov [edx + OFFSETOF__Thread__m_pTransitionFrame], ecx
push eax
push edx
mov ecx, edx ; passing Thread pointer in ecx
call @RhpPInvokeReturnWaitEx@4
pop edx
pop eax
jmp ReverseRetry
BadTransition:
pop edx
pop ecx
jmp RhpReversePInvokeBadTransition
FASTCALL_ENDFUNC
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; RhpReversePInvokeReturn
;;
;; IN: ECX: address of reverse pinvoke frame
;; 0: save slot for previous M->U transition frame
;; 4: save slot for thread pointer to avoid re-calc in epilog sequence
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
FASTCALL_FUNC RhpReversePInvokeReturn, 0
push edx ; save return value
mov edx, [ecx + 4] ; get Thread pointer
mov ecx, [ecx + 0] ; get previous M->U transition frame
mov [edx + OFFSETOF__Thread__m_pTransitionFrame], ecx
cmp [RhpTrapThreads], 0
pop edx ; restore return value
jne _RhpWaitForSuspend
ret
FASTCALL_ENDFUNC
end | 33.213675 | 120 | 0.487262 |
145c015b228ddf446368c5b72213190f42bd9eb0 | 492 | asm | Assembly | boot/gdt.asm | foreverbell/BadAppleOS | 695e4de5f41cc64e0d6a1b147ab6d84d50b91416 | [
"MIT"
] | 52 | 2015-07-11T02:35:11.000Z | 2022-01-06T22:03:23.000Z | boot/gdt.asm | foreverbell/BadAppleOS | 695e4de5f41cc64e0d6a1b147ab6d84d50b91416 | [
"MIT"
] | null | null | null | boot/gdt.asm | foreverbell/BadAppleOS | 695e4de5f41cc64e0d6a1b147ab6d84d50b91416 | [
"MIT"
] | 3 | 2018-06-10T06:52:37.000Z | 2021-11-05T05:49:15.000Z | gdt:
.start:
.null:
dd 0x0
dd 0x0
.code: equ $ - gdt
dw 0xffff ; limit
dw 0x0 ; base_low
db 0x0 ; base_middle
db 10011010b ; access
db 11001111b ; granularity
db 0x0 ; base_high
.data: equ $ - gdt
dw 0xffff ; limit
dw 0x0 ; base_low
db 0x0 ; base_middle
db 10010010b ; access
db 11001111b ; granularity
db 0x0 ; base_high
.end:
.descriptor:
dw .end - .start - 1 ; limit
dd .start ; base
| 16.4 | 31 | 0.552846 |
fc6a1e13b8b90c5fe0757763d9c3d50b44676b1c | 36,831 | asm | Assembly | testbench/dtw/pthread/a_arm.asm | Arka2009/LOCUS | a0ef0bc9a25456668ef381734b17385da738805a | [
"BSD-3-Clause"
] | 8 | 2017-09-16T10:07:04.000Z | 2021-07-27T06:07:28.000Z | testbench/dtw/pthread/a_arm.asm | Arka2009/LOCUS | a0ef0bc9a25456668ef381734b17385da738805a | [
"BSD-3-Clause"
] | 3 | 2018-08-17T13:13:11.000Z | 2018-12-04T03:05:16.000Z | testbench/dtw/pthread/a_arm.asm | Arka2009/LOCUS | a0ef0bc9a25456668ef381734b17385da738805a | [
"BSD-3-Clause"
] | 1 | 2021-08-08T04:30:55.000Z | 2021-08-08T04:30:55.000Z | .arch armv5t
.eabi_attribute 27, 3
.fpu neon
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 0
.eabi_attribute 18, 4
.file "main_minus1.cpp"
.local _ZStL8__ioinit
.comm _ZStL8__ioinit,1,4
.global lock
.bss
.align 2
.type lock, %object
.size lock, 24576
lock:
.space 24576
.global value_lock
.align 2
.type value_lock, %object
.size value_lock, 64
value_lock:
.space 64
.global S
.align 2
.type S, %object
.size S, 644
S:
.space 644
.global T
.align 2
.type T, %object
.size T, 644
T:
.space 644
.global DTW
.align 2
.type DTW, %object
.size DTW, 104976
DTW:
.space 104976
.global X
.align 2
.type X, %object
.size X, 12
X:
.space 12
.global Y
.align 2
.type Y, %object
.size Y, 12
Y:
.space 12
.text
.align 2
.global _Z8add_intsPiS_ji
.type _Z8add_intsPiS_ji, %function
_Z8add_intsPiS_ji:
.fnstart
.LFB1232:
@ args = 0, pretend = 0, frame = 24
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #28
str r0, [fp, #-16]
str r1, [fp, #-20]
str r2, [fp, #-24]
str r3, [fp, #-28]
mov r3, #0
str r3, [fp, #-8]
b .L2
.L3:
ldr r3, [fp, #-8]
mov r3, r3, asl #2
ldr r2, [fp, #-16]
add r3, r2, r3
ldr r2, [fp, #-8]
mov r2, r2, asl #2
ldr r1, [fp, #-20]
add r2, r1, r2
ldr r1, [r2, #0]
ldr r2, [fp, #-28]
add r2, r1, r2
str r2, [r3, #0]
ldr r3, [fp, #-8]
add r3, r3, #1
str r3, [fp, #-8]
.L2:
ldr r3, [fp, #-24]
bic r2, r3, #3
ldr r3, [fp, #-8]
cmp r2, r3
movls r3, #0
movhi r3, #1
and r3, r3, #255
cmp r3, #0
bne .L3
add sp, fp, #0
ldmfd sp!, {fp}
bx lr
.cantunwind
.fnend
.size _Z8add_intsPiS_ji, .-_Z8add_intsPiS_ji
.align 2
.global _Z7minimumiii
.type _Z7minimumiii, %function
_Z7minimumiii:
.fnstart
.LFB1233:
@ args = 0, pretend = 0, frame = 24
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #28
str r0, [fp, #-16]
str r1, [fp, #-20]
str r2, [fp, #-24]
mov r3, #65536
str r3, [fp, #-8]
ldr r2, [fp, #-16]
ldr r3, [fp, #-20]
cmp r2, r3
bge .L5
ldr r3, [fp, #-16]
str r3, [fp, #-8]
b .L6
.L5:
ldr r3, [fp, #-20]
str r3, [fp, #-8]
.L6:
ldr r2, [fp, #-8]
ldr r3, [fp, #-24]
cmp r2, r3
ble .L7
ldr r3, [fp, #-24]
str r3, [fp, #-8]
.L7:
ldr r3, [fp, #-8]
mov r0, r3
add sp, fp, #0
ldmfd sp!, {fp}
bx lr
.cantunwind
.fnend
.size _Z7minimumiii, .-_Z7minimumiii
.align 2
.global _Z7minimumii
.type _Z7minimumii, %function
_Z7minimumii:
.fnstart
.LFB1234:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #20
str r0, [fp, #-16]
str r1, [fp, #-20]
mov r3, #65536
str r3, [fp, #-8]
ldr r2, [fp, #-16]
ldr r3, [fp, #-20]
cmp r2, r3
bge .L10
ldr r3, [fp, #-16]
str r3, [fp, #-8]
b .L11
.L10:
ldr r3, [fp, #-20]
str r3, [fp, #-8]
.L11:
ldr r3, [fp, #-8]
mov r0, r3
add sp, fp, #0
ldmfd sp!, {fp}
bx lr
.cantunwind
.fnend
.size _Z7minimumii, .-_Z7minimumii
.align 2
.global _Z7maximumiii
.type _Z7maximumiii, %function
_Z7maximumiii:
.fnstart
.LFB1235:
@ args = 0, pretend = 0, frame = 24
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #28
str r0, [fp, #-16]
str r1, [fp, #-20]
str r2, [fp, #-24]
mov r3, #0
str r3, [fp, #-8]
ldr r2, [fp, #-16]
ldr r3, [fp, #-20]
cmp r2, r3
bge .L14
ldr r3, [fp, #-20]
str r3, [fp, #-8]
b .L15
.L14:
ldr r3, [fp, #-16]
str r3, [fp, #-8]
.L15:
ldr r2, [fp, #-8]
ldr r3, [fp, #-24]
cmp r2, r3
bge .L16
ldr r3, [fp, #-24]
str r3, [fp, #-8]
.L16:
ldr r3, [fp, #-8]
mov r0, r3
add sp, fp, #0
ldmfd sp!, {fp}
bx lr
.cantunwind
.fnend
.size _Z7maximumiii, .-_Z7maximumiii
.align 2
.global _Z7maximumii
.type _Z7maximumii, %function
_Z7maximumii:
.fnstart
.LFB1236:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #20
str r0, [fp, #-16]
str r1, [fp, #-20]
mov r3, #0
str r3, [fp, #-8]
ldr r2, [fp, #-16]
ldr r3, [fp, #-20]
cmp r2, r3
bge .L19
ldr r3, [fp, #-20]
str r3, [fp, #-8]
b .L20
.L19:
ldr r3, [fp, #-16]
str r3, [fp, #-8]
.L20:
ldr r3, [fp, #-8]
mov r0, r3
add sp, fp, #0
ldmfd sp!, {fp}
bx lr
.cantunwind
.fnend
.size _Z7maximumii, .-_Z7maximumii
.section .rodata
.align 2
.LC0:
.ascii "\011\000"
.text
.align 2
.global _Z6outputv
.type _Z6outputv, %function
_Z6outputv:
.fnstart
.LFB1237:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
.save {fp, lr}
.setfp fp, sp, #4
add fp, sp, #4
.pad #8
sub sp, sp, #8
mov r3, #161
str r3, [fp, #-12]
b .L23
.L27:
mov r3, #0
str r3, [fp, #-8]
b .L24
.L26:
ldr r3, [fp, #-8]
cmp r3, #161
bne .L25
ldr r1, .L28
ldr r2, [fp, #-12]
mov r3, r2
mov r3, r3, asl #3
add r3, r3, r2
mov r2, r3, asl #3
add r3, r3, r2
mov r3, r3, asl #1
ldr r2, [fp, #-8]
add r3, r3, r2
ldr r3, [r1, r3, asl #2]
ldr r0, .L28+4
mov r1, r3
bl _ZNSolsEi
mov r3, r0
mov r0, r3
ldr r1, .L28+8
bl _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
.L25:
ldr r3, [fp, #-8]
add r3, r3, #1
str r3, [fp, #-8]
.L24:
ldr r3, [fp, #-8]
cmp r3, #161
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L26
ldr r0, .L28+4
ldr r1, .L28+12
bl _ZNSolsEPFRSoS_E
ldr r3, [fp, #-12]
add r3, r3, #1
str r3, [fp, #-12]
.L23:
ldr r3, [fp, #-12]
cmp r3, #161
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L27
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.L29:
.align 2
.L28:
.word DTW
.word _ZSt4cout
.word .LC0
.word _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.fnend
.size _Z6outputv, .-_Z6outputv
.align 2
.global _Z8absolutei
.type _Z8absolutei, %function
_Z8absolutei:
.fnstart
.LFB1238:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #12
str r0, [fp, #-8]
ldr r3, [fp, #-8]
cmp r3, #0
bge .L31
ldr r3, [fp, #-8]
rsb r3, r3, #0
str r3, [fp, #-8]
.L31:
ldr r3, [fp, #-8]
mov r0, r3
add sp, fp, #0
ldmfd sp!, {fp}
bx lr
.cantunwind
.fnend
.size _Z8absolutei, .-_Z8absolutei
.section .rodata
.align 2
.LC3:
.ascii "r\000"
.align 2
.LC4:
.ascii "\012cannot open file \"%s\".\012\000"
.align 2
.LC5:
.ascii "%f,%f\000"
.align 2
.LC1:
.ascii "input_dtw/input_std\000"
.space 236
.align 2
.LC2:
.ascii "input_dtw/input_smp\000"
.space 236
.text
.align 2
.global _Z8get_dataiPPiS0_
.type _Z8get_dataiPPiS0_, %function
_Z8get_dataiPPiS0_:
.fnstart
.LFB1239:
@ args = 0, pretend = 0, frame = 560
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
.save {fp, lr}
.setfp fp, sp, #4
add fp, sp, #4
.pad #560
sub sp, sp, #560
str r0, [fp, #-552]
str r1, [fp, #-556]
str r2, [fp, #-560]
ldr r3, .L44+4
ldr r3, [r3, #0]
str r3, [fp, #-8]
ldr r3, .L44+8
sub ip, fp, #520
mov lr, r3
ldmia lr!, {r0, r1, r2, r3}
stmia ip!, {r0, r1, r2, r3}
ldr r3, [lr, #0]
str r3, [ip, #0]
sub r2, fp, #500
mov r3, #236
mov r0, r2
mov r1, #0
mov r2, r3
bl memset
ldr r3, .L44+12
sub ip, fp, #264
mov lr, r3
ldmia lr!, {r0, r1, r2, r3}
stmia ip!, {r0, r1, r2, r3}
ldr r3, [lr, #0]
str r3, [ip, #0]
sub r2, fp, #244
mov r3, #236
mov r0, r2
mov r1, #0
mov r2, r3
bl memset
mov r3, #18
str r3, [fp, #-536]
ldr r3, [fp, #-536]
add r2, r3, #1
ldr r3, .L44+16
sub r1, fp, #4
add r2, r1, r2
add r3, r2, r3
mov r2, #0
strb r2, [r3, #0]
sub r3, fp, #520
mov r0, r3
ldr r1, .L44+20
.LEHB0:
bl fopen
mov r3, r0
str r3, [fp, #-532]
ldr r3, [fp, #-532]
cmp r3, #0
bne .L34
sub r3, fp, #520
ldr r0, .L44+24
mov r1, r3
bl printf
mov r0, #1
bl exit
.L34:
ldr r3, [fp, #-552]
mov r3, r3, asl #2
mov r0, r3
bl malloc
mov r3, r0
str r3, [fp, #-528]
ldr r3, [fp, #-552]
str r3, [fp, #-524]
ldr r3, [fp, #-528]
str r3, [fp, #-540]
flds s15, .L44
fsts s15, [fp, #-548]
flds s15, .L44
fsts s15, [fp, #-544]
b .L35
.L36:
sub r2, fp, #548
sub r3, fp, #544
ldr r0, [fp, #-532]
ldr r1, .L44+28
bl fscanf
flds s15, [fp, #-548]
ftosizs s15, s15
ldr r3, [fp, #-540]
fsts s15, [r3, #0] @ int
ldr r3, [fp, #-540]
add r3, r3, #4
str r3, [fp, #-540]
.L35:
ldr r3, [fp, #-552]
cmp r3, #0
moveq r3, #0
movne r3, #1
and r3, r3, #255
ldr r2, [fp, #-552]
sub r2, r2, #1
str r2, [fp, #-552]
cmp r3, #0
bne .L36
ldr r0, [fp, #-532]
bl fclose
ldr r3, [fp, #-556]
ldr r2, [fp, #-528]
str r2, [r3, #0]
sub r3, fp, #264
mov r0, r3
ldr r1, .L44+20
bl fopen
mov r3, r0
str r3, [fp, #-532]
ldr r3, [fp, #-532]
cmp r3, #0
bne .L37
sub r3, fp, #264
ldr r0, .L44+24
mov r1, r3
bl printf
mov r0, #1
bl exit
.L37:
ldr r3, [fp, #-524]
str r3, [fp, #-552]
ldr r3, [fp, #-552]
mov r3, r3, asl #2
mov r0, r3
bl malloc
mov r3, r0
str r3, [fp, #-528]
ldr r3, [fp, #-528]
str r3, [fp, #-540]
flds s15, .L44
fsts s15, [fp, #-548]
flds s15, .L44
fsts s15, [fp, #-544]
b .L38
.L39:
sub r2, fp, #548
sub r3, fp, #544
ldr r0, [fp, #-532]
ldr r1, .L44+28
bl fscanf
flds s15, [fp, #-548]
ftosizs s15, s15
ldr r3, [fp, #-540]
fsts s15, [r3, #0] @ int
ldr r3, [fp, #-540]
add r3, r3, #4
str r3, [fp, #-540]
.L38:
ldr r3, [fp, #-552]
cmp r3, #0
moveq r3, #0
movne r3, #1
and r3, r3, #255
ldr r2, [fp, #-552]
sub r2, r2, #1
str r2, [fp, #-552]
cmp r3, #0
bne .L39
ldr r0, [fp, #-532]
bl fclose
.LEHE0:
ldr r3, [fp, #-560]
ldr r2, [fp, #-528]
str r2, [r3, #0]
ldr r3, .L44+4
ldr r2, [fp, #-8]
ldr r3, [r3, #0]
cmp r2, r3
beq .L41
b .L43
.L42:
.LEHB1:
bl __cxa_end_cleanup
.LEHE1:
.L43:
bl __stack_chk_fail
.L41:
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.L45:
.align 2
.L44:
.word 0
.word __stack_chk_guard
.word .LC1
.word .LC2
.word -516
.word .LC3
.word .LC4
.word .LC5
.global __gxx_personality_v0
.personality __gxx_personality_v0
.handlerdata
.LLSDA1239:
.byte 0xff
.byte 0xff
.byte 0x1
.uleb128 .LLSDACSE1239-.LLSDACSB1239
.LLSDACSB1239:
.uleb128 .LEHB0-.LFB1239
.uleb128 .LEHE0-.LEHB0
.uleb128 .L42-.LFB1239
.uleb128 0
.uleb128 .LEHB1-.LFB1239
.uleb128 .LEHE1-.LEHB1
.uleb128 0
.uleb128 0
.LLSDACSE1239:
.text
.fnend
.size _Z8get_dataiPPiS0_, .-_Z8get_dataiPPiS0_
.section .rodata
.align 2
.LC6:
.ascii "\012-----------------------------------------------"
.ascii "--------\000"
.text
.align 2
.global _Z10initializeb
.type _Z10initializeb, %function
_Z10initializeb:
.fnstart
.LFB1240:
@ args = 0, pretend = 0, frame = 1336
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
.save {fp, lr}
.setfp fp, sp, #4
add fp, sp, #4
.pad #1328
sub sp, sp, #1328
.pad #8
sub sp, sp, #8
mov r3, r0
strb r3, [fp, #-1333]
mov r3, #0
str r3, [fp, #-1332]
b .L47
.L48:
ldr r3, [fp, #-1332]
add r2, r3, #1
ldr r1, [fp, #-1332]
ldr r3, .L71
mov r1, r1, asl #2
sub r0, fp, #4
add r1, r0, r1
add r3, r1, r3
str r2, [r3, #0]
ldr r3, [fp, #-1332]
add r3, r3, #1
str r3, [fp, #-1332]
.L47:
ldr r3, [fp, #-1332]
cmp r3, #160
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L48
mov r3, #0
str r3, [fp, #-1328]
b .L49
.L50:
ldr r2, [fp, #-1328]
ldr r3, .L71
mov r2, r2, asl #2
sub r1, fp, #4
add r2, r1, r2
add r3, r2, r3
ldr r1, [r3, #0]
ldr r3, .L71+4
ldr r2, [fp, #-1328]
str r1, [r3, r2, asl #2]
ldr r3, [fp, #-1328]
add r3, r3, #1
str r3, [fp, #-1328]
.L49:
ldr r3, [fp, #-1328]
cmp r3, #160
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L50
mov r3, #0
str r3, [fp, #-1324]
b .L51
.L52:
ldr r3, [fp, #-1324]
add r2, r3, #3
ldr r1, [fp, #-1324]
ldr r3, .L71+8
mov r1, r1, asl #2
sub r0, fp, #4
add r1, r0, r1
add r3, r1, r3
str r2, [r3, #0]
ldr r3, [fp, #-1324]
add r3, r3, #1
str r3, [fp, #-1324]
.L51:
ldr r3, [fp, #-1324]
cmp r3, #160
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L52
mov r3, #0
str r3, [fp, #-1320]
b .L53
.L54:
ldr r2, [fp, #-1320]
ldr r3, .L71+8
mov r2, r2, asl #2
sub r1, fp, #4
add r2, r1, r2
add r3, r2, r3
ldr r1, [r3, #0]
ldr r3, .L71+12
ldr r2, [fp, #-1320]
str r1, [r3, r2, asl #2]
ldr r3, [fp, #-1320]
add r3, r3, #1
str r3, [fp, #-1320]
.L53:
ldr r3, [fp, #-1320]
cmp r3, #160
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L54
mov r3, #1
str r3, [fp, #-1316]
b .L55
.L58:
mov r3, #1
str r3, [fp, #-1312]
b .L56
.L57:
ldr r1, .L71+16
ldr r2, [fp, #-1316]
mov r3, r2
mov r3, r3, asl #3
add r3, r3, r2
mov r2, r3, asl #3
add r3, r3, r2
mov r3, r3, asl #1
ldr r2, [fp, #-1312]
add r3, r3, r2
mvn r2, #0
str r2, [r1, r3, asl #2]
ldr r3, [fp, #-1312]
add r3, r3, #1
str r3, [fp, #-1312]
.L56:
ldr r3, [fp, #-1312]
cmp r3, #161
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L57
ldr r3, [fp, #-1316]
add r3, r3, #1
str r3, [fp, #-1316]
.L55:
ldr r3, [fp, #-1316]
cmp r3, #161
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L58
ldr r0, .L71+20
ldr r1, .L71+24
.LEHB2:
bl _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
mov r3, r0
mov r0, r3
ldr r1, .L71+28
bl _ZNSolsEPFRSoS_E
.LEHE2:
mov r3, #1
str r3, [fp, #-1308]
b .L59
.L60:
ldr r1, .L71+16
ldr r2, [fp, #-1308]
mov r3, r2
mov r3, r3, asl #3
add r3, r3, r2
mov r2, r3, asl #3
add r3, r3, r2
mov r3, r3, asl #3
add r3, r1, r3
mov r2, #65536
str r2, [r3, #0]
ldr r3, .L71+16
ldr r2, [fp, #-1308]
mov r1, #65536
str r1, [r3, r2, asl #2]
ldr r3, [fp, #-1308]
add r3, r3, #1
str r3, [fp, #-1308]
.L59:
ldr r3, [fp, #-1308]
cmp r3, #161
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L60
mov r3, #1
str r3, [fp, #-1304]
b .L61
.L62:
ldr r0, .L71+16
ldr r2, [fp, #-1304]
mov r1, #4
mov r3, r2
mov r3, r3, asl #3
add r3, r3, r2
mov r2, r3, asl #3
add r3, r3, r2
mov r3, r3, asl #3
add r3, r0, r3
add r3, r3, r1
mov r2, #65536
str r2, [r3, #0]
ldr r3, .L71+4
ldr r2, [r3, #0]
ldr r3, [fp, #-1304]
sub r1, r3, #1
ldr r3, .L71+12
ldr r3, [r3, r1, asl #2]
rsb r3, r3, r2
mov r0, r3
bl _Z8absolutei
mov r1, r0
ldr r3, .L71+16
ldr r2, [fp, #-1304]
add r2, r2, #162
str r1, [r3, r2, asl #2]
ldr r3, [fp, #-1304]
add r3, r3, #1
str r3, [fp, #-1304]
.L61:
ldr r3, [fp, #-1304]
cmp r3, #161
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L62
ldrb r3, [fp, #-1333] @ zero_extendqisi2
cmp r3, #0
beq .L63
mov r3, #0
str r3, [fp, #-1300]
b .L64
.L67:
mov r3, #0
str r3, [fp, #-1296]
b .L65
.L66:
ldr r1, .L71+16
ldr r2, [fp, #-1300]
mov r3, r2
mov r3, r3, asl #3
add r3, r3, r2
mov r2, r3, asl #3
add r3, r3, r2
mov r3, r3, asl #1
ldr r2, [fp, #-1296]
add r3, r3, r2
mov r2, #65536
str r2, [r1, r3, asl #2]
ldr r3, [fp, #-1296]
add r3, r3, #1
str r3, [fp, #-1296]
.L65:
ldr r3, [fp, #-1296]
cmp r3, #161
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L66
ldr r3, [fp, #-1300]
add r3, r3, #1
str r3, [fp, #-1300]
.L64:
ldr r3, [fp, #-1300]
cmp r3, #161
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L67
.L63:
ldr r3, .L71+16
mov r2, #0
str r2, [r3, #0]
b .L70
.L69:
.LEHB3:
bl __cxa_end_cleanup
.LEHE3:
.L70:
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.L72:
.align 2
.L71:
.word -1288
.word S
.word -644
.word T
.word DTW
.word _ZSt4cout
.word .LC6
.word _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.personality __gxx_personality_v0
.handlerdata
.LLSDA1240:
.byte 0xff
.byte 0xff
.byte 0x1
.uleb128 .LLSDACSE1240-.LLSDACSB1240
.LLSDACSB1240:
.uleb128 .LEHB2-.LFB1240
.uleb128 .LEHE2-.LEHB2
.uleb128 .L69-.LFB1240
.uleb128 0
.uleb128 .LEHB3-.LFB1240
.uleb128 .LEHE3-.LEHB3
.uleb128 0
.uleb128 0
.LLSDACSE1240:
.text
.fnend
.size _Z10initializeb, .-_Z10initializeb
.align 2
.global _Z6masterPv
.type _Z6masterPv, %function
_Z6masterPv:
.fnstart
.LFB1241:
@ args = 0, pretend = 0, frame = 72
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {r4, r5, r6, fp, lr}
add fp, sp, #16
sub sp, sp, #76
str r0, [fp, #-88]
ldr r3, [fp, #-88]
str r3, [fp, #-68]
ldr r3, [fp, #-68]
ldr r2, [r3, #0]
mov r3, r2
mov r3, r3, asl #2
add r3, r3, r2
mov r3, r3, asl #1
add r3, r3, #1
str r3, [fp, #-64]
mov r3, #0
strb r3, [fp, #-81]
mov r3, #1
str r3, [fp, #-80]
b .L74
.L80:
mov r3, #0
str r3, [fp, #-76]
b .L75
.L76:
ldr r3, .L81
ldr r2, [fp, #-80]
ldr r2, [r3, r2, asl #2]
ldr r1, [fp, #-64]
ldr r3, [fp, #-76]
add r1, r1, r3
ldr r3, .L81+4
ldr r3, [r3, r1, asl #2]
rsb r3, r3, r2
mov r0, r3
bl _Z8absolutei
mov r2, r0
ldr r1, [fp, #-76]
mvn r3, #39
mov r1, r1, asl #2
sub r0, fp, #20
add r1, r0, r1
add r3, r1, r3
str r2, [r3, #0]
ldr r3, [fp, #-76]
add r3, r3, #1
str r3, [fp, #-76]
.L75:
ldr r3, [fp, #-76]
cmp r3, #9
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L76
mov r0, r0 @ nop
.L77:
ldr r1, .L81+8
ldr r2, [fp, #-80]
mov r3, r2
mov r3, r3, asl #3
add r3, r3, r2
mov r2, r3, asl #3
add r3, r3, r2
mov r3, r3, asl #1
ldr r2, [fp, #-64]
add r3, r3, r2
ldr r3, [r1, r3, asl #2]
cmn r3, #1
movne r3, #0
moveq r3, #1
and r3, r3, #255
cmp r3, #0
bne .L77
mov r3, #0
str r3, [fp, #-72]
b .L78
.L79:
ldr r3, [fp, #-80]
add r4, r3, #1
ldr r3, [fp, #-64]
add r2, r3, #1
ldr r3, [fp, #-72]
add r5, r2, r3
ldr r2, [fp, #-72]
mvn r3, #39
mov r2, r2, asl #2
sub r1, fp, #20
add r2, r1, r2
add r3, r2, r3
ldr r6, [r3, #0]
ldr r3, [fp, #-80]
sub r2, r3, #1
ldr r1, [fp, #-64]
ldr r3, [fp, #-72]
add r0, r1, r3
ldr r1, .L81+8
mov r3, r2
mov r3, r3, asl #3
add r3, r3, r2
mov r2, r3, asl #3
add r3, r3, r2
mov r3, r3, asl #1
add r3, r3, r0
ldr r0, [r1, r3, asl #2]
ldr r2, [fp, #-64]
ldr r3, [fp, #-72]
add ip, r2, r3
ldr r1, .L81+8
ldr r2, [fp, #-80]
mov r3, r2
mov r3, r3, asl #3
add r3, r3, r2
mov r2, r3, asl #3
add r3, r3, r2
mov r3, r3, asl #1
add r3, r3, ip
ldr r1, [r1, r3, asl #2]
ldr r3, [fp, #-64]
sub r2, r3, #1
ldr r3, [fp, #-72]
add lr, r2, r3
ldr ip, .L81+8
ldr r2, [fp, #-80]
mov r3, r2
mov r3, r3, asl #3
add r3, r3, r2
mov r2, r3, asl #3
add r3, r3, r2
mov r3, r3, asl #1
add r3, r3, lr
ldr r3, [ip, r3, asl #2]
mov r2, r3
bl _Z7minimumiii
mov r3, r0
add r1, r6, r3
ldr r2, .L81+8
mov r3, r4
mov r3, r3, asl #3
add r3, r3, r4
mov r0, r3, asl #3
add r3, r3, r0
mov r3, r3, asl #1
add r3, r3, r5
str r1, [r2, r3, asl #2]
ldr r3, [fp, #-72]
add r3, r3, #1
str r3, [fp, #-72]
.L78:
ldr r3, [fp, #-72]
cmp r3, #9
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L79
ldr r3, [fp, #-80]
add r3, r3, #1
str r3, [fp, #-80]
.L74:
ldr r3, [fp, #-80]
cmp r3, #160
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L80
mov r0, r3
sub sp, fp, #16
ldmfd sp!, {r4, r5, r6, fp, pc}
.L82:
.align 2
.L81:
.word S
.word T
.word DTW
.cantunwind
.fnend
.size _Z6masterPv, .-_Z6masterPv
.section .rodata
.align 2
.LC7:
.ascii "================= DTW variation==============\000"
.text
.align 2
.global main
.type main, %function
main:
.fnstart
.LFB1242:
@ args = 0, pretend = 0, frame = 152
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
.save {fp, lr}
.setfp fp, sp, #4
add fp, sp, #4
.pad #152
sub sp, sp, #152
str r0, [fp, #-152]
str r1, [fp, #-156]
mov r0, #0
.LEHB4:
bl _Z10initializeb
mov r3, #0
str r3, [fp, #-144]
b .L84
.L85:
ldr r2, [fp, #-144]
mov r3, r2
mov r3, r3, asl #1
add r3, r3, r2
mov r3, r3, asl #9
mov r2, r3
ldr r3, .L92
add r3, r2, r3
mov r0, r3
mov r1, #0
bl pthread_mutex_init
ldr r3, [fp, #-144]
add r3, r3, #1
str r3, [fp, #-144]
.L84:
ldr r3, [fp, #-144]
cmp r3, #15
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L85
ldr r0, .L92+4
ldr r1, .L92+8
bl _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
mov r3, r0
mov r0, r3
ldr r1, .L92+12
bl _ZNSolsEPFRSoS_E
mov r0, #0
mov r1, #0
mov r2, #0
mov r3, #0
bl m5_dump_stats
mov r0, #0
mov r1, #0
mov r2, #0
mov r3, #0
bl m5_reset_stats
mov r3, #0
str r3, [fp, #-140]
b .L86
.L87:
ldr r2, [fp, #-140]
mvn r3, #63
mov r2, r2, asl #2
sub r1, fp, #4
add r2, r1, r2
add r3, r2, r3
ldr r2, [fp, #-140]
str r2, [r3, #0]
sub r2, fp, #132
ldr r3, [fp, #-140]
mov r3, r3, asl #2
add r2, r2, r3
ldr r3, [fp, #-140]
mov r3, r3, asl #2
sub r1, fp, #68
add r3, r1, r3
mov r0, r2
mov r1, #0
ldr r2, .L92+16
bl pthread_create
str r0, [fp, #-136]
ldr r3, [fp, #-140]
add r3, r3, #1
str r3, [fp, #-140]
.L86:
ldr r3, [fp, #-140]
cmp r3, #14
movgt r3, #0
movle r3, #1
and r3, r3, #255
cmp r3, #0
bne .L87
mov r3, #15
str r3, [fp, #-8]
sub r3, fp, #68
add r3, r3, #60
mov r0, r3
bl _Z6masterPv
mov r0, #0
mov r1, #0
mov r2, #0
mov r3, #0
bl m5_dump_stats
mov r0, #0
mov r1, #0
mov r2, #0
mov r3, #0
bl m5_reset_stats
bl _Z6outputv
.LEHE4:
mov r3, #0
b .L91
.L90:
.LEHB5:
bl __cxa_end_cleanup
.LEHE5:
.L91:
mov r0, r3
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.L93:
.align 2
.L92:
.word lock
.word _ZSt4cout
.word .LC7
.word _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
.word _Z6masterPv
.personality __gxx_personality_v0
.handlerdata
.LLSDA1242:
.byte 0xff
.byte 0xff
.byte 0x1
.uleb128 .LLSDACSE1242-.LLSDACSB1242
.LLSDACSB1242:
.uleb128 .LEHB4-.LFB1242
.uleb128 .LEHE4-.LEHB4
.uleb128 .L90-.LFB1242
.uleb128 0
.uleb128 .LEHB5-.LFB1242
.uleb128 .LEHE5-.LEHB5
.uleb128 0
.uleb128 0
.LLSDACSE1242:
.text
.fnend
.size main, .-main
.section .text._ZNSt6vectorIiSaIiEEC2Ev,"axG",%progbits,_ZNSt6vectorIiSaIiEEC5Ev,comdat
.align 2
.weak _ZNSt6vectorIiSaIiEEC2Ev
.type _ZNSt6vectorIiSaIiEEC2Ev, %function
_ZNSt6vectorIiSaIiEEC2Ev:
.fnstart
.LFB1245:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
.save {fp, lr}
.setfp fp, sp, #4
add fp, sp, #4
.pad #8
sub sp, sp, #8
str r0, [fp, #-8]
ldr r3, [fp, #-8]
mov r0, r3
bl _ZNSt12_Vector_baseIiSaIiEEC2Ev
ldr r3, [fp, #-8]
mov r0, r3
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.fnend
.size _ZNSt6vectorIiSaIiEEC2Ev, .-_ZNSt6vectorIiSaIiEEC2Ev
.weak _ZNSt6vectorIiSaIiEEC1Ev
_ZNSt6vectorIiSaIiEEC1Ev = _ZNSt6vectorIiSaIiEEC2Ev
.section .text._ZNSt12_Vector_baseIiSaIiEE12_Vector_implD2Ev,"axG",%progbits,_ZNSt12_Vector_baseIiSaIiEE12_Vector_implD5Ev,comdat
.align 2
.weak _ZNSt12_Vector_baseIiSaIiEE12_Vector_implD2Ev
.type _ZNSt12_Vector_baseIiSaIiEE12_Vector_implD2Ev, %function
_ZNSt12_Vector_baseIiSaIiEE12_Vector_implD2Ev:
.fnstart
.LFB1254:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
add fp, sp, #4
sub sp, sp, #8
str r0, [fp, #-8]
ldr r0, [fp, #-8]
bl _ZNSaIiED2Ev
ldr r3, [fp, #-8]
mov r0, r3
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.cantunwind
.fnend
.size _ZNSt12_Vector_baseIiSaIiEE12_Vector_implD2Ev, .-_ZNSt12_Vector_baseIiSaIiEE12_Vector_implD2Ev
.weak _ZNSt12_Vector_baseIiSaIiEE12_Vector_implD1Ev
_ZNSt12_Vector_baseIiSaIiEE12_Vector_implD1Ev = _ZNSt12_Vector_baseIiSaIiEE12_Vector_implD2Ev
.section .text._ZNSt12_Vector_baseIiSaIiEEC2Ev,"axG",%progbits,_ZNSt12_Vector_baseIiSaIiEEC5Ev,comdat
.align 2
.weak _ZNSt12_Vector_baseIiSaIiEEC2Ev
.type _ZNSt12_Vector_baseIiSaIiEEC2Ev, %function
_ZNSt12_Vector_baseIiSaIiEEC2Ev:
.fnstart
.LFB1256:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
add fp, sp, #4
sub sp, sp, #8
str r0, [fp, #-8]
ldr r3, [fp, #-8]
mov r0, r3
bl _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev
ldr r3, [fp, #-8]
mov r0, r3
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.cantunwind
.fnend
.size _ZNSt12_Vector_baseIiSaIiEEC2Ev, .-_ZNSt12_Vector_baseIiSaIiEEC2Ev
.weak _ZNSt12_Vector_baseIiSaIiEEC1Ev
_ZNSt12_Vector_baseIiSaIiEEC1Ev = _ZNSt12_Vector_baseIiSaIiEEC2Ev
.section .text._ZNSt12_Vector_baseIiSaIiEED2Ev,"axG",%progbits,_ZNSt12_Vector_baseIiSaIiEED5Ev,comdat
.align 2
.weak _ZNSt12_Vector_baseIiSaIiEED2Ev
.type _ZNSt12_Vector_baseIiSaIiEED2Ev, %function
_ZNSt12_Vector_baseIiSaIiEED2Ev:
.fnstart
.LFB1259:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
.save {fp, lr}
.setfp fp, sp, #4
add fp, sp, #4
.pad #8
sub sp, sp, #8
str r0, [fp, #-8]
ldr r3, [fp, #-8]
ldr r2, [r3, #0]
ldr r3, [fp, #-8]
ldr r3, [r3, #8]
mov r1, r3
ldr r3, [fp, #-8]
ldr r3, [r3, #0]
rsb r3, r3, r1
mov r3, r3, asr #2
ldr r0, [fp, #-8]
mov r1, r2
mov r2, r3
.LEHB6:
bl _ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPij
.LEHE6:
ldr r3, [fp, #-8]
mov r0, r3
bl _ZNSt12_Vector_baseIiSaIiEE12_Vector_implD1Ev
ldr r3, [fp, #-8]
b .L108
.L107:
ldr r3, [fp, #-8]
mov r0, r3
bl _ZNSt12_Vector_baseIiSaIiEE12_Vector_implD1Ev
.LEHB7:
bl __cxa_end_cleanup
.LEHE7:
.L108:
mov r0, r3
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.personality __gxx_personality_v0
.handlerdata
.LLSDA1259:
.byte 0xff
.byte 0xff
.byte 0x1
.uleb128 .LLSDACSE1259-.LLSDACSB1259
.LLSDACSB1259:
.uleb128 .LEHB6-.LFB1259
.uleb128 .LEHE6-.LEHB6
.uleb128 .L107-.LFB1259
.uleb128 0
.uleb128 .LEHB7-.LFB1259
.uleb128 .LEHE7-.LEHB7
.uleb128 0
.uleb128 0
.LLSDACSE1259:
.section .text._ZNSt12_Vector_baseIiSaIiEED2Ev,"axG",%progbits,_ZNSt12_Vector_baseIiSaIiEED5Ev,comdat
.fnend
.size _ZNSt12_Vector_baseIiSaIiEED2Ev, .-_ZNSt12_Vector_baseIiSaIiEED2Ev
.weak _ZNSt12_Vector_baseIiSaIiEED1Ev
_ZNSt12_Vector_baseIiSaIiEED1Ev = _ZNSt12_Vector_baseIiSaIiEED2Ev
.section .text._ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev,"axG",%progbits,_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC5Ev,comdat
.align 2
.weak _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev
.type _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev, %function
_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev:
.fnstart
.LFB1266:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
add fp, sp, #4
sub sp, sp, #8
str r0, [fp, #-8]
ldr r0, [fp, #-8]
bl _ZNSaIiEC2Ev
ldr r3, [fp, #-8]
mov r2, #0
str r2, [r3, #0]
ldr r3, [fp, #-8]
mov r2, #0
str r2, [r3, #4]
ldr r3, [fp, #-8]
mov r2, #0
str r2, [r3, #8]
ldr r3, [fp, #-8]
mov r0, r3
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.cantunwind
.fnend
.size _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev, .-_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev
.weak _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev
_ZNSt12_Vector_baseIiSaIiEE12_Vector_implC1Ev = _ZNSt12_Vector_baseIiSaIiEE12_Vector_implC2Ev
.section .text._ZNSaIiED2Ev,"axG",%progbits,_ZNSaIiED5Ev,comdat
.align 2
.weak _ZNSaIiED2Ev
.type _ZNSaIiED2Ev, %function
_ZNSaIiED2Ev:
.fnstart
.LFB1269:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
add fp, sp, #4
sub sp, sp, #8
str r0, [fp, #-8]
ldr r0, [fp, #-8]
bl _ZN9__gnu_cxx13new_allocatorIiED2Ev
ldr r3, [fp, #-8]
mov r0, r3
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.cantunwind
.fnend
.size _ZNSaIiED2Ev, .-_ZNSaIiED2Ev
.weak _ZNSaIiED1Ev
_ZNSaIiED1Ev = _ZNSaIiED2Ev
.section .text._ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPij,"axG",%progbits,_ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPij,comdat
.align 2
.weak _ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPij
.type _ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPij, %function
_ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPij:
.fnstart
.LFB1271:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
add fp, sp, #4
sub sp, sp, #16
str r0, [fp, #-8]
str r1, [fp, #-12]
str r2, [fp, #-16]
ldr r3, [fp, #-12]
cmp r3, #0
beq .L115
ldr r3, [fp, #-8]
mov r0, r3
ldr r1, [fp, #-12]
ldr r2, [fp, #-16]
bl _ZN9__gnu_cxx13new_allocatorIiE10deallocateEPij
.L115:
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.cantunwind
.fnend
.size _ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPij, .-_ZNSt12_Vector_baseIiSaIiEE13_M_deallocateEPij
.section .text._ZNSaIiEC2Ev,"axG",%progbits,_ZNSaIiEC5Ev,comdat
.align 2
.weak _ZNSaIiEC2Ev
.type _ZNSaIiEC2Ev, %function
_ZNSaIiEC2Ev:
.fnstart
.LFB1275:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
add fp, sp, #4
sub sp, sp, #8
str r0, [fp, #-8]
ldr r0, [fp, #-8]
bl _ZN9__gnu_cxx13new_allocatorIiEC2Ev
ldr r3, [fp, #-8]
mov r0, r3
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.cantunwind
.fnend
.size _ZNSaIiEC2Ev, .-_ZNSaIiEC2Ev
.weak _ZNSaIiEC1Ev
_ZNSaIiEC1Ev = _ZNSaIiEC2Ev
.section .text._ZN9__gnu_cxx13new_allocatorIiED2Ev,"axG",%progbits,_ZN9__gnu_cxx13new_allocatorIiED5Ev,comdat
.align 2
.weak _ZN9__gnu_cxx13new_allocatorIiED2Ev
.type _ZN9__gnu_cxx13new_allocatorIiED2Ev, %function
_ZN9__gnu_cxx13new_allocatorIiED2Ev:
.fnstart
.LFB1278:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #12
str r0, [fp, #-8]
ldr r3, [fp, #-8]
mov r0, r3
add sp, fp, #0
ldmfd sp!, {fp}
bx lr
.cantunwind
.fnend
.size _ZN9__gnu_cxx13new_allocatorIiED2Ev, .-_ZN9__gnu_cxx13new_allocatorIiED2Ev
.weak _ZN9__gnu_cxx13new_allocatorIiED1Ev
_ZN9__gnu_cxx13new_allocatorIiED1Ev = _ZN9__gnu_cxx13new_allocatorIiED2Ev
.section .text._ZN9__gnu_cxx13new_allocatorIiE10deallocateEPij,"axG",%progbits,_ZN9__gnu_cxx13new_allocatorIiE10deallocateEPij,comdat
.align 2
.weak _ZN9__gnu_cxx13new_allocatorIiE10deallocateEPij
.type _ZN9__gnu_cxx13new_allocatorIiE10deallocateEPij, %function
_ZN9__gnu_cxx13new_allocatorIiE10deallocateEPij:
.fnstart
.LFB1280:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
add fp, sp, #4
sub sp, sp, #16
str r0, [fp, #-8]
str r1, [fp, #-12]
str r2, [fp, #-16]
ldr r0, [fp, #-12]
bl _ZdlPv
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.cantunwind
.fnend
.size _ZN9__gnu_cxx13new_allocatorIiE10deallocateEPij, .-_ZN9__gnu_cxx13new_allocatorIiE10deallocateEPij
.section .text._ZN9__gnu_cxx13new_allocatorIiEC2Ev,"axG",%progbits,_ZN9__gnu_cxx13new_allocatorIiEC5Ev,comdat
.align 2
.weak _ZN9__gnu_cxx13new_allocatorIiEC2Ev
.type _ZN9__gnu_cxx13new_allocatorIiEC2Ev, %function
_ZN9__gnu_cxx13new_allocatorIiEC2Ev:
.fnstart
.LFB1282:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #12
str r0, [fp, #-8]
ldr r3, [fp, #-8]
mov r0, r3
add sp, fp, #0
ldmfd sp!, {fp}
bx lr
.cantunwind
.fnend
.size _ZN9__gnu_cxx13new_allocatorIiEC2Ev, .-_ZN9__gnu_cxx13new_allocatorIiEC2Ev
.weak _ZN9__gnu_cxx13new_allocatorIiEC1Ev
_ZN9__gnu_cxx13new_allocatorIiEC1Ev = _ZN9__gnu_cxx13new_allocatorIiEC2Ev
.text
.align 2
.type _Z41__static_initialization_and_destruction_0ii, %function
_Z41__static_initialization_and_destruction_0ii:
.fnstart
.LFB1284:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
add fp, sp, #4
sub sp, sp, #8
str r0, [fp, #-8]
str r1, [fp, #-12]
ldr r3, [fp, #-8]
cmp r3, #1
bne .L127
ldr r2, [fp, #-12]
ldr r3, .L129
cmp r2, r3
bne .L127
ldr r0, .L129+4
bl _ZNSt8ios_base4InitC1Ev
ldr r0, .L129+4
ldr r1, .L129+8
ldr r2, .L129+12
bl __aeabi_atexit
ldr r0, .L129+16
bl _ZNSt6vectorIiSaIiEEC1Ev
ldr r0, .L129+16
ldr r1, .L129+20
ldr r2, .L129+12
bl __aeabi_atexit
ldr r0, .L129+24
bl _ZNSt6vectorIiSaIiEEC1Ev
ldr r0, .L129+24
ldr r1, .L129+20
ldr r2, .L129+12
bl __aeabi_atexit
.L127:
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.L130:
.align 2
.L129:
.word 65535
.word _ZStL8__ioinit
.word _ZNSt8ios_base4InitD1Ev
.word __dso_handle
.word X
.word _ZNSt6vectorIiSaIiEED1Ev
.word Y
.cantunwind
.fnend
.size _Z41__static_initialization_and_destruction_0ii, .-_Z41__static_initialization_and_destruction_0ii
.section .text._ZNSt6vectorIiSaIiEED2Ev,"axG",%progbits,_ZNSt6vectorIiSaIiEED5Ev,comdat
.align 2
.weak _ZNSt6vectorIiSaIiEED2Ev
.type _ZNSt6vectorIiSaIiEED2Ev, %function
_ZNSt6vectorIiSaIiEED2Ev:
.fnstart
.LFB1286:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {r4, r5, fp, lr}
.save {r4, r5, fp, lr}
.setfp fp, sp, #12
add fp, sp, #12
.pad #8
sub sp, sp, #8
str r0, [fp, #-16]
ldr r3, [fp, #-16]
ldr r5, [r3, #0]
ldr r3, [fp, #-16]
ldr r4, [r3, #4]
ldr r3, [fp, #-16]
mov r0, r3
bl _ZNSt12_Vector_baseIiSaIiEE19_M_get_Tp_allocatorEv
mov r3, r0
mov r0, r5
mov r1, r4
mov r2, r3
.LEHB8:
bl _ZSt8_DestroyIPiiEvT_S1_RSaIT0_E
.LEHE8:
ldr r3, [fp, #-16]
mov r0, r3
.LEHB9:
bl _ZNSt12_Vector_baseIiSaIiEED2Ev
.LEHE9:
ldr r3, [fp, #-16]
b .L136
.L135:
ldr r3, [fp, #-16]
mov r0, r3
bl _ZNSt12_Vector_baseIiSaIiEED2Ev
.LEHB10:
bl __cxa_end_cleanup
.LEHE10:
.L136:
mov r0, r3
sub sp, fp, #12
ldmfd sp!, {r4, r5, fp, pc}
.personality __gxx_personality_v0
.handlerdata
.LLSDA1286:
.byte 0xff
.byte 0xff
.byte 0x1
.uleb128 .LLSDACSE1286-.LLSDACSB1286
.LLSDACSB1286:
.uleb128 .LEHB8-.LFB1286
.uleb128 .LEHE8-.LEHB8
.uleb128 .L135-.LFB1286
.uleb128 0
.uleb128 .LEHB9-.LFB1286
.uleb128 .LEHE9-.LEHB9
.uleb128 0
.uleb128 0
.uleb128 .LEHB10-.LFB1286
.uleb128 .LEHE10-.LEHB10
.uleb128 0
.uleb128 0
.LLSDACSE1286:
.section .text._ZNSt6vectorIiSaIiEED2Ev,"axG",%progbits,_ZNSt6vectorIiSaIiEED5Ev,comdat
.fnend
.size _ZNSt6vectorIiSaIiEED2Ev, .-_ZNSt6vectorIiSaIiEED2Ev
.weak _ZNSt6vectorIiSaIiEED1Ev
_ZNSt6vectorIiSaIiEED1Ev = _ZNSt6vectorIiSaIiEED2Ev
.section .text._ZNSt12_Vector_baseIiSaIiEE19_M_get_Tp_allocatorEv,"axG",%progbits,_ZNSt12_Vector_baseIiSaIiEE19_M_get_Tp_allocatorEv,comdat
.align 2
.weak _ZNSt12_Vector_baseIiSaIiEE19_M_get_Tp_allocatorEv
.type _ZNSt12_Vector_baseIiSaIiEE19_M_get_Tp_allocatorEv, %function
_ZNSt12_Vector_baseIiSaIiEE19_M_get_Tp_allocatorEv:
.fnstart
.LFB1288:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #12
str r0, [fp, #-8]
ldr r3, [fp, #-8]
mov r0, r3
add sp, fp, #0
ldmfd sp!, {fp}
bx lr
.cantunwind
.fnend
.size _ZNSt12_Vector_baseIiSaIiEE19_M_get_Tp_allocatorEv, .-_ZNSt12_Vector_baseIiSaIiEE19_M_get_Tp_allocatorEv
.section .text._ZSt8_DestroyIPiiEvT_S1_RSaIT0_E,"axG",%progbits,_ZSt8_DestroyIPiiEvT_S1_RSaIT0_E,comdat
.align 2
.weak _ZSt8_DestroyIPiiEvT_S1_RSaIT0_E
.type _ZSt8_DestroyIPiiEvT_S1_RSaIT0_E, %function
_ZSt8_DestroyIPiiEvT_S1_RSaIT0_E:
.fnstart
.LFB1289:
@ args = 0, pretend = 0, frame = 16
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
.save {fp, lr}
.setfp fp, sp, #4
add fp, sp, #4
.pad #16
sub sp, sp, #16
str r0, [fp, #-8]
str r1, [fp, #-12]
str r2, [fp, #-16]
ldr r0, [fp, #-8]
ldr r1, [fp, #-12]
bl _ZSt8_DestroyIPiEvT_S1_
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.fnend
.size _ZSt8_DestroyIPiiEvT_S1_RSaIT0_E, .-_ZSt8_DestroyIPiiEvT_S1_RSaIT0_E
.section .text._ZSt8_DestroyIPiEvT_S1_,"axG",%progbits,_ZSt8_DestroyIPiEvT_S1_,comdat
.align 2
.weak _ZSt8_DestroyIPiEvT_S1_
.type _ZSt8_DestroyIPiEvT_S1_, %function
_ZSt8_DestroyIPiEvT_S1_:
.fnstart
.LFB1290:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
add fp, sp, #4
sub sp, sp, #8
str r0, [fp, #-8]
str r1, [fp, #-12]
ldr r0, [fp, #-8]
ldr r1, [fp, #-12]
bl _ZNSt12_Destroy_auxILb1EE9__destroyIPiEEvT_S3_
sub sp, fp, #4
ldmfd sp!, {fp, pc}
.cantunwind
.fnend
.size _ZSt8_DestroyIPiEvT_S1_, .-_ZSt8_DestroyIPiEvT_S1_
.section .text._ZNSt12_Destroy_auxILb1EE9__destroyIPiEEvT_S3_,"axG",%progbits,_ZNSt12_Destroy_auxILb1EE9__destroyIPiEEvT_S3_,comdat
.align 2
.weak _ZNSt12_Destroy_auxILb1EE9__destroyIPiEEvT_S3_
.type _ZNSt12_Destroy_auxILb1EE9__destroyIPiEEvT_S3_, %function
_ZNSt12_Destroy_auxILb1EE9__destroyIPiEEvT_S3_:
.fnstart
.LFB1291:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
@ link register save eliminated.
str fp, [sp, #-4]!
add fp, sp, #0
sub sp, sp, #12
str r0, [fp, #-8]
str r1, [fp, #-12]
add sp, fp, #0
ldmfd sp!, {fp}
bx lr
.cantunwind
.fnend
.size _ZNSt12_Destroy_auxILb1EE9__destroyIPiEEvT_S3_, .-_ZNSt12_Destroy_auxILb1EE9__destroyIPiEEvT_S3_
.text
.align 2
.type _GLOBAL__sub_I_lock, %function
_GLOBAL__sub_I_lock:
.fnstart
.LFB1292:
@ args = 0, pretend = 0, frame = 0
@ frame_needed = 1, uses_anonymous_args = 0
stmfd sp!, {fp, lr}
add fp, sp, #4
mov r0, #1
ldr r1, .L143
bl _Z41__static_initialization_and_destruction_0ii
ldmfd sp!, {fp, pc}
.L144:
.align 2
.L143:
.word 65535
.cantunwind
.fnend
.size _GLOBAL__sub_I_lock, .-_GLOBAL__sub_I_lock
.section .init_array,"aw",%init_array
.align 2
.word _GLOBAL__sub_I_lock(target1)
.hidden __dso_handle
.ident "GCC: (Ubuntu/Linaro 4.7.3-12ubuntu1) 4.7.3"
.section .note.GNU-stack,"",%progbits
| 19.695722 | 140 | 0.644158 |
bf9394927e79e08a3f45bf2bb53997d04b65c4fb | 342 | asm | Assembly | programs/oeis/224/A224667.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/224/A224667.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/224/A224667.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A224667: Number of 5 X 5 0..n matrices with each 2 X 2 subblock idempotent.
; 196,260,332,412,500,596,700,812,932,1060,1196,1340,1492,1652,1820,1996,2180,2372,2572,2780,2996,3220,3452,3692,3940,4196,4460,4732,5012,5300,5596,5900,6212,6532,6860,7196,7540,7892,8252,8620,8996,9380,9772,10172
mov $1,$0
add $0,15
mul $1,$0
add $1,49
mul $1,4
| 38 | 213 | 0.736842 |
f11fb411e165d363eaa0e2e43b3b9301f004f3e0 | 133,259 | asm | Assembly | base/mvdm/dpmi/dxintr.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/mvdm/dpmi/dxintr.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/mvdm/dpmi/dxintr.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | PAGE ,132
TITLE DXINTR.ASM -- Dos Extender Interrupt Reflector
; Copyright (c) Microsoft Corporation 1988-1991. All Rights Reserved.
;****************************************************************
;* *
;* DXINTR.ASM - Dos Extender Interrupt Reflector *
;* *
;****************************************************************
;* *
;* Revision History: *
;* *
;* *
;* 09/13/90 earleh Fault handlers Ring 0 *
;* 09/06/90 earleh Fault handlers DPMI compliant *
;* PIC remapping no longer required *
;* 08/08/90 earleh DOSX and client privilege ring determined *
;* by equate in pmdefs.inc *
;* 05/09/90 jimmat Started VCPI changes. *
;* 04/02/90 jimmat Added PM Int 70h handler. *
;* 01/08/90 jimmat Don't allow nested PS/2 mouse interrupts *
;* (later removed!) *
;* 09/15/89 jimmat Support for 'Classic' HP Vectras which *
;* have 3 8259 interrupt controllers *
;* 07/28/89 jimmat Save A20 state when reflecting an int to *
;* protected mode, removed Int 30h handler *
;* that did code patch-ups, point debugger *
;* to faulting instruction, not Int 3. *
;* 07/13/89 jimmat Improved termination due to faults when *
;* not running under a debugger--also ifdef'd *
;* out code to dynamically fixup code seg *
;* references on GP faults *
;* 06/05/89 jimmat Ints 0h-1Fh are now vectored through a 2nd *
;* table. This allows Wdeb386 interaction *
;* more like Windows/386. *
;* 05/23/89 jimmat Added wParam & lParam to interrupt frame. *
;* 05/07/89 jimmat Added XMScontrol function to map protected *
;* mode XMS requests to real mode driver. *
;* 05/02/89 jimmat 8259 interrupt mask saved around changing *
;* of hardware interrupt base *
;* 04/24/89 jimmat Added support for PS/2 Int 15h/C2h/07 Set *
;* Pointing Device Handler Address function *
;* 04/12/89 jimmat Added PMIntr24 routine to support PM *
;* Critical Error Handlers *
;* 03/15/89 jimmat Added INT 31h LDT/heap interface a la *
;* Windows/386 *
;* 03/14/89 jimmat Changes to run child in ring 1 with LDT *
;* 02/24/89 (GeneA): fixed problem in IntEntryVideo and *
;* IntExitVideo for processing function 10h subfunction *
;* for reading and writing the VGA palette. *
;* 02/22/89 (GeneA): added handlers for Int 10h, Int 15h, and *
;* Int 33h. Added support for more general mechanism for *
;* handling interrupts require special servicing and *
;* allowing nesting of these interrupts. Allocation and *
;* deallocation of stack frames is supported to allow *
;* nested paths through the interrupt reflection code to *
;* a depth of 8. *
;* There is still a problem that if an interrupt handler *
;* is using a static buffer to transfer data, another *
;* interrupt that uses the same static buffer could come *
;* in and trash it. Solving the problem in a completely *
;* general way would require having a buffer allocation *
;* deallocation scheme for doing the transfers between *
;* real mode memory and protected mode memory. *
;* 02/14/89 (GeneA): added code in TrapGP to print error msg *
;* and quit when running a non-debugging version. *
;* 02/10/89 (GeneA): changed Dos Extender from small model to *
;* medium model. Added function LoaderTrap to handle *
;* loader interrupts when the program contains overlays. *
;* 11/20/88 (GeneA): changed both RM and PM interrupt reflector*
;* routines to pass the flags returned by the ISR back to *
;* the originator of the interrupt, rather than returning *
;* the original flags. *
;* 10/28/88 (GeneA): created *
; 18-Dec-1992 sudeepb Changed cli/sti to faster FCLI/FSTI
;* *
;****************************************************************
.286p
.287
; -------------------------------------------------------
; INCLUDE FILE DEFINITIONS
; -------------------------------------------------------
.xlist
.sall
include segdefs.inc
include gendefs.inc
include pmdefs.inc
include interupt.inc
ifdef WOW_x86
include vdmtib.inc
endif
.list
include intmac.inc
include stackchk.inc
include bop.inc
include dpmi.inc
; -------------------------------------------------------
; GENERAL SYMBOL DEFINITIONS
; -------------------------------------------------------
; -------------------------------------------------------
; EXTERNAL SYMBOL DEFINITIONS
; -------------------------------------------------------
extrn EnterRealMode:NEAR
extrn EnterProtectedMode:NEAR
extrn ParaToLinear:NEAR
externFP NSetSegmentDscr
ifdef NEC_98
extrn GetSegmentAddress:NEAR
endif ;NEC_98
extrn ParaToLDTSelector:NEAR
; -------------------------------------------------------
; DATA SEGMENT DEFINITIONS
; -------------------------------------------------------
DXDATA segment
extrn pmusrss:WORD
extrn pmusrsp:WORD
extrn npXfrBuf1:WORD
extrn rgbXfrBuf0:BYTE
extrn rgbXfrBuf1:BYTE
extrn lpfnXMSFunc:DWORD
extrn Int28Filter:WORD
extrn DpmiFlags:WORD
IFDEF WOW_x86
extrn FastBop:fword
ENDIF
;
; Variables used to store register values while mode switching.
public regUserSS, regUserSP, regUserFL, regUserAX, regUserDS
public regUserES
regUserSS dw ?
regUserSP dw ?
regUserCS dw ?
regUserIP dw ?
regUserFL dw ?
regUserAX dw ?
regUserDS dw ?
regUserES dw ?
pfnReturnAddr dw ?
Int28Count dw -1 ;Count of idle Int 28h's not reflected to RM
;
; Far pointer to the user's mouse callback function.
public lpfnUserMouseHandler
lpfnUserMouseHandler dd 0 ;Entry point to the users mouse handler
cbMouseState dw 0 ;size of mouse state buffer in bytes
; Far pointer to PS/2 Pointing device handler address
public lpfnUserPointingHandler
lpfnUserPointingHandler dd 0 ;Sel:Off to user's handler
align 2
if DEBUG
extrn StackGuard:WORD
endif
extrn pbReflStack:WORD
extrn bReflStack:WORD
;
; This buffer contains the original real mode interrupt vectors.
ifdef NEC_98
public rglpfnRmISR
endif ;NEC_98
align 2
rglpfnRmISR dd 256 dup (?)
; PMFaultVector is a table of selector:offsets for routines to process
; protected mode processor faults/traps/exceptions. If we don't handle
; the exception as an exception, we vector it through PMReservedEntryVector.
FltRtn macro off
dw DXPMCODE:off
dw 0
dw SEL_DXPMCODE or STD_RING
dw 0
endm
public PMFaultVector
align 4
PMFaultVector label DWORD
FltRtn PMFaultEntryVector+5*0h ; int 0
FltRtn PMFaultEntryVector+5*1h ; int 1
FltRtn PMFaultEntryVector+5*2h ; int 2
FltRtn PMFaultEntryVector+5*3h ; int 3
FltRtn PMFaultEntryVector+5*4h ; int 4
FltRtn PMFaultEntryVector+5*5h ; int 5
FltRtn PMFaultEntryVector+5*6h ; int 6
FltRtn PMFaultEntryVector+5*7h ; int 7
FltRtn PMFaultEntryVector+5*8h ; int 8
FltRtn PMFaultEntryVector+5*9h ; int 9
FltRtn PMFaultEntryVector+5*0Ah ; int a
FltRtn PMFaultEntryVector+5*0Bh ; int b
FltRtn PMFaultEntryVector+5*0Ch ; int c
FltRtn PMFaultEntryVector+5*0Dh ; int d
FltRtn PMFaultEntryVector+5*0Eh ; int e
FltRtn PMFaultEntryVector+5*0Fh ; int f
FltRtn PMFaultEntryVector+5*10h ; int 10h
FltRtn PMFaultEntryVector+5*11h ; int 11h
FltRtn PMFaultEntryVector+5*12h ; int 12h
FltRtn PMFaultEntryVector+5*13h ; int 13h
FltRtn PMFaultEntryVector+5*14h ; int 14h
FltRtn PMFaultEntryVector+5*15h ; int 15h
FltRtn PMFaultEntryVector+5*16h ; int 16h
FltRtn PMFaultEntryVector+5*17h ; int 17h
FltRtn PMFaultEntryVector+5*18h ; int 18h
FltRtn PMFaultEntryVector+5*19h ; int 19h
FltRtn PMFaultEntryVector+5*1Ah ; int 1ah
FltRtn PMFaultEntryVector+5*1Bh ; int 1bh
FltRtn PMFaultEntryVector+5*1Ch ; int 1ch
FltRtn PMFaultEntryVector+5*1Dh ; int 1Dh
FltRtn PMFaultEntryVector+5*1Eh ; int 1Eh
FltRtn PMFaultEntryVector+5*1Fh ; int 1Fh
extrn npEHStackLimit:word
extrn npEHStacklet:word
ifdef NEC_98
extrn fPCH98:BYTE
endif ;NEC_98
IFDEF WOW
public Wow16BitHandlers
Wow16BitHandlers dw 256 dup (0,0)
ENDIF
DXDATA ends
DXSTACK segment
public rgw0Stack, rgw2FStack
dw 64 dup (?) ; INT 2Fh handler stack
rgw2FStack label word
dw 64 dup (?) ; DOSX Ring -> Ring 0 transition stack
;
; Interrupts in the range 0-1fh cause a ring transition and leave
; an outer ring IRET frame right here.
;
Ring0_EH_DS dw ? ; place to put user DS
Ring0_EH_AX dw ? ; place to put user AX
Ring0_EH_BX dw ? ; place to put user BX
Ring0_EH_CX dw ? ; place to put user CX
Ring0_EH_BP dw ? ; place to put user BP
Ring0_EH_PEC dw ? ; lsw of error code for 386 page fault
; also near return to PMFaultEntryVector
Ring0_EH_EC dw ? ; error code passed to EH
Ring0_EH_IP dw ? ; interrupted code IP
Ring0_EH_EIP dw ? ; high half eip
Ring0_EH_CS dw ? ; interrupted code CS
dw ? ; high half of cs
Ring0_EH_Flags dw ? ; interrupted code flags
Ring0_EH_EFlags dw ? ; high half of flags
Ring0_EH_SP dw ? ; interrupted code SP
Rin0_EH_ESP dw ? ; high half of esp
Ring0_EH_SS dw ? ; interrupted code SS
dw ? ; high half of ss
rgw0Stack label word
dw 64 dup (?) ; stack for switching to ring0
public ResetStack
ResetStack label word
ifdef WOW_x86
dw 64 dup (?) ; wow stack for initial int field
public rgwWowStack
rgwWowStack label word
endif
DXSTACK ends
; -------------------------------------------------------
; CODE SEGMENT VARIABLES
; -------------------------------------------------------
DXCODE segment
extrn selDgroup:WORD
DXCODE ends
DXPMCODE segment
extrn selDgroupPM:WORD
extrn segDXCodePM:WORD
extrn RZCall:NEAR
extrn segDXDataPM:WORD
DXPMCODE ends
; -------------------------------------------------------
page
subttl Protected Mode Interrupt Reflector
; -------------------------------------------------------
; PROTECTED MODE INTERRUPT REFLECTOR
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; PMIntrEntryVector -- This table contains a vector of
; near jump instructions to the protected mode interrupt
; reflector. The protected mode interrupt descriptor
; table is initialized so that all interrupts jump to
; locations in this table, which transfers control to
; the interrupt reflection code for reflecting the
; interrupt to real mode.
StartBopTable macro
?intr = 0
endm
PMIntrBop macro
DPMIBOP ReflectIntrToV86
db ?intr
?intr = ?intr+1
endm
public PMIntrEntryVector
PMIntrEntryVector:
StartBopTable
rept 256
PMIntrBop
endm
FaultBop macro
DPMIBOP DpmiUnhandledException
db ?intr
?intr = ?intr+1
endm
public PMFaultEntryVector
; -------------------------------------------------------
; PMFaultEntryVector -- This table contains a vector of
; near jump instructions to the protected mode fault
; analyzer.
;
PMFaultEntryVector:
StartBopTable
rept 32
FaultBop
endm
assume ds:nothing,es:nothing,ss:nothing
public PMFaultHandlerIRET
PMFaultHandlerIRET:
DPMIBOP FaultHandlerIret
public PMFaultHandlerIRETD
PMFaultHandlerIRETD:
DPMIBOP FaultHandlerIretd
public PMIntHandlerIRET
PMIntHandlerIRET:
DPMIBOP IntHandlerIret
public PMIntHandlerIRETD
PMIntHandlerIRETD:
DPMIBOP IntHandlerIretd
public PMDosxIret
PMDosxIret:
iret
public PMDosxIretd
PMDosxIretd:
db 66h
iret
public HungAppExit
HungAppExit:
mov ax,4CFFh
int 21h
; -------------------------------------------------------
DXPMCODE ends
; -------------------------------------------------------
subttl Real Mode Interrupt Reflector
page
; -------------------------------------------------------
; REAL MODE INTERRUPT REFLECTOR
; -------------------------------------------------------
DXCODE segment
assume cs:DXCODE
; -------------------------------------------------------
; RMIntrEntryVector -- This table contains a vector of
; near jump instructions to the real mode interrupt
; reflector. Real mode interrupts that have been hooked
; by the protected mode application have their vector
; set to entry the real mode reflector through this table.
public RMtoPMReflector
RMtoPMReflector:
DPMIBOP ReflectIntrToPM
public RMCallBackBop
RMCallBackBop proc far
DPMIBOP RMCallBackCall
ret ;finished!
RMCallBackBop endp
DXCODE ends
; -------------------------------------------------------
subttl INT 24h Critical Error Mapper
page
; -------------------------------------------------------
; DOS CRITICAL ERROR MAPPER
; -------------------------------------------------------
DXCODE segment
; -------------------------------------------------------
; RMDefaultInt24Handler -- Default action for a DOS critical
; error is to fail the call.
;
public RMDefaultInt24Handler
RMDefaultInt24Handler proc far
mov al,3
iret
RMDefaultInt24Handler endp
DXCODE ends
; -------------------------------------------------------
subttl INT 28h Idle Handler
page
; -------------------------------------------------------
; INT 28H IDLE HANDLER
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; PMIntr28 -- Protected mode handler for Idle Int 28h calls.
; The purpose of this routine is simply to cut down on the
; number of protected mode to real mode switches by ignoring
; many of the Int 28h idle calls made by the Windows PM
; kernel.
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntr28
PMIntr28 proc near
cld
push ds ;address our DGROUP
mov ds,selDgroupPM
assume ds:DGROUP
cmp Int28Filter,0 ;are we passing any through?
jz @f
inc Int28Count ;should this one be reflected?
jz i28_reflect
@@:
pop ds
iret ; no, just ignore it
i28_reflect: ; yes, reset count and
push ax ; reflecto to real mode
mov ax,Int28Filter
neg ax
mov Int28Count,ax
pop ax
pop ds
assume ds:NOTHING
jmp PMIntrEntryVector + 5*28h
PMIntr28 endp
; -------------------------------------------------------
; PMIntr31 -- Service routine for the Protect Mode INT 31h
; services. These functions duplicate the
; Windows/386 VMM INT 31h services for protected
; mode applications. They were implemented to
; support a protect mode version of Windows/286.
;
; Input: Various registers
; Output: Various registers
; Errors:
; Uses: All registers preserved, other than return values
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntr31
PMIntr31 proc near
push ds
push ax
mov ax,SEL_DXDATA OR STD_RING
mov ds,ax
assume ds:DGROUP
pop ax
FBOP BOP_DPMI,Int31Entry,FastBop
int 3
; This BOP does an implicit IRET
PMIntr31 endp
; -------------------------------------------------------
subttl Ignore Interrupt Handlers
page
; -------------------------------------------------------
; IGNORE INTERRUPT HANDLER
; -------------------------------------------------------
; PMIntrIgnore -- Service routine for protected mode interrupts
; that should be ignored, and not reflected to real mode.
; Currently used for:
;
; Int 30h - used to be Win/386 Virtualize I/O, now
; unused but no int handler in real mode
; Int 41h - Wdeb386 interface, no int handler in
; real mode
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrIgnore
PMIntrIgnore proc near
iret
PMIntrIgnore endp
; -------------------------------------------------------
public PMIntr19
PMIntr19 proc near
push offset DXPMCODE:Reboot
call RZCall
bpRebootIDT df 0
Reboot:
mov ax,40h
mov es,ax
mov word ptr es:[0072h],1234h
lidt bpRebootIDT
int 3
PMIntr19 endp
DXPMCODE ends
; -------------------------------------------------------
subttl XMS Driver Interface
page
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; XMScontrol - This function implements a protected mode
; interface to a real mode XMS driver. Unlike other
; routines in this module, this routine is called by
; the user, not invoked via an INT instruction.
;
; Input: User's regs for XMS driver
; Output: regs from XMS driver
; Uses: none
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public XMScontrol
XMScontrol proc far
jmp short XMSentry ;'standard' XMS control function
nop ; just to be consistant
nop
nop
XMSentry:
; Modify the stack so it looks like we got here via an INT (except that
; we may still have interrupts enabled)
pushf
cld
push bp
mov bp,sp ;bp -> [BP] [FL] [IP] [CS]
push ax
push bx
mov ax,[bp+4]
mov bx,[bp+6]
xchg ax,[bp+2]
mov [bp+4],bx
mov [bp+6],ax ;bp -> [BP] [IP] [CS] [FL]
pop bx
pop ax
pop bp
; We don't support XMS function 0Bh (Move Extended Memory Block) because
; it requires mapping of data between hi/low memory. Maybe someday...
cmp ah,0Bh
jnz xms_2
xms_deny:
xor ax,ax ;if function 0Bh, return failure
mov bl,80h ; (ax = 0, bl = 80h-not implemented)
jmp short XMSret
xms_2:
; We are not really an Int handler, but close enough...
call EnterIntHandler ;build an interrupt stack frame
assume ds:DGROUP,es:DGROUP ; also sets up addressability
SwitchToRealMode
pop es ;load regs for driver
pop ds
assume ds:NOTHING,es:NOTHING,ss:DGROUP
popa
npopf
call lpfnXMSFunc ;call real mode driver
pushf ;rebuild stack frame
FCLI
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
call LeaveIntHandler
assume ds:NOTHING,es:NOTHING,ss:NOTHING
XMSret:
riret
XMScontrol endp
; -------------------------------------------------------
DXPMCODE ends
; -------------------------------------------------------
subttl Special Interrupt Handler Routines
page
; -------------------------------------------------------
;
; The following sets of routines handle interrupts that
; are function call interfaces and require special servicing
; by the Dos Extender. These interrupts are such things as
; the mouse driver function call interrupt, various PC BIOS
; function call interrupts, etc. Note that INT 21h (the Dos
; function call interrupt) is not handled here. These
; interrupts typically require that register values be modified
; and parameter data be copied between real mode memory and
; extended memory. The following conventions are used for these
; interrupt function handler routines.
;
; A stack is allocated from the interrupt reflector stack for these
; routines to use. This allows nested servicing of interrupts.
; A stack frame is built in the allocated stack which contains the
; following information:
; original caller's stack address
; caller's original flags and general registers (in pusha form)
; caller's original segment registers (DS & ES)
; flags and general registers to be passed to interrupt routine
; (initially the same as caller's original values)
; segment registers (DS & ES) to be passed to interrupt routine
; (initially set to the Dos Extender data segment address)
; This stack frame is built by the routine EnterIntHandler, and its
; format is defined by the structure INTRSTACK. The stack frame is
; destroyed and the processor registers set up for return to the user
; by the function LeaveIntHandler.
;
; For each interrupt, there is an entry function and an exit function.
; The entry function performs any modifications to parameter values and
; data buffering necessary before the interrupt service routine is called.
; The exit function performs any data buffering and register value
; modifications after return from the interrupt service routine.
;
; There are two sets of general registers and two sets of segment
; registers (DS & ES) on the stack frame. One set of register values
; has member names of the form intUserXX. The values in these stack
; frame members will be passed to the interrupt service routine when
; it is called, and will be loaded with the register values returned
; by the interrupt service routine. The other set of registers values
; has member names of the form pmUserXX. These stack frame members
; contain the original values in the registers on entry from the
; user program that called the interrupt.
;
; When we return to the original caller, we want to pass back the
; general registers as returned by the interrupt routine (and possibly
; modified by the exit handler), and the same segment registers as
; on entry, unless the interrupt routine returns a value in a segment
; register. (in this case, there must be some code in the exit routine
; to handle this). This means that when we return to the caller, we
; return the general register values from the intUserXX set of stack
; frame members, but we return the segment registers from the pmUserXX
; set of frame members. By doing it this way, we don't have to do
; any work for the case where the interrupt subfuntion doesn't require
; any parameter manipulation. NOTE however, this means that when
; manipulating register values to be returned to the user, the segment
; registers are treated opposite to the way the general registers are
; treated. For general registers, to return a value to the user,
; store it in a intUserXX stack frame member. To return a segment
; value to the user, store it in a pmUserXX stack frame member.
;
; -------------------------------------------------------
subttl BIOS Video Interrupt (Int 10h) Service Routine
page
; -------------------------------------------------------
; BIOS VIDEO INTERRUPT (INT 10h) SERVICE ROUTINE
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; PMIntrVideo - Entry point into interrupt reflector code
; for IBM PC Bios video (int 10h) calls.
;
; Input: normal registers for Bios calls
; Output: normal register returns for Bios calls
; Errors: normal Bios errors
; Uses: as per Bios calls
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrVideo
PMIntrVideo:
ifdef NEC_98
cmp ah,40h
jb CRT_bios
cmp ah,4Fh ;4Bh-4Fh = Reserve
ja CRT_bios
jmp PMIntrGBIO
CRT_bios:
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryVideo
@@:
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*18h] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
;; test fPCH98,0FFh
;; jz NotNPCVideoExit ;for PC-H98 modelxx
;; call IntExitVideoNPC ; "
;; jmp @f ; "
;;NotNPCVideoExit: ; "
call IntExitVideo
@@:
;
; And return to the original caller.
call LeaveIntHandler
iret
;/////////////////////////////////////////////////////////////////////////
; Nmode GRAPH BIOS
;/////////////////////////////////////////////////////////////////////////
; -------------------------------------------------------
; PMIntrGBIO
;--------------------------------------------------------
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrGBIO
PMIntrGBIO:
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
push ax
mov ax,[bp].pmUserDS
call GetSegmentAddress
shr dx,4
shl bx,12
or bx,dx ;bx now = seg of parent psp
mov [bp].intUserDS,bx
pop ax
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*18h] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov ax,ss
mov ds,ax
mov es,ax
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
push ax
mov ax,[bp].pmUserDS
mov [bp].intUserDS,ax
pop ax
;
; And return to the original caller.
call LeaveIntHandler
iret
else ;!NEC_98
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryVideo
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
sub sp,8 ; make room for stack frame
push bp
mov bp,sp
push es
push ax
xor ax,ax
mov es,ax
mov [bp + 8],cs
mov word ptr [bp + 6],offset piv_10
mov ax,es:[10h*4]
mov [bp + 2],ax
mov ax,es:[10h*4 + 2]
mov [bp + 4],ax
pop ax
pop es
pop bp
retf
piv_10: pushf
FCLI
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
call IntExitVideo
;
; And return to the original caller.
call LeaveIntHandler
riret
endif ;!NEC_98
; -------------------------------------------------------
; IntEntryVideo -- This routine performs any register
; fixups and data copying needed on entry to the
; PC BIOS video interrupt (Int 10h)
;
; Input: register values on stack frame
; Output: register values on stack frame
; Errors: none
; Uses: any registers modified,
; possibly modifies buffers rgbXfrBuf0 or rgbXfrBuf1
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntryVideo
IntEntryVideo:
ifdef NEC_98
;video mode
cmp ah,0Fh
jnz ienv10
mov cx,16
jmp ienv70
ienv10:
cmp ah,14h
jnz ienv20
jmp ienv80
ienv20:
cmp ah,1Fh
jnz ienv30
jmp ienv110
ienv30:
cmp ah,1Ah
jnz ienv40
test fPCH98,0FFh
jnz H98_FontWrite_N
mov cx,34
jmp ienv70
ienv40:
cmp ah,20h
jnz ienv90
test fPCH98,0FFh
jnz @f
mov cx,72
jmp ienv100
@@:
jmp H98_FontWrite_H
ienv70:
push ds
mov si,[bp].pmUserCX ;offset address
mov ds,[bp].pmUserBX ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
ienv80:
push ax
mov ax,segDXDataPM
mov [bp].intUserBX,ax ;segment address
pop ax
mov [bp].intUserCX,offset DGROUP:rgbXfrBuf1
ienv90:
ret
ienv100:
push ds
mov si,[bp].pmUserBX ;offset address
mov ds,[bp].pmUserDS ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
ienv110:
push ax
mov ax,segDXDataPM
mov [bp].intUserDS,ax ;segment address
pop ax
mov [bp].intUserBX,offset DGROUP:rgbXfrBuf1
ienv120:
ret
H98_FontWrite_N:
cmp dx,7601h
jb @f
cmp dx,767Fh
jna WUSKZEN
cmp dx,7701h
jb @f
cmp dx,777Fh
jna WUSKZEN
cmp dx,7801h
jb @f
cmp dx,783Fh
;;;;;;;; ja ienv35
jna WUSKZEN
jmp ienv35
WUSKZEN:
mov cx,34
jmp ienv70
@@:
jmp ienv40
ienv35:
cmp dx,7840h
jb @b
cmp dx,787Fh
jna WUSKHAN
cmp dx,7D01h
jb @b
cmp dx,7D7Fh
jna WUSKHAN
cmp dx,7E01h
jb @b
cmp dx,7E7Fh
;;;;;;;; ja @b
jna WUSKHAN
jmp @b
WUSKHAN:
mov cx,18
jmp ienv70
H98_FontWrite_H:
cmp dx,7601h
jb @f
cmp dx,767Fh
jna HWUSKZEN
cmp dx,7701h
jb @f
cmp dx,777Fh
jna HWUSKZEN
cmp dx,7801h
jb @f
cmp dx,783Fh
;;;;;;;; ja @f
jna HWUSKZEN
jmp ienv45
HWUSKZEN:
;;;;;;;; mov cx,74
mov cx,72
jmp ienv100
@@:
jmp ienv90
ienv45:
cmp dx,7840h
jb @f
cmp dx,787Fh
jna HWUSKHAN
cmp dx,7D01h
jb @f
cmp dx,7D7Fh
jna HWUSKHAN
cmp dx,7E01h
jb @f
cmp dx,7E7Fh
;;;;;;;; ja @f
jna HWUSKHAN
jmp @f
HWUSKHAN:
;;;;;;;; mov cx,50
mov cx,48
jmp ienv100
@@:
ret
else ;!NEC_98
cmp ah,10h
jnz ienv20
;
; Video palette control function. Check for subfunctions that require
; special actions.
ienv10: cmp al,2 ;update all palette registers?
jnz @F
mov cx,17 ;palette data is 17 bytes long
jmp short ienv70 ;go copy the data
;
@@: cmp al,9 ;read all palette registers
jz ienv72
;
cmp al,12h ;update video DAC color registers
jnz @F
mov cx,[bp].pmUserCX ;count of table entries is in caller CX
add cx,cx ;each entry is 3 bytes long
add cx,[bp].pmUserCX
jmp short ienv70 ;go copy the data down
@@: cmp al,17h ;read a block of video DAC registers
jz ienv72
;
jmp short ienv90
;
;
ienv20: cmp ah,11h
jnz ienv30
;
; Character generator interface function.
; NOTE: a number of subfunctions of function 11h need to have munging
; and data buffering performed. However, function 30h is the only
; one used by Codeview, so this is the only one currently implemented.
; For this one, nothing needs to be done on entry, only on exit.
jmp short ienv90
;
;
ienv30: cmp ah,1Bh
jnz ienv40
;
; Video BIOS functionality/state information.
; On entry, we need to fix up ES:DI to point to our buffer.
mov [bp].intUserDI,offset DGROUP:rgbXfrBuf0
jmp short ienv90
;
;
ienv40:
jmp short ienv90
;
; Copy the buffer from the user ES:DX to our transfer buffer and set
; the value to DX passed to the interrupt routine to point to our buffer.
ienv70: cld
jcxz ienv90
push ds
mov si,[bp].pmUserDX
mov ds,[bp].pmUserES
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
;
ienv72: mov [bp].intUserDX,offset DGROUP:rgbXfrBuf1
jmp short ienv90
;
; All done
ienv90:
ret
endif ;!NEC_98
; -------------------------------------------------------
; IntExitVideo: This routine performs any register
; fixups and data copying needed on exit from the
; PC BIOS video interrupt (Int 10h).
;
; Input: register values on stack frame
; Output: register values on stack frame
; Errors: none
; Uses: any registers modified
; possibly modifies buffers rgbXfrBuf0 or rgbXfrBuf1
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitVideo
IntExitVideo:
ifdef NEC_98
;video mode
cmp ah,0Fh
jnz iexv10
jmp iexv80
iexv10:
cmp ah,14h
jnz iexv20
cmp dh,00h
jnz iexv11
mov cx,10
jmp iexv70
iexv11:
cmp dh,80h ;ANK(7*13)
jnz iexv12
mov cx,18
jmp iexv70
iexv12:
test fPCH98,0FFh
jnz @f
cmp dx,2920h
jb iexv13
cmp dx,297dh
ja iexvhan1
mov cx,18
jmp iexv70
iexvhan1:
cmp dx,2a20h
jb iexv13
cmp dx,2a5fh
ja iexv13
mov cx,18
jmp iexv70
@@:
jmp H98_FontRead_N
iexv13:
mov cx,34
jmp iexv70
iexv20:
cmp ah,1Fh
jnz iexv30
cmp dh,00h
jnz iexv21
mov cx,48
jmp iexv100
iexv21:
test fPCH98,0FFh
jnz @f
cmp dx,2920h
jb Hmode_han1
cmp dx,297dh
ja Hmode_han1
mov cx,48
jmp iexv100
Hmode_han1:
cmp dx,2a20h
jb iexv22
cmp dx,2a5fh
ja iexv22
mov cx,48
jmp iexv100
@@:
jmp H98_FontRead_H
iexv22:
mov cx,72
jmp iexv100
iexv30:
cmp ah,1Ah
jnz iexv40
jmp iexv80
iexv40:
cmp ah,20h
jnz iexv90
jmp iexv110
iexv70:
cld
push es
mov di,[bp].pmUserCX
mov es,[bp].pmUserBX
mov si,offset DGROUP:rgbXfrBuf1
rep movsb
pop es
;
; Restore the caller's CX
iexv80:
push ax
mov ax,[bp].pmUserBX ;BX regster restor
mov [bp].intUserBX,ax
;------------------------------------------------------------
mov ax,[bp].pmUserCX
mov [bp].intUserCX,ax
pop ax
iexv90:
ret
iexv100:
cld
push es
mov di,[bp].pmUserBX
mov es,[bp].pmUserDS
mov si,offset DGROUP:rgbXfrBuf1
rep movsb
pop es
;
; Restore the caller's CX
iexv110:
push ax
mov ax,[bp].pmUserDS ;BX regster restor
mov [bp].intUserDS,ax
;------------------------------------------------------------
mov ax,[bp].pmUserBX
mov [bp].intUserBX,ax
pop ax
iexv120:
ret
H98_FontRead_N:
cmp dx,2920h
jb iexvN15
cmp dx,297fh
jna iexvNhan
cmp dx,2a20h
jb iexvN15
cmp dx,2a7fh
jna iexvNhan
cmp dx,2b20h
jb iexvN15
cmp dx,2b7fh
jna iexvNhan
cmp dx,7840h
jb iexvN15
cmp dx,787fh
jna iexvNhan
cmp dx,7d01h
jb iexvN15
cmp dx,7d7fh
jna iexvNhan
cmp dx,7e01h
jb iexvN15
cmp dx,7e7fh
ja iexvN15
iexvNhan:
mov cx,18 ;16byte+2=18 ; jmp iexv70
iexvN15:
mov cx,34 ;32byte+2=34
jmp iexv70
H98_FontRead_H:
cmp dx,2920h
jb iexvN25
cmp dx,297fh
jna HiexvNhan
cmp dx,2a20h
jb iexvN25
cmp dx,2a7fh
jna HiexvNhan
cmp dx,2b20h
jb iexvN25
cmp dx,2b7fh
jna HiexvNhan
cmp dx,7840h
jb iexvN25
cmp dx,787fh
jna HiexvNhan
cmp dx,7d01h
jb iexvN25
cmp dx,7d7fh
jna HiexvNhan
cmp dx,7e01h
jb iexvN25
cmp dx,7e7fh
ja iexvN25
HiexvNhan:
;;;;;;;; mov cx,50 ;48byte+2=50
mov cx,48 ;48byte
;;;;;;;; jmp iexv70
jmp iexv100
iexvN25:
;;;;;;;; mov cx,74 ;72byte+2=74
mov cx,72 ;72byte
;;;;;;;; jmp iexv70
jmp iexv100
else ;!NEC_98
cmp ah,10h
jnz iexv20
;
; Palette control function.
cmp al,9 ;read palette data function
jnz @F
mov cx,17
jmp short iexv70
;
@@: cmp al,17h ;read video DAC registers
jnz @F
mov cx,[bp].pmUserCX ;each entry in table is 3 bytes long
add cx,cx
add cx,[bp].pmUserCX
jmp short iexv70
;
@@: jmp short iexv72
;
;
iexv20: cmp ah,11h
jnz iexv30
;
; Character generator interface function.
; NOTE: a number of subfunctions of function 11h need to have munging
; and data buffering performed. However, function 30h is the only
; one used by Codeview, so this is the only one currently implemented
cmp al,30h
jnz @F
mov ax,[bp].intUserES ;get the paragraph address returned by BIOS
mov bx,STD_DATA
call ParaToLDTSelector ;get a selector for that address
mov [bp].pmUserES,ax ;store the selector so that it will be
; returned to the caller
@@: jmp short iexv90
;
;
iexv30: cmp ah,1Bh
jnz iexv40
;
; Video BIOS functionality/state information.
; On exit, we need to fix up the pointer at the beginning of the
; data put in our buffer by the BIOS, and then transfer the buffer up
; to the user.
mov ax,word ptr rgbXfrBuf0[2] ;get segment of pointer to
; 'static functionallity table'
mov bx,STD_DATA
call ParaToLDTSelector ;convert paragraph to selector
mov word ptr rgbXfrBuf0[2],ax ;store back into table
push es
mov si,offset rgbXfrBuf0 ;pointer to our copy of the table
mov di,[bp].pmUserDI ;where the user wants it
mov [bp].intUserDi,di ;restore the DI returned to the user
mov es,[bp].pmUserES
mov cx,64 ;the table is 64 bytes long
cld
rep movsb ;copy the table to the user's buffer
pop es
jmp short iexv90
;
;
iexv40:
jmp short iexv90
;
; Copy data from our buffer to the caller's buffer pointed to by ES:DX
iexv70: cld
push es
mov di,[bp].pmUserDX
mov es,[bp].pmUserES
mov si,offset DGROUP:rgbXfrBuf1
rep movsb
pop es
;
; Restore the caller's DX
iexv72: mov ax,[bp].pmUserDX
mov [bp].intUserDX,ax
;
; All done
iexv90:
ret
endif ;!NEC_98
; -------------------------------------------------------
DXPMCODE ends
; -------------------------------------------------------
subttl BIOS Misc. Interrupt (Int 15h) Service Routine
page
; -------------------------------------------------------
; BIOS MISC. INTERRUPT (INT 15h) SERVICE ROUTINE
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; PMIntrMisc -- Entry point into the interrupt processing code
; for the BIOS misc functions interrupt (INT 15h).
;
; Input: normal registers for Bios calls
; Output: normal register returns for Bios calls
; Errors: normal Bios errors
; Uses: as per Bios calls
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrMisc
PMIntrMisc:
;
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryMisc
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
sub sp,8 ; make room for stack frame
push bp
mov bp,sp
push es
push ax
xor ax,ax
mov es,ax
mov [bp + 8],cs
mov word ptr [bp + 6],offset pim_10
mov ax,es:[15h*4]
mov [bp + 2],ax
mov ax,es:[15h*4 + 2]
mov [bp + 4],ax
pop ax
pop es
pop bp
retf
pim_10: pushf
FCLI
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
call IntExitMisc
;
; And return to the original caller.
call LeaveIntHandler
riret
; -------------------------------------------------------
; MISC INTERRUPT SUPPORT ROUTINES
; -------------------------------------------------------
;
; IntEntryMisc -- This function performs data transfer
; and register translation on entry to the BIOS Misc.
; functions interrupt. (INT 15h).
;
; Input: AX - BIOS function being performed
; Output:
; Errors:
; Uses: All registers preserved
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntryMisc
IntEntryMisc:
ifdef NEC_98
push cx
cmp ah,90h ;SYSTEM BIOS BLOCK MOVE
jnz iemDMA1 ;yes = jmp
jmp iem70
iemDMA1:
cmp ah,0D5h ;DMA BIOS DMA
jnz iemDMA2 ;yes = jmp
mov cx,8 ;DMA_CBIOS
jmp iem70
iemDMA2:
cmp ah,0D6h ;DMA BIOS DMA
jnz iemROM1 ;yes = jmp
jmp iem80 ;Read JMP
iemROM1:
cmp ah,0D8h ;ROM
jnz iemROM2 ;yes = jmp
mov cx,4
jmp iem70
iemROM2:
cmp ah,0D9h ;ROM
jnz iem90 ;yes = jmp
mov cx,8 ;ROM BIOS
iem70:
push ds
mov si,[bp].pmUserBX ;offset address
mov ds,[bp].pmUserES ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
iem80:
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
mov [bp].intUserBX,offset DGROUP:rgbXfrBuf1
iem90:
pop cx
ret
else ;!NEC_98
; Map requests to set the PS/2 Pointing Device Handler Address
cmp ax,0C207h ;PS/2 Set Pointing Device Handler adr?
jnz iem90
mov ax,[bp].pmUserBX ;User's ES:BX -> handler
mov word ptr lpfnUserPointingHandler,ax
mov ax,[bp].pmUserES
mov word ptr [lpfnUserPointingHandler+2],ax
mov ax,segDXCodePM ;pass BIOS address of our handler
mov [bp].intUserES,ax
mov ax,offset PointDeviceHandler
mov [bp].intUserBX,ax
iem90:
ret
endif ;!NEC_98
; -------------------------------------------------------
; IntExitMisc -- This function performs data transfer
; and register translation on exit from the BIOS Misc.
; Functions interrupt (INT 15h).
;
; Input: AX - BIOS function being performed
; Output:
; Errors:
; Uses: All registers preserved
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitMisc
IntExitMisc:
ifdef NEC_98
push cx
cmp ah,90h ;SYSTEM BIOS BLOCK MOVE
jnz ixmDMA1 ;yes = jmp
jmp ixm70
ixmDMA1:
cmp ah,0D5h ;DMA BIOS
jnz ixmDMA2 ;yes = jmp
jmp ixm70
ixmDMA2:
cmp ah,0D6h ;DMA BIOS DMA
jnz ixmROM1 ;yes = jmp
mov cx,16
jmp ixm80
ixmROM1:
cmp ah,0D8h ; ROM
jnz ixmROM2 ;yes = jmp
jmp ixm70
ixmROM2:
cmp ah,0D9h ; ROM
jnz ixm90
ixm70:
cld
push es
mov di,[bp].pmUserBX
mov es,[bp].pmUserES
mov si,offset DGROUP:rgbXfrBuf1
rep movsb
pop es
;
; Restore the caller's ES,BX
ixm80:
push ax
mov ax,[bp].pmUserES
mov [bp].intUserES,ax
mov ax,[bp].pmUserBX
mov [bp].intUserBX,ax
pop ax
ixm90:
pop cx
ret
else ;!NEC_98
push ax
push bx
push cx
push dx
;
; Check for function 0C0h - Return System Configuration Parameters
cmp ah,0C0h
jnz ixmi30
test [bp].intUserFL,1 ;check if the bios call returned an error
jnz ixmi90 ;(carry flag set in returned flags)
;
; The BIOS call succeeded. This means that ES:BX points to a configuration
; vector. We need to fix up the segment to be a selector.
mov dx,[bp].intUserES
cmp dx,0F000h ;does it point to normal BIOS segment
jnz ixmi22
mov ax,SEL_BIOSCODE or STD_RING
jmp short ixmi24
ixmi22: call ParaToLinear
mov cx,0FFFFh
mov ax,SEL_USERSCR or STD_TBL_RING
cCall NSetSegmentDscr,<ax,bx,dx,0,cx,STD_DATA>
ixmi24: mov [bp].pmUserES,ax
jmp short ixmi90
; Chack for function 0C207h - PS/2 Set Pointing Device Handler Address
ixmi30:
cmp ax,0C207h
jne ixmi90
mov ax,[bp].pmUserBX ;restore user's BX
mov [bp].intUserBX,ax
; All done
ixmi90:
pop dx
pop cx
pop bx
pop ax
ret
endif ;!NEC_98
; -------------------------------------------------------
DXPMCODE ends
; -------------------------------------------------------
subttl Mouse Function Interrupt (Int 33h) Service Routine
page
; -------------------------------------------------------
; MOUSE FUNCTION INTERRUPT (INT 33h) SERVICE ROUTINE
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; PMIntrMouse - Entry point into interrupt reflector code
; for mouse driver (int 33h) calls.
;
; Input: normal registers for mouse calls
; Output: normal register returns for mouse calls
; Errors: normal mouse errors
; Uses: as per mouse calls
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrMouse
PMIntrMouse:
;
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryMouse
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
sub sp,8 ; make room for stack frame
push bp
mov bp,sp
push es
push ax
xor ax,ax
mov es,ax
mov [bp + 8],cs
mov word ptr [bp + 6],offset pimo_10
mov ax,es:[33h*4]
mov [bp + 2],ax
mov ax,es:[33h*4 + 2]
mov [bp + 4],ax
pop ax
pop es
pop bp
retf
pimo_10: pushf
FCLI
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
call IntExitMouse
;
; And return to the original caller.
call LeaveIntHandler
riret
; -------------------------------------------------------
; MOUSE SUPPORT ROUTINES
; -------------------------------------------------------
; IntEntryMouse -- This function performs data transfer and
; register translation on entry to mouse driver functions.
; (INT 33h)
;
; Input: AX - mouse function being performed
; Output:
; Errors:
; Uses: NOTHING
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntryMouse
IntEntryMouse:
cld
push ax
push cx
push si
push di
;
cmp al,9 ;Set graphics cursor block?
jnz ment10
;
; The user is setting a graphics cursor. We need to copy the masks
; down to low memory so that the mouse driver can get at them and then
; fix up the pointer in DX.
mov cx,32
jmp short ment92
;
; Mouse interrupt handler establishment
ment10: cmp al,12 ;Set user defined interrupt subroutine ?
jnz ment20
;
; This command has the effect of causing a call to the address es:ds
; Whenever an event of one of the types specified by the mask in cx.
; The address es:dx must be saved in lpfnUserMouseHandler and the
; real mode address of MouseInterruptHandler substituted.
mov ax,[bp].pmUserDX ; Load users handler offset
mov word ptr lpfnUserMouseHandler,ax ; Store for future use
mov ax,[bp].pmUserES ; Load users handler segment value
mov word ptr lpfnUserMouseHandler + 2,ax ; Store for future use
mov ax,segDXCodePM ; Load real mode code segment value
mov [bp].intUserES,ax ; Store in real mode es register image
mov ax,offset MouseInterruptHandler ; Load handler offset
mov [bp].intUserDX,ax ; Store in real mode dx register image
jmp short ment99 ;Return
;
ment20: cmp al,20
jc ment99
jnz ment30
;
; This is the swap interrupt subroutine function. Not currently implemented
jmp short ment99
;
ment30: cmp al,22 ;Save mouse driver state?
jnz ment40
;
; This is the save mouse driver state function. We need to pass a pointer
; to the transer buffer down to the mouse driver.
mov ax,npXfrBuf1
mov [bp].intUserDX,ax
jmp short ment99
ment40: cmp al,23 ;Restore mouse driver state?
jnz ment99
;
; This is the restore mouse driver state function. We need to copy the
; mouse state buffer from the pm user location to the transfer buffer,
; and then pass the pointer to the transfer buffer on to the mouse driver.
mov cx,cbMouseState
jcxz ment99
;
; Transfer the data pointed to by the user ES:DX to the scratch buffer, and
; fix up the pointer that is passed on to the mouse driver.
ment92: mov si,[bp].pmUserDX
mov di,npXfrBuf1
mov [bp].intUserDX,di
push ds
mov ds,[bp].pmUserES
cld
rep movs word ptr [di],word ptr [si]
pop ds
;
ment99: pop di
pop si
pop cx
pop ax
ret
; -------------------------------------------------------
; IntExitMouse -- This function performs data transfer and
; register translation on exit from mouse driver functions.
; (INT 33h)
;
; Input: AX - mouse function being performed
; Output:
; Errors:
; Uses:
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitMouse
IntExitMouse:
cld
cmp al,21 ;get state buffer size?
jnz mxit20
;
; We need to remember the state buffer size, so that later we will know
; how many bytes to transfer when we do the save/restore state fucntions.
mov ax,[bp].intUserBX
mov cbMouseState,ax
return
;
mxit20: cmp al,22 ;Save mouse driver state?
jnz mxit30
;
; We need to restore the original values of ES:DX and transfer the mouse
; state data from the real mode buffer to the user's protected mode buffer.
mov cx,cbMouseState
jcxz mxit28
push es
mov si,npXfrBuf1
mov di,[bp].pmUserDX
mov [bp].intUserDX,di
mov es,[bp].pmUserES
rep movs byte ptr [di],byte ptr [si]
pop es
mxit28: return
;
mxit30: cmp al,23 ;Restore mouse driver state?
jnz mxit99
mov ax,[bp].pmUserDX
mov [bp].intUserDX,ax
;
mxit99: ret
; -------------------------------------------------------
DXPMCODE ends
; -------------------------------------------------------
subttl PM Interrupt Support Routines
page
; -------------------------------------------------------
; PM INTERRUPT SUPPORT ROUTINES
; -------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
; -------------------------------------------------------
; EnterIntHandler -- This routine will allocate a stack
; frame on the interrupt reflector stack and make
; a copy of the registers on the allocated stack.
;
; Note: This routine expects the current stack to contain a near
; return address and a normal [IP] [CS] [FL] interrupt stack
; frame. Don't have anything else on the stack before calling
; this routine!
;
; Note: This routine disables interrupts, and leaves them disabled.
; Most callers already have them disabled, so it doesn't
; really make a difference, except that this routine
; requires that they be disabled.
;
; Input: none
; Output: stack frame set up
; Errors: none
; Uses: all registers preserved
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public EnterIntHandler
EnterIntHandler proc near
FCLI ;we really want int's disabled (and
; XMScontrol doesn't do that)
push ds
mov ds,selDgroupPM ;save user's DS and address our DGROUP
assume ds:DGROUP
pop regUserDS
push bp
mov bp,sp ;bp -> [BP] [IP] [IP] [CS] [FL]
push word ptr [bp+8]
pop regUserFL ;user's flags before doing INT
pop bp
pop pfnReturnAddr ;near return to our immediate caller
mov regUserSS,ss ;save caller's stack address
mov regUserSP,sp
ASSERT_REFLSTK_OK
mov ss,selDgroupPM ;switch to interrupt reflector stack
mov sp,pbReflStack
sub pbReflStack,CB_STKFRAME ;adjust pointer to next stack frame
FIX_STACK
; Build the stack frame. The stack frame contains the following:
; dword & word parameter locations
; original caller's stack address
; caller's original flags and general registers (in pusha form)
; caller's original segment registers (DS & ES)
; flags and general registers to be passed to interrupt routine
; (initially the same as caller's original values)
; segment registers (DS & ES) to be passed to interrupt routine
; (initially set to the Dos Extender data segment address)
;
; The parameter words and then the caller's original register values go on top.
sub sp,8 ;space for a dd & 2 dw's
push regUserSP
push regUserSS
push regUserFL
pusha
push regUserDS
push es
; Now, put all of the general registers, and values for the segment
; registers to be passed to the interrupt service routine. We pass
; the Dos Extender data segment address to the interrupt routine.
push regUserFL
pusha
push segDXDataPM
push segDXDataPM
; And we are done.
mov bp,sp ;set up frame pointer
mov es,selDgroupPM
jmp pfnReturnAddr ;return to the caller.
EnterIntHandler endp
; -------------------------------------------------------
; LeaveIntHandler -- This routine will restore the user registers,
; release the stack frame, and restore the original user's stack
; for exit from an interrupt reflector routine.
;
; Note: Interrupts must be off when this routine is called.
;
; Input: none
; Output: none
; Errors: none
; Uses: All registers modified
assume ds:DGROUP,es:NOTHING,ss:NOTHING
public LeaveIntHandler
LeaveIntHandler proc near
FCLI
pop pfnReturnAddr
; The copy of the register values returned from the interrupt routine
; (and then possibly modified by the exit handler for the particular
; interrupt) are what gets returned to the caller. We discard the original
; register values saved on entry. (They were there so that the exit
; routine could refer to them if necessary)
add sp,4 ;skip over interrupt service routine's
; segment register values
popa ;restore general register values
pop regUserFL ;flags returned by interrupt routine
pop es ;get segment registers from pmUserES
pop regUserDS ; and pmUserDS
add sp,18 ;skip over the original user registers
; and flags
pop regUserSS ;original interrupted routine's stack
pop regUserSP
mov regUserAX,ax
; Switch back to the original user's stack.
ASSERT_REFLSTK_OK
ASSERT_CLI
CHECK_STACK
mov ss,regUserSS
mov sp,regUserSP
add pbReflStack,CB_STKFRAME
ASSERT_REFLSTK_OK
; We need to replace the image of the flags in the original int return
; address on the user's stack with the new flags returned from the interrupt
; service routine.
push bp
mov bp,sp ;stack -> BP IP CS FL
mov ax,regUserFL ;flags returned by interrupt service routine
and ax,0BFFFh ;clear the nested task flag
and [bp+6],0300h ;clear all but the interrupt and trace flags
; in the caller's original flags
or [bp+6],ax ;combine in the flags returned by the
; interrupt service routine. This will cause
; us to return to the original routine with
; interrupts on if they were on when the
; interrupt occured, or if the ISR returned
; with them on.
pop bp
; And now, return to the caller.
push pfnReturnAddr
mov ax,regUserAX
mov ds,regUserDS
assume ds:NOTHING
ret
LeaveIntHandler endp
; -------------------------------------------------------
DXPMCODE ends
; -------------------------------------------------------
subttl Mouse Interrupt Callback Function Handler
page
; -------------------------------------------------------
; MOUSE INTERRUPT CALLBACK FUNCTION HANDLER
; -------------------------------------------------------
DXCODE segment
assume cs:DXCODE
; -------------------------------------------------------
; MouseInterruptHandler -- This routine is the entry point for
; user requested mouse event interrupts. It switches the
; processor to protected mode and transfers control to the
; user protected mode mouse handling routine. When that
; completes, it switches back to real mode and returns control
; to the mouse driver.
; Entry to this routine will have been requested by an
; INT 33H code 12 with the real address of this routine
; substituted for the users entry point.
; The address of the user specified mouse handler as specified
; in the original INT 33H is stored in the variable
; lpfnUserMouseHandler.
;
; Input: none
; Output: none
; Errors: none
; Uses: The segment registers are explicitly preserved by
; this routine. Other registers are as preserved or
; modified by the users mouse handler.
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public MouseInterruptHandler
MouseInterruptHandler proc far
;
; On entry, the stack layout is:
; [2] CS - System mouse handler code segment
; [0] IP - System mouse handler return offset
;
push es
push ds
pushf
FCLI
cld
mov ds,selDgroup
assume ds:DGROUP
pop regUserFL
;
; Allocate a new stack frame, and then switch to the local stack
; frame.
mov regUserSP,sp ;save entry stack pointer so we can restore it
mov regUSerSS,ss ;save segment too
mov ss,selDgroup ;switch to our own stack frame
ASSERT_REFLSTK_OK
mov sp,pbReflStack
sub pbReflStack,CB_STKFRAME ;adjust pointer to next stack frame
FIX_STACK
;
; We are now running on our own stack, so we can switch into protected mode.
push ax ;preserve caller's AX
SwitchToProtectedMode
pop ax
;
; Build a far return frame on the stack so that the user's
; routine will return to us when it is finished.
push regUserSS ; save system mouse handler stack address
push regUserSP ; so we can restore it later
push ds
push cs
push offset mih50
;
; Build an IRET frame on the stack to use to transfer control to the
; user's protected mode routine
push regUserFL
push word ptr lpfnUserMouseHandler+2 ;push segment of user routine
push word ptr lpfnUserMouseHandler ;push offset of user routine
;
; At this point the interrupt reflector stack looks like this:
;
; [14] stack segment of original stack
; [12] stack pointer of original stack
; [10] real mode dos extender data segment
; [8] segment of return address back to here
; [6] offset of return address back here
; [4] Users flags
; [2] segment of user routine
; [0] offset of user routine
;
; Execute the users mouse handler
iret
;
; The users handler will return here after it is finsished.
mih50: FCLI
cld
pop ds
pop regUserSP
pop regUserSS
;
; Switch back to real mode.
push ax ;preserve AX
SwitchToRealMode
pop ax
CHECK_STACK
;
; Switch back to the original stack.
mov ss,regUserSS
mov sp,regUserSP
ASSERT_REFLSTK_OK
;
; Deallocate the stack frame that we are using.
add pbReflStack,CB_STKFRAME
ASSERT_REFLSTK_OK
;
; And return to the original interrupted program.
pop ds
pop es
ret
MouseInterruptHandler endp
; -------------------------------------------------------
DXCODE ends
; -------------------------------------------------------
subttl PS/2 Pointing Device Handler
page
; -------------------------------------------------------
; PS/2 POINTING DEVICE HANDLER
; -------------------------------------------------------
DXCODE segment
assume cs:DXCODE
ifndef NEC_98
; -------------------------------------------------------
; PointDeviceHandler -- This routine is the entry point for
; the PS/2 Pointing Device Handler. It switches the
; processor to protected mode and transfers control to the
; user pointing device handler. When that completes,
; it switches back to real mode and returns control to
; the PS/2 BIOS.
;
; Note: The BIOS calls us with interrutps enabled!
; Input: none
; Output: none
; Errors: none
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PointDeviceHandler
PointDeviceHandler proc far
; On entry, the stack layout is:
;
; [10] status
; [8] X coordinate
; [6] Y coordinate
; [4] Z coordinate
; [2] CS - PS/2 BIOS code segment
; [0] IP - PS/2 BIOS return offset
cld
push es ;save PS/2 BIOS ds/es on it's stack
push ds
mov ds,selDgroup ;addressability to DOSX DGROUP
push ds
pop es
assume ds:DGROUP,es:DGROUP
FCLI ;protect global regUserXX vars
; Allocate a new stack frame, and then switch to the local stack
; frame.
mov regUserSP,sp ;save entry stack pointer so we can restore it
mov regUSerSS,ss ;save segment too
ASSERT_REFLSTK_OK
mov ss,selDgroup ;switch to our own stack frame
mov sp,pbReflStack
sub pbReflStack,CB_STKFRAME ;adjust pointer to next stack frame
FIX_STACK
push regUserSS ;save PS/2 BIOS stack address
push regUserSP ; so we can restore it later
push SEL_DXDATA or STD_RING ;DOSX DS to be poped in PM
sub sp,4*2 ;temp save the general regs further down the
pusha ; stack, they'll get poped in a little while
; Copy PS/2 pointing device stack info to our (soon to be) protected mode stack
mov si,regUserSP ;PS/2 stack pointer
mov ds,regUserSS ;PS/2 stack segment
assume ds:NOTHING
FSTI ;no more references to global regUserXX vars
add si,4*2 ;skip over es,ds,cs,ip
mov di,sp ;loc for pointing device
add di,8*2 ; data on our stack
mov cx,4
cld
rep movsw
push es ;restore ds = DGROUP
pop ds
assume ds:DGROUP
; We are now running on our own stack, so we can switch into protected mode.
SwitchToProtectedMode ;disables interrupts again
FSTI ; but we don't want them disabled
popa ;restore general registers
; At this point the stack looks like this:
;
; [12] stack segment of original stack
; [10] stack pointer of original stack
; [8] protect mode dos extender data segment
; [6] status
; [4] X coordinate
; [2] Y coordinate
; [0] Z coordinate
; Execute the user's pointing device handler
call [lpfnUserPointingHandler]
; The users handler will return here after it is finsished.
pdh50:
cld
add sp,4*2 ;discard pointing device info
pop ds
FCLI ;protect global regUserXX vars
pop regUserSP
pop regUserSS
; Switch back to real mode.
push ax ;preserve AX
SwitchToRealMode
pop ax
; Switch back to the original stack.
CHECK_STACK
mov ss,regUserSS
mov sp,regUserSP
; Deallocate the stack frame that we are using.
ASSERT_REFLSTK_OK
add pbReflStack,CB_STKFRAME
ASSERT_REFLSTK_OK
; And return to the PS/2 BIOS
FSTI ;we came in with ints enabled
pop ds
pop es
ret
PointDeviceHandler endp
; -------------------------------------------------------
endif ;!NEC_98
;
; -------------------------------------------------------
subttl Utility Function Definitions
page
; -------------------------------------------------------
; UTILITY FUNCTION DEFINITIONS
; -------------------------------------------------------
;
; SaveRMIntrVectors -- This routine copies the current
; real mode interrupt vector table to the shadow
; vector table used by the interrupt reflector.
;
; Input: none
; Output: none
; Errors: none
; Uses; all registers preserved
;
; NOTE: This routine can only be called in REAL MODE.
assume ds:DGROUP,es:NOTHING,ss:NOTHING
public SaveRMIntrVectors
SaveRMIntrVectors:
push cx
push si
push di
push ds
push es
;
cld
push ds
pop es
xor cx,cx
mov si,cx
mov ds,cx
mov di,offset DGROUP:rglpfnRmISR
mov cx,2*256
rep movs word ptr [di],word ptr [si]
;
pop es
pop ds
pop di
pop si
pop cx
ret
; -------------------------------------------------------
; RestoreRMIntrVectors -- This routine copies the
; interrupt vectors from the real mode interrupt
; vector shadow table back down to the real interrupt
; vectors.
;
; Input: none
; Output: none
; Errors: none
; Uses; all registers preserved
;
; NOTE: This routine can only be called in REAL MODE.
assume ds:DGROUP,es:NOTHING,ss:NOTHING
public RestoreRMIntrVectors
RestoreRMIntrVectors:
push cx
push si
push di
push ds
push es
;
FCLI
cld
xor cx,cx
mov di,cx
mov es,cx
mov si,offset DGROUP:rglpfnRmISR
mov cx,2*256
rep movs word ptr [di],word ptr [si]
FSTI
;
pop es
pop ds
pop di
pop si
pop cx
ret
; -------------------------------------------------------
DXCODE ends
ifdef NEC_98
;
; -------------------------------------------------------
subttl INT D2h SOUND BIOS HANDRER
page
; -------------------------------------------------------
; PMIntrSound
;--------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrSound
PMIntrSound:
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntrySD
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*0D2h] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
call IntExitSD
;
; And return to the original caller.
call LeaveIntHandler
iret
;--------------------------------------------------------
; IntEntrySD
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntrySD
IntEntrySD:
cmp ah,0 ;BIOS(INITIALIZE)
jnz ienSD10
mov bx,0 ;BIOS
mov si,bx
mov cx,2FFh ;(256) (512)
jmp ienSD50
ienSD10:
cmp ah,1 ;(PLAY)
jnz ienSD20
mov si,[bp].pmUserBX
mov cx,28
jmp ienSD50
ienSD20:
cmp ah,16h ;(SET PARA BLOCK)
jnz ienSD90
mov si,[bp].pmUserBX
cmp dl,0 ;00=WORD/01=BYTE?
jnz ienSD21 ;not 0 = JMP
mov cx,100 ;100
jmp ienSD50
ienSD21:
mov cx,51 ;51
ienSD50:
push ds
;;;; mov si,[bp].pmUserBX ;
mov ds,[bp].pmUserES ;
mov di,offset DGROUP:rgbXfrBuf1
rep movsb
pop ds
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
;------------------------------------------------------------
mov [bp].intUserBX,offset DGROUP:rgbXfrBuf1
ienSD90:
ret
;--------------------------------------------------------
; IntExitSD
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitSD
IntExitSD:
cmp ah,0 ;BIOS (INITIALIZE)
jnz iexSD10
jmp iexSD50
iexSD10:
cmp ah,1 ;(PLAY)
jnz iexSD20
jmp iexSD50
iexSD20:
cmp ah,16h ;(SET PARA BLOCK)
jnz iexSD90
iexSD50:
push ax
mov ax,[bp].pmUserES
mov [bp].intUserES,ax
;------------------------------------------------------------
mov ax,[bp].pmUserBX
mov [bp].intUserBX,ax
pop ax
iexSD90:
ret
DXPMCODE ends
; -------------------------------------------------------
subttl INT 1Ah PRINTER BIOS HANDRER
page
; 30h( ) 2K
; -------------------------------------------------------
; PMIntrPrinter
;--------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrPrinter
PMIntrPrinter:
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryPR
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*1Ah] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
call IntExitPR
;
; And return to the original caller.
call LeaveIntHandler
iret
;--------------------------------------------------------
; IntEntryPR
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntryPR
IntEntryPR:
cmp ah,30h ;
jnz ienPR20 ;90/08/24
mov cx,[bp].pmUserCX ;
cmp cx,2048 ;2K
jbe ienPR10 ;NO = jmp
mov cx,2048
mov [bp].intUserCX,cx
ienPR10:
push ds
mov si,[bp].pmUserBX ;offset address
mov ds,[bp].pmUserES ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
;------------------------------------------------------------
mov [bp].intUserBX,offset DGROUP:rgbXfrBuf1
ienPR20:
ret
;--------------------------------------------------------
; IntExitPR
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitPR
IntExitPR:
cmp ah,30h
jnz iexPR20
mov cx,[bp].pmUserCX
cmp cx,2048
ja iexPR10 ;YES = jmp
push ax
mov ax,[bp].pmUserES
mov [bp].intUserES,ax
;------------------------------------------------------------
mov ax,[bp].pmUserBX ;offset address
mov [bp].intUserBX,ax
pop ax
ret
iexPR10:
push ax
mov ax,[bp].pmUserES
mov [bp].intUserES,ax
;------------------------------------------------------------
mov cx,2048
sub [bp].pmUserCX,cx
mov ax,[bp].pmUserCX
mov [bp].intUserCX,ax
pop ax
push bx
add [bp].pmUserBX,cx
mov bx,[bp].pmUserBX
mov [bp].intUserBX,bx
pop bx
iexPR20:
ret
;////////////////////////////////////////////////////////////
if 0
;////////////////////////////////////////////////////////////
IntEntryPR:
cmp ah,30h
jnz ienPR10
mov cx,[bp].pmUserCX
cmp cx,2048
ja ienPR10 ;YES = jmp
push ds
mov si,[bp].pmUserBX ;offset address
mov ds,[bp].pmUserES ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
;------------------------------------------------------------
mov [bp].intUserBX,offset DGROUP:rgbXfrBuf1
ret
ienPR10:
push ds
mov si,[bp].pmUserBX ;offset address
mov ds,[bp].pmUserES ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
;------------------------------------------------------------
push bx
mov bx,offset DGROUP:rgbXfrBuf1 ;
add bx,cx ;DGROUP:rgbXfrBuf1
mov [bp].intUserBX,bx ;
pop bx
ret
; push ds
; mov [bp].intUserES,ds ;segment address
; pop ds
;;------------------------------------------------------------
; mov bx,offset DGROUP:rgbXfrBuf1 ;
; add bx,cx ;
; mov [bp].intUserBX,bx ;
; ret
;
;--------------------------------------------------------
; IntExitPR
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitPR
IntExitPR:
cmp ah,30h
jnz iexPR10
mov ax,[bp].pmUserES
mov [bp].intUserES,ax
;------------------------------------------------------------
mov ax,[bp].pmUserBX ;
mov [bp].intUserBX,ax
iexPR10:
ret
;////////////////////////////////////////////////////////////
endif
;////////////////////////////////////////////////////////////
DXPMCODE ends
; -------------------------------------------------------
subttl INT 1Ch CALENDER/TIMER HANDRER
page
; -------------------------------------------------------
; PMIntrCalTi
;--------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrCalTi
PMIntrCalTi:
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryCT
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*1Ch] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
call IntExitCT
;
; And return to the original caller.
call LeaveIntHandler
iret
;--------------------------------------------------------
; IntEntryCT
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntryCT
IntEntryCT:
cmp ah,0 ;
jnz ienCT10
jmp ienCT80
ienCT10:
cmp ah,1 ;
jnz ienCT20
mov cx,6 ;
jmp ienCT70
ienCT20:
ienCT50:
push es
push ax
mov ax,40h
mov es,ax
; test byte ptr es:[501h],8h ;if Hmode
test byte ptr es:[101h],8h ;if Hmode
jz ienCT90
;; test fNHmode,0FFh
;; jz ienCT90 ;0=Nmode --->jmp
;--------------------- Hmode ----------------------
cmp ah,3
jnz ienCT30
mov cx,4
jmp ienCT70
ienCT30:
cmp ah,4
jnz ienCT40
mov cx,12
jmp ienCT70
ienCT40:
cmp ah,5
jnz ienCT90
mov cx,12
;--------------------- Hmode ----------------------
ienCT70:
push ds
mov si,[bp].pmUserBX ;offset address
mov ds,[bp].pmUserES ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
ienCT80:
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
;------------------------------------------------------------
mov [bp].intUserBX,offset DGROUP:rgbXfrBuf1
ienCT90:
ret
;--------------------------------------------------------
; IntExitCT
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitCT
IntExitCT:
cmp ah,0
jnz iexCT10
mov cx,6
jmp iexCT70
iexCT10:
cmp ah,1
jnz iexCT20
jmp iexCT80
iexCT20:
iexCT50:
push es
push ax
mov ax,40h
mov es,ax
; test byte ptr es:[501h],8h ;if Hmode
test byte ptr es:[101h],8h ;if Hmode
jz iexCT90
;; test fNHmode,0FFh
;; jz iexCT90 ;0=Nmode --->jmp
;--------------------- Hmode ----------------------
cmp ah,3
jnz iexCT30
jmp iexCT80
iexCT30:
cmp ah,4
jnz iexCT40
jmp iexCT80
iexCT40:
cmp ah,5
jnz iexCT90
jmp iexCT80
;--------------------- Hmode ----------------------
iexCT70:
push es
mov di,[bp].pmUserBX ;offset address
mov es,[bp].pmUserES ;segment address
mov si,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop es
iexCT80:
push ax
mov ax,[bp].pmUserES
mov [bp].intUserES,ax
;------------------------------------------------------------
mov ax,[bp].pmUserBX
mov [bp].intUserBX,ax
pop ax
iexCT90:
ret
DXPMCODE ends
; -------------------------------------------------------
subttl INT DCh extended DOS HANDRER
page
; -------------------------------------------------------
; PMIntrExDos
;--------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrExDos
PMIntrExDos:
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
call IntEntryED
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*0DCh] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
; mov ax,[bp].pmUserAX ;get original function code
mov cx,[bp].pmUserCX ;get original function code
call IntExitED
;
; And return to the original caller.
call LeaveIntHandler
iret
;--------------------------------------------------------
; IntEntryED
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntEntryED
IntEntryED:
cmp cl,0Ch
jnz ienED10
jmp ienED80
ienED10:
;;; push cx
cmp cl,0Dh
jz ienED
jmp ienED20
ienED:
push cx
cmp ax,0
jnz ienED11
mov cx,386 ;386byte
jmp ienED70
ienED11:
cmp ax,0FFh
jnz ienED12
mov cx,786 ;786byte
jmp ienED70
ienED12:
cmp ax,1
jb ienED13
cmp ax,0Ah
ja ienED13
mov cx,160 ;16*10=160byte
jmp ienED70
ienED13:
cmp ax,0Bh
jb ienED14
cmp ax,14h
ja ienED14
mov cx,160 ;16*10=160byte
jmp ienED70
ienED14:
cmp ax,15h
jb ienED15
cmp ax,1Fh
ja ienED15
mov cx,66 ;6*11=66byte
jmp ienED70
ienED15:
cmp ax,20h
jb ienED16
cmp ax,24h
ja ienED16
mov cx,80 ;16*5=80byte
jmp ienED70
ienED16:
cmp ax,25h
jb ienED17
cmp ax,29h
ja ienED17
mov cx,80 ;16*5=80byte
jmp ienED70
ienED17:
cmp ax,2Ah
jb ienED18
cmp ax,38h
ja ienED18
mov cx,240 ;16*15=240byte
jmp ienED70
ienED18:
cmp ax,100h
jnz ienED20
mov cx,514 ;2+512=514byte
jmp ienED70
ienED20:
cmp cl,10h
jnz ienED90
cmp ah,1
jnz ienED90
moji_out:
mov si,dx
cmp byte ptr ds:[si],'$'
;;;;;;;; cmp byte ptr ds:[dx],'$'
jz ienED90
push ds
mov si,[bp].pmUserDX ;offset address
mov ds,[bp].pmUserDS ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
movsb
pop ds
jmp moji_out
ienED70:
push ds
mov si,[bp].pmUserDX ;offset address
mov ds,[bp].pmUserDS ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
pop cx
ienED80:
;-----------
push ax
mov ax,segDXDataPM
mov [bp].intUserES,ax ;segment address
pop ax
;------------------------------------------------------------
mov [bp].intUserDX,offset DGROUP:rgbXfrBuf1
ienED90:
ret
;--------------------------------------------------------
; IntExitED
;--------------------------------------------------------
assume ds:DGROUP,es:DGROUP,ss:NOTHING
public IntExitED
IntExitED:
cmp cl,0Ch
jz iexED
jmp iexED10
iexED:
push cx
cmp ax,0
jnz iexED1
mov cx,386 ;386byte
jmp iexED70
iexED1:
cmp ax,0FFh
jnz iexED2
mov cx,786 ;786byte
jmp iexED70
iexED2:
cmp ax,1
jb iexED3
cmp ax,0Ah
ja iexED3
mov cx,160 ;16*10=160byte
jmp iexED70
iexED3:
cmp ax,0Bh
jb iexED4
cmp ax,14h
ja iexED4
mov cx,160 ;16*10=160byte
jmp iexED70
iexED4:
cmp ax,15h
jb iexED5
cmp ax,1Fh
ja iexED5
mov cx,66 ;6*11=66byte
jmp iexED70
iexED5:
cmp ax,20h
jb iexED6
cmp ax,24h
ja iexED6
mov cx,80 ;16*5=80byte
jmp iexED70
iexED6:
cmp ax,25h
jb iexED7
cmp ax,29h
ja iexED7
mov cx,80 ;16*5=80byte
jmp iexED70
iexED7:
cmp ax,2Ah
jb iexED8
cmp ax,38h
ja iexED8
mov cx,240 ;16*15=240byte
jmp iexED70
iexED8:
cmp ax,100h
jnz iexED10
mov cx,514 ;2+512=514byte
jmp iexED70
iexED10:
cmp cl,0Dh
jnz iexED20
jmp iexED80
iexED20:
cmp cl,10h
jnz iexED90
cmp ah,1
jnz iexED90
jmp iexED80
iexED70:
push ds
mov si,[bp].pmUserDX ;offset address
mov ds,[bp].pmUserDS ;segment address
mov di,offset DGROUP:rgbXfrBuf1
cld
rep movsb
pop ds
pop cx
iexED80:
push ax
;-----------
mov ax,[bp].pmUserDS
mov [bp].intUserDS,ax
;------------------------------------------------------------
mov ax,[bp].pmUserDX
mov [bp].intUserDX,ax
pop ax
iexED90:
ret
DXPMCODE ends
;/////////////////////////////////////////////////////////////////////////
; Hmode no GRAPH ha INT 1Dh(Graph BIOS) niyori byouga sareru.
; DOSX deha,
;/////////////////////////////////////////////////////////////////////////
; -------------------------------------------------------
; PMIntr GRAPH BIOS
;--------------------------------------------------------
DXPMCODE segment
assume cs:DXPMCODE
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntrGraph
;///////////////////////////////////////////////////////////////////////
;; extrn fNHmode:BYTE ;NHmode
;///////////////////////////////////////////////////////////////////////
PMIntrGraph:
;; test fNHmode,0FFh
;; jz GBios_Nmode
call EnterIntHandler ;build a stack frame and fix up the
cld ; return address so that the interrupt
;service routine will return to us.
;
; Perform fixups on the entry register values
push ax
mov ax,[bp].pmUserDS
call GetSegmentAddress
shr dx,4
shl bx,12
or bx,dx ;bx now = seg of parent psp
mov [bp].intUserDS,bx
pop ax
;
; Execute the interrupt service routine
SwitchToRealMode
assume ss:DGROUP
pop es
pop ds
assume ds:NOTHING,es:NOTHING
popa
call rglpfnRmISR[4*1Dh] ;execute the real mode interrupt routine
pushf
cli
cld
pusha
push ds
push es
mov ax,ss
mov ds,ax
mov es,ax
mov bp,sp ;restore stack frame pointer
SwitchToProtectedMode
assume ds:DGROUP,es:DGROUP
;
; Perform fixups on the return register values.
mov ax,[bp].pmUserAX ;get original function code
;/////////////
push ax
mov ax,[bp].pmUserDS
mov [bp].intUserDS,ax
pop ax
;/////////////
;
; And return to the original caller.
call LeaveIntHandler
iret
DXPMCODE ends
DXPMCODE segment
assume cs:DXPMCODE
assume ds:NOTHING,es:NOTHING,ss:NOTHING
public PMIntr11dummy
PMIntr11dummy proc near
and ax,0FFFDh
iret
PMIntr11dummy endp
DXPMCODE ends
endif ;NEC_98
DXPMCODE segment
assume cs:DXPMCODE
IFDEF WOW
public Wow32IntrRefl
Wow32IntrRefl label word
??intnum = 0
rept 256
push word ptr ??intnum
jmp Wow32Intr16Reflector
??intnum = ??intnum + 1
endm
;--------------------------------------------------------
;
; Wow32Intr16Reflector -- This routine reflects a 32 bit
; interrupt to a 16 bit handler. It switches to the
; dos extender stack to do so.
;
; Inputs: none
; Outputs: none
;
assume ds:nothing,es:nothing,ss:nothing
public Wow32Intr16Reflector
Wow32Intr16Reflector proc
.386p
push ebp
mov ebp,esp
push ds
push eax
push ebx
push edi
mov ax,ss
movzx eax,ax
lar eax,eax
test eax,(AB_BIG SHL 8)
jnz w32i16r10
movzx ebp,bp
w32i16r10:
;
; Get a frame on the dosx stack.
;
mov ax,selDgroupPM
mov ds,ax
assume ds:DGROUP
movzx ebx,pbReflStack
sub pbReflStack,CB_STKFRAME
;
; Build a frame on the stack
;
sub bx,30
mov eax, [ebp+6] ; eip
mov [bx+20], eax
mov eax, [ebp+10] ; cs
mov [bx+24], eax
mov [bx + 18],ss ; ss for stack switch back
mov eax,ebp
add eax,6 ; ebp, int number
mov [bx + 14],eax ; esp for stack switch back
mov ax,[ebp + 14] ; get flags
mov [bx + 12],ax
mov ax,cs
mov [bx + 10],ax
mov [bx + 8],offset DXPMCODE:w3216r30
mov eax,[ebp]
mov [bx],eax ; put ebp on other stack for pop
;
; Get handler
;
mov di,[ebp + 4] ; int number
shl di,2 ; al * 4
add di,offset DGROUP:Wow16BitHandlers
mov ax,[di]
mov [bx + 4],ax ; handler ip
mov ax,[di + 2]
mov [bx + 6],ax ; handler cs
;
; Set up for stack switch
;
push ds
push ebx
;
; Restore registers
;
mov ax,[ebp - 2]
mov ds,ax
mov eax,[ebp - 6]
mov ebx,[ebp - 10]
mov edi,[ebp - 14]
;
; Switch stacks, restore ebp, and call handler
;
lss esp,[ebp - 20]
pop ebp
retf
;
; N.B. i31_RMCall looks on the stack to get the original user stack pointer.
; if you change the stack frame the is passed to the 16 bit int
; handlers, that WILL break.
;
w3216r30:
;
; Switch stacks, deallocate frame from dosx stack and return
;
push ebx
push eax
push ds
lds ebx,[esp+10] ;get ss:esp
mov eax,[esp+16]
mov [ebx],eax ;eip
mov eax,[esp+20]
mov [ebx+4],eax ;cs
pop ds
pop eax
pop ebx
lss esp,[esp]
push ebx
pushfd
push eax
mov ax,ss
movzx eax,ax
lar eax,eax
test eax,(AB_BIG SHL 8) ; is the stack big?
jnz w32i16r40 ; jif yes, use 32bit operations
pop eax ; restore regs
popfd
rpushfd ; save flags, set virtual int bit
pop ebx
push ebp
movzx ebp, sp
mov [ebp + 16],ebx ; put flags on iret frame
pop ebp
push ds
mov bx,selDgroupPM
mov ds,bx
add pbReflStack,CB_STKFRAME
pop ds
pop ebx
riretd
w32i16r40: ; stack is big
pop eax ; restore regs
popfd
rpushfd32
pop ebx
mov [esp + 12],ebx
push ds
mov bx,selDgroupPM
mov ds,bx
add pbReflStack,CB_STKFRAME
pop ds
pop ebx
riretd32
.286p
Wow32Intr16Reflector endp
ENDIF
DXPMCODE ends
;
;****************************************************************
end
| 37.348374 | 81 | 0.382361 |
db052ab46b413f32c714ef6e46c5e644dac6f16d | 6,513 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_1212.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_0x48.log_21829_1212.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_0x48.log_21829_1212.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 %r12
push %r13
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x278b, %rdi
nop
nop
xor $34403, %rdx
movb (%rdi), %r13b
nop
nop
nop
nop
nop
xor $52188, %rbx
lea addresses_UC_ht+0x8a8b, %rcx
clflush (%rcx)
nop
nop
xor %r10, %r10
vmovups (%rcx), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %rdx
nop
add $27567, %rdi
lea addresses_normal_ht+0x13cf7, %rsi
lea addresses_normal_ht+0xc573, %rdi
nop
nop
nop
nop
add $2881, %r12
mov $28, %rcx
rep movsl
nop
nop
nop
nop
sub %r12, %r12
lea addresses_A_ht+0x6cfb, %rbx
add $50601, %r10
mov $0x6162636465666768, %r12
movq %r12, %xmm1
movups %xmm1, (%rbx)
sub %rbx, %rbx
lea addresses_D_ht+0x10c0b, %rdi
nop
nop
nop
nop
nop
sub %rsi, %rsi
movw $0x6162, (%rdi)
nop
nop
and $10024, %r10
lea addresses_A_ht+0x12d00, %rcx
nop
nop
dec %r10
movl $0x61626364, (%rcx)
nop
nop
inc %rdi
lea addresses_A_ht+0x1238b, %r12
nop
nop
and %rbx, %rbx
mov $0x6162636465666768, %rdi
movq %rdi, (%r12)
nop
cmp $43956, %rdx
lea addresses_UC_ht+0x1758b, %rsi
lea addresses_WT_ht+0xe2db, %rdi
nop
nop
nop
nop
nop
inc %r10
mov $83, %rcx
rep movsw
nop
nop
nop
nop
nop
add %r10, %r10
lea addresses_normal_ht+0x11ab, %r10
nop
cmp $23258, %rdi
movb (%r10), %bl
nop
nop
nop
add $19719, %rdx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r15
push %rax
push %rcx
push %rsi
// Store
lea addresses_WT+0x1cee3, %rsi
clflush (%rsi)
nop
nop
and %rcx, %rcx
mov $0x5152535455565758, %rax
movq %rax, %xmm2
vmovups %ymm2, (%rsi)
nop
nop
nop
nop
cmp $17188, %rcx
// Faulty Load
lea addresses_WC+0x12b8b, %rax
nop
nop
nop
nop
dec %r10
movb (%rax), %r12b
lea oracles, %r14
and $0xff, %r12
shlq $12, %r12
mov (%r14,%r12,1), %r12
pop %rsi
pop %rcx
pop %rax
pop %r15
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 3, 'size': 32, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 9, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 8, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 4, 'size': 16, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 7, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': True, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': True, 'congruent': 5, 'size': 1, 'same': True, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 36.385475 | 2,999 | 0.659297 |
cc55bfbc8692de195e9fefbc3162ddf0ba6a3bb0 | 5,993 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_705.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_705.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_705.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 %r11
push %r14
push %r15
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x9c1a, %rsi
lea addresses_UC_ht+0x1c0da, %rdi
nop
nop
nop
sub $60580, %r15
mov $33, %rcx
rep movsq
add $3069, %rbp
lea addresses_A_ht+0x91da, %rcx
nop
nop
nop
nop
sub $43895, %r11
mov $0x6162636465666768, %r15
movq %r15, %xmm6
vmovups %ymm6, (%rcx)
nop
nop
nop
dec %r15
lea addresses_WC_ht+0x1a3da, %rsi
lea addresses_D_ht+0xf5a, %rdi
nop
add %r9, %r9
mov $60, %rcx
rep movsw
nop
nop
nop
cmp $48705, %rbp
lea addresses_normal_ht+0x14ec, %rsi
lea addresses_A_ht+0x9dda, %rdi
nop
dec %r14
mov $9, %rcx
rep movsb
dec %r15
lea addresses_A_ht+0x7c7a, %rcx
nop
nop
nop
nop
nop
sub $30725, %r11
vmovups (%rcx), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %r9
nop
nop
nop
sub $33198, %r15
lea addresses_normal_ht+0x1533a, %r9
nop
nop
nop
nop
lfence
movw $0x6162, (%r9)
nop
nop
nop
nop
nop
and %r11, %r11
lea addresses_D_ht+0xe65a, %rcx
nop
nop
add $41174, %r11
mov (%rcx), %r9w
nop
nop
and $13654, %r14
lea addresses_normal_ht+0x375a, %rbp
nop
cmp %rdi, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm1
vmovups %ymm1, (%rbp)
nop
nop
nop
nop
nop
xor $37351, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r15
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %rbx
push %rcx
push %rdi
// Faulty Load
lea addresses_PSE+0x45da, %r13
nop
nop
nop
dec %r10
movb (%r13), %bl
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rdi
pop %rcx
pop %rbx
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_PSE', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 4, 'same': True}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}}
{'src': {'same': True, 'congruent': 4, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': False}}
{'src': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_D_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 39.688742 | 2,999 | 0.661939 |
0e40ab80b977efd50a87a9fb3f23f59f9dc0cb6c | 790 | asm | Assembly | oeis/138/A138977.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/138/A138977.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/138/A138977.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A138977: Number of 2 X n matrices containing a 1 in the top left entry, all entries are integer values and adjacent entries differ by at most 1.
; Submitted by Christian Krause
; 3,19,121,771,4913,31307,199497,1271251,8100769,51620379,328939577,2096095523,13356910353,85113990379,542370291241,3456136077171,22023471375233,140339755317947,894284401724697,5698631790801091,36313284928708849,231398467337757579,1474536131649467657,9396159052195243283,59874968838768832353,381540145662600853339,2431281144283130643961,15492807427331511094371,98724527414188055084753,629100462189990341215787,4008805125673180168171497,25545234030952299812337331,162781417713973378013675329
mov $1,2
mov $3,3
lpb $0
sub $0,1
dif $1,2
mov $2,$3
mul $2,2
mul $3,6
add $3,$1
add $1,$2
lpe
mov $0,$3
| 46.470588 | 490 | 0.826582 |
945d821b959e6ed82b3c1c45b8939854960115b2 | 461 | asm | Assembly | oeis/144/A144328.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/144/A144328.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/144/A144328.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A144328: A002260 preceded by a column of 1's: a (1, 1, 2, 3, 4, 5,...) crescendo triangle by rows.
; Submitted by Christian Krause
; 1,1,1,1,1,2,1,1,2,3,1,1,2,3,4,1,1,2,3,4,5,1,1,2,3,4,5,6,1,1,2,3,4,5,6,7,1,1,2,3,4,5,6,7,8,1,1,2,3,4,5,6,7,8,9,1,1,2,3,4,5,6,7,8,9,10,1,1,2,3,4,5,6,7,8,9,10,11,1,1,2,3,4,5,6,7,8,9,10,11,12,1,1,2,3,4,5,6,7,8
seq $0,25675 ; Exponent of 8 (value of j) in n-th number of form 7^i*8^j.
mul $0,1977326743
div $0,1977326753
add $0,1
| 51.222222 | 207 | 0.605206 |
a595747f9412d7f5804057f9605ea2dcbe11e831 | 405 | asm | Assembly | programs/oeis/228/A228261.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/228/A228261.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/228/A228261.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A228261: Number of third differences of arrays of length 5 of numbers in 0..n.
; 31,143,319,565,881,1267,1723,2249,2845,3511,4247,5053,5929,6875,7891,8977,10133,11359,12655,14021,15457,16963,18539,20185,21901,23687,25543,27469,29465,31531,33667,35873,38149,40495,42911,45397,47953,50579,53275
pow $1,$0
gcd $1,7
add $1,30
mov $2,$0
mul $2,71
add $1,$2
mov $3,$0
mul $3,$0
mov $2,$3
mul $2,35
add $1,$2
| 27 | 213 | 0.720988 |
ce8c2a27649607d4fc5c2ced29583936127e1ac6 | 2,835 | asm | Assembly | hyper-screen-with-more-than-8-sprites.asm | chris73it/C64-hyper-screen | 3fb283bc28a9b65e5e7506370708ddf9c5518df7 | [
"MIT"
] | 2 | 2019-05-21T16:04:47.000Z | 2022-01-17T23:58:41.000Z | hyper-screen-with-more-than-8-sprites.asm | chris73it/C64-hyper-screen | 3fb283bc28a9b65e5e7506370708ddf9c5518df7 | [
"MIT"
] | null | null | null | hyper-screen-with-more-than-8-sprites.asm | chris73it/C64-hyper-screen | 3fb283bc28a9b65e5e7506370708ddf9c5518df7 | [
"MIT"
] | null | null | null | #import "helpers.asm"
.label border = $d020
.label background = $d021
.label screen = $0400
.label cia1_interrupt_control_register = $dc0d
.label cia2_interrupt_control_register = $dd0d
:BasicUpstart2(main)
.const RASTER_LINE = 309
main:
sei
lda #$f0
sta $3fff
lda #WHITE
sta border
lda #BLACK
sta background
lda $01
and #%11111101
sta $01
lda #%01111111
sta cia1_interrupt_control_register
sta cia2_interrupt_control_register
lda cia1_interrupt_control_register
lda cia2_interrupt_control_register
lda #%00000001
sta vic2_interrupt_control_register
sta vic2_interrupt_status_register
:set_raster(RASTER_LINE)
:mov16 #irq1 : $fffe
cli
loop:
jmp loop
irq1:
sta atemp
stx xtemp
sty ytemp
:stabilize_irq()
last_line:
// At the start of line with index 311 (stabilized at cycle 3)
:cycles(56-3-2*8)
lda vic2_screen_control_register2
ora #%00001000
tax
lda vic2_screen_control_register2
and #%11110111
tay
// We add 3 cycles and remove them immediately from the new_frame: this way
// we have a compensation for the 3 cycles taken by the jmp at the end.
:cycles(3)
new_frame:
// At the end of line with index 311 (stabilized at cycle 56+3)
:cycles(63-3-8)
stx vic2_screen_control_register2
sty vic2_screen_control_register2 // <<< Opens line with index 0
// Lines with index from 0 to 49
.for (var i = 0; i < 50; i++) {
:cycles(63-8)
stx vic2_screen_control_register2
sty vic2_screen_control_register2 // <<< Opens lines from index 1 to 50
}
all_but_last_char_lines:
// Start from line with index 51
.for (var i = 0; i < 24; i++) {
:cycles(20-8)
stx vic2_screen_control_register2
sty vic2_screen_control_register2
.for (var j = 0; j < 7; j++) {
:cycles(63-8)
stx vic2_screen_control_register2
sty vic2_screen_control_register2
}
}
last_char_line:
:cycles(20-8)
stx vic2_screen_control_register2
sty vic2_screen_control_register2
.var rasterline = $f3
.for (var i = 0; i < 7; i++, rasterline++) {
.if(rasterline == $f3) {
:cycles(63-10-8)
lda vic2_screen_control_register1
ora #%00001000
sta vic2_screen_control_register1
} else .if(rasterline == $f7) {
:cycles(63-10-8)
lda vic2_screen_control_register1
and #%11110111
sta vic2_screen_control_register1
} else {
:cycles(63-8)
}
stx vic2_screen_control_register2
sty vic2_screen_control_register2
}
// 49+12 lines of bottom border
.for (var i = 0; i < 49+12; i++) {
:cycles(63-8)
stx vic2_screen_control_register2
sty vic2_screen_control_register2
}
jmp new_frame
asl vic2_interrupt_status_register
:set_raster(RASTER_LINE)
:mov16 #irq1 : $fffe
lda atemp: #$00
ldx xtemp: #$00
ldy ytemp: #$00
rti
| 21.315789 | 77 | 0.695591 |
c157bf3c2ffb5a22411efba56e54e21cf04be20c | 348 | asm | Assembly | programs/oeis/091/A091284.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/091/A091284.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/091/A091284.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A091284: Exponent of 2 in -1+prime[n]^s, if s is an exponent of form 16k-8. Except a(1)=0, a(n)=1+A091283(n).
; 0,5,5,6,5,5,7,5,6,5,8,5,6,5,7,5,5,5,5,6,6,7,5,6,8,5,6,5,5,7,10,5,6,5,5,6,5,5,6,5,5,5,9,9,5,6,5,8,5,5
seq $0,6005 ; The odd prime numbers together with 1.
pow $0,8
sub $0,1
mov $1,1
lpb $0
dif $0,2
add $1,1
lpe
sub $1,1
mov $0,$1
| 24.857143 | 111 | 0.58908 |
33fb1187a32d76a0beec679a583638c52d5b9fcb | 434 | asm | Assembly | Tests/yasm-regression/avx16.asm | 13xforever/x86-assembly-textmate-bundle | f1bb62f77b776d87d0fd85b0276d4237ff72c43c | [
"MIT"
] | 69 | 2015-04-16T18:01:22.000Z | 2022-02-15T07:54:26.000Z | Tests/yasm-regression/avx16.asm | javiercbk/x86-assembly-textmate-bundle | 62d700e0196f62ef4353a9b95c2e64beb0a6afda | [
"MIT"
] | 17 | 2016-09-20T08:49:09.000Z | 2021-02-19T15:01:04.000Z | Tests/yasm-regression/avx16.asm | javiercbk/x86-assembly-textmate-bundle | 62d700e0196f62ef4353a9b95c2e64beb0a6afda | [
"MIT"
] | 19 | 2016-05-31T07:11:14.000Z | 2021-07-19T10:17:12.000Z | [bits 16]
extractps eax, xmm1, 5 ; out: 66 0f 3a 17 c8 05
vextractps eax, xmm1, 5 ; out: c4 e3 79 17 c8 05
pextrb eax, xmm1, 5 ; out: 66 0f 3a 14 c8 05
vpextrb eax, xmm1, 5 ; out: c4 e3 79 14 c8 05
pextrw eax, xmm1, 5 ; out: 66 0f c5 c1 05
vpextrw eax, xmm1, 5 ; out: c5 f9 c5 c1 05
pextrd eax, xmm1, 5 ; out: 66 0f 3a 16 c8 05
vpextrd eax, xmm1, 5 ; out: c4 e3 79 16 c8 05
vpinsrd xmm1, xmm2, eax, 5 ; out: c4 e3 69 22 c8 05
| 39.454545 | 51 | 0.640553 |
a53b61c2d81aa7413598e4f229c0c509b729b932 | 25,800 | asm | Assembly | pld/src/board/de0cv/ipl/asm_iplrom/iplrom_304k_de0cv.asm | uniabis/deocmpldcv | fefc7582757578d9236d6ebf333de2571bcfbb73 | [
"Unlicense"
] | 17 | 2019-02-17T19:31:42.000Z | 2022-03-27T04:50:06.000Z | pld/src/board/de0cv/ipl/asm_iplrom/iplrom_304k_de0cv.asm | uniabis/deocmpldcv | fefc7582757578d9236d6ebf333de2571bcfbb73 | [
"Unlicense"
] | null | null | null | pld/src/board/de0cv/ipl/asm_iplrom/iplrom_304k_de0cv.asm | uniabis/deocmpldcv | fefc7582757578d9236d6ebf333de2571bcfbb73 | [
"Unlicense"
] | 2 | 2019-12-14T19:32:32.000Z | 2020-09-06T05:21:15.000Z | ;
; iplrom_de0cv.vhd
; initial program loader for Cyclone & EPCS (Altera)
; Revision 2.00
;
; Copyright (c) 2006 Kazuhiro Tsujikawa (ESE Artists' factory)
; All rights reserved.
;
; Redistribution and use of this source code or any derivative works, 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. Redistributions may not be sold, nor may they be used in a commercial
; product or activity 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.
;
; IPL-ROM Revision 2.00 for 304 kB unpacked
; EPCS4 start adr 34000h - Optimized by KdL 2017.09.18
;
; SDHC support by yuukun-OKEI, thanks to MAX
;
; EPCS64 start adr 7b4000h
;
; Coded in sjasm 0.42c for DEOCM-PLD-CV v0.0.3
org $FC00
;----------------------------------------
SDBIOS_LEN equ 32 ; SDBIOS lenght: 32=512 kB, 24=384 kB
;----------------------------------------
begin: ; ### from low memory ($0000) ###
di
; self copy
ld bc, end - begin ; bc = ipl-rom file size (bytes)
ld de, begin ; de = RAM start adr
ld h, e ; ld hl, $0000
ld l, e ; hl = IPL-ROM start adr
ldir ; copy to RAM
; set VDP color palette
ld hl, data_r16
ld bc, $0299 ; 2 bytes => $99
otir
ld bc, $209A ; 32 bytes => $9A
otdr
; b = $00
;----------------------------------------
jp init_stack ; WARNING!! DO NOT CHANGE THIS LINE
;----------------------------------------
init_stack: ; ### to high memory ($FCXX) ###
ld sp, $FFFF ; initializing stack pointer
ld a, $D4
out ($40), a ; I/O $40 = 212
; check 'AB' marker in RAM
ld a, $80
ld ($7000), a
ds 11,$00
;ld hl, ($8000)
;ld de, 'B'*256 + 'A'
;sbc hl, de
;jp z, init_sys ; yes 'AB'
; check SD-CARD
ld a, $40
ld ($6000), a
ld hl, $C000 ; sector buffer
inc b ; ld bc, $0100 => sector 0
ld c, l
ld d, l ; ld de, $0000
ld e, l
load_sd:
;----------------------------------------
; jp load_epcs ; loading BIOS from EPCS only
call read_sd ; read from SD-CARD
;----------------------------------------
jr c, load_epcs ; loading BIOS from SD-CARD or EPCS (default)
; jr c, load_sd ; loading BIOS from SD-CARD only
; read OK => CY = 0
;----------------------------------------
; search 'FAT' checksum
ld hl, $C000 ; buffer
ld bc, $0080
loop_f:
ld a, 'F' ; 'F'
cpir
or a
jr nz, exit_fat
test_fat:
add a, (hl) ; 'A'
inc hl
add a, (hl) ; 'T'
sub 'F' + 'A' + 'T'
dec hl
jr nz, loop_f
; yes marker 'FAT'
ld c, b ; ld c, $00
ld e, c ; ld de, $0000
ld d, c
scf
; no 'FAT'
exit_fat:
jr c, find_ab ; CY = 1 => yes 'FAT'
;----------------------------------------
; test MBR, search partition
ld b, $04 ; partitions to find
ld hl, $C000 + $01C6 ; sector offset
find_part:
push hl
ld e, (hl)
inc hl
ld d, (hl)
inc hl
ld c, (hl)
ld a, c
or d
or e
pop hl
jr nz,exit_mbr ; yes partition
ld de, $0010
add hl, de
djnz find_part
; no partition
scf ; CY = 1 error
;----------------------------------------
exit_mbr:
jr c, load_epcs ; no partition
; yes partition
push de
push bc
ld b, $01 ; 1 sector
ld hl, $C000 ; DAT buffer
call read_sd ; PBR read
pop bc
pop de
jr nc, find_ab ; CY = 1 => error
;----------------------------------------
load_epcs:
ld hl, read_epcs ; get_data <= call read_epcs
ld (get_data + 1), hl
;----------------------------------------
; load BIOS from EPCS
ld a, $60
ld ($6000), a
;----------------------------------------
; ld de, $0180 ; EPCS4 start adr = (080000h - 050000h) / 200h <320k
; ld de, $01A0 ; EPCS4 start adr = (080000h - 04c000h) / 200h <304k
ld de, $3DA0 ; EPCS64 start adr = (800000h - 04c000h) / 200h <304k
;----------------------------------------
ld a, $80 ; ESE-RAM init adr
ld b, 4 -1 ; DISK lenght -1
call load_blocks ; 4 * 16 kB [DATA]
ld b, 4 -1 ; FILL ZERO lenght -1
call load_zero_16k ; +4 * 16 kB [ZERO]
call load_blocks ; +1 * 16 kB [DATA] <= MAIN(1)
call set_f4_device ; set F4 normal or inverted
ld b, 6 -1 ; MAIN(2)+XBAS+MUS+SUB+KNJ lenght -1
call load_blocks ; +7 * 16 kB [DATA]
;----------------------------------------
; call load_blocks ; +1 * 16 kB [DATA] <= HEX-FILE 320k
call load_free_16k ; +1 * 16 kB [FREE] <= HEX-FILE 304k
;----------------------------------------
ld b, 8 -1 ; JIS1 lenght -1
call load_blocks ; +8 * 16 kB [DATA]
jr set_jis2_ena ; a = $b0 (384 kB) JIS2 enabler = Off
;----------------------------------------
; test BIOS on SD-CARD
find_ab:
ld ix, $C000 ; PBR buffer
ld l, (ix + $0E) ; number of reserved
ld h, (ix + $0F) ; sectors
ld a, c
add hl, de
adc a, $00
ld c, a
ld e, (ix + $11) ; number of root
ld d, (ix + $12) ; entries
ld a, e
and $0F
ld b, $04
loop1_ab:
srl d
rr e
djnz loop1_ab
or a ; CY = 0
jr z, parse_ab
inc de
parse_ab:
push de
ld b, (ix + $10) ; FAT type
ld e, (ix + $16) ; number of sectors
ld d, (ix + $17) ; per FAT
ld a, c
loop2_ab:
add hl, de
adc a, $00
djnz loop2_ab
pop de
add hl, de
ex de, hl
ld c, a
push de
push bc
ld b, $01
ld hl, $C000 ; buffer
call read_sd ; read
jr c, exit_ab ; error
ld hl, ($C000) ; first two bytes
ld de, 'B'*256 + 'A' ; 'AB' marker of Disk-ROM
or a ; CY = 0
sbc hl, de ; compare
pop bc
pop de
jr z, exit_ab ; yes marker
scf ; CY = 1 error
;----------------------------------------
exit_ab:
jp c, load_epcs ; test error
; test OK
;----------------------------------------
; load BIOS from SD-CARD
ld a, $80
ld b, 9 ; 9 * 16 kB <= DISK+MAIN(1)
call load_erm
call set_f4_device ; set F4 normal or inverted
test_sdbios_len:
ld b, SDBIOS_LEN - 9 ; +23 * 16k <= MAIN(2)+OTHERS
call load_erm
cpl ; a = $b0 (384 kB) JIS2 enabler = Off
rlca ; a = $c0 (512 kB) JIS2 enabler = On
set_jis2_ena:
out ($4E), a ; set JIS2 enabler
;----------------------------------------
; start system
init_sys:
xor a
ld ($6000), a ; init ESE-RAM adr $6000
inc a
ld ($6800), a ; init ESE-RAM adr $6800
ld ($7000), a ; init ESE-RAM adr $7000
ld ($7800), a ; init ESE-RAM adr $7800
ld a, $C0
out ($A8), a ; ff_ldbios_n <= '1' [emsx_top.vhd]
;----------------------------------------
rst 00 ; reset MSX BASIC
;---------------------------------------- ; $C7 => color 15 (unused/green)
; VDP port 9Ah (set color palette) optimized for otdr
; unused/green , red/blue
db $77 ; color 15 (red/blue) => .db $77, $07
db $05, $55 ; color 14
db $02, $65 ; color 13
db $04, $11 ; color 12
db $06, $64 ; color 11
db $06, $61 ; color 10
db $03, $73 ; color 9
db $01, $71 ; color 8
db $06, $27 ; color 7
db $01, $51 ; color 6
db $03, $27 ; color 5
db $01, $17 ; color 4
db $07, $33 ; color 3
db $06, $11 ; color 2
db $00 ; color 1 (unused/green)
; VDP port 99h (set register)
data_r16: ; optimized for otir
; start otir ----->
db $00 ; color 1 (red/blue)
db $90, $00 ; $00 => R16 (Palette) => color 0
; <----- start otdr
;----------------------------------------
; F4 device
set_f4_device:
ex af, af'
ld a, ($8000 + $002D) ; MSX-ID adr = $002D of MAIN-ROM
sub $03 ; MSX-ID = 3 is MSXtR
out ($4F), a ; $0X = normal, $FX = inverted
out ($F4), a ; force MSX logo = on
rrca ; free16k ($FF) when MSX-ID = 0, 1, 2
or $C9 ; no-logo ($C9) when MSX-ID = 3, 4, 5
ld (fill_free_16k + 1), a
ex af, af'
ret
;----------------------------------------
load_free_16k:
ld hl, $2318 ; set fill_free_16k = on
jr load_skip_fill
load_zero_16k:
ld hl, $2518 ; set fill_zero_16k = on
load_skip_fill:
ld (skip_fill_16k), hl
;----------------------------------------
load_blocks:
ld c, e
inc b ; +1 block (16 kB)
load_erm:
ld ($7000), a ; ermbank2 (8 kB)
inc a
ld ($7800), a ; ermbank3 (8 kB)
inc a
push af
push bc
; load page 16 kB
ld b, $20 ; 32 sectors
ld hl, $8000 ; buffer
get_data:
call read_sd ; or read_epcs (read and load)
pop bc
pop hl
ret c ; error
ld a, h
djnz load_erm
ld h, b ; ld hl, $0000 (default)
ld l, b ; set fill_free_16k = off
ld (skip_fill_16k), hl
ret ; OK
;----------------------------------------
; for EPCS
read_epcs:
push de
push bc
sla e
rl d
ld c, b
xor a ; a = $00
ld b, a
;----------------------------------------
skip_fill_16k:
nop
nop
; jr fill_free_16k ; $1823 => jr +35 bytes
; jr fill_zero_16k ; $1825 => jr +37 bytes
;----------------------------------------
push hl ; +1
ld hl, $4000 ; /CS = 0 ; +3
ld (hl), $03 ; +2
ld (hl), d ; +1
ld (hl), e ; +1
ld (hl), b ; +1
ld a, (hl) ; +1
pop de
loop_epcs: ; +1
ld a, (hl) ; +1
ld (de), a ; +1
inc de ; +1
ld a, (hl) ; +1
ld (de), a ; +1
inc de ; +1
djnz loop_epcs ; 256 cycles * 2 bytes ; +2
dec c ; 32 cycles ; +1
jr nz, loop_epcs ; +2
ld a, ($5000) ; /CS = 1 ; +3
pop bc ; +1
pop hl ; +1
xor a ; +1
ld d, a ; +1
ld e, b ; +1
add hl, de ; +1
ex de, hl ; +1
exit_read_epcs:
adc a, c ; +1
ld c, a ; +1
ret ; +1
;---------------------------------------- ;___
;=35
fill_free_16k:
ld a, $FF ; +2
fill_zero_16k: ;___
ex de, hl ;=37
loop_fill_16k:
ld (de), a
inc de
ld (de), a
inc de
djnz loop_fill_16k ; 256 cycles * 2 bytes
dec c ; 32 cycles
jr nz, loop_fill_16k
pop bc
pop de
xor a
jr exit_read_epcs
;----------------------------------------
; set MMC/SDSC or SDHC
set_cmd:
_Z0026:
ld a, ($FFCF)
cp $03 ; SDHC
jr z, _Z0021
cp $02 ; MMC/SDSC
jr z, _Z0022
scf
ret
;----------------------------------------
; SDHC address set
_Z0021:
ld a, (hl) ; SDHC
ld (hl), b ; CMD
ld (hl), $00
ld (hl), c
ld (hl), d
ld (hl), e
ld (hl), $95 ; CRC
jr _Z0023
; shift address x512
_Z0022:
sla e ; MMC/SDSC
rl d
rl c
; SDSC address set & init status
set_cmd2:
_Z0055:
ld a, (hl)
ld (hl), b ; CMD
ld (hl), c
ld (hl), d
ld (hl), e
ld (hl), $00
ld (hl), $95 ; CRC
jr _Z0023
; init status set2
set_cmd8:
_Z0056:
ld a, (hl)
ld (hl), b ; CMD8
ld (hl), $00
ld (hl), $00
ld (hl), c ; 01
ld (hl), d ; AA
ld (hl), e ; 87(CRC)
; SD command execute
_Z0023:
ld a, (hl)
ld bc, $0010 ; 16 cycles
_Z0024:
ld a, (hl)
cp $FF
ccf
ret nc ; no error
dec bc
ld a, b
or c
jr nz, _Z0024
scf ; error
ret
;----------------------------------------
; MMC/SDSC/SDHC read
test_sd:
_Z0027:
call init_sd
pop bc
pop de
pop hl
ret c ; error
; read from SD-CARD
read_sd:
_Z0001:
push hl
push de
push bc
ld b, $51
ld hl, $4000 ; CMD17 - READ_SINGLE_BLOCK
call set_cmd
jr c, test_sd ; error
pop bc
pop de
pop hl
or a
scf
ret nz ; error
push de
push bc
ex de, hl
ld bc, $0200 ; 512 bytes
ld hl, $4000
_Z0028:
ld a, (hl)
cp $FE
jr nz, _Z0028
ldir
ex de, hl
ld a, (de)
pop bc
ld a, (de)
pop de
inc de
ld a, d
or e
jr nz, _Z0029
inc c
_Z0029:
djnz _Z0001
ret
;----------------------------------------
;SDSC/MMC or SDHC checkflag set
init_sd:
_Z0025:
call _Z0061 ; MMC/SDSC/SDHC init
ret c
ret nz
ld hl, $FFCF
ld a, $03
cp e
jr nz, _Z0062
ld (hl), $03 ; SDHC
jr _Z0063
_Z0062:
ld (hl), $02 ; MMC/SDSC
_Z0063:
xor a
ret
; MMC/SDSC/SDHC init
_Z0061:
ld hl, $4000
ld b, $0A ; 10 bytes
_Z0054:
ld a, ($5000) ; /CS = 1 (bit12)
djnz _Z0054
ld bc, $4000 ; CMD0 - GO_IDLE_STATE
ld de, $0000
call set_cmd2
ret c ; error
and $F3
cp $01
ret nz ; error
ld bc, $4801 ; CMD8
ld de, $AA87 ; CRC:87H
call set_cmd8
ret c ; error
cp $01
jr nz, _Z0057
ld a, (hl)
nop
ld a, (hl)
nop
ld a, (hl)
and $0F
cp $01
ret nz ; error
ld a, (hl)
cp $AA
ret nz ; error
_Z0058:
ld bc, $7700 ; CMD55 - APP_CMD
ld de, $0000
call set_cmd2
ret c ; error
cp $01
ret nz ; error
ld bc, $6940 ; ACMD41 - APP_SEND_OP_COND
ld de, $0000
call set_cmd2
ret c ; error
and $01
cp $01
jr z, _Z0058
ld bc, $7A00 ; CMD58 - READ_OCR
ld de, $0000
call set_cmd2
ret c ; error
ld a, (hl)
cp (hl)
cp (hl)
cp (hl)
bit 6, a
ld e, $02
jr z, _Z0059 ; SDHC
inc e
_Z0059:
xor a
ret
_Z0057:
ld bc, $7700 ; CMD55
ld de, $0000
call set_cmd2
ret c
bit 2, a
jr nz, _Z0060
cp $01
ret nz
ld bc, $6900 ; ACMD41 - APP_SEND_OP_COND
ld de, $0000
call set_cmd2
ret c ; error
bit 2, a
jr nz, _Z0060
bit 0, a
jr nz, _Z0057
xor a
ld e, $01 ; MMC?
ret
_Z0060:
ld bc, $4100 ; CMD1 - SEND_OP_COND
ld de, $0000
call set_cmd2
ret c ; error
cp $01
jr z, _Z0057
ld e, $00
or a
ret
;----------------------------------------
end:
ds 10000h-$,$ff
end
| 38.796992 | 97 | 0.285853 |
56c51a8198f064a7cb9f463e530f59e1a3e1dcf3 | 297 | asm | Assembly | oeis/105/A105332.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/105/A105332.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/105/A105332.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A105332: a(n) = n*(n+1)/2 mod 8.
; Submitted by Christian Krause
; 0,1,3,6,2,7,5,4,4,5,7,2,6,3,1,0,0,1,3,6,2,7,5,4,4,5,7,2,6,3,1,0,0,1,3,6,2,7,5,4,4,5,7,2,6,3,1,0,0,1,3,6,2,7,5,4,4,5,7,2,6,3,1,0,0,1,3,6,2,7,5,4,4,5,7,2,6,3,1,0,0,1,3,6,2,7,5,4,4,5,7,2,6,3,1,0,0,1,3,6
add $0,1
bin $0,2
mod $0,8
| 37.125 | 201 | 0.531987 |
2621371664d1ee5a3ee97122777c7a6b6369593e | 778 | asm | Assembly | oeis/060/A060706.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/060/A060706.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/060/A060706.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A060706: For n >= 1 a(n) is the size of the conjugacy class in the symmetric group S_(4n) consisting of permutations whose cycle decomposition is a product of n disjoint 4-cycles.
; Submitted by Jamie Morken(s3)
; 1,6,1260,1247400,3405402000,19799007228000,210384250804728000,3692243601622976400000,99579809935771673508000000,3910499136177753618659160000000,214428309633170941925556379440000000,15877558615097775565819747672014240000000,1544727677662862584798603251010265409600000000,193013723323974679970585476213732662929520000000000,30382290188426854374169859810803658471735743200000000000,5926187230413411653099327835536496799545943654132800000000000
mov $1,1
mov $2,-1
lpb $0
sub $0,1
add $2,2
mul $1,$2
add $2,1
mul $1,$2
add $2,1
mul $1,$2
lpe
mov $0,$1
| 45.764706 | 442 | 0.830334 |
09a01c80299619b20b45a5e6e931c3412bd96491 | 1,360 | asm | Assembly | asm/amd64/core.asm | drkameleon/elena-lang | 8585e93a3bc0b19f8d60029ffbe01311d0b711a3 | [
"MIT"
] | null | null | null | asm/amd64/core.asm | drkameleon/elena-lang | 8585e93a3bc0b19f8d60029ffbe01311d0b711a3 | [
"MIT"
] | null | null | null | asm/amd64/core.asm | drkameleon/elena-lang | 8585e93a3bc0b19f8d60029ffbe01311d0b711a3 | [
"MIT"
] | null | null | null | // --- Predefined References --
define INIT 10013h
define NEWFRAME 10014h
define EXIT 1001Dh
define PREPARE 10027h
define CORE_OS_TABLE 20009h
// --- System Core Functions --
procedure % INIT
ret
end
procedure % NEWFRAME
ret
end
// ; ==== Command Set ==
// ; close
inline % 15h
mov rsp, rbp
pop rbp
end
// ; validate
inline % 03Ah
cmp dword ptr [rax], eax
end
// ; ncopy (src, tgt)
inline % 42h
mov esi, dword ptr [rax]
mov dword ptr [rdi], esi
end
// ; nadd
inline % 43h
mov edx, dword ptr [rax]
add dword ptr [rdi], edx
end
// ; nsave
inline % 47h
mov dword ptr [rdi], ebx
end
// ; nload
inline % 48h
mov ebx, dword ptr [rax]
end
// ; restore
inline % 92h
add rbp, __arg1
end
// ; aloadfi
inline % 94h
mov rax, qword ptr [rbp+__arg1]
end
// ; aloadsi
inline % 95h
mov rax, qword ptr [rsp+__arg1]
end
// ; open
inline % 98h
push rbp
mov rbp, rsp
end
// ; reserve
inline % 0BFh
sub rsp, __arg1
push rbp
push 0
mov rbp, rsp
end
// ; bloadsi
inline % 0C9h
mov rdi, qword ptr [rsp + __arg1]
end
// ; aloadbi (__arg1 : index)
inline % 0CEh
mov rax, qword ptr [rdi + __arg1]
end
// xcallrm (rdx contains message, __arg1 contains vmtentry)
inline % 0FEh
call code : __arg1
end
| 10.225564 | 59 | 0.590441 |
68869df755e6a0a11f7c13602d4e652465de8eb8 | 9 | asm | Assembly | src/main/fragment/mos6502-common/vbsm1=vbsm1_minus_1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vbum1=vbum1_minus_1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vbum1=vbum1_minus_1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | dec {m1}
| 4.5 | 8 | 0.555556 |
fb9460cf8193e594f2fd4ed2f3e223f9e2bc3dd1 | 6,629 | asm | Assembly | arch/boot.asm | quackerd/fusion | 2bdb8dae04388ac7208a5ecaefeac4e2491ae57e | [
"MIT"
] | 1 | 2017-03-28T19:55:30.000Z | 2017-03-28T19:55:30.000Z | arch/boot.asm | quackerd/fusion | 2bdb8dae04388ac7208a5ecaefeac4e2491ae57e | [
"MIT"
] | null | null | null | arch/boot.asm | quackerd/fusion | 2bdb8dae04388ac7208a5ecaefeac4e2491ae57e | [
"MIT"
] | null | null | null | #define ASM_FILE
#include <arch/mlayout.h>
#include "multiboot2.h"
%define BOCHS_BREAK xchg bx, bx
%define GET_PADDR(x) ((x) - KERN_BASE_START)
%define GET_PML4(vaddr) (((vaddr) >> 39 ) & 0x1FF)
%define GET_PDPT(vaddr) (((vaddr) >> 30 ) & 0x1FF)
%define GET_PDE(vaddr) (((vaddr) >> 21 ) & 0x1FF)
; make arch_init_32 visiable
global arch_init_32
; arch_main is the C long mode entry point
extern arch_main
section .text
bits 32
; the bootloader calls this dude, we switch to long mode with some basic setup:
; Identity map the first 4G memory, where the kernel binary and multiboot info is
; Map the first 4G memory to KERN_PMAP temporarily so we have access to printf
; Map the first 1G memory, which contains the kernel, to KERN_BASE_START
arch_init_32:
cli ; close interrupt
cld ; set direction
cmp eax, MULTIBOOT2_BOOTLOADER_MAGIC ; compare with multiboot2 magic
jne .end ; if not loaded by multiboot2 compliant bootloader, loop infinitely
BOCHS_BREAK
; save multiboot info
mov dword [GET_PADDR(multiboot_info_ptr)], ebx
; disable paging first
mov eax, cr0 ; Set the A-register to control register 0.
and eax, ~(1 << 31) & 0xFFFFFFFF ; Clear the PG-bit, which is bit 31, and hack to get rid of warning
mov cr0, eax ; Set control register 0 to the A-register.
; identity map the first 4G page
mov eax, GET_PADDR(kern_early_pml4)
add eax, GET_PML4(0) * 8 ; eax = offset of pml4e in pml4 for the 0th GB
mov dword [eax], GET_PADDR(kern_early_ident_pdpt) + 11b ; let the corresponding pml4e point to the kern_early_ident_pdpt
mov eax, GET_PADDR(kern_early_ident_pdpt)
add eax, GET_PDPT(0) * 8
mov ebx, 10000011b ; ebx lower bits is attribute = R/W + SU + 1G page, high bits = physical 0th GB
mov ecx, 4 ; 4 times = 4GB
.l0:
mov dword [eax], ebx ; set the corresponding pdpte to map 1GB pages in ebx
add ebx, 1*1024*1024*1024 ; add another 1G to ebx higher bits
add eax, 8 ; increment to next pdpte
loop .l0
; map the first 4G to pmap
mov eax, GET_PADDR(kern_early_pml4)
add eax, GET_PML4(KERN_PMAP_START) * 8 ; eax = offset of pml4e in pml4 for PMAP region
mov dword [eax], GET_PADDR(kern_early_pmap_pdpt) + 11b ; let the corresponding pml4e point to the kern_early_pmap_pdpt
mov eax, GET_PADDR(kern_early_pmap_pdpt)
add eax, GET_PDPT(KERN_PMAP_START) * 8
mov ebx, 10000011b ; ebx lower bits is attribute = R/W + SU + 1G page, high bits = physical 0th GB
mov ecx, 4 ; 4 times = 4GB
.l1:
mov dword [eax], ebx ; set the corresponding pdpte to map 1GB pages in ebx
add ebx, 1*1024*1024*1024 ; add another 1G to ebx higher bits
add eax, 8 ; increment to next pdpte
loop .l1
; map the first 1G to kern_base
; point the first PML4 entry to the identity pdpt
mov eax, GET_PADDR(kern_early_pml4)
add eax, GET_PML4(KERN_BASE_START) * 8
mov dword [eax], GET_PADDR(kern_early_img_pdpt) + 11b ; let the corresponding pml4e point to the kern_early_img_pdpt
mov eax, GET_PADDR(kern_early_img_pdpt)
add eax, GET_PDPT(KERN_BASE_START) * 8
mov dword [eax], 10000011b ; ebx lower bits is attribute = R/W + SU + 1G page, high bits = physical 0th GB
BOCHS_BREAK
; enable PAE
mov eax, cr4 ; Set the A-register to control register 4.
or eax, 1 << 5 ; Set the PAE-bit, which is the 6th bit (bit 5).
mov cr4, eax ; Set control register 4 to the A-register.
; enable long mode
mov ecx, 0xC0000080 ; Set the C-register to 0xC0000080, which is the EFER MSR.
rdmsr ; Read from the model-specific register.
or eax, 1 << 8 ; Set the LM-bit which is the 9th bit (bit 8).
wrmsr ; Write to the model-specific register.
; let cr3 point at page table
mov eax, GET_PADDR(kern_early_pml4)
mov cr3, eax
xchg bx, bx
; enable paging, enter compatibility mode
mov eax, cr0 ; Set the A-register to control register 0.
or eax, 1 << 31 ; Set the PG-bit, which is bit 31.
mov cr0, eax ; Set control register 0 to the A-register.
; now we are in compat mode
; load the long mode GDT
lgdt [GET_PADDR(kern_early_gdt.ptr)]
; switch to long mode
jmp kern_early_gdt.code:GET_PADDR(arch_init_64)
; should not reach this point
.end:
jmp $
section .data
bits 32
multiboot_info_ptr:
dd 0
section .text
bits 64
arch_init_64:
; note that we are in long mode but rip is still lower
; switch to high address
mov rax, .high
jmp rax
.high:
; set proper segment registers
mov ax,kern_early_gdt.data
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
mov ss,ax
; initial kernel stack, 4k
mov rsp, kern_early_stack
xor rdi, rdi
mov edi, dword [multiboot_info_ptr]
; init arch
call arch_main
; should not reach this point
jmp $
section .data
bits 64
align 0x1000
times KERN_PAGE_SZ db 0
kern_early_stack:
align 0x1000
kern_early_pml4:
times 0x1000 db 0
align 0x1000
kern_early_ident_pdpt:
times 0x1000 db 0
align 0x1000
kern_early_pmap_pdpt:
times 0x1000 db 0
align 0x1000
kern_early_img_pdpt:
times 0x1000 db 0
kern_early_gdt: ; Global Descriptor Table (long mode).
.null: equ $ - kern_early_gdt ; The null descriptor.
dw 0 ; Limit (low).
dw 0 ; Base (low).
db 0 ; Base (middle)
db 0 ; Access.
db 0 ; Granularity.
db 0 ; Base (high).
.code: equ $ - kern_early_gdt ; The code descriptor.
dw 0 ; Limit (low).
dw 0 ; Base (low).
db 0 ; Base (middle)
db 10011010b ; Access (exec/read).
db 00100000b ; Granularity.
db 0 ; Base (high).
.data: equ $ - kern_early_gdt ; The data descriptor.
dw 0 ; Limit (low).
dw 0 ; Base (low).
db 0 ; Base (middle)
db 10010010b ; Access (read/write).
db 00000000b ; Granularity.
db 0 ; Base (high).
.ptr:
; GDT PTR
dw $ - kern_early_gdt - 1 ; Limit.
dq GET_PADDR(kern_early_gdt) ; Base.
| 34.889474 | 124 | 0.611555 |
21aa22f1cd9885d18324c7a25ab288efdeff5134 | 4,716 | asm | Assembly | smsq/smsq/base.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | smsq/smsq/base.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | smsq/smsq/base.asm | olifink/smsqe | c546d882b26566a46d71820d1539bed9ea8af108 | [
"BSD-2-Clause"
] | null | null | null | ; Initialise SMSQ V2.02 1994 Tony Tebby
; 2003-01-22 2.03 use sms_dlan to copy default language (wl)
section base
xdef smsq_base
xref init_vec ; initialise vector area
xref init_trp ; initialise traps
xref init_sys ; initialise system variables
xref init_exrv ; initialise exception redir vector
xref init_sbst ; initialise SBASIC stub
xref init_ext ; initialise extensions
;sbtrns xref mem_atpa
xref mem_achp
xref.l smsq_vers
xref smsq_end
include 'dev8_keys_sys'
include 'dev8_keys_jcbq'
include 'dev8_keys_chp'
include 'dev8_keys_err'
include 'dev8_keys_sbasic'
include 'dev8_keys_qdos_sms'
include 'dev8_smsq_smsq_base_keys'
include 'dev8_smsq_smsq_ini_keys'
include 'dev8_smsq_smsq_config_keys'
include 'dev8_mac_assert'
smsq_base
lea ini_sstk,a7 ; set ssp
move.l #$20400,-(sp) #####
bsr.l blat #####
addq.l #4,sp
bra.l sms_reset ; reset
section init
sms_reset
move.l sms.usetop,d7 ; top of usable memory
tst.l sms.framt ; fast RAM installed?
bne.s sms_init ; ... yes, ignore request
cmp.l a4,d7 ; requested above useable top
bls.s sms_init ; ... yes, ignore request
move.l a4,d7 ; set requested RAMTOP
sms_init
jsr smsi_qmon ***********
moveq #0,d0
lea $20000,a0
move.b ini_ouch,d1 ; save ouch status
smsi_cll
move.l d0,(a0)+ ; clear low memory
cmp.l d7,a0
blt.s smsi_cll
move.b d1,ini_ouch
move.l #$20400,-(sp) #####
bsr.l blat #####
jsr init_vec ; initialise vector area
bsr.l blat #####
jsr smsi_qmon ***********
jsr init_trp ; initialise TRAP vectors
bsr.l blat #####
; jsr smsi_qmon ***********
jsr init_sys ; initialise system vars
bsr.l blat #####
; jsr smsi_qmon ***********
jsr init_exrv ; initialise exception redirection vec
bsr.l blat #####
; jsr smsi_qmon ***********
jsr init_sbst ; initialise SuperBASIC stub
bsr.l blat #####
; jsr smsi_qmon ***********
; system initialisation complete
move.l #sb.jobsz+jcb_end,d1 ; set up job
;sbtrns jsr mem_atpa ; starting here, if it ever does
; if this is changed back, look for all ;sbtrns
jsr mem_achp ; starting here, if it ever does
bsr.l blat #####
lea chp.len(a0),a2
move.w #(jcb_end-chp.len)/4-1,d0
smsi_jclear
clr.l (a2)+
dbra d0,smsi_jclear
move.l sys_jbtb(a6),a1 ; job table
move.l a0,(a1) ; job 0
move.l a1,sys_jbpt(a6) ; current job
move.b #32,jcb_pinc(a0) ; priority 32
move.l sys_ertb(a6),jcb_exv(a0) ; exception redirection table
lea jcb_end(a0),a6
lea sb.jobsz(a6),a1
move.l a1,usp
bsr.l blat #####
; jsr smsi_qmon ***********
move.l (sp)+,d0 #####
move.w #$0700,sr ; go, but no interrupts yet!!
move.l d0,-(sp) #####
smsi_job
bsr.l blatu #####
jsr init_ext ; initialise (SBASIC and) extensions
bsr.l blatu #####
trap #0
move.w sms_dlan+sms.conf,d1 ; default language
moveq #0,d2
moveq #sms.lset,d0 ; set it
trap #do.smsq
moveq #0,d1 ; default tra
moveq #0,d2
moveq #sms.trns,d0
trap #do.smsq
move.l sms.sysb,a0
clr.w sys_chtg(a0) ; start channels at 0,0
moveq #0,d7
move.b sms_bwin+sms.conf,d7
swap d7
move.b sms_bflp+sms.conf,d7
move.l sms.sbjob,a0
and.w #$dfff,sr ; user mode
jmp (a0) ; start job with config in d7
; and a0 <> 0
smsi_qmon
tst.b ini_ouch
beq.s smsi_rts
lea smsq_base-4,a0
smsi_next
move.l (a0),d0
beq.s smsi_rts
move.l d0,a0
cmp.l #'QMON',8(a0) ; is it QMON?
bne.s smsi_next ; ... no
jmp $c(a0) ; call qmon
smsi_rts
rts
blatu
tst.b ini_ouch
bgt.s blatx
rts
blat
tst.b ini_ouch
beq.s blat_rts
blt.s x_flash
blatx
cmp.b #1,ini_ouch ; only produce blats on ini_ouch = 1
bne.s blat_rts
movem.l d0/a4,-(sp)
move.l $0c(sp),a4
move.l #$ffff0000,(a4)
addq.l #4,$0c(sp)
move.l #4000000,d0
subq.l #1,d0
bgt.s *-2
movem.l (sp)+,d0/a4
blat_rts
rts
; This flash routine sends the net low for one period, then high for one period.
; This is repeated a4 times and then there are two periods low.
; The sequence is repeated once again and followed by a double pause.
include 'dev8_smsq_qxl_keys'
x_flash
; rts
movem.l d0/d1,-(sp)
addq.l #1,$0c(sp) ; increment
move.l $0c(sp),d0
bsr.s flash1 ; flash once
move.l $0c(sp),d0
bsr.s flash1 ; and again
bsr.s flashidle ; extra idel
movem.l (sp)+,d0/d1
rts
flashlp
tst.b qxl_netl ; net low
bsr.s flashp
tst.b qxl_neth ; net high
bsr.s flashp
flash1
subq.b #1,d0
bcc.s flashlp ; ... and repeat
tst.b qxl_netl ; idle low
flashidle
bsr.s flashp
nop
flashp
move.l #1000000,d1 ; 1,000,000 cycles for about .2 sec
move.l #300000,d1 ; 1,000,000 cycles for about .2 sec
subq.l #1,d1
bne.s *-2
rts
end
| 21.633028 | 80 | 0.656913 |
7a33c390ea9ec5b5f82638b58e1667fad2de3d57 | 3,822 | asm | Assembly | 9LAB/bar5.asm | RustyRaptor/compilers | 2f27179a9219ee61ed4e32b7fd4802e22aa19863 | [
"Unlicense"
] | null | null | null | 9LAB/bar5.asm | RustyRaptor/compilers | 2f27179a9219ee61ed4e32b7fd4802e22aa19863 | [
"Unlicense"
] | null | null | null | 9LAB/bar5.asm | RustyRaptor/compilers | 2f27179a9219ee61ed4e32b7fd4802e22aa19863 | [
"Unlicense"
] | null | null | null | # PACKAGE fibinaci
.data # Data section starts here, strings first
_L0: .asciiz "in fib"
_L1: .asciiz "hello"
_NL: .asciiz "\n" # NEWLINE STRING
.align 2 # start all global variable aligned
y: .word 7 # global var initialized
Z: .space 4 # global var uninitialized
A: .space 400 # global var uninitialized
x: .word 1 # global var initialized
.text # start of text segment (code)
.globl main # Force MIPS to start at main label
fib: # MAIN METHOD LABEL
subu $t0 $sp 44 #set up $t0 to be the new spot for SP
sw $ra ($t0) #Store the return address in offset 0
sw $sp 4($t0) #Store the old stack pointer in offset 4
move $sp $t0 #set the stack pointer to the new value
la $a0, _L0 #expr constant is a string
li $v0 4 #set up write call
syscall #print a string
li $v0, 4 #print NEWLINE
la $a0, _NL #print NEWLINE string location
syscall #call print a NEWLINE
li $a0, 8 #offset for variable address
add $a0, $a0, $sp #exact location for stack variable
lw $a0 ($a0) #load from the memory address a value
sw $a0, 16($sp) #store $a0 (LHS) temporarily so we can eval RHS
li $a0, 0 #expr constant value
move $a1, $a0 #move RHS to $a1
lw $a0, 16($sp) #get LHS from storage
sle $a0, $a0, $a1 #less than or eq to
beq $a0 $0 _L2 #Branch to first label if expression is 0
j _L3 #And the cow jumped over the else 🐄
_L2: #First Label for entering else
_L3: #Second Label for jumping over the else
li $a0, 8 #offset for variable address
add $a0, $a0, $sp #exact location for stack variable
lw $a0 ($a0) #load from the memory address a value
sw $a0, 20($sp) #store $a0 (LHS) temporarily so we can eval RHS
li $a0, 1 #expr constant value
move $a1, $a0 #move RHS to $a1
lw $a0, 20($sp) #get LHS from storage
seq $a0, $a0, $a1 #equal to
beq $a0 $0 _L4 #Branch to first label if expression is 0
j _L5 #And the cow jumped over the else 🐄
_L4: #First Label for entering else
_L5: #Second Label for jumping over the else
li $v0 0 #return NULL zero (0)
lw $ra ($sp) #reset return address
lw $ra 4($sp) #reset stack pointer
main: # MAIN METHOD LABEL
subu $t0 $sp 32 #set up $t0 to be the new spot for SP
sw $ra ($t0) #Store the return address in offset 0
sw $sp 4($t0) #Store the old stack pointer in offset 4
move $sp $t0 #set the stack pointer to the new value
li $a0, 4 #expr constant value
sw $a0, 12($sp) #Store the argument value in the stack
li $a0, 4 #expr constant value
lw $a0, 12($sp) #load the argument from the stack to a0, a1, a2, a3 respectively and as necessary
sw $a0 16($sp) #store RHS of assign temporarily
li $a0, 8 #offset for variable address
add $a0, $a0, $sp #exact location for stack variable
lw $a1, 16($sp) #load back RHS into $a1
sw $a1, ($a0) #Store assign value
#EMIT PRINT INT HERE
li $a0, 5 #expr constant value
li $v0 1 #set up write call
syscall #print a number
li $v0, 4 #print NEWLINE
la $a0, _NL #print NEWLINE string location
syscall #call print a NEWLINE
la $a0, _L1 #expr constant is a string
li $v0 4 #set up write call
syscall #print a string
li $v0, 4 #print NEWLINE
la $a0, _NL #print NEWLINE string location
syscall #call print a NEWLINE
#EMIT PRINT INT HERE
li $a0, 28 #offset for variable address
add $a0, $a0, $sp #exact location for stack variable
lw $a0 ($a0) #load from the memory address a value
li $v0 1 #set up write call
syscall #print a number
li $v0, 4 #print NEWLINE
la $a0, _NL #print NEWLINE string location
syscall #call print a NEWLINE
li $v0 0 #return NULL zero (0)
lw $ra ($sp) #reset return address
lw $ra 4($sp) #reset stack pointer
li $v0, 10 #Main function ends
syscall #MAIN FUNCTION EXIT
| 32.389831 | 100 | 0.661434 |
d35e735f4b881355f312cea23658a6f196121dae | 1,882 | asm | Assembly | AOC/Meus Exercicios/Aula11/exercicio4.asm | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 10 | 2020-12-08T20:18:15.000Z | 2021-06-07T20:00:07.000Z | AOC/Meus Exercicios/Aula11/exercicio4.asm | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-06-28T03:42:13.000Z | 2021-06-28T16:53:13.000Z | AOC/Meus Exercicios/Aula11/exercicio4.asm | joao-frohlich/BCC | 9ed74eb6d921d1280f48680677a2140c5383368d | [
"Apache-2.0"
] | 2 | 2021-01-14T19:59:20.000Z | 2021-06-15T11:53:21.000Z | .data
poli_text: .asciiz "Dado o polinomio y = ax^3+bx^2+cx+d\nInsira os valores de a,b,c e d\n"
x_text: .asciiz "Insira o valor de x: "
ans_text: .asciiz "Y no ponto informado: "
.text
# Vinicius Gasparini
.globl main
main:
ori $v0, $zero, 4 # call code para print_str
la $a0, poli_text # carregando str para arg da syscall
syscall
addi $sp, $sp, -16 # avancando stack pointer
li $v0, 5 # call code para read_int
syscall
sw $v0, 0($sp) # carregando valor de a para stack
li $v0, 5 # call code para read_int
syscall
sw $v0, 4($sp) # carregando valor de b para stack
li $v0, 5 # call code para read_int
syscall
sw $v0, 8($sp) # carregando valor de c para stack
li $v0, 5 # call code para read_int
syscall
sw $v0, 12($sp) # carregando valor de d para stack
ori $v0, $zero, 4 # call code para print_str
la $a0, x_text # carregando str para arg da syscall
syscall
li $v0, 5 # call code para read_int
syscall
move $a1, $v0 # carregando valor de x para arg
jal polinomio
move $s0, $v0
ori $v0, $zero, 4 # call code para print_str
la $a0, ans_text # carregando str para arg da syscall
syscall
move $a0, $s0 # carregando resultado para o arg da funcao
ori $v0, $zero, 1 # call code para print_int
syscall
end:
ori $v0, $zero, 10 # call code para exit
syscall
polinomio:
lw $s0, 0($sp) # $s0 = a
addi $sp, $sp, 4 # recuando stack pointer
lw $s1, 0($sp) # $s1 = b
addi $sp, $sp, 4 # recuando stack pointer
lw $s2, 0($sp) # $s2 = c
addi $sp, $sp, 4 # recuando stack pointer
lw $s3, 0($sp) # $s3 = d
or $s4, $a1, $zero # $s4 = x
mul $t0, $s4, $s4 # x^2
mul $t1, $t0, $s4 # x^3
mul $s0, $t1, $s0 # a* x^3
mul $s1, $t0, $s1 # b* x^2
mul $s2, $s4, $s2 # c*x
add $v0, $s3, $s2 # d + c*x
add $v0, $v0, $s1 # d + c*x + b* x^2
add $v0, $v0, $s0 # d + c*x + b* x^2 + a* x^3
jr $ra
| 24.128205 | 92 | 0.610521 |
462d7d3e1ce47e78bb52627ce379e4fdcb717a9f | 636 | asm | Assembly | oeis/310/A310423.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/310/A310423.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/310/A310423.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A310423: Coordination sequence Gal.6.326.1 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
; Submitted by Jon Maiga
; 1,4,10,14,20,26,32,38,44,48,54,58,62,68,72,78,84,90,96,102,106,112,116,120,126,130,136,142,148,154,160,164,170,174,178,184,188,194,200,206,212,218,222,228,232,236,242,246,252,258
mov $1,$0
mul $0,12
seq $1,314165 ; Coordination sequence Gal.5.307.2 where G.u.t.v denotes the coordination sequence for a vertex of type v in tiling number t in the Galebach list of u-uniform tilings.
mul $1,2
mod $0,$1
sub $1,$0
mov $0,$1
div $0,2
| 48.923077 | 182 | 0.734277 |
1c28abe6d6d6e7d7119c875e510c03adf618ce9b | 287 | asm | Assembly | spectranet/libspectranet/spectranet_detect.asm | speccytools/spectranet-gdbserver | c76acd970e5e8bbf793d8514bf64c32a180c26a4 | [
"MIT"
] | 40 | 2021-07-23T21:33:59.000Z | 2022-02-07T19:07:46.000Z | spectranet/libspectranet/spectranet_detect.asm | speccytools/spectranet-gdbserver | c76acd970e5e8bbf793d8514bf64c32a180c26a4 | [
"MIT"
] | null | null | null | spectranet/libspectranet/spectranet_detect.asm | speccytools/spectranet-gdbserver | c76acd970e5e8bbf793d8514bf64c32a180c26a4 | [
"MIT"
] | 2 | 2021-08-02T17:49:03.000Z | 2021-10-09T21:53:41.000Z | ; int __FASTCALL__ spectranet_detect(void);
PUBLIC spectranet_detect
EXTERN libspectranet
include "spectranet.asm"
.spectranet_detect
push bc
ld bc,CTRLREG
ld a,5 ;cyan
ei
halt
out (0xFE),a
in a,(c)
and 0x07 ;mask off bits
pop bc
and a
ld hl, 0
cp 5
ret z
ld hl, -1
ret
| 13.045455 | 43 | 0.714286 |
abf530eee1c299dc1021f2daafe6f798f4fc8931 | 1,934 | asm | Assembly | SOURCE/base/boot/SingLdrPc/x64/bllrb0.asm | pmache/singularityrdk | 090dbe7d1314fd4938d259abc103c4f3310798e5 | [
"MIT"
] | 3 | 2020-05-30T09:57:51.000Z | 2020-05-30T10:01:47.000Z | SOURCE/base/boot/SingLdrPc/x64/bllrb0.asm | pmache/singularityrdk | 090dbe7d1314fd4938d259abc103c4f3310798e5 | [
"MIT"
] | 1 | 2020-05-29T08:14:06.000Z | 2020-05-29T08:14:06.000Z | SOURCE/base/boot/SingLdrPc/x64/bllrb0.asm | pmache/singularityrdk | 090dbe7d1314fd4938d259abc103c4f3310798e5 | [
"MIT"
] | null | null | null | ;++
;
; Copyright (c) Microsoft Corporation
;
; Module Name:
;
; bllrb0.asm
;
; Abstract:
;
; This module implements utility functions for the boot reloader.
;
; Environment:
;
; Boot reloader.
;
;--
.code
externdef main:NEAR
;++
;
; VOID
; BlLrbEnter(
; uint pConfig, ulong pVars
; )
;
; Routine Description:
;
; This function adjusts the stack, then enters the C code.
;
;--
BlLrbEnter proc
mov edx, [rsp+8]
mov ecx, [rsp]
mov rsp, 07b00h
jmp main
BlLrbEnter endp
;++
;
; ULONG_PTR
; BlMmGetCr3(
; VOID
; )
;
; Routine Description:
;
; This function queries the CR3 register.
;
; Return Value:
;
; Value of the CR3 register.
;
;--
BlMmGetCr3 proc
mov rax, cr3
ret
BlMmGetCr3 endp
;++
;
; VOID
; BlMmSetCr3(
; ULONG_PTR Value
; )
;
; Routine Description:
;
; This function sets the CR3 register.
;
; Arguments:
;
; Value - Supplies the value to write to the CR3 register.
;
;--
BlMmSetCr3 proc
mov cr3, rcx
ret
BlMmSetCr3 endp
;++
;
; VOID
; BlMmGetGdtr(
; PGDTR Gdtr
; )
;
; Routine Description:
;
; This function queries the GDTR register.
;
; Arguments:
;
; Gdtr - Receives the contents of the GDTR register.
;
;--
BlMmGetGdtr proc
sgdt fword ptr [rcx]
ret
BlMmGetGdtr endp
;++
;
; VOID
; BlMmSetGdtr(
; PGDTR Gdtr
; )
;
; Routine Description:
;
; This function sets the GDTR register.
;
; Arguments:
;
; Gdtr - Supplies the data to write to the GDTR register.
;
;--
BlMmSetGdtr proc
lgdt fword ptr [rcx]
ret
BlMmSetGdtr endp
;++
;
; ULONG_PTR
; BlMmGetRsp(
; VOID
; )
;
; Routine Description:
;
; This function queries the RSP register.
;
; Return Value:
;
; Value of the RSP register.
;
;--
BlMmGetRsp proc
mov rax, rsp
ret
BlMmGetRsp endp
end
| 11.580838 | 69 | 0.583764 |
26f00e3c957f496ae6026007fb0a3b4b42b53f94 | 10,254 | asm | Assembly | dino/lcs/enemy/0.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | dino/lcs/enemy/0.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | dino/lcs/enemy/0.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
00042A move.l D1, (A0)+
00042C dbra D0, $42a
00490E move.l D0, (A4)+
004910 move.l D0, (A4)+
004AF4 cmpi.b #$1, ($0,A6)
004AFA bne $4b0c [enemy+ 0]
004B26 cmpi.b #$1, ($0,A6)
004B2C bne $4b3e [enemy+ 0]
004D38 move.l D0, (A4)+
004D3A move.l D0, (A4)+
00650A btst #$0, ($0,A1)
006510 beq $6558 [enemy+ 0]
00FE30 move.b #$1, ($0,A0)
00FE36 move.w ($4,A2), ($20,A0) [enemy+ 0, etc+ 0, item+ 0]
00FEEE move.b #$1, ($0,A0)
00FEF4 move.w ($4,A2), ($20,A0) [enemy+ 0]
01085A btst #$1, ($0,A3)
010860 bne $10896 [enemy+ 0]
010972 btst #$1, ($0,A3)
010978 bne $109aa [enemy+ 0]
010A1E move.b #$2, ($0,A3)
010A24 move.l #$2020000, ($4,A3) [enemy+ 0]
010FC2 btst #$1, ($0,A3)
010FC8 bne $10fe6 [enemy+ 0]
011072 move.b #$2, ($0,A3)
011078 move.l #$2020000, ($4,A3) [enemy+ 0]
011356 btst #$1, ($0,A3)
01135C bne $1137a [enemy+ 0]
0113BE move.b #$2, ($0,A3) [enemy+ 2]
0113C4 move.l #$2020000, ($4,A3) [enemy+ 0]
011882 btst #$1, ($0,A3)
011888 bne $11890 [enemy+ 0]
0118DA move.b #$2, ($0,A3)
0118E0 move.b ($5e,A2), ($5e,A3) [enemy+ 0]
011AE8 btst #$1, ($0,A3)
011AEE bne $11b20 [enemy+ 0]
011B8A move.b #$2, ($0,A3)
011B90 move.l #$2020000, ($4,A3) [enemy+ 0]
011E82 btst #$1, ($0,A3)
011E88 bne $11e90 [enemy+ 0]
011EEA move.b #$2, ($0,A3) [enemy+5E]
011EF0 move.b #$ff, ($2,A3) [enemy+ 0]
0121EC btst #$1, ($0,A3)
0121F2 bne $12220 [enemy+ 0]
01224A move.b #$2, ($0,A3) [enemy+ 2]
012250 move.l #$2020000, ($4,A3) [enemy+ 0]
012356 btst #$1, ($0,A3)
01235C bne $1238a [enemy+ 0]
0123B4 move.b #$2, ($0,A3) [enemy+ 2]
0123BA move.l #$2020000, ($4,A3) [enemy+ 0]
014210 tst.b ($0,A1) [123p+ 70]
014214 beq $14226 [123p+ 0, enemy+ 0]
0195BC tst.b ($0,A0)
0195C0 beq $19614 [enemy+ 0]
023428 tst.b ($0,A6)
02342C beq $23436 [enemy+ 0]
02AF94 move.b #$1, ($0,A6) [enemy+ 4, enemy+ 6]
02AF9A moveq #$0, D0 [enemy+ 0]
02B234 move.b #$1, ($0,A6) [enemy+81]
02B23A move.w ($80,A6), D0 [enemy+ 0]
02B55C move.b #$1, ($0,A6) [enemy+9A]
02B562 move.w ($84,A6), D0 [enemy+ 0]
032464 tst.b ($0,A1)
032468 beq $324ce [enemy+ 0]
03380A move.b #$1, ($0,A0)
033810 move.w #$8, ($20,A0) [enemy+ 0]
03590A move.b #$1, ($0,A0)
035910 move.w #$c, ($20,A0) [enemy+ 0]
035940 move.b #$1, ($0,A1) [enemy+ 5]
035946 move.w #$f8, ($20,A1) [enemy+ 0]
035972 move.b #$1, ($0,A2) [enemy+A6]
035978 move.w #$0, ($26,A2) [enemy+ 0]
038E1A move.b #$2, ($0,A6)
038E20 move.l #$3906a, ($40,A6) [enemy+ 0]
038E54 move.b #$1, ($0,A0)
038E5A move.w #$cc, ($20,A0) [enemy+ 0]
038E9C move.b #$1, ($0,A0)
038EA2 move.w #$d4, ($20,A0) [enemy+ 0]
038EEA move.b #$1, ($0,A0)
038EF0 move.w #$e8, ($20,A0) [enemy+ 0]
038F0C move.b #$1, ($0,A0)
038F12 move.w #$e8, ($20,A0) [enemy+ 0]
03B2B6 move.b #$2, ($0,A6) [enemy+40, enemy+42]
03B2BC move.b #$ff, ($7d,A6) [enemy+ 0]
040268 move.b #$1, ($0,A1)
04026E move.w #$38, ($20,A1) [enemy+ 0]
0402A6 move.b #$1, ($0,A0) [enemy+ 5]
0402AC move.w #$f0, ($20,A0) [enemy+ 0]
0402C4 move.b #$1, ($0,A2) [enemy+A2]
0402CA move.w #$f0, ($20,A2) [enemy+ 0]
04046E move.b #$1, ($0,A0)
040474 move.w #$88, ($20,A0) [enemy+ 0]
040F9A move.b #$1, ($0,A0)
040FA0 move.w #$a4, ($20,A0) [enemy+ 0]
041D9E tst.b ($0,A1)
041DA2 beq $41e36 [enemy+ 0]
041EF2 move.b #$1, ($0,A0)
041EF8 move.w #$3c, ($20,A0) [enemy+ 0]
0420C6 move.b #$1, ($0,A0)
0420CC move.w #$40, ($20,A0) [enemy+ 0]
04214E move.b #$1, ($0,A0)
042154 move.w #$44, ($20,A0) [enemy+ 0]
042184 move.b #$1, ($0,A0)
04218A move.w #$44, ($20,A0) [enemy+ 0]
0423B8 move.b #$2, ($0,A6)
0423BE move.b #$ff, ($7d,A6) [enemy+ 0]
042452 tst.b ($0,A3)
042456 bne $4245e [enemy+ 0]
048548 move.b #$2, ($0,A6)
04854E move.w ($8,A6), ($ae,A6) [enemy+ 0]
048C0C move.b #$2, ($0,A6) [enemy+A8]
048C12 moveq #$0, D0 [enemy+ 0]
048CE2 move.b #$2, ($0,A6) [enemy+A4]
048CE8 clr.b ($c0,A6) [enemy+ 0]
048D0C move.b #$1, ($0,A6)
048D12 bra $48768 [enemy+ 0]
048E34 move.b #$1, ($0,A6)
048E3A tst.b ($a4,A6) [enemy+ 0]
049244 cmpi.b #$1, ($0,A0)
04924A bne $49292 [123p+ 0, enemy+ 0]
0492E2 cmpi.b #$1, ($0,A0)
0492E8 bne $49330 [123p+ 0, enemy+ 0]
04DCCE move.b #$1, ($0,A0)
04DCD4 move.w #$74, ($20,A0) [enemy+ 0]
04EBF2 move.b #$2, ($0,A6) [enemy+A8]
04EBF8 clr.w ($6,A6) [enemy+ 0]
04EF1A move.b #$1, ($0,A6)
04EF20 tst.b ($a4,A6) [enemy+ 0]
04F300 tst.b ($0,A0)
04F304 beq $4f34c [123p+ 0, enemy+ 0]
04FD02 move.b #$1, ($0,A0)
04FD08 move.w #$7c, ($20,A0) [enemy+ 0]
04FD3A move.b #$1, ($0,A1) [enemy+ 5]
04FD40 move.w #$80, ($20,A1) [enemy+ 0]
04FE68 move.b #$1, ($0,A6) [base+502]
04FE6E subq.w #1, ($c6,A6) [enemy+ 0]
04FE74 move.b #$2, ($0,A6)
04FE7A bra $4fe80 [enemy+ 0]
0512D6 move.b #$2, ($0,A6)
0512DC move.b #$ff, ($7d,A6) [enemy+ 0]
0538C2 move.b #$2, ($0,A6) [enemy+A4]
0538C8 clr.b ($c0,A6) [enemy+ 0]
053974 move.b #$2, ($0,A6) [enemy+A0]
05397A clr.w ($6,A6) [enemy+ 0]
0558B6 move.b #$1, ($0,A6)
0558BC move.b #$ff, ($7d,A6) [enemy+ 0]
055A86 move.b #$1, ($0,A0)
055A8C move.w #$a8, ($20,A0) [enemy+ 0]
056580 move.b #$2, ($0,A6)
056586 move.b #$ff, ($7d,A6) [enemy+ 0]
056716 move.b #$1, ($0,A0)
05671C move.w #$c0, ($20,A0) [enemy+ 0]
056938 move.b #$2, ($0,A6)
05693E move.b #$0, ($5,A6) [enemy+ 0]
056A84 move.b #$2, ($0,A6)
056A8A move.l #$56c38, ($40,A6) [enemy+ 0]
056C94 move.b #$2, ($0,A6)
056C9A move.l #$5708c, ($40,A6) [enemy+ 0]
057198 move.b #$2, ($0,A6) [enemy+ 4]
05719E move.l #$5727a, ($40,A6) [enemy+ 0]
0571CA move.b #$1, ($0,A0)
0571D0 move.w #$cc, ($20,A0) [enemy+ 0]
0572B8 move.b #$2, ($0,A6)
0572BE moveq #$0, D0 [enemy+ 0]
05764A move.b #$2, ($0,A6) [enemy+ 4]
057650 move.l #$57682, ($40,A6) [enemy+ 0]
0576E6 move.b #$2, ($0,A6)
0576EC move.l #$577d2, ($40,A6) [enemy+ 0]
057870 move.b #$1, ($0,A6)
057876 jsr $119c.l [enemy+ 0]
057CB0 move.b #$2, ($0,A6)
057CB6 move.l #$57d84, ($40,A6) [enemy+ 0]
057D12 move.b #$1, ($0,A0)
057D18 move.w #$e4, ($20,A0) [enemy+ 0]
057DA8 move.b #$2, ($0,A6)
057DAE move.l #$57e0e, ($40,A6) [enemy+ 0]
057E72 move.b #$2, ($0,A6)
057E78 move.l #$57f44, ($40,A6) [enemy+ 0]
057F72 move.b #$1, ($0,A0)
057F78 move.w #$ec, ($20,A0) [enemy+ 0]
057FEC move.b #$1, ($0,A6)
057FF2 move.l #$6fb1a, ($40,A6) [enemy+ 0]
0580FE move.b #$2, ($0,A6)
058104 move.b #$ff, ($7d,A6) [enemy+ 0]
0584AC move.b #$1, ($0,A6)
0584B2 move.b #$0, ($87,A6) [enemy+ 0]
058566 move.b #$1, ($0,A0)
05856C move.w #$d0, ($20,A0) [enemy+ 0]
0585AC move.b #$1, ($0,A0)
0585B2 move.w #$d0, ($20,A0) [enemy+ 0]
0595C6 move.b #$1, ($0,A0)
0595CC move.w #$d0, ($20,A0) [enemy+ 0]
05A490 move.b #$2, ($0,A6)
05A496 move.b #$ff, ($7d,A6) [enemy+ 0]
05AA84 move.b #$1, ($0,A6)
05AA8A move.b #$0, ($87,A6) [enemy+ 0]
05AD46 move.b #$1, ($0,A0)
05AD4C move.w #$a4, ($20,A0) [enemy+ 0]
05B000 move.b #$1, ($0,A0)
05B006 move.w #$100, ($20,A0) [enemy+ 0]
05B03A move.b #$1, ($0,A1) [enemy+ 5]
05B040 move.w #$134, ($20,A1) [enemy+ 0]
05EE6A tst.b ($0,A0) [enemy+A0]
05EE6E beq $5f088 [enemy+ 0]
05F3E2 tst.b ($0,A1)
05F3E6 beq $5f436 [enemy+ 0]
05F6D4 tst.b ($0,A0)
05F6D8 beq $5f6f2 [enemy+ 0]
05FAA2 tst.b ($0,A0) [enemy+76]
05FAA6 beq $5faac [enemy+ 0]
06A242 move.b #$1, ($0,A6)
06A248 move.l #$71f72, ($40,A6) [enemy+ 0]
089A08 move.b #$1, ($0,A0)
089A0E move.w #$b8, ($20,A0) [enemy+ 0]
089AF2 move.b #$1, ($0,A0)
089AF8 move.w #$c8, ($20,A0) [enemy+ 0]
089B9C move.b #$1, ($0,A0)
089BA2 move.w #$d8, ($20,A0) [enemy+ 0]
089BD2 move.b #$1, ($0,A0)
089BD8 move.w #$e0, ($20,A0) [enemy+ 0]
089BFC move.b #$1, ($0,A0)
089C02 move.w #$dc, ($20,A0) [enemy+ 0]
089C32 move.b #$1, ($0,A0)
089C38 move.w #$dc, ($20,A0) [enemy+ 0]
089C68 move.b #$1, ($0,A0)
089C6E move.w #$dc, ($20,A0) [enemy+ 0]
089CC6 move.b #$1, ($0,A0)
089CCC move.w #$dc, ($20,A0) [enemy+ 0]
089D02 move.b #$1, ($0,A0)
089D08 move.w #$dc, ($20,A0) [enemy+ 0]
089D3E move.b #$1, ($0,A0)
089D44 move.w #$dc, ($20,A0) [enemy+ 0]
092AA4 tst.b ($0,A0)
092AA8 beq $92aba [123p+ 0, enemy+ 0]
0979D0 move.b #$1, ($0,A0)
0979D6 move.w #$188, ($20,A0) [enemy+ 0]
0979E8 move.b #$1, ($0,A0)
0979EE move.w #$188, ($20,A0) [enemy+ 0]
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAE6 move.l (A0), D2
0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAF4 move.l D2, (A0)+
0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
copyright zengfr site:http://github.com/zengfr/romhack
| 40.370079 | 350 | 0.562025 |
fbec19c47f29e4b1f89d27050a5e9f426724dde4 | 1,496 | asm | Assembly | Driver/Mailbox/Transport/SpoolTD/spooltdAddress.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Driver/Mailbox/Transport/SpoolTD/spooltdAddress.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Driver/Mailbox/Transport/SpoolTD/spooltdAddress.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1994 -- All Rights Reserved
PROJECT:
MODULE:
FILE: spooltdAddress.asm
AUTHOR: Adam de Boor, Oct 26, 1994
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
Adam 10/26/94 Initial revision
DESCRIPTION:
Address controller fun
$Id: spooltdAddress.asm,v 1.1 97/04/18 11:40:55 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
AddressCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolTDGetAddressController
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Retrieve the class pointer for the address controller to use
CALLED BY: DR_MBTD_GET_ADDRESS_CONTROLLER
PASS: cxdx = MediumType
ax = MailboxTransportOption
RETURN: cx:dx = class pointer
DESTROYED: nothing
SIDE EFFECTS: none
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 10/26/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolTDGetAddressController proc far
.enter
mov cx, segment MailboxSpoolAddressControlClass
mov dx, offset MailboxSpoolAddressControlClass
.leave
ret
SpoolTDGetAddressController endp
AddressCode ends
| 22 | 79 | 0.514037 |
2f8c1ecae82521dd1248a2b9eb2473a646b1a659 | 530 | asm | Assembly | programs/oeis/137/A137688.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/137/A137688.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/137/A137688.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A137688: 2^A003056: 2^n appears n+1 times.
; 1,2,2,4,4,4,8,8,8,8,16,16,16,16,16,32,32,32,32,32,32,64,64,64,64,64,64,64,128,128,128,128,128,128,128,128,256,256,256,256,256,256,256,256,256,512,512,512,512,512,512,512,512,512,512,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,4096,8192,8192,8192,8192,8192,8192,8192,8192,8192
mov $1,1
lpb $0
sub $0,1
mul $1,2
add $2,1
trn $0,$2
lpe
mov $0,$1
| 44.166667 | 408 | 0.707547 |
ab550feedefbd3e6add1054331d8f3a2ba68c173 | 412 | asm | Assembly | programs/oeis/226/A226570.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/226/A226570.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/226/A226570.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A226570: Sum_{k=1..n} (k+1)! mod n
; 0,0,2,0,2,2,4,0,8,2,10,8,8,4,2,8,11,8,7,12,11,10,19,8,12,8,8,4,15,2,0,24,32,28,32,8,3,26,8,32,2,32,14,32,17,42,16,8,46,12,11,8,11,8,32,32,26,44,26,32,20,0,53,24,47,32,63,28,65,32,66,8,53,40,62,64,32,8,18,72,62,2,25,32,62,14,44,32,74,62,60,88,62,16,7,56,78,46,98,12
add $0,1
mov $2,$0
lpb $0
add $3,1
mul $3,$0
sub $0,1
mov $1,$3
mod $3,$2
lpe
sub $1,1
mov $0,$1
| 27.466667 | 266 | 0.575243 |
d950ed73d596c6c34aec8ec00c27ab8230cd4783 | 808 | asm | Assembly | oeis/141/A141995.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/141/A141995.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/141/A141995.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A141995: Primes congruent to 19 mod 29.
; Submitted by Jon Maiga
; 19,193,251,367,541,599,773,947,1063,1237,1759,1933,2281,2339,2687,2803,2861,3209,3499,3557,3673,3847,4021,4079,4253,5297,5413,5471,6689,6863,7211,7559,7907,8081,8429,8719,8893,8951,9067,9241,9473,10111,10169,10343,10459,10691,11213,11329,11503,11677,11909,12373,12547,12721,12953,13127,13417,13591,13649,13997,14461,14519,14867,14983,15331,15679,15737,16433,16607,17419,17477,18289,18521,18637,18869,19333,19391,19507,19681,19739,19913,20029,20261,20551,20899,21247,21943,22291,22349,22639,22697
mov $2,$0
add $2,6
pow $2,2
lpb $2
mov $3,$4
add $3,18
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
mov $1,$0
max $1,0
cmp $1,$0
mul $2,$1
sub $2,1
add $4,58
lpe
mov $0,$4
add $0,19
| 36.727273 | 497 | 0.730198 |
da19eb00ea01af65100e88bfbd10a055b96251b6 | 115 | asm | Assembly | Assembler/AssemblyCode/TTL/JZ1.asm | KPU-RISC/KPU | 9f85c322e1b8489eef31f0696799e0c6c7273c0e | [
"MIT"
] | 8 | 2017-04-16T16:53:03.000Z | 2021-09-14T22:29:28.000Z | Assembler/AssemblyCode/TTL/JZ1.asm | KPU-RISC/KPU | 9f85c322e1b8489eef31f0696799e0c6c7273c0e | [
"MIT"
] | null | null | null | Assembler/AssemblyCode/TTL/JZ1.asm | KPU-RISC/KPU | 9f85c322e1b8489eef31f0696799e0c6c7273c0e | [
"MIT"
] | null | null | null | :START
MOV E, 10110111b
MOV D, 01001001b
ADD E, D
; Conditional Jump if the Zero-Flag from the ALU is 1
JMP :START | 16.428571 | 53 | 0.73913 |
202ba6379a32784a79a3ade84746ae4085370333 | 7,951 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_799.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_799.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_799.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 %r11
push %r12
push %r15
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x11fa1, %rdi
nop
inc %r9
movw $0x6162, (%rdi)
nop
nop
nop
nop
cmp $15870, %r12
lea addresses_A_ht+0x1b031, %r11
nop
nop
nop
nop
nop
add $20646, %r15
mov $0x6162636465666768, %rsi
movq %rsi, %xmm3
vmovups %ymm3, (%r11)
nop
nop
nop
nop
nop
xor $62573, %rdi
lea addresses_WT_ht+0x7eb1, %r9
nop
and $12874, %r11
mov $0x6162636465666768, %rdi
movq %rdi, (%r9)
nop
nop
nop
xor $47005, %r12
lea addresses_WT_ht+0xfe51, %rdi
nop
nop
nop
nop
cmp %rbp, %rbp
mov $0x6162636465666768, %r12
movq %r12, (%rdi)
nop
nop
nop
nop
cmp $24829, %rbp
lea addresses_normal_ht+0xdb7f, %rbp
nop
nop
nop
cmp $35844, %r15
movb $0x61, (%rbp)
nop
xor $9558, %rbp
lea addresses_normal_ht+0x5931, %r11
nop
nop
nop
nop
nop
dec %rsi
movb $0x61, (%r11)
nop
and %rbp, %rbp
lea addresses_normal_ht+0xebb1, %rsi
nop
nop
nop
cmp $4977, %r9
mov $0x6162636465666768, %r15
movq %r15, %xmm5
movups %xmm5, (%rsi)
nop
nop
add %r15, %r15
lea addresses_normal_ht+0x6871, %rdi
nop
nop
nop
nop
xor %r15, %r15
movups (%rdi), %xmm3
vpextrq $0, %xmm3, %r12
nop
cmp $6391, %r15
lea addresses_UC_ht+0x190e1, %r11
xor %rbp, %rbp
movw $0x6162, (%r11)
nop
nop
nop
nop
cmp $45094, %r12
lea addresses_D_ht+0x1dcf1, %rsi
lea addresses_A_ht+0x4e19, %rdi
add %rbp, %rbp
mov $102, %rcx
rep movsl
nop
add $30037, %r15
lea addresses_A_ht+0x14831, %r15
nop
nop
nop
nop
sub %rbp, %rbp
mov (%r15), %r9w
nop
nop
nop
and $48185, %r9
lea addresses_UC_ht+0x3831, %rbp
nop
and $13069, %rdi
and $0xffffffffffffffc0, %rbp
movntdqa (%rbp), %xmm0
vpextrq $1, %xmm0, %rcx
xor %rcx, %rcx
lea addresses_A_ht+0x16c31, %rsi
lea addresses_WC_ht+0x29b1, %rdi
nop
cmp %r9, %r9
mov $92, %rcx
rep movsw
nop
nop
nop
nop
sub $33671, %rcx
lea addresses_WT_ht+0x3891, %rsi
lea addresses_normal_ht+0x1b335, %rdi
nop
nop
nop
nop
sub $52582, %rbp
mov $80, %rcx
rep movsw
nop
inc %rcx
lea addresses_normal_ht+0x156c, %r11
nop
sub %rbp, %rbp
mov (%r11), %edi
nop
nop
nop
inc %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r15
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %r8
push %rbp
push %rbx
push %rsi
// Store
lea addresses_A+0x11f19, %r13
nop
nop
nop
dec %rbx
movw $0x5152, (%r13)
nop
nop
nop
xor $56849, %rbx
// Faulty Load
lea addresses_D+0x4031, %r15
nop
inc %r8
movb (%r15), %r12b
lea oracles, %r13
and $0xff, %r12
shlq $12, %r12
mov (%r13,%r12,1), %r12
pop %rsi
pop %rbx
pop %rbp
pop %r8
pop %r15
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_A', 'AVXalign': False, 'size': 2, 'NT': True, 'same': False, 'congruent': 2}}
[Faulty Load]
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8, 'NT': False, 'same': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 1}}
{'src': {'type': 'addresses_D_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2, 'NT': True, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16, 'NT': True, 'same': False, 'congruent': 11}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 2, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 33.690678 | 2,999 | 0.656899 |
d95f9cc70e67440c24ab1e0bcf410629d0397b97 | 9,425 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_2520.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_2520.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_2520.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 %r11
push %r14
push %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0xc966, %rsi
lea addresses_WC_ht+0x1552, %rdi
nop
add %r8, %r8
mov $18, %rcx
rep movsl
nop
xor $38683, %rsi
lea addresses_WC_ht+0xe78a, %rsi
lea addresses_WC_ht+0x3e4a, %rdi
nop
nop
dec %rax
mov $119, %rcx
rep movsq
nop
nop
xor $17549, %r8
lea addresses_A_ht+0xbf0a, %rdi
nop
nop
and $54702, %r14
mov (%rdi), %eax
nop
nop
nop
cmp %rcx, %rcx
lea addresses_WT_ht+0xe5d4, %rsi
lea addresses_UC_ht+0xdf0a, %rdi
nop
nop
sub $28363, %r11
mov $45, %rcx
rep movsl
nop
nop
add %r8, %r8
lea addresses_A_ht+0x151ce, %rsi
lea addresses_D_ht+0x15da1, %rdi
nop
nop
nop
and $43587, %rbx
mov $16, %rcx
rep movsb
nop
nop
nop
nop
sub $64855, %r14
lea addresses_WC_ht+0x16408, %r8
clflush (%r8)
nop
nop
nop
nop
nop
add %rax, %rax
mov (%r8), %bx
nop
nop
nop
sub %r8, %r8
lea addresses_UC_ht+0xfe4d, %r14
nop
nop
nop
nop
nop
xor %rax, %rax
vmovups (%r14), %ymm1
vextracti128 $0, %ymm1, %xmm1
vpextrq $0, %xmm1, %rcx
nop
xor %rcx, %rcx
lea addresses_WT_ht+0x1b30a, %rsi
lea addresses_D_ht+0x17f0a, %rdi
nop
nop
inc %rax
mov $36, %rcx
rep movsq
nop
nop
add %r8, %r8
lea addresses_D_ht+0x10e0a, %rsi
nop
nop
nop
nop
nop
xor %rbx, %rbx
mov $0x6162636465666768, %rax
movq %rax, %xmm3
movups %xmm3, (%rsi)
xor $22344, %rax
lea addresses_A_ht+0x1b6a, %rbx
nop
nop
nop
and %r14, %r14
movb $0x61, (%rbx)
nop
nop
and %rcx, %rcx
lea addresses_normal_ht+0x125a, %rbx
nop
nop
nop
and %r8, %r8
movb (%rbx), %cl
nop
nop
xor %rdi, %rdi
lea addresses_normal_ht+0xb60a, %rcx
nop
nop
nop
nop
nop
inc %r8
mov (%rcx), %rbx
nop
nop
add %r8, %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r14
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_UC+0x92e2, %r14
nop
nop
sub %r12, %r12
mov $0x5152535455565758, %r9
movq %r9, %xmm6
vmovups %ymm6, (%r14)
nop
nop
cmp $50770, %r11
// Store
lea addresses_PSE+0x1f0a, %r14
nop
nop
nop
cmp $39863, %r9
mov $0x5152535455565758, %r11
movq %r11, %xmm4
movups %xmm4, (%r14)
nop
nop
nop
cmp $32100, %r9
// Store
lea addresses_PSE+0x1f0a, %rcx
nop
cmp $55543, %rdx
mov $0x5152535455565758, %r14
movq %r14, %xmm4
vmovups %ymm4, (%rcx)
nop
dec %r12
// Load
lea addresses_D+0x920a, %rcx
nop
nop
dec %r11
mov (%rcx), %r14w
nop
nop
sub $16978, %rcx
// Store
lea addresses_normal+0xb90a, %r13
nop
nop
nop
nop
nop
add %r11, %r11
movl $0x51525354, (%r13)
xor $30993, %r13
// REPMOV
lea addresses_D+0x1b70a, %rsi
lea addresses_D+0x180a, %rdi
nop
nop
nop
nop
nop
and $20979, %r13
mov $39, %rcx
rep movsl
nop
nop
nop
nop
nop
add %r9, %r9
// Store
lea addresses_RW+0x5a76, %r13
nop
nop
nop
inc %r11
mov $0x5152535455565758, %r12
movq %r12, %xmm5
movups %xmm5, (%r13)
nop
nop
xor %rsi, %rsi
// Store
lea addresses_UC+0xaf0a, %r9
nop
nop
nop
nop
sub %r14, %r14
movb $0x51, (%r9)
nop
nop
nop
sub $15601, %r14
// Store
lea addresses_D+0x270a, %rsi
nop
nop
sub $12539, %r14
mov $0x5152535455565758, %rdi
movq %rdi, (%rsi)
nop
xor $20836, %rdi
// Faulty Load
lea addresses_PSE+0x1f0a, %r12
nop
nop
nop
sub $1826, %r11
mov (%r12), %r14d
lea oracles, %rsi
and $0xff, %r14
shlq $12, %r14
mov (%rsi,%r14,1), %r14
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r14
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 32, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_PSE', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_PSE', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D', 'same': False, 'size': 2, 'congruent': 7, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 4, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D', 'congruent': 8, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_RW', 'same': False, 'size': 16, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 1, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 8, 'congruent': 10, 'NT': True, 'AVXalign': True}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_PSE', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 11, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_UC_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': True}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 16, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 1, 'congruent': 3, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 8, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 29.270186 | 2,999 | 0.652414 |
e9b137c68694734447c908c85c9d47ce7a056508 | 407 | asm | Assembly | src/crate_patches.asm | mvdhout1992/ts-patches | a426970abeb6993eea6703d1a756fd74489ffed2 | [
"MIT"
] | 33 | 2016-07-30T14:17:28.000Z | 2021-12-19T15:45:19.000Z | src/crate_patches.asm | A-Productions/ts-patches | 326db731f7226d9e803feab475777c730688634e | [
"MIT"
] | 73 | 2018-08-17T00:25:19.000Z | 2021-05-10T08:31:15.000Z | src/crate_patches.asm | A-Productions/ts-patches | 326db731f7226d9e803feab475777c730688634e | [
"MIT"
] | 18 | 2017-05-16T11:28:06.000Z | 2022-03-20T20:41:03.000Z | %include "TiberianSun.inc"
%include "macros/patch.inc"
%include "macros/datatypes.inc"
;;; http://www.ppmforums.com/viewtopic.php?t=37620
;;; A bug where the Armor crate weakens the unit instead of powering it up
@SET 0x00458C01, fmul qword [esp+0x38]
;;; Allow a unit to get multiple powerups
@CLEAR 0x00457E74, 0x90, 0x00457E7A
@CLEAR 0x00458BF9, 0x90, 0x00458BFB
@SET 0x00458C07, fadd qword [ecx+0B0h]
| 31.307692 | 74 | 0.756757 |
4b7cca16c759a5fe21424ee5c3a22fe63a1f06d1 | 4,188 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_1552_1109.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_1552_1109.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_1552_1109.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:
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r8
push %r9
push %rax
push %rbx
// Store
lea addresses_PSE+0x1f531, %rax
sub $6609, %r13
mov $0x5152535455565758, %rbx
movq %rbx, (%rax)
nop
nop
xor $27463, %r10
// Load
mov $0x4e86aa0000000f21, %r9
nop
nop
nop
nop
sub %r8, %r8
movb (%r9), %r11b
nop
nop
nop
nop
nop
dec %rbx
// Faulty Load
lea addresses_D+0x86a1, %r11
nop
cmp $33041, %r13
mov (%r11), %ax
lea oracles, %r13
and $0xff, %rax
shlq $12, %rax
mov (%r13,%rax,1), %rax
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_D', 'same': False, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 8, 'congruent': 4, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_NC', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_D', 'same': True, 'size': 2, 'congruent': 0, 'NT': True, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'36': 1552}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 60.695652 | 2,999 | 0.658787 |
217ac157dd2d40c00e01cf639fbc404737143cb6 | 7,146 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca_notsx.log_21829_1593.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca_notsx.log_21829_1593.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i7-7700_9_0xca_notsx.log_21829_1593.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 %r8
push %r9
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x18c2, %r9
and %rbx, %rbx
mov (%r9), %r12
nop
inc %rax
lea addresses_A_ht+0x19deb, %r8
inc %r13
movups (%r8), %xmm6
vpextrq $0, %xmm6, %rcx
nop
nop
nop
nop
cmp %rbx, %rbx
lea addresses_normal_ht+0x193c2, %rsi
lea addresses_A_ht+0x1c6c2, %rdi
nop
nop
nop
nop
cmp $36484, %rbx
mov $37, %rcx
rep movsl
nop
nop
nop
nop
nop
and %r12, %r12
lea addresses_WC_ht+0x602, %rsi
lea addresses_WC_ht+0xe415, %rdi
clflush (%rdi)
nop
and $33726, %rax
mov $120, %rcx
rep movsl
nop
nop
inc %rsi
lea addresses_D_ht+0x1ed82, %rsi
lea addresses_normal_ht+0x1e762, %rdi
clflush (%rdi)
nop
nop
nop
cmp %r9, %r9
mov $87, %rcx
rep movsb
nop
nop
nop
nop
nop
inc %rbx
lea addresses_WT_ht+0xb8c2, %rdi
nop
nop
nop
nop
cmp %rax, %rax
movb $0x61, (%rdi)
inc %rax
lea addresses_UC_ht+0x6f91, %rsi
clflush (%rsi)
nop
nop
nop
and $51682, %r8
mov $0x6162636465666768, %rbx
movq %rbx, %xmm3
vmovups %ymm3, (%rsi)
nop
nop
nop
nop
cmp $43126, %rdi
lea addresses_D_ht+0x1bc2, %rcx
cmp %rdi, %rdi
movups (%rcx), %xmm4
vpextrq $0, %xmm4, %r12
nop
nop
add $27654, %rcx
lea addresses_normal_ht+0x122c2, %rsi
lea addresses_D_ht+0x5fc2, %rdi
nop
nop
nop
nop
xor $59879, %r8
mov $78, %rcx
rep movsw
nop
nop
nop
nop
nop
xor %r8, %r8
lea addresses_WT_ht+0x15b22, %rcx
nop
nop
nop
nop
inc %rax
mov (%rcx), %bx
nop
nop
inc %rsi
lea addresses_normal_ht+0x6ea2, %r9
nop
dec %rsi
mov (%r9), %r13w
add %rbx, %rbx
lea addresses_normal_ht+0xf86a, %rsi
nop
nop
nop
nop
add %rax, %rax
movw $0x6162, (%rsi)
nop
nop
nop
nop
cmp $7717, %rax
lea addresses_WT_ht+0x2b0a, %rsi
nop
nop
and $26937, %rdi
movb (%rsi), %r8b
nop
add %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r9
pop %r8
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r15
push %rbp
// Faulty Load
lea addresses_RW+0x143c2, %rbp
sub $30844, %r10
movb (%rbp), %r15b
lea oracles, %r11
and $0xff, %r15
shlq $12, %r15
mov (%r11,%r15,1), %r15
pop %rbp
pop %r15
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 3, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1, 'same': True, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'src': {'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}, '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.909548 | 2,999 | 0.657011 |
898556fdb0e7bf1013e930b96af9eaccce3c26c3 | 218 | asm | Assembly | ubb/asc/exam/andra.asm | AlexanderChristian/private_courses | c80f3526af539e35f93b460f3909f669aaef573c | [
"MIT"
] | null | null | null | ubb/asc/exam/andra.asm | AlexanderChristian/private_courses | c80f3526af539e35f93b460f3909f669aaef573c | [
"MIT"
] | 6 | 2020-03-04T20:52:39.000Z | 2022-03-31T00:33:07.000Z | ubb/asc/exam/andra.asm | AlexanderChristian/private_courses | c80f3526af539e35f93b460f3909f669aaef573c | [
"MIT"
] | null | null | null | assume cs:code, ds:data
data segment
newdir db 'director/altdir', 0
data ends
code segment
start:
mov ax, data
mov ds, ax
mov ah, 3Ah
mov dx, offset newdir
int 21h
mov ax, 4c00h
int 21h
code ends
end start
| 10.9 | 31 | 0.711009 |
41c93ccd02e9b9200b98afea6a64ca5bdca49e45 | 226 | asm | Assembly | programs/oeis/236/A236682.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/236/A236682.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/236/A236682.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A236682: Values of a for triples (a,b,c) of positive integers such that 1/a + 1/b + 1/c = 1/2 and a <= b <= c, listed with multiplicity.
; 3,3,3,3,3,4,4,4,5,6
add $0,2
mov $1,2
lpb $0,1
sub $0,6
add $1,1
mul $0,2
lpe
| 20.545455 | 138 | 0.59292 |
1edf3b4a85fee7eb0754377d954717916e05bfed | 207 | asm | Assembly | libsrc/_DEVELOPMENT/z80/c/sdcc/z80_set_int_state_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/z80/c/sdcc/z80_set_int_state_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/z80/c/sdcc/z80_set_int_state_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; void z80_set_int_state_fastcall(uint state)
SECTION code_clib
SECTION code_z80
PUBLIC _z80_set_int_state_fastcall
EXTERN asm_z80_set_int_state
defc _z80_set_int_state_fastcall = asm_z80_set_int_state
| 17.25 | 56 | 0.879227 |
79dadc6d8dc72bf21ab78346481226165197b4ba | 688 | asm | Assembly | oeis/007/A007160.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/007/A007160.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/007/A007160.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A007160: Number of diagonal dissections of a convex (n+6)-gon into n regions.
; Submitted by Jamie Morken(s2)
; 1,20,225,1925,14014,91728,556920,3197700,17587350,93486536,483367885,2442687975,12109051500,59053512000,283963030560,1348824395160,6338392712550,29503515951000,136173391604250,623760137794794,2837765901615876,12830687578253600,57687379921990000,258036428781495000,1148778180935215740,5092251470031437712,22482616666565081565,98895396544366364075,433523488531780456600,1894348154025766188288,8252975559922289612416,35854933598114873081840,155364230812405655190150,671562047460616464310200
mov $2,$0
mul $0,2
add $0,6
bin $0,$2
mov $1,$2
add $1,4
bin $1,3
mul $0,$1
div $0,4
| 49.142857 | 489 | 0.847384 |
d659029b1dd9fa3c87c9431f8619231f64e29764 | 555 | asm | Assembly | src/SystemInfo.asm | issalig/amstrad-diagnostics | ed069cc45436549bd3d11b976361988a23661088 | [
"MIT"
] | null | null | null | src/SystemInfo.asm | issalig/amstrad-diagnostics | ed069cc45436549bd3d11b976361988a23661088 | [
"MIT"
] | null | null | null | src/SystemInfo.asm | issalig/amstrad-diagnostics | ed069cc45436549bd3d11b976361988a23661088 | [
"MIT"
] | null | null | null | MODULE SYSTEMINFO
@DetectSystemInfo:
;; Try to detect the model and language
call CalculateTotalUpperRAM
call DetectModel
call DetectVendor
call RefreshFrequency
;; From the model, determine the keyboard layout
ld a, (ModelType)
cp MODEL_CPC6128
jr c, .set464Layout
ld a, KEYBOARD_LAYOUT_6128
jr .setLayout
.set464Layout:
ld a, KEYBOARD_LAYOUT_464
.setLayout:
ld (KeyboardLayout), a
ld a, (MenuItemCount)
ld (SelectedMenuItem), a
call IsAmstradFDCPresent
jr c, .noFDC
ld a, 1
ld (FDCPresent), a
.noFDC:
ret
ENDMODULE
| 15 | 49 | 0.744144 |
6c19316cfa6eac1b8f4ac9c3a2e5fe123e7ba7d1 | 52 | asm | Assembly | VirtualMachine/Win32/UnitTests/Arithmetic/test1_addii_Arithmetic.asm | ObjectPascalInterpreter/BookPart_3 | 95150d4d02f7e13e5b1ebb58c249073a384f2a0a | [
"Apache-2.0"
] | 8 | 2021-11-07T22:45:25.000Z | 2022-03-12T21:38:53.000Z | VirtualMachine/Win32/UnitTests/Arithmetic/test1_addii_Arithmetic.asm | Irwin1985/BookPart_2 | 4e8c2e47cd09b77c6e5bd3455ddfe7492adf26bf | [
"Apache-2.0"
] | 4 | 2021-09-23T02:13:55.000Z | 2021-12-07T06:08:17.000Z | VirtualMachine/Win32/UnitTests/Arithmetic/test1_addii_Arithmetic.asm | Irwin1985/BookPart_2 | 4e8c2e47cd09b77c6e5bd3455ddfe7492adf26bf | [
"Apache-2.0"
] | 4 | 2021-11-24T17:24:56.000Z | 2021-12-21T04:56:58.000Z | # Test 1 - add
pushi 2
pushi 5
add
halt | 8.666667 | 14 | 0.519231 |
f7ca8af3b932eb307e59846cc56b783a0227267e | 1,906 | asm | Assembly | programs/oeis/084/A084377.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/084/A084377.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/084/A084377.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A084377: a(n) = n^3 + 7.
; 7,8,15,34,71,132,223,350,519,736,1007,1338,1735,2204,2751,3382,4103,4920,5839,6866,8007,9268,10655,12174,13831,15632,17583,19690,21959,24396,27007,29798,32775,35944,39311,42882,46663,50660,54879,59326,64007,68928,74095,79514,85191,91132,97343,103830,110599,117656,125007,132658,140615,148884,157471,166382,175623,185200,195119,205386,216007,226988,238335,250054,262151,274632,287503,300770,314439,328516,343007,357918,373255,389024,405231,421882,438983,456540,474559,493046,512007,531448,551375,571794,592711,614132,636063,658510,681479,704976,729007,753578,778695,804364,830591,857382,884743,912680,941199,970306,1000007,1030308,1061215,1092734,1124871,1157632,1191023,1225050,1259719,1295036,1331007,1367638,1404935,1442904,1481551,1520882,1560903,1601620,1643039,1685166,1728007,1771568,1815855,1860874,1906631,1953132,2000383,2048390,2097159,2146696,2197007,2248098,2299975,2352644,2406111,2460382,2515463,2571360,2628079,2685626,2744007,2803228,2863295,2924214,2985991,3048632,3112143,3176530,3241799,3307956,3375007,3442958,3511815,3581584,3652271,3723882,3796423,3869900,3944319,4019686,4096007,4173288,4251535,4330754,4410951,4492132,4574303,4657470,4741639,4826816,4913007,5000218,5088455,5177724,5268031,5359382,5451783,5545240,5639759,5735346,5832007,5929748,6028575,6128494,6229511,6331632,6434863,6539210,6644679,6751276,6859007,6967878,7077895,7189064,7301391,7414882,7529543,7645380,7762399,7880606,8000007,8120608,8242415,8365434,8489671,8615132,8741823,8869750,8998919,9129336,9261007,9393938,9528135,9663604,9800351,9938382,10077703,10218320,10360239,10503466,10648007,10793868,10941055,11089574,11239431,11390632,11543183,11697090,11852359,12008996,12167007,12326398,12487175,12649344,12812911,12977882,13144263,13312060,13481279,13651926,13824007,13997528,14172495,14348914,14526791,14706132,14886943,15069230,15252999,15438256
pow $0,3
mov $1,$0
add $1,7
| 272.285714 | 1,849 | 0.852571 |
097dcede4da0a61ade7b2e307baf5716a31ba2f6 | 461 | asm | Assembly | libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_loadPSGaidencompressedTiles_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_loadPSGaidencompressedTiles_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/sms/SMSlib/c/sdcc/SMS_loadPSGaidencompressedTiles_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; void SMS_loadPSGaidencompressedTiles(void *src, unsigned int tilefrom)
SECTION code_clib
SECTION code_SMSlib
PUBLIC _SMS_loadPSGaidencompressedTiles_callee
PUBLIC _SMS_loadPSGaidencompressedTiles_callee_0
EXTERN asm_SMSlib_loadPSGaidencompressedTiles
_SMS_loadPSGaidencompressedTiles_callee:
pop hl
pop de
ex (sp),hl
_SMS_loadPSGaidencompressedTiles_callee_0:
push ix
push iy
call asm_SMSlib_loadPSGaidencompressedTiles
pop iy
pop ix
ret
| 16.464286 | 72 | 0.854664 |
22f6f0e7706ca118ee91f58e095fdfc5cdad703b | 440 | asm | Assembly | programs/oeis/123/A123740.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/123/A123740.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/123/A123740.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A123740: Characteristic sequence for Wythoff AB-numbers A003623.
; 0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,1
mov $1,3
lpb $1
lpb $0
mov $1,$0
mov $2,$0
seq $2,66628 ; a(n) = n - the largest Fibonacci number <= n.
mov $0,$2
lpe
lpe
sub $1,1
mod $1,2
mov $0,$1
| 27.5 | 201 | 0.55 |
c46298290c66acfc5a6d47dacc93271ad211a217 | 675 | asm | Assembly | oeis/191/A191638.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/191/A191638.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/191/A191638.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A191638: a(n) = floor((-1 + 4^n)/(-1 + 3*n)).
; Submitted by Jamie Morken(s4)
; 1,3,7,23,73,240,819,2849,10082,36157,131071,479349,1766022,6547206,24403223,91382282,343597383,1296593900,4908534052,18635790301,70936234050,270649016067,1034834473200,3964436291699,15214863605981,58488306848967,225179981368524,868163783589493,3351516001764090,12954174209065696,50127021939428129,194176253407468964,752928329539165372,2922256486924285404,11351842506898185609,44134266195043413212,171722417558896189588,668653661291277198399,2605443576755666324797,10159040500963270375682
mul $0,2
add $0,2
mov $1,2
pow $1,$0
mov $2,1
sub $2,$0
div $0,2
sub $0,$2
sub $1,1
div $1,$0
mov $0,$1
| 42.1875 | 489 | 0.81037 |
213975f234f5938e09dc7f240bdef42407c7eedf | 2,460 | asm | Assembly | kernel/data.asm | paulscottrobson/flat-color-forth | e11505536757ada55f147fee6e3faac49dfc80aa | [
"MIT"
] | 1 | 2018-11-25T14:13:21.000Z | 2018-11-25T14:13:21.000Z | kernel/data.asm | paulscottrobson/flat-color-forth | e11505536757ada55f147fee6e3faac49dfc80aa | [
"MIT"
] | 1 | 2019-03-03T21:17:54.000Z | 2020-07-02T09:20:01.000Z | kernel/data.asm | paulscottrobson/flat-color-forth | e11505536757ada55f147fee6e3faac49dfc80aa | [
"MIT"
] | null | null | null | ; ***************************************************************************************
; ***************************************************************************************
;
; Name : data.asm
; Author : Paul Robson (paul@robsons.org.uk)
; Date : 20th December 2018
; Purpose : Data area
;
; ***************************************************************************************
; ***************************************************************************************
; ***************************************************************************************
;
; System Information
;
; ***************************************************************************************
SystemInformation:
Here: ; +0 Here
dw FreeMemory
HerePage: ; +2 Here.Page
db FirstCodePage,0
NextFreePage: ; +4 Next available code page (2 8k pages/page)
db FirstCodePage+2,0,0,0
DisplayInfo: ; +8 Display information
dw DisplayInformation,0
Parameter: ; +12 Third Parameter used in some functions.
dw 0,0
WarmStartVector: ; +16 Warm Start vector.
dw WarmStart,0
; ***************************************************************************************
;
; Display system information
;
; ***************************************************************************************
DisplayInformation:
__DIScreenWidth: ; +0 screen width
db 0,0,0,0
__DIScreenHeight: ; +4 screen height
db 0,0,0,0
__DIScreenSize: ; +8 char size of screen
dw 0,0
__DIScreenMode: ; +12 current mode
db 0,0,0,0
__DIFontBase: ; font in use
dw AlternateFont
__DIScreenDriver: ; Screen Driver
dw 0
; ***************************************************************************************
;
; Other data and buffers
;
; ***************************************************************************************
__ARegister: ; register values when not running.
dw 0
__BRegister:
dw 0
__PAGEStackPointer: ; stack used for switching pages
dw 0
__PAGEStackBase:
ds 16
__CLICurrentKey: ; current inkey state on CLI
db 0
db $86 ; buffer for executing, tags it yellow effectively.
__CLIBuffer:
ds 20
SAVEFileHandle:
db 0
SAVEDefaultDrive:
db 0
FreeMemory:
org $C000
db 0 ; start of dictionary, which is empty.
| 28.604651 | 89 | 0.384146 |
852f605ec6b997780d674f51ff28c335873f1134 | 305 | asm | Assembly | programs/oeis/053/A053132.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/053/A053132.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/053/A053132.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A053132: One half of binomial coefficients C(2*n-4,5).
; 3,28,126,396,1001,2184,4284,7752,13167,21252,32890,49140,71253,100688,139128,188496,250971,329004,425334,543004,685377,856152,1059380,1299480,1581255,1909908,2291058,2730756,3235501,3812256,4468464
mov $1,$0
add $1,$0
add $1,6
bin $1,5
div $1,2
| 33.888889 | 199 | 0.763934 |
096a046fc056342834853d7468b1866684e502cf | 605 | asm | Assembly | programs/oeis/282/A282577.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/282/A282577.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/282/A282577.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A282577: Decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 553", based on the 5-celled von Neumann neighborhood.
; 1,0,1,0,5,0,21,0,85,0,341,0,1365,0,5461,0,21845,0,87381,0,349525,0,1398101,0,5592405,0,22369621,0,89478485,0,357913941,0,1431655765,0,5726623061,0,22906492245,0,91625968981,0,366503875925,0,1466015503701,0,5864062014805,0,23456248059221,0,93824992236885,0,375299968947541,0,1501199875790165,0,6004799503160661,0
mov $1,$0
trn $0,2
gcd $1,2
mov $2,2
add $2,$0
pow $1,$2
div $1,3
| 55 | 313 | 0.771901 |
d74eddf0653680ad453d74a9ed69cf08aba8900b | 592 | asm | Assembly | oeis/008/A008333.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/008/A008333.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/008/A008333.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A008333: Sum of divisors of p+1, p prime.
; 4,7,12,15,28,24,39,42,60,72,63,60,96,84,124,120,168,96,126,195,114,186,224,234,171,216,210,280,216,240,255,336,288,336,372,300,240,294,480,360,546,336,508,294,468,465,378,504,560,432,546,744,399,728,528,720,720,558,420,576,504,684,672,840,474,648,588,549,840,744,720,1170,744,648,840,1020,1008,600,816,756,1344,636,1240,768,1080,1064,1209,690,1152,930,1274,1512,930,1176,1092,1560,1296,1170,924,816
seq $0,6005 ; The odd prime numbers together with 1.
max $0,2
seq $0,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n).
| 84.571429 | 400 | 0.722973 |
3579715e7224976325b971b18c0185e14d590487 | 67 | asm | Assembly | src/echo.asm | notti/dis_se | 224f9ed6e71a77427c1286fcf958c075a7522e93 | [
"BSD-2-Clause"
] | null | null | null | src/echo.asm | notti/dis_se | 224f9ed6e71a77427c1286fcf958c075a7522e93 | [
"BSD-2-Clause"
] | null | null | null | src/echo.asm | notti/dis_se | 224f9ed6e71a77427c1286fcf958c075a7522e93 | [
"BSD-2-Clause"
] | null | null | null | START:
MOVL $0, SERIAL[0]
MOVL SERIAL[0], $0
JMP START
| 13.4 | 22 | 0.552239 |
72b2d85fa84c090e19f3235a1b0bd1b9c99b88d2 | 3,172 | asm | Assembly | bootloader.asm | drop-lt/smolOS | b82fa7be1c332938a17d1c40f7fa046caa5464fc | [
"BSD-3-Clause"
] | 3 | 2021-12-27T22:29:30.000Z | 2021-12-29T05:07:03.000Z | bootloader.asm | drop-lt/smolOS | b82fa7be1c332938a17d1c40f7fa046caa5464fc | [
"BSD-3-Clause"
] | null | null | null | bootloader.asm | drop-lt/smolOS | b82fa7be1c332938a17d1c40f7fa046caa5464fc | [
"BSD-3-Clause"
] | null | null | null | [bits 16]
_start:
mov ax, 021fh ; | read op:sector count
mov bx, 7e00h ; | memory mapped on ram
mov cx, 2 ; | cylinder:sector to start
xor dh, dh ; | head:drive
int 13h ; load segments on the disk
exit_16_bit_mode: ; finish everything needed on 16 bit
mov eax, cr0 ; | set the protected bit
or eax, 1 ; | on the control register
mov cr0, eax ; | to enable 32 bit
lgdt [desc] ; load the gdt table
jmp 0x0008:init_32bit ; and jump to the 32 bit zone
gdt: ; gdt table start
dq 0, 0xcf9A000000ffff, 0xcf92000000ffff ; | all the gdt table lol
desc: ; | the gdt descriptor that is loaded
dw $-gdt-1, gdt, 0 ; gdt table end
[bits 32] ; ------------------------------------------------------------
init_32bit: ; start 32 bit by checking A20 line
mov esi,0x012345 ; | even megabyte address.
mov edi,0x112345 ; | odd megabyte address.
mov [esi],esi ; | making sure that both addresses contain diffrent values.
mov [edi],edi ; | (if A20 line is cleared the two pointers would point to the address 0x012345 that would contain 0x112345 (edi))
cmpsd ; | compare addresses to see if they're equivalent.
jne setup_segments ; end booting if a20 line is off (no better method for now lol)
hlt
setup_segments: ;
mov al, 0x10 ; update segment registers
mov ds, ax ; |
mov ss, ax ; |
setup_stack: ;
mov ebp, 80000h ; update stack
mov esp, ebp ; because now the kernel is gonna be called and we need the stack for that
sti ; enable interrupts back
remove_cursor:
mov eax, 0xa ; put the cursor else where
mov edx, 0x3d4 ; |
out dx, al ; |
mov eax, 0x20 ; |
mov edx, 0x3d5 ; |
out dx, al ; |
kernel_call: ;
call clear_screen ; clear the screen before entering the kernel
call _startk ; call the "kernel"
jmp $ ; loop forever the computer can cope with this
; ============================================== kernel functions ==============================================
putcat:
mov al, byte [esp+4] ; move the char to al
mov edx, dword [esp+8] ; get the offset
mov ah, 15 ; white on black:char
mov [edx+753664+edx], ax ; write the char to the screen
ret
clear_screen:
mov eax, 757662
clear_screen_loop:
mov word [eax], 3872
sub eax, 2
cmp eax, 753664
jne clear_screen_loop
xor eax, eax
mov [cursor_offset], eax
ret
irq0:
push 32
jmp irq_common_stub
irq1:
push 33
irq_common_stub:
call irq_handler ; and call the handler (i want it here so bad)
add esp, 4 ; pop back error codes
iret ; and might triple fault.
irq_handler:
mov eax, dword [esp+4]
mov eax, dword interrupt_handlers[0+eax*4]
test eax, eax
je no_handler
call eax
no_handler:
mov eax, 32
mov edx, 32
out dx, al
ret
IRQ_Array:
dw irq0, irq1
times 510-($-$$) db 0
dw 0xaa55
[extern _startk]
[extern cursor_offset]
[extern interrupt_handlers]
global putcat, IRQ_Array, _start, clear_screen | 34.478261 | 138 | 0.594893 |
90293adfc4b5ff4ee2ad54a9ec044ac3e8e22430 | 787 | asm | Assembly | programs/oeis/152/A152556.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/152/A152556.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/152/A152556.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A152556: a(n) = 2*(2*n+2)^floor((n-1)/2).
; 1,2,2,16,20,288,392,8192,11664,320000,468512,15925248,23762752,963780608,1458000000,68719476736,105046700288,5642219814912,8695584276992,524288000000000,813342767698944,54394721876836352,84841494965553152,6232805962420322304,9765625000000000000,781754012972500385792,1229575252353016799232,106530593546206374264832,168110140833113738264576,15672832819200000000000000,24803538869315053824278528,2475880078570760549798248448,3928158732213644200735997952,417996455380740196633256394752,664658611392020000000000000000,75107349288208415283769428148224,119665574759900159778264689410048,14311154052757268463817888158973952,22841932514339760506510990419427328
mov $1,$0
add $0,1
add $1,1
mov $2,$1
add $1,$0
div $0,2
pow $1,$0
div $1,$2
mov $0,$1
| 60.538462 | 654 | 0.864041 |
db9c9cd407081ca67382e469a3c51eb79f7c4e22 | 246 | asm | Assembly | programs/oeis/120/A120521.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/120/A120521.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/120/A120521.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A120521: a(n) = min{j : A120510(j) = n}.
; 1,5,6,7,12,13,14,15,17,18,19,20,22,23,24,25,31,32,33,34,36,37,38,39,41,42,43,44,46,47,48,49,52,53,54,55,57,58,59,60,62,63,64,65,67,68,69,70,73,74
mov $1,1
lpb $0
add $1,$0
div $0,4
add $1,3
lpe
| 24.6 | 147 | 0.589431 |
ffbb78379446a2db4494408d9568405b45fb21b6 | 44,903 | asm | Assembly | user/wc.asm | Vidhi1109/Modified-XV6 | 691430b9f9be91cb556f138918c1fc0e57bcabdf | [
"MIT-0"
] | null | null | null | user/wc.asm | Vidhi1109/Modified-XV6 | 691430b9f9be91cb556f138918c1fc0e57bcabdf | [
"MIT-0"
] | null | null | null | user/wc.asm | Vidhi1109/Modified-XV6 | 691430b9f9be91cb556f138918c1fc0e57bcabdf | [
"MIT-0"
] | null | null | null |
user/_wc: file format elf64-littleriscv
Disassembly of section .text:
0000000000000000 <wc>:
char buf[512];
void
wc(int fd, char *name)
{
0: 7119 addi sp,sp,-128
2: fc86 sd ra,120(sp)
4: f8a2 sd s0,112(sp)
6: f4a6 sd s1,104(sp)
8: f0ca sd s2,96(sp)
a: ecce sd s3,88(sp)
c: e8d2 sd s4,80(sp)
e: e4d6 sd s5,72(sp)
10: e0da sd s6,64(sp)
12: fc5e sd s7,56(sp)
14: f862 sd s8,48(sp)
16: f466 sd s9,40(sp)
18: f06a sd s10,32(sp)
1a: ec6e sd s11,24(sp)
1c: 0100 addi s0,sp,128
1e: f8a43423 sd a0,-120(s0)
22: f8b43023 sd a1,-128(s0)
int i, n;
int l, w, c, inword;
l = w = c = 0;
inword = 0;
26: 4981 li s3,0
l = w = c = 0;
28: 4c81 li s9,0
2a: 4c01 li s8,0
2c: 4b81 li s7,0
2e: 00001d97 auipc s11,0x1
32: 9d3d8d93 addi s11,s11,-1581 # a01 <buf+0x1>
while((n = read(fd, buf, sizeof(buf))) > 0){
for(i=0; i<n; i++){
c++;
if(buf[i] == '\n')
36: 4aa9 li s5,10
l++;
if(strchr(" \r\t\n\v", buf[i]))
38: 00001a17 auipc s4,0x1
3c: 900a0a13 addi s4,s4,-1792 # 938 <malloc+0xec>
inword = 0;
40: 4b01 li s6,0
while((n = read(fd, buf, sizeof(buf))) > 0){
42: a805 j 72 <wc+0x72>
if(strchr(" \r\t\n\v", buf[i]))
44: 8552 mv a0,s4
46: 00000097 auipc ra,0x0
4a: 1e4080e7 jalr 484(ra) # 22a <strchr>
4e: c919 beqz a0,64 <wc+0x64>
inword = 0;
50: 89da mv s3,s6
for(i=0; i<n; i++){
52: 0485 addi s1,s1,1
54: 01248d63 beq s1,s2,6e <wc+0x6e>
if(buf[i] == '\n')
58: 0004c583 lbu a1,0(s1)
5c: ff5594e3 bne a1,s5,44 <wc+0x44>
l++;
60: 2b85 addiw s7,s7,1
62: b7cd j 44 <wc+0x44>
else if(!inword){
64: fe0997e3 bnez s3,52 <wc+0x52>
w++;
68: 2c05 addiw s8,s8,1
inword = 1;
6a: 4985 li s3,1
6c: b7dd j 52 <wc+0x52>
c++;
6e: 01ac8cbb addw s9,s9,s10
while((n = read(fd, buf, sizeof(buf))) > 0){
72: 20000613 li a2,512
76: 00001597 auipc a1,0x1
7a: 98a58593 addi a1,a1,-1654 # a00 <buf>
7e: f8843503 ld a0,-120(s0)
82: 00000097 auipc ra,0x0
86: 398080e7 jalr 920(ra) # 41a <read>
8a: 00a05f63 blez a0,a8 <wc+0xa8>
for(i=0; i<n; i++){
8e: 00001497 auipc s1,0x1
92: 97248493 addi s1,s1,-1678 # a00 <buf>
96: 00050d1b sext.w s10,a0
9a: fff5091b addiw s2,a0,-1
9e: 1902 slli s2,s2,0x20
a0: 02095913 srli s2,s2,0x20
a4: 996e add s2,s2,s11
a6: bf4d j 58 <wc+0x58>
}
}
}
if(n < 0){
a8: 02054e63 bltz a0,e4 <wc+0xe4>
printf("wc: read error\n");
exit(1);
}
printf("%d %d %d %s\n", l, w, c, name);
ac: f8043703 ld a4,-128(s0)
b0: 86e6 mv a3,s9
b2: 8662 mv a2,s8
b4: 85de mv a1,s7
b6: 00001517 auipc a0,0x1
ba: 89a50513 addi a0,a0,-1894 # 950 <malloc+0x104>
be: 00000097 auipc ra,0x0
c2: 6d6080e7 jalr 1750(ra) # 794 <printf>
}
c6: 70e6 ld ra,120(sp)
c8: 7446 ld s0,112(sp)
ca: 74a6 ld s1,104(sp)
cc: 7906 ld s2,96(sp)
ce: 69e6 ld s3,88(sp)
d0: 6a46 ld s4,80(sp)
d2: 6aa6 ld s5,72(sp)
d4: 6b06 ld s6,64(sp)
d6: 7be2 ld s7,56(sp)
d8: 7c42 ld s8,48(sp)
da: 7ca2 ld s9,40(sp)
dc: 7d02 ld s10,32(sp)
de: 6de2 ld s11,24(sp)
e0: 6109 addi sp,sp,128
e2: 8082 ret
printf("wc: read error\n");
e4: 00001517 auipc a0,0x1
e8: 85c50513 addi a0,a0,-1956 # 940 <malloc+0xf4>
ec: 00000097 auipc ra,0x0
f0: 6a8080e7 jalr 1704(ra) # 794 <printf>
exit(1);
f4: 4505 li a0,1
f6: 00000097 auipc ra,0x0
fa: 30c080e7 jalr 780(ra) # 402 <exit>
00000000000000fe <main>:
int
main(int argc, char *argv[])
{
fe: 7179 addi sp,sp,-48
100: f406 sd ra,40(sp)
102: f022 sd s0,32(sp)
104: ec26 sd s1,24(sp)
106: e84a sd s2,16(sp)
108: e44e sd s3,8(sp)
10a: e052 sd s4,0(sp)
10c: 1800 addi s0,sp,48
int fd, i;
if(argc <= 1){
10e: 4785 li a5,1
110: 04a7d763 bge a5,a0,15e <main+0x60>
114: 00858493 addi s1,a1,8
118: ffe5099b addiw s3,a0,-2
11c: 02099793 slli a5,s3,0x20
120: 01d7d993 srli s3,a5,0x1d
124: 05c1 addi a1,a1,16
126: 99ae add s3,s3,a1
wc(0, "");
exit(0);
}
for(i = 1; i < argc; i++){
if((fd = open(argv[i], 0)) < 0){
128: 4581 li a1,0
12a: 6088 ld a0,0(s1)
12c: 00000097 auipc ra,0x0
130: 316080e7 jalr 790(ra) # 442 <open>
134: 892a mv s2,a0
136: 04054263 bltz a0,17a <main+0x7c>
printf("wc: cannot open %s\n", argv[i]);
exit(1);
}
wc(fd, argv[i]);
13a: 608c ld a1,0(s1)
13c: 00000097 auipc ra,0x0
140: ec4080e7 jalr -316(ra) # 0 <wc>
close(fd);
144: 854a mv a0,s2
146: 00000097 auipc ra,0x0
14a: 2e4080e7 jalr 740(ra) # 42a <close>
for(i = 1; i < argc; i++){
14e: 04a1 addi s1,s1,8
150: fd349ce3 bne s1,s3,128 <main+0x2a>
}
exit(0);
154: 4501 li a0,0
156: 00000097 auipc ra,0x0
15a: 2ac080e7 jalr 684(ra) # 402 <exit>
wc(0, "");
15e: 00001597 auipc a1,0x1
162: 80258593 addi a1,a1,-2046 # 960 <malloc+0x114>
166: 4501 li a0,0
168: 00000097 auipc ra,0x0
16c: e98080e7 jalr -360(ra) # 0 <wc>
exit(0);
170: 4501 li a0,0
172: 00000097 auipc ra,0x0
176: 290080e7 jalr 656(ra) # 402 <exit>
printf("wc: cannot open %s\n", argv[i]);
17a: 608c ld a1,0(s1)
17c: 00000517 auipc a0,0x0
180: 7ec50513 addi a0,a0,2028 # 968 <malloc+0x11c>
184: 00000097 auipc ra,0x0
188: 610080e7 jalr 1552(ra) # 794 <printf>
exit(1);
18c: 4505 li a0,1
18e: 00000097 auipc ra,0x0
192: 274080e7 jalr 628(ra) # 402 <exit>
0000000000000196 <strcpy>:
#include "kernel/fcntl.h"
#include "user/user.h"
char*
strcpy(char *s, const char *t)
{
196: 1141 addi sp,sp,-16
198: e422 sd s0,8(sp)
19a: 0800 addi s0,sp,16
char *os;
os = s;
while((*s++ = *t++) != 0)
19c: 87aa mv a5,a0
19e: 0585 addi a1,a1,1
1a0: 0785 addi a5,a5,1
1a2: fff5c703 lbu a4,-1(a1)
1a6: fee78fa3 sb a4,-1(a5)
1aa: fb75 bnez a4,19e <strcpy+0x8>
;
return os;
}
1ac: 6422 ld s0,8(sp)
1ae: 0141 addi sp,sp,16
1b0: 8082 ret
00000000000001b2 <strcmp>:
int
strcmp(const char *p, const char *q)
{
1b2: 1141 addi sp,sp,-16
1b4: e422 sd s0,8(sp)
1b6: 0800 addi s0,sp,16
while(*p && *p == *q)
1b8: 00054783 lbu a5,0(a0)
1bc: cb91 beqz a5,1d0 <strcmp+0x1e>
1be: 0005c703 lbu a4,0(a1)
1c2: 00f71763 bne a4,a5,1d0 <strcmp+0x1e>
p++, q++;
1c6: 0505 addi a0,a0,1
1c8: 0585 addi a1,a1,1
while(*p && *p == *q)
1ca: 00054783 lbu a5,0(a0)
1ce: fbe5 bnez a5,1be <strcmp+0xc>
return (uchar)*p - (uchar)*q;
1d0: 0005c503 lbu a0,0(a1)
}
1d4: 40a7853b subw a0,a5,a0
1d8: 6422 ld s0,8(sp)
1da: 0141 addi sp,sp,16
1dc: 8082 ret
00000000000001de <strlen>:
uint
strlen(const char *s)
{
1de: 1141 addi sp,sp,-16
1e0: e422 sd s0,8(sp)
1e2: 0800 addi s0,sp,16
int n;
for(n = 0; s[n]; n++)
1e4: 00054783 lbu a5,0(a0)
1e8: cf91 beqz a5,204 <strlen+0x26>
1ea: 0505 addi a0,a0,1
1ec: 87aa mv a5,a0
1ee: 4685 li a3,1
1f0: 9e89 subw a3,a3,a0
1f2: 00f6853b addw a0,a3,a5
1f6: 0785 addi a5,a5,1
1f8: fff7c703 lbu a4,-1(a5)
1fc: fb7d bnez a4,1f2 <strlen+0x14>
;
return n;
}
1fe: 6422 ld s0,8(sp)
200: 0141 addi sp,sp,16
202: 8082 ret
for(n = 0; s[n]; n++)
204: 4501 li a0,0
206: bfe5 j 1fe <strlen+0x20>
0000000000000208 <memset>:
void*
memset(void *dst, int c, uint n)
{
208: 1141 addi sp,sp,-16
20a: e422 sd s0,8(sp)
20c: 0800 addi s0,sp,16
char *cdst = (char *) dst;
int i;
for(i = 0; i < n; i++){
20e: ca19 beqz a2,224 <memset+0x1c>
210: 87aa mv a5,a0
212: 1602 slli a2,a2,0x20
214: 9201 srli a2,a2,0x20
216: 00a60733 add a4,a2,a0
cdst[i] = c;
21a: 00b78023 sb a1,0(a5)
for(i = 0; i < n; i++){
21e: 0785 addi a5,a5,1
220: fee79de3 bne a5,a4,21a <memset+0x12>
}
return dst;
}
224: 6422 ld s0,8(sp)
226: 0141 addi sp,sp,16
228: 8082 ret
000000000000022a <strchr>:
char*
strchr(const char *s, char c)
{
22a: 1141 addi sp,sp,-16
22c: e422 sd s0,8(sp)
22e: 0800 addi s0,sp,16
for(; *s; s++)
230: 00054783 lbu a5,0(a0)
234: cb99 beqz a5,24a <strchr+0x20>
if(*s == c)
236: 00f58763 beq a1,a5,244 <strchr+0x1a>
for(; *s; s++)
23a: 0505 addi a0,a0,1
23c: 00054783 lbu a5,0(a0)
240: fbfd bnez a5,236 <strchr+0xc>
return (char*)s;
return 0;
242: 4501 li a0,0
}
244: 6422 ld s0,8(sp)
246: 0141 addi sp,sp,16
248: 8082 ret
return 0;
24a: 4501 li a0,0
24c: bfe5 j 244 <strchr+0x1a>
000000000000024e <gets>:
char*
gets(char *buf, int max)
{
24e: 711d addi sp,sp,-96
250: ec86 sd ra,88(sp)
252: e8a2 sd s0,80(sp)
254: e4a6 sd s1,72(sp)
256: e0ca sd s2,64(sp)
258: fc4e sd s3,56(sp)
25a: f852 sd s4,48(sp)
25c: f456 sd s5,40(sp)
25e: f05a sd s6,32(sp)
260: ec5e sd s7,24(sp)
262: 1080 addi s0,sp,96
264: 8baa mv s7,a0
266: 8a2e mv s4,a1
int i, cc;
char c;
for(i=0; i+1 < max; ){
268: 892a mv s2,a0
26a: 4481 li s1,0
cc = read(0, &c, 1);
if(cc < 1)
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
26c: 4aa9 li s5,10
26e: 4b35 li s6,13
for(i=0; i+1 < max; ){
270: 89a6 mv s3,s1
272: 2485 addiw s1,s1,1
274: 0344d863 bge s1,s4,2a4 <gets+0x56>
cc = read(0, &c, 1);
278: 4605 li a2,1
27a: faf40593 addi a1,s0,-81
27e: 4501 li a0,0
280: 00000097 auipc ra,0x0
284: 19a080e7 jalr 410(ra) # 41a <read>
if(cc < 1)
288: 00a05e63 blez a0,2a4 <gets+0x56>
buf[i++] = c;
28c: faf44783 lbu a5,-81(s0)
290: 00f90023 sb a5,0(s2)
if(c == '\n' || c == '\r')
294: 01578763 beq a5,s5,2a2 <gets+0x54>
298: 0905 addi s2,s2,1
29a: fd679be3 bne a5,s6,270 <gets+0x22>
for(i=0; i+1 < max; ){
29e: 89a6 mv s3,s1
2a0: a011 j 2a4 <gets+0x56>
2a2: 89a6 mv s3,s1
break;
}
buf[i] = '\0';
2a4: 99de add s3,s3,s7
2a6: 00098023 sb zero,0(s3)
return buf;
}
2aa: 855e mv a0,s7
2ac: 60e6 ld ra,88(sp)
2ae: 6446 ld s0,80(sp)
2b0: 64a6 ld s1,72(sp)
2b2: 6906 ld s2,64(sp)
2b4: 79e2 ld s3,56(sp)
2b6: 7a42 ld s4,48(sp)
2b8: 7aa2 ld s5,40(sp)
2ba: 7b02 ld s6,32(sp)
2bc: 6be2 ld s7,24(sp)
2be: 6125 addi sp,sp,96
2c0: 8082 ret
00000000000002c2 <stat>:
int
stat(const char *n, struct stat *st)
{
2c2: 1101 addi sp,sp,-32
2c4: ec06 sd ra,24(sp)
2c6: e822 sd s0,16(sp)
2c8: e426 sd s1,8(sp)
2ca: e04a sd s2,0(sp)
2cc: 1000 addi s0,sp,32
2ce: 892e mv s2,a1
int fd;
int r;
fd = open(n, O_RDONLY);
2d0: 4581 li a1,0
2d2: 00000097 auipc ra,0x0
2d6: 170080e7 jalr 368(ra) # 442 <open>
if(fd < 0)
2da: 02054563 bltz a0,304 <stat+0x42>
2de: 84aa mv s1,a0
return -1;
r = fstat(fd, st);
2e0: 85ca mv a1,s2
2e2: 00000097 auipc ra,0x0
2e6: 178080e7 jalr 376(ra) # 45a <fstat>
2ea: 892a mv s2,a0
close(fd);
2ec: 8526 mv a0,s1
2ee: 00000097 auipc ra,0x0
2f2: 13c080e7 jalr 316(ra) # 42a <close>
return r;
}
2f6: 854a mv a0,s2
2f8: 60e2 ld ra,24(sp)
2fa: 6442 ld s0,16(sp)
2fc: 64a2 ld s1,8(sp)
2fe: 6902 ld s2,0(sp)
300: 6105 addi sp,sp,32
302: 8082 ret
return -1;
304: 597d li s2,-1
306: bfc5 j 2f6 <stat+0x34>
0000000000000308 <atoi>:
int
atoi(const char *s)
{
308: 1141 addi sp,sp,-16
30a: e422 sd s0,8(sp)
30c: 0800 addi s0,sp,16
int n;
n = 0;
while('0' <= *s && *s <= '9')
30e: 00054683 lbu a3,0(a0)
312: fd06879b addiw a5,a3,-48
316: 0ff7f793 zext.b a5,a5
31a: 4625 li a2,9
31c: 02f66863 bltu a2,a5,34c <atoi+0x44>
320: 872a mv a4,a0
n = 0;
322: 4501 li a0,0
n = n*10 + *s++ - '0';
324: 0705 addi a4,a4,1
326: 0025179b slliw a5,a0,0x2
32a: 9fa9 addw a5,a5,a0
32c: 0017979b slliw a5,a5,0x1
330: 9fb5 addw a5,a5,a3
332: fd07851b addiw a0,a5,-48
while('0' <= *s && *s <= '9')
336: 00074683 lbu a3,0(a4)
33a: fd06879b addiw a5,a3,-48
33e: 0ff7f793 zext.b a5,a5
342: fef671e3 bgeu a2,a5,324 <atoi+0x1c>
return n;
}
346: 6422 ld s0,8(sp)
348: 0141 addi sp,sp,16
34a: 8082 ret
n = 0;
34c: 4501 li a0,0
34e: bfe5 j 346 <atoi+0x3e>
0000000000000350 <memmove>:
void*
memmove(void *vdst, const void *vsrc, int n)
{
350: 1141 addi sp,sp,-16
352: e422 sd s0,8(sp)
354: 0800 addi s0,sp,16
char *dst;
const char *src;
dst = vdst;
src = vsrc;
if (src > dst) {
356: 02b57463 bgeu a0,a1,37e <memmove+0x2e>
while(n-- > 0)
35a: 00c05f63 blez a2,378 <memmove+0x28>
35e: 1602 slli a2,a2,0x20
360: 9201 srli a2,a2,0x20
362: 00c507b3 add a5,a0,a2
dst = vdst;
366: 872a mv a4,a0
*dst++ = *src++;
368: 0585 addi a1,a1,1
36a: 0705 addi a4,a4,1
36c: fff5c683 lbu a3,-1(a1)
370: fed70fa3 sb a3,-1(a4)
while(n-- > 0)
374: fee79ae3 bne a5,a4,368 <memmove+0x18>
src += n;
while(n-- > 0)
*--dst = *--src;
}
return vdst;
}
378: 6422 ld s0,8(sp)
37a: 0141 addi sp,sp,16
37c: 8082 ret
dst += n;
37e: 00c50733 add a4,a0,a2
src += n;
382: 95b2 add a1,a1,a2
while(n-- > 0)
384: fec05ae3 blez a2,378 <memmove+0x28>
388: fff6079b addiw a5,a2,-1
38c: 1782 slli a5,a5,0x20
38e: 9381 srli a5,a5,0x20
390: fff7c793 not a5,a5
394: 97ba add a5,a5,a4
*--dst = *--src;
396: 15fd addi a1,a1,-1
398: 177d addi a4,a4,-1
39a: 0005c683 lbu a3,0(a1)
39e: 00d70023 sb a3,0(a4)
while(n-- > 0)
3a2: fee79ae3 bne a5,a4,396 <memmove+0x46>
3a6: bfc9 j 378 <memmove+0x28>
00000000000003a8 <memcmp>:
int
memcmp(const void *s1, const void *s2, uint n)
{
3a8: 1141 addi sp,sp,-16
3aa: e422 sd s0,8(sp)
3ac: 0800 addi s0,sp,16
const char *p1 = s1, *p2 = s2;
while (n-- > 0) {
3ae: ca05 beqz a2,3de <memcmp+0x36>
3b0: fff6069b addiw a3,a2,-1
3b4: 1682 slli a3,a3,0x20
3b6: 9281 srli a3,a3,0x20
3b8: 0685 addi a3,a3,1
3ba: 96aa add a3,a3,a0
if (*p1 != *p2) {
3bc: 00054783 lbu a5,0(a0)
3c0: 0005c703 lbu a4,0(a1)
3c4: 00e79863 bne a5,a4,3d4 <memcmp+0x2c>
return *p1 - *p2;
}
p1++;
3c8: 0505 addi a0,a0,1
p2++;
3ca: 0585 addi a1,a1,1
while (n-- > 0) {
3cc: fed518e3 bne a0,a3,3bc <memcmp+0x14>
}
return 0;
3d0: 4501 li a0,0
3d2: a019 j 3d8 <memcmp+0x30>
return *p1 - *p2;
3d4: 40e7853b subw a0,a5,a4
}
3d8: 6422 ld s0,8(sp)
3da: 0141 addi sp,sp,16
3dc: 8082 ret
return 0;
3de: 4501 li a0,0
3e0: bfe5 j 3d8 <memcmp+0x30>
00000000000003e2 <memcpy>:
void *
memcpy(void *dst, const void *src, uint n)
{
3e2: 1141 addi sp,sp,-16
3e4: e406 sd ra,8(sp)
3e6: e022 sd s0,0(sp)
3e8: 0800 addi s0,sp,16
return memmove(dst, src, n);
3ea: 00000097 auipc ra,0x0
3ee: f66080e7 jalr -154(ra) # 350 <memmove>
}
3f2: 60a2 ld ra,8(sp)
3f4: 6402 ld s0,0(sp)
3f6: 0141 addi sp,sp,16
3f8: 8082 ret
00000000000003fa <fork>:
# generated by usys.pl - do not edit
#include "kernel/syscall.h"
.global fork
fork:
li a7, SYS_fork
3fa: 4885 li a7,1
ecall
3fc: 00000073 ecall
ret
400: 8082 ret
0000000000000402 <exit>:
.global exit
exit:
li a7, SYS_exit
402: 4889 li a7,2
ecall
404: 00000073 ecall
ret
408: 8082 ret
000000000000040a <wait>:
.global wait
wait:
li a7, SYS_wait
40a: 488d li a7,3
ecall
40c: 00000073 ecall
ret
410: 8082 ret
0000000000000412 <pipe>:
.global pipe
pipe:
li a7, SYS_pipe
412: 4891 li a7,4
ecall
414: 00000073 ecall
ret
418: 8082 ret
000000000000041a <read>:
.global read
read:
li a7, SYS_read
41a: 4895 li a7,5
ecall
41c: 00000073 ecall
ret
420: 8082 ret
0000000000000422 <write>:
.global write
write:
li a7, SYS_write
422: 48c1 li a7,16
ecall
424: 00000073 ecall
ret
428: 8082 ret
000000000000042a <close>:
.global close
close:
li a7, SYS_close
42a: 48d5 li a7,21
ecall
42c: 00000073 ecall
ret
430: 8082 ret
0000000000000432 <kill>:
.global kill
kill:
li a7, SYS_kill
432: 4899 li a7,6
ecall
434: 00000073 ecall
ret
438: 8082 ret
000000000000043a <exec>:
.global exec
exec:
li a7, SYS_exec
43a: 489d li a7,7
ecall
43c: 00000073 ecall
ret
440: 8082 ret
0000000000000442 <open>:
.global open
open:
li a7, SYS_open
442: 48bd li a7,15
ecall
444: 00000073 ecall
ret
448: 8082 ret
000000000000044a <mknod>:
.global mknod
mknod:
li a7, SYS_mknod
44a: 48c5 li a7,17
ecall
44c: 00000073 ecall
ret
450: 8082 ret
0000000000000452 <unlink>:
.global unlink
unlink:
li a7, SYS_unlink
452: 48c9 li a7,18
ecall
454: 00000073 ecall
ret
458: 8082 ret
000000000000045a <fstat>:
.global fstat
fstat:
li a7, SYS_fstat
45a: 48a1 li a7,8
ecall
45c: 00000073 ecall
ret
460: 8082 ret
0000000000000462 <link>:
.global link
link:
li a7, SYS_link
462: 48cd li a7,19
ecall
464: 00000073 ecall
ret
468: 8082 ret
000000000000046a <mkdir>:
.global mkdir
mkdir:
li a7, SYS_mkdir
46a: 48d1 li a7,20
ecall
46c: 00000073 ecall
ret
470: 8082 ret
0000000000000472 <chdir>:
.global chdir
chdir:
li a7, SYS_chdir
472: 48a5 li a7,9
ecall
474: 00000073 ecall
ret
478: 8082 ret
000000000000047a <dup>:
.global dup
dup:
li a7, SYS_dup
47a: 48a9 li a7,10
ecall
47c: 00000073 ecall
ret
480: 8082 ret
0000000000000482 <getpid>:
.global getpid
getpid:
li a7, SYS_getpid
482: 48ad li a7,11
ecall
484: 00000073 ecall
ret
488: 8082 ret
000000000000048a <sbrk>:
.global sbrk
sbrk:
li a7, SYS_sbrk
48a: 48b1 li a7,12
ecall
48c: 00000073 ecall
ret
490: 8082 ret
0000000000000492 <sleep>:
.global sleep
sleep:
li a7, SYS_sleep
492: 48b5 li a7,13
ecall
494: 00000073 ecall
ret
498: 8082 ret
000000000000049a <uptime>:
.global uptime
uptime:
li a7, SYS_uptime
49a: 48b9 li a7,14
ecall
49c: 00000073 ecall
ret
4a0: 8082 ret
00000000000004a2 <waitx>:
.global waitx
waitx:
li a7, SYS_waitx
4a2: 48d9 li a7,22
ecall
4a4: 00000073 ecall
ret
4a8: 8082 ret
00000000000004aa <trace>:
.global trace
trace:
li a7, SYS_trace
4aa: 48e1 li a7,24
ecall
4ac: 00000073 ecall
ret
4b0: 8082 ret
00000000000004b2 <set_priority>:
.global set_priority
set_priority:
li a7, SYS_set_priority
4b2: 48dd li a7,23
ecall
4b4: 00000073 ecall
ret
4b8: 8082 ret
00000000000004ba <putc>:
static char digits[] = "0123456789ABCDEF";
static void
putc(int fd, char c)
{
4ba: 1101 addi sp,sp,-32
4bc: ec06 sd ra,24(sp)
4be: e822 sd s0,16(sp)
4c0: 1000 addi s0,sp,32
4c2: feb407a3 sb a1,-17(s0)
write(fd, &c, 1);
4c6: 4605 li a2,1
4c8: fef40593 addi a1,s0,-17
4cc: 00000097 auipc ra,0x0
4d0: f56080e7 jalr -170(ra) # 422 <write>
}
4d4: 60e2 ld ra,24(sp)
4d6: 6442 ld s0,16(sp)
4d8: 6105 addi sp,sp,32
4da: 8082 ret
00000000000004dc <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
4dc: 7139 addi sp,sp,-64
4de: fc06 sd ra,56(sp)
4e0: f822 sd s0,48(sp)
4e2: f426 sd s1,40(sp)
4e4: f04a sd s2,32(sp)
4e6: ec4e sd s3,24(sp)
4e8: 0080 addi s0,sp,64
4ea: 84aa mv s1,a0
char buf[16];
int i, neg;
uint x;
neg = 0;
if(sgn && xx < 0){
4ec: c299 beqz a3,4f2 <printint+0x16>
4ee: 0805c963 bltz a1,580 <printint+0xa4>
neg = 1;
x = -xx;
} else {
x = xx;
4f2: 2581 sext.w a1,a1
neg = 0;
4f4: 4881 li a7,0
4f6: fc040693 addi a3,s0,-64
}
i = 0;
4fa: 4701 li a4,0
do{
buf[i++] = digits[x % base];
4fc: 2601 sext.w a2,a2
4fe: 00000517 auipc a0,0x0
502: 4e250513 addi a0,a0,1250 # 9e0 <digits>
506: 883a mv a6,a4
508: 2705 addiw a4,a4,1
50a: 02c5f7bb remuw a5,a1,a2
50e: 1782 slli a5,a5,0x20
510: 9381 srli a5,a5,0x20
512: 97aa add a5,a5,a0
514: 0007c783 lbu a5,0(a5)
518: 00f68023 sb a5,0(a3)
}while((x /= base) != 0);
51c: 0005879b sext.w a5,a1
520: 02c5d5bb divuw a1,a1,a2
524: 0685 addi a3,a3,1
526: fec7f0e3 bgeu a5,a2,506 <printint+0x2a>
if(neg)
52a: 00088c63 beqz a7,542 <printint+0x66>
buf[i++] = '-';
52e: fd070793 addi a5,a4,-48
532: 00878733 add a4,a5,s0
536: 02d00793 li a5,45
53a: fef70823 sb a5,-16(a4)
53e: 0028071b addiw a4,a6,2
while(--i >= 0)
542: 02e05863 blez a4,572 <printint+0x96>
546: fc040793 addi a5,s0,-64
54a: 00e78933 add s2,a5,a4
54e: fff78993 addi s3,a5,-1
552: 99ba add s3,s3,a4
554: 377d addiw a4,a4,-1
556: 1702 slli a4,a4,0x20
558: 9301 srli a4,a4,0x20
55a: 40e989b3 sub s3,s3,a4
putc(fd, buf[i]);
55e: fff94583 lbu a1,-1(s2)
562: 8526 mv a0,s1
564: 00000097 auipc ra,0x0
568: f56080e7 jalr -170(ra) # 4ba <putc>
while(--i >= 0)
56c: 197d addi s2,s2,-1
56e: ff3918e3 bne s2,s3,55e <printint+0x82>
}
572: 70e2 ld ra,56(sp)
574: 7442 ld s0,48(sp)
576: 74a2 ld s1,40(sp)
578: 7902 ld s2,32(sp)
57a: 69e2 ld s3,24(sp)
57c: 6121 addi sp,sp,64
57e: 8082 ret
x = -xx;
580: 40b005bb negw a1,a1
neg = 1;
584: 4885 li a7,1
x = -xx;
586: bf85 j 4f6 <printint+0x1a>
0000000000000588 <vprintf>:
}
// Print to the given fd. Only understands %d, %x, %p, %s.
void
vprintf(int fd, const char *fmt, va_list ap)
{
588: 7119 addi sp,sp,-128
58a: fc86 sd ra,120(sp)
58c: f8a2 sd s0,112(sp)
58e: f4a6 sd s1,104(sp)
590: f0ca sd s2,96(sp)
592: ecce sd s3,88(sp)
594: e8d2 sd s4,80(sp)
596: e4d6 sd s5,72(sp)
598: e0da sd s6,64(sp)
59a: fc5e sd s7,56(sp)
59c: f862 sd s8,48(sp)
59e: f466 sd s9,40(sp)
5a0: f06a sd s10,32(sp)
5a2: ec6e sd s11,24(sp)
5a4: 0100 addi s0,sp,128
char *s;
int c, i, state;
state = 0;
for(i = 0; fmt[i]; i++){
5a6: 0005c903 lbu s2,0(a1)
5aa: 18090f63 beqz s2,748 <vprintf+0x1c0>
5ae: 8aaa mv s5,a0
5b0: 8b32 mv s6,a2
5b2: 00158493 addi s1,a1,1
state = 0;
5b6: 4981 li s3,0
if(c == '%'){
state = '%';
} else {
putc(fd, c);
}
} else if(state == '%'){
5b8: 02500a13 li s4,37
5bc: 4c55 li s8,21
5be: 00000c97 auipc s9,0x0
5c2: 3cac8c93 addi s9,s9,970 # 988 <malloc+0x13c>
printptr(fd, va_arg(ap, uint64));
} else if(c == 's'){
s = va_arg(ap, char*);
if(s == 0)
s = "(null)";
while(*s != 0){
5c6: 02800d93 li s11,40
putc(fd, 'x');
5ca: 4d41 li s10,16
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
5cc: 00000b97 auipc s7,0x0
5d0: 414b8b93 addi s7,s7,1044 # 9e0 <digits>
5d4: a839 j 5f2 <vprintf+0x6a>
putc(fd, c);
5d6: 85ca mv a1,s2
5d8: 8556 mv a0,s5
5da: 00000097 auipc ra,0x0
5de: ee0080e7 jalr -288(ra) # 4ba <putc>
5e2: a019 j 5e8 <vprintf+0x60>
} else if(state == '%'){
5e4: 01498d63 beq s3,s4,5fe <vprintf+0x76>
for(i = 0; fmt[i]; i++){
5e8: 0485 addi s1,s1,1
5ea: fff4c903 lbu s2,-1(s1)
5ee: 14090d63 beqz s2,748 <vprintf+0x1c0>
if(state == 0){
5f2: fe0999e3 bnez s3,5e4 <vprintf+0x5c>
if(c == '%'){
5f6: ff4910e3 bne s2,s4,5d6 <vprintf+0x4e>
state = '%';
5fa: 89d2 mv s3,s4
5fc: b7f5 j 5e8 <vprintf+0x60>
if(c == 'd'){
5fe: 11490c63 beq s2,s4,716 <vprintf+0x18e>
602: f9d9079b addiw a5,s2,-99
606: 0ff7f793 zext.b a5,a5
60a: 10fc6e63 bltu s8,a5,726 <vprintf+0x19e>
60e: f9d9079b addiw a5,s2,-99
612: 0ff7f713 zext.b a4,a5
616: 10ec6863 bltu s8,a4,726 <vprintf+0x19e>
61a: 00271793 slli a5,a4,0x2
61e: 97e6 add a5,a5,s9
620: 439c lw a5,0(a5)
622: 97e6 add a5,a5,s9
624: 8782 jr a5
printint(fd, va_arg(ap, int), 10, 1);
626: 008b0913 addi s2,s6,8
62a: 4685 li a3,1
62c: 4629 li a2,10
62e: 000b2583 lw a1,0(s6)
632: 8556 mv a0,s5
634: 00000097 auipc ra,0x0
638: ea8080e7 jalr -344(ra) # 4dc <printint>
63c: 8b4a mv s6,s2
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
putc(fd, c);
}
state = 0;
63e: 4981 li s3,0
640: b765 j 5e8 <vprintf+0x60>
printint(fd, va_arg(ap, uint64), 10, 0);
642: 008b0913 addi s2,s6,8
646: 4681 li a3,0
648: 4629 li a2,10
64a: 000b2583 lw a1,0(s6)
64e: 8556 mv a0,s5
650: 00000097 auipc ra,0x0
654: e8c080e7 jalr -372(ra) # 4dc <printint>
658: 8b4a mv s6,s2
state = 0;
65a: 4981 li s3,0
65c: b771 j 5e8 <vprintf+0x60>
printint(fd, va_arg(ap, int), 16, 0);
65e: 008b0913 addi s2,s6,8
662: 4681 li a3,0
664: 866a mv a2,s10
666: 000b2583 lw a1,0(s6)
66a: 8556 mv a0,s5
66c: 00000097 auipc ra,0x0
670: e70080e7 jalr -400(ra) # 4dc <printint>
674: 8b4a mv s6,s2
state = 0;
676: 4981 li s3,0
678: bf85 j 5e8 <vprintf+0x60>
printptr(fd, va_arg(ap, uint64));
67a: 008b0793 addi a5,s6,8
67e: f8f43423 sd a5,-120(s0)
682: 000b3983 ld s3,0(s6)
putc(fd, '0');
686: 03000593 li a1,48
68a: 8556 mv a0,s5
68c: 00000097 auipc ra,0x0
690: e2e080e7 jalr -466(ra) # 4ba <putc>
putc(fd, 'x');
694: 07800593 li a1,120
698: 8556 mv a0,s5
69a: 00000097 auipc ra,0x0
69e: e20080e7 jalr -480(ra) # 4ba <putc>
6a2: 896a mv s2,s10
putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]);
6a4: 03c9d793 srli a5,s3,0x3c
6a8: 97de add a5,a5,s7
6aa: 0007c583 lbu a1,0(a5)
6ae: 8556 mv a0,s5
6b0: 00000097 auipc ra,0x0
6b4: e0a080e7 jalr -502(ra) # 4ba <putc>
for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4)
6b8: 0992 slli s3,s3,0x4
6ba: 397d addiw s2,s2,-1
6bc: fe0914e3 bnez s2,6a4 <vprintf+0x11c>
printptr(fd, va_arg(ap, uint64));
6c0: f8843b03 ld s6,-120(s0)
state = 0;
6c4: 4981 li s3,0
6c6: b70d j 5e8 <vprintf+0x60>
s = va_arg(ap, char*);
6c8: 008b0913 addi s2,s6,8
6cc: 000b3983 ld s3,0(s6)
if(s == 0)
6d0: 02098163 beqz s3,6f2 <vprintf+0x16a>
while(*s != 0){
6d4: 0009c583 lbu a1,0(s3)
6d8: c5ad beqz a1,742 <vprintf+0x1ba>
putc(fd, *s);
6da: 8556 mv a0,s5
6dc: 00000097 auipc ra,0x0
6e0: dde080e7 jalr -546(ra) # 4ba <putc>
s++;
6e4: 0985 addi s3,s3,1
while(*s != 0){
6e6: 0009c583 lbu a1,0(s3)
6ea: f9e5 bnez a1,6da <vprintf+0x152>
s = va_arg(ap, char*);
6ec: 8b4a mv s6,s2
state = 0;
6ee: 4981 li s3,0
6f0: bde5 j 5e8 <vprintf+0x60>
s = "(null)";
6f2: 00000997 auipc s3,0x0
6f6: 28e98993 addi s3,s3,654 # 980 <malloc+0x134>
while(*s != 0){
6fa: 85ee mv a1,s11
6fc: bff9 j 6da <vprintf+0x152>
putc(fd, va_arg(ap, uint));
6fe: 008b0913 addi s2,s6,8
702: 000b4583 lbu a1,0(s6)
706: 8556 mv a0,s5
708: 00000097 auipc ra,0x0
70c: db2080e7 jalr -590(ra) # 4ba <putc>
710: 8b4a mv s6,s2
state = 0;
712: 4981 li s3,0
714: bdd1 j 5e8 <vprintf+0x60>
putc(fd, c);
716: 85d2 mv a1,s4
718: 8556 mv a0,s5
71a: 00000097 auipc ra,0x0
71e: da0080e7 jalr -608(ra) # 4ba <putc>
state = 0;
722: 4981 li s3,0
724: b5d1 j 5e8 <vprintf+0x60>
putc(fd, '%');
726: 85d2 mv a1,s4
728: 8556 mv a0,s5
72a: 00000097 auipc ra,0x0
72e: d90080e7 jalr -624(ra) # 4ba <putc>
putc(fd, c);
732: 85ca mv a1,s2
734: 8556 mv a0,s5
736: 00000097 auipc ra,0x0
73a: d84080e7 jalr -636(ra) # 4ba <putc>
state = 0;
73e: 4981 li s3,0
740: b565 j 5e8 <vprintf+0x60>
s = va_arg(ap, char*);
742: 8b4a mv s6,s2
state = 0;
744: 4981 li s3,0
746: b54d j 5e8 <vprintf+0x60>
}
}
}
748: 70e6 ld ra,120(sp)
74a: 7446 ld s0,112(sp)
74c: 74a6 ld s1,104(sp)
74e: 7906 ld s2,96(sp)
750: 69e6 ld s3,88(sp)
752: 6a46 ld s4,80(sp)
754: 6aa6 ld s5,72(sp)
756: 6b06 ld s6,64(sp)
758: 7be2 ld s7,56(sp)
75a: 7c42 ld s8,48(sp)
75c: 7ca2 ld s9,40(sp)
75e: 7d02 ld s10,32(sp)
760: 6de2 ld s11,24(sp)
762: 6109 addi sp,sp,128
764: 8082 ret
0000000000000766 <fprintf>:
void
fprintf(int fd, const char *fmt, ...)
{
766: 715d addi sp,sp,-80
768: ec06 sd ra,24(sp)
76a: e822 sd s0,16(sp)
76c: 1000 addi s0,sp,32
76e: e010 sd a2,0(s0)
770: e414 sd a3,8(s0)
772: e818 sd a4,16(s0)
774: ec1c sd a5,24(s0)
776: 03043023 sd a6,32(s0)
77a: 03143423 sd a7,40(s0)
va_list ap;
va_start(ap, fmt);
77e: fe843423 sd s0,-24(s0)
vprintf(fd, fmt, ap);
782: 8622 mv a2,s0
784: 00000097 auipc ra,0x0
788: e04080e7 jalr -508(ra) # 588 <vprintf>
}
78c: 60e2 ld ra,24(sp)
78e: 6442 ld s0,16(sp)
790: 6161 addi sp,sp,80
792: 8082 ret
0000000000000794 <printf>:
void
printf(const char *fmt, ...)
{
794: 711d addi sp,sp,-96
796: ec06 sd ra,24(sp)
798: e822 sd s0,16(sp)
79a: 1000 addi s0,sp,32
79c: e40c sd a1,8(s0)
79e: e810 sd a2,16(s0)
7a0: ec14 sd a3,24(s0)
7a2: f018 sd a4,32(s0)
7a4: f41c sd a5,40(s0)
7a6: 03043823 sd a6,48(s0)
7aa: 03143c23 sd a7,56(s0)
va_list ap;
va_start(ap, fmt);
7ae: 00840613 addi a2,s0,8
7b2: fec43423 sd a2,-24(s0)
vprintf(1, fmt, ap);
7b6: 85aa mv a1,a0
7b8: 4505 li a0,1
7ba: 00000097 auipc ra,0x0
7be: dce080e7 jalr -562(ra) # 588 <vprintf>
}
7c2: 60e2 ld ra,24(sp)
7c4: 6442 ld s0,16(sp)
7c6: 6125 addi sp,sp,96
7c8: 8082 ret
00000000000007ca <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
7ca: 1141 addi sp,sp,-16
7cc: e422 sd s0,8(sp)
7ce: 0800 addi s0,sp,16
Header *bp, *p;
bp = (Header*)ap - 1;
7d0: ff050693 addi a3,a0,-16
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
7d4: 00000797 auipc a5,0x0
7d8: 2247b783 ld a5,548(a5) # 9f8 <freep>
7dc: a02d j 806 <free+0x3c>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
bp->s.size += p->s.ptr->s.size;
7de: 4618 lw a4,8(a2)
7e0: 9f2d addw a4,a4,a1
7e2: fee52c23 sw a4,-8(a0)
bp->s.ptr = p->s.ptr->s.ptr;
7e6: 6398 ld a4,0(a5)
7e8: 6310 ld a2,0(a4)
7ea: a83d j 828 <free+0x5e>
} else
bp->s.ptr = p->s.ptr;
if(p + p->s.size == bp){
p->s.size += bp->s.size;
7ec: ff852703 lw a4,-8(a0)
7f0: 9f31 addw a4,a4,a2
7f2: c798 sw a4,8(a5)
p->s.ptr = bp->s.ptr;
7f4: ff053683 ld a3,-16(a0)
7f8: a091 j 83c <free+0x72>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
7fa: 6398 ld a4,0(a5)
7fc: 00e7e463 bltu a5,a4,804 <free+0x3a>
800: 00e6ea63 bltu a3,a4,814 <free+0x4a>
{
804: 87ba mv a5,a4
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
806: fed7fae3 bgeu a5,a3,7fa <free+0x30>
80a: 6398 ld a4,0(a5)
80c: 00e6e463 bltu a3,a4,814 <free+0x4a>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
810: fee7eae3 bltu a5,a4,804 <free+0x3a>
if(bp + bp->s.size == p->s.ptr){
814: ff852583 lw a1,-8(a0)
818: 6390 ld a2,0(a5)
81a: 02059813 slli a6,a1,0x20
81e: 01c85713 srli a4,a6,0x1c
822: 9736 add a4,a4,a3
824: fae60de3 beq a2,a4,7de <free+0x14>
bp->s.ptr = p->s.ptr->s.ptr;
828: fec53823 sd a2,-16(a0)
if(p + p->s.size == bp){
82c: 4790 lw a2,8(a5)
82e: 02061593 slli a1,a2,0x20
832: 01c5d713 srli a4,a1,0x1c
836: 973e add a4,a4,a5
838: fae68ae3 beq a3,a4,7ec <free+0x22>
p->s.ptr = bp->s.ptr;
83c: e394 sd a3,0(a5)
} else
p->s.ptr = bp;
freep = p;
83e: 00000717 auipc a4,0x0
842: 1af73d23 sd a5,442(a4) # 9f8 <freep>
}
846: 6422 ld s0,8(sp)
848: 0141 addi sp,sp,16
84a: 8082 ret
000000000000084c <malloc>:
return freep;
}
void*
malloc(uint nbytes)
{
84c: 7139 addi sp,sp,-64
84e: fc06 sd ra,56(sp)
850: f822 sd s0,48(sp)
852: f426 sd s1,40(sp)
854: f04a sd s2,32(sp)
856: ec4e sd s3,24(sp)
858: e852 sd s4,16(sp)
85a: e456 sd s5,8(sp)
85c: e05a sd s6,0(sp)
85e: 0080 addi s0,sp,64
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
860: 02051493 slli s1,a0,0x20
864: 9081 srli s1,s1,0x20
866: 04bd addi s1,s1,15
868: 8091 srli s1,s1,0x4
86a: 0014899b addiw s3,s1,1
86e: 0485 addi s1,s1,1
if((prevp = freep) == 0){
870: 00000517 auipc a0,0x0
874: 18853503 ld a0,392(a0) # 9f8 <freep>
878: c515 beqz a0,8a4 <malloc+0x58>
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
87a: 611c ld a5,0(a0)
if(p->s.size >= nunits){
87c: 4798 lw a4,8(a5)
87e: 02977f63 bgeu a4,s1,8bc <malloc+0x70>
882: 8a4e mv s4,s3
884: 0009871b sext.w a4,s3
888: 6685 lui a3,0x1
88a: 00d77363 bgeu a4,a3,890 <malloc+0x44>
88e: 6a05 lui s4,0x1
890: 000a0b1b sext.w s6,s4
p = sbrk(nu * sizeof(Header));
894: 004a1a1b slliw s4,s4,0x4
p->s.size = nunits;
}
freep = prevp;
return (void*)(p + 1);
}
if(p == freep)
898: 00000917 auipc s2,0x0
89c: 16090913 addi s2,s2,352 # 9f8 <freep>
if(p == (char*)-1)
8a0: 5afd li s5,-1
8a2: a895 j 916 <malloc+0xca>
base.s.ptr = freep = prevp = &base;
8a4: 00000797 auipc a5,0x0
8a8: 35c78793 addi a5,a5,860 # c00 <base>
8ac: 00000717 auipc a4,0x0
8b0: 14f73623 sd a5,332(a4) # 9f8 <freep>
8b4: e39c sd a5,0(a5)
base.s.size = 0;
8b6: 0007a423 sw zero,8(a5)
if(p->s.size >= nunits){
8ba: b7e1 j 882 <malloc+0x36>
if(p->s.size == nunits)
8bc: 02e48c63 beq s1,a4,8f4 <malloc+0xa8>
p->s.size -= nunits;
8c0: 4137073b subw a4,a4,s3
8c4: c798 sw a4,8(a5)
p += p->s.size;
8c6: 02071693 slli a3,a4,0x20
8ca: 01c6d713 srli a4,a3,0x1c
8ce: 97ba add a5,a5,a4
p->s.size = nunits;
8d0: 0137a423 sw s3,8(a5)
freep = prevp;
8d4: 00000717 auipc a4,0x0
8d8: 12a73223 sd a0,292(a4) # 9f8 <freep>
return (void*)(p + 1);
8dc: 01078513 addi a0,a5,16
if((p = morecore(nunits)) == 0)
return 0;
}
}
8e0: 70e2 ld ra,56(sp)
8e2: 7442 ld s0,48(sp)
8e4: 74a2 ld s1,40(sp)
8e6: 7902 ld s2,32(sp)
8e8: 69e2 ld s3,24(sp)
8ea: 6a42 ld s4,16(sp)
8ec: 6aa2 ld s5,8(sp)
8ee: 6b02 ld s6,0(sp)
8f0: 6121 addi sp,sp,64
8f2: 8082 ret
prevp->s.ptr = p->s.ptr;
8f4: 6398 ld a4,0(a5)
8f6: e118 sd a4,0(a0)
8f8: bff1 j 8d4 <malloc+0x88>
hp->s.size = nu;
8fa: 01652423 sw s6,8(a0)
free((void*)(hp + 1));
8fe: 0541 addi a0,a0,16
900: 00000097 auipc ra,0x0
904: eca080e7 jalr -310(ra) # 7ca <free>
return freep;
908: 00093503 ld a0,0(s2)
if((p = morecore(nunits)) == 0)
90c: d971 beqz a0,8e0 <malloc+0x94>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
90e: 611c ld a5,0(a0)
if(p->s.size >= nunits){
910: 4798 lw a4,8(a5)
912: fa9775e3 bgeu a4,s1,8bc <malloc+0x70>
if(p == freep)
916: 00093703 ld a4,0(s2)
91a: 853e mv a0,a5
91c: fef719e3 bne a4,a5,90e <malloc+0xc2>
p = sbrk(nu * sizeof(Header));
920: 8552 mv a0,s4
922: 00000097 auipc ra,0x0
926: b68080e7 jalr -1176(ra) # 48a <sbrk>
if(p == (char*)-1)
92a: fd5518e3 bne a0,s5,8fa <malloc+0xae>
return 0;
92e: 4501 li a0,0
930: bf45 j 8e0 <malloc+0x94>
| 29.796284 | 62 | 0.459813 |
2f3ba002e8b1acd4f7776d3f38929d3d65fbfc2d | 93 | asm | Assembly | libmikeos/src.os/__isr.asm | mynameispyo/InpyoOS | b6ddb6d9715b027ab65891bd4c4f46dbe5c9890d | [
"BSD-3-Clause",
"MIT"
] | null | null | null | libmikeos/src.os/__isr.asm | mynameispyo/InpyoOS | b6ddb6d9715b027ab65891bd4c4f46dbe5c9890d | [
"BSD-3-Clause",
"MIT"
] | null | null | null | libmikeos/src.os/__isr.asm | mynameispyo/InpyoOS | b6ddb6d9715b027ab65891bd4c4f46dbe5c9890d | [
"BSD-3-Clause",
"MIT"
] | null | null | null |
section .text
use16
; (signed) ax >>= cl
global isr
isr:
mov cl, bl
sar ax, cl
ret
| 7.75 | 21 | 0.591398 |
c6f6b1058cfda2ca6cdd3208f12ecef01f411937 | 8,373 | asm | Assembly | audio/music/dungeon1.asm | etdv-thevoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | 9 | 2020-07-12T19:44:21.000Z | 2022-03-03T23:32:40.000Z | audio/music/dungeon1.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | audio/music/dungeon1.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2021-03-28T18:33:43.000Z | 2021-05-06T13:12:09.000Z | Music_Dungeon1_Ch0::
tempo 144
volume 7, 7
duty 3
toggleperfectpitch
vibrato 10, 1, 4
notetype 12, 4, 13
rest 8
stereopanning 237
octave 4
F# 8
stereopanning 255
Music_Dungeon1_branch_7dee5::
notetype 12, 11, 2
octave 3
Music_Dungeon1_branch_7dee8::
callchannel Music_Dungeon1_branch_7dfaa
loopchannel 3, Music_Dungeon1_branch_7dee8
E_ 1
D# 1
B_ 1
A# 1
G_ 1
G# 1
rest 1
A# 1
E_ 1
D# 1
B_ 1
A# 1
G_ 1
G# 1
A_ 1
A# 1
Music_Dungeon1_branch_7deff::
callchannel Music_Dungeon1_branch_7dfaa
loopchannel 4, Music_Dungeon1_branch_7deff
callchannel Music_Dungeon1_branch_7dfd5
octave 3
G_ 1
F# 1
E_ 1
G_ 1
callchannel Music_Dungeon1_branch_7dfd5
octave 3
A_ 1
G_ 1
E_ 1
A_ 1
callchannel Music_Dungeon1_branch_7dfd5
octave 3
B_ 1
A_ 1
G_ 1
F# 1
notetype 12, 12, 3
G_ 4
F# 4
E_ 4
D# 4
notetype 12, 12, 2
callchannel Music_Dungeon1_branch_7dfc5
octave 3
B_ 3
callchannel Music_Dungeon1_branch_7dfc5
C_ 3
callchannel Music_Dungeon1_branch_7dfc5
C# 3
notetype 12, 12, 3
octave 3
G_ 4
F# 4
E_ 4
D# 4
E_ 4
D# 4
C_ 4
octave 2
B_ 4
notetype 12, 12, 2
B_ 1
A# 1
G_ 1
A# 1
B_ 1
A# 1
G_ 1
A# 1
octave 3
C_ 1
octave 2
B_ 1
G# 1
B_ 1
octave 3
C_ 1
octave 2
B_ 1
G# 1
B_ 1
octave 3
C# 1
C_ 1
octave 2
A_ 1
octave 3
C_ 1
C# 1
C_ 1
octave 2
A_ 1
octave 3
C_ 1
D_ 1
C# 1
octave 2
A# 1
octave 3
C# 1
D_ 1
C# 1
octave 2
A# 1
octave 3
C# 1
Music_Dungeon1_branch_7df6e::
rest 16
loopchannel 8, Music_Dungeon1_branch_7df6e
notetype 12, 12, 3
callchannel Music_Dungeon1_branch_7dfbb
B_ 2
G_ 2
octave 3
C# 4
octave 2
G_ 2
A_ 4
F# 2
callchannel Music_Dungeon1_branch_7dfbb
A# 2
G_ 2
B_ 4
G_ 2
F# 2
G_ 2
D# 2
notetype 12, 12, 2
callchannel Music_Dungeon1_branch_7dfc5
octave 3
B_ 3
callchannel Music_Dungeon1_branch_7dfc5
C_ 3
callchannel Music_Dungeon1_branch_7dfc5
C# 3
notetype 12, 12, 7
octave 3
F# 8
D# 8
notetype 12, 12, 2
callchannel Music_Dungeon1_branch_7dfaa
callchannel Music_Dungeon1_branch_7dfaa
loopchannel 0, Music_Dungeon1_branch_7dee5
Music_Dungeon1_branch_7dfaa::
E_ 1
D# 1
B_ 1
A# 1
G_ 1
G# 1
rest 1
A# 1
E_ 1
D# 1
B_ 1
A# 1
G_ 1
G# 1
rest 1
A# 1
endchannel
Music_Dungeon1_branch_7dfbb::
octave 2
G_ 2
A# 4
G_ 2
octave 3
C# 4
octave 2
G_ 2
A# 2
endchannel
Music_Dungeon1_branch_7dfc5::
octave 3
E_ 1
E_ 1
F_ 1
E_ 1
G_ 1
E_ 1
A_ 1
E_ 1
A# 1
E_ 1
B_ 1
E_ 1
octave 4
C_ 1
endchannel
Music_Dungeon1_branch_7dfd5::
E_ 1
E_ 1
rest 4
octave 1
E_ 1
rest 3
E_ 1
rest 1
endchannel
Music_Dungeon1_Ch1::
vibrato 11, 1, 5
duty 3
notetype 12, 0, 15
octave 4
G# 8
notetype 12, 4, 13
octave 5
D_ 8
Music_Dungeon1_branch_7dfeb::
notetype 12, 12, 2
Music_Dungeon1_branch_7dfed::
callchannel Music_Dungeon1_branch_7e097
loopchannel 3, Music_Dungeon1_branch_7dfed
octave 2
E_ 1
E_ 1
B_ 1
octave 3
C_ 1
rest 2
C_ 1
octave 2
B_ 1
E_ 1
E_ 1
A_ 1
G_ 1
F_ 1
F# 1
G_ 1
D# 1
Music_Dungeon1_branch_7e006::
callchannel Music_Dungeon1_branch_7e097
loopchannel 4, Music_Dungeon1_branch_7e006
rest 2
callchannel Music_Dungeon1_branch_7e0ab
octave 3
C_ 4
callchannel Music_Dungeon1_branch_7e0ab
octave 3
C# 4
callchannel Music_Dungeon1_branch_7e0ab
octave 3
D# 4
notetype 12, 13, 3
octave 4
E_ 4
D# 4
C_ 4
octave 3
B_ 4
notetype 12, 13, 2
callchannel Music_Dungeon1_branch_7e0b5
octave 3
F# 4
callchannel Music_Dungeon1_branch_7e0b5
octave 3
G_ 4
callchannel Music_Dungeon1_branch_7e0b5
octave 3
A# 4
notetype 12, 13, 3
octave 4
E_ 4
D# 4
C_ 4
octave 3
B_ 4
octave 4
C_ 4
octave 3
B_ 4
G_ 4
F# 2
notetype 12, 13, 6
E_ 8
F_ 8
F# 8
G_ 8
notetype 12, 13, 2
callchannel Music_Dungeon1_branch_7e0ba
rest 10
E_ 1
rest 1
callchannel Music_Dungeon1_branch_7e0ba
rest 12
callchannel Music_Dungeon1_branch_7e0ba
rest 12
callchannel Music_Dungeon1_branch_7e0ba
rest 14
notetype 12, 13, 3
callchannel Music_Dungeon1_branch_7e0cd
D# 4
callchannel Music_Dungeon1_branch_7e0cd
D# 2
rest 2
notetype 12, 13, 2
callchannel Music_Dungeon1_branch_7e0c0
rest 2
octave 3
F# 4
octave 2
E_ 1
E_ 1
octave 3
B_ 1
rest 1
octave 4
C_ 1
rest 1
C# 1
rest 1
D_ 1
C# 1
rest 2
octave 3
G_ 4
callchannel Music_Dungeon1_branch_7e0c0
octave 3
A# 4
notetype 12, 13, 6
B_ 8
octave 4
D# 8
notetype 12, 13, 2
callchannel Music_Dungeon1_branch_7e097
callchannel Music_Dungeon1_branch_7e097
loopchannel 0, Music_Dungeon1_branch_7dfeb
Music_Dungeon1_branch_7e097::
octave 2
E_ 1
E_ 1
B_ 1
octave 3
C_ 1
rest 2
C_ 1
octave 2
B_ 1
E_ 1
E_ 1
B_ 1
octave 3
C_ 1
rest 2
C_ 1
octave 2
B_ 1
endchannel
Music_Dungeon1_branch_7e0ab::
octave 2
E_ 1
E_ 1
rest 2
octave 1
E_ 1
rest 3
E_ 1
rest 3
endchannel
Music_Dungeon1_branch_7e0b5::
octave 2
E_ 1
E_ 1
rest 10
endchannel
Music_Dungeon1_branch_7e0ba::
octave 1
E_ 1
G_ 1
E_ 1
D# 1
endchannel
Music_Dungeon1_branch_7e0c0::
octave 2
E_ 1
E_ 1
octave 4
E_ 1
rest 1
D# 1
rest 1
D_ 1
rest 1
C# 1
C_ 1
endchannel
Music_Dungeon1_branch_7e0cd::
octave 3
E_ 6
G_ 6
E_ 4
A_ 6
octave 4
C_ 6
octave 3
B_ 4
G_ 6
A# 6
F# 4
E_ 6
F# 6
endchannel
Music_Dungeon1_Ch2::
notetype 12, 1, 1
vibrato 8, 2, 6
rest 14
octave 4
D_ 1
D# 1
Music_Dungeon1_branch_7e0e5::
callchannel Music_Dungeon1_branch_7e140
callchannel Music_Dungeon1_branch_7e140
octave 5
E_ 2
rest 4
octave 3
E_ 1
rest 3
E_ 1
rest 1
octave 4
F# 4
callchannel Music_Dungeon1_branch_7e154
octave 4
G_ 4
callchannel Music_Dungeon1_branch_7e154
octave 4
A_ 4
B_ 4
A# 4
G_ 4
F# 4
rest 6
callchannel Music_Dungeon1_branch_7e177
B_ 4
A# 4
G_ 4
F# 4
G_ 4
F# 4
E_ 4
D# 4
callchannel Music_Dungeon1_branch_7e15e
rest 12
callchannel Music_Dungeon1_branch_7e15e
rest 12
callchannel Music_Dungeon1_branch_7e15e
rest 10
E_ 1
rest 1
callchannel Music_Dungeon1_branch_7e15e
rest 12
callchannel Music_Dungeon1_branch_7e15e
rest 12
callchannel Music_Dungeon1_branch_7e15e
rest 10
D_ 1
D# 1
callchannel Music_Dungeon1_branch_7e164
callchannel Music_Dungeon1_branch_7e164
E_ 2
rest 4
callchannel Music_Dungeon1_branch_7e177
B_ 8
F# 6
D_ 1
D# 1
rest 16
rest 16
loopchannel 0, Music_Dungeon1_branch_7e0e5
Music_Dungeon1_branch_7e140::
octave 5
E_ 4
B_ 4
A# 4
octave 6
D_ 4
C# 4
octave 5
G# 4
G_ 4
B_ 4
A# 4
E_ 4
D# 4
A_ 4
G# 4
E_ 4
F# 4
D# 4
endchannel
Music_Dungeon1_branch_7e154::
octave 6
E_ 1
E_ 1
rest 4
octave 3
E_ 1
rest 3
E_ 1
rest 1
endchannel
Music_Dungeon1_branch_7e15e::
octave 3
E_ 1
G_ 1
E_ 1
D# 1
endchannel
Music_Dungeon1_branch_7e164::
E_ 4
B_ 4
A# 4
octave 4
D_ 4
C# 4
octave 3
G# 4
G_ 4
B_ 4
A# 4
E_ 4
D# 4
A_ 4
G# 4
E_ 4
F# 4
D# 4
endchannel
Music_Dungeon1_branch_7e177::
octave 4
E_ 1
rest 3
E_ 1
rest 1
F# 4
rest 6
E_ 1
rest 3
E_ 1
rest 1
G_ 4
rest 6
E_ 1
rest 3
E_ 1
E_ 1
A# 4
endchannel
Music_Dungeon1_Ch3::
dspeed 12
rest 14
cymbal1 1
cymbal1 1
Music_Dungeon1_branch_7e190::
callchannel Music_Dungeon1_branch_7e1f1
loopchannel 3, Music_Dungeon1_branch_7e190
cymbal2 4
cymbal1 4
cymbal2 4
cymbal1 2
cymbal1 2
Music_Dungeon1_branch_7e1a1::
callchannel Music_Dungeon1_branch_7e1f1
loopchannel 3, Music_Dungeon1_branch_7e1a1
cymbal2 4
cymbal1 4
cymbal2 4
cymbal2 4
Music_Dungeon1_branch_7e1b0::
callchannel Music_Dungeon1_branch_7e1fa
loopchannel 3, Music_Dungeon1_branch_7e1b0
callchannel Music_Dungeon1_branch_7e202
Music_Dungeon1_branch_7e1ba::
callchannel Music_Dungeon1_branch_7e1fa
loopchannel 3, Music_Dungeon1_branch_7e1ba
callchannel Music_Dungeon1_branch_7e202
snare7 4
snare8 4
snare8 4
rest 2
snare7 2
cymbal2 4
Music_Dungeon1_branch_7e1cf::
rest 16
loopchannel 13, Music_Dungeon1_branch_7e1cf
rest 12
Music_Dungeon1_branch_7e1d5::
callchannel Music_Dungeon1_branch_7e1fa
loopchannel 3, Music_Dungeon1_branch_7e1d5
cymbal1 4
cymbal1 4
cymbal1 4
rest 2
cymbal1 1
cymbal1 1
callchannel Music_Dungeon1_branch_7e1f1
callchannel Music_Dungeon1_branch_7e1f1
loopchannel 0, Music_Dungeon1_branch_7e190
Music_Dungeon1_branch_7e1f1::
cymbal2 4
cymbal1 4
cymbal2 4
cymbal1 4
endchannel
Music_Dungeon1_branch_7e1fa::
cymbal1 1
cymbal1 1
rest 10
cymbal3 4
endchannel
Music_Dungeon1_branch_7e202::
snare7 4
snare8 4
snare8 4
snare9 4
endchannel
| 12.386095 | 44 | 0.740714 |
d07dc17c5a5f970202f41d7a04a5512288624451 | 1,924 | asm | Assembly | testc/cputest/daadas.asm | krismuad/TOWNSEMU | 49c098ecb4686a506a208e01271ed135c0c3c482 | [
"BSD-3-Clause"
] | 124 | 2020-03-17T05:49:47.000Z | 2022-03-27T00:11:33.000Z | testc/cputest/daadas.asm | krismuad/TOWNSEMU | 49c098ecb4686a506a208e01271ed135c0c3c482 | [
"BSD-3-Clause"
] | 40 | 2020-05-24T12:50:43.000Z | 2022-02-22T05:32:18.000Z | testc/cputest/daadas.asm | krismuad/TOWNSEMU | 49c098ecb4686a506a208e01271ed135c0c3c482 | [
"BSD-3-Clause"
] | 11 | 2020-05-26T17:52:04.000Z | 2021-07-31T01:07:31.000Z | .386p
ASSUME CS:CODE
PUBLIC TEST_DAA
PUBLIC TEST_DAS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
EFLAGS_CF EQU 00001H
EFLAGS_PF EQU 00004H
EFLAGS_AF EQU 00010H
EFLAGS_ZF EQU 00040H
EFLAGS_SF EQU 00080H
EFLAGS_TRAP EQU 00100H
EFLAGS_IF EQU 00200H
EFLAGS_DF EQU 00400H
EFLAGS_OF EQU 00800H
EFLAGS_IOPL EQU 03000H
EFLAGS_NF EQU 04000H
EFLAGS_RF EQU 10000H
EFLAGS_VF EQU 20000H
EFLAGS_ALIGN_CHECK EQU 40000H
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CODE SEGMENT
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; int TEST_DAA(unsigned int eax,unsigned int edx)
TEST_DAA PROC
PUSH EBP ; [EBP]=PrevEBP, [EBP+4]=EIP, [EIP+8]=EAX, [EIP+12]=EDX
MOV EBP,ESP
PUSHAD
MOV EAX,[EBP+8]
MOV EDX,[EBP+12]
XOR AH,AH
ADD AL,DL
DAA
PUSHFD
POP EBX
AND BL,EFLAGS_SF+EFLAGS_ZF+EFLAGS_PF+EFLAGS_CF+EFLAGS_AF
MOV AH,BL
AND EAX,0FFFFH
MOV [EBP+8],EAX
POPAD
MOV EAX,[EBP+8]
POP EBP
RET
TEST_DAA ENDP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; int TEST_DAS(unsigned int eax,unsigned int edx)
TEST_DAS PROC
PUSH EBP ; [EBP]=PrevEBP, [EBP+4]=EIP, [EIP+8]=EAX, [EIP+12]=EDX
MOV EBP,ESP
PUSHAD
MOV EAX,[EBP+8]
MOV EDX,[EBP+12]
XOR AH,AH
SUB AL,DL
DAS
PUSHFD
POP EBX
AND BL,EFLAGS_SF+EFLAGS_ZF+EFLAGS_PF+EFLAGS_CF+EFLAGS_AF
MOV AH,BL
AND EAX,0FFFFH
MOV [EBP+8],EAX
POPAD
MOV EAX,[EBP+8]
POP EBP
RET
TEST_DAS ENDP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CODE ENDS
END
| 18.150943 | 76 | 0.452703 |
eefa550ee39d55452d475f6fa363a982de0d1811 | 3,762 | asm | Assembly | fnv1hash.asm | JonathonReinhart/h2incn | ed62c11617fce8b2e62857a0a92a385036c28c38 | [
"BSD-2-Clause"
] | 1 | 2021-09-11T15:29:42.000Z | 2021-09-11T15:29:42.000Z | fnv1hash.asm | JonathonReinhart/h2incn | ed62c11617fce8b2e62857a0a92a385036c28c38 | [
"BSD-2-Clause"
] | null | null | null | fnv1hash.asm | JonathonReinhart/h2incn | ed62c11617fce8b2e62857a0a92a385036c28c38 | [
"BSD-2-Clause"
] | null | null | null | ;
; FNV1HASH.ASM : FNV-1 Hash algorithm
; Author : Rob Neff
;
; Copyright (C)2010 Piranha Designs, LLC - All rights reserved.
; Source code is licensed under the new/simplified 2-clause BSD OSI license.
;
; This function implements the FNV-1 hash algorithm.
; This source file is formatted for Nasm compatibility although it
; is small enough to be easily converted into another assembler format.
;
; Example C/C++ call:
;
; #ifdef __cplusplus
; extern "C" {
; #endif
;
; unsigned int FNV1Hash(char *buffer, unsigned int len, unsigned int offset_basis);
;
; #ifdef __cplusplus
; }
; #endif
;
; int hash;
;
; /* obtain 32-bit FNV1 hash */
; hash = FNV1Hash(buffer, len, 2166136261);
;
; /* if desired - convert from a 32-bit to 16-bit hash */
; hash = ((hash >> 16) ^ (hash & 0xFFFF));
;
; uncomment the following line to get FNV1A behavior
%define FNV1A 1
[section .text]
%ifidni __BITS__,32
;
; 32-bit C calling convention
;
%define buffer [ebp+8]
%define len [ebp+12]
%define offset_basis [ebp+16]
global _FNV1Hash
_FNV1Hash:
push ebp ; set up stack frame
mov ebp, esp
push esi ; save registers used
push edi
push ebx
mov esi, buffer ; esi = ptr to buffer
mov ecx, len ; ecx = length of buffer (counter)
mov eax, offset_basis ; set to 2166136261 for FNV-1
mov edi, 1000193h ; FNV_32_PRIME = 16777619
xor ebx, ebx ; ebx = 0
nextbyte:
%ifdef FNV1A
mov bl, byte[esi] ; bl = byte from esi
xor eax, ebx ; al = al xor bl
mul edi ; eax = eax * FNV_32_PRIME
%else
mul edi ; eax = eax * FNV_32_PRIME
mov bl, byte[esi] ; bl = byte from esi
xor eax, ebx ; al = al xor bl
%endif
inc esi ; esi = esi + 1 (buffer pos)
dec ecx ; ecx = ecx - 1 (counter)
jnz nextbyte ; if ecx != 0, jmp to nextbyte
pop ebx ; restore registers
pop edi
pop esi
mov esp, ebp ; restore stack frame
pop ebp
ret ; eax = fnv1 hash
%elifidni __BITS__,64
;
; 64-bit function
;
%ifidni __OUTPUT_FORMAT__,win64
;
; 64-bit Windows fastcall convention:
; ints/longs/ptrs: RCX, RDX, R8, R9
; floats/doubles: XMM0 to XMM3
;
global FNV1Hash
FNV1Hash:
xchg rcx, rdx ; rcx = length of buffer
xchg r8, rdx ; r8 = ptr to buffer
%elifidni __OUTPUT_FORMAT__,elf64
;
; 64-bit Linux fastcall convention
; ints/longs/ptrs: RDI, RSI, RDX, RCX, R8, R9
; floats/doubles: XMM0 to XMM7
global _FNV1Hash
_FNV1Hash:
mov rcx, rsi
mov r8, rdi
%endif
mov rax, rdx ; rax = offset_basis - set to 14695981039346656037 for FNV-1
mov r9, 100000001B3h ; r9 = FNV_64_PRIME = 1099511628211
mov r10, rbx ; r10 = saved copy of rbx
xor rbx, rbx ; rbx = 0
nextbyte:
%ifdef FNV1A
mov bl, byte[r8] ; bl = byte from r8
xor rax, rbx ; al = al xor bl
mul r9 ; rax = rax * FNV_64_PRIME
%else
mul r9 ; rax = rax * FNV_64_PRIME
mov bl, byte[r8] ; bl = byte from r8
xor rax, rbx ; al = al xor bl
%endif
inc r8 ; inc buffer pos
dec rcx ; rcx = rcx - 1 (counter)
jnz nextbyte ; if rcx != 0, jmp to nextbyte
mov rbx, r10 ; restore rbx
ret ; rax = fnv1 hash
%endif
| 27.064748 | 92 | 0.536417 |
16198c7ac7c89d79e7f8076ef2706fbcddbf5f36 | 657 | asm | Assembly | libsrc/_DEVELOPMENT/z180/z180/asm_z180_set_int_state.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/z180/z180/asm_z180_set_int_state.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/z180/z180/asm_z180_set_int_state.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; ===============================================================
; Stefano Bodrato
; ===============================================================
;
; void z180_set_int_state(unsigned int state)
;
; Set the ei/di status previously retrieved.
;
; ===============================================================
INCLUDE "config_private.inc"
SECTION code_clib
SECTION code_z180
PUBLIC asm_z180_set_int_state
PUBLIC asm_cpu_set_int_state
asm_z180_set_int_state:
asm_cpu_set_int_state:
; enter : l = ei/di status
;
; uses : f
bit 2,l ; check p/v flag
jr z, di_state
ei_state:
ei
ret
di_state:
di
ret
| 16.846154 | 65 | 0.479452 |
29fa33830639a4db30620877978b0012b5d59100 | 968 | asm | Assembly | sk/sfx/7B.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 9 | 2017-10-09T20:28:45.000Z | 2021-06-29T21:19:20.000Z | sk/sfx/7B.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 12 | 2018-08-01T13:52:20.000Z | 2022-02-21T02:19:37.000Z | sk/sfx/7B.asm | Cancer52/flamedriver | 9ee6cf02c137dcd63e85a559907284283421e7ba | [
"0BSD"
] | 2 | 2018-02-17T19:50:36.000Z | 2019-10-30T19:28:06.000Z | Sound_7B_Header:
smpsHeaderStartSong 3
smpsHeaderVoice Sound_7B_Voices
smpsHeaderTempoSFX $01
smpsHeaderChanSFX $01
smpsHeaderSFXChannel cFM5, Sound_7B_FM5, $17, $04
; FM5 Data
Sound_7B_FM5:
smpsSetvoice $00
smpsModSet $01, $01, $0C, $01
dc.b nC0, $08
smpsFMAlterVol $10
dc.b nE0
smpsStop
Sound_7B_Voices:
; Voice $00
; $F1
; $23, $30, $11, $30, $1F, $18, $1F, $1F, $05, $1F, $09, $01
; $0B, $12, $03, $03, $1F, $0F, $4F, $2F, $6F, $31, $00, $80
smpsVcAlgorithm $01
smpsVcFeedback $06
smpsVcUnusedBits $03
smpsVcDetune $03, $01, $03, $02
smpsVcCoarseFreq $00, $01, $00, $03
smpsVcRateScale $00, $00, $00, $00
smpsVcAttackRate $1F, $1F, $18, $1F
smpsVcAmpMod $00, $00, $00, $00
smpsVcDecayRate1 $01, $09, $1F, $05
smpsVcDecayRate2 $03, $03, $12, $0B
smpsVcDecayLevel $02, $04, $00, $01
smpsVcReleaseRate $0F, $0F, $0F, $0F
smpsVcTotalLevel $00, $00, $31, $6F
| 26.162162 | 62 | 0.607438 |
46606b1c04177fe778842c2af7ee4ca5c77e4f1c | 160,380 | asm | Assembly | Library/Kernel/Graphics/graphicsString.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Kernel/Graphics/graphicsString.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Kernel/Graphics/graphicsString.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
930! Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Kernel Graphics
FILE: Graphics/graphicsString.asm
AUTHOR: Jim DeFrisco, 26 September 1989
ROUTINES:
Name Description
---- -----------
GLB GrCreateGString Open a graphics string, start redirecting
graphics orders to the string.
GLB GrLoadGString Load a graphics string from a file
GLB GrDrawGString Draw a graphics string
GLB GrDrawGStringAtCP Draw a graphics string at the current
position.
INT GStringSetup Utility routine used by GrDrawGString
INT GStringCleanup Finished drawing GString, do some cleanup.
GLB GrCopyGString Copy a graphics string
GLB GrGetGStringElement Extract an element from a graphics string
GLB GrGetGStringBounds Get the coordinate bounds of a graphics
string drawn at the current position
EXT GrDerefPtrGString Dereference a pointer-type gstring
INT CheckEndCondition Check end condition, see if done drawing
GLB ReadElement Read the next graphics string into the file
buffer
INT DerefMemElement Read the next element from a chunk-based
GString
INT DerefStreamElement Already an element in the buffer, point at
it.
INT ReadStreamElement Read in the next element from a stream
INT ReadStreamBytes Utility routine to read a few bytes from a
stream.
INT DerefVMemElement Read in the next vmem element
INT ReadVMemElement Read in the next vmem element
INT DerefPtrElement Get pointer to element
INT GetElementInfo Grab some info about the element, store in
the stack frame
GLB PlayElement Play a single graphics string element
INT CallKernelRoutine Call the appropriate kernel graphics
routine
INT PENoArgs Interpret elements with no arguments
INT PEOneCoord Interpret elements with one coordinate
value
INT PERelCoord Interpret elements with one coordinate
value
INT PETwoCoords Interpret elements with two coordinate
values
INT PEByteAttr Interpret attribute elements with one byte
arguments
INT PE3ByteAttr Interpret elements with RGB color arguments
INT PEWordAttr Interpret attribute elements with one word
arguments
INT PELineStyle Interpret attribute elements with one word
arguments
INT PESpacePad Interpret elements with RGB color arguments
INT PESetFont Interpret SetFont call
INT PEDrawChar Interpret drawchar elements
INT PETMatrix Interpret elements with transformation
matrices passed
INT PEClipRect Interpret elements from a clip rect opcode
INT PEDrawText Interpret draw_text elements
INT PEDrawRoundRects Interpret rounded rectangle & some
arc-related elements
INT PEDrawArcs Interpret arc-related elements
INT PEDrawHalfLine Interpret horis and vertical lines
INT PEPolyCoord Interpret poly-coord elements
INT PERotate Interpret scale and rotate opcodes
INT PETransScale Interpret translation/scale opcode
INT PEComment Encountered a GR_COMMENT opcode while
interpreting
INT PECustomMask Encountered a END_STRING opcode while
interpreting
INT PECustomStyle Encountered a GR_SET_CUSTOM_LINE_STYLE
opcode
INT PEAttr Encountered a SET_{LINE,AREA,TEXT}_ATTR
opcode
INT PESetPattern Encountered a GR_SET_???_PATTERN in the
GString
INT PESetCustPattern Encountered a GR_SET_???_PATTERN in the
GString
GLB PEBitmapPtr Draw a bitmap pointer static element
GLB PEBitmapOptr Draw a bitmap localmem pointer static
element
INT PEBitmap Encountered a GR_DRAW_BITMAP opcode
GLB PEBitmapCB Callback to write next slice of bitmap
GLB PETextPtr Draw a text pointer static element
GLB PETextOptr Draw a text localmem pointer static element
INT PETextField Draw GR_DRAW_TEXT_FIELD element
EXT TextFieldCB Callback routine for PETextField
INT BoundRelCoord Accumulate the bounds of a relatively drawn
object
INT BoundText Figure the bounds for some piece of text
INT BoundPoly Do bounds calc, for poly something
INT BoundRect Calculate and accumulate bounds for an
object
INT BoundCoord Process a single coordinate for bounds
calculation
INT BoundX Do min/max calc on X coordinate
INT BoundY Do min/max calc on y coordinate
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 9/26/89 Initial revision
DESCRIPTION:
This file contains the global interface for all the graphics string
support in the kernel.
Resources:
GraphicsCommon
GraphicsString
$Id: graphicsString.asm,v 1.1 97/04/05 01:13:44 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GraphicsCommon segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrLoadGString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Load a graphics string from a file
CALLED BY: GLOBAL
PASS: cl - type of handle passed in bx (enum GStringType):
GST_CHUNK - block handle
GST_STREAM - stream handle
GST_VMEM - VMem file handle
GST_PTR - segment address
bx - handle to file where gstring is stored, or
segment address (For GST_PTR strings)
si - if cx = GST_VMEM then
si = vmem block handle of gstring beginning
if cx = GST_PTR then
si = offset in block to start of string
if cx = GST_CHUNK then
si = chunk handle
RETURN: si - handle of graphics string
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
This routine doesn't actually load the entire string into
memory, it just allocates a GString structure for the file, so
that the handle can be used with the other string routines.
The file is assumed open, and positioned at the beginning of
the string.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 09/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrLoadGString proc far
uses ax, cx, di ; save some regs
.enter
if FULL_EXECUTE_IN_PLACE
EC < cmp cl, GST_PTR >
EC < jne continue >
EC < call ECAssertValidFarPointerXIP >
continue::
endif
clr ch
call AllocGString ; allocate the handle/structs
mov si, di ; return handle in si
.leave
ret
GrLoadGString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DerefPtrElement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get pointer to element
CALLED BY: INTERNAL
ReadElement
PASS: es - GString block
RETURN: ds:si - ptr to element
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/16/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DerefPtrElement proc far
.enter
mov ds, es:[GSS_hString] ; get segment
mov si, es:[GSS_firstBlock] ; get pointer to start
add si, es:[GSS_curPos].low ; get offset
clc
.leave
ret
DerefPtrElement endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GetElementInfo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Grab some info about the element, store in the stack frame
CALLED BY: INTERNAL
ReadString
PASS: es - GString block
ds:si - pointer to element
inherits DrawStringFrame
RETURN: carry - set if invalid opcode
else
fills fields in the stack frame
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/16/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GetElementInfo proc near
.enter
movdw es:[GSS_lastPtr], dssi
mov bl, ds:[si] ; get opcode
cmp bl, GStringElement
cmc
jc done
CheckHack <(size GSElemInfo) eq 10>
clr bh
shl bx ;*2
mov ax, bx
shl bx ;*4
shl bx ;*8
add bx, ax
cmp bx, GR_DRAW_TEXT_FIELD * (size GSElemInfo)
je yowza
mov ax, cs:GSElemInfoTab[bx].GSEI_size ; al = elem size
cmp ax, 1 ; if zero, bail >
jc done
; if any of the top two bits are set, it indicates that the
; that the element is variable sized. The rest of the
; byte is an offset into the element to a word that holds
; a count. That count can be one of bytes, words or dwords
; as indicated by the top two bits:
; TOP TWO BITS SIZE OF VARIABLE ELEMENTS
; 00 Not variable sized
; 01 byte count
; 10 word count
; 11 dword count
test ah, 0xc0 ; variable sized ?
jnz calcVariableSize
haveSize:
mov es:[GSS_lastSize], ax
movdw es:[GSS_lastRout], cs:GSElemInfoTab[bx].GSEI_play, ax
movdw es:[GSS_lastKern], cs:GSElemInfoTab[bx].GSEI_kern, ax
clc
done:
.leave
ret
; we can calculate this now...
calcVariableSize:
push bx
mov bl, ah
and bx, 0x3f ; isolate low bits
mov bx, ds:[si][bx] ; grab count
test ah, 0x80 ; *2 ?
jz haveVarSize
shl bx, 1
test ah, 0x40
jz haveVarSize
shl bx, 1
haveVarSize:
clr ah
add ax, bx
pop bx
jmp haveSize
; GR_DRAW_TEXT_FIELD is a brutish beast and we must
; calculate its size.
; First get the total number of chars and advance
; si to the begining of the first style run
yowza:
push cx ; don't trash
push si ; offset to element
add si,offset ODTF_saved
mov cx,ds:[si].GDFS_nChars ;
add si,size GDF_saved
; Loop through the style runs until we've read
; the total number of chars
nextStyle:
lodsw ; num chars in style
add si,size TextAttr ; move past TextAttr
DBCS < shl ax, 1 >
add si,ax ; move past chars
DBCS < shr ax, 1 >
sub cx,ax
jnz nextStyle
; The size of the GR_DRAW_TEXT_FIELD is the offset past
; the last char - the original offset to the element
mov ax,si ; offset past last char
pop si ; original offset
sub ax,si ; size
pop cx ; don't trash
jmp haveSize
GetElementInfo endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PlayElement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Play a single graphics string element
CALLED BY: GLOBAL
PASS: ds:si - far pointer to element
inherits DrawStringFrame
di - GState
es - GString block
RETURN: nothing
DESTROYED: ax, bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/89 Initial version
jim 4/92 rewritten for 2.0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PlayElement proc far
; signal we're going to use the element that is setup
and es:[GSS_flags], not mask GSF_ELEMENT_READY
; bump curPos to the next element
mov bx, es:[GSS_flags] ; get flags
and bl, mask GSF_HANDLE_TYPE ; isolate gstring type
cmp bl, GST_VMEM ; different bump routine for vm
je bumpVMemCurPos
mov bx, es:[GSS_lastSize]
add es:[GSS_curPos].low, bx
adc es:[GSS_curPos].high, 0
; call the local play routine
playIt:
tst di ; if zero, don't call rout
jz done
test es:[GSS_flags], mask GSF_FIGURE_BOUNDS ; see which...
; clears carry
jz notBounds
stc
notBounds:
mov bx, es:[GSS_lastRout].segment
mov ax, es:[GSS_lastRout].offset
push bx
call ProcCallModuleRoutine
pop bx
done:
ret
; for all other gstring types, add in the current elem size
bumpVMemCurPos:
incdw es:[GSS_curPos] ; next element in HugeArray
jmp playIt
PlayElement endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CallKernelRoutine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call the appropriate kernel graphics routine
CALLED BY: all PEXXXXX routines
PASS: es - GString structure
RETURN: depends on kernel routine
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
call ProCallFixedOrMovable
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine became necessary when some of the kernel graphics
routines moved out of fixed memory.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 02/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
Common_CallKernelRoutine proc near
DSframe local DrawStringFrame
.enter inherit
mov ss:[TPD_dataAX], ax
mov ss:[TPD_dataBX], bx
movdw bxax, es:[GSS_lastKern]
call ProcCallFixedOrMovable
.leave
ret
Common_CallKernelRoutine endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CheckEndCondition
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check end condition, see if done drawing
CALLED BY: INTERNAL
GrDrawStringAtCP
PASS: inherits DrawStringFrame
ds:si - points at next element
RETURN: carry - set if done, else clear
if carry is set:
dx - exit code, if carry set
cx - additional info, as per exit code:
enum in dx value in cx
---------- -----------
GSRT_COMPLETE nothing
GSRT_NEW_PAGE PageEndCommand (in cl)
GSRT_FAULT nothing
GSRT_LABEL label value
GSRT_ESCAPE escape number
GSRT_ONE next opcode (in cl)
GSRT_MISC next opcode (in cl)
GSRT_XFORM next opcode (in cl)
GSRT_OUTPUT next opcode (in cl)
GSRT_ATTR next opcode (in cl)
GSRT_PATH next opcode (in cl)
DESTROYED: bx
PSEUDO CODE/STRATEGY:
Check opcode against various ending conditions
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CheckEndCondition proc far
DSframe local DrawStringFrame
.enter inherit
; test for all the possible abort conditions
; check first for end of string
clr ch ; return a word
mov cl, ds:[si] ; get next opcode
mov dx, GSRT_COMPLETE ; assume we're done
cmp cl, GR_END_GSTRING ; done ?
je doneStop ; yes, set carry & go
; check to see if any other flags set
mov bx, DSframe.DSF_flags ; load up passed flags
tst bx ; no flags ?
jnz keepLooking ; no, continue
doneContinue:
clc ; setup carry
.leave
ret
; stop drawing
doneStop:
stc ; signal done
.leave
ret
; check next for drawing one element
keepLooking:
mov dx, GSRT_ONE ; assume return value
test bx, mask GSC_ONE ; done after one ?
jnz doneStop
; check for an output element
test bx, mask GSC_OUTPUT
jz checkNewPage
mov dx, GSRT_OUTPUT ; setup return type
cmp cl, GSE_FIRST_OUTPUT_OPCODE ; check the range
jb notOutput
cmp cl, GSE_LAST_OUTPUT_OPCODE
jbe doneStop
; we were looking for an output code, but didn't find one,
; it that's all we were interested in, we're done.
notOutput:
and bx, not mask GSC_OUTPUT ; clear the bit
jz doneContinue ; if nothing else, go
; check next for a form feed
checkNewPage:
test bx, mask GSC_NEW_PAGE ; looking for new page?
jz checkEscape ; no, continue
cmp cl, GR_NEW_PAGE ; found new page ?
jne notNewPage
mov dx, GSRT_NEW_PAGE ; signal we found it
mov cl, ds:[si].ONP_pageEnd ; return PageEndCommand
jmp doneStop
notNewPage:
and bx, not mask GSC_NEW_PAGE
jz doneContinue
; check next for an escape code
checkEscape:
test bx, mask GSC_ESCAPE ; looking for escape ?
jz checkLabel ; no, continue
cmp cl, GR_ESCAPE ; escape code ?
jne notEscape ; no, continue
mov dx, GSRT_ESCAPE ; yes, load ret values
mov cx, ds:[si].OE_escCode ; including esc code
jmp doneStop ; yes, finished
notEscape:
and bx, not mask GSC_ESCAPE
jz doneContinue
; check next for a GString label element
checkLabel:
test bx, mask GSC_LABEL ; stopping for labels ?
jz checkMisc
cmp cl, GR_LABEL ; found one ?
jne notLabel
mov dx, GSRT_LABEL
mov cx, ds:[si].OL_value ; return label value
jmp doneStop
notLabel:
and bx, not mask GSC_LABEL
jz doneContinue
; check for an output code
checkMisc:
test bx, mask GSC_MISC ; bit set ?
jz checkXform ; no, keep looking
mov dx, GSRT_MISC
cmp cl, GSE_LAST_MISC_OPCODE ; see if an output code
ja notMisc
doneStopCloser:
stc
.leave
ret
notMisc:
and bx, not mask GSC_MISC
jz doneContCloser
; check for xformation related opcode
checkXform:
test bx, mask GSC_XFORM ; bit set ?
jz checkAttr
mov dx, GSRT_XFORM
cmp cl, GSE_FIRST_XFORM_OPCODE
jb checkAttr
cmp cl, GSE_LAST_XFORM_OPCODE
jbe doneStopCloser
and bx, not mask GSC_XFORM
jnz checkAttr
doneContCloser:
clc
.leave
ret
; check for attribute related opcode
checkAttr:
test bx, mask GSC_ATTR ; bit set ?
jz checkPath
mov dx, GSRT_ATTR
cmp cl, GSE_FIRST_ATTR_OPCODE
jb checkPath
cmp cl, GSE_LAST_ATTR_OPCODE
jbe doneStopCloser
and bx, not mask GSC_ATTR
jz doneContCloser
; must be path, then
checkPath:
mov dx, GSRT_PATH
cmp cl, GSE_FIRST_PATH_OPCODE ; in not here, fault
jb doneContCloser
cmp cl, GSE_LAST_PATH_OPCODE ; in not here, fault
jbe doneStopCloser
mov dx, GSRT_FAULT
cmp cl, GSE_LAST_OPCODE ; catch bogus codes
ja doneStopCloser
jmp doneContCloser
CheckEndCondition endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ReadElement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Read the next graphics string into the file buffer
CALLED BY: GLOBAL
PASS: inherits DrawStringFrame
es - GString
RETURN: carry - set if some problem reading, else
ds:si - far pointer to element
DESTROYED: bx
PSEUDO CODE/STRATEGY:
if we don't already have one:
call individual read routines
set the flag saying we have one
else
just get a pointer to it.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
Note: this routine does NOT bump the curPos, that is now
done in PlayElement
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
jim 4/92 rewritten for 2.0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ReadElement proc far uses ax
DSframe local DrawStringFrame
.enter inherit
EC < call ECCheckStack >
; see if we have one already.
mov bx, es:[GSS_flags] ; we'll need the type
test bx, mask GSF_ELEMENT_READY ; see if we have one
jnz derefElement ; yes, just deref it
; there isn't one set up yet. Call the routine to get the
; next one.
and bx, mask GSF_HANDLE_TYPE ; get GString type
shl bx ; dword table
shl bx
mov ax, cs:[readElemTable][bx].offset
mov bx, cs:[readElemTable][bx].segment
call ProcCallFixedOrMovable ; call approp routine
jc exit
done:
call GetElementInfo ; get routine,size,etc
jc exit ; check invalid opcodes
or es:[GSS_flags], mask GSF_ELEMENT_READY
clc
exit:
.leave
ret
; there is already an element set up somewhere that we
; haven't played yet. Get a pointer to it.
derefElement:
and bx, mask GSF_HANDLE_TYPE ; type of gstring
shl bx
shl bx
mov ax, cs:[derefElemTable][bx].offset
mov bx, cs:[derefElemTable][bx].segment
call ProcCallFixedOrMovable ; ds:si -> element
jmp done
ReadElement endp
; table of routines to read in and dereference an element
readElemTable fptr \
DerefMemElement, ; GST_CHUNK
ReadStreamElement, ; GST_STREAM
ReadVMemElement, ; GST_VMEM
DerefPtrElement ; GST_PTR
; table of routines to dereference an element
derefElemTable fptr \
DerefMemElement, ; GST_CHUNK
DerefStreamElement, ; GST_STREAM
DerefVMemElement, ; GST_VMEM
DerefPtrElement ; GST_PTR
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GStringSetup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Utility routine used by GrDrawGString
CALLED BY: INTERNAL
GrDrawGStringAtCP
PASS: si - handle of GString to draw
di - handle of GState to draw to
dx - GSControl flags (if required)
NOTE: if CheckEndCondition() is not going to be called,
(as is the case for GrSetGStringPos()), then the flags
are not used (or required).
es - GString block
inherits DrawStringFrame
carry - set if are called from CopyString, so that we don't
need to do the transformation matrix stuff.
RETURN: nothing
DESTROYED: ax,bx,cx,dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/13/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GStringSetup proc far
DSframe local DrawStringFrame
.enter inherit
; save the parameters
pushf ; save carry
mov DSframe.DSF_hSrc, si ; save handle
mov DSframe.DSF_hDest, di ; save handle
mov DSframe.DSF_flags, dx ; save them
; check for valid gstring operation
EC < cmp di, si ; bad idea... >
EC < ERROR_Z GRAPHICS_NO_RECURSIVE_GSTRINGS ; ..that's why >
; lock graphics string block
mov bx, si ; lock gstate
call MemLock
mov es, ax ; es -> GState
mov ax, es:[GS_gstring] ; get handle
EC < tst ax ; make sure valid >
EC < ERROR_Z GRAPHICS_BAD_GSTRING_HANDLE ; bogus, die >
call MemUnlock ; release gstate
mov DSframe.DSF_hGString, ax ; save handle
mov bx, ax ; lock GString block
call MemLock
mov es, ax ; es -> GString block
; if it's a chunk-based GString, lock the chunk with the
; elements. We'll unlock it again at the end of the routine.
; Also, we don't store the segment anywhere, since it's an
; LMem type thing and can move around on us. We'll just
; deref the handle when we need to access the block.
mov bx, es:[GSS_flags] ; test the flags
and bx, mask GSF_HANDLE_TYPE ; isolate type
cmp bl, GST_CHUNK ; chunk based ?
jne checkStart ; no, continue
mov bx, es:[GSS_hString] ; get chunk block han
call MemLock ; lock the block
; if this is the intial call to DrawString, save the current
; transform and translate the coord system to the current pos
; If we're continuing, then don't re-save the transform.
checkStart:
popf ; restore carry
jc done ; if CopyString, skip
test es:[GSS_flags], mask GSF_CONTINUING
jnz done
call GrSaveTransform ; save the current xfrm
call GrGetCurPosWWFixed
call GrApplyTranslation ; translate to spot
call GrInitDefaultTransform ; make this the default
or es:[GSS_flags], mask GSF_CONTINUING
done:
.leave
ret
GStringSetup endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GStringCleanup
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Finished drawing GString, do some cleanup.
CALLED BY: INTERNAL
GrDrawStringAtCP
PASS: inherits DrawStringFrame
dx - GSRetType enum
cx - value appropriate to GSRetType in dx (see description
in GrDrawGString, above)
es - GString structure
carry - set if are called from CopyString, so that we don't
need to do the transformation matrix stuff.
RETURN: GString structure unlocked
DESTROYED: es
PSEUDO CODE/STRATEGY:
Things to cleanup:
unlock any locked blocks;
if we stopped on a NEW_PAGE or COMPLETE
restore the matrices.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/14/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GStringCleanup proc far
uses ax, di, bx
DSframe local DrawStringFrame
.enter inherit
jc checkEnd ; no xform stuff for
cmp dx, GSRT_COMPLETE ; CopyString
je restoreMatrix
cmp dx, GSRT_FAULT
je restoreMatrix
cmp dx, GSRT_NEW_PAGE
jne checkEnd
; time to restore the transformation matrix to what it was
; before the GString was played. This includes the default
; transformation.
restoreMatrix:
and es:[GSS_flags], not mask GSF_CONTINUING ; reset flag
mov di, DSframe.DSF_hDest ; get GState handle
call GrRestoreTransform ; restore GS_TMatrix
; if we've hit the end of the GString, then reset the
; position back to the beginning.
checkEnd:
cmp dx, GSRT_COMPLETE ; if at END_STRING
jne checkStream
; if we're at the END_STRING, reset it back to the beginning
mov ax, es:[GSS_flags] ; see if stream type
and ax, not mask GSF_ELEMENT_READY ; nothing ready
mov es:[GSS_flags], ax ; reset flags variable
and ax, mask GSF_HANDLE_TYPE ; isolate handle info
cmp al, GST_STREAM ; if stream, bail
je doFileStuff
; for all but the stream type, we just reset the curPos to zero
clr ax ; clear current position
mov es:[GSS_curPos].low, ax ; this works for all but file
mov es:[GSS_curPos].high, ax ; type
; see if we are a vmem-based string and clean that up too
checkStream:
mov ax, es:[GSS_flags] ; see if stream type
and ax, mask GSF_HANDLE_TYPE ; isolate handle info
cmp al, GST_STREAM ; if stream, bail
je unlockStream
; see if we are a vmem-based string and clean that up too
checkVMemBlock:
mov bx, es:[GSS_flags] ; test the flags
test bx, mask GSF_VMEM_LOCKED ; if locked, undoit
jnz unlockVMem
; see if we had a chunk-based gstring, and unlock the block
; if we did
and bx, mask GSF_HANDLE_TYPE ; isolate type
cmp bl, GST_CHUNK ; chunk based ?
je unlockChunk ; yes, unlock it
; next thing is to unlock the GString block.
unlockGString:
mov bx, DSframe.DSF_hGString
call MemUnlock ; all clear.
.leave
ret
; for stream types, reset the "file position"
doFileStuff:
push bx, cx, dx
mov al, FILE_POS_START ; assume beginning
movdw cxdx, es:[GSS_filePos]
mov bx, es:[GSS_hString]
call FilePosFar
movdw es:[GSS_curPos], dxax
clr es:[GSS_readBytesAvail]
pop bx, cx, dx
jmp checkVMemBlock
; for stream types we need to restore the file position
; to what it would be if we were not buffering the reads
; we only use the term "unlock" for consistency with the
; handle of the other GString types
unlockStream:
tst es:[GSS_readBytesAvail] ; are there excess bytes in buffer?
je checkVMemBlock ; if not, then continue normally
push bx, cx, dx
mov al, FILE_POS_RELATIVE ; back up relative to cur pos
clr dx
xchg dx, es:[GSS_readBytesAvail]
neg dx
mov cx, -1
mov bx, es:[GSS_hString]
call FilePosFar
movdw es:[GSS_curPos], dxax
pop bx, cx, dx
jmp checkVMemBlock
; we have some HugeArray block locked. Deal with it.
unlockVMem:
push ds
mov ds, es:[GSS_lastPtr].segment ; all we need is seg
call HugeArrayUnlock
and es:[GSS_flags], not mask GSF_VMEM_LOCKED
pop ds
jmp unlockGString
; unlock the block the chunk is in
unlockChunk:
mov bx, es:[GSS_hString] ; get chunk block han
call MemUnlock ; release the block
jmp unlockGString
GStringCleanup endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrDrawGString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a graphics string
CALLED BY: GLOBAL
PASS: di - GState handle
si - handle of GString to draw
(as returned by GrLoadString)
ax,bx - x,y coordinate at which to draw
dx - control flags (record of type GSControl):
RETURN: dx - enum of type GSRetType
cx - extra information, based on enum retuned in GSRetType
as follows:
enum in dx value in cx
---------- -----------
GSRT_COMPLETE nothing
GSRT_NEW_PAGE PageEndCommand (in cl)
GSRT_FAULT nothing
GSRT_LABEL label value
GSRT_ESCAPE escape number
GSRT_ONE next opcode (in cl)
GSRT_MISC next opcode (in cl)
GSRT_XFORM next opcode (in cl)
GSRT_OUTPUT next opcode (in cl)
GSRT_ATTR next opcode (in cl)
GSRT_PATH next opcode (in cl)
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Interpret the drawing opcodes in the string, until a string
terminator, end-of-file, user-defined escape or form-feed
opcode (see flags above) is encountered.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 01/90 Copied over from the kernel
jim 4/92 lots of changes for 2.0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrDrawGString proc far
; before we do anything, we have to figure out if this
; routine has been called already with this gstring, in
; which case we don't want to reset the current position.
push ax,bx,ds
mov bx, si ; get source string
call MemLock ; ax -> GState
mov ds, ax
mov ax, ds:[GS_gstring] ; get handle to string
call MemUnlock ; release GState
EC < tst ax ; if zero, bail >
EC < ERROR_Z GRAPHICS_BAD_GSTRING_HANDLE ; bogus, die >
mov bx, ax
call MemLock ; lock GString block
mov ds, ax ; ds -> GString
test ds:[GSS_flags], mask GSF_CONTINUING ; here before
call MemUnlock ; leaves flags alone
pop ax,bx,ds ; restore everything
jnz alreadyMoved
call GrMoveTo ; set pen position
alreadyMoved:
call GrDrawGStringAtCP
.leave
ret
GrDrawGString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrDrawGStringAtCP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a graphics string at the current position.
CALLED BY: GLOBAL
PASS: di - GState handle
si - handle of GString to draw
(as returned by GrLoadString)
dx - control flags (record of type GSControl):
RETURN: dx - enum of type GSRetType
cx - extra information, based on enum retuned in GSRetType
as follows:
enum in dx value in cx
---------- -----------
GSRT_COMPLETE nothing
GSRT_NEW_PAGE PageEndCommand (in cl)
GSRT_FAULT nothing
GSRT_LABEL label value
GSRT_ESCAPE escape number
GSRT_ONE next opcode (in cl)
GSRT_MISC next opcode (in cl)
GSRT_XFORM next opcode (in cl)
GSRT_OUTPUT next opcode (in cl)
GSRT_ATTR next opcode (in cl)
GSRT_PATH next opcode (in cl)
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/10/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrDrawGStringAtCP proc far
uses si, ax, bx, ds, es
DSframe local DrawStringFrame
.enter
ForceRef DSframe
; store away the function arguments and do some setup work
and dx, not mask GSC_PARTIAL ; don't allow it here
clc ; signal not CopyString
call GStringSetup ; es -> GString struc
; if there is something already setup (that is, ReadElement
; was called, but PlayElement wasn't), then play the element
; before we do anything.
test es:[GSS_flags], mask GSF_ELEMENT_READY ; is one there ?
jz readNextElement
call ReadElement ; ds:si -> element
cmp {byte} ds:[si], GR_END_GSTRING ; don't play past this
je deadAlready
call PlayElement ; bump past it
; loop through all elements in string, until we hit something
; we're not supposed to draw...
readNextElement:
call ReadElement ; set up next element
jc hosed
call CheckEndCondition ; see if done
jc donePlaying
call PlayElement ; draw the next one
jmp readNextElement
; done with the gstring. cleanup and leave.
donePlaying:
clc ; signal not CopyString
call GStringCleanup ; clean up things
.leave
ret
; premature end. what a cruel world.
deadAlready:
mov dx, GSRT_COMPLETE
clr cx
jmp donePlaying
; premature termination.
hosed:
mov dx, GSRT_FAULT
clr cx
jmp donePlaying
GrDrawGStringAtCP endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEBitmapOptr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a bitmap localmem pointer static element
CALLED BY: GLOBAL
PASS: ds:si - pointer to last slice
RETURN: ds:si - update pointer
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
if (stream-based string)
read in next slice;
else
just bump pointer to next slice;
Supports the following codes:
GR_DRAW_BITMAP_OPTR
GR_FILL_BITMAP_OPTR
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 5/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEBitmapOptr proc far
uses ds, si
.enter
mov cx, ds:[si].ODBOP_x ; get position info
mov dx, ds:[si].ODBOP_y ; get position info
movdw bxsi, ds:[si].ODBOP_optr ; get resource handle
push bx ; save handle
pushf
call MemLock ; lock it down
mov ds, ax ; ds -> resource
mov si, ds:[si] ; dereference chunk
movdw axbx, cxdx ; move coords over
popf ; restore carry
jc figBounds ; do bounds calculation
callKernel:
clr cx, dx ; no callback routine
call Common_CallKernelRoutine
pop bx ; restore resource handle
call MemUnlock ; release block
.leave
ret
; do bounds calc for bitmap
figBounds:
call GrGetBitmapSize
xchgdw axbx, cxdx
add cx, ax
add dx, bx
call BoundFillRect
jmp callKernel
PEBitmapOptr endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEBitmap
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Encountered a GR_DRAW_BITMAP opcode
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
inherits DrawStringFrame so we can see PARTIAL flag
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrDrawBitmap
GrDrawBitmapAtCP
GrFillBitmap
GrFillBitmapAtCP
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEBitmap proc far
uses si
DSframe local DrawStringFrame
.enter inherit
; load up the coordinates to pass to the bitmap routines. If
; we are doing CP versions, they just won't be used.
pushf ; save bounds flag
mov ax, ds:[si].ODB_x ; get coordinate to draw
mov bx, ds:[si].ODB_y
mov cl, ds:[si].ODB_opcode ; get this opcode
add si, size OpDrawBitmap ; ds:si -> BM header
cmp cl, GR_DRAW_BITMAP ; check for CP versions
je haveHdrPtr
cmp cl, GR_FILL_BITMAP
jne handleAtCP
haveHdrPtr:
test ds:[si].B_type, mask BMT_COMPLEX ; see if it's complex
jnz handleComplex
goforit:
popf ; restore bounds flag
jc figBounds ; do bounds calc
callKernel:
push es:[LMBH_handle] ; find GString block again
call Common_CallKernelRoutine ; call the routine
pop bx
call MemDerefES ; es -> GString block
.leave
ret
; we're doing one of the CP versions. size is at a different
; offset
handleAtCP:
add si, size OpDrawBitmapAtCP - size OpDrawBitmap
call GrGetCurPos ; for AtCP versions, need CP
jmp haveHdrPtr
; we're drawing a complex bitmap. Setup the callback routine
; and other good stuff.
handleComplex:
test DSframe.DSF_flags, mask GSC_PARTIAL ; if partial
jnz partialCallback ; diff callb
setupCallback:
mov ds:[si].CB_devInfo, bp ; save frame pointer
mov dx, SEGMENT_CS
mov cx, offset PEBitmapCB ; dx:cx = callback address
jmp goforit
; do bounds calc for bitmap
figBounds:
push ax, bx, cx, dx
movdw cxdx, axbx
call GrGetBitmapSize
xchgdw axbx, cxdx
add cx, ax
add dx, bx
call BoundFillRect
pop ax, bx, cx, dx
jmp callKernel
; if partial, callback should be NULL
; but only if we would stop here anyway...
partialCallback:
test DSframe.DSF_flags, mask GSC_OUTPUT or mask GSC_ONE
jz setupCallback
clr cx, dx ; no callback...
jmp goforit
PEBitmap endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PESlice
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: A specialty routine for bitmap slices when GrCopyGString is
used in PARTIAL mode.
CALLED BY:
PASS:
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 1/21/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PESlice proc far
uses si, di, bx, cx, ax
DSframe local DrawStringFrame
.enter inherit
; bail if we're not going to another GString
push ds
mov bx, di
call MemLock
mov ds, ax
mov ax, ds:[GS_gstring]
mov cx, ds:[GS_window]
call MemUnlock
pop ds
or cx, ax ; if no win or
jz done ; gstring,bail
tst ax
jz done
; bail if we're not in partial mode
test DSframe.DSF_flags, mask GSC_PARTIAL ; must be...
EC < ERROR_Z GRAPHICS_BAD_GSTRING_ELEMENT_DATA >
NEC < jz done ; else skip >
; only writing to a GString here...
mov di, ax ; di = GString handle
mov al, GSE_BITMAP_SLICE
mov cl, 2
mov bx, ds:[si].OBS_size
mov ch, GSSC_DONT_FLUSH
call GSStoreBytes
mov al, GSE_INVALID
mov ah, GSSC_FLUSH
mov cx, ds:[si].OBS_size
add si, size OpBitmapSlice
call GSStore
done:
.leave
ret
PESlice endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEBitmapPtr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a bitmap pointer static element
CALLED BY: GLOBAL
PASS: ds:si - pointer to last slice
RETURN: ds:si - update pointer
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
if (stream-based string)
read in next slice;
else
just bump pointer to next slice;
Supports the following codes:
GR_DRAW_BITMAP_PTR
GR_FILL_BITMAP_PTR
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEBitmapPtr proc far
uses si
.enter
mov ax, ds:[si].ODTP_x1 ; get position info
mov bx, ds:[si].ODTP_y1 ; get position info
mov si, ds:[si].ODTP_ptr ; load offset to bitmap data
jc figBounds
callKernel:
clr cx, dx ; no complex ones allowed
call Common_CallKernelRoutine
.leave
ret
figBounds:
movdw cxdx, axbx
call GrGetBitmapSize
xchgdw cxdx, axbx
add cx, ax
add dx, bx
call BoundFillRect
jmp callKernel
PEBitmapPtr endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEBitmapCB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Callback to write next slice of bitmap
CALLED BY: GLOBAL
PASS: ds:si - pointer to last slice
RETURN: ds:si - update pointer
DESTROYED: es (else ec +segment death for VM gstrings)
PSEUDO CODE/STRATEGY:
We need to inherit the DrawStringFrame variables, so we can
read in the next slice. BP is actually not correct as passed
to this routine, but we've stored the correct value of BP in
the CB_devInfo field of the bitmap header.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
jim 4/92 rewritten for 2.0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEBitmapCB proc far
uses bp, bx
DSframe local DrawStringFrame
.enter inherit
mov bp, ds:[si].CB_devInfo ; make the frame valid
sub si, size OpBitmapSlice ; assume it was a slice
cmp {byte} ds:[si], GSE_BITMAP_SLICE ; check assumption
jne notASlice
; ds:si -> beginning of element. Use ReadElement to read in
; the next slice.
haveElemPtr:
mov bx, DSframe.DSF_hGString ; get handle to locked
call MemDerefES ; block es -> GString
call ReadElement ; read the next element
and es:[GSS_flags], not mask GSF_ELEMENT_READY
cmp {byte} ds:[si], GSE_BITMAP_SLICE ; see if we're done
jne doneWithBitmap
; In order that the PESlice routine doesn't get called when
; we are done drawing, we need to update the internal
; pointers in the GString structure. The operation depends
; on the type of GString (the current position in a VMem
; GString is the element number, for others it is an offset
; into the block/chunk/file.
mov bx, es:[GSS_flags] ; get flags
and bl, mask GSF_HANDLE_TYPE ; isolate gstring type
cmp bl, GST_VMEM ; different bump routine for vm
je bumpVMemCurPos
mov bx, es:[GSS_lastSize]
add es:[GSS_curPos].low, bx
adc es:[GSS_curPos].high, 0
playIt:
add si, size OpBitmapSlice ; else bump past GS
mov ds:[si].CB_devInfo, bp ; save frame ptr again
clc ; signal valid slice
done:
.leave
ret
; we're done with the bitmap. Signal completion and exit.
doneWithBitmap:
stc
jmp done
; we just finished with the first slice. It's either a
; GR_DRAW_BITMAP or a GR_DRAW_BITMAP_CP
notASlice:
sub si, (size OpDrawBitmap)-(size OpBitmapSlice)
cmp {byte} ds:[si], GR_DRAW_BITMAP
je haveElemPtr
sub si, (size OpDrawBitmapAtCP) - (size OpDrawBitmap)
jmp haveElemPtr
; for all other gstring types, add in the current elem size
bumpVMemCurPos:
incdw es:[GSS_curPos] ; next element in HugeArray
jmp playIt
PEBitmapCB endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEByteAttr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret attribute elements with one byte arguments
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
; OUTPUT
GrFillPath (RegionFillRule)
; ATTRIBUTE
GrSetMixMode
GrSetLineEnd
GrSetLineJoin
GrSetLineColorMap
GrSetAreaColorMap
GrSetTextColorMap
GrSetLineMask (system pattern)
GrSetAreaMask (system pattern)
GrSetTextMask (system pattern)
GrSetLineColor (color index)
GrSetAreaColor (color index)
GrSetTextColor (color index)
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEByteAttr proc far
; load the arguments and call the routine
mov al, ds:[si].OSMM_mode ; get byte
; Move into CL as well, so GrFillPath can be called.
mov cl, al
mov ah, 0 ; some routines need this
jc figBounds
callKernel:
call Common_CallKernelRoutine
ret
; for this routine, the only significant opcode is GR_FILL_PATH
figBounds:
cmp ds:[si].OFLP_opcode, GR_FILL_PATH
jne callKernel
push ax,bx,cx,dx
mov ax, GPT_CURRENT
call GrGetPathBounds
call BoundFillRect
pop ax,bx,cx,dx
jmp callKernel
PEByteAttr endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PESetFont
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret SetFont call
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrSetFont
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PESetFont proc far
; load the arguments and call the routine
mov ah, ds:[si].OSF_size.WBF_frac ; assume SetFont
mov dx, ds:[si].OSF_size.WBF_int ;
mov cx, ds:[si].OSF_id ; get FontID
call GrSetFont
ret
PESetFont endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEDrawText
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret draw_text elements
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrDrawText
GrDrawTextAtCP
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEDrawText proc far
uses si
.enter
.assert (offset ODT_x1) eq (offset ODTCP_len)
; getting at least one word, then check for funct
; assume GrDrawText
mov ax, ds:[si].ODT_x1 ; first word was x coord
mov bx, ds:[si].ODT_y1
mov cx, ds:[si].ODT_len
jc figBounds
cmp {byte} ds:[si], GR_DRAW_TEXT ; different for each
jne doCP
add si, size OpDrawText
; have params, call routine
callKernel:
jcxz done ; if no text, we're done
; (the length field is always
; valid in a GString, so we
; don't have to worry about
; NULL-terminated strings)
call Common_CallKernelRoutine
done:
.leave
ret
; no bounds, but we're doing the Current Pos thing
doCP:
mov cx, ax ; move size over
add si, size OpDrawTextAtCP
jmp callKernel
; need to compute the bounds of the text
figBounds:
cmp {byte} ds:[si], GR_DRAW_TEXT ; different for each
jne getDrawPos
add si, size OpDrawText
getBounds:
jcxz done ; if no text, we're done
; (the length field is always
; valid in a GString, so we
; don't have to worry about
; NULL-terminated strings)
call BoundText
jmp callKernel
getDrawPos:
mov cx, ax ; size is first word here
call GrGetCurPos ; ax,bx = current position
add si, size OpDrawTextAtCP ; ds:si -> text
jmp getBounds
PEDrawText endp
GraphicsCommon ends
;---------------------------------------------------------
;---------------------------------------------------------
;---------------------------------------------------------
GraphicsString segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CallKernelRoutine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call the appropriate kernel graphics routine
CALLED BY: all PEXXXXX routines
PASS: es - GString structure
RETURN: depends on kernel routine
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
call ProCallFixedOrMovable
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine became necessary when some of the kernel graphics
routines moved out of fixed memory.
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 02/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GS_CallKernelRoutine proc near
DSframe local DrawStringFrame
.enter inherit
mov ss:[TPD_dataAX], ax
mov ss:[TPD_dataBX], bx
movdw bxax, es:[GSS_lastKern]
call ProcCallFixedOrMovable
.leave
ret
GS_CallKernelRoutine endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrCreateGString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Open a graphics string, start redirecting graphics orders to
the string.
CALLED BY: GLOBAL
PASS: cl - type of handle passed in bx (enum GStringType):
GST_CHUNK - memory handle:chunk
GST_STREAM - stream handle
GST_VMEM - VM file handle
bx - handle of entity in which to store graphics string.
(one of: {memory,stream,vmem file} handle)
RETURN: di - handle of graphics string
si - allocated chunk/VMBlock handle (as appropriate)
(for GST_CHUNK and GST_VMEM types only)
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 09/89 Initial version
Jim 11/89 Broke out substring definition to
another routine
Jim 2/90 Added GState support
Jim 3/90 Added VMem support
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrCreateGString proc far
uses ax, cx ; save some regs
.enter
mov ch, mask CGSC_WRITING ; initiating writing
clr si ; allocate me a block
call AllocGString ; allocate the handle/structs
.leave
ret
GrCreateGString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrEditGString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Setup a graphics string into an editing mode
CALLED BY: GLOBAL
PASS: bx:si - VM file:block handle to HugeArray where gstring
is stored (Editing only works for GST_VMEM types)
RETURN: di - handle of graphics string to edit (actually a GState
handle)
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 05/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrEditGString proc far
uses ax, cx ; save some regs
.enter
mov cl, GST_VMEM
mov ch, mask CGSC_WRITING ; initiating writing
call AllocGString ; allocate the handle/structs
.leave
ret
GrEditGString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrParseGString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Parse a graphics string by calling back on desired elements.
CALLED BY: GLOBAL
PASS: di - GState handle or 0
si - handle of GString to draw
(as returned by GrLoadString)
dx - control flags (record of type GSControl):
bx:cx - vfptr to callback routine
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
When the callback routine is called, the following is set
up:
PASS: ds:si - pointer to element.
bx - BP passed to GrParseGString
di - GState handle passed to GrParseGString
RETURN: ax - TRUE if finished, else
FALSE to continue parsing.
ds - as passed or segment of another
huge array block in vm based
gstrings. See Special Processing
below.
MAY DESTROY: ax,bx,cx,dx,di,si,bp,es
Must *NOT* write into, realloc, move or otherwise
munge the block pointed to by ds.
Special Processing:
In huge array based gstrings the call back
routine may change ds to point to other huge
array blocks in the gstring. In this case,
upon returning from the call back,
GrParseGString will unlock the huge array
block now referenced by ds and relock the
the huge array block originally passed
to the call back. All gstring elements will
be processed.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/10/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrParseGString proc far
uses si, ax, bx, ds, es, cx, dx
DSframe local DrawStringFrame
.enter
if FULL_EXECUTE_IN_PLACE
;
; In XIP kernels, we need to make sure the far pointer does not
; reference something in an XIP'ed resource (since this code is
; in a movable resource and might have just been banked over the
; callback routine...
EC< xchg cx, si >
EC< call ECAssertValidFarPointerXIP >
EC< xchg si, cx >
endif
mov ax, ss:[bp] ; get old BP
mov DSframe.DSF_savedBP, ax ; save for callback
movdw DSframe.DSF_callBack,bxcx
; store away the function arguments and do some setup work
and dx, not mask GSC_PARTIAL ; don't allow it here
stc ; signal no xforms
call GStringSetup ; es -> GString struc
; if there is something already setup (that is, ReadElement
; was called, but PlayElement wasn't), then play the element
; before we do anything.
test es:[GSS_flags], mask GSF_ELEMENT_READY ; is one there ?
jz readNextElement
call ReadElement ; ds:si -> element
cmp {byte} ds:[si], GR_END_GSTRING ; don't go past this
je deadAlready
call PlayElement ; bump past it
; loop through all elements in string, until we hit something
; we're not supposed to draw...
readNextElement:
call ReadElement ; set up next element
jc hosed
call CheckEndCondition ; see if done
jc foundElement
playElement:
call PlayElement ; draw the next one
jmp readNextElement
; do the callback
foundElement:
cmp dx, GSRT_COMPLETE ; if done, exit
je donePlaying
push si, bp, dx, cx, di
push ds,es ; element, GString seg
mov cl, ds:[si] ; get opcode
cmp cl, GR_ESCAPE
jne doCallBack
mov dx, ds:[si].OE_escCode ; load escape type
doCallBack:
if FULL_EXECUTE_IN_PLACE
mov ss:[TPD_dataAX], ax ; faster than push/pop
mov ax, DSframe.DSF_savedBP
mov ss:[TPD_dataBX], ax
movdw bxax, DSframe.DSF_callBack
call ProcCallFixedOrMovable
else
mov bx, DSframe.DSF_savedBP ; give them access
call ss:DSframe.DSF_callBack ; call caller
endif
pop bx,es ; passed element seg
; GString seg
; If this is a gstring in a vmem the call back routine
; may have advanced to another block in the gstring.
CheckHack <offset GSF_HANDLE_TYPE eq 0 >
mov dx,es:[GSS_flags]
andnf dx,mask GSF_HANDLE_TYPE
cmp dx,GST_VMEM
je checkForNewBlock
popRest:
pop si, bp, dx, cx, di
cmp ax, TRUE ; see if done
jne playElement
; done with the gstring. cleanup and leave.
donePlaying:
stc ; signal not CopyString
call GStringCleanup ; clean up things
.leave
ret
; END_GSTRING was the first element. bummer.
deadAlready:
mov dx, GSRT_COMPLETE
clr cx
jmp donePlaying
; premature termination.
hosed:
mov dx, GSRT_FAULT
clr cx
jmp donePlaying
checkForNewBlock:
; If the returned segment is different we need to unlock
; the block currently being pointed to and lock the
; original block so that we can continue processing
; where we left off.
mov dx,ds ; returned segemnt
cmp dx,bx ; returned seg, passed seg
je popRest
push ax ; call back return flags
call HugeArrayUnlock
mov bx,es:[GSS_hString]
mov di,es:[GSS_firstBlock]
movdw dxax,es:[GSS_curPos]
call HugeArrayLock
mov es:[GSS_lastPtr].segment,ds; orig block may have moved
pop ax ; call back return flags
jmp popRest
GrParseGString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrCopyGString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copy a graphics string
CALLED BY: GLOBAL
PASS: si - source gstring
di - destination gstring
dx - control flags (record of type GSControl):
RETURN: dx - enum of type GSRetType
cx - extra info as appropriate to the value in dx:
enum in dx value in cx
---------- -----------
GSRT_COMPLETE nothing
GSRT_NEW_PAGE nothing
GSRT_FAULT nothing
GSRT_LABEL label value
GSRT_ESCAPE escape number
GSRT_ONE next opcode (in cl)
GSRT_MISC next opcode (in cl)
GSRT_XFORM next opcode (in cl)
GSRT_OUTPUT next opcode (in cl)
GSRT_ATTR next opcode (in cl)
GSRT_PATH next opcode (in cl)
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Write elements found in input GString to output GString, until
we're done.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 01/90 Moved over from the kernel
Jim 04/92 rewritten for 2.0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrCopyGString proc far
uses si, ax, bx, ds, es
DSframe local DrawStringFrame
.enter
ForceRef DSframe
; store away the function arguments and do some setup work
stc ; signal CopyString
call GStringSetup ; es -> GString struc
; if there is something already setup (that is, ReadElement
; was called, but PlayElement wasn't), then play the element
; before we do anything.
test es:[GSS_flags], mask GSF_ELEMENT_READY ; is one there ?
jz readNextElement
call ReadElement ; ds:si -> element
cmp {byte} ds:[si], GR_END_GSTRING ; play it anyway
pushf
call PlayElement ; bump past it
popf
je deadAlready ; play, but don't keep
; loop through all elements in string, until we hit something
; we're not supposed to draw...
readNextElement:
call ReadElement ; set up next element
jc hosed
call CheckEndCondition ; see if done
jc donePlaying ; yes, cleanup
call PlayElement ; draw the next one
jmp readNextElement
; done with the gstring. cleanup and leave.
donePlaying:
stc ; signal CopyString
call GStringCleanup ; clean up things
.leave
ret
; first element was an END_GSTRING. Didn't know what hit me.
deadAlready:
mov dx, GSRT_COMPLETE
clr cx
jmp donePlaying
hosed:
mov dx, GSRT_FAULT
clr cx
jmp donePlaying
GrCopyGString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrGetGStringElement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Extract an element from a graphics string
CALLED BY: GLOBAL
PASS: di - handle to GState
si - handle to GString
cx - size of buffer to put element into
ds:bx - far pointer to buffer
RETURN: al - opcode of element
cx - actual size of element
NOTE: if there are no elements left to get, al is
returned as GSE_INVALID, and cx = zero.
DESTROYED: none
PSEUDO CODE/STRATEGY:
if (buffer is large enough to hold element)
copy element;
return size of element;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 09/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrGetGStringElement proc far
uses es, ds, di, bx, si, dx
DSframe local DrawStringFrame
.enter
if FULL_EXECUTE_IN_PLACE
EC < jcxz xipOK >
EC < push bx, si >
EC < mov si, bx >
EC < mov bx, ds >
EC < call ECAssertValidFarPointerXIP >
EC < pop bx, si >
xipOK::
endif
ForceRef DSframe
push ax ; save passed ah
; store away the function arguments and do some setup work
stc ; signal not drawing
push bx, cx
call GStringSetup ; es -> GString struc
pop bx, cx
push es:[LMBH_handle] ; save GString block
push di ; save GString handle
push ds, bx ; save destination addr
push cx
call ReadElement ; get it all in memory
pop cx
jc readError
; see if the buffer is big enough. If not, copy what we have
; and return the right info
cmp cx, es:[GSS_lastSize] ; buffer big enough ?
jbe haveCopySize
mov cx, es:[GSS_lastSize]
haveCopySize:
pop es, di ; es:di -> destination
mov al, ds:[si] ; grab opcode
jcxz doneCopy
rep movsb ; copy the data
clc ; return no error
; all done, so return some useful info and cleanup
doneCopy:
pop di ; restore gstring handle
call MemDerefStackES ; restore gstring seg
mov cx, es:[GSS_lastSize] ; return element size
doneCommon:
pop dx ; restore old ah
mov ah, dh ; return it intact
mov dx, GSRT_ONE
stc ; signal not drawing
call GStringCleanup ; all done...
.leave
ret
; ReadElement failed. Clear destination address from stack.
readError:
add sp, 4 ; don't need dest addr
mov al, GSE_INVALID ; setup error return
pop di ; restore gstring handle
call MemDerefStackES ; restore gstring seg
clr cx
jmp doneCommon
GrGetGStringElement endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrGetGStringBoundsDWord
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get coordinate bounds of a graphics string
CALLED BY: GLOBAL
PASS: di - graphics state handle, or 0 for no graphics state
si - graphics string handle
dx - enum of type GSControl
ds:bx - fptr to buffer the size of RectDWord
RETURN: ds:bx - RectDWord structure filled with bounds
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
If the GString is empty, this routine returns bounds of
(0,0) to (0,0).
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 11/24/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrGetGStringBoundsDWord proc far
uses ax, bx, cx, dx, di, si, ds, es
DSframe local DrawStringFrame
.enter
if FULL_EXECUTE_IN_PLACE
EC < push bx, si >
EC < movdw bxsi, dsbx >
EC < call ECAssertValidFarPointerXIP >
EC < pop bx, si >
endif
push ds, bx ; save pointer to result structure
and dx, not mask GSC_PARTIAL ; no partial elements
; If we are passed a bogus GState (by Steve, probably), then
; allocate one.
tst di ; check bogosity
jnz haveGState
call GrCreateState
push si
segmov ds, ss
lea si, DSframe.DSF_tempMatrix
call GrGetTransform
pop si
jmp initBounds
; we want to save the GState, and use one without a Window,
; since we don't really want to draw anything.
haveGState:
push si, dx
segmov ds, ss
lea si, DSframe.DSF_tempMatrix
call GrGetFont ; cx, dx.ah = font
pushwwf dxax
call GrGetTransform
call GrGetLineWidth ; affects outcome
pushwwf dxax
call GrGetCurPos ; ax, bx = pos
clr di
call GrCreateState
call GrSetTransform
call GrMoveTo
popwwf dxax
call GrSetLineWidth
popwwf dxax ; cx, dx.ah = font
call GrSetFont
pop si, dx
; initialize bounds
initBounds:
mov ax, 0xffff ; init right/bot to neg
mov ss:DSframe.DSF_brBound.PDF_x.DWF_int.high, ax
mov ss:DSframe.DSF_brBound.PDF_y.DWF_int.high, ax
clr ax ; init top/left to pos
mov ss:DSframe.DSF_brBound.PDF_x.DWF_int.low, ax
mov ss:DSframe.DSF_brBound.PDF_y.DWF_int.low, ax
mov ss:DSframe.DSF_tlBound.PDF_x.DWF_int.high, ax
mov ss:DSframe.DSF_tlBound.PDF_y.DWF_int.high, ax
mov ax, 0x3fff
mov ss:DSframe.DSF_tlBound.PDF_x.DWF_int.low, ax
mov ss:DSframe.DSF_tlBound.PDF_y.DWF_int.low, ax
; store away the function arguments and do some setup work
stc ; signal not playing
call GStringSetup ; es -> GString struc
; set the flag in the GString structure that tells PlayElement
; that we want to get the bounds, not play the darn thing.
or es:[GSS_flags], mask GSF_FIGURE_BOUNDS
; if there is something already setup (that is, ReadElement
; was called, but PlayElement wasn't), then play the element
; before we do anything.
test es:[GSS_flags], mask GSF_ELEMENT_READY ; is one there ?
jz readNextElement
call ReadElement ; ds:si -> element
cmp {byte} ds:[si], GR_END_GSTRING
jne playFirst
mov dx, GSRT_COMPLETE
clr cx
jmp donePlaying
playFirst:
call PlayElement ; bump past it
; loop through all elements in string, until we hit something
; we're not supposed to draw...
readNextElement:
call ReadElement ; set up next element
jc donePlaying
call CheckEndCondition ; see if done
jc donePlaying ; yes, cleanup
call PlayElement ; draw the next one
jmp readNextElement
; done with the gstring. cleanup and leave.
donePlaying:
and es:[GSS_flags], not mask GSF_FIGURE_BOUNDS
stc ; signal CopyString
call GStringCleanup ; clean up things
; before we untransform the coordinates, make sure that
; the bounds are reasonable -- that is, make sure that
; left is smaller than the right. If not, it means the
; GString was empty and we should fixup the values to return.
mov ax, ss:DSframe.DSF_brBound.PDF_x.DWF_int.high
cmp ax, ss:DSframe.DSF_tlBound.PDF_x.DWF_int.high
jl emptyGString ; bail if empty
; get the values stored in the stack frame, and untransform
; them through the transformation matrix.
segmov ds, ss
lea si, ss:DSframe.DSF_tempMatrix ; ds:si -> orig matrix
call GrSetTransform ; setup new transform
clr ax, si
cmpwwf ss:DSframe.DSF_tempMatrix.TM_e12, siax ; these should
jnz doRotate ; be zero
cmpwwf ss:DSframe.DSF_tempMatrix.TM_e21, siax
jnz doRotate
segmov es, ss
lea dx, ss:DSframe.DSF_tlBound ; do top left
call GrUntransformDWFixed
lea dx, ss:DSframe.DSF_brBound ; do bottom right
call GrUntransformDWFixed
jmp storeResults
; GString is empty. Zero out the coords and exit
emptyGString:
call GrDestroyState ; nuke extra GState
pop es, di ; ds:si -> results rect
mov cx, (size RectDWord) / 2 ; # of words => CX
clr ax
rep stosw ; stuff it with zeroes
jmp done
; untransform PAGE coordinate bounds through a rotated matrix.
doRotate:
call UnTransRotBounds
; Store our results, after checking to see that the
; bounds are ordered & properly rounded
storeResults:
call GrDestroyState ; nuke extra GState
pop ds, si ; ds:si -> results rect
movdwf axbxdi, ss:DSframe.DSF_tlBound.PDF_x
rnddwf axbxdi
movdwf cxdxdi, ss:DSframe.DSF_brBound.PDF_x
rnddwf cxdxdi
jledw axbx, cxdx, xSorted
xchgdw axbx, cxdx
xSorted:
movdw ds:[si].RD_left, axbx
movdw ds:[si].RD_right, cxdx
; Finished left & right. Now deal with top & bottom.
;
movdwf axbxdi, ss:DSframe.DSF_tlBound.PDF_y
rnddwf axbxdi
movdwf cxdxdi, ss:DSframe.DSF_brBound.PDF_y
rnddwf cxdxdi
jledw axbx, cxdx, ySorted
xchgdw axbx, cxdx
ySorted:
movdw ds:[si].RD_top, axbx
movdw ds:[si].RD_bottom, cxdx
done:
.leave
ret
GrGetGStringBoundsDWord endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrGetGStringBounds
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get the coordinate bounds of a graphics string drawn at the
current position
CALLED BY: GLOBAL
PASS: di - graphics state handle, or 0 for no graphics state
si - graphics string handle
dx - enum of type GSControl
RETURN: carry - set on any overflow, else
ax - left side coord of smallest rect enclosing string
bx - top coord
cx - right coord
dx - bottom coord
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
if (encounter a GR_SET_GSTRING_BOUNDS element)
use the values in there;
else
Get bounds of each item in string;
Accumulate the net bounds;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
* The coordinates are returned relative to the transformation
matrix in place AT THE BEGINNING of the operation.
* This procedure starts working at the "current GString
position" (ie, the current element number), which
may or may not be the beginning of the GString. To
get the size of the entire string, make sure to call
GrSetGStringPos, passing GSSPT_BEGINNING, BEFORE calling
this routine.
ALSO,
* The "current GString position" after this operation
depends on what is passed in the GSControl flags. So, you
probably want to call GrSetGStringPos directly after
this call, in order to set the position back to where it
was before the call.
* If the GString is empty, this routine returns bounds of
(0,0) to (0,0).
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 09/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrGetGStringBounds proc far
uses si, ds, es
push di
mov_tr ax, di ;Save gstate handle
mov di, 1000
call ThreadBorrowStackSpace
xchg di, ax ;DI <- gstate handle
;AX <- val returned from TBSS
push ax ;Save value from ThreadBorrowSS
dwBounds local RectDWord
.enter
segmov ds, ss, bx
lea bx, dwBounds
call GrGetGStringBoundsDWord
; grab the untransformed values and round the results
movdw siax, ss:dwBounds.RD_left
CheckDWordResult si, ax
jc done
movdw sibx, ss:dwBounds.RD_top
CheckDWordResult si, bx
jc done
movdw sicx, ss:dwBounds.RD_right
CheckDWordResult si, cx
jc done
movdw sidx, ss:dwBounds.RD_bottom
CheckDWordResult si, dx
done:
.leave
pop di
call ThreadReturnStackSpace
pop di ;Restore gstate handle
ret
GrGetGStringBounds endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrSetGStringPos
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the current position of a string
CALLED BY: GLOBAL
PASS: si - gstring handle
al - GStringSetPosType enum
GSSPT_SKIP_1 - skip 1 element
GSSPT_RELATIVE - skip N elements
GSSPT_BEGINNING - start of string
GSSPT_END - end of string
cx - #elements to skip if GSSPT_RELATIVE chosen
(this number can be negative for HugeArray
based gstrings, but must be positive
otherwise).
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrSetGStringPos proc far
uses ax, bx, cx, dx, di, ds, si, es
DSframe local DrawStringFrame
.enter
ForceRef DSframe
; clear DI so GStringSetup doesn't get confused
clr di
; store away the function arguments and do some setup work
stc ; signal not drawing
push ax, cx
call GStringSetup ; es -> GString struc
pop ax, cx
cmp al, GSSPT_BEGINNING ; special stuff
je resetGString ; to backup
cmp al, GSSPT_END ; special stuff
je resetGString ; to go to end
cmp al, GSSPT_SKIP_1 ; just skip one element
jne haveElemCount
mov cx, 1
; have element count. Take a shortcut for VMem based ones.
haveElemCount:
mov dx, es:[GSS_flags] ; see if HugeArray type
and dx, mask GSF_HANDLE_TYPE ; isolate handle info
cmp dl, GST_VMEM ; if not vmem, bail
je moveVMemRelative
; for non-VMem based GStrings, only allow positive counts
tst cx ; make sure we're > 0
jns readNextElement
EC < ERROR GRAPHICS_BAD_GSTRING_TYPE >
NEC < jmp done >
; loop through all elements in string, until we hit something
; we're not supposed to draw...
readNextElement:
push cx ; save count
call ReadElement ; set up next element
jc noMoreElements
mov es:[GSS_lastRout].offset, offset PENull
mov es:[GSS_lastRout].segment, handle PENull
call PlayElement ; advance to next
pop cx
loop readNextElement
; done. cleanup and leave.
done:
mov dx, GSRT_MISC
stc ; signal CopyString
call GStringCleanup ; clean up things
.leave
ret
; we get here if ReadElement fails (because there are no
; more elements to read)
noMoreElements:
pop cx
jmp done
; we allow backing up, but only for the HugeArray code
moveVMemRelative:
mov ax, cx ; make it a dword
cwd ; signed number
adddw es:[GSS_curPos], dxax
jmp done
; go to the beginning of the gstring
resetGString:
mov dx, es:[GSS_flags] ; see if stream type
and dx, not mask GSF_ELEMENT_READY ; nothing ready
mov es:[GSS_flags], dx ; reset flags variable
and dx, mask GSF_HANDLE_TYPE ; isolate handle info
cmp dl, GST_STREAM ; if stream, bail
je doFileStuff
; see if going to beginning or end...
cmp al, GSSPT_BEGINNING ; if not beginning...
jne resetToEnd
; for all but the stream type, we just reset the curPos to zero
clr ax ; clear current position
mov es:[GSS_curPos].low, ax ; this works for all but file
mov es:[GSS_curPos].high, ax ; type
jmp done
; for stream types, reset the "file position"
doFileStuff:
cmp al, GSSPT_BEGINNING ; go to beginning or end ?
mov al, FILE_POS_START ; assume beginning
movdw cxdx, es:[GSS_filePos]
je setFilePos
mov al, FILE_POS_END
clr cx, dx
setFilePos:
mov bx, es:[GSS_hString]
call FilePosFar
movdw es:[GSS_curPos], dxax
clr es:[GSS_readBytesAvail]
jmp done
; go to the end of the GString. Depends on type...
resetToEnd:
cmp dl, GST_PTR ; no can do for ptr
EC < ERROR_Z GRAPHICS_CANT_POS_PTR_GSTRING_TO_END >
NEC < je done ; just bail in non-ec >
cmp dl, GST_CHUNK ; if chunk based, find size
je posChunkAtEnd
EC < cmp dl, GST_VMEM ; must be HugeArray based >
EC < ERROR_NE GRAPHICS_BAD_GSTRING_TYPE >
; for VMem ones, just get the count
mov bx, es:[GSS_hString] ; get VM file handle
mov di, es:[GSS_firstBlock] ; and block handle
call HugeArrayGetCount ; dxax = #elements
movdw es:[GSS_curPos], dxax ; set curPos at end
jmp done
; for Chunk ones, get the size of the chunk
posChunkAtEnd:
mov bx, es:[GSS_hString] ; get block handle
call MemLock ; ax -> block with chunk
mov ds, ax
mov si, es:[GSS_firstBlock] ; get chunk handle
ChunkSizeHandle ds, si, si ; si = size of chunk
call MemUnlock ; release block
mov es:[GSS_curPos].low, si ; store position
jmp done
GrSetGStringPos endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrDeleteGStringElement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Delete a range of GString elements
CALLED BY: GLOBAL
PASS: di - GState handle (points to graphics string)
cx - number of elements to delete (starting with element
at current position)
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 5/18/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrDeleteGStringElement proc far
uses es, bx, ax, dx, di
.enter
mov bx, di ; lock GState
call MemLock
mov es, ax ; es -> GState
mov ax, es:[GS_gstring] ; get gstring handle
call MemUnlock
EC < tst ax ; check for null gstring >
EC < ERROR_Z GRAPHICS_BAD_GSTRING_HANDLE >
mov bx, ax ; bx = gstring handle
push bx ; save block handle
call MemLock ; lock gstring structure
mov es, ax ; es -> GString structure
EC < mov ax, es:[GSS_flags] ; see if vmem type >
EC < and ax, mask GSF_HANDLE_TYPE ; isolate handle info>
EC < cmp al, GST_VMEM ; if not vmem, bail >
EC < ERROR_NE GRAPHICS_BAD_GSTRING_TYPE >
mov bx, es:[GSS_hString] ; get vm file handle
mov di, es:[GSS_firstBlock] ; get vm block handle
movdw dxax, es:[GSS_curPos] ; get current position
call HugeArrayDelete
pop bx ; restore GString block handle
call MemUnlock ; releae block
.leave
ret
GrDeleteGStringElement endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UnTransRotBounds
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Untransform the bounds determined by GrGetGStringBounds
CALLED BY: INTERNAL
GrGetGStringBoundsDWord
PASS: inherits stack frame
RETURN: ax...dx - rectangle bounds, in doc coords
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 5/ 8/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UnTransRotBounds proc near
uses ax, dx, di
.enter inherit GrGetGStringBoundsDWord
; make a copy of the coords for the other corners
movdwf ss:DSframe.DSF_trCorner.PDF_y,\
ss:DSframe.DSF_tlBound.PDF_y, ax
movdwf ss:DSframe.DSF_trCorner.PDF_x,\
ss:DSframe.DSF_brBound.PDF_x, ax
movdwf ss:DSframe.DSF_blCorner.PDF_y,\
ss:DSframe.DSF_brBound.PDF_y, ax
movdwf ss:DSframe.DSF_blCorner.PDF_x,\
ss:DSframe.DSF_tlBound.PDF_x, ax
; untransform all four corners
segmov es, ss
lea dx, ss:DSframe.DSF_tlBound ; do top left
call GrUntransformDWFixed
lea dx, ss:DSframe.DSF_brBound ; do bottom right
call GrUntransformDWFixed
lea dx, ss:DSframe.DSF_blCorner ; do bottom left
call GrUntransformDWFixed
lea dx, ss:DSframe.DSF_trCorner ; do top right
call GrUntransformDWFixed
; sort the results.
movdw axdx, ss:DSframe.DSF_tlBound.PDF_x.DWF_int
jledw axdx, ss:DSframe.DSF_brBound.PDF_x.DWF_int, xSorted
xchgdw axdx, ss:DSframe.DSF_brBound.PDF_x.DWF_int
movdw ss:DSframe.DSF_tlBound.PDF_x.DWF_int, axdx
xSorted:
movdw axdx, ss:DSframe.DSF_tlBound.PDF_y.DWF_int
jledw axdx, ss:DSframe.DSF_brBound.PDF_y.DWF_int, ySorted
xchgdw axdx, ss:DSframe.DSF_brBound.PDF_y.DWF_int
movdw ss:DSframe.DSF_tlBound.PDF_y.DWF_int, axdx
; now we have to do another check to find the mins and maxs
; after the transformations. Use the tlBound and brBound
; variables to keep the min and max.
ySorted:
movdwf siaxdi, DSframe.DSF_blCorner.PDF_x
call CheckGSBX
movdwf siaxdi, DSframe.DSF_trCorner.PDF_x
call CheckGSBX
movdwf siaxdi, DSframe.DSF_blCorner.PDF_y
call CheckGSBY
movdwf siaxdi, DSframe.DSF_trCorner.PDF_y
call CheckGSBY
.leave
ret
UnTransRotBounds endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CheckGSBX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check an X coordinate against current min/max
CALLED BY: INTERNAL
UnTransRotBounds
PASS: siaxdi - DWFixed coord to check
RETURN: nothing
DESTROYED: si,ax,di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 5/ 8/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CheckGSBX proc near
.enter inherit GrGetGStringBoundsDWord
cmp si, DSframe.DSF_tlBound.PDF_x.DWF_int.high
jl newLow
jg checkHigh
cmp ax, DSframe.DSF_tlBound.PDF_x.DWF_int.low
jl newLow
checkHigh:
cmp si, DSframe.DSF_brBound.PDF_x.DWF_int.high
jg newHigh
jl done
cmp ax, DSframe.DSF_brBound.PDF_x.DWF_int.low
jg newHigh
done:
.leave
ret
newLow:
xchgdwf siaxdi, DSframe.DSF_tlBound.PDF_x
jmp checkHigh
newHigh:
xchgdwf DSframe.DSF_brBound.PDF_x, siaxdi
cmp si, DSframe.DSF_tlBound.PDF_x.DWF_int.high
jl makeHighLow
jg done
cmp ax, DSframe.DSF_tlBound.PDF_x.DWF_int.low
jge done
makeHighLow:
movdwf DSframe.DSF_tlBound.PDF_x, siaxdi
jmp done
CheckGSBX endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CheckGSBY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check an Y coordinate against current min/max
CALLED BY: INTERNAL
UnTransRotBounds
PASS: siaxdi - DWFixed coord to check
RETURN: nothing
DESTROYED: si,ax,di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 5/ 8/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CheckGSBY proc near
.enter inherit GrGetGStringBoundsDWord
cmp si, DSframe.DSF_tlBound.PDF_y.DWF_int.high
jl newLow
jg checkHigh
cmp ax, DSframe.DSF_tlBound.PDF_y.DWF_int.low
jl newLow
checkHigh:
cmp si, DSframe.DSF_brBound.PDF_y.DWF_int.high
jg newHigh
jl done
cmp ax, DSframe.DSF_brBound.PDF_y.DWF_int.low
jg newHigh
done:
.leave
ret
newLow:
xchgdwf siaxdi, DSframe.DSF_tlBound.PDF_y
jmp checkHigh
newHigh:
xchgdwf DSframe.DSF_brBound.PDF_x, siaxdi
cmp si, DSframe.DSF_tlBound.PDF_x.DWF_int.high
jl makeHighLow
jg done
cmp ax, DSframe.DSF_tlBound.PDF_x.DWF_int.low
jge done
makeHighLow:
movdwf DSframe.DSF_tlBound.PDF_x, siaxdi
jmp done
CheckGSBY endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GrDerefPtrGString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Dereference a pointer-type gstring
CALLED BY: EXTERNAL
Path code.
PASS: si - GString handle
RETURN: ds:si - pointer to current element
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/20/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GrDerefPtrGString proc far
uses ax, bx
.enter
; get things started...
mov bx, si ; lock gstate
call MemLock
mov ds, ax ; es -> GState
mov ax, ds:[GS_gstring] ; get handle
EC < tst ax ; make sure valid >
EC < ERROR_Z GRAPHICS_BAD_GSTRING_HANDLE ; bogus, die >
call MemUnlock ; release gstate
mov bx, ax ; lock GString block
call MemLock
mov ds, ax ; es -> GString block
; if we're not a memory type, bail
EC < mov ax, ds:[GSS_flags] >
EC < and al, mask GSF_HANDLE_TYPE ; isolate type >
EC < cmp al, GST_PTR ; must be ptr >
EC < ERROR_NE GRAPHICS_INVALID_GSTRING_TYPE >
; just grab the current pointer
mov si, ds:[GSS_firstBlock] ; get base position
add si, ds:[GSS_curPos].low ; add offset
mov ds, ds:[GSS_hString] ; get segment
call MemUnlock ; release GString blk
.leave
ret
GrDerefPtrGString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DerefMemElement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Read the next element from a chunk-based GString
CALLED BY: INTERNAL
ReadElement
PASS: inherits DrawStringFrame
es - GString block
RETURN: carry - set if some problem reading element
else: ds:si - points at element
cx - element size
DESTROYED: bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/16/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DerefMemElement proc far
DSframe local DrawStringFrame
.enter inherit
; this is easy, since the element is already there. Just
; dereference the block that it is in and set si to curPos
mov bx, es:[GSS_hString] ; get block handle
call MemDerefDS ; ds -> block
mov si, es:[GSS_firstBlock] ; get chunk handle
mov si, ds:[si] ; ds:si -> chunk start
add si, es:[GSS_curPos].low ; ds:si -> cur element
clc
.leave
ret
DerefMemElement endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DerefStreamElement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Already an element in the buffer, point at it.
CALLED BY: INTERNAL
ReadElement
PASS: es - GString block
RETURN: ds:si - points at element
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/20/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DerefStreamElement proc far
.enter
segmov ds, es, si ; ds -> GString block
mov si, ds:[GSS_fileBuffer]
mov si, ds:[si] ; ds:si -> filebuff chunk
clc
.leave
ret
DerefStreamElement endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ReadStreamElement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Read in the next element from a stream
CALLED BY: INTERNAL
ReadElement
PASS: inherits DrawStringFrame
es - GString
RETURN: carry - set if some error reading stream
or if the opcode read is invalid
if carry is clear:
ds:si - far pointer to the element read it
DESTROYED: bx, cx, dx, ax
PSEUDO CODE/STRATEGY:
If (variable sized element)
read enough to figure out how big it will be
If (chunk for file buffer not big enough)
resize it
Read in element
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 05/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ReadStreamElement proc far
DSframe local DrawStringFrame
.enter inherit
; read in a single byte, to see what the element type is.
segmov ds, es ; ds -> GString block
mov cx, 1 ; read one byte
clr dx ; at 0 offset in chunk
call ReadStreamBytes ; read 'em in
jc done ; bail on error
; the opcode is in the buffer. Calculate how big the element
; is. We may need to read more to determine this
mov bl, ds:[si] ; get opcode
cmp bl, GStringElement ; make sure in range
cmc
jc done ; bad opcode
push ds
push bx
mov bx, handle GSElemInfoTab
call MemLock
mov ds, ax
pop bx
CheckHack <(size GSElemInfo) eq 10>
clr bh ; bx = opcode
shl bx ; *2
mov ax, bx
shl bx ; *4
shl bx ; *8
add bx, ax
mov ax, ds:GSElemInfoTab[bx].GSEI_size ; al = elem size
mov bx, handle GSElemInfoTab
call MemUnlock
pop ds
test ah, 0xc0 ; if high bits set, var
jnz variableSize ; we need more info
cmp al, 1 ; if single byte, done
jb done ; unclaimed opcode
ja readMore
doneOK:
clc
done:
.leave
ret
; it's a fixed sized element, but we have more to read
readMore:
mov dx, 1 ; read in past opcode
mov cx, ax ;
clr ch ; cx = element size
dec cx ; already read first
call ReadStreamBytes ; read in extra bytes
; if the element is a GR_DRAW_TEXT_FIELD element, then there
; is more to read (style runs, etc).
cmp {byte} ds:[si], GR_DRAW_TEXT_FIELD ; if so...
jne doneOK
; OK, we have more to read. Get the total character count,
; and loop til we've read all the style runs
call ReadStreamStyleRuns
jmp done
; have a variable sized element. Read in a little more, so
; we can figure out how much more to read.
variableSize:
mov cl, al ; read the rest of the
clr ch
dec cx ; already read one,
mov dx, 1 ;
call ReadStreamBytes ; have enough to tell
jc done ; bail on error
mov cl, ah
and cx, 3fh ; ds:[si][cx] = offset
add si, cx ; ds:si -> count word
mov dx, ds:[si] ; grab count word
sub si, cx
mov cx, dx
mov dl, al
clr dh
test ah, 0x80 ; *2 or *4 ?
jz haveCount
shl cx, 1 ; at least words
test ah, 0x40 ; might be dwords
jz haveCount
shl cx, 1
haveCount:
cmp {byte} ds:[si], GR_SET_PALETTE ; if this, 3* count
je hackForSetPalette
readVarBytes:
call ReadStreamBytes ; read in rest of data
jmp done
; we lied about there being byte values in the SetPalette
; element, cause we have no flag for "three-byte values". So
; calculate the real number here.
hackForSetPalette:
push ax
mov ax, cx
shl cx, 1
add cx, ax
pop ax
jmp readVarBytes
ReadStreamElement endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ReadStreamStyleRuns
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Read the style runs associated with GR_DRAW_TEXT_FIELD
CALLED BY: INTERNAL
ReadStreamElement
PASS: ds:si - pointer to start of element in GS_fileBuffer
RETURN: carry - set if some error in disk reading, else
ds:si - still points to structure, though the pointer may
have changed.
DESTROYED: cx, dx, ax
PSEUDO CODE/STRATEGY:
Keep reading style runs until we have all the characters in.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 8/ 5/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ReadStreamStyleRuns proc near
DSframe local DrawStringFrame
.enter inherit
; First get the total number of characters we have to read.
mov cx, ds:[si].ODTF_saved.GDFS_nChars
mov dx, size OpDrawTextField ; offset to first
; style run spot
; Now loop through all the nice style runs. They are stored
; with the TFStyleRun structure first, then the text string.
styleRunLoop:
push cx ; save number of chars left
mov ax, dx ; save offset to start of run
mov cx, size TFStyleRun ; first read in the structure
call ReadStreamBytes
jc doneError
add si, ax ; ds:si -> TFStyleRun
mov cx, ds:[si].TFSR_count ; get char count for this run
DBCS < shl cx, 1 ; Char to byte count >
add ax, size TFStyleRun
mov dx, ax
call ReadStreamBytes ; read in character string
jc doneError
add ax, cx ; ax = offset to next run
mov dx, ax ; needs to be in dx
DBCS < shr cx, 1 ; Byte to char count >
mov ax, cx ; ax = #chars just read
pop cx ; restore #chars left
sub cx, ax ; fewer to go
EC < ERROR_S GRAPHICS_BAD_GSTRING_ELEMENT_DATA >
jnz styleRunLoop ;
clc
done:
.leave
ret
; some error reading from disk
doneError:
pop cx ; restore stack
jmp done
ReadStreamStyleRuns endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ReadStreamBytes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Utility routine to read a few bytes from a stream.
CALLED BY: INTERNAL
ReadStreamElement
PASS: ds,es - GString block
dx - offset into GSS_fileBuffer to read into
cx - #bytes to read
RETURN: carry - set if some error reading file
ds:si - start of GSS_fileBuffer chunk
DESTROYED: dx
PSEUDO CODE/STRATEGY:
The higher-level code assumes that the chunk
GSS_fileBuffer holds the GStringElement data
in a specific location, so we do buffered file
reads in a separate chunk.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/16/92 Initial version
Don 3/21/00 Added buffered FileReads
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MIN_CHUNK_RESIZE equ 32
ReadStreamBytes proc near
uses ax, cx, di
.enter
mov si, ds:[GSS_fileBuffer] ; use file buffer
ChunkSizeHandle ds, si, ax ; ax = size of chunk
mov di, ds:[si] ; get pointer to buffer
add cx, dx ; cx = total chunk size
; after read
cmp ax, cx ; if zero, resize chunk
jb resizeChunk
; alright, we have enough room to read, so copy the data
copyData:
sub cx, dx ; cx = bytes to copy
add di, dx ; es:di = destination
copyDataLow:
mov si, ds:[GSS_readBuffer]
mov si, ds:[si]
add si, ds:[GSS_readOffset]
cmp cx, ds:[GSS_readBytesAvail]
ja copyDataPartial
add ds:[GSS_readOffset], cx
sub ds:[GSS_readBytesAvail], cx
rep movsb
; clean up
mov si, ds:[GSS_fileBuffer]
mov si, ds:[si]
clc
done:
.leave
ret
; not enough room. Resize it.
resizeChunk:
mov ax, ds:[GSS_fileBuffer] ; get chunk handle
add cx, MIN_CHUNK_RESIZE ; resize a little extra
call LMemReAlloc ; resize chunk
sub cx, MIN_CHUNK_RESIZE ; get back chunk size
mov di, ax ; deref chunk again
mov di, ds:[di] ; ds:di -> chunk
jmp copyData ; now we have enough
; partially fill the request
copyDataPartial:
mov ax, cx ; ax = bytes desired
clr cx
xchg cx, ds:[GSS_readBytesAvail] ; cx = byte available
jcxz fileRead
sub ax, cx
rep movsb
; read data from the file
fileRead:
push ax ; bytes we still need
mov si, ds:[GSS_readBuffer]
ChunkSizeHandle ds, si, ax
mov cx, GS_READ_BUFFER_SIZE
cmp ax, cx
EC < ERROR_A GRAPHICS_INTERNAL_ERROR_IN_GSTRING_READ_BUFFERING >
je fileReadLow
mov ax, ds:[GSS_readBuffer]
call LMemReAlloc
mov si, ax
mov di, es:[GSS_fileBuffer]
mov di, es:[di]
add di, dx
fileReadLow:
mov bx, ds:[GSS_hString] ; get file handle
clr al ; we want errors
mov dx, ds:[si] ; ds:dx = read buffer
call FileReadFar ; cx = bytes read
pop dx ; dx=bytes still needed
jc fileReadError
fileReadDone:
mov ds:[GSS_readBytesAvail], cx
clr ds:[GSS_readOffset]
mov cx, dx ; cx=bytes still needed
jmp copyDataLow
; some error on reading. Set a flag
fileReadError:
cmp ax, ERROR_SHORT_READ_WRITE
jne fileReadErrorReal
cmp cx, dx ; is file too short?
jae fileReadDone ; ...nope, we're OK
fileReadErrorReal:
or ds:[GSS_flags], mask GSF_ERROR
stc
jmp done
ReadStreamBytes endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DerefVMemElement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Read in the next vmem element
CALLED BY: INTERNAL
ReadElement
PASS: inherits DrawStringFrame
RETURN: ds:si -> next element
DESTROYED: bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/16/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DerefVMemElement proc far
DSframe local DrawStringFrame
.enter inherit
; see if the vmem block is already locked. If so, just grab
; the pointer.
test es:[GSS_flags], mask GSF_VMEM_LOCKED
jz lockIt
movdw dssi, es:[GSS_lastPtr]
done:
clc
.leave
ret
; for now, just use HugeArrayLock
lockIt:
push di, dx, cx, ax
movdw dxax, es:[GSS_curPos] ; get this element
mov bx, es:[GSS_hString] ; file handle
mov di, es:[GSS_firstBlock] ; vmem block handle
call HugeArrayLock ; ds:si -> block
or es:[GSS_flags], mask GSF_VMEM_LOCKED
mov es:[GSS_vmemNext], ax
mov es:[GSS_vmemPrev], cx
pop di, dx, cx, ax
jmp done
DerefVMemElement endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ReadVMemElement
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Read in the next vmem element
CALLED BY: INTERNAL
ReadElement
PASS: inherits DrawStringFrame
RETURN: carry - set if some problem, else
ds:si -> next element
DESTROYED: bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/16/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ReadVMemElement proc far
DSframe local DrawStringFrame
.enter inherit
EC < call ECCheckStack >
; see if the vmem block is already locked. If so, just grab
; the pointer.
test es:[GSS_flags], mask GSF_VMEM_LOCKED
jz lockIt
movdw dssi, es:[GSS_lastPtr]
inc es:[GSS_vmemPrev] ; update opt vars
dec es:[GSS_vmemNext] ; if negative, go to
jz nextVMemBlock ; the next block
add si, es:[GSS_lastSize] ; ds:si -> next elem
done:
.leave
ret
; for now, just use HugeArrayLock
lockIt:
push di, dx, ax, cx
movdw dxax, es:[GSS_curPos] ; get this element
mov bx, es:[GSS_hString] ; file handle
mov di, es:[GSS_firstBlock] ; vmem block handle
call HugeArrayLock ; ds:si -> block
mov es:[GSS_vmemNext], ax
mov es:[GSS_vmemPrev], cx
tst ax ; check for NULL element
pop di, dx, ax, cx
je nullElement ; ..and jump if found
or es:[GSS_flags], mask GSF_VMEM_LOCKED
;;; clc ; carry flag cleared by OR
jmp done
; done with all the elements in this block, go to next one
nextVMemBlock:
call HugeArrayNext ; read in next block
clr es:[GSS_vmemPrev] ; no previous ones
mov es:[GSS_vmemNext], ax ; save number in new block
tst ax ; make sure no error
clc
jnz done
nullElement:
or es:[GSS_flags], mask GSF_ERROR ; signal error
stc
jmp done
ReadVMemElement endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PENoArgs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret elements with no arguments
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
es - GString block
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
; MISC
GrNullOp
; TRANSFORM
GrSetNullTransform
GrSetDefaultTransform
GrInitDefaultTransform
GrSaveTransform
GrRestoreTransform
; OUTPUT
GrDrawPointAtCP
GrDrawPath
; ATTRIBUTES
GrSaveState
GrRestoreState
GrCreatePalette
GrDestroyPalette
; PATH
GrEndPath
GrCloseSubPath
GrSetStrokePath
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PENoArgs proc far
jc figBounds
callKernel:
call GS_CallKernelRoutine
PENull label far
ret
; might be DrawPointAtCP
figBounds:
cmp {byte} ds:[si], GR_DRAW_PATH
je pathBounds
cmp {byte} ds:[si], GR_DRAW_POINT_CP
jne callKernel
call GrGetCurPos
call BoundFillCoord
jmp callKernel
; it's a GrDrawPath. Need the path bounds
pathBounds:
mov ax, GPT_CURRENT
call GrGetPathBounds
call BoundLineRect
jmp callKernel
PENoArgs endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEOneCoord
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret elements with one coordinate value
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load args from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
; OUTPUT
GrDrawLineTo
GrDrawRectTo
GrDrawPoint
GrFillRectTo
; ATTRIBUTE
GrMoveTo
GrSetPaletteEntry
GrSetLineWidth
GrSetMiterLimit
; PATH
GrBeginPath
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEOneCoord proc far
.enter
; load the arguments and call the routine
mov bx, ds:[si].ODP_y1
mov dx, bx ; put here to cover more rout
mov ax, ds:[si].ODP_x1
mov cx, ax
jc figBounds ; do bounds calc
callKernel:
cmp ds:[si].ODP_opcode, GR_SET_PALETTE_ENTRY
jne doIt
xchg al, ah ; these stored sitched
doIt:
call GS_CallKernelRoutine
.leave
ret
figBounds:
cmp ds:[si].ODP_opcode, GSE_FIRST_OUTPUT_OPCODE
jb callKernel
cmp ds:[si].ODP_opcode, GSE_LAST_OUTPUT_OPCODE
ja callKernel
call GrGetCurPos ; ax,bx = current position
cmp ds:[si].ODP_opcode, GR_DRAW_LINE_TO
je figLine
cmp ds:[si].ODP_opcode, GR_FILL_RECT_TO
je figFillBound
call BoundLineRect
jmp callKernel
figFillBound:
call BoundFillRect
jmp callKernel
; just a line.
figLine:
call BoundLine
jmp callKernel
PEOneCoord endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PERelCoord
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret elements with one coordinate value
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
; OUTPUT
GrDrawRelLineTo
; ATTRIBUTE
GrRelMoveTo
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 4/22/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PERelCoord proc far
.enter
; load args and call routine
movdw dxcx, ds:[si].ODRLT_x2
movdw bxax, ds:[si].ODRLT_y2
jc figBounds
callKernel:
call GS_CallKernelRoutine
.leave
ret
; do relative bounds calculation
figBounds:
cmp {byte} ds:[si], GR_REL_MOVE_TO
je callKernel
cmp {byte} ds:[si], GR_MOVE_TO_WWFIXED
je callKernel
push ax, bx
call GrGetCurPos
call BoundLineCoord
pop ax, bx
call BoundRelCoord
jmp callKernel
PERelCoord endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PETwoCoords
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret elements with two coordinate values
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load args from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
; MISC
GrSetGStringBounds
; OUTPUT
GrDrawLine
GrDrawRect
GrDrawEllipse
GrFillRect
GrFillEllipse
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PETwoCoords proc far
.enter
; load the arguments and call the routine
mov ax, ds:[si].ODL_x1
mov bx, ds:[si].ODL_y1
mov cx, ds:[si].ODL_x2
mov dx, ds:[si].ODL_y2
jc figBounds
callKernel:
call GS_CallKernelRoutine
; restore regs and leave
.leave
ret
; need to figure the bounds of the object
figBounds:
cmp {byte} ds:[si], GR_FILL_RECT
je figFillBound
cmp {byte} ds:[si], GR_FILL_ELLIPSE
je figFillEllipse
cmp {byte} ds:[si], GR_SET_GSTRING_BOUNDS
je figFillBound
cmp {byte} ds:[si], GR_DRAW_ELLIPSE
je figDrawEllipse
call BoundLineRect
jmp callKernel
figFillBound:
call BoundFillRect
jmp callKernel
; Ellipses.
; We want to ultimately call the CalcEllipse routine elsewhere
; in the kernel to generate the points along the ellipse,
; then call the appropriate BoundPolyLine or BoundPolyFill
figFillEllipse:
push bx, ds, si, cx
push bp
mov bp, offset BoundSetupEllipse
call GetArcCoords ; bx = block handle
pop bp
jc doneCoords
call BoundDevFillPoly
ellipseBoundCommon:
call MemFree ; free coord block
doneCoords:
pop bx, ds, si, cx
jmp callKernel
; drawing an ellipse. This gets complicated
figDrawEllipse:
push bx, ds, si, cx
push bp
mov bp, offset BoundSetupEllipse
call GetArcCoords ; bx = block handle
pop bp
jc doneCoords
call BoundDevLinePoly
jmp ellipseBoundCommon
PETwoCoords endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PE3ByteAttr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret elements with RGB color arguments
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
; ATTRIBUTE
GrSetLineColor
GrSetAreaColor
GrSetTextColor
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PE3ByteAttr proc far
; get the components, call the routine
mov al, ds:[si].OSAC_color.RGB_red ; get R
mov bx, {word} ds:[si].OSAC_color.RGB_green ; get G, B
mov ah, CF_RGB
call GS_CallKernelRoutine
ret
PE3ByteAttr endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEWordAttr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret attribute elements with one word arguments
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
; MISC
GrLabel
; ATTRIBUTE
GrSetTextStyle
GrSetTextMode
GrSetTrackKern
GrSetSuperscriptAttr
GrSetSubscriptAttr
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEWordAttr proc far
; load the arguments and call the routine
mov ax, {word} ds:[si].OSTM_mask ; get word
mov cx, ax ; path stuff wants this
call GS_CallKernelRoutine
ret
PEWordAttr endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEPalette
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Handle SetPalette
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrSetPalette
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 11/12/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEPalette proc far
uses si
.enter
mov cx, ds:[si].OSP_num ; get count
lodsb ; get starting number
add si, 2 ; ds:si -> data
mov dx, ds ; dx:si -> data
call GrSetPalette ; call routine
.leave
ret
PEPalette endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEPathArgs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret SetPath elements
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrSetClipPath
GrSetWinClipPath
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEPathArgs proc far
; load the arguments and call the routine
mov dl, ds:[si].OSCP_rule ; get fill rule
mov cx, ds:[si].OSCP_flags ; get combine type
call GS_CallKernelRoutine
ret
PEPathArgs endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PELineStyle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret attribute elements with one word arguments
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrSetLineStyle
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PELineStyle proc far
; load the arguments and call the routine
mov al, ds:[si].OSLS_style
mov bl, ds:[si].OSLS_index
call GrSetLineStyle
ret
PELineStyle endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PESpacePad
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret SetTextSpacePad element
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrSetTextSpacePad
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PESpacePad proc far
; get the components, call the routine
movwbf dxbl, ds:[si].OSTSP_pad ; get space padding
call GrSetTextSpacePad ; call routine to set color
ret
PESpacePad endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEDrawChar
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret drawchar elements
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
carry set if we are just getting the bounds
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrDrawChar
GrDrawCharAtCP
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEDrawChar proc far
; load up the character to draw
if DBCS_PCGEOS
mov dx, ds:[si].ODC_char ; get the character
else
mov dl, ds:[si].ODC_char ; get the character
;DON'T CHANGE THIS TO "CLR", AS WE USE THE CARRY BELOW
EC < mov dh,0 ; single-byte char >
endif
; if we're doing bounds stuff, branch here
mov bx, ds:[si].ODC_y1 ; load coords. It's OK for CP
mov ax, ds:[si].ODC_x1
jc figBounds
; call the routine
callKernel:
call GS_CallKernelRoutine
ret
; we need to calculate the bounds. Load up the correct args
; and do the right thing.
figBounds:
cmp ds:[si].ODC_opcode, GR_DRAW_CHAR
jne getCurPos
getTextBounds:
inc si ; point at character
mov cx, 1
call BoundText
dec si
jmp callKernel
; doing the AtCP thing, get the current text position
getCurPos:
call GrGetCurPos
jmp getTextBounds
PEDrawChar endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PETMatrix
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret elements with transformation matrices passed
CALLED BY: INTERNAL
PlayElement
PASS: bx - graphics opcode *2
ds:si - pointer to element data
RETURN: ds:si - points past data
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrSetTransform
GrApplyTransform
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PETMatrix proc far
; args already set up, just call
inc si ; bump to TransMatrix data
call GS_CallKernelRoutine
dec si ; restore pointer
ret
PETMatrix endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEClipRect
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret elements from a clip rect opcode
CALLED BY: PlayElement()
PASS: ds:si - ptr to element data
di - handle of GState
bx - GStringElement x 2
RETURN: ds:si - ptr past element data
DESTROYED: none
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
ASSUMES: OpSetClipRect & OpSetWinClipRect are equivalent
REVISION HISTORY:
Name Date Description
---- ---- -----------
eca 8/27/90 Initial version
don 7/25/91 Changed parameters to GrSetClip[Doc]Rect
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
; Flags that were previously passed to GrSetAppClipRect() & GrSetWinClipRect().
; They are no longer passed, but a conversion from the old flags to the new is
; left for compatability with 1.0 GStrings.
;
SetApplClipRegionFlags record
SACRF_REPLACE:1
:1
SACRF_NULL:1
SACRF_RECT:1
:12
SetApplClipRegionFlags end
PEClipRect proc far
uses si
.enter
cmp {byte} ds:[si], GR_SET_CLIP_RECT ; see which one it is...
pushf ; save results of comparison
mov ax, ds:[si].OSCR_rect.R_left ; load coords
mov bx, ds:[si].OSCR_rect.R_top
mov cx, ds:[si].OSCR_rect.R_right
mov dx, ds:[si].OSCR_rect.R_bottom
mov si, ds:[si].OSCR_flags ; si <- PathCombineType
test si, mask SACRF_REPLACE or mask SACRF_NULL
jz continue ; if neither set, PCP_ passed
test si, mask SACRF_REPLACE ; was replace set ??
mov si, PCT_NULL ; assume not, and use NULL
jz continue
mov si, PCT_REPLACE ; else replace was set
continue:
popf ; restore results of comparison
jne callDocRect
call GrSetClipRect
done:
.leave
ret
callDocRect:
call GrSetWinClipRect
jmp done
PEClipRect endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEDrawRoundRects
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret rounded rectangle & some arc-related elements
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
; OUTPUT
GrDrawRoundRect
GrFillRoundRect
GrDrawRoundRectTo
GrFillRoundRectTo
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 12/ 9/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEDrawRoundRects proc far
uses si
.enter
; load up the radius and some coords
push ds:[si].ODRR_radius ; get the radius (goes in si)
pushf ; save carry (for bounds)
mov ax, ds:[si].ODRR_x1 ; get coord
mov cx, ax ; could be a "RectTo" routine
mov bx, ds:[si].ODRR_y1 ; get coord
mov dx, bx ; could be a "RectTo" routine
cmp {byte} ds:[si], GR_DRAW_ROUND_RECT_TO
je rrectTo
cmp {byte} ds:[si], GR_FILL_ROUND_RECT_TO
je rrectTo
; It's not a "RectTo" routine, load up the other coordinate
mov cx, ds:[si].ODRR_x2 ; load up opposite corner
mov dx, ds:[si].ODRR_y2
; Call the routine.
haveParams:
popf ; restore carry
jc figBounds
getRadius:
pop si ; restore radius
call GS_CallKernelRoutine
.leave
ret
; a To routine. Load up the current position
rrectTo:
call GrGetCurPos
jmp haveParams
; calculate the bounds of the object
figBounds:
cmp {byte} ds:[si], GR_FILL_ROUND_RECT
je figFillBound
cmp {byte} ds:[si], GR_FILL_ROUND_RECT_TO
je figFillBound
call BoundLineRect
jmp getRadius
figFillBound:
call BoundFillRect
jmp getRadius
PEDrawRoundRects endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEDrawArcs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret arc-related elements
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
; OUTPUT
GrDrawArc
GrFillArc
GrDrawArc3Point
GrFillArc3Point
GrDrawArc3PointTo
GrFillArc3PointTo
GrDrawRelArc3PointTo
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEDrawArcs proc far
uses si
.enter
; pass a struct in DS:SI to the appropriate routine
;
jc figBounds ; do bounds for ARC routines
inc si ; just point to the params
callKernel:
call GS_CallKernelRoutine ; call the routine
.leave
ret
; do bounds calc for arc routines
figBounds:
lodsb ; grab opcode
push ds, si, bx, cx
push bp
mov bp, offset BoundSetupArc
cmp al, GR_FILL_ARC ; check assumption
je boundFillArc
cmp al, GR_DRAW_ARC
je boundArc
mov bp, offset BoundSetupRelArc
cmp al, GR_DRAW_REL_ARC_3POINT_TO
je boundArc
mov bp, offset BoundSetup3PointTo
cmp al, GR_FILL_ARC_3POINT_TO
je boundFillArc
cmp al, GR_DRAW_ARC_3POINT_TO
je boundArc
mov bp, offset BoundSetup3Point
cmp al, GR_FILL_ARC_3POINT
je boundFillArc
boundArc:
call GetArcCoords
pop bp
jc doneCoords
call BoundDevLinePoly ; bound like polycoord rout
boundArcCommon:
call MemFree ; release the puny block
doneCoords:
pop ds, si, bx, cx
jmp callKernel
boundFillArc:
call GetArcCoords
pop bp
jc doneCoords
call BoundDevFillPoly
jmp boundArcCommon
PEDrawArcs endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoundSetupArc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Various callback routines for arc bounds setup
CALLED BY: INTERNAL
GetArcCoords
PASS:
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 2/ 2/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoundSetupArc proc near
call SetupArcLowFar
ret
BoundSetupArc endp
BoundSetupRelArc proc near
call SetupRelArc3PointToLowFar
ret
BoundSetupRelArc endp
BoundSetup3PointTo proc near
call SetupArc3PointToLowFar
ret
BoundSetup3PointTo endp
BoundSetup3Point proc near
call SetupArc3PointLowFar
ret
BoundSetup3Point endp
BoundSetupEllipse proc near
mov di, CET_ELLIPSE
ret
BoundSetupEllipse endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GetArcCoords
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get coord list for points along an arc
CALLED BY: INTERNAL
PASS: ds:si - pointer to arc coords
di - GState handle
bp - setup routine to call
RETURN: carry - SET if there is nothing else to do, else
if carry is CLEAR:
bx - handle of blocks holding point
ds:si - pointer to points
cx - number of points
DESTROYED: bp
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 2/ 2/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GetArcCoords proc near
uses ax, dx
.enter
; lock down the GState since we'll need that eventually.
; Make like we don't have a window, so that we'll get back
; all the points.
push di ; save GState handle
push ds:[si].AP_close ; save for CloseArcFar
push ds ; save pointer to params
push ax ; save for param for ellipse
xchg bx, di ; bx = GState handle
call MemLock ;
xchg bx, di ; bx = GState handle
mov ds, ax ; ds -> GState
pop ax ; restore ellipse parameter
; call the local setup routine
cmp bp, offset BoundSetupEllipse
je doEllipse
pop ax ; ax:si -> parameters
sub sp, SETUP_AE_BUFFER_SIZE ; allocate stack frame
mov bx, bp ; setup routine in bx
mov bp, sp ; ss:bp -> scratch space
call bx
; Generate the points in an ellipse or arc
;
genPoints:
test di, mask CEF_COLINEAR ; check for colinear points
jnz handleLine
mov si, sp ; parameters => SS:SI
call CalcEllipse ; calculate point buffer
tst bx
jz haveBlock ; if no block, bail
; if we were drawing an arc, handle the close type
cmp di, CET_ELLIPSE
je haveBlock
call CloseArcFar ; handle close type
haveBlock:
add sp, SETUP_AE_BUFFER_SIZE+2 ; free structure and arc
; close type
; fix things up, release the GState
pop di ; restore GState handle
xchg di, bx ; need to release GState
call MemUnlock ; release it
xchg di, bx
; lock down Ellipse points block if there
tst bx
stc ; anticipate nothing to do
jz done
tst cx ; if this is an empty arc, bail
stc
jz done
call MemLock
mov ds, ax
clr si ; ds:si -> ellipse points
clc
done:
.leave
ret
doEllipse:
add sp, 2 ; don't need segment on stack
sub sp, SETUP_AE_BUFFER_SIZE ; allocate stack frame
call bp
jmp genPoints
handleLine:
push ax,bx,cx
mov ax, 8 ; only need 8 bytes
mov cx, ALLOC_DYNAMIC_NO_ERR_LOCK
call MemAllocFar
mov ds, ax ; ds -> block
clr si
mov ds:[(size Point)].P_y, dx ; store second point
pop ax,dx,cx
mov ds:[0].P_x, ax ; store other points
mov ds:[0].P_y, dx
mov ds:[(size Point)].P_x, cx
call MemUnlock ; release for a second
mov cx, 2 ; two coords
jmp haveBlock
GetArcCoords endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEDrawHalfLine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret horis and vertical lines
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
; OUTPUT
GrDrawHLine
GrDrawHLineTo
GrDrawVLine
GrDrawVLineTo
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEDrawHalfLine proc far
; test type of opcode and load up the parameters
mov cx, ds:[si].ODHLT_x2 ; assume simplest
mov al, ds:[si]
jc figBounds
cmp al, GR_DRAW_HLINE_TO ; test for to vers
je haveParams
mov dx, cx ; might be VLineTo
cmp al, GR_DRAW_VLINE_TO
je haveParams
xchg ax, dx
mov bx, ds:[si].ODHL_y1 ; get y coordinate
mov cx, ds:[si].ODHL_x2 ; assume horiz
cmp dl, GR_DRAW_HLINE ; check assumption
je haveParams
mov dx, cx ; must be VLINE
haveParams:
call GS_CallKernelRoutine
ret
; we need to calc the bounds of the line
figBounds:
mov dx, cx ; in case of VLINE_TO
cmp al, GR_DRAW_HLINE_TO
je doCP
cmp al, GR_DRAW_VLINE_TO
je doCP
mov ax, dx
mov bx, ds:[si].ODHL_y1
call BoundLineCoord
mov cx, ds:[si].ODHL_x2 ; assume hline
mov dx, bx
cmp {byte} ds:[si], GR_DRAW_HLINE
je have2nd
mov dx, cx
mov cx, ax
have2nd:
xchgdw axbx, cxdx
call BoundLineCoord
xchgdw axbx, cxdx
jmp haveParams
doCP:
call GrGetCurPos ; set ax/bx
call BoundLineCoord
cmp {byte} ds:[si], GR_DRAW_HLINE_TO
je hlineTo
mov bx, dx
boundTo:
call BoundLineCoord
jmp haveParams
hlineTo:
mov ax, cx
jmp boundTo
PEDrawHalfLine endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEPolyCoord
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret poly-coord elements
CALLED BY: INTERNAL
PlayElement
PASS: bx - graphics opcode *2
ds:si - pointer to element data
RETURN: ds:si - points past data
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
; OUTPUT
GrDrawPolyline
GrDrawSpline
GrDrawSplineTo
GrDrawPolygon
GrBrushPolyline
GrFillPolygon
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEPolyCoord proc far
uses si
.enter
; If polyline, polygon, or spline, only read a word
pushf ; save carry
mov cx, ds:[si].ODPL_count ; get poly-coord count
; If filled polygon, read another byte. If brushed
; polyline, read another word.
mov al, ds:[si] ; grab opcode
cmp al, GR_FILL_POLYGON ; a few opcodes need more work
je getFillRule
cmp al, GR_BRUSH_POLYLINE
je getBrushSize
; OK, we have all we need, just setup si -> coord block
add si, size OpDrawPolyline ; same for spline, drawPolygon
popf ; restore carry
jc doBoundsThing
callKernel:
call GS_CallKernelRoutine
.leave
ret
; for filled polygons, get the fill rule
getFillRule:
mov al, ds:[si].OFP_rule
add si, size OpFillPolygon
popf ; restore bounds flag
jnc callKernel
call BoundFillPoly
jmp callKernel
; for brushed polylines, get brush size
getBrushSize:
mov ax, {word} ds:[si].OBPL_width ; get width, height
add si, size OpBrushPolyline
popf ; restore bounds flag
jnc callKernel
normalBounds:
call BoundLinePoly
jmp callKernel
doBoundsThing:
cmp al, GR_DRAW_POLYGON
je normalBounds
cmp al, GR_DRAW_POLYLINE
je normalBounds
cmp al, GR_DRAW_SPLINE_TO
je splineToBound
; do first point alone then fall into common code
push bx, ds, si, cx
mov ax, ds:[si].P_x
mov bx, ds:[si].P_x
call GrMoveTo
dec cx ; one less point
add si, (size Point)
jmp getpoints
splineToBound:
push bx, ds, si, cx
getpoints:
call GetCurveCoords
pop bx, ds, si, cx
jmp callKernel
PEPolyCoord endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GetCurveCoords
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get coords for bezier curve
CALLED BY: INTERNAL
PEPolyCoord
PASS: ds:si - pointer to array of control points
di - GState handle
cx - count of points
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 2/ 2/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GetCurveCoords proc near
uses ax, bx, cx,dx, si, di, es, ds
.enter
cmp cx, 2 ; if fewer than three points...
jbe handleLine
mov bx, cx ; di = point count
call AllocCurveDataStructsFar
push cx, dx
push di ; save GState
push bx ; save point count
call GrGetCurPos ; current pos is first
pop di ; restore point count
; Convert all the passed curves to one big huge polyline
curveLoop:
call CurveToPolylineFar
sub di, 3
cmp di, 3
jge curveLoop
mov bx, cx ; CurvePoints block
call MemDerefDS
mov cx, ds:[CP_numPoints] ; cx = #points
mov si, size CurvePolyline ; ds:si -> points
pop di ; restore GState
call BoundFillPoly
pop cx, dx
call FreeCurveDataStructsFar
done:
.leave
ret
handleLine:
call GrGetCurPos
call BoundFillCoord
movdw axbx, ds:[si]
call BoundFillCoord
add si, (size Point)
movdw axbx, ds:[si]
call BoundFillCoord
jmp done
GetCurveCoords endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PECurve
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret curve elements
CALLED BY: INTERNAL
PlayElement
PASS: bx - graphics opcode *2
ds:si - pointer to element data
RETURN: ds:si - points past data
DESTROYED: ax, bx, cx, dx
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
; OUTPUT
GrDrawCurve
GrDrawCurveTo
GrDrawRelCurveTo
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PECurve proc far
uses si
.enter
; Pass structure in DS:SI to appropriate routine
;
lodsb ; opcode => AL, params => DS:SI
jc doBoundsCalc
callKernel:
call GS_CallKernelRoutine
.leave
ret
; Determine the bounds of the element
doBoundsCalc:
push cx, si
mov cx, 3 ; we have 3 points
cmp al, GR_DRAW_REL_CURVE_TO
je relativeCurve
cmp al, GR_DRAW_CURVE_TO
je doBounds
mov ax, ds:[si].P_x
mov bx, ds:[si].P_y
call GrMoveTo
add si, size Point
doBounds:
call GetCurveCoords
pop cx, si
jmp callKernel ; now go draw the sucker
; Deal with GrDrawRelCurveTo. Since we have integer
; coordinates now, but will later have WWFixed points,
; do a little unnecessary work for now.
relativeCurve:
push cx ; save # of remaining points
lodsw
mov_tr dx, ax ; P_x => AX
lodsw
mov_tr bx, ax ; P_y => BX
clr ax, cx ; clear fractions
call BoundRelCoord
pop cx ; restore # of remaining points
loop relativeCurve ; loop through the points
pop cx, si
jmp callKernel ; now go draw the sucker
PECurve endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PERotate
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret scale and rotate opcodes
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrApplyRotation
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PERotate proc far
movdw dxcx, ds:[si].OAR_angle ; get rotation angle
call GS_CallKernelRoutine
ret
PERotate endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PETransScale
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Interpret translation/scale opcode
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrApplyTranslation
GrApplyTranslationDWord
GrApplyScale
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PETransScale proc far
movdw dxcx, ds:[si].OAS_xScale ; move factors over
movdw bxax, ds:[si].OAS_yScale
call GS_CallKernelRoutine
ret
PETransScale endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PEComment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Encountered a GR_COMMENT opcode while interpreting
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
resume normal string interpretation;
if the target gstate is a gstring, call the kernel functions;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrComment
GrEscape
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEComment proc far
uses si
.enter
mov cx, ds:[si].OC_size ; get size of beast
cmp {byte} ds:[si], GR_COMMENT ; see if comment or escape
jne setupEscape
add si, size OpComment ; bump source pointer
haveParams:
call GS_CallKernelRoutine
.leave
ret
; it's an escape code
setupEscape:
mov ax, cx
mov cx, ds:[si].OE_escSize ; get size of escape
add si, size OpEscape
jmp haveParams
PEComment endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PECustomMask
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Encountered a END_STRING opcode while interpreting
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrSetLineMask
GrSetAreaMask
GrSetTextMask
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PECustomMask proc far
mov al, SET_CUSTOM_PATTERN ; give it right option code
inc si ; point at mask
call GS_CallKernelRoutine
dec si ; restore si
ret
PECustomMask endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PECustomStyle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Encountered a GR_SET_CUSTOM_LINE_STYLE opcode
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrSetLineStyle
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 11/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PECustomStyle proc far
mov bl, ds:[si].OSCLS_index.low ; get index
mov ah, ds:[si].OSCLS_count.low ; get pair count
mov al, LS_CUSTOM ; give it right option code
add si, size OpSetCustomLineStyle
call GrSetLineStyle ; call the darn thing
sub si, size OpSetCustomLineStyle
ret
PECustomStyle endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PELineAttr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Encountered a SET_{LINE,AREA,TEXT}_ATTR opcode
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
load arg from string;
call graphics routine;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine supports the following graphics functions:
GrSetLineAttr
GrSetAreaAttr
GrSetTextAttr
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PEAttr proc far
inc si ; point ds:si -> LineAttr
call GS_CallKernelRoutine ; call appropriate routine
dec si
ret
PEAttr endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PESetPattern
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Encountered a GR_SET_???_PATTERN in the GString
CALLED BY: INTERNAL
PlayElement
PASS: ds:si - pointer to element data
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 3/27/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PESetPattern proc far
mov ax, {word} ds:[si].OSAP_pattern
call GS_CallKernelRoutine
ret
PESetPattern endp
PESetCustPattern proc far
mov ax, {word} ds:[si].OSCAP_pattern
mov cx, ds:[si].OSCAP_size ; size of custom pattern
add si, (size OpSetCustomAreaPattern)
call GS_CallKernelRoutine
sub si, (size OpSetCustomAreaPattern)
ret
PESetCustPattern endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PETextPtr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a text pointer static element
CALLED BY: GLOBAL
PASS: ds:si - pointer to last slice
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Supports the following codes:
GR_DRAW_TEXT_PTR
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 10/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PETextPtr proc far
uses si
.enter
mov ax, ds:[si].ODTP_x1 ; get position info
mov bx, ds:[si].ODTP_y1 ; get position info
mov si, ds:[si].ODTP_ptr ; load offset to bitmap data
jc figBounds
callKernel:
call GS_CallKernelRoutine
.leave
ret
; we need to calculate the text extent
figBounds:
clr cx ; null-terminated
call BoundText
jmp callKernel
PETextPtr endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PETextOptr
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw a text localmem pointer static element
CALLED BY: GLOBAL
PASS: ds:si - pointer to element
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Supports the following codes:
GR_DRAW_BITMAP_OPTR
GR_FILL_BITMAP_OPTR
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 5/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PETextOptr proc far
uses ds, si
.enter
mov cx, ds:[si].ODTO_x1 ; get position info
mov dx, ds:[si].ODTO_y1 ; get position info
movdw bxsi, ds:[si].ODTO_optr ; get resource handle
push bx ; save handle
pushf ; save carry
call MemLock ; lock it down
popf ; restore carry
mov ds, ax ; ds -> resource
mov si, ds:[si] ; dereference chunk
movdw axbx, cxdx ; move coords over
jc figBounds ; do bounds calc
callKernel:
clr cx ; string is null-terminated
call GS_CallKernelRoutine
pop bx ; restore resource handle
call MemUnlock ; release block
.leave
ret
; need to do text extent calculation
figBounds:
clr cx
call BoundText
jmp callKernel
PETextOptr endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PETextField
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Draw GR_DRAW_TEXT_FIELD element
CALLED BY: INTERNAL
PASS: ds:si - pointer to element data:
RETURN: nothing
DESTROYED: ax-dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
PETextField proc far
uses si, bp, es, di
.enter
; need to do bounds the hard way :(
jc figBounds
; allocate some breathing room, and copy over the saved params
sub sp, size GDF_vars
mov bp, sp ; ss:bp -> GDF_vars
mov ax, di ; ax = GState han
segmov es, ss, di
mov di, bp ; es:di -> GDF_vars
add di, offset GDFV_saved ;
add si, offset ODTF_saved ; ds:si -> GDF_saved
mov cx, size GDF_saved
rep movsb ; move parameters
mov di, ax ; restore GState han
; setup the callback address, and save an address of our own
NOFXIP< mov ss:[bp].GDFV_styleCallback.segment, cs >
FXIP< mov ss:[bp].GDFV_styleCallback.segment, vseg TextFieldCB >
mov ss:[bp].GDFV_styleCallback.offset, offset TextFieldCB
movdw ss:[bp].GDFV_other, dssi ; set ptr to 1st run
; everything is set. do it.
call GrDrawTextField
add sp, size GDF_vars ; backup stack
done:
.leave
ret
; we need to calculate the bounds of this beast.
; the way we do this is to set the attributes for each run.
; Since for the bounds calc we are only interested in position
; info, this will be a satisfactory replacement for calling
; the TextField function.
figBounds:
add si, ODTF_saved
movwbf dxch, ds:[si].GDFS_drawPos.PWBF_x
clr cl
movwbf bxah, ds:[si].GDFS_drawPos.PWBF_y
addwbf bxah, ds:[si].GDFS_baseline
clr al
call GrMoveToWWFixed ; set the current position
mov cx, ds:[si].GDFS_nChars ; get total string length
add si, size GDF_saved ; ds:si -> first style run
fieldLoop:
lodsw ; ax = count for this run
call GrSetTextAttr ; set text attributes for run
add si, size TextAttr ; ds:si -> string
xchg cx, ax ; cx = string length, ax=total
push ax
call GrGetCurPos
call BoundText ; deal with this set
pop ax
xchg ax, cx
call GrDrawTextAtCP ; update current position
DBCS < shl ax, 1 >
add si, ax ; ds:si -> next style run
DBCS < shr ax, 1 >
sub cx, ax ; see if we're done
jnz fieldLoop
jmp done
PETextField endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TextFieldCB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Callback routine for PETextField
CALLED BY: EXTERNAL
GrDrawTextField
PASS: ss:bp - pointer to GDF_vars struct (see above)
bx:di - pointer to buffer to fill with TextAttr
si - current offset to the text
RETURN: cx - # characters in this run
ds:si - Pointer to text
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
stuff style run info for this run into buffer;
return run length in cx;
bump nextRunPtr to next run;
reduce #chars left;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TextFieldCB proc far
uses es, di, ax
.enter
; first fill the TextAttr structre. The GDFV_other field is
; already pointing there..
mov es, bx ; es:di -> buffer to fill
movdw dssi, ss:[bp].GDFV_other ; ds:si -> TFStyleRun
mov ax, ds:[si].TFSR_count ; need this later
add si, offset TFSR_attr ; ds:si -> TextAttr
mov cx, size TextAttr
rep movsb
; at this point ds:si -> text string. Record the position
; of the next run.
movdw ss:[bp].GDFV_textPointer, dssi ; save pointer
mov cx, ax ; return string len in cx
DBCS < shl cx, 1 >
add si, cx ; calc next pointer
movdw ss:[bp].GDFV_other, dssi ; save next run pointer
sub si, cx
DBCS < shr cx, 1 >
.leave
ret
TextFieldCB endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoundRelCoord
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Accumulate the bounds of a relatively drawn object
CALLED BY: INTERNAL
PASS: dxcx - x offset (WWFixed)
bxax - y offset (WWFixed)
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 5/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoundRelCoord proc near
uses ax, bx, cx, dx, ds, si
DSframe local DrawStringFrame
.enter inherit
; copy coords into some temp space so we can transform them
mov si, ax ; save ax
xchg bx, di
call MemLock
mov ds, ax
xchg bx, di
mov ax, si
call TransformRelVector
pushdw bxax ; save X offset
mov si, dx ; save dx and ax
call GrGetLineWidth
xchg si, dx ; set dxax = Y offset
xchg cx, ax ; sicx = line width
mov bx, ax
mov ax, dx
cwd ; dxaxbx = y offset (DWFixed)
adddwf dxaxbx, ds:[GS_penPos].PDF_x
call BoundXLine
popdw axbx ; restore in new order
cwd
adddwf dxaxbx, ds:[GS_penPos].PDF_y
call BoundYLine
mov bx, di
call MemUnlock
.leave
ret
BoundRelCoord endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoundText
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Figure the bounds for some piece of text
CALLED BY: INTERNAL
PASS: di - GState handle
ax,bx - position to draw at
cx - number of characters
ds:si - pointer to string
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 5/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoundText proc far
uses ax,bx,cx,dx
.enter
; use the new kernel function to get the text bounds
call GrGetTextBounds
jc done ; if bogus, don't use
call BoundFillRect
done:
.leave
ret
BoundText endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoundPoly
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Do bounds calc, for poly something
CALLED BY: PEPolyCoord
PASS: ds:si - pointer to coords
cx - number of coords
di - GState handle
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 5/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoundLinePoly proc near
uses ax,bx,cx,si
.enter
coordLoop:
lodsw ; get x coord
mov bx, ax
lodsw ; get y coord
xchg ax, bx
call BoundLineCoord
loop coordLoop
.leave
ret
BoundLinePoly endp
BoundFillPoly proc near
uses ax,bx,cx,si
.enter
coordLoop:
lodsw ; get x coord
mov bx, ax
lodsw ; get y coord
xchg ax, bx
call BoundFillCoord
loop coordLoop
.leave
ret
BoundFillPoly endp
; save as above routines, except we already have device coords.
BoundDevLinePoly proc near
uses ax,bx,cx,si
.enter
coordLoop:
lodsw ; get x coord
mov bx, ax
lodsw ; get y coord
xchg ax, bx
call BoundDevLineCoord
loop coordLoop
.leave
ret
BoundDevLinePoly endp
BoundDevFillPoly proc near
uses ax,bx,cx,si
.enter
coordLoop:
lodsw ; get x coord
mov bx, ax
lodsw ; get y coord
xchg ax, bx
call BoundDevFillCoord
loop coordLoop
.leave
ret
BoundDevFillPoly endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoundLineRect
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calculate and accumulate bounds for an object
CALLED BY: INTERNAL
various playelement routines
PASS: ax..dx - rectangle bounds
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
figure the bounds and accumulate in DSframe
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 5/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoundLineRect proc near
uses ax,bx,cx,dx
.enter
push ax, dx ; save other corners
push cx, bx
push cx, dx
call BoundLineCoord ; do upper left
pop ax, bx
call BoundLineCoord ; do lower right
pop ax, bx
call BoundLineCoord ; do upper right
pop ax, bx
call BoundLineCoord ; do lower left
.leave
ret
BoundLineRect endp
BoundFillRect proc far
uses ax,bx,cx,dx
.enter
push ax, dx ; save other corners
push cx, bx
push cx, dx
call BoundFillCoord ; do upper left
pop ax, bx
call BoundFillCoord ; do lower right
pop ax, bx
call BoundFillCoord ; do upper right
pop ax, bx
call BoundFillCoord ; do lower left
.leave
ret
BoundFillRect endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoundLine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Bounding box for line
CALLED BY: INTERNAL
PASS: ax,bx,cx,dx - x1,y1,x2,y2 for line
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 2/ 2/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoundLine proc near
call BoundLineCoord
xchgdw axbx, cxdx
call BoundLineCoord
xchgdw axbx, cxdx
ret
BoundLine endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoundLineCoord
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Process a single coordinate for bounds calculation
CALLED BY: INTERNAL
BoundRect
PASS: ax,bx - doc coord
di - GState
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 5/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoundLineCoord proc near
uses ax,bx,dx,es,cx,si
DSframe local DrawStringFrame
.enter inherit
; copy the coordinate into a temporary space
cwd
movdw DSframe.DSF_tempCoord.PDF_x.DWF_int, dxax
clr DSframe.DSF_tempCoord.PDF_x.DWF_frac
mov ax, bx
cwd
movdw DSframe.DSF_tempCoord.PDF_y.DWF_int, dxax
clr DSframe.DSF_tempCoord.PDF_y.DWF_frac
segmov es, ss, dx
lea dx, ss:DSframe.DSF_tempCoord
call GrTransformDWFixed
call GrGetLineWidth ; dxax = width
movdw sicx, dxax
movdwf dxaxbx, DSframe.DSF_tempCoord.PDF_x
call BoundXLine
movdwf dxaxbx, DSframe.DSF_tempCoord.PDF_y
call BoundYLine
.leave
ret
BoundLineCoord endp
BoundFillCoord proc near
uses ax,bx,dx,es
DSframe local DrawStringFrame
.enter inherit
; copy the coordinate into a temporary space
cwd
movdw DSframe.DSF_tempCoord.PDF_x.DWF_int, dxax
clr DSframe.DSF_tempCoord.PDF_x.DWF_frac
mov ax, bx
cwd
movdw DSframe.DSF_tempCoord.PDF_y.DWF_int, dxax
clr DSframe.DSF_tempCoord.PDF_y.DWF_frac
segmov es, ss, dx
lea dx, ss:DSframe.DSF_tempCoord
call GrTransformDWFixed
movdwf dxaxbx, DSframe.DSF_tempCoord.PDF_x
call BoundXFill
movdwf dxaxbx, DSframe.DSF_tempCoord.PDF_y
call BoundYFill
.leave
ret
BoundFillCoord endp
; save as above, except device coords passed.
BoundDevLineCoord proc near
uses ax,bx,dx,cx,si
.enter
push bx
push ax
call GrGetLineWidth ; dxax = width
movdw sicx, dxax
pop ax
cwd
clr bx
call BoundXLine
pop ax
cwd
clr bx
call BoundYLine
.leave
ret
BoundDevLineCoord endp
BoundDevFillCoord proc near
uses ax,bx,dx
.enter
push bx
cwd
clr bx
call BoundXFill
pop ax
cwd
clr bx
call BoundYFill
.leave
ret
BoundDevFillCoord endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoundX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Do min/max calc on X coordinate
CALLED BY: INTERNAL
PASS: dxaxbx - x coordiante to check (Page coords, DWFixed)
sicx - line width
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
This routine takes the current line width into account,
whether or not the passed coordinate is part of a line object.
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 5/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoundXLine proc near
uses cx,si
DSframe local DrawStringFrame
.enter inherit
sar si, 1 ; only apply half
rcr cx, 1
sub bx, cx ; add fractions
sbb ax, si
sbb dx, 0 ; dxaxbx = pos - linewidth
cmp dx, DSframe.DSF_tlBound.PDF_x.DWF_int.high
jl storeNewLowX
je checkMoreLow
checkHighX:
add bx, cx ; adding twice is faster than
adc ax, si ; saving/restoring orig coord
adc dx, 0 ; dxaxbx = orig pos
add bx, cx ; add fractions
adc ax, si
adc dx, 0 ; dxaxbx = pos + linewidth
cmp dx, DSframe.DSF_brBound.PDF_x.DWF_int.high
jg storeNewHighX
je checkMoreHigh
done:
sub bx, cx ; restore original values
sbb ax, si ; (faster than push/pop)
sbb dx, 0
.leave
ret
checkMoreLow:
cmp ax, DSframe.DSF_tlBound.PDF_x.DWF_int.low
jb storeNewLowX
jne checkHighX
cmp bx, DSframe.DSF_tlBound.PDF_x.DWF_frac
jae checkHighX
storeNewLowX:
movdwf DSframe.DSF_tlBound.PDF_x, dxaxbx
jmp checkHighX
checkMoreHigh:
cmp ax, DSframe.DSF_brBound.PDF_x.DWF_int.low
ja storeNewHighX
jne done
cmp bx, DSframe.DSF_brBound.PDF_x.DWF_frac
jbe done
storeNewHighX:
movdwf DSframe.DSF_brBound.PDF_x, dxaxbx
jmp done
BoundXLine endp
BoundXFill proc near
DSframe local DrawStringFrame
.enter inherit
cmp dx, DSframe.DSF_tlBound.PDF_x.DWF_int.high
jl newLowX
je moreCheckLow
checkHighX:
cmp dx, DSframe.DSF_brBound.PDF_x.DWF_int.high
jg newHighX
je moreCheckHigh
done:
.leave
ret
; make sure it's lower
moreCheckLow:
cmp ax, DSframe.DSF_tlBound.PDF_x.DWF_int.low
jb newLowX
jne checkHighX
cmp bx, DSframe.DSF_tlBound.PDF_x.DWF_frac
jae checkHighX
newLowX:
movdwf DSframe.DSF_tlBound.PDF_x, dxaxbx
jmp checkHighX
; make sure it's higher
moreCheckHigh:
cmp ax, DSframe.DSF_brBound.PDF_x.DWF_int.low
ja newHighX
jne done
cmp bx, DSframe.DSF_brBound.PDF_x.DWF_frac
jbe done
newHighX:
movdwf DSframe.DSF_brBound.PDF_x, dxaxbx
jmp done
BoundXFill endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BoundY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Do min/max calc on y coordinate
CALLED BY: INTERNAL
PASS: dxaxbx - DWFixed Page coordiante to check
sicx - current line width (WWFixed)
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jim 5/ 6/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
BoundYLine proc near
uses cx,si
DSframe local DrawStringFrame
.enter inherit
sar si, 1 ; only apply half
rcr cx, 1
sub bx, cx ; add fractions
sbb ax, si
sbb dx, 0 ; dxaxbx = pos - linewidth
cmp dx, DSframe.DSF_tlBound.PDF_y.DWF_int.high
jl storeNewLowY
je checkMoreLow
checkHighY:
add bx, cx ; adding twice is faster than
adc ax, si ; saving/restoring orig coord
adc dx, 0 ; dxaxbx = orig pos
add bx, cx ; add fractions
adc ax, si
adc dx, 0 ; dxaxbx = pos + linewidth
cmp dx, DSframe.DSF_brBound.PDF_y.DWF_int.high
jg storeNewHighY
je checkMoreHigh
done:
sub bx, cx ; restore original values
sbb ax, si ; (faster than push/pop)
sbb dx, 0
.leave
ret
checkMoreLow:
cmp ax, DSframe.DSF_tlBound.PDF_y.DWF_int.low
jb storeNewLowY
jne checkHighY
cmp bx, DSframe.DSF_tlBound.PDF_y.DWF_frac
jae checkHighY
storeNewLowY:
movdwf DSframe.DSF_tlBound.PDF_y, dxaxbx
jmp checkHighY
checkMoreHigh:
cmp ax, DSframe.DSF_brBound.PDF_y.DWF_int.low
ja storeNewHighY
jne done
cmp bx, DSframe.DSF_brBound.PDF_y.DWF_frac
jbe done
storeNewHighY:
movdwf DSframe.DSF_brBound.PDF_y, dxaxbx
jmp done
BoundYLine endp
BoundYFill proc near
DSframe local DrawStringFrame
.enter inherit
cmp dx, DSframe.DSF_tlBound.PDF_y.DWF_int.high
jl newLowY
je moreCheckLow
checkHighY:
cmp dx, DSframe.DSF_brBound.PDF_y.DWF_int.high
jg newHighY
je moreCheckHigh
done:
.leave
ret
; make sure it's lower
moreCheckLow:
cmp ax, DSframe.DSF_tlBound.PDF_y.DWF_int.low
jb newLowY
jne checkHighY
cmp bx, DSframe.DSF_tlBound.PDF_y.DWF_frac
jae checkHighY
newLowY:
movdwf DSframe.DSF_tlBound.PDF_y, dxaxbx
jmp checkHighY
; make sure it's higher
moreCheckHigh:
cmp ax, DSframe.DSF_brBound.PDF_y.DWF_int.low
ja newHighY
jne done
cmp bx, DSframe.DSF_brBound.PDF_y.DWF_frac
jbe done
newHighY:
movdwf DSframe.DSF_brBound.PDF_y, dxaxbx
jmp done
BoundYFill endp
GraphicsString ends
| 25.308506 | 80 | 0.602064 |
011487dab18106f9ff7c6469e9a49377e072ce8f | 502 | asm | Assembly | programs/oeis/054/A054684.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/054/A054684.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/054/A054684.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A054684: Sum of digits is odd.
; 1,3,5,7,9,10,12,14,16,18,21,23,25,27,29,30,32,34,36,38,41,43,45,47,49,50,52,54,56,58,61,63,65,67,69,70,72,74,76,78,81,83,85,87,89,90,92,94,96,98,100,102,104,106,108,111,113,115,117,119,120,122,124,126,128,131,133,135,137,139,140,142,144,146,148,151,153,155,157,159,160,162,164,166,168,171,173,175,177,179,180,182,184,186,188,191,193,195,197,199
mov $3,$0
mul $0,2
lpb $0
add $4,$0
div $0,10
lpe
gcd $4,2
mov $1,$4
sub $1,1
mov $2,$3
mul $2,2
add $1,$2
mov $0,$1
| 29.529412 | 346 | 0.659363 |
56b8d9046ed8fbda1846e68fd8272168df97c85d | 124 | asm | Assembly | libsrc/_DEVELOPMENT/font/fzx/fonts/ao/Dutch/_ff_ao_DutchLatin5.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/font/fzx/fonts/ao/Dutch/_ff_ao_DutchLatin5.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/font/fzx/fonts/ao/Dutch/_ff_ao_DutchLatin5.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
SECTION rodata_font_fzx
PUBLIC _ff_ao_DutchLatin5
_ff_ao_DutchLatin5:
BINARY "font/fzx/fonts/ao/Dutch/Dutch_Latin5.fzx"
| 13.777778 | 49 | 0.83871 |
9ff3f9f75d79487b0599fce1bf8532ef11ca2a95 | 399 | asm | Assembly | oeis/254/A254132.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/254/A254132.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/254/A254132.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A254132: a(0)=1 and a(1)=2, then each term is x + y + x*y where x and y are the 2 last terms.
; 1,2,5,17,107,1943,209951,408146687,85691213438975,34974584955819144511487,2997014624388697307377363936018956287,104819342594514896999066634490728502944926883876041385836543
mov $1,8
mov $2,6
lpb $0
sub $0,1
mod $0,15
mov $3,$2
mov $2,$1
mul $1,$3
div $1,4
lpe
mov $0,$1
div $0,4
sub $0,1
| 23.470588 | 174 | 0.711779 |
16f58226a61385fffaa38b9d2cebe45acb6ae82a | 177 | asm | Assembly | src/arch/aarch64/threads.asm | dendisuhubdy/IncludeOS | 95aaa1e16a5666d08fcb9f3c99d6ab4268548639 | [
"Apache-2.0"
] | 3,673 | 2015-12-01T22:14:02.000Z | 2019-03-22T03:07:20.000Z | src/arch/aarch64/threads.asm | dendisuhubdy/IncludeOS | 95aaa1e16a5666d08fcb9f3c99d6ab4268548639 | [
"Apache-2.0"
] | 960 | 2015-12-01T20:40:36.000Z | 2019-03-22T13:21:21.000Z | src/arch/aarch64/threads.asm | dendisuhubdy/IncludeOS | 95aaa1e16a5666d08fcb9f3c99d6ab4268548639 | [
"Apache-2.0"
] | 357 | 2015-12-02T09:32:50.000Z | 2019-03-22T09:32:34.000Z | .globl __clone_return
.globl __thread_yield
.globl __thread_restore
.extern __thread_suspend_and_yield
.section .text
__clone_return:
__thread_yield:
__thread_restore:
ret
| 16.090909 | 34 | 0.841808 |
0a5b0c1c99d93254ecd1ed2e2672817360b4b7aa | 550 | asm | Assembly | oeis/076/A076338.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/076/A076338.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/076/A076338.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A076338: a(n) = 512*n + 1.
; 1,513,1025,1537,2049,2561,3073,3585,4097,4609,5121,5633,6145,6657,7169,7681,8193,8705,9217,9729,10241,10753,11265,11777,12289,12801,13313,13825,14337,14849,15361,15873,16385,16897,17409,17921,18433,18945,19457,19969,20481,20993,21505,22017,22529,23041,23553,24065,24577,25089,25601,26113,26625,27137,27649,28161,28673,29185,29697,30209,30721,31233,31745,32257,32769,33281,33793,34305,34817,35329,35841,36353,36865,37377,37889,38401,38913,39425,39937,40449,40961,41473,41985,42497,43009,43521,44033
mul $0,512
add $0,1
| 91.666667 | 499 | 0.794545 |
e5fd589663e125b122d4ee95b5ae7f4f03cb8fec | 2,479 | asm | Assembly | Programming for Embedded Systems/Labs/Lab 2/Task 3/Task 3/main.asm | sathwikkannam/courses-HKR | 3a3fe0275575f21e27152ffcef4bcf47733404cd | [
"MIT"
] | null | null | null | Programming for Embedded Systems/Labs/Lab 2/Task 3/Task 3/main.asm | sathwikkannam/courses-HKR | 3a3fe0275575f21e27152ffcef4bcf47733404cd | [
"MIT"
] | null | null | null | Programming for Embedded Systems/Labs/Lab 2/Task 3/Task 3/main.asm | sathwikkannam/courses-HKR | 3a3fe0275575f21e27152ffcef4bcf47733404cd | [
"MIT"
] | null | null | null | ;
; Task 3.asm
;
; Created: 2022-02-23 14:11:05
; Author : SAKA0191
;Write a short program that adds two integer values, where the sum is less
;than or equal to 9, and display the result on a 7-segment display
.include "m328pdef.inc"
.equ zero = 0
.equ one = 1
.equ two = 2
.equ three = 3
.equ four = 4
.equ five = 5
.equ six = 6
.equ seven = 7
.equ eight = 8
.equ nine = 9
.equ DDRB_PINS = 0b00001111
.equ DDRD_PINS = 0b11110000
.equ PB = 0x25
.equ PD = 0x2B
start:
LDI R17, DDRB_PINS
STS 0x24, R17 ;; DDRB OUTPUT
LDI R18, DDRD_PINS
STS 0x2A, R18 ;; DDRD OUTPUT
LDI R19, 0 ;; R19 and R16 as inputs
LDI R16, 0
ADD R19, R16 ;; MUL R19, R16 or SUB R19, R16
CPI R19, nine
BRLO equal_or_lower
BREQ equal_or_lower
BRGE turn_on_zero
equal_or_lower:
CPI R19, zero
BREQ turn_on_zero
CPI R19, one
BREQ turn_on_one
CPI R19, two
BREQ turn_on_two
CPI R19, three
BREQ turn_on_three
CPI R19, four
BREQ turn_on_four
CPI R19, five
BREQ turn_on_five
CPI R19, six
BREQ turn_on_six
CPI R19, seven
BREQ turn_on_seven
CPI R19, eight
BREQ turn_on_eight
CPI R19, nine
BREQ turn_on_nine
turn_on_zero: ;show 0 if higher of zero
LDI R17, 0b00001101
STS PB, R17
LDI R18, 0b11110000
STS PD, R18
rjmp loop
turn_on_one:
LDI R17, 0b00001001
STS PB, R17
rjmp loop
turn_on_two:
LDI R17, 0b0001110
STS PB, R17
LDI R18, 0b11000000
STS PD, R18
rjmp loop
turn_on_three:
LDI R17, 0b0000110
STS PB, R17
LDI R18, 0b11110000
STS PD, R18
rjmp loop
turn_on_four:
LDI R17, 0b00000011
STS PB, R17
LDI R18, 0b01100000
STS PD, R18
rjmp loop
turn_on_five:
LDI R17, 0b00000111
STS PB, R17
LDI R18, 0b10110000
STS PD, R18
rjmp loop
turn_on_six:
LDI R17, 0b00001111
STS PB, R17
LDI R18, 0b10110000
STS PD, R18
rjmp loop
turn_on_seven:
LDI R17, 0b00000000
STS PB, R17
LDI R18, 0b11110000
STS PD, R18
rjmp loop
turn_on_eight:
LDI R17, 0b00001111
STS PB, R17
LDI R18, 0b11110000
STS PD, R18
rjmp loop
turn_on_nine:
LDI R17, 0b00000111
STS PB, R17
LDI R18, 0b11110000
STS PD, R18
rjmp loop
loop: ;; loop to prevent jumping to random registers.
rjmp loop | 17.335664 | 76 | 0.607503 |
ed7ef55b9ec50b17d3baa9a8dee0429d0f62de22 | 47,411 | asm | Assembly | data/pokemon/evos_attacks_kanto.asm | Karkino/KarkCrystal16 | 945dde0354016f9357e9d3798312cc6efa52ff7a | [
"blessing"
] | null | null | null | data/pokemon/evos_attacks_kanto.asm | Karkino/KarkCrystal16 | 945dde0354016f9357e9d3798312cc6efa52ff7a | [
"blessing"
] | null | null | null | data/pokemon/evos_attacks_kanto.asm | Karkino/KarkCrystal16 | 945dde0354016f9357e9d3798312cc6efa52ff7a | [
"blessing"
] | null | null | null | SECTION "Evolutions and Attacks 1", ROMX
EvosAttacksPointers1::
dw BulbasaurEvosAttacks
dw IvysaurEvosAttacks
dw VenusaurEvosAttacks
dw CharmanderEvosAttacks
dw CharmeleonEvosAttacks
dw CharizardEvosAttacks
dw SquirtleEvosAttacks
dw WartortleEvosAttacks
dw BlastoiseEvosAttacks
dw CaterpieEvosAttacks
dw MetapodEvosAttacks
dw ButterfreeEvosAttacks
dw WeedleEvosAttacks
dw KakunaEvosAttacks
dw BeedrillEvosAttacks
dw PidgeyEvosAttacks
dw PidgeottoEvosAttacks
dw PidgeotEvosAttacks
dw RattataEvosAttacks
dw RaticateEvosAttacks
dw SpearowEvosAttacks
dw FearowEvosAttacks
dw EkansEvosAttacks
dw ArbokEvosAttacks
dw PikachuEvosAttacks
dw RaichuEvosAttacks
dw SandshrewEvosAttacks
dw SandslashEvosAttacks
dw NidoranFEvosAttacks
dw NidorinaEvosAttacks
dw NidoqueenEvosAttacks
dw NidoranMEvosAttacks
dw NidorinoEvosAttacks
dw NidokingEvosAttacks
dw ClefairyEvosAttacks
dw ClefableEvosAttacks
dw VulpixEvosAttacks
dw NinetalesEvosAttacks
dw JigglypuffEvosAttacks
dw WigglytuffEvosAttacks
dw ZubatEvosAttacks
dw GolbatEvosAttacks
dw OddishEvosAttacks
dw GloomEvosAttacks
dw VileplumeEvosAttacks
dw ParasEvosAttacks
dw ParasectEvosAttacks
dw VenonatEvosAttacks
dw VenomothEvosAttacks
dw DiglettEvosAttacks
dw DugtrioEvosAttacks
dw MeowthEvosAttacks
dw PersianEvosAttacks
dw PsyduckEvosAttacks
dw GolduckEvosAttacks
dw MankeyEvosAttacks
dw PrimeapeEvosAttacks
dw GrowlitheEvosAttacks
dw ArcanineEvosAttacks
dw PoliwagEvosAttacks
dw PoliwhirlEvosAttacks
dw PoliwrathEvosAttacks
dw AbraEvosAttacks
dw KadabraEvosAttacks
dw AlakazamEvosAttacks
dw MachopEvosAttacks
dw MachokeEvosAttacks
dw MachampEvosAttacks
dw BellsproutEvosAttacks
dw WeepinbellEvosAttacks
dw VictreebelEvosAttacks
dw TentacoolEvosAttacks
dw TentacruelEvosAttacks
dw GeodudeEvosAttacks
dw GravelerEvosAttacks
dw GolemEvosAttacks
dw PonytaEvosAttacks
dw RapidashEvosAttacks
dw SlowpokeEvosAttacks
dw SlowbroEvosAttacks
dw MagnemiteEvosAttacks
dw MagnetonEvosAttacks
dw FarfetchDEvosAttacks
dw DoduoEvosAttacks
dw DodrioEvosAttacks
dw SeelEvosAttacks
dw DewgongEvosAttacks
dw GrimerEvosAttacks
dw MukEvosAttacks
dw ShellderEvosAttacks
dw CloysterEvosAttacks
dw GastlyEvosAttacks
dw HaunterEvosAttacks
dw GengarEvosAttacks
dw OnixEvosAttacks
dw DrowzeeEvosAttacks
dw HypnoEvosAttacks
dw KrabbyEvosAttacks
dw KinglerEvosAttacks
dw VoltorbEvosAttacks
dw ElectrodeEvosAttacks
dw ExeggcuteEvosAttacks
dw ExeggutorEvosAttacks
dw CuboneEvosAttacks
dw MarowakEvosAttacks
dw HitmonleeEvosAttacks
dw HitmonchanEvosAttacks
dw LickitungEvosAttacks
dw KoffingEvosAttacks
dw WeezingEvosAttacks
dw RhyhornEvosAttacks
dw RhydonEvosAttacks
dw ChanseyEvosAttacks
dw TangelaEvosAttacks
dw KangaskhanEvosAttacks
dw HorseaEvosAttacks
dw SeadraEvosAttacks
dw GoldeenEvosAttacks
dw SeakingEvosAttacks
dw StaryuEvosAttacks
dw StarmieEvosAttacks
dw MrMimeEvosAttacks
dw ScytherEvosAttacks
dw JynxEvosAttacks
dw ElectabuzzEvosAttacks
dw MagmarEvosAttacks
dw PinsirEvosAttacks
dw TaurosEvosAttacks
dw MagikarpEvosAttacks
dw GyaradosEvosAttacks
dw LaprasEvosAttacks
dw DittoEvosAttacks
dw EeveeEvosAttacks
dw VaporeonEvosAttacks
dw JolteonEvosAttacks
dw FlareonEvosAttacks
dw PorygonEvosAttacks
dw OmanyteEvosAttacks
dw OmastarEvosAttacks
dw KabutoEvosAttacks
dw KabutopsEvosAttacks
dw AerodactylEvosAttacks
dw SnorlaxEvosAttacks
dw ArticunoEvosAttacks
dw ZapdosEvosAttacks
dw MoltresEvosAttacks
dw DratiniEvosAttacks
dw DragonairEvosAttacks
dw DragoniteEvosAttacks
dw MewtwoEvosAttacks
dw MewEvosAttacks
BulbasaurEvosAttacks:
dbbw EVOLVE_LEVEL, 16, IVYSAUR
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 4, GROWL
dbw 7, LEECH_SEED
dbw 10, VINE_WHIP
dbw 15, POISONPOWDER
dbw 15, SLEEP_POWDER
dbw 20, RAZOR_LEAF
dbw 25, SWEET_SCENT
dbw 32, GROWTH
dbw 39, SYNTHESIS
dbw 46, SOLARBEAM
db 0 ; no more level-up moves
IvysaurEvosAttacks:
dbbw EVOLVE_LEVEL, 32, VENUSAUR
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, GROWL
dbw 1, LEECH_SEED
dbw 4, GROWL
dbw 7, LEECH_SEED
dbw 10, VINE_WHIP
dbw 15, POISONPOWDER
dbw 15, SLEEP_POWDER
dbw 22, RAZOR_LEAF
dbw 29, SWEET_SCENT
dbw 38, GROWTH
dbw 47, SYNTHESIS
dbw 56, SOLARBEAM
db 0 ; no more level-up moves
VenusaurEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, GROWL
dbw 1, LEECH_SEED
dbw 1, VINE_WHIP
dbw 4, GROWL
dbw 7, LEECH_SEED
dbw 10, VINE_WHIP
dbw 15, POISONPOWDER
dbw 15, SLEEP_POWDER
dbw 22, RAZOR_LEAF
dbw 29, SWEET_SCENT
dbw 41, GROWTH
dbw 53, SYNTHESIS
dbw 65, SOLARBEAM
db 0 ; no more level-up moves
CharmanderEvosAttacks:
dbbw EVOLVE_LEVEL, 16, CHARMELEON
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, GROWL
dbw 4, EMBER
dbw 8, SMOKESCREEN
dbw 12, DRAGONBREATH
dbw 17, FIRE_PUNCH
dbw 21, SLASH
dbw 26, FLAMETHROWER
dbw 32, THUNDERPUNCH
dbw 37, FIRE_SPIN
dbw 44, DRAGON_RUSH
dbw 51, ROAR
dbw 57, FIRE_BLAST
dbw 63, ROCK_SLIDE
db 0 ; no more level-up moves
CharmeleonEvosAttacks:
dbbw EVOLVE_LEVEL, 36, CHARIZARD
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, EMBER
dbw 1, SMOKESCREEN
dbw 1, DRAGONBREATH
dbw 18, FIRE_PUNCH
dbw 24, SLASH
dbw 30, FLAMETHROWER
dbw 38, THUNDERPUNCH
dbw 40, FIRE_SPIN
dbw 48, DRAGON_RUSH
dbw 56, ROAR
dbw 61, FIRE_BLAST
dbw 68, ROCK_SLIDE
db 0 ; no more level-up moves
CharizardEvosAttacks:
db 0 ; no more evolutions
dbw 1, DRAGONBREATH
dbw 1, FIRE_PUNCH
dbw 1, SLASH
dbw 1, FLAMETHROWER
dbw 39, THUNDERPUNCH
dbw 46, FIRE_SPIN
dbw 54, DRAGON_RUSH
dbw 62, ROAR
dbw 68, FIRE_BLAST
dbw 74, ROCK_SLIDE
db 0 ; no more level-up moves
SquirtleEvosAttacks:
dbbw EVOLVE_LEVEL, 16, WARTORTLE
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 4, TAIL_WHIP
dbw 7, BUBBLE
dbw 10, WITHDRAW
dbw 13, WATER_GUN
dbw 18, BITE
dbw 23, RAPID_SPIN
dbw 28, PROTECT
dbw 33, RAIN_DANCE
dbw 40, SKULL_BASH
dbw 47, HYDRO_PUMP
db 0 ; no more level-up moves
WartortleEvosAttacks:
dbbw EVOLVE_LEVEL, 36, BLASTOISE
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, TAIL_WHIP
dbw 1, BUBBLE
dbw 4, TAIL_WHIP
dbw 7, BUBBLE
dbw 10, WITHDRAW
dbw 13, WATER_GUN
dbw 19, BITE
dbw 25, RAPID_SPIN
dbw 31, PROTECT
dbw 37, RAIN_DANCE
dbw 45, SKULL_BASH
dbw 53, HYDRO_PUMP
db 0 ; no more level-up moves
BlastoiseEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, TAIL_WHIP
dbw 1, BUBBLE
dbw 1, WITHDRAW
dbw 4, TAIL_WHIP
dbw 7, BUBBLE
dbw 10, WITHDRAW
dbw 13, WATER_GUN
dbw 19, BITE
dbw 25, RAPID_SPIN
dbw 31, PROTECT
dbw 42, RAIN_DANCE
dbw 55, SKULL_BASH
dbw 68, HYDRO_PUMP
db 0 ; no more level-up moves
CaterpieEvosAttacks:
dbbw EVOLVE_LEVEL, 7, METAPOD
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, STRING_SHOT
dbw 6, STRUGGLE_BUG
dbw 9, POISONPOWDER
dbw 9, STUN_SPORE
dbw 9, SLEEP_POWDER
dbw 15, SIGNAL_BEAM
db 0 ; no more level-up moves
MetapodEvosAttacks:
dbbw EVOLVE_LEVEL, 10, BUTTERFREE
db 0 ; no more evolutions
dbw 1, HARDEN
dbw 1, STRUGGLE_BUG
dbw 1, TACKLE
dbw 7, HARDEN
db 0 ; no more level-up moves
ButterfreeEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, STRING_SHOT
dbw 1, STRUGGLE_BUG
dbw 1, HARDEN
dbw 10, GUST
dbw 11, CONFUSION
dbw 13, POISONPOWDER
dbw 13, SLEEP_POWDER
dbw 13, STUN_SPORE
dbw 16, PSYBEAM
dbw 20, WHIRLWIND
dbw 24, TWISTER
dbw 28, SAFEGUARD
dbw 32, SIGNAL_BEAM
dbw 36, AGILITY
dbw 40, BATON_PASS
dbw 44, NASTY_PLOT
dbw 48, PSYCHIC_M
dbw 52, LIGHT_SCREEN
dbw 56, SPORE
db 0 ; no more level-up moves
WeedleEvosAttacks:
dbbw EVOLVE_LEVEL, 7, KAKUNA
db 0 ; no more evolutions
dbw 1, POISON_STING
dbw 1, STRING_SHOT
dbw 6, STRUGGLE_BUG
dbw 10, FURY_ATTACK
dbw 13, RAGE
dbw 16, PURSUIT
dbw 19, FOCUS_ENERGY
db 0 ; no more level-up moves
KakunaEvosAttacks:
dbbw EVOLVE_LEVEL, 10, BEEDRILL
db 0 ; no more evolutions
dbw 1, HARDEN
dbw 1, STRUGGLE_BUG
dbw 1, POISON_STING
dbw 7, HARDEN
db 0 ; no more level-up moves
BeedrillEvosAttacks:
db 0 ; no more evolutions
dbw 1, POISON_STING
dbw 1, STRING_SHOT
dbw 1, STRUGGLE_BUG
dbw 1, HARDEN
dbw 10, FURY_ATTACK
dbw 13, RAGE
dbw 17, TWINEEDLE
dbw 20, FOCUS_ENERGY
dbw 23, SLUDGE
dbw 26, PURSUIT
dbw 29, TOXIC
dbw 32, PIN_MISSILE
dbw 35, SLUDGE_BOMB
dbw 38, AGILITY
dbw 41, BODY_SLAM
dbw 44, SWORDS_DANCE
dbw 47, GUNK_SHOT
dbw 50, DOUBLE_EDGE
dbw 53, BATON_PASS
dbw 57, SWAGGER
db 0 ; no more level-up moves
PidgeyEvosAttacks:
dbbw EVOLVE_LEVEL, 18, PIDGEOTTO
db 0 ; no more evolutions
dbw 1, SAND_ATTACK
dbw 1, TACKLE
dbw 7, GUST
dbw 10, QUICK_ATTACK
dbw 14, MUD_SLAP
dbw 18, WHIRLWIND
dbw 20, AGILITY
dbw 23, WING_ATTACK
dbw 27, TWISTER
dbw 32, SOFTBOILED
dbw 36, MIRROR_MOVE
dbw 42, AIR_SLASH
dbw 47, DOUBLE_EDGE
dbw 52, SKY_ATTACK
db 0 ; no more level-up moves
PidgeottoEvosAttacks:
dbbw EVOLVE_LEVEL, 36, PIDGEOT
db 0 ; no more evolutions
dbw 1, GUST
dbw 1, QUICK_ATTACK
dbw 1, MUD_SLAP
dbw 1, WHIRLWIND
dbw 23, AGILITY
dbw 26, WING_ATTACK
dbw 31, TWISTER
dbw 36, SOFTBOILED
dbw 43, MIRROR_MOVE
dbw 48, AIR_SLASH
dbw 54, DOUBLE_EDGE
dbw 47, SKY_ATTACK
db 0 ; no more level-up moves
PidgeotEvosAttacks:
db 0 ; no more evolutions
dbw 1, AGILITY
dbw 1, WING_ATTACK
dbw 1, TWISTER
dbw 1, SOFTBOILED
dbw 45, MIRROR_MOVE
dbw 40, AIR_SLASH
dbw 57, DOUBLE_EDGE
dbw 60, SKY_ATTACK
db 0 ; no more level-up moves
RattataEvosAttacks:
dbbw EVOLVE_LEVEL, 20, RATICATE
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, SAND_ATTACK
dbw 4, QUICK_ATTACK
dbw 7, FOCUS_ENERGY
dbw 10, BITE
dbw 13, PURSUIT
dbw 16, HYPER_FANG
dbw 19, AGILITY
dbw 22, CRUNCH
dbw 25, MAGNITUDE
dbw 28, SUPER_FANG
dbw 31, DOUBLE_EDGE
dbw 34, EARTHQUAKE
db 0 ; no more level-up moves
RaticateEvosAttacks:
db 0 ; no more evolutions
dbw 1, BITE
dbw 1, PURSUIT
dbw 1, HYPER_FANG
dbw 1, AGILITY
dbw 24, CRUNCH
dbw 29, MAGNITUDE
dbw 34, SUPER_FANG
dbw 39, DOUBLE_EDGE
dbw 44, EARTHQUAKE
db 0 ; no more level-up moves
SpearowEvosAttacks:
dbbw EVOLVE_LEVEL, 20, FEAROW
db 0 ; no more evolutions
dbw 1, PECK
dbw 1, GROWL
dbw 4, LEER
dbw 8, PURSUIT
dbw 11, FURY_ATTACK
dbw 15, FEATHERDANCE
dbw 18, MIRROR_MOVE
dbw 22, BEAT_UP
dbw 25, AGILITY
dbw 29, FOCUS_ENERGY
dbw 32, SOFTBOILED
dbw 36, DRILL_PECK
dbw 40, BODY_SLAM
dbw 45, SKY_ATTACK
db 0 ; no more level-up moves
FearowEvosAttacks:
db 0 ; no more evolutions
dbw 1, PURSUIT
dbw 1, FURY_ATTACK
dbw 1, FEATHERDANCE
dbw 1, MIRROR_MOVE
dbw 23, BEAT_UP
dbw 27, AGILITY
dbw 32, FOCUS_ENERGY
dbw 36, SOFTBOILED
dbw 41, DRILL_PECK
dbw 45, BODY_SLAM
dbw 51, SKY_ATTACK
db 0 ; no more level-up moves
EkansEvosAttacks:
dbbw EVOLVE_LEVEL, 22, ARBOK
db 0 ; no more evolutions
dbw 1, WRAP
dbw 1, LEER
dbw 4, POISON_STING
dbw 9, BITE
dbw 12, GLARE
dbw 17, SCREECH
dbw 20, ACID
dbw 25, REST
dbw 25, SNORE
dbw 25, SLEEP_TALK
dbw 28, ACID_ARMOR
dbw 33, POISON_FANG
dbw 36, TOXIC
dbw 38, IRON_TAIL
dbw 41, HAZE
dbw 44, SWORDS_DANCE
dbw 49, GUNK_SHOT
db 0 ; no more level-up moves
ArbokEvosAttacks:
db 0 ; no more evolutions
dbw 1, BITE
dbw 1, GLARE
dbw 1, SCREECH
dbw 1, ACID
dbw 27, REST
dbw 27, SNORE
dbw 27, SLEEP_TALK
dbw 32, ACID_ARMOR
dbw 39, POISON_FANG
dbw 44, TOXIC
dbw 48, IRON_TAIL
dbw 51, HAZE
dbw 56, SWORDS_DANCE
dbw 63, GUNK_SHOT
db 0 ; no more level-up moves
PikachuEvosAttacks:
dbbw EVOLVE_ITEM, THUNDERSTONE, RAICHU
db 0 ; no more evolutions
dbw 1, CHARM
dbw 1, NUZZLE
dbw 6, THUNDERSHOCK
dbw 10, DOUBLE_TEAM
dbw 15, BITE
dbw 19, DOUBLE_KICK
dbw 24, THUNDERBOLT
dbw 29, IRON_TAIL
dbw 34, SLAM
dbw 37, AGILITY
dbw 40, FLAIL
dbw 46, MOONBLAST
dbw 52, THUNDER
dbw 57, JUMP_KICK
dbw 64, EXTREMESPEED
db 0 ; no more level-up moves
RaichuEvosAttacks:
db 0 ; no more evolutions
dbw 1, CHARM
dbw 1, NUZZLE
dbw 6, THUNDERSHOCK
dbw 10, DOUBLE_TEAM
dbw 16, BITE
dbw 21, DOUBLE_KICK
dbw 26, THUNDERBOLT
dbw 32, IRON_TAIL
dbw 38, SLAM
dbw 41, AGILITY
dbw 44, FLAIL
dbw 51, MOONBLAST
dbw 57, THUNDER
dbw 63, JUMP_KICK
dbw 70, EXTREMESPEED
db 0 ; no more level-up moves
SandshrewEvosAttacks:
dbbw EVOLVE_LEVEL, 22, SANDSLASH
db 0 ; no more evolutions
dbw 1, DEFENSE_CURL
dbw 1, POISON_STING
dbw 1, SAND_ATTACK
dbw 1, SCRATCH
dbw 9, ROLLOUT
dbw 12, FURY_CUTTER
dbw 15, RAPID_SPIN
dbw 18, MAGNITUDE
dbw 21, SWIFT
dbw 24, FURY_SWIPES
dbw 27, ROCK_TOMB
dbw 30, SLASH
dbw 33, DIG
dbw 36, IRON_HEAD
dbw 39, SWORDS_DANCE
dbw 42, SANDSTORM
dbw 45, EARTHQUAKE
db 0 ; no more level-up moves
SandslashEvosAttacks:
db 0 ; no more evolutions
dbw 1, FURY_CUTTER
dbw 1, RAPID_SPIN
dbw 1, MAGNITUDE
dbw 1, SWIFT
dbw 26, FURY_SWIPES
dbw 31, ROCK_TOMB
dbw 36, SLASH
dbw 41, DIG
dbw 46, IRON_HEAD
dbw 51, SWORDS_DANCE
dbw 56, SANDSTORM
dbw 61, EARTHQUAKE
db 0 ; no more level-up moves
NidoranFEvosAttacks:
dbbw EVOLVE_LEVEL, 16, NIDORINA
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, TACKLE
dbw 8, SCRATCH
dbw 12, DOUBLE_KICK
dbw 17, POISON_STING
dbw 23, TAIL_WHIP
dbw 30, BITE
dbw 38, FURY_SWIPES
db 0 ; no more level-up moves
NidorinaEvosAttacks:
dbbw EVOLVE_ITEM, MOON_STONE, NIDOQUEEN
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, TACKLE
dbw 8, SCRATCH
dbw 12, DOUBLE_KICK
dbw 19, POISON_STING
dbw 27, TAIL_WHIP
dbw 36, BITE
dbw 46, FURY_SWIPES
db 0 ; no more level-up moves
NidoqueenEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, SCRATCH
dbw 1, DOUBLE_KICK
dbw 1, TAIL_WHIP
dbw 23, BODY_SLAM
db 0 ; no more level-up moves
NidoranMEvosAttacks:
dbbw EVOLVE_LEVEL, 16, NIDORINO
db 0 ; no more evolutions
dbw 1, LEER
dbw 1, TACKLE
dbw 8, HORN_ATTACK
dbw 12, DOUBLE_KICK
dbw 17, POISON_STING
dbw 23, FOCUS_ENERGY
dbw 30, FURY_ATTACK
dbw 38, HORN_DRILL
db 0 ; no more level-up moves
NidorinoEvosAttacks:
dbbw EVOLVE_ITEM, MOON_STONE, NIDOKING
db 0 ; no more evolutions
dbw 1, LEER
dbw 1, TACKLE
dbw 8, HORN_ATTACK
dbw 12, DOUBLE_KICK
dbw 19, POISON_STING
dbw 27, FOCUS_ENERGY
dbw 36, FURY_ATTACK
dbw 46, HORN_DRILL
db 0 ; no more level-up moves
NidokingEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, HORN_ATTACK
dbw 1, DOUBLE_KICK
dbw 1, POISON_STING
dbw 23, THRASH
db 0 ; no more level-up moves
ClefairyEvosAttacks:
dbbw EVOLVE_ITEM, MOON_STONE, CLEFABLE
db 0 ; no more evolutions
dbw 1, ENCORE
dbw 1, CHARM
dbw 1, RECOVER
dbw 1, MINIMIZE
dbw 8, SING
dbw 13, DOUBLESLAP
dbw 19, MINIMIZE
dbw 24, DEFENSE_CURL
dbw 28, NASTY_PLOT
dbw 32, HEADBUTT
dbw 38, MOONBLAST
dbw 43, RECOVER
dbw 48, BARRIER
dbw 54, DOUBLE_EDGE
dbw 57, PSYCHIC_M
dbw 60, LIGHT_SCREEN
db 0 ; no more level-up moves
ClefableEvosAttacks:
db 0 ; no more evolutions
dbw 1, ENCORE
dbw 1, CHARM
dbw 1, RECOVER
dbw 1, MINIMIZE
dbw 8, SING
dbw 14, DOUBLESLAP
dbw 21, MINIMIZE
dbw 26, DEFENSE_CURL
dbw 30, NASTY_PLOT
dbw 38, HEADBUTT
dbw 43, MOONBLAST
dbw 46, RECOVER
dbw 54, BARRIER
dbw 59, DOUBLE_EDGE
dbw 63, PSYCHIC_M
dbw 69, LIGHT_SCREEN
db 0 ; no more level-up moves
VulpixEvosAttacks:
dbbw EVOLVE_ITEM, FIRE_STONE, NINETALES
db 0 ; no more evolutions
dbw 1, EMBER
dbw 1, CONFUSE_RAY
dbw 4, DISABLE
dbw 8, QUICK_ATTACK
dbw 12, SPITE
dbw 16, FIRE_SPIN
dbw 20, NASTY_PLOT
dbw 24, CURSE
dbw 28, PSYWAVE
dbw 32, FLAMETHROWER
dbw 36, HYPNOSIS
dbw 36, NIGHTMARE
dbw 40, FIRE_SPIN
dbw 44, SAFEGUARD
dbw 48, SHADOW_BALL
dbw 52, DESTINY_BOND
dbw 56, FIRE_BLAST
db 0 ; no more level-up moves
NinetalesEvosAttacks:
db 0 ; no more evolutions
dbw 1, EMBER
dbw 1, CONFUSE_RAY
dbw 4, DISABLE
dbw 9, QUICK_ATTACK
dbw 14, SPITE
dbw 18, FIRE_SPIN
dbw 23, NASTY_PLOT
dbw 27, CURSE
dbw 31, PSYWAVE
dbw 35, FLAMETHROWER
dbw 40, HYPNOSIS
dbw 40, NIGHTMARE
dbw 45, FIRE_SPIN
dbw 49, SAFEGUARD
dbw 53, SHADOW_BALL
dbw 58, DESTINY_BOND
dbw 62, FIRE_BLAST
db 0 ; no more level-up moves
JigglypuffEvosAttacks:
dbbw EVOLVE_ITEM, MOON_STONE, WIGGLYTUFF
db 0 ; no more evolutions
dbw 1, POUND
dbw 1, SING
dbw 1, DEFENSE_CURL
dbw 16, ROLLOUT
dbw 22, DAZZLE_GLEAM
dbw 26, DOUBLE_EDGE
dbw 30, MOONBLAST
dbw 37, RECOVER
dbw 43, REFLECT
dbw 48, ATTRACT
dbw 51, PURSUIT
dbw 55, REST
dbw 55, SLEEP_TALK
dbw 59, HYPER_BEAM
db 0 ; no more level-up moves
WigglytuffEvosAttacks:
db 0 ; no more evolutions
dbw 1, POUND
dbw 1, SING
dbw 1, DEFENSE_CURL
dbw 17, ROLLOUT
dbw 24, DAZZLE_GLEAM
dbw 28, DOUBLE_EDGE
dbw 32, MOONBLAST
dbw 40, RECOVER
dbw 46, REFLECT
dbw 52, ATTRACT
dbw 55, PURSUIT
dbw 60, REST
dbw 60, SLEEP_TALK
dbw 65, HYPER_BEAM
db 0 ; no more level-up moves
ZubatEvosAttacks:
dbbw EVOLVE_LEVEL, 22, GOLBAT
db 0 ; no more evolutions
dbw 1, ABSORB
dbw 1, SCREECH
dbw 5, SUPERSONIC
dbw 7, ASTONISH
dbw 11, BITE
dbw 13, GUST
dbw 17, CONFUSE_RAY
dbw 19, WING_ATTACK
dbw 23, SWIFT
dbw 25, POISON_FANG
dbw 29, MEAN_LOOK
dbw 31, LEECH_LIFE
dbw 35, HAZE
dbw 37, SLUDGE_BOMB
dbw 41, EXPLOSION
dbw 43, DETECT
dbw 48, GUNK_SHOT
db 0 ; no more level-up moves
GolbatEvosAttacks:
dbbw EVOLVE_HAPPINESS, TR_ANYTIME, CROBAT
db 0 ; no more evolutions
dbw 1, BITE
dbw 1, GUST
dbw 1, CONFUSE_RAY
dbw 1, WING_ATTACK
dbw 24, SWIFT
dbw 27, POISON_FANG
dbw 32, MEAN_LOOK
dbw 35, LEECH_LIFE
dbw 40, HAZE
dbw 43, SLUDGE_BOMB
dbw 48, EXPLOSION
dbw 51, DETECT
dbw 57, GUNK_SHOT
db 0 ; no more level-up moves
OddishEvosAttacks:
dbbw EVOLVE_LEVEL, 21, GLOOM
db 0 ; no more evolutions
dbw 1, ABSORB
dbw 7, SWEET_SCENT
dbw 14, POISONPOWDER
dbw 16, STUN_SPORE
dbw 18, SLEEP_POWDER
dbw 23, ACID
dbw 32, MOONLIGHT
dbw 39, PETAL_DANCE
db 0 ; no more level-up moves
GloomEvosAttacks:
dbbw EVOLVE_ITEM, LEAF_STONE, VILEPLUME
dbbw EVOLVE_ITEM, SUN_STONE, BELLOSSOM
db 0 ; no more evolutions
dbw 1, ABSORB
dbw 1, SWEET_SCENT
dbw 1, POISONPOWDER
dbw 7, SWEET_SCENT
dbw 14, POISONPOWDER
dbw 16, STUN_SPORE
dbw 18, SLEEP_POWDER
dbw 24, ACID
dbw 35, MOONLIGHT
dbw 44, PETAL_DANCE
db 0 ; no more level-up moves
VileplumeEvosAttacks:
db 0 ; no more evolutions
dbw 1, ABSORB
dbw 1, SWEET_SCENT
dbw 1, STUN_SPORE
dbw 1, PETAL_DANCE
db 0 ; no more level-up moves
ParasEvosAttacks:
dbbw EVOLVE_LEVEL, 24, PARASECT
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 7, STUN_SPORE
dbw 13, POISONPOWDER
dbw 19, LEECH_LIFE
dbw 25, SPORE
dbw 31, SLASH
dbw 37, GROWTH
dbw 43, GIGA_DRAIN
db 0 ; no more level-up moves
ParasectEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, STUN_SPORE
dbw 1, POISONPOWDER
dbw 7, STUN_SPORE
dbw 13, POISONPOWDER
dbw 19, LEECH_LIFE
dbw 28, SPORE
dbw 37, SLASH
dbw 46, GROWTH
dbw 55, GIGA_DRAIN
db 0 ; no more level-up moves
VenonatEvosAttacks:
dbbw EVOLVE_LEVEL, 31, VENOMOTH
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, DISABLE
dbw 1, FORESIGHT
dbw 9, SUPERSONIC
dbw 17, CONFUSION
dbw 20, POISONPOWDER
dbw 25, LEECH_LIFE
dbw 28, STUN_SPORE
dbw 33, PSYBEAM
dbw 36, SLEEP_POWDER
dbw 41, PSYCHIC_M
db 0 ; no more level-up moves
VenomothEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, DISABLE
dbw 1, FORESIGHT
dbw 1, SUPERSONIC
dbw 9, SUPERSONIC
dbw 17, CONFUSION
dbw 20, POISONPOWDER
dbw 25, LEECH_LIFE
dbw 28, STUN_SPORE
dbw 31, GUST
dbw 36, PSYBEAM
dbw 42, SLEEP_POWDER
dbw 52, PSYCHIC_M
db 0 ; no more level-up moves
DiglettEvosAttacks:
dbbw EVOLVE_LEVEL, 26, DUGTRIO
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 5, GROWL
dbw 9, MAGNITUDE
dbw 17, DIG
dbw 25, SAND_ATTACK
dbw 33, SLASH
dbw 41, EARTHQUAKE
dbw 49, FISSURE
db 0 ; no more level-up moves
DugtrioEvosAttacks:
db 0 ; no more evolutions
dbw 1, TRI_ATTACK
dbw 1, SCRATCH
dbw 1, GROWL
dbw 1, MAGNITUDE
dbw 5, GROWL
dbw 9, MAGNITUDE
dbw 17, DIG
dbw 25, SAND_ATTACK
dbw 37, SLASH
dbw 49, EARTHQUAKE
dbw 61, FISSURE
db 0 ; no more level-up moves
MeowthEvosAttacks:
dbbw EVOLVE_LEVEL, 28, PERSIAN
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, GROWL
dbw 11, BITE
dbw 20, PAY_DAY
dbw 28, FAINT_ATTACK
dbw 35, SCREECH
dbw 41, FURY_SWIPES
dbw 46, SLASH
db 0 ; no more level-up moves
PersianEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, GROWL
dbw 1, BITE
dbw 11, BITE
dbw 20, PAY_DAY
dbw 29, FAINT_ATTACK
dbw 38, SCREECH
dbw 46, FURY_SWIPES
dbw 53, SLASH
db 0 ; no more level-up moves
PsyduckEvosAttacks:
dbbw EVOLVE_LEVEL, 33, GOLDUCK
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 5, TAIL_WHIP
dbw 10, DISABLE
dbw 16, CONFUSION
dbw 23, SCREECH
dbw 31, PSYCH_UP
dbw 40, FURY_SWIPES
dbw 50, HYDRO_PUMP
db 0 ; no more level-up moves
GolduckEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, TAIL_WHIP
dbw 1, DISABLE
dbw 1, CONFUSION
dbw 5, TAIL_WHIP
dbw 10, DISABLE
dbw 16, CONFUSION
dbw 23, SCREECH
dbw 31, PSYCH_UP
dbw 44, FURY_SWIPES
dbw 58, HYDRO_PUMP
db 0 ; no more level-up moves
MankeyEvosAttacks:
dbbw EVOLVE_LEVEL, 28, PRIMEAPE
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, LEER
dbw 9, LOW_KICK
dbw 15, KARATE_CHOP
dbw 21, FURY_SWIPES
dbw 27, FOCUS_ENERGY
dbw 33, SEISMIC_TOSS
dbw 39, CROSS_CHOP
dbw 45, SCREECH
dbw 51, THRASH
db 0 ; no more level-up moves
PrimeapeEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, LEER
dbw 1, LOW_KICK
dbw 1, RAGE
dbw 9, LOW_KICK
dbw 15, KARATE_CHOP
dbw 21, FURY_SWIPES
dbw 27, FOCUS_ENERGY
dbw 28, RAGE
dbw 36, SEISMIC_TOSS
dbw 45, CROSS_CHOP
dbw 54, SCREECH
dbw 63, THRASH
db 0 ; no more level-up moves
GrowlitheEvosAttacks:
dbbw EVOLVE_ITEM, FIRE_STONE, ARCANINE
db 0 ; no more evolutions
dbw 1, EMBER
dbw 1, LEER
dbw 4, GROWL
dbw 8, BITE
dbw 12, FLAME_WHEEL
dbw 16, CHARM
dbw 20, AGILITY
dbw 24, FIRE_SPIN
dbw 28, FLAIL
dbw 32, CRUNCH
dbw 36, TAKE_DOWN
dbw 40, FLAMETHROWER
dbw 44, ROAR
dbw 48, EXTREMESPEED
dbw 52, REVERSAL
dbw 56, FIRE_BLAST
db 0 ; no more level-up moves
ArcanineEvosAttacks:
db 0 ; no more evolutions
dbw 1, EMBER
dbw 1, LEER
dbw 4, GROWL
dbw 9, BITE
dbw 14, FLAME_WHEEL
dbw 17, CHARM
dbw 22, AGILITY
dbw 26, FIRE_SPIN
dbw 31, FLAIL
dbw 35, CRUNCH
dbw 39, TAKE_DOWN
dbw 44, FLAMETHROWER
dbw 48, ROAR
dbw 53, EXTREMESPEED
dbw 57, REVERSAL
dbw 61, FIRE_BLAST
db 0 ; no more level-up moves
PoliwagEvosAttacks:
dbbw EVOLVE_LEVEL, 25, POLIWHIRL
db 0 ; no more evolutions
dbw 1, HYPNOSIS
dbw 1, WATER_GUN
dbw 6, POUND
dbw 12, MUD_SLAP
dbw 18, BUBBLEBEAM
dbw 24, RAIN_DANCE
dbw 27, BODY_SLAM
dbw 36, MAGNITUDE
dbw 42, HYDRO_PUMP
dbw 48, BELLY_DRUM
dbw 54, DOUBLE_EDGE
dbw 60, THRASH
db 0 ; no more level-up moves
PoliwhirlEvosAttacks:
dbbw EVOLVE_ITEM, WATER_STONE, POLIWRATH
dbbw EVOLVE_TRADE, KINGS_ROCK, POLITOED
db 0 ; no more evolutions
dbw 1, POUND
dbw 1, MUD_SLAP
dbw 1, BUBBLEBEAM
dbw 1, RAIN_DANCE
dbw 30, BODY_SLAM
dbw 38, MAGNITUDE
dbw 43, HYDRO_PUMP
dbw 51, BELLY_DRUM
dbw 56, DOUBLE_EDGE
dbw 65, THRASH
db 0 ; no more level-up moves
PoliwrathEvosAttacks:
db 0 ; no more evolutions
dbw 1, POUND
dbw 1, MUD_SLAP
dbw 1, BUBBLEBEAM
dbw 1, RAIN_DANCE
dbw 30, DETECT
dbw 34, BODY_SLAM
dbw 37, SUBMISSION
dbw 42, SWORDS_DANCE
dbw 48, MAGNITUDE
dbw 52, DOUBLE_EDGE
dbw 55, BELLY_DRUM
dbw 59, DYNAMICPUNCH
dbw 65, HYDRO_PUMP
dbw 73, THRASH
db 0 ; no more level-up moves
AbraEvosAttacks:
dbbw EVOLVE_LEVEL, 16, KADABRA
db 0 ; no more evolutions
dbw 1, TELEPORT
db 0 ; no more level-up moves
KadabraEvosAttacks:
dbbw EVOLVE_TRADE, -1, ALAKAZAM
db 0 ; no more evolutions
dbw 1, TELEPORT
dbw 1, KINESIS
dbw 1, CONFUSION
dbw 16, CONFUSION
dbw 18, DISABLE
dbw 21, PSYBEAM
dbw 26, RECOVER
dbw 31, FUTURE_SIGHT
dbw 38, PSYCHIC_M
dbw 45, REFLECT
db 0 ; no more level-up moves
AlakazamEvosAttacks:
db 0 ; no more evolutions
dbw 1, TELEPORT
dbw 1, KINESIS
dbw 1, CONFUSION
dbw 16, CONFUSION
dbw 18, DISABLE
dbw 21, PSYBEAM
dbw 26, RECOVER
dbw 31, FUTURE_SIGHT
dbw 38, PSYCHIC_M
dbw 45, REFLECT
db 0 ; no more level-up moves
MachopEvosAttacks:
dbbw EVOLVE_LEVEL, 28, MACHOKE
db 0 ; no more evolutions
dbw 1, LOW_KICK
dbw 1, LEER
dbw 7, FOCUS_ENERGY
dbw 13, KARATE_CHOP
dbw 19, SEISMIC_TOSS
dbw 25, FORESIGHT
dbw 31, VITAL_THROW
dbw 37, CROSS_CHOP
dbw 43, SCARY_FACE
dbw 49, SUBMISSION
db 0 ; no more level-up moves
MachokeEvosAttacks:
dbbw EVOLVE_TRADE, -1, MACHAMP
db 0 ; no more evolutions
dbw 1, LOW_KICK
dbw 1, LEER
dbw 1, FOCUS_ENERGY
dbw 8, FOCUS_ENERGY
dbw 15, KARATE_CHOP
dbw 19, SEISMIC_TOSS
dbw 25, FORESIGHT
dbw 34, VITAL_THROW
dbw 43, CROSS_CHOP
dbw 52, SCARY_FACE
dbw 61, SUBMISSION
db 0 ; no more level-up moves
MachampEvosAttacks:
db 0 ; no more evolutions
dbw 1, LOW_KICK
dbw 1, LEER
dbw 1, FOCUS_ENERGY
dbw 8, FOCUS_ENERGY
dbw 15, KARATE_CHOP
dbw 19, SEISMIC_TOSS
dbw 25, FORESIGHT
dbw 34, VITAL_THROW
dbw 43, CROSS_CHOP
dbw 52, SCARY_FACE
dbw 61, SUBMISSION
db 0 ; no more level-up moves
BellsproutEvosAttacks:
dbbw EVOLVE_LEVEL, 21, WEEPINBELL
db 0 ; no more evolutions
dbw 1, VINE_WHIP
dbw 1, WRAP
dbw 7, GROWTH
dbw 11, SLEEP_POWDER
dbw 13, CONSTRICT
dbw 15, POISONPOWDER
dbw 17, ACID
dbw 20, RAZOR_LEAF
dbw 23, STUN_SPORE
dbw 27, THIEF
dbw 29, SWEET_SCENT
dbw 35, SLUDGE
dbw 39, ENERGY_BALL
dbw 41, SLUDGE_BOMB
dbw 47, SLAM
dbw 51, SOLARBEAM
dbw 55, THRASH
db 0 ; no more level-up moves
WeepinbellEvosAttacks:
dbbw EVOLVE_ITEM, LEAF_STONE, VICTREEBEL
db 0 ; no more evolutions
dbw 1, CONSTRICT
dbw 1, POISONPOWDER
dbw 1, ACID
dbw 1, RAZOR_LEAF
dbw 24, STUN_SPORE
dbw 28, THIEF
dbw 30, SWEET_SCENT
dbw 37, SLUDGE
dbw 42, ENERGY_BALL
dbw 44, SLUDGE_BOMB
dbw 53, SLAM
dbw 55, SOLARBEAM
dbw 61, THRASH
db 0 ; no more level-up moves
VictreebelEvosAttacks:
db 0 ; no more evolutions
dbw 1, CONSTRICT
dbw 1, POISONPOWDER
dbw 1, ACID
dbw 1, RAZOR_LEAF
dbw 24, STUN_SPORE
dbw 29, THIEF
dbw 31, SWEET_SCENT
dbw 39, SLUDGE
dbw 45, ENERGY_BALL
dbw 49, SLUDGE_BOMB
dbw 56, SLAM
dbw 60, SOLARBEAM
dbw 65, THRASH
db 0 ; no more level-up moves
TentacoolEvosAttacks:
dbbw EVOLVE_LEVEL, 30, TENTACRUEL
db 0 ; no more evolutions
dbw 1, POISON_STING
dbw 6, SUPERSONIC
dbw 12, CONSTRICT
dbw 19, ACID
dbw 25, BUBBLEBEAM
dbw 30, WRAP
dbw 36, BARRIER
dbw 43, SCREECH
dbw 49, HYDRO_PUMP
db 0 ; no more level-up moves
TentacruelEvosAttacks:
db 0 ; no more evolutions
dbw 1, POISON_STING
dbw 1, SUPERSONIC
dbw 1, CONSTRICT
dbw 6, SUPERSONIC
dbw 12, CONSTRICT
dbw 19, ACID
dbw 25, BUBBLEBEAM
dbw 30, WRAP
dbw 38, BARRIER
dbw 47, SCREECH
dbw 55, HYDRO_PUMP
db 0 ; no more level-up moves
GeodudeEvosAttacks:
dbbw EVOLVE_LEVEL, 25, GRAVELER
db 0 ; no more evolutions
dbw 1, DEFENSE_CURL
dbw 1, RAPID_SPIN
dbw 4, MUD_SLAP
dbw 6, AGILITY
dbw 10, ROLLOUT
dbw 12, MAGNITUDE
dbw 16, ROCK_THROW
dbw 18, ARM_THRUST
dbw 22, IRON_HEAD
dbw 24, SELFDESTRUCT
dbw 30, ROCK_TOMB
dbw 32, EARTHQUAKE
dbw 36, EXPLOSION
dbw 40, DOUBLE_EDGE
dbw 42, STONE_EDGE
db 0 ; no more level-up moves
GravelerEvosAttacks:
dbbw EVOLVE_LEVEL, 41, GOLEM
db 0 ; no more evolutions
dbw 1, ROCK_THROW
dbw 1, ARM_THRUST
dbw 1, IRON_HEAD
dbw 1, SELFDESTRUCT
dbw 30, ROCK_TOMB
dbw 34, EARTHQUAKE
dbw 41, EXPLOSION
dbw 45, DOUBLE_EDGE
dbw 50, STONE_EDGE
db 0 ; no more level-up moves
GolemEvosAttacks:
db 0 ; no more evolutions
dbw 1, IRON_HEAD
dbw 1, SELFDESTRUCT
dbw 1, ROCK_TOMB
dbw 1, EARTHQUAKE
dbw 44, EXPLOSION
dbw 50, DOUBLE_EDGE
dbw 54, STONE_EDGE
db 0 ; no more level-up moves
PonytaEvosAttacks:
dbbw EVOLVE_LEVEL, 40, RAPIDASH
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 4, GROWL
dbw 8, TAIL_WHIP
dbw 13, EMBER
dbw 19, STOMP
dbw 26, FIRE_SPIN
dbw 34, TAKE_DOWN
dbw 43, AGILITY
dbw 53, FIRE_BLAST
db 0 ; no more level-up moves
RapidashEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, GROWL
dbw 1, TAIL_WHIP
dbw 1, EMBER
dbw 4, GROWL
dbw 8, TAIL_WHIP
dbw 13, EMBER
dbw 19, STOMP
dbw 26, FIRE_SPIN
dbw 34, TAKE_DOWN
dbw 40, FURY_ATTACK
dbw 47, AGILITY
dbw 61, FIRE_BLAST
db 0 ; no more level-up moves
SlowpokeEvosAttacks:
dbbw EVOLVE_LEVEL, 37, SLOWBRO
dbbw EVOLVE_TRADE, KINGS_ROCK, SLOWKING
db 0 ; no more evolutions
dbw 1, CURSE
dbw 1, TACKLE
dbw 6, GROWL
dbw 15, WATER_GUN
dbw 20, CONFUSION
dbw 29, DISABLE
dbw 34, HEADBUTT
dbw 43, AMNESIA
dbw 48, PSYCHIC_M
db 0 ; no more level-up moves
SlowbroEvosAttacks:
db 0 ; no more evolutions
dbw 1, CURSE
dbw 1, TACKLE
dbw 1, GROWL
dbw 1, WATER_GUN
dbw 6, GROWL
dbw 15, WATER_GUN
dbw 20, CONFUSION
dbw 29, DISABLE
dbw 34, HEADBUTT
dbw 37, WITHDRAW
dbw 46, AMNESIA
dbw 54, PSYCHIC_M
db 0 ; no more level-up moves
MagnemiteEvosAttacks:
dbbw EVOLVE_LEVEL, 30, MAGNETON
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 6, THUNDERSHOCK
dbw 11, SUPERSONIC
dbw 16, SONICBOOM
dbw 21, THUNDER_WAVE
dbw 27, LOCK_ON
dbw 33, SWIFT
dbw 39, SCREECH
dbw 45, ZAP_CANNON
db 0 ; no more level-up moves
MagnetonEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, THUNDERSHOCK
dbw 1, SUPERSONIC
dbw 1, SONICBOOM
dbw 6, THUNDERSHOCK
dbw 11, SUPERSONIC
dbw 16, SONICBOOM
dbw 21, THUNDER_WAVE
dbw 27, LOCK_ON
dbw 35, TRI_ATTACK
dbw 43, SCREECH
dbw 53, ZAP_CANNON
db 0 ; no more level-up moves
FarfetchDEvosAttacks:
db 0 ; no more evolutions
dbw 1, PECK
dbw 7, SAND_ATTACK
dbw 13, LEER
dbw 19, FURY_ATTACK
dbw 25, SWORDS_DANCE
dbw 31, AGILITY
dbw 37, SLASH
dbw 44, FALSE_SWIPE
db 0 ; no more level-up moves
DoduoEvosAttacks:
dbbw EVOLVE_LEVEL, 31, DODRIO
db 0 ; no more evolutions
dbw 1, PECK
dbw 1, GROWL
dbw 9, PURSUIT
dbw 13, FURY_ATTACK
dbw 21, TRI_ATTACK
dbw 25, RAGE
dbw 33, DRILL_PECK
dbw 37, AGILITY
db 0 ; no more level-up moves
DodrioEvosAttacks:
db 0 ; no more evolutions
dbw 1, PECK
dbw 1, GROWL
dbw 1, PURSUIT
dbw 1, FURY_ATTACK
dbw 9, PURSUIT
dbw 13, FURY_ATTACK
dbw 21, TRI_ATTACK
dbw 25, RAGE
dbw 38, DRILL_PECK
dbw 47, AGILITY
db 0 ; no more level-up moves
SeelEvosAttacks:
dbbw EVOLVE_LEVEL, 34, DEWGONG
db 0 ; no more evolutions
dbw 1, HEADBUTT
dbw 5, GROWL
dbw 16, AURORA_BEAM
dbw 21, REST
dbw 32, TAKE_DOWN
dbw 37, ICE_BEAM
dbw 48, SAFEGUARD
db 0 ; no more level-up moves
DewgongEvosAttacks:
db 0 ; no more evolutions
dbw 1, HEADBUTT
dbw 1, GROWL
dbw 1, AURORA_BEAM
dbw 5, GROWL
dbw 16, AURORA_BEAM
dbw 21, REST
dbw 32, TAKE_DOWN
dbw 43, ICE_BEAM
dbw 60, SAFEGUARD
db 0 ; no more level-up moves
GrimerEvosAttacks:
dbbw EVOLVE_LEVEL, 38, MUK
db 0 ; no more evolutions
dbw 1, POISON_GAS
dbw 1, POUND
dbw 5, HARDEN
dbw 10, DISABLE
dbw 16, SLUDGE
dbw 23, MINIMIZE
dbw 31, SCREECH
dbw 40, ACID_ARMOR
dbw 50, SLUDGE_BOMB
db 0 ; no more level-up moves
MukEvosAttacks:
db 0 ; no more evolutions
dbw 1, POISON_GAS
dbw 1, POUND
dbw 1, HARDEN
dbw 33, HARDEN
dbw 37, DISABLE
dbw 45, SLUDGE
dbw 23, MINIMIZE
dbw 31, SCREECH
dbw 45, ACID_ARMOR
dbw 60, SLUDGE_BOMB
db 0 ; no more level-up moves
ShellderEvosAttacks:
dbbw EVOLVE_ITEM, WATER_STONE, CLOYSTER
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, WITHDRAW
dbw 9, SUPERSONIC
dbw 17, AURORA_BEAM
dbw 25, PROTECT
dbw 33, LEER
dbw 41, CLAMP
dbw 49, ICE_BEAM
db 0 ; no more level-up moves
CloysterEvosAttacks:
db 0 ; no more evolutions
dbw 1, WITHDRAW
dbw 1, SUPERSONIC
dbw 1, AURORA_BEAM
dbw 1, PROTECT
dbw 33, SPIKES
dbw 41, SPIKE_CANNON
db 0 ; no more level-up moves
GastlyEvosAttacks:
dbbw EVOLVE_LEVEL, 25, HAUNTER
db 0 ; no more evolutions
dbw 1, CONFUSE_RAY
dbw 1, LICK
dbw 9, HYPNOSIS
dbw 12, PURSUIT
dbw 16, SPITE
dbw 20, CURSE
dbw 24, SLUDGE
dbw 28, NIGHT_SHADE
dbw 32, NASTY_PLOT
dbw 36, DARK_PULSE
dbw 40, SHADOW_BALL
dbw 44, DESTINY_BOND
dbw 48, HYPNOSIS
dbw 50, DREAM_EATER
dbw 53, GUNK_SHOT
db 0 ; no more level-up moves
HaunterEvosAttacks:
dbbw EVOLVE_LEVEL, 40, HAUNTER
db 0 ; no more evolutions
dbw 1, PURSUIT
dbw 1, SPITE
dbw 1, CURSE
dbw 1, SLUDGE
dbw 30, NIGHT_SHADE
dbw 36, NASTY_PLOT
dbw 41, DARK_PULSE
dbw 47, SHADOW_BALL
dbw 52, DESTINY_BOND
dbw 54, HYPNOSIS
dbw 57, DREAM_EATER
dbw 62, GUNK_SHOT
db 0 ; no more level-up moves
GengarEvosAttacks:
db 0 ; no more evolutions
dbw 1, CURSE
dbw 1, SLUDGE
dbw 1, NIGHT_SHADE
dbw 1, NASTY_PLOT
dbw 42, DARK_PULSE
dbw 48, SHADOW_BALL
dbw 54, DESTINY_BOND
dbw 56, HYPNOSIS
dbw 60, DREAM_EATER
dbw 68, GUNK_SHOT
db 0 ; no more level-up moves
OnixEvosAttacks:
dbbw EVOLVE_TRADE, METAL_COAT, STEELIX
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, SCREECH
dbw 10, BIND
dbw 14, ROCK_THROW
dbw 23, HARDEN
dbw 27, RAGE
dbw 36, SANDSTORM
dbw 40, SLAM
db 0 ; no more level-up moves
DrowzeeEvosAttacks:
dbbw EVOLVE_LEVEL, 26, HYPNO
db 0 ; no more evolutions
dbw 1, POUND
dbw 1, HYPNOSIS
dbw 10, DISABLE
dbw 18, CONFUSION
dbw 25, HEADBUTT
dbw 31, POISON_GAS
dbw 36, MEDITATE
dbw 40, PSYCHIC_M
dbw 43, PSYCH_UP
dbw 45, FUTURE_SIGHT
db 0 ; no more level-up moves
HypnoEvosAttacks:
db 0 ; no more evolutions
dbw 1, POUND
dbw 1, HYPNOSIS
dbw 1, DISABLE
dbw 1, CONFUSION
dbw 10, DISABLE
dbw 18, CONFUSION
dbw 25, HEADBUTT
dbw 33, POISON_GAS
dbw 40, MEDITATE
dbw 49, PSYCHIC_M
dbw 55, PSYCH_UP
dbw 60, FUTURE_SIGHT
db 0 ; no more level-up moves
KrabbyEvosAttacks:
dbbw EVOLVE_LEVEL, 28, KINGLER
db 0 ; no more evolutions
dbw 1, BUBBLE
dbw 5, LEER
dbw 12, VICEGRIP
dbw 16, HARDEN
dbw 23, STOMP
dbw 27, GUILLOTINE
dbw 34, PROTECT
dbw 41, CRABHAMMER
db 0 ; no more level-up moves
KinglerEvosAttacks:
db 0 ; no more evolutions
dbw 1, BUBBLE
dbw 1, LEER
dbw 1, VICEGRIP
dbw 5, LEER
dbw 12, VICEGRIP
dbw 16, HARDEN
dbw 23, STOMP
dbw 27, GUILLOTINE
dbw 38, PROTECT
dbw 49, CRABHAMMER
db 0 ; no more level-up moves
VoltorbEvosAttacks:
dbbw EVOLVE_LEVEL, 30, ELECTRODE
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 9, SCREECH
dbw 17, SONICBOOM
dbw 23, SELFDESTRUCT
dbw 29, ROLLOUT
dbw 33, LIGHT_SCREEN
dbw 37, SWIFT
dbw 39, EXPLOSION
dbw 41, MIRROR_COAT
db 0 ; no more level-up moves
ElectrodeEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, SCREECH
dbw 1, SONICBOOM
dbw 1, SELFDESTRUCT
dbw 9, SCREECH
dbw 17, SONICBOOM
dbw 23, SELFDESTRUCT
dbw 29, ROLLOUT
dbw 34, LIGHT_SCREEN
dbw 40, SWIFT
dbw 44, EXPLOSION
dbw 48, MIRROR_COAT
db 0 ; no more level-up moves
ExeggcuteEvosAttacks:
dbbw EVOLVE_ITEM, LEAF_STONE, EXEGGUTOR
db 0 ; no more evolutions
dbw 1, BARRAGE
dbw 1, HYPNOSIS
dbw 7, REFLECT
dbw 13, LEECH_SEED
dbw 19, CONFUSION
dbw 25, STUN_SPORE
dbw 31, POISONPOWDER
dbw 37, SLEEP_POWDER
dbw 43, SOLARBEAM
db 0 ; no more level-up moves
ExeggutorEvosAttacks:
db 0 ; no more evolutions
dbw 1, BARRAGE
dbw 1, HYPNOSIS
dbw 1, CONFUSION
dbw 19, STOMP
dbw 31, EGG_BOMB
db 0 ; no more level-up moves
CuboneEvosAttacks:
dbbw EVOLVE_LEVEL, 28, MAROWAK
db 0 ; no more evolutions
dbw 1, GROWL
dbw 5, TAIL_WHIP
dbw 9, BONE_CLUB
dbw 13, HEADBUTT
dbw 17, LEER
dbw 21, FOCUS_ENERGY
dbw 25, BONEMERANG
dbw 29, RAGE
dbw 33, FALSE_SWIPE
dbw 37, THRASH
dbw 41, BONE_RUSH
db 0 ; no more level-up moves
MarowakEvosAttacks:
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, TAIL_WHIP
dbw 1, BONE_CLUB
dbw 1, HEADBUTT
dbw 5, TAIL_WHIP
dbw 9, BONE_CLUB
dbw 13, HEADBUTT
dbw 17, LEER
dbw 21, FOCUS_ENERGY
dbw 25, BONEMERANG
dbw 32, RAGE
dbw 39, FALSE_SWIPE
dbw 46, THRASH
dbw 53, BONE_RUSH
db 0 ; no more level-up moves
HitmonleeEvosAttacks:
db 0 ; no more evolutions
dbw 1, DOUBLE_KICK
dbw 6, MEDITATE
dbw 11, ROLLING_KICK
dbw 16, JUMP_KICK
dbw 21, FOCUS_ENERGY
dbw 26, HI_JUMP_KICK
dbw 31, MIND_READER
dbw 36, FORESIGHT
dbw 41, ENDURE
dbw 46, MEGA_KICK
dbw 51, REVERSAL
db 0 ; no more level-up moves
HitmonchanEvosAttacks:
db 0 ; no more evolutions
dbw 1, COMET_PUNCH
dbw 7, AGILITY
dbw 13, PURSUIT
dbw 26, THUNDERPUNCH
dbw 26, ICE_PUNCH
dbw 26, FIRE_PUNCH
dbw 32, MACH_PUNCH
dbw 38, MEGA_PUNCH
dbw 44, DETECT
dbw 50, COUNTER
db 0 ; no more level-up moves
LickitungEvosAttacks:
db 0 ; no more evolutions
dbw 1, LICK
dbw 7, SUPERSONIC
dbw 13, DEFENSE_CURL
dbw 19, STOMP
dbw 25, WRAP
dbw 31, DISABLE
dbw 37, SLAM
dbw 43, SCREECH
db 0 ; no more level-up moves
KoffingEvosAttacks:
dbbw EVOLVE_LEVEL, 35, WEEZING
db 0 ; no more evolutions
dbw 1, POISON_GAS
dbw 1, TACKLE
dbw 9, SMOG
dbw 17, SELFDESTRUCT
dbw 21, SLUDGE
dbw 25, SMOKESCREEN
dbw 33, HAZE
dbw 41, EXPLOSION
dbw 45, DESTINY_BOND
db 0 ; no more level-up moves
WeezingEvosAttacks:
db 0 ; no more evolutions
dbw 1, POISON_GAS
dbw 1, TACKLE
dbw 1, SMOG
dbw 1, SELFDESTRUCT
dbw 9, SMOG
dbw 17, SELFDESTRUCT
dbw 21, SLUDGE
dbw 25, SMOKESCREEN
dbw 33, HAZE
dbw 44, EXPLOSION
dbw 51, DESTINY_BOND
db 0 ; no more level-up moves
RhyhornEvosAttacks:
dbbw EVOLVE_LEVEL, 42, RHYDON
db 0 ; no more evolutions
dbw 1, HORN_ATTACK
dbw 1, TAIL_WHIP
dbw 13, STOMP
dbw 19, FURY_ATTACK
dbw 31, SCARY_FACE
dbw 37, HORN_DRILL
dbw 49, TAKE_DOWN
dbw 55, EARTHQUAKE
db 0 ; no more level-up moves
RhydonEvosAttacks:
db 0 ; no more evolutions
dbw 1, HORN_ATTACK
dbw 1, TAIL_WHIP
dbw 1, STOMP
dbw 1, FURY_ATTACK
dbw 13, STOMP
dbw 19, FURY_ATTACK
dbw 31, SCARY_FACE
dbw 37, HORN_DRILL
dbw 54, TAKE_DOWN
dbw 65, EARTHQUAKE
db 0 ; no more level-up moves
ChanseyEvosAttacks:
dbbw EVOLVE_HAPPINESS, TR_ANYTIME, BLISSEY
db 0 ; no more evolutions
dbw 1, POUND
dbw 5, GROWL
dbw 9, TAIL_WHIP
dbw 13, SOFTBOILED
dbw 17, DOUBLESLAP
dbw 23, MINIMIZE
dbw 29, SING
dbw 35, EGG_BOMB
dbw 41, DEFENSE_CURL
dbw 49, LIGHT_SCREEN
dbw 57, DOUBLE_EDGE
db 0 ; no more level-up moves
TangelaEvosAttacks:
db 0 ; no more evolutions
dbw 1, ABSORB
dbw 1, BIND
dbw 4, POISONPOWDER
dbw 7, VINE_WHIP
dbw 10, STUN_SPORE
dbw 14, SLEEP_POWDER
dbw 17, GROWTH
dbw 20, MEGA_DRAIN
dbw 23, SYNTHESIS
dbw 27, FAINT_ATTACK
dbw 30, SWEET_SCENT
dbw 34, GIGA_DRAIN
dbw 38, ANCIENTPOWER
dbw 41, BODY_SLAM
dbw 44, MIMIC
dbw 47, SOLARBEAM
dbw 51, TOXIC
db 0 ; no more level-up moves
KangaskhanEvosAttacks:
db 0 ; no more evolutions
dbw 1, COMET_PUNCH
dbw 7, LEER
dbw 13, BITE
dbw 19, TAIL_WHIP
dbw 25, MEGA_PUNCH
dbw 31, RAGE
dbw 37, ENDURE
dbw 43, DIZZY_PUNCH
dbw 49, REVERSAL
db 0 ; no more level-up moves
HorseaEvosAttacks:
dbbw EVOLVE_LEVEL, 32, SEADRA
db 0 ; no more evolutions
dbw 1, BUBBLE
dbw 8, SMOKESCREEN
dbw 15, LEER
dbw 22, WATER_GUN
dbw 29, TWISTER
dbw 36, AGILITY
dbw 43, HYDRO_PUMP
db 0 ; no more level-up moves
SeadraEvosAttacks:
dbbw EVOLVE_TRADE, DRAGON_SCALE, KINGDRA
db 0 ; no more evolutions
dbw 1, BUBBLE
dbw 1, SMOKESCREEN
dbw 1, LEER
dbw 1, WATER_GUN
dbw 8, SMOKESCREEN
dbw 15, LEER
dbw 22, WATER_GUN
dbw 29, TWISTER
dbw 40, AGILITY
dbw 51, HYDRO_PUMP
db 0 ; no more level-up moves
GoldeenEvosAttacks:
dbbw EVOLVE_LEVEL, 33, SEAKING
db 0 ; no more evolutions
dbw 1, PECK
dbw 1, TAIL_WHIP
dbw 10, SUPERSONIC
dbw 15, HORN_ATTACK
dbw 24, FLAIL
dbw 29, FURY_ATTACK
dbw 38, WATERFALL
dbw 43, HORN_DRILL
dbw 52, AGILITY
db 0 ; no more level-up moves
SeakingEvosAttacks:
db 0 ; no more evolutions
dbw 1, PECK
dbw 1, TAIL_WHIP
dbw 1, TAIL_WHIP
dbw 10, SUPERSONIC
dbw 15, HORN_ATTACK
dbw 24, FLAIL
dbw 29, FURY_ATTACK
dbw 41, WATERFALL
dbw 49, HORN_DRILL
dbw 61, AGILITY
db 0 ; no more level-up moves
StaryuEvosAttacks:
dbbw EVOLVE_ITEM, WATER_STONE, STARMIE
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, HARDEN
dbw 7, WATER_GUN
dbw 13, RAPID_SPIN
dbw 19, RECOVER
dbw 25, SWIFT
dbw 31, BUBBLEBEAM
dbw 37, MINIMIZE
dbw 43, LIGHT_SCREEN
dbw 50, HYDRO_PUMP
db 0 ; no more level-up moves
StarmieEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 1, RAPID_SPIN
dbw 1, RECOVER
dbw 1, BUBBLEBEAM
dbw 37, CONFUSE_RAY
db 0 ; no more level-up moves
MrMimeEvosAttacks:
db 0 ; no more evolutions
dbw 1, BARRIER
dbw 6, CONFUSION
dbw 11, SUBSTITUTE
dbw 16, MEDITATE
dbw 21, DOUBLESLAP
dbw 26, LIGHT_SCREEN
dbw 26, REFLECT
dbw 31, ENCORE
dbw 36, PSYBEAM
dbw 41, BATON_PASS
dbw 46, SAFEGUARD
db 0 ; no more level-up moves
ScytherEvosAttacks:
dbbw EVOLVE_TRADE, METAL_COAT, SCIZOR
db 0 ; no more evolutions
dbw 1, QUICK_ATTACK
dbw 1, LEER
dbw 6, FOCUS_ENERGY
dbw 12, PURSUIT
dbw 18, FALSE_SWIPE
dbw 24, AGILITY
dbw 30, WING_ATTACK
dbw 36, SLASH
dbw 42, SWORDS_DANCE
dbw 48, DOUBLE_TEAM
db 0 ; no more level-up moves
JynxEvosAttacks:
db 0 ; no more evolutions
dbw 1, POUND
dbw 1, LICK
dbw 1, LOVELY_KISS
dbw 1, POWDER_SNOW
dbw 9, LOVELY_KISS
dbw 13, POWDER_SNOW
dbw 21, DOUBLESLAP
dbw 25, ICE_PUNCH
dbw 35, MEAN_LOOK
dbw 41, BODY_SLAM
dbw 51, PERISH_SONG
dbw 57, BLIZZARD
db 0 ; no more level-up moves
ElectabuzzEvosAttacks:
db 0 ; no more evolutions
dbw 1, REFLECT
dbw 1, THUNDER_WAVE
dbw 1, SCREECH
dbw 1, THUNDERPUNCH
dbw 34, SWAGGER
dbw 40, LOW_KICK
dbw 46, THUNDERBOLT
dbw 52, LIGHT_SCREEN
dbw 58, THUNDER
dbw 64, HYPER_BEAM
db 0 ; no more level-up moves
MagmarEvosAttacks:
db 0 ; no more evolutions
dbw 1, EMBER
dbw 1, LEER
dbw 1, SMOG
dbw 1, FIRE_PUNCH
dbw 7, LEER
dbw 13, SMOG
dbw 19, FIRE_PUNCH
dbw 25, SMOKESCREEN
dbw 33, SUNNY_DAY
dbw 41, FLAMETHROWER
dbw 49, CONFUSE_RAY
dbw 57, FIRE_BLAST
db 0 ; no more level-up moves
PinsirEvosAttacks:
db 0 ; no more evolutions
dbw 1, VICEGRIP
dbw 7, FOCUS_ENERGY
dbw 13, BIND
dbw 19, SEISMIC_TOSS
dbw 25, HARDEN
dbw 31, GUILLOTINE
dbw 37, SUBMISSION
dbw 43, SWORDS_DANCE
db 0 ; no more level-up moves
TaurosEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 4, TAIL_WHIP
dbw 8, RAGE
dbw 13, HORN_ATTACK
dbw 19, SCARY_FACE
dbw 26, PURSUIT
dbw 34, REST
dbw 43, THRASH
dbw 53, TAKE_DOWN
db 0 ; no more level-up moves
MagikarpEvosAttacks:
dbbw EVOLVE_LEVEL, 20, GYARADOS
db 0 ; no more evolutions
dbw 1, SPLASH
dbw 15, TACKLE
dbw 30, FLAIL
db 0 ; no more level-up moves
GyaradosEvosAttacks:
db 0 ; no more evolutions
dbw 1, THRASH
dbw 20, BITE
dbw 25, DRAGON_RAGE
dbw 30, LEER
dbw 35, TWISTER
dbw 40, HYDRO_PUMP
dbw 45, RAIN_DANCE
dbw 50, HYPER_BEAM
db 0 ; no more level-up moves
LaprasEvosAttacks:
db 0 ; no more evolutions
dbw 1, WATER_GUN
dbw 1, GROWL
dbw 1, SING
dbw 8, MIST
dbw 15, BODY_SLAM
dbw 22, CONFUSE_RAY
dbw 29, PERISH_SONG
dbw 36, ICE_BEAM
dbw 43, RAIN_DANCE
dbw 50, SAFEGUARD
dbw 57, HYDRO_PUMP
db 0 ; no more level-up moves
DittoEvosAttacks:
db 0 ; no more evolutions
dbw 1, TRANSFORM
db 0 ; no more level-up moves
EeveeEvosAttacks:
dbbw EVOLVE_ITEM, THUNDERSTONE, JOLTEON
dbbw EVOLVE_ITEM, WATER_STONE, VAPOREON
dbbw EVOLVE_ITEM, FIRE_STONE, FLAREON
dbbw EVOLVE_HAPPINESS, TR_MORNDAY, ESPEON
dbbw EVOLVE_HAPPINESS, TR_NITE, UMBREON
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, TACKLE
dbw 1, TAIL_WHIP
dbw 5, SAND_ATTACK
dbw 10, QUICK_ATTACK
dbw 15, CHARM
dbw 20, SWIFT
dbw 25, BITE
dbw 30, MIRROR_MOVE
dbw 35, BATON_PASS
dbw 40, TAKE_DOWN
dbw 45, PROTECT
dbw 50, DOUBLE_EDGE
db 0 ; no more level-up moves
VaporeonEvosAttacks:
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, TACKLE
dbw 1, TAIL_WHIP
dbw 5, SAND_ATTACK
dbw 10, QUICK_ATTACK
dbw 15, CHARM
dbw 20, HAZE
dbw 25, BUBBLEBEAM
dbw 30, AURORA_BEAM
dbw 35, RECOVER
dbw 40, NASTY_PLOT
dbw 45, ACID_ARMOR
dbw 50, HYDRO_PUMP
dbw 55, ICE_BEAM
dbw 60, SIGNAL_BEAM
db 0 ; no more level-up moves
JolteonEvosAttacks:
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, TACKLE
dbw 1, TAIL_WHIP
dbw 5, SAND_ATTACK
dbw 10, QUICK_ATTACK
dbw 15, CHARM
dbw 20, THUNDER_WAVE
dbw 25, DOUBLE_KICK
dbw 30, SPARK
dbw 35, PIN_MISSILE
dbw 40, NASTY_PLOT
dbw 45, AGILITY
dbw 50, THUNDER
dbw 55, IRON_HEAD
dbw 60, EXPLOSION
db 0 ; no more level-up moves
FlareonEvosAttacks:
db 0 ; no more evolutions
dbw 1, GROWL
dbw 1, TACKLE
dbw 1, TAIL_WHIP
dbw 5, SAND_ATTACK
dbw 10, QUICK_ATTACK
dbw 15, CHARM
dbw 20, SMOG
dbw 25, HEADBUTT
dbw 30, FLAME_WHEEL
dbw 35, FIRE_SPIN
dbw 40, NASTY_PLOT
dbw 45, SCARY_FACE
dbw 50, FIRE_BLAST
dbw 55, STONE_EDGE
dbw 60, SHADOW_BALL
db 0 ; no more level-up moves
PorygonEvosAttacks:
dbbw EVOLVE_TRADE, UP_GRADE, PORYGON2
db 0 ; no more evolutions
dbw 1, CONVERSION2
dbw 1, TACKLE
dbw 1, CONVERSION
dbw 9, AGILITY
dbw 12, PSYBEAM
dbw 20, RECOVER
dbw 24, SHARPEN
dbw 32, LOCK_ON
dbw 36, TRI_ATTACK
dbw 44, ZAP_CANNON
db 0 ; no more level-up moves
OmanyteEvosAttacks:
dbbw EVOLVE_LEVEL, 40, OMASTAR
db 0 ; no more evolutions
dbw 1, CONSTRICT
dbw 1, WITHDRAW
dbw 13, BITE
dbw 19, WATER_GUN
dbw 31, LEER
dbw 37, PROTECT
dbw 49, ANCIENTPOWER
dbw 55, HYDRO_PUMP
db 0 ; no more level-up moves
OmastarEvosAttacks:
db 0 ; no more evolutions
dbw 1, CONSTRICT
dbw 1, WITHDRAW
dbw 1, BITE
dbw 13, BITE
dbw 19, WATER_GUN
dbw 31, LEER
dbw 37, PROTECT
dbw 40, SPIKE_CANNON
dbw 54, ANCIENTPOWER
dbw 65, HYDRO_PUMP
db 0 ; no more level-up moves
KabutoEvosAttacks:
dbbw EVOLVE_LEVEL, 40, KABUTOPS
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, HARDEN
dbw 10, ABSORB
dbw 19, LEER
dbw 28, SAND_ATTACK
dbw 37, ENDURE
dbw 46, MEGA_DRAIN
dbw 55, ANCIENTPOWER
db 0 ; no more level-up moves
KabutopsEvosAttacks:
db 0 ; no more evolutions
dbw 1, SCRATCH
dbw 1, HARDEN
dbw 1, ABSORB
dbw 10, ABSORB
dbw 19, LEER
dbw 28, SAND_ATTACK
dbw 37, ENDURE
dbw 40, SLASH
dbw 51, MEGA_DRAIN
dbw 65, ANCIENTPOWER
db 0 ; no more level-up moves
AerodactylEvosAttacks:
db 0 ; no more evolutions
dbw 1, WING_ATTACK
dbw 8, AGILITY
dbw 15, BITE
dbw 22, SUPERSONIC
dbw 29, ANCIENTPOWER
dbw 36, SCARY_FACE
dbw 43, TAKE_DOWN
dbw 50, HYPER_BEAM
db 0 ; no more level-up moves
SnorlaxEvosAttacks:
db 0 ; no more evolutions
dbw 1, TACKLE
dbw 8, AMNESIA
dbw 15, DEFENSE_CURL
dbw 22, BELLY_DRUM
dbw 29, HEADBUTT
dbw 36, SNORE
dbw 36, REST
dbw 43, BODY_SLAM
dbw 50, ROLLOUT
dbw 57, HYPER_BEAM
db 0 ; no more level-up moves
ArticunoEvosAttacks:
db 0 ; no more evolutions
dbw 1, GUST
dbw 1, POWDER_SNOW
dbw 13, MIST
dbw 25, AGILITY
dbw 37, MIND_READER
dbw 49, ICE_BEAM
dbw 61, REFLECT
dbw 73, BLIZZARD
db 0 ; no more level-up moves
ZapdosEvosAttacks:
db 0 ; no more evolutions
dbw 1, PECK
dbw 1, THUNDERSHOCK
dbw 13, THUNDER_WAVE
dbw 25, AGILITY
dbw 37, DETECT
dbw 49, DRILL_PECK
dbw 61, LIGHT_SCREEN
dbw 73, THUNDER
db 0 ; no more level-up moves
MoltresEvosAttacks:
db 0 ; no more evolutions
dbw 1, WING_ATTACK
dbw 1, EMBER
dbw 13, FIRE_SPIN
dbw 25, AGILITY
dbw 37, ENDURE
dbw 49, FLAMETHROWER
dbw 61, SAFEGUARD
dbw 73, SKY_ATTACK
db 0 ; no more level-up moves
DratiniEvosAttacks:
dbbw EVOLVE_LEVEL, 30, DRAGONAIR
db 0 ; no more evolutions
dbw 1, WRAP
dbw 1, LEER
dbw 8, THUNDER_WAVE
dbw 15, TWISTER
dbw 22, DRAGON_RAGE
dbw 29, SLAM
dbw 36, AGILITY
dbw 43, SAFEGUARD
dbw 50, OUTRAGE
dbw 57, HYPER_BEAM
db 0 ; no more level-up moves
DragonairEvosAttacks:
dbbw EVOLVE_LEVEL, 55, DRAGONITE
db 0 ; no more evolutions
dbw 1, WRAP
dbw 1, LEER
dbw 1, THUNDER_WAVE
dbw 1, TWISTER
dbw 8, THUNDER_WAVE
dbw 15, TWISTER
dbw 22, DRAGON_RAGE
dbw 29, SLAM
dbw 38, AGILITY
dbw 47, SAFEGUARD
dbw 56, OUTRAGE
dbw 65, HYPER_BEAM
db 0 ; no more level-up moves
DragoniteEvosAttacks:
db 0 ; no more evolutions
dbw 1, WRAP
dbw 1, LEER
dbw 1, THUNDER_WAVE
dbw 1, TWISTER
dbw 8, THUNDER_WAVE
dbw 15, TWISTER
dbw 22, DRAGON_RAGE
dbw 29, SLAM
dbw 38, AGILITY
dbw 47, SAFEGUARD
dbw 55, WING_ATTACK
dbw 61, OUTRAGE
dbw 75, HYPER_BEAM
db 0 ; no more level-up moves
MewtwoEvosAttacks:
db 0 ; no more evolutions
dbw 1, CONFUSION
dbw 1, DISABLE
dbw 11, BARRIER
dbw 22, SWIFT
dbw 33, PSYCH_UP
dbw 44, FUTURE_SIGHT
dbw 55, MIST
dbw 66, PSYCHIC_M
dbw 77, AMNESIA
dbw 88, RECOVER
dbw 99, SAFEGUARD
db 0 ; no more level-up moves
MewEvosAttacks:
db 0 ; no more evolutions
dbw 1, POUND
dbw 10, TRANSFORM
dbw 20, MEGA_PUNCH
dbw 30, METRONOME
dbw 40, PSYCHIC_M
dbw 50, ANCIENTPOWER
db 0 ; no more level-up moves
| 19.398936 | 43 | 0.742043 |
5c61c9535c8160c860b0413ac7d7e6a10dc2e7a4 | 203 | asm | Assembly | src/third_party/nasm/travis/test/br3026808.asm | Mr-Sheep/naiveproxy | 9f6e9768295f6d1d41517a15a621d4756bd7d6be | [
"BSD-3-Clause"
] | 2,219 | 2018-03-26T02:57:34.000Z | 2022-03-31T00:27:59.000Z | src/third_party/nasm/travis/test/br3026808.asm | Mr-Sheep/naiveproxy | 9f6e9768295f6d1d41517a15a621d4756bd7d6be | [
"BSD-3-Clause"
] | 250 | 2018-02-02T23:16:57.000Z | 2022-03-21T06:09:53.000Z | src/third_party/nasm/travis/test/br3026808.asm | Mr-Sheep/naiveproxy | 9f6e9768295f6d1d41517a15a621d4756bd7d6be | [
"BSD-3-Clause"
] | 473 | 2019-03-24T16:34:23.000Z | 2022-03-31T02:01:05.000Z | %imacro proc 1
%push proc
%assign %$arg 1
%endmacro
%imacro arg 0-1 1
%assign %$arg %1+%$arg
%endmacro
%imacro endproc 0
%pop
%endmacro
;----------------------------
proc Test
%$ARG arg
endproc
| 10.684211 | 29 | 0.571429 |
83bc07448d692f78bef6201521ff277b63e5c582 | 413 | asm | Assembly | wof/lcs/123p/17.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | wof/lcs/123p/17.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | wof/lcs/123p/17.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
00177E clr.b ($17,A0) [123p+ 0]
001782 rts
001798 rts [123p+ 17]
0017A0 rts [123p+ 17]
00B43E move.b D0, ($b9,A0)
05E6B2 bpl $5e6c0 [123p+ 17, enemy+17]
05E80E bpl $5e81a [123p+ 17, enemy+17]
05E880 bpl $5e88c [123p+ 17, enemy+17]
05E8A8 bpl $5e8b4 [123p+ 17, enemy+17]
copyright zengfr site:http://github.com/zengfr/romhack
| 29.5 | 54 | 0.661017 |
779ee071da4e02b54eca302898b1c0f83ce9046e | 4,913 | asm | Assembly | Appl/Art/Decks/GeoDeck/LMClub7.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/Art/Decks/GeoDeck/LMClub7.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/Art/Decks/GeoDeck/LMClub7.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | LMClub7 label byte
word C_BLACK
Bitmap <71,100,BMC_PACKBITS,BMF_MONO>
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0x01, 0x0f, 0xf8, 0xfa, 0x00
db 0x01, 0x0f, 0xf8, 0xfc, 0x00, 0x01, 0x1c, 0x00
db 0x01, 0x0c, 0x18, 0xfc, 0x00, 0x01, 0x2e, 0x00
db 0x01, 0x0c, 0x38, 0xfc, 0x00, 0x01, 0x3e, 0x00
db 0x01, 0x00, 0x30, 0xfc, 0x00, 0x01, 0x3e, 0x00
db 0x01, 0x00, 0x60, 0xfc, 0x00, 0x01, 0xdd, 0x80
db 0x01, 0x00, 0x60, 0xfd, 0x00, 0x02, 0x01, 0x7e,
0xc0
db 0x08, 0x00, 0xc0, 0x01, 0xc0, 0x00, 0x07, 0x01,
0xff, 0xc0
db 0x08, 0x00, 0xc0, 0x02, 0xe0, 0x00, 0x0b, 0x81,
0xff, 0xc0
db 0x08, 0x01, 0x80, 0x05, 0xf0, 0x00, 0x17, 0xc0,
0xeb, 0x80
db 0x08, 0x01, 0x80, 0x07, 0xf0, 0x00, 0x1f, 0xc0,
0x1c, 0x00
db 0x08, 0x01, 0x80, 0x07, 0xf0, 0x00, 0x1f, 0xc0,
0x3e, 0x00
db 0x08, 0x01, 0x80, 0x03, 0xe0, 0x00, 0x0f, 0x80,
0x00, 0x00
db 0x08, 0x01, 0x80, 0x1d, 0xdc, 0x00, 0x77, 0x70,
0x00, 0x00
db 0x08, 0x01, 0x80, 0x2e, 0xae, 0x00, 0xba, 0xb8,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x5f, 0xdf, 0x01, 0x7f, 0x7c,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x7f, 0xff, 0x01, 0xff, 0xfc,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x7f, 0xff, 0x01, 0xff, 0xfc,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x3e, 0xbe, 0x00, 0xfa, 0xf8,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x1c, 0x9c, 0x00, 0x72, 0x70,
0x00, 0x00
db 0x05, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x07, 0xfe,
0x00
db 0x08, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x0f, 0x80,
0x00, 0x00
db 0xf8, 0x00
db 0xfd, 0x00, 0x00, 0x38, 0xfd, 0x00
db 0xfd, 0x00, 0x00, 0x5c, 0xfd, 0x00
db 0xfd, 0x00, 0x00, 0xbe, 0xfd, 0x00
db 0xfd, 0x00, 0x00, 0xfe, 0xfd, 0x00
db 0xfd, 0x00, 0x00, 0xfe, 0xfd, 0x00
db 0xfd, 0x00, 0x00, 0x7c, 0xfd, 0x00
db 0xfe, 0x00, 0x02, 0x03, 0xbb, 0x80, 0xfe, 0x00
db 0xfe, 0x00, 0x02, 0x05, 0xd5, 0xc0, 0xfe, 0x00
db 0xfe, 0x00, 0x02, 0x0b, 0xfb, 0xe0, 0xfe, 0x00
db 0xfe, 0x00, 0x02, 0x0f, 0xff, 0xe0, 0xfe, 0x00
db 0xfe, 0x00, 0x02, 0x0f, 0xff, 0xe0, 0xfe, 0x00
db 0xfe, 0x00, 0x02, 0x07, 0xd7, 0xc0, 0xfe, 0x00
db 0xfe, 0x00, 0x02, 0x03, 0x93, 0x80, 0xfe, 0x00
db 0xfd, 0x00, 0x00, 0x38, 0xfd, 0x00
db 0xfd, 0x00, 0x00, 0x7c, 0xfd, 0x00
db 0x05, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x07, 0xfe,
0x00
db 0x08, 0x00, 0x00, 0x02, 0xe0, 0x00, 0x0b, 0x80,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x05, 0xf0, 0x00, 0x17, 0xc0,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x07, 0xf0, 0x00, 0x1f, 0xc0,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x07, 0xf0, 0x00, 0x1f, 0xc0,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x0f, 0x80,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x1d, 0xdc, 0x00, 0x77, 0x70,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x2e, 0xae, 0x00, 0xba, 0xb8,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x5f, 0xdf, 0x01, 0x7f, 0x7c,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x7f, 0xff, 0x01, 0xff, 0xfc,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x7f, 0xff, 0x01, 0xff, 0xfc,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x3e, 0xbe, 0x00, 0xfa, 0xf8,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x1c, 0x9c, 0x00, 0x72, 0x70,
0x00, 0x00
db 0x05, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x07, 0xfe,
0x00
db 0x08, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x0f, 0x80,
0x00, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0x08, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x0f, 0x80,
0x00, 0x00
db 0x05, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x07, 0xfe,
0x00
db 0x08, 0x00, 0x00, 0x1c, 0x9c, 0x00, 0x72, 0x70,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x2e, 0xae, 0x00, 0xba, 0xb8,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x5f, 0xdf, 0x01, 0x7f, 0x7c,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x7f, 0xff, 0x01, 0xff, 0xfc,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x7f, 0xff, 0x01, 0xff, 0xfc,
0x00, 0x00
db 0x08, 0x00, 0x00, 0x3e, 0xbe, 0x00, 0xfa, 0xf8,
0x03, 0x00
db 0x08, 0x00, 0x00, 0x1d, 0xdc, 0x00, 0x77, 0x70,
0x03, 0x00
db 0x08, 0x00, 0x00, 0x02, 0xe0, 0x00, 0x0b, 0x80,
0x03, 0x00
db 0x08, 0x00, 0xf8, 0x05, 0xf0, 0x00, 0x17, 0xc0,
0x03, 0x00
db 0x08, 0x00, 0x70, 0x07, 0xf0, 0x00, 0x1f, 0xc0,
0x03, 0x00
db 0x08, 0x03, 0xae, 0x07, 0xf0, 0x00, 0x1f, 0xc0,
0x03, 0x00
db 0x08, 0x05, 0xf7, 0x03, 0xe0, 0x00, 0x0f, 0x80,
0x06, 0x00
db 0x08, 0x07, 0xff, 0x01, 0xc0, 0x00, 0x07, 0x00,
0x06, 0x00
db 0x01, 0x07, 0xff, 0xfc, 0x00, 0x01, 0x0c, 0x00
db 0x01, 0x03, 0x76, 0xfc, 0x00, 0x01, 0x0c, 0x00
db 0x01, 0x00, 0xb8, 0xfc, 0x00, 0x01, 0x18, 0x00
db 0x01, 0x00, 0xf8, 0xfc, 0x00, 0x01, 0x38, 0x60
db 0x01, 0x00, 0xf8, 0xfc, 0x00, 0x01, 0x30, 0x60
db 0x01, 0x00, 0x70, 0xfc, 0x00, 0x01, 0x3f, 0xe0
db 0xfa, 0x00, 0x01, 0x3f, 0xe0
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
db 0xf8, 0x00
| 32.753333 | 53 | 0.629758 |
44a10f8ae8bbc12e312bb2ba08708d5372bbeb01 | 516 | asm | Assembly | oeis/176/A176056.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/176/A176056.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/176/A176056.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A176056: Decimal expansion of (3+sqrt(11))/3.
; Submitted by Christian Krause
; 2,1,0,5,5,4,1,5,9,6,7,8,5,1,3,3,2,8,3,0,3,8,3,1,0,9,1,2,2,2,3,5,6,2,2,2,7,9,7,5,6,9,6,1,8,1,8,6,3,1,1,7,8,6,5,6,8,6,2,2,7,3,8,2,0,3,8,8,2,8,2,1,4,2,0,3,0,1,4,6,1,5,5,6,9,6,1,4,4,6,6,3,7,6,0,9,6,8,8,3
mov $2,1
mov $3,$0
mul $3,4
lpb $3
add $1,$2
add $5,$2
add $5,$2
add $1,$5
mul $1,12
add $2,$1
mov $1,$5
mul $1,2
sub $3,1
lpe
mov $1,1
add $1,$5
mul $1,2
mov $4,10
pow $4,$0
div $2,$4
div $1,$2
mov $0,$1
mod $0,10
| 18.428571 | 201 | 0.531008 |
2c8f56e8626b4f9e15c9beae3d029cdf7e631065 | 12,137 | asm | Assembly | Library/User/Gen/genToolGroup.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/User/Gen/genToolGroup.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/User/Gen/genToolGroup.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @----------------------------------------------------------------------
Copyright (c) GeoWorks 1992 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: UserInterface/Gen
FILE: genToolGroup.asm
ROUTINES:
Name Description
---- -----------
GLB GenToolGroupClass Control object
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 7/92 Initial version
DESCRIPTION:
This file contains routines to implement the GenToolGroup class
$Id: genToolGroup.asm,v 1.1 97/04/07 11:45:05 newdeal Exp $
------------------------------------------------------------------------------@
UserClassStructures segment resource
GenToolGroupClass
UserClassStructures ends
if not NO_CONTROLLERS ;++++++++++++++++++++++++++++++++++++++++++++++++++++
ControlObject segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenToolGroupSetHighlight
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: <description here>
PASS: *ds:si - instance data
ds:di - ptr to start of master instance data
es - segment of class
ax - MSG_GEN_TOOL_GROUP_SET_HIGHLIGHT
cl - ToolGroupHighlightType
RETURN: nothing
ALLOWED TO DESTROY:
bx, si, di, ds, es
PSEUDO CODE/STRATEGY/KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 7/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenToolGroupSetHighlight method dynamic GenToolGroupClass,
MSG_GEN_TOOL_GROUP_SET_HIGHLIGHT
EC < cmp cl, ToolGroupHighlightType >
EC < ERROR_AE BAD_HIGHLIGHT_TYPE >
cmp cl, TGHT_NO_HIGHLIGHT
je nukeHighlight
push cx
; Set the tool group enabled when we are customizing the toolbar, so
; the tool group can be clicked on, even if the associated controller
; is disabled (when the highlight goes away, we'll restore the enabled
; state).
mov ax, MSG_GEN_SET_ENABLED
mov dl, VUM_NOW
call ObjCallInstanceNoLock
mov ax, TEMP_TOOL_GROUP_HIGHLIGHT
call ObjVarFindData
jc existingHighlight
; Create vardata for highlight
mov ax, TEMP_TOOL_GROUP_HIGHLIGHT
mov cx, size ToolGroupHighlightType
call ObjVarAddData
existingHighlight:
pop cx
mov ds:[bx], cl ; store color away for later
call GenToolGroupDrawHighlightFromScratch
jmp short done
nukeHighlight:
; Nuke vardata
mov ax, TEMP_TOOL_GROUP_HIGHLIGHT
call ObjVarDeleteData
jc skipInval
; We can't do this, because we have VCGA_ONLY_DRAWS_IN_MARGINS set. We'd
; have to invalidate our children instead. So, we just invalidate our
; bounds on screen.
; we have turned off VCGA_ONLY_DRAWS_IN_MARGINS for GenToolGroup, so we can
; use MSG_VIS_INVALIDATE now - brianc 2/5/93
mov ax, MSG_VIS_INVALIDATE
call ObjCallInstanceNoLock
; call VisQueryWindow
; tst di
; jz skipInval
;
; push si
; call VisGetBounds
; clrdw bpsi
; call WinInvalReg
; pop si
skipInval:
;
; Now, restore the enabled state from the controller
;
push si
mov di, ds:[si]
add di, ds:[di].GenToolGroup_offset
movdw bxsi, ds:[di].GTGI_controller
tst_clc bx ;If no controller, disable the
jz noController ; tool group (it is unclear if this
; can ever happen, though).
mov ax, MSG_GEN_GET_ENABLED
mov di, mask MF_FIXUP_DS or mask MF_CALL
call ObjMessage
noController:
pop si
mov ax, MSG_GEN_SET_ENABLED
jc setObj
mov ax, MSG_GEN_SET_NOT_ENABLED
setObj:
mov dl, VUM_NOW
call ObjCallInstanceNoLock
done:
ret
GenToolGroupSetHighlight endm
;--------------
GenToolGroupDrawHighlightFromScratch proc near
call VisQueryWindow
tst di
jz done
call GrCreateState
call GenToolGroupDrawHighlightLow
call GrDestroyState
done:
ret
GenToolGroupDrawHighlightFromScratch endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetLineColorForCurrentDisplay
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets up the line color for the current display
CALLED BY: GLOBAL
PASS: cl - ToolGroupHighlightType
*ds:si GenToolGroupClass
di - gstate
RETURN: nada
DESTROYED: nada
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 12/21/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetLineColorForCurrentDisplay proc near
.enter
push cx
mov ax, MSG_GEN_APPLICATION_GET_DISPLAY_SCHEME
call UserCallApplication ;AH <- DisplayType
pop cx
and ah, mask DT_DISP_CLASS
cmp ah, DC_GRAY_1 shl offset DT_DISP_CLASS
ja isColor
mov ax, C_BLACK
cmp cl, TGHT_ACTIVE_HIGHLIGHT
je setColor
EC < cmp cl, TGHT_INACTIVE_HIGHLIGHT >
EC < ERROR_NZ BAD_HIGHLIGHT_TYPE >
; We are in B/W mode, so set the map mode to dither, and the color
; to BW_GREY
mov al, CMT_DITHER
call GrSetLineColorMap
mov ax, C_BW_GREY
jmp setColor
isColor:
mov ax, ACTIVE_COLOR
cmp cl, TGHT_ACTIVE_HIGHLIGHT
je setColor
EC < cmp cl, TGHT_INACTIVE_HIGHLIGHT >
EC < ERROR_NZ BAD_HIGHLIGHT_TYPE >
mov ax, INACTIVE_COLOR
setColor:
call GrSetLineColor
.leave
ret
SetLineColorForCurrentDisplay endp
;--------------
ACTIVE_COLOR equ C_LIGHT_VIOLET
INACTIVE_COLOR equ C_BROWN
GenToolGroupDrawHighlightLow proc far
; If there are no tools (no children), then don't draw the outline
push cx
mov ax, MSG_GEN_COUNT_CHILDREN
call ObjCallInstanceNoLock
pop cx
tst dx
jz noDraw
call GrSaveState
call SetLineColorForCurrentDisplay
mov dx, 2
clr ax
call GrSetLineWidth
call VisGetBounds
inc ax
inc bx
dec cx
dec dx
EC < cmp cx, ax >
EC < ERROR_BE BAD_TOOL_GROUP_BOUNDS >
EC < cmp dx, bx >
EC < ERROR_BE BAD_TOOL_GROUP_BOUNDS >
call GrDrawRect
call GrRestoreState
noDraw:
ret
GenToolGroupDrawHighlightLow endp
ControlObject ends
GCCommon segment resource
COMMENT @----------------------------------------------------------------------
MESSAGE: GenToolGroupBuildBranch
DESCRIPTION: Intercept spec build to request generation of tools
PASS:
*ds:si - instance data
es - segment of class
RETURN:
none
DESTROYED:
bx, si, di, ds, es (message handler)
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 7/15/92 initial version
------------------------------------------------------------------------------@
GenToolGroupBuildBranch method dynamic GenToolGroupClass,
MSG_SPEC_BUILD_BRANCH
mov bx, di
mov di, 600
call ThreadBorrowStackSpace
push di
tst ds:[bx].GI_comp.CP_firstChild.handle
jnz afterToolsGenerated
push ax, cx, dx, bp, si
; Ask controller to build tool set
;
mov ax, MSG_GEN_CONTROL_GENERATE_TOOLBOX_UI
mov cx, ds:[LMBH_handle] ; Pass self as tool parent
mov dx, si
mov si, ds:[bx].GTGI_controller.chunk
mov bx, ds:[bx].GTGI_controller.handle
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop ax, cx, dx, bp, si
afterToolsGenerated:
mov ax, MSG_SPEC_BUILD_BRANCH ; Then, do specific build
mov di, offset GenToolGroupClass
call ObjCallSuperNoLock
pop di
call ThreadReturnStackSpace
ret
GenToolGroupBuildBranch endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenToolGroupSpecBuild
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: clear VCGA_ONLY_DRAWS_IN_MARGINS, to deal with drawing
highlight for tools that don't completely fill a rectangular
region
CALLED BY: MSG_SPEC_BUILD
PASS: *ds:si = GenToolGroupClass object
ds:di = GenToolGroupClass instance data
es = segment of GenToolGroupClass
ax = MSG_SPEC_BUILD
bp = SpecBuildFlags
RETURN: nothing
ALLOWED TO DESTROY:
ax, cx, dx, bp
bx, si, di, ds, es
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
brianc 2/5/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenToolGroupSpecBuild method dynamic GenToolGroupClass, MSG_SPEC_BUILD
;
; let superclass do default handling
;
mov di, offset GenToolGroupClass
call ObjCallSuperNoLock
;
; then clear VCGA_ONLY_DRAWS_IN_MARGINS
;
EC < call VisCheckVisAssumption >
NEC < call VisCheckIfVisGrown >
NEC < jnc done >
mov di, ds:[si]
add di, ds:[di].Vis_offset
andnf ds:[di].VCI_geoAttrs, not mask VCGA_ONLY_DRAWS_IN_MARGINS
NEC <done: >
ret
GenToolGroupSpecBuild endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenToolGroupDraw
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: <description here>
PASS: *ds:si - instance data
ds:di - ptr to start of master instance data
es - segment of class
ax - MSG_VIS_DRAW
<pass info>
RETURN: <return info>
ALLOWED TO DESTROY:
bx, si, di, ds, es
PSEUDO CODE/STRATEGY/KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 7/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenToolGroupDraw method dynamic GenToolGroupClass,
MSG_VIS_DRAW
push bp
mov di, offset GenToolGroupClass
call ObjCallSuperNoLock
pop bp
; Check to see if we should highlight group
;
mov ax, TEMP_TOOL_GROUP_HIGHLIGHT
call ObjVarFindData
jnc done
mov cl, ds:[bx] ; get highlight color
mov di, bp
call GenToolGroupDrawHighlightLow
done:
ret
GenToolGroupDraw endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GenToolGroupMouseInput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DESCRIPTION: <description here>
PASS: *ds:si - instance data
ds:di - ptr to start of master instance data
es - segment of class
ax - The various mouse input messages
<pass info>
RETURN: <return info>
ALLOWED TO DESTROY:
bx, si, di, ds, es
PSEUDO CODE/STRATEGY/KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
doug 7/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GenToolGroupMouseInput method dynamic GenToolGroupClass, MSG_META_PTR,
MSG_META_START_SELECT,
MSG_META_START_MOVE_COPY,
MSG_META_START_FEATURES,
MSG_META_START_OTHER,
MSG_META_DRAG_SELECT,
MSG_META_DRAG_MOVE_COPY,
MSG_META_DRAG_FEATURES,
MSG_META_DRAG_OTHER,
MSG_META_END_SELECT,
MSG_META_END_MOVE_COPY,
MSG_META_END_FEATURES,
MSG_META_END_OTHER,
MSG_META_QUERY_IF_PRESS_IS_INK
; Check to see if in special highlight mode. If so, branch to deal
; with it. Otherwise just call superclass.
;
push ax
mov ax, TEMP_TOOL_GROUP_HIGHLIGHT
call ObjVarFindData
pop ax
jc highlightMode
mov di, offset GenToolGroupClass
GOTO ObjCallSuperNoLock
highlightMode:
cmp ax, MSG_META_START_SELECT
je sendToolgroupSelectedChange
cmp ax, MSG_META_QUERY_IF_PRESS_IS_INK
je isInk
jmp short mouseExit
isInk:
mov ax, IRV_NO_INK ; No ink while editing tools
jmp short exit
sendToolgroupSelectedChange:
mov bx, ds:[di].GTGI_controller.handle
tst bx
jz afterChangeSent
push si
mov si, ds:[di].GTGI_controller.chunk
call ObjSwapLock
mov ax, mask GCSF_HIGHLIGHTED_TOOLGROUP_SELECTED
call ControlSendStatusChange
call ObjSwapUnlock
pop si
afterChangeSent:
mouseExit:
mov ax, mask MRF_PROCESSED
exit:
ret
GenToolGroupMouseInput endm
GCCommon ends
endif ; NO_CONTROLLERS ++++++++++++++++++++++++++++++++++++
| 23.030361 | 80 | 0.623218 |
165209e7a5b915dcb1673e076f14396290f71eac | 288 | asm | Assembly | programs/oeis/070/A070454.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/070/A070454.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/070/A070454.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A070454: a(n) = n^2 mod 32.
; 0,1,4,9,16,25,4,17,0,17,4,25,16,9,4,1,0,1,4,9,16,25,4,17,0,17,4,25,16,9,4,1,0,1,4,9,16,25,4,17,0,17,4,25,16,9,4,1,0,1,4,9,16,25,4,17,0,17,4,25,16,9,4,1,0,1,4,9,16,25,4,17,0,17,4,25,16,9,4,1,0,1,4,9,16,25,4,17,0,17,4,25,16,9,4,1,0,1,4,9
pow $0,2
mod $0,32
| 48 | 237 | 0.565972 |
2f8105bfd57c6412ed7e682c095bc4675ab4c992 | 315 | asm | Assembly | dataToTestOn/asm/3/prog03.asm | Epacik/8051-ASM-Plugin | 3e2cf55c82733d66198bd41a68f8363c0129043b | [
"MIT"
] | 1 | 2020-11-10T18:42:46.000Z | 2020-11-10T18:42:46.000Z | dataToTestOn/asm/3/prog03.asm | Epacik/8051-ASM-Plugin | 3e2cf55c82733d66198bd41a68f8363c0129043b | [
"MIT"
] | null | null | null | dataToTestOn/asm/3/prog03.asm | Epacik/8051-ASM-Plugin | 3e2cf55c82733d66198bd41a68f8363c0129043b | [
"MIT"
] | null | null | null | TAB EQU 30H
LJMP START
ORG 100H
START:
MOV TAB,#0
MOV TAB+1,#2
MOV TAB+2,#4
MOV TAB+3,#6
MOV TAB+4,#8
MOV TAB+5,#10h
MOV R0,#TAB
CALL LCD_CLR
ABCD:
MOV A,@R0
CALL WRITE_HEX
MOV A,#5
CALL DELAY_100MS
CALL LCD_CLR
INC R0
CJNE R0,#TAB+6,ABCD
MOV R0,#TAB
SJMP ABCD
| 13.695652 | 22 | 0.593651 |
906e1d727a997628a5b5e5dcced37acea70ea880 | 1,013 | asm | Assembly | _build/dispatcher/jmp_ippsGFpGetInfo_4b72be1c.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | 1 | 2021-10-04T10:21:54.000Z | 2021-10-04T10:21:54.000Z | _build/dispatcher/jmp_ippsGFpGetInfo_4b72be1c.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | _build/dispatcher/jmp_ippsGFpGetInfo_4b72be1c.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | extern m7_ippsGFpGetInfo:function
extern n8_ippsGFpGetInfo:function
extern y8_ippsGFpGetInfo:function
extern e9_ippsGFpGetInfo:function
extern l9_ippsGFpGetInfo:function
extern n0_ippsGFpGetInfo:function
extern k0_ippsGFpGetInfo:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsGFpGetInfo
.Larraddr_ippsGFpGetInfo:
dq m7_ippsGFpGetInfo
dq n8_ippsGFpGetInfo
dq y8_ippsGFpGetInfo
dq e9_ippsGFpGetInfo
dq l9_ippsGFpGetInfo
dq n0_ippsGFpGetInfo
dq k0_ippsGFpGetInfo
segment .text
global ippsGFpGetInfo:function (ippsGFpGetInfo.LEndippsGFpGetInfo - ippsGFpGetInfo)
.Lin_ippsGFpGetInfo:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsGFpGetInfo:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsGFpGetInfo]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsGFpGetInfo:
| 25.974359 | 83 | 0.782823 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.