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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4179deab046e1c9e275b8a04f0418f070f45a343
| 3,890
|
asm
|
Assembly
|
data/pokemon/dex_order_alpha.asm
|
Ebernacher90/pokecrystal-allworld
|
5d623c760e936842cf92563912c5bd64dd69baef
|
[
"blessing"
] | null | null | null |
data/pokemon/dex_order_alpha.asm
|
Ebernacher90/pokecrystal-allworld
|
5d623c760e936842cf92563912c5bd64dd69baef
|
[
"blessing"
] | null | null | null |
data/pokemon/dex_order_alpha.asm
|
Ebernacher90/pokecrystal-allworld
|
5d623c760e936842cf92563912c5bd64dd69baef
|
[
"blessing"
] | null | null | null |
; Every Pokémon sorted alphabetically by name.
AlphabeticalPokedexOrder:
dw ABRA
dw AERODACTYL
dw AGGRON
dw AIPOM
dw ALAKAZAM
dw AMPHAROS
dw ARBOK
dw ARCANINE
dw ARIADOS
dw ARON
dw ARTICUNO
dw AZUMARILL
dw AZURILL
dw BAYLEEF
dw BEAUTIFLY
dw BEEDRILL
dw BELLOSSOM
dw BELLSPROUT
dw BLASTOISE
dw BLAZIKEN
dw BLISSEY
dw BRELOOM
dw BULBASAUR
dw BUTTERFREE
dw CASCOON
dw CATERPIE
dw CELEBI
dw CHANSEY
dw CHARIZARD
dw CHARMANDER
dw CHARMELEON
dw CHIKORITA
dw CHINCHOU
dw CLEFABLE
dw CLEFAIRY
dw CLEFFA
dw CLOYSTER
dw COMBUSKEN
dw CORSOLA
dw CROBAT
dw CROCONAW
dw CUBONE
dw CYNDAQUIL
dw DELCATTY
dw DELIBIRD
dw DEWGONG
dw DIGLETT
dw DITTO
dw DODRIO
dw DODUO
dw DONPHAN
dw DRAGONAIR
dw DRAGONITE
dw DRATINI
dw DROWZEE
dw DUGTRIO
dw DUNSPARCE
dw DUSTOX
dw EEVEE
dw EKANS
dw ELECTABUZZ
dw ELECTRIKE
dw ELECTRODE
dw ELEKID
dw ENTEI
dw ESPEON
dw EXEGGCUTE
dw EXEGGUTOR
dw EXPLOUD
dw FARFETCH_D
dw FEAROW
dw FERALIGATR
dw FLAAFFY
dw FLAREON
dw FORRETRESS
dw FURRET
dw GARDEVOIR
dw GASTLY
dw GENGAR
dw GEODUDE
dw GIRAFARIG
dw GLIGAR
dw GLOOM
dw GOLBAT
dw GOLDEEN
dw GOLDUCK
dw GOLEM
dw GRANBULL
dw GRAVELER
dw GRIMER
dw GROVYLE
dw GROWLITHE
dw GYARADOS
dw HARIYAMA
dw HAUNTER
dw HERACROSS
dw HITMONCHAN
dw HITMONLEE
dw HITMONTOP
dw HO_OH
dw HOOTHOOT
dw HOPPIP
dw HORSEA
dw HOUNDOOM
dw HOUNDOUR
dw HYPNO
dw IGGLYBUFF
dw IVYSAUR
dw JIGGLYPUFF
dw JOLTEON
dw JUMPLUFF
dw JYNX
dw KABUTO
dw KABUTOPS
dw KADABRA
dw KAKUNA
dw KANGASKHAN
dw KINGDRA
dw KINGLER
dw KIRLIA
dw KOFFING
dw KRABBY
dw LAIRON
dw LANTURN
dw LAPRAS
dw LARVITAR
dw LEDIAN
dw LEDYBA
dw LICKITUNG
dw LINOONE
dw LOMBRE
dw LOTAD
dw LOUDRED
dw LUDICOLO
dw LUGIA
dw MACHAMP
dw MACHOKE
dw MACHOP
dw MAGBY
dw MAGCARGO
dw MAGIKARP
dw MAGMAR
dw MAGNEMITE
dw MAGNETON
dw MAKUHITA
dw MANECTRIC
dw MANKEY
dw MANTINE
dw MAREEP
dw MARILL
dw MAROWAK
dw MARSHTOMP
dw MASQUERAIN
dw MAWILE
dw MEDICHAM
dw MEDITITE
dw MEGANIUM
dw MEOWTH
dw METAPOD
dw MEW
dw MEWTWO
dw MIGHTYENA
dw MILTANK
dw MISDREAVUS
dw MOLTRES
dw MR__MIME
dw MUDKIP
dw MUK
dw MURKROW
dw NATU
dw NIDOKING
dw NIDOQUEEN
dw NIDORAN_F
dw NIDORAN_M
dw NIDORINA
dw NIDORINO
dw NINCADA
dw NINETALES
dw NINJASK
dw NOCTOWL
dw NOSEPASS
dw NUZLEAF
dw OCTILLERY
dw ODDISH
dw OMANYTE
dw OMASTAR
dw ONIX
dw PARAS
dw PARASECT
dw PELIPPER
dw PERSIAN
dw PHANPY
dw PICHU
dw PIDGEOT
dw PIDGEOTTO
dw PIDGEY
dw PIKACHU
dw PILOSWINE
dw PINECO
dw PINSIR
dw POLITOED
dw POLIWAG
dw POLIWHIRL
dw POLIWRATH
dw PONYTA
dw POOCHYENA
dw PORYGON
dw PORYGON2
dw PRIMEAPE
dw PSYDUCK
dw PUPITAR
dw QUAGSIRE
dw QUILAVA
dw QWILFISH
dw RAICHU
dw RAIKOU
dw RALTS
dw RAPIDASH
dw RATICATE
dw RATTATA
dw REMORAID
dw RHYDON
dw RHYHORN
dw SABLEYE
dw SANDSHREW
dw SANDSLASH
dw SCEPTILE
dw SCIZOR
dw SCYTHER
dw SEADRA
dw SEAKING
dw SEEDOT
dw SEEL
dw SENTRET
dw SHEDINJA
dw SHELLDER
dw SHIFTRY
dw SHROOMISH
dw SHUCKLE
dw SILCOON
dw SKARMORY
dw SKIPLOOM
dw SKITTY
dw SLAKING
dw SLAKOTH
dw SLOWBRO
dw SLOWKING
dw SLOWPOKE
dw SLUGMA
dw SMEARGLE
dw SMOOCHUM
dw SNEASEL
dw SNORLAX
dw SNUBBULL
dw SPEAROW
dw SPINARAK
dw SQUIRTLE
dw STANTLER
dw STARMIE
dw STARYU
dw STEELIX
dw SUDOWOODO
dw SUICUNE
dw SUNFLORA
dw SUNKERN
dw SURSKIT
dw SWAMPERT
dw SWELLOW
dw SWINUB
dw TAILLOW
dw TANGELA
dw TAUROS
dw TEDDIURSA
dw TENTACOOL
dw TENTACRUEL
dw TOGEPI
dw TOGETIC
dw TORCHIC
dw TOTODILE
dw TREECKO
dw TYPHLOSION
dw TYRANITAR
dw TYROGUE
dw UMBREON
dw UNOWN
dw URSARING
dw VAPOREON
dw VENOMOTH
dw VENONAT
dw VENUSAUR
dw VICTREEBEL
dw VIGOROTH
dw VILEPLUME
dw VOLTORB
dw VULPIX
dw WARTORTLE
dw WEEDLE
dw WEEPINBELL
dw WEEZING
dw WHISMUR
dw WIGGLYTUFF
dw WINGULL
dw WOBBUFFET
dw WOOPER
dw WURMPLE
dw XATU
dw YANMA
dw ZAPDOS
dw ZIGZAGOON
dw ZUBAT
| 12.388535
| 46
| 0.757841
|
d5060f1d801da4a89a474e08b5d4b1c953f545ca
| 5,203
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_441.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.log_21829_441.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.log_21829_441.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 %rbp
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x505d, %rsi
lea addresses_UC_ht+0x4ffd, %rdi
nop
nop
inc %rbp
mov $41, %rcx
rep movsl
nop
nop
nop
inc %rbx
lea addresses_normal_ht+0xd6ac, %rdx
nop
sub $19413, %rsi
movups (%rdx), %xmm7
vpextrq $1, %xmm7, %rbp
inc %rdi
lea addresses_A_ht+0x1aead, %rsi
lea addresses_WT_ht+0x1ba10, %rdi
nop
nop
add %r12, %r12
mov $97, %rcx
rep movsq
nop
nop
nop
nop
nop
and $11876, %r12
lea addresses_WT_ht+0x1cbfd, %r12
nop
xor $27259, %rdi
vmovups (%r12), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $1, %xmm2, %rdx
nop
sub %rsi, %rsi
lea addresses_A_ht+0x114b5, %rdx
clflush (%rdx)
nop
nop
and $22087, %rsi
movb (%rdx), %bl
nop
nop
sub $55714, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %rax
push %rbx
push %rcx
push %rdi
// Faulty Load
lea addresses_normal+0x2ffd, %r13
nop
nop
nop
add $21348, %rax
movups (%r13), %xmm1
vpextrq $1, %xmm1, %rbx
lea oracles, %r11
and $0xff, %rbx
shlq $12, %rbx
mov (%r11,%rbx,1), %rbx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': True, 'congruent': 5, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_WT_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_A_ht', 'AVXalign': True, 'size': 1}, 'OP': 'LOAD'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 47.3
| 2,999
| 0.661926
|
aff7a1b771bf25c50df57969abc0228c652f511c
| 5,456
|
asm
|
Assembly
|
src/cartload.asm
|
fjpena/sword-of-ianna-zx
|
fdd6bdb5775933756e75402a7c6be80d5334702d
|
[
"Apache-2.0"
] | 67
|
2017-10-07T18:48:05.000Z
|
2022-02-01T20:37:40.000Z
|
src/cartload.asm
|
fjpena/sword-of-ianna-zx
|
fdd6bdb5775933756e75402a7c6be80d5334702d
|
[
"Apache-2.0"
] | null | null | null |
src/cartload.asm
|
fjpena/sword-of-ianna-zx
|
fdd6bdb5775933756e75402a7c6be80d5334702d
|
[
"Apache-2.0"
] | 9
|
2017-10-06T21:02:55.000Z
|
2022-01-06T03:11:58.000Z
|
org 24000
set_cart_boot:
ld a, 41 ; 41,1,0 special command stores in eeprom bank 1 on normal boot (if not stored already)
ld d, 1
ld e, 0
call SENDSPCMD
call SENDCONF
set_reset_boot:
; Current slot is 0. Make sure it will be used after a reset
ld hl,1
ld a, 39 ; Command 39 sets current rom Slot as reset slot
call SENDNRCMD
start_load:
ld ix, loader_table_ianna
ld b, (ix+0) ; b==iteratons
inc ix
load_loop:
push bc
ld a, (ix+0) ; ROM page
ld hl, DDNTRADDRCMD
call SENDNRCMD ; Set ROM page
ld a, (ix+7) ; RAM page
call setrambank ; set RAM page
ld l, (ix+1)
ld h, (ix+2) ; HL = source (offset in page)
ld c, (ix+3)
ld b, (ix+4) ; BC = number of bytes to load
ld e, (ix+5)
ld d, (ix+6) ; DE = destination
ldir ; copy data
ld bc, 8
add ix, bc ; go to next entry
pop bc ; get the counter back!
djnz load_loop
ld e, (ix+0)
ld d, (ix+1) ; get the execution address in de
push de
set_ram_paging:
ld a, $10 ; RAM 0, ROM 2 (48k BASIC)
call setrambank
wait_keypressed_loop:
call KEYPRESSED
and a
jr z, wait_keypressed_loop
xor a
out ($fe), a
launch_program:
pop hl ; get the execution address
LD IY, 5C3Ah ; re-establish the IY pointer (must be done!)
; ei ; enable interrupts
jp (hl) ; and run!
; Function: test if any key is pressed
; INPUT: none
; OUTPUT: A = 0 if no key pressed, A != 0 if any key pressed
; MODIFIES: AF, BC, DE
KEYPRESSED:
LD BC, $FEFE ; This is the first row, we will later scan all of them
LD D,8 ; loop counter
keyp_scanloop:
IN A, (C) ; Read the row status
CPL ; invert, so that any bit in 1 is a key pressed
AND $1f ; get the 5 significant bits
RET NZ ; A != 0, a key was pressed
RLC B ; go to the next row
DEC D
JR NZ, keyp_scanloop
XOR A ; No key pressed, A=0 and return
RET
; INPUT: A: page to set
setrambank:
or $10 ; select always ROM1 (128K) or ROM3 (+2A/+3)
ld BC, $7FFD
ld ($5b5c), a ; save in the BASIC variable
out (c), a
ret
loader_table_ianna:
db 6 ; 6 entries
db 18 ; load from page 17
dw 0 ; load offset is 0
dw 6912 ; load 6912 bytes (loading.scr)
dw 16384 ; loading screen
db $00 ; RAM Bank 0, not compressed
db 5 ; load from ROM page 4
dw 0 ; load offset is 0
dw 16372 ; load 16372 bytes (ianna-4.rom) -> ram3.bin
dw 49152 ; load to 49152
db $03 ; RAM Bank 3, not compressed
db 4 ; load from ROM page 3
dw 0 ; load offset is 0
dw 16254 ; load 16254 bytes (menu)
dw 49152 ; load to 49152
db $06 ; RAM Bank 6, not compressed
db 1 ; load from ROM page 0
dw 8192 ; load offset is 8192
dw 8192 ; load 8192 bytes (ianna-0.rom)
dw 24576 ; load to 24576
db $00 ; RAM Bank 0, not compressed
db 2 ; load from ROM page 1
dw 0 ; load offset is 0
dw 16384 ; load 16384 bytes (ianna-1.rom)
dw 32768 ; load to 32768
db $00 ; RAM Bank 0, not compressed
db 3 ; load from ROM page 2
dw 0 ; load offset is 0
dw 15872 ; load 15872 bytes (ianna-2.rom)
dw 49152 ; load to 49152
db $00 ; RAM Bank 0, not compressed
dw 24576 ; randomize usr 24576
; ----------------------------------------------------------------------------------------
; Send Special Command to Dandanator - Sends Command (a), Data 1 (d) and Data 2 (e)- Prepare for Pulse
; Destroys HL, B.
; Uses Extra 2 bytes on Stack
;
; ******************** MUST BE RUN FROM RAM IF CHANGING SLOTS ********************
;
; ----------------------------------------------------------------------------------------
SENDSPCMD: LD HL,DDNTRADDRCMD ; HL=0 Command (ZESARUX)
CALL SENDNRCMD ; Send command
INC HL ; HL=1 Data1 (ZESARUX)
LD A,D ; Data 1
CALL SENDNRCMD ; Send Data 1
INC HL ; HL=2 Data2 (ZESARUX)
LD A,E ; Data 2
JP SENDNRCMD ; Send Data 2
; Now about 0,5ms to confirm command with a pulse to DDNTRADDRCONF
; ----------------------------------------------------------------------------------------
; ----------------------------------------------------------------------------------------
; Send Normal Command to Dandanator - Sends Command/Data
; A = Cmd/Data,
; HL = port number: 1 for cmd, 2 for data1, 3 for data2, (0 for confirmation) (ZESARUX)
; Destroys B
; NOTE: 0 is signaled by 256 pulses.
;
; ******************** MUST BE RUN FROM RAM ********************
;
; ----------------------------------------------------------------------------------------
SENDNRCMD: LD B,A
NRCMDLOOP: NOP ; Some time to avoid very fast pulses
NOP
NOP
LD (HL),A ; Send Pulse
DJNZ NRCMDLOOP
LD B, PAUSELOOPSN ; Timeout Command/Data
WAITXCMD: DJNZ WAITXCMD
RET
; ----------------------------------------------------------------------------------------
; ----------------------------------------------------------------------------------------
; Send Confirmation Pulse to dandanator and wait a bit - Also Pause Routine
; ----------------------------------------------------------------------------------------
SENDCONF: LD (0),A
PAUSE: PUSH BC
LD B,PAUSELOOPSN
WAITPAUSE: DJNZ WAITPAUSE
POP BC
RET
; ----------------------------------------------------------------------------------------
PAUSELOOPSN EQU 40 ; 40 is compatible with all firmware versions. 10 is faster but only >=6.4
DDNTRADDRCMD EQU 1
| 27.555556
| 102
| 0.527676
|
bd1b86834541a258a76131fb31829b4d227fd237
| 573
|
asm
|
Assembly
|
src/l4/a/x86/c/system/asm/seframe.asm
|
archibate/h2os
|
04bf2a16519969eeb605ec97d8cb04d16da93ee9
|
[
"MIT"
] | 1
|
2020-07-06T02:44:00.000Z
|
2020-07-06T02:44:00.000Z
|
src/l4/a/x86/c/system/asm/seframe.asm
|
archibate/h2os
|
04bf2a16519969eeb605ec97d8cb04d16da93ee9
|
[
"MIT"
] | null | null | null |
src/l4/a/x86/c/system/asm/seframe.asm
|
archibate/h2os
|
04bf2a16519969eeb605ec97d8cb04d16da93ee9
|
[
"MIT"
] | null | null | null |
bits 32
section .text
globl sysenter_entry
globl seframe_exiter
extrn sched_enter
extrn sched_leave
extrn _systab
sysenter_entry:
cli
push ecx
push edx
push ds
push es
mov edx, ss
mov ds, edx
mov es, edx
push ebp
push esi
push edi
push ebx
mov esi, [_systab + eax * 4]
test esi, esi
jz serr
call sched_enter
call esi
add esp, 16
push eax
call sched_leave
seframe_exiter:
pop eax
pop es
pop ds
pop edx
pop ecx
sti
sysexit
serr:
mov byte [0xb8000], 's'
mov byte [0xb8002], 'E'
mov byte [0xb8004], 'R'
mov byte [0xb8006], 'R'
cli
hlt
| 12.456522
| 36
| 0.699825
|
0ad3fd213c69c437326924798123a992fbbb4e71
| 8,039
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_1205.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_1205.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_1205.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 %r14
push %r8
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1dd9a, %r14
nop
nop
nop
nop
nop
add %r8, %r8
mov (%r14), %esi
sub %rbp, %rbp
lea addresses_A_ht+0x17eda, %rbx
cmp $45532, %r10
movups (%rbx), %xmm0
vpextrq $0, %xmm0, %r8
nop
nop
nop
nop
and $3487, %r14
lea addresses_WC_ht+0xb7d6, %rsi
lea addresses_normal_ht+0x941a, %rdi
nop
nop
nop
nop
cmp $28867, %r8
mov $124, %rcx
rep movsq
add %rbp, %rbp
lea addresses_normal_ht+0x1886, %r14
nop
nop
nop
and %rcx, %rcx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm1
vmovups %ymm1, (%r14)
nop
nop
nop
cmp %rbp, %rbp
lea addresses_UC_ht+0x1ef9a, %rdi
nop
and %rbp, %rbp
movups (%rdi), %xmm6
vpextrq $1, %xmm6, %r14
nop
and %rbp, %rbp
lea addresses_WC_ht+0x15282, %rsi
lea addresses_WC_ht+0x181a, %rdi
clflush (%rdi)
nop
nop
nop
nop
dec %rbx
mov $123, %rcx
rep movsl
nop
nop
nop
xor $3821, %rbp
lea addresses_UC_ht+0x7efe, %rbx
nop
nop
nop
nop
cmp %r10, %r10
movups (%rbx), %xmm4
vpextrq $1, %xmm4, %rcx
nop
sub %rbx, %rbx
lea addresses_WC_ht+0x1001a, %rsi
lea addresses_normal_ht+0x10c1a, %rdi
nop
nop
nop
nop
add %rbp, %rbp
mov $25, %rcx
rep movsl
nop
nop
nop
nop
dec %r14
lea addresses_normal_ht+0x1509a, %rbx
nop
nop
nop
nop
nop
inc %rdi
mov (%rbx), %r10d
nop
nop
nop
xor %rsi, %rsi
lea addresses_D_ht+0x1c62a, %rsi
lea addresses_WT_ht+0x859a, %rdi
nop
nop
sub $40794, %rbx
mov $87, %rcx
rep movsw
add $5103, %rdi
lea addresses_WC_ht+0x1941a, %rbp
xor %rbx, %rbx
movb $0x61, (%rbp)
nop
nop
nop
nop
nop
inc %r10
lea addresses_D_ht+0x11a1a, %rsi
lea addresses_WT_ht+0x1665a, %rdi
xor %r8, %r8
mov $24, %rcx
rep movsw
nop
and %r10, %r10
lea addresses_WT_ht+0x1d09a, %r14
nop
nop
nop
nop
nop
inc %rsi
mov $0x6162636465666768, %r10
movq %r10, %xmm2
movups %xmm2, (%r14)
nop
nop
nop
nop
nop
and %r8, %r8
lea addresses_WT_ht+0x601a, %rbp
nop
inc %rcx
movb (%rbp), %r10b
nop
nop
nop
xor $49297, %rcx
lea addresses_A_ht+0x160da, %r8
nop
nop
nop
nop
nop
cmp %r14, %r14
movb $0x61, (%r8)
nop
nop
nop
nop
and $29732, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r8
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r15
push %r8
push %r9
push %rax
push %rdx
push %rsi
// Store
lea addresses_US+0xddda, %r8
clflush (%r8)
nop
cmp $28430, %r9
movb $0x51, (%r8)
nop
nop
nop
nop
xor %rax, %rax
// Faulty Load
lea addresses_normal+0x601a, %r8
nop
nop
nop
and $50440, %rdx
mov (%r8), %ax
lea oracles, %rsi
and $0xff, %rax
shlq $12, %rax
mov (%rsi,%rax,1), %rax
pop %rsi
pop %rdx
pop %rax
pop %r9
pop %r8
pop %r15
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': True, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 2, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 7, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 11, 'size': 1, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': True, 'NT': False}}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 32.812245
| 2,999
| 0.656923
|
efc376182a105abc2eae0ce18df38da4b14bc490
| 360
|
asm
|
Assembly
|
programs/oeis/319/A319013.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/319/A319013.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/319/A319013.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A319013: a(n) is the sum over each permutation of S_n of the least element of the descent set.
; 0,1,7,37,201,1231,8653,69273,623521,6235291,68588301,823059733,10699776673,149796873591,2246953104061,35951249665201,611171244308673,11001082397556403,209020565553571981,4180411311071439981
lpb $0,1
add $2,$0
add $3,$2
mul $2,$0
sub $0,1
lpe
mov $1,$3
| 32.727273
| 191
| 0.766667
|
460593d8062372ee2694978ce9f7f00a2264f4a7
| 452
|
asm
|
Assembly
|
oeis/349/A349664.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/349/A349664.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/349/A349664.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A349664: a(n) is the number of solutions for n^4 = z^2 - x^2 with {z,x} >= 1.
; Submitted by Christian Krause
; 0,1,2,3,2,7,2,5,4,7,2,17,2,7,12,7,2,13,2,17,12,7,2,27,4,7,6,17,2,37,2,9,12,7,12,31,2,7,12,27,2,37,2,17,22,7,2,37,4,13,12,17,2,19,12,27,12,7,2,87,2,7,22,11,12,37,2,17,12,37,2,49,2,7,22,17,12,37,2,37,8,7,2,87,12,7,12,27,2,67,12,17,12,7,12,47,2,13,22,31
add $0,1
pow $0,2
sub $0,1
seq $0,46079 ; Number of Pythagorean triangles with leg n.
| 50.222222
| 252
| 0.628319
|
9f9459c754b7b3fe2984ffe69f95f5abed9bd7ad
| 6,487
|
asm
|
Assembly
|
Source/Levels/L1105.asm
|
AbePralle/FGB
|
52f004b8d9d4091a2a242a012dc8c1f90d4c160d
|
[
"MIT"
] | null | null | null |
Source/Levels/L1105.asm
|
AbePralle/FGB
|
52f004b8d9d4091a2a242a012dc8c1f90d4c160d
|
[
"MIT"
] | null | null | null |
Source/Levels/L1105.asm
|
AbePralle/FGB
|
52f004b8d9d4091a2a242a012dc8c1f90d4c160d
|
[
"MIT"
] | null | null | null |
; L1105.asm Save game screen
; Generated 05.09.2001 by mlevel
; Modified 05.09.2001 by Abe Pralle
INCLUDE "Source/Defs.inc"
INCLUDE "Source/Levels.inc"
VAR_SELECTION EQU 0
;---------------------------------------------------------------------
SECTION "Level1105Gfx1",ROMX
;---------------------------------------------------------------------
savegame_bg:
INCBIN "Data/Cinema/Appomattox/savegame.bg"
cantsave_bg:
INCBIN "Data/Cinema/Appomattox/cantsave.bg"
;---------------------------------------------------------------------
SECTION "Level1105Gfx2",ROMX
;---------------------------------------------------------------------
cantsave_flying_bg:
INCBIN "Data/Cinema/Appomattox/cantsave_flying.bg"
;---------------------------------------------------------------------
SECTION "Level1105Section",ROMX
;---------------------------------------------------------------------
L1105_Contents::
DW L1105_Load
DW L1105_Init
DW L1105_Check
DW L1105_Map
;---------------------------------------------------------------------
; Load
;---------------------------------------------------------------------
L1105_Load:
DW ((L1105_LoadFinished - L1105_Load2)) ;size
L1105_Load2:
ld a,[amLinkMaster]
or a
jp z,((.amSlave-L1105_Load2)+levelCheckRAM)
ld a,[appomattoxMapIndex]
or a
jp z,((.amFlying-L1105_Load2)+levelCheckRAM)
ld a,BANK(savegame_bg)
ld hl,savegame_bg
call LoadCinemaBG
ld a,15
call SetupFadeFromStandard
call WaitFade
xor a
ld [levelVars+VAR_SELECTION],a
.waitSelection
call ((.blitCurSelection-L1105_Load2)+levelCheckRAM)
ld a,1
call Delay
ld a,[myJoy]
bit JOY_UP_BIT,a
jr z,.checkDown
xor a
ld [levelVars+VAR_SELECTION],a
jr .checkDone
.checkDown
bit JOY_DOWN_BIT,a
jr z,.checkDone
ld a,1
ld [levelVars+VAR_SELECTION],a
.checkDone
ld a,[myJoy]
bit JOY_A_BIT,a
jr z,.waitSelection
ld a,[levelVars+VAR_SELECTION]
or a
call z,((.saveGame-L1105_Load2)+levelCheckRAM)
ld a,15
call SetupFadeToStandard
call WaitFade
ld a,EXIT_S
ld [hero0_enterLevelFacing],a
ld [hero1_enterLevelFacing],a
ld hl,$1300
ld a,l
ld [curLevelIndex],a
ld a,h
ld [curLevelIndex+1],a
ld a,1
ld [timeToChangeLevel],a
ret
.saveGame
ld a,$0a ;enable save ram access
ld [0],a
ld hl,$a000 ;start of save area $a000-$bfff
ld de,gameState
ld bc,9
xor a
call ((.saveData-L1105_Load2)+levelCheckRAM)
ld de,inventory
ld bc,16
xor a
call ((.saveData-L1105_Load2)+levelCheckRAM)
ld de,levelState
ld bc,256
ld a,LEVELSTATEBANK
call ((.saveData-L1105_Load2)+levelCheckRAM)
ld de,flightCode
ld bc,256
ld a,FLIGHTCODEBANK
call ((.saveData-L1105_Load2)+levelCheckRAM)
xor a
ld [0],a ;disable save ram to prevent false writes on powerdown
;blit "saved"
ld bc,$0a06
ld de,$0509
ld hl,$1412
call CinemaBlitRect
ld a,15
call Delay
ret
.saveData
;copies "bc" # of bytes from [de] to [hl] in bank "a"
ldio [$ff70],a
.saveLoop
ld a,[de]
inc de
ld [hl+],a
dec bc
xor a
cp b
jr nz,.saveLoop
cp c
jr nz,.saveLoop
ret
.blitCurSelection
ldio a,[updateTimer]
and %1000
jr z,.blitAppropriateCursor
;blit empty space
ld bc,$0a06
ld de,$0509
ld hl,$1400
call CinemaBlitRect
ret
.blitAppropriateCursor
ld a,[levelVars+VAR_SELECTION] ;selection * 6 + 6
rlca
ld b,a
rlca
add b
add 6
ld l,a
ld h,$14
ld bc,$0a06
ld de,$0509
call CinemaBlitRect
ret
.amFlying
ld a,BANK(cantsave_flying_bg)
ld hl,cantsave_flying_bg
call LoadCinemaBG
jr .showReason
.amSlave
ld a,BANK(cantsave_bg)
ld hl,cantsave_bg
call LoadCinemaBG
.showReason
ld a,15
call SetupFadeFromStandard
call WaitFade
ld de,((.returnToShip-L1105_Load2)+levelCheckRAM)
call SetDialogForward
call SetDialogSkip
ld a,150
call Delay
.returnToShip
call ClearDialogSkipForward
ld a,15
call SetupFadeToStandard
call WaitFade
ld a,EXIT_S
ld [hero0_enterLevelFacing],a
ld [hero1_enterLevelFacing],a
ld hl,$1300
ld a,l
ld [curLevelIndex],a
ld a,h
ld [curLevelIndex+1],a
ld a,1
ld [timeToChangeLevel],a
ret
L1105_LoadFinished:
;---------------------------------------------------------------------
; Map
;---------------------------------------------------------------------
L1105_Map:
;---------------------------------------------------------------------
; Init
;---------------------------------------------------------------------
L1105_Init:
DW ((L1105_InitFinished - L1105_Init2)) ;size
L1105_Init2:
ret
L1105_InitFinished:
;---------------------------------------------------------------------
; Check
;---------------------------------------------------------------------
L1105_Check:
DW ((L1105_CheckFinished - L1105_Check2)) ;size
L1105_Check2:
ret
L1105_CheckFinished:
PRINT "1105 Script Sizes (Load/Init/Check) (of $500): "
PRINT (L1105_LoadFinished - L1105_Load2)
PRINT " / "
PRINT (L1105_InitFinished - L1105_Init2)
PRINT " / "
PRINT (L1105_CheckFinished - L1105_Check2)
PRINT "\n"
| 24.854406
| 82
| 0.443348
|
d6d516fbd737410f6a5f6df3f2354edb7f4777ee
| 720
|
asm
|
Assembly
|
oeis/096/A096617.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/096/A096617.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/096/A096617.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A096617: Numerator of n*HarmonicNumber(n).
; Submitted by Jamie Morken(w1)
; 1,3,11,25,137,147,363,761,7129,7381,83711,86021,1145993,1171733,1195757,2436559,42142223,42822903,275295799,279175675,56574159,19093197,444316699,1347822955,34052522467,34395742267,312536252003,315404588903,9227046511387,9304682830147,290774257297357,586061125622639,590436990861839,54062195834749,54437269998109,54801925434709,2040798836801833,2053580969474233,2066035355155033,2078178381193813,85691034670497533,86165190925345133,532145396070491417,5884182435213075787,5914085889685464427
add $0,1
mov $2,1
mov $3,$0
lpb $3
mul $1,$3
mov $4,$3
add $4,1
mul $2,$4
add $1,$2
sub $3,1
lpe
mul $1,$0
gcd $2,$1
div $1,$2
mov $0,$1
| 36
| 492
| 0.8
|
3fae4db749a45d2355a50ec0e74d62293a9c6714
| 337
|
asm
|
Assembly
|
libsrc/osca/create_file.asm
|
grancier/z180
|
e83f35e36c9b4d1457e40585019430e901c86ed9
|
[
"ClArtistic"
] | null | null | null |
libsrc/osca/create_file.asm
|
grancier/z180
|
e83f35e36c9b4d1457e40585019430e901c86ed9
|
[
"ClArtistic"
] | null | null | null |
libsrc/osca/create_file.asm
|
grancier/z180
|
e83f35e36c9b4d1457e40585019430e901c86ed9
|
[
"ClArtistic"
] | 1
|
2019-12-03T23:57:48.000Z
|
2019-12-03T23:57:48.000Z
|
;
; Old School Computer Architecture - interfacing FLOS
; Stefano Bodrato, 2011
;
;
; $Id: create_file.asm,v 1.3 2016/06/22 22:13:09 dom Exp $
;
INCLUDE "flos.def"
SECTION code_clib
PUBLIC create_file
PUBLIC _create_file
EXTERN flos_err
create_file:
_create_file:
; __FASTCALL__
call kjt_create_file
jp flos_err
| 16.047619
| 58
| 0.724036
|
385dccb6521c452c8aededc14706f8d7bf2e2b48
| 597
|
asm
|
Assembly
|
oeis/158/A158447.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/158/A158447.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/158/A158447.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A158447: a(n) = 10*n^2 - 1.
; Submitted by Christian Krause
; 9,39,89,159,249,359,489,639,809,999,1209,1439,1689,1959,2249,2559,2889,3239,3609,3999,4409,4839,5289,5759,6249,6759,7289,7839,8409,8999,9609,10239,10889,11559,12249,12959,13689,14439,15209,15999,16809,17639,18489,19359,20249,21159,22089,23039,24009,24999,26009,27039,28089,29159,30249,31359,32489,33639,34809,35999,37209,38439,39689,40959,42249,43559,44889,46239,47609,48999,50409,51839,53289,54759,56249,57759,59289,60839,62409,63999,65609,67239,68889,70559,72249,73959,75689,77439,79209,80999
add $0,1
pow $0,2
mul $0,10
sub $0,1
| 66.333333
| 496
| 0.78057
|
e7c15e4d2c081024abf7f1edd865d8fbb501608d
| 19,938
|
asm
|
Assembly
|
src/native/third_party/isa-l_crypto/sha256_mb/sha256_opt_x1.asm
|
guptsanj/noobaa-core
|
91b01ec8d537780d3b0a7a9a20065000167d882a
|
[
"Apache-2.0"
] | null | null | null |
src/native/third_party/isa-l_crypto/sha256_mb/sha256_opt_x1.asm
|
guptsanj/noobaa-core
|
91b01ec8d537780d3b0a7a9a20065000167d882a
|
[
"Apache-2.0"
] | null | null | null |
src/native/third_party/isa-l_crypto/sha256_mb/sha256_opt_x1.asm
|
guptsanj/noobaa-core
|
91b01ec8d537780d3b0a7a9a20065000167d882a
|
[
"Apache-2.0"
] | null | null | null |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Implement fast SHA-256 with SSSE3 instructions. (x86_64)
;
; Copyright (C) 2013 Intel Corporation.
;
; Authors:
; James Guilford <james.guilford@intel.com>
; Kirk Yap <kirk.s.yap@intel.com>
; Tim Chen <tim.c.chen@linux.intel.com>
; Transcoded by:
; Xiaodong Liu <xiaodong.liu@intel.com>
;
; This software is available to you under the OpenIB.org BSD license
; below:
;
; Redistribution and use in source and binary forms, with or
; without modification, are permitted provided that the following
; conditions are met:
;
; - Redistributions of source code must retain the above
; copyright notice, this list of conditions and the following
; disclaimer.
;
; - Redistributions in binary form must reproduce the above
; copyright notice, this list of conditions and the following
; disclaimer in the documentation and/or other materials
; provided with the distribution.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; This code is described in an Intel White-Paper:
; "Fast SHA-256 Implementations on Intel Architecture Processors"
;
; To find it, surf to http://www.intel.com/p/en_US/embedded
; and search for that title.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%include "sha256_mb_mgr_datastruct.asm"
%include "reg_sizes.asm"
default rel
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
%ifidn __OUTPUT_FORMAT__, elf64
; Linux
%define arg0 rdi
%define arg1 rsi
%else
; Windows
%define arg0 rcx
%define arg1 rdx
%endif
%xdefine X0 xmm4
%xdefine X1 xmm5
%xdefine X2 xmm6
%xdefine X3 xmm7
%xdefine XTMP0 xmm0
%xdefine XTMP1 xmm1
%xdefine XTMP2 xmm2
%xdefine XTMP3 xmm3
%xdefine XTMP4 xmm8
%xdefine XFER xmm9
%define SHUF_00BA xmm10 ; shuffle xBxA -> 00BA
%define SHUF_DC00 xmm11 ; shuffle xDxC -> DC00
%define BYTE_FLIP_MASK xmm12
; arg index is start from 0 while mgr_flush/submit is from 1
%define MGR arg0 ; rdi or rcx
%define NBLK arg1 ; rsi or rdx
%define IDX r8 ; local variable -- consistent with caller
%define NLANX4 r10 ; consistent with caller, should be r10
%define TMGR r9 ; data pointer stored in stack named _TMGR
%define INP r9 ; data pointer stored in stack named _INP
%define SRND r9 ; clobbers INP
%define TMP r9 ; local variable -- assistant to address digest
%xdefine TBL rbp
%xdefine c ecx
%xdefine d esi
%xdefine e edx
%xdefine a eax
%xdefine b ebx
%xdefine f edi
%xdefine g r12d
%xdefine h r11d
%xdefine y0 r13d
%xdefine y1 r14d
%xdefine y2 r15d
;; FRAMESZ plus pushes must be an odd multiple of 8
%define _STACK_ALIGN_SIZE 8 ; 0 or 8 depends on pushes
%define _INP_END_SIZE 8
%define _INP_SIZE 8
%define _TMGR_SIZE 8
%define _XFER_SIZE 16
%define _XMM_SAVE_SIZE 0
%define _GPR_SAVE_SIZE 8*9 ;rbx, rdx, rbp, (rdi, rsi), r12~r15
%define _STACK_ALIGN 0
%define _INP_END (_STACK_ALIGN + _STACK_ALIGN_SIZE)
%define _INP (_INP_END + _INP_END_SIZE)
%define _TMGR (_INP + _INP_SIZE)
%define _XFER (_TMGR + _TMGR_SIZE)
%define _XMM_SAVE (_XFER + _XFER_SIZE)
%define _GPR_SAVE (_XMM_SAVE + _XMM_SAVE_SIZE)
%define STACK_SIZE (_GPR_SAVE + _GPR_SAVE_SIZE)
;; assume buffers not aligned
%define MOVDQ movdqu
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Define Macros
; addm [mem], reg
; Add reg to mem using reg-mem add and store
%macro addm 2
add %2, %1 ;changed
mov %1, %2 ;changed
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; COPY_XMM_AND_BSWAP xmm, [mem], byte_flip_mask
; Load xmm with mem and byte swap each dword
%macro COPY_XMM_AND_BSWAP 3
MOVDQ %1, %2 ;changed
pshufb %1, %3 ;changed
%endmacro
; rotate_Xs
; Rotate values of symbols X0...X3
%macro rotate_Xs 0
%xdefine X_ X0
%xdefine X0 X1
%xdefine X1 X2
%xdefine X2 X3
%xdefine X3 X_
%endmacro
; ROTATE_ARGS
; Rotate values of symbols a...h
%macro ROTATE_ARGS 0
%xdefine TMP_ h
%xdefine h g
%xdefine g f
%xdefine f e
%xdefine e d
%xdefine d c
%xdefine c b
%xdefine b a
%xdefine a TMP_
%endmacro
%macro FOUR_ROUNDS_AND_SCHED 0
;; compute s0 four at a time and s1 two at a time
;; compute W[-16] + W[-7] 4 at a time
movdqa XTMP0, X3
mov y0, e ; y0 = e
ror y0, (25-11) ; y0 = e >> (25-11)
mov y1, a ; y1 = a
palignr XTMP0, X2, 4 ; XTMP0 = W[-7]
ror y1, (22-13) ; y1 = a >> (22-13)
xor y0, e ; y0 = e ^ (e >> (25-11))
mov y2, f ; y2 = f
ror y0, (11-6) ; y0 = (e >> (11-6)) ^ (e >> (25-6))
movdqa XTMP1, X1
xor y1, a ; y1 = a ^ (a >> (22-13)
xor y2, g ; y2 = f^g
paddd XTMP0, X0 ; XTMP0 = W[-7] + W[-16]
xor y0, e ; y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
and y2, e ; y2 = (f^g)&e
ror y1, (13-2) ; y1 = (a >> (13-2)) ^ (a >> (22-2))
;; compute s0
palignr XTMP1, X0, 4 ; XTMP1 = W[-15]
xor y1, a ; y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
ror y0, 6 ; y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
xor y2, g ; y2 = CH = ((f^g)&e)^g
movdqa XTMP2, XTMP1 ; XTMP2 = W[-15]
ror y1, 2 ; y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
add y2, y0 ; y2 = S1 + CH
add y2 , [rsp + _XFER] ; y2 = k + w + S1 + CH
movdqa XTMP3, XTMP1 ; XTMP3 = W[-15]
mov y0, a ; y0 = a
add h, y2 ; h = h + S1 + CH + k + w
mov y2, a ; y2 = a
pslld XTMP1, (32-7) ;
or y0, c ; y0 = a|c
add d, h ; d = d + h + S1 + CH + k + w
and y2, c ; y2 = a&c
psrld XTMP2, 7 ;
and y0, b ; y0 = (a|c)&b
add h, y1 ; h = h + S1 + CH + k + w + S0
por XTMP1, XTMP2 ; XTMP1 = W[-15] ror 7
or y0, y2 ; y0 = MAJ = (a|c)&b)|(a&c)
add h, y0 ; h = h + S1 + CH + k + w + S0 + MAJ
ROTATE_ARGS
movdqa XTMP2, XTMP3 ; XTMP2 = W[-15]
mov y0, e ; y0 = e
mov y1, a ; y1 = a
movdqa XTMP4, XTMP3 ; XTMP4 = W[-15]
ror y0, (25-11) ; y0 = e >> (25-11)
xor y0, e ; y0 = e ^ (e >> (25-11))
mov y2, f ; y2 = f
ror y1, (22-13) ; y1 = a >> (22-13)
pslld XTMP3, (32-18) ;
xor y1, a ; y1 = a ^ (a >> (22-13)
ror y0, (11-6) ; y0 = (e >> (11-6)) ^ (e >> (25-6))
xor y2, g ; y2 = f^g
psrld XTMP2, 18 ;
ror y1, (13-2) ; y1 = (a >> (13-2)) ^ (a >> (22-2))
xor y0, e ; y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
and y2, e ; y2 = (f^g)&e
ror y0, 6 ; y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
pxor XTMP1, XTMP3
xor y1, a ; y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
xor y2, g ; y2 = CH = ((f^g)&e)^g
psrld XTMP4, 3 ; XTMP4 = W[-15] >> 3
add y2, y0 ; y2 = S1 + CH
add y2, [rsp + (1*4 + _XFER)] ; y2 = k + w + S1 + CH
ror y1, 2 ; y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
pxor XTMP1, XTMP2 ; XTMP1 = W[-15] ror 7 ^ W[-15] ror 18
mov y0, a ; y0 = a
add h, y2 ; h = h + S1 + CH + k + w
mov y2, a ; y2 = a
pxor XTMP1, XTMP4 ; XTMP1 = s0
or y0, c ; y0 = a|c
add d, h ; d = d + h + S1 + CH + k + w
and y2, c ; y2 = a&c
;; compute low s1
pshufd XTMP2, X3, 11111010B ; XTMP2 = W[-2] {BBAA}
and y0, b ; y0 = (a|c)&b
add h, y1 ; h = h + S1 + CH + k + w + S0
paddd XTMP0, XTMP1 ; XTMP0 = W[-16] + W[-7] + s0
or y0, y2 ; y0 = MAJ = (a|c)&b)|(a&c)
add h, y0 ; h = h + S1 + CH + k + w + S0 + MAJ
ROTATE_ARGS
movdqa XTMP3, XTMP2 ; XTMP3 = W[-2] {BBAA}
mov y0, e ; y0 = e
mov y1, a ; y1 = a
ror y0, (25-11) ; y0 = e >> (25-11)
movdqa XTMP4, XTMP2 ; XTMP4 = W[-2] {BBAA}
xor y0, e ; y0 = e ^ (e >> (25-11))
ror y1, (22-13) ; y1 = a >> (22-13)
mov y2, f ; y2 = f
xor y1, a ; y1 = a ^ (a >> (22-13)
ror y0, (11-6) ; y0 = (e >> (11-6)) ^ (e >> (25-6))
psrlq XTMP2, 17 ; XTMP2 = W[-2] ror 17 {xBxA}
xor y2, g ; y2 = f^g
psrlq XTMP3, 19 ; XTMP3 = W[-2] ror 19 {xBxA}
xor y0, e ; y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
and y2, e ; y2 = (f^g)&e
psrld XTMP4, 10 ; XTMP4 = W[-2] >> 10 {BBAA}
ror y1, (13-2) ; y1 = (a >> (13-2)) ^ (a >> (22-2))
xor y1, a ; y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
xor y2, g ; y2 = CH = ((f^g)&e)^g
ror y0, 6 ; y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
pxor XTMP2, XTMP3
add y2, y0 ; y2 = S1 + CH
ror y1, 2 ; y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
add y2, [rsp + (2*4 + _XFER)] ; y2 = k + w + S1 + CH
pxor XTMP4, XTMP2 ; XTMP4 = s1 {xBxA}
mov y0, a ; y0 = a
add h, y2 ; h = h + S1 + CH + k + w
mov y2, a ; y2 = a
pshufb XTMP4, SHUF_00BA ; XTMP4 = s1 {00BA}
or y0, c ; y0 = a|c
add d, h ; d = d + h + S1 + CH + k + w
and y2, c ; y2 = a&c
paddd XTMP0, XTMP4 ; XTMP0 = {..., ..., W[1], W[0]}
and y0, b ; y0 = (a|c)&b
add h, y1 ; h = h + S1 + CH + k + w + S0
;; compute high s1
pshufd XTMP2, XTMP0, 01010000B ; XTMP2 = W[-2] {BBAA}
or y0, y2 ; y0 = MAJ = (a|c)&b)|(a&c)
add h, y0 ; h = h + S1 + CH + k + w + S0 + MAJ
ROTATE_ARGS
movdqa XTMP3, XTMP2 ; XTMP3 = W[-2] {DDCC}
mov y0, e ; y0 = e
ror y0, (25-11) ; y0 = e >> (25-11)
mov y1, a ; y1 = a
movdqa X0, XTMP2 ; X0 = W[-2] {DDCC}
ror y1, (22-13) ; y1 = a >> (22-13)
xor y0, e ; y0 = e ^ (e >> (25-11))
mov y2, f ; y2 = f
ror y0, (11-6) ; y0 = (e >> (11-6)) ^ (e >> (25-6))
psrlq XTMP2, 17 ; XTMP2 = W[-2] ror 17 {xDxC}
xor y1, a ; y1 = a ^ (a >> (22-13)
xor y2, g ; y2 = f^g
psrlq XTMP3, 19 ; XTMP3 = W[-2] ror 19 {xDxC}
xor y0, e ; y0 = e ^ (e >> (11-6)) ^ (e >> (25
and y2, e ; y2 = (f^g)&e
ror y1, (13-2) ; y1 = (a >> (13-2)) ^ (a >> (22-2))
psrld X0, 10 ; X0 = W[-2] >> 10 {DDCC}
xor y1, a ; y1 = a ^ (a >> (13-2)) ^ (a >> (22
ror y0, 6 ; y0 = S1 = (e>>6) & (e>>11) ^ (e>>2
xor y2, g ; y2 = CH = ((f^g)&e)^g
pxor XTMP2, XTMP3 ;
ror y1, 2 ; y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>2
add y2, y0 ; y2 = S1 + CH
add y2, [rsp + (3*4 + _XFER)] ; y2 = k + w + S1 + CH
pxor X0, XTMP2 ; X0 = s1 {xDxC}
mov y0, a ; y0 = a
add h, y2 ; h = h + S1 + CH + k + w
mov y2, a ; y2 = a
pshufb X0, SHUF_DC00 ; X0 = s1 {DC00}
or y0, c ; y0 = a|c
add d, h ; d = d + h + S1 + CH + k + w
and y2, c ; y2 = a&c
paddd X0, XTMP0 ; X0 = {W[3], W[2], W[1], W[0]}
and y0, b ; y0 = (a|c)&b
add h, y1 ; h = h + S1 + CH + k + w + S0
or y0, y2 ; y0 = MAJ = (a|c)&b)|(a&c)
add h, y0 ; h = h + S1 + CH + k + w + S0 + MAJ
ROTATE_ARGS
rotate_Xs
%endmacro
;; input is [rsp + _XFER + %1 * 4]
%macro DO_ROUND 1
mov y0, e ; y0 = e
ror y0, (25-11) ; y0 = e >> (25-11)
mov y1, a ; y1 = a
xor y0, e ; y0 = e ^ (e >> (25-11))
ror y1, (22-13) ; y1 = a >> (22-13)
mov y2, f ; y2 = f
xor y1, a ; y1 = a ^ (a >> (22-13)
ror y0, (11-6) ; y0 = (e >> (11-6)) ^ (e >> (25-6))
xor y2, g ; y2 = f^g
xor y0, e ; y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))
ror y1, (13-2) ; y1 = (a >> (13-2)) ^ (a >> (22-2))
and y2, e ; y2 = (f^g)&e
xor y1, a ; y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))
ror y0, 6 ; y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)
xor y2, g ; y2 = CH = ((f^g)&e)^g
add y2, y0 ; y2 = S1 + CH
ror y1, 2 ; y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)
%xdefine offset (%1 * 4 + _XFER)
add y2, [rsp + offset] ; y2 = k + w + S1 + CH
mov y0, a ; y0 = a
add h, y2 ; h = h + S1 + CH + k + w
mov y2, a ; y2 = a
or y0, c ; y0 = a|c
add d, h ; d = d + h + S1 + CH + k + w
and y2, c ; y2 = a&c
and y0, b ; y0 = (a|c)&b
add h, y1 ; h = h + S1 + CH + k + w + S0
or y0, y2 ; y0 = MAJ = (a|c)&b)|(a&c)
add h, y0 ; h = h + S1 + CH + k + w + S0 + MAJ
ROTATE_ARGS
%endmacro
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; void sha1_opt_x1(SHA1_MB_ARGS_Xn *args, uint32_t size_in_blocks);
; arg 0 : MGR : pointer to args (only 4 of the 16 lanes used)
; arg 1 : NBLK : size (in blocks) ;; assumed to be >= 1
; invisibile arg 2 : IDX : hash on which lane
; invisibile arg 3 : NLANX4 : max lanes*4 for this arch (digest is placed by it)
; (sse/avx is 4, avx2 is 8, avx512 is 16)
;
; Clobbers registers: all general regs, xmm0-xmm12
; {rbx, rdx, rbp, (rdi, rsi), r12~r15 are saved on stack}
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
section .text
global sha256_opt_x1:function internal
sha256_opt_x1:
sub rsp, STACK_SIZE
mov [rsp + _GPR_SAVE + 8*0], rbx
mov [rsp + _GPR_SAVE + 8*1], rbp
%ifidn __OUTPUT_FORMAT__, win64
mov [rsp + _GPR_SAVE + 8*2], rdi
mov [rsp + _GPR_SAVE + 8*3], rsi
; caller has already stored XMM6~10
%endif
mov [rsp + _GPR_SAVE + 8*4], r12
mov [rsp + _GPR_SAVE + 8*5], r13
mov [rsp + _GPR_SAVE + 8*6], r14
mov [rsp + _GPR_SAVE + 8*7], r15
mov [rsp + _GPR_SAVE + 8*8], rdx
shl NBLK, 6 ; convert to bytes
jz done_hash
; detach idx from nlanx4
mov IDX, NLANX4
shr NLANX4, 8
and IDX, 0xff
mov [rsp + _TMGR], MGR
;; Load input pointers
mov INP, [MGR + _data_ptr + IDX*8]
mov [rsp + _INP], INP
;; nblk is used to indicate data end
add NBLK, INP
mov [rsp + _INP_END], NBLK ; pointer to end of data
mov TMGR, [rsp + _TMGR]
;; load initial digest
lea TMP, [TMGR + 4*IDX]
mov a, [TMP + 0*NLANX4]
mov b, [TMP + 1*NLANX4]
mov c, [TMP + 2*NLANX4]
lea TMP, [TMP + 2*NLANX4] ; MGR + 4*IDX + 2*NLANX4
mov d, [TMP + 1*NLANX4]
mov e, [TMP + 2*NLANX4]
mov g, [TMP + 4*NLANX4]
lea TMP, [TMP + 1*NLANX4] ; MGR + 4*IDX + 3*NLANX4
mov f, [TMP + 2*NLANX4]
mov h, [TMP + 4*NLANX4]
movdqa BYTE_FLIP_MASK, [PSHUFFLE_BYTE_FLIP_MASK]
movdqa SHUF_00BA, [_SHUF_00BA]
movdqa SHUF_DC00, [_SHUF_DC00]
mov INP, [rsp + _INP]
loop0:
lea TBL, [K256]
;; byte swap first 16 dwords
COPY_XMM_AND_BSWAP X0, [INP + 0*16], BYTE_FLIP_MASK
COPY_XMM_AND_BSWAP X1, [INP + 1*16], BYTE_FLIP_MASK
COPY_XMM_AND_BSWAP X2, [INP + 2*16], BYTE_FLIP_MASK
COPY_XMM_AND_BSWAP X3, [INP + 3*16], BYTE_FLIP_MASK
mov [rsp + _INP], INP
;; schedule 48 input dwords, by doing 3 rounds of 16 each
mov SRND, 3
loop1:
movdqa XFER, [TBL]
paddd XFER, X0
movdqa [rsp + _XFER], XFER
FOUR_ROUNDS_AND_SCHED
movdqa XFER, [TBL + 1*16]
paddd XFER, X0
movdqa [rsp + _XFER], XFER
FOUR_ROUNDS_AND_SCHED
movdqa XFER, [TBL + 2*16]
paddd XFER, X0
movdqa [rsp + _XFER], XFER
FOUR_ROUNDS_AND_SCHED
movdqa XFER, [TBL + 3*16]
paddd XFER, X0
movdqa [rsp + _XFER], XFER
add TBL, 4*16
FOUR_ROUNDS_AND_SCHED
sub SRND, 1
jne loop1
mov SRND, 2
loop2:
paddd X0, [TBL]
movdqa [rsp + _XFER], X0
DO_ROUND 0
DO_ROUND 1
DO_ROUND 2
DO_ROUND 3
paddd X1, [TBL + 1*16]
movdqa [rsp + _XFER], X1
add TBL, 2*16
DO_ROUND 0
DO_ROUND 1
DO_ROUND 2
DO_ROUND 3
movdqa X0, X2
movdqa X1, X3
sub SRND, 1
jne loop2
; write out digests
mov TMGR, [rsp + _TMGR]
lea TMP, [TMGR + 4*IDX]
addm a, [TMP + 0*NLANX4]
addm b, [TMP + 1*NLANX4]
addm c, [TMP + 2*NLANX4]
lea TMP, [TMP + 2*NLANX4] ; MGR + 4*IDX + 2*NLANX4
addm d, [TMP + 1*NLANX4]
addm e, [TMP + 2*NLANX4]
addm g, [TMP + 4*NLANX4]
lea TMP, [TMP + 1*NLANX4] ; MGR + 4*IDX + 3*NLANX4
addm f, [TMP + 2*NLANX4]
addm h, [TMP + 4*NLANX4]
mov INP, [rsp + _INP]
add INP, 64
cmp INP, [rsp + _INP_END]
jne loop0
done_hash:
mov MGR, [rsp + _TMGR]
mov rdx, [rsp + _GPR_SAVE + 8*8]
mov r15, [rsp + _GPR_SAVE + 8*7]
mov r14, [rsp + _GPR_SAVE + 8*6]
mov r13, [rsp + _GPR_SAVE + 8*5]
mov r12, [rsp + _GPR_SAVE + 8*4]
%ifidn __OUTPUT_FORMAT__, win64
mov rsi, [rsp + _GPR_SAVE + 8*3]
mov rdi, [rsp + _GPR_SAVE + 8*2]
%endif
mov rbp, [rsp + _GPR_SAVE + 8*1]
mov rbx, [rsp + _GPR_SAVE + 8*0]
add rsp, STACK_SIZE
ret
section .data
align 64
K256:
DD 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
DD 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
DD 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
DD 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
DD 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
DD 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
DD 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
DD 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
DD 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
DD 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
DD 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
DD 0xd192e819,0xd6990624,0xf40e3585,0x106aa070
DD 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
DD 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
DD 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
DD 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
PSHUFFLE_BYTE_FLIP_MASK:
DQ 0x0405060700010203, 0x0c0d0e0f08090a0b
; shuffle xBxA -> 00BA
_SHUF_00BA:
DQ 0x0b0a090803020100, 0xFFFFFFFFFFFFFFFF
; shuffle xDxC -> DC00
_SHUF_DC00:
DQ 0xFFFFFFFFFFFFFFFF, 0x0b0a090803020100
| 35.288496
| 80
| 0.475324
|
44621a78b5a7d60798f260070f932327b85f2c46
| 407
|
asm
|
Assembly
|
oeis/036/A036502.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/036/A036502.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/036/A036502.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A036502: Numerator of n^(n-2)/n!.
; Submitted by Christian Krause
; 1,1,1,2,25,9,2401,2048,59049,15625,214358881,248832,137858491849,564950498,21357421875,2199023255552,168377826559400929,282429536481,288441413567621167681,1600000000000000,1962371317204369449,11119834626984462962
add $0,1
mov $1,1
mov $2,$0
pow $2,2
mov $3,$0
lpb $3
mul $1,$0
mul $2,$3
sub $3,1
lpe
gcd $2,$1
div $1,$2
mov $0,$1
| 22.611111
| 214
| 0.739558
|
faf0eb456f014284cdc1c304d055a7dd17f3e19e
| 6,799
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1026.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.log_21829_1026.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.log_21829_1026.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 %r14
push %r15
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x18665, %r14
clflush (%r14)
nop
cmp $47109, %r12
mov (%r14), %rcx
nop
nop
nop
nop
add %r10, %r10
lea addresses_A_ht+0x105ba, %rbx
mfence
mov $0x6162636465666768, %rdx
movq %rdx, %xmm0
movups %xmm0, (%rbx)
nop
and $10914, %r15
lea addresses_normal_ht+0x18065, %rdx
nop
nop
dec %r14
movb (%rdx), %r12b
nop
nop
cmp $5449, %r12
lea addresses_normal_ht+0xd965, %rsi
lea addresses_WC_ht+0x1040d, %rdi
nop
nop
nop
nop
nop
sub $22786, %r12
mov $118, %rcx
rep movsq
nop
nop
nop
nop
add %rdi, %rdi
lea addresses_WT_ht+0x10165, %rsi
lea addresses_WT_ht+0x10065, %rdi
nop
nop
and $13244, %r15
mov $51, %rcx
rep movsb
sub $26397, %rdx
lea addresses_A_ht+0x3be9, %r14
nop
and $30929, %r12
mov $0x6162636465666768, %rcx
movq %rcx, %xmm3
movups %xmm3, (%r14)
nop
nop
inc %r12
lea addresses_WT_ht+0xb865, %rsi
lea addresses_WT_ht+0x3be5, %rdi
nop
nop
nop
nop
nop
add %r10, %r10
mov $93, %rcx
rep movsl
nop
nop
sub %rdi, %rdi
lea addresses_normal_ht+0x19a25, %rbx
clflush (%rbx)
nop
nop
add %rsi, %rsi
mov $0x6162636465666768, %rcx
movq %rcx, (%rbx)
nop
nop
nop
and %r15, %r15
lea addresses_WC_ht+0x15e9d, %rcx
xor %r15, %r15
movb (%rcx), %r14b
nop
nop
cmp %rdx, %rdx
lea addresses_A_ht+0x1a065, %rcx
nop
nop
nop
add $30871, %r10
movw $0x6162, (%rcx)
nop
sub %rsi, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r8
push %rbp
push %rcx
push %rdi
push %rsi
// REPMOV
lea addresses_D+0x1d865, %rsi
lea addresses_A+0x1e0a5, %rdi
nop
xor $16533, %r14
mov $28, %rcx
rep movsb
nop
nop
cmp $8359, %rbp
// Faulty Load
lea addresses_D+0x11865, %r14
nop
nop
nop
nop
cmp $3348, %rbp
movups (%r14), %xmm2
vpextrq $0, %xmm2, %rcx
lea oracles, %r12
and $0xff, %rcx
shlq $12, %rcx
mov (%r12,%rcx,1), %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 9, 'type': 'addresses_D'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_A'}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_D', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': True, 'same': False, 'congruent': 5, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}}
{'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 16}}
{'src': {'same': True, 'congruent': 11, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8}}
{'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 9, 'type': 'addresses_A_ht', 'AVXalign': True, 'size': 2}}
{'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
*/
| 37.357143
| 2,999
| 0.659215
|
0791063ce488f0461371436d2a11fc5156431cf5
| 108,119
|
asm
|
Assembly
|
fallingblocks.asm
|
soiaf/FallingBlocks
|
b03087bb829c193811c8858df10eb2f0720b5cb3
|
[
"BSD-3-Clause"
] | 20
|
2015-05-23T18:44:21.000Z
|
2021-07-15T14:35:48.000Z
|
fallingblocks.asm
|
soiaf/FallingBlocks
|
b03087bb829c193811c8858df10eb2f0720b5cb3
|
[
"BSD-3-Clause"
] | 1
|
2016-03-24T18:34:50.000Z
|
2016-05-28T12:51:44.000Z
|
fallingblocks.asm
|
soiaf/FallingBlocks
|
b03087bb829c193811c8858df10eb2f0720b5cb3
|
[
"BSD-3-Clause"
] | 3
|
2017-02-22T05:40:59.000Z
|
2017-11-23T21:03:35.000Z
|
;
; FallingBlocks.asm
;
; Copyright (c) 2015-2016 Peter McQuillan
;
; All Rights Reserved.
;
; Distributed under the BSD Software License (see license.txt)
;
;
org 24576
; set up our own routines. Two elements, a table that points to where the interrupt code is
; held and the actual interrupt code itself. Due to the strange way interrupts work on spectrum
; our table is a series of the value 200. The idea is that an interrupt call would randomly jump
; to somewhere in this table and read the values 200 (2 reads) 0 this gives a memory location of
; (200*256) + 200 = 51400, which is where we will put our actual interrupt routine
; We put our table out of the way, starting at 65024 (which is 256 * 254)
di ; we are setting up out own interrupt routine, disable while doing this
ld a,254 ; high byte of pointer table location (256 * 254 gives 65024).
ld i,a ; set high byte.
im 2 ; select interrupt mode 2.
ei ; enable interrupts.
jp START
graphics
defb 254, 126, 190, 94, 174, 86, 170, 0 ; basic block
defb 126, 129, 189, 165, 165, 189, 129, 126 ; old side wall graphic
defb 231, 231, 231, 231, 231, 231, 231, 231 ;vertical pipe
defb 60, 126, 126, 231, 231, 231, 231, 231 ;pipe end (top)
defb 231, 231, 231, 231, 231, 126, 126, 60 ; pipe end (bottom)
defb 255, 255, 255, 0, 0, 255, 255, 255 ;horizontal pipe
defb 231, 231, 227, 224, 240, 255, 127, 63 ; pipe corner bottom left
defb 63, 127, 255, 240, 224, 227, 231, 231 ; pipe corner top left
defb 231, 231, 199, 7, 15, 255, 254, 252 ; pipe corner bottom right
defb 252, 254, 255, 15, 7, 199, 231, 231 ; pipe corner top right
defb 8, 4, 2, 255, 2, 4, 8, 0, 56 ; arrow pointing right
;Port array used for the redefine keys routine
port_array: defb $7f ; B-SPACE
defb $bf ; H-ENTER
defb $df ; Y-P
defb $ef ; 6-0
defb $f7 ; 1-5
defb $fb ; Q-T
defb $fd ; A-G
defb $fe ; CAPS-V
key_music_port: defb $7f
key_music_pattern: defb 4
key_left_port: defb $df
key_left_pattern: defb 2
key_right_port: defb $df
key_right_pattern: defb 1
key_anticlockwise_port: defb $7f
key_anticlockwise_pattern: defb 1
key_clockwise_port: defb $bf
key_clockwise_pattern: defb 16
key_drop_port: defb $fd
key_drop_pattern: defb 4
key_ghost_port: defb $fd
key_ghost_pattern: defb 16
key_swap_port: defb $fd
key_swap_pattern: defb 2
ROM_CLS: EQU 3435
CHAN_OPEN: EQU 5633
CC_INK: EQU 16
CC_PAPER: EQU 17
CC_AT: EQU 22
msg_left: defm CC_INK,4,CC_AT,7,8,"Left ?",255
msg_right: defm CC_INK,4,CC_AT,8,8,"Right ?",255
msg_anticlockwise: defm CC_INK,4,CC_AT,9,8,"Anti Clockwise ?",255
msg_clockwise: defm CC_INK,4,CC_AT,10,8,"Clockwise ?",255
msg_drop: defm CC_INK,4,CC_AT,11,8,"Drop ?",255
msg_ghost: defm CC_INK,4,CC_AT,12,8,"Ghost ?",255
msg_swap: defm CC_INK,4,CC_AT,13,8,"Swap/Save ?",255
msg_music: defm CC_INK,4,CC_AT,14,8,"Music On/Off ?",255
msg_define: defm CC_INK,4,CC_AT,1,7,"Press key for ...",255
msg_gameover_score: defm CC_INK,7,CC_AT,17,10,"Your score",255
msg_gameover_newhighscore defm CC_INK,4,CC_AT,21,0,"Congratulations! New high score",255
msg_newscreen_level defm CC_INK,7,CC_AT,12,12,"Level ",255
startx defb 0 ; all blocks start at this position
starty defb 15 ; all blocks start at this position
upsidedownstartx defb 20 ; starting x position if upside down
nextblockx defb 11 ;x position of the next block space
nextblocky defb 25 ;y position of the next block space
scorex defb 4 ;x position where we write the score
scorey defb 25 ; y position where we write the score
highscorex defb 4 ; x position where we write the high score
highscorey defb 3 ; y position where we write the high score
savedblockx defb 11 ;x position of the saved block space
savedblocky defb 4 ;y position of the saved block space
ghostx defb 0 ;x position of the ghost shape
ghosty defb 15 ;y position of the ghost shape
linesx defb 18 ; x position of where we write the lines completed
linesy defb 25 ; y position of where we write the lines completed
shootingstarx defb 0 ; x position of the star
shootingstary defb 0 ; y position of the star
; holds the row that will be shifted one column left or right
slidingrow defb 0
; sliding attempt counter. We try 20 times to find a row to slide, but if not we exit
; this is to prevent the (unlikely) case of no pieces currently being on the playarea
slidingcounter defb 0
; when we slide a row we wrap around the blocks, this holds the value of the wrapped around block
slidingwraparoundcolour defb 0
; this is the temp holder for colours used in the sliding floors routine
slidingtempcolour defb 0
; This holds the colour of the ghost shape (bright white)
ghostcolour defb 71
; this is used for determining whether the ghost is actually showing, for example may not be
; due to shape being too near the top of the piled blocks
ghostshowing defb 0
; This defines the top line starting position, this is used when erasing the line
; after a winning line is detected
playareatoplinex defb 0
playareatopliney defb 12
upsidedownplayareatoplinex defb 21 ; top line when upside down
plx defb 4 ; player's x coordinate.
ply defb 4 ; player's y coordinate.
tmpx defb 16
tmpy defb 16
wallpos defb 3
shapedata
defb 15,0 ; shape 1
defb 68,68
defb 15,0
defb 68,68
defb 142,0 ; shape 2
defb 68,192
defb 14,32
defb 200,128
defb 46,0 ;shape 3
defb 196,64
defb 232,0
defb 136,192
defb 204,0 ;shape 4
defb 204,0
defb 204,0
defb 204,0
defb 108,0 ; shape 5
defb 140,64
defb 108,0
defb 140,64
defb 78,0 ; shape 6
defb 76,64
defb 14,64
defb 140,128
defb 198,0 ; shape 7
defb 76,128
defb 198,0
defb 76,128 ; this is the end of the standard blocks
defb 72,0 ;shape 8
defb 132,0
defb 72,0
defb 132,0
defb 200,192 ;shape 9
defb 174,0
defb 196,192
defb 14,160
defb 12,0 ; shape 10
defb 68,0
defb 12,0
defb 68,0
defb 164,0 ; shape 11
defb 132,128
defb 74,0
defb 72,64
defb 78,64 ; shape 12
defb 78,64
defb 78,64
defb 78,64
; this holds the offset for ghost. Basically it is the number of increments you would
; need to take for a shape to be no longer blocking itself
ghostoffset
defb 1,4,1,4
defb 2,3,2,3
defb 2,3,2,3
defb 2,2,2,2
defb 2,2,2,2
defb 2,3,2,3
defb 2,2,2,2
defb 1,1,1,1
defb 3,2,3,2
defb 1,2,1,2
defb 1,3,1,3
defb 3,3,3,3
; this table helps find the correct ghost offset
ghostlookuptable defb 0,4,8,12,16,20,24,28,32,36,40,44
; ghost offset value pointer
ghostpointer defb 0
; this gives the colour of each of the shapes
colourlookuptable defb 5,1,67,6,4,3,2,66,68,69,70,65
blockshapes defb 142,0
; this holds the current shape being shown
currentshape defb 3
; this holds the next shape that will be played
nextshape defb 2
; this holds the saved shape
savedshape defb 0
currentorientation defb 0
blockpointer defb 0
blocklookuptable defb 0,8,16,24,32,40,48,56,64,72,80,88
; this is the number of complete lines required to win each level
linesneededperlevel defb 10,6,6,5,4,8,5,5,4,25
;linesneededperlevel defb 1,3,4,1,1,1,1,1,1,1
; this holds what level the player is currently on
currentlevel defb 1
; this holds the total number of lines completed so far this level
totalrowscompleted defb '00'
; this holds the total number of lines completed so far this level (as a number)
totalrowscompletednum defb 0
; this holds the lines target for this level (as a string)
targetlinesforthislevel defb '00'
; this holds the lines target for this level (as a number)
targetlinesforthislevelnum defb 0
; this is the colour of the shape currently being played
blockcolour defb 5
; this is the colour used by showshape when showing a shape onscreen
drawcolour defb 0
; this holds the current number of complete lines we have made this level
completedlines defb 0
; this is set to 1 when a winning/complete line is detected
winningline defb 0
; when flashing a winning line, or then erasing it, this sets the colour
winninglinecolour defb 130 ; flashing red
; holds the score
score defb '000000'
; holds the high score
highscore defb '001250'
; shows whether a new high score has been set
newhighscore defb 0
; this holds whether the level is upside down (i.e. falls up rather than usual down)
upsidedown defb 0
; a value of 1 means allowed move
allowedmove defb 1
; a player is only allowed swap once (till the next shape is automatically picked)
; a value of 1 means they are allowed swap, otherwise they are not
allowedswap defb 1
; rows completed holds the number of rows filled, bonus points for 4
rowscompleted defb 0
; this holds the number of pieces played this level
piecesthislevel defb 0
; ghost active. 0 is off, 1 is on. This determines whether the ghost shape is shown
; The ghost shape shows where the shape would go if the player pressed drop
ghostactive defb 0
; this holds whether Kempston joystick support is enabled or not. Can cause
; issues if activated when, say, emulator is not set to support it.
; 0 - disabled, 1 - enabled, 2 - not available
kemsptonactivated defb 0
; this holds the difficulty level, 0 is normal, 1 is hard
difficulty defb 0
; this holds the mainmenu option pointer. If joystick is available then this is the option
; the arrow is pointing at
mainmenuoptionpointer defb 0
; this holds the current settings option pointer. If joystick is available then this is the option
; the arrow is pointing at
settingsmenuoptionpointer defb 0
; this holds the mainmenu option chosen.
mainmenuoptionchosen defb 0
; this holds the current settings option chosen.
settingsmenuoptionchosen defb 0
; this holds the colour of the arrow that points at the menu options
arrowcolour defb 2
; this holds the current x position of the arrow
arrowxpos defb 18
; timer used when deciding to auto drop the block
pretim defb 0
; this holds whether in game music is wanted/enabled (by the player)
gamemusicenabled defb 1
; drop method. When set to 0 if the player presses drop then the piece drops in one go as
; far as it can. If set to 1 then the piece only goes down while the player holds the key
; when set to 1 acts like a 'down' key rather than a drop
; when set to 2, it acts like a mixture. A quick tap causes the piece to drop down fully,
; while holding it down causes it to act like a 'down' key.
dropmethod defb 0
; this is used when the dropmethod is set to 2, used in the case when we want to say drop full
fulldropactive defb 0
; as we support key repeat, this is used to show when it is the first call of the key within a
; possible repeat series. Holds the number of repeated key presses
keypresscount defb 0
; this holds the number of repeated joystick fire button presses
firebuttoncount defb 0
; this holds the key press sensitivity, essentially this is the delay between keypress repeat
; 0 is fast, 1 is normal, 2 is slow
sensitivity defb 1
randomtable:
db 82,97,120,111,102,116,20,12
; holds a value for last action/key pressed.
; a bit is set corresponding to the action done
lastkeypressed defb 0
; holds a value for last joystick action done
; a bit is set corresponding to the action done
lastjoystick defb 0
;; this mask determines if simultaneous key presses are allowed. Set to 255 to allow
keypressmask defb 0
msg_menu_copyright: defm CC_INK,7,CC_AT,13,4,"(c)2015 Peter McQuillan",255
msg_menu_startgame: defm CC_INK,7,CC_AT,18,4,"1 Start Game",255
msg_menu_definekeys: defm CC_INK,7,CC_AT,19,4,"2 Define Keys",255
msg_menu_kempston: defm CC_INK,7,CC_AT,20,4,"3 Kempston Joystick",255
msg_menu_settings: defm CC_INK,7,CC_AT,21,4,"4 Settings",255
msg_menu_kempston_on: defm CC_INK,4,CC_AT,20,23,"(On) ",255
msg_menu_kempston_off: defm CC_INK,2,CC_AT,20,23,"(Off)",255
msg_menu_kempston_na: defm CC_INK,2,CC_AT,20,23,"(n/a)",255 ; we detect if a kempston joystick is present, if not show this
;settings menu text
msg_menu_difficulty: defm CC_INK,7,CC_AT,10,4,"1 Difficulty",255
msg_menu_difficulty_normal: defm CC_INK,4,CC_AT,10,16,"(Normal) ",255
msg_menu_difficulty_hard: defm CC_INK,2,CC_AT,10,16,"(Hard) ",255
msg_menu_dropmethod: defm CC_INK,7,CC_AT,11,4,"2 Drop Method",255
msg_menu_dropmethod_normal: defm CC_INK,4,CC_AT,11,17,"(Full) ",255
msg_menu_dropmethod_likedown: defm CC_INK,2,CC_AT,11,17,"(While Held)",255
msg_menu_dropmethod_mixture: defm CC_INK,6,CC_AT,11,17,"(Mixture) ",255
msg_menu_sensitivity: defm CC_INK,7,CC_AT,12,4,"3 Control Response",255
msg_menu_sensitivity_fast: defm CC_INK,4,CC_AT,12,22,"(Fast) ",255
msg_menu_sensitivity_normal: defm CC_INK,6,CC_AT,12,22,"(Normal)",255
msg_menu_sensitivity_slow: defm CC_INK,2,CC_AT,12,22,"(Slow) ",255
msg_menu_simultaneous: defm CC_INK,7,CC_AT,13,4,"4 Simultaneous Keys",255
msg_menu_simultaneous_off: defm CC_INK,4,CC_AT,13,23,"(Off) ",255
msg_menu_simultaneous_on: defm CC_INK,2,CC_AT,13,23,"(On) ",255
msg_menu_back_to_main_menu: defm CC_INK,7,CC_AT,14,4,"5 Back To Main Menu",255
msg_game_score: defm CC_INK,7,CC_AT,2,25,"Score",255
msg_game_highscore: defm CC_INK,7,CC_AT,2,3,"High",255
msg_game_nextpiece: defm CC_INK,7,CC_AT,9,25,"Next",255
msg_game_savedpiece: defm CC_INK,7,CC_AT,9,3,"Saved",255
msg_game_line: defm CC_INK,7,CC_AT,16,25,"Lines",255
msg_game_ghost: defm CC_INK,7,CC_AT,16,3,"Ghost",255
msg_game_ghost_active: defm CC_INK,4,CC_AT,18,2," Active ",255
msg_game_ghost_inactive: defm CC_INK,2,CC_AT,18,2,"Inactive",255
msg_game_level1: defm CC_INK,7,CC_AT,1,8,"1 - Nice and Easy",255
msg_game_level2: defm CC_INK,7,CC_AT,1,9,"2 - Spice it up ",255
msg_game_level3: defm CC_INK,7,CC_AT,1,10,"3 - G'day Mate",255
msg_game_level4: defm CC_INK,7,CC_AT,1,8,"4 - Shooting Star",255
msg_game_level5: defm CC_INK,7,CC_AT,1,10,"5 - More Stars",255
msg_game_level6: defm CC_INK,7,CC_AT,1,11,"6 - Letter F",255
msg_game_level7: defm CC_INK,7,CC_AT,1,12,"7 - Mirror",255
msg_game_level8: defm CC_INK,7,CC_AT,1,8,"8 - Sliding Floor",255
msg_game_level9: defm CC_INK,7,CC_AT,1,10,"9 - Mix it up",255
msg_game_level10: defm CC_INK,7,CC_AT,1,9,"10 - Rising Fall",255
; date for the main falling blocks logo on the main menu page. 254 means end of line, 255 means end of data
fallingblockslogo
defb 0,0,67,67,67,0,254
defb 0,0,67,0,0,0,0,7,0,0,7,0,0,0,7,0,0,0,7,7,7,0,7,7,0,0,0,7,7,254
defb 0,0,0 ,0,0,0,7,0,3,0,5,0,0,0,7,0,0,0,0,7,0,0,7,0,5,0,7,0,0,254
defb 0,0,7 ,7,0,0,7,3,3,0,5,0,0,0,7,0,0,0,0,7,0,0,7,0,5,0,7,0,2,254
defb 0,0,7 ,0,0,0,7,0,3,0,5,0,0,0,7,0,0,0,0,7,0,0,7,0,5,0,7,0,2,254
defb 0,0,7 ,0,0,0,7,0,7,0,5,7,7,0,7,7,7,0,7,7,7,0,7,0,5,0,0,2,2,254
defb 254
defb 0,0,0,0,7,7,0,0,7,0,0,0,0,7,0,0,0,7,7,0,7,0,7,0,0,7,7,254
defb 0,0,0,0,7,0,7,0,7,0,0,0,7,0,7,0,7,0,0,0,3,0,7,0,7,0,0,254
defb 0,0,0,0,67,7,0,0,7,0,0,0,7,0,7,0,7,0,0,0,3,3,0,0,0,7,0,254
defb 0,0,0,0,67,0,7,0,2,0,0,0,7,0,7,0,7,0,0,0,3,0,7,0,0,0,7,254
defb 0,0,0,0,67,67,0,0,2,2,2,0,0,7,0,0,0,7,7,0,7,0,7,0,7,7,0,254
defb 255
gameoverlogo
defb 254,254,254 ;skip a few lines
defb 0,0,0,0,0,0,0,0,7,7,0,0,7,0,0,7,0,0,0,7,0,7,7,7,254
defb 0,0,0,0,0,0,0,7,0,0,0,7,0,7,0,7,7,0,7,7,0,7,0,0,254
defb 0,0,0,0,0,0,0,7,0,7,0,7,7,7,0,7,0,7,0,7,0,7,7,0,254
defb 0,0,0,0,0,0,0,7,0,7,0,7,0,7,0,7,0,0,0,7,0,7,0,0,254
defb 0,0,0,0,0,0,0,0,7,7,0,7,0,7,0,7,0,0,0,7,0,7,7,7,254
defb 254
defb 0,0,0,0,0,0,0,0,0,7,0,0,7,0,7,0,7,7,7,0,7,7,0,254
defb 0,0,0,0,0,0,0,0,7,0,7,0,7,0,7,0,7,0,0,0,7,0,7,254
defb 0,0,0,0,0,0,0,0,7,0,7,0,7,0,7,0,7,7,0,0,7,7,0,254
defb 0,0,0,0,0,0,0,0,7,0,7,0,0,7,0,0,7,0,0,0,7,0,7,254
defb 0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,7,7,7,0,7,0,7,254
defb 255
youwinlogo
defb 254,254,254
defb 0,0,0,0,0,0,0,0,0,0,7,0,7,0,0,7,0,0,7,0,7,254
defb 0,0,0,0,0,0,0,0,0,0,7,0,7,0,7,0,7,0,7,0,7,254
defb 0,0,0,0,0,0,0,0,0,0,0,7,0,0,7,0,7,0,7,0,7,254
defb 0,0,0,0,0,0,0,0,0,0,0,7,0,0,7,0,7,0,7,0,7,254
defb 0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,0,7,0,254
defb 254
defb 0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,7,7,7,0,7,7,0,254
defb 0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,0,7,0,0,7,0,7,254
defb 0,0,0,0,0,0,0,0,0,7,0,7,0,7,0,0,7,0,0,7,0,7,254
defb 0,0,0,0,0,0,0,0,0,7,7,0,7,7,0,0,7,0,0,7,0,7,254
defb 0,0,0,0,0,0,0,0,0,7,0,0,0,7,0,7,7,7,0,7,0,7,254
defb 255
START
; Set up the graphics.
ld de,(23675) ; address of user-defined graphics data.
ld hl, graphics
ld bc,88
ldir
BEGIN
xor a ; black ink (0) on black paper (0*8).
ld (23693),a ; set our screen colours.
call 3503 ; clear the screen.
; We also want to change the border colour
xor a ; 0 is the code for black.
call 8859 ; set border colour.
;open the upper screen for printing (channel 2)
ld a,2
call 5633
; set the main menu music to be 'If I Were A Rich Man'
ld bc,ifiwerearichman
ld (gamemusic),bc
ld a, 8
ld (musicspeed),a
xor a
ld (noteindex),a ; so music plays at start of song
ld (keypresscount),a ; so we show no keys have been pressed before
ld (firebuttoncount),a ; we reset the counter for the joystick fire button presses
ld (mainmenuoptionpointer),a ; we reset where the arrow points to on main menu
ld a,18
ld (arrowxpos),a ; start position on screen for the arrow (if kemptson available)
; before we start the main menu we need to see if a kempston joystick is
; actually there. Otherwise you can have a situation where the user enables
; kempston support but they don't actually have one and strange things happen
; during the game :) This is due to floating bus values
halt
in a,(31) ;read kempston joystick port directly after HALT
and 31
ld b,a ; backup value of a in register b for later usage
and 3
cp 3 ; this is equal to both left and right being active at same time, obviously should not happen with real joystick
jr z, nojoy
ld a,b ; get back that value we saved earlier
and 12
cp 12 ; 12 (8+4) is both up and down, again should not be possible
jr z, nojoy
; a joystick is available, show arrow
call drawarrow
jr mainmenu ; all good, go to main menu
nojoy
ld a,2
ld (kemsptonactivated),a ; set value to not available
mainmenu
ld hl,fallingblockslogo
call printwordswithblocks
ld hl,msg_menu_copyright
call print_message
ld hl,msg_menu_startgame
call print_message
ld hl,msg_menu_definekeys
call print_message
ld hl, msg_menu_kempston
call print_message
ld hl,msg_menu_settings
call print_message
mm11
ld a,(kemsptonactivated)
cp 0
jr z,mm6
cp 2
jr z, mm9
ld hl, msg_menu_kempston_on
call print_message
jp mm1
mm6
ld hl, msg_menu_kempston_off
call print_message
jr mm1
mm9
; kempston is not available
ld hl, msg_menu_kempston_na
call print_message
mm1
; if kempston is active, we check for up, down and fire
ld a,(kemsptonactivated)
cp 2
jp z, mmkey1
mmjoy1
; kempston is available
ld bc,31
in a,(c)
and 31 ; bitmask 5 bits
or 0
jr nz, mmjoy2
jp mmkey1 ; no joystick action
mmjoy2
ld bc,31
in a,(c) ; read input.
and 8 ; check "up" bit.
jr nz,mmjoy3 ; move up.
jr mmjoy4
mmjoy3
; move arrow up if possible
; if mainmenuoptionpointer is 0 then cannot move up
ld a,(mainmenuoptionpointer)
or 0
jp z, mmkey1 ; at top option already, jump to key read section as nothing more to do in joystick section
; possible to move up, so decrement mainmenuoptionpointer and arrowxpos
xor a
ld (arrowcolour),a
call drawarrow ; erase old arrow
ld hl,mainmenuoptionpointer
dec (hl)
ld hl,arrowxpos
dec (hl)
ld a,2
ld (arrowcolour),a
call drawarrow
call smalldelay
jr mmkey1 ; finished in joystick read section
mmjoy4
ld bc,31
in a,(c) ; read input.
and 4 ; check "down" bit.
jr nz,mmjoy5
jr mmjoy6
mmjoy5
; move arrow down if possible
; if mainmenuoptionpointer is 3 then cannot move down
ld a,(mainmenuoptionpointer)
cp 3
jr z, mmkey1 ; at bottom option already, jump to key read section as nothing more to do in joystick section
; possible to move down, so increment mainmenuoptionpointer and arrowxpos
xor a
ld (arrowcolour),a
call drawarrow ; erase old arrow
ld hl,mainmenuoptionpointer
inc (hl)
ld hl,arrowxpos
inc (hl)
ld a,2
ld (arrowcolour),a
call drawarrow
call smalldelay
jr mmkey1 ; finished in joystick read section
mmjoy6
ld bc,31
in a,(c) ; read input.
and 16 ; try the fire bit.
jr nz,mmjoy7 ; fire pressed.
jr mmkey1
mmjoy7
; fire button pressed
ld a,(mainmenuoptionpointer)
cp 1
jr nz, mmjoy8
; the key read routine actually sets all the bits to 1 except the key corresponding to key pressed
ld a,29 ; 11101
ld (mainmenuoptionchosen),a
jr mm20
mmjoy8
cp 2
jr nz, mmjoy9
ld a,27 ; 11011
ld (mainmenuoptionchosen),a
jr mm20
mmjoy9
cp 3
jr nz, mmjoy10
ld a,23 ;10111
ld (mainmenuoptionchosen),a
jr mm20
mmjoy10
; assume it is start game
ld a,30 ;11110
ld (mainmenuoptionchosen),a
jr mm20
mmkey1
;IN 63486 reads the half row 1 to 5
ld bc,63486
in a,(c)
ld (mainmenuoptionchosen),a
mm20
ld a,(mainmenuoptionchosen)
bit 0,a
jr nz,mm2
jr mm5 ;1 key pressed, start game
mm2
ld a, (mainmenuoptionchosen)
bit 1,a
jr nz,mm3
call do_the_redefine
jp BEGIN
mm3
ld a, (mainmenuoptionchosen)
bit 2,a
jr nz,mm7
ld a,(kemsptonactivated)
cp 0
jr z,mm8
cp 2
jr z,mm10
; if here then currently support enabled, so disable
xor a
ld (kemsptonactivated),a
ld hl, msg_menu_kempston_off
call print_message
call mediumdelay
jp mm13
mm8
; if here then currently support disabled, so enable
ld a,1
ld (kemsptonactivated),a
ld hl, msg_menu_kempston_on
call print_message
call mediumdelay
jr mm13
mm10
; if we are set to n/a for kempston we ignore '3' keypresses
jr mm13
mm7
ld a, (mainmenuoptionchosen)
bit 3,a ; check for keypress of number 4
jr nz,mm13
call settingsmenu
jp BEGIN ; need to reset everything after accessing settings menu
mm13
jp mm1
mm5
call 3503
jp maingame
settingsmenu
; settings menu is where difficulty level can be chosen and where the behaviour of the pieces can be altered
call ROM_CLS
xor a
ld (settingsmenuoptionpointer),a ; we reset where the arrow points to on settings menu
ld a,10
ld (arrowxpos),a ; start position on screen for the arrow on settings menu (if kemptson available)
ld hl,msg_menu_difficulty
call print_message
ld a,(difficulty)
cp 0
jr nz,setm1 ; 0 is normal difficulty
ld hl,msg_menu_difficulty_normal
call print_message
jr setm5
setm1
ld hl,msg_menu_difficulty_hard
call print_message
setm5
ld hl,msg_menu_dropmethod
call print_message
ld a,(dropmethod)
cp 0
jr z,setm20 ; 0 is normal drop method
cp 1
jr z,setm6; 1 is when acts like a down key
; otherwise we assume acting like a mixture
jr setm21
setm20
; normal drop method
ld hl,msg_menu_dropmethod_normal
call print_message
jr setm2
setm6
; when drop acts like a down key
ld hl,msg_menu_dropmethod_likedown
call print_message
jr setm2
setm21
; when drop acts like a mixture, quick tap will drop, otherwise
; holding the key down will act like a 'down' key
ld hl,msg_menu_dropmethod_mixture
call print_message
setm2
ld hl,msg_menu_sensitivity
call print_message
ld a,(sensitivity)
cp 0
jr z,setm10
cp 1
jr z,setm11
cp 2
jr z,setm12
jr setm13 ; this line should not be called, here just in case!
setm10
; sensitivity is 0, fast
ld hl, msg_menu_sensitivity_fast
call print_message
jr setm13
setm11
; sensitivity is 1, normal
ld hl, msg_menu_sensitivity_normal
call print_message
jr setm13
setm12
; sensitivity is 2, slow
ld hl, msg_menu_sensitivity_slow
call print_message
setm13
; print the simultaneous keys message
ld hl, msg_menu_simultaneous
call print_message
ld a,(keypressmask)
cp 0
jr z,setm30
cp 255
jr z,setm31
jr setm32 ; this line should not be called, here just in case!
setm30
ld hl, msg_menu_simultaneous_off
call print_message
jr setm32
setm31
ld hl, msg_menu_simultaneous_on
call print_message
setm32
; print the back to main menu message
ld hl, msg_menu_back_to_main_menu
call print_message
call mediumdelay
setm9
; if kempston is active, we check for up, down and fire
ld a,(kemsptonactivated)
cp 2
jp z, smkey1
call drawarrow
smjoy1
; kempston is available
ld bc,31
in a,(c)
and 31 ; bitmask 5 bits
or 0
jr nz, smjoy2
jp smkey1 ; no joystick action
smjoy2
ld bc,31
in a,(c) ; read input.
and 8 ; check "up" bit.
jr nz,smjoy3 ; move up.
jr smjoy4
smjoy3
; move arrow up if possible
; if settingsmenuoptionpointer is 0 then cannot move up
ld a,(settingsmenuoptionpointer)
or 0
jp z, smkey1 ; at top option already, jump to key read section as nothing more to do in joystick section
; possible to move up, so decrement settingsmenuoptionpointer and arrowxpos
xor a
ld (arrowcolour),a
call drawarrow ; erase old arrow
ld hl,settingsmenuoptionpointer
dec (hl)
ld hl, arrowxpos
dec (hl)
ld a,2
ld (arrowcolour),a
call drawarrow
call smalldelay
jr smkey1 ; finished in joystick read section
smjoy4
ld bc,31
in a,(c) ; read input.
and 4 ; check "down" bit.
jr nz,smjoy5
jr smjoy6
smjoy5
; move arrow down if possible
; if settingsmenuoptionpointer is 4 then cannot move down
ld a,(settingsmenuoptionpointer)
cp 4
jr z, smkey1 ; at bottom option already, jump to key read section as nothing more to do in joystick section
; possible to move down, so increment settingsmenuoptionpointer and arrowxpos
xor a
ld (arrowcolour),a
call drawarrow ; erase old arrow
ld hl,settingsmenuoptionpointer
inc (hl)
ld hl, arrowxpos
inc (hl)
ld a,2
ld (arrowcolour),a
call drawarrow
call smalldelay
jr smkey1 ; finished in joystick read section
smjoy6
ld bc,31
in a,(c) ; read input.
and 16 ; try the fire bit.
jr nz,smjoy7 ; fire pressed.
jr smkey1
smjoy7
; fire button pressed
ld a,(settingsmenuoptionpointer)
cp 1
jr nz, smjoy8
; the key read routine actually sets all the bits to 1 except the key corresponding to key pressed
ld a,29 ; 11101
ld (settingsmenuoptionchosen),a
jr setm24
smjoy8
cp 2
jr nz, smjoy9
ld a,27 ; 11011
ld (settingsmenuoptionchosen),a
jr setm24
smjoy9
cp 3
jr nz, smjoy10
ld a,23 ;10111
ld (settingsmenuoptionchosen),a
jr setm24
smjoy10
cp 4
jr nz, smjoy11
ld a,15 ;01111
ld (settingsmenuoptionchosen),a
jr setm24
smjoy11
; assume it is difficulty
ld a,30 ;11110
ld (settingsmenuoptionchosen),a
jr setm24
smkey1
;IN 63486 reads the half row 1 to 5
ld bc,63486
in a,(c)
ld (settingsmenuoptionchosen), a
setm24
ld a, (settingsmenuoptionchosen)
bit 0,a ; check for keypress of number 1 - difficulty
jr nz,setm4
ld a,(difficulty)
cp 0
jr nz,setm3
; difficulty is currently 0 (normal), set to 1
ld a,1
ld (difficulty),a
ld hl,msg_menu_difficulty_hard
call print_message
call mediumdelay
jp setm19
setm3
; difficulty is currently 1 (hard), set to 0
xor a
ld (difficulty),a
ld hl,msg_menu_difficulty_normal
call print_message
call mediumdelay
jp setm19
setm4
ld a, (settingsmenuoptionchosen)
bit 1,a ; check for keypress of number 2 - drop method
jr nz,setm7
ld a,(dropmethod)
cp 1
jr z,setm8 ; currently acts like down key
cp 2
jr z,setm23
setm22
; drop method is currently 0 (normal), set to 1
ld a,1
ld (dropmethod),a
ld hl,msg_menu_dropmethod_likedown
call print_message
call mediumdelay
jp setm19
setm8
; drop method is currently 1 (like down key), set to 2
ld a,2
ld (dropmethod),a
ld hl,msg_menu_dropmethod_mixture
call print_message
call mediumdelay
jp setm19
setm23
; drop method is currently 2 (mixture), set to 0
xor a
ld (dropmethod),a
ld hl,msg_menu_dropmethod_normal
call print_message
call mediumdelay
jp setm19
setm7
ld a, (settingsmenuoptionchosen)
bit 2,a ; check for keypress of number 3 - key sensitivity
jr nz,setm18
ld a,(sensitivity)
cp 0
jr z, setm14
cp 1
jr z, setm15
cp 2
jr z, setm16
jr setm19 ; this line should not be called
setm14
; sensitivity is 0, set to 1
ld a,1
ld (sensitivity),a
ld hl, msg_menu_sensitivity_normal
call print_message
call mediumdelay
jr setm19
setm15
; sensitivity is 1, set to 2
ld a,2
ld (sensitivity),a
ld hl, msg_menu_sensitivity_slow
call print_message
call mediumdelay
jr setm19
setm16
; sensitivity is 2, set to 0
xor a
ld (sensitivity),a
ld hl, msg_menu_sensitivity_fast
call print_message
call mediumdelay
jr setm19
setm18
ld a, (settingsmenuoptionchosen)
bit 4,a ; check for keypress of number 5 - back to main menu
jr nz,setm33
ret ; back to main menu
setm33
ld a, (settingsmenuoptionchosen)
bit 3,a ; check for keypress of number 4 - simultaneous keypress
jr nz,setm19
ld a,(keypressmask)
cp 0
jr z, setm34
cp 255
jr z, setm35
jr setm19 ; this line should not be called
setm34
; keypressmask is 0, set to 255
ld a,255
ld (keypressmask),a
ld hl, msg_menu_simultaneous_on
call print_message
call mediumdelay
jr setm19
setm35
; keypressmask is 255, set to 0
xor a
ld (keypressmask),a
ld hl, msg_menu_simultaneous_off
call print_message
call mediumdelay
jr setm19
setm19
jp setm2
maingame
;seed our random number generator
ld a,(23672)
and 63
ld b,a
seedgen
push bc ; have to push bc to stack as rnd changes value
call rnd
pop bc
djnz seedgen
; Need to reset the score
ld hl,score
ld (hl),'0'
inc hl
ld (hl),'0'
inc hl
ld (hl),'0'
inc hl
ld (hl),'0'
inc hl
ld (hl),'0'
inc hl
ld (hl),'0'
; ghost is set to off
xor a
ld (ghostactive),a
; set the current level to 1 (starting)
ld a,1
ld (currentlevel),a
; reset the saved shape to 0 (long bar)
xor a
ld (savedshape),a
; lets draw the screen
call newlevel
; main game loop
L7
;check key pressed
call get_keys
;The bits in A after checking keys are as follows: A = mlracdgs
main1
cp 0
jr z,nokeypressed
jr main2
nokeypressed
call droppieceiftappedkeyboard
xor a
ld (keypresscount),a
ld (lastkeypressed),a
jp joycon ;no key has been pressed so jump to joystick check part
main2
;check key for right pressed
bit 5,a
jr z,re1
; move right if valid move
push af
ld a,(lastkeypressed)
bit 5,a
jr nz,main5
call moveright
ld a,(lastkeypressed)
set 5,a ; set the 5 bit of lastkeypressed
ld (lastkeypressed),a
call smalldelay
pop af
ld b,a
ld a,(keypressmask)
and b
jp l1
main5
; if last key was right, we do not move right, but we change last key to 8
; effectively this means that right move can be made on next call, so we have
; key repeat but at a slower rate
ld a,(lastkeypressed)
res 5,a ; reset the 5 bit of lastkeypressed
ld (lastkeypressed),a
call smalldelay
pop af
ld b,a
ld a,(keypressmask)
and b
jp l1
re1
push af ; a is holding the key pressed so save to the stack
ld a,(lastkeypressed)
res 5,a ; reset the 5 bit of lastkeypressed
ld (lastkeypressed),a
pop af
l1
bit 6,a
jr z,re2
; move left if valid move
push af
ld a,(lastkeypressed)
bit 6,a
jr nz,main6
call moveleft
ld a,(lastkeypressed)
set 6,a ; set the 6 bit of lastkeypressed
ld (lastkeypressed),a
call smalldelay
pop af
ld b,a
ld a,(keypressmask)
and b
jr l2
main6
ld a,(lastkeypressed)
res 6,a ; reset the 6 bit of lastkeypressed
ld (lastkeypressed),a
call smalldelay
pop af
ld b,a
ld a,(keypressmask)
and b
jr l2
re2
push af ; a is holding the key pressed so save to the stack
ld a,(lastkeypressed)
res 6,a ; reset the 6 bit of lastkeypressed
ld (lastkeypressed),a
pop af
l2
bit 0,a
jr z,l3
; swap shape if valid move
push af
call swapshape
call smalldelay
pop af
ld b,a
ld a,(keypressmask)
and b
l3
bit 1,a
jr z,re3
push af
ld a,(lastkeypressed)
bit 1,a
jr nz,main7
call changeghostsetting
ld a,(lastkeypressed)
set 1,a ; set the 1 bit of lastkeypressed
ld (lastkeypressed),a
call smalldelay
pop af
ld b,a
ld a,(keypressmask)
and b
jr l4
main7
pop af
ld b,a
ld a,(keypressmask)
and b
jr l4
re3
push af ; a is holding the key pressed so save to the stack
ld a,(lastkeypressed)
res 1,a ; reset the 1 bit of lastkeypressed
ld (lastkeypressed),a
pop af
l4
bit 3,a
jr z,l5
push af
ld a,(lastkeypressed)
bit 3,a
jr nz, main4 ; if the last key pressed was moving clockwise then we don't turn clockwise again
call moveclockwise
ld a,(lastkeypressed)
set 3,a ; set the 3 bit of lastkeypressed
ld (lastkeypressed),a
call smalldelay
pop af
ld b,a
ld a,(keypressmask)
and b
jr l5
main4
ld a,(lastkeypressed)
res 3,a ; reset the 3 bit of lastkeypressed
ld (lastkeypressed),a
call smalldelay
pop af
ld b,a
ld a,(keypressmask)
and b
jr l5
re4
push af ; a is holding the key pressed so save to the stack
ld a,(lastkeypressed)
res 3,a ; reset the 3 bit of lastkeypressed
ld (lastkeypressed),a
pop af
l5
bit 4,a
jr z,re5
push af
ld a,(lastkeypressed)
bit 4,a
jr nz,main3
call moveanticlockwise
ld a,(lastkeypressed)
set 4,a ; set the 4 bit of lastkeypressed
ld (lastkeypressed),a
call smalldelay
pop af
ld b,a
ld a,(keypressmask)
and b
jr l6
main3
ld a,(lastkeypressed)
res 4,a ; reset the 4 bit of lastkeypressed
ld (lastkeypressed),a
call smalldelay
pop af
ld b,a
ld a,(keypressmask)
and b
jr l6
re5
push af ; a is holding the key pressed so save to the stack
ld a,(lastkeypressed)
res 4,a ; reset the 4 bit of lastkeypressed
ld (lastkeypressed),a
pop af
l6
bit 2,a
jr z,re6
push af
ld a,(keypresscount)
inc a
ld (keypresscount),a
ld a,(lastkeypressed)
bit 2,a
jr nz,main8
call droppiece
ld a,(lastkeypressed)
set 2,a ; set the 2 bit of lastkeypressed
ld (lastkeypressed),a
call mediumdelay ; drop unusual in that we do not vary delay
pop af
ld b,a
ld a,(keypressmask)
and b
jr main10 ; we skip to the end of the check keyboard key section as the drop key was pressed
main8
; if last key was drop, and our drop method is one square/down we do not drop down on square,
; but we reset bit 2 of lastkeypressed
; effectively this means that down move can be made on next call, so we have
; key repeat but at a slower rate
ld a,(dropmethod)
cp 0
jr z,main12
ld a,(lastkeypressed)
res 2,a ; reset the 2 bit of lastkeypressed
ld (lastkeypressed),a
call mediumdelay ; drop unusual in that we do not vary delay
main12
pop af
ld b,a
ld a,(keypressmask)
and b
jr main10
re6
push af ; a is holding the key pressed so save to the stack
ld a,(lastkeypressed)
res 2,a ; reset the 2 bit of lastkeypressed
ld (lastkeypressed),a
pop af
main10
bit 7,a
jr z,joycon
push af
ld a,(lastkeypressed)
bit 7,a
jr nz,main11
call switchmusiconoff
ld a,(lastkeypressed)
set 7,a ; set the 7 bit of lastkeypressed
ld (lastkeypressed),a
call smalldelay
pop af
ld b,a
ld a,(keypressmask)
and b
jr joycon
main11
pop af
ld b,a
ld a,(keypressmask)
and b
jr joycon
re7
push af ; a is holding the key pressed so save to the stack
ld a,(lastkeypressed)
res 7,a ; reset the 7 bit of lastkeypressed
ld (lastkeypressed),a
pop af
; in addition to key support, we also support Kempston joystick. On zxspin the emulator uses
; the cursor keys with CTRL (for fire)
joycon
ld a,(kemsptonactivated)
cp 2 ; if 2 (n/a) or 0 (deactivated) then skip
jp z,l9 ; if user has not activated kempston support then we skip this section
or 0
jp z,l9
ld bc,31
in a,(c)
and 31 ; bitmask 5 bits
or 0
jr nz, jc10
call droppieceiftappedjoystick
xor a
ld (lastjoystick),a
ld (firebuttoncount),a
jp l9 ; no joystick action, so skip ahead
jc10
ld bc,31 ; Kempston joystick port.
in a,(c) ; read input.
and 2 ; check "left" bit.
jr nz,jc1 ; move left.
jr jc2
jc1
ld a,(lastjoystick)
bit 2,a
jr nz,jc11
call moveleft
ld a,(lastjoystick)
set 2,a
ld (lastjoystick),a
call smalldelay
jr jc2
jc11
res 2,a
ld (lastjoystick),a
call smalldelay
jc2
ld bc,31
in a,(c) ; read input.
and 1 ; test "right" bit.
jr nz,jc3 ; move right.
jr jc4
jc3
ld a,(lastjoystick)
bit 1,a
jr nz,jc12
call moveright
ld a,(lastjoystick)
set 1,a
ld (lastjoystick),a
call smalldelay
jr jc4
jc12
res 1,a
ld (lastjoystick),a
call smalldelay
jc4
ld bc,31
in a,(c) ; read input.
and 8 ; check "up" bit.
jr nz,jc5 ; move up.
jr jc6
jc5
ld a,(lastjoystick)
bit 4,a
jr nz,jc14
call moveclockwise
ld a,(lastjoystick)
set 4,a
ld (lastjoystick),a
call smalldelay
jr jc6
jc14
res 4,a
ld (lastjoystick),a
call smalldelay
jc6
ld bc,31
in a,(c) ; read input.
and 4 ; check "down" bit.
jr nz,jc7
jr jc8
jc7
ld a,(lastjoystick)
bit 3,a
jr nz,jc15
call moveanticlockwise
ld a,(lastjoystick)
set 3,a
ld (lastjoystick),a
call smalldelay
jr jc8
jc15
res 3,a
ld (lastjoystick),a
call smalldelay
jc8
ld bc,31
in a,(c) ; read input.
and 16 ; try the fire bit.
jr nz,jc9 ; fire pressed.
jr l9
jc9
ld a,(firebuttoncount)
inc a
ld (firebuttoncount),a
ld a,(lastjoystick)
bit 5,a
jr nz,jc13
call droppiece
ld a,(lastjoystick)
set 5,a
ld (lastjoystick),a
call mediumdelay ; different (fixed) delay for drop
jr l9
jc13
ld a,(dropmethod)
cp 0
jr z,l9 ; we do not repeat keypresses when drop method is full
ld a,(lastjoystick)
res 5,a
ld (lastjoystick),a
call mediumdelay ; different (fixed) delay for drop
l9
ld a,(difficulty)
cp 0
jr nz,l14
ld hl,pretim ; previous time setting
ld a,(23672) ; current timer setting.
sub (hl) ; difference between the two.
cp 45 ; have 45 frames elapsed yet?
jr nc,l13
jr l15
l14
; difficulty hard
ld hl,pretim ; previous time setting
ld a,(23672) ; current timer setting.
sub (hl) ; difference between the two.
cp 15 ; have 15 frames elapsed yet?
jr nc,l13
jr l15
l15
jp L7 ;not time to drop piece yet, continue main loop
l13
ld hl,pretim
ld a,(23672)
ld (hl),a
call autodroppiece
call checklevelcomplete
jp L7
; random number generator
rnd:
ld hl,randomtable
rndidx:
ld bc,0 ; i
add hl,bc
ld a,c
inc a
and 7
ld (rndidx+1),a ; i = ( i + 1 ) & 7
ld c,(hl) ; y = q[i]
ex de,hl
ld h,c ; t = 256 * y
ld l,b
sbc hl,bc ; t = 255 * y
sbc hl,bc ; t = 254 * y
sbc hl,bc ; t = 253 * y
car:
ld c,0 ; c
add hl,bc ; t = 253 * y + c
ld a,h ; c = t / 256
ld (car+1),a
ld a,l ; x = t % 256
cpl ; x = (b-1) - x = -x - 1 = ~x + 1 - 1 = ~x
ld (de),a
ret
drawblock
ld a,22
rst 16
ld a,(tmpx)
rst 16
ld a,(tmpy)
rst 16
ld a,(blockcolour)
ld (23695),a ; set our temporary screen colours.
ld a,144 ; ASCII code for User Defined Graphic 'A'.
rst 16 ; draw player.
ret
drawarrow
ld a,22
rst 16
ld a,(arrowxpos)
rst 16
ld a,3 ; arrow y pos always 3
rst 16
ld a,(arrowcolour) ; arrow colour
ld (23695),a ; set our temporary screen colours.
ld a,154 ; ASCII code for User Defined Graphic 'K'.
rst 16 ; draw arrow.
ret
;erases the current shape. Same as showcurrentshape except
;colour is hardcoded to 0 (black). So, this redraws over the current
; shape in black, erasing it
erasecurrentshape
ld a,(plx)
ld (tmpx),a
ld a,(ply)
ld (tmpy),a
xor a
ld (drawcolour),a
jp showshape
; shows the current shape
showcurrentshape
ld a,(plx)
ld (tmpx),a
ld a,(ply)
ld (tmpy),a
ld a,(blockcolour)
ld (drawcolour),a
jp showshape
; this draws the ghost shape. It only draws if ghost is active
; and if calculateghostposition determines it is possible/safe to draw
showghostshape
ld a,(ghostactive)
or a
ret z ; if equal to 0 (ghost not active) then return
sgs1
call calculateghostposition
; now determine if possible to show ghost
ld a,(ghostshowing)
or a
ret z ; return if not possible to show ghost
ld a,(ghostx)
ld (tmpx),a
ld a,(ghosty)
ld (tmpy),a
ld a,(ghostcolour)
ld (drawcolour),a
jp showshape
; this erases the ghost shape. It checks ghostshowing and if set to 1
; it erases it. Does not bother checking ghostactive as that is only relevant
; when drawing the ghost
eraseghostshape
ld a,(ghostshowing)
or a
ret z ; return ias ghost not currently showing
ld a,(ghostx)
ld (tmpx),a
ld a,(ghosty)
ld (tmpy),a
xor a
ld (drawcolour),a
xor a
ld (ghostshowing),a ; we set to not showing as should only be set by calculateghostposition
jp showshape
; showshape draws a shape on screen, it is passed a tmpx and tmpy
; The colour used is passed in as drawcolour
; It draws the shape pointed to in blockshapes
showshape
ld a,(tmpx) ; instead of referring to tmpx and tmpy through this routine, we copy the values to d and e registers and use those
ld d,a
ld a,(tmpy)
ld e,a
ld a,(blockshapes)
bit 7,a
jp z, ss1
ld b,d
ld a,(tmpy)
ld c,a
call atadd
ld a,(drawcolour)
ld (hl),a
ss1
inc e
ld a,(blockshapes)
bit 6,a
jp z, ss2
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss2
inc e
ld a,(blockshapes)
bit 5,a
jp z, ss3
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss3
inc e
ld a,(blockshapes)
bit 4,a
jp z, ss4
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss4
inc d
ld a,(blockshapes)
bit 0,a
jp z, ss5
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss5
dec e
ld a,(blockshapes)
bit 1,a
jp z, ss6
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss6
dec e
ld a,(blockshapes)
bit 2,a
jp z, ss7
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss7
dec e
ld a,(blockshapes)
bit 3,a
jp z, ss8
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss8
inc d
ld a,(blockshapes+1)
bit 7,a
jp z, ss9
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss9
inc e
ld a,(blockshapes+1)
bit 6,a
jp z, ss10
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss10
inc e
ld a,(blockshapes+1)
bit 5,a
jp z, ss11
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss11
inc e
ld a,(blockshapes+1)
bit 4,a
jp z, ss12
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss12
inc d
ld a,(blockshapes+1)
bit 0,a
jp z, ss13
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss13
dec e
ld a,(blockshapes+1)
bit 1,a
jp z, ss14
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss14
dec e
ld a,(blockshapes+1)
bit 2,a
jp z, ss15
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss15
dec e
ld a,(blockshapes+1)
bit 3,a
jp z, ss16
ld b,d
ld c,e
call atadd
ld a,(drawcolour)
ld (hl),a
ss16
ret
; moves the block right if allowed. First deletes the shape and
; then checks the new location
moveright
call eraseghostshape ; always try to erase ghost, if not showing this call will not do anything
call erasecurrentshape
ld a,(plx)
ld (tmpx),a
ld a,(ply)
inc a ; we are trying to move right
ld (tmpy),a
call checkmove
ld a,(allowedmove)
or 0
jr z,mr1
ld a,(ply) ; move is valid so increment y
inc a
ld (ply),a
mr1
ld hl, colourlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (blockcolour),a ; now draw block in new position
call showcurrentshape
call showghostshape
ret
; moves the block left if allowed. First deletes the shape and
; then checks the new location
moveleft
call eraseghostshape ; always try to erase ghost, if not showing this call will not do anything
call erasecurrentshape
ld a,(plx)
ld (tmpx),a
ld a,(ply)
dec a ; we are trying to move left
ld (tmpy),a
call checkmove
ld a,(allowedmove)
or 0
jr z,ml1
ld a,(ply) ; move is valid so decrement y
dec a
ld (ply),a
ml1
ld hl, colourlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (blockcolour),a ; now draw block in new position
call showcurrentshape
call showghostshape
ret
; this drops the piece when in mixture drop mode and drop key has been tapped
droppieceiftappedkeyboard
; check dropmethod and lastkeypressed and keypresscount
ld a,(dropmethod)
cp 2
ret nz
ld a,(lastkeypressed)
bit 2,a ; drop
jr dpitk1
ret
dpitk1
ld a,(keypresscount)
cp 1
jr z,dpitk2
ret
dpitk2
ld a,1
ld (fulldropactive),a
call droppiece
call smalldelay
ret
droppieceiftappedjoystick
; check dropmethod and lastjoystick and firebuttoncount
ld a,(dropmethod)
cp 2
ret nz
ld a,(lastjoystick)
bit 5,a ; drop
jr dpitj1
ret
dpitj1
ld a,(firebuttoncount)
cp 1
jr z,dpitj2
ret
dpitj2
ld a,1
ld (fulldropactive),a
call droppiece
call smalldelay
ret
;this drops the piece, either by 1 square or till it cannot go any further
droppiece
ld a,(dropmethod)
cp 0
jr z,droppiecefull
cp 1
jr z,droppieceonequare
; we are not 0 or 1 so using a mixture - check for fulldropactive
ld a,(fulldropactive)
cp 0
jr z,droppieceonequare
; if here then using mixture dropmethod and full drop has been requested
xor a
ld (fulldropactive),a
jr droppiecefull
; moves the block down one square if allowed. First deletes the shape and
; then checks the new location
droppieceonequare
call eraseghostshape ; always try to erase ghost, if not showing this call will not do anything
call erasecurrentshape
ld a,(upsidedown)
cp 1
jr z,dpo2
ld a,(plx)
inc a ; going down one square
ld (tmpx),a
jr dpo3
dpo2
ld a,(plx)
dec a ; going up one square (we are upside down)
ld (tmpx),a
dpo3
ld a,(ply)
ld (tmpy),a
call checkmove
ld a,(allowedmove)
or 0
jr z,dpo1
ld a,(upsidedown)
cp 1
jr z,dpo4
ld a,(plx) ; move is valid so increment x
inc a
ld (plx),a
jr dpo1
dpo4
ld a,(plx) ; move is valid so decrement x (as upside down)
dec a
ld (plx),a
dpo1
ld hl, colourlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (blockcolour),a ; now draw block in new position
call showcurrentshape
call showghostshape
; reset the automatic drop timing - we do this as otherwise we would get occasional piece dropping
; down 2 spaces
ld hl,pretim
ld a,(23672)
ld (hl),a
ret
; drop the piece till it cannot go any further
; this is a loop, the exit being when no more moves are available, when dp1 is
; called which exits
droppiecefull
call eraseghostshape ; always try to erase ghost, if not showing this call will not do anything
call erasecurrentshape
ld a,(upsidedown)
cp 1
jr z,dp4
ld a,(plx)
inc a ; we are trying to move down
ld (tmpx),a
jr dp5
dp4
ld a,(plx)
dec a ; we are trying to move up (as upside down)
ld (tmpx),a
dp5
ld a,(ply)
ld (tmpy),a
call checkmove
ld a,(allowedmove)
or 0
jr z,dp1
ld a,(upsidedown)
cp 1
jr z,dp6
ld a,(plx) ; move is valid so increment x
inc a
ld (plx),a
jr dp7
dp6
ld a,(plx) ; move is valid so decrement x (as upside down)
dec a
ld (plx),a
dp7
call dp2
;delay loop to make the drop seem less sudden, but still a very fast drop
ld hl, 500
dp3
dec hl
ld a,h
or l
jr nz,dp3
; we get bonus points for dropping, 5 points per square dropped
ld hl,score+5 ; point to ones column.
ld b,5 ; 5 ones = 5.
call uscor ; up the score.
call printscore ;print this new score
jp droppiecefull
dp1
call dp2
ret ; so, if can't make any more moves then we call dp2 and then return
dp2
ld hl, colourlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (blockcolour),a ; now draw block in new position
call showcurrentshape
ret
; this is where we calculate the ghost x and y position
; we do this by first offsetting till no collision (against the actual current shape)
; then dropping down till we hit the top of the already placed pieces
calculateghostposition
; copy the player x and y to the tmp x and y
ld a,(plx)
ld (tmpx),a
ld a,(ply)
ld (tmpy),a
ld hl, ghostlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl) ; this now gives us the offset in the ghost offset table
ld (ghostpointer),a
ld hl,ghostoffset
ld de,(ghostpointer)
ld d,0
add hl,de
ld de,(currentorientation)
ld d,0
add hl,de
ld a,(hl) ; a now holds the number of blocks to skip
ld d,a ; save value to d
ld a,(upsidedown)
cp 1
jr z,cgp5
ld a,(tmpx)
add a,d
ld (tmpx),a
cp 22
jp nc,cgp2 ; if a greater or equal to 22 we exit
jr cgp1
cgp5
ld a,(tmpx)
sub d
ld (tmpx),a
cp 0
jp c,cgp2
cgp1
; we have gone the minimum distance required by the ghost offset
; we check if there is an immediate collision, if there is, we exit
call checkmove
ld a,(allowedmove)
or 0
jp nz,cgp3 ; if no collision then determine ghost location
cgp2
; if in here this not possible to determine ghost x and y, set the ghostshowing to 0
xor a
ld (ghostshowing),a
ret
cgp3
; if here then found empty space, now keep dropping, this will be where the ghost shape will be shown
ld a,(upsidedown)
cp 1
jr z,cgp6
ld a,(tmpx)
inc a
ld (tmpx),a
jr cgp7
cgp6
ld a,(tmpx)
dec a ; as we are upside down
ld (tmpx),a
cgp7
call checkmove
ld a,(allowedmove)
or 0
jp nz,cgp3
cgp4
; if we are here then have found the top of the place pieces, allocate ghost x and y
ld a,(upsidedown)
cp 1
jr z,cgp8
ld a,(tmpx)
dec a ; we decrement one as we had gone one too far with previous loop
ld (ghostx),a
jr cgp9
cgp8
ld a,(tmpx)
inc a ; we increment one as we had gone one too far with previous loop
ld (ghostx),a
cgp9
ld a,(tmpy)
ld (ghosty),a
ld a,1
ld (ghostshowing),a
ret
; this swaps the ghost setting from active to inactive (and vice versa)
changeghostsetting
ld a,(ghostactive)
or 0
jr nz, cgs1
; ghost is currently off, switch it on
ld a,1
ld (ghostactive),a
ld hl,msg_game_ghost_active
call print_message
ret
cgs1
; ghost is currently on, switch it off
xor a
ld (ghostactive),a
ld hl,msg_game_ghost_inactive
call print_message
ret
; This handles the swap piece functionality. A player is allowed swap once till a new shape is selected automatically
; by the drop process. We swap the current piece with the saved shape
swapshape
ld a,(allowedswap)
or 0
jr nz, ssh1
ret ;not allowed swap
ssh1
xor a
ld (allowedswap),a ; stop any more swapping of this shape
call eraseghostshape ; always try to erase ghost, if not showing this call will not do anything
; erase our current shape
call erasecurrentshape
ld a,(savedshape)
push af ; save the shape to the stack
ld a,(currentshape)
ld (savedshape),a
call drawsavedshape
pop af ; get the saved shape from the stack
ld (currentshape),a ; now we have swapped shapes
ld a,(startx) ; swapped piece starts from the top of the screen
ld (plx),a
ld a,(starty)
ld (ply),a
; if we are upside down we need to update the x position
ld a,(upsidedown)
cp 1
jr z,ssh3
jr ssh4
ssh3
ld a,(upsidedownstartx)
ld (plx),a
ssh4
; now we work out the colour for this shape
ld hl, colourlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (blockcolour),a ; now draw block in new position
; need to transfer new shape position to tmpx and tmpy for checkmove to correctly work
ld a,(plx)
ld (tmpx),a
ld a,(ply)
ld (tmpy),a
; player has swapped, but maybe the piece will not fit at the top of the screen (and thus game over)
call checkmove
ld a,(allowedmove)
or 0
jr nz,ssh2
; move is not valid so its end game
pop af ; this is popping to ensure stack is back to correct status. This pop is to match the push that is done in the main loop
jp gameover
ssh2
; ok, so we can draw the shape ok
call setblockshapes
call showcurrentshape
call showghostshape
ret
; This drops the piece down by one square if possible, if not possible then it starts a new piece
autodroppiece
call eraseghostshape ; always try to erase ghost, if not showing this call will not do anything
call erasecurrentshape
ld a,(upsidedown)
cp 1
jr z, adp3
ld a,(plx)
inc a ; we are trying to move down
ld (tmpx),a
jr adp4
adp3
; this is the section called if upside down
ld a,(plx)
dec a ; we are trying to move up (as we are upside down)
ld (tmpx),a
adp4
ld a,(ply)
ld (tmpy),a
call checkmove
ld a,(allowedmove)
or 0
jr z,adp1
ld a,(upsidedown)
cp 1
jr z,adp5
ld a,(plx) ; move is valid so increment x
inc a
ld (plx),a
jr adp2
adp5
ld a,(plx) ; move is valid so decrement x (as upside down)
dec a
ld (plx),a
jr adp2
adp1
; if we are here then it was not possible to drop the block, choose a new block
; first we redraw back the piece then choose our new one
; we also add to the score
; Add 50 to the score.
ld hl,score+4 ; point to tens column.
ld b,5 ; 5 tens = 50.
call uscor ; up the score.
call printscore ;print this new score
ld hl, colourlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (blockcolour),a ; now draw block in new position
call showcurrentshape
call checkplayarea ; now see if a winning line (or lines) exists
call selectnewpiece
adp2
ld hl, colourlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (blockcolour),a ; now draw block in new position
call showcurrentshape
call showghostshape
;call autodropnoise
ret
; Routine to pick a new block. Holds this in next shape and makes currentshape the old value of nextshape
; levels 2,5,7 amd 9 have extra shapes added
selectnewpiece
ld a,(nextshape)
push af ; save the nextshape to the stack, this will become currentshape
ld a,(currentlevel)
cp 2
jr z,snp2
cp 5
jr z,snp2
cp 7
jr z,snp2
cp 9
jr z,snp2
; if get to here then using the standard set
;this picks the random numbers when just using standard set
snp1
call rnd
and 7 ;bitmask bits 0, 1 and 2
cp 7
jp nc, snp1
jr snp3
; this picks the random numbers when using the extended set
snp2
call rnd
and 15 ;bitmask bits 0, 1, 2 and 3 (7 for standard set)
cp 12 ; change to 7 for standard set
jp nc, snp2
snp3
ld (nextshape),a
call drawnextshape
pop af
ld (currentshape),a ; now retrieve from the stack
ld a,(startx)
ld (plx),a
ld a,(starty)
ld (ply),a
; if upside down we need to update the starting x position
ld a,(upsidedown)
cp 1
jr z,snp5
jr snp6
snp5
ld a,(upsidedownstartx)
ld (plx),a
snp6
; reset allowed swap
ld a,1
ld (allowedswap),a
; reset last key pressed (if the last key pressed was not 'drop')
ld a,(lastkeypressed)
cp 7 ;7 is drop
jr z,snp7
xor a
ld (lastkeypressed),a
snp7
; now check if end game
ld a,(plx)
ld (tmpx),a
ld a,(ply)
ld (tmpy),a
call checkmove
ld a,(allowedmove)
or 0
jr nz,snp4
; move is not valid so its end game
jp gameover
snp4
xor a
ld (currentorientation),a
call setblockshapes
ld hl,piecesthislevel
inc (hl)
jp levelspecialaction; this does the special action required per level (may not do anything)
; Moves the block anti clockwise if allowed
moveanticlockwise
call eraseghostshape ; always try to erase ghost, if not showing this call will not do anything
call erasecurrentshape
ld a,(currentorientation)
inc a
cp 4 ;if 4 then need to set to 0
jr nz, mac1
xor a
mac1
ld (currentorientation),a
call setblockshapes
ld a,(plx)
ld (tmpx),a
ld a,(ply)
ld (tmpy),a
call checkmove
ld a,(allowedmove)
or 0
jr nz,mac6
; move is not valid so need to reset blockpointer and blockshapes
ld a,(currentorientation)
or 0
jr nz, mac5
ld a,4 ; we set to be 4 as we will decrememt by 1 giving us correct value 3
mac5
dec a
ld (currentorientation),a ;currentorientation not reset to previous value
call setblockshapes
mac6
ld hl, colourlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (blockcolour),a ; now draw block in new position
call showcurrentshape
call showghostshape
ret
; Moves the block clockwise if allowed
moveclockwise
call eraseghostshape ; always try to erase ghost, if not showing this call will not do anything
call erasecurrentshape
ld a,(currentorientation)
or 0
jr nz,mcw1
ld a,4 ; we set to be 4 as we will decrememt by 1 giving us correct value 3
mcw1
dec a
ld (currentorientation),a
call setblockshapes
ld a,(plx)
ld (tmpx),a
ld a,(ply)
ld (tmpy),a
call checkmove
ld a,(allowedmove)
or 0
jr nz,mcw3 ; move is valid
; move is not valid so need to reset blockpointer and blockshapes
ld a,(currentorientation)
inc a
cp 4
jr nz, mcw2
xor a ; we set to be 4 as we will decrememt by 1 giving us correct value 3
mcw2
ld (currentorientation),a ;currentorientation not reset to previous value
call setblockshapes
mcw3
ld hl, colourlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (blockcolour),a ; now draw block in new position
call showcurrentshape
call showghostshape
ret
;setblockshapes uses the currentorientation and currentshape to set the
; value of blockshapes i.e. the exact block to draw
setblockshapes
xor a ;reset a to 0
ld (blockpointer),a
ld a,(currentshape)
or 0
jr z, sbs1
; each shape is 8 bytes so have to increase by eight for each shape
ld hl, blocklookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (blockpointer),a
sbs1
ld a,(currentorientation)
or 0
jr z, sbs2
ld b,a
sbsloop1
ld a,(blockpointer)
inc a
inc a
ld (blockpointer),a
djnz sbsloop1
sbs2
ld hl, shapedata
ld de,(blockpointer)
ld d,0 ;blockpointer is always a 8 bit value
add hl,de
ld a,(hl)
ld (blockshapes),a
inc hl
ld a,(hl)
ld (blockshapes+1),a
ret
;this draws the next piece that will be played in the right hand side
; we temporarily set the current piece to be this
drawnextshape
call erasenextshape
ld a,(nextblockx)
ld (tmpx),a
ld a,(nextblocky)
ld (tmpy),a
xor a
ld (currentorientation),a
ld a,(nextshape)
ld (currentshape),a
ld hl, colourlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (drawcolour),a
call setblockshapes
call showshape
ret
; This erases the next shape area. There are three lines here to cope with all shapes
; in orientation 0
erasenextshape
ld a,(nextblockx)
ld (tmpx),a
ld a,(nextblocky)
ld (tmpy),a
ld b,4
ens1
push bc
ld a,(tmpx)
ld b,a
ld a,(tmpy)
ld c,a
call atadd
ld (hl),0
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz ens1
ld a,(tmpx)
inc a
ld (tmpx),a
ld a,(nextblocky)
ld (tmpy),a
ld b,4
ens2
push bc
ld a,(tmpx)
ld b,a
ld a,(tmpy)
ld c,a
call atadd
ld (hl),0
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz ens2
ld a,(tmpx)
inc a
ld (tmpx),a
ld a,(nextblocky)
ld (tmpy),a
ld b,4
ens3
push bc
ld a,(tmpx)
ld b,a
ld a,(tmpy)
ld c,a
call atadd
ld (hl),0
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz ens3
ret
; This is the initial setup of the next shape area. 3 lines to handle
; all shapes in orientation 0
setupnextshape
xor a
ld (blockcolour),a
ld a,(nextblockx)
ld (tmpx),a
ld a,(nextblocky)
ld (tmpy),a
ld b,4
sns1
push bc
call drawblock
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz sns1
ld a,(tmpx)
inc a
ld (tmpx),a
ld a,(nextblocky)
ld (tmpy),a
ld b,4
sns2
push bc
call drawblock
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz sns2
ld a,(tmpx)
inc a
ld (tmpx),a
ld a,(nextblocky)
ld (tmpy),a
ld b,4
sns3
push bc
call drawblock
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz sns3
ret
; This erases the saved shape area
erasesavedshape
ld a,(savedblockx)
ld (tmpx),a
ld a,(savedblocky)
ld (tmpy),a
ld b,4
ess1
push bc
ld a,(tmpx)
ld b,a
ld a,(tmpy)
ld c,a
call atadd
ld (hl),0
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz ess1
ld a,(tmpx)
inc a
ld (tmpx),a
ld a,(savedblocky)
ld (tmpy),a
ld b,4
ess2
push bc
ld a,(tmpx)
ld b,a
ld a,(tmpy)
ld c,a
call atadd
ld (hl),0
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz ess2
ld a,(tmpx)
inc a
ld (tmpx),a
ld a,(savedblocky)
ld (tmpy),a
ld b,4
ess3
push bc
ld a,(tmpx)
ld b,a
ld a,(tmpy)
ld c,a
call atadd
ld (hl),0
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz ess3
ret
; This is the initial setup of the saved shape area
setupsavedshape
xor a
ld (blockcolour),a
ld a,(savedblockx)
ld (tmpx),a
ld a,(savedblocky)
ld (tmpy),a
ld b,4
sss1
push bc
call drawblock
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz sss1
ld a,(tmpx)
inc a
ld (tmpx),a
ld a,(savedblocky)
ld (tmpy),a
ld b,4
sss2
push bc
call drawblock
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz sss2
ld a,(tmpx)
inc a
ld (tmpx),a
ld a,(savedblocky)
ld (tmpy),a
ld b,4
sss3
push bc
call drawblock
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz sss3
ret
;this draws the saved piece that on the left hand side
; we temporarily set the current piece to be this
drawsavedshape
call erasesavedshape
ld a,(savedblockx)
ld (tmpx),a
ld a,(savedblocky)
ld (tmpy),a
xor a
ld (currentorientation),a
ld a,(savedshape)
ld (currentshape),a
ld hl, colourlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (drawcolour),a
call setblockshapes
call showshape
ret
; this routine is used to erase the top line of the play area. We need this code
; as when we move everything down a line after a winning line, we need to clear the top line
erasetopline
ld a,(upsidedown)
cp 1
jp z,etl2
ld a,(playareatoplinex)
ld (tmpx),a
jp eraseline
etl2
ld a,(upsidedownplayareatoplinex) ; different x if upside down
ld (tmpx),a
jp eraseline
; eraseline is used for clearing the playarea at the start of every level and is used
; during process for handling winning lines. tmpx is passed in (line to erase)
eraseline
ld a,(playareatopliney)
ld (tmpy),a
ld b,10 ;10 squares in width of play area
etl1
push bc
ld a,(tmpx)
ld b,a
ld a,(tmpy)
ld c,a
call atadd
ld (hl),0 ; set the attribute at this square to be 0, black
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz etl1
ret
; this routine detects a winning line in the playarea. It checks the line defined in tmpx
; winningline will be set to 1 in the case of a winning line, otherwise 0
checkwinningline
xor a
ld (winningline),a ; winningline reset to 0
; tmpx is already set, but set initial y value
ld a,(playareatopliney)
ld (tmpy),a
ld b,10 ;10 squares in width of play area
cwl1
push bc
ld a,(tmpx)
ld b,a
ld a,(tmpy)
ld c,a
call atadd
or 0 ; check if it black/black i.e. empty square
jp z, cwl2 ;square is empty, can return with winningline set to 0, not winning line
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz cwl1
; if get this far then winning line
ld a,1
ld (winningline),a
ret
cwl2
; not a winning line, but need to tidy the stack, then exit
pop bc
ret
; when a winning line is detected, this is the routine that flashes the line, by setting
; the attribute of each of the squares with a flash attribute
; The line to flash will be passed in using tmpx
flashwinningline
; tmpx is already set, but set initial y value
ld a,(playareatopliney)
ld (tmpy),a
ld b,10 ;10 squares in width of play area
fwl1
push bc
ld a,(tmpx)
ld b,a
ld a,(tmpy)
ld c,a
call atadd
ld a,(winninglinecolour)
ld (hl),a ; set the attribute at this square to be winninglinecolour
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz fwl1
ret
; this is the routine that checks the playarea for all winning lines, adding to
; the players score, flash the lines temporarily and then deleting them and moving
; the playarea down
checkplayarea
xor a
ld (rowscompleted),a
ld b,20
cpa1
push bc ; b will be modified by later calls
ld a,b
ld (tmpx),a
call checkwinningline
ld a,(winningline)
or 0
jr z,cpa2 ; if not a winning line then skip flashwinningline call
call flashwinningline
ld hl,score+4 ; point to tens column.
ld b,5 ; 5 tens = 50.
call uscor ; up the score.
ld hl,score+3 ; point to hundreds column.
ld b,2 ; 2 hundreds = 200.
call uscor ; up the score. - so score increased by 250
call printscore ;print this new score
ld a,(rowscompleted)
inc a
ld (rowscompleted),a
cp 4 ; bonus points for 4 rows together (+1000 score)
jr nz, cpa2
ld hl,score+2 ; point to thousands column.
ld b,1 ; 1 thousands = 1000.
call uscor ; up the score.
call printscore ;print this new score
cpa2
pop bc
djnz cpa1
; now update the lines completed
ld hl,totalrowscompleted+1 ; point to ones column.
ld a,(rowscompleted)
ld b,a
call uscor ; up the lines count
call printlines ;print this new lines tally
ld a,(rowscompleted)
ld b,a
ld a,(totalrowscompletednum)
add a,b
ld (totalrowscompletednum),a
; at this stage we have any winning lines flashing and extra score has been added
; if any winning lines need to now remove
ld a,(rowscompleted)
or 0
ret z ; if no rows completed we can exit this routine
; if there are rows we add a short delay so the player can see the flashing lines i.e.
; they can see their winning lines
ld hl, 50000
cpa3
dec hl
ld a,h
or l
jr nz,cpa3
ld a,(upsidedown)
cp 1
jr z,cpa6
ld b,20
cpa4
push bc ; b will be modified by later calls
ld a,b
ld (tmpx),a
call checkwinningline
ld a,(winningline)
or 0
jr z,cpa5 ; if not a winning line then skip eraseline
call eraseline
call dropplayarea
; we now need to add 1 to b to ensure we delete all winning lines
pop bc
inc b
push bc
cpa5
pop bc
djnz cpa4
call clearedlinenoise
ret
cpa6
ld b,1
cpa7
push bc ; b will be modified by later calls
ld a,b
ld (tmpx),a
call checkwinningline
ld a,(winningline)
or 0
jr z,cpa8
call eraseline
call upsidedowndropplayarea
; we now need to decrement 1 from b to ensure we delete all winning lines
pop bc
dec b
push bc
cpa8
pop bc
inc b
ld a,b
cp 22
jr z,cpa9
jp cpa7
cpa9
call clearedlinenoise
ret
; move playarea down. When we get a winning line, we remove the winning line and this routine
; drops the playarea above that line down
; we pass in tmpx which is the winning line (drop everything above this)
dropplayarea
ld a,(playareatopliney)
ld (tmpy),a
ld a,(tmpx)
ld b,a
dpa1
push bc
ld b,10 ; inner loop
dpa2
push bc
ld a,(tmpx)
dec a ; we drop by 1 as we are copying the line above
ld b,a
ld a,(tmpy)
ld c,a
call atadd
ld (blockcolour),a ; this now contains the colour of the square directly above
ld a,(tmpx)
ld b,a
call atadd
ld a,(blockcolour)
ld (hl),a
ld a,(tmpy) ; next square in the row
inc a
ld (tmpy),a
pop bc
djnz dpa2
; finished inner loop, i.e. that row, drop x by 1 and reset y
ld a,(tmpx)
dec a
ld (tmpx),a
ld a,(playareatopliney)
ld (tmpy),a
pop bc
djnz dpa1
; at this stage we have dropped everything, now just need to erase the top line
jp erasetopline
; move playarea up. When we get a winning line, we remove the winning line and this routine
; drops the playarea above that line up (as this is the routine called when upside down)
; we pass in tmpx which is the winning line (drop everything below this)
upsidedowndropplayarea
ld a,(playareatopliney)
ld (tmpy),a
ld a,(tmpx)
uddpa1
ld b,10 ; inner loop
uddpa2
push bc
ld a,(tmpx)
inc a ; we increase by 1 as we are copying the line below
ld b,a
ld a,(tmpy)
ld c,a
call atadd
ld (blockcolour),a ; this now contains the colour of the square directly above
ld a,(tmpx)
ld b,a
call atadd
ld a,(blockcolour)
ld (hl),a
ld a,(tmpy) ; next square in the row
inc a
ld (tmpy),a
pop bc
djnz uddpa2
; finished inner loop, i.e. that row, increase x by 1 and reset y
ld a,(tmpx)
inc a
ld (tmpx),a
ld a,(playareatopliney)
ld (tmpy),a
ld a,(tmpx)
cp 22
jr nz, uddpa1
; at this stage we have dropped everything, now just need to erase the top line
jp erasetopline
; setupplayarea is used to draw a block (in black so not shown) in each square of the
; playarea
setupplayarea
xor a
ld (blockcolour),a
ld b,21
spa1
push bc ; b will be modified by later calls
ld a,b
ld (tmpx),a
call drawlineofblocks
pop bc
djnz spa1
xor a ; now clear the very top line
ld (tmpx),a
call drawlineofblocks
ret
;drawlineofblocks draws a line of blocks
; passed in tmpx, line at which to draw
drawlineofblocks
ld a,(playareatopliney)
ld (tmpy),a
ld b,10 ;10 squares in width of play area
dlb1
push bc
call drawblock
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz dlb1
ret
;checkmove. tmpx and tmpy will be set to the desired location
;and the current shape will be removed. This checks if there are
;any existing blocks at the new location
checkmove
ld a,1
ld (allowedmove),a ; default is move allowed
ld a,(tmpx) ; instead of referring to tmpx and tmpy through this routine, we copy the values to d and e registers and use those
ld d,a
ld a,(tmpy)
ld e,a
ld a,(blockshapes)
bit 7,a
jp z, cm1
ld b,d
ld c,e
call atadd
or 0 ; check if it black/black i.e. empty square
jp z, cm1 ;square is empty, can move
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm1
ld a,(blockshapes)
bit 6,a
jp z, cm2
ld b,d
ld a,e
inc a
ld c,a
call atadd
or 0
jp z, cm2
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm2
ld a,(blockshapes)
bit 5,a
jp z, cm3
ld b,d
ld a,e
inc a
inc a
ld c,a
call atadd
or 0
jp z, cm3
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm3
ld a,(blockshapes)
bit 4,a
jp z, cm4
ld b,d
ld a,e
inc a
inc a
inc a
ld c,a
call atadd
or 0
jp z, cm4
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm4
ld a,(blockshapes)
bit 3,a
jp z, cm5
ld a,d
inc a
ld b,a
ld c,e
call atadd
or 0 ; check if it black/black i.e. empty square
jp z, cm5
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm5
ld a,(blockshapes)
bit 2,a
jp z, cm6
ld a,d
inc a
ld b,a
ld a,e
inc a
ld c,a
call atadd
or 0
jp z, cm6
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm6
ld a,(blockshapes)
bit 1,a
jp z, cm7
ld a,d
inc a
ld b,a
ld a,e
inc a
inc a
ld c,a
call atadd
or 0
jp z, cm7
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm7
ld a,(blockshapes)
bit 0,a
jp z, cm8
ld a,d
inc a
ld b,a
ld a,e
inc a
inc a
inc a
ld c,a
call atadd
or 0
jp z, cm8
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm8
ld a,(blockshapes+1)
bit 7,a
jp z, cm9
ld a,d
inc a
inc a
ld b,a
ld c,e
call atadd
or 0 ; check if it black/black i.e. empty square
jp z, cm9
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm9
ld a,(blockshapes+1)
bit 6,a
jp z, cm10
ld a,d
inc a
inc a
ld b,a
ld a,e
inc a
ld c,a
call atadd
or 0
jp z, cm10
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm10
ld a,(blockshapes+1)
bit 5,a
jp z, cm11
ld a,d
inc a
inc a
ld b,a
ld a,e
inc a
inc a
ld c,a
call atadd
or 0
jp z, cm11
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm11
ld a,(blockshapes+1)
bit 4,a
jp z, cm12
ld a,d
inc a
inc a
ld b,a
ld a,e
inc a
inc a
inc a
ld c,a
call atadd
or 0
jp z, cm12
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm12
ld a,(blockshapes+1)
bit 3,a
jp z, cm13
ld a,d
inc a
inc a
inc a
ld b,a
ld c,e
call atadd
or 0 ; check if it black/black i.e. empty square
jp z, cm13
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm13
ld a,(blockshapes+1)
bit 2,a
jp z, cm14
ld a,d
inc a
inc a
inc a
ld b,a
ld a,e
inc a
ld c,a
call atadd
or 0
jp z, cm14
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm14
ld a,(blockshapes+1)
bit 1,a
jp z, cm15
ld a,d
inc a
inc a
inc a
ld b,a
ld a,e
inc a
inc a
ld c,a
call atadd
or 0
jp z, cm15
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cm15
ld a,(blockshapes+1)
bit 0,a
jp z, cmend
ld a,d
inc a
inc a
inc a
ld b,a
ld a,e
inc a
inc a
inc a
ld c,a
call atadd
or 0
jp z, cmend
xor a
ld (allowedmove),a ; cannot move
ret ; exit as cannot move
cmend
ret
; Calculate address of attribute for character at (b, c).
atadd
ld a,b ; x position.
rrca ; multiply by 32.
rrca
rrca
ld l,a ; store away in l.
and 3 ; mask bits for high byte.
add a,88 ; 88*256=22528, start of attributes.
ld h,a ; high byte done.
ld a,l ; get x*32 again.
and 224 ; mask low byte.
ld l,a ; put in l.
ld a,c ; get y displacement.
add a,l ; add to low byte.
ld l,a ; hl=address of attributes.
ld a,(hl) ; return attribute in a.
ret
; redefine keys routine written by John Young
get_keys:
ld de,0 ; DE will hold the bits for the keys pressed
ld hl,key_music_port ; address of the ports/patterns
ld b,8 ; 8 keys to check
res 0,d
dec hl
gk_loop:
inc hl
rl d
ld a,(hl) ; get the port row
in a,(254) ; check that row
cpl
and 31
inc hl ; point to the key bit pattern
cp (hl) ; check if that key is pressed
jr z,gk_key_is_pressed
;key is not pressed
res 0,d ; indicate key not pressed
djnz gk_loop ; go check next key
jr gk_exit
gk_key_is_pressed:
set 0,d ; indicate key is pressed
djnz gk_loop ; go check next key
; ok, all done, maybe, I hope, ahh pffffffffffffffffft
gk_exit:
ld a,d ; return the bit thingy
ret
; This is where we redefine the keys
do_the_redefine:
call ROM_CLS ; do the clear screen
xor a
ld hl,msg_define
call print_message
call mediumdelay
ld hl,msg_left
call print_message
ld hl,key_left_port
call get_defined_key
ld hl,msg_right
call print_message
ld hl,key_right_port
call get_defined_key
ld hl,msg_anticlockwise
call print_message
ld hl,key_anticlockwise_port
call get_defined_key
ld hl,msg_clockwise
call print_message
ld hl,key_clockwise_port
call get_defined_key
ld hl,msg_drop
call print_message
ld hl,key_drop_port
call get_defined_key
ld hl,msg_ghost
call print_message
ld hl,key_ghost_port
call get_defined_key
ld hl,msg_swap
call print_message
ld hl,key_swap_port
call get_defined_key
ld hl,msg_music
call print_message
ld hl,key_music_port
call get_defined_key
; ok, keys should have been saved, (/me hopes)
ld bc,key_music_port ; return the keys data to calling program
ret
; ----------------------------------------------
; ROUTINE: print_message
;
; prints a string which is terminated with $ff
; On entry, HL = address of message
print_message:
push hl ; save the message address
ld a,2 ; upper screen
call CHAN_OPEN ; get the channel sorted
pop hl ; get the message address back
pm_do_it:
ld a,(hl) ; get the character to print
inc hl ; point to next character
cp 255 ; end of the string
ret z ; so exit
rst 16 ; print the character
jr pm_do_it ; and do it all over again
ret
; ----------------------------------------------
; ROUTINE: get_defined_key
;
; check for key being pressed
; On entry, HL = key_xxx_port where xxx is the direction, eg up/down/left/right/fire/pause/quit
; On exit, the key_xxx_port and key_xxx_pattern will hold the values for the key pressed
;
get_defined_key:
ld de,port_array ; the array of rows
ld b,8 ; number of rows to check
gdk_loop:
ld a,(de) ; get row
in a,(254) ; check for keys on that row
cpl
and 31 ; mask off the 5 bits I want
jr z,gdk_none ; nothing pressed? ok, go to next row
inc hl ; point to the key_xxx_pattern byte
ld (hl),a ; save the pattern byte
dec hl ; go back to the key_xxx_port byte
ld a,(de) ; get the port that the key was found on
ld (hl),a ; save it
; ok, details for the pressed key are saved, lets gtfo here
call delay
ret
gdk_none:
inc de ; next row in array
djnz gdk_loop ; go check next row
; hmm, no key pressed on keyboard, sooooo do it all again
jr get_defined_key
ret ; not executed, but it stops me from getting confused, :)
; -----------------------------------------------
delay:
ld bc,32768
xor a
d_loop:
dec a
out (254),a
dec bc
ld a,b
or c
jr nz,d_loop
ret
; Update score routine by Jonathan Cauldwell
uscor
ld a,(hl) ; current value of digit.
add a,b ; add points to this digit.
ld (hl),a ; place new digit back in string.
cp 58 ; more than ASCII value '9'?
ret c ; no - relax.
sub 10 ; subtract 10.
ld (hl),a ; put new character back in string.
uscor0
dec hl ; previous character in string.
inc (hl) ; up this by one.
ld a,(hl) ; what's the new value?
cp 58 ; gone past ASCII nine?
ret c ; no, scoring done.
sub 10 ; down by ten.
ld (hl),a ; put it back
jr uscor0 ; go round again.
; Print the score
printscore
ld a,CC_INK
rst 16
ld a,7
rst 16
ld a,CC_AT
rst 16
ld a,(scorex)
rst 16
ld a,(scorey)
rst 16
ld hl, score
ld b,6
ps1
ld a,(hl) ; get the character to print
inc hl ; point to next character
rst 16 ; print the character
djnz ps1 ; and do it all over again
ret
; Print the high score
printhighscore
ld a,CC_INK
rst 16
ld a,7
rst 16
ld a,CC_AT
rst 16
ld a,(highscorex)
rst 16
ld a,(highscorey)
rst 16
ld hl, highscore
ld b,6
phs1
ld a,(hl) ; get the character to print
inc hl ; point to next character
rst 16 ; print the character
djnz phs1 ; and do it all over again
ret
gameover
; switch the music to heart and soul
ld bc,heartandsoul
ld (gamemusic),bc
ld a, 11
ld (musicspeed),a
xor a
ld (noteindex),a ; so music plays at start of song
call ROM_CLS ; do the clear screen
;open the upper screen for printing (channel 2)
ld a,2
call 5633
ld hl,gameoverlogo
call printwordswithblocks
ld hl, msg_gameover_score
call print_message
ld a,CC_INK
rst 16
ld a,7
rst 16
ld a,CC_AT
rst 16
ld a,19
rst 16
ld a,12
rst 16
ld hl, score
ld b,6
go1
ld a,(hl) ; get the character to print
inc hl ; point to next character
rst 16 ; print the character
djnz go1 ; and do it all over again
call checkhighscore
ld a,(newhighscore)
cp 0
jr z,go3 ; if equal to 0, no new high score
ld hl, msg_gameover_newhighscore
call print_message
go3
ld b,250 ; time to pause (50 frames a sec, 5 secs wait)
go2
halt ; wait for an interrupt.
djnz go2 ; repeat.
jp BEGIN
; screen that gets called when you win
youwin
; change music to you win music
ld bc,youwinmusic
ld (gamemusic),bc
ld a, 10
ld (musicspeed),a
xor a
ld (noteindex),a ; so music plays at start of song
call ROM_CLS ; do the clear screen
;open the upper screen for printing (channel 2)
ld a,2
call 5633
ld hl,youwinlogo
call printwordswithblocks
ld hl, msg_gameover_score
call print_message
ld a,CC_INK
rst 16
ld a,7
rst 16
ld a,CC_AT
rst 16
ld a,19
rst 16
ld a,12
rst 16
ld hl, score
ld b,6
yw1
ld a,(hl) ; get the character to print
inc hl ; point to next character
rst 16 ; print the character
djnz yw1 ; and do it all over again
call checkhighscore
ld a,(newhighscore)
cp 0
jr z,yw3 ; if equal to 0, no new high score
ld hl, msg_gameover_newhighscore
call print_message
yw3
ld b,250 ; time to pause (50 frames a sec, 5 secs wait)
yw2
halt ; wait for an interrupt.
djnz yw2 ; repeat.
jp BEGIN
; small delay loop used by main loop
smalldelay
ld a,(sensitivity)
cp 0
jr z,sd2
cp 1
jr z,sd3
; else its slow
ld hl, 17500
jr sd1
sd2
; fast
ld hl,5000
jr sd1
sd3
; normal
ld hl,12500
sd1
jr actualdelay
longdelay
ld hl, 17500
jr actualdelay
; medium delay loop used by main menu loop
mediumdelay
ld hl, 12500
jr actualdelay
; very small delay loop used by main menu loop
verysmalldelay
ld hl, 5000
jr actualdelay
actualdelay
dec hl
ld a,h
or l
jr nz,actualdelay
ret
; This draws words onscreen using blocks to make up the parts of the letters
; Each byte represents a colour for the block to draw
; 254 means end of line and 255 means end of data (stop drawing)
; hl is passed in, this is the address of the start of the data to print
printwordswithblocks
xor a
ld (tmpx),a
ld (tmpy),a
pbl1
ld a,(hl)
cp 254
jr z,pbl2
cp 255
ret z ; we return from here if a 255 found
ld (blockcolour),a
call drawblock
ld a,(tmpy)
inc a
ld (tmpy),a
inc hl
jp pbl1
pbl2
; end of line reached, reset y and increment x
ld a,(tmpx)
inc a
ld (tmpx),a
xor a
ld (tmpy),a
inc hl
jp pbl1
; this updates the lines completed area
printlines
ld a,CC_INK
rst 16
ld a,7
rst 16
ld a,CC_AT
rst 16
ld a,(linesx)
rst 16
ld a,(linesy)
rst 16
ld hl, totalrowscompleted
ld b,2
pl1
ld a,(hl) ; get the character to print
inc hl ; point to next character
rst 16 ; print the character
djnz pl1 ; and do it all over again
; now print slash divider
ld a,'/'
rst 16
ld hl, targetlinesforthislevel
ld b,2
pl2
ld a,(hl) ; get the character to print
inc hl ; point to next character
rst 16 ; print the character
djnz pl2 ; and do it all over again
ret
; this determines the target number of lines for this level
calculatelinesforthislevel
ld hl, linesneededperlevel
ld de,(currentlevel)
dec de
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
cp 10
jr z,cll1
cp 25
jr z,cll2
ld hl,targetlinesforthislevel+1 ; point to ones column.
ld b,a
call uscor ; up the lines count
ret
cll1
ld hl,targetlinesforthislevel ; point to tens column.
ld b,1
call uscor ; up the lines count
ret
cll2
ld hl,targetlinesforthislevel ; point to tens column.
ld b,2
call uscor ; up the lines count
ld hl,targetlinesforthislevel+1 ; point to ones column.
ld b,5
call uscor ; up the lines count
ret
; routine for printing the name of the level at the bottom of the screen
printlevelname
ld a,1 ; open channel 1
call 5633
ld a,(currentlevel)
cp 1
jr z,pln1
cp 2
jr z,pln2
cp 3
jr z,pln3
cp 4
jr z,pln4
cp 5
jr z,pln5
cp 6
jr z,pln6
cp 7
jr z,pln7
cp 8
jr z,pln8
cp 9
jr z,pln9
cp 10
jr z,pln10
jr pln12 ; no matches found, exit
pln1
ld hl, msg_game_level1
jr pln11
pln2
ld hl, msg_game_level2
jr pln11
pln3
ld hl, msg_game_level3
jr pln11
pln4
ld hl, msg_game_level4
jr pln11
pln5
ld hl, msg_game_level5
jr pln11
pln6
ld hl, msg_game_level6
jr pln11
pln7
ld hl, msg_game_level7
jr pln11
pln8
ld hl, msg_game_level8
jr pln11
pln9
ld hl, msg_game_level9
jr pln11
pln10
ld hl, msg_game_level10
pln11
call pm_do_it ; part of print_message
pln12
ld a,2 ; re-open channel 2
call 5633
ret
; sound effect when clearing lines
clearedlinenoise
ld e,200 ; repeat 200 times.
ld hl,0 ; start pointer in ROM.
noise2
push de
ld b,32 ; length of step.
noise0
push bc
ld a,(hl) ; next "random" number.
inc hl ; pointer.
and 248 ; we want a black border.
out (254),a ; write to speaker.
ld a,e ; as e gets smaller...
cpl ; ...we increase the delay.
noise1
dec a ; decrement loop counter.
jr nz,noise1 ; delay loop.
pop bc
djnz noise0 ; next step.
pop de
ld a,e
sub 24 ; size of step.
cp 30 ; end of range.
ret z
ret c
ld e,a
cpl
noise3
ld b,40 ; silent period.
noise4
djnz noise4
dec a
jr nz,noise3
jr noise2
ret
; this is the noise used when the piece drops one square
autodropnoise
ld hl,300 ; starting pitch.
ld b, 2 ; length of pitch bend.
adn1
push bc
push hl ; store pitch.
ld de,1 ; very short duration.
call 949 ; ROM beeper routine.
pop hl ; restore pitch.
inc hl ; pitch going up.
pop bc
djnz adn1 ; repeat.
ret
; this is the routine that draws the screen
drawscreen
call 3503 ; clear the screen
ld hl, msg_newscreen_level
call print_message
; now print the level
ld a,CC_AT
rst 16
ld a,12 ;x position
rst 16
ld a,18 ;y position
rst 16
ld a,7 ;colour white
ld a,(currentlevel)
cp 10
jr z,ds20
add a,48 ; add ASCII to get correct character
ld c,a
rst 16
jr ds21
ds20
;code for handling level 10
ld a,49 ; ASCII char for '1'
rst 16
ld a,48; ASCII char for '0'
rst 16
ds21
ld b,75 ; time to pause (50 frames a sec, 1.5 secs wait)
ds19
halt ; wait for an interrupt.
djnz ds19 ; repeat.
; to improve performance, we initially draw blocks whereever one of the shapes will be drawn
; we then simply change their attribute colour to show or hide them
call setupnextshape
call setupsavedshape
call setupplayarea
; draw the saved shape
call drawsavedshape
; we call selectnewpiece twice so we have a value for current and next shape
call selectnewpiece
call selectnewpiece
; reset the number of pieces played this level (to skip over the 2 select new piece calls above)
xor a
ld (piecesthislevel),a
ld b,21
dsloop1
ld a,CC_AT
rst 16
ld a,b
rst 16
ld a,11
rst 16
ld a,2 ;wall colour
ld (23695),a ; set our temporary screen colours.
ld a,146 ; ASCII code for User Defined Graphic 'C'.
rst 16
djnz dsloop1
ld b,21
dsloop2
ld a,CC_AT
rst 16
ld a,b
rst 16
ld a,22 ; y co-ordinate
rst 16
ld a,2 ;wall colour
ld (23695),a ; set our temporary screen colours.
ld a,146 ; ASCII code for User Defined Graphic 'C'.
rst 16
djnz dsloop2
ld a,12
ld (wallpos),a
ld d,21 ; default position
ld a,(upsidedown)
cp 1
jr z, ds1
jr ds2
ds1
ld d,0
ds2
ld b,10
dsloop3
ld a,CC_AT
rst 16
ld a,d
rst 16
ld a,(wallpos) ; y co-ordinate
rst 16
ld a,(wallpos)
inc a
ld (wallpos),a
ld a,2 ;wall colour
ld (23695),a ; set our temporary screen colours.
ld a,149 ; ASCII code for User Defined Graphic 'F'.
rst 16
djnz dsloop3
; now we draw the end of the pipes
ld a,(upsidedown)
cp 1
jr z,ds12
ds11
ld b,0 ;end of pipes at top
ld c,147 ; ASCII code for User Defined Graphic 'D'
jr ds13
ds12
ld b,21 ;upside down so end of pipes at bottom
ld c,148 ; ASCII code for User Defined Graphic 'E'
ds13
ld a,CC_AT
rst 16
ld a,b ;x position
rst 16
ld a,11 ;y position
rst 16
ld a,2 ;colour red
ld (23695),a ; set our temporary screen colours.
ld a,c ; graphic
rst 16
ld a,CC_AT
rst 16
ld a,b
rst 16
ld a,22 ;y position
rst 16
ld a,2 ;colour red
ld (23695),a ; set our temporary screen colours.
ld a,c ;graphic
rst 16
ds14
; now we draw the corner pieces
ld a,(upsidedown)
cp 1
jr z,ds16
ds15
ld b,21 ;corner of pipes at bottom
ld c,150 ; ASCII code for User Defined Graphic 'G'
ld d,152 ; ASCII code for User Defined Graphic 'I'
jr ds17
ds16
ld b,0 ;corner of pipes at top
ld c,151 ; ASCII code for User Defined Graphic 'H'
ld d,153 ; ASCII code for User Defined Graphic 'J'
ds17
ld a,CC_AT
rst 16
ld a,b ;x position
rst 16
ld a,11 ;y position
rst 16
ld a,2 ;colour red
ld (23695),a ; set our temporary screen colours.
ld a,c ; graphic
rst 16
ld a,CC_AT
rst 16
ld a,b ;x position
rst 16
ld a,22 ;y position
rst 16
ld a,2 ;colour red
ld (23695),a ; set our temporary screen colours.
ld a,d ; graphic
rst 16
ds18
; now we check for any special cases
ld a,(currentlevel)
cp 4 ; shooting stars
jr z,ds3
cp 5 ; more stars
jr z,ds4
cp 6 ; level letter F
jr z,ds5
cp 7 ; mirror level
jr z,ds6
cp 9
jr z,ds7
jr ds8 ; no matches to special cases
ds3
; draw 2 stars on screen
call shootingstar
call shootingstar
jr ds8
ds4
; draw 2 stars on screen
call shootingstar
call shootingstar
jr ds8
ds5
call drawletterf
jr ds8
ds6
call drawmirror
jr ds8
ds7
; draw 2 stars on screen
call shootingstar
call shootingstar
ds8
; print the score section
ld hl,msg_game_score
call print_message
call printscore
; print the high score section
ld hl,msg_game_highscore
call print_message
call printhighscore
; print ghost section
ld hl, msg_game_ghost
call print_message
ld a,(ghostactive)
cp 1
jr z,ds9
ld hl, msg_game_ghost_inactive
jr ds10
ds9
ld hl, msg_game_ghost_active
ds10
call print_message
; print next shape wording
ld hl, msg_game_nextpiece
call print_message
; print saved shape section
ld hl, msg_game_savedpiece
call print_message
; print lines completed section
ld hl,msg_game_line
call print_message
call printlines
; print the name of the level
call printlevelname
;align shape to correct orientation
call setblockshapes
; now we draw our shape
ld hl, colourlookuptable
ld de,(currentshape)
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (blockcolour),a ; now draw block in new position
call showcurrentshape
; final action of setup, set music to 'Hall of the Mountain King'
ld bc,hallofthemountainking
ld (gamemusic),bc
ld a, 6
ld (musicspeed),a
xor a
ld (noteindex),a ; so music plays at start of song
ret
; level 6 is called the letter F. We draw a letter F on-screen
drawletterf
ld c,20 ; starting x position
ld b,5
dlf1
ld a,CC_AT
rst 16
ld a,c
rst 16
ld a,16 ;y position
rst 16
ld a,4 ;colour green
ld (23695),a ; set our temporary screen colours.
ld a,144 ; ASCII code for User Defined Graphic 'A'.
rst 16
dec c ; drop c one square (up the screen)
djnz dlf1
ld a,CC_AT
rst 16
ld a,18
rst 16
ld a,17 ;y position
rst 16
ld a,4 ;colour green
ld (23695),a ; set our temporary screen colours.
ld a,144 ; ASCII code for User Defined Graphic 'A'.
rst 16
ld a,CC_AT
rst 16
ld a,16
rst 16
ld a,17 ;y position
rst 16
ld a,4 ;colour green
ld (23695),a ; set our temporary screen colours.
ld a,144 ; ASCII code for User Defined Graphic 'A'.
rst 16
ld a,CC_AT
rst 16
ld a,16
rst 16
ld a,18 ;y position
rst 16
ld a,4 ;colour green
ld (23695),a ; set our temporary screen colours.
ld a,144 ; ASCII code for User Defined Graphic 'A'.
rst 16
ret
; level 7 is called Mirror, this draws a mirrored F on screen
drawmirror
ld c,20 ; starting x position
ld b,5
dm1
ld a,CC_AT
rst 16
ld a,c
rst 16
ld a,16 ;y position
rst 16
ld a,4 ;colour green
ld (23695),a ; set our temporary screen colours.
ld a,144 ; ASCII code for User Defined Graphic 'A'.
rst 16
dec c ; drop c one square (up the screen)
djnz dm1
ld c,14
ld b,5
dm2
ld a,CC_AT
rst 16
ld a, 16
rst 16
ld a,c
rst 16
ld a,4 ;colour green
ld (23695),a ; set our temporary screen colours.
ld a,144 ; ASCII code for User Defined Graphic 'A'.
rst 16
inc c
djnz dm2
ld c,15
ld b,3
dm3
ld a,CC_AT
rst 16
ld a, 18
rst 16
ld a,c
rst 16
ld a,4 ;colour green
ld (23695),a ; set our temporary screen colours.
ld a,144 ; ASCII code for User Defined Graphic 'A'.
rst 16
inc c
djnz dm3
ret
; this sets up the variables for a new level
setuplevel
xor a
ld (upsidedown),a
ld a,(currentlevel)
cp 3
jr z,sul1
jr sul2
sul1
ld a,1
ld (upsidedown),a
sul2
; reset allowed swap
ld a,1
ld (allowedswap),a
;reset the lines completed
ld hl,totalrowscompleted
ld (hl),'0'
inc hl
ld (hl),'0'
xor a
ld (totalrowscompletednum),a
; reset the number of pieces played this level
xor a
ld (piecesthislevel),a
; calculate the lines required for this level
ld hl,targetlinesforthislevel
ld (hl),'0'
inc hl
ld (hl),'0'
call calculatelinesforthislevel
ld hl, linesneededperlevel
ld de,(currentlevel)
dec de
ld d,0 ;de is 16 bit, but we are actually trying to add an 8 bit to a 16bit so remove any possible extras
add hl,de
ld a,(hl)
ld (targetlinesforthislevelnum),a
; ensure block starts in start position
ld a,(startx)
ld (plx),a
ld a,(starty)
ld (ply),a
; if upside down we need to modify the x position
ld a,(upsidedown)
cp 1
jr z,sul3
jr sul4
sul3
ld a,(upsidedownstartx)
ld (plx),a
sul4
ret
; this setups the variables for a new level and draws the screen
newlevel
; switch off in-game music, music set to silent (will be re-activated later after new screen drawn)
ld bc,silentmusic
ld (gamemusic),bc
xor a
ld (noteindex),a ; so (silent) music plays at start of song
call setuplevel
call drawscreen
ld hl,pretim
ld a,(23672)
ld (hl),a
ret
; this does the level special action
; for example put a random square on the screen or slide a floor level or
; rise the entire board. There are special actions for levels 4,5,8,9 and 10
levelspecialaction
ld a,(currentlevel)
cp 4
jp z,lsa1
cp 5
jp z,lsa2
cp 8
jp z,lsa3
cp 9
jp z,lsa4
cp 10
jp z,lsa5
ret
lsa1
; level 4, needs shooting stars every 5 pieces
ld a,(piecesthislevel)
ld d,a
ld e,5
call getmodulo
; a will be 0 if evenly divisible by 5
cp 0
ret nz
call shootingstar
ret
lsa2
; level 5, needs shooting stars every 5 pieces
ld a,(piecesthislevel)
ld d,a
ld e,5
call getmodulo
; a will be 0 if evenly divisible by 5
cp 0
ret nz
call shootingstar
ret
lsa3
; level 8, sliding floor
; a random level is moved either left or right every 4 pieces
ld a,(piecesthislevel)
ld d,a
ld e,4
call getmodulo
; a will be 0 if evenly divisible by 4
cp 0
ret nz
call slidingfloor
ret
lsa4
; level 9, needs shooting stars every 5 pieces and sliding floor
ld a,(piecesthislevel)
ld d,a
ld e,5
call getmodulo
; a will be 0 if evenly divisible by 5
cp 0
jp nz,lsa6
call shootingstar
lsa6
ld a,(piecesthislevel)
ld d,a
ld e,4
call getmodulo
; a will be 0 if evenly divisible by 4
cp 0
ret nz
call slidingfloor
ret
lsa5
ld a,(piecesthislevel)
ld d,a
ld e,10
call getmodulo
; a will be 0 if evenly divisible by 10
cp 0
ret nz
call risingfloor
ret
; routine for calculating modulo
; Integer divides D by E
; Result in D, remainder in A
; Clobbers F, B
getmodulo
xor a
ld b,8
gm1
sla d
rla
cp e
jr c,gm2
sub e
inc d
gm2
djnz gm1
ret
; shooting star. This puts a random square somewhere on the playarea. It puts it at least 4
; squares down from the top of the screen to give the player a chance
shootingstar
call rnd
and 15 ;bitmask bits 0, 1, 2 and 3
add a,5 ; to ensure we do not put a block directly in starting position
ld (shootingstarx),a
; now that we have picked the row, need to pick the column
; column must be between 12 and 21 (inclusive)
sst1
call rnd
and 15; bitmask 4 bits
cp 10
jp nc,sst1
sst3
; we now have a value between 0 and 9
add a,12
ld c,a
ld (shootingstary),a
; now see if there is already a block at this position
ld a,(shootingstarx)
ld b,a
call atadd
or 0 ; check if it black/black i.e. empty square
jp nz,sst1
; at this stage we have picked a square and it is blank
; lets draw it on-screen
ld a,CC_AT
rst 16
ld a,(shootingstarx)
rst 16
ld a,(shootingstary)
rst 16
ld a,2 ;colour red
ld (23695),a ; set our temporary screen colours.
ld a,144 ; ASCII code for User Defined Graphic 'A'.
rst 16
ret
; finds a row (that has a square already on that row) and slides it one square left or right
slidingfloor
xor a
ld (slidingcounter),a
sf1
call rnd
and 15 ;bitmask bits 0, 1, 2 and 3
add a,5 ; so picking a level safely below start point
ld (slidingrow),a
; now that we have picked a row, need to ensure there is at least one square already on that
; row, otherwise we will need to pick a new row
; set tmpx to the row to check
ld (tmpx),a
ld a,(playareatopliney)
ld (tmpy),a
ld b,10 ;10 squares in width of play area
sf2
push bc
ld a,(tmpx)
ld b,a
ld a,(tmpy)
ld c,a
call atadd
or 0 ; check if it black/black i.e. empty square
jp nz, sf3 ; found a non black square
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz sf2
; if got here then no squares on the line, pick a new row
ld a,(slidingcounter)
inc a
cp 20
ret z ; if 20 attempts to find a row, give up
ld (slidingcounter),a
jr sf1
sf3
; so we have found a row with at least one block on it, now lets shift it
;pick whether to go left (0) or right (1)
pop bc ; to handle first push within sf2
call rnd
and 15; bitmask 4 bits
ld d,a
ld e,2
call getmodulo
cp 1
jp z,sf4 ; going right
;we are going left so get value at column 12
ld c,12
ld a,(slidingrow)
ld b,a
call atadd
ld (slidingwraparoundcolour),a
ld a,12 ; starting point is column 12
ld (tmpy),a
ld b,9 ; one less than normal
sf5
push bc
ld a,(slidingrow)
ld b,a
ld a,(tmpy)
inc a
ld c,a
call atadd
ld (slidingtempcolour),a ; this now contains the colour of the square directly to the right
ld a,(tmpy)
ld c,a
call atadd
ld a,(slidingtempcolour)
ld (hl),a
ld a,(tmpy) ; next square in the row
inc a
ld (tmpy),a
pop bc
djnz sf5
sf6
; now place the wrap around colour, place at column 21
ld a,(slidingrow)
ld b,a
ld c,21
call atadd
ld a,(slidingwraparoundcolour)
ld (hl),a
ret ;finished
sf4
;get the value at column 21
ld c,21
ld a,(slidingrow)
ld b,a
call atadd
ld (slidingwraparoundcolour),a
ld a,21 ; starting point is column 21
ld (tmpy),a
ld b,9 ; one less than normal
sf7
push bc
ld a,(slidingrow)
ld b,a
ld a,(tmpy)
dec a
ld c,a
call atadd
ld (slidingtempcolour),a ; this now contains the colour of the square directly to the left
ld a,(tmpy)
ld c,a
call atadd
ld a,(slidingtempcolour)
ld (hl),a
ld a,(tmpy) ; next square in the row
dec a
ld (tmpy),a
pop bc
djnz sf7
sf8
; now place the wrap around colour, place at column 12
ld a,(slidingrow)
ld b,a
ld c,12
call atadd
ld a,(slidingwraparoundcolour)
ld (hl),a
ret
; this is the special action for level 10. Every 10 pieces the playarea raises one level
; and random squares are added to that level
risingfloor
ld a,(playareatopliney)
ld (tmpy),a
xor a
ld (tmpx),a
rf1
ld b,10 ; inner loop
rf2
push bc
ld a,(tmpx)
inc a ; we increase by 1 as we are copying the line below
ld b,a
ld a,(tmpy)
ld c,a
call atadd
ld (blockcolour),a ; this now contains the colour of the square directly above
ld a,(tmpx)
ld b,a
call atadd
ld a,(blockcolour)
ld (hl),a
ld a,(tmpy) ; next square in the row
inc a
ld (tmpy),a
pop bc
djnz rf2
; finished inner loop, i.e. that row, increase x by 1 and reset y
ld a,(tmpx)
inc a
ld (tmpx),a
ld a,(playareatopliney)
ld (tmpy),a
ld a,(tmpx)
cp 20 ; at 21 we are at the bottom of the screen, 20 would try to read from the bricks (+1)
jr nz, rf1
; at this stage we have dropped everything, now now erase the bottom line
ld a,20
ld (tmpx),a
call eraseline
; now fill this line with random squares
ld a,(playareatopliney)
ld (tmpy),a
ld b,10 ;10 squares in width of play area
rf3
push bc
call rnd
and 15; bitmask 4 bits
ld d,a
ld e,2
call getmodulo
cp 1
jp z,rf5
rf4
ld a,(tmpx)
ld b,a
ld a,(tmpy)
ld c,a
call atadd
ld (hl),5 ; set the attribute at this square to be 5, cyan
rf5
ld a,(tmpy)
inc a
ld (tmpy),a
pop bc
djnz rf3
ret
; this checks if we have completed the level or won the game
checklevelcomplete
ld a,(targetlinesforthislevelnum)
ld b,a
ld a,(totalrowscompletednum)
cp b
jr nc,clc1
ret ; target for level nor reached, can exit routine
clc1
ld a,(currentlevel)
inc a
ld (currentlevel),a
cp 11
jp nc,youwin
; add delay
ld hl, 50000
clc2
dec hl
ld a,h
or l
jr nz,clc2
jp newlevel
;checks the score against the high score and sets the score to be the high score if larger
checkhighscore
xor a
ld (newhighscore),a
ld hl,highscore
ld c,(hl)
ld hl,score
ld a,(hl)
cp c
jr z,chs2 ;if equal we check next digit
jr nc,chs1 ; accumulator (score) is greater than high score
ret ; otherwise high score is still bettter
chs2
inc hl ; advance score pointer
ld a,(hl)
ld hl,highscore+1
ld c,(hl)
cp c
jr z,chs3
jr nc,chs1
ret
chs3
inc hl ;advance high score pointer
ld c,(hl)
ld hl,score+2
ld a,(hl)
cp c
jr z,chs4
jr nc,chs1
ret
chs4
inc hl ; advance score pointer
ld a,(hl)
ld hl,highscore+3
ld c,(hl)
cp c
jr z,chs5
jr nc,chs1
ret
chs5
inc hl ;advance high score pointer
ld c,(hl)
ld hl,score+4
ld a,(hl)
cp c
jr z,chs6
jr nc,chs1
ret
chs6
inc hl ; advance score pointer
ld a,(hl)
ld hl,highscore+5
ld c,(hl)
cp c
jr nc,chs1
ret ;if reach here score is less than high score
chs1
ld a,1
ld (newhighscore),a ;new high score
ld de,highscore
ld hl,score
ld bc,6
ldir
ret
; this allows the player to switch the music on off
switchmusiconoff
ld a,(gamemusicenabled)
cp 0
jr nz,smo1
; if here then music is currently on, switch off
ld a,1
ld (gamemusicenabled),a
ret
smo1
; if here then music is currently on, we switch off
xor a
ld (gamemusicenabled),a
ret
; the in-game music section
org 40000
gamemusic defb 0,0
musicspeed defb 6
;alternative version 'In the Hall of the Mountain King'
;set musicspeed value to 6 to use
hallofthemountainking
defb 48,48,43,43,40,40,36,36,32,32,40,40,32,32
defb 32,32
defb 34,34,43,43,34,34,34,34,36,36,45,45,36,36,36,36
defb 48,48,43,43,40,40,36,36,32,32,40,40,32,32
defb 24,24,27,27,32,32,40,40,32,32,27,27,27,27,27,27
defb 27,27
defb 128,128,114,114,102,102,96,96,86,86,102,102,86,86
defb 86,86,81,81,102,102,81,81,81,81,86,86,102,102,86,86
defb 86,86
defb 128,128,114,114,102,102,96,96,86,86,102,102,86,86
defb 86,86,81,81,102,102,81,81,81,81,86,86,86,86
defb 86,86,86,86,255
; music played when you win
;set cp value to 10 in playmusic to use
youwinmusic
defb 18,24,23,20,23,24,27,27
defb 23,18,20,23,24,23,20,18
defb 23,27,27,27,24,23,20,17
defb 13,15,17,18,23,18,20,23
defb 24,24,23,20,18,23,27,27
defb 1,18,23,20,24,23,27,28
defb 24,1,18,23,20,24,23,18
defb 13,14,255
; 'If I were a rich man' from Jet Set Willy
ifiwerearichman
defb 86,96,86,96,102,102,128,128,128,128,102,96,86,96,86,96
defb 102,96,86,76,72,76,72,76,86,86,86,86,86,86,86,86
defb 64,64,64,64,68,68,76,76,86,96,102,96,86,86,102,102
defb 81,86,96,86,81,81,96,96,64,64,64,64,64,64,64,64,255
; heart and soul, speed 11
heartandsoul
defb 91,91,91,0,91,96,108,96
defb 91,81,0,72,72,72,0,72
defb 81,91,81,72,68,0,61,0
defb 91,0,54,61,68,72,81,72
defb 81,91,0,0,255
; silent music
silentmusic
defb 0,0,0,255
noteindex defb 0
musicpauseindex defb 0
playmusic
; now see if player wants music
ld a,(gamemusicenabled)
cp 0
ret z
; we do not play a not every interrupt call. This piece of code allows us
; to play a note every X (musicspeed) interrupts
ld a,(musicspeed)
ld d,a
ld a,(musicpauseindex)
inc a
ld (musicpauseindex),a
cp d
jr nc,pm1
ret
pm1
xor a
ld (musicpauseindex),a
jp playnote
; this music routine adapted from manic miner code
; 255 means end of music data, back to beginning of music data
; 0 is a pause, don't play anything
playnote
ld a,(noteindex)
ld e,a
ld d,0
ld hl,(gamemusic)
add hl,de
ld a,(hl)
cp 255 ; end of song
jr z,pn3
cp 0 ; pause/silence
jr z,pn6
; not end of song, increase index
ld a,(noteindex)
inc a
ld (noteindex),a
jr pn4
pn3
xor a
ld (noteindex),a
jr playnote
pn4
xor a ; set border colour to 0
ld e,(hl)
ld bc,3
pn1
out (254),a
dec e
jr nz,pn2
ld e,(hl)
xor 24
pn2
djnz pn1
dec c
jr nz,pn1
ret
; pause routine (0 in music data), increases index, but does not play sound
pn6
ld a,(noteindex)
inc a
ld (noteindex),a
ret
org 51400 ; location of our interrupt routine
Interrupt
di ; disable interrupts
push af ; preserve registers.
push bc
push hl
push de
push ix
; here is where we put the calls to the routines we want to execute during interrupts
; e.g. play music etc.
; we increment the frames counter as this is used to determine the rate of drop of the
; main game piece
ld hl,23672 ; frames counter.
inc (hl) ; move it along.
call playmusic
; end of our routines
pop ix ; restore registers.
pop de
pop hl
pop bc
pop af
ei ; always re-enable interrupts before returning.
reti ; done (return from interrupt)
org 65024
; pointers to interrupt routine.
; 257 instances of '200'
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200,200,200,200,200,200,200,200
defb 200
end 24576 ; assembler directive, says this is the end of the code and where the entry point is
| 19.802015
| 128
| 0.682553
|
e1197d97ddce807ff5c71cb31a09dc8b3ba4e6b1
| 269
|
asm
|
Assembly
|
programs/oeis/040/A040139.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/040/A040139.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/040/A040139.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A040139: Continued fraction for sqrt(152).
; 12,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3,24,3
pow $0,4
mov $1,$0
trn $0,4
sub $0,4
gcd $1,$0
mul $1,3
| 26.9
| 166
| 0.605948
|
8b6a71df75ee2285d772141a3b7c3aeb303cf853
| 608
|
asm
|
Assembly
|
programs/oeis/129/A129308.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/129/A129308.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/129/A129308.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A129308: a(n) is the number of positive integers k such that k*(k+1) divides n.
; 0,1,0,1,0,2,0,1,0,1,0,3,0,1,0,1,0,2,0,2,0,1,0,3,0,1,0,1,0,3,0,1,0,1,0,3,0,1,0,2,0,3,0,1,0,1,0,3,0,1,0,1,0,2,0,2,0,1,0,5,0,1,0,1,0,2,0,1,0,1,0,4,0,1,0,1,0,2,0,2,0,1,0,4,0,1,0,1,0,4,0,1,0,1,0,3,0,1,0,2
mov $4,2
mov $6,$0
lpb $4
mov $0,$6
mov $3,0
sub $4,1
add $0,$4
sub $0,1
mov $5,0
lpb $0
mov $7,$0
sub $0,1
mov $8,$3
cmp $8,0
add $3,$8
div $7,$3
add $3,1
add $7,1
div $7,$3
add $5,$7
lpe
mov $2,$4
lpb $2
mov $1,$5
mov $2,0
lpe
lpe
sub $1,$5
mov $0,$1
| 18.424242
| 201
| 0.483553
|
06d6444b50e0ec7ef3087c61b5854e23abdcbd89
| 42,672
|
asm
|
Assembly
|
target/cos_117/disasm/iop_overlay1/FEIMSG.asm
|
jrrk2/cray-sim
|
52c9639808d6890517092637b188282c00cce4f7
|
[
"BSL-1.0"
] | 49
|
2020-10-09T12:29:16.000Z
|
2022-03-12T02:33:35.000Z
|
target/cos_117/disasm/iop_overlay1/FEIMSG.asm
|
jrrk2/cray-sim
|
52c9639808d6890517092637b188282c00cce4f7
|
[
"BSL-1.0"
] | 1
|
2021-12-29T15:59:25.000Z
|
2021-12-29T15:59:25.000Z
|
target/cos_117/disasm/iop_overlay1/FEIMSG.asm
|
jrrk2/cray-sim
|
52c9639808d6890517092637b188282c00cce4f7
|
[
"BSL-1.0"
] | 6
|
2021-04-12T06:10:32.000Z
|
2022-02-08T23:11:19.000Z
|
0x0000 (0x000000) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x0001 (0x000002) 0x291A- f:00024 d: 282 | OR[282] = A
0x0002 (0x000004) 0x211A- f:00020 d: 282 | A = OR[282]
0x0003 (0x000006) 0x841D- f:00102 d: 29 | P = P + 29 (0x0020), A = 0
0x0004 (0x000008) 0x1018- f:00010 d: 24 | A = 24 (0x0018)
0x0005 (0x00000A) 0x291F- f:00024 d: 287 | OR[287] = A
0x0006 (0x00000C) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x0007 (0x00000E) 0x1401- f:00012 d: 1 | A = A + 1 (0x0001)
0x0008 (0x000010) 0x2920- f:00024 d: 288 | OR[288] = A
0x0009 (0x000012) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x000A (0x000014) 0x2921- f:00024 d: 289 | OR[289] = A
0x000B (0x000016) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x000C (0x000018) 0x2922- f:00024 d: 290 | OR[290] = A
0x000D (0x00001A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x000E (0x00001C) 0x2923- f:00024 d: 291 | OR[291] = A
0x000F (0x00001E) 0x111B- f:00010 d: 283 | A = 283 (0x011B)
0x0010 (0x000020) 0x2924- f:00024 d: 292 | OR[292] = A
0x0011 (0x000022) 0x111F- f:00010 d: 287 | A = 287 (0x011F)
0x0012 (0x000024) 0x5800- f:00054 d: 0 | B = A
0x0013 (0x000026) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0014 (0x000028) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0015 (0x00002A) 0x291A- f:00024 d: 282 | OR[282] = A
0x0016 (0x00002C) 0x8602- f:00103 d: 2 | P = P + 2 (0x0018), A # 0
0x0017 (0x00002E) 0x7008- f:00070 d: 8 | P = P + 8 (0x001F)
0x0018 (0x000030) 0x1004- f:00010 d: 4 | A = 4 (0x0004)
0x0019 (0x000032) 0x291F- f:00024 d: 287 | OR[287] = A
0x001A (0x000034) 0x111F- f:00010 d: 287 | A = 287 (0x011F)
0x001B (0x000036) 0x5800- f:00054 d: 0 | B = A
0x001C (0x000038) 0x1800-0x0F18 f:00014 d: 0 | A = 3864 (0x0F18)
0x001E (0x00003C) 0x7C09- f:00076 d: 9 | R = OR[9]
0x001F (0x00003E) 0x721D- f:00071 d: 29 | P = P - 29 (0x0002)
0x0020 (0x000040) 0x211B- f:00020 d: 283 | A = OR[283]
0x0021 (0x000042) 0x1428- f:00012 d: 40 | A = A + 40 (0x0028)
0x0022 (0x000044) 0x291E- f:00024 d: 286 | OR[286] = A
0x0023 (0x000046) 0x211B- f:00020 d: 283 | A = OR[283]
0x0024 (0x000048) 0x290E- f:00024 d: 270 | OR[270] = A
0x0025 (0x00004A) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x0026 (0x00004C) 0x290D- f:00024 d: 269 | OR[269] = A
0x0027 (0x00004E) 0x210D- f:00020 d: 269 | A = OR[269]
0x0028 (0x000050) 0x8407- f:00102 d: 7 | P = P + 7 (0x002F), A = 0
0x0029 (0x000052) 0x1800-0x2020 f:00014 d: 0 | A = 8224 (0x2020)
0x002B (0x000056) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x002C (0x000058) 0x2F0D- f:00027 d: 269 | OR[269] = OR[269] - 1
0x002D (0x00005A) 0x2D0E- f:00026 d: 270 | OR[270] = OR[270] + 1
0x002E (0x00005C) 0x7207- f:00071 d: 7 | P = P - 7 (0x0027)
0x002F (0x00005E) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x0030 (0x000060) 0x291F- f:00024 d: 287 | OR[287] = A
0x0031 (0x000062) 0x1800-0x0041 f:00014 d: 0 | A = 65 (0x0041)
0x0033 (0x000066) 0x2920- f:00024 d: 288 | OR[288] = A
0x0034 (0x000068) 0x1800-0x0000 f:00014 d: 0 | A = 0 (0x0000)
0x0036 (0x00006C) 0x2921- f:00024 d: 289 | OR[289] = A
0x0037 (0x00006E) 0x211B- f:00020 d: 283 | A = OR[283]
0x0038 (0x000070) 0x2922- f:00024 d: 290 | OR[290] = A
0x0039 (0x000072) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x003A (0x000074) 0x2923- f:00024 d: 291 | OR[291] = A
0x003B (0x000076) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x003C (0x000078) 0x2924- f:00024 d: 292 | OR[292] = A
0x003D (0x00007A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x003E (0x00007C) 0x2925- f:00024 d: 293 | OR[293] = A
0x003F (0x00007E) 0x111F- f:00010 d: 287 | A = 287 (0x011F)
0x0040 (0x000080) 0x5800- f:00054 d: 0 | B = A
0x0041 (0x000082) 0x1800-0x0F18 f:00014 d: 0 | A = 3864 (0x0F18)
0x0043 (0x000086) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0044 (0x000088) 0x1800-0x01AF f:00014 d: 0 | A = 431 (0x01AF)
0x0046 (0x00008C) 0x2518- f:00022 d: 280 | A = A + OR[280]
0x0047 (0x00008E) 0x2403- f:00022 d: 3 | A = A + OR[3]
0x0048 (0x000090) 0x291A- f:00024 d: 282 | OR[282] = A
0x0049 (0x000092) 0x311A- f:00030 d: 282 | A = (OR[282])
0x004A (0x000094) 0x291A- f:00024 d: 282 | OR[282] = A
0x004B (0x000096) 0x100F- f:00010 d: 15 | A = 15 (0x000F)
0x004C (0x000098) 0x291C- f:00024 d: 284 | OR[284] = A
0x004D (0x00009A) 0x744E- f:00072 d: 78 | R = P + 78 (0x009B)
0x004E (0x00009C) 0x1800-0x01B9 f:00014 d: 0 | A = 441 (0x01B9)
0x0050 (0x0000A0) 0x291A- f:00024 d: 282 | OR[282] = A
0x0051 (0x0000A2) 0x744A- f:00072 d: 74 | R = P + 74 (0x009B)
0x0052 (0x0000A4) 0x2119- f:00020 d: 281 | A = OR[281]
0x0053 (0x0000A6) 0x391E- f:00034 d: 286 | (OR[286]) = A
0x0054 (0x0000A8) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x0055 (0x0000AA) 0x291F- f:00024 d: 287 | OR[287] = A
0x0056 (0x0000AC) 0x1800-0x0011 f:00014 d: 0 | A = 17 (0x0011)
0x0058 (0x0000B0) 0x2920- f:00024 d: 288 | OR[288] = A
0x0059 (0x0000B2) 0x211E- f:00020 d: 286 | A = OR[286]
0x005A (0x0000B4) 0x2921- f:00024 d: 289 | OR[289] = A
0x005B (0x0000B6) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x005C (0x0000B8) 0x2922- f:00024 d: 290 | OR[290] = A
0x005D (0x0000BA) 0x1010- f:00010 d: 16 | A = 16 (0x0010)
0x005E (0x0000BC) 0x2923- f:00024 d: 291 | OR[291] = A
0x005F (0x0000BE) 0x211B- f:00020 d: 283 | A = OR[283]
0x0060 (0x0000C0) 0x2924- f:00024 d: 292 | OR[292] = A
0x0061 (0x0000C2) 0x211C- f:00020 d: 284 | A = OR[284]
0x0062 (0x0000C4) 0x2925- f:00024 d: 293 | OR[293] = A
0x0063 (0x0000C6) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0064 (0x0000C8) 0x2926- f:00024 d: 294 | OR[294] = A
0x0065 (0x0000CA) 0x111F- f:00010 d: 287 | A = 287 (0x011F)
0x0066 (0x0000CC) 0x5800- f:00054 d: 0 | B = A
0x0067 (0x0000CE) 0x1800-0x0F18 f:00014 d: 0 | A = 3864 (0x0F18)
0x0069 (0x0000D2) 0x7C09- f:00076 d: 9 | R = OR[9]
0x006A (0x0000D4) 0x1002- f:00010 d: 2 | A = 2 (0x0002)
0x006B (0x0000D6) 0x2B1C- f:00025 d: 284 | OR[284] = A + OR[284]
0x006C (0x0000D8) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x006D (0x0000DA) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x006E (0x0000DC) 0x290D- f:00024 d: 269 | OR[269] = A
0x006F (0x0000DE) 0x211C- f:00020 d: 284 | A = OR[284]
0x0070 (0x0000E0) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001)
0x0071 (0x0000E2) 0x251B- f:00022 d: 283 | A = A + OR[283]
0x0072 (0x0000E4) 0x290E- f:00024 d: 270 | OR[270] = A
0x0073 (0x0000E6) 0x211C- f:00020 d: 284 | A = OR[284]
0x0074 (0x0000E8) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x0075 (0x0000EA) 0x2908- f:00024 d: 264 | OR[264] = A
0x0076 (0x0000EC) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0077 (0x0000EE) 0x2708- f:00023 d: 264 | A = A - OR[264]
0x0078 (0x0000F0) 0x8607- f:00103 d: 7 | P = P + 7 (0x007F), A # 0
0x0079 (0x0000F2) 0x310E- f:00030 d: 270 | A = (OR[270])
0x007A (0x0000F4) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009)
0x007B (0x0000F6) 0x250D- f:00022 d: 269 | A = A + OR[269]
0x007C (0x0000F8) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009)
0x007D (0x0000FA) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x007E (0x0000FC) 0x7006- f:00070 d: 6 | P = P + 6 (0x0084)
0x007F (0x0000FE) 0x310E- f:00030 d: 270 | A = (OR[270])
0x0080 (0x000100) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00)
0x0082 (0x000104) 0x250D- f:00022 d: 269 | A = A + OR[269]
0x0083 (0x000106) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x0084 (0x000108) 0x1010- f:00010 d: 16 | A = 16 (0x0010)
0x0085 (0x00010A) 0x291F- f:00024 d: 287 | OR[287] = A
0x0086 (0x00010C) 0x211B- f:00020 d: 283 | A = OR[283]
0x0087 (0x00010E) 0x2920- f:00024 d: 288 | OR[288] = A
0x0088 (0x000110) 0x111F- f:00010 d: 287 | A = 287 (0x011F)
0x0089 (0x000112) 0x5800- f:00054 d: 0 | B = A
0x008A (0x000114) 0x1800-0x0F18 f:00014 d: 0 | A = 3864 (0x0F18)
0x008C (0x000118) 0x7C09- f:00076 d: 9 | R = OR[9]
0x008D (0x00011A) 0x1019- f:00010 d: 25 | A = 25 (0x0019)
0x008E (0x00011C) 0x291F- f:00024 d: 287 | OR[287] = A
0x008F (0x00011E) 0x211B- f:00020 d: 283 | A = OR[283]
0x0090 (0x000120) 0x2920- f:00024 d: 288 | OR[288] = A
0x0091 (0x000122) 0x111F- f:00010 d: 287 | A = 287 (0x011F)
0x0092 (0x000124) 0x5800- f:00054 d: 0 | B = A
0x0093 (0x000126) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0094 (0x000128) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0095 (0x00012A) 0x1003- f:00010 d: 3 | A = 3 (0x0003)
0x0096 (0x00012C) 0x291F- f:00024 d: 287 | OR[287] = A
0x0097 (0x00012E) 0x111F- f:00010 d: 287 | A = 287 (0x011F)
0x0098 (0x000130) 0x5800- f:00054 d: 0 | B = A
0x0099 (0x000132) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x009A (0x000134) 0x7C09- f:00076 d: 9 | R = OR[9]
0x009B (0x000136) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x009C (0x000138) 0x2913- f:00024 d: 275 | OR[275] = A
0x009D (0x00013A) 0x1001- f:00010 d: 1 | A = 1 (0x0001)
0x009E (0x00013C) 0x2914- f:00024 d: 276 | OR[276] = A
0x009F (0x00013E) 0x211A- f:00020 d: 282 | A = OR[282]
0x00A0 (0x000140) 0x2403- f:00022 d: 3 | A = A + OR[3]
0x00A1 (0x000142) 0x291A- f:00024 d: 282 | OR[282] = A
0x00A2 (0x000144) 0x2114- f:00020 d: 276 | A = OR[276]
0x00A3 (0x000146) 0x8439- f:00102 d: 57 | P = P + 57 (0x00DC), A = 0
0x00A4 (0x000148) 0x2113- f:00020 d: 275 | A = OR[275]
0x00A5 (0x00014A) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001)
0x00A6 (0x00014C) 0x251A- f:00022 d: 282 | A = A + OR[282]
0x00A7 (0x00014E) 0x290D- f:00024 d: 269 | OR[269] = A
0x00A8 (0x000150) 0x310D- f:00030 d: 269 | A = (OR[269])
0x00A9 (0x000152) 0x290D- f:00024 d: 269 | OR[269] = A
0x00AA (0x000154) 0x2113- f:00020 d: 275 | A = OR[275]
0x00AB (0x000156) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x00AC (0x000158) 0x2908- f:00024 d: 264 | OR[264] = A
0x00AD (0x00015A) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00AE (0x00015C) 0x2708- f:00023 d: 264 | A = A - OR[264]
0x00AF (0x00015E) 0x8604- f:00103 d: 4 | P = P + 4 (0x00B3), A # 0
0x00B0 (0x000160) 0x210D- f:00020 d: 269 | A = OR[269]
0x00B1 (0x000162) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008)
0x00B2 (0x000164) 0x290D- f:00024 d: 269 | OR[269] = A
0x00B3 (0x000166) 0x210D- f:00020 d: 269 | A = OR[269]
0x00B4 (0x000168) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x00B5 (0x00016A) 0x2914- f:00024 d: 276 | OR[276] = A
0x00B6 (0x00016C) 0x2D13- f:00026 d: 275 | OR[275] = OR[275] + 1
0x00B7 (0x00016E) 0x2114- f:00020 d: 276 | A = OR[276]
0x00B8 (0x000170) 0x1620- f:00013 d: 32 | A = A - 32 (0x0020)
0x00B9 (0x000172) 0x8202- f:00101 d: 2 | P = P + 2 (0x00BB), C = 1
0x00BA (0x000174) 0x701F- f:00070 d: 31 | P = P + 31 (0x00D9)
0x00BB (0x000176) 0x2114- f:00020 d: 276 | A = OR[276]
0x00BC (0x000178) 0x167F- f:00013 d: 127 | A = A - 127 (0x007F)
0x00BD (0x00017A) 0x8002- f:00100 d: 2 | P = P + 2 (0x00BF), C = 0
0x00BE (0x00017C) 0x701B- f:00070 d: 27 | P = P + 27 (0x00D9)
0x00BF (0x00017E) 0x2114- f:00020 d: 276 | A = OR[276]
0x00C0 (0x000180) 0x12FF- f:00011 d: 255 | A = A & 255 (0x00FF)
0x00C1 (0x000182) 0x290D- f:00024 d: 269 | OR[269] = A
0x00C2 (0x000184) 0x211C- f:00020 d: 284 | A = OR[284]
0x00C3 (0x000186) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001)
0x00C4 (0x000188) 0x251B- f:00022 d: 283 | A = A + OR[283]
0x00C5 (0x00018A) 0x290E- f:00024 d: 270 | OR[270] = A
0x00C6 (0x00018C) 0x211C- f:00020 d: 284 | A = OR[284]
0x00C7 (0x00018E) 0x1201- f:00011 d: 1 | A = A & 1 (0x0001)
0x00C8 (0x000190) 0x2908- f:00024 d: 264 | OR[264] = A
0x00C9 (0x000192) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00CA (0x000194) 0x2708- f:00023 d: 264 | A = A - OR[264]
0x00CB (0x000196) 0x8607- f:00103 d: 7 | P = P + 7 (0x00D2), A # 0
0x00CC (0x000198) 0x310E- f:00030 d: 270 | A = (OR[270])
0x00CD (0x00019A) 0x0A09- f:00005 d: 9 | A = A < 9 (0x0009)
0x00CE (0x00019C) 0x250D- f:00022 d: 269 | A = A + OR[269]
0x00CF (0x00019E) 0x0C09- f:00006 d: 9 | A = A >> 9 (0x0009)
0x00D0 (0x0001A0) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x00D1 (0x0001A2) 0x7006- f:00070 d: 6 | P = P + 6 (0x00D7)
0x00D2 (0x0001A4) 0x310E- f:00030 d: 270 | A = (OR[270])
0x00D3 (0x0001A6) 0x1A00-0xFF00 f:00015 d: 0 | A = A & 65280 (0xFF00)
0x00D5 (0x0001AA) 0x250D- f:00022 d: 269 | A = A + OR[269]
0x00D6 (0x0001AC) 0x390E- f:00034 d: 270 | (OR[270]) = A
0x00D7 (0x0001AE) 0x2D1C- f:00026 d: 284 | OR[284] = OR[284] + 1
0x00D8 (0x0001B0) 0x7003- f:00070 d: 3 | P = P + 3 (0x00DB)
0x00D9 (0x0001B2) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x00DA (0x0001B4) 0x2914- f:00024 d: 276 | OR[276] = A
0x00DB (0x0001B6) 0x7239- f:00071 d: 57 | P = P - 57 (0x00A2)
0x00DC (0x0001B8) 0x0200- f:00001 d: 0 | EXIT
0x00DD (0x0001BA) 0x0000- f:00000 d: 0 | PASS
0x00DE (0x0001BC) 0x4645- f:00043 d: 69 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0045 ****
0x00DF (0x0001BE) 0x4920- f:00044 d: 288 | A = A > B | **** non-standard encoding with D:0x0120 ****
0x00E0 (0x0001C0) 0x4C4F- f:00046 d: 79 | A = A >> B | **** non-standard encoding with D:0x004F ****
0x00E1 (0x0001C2) 0x4749- f:00043 d: 329 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0149 ****
0x00E2 (0x0001C4) 0x4341- f:00041 d: 321 | C = 1, io 0501 = BZ
0x00E3 (0x0001C6) 0x4C20- f:00046 d: 32 | A = A >> B | **** non-standard encoding with D:0x0020 ****
0x00E4 (0x0001C8) 0x5041- f:00050 d: 65 | A = B | **** non-standard encoding with D:0x0041 ****
0x00E5 (0x0001CA) 0x5448- f:00052 d: 72 | A = A + B | **** non-standard encoding with D:0x0048 ****
0x00E6 (0x0001CC) 0x2043- f:00020 d: 67 | A = OR[67]
0x00E7 (0x0001CE) 0x4F4E- f:00047 d: 334 | A = A << B | **** non-standard encoding with D:0x014E ****
0x00E8 (0x0001D0) 0x4E45- f:00047 d: 69 | A = A << B | **** non-standard encoding with D:0x0045 ****
0x00E9 (0x0001D2) 0x4354- f:00041 d: 340 | C = 1, io 0524 = BZ
0x00EA (0x0001D4) 0x494F- f:00044 d: 335 | A = A > B | **** non-standard encoding with D:0x014F ****
0x00EB (0x0001D6) 0x4E20- f:00047 d: 32 | A = A << B | **** non-standard encoding with D:0x0020 ****
0x00EC (0x0001D8) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x00ED (0x0001DA) 0x4954- f:00044 d: 340 | A = A > B | **** non-standard encoding with D:0x0154 ****
0x00EE (0x0001DC) 0x4941- f:00044 d: 321 | A = A > B | **** non-standard encoding with D:0x0141 ****
0x00EF (0x0001DE) 0x4C49- f:00046 d: 73 | A = A >> B | **** non-standard encoding with D:0x0049 ****
0x00F0 (0x0001E0) 0x5A45- f:00055 d: 69 | B = A + B | **** non-standard encoding with D:0x0045 ****
0x00F1 (0x0001E2) 0x4400- f:00042 d: 0 | C = 1, IOB = DN
0x00F2 (0x0001E4) 0x4645- f:00043 d: 69 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0045 ****
0x00F3 (0x0001E6) 0x4920- f:00044 d: 288 | A = A > B | **** non-standard encoding with D:0x0120 ****
0x00F4 (0x0001E8) 0x4C4F- f:00046 d: 79 | A = A >> B | **** non-standard encoding with D:0x004F ****
0x00F5 (0x0001EA) 0x4749- f:00043 d: 329 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0149 ****
0x00F6 (0x0001EC) 0x4341- f:00041 d: 321 | C = 1, io 0501 = BZ
0x00F7 (0x0001EE) 0x4C20- f:00046 d: 32 | A = A >> B | **** non-standard encoding with D:0x0020 ****
0x00F8 (0x0001F0) 0x5041- f:00050 d: 65 | A = B | **** non-standard encoding with D:0x0041 ****
0x00F9 (0x0001F2) 0x5448- f:00052 d: 72 | A = A + B | **** non-standard encoding with D:0x0048 ****
0x00FA (0x0001F4) 0x2043- f:00020 d: 67 | A = OR[67]
0x00FB (0x0001F6) 0x4F4E- f:00047 d: 334 | A = A << B | **** non-standard encoding with D:0x014E ****
0x00FC (0x0001F8) 0x4E45- f:00047 d: 69 | A = A << B | **** non-standard encoding with D:0x0045 ****
0x00FD (0x0001FA) 0x4354- f:00041 d: 340 | C = 1, io 0524 = BZ
0x00FE (0x0001FC) 0x494F- f:00044 d: 335 | A = A > B | **** non-standard encoding with D:0x014F ****
0x00FF (0x0001FE) 0x4E20- f:00047 d: 32 | A = A << B | **** non-standard encoding with D:0x0020 ****
0x0100 (0x000200) 0x4E4F- f:00047 d: 79 | A = A << B | **** non-standard encoding with D:0x004F ****
0x0101 (0x000202) 0x5420- f:00052 d: 32 | A = A + B | **** non-standard encoding with D:0x0020 ****
0x0102 (0x000204) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x0103 (0x000206) 0x4954- f:00044 d: 340 | A = A > B | **** non-standard encoding with D:0x0154 ****
0x0104 (0x000208) 0x4941- f:00044 d: 321 | A = A > B | **** non-standard encoding with D:0x0141 ****
0x0105 (0x00020A) 0x4C49- f:00046 d: 73 | A = A >> B | **** non-standard encoding with D:0x0049 ****
0x0106 (0x00020C) 0x5A45- f:00055 d: 69 | B = A + B | **** non-standard encoding with D:0x0045 ****
0x0107 (0x00020E) 0x4400- f:00042 d: 0 | C = 1, IOB = DN
0x0108 (0x000210) 0x4645- f:00043 d: 69 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0045 ****
0x0109 (0x000212) 0x4920- f:00044 d: 288 | A = A > B | **** non-standard encoding with D:0x0120 ****
0x010A (0x000214) 0x4C4F- f:00046 d: 79 | A = A >> B | **** non-standard encoding with D:0x004F ****
0x010B (0x000216) 0x4749- f:00043 d: 329 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0149 ****
0x010C (0x000218) 0x4341- f:00041 d: 321 | C = 1, io 0501 = BZ
0x010D (0x00021A) 0x4C20- f:00046 d: 32 | A = A >> B | **** non-standard encoding with D:0x0020 ****
0x010E (0x00021C) 0x5041- f:00050 d: 65 | A = B | **** non-standard encoding with D:0x0041 ****
0x010F (0x00021E) 0x5448- f:00052 d: 72 | A = A + B | **** non-standard encoding with D:0x0048 ****
0x0110 (0x000220) 0x2043- f:00020 d: 67 | A = OR[67]
0x0111 (0x000222) 0x4F4E- f:00047 d: 334 | A = A << B | **** non-standard encoding with D:0x014E ****
0x0112 (0x000224) 0x4E45- f:00047 d: 69 | A = A << B | **** non-standard encoding with D:0x0045 ****
0x0113 (0x000226) 0x4354- f:00041 d: 340 | C = 1, io 0524 = BZ
0x0114 (0x000228) 0x494F- f:00044 d: 335 | A = A > B | **** non-standard encoding with D:0x014F ****
0x0115 (0x00022A) 0x4E20- f:00047 d: 32 | A = A << B | **** non-standard encoding with D:0x0020 ****
0x0116 (0x00022C) 0x5445- f:00052 d: 69 | A = A + B | **** non-standard encoding with D:0x0045 ****
0x0117 (0x00022E) 0x524D- f:00051 d: 77 | A = A & B | **** non-standard encoding with D:0x004D ****
0x0118 (0x000230) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x0119 (0x000232) 0x4154- f:00040 d: 340 | C = 1, io 0524 = DN
0x011A (0x000234) 0x4544- f:00042 d: 324 | C = 1, IOB = DN | **** non-standard encoding with D:0x0144 ****
0x011B (0x000236) 0x0000- f:00000 d: 0 | PASS
0x011C (0x000238) 0x564D- f:00053 d: 77 | A = A - B | **** non-standard encoding with D:0x004D ****
0x011D (0x00023A) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x011E (0x00023C) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x011F (0x00023E) 0x5445- f:00052 d: 69 | A = A + B | **** non-standard encoding with D:0x0045 ****
0x0120 (0x000240) 0x5246- f:00051 d: 70 | A = A & B | **** non-standard encoding with D:0x0046 ****
0x0121 (0x000242) 0x4143- f:00040 d: 323 | C = 1, io 0503 = DN
0x0122 (0x000244) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0123 (0x000246) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x0124 (0x000248) 0x4954- f:00044 d: 340 | A = A > B | **** non-standard encoding with D:0x0154 ****
0x0125 (0x00024A) 0x4941- f:00044 d: 321 | A = A > B | **** non-standard encoding with D:0x0141 ****
0x0126 (0x00024C) 0x4C49- f:00046 d: 73 | A = A >> B | **** non-standard encoding with D:0x0049 ****
0x0127 (0x00024E) 0x5A41- f:00055 d: 65 | B = A + B | **** non-standard encoding with D:0x0041 ****
0x0128 (0x000250) 0x5449- f:00052 d: 73 | A = A + B | **** non-standard encoding with D:0x0049 ****
0x0129 (0x000252) 0x4F4E- f:00047 d: 334 | A = A << B | **** non-standard encoding with D:0x014E ****
0x012A (0x000254) 0x2046- f:00020 d: 70 | A = OR[70]
0x012B (0x000256) 0x4149- f:00040 d: 329 | C = 1, io 0511 = DN
0x012C (0x000258) 0x4C45- f:00046 d: 69 | A = A >> B | **** non-standard encoding with D:0x0045 ****
0x012D (0x00025A) 0x443A- f:00042 d: 58 | C = 1, IOB = DN | **** non-standard encoding with D:0x003A ****
0x012E (0x00025C) 0x2052- f:00020 d: 82 | A = OR[82]
0x012F (0x00025E) 0x4553- f:00042 d: 339 | C = 1, IOB = DN | **** non-standard encoding with D:0x0153 ****
0x0130 (0x000260) 0x4F55- f:00047 d: 341 | A = A << B | **** non-standard encoding with D:0x0155 ****
0x0131 (0x000262) 0x5243- f:00051 d: 67 | A = A & B | **** non-standard encoding with D:0x0043 ****
0x0132 (0x000264) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0133 (0x000266) 0x4552- f:00042 d: 338 | C = 1, IOB = DN | **** non-standard encoding with D:0x0152 ****
0x0134 (0x000268) 0x524F- f:00051 d: 79 | A = A & B | **** non-standard encoding with D:0x004F ****
0x0135 (0x00026A) 0x5200- f:00051 d: 0 | A = A & B
0x0136 (0x00026C) 0x564D- f:00053 d: 77 | A = A - B | **** non-standard encoding with D:0x004D ****
0x0137 (0x00026E) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0138 (0x000270) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x0139 (0x000272) 0x5445- f:00052 d: 69 | A = A + B | **** non-standard encoding with D:0x0045 ****
0x013A (0x000274) 0x5246- f:00051 d: 70 | A = A & B | **** non-standard encoding with D:0x0046 ****
0x013B (0x000276) 0x4143- f:00040 d: 323 | C = 1, io 0503 = DN
0x013C (0x000278) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x013D (0x00027A) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x013E (0x00027C) 0x4954- f:00044 d: 340 | A = A > B | **** non-standard encoding with D:0x0154 ****
0x013F (0x00027E) 0x4941- f:00044 d: 321 | A = A > B | **** non-standard encoding with D:0x0141 ****
0x0140 (0x000280) 0x4C49- f:00046 d: 73 | A = A >> B | **** non-standard encoding with D:0x0049 ****
0x0141 (0x000282) 0x5A41- f:00055 d: 65 | B = A + B | **** non-standard encoding with D:0x0041 ****
0x0142 (0x000284) 0x5449- f:00052 d: 73 | A = A + B | **** non-standard encoding with D:0x0049 ****
0x0143 (0x000286) 0x4F4E- f:00047 d: 334 | A = A << B | **** non-standard encoding with D:0x014E ****
0x0144 (0x000288) 0x2046- f:00020 d: 70 | A = OR[70]
0x0145 (0x00028A) 0x4149- f:00040 d: 329 | C = 1, io 0511 = DN
0x0146 (0x00028C) 0x4C45- f:00046 d: 69 | A = A >> B | **** non-standard encoding with D:0x0045 ****
0x0147 (0x00028E) 0x443A- f:00042 d: 58 | C = 1, IOB = DN | **** non-standard encoding with D:0x003A ****
0x0148 (0x000290) 0x2046- f:00020 d: 70 | A = OR[70]
0x0149 (0x000292) 0x4549- f:00042 d: 329 | C = 1, IOB = DN | **** non-standard encoding with D:0x0149 ****
0x014A (0x000294) 0x2054- f:00020 d: 84 | A = OR[84]
0x014B (0x000296) 0x4142- f:00040 d: 322 | C = 1, io 0502 = DN
0x014C (0x000298) 0x4C45- f:00046 d: 69 | A = A >> B | **** non-standard encoding with D:0x0045 ****
0x014D (0x00029A) 0x2045- f:00020 d: 69 | A = OR[69]
0x014E (0x00029C) 0x5252- f:00051 d: 82 | A = A & B | **** non-standard encoding with D:0x0052 ****
0x014F (0x00029E) 0x4F52- f:00047 d: 338 | A = A << B | **** non-standard encoding with D:0x0152 ****
0x0150 (0x0002A0) 0x0000- f:00000 d: 0 | PASS
0x0151 (0x0002A2) 0x564D- f:00053 d: 77 | A = A - B | **** non-standard encoding with D:0x004D ****
0x0152 (0x0002A4) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0153 (0x0002A6) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x0154 (0x0002A8) 0x5445- f:00052 d: 69 | A = A + B | **** non-standard encoding with D:0x0045 ****
0x0155 (0x0002AA) 0x5246- f:00051 d: 70 | A = A & B | **** non-standard encoding with D:0x0046 ****
0x0156 (0x0002AC) 0x4143- f:00040 d: 323 | C = 1, io 0503 = DN
0x0157 (0x0002AE) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0158 (0x0002B0) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x0159 (0x0002B2) 0x4954- f:00044 d: 340 | A = A > B | **** non-standard encoding with D:0x0154 ****
0x015A (0x0002B4) 0x4941- f:00044 d: 321 | A = A > B | **** non-standard encoding with D:0x0141 ****
0x015B (0x0002B6) 0x4C49- f:00046 d: 73 | A = A >> B | **** non-standard encoding with D:0x0049 ****
0x015C (0x0002B8) 0x5A45- f:00055 d: 69 | B = A + B | **** non-standard encoding with D:0x0045 ****
0x015D (0x0002BA) 0x4400- f:00042 d: 0 | C = 1, IOB = DN
0x015E (0x0002BC) 0x564D- f:00053 d: 77 | A = A - B | **** non-standard encoding with D:0x004D ****
0x015F (0x0002BE) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0160 (0x0002C0) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x0161 (0x0002C2) 0x5445- f:00052 d: 69 | A = A + B | **** non-standard encoding with D:0x0045 ****
0x0162 (0x0002C4) 0x5246- f:00051 d: 70 | A = A & B | **** non-standard encoding with D:0x0046 ****
0x0163 (0x0002C6) 0x4143- f:00040 d: 323 | C = 1, io 0503 = DN
0x0164 (0x0002C8) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0165 (0x0002CA) 0x5245- f:00051 d: 69 | A = A & B | **** non-standard encoding with D:0x0045 ****
0x0166 (0x0002CC) 0x534F- f:00051 d: 335 | A = A & B | **** non-standard encoding with D:0x014F ****
0x0167 (0x0002CE) 0x5552- f:00052 d: 338 | A = A + B | **** non-standard encoding with D:0x0152 ****
0x0168 (0x0002D0) 0x4345- f:00041 d: 325 | C = 1, io 0505 = BZ
0x0169 (0x0002D2) 0x2045- f:00020 d: 69 | A = OR[69]
0x016A (0x0002D4) 0x5252- f:00051 d: 82 | A = A & B | **** non-standard encoding with D:0x0052 ****
0x016B (0x0002D6) 0x4F52- f:00047 d: 338 | A = A << B | **** non-standard encoding with D:0x0152 ****
0x016C (0x0002D8) 0x3A20- f:00035 d: 32 | (OR[32]) = A + (OR[32])
0x016D (0x0002DA) 0x4452- f:00042 d: 82 | C = 1, IOB = DN | **** non-standard encoding with D:0x0052 ****
0x016E (0x0002DC) 0x4956- f:00044 d: 342 | A = A > B | **** non-standard encoding with D:0x0156 ****
0x016F (0x0002DE) 0x4552- f:00042 d: 338 | C = 1, IOB = DN | **** non-standard encoding with D:0x0152 ****
0x0170 (0x0002E0) 0x2054- f:00020 d: 84 | A = OR[84]
0x0171 (0x0002E2) 0x4552- f:00042 d: 338 | C = 1, IOB = DN | **** non-standard encoding with D:0x0152 ****
0x0172 (0x0002E4) 0x4D49- f:00046 d: 329 | A = A >> B | **** non-standard encoding with D:0x0149 ****
0x0173 (0x0002E6) 0x4E41- f:00047 d: 65 | A = A << B | **** non-standard encoding with D:0x0041 ****
0x0174 (0x0002E8) 0x5445- f:00052 d: 69 | A = A + B | **** non-standard encoding with D:0x0045 ****
0x0175 (0x0002EA) 0x4400- f:00042 d: 0 | C = 1, IOB = DN
0x0176 (0x0002EC) 0x564D- f:00053 d: 77 | A = A - B | **** non-standard encoding with D:0x004D ****
0x0177 (0x0002EE) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0178 (0x0002F0) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x0179 (0x0002F2) 0x5445- f:00052 d: 69 | A = A + B | **** non-standard encoding with D:0x0045 ****
0x017A (0x0002F4) 0x5246- f:00051 d: 70 | A = A & B | **** non-standard encoding with D:0x0046 ****
0x017B (0x0002F6) 0x4143- f:00040 d: 323 | C = 1, io 0503 = DN
0x017C (0x0002F8) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x017D (0x0002FA) 0x5445- f:00052 d: 69 | A = A + B | **** non-standard encoding with D:0x0045 ****
0x017E (0x0002FC) 0x524D- f:00051 d: 77 | A = A & B | **** non-standard encoding with D:0x004D ****
0x017F (0x0002FE) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x0180 (0x000300) 0x4154- f:00040 d: 340 | C = 1, io 0524 = DN
0x0181 (0x000302) 0x4544- f:00042 d: 324 | C = 1, IOB = DN | **** non-standard encoding with D:0x0144 ****
0x0182 (0x000304) 0x0000- f:00000 d: 0 | PASS
0x0183 (0x000306) 0x564D- f:00053 d: 77 | A = A - B | **** non-standard encoding with D:0x004D ****
0x0184 (0x000308) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0185 (0x00030A) 0x5445- f:00052 d: 69 | A = A + B | **** non-standard encoding with D:0x0045 ****
0x0186 (0x00030C) 0x524D- f:00051 d: 77 | A = A & B | **** non-standard encoding with D:0x004D ****
0x0187 (0x00030E) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x0188 (0x000310) 0x4154- f:00040 d: 340 | C = 1, io 0524 = DN
0x0189 (0x000312) 0x494F- f:00044 d: 335 | A = A > B | **** non-standard encoding with D:0x014F ****
0x018A (0x000314) 0x4E20- f:00047 d: 32 | A = A << B | **** non-standard encoding with D:0x0020 ****
0x018B (0x000316) 0x4641- f:00043 d: 65 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0041 ****
0x018C (0x000318) 0x494C- f:00044 d: 332 | A = A > B | **** non-standard encoding with D:0x014C ****
0x018D (0x00031A) 0x4544- f:00042 d: 324 | C = 1, IOB = DN | **** non-standard encoding with D:0x0144 ****
0x018E (0x00031C) 0x3A20- f:00035 d: 32 | (OR[32]) = A + (OR[32])
0x018F (0x00031E) 0x4645- f:00043 d: 69 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0045 ****
0x0190 (0x000320) 0x4920- f:00044 d: 288 | A = A > B | **** non-standard encoding with D:0x0120 ****
0x0191 (0x000322) 0x5441- f:00052 d: 65 | A = A + B | **** non-standard encoding with D:0x0041 ****
0x0192 (0x000324) 0x424C- f:00041 d: 76 | C = 1, io 0114 = BZ
0x0193 (0x000326) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0194 (0x000328) 0x4552- f:00042 d: 338 | C = 1, IOB = DN | **** non-standard encoding with D:0x0152 ****
0x0195 (0x00032A) 0x524F- f:00051 d: 79 | A = A & B | **** non-standard encoding with D:0x004F ****
0x0196 (0x00032C) 0x5200- f:00051 d: 0 | A = A & B
0x0197 (0x00032E) 0x564D- f:00053 d: 77 | A = A - B | **** non-standard encoding with D:0x004D ****
0x0198 (0x000330) 0x4520- f:00042 d: 288 | C = 1, IOB = DN | **** non-standard encoding with D:0x0120 ****
0x0199 (0x000332) 0x5445- f:00052 d: 69 | A = A + B | **** non-standard encoding with D:0x0045 ****
0x019A (0x000334) 0x524D- f:00051 d: 77 | A = A & B | **** non-standard encoding with D:0x004D ****
0x019B (0x000336) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x019C (0x000338) 0x4154- f:00040 d: 340 | C = 1, io 0524 = DN
0x019D (0x00033A) 0x494F- f:00044 d: 335 | A = A > B | **** non-standard encoding with D:0x014F ****
0x019E (0x00033C) 0x4E20- f:00047 d: 32 | A = A << B | **** non-standard encoding with D:0x0020 ****
0x019F (0x00033E) 0x414C- f:00040 d: 332 | C = 1, io 0514 = DN
0x01A0 (0x000340) 0x5245- f:00051 d: 69 | A = A & B | **** non-standard encoding with D:0x0045 ****
0x01A1 (0x000342) 0x4144- f:00040 d: 324 | C = 1, io 0504 = DN
0x01A2 (0x000344) 0x5920- f:00054 d: 288 | B = A | **** non-standard encoding with D:0x0120 ****
0x01A3 (0x000346) 0x494E- f:00044 d: 334 | A = A > B | **** non-standard encoding with D:0x014E ****
0x01A4 (0x000348) 0x2050- f:00020 d: 80 | A = OR[80]
0x01A5 (0x00034A) 0x524F- f:00051 d: 79 | A = A & B | **** non-standard encoding with D:0x004F ****
0x01A6 (0x00034C) 0x4752- f:00043 d: 338 | C = 1, IOB = BZ | **** non-standard encoding with D:0x0152 ****
0x01A7 (0x00034E) 0x4553- f:00042 d: 339 | C = 1, IOB = DN | **** non-standard encoding with D:0x0153 ****
0x01A8 (0x000350) 0x5300- f:00051 d: 256 | A = A & B | **** non-standard encoding with D:0x0100 ****
0x01A9 (0x000352) 0x00E4- f:00000 d: 228 | PASS | **** non-standard encoding with D:0x00E4 ****
0x01AA (0x000354) 0x00F8- f:00000 d: 248 | PASS | **** non-standard encoding with D:0x00F8 ****
0x01AB (0x000356) 0x010E- f:00000 d: 270 | PASS | **** non-standard encoding with D:0x010E ****
0x01AC (0x000358) 0x0122- f:00000 d: 290 | PASS | **** non-standard encoding with D:0x0122 ****
0x01AD (0x00035A) 0x013C- f:00000 d: 316 | PASS | **** non-standard encoding with D:0x013C ****
0x01AE (0x00035C) 0x0157- f:00000 d: 343 | PASS | **** non-standard encoding with D:0x0157 ****
0x01AF (0x00035E) 0x0164- f:00000 d: 356 | PASS | **** non-standard encoding with D:0x0164 ****
0x01B0 (0x000360) 0x017C- f:00000 d: 380 | PASS | **** non-standard encoding with D:0x017C ****
0x01B1 (0x000362) 0x0189- f:00000 d: 393 | PASS | **** non-standard encoding with D:0x0189 ****
0x01B2 (0x000364) 0x019D- f:00000 d: 413 | PASS | **** non-standard encoding with D:0x019D ****
0x01B3 (0x000366) 0x202D- f:00020 d: 45 | A = OR[45]
0x01B4 (0x000368) 0x2043- f:00020 d: 67 | A = OR[67]
0x01B5 (0x00036A) 0x482E- f:00044 d: 46 | A = A > B | **** non-standard encoding with D:0x002E ****
0x01B6 (0x00036C) 0x2000- f:00020 d: 0 | A = OR[0]
0x01B7 (0x00036E) 0x0000- f:00000 d: 0 | PASS
0x01B8 (0x000370) 0x0000- f:00000 d: 0 | PASS
0x01B9 (0x000372) 0x0000- f:00000 d: 0 | PASS
0x01BA (0x000374) 0x0000- f:00000 d: 0 | PASS
0x01BB (0x000376) 0x0000- f:00000 d: 0 | PASS
| 98.549654
| 127
| 0.477901
|
70af52c7488362c2ceb7e0aff23bb2ec13a11f1f
| 405
|
asm
|
Assembly
|
programs/oeis/323/A323048.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/323/A323048.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/323/A323048.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A323048: Sums of no more than two 5-smooth numbers.
; 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100
mov $1,$0
add $1,1
div $1,36
mul $1,2
div $1,4
add $1,$0
| 40.5
| 292
| 0.646914
|
98b9be8d2ca0c89d9867b26a5957c3d5f902b2c3
| 655
|
asm
|
Assembly
|
oeis/074/A074562.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/074/A074562.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/074/A074562.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A074562: a(n) = 4^n + 5^n + 7^n.
; Submitted by Jamie Morken(s1.)
; 3,16,90,532,3282,20956,137370,918052,6220962,42568876,293289450,2030349172,14102205042,98176822396,684595023930,4779152829892,33389813427522,233410633309516,1632297014652810,11418243549608212,79888733240880402,559027099287998236,3912222826560048090,27380738637780172132,191641117500318515682,1341367768787748696556,9388974957366766441770,65719830958529713449652,460023861505318618045362,3220092308558478974252476,22540272766188378173225850,157780043259404902435008772,1104450975755030106977741442
mov $3,$0
seq $0,74511 ; a(n) = 1^n + 4^n + 5^n.
mov $2,7
pow $2,$3
add $0,$2
sub $0,1
| 59.545455
| 498
| 0.832061
|
a1afabd887a3c7151fd3e7ce409d9a1d431f3efb
| 1,158
|
asm
|
Assembly
|
programs/oeis/185/A185868.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/185/A185868.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/185/A185868.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A185868: (Odd,odd)-polka dot array in the natural number array A000027, by antidiagonals.
; 1,4,6,11,13,15,22,24,26,28,37,39,41,43,45,56,58,60,62,64,66,79,81,83,85,87,89,91,106,108,110,112,114,116,118,120,137,139,141,143,145,147,149,151,153,172,174,176,178,180,182,184,186,188,190,211,213,215,217,219,221,223,225,227,229,231,254,256,258,260,262,264,266,268,270,272,274,276,301,303,305,307,309,311,313,315,317,319,321,323,325,352,354,356,358,360,362,364,366,368,370,372,374,376,378,407,409,411,413,415,417,419,421,423,425,427,429,431,433,435,466,468,470,472,474,476,478,480,482,484,486,488,490,492,494,496,529,531,533,535,537,539,541,543,545,547,549,551,553,555,557,559,561,596,598,600,602,604,606,608,610,612,614,616,618,620,622,624,626,628,630,667,669,671,673,675,677,679,681,683,685,687,689,691,693,695,697,699,701,703,742,744,746,748,750,752,754,756,758,760,762,764,766,768,770,772,774,776,778,780,821,823,825,827,829,831,833,835,837,839,841,843,845,847,849,851,853,855,857,859,861,904,906,908,910,912,914,916,918,920,922,924,926,928,930,932,934,936,938,940
mul $0,2
mov $1,$0
add $1,1
mov $2,1
lpb $0
add $1,$2
add $2,2
sub $0,$2
trn $0,1
lpe
| 82.714286
| 970
| 0.722798
|
781355ffeda05b877577f7a351c1f5f3e1c09db4
| 61
|
asm
|
Assembly
|
gfx/pokemon/grimer/anim.asm
|
Dev727/ancientplatinum
|
8b212a1728cc32a95743e1538b9eaa0827d013a7
|
[
"blessing"
] | 28
|
2019-11-08T07:19:00.000Z
|
2021-12-20T10:17:54.000Z
|
gfx/pokemon/grimer/anim.asm
|
Dev727/ancientplatinum
|
8b212a1728cc32a95743e1538b9eaa0827d013a7
|
[
"blessing"
] | 13
|
2020-01-11T17:00:40.000Z
|
2021-09-14T01:27:38.000Z
|
gfx/pokemon/grimer/anim.asm
|
Dev727/ancientplatinum
|
8b212a1728cc32a95743e1538b9eaa0827d013a7
|
[
"blessing"
] | 22
|
2020-05-28T17:31:38.000Z
|
2022-03-07T20:49:35.000Z
|
frame 0, 04
frame 2, 12
frame 1, 08
frame 2, 28
endanim
| 10.166667
| 12
| 0.639344
|
6048407d019282f4bc9e54791896e19949e50601
| 1,260
|
asm
|
Assembly
|
source/MicroBenchX.Ipc/IpcTests/sub_avx512_int.asm
|
clayne/MicroBenchX
|
9b109102d6cb5932d8a3e8a1b102ba0d0c33a1be
|
[
"MIT"
] | 15
|
2021-10-11T01:52:42.000Z
|
2022-02-14T15:32:42.000Z
|
source/MicroBenchX.Ipc/IpcTests/sub_avx512_int.asm
|
clayne/MicroBenchX
|
9b109102d6cb5932d8a3e8a1b102ba0d0c33a1be
|
[
"MIT"
] | null | null | null |
source/MicroBenchX.Ipc/IpcTests/sub_avx512_int.asm
|
clayne/MicroBenchX
|
9b109102d6cb5932d8a3e8a1b102ba0d0c33a1be
|
[
"MIT"
] | 1
|
2021-09-12T09:31:40.000Z
|
2021-09-12T09:31:40.000Z
|
[BITS 64]
%include "parameters.inc"
extern exit
global sub_avx512_int
section .text
sub_avx512_int:
push rbp
mov rax, ITERATIONS_sub_avx512i
lea rbx, [rel avx_iv]
vmovdqa32 zmm0, [rbx]
vmovdqa32 zmm1, [rbx]
vmovdqa32 zmm2, [rbx]
vmovdqa32 zmm3, [rbx]
vmovdqa32 zmm4, [rbx]
vmovdqa32 zmm5, [rbx]
vmovdqa32 zmm6, [rbx]
vmovdqa32 zmm7, [rbx]
vmovdqa32 zmm8, [rbx]
vmovdqa32 zmm9, [rbx]
vmovdqa32 zmm10, [rbx]
vmovdqa32 zmm11, [rbx]
vmovdqa32 zmm12, [rbx]
vmovdqa32 zmm13, [rbx]
vmovdqa32 zmm14, [rbx]
vmovdqa32 zmm15, [rbx]
.loop:
vpsubd zmm0, zmm0, zmm0
vpsubd zmm1, zmm1, zmm1
vpsubd zmm2, zmm2, zmm2
vpsubd zmm3, zmm3, zmm3
vpsubd zmm4, zmm4, zmm4
vpsubd zmm5, zmm5, zmm5
vpsubd zmm6, zmm6, zmm6
vpsubd zmm7, zmm7, zmm7
vpsubd zmm8, zmm8, zmm8
vpsubd zmm9, zmm9, zmm9
vpsubd zmm10, zmm10, zmm10
vpsubd zmm11, zmm11, zmm11
vpsubd zmm12, zmm12, zmm12
vpsubd zmm13, zmm13, zmm13
vpsubd zmm14, zmm14, zmm14
vpsubd zmm15, zmm15, zmm15
dec rax
jnz .loop
.exit:
lea rdi, [rel format]
pop rbp
xor rax, rax
mov rax, ITERATIONS_sub_avx512i
mov rsi, 18 ; 16 vpsubd + 1 dec + 1 loop
mul rsi
ret
section .data
format: db "%lu", 10, 0
align 64
avx_iv: dd 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
| 20
| 64
| 0.693651
|
1ef75f488efaae514b4e40fed21086476eca4661
| 1,924
|
asm
|
Assembly
|
fg_ram_tests.asm
|
jwestfall69/ddragon-diag
|
847c8cb4a447196eec895e7d608e412602c6fbc2
|
[
"Unlicense"
] | null | null | null |
fg_ram_tests.asm
|
jwestfall69/ddragon-diag
|
847c8cb4a447196eec895e7d608e412602c6fbc2
|
[
"Unlicense"
] | null | null | null |
fg_ram_tests.asm
|
jwestfall69/ddragon-diag
|
847c8cb4a447196eec895e7d608e412602c6fbc2
|
[
"Unlicense"
] | null | null | null |
include "ddragon.inc"
include "ddragon_diag.inc"
include "error_codes.inc"
include "macros.inc"
global auto_fg_ram_tests
global manual_fg_ram_tests
global STR_FG_RAM_TESTS
section text
; foreground video ram test, which is on the
; same ram chip as work ram. If the chip has
; issues will likely trigger the work ram tests
auto_fg_ram_tests:
ldd #FG_RAM_START
std g_mt_mem_start_address
ldd #FG_RAM_SIZE
std g_mt_mem_size
lda #FG_RAM_ADDRESS_LINES
sta g_mt_mem_address_lines
lda #$ff
sta g_mt_data_mask
jsr mem_tester
tsta
beq .mem_tester_passed
adda #(EC_FG_RAM_DEAD_OUTPUT - 1)
.mem_tester_passed:
rts
manual_fg_ram_tests:
; not doing print_static_text here
; cause it will just get nuked when we
; start testing fg ram
ldw #0 ; # of passes
pshsw
.loop_next_test:
ldd #FG_RAM_START
std g_mt_mem_start_address
ldd #FG_RAM_SIZE
std g_mt_mem_size
lda #FG_RAM_ADDRESS_LINES
sta g_mt_mem_address_lines
lda #$ff
sta g_mt_data_mask
jsr mem_tester
tsta
bne .test_failed
pulsw
incw
pshsw
jsr input_update
lda g_p1_input_edge
bita #A_BUTTON
beq .a_not_pressed
jsr fg_clear_with_header
jsr print_static_text
pulsw
tfr w,d
pshsw
FG_XY 12,12
JRU fg_print_hex_word
jsr wait_a_release
.a_not_pressed:
lda g_extra_input_edge
bita #P1_C_BUTTON
beq .loop_next_test
; fix up stack
pulsw
; main menu code will handle cleanup
rts
.test_failed:
adda #(EC_FG_RAM_DEAD_OUTPUT - 1)
jsr print_error
jsr print_static_text
pulsw
tfr w,d
FG_XY 12,12
JRU fg_print_hex_word
jsr wait_c_press
rts
print_static_text:
FG_XY 10,4
ldy #STR_FG_RAM_TESTS
JRU fg_print_string
FG_XY 2,12
ldy #STR_PASSES
JRU fg_print_string
FG_XY 5,25
ldy #STR_A_HOLD_PAUSE
JRU fg_print_string
FG_XY 5,26
ldy #STR_C_MAIN_MENU
JRU fg_print_string
rts
STR_FG_RAM_TESTS: string "FG RAM TESTS"
| 15.770492
| 47
| 0.74948
|
1a023c2b67ad8c4790aae27d5413975ac0726180
| 3,624
|
asm
|
Assembly
|
src/public/src/FM7/util/T77ToRS232C/bioshook_small.asm
|
rothberg-cmu/rothberg-run
|
a42df5ca9fae97de77753864f60d05295d77b59f
|
[
"MIT"
] | 1
|
2019-08-10T00:24:09.000Z
|
2019-08-10T00:24:09.000Z
|
src/public/src/FM7/util/T77ToRS232C/bioshook_small.asm
|
rothberg-cmu/rothberg-run
|
a42df5ca9fae97de77753864f60d05295d77b59f
|
[
"MIT"
] | null | null | null |
src/public/src/FM7/util/T77ToRS232C/bioshook_small.asm
|
rothberg-cmu/rothberg-run
|
a42df5ca9fae97de77753864f60d05295d77b59f
|
[
"MIT"
] | 2
|
2019-05-01T03:11:10.000Z
|
2019-05-01T03:30:35.000Z
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DEF_BRIDGE_OFFSET EQU $0
BIOS_HOOK ; Typical way of handling I/O can bd
; LDA #$FD
; TFR A,DP
; and then use direct-page access.
; But, it takes 4 bytes.
; If I use U register, I can set #$FD00 to U in 3 bytes.
; Bridge code assumes U=#$FD00 on return.
LDU #$FD00
LDA #$B7
; #$B7 will be written to RS232C command
; in BIOS_CTBWRT and BIOS_CTBRED
; In "Dig Dug" (COMPAC) loader, subsequent LOADM commands call
; MOTOR OFF and then start reading without calling MOTOR ON.
; Need to guarantee to enable RS232C Rx/Tx by writing #$B7 to 7,U.
LDB ,X
DECB
BEQ BIOS_MOTOR
DECB
BEQ BIOS_CTBWRT
DECB
BEQ BIOS_CTBRED
COMA ; ORCC #1 <- COM always raise Carry.
RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; If [2,X] is $FF, turn on motor, turn off otherwise.
; When motor is turned off, reset RS232C so that it won't fire IRQ any more.
BIOS_MOTOR LDA 2,X
INCA
BNE BIOS_MOTOR_OFF
BIOS_MOTOR_ON LEAX RS232C_RESET_CMD,PCR
; According to http://vorkosigan.cocolog-nifty.com/blog/2009/12/a-b085.html
; Need to wait 8 clocks between writes.
MOTOR_RS232C_RESET_LOOP
CLRA ; 2 clocks
LDA ,X+ ; 5 clocks
STA 7,U ; IO_RS232C_COMMAND
BPL MOTOR_RS232C_RESET_LOOP ; Only last command is negative ; 3 clocks
; CLRA clears carry flag.
; LDA, STA, and BPL does not change.
; Can take 10 clocks after each STA 7,U
RTS
; 8251A Data Sheet pp.12 'NOTE' paragraph
; Regarding Internal Reset on Power-up.
RS232C_RESET_CMD FCB 0,0,0,$40,$4E,$B7
; Need to make sure RS232C does nothing after MOTOR OFF.
; "Emergency" (COMPAC) cannot take key inputs unless
; RS232C is set to do nothing.
BIOS_MOTOR_OFF
; Commonly known I/O map tells bit1 of $FD00 means
; 1: Motor off
; 0: Motor on
; which is flipped from actual. Actual FM-7 write 1 to bit1 of $FD00 to MOTOR-ON.
; Also, F-BASIC "SAVE" command write $42 outside of BIOS. Overriding the BIOS
; does not stop F-BASIC from MOTOR-ON. Therefore, after loading, it must be set
; to OFF.
; To motor off, $40 needs to be written to $FD00. Bit6 carries a printer strobe
; I need that 1 bit to prevent printer confusion.
; I don't want to do it, but it wastes another 4 bytes.
LDA #$40
STA ,U
CLR 2,U ; Re-clear IRQ
CLR 7,U ; IO_RS232C_COMMAND
RTS ; Previous CLR 7,U also clears carry
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 8251A Data Sheet pp.16 "NOTES" #4
; Recovery time between writes for asynchronous mode is 8 tCY
; Probably it is recovery time between sends.
; May not need wait after setting the status bits.
BIOS_CTBWRT STA 7,U ; IO_RS232C_COMMAND
; A=#$B7=WRITE_REQUEST
BSR RS232C_WRITE ; 7 clocks
LDA 2,X
RS232C_WRITE LDB 7,U ; IO_RS232C_COMMAND
LSRB
BCC RS232C_WRITE
STA 6,U ; IO_RS232C_DATA
CLRA
RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
BIOS_CTBRED STA 7,U ; IO_RS232C_COMMAND
DECA ; A=#$B7 -> #$B6
; A=#$B6=READ_REQUEST
BSR RS232C_WRITE ; 7 clocks
RS232C_READ LDA #2
ANDA 7,U ; IO_RS232C_COMMAND
BEQ RS232C_READ
LDA 6,U ; IO_RS232C_DATA
BIOS_CTBRED_EXIT STA 2,X
CLRA
RTS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
BIOS_HOOK_END
END_OF_PROGRAM
| 28.535433
| 88
| 0.579746
|
a5efde0c5c8fa00c58ffc03b3dc1b3d156c36ba7
| 11,406
|
asm
|
Assembly
|
src/arch/x86_64/boot.asm
|
mopp/Axel
|
2f14ca29a02276a059c2a5a4cb79f28ac10d5fae
|
[
"MIT"
] | 96
|
2015-06-06T07:30:01.000Z
|
2022-01-06T21:58:10.000Z
|
src/arch/x86_64/boot.asm
|
mopp/Axel
|
2f14ca29a02276a059c2a5a4cb79f28ac10d5fae
|
[
"MIT"
] | null | null | null |
src/arch/x86_64/boot.asm
|
mopp/Axel
|
2f14ca29a02276a059c2a5a4cb79f28ac10d5fae
|
[
"MIT"
] | 8
|
2015-11-22T18:03:25.000Z
|
2021-06-25T16:49:43.000Z
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; vim:ft=nasm:foldmethod=marker
; @brief
; Program to boot the kernel.
; This program have to be called from a bootloader complying multiboot2 spec.
; Reference:
; [Memory Map (x86)](http://wiki.osdev.org/Memory_Map_(x86))
; [Setting Up Long Mode](http://wiki.osdev.org/Setting_Up_Long_Mode)
; [Intel(R) 64 and IA-32 Architectures Software Developer's Manual]()
; [Canonical form addresses](https://en.wikipedia.org/wiki/X86-64#Virtual_address_space_details)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
bits 32
; This section is for the Multiboot header.
; It must be located in the first 32768 bytes of the OS binary.
section .multiboot2
; {{{
; The multiboot magic numbers.
MULTIBOOT2_MAGIC equ 0xE85250D6
MULTIBOOT2_EAX_MAGIC equ 0x36D76289
; @brief
; Multiboot header region.
align 8
multiboot2_begin: ; {{{
dd MULTIBOOT2_MAGIC ; Magic number
dd 0 ; Architecture (i386 32-bit protected mode)
dd multiboot2_end - multiboot2_begin ; Header length
; Checksum, it subtracts from 0x100000000 to avoid compiler warning.
dd 0x100000000 - (MULTIBOOT2_MAGIC + 0 + (multiboot2_end - multiboot2_begin))
; The tag for terminating.
dw 0 ; type
dw 0 ; flags
dd 8 ; size
multiboot2_end:
; }}}
; }}}
; This section is for configure the CPU.
; Before turning on the paging, we cannot use some instructions such as jmp and call, which want to use 64 bit addresses.
; Because we are in 32-bit protected mode still here.
; However, the symbols are linked at the higher kernel space (over 32-bit).
; Then, in order to use the instructions, this section is mapped to the load memory addresses only using linker script.
section .text_boot_32bit
; {{{
; This constant refers the virtual kernel address offset.
; When I tried to read this values using the linker script, an error `relocation truncated to fit: R_X86_64_32 against ~~~` was ommited.
; Therefore, I had to write the value directly here :(
KERNEL_ADDR_VIRTUAL_OFFSET equ 0xFFFF800000000000
; @brief
; Axel starting function.
global start_axel
start_axel:
; {{{
; Clear interrupt.
cli
; Set temporal stack.
; 0x500 - 0x1000 is free to use.
mov esp, 0x1000
; Store the pointer to the multiboot information struct.
push ebx
; Check eax has the correct multiboot2 magic number.
test eax, MULTIBOOT2_EAX_MAGIC
jz boot_failure
call is_cpuid_available
call is_sse_available
call enable_sse
call is_long_mode_available
call enter_compatibility_mode
; Load the pointer to the multiboot information struct.
pop ebx
call enter_64bit_mode
jmp prelude_to_canonical_higher_harf
; }}}
; @brief
; If axel could not be execute, this function will be called.
boot_failure:
; {{{
hlt
jmp boot_failure
; }}}
; @brief
; Check the CPUID instruction available or not.
; The ID flag (bit 21) in the EFLAGS register indicates support for the CPUID instruction.
; If this flag can be modified, it refers this CPU has the CPUID.
; For more information, please refer "19.1 USING THE CPUID INSTRUCTION" in the Intel manual.
is_cpuid_available:
; {{{
; Store the original values in the EFLAGS.
pushfd
; Set the invert value of the ID flag (bit 21).
pushfd
xor dword [esp], (1 << 21)
popfd
pushfd
pop eax
; Compare the original EFLAGS and the current EFLAGS.
xor eax, [esp]
jz boot_failure
; Load the original EFLAGS.
popfd
ret
; }}}
; @brief
; Check long mode (IA-32e mode) available or not.
; Long mode is the name in the AMD64 and IA-32e mode is the name in the Intel 64.
is_long_mode_available:
; {{{
; Try to obtain Extended Function CPUID Information.
mov eax, 0x80000000
cpuid
; Now, eax has Maximum Input Value for Extended Function CPUID Information.
; If the maximum value is 0x80000000, it means this CPU don't have more extended functions.
xor eax, 0x80000000
jz boot_failure
; Check CPU extended functions.
; Bit 29 is 1 if Intel 64 Architecture is available.
mov eax, 0x80000001
cpuid
test edx, (1 << 29)
jz boot_failure
ret
; }}}
; @brief
; Check SSE extension is supported or not
is_sse_available:
; {{{
; Try to obtain Feature Information.
mov eax, 0x1
cpuid
; Check SSE extension.
test edx, (1 << 25)
jz boot_failure
ret
; }}}
; @brief
; Enable SSE extension.
; For more Information, Please refer 9.6 INITIALIZING SSE/SSE2/SSE3/SSSE3 EXTENSIONS.
enable_sse:
; {{{
; Clear EM bit and set MP bit in CR0
mov eax, cr0
and ax, 0xFFFB
or ax, 0x2
mov cr0, eax
; Set OSFXSR and OSXMMEXCPT bit in CR4.
mov eax, cr4
or ax, (3 << 9)
mov cr4, eax
ret
; }}}
; @brief
; Enter compatibility mode (submode of IA-32e mode).
; 1. Disable paging. (This is already done by the bootloader which complies with the multiboot2 specification.)
; 2. Enable physical-address extensions (PAE) by setting PAE bit in CR4.
; 3. Load CR3 with the physical base address of the Level 4 page map table (PML4).
; 4. Enable long mode (IA-32e mode) by setting IA32_EFER.LME = 1.
; 5. Enable paging.
; For more information, please refer 9.8.5 Initializing IA-32e Mode in the intel manual.
enter_compatibility_mode:
; {{{
; Enable PAE.
mov eax, cr4
or eax, 1 << 5
mov cr4, eax
; Set the page struct address to CR3.
; 64-bit mode paging tables must be located in the first 4 GBytes of physical-address space prior to activating IA-32e mode.
; The memory region 0x00500 ~ 0x7FFFF can be used.
mov edi, 0x1000
mov cr3, edi
; Clean up the memories for the paging.
xor eax, eax
mov ecx, (0x4000 - 0x1000) / 4
rep stosd
; Configure temporal page settings.
; Level4 Table/Entry - Page Map Level 4 Table/Entry
; Level3 Table/Entry - Page Directory Pointer Table/Entry
; Level2 Table/Entry - Page Directory Table/Entry
; Level1 Table/Entry - Page Table/Entry
; Each mapping region is 1GB for the kernel load address and the kernel virtual address.
; For more information, Please refer 4.5 IA-32E PAGING in the intel manual.
; Entries for the kernel load address.
mov dword [0x1000 + 8 * 0], 0x00002003 ; Set the level4 entry.
mov dword [0x2000 + 8 * 0], 0x00000083 ; Set the level3 entry
; Entries for the kernel virtual address.
mov dword [0x1000 + 8 * 256], 0x00003003 ; Set the level4 entry.
mov dword [0x3000 + 8 * 0], 0x00000083 ; Set the level3 entry.
; Entry for the recursive page mapping.
mov dword [0x1000 + 8 * 511], 0x00001003 ; Set the level4 entry.
; Set the long mode bit in the EFER MSR.
mov ecx, 0xC0000080
rdmsr
or eax, 1 << 8
wrmsr
; Enable paging.
mov eax, cr0
or eax, 1 << 31
mov cr0, eax
ret
; }}}
; @brief Enter 64-bit mode (submode of IA-32e mode).
; Set GDT for 64-bit.
; Code segment-descriptor should be set correctly.
; For more information, please refer 9.8.5.3 64-bit Mode and Compatibility Mode Operation in the intel manual.
enter_64bit_mode:
; {{{
; Load 64-bit Global Descriptor Table Register (GDTR)
mov eax, gdtr64 - KERNEL_ADDR_VIRTUAL_OFFSET
lgdt [eax]
; Change the code segment register.
jmp gdt64.descriptor_kernel_code:.change_segment_register
.change_segment_register:
; Set the segment registers.
mov ax, gdt64.descriptor_kernel_data
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
; 64-bit mode is already available here,
; So, the ret instruction try to load 8bytes (not 4bytes) from the stack to return.
; However, this function was called from 32-bit world.
; We have to load correctly 4bytes.
mov eax, dword [esp]
add esp, 4
jmp eax
; }}}
; }}}
bits 64
; This section is for 64-bit instruction, and it is located at the kernel load address.
; The purpose of this section is to jump canonical higher harf space because the address is 64-bit.
section .text_boot_64bit
; {{{
; @brief
; Jump via register.
; Because direct jump cause an error 'relocation truncated to fit: R_X86_64_PC32 against `.text_canonical_higher_harf''
prelude_to_canonical_higher_harf:
; {{{
mov rax, canonical_higher_harf
; Let's go to the canonical higher harf space :)
jmp rax
; }}}
; }}}
; This section is mapped to the kernel virtual address.
section .text_canonical_higher_harf
; {{{
; 0x00007E00 - 0x0007FFFF is free region.
; See x86 memory map.
FRAME_SIZE_BYTES equ 4096
KERNEL_STACK_FRAME_COUNT equ 4
KERNEL_STACK_ADDR_TOP equ 0x00070000
KERNEL_STACK_ADDR_BOTTOM equ KERNEL_STACK_ADDR_TOP + (FRAME_SIZE_BYTES * KERNEL_STACK_FRAME_COUNT) - 1
TASK_STATE_SEGMENT_ADDR equ KERNEL_STACK_ADDR_TOP - FRAME_SIZE_BYTES
%if 0x0007FFFF < KERNEL_STACK_ADDR_BOTTOM
%error "Kernel stack is out of range"
%endif
; @brief
; Configure some information should be passed to the main function.
; Then, call the main function.
canonical_higher_harf:
; {{{
; Invalidate the entry for the kernel load address.
; It is never used in the long mode.
mov dword [0x1000], 0
invlpg [0]
; Reload GDTR
; The prevous GDTR is not 64 bit address.
mov rax, gdtr64
lgdt [rax]
; Load task register.
mov ax, gdt64.descriptor_tss
ltr ax
mov rax, KERNEL_ADDR_VIRTUAL_OFFSET
; Set the kernel stask.
; The harf will be used as a guard page.
mov rcx, KERNEL_STACK_ADDR_BOTTOM
add rcx, rax
mov rsp, rcx
; FIXME:
; Set the number of frames and address.
push KERNEL_STACK_FRAME_COUNT + 1
mov rcx, TASK_STATE_SEGMENT_ADDR
push rcx
; rbx is pointer to multiboot info struct.
add rbx, rax
push rbx
; Set the arguments of the main function.
mov rdi, 3
mov rsi, rsp
extern main
call main
.loop:
hlt
jmp .loop
; }}}
; }}}
section .rodata
; {{{
; Global descriptor table in 64-bit mode.
; Note that the CPU does not perform segment limit checks at runtime in 64-bit mode.
; `$ - gdt64` makes each label refers to segment selector value.
align 8
gdt64:
; {{{
.descriptor_null: equ $ - gdt64
dd 0x00000000
dd 0x00000000
.descriptor_kernel_code: equ $ - gdt64
; Set 64-bit flag, present flag.
; Execute and read.
; DPL is 0.
dd 0x00000000
dd 0x00A09B00
.descriptor_kernel_data: equ $ - gdt64
; Set 64-bit flag, present flag.
; Read and write.
; DPL is 0.
dd 0x00000000
dd 0x00C09300
.descriptor_user_code: equ $ - gdt64
; DPL is 3.
dd 0x00000000
dd 0x00A0FB00
.descriptor_user_data: equ $ - gdt64
; DPL is 3.
dd 0x00000000
dd 0x00C0F300
.descriptor_tss: equ $ - gdt64
dw 0x0064
dw TASK_STATE_SEGMENT_ADDR & 0xFFFF
db (TASK_STATE_SEGMENT_ADDR >> 16) & 0xFF
db 10001001b
dw (TASK_STATE_SEGMENT_ADDR >> 24) & 0xFFFF
dd KERNEL_ADDR_VIRTUAL_OFFSET >> 32
dd 0x00000000
; }}}
; Global descriptor table register in 64-bit mode.
; For more information, please refer 3.5.1 Segment Descriptor Tables in the intel manual.
gdtr64:
; {{{
dw $ - gdt64 - 1
dq gdt64
; }}}
; }}}
| 26.711944
| 136
| 0.673067
|
abd249122bac725e35d8047ef4ac5876d2dd81ed
| 835
|
asm
|
Assembly
|
oeis/142/A142754.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/142/A142754.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/142/A142754.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A142754: Primes congruent to 27 mod 59.
; Submitted by Jon Maiga
; 263,499,617,853,971,2269,2741,3331,3449,3803,4157,5101,5573,5927,6163,6871,7933,8287,8641,9349,9467,10529,10883,11119,11827,12653,12889,13007,13597,14423,15013,15131,16193,16547,16901,17137,17491,17609,18199,18553,18671,19379,20323,20441,21031,21149,21503,21739,22093,22447,23509,23627,23981,24571,25633,26459,26813,28111,28229,29173,29527,29881,30707,31769,32359,32713,32831,33893,34129,34483,35899,36017,36607,38377,39439,40973,41681,42743,42979,43451,44041,44159,44867,47581,47699,48407,48761
mov $1,13
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $2,1
mov $3,$1
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,59
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
sub $0,60
mul $0,2
add $0,3
| 33.4
| 497
| 0.729341
|
5622a249f1341f0bb42d915f42c689804a3d0615
| 288
|
asm
|
Assembly
|
masm/AddTwoInts.asm
|
pysogge/assembly_hello_world
|
4ef5114b03d9640b285e176231254e6c5bc85efb
|
[
"MIT"
] | 1
|
2022-02-21T15:04:53.000Z
|
2022-02-21T15:04:53.000Z
|
masm/AddTwoInts.asm
|
pysogge/assembly_hello_world
|
4ef5114b03d9640b285e176231254e6c5bc85efb
|
[
"MIT"
] | null | null | null |
masm/AddTwoInts.asm
|
pysogge/assembly_hello_world
|
4ef5114b03d9640b285e176231254e6c5bc85efb
|
[
"MIT"
] | null | null | null |
; AddTwoInts.asm - adds two 32-bit integers
; Inputs: r0 = operand 1
; r1 = operand 2
; Outputs: r0 = sum
.386
.model flat, stdcall
.stack 4096
ExitProcess PROTO, dwExitCode:DWORD
.code
main PROC
mov eax, 5
add eax, 6
INVOKE ExitProcess,0
main ENDP
END main
| 16
| 43
| 0.65625
|
140d051494c726e760c00d3e56bd7cfd030775af
| 789
|
asm
|
Assembly
|
src/kernel/kernel.asm
|
DalvikArt/OperatingSystem
|
a02590e7679f838b11f77eb488a86073a9c8771e
|
[
"Apache-2.0"
] | 5
|
2018-08-30T09:06:33.000Z
|
2020-03-16T08:39:28.000Z
|
src/kernel/kernel.asm
|
DalvikArt/OperatingSystem
|
a02590e7679f838b11f77eb488a86073a9c8771e
|
[
"Apache-2.0"
] | null | null | null |
src/kernel/kernel.asm
|
DalvikArt/OperatingSystem
|
a02590e7679f838b11f77eb488a86073a9c8771e
|
[
"Apache-2.0"
] | 2
|
2020-03-01T04:20:58.000Z
|
2020-03-11T14:26:37.000Z
|
jmp Label_Start
%include "fat12.inc"
; entry point
Label_Start:
; init registers
mov ax, cs
mov ds, ax
mov es, ax
mov ss, ax
mov sp, BaseOfStack
; clear screen
; AH = 06h roll pages
; AL = page num (0 to clear screen)
; BH = color attributes
; CL = left row, CH = left column
; DL = right row, DL = right column
mov ax, 0600h
mov bx, 0700h
mov cx, 0
mov dx, 184Fh
int 10h
; set focus
; AH = 02h set focus
; DL = row
; DH = column
; BH = page num
mov ax, 0200h
mov bx, 0000h
mov dx, 0000h
int 10h
; display boot string
push 0000h
push KernelInitMessageLength
push KernelInitMessage
call Func_PrintString
%include "functions.inc"
KernelInitMessageLength equ 22
KernelInitMessage db 'Initializing kernel...'
| 17.533333
| 51
| 0.652725
|
eddf0f9a9d13e3b737a88c0652c456931c09b39e
| 757
|
asm
|
Assembly
|
programs/oeis/257/A257198.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/257/A257198.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/257/A257198.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A257198: Number of permutations of length n having exactly one descent such that the first element of the permutation is an odd number.
; 0,0,2,6,16,36,78,162,332,672,1354,2718,5448,10908,21830,43674,87364,174744,349506,699030,1398080,2796180,5592382,11184786,22369596,44739216,89478458,178956942,357913912,715827852,1431655734,2863311498,5726623028,11453246088,22906492210,45812984454,91625968944,183251937924,366503875886,733007751810,1466015503660,2932031007360,5864062014762,11728124029566,23456248059176,46912496118396,93824992236838,187649984473722,375299968947492,750599937895032,1501199875790114,3002399751580278,6004799503160608
lpb $0,1
sub $0,1
add $3,1
add $4,5
mov $2,$4
sub $2,5
add $1,$2
mov $4,$3
add $3,$2
mul $4,2
lpe
| 50.466667
| 501
| 0.807133
|
32e49db2b9cbc65f5c66d53fd05f88c3c25a8c82
| 58,813
|
asm
|
Assembly
|
crypto/aes/aes-x86_64.asm
|
gajgeospatial/openssl-3.0.2
|
bdafd16dda359a51744280f79ee717034d37e892
|
[
"Apache-2.0"
] | null | null | null |
crypto/aes/aes-x86_64.asm
|
gajgeospatial/openssl-3.0.2
|
bdafd16dda359a51744280f79ee717034d37e892
|
[
"Apache-2.0"
] | null | null | null |
crypto/aes/aes-x86_64.asm
|
gajgeospatial/openssl-3.0.2
|
bdafd16dda359a51744280f79ee717034d37e892
|
[
"Apache-2.0"
] | null | null | null |
default rel
%define XMMWORD
%define YMMWORD
%define ZMMWORD
section .text code align=64
ALIGN 16
_x86_64_AES_encrypt:
xor eax,DWORD[r15]
xor ebx,DWORD[4+r15]
xor ecx,DWORD[8+r15]
xor edx,DWORD[12+r15]
mov r13d,DWORD[240+r15]
sub r13d,1
jmp NEAR $L$enc_loop
ALIGN 16
$L$enc_loop:
movzx esi,al
movzx edi,bl
movzx ebp,cl
mov r10d,DWORD[rsi*8+r14]
mov r11d,DWORD[rdi*8+r14]
mov r12d,DWORD[rbp*8+r14]
movzx esi,bh
movzx edi,ch
movzx ebp,dl
xor r10d,DWORD[3+rsi*8+r14]
xor r11d,DWORD[3+rdi*8+r14]
mov r8d,DWORD[rbp*8+r14]
movzx esi,dh
shr ecx,16
movzx ebp,ah
xor r12d,DWORD[3+rsi*8+r14]
shr edx,16
xor r8d,DWORD[3+rbp*8+r14]
shr ebx,16
lea r15,[16+r15]
shr eax,16
movzx esi,cl
movzx edi,dl
movzx ebp,al
xor r10d,DWORD[2+rsi*8+r14]
xor r11d,DWORD[2+rdi*8+r14]
xor r12d,DWORD[2+rbp*8+r14]
movzx esi,dh
movzx edi,ah
movzx ebp,bl
xor r10d,DWORD[1+rsi*8+r14]
xor r11d,DWORD[1+rdi*8+r14]
xor r8d,DWORD[2+rbp*8+r14]
mov edx,DWORD[12+r15]
movzx edi,bh
movzx ebp,ch
mov eax,DWORD[r15]
xor r12d,DWORD[1+rdi*8+r14]
xor r8d,DWORD[1+rbp*8+r14]
mov ebx,DWORD[4+r15]
mov ecx,DWORD[8+r15]
xor eax,r10d
xor ebx,r11d
xor ecx,r12d
xor edx,r8d
sub r13d,1
jnz NEAR $L$enc_loop
movzx esi,al
movzx edi,bl
movzx ebp,cl
movzx r10d,BYTE[2+rsi*8+r14]
movzx r11d,BYTE[2+rdi*8+r14]
movzx r12d,BYTE[2+rbp*8+r14]
movzx esi,dl
movzx edi,bh
movzx ebp,ch
movzx r8d,BYTE[2+rsi*8+r14]
mov edi,DWORD[rdi*8+r14]
mov ebp,DWORD[rbp*8+r14]
and edi,0x0000ff00
and ebp,0x0000ff00
xor r10d,edi
xor r11d,ebp
shr ecx,16
movzx esi,dh
movzx edi,ah
shr edx,16
mov esi,DWORD[rsi*8+r14]
mov edi,DWORD[rdi*8+r14]
and esi,0x0000ff00
and edi,0x0000ff00
shr ebx,16
xor r12d,esi
xor r8d,edi
shr eax,16
movzx esi,cl
movzx edi,dl
movzx ebp,al
mov esi,DWORD[rsi*8+r14]
mov edi,DWORD[rdi*8+r14]
mov ebp,DWORD[rbp*8+r14]
and esi,0x00ff0000
and edi,0x00ff0000
and ebp,0x00ff0000
xor r10d,esi
xor r11d,edi
xor r12d,ebp
movzx esi,bl
movzx edi,dh
movzx ebp,ah
mov esi,DWORD[rsi*8+r14]
mov edi,DWORD[2+rdi*8+r14]
mov ebp,DWORD[2+rbp*8+r14]
and esi,0x00ff0000
and edi,0xff000000
and ebp,0xff000000
xor r8d,esi
xor r10d,edi
xor r11d,ebp
movzx esi,bh
movzx edi,ch
mov edx,DWORD[((16+12))+r15]
mov esi,DWORD[2+rsi*8+r14]
mov edi,DWORD[2+rdi*8+r14]
mov eax,DWORD[((16+0))+r15]
and esi,0xff000000
and edi,0xff000000
xor r12d,esi
xor r8d,edi
mov ebx,DWORD[((16+4))+r15]
mov ecx,DWORD[((16+8))+r15]
xor eax,r10d
xor ebx,r11d
xor ecx,r12d
xor edx,r8d
DB 0xf3,0xc3
ALIGN 16
_x86_64_AES_encrypt_compact:
lea r8,[128+r14]
mov edi,DWORD[((0-128))+r8]
mov ebp,DWORD[((32-128))+r8]
mov r10d,DWORD[((64-128))+r8]
mov r11d,DWORD[((96-128))+r8]
mov edi,DWORD[((128-128))+r8]
mov ebp,DWORD[((160-128))+r8]
mov r10d,DWORD[((192-128))+r8]
mov r11d,DWORD[((224-128))+r8]
jmp NEAR $L$enc_loop_compact
ALIGN 16
$L$enc_loop_compact:
xor eax,DWORD[r15]
xor ebx,DWORD[4+r15]
xor ecx,DWORD[8+r15]
xor edx,DWORD[12+r15]
lea r15,[16+r15]
movzx r10d,al
movzx r11d,bl
movzx r12d,cl
movzx r8d,dl
movzx esi,bh
movzx edi,ch
shr ecx,16
movzx ebp,dh
movzx r10d,BYTE[r10*1+r14]
movzx r11d,BYTE[r11*1+r14]
movzx r12d,BYTE[r12*1+r14]
movzx r8d,BYTE[r8*1+r14]
movzx r9d,BYTE[rsi*1+r14]
movzx esi,ah
movzx r13d,BYTE[rdi*1+r14]
movzx edi,cl
movzx ebp,BYTE[rbp*1+r14]
movzx esi,BYTE[rsi*1+r14]
shl r9d,8
shr edx,16
shl r13d,8
xor r10d,r9d
shr eax,16
movzx r9d,dl
shr ebx,16
xor r11d,r13d
shl ebp,8
movzx r13d,al
movzx edi,BYTE[rdi*1+r14]
xor r12d,ebp
shl esi,8
movzx ebp,bl
shl edi,16
xor r8d,esi
movzx r9d,BYTE[r9*1+r14]
movzx esi,dh
movzx r13d,BYTE[r13*1+r14]
xor r10d,edi
shr ecx,8
movzx edi,ah
shl r9d,16
shr ebx,8
shl r13d,16
xor r11d,r9d
movzx ebp,BYTE[rbp*1+r14]
movzx esi,BYTE[rsi*1+r14]
movzx edi,BYTE[rdi*1+r14]
movzx edx,BYTE[rcx*1+r14]
movzx ecx,BYTE[rbx*1+r14]
shl ebp,16
xor r12d,r13d
shl esi,24
xor r8d,ebp
shl edi,24
xor r10d,esi
shl edx,24
xor r11d,edi
shl ecx,24
mov eax,r10d
mov ebx,r11d
xor ecx,r12d
xor edx,r8d
cmp r15,QWORD[16+rsp]
je NEAR $L$enc_compact_done
mov r10d,0x80808080
mov r11d,0x80808080
and r10d,eax
and r11d,ebx
mov esi,r10d
mov edi,r11d
shr r10d,7
lea r8d,[rax*1+rax]
shr r11d,7
lea r9d,[rbx*1+rbx]
sub esi,r10d
sub edi,r11d
and r8d,0xfefefefe
and r9d,0xfefefefe
and esi,0x1b1b1b1b
and edi,0x1b1b1b1b
mov r10d,eax
mov r11d,ebx
xor r8d,esi
xor r9d,edi
xor eax,r8d
xor ebx,r9d
mov r12d,0x80808080
rol eax,24
mov ebp,0x80808080
rol ebx,24
and r12d,ecx
and ebp,edx
xor eax,r8d
xor ebx,r9d
mov esi,r12d
ror r10d,16
mov edi,ebp
ror r11d,16
lea r8d,[rcx*1+rcx]
shr r12d,7
xor eax,r10d
shr ebp,7
xor ebx,r11d
ror r10d,8
lea r9d,[rdx*1+rdx]
ror r11d,8
sub esi,r12d
sub edi,ebp
xor eax,r10d
xor ebx,r11d
and r8d,0xfefefefe
and r9d,0xfefefefe
and esi,0x1b1b1b1b
and edi,0x1b1b1b1b
mov r12d,ecx
mov ebp,edx
xor r8d,esi
xor r9d,edi
ror r12d,16
xor ecx,r8d
ror ebp,16
xor edx,r9d
rol ecx,24
mov esi,DWORD[r14]
rol edx,24
xor ecx,r8d
mov edi,DWORD[64+r14]
xor edx,r9d
mov r8d,DWORD[128+r14]
xor ecx,r12d
ror r12d,8
xor edx,ebp
ror ebp,8
xor ecx,r12d
mov r9d,DWORD[192+r14]
xor edx,ebp
jmp NEAR $L$enc_loop_compact
ALIGN 16
$L$enc_compact_done:
xor eax,DWORD[r15]
xor ebx,DWORD[4+r15]
xor ecx,DWORD[8+r15]
xor edx,DWORD[12+r15]
DB 0xf3,0xc3
global AES_encrypt
ALIGN 16
global asm_AES_encrypt
asm_AES_encrypt:
AES_encrypt:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_AES_encrypt:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
DB 243,15,30,250
mov rax,rsp
push rbx
push rbp
push r12
push r13
push r14
push r15
lea rcx,[((-63))+rdx]
and rsp,-64
sub rcx,rsp
neg rcx
and rcx,0x3c0
sub rsp,rcx
sub rsp,32
mov QWORD[16+rsp],rsi
mov QWORD[24+rsp],rax
$L$enc_prologue:
mov r15,rdx
mov r13d,DWORD[240+r15]
mov eax,DWORD[rdi]
mov ebx,DWORD[4+rdi]
mov ecx,DWORD[8+rdi]
mov edx,DWORD[12+rdi]
shl r13d,4
lea rbp,[r13*1+r15]
mov QWORD[rsp],r15
mov QWORD[8+rsp],rbp
lea r14,[(($L$AES_Te+2048))]
lea rbp,[768+rsp]
sub rbp,r14
and rbp,0x300
lea r14,[rbp*1+r14]
call _x86_64_AES_encrypt_compact
mov r9,QWORD[16+rsp]
mov rsi,QWORD[24+rsp]
mov DWORD[r9],eax
mov DWORD[4+r9],ebx
mov DWORD[8+r9],ecx
mov DWORD[12+r9],edx
mov r15,QWORD[((-48))+rsi]
mov r14,QWORD[((-40))+rsi]
mov r13,QWORD[((-32))+rsi]
mov r12,QWORD[((-24))+rsi]
mov rbp,QWORD[((-16))+rsi]
mov rbx,QWORD[((-8))+rsi]
lea rsp,[rsi]
$L$enc_epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_AES_encrypt:
ALIGN 16
_x86_64_AES_decrypt:
xor eax,DWORD[r15]
xor ebx,DWORD[4+r15]
xor ecx,DWORD[8+r15]
xor edx,DWORD[12+r15]
mov r13d,DWORD[240+r15]
sub r13d,1
jmp NEAR $L$dec_loop
ALIGN 16
$L$dec_loop:
movzx esi,al
movzx edi,bl
movzx ebp,cl
mov r10d,DWORD[rsi*8+r14]
mov r11d,DWORD[rdi*8+r14]
mov r12d,DWORD[rbp*8+r14]
movzx esi,dh
movzx edi,ah
movzx ebp,dl
xor r10d,DWORD[3+rsi*8+r14]
xor r11d,DWORD[3+rdi*8+r14]
mov r8d,DWORD[rbp*8+r14]
movzx esi,bh
shr eax,16
movzx ebp,ch
xor r12d,DWORD[3+rsi*8+r14]
shr edx,16
xor r8d,DWORD[3+rbp*8+r14]
shr ebx,16
lea r15,[16+r15]
shr ecx,16
movzx esi,cl
movzx edi,dl
movzx ebp,al
xor r10d,DWORD[2+rsi*8+r14]
xor r11d,DWORD[2+rdi*8+r14]
xor r12d,DWORD[2+rbp*8+r14]
movzx esi,bh
movzx edi,ch
movzx ebp,bl
xor r10d,DWORD[1+rsi*8+r14]
xor r11d,DWORD[1+rdi*8+r14]
xor r8d,DWORD[2+rbp*8+r14]
movzx esi,dh
mov edx,DWORD[12+r15]
movzx ebp,ah
xor r12d,DWORD[1+rsi*8+r14]
mov eax,DWORD[r15]
xor r8d,DWORD[1+rbp*8+r14]
xor eax,r10d
mov ebx,DWORD[4+r15]
mov ecx,DWORD[8+r15]
xor ecx,r12d
xor ebx,r11d
xor edx,r8d
sub r13d,1
jnz NEAR $L$dec_loop
lea r14,[2048+r14]
movzx esi,al
movzx edi,bl
movzx ebp,cl
movzx r10d,BYTE[rsi*1+r14]
movzx r11d,BYTE[rdi*1+r14]
movzx r12d,BYTE[rbp*1+r14]
movzx esi,dl
movzx edi,dh
movzx ebp,ah
movzx r8d,BYTE[rsi*1+r14]
movzx edi,BYTE[rdi*1+r14]
movzx ebp,BYTE[rbp*1+r14]
shl edi,8
shl ebp,8
xor r10d,edi
xor r11d,ebp
shr edx,16
movzx esi,bh
movzx edi,ch
shr eax,16
movzx esi,BYTE[rsi*1+r14]
movzx edi,BYTE[rdi*1+r14]
shl esi,8
shl edi,8
shr ebx,16
xor r12d,esi
xor r8d,edi
shr ecx,16
movzx esi,cl
movzx edi,dl
movzx ebp,al
movzx esi,BYTE[rsi*1+r14]
movzx edi,BYTE[rdi*1+r14]
movzx ebp,BYTE[rbp*1+r14]
shl esi,16
shl edi,16
shl ebp,16
xor r10d,esi
xor r11d,edi
xor r12d,ebp
movzx esi,bl
movzx edi,bh
movzx ebp,ch
movzx esi,BYTE[rsi*1+r14]
movzx edi,BYTE[rdi*1+r14]
movzx ebp,BYTE[rbp*1+r14]
shl esi,16
shl edi,24
shl ebp,24
xor r8d,esi
xor r10d,edi
xor r11d,ebp
movzx esi,dh
movzx edi,ah
mov edx,DWORD[((16+12))+r15]
movzx esi,BYTE[rsi*1+r14]
movzx edi,BYTE[rdi*1+r14]
mov eax,DWORD[((16+0))+r15]
shl esi,24
shl edi,24
xor r12d,esi
xor r8d,edi
mov ebx,DWORD[((16+4))+r15]
mov ecx,DWORD[((16+8))+r15]
lea r14,[((-2048))+r14]
xor eax,r10d
xor ebx,r11d
xor ecx,r12d
xor edx,r8d
DB 0xf3,0xc3
ALIGN 16
_x86_64_AES_decrypt_compact:
lea r8,[128+r14]
mov edi,DWORD[((0-128))+r8]
mov ebp,DWORD[((32-128))+r8]
mov r10d,DWORD[((64-128))+r8]
mov r11d,DWORD[((96-128))+r8]
mov edi,DWORD[((128-128))+r8]
mov ebp,DWORD[((160-128))+r8]
mov r10d,DWORD[((192-128))+r8]
mov r11d,DWORD[((224-128))+r8]
jmp NEAR $L$dec_loop_compact
ALIGN 16
$L$dec_loop_compact:
xor eax,DWORD[r15]
xor ebx,DWORD[4+r15]
xor ecx,DWORD[8+r15]
xor edx,DWORD[12+r15]
lea r15,[16+r15]
movzx r10d,al
movzx r11d,bl
movzx r12d,cl
movzx r8d,dl
movzx esi,dh
movzx edi,ah
shr edx,16
movzx ebp,bh
movzx r10d,BYTE[r10*1+r14]
movzx r11d,BYTE[r11*1+r14]
movzx r12d,BYTE[r12*1+r14]
movzx r8d,BYTE[r8*1+r14]
movzx r9d,BYTE[rsi*1+r14]
movzx esi,ch
movzx r13d,BYTE[rdi*1+r14]
movzx ebp,BYTE[rbp*1+r14]
movzx esi,BYTE[rsi*1+r14]
shr ecx,16
shl r13d,8
shl r9d,8
movzx edi,cl
shr eax,16
xor r10d,r9d
shr ebx,16
movzx r9d,dl
shl ebp,8
xor r11d,r13d
shl esi,8
movzx r13d,al
movzx edi,BYTE[rdi*1+r14]
xor r12d,ebp
movzx ebp,bl
shl edi,16
xor r8d,esi
movzx r9d,BYTE[r9*1+r14]
movzx esi,bh
movzx ebp,BYTE[rbp*1+r14]
xor r10d,edi
movzx r13d,BYTE[r13*1+r14]
movzx edi,ch
shl ebp,16
shl r9d,16
shl r13d,16
xor r8d,ebp
movzx ebp,dh
xor r11d,r9d
shr eax,8
xor r12d,r13d
movzx esi,BYTE[rsi*1+r14]
movzx ebx,BYTE[rdi*1+r14]
movzx ecx,BYTE[rbp*1+r14]
movzx edx,BYTE[rax*1+r14]
mov eax,r10d
shl esi,24
shl ebx,24
shl ecx,24
xor eax,esi
shl edx,24
xor ebx,r11d
xor ecx,r12d
xor edx,r8d
cmp r15,QWORD[16+rsp]
je NEAR $L$dec_compact_done
mov rsi,QWORD[((256+0))+r14]
shl rbx,32
shl rdx,32
mov rdi,QWORD[((256+8))+r14]
or rax,rbx
or rcx,rdx
mov rbp,QWORD[((256+16))+r14]
mov r9,rsi
mov r12,rsi
and r9,rax
and r12,rcx
mov rbx,r9
mov rdx,r12
shr r9,7
lea r8,[rax*1+rax]
shr r12,7
lea r11,[rcx*1+rcx]
sub rbx,r9
sub rdx,r12
and r8,rdi
and r11,rdi
and rbx,rbp
and rdx,rbp
xor r8,rbx
xor r11,rdx
mov r10,rsi
mov r13,rsi
and r10,r8
and r13,r11
mov rbx,r10
mov rdx,r13
shr r10,7
lea r9,[r8*1+r8]
shr r13,7
lea r12,[r11*1+r11]
sub rbx,r10
sub rdx,r13
and r9,rdi
and r12,rdi
and rbx,rbp
and rdx,rbp
xor r9,rbx
xor r12,rdx
mov r10,rsi
mov r13,rsi
and r10,r9
and r13,r12
mov rbx,r10
mov rdx,r13
shr r10,7
xor r8,rax
shr r13,7
xor r11,rcx
sub rbx,r10
sub rdx,r13
lea r10,[r9*1+r9]
lea r13,[r12*1+r12]
xor r9,rax
xor r12,rcx
and r10,rdi
and r13,rdi
and rbx,rbp
and rdx,rbp
xor r10,rbx
xor r13,rdx
xor rax,r10
xor rcx,r13
xor r8,r10
xor r11,r13
mov rbx,rax
mov rdx,rcx
xor r9,r10
shr rbx,32
xor r12,r13
shr rdx,32
xor r10,r8
rol eax,8
xor r13,r11
rol ecx,8
xor r10,r9
rol ebx,8
xor r13,r12
rol edx,8
xor eax,r10d
shr r10,32
xor ecx,r13d
shr r13,32
xor ebx,r10d
xor edx,r13d
mov r10,r8
rol r8d,24
mov r13,r11
rol r11d,24
shr r10,32
xor eax,r8d
shr r13,32
xor ecx,r11d
rol r10d,24
mov r8,r9
rol r13d,24
mov r11,r12
shr r8,32
xor ebx,r10d
shr r11,32
xor edx,r13d
mov rsi,QWORD[r14]
rol r9d,16
mov rdi,QWORD[64+r14]
rol r12d,16
mov rbp,QWORD[128+r14]
rol r8d,16
mov r10,QWORD[192+r14]
xor eax,r9d
rol r11d,16
xor ecx,r12d
mov r13,QWORD[256+r14]
xor ebx,r8d
xor edx,r11d
jmp NEAR $L$dec_loop_compact
ALIGN 16
$L$dec_compact_done:
xor eax,DWORD[r15]
xor ebx,DWORD[4+r15]
xor ecx,DWORD[8+r15]
xor edx,DWORD[12+r15]
DB 0xf3,0xc3
global AES_decrypt
ALIGN 16
global asm_AES_decrypt
asm_AES_decrypt:
AES_decrypt:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_AES_decrypt:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
DB 243,15,30,250
mov rax,rsp
push rbx
push rbp
push r12
push r13
push r14
push r15
lea rcx,[((-63))+rdx]
and rsp,-64
sub rcx,rsp
neg rcx
and rcx,0x3c0
sub rsp,rcx
sub rsp,32
mov QWORD[16+rsp],rsi
mov QWORD[24+rsp],rax
$L$dec_prologue:
mov r15,rdx
mov r13d,DWORD[240+r15]
mov eax,DWORD[rdi]
mov ebx,DWORD[4+rdi]
mov ecx,DWORD[8+rdi]
mov edx,DWORD[12+rdi]
shl r13d,4
lea rbp,[r13*1+r15]
mov QWORD[rsp],r15
mov QWORD[8+rsp],rbp
lea r14,[(($L$AES_Td+2048))]
lea rbp,[768+rsp]
sub rbp,r14
and rbp,0x300
lea r14,[rbp*1+r14]
shr rbp,3
add r14,rbp
call _x86_64_AES_decrypt_compact
mov r9,QWORD[16+rsp]
mov rsi,QWORD[24+rsp]
mov DWORD[r9],eax
mov DWORD[4+r9],ebx
mov DWORD[8+r9],ecx
mov DWORD[12+r9],edx
mov r15,QWORD[((-48))+rsi]
mov r14,QWORD[((-40))+rsi]
mov r13,QWORD[((-32))+rsi]
mov r12,QWORD[((-24))+rsi]
mov rbp,QWORD[((-16))+rsi]
mov rbx,QWORD[((-8))+rsi]
lea rsp,[rsi]
$L$dec_epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_AES_decrypt:
global AES_set_encrypt_key
ALIGN 16
AES_set_encrypt_key:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_AES_set_encrypt_key:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
DB 243,15,30,250
push rbx
push rbp
push r12
push r13
push r14
push r15
sub rsp,8
$L$enc_key_prologue:
call _x86_64_AES_set_encrypt_key
mov rbp,QWORD[40+rsp]
mov rbx,QWORD[48+rsp]
add rsp,56
$L$enc_key_epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_AES_set_encrypt_key:
ALIGN 16
_x86_64_AES_set_encrypt_key:
mov ecx,esi
mov rsi,rdi
mov rdi,rdx
test rsi,-1
jz NEAR $L$badpointer
test rdi,-1
jz NEAR $L$badpointer
lea rbp,[$L$AES_Te]
lea rbp,[((2048+128))+rbp]
mov eax,DWORD[((0-128))+rbp]
mov ebx,DWORD[((32-128))+rbp]
mov r8d,DWORD[((64-128))+rbp]
mov edx,DWORD[((96-128))+rbp]
mov eax,DWORD[((128-128))+rbp]
mov ebx,DWORD[((160-128))+rbp]
mov r8d,DWORD[((192-128))+rbp]
mov edx,DWORD[((224-128))+rbp]
cmp ecx,128
je NEAR $L$10rounds
cmp ecx,192
je NEAR $L$12rounds
cmp ecx,256
je NEAR $L$14rounds
mov rax,-2
jmp NEAR $L$exit
$L$10rounds:
mov rax,QWORD[rsi]
mov rdx,QWORD[8+rsi]
mov QWORD[rdi],rax
mov QWORD[8+rdi],rdx
shr rdx,32
xor ecx,ecx
jmp NEAR $L$10shortcut
ALIGN 4
$L$10loop:
mov eax,DWORD[rdi]
mov edx,DWORD[12+rdi]
$L$10shortcut:
movzx esi,dl
movzx ebx,BYTE[((-128))+rsi*1+rbp]
movzx esi,dh
shl ebx,24
xor eax,ebx
movzx ebx,BYTE[((-128))+rsi*1+rbp]
shr edx,16
movzx esi,dl
xor eax,ebx
movzx ebx,BYTE[((-128))+rsi*1+rbp]
movzx esi,dh
shl ebx,8
xor eax,ebx
movzx ebx,BYTE[((-128))+rsi*1+rbp]
shl ebx,16
xor eax,ebx
xor eax,DWORD[((1024-128))+rcx*4+rbp]
mov DWORD[16+rdi],eax
xor eax,DWORD[4+rdi]
mov DWORD[20+rdi],eax
xor eax,DWORD[8+rdi]
mov DWORD[24+rdi],eax
xor eax,DWORD[12+rdi]
mov DWORD[28+rdi],eax
add ecx,1
lea rdi,[16+rdi]
cmp ecx,10
jl NEAR $L$10loop
mov DWORD[80+rdi],10
xor rax,rax
jmp NEAR $L$exit
$L$12rounds:
mov rax,QWORD[rsi]
mov rbx,QWORD[8+rsi]
mov rdx,QWORD[16+rsi]
mov QWORD[rdi],rax
mov QWORD[8+rdi],rbx
mov QWORD[16+rdi],rdx
shr rdx,32
xor ecx,ecx
jmp NEAR $L$12shortcut
ALIGN 4
$L$12loop:
mov eax,DWORD[rdi]
mov edx,DWORD[20+rdi]
$L$12shortcut:
movzx esi,dl
movzx ebx,BYTE[((-128))+rsi*1+rbp]
movzx esi,dh
shl ebx,24
xor eax,ebx
movzx ebx,BYTE[((-128))+rsi*1+rbp]
shr edx,16
movzx esi,dl
xor eax,ebx
movzx ebx,BYTE[((-128))+rsi*1+rbp]
movzx esi,dh
shl ebx,8
xor eax,ebx
movzx ebx,BYTE[((-128))+rsi*1+rbp]
shl ebx,16
xor eax,ebx
xor eax,DWORD[((1024-128))+rcx*4+rbp]
mov DWORD[24+rdi],eax
xor eax,DWORD[4+rdi]
mov DWORD[28+rdi],eax
xor eax,DWORD[8+rdi]
mov DWORD[32+rdi],eax
xor eax,DWORD[12+rdi]
mov DWORD[36+rdi],eax
cmp ecx,7
je NEAR $L$12break
add ecx,1
xor eax,DWORD[16+rdi]
mov DWORD[40+rdi],eax
xor eax,DWORD[20+rdi]
mov DWORD[44+rdi],eax
lea rdi,[24+rdi]
jmp NEAR $L$12loop
$L$12break:
mov DWORD[72+rdi],12
xor rax,rax
jmp NEAR $L$exit
$L$14rounds:
mov rax,QWORD[rsi]
mov rbx,QWORD[8+rsi]
mov rcx,QWORD[16+rsi]
mov rdx,QWORD[24+rsi]
mov QWORD[rdi],rax
mov QWORD[8+rdi],rbx
mov QWORD[16+rdi],rcx
mov QWORD[24+rdi],rdx
shr rdx,32
xor ecx,ecx
jmp NEAR $L$14shortcut
ALIGN 4
$L$14loop:
mov eax,DWORD[rdi]
mov edx,DWORD[28+rdi]
$L$14shortcut:
movzx esi,dl
movzx ebx,BYTE[((-128))+rsi*1+rbp]
movzx esi,dh
shl ebx,24
xor eax,ebx
movzx ebx,BYTE[((-128))+rsi*1+rbp]
shr edx,16
movzx esi,dl
xor eax,ebx
movzx ebx,BYTE[((-128))+rsi*1+rbp]
movzx esi,dh
shl ebx,8
xor eax,ebx
movzx ebx,BYTE[((-128))+rsi*1+rbp]
shl ebx,16
xor eax,ebx
xor eax,DWORD[((1024-128))+rcx*4+rbp]
mov DWORD[32+rdi],eax
xor eax,DWORD[4+rdi]
mov DWORD[36+rdi],eax
xor eax,DWORD[8+rdi]
mov DWORD[40+rdi],eax
xor eax,DWORD[12+rdi]
mov DWORD[44+rdi],eax
cmp ecx,6
je NEAR $L$14break
add ecx,1
mov edx,eax
mov eax,DWORD[16+rdi]
movzx esi,dl
movzx ebx,BYTE[((-128))+rsi*1+rbp]
movzx esi,dh
xor eax,ebx
movzx ebx,BYTE[((-128))+rsi*1+rbp]
shr edx,16
shl ebx,8
movzx esi,dl
xor eax,ebx
movzx ebx,BYTE[((-128))+rsi*1+rbp]
movzx esi,dh
shl ebx,16
xor eax,ebx
movzx ebx,BYTE[((-128))+rsi*1+rbp]
shl ebx,24
xor eax,ebx
mov DWORD[48+rdi],eax
xor eax,DWORD[20+rdi]
mov DWORD[52+rdi],eax
xor eax,DWORD[24+rdi]
mov DWORD[56+rdi],eax
xor eax,DWORD[28+rdi]
mov DWORD[60+rdi],eax
lea rdi,[32+rdi]
jmp NEAR $L$14loop
$L$14break:
mov DWORD[48+rdi],14
xor rax,rax
jmp NEAR $L$exit
$L$badpointer:
mov rax,-1
$L$exit:
DB 0xf3,0xc3
global AES_set_decrypt_key
ALIGN 16
AES_set_decrypt_key:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_AES_set_decrypt_key:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
DB 243,15,30,250
push rbx
push rbp
push r12
push r13
push r14
push r15
push rdx
$L$dec_key_prologue:
call _x86_64_AES_set_encrypt_key
mov r8,QWORD[rsp]
cmp eax,0
jne NEAR $L$abort
mov r14d,DWORD[240+r8]
xor rdi,rdi
lea rcx,[r14*4+rdi]
mov rsi,r8
lea rdi,[rcx*4+r8]
ALIGN 4
$L$invert:
mov rax,QWORD[rsi]
mov rbx,QWORD[8+rsi]
mov rcx,QWORD[rdi]
mov rdx,QWORD[8+rdi]
mov QWORD[rdi],rax
mov QWORD[8+rdi],rbx
mov QWORD[rsi],rcx
mov QWORD[8+rsi],rdx
lea rsi,[16+rsi]
lea rdi,[((-16))+rdi]
cmp rdi,rsi
jne NEAR $L$invert
lea rax,[(($L$AES_Te+2048+1024))]
mov rsi,QWORD[40+rax]
mov rdi,QWORD[48+rax]
mov rbp,QWORD[56+rax]
mov r15,r8
sub r14d,1
ALIGN 4
$L$permute:
lea r15,[16+r15]
mov rax,QWORD[r15]
mov rcx,QWORD[8+r15]
mov r9,rsi
mov r12,rsi
and r9,rax
and r12,rcx
mov rbx,r9
mov rdx,r12
shr r9,7
lea r8,[rax*1+rax]
shr r12,7
lea r11,[rcx*1+rcx]
sub rbx,r9
sub rdx,r12
and r8,rdi
and r11,rdi
and rbx,rbp
and rdx,rbp
xor r8,rbx
xor r11,rdx
mov r10,rsi
mov r13,rsi
and r10,r8
and r13,r11
mov rbx,r10
mov rdx,r13
shr r10,7
lea r9,[r8*1+r8]
shr r13,7
lea r12,[r11*1+r11]
sub rbx,r10
sub rdx,r13
and r9,rdi
and r12,rdi
and rbx,rbp
and rdx,rbp
xor r9,rbx
xor r12,rdx
mov r10,rsi
mov r13,rsi
and r10,r9
and r13,r12
mov rbx,r10
mov rdx,r13
shr r10,7
xor r8,rax
shr r13,7
xor r11,rcx
sub rbx,r10
sub rdx,r13
lea r10,[r9*1+r9]
lea r13,[r12*1+r12]
xor r9,rax
xor r12,rcx
and r10,rdi
and r13,rdi
and rbx,rbp
and rdx,rbp
xor r10,rbx
xor r13,rdx
xor rax,r10
xor rcx,r13
xor r8,r10
xor r11,r13
mov rbx,rax
mov rdx,rcx
xor r9,r10
shr rbx,32
xor r12,r13
shr rdx,32
xor r10,r8
rol eax,8
xor r13,r11
rol ecx,8
xor r10,r9
rol ebx,8
xor r13,r12
rol edx,8
xor eax,r10d
shr r10,32
xor ecx,r13d
shr r13,32
xor ebx,r10d
xor edx,r13d
mov r10,r8
rol r8d,24
mov r13,r11
rol r11d,24
shr r10,32
xor eax,r8d
shr r13,32
xor ecx,r11d
rol r10d,24
mov r8,r9
rol r13d,24
mov r11,r12
shr r8,32
xor ebx,r10d
shr r11,32
xor edx,r13d
rol r9d,16
rol r12d,16
rol r8d,16
xor eax,r9d
rol r11d,16
xor ecx,r12d
xor ebx,r8d
xor edx,r11d
mov DWORD[r15],eax
mov DWORD[4+r15],ebx
mov DWORD[8+r15],ecx
mov DWORD[12+r15],edx
sub r14d,1
jnz NEAR $L$permute
xor rax,rax
$L$abort:
mov r15,QWORD[8+rsp]
mov r14,QWORD[16+rsp]
mov r13,QWORD[24+rsp]
mov r12,QWORD[32+rsp]
mov rbp,QWORD[40+rsp]
mov rbx,QWORD[48+rsp]
add rsp,56
$L$dec_key_epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_AES_set_decrypt_key:
global AES_cbc_encrypt
ALIGN 16
EXTERN OPENSSL_ia32cap_P
global asm_AES_cbc_encrypt
asm_AES_cbc_encrypt:
AES_cbc_encrypt:
mov QWORD[8+rsp],rdi ;WIN64 prologue
mov QWORD[16+rsp],rsi
mov rax,rsp
$L$SEH_begin_AES_cbc_encrypt:
mov rdi,rcx
mov rsi,rdx
mov rdx,r8
mov rcx,r9
mov r8,QWORD[40+rsp]
mov r9,QWORD[48+rsp]
DB 243,15,30,250
cmp rdx,0
je NEAR $L$cbc_epilogue
pushfq
push rbx
push rbp
push r12
push r13
push r14
push r15
$L$cbc_prologue:
cld
mov r9d,r9d
lea r14,[$L$AES_Te]
lea r10,[$L$AES_Td]
cmp r9,0
cmove r14,r10
mov r10d,DWORD[OPENSSL_ia32cap_P]
cmp rdx,512
jb NEAR $L$cbc_slow_prologue
test rdx,15
jnz NEAR $L$cbc_slow_prologue
bt r10d,28
jc NEAR $L$cbc_slow_prologue
lea r15,[((-88-248))+rsp]
and r15,-64
mov r10,r14
lea r11,[2304+r14]
mov r12,r15
and r10,0xFFF
and r11,0xFFF
and r12,0xFFF
cmp r12,r11
jb NEAR $L$cbc_te_break_out
sub r12,r11
sub r15,r12
jmp NEAR $L$cbc_te_ok
$L$cbc_te_break_out:
sub r12,r10
and r12,0xFFF
add r12,320
sub r15,r12
ALIGN 4
$L$cbc_te_ok:
xchg r15,rsp
mov QWORD[16+rsp],r15
$L$cbc_fast_body:
mov QWORD[24+rsp],rdi
mov QWORD[32+rsp],rsi
mov QWORD[40+rsp],rdx
mov QWORD[48+rsp],rcx
mov QWORD[56+rsp],r8
mov DWORD[((80+240))+rsp],0
mov rbp,r8
mov rbx,r9
mov r9,rsi
mov r8,rdi
mov r15,rcx
mov eax,DWORD[240+r15]
mov r10,r15
sub r10,r14
and r10,0xfff
cmp r10,2304
jb NEAR $L$cbc_do_ecopy
cmp r10,4096-248
jb NEAR $L$cbc_skip_ecopy
ALIGN 4
$L$cbc_do_ecopy:
mov rsi,r15
lea rdi,[80+rsp]
lea r15,[80+rsp]
mov ecx,240/8
DD 0x90A548F3
mov DWORD[rdi],eax
$L$cbc_skip_ecopy:
mov QWORD[rsp],r15
mov ecx,18
ALIGN 4
$L$cbc_prefetch_te:
mov r10,QWORD[r14]
mov r11,QWORD[32+r14]
mov r12,QWORD[64+r14]
mov r13,QWORD[96+r14]
lea r14,[128+r14]
sub ecx,1
jnz NEAR $L$cbc_prefetch_te
lea r14,[((-2304))+r14]
cmp rbx,0
je NEAR $L$FAST_DECRYPT
mov eax,DWORD[rbp]
mov ebx,DWORD[4+rbp]
mov ecx,DWORD[8+rbp]
mov edx,DWORD[12+rbp]
ALIGN 4
$L$cbc_fast_enc_loop:
xor eax,DWORD[r8]
xor ebx,DWORD[4+r8]
xor ecx,DWORD[8+r8]
xor edx,DWORD[12+r8]
mov r15,QWORD[rsp]
mov QWORD[24+rsp],r8
call _x86_64_AES_encrypt
mov r8,QWORD[24+rsp]
mov r10,QWORD[40+rsp]
mov DWORD[r9],eax
mov DWORD[4+r9],ebx
mov DWORD[8+r9],ecx
mov DWORD[12+r9],edx
lea r8,[16+r8]
lea r9,[16+r9]
sub r10,16
test r10,-16
mov QWORD[40+rsp],r10
jnz NEAR $L$cbc_fast_enc_loop
mov rbp,QWORD[56+rsp]
mov DWORD[rbp],eax
mov DWORD[4+rbp],ebx
mov DWORD[8+rbp],ecx
mov DWORD[12+rbp],edx
jmp NEAR $L$cbc_fast_cleanup
ALIGN 16
$L$FAST_DECRYPT:
cmp r9,r8
je NEAR $L$cbc_fast_dec_in_place
mov QWORD[64+rsp],rbp
ALIGN 4
$L$cbc_fast_dec_loop:
mov eax,DWORD[r8]
mov ebx,DWORD[4+r8]
mov ecx,DWORD[8+r8]
mov edx,DWORD[12+r8]
mov r15,QWORD[rsp]
mov QWORD[24+rsp],r8
call _x86_64_AES_decrypt
mov rbp,QWORD[64+rsp]
mov r8,QWORD[24+rsp]
mov r10,QWORD[40+rsp]
xor eax,DWORD[rbp]
xor ebx,DWORD[4+rbp]
xor ecx,DWORD[8+rbp]
xor edx,DWORD[12+rbp]
mov rbp,r8
sub r10,16
mov QWORD[40+rsp],r10
mov QWORD[64+rsp],rbp
mov DWORD[r9],eax
mov DWORD[4+r9],ebx
mov DWORD[8+r9],ecx
mov DWORD[12+r9],edx
lea r8,[16+r8]
lea r9,[16+r9]
jnz NEAR $L$cbc_fast_dec_loop
mov r12,QWORD[56+rsp]
mov r10,QWORD[rbp]
mov r11,QWORD[8+rbp]
mov QWORD[r12],r10
mov QWORD[8+r12],r11
jmp NEAR $L$cbc_fast_cleanup
ALIGN 16
$L$cbc_fast_dec_in_place:
mov r10,QWORD[rbp]
mov r11,QWORD[8+rbp]
mov QWORD[((0+64))+rsp],r10
mov QWORD[((8+64))+rsp],r11
ALIGN 4
$L$cbc_fast_dec_in_place_loop:
mov eax,DWORD[r8]
mov ebx,DWORD[4+r8]
mov ecx,DWORD[8+r8]
mov edx,DWORD[12+r8]
mov r15,QWORD[rsp]
mov QWORD[24+rsp],r8
call _x86_64_AES_decrypt
mov r8,QWORD[24+rsp]
mov r10,QWORD[40+rsp]
xor eax,DWORD[((0+64))+rsp]
xor ebx,DWORD[((4+64))+rsp]
xor ecx,DWORD[((8+64))+rsp]
xor edx,DWORD[((12+64))+rsp]
mov r11,QWORD[r8]
mov r12,QWORD[8+r8]
sub r10,16
jz NEAR $L$cbc_fast_dec_in_place_done
mov QWORD[((0+64))+rsp],r11
mov QWORD[((8+64))+rsp],r12
mov DWORD[r9],eax
mov DWORD[4+r9],ebx
mov DWORD[8+r9],ecx
mov DWORD[12+r9],edx
lea r8,[16+r8]
lea r9,[16+r9]
mov QWORD[40+rsp],r10
jmp NEAR $L$cbc_fast_dec_in_place_loop
$L$cbc_fast_dec_in_place_done:
mov rdi,QWORD[56+rsp]
mov QWORD[rdi],r11
mov QWORD[8+rdi],r12
mov DWORD[r9],eax
mov DWORD[4+r9],ebx
mov DWORD[8+r9],ecx
mov DWORD[12+r9],edx
ALIGN 4
$L$cbc_fast_cleanup:
cmp DWORD[((80+240))+rsp],0
lea rdi,[80+rsp]
je NEAR $L$cbc_exit
mov ecx,240/8
xor rax,rax
DD 0x90AB48F3
jmp NEAR $L$cbc_exit
ALIGN 16
$L$cbc_slow_prologue:
lea rbp,[((-88))+rsp]
and rbp,-64
lea r10,[((-88-63))+rcx]
sub r10,rbp
neg r10
and r10,0x3c0
sub rbp,r10
xchg rbp,rsp
mov QWORD[16+rsp],rbp
$L$cbc_slow_body:
mov QWORD[56+rsp],r8
mov rbp,r8
mov rbx,r9
mov r9,rsi
mov r8,rdi
mov r15,rcx
mov r10,rdx
mov eax,DWORD[240+r15]
mov QWORD[rsp],r15
shl eax,4
lea rax,[rax*1+r15]
mov QWORD[8+rsp],rax
lea r14,[2048+r14]
lea rax,[((768-8))+rsp]
sub rax,r14
and rax,0x300
lea r14,[rax*1+r14]
cmp rbx,0
je NEAR $L$SLOW_DECRYPT
test r10,-16
mov eax,DWORD[rbp]
mov ebx,DWORD[4+rbp]
mov ecx,DWORD[8+rbp]
mov edx,DWORD[12+rbp]
jz NEAR $L$cbc_slow_enc_tail
ALIGN 4
$L$cbc_slow_enc_loop:
xor eax,DWORD[r8]
xor ebx,DWORD[4+r8]
xor ecx,DWORD[8+r8]
xor edx,DWORD[12+r8]
mov r15,QWORD[rsp]
mov QWORD[24+rsp],r8
mov QWORD[32+rsp],r9
mov QWORD[40+rsp],r10
call _x86_64_AES_encrypt_compact
mov r8,QWORD[24+rsp]
mov r9,QWORD[32+rsp]
mov r10,QWORD[40+rsp]
mov DWORD[r9],eax
mov DWORD[4+r9],ebx
mov DWORD[8+r9],ecx
mov DWORD[12+r9],edx
lea r8,[16+r8]
lea r9,[16+r9]
sub r10,16
test r10,-16
jnz NEAR $L$cbc_slow_enc_loop
test r10,15
jnz NEAR $L$cbc_slow_enc_tail
mov rbp,QWORD[56+rsp]
mov DWORD[rbp],eax
mov DWORD[4+rbp],ebx
mov DWORD[8+rbp],ecx
mov DWORD[12+rbp],edx
jmp NEAR $L$cbc_exit
ALIGN 4
$L$cbc_slow_enc_tail:
mov r11,rax
mov r12,rcx
mov rcx,r10
mov rsi,r8
mov rdi,r9
DD 0x9066A4F3
mov rcx,16
sub rcx,r10
xor rax,rax
DD 0x9066AAF3
mov r8,r9
mov r10,16
mov rax,r11
mov rcx,r12
jmp NEAR $L$cbc_slow_enc_loop
ALIGN 16
$L$SLOW_DECRYPT:
shr rax,3
add r14,rax
mov r11,QWORD[rbp]
mov r12,QWORD[8+rbp]
mov QWORD[((0+64))+rsp],r11
mov QWORD[((8+64))+rsp],r12
ALIGN 4
$L$cbc_slow_dec_loop:
mov eax,DWORD[r8]
mov ebx,DWORD[4+r8]
mov ecx,DWORD[8+r8]
mov edx,DWORD[12+r8]
mov r15,QWORD[rsp]
mov QWORD[24+rsp],r8
mov QWORD[32+rsp],r9
mov QWORD[40+rsp],r10
call _x86_64_AES_decrypt_compact
mov r8,QWORD[24+rsp]
mov r9,QWORD[32+rsp]
mov r10,QWORD[40+rsp]
xor eax,DWORD[((0+64))+rsp]
xor ebx,DWORD[((4+64))+rsp]
xor ecx,DWORD[((8+64))+rsp]
xor edx,DWORD[((12+64))+rsp]
mov r11,QWORD[r8]
mov r12,QWORD[8+r8]
sub r10,16
jc NEAR $L$cbc_slow_dec_partial
jz NEAR $L$cbc_slow_dec_done
mov QWORD[((0+64))+rsp],r11
mov QWORD[((8+64))+rsp],r12
mov DWORD[r9],eax
mov DWORD[4+r9],ebx
mov DWORD[8+r9],ecx
mov DWORD[12+r9],edx
lea r8,[16+r8]
lea r9,[16+r9]
jmp NEAR $L$cbc_slow_dec_loop
$L$cbc_slow_dec_done:
mov rdi,QWORD[56+rsp]
mov QWORD[rdi],r11
mov QWORD[8+rdi],r12
mov DWORD[r9],eax
mov DWORD[4+r9],ebx
mov DWORD[8+r9],ecx
mov DWORD[12+r9],edx
jmp NEAR $L$cbc_exit
ALIGN 4
$L$cbc_slow_dec_partial:
mov rdi,QWORD[56+rsp]
mov QWORD[rdi],r11
mov QWORD[8+rdi],r12
mov DWORD[((0+64))+rsp],eax
mov DWORD[((4+64))+rsp],ebx
mov DWORD[((8+64))+rsp],ecx
mov DWORD[((12+64))+rsp],edx
mov rdi,r9
lea rsi,[64+rsp]
lea rcx,[16+r10]
DD 0x9066A4F3
jmp NEAR $L$cbc_exit
ALIGN 16
$L$cbc_exit:
mov rsi,QWORD[16+rsp]
mov r15,QWORD[rsi]
mov r14,QWORD[8+rsi]
mov r13,QWORD[16+rsi]
mov r12,QWORD[24+rsi]
mov rbp,QWORD[32+rsi]
mov rbx,QWORD[40+rsi]
lea rsp,[48+rsi]
$L$cbc_popfq:
popfq
$L$cbc_epilogue:
mov rdi,QWORD[8+rsp] ;WIN64 epilogue
mov rsi,QWORD[16+rsp]
DB 0F3h,0C3h ;repret
$L$SEH_end_AES_cbc_encrypt:
ALIGN 64
$L$AES_Te:
DD 0xa56363c6,0xa56363c6
DD 0x847c7cf8,0x847c7cf8
DD 0x997777ee,0x997777ee
DD 0x8d7b7bf6,0x8d7b7bf6
DD 0x0df2f2ff,0x0df2f2ff
DD 0xbd6b6bd6,0xbd6b6bd6
DD 0xb16f6fde,0xb16f6fde
DD 0x54c5c591,0x54c5c591
DD 0x50303060,0x50303060
DD 0x03010102,0x03010102
DD 0xa96767ce,0xa96767ce
DD 0x7d2b2b56,0x7d2b2b56
DD 0x19fefee7,0x19fefee7
DD 0x62d7d7b5,0x62d7d7b5
DD 0xe6abab4d,0xe6abab4d
DD 0x9a7676ec,0x9a7676ec
DD 0x45caca8f,0x45caca8f
DD 0x9d82821f,0x9d82821f
DD 0x40c9c989,0x40c9c989
DD 0x877d7dfa,0x877d7dfa
DD 0x15fafaef,0x15fafaef
DD 0xeb5959b2,0xeb5959b2
DD 0xc947478e,0xc947478e
DD 0x0bf0f0fb,0x0bf0f0fb
DD 0xecadad41,0xecadad41
DD 0x67d4d4b3,0x67d4d4b3
DD 0xfda2a25f,0xfda2a25f
DD 0xeaafaf45,0xeaafaf45
DD 0xbf9c9c23,0xbf9c9c23
DD 0xf7a4a453,0xf7a4a453
DD 0x967272e4,0x967272e4
DD 0x5bc0c09b,0x5bc0c09b
DD 0xc2b7b775,0xc2b7b775
DD 0x1cfdfde1,0x1cfdfde1
DD 0xae93933d,0xae93933d
DD 0x6a26264c,0x6a26264c
DD 0x5a36366c,0x5a36366c
DD 0x413f3f7e,0x413f3f7e
DD 0x02f7f7f5,0x02f7f7f5
DD 0x4fcccc83,0x4fcccc83
DD 0x5c343468,0x5c343468
DD 0xf4a5a551,0xf4a5a551
DD 0x34e5e5d1,0x34e5e5d1
DD 0x08f1f1f9,0x08f1f1f9
DD 0x937171e2,0x937171e2
DD 0x73d8d8ab,0x73d8d8ab
DD 0x53313162,0x53313162
DD 0x3f15152a,0x3f15152a
DD 0x0c040408,0x0c040408
DD 0x52c7c795,0x52c7c795
DD 0x65232346,0x65232346
DD 0x5ec3c39d,0x5ec3c39d
DD 0x28181830,0x28181830
DD 0xa1969637,0xa1969637
DD 0x0f05050a,0x0f05050a
DD 0xb59a9a2f,0xb59a9a2f
DD 0x0907070e,0x0907070e
DD 0x36121224,0x36121224
DD 0x9b80801b,0x9b80801b
DD 0x3de2e2df,0x3de2e2df
DD 0x26ebebcd,0x26ebebcd
DD 0x6927274e,0x6927274e
DD 0xcdb2b27f,0xcdb2b27f
DD 0x9f7575ea,0x9f7575ea
DD 0x1b090912,0x1b090912
DD 0x9e83831d,0x9e83831d
DD 0x742c2c58,0x742c2c58
DD 0x2e1a1a34,0x2e1a1a34
DD 0x2d1b1b36,0x2d1b1b36
DD 0xb26e6edc,0xb26e6edc
DD 0xee5a5ab4,0xee5a5ab4
DD 0xfba0a05b,0xfba0a05b
DD 0xf65252a4,0xf65252a4
DD 0x4d3b3b76,0x4d3b3b76
DD 0x61d6d6b7,0x61d6d6b7
DD 0xceb3b37d,0xceb3b37d
DD 0x7b292952,0x7b292952
DD 0x3ee3e3dd,0x3ee3e3dd
DD 0x712f2f5e,0x712f2f5e
DD 0x97848413,0x97848413
DD 0xf55353a6,0xf55353a6
DD 0x68d1d1b9,0x68d1d1b9
DD 0x00000000,0x00000000
DD 0x2cededc1,0x2cededc1
DD 0x60202040,0x60202040
DD 0x1ffcfce3,0x1ffcfce3
DD 0xc8b1b179,0xc8b1b179
DD 0xed5b5bb6,0xed5b5bb6
DD 0xbe6a6ad4,0xbe6a6ad4
DD 0x46cbcb8d,0x46cbcb8d
DD 0xd9bebe67,0xd9bebe67
DD 0x4b393972,0x4b393972
DD 0xde4a4a94,0xde4a4a94
DD 0xd44c4c98,0xd44c4c98
DD 0xe85858b0,0xe85858b0
DD 0x4acfcf85,0x4acfcf85
DD 0x6bd0d0bb,0x6bd0d0bb
DD 0x2aefefc5,0x2aefefc5
DD 0xe5aaaa4f,0xe5aaaa4f
DD 0x16fbfbed,0x16fbfbed
DD 0xc5434386,0xc5434386
DD 0xd74d4d9a,0xd74d4d9a
DD 0x55333366,0x55333366
DD 0x94858511,0x94858511
DD 0xcf45458a,0xcf45458a
DD 0x10f9f9e9,0x10f9f9e9
DD 0x06020204,0x06020204
DD 0x817f7ffe,0x817f7ffe
DD 0xf05050a0,0xf05050a0
DD 0x443c3c78,0x443c3c78
DD 0xba9f9f25,0xba9f9f25
DD 0xe3a8a84b,0xe3a8a84b
DD 0xf35151a2,0xf35151a2
DD 0xfea3a35d,0xfea3a35d
DD 0xc0404080,0xc0404080
DD 0x8a8f8f05,0x8a8f8f05
DD 0xad92923f,0xad92923f
DD 0xbc9d9d21,0xbc9d9d21
DD 0x48383870,0x48383870
DD 0x04f5f5f1,0x04f5f5f1
DD 0xdfbcbc63,0xdfbcbc63
DD 0xc1b6b677,0xc1b6b677
DD 0x75dadaaf,0x75dadaaf
DD 0x63212142,0x63212142
DD 0x30101020,0x30101020
DD 0x1affffe5,0x1affffe5
DD 0x0ef3f3fd,0x0ef3f3fd
DD 0x6dd2d2bf,0x6dd2d2bf
DD 0x4ccdcd81,0x4ccdcd81
DD 0x140c0c18,0x140c0c18
DD 0x35131326,0x35131326
DD 0x2fececc3,0x2fececc3
DD 0xe15f5fbe,0xe15f5fbe
DD 0xa2979735,0xa2979735
DD 0xcc444488,0xcc444488
DD 0x3917172e,0x3917172e
DD 0x57c4c493,0x57c4c493
DD 0xf2a7a755,0xf2a7a755
DD 0x827e7efc,0x827e7efc
DD 0x473d3d7a,0x473d3d7a
DD 0xac6464c8,0xac6464c8
DD 0xe75d5dba,0xe75d5dba
DD 0x2b191932,0x2b191932
DD 0x957373e6,0x957373e6
DD 0xa06060c0,0xa06060c0
DD 0x98818119,0x98818119
DD 0xd14f4f9e,0xd14f4f9e
DD 0x7fdcdca3,0x7fdcdca3
DD 0x66222244,0x66222244
DD 0x7e2a2a54,0x7e2a2a54
DD 0xab90903b,0xab90903b
DD 0x8388880b,0x8388880b
DD 0xca46468c,0xca46468c
DD 0x29eeeec7,0x29eeeec7
DD 0xd3b8b86b,0xd3b8b86b
DD 0x3c141428,0x3c141428
DD 0x79dedea7,0x79dedea7
DD 0xe25e5ebc,0xe25e5ebc
DD 0x1d0b0b16,0x1d0b0b16
DD 0x76dbdbad,0x76dbdbad
DD 0x3be0e0db,0x3be0e0db
DD 0x56323264,0x56323264
DD 0x4e3a3a74,0x4e3a3a74
DD 0x1e0a0a14,0x1e0a0a14
DD 0xdb494992,0xdb494992
DD 0x0a06060c,0x0a06060c
DD 0x6c242448,0x6c242448
DD 0xe45c5cb8,0xe45c5cb8
DD 0x5dc2c29f,0x5dc2c29f
DD 0x6ed3d3bd,0x6ed3d3bd
DD 0xefacac43,0xefacac43
DD 0xa66262c4,0xa66262c4
DD 0xa8919139,0xa8919139
DD 0xa4959531,0xa4959531
DD 0x37e4e4d3,0x37e4e4d3
DD 0x8b7979f2,0x8b7979f2
DD 0x32e7e7d5,0x32e7e7d5
DD 0x43c8c88b,0x43c8c88b
DD 0x5937376e,0x5937376e
DD 0xb76d6dda,0xb76d6dda
DD 0x8c8d8d01,0x8c8d8d01
DD 0x64d5d5b1,0x64d5d5b1
DD 0xd24e4e9c,0xd24e4e9c
DD 0xe0a9a949,0xe0a9a949
DD 0xb46c6cd8,0xb46c6cd8
DD 0xfa5656ac,0xfa5656ac
DD 0x07f4f4f3,0x07f4f4f3
DD 0x25eaeacf,0x25eaeacf
DD 0xaf6565ca,0xaf6565ca
DD 0x8e7a7af4,0x8e7a7af4
DD 0xe9aeae47,0xe9aeae47
DD 0x18080810,0x18080810
DD 0xd5baba6f,0xd5baba6f
DD 0x887878f0,0x887878f0
DD 0x6f25254a,0x6f25254a
DD 0x722e2e5c,0x722e2e5c
DD 0x241c1c38,0x241c1c38
DD 0xf1a6a657,0xf1a6a657
DD 0xc7b4b473,0xc7b4b473
DD 0x51c6c697,0x51c6c697
DD 0x23e8e8cb,0x23e8e8cb
DD 0x7cdddda1,0x7cdddda1
DD 0x9c7474e8,0x9c7474e8
DD 0x211f1f3e,0x211f1f3e
DD 0xdd4b4b96,0xdd4b4b96
DD 0xdcbdbd61,0xdcbdbd61
DD 0x868b8b0d,0x868b8b0d
DD 0x858a8a0f,0x858a8a0f
DD 0x907070e0,0x907070e0
DD 0x423e3e7c,0x423e3e7c
DD 0xc4b5b571,0xc4b5b571
DD 0xaa6666cc,0xaa6666cc
DD 0xd8484890,0xd8484890
DD 0x05030306,0x05030306
DD 0x01f6f6f7,0x01f6f6f7
DD 0x120e0e1c,0x120e0e1c
DD 0xa36161c2,0xa36161c2
DD 0x5f35356a,0x5f35356a
DD 0xf95757ae,0xf95757ae
DD 0xd0b9b969,0xd0b9b969
DD 0x91868617,0x91868617
DD 0x58c1c199,0x58c1c199
DD 0x271d1d3a,0x271d1d3a
DD 0xb99e9e27,0xb99e9e27
DD 0x38e1e1d9,0x38e1e1d9
DD 0x13f8f8eb,0x13f8f8eb
DD 0xb398982b,0xb398982b
DD 0x33111122,0x33111122
DD 0xbb6969d2,0xbb6969d2
DD 0x70d9d9a9,0x70d9d9a9
DD 0x898e8e07,0x898e8e07
DD 0xa7949433,0xa7949433
DD 0xb69b9b2d,0xb69b9b2d
DD 0x221e1e3c,0x221e1e3c
DD 0x92878715,0x92878715
DD 0x20e9e9c9,0x20e9e9c9
DD 0x49cece87,0x49cece87
DD 0xff5555aa,0xff5555aa
DD 0x78282850,0x78282850
DD 0x7adfdfa5,0x7adfdfa5
DD 0x8f8c8c03,0x8f8c8c03
DD 0xf8a1a159,0xf8a1a159
DD 0x80898909,0x80898909
DD 0x170d0d1a,0x170d0d1a
DD 0xdabfbf65,0xdabfbf65
DD 0x31e6e6d7,0x31e6e6d7
DD 0xc6424284,0xc6424284
DD 0xb86868d0,0xb86868d0
DD 0xc3414182,0xc3414182
DD 0xb0999929,0xb0999929
DD 0x772d2d5a,0x772d2d5a
DD 0x110f0f1e,0x110f0f1e
DD 0xcbb0b07b,0xcbb0b07b
DD 0xfc5454a8,0xfc5454a8
DD 0xd6bbbb6d,0xd6bbbb6d
DD 0x3a16162c,0x3a16162c
DB 0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
DB 0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
DB 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
DB 0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
DB 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
DB 0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
DB 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
DB 0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
DB 0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
DB 0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
DB 0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
DB 0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
DB 0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
DB 0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
DB 0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
DB 0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
DB 0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
DB 0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
DB 0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
DB 0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
DB 0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
DB 0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
DB 0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
DB 0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
DB 0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
DB 0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
DB 0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
DB 0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
DB 0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
DB 0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
DB 0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
DB 0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
DB 0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
DB 0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
DB 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
DB 0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
DB 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
DB 0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
DB 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
DB 0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
DB 0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
DB 0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
DB 0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
DB 0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
DB 0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
DB 0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
DB 0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
DB 0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
DB 0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
DB 0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
DB 0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
DB 0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
DB 0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
DB 0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
DB 0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
DB 0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
DB 0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
DB 0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
DB 0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
DB 0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
DB 0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
DB 0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
DB 0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
DB 0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
DB 0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
DB 0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
DB 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
DB 0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
DB 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
DB 0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
DB 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
DB 0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
DB 0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
DB 0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
DB 0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
DB 0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
DB 0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
DB 0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
DB 0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
DB 0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
DB 0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
DB 0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
DB 0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
DB 0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
DB 0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
DB 0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
DB 0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
DB 0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
DB 0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
DB 0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
DB 0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
DB 0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
DB 0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
DB 0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
DB 0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
DB 0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
DB 0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
DB 0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
DB 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
DB 0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
DB 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
DB 0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
DB 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
DB 0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
DB 0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
DB 0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
DB 0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
DB 0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
DB 0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
DB 0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
DB 0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
DB 0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
DB 0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
DB 0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
DB 0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
DB 0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
DB 0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
DB 0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
DB 0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
DB 0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
DB 0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
DB 0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
DB 0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
DB 0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
DB 0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
DB 0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
DB 0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
DB 0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
DD 0x00000001,0x00000002,0x00000004,0x00000008
DD 0x00000010,0x00000020,0x00000040,0x00000080
DD 0x0000001b,0x00000036,0x80808080,0x80808080
DD 0xfefefefe,0xfefefefe,0x1b1b1b1b,0x1b1b1b1b
ALIGN 64
$L$AES_Td:
DD 0x50a7f451,0x50a7f451
DD 0x5365417e,0x5365417e
DD 0xc3a4171a,0xc3a4171a
DD 0x965e273a,0x965e273a
DD 0xcb6bab3b,0xcb6bab3b
DD 0xf1459d1f,0xf1459d1f
DD 0xab58faac,0xab58faac
DD 0x9303e34b,0x9303e34b
DD 0x55fa3020,0x55fa3020
DD 0xf66d76ad,0xf66d76ad
DD 0x9176cc88,0x9176cc88
DD 0x254c02f5,0x254c02f5
DD 0xfcd7e54f,0xfcd7e54f
DD 0xd7cb2ac5,0xd7cb2ac5
DD 0x80443526,0x80443526
DD 0x8fa362b5,0x8fa362b5
DD 0x495ab1de,0x495ab1de
DD 0x671bba25,0x671bba25
DD 0x980eea45,0x980eea45
DD 0xe1c0fe5d,0xe1c0fe5d
DD 0x02752fc3,0x02752fc3
DD 0x12f04c81,0x12f04c81
DD 0xa397468d,0xa397468d
DD 0xc6f9d36b,0xc6f9d36b
DD 0xe75f8f03,0xe75f8f03
DD 0x959c9215,0x959c9215
DD 0xeb7a6dbf,0xeb7a6dbf
DD 0xda595295,0xda595295
DD 0x2d83bed4,0x2d83bed4
DD 0xd3217458,0xd3217458
DD 0x2969e049,0x2969e049
DD 0x44c8c98e,0x44c8c98e
DD 0x6a89c275,0x6a89c275
DD 0x78798ef4,0x78798ef4
DD 0x6b3e5899,0x6b3e5899
DD 0xdd71b927,0xdd71b927
DD 0xb64fe1be,0xb64fe1be
DD 0x17ad88f0,0x17ad88f0
DD 0x66ac20c9,0x66ac20c9
DD 0xb43ace7d,0xb43ace7d
DD 0x184adf63,0x184adf63
DD 0x82311ae5,0x82311ae5
DD 0x60335197,0x60335197
DD 0x457f5362,0x457f5362
DD 0xe07764b1,0xe07764b1
DD 0x84ae6bbb,0x84ae6bbb
DD 0x1ca081fe,0x1ca081fe
DD 0x942b08f9,0x942b08f9
DD 0x58684870,0x58684870
DD 0x19fd458f,0x19fd458f
DD 0x876cde94,0x876cde94
DD 0xb7f87b52,0xb7f87b52
DD 0x23d373ab,0x23d373ab
DD 0xe2024b72,0xe2024b72
DD 0x578f1fe3,0x578f1fe3
DD 0x2aab5566,0x2aab5566
DD 0x0728ebb2,0x0728ebb2
DD 0x03c2b52f,0x03c2b52f
DD 0x9a7bc586,0x9a7bc586
DD 0xa50837d3,0xa50837d3
DD 0xf2872830,0xf2872830
DD 0xb2a5bf23,0xb2a5bf23
DD 0xba6a0302,0xba6a0302
DD 0x5c8216ed,0x5c8216ed
DD 0x2b1ccf8a,0x2b1ccf8a
DD 0x92b479a7,0x92b479a7
DD 0xf0f207f3,0xf0f207f3
DD 0xa1e2694e,0xa1e2694e
DD 0xcdf4da65,0xcdf4da65
DD 0xd5be0506,0xd5be0506
DD 0x1f6234d1,0x1f6234d1
DD 0x8afea6c4,0x8afea6c4
DD 0x9d532e34,0x9d532e34
DD 0xa055f3a2,0xa055f3a2
DD 0x32e18a05,0x32e18a05
DD 0x75ebf6a4,0x75ebf6a4
DD 0x39ec830b,0x39ec830b
DD 0xaaef6040,0xaaef6040
DD 0x069f715e,0x069f715e
DD 0x51106ebd,0x51106ebd
DD 0xf98a213e,0xf98a213e
DD 0x3d06dd96,0x3d06dd96
DD 0xae053edd,0xae053edd
DD 0x46bde64d,0x46bde64d
DD 0xb58d5491,0xb58d5491
DD 0x055dc471,0x055dc471
DD 0x6fd40604,0x6fd40604
DD 0xff155060,0xff155060
DD 0x24fb9819,0x24fb9819
DD 0x97e9bdd6,0x97e9bdd6
DD 0xcc434089,0xcc434089
DD 0x779ed967,0x779ed967
DD 0xbd42e8b0,0xbd42e8b0
DD 0x888b8907,0x888b8907
DD 0x385b19e7,0x385b19e7
DD 0xdbeec879,0xdbeec879
DD 0x470a7ca1,0x470a7ca1
DD 0xe90f427c,0xe90f427c
DD 0xc91e84f8,0xc91e84f8
DD 0x00000000,0x00000000
DD 0x83868009,0x83868009
DD 0x48ed2b32,0x48ed2b32
DD 0xac70111e,0xac70111e
DD 0x4e725a6c,0x4e725a6c
DD 0xfbff0efd,0xfbff0efd
DD 0x5638850f,0x5638850f
DD 0x1ed5ae3d,0x1ed5ae3d
DD 0x27392d36,0x27392d36
DD 0x64d90f0a,0x64d90f0a
DD 0x21a65c68,0x21a65c68
DD 0xd1545b9b,0xd1545b9b
DD 0x3a2e3624,0x3a2e3624
DD 0xb1670a0c,0xb1670a0c
DD 0x0fe75793,0x0fe75793
DD 0xd296eeb4,0xd296eeb4
DD 0x9e919b1b,0x9e919b1b
DD 0x4fc5c080,0x4fc5c080
DD 0xa220dc61,0xa220dc61
DD 0x694b775a,0x694b775a
DD 0x161a121c,0x161a121c
DD 0x0aba93e2,0x0aba93e2
DD 0xe52aa0c0,0xe52aa0c0
DD 0x43e0223c,0x43e0223c
DD 0x1d171b12,0x1d171b12
DD 0x0b0d090e,0x0b0d090e
DD 0xadc78bf2,0xadc78bf2
DD 0xb9a8b62d,0xb9a8b62d
DD 0xc8a91e14,0xc8a91e14
DD 0x8519f157,0x8519f157
DD 0x4c0775af,0x4c0775af
DD 0xbbdd99ee,0xbbdd99ee
DD 0xfd607fa3,0xfd607fa3
DD 0x9f2601f7,0x9f2601f7
DD 0xbcf5725c,0xbcf5725c
DD 0xc53b6644,0xc53b6644
DD 0x347efb5b,0x347efb5b
DD 0x7629438b,0x7629438b
DD 0xdcc623cb,0xdcc623cb
DD 0x68fcedb6,0x68fcedb6
DD 0x63f1e4b8,0x63f1e4b8
DD 0xcadc31d7,0xcadc31d7
DD 0x10856342,0x10856342
DD 0x40229713,0x40229713
DD 0x2011c684,0x2011c684
DD 0x7d244a85,0x7d244a85
DD 0xf83dbbd2,0xf83dbbd2
DD 0x1132f9ae,0x1132f9ae
DD 0x6da129c7,0x6da129c7
DD 0x4b2f9e1d,0x4b2f9e1d
DD 0xf330b2dc,0xf330b2dc
DD 0xec52860d,0xec52860d
DD 0xd0e3c177,0xd0e3c177
DD 0x6c16b32b,0x6c16b32b
DD 0x99b970a9,0x99b970a9
DD 0xfa489411,0xfa489411
DD 0x2264e947,0x2264e947
DD 0xc48cfca8,0xc48cfca8
DD 0x1a3ff0a0,0x1a3ff0a0
DD 0xd82c7d56,0xd82c7d56
DD 0xef903322,0xef903322
DD 0xc74e4987,0xc74e4987
DD 0xc1d138d9,0xc1d138d9
DD 0xfea2ca8c,0xfea2ca8c
DD 0x360bd498,0x360bd498
DD 0xcf81f5a6,0xcf81f5a6
DD 0x28de7aa5,0x28de7aa5
DD 0x268eb7da,0x268eb7da
DD 0xa4bfad3f,0xa4bfad3f
DD 0xe49d3a2c,0xe49d3a2c
DD 0x0d927850,0x0d927850
DD 0x9bcc5f6a,0x9bcc5f6a
DD 0x62467e54,0x62467e54
DD 0xc2138df6,0xc2138df6
DD 0xe8b8d890,0xe8b8d890
DD 0x5ef7392e,0x5ef7392e
DD 0xf5afc382,0xf5afc382
DD 0xbe805d9f,0xbe805d9f
DD 0x7c93d069,0x7c93d069
DD 0xa92dd56f,0xa92dd56f
DD 0xb31225cf,0xb31225cf
DD 0x3b99acc8,0x3b99acc8
DD 0xa77d1810,0xa77d1810
DD 0x6e639ce8,0x6e639ce8
DD 0x7bbb3bdb,0x7bbb3bdb
DD 0x097826cd,0x097826cd
DD 0xf418596e,0xf418596e
DD 0x01b79aec,0x01b79aec
DD 0xa89a4f83,0xa89a4f83
DD 0x656e95e6,0x656e95e6
DD 0x7ee6ffaa,0x7ee6ffaa
DD 0x08cfbc21,0x08cfbc21
DD 0xe6e815ef,0xe6e815ef
DD 0xd99be7ba,0xd99be7ba
DD 0xce366f4a,0xce366f4a
DD 0xd4099fea,0xd4099fea
DD 0xd67cb029,0xd67cb029
DD 0xafb2a431,0xafb2a431
DD 0x31233f2a,0x31233f2a
DD 0x3094a5c6,0x3094a5c6
DD 0xc066a235,0xc066a235
DD 0x37bc4e74,0x37bc4e74
DD 0xa6ca82fc,0xa6ca82fc
DD 0xb0d090e0,0xb0d090e0
DD 0x15d8a733,0x15d8a733
DD 0x4a9804f1,0x4a9804f1
DD 0xf7daec41,0xf7daec41
DD 0x0e50cd7f,0x0e50cd7f
DD 0x2ff69117,0x2ff69117
DD 0x8dd64d76,0x8dd64d76
DD 0x4db0ef43,0x4db0ef43
DD 0x544daacc,0x544daacc
DD 0xdf0496e4,0xdf0496e4
DD 0xe3b5d19e,0xe3b5d19e
DD 0x1b886a4c,0x1b886a4c
DD 0xb81f2cc1,0xb81f2cc1
DD 0x7f516546,0x7f516546
DD 0x04ea5e9d,0x04ea5e9d
DD 0x5d358c01,0x5d358c01
DD 0x737487fa,0x737487fa
DD 0x2e410bfb,0x2e410bfb
DD 0x5a1d67b3,0x5a1d67b3
DD 0x52d2db92,0x52d2db92
DD 0x335610e9,0x335610e9
DD 0x1347d66d,0x1347d66d
DD 0x8c61d79a,0x8c61d79a
DD 0x7a0ca137,0x7a0ca137
DD 0x8e14f859,0x8e14f859
DD 0x893c13eb,0x893c13eb
DD 0xee27a9ce,0xee27a9ce
DD 0x35c961b7,0x35c961b7
DD 0xede51ce1,0xede51ce1
DD 0x3cb1477a,0x3cb1477a
DD 0x59dfd29c,0x59dfd29c
DD 0x3f73f255,0x3f73f255
DD 0x79ce1418,0x79ce1418
DD 0xbf37c773,0xbf37c773
DD 0xeacdf753,0xeacdf753
DD 0x5baafd5f,0x5baafd5f
DD 0x146f3ddf,0x146f3ddf
DD 0x86db4478,0x86db4478
DD 0x81f3afca,0x81f3afca
DD 0x3ec468b9,0x3ec468b9
DD 0x2c342438,0x2c342438
DD 0x5f40a3c2,0x5f40a3c2
DD 0x72c31d16,0x72c31d16
DD 0x0c25e2bc,0x0c25e2bc
DD 0x8b493c28,0x8b493c28
DD 0x41950dff,0x41950dff
DD 0x7101a839,0x7101a839
DD 0xdeb30c08,0xdeb30c08
DD 0x9ce4b4d8,0x9ce4b4d8
DD 0x90c15664,0x90c15664
DD 0x6184cb7b,0x6184cb7b
DD 0x70b632d5,0x70b632d5
DD 0x745c6c48,0x745c6c48
DD 0x4257b8d0,0x4257b8d0
DB 0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
DB 0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
DB 0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
DB 0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
DB 0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
DB 0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
DB 0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
DB 0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
DB 0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
DB 0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
DB 0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
DB 0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
DB 0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
DB 0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
DB 0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
DB 0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
DB 0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
DB 0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
DB 0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
DB 0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
DB 0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
DB 0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
DB 0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
DB 0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
DB 0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
DB 0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
DB 0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
DB 0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
DB 0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
DB 0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
DB 0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
DB 0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
DD 0x80808080,0x80808080,0xfefefefe,0xfefefefe
DD 0x1b1b1b1b,0x1b1b1b1b,0,0
DB 0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
DB 0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
DB 0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
DB 0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
DB 0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
DB 0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
DB 0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
DB 0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
DB 0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
DB 0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
DB 0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
DB 0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
DB 0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
DB 0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
DB 0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
DB 0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
DB 0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
DB 0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
DB 0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
DB 0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
DB 0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
DB 0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
DB 0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
DB 0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
DB 0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
DB 0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
DB 0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
DB 0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
DB 0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
DB 0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
DB 0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
DB 0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
DD 0x80808080,0x80808080,0xfefefefe,0xfefefefe
DD 0x1b1b1b1b,0x1b1b1b1b,0,0
DB 0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
DB 0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
DB 0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
DB 0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
DB 0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
DB 0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
DB 0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
DB 0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
DB 0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
DB 0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
DB 0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
DB 0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
DB 0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
DB 0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
DB 0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
DB 0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
DB 0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
DB 0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
DB 0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
DB 0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
DB 0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
DB 0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
DB 0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
DB 0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
DB 0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
DB 0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
DB 0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
DB 0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
DB 0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
DB 0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
DB 0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
DB 0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
DD 0x80808080,0x80808080,0xfefefefe,0xfefefefe
DD 0x1b1b1b1b,0x1b1b1b1b,0,0
DB 0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
DB 0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
DB 0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
DB 0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
DB 0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
DB 0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
DB 0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
DB 0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
DB 0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
DB 0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
DB 0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
DB 0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
DB 0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
DB 0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
DB 0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
DB 0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
DB 0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
DB 0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
DB 0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
DB 0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
DB 0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
DB 0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
DB 0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
DB 0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
DB 0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
DB 0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
DB 0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
DB 0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
DB 0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
DB 0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
DB 0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
DB 0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
DD 0x80808080,0x80808080,0xfefefefe,0xfefefefe
DD 0x1b1b1b1b,0x1b1b1b1b,0,0
DB 65,69,83,32,102,111,114,32,120,56,54,95,54,52,44,32
DB 67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97
DB 112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103
DB 62,0
ALIGN 64
EXTERN __imp_RtlVirtualUnwind
ALIGN 16
block_se_handler:
push rsi
push rdi
push rbx
push rbp
push r12
push r13
push r14
push r15
pushfq
sub rsp,64
mov rax,QWORD[120+r8]
mov rbx,QWORD[248+r8]
mov rsi,QWORD[8+r9]
mov r11,QWORD[56+r9]
mov r10d,DWORD[r11]
lea r10,[r10*1+rsi]
cmp rbx,r10
jb NEAR $L$in_block_prologue
mov rax,QWORD[152+r8]
mov r10d,DWORD[4+r11]
lea r10,[r10*1+rsi]
cmp rbx,r10
jae NEAR $L$in_block_prologue
mov rax,QWORD[24+rax]
mov rbx,QWORD[((-8))+rax]
mov rbp,QWORD[((-16))+rax]
mov r12,QWORD[((-24))+rax]
mov r13,QWORD[((-32))+rax]
mov r14,QWORD[((-40))+rax]
mov r15,QWORD[((-48))+rax]
mov QWORD[144+r8],rbx
mov QWORD[160+r8],rbp
mov QWORD[216+r8],r12
mov QWORD[224+r8],r13
mov QWORD[232+r8],r14
mov QWORD[240+r8],r15
$L$in_block_prologue:
mov rdi,QWORD[8+rax]
mov rsi,QWORD[16+rax]
mov QWORD[152+r8],rax
mov QWORD[168+r8],rsi
mov QWORD[176+r8],rdi
jmp NEAR $L$common_seh_exit
ALIGN 16
key_se_handler:
push rsi
push rdi
push rbx
push rbp
push r12
push r13
push r14
push r15
pushfq
sub rsp,64
mov rax,QWORD[120+r8]
mov rbx,QWORD[248+r8]
mov rsi,QWORD[8+r9]
mov r11,QWORD[56+r9]
mov r10d,DWORD[r11]
lea r10,[r10*1+rsi]
cmp rbx,r10
jb NEAR $L$in_key_prologue
mov rax,QWORD[152+r8]
mov r10d,DWORD[4+r11]
lea r10,[r10*1+rsi]
cmp rbx,r10
jae NEAR $L$in_key_prologue
lea rax,[56+rax]
mov rbx,QWORD[((-8))+rax]
mov rbp,QWORD[((-16))+rax]
mov r12,QWORD[((-24))+rax]
mov r13,QWORD[((-32))+rax]
mov r14,QWORD[((-40))+rax]
mov r15,QWORD[((-48))+rax]
mov QWORD[144+r8],rbx
mov QWORD[160+r8],rbp
mov QWORD[216+r8],r12
mov QWORD[224+r8],r13
mov QWORD[232+r8],r14
mov QWORD[240+r8],r15
$L$in_key_prologue:
mov rdi,QWORD[8+rax]
mov rsi,QWORD[16+rax]
mov QWORD[152+r8],rax
mov QWORD[168+r8],rsi
mov QWORD[176+r8],rdi
jmp NEAR $L$common_seh_exit
ALIGN 16
cbc_se_handler:
push rsi
push rdi
push rbx
push rbp
push r12
push r13
push r14
push r15
pushfq
sub rsp,64
mov rax,QWORD[120+r8]
mov rbx,QWORD[248+r8]
lea r10,[$L$cbc_prologue]
cmp rbx,r10
jb NEAR $L$in_cbc_prologue
lea r10,[$L$cbc_fast_body]
cmp rbx,r10
jb NEAR $L$in_cbc_frame_setup
lea r10,[$L$cbc_slow_prologue]
cmp rbx,r10
jb NEAR $L$in_cbc_body
lea r10,[$L$cbc_slow_body]
cmp rbx,r10
jb NEAR $L$in_cbc_frame_setup
$L$in_cbc_body:
mov rax,QWORD[152+r8]
lea r10,[$L$cbc_epilogue]
cmp rbx,r10
jae NEAR $L$in_cbc_prologue
lea rax,[8+rax]
lea r10,[$L$cbc_popfq]
cmp rbx,r10
jae NEAR $L$in_cbc_prologue
mov rax,QWORD[8+rax]
lea rax,[56+rax]
$L$in_cbc_frame_setup:
mov rbx,QWORD[((-16))+rax]
mov rbp,QWORD[((-24))+rax]
mov r12,QWORD[((-32))+rax]
mov r13,QWORD[((-40))+rax]
mov r14,QWORD[((-48))+rax]
mov r15,QWORD[((-56))+rax]
mov QWORD[144+r8],rbx
mov QWORD[160+r8],rbp
mov QWORD[216+r8],r12
mov QWORD[224+r8],r13
mov QWORD[232+r8],r14
mov QWORD[240+r8],r15
$L$in_cbc_prologue:
mov rdi,QWORD[8+rax]
mov rsi,QWORD[16+rax]
mov QWORD[152+r8],rax
mov QWORD[168+r8],rsi
mov QWORD[176+r8],rdi
$L$common_seh_exit:
mov rdi,QWORD[40+r9]
mov rsi,r8
mov ecx,154
DD 0xa548f3fc
mov rsi,r9
xor rcx,rcx
mov rdx,QWORD[8+rsi]
mov r8,QWORD[rsi]
mov r9,QWORD[16+rsi]
mov r10,QWORD[40+rsi]
lea r11,[56+rsi]
lea r12,[24+rsi]
mov QWORD[32+rsp],r10
mov QWORD[40+rsp],r11
mov QWORD[48+rsp],r12
mov QWORD[56+rsp],rcx
call QWORD[__imp_RtlVirtualUnwind]
mov eax,1
add rsp,64
popfq
pop r15
pop r14
pop r13
pop r12
pop rbp
pop rbx
pop rdi
pop rsi
DB 0F3h,0C3h ;repret
section .pdata rdata align=4
ALIGN 4
DD $L$SEH_begin_AES_encrypt wrt ..imagebase
DD $L$SEH_end_AES_encrypt wrt ..imagebase
DD $L$SEH_info_AES_encrypt wrt ..imagebase
DD $L$SEH_begin_AES_decrypt wrt ..imagebase
DD $L$SEH_end_AES_decrypt wrt ..imagebase
DD $L$SEH_info_AES_decrypt wrt ..imagebase
DD $L$SEH_begin_AES_set_encrypt_key wrt ..imagebase
DD $L$SEH_end_AES_set_encrypt_key wrt ..imagebase
DD $L$SEH_info_AES_set_encrypt_key wrt ..imagebase
DD $L$SEH_begin_AES_set_decrypt_key wrt ..imagebase
DD $L$SEH_end_AES_set_decrypt_key wrt ..imagebase
DD $L$SEH_info_AES_set_decrypt_key wrt ..imagebase
DD $L$SEH_begin_AES_cbc_encrypt wrt ..imagebase
DD $L$SEH_end_AES_cbc_encrypt wrt ..imagebase
DD $L$SEH_info_AES_cbc_encrypt wrt ..imagebase
section .xdata rdata align=8
ALIGN 8
$L$SEH_info_AES_encrypt:
DB 9,0,0,0
DD block_se_handler wrt ..imagebase
DD $L$enc_prologue wrt ..imagebase,$L$enc_epilogue wrt ..imagebase
$L$SEH_info_AES_decrypt:
DB 9,0,0,0
DD block_se_handler wrt ..imagebase
DD $L$dec_prologue wrt ..imagebase,$L$dec_epilogue wrt ..imagebase
$L$SEH_info_AES_set_encrypt_key:
DB 9,0,0,0
DD key_se_handler wrt ..imagebase
DD $L$enc_key_prologue wrt ..imagebase,$L$enc_key_epilogue wrt ..imagebase
$L$SEH_info_AES_set_decrypt_key:
DB 9,0,0,0
DD key_se_handler wrt ..imagebase
DD $L$dec_key_prologue wrt ..imagebase,$L$dec_key_epilogue wrt ..imagebase
$L$SEH_info_AES_cbc_encrypt:
DB 9,0,0,0
DD cbc_se_handler wrt ..imagebase
| 19.802357
| 75
| 0.746417
|
5c2e981891710536d0b2619a7ad4db96e4416b66
| 315
|
asm
|
Assembly
|
libsrc/spectrum/display/zx_saddr2px.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/spectrum/display/zx_saddr2px.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/spectrum/display/zx_saddr2px.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
; uint zx_saddr2px(void *pixeladdr, uchar mask)
; CALLER linkage for function pointers
PUBLIC zx_saddr2px
EXTERN zx_saddr2px_callee
EXTERN ASMDISP_ZX_SADDR2PX_CALLEE
.zx_saddr2px
pop af
pop de
pop hl
push hl
push de
push af
ld a,e
jp zx_saddr2px_callee + ASMDISP_ZX_SADDR2PX_CALLEE
| 15
| 53
| 0.749206
|
9bd2d85bfc4b0806354897a5f9189df103558834
| 1,072
|
asm
|
Assembly
|
A1P5.asm
|
ILZM/mips_examples
|
eddd38d1721756c6aa7b916b434a7980a2b3e2d5
|
[
"Unlicense"
] | null | null | null |
A1P5.asm
|
ILZM/mips_examples
|
eddd38d1721756c6aa7b916b434a7980a2b3e2d5
|
[
"Unlicense"
] | null | null | null |
A1P5.asm
|
ILZM/mips_examples
|
eddd38d1721756c6aa7b916b434a7980a2b3e2d5
|
[
"Unlicense"
] | null | null | null |
# The solution code on Java
# int length = array.size ( );
# for ( int i = 0; i < length - 1; i++ )
# {
# for ( int j = length - 2; j >= 0; j-- )
# {
# if ( array [ j ] % 2 != 0 && array [ j+1 ] % 2 == 0 )
# {
# int temp = array [ j+1 ];
# array [ j+1 ] = array [ j ];
# array [ j ] = temp;
# }
# }
# }
.data
array: .word 8 2 3 12 31 32 3 2 1
length: .word 9
# 2 4 6 8 10 1 3 5 7 9
.text
la $s0, length
lw $v0, 0($s0) # length = array.size
li $a0, 0 # i = 0
li $s4, 0
addi $v1, $v0, -1 # length - 1
loopI:
addi $s2, $s0, -8 # prepare the adress array [ length - 2 ]
addi $a1, $v0, -2 # j = length - 2
loopJ:
lw $t0, 0($s2) # load array [ j ]
lw $t1, 4($s2) # load array [ j + 1 ]
andi $s3, $t0, 1 # check for parity of array [ j ]
beqz $s3, skipSwap
andi $s3, $t1, 1 # check for parity of array [ j + 1 ]
bnez $s3, skipSwap
sw $t1, 0($s2)
sw $t0, 4($s2)
skipSwap:
addi $s2, $s2, -4 # array [ j-- ]
addi $a1, $a1, -1 # j-
sle $s3, $s4, $a1 # ?
bnez $s3, loopJ
addi $a0, $a0, 1 # i++
slt $s3, $a0, $v1 # ?
bnez $s3, loopI
| 20.615385
| 60
| 0.491604
|
aebdb9b125e65bbba2e3d2925099ad9bc751ce26
| 134
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/stdlib/c/sdcc_iy/ftog.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/stdlib/c/sdcc_iy/ftog.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/stdlib/c/sdcc_iy/ftog.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
; size_t ftog(float x, char *buf, uint16_t prec, uint16_t flag)
SECTION code_stdlib
PUBLIC _ftog
EXTERN _dtog
defc _ftog = _dtog
| 12.181818
| 63
| 0.753731
|
601b4982023c6f9df5d9371be1405e193a6daa1c
| 4,610
|
asm
|
Assembly
|
audio.asm
|
genterz/pokecross
|
5e62ab6c23e624ea82d599af306f9c52d768a8b4
|
[
"blessing"
] | 28
|
2019-11-08T07:19:00.000Z
|
2021-12-20T10:17:54.000Z
|
audio.asm
|
genterz/pokecross
|
5e62ab6c23e624ea82d599af306f9c52d768a8b4
|
[
"blessing"
] | 13
|
2020-01-11T17:00:40.000Z
|
2021-09-14T01:27:38.000Z
|
audio.asm
|
genterz/pokecross
|
5e62ab6c23e624ea82d599af306f9c52d768a8b4
|
[
"blessing"
] | 22
|
2020-05-28T17:31:38.000Z
|
2022-03-07T20:49:35.000Z
|
INCLUDE "constants.asm"
SECTION "Audio", ROMX
INCLUDE "audio/engine.asm"
INCLUDE "data/trainers/encounter_music.asm"
INCLUDE "audio/music_pointers.asm"
INCLUDE "audio/music/nothing.asm"
INCLUDE "audio/cry_pointers.asm"
INCLUDE "audio/sfx_pointers.asm"
SECTION "Songs 1", ROMX
INCLUDE "audio/music/route36.asm"
INCLUDE "audio/music/rivalbattle.asm"
INCLUDE "audio/music/rocketbattle.asm"
INCLUDE "audio/music/elmslab.asm"
INCLUDE "audio/music/darkcave.asm"
INCLUDE "audio/music/johtogymbattle.asm"
INCLUDE "audio/music/championbattle.asm"
INCLUDE "audio/music/ssaqua.asm"
INCLUDE "audio/music/newbarktown.asm"
INCLUDE "audio/music/goldenrodcity.asm"
INCLUDE "audio/music/vermilioncity.asm"
INCLUDE "audio/music/titlescreen.asm"
INCLUDE "audio/music/ruinsofalphinterior.asm"
INCLUDE "audio/music/lookpokemaniac.asm"
INCLUDE "audio/music/trainervictory.asm"
SECTION "Songs 2", ROMX
INCLUDE "audio/music/route1.asm"
INCLUDE "audio/music/route3.asm"
INCLUDE "audio/music/route12.asm"
INCLUDE "audio/music/kantogymbattle.asm"
INCLUDE "audio/music/kantotrainerbattle.asm"
INCLUDE "audio/music/kantowildbattle.asm"
INCLUDE "audio/music/pokemoncenter.asm"
INCLUDE "audio/music/looklass.asm"
INCLUDE "audio/music/lookofficer.asm"
INCLUDE "audio/music/route2.asm"
INCLUDE "audio/music/mtmoon.asm"
INCLUDE "audio/music/showmearound.asm"
INCLUDE "audio/music/gamecorner.asm"
INCLUDE "audio/music/bicycle.asm"
INCLUDE "audio/music/looksage.asm"
INCLUDE "audio/music/pokemonchannel.asm"
INCLUDE "audio/music/lighthouse.asm"
INCLUDE "audio/music/lakeofrage.asm"
INCLUDE "audio/music/indigoplateau.asm"
INCLUDE "audio/music/route37.asm"
INCLUDE "audio/music/rockethideout.asm"
INCLUDE "audio/music/dragonsden.asm"
INCLUDE "audio/music/ruinsofalphradio.asm"
INCLUDE "audio/music/lookbeauty.asm"
INCLUDE "audio/music/route26.asm"
INCLUDE "audio/music/ecruteakcity.asm"
INCLUDE "audio/music/lakeofragerocketradio.asm"
INCLUDE "audio/music/magnettrain.asm"
INCLUDE "audio/music/lavendertown.asm"
INCLUDE "audio/music/dancinghall.asm"
INCLUDE "audio/music/contestresults.asm"
INCLUDE "audio/music/route30.asm"
SECTION "Songs 3", ROMX
INCLUDE "audio/music/violetcity.asm"
INCLUDE "audio/music/route29.asm"
INCLUDE "audio/music/halloffame.asm"
INCLUDE "audio/music/healpokemon.asm"
INCLUDE "audio/music/evolution.asm"
INCLUDE "audio/music/printer.asm"
SECTION "Songs 4", ROMX
INCLUDE "audio/music/viridiancity.asm"
INCLUDE "audio/music/celadoncity.asm"
INCLUDE "audio/music/wildpokemonvictory.asm"
INCLUDE "audio/music/successfulcapture.asm"
INCLUDE "audio/music/gymleadervictory.asm"
INCLUDE "audio/music/mtmoonsquare.asm"
INCLUDE "audio/music/gym.asm"
INCLUDE "audio/music/pallettown.asm"
INCLUDE "audio/music/profoakspokemontalk.asm"
INCLUDE "audio/music/profoak.asm"
INCLUDE "audio/music/lookrival.asm"
INCLUDE "audio/music/aftertherivalfight.asm"
INCLUDE "audio/music/surf.asm"
INCLUDE "audio/music/nationalpark.asm"
INCLUDE "audio/music/azaleatown.asm"
INCLUDE "audio/music/cherrygrovecity.asm"
INCLUDE "audio/music/unioncave.asm"
INCLUDE "audio/music/johtowildbattle.asm"
INCLUDE "audio/music/johtowildbattlenight.asm"
INCLUDE "audio/music/johtotrainerbattle.asm"
INCLUDE "audio/music/lookyoungster.asm"
INCLUDE "audio/music/tintower.asm"
INCLUDE "audio/music/sprouttower.asm"
INCLUDE "audio/music/burnedtower.asm"
INCLUDE "audio/music/mom.asm"
INCLUDE "audio/music/victoryroad.asm"
INCLUDE "audio/music/pokemonlullaby.asm"
INCLUDE "audio/music/pokemonmarch.asm"
INCLUDE "audio/music/goldsilveropening.asm"
INCLUDE "audio/music/goldsilveropening2.asm"
INCLUDE "audio/music/lookhiker.asm"
INCLUDE "audio/music/lookrocket.asm"
INCLUDE "audio/music/rockettheme.asm"
INCLUDE "audio/music/mainmenu.asm"
INCLUDE "audio/music/lookkimonogirl.asm"
INCLUDE "audio/music/pokeflutechannel.asm"
INCLUDE "audio/music/bugcatchingcontest.asm"
SECTION "Songs 5", ROMX
INCLUDE "audio/music/mobileadaptermenu.asm"
INCLUDE "audio/music/buenaspassword.asm"
INCLUDE "audio/music/lookmysticalman.asm"
INCLUDE "audio/music/crystalopening.asm"
INCLUDE "audio/music/battletowertheme.asm"
INCLUDE "audio/music/suicunebattle.asm"
INCLUDE "audio/music/battletowerlobby.asm"
INCLUDE "audio/music/mobilecenter.asm"
SECTION "Extra Songs 1", ROMX
INCLUDE "audio/music/credits.asm"
INCLUDE "audio/music/clair.asm"
INCLUDE "audio/music/mobileadapter.asm"
SECTION "Extra Songs 2", ROMX
INCLUDE "audio/music/postcredits.asm"
SECTION "Sound Effects", ROMX
INCLUDE "audio/sfx.asm"
SECTION "Crystal Sound Effects", ROMX
INCLUDE "audio/sfx_crystal.asm"
SECTION "Cries", ROMX
INCLUDE "data/pokemon/cries.asm"
INCLUDE "audio/cries.asm"
| 28.993711
| 47
| 0.806074
|
e332b15d5892a229aa8944c9c59f60fa808e93eb
| 881
|
asm
|
Assembly
|
programs/oeis/183/A183906.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/183/A183906.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/183/A183906.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A183906: Number of nondecreasing arrangements of n+2 numbers in 0..3 with each number being the sum mod 4 of two others.
; 2,5,17,38,67,105,153,212,283,367,465,578,707,853,1017,1200,1403,1627,1873,2142,2435,2753,3097,3468,3867,4295,4753,5242,5763,6317,6905,7528,8187,8883,9617,10390,11203,12057,12953,13892,14875,15903,16977,18098,19267,20485,21753,23072,24443,25867,27345,28878,30467,32113,33817,35580,37403,39287,41233,43242,45315,47453,49657,51928,54267,56675,59153,61702,64323,67017,69785,72628,75547,78543,81617,84770,88003,91317,94713,98192,101755,105403,109137,112958,116867,120865,124953,129132,133403,137767,142225,146778,151427,156173,161017,165960,171003,176147,181393,186742
mov $5,5
lpb $0
sub $0,1
add $2,4
add $1,$2
trn $3,$1
add $3,$2
sub $2,3
add $4,$1
trn $5,4
add $5,2
lpe
sub $1,$3
trn $1,1
add $5,$2
add $4,$5
add $1,$4
sub $1,3
mov $0,$1
| 38.304348
| 565
| 0.738933
|
58bf0a5c771f6bfd1924527f8f87cedb705ae383
| 281
|
asm
|
Assembly
|
unittests/32Bit_ASM/FEX_bugs/InlineSyscall.asm
|
fengjixuchui/FEX
|
287c65dc6414523ec74303c4b1d03123ae720d6b
|
[
"MIT"
] | null | null | null |
unittests/32Bit_ASM/FEX_bugs/InlineSyscall.asm
|
fengjixuchui/FEX
|
287c65dc6414523ec74303c4b1d03123ae720d6b
|
[
"MIT"
] | null | null | null |
unittests/32Bit_ASM/FEX_bugs/InlineSyscall.asm
|
fengjixuchui/FEX
|
287c65dc6414523ec74303c4b1d03123ae720d6b
|
[
"MIT"
] | null | null | null |
%ifdef CONFIG
{
"RegData": {
},
"Mode": "32BIT"
}
%endif
; FEX 32-bit inline syscalls hit an assert in uxtw
; Just use an inline syscall and throw it zero data to catch the assert
mov eax, 355 ; getrandom, is an inline syscall
mov ebx, 0
mov ecx, 0
mov edx, 0
int 0x80
hlt
| 15.611111
| 71
| 0.686833
|
6b3fe96abb6a71b1ce98f1baffb2705d998f305a
| 63
|
asm
|
Assembly
|
mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/xor16.asm
|
gb-archive/really-old-stuff
|
ffb39a518cad47e23353b3420b88e2f3521fd3d7
|
[
"Apache-2.0"
] | 10
|
2016-10-27T20:46:02.000Z
|
2021-11-01T15:49:13.000Z
|
mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/xor16.asm
|
gb-archive/really-old-stuff
|
ffb39a518cad47e23353b3420b88e2f3521fd3d7
|
[
"Apache-2.0"
] | null | null | null |
mastersystem/zxb-sms-2012-02-23/zxb-sms/wip/zxb/library-asm/xor16.asm
|
gb-archive/really-old-stuff
|
ffb39a518cad47e23353b3420b88e2f3521fd3d7
|
[
"Apache-2.0"
] | 2
|
2015-03-11T14:28:08.000Z
|
2017-11-02T10:57:57.000Z
|
; XOR16 implemented in XOR8.ASM file
#include once <xor8.asm>
| 15.75
| 36
| 0.746032
|
f639150b4a9deed6d9a623b160c8b4e40e0fb4d5
| 3,299
|
asm
|
Assembly
|
bessel_func1_old1.asm
|
rgimad/fasm_programs
|
f6739ea19d5a3cdc759d902971a889eda5e98e9a
|
[
"MIT"
] | 8
|
2021-03-23T05:24:56.000Z
|
2021-11-29T08:56:33.000Z
|
bessel_func1_old1.asm
|
rgimad/fasm_programs
|
f6739ea19d5a3cdc759d902971a889eda5e98e9a
|
[
"MIT"
] | null | null | null |
bessel_func1_old1.asm
|
rgimad/fasm_programs
|
f6739ea19d5a3cdc759d902971a889eda5e98e9a
|
[
"MIT"
] | 1
|
2021-09-18T07:26:29.000Z
|
2021-09-18T07:26:29.000Z
|
format PE64 Console 5.0
entry main
include 'C:\Program Files (x86)\fasmw17322\INCLUDE\win64a.inc'
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
section '.text' code readable executable
main:
; for printf, scanf etc. we use cinvoke (__cdecl), invoke is used for __stdcall functions
cinvoke printf, msg_enter_x
cinvoke scanf, x_read_fmt, x
mov [s], 0.0 ; for double values we must write .0 always.
mov rax, 1.0 ; 64bit mode allows only signed 32bit immediates. Only instruction that can take 64bit immediate is "mov rax, imm64"
mov [p], rax
mov [n], 0
while_1:
; check if abs(p) >= eps. if false break
movq xmm0, [p]
pslld xmm0, 1
psrld xmm0, 1
comisd xmm0, [eps]
jc while_1_end ; if abs(p) < eps then break
movq xmm1, [s]
addsd xmm1, [p]
movq [s], xmm1
inc [n]
cvtsi2sd xmm1, [n] ; convert int to double. ~ xmm1 = (double)n;
mulsd xmm1, xmm1 ; now xmm1 = n^2
mov rax, 4.0
movq xmm4, rax
mulsd xmm1, xmm4 ; now xmm1 = 4*(n^2)
movq xmm0, [x]
mulsd xmm0, xmm0 ; now xmm0 = x^2
mov rax, -1.0
movq xmm4, rax
mulsd xmm0, xmm4 ; now xmm0 = -(x^2)
movq xmm3, [p]
mulsd xmm3, xmm0
divsd xmm3, xmm1
movq [p], xmm3
jmp while_1
while_1_end:
;cinvoke printf, format1, 1337
;cinvoke printf, <'a = %s', 13, 10, 'b = %s', 13, 10>, 'apple', 'boy'
;cinvoke printf, "num = %x", 2227
;cinvoke printf, "var1 = %.11lf", [var1]
;movq xmm0, [var1] ; load from memory
;addsd xmm0, xmm0 ; *=2
;mulsd xmm0, xmm0
; 1st way to get absolute value of for example xmm0
;mov rax, 0
;movq xmm1, rax
;subsd xmm1, xmm0
;movq xmm0, xmm1
; 2nd way to get abs of xmm register
;pslld xmm0, 1
;psrld xmm0, 1
;movq [var1], xmm0
;cinvoke printf, " var1 = %.11lf", [var1]
;inc [n]
;inc [n]
;cvtsi2sd xmm1, [n]
;movq [p], xmm1
cinvoke printf, "J0(%f) = %f", [x], [s]
cinvoke getchar ; first getchar will read \n
cinvoke getchar
jmp main
;cinvoke system, cmd
Exit: ; exit from program
invoke ExitProcess, 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
section '.data' data readable writeable
; db - reserve byte, dw - reserve word, dd - reserve dword, dq - reserve qword
eps dq 0.000001 ; double eps = 0.000001; // epsilon
x dq ? ; double x; // x value
n dd ? ; int n; // step counter
s dq ? ; double s; // current sum
p dq ? ; double p; // current member of series
msg_enter_x db 'Enter x: ', 13, 10, 0
x_read_fmt db '%lf', 0
;cmd db 'mspaint.exe', 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;section '.bss' readable writeable ; statically-allocated variables that are not explicitly initialized to any value
; readBuf db ?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
section '.idata' import data readable
library msvcrt,'MSVCRT.DLL',\
kernel,'KERNEL32.DLL'
import kernel,\
ExitProcess, 'ExitProcess'
;SetConsoleTitleA, 'SetConsoleTitleA',\
;GetStdHandle, 'GetStdHandle',\
;WriteConsoleA, 'WriteConsoleA',\
;ReadConsoleA, 'ReadConsoleA'
import msvcrt,\
puts,'puts',\
scanf,'scanf',\
printf,'printf',\
getchar,'getchar',\
system,'system',\
exit,'exit'
| 24.080292
| 131
| 0.574416
|
007d6539e01fd05f9d07a373201d59a4840b9843
| 7,105
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xa0.log_21829_1236.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xa0.log_21829_1236.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_st_/i9-9900K_12_0xa0.log_21829_1236.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 %r8
push %r9
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x7d53, %rax
nop
nop
nop
nop
and $44747, %r8
mov $0x6162636465666768, %rcx
movq %rcx, %xmm2
vmovups %ymm2, (%rax)
nop
nop
nop
and %r9, %r9
lea addresses_normal_ht+0x18a8b, %r9
nop
nop
and $11477, %rdx
mov (%r9), %r11
nop
add %rax, %rax
lea addresses_WC_ht+0x2fd8, %r11
nop
nop
nop
nop
nop
sub %rdi, %rdi
mov (%r11), %r8
nop
nop
nop
nop
and %rax, %rax
lea addresses_UC_ht+0xdb7, %rdx
nop
cmp %rdi, %rdi
movb $0x61, (%rdx)
cmp $44446, %rcx
lea addresses_UC_ht+0xa40b, %rdx
nop
nop
nop
nop
and $64215, %r8
and $0xffffffffffffffc0, %rdx
vmovaps (%rdx), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $1, %xmm0, %rax
nop
add %rdi, %rdi
lea addresses_D_ht+0x13524, %rsi
lea addresses_UC_ht+0x1eab, %rdi
nop
nop
cmp $25815, %rdx
mov $77, %rcx
rep movsw
nop
nop
nop
nop
xor $9007, %rsi
lea addresses_UC_ht+0x5f8b, %rsi
lea addresses_A_ht+0xd38b, %rdi
nop
nop
sub %rdx, %rdx
mov $14, %rcx
rep movsl
nop
nop
nop
inc %rdi
lea addresses_normal_ht+0x348b, %rsi
lea addresses_A_ht+0x1488b, %rdi
nop
nop
nop
nop
and %r8, %r8
mov $68, %rcx
rep movsl
nop
nop
nop
nop
dec %r9
lea addresses_WT_ht+0x14a7b, %r9
nop
nop
sub %rdi, %rdi
vmovups (%r9), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $1, %xmm6, %r8
nop
xor $64333, %rax
lea addresses_WC_ht+0x8a73, %rsi
lea addresses_D_ht+0xa68b, %rdi
nop
nop
cmp %rdx, %rdx
mov $109, %rcx
rep movsq
nop
nop
nop
nop
and $3593, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r14
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_RW+0x1ec8b, %rdi
clflush (%rdi)
nop
nop
nop
nop
cmp %r11, %r11
movl $0x51525354, (%rdi)
nop
add %rsi, %rsi
// Store
lea addresses_US+0xb48b, %rcx
nop
dec %rdx
mov $0x5152535455565758, %rsi
movq %rsi, %xmm5
movaps %xmm5, (%rcx)
nop
and %rcx, %rcx
// Faulty Load
lea addresses_A+0xb48b, %r14
nop
nop
nop
nop
nop
sub $49031, %rdx
mov (%r14), %r11
lea oracles, %rbx
and $0xff, %r11
shlq $12, %r11
mov (%rbx,%r11,1), %r11
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r14
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_RW', 'AVXalign': True, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_US', 'AVXalign': True, 'size': 16}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_A', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32}}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1}}
{'src': {'NT': True, 'same': False, 'congruent': 7, 'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 32}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 8, 'type': 'addresses_A_ht'}}
{'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}}
{'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
*/
| 34.658537
| 2,999
| 0.657284
|
0668a3ba86af5ca0461e0450526de1a5a2350c61
| 681
|
asm
|
Assembly
|
oeis/277/A277464.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/277/A277464.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/277/A277464.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A277464: E.g.f.: cosh(x)/(1 + LambertW(-x)).
; Submitted by Jamie Morken(w4)
; 1,1,5,30,281,3400,50557,890120,18101617,417464064,10764826421,306893014912,9584448407305,325407839778944,11933432488693549,470087171351873280,19796492491889197025,887518214183286390784,42202928616264032249701,2121583256369642798845952,112423223835738872247945721,6263030002648909129582215168,365939181865264378387268778461,22376245144025554489463868030976,1429089397318412955748660911533905,95156242370025829561422110697881600,6594712257383344028182455543534215317
mov $4,$0
add $0,1
lpb $0
sub $0,1
mov $2,$0
pow $2,$0
mov $3,$4
bin $3,$0
trn $0,1
mul $3,$2
add $5,$3
lpe
mov $0,$5
| 37.833333
| 466
| 0.806167
|
7ff12071f4bdba48bd6ffb184269abcf9445afbb
| 430
|
asm
|
Assembly
|
oeis/112/A112831.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/112/A112831.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/112/A112831.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A112831: Number of non-intersecting cycle systems in a particular directed graph.
; Submitted by Jamie Morken(s1)
; 1,2,5,17,74,365,1889,9938,52565,278513,1476506,7828925,41513921,220137122,1167334565,6190107857,32824743914,174062236685,923012961569,4894530600818,25954597551605,137631407453873,729828474212666
mul $0,2
mov $1,1
mov $2,$0
mov $3,1
lpb $2
sub $2,1
mul $3,3
sub $1,$3
add $3,$1
mul $1,-1
lpe
mov $0,$3
| 25.294118
| 196
| 0.746512
|
f6041e0dbace20c9d3ced643db73b61232a178a2
| 191
|
asm
|
Assembly
|
text/maps/school.asm
|
etdv-thevoid/pokemon-rgb-enhanced
|
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
|
[
"MIT"
] | 9
|
2020-07-12T19:44:21.000Z
|
2022-03-03T23:32:40.000Z
|
text/maps/ViridianSchoolHouse.asm
|
JStar-debug2020/pokemon-rby-dx
|
c2fdd8145d96683addbd8d9075f946a68d1527a1
|
[
"MIT"
] | 7
|
2020-07-16T10:48:52.000Z
|
2021-01-28T18:32:02.000Z
|
text/maps/ViridianSchoolHouse.asm
|
JStar-debug2020/pokemon-rby-dx
|
c2fdd8145d96683addbd8d9075f946a68d1527a1
|
[
"MIT"
] | 2
|
2021-03-28T18:33:43.000Z
|
2021-05-06T13:12:09.000Z
|
_SchoolText1::
text "Whew! I'm trying"
line "to memorize all"
cont "my notes."
done
_SchoolText2::
text "Okay!"
para "Be sure to read"
line "the blackboard"
cont "carefully!"
done
| 13.642857
| 24
| 0.680628
|
bc9097e9fc72731f1aef364a44a63af8b4b2c6c8
| 3,129
|
asm
|
Assembly
|
Docs/patron_volteo.asm
|
aeri/Senpai
|
966a730cd6a9b3b5eff98f99bd43a2f514f81b9e
|
[
"Unlicense"
] | null | null | null |
Docs/patron_volteo.asm
|
aeri/Senpai
|
966a730cd6a9b3b5eff98f99bd43a2f514f81b9e
|
[
"Unlicense"
] | null | null | null |
Docs/patron_volteo.asm
|
aeri/Senpai
|
966a730cd6a9b3b5eff98f99bd43a2f514f81b9e
|
[
"Unlicense"
] | 1
|
2020-09-22T08:36:52.000Z
|
2020-09-22T08:36:52.000Z
|
patron_volteo:
0c000324: mov r12, sp
0c000328: push {r11, r12, lr, pc}
0c00032c: sub r11, r12, #4
0c000330: sub sp, sp, #48 ; 0x30
0c000334: str r0, [r11, #-32]
0c000338: str r1, [r11, #-36] ; 0x24
0c00033c: strb r2, [r11, #-37] ; 0x25
0c000340: strb r3, [r11, #-38] ; 0x26
196 FA = FA + SF;
0c000344: ldrb r2, [r11, #-37] ; 0x25
0c000348: ldrb r3, [r11, #4]
0c00034c: add r3, r2, r3
0c000350: strb r3, [r11, #-37] ; 0x25
197 CA = CA + SC;
0c000354: ldrb r2, [r11, #-38] ; 0x26
0c000358: ldrb r3, [r11, #8]
0c00035c: add r3, r2, r3
0c000360: strb r3, [r11, #-38] ; 0x26
198 casilla = ficha_valida(tablero, FA, CA, &posicion_valida);
0c000364: ldrb r1, [r11, #-37] ; 0x25
0c000368: ldrb r2, [r11, #-38] ; 0x26
0c00036c: sub r3, r11, #24
0c000370: ldr r0, [r11, #-32]
0c000374: bl 0xc000270 <ficha_valida>
0c000378: mov r3, r0
0c00037c: strb r3, [r11, #-13]
201 if ((posicion_valida == 1) && (casilla != color))
0c000380: ldr r3, [r11, #-24]
0c000384: cmp r3, #1
0c000388: bne 0xc0003e8 <patron_volteo+196>
0c00038c: ldrb r2, [r11, #-13]
0c000390: ldrb r3, [r11, #12]
0c000394: cmp r2, r3
0c000398: beq 0xc0003e8 <patron_volteo+196>
203 *longitud = *longitud + 1;
0c00039c: ldr r3, [r11, #-36] ; 0x24
0c0003a0: ldr r3, [r3]
0c0003a4: add r2, r3, #1
0c0003a8: ldr r3, [r11, #-36] ; 0x24
0c0003ac: str r2, [r3]
204 patron = patron_volteo(tablero, longitud, FA, CA, SF, SC, color);
0c0003b0: ldrb r2, [r11, #-37] ; 0x25
0c0003b4: ldrb r3, [r11, #-38] ; 0x26
0c0003b8: ldrb r1, [r11, #4]
0c0003bc: str r1, [sp]
0c0003c0: ldrb r1, [r11, #8]
0c0003c4: str r1, [sp, #4]
0c0003c8: ldrb r1, [r11, #12]
0c0003cc: str r1, [sp, #8]
0c0003d0: ldr r0, [r11, #-32]
0c0003d4: ldr r1, [r11, #-36] ; 0x24
0c0003d8: bl 0xc000324 <patron_volteo>
0c0003dc: str r0, [r11, #-20]
207 return patron;
0c0003e0: ldr r3, [r11, #-20]
0c0003e4: b 0xc000428 <patron_volteo+260>
211 else if ((posicion_valida == 1) && (casilla == color))
0c0003e8: ldr r3, [r11, #-24]
0c0003ec: cmp r3, #1
0c0003f0: bne 0xc000424 <patron_volteo+256>
0c0003f4: ldrb r2, [r11, #-13]
0c0003f8: ldrb r3, [r11, #12]
0c0003fc: cmp r2, r3
0c000400: bne 0xc000424 <patron_volteo+256>
213 if (*longitud > 0) // longitud indica cuantas fichas hay que voltear
0c000404: ldr r3, [r11, #-36] ; 0x24
0c000408: ldr r3, [r3]
0c00040c: cmp r3, #0
0c000410: ble 0xc00041c <patron_volteo+248>
215 return PATRON_ENCONTRADO; // si hay que voltear una ficha o más hemos encontrado el patrón
0c000414: mov r3, #1
0c000418: b 0xc000428 <patron_volteo+260>
219 return NO_HAY_PATRON; // si no hay que voltear no hay patrón
0c00041c: mov r3, #0
0c000420: b 0xc000428 <patron_volteo+260>
226 return NO_HAY_PATRON;
0c000424: mov r3, #0
229 }
0c000428: mov r0, r3
0c00042c: sub sp, r11, #12
0c000430: ldm sp, {r11, sp, lr}
0c000434: bx lr
236 {
| 37.25
| 112
| 0.597635
|
45b10aa503c7f5bbcb20d16f4650e5c6337caf1a
| 392
|
asm
|
Assembly
|
programs/oeis/242/A242771.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/242/A242771.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/242/A242771.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A242771: Number of integer points in a certain quadrilateral scaled by a factor of n (another version).
; 0,0,1,3,6,9,14,19,25,32,40,48,58,68,79,91,104,117,132,147,163,180,198,216,236,256,277,299,322,345,370,395,421,448,476,504,534,564,595,627,660,693,728,763,799,836,874,912,952,992,1033,1075,1118,1161,1206
mov $2,$0
lpb $2,1
trn $0,2
add $1,$3
trn $1,$0
sub $2,1
add $3,1
lpe
| 32.666667
| 204
| 0.686224
|
f04c0f9b05fe3dd974ba54e769a238c203241fcb
| 4,032
|
asm
|
Assembly
|
Appl/Art/Decks/GeoDeck/LMDiamondA.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504
|
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Appl/Art/Decks/GeoDeck/LMDiamondA.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96
|
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Appl/Art/Decks/GeoDeck/LMDiamondA.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 73
|
2018-11-19T20:46:53.000Z
|
2022-03-29T00:59:26.000Z
|
LMDiamondA label byte
word C_BLACK
Bitmap <71,100,BMC_PACKBITS,BMF_MONO>
db 0xfa, 0x00, 0x01, 0x3f, 0xff
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0x01, 0x00, 0x80, 0xfb, 0x00, 0x00, 0x03
db 0x01, 0x00, 0x80, 0xfc, 0x00, 0x01, 0x04, 0x03
db 0x01, 0x01, 0xc0, 0xfc, 0x00, 0x01, 0x0e, 0x03
db 0x01, 0x01, 0xc0, 0xfc, 0x00, 0x01, 0x1b, 0x03
db 0x01, 0x03, 0xe0, 0xfc, 0x00, 0x01, 0x35, 0x83
db 0x01, 0x03, 0x60, 0xfc, 0x00, 0x01, 0x2a, 0x83
db 0x01, 0x03, 0x60, 0xfc, 0x00, 0x01, 0x55, 0x43
db 0x01, 0x06, 0x30, 0xfc, 0x00, 0x01, 0x2a, 0x83
db 0x01, 0x06, 0x30, 0xfc, 0x00, 0x01, 0x35, 0x83
db 0x01, 0x07, 0xf0, 0xfc, 0x00, 0x01, 0x1b, 0x03
db 0x01, 0x0f, 0xf8, 0xfc, 0x00, 0x01, 0x0e, 0x03
db 0x01, 0x0c, 0x18, 0xfc, 0x00, 0x01, 0x04, 0x03
db 0x01, 0x0c, 0x18, 0xfb, 0x00, 0x00, 0x03
db 0x01, 0x3f, 0x7e, 0xfb, 0x00, 0x00, 0x03
db 0x01, 0x3f, 0x7e, 0xfb, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xfd, 0x00, 0x00, 0x20, 0xfe, 0x00, 0x00, 0x03
db 0xfd, 0x00, 0x00, 0x70, 0xfe, 0x00, 0x00, 0x03
db 0xfd, 0x00, 0x00, 0xd8, 0xfe, 0x00, 0x00, 0x03
db 0xfe, 0x00, 0x01, 0x01, 0xac, 0xfe, 0x00, 0x00,
0x03
db 0xfe, 0x00, 0x01, 0x03, 0x56, 0xfe, 0x00, 0x00,
0x03
db 0xfe, 0x00, 0x01, 0x06, 0xab, 0xfe, 0x00, 0x00,
0x03
db 0xfe, 0x00, 0x05, 0x0d, 0x55, 0x80, 0x00, 0x00,
0x03
db 0xfe, 0x00, 0x05, 0x0a, 0xaa, 0x80, 0x00, 0x00,
0x03
db 0xfe, 0x00, 0x05, 0x15, 0x55, 0x40, 0x00, 0x00,
0x03
db 0xfe, 0x00, 0x05, 0x0a, 0xaa, 0x80, 0x00, 0x00,
0x03
db 0xfe, 0x00, 0x05, 0x0d, 0x55, 0x80, 0x00, 0x00,
0x03
db 0xfe, 0x00, 0x01, 0x06, 0xab, 0xfe, 0x00, 0x00,
0x03
db 0xfe, 0x00, 0x01, 0x03, 0x56, 0xfe, 0x00, 0x00,
0x03
db 0xfe, 0x00, 0x01, 0x01, 0xac, 0xfe, 0x00, 0x00,
0x03
db 0xfd, 0x00, 0x00, 0xd8, 0xfe, 0x00, 0x00, 0x03
db 0xfd, 0x00, 0x00, 0x70, 0xfe, 0x00, 0x00, 0x03
db 0xfd, 0x00, 0x00, 0x20, 0xfe, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xfa, 0x00, 0x01, 0xfd, 0xfb
db 0xfa, 0x00, 0x01, 0xfd, 0xfb
db 0xfa, 0x00, 0x01, 0x30, 0x63
db 0x01, 0x00, 0x40, 0xfc, 0x00, 0x01, 0x30, 0x63
db 0x01, 0x00, 0xe0, 0xfc, 0x00, 0x01, 0x3f, 0xe3
db 0x01, 0x01, 0xb0, 0xfc, 0x00, 0x01, 0x1f, 0xc3
db 0x01, 0x03, 0x58, 0xfc, 0x00, 0x01, 0x18, 0xc3
db 0x01, 0x02, 0xa8, 0xfc, 0x00, 0x01, 0x18, 0xc3
db 0x01, 0x05, 0x54, 0xfc, 0x00, 0x01, 0x0d, 0x83
db 0x01, 0x02, 0xa8, 0xfc, 0x00, 0x01, 0x0d, 0x83
db 0x01, 0x03, 0x58, 0xfc, 0x00, 0x01, 0x0f, 0x83
db 0x01, 0x01, 0xb0, 0xfc, 0x00, 0x01, 0x07, 0x03
db 0x01, 0x00, 0xe0, 0xfc, 0x00, 0x01, 0x07, 0x03
db 0x01, 0x00, 0x40, 0xfc, 0x00, 0x01, 0x02, 0x03
db 0xfa, 0x00, 0x01, 0x02, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xf9, 0x00, 0x00, 0x03
db 0xfa, 0x00, 0x01, 0x3f, 0xff
| 35.06087
| 53
| 0.645089
|
0425d68015ed51ad69606ed5fccb01dbbfe1681b
| 1,120
|
asm
|
Assembly
|
programs/oeis/001/A001303.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/001/A001303.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/001/A001303.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A001303: Stirling numbers of first kind, s(n+3, n), negated.
; 6,50,225,735,1960,4536,9450,18150,32670,55770,91091,143325,218400,323680,468180,662796,920550,1256850,1689765,2240315,2932776,3795000,4858750,6160050,7739550,9642906,11921175,14631225,17836160,21605760,26016936,31154200,37110150,43985970,51891945,60947991,71284200,83041400,96371730,111439230,128420446,147505050,168896475,192812565,219486240,249166176,282117500,318622500,358981350,403512850,452555181,506466675,565626600,630435960,701318310,778720586,863113950,954994650,1054884895,1163333745,1280918016,1408243200,1545944400,1694687280,1855169030,2028119346,2214301425,2414512975,2629587240,2860394040,3107840826,3372873750,3656478750,3959682650,4283554275,4629205581,4997792800,5390517600,5808628260,6253420860,6726240486,7228482450,7761593525,8327073195,8926474920,9561407416,10233535950,10944583650,11696332830,12490626330,13329368871,14214528425,15148137600,16132295040,17169166840,18260987976,19410063750,20618771250,21889560825,23224957575
add $0,2
mov $1,-3
bin $1,$0
bin $0,2
mul $0,2
pow $1,2
mul $1,$0
sub $1,72
div $1,12
add $1,6
mov $0,$1
| 74.666667
| 950
| 0.848214
|
98babb106cbcd5054fdff3ded6ff7db7fcb033c8
| 691
|
asm
|
Assembly
|
oeis/112/A112776.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/112/A112776.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/112/A112776.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A112776: Numbers n such that 6n+5 is semiprime.
; Submitted by Jon Maiga
; 5,10,12,15,19,23,25,26,30,33,34,35,36,47,49,50,53,54,55,56,60,61,62,65,67,68,72,78,80,82,85,87,88,90,91,96,101,103,104,105,111,114,115,117,118,121,122,124,125,127,129,130,131,133,135,141,144,148,149,150,152,153,159,160,164,165,167,172,173,175,177,178,179,185,186,188,189,190,192,194,199,200,201,206,207,208,211,218,222,223,224,225,229,230,231,232,233,235,242,244
mov $1,10
mov $2,$0
add $2,2
pow $2,2
lpb $2
mov $3,$1
seq $3,64911 ; If n is semiprime (or 2-almost prime) then 1 else 0.
sub $0,$3
add $1,6
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
sub $2,1
lpe
mov $0,$1
sub $0,34
div $0,6
add $0,5
| 28.791667
| 364
| 0.658466
|
1bf324f47655eb07d5f29d017618c1c4ddaa334b
| 318
|
asm
|
Assembly
|
oeis/105/A105356.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/105/A105356.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/105/A105356.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A105356: Records in A105354.
; Submitted by Jamie Morken(s1)
; 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120
mov $1,$0
mul $0,4
add $0,1
div $1,22
add $0,$1
add $0,1
div $0,2
| 26.5
| 187
| 0.657233
|
54fc7e6defc4885a25589881751c7023dc077e7a
| 389
|
asm
|
Assembly
|
libsrc/adt/linkedlist/adt_ListInsert.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 38
|
2021-06-18T12:56:15.000Z
|
2022-03-12T20:38:40.000Z
|
libsrc/adt/linkedlist/adt_ListInsert.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 2
|
2021-06-20T16:28:12.000Z
|
2021-11-17T21:33:56.000Z
|
libsrc/adt/linkedlist/adt_ListInsert.asm
|
jpoikela/z88dk
|
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
|
[
"ClArtistic"
] | 6
|
2021-06-18T18:18:36.000Z
|
2021-12-22T08:01:32.000Z
|
; int adt_ListInsert(struct adt_List *list, void *item)
; CALLER linkage for function pointers
SECTION code_clib
PUBLIC adt_ListInsert
PUBLIC _adt_ListInsert
EXTERN adt_ListInsert_callee
EXTERN ASMDISP_ADT_LISTINSERT_CALLEE
.adt_ListInsert
._adt_ListInsert
pop hl
pop bc
pop de
push de
push bc
push hl
jp adt_ListInsert_callee + ASMDISP_ADT_LISTINSERT_CALLEE
| 16.913043
| 59
| 0.791774
|
9e2f409126006c476ff5047053f080f15d8a2d28
| 8,680
|
asm
|
Assembly
|
maps/Route31.asm
|
pokeachromicdevs/pokeoctober
|
db74bb68bbfceac07eec6d64674bc24fd4c0b67f
|
[
"blessing"
] | 1
|
2021-07-05T23:48:37.000Z
|
2021-07-05T23:48:37.000Z
|
maps/Route31.asm
|
AtmaBuster/pokeoctober
|
12652b84eb2df1a0ed2f654a0ffcfb78202e515f
|
[
"blessing"
] | 1
|
2020-12-16T01:11:20.000Z
|
2020-12-16T22:53:56.000Z
|
maps/Route31.asm
|
AtmaBuster/pokeoctober
|
12652b84eb2df1a0ed2f654a0ffcfb78202e515f
|
[
"blessing"
] | 1
|
2021-07-05T23:33:22.000Z
|
2021-07-05T23:33:22.000Z
|
object_const_def ; object_event constants
const ROUTE31_FISHER
const ROUTE31_YOUNGSTER
const ROUTE31_SUPER_NERD
const ROUTE31_COOLTRAINER_M
const ROUTE31_FRUIT_TREE
const ROUTE31_POKE_BALL1
const ROUTE31_POKE_BALL2
Route31_MapScripts:
db 0 ; scene scripts
db 1 ; callbacks
callback MAPCALLBACK_NEWMAP, .CheckMomCall
.CheckMomCall:
checkevent EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST
iffalse .DoMomCall
return
.DoMomCall:
specialphonecall SPECIALCALL_WORRIED
return
TrainerInstructorStanley:
trainer INSTRUCTOR, STANLEY, EVENT_BEAT_INSTRUCTOR_STANLEY, InstructorStanley1SeenText, InstructorStanley1BeatenText, 0, .Script
.Script:
loadvar VAR_CALLERID, PHONE_INSTRUCTOR_STANLEY
endifjustbattled
opentext
checkflag ENGINE_STANLEY
iftrue .WadeRematch
checkflag ENGINE_STANLEY_HAS_ITEM
iftrue .WadeItem
checkcellnum PHONE_INSTRUCTOR_STANLEY
iftrue .AcceptedNumberSTD
checkevent EVENT_STANLEY_ASKED_FOR_PHONE_NUMBER
iftrue .AskAgain
writetext InstructorStanley1AfterText
waitbutton
setevent EVENT_STANLEY_ASKED_FOR_PHONE_NUMBER
scall .AskPhoneNumberSTD
sjump .Continue
.AskAgain:
scall .AskAgainSTD
.Continue:
askforphonenumber PHONE_INSTRUCTOR_STANLEY
ifequal PHONE_CONTACTS_FULL, .PhoneFullSTD
ifequal PHONE_CONTACT_REFUSED, .DeclinedNumberSTD
gettrainername STRING_BUFFER_3, BUG_CATCHER, STANLEY1
scall .RegisterNumberSTD
sjump .AcceptedNumberSTD
.WadeRematch:
scall .RematchSTD
winlosstext InstructorStanley1BeatenText, 0
readmem wWadeFightCount
ifequal 4, .Fight4
ifequal 3, .Fight3
ifequal 2, .Fight2
ifequal 1, .Fight1
ifequal 0, .LoadFight0
.Fight4:
checkevent EVENT_BEAT_ELITE_FOUR
iftrue .LoadFight4
.Fight3:
checkevent EVENT_CLEARED_RADIO_TOWER
iftrue .LoadFight3
.Fight2:
checkflag ENGINE_FLYPOINT_MAHOGANY
iftrue .LoadFight2
.Fight1:
checkflag ENGINE_FLYPOINT_GOLDENROD
iftrue .LoadFight1
.LoadFight0:
loadtrainer INSTRUCTOR, STANLEY
startbattle
reloadmapafterbattle
loadmem wWadeFightCount, 1
clearflag ENGINE_STANLEY
end
.LoadFight1:
loadtrainer BUG_CATCHER, STANLEY2
startbattle
reloadmapafterbattle
loadmem wWadeFightCount, 2
clearflag ENGINE_STANLEY
end
.LoadFight2:
loadtrainer BUG_CATCHER, STANLEY3
startbattle
reloadmapafterbattle
loadmem wWadeFightCount, 3
clearflag ENGINE_STANLEY
end
.LoadFight3:
loadtrainer BUG_CATCHER, STANLEY4
startbattle
reloadmapafterbattle
loadmem wWadeFightCount, 4
clearflag ENGINE_STANLEY
end
.LoadFight4:
loadtrainer INSTRUCTOR, STANLEY
startbattle
reloadmapafterbattle
clearflag ENGINE_STANLEY
end
.WadeItem:
scall .ItemSTD
checkevent EVENT_STANLEY_HAS_BERRY
iftrue .Berry
checkevent EVENT_STANLEY_HAS_PSNCUREBERRY
iftrue .Psncureberry
checkevent EVENT_STANLEY_HAS_PRZCUREBERRY
iftrue .Przcureberry
checkevent EVENT_STANLEY_HAS_BITTER_BERRY
iftrue .BitterBerry
.Berry:
verbosegiveitem BERRY
iffalse .PackFull
sjump .Done
.Psncureberry:
verbosegiveitem PSNCUREBERRY
iffalse .PackFull
sjump .Done
.Przcureberry:
verbosegiveitem PRZCUREBERRY
iffalse .PackFull
sjump .Done
.BitterBerry:
verbosegiveitem BITTER_BERRY
iffalse .PackFull
.Done:
clearflag ENGINE_STANLEY_HAS_ITEM
sjump .AcceptedNumberSTD
.PackFull:
sjump .PackFullSTD
.AskPhoneNumberSTD:
jumpstd asknumber1m
end
.AskAgainSTD:
jumpstd asknumber2m
end
.RegisterNumberSTD:
jumpstd registerednumberm
end
.AcceptedNumberSTD:
jumpstd numberacceptedm
end
.DeclinedNumberSTD:
jumpstd numberdeclinedm
end
.PhoneFullSTD:
jumpstd phonefullm
end
.RematchSTD:
jumpstd rematchm
end
.ItemSTD:
jumpstd giftm
end
.PackFullSTD:
jumpstd packfullm
end
Route31MailRecipientScript:
faceplayer
opentext
checkevent EVENT_GOT_TM50_NIGHTMARE
iftrue .DescribeNightmare
checkevent EVENT_GOT_KENYA
iftrue .TryGiveKenya
writetext Text_Route31SleepyMan
waitbutton
closetext
end
.TryGiveKenya:
writetext Text_Route31SleepyManGotMail
buttonsound
checkpokemail ReceivedSpearowMailText
ifequal POKEMAIL_WRONG_MAIL, .WrongMail
ifequal POKEMAIL_REFUSED, .Refused
ifequal POKEMAIL_NO_MAIL, .NoMail
ifequal POKEMAIL_LAST_MON, .LastMon
; POKEMAIL_CORRECT
writetext Text_Route31HandOverMailMon
buttonsound
writetext Text_Route31ReadingMail
buttonsound
setevent EVENT_GAVE_KENYA
verbosegiveitem TM_NIGHTMARE
iffalse .NoRoomForItems
setevent EVENT_GOT_TM50_NIGHTMARE
.DescribeNightmare:
writetext Text_Route31DescribeNightmare
waitbutton
.NoRoomForItems:
closetext
end
.WrongMail:
writetext Text_Route31WrongMail
waitbutton
closetext
end
.NoMail:
writetext Text_Route31MissingMail
waitbutton
closetext
end
.Refused:
writetext Text_Route31DeclinedToHandOverMail
waitbutton
closetext
end
.LastMon:
writetext Text_Route31CantTakeLastMon
waitbutton
closetext
end
ReceivedSpearowMailText:
db "DARK CAVE leads"
next "to another road@"
Route31YoungsterScript:
jumptextfaceplayer Route31YoungsterText
Route31Sign:
jumptext Route31SignText
DarkCaveSign:
jumptext MrPokemonHouseText
Route31CooltrainerMScript:
jumptextfaceplayer Route31CooltrainerMText
Route31FruitTree:
fruittree FRUITTREE_ROUTE_31
Route31Potion:
itemball POTION
Route31PokeBall:
itemball POKE_BALL
Route31CooltrainerMText:
text "DARK CAVE…"
para "If #MON could"
line "light it up, I'd"
cont "explore it."
done
InstructorStanley1SeenText:
text "Do you want to"
line "learn about"
cont "BERRIES?"
done
InstructorStanley1BeatenText:
text "Oh…I guess not…"
done
InstructorStanley1AfterText:
text "We take kids out"
line "here for some"
para "experience out in"
line "the real world"
para "pretty frequently."
done
Text_Route31SleepyMan:
text "… Hnuurg… Huh?"
para "I walked too far"
line "today looking for"
cont "#MON."
para "My feet hurt and"
line "I'm sleepy…"
para "If I were a wild"
line "#MON, I'd be"
cont "easy to catch…"
para "…Zzzz…"
done
Text_Route31SleepyManGotMail:
text "…Zzzz… Huh?"
para "What's that? You"
line "have MAIL for me?"
done
Text_Route31HandOverMailMon:
text "<PLAYER> handed"
line "over the #MON"
cont "holding the MAIL."
done
Text_Route31ReadingMail:
text "Let's see…"
para "…DARK CAVE leads"
line "to another road…"
para "That's good to"
line "know."
para "Thanks for bring-"
line "ing this to me."
para "My friend's a good"
line "guy, and you're"
cont "swell too!"
para "I'd like to do"
line "something good in"
cont "return too!"
para "I know! I want you"
line "to have this!"
done
Text_Route31DescribeNightmare:
text "TM50 is NIGHTMARE."
para "It's a wicked move"
line "that steadily cuts"
para "the HP of a sleep-"
line "ing enemy."
para "Ooooh…"
line "That's scary…"
para "I don't want to"
line "have bad dreams."
done
Text_Route31WrongMail:
text "This MAIL isn't"
line "for me."
done
Text_Route31MissingMail:
text "Why is this #-"
line "MON so special?"
para "It doesn't have"
line "any MAIL."
done
Text_Route31DeclinedToHandOverMail:
text "What? You don't"
line "want anything?"
done
Text_Route31CantTakeLastMon:
text "If I take that"
line "#MON from you,"
para "what are you going"
line "to use in battle?"
done
Route31YoungsterText:
text "I found a good"
line "#MON in DARK"
cont "CAVE."
para "I'm going to raise"
line "it to take on"
cont "FALKNER."
para "He's the leader of"
line "VIOLET CITY's GYM."
done
Route31SignText:
text "ROUTE 31"
para "VIOLET CITY -"
line "CHERRYGROVE CITY"
done
MrPokemonHouseText:
text "MR. #MON's"
line "HOUSE"
done
Route31_MapEvents:
db 0, 0 ; filler
db 2 ; warp events
warp_event 21, 3, MR_POKEMONS_HOUSE, 1
warp_event 1, 4, ROUTE_31_VIOLET_GATE, 4
db 0 ; coord events
db 1 ; bg events
bg_event 19, 3, BGEVENT_READ, MrPokemonHouseText
db 7 ; object events
object_event 13, 8, SPRITE_FISHER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Route31MailRecipientScript, -1
object_event 28, 9, SPRITE_YOUNGSTER, SPRITEMOVEDATA_WANDER, 1, 1, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Route31YoungsterScript, -1
object_event 27, 13, SPRITE_SUPER_NERD, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, PAL_NPC_BROWN, OBJECTTYPE_TRAINER, 5, TrainerInstructorStanley, -1
object_event 33, 8, SPRITE_COOLTRAINER_M, SPRITEMOVEDATA_WANDER, 1, 1, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Route31CooltrainerMScript, -1
object_event 9, 8, SPRITE_FRUIT_TREE, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, Route31FruitTree, -1
object_event 35, 5, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, Route31Potion, EVENT_ROUTE_31_POTION
object_event 36, 9, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, Route31PokeBall, EVENT_ROUTE_31_POKE_BALL
| 19.8627
| 152
| 0.792396
|
b068286b8cbb497d556b41065304cb01a9077ebc
| 4,427
|
asm
|
Assembly
|
Transynther/x86/_processed/NC/_ht_zr_un_/i9-9900K_12_0xa0_notsx.log_21829_184.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NC/_ht_zr_un_/i9-9900K_12_0xa0_notsx.log_21829_184.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NC/_ht_zr_un_/i9-9900K_12_0xa0_notsx.log_21829_184.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 3
|
2020-07-14T17:07:07.000Z
|
2022-03-21T01:12:22.000Z
|
.global s_prepare_buffers
s_prepare_buffers:
push %r13
push %rax
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x2256, %rsi
lea addresses_UC_ht+0x549e, %rdi
dec %r13
mov $67, %rcx
rep movsb
nop
nop
and $15331, %rdx
lea addresses_D_ht+0xa6b6, %rsi
lea addresses_WC_ht+0xe256, %rdi
nop
cmp $60574, %rax
mov $64, %rcx
rep movsw
nop
nop
cmp %r13, %r13
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rax
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %rbx
push %rcx
push %rsi
// Faulty Load
mov $0x3d2bba0000000656, %rcx
nop
nop
nop
sub $48852, %r11
movups (%rcx), %xmm1
vpextrq $1, %xmm1, %r10
lea oracles, %r11
and $0xff, %r10
shlq $12, %r10
mov (%r11,%r10,1), %r10
pop %rsi
pop %rcx
pop %rbx
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_NC', 'AVXalign': False, 'size': 16, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'08': 1, '46': 19781, 'f2': 1, '00': 2046}
00 46 00 00 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 00 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 00 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 00 46 46 46 46 46 46 46 46 46 46 46 46 00 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 00 46 46 46 46 46 46 46 46 00 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 00 46 46 46 46 46 46 46 46 00 46 00 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 00 00 46 46 46 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 00 00 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 00 46 46 46 46 46 46 46 46 46 00 46 46
*/
| 59.026667
| 2,999
| 0.662525
|
adb76e510e5960b96c3d85b21f9e709dc63202bf
| 14,646
|
asm
|
Assembly
|
third_party/crashpad/crashpad/util/misc/capture_context_win.asm
|
zealoussnow/chromium
|
fd8a8914ca0183f0add65ae55f04e287543c7d4a
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668
|
2015-01-01T01:57:10.000Z
|
2022-03-31T23:33:32.000Z
|
third_party/crashpad/crashpad/util/misc/capture_context_win.asm
|
zealoussnow/chromium
|
fd8a8914ca0183f0add65ae55f04e287543c7d4a
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113
|
2015-05-04T09:58:14.000Z
|
2022-01-31T19:35:03.000Z
|
third_party/crashpad/crashpad/util/misc/capture_context_win.asm
|
zealoussnow/chromium
|
fd8a8914ca0183f0add65ae55f04e287543c7d4a
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941
|
2015-01-02T11:32:21.000Z
|
2022-03-31T16:35:46.000Z
|
; Copyright 2015 The Crashpad Authors. All rights reserved.
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
; Detect ml64 assembling for x86_64 by checking for rax.
ifdef rax
_M_X64 equ 1
else
_M_IX86 equ 1
endif
ifdef _M_IX86
.586
.xmm
.model flat
endif
; The CONTEXT structure definitions that follow are based on those in <winnt.h>.
; Field names are prefixed (as in c_Rax) to avoid colliding with the predefined
; register names (such as Rax).
ifdef _M_IX86
CONTEXT_i386 equ 10000h
CONTEXT_CONTROL equ CONTEXT_i386 or 1h
CONTEXT_INTEGER equ CONTEXT_i386 or 2h
CONTEXT_SEGMENTS equ CONTEXT_i386 or 4h
CONTEXT_FLOATING_POINT equ CONTEXT_i386 or 8h
CONTEXT_DEBUG_REGISTERS equ CONTEXT_i386 or 10h
CONTEXT_EXTENDED_REGISTERS equ CONTEXT_i386 or 20h
CONTEXT_XSTATE equ CONTEXT_i386 or 40h
MAXIMUM_SUPPORTED_EXTENSION equ 512
CONTEXT struct
c_ContextFlags dword ?
c_Dr0 dword ?
c_Dr1 dword ?
c_Dr2 dword ?
c_Dr3 dword ?
c_Dr6 dword ?
c_Dr7 dword ?
struct c_FloatSave
f_ControlWord dword ?
f_StatusWord dword ?
f_TagWord dword ?
f_ErrorOffset dword ?
f_ErrorSelector dword ?
f_DataOffset dword ?
f_DataSelector dword ?
f_RegisterArea byte 80 dup(?)
union
f_Spare0 dword ? ; As in FLOATING_SAVE_AREA.
f_Cr0NpxState dword ? ; As in WOW64_FLOATING_SAVE_AREA.
ends
ends
c_SegGs dword ?
c_SegFs dword ?
c_SegEs dword ?
c_SegDs dword ?
c_Edi dword ?
c_Esi dword ?
c_Ebx dword ?
c_Edx dword ?
c_Ecx dword ?
c_Eax dword ?
c_Ebp dword ?
c_Eip dword ?
c_SegCs dword ?
c_EFlags dword ?
c_Esp dword ?
c_SegSs dword ?
c_ExtendedRegisters byte MAXIMUM_SUPPORTED_EXTENSION dup(?)
CONTEXT ends
elseifdef _M_X64
M128A struct 16
m_Low qword ?
m_High qword ?
M128A ends
CONTEXT_AMD64 equ 100000h
CONTEXT_CONTROL equ CONTEXT_AMD64 or 1h
CONTEXT_INTEGER equ CONTEXT_AMD64 or 2h
CONTEXT_SEGMENTS equ CONTEXT_AMD64 or 4h
CONTEXT_FLOATING_POINT equ CONTEXT_AMD64 or 8h
CONTEXT_DEBUG_REGISTERS equ CONTEXT_AMD64 or 10h
CONTEXT_XSTATE equ CONTEXT_AMD64 or 40h
CONTEXT struct 16
c_P1Home qword ?
c_P2Home qword ?
c_P3Home qword ?
c_P4Home qword ?
c_P5Home qword ?
c_P6Home qword ?
c_ContextFlags dword ?
c_MxCsr dword ?
c_SegCs word ?
c_SegDs word ?
c_SegEs word ?
c_SegFs word ?
c_SegGs word ?
c_SegSs word ?
c_EFlags dword ?
c_Dr0 qword ?
c_Dr1 qword ?
c_Dr2 qword ?
c_Dr3 qword ?
c_Dr6 qword ?
c_Dr7 qword ?
c_Rax qword ?
c_Rcx qword ?
c_Rdx qword ?
c_Rbx qword ?
c_Rsp qword ?
c_Rbp qword ?
c_Rsi qword ?
c_Rdi qword ?
c_R8 qword ?
c_R9 qword ?
c_R10 qword ?
c_R11 qword ?
c_R12 qword ?
c_R13 qword ?
c_R14 qword ?
c_R15 qword ?
c_Rip qword ?
union
struct c_FltSave
f_ControlWord word ?
f_StatusWord word ?
f_TagWord byte ?
f_Reserved1 byte ?
f_ErrorOpcode word ?
f_ErrorOffset dword ?
f_ErrorSelector word ?
f_Reserved2 word ?
f_DataOffset dword ?
f_DataSelector word ?
f_Reserved3 word ?
f_MxCsr dword ?
f_MxCsr_Mask dword ?
f_FloatRegisters M128A 8 dup(<?>)
f_XmmRegisters M128A 16 dup(<?>)
f_Reserved4 byte 96 dup(?)
ends
struct
fx_Header M128A 2 dup(<?>)
fx_Legacy M128A 8 dup(<?>)
fx_Xmm0 M128A <?>
fx_Xmm1 M128A <?>
fx_Xmm2 M128A <?>
fx_Xmm3 M128A <?>
fx_Xmm4 M128A <?>
fx_Xmm5 M128A <?>
fx_Xmm6 M128A <?>
fx_Xmm7 M128A <?>
fx_Xmm8 M128A <?>
fx_Xmm9 M128A <?>
fx_Xmm10 M128A <?>
fx_Xmm11 M128A <?>
fx_Xmm12 M128A <?>
fx_Xmm13 M128A <?>
fx_Xmm14 M128A <?>
fx_Xmm15 M128A <?>
ends
ends
c_VectorRegister M128A 26 dup(<?>)
c_VectorControl qword ?
c_DebugControl qword ?
c_LastBranchToRip qword ?
c_LastBranchFromRip qword ?
c_LastExceptionToRip qword ?
c_LastExceptionFromRip qword ?
CONTEXT ends
endif
; namespace crashpad {
; void CaptureContext(CONTEXT* context);
; } // namespace crashpad
ifdef _M_IX86
CAPTURECONTEXT_SYMBOL equ ?CaptureContext@crashpad@@YAXPAU_CONTEXT@@@Z
elseifdef _M_X64
CAPTURECONTEXT_SYMBOL equ ?CaptureContext@crashpad@@YAXPEAU_CONTEXT@@@Z
endif
_TEXT segment
public CAPTURECONTEXT_SYMBOL
ifdef _M_IX86
CAPTURECONTEXT_SYMBOL proc
push ebp
mov ebp, esp
; pushfd first, because some instructions affect eflags. eflags will be in
; [ebp-4].
pushfd
; Save the original value of ebx, and use ebx to hold the CONTEXT* argument.
; The original value of ebx will be in [ebp-8].
push ebx
mov ebx, [ebp+8]
; General-purpose registers whose values haven’t changed can be captured
; directly.
mov [ebx.CONTEXT].c_Edi, edi
mov [ebx.CONTEXT].c_Esi, esi
mov [ebx.CONTEXT].c_Edx, edx
mov [ebx.CONTEXT].c_Ecx, ecx
mov [ebx.CONTEXT].c_Eax, eax
; Now that the original value of edx has been saved, it can be repurposed to
; hold other registers’ values.
; The original ebx was saved on the stack above.
mov edx, dword ptr [ebp-8]
mov [ebx.CONTEXT].c_Ebx, edx
; The original ebp was saved on the stack in this function’s prologue.
mov edx, dword ptr [ebp]
mov [ebx.CONTEXT].c_Ebp, edx
; eip can’t be accessed directly, but the return address saved on the stack
; by the call instruction that reached this function can be used.
mov edx, dword ptr [ebp+4]
mov [ebx.CONTEXT].c_Eip, edx
; The original eflags was saved on the stack above.
mov edx, dword ptr [ebp-4]
mov [ebx.CONTEXT].c_EFlags, edx
; esp was saved in ebp in this function’s prologue, but the caller’s esp is 8
; more than this value: 4 for the original ebp saved on the stack in this
; function’s prologue, and 4 for the return address saved on the stack by the
; call instruction that reached this function.
lea edx, [ebp+8]
mov [ebx.CONTEXT].c_Esp, edx
; The segment registers are 16 bits wide, but CONTEXT declares them as
; unsigned 32-bit values, so zero the top half.
xor edx, edx
mov dx, gs
mov [ebx.CONTEXT].c_SegGs, edx
mov dx, fs
mov [ebx.CONTEXT].c_SegFs, edx
mov dx, es
mov [ebx.CONTEXT].c_SegEs, edx
mov dx, ds
mov [ebx.CONTEXT].c_SegDs, edx
mov dx, cs
mov [ebx.CONTEXT].c_SegCs, edx
mov dx, ss
mov [ebx.CONTEXT].c_SegSs, edx
; Prepare for the string move that will populate the ExtendedRegisters area,
; or the string store that will zero it.
cld
; Use cpuid 1 to check whether fxsave is supported. If it is, perform it
; before fnsave because fxsave is a less-destructive operation.
mov esi, ebx
mov eax, 1
cpuid
mov ebx, esi
test edx, 01000000 ; FXSR
jnz $FXSave
; fxsave is not supported. Set ContextFlags to not include
; CONTEXT_EXTENDED_REGISTERS, and zero the ExtendedRegisters area.
mov [ebx.CONTEXT].c_ContextFlags, CONTEXT_i386 or \
CONTEXT_CONTROL or \
CONTEXT_INTEGER or \
CONTEXT_SEGMENTS or \
CONTEXT_FLOATING_POINT
lea edi, [ebx.CONTEXT].c_ExtendedRegisters
xor eax, eax
mov ecx, MAXIMUM_SUPPORTED_EXTENSION / sizeof(dword) ; 128
rep stosd
jmp $FXSaveDone
$FXSave:
; fxsave is supported. Set ContextFlags to include CONTEXT_EXTENDED_REGISTERS.
mov [ebx.CONTEXT].c_ContextFlags, CONTEXT_i386 or \
CONTEXT_CONTROL or \
CONTEXT_INTEGER or \
CONTEXT_SEGMENTS or \
CONTEXT_FLOATING_POINT or \
CONTEXT_EXTENDED_REGISTERS
; fxsave requires a 16 byte-aligned destination memory area. Nothing
; guarantees the alignment of a CONTEXT structure, so create a temporary
; aligned fxsave destination on the stack.
and esp, 0fffffff0h
sub esp, MAXIMUM_SUPPORTED_EXTENSION
; Zero out the temporary fxsave area before performing the fxsave. Some of the
; fxsave area may not be written by fxsave, and some is definitely not written
; by fxsave.
mov edi, esp
xor eax, eax
mov ecx, MAXIMUM_SUPPORTED_EXTENSION / sizeof(dword) ; 128
rep stosd
fxsave [esp]
; Copy the temporary fxsave area into the CONTEXT structure.
lea edi, [ebx.CONTEXT].c_ExtendedRegisters
mov esi, esp
mov ecx, MAXIMUM_SUPPORTED_EXTENSION / sizeof(dword) ; 128
rep movsd
; Free the stack space used for the temporary fxsave area.
lea esp, [ebp-8]
; TODO(mark): AVX/xsave support. https://crashpad.chromium.org/bug/58
$FXSaveDone:
; fnsave reinitializes the FPU with an implicit finit operation, so use frstor
; to restore the original state.
fnsave [ebx.CONTEXT].c_FloatSave
frstor [ebx.CONTEXT].c_FloatSave
; cr0 is inaccessible from user code, and this field would not be used anyway.
mov [ebx.CONTEXT].c_FloatSave.f_Cr0NpxState, 0
; The debug registers can’t be read from user code, so zero them out in the
; CONTEXT structure. context->ContextFlags doesn’t indicate that they are
; present.
mov [ebx.CONTEXT].c_Dr0, 0
mov [ebx.CONTEXT].c_Dr1, 0
mov [ebx.CONTEXT].c_Dr2, 0
mov [ebx.CONTEXT].c_Dr3, 0
mov [ebx.CONTEXT].c_Dr6, 0
mov [ebx.CONTEXT].c_Dr7, 0
; Clean up by restoring clobbered registers, even those considered volatile
; by the ABI, so that the captured context represents the state at this
; function’s exit.
mov edi, [ebx.CONTEXT].c_Edi
mov esi, [ebx.CONTEXT].c_Esi
mov edx, [ebx.CONTEXT].c_Edx
mov ecx, [ebx.CONTEXT].c_Ecx
mov eax, [ebx.CONTEXT].c_Eax
pop ebx
popfd
pop ebp
ret
CAPTURECONTEXT_SYMBOL endp
elseifdef _M_X64
CAPTURECONTEXT_SYMBOL proc frame
push rbp
.pushreg rbp
mov rbp, rsp
.setframe rbp, 0
; Note that 16-byte stack alignment is not maintained because this function
; does not call out to any other.
; pushfq first, because some instructions affect rflags. rflags will be in
; [rbp-8].
pushfq
.allocstack 8
.endprolog
mov [rcx.CONTEXT].c_ContextFlags, CONTEXT_AMD64 or \
CONTEXT_CONTROL or \
CONTEXT_INTEGER or \
CONTEXT_SEGMENTS or \
CONTEXT_FLOATING_POINT
; General-purpose registers whose values haven’t changed can be captured
; directly.
mov [rcx.CONTEXT].c_Rax, rax
mov [rcx.CONTEXT].c_Rdx, rdx
mov [rcx.CONTEXT].c_Rbx, rbx
mov [rcx.CONTEXT].c_Rsi, rsi
mov [rcx.CONTEXT].c_Rdi, rdi
mov [rcx.CONTEXT].c_R8, r8
mov [rcx.CONTEXT].c_R9, r9
mov [rcx.CONTEXT].c_R10, r10
mov [rcx.CONTEXT].c_R11, r11
mov [rcx.CONTEXT].c_R12, r12
mov [rcx.CONTEXT].c_R13, r13
mov [rcx.CONTEXT].c_R14, r14
mov [rcx.CONTEXT].c_R15, r15
; Because of the calling convention, there’s no way to recover the value of
; the caller’s rcx as it existed prior to calling this function. This
; function captures a snapshot of the register state at its return, which
; involves rcx containing a pointer to its first argument.
mov [rcx.CONTEXT].c_Rcx, rcx
; Now that the original value of rax has been saved, it can be repurposed to
; hold other registers’ values.
; Save mxcsr. This is duplicated in context->FltSave.MxCsr, saved by fxsave
; below.
stmxcsr [rcx.CONTEXT].c_MxCsr
; Segment registers.
mov [rcx.CONTEXT].c_SegCs, cs
mov [rcx.CONTEXT].c_SegDs, ds
mov [rcx.CONTEXT].c_SegEs, es
mov [rcx.CONTEXT].c_SegFs, fs
mov [rcx.CONTEXT].c_SegGs, gs
mov [rcx.CONTEXT].c_SegSs, ss
; The original rflags was saved on the stack above. Note that the CONTEXT
; structure only stores eflags, the low 32 bits. The high 32 bits in rflags
; are reserved.
mov rax, qword ptr [rbp-8]
mov [rcx.CONTEXT].c_EFlags, eax
; rsp was saved in rbp in this function’s prologue, but the caller’s rsp is
; 16 more than this value: 8 for the original rbp saved on the stack in this
; function’s prologue, and 8 for the return address saved on the stack by the
; call instruction that reached this function.
lea rax, [rbp+16]
mov [rcx.CONTEXT].c_Rsp, rax
; The original rbp was saved on the stack in this function’s prologue.
mov rax, qword ptr [rbp]
mov [rcx.CONTEXT].c_Rbp, rax
; rip can’t be accessed directly, but the return address saved on the stack by
; the call instruction that reached this function can be used.
mov rax, qword ptr [rbp+8]
mov [rcx.CONTEXT].c_Rip, rax
; Zero out the fxsave area before performing the fxsave. Some of the fxsave
; area may not be written by fxsave, and some is definitely not written by
; fxsave. This also zeroes out the rest of the CONTEXT structure to its end,
; including the unused VectorRegister and VectorControl fields, and the debug
; control register fields.
mov rbx, rcx
cld
lea rdi, [rcx.CONTEXT].c_FltSave
xor rax, rax
mov rcx, (sizeof(CONTEXT) - CONTEXT.c_FltSave) / sizeof(qword) ; 122
rep stosq
mov rcx, rbx
; Save the floating point (including SSE) state. The CONTEXT structure is
; declared as 16-byte-aligned, which is correct for this operation.
fxsave [rcx.CONTEXT].c_FltSave
; TODO(mark): AVX/xsave support. https://crashpad.chromium.org/bug/58
; The register parameter home address fields aren’t used, so zero them out.
mov [rcx.CONTEXT].c_P1Home, 0
mov [rcx.CONTEXT].c_P2Home, 0
mov [rcx.CONTEXT].c_P3Home, 0
mov [rcx.CONTEXT].c_P4Home, 0
mov [rcx.CONTEXT].c_P5Home, 0
mov [rcx.CONTEXT].c_P6Home, 0
; The debug registers can’t be read from user code, so zero them out in the
; CONTEXT structure. context->ContextFlags doesn’t indicate that they are
; present.
mov [rcx.CONTEXT].c_Dr0, 0
mov [rcx.CONTEXT].c_Dr1, 0
mov [rcx.CONTEXT].c_Dr2, 0
mov [rcx.CONTEXT].c_Dr3, 0
mov [rcx.CONTEXT].c_Dr6, 0
mov [rcx.CONTEXT].c_Dr7, 0
; Clean up by restoring clobbered registers, even those considered volatile by
; the ABI, so that the captured context represents the state at this
; function’s exit.
mov rax, [rcx.CONTEXT].c_Rax
mov rbx, [rcx.CONTEXT].c_Rbx
mov rdi, [rcx.CONTEXT].c_Rdi
popfq
pop rbp
ret
CAPTURECONTEXT_SYMBOL endp
endif
_TEXT ends
end
| 27.844106
| 80
| 0.696914
|
44c4c2dc23071179e90aed55b497189e41ef0e56
| 8,540
|
asm
|
Assembly
|
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xa0.log_21829_1412.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xa0.log_21829_1412.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/US/_zr_/i9-9900K_12_0xa0.log_21829_1412.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 %r13
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x1d684, %rdx
nop
nop
cmp %r12, %r12
and $0xffffffffffffffc0, %rdx
movaps (%rdx), %xmm6
vpextrq $0, %xmm6, %rsi
nop
nop
and %r13, %r13
lea addresses_A_ht+0x4596, %r11
nop
nop
nop
nop
cmp %rbp, %rbp
movl $0x61626364, (%r11)
nop
nop
nop
nop
nop
xor $53643, %r11
lea addresses_WT_ht+0x79d6, %r12
nop
nop
nop
sub %r11, %r11
movb $0x61, (%r12)
nop
nop
cmp $52416, %rsi
lea addresses_normal_ht+0x17dd6, %rsi
lea addresses_WT_ht+0x11616, %rdi
nop
inc %r12
mov $56, %rcx
rep movsl
nop
nop
and $35412, %rbp
lea addresses_WT_ht+0x1c326, %r13
nop
nop
nop
nop
inc %rdi
mov (%r13), %rdx
nop
nop
nop
lfence
lea addresses_UC_ht+0xedd6, %rdi
cmp $17989, %r11
mov (%rdi), %r12d
nop
nop
inc %r13
lea addresses_UC_ht+0x1eaef, %r12
nop
add $57471, %r13
mov (%r12), %di
nop
nop
nop
cmp $36070, %r12
lea addresses_D_ht+0x1b520, %rsi
nop
nop
nop
nop
xor %r13, %r13
movups (%rsi), %xmm3
vpextrq $1, %xmm3, %rbp
nop
nop
nop
nop
inc %rbp
lea addresses_D_ht+0x555e, %rsi
lea addresses_UC_ht+0xef34, %rdi
nop
nop
nop
nop
nop
inc %rdx
mov $38, %rcx
rep movsq
nop
nop
dec %rdi
lea addresses_WT_ht+0xdb16, %rdi
clflush (%rdi)
nop
add $15969, %rcx
movb (%rdi), %r13b
nop
cmp %r11, %r11
lea addresses_D_ht+0x10de6, %rsi
lea addresses_A_ht+0x1a7d6, %rdi
xor %r11, %r11
mov $91, %rcx
rep movsb
nop
nop
nop
nop
nop
add $3417, %rdi
lea addresses_A_ht+0x5bd6, %rdi
nop
nop
nop
nop
nop
sub $50715, %rbp
mov (%rdi), %rdx
nop
nop
nop
nop
nop
mfence
lea addresses_WT_ht+0x45d6, %rsi
lea addresses_D_ht+0x8256, %rdi
nop
cmp $1836, %rdx
mov $82, %rcx
rep movsb
nop
xor %rcx, %rcx
lea addresses_UC_ht+0x157e0, %r13
nop
nop
nop
nop
xor %rbp, %rbp
vmovups (%r13), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $1, %xmm2, %r11
nop
nop
nop
nop
sub $38065, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r8
push %r9
push %rbp
push %rdx
push %rsi
// Load
lea addresses_US+0x4c76, %rdx
nop
cmp %r12, %r12
vmovups (%rdx), %ymm7
vextracti128 $1, %ymm7, %xmm7
vpextrq $0, %xmm7, %r9
nop
nop
nop
sub %rsi, %rsi
// Store
lea addresses_UC+0x9f16, %r12
nop
nop
nop
nop
nop
sub %rbp, %rbp
mov $0x5152535455565758, %r8
movq %r8, %xmm5
movups %xmm5, (%r12)
nop
nop
nop
and $16156, %rdx
// Store
lea addresses_normal+0xf076, %r9
nop
nop
nop
nop
nop
cmp %r8, %r8
mov $0x5152535455565758, %rsi
movq %rsi, (%r9)
nop
add $64587, %r12
// Store
lea addresses_WC+0x3242, %r13
nop
nop
nop
nop
nop
and $29795, %r8
movw $0x5152, (%r13)
nop
nop
nop
nop
xor %rsi, %rsi
// Faulty Load
lea addresses_US+0x1d9d6, %r12
nop
nop
nop
cmp $16593, %r8
movb (%r12), %r9b
lea oracles, %rbp
and $0xff, %r9
shlq $12, %r9
mov (%rbp,%r9,1), %r9
pop %rsi
pop %rdx
pop %rbp
pop %r9
pop %r8
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_US', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_UC', 'AVXalign': False, 'size': 16}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_normal', 'AVXalign': False, 'size': 8}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_WC', 'AVXalign': False, 'size': 2}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': True, 'congruent': 1, 'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1}}
{'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_WT_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT_ht', 'AVXalign': True, 'size': 8}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 10, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 3, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'src': {'same': True, 'congruent': 5, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 1, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'}
{'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
*/
| 30.391459
| 2,999
| 0.654215
|
6cce20f495d01532ce90e097064af7152900e290
| 658
|
asm
|
Assembly
|
oeis/099/A099072.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/099/A099072.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/099/A099072.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A099072: First differences of A000960, divided by 2.
; Submitted by Jon Maiga
; 1,2,3,3,4,6,5,7,8,6,9,12,7,17,13,8,15,18,9,21,19,6,30,11,24,19,23,18,30,27,22,18,42,11,30,42,9,39,36,30,19,56,6,48,57,13,44,46,17,45,69,13,41,49,56,27,85,18,30,84,26,64,26,64,47,54,45,94,17,36,85,60,23,79,98
mov $2,$0
mov $4,2
lpb $4
mov $0,$2
sub $4,1
add $0,$4
trn $0,1
add $0,1
seq $0,960 ; Flavius Josephus's sieve: Start with the natural numbers; at the k-th sieving step, remove every (k+1)-st term of the sequence remaining after the (k-1)-st sieving step; iterate.
div $0,2
mov $5,$4
mul $5,$0
add $3,$5
lpe
min $2,1
mul $2,$0
mov $0,$3
sub $0,$2
| 28.608696
| 209
| 0.638298
|
a937bc9d47e0d6088e16e2cad6118ade136f6d42
| 345
|
asm
|
Assembly
|
programs/oeis/062/A062378.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/062/A062378.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/062/A062378.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A062378: n divided by largest cubefree factor of n.
; 1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,2,1,1,3,1,1,1,1,8,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,4,1,1,1,1,1,3,1,2,1,1,1,1,1,1,1,16,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,4,9,1,1,1,1,1,1,2,1,1,1,1,1,1,1,8,1,1,1,1
seq $0,336551 ; a(n) = A003557(n) - 1.
seq $0,336551 ; a(n) = A003557(n) - 1.
add $0,1
| 49.285714
| 202
| 0.547826
|
23f82c4ee2d4db8e82d116bca2dd61ec2a9c05cf
| 685
|
asm
|
Assembly
|
programs/oeis/185/A185109.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/185/A185109.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/185/A185109.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A185109: a(0)=2; for n > 0, a(n) = (n+2)*a(n-1) + 1.
; 2,7,29,146,877,6140,49121,442090,4420901,48629912,583558945,7586266286,106207728005,1593115920076,25489854721217,433327530260690,7799895544692421,148198015349156000,2963960306983120001,62243166446645520022,1369349661826201440485,31495042222002633131156,755881013328063195147745,18897025333201579878693626,491322658663241076846034277,13265711783907509074842925480,371439929949410254095601913441,10771757968532897368772455489790,323152739055986921063173664693701,10017734910735594552958383605504732,320567517143539025694668275376151425
mov $1,1
mov $2,3
lpb $0
sub $0,1
add $1,1
mul $1,$2
add $2,1
lpe
add $1,1
mov $0,$1
| 48.928571
| 535
| 0.836496
|
8b53080cd8b45db437956039a9e0e6e675018175
| 291
|
asm
|
Assembly
|
kern/i686/tasking/userspace_jump.asm
|
greck2908/LudOS
|
db38455eb33dfc0dfc6d4be102e6bd54d852eee8
|
[
"MIT"
] | 44
|
2018-01-28T20:07:48.000Z
|
2022-02-11T22:58:49.000Z
|
kern/i686/tasking/userspace_jump.asm
|
greck2908/LudOS
|
db38455eb33dfc0dfc6d4be102e6bd54d852eee8
|
[
"MIT"
] | 2
|
2017-09-12T15:38:16.000Z
|
2017-11-05T12:19:01.000Z
|
kern/i686/tasking/userspace_jump.asm
|
greck2908/LudOS
|
db38455eb33dfc0dfc6d4be102e6bd54d852eee8
|
[
"MIT"
] | 8
|
2018-08-17T13:30:57.000Z
|
2021-06-25T16:56:12.000Z
|
global userspace_jump
userspace_jump:
cli ; disable instructions
pop esp ; reg_frame (= mov esp, [esp+0x0])
;;;;;;;;;;;;
pop gs ; segment registers
pop fs
pop es
pop ds
popad ; restore gprs
add esp, 8 ; int_no and err_code
iret ; to user land !
| 16.166667
| 46
| 0.594502
|
4580c881fd1d493621a0ba64d305c8e6fc23f8b2
| 3,586
|
asm
|
Assembly
|
lab/task1_blink.asm
|
knodel/msp430lab
|
2dc6237b0bb677e85dda2a7ec51ad290c69ba94f
|
[
"MIT"
] | 2
|
2019-09-16T02:15:26.000Z
|
2020-11-04T09:15:26.000Z
|
lab/task1_blink.asm
|
knodel/msp430lab
|
2dc6237b0bb677e85dda2a7ec51ad290c69ba94f
|
[
"MIT"
] | null | null | null |
lab/task1_blink.asm
|
knodel/msp430lab
|
2dc6237b0bb677e85dda2a7ec51ad290c69ba94f
|
[
"MIT"
] | null | null | null |
;------------------------------------------------------------------------------
; MIT License
;
; Copyright (c) 2019 Oliver Knodel
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in all
; copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
; MSP430G2231
; -----------------
; /|\| XIN|-
; | | |
; --|RST XOUT|-
; | |
; | P1.0|--> LED red
; Buton -->|P1.3 P1.6|--> LED green
; | |
; -----------------
;
; Blinking LED example for the red LED
; The delays are realised by two Wait-Loops
;------------------------------------------------------------------------------
.cdecls C,LIST,"msp430g2231.h" ; cdecls tells assembler to allow
; the c header file
COUNT .equ 0x0004 ; delay count
;------------------------------------------------------------------------------
; Main Code
;------------------------------------------------------------------------------
.text ; program start
.global _main ; define entry point
_main mov.w #0280h,SP ; initialize stack pointer
mov.w #WDTPW+WDTHOLD,&WDTCTL ; stop watchdog timer
bis.b #01000001b,&P1DIR ; make P1.0 and P1.6 output
bis.b #00000001b,&P1OUT
bic.b #01000000b,&P1OUT
Mainloop xor.b #01000001b,&P1OUT
call #LongWait
jmp Mainloop
;------------------------------------------------------------------------------
; Subroutines
;------------------------------------------------------------------------------
LongWait push SR
push R15
mov.w #COUNT,R15
LongWait_l dec.w R15
call #ShortWait
jnz LongWait_l
pop R15
pop SR
ret
ShortWait push SR
push R15
mov.w #0x0,R15
ShortWait_l dec.w R15
jnz ShortWait_l
pop R15
pop SR
ret
;------------------------------------------------------------------------------
; Interrupt Vectors
;------------------------------------------------------------------------------
.sect ".reset" ; MSP430 RESET Vector
.short _main
.end
| 37.747368
| 80
| 0.4314
|
613859a8a1e92a891569f3a43bef8ee9cfa161f9
| 246
|
asm
|
Assembly
|
programs/oeis/139/A139161.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/139/A139161.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/139/A139161.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A139161: a(n)=(prime(n)!+3)/3.
; 3,41,1681,13305601,2075673601,118562476032001,40548366802944001,8617338912961658880001,2947253997913233984847872000001,2740946218059307605908520960000001
add $0,1
seq $0,131491 ; 2*prime(n)!.
div $0,6
add $0,1
| 30.75
| 155
| 0.784553
|
6005f6615fb7a9f8a04bcce4ce6ade3186b92369
| 165
|
asm
|
Assembly
|
01. 8051/01. Introduction/Prog4.asm
|
nitrece/microprocessor-laboratory
|
40d9e41537e56fb049ef6230fcaaaee3b5d3b121
|
[
"MIT"
] | null | null | null |
01. 8051/01. Introduction/Prog4.asm
|
nitrece/microprocessor-laboratory
|
40d9e41537e56fb049ef6230fcaaaee3b5d3b121
|
[
"MIT"
] | null | null | null |
01. 8051/01. Introduction/Prog4.asm
|
nitrece/microprocessor-laboratory
|
40d9e41537e56fb049ef6230fcaaaee3b5d3b121
|
[
"MIT"
] | null | null | null |
org 0h
mov dptr, #200h
mov r0, #0
mov r1, #40h
loop:
mov a, r0
movc a, @a+dptr
jz p_end
mov @r1, a
inc r0
inc r1
sjmp loop
p_end:
org 200h
db "Subhajit Sahu", 0
end
| 9.705882
| 21
| 0.672727
|
f3d71852fae1c1e01830252f472b32c39ed9e5e6
| 41,628
|
asm
|
Assembly
|
fish.asm
|
mgr-inz-rafal/wytyczne-rybne
|
5fbac5d9ca9a159868cfe7cd706ec71e0ab3c5f6
|
[
"MIT"
] | null | null | null |
fish.asm
|
mgr-inz-rafal/wytyczne-rybne
|
5fbac5d9ca9a159868cfe7cd706ec71e0ab3c5f6
|
[
"MIT"
] | null | null | null |
fish.asm
|
mgr-inz-rafal/wytyczne-rybne
|
5fbac5d9ca9a159868cfe7cd706ec71e0ab3c5f6
|
[
"MIT"
] | null | null | null |
opt m+r+
; Selected ATARI registes
icl 'atari.inc'
pstart equ $2000
scr_rowsize equ 40
scr_lines equ 96
scr_lastb equ scr_mem_0+scr_rowsize*(scr_lines-1)+(scr_rowsize-1)
scr_size equ scr_lastb-scr_mem_0+1
fishdimx equ 32 ; Horizontal dimension of fish (in pixels)
fishdimy equ 32 ; Vertical dimension of fish (in pixels)
fishpxperb equ 4 ; Pixels per byte (ie. 10 00 10 11)
fishbperrow equ fishdimx/fishpxperb ; Bytes for each row
fishsize equ fishbperrow*fishdimy ; Bytes per fish
fishtpspprt equ 5 ; Fish types per part (ie. 5 heads, 5 tails, etc.)
fishparts equ 4 ; Head, Upper body, Lower body, Tail
fishestotal equ fishtpspprt*fishparts ; Total number of fishes
fishtotbts equ fishestotal*fishsize ; Total bytes for all fishes
fish_maxy equ scr_lines-fishdimy ; Maximum vertical fish position
fish_maxx equ scr_rowsize-fishbperrow ; Maximum horizontal fish position
fishchain_x equ 0
fishchain_len equ 5
fishslot_x equ fishbperrow
fishslot_y equ fishdimy*2
fishslot_len equ 4
fish_color_0 equ 21
fish_color_1 equ 98
fish_color_2 equ 207
fish_color_bg equ 0
busted_color_0 equ 49
busted_color_1 equ 54
busted_color_2 equ $00
busted_color_bg equ $0f
congra_color_0 equ 117
congra_color_1 equ 123
congra_color_2 equ $00
congra_color_bg equ $0f
tool_init_y equ $20
tool_init_x equ $2b
tool_color equ $0f
tool_apart equ $a2
tool_height equ 64
tool_at_bottom equ tool_height+tool_init_y-2
funnel_init_x equ fishbperrow*2
funnel_y equ fishdimy
funnel_at_left equ fishbperrow
funnel_at_right equ fishbperrow*fishparts
slots_y equ fishdimy*2
number_count equ fishslot_len ; 3, 2, 1, 0
count_delay equ 50
level_count equ 20
level_delay_inc equ 13
busted_count equ 4 ; 4 segments of "BUSTED" text
busted_width equ 111 ; Pixels
congrats_count equ 5 ; 5 segments of "CONGRATULATIONS" text
titlefish_count equ 4 ; 4 segments of the title fish graphics
titlefish_width equ 125 ; Pixels
lives_count equ 4
; Fish chain states
.zpvar fcstate .byte
FC_STATIONARY equ 0
FC_MOVINGLEFT equ 1
FC_MOVINGRIGHT equ 2
FC_DROPPING equ 3 ; Fish going into funnel
FC_CONSTRUCTING equ 4 ; Fish going from funnel to slot
; Game states
.zpvar gstate .byte
GS_GUIDELINES equ 0 ; Fish guidelines are shown
GS_CUNTDOWN equ 1 ; C(o)untdown before the guidelines ;-)
GS_CONSTRUCTION equ 2 ; Player is constructing the fish
GS_GAME_OVER equ 3 ; The game is over
; Tool states
.zpvar tstate .byte
TS_STATIONARY equ 0
TS_MOVING_DOWN equ 1
TS_MOVING_UP equ 2
; Funnel states
.zpvar fstate .byte
FU_STATIONARY equ 0
FU_MOVINGLEFT equ 1
FU_MOVINGRIGHT equ 2
.zpvar fishdry .byte ; Used when moving fish vertically
.zpvar erase_r .byte ; Used by rectangle draving routine...
.zpvar erase_l .byte ; ...to check whether rightmost or...
; ...leftmost column should get erased
.zpvar funnl_x .byte ; Horizontal position of funnel
.zpvar tool_y .byte ; Current vertical position of tool
.zpvar pscr .word ; Pointer to current screen
.zpvar pnscr .word ; Pointer to next screen
.zpvar ffeedof .byte ; Fish feeding offset
.zpvar fishmov .byte ; Fish move counters,
; when =0 fish chain is aligned
; (used also for funnel movement)
.zpvar ptr0 .word ; General purpose pointers
.zpvar ptr1 .word ; ...
.zpvar ptr2 .word ; ...ditto
.zpvar cntr0 .byte ; General purpose counter
.zpvar drf_x .byte ; Used by fish-drawing routine...
.zpvar drf_y .byte ; ...to draw at given coordinates
.zpvar tmp0 .byte ; General purpose temporary value
.zpvar tmp1 .byte ; ...
.zpvar tmp2 .byte ; ...
.zpvar tmp3 .byte ; ...
.zpvar tmp4 .byte ; ...ditto
.zpvar delayt .byte ; Delay time, used by delay routine
.zpvar delayt2 .byte ; ...ditto
.zpvar level .byte ; Current level
.zpvar lives .byte ; Number of lives
.zpvar english .byte ; If 1 then english version
.zpvar silence .byte ; If 1 then no music
.zpvar crunched .byte ; If 1 then no more decrunching
; Here we begin!
org pstart
.align $1000
scr_mem_0
ins "graphics/backgrnd.sra"
tab_fish_ypos_0 ; Y-coordinate tabs for screen 0
.rept fish_maxy+1
dta a(scr_mem_0+scr_rowsize*#)
.endr
tab_fish_ypos_0_len equ *-tab_fish_ypos_0
.align $1000
scr_mem_1
ins "graphics/backgrnd.sra"
tab_fish_ypos_1 ; Y-coordinate tabs for screen 1
.rept fish_maxy+1
dta a(scr_mem_1+scr_rowsize*#)
.endr
tab_fish_ypos_1_len equ *-tab_fish_ypos_1
fishdata
.rept fishestotal, #/fishtpspprt, #%fishtpspprt
.if :2=0
fishparts_:1
.endif
fish_:1_:2
ins "graphics/p:1_:2.sra"
.endr
funnel_data
ins "graphics/funnel.sra"
empty_data
ins "graphics/empty.sra"
.rept number_count, 3-#
numbitmap_:1
ins "graphics/no:1.sra"
.endr
level_data
.rept level_count, #+1
ins "graphics/level:1.sra"
.endr
lives_data
.rept lives_count, 3-#
ins "graphics/lives:1.sra"
.endr
busted_data
.rept busted_count, #+1
ins "graphics/busted:1.sra"
.endr
congrats_data
.rept congrats_count, #+1
ins "graphics/congrat:1.sra"
.endr
titlefish_data
.rept titlefish_count, #+1
ins "graphics/fish:1.sra"
.endr
badfish_data
ins "graphics/badfish.sra"
goodfish_data
ins "graphics/goodfish.sra"
run_here
cld
ldx #1
stx silence
dex
stx crunched
ldy <vbi_routine
ldx >vbi_routine
lda #7
jsr SETVBV
run_again mwa #scr_mem_0 pscr
mwa #scr_mem_1 pnscr
jsr title_screen
jsr disable_antic
mwa #scr_size ptr2
lda #0
jsr fill_screen
jsr flip_screens
mwa #scr_size ptr2
lda #0
jsr fill_screen
jsr game_init
jsr enable_antic
jsr gfx_init
jsr game_loop
; Unreachable :)
chuj jmp chuj
disable_antic
lda SDMCTL
sta tmp4
lda #0
sta SDMCTL
rts
enable_antic
lda tmp4
sta SDMCTL
rts
title_dli_routine
phr
lda VCOUNT
; Fish picture
cmp #$0f
bne tdr_a
lda #216
ldx #221
ldy #$79
sta WSYNC
sta COLPF0
stx COLPF1
sty COLPF2
lda #0
sta COLPF3
sta COLBK
jmp tdr_x
; Shade of water #1
tdr_a cmp #$17
bne tdr_b
ldy #$77
sta WSYNC
sty COLPF2
jmp tdr_x
; Shade of water #2
tdr_b cmp #$1e
bne tdr_c
ldy #$75
sta WSYNC
sty COLPF2
jmp tdr_x
; Shade of water #3
tdr_c cmp #$25
bne tdr_0
ldy #$73
sta WSYNC
sty COLPF2
jmp tdr_x
; Main title text
tdr_0 cmp #$33
bne tdr_1
lda #>pmg_base
sta CHBASE
lda #$7a
ldx #$ba
ldy #$5a
sta WSYNC
sta COLPF0
stx COLPF1
sty COLPF2
lda #0
sta COLPF3
sta COLBK
:8 sta WSYNC
lda #$77
ldx #$b7
ldy #$57
sta WSYNC
sta COLPF0
stx COLPF1
sty COLPF2
jmp tdr_x
; Title separator
tdr_1 cmp #$3b
bne tdr_2
lda #$00
ldx #$06
ldy #$b2
;sta WSYNC
sta COLPF0
stx COLPF1
sty COLPF2
lda #0
sta COLPF3
sta COLBK
jmp tdr_x
; First subtitle line
tdr_2 cmp #$3f
bne tdr_3
lda #>(pmg_base+512)
sta CHBASE
lda #223
ldx #223
ldy #$00
sta WSYNC
sta COLPF0
stx COLPF1
sty COLPF2
lda #0
sta COLPF3
sta COLBK
jmp tdr_x
; Second subtitle line
tdr_3 cmp #$43
bne tdr_4
lda #216
ldx #216
ldy #$00
sta WSYNC
sta COLPF0
stx COLPF1
sty COLPF2
lda #0
sta COLPF3
sta COLBK
jmp tdr_x
; Main text
tdr_4 cmp #$4b
bne tdr_5
lda #>pmg_base
sta CHBASE
lda #$00
ldx #$0f
ldy #$22
; sta WSYNC
sta COLPF0
stx COLPF1
sty COLPF2
lda #0
sta COLPF3
sta COLBK
jmp tdr_x
; Separator after main text
tdr_5 cmp #$63
bne tdr_6
lda #$00
ldx #$00
ldy #$00
sta WSYNC
sta COLPF0
stx COLPF1
sty COLPF2
lda #0
sta COLPF3
sta COLBK
:5 sta WSYNC
; First footer line
lda #$00
ldx #$0f
ldy #$42
sta WSYNC
sta COLPF0
stx COLPF1
sty COLPF2
lda #0
sta COLPF3
sta COLBK
:7 sta WSYNC
; Second footer line
lda #$00
ldx #$07
ldy #$82
sta WSYNC
sta COLPF0
stx COLPF1
sty COLPF2
lda #0
sta COLPF3
sta COLBK
jmp tdr_x
tdr_6
tdr_x plr
rti
decrunch_dli_routine
phr
lda VCOUNT
; Fish picture
cmp #$0f
bne dddr_a
lda #216
ldx #221
ldy #$79
sta WSYNC
sta COLPF0
stx COLPF1
sty COLPF2
lda #0
sta COLPF3
sta COLBK
jmp dddr_x
; Shade of water #1
dddr_a cmp #$17
bne dddr_b
ldy #$77
sta WSYNC
sty COLPF2
jmp dddr_x
; Shade of water #2
dddr_b cmp #$1e
bne dddr_c
ldy #$75
sta WSYNC
sty COLPF2
jmp dddr_x
; Shade of water #3
dddr_c cmp #$25
bne dddr_0
ldy #$73
sta WSYNC
sty COLPF2
jmp dddr_x
; White text on black screen
dddr_0 cmp #$33
bne dddr_x
lda #$ff
ldy #$00
sta WSYNC
sta COLPF0
sty COLPF2
dddr_6
dddr_x plr
rti
; Sets up the title screen
title_screen
jsr disable_antic
lda #$ff
sta CH
lda #$00
sta COLOR0
sta COLOR1
sta COLOR2
sta COLOR3
sta COLOR4
; Setup display list
ldx <dlist_title
ldy >dlist_title
stx SDLSTL
sty SDLSTL+1
; Setup font
lda #>pmg_base
sta CHBAS
; Clear graphical part of the screen
mwa #scr_rowsize*fishdimy ptr2
lda #%11111111
jsr fill_screen
jsr draw_title_fish
lda crunched
cmp #1
beq @+
jsr decrunching ;-)
; Init DLI
lda <title_dli_routine
sta VDSLST
lda >title_dli_routine
sta VDSLST+1
lda #%11000000
sta NMIEN
@ jsr draw_title_content
jsr enable_antic
jsr play_title_music
; Protect agains accidental game startup
jsr short_delay
ts_1 lda HELPFG
sta ATRACT
cmp #0
beq ts_0
jsr switch_language
ts_0 lda STRIG0
cmp #1
beq ts_1
jsr stop_music
rts
; Switches the current language
switch_language
lda #0
sta HELPFG
inc english
jsr draw_title_content
jsr short_delay
rts
; Provides short delay
short_delay
lda #50
sta delayt
lda #0
sta delayt2
jsr delay
rts
; Provides very short delay
very_short_delay
lda #15
sta delayt
lda #0
sta delayt2
jsr delay
rts
; Draws the content of the title screen
draw_title_content
mwa #scr_mem_1+scr_rowsize*fishdimy ptr0
lda english
and #%00000001
cmp #0
beq dtc_2
mwa #title_content_data_EN ptr1
jmp dtc_3
dtc_2 mwa #title_content_data_PL ptr1
dtc_3 ldy #0
dtc_1 lda (ptr1),y
cmp #$ff
beq dtc_0 ; Done
sta (ptr0),y
inw ptr0
inw ptr1
jmp dtc_1
dtc_0 rts
title_content_data_EN
dta d' F'
dta d'i'
dta d'S'*
dta d'H'
dta d'y '
dta d'g'
dta d'U'*
dta d'I'
dta d'd'
dta d'E'*
dta d'L'
dta d'i'
dta d'N'*
dta d'E'
dta d's '
:20 dta b(126),b(127)
dta d' mgr in'
dta b(24)
dta b(32)
dta d' '
dta b(8)
dta d'afa'
dta b(59)
dta d' '
dta d' music by '
dta b(84)
dta d'n'
dta b(85)
dta d' '
dta d'This is the game about joining fishes '
dta d'that had been sliced apart by using the '
dta d'moving pipe with arrow. Remember the '
dta d'target fish, find correct pieces and '
dta d'reunite them! Time to remember the fish '
dta d'decreases with each level. '
dta d' '
dta d'GAME-COMPO ENTRY for WAP-NIAK 2016 PARTY'*
dta b(74)
dta d'HELP'*
dta b(74+128)
dta d' - polish version v1.1'
dta b($ff)
title_content_data_PL
dta d' W'
dta d'y'
dta d'T'*
dta d'Y'
dta d'c'
dta d'Z'*
dta d'N'
dta d'e '
dta d'R'*
dta d'Y'
dta d'b'
dta d'N'*
dta d'E '
:20 dta b(126),b(127)
dta d' mgr in'
dta b(24)
dta b(32)
dta d' '
dta b(8)
dta d'afa'
dta b(59)
dta d' '
dta d' music by '
dta b(84)
dta d'n'
dta b(85)
dta d' '
dta d'Jest to gra o '
dta b(123)
dta b(81)
dta d'czeniu poszatkowanych '
dta d'ryb w ca'
dta b(123)
dta d'o'
dta b(87)
dta b(86)
dta d' za pomoc'
dta b(81)
dta d' je'
dta b(88)
dta d'd'
dta b(88)
dta b(81)
dta d'cej rury. '
dta d'Zapami'
dta b(68)
dta d'taj kszta'
dta b(123)
dta d't ryby, poszukaj odpo- '
dta d'wiednich cz'
dta b(68)
dta b(87)
dta d'ci i z'
dta b(123)
dta b(80)
dta b(88)
dta d' ca'
dta b(123)
dta d'o'
dta b(87)
dta b(86)
dta d' do kupy. '
dta d'W miar'
dta b(68)
dta d' post'
dta b(68)
dta d'pu prac czas na zapami'
dta b(68)
dta d'ta- '
dta d'nie dok'
dta b(123)
dta d'adnego kszta'
dta b(123)
dta d'tu ulega skr'
dta b(80)
dta d'ceniu.'
dta d' '
dta d'GAME-COMPO ENTRY for WAP-NIAK 2016 PARTY'*
dta b(74)
dta d'HELP'*
dta b(74+128)
dta d' - english version v1.1'
dta b($ff) ; End
; Initializes graphics subsystem
gfx_init
; Setup display list
ldx <dlist
ldy >dlist
stx SDLSTL
sty SDLSTL+1
jsr init_sprites
jsr setup_colors
rts
setup_colors
; Border
lda #$00
sta COLOR4
; Other elements
lda #fish_color_0
sta COLOR0
lda #fish_color_1
sta COLOR1
lda #fish_color_2
sta COLOR2
rts
process_fishchain_state
lda fcstate
cmp #FC_STATIONARY
beq pfcs_2
cmp #FC_MOVINGLEFT
bne pfcs_1
jsr move_fish_chain_left
rts
pfcs_1 cmp #FC_MOVINGRIGHT
bne pfcs_0
jsr move_fish_chain_right
rts
pfcs_0 cmp #FC_DROPPING
bne pfcs_2
jsr drop_current_fish
pfcs_2 rts
; When fish part is being dropped
; this routine will draw an empty
; slot in the place of the fish
; part being dropped
draw_empty_fish_slot
lda funnl_x
sta drf_x
lda #0
sta drf_y
mwa #empty_data ptr1
jsr draw_data_rectangle
rts
; Sets the ptr1 to indicate the fish
; part that is located above the funnel
; Additional:
; - Stores ptr0 also in tmp1/tmp2, because
; the fish drawing routine will destroy
; ptr0. The caller can restore it
; from the temporary values
; - Stores the pointer to appropriate
; fish chain data in ptr2, so at the end
; of the movement it can be replaced with
; empty fish block
prepare_correct_fish_data
jsr funnel_pos_to_ptr
sta tmp0
mwa #tab_fishchain ptr0
lda ptr0
clc
adc tmp0
sta ptr0
sta ptr2
lda ptr0+1
adc #0
sta ptr0+1
sta ptr2+1
ldy #0
lda (ptr0),y
sta ptr1
sta tmp1
iny
lda (ptr0),y
sta ptr1+1
sta tmp2
rts
; Moves into the funnel the fish part
; that is located directly above it
drop_current_fish
jsr draw_empty_fish_slot
jsr prepare_correct_fish_data
; Are we dropping an empty block?
lda ptr1
cmp #<empty_data
bne dcf_1
lda ptr1+1
cmp #>empty_data
bne dcf_1
; Yes. Do not drop.
lda #FC_STATIONARY
sta fcstate
rts
; Now ptr1 = pointer to rectangle
; data representing correct fish part
dcf_1 lda funnl_x
sta drf_x
lda fishdry
sta drf_y
:2 inc fishdry
jsr draw_data_rectangle
jsr draw_funnel
jsr flip_screens
; Is fish part down an the slot?
lda fishdry
cmp #slots_y+2
bne dcf_0
; Yes.
jsr handle_fish_part_in_slot
dcf_0 rts
; Performs all actions that need to be
; executed after the fish part has been
; dropped into the slot
handle_fish_part_in_slot
; Stop the movement
lda #FC_STATIONARY
sta fcstate
:2 dec fishdry
; Recover ptr1 used to draw the rectangle
; from temporary values
lda tmp1
sta ptr1
lda tmp2
sta ptr1+1
; Draw funnel
lda funnl_x
sta drf_x
lda fishdry
sta drf_y
jsr draw_data_rectangle
jsr flip_screens
; Once again, recover ptr1
; from temporary values
lda tmp1
sta ptr1
lda tmp2
sta ptr1+1
; Setup pointers in chain and in slots
jsr adapt_for_empty_block
jsr adapt_dropped_fish
; Check if fish is completed
jsr check_fish_completion
cpx #0
beq hfpis_1
; Validate constructed fish
jsr validate_fish
cpx #0
beq hfpis_0
; The fish is good
jsr good_fish
rts
hfpis_0 jsr bad_fish
hfpis_1 rts
; Draws the image of the bad fish
draw_bad_fish
lda #0
sta drf_x
lda #funnel_y
sta drf_y
mwa #badfish_data ptr1
jsr draw_data_rectangle
rts
; Draws the image of the good fish
draw_good_fish
lda #0
sta drf_x
lda #funnel_y
sta drf_y
mwa #goodfish_data ptr1
jsr draw_data_rectangle
rts
; Called when constructed fish is incorrect
bad_fish
jsr stop_music
dec lives
jsr draw_bad_fish
jsr flip_screens
jsr wait_for_fire
lda lives
cmp #0
beq bf_0
; Still more lives
jsr draw_lives
jsr flip_screens
jsr draw_lives
jsr initialize_target_fish
lda #GS_CUNTDOWN
sta gstate
rts
bf_0 ; No more lives
jsr handle_game_over
rts
; Called when constructed fish is correct
good_fish
jsr stop_music
inc level
jsr draw_good_fish
jsr flip_screens
jsr wait_for_fire
lda level
cmp #level_count+1
beq gf_0
; Still more levels
jsr draw_level
jsr draw_lives
jsr flip_screens
jsr draw_level
jsr draw_lives
jsr initialize_target_fish
lda #GS_CUNTDOWN
sta gstate
rts
gf_0 ; No more levels
jsr handle_congrats
rts
; Performs all actions required to handle
; the finished game process
handle_congrats
lda #GS_GAME_OVER
sta gstate
mwa #scr_size ptr2
lda #$ff
jsr fill_screen
jsr draw_congrats
; Set appropriate colors
lda #congra_color_0
sta COLOR0
lda #congra_color_1
sta COLOR1
lda #congra_color_2
sta COLOR3
lda #congra_color_bg
sta COLOR2
; Hide tool
lda #0
sta HPOSP0
sta HPOSP1
jsr flip_screens
rts
; Performs all actions required to handle
; the game over process
handle_game_over
lda #GS_GAME_OVER
sta gstate
mwa #scr_size ptr2
lda #$ff
jsr fill_screen
jsr draw_busted
; Set appropriate colors
lda #busted_color_0
sta COLOR0
lda #busted_color_1
sta COLOR1
lda #busted_color_2
sta COLOR3
lda #busted_color_bg
sta COLOR2
; Hide tool
lda #0
sta HPOSP0
sta HPOSP1
jsr flip_screens
rts
; Fills the screen with the byte
; stored in A
; Precondition:
; - "ptr2" stores the count of bytes
; that should be cleared
fill_screen
sta tmp0
mwa #0 ptr1
mwa pnscr ptr0
fs_1 lda tmp0
ldy #0
sta (ptr0),y
adw ptr0 #1
inw ptr1
#if .word ptr1 = ptr2
jmp fs_0
#end
jmp fs_1
fs_0 rts
; Draws the "BUSTED" message
draw_busted
ldx #busted_count
lda #(scr_rowsize-(busted_width/fishpxperb))/2
sta drf_x
pha
lda #funnel_y
sta drf_y
mwa #busted_data ptr1
db_3 jsr draw_data_rectangle
dex
cpx #0
beq db_0
pla
clc
adc #fishbperrow
sta drf_x
pha
jmp db_3
db_0 pla
rts
; Draws the "CONGRATS" message
draw_congrats
ldx #congrats_count
lda #0
sta drf_x
pha
lda #funnel_y
sta drf_y
mwa #congrats_data ptr1
dc_3 jsr draw_data_rectangle
dex
cpx #0
beq dc_0
pla
clc
adc #fishbperrow
sta drf_x
pha
jmp dc_3
dc_0 pla
rts
; Draws the title fish
draw_title_fish
ldx #titlefish_count
lda #(scr_rowsize-(titlefish_width/fishpxperb))/2
sta drf_x
pha
lda #0
sta drf_y
mwa #titlefish_data ptr1
dtf_3 jsr draw_data_rectangle
dex
cpx #0
beq dtf_0
pla
clc
adc #fishbperrow
sta drf_x
pha
jmp dtf_3
dtf_0 pla
rts
; Waits until the joystick button is pressed
wait_for_fire
@ lda STRIG0
cmp #1
beq @-
rts
; Checks whether slots are filled
; with correct fish parts
; Retrun:
; X = 0 - fish not valid
; X = 1 - fish valid
validate_fish
ldx #0
.rept fishslot_len, #*2
#if .word tab_fishslots+:1 <> tab_fishguidelines+:1
rts
#end
.endr
inx
rts
; Checks whether all slots are filled
; with fish parts.
; Retrun:
; X = 0 - fish not completed
; X = 1 - fish completed
check_fish_completion
ldx #0
; If any slot is empty
; fish is not completed
.rept fishslot_len, #*2
#if .word tab_fishslots+:1 = #empty_data
rts
#end
.endr
inx
rts
; Converts funnel position
; to the array index
funnel_pos_to_ptr
lda funnl_x
lsr
lsr
rts
; Fills the appropriate slot with the
; fish that has been dropped into it
; Precondition:
; - "ptr1" still valid (pointing to fish
; part being dropped)
adapt_dropped_fish
jsr funnel_pos_to_ptr
sec
sbc #2 ; Skip position #0 since
; it is not used in slots
tay
lda ptr1
sta tab_fishslots,y
iny
lda ptr1+1
sta tab_fishslots,y
rts
; At the end of the fish drop
; this routine modifies the content
; of the fish chain (it inserts
; the pointer to empty block in the
; correct pleace, precalculated in ptr2)
adapt_for_empty_block
ldy #0
lda #<empty_data
sta (ptr2),y
iny
lda #>empty_data
sta (ptr2),y
rts
process_tool_state
lda tstate
cmp #TS_STATIONARY
beq pts_0
cmp #TS_MOVING_DOWN
bne pts_1
jsr move_tool_down
rts
pts_1 cmp #TS_MOVING_UP
bne pts_0
jsr move_tool_up
pts_0 rts
process_funnel_state
lda fstate
cmp #FU_STATIONARY
beq pfs_0
cmp #FU_MOVINGLEFT
bne pfs_1
jsr move_funnel_left
rts
pfs_1 cmp #FC_MOVINGRIGHT
bne pfs_0
jsr move_funnel_right
pfs_0 rts
move_funnel_left
jsr is_funnel_movement_finished
dec funnl_x
inc erase_r
jsr draw_funnel
jsr flip_screens
jsr draw_funnel
dec erase_r
rts
move_funnel_right
jsr is_funnel_movement_finished
inc funnl_x
inc erase_l
jsr draw_funnel
jsr flip_screens
jsr draw_funnel
dec erase_l
rts
move_tool_up
ldx #0
lda tool_y
clc
adc #2
tay
@ lda pmg_p0,y
dey
sta pmg_p0,y
iny
lda pmg_p1,y
dey
sta pmg_p1,y
iny
iny
inx
cpx #tool_height+1
bne @-
dec tool_y
; At the top?
lda tool_y
cmp #tool_init_y-2
bne mtu_0 ; No
lda #TS_STATIONARY ; Yes
sta tstate
mtu_0 rts
move_tool_down
lda tool_y
clc
adc #tool_height
tay
iny
@ lda pmg_p0,y
iny
sta pmg_p0,y
dey
lda pmg_p1,y
iny
sta pmg_p1,y
dey
dey
cpy tool_y
bne @-
inc tool_y
; At the bottom?
lda tool_y
cmp #tool_at_bottom
bne mtd_0 ; No
lda #TS_STATIONARY ; Yes
sta tstate
mtd_0 rts
; Short delay used during countdown
countdown_delay
lda #count_delay
sta delayt
lda #0
sta delayt2
jsr delay
rts
; Shows the countdown sequence
process_countdown
jsr countdown_delay
.rept number_count, 3-#, #*2
jsr play_lo_beep
mwa #numbitmap_:1 tab_fishslots+:2
jsr draw_fish_slots
jsr flip_screens
jsr countdown_delay
.endr
lda #GS_GUIDELINES
sta gstate
rts
; Pauses for the amount of time
; appropriate to the current level
provide_guidelines_delay
ldy level
dey
lda delay_tab_1,y
sta delayt
lda delay_tab_0,y
sta delayt2
jsr delay
; Clear accidental key presses
; made during waiting time
lda #$ff
sta CH
rts
delay_tab_0
:level_count dta b(level_delay_inc*(level_count-#)/256)
delay_tab_1
:level_count dta b(level_delay_inc*(level_count-#)-((level_delay_inc*(level_count-#)/256)*256))
; Shows the fish to be constructed
process_guidelines
ldy #0
pg_0 lda tab_fishguidelines,y
sta tab_fishslots,y
iny
cpy #(fishslot_len*2)
bne pg_0
jsr draw_fish_slots
jsr flip_screens
jsr play_hi_beep
jsr provide_guidelines_delay
; Hide the guidelines
:fishslot_len mwa #empty_data tab_fishslots+#*2
jsr draw_fish_slots
jsr flip_screens
jsr draw_fish_slots
; Begin construction
jsr play_game_music
lda #GS_CONSTRUCTION
sta gstate
rts
; Processes all machine states
; used during the game
process_game_state
lda CH
cmp #$1c ; ESC
bne pgs_4
; Returning to the title screen
; Clear stack, so we can jmp out
; and start from scratch
pla
pla
pla
pla
; Hide tool
lda #0
sta HPOSP0
sta HPOSP1
jmp run_again
pgs_4 lda gstate
cmp #GS_CUNTDOWN
bne pgs_0
jsr process_countdown
rts
pgs_0 cmp #GS_CONSTRUCTION
bne pgs_1
jsr process_fishchain_state
jsr process_tool_state
jsr process_funnel_state
rts
pgs_1 cmp #GS_GUIDELINES
bne pgs_2
jsr process_guidelines
rts
pgs_2 cmp #GS_GAME_OVER
bne pgs_3
jsr process_game_over
pgs_3 rts
; Waits for fire and returns to title screen
process_game_over
jsr wait_for_fire
; Clear stack, so we can jmp out
; and start from scratch
pla
pla
pla
pla
pla
pla
jmp run_again
game_init_common_tasks
mwa #scr_size ptr2
lda #$00
jsr fill_screen
jsr draw_fish_chain
jsr draw_fish_slots
jsr draw_funnel
jsr draw_level
jsr draw_lives
rts
game_init
; Variables
lda #funnel_init_x
sta funnl_x
lda #0
sta erase_l
sta erase_r
lda #1
sta level
lda #lives_count
sta lives
; Initial position and colors
lda #tool_init_x
sta HPOSP0
clc
adc #tool_apart
sta HPOSP1
lda #tool_color
sta PCOLR0
sta PCOLR1
; Fish species to be built
jsr initialize_target_fish
; Reset empty slots
:fishslot_len mwa #empty_data tab_fishslots+#*2
; Draw initial graphics
; on both screens
jsr randomize_fish_chain
jsr game_init_common_tasks
jsr flip_screens
jsr game_init_common_tasks
; Setup state machines
lda #FC_STATIONARY
sta fcstate
lda #GS_CUNTDOWN
sta gstate
lda #TS_STATIONARY
sta tstate
lda #FU_STATIONARY
sta fstate
rts
; Draws the tile with level number
draw_level
mwa #level_data ptr1
ldx level
dl_1 dex
cpx #0
beq dl_0
adw ptr1 #fishsize
jmp dl_1
dl_0 lda #0
sta drf_x
lda #slots_y
sta drf_y
jsr draw_data_rectangle
rts
; Draws the lives indicator
draw_lives
mwa #lives_data ptr1
ldx lives
dli_1 dex
cpx #0
beq dli_0
adw ptr1 #fishsize
jmp dli_1
dli_0 lda #0
sta drf_x
lda #funnel_y
sta drf_y
jsr draw_data_rectangle
rts
; Calls "prepare_target_fish" for each part
initialize_target_fish
.rept fishparts, #, #*2
mwa #fishparts_:1 ptr0
ldy #:2
jsr prepare_target_fish
.endr
rts
; Randomizes each part of the target fish
; Precondition:
; - "ptr0" contains the base of the fish
; part to be generated
; - Y contains the target pointer offset
; where generated fish should be stored
prepare_target_fish
; Put random number [0 to 4] in X
lda RANDOM
and #%00111111
tax
lda prepare_fish_lut,x
tax
; Apply random shift to the offset
ptf3 cpx #0
beq ptf1
adw ptr0 #fishsize
dex
jmp ptf3
ptf1 ; Store in appropriate pointer
mwa ptr0 tab_fishguidelines,y
rts
; LUT for fast fish randomization
prepare_fish_lut
:$100/2/2 dta(#%fishtpspprt)
init_sprites
lda #>pmg_base
sta PMBASE
lda #%00000001
sta GPRIOR
lda #%00000011
sta GRACTL
lda SDMCTL
ora #%00011100
sta SDMCTL
lda #0
sta SIZEP0
sta SIZEP1
rts
draw_funnel
mwa #funnel_data ptr1
lda funnl_x
sta drf_x
lda #funnel_y
sta drf_y
jsr draw_data_rectangle
rts
; Flips the screen buffer
flip_screens
jsr synchro
lda pscr
pha
lda pscr+1
pha
lda pnscr
sta pscr
sta scr_mem_antic
lda pnscr+1
sta pscr+1
sta scr_mem_antic+1
pla
sta pnscr+1
pla
sta pnscr
rts
game_loop
jsr process_game_state
lda STICK0
sta ATRACT
cmp #7
beq stick_right
lda STICK0
cmp #11
beq stick_left
lda STICK0
cmp #13
beq stick_down
lda STICK0
cmp #14
beq stick_up
lda STRIG0
cmp #0
beq button_down
jmp game_loop
stick_right
jsr stick_moved_right
jmp game_loop
stick_left
jsr stick_moved_left
jmp game_loop
stick_down
jsr init_tool_move_down
jmp game_loop
stick_up
jsr init_tool_move_up
jmp game_loop
button_down
jsr init_fish_drop
jmp game_loop
init_fish_drop
; Fish chain must be stopped
lda fcstate
cmp #FC_STATIONARY
bne ifd_0
; Funnel must be stopped
lda fstate
cmp #FU_STATIONARY
bne ifd_0
lda #FC_DROPPING
sta fcstate
lda #2
sta fishdry
ifd_0 rts
stick_moved_left
; Tool at the bottom?
lda tool_y
cmp #tool_at_bottom
bne sml_0 ; No
; Yes - check if funnel can move further
lda funnl_x
cmp #funnel_at_left
beq sml_1
; Check if fish part is not being dropped
lda fcstate
cmp #FC_STATIONARY
bne sml_1
lda #FU_MOVINGLEFT
sta tmp0
jsr init_funnel_move
sml_1 rts
sml_0 lda #FC_MOVINGLEFT
sta tmp0
jsr init_fish_chain_move
rts
stick_moved_right
; Tool at the bottom?
lda tool_y
cmp #tool_at_bottom
bne smr_0 ; No
; Yes - check if funnel can move further
lda funnl_x
cmp #funnel_at_right
beq smr_1
; Check if fish part is not being dropped
lda fcstate
cmp #FC_STATIONARY
bne smr_1
lda #FU_MOVINGRIGHT
sta tmp0
jsr init_funnel_move
smr_1 rts
smr_0 lda #FC_MOVINGRIGHT
sta tmp0
jsr init_fish_chain_move
rts
init_tool_move_down
; Don't move if at the bottom
lda tool_y
cmp #tool_at_bottom
beq itmd_0
; Don't move if fish chain is moving
lda fcstate
cmp #FC_STATIONARY
bne itmd_0
lda #TS_MOVING_DOWN
sta tstate
itmd_0 rts
init_tool_move_up
; Don't move if at the top
lda tool_y
cmp #tool_init_y-2
beq itmu_0
; Don't move if fish chain is moving
lda fcstate
cmp #FC_STATIONARY
bne itmu_0
lda #TS_MOVING_UP
sta tstate
itmu_0 rts
; Fills the initial fish chain
; with random fish-parts
randomize_fish_chain
mwa #tab_fishchain ptr1
ldx #fishchain_len
rfc_1 jsr pick_random_fish_part
ldy #0
mwa ptr0 (ptr1),y
dex
cpx #0
beq rfc_0
adw ptr1 #2
jmp rfc_1
rfc_0 jsr randomize_approaching_fish_segment
rts
; Randomly picks the new fish segment
; to be scrolled in into the chain
randomize_approaching_fish_segment
jsr pick_random_fish_part
mwa ptr0 tab_fish_random
rts
; Picks one random fish part
; and points "ptr0" to it
pick_random_fish_part
ldy RANDOM
lda random_fish_chain_table,y
tay
mwa #fishdata ptr0
prfp_1 cpy #0
beq prfp_0
adw ptr0 #fishsize
dey
jmp prfp_1
prfp_0 rts
; Helper for randomizing the fish chain
random_fish_chain_table
:$100 dta b(:1 % fishestotal)
; Modifies the fishchain data pointers
; to reflect situation after movement
adapt_fish_chain_data
lda tmp0
cmp #FC_MOVINGLEFT
bne afcd_0
; Adapt to the left
:fishchain_len-1 mwa tab_fishchain+#*2+2 tab_fishchain+#*2
mwa tab_fish_random tab_fishchain+((fishchain_len-1)*2)
rts
afcd_0 ; Adapt to the right
:fishchain_len-1 mwa tab_fishchain+(((fishchain_len-2)-#)*2) tab_fishchain+(((fishchain_len-2)-#)*2)+2
mwa tab_fish_random tab_fishchain
rts
; Inits the move of a fish chain
; accordingly to the content of "tmp0" (direction)
init_fish_chain_move
lda fcstate
cmp #FC_STATIONARY
bne ifcml_0
jsr adapt_fish_chain_data
lda #(0-1)
sta fishmov
lda #0
sta ffeedof
lda tmp0
sta fcstate
ifcml_0 rts
; Inits the move of a funnel
; accordingly to the content of "tmp0" (direction)
init_funnel_move
lda fstate
cmp #FU_STATIONARY
bne ifm_0
lda #(0-1)
sta fishmov
lda tmp0
sta fstate
ifm_0 rts
move_fish_chain_right
jsr is_movement_finished
; Continue moving
mfcr_3 lda #0
sta tmp0
mwa pscr ptr0
mwa pnscr ptr2
ldx #0
mfcr_1 ldy #(scr_rowsize-2)
mfcr_0 lda #0
lda (ptr0),y
iny
sta (ptr2),y
dey
dey
cpy #(0-1)
bne mfcr_0
inx
cpx #fishdimy
beq mfcr_2
adw ptr0 #scr_rowsize
adw ptr2 #scr_rowsize
jmp mfcr_1
mfcr_2
; Feed newly appearing column with
; data of the random fish
mwa pnscr ptr0
mwa tab_fish_random ptr1
ldx ffeedof
mfcr_7 cpx #0
beq mfcr_6
sbw ptr1 #1
dex
jmp mfcr_7
mfcr_6 ldx #0
mfcr_5 ldy #(fishbperrow-1)
lda (ptr1),y
ldy #0
sta (ptr0),y
inx
cpx #fishdimy
beq mfcr_4
jsr modify_fish_chain_movement_pointers
jmp mfcr_5
mfcr_4 inc ffeedof
jsr flip_screens
rts
move_fish_chain_left
jsr is_movement_finished
; Continue moving
mfcl_3 lda #0
sta tmp0
mwa pscr ptr0
mwa pnscr ptr2
ldx #0
mfcl_1 ldy #1
mfcl_0 lda (ptr0),y
dey
sta (ptr2),y
iny
iny
cpy #scr_rowsize
bne mfcl_0
inx
cpx #fishdimy
beq mfcl_2
adw ptr0 #scr_rowsize
adw ptr2 #scr_rowsize
jmp mfcl_1
mfcl_2
; Feed newly appearing column with
; data of the random fish
mwa pnscr ptr0
adw ptr0 #(scr_rowsize-1)
mwa tab_fish_random ptr1
ldx ffeedof
mfcl_7 cpx #0
beq mfcl_6
adw ptr1 #1
dex
jmp mfcl_7
mfcl_6 ldx #0
mfcl_5 ldy #0
lda (ptr1),y
sta (ptr0),y
inx
cpx #fishdimy
beq mfcl_4
jsr modify_fish_chain_movement_pointers
jmp mfcl_5
mfcl_4 inc ffeedof
jsr flip_screens
rts
; If full move of the funnel is finished
; this routine will move to next state
is_funnel_movement_finished
inc fishmov
lda fishmov
cmp #fishbperrow
bne ifmf_0
lda #FU_STATIONARY
sta fstate
pla
pla
; Make sure funnel position
; is consistent over two
; screens
jsr draw_funnel
jsr flip_screens
ifmf_0 rts
; If full move-segment of the fish chain is finished
; this routine will move to next state
is_movement_finished
inc fishmov
lda fishmov
cmp #fishbperrow
bne @+
; Segment moved
lda #FC_STATIONARY
sta fcstate
jsr randomize_approaching_fish_segment
jsr draw_fish_chain
jsr flip_screens
pla
pla
; Continue moving
@ rts
modify_fish_chain_movement_pointers
adw ptr1 #fishbperrow
adw ptr0 #scr_rowsize
rts
; Draws the entire fish chain
; accordingly to the "tab_fishchain" content
draw_fish_chain
; tmp3 stores the Y-position of the
; chain. Required by "draw_chains_internal"
lda #0
sta tmp3
mwa #(tab_fishchain-2) ptr2
lda #(fishchain_x-8)
sta tmp1
lda #fishchain_len
jsr draw_chains_internal
rts
; Array of pointers representing
; the current content of the fish chain
tab_fishchain
:fishchain_len dta a($0000)
; Random fish part that will be spawned
; when fish chain is moved
tab_fish_random
dta a($0000)
; Draws the full set of fish slots
draw_fish_slots
; tmp3 stores the Y-position of the
; chain. Required by "draw_chains_internal"
lda #fishslot_y
sta tmp3
mwa #(tab_fishslots-2) ptr2
lda #(fishslot_x-8)
sta tmp1
lda #fishslot_len
jsr draw_chains_internal
rts
; Array of pointers representing
; the current content of the fish slots
tab_fishslots
:fishslot_len dta a($0000)
; Array of pointers representing
; the target fish species to be built
tab_fishguidelines
:fishslot_len dta a($0000)
; Helper routine used by
; "draw_fish_chain" and "draw_fish_slots".
; Iterates through pointers to rectangles
; and draws them at the specified position
draw_chains_internal
sta tmp2
@ adw ptr2 #2
lda tmp1
clc
adc #fishbperrow
sta tmp1
sta drf_x
lda tmp3
sta drf_y
ldy #0
lda (ptr2),y
sta ptr1
iny
lda (ptr2),y
sta ptr1+1
jsr draw_data_rectangle
dec tmp2
lda tmp2
cmp #0
bne @-
rts
; Initializes the source rectangle data pointer
; accordinlgy to the selected y-location.
; Preservers "ptr1"
draw_data_rectangle_initpos
lda ptr1
pha
lda ptr1+1
pha
; Tables with Y-coordinates
; are located directly after
; the screen memory
mwa pnscr ptr1
adw ptr1 #scr_size
lda drf_y
asl
tay
lda (ptr1),y
sta ptr0
iny
lda (ptr1),y
sta ptr0+1
pla
sta ptr1+1
pla
sta ptr1
rts
; Draws a data rectangle on the specified location
; drf_x - Horizontal position (4 pixels precision)
; drf_y - Vertical position (1 pixel precision)
; ptr1 - Pointer to rectangle data
; erase_r - Should the rightmost column be erased?
; erase_l - Should the leftmost column be erased?
draw_data_rectangle
mva #0 cntr0
jsr draw_data_rectangle_initpos
ddr_1 ldy #0
ddr_0 lda (ptr1),y
sty tmp0
ldy drf_x
sta (ptr0),y
inc drf_x
ldy tmp0
iny
cpy #fishbperrow
bne ddr_0
; Erase rightmost column if necessary
lda erase_r
cmp #0
beq ddr_4
lda #0
ldy drf_x
sta (ptr0),y
; Erase leftmost column if necessary
ddr_4 lda erase_l
cmp #0
beq ddr_3
lda drf_x
sec
sbc #fishbperrow+1
tay
lda #0
sta (ptr0),y
ddr_3 adw ptr0 #scr_rowsize
adw ptr1 #fishbperrow
inc cntr0
lda cntr0
cmp #fishdimy
bne ddr_2
rts
ddr_2 lda drf_x
sec
sbc #fishbperrow
sta drf_x
jmp ddr_1
delay
inc CDTMF4
lda delayt
sta CDTMV4
lda delayt2
sta CDTMV4+1
@ lda CDTMF4
bne @-
rts
synchro
lda PAL
cmp #1
bne synchr1
lda #145 ; PAL
jmp synchr2
synchr1 lda #120 ; NTSC
synchr2 cmp VCOUNT
bne synchr2
rts
vbi_routine
lda silence
cmp #0
bne @+
jsr RASTERMUSICTRACKER+3
@ jmp XITVBV
stop_music
lda #1
sta silence
jsr RASTERMUSICTRACKER+9
rts
play_music_common
lda #0
sta silence
ldx #<MODUL
ldy #>MODUL
rts
play_lo_beep
jsr play_music_common
lda #05
jsr RASTERMUSICTRACKER ;Init
rts
play_hi_beep
jsr play_music_common
lda #$0d
jsr RASTERMUSICTRACKER ;Init
rts
play_title_music
jsr play_music_common
lda #07
jsr RASTERMUSICTRACKER ;Init
rts
play_game_music
jsr play_music_common
lda #00
jsr RASTERMUSICTRACKER ;Init
rts
play_error_music
jsr play_music_common
lda #$0f
jsr RASTERMUSICTRACKER ;Init
rts
; Align to 2k for single-line resolution sprites
.align $800
pmg_base
:$800 dta b(0)
pmg_p0 equ pmg_base+$400
pmg_p1 equ pmg_base+$500
pmg_p2 equ pmg_base+$600
pmg_p3 equ pmg_base+$700
org pmg_p0+tool_init_y
:2 dta b(15)
:2 dta b(31)
:56 dta b(48)
:2 dta b(31)
:2 dta b(15)
org pmg_p1+tool_init_y
:2 dta b(240)
:2 dta b(248)
:56 dta b(12)
:2 dta b(248)
:2 dta b(240)
.align $400
dlist
:3 dta b($70)
dta b($4d)
scr_mem_antic
dta a($0000)
:95 dta b($0d)
dta b($41),a(dlist)
dlist_title
:2 dta b($70)
dta b($f0) ; DLI - before fish (VCOUNT=$0f)
dta b($4d)
dta a(scr_mem_1)
:6 dta b($0d)
dta b($8d) ; DLI - shades of water (VCOUNT=$17)
:6 dta b($0d)
dta b($8d) ; DLI - shades of water (VCOUNT=$1e)
:6 dta b($0d)
dta b($8d) ; DLI - shades of water (VCOUNT=$25)
:10 dta b($0d)
dta b($f0) ; DLI - before title line (VCOUNT=$33)
dta b($87) ; DLI - before title separator (VCOUNT=$3b)
dta b($82) ; DLI - before first subtitle (VCOUNT=$3f)
dta b($86) ; DLI - before second subtitle (VCOUNT=$43)
dta b($06)
dta b($f0) ; DLI - before text (VCOUNT=$4b)
:5 dta b($02)
dta b($82) ; DLI - after last text line (VCOUNT=$63)
dta b($02)
dta b($02)
dta b($02)
dta b($41),a(dlist)
MODUL equ $a100
org MODUL
opt h-
ins "music/musA100.rmt"
opt h+
MUSICPLAYER equ $b000
org MUSICPLAYER
icl "rmtplayr.a65"
clear_decrunch_panel
mwa #scr_mem_1+scr_rowsize*fishdimy ptr0
mwa #0 ptr1
ldy #0
cdp_0 lda #0
sta (ptr0),y
adw ptr0 #1
adw ptr1 #1
lda ptr1+1
cmp #1
bne cdp_0
lda ptr1
cmp #204
bne cdp_0
rts
write_decrunch_line
adw ptr0 tmp0
ldy #0
wdl_1 lda (ptr2),y
cmp #$9b
beq wdl_0
sta (ptr0),y
iny
jmp wdl_1
wdl_0 rts
decrunching
inc crunched
jsr play_game_music
; Init DLI
lda <decrunch_dli_routine
sta VDSLST
lda >decrunch_dli_routine
sta VDSLST+1
lda #%11000000
sta NMIEN
jsr clear_decrunch_panel
jsr enable_antic
mwa #scr_mem_1+scr_rowsize*fishdimy ptr0
; Draw decrunching text and initial progress bar
mwa #text_decrunch ptr2
mva #113 tmp0
jsr write_decrunch_line
; Paint decrunching progrsss
mwa #text_decrunch_progress ptr2
mva #71 tmp0
jsr write_decrunch_line
; Animate progress
ldx #0
ldy #1
dec_4 lda #94
sta (ptr0),y
jsr very_short_delay
iny
inx
cpx #7
beq dec_5
cpx #12
beq dec_5
cpx #21
beq dec_5
cpx #30
beq dec_6
cpx #44
beq dec_7
jmp dec_4
dec_5
:2 jsr short_delay
jmp dec_4
dec_6
:4 jsr short_delay
jmp dec_4
dec_7
:4 jsr short_delay
; Draw error text
ldx #0
ldy #76
dec_9 lda text_chuj,x
cmp #$9b
beq dec_8
sta (ptr0),y
iny
inx
jmp dec_9
dec_8
jsr play_error_music
:3 jsr short_delay
jsr stop_music
; Back to the normal program
jsr disable_antic
:6 jsr short_delay
rts
text_decrunch
dta d"Decrunching...",b($9b)
text_decrunch_progress
dta b(92)
:30 dta b(93)
dta b(95)
dta b($9b)
text_chuj
dta d" ERROR W CHUJ !!! "*,b($9b)
; Fit font into unused space of PMG memory
org pmg_base
ins "font.fnt"
; Start with polish version
org english
dta b(0)
; Init tool position on load only
org tool_y
dta b(tool_init_y-2)
org RUNAD
dta a(run_here)
| 16.928833
| 102
| 0.661142
|
3d07cc3bfa1f717f8d034e0c9224df65a6fbe38b
| 112
|
asm
|
Assembly
|
gfx/pokemon/chansey/anim.asm
|
Dev727/ancientplatinum
|
8b212a1728cc32a95743e1538b9eaa0827d013a7
|
[
"blessing"
] | 28
|
2019-11-08T07:19:00.000Z
|
2021-12-20T10:17:54.000Z
|
gfx/pokemon/chansey/anim.asm
|
Dev727/ancientplatinum
|
8b212a1728cc32a95743e1538b9eaa0827d013a7
|
[
"blessing"
] | 13
|
2020-01-11T17:00:40.000Z
|
2021-09-14T01:27:38.000Z
|
gfx/pokemon/chansey/anim.asm
|
Dev727/ancientplatinum
|
8b212a1728cc32a95743e1538b9eaa0827d013a7
|
[
"blessing"
] | 22
|
2020-05-28T17:31:38.000Z
|
2022-03-07T20:49:35.000Z
|
frame 1, 06
frame 4, 06
frame 1, 06
frame 2, 10
setrepeat 2
frame 0, 05
frame 3, 05
dorepeat 5
endanim
| 11.2
| 12
| 0.660714
|
1bb752eb5f85d60ed05eb4d3f09e8d765c0b8a71
| 961
|
asm
|
Assembly
|
0.asm
|
jacobggman/assembly-exercises
|
0482dacaf87204cdaa48d0c3e67e65b7c3029074
|
[
"Apache-2.0"
] | null | null | null |
0.asm
|
jacobggman/assembly-exercises
|
0482dacaf87204cdaa48d0c3e67e65b7c3029074
|
[
"Apache-2.0"
] | null | null | null |
0.asm
|
jacobggman/assembly-exercises
|
0482dacaf87204cdaa48d0c3e67e65b7c3029074
|
[
"Apache-2.0"
] | null | null | null |
.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
.data
BUFFER_LENGTH EQU 1024
szMessageBoxFormat BYTE "The result is %d", 0
szMessageBoxText BYTE 0 dup(BUFFER_LENGTH)
nums EQU 100
.code
start:
main proc
;formala n∗(n+1)/2
mov eax, nums
mov ecx, nums + 1
mul ecx ; eax = eax * ecx ; actually edx:eax = ax * cx
sar eax, 1
; adding:
; add eax, ecx
; loop adding
push eax
call display_number_in_message_box
ret
main endp
display_number_in_message_box proc
;Create a string representation of the number
mov eax, [esp + 4]
invoke wsprintf, ADDR szMessageBoxText, ADDR szMessageBoxFormat, eax
;Display that string in a message box
invoke MessageBoxA, NULL, ADDR szMessageBoxText, NULL, MB_OK
ret 4
display_number_in_message_box endp
end start
| 19.22
| 71
| 0.685744
|
700747309b3c17f930d4a64d32b59a152c2b4220
| 581
|
asm
|
Assembly
|
programs/oeis/010/A010844.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/010/A010844.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/010/A010844.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A010844: a(n) = 2*n*a(n-1) + 1 with a(0) = 1.
; 1,3,13,79,633,6331,75973,1063623,17017969,306323443,6126468861,134782314943,3234775558633,84104164524459,2354916606684853,70647498200545591,2260719942417458913,76864478042193603043,2767121209518969709549,105150605961720848962863,4206024238468833958514521,176653018015691026257609883,7772732792690405155334834853,357545708463758637145402403239,17162194006260414582979315355473,858109700313020729148965767773651,44621704416277077915746219924229853
mul $0,2
mov $2,$0
lpb $0
sub $0,2
add $1,$2
mul $2,$0
lpe
add $1,1
mov $0,$1
| 44.692308
| 447
| 0.831325
|
633639029a20be1ecae569f6a8978a360a4b07cc
| 527
|
asm
|
Assembly
|
programs/oeis/088/A088520.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/088/A088520.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/088/A088520.asm
|
jmorken/loda
|
99c09d2641e858b074f6344a352d13bc55601571
|
[
"Apache-2.0"
] | null | null | null |
; A088520: Permutation of natural numbers generated by 3-rowed array shown below.
; 1,5,2,7,4,3,11,8,6,13,10,9,17,14,12,19,16,15,23,20,18,25,22,21,29,26,24,31,28,27,35,32,30,37,34,33,41,38,36,43,40,39,47,44,42,49,46,45,53,50,48,55,52,51,59,56,54,61,58,57,65,62,60,67,64,63,71,68,66,73,70,69
cal $0,116551 ; Permutation of natural numbers generated by 3-rowed array shown below.
cal $0,131717 ; Natural numbers A000027 with 6n+4 and 6n+5 terms swapped.
mov $1,52547
mov $2,$0
mul $2,-9
sub $1,$2
sub $1,52556
div $1,9
add $1,1
| 40.538462
| 208
| 0.70019
|
e38ed3ebe8f6b0aa3e5d923c234c0d9262882a9d
| 19,747
|
asm
|
Assembly
|
defines/pe.asm
|
Ge0/okita-poc
|
2cf1230361fe507cf31f94ba1a11b6e5e5a4361e
|
[
"MIT"
] | 18
|
2015-08-06T02:20:06.000Z
|
2021-05-20T09:43:31.000Z
|
defines/pe.asm
|
Ge0/okita-poc
|
2cf1230361fe507cf31f94ba1a11b6e5e5a4361e
|
[
"MIT"
] | null | null | null |
defines/pe.asm
|
Ge0/okita-poc
|
2cf1230361fe507cf31f94ba1a11b6e5e5a4361e
|
[
"MIT"
] | 1
|
2016-12-04T04:50:48.000Z
|
2016-12-04T04:50:48.000Z
|
%define PREFIX_OPERANDSIZE db 66h
IMAGE_RESOURCE_DATA_IS_DIRECTORY equ 80000000h
PAGE_READWRITE equ 4
ExceptionContinueExecution equ 0
DLL_PROCESS_ATTACH equ 1
DLL_PROCESS_DETACH equ 0
IMAGE_SCN_CNT_CODE equ 000000020h
IMAGE_SCN_CNT_INITIALIZED_DATA equ 000000040h
IMAGE_SCN_MEM_SHARED equ 010000000h
IMAGE_SCN_MEM_EXECUTE equ 020000000h
IMAGE_SCN_MEM_READ equ 040000000h
IMAGE_SCN_MEM_WRITE equ 080000000h
MEM_COMMIT equ 1000h
BREAKPOINT equ 080000003h
SINGLE_STEP equ 80000004h
ACCESS_VIOLATION equ 0c0000005h
INVALID_HANDLE equ 0C0000008h
INVALID_LOCK_SEQUENCE equ 0C000001eh
INTEGER_DIVIDE_BY_ZERO equ 0C0000094h
INTEGER_OVERFLOW equ 0C0000095h
PRIVILEGED_INSTRUCTION equ 0C0000096h
struc exceptionHandler
.pException resd 1 ; EXCEPTION_RECORD
.pRegistrationRecord resd 1 ; EXCEPTION_REGISTRATION_RECORD
.pContext resd 1 ; CONTEXT
endstruc
SIZE_OF_80387_REGISTERS equ 80
MAXIMUM_SUPPORTED_EXTENSION equ 512
struc CONTEXT
.ContextFlags resd 1
;CONTEXT_DEBUG_REGISTERS
.iDr0 resd 1
.iDr1 resd 1
.iDr2 resd 1
.iDr3 resd 1
.iDr6 resd 1
.iDr7 resd 1
;CONTEXT_FLOATING_POINT
.ControlWord resd 1
.StatusWord resd 1
.TagWord resd 1
.ErrorOffset resd 1
.ErrorSelector resd 1
.DataOffset resd 1
.DataSelector resd 1
.RegisterArea resb SIZE_OF_80387_REGISTERS
.Cr0NpxState resd 1
;CONTEXT_SEGMENTS
.regGs resd 1
.regFs resd 1
.regEs resd 1
.regDs resd 1
;CONTEXT_INTEGER
.regEdi resd 1
.regEsi resd 1
.regEbx resd 1
.regEdx resd 1
.regEcx resd 1
.regEax resd 1
;CONTEXT_CONTROL
.regEbp resd 1
.regEip resd 1
.regCs resd 1
.regFlag resd 1
.regEsp resd 1
.regSs resd 1
;CONTEXT_EXTENDED_REGISTERS
.ExtendedRegisters resb MAXIMUM_SUPPORTED_EXTENSION
endstruc
IMAGE_SIZEOF_SHORT_NAME equ 8
struc IMAGE_DOS_HEADER
.e_magic resw 1
.e_cblp resw 1
.e_cp resw 1
.e_crlc resw 1
.e_cparhdr resw 1
.e_minalloc resw 1
.e_maxalloc resw 1
.e_ss resw 1
.e_sp resw 1
.e_csum resw 1
.e_ip resw 1
.e_cs resw 1
.e_lfarlc resw 1
.e_ovno resw 1
.e_res resw 4
.e_oemid resw 1
.e_oeminfo resw 1
.e_res2 resw 10
.e_lfanew resd 1
endstruc
struc IMAGE_NT_HEADERS
.Signature resd 1
; .FileHeader resb IMAGE_FILE_HEADER_size
; .OptionalHeader resb IMAGE_OPTIONAL_HEADER32_size
endstruc
struc IMAGE_FILE_HEADER
.Machine resw 1
.NumberOfSections resw 1
.TimeDateStamp resd 1
.PointerToSymbolTable resd 1
.NumberOfSymbols resd 1
.SizeOfOptionalHeader resw 1
.Characteristics resw 1
endstruc
IMAGE_FILE_MACHINE_I386 equ 014ch
IMAGE_FILE_DLL equ 02000h
IMAGE_NT_OPTIONAL_HDR32_MAGIC equ 010bh
struc IMAGE_OPTIONAL_HEADER32
.Magic resw 1
.MajorLinkerVersion resb 1
.MinorLinkerVersion resb 1
.SizeOfCode resd 1
.SizeOfInitializedData resd 1
.SizeOfUninitializedData resd 1
.AddressOfEntryPoint resd 1
.BaseOfCode resd 1
.BaseOfData resd 1
.ImageBase resd 1
.SectionAlignment resd 1
.FileAlignment resd 1
.MajorOperatingSystemVersion resw 1
.MinorOperatingSystemVersion resw 1
.MajorImageVersion resw 1
.MinorImageVersion resw 1
.MajorSubsystemVersion resw 1
.MinorSubsystemVersion resw 1
.Win32VersionValue resd 1
.SizeOfImage resd 1
.SizeOfHeaders resd 1
.CheckSum resd 1
.Subsystem resw 1
.DllCharacteristics resw 1
.SizeOfStackReserve resd 1
.SizeOfStackCommit resd 1
.SizeOfHeapReserve resd 1
.SizeOfHeapCommit resd 1
.LoaderFlags resd 1
.NumberOfRvaAndSizes resd 1
.DataDirectory resb 0
endstruc
struc IMAGE_DATA_DIRECTORY
VirtualAddress resd 1
isize resd 1
endstruc
struc IMAGE_DATA_DIRECTORY_16
.ExportsVA resd 1
.ExportsSize resd 1
.ImportsVA resd 1
.ImportsSize resd 1
.ResourceVA resd 1
.ResourceSize resd 1
.Exception resd 2
.Security resd 2
.FixupsVA resd 1
.FixupsSize resd 1
.DebugVA resd 1
.DebugSize resd 1
.Description resd 2
.MIPS resd 2
.TLSVA resd 1
.TLSSize resd 1
.Load resd 2
.BoundImportsVA resd 1
.BoundImportsSize resd 1
.IATVA resd 1
.IATSize resd 1
.DelayImportsVA resd 1
.DelayImportsSize resd 1
.COM resd 2
.reserved resd 2
endstruc
struc IMAGE_SECTION_HEADER
.Name resb IMAGE_SIZEOF_SHORT_NAME
.VirtualSize resd 1
.VirtualAddress resd 1
.SizeOfRawData resd 1
.PointerToRawData resd 1
.PointerToRelocations resd 1
.PointerToLinenumbers resd 1
.NumberOfRelocations resw 1
.NumberOfLinenumbers resw 1
.Characteristics resd 1
endstruc
IMAGE_SUBSYSTEM_WINDOWS_CUI equ 3
IMAGE_SUBSYSTEM_WINDOWS_GUI equ 2
IMAGE_FILE_RELOCS_STRIPPED equ 00001h
IMAGE_FILE_EXECUTABLE_IMAGE equ 00002h
IMAGE_FILE_LINE_NUMS_STRIPPED equ 00004h
IMAGE_FILE_LOCAL_SYMS_STRIPPED equ 00008h
IMAGE_FILE_32BIT_MACHINE equ 00100h
%macro _ 0
nop
%endmacro
%macro _c 0
int3
align 4, int3
%endmacro
%macro _d 0
db 0
align 16, db 0
%endmacro
%macro setSEH 1
push %1
push dword [fs:0]
mov [fs:0], esp
%endmacro
%macro clearSEH 0
pop dword [fs:0]
add esp, 4
%endmacro
struc IMAGE_OPTIONAL_HEADER64
.Magic resw 1
.MajorLinkerVersion resb 1
.MinorLinkerVersion resb 1
.SizeOfCode resd 1
.SizeOfInitializedData resd 1
.SizeOfUninitializedData resd 1
.AddressOfEntryPoint resd 1
.BaseOfCode resd 1
.ImageBase resq 1
.SectionAlignment resd 1
.FileAlignment resd 1
.MajorOperatingSystemVersion resw 1
.MinorOperatingSystemVersion resw 1
.MajorImageVersion resw 1
.MinorImageVersion resw 1
.MajorSubsystemVersion resw 1
.MinorSubsystemVersion resw 1
.Win32VersionValue resd 1
.SizeOfImage resd 1
.SizeOfHeaders resd 1
.CheckSum resd 1
.Subsystem resw 1
.DllCharacteristics resw 1
.SizeOfStackReserve resq 1
.SizeOfStackCommit resq 1
.SizeOfHeapReserve resq 1
.SizeOfHeapCommit resq 1
.LoaderFlags resd 1
.NumberOfRvaAndSizes resd 1
.DataDirectory resb 0
endstruc
IMAGE_FILE_MACHINE_AMD64 equ 8664h
IMAGE_NT_OPTIONAL_HDR64_MAGIC equ 020bh
IMAGE_REL_BASED_ABSOLUTE equ 0 ; used for padding
IMAGE_REL_BASED_HIGH equ 1
IMAGE_REL_BASED_LOW equ 2 ; does nothing
IMAGE_REL_BASED_HIGHLOW equ 3 ;
IMAGE_REL_BASED_HIGHADJ equ 4 ; takes an argument but actually does nothing
IMAGE_REL_BASED_MIPS_JMPADDR equ 5 ; until W7 only
IMAGE_REL_BASED_SECTION equ 6 ; until W7 only ; does nothing anyway
IMAGE_REL_BASED_REL32 equ 7 ; until W7 only ; does nothing anyway
; 8 is always rejected, historically
IMAGE_REL_BASED_MIPS_JMPADDR16 equ 9
IMAGE_REL_BASED_IA64_IMM64 equ 9
IMAGE_REL_BASED_DIR64 equ 10
IMAGE_REL_BASED_HIGH3ADJ equ 11 ; Win2k only
CR equ 0dh
EOF equ 1ah
LF equ 0ah
struc IMAGE_RESOURCE_DIRECTORY
.Characteristics resd 1
.TimeDateStamp resd 1
.MajorVersion resw 1
.MinorVersion resw 1
.NumberOfNamedEntries resw 1
.NumberOfIdEntries resw 1
endstruc
struc IMAGE_RESOURCE_DIRECTORY_ENTRY
.NameID resd 1
.OffsetToData resd 1
endstruc
struc IMAGE_RESOURCE_DATA_ENTRY
.OffsetToData resd 1
.Size1 resd 1
.CodePage resd 1
.Reserved resd 1
endstruc
struc _IMAGE_DELAY_IMPORT_DESCRIPTOR
.grAttrs resd 1 ; attributes
.rvaDLLName resd 1 ; RVA to dll name
.rvaHmod resd 1 ; RVA of module handle
.rvaIAT resd 1 ; RVA of the IAT
.rvaINT resd 1 ; RVA of the INT
.rvaBoundIAT resd 1 ; RVA of the optional bound IAT
.rvaUnloadIAT resd 1 ; RVA of optional copy of original IAT
.dwTimeStamp resd 1 ; 0 if not bound
endstruc
struc TRUNC_OPTIONAL_HEADER32
.Magic resw 1
.MajorLinkerVersion resb 1
.MinorLinkerVersion resb 1
.SizeOfCode resd 1
.SizeOfInitializedData resd 1
.SizeOfUninitializedData resd 1
.AddressOfEntryPoint resd 1
.BaseOfCode resd 1
.BaseOfData resd 1
.ImageBase resd 1
.SectionAlignment resd 1
.FileAlignment resd 1
.MajorOperatingSystemVersion resw 1
.MinorOperatingSystemVersion resw 1
.MajorImageVersion resw 1
.MinorImageVersion resw 1
.MajorSubsystemVersion resw 1
.MinorSubsystemVersion resw 1
.Win32VersionValue resd 1
.SizeOfImage resd 1
.SizeOfHeaders resd 1
.CheckSum resd 1
.Subsystem resb 1 ; truncated as a byte
; no more data
endstruc
struc VS_FIXEDFILEINFO
.dwSignature resd 1
.dwStrucVersion resd 1
.dwFileVersionMS resd 1
.dwFileVersionLS resd 1
.dwProductVersionMS resd 1
.dwProductVersionLS resd 1
.dwFileFlagsMask resd 1
.dwFileFlags resd 1
.dwFileOS resd 1
.dwFileType resd 1
.dwFileSubtype resd 1
.dwFileDateMS resd 1
.dwFileDateLS resd 1
endstruc
CREATEPROCESS_MANIFEST_RESOURCE_ID EQU 1
ISOLATIONAWARE_MANIFEST_RESOURCE_ID EQU 2
ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID EQU 3
struc ACTCTX ; typedef struct tagACTCTX {
.cbSize resd 1 ; ULONG cbSize;
.dwFlags resd 1 ; DWORD dwFlags;
.lpSource resd 1 ; LPCWSTR lpSource;
.wProcessorArchitecture resw 1 ; USHORT wProcessorArchitecture;
.wLangId resw 1 ; LANGID wLangId;
.lpAssemblyDirectory resd 1 ; LPCTSTR lpAssemblyDirectory;
.lpResourceName resd 1 ; LPCTSTR lpResourceName;
.lpApplicationName resd 1 ; LPCTSTR lpApplicationName;
.hModule resd 1 ; HMODULE hModule;
endstruc ; } ACTCTX, *PACTCTX;
ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID equ 1
ACTCTX_FLAG_LANGID_VALID equ 2
ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID equ 4
ACTCTX_FLAG_RESOURCE_NAME_VALID equ 8
ACTCTX_FLAG_SET_PROCESS_DEFAULT equ 16
ACTCTX_FLAG_APPLICATION_NAME_VALID equ 32
ACTCTX_FLAG_HMODULE_VALID equ 128
; widechar string macro
%macro WIDE 1
%assign %%__i 1
%strlen %%__len %1
%rep %%__len
%substr %%__c %1 %%__i
db %%__c
db 0
%assign %%__i %%__i + 1
%endrep
db 0, 0
%endmacro
%macro _widestr_no0 1
%assign %%__i 1
%strlen %%__len %1
%rep %%__len
%substr %%__c %1 %%__i
db %%__c
db 0
%assign %%__i %%__i + 1
%endrep
%endmacro
%macro __string 2
%%string:
dw %%SLEN
dw %%VALLEN / 2 ; dammit !
dw 1 ; text type
WIDE %1
align 4, db 0
%%val:
WIDE %2
%%VALLEN equ $ - %%val
align 4, db 0
%%SLEN equ $ - %%string
%endmacro
struc RUNTIME_FUNCTION
.FunctionStart resd 1
.FunctionEnd resd 1
.UnwindInfo resd 1
endstruc
struc UNWIND_INFO
.Ver3_Flags resb 1 ; versions and flags
.PrologSize resb 1
.CntUnwindCodes resb 1
.FrReg_FrRegOff resb 1 ; frame register and offsets
; dd ExceptionHandler or FunctionEntry
; ExceptionData
endstruc
struc UNWIND_CODE
.PrologOff resb 1
.OpCode_OpInfo resb 1 ; operation code and info
endstruc
UNW_FLAG_EHANDLER equ 1
struc IMAGE_DEBUG_DIRECTORY
.Characteristics resd 1
.TimeDateStamp resd 1
.MajorVersion resw 1
.MinorVersion resw 1
.Type resd 1
.SizeOfData resd 1
.AddressOfRawData resd 1
.PointerToRawData resd 1
endstruc
IMAGE_DEBUG_TYPE_COFF equ 1
IMAGE_DEBUG_TYPE_CODEVIEW equ 2
IMAGE_DEBUG_TYPE_MISC equ 4
SYMOPT_DEBUG equ 080000000h
struc IMAGE_EXPORT_DIRECTORY
.Characteristics resd 1
.TimeDateStamp resd 1
.MajorVersion resw 1
.MinorVersion resw 1
.nName resd 1
.nBase resd 1
.NumberOfFunctions resd 1
.NumberOfNames resd 1
.AddressOfFunctions resd 1
.AddressOfNames resd 1
.AddressOfNameOrdinals resd 1
endstruc
struc IMAGE_IMPORT_DESCRIPTOR
.OriginalFirstThunk resd 1 ; Characteristics
.TimeDateStamp resd 1
.ForwarderChain resd 1
.Name1 resd 1
.FirstThunk resd 1
endstruc
%macro _import_descriptor 1
istruc IMAGE_IMPORT_DESCRIPTOR
at IMAGE_IMPORT_DESCRIPTOR.OriginalFirstThunk, dd %1_hintnames - IMAGEBASE
at IMAGE_IMPORT_DESCRIPTOR.Name1 , dd %1 - IMAGEBASE
at IMAGE_IMPORT_DESCRIPTOR.FirstThunk , dd %1_iat - IMAGEBASE
iend
%endmacro
struc IMAGE_LOAD_CONFIG_DIRECTORY32
.Size resd 1
.TimeDateStamp resd 1
.MajorVersion resw 1
.MinorVersion resw 1
.GlobalFlagsClear resd 1
.GlobalFlagsSet resd 1
.CriticalSectionDefaultTimeout resd 1
.DeCommitFreeBlockThreshold resd 1
.DeCommitTotalFreeThreshold resd 1
.LockPrefixTable resd 1 ; VA
.MaximumAllocationSize resd 1
.VirtualMemoryThreshold resd 1
.ProcessHeapFlags resd 1
.ProcessAffinityMask resd 1
.CSDVersion resw 1
.Reserved1 resw 1
.EditList resd 1 ; VA
.SecurityCookie resd 1 ; VA
.SEHandlerTable resd 1 ; VA
.SEHandlerCount resd 1
.GuardCFCheckFunctionPointer resd 1 ; VA
.Reserved2 resd 1
.GuardCFFunctionTable resd 1 ; VA
.GuardCFFunctionCount resd 1
.GuardFlags resd 1
endstruc
struc IMAGE_LOAD_CONFIG_DIRECTORY64
.Size resd 1
.TimeDateStamp resd 1
.MajorVersion resw 1
.MinorVersion resw 1
.GlobalFlagsClear resd 1
.GlobalFlagsSet resd 1
.CriticalSectionDefaultTimeout resd 1
.DeCommitFreeBlockThreshold resq 1
.DeCommitTotalFreeThreshold resq 1
.LockPrefixTable resq 1 ; VA
.MaximumAllocationSize resq 1
.VirtualMemoryThreshold resq 1
.ProcessAffinityMask resq 1
.ProcessHeapFlags resd 1
.CSDVersion resw 1
.Reserved1 resw 1
.EditList resq 1 ; VA
.SecurityCookie resq 1 ; VA
.SEHandlerTable resq 1 ; VA
.SEHandlerCount resq 1
.GuardCFCheckFunctionPointer resq 1 ; VA
.Reserved2 resq 1
.GuardCFFunctionTable resq 1 ; VA
.GuardCFFunctionCount resq 1
.GuardFlags resd 1
endstruc
RT_ICON equ 3
RT_STRING equ 6
RT_GROUP_ICON equ 14
RT_VERSION equ 16
RT_MANIFEST equ 24
struc GRPICONDIR
.idReserved resw 1 ; always 0 - enforced
.idType resw 1 ; always 1 for icons
.idCount resw 1
endstruc
struc GRPICONDIRENTRY
.bWidth resb 1
.bHeight resb 1
.bColorCount resb 1
.bReserved resb 1
.wPlanes resw 1
.wBitCount resw 1
.dwBytesInRes resd 1
.nId resw 1
endstruc
%macro _resourceDirectoryEntry 2
istruc IMAGE_RESOURCE_DIRECTORY_ENTRY
at IMAGE_RESOURCE_DIRECTORY_ENTRY.NameID, dd %1
at IMAGE_RESOURCE_DIRECTORY_ENTRY.OffsetToData, dd IMAGE_RESOURCE_DATA_IS_DIRECTORY | (%2 - Directory_Entry_Resource)
iend
%endmacro
%macro _resource_tree 3 ; ID, Offset, Size
istruc IMAGE_RESOURCE_DIRECTORY
at IMAGE_RESOURCE_DIRECTORY.NumberOfIdEntries, dw 1
iend
istruc IMAGE_RESOURCE_DIRECTORY_ENTRY
at IMAGE_RESOURCE_DIRECTORY_ENTRY.NameID, dd %1
at IMAGE_RESOURCE_DIRECTORY_ENTRY.OffsetToData, dd IMAGE_RESOURCE_DATA_IS_DIRECTORY | (%%language - Directory_Entry_Resource)
iend
%%language:
istruc IMAGE_RESOURCE_DIRECTORY
at IMAGE_RESOURCE_DIRECTORY.NumberOfIdEntries, dw 1
iend
istruc IMAGE_RESOURCE_DIRECTORY_ENTRY
; language doesn't matter
at IMAGE_RESOURCE_DIRECTORY_ENTRY.OffsetToData, dd %%entry - Directory_Entry_Resource
iend
%%entry:
istruc IMAGE_RESOURCE_DATA_ENTRY
at IMAGE_RESOURCE_DATA_ENTRY.OffsetToData, dd %2 - IMAGEBASE
at IMAGE_RESOURCE_DATA_ENTRY.Size1, dd %3
iend
%endmacro
RichKey EQU 092033d19h
struc IMAGE_TLS_DIRECTORY32
.StartAddressOfRawData resd 1
.EndAddressOfRawData resd 1
.AddressOfIndex resd 1
.AddressOfCallBacks resd 1
.SizeOfZeroFill resd 1
.Characteristics resd 1
endstruc
struc IMAGE_TLS_DIRECTORY64
.StartAddressOfRawData resq 1
.EndAddressOfRawData resq 1
.AddressOfIndex resq 1
.AddressOfCallBacks resq 1
.SizeOfZeroFill resd 1
.Characteristics resd 1
endstruc
struc IMAGE_BOUND_IMPORT_DESCRIPTOR
.TimeDateStamp resd 1
.OffsetModuleName resw 1
.NumberOfModulesForwarderRefs resw 1
endstruc
struc WIN_CERTIFICATE
.dwLength resd 1
.wRevision resw 1
.wCertificateType resw 1
.bCertificate resb 0
endstruc
struc IMAGE_BASE_RELOCATION
.VirtualAddress resd 1
.SizeOfBlock resd 1
endstruc
; can't make a struct of that one with Yasm :(
%macro _IMAGE_IMPORT_BY_NAME 1
.Hint dw 0
.Name db %1, 0
%endmacro
IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE equ 0040h
IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY equ 0080h
IMAGE_DLLCHARACTERISTICS_NX_COMPAT equ 0100h
IMAGE_DLLCHARACTERISTICS_NO_SEH equ 0400h
IMAGE_DLLCHARACTERISTICS_APPCONTAINER equ 1000h ; W8
IMAGE_DLLCHARACTERISTICS_GUARD_CF equ 4000h ; W8.1
FLG_SHOW_LDR_SNAPS equ 2
MB_OK equ 00000000h
MB_ICONASTERISK equ 00000040h
MB_APPLMODAL equ 00000000h
LOAD_LIBRARY_AS_DATAFILE equ 000000002h
IMAGE_GUARD_CF_INSTRUMENTED equ 000000100h ;Module performs control flow integrity checks using system-supplied support
IMAGE_GUARD_CFW_INSTRUMENTED equ 000000200h ;Module performs control flow and write integrity checks
IMAGE_GUARD_CF_FUNCTION_TABLE_PRESENT equ 000000400h ;Module contains valid control flow target metadata
IMAGE_GUARD_SECURITY_COOKIE_UNUSED equ 000000800h ;Module does not make use of the /GS security cookie
COOKIE_DEFAULT equ 0bb40e64eh
| 29.254815
| 129
| 0.640958
|
367212da4e3be8c244540b683252423374b918ce
| 488
|
asm
|
Assembly
|
oeis/180/A180017.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/180/A180017.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/180/A180017.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A180017: Difference of sums of digits of n in ternary and in binary.
; 0,0,1,-1,1,1,0,0,3,-1,0,0,0,0,1,-1,3,3,0,0,2,0,1,1,2,2,3,-3,-1,-1,-2,-2,3,1,2,2,0,0,1,-1,2,2,1,1,3,-1,0,0,2,2,3,1,3,3,-2,-2,1,-1,0,0,0,0,1,-3,3,3,2,2,4,2,3,3,2,2,3,1,3,3,2,2,6,-2,-1,-1,-1,-1,0,-2,1,1,-2,-2,0,-2,-1,-1,2,2,3,-1
lpb $0
mov $2,$0
div $0,2
mul $2,2
sub $2,$0
seq $2,65363 ; Sum of balanced ternary digits in n. Replace 3^k with 1 in balanced ternary expansion of n.
add $3,$2
lpe
mov $0,$3
| 37.538462
| 227
| 0.557377
|
9606f4f0367469ceed45a95d486302d0b520789e
| 9,086
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_18180_1180.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_18180_1180.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_18180_1180.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 %r15
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WT_ht+0xe86f, %rsi
lea addresses_A_ht+0x1006f, %rdi
nop
nop
sub $63668, %rdx
mov $54, %rcx
rep movsb
nop
nop
nop
cmp $9352, %r15
lea addresses_WT_ht+0x1a71d, %rsi
lea addresses_UC_ht+0x1b55b, %rdi
clflush (%rsi)
nop
nop
nop
nop
and %r8, %r8
mov $44, %rcx
rep movsb
nop
sub %rdi, %rdi
lea addresses_D_ht+0x1770f, %rsi
lea addresses_A_ht+0x4247, %rdi
nop
and $37971, %rbp
mov $38, %rcx
rep movsq
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_WT_ht+0x1206f, %rsi
lea addresses_WT_ht+0xf4ef, %rdi
nop
nop
nop
nop
inc %r9
mov $48, %rcx
rep movsw
nop
nop
nop
nop
sub $40795, %rcx
lea addresses_UC_ht+0xb56f, %r9
sub %rcx, %rcx
mov (%r9), %rsi
nop
nop
xor %rdi, %rdi
lea addresses_normal_ht+0xe8f7, %rdx
nop
nop
nop
xor %rcx, %rcx
mov (%rdx), %rdi
nop
xor %rbp, %rbp
lea addresses_WT_ht+0x1a50f, %rsi
lea addresses_D_ht+0x624f, %rdi
nop
xor $39663, %r15
mov $83, %rcx
rep movsw
nop
nop
xor $18669, %rcx
lea addresses_D_ht+0x1106f, %r15
nop
nop
nop
nop
dec %r8
movw $0x6162, (%r15)
nop
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_D_ht+0x9713, %rsi
nop
nop
nop
nop
nop
and %r15, %r15
mov $0x6162636465666768, %rdx
movq %rdx, %xmm4
movups %xmm4, (%rsi)
nop
nop
xor %rsi, %rsi
lea addresses_A_ht+0x546f, %rsi
lea addresses_UC_ht+0x1946f, %rdi
nop
nop
nop
nop
sub %r15, %r15
mov $106, %rcx
rep movsq
nop
dec %r8
lea addresses_WT_ht+0x1eb93, %rsi
lea addresses_A_ht+0x1dc7, %rdi
nop
nop
nop
add %r8, %r8
mov $90, %rcx
rep movsq
nop
nop
nop
nop
cmp %r15, %r15
lea addresses_normal_ht+0x1d10f, %r8
nop
nop
nop
nop
sub %rcx, %rcx
mov (%r8), %di
add $56222, %rcx
lea addresses_WT_ht+0x1646f, %rbp
dec %rcx
mov $0x6162636465666768, %rdx
movq %rdx, %xmm0
vmovups %ymm0, (%rbp)
inc %r8
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r15
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r8
push %rax
push %rbp
push %rbx
push %rdx
// Store
lea addresses_RW+0x1fa9f, %rax
nop
nop
nop
nop
nop
xor $44723, %r8
mov $0x5152535455565758, %rdx
movq %rdx, (%rax)
nop
nop
xor $27287, %r8
// Store
lea addresses_A+0xc747, %r10
nop
nop
nop
xor %rbp, %rbp
movl $0x51525354, (%r10)
nop
nop
nop
nop
add $56769, %rbx
// Load
lea addresses_A+0x9b6f, %rdx
nop
nop
xor %r12, %r12
movb (%rdx), %bl
nop
nop
nop
nop
xor $8035, %r8
// Load
lea addresses_D+0xf790, %r8
nop
cmp $26038, %rbx
movb (%r8), %al
nop
sub %rdx, %rdx
// Load
lea addresses_RW+0x6c6f, %r12
nop
add $39828, %rbp
mov (%r12), %r10
nop
nop
nop
nop
xor $52426, %r8
// Store
lea addresses_WC+0xa46f, %rbp
clflush (%rbp)
nop
nop
nop
nop
inc %r8
mov $0x5152535455565758, %rax
movq %rax, %xmm2
vmovups %ymm2, (%rbp)
nop
nop
add %rbx, %rbx
// Store
mov $0xef533000000076f, %rbx
sub $27695, %rbp
movw $0x5152, (%rbx)
nop
nop
nop
inc %r10
// Faulty Load
lea addresses_RW+0x6c6f, %rbx
nop
inc %r10
vmovups (%rbx), %ymm2
vextracti128 $1, %ymm2, %xmm2
vpextrq $1, %xmm2, %r12
lea oracles, %rbx
and $0xff, %r12
shlq $12, %r12
mov (%rbx,%r12,1), %r12
pop %rdx
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 4, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 3, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10, 'same': False, 'type': 'addresses_WC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5, 'same': False, 'type': 'addresses_NC'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_RW'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_D_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 5, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 5, 'same': True, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 5, 'same': True, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 1, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 11, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'32': 18180}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 30.489933
| 2,999
| 0.652873
|
447dbe01dbded78a7fe2142cbf3d895089e68d5c
| 211
|
asm
|
Assembly
|
programs/oeis/134/A134441.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/134/A134441.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/134/A134441.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A134441: Last two digits of primes of form 4n+1 (A002144), excluding 5. Leading 0's omitted.
; 1,9,13,17,21,29,33,37,41,49,53,57,61,69,73,77,81,89,93,97
mov $1,5
mul $1,$0
add $1,3
div $1,4
mul $1,4
add $1,1
| 21.1
| 94
| 0.654028
|
5f96740b2655ad659634691e15a8ae09758883f0
| 707
|
asm
|
Assembly
|
programs/oeis/158/A158062.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/158/A158062.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/158/A158062.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A158062: a(n) = 36*n^2 - 2*n.
; 34,140,318,568,890,1284,1750,2288,2898,3580,4334,5160,6058,7028,8070,9184,10370,11628,12958,14360,15834,17380,18998,20688,22450,24284,26190,28168,30218,32340,34534,36800,39138,41548,44030,46584,49210,51908,54678,57520,60434,63420,66478,69608,72810,76084,79430,82848,86338,89900,93534,97240,101018,104868,108790,112784,116850,120988,125198,129480,133834,138260,142758,147328,151970,156684,161470,166328,171258,176260,181334,186480,191698,196988,202350,207784,213290,218868,224518,230240,236034,241900,247838,253848,259930,266084,272310,278608,284978,291420,297934,304520,311178,317908,324710,331584,338530,345548,352638,359800
add $0,1
mul $0,18
bin $0,2
div $0,9
mul $0,2
| 78.555556
| 627
| 0.80198
|
5c712e3b2c17dad18584a8287189c487e9f9bc55
| 7,431
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1799.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_1799.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_1799.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 %r13
push %r15
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1c7ac, %r15
nop
nop
nop
sub $48164, %r10
mov (%r15), %r11w
nop
sub %rcx, %rcx
lea addresses_D_ht+0x2013, %rsi
lea addresses_WT_ht+0xc344, %rdi
nop
sub $61726, %rbx
mov $64, %rcx
rep movsb
nop
nop
nop
nop
nop
inc %rsi
lea addresses_UC_ht+0x1c4fd, %rdi
nop
nop
nop
nop
nop
xor %r15, %r15
vmovups (%rdi), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %rsi
add %rdi, %rdi
lea addresses_normal_ht+0x65ec, %rsi
clflush (%rsi)
nop
add %r15, %r15
movw $0x6162, (%rsi)
nop
inc %r11
lea addresses_UC_ht+0x1ecec, %rbx
nop
nop
nop
nop
nop
inc %r10
movl $0x61626364, (%rbx)
nop
add %r11, %r11
lea addresses_WT_ht+0x198ec, %r10
nop
nop
nop
nop
and %rbx, %rbx
mov $0x6162636465666768, %r11
movq %r11, %xmm1
movups %xmm1, (%r10)
nop
nop
and %rcx, %rcx
lea addresses_WC_ht+0x1126c, %rsi
lea addresses_WT_ht+0x2d6c, %rdi
nop
nop
nop
nop
nop
sub %r13, %r13
mov $31, %rcx
rep movsl
nop
nop
nop
dec %rcx
lea addresses_A_ht+0x1a4ec, %rsi
clflush (%rsi)
sub %r15, %r15
movl $0x61626364, (%rsi)
nop
and $24292, %rdi
lea addresses_WT_ht+0x1236c, %rcx
nop
nop
nop
nop
nop
dec %rsi
mov (%rcx), %r10w
nop
nop
nop
nop
nop
sub $280, %r13
lea addresses_A_ht+0x192ec, %rsi
nop
nop
nop
nop
nop
xor %rdi, %rdi
mov (%rsi), %rbx
nop
nop
sub $3645, %rsi
lea addresses_D_ht+0x1c2ec, %r10
nop
nop
nop
nop
nop
dec %r13
movl $0x61626364, (%r10)
nop
nop
inc %rbx
lea addresses_normal_ht+0xd0b4, %rsi
nop
nop
nop
cmp %r15, %r15
mov $0x6162636465666768, %r11
movq %r11, (%rsi)
nop
nop
nop
nop
xor %r10, %r10
lea addresses_WT_ht+0x17f8c, %rsi
lea addresses_WC_ht+0x197e3, %rdi
nop
dec %r11
mov $124, %rcx
rep movsl
nop
nop
nop
sub $10172, %r13
lea addresses_WC_ht+0x7bec, %rsi
lea addresses_UC_ht+0x155cc, %rdi
xor $106, %r15
mov $65, %rcx
rep movsw
nop
nop
inc %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r15
push %r8
push %rax
push %rcx
// Faulty Load
lea addresses_UC+0xe4ec, %r11
nop
and %rcx, %rcx
mov (%r11), %r8d
lea oracles, %r11
and $0xff, %r8
shlq $12, %r8
mov (%r11,%r8,1), %r8
pop %rcx
pop %rax
pop %r8
pop %r15
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_UC', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_UC', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}}
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 7, 'NT': False, 'type': 'addresses_normal_ht', 'size': 2, 'AVXalign': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False}}
{'src': {'same': True, 'congruent': 7, 'NT': True, 'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 8, 'NT': True, 'type': 'addresses_D_ht', 'size': 4, 'AVXalign': True}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 3, 'NT': True, 'type': 'addresses_normal_ht', 'size': 8, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}}
{'37': 21829}
37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37 37
*/
| 34.24424
| 2,999
| 0.657516
|
c3217279e755dd576574130e263b6cb0d562df3e
| 306
|
asm
|
Assembly
|
programs/oeis/305/A305503.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/305/A305503.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/305/A305503.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A305503: Largest cardinality of subsets A of {0,1,...,n-1} with |A + A| > |A - A|.
; 0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40
lpb $0,1
trn $1,3
add $1,$0
trn $1,3
sub $0,$1
trn $0,1
trn $1,3
add $0,$1
lpe
| 23.538462
| 126
| 0.555556
|
42bf09ca1a50951fcbbb5647f1f5d8df9c65e96d
| 255
|
asm
|
Assembly
|
programs/oeis/178/A178681.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/178/A178681.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/178/A178681.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A178681: a(n) = 6^n + 6.
; 7,12,42,222,1302,7782,46662,279942,1679622,10077702,60466182,362797062,2176782342,13060694022,78364164102,470184984582,2821109907462,16926659444742,101559956668422,609359740010502,3656158440062982
mov $1,6
pow $1,$0
add $1,6
| 36.428571
| 198
| 0.796078
|
7f5382666a8233510d99cff4917854ae7712c9a0
| 3,861
|
asm
|
Assembly
|
Driver/Socket/EtherLink/etherAddrCtrl.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504
|
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Driver/Socket/EtherLink/etherAddrCtrl.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96
|
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Driver/Socket/EtherLink/etherAddrCtrl.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: loopbackAddrCtrl.asm
AUTHOR: Steve Jang, Dec 5, 1994
ROUTINES:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 12/ 5/94 Initial revision
DESCRIPTION:
LoopbackAddressControlClass code.
$Id: loopbackAddrCtrl.asm,v 1.2 95/01/09 01:42:47 weber Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LoopbackClassStructures segment resource
LoopbackAddrCtrlChildList GenControlChildInfo \
< offset LoopbackAddrCtrlBox,
0,
mask GCCF_IS_DIRECTLY_A_FEATURE or mask GCCF_ALWAYS_ADD>
LoopbackAddrCtrlFeaturesList GenControlFeaturesInfo \
< offset LoopbackAddrCtrlBox,
0,
1>
LoopbackClassStructures ends
LoopbackCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LACGenControlGetInfo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Returns GenCtrl information for LoopbackAddressControlClass
CALLED BY: MSG_GEN_CONTROL_GET_INFO
PASS: *ds:si = LoopbackAddressControlClass object
ds:di = LoopbackAddressControlClass instance data
ds:bx = LoopbackAddressControlClass object (same as *ds:si)
es = segment of LoopbackAddressControlClass
ax = message #
cx:dx = Buffer for GenControlInfo
RETURN: GenControlDupInfo field filled in
DESTROYED: nothing
REVISION HISTORY:
Name Date Description
---- ---- -----------
SJ 12/ 5/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LACGenControlGetInfo method dynamic LoopbackAddressControlClass,
MSG_GEN_CONTROL_GET_INFO
uses cx
.enter
;
; copy the data into the buffer
;
segmov ds, cs ; ds:si = source
mov si, offset LoopbackAddrCtrlInfo
mov es, cx
mov di, dx ; es:di = dest
mov cx, size GenControlBuildInfo
rep movsb
.leave
ret
LACGenControlGetInfo endm
LoopbackAddrCtrlInfo GenControlBuildInfo <
mask GCBF_NOT_REQUIRED_TO_BE_ON_SELF_LOAD_OPTIONS_LIST, ;GCBI_flags
0, ; GCBI_initFileKey
0, ; GCBI_gcnList
0, ; GCBI_gcnCount
0, ; GCBI_notificationList
0, ; GCBI_notificationCount
0, ; GCBI_controllerName
handle LoopbackAddrCtrlBox, ; GCBI_dupBlock
LoopbackAddrCtrlChildList, ; GCBI_childList
length LoopbackAddrCtrlChildList, ; GCBI_childCount
LoopbackAddrCtrlFeaturesList, ; GCBI_featuresList
length LoopbackAddrCtrlFeaturesList, ; GCBI_featuresCount
1, ; GCBI_features
0, ; GCBI_toolBlock
0, ; GCBI_toolList
0, ; GCBI_toolCount
0, ; GCBI_toolFeaturesList
0, ; GCBI_toolFeaturesCount
0, ; GCBI_toolFeatures
0, ; GCBI_helpContext
0 ; GCBI_reserve
>
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LoopbackInitialize
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize instance data with our geode handle
CALLED BY: MSG_META_INITIALIZE
PASS: *ds:si = LoopbackAddressControlClass object
es = segment of LoopbackAddressControlClass
ax = message #
RETURN: nothing
DESTROYED: ax,cx,dx,bp
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
EW 1/ 5/95 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LoopbackInitialize method dynamic LoopbackAddressControlClass,
MSG_META_INITIALIZE
mov ds:[di].SACI_geode, handle 0
mov di, offset LoopbackAddressControlClass
GOTO ObjCallSuperNoLock
LoopbackInitialize endm
LoopbackCode ends
| 27.578571
| 79
| 0.605025
|
34ae4997388c2a49a276a7135ee5001f49b69792
| 224
|
asm
|
Assembly
|
libsrc/_DEVELOPMENT/adt/p_list/c/sccz80/p_list_remove_callee.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/adt/p_list/c/sccz80/p_list_remove_callee.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
libsrc/_DEVELOPMENT/adt/p_list/c/sccz80/p_list_remove_callee.asm
|
meesokim/z88dk
|
5763c7778f19a71d936b3200374059d267066bb2
|
[
"ClArtistic"
] | null | null | null |
; void *p_list_remove(p_list_t *list, void *item)
SECTION code_adt_p_list
PUBLIC p_list_remove_callee
p_list_remove_callee:
pop af
pop hl
pop bc
push af
INCLUDE "adt/p_list/z80/asm_p_list_remove.asm"
| 14
| 49
| 0.736607
|
92052b04c8a12b9cb9c7730e01d8f9e1a395a466
| 1,472
|
asm
|
Assembly
|
programs/oeis/238/A238410.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | 1
|
2021-03-15T11:38:20.000Z
|
2021-03-15T11:38:20.000Z
|
programs/oeis/238/A238410.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/238/A238410.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A238410: a(n) = floor((3(n-1)^2 + 1)/2).
; 0,2,6,14,24,38,54,74,96,122,150,182,216,254,294,338,384,434,486,542,600,662,726,794,864,938,1014,1094,1176,1262,1350,1442,1536,1634,1734,1838,1944,2054,2166,2282,2400,2522,2646,2774,2904,3038,3174,3314,3456,3602,3750,3902,4056,4214,4374,4538,4704,4874,5046,5222,5400,5582,5766,5954,6144,6338,6534,6734,6936,7142,7350,7562,7776,7994,8214,8438,8664,8894,9126,9362,9600,9842,10086,10334,10584,10838,11094,11354,11616,11882,12150,12422,12696,12974,13254,13538,13824,14114,14406,14702,15000,15302,15606,15914,16224,16538,16854,17174,17496,17822,18150,18482,18816,19154,19494,19838,20184,20534,20886,21242,21600,21962,22326,22694,23064,23438,23814,24194,24576,24962,25350,25742,26136,26534,26934,27338,27744,28154,28566,28982,29400,29822,30246,30674,31104,31538,31974,32414,32856,33302,33750,34202,34656,35114,35574,36038,36504,36974,37446,37922,38400,38882,39366,39854,40344,40838,41334,41834,42336,42842,43350,43862,44376,44894,45414,45938,46464,46994,47526,48062,48600,49142,49686,50234,50784,51338,51894,52454,53016,53582,54150,54722,55296,55874,56454,57038,57624,58214,58806,59402,60000,60602,61206,61814,62424,63038,63654,64274,64896,65522,66150,66782,67416,68054,68694,69338,69984,70634,71286,71942,72600,73262,73926,74594,75264,75938,76614,77294,77976,78662,79350,80042,80736,81434,82134,82838,83544,84254,84966,85682,86400,87122,87846,88574,89304,90038,90774,91514,92256,93002
pow $0,2
mul $0,3
add $0,1
div $0,2
mov $1,$0
| 163.555556
| 1,381
| 0.798234
|
d4a4c657be685164e65b68b225222bbfec16930a
| 7,963
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_440_1113.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_440_1113.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_xt_/i7-8650U_0xd2_notsx.log_440_1113.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 %r13
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x1d795, %rcx
nop
and $19760, %r11
mov (%rcx), %rax
nop
dec %r8
lea addresses_UC_ht+0x1ba95, %rax
nop
nop
nop
nop
nop
dec %r13
mov $0x6162636465666768, %r9
movq %r9, (%rax)
nop
nop
nop
and $29079, %r13
lea addresses_A_ht+0x1cb75, %r11
nop
nop
nop
nop
add %r12, %r12
mov (%r11), %eax
nop
nop
nop
sub %r12, %r12
lea addresses_A_ht+0x11b95, %rsi
lea addresses_D_ht+0x1e615, %rdi
nop
nop
nop
nop
nop
and %r13, %r13
mov $93, %rcx
rep movsq
nop
and $20159, %r11
lea addresses_A_ht+0x1baed, %r9
nop
nop
nop
xor %r8, %r8
mov (%r9), %r11
xor %r12, %r12
lea addresses_WC_ht+0xd84d, %r11
nop
nop
nop
nop
cmp $37578, %rax
mov (%r11), %r9w
xor %r12, %r12
lea addresses_UC_ht+0xad75, %r13
nop
nop
nop
add %r11, %r11
movb (%r13), %r8b
nop
nop
nop
nop
nop
sub $4197, %r12
lea addresses_A_ht+0xfc05, %rdi
dec %r12
mov $0x6162636465666768, %r11
movq %r11, (%rdi)
nop
nop
nop
sub %rax, %rax
lea addresses_WT_ht+0x4f15, %r9
clflush (%r9)
nop
nop
nop
add $5892, %rdi
movw $0x6162, (%r9)
nop
nop
nop
nop
dec %r13
lea addresses_D_ht+0x14b95, %rsi
lea addresses_UC_ht+0x2163, %rdi
sub %r13, %r13
mov $105, %rcx
rep movsw
nop
and %rax, %rax
lea addresses_normal_ht+0x8b05, %rsi
lea addresses_WC_ht+0x1ab59, %rdi
clflush (%rsi)
nop
cmp %r11, %r11
mov $48, %rcx
rep movsl
nop
nop
nop
nop
cmp %rsi, %rsi
lea addresses_A_ht+0x1401b, %r13
nop
nop
nop
nop
sub $3310, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, (%r13)
nop
add %rsi, %rsi
lea addresses_A_ht+0xfc55, %rsi
lea addresses_WC_ht+0x1c75, %rdi
nop
nop
xor %r11, %r11
mov $127, %rcx
rep movsl
nop
nop
inc %r13
lea addresses_A_ht+0x179a5, %rax
nop
xor $64360, %r9
mov (%rax), %r13w
nop
nop
nop
add $25334, %rdi
lea addresses_normal_ht+0x9b95, %rax
clflush (%rax)
nop
nop
nop
inc %r8
vmovups (%rax), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %r13
nop
nop
nop
nop
add $35799, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r13
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r14
push %r8
push %r9
push %rcx
push %rdx
// Store
lea addresses_RW+0x12b95, %rdx
dec %rcx
mov $0x5152535455565758, %r10
movq %r10, %xmm5
vmovups %ymm5, (%rdx)
nop
nop
nop
nop
nop
add $10858, %rcx
// Store
mov $0xaad, %rdx
nop
nop
nop
nop
nop
dec %r11
movb $0x51, (%rdx)
dec %r8
// Load
lea addresses_RW+0x123d5, %rdx
nop
nop
nop
nop
sub %r14, %r14
mov (%rdx), %r8d
nop
nop
nop
nop
sub %r10, %r10
// Store
lea addresses_WT+0xb015, %r9
nop
nop
nop
nop
nop
cmp $55994, %rdx
movb $0x51, (%r9)
nop
nop
nop
and $48475, %r10
// Load
mov $0xd95, %r10
nop
nop
nop
nop
nop
and %r8, %r8
movb (%r10), %cl
nop
nop
nop
nop
nop
xor $23959, %rdx
// Store
mov $0x7dd, %r11
nop
and %rcx, %rcx
mov $0x5152535455565758, %r8
movq %r8, (%r11)
nop
nop
nop
nop
and $2813, %r11
// Store
lea addresses_PSE+0x7195, %rdx
nop
nop
nop
nop
nop
sub %r10, %r10
movw $0x5152, (%rdx)
nop
sub $489, %rdx
// Store
mov $0x43ebb40000000895, %rdx
nop
nop
nop
nop
nop
and %r9, %r9
mov $0x5152535455565758, %r11
movq %r11, %xmm6
vmovups %ymm6, (%rdx)
nop
nop
nop
inc %rdx
// Faulty Load
lea addresses_RW+0x8395, %rdx
nop
dec %r14
mov (%rdx), %r11
lea oracles, %rdx
and $0xff, %r11
shlq $12, %r11
mov (%rdx,%r11,1), %r11
pop %rdx
pop %rcx
pop %r9
pop %r8
pop %r14
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_P', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': False, 'NT': True, 'congruent': 9, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 8, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 7, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 4, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': True}}
{'32': 440}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 23.283626
| 1,319
| 0.644481
|
40e1c33c0ae32d75616b2d63e0c43e7df05a36cd
| 528
|
asm
|
Assembly
|
programs/oeis/083/A083457.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/083/A083457.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/083/A083457.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A083457: Smallest nontrivial k such that k^n - 1 is a palindrome (k >1 for n>1).
; 1,2,2,10,3,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
mov $1,1
mov $2,$0
mov $4,1
lpb $$2,1
sub $2,1
add $3,5
lpe
lpb $$4,1
sub $4,1
lpe
add $$5,3
trn $1,$$4
add $$4,4
sub $$2,$$4
mov $$0,$$1
lpb $$0,1
sub $0,1
add $1,5
lpe
lpb $4,1
sub $4,1
lpe
mov $$2,1
mov $$4,2
add $1,1
| 18.206897
| 210
| 0.590909
|
ea4631e30eab6cd3bf9fd7ef2e67732a5accfd47
| 83,169
|
asm
|
Assembly
|
Library/Kernel/Sys/sysMisc.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 504
|
2018-11-18T03:35:53.000Z
|
2022-03-29T01:02:51.000Z
|
Library/Kernel/Sys/sysMisc.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 96
|
2018-11-19T21:06:50.000Z
|
2022-03-06T10:26:48.000Z
|
Library/Kernel/Sys/sysMisc.asm
|
steakknife/pcgeos
|
95edd7fad36df400aba9bab1d56e154fc126044a
|
[
"Apache-2.0"
] | 73
|
2018-11-19T20:46:53.000Z
|
2022-03-29T00:59:26.000Z
|
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1989 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Kernel System Functions -- Miscellaneous Functions
FILE: sysMisc.asm
AUTHOR: Adam de Boor, Apr 6, 1989
ROUTINES:
Name Description
---- -----------
GLB SysEmptyRoutine Routine that should never be called
GLB SysShutdown Exit the system gracefully
GLB SysGetConfig Return system configuration information
GLB SysSetExitFlags Set/clear exit flags
GLB UtilHex32ToAscii Convert a 32-bit number to an ascii
GLB UtilAsciiToHex32 Convert an ASCII string to a 32-bit number
string.
RGLB SysLockBIOS Gain exclusive access to DOS/BIOS
RGLB SysUnlockBIOS Release exclusive access to DOS/BIOS
EXT SysCallCallbackBP Call a standard callback function passing
bp properly.
EXT SysJumpVector Call a vector w/o trashing registers
EXT SysLockCommon Perform common module-lock lock operations
EXT SysUnlockCommon Perform common module-lock unlock operations
EXT SysPSemCommon Perform common PSem operations
EXT SysVSemCommon Perform common VSem operations
EXT SysCopyToStack* Copy a buffer to the stack for XIP
GLB SYSSETINKWIDTHANDHEIGHT Set the default ink thickness
GLB SYSGETINKWIDTHANDHEIGHT
GLB SYSDISABLEAPO disable auto power off
GLB SYSENABLEAPO enable auto power off
REVISION HISTORY:
Name Date Description
---- ---- -----------
Adam 4/ 6/89 Initial revision
DESCRIPTION:
Miscellaneous system functions
$Id: sysMisc.asm,v 1.2 98/04/30 15:50:39 joon Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysSetExitFlags
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets and clears the exit flags (this is intended for use
by task-switching drivers, primarily)
CALLED BY: RESTRICTED GLOBAL
PASS: bh - flags to clear
bl - flags to set
RETURN: bl - exitFlags
DESTROYED: bh
PSEUDO CODE/STRATEGY:
This page intentionally left blank
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 5/ 2/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysSetExitFlags proc far
uses ds
.enter
EC < test bl, not mask ExitFlags >
EC < jnz bad >
EC < test bh, not mask ExitFlags >
EC < jz good >
EC <bad: >
EC < ERROR BAD_EXIT_FLAGS >
EC <good: >
LoadVarSeg ds ;Get ptr to idata
or bl,ds:[exitFlags] ;Set bits
not bh ;
and bl,bh ;Clear bits
mov ds:[exitFlags],bl ;
.leave
ret
SysSetExitFlags endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LoadVarSegDS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Load the kernel's data segment into DS
CALLED BY: INTERNAL
PASS: nothing
RETURN: ds = idata
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/ 8/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
kernelData word dgroup
LoadVarSegDS proc near
.enter
mov ds, cs:kernelData
.leave
ret
LoadVarSegDS endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LoadVarSegES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Load the kernel's data segment into ES
CALLED BY: INTERNAL
PASS: nothing
RETURN: es = idata
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/ 8/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LoadVarSegES proc near
.enter
mov es, cs:kernelData
.leave
ret
LoadVarSegES endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysEmptyRoutine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: A routine to which empty slots in the jump table are vectored
CALLED BY: Shouldn't be
PASS: Anything
RETURN: Never
DESTROYED: Everything
PSEUDO CODE/STRATEGY:
FatalError(SYS_EMPTY_CALLED)
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/ 6/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysEmptyRoutine proc far
ERROR SYS_EMPTY_CALLED
SysEmptyRoutine endp
ForceRef SysEmptyRoutine ;Used for "skip" in .gp file
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysShutdown
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Cause the system to exit
CALLED BY: EXTERNAL
PASS: ax - SysShutdownType. See documentation in system.def for
additional parameters specific to the type of shutdown
RETURN: only as noted in system.def
DESTROYED: ax, bx, cx, dx, bp
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/13/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysShutdown proc far
uses es, ds, si, di
.enter
EC < cmp ax,SysShutdownType >
EC < ERROR_AE BAD_SHUTDOWN_TYPE >
mov_tr di, ax
LoadVarSeg es, ax
shl di
jmp cs:[shutdownTable][di]
shutdownTable nptr.near clean, ; SST_CLEAN
cleanForced, ; SST_CLEAN_FORCED
dirty, ; SST_DIRTY
EndGeosDoubleFault, ; SST_PANIC
reboot, ; SST_REBOOT
restart, ; SST_RESTART
final, ; SST_FINAL
suspend, ; SST_SUSPEND
confirmStart, ; SST_CONFIRM_START
confirmEnd, ; SST_CONFIRM_END
cleanReboot, ; SST_CLEAN_REBOOT
powerOff ; SST_POWER_OFF
;--------------------
dirty:
inc es:[errorFlag] ; set errorFlag so we don't delete
; the GEOS_ACT.IVE file, thereby
; alerting us to the non-standard
; exit next time.
; FALL THROUGH
;--------------------
final:
cmp si, -1
je die
; move the string to messageBuffer
mov di, offset messageBuffer
mov cx, length messageBuffer-1
copyLoop:
if not DBCS_PCGEOS
lodsb
else
lodsw
EC < tst ah >
EC < WARNING_NZ LARGE_VALUE_FOR_CHARACTER >
endif
stosb
tst al
loopne copyLoop
clr al
stosb
die:
jmp EndGeos
;--------------------
reboot:
ornf es:[exitFlags], mask EF_RESET
jmp EndGeos
;--------------------
restart:
call DosExecPrepareForRestart
LONG jc done
;--------------------
cleanForced:
; If the UI is not running, just exit
mov bx,es:[uiHandle]
tst bx
jz die
; The UI is running -- tell it to kill all apps & fields. No ack optr
; or ID, as the UI will call us back with SST_FINAL when everything's
; ready to go.
mov ax, MSG_META_DETACH
clr cx, dx, bp, di
call ObjMessage
clc
jmp done
;--------------------
powerOff:
push ds, si, di
; jfh 12/05/03 - lets put the string in a resource for localization
mov bx, handle MovableStrings
call MemLock
mov ds, ax
; segmov ds, cs
mov si, offset PowerOffString
mov si, ds:[si] ; ds:si <- PowerOffString
mov di, offset messageBuffer
LocalCopyString
call MemUnlock
pop ds, si, di
ornf es:[exitFlags], mask EF_POWER_OFF
jmp short clean
;PowerOffString char "You may now safely turn off the computer.",0
;--------------------
cleanReboot:
ornf es:[exitFlags], mask EF_RESET
; FALL THROUGH
;--------------------
clean:
mov di, GCNSCT_SHUTDOWN
cleanSuspendCommon:
segmov ds, es
;
; Gain exclusive access to the shutdown-status variables.
;
PSem ds, shutdownBroadcastSem, TRASH_AX_BX
;
; If something else is already shutting down the system, fail this
; request.
;
tst ds:[shutdownConfirmCount]
jnz failCleanSuspend
;
; Record the object we should notify when the final confirmation
; comes in.
;
mov ds:[shutdownAckOD].handle, cx
mov ds:[shutdownAckOD].chunk, dx
mov ds:[shutdownAckMsg], bp
;
; Start the count off at 1 so we can reliably figure out when to send
; out notification and deal with not having anyone interested in what
; we've got to say...The extra 10,000 are to deal with having something
; being notified being run by this thread (since we can't add the
; count of the number of notifications in until GCNListRecordAndSend
; returns).
;
mov ds:[shutdownConfirmCount], 10001
VSem ds, shutdownBroadcastSem, TRASH_AX_BX
;
; Broadcast the intent to shutdown.
;
mov bx, MANUFACTURER_ID_GEOWORKS
mov si, GCNSLT_SHUTDOWN_CONTROL
mov bp, di
clr di ; not status message
mov ax, MSG_META_CONFIRM_SHUTDOWN
call GCNListRecordAndSend
;
; Record the number of acks needed and remove our protective 10,000
;
add ds:[shutdownConfirmCount], cx
sub ds:[shutdownConfirmCount], 10000
;
; Now perform an SST_CONFIRM_END allowing the shutdown, thereby sending
; confirmation to the caller if there was no one on the list.
;
mov cx, TRUE
jmp confirmEnd
failCleanSuspend:
;
; Someone else is doing a shutdown, so we can't start this one off.
; Release the broadcast semaphore and return carry set.
;
VSem ds, shutdownBroadcastSem, TRASH_AX_BX
doneCarrySet:
stc
done:
.leave
ret
;--------------------
suspend:
mov di, GCNSCT_SUSPEND
jmp cleanSuspendCommon
;--------------------
confirmStart:
;
; Gain the exclusive right to ask the user to confirm.
;
segmov ds, es
PSem ds, shutdownConfirmSem, TRASH_AX_BX
;
; If not already refused, return carry clear.
;
tst ds:[shutdownOK]
jnz done
;
; Someone's already refused the shutdown, so call ourselves to deny
; the request and return carry set.
clr cx
mov ax, SST_CONFIRM_END
call SysShutdown
jmp doneCarrySet
;--------------------
confirmEnd:
segmov ds, es
jcxz denied
releaseConfirmSem:
VSem ds, shutdownConfirmSem, TRASH_AX_BX
;
; Gain exclusive access to the confirm count & attendant variables, to
; prevent some other thread from coming in after the dec but before we
; can load the other variables, and trashing them...
;
PSem ds, shutdownBroadcastSem, TRASH_AX_BX
dec ds:[shutdownConfirmCount]
jz sendShutdownConfirmAck
confirmEndComplete:
VSem ds, shutdownBroadcastSem, TRASH_AX_BX
clc ; carry clear for SST_CLEAN/SST_SUSPEND...
jmp done
denied:
;
; Caller is refusing the shutdown, so mark the shutdown as denied
; and do all the normal processing for SST_CONFIRM_END.
;
mov ds:[shutdownOK], FALSE
jmp releaseConfirmSem
sendShutdownConfirmAck:
;
; Fetch shutdownOK into CX to tell the original caller whether it's
; ok to shutdown/suspend.
;
clr cx
mov cl, TRUE
xchg ds:[shutdownOK], cl
;
; If no shutdownAckOD, it means we should notify the UI in the normal
; fashion.
;
mov bx, ds:[shutdownAckOD].handle
tst bx
jz sendToUI
mov ax, ds:[shutdownAckMsg]
mov si, ds:[shutdownAckOD].chunk
sendShutdownAckMessage:
clr di
call ObjMessage
jmp confirmEndComplete
sendToUI:
;
; If the shutdown was refused and there's no one specific to notify, we
; don't need to notify anyone. The UI hasn't been involved in the shut-
; down hitherto, so there's no need to notify it.
;
mov bx, ds:[uiHandle]
EC < tst bx >
EC < ERROR_Z NO_ONE_TO_SEND_SHUTDOWN_ACK_TO_ALAS >
mov ax, MSG_META_DETACH
clr dx, bp ; no Ack OD
tst cx
jnz sendShutdownAckMessage
;
; If marked as running a DOS application, let the task driver know
; the shutdown was aborted.
;
test ds:[exitFlags], mask EF_RUN_DOS
jz confirmEndComplete
mov di, DR_TASK_SHUTDOWN_COMPLETE
call ds:[taskDriverStrategy]
jmp confirmEndComplete
SysShutdown endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYSGETCONFIG
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Return the system configuration
CALLED BY: GLOBAL
PASS: Nothing
RETURN: AL = SysConfigFlags reflecting system status
AH = reserved
DL = SysProcessorType given processor type
DH = SysMachineType giving machine type
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/17/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SYSGETCONFIG proc far
push ds
LoadVarSeg ds
clr ax
mov al, ds:sysConfig
mov dx, word ptr ds:sysProcessorType
pop ds
ret
SYSGETCONFIG endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYSGETPENMODE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This routine returns AX = TRUE or FALSE depending upon whether
or not the machine PC/GEOS is running on is Pen-based or not.
CALLED BY: GLOBAL
PASS: nada
RETURN: AX = TRUE if PC/GEOS is running on a pen-based system.
DESTROYED: nada
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 11/18/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SYSGETPENMODE proc far uses ds
.enter
LoadVarSeg ds, ax
mov ax, ds:[penBoolean]
.leave
ret
SYSGETPENMODE endp
IMResident segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysDisableAPO
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Disable auto power off feature
CALLED BY: Global
PASS: nothing
RETURN: nothing
DESTROYED: ds
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
if disableAPOCount > 0
dec disableAPOCount
REVISION HISTORY:
Name Date Description
---- ---- -----------
IP 4/29/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SYSDISABLEAPO proc far
uses ds
.enter
call LoadVarSegDS
inc ds:[disableAPOCount]
EC< ERROR_Z DISABLE_APO_COUNT_OVERFLOW >
.leave
ret
SYSDISABLEAPO endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysEnableAPO
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Enable auto power off feature
CALLED BY: Global
PASS: nothing
RETURN: nothing
DESTROYED: ds
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
IP 4/29/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SYSENABLEAPO proc far
uses ds
.enter
call LoadVarSegDS
dec ds:[disableAPOCount]
EC< ERROR_S DISABLE_APO_COUNT_OVERFLOW >
.leave
ret
SYSENABLEAPO endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysGetInkWidthAndHeight
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This function returns the current height and width to
be used as defaults for drawing ink
CALLED BY: Global
PASS: nothing
RETURN: ax - default width and height
DESTROYED:
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
IP 4/28/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SYSGETINKWIDTHANDHEIGHT proc far
uses ds
.enter
LoadVarSeg ds, ax
mov ax, ds:[inkDefaultWidthAndHeight]
.leave
ret
SYSGETINKWIDTHANDHEIGHT endp
IMResident ends
IMPenCode segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysSetInkWidthAndHeight
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Sets the default ink width value
CALLED BY: global
PASS: ax - ink height and width
RETURN: nothing
DESTROYED:
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
IP 4/28/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysSetInkWidthAndHeight proc far
uses bx, ds
.enter
LoadVarSeg ds, bx
mov ds:[inkDefaultWidthAndHeight], ax
.leave
ret
SysSetInkWidthAndHeight endp
IMPenCode ends
COMMENT @-----------------------------------------------------------------------
FUNCTION: UtilHex32ToAscii
DESCRIPTION: Converts a 32 bit unsigned number to its ASCII representation.
CALLED BY: INTERNAL (GenerateLabel)
PASS: DX:AX = DWord to convert
CX = UtilHexToAsciiFlags
UHTAF_INCLUDE_LEADING_ZEROS
UHTAF_NULL_TERMINATE
ES:DI = Buffer to place string. Should be of size:
UHTA_NO_NULL_TERM_BUFFER_SIZE or
UHTA_NULL_TERM_BUFFER_SIZE
RETURN: CX = Length of the string (not including NULL)
DESTROYED: Nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
You might think that one could use the 8086 32bit divide instruction
to perform the conversion here. You'd be wrong. The divisor (10) is
too small. Given something greater than 64k * 10, we will get a divide-
by-zero trap the first time we try to divide. So we use "32-bit"
division with a 16-bit divisor to avoid such problems, doing two
divides instead of one, etc.
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Cheng 7/89 Initial version
Don 1/92 Changed dword parameter to DX:AX
-------------------------------------------------------------------------------@
UtilHex32ToAscii proc far
uses ax, bx, dx, di, si, bp
.enter
if FULL_EXECUTE_IN_PLACE
EC < push bx, si >
EC < movdw bxsi, esdi >
EC < call ECAssertValidFarPointerXIP >
EC < pop bx, si >
endif
mov si, cx ;place flags in si
;
; Check for a signed value
;
test si, mask UHTAF_SIGNED_VALUE
jz notSigned
tst dx
jns notSigned
;
; The value is signed and negative. Stick in a minus sign and negate.
;
negdw dxax ;dx:ax <- negative of value
push ax
DBCS < LocalLoadChar ax, C_MINUS_SIGN >
SBCS < LocalLoadChar ax, C_MINUS >
LocalPutChar esdi, ax
pop ax
jmp afterSigned
notSigned:
andnf si, not (mask UHTAF_SIGNED_VALUE)
afterSigned:
;
; First convert the number to characters, storing each on the stack
;
mov bx, 10 ;print in base ten
clr cx ;cx <- char count
xchg ax, dx
nextDigit:
mov bp, dx ;bp = low word
clr dx ;dx:ax = high word
div bx
xchg ax, bp ;ax = low word, bp = quotient
div bx
xchg ax, dx ;ax = remainder, dx = quotient
add al, '0' ;convert to ASCII
push ax ;save character
inc cx
mov ax, bp ;retrieve quotient of high word
or bp, dx ;check if done
jnz nextDigit ;if not, do next digit
; Now let's see if we need to provide leading zeroes. A 32-bit
; binary values can be as long as ten digits.
;
test si, mask UHTAF_INCLUDE_LEADING_ZEROS
jz copyChars
sub bx, cx ;bx <- number of 0s needed
mov cx, bx ;place count in cx
jcxz tenDigits ;if already ten digits, jump
mov ax, '0' ;character to push
addLeadZeros:
push ax
loop addLeadZeros
tenDigits:
mov cx, 10 ;digit count = 10
; Now pop the characters into its buffer, one-by-one
;
copyChars:
mov dx, cx ;dx = character count
DBCS < test si, mask UHTAF_SBCS_STRING ;want SBCS string? >
DBCS < jnz nextCharSBCS ;branch if SBCS >
nextChar:
pop ax ;retrieve character
SBCS < stosb >
DBCS < stosw >
;
; Check for thousands separators
;
test si, mask UHTAF_THOUSANDS_SEPARATORS
jz afterComma ;branch if no separators
cmp cx, 10
je storeComma
cmp cx, 7
je storeComma
cmp cx, 4
je storeComma
afterComma:
loop nextChar ;loop to print all
DBCS <afterChars: >
;
; Count the sign character if we added it above
;
test si, mask UHTAF_SIGNED_VALUE
jz noSignChar
inc dx ;dx <- one more char
noSignChar:
;
; Add a NULL if requested
;
test si, mask UHTAF_NULL_TERMINATE ;NULL-terminate the string ??
jz noNULL ;nope, so we're done
SBCS < mov {byte} es:[di], 0 ;this is fastest >
DBCS < mov {wchar}es:[di], 0 ;this is fastest >
noNULL:
mov cx, dx ;cx = character count
.leave
ret
storeComma:
inc dx ;dx <- 1 more character
push cx, dx
call LocalGetNumericFormat
mov ax, bx ;ax <- thousands separator
LocalPutChar esdi, ax
pop cx, dx
jmp afterComma
if DBCS_PCGEOS
nextCharSBCS:
pop ax ;retrieve character
stosb ;store SBCS character
loop nextCharSBCS ;loop to print all
jmp afterChars
endif
UtilHex32ToAscii endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
UtilAsciiToHex32
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Converts a null-terminated ASCII string into a dword. The
string may be signed or unsigned.
CALLED BY: GLOBAL
PASS: DS:SI = String to convert
RETURN: DX:AX = DWord value
Carry = Clear (valid number)
- or -
Carry = Set (invalid number)
AX = UtilAsciiToHexError
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 1/ 2/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
UtilAsciiToHex32 proc far
uses bx, cx, bp, si
.enter
if FULL_EXECUTE_IN_PLACE
EC < call ECCheckBounds >
endif
; See if we have a leading minus sign
;
clr ax ; assume positive number
LocalCmpChar ds:[si], '+' ; just skip over a '+', as we
je skipChar ; assume the number is positive
LocalCmpChar ds:[si], '-' ; check for negative sign
jne startConversion ; if not there, jump
dec ax ; else set minus boolean
skipChar:
inc si ; increment past minus sign
LocalNextChar dssi ; increment past minus sign
; Calculate the number, digit by digit
;
startConversion:
push ax ; save minus boolean
clrdw dxcx ; initialize our number
convertDigit:
LocalGetChar ax, dssi ; get the next digit
LocalIsNull ax ; NULL termination ??
jz done ; yes, so jump
SBCS < sub al, '0' ; turn into a number >
DBCS < sub ax, '0' ; turn into a number >
SBCS < cmp al, 9 ; ensure we have a digit >
DBCS < cmp ax, 9 ; ensure we have a digit >
ja notADigit
shldw dxcx ; double current value
jc overflow
movdw bpbx, dxcx
shldw dxcx
jc overflow
shldw dxcx ; 8 * original value => DX:CX
jc overflow
adddw dxcx, bpbx ; and in 2 * original value
jc overflow
SBCS < clr ah >
add cx, ax ; add in new digit
adc dx, 0 ; propogate carry
jnc convertDigit ; loop until done, or overflow
; Deal with error - either an invalid digit or overflow
overflow:
mov cx, UATH_CONVERT_OVERFLOW
jmp error ; we fail with an error
notADigit:
mov cx, UATH_NON_NUMERIC_DIGIT_IN_STRING
error:
stc
done:
pop ax ; minus boolean => AX
xchg ax, cx ; result => DX:AX, boolean => CX
jc exit ; if error, don't do anything
jcxz exit ; if zero, we're OK
mov cx, UATH_CONVERT_OVERFLOW
test dh, 0x80 ; high bit must be clear
stc
jnz exit ; ...else we have overflow
negdw dxax ; else negate the number
clc ; ensure carry is clear
exit:
.leave
ret
UtilAsciiToHex32 endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCallCallbackBP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Standard utility function for calling a callback function
where bp must be passed. The calling function must have a
stack frame whose first local variable is a far pointer
to the callback routine.
CALLED BY: ThreadProcess, FilePathProcess, GeodeProcess, DiskForEach,
WinForEach
PASS: ax, cx, dx, ss:[bp] = data to pass to callback.
ss:[bp] is the bp from entry to the calling function
RETURN: ax, cx, dx, ss:[bp] = data returned by callback
carry - returned from callback
DESTROYED: si (callback may destroy di as well)
PSEUDO CODE/STRATEGY:
Notes - ss:bp points to the word to pass in to called routine
as bp.
save this pointer
load in bp to pass to routine
call routine
restore pointer to BPData
stuff returned BP value into BPData
return
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/24/90 Initial version
todd 02/10/94 Added XIP version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysCallCallbackBP proc near
callback local fptr.far
.enter inherit
push bp
;
; See if we are passed a vfptr, or an fptr.
; Do different actions, depending upon the state
; of the high-byte of the segment.
; -- todd 02/17/94
FXIP< cmp {byte}callback.segment.high, SIG_UNUSED_FF >
FXIP< je doHighMemCall >
FXIP< cmp {byte}callback.segment.high, high MAX_SEGMENT >
FXIP< jae doProcCall >
doHighMemCall::
;
; We got here by one of two ways, either we are
; calling something in high memory, or we are calling
; a segment that doesn't have an 0fh, in the high nibble.
; -- todd 02/17/94
lea si, callback ; ss:[si] = callback routine
mov bp, ss:[bp] ; recover bp passed to caller
call {dword}ss:[si]
done::
mov si, bp ; preserve returned bp
pop bp ; recover our frame pointer
mov ss:[bp], si ; store returned bp for possible
; return/next call
.leave
ret
doProcCall::
;
; Stuff AX and BX into ThreadPrivData so they will be
; passed along to routine. Passing BX in this way
; is easier than pushing and popping, and faster as well.
; -- todd 02/10/94
FXIP< mov ss:[TPD_dataAX], ax >
FXIP< mov ss:[TPD_dataBX], bx >
FXIP< movdw bxax, callback ; bx:ax <- vfptr to callback >
FXIP< mov bp, ss:[bp] ; bp <- data to pass in bp >
FXIP< call ProcCallFixedOrMovable >
FXIP< jmp short done >
SysCallCallbackBP endp
SysCallCallbackBPFar proc far
call SysCallCallbackBP
ret
SysCallCallbackBPFar endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysLockBIOS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Gain exclusive access to BIOS/DOS
CALLED BY: RESTRICTED GLOBAL
PASS: nothing
RETURN: nothing
DESTROYED: flags
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 10/16/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysLockBIOSFar proc far
call SysLockBIOS
ret
SysLockBIOSFar endp
public SysLockBIOSFar
SysLockBIOS proc near
push bx
mov bx, offset biosLock
jmp SysLockCommon
SysLockBIOS endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysUnlockBIOS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Release exclusive access to BIOS/DOS
CALLED BY: RESTRICTED GLOBAL
PASS: nothing
RETURN: nothing
DESTROYED: nothing (flags preserved)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 10/16/91 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysUnlockBIOSFar proc far
call SysUnlockBIOS
ret
SysUnlockBIOSFar endp
public SysUnlockBIOSFar
SysUnlockBIOS proc near
if CHECKSUM_DOS_BLOCKS
;
; Before releasing the BIOS lock, perform checksums of various DOS
; blocks and save them away for SysLockBIOS.
;
call SysComputeDOSBlockChecksums
endif
push bx
mov bx, offset biosLock
jmp SysUnlockCommon
SysUnlockBIOS endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysLockCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Perform common module-lock activities for the various
module locks in the kernel. THIS MUST BE JUMPED TO
CALLED BY: EXTERNAL
PASS: bx = offset in idata of the ThreadLock to lock
previous bx pushed on stack
RETURN: doesn't.
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/ 5/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysLockCommon proc near jmp
on_stack bx retn
push ds
on_stack ds bx retn
LoadVarSeg ds
push ax
on_stack ax ds bx retn
; Crash if someone is trying to call this from the kernel thread,
; after the kernel has been initialized. This catches problems where
; people try to grab semaphores from the Idle loop.
;
; It turns out that ThreadDestroy locks down blocks while on the kernel
; thread, but it already has the heap semaphore, so we don't bother
; checking the heap semaphore here (if we actually block on the heap
; semaphore, it will still die in BlockOnLongQueue).
EC < cmp bx, offset heapSem >
EC < jz notKernel >
EC < tst ds:[currentThread] >
EC < jnz notKernel >
EC < tst ds:[interruptCount] >
EC < jnz notKernel >
EC < tst ds:[initFlag] >
EC < jnz notKernel >
; the stub sometimes calls MemLock pretending to be the kernel. so
; it sets TPD_dataAX to be 0xadeb specifically for this piece of EC
; code, so that it knows that its really the stub and not the kernel
; that is running here. jimmy - 8/94
; This is no longer true. Instead, the swat stub does nothing
; special when it calls MemLock. It just so happens that when the
; stub fakes calling MemLock, its ThreadPrivateData has no exception
; handlers. So, to make things all better (now that the exception
; handlers are in a separate block), simply check to see if the
; TPD_exceptionHandlers ptr is null. If it is NULL, and the
; "currentThread" is 0, we know it is the swat stub. In that case,
; DO NOT fatal error. JimG - 6/4/96
EC < tst ss:[TPD_exceptionHandlers] >
EC < jz notKernel >
; At this point, we know that this is actually the kernel thread. But
; there is a special case for ThreadDestroy where we know that (1) the
; kernel thread has the BIOS lock (in a manner of speaking) and (2) it
; will not block if we call SysLockBIOS. So, if the kernel thread
; tries to grab the BIOS and the kernel already has it (i.e., the
; TL_owner is 0) then don't complain about it.
EC < cmp bx, offset biosLock >
EC < jne notBiosLock >
EC < tst ds:[bx].TL_owner >
EC < jz notKernel >
EC <notBiosLock: >
EC < ERROR BLOCK_IN_KERNEL >
EC <notKernel: >
EC < tst ds:[interruptCount] >
EC < ERROR_NZ NOT_ALLOWED_TO_PSEM_IN_INTERRUPT_CODE >
; XXX: TRASH_AX_BX doesn't really trash BX, since it holds the
; address of the module lock. This is just to save bytes and
; cycles by not pushing and popping BX when the macro can't
; destroy BX anyway, since it has to use it to claim ownership
; of the lock once the semaphore in the lock has been grabbed.
; So much for data-hiding-via-macros... -- ardeb/tony 11/15/90
LockModule ds:[currentThread], ds, [bx], TRASH_AX_BX, \
<ax ds bx retn>
pop ax
cmp bx, offset biosLock
je saveStack
done:
on_stack ds bx retn
pop ds
on_stack bx retn
pop bx
on_stack retn
ret
saveStack:
;
; Save the current stack segment away so ThreadFindStack has a chance
; of finding the right one.
;
mov ds:[biosStack], ss
if CHECKSUM_DOS_BLOCKS
;
; After acquiring the BIOS lock, perform checksums of various DOS
; blocks, and see if they have changed from the last SysUnlockBIOS.
;
call SysCompareDOSBlockChecksums
endif ; CHECKSUM_DOS_BLOCKS
jmp done
SysLockCommon endp
if CHECKSUM_DOS_BLOCKS
dosBlockNames char 7, "COMMAND"
char 0
MAX_DOS_CHECKSUMS equ 10
DOSBlockStruct struct
dbSeg word
dbSize word
dbSum word
DOSBlockStruct ends
udata segment
DOSBlockInit byte ?
numDOSBlocks byte ?
DOSBlocks DOSBlockStruct MAX_DOS_CHECKSUMS dup(<>)
udata ends
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysSetDOSTables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Initialize the DOS block checksum structures. This routine
loops thru the DOS MCB chain, identifying each block in the
system. Blocks of interest include certain subsegments of
system blocks and blocks listed in dosBlockNames. These
currently include:
DOS system subsegments:
System file tables
FCB's
Current Directory Table
Stacks
Blocks identified by name:
COMMAND
Each block's segment and size is stored in the global
DOSBlocks table. This table is used later by
SysCompute... and SysCompareDOSBlockChecksums to monitor
each block independently.
CALLED BY: BootInit
PASS: nothing
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Scan the DOS MCB chain for blocks to check
Store interesting blocks in DOSBlocks
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
dhunter 3/7/2000 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysSetDOSTables proc far
pusha
;
; Get the address of the various DOS system tables and store
; it in the reply. This uses the undocumented DOS function
; 52, which returns in ES:BX a pointer to a table of pointers
; to various system data structures.
;
mov ah, 52h ; Get DOS tables...
int 21h
;
; Point to the start of the checksum table and clear it.
;
mov bp, offset DOSBlocks
clr ds:[numDOSBlocks]
clr ds:[DOSBlockInit]
;
; Iterate the DOS MCBs to find interesting blocks
;
segmov es, es:[bx-2]
next:
mov cx, {word}es:3 ; cx <- size (in paragraphs)
mov ax, {word}es:1 ; ax <- owner
tst ax ; maybe IRQ
je nope
cmp ax, 8 ; system - yes
je doSystem
cmp ax, 7 ; excluded - no
je nope
cmp ax, 6 ; umb - no
je nope
cmp ax, 0fffdh ; 386MAX - no
jae nope
;
; It's something real, check the name.
;
push ax, cx, ds, es
dec ax
mov es, ax ; es:0 <- owner's MCB
segmov ds, cs, ax
mov si, offset dosBlockNames
nextName:
mov cl, {byte}ds:[si]
tst cl
stc
jz endName
inc si
clr ch
mov di, 8
repe cmpsb
clc
jne goNextName ; mismatch in given bytes
cmp di, 16 ; compared all 8 chars?
je endName
tst {byte}es:[di] ; if not, is null term there?
je endName
goNextName:
add si, cx
jmp nextName
endName:
pop ax, cx, ds, es
jc nope
if 0 ; This turned out not to be such a great idea.
; jnc doit
;
; Check if it's our (loader's) block, and if so, add the PSP to the
; list (only the first 110h bytes (MCB + PSP))
;
mov ax, es
inc ax
cmp ax, ds:[loaderVars].KLV_pspSegment
jne nope
mov cx, (110h shr 4)
; fall-thru to doit...
endif
;
; We like this one, add it to the list.
;
doit::
segmov ds:[bp].dbSeg, es, ax
mov ds:[bp].dbSize, cx
inc ds:[numDOSBlocks]
add bp, size DOSBlockStruct
;
; Advance to next block.
;
nope:
mov al, {byte}es:0
mov cx, {word}es:3 ; cx <- size (in paragraphs)
mov dx, es
add dx, cx
inc dx
mov es, dx ; es <- next block
cmp al, 04dh ; was block control?
je next
cmp {byte}es:0, 04dh ; is next block control?
LONG je next
popa
ret
;
; Check the subsegments of the system block (if it has any).
;
doSystem:
cmp {word}es:8, 04353h ; Is this video memory?
je nope
mov di, 16 ; di <= byte offset of current sub
mov dx, 1 ; dx <= paragraph offset of current sub
nextSub:
cmp dx, cx ; stop when we exceed main block size
ja doneSystem
mov al, {byte}es:[di]
mov bx, {word}es:[di+3] ; bx <= paragraphs in sub
cmp al, 'F' ; System file tables
je doSub
cmp al, 'X' ; FCB's
je doSub
cmp al, 'L' ; Current Directory Table
je doSub
; cmp al, 'S' ; Stacks
; je doSub
jmp nopeSub
;
; We like this subsegment, add it to the list.
;
doSub:
mov ax, es ; compute zero-based segment
add ax, dx
mov ds:[bp].dbSeg, ax
mov ds:[bp].dbSize, bx
inc ds:[numDOSBlocks]
add bp, size DOSBlockStruct
;
; Move to next subsegment.
;
nopeSub:
inc bx
add dx, bx ; update current paragraph offset
shl bx
shl bx
shl bx
shl bx ; bx <- byte length of sub
add di, bx ; update current byte offset
jmp nextSub
;
; We're currently pointing to the next block, so update es
; and return to the main loop.
;
doneSystem:
mov ax, es ; compute zero-based segment
add ax, dx
mov es, ax
jmp next
SysSetDOSTables endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysComputeDOSBlockChecksums
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Loop thru DOSBlocks, compute the checksums for each block,
and store the results for future comparison.
CALLED BY: SysUnlockBIOS
PASS: nothing
RETURN: nothing
DESTROYED: nothing (flags preserved)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
dhunter 3/7/2000 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysComputeDOSBlockChecksums proc near
uses ax, bx, cx, si, di, ds, es
.enter
pushf
LoadVarSeg ds
;
; Only compute if biosLock is about to be completely unlocked.
;
cmp ds:[biosLock].TL_nesting, 1
jne done
;
; Iterate the DOSBlocks table, checksumming (is that a real word?)
; each block and storing the result.
;
clr ch
mov cl, ds:[numDOSBlocks]
tst cl
jz done
mov si, offset DOSBlocks
next:
xchg bx, cx
segmov es, ds:[si].dbSeg, ax
mov cx, ds:[si].dbSize
call SysComputeDBChecksum
mov ds:[si].dbSum, ax
add si, size DOSBlockStruct
xchg bx, cx
loop next
done:
popf
.leave
ret
SysComputeDOSBlockChecksums endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCompareDOSBlockChecksums
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Loop thru DOSBlocks, compute the checksums for each block,
and compare them to the previously stored results. If a
block has changed, EC will throw a FatalError, and NC will
display a SysNotify box.
CALLED BY: SysLockCommon
PASS: nothing
RETURN: nothing
DESTROYED: nothing (flags preserved)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
dhunter 3/7/2000 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysCompareDOSBlockChecksums proc near
uses ax, bx, cx, si, di, ds, es
.enter
pushf
LoadVarSeg ds
;
; Only compare if biosLock was locked for the first time.
;
cmp ds:[biosLock].TL_nesting, 1
jne done
;
; If this is the first call, do nothing. The checksums are not
; initialized, and the FS skeleton driver has been making direct
; int 21h calls up until now. Allow the followup SysUnlockBIOS
; to initialize the checksums and then all will be happy.
;
tst ds:[DOSBlockInit]
jz notYet
;
; Iterate the DOSBlocks table, checksumming (is that a real word?)
; each block and comparing the result with the previous results.
;
clr ch
mov cl, ds:[numDOSBlocks]
tst cl
jz done
mov si, offset DOSBlocks
next:
xchg bx, cx
segmov es, ds:[si].dbSeg, ax
mov cx, ds:[si].dbSize
call SysComputeDBChecksum
cmp ds:[si].dbSum, ax
jne mismatch
add si, size DOSBlockStruct
xchg bx, cx
loop next
done:
popf
.leave
ret
notYet:
inc ds:[DOSBlockInit]
jmp done
;
; Raiase a SysNotify error message.
;
mismatch:
EC < ERROR_NE DOS_BLOCK_CHECKSUM_CHANGED >
call SysDBCFailure
; allow shutdown to occur unchallenged
clr ds:[numDOSBlocks]
jmp done
SysCompareDOSBlockChecksums endp
SysComputeDBChecksum proc near
; es:0 = start of block
; cx = length (in paragraphs) of block
push dx
mov dx, es
clr ax
next:
add ax, {word}es:00h ; sum this paragraph
add ax, {word}es:02h
add ax, {word}es:04h
add ax, {word}es:06h
add ax, {word}es:08h
add ax, {word}es:0ah
add ax, {word}es:0ch
add ax, {word}es:0eh
inc dx ; go to the next one
mov es, dx ; ack! Segment arithmetic!
loop next
pop dx
ret
SysComputeDBChecksum endp
SysDBCFailure proc near
; ds:si = DOSBlockStruct that changed
; ax = new checksum
newSum local word push ax ; save new checksum
uses ds
.enter
mov al, KS_DOS_BLOCK_CHECKSUM_BAD
call AddStringAtMessageBuffer
inc di ;put second string after first
push di
mov al, 'B' ; write "B"
stosb
mov ax, ds:[si].dbSeg ; write segment
call Hex16ToAscii
mov ax, ('S' shl 8) or C_SPACE ; write " S"
stosw
mov ax, ds:[si].dbSize ; write size
call Hex16ToAscii
mov ax, ('O' shl 8) or C_SPACE ; write " O"
stosw
mov ax, ds:[si].dbSum ; write old sum
call Hex16ToAscii
mov ax, ('N' shl 8) or C_SPACE ; write " N"
stosw
mov ax, ss:newSum ; write new sum
call Hex16ToAscii
clr al ; write null term
stosb
segmov ds, es ; both strings are in dgroup...
pop di ; ds:di <- second string
mov si, offset messageBuffer ; ds:si <- first string
mov ax, mask SNF_EXIT
call SysNotify
.leave
ret
SysDBCFailure endp
nibbles db "0123456789ABCDEF"
Hex16ToAscii proc near
push ax
xchg ah, al
push ax
mov bx, offset nibbles
shr al, 1
shr al, 1
shr al, 1
shr al, 1
and al, 0fh
xlatb cs:
stosb
pop ax
and al, 0fh
xlatb cs:
stosb
pop ax
push ax
mov bx, offset nibbles
shr al, 1
shr al, 1
shr al, 1
shr al, 1
and al, 0fh
xlatb cs:
stosb
pop ax
and al, 0fh
xlatb cs:
stosb
ret
Hex16ToAscii endp
endif ; CHECKSUM_DOS_BLOCKS
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysUnlockCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Perform common module-unlock activities for the various
module locks in the kernel. THIS MUST BE JUMPED TO
CALLED BY: Unlock*
PASS: bx = offset in idata of the ThreadLock to unlock
previous bx pushed on stack
RETURN: doesn't.
DESTROYED: nothing, not even flags
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/ 5/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysUnlockCommon proc near jmp
on_stack bx retn
pushf
on_stack cc bx retn
push ds
on_stack ds cc bx retn
LoadVarSeg ds
push ax
on_stack ax ds cc bx retn
UnlockModule ds:[currentThread], ds, [bx], TRASH_AX_BX, \
<ax ds cc bx retn>
pop ax
on_stack ds cc bx retn
pop ds
on_stack cc bx retn
popf
on_stack bx retn
pop bx
on_stack retn
ret
SysUnlockCommon endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysPSemCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Perform common PSem activities for the various
semaphores in the kernel. THIS MUST BE JUMPED TO
CALLED BY: PSem*
PASS: bx = offset in idata of the Semaphore to P
previous bx pushed on stack
RETURN: doesn't.
DESTROYED: nothing (carry flag preserved)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/ 5/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysPSemCommon proc near jmp
on_stack bx retn
push ds
on_stack ds bx retn
LoadVarSeg ds
EC < tst ds:[interruptCount] >
EC < ERROR_NZ NOT_ALLOWED_TO_PSEM_IN_INTERRUPT_CODE >
push ax
on_stack ax ds bx retn
PSem ds, [bx], TRASH_AX_BX, NO_EC
pop ax
on_stack ds bx retn
pop ds
on_stack bx retn
pop bx
on_stack retn
ret
SysPSemCommon endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysVSemCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Perform common VSem activities for the various
semaphores in kernel. THIS MUST BE JUMPED TO
CALLED BY: VSem*
PASS: bx = offset in idata of the Semaphore to V
previous bx pushed on stack
RETURN: doesn't.
DESTROYED: nothing, not even flags
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/ 5/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysVSemCommon proc near jmp
on_stack bx retn
pushf
on_stack cc bx retn
push ds
on_stack ds cc bx retn
LoadVarSeg ds
on_stack ax ds cc bx retn
push ax
VSem ds, [bx], TRASH_AX_BX, NO_EC
pop ax
on_stack ds cc bx retn
pop ds
on_stack cc bx retn
popf
on_stack bx retn
pop bx
on_stack retn
ret
SysVSemCommon endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysJmpVector
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Jump through a vector w/o destroying registers
CALLED BY: Thread{Exception}Handlers
PASS: ds:bx = vector
on stack:
sp -> ds
ax
bx
ret
RETURN: doesn't
DESTROYED: ax, bx and ds restored to their values from entry to the
interrupt.
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/ 8/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SPOIStack struct
SPOIS_bp word
SPOIS_ax word
SPOIS_bx word
SPOIS_retAddr fptr.far
SPOIS_flags word
SPOIStack ends
SysJmpVector proc far jmp
on_stack ds ax bx retf
;
; Fetch the old vector into ax and bx
;
mov ax, ds:[bx].offset
mov bx, ds:[bx].segment
pop ds
on_stack ax bx retf
;
; Now replace the saved ax and bx with the old vector, so we can
; just perform a far return to get to the old handler.
;
push bp
on_stack bp ax bx retf
mov bp, sp
xchg ax, ss:[bp].SPOIS_ax
xchg bx, ss:[bp].SPOIS_bx
pop bp
on_stack retf
ret
SysJmpVector endp
COMMENT @----------------------------------------------------------------------
FUNCTION: SysGetECLevel
DESCRIPTION: Return value of sysECLevel
CALLED BY: GLOBAL
PASS:
Nothing
RETURN:
ax - ErrorCheckingFlags
bx - error checking block (valid if ECF_BLOCK_CHECKSUM)
DESTROYED:
Nothing
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
Get exclusive on default video driver
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Doug 5/89 Initial version
------------------------------------------------------------------------------@
SysGetECLevel proc far
if ERROR_CHECK
push ds
LoadVarSeg ds
mov ax, ds:[sysECLevel] ; fetch the error checking level
mov bx, ds:[sysECBlock]
pop ds
else
clr ax
clr bx
endif
ret
SysGetECLevel endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysSetECLevel
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the current error-check level
CALLED BY: GLOBAL
PASS: AX = ErrorCheckingFlags
BX = error checking block (if any)
RETURN: Nothing
DESTROYED: Nothing
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/17/89 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysSetECLevel proc far
if ERROR_CHECK
push ds
LoadVarSeg ds
mov ds:[sysECLevel], ax
mov ds:[sysECBlock], bx
mov ds:[sysECChecksum], 0 ;invalid -- recalculate
pop ds
endif
ret
SysSetECLevel endp
Filemisc segment
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysGetDosEnvironment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Looks up an environment variable in the environment buffer.
CALLED BY: GLOBAL
PASS: ds:si - variable name to look up (null terminated)
es:di - dest buffer to store data (null terminated string)
cx - max # bytes to store in buffer including null
RETURN: carry set if environment variable not found
DESTROYED: none
PSEUDO CODE/STRATEGY:
Data in Environment Block consists of null terminated strings
of the form: <variable name>=<variable data>. The end of the
block comes when a null byte is found in place of the variable
name.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 8/13/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
CopyStackCodeXIP segment resource
SysGetDosEnvironment proc far
mov ss:[TPD_dataBX], handle SysGetDosEnvironmentReal
mov ss:[TPD_dataAX], offset SysGetDosEnvironmentReal
GOTO SysCallMovableXIPWithDSSI
SysGetDosEnvironment endp
CopyStackCodeXIP ends
else
SysGetDosEnvironment proc far
FALL_THRU SysGetDosEnvironmentReal
SysGetDosEnvironment endp
endif
SysGetDosEnvironmentReal proc far uses ax, bx, ds, si, cx, di
.enter
EC < call FarCheckDS_ES >
push es, di, cx
if FULL_EXECUTE_IN_PLACE
EC < push bx, si >
EC < movdw bxsi, esdi >
EC < call ECAssertValidFarPointerXIP >
EC < pop bx, si >
endif
; GET LENGTH OF PASSED VARIABLE NAME
segmov es, ds, di ;ES:DI <- ptr to variable string
mov di, si
mov cx, -1
clr ax
repne scasb
not cx ;CX <- # bytes (sans null term)
dec cx ;If passed nullstring, return not found
jcxz notFound ;
segmov es, dgroup, di
mov es, es:[loaderVars].KLV_pspSegment
mov es, es:[PSP_envBlk] ;es:di <- env block
clr di
mov ax, di
; SEARCH THROUGH THE ENVIRONMENT BLOCK
varSearchTop:
; ES:DI <- PTR TO ENVIRONMENT BLOCK ENTRY
; DS:SI <- PTR TO VARIABLE NAME TO MATCH
; CX <- # BYTES IN SOURCE STRING (NOT COUNTING NULL)
cmp {byte} es:[di], 0 ;At end of env block?
jz notFound ;Branch if so
push cx, si ;
repe cmpsb ;Compare source and dest strings
pop si ;
jnz noMatch ;Branch if they didn't match
cmp {byte} es:[di], '=' ;If they matched, make sure next byte
jz match ; is '=' -- branch if so
noMatch:
;AX is always 0 here
mov cx, -1
repne scasb ;ES:DI <- ptr beyond null terminator
pop cx
jmp varSearchTop
match:
inc sp
inc sp ;discard saved CX
inc di ;ES:DI <- ptr to variable data
segmov ds, es, si ;DS:SI <- ptr to variable data
mov si, di
mov cx, -1
repne scasb
not cx ;CX <- # bytes + null terminator
pop es, di, bx ;BX <- max # bytes to copy
;ES:DI <- dest buffer
cmp cx, bx ;
jle 80$ ;
mov cx, bx ;
80$:
rep movsb ;
mov {byte} es:[di][-1], 0 ;Null terminate the string
clc
jmp exit
notFound:
pop es, di, cx
stc
exit:
.leave
ret
SysGetDosEnvironmentReal endp
Filemisc ends
CopyStackCodeXIP segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCopyToStackDSBX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copy passed parameter to stack
CALLED BY: GLOBAL
PASS: ds:bx -> fptr to block to copy
cx -> size of buffer to copy
(0 if null terminated string (DBCS or SBCS))
RETURN: ds:bx <- fptr to block on stack
DESTROYED: nothing
SIDE EFFECTS:
Modifies TPD_stackBot to reserve space on stack
PSEUDO CODE/STRATEGY:
Fiddle with pointers, then call SysCopyToStack
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysCopyToStackDSBXFar proc far
if FULL_EXECUTE_IN_PLACE
call SysCopyToStackDSBX
endif
ret
SysCopyToStackDSBXFar endp
if FULL_EXECUTE_IN_PLACE
SysCopyToStackDSBX proc near
xchg si, bx
call SysCopyToStack
xchg bx, si
ret
SysCopyToStackDSBX endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCopyToStackDSDX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copy passed parameter to stack
CALLED BY: GLOBAL
PASS: ds:dx -> fptr to block to copy
cx -> size of buffer to copy
(0 if null terminated string (DBCS or SBCS))
RETURN: ds:dx <- fptr to block on stack
DESTROYED: nothing
SIDE EFFECTS:
Modifies TPD_stackBot to reserve space on stack
PSEUDO CODE/STRATEGY:
Fiddle with pointers, then call SysCopyToStack
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/23/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysCopyToStackDSDXFar proc far
if FULL_EXECUTE_IN_PLACE
call SysCopyToStackDSDX
endif
ret
SysCopyToStackDSDXFar endp
if FULL_EXECUTE_IN_PLACE
SysCopyToStackDSDX proc near
xchg si, dx
call SysCopyToStack
xchg dx, si
ret
SysCopyToStackDSDX endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCopyToStackBXSI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copy passed parameter to stack
CALLED BY: GLOBAL
PASS: bx:si -> fptr to block to copy
cx -> size of buffer to copy
(0 if null temrinated string (DBCS or SBCS))
RETURN: bx:si <- fptr to block on stack
DESTROYED: nothing
SIDE EFFECTS:
Modified TPD_stackBot to reserve space on stack
PSEUDO CODE/STRATEGY:
Fiddle with pointers, then call SysCopyToStack
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/21/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysCopyToStackBXSIFar proc far
if FULL_EXECUTE_IN_PLACE
call SysCopyToStackBXSI
endif
ret
SysCopyToStackBXSIFar endp
if FULL_EXECUTE_IN_PLACE
SysCopyToStackBXSI proc near
segxchg bx, ds
call SysCopyToStack
segxchg ds, bx
ret
SysCopyToStackBXSI endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCopyToStackESDI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copy passed parameter to stack
CALLED BY: GLOBAL
PASS: es:di -> fptr to block to copy
cx -> size of buffer to copy
(0 if null termined string (DBCS or SBCS))
RETURN: es:di <- fptr to block on stack
DESTROYED: nothing
SIDE EFFECTS:
Allocates space on bottom of stack (below TPD_stackBot)
PSEUDO CODE/STRATEGY:
Swap the pointers around so we can call SysCopyToStack
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/19/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysCopyToStackESDIFar proc far
if FULL_EXECUTE_IN_PLACE
call SysCopyToStackESDI
endif
ret
SysCopyToStackESDIFar endp
if FULL_EXECUTE_IN_PLACE
SysCopyToStackESDI proc near
xchg si, di ; ds:si <- buffer
segxchg ds, es
call SysCopyToStack ; ds:si <- new buffer on stack
segxchg es, ds ; es:di <- new buffer
xchg di, si
ret
SysCopyToStackESDI endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCopyToStack, SysCopyToStackDSSI, SysCopyToStackDSSIFar
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Move a passed in parameter block to the stack
CALLED BY: SysCopyToStack*
PASS: ds:si -> block to copy
cx -> size (or zero if null terminated)
RETURN: ds:si <- buffer on stack
DESTROYED: nothing
SIDE EFFECTS:
Modifies TPD_stackBot. This reduces the amount of stack
space temporarily available to the thread, but it has the
same affect as allocating the space on the stack, and this
method doesn't mess up the call stack.
It all gets returned to the thread in the end...
PSEUDO CODE/STRATEGY:
As opposed to mucking about with the stack (my idea), Andrew
suggested we just copy the needed data to the TPD_stackBot,
and adjust TPD_stackBot so that we don't worry about it being
written over.
This is inspired, and he should be given a large golden
plack indicating what a computer stud he is.
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/ 4/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
EC_VALUE equ 042294
SysCopyToStackStruct struct
SCTSS_oldBottom word
;The old bottom of the stack
SCTSS_siDifference word
;The difference between the old value of SI and new value. We can
; convert between pointers into the copied buffer and the original
; buffer by adding this difference to the pointer.
SCTSS_restoreRegsRout nptr.near
;The routine to call to restore registers when
; SysRemoveFromStackPreserveRegs is called
EC < SCTSS_ecValue word >
;An EC value we store/check to make sure the stack isn't
; mangled.
SysCopyToStackStruct ends
SysCopyToStackDSSIFar proc far
if FULL_EXECUTE_IN_PLACE
call SysCopyToStack
endif
ret
SysCopyToStackDSSIFar endp
if FULL_EXECUTE_IN_PLACE
SysCopyToStackDSSI label near
SysCopyToStack proc near
uses ax, bp
.enter
pushf
;
; First things first. See if the value needs to be copied
; to the stack at all (if it's not in an XIP resource,
; we don't need to worry about it.)
push ds
mov ax, ds ; ax <- current segment
LoadVarSeg ds
sub ax, ds:[loaderVars].KLV_mapPageAddr
pop ds
jc noCopy ; => Below XIP segment
cmp ax, (MAPPING_PAGE_SIZE/16)
jb copy ; => In XIP segment
noCopy:
;
; No need to copy it, but we still need to leave the
; stack in a state that SysReturnStack will understand.
mov bp, ss:[TPD_stackBot] ; bp <- current bottom
add ss:[TPD_stackBot], size SysCopyToStackStruct
; Make space for structure
mov ss:[bp].SCTSS_oldBottom, bp ; Store old stackBot value
clr ss:[bp].SCTSS_siDifference
EC < clr ss:[bp].SCTSS_restoreRegsRout >
EC < mov ss:[bp].SCTSS_ecValue, EC_VALUE >
; Store sentinel to check for stack
; mangling
done:
popf
;
; With that done, let's return...
.leave
ret
copy:
push cx, di, es ; save trashed registers
;
; Now, with the case of null terminated strings, we
; won't know the length until we scan the string. Sigh.
; See if we need to scan the list, or if we were passed
; in the string length
jcxz getLength ; => look for null
reserveSpaceOnStack:
;
; With the correct length available (for whatever reason),
; we now reserve space at the base of the stack and
; move the data over.
mov ax, ss:[TPD_stackBot] ; ax <- original stack bottom
;
; To reserve space, we adjust the stack bottom so
; we have room to copy the buffer, the previous stack
; bottom, and possibly an EC value as well.
segmov es, ss, di ; es:di <- new buffer
mov di, ax
mov bp, ax ; bp <- current stack bottom
add bp, cx ; reserve space at base of stack
add bp, size SysCopyToStackStruct
;
; Now that we know what we want to change the stackBot
; to, let's make sure we don't overwrite the existing
; stack, shall we?
EC < cmp bp, sp >
EC < ERROR_AE STACK_OVERFLOW >
mov ss:[TPD_stackBot], bp ; mark new bottom of stack
mov ss:[bp - size SysCopyToStackStruct].SCTSS_oldBottom, ax
mov ss:[bp - size SysCopyToStackStruct].SCTSS_siDifference, si
sub ss:[bp - size SysCopyToStackStruct].SCTSS_siDifference, ax
; store original stack bottom
EC < mov ss:[bp - size SysCopyToStackStruct].SCTSS_restoreRegsRout,0 >
EC < mov ss:[bp - size SysCopyToStackStruct].SCTSS_ecValue, EC_VALUE>
; mark with special value
EC < call ECCheckStack >
;
; Now that that has been taken care of, copy the buffer
; to the stack, storing the start of the buffer for later.
shr cx, 1 ; convert from byte to words...
rep movsw ; move all the words...
jnc cleanUp ; => even byte length
movsb ; and the byte...
cleanUp:
mov_tr si, ax ; ds:si <- buffer
segmov ds, ss, ax
pop cx, di, es ; restore trashed registers
jmp done
getLength:
;
; Get the length of the passed in null-terminated string
; worrying about DBCS...
segmov es, ds, ax ; es:di <- length
mov di, si
LocalStrSize <includeNull> ; cx <- length
; ax, di destroyed
jmp reserveSpaceOnStack
SysCopyToStack endp
endif
ForceRef SysCopyToStack
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysRemoveFromStack
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Restore Stack space used to hold parameters
CALLED BY: INTERNAL
PASS: ss:sp -> as returned by SysCopyToStack
RETURN: ss:sp -> as before call to SysCopyToStack
DESTROYED: nothing
SIDE EFFECTS:
None
PSEUDO CODE/STRATEGY:
Get value at top of bottom of stack and
assign it as new bottom of stack.
For EC, make sure our value is there as well...
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/11/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysRemoveFromStackFar proc far
if FULL_EXECUTE_IN_PLACE
call SysRemoveFromStack
endif
ret
SysRemoveFromStackFar endp
if FULL_EXECUTE_IN_PLACE
SysRemoveFromStack proc near
uses bp
.enter
mov bp, ss:[TPD_stackBot]
EC < pushf >
EC < cmp ss:[bp-size SysCopyToStackStruct].SCTSS_ecValue, EC_VALUE>
EC < ERROR_NE SYS_COPY_TO_STACK_ERROR_BOTTOM_OF_STACK_MANGLED >
EC < popf >
mov bp, ss:[bp-size SysCopyToStackStruct].SCTSS_oldBottom
;bp <- old stackBot
EC < pushf >
EC < cmp bp, ss:[TPD_stackBot] >
EC < ERROR_AE SYS_COPY_TO_STACK_ERROR_BOTTOM_OF_STACK_MANGLED >
EC < popf >
mov ss:[TPD_stackBot], bp
EC< call ECCheckStack >
.leave
ret
SysRemoveFromStack endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCopyToStackPreserve*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calls SysCopyToStack, but stores a routine to call to restore
the registers afterwards.
CALLED BY: GLOBAL
PASS: nada
RETURN: registers munged
DESTROYED: nada (flags preserved)
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 5/13/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
SysCopyToStackPreserveDSDX proc near
mov ss:[TPD_callTemporary], offset SysRemoveFromStackPreserveDX
xchg dx, si
call SysCopyToStackPreserveCommon
xchg dx, si
ret
SysCopyToStackPreserveDSDX endp
if 0
SysCopyToStackPreserveDSBX proc near
mov ss:[TPD_callTemporary], offset SysRemoveFromStackPreserveBX
xchg bx, si
call SysCopyToStackPreserveCommon
xchg bx, si
ret
SysCopyToStackPreserveDSBX endp
endif
SysCopyToStackPreserveESDI proc near
xchg si, di
segxchg ds, es
mov ss:[TPD_callTemporary], offset SysRemoveFromStackPreserveDI
call SysCopyToStackPreserveCommon
segxchg ds, es
xchg si, di
ret
SysCopyToStackPreserveESDI endp
SysCopyToStackPreserveDSDI proc near
mov ss:[TPD_callTemporary], offset SysRemoveFromStackPreserveDI
xchg si, di
call SysCopyToStackPreserveCommon
xchg si, di
ret
SysCopyToStackPreserveDSDI endp
SysCopyToStackPreserveDXSI proc near
mov ss:[TPD_callTemporary], offset SysRemoveFromStackPreserveSI
xchg bx, dx
call SysCopyToStackPreserveCommon
xchg bx, dx
ret
SysCopyToStackPreserveDXSI endp
SysCopyToStackPreserveDSSI proc near
mov ss:[TPD_callTemporary], offset SysRemoveFromStackPreserveSI
FALL_THRU SysCopyToStackPreserveCommon
SysCopyToStackPreserveDSSI endp
SysCopyToStackPreserveCommon proc near uses bp, ax
.enter
call SysCopyToStackDSSI
mov bp, ss:[TPD_stackBot]
mov ax, ss:[TPD_callTemporary]
mov ss:[bp - size SysCopyToStackStruct].SCTSS_restoreRegsRout, ax
.leave
ret
SysCopyToStackPreserveCommon endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysRemoveFromStackPreserveRegs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Calls the appropriate routine to remove the data from the
stack and preserve register values (we have to go through
these shenanigans because we copy data to the stack, and
call routines, that return pointers into that data, so we
need to modify those pointers to return to the correct place.
CALLED BY: GLOBAL
PASS: various
RETURN: regs updated
DESTROYED: nada
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 5/13/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
SysRemoveFromStackPreserveRegs proc near uses bp
.enter
mov bp, ss:[TPD_stackBot]
EC < pushf >
EC < cmp ss:[bp-size SysCopyToStackStruct].SCTSS_ecValue, EC_VALUE>
EC < ERROR_NE SYS_COPY_TO_STACK_ERROR_BOTTOM_OF_STACK_MANGLED >
EC < cmp ss:[bp - size SysCopyToStackStruct].SCTSS_restoreRegsRout,0 >
EC < ERROR_Z SYS_COPY_TO_STACK_ERROR_NO_RESTORE_REGS_ROUTINE >
EC < popf >
call ss:[bp - size SysCopyToStackStruct].SCTSS_restoreRegsRout
.leave
ret
SysRemoveFromStackPreserveRegs endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysRemoveFromStackPreserve*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Restores registers after a call to a routine that may have
changed them, and updates the stack
CALLED BY: GLOBAL
PASS: various regs
RETURN: regs updated
DESTROYED: nada
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 5/13/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
SysRemoveFromStackPreserveDI proc near
xchg si, di
call SysRemoveFromStackPreserveSI
xchg si, di
ret
SysRemoveFromStackPreserveDI endp
SysRemoveFromStackPreserveDX proc near
xchg si, dx
call SysRemoveFromStackPreserveSI
xchg si, dx
ret
SysRemoveFromStackPreserveDX endp
if 0
SysRemoveFromStackPreserveBX proc near
xchg si, bx
call SysRemoveFromStackPreserveSI
xchg si, bx
ret
SysRemoveFromStackPreserveBX endp
endif
SysRemoveFromStackPreserveSI proc near uses bp
.enter
pushf
mov bp, ss:[TPD_stackBot]
add si, ss:[bp - size SysCopyToStackStruct].SCTSS_siDifference
popf
call SysRemoveFromStack
.leave
ret
SysRemoveFromStackPreserveSI endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCopyToBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Allocate a block and copy data into it.
CALLED BY: INTERNAL
PASS: ds:si = address of data to copy
cx = size of data
RETURN: carry set if insufficient memory, else
ds:si = address to copy of data
bx = handle of locked data block
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
NOTE: Caller is responsible for freeing block.
REVISION HISTORY:
Name Date Description
---- ---- -----------
jwu 4/19/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SysCopyToBlockFar proc far
if FULL_EXECUTE_IN_PLACE
call SysCopyToBlock
endif
ret
SysCopyToBlockFar endp
if FULL_EXECUTE_IN_PLACE
SysCopyToBlock proc near
uses ax,cx,di
.enter
;
; Allocate a locked block for the data.
;
push cx ; save size for copy
mov_tr ax, cx ; ax = size of data
mov cx, ALLOC_FIXED
call MemAllocFar ; ^hbx = block
; ax = address of block
pop cx ; cx = size of data
jc exit ; no more memory...
;
; Copy the data to the block.
;
mov es, ax
clr di ; es:di = dest of copy
shr cx, 1 ; convert byte to words
rep movsw
jnc done ; even byte length
movsb ; and the byte...
done:
segmov ds, es, si
clr si ; ds:si = copied data
clc ; all is well
exit:
.leave
ret
SysCopyToBlock endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCallMovableXIPWithDSSIAndESDI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call a movable routine passing DS:SI and ES:DI on stack
CALLED BY: INTERNAL
PASS: ds:dx -> 1st buffer to pass
es:di -> 2nd buffer to pass
TPD_dataBX:TPD_dataAX -> handle:offset of routine to call
RETURN: As per routine
DESTROYED: si, di, ds, es unchanged
others as per routine
SIDE EFFECTS:
Copies blocks to stack
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/26/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
SysCallMovableXIPWithDSSIAndESDI proc far uses ds, es
.enter
; On full-XIP systems, we need to copy the data to the stack, but
; also return a pointer into that data, so calculate the amount
; the pointer changes, and return the original pointer, modified by
; the passed amount.
push cx
clr cx
call SysCopyToStackPreserveDSSI
pop cx
mov ss:[TPD_callTemporary], offset SysCopyToStackPreserveESDI
call SysCallMovableXIP
call SysRemoveFromStackPreserveRegs
.leave
ret
SysCallMovableXIPWithDSSIAndESDI endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCallMovableXIPWithDSDXAndESDI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copies ds:dx and es:di to the stack before calling a movable
routine
CALLED BY: various
PASS: ds:dx, es:di - null terminated strings
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 5/10/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
SysCallMovableXIPWithDSDXAndESDI proc far
uses ds, es
.enter
push cx
clr cx
call SysCopyToStackPreserveDSDX
pop cx
mov ss:[TPD_callTemporary], offset SysCopyToStackPreserveESDI
call SysCallMovableXIP
call SysRemoveFromStackPreserveRegs
.leave
ret
SysCallMovableXIPWithDSDXAndESDI endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCallMovableXIPWithDSDX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call a movable routine with ds:dx pointing to valid parameter
CALLED BY: INTERNAL
PASS: ds:dx -> Parameters to copy to stack (null terminated)
TPD_dataBX:TPD_dataAX -> handle:offset to routine to call
after copying to stack
Others as per Routine
RETURN: As per routine
DESTROYED: dx, ds unchanged
others as per routine
SIDE EFFECTS:
Copies block to stack
PSEUDO CODE/STRATEGY:
Copy the parameter block to the stack
Call the specified routine
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/26/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
SysCallMovableXIPWithDSDX proc far
uses ds
.enter
mov ss:[TPD_callTemporary], offset SysCopyToStackPreserveDSDX
call SysCallMovableXIP
.leave
ret
SysCallMovableXIPWithDSDX endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCallMovableXIPWithDSBX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call a movable routine with ds:bx pointing to valid parameter
CALLED BY: INTERNAL
PASS: ds:bx -> Parameters to copy to stack (null terminated)
TPD_dataBX:TPD_dataAX -> handle:offset to routine to call
after copying to stack
Others as per Routine
RETURN: As per routine
DESTROYED: bx, ds unchanged
others as per routine
SIDE EFFECTS:
Copies block to stack
PSEUDO CODE/STRATEGY:
Copy the parameter block to the stack
Call the specified routine
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/26/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if 0
if FULL_EXECUTE_IN_PLACE
SysCallMovableXIPWithDSBX proc far
uses ds
.enter
mov ss:[TPD_callTemporary], offset SysCopyToStackPreserveDSBX
call SysCallMovableXIP
.leave
ret
SysCallMovableXIPWithDSBX endp
endif
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCallMovableXIPWithESDI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call a movable routine with es:di pointing to valid parameter
CALLED BY: INTERNAL
PASS: es:di -> Parameters to copy to stack (null terminated)
TPD_dataBX:TPD_dataAX -> handle:offset to routine to call
after copying to stack
Others as per Routine
RETURN: As per routine
DESTROYED: di, es unchanged
others as per routine
SIDE EFFECTS:
Copies block to stack
PSEUDO CODE/STRATEGY:
Copy the parameter block to the stack
Call the specified routine
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/26/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
SysCallMovableXIPWithESDI proc far
uses es
.enter
mov ss:[TPD_callTemporary], offset SysCopyToStackPreserveESDI
call SysCallMovableXIP
.leave
ret
SysCallMovableXIPWithESDI endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCallMovableXIPWithDSSI
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call a movable routine with ds:si pointing to valid parameter
CALLED BY: INTERNAL
PASS: ds:si -> Parameters to copy to stack (null terminated)
TPD_dataBX:TPD_dataAX -> handle:offset to routine to call
after copying to stack
Others as per Routine
RETURN: As per routine
DESTROYED: si, ds unchanged
others as per routine
SIDE EFFECTS:
Copies block to stack
PSEUDO CODE/STRATEGY:
Copy the parameter block to the stack
Call the specified routine
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/26/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
SysCallMovableXIPWithDSSI proc far
uses ds
.enter
mov ss:[TPD_callTemporary], offset SysCopyToStackPreserveDSSI
call SysCallMovableXIP
.leave
ret
SysCallMovableXIPWithDSSI endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCallMovableXIP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call a passed routine, saving the specified parameter
block on the stack if needed
CALLED BY: INTERNAL
PASS: ss:[TPD_callTemporary] -> near SysCopyTo* to call
fptr of routine call after copy stored in:
ss:[TPD_dataBX]:ss:[dataAX]
( that is dataBX is handle, dataAX is offset)
RETURN: as per routine
DESTROYED: as per SysCopyTo* routine
SIDE EFFECTS:
Copies and frees block on the stack
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
TS 4/26/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
SysCallMovableXIP proc near
.enter
;
; Copy parameter to stack (assume null terminated)
push cx
clr cx
call ss:[TPD_callTemporary]
pop cx
;
; Call routine passing correct values in AX & BX
xchg ss:[TPD_dataBX], bx ; bx <- handle
xchg ss:[TPD_dataAX], ax ; ax <- offset
call ProcCallModuleRoutine
;
; Remove parameter from stack
call SysRemoveFromStackPreserveRegs
.leave
ret
SysCallMovableXIP endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCallMovableXIPWithDSDIBlock /*DSSIBlock /*DXSIBlock...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call a movable routine with ds:di/ds:si/dx:si pointing to
a valid parameter.
CALLED BY: INTERNAL
PASS: ds:di/ds:si/dx:si -> Parameters to copy to stack
TPD_dataBX:TPD_dataAX -> handle:offset to routine to call
after copying to stack
TPD_callVector.segment -> size of data to copy to stack
RETURN: As per routine
DESTROYED: ds, di unchanged (or ds, si or dx, si, depending on routine)
others as per routine
SIDE EFFECTS:
Copies block to stack
PSEUDO CODE/STRATEGY:
Copy the parameter block to the stack
Call the specified routine
REVISION HISTORY:
Name Date Description
---- ---- -----------
jwu 5/11/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
SysCallMovableXIPWithDSDIBlock proc far
uses ds
.enter
mov ss:[TPD_callTemporary], offset SysCopyToStackPreserveDSDI
call SysCallMovableXIPBlock
.leave
ret
SysCallMovableXIPWithDSDIBlock endp
SysCallMovableXIPWithDSSIBlock proc far
uses ds
.enter
mov ss:[TPD_callTemporary], offset SysCopyToStackPreserveDSSI
call SysCallMovableXIPBlock
.leave
ret
SysCallMovableXIPWithDSSIBlock endp
SysCallMovableXIPWithDXSIBlock proc far
uses dx
.enter
mov ss:[TPD_callTemporary], offset SysCopyToStackPreserveDXSI
call SysCallMovableXIPBlock
.leave
ret
SysCallMovableXIPWithDXSIBlock endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCallMovableXIPWithDSSIAndESDIBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call a movable routine with ds:si and es:di pointing to
a valid parameter.
CALLED BY: INTERNAL
PASS: es:di -> Parameter to copy to stack
ds:si -> Parameter to copy to stack
TPD_dataBX:TPD_dataAX -> handle:offset to routine to call
after copying to stack
TPD_callVector.segment -> size of data to copy to stack
( Data in es:di and ds:si MUST be same size!)
RETURN: As per routine
DESTROYED: ds, di unchanged
others as per routine
SIDE EFFECTS:
Copies block to stack
PSEUDO CODE/STRATEGY:
Copy the parameter block to the stack
Call the specified routine
Copy ESDI data to stack first so we don't have
to write a SysCallMovableXIPWithESDIBlock.
REVISION HISTORY:
Name Date Description
---- ---- -----------
jwu 5/11/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
SysCallMovableXIPWithDSSIAndESDIBlock proc far
uses ds, es
.enter
push cx
mov cx, ss:[TPD_callVector].segment ; cx = size
call SysCopyToStackPreserveESDI
pop cx
mov ss:[TPD_callTemporary], offset SysCopyToStackPreserveDSSI
call SysCallMovableXIPBlock
call SysRemoveFromStackPreserveRegs
.leave
ret
SysCallMovableXIPWithDSSIAndESDIBlock endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SysCallMovableXIPBlock
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Call a passed routine, saving the specified parameter
block on the stack if needed
CALLED BY: INTERNAL
PASS: ss:[TPD_callTemporary] -> near SysCopyTo* to call
ss:[TPD_callVector].segment -> size of data to be copied
fptr of routine to call after copy stored in:
ss:[TPD_dataBX]:ss:[dataAX]
( that is dataBX is handle, dataAX is offset)
RETURN: as per routine
DESTROYED: as per SysCopyTo* routine
SIDE EFFECTS:
Copies and frees block on the stack.
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
jwu 5/11/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if FULL_EXECUTE_IN_PLACE
SysCallMovableXIPBlock proc near
;
; Copy paramter to stack.
;
push cx
mov cx, ss:[TPD_callVector].segment ; cx = size
call ss:[TPD_callTemporary]
pop cx
;
; Call routine passing correct values in AX & BX
;
xchg ss:[TPD_dataBX], bx ; bx <- handle
xchg ss:[TPD_dataAX], ax ; ax <- offset
call ProcCallModuleRoutine
;
; Remove parameter from stack
;
call SysRemoveFromStackPreserveRegs
ret
SysCallMovableXIPBlock endp
endif
CopyStackCodeXIP ends
| 24.628072
| 81
| 0.599009
|
5092787af240d20b2d3db631d203d784740d8fa5
| 231
|
asm
|
Assembly
|
programs/oeis/010/A010708.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/010/A010708.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/010/A010708.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A010708: Period 2: repeat (3,10).
; 3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10,3,10
mod $0,2
mul $0,7
add $0,3
| 33
| 166
| 0.593074
|
80228d606791f90c2b48795a3a8a84dc1295d465
| 1,954
|
asm
|
Assembly
|
src/game.asm
|
gltchitm/tic-tac-toe-asm
|
84d2112397218f770e9c573744504078afbdbf8f
|
[
"MIT"
] | null | null | null |
src/game.asm
|
gltchitm/tic-tac-toe-asm
|
84d2112397218f770e9c573744504078afbdbf8f
|
[
"MIT"
] | null | null | null |
src/game.asm
|
gltchitm/tic-tac-toe-asm
|
84d2112397218f770e9c573744504078afbdbf8f
|
[
"MIT"
] | null | null | null |
%macro move_handler 1
.handle_%1_move:
cmp rax, 49
je .spot_0_%1
cmp rax, 50
je .spot_1_%1
cmp rax, 51
je .spot_2_%1
cmp rax, 52
je .spot_3_%1
cmp rax, 53
je .spot_4_%1
cmp rax, 54
je .spot_5_%1
cmp rax, 55
je .spot_6_%1
cmp rax, 56
je .spot_7_%1
cmp rax, 57
je .spot_8_%1
jmp print_gameboard
%endmacro
%macro spot 2
.spot_%1_%2:
mov rdx, r10
and rdx, mask_x_%1
cmp rdx, mask_x_%1
je print_gameboard
mov rdx, r10
and rdx, mask_o_%1
cmp rdx, mask_o_%1
je print_gameboard
xor r10, mask_%2_%1
jmp .swap_turn
%endmacro
start_game:
mov r10, ( \
mask_empty_0 | \
mask_empty_1 | \
mask_empty_2 | \
mask_empty_3 | \
mask_empty_4 | \
mask_empty_5 | \
mask_empty_6 | \
mask_empty_7 | \
mask_empty_8 | \
mask_turn_x \
)
call print_gameboard
ret
get_next_move:
mov rdx, r10
and rdx, mask_turn_x
cmp rdx, mask_turn_x
je .print_turn_x
jmp .print_turn_o
.print_turn_x:
mov rdi, player_x_turn
mov rsi, player_x_turn_len
call print
jmp .print_prompt
.print_turn_o:
mov rdi, player_o_turn
mov rsi, player_o_turn_len
call print
jmp .print_prompt
.print_prompt:
mov rdi, prompt
mov rsi, prompt_len
call print
jmp get_user_input_spot
handle_move:
mov rdx, r10
and rdx, mask_turn_x
cmp rdx, mask_turn_x
je .handle_x_move
jmp .handle_o_move
move_handler x
move_handler o
spot 0, x
spot 1, x
spot 2, x
spot 3, x
spot 4, x
spot 5, x
spot 6, x
spot 7, x
spot 8, x
spot 0, o
spot 1, o
spot 2, o
spot 3, o
spot 4, o
spot 5, o
spot 6, o
spot 7, o
spot 8, o
.swap_turn:
xor r10, mask_turn_x
xor r10, mask_turn_o
jmp print_gameboard
| 16.559322
| 30
| 0.577277
|
0d0c2d4b18280b3aedc7bd6c512d25817e26b95f
| 5,887
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1881.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_1881.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_1881.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 %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x786f, %rsi
lea addresses_A_ht+0xd3ff, %rdi
xor $47843, %r14
mov $11, %rcx
rep movsb
nop
mfence
lea addresses_UC_ht+0x706f, %r14
nop
sub $49989, %r9
vmovups (%r14), %ymm5
vextracti128 $1, %ymm5, %xmm5
vpextrq $1, %xmm5, %rcx
nop
nop
nop
nop
nop
cmp $50933, %r9
lea addresses_WT_ht+0xdef, %rbx
nop
add $18571, %rcx
mov $0x6162636465666768, %rdi
movq %rdi, (%rbx)
sub $37566, %rdi
lea addresses_WC_ht+0xd58f, %r14
nop
and $45272, %r11
movw $0x6162, (%r14)
nop
nop
nop
nop
cmp %rbx, %rbx
lea addresses_WC_ht+0x1986f, %r14
nop
nop
nop
xor $51243, %rdi
mov $0x6162636465666768, %r9
movq %r9, %xmm1
vmovups %ymm1, (%r14)
nop
nop
nop
add %rsi, %rsi
lea addresses_A_ht+0x15423, %rsi
lea addresses_UC_ht+0x1486f, %rdi
xor $35572, %r8
mov $53, %rcx
rep movsl
nop
sub $64383, %r8
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r8
push %rax
push %rbp
push %rbx
push %rcx
// Load
lea addresses_WT+0x1e06f, %r8
nop
mfence
mov (%r8), %rbp
nop
nop
xor %r8, %r8
// Store
lea addresses_A+0x1186f, %rbp
nop
nop
sub $14384, %r14
movw $0x5152, (%rbp)
nop
nop
nop
cmp $16962, %rcx
// Faulty Load
lea addresses_WT+0x1286f, %r8
nop
nop
nop
and %rbx, %rbx
mov (%r8), %ecx
lea oracles, %rbp
and $0xff, %rcx
shlq $12, %rcx
mov (%rbp,%rcx,1), %rcx
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r8
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WT', 'size': 8, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_A', 'size': 2, 'AVXalign': False}}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_WT', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}}
{'src': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_UC_ht', 'size': 32, 'AVXalign': False}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'same': True, 'congruent': 7, 'NT': False, 'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 11, 'NT': False, 'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 42.05
| 2,999
| 0.65772
|
55dcd9732126fa19ee7e63c23e66f1412e09e9aa
| 50,756
|
asm
|
Assembly
|
Microsoft Word for Windows Version 1.1a/Word 1.1a CHM Distribution/Opus/asm/layout22.asm
|
lborgav/Historical-Source-Codes
|
c0aeaae1d482718e3b469d9eb7a6d0002faa1ff5
|
[
"MIT"
] | 7
|
2017-01-12T17:48:48.000Z
|
2021-11-28T04:37:34.000Z
|
Microsoft Word for Windows Version 1.1a/Word 1.1a CHM Distribution/Opus/asm/layout22.asm
|
lborgav/Historical-Source-Codes
|
c0aeaae1d482718e3b469d9eb7a6d0002faa1ff5
|
[
"MIT"
] | null | null | null |
Microsoft Word for Windows Version 1.1a/Word 1.1a CHM Distribution/Opus/asm/layout22.asm
|
lborgav/Historical-Source-Codes
|
c0aeaae1d482718e3b469d9eb7a6d0002faa1ff5
|
[
"MIT"
] | 5
|
2017-03-28T08:04:30.000Z
|
2020-03-25T14:25:29.000Z
|
include w2.inc
include noxport.inc
include consts.inc
include structs.inc
createSeg _LAYOUT2,layout2,byte,public,CODE
; DEBUGGING DECLARATIONS
ifdef DEBUG
midLayout22 equ 21 ; module ID, for native asserts
NatPause equ 1
endif
ifdef NatPause
PAUSE MACRO
int 3
ENDM
else
PAUSE MACRO
ENDM
endif
; EXTERNAL FUNCTIONS
externFP <GetPlc>
externFP <AbortLayout>
externFP <CpFromCpCl>
externFP <N_FInTableDocCp>
externFP <CpMacDocEdit>
externFP <IInPlcCheck>
externFP <CpFirstTap>
externFP <DxlFromTable>
externFP <FTableHeight>
externFP <FSavePhe>
externFP <IInPlc>
externFP <FGetValidPhe>
externFP <LbcFormatChain>
externFP <N_FAbortLayout>
externFP <N_ClFormatLines>
externNP <LN_CacheParaLbs>
externNP <LN_CacheSectL>
externNP <LN_XaFromXl>
externNP <LN_YlFromYa>
externNP <LN_NMultDivCzaInch>
externNP <LN_PdodDocL>
externNP <LN_LrpInPlCur>
externNP <LN_IInPlc>
externNP <LN_CpMacDocPlbs>
externNP <LN_CpPlc>
ifdef DEBUG
externFP <AssertProcForNative>
externFP <ScribbleProc>
externFP <S_FAbortLayout>
externFP <S_ClFormatLines>
externFP <S_FInTableDocCp>
externFP <ShowLbsProc>
endif ;DEBUG
sBegin data
; EXTERNALS
externW vfls
externW vfli
externW caParaL
externW vfti
externW caSect
externW vlm
externW vpapFetch
externW vsepFetch
externW caTap
externW vdocTemp
externW vylTopPage
externW vcBalance
ifdef DEBUG
externW vdbs
externW vfInFormatPage
endif ;DEBUG
sEnd data
; CODE SEGMENT _LAYOUT2
sBegin layout2
assumes cs,layout2
assumes ds,dgroup
assumes ss,dgroup
;-------------------------------------------------------------------------
; LbcFormatPara(plbs, dylFill, clLim)
;-------------------------------------------------------------------------
;/* L b c F o r m a t P a r a */
;NATIVE int LbcFormatPara(plbs, dylFill, clLim)
;struct LBS *plbs;
;int dylFill, clLim;
;{
;/* adds rectangle starting at lbs and ending before dylFill is exhausted and
; clLim is reached; advances lbs; returns lbc:
; lbcEndOfSect
; lbcEndOfColumn
; lbcEndOfPage
; lbcEndOfDoc
; lbcYlLim
; lbcNil means para fits
; saves the height information obtained in the process. advances lbs
;*/
; YLL dyllCur, dyllAdvance;
; YLL dyllRemain;
; int dylLine, dylBefore, dylT, dylMax;
; int dcl = -1, dxlT;
; int fParaStart, fEndBreak = fFalse, fChain = fFalse;
; int cl, clT, lbc;
; int fLnn, fTableRow = fFalse;
; int fNoYlLimit = (dylFill == ylLarge);
; int dylAbove, dylBelow, dylOverlapNew = plbs->dylOverlap;
; int doc = plbs->doc;
; struct PAD pad;
; struct PAD **hplcpad;
; struct DOD **hdod;
; int fShort;
; struct PHE phe;
; CP cpFirst, cpLim, cpMac, cpMacDoc;
; struct LNH lnh, lnhT;
; LRP lrp;
; struct LR lr;
;#ifdef DEBUG
; CP cpStart = plbs->cp;
; int clStart = plbs->cl;
;#endif /* DEBUG */
maskFChainLocal = 1
maskFTableRowLocal = 2
maskFParaStartLocal = 4
; %%Function:N_LbcFormatPara %%Owner:BRADV
cProc N_LbcFormatPara,<PUBLIC,FAR>,<si,di>
ParmW plbs
ParmW dylFill
ParmW clLim
LocalW dcl
LocalW fEndBreak ;high byte contains fChain, fTableRow
LocalW lbc
LocalW fShort
LocalW fLnn
LocalW fNoYlLimit
LocalW clVar
LocalW dylText
LocalW dylBefore
LocalW dylAbove
LocalW dylBelow
LocalW dylOverlapNew
LocalD dyllRemain
LocalD cpLim
LocalD dyllCur
LocalD dyllAdvance
LocalD cpMacDocVar
LocalV phe, cbPheMin
LocalV pad, cbPadMin
LocalV lnh, cbLnhMin
LocalV lnhT, cbLnhMin
LocalV lr, cbLrMin
LocalV rgw, cbPAPBaseScan
ifdef DEBUG
LocalD cpStart
LocalW clStart
endif ;DEBUG
cBegin
xor ax,ax
mov [fEndBreak],ax ;also clears fChain, fTableRow
dec ax
mov [dcl],ax
cmp [dylFill],ylLarge
je LFP00
inc ax
LFP00:
mov [fNoYlLimit],ax
mov si,[plbs]
mov ax,[si.dylOverlapLbs]
mov [dylOverlapNew],ax
ifdef DEBUG
push [si.LO_cpLbs]
pop [OFF_cpStart]
push [si.HI_cpLbs]
pop [SEG_cpStart]
push [si.clLbs]
pop [clStart]
endif ;DEBUG
; StartProfile();
; Assert(vfInFormatPage);
ifdef DEBUG
cmp [vfInFormatPage],fFalse
jne LFP01
push ax
push bx
push cx
push dx
mov ax,midLayout22
mov bx,1028
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
LFP01:
endif ;/* DEBUG */
; CacheParaL(doc, plbs->cp, plbs->fOutline);
;LN_CacheParaLbs takes plbs in si
;and performs CacheParaL(plbs->doc, plbs->cp, plbs->fOutline).
;ax, bx, cx, dx are altered.
call LN_CacheParaLbs
; cpLim = caParaL.cpLim;
mov ax,[caParaL.LO_cpLimCa]
mov [OFF_cpLim],ax
mov ax,[caParaL.HI_cpLimCa]
mov [SEG_cpLim],ax
; cpMacDoc = CpMacDocPlbs(plbs);
;LN_CpMacDocPlbs performs CpMacDocPlbs(si).
;ax, bx, cx, dx are altered.
call LN_CpMacDocPlbs
mov [OFF_cpMacDocVar],ax
mov [SEG_cpMacDocVar],dx
; bltLrp(LrpInPl(plbs->hpllr, plbs->ilrCur), &lr, sizeof(struct LR));
;LFP82 performs
;bltLrp(LrpInPl(plbs->hpllr, plbs->ilrCur), &lr, sizeof(struct LR));
;ax, bx, cx, dx, di are altered.
call LFP82
; if (lr.lrk == lrkAbsHit)
; {
cmp [lr.lrkLr],lrkAbsHit
jne LFP03
; if (dylFill != ylLarge)
; dylFill = lr.yl + lr.dyl - plbs->ylColumn;
cmp [dylFill],ylLarge
je LFP02
mov ax,[lr.ylLr]
add ax,[lr.dylLr]
sub ax,[si.ylColumnLbs]
mov [dylFill],ax
LFP02:
; if (plbs->cl != 0)
; {
cmp [si.clLbs],0
je LFP03
; /* for absolute-affected rectangles, we need raw
; cps since we can't save rectangle */
; plbs->cp = CpFromCpCl(plbs, fTrue);
; plbs->cl = 0;
mov ax,fTrue
cCall CpFromCpCl,<si, ax>
;LFP76 performs:
;plbs->cl = bx = 0;
;plbs->cp = dx:ax;
;plbs is assumed to be in si.
;bx is altered.
call LFP76
; }
; }
LFP03:
; if (FAbortLayout(plbs->fOutline, plbs))
; {
; AbortLayout();
; }
mov al,[si.fOutlineLbs]
cbw
push ax
push si
ifdef DEBUG
cCall S_FAbortLayout,<>
else ;!DEBUG
push cs
call near ptr N_FAbortLayout
endif ;!DEBUG
or ax,ax
je LFP06
cCall AbortLayout,<>
LFP06:
; vfls.fFirstPara = plbs->fFirstPara;
mov al,[si.fFirstParaLbs]
mov [vfls.fFirstParaFls],al
; fTableRow = FInTableVPapFetch(plbs->doc, plbs->cp);
; if (plbs->fOutline)
; caParaL.doc = docNil; /* props got refreshed */
; CacheParaL(doc, plbs->cp, plbs->fOutline);
;#define FInTableVPapFetch(doc, cp) (vpapFetch.fInTable && FInTableDocCp(doc, cp))
mov al,[vpapFetch.fInTablePap]
or al,al
je LFP065
push [si.docLbs]
push [si.HI_cpLbs]
push [si.LO_cpLbs]
ifdef DEBUG
cCall S_FInTableDocCp,<>
else ;not DEBUG
cCall N_FInTableDocCp,<>
endif ;DEBUG
push ax ;save result of FInTableDocCp
errnz <fFalse>
xor ax,ax
cmp [si.fOutlineLbs],al
je LFP063
errnz <hNil>
mov [caParaL.docCa],ax
LFP063:
;LN_CacheParaLbs takes plbs in si
;and performs CacheParaL(plbs->doc, plbs->cp, plbs->fOutline).
;ax, bx, cx, dx are altered.
call LN_CacheParaLbs
pop cx ;restore result of FInTableDocCp
jcxz LFP065
or bptr ([fEndBreak+1]),maskFTableRowLocal
LFP065:
; hdod = mpdochdod[doc];
; fShort = (*hdod)->fShort;
mov bx,[si.docLbs]
call LN_PdodDocL
mov al,[bx.fShortDod]
mov bptr ([fShort]),al
;/* in outline mode, ignore paragraphs not being shown */
; if (plbs->fOutline && !fShort && (hplcpad = (*hdod)->hplcpad) != hNil)
; {
cmp [si.fOutlineLbs],fFalse
je LFP08
or al,al
jne LFP08
mov cx,[bx.hplcpadDod]
errnz <hNil>
jcxz LFP08
; GetPlc(hplcpad, IInPlc(hplcpad, plbs->cp), &pad);
push cx ;argument for GetPlc
cCall IInPlc,<cx, [si.HI_cpLbs], [si.LO_cpLbs]>
push ax
lea bx,[pad]
push bx
cCall GetPlc,<>
; if (!pad.fShow)
; {
test [pad.fShowPad],maskFShowPad
jne LFP08
; /* collapsed text */
; plbs->cl = 0;
; lbc = ((plbs->cp = cpLim) >= cpMacDoc) ? lbcEndOfDoc : lbcNil;
;LFP74 performs:
;plbs->cl = bx = 0;
;dx:ax = plbs->cp = cpLim;
;plbs is assumed to be in si.
;ax, bx, dx are altered.
call LFP74
cmp ax,[OFF_cpMacDocVar]
mov cx,dx
sbb cx,[SEG_cpMacDocVar]
errnz <lbcNil>
jl LFP07
errnz <(lbcEndOfDoc XOR lbcNil) AND 0FF00h>
mov bl,lbcEndOfDoc
LFP07:
mov bptr ([lbc]),bl
; vfls.ca.doc = docNil;
; vfls.ca.cpLim = cpLim;
mov [vfls.caFls.LO_cpLimCa],ax
mov [vfls.caFls.HI_cpLimCa],dx
errnz <docNil>
xor ax,ax
mov [vfls.caFls.docCa],ax
; goto LAdjustDyl;
; }
jmp LAdjustDyl
; }
LFP08:
;/* chained across absolute object */
;/* some of the test for lnn was done by FAssignLr */
; fLnn = lr.lnn != lnnNil && IfWinElse(fTrue, !vpapFetch.fSideBySide) &&
; FLnnPap(vpapFetch) && !fTableRow;
;#define FLnnPap(pap) (!pap.fNoLnn)
errnz <fFalse>
xor di,di
cmp [lr.lnnLr],lnnNil
je LFP09
mov al,[vpapFetch.fNoLnnPap]
or al,al
jne LFP09
test bptr ([fEndBreak+1]),maskFTableRowLocal
jne LFP09
errnz <fTrue - fFalse - 1>
inc di
LFP09:
mov [fLnn],di
; if (plbs->ilrFirstChain != ilrNil)
; {
cmp [si.ilrFirstChainLbs],ilrNil
je LFP10
; fChain = fTrue;
or bptr ([fEndBreak+1]),maskFChainLocal
; lbc = LbcFormatChain(plbs, cpLim, dylFill, clLim, fLnn);
cCall LbcFormatChain,<si, [SEG_cpLim], [OFF_cpLim], [dylFill], [clLim], di>
mov bptr ([lbc]),al
; dylOverlapNew = plbs->dylOverlap;
mov ax,[si.dylOverlapLbs]
mov [dylOverlapNew],ax
; goto LSetLbc;
jmp LSetLbc
; }
LFP10:
; cl = plbs->cl;
; lbc = lbcNil;
; CacheSectL(caParaL.doc, caParaL.cpFirst, plbs->fOutline);
mov bptr ([lbc]),lbcNil
mov bx,[caParaL.docCa]
mov ax,[caParaL.LO_cpFirstCa]
mov dx,[caParaL.HI_cpFirstCa]
mov cl,[si.fOutlineLbs]
xor ch,ch
;LN_CacheSectL takes doc in bx, cp in dx:ax, fOutline in cx
;ax, bx, cx, dx are altered.
call LN_CacheSectL
mov ax,[si.clLbs]
mov [clVar],ax
; fParaStart = (cl == 0 && plbs->cp == caParaL.cpFirst);
; dylBefore = fParaStart ? YlFromYa(vpapFetch.dyaBefore) : 0;
ifdef DEBUG
test bptr ([fEndBreak+1]),maskFParaStartLocal
je LFP11
push ax
push bx
push cx
push dx
mov ax,midLayout22
mov bx,1029
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
LFP11:
endif ;/* DEBUG */
or ax,ax
jne LFP12
;LFP77 performs plbs->cp == caParaL.cpFirst.
;plbs is assumed in si. Only ax is altered.
call LFP77
jne LFP12
or bptr ([fEndBreak+1]),maskFParaStartLocal
;LN_YlFromYa performs YlFromYa(ax); ax, bx, cx, dx are altered.
mov ax,[vpapFetch.dyaBeforePap]
call LN_YlFromYa
db 03dh ;turns next "xor ax,ax" into "cmp ax,immediate"
LFP12:
xor ax,ax
mov [dylBefore],ax
; dylOverlapNew = 0;
xor ax,ax
mov [dylOverlapNew],ax
;/* ignore heights in some cases */
; if (plbs->fOutline || lr.lrk == lrkAbsHit || plbs->doc == vdocTemp ||
; fTableRow)
; SetWords(&phe, 0, cwPHE);
errnz <fFalse>
cmp [si.fOutlineLbs],al
jne LFP13
cmp [lr.lrkLr],lrkAbsHit
je LFP13
mov ax,[vdocTemp]
cmp ax,[si.docLbs]
je LFP13
test bptr ([fEndBreak+1]),maskFTableRowLocal
je LFP14
LFP13:
push ds
pop es
xor ax,ax
lea di,[phe]
errnz <cbPheMin - 6>
stosw
stosw
stosw
jmp short LHavePhe
Ltemp013:
jmp LEmptyPara
LFP14:
;/* if we don't know the para's height, calculate it now and save the height in
; hplcphe so we (hopefully) don't have to do this again */
; else if (!FGetValidPhe(doc, plbs->cp, &phe) ||
lea ax,[phe]
cCall FGetValidPhe,<[si.docLbs], [si.HI_cpLbs], [si.LO_cpLbs], ax>
or ax,ax
je LFP15
; phe.dxaCol != XaFromXl(lr.dxl))
; {
;LN_XaFromXl performs XaFromXl(ax); ax, bx, cx, dx are altered.
mov ax,[lr.dxlLr]
call LN_XaFromXl
cmp ax,[phe.dxaColPhe]
je LHavePhe
LFP15:
; if (plbs->cp != caParaL.cpFirst)
; {
; SetWords(&phe, 0, cwPHE);
; goto LHavePhe;
; }
;LFP77 performs plbs->cp == caParaL.cpFirst.
;plbs is assumed in si. Only ax is altered.
call LFP77
jne LFP13
; /* limit the number of lines: 255 is the largest clMac that will fit
; in phe and represents 53" of 15-pt lines */
; clT = ClFormatLines(plbs, cpLim, ylLarge, ylLarge, 255, lr.dxl, fFalse, lr.lrk != lrkAbs);
push si
push [SEG_cpLim]
push [OFF_cpLim]
mov ax,ylLarge
push ax
push ax
errnz <ylLarge - 03FFFh>
mov ah,0
push ax
push [lr.dxlLr]
errnz <fFalse>
xor ax,ax
push ax
mov al,[lr.lrkLr]
sub al,lrkAbs
push ax
ifdef DEBUG
cCall S_ClFormatLines,<>
else ;!DEBUG
push cs
call near ptr N_ClFormatLines
endif ;!DEBUG
; if (vfls.fPageBreak || (clT != 0 && vfls.clMac == clNil))
; SetWords(&phe, 0, cwPHE);
; else if (clT == 0)
; goto LEmptyPara;
cmp [vfls.fPageBreakFls],fFalse
jne LFP13
or ax,ax
je Ltemp013
cmp [vfls.clMacFls],clNil
je LFP13
; else if (vfls.fVolatile)
; /* para has vanished chars but we know its height */
; /* FUTURE chrism: remember vanished state (dsb) */
; phe = vfls.phe;
cmp [vfls.fVolatileFls],fFalse
jne LFP16
; else
; {
; /* para is not interrupted, has no vanished chars */
; if (!FSavePhe(&vfls.phe))
; {
mov ax,dataoffset [vfls.pheFls]
cCall FSavePhe,<ax>
or ax,ax
jne LFP16
; AbortLayout();
; }
cCall AbortLayout,<>
LFP16:
; phe = vfls.phe;
; }
;LFP80 performs phe = vfls.phe. No registers are altered.
call LFP80
; }
;/* here we have a phe; it may or may not be of use */
;LHavePhe:
;/* first para for LR */
; if (lr.cp == cpNil)
; {
LHavePhe:
errnz <LO_cpNil - 0FFFFh>
errnz <HI_cpNil - 0FFFFh>
mov ax,[lr.LO_cpLr]
and ax,[lr.HI_cpLr]
inc ax
jne LFP18
; Assert(lr.lrk != lrkAbs);
ifdef DEBUG
cmp [lr.lrkLr],lrkAbs
jne LFP17
push ax
push bx
push cx
push dx
mov ax,midLayout22
mov bx,1030
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
LFP17:
endif ;/* DEBUG */
; lr.cp = plbs->cp;
mov ax,[si.LO_cpLbs]
mov [lr.LO_cpLr],ax
mov ax,[si.HI_cpLbs]
mov [lr.HI_cpLr],ax
; lr.clFirst = plbs->cl;
mov ax,[si.clLbs]
mov [lr.clFirstLr],ax
; lr.lrs = lrsNormal;
mov [lr.lrsLr],lrsNormal
;/* ignore space before at top of page, and here's the rule:
; not table or side by side, never at top of section, only in 1-column
; sections, not page break before, and top not affected by apo */
; if (lr.yl == vylTopPage && dylBefore != 0 && fParaStart &&
; !fTableRow && !lr.fConstrainTop &&
; !vpapFetch.fPageBreakBefore && Mac(!vpapFetch.fSideBySide &&)
; vsepFetch.ccolM1 == 0 && lr.cp != caSect.cpFirst)
; {
mov ax,[vylTopPage]
cmp [lr.ylLr],ax
jne LFP175
mov cx,[dylBefore]
jcxz LFP175
mov al,bptr ([fEndBreak+1]) ;Local flags
mov ah,[lr.fConstrainTopLr]
and ax,maskFParaStartLocal+maskFTableRowLocal+(maskFConstrainTopLr SHL 8)
cmp ax,maskFParaStartLocal
jne LFP175
mov ax,[vsepFetch.ccolM1Sep]
or al,ah
jne LFP175
errnz <fFalse>
cmp [vpapFetch.fPageBreakBeforePap],al
jne LFP175
mov ax,[caSect.LO_cpFirstCa]
sub ax,[lr.LO_cpLr]
jne LFP173
mov ax,[caSect.HI_cpFirstCa]
sub ax,[lr.HI_cpLr]
je LFP175
LFP173:
; lr.yl -= dylBefore;
sub [lr.ylLr],cx
; lr.fSpaceBefore = fTrue;
or [lr.fSpaceBeforeLr],maskFSpaceBeforeLr
; }
LFP175:
; plbs->yl = lr.yl; /* update to current position */
mov ax,[lr.ylLr]
mov [si.ylLbs],ax
; }
LFP18:
; InvalFli(); /* clear fli cache */
;#define InvalFli() vfli.ww = wwNil
mov [vfli.wwFli],wwNil
; dyllRemain = fNoYlLimit ? yllLarge :
; (YLL)dylFill - plbs->yl + plbs->ylColumn; /* space left */
mov ax,0FFFFh
mov dx,07FFFh
test [fNoYlLimit],ax
jnz LFP19
mov ax,[dylFill]
sub ax,[si.ylLbs]
add ax,[si.ylColumnLbs]
cwd
LFP19:
mov [OFF_dyllRemain],ax
mov [SEG_dyllRemain],dx
;/* table */
; if (fTableRow)
; {
test bptr ([fEndBreak+1]),maskFTableRowLocal
jne Ltemp014
jmp LFP24
Ltemp015:
jmp LFP264
Ltemp014:
; Assert(plbs->cl == 0);
ifdef DEBUG
;Do this assert with a call so as not to mess up short jumps
call LFP95
endif ;/* DEBUG */
; if (lr.lrk == lrkAbsHit)
; {
cmp [lr.lrkLr],lrkAbsHit
jne LFP195
; dxlT = DxlFromTable(plbs->ww, doc, plbs->cp);
push [si.wwLbs]
push [si.docLbs]
push [si.HI_cpLbs]
push [si.LO_cpLbs]
cCall DxlFromTable,<>
; if (dxlT > lr.dxl && clLim == clMax &&
; (lr.fConstrainLeft || lr.fConstrainRight))
; {
; lbc = lbcYlLim;
; goto LNoChange;
; }
cmp ax,[lr.dxlLr]
jle LFP195
cmp [clLim],clMax
jne LFP195
errnz <(fConstrainLeftLr) - (fConstrainRightLr)>
test [lr.fConstrainLeftLr],maskfConstrainLeftLr + maskfConstrainRightLr
jne Ltemp015
; }
LFP195:
; if (!FTableHeight(plbs->ww, doc, plbs->cp, vlm == lmBRepag/*fAbortOK*/,
; !plbs->fPrevTable, fTrue, &dylText, &dylAbove, &dylBelow))
; AbortLayout();
; dyllAdvance = dyllCur = dylText + dylAbove + dylBelow;
push [si.wwLbs]
push [si.docLbs]
push [si.HI_cpLbs]
push [si.LO_cpLbs]
mov ax,fTrue ; we'll use this a couple of times...
mov cx,ax
cmp [vlm],lmBRepag
jz LFP197
errnz <fTrue - 1>
dec cx
LFP197:
push cx ; fAbort
;Assembler note: dcl is set to one below in the C source
errnz <fTrue - 1>
mov [dcl],ax
cwd
errnz <fTrue - 1>
cmp [si.fPrevTableLbs],al
adc dx,dx
push dx
push ax
lea ax,[dylText]
push ax
lea ax,[dylAbove]
push ax
lea ax,[dylBelow]
push ax
cCall FTableHeight,<>
; dyllCur = dylText + dylAbove + dylBelow;
mov ax,[dylText]
add ax,[dylAbove]
add ax,[dylBelow]
cwd
mov [OFF_dyllCur],ax
mov [SEG_dyllCur],dx
; dyllAdvance = dyllCur;
; dcl = 1;
; if (plbs->fPrevTable)
; {
; if (plbs->cp == lr.cp)
; /* 1st thing in lr is table following table */
; lr.yl -= plbs->dylBelowTable;
; dyllAdvance -= plbs->dylBelowTable;
; }
; else if (plbs->cp == lr.cp)
; lr.fForceFirstRow = fTrue;
;Assembler note: dcl is set to one above in the assembler version
mov bx,[lr.LO_cpLr]
mov cx,[lr.HI_cpLr]
sub bx,[si.LO_cpLbs]
sbb cx,[si.HI_cpLbs]
or cx,bx ; cx = fNeqCps
mov bx,[si.dylBelowTableLbs]
cmp [si.fPrevTableLbs],fFalse
jnz LFP20
xor bx,bx ; make subtractions below virtual nop's
or cx,cx
jnz LFP21 ; nothing to do
or [lr.fForceFirstRowLr],maskfForceFirstRowLr
LFP20:
sub ax,bx
sbb dx,0
jcxz LFP205
xor bx,bx ; nop next subtraction
LFP205:
sub [lr.ylLr],bx
LFP21:
mov [OFF_dyllAdvance],ax
mov [SEG_dyllAdvance],dx
; if (lr.tSoftBottom == tPos)
; dyllRemain = plbs->ylMaxLr - plbs->yl;
;LFPa2 compares lr.tSoftBottom with tPos.
;only flags are altered.
call LFPa2
jne LFP22
mov bx,[si.ylMaxLrLbs]
sub bx,[si.ylLbs]
sbb cx,cx ;sign extend to long
mov [OFF_dyllRemain],bx
mov [SEG_dyllRemain],cx
LFP22:
; if (dyllAdvance > dyllRemain)
; {
xchg ax,bx
mov cx,dx
cmp [OFF_dyllRemain],bx
mov ax,[SEG_dyllRemain]
sbb ax,cx
jge LFP23
; lbc = lbcYlLim;
mov bptr ([lbc]),lbcYlLim
; if (vylTopPage + dyllAdvance < plbs->ylMaxColumn)
; {
mov ax,[vylTopPage]
cwd
add bx,ax
adc cx,dx
; Assert (plbs->ylMaxColumn >= 0); so we can sign extend with 0
ifdef DEBUG
;Do this assert with a call so as not to mess up short jumps
call LFP97
endif ;/* DEBUG */
sub bx,[si.ylMaxColumnLbs]
sbb cx,0
jge LFP23
; Assert(dylFill != ylLarge); /* are we lying? */
ifdef DEBUG
;Do this assert with a call so as not to mess up short jumps
call LFP93
endif ;/* DEBUG */
; if (lr.lrk != lrkNormal || plbs->yl != vylTopPage)
; goto LNoChange;
; }
; }
cmp [lr.lrkLr],lrkNormal
jne Ltemp002
cmp ax,[si.ylLbs]
jne Ltemp002
LFP23:
; CpFirstTap(doc, plbs->cp);
cCall CpFirstTap,<[si.docLbs], [si.HI_cpLbs], [si.LO_cpLbs]>
; plbs->cp = caTap.cpLim;
mov ax,[caTap.LO_cpLimCa]
mov [si.LO_cpLbs],ax
mov ax,[caTap.HI_cpLimCa]
mov [si.HI_cpLbs],ax
; fLnn = fFalse;
; plbs->dylBelowTable = dylBelow;
mov [fLnn],fFalse
mov ax,[dylBelow]
mov [si.dylBelowTableLbs],ax
; }
jmp LHaveDylCur
Ltemp016:
jmp LFormatPara
Ltemp017:
jmp LFP38
Ltemp002:
jmp LNoChange
; else
LFP24:
;/* all equal lines. this is the common, important, fast case */
; if (!phe.fDiffLines)
; {
test [phe.fDiffLinesPhe],maskFDiffLinesPhe
jne Ltemp017
; dylLine = YlFromYa(phe.dyaLine);
;LN_YlFromYa performs YlFromYa(ax); ax, bx, cx, dx are altered.
mov ax,[phe.dyaLinePhe]
call LN_YlFromYa
xchg ax,di
; if (dylLine == 0 || plbs->cp != caParaL.cpFirst)
; goto LFormatPara; /* invalid phe */
or di,di
je Ltemp016
;LFP77 performs plbs->cp == caParaL.cpFirst.
;plbs is assumed in si. Only ax is altered.
call LFP77
jne Ltemp016
; ClFormatLines(plbs, cp0, 0, 0, 0, lr.dxl, fFalse, fFalse);
; vfls.phe = phe;
;LFP79 performs:
;ClFormatLines(plbs, cp0, 0, 0, 0, lr.dxl, fFalse, fFalse);
;vfls.phe = phe;
;ax, bx, cx, dx are altered.
call LFP79
; clLim = min(clLim, vfls.clMac = phe.clMac);
mov al,[phe.clMacPhe]
xor ah,ah
mov [vfls.clMacFls],ax
cmp [clLim],ax
jle LFP25
mov [clLim],ax
LFP25:
; dyllRemain -= dylBefore;
mov bx,[OFF_dyllRemain]
mov cx,[SEG_dyllRemain]
mov ax,[dylBefore]
cwd
sub bx,ax
sbb cx,dx
; if (lr.tSoftBottom == tPos && clLim == clMax)
; {
; /* dyllRemain is long for OPUS and PCWORD - can't use min */
; dyllRemain += dylLine - 1;
; if (dyllRemain > plbs->ylMaxLr - plbs->yl)
; dyllRemain = plbs->ylMaxLr - plbs->yl;
; }
;LFPa2 compares lr.tSoftBottom with tPos.
;only flags are altered.
call LFPa2
jne LFP26
cmp [clLim],clMax
jne LFP26
mov ax,di
dec ax
cwd
add bx,ax
adc cx,dx
mov ax,[si.ylMaxLrLbs]
sub ax,[si.ylLbs]
cwd
cmp ax,bx
push dx
sbb dx,cx
pop dx
jge LFP26
xchg ax,bx
mov cx,dx
LFP26:
; if (dylLine > dyllRemain)
; {
; lbc = lbcYlLim;
; Assert(dylFill != ylLarge); /* are we lying? */
; goto LNoChange;
; }
mov [OFF_dyllRemain],bx
mov [SEG_dyllRemain],cx
mov ax,di
cwd
cmp bx,ax
mov ax,cx
sbb ax,dx
jge LFP265
ifdef DEBUG
;Do this assert with a call so as not to mess up short jumps
call LFP93
endif ;/* DEBUG */
LFP264:
mov al,lbcYlLim
jmp LFP46
LFP265:
; dcl = clLim - cl;
; if (!fNoYlLimit && dcl > dyllRemain / dylLine)
; dcl = dyllRemain / dylLine;
mov ax,[clLim]
sub ax,[clVar]
cmp [fNoYlLimit],fFalse
jnz LFP31
xchg ax,bx
mov dx,cx
;#ifndef WIN /* Assert causes CS compiler native bug (bl) */
; Assert(dyllRemain / dylLine == (int)(dyllRemain / dylLine));
;#endif
ifdef DEBUG
push ax
push bx
push cx
push dx
mov cx,di
cmp cx,08000h
je LFP30
or cx,cx
jns LFP27
neg cx
LFP27:
or dx,dx
jns LFP28
neg dx
LFP28:
shl cx,1
cmp cx,dx
ja LFP30
LFP29:
mov ax,midLayout22
mov bx,1031
cCall AssertProcForNative,<ax,bx>
LFP30:
pop dx
pop cx
pop bx
pop ax
endif ;/* DEBUG */
idiv di
cmp bx,ax
jg LFP31
xchg ax,bx
LFP31:
mov [dcl],ax
; dyllCur = dcl * dylLine;
imul di
mov [OFF_dyllCur],ax
mov [SEG_dyllCur],dx
; Assert(dyllCur == (int)dyllCur);
ifdef DEBUG
push ax
push bx
push cx
push dx
mov cx,dx
cwd
cmp cx,dx
je LFP32
mov ax,midLayout22
mov bx,1032
cCall AssertProcForNative,<ax,bx>
LFP32:
pop dx
pop cx
pop bx
pop ax
endif ;/* DEBUG */
; if (phe.clMac == cl + dcl)
; {
mov ax,[clVar]
add ax,[dcl]
sub al,[phe.clMacPhe]
or ax,ax
jne LFP35
; /* last line: must carry space after as well;
; if text fits and dyaAfter doesn't, keep text */
; /* two lines for brain dead native generator! */
; YLL ddyll = YlFromYa(vpapFetch.dyaAfter);
;LN_YlFromYa performs YlFromYa(ax); ax, bx, cx, dx are altered.
mov ax,[vpapFetch.dyaAfterPap]
call LN_YlFromYa
cwd
; if (dyllRemain - dyllCur < ddyll)
; ddyll = dyllRemain - dyllCur;
mov bx,[OFF_dyllRemain]
mov cx,[SEG_dyllRemain]
sub bx,[OFF_dyllCur]
sbb cx,[SEG_dyllCur]
cmp bx,ax
mov di,cx
sbb di,dx
jge LFP34
xchg ax,bx
mov dx,cx
LFP34:
; dyllCur += ddyll;
; plbs->cp = cpLim;
; plbs->cl = 0;
add [OFF_dyllCur],ax
adc [SEG_dyllCur],dx
;LFP74 performs:
;plbs->cl = bx = 0;
;dx:ax = plbs->cp = cpLim;
;plbs is assumed to be in si.
;ax, bx, dx are altered.
call LFP74
; }
jmp short LFP37
; else
; {
LFP35:
; Assert(dcl >= 0);
; plbs->cl += dcl;
; lbc = lbcYlLim;
; }
mov ax,[dcl]
ifdef DEBUG
or ax,ax
jge LFP36
push ax
push bx
push cx
push dx
mov ax,midLayout22
mov bx,1034
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
LFP36:
endif ;/* DEBUG */
add [si.clLbs],ax
mov bptr ([lbc]),lbcYlLim
LFP37:
; dyllCur += dylBefore;
; }
mov ax,[dylBefore]
cwd
add [OFF_dyllCur],ax
adc [SEG_dyllCur],dx
jmp short Ltemp018
LFP38:
;/* still a common case: height is known and it fits */
; else if (fParaStart && phe.dxaCol != 0 && !fLnn && clLim == clMax &&
; (dyllCur = YlFromYa(phe.dyaHeight)) <= dyllRemain)
; {
test bptr ([fEndBreak+1]),maskFParaStartLocal
je LFormatPara
cmp [phe.dxaColPhe],0
je LFormatPara
mov ax,[clLim]
sub ax,clMax
or ax,[fLnn]
jne LFormatPara
;LN_YlFromYa performs YlFromYa(ax); ax, bx, cx, dx are altered.
mov ax,[phe.dyaHeightPhe]
call LN_YlFromYa
cwd
mov [OFF_dyllCur],ax
mov [SEG_dyllCur],dx
cmp [OFF_dyllRemain],ax
mov cx,[SEG_dyllRemain]
sbb cx,dx
jl LFormatPara
; ClFormatLines(plbs, cp0, 0, 0, 0, lr.dxl, fFalse, fFalse);
; vfls.phe = phe;
;LFP79 performs:
;ClFormatLines(plbs, cp0, 0, 0, 0, lr.dxl, fFalse, fFalse);
;vfls.phe = phe;
;ax, bx, cx, dx are altered.
call LFP79
; plbs->cp = cpLim;
; plbs->cl = 0;
;LFP74 performs:
;plbs->cl = bx = 0;
;dx:ax = plbs->cp = cpLim;
;plbs is assumed to be in si.
;ax, bx, dx are altered.
call LFP74
; dcl = 1; /* treat it as indivisible */
inc bx
mov [dcl],bx
; }
Ltemp018:
jmp LHaveDylCur
;/* we don't know para's height, or lines are different heights and cl != 0;
; we have to format the lines */
; else
; {
; /* we only measure the amount of TEXT -- if dyaAfter doesn't
; fit but the text does, that's OK */
;LFormatPara:
; if (dylFill == ylLarge)
; dylT = dylMax = ylLarge;
LFormatPara:
mov ax,ylLarge
mov cx,ax
cmp [dylFill],ax
je LFP41
; else
; {
; dylT = (lr.lrk == lrkAbsHit) ? 0 : YlFromYa(vpapFetch.dyaAfter);
mov al,[lr.lrkLr]
sub al,lrkAbsHit
cbw
je LFP39
mov ax,[vpapFetch.dyaAfterPap]
;LN_YlFromYa performs YlFromYa(ax); ax, bx, cx, dx are altered.
call LN_YlFromYa
LFP39:
; dylMax = dylT + ((lr.tSoftBottom != tPos) ? dylFill : plbs->ylMaxLr - plbs->ylColumn);
mov cx,[si.ylMaxLrLbs]
sub cx,[si.ylColumnLbs]
;LFPa2 compares lr.tSoftBottom with tPos.
;only flags are altered.
call LFPa2
je LFP40
mov cx,[dylFill]
LFP40:
add cx,ax
; dylT += dylFill;
; }
add ax,[dylFill]
LFP41:
; clLim = min(clLim, ClFormatLines(plbs, cpLim, dylT, dylMax, clLim, lr.dxl, fFalse, fTrue));
push si
push [SEG_cpLim]
push [OFF_cpLim]
push ax
push cx
push [clLim]
push [lr.dxlLr]
errnz <fFalse>
xor ax,ax
push ax
errnz <fTrue - fFalse - 1>
inc ax
push ax
ifdef DEBUG
cCall S_ClFormatLines,<>
else ;!DEBUG
push cs
call near ptr N_ClFormatLines
endif ;!DEBUG
cmp [clLim],ax
jl LFP42
mov [clLim],ax
LFP42:
; if (clLim == 0 || (!fParaStart &&
; (cl = plbs->cl + IInPlc(vfls.hplclnh, plbs->cp)) >= clLim))
; {
cmp [clLim],0
je LFP43
test bptr ([fEndBreak+1]),maskFParaStartLocal
jne LFP48
;LN_IInPlc performs IInPlc(vfls.hplclnh, *pcp) where pcp is passed
;in bx. ax, bx, cx, dx are altered.
lea bx,[si.cpLbs]
call LN_IInPlc
add ax,[si.clLbs]
mov [clVar],ax
cmp ax,[clLim]
jl LFP48
LFP43:
; /* no lines used */
; if (!vfli.fParaStopped)
; {
; /* not even one line fit */
; lbc = lbcYlLim;
; goto LNoChange;
; }
mov al,lbcYlLim
test [vfli.fParaStoppedFli],maskFParaStoppedFli
je LFP46
; /* entire para is invisible, simply skip it; we ignore
; section boundaries for short docs */
;LEmptyPara:
; plbs->cl = 0;
; plbs->cp = vfls.ca.cpLim;
LEmptyPara:
;LFP73 performs:
;plbs->cl = bx = 0;
;dx:ax = plbs->cp = vfls.ca.cpLim
;plbs is assumed to be in si.
;ax, bx, dx are altered.
call LFP73
; lbc = (vfls.ca.cpLim >= cpMacDoc) ? lbcEndOfDoc :
; (fShort || vfls.ca.cpLim != caSect.cpLim) ?
; lbcNil : lbcEndOfSection;
mov bl,lbcEndOfDoc
cmp ax,[OFF_cpMacDocVar]
mov di,dx
sbb di,[SEG_cpMacDocVar]
jge LFP45
mov bl,lbcNil
errnz <lbcNil - fFalse>
cmp bptr ([fShort]),bl
jne LFP45
cmp dx,[caSect.HI_cpLimCa]
jne LFP45
cmp ax,[caSect.LO_cpLimCa]
jne LFP45
mov bl,lbcEndOfSection
LFP45:
mov bptr ([lbc]),bl
; if (lbc == lbcNil)
; {
errnz <lbcNil>
or bl,bl
jne LNoChange
; Debug(Assert(plbs->cp > cpStart ||
; (plbs->cp == cpStart && plbs->cl > clStart)));
; goto LExitLbcFormatPara;
; }
;Do this assert with a call so as not to affect short jumps.
ifdef DEBUG
call LFP90
endif ;/* DEBUG */
jmp LExitLbcFormatPara
LFP46:
mov bptr [lbc],al
;LNoChange:
; bltLrp(LrpInPl(plbs->hpllr, plbs->ilrCur), &lr, sizeof(struct LR));
LNoChange:
;LFP82 performs
;bltLrp(LrpInPl(plbs->hpllr, plbs->ilrCur), &lr, sizeof(struct LR));
;ax, bx, cx, dx, di are altered.
call LFP82
; if (lbc == lbcYlLim && lr.lrk == lrkAbsHit)
; {
mov ah,bptr ([lbc])
mov al,[lr.lrkLr]
cmp ax,(lbcYlLim SHL 8) + lrkAbsHit
jne Ltemp019
; dylOverlapNew = plbs->dylOverlap + max(0, lr.yl + lr.dyl - plbs->yl);
; }
; goto LAdjustDyl;
; }
mov ax,[lr.ylLr]
add ax,[lr.dylLr]
sub ax,[si.ylLbs]
jge LFP47
xor ax,ax
LFP47:
add ax,[si.dylOverlapLbs]
mov [dylOverlapNew],ax
Ltemp019:
jmp LAdjustDyl
LFP48:
; dcl = clLim - cl;
mov cx,[clLim]
mov ax,cx
sub ax,[clVar]
mov [dcl],ax
; GetPlc(vfls.hplclnh, clLim - 1, &lnh);
; dyllCur = lnh.yll;
;LFP85 performs GetPlc(vfls.hplclnh, cx, bx)
;dx:ax <== bx.yll;
;ax, bx, cx, dx are altered.
dec cx
lea bx,[lnh]
call LFP85
mov [OFF_dyllCur],ax
mov [SEG_dyllCur],dx
; if (cl > 0)
; {
; GetPlc(vfls.hplclnh, cl - 1, &lnhT);
; dyllCur -= lnhT.yll;
; }
mov cx,[clVar]
dec cx
js LFP49
;LFP85 performs GetPlc(vfls.hplclnh, cx, bx)
;dx:ax <== bx.yll;
;ax, bx, cx, dx are altered.
lea bx,[lnhT]
call LFP85
sub [OFF_dyllCur],ax
sbb [SEG_dyllCur],dx
LFP49:
; /* give height to splat-only lines only at start of column */
; if (lnh.fSplatOnly && dcl-- == 1)
; {
xor ax,ax
errnz <fFalse>
test [lnh.fSplatOnlyLnh],maskfSplatOnlyLnh
je LFP495
dec [dcl]
jne LFP495
; fLnn = fFalse; /* don't count splats as lines */
errnz <fFalse>
mov [fLnn],ax
; if (plbs->yl > plbs->ylColumn)
mov bx,[si.ylLbs]
cmp bx,[si.ylColumnLbs]
jle LFP495
; dyllCur = 1;
mov [SEG_dyllCur],ax
inc ax
mov [OFF_dyllCur],ax
; }
LFP495:
; /* this works even if plclnh is empty: rgcp[iylMac = 0] != cpLim */
; plbs->cp = CpPlc(vfls.hplclnh, clLim);
; plbs->cl = 0;
mov cx,[clLim]
;LN_CpPlc performs CpPlc(vfls.hplclnh, cx)
;ax, bx, cx, dx are altered.
call LN_CpPlc
;LFP76 performs:
;plbs->cl = bx = 0;
;plbs->cp = dx:ax;
;plbs is assumed to be in si.
;bx is altered.
call LFP76
; if (plbs->cp != vfls.ca.cpLim && !vfls.fEndBreak)
; {
mov cl,[vfls.fEndBreakFls]
or cl,cl
jne LFP51
cmp dx,[vfls.caFls.HI_cpLimCa]
jne LFP50
cmp ax,[vfls.caFls.LO_cpLimCa]
je LFP51
; /* ran out of space */
; lbc = lbcYlLim;
LFP50:
mov bptr ([lbc]),lbcYlLim
; }
LFP51:
; fEndBreak = vfls.fEndBreak;
mov bptr ([fEndBreak]),cl
; }
;LHaveDylCur:
LHaveDylCur:
; if (dyllCur > ylLarge - plbs->yl - 1)
; dyllCur = ylLarge - plbs->yl -1;
mov ax,ylLarge-1
sub ax,[si.ylLbs]
cwd
cmp ax,[OFF_dyllCur]
sbb dx,[SEG_dyllCur]
jge LFP52
cwd
mov [OFF_dyllCur],ax
mov [SEG_dyllCur],dx
LFP52:
; Assert(dyllCur < ylLarge); /* after substracting height of lines in
; in previous columns, we should be back in the integer range */
ifdef DEBUG
push ax
push bx
push cx
push dx
mov ax,[OFF_dyllCur]
mov dx,[SEG_dyllCur]
sub ax,ylLarge
sbb dx,0
jl LFP53
mov ax,midLayout22
mov bx,1035
cCall AssertProcForNative,<ax,bx>
LFP53:
pop dx
pop cx
pop bx
pop ax
endif ;/* DEBUG */
; if (!fTableRow)
; dyllAdvance = dyllCur;
test bptr ([fEndBreak+1]),maskFTableRowLocal
jne LFP54
mov ax,[OFF_dyllCur]
mov dx,[SEG_dyllCur]
mov [OFF_dyllAdvance],ax
mov [SEG_dyllAdvance],dx
LFP54:
;/* now we know amount of text from para that will be used in this lr */
; Scribble(ispLayout3, (((int)IMacPllr(plbs) / 10) % 10) + '0');
; Scribble(ispLayout4, ((int)IMacPllr(plbs) % 10) + '0');
ifdef DEBUG
push ax
push bx
push cx
push dx
cmp [vdbs.grpfScribbleDbs],0
jz LFP55
mov bx,[si.hpllrLbs]
mov bx,[bx]
mov ax,[bx.iMacPl]
mov bl,10
div bl
mov dl,ah
push dx
xor ah,ah
div bl
xor ah,ah
mov cx,ispLayout3
cCall ScribbleProc,<cx,ax>
pop ax
xor ah,ah
mov cx,ispLayout4
cCall ScribbleProc,<cx,ax>
LFP55:
pop dx
pop cx
pop bx
pop ax
endif ;DEBUG
; lrp = LrpInPl(plbs->hpllr, plbs->ilrCur);
;LN_LrpInPlCur performs LrpInPl(plbs->hpllr, plbs->ilrCur) with
;the result in es:bx or es:ax. It assumes plbs is passed in si.
;ax, bx, cx, dx are altered.
call LN_LrpInPlCur
; if (lr.fSpaceBefore && lrp->cp == cpNil)
; {
test [lr.fSpaceBeforeLr],maskFSpaceBeforeLr
je LFP555
errnz <LO_cpNil - 0FFFFh>
errnz <HI_cpNil - 0FFFFh>
mov ax,es:[bx.LO_cpLr]
and ax,es:[bx.HI_cpLr]
inc ax
jne LFP555
; /* don't let space before at top of page change the LR */
; lr.yl += dylBefore;
mov ax,[dylBefore]
add [lr.ylLr],ax
; dyllCur -= dylBefore;
cwd
sub [OFF_dyllCur],ax
sbb [SEG_dyllCur],dx
; }
LFP555:
; if (lr.lrk == lrkAbs || lr.ihdt != ihdtNil)
; lr.dyl += dyllCur;
cmp [lr.lrkLr],lrkAbs
je LFP56
cmp [lr.ihdtLr],ihdtNil
je LFP57
LFP56:
mov ax,[OFF_dyllCur]
add [lr.dylLr],ax
jmp short LFP58
; else if (lr.dyl <= plbs->yl + (int)dyllAdvance - lr.yl)
; {
; /* if tSoftBottom, we can extend past end of lr */
; lr.dyl = plbs->yl + (int)dyllAdvance - lr.yl;
; if (dyllAdvance > dyllRemain)
; lbc = lbcYlLim; /* non-apo footnotes don't set ylLim */
; }
LFP57:
mov ax,[si.ylLbs]
add ax,[OFF_dyllAdvance]
sub ax,[lr.ylLr]
cmp [lr.dylLr],ax
jg LFP58
mov [lr.dylLr],ax
mov bx,[OFF_dyllRemain]
sub bx,[OFF_dyllAdvance]
mov bx,[SEG_dyllRemain]
sbb bx,[SEG_dyllAdvance]
jge LFP58
mov bptr ([lbc]),lbcYlLim
LFP58:
; if (lr.lrk != lrkAbs)
; {
mov bx,[dcl]
cmp [lr.lrkLr],lrkAbs
je LFP59
; lr.cpLim = plbs->cp;
; lr.clLim = plbs->cl;
mov ax,[si.LO_cpLbs]
mov [lr.LO_cpLimLr],ax
mov ax,[si.HI_cpLbs]
mov [lr.HI_cpLimLr],ax
mov ax,[si.clLbs]
mov [lr.clLimLr],ax
; plbs->yl += dyllAdvance;
mov cx,[OFF_dyllAdvance]
mov dx,[SEG_dyllAdvance]
add [si.ylLbs],cx
; if (plbs->fSimpleLr)
; {
cmp [si.fSimpleLrLbs],fFalse
je LFP585
; lr.lrs = lrsFrozen;
mov [lr.lrsLr],lrsFrozen
; /* will be off slightly for unusual borders because
; we don't come back and adjust lr.dyl */
; lr.dyl = plbs->yl - lr.yl;
; }
mov ax,[si.ylLbs]
sub ax,[lr.ylLr]
mov [lr.dylLr],ax
LFP585:
; plbs->dylUsedCol += dyllAdvance; /* amount of linear space used */
add [si.dylUsedColLbs],cx
; if (dcl > 0)
; {
or bx,bx
jle LFP59
; plbs->dyllTotal += dyllAdvance;
; plbs->clTotal += dcl;
; }
add [si.LO_dyllTotalLbs],cx
adc [si.HI_dyllTotalLbs],dx
add [si.clTotalLbs],bx
; }
LFP59:
; bltLrp(&lr, lrp, sizeof(struct LR));
; if (fLnn)
; plbs->lnn += dcl;
cmp [fLnn],fFalse
je LFP60
add [si.lnnLbs],bx
LFP60:
;LFP83 performs
;bltLrp(&lr, LrpInPl(plbs->hpllr, plbs->ilrCur), sizeof(struct LR));
;ax, bx, cx, dx, di are altered.
call LFP83
; plbs->fFirstPara = fFalse; /* at least one done */
mov [si.fFirstParaLbs],fFalse
; plbs->fPrevTable = fTableRow; /* remember if we're in a table */
mov al,bptr ([fEndBreak+1])
and al,maskFTableRowLocal
mov [si.fPrevTableLbs],al
;/* determine why we stopped */
;LSetLbc:
; if (plbs->cp >= cpMacDoc)
; lbc = lbcEndOfDoc;
LSetLbc:
mov ax,[si.LO_cpLbs]
mov dx,[si.HI_cpLbs]
sub ax,[OFF_cpMacDocVar]
sbb dx,[SEG_cpMacDocVar]
mov al,lbcEndOfDoc
jge Ltemp020
; else if (fEndBreak)
; {
cmp bptr ([fEndBreak]),fFalse
je LFP62
; /* terminated by chSect/chColumnBreak;
; note: short docs can't get in here */
;LPageBreak: Assert(!fShort);
LPageBreak:
ifdef DEBUG
;Do this assert with a call so as not to mess up short jumps.
call LFP86
endif ;DEBUG
; if (vfls.ca.cpLim == caSect.cpLim && plbs->cp == vfls.ca.cpLim)
; lbc = lbcEndOfSection;
mov ax,[vfls.caFls.LO_cpLimCa]
cmp ax,[caSect.LO_cpLimCa]
jne LFP61
cmp ax,[si.LO_cpLbs]
jne LFP61
mov ax,[vfls.caFls.HI_cpLimCa]
cmp ax,[caSect.HI_cpLimCa]
jne LFP61
cmp ax,[si.HI_cpLbs]
mov al,lbcEndOfSection
je Ltemp020
LFP61:
; else if (CColM1Sep(vsepFetch) == 0 || vfls.chBreak == chSect)
; lbc = lbcEndOfPage;
;#define CColM1Sep(sep) (sep.ccolM1)
mov al,lbcEndOfPage
mov cx,[vsepFetch.ccolM1Sep]
jcxz Ltemp020
cmp [vfls.chBreakFls],chSect
je Ltemp020
; else
; {
; Assert(vfls.chBreak == chColumnBreak);
ifdef DEBUG
;Do this assert with a call so as not to mess up short jumps.
call LFP88
endif ;DEBUG
; plbs->fNoBalance = fTrue;
mov [si.fNoBalanceLbs],fTrue
; lbc = lbcEndOfColumn;
mov al,lbcEndOfColumn
Ltemp020:
jmp short LFP64
; }
; }
LFP62:
; else if (!fChain && !fShort && lr.lrk != lrkAbs && plbs->cp == caSect.cpLim - ccpSect &&
; plbs->cp < CpMacDocEditPlbs(plbs))
; {
;#define CpMacDocEditPlbs(plbs) CpMacDocEdit(plbs->doc)
mov al,bptr ([fEndBreak+1])
and al,maskFChainLocal
or al,bptr ([fShort])
jne LAdjustDyl
cmp [lr.lrkLr],lrkAbs
je LAdjustDyl
cCall CpMacDocEdit,<[si.docLbs]>
mov bx,[si.LO_cpLbs]
mov cx,[si.HI_cpLbs]
cmp bx,ax
mov ax,cx
sbb ax,dx
jge LAdjustDyl
mov ax,[caSect.LO_cpLimCa]
mov dx,[caSect.HI_cpLimCa]
sub ax,bx
sbb dx,cx
sub ax,ccpSect
or ax,dx
jne LAdjustDyl
; /* special check: last line of section exactly filled space;
; especially useful when balancing */
; if (FInTableDocCp(plbs->doc, plbs->cp))
; {
; caParaL.doc = docNil; /* make sure caParaL gets redone */
; goto LAdjustDyl;
; }
push [si.docLbs]
push cx
push bx
ifdef DEBUG
cCall S_FInTableDocCp,<>
else ;not DEBUG
cCall N_FInTableDocCp,<>
endif ;DEBUG
xchg ax,cx
jcxz LFP625
errnz <hNil>
xor ax,ax
mov [caParaL.docCa],ax
jmp short LAdjustDyl
LFP625:
; /* special check: last line of section exactly filled space;
; especially useful when balancing */
; lbc = ((plbs->cp = lr.cpLim = caSect.cpLim) >= cpMacDoc) ?
; lbcEndOfDoc : lbcEndOfSection;
; /* update cpLim for dcpDepend */
; vfls.ca.cpLim = CpMax(vfls.ca.cpLim, caSect.cpLim);
; plbs->cl = lr.clLim = 0;
mov ax,[caSect.LO_cpLimCa]
mov dx,[caSect.HI_cpLimCa]
;LFP76 performs:
;plbs->cl = bx = 0;
;plbs->cp = dx:ax;
;plbs is assumed to be in si.
;bx is altered.
call LFP76
mov [lr.LO_cpLimLr],ax
mov [lr.HI_cpLimLr],dx
mov [lr.clLimLr],bx
cmp ax,[vfls.caFls.LO_cpLimCa]
mov cx,dx
sbb cx,[vfls.caFls.HI_cpLimCa]
jl LFP63
mov [vfls.caFls.LO_cpLimCa],ax
mov [vfls.caFls.HI_cpLimCa],dx
LFP63:
sub ax,[OFF_cpMacDocVar]
sbb dx,[SEG_cpMacDocVar]
mov al,lbcEndOfSection
jl LFP64
mov al,lbcEndOfDoc
; }
LFP64:
mov bptr ([lbc]),al
;LAdjustDyl:
; if (!fChain && lbc != lbcNil)
; {
LAdjustDyl:
mov al,bptr ([lbc])
mov ah,[lr.lrkLr]
test bptr ([fEndBreak+1]),maskFChainLocal
jne Ltemp022
cmp al,lbcNil
je Ltemp022
; /* keep advances past this lr; others need to shorten lr and
; try to use remaining space */
; if (lr.cp != cpNil && lr.ihdt == ihdtNil)
errnz <LO_cpNil - 0FFFFh>
errnz <HI_cpNil - 0FFFFh>
mov cx,[lr.LO_cpLr]
and cx,[lr.HI_cpLr]
inc cx
je LFP648
cmp [lr.ihdtLr],ihdtNil
jne LFP648
; if (lbc == lbcYlLim)
; {
; if (fTableRow || !FKeepPap(vpapFetch))
; lr.dyl = plbs->yl - lr.yl;
; }
; else if (lr.lrk != lrkAbs)
; lr.dyl = plbs->yl - lr.yl;
;#define FKeepPap(pap) (pap.fKeep)
cmp al,lbcYlLim
jne LFP642
cmp [vpapFetch.fKeepPap],fFalse
je LFP646
test bptr ([fEndBreak+1]),maskFTableRowLocal
jmp short LFP644
Ltemp022:
jmp LFP67
LFP642:
cmp ah,lrkAbs
LFP644:
je LFP648
LFP646:
mov cx,[si.ylLbs]
sub cx,[lr.ylLr]
mov [lr.dylLr],cx
LFP648:
; /* can't maintain width for rectangles altered by APO */
; /* need raw cp's for accurate page breaks on screen */
; /* keeping cl for footnotes raises too many problems */
; /* Mac: because yl is int, allowing large cl can overflow
; ClFormatLines' clFirst scan; in any case, having a big
; cl is NOT an optimization */
; if (lr.clLim != 0 && (lr.lrk != lrkNormal ||
; vlm == lmBRepag || fShort || plbs->cl >= clMaxLbs))
; {
mov di,[lr.clLimLr]
or di,di
je LFP663
errnz <lrkNormal - 0>
or ah,ah
jne LFP65
cmp [vlm],lmBRepag
je LFP65
cmp bptr ([fShort]),ah
jne LFP65
cmp [si.clLbs],clMaxLbs
jl LFP663
LFP65:
; /* reduce cl; this is a smart version of CpFromCpCl */
; cl = lr.clLim + max(0, IInPlcCheck(vfls.hplclnh, plbs->cp));
cCall IInPlcCheck,<[vfls.hplclnhFls], [si.HI_cpLbs], [si.LO_cpLbs]>
or ax,ax
jl LFP655
add di,ax
LFP655:
; if (IMacPlc(vfls.hplclnh) < cl)
; ClFormatLines(plbs, vfls.ca.cpLim, ylLarge, ylLarge, cl, lr.dxl, fFalse, fTrue);
mov bx,[vfls.hplclnhFls]
mov bx,[bx]
cmp [bx.iMacPl],di
jge LFP66
mov ax,ylLarge
push si
push [vfls.caFls.HI_cpLimCa]
push [vfls.caFls.LO_cpLimCa]
push ax
push ax
push di
push [lr.dxlLr]
errnz <fFalse>
xor ax,ax
push ax
errnz <fTrue - fFalse - 1>
inc ax
push ax
ifdef DEBUG
cCall S_ClFormatLines,<>
else ;!DEBUG
push cs
call near ptr N_ClFormatLines
endif ;!DEBUG
LFP66:
; plbs->cp = lr.cpLim = CpPlc(vfls.hplclnh, cl);
; plbs->cl = lr.clLim = 0;
;LN_CpPlc performs CpPlc(vfls.hplclnh, cx)
;ax, bx, cx, dx are altered.
mov cx,di
call LN_CpPlc
;LFP76 performs:
;plbs->cl = bx = 0;
;plbs->cp = dx:ax;
;plbs is assumed to be in si.
;bx is altered.
call LFP76
mov [lr.clLimLr],bx
mov [lr.LO_cpLimLr],ax
mov [lr.HI_cpLimLr],dx
; }
LFP663:
; if (lr.lrk == lrkAbs && plbs->cp < vfls.ca.cpLim)
; lr.cpLim = plbs->cp;
cmp [lr.lrkLr],lrkAbs
jne LFP667
mov ax,[si.LO_cpLbs]
mov dx,[si.HI_cpLbs]
cmp ax,[vfls.caFls.LO_cpLimCa]
mov cx,dx
sbb cx,[vfls.caFls.HI_cpLimCa]
jge LFP667
mov [lr.LO_cpLimLr],ax
mov [lr.HI_cpLimLr],dx
LFP667:
; lr.lrs = lrsFrozen;
mov [lr.lrsLr],lrsFrozen
; /* check height/width, but balancing causes restricted room
; cases all the time */
; Assert(vcBalance > 0 || lr.cp == cpNil || (lr.dxl >= 0 && lr.dyl >= 0));
ifdef DEBUG
;Do this assert with a call so as not to mess up short jumps.
call LFPa3
endif ;DEBUG
; bltLrp(&lr, LrpInPl(plbs->hpllr, plbs->ilrCur), sizeof(struct LR));
;LFP83 performs
;bltLrp(&lr, LrpInPl(plbs->hpllr, plbs->ilrCur), sizeof(struct LR));
;ax, bx, cx, dx, di are altered.
call LFP83
; }
LFP67:
; /* notice that dcpDepend ignores cl */
; plbs->dcpDepend = max(0,(int) CpMin(0x7fffL, vfls.ca.cpLim - plbs->cp));
mov ax,[vfls.caFls.LO_cpLimCa]
mov dx,[vfls.caFls.HI_cpLimCa]
sub ax,[si.LO_cpLbs]
sbb dx,[si.HI_cpLbs]
jl LFP675
cmp ax,07FFFh
sbb dx,0
jl LFP68
mov ax,07FFFh
db 03dh ;turns next "xor ax,ax" into "cmp ax,immediate"
LFP675:
xor ax,ax
LFP68:
mov [si.dcpDependLbs],ax
; plbs->dylOverlap = dylOverlapNew;
mov ax,[dylOverlapNew]
mov [si.dylOverlapLbs],ax
;LExitLbcFormatPara:
; /* I certainly hope we accomplished something! */
; /* We may not have made any progress if the first line we tried
; would not fit. (lbc == lbcYlLim) */
LExitLbcFormatPara:
; Debug(Assert(lbc == lbcYlLim || lbc == lbcEndOfDoc ||
; (plbs->cp > cpStart ||
; (plbs->cp == cpStart && plbs->cl > clStart))));
ifdef DEBUG
push ax
push bx
push cx
push dx
cmp bptr ([lbc]),lbcYlLim
je LFP70
cmp bptr ([lbc]),lbcEndOfDoc
je LFP70
mov ax,[OFF_cpStart]
mov dx,[SEG_cpStart]
sub ax,[si.LO_cpLbs]
sbb dx,[si.HI_cpLbs]
jl LFP70
or ax,dx
jne LFP69
mov ax,[clStart]
cmp [si.clLbs],ax
jle LFP70
LFP69:
mov ax,midLayout22
mov bx,1036
cCall AssertProcForNative,<ax,bx>
LFP70:
pop dx
pop cx
pop bx
pop ax
; ShowLbs(plbs, irtnFormPara);
cmp [vdbs.fShowLbsDbs],0
jz LFP71
push plbs
mov ax,irtnFormPara
push ax
cCall ShowLbsProc,<>
LFP71:
endif ;/* DEBUG */
; StopProfile();
; return(lbc);
mov al,bptr ([lbc])
cbw
;}
cEnd
;LFP73 performs:
;plbs->cl = bx = 0;
;dx:ax = plbs->cp = vfls.ca.cpLim
;plbs is assumed to be in si.
;ax, bx, dx are altered.
LFP73:
mov bx,dataoffset [vfls.caFls.cpLimCa]
jmp short LFP75
;LFP74 performs:
;plbs->cl = bx = 0;
;dx:ax = plbs->cp = cpLim;
;plbs is assumed to be in si.
;ax, bx, dx are altered.
LFP74:
lea bx,[cpLim]
LFP75:
mov ax,[bx]
mov dx,[bx+2]
;LFP76 performs:
;plbs->cl = bx = 0;
;plbs->cp = dx:ax;
;plbs is assumed to be in si.
;bx is altered.
LFP76:
mov [si.LO_cpLbs],ax
mov [si.HI_cpLbs],dx
xor bx,bx
mov [si.clLbs],bx
ret
;LFP77 performs plbs->cp == caParaL.cpFirst.
;plbs is assumed in si. Only ax is altered.
LFP77:
mov ax,[caParaL.HI_cpFirstCa]
cmp ax,[si.HI_cpLbs]
jne LFP78
mov ax,[caParaL.LO_cpFirstCa]
cmp ax,[si.LO_cpLbs]
LFP78:
ret
;LFP79 performs:
;ClFormatLines(plbs, cp0, 0, 0, 0, lr.dxl, fFalse, fFalse);
;vfls.phe = phe;
;ax, bx, cx, dx are altered.
LFP79:
xor ax,ax
push si
push ax
push ax
push ax
push ax
push ax
push [lr.dxlLr]
errnz <fFalse>
push ax
push ax
ifdef DEBUG
cCall S_ClFormatLines,<>
else ;!DEBUG
push cs
call near ptr N_ClFormatLines
endif ;!DEBUG
db 0A8h ;turns next "stc" into "test al,immediate"
;also clears the carry flag
;LFP80 performs phe = vfls.phe. No registers are altered.
LFP80:
stc
push si ;save plbs
push di ;save caller's di
push ds
pop es
mov si,dataoffset [vfls.pheFls]
lea di,[phe]
jc LFP81
xchg si,di
LFP81:
errnz <cbPheMin - 6>
movsw
movsw
movsw
pop di ;restore caller's di
pop si ;restore plbs
ret
;LFP82 performs
;bltLrp(LrpInPl(plbs->hpllr, plbs->ilrCur), &lr, sizeof(struct LR));
;ax, bx, cx, dx, di are altered.
LFP82:
db 0A8h ;turns next "stc" into "test al,immediate"
;also clears the carry flag
;LFP83 performs
;bltLrp(&lr, LrpInPl(plbs->hpllr, plbs->ilrCur), sizeof(struct LR));
;ax, bx, cx, dx, di are altered.
LFP83:
stc
pushf
ifdef DEBUG
push ax
push bx
push cx
push dx
jnc LFP837
cmp [lr.LO_cpLr],LO_cpNil
jne LFP833
cmp [lr.HI_cpLr],HI_cpNil
je LFP837
LFP833:
cmp [lr.dxlLr],0
jl LFP835
cmp [lr.dylLr],0
jge LFP837
LFP835:
mov ax,midLayout22
mov bx,6666
cCall AssertProcForNative,<ax,bx>
LFP837:
pop dx
pop cx
pop bx
pop ax
endif ;DEBUG
;LN_LrpInPlCur performs LrpInPl(plbs->hpllr, plbs->ilrCur) with
;the result in es:bx or es:ax. It assumes plbs is passed in si.
;ax, bx, cx, dx are altered.
call LN_LrpInPlCur
popf
push si
xchg ax,di
lea si,[lr]
jc LFP84
push es
pop ds
push ss
pop es
xchg si,di
LFP84:
errnz <cbLrMin AND 1>
mov cx,cbLrMin SHR 1
rep movsw
push ss
pop ds
pop si
ret
;LFP85 performs GetPlc(vfls.hplclnh, cx, bx)
;dx:ax <== bx.yll;
;ax, bx, cx, dx are altered.
LFP85:
push bx ;save plnh
cCall GetPlc,<[vfls.hplclnhFls], cx, bx>
pop bx ;restore plnh
mov ax,[bx.LO_yllLnh]
mov dx,[bx.HI_yllLnh]
ret
; Assert(!fShort);
ifdef DEBUG
LFP86:
cmp bptr ([fShort]),fFalse
je LFP87
push ax
push bx
push cx
push dx
mov ax,midLayout22
mov bx,1037
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
LFP87:
ret
endif ;/* DEBUG */
; Assert(vfls.chBreak == chColumnBreak);
ifdef DEBUG
LFP88:
cmp bptr ([vfls.chBreakFls]),chColumnBreak
je LFP89
push ax
push bx
push cx
push dx
mov ax,midLayout22
mov bx,1038
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
LFP89:
ret
endif ;DEBUG
; Debug(Assert(plbs->cp > cpStart ||
; (plbs->cp == cpStart && plbs->cl > clStart)));
ifdef DEBUG
LFP90:
push ax
push bx
push cx
push dx
mov ax,[OFF_cpStart]
mov dx,[SEG_cpStart]
sub ax,[si.LO_cpLbs]
sbb dx,[si.HI_cpLbs]
jl LFP92
or ax,dx
jne LFP91
mov ax,[clStart]
cmp [si.clLbs],ax
jle LFP92
LFP91:
mov ax,midLayout22
mov bx,1039
cCall AssertProcForNative,<ax,bx>
LFP92:
pop dx
pop cx
pop bx
pop ax
ret
endif ;/* DEBUG */
; Assert(dylFill != ylLarge); /* are we lying? */
ifdef DEBUG
LFP93:
cmp [dylFill],ylLarge
jne LFP94
push ax
push bx
push cx
push dx
mov ax,midLayout22
mov bx,1040
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
LFP94:
ret
endif ;/* DEBUG */
; Assert(plbs->cl == 0);
ifdef DEBUG
LFP95:
cmp [si.clLbs],0
je LFP96
push ax
push bx
push cx
push dx
mov ax,midLayout22
mov bx,1041
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
LFP96:
ret
endif ;/* DEBUG */
; Assert (plbs->ylMaxColumn >= 0);
ifdef DEBUG
LFP97:
cmp [si.ylMaxColumnLbs],0
jge LFP98
push ax
push bx
push cx
push dx
mov ax,midLayout22
mov bx,1042
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
LFP98:
ret
endif ;/* DEBUG */
;LFPa2 compares lr.tSoftBottom with tPos.
;only flags are altered.
LFPa2:
push ax
mov al,[lr.tSoftBottomLr]
and al,maskTSoftBottomLr
errnz <maskTSoftBottomLr - 0F0h>
cmp al,tPos SHL 4
pop ax
ret
; /* check height/width, but balancing causes restricted room
; cases all the time */
; Assert(vcBalance > 0 || lr.cp == cpNil || (lr.dxl >= 0 && lr.dyl >= 0));
ifdef DEBUG
LFPa3:
cmp [vcBalance],0
jg LFPa5
cmp [lr.LO_cpLr],LO_cpNil
jne LFPa35
cmp [lr.HI_cpLr],HI_cpNil
je LFPa5
LFPa35:
cmp [lr.dxlLr],0
jl LFPa4
cmp [lr.dylLr],0
jge LFPa5
LFPa4:
push ax
push bx
push cx
push dx
mov ax,midLayout22
mov bx,1043
cCall AssertProcForNative,<ax,bx>
pop dx
pop cx
pop bx
pop ax
LFPa5:
ret
endif ;/* DEBUG */
sEnd layout2
end
| 20.657713
| 95
| 0.640732
|
85aeeab3610e22418bedf74a03175719de60e4c9
| 1,002
|
asm
|
Assembly
|
data/pokemon/base_stats/drifblim.asm
|
AtmaBuster/pokeplat-gen2
|
fa83b2e75575949b8f72cb2c48f7a1042e97f70f
|
[
"blessing"
] | 6
|
2021-06-19T06:41:19.000Z
|
2022-02-15T17:12:33.000Z
|
data/pokemon/base_stats/drifblim.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | null | null | null |
data/pokemon/base_stats/drifblim.asm
|
AtmaBuster/pokeplat-gen2-old
|
01e42c55db5408d72d89133dc84a46c699d849ad
|
[
"blessing"
] | 2
|
2021-08-11T19:47:07.000Z
|
2022-01-01T07:07:56.000Z
|
db 0 ; species ID placeholder
db 150, 80, 44, 80, 90, 54
; hp atk def spd sat sdf
db GHOST, FLYING ; type
db 60 ; catch rate
db 174 ; base exp
db NO_ITEM, NO_ITEM ; items
db GENDER_F50 ; gender ratio
db 30 ; step cycles to hatch
INCBIN "gfx/pokemon/drifblim/front.dimensions"
db GROWTH_FLUCTUATING ; growth rate
dn EGG_INDETERMINATE, EGG_INDETERMINATE ; egg groups
db 70 ; happiness
; tm/hm learnset
tmhm CALM_MIND, TOXIC, HIDDEN_POWER, SUNNY_DAY, HYPER_BEAM, PROTECT, RAIN_DANCE, FRUSTRATION, THUNDERBOLT, THUNDER, RETURN, PSYCHIC_M, SHADOW_BALL, DOUBLE_TEAM, SHOCK_WAVE, FACADE, SECRET_POWER, REST, ATTRACT, THIEF, SKILL_SWAP, CHARGE_BEAM, ENDURE, WILL_O_WISP, SILVER_WIND, EMBARGO, EXPLOSION, PAYBACK, RECYCLE, GIGA_IMPACT, FLASH, THUNDER_WAVE, GYRO_BALL, PSYCH_UP, CAPTIVATE, SLEEP_TALK, NATURAL_GIFT, DREAM_EATER, SWAGGER, SUBSTITUTE, CUT, FLY, DEFOG, AIR_CUTTER, ICY_WIND, KNOCK_OFF, MUD_SLAP, OMINOUS_WIND, ROLLOUT, SNORE, SPITE, SUCKER_PUNCH, SWIFT, TRICK
; end
| 50.1
| 565
| 0.758483
|
7472ccb585484661353fece501babe7247f39be8
| 5,105
|
asm
|
Assembly
|
data/actors/boat.asm
|
sinusoid-studios/rhythm-land
|
6471f1d7b7d885bbb898888645ac291d45125134
|
[
"MIT"
] | 11
|
2021-08-10T20:31:11.000Z
|
2021-12-28T11:57:03.000Z
|
data/actors/boat.asm
|
sinusoid-studios/rhythm-land
|
6471f1d7b7d885bbb898888645ac291d45125134
|
[
"MIT"
] | null | null | null |
data/actors/boat.asm
|
sinusoid-studios/rhythm-land
|
6471f1d7b7d885bbb898888645ac291d45125134
|
[
"MIT"
] | 1
|
2021-10-02T17:49:10.000Z
|
2021-10-02T17:49:10.000Z
|
INCLUDE "constants/hardware.inc"
INCLUDE "constants/actors.inc"
INCLUDE "constants/games/battleship.inc"
INCLUDE "macros/actors.inc"
SECTION "Battleship Boat Actor Animation Data", ROMX
xActorBoatAnimation::
animation Boat, BOAT
.left
cel enter1, MUSIC_BATTLESHIP_SPEED * 2 / 4
cel enter2, MUSIC_BATTLESHIP_SPEED * 2 / 4
cel enter3, MUSIC_BATTLESHIP_SPEED * 2 / 4
cel enter4, MUSIC_BATTLESHIP_SPEED * 2 / 4
cel left1, 4
cel left2, 4
cel exitLeft1, 4
cel exitLeft2, 4
cel exitLeft3, 4
cel exitLeft4, 4
DB ANIMATION_KILL_ACTOR
; Fix alignment
DS 1
.right
cel enter1, MUSIC_BATTLESHIP_SPEED * 2 / 4
cel enter2, MUSIC_BATTLESHIP_SPEED * 2 / 4
cel enter3, MUSIC_BATTLESHIP_SPEED * 2 / 4
cel enter4, MUSIC_BATTLESHIP_SPEED * 2 / 4
cel right1, 4
cel right2, 4
cel exitRight1, 4
cel exitRight2, 4
cel exitRight3, 4
cel exitRight4, 4
DB ANIMATION_KILL_ACTOR
; Cel constant definitions
def_cel .left, LEFT
def_cel .right, RIGHT
SECTION "Battleship Boat Actor Meta-Sprite Data", ROMX
xActorBoatMetasprites::
metasprite .enter1
metasprite .enter2
metasprite .enter3
metasprite .enter4
metasprite .left1
metasprite .left2
metasprite .exitLeft1
metasprite .exitLeft2
metasprite .exitLeft3
metasprite .exitLeft4
metasprite .right1
metasprite .right2
metasprite .exitRight1
metasprite .exitRight2
metasprite .exitRight3
metasprite .exitRight4
.enter1
obj 8, 8, $36, OAMF_PAL1
obj 8, 16, $38, OAMF_PAL1
obj 24, 8, $3A, OAMF_PAL1
obj 24, 16, $3C, OAMF_PAL1
obj 4, 12, $9A, OAMF_PAL1
DB METASPRITE_END
.enter2
obj 8, 8, $36, OAMF_PAL1
obj 8, 16, $38, OAMF_PAL1
obj 24, 8, $3A, OAMF_PAL1
obj 24, 16, $3C, OAMF_PAL1
obj 4, 12, $9C, OAMF_PAL1
DB METASPRITE_END
.enter3
obj 8, 8, $3E, OAMF_PAL1
obj 8, 16, $40, OAMF_PAL1
obj 24, 8, $42, OAMF_PAL1
obj 24, 16, $44, OAMF_PAL1
obj 4, 12, $9A, OAMF_PAL1
DB METASPRITE_END
.enter4
obj 8, 8, $3E, OAMF_PAL1
obj 8, 16, $40, OAMF_PAL1
obj 24, 8, $42, OAMF_PAL1
obj 24, 16, $44, OAMF_PAL1
obj 4, 12, $9C, OAMF_PAL1
DB METASPRITE_END
.left1
obj 20, -2, $46, OAMF_PAL1
obj 20, 6, $48, OAMF_PAL1
obj 20, 14, $4A, OAMF_PAL1
obj 4, 6, $4C, OAMF_PAL1
obj 4, 14, $4E, OAMF_PAL1
obj 5, 15, $9E, OAMF_PAL1
DB METASPRITE_END
.left2
obj 16, -10, $50, OAMF_PAL1
obj 16, -2, $52, OAMF_PAL1
obj 16, 6, $54, OAMF_PAL1
obj 16, 14, $56, OAMF_PAL1
obj 0, 0, $58, OAMF_PAL1
obj 0, 8, $5A, OAMF_PAL1
obj 6, 14, $A0, OAMF_PAL1
DB METASPRITE_END
.exitLeft1
obj 16, -18, $5C, OAMF_PAL1
obj 16, -10, $5E, OAMF_PAL1
obj 16, -2, $60, OAMF_PAL1
obj 15, 6, $62, OAMF_PAL1
obj 0, -2, $64, OAMF_PAL1
obj 0, -10, $66, OAMF_PAL1
obj 9, 11, $A2, OAMF_PAL1
DB METASPRITE_END
.exitLeft2
obj 16, -26, $5C, OAMF_PAL1
obj 16, -18, $5E, OAMF_PAL1
obj 16, -10, $60, OAMF_PAL1
obj 0, -10, $64, OAMF_PAL1
obj 15, -2, $62, OAMF_PAL1
obj 0, -18, $66, OAMF_PAL1
obj 9, 3, $A4, OAMF_PAL1
DB METASPRITE_END
.exitLeft3
obj 16, -34, $68, OAMF_PAL1
obj 16, -26, $6A, OAMF_PAL1
obj 14, -18, $6C, OAMF_PAL1
obj 15, -10, $6E, OAMF_PAL1
obj 0, -26, $66, OAMF_PAL1
obj 0, -18, $64, OAMF_PAL1
obj 9, -5, $A2, OAMF_PAL1
DB METASPRITE_END
.exitLeft4
obj 16, -42, $68, OAMF_PAL1
obj 16, -34, $6A, OAMF_PAL1
obj 14, -26, $6C, OAMF_PAL1
obj 15, -18, $6E, OAMF_PAL1
obj 0, -34, $66, OAMF_PAL1
obj 0, -26, $64, OAMF_PAL1
obj 9, -13, $A4, OAMF_PAL1
DB METASPRITE_END
.right1
obj 20, 26, $70, OAMF_PAL1
obj 20, 10, $72, OAMF_PAL1
obj 20, 18, $74, OAMF_PAL1
obj 4, 10, $76, OAMF_PAL1
obj 4, 18, $78, OAMF_PAL1
obj 5, 9, $A6, OAMF_PAL1
DB METASPRITE_END
.right2
obj 16, 8, $7A, OAMF_PAL1
obj 16, 16, $7C, OAMF_PAL1
obj 16, 24, $7E, OAMF_PAL1
obj 16, 32, $80, OAMF_PAL1
obj 0, 16, $82, OAMF_PAL1
obj 0, 24, $84, OAMF_PAL1
obj 6, 9, $A6, OAMF_PAL1
DB METASPRITE_END
.exitRight1
obj 15, 16, $86, OAMF_PAL1
obj 16, 24, $88, OAMF_PAL1
obj 16, 32, $8A, OAMF_PAL1
obj 16, 40, $8C, OAMF_PAL1
obj 0, 24, $8E, OAMF_PAL1
obj 8, 12, $AA, OAMF_PAL1
DB METASPRITE_END
.exitRight2
obj 15, 32, $86, OAMF_PAL1
obj 16, 40, $88, OAMF_PAL1
obj 16, 48, $8A, OAMF_PAL1
obj 16, 56, $8C, OAMF_PAL1
obj 0, 40, $8E, OAMF_PAL1
obj 0, 48, $90, OAMF_PAL1
obj 9, 27, $AC, OAMF_PAL1
DB METASPRITE_END
.exitRight3
obj 15, 40, $92, OAMF_PAL1
obj 16, 48, $94, OAMF_PAL1
obj 16, 56, $96, OAMF_PAL1
obj 16, 64, $98, OAMF_PAL1
obj 0, 48, $8E, OAMF_PAL1
obj 0, 56, $90, OAMF_PAL1
obj 9, 35, $AA, OAMF_PAL1
DB METASPRITE_END
.exitRight4
obj 15, 52, $92, OAMF_PAL1
obj 16, 60, $94, OAMF_PAL1
obj 16, 68, $96, OAMF_PAL1
obj 16, 76, $98, OAMF_PAL1
obj 0, 60, $8E, OAMF_PAL1
obj 0, 68, $90, OAMF_PAL1
obj 9, 47, $AC, OAMF_PAL1
DB METASPRITE_END
| 26.045918
| 54
| 0.625073
|
42e56d8d48a6ff2e27f5874d5073a1a6c3fe4c70
| 649
|
asm
|
Assembly
|
oeis/222/A222138.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/222/A222138.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/222/A222138.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A222138: Number of nX2 0..4 arrays with no entry increasing mod 5 by 4 rightwards or downwards, starting with upper left zero
; 4,52,676,8788,114244,1485172,19307236,250994068,3262922884,42417997492,551433967396,7168641576148,93192340489924,1211500426369012,15749505542797156,204743572056363028,2661666436732719364,34601663677525351732,449821627807829572516,5847681161501784442708,76019855099523197755204,988258116293801570817652,12847355511819420420629476,167015621653652465468183188,2171203081497482051086381444,28225640059467266664122958772,366933320773074466633598464036,4770133170049968066236780032468
mov $1,13
pow $1,$0
mul $1,4
mov $0,$1
| 81.125
| 480
| 0.881356
|
55559a90e19318990385d0f78c761bf9719ae15b
| 422
|
asm
|
Assembly
|
oeis/156/A156161.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/156/A156161.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/156/A156161.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A156161: a(n) = 34*a(n-1)-a(n-2)-2312 for n > 2; a(1)=289, a(2)=7225.
; Submitted by Jamie Morken(s4)
; 289,7225,243049,8254129,280395025,9525174409,323575532569,10992042930625,373405884106369,12684808016683609,430910066683134025,14638257459209870929,497269843546452475249,16892536423120174285225
mov $3,1
lpb $0
sub $0,1
mov $1,$3
mul $1,32
add $2,$1
add $3,$2
lpe
mov $0,$3
div $0,32
mul $0,6936
add $0,289
| 24.823529
| 194
| 0.720379
|
0f014f424cb1060546bea4c664da66f5c4eac0de
| 668
|
asm
|
Assembly
|
oeis/011/A011922.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/011/A011922.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/011/A011922.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A011922: a(n) = 15*a(n-1) - 15*a(n-2) + a(n-3).
; Submitted by Jon Maiga
; 1,3,33,451,6273,87363,1216801,16947843,236052993,3287794051,45793063713,637815097923,8883618307201,123732841202883,1723376158533153,24003533378261251,334326091137124353,4656561742541479683,64857538304443591201,903348974519668797123,12582028104970919568513,175245044495073205162051,2440848594826053952700193,33996635283069682132640643,473512045368149495904268801,6595171999871023260527122563,91858895952826176151475447073,1279429371339695442860129136451,17820152302802910023890332463233
mov $2,1
lpb $0
sub $0,1
add $2,$3
add $2,$3
add $3,$2
lpe
pow $3,2
mov $0,$3
mul $0,2
add $0,1
| 41.75
| 487
| 0.823353
|
f314fb74da97f00c5425c76cc136d714ac823292
| 9,356
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_21829_60.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 9
|
2020-08-13T19:41:58.000Z
|
2022-03-30T12:22:51.000Z
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_21829_60.asm
|
ljhsiun2/medusa
|
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
|
[
"MIT"
] | 1
|
2021-04-29T06:29:35.000Z
|
2021-05-13T21:02:30.000Z
|
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xa0.log_21829_60.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 %r13
push %r14
push %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x14b5c, %r11
clflush (%r11)
nop
nop
xor $7968, %r13
movw $0x6162, (%r11)
nop
nop
nop
inc %rbp
lea addresses_UC_ht+0xea5c, %rsi
lea addresses_normal_ht+0x14bdc, %rdi
nop
nop
xor $10043, %rbp
mov $75, %rcx
rep movsq
nop
nop
xor %rcx, %rcx
lea addresses_D_ht+0x4afc, %rcx
nop
add $7962, %r14
mov $0x6162636465666768, %r13
movq %r13, %xmm0
vmovups %ymm0, (%rcx)
add %rcx, %rcx
lea addresses_WC_ht+0x12e5c, %rcx
xor $8738, %r14
and $0xffffffffffffffc0, %rcx
vmovaps (%rcx), %ymm4
vextracti128 $0, %ymm4, %xmm4
vpextrq $1, %xmm4, %rdi
nop
nop
nop
add %r13, %r13
lea addresses_WT_ht+0x1045c, %rsi
lea addresses_UC_ht+0x66dc, %rdi
nop
nop
nop
nop
sub $51155, %rbx
mov $114, %rcx
rep movsl
nop
nop
cmp $28778, %rcx
lea addresses_WT_ht+0x1eeb8, %r11
nop
nop
nop
nop
add $57789, %r14
movb $0x61, (%r11)
nop
nop
nop
inc %rsi
lea addresses_normal_ht+0x1e5dc, %rcx
nop
nop
nop
cmp %rbp, %rbp
movups (%rcx), %xmm7
vpextrq $1, %xmm7, %rbx
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_UC_ht+0xe05c, %r11
nop
nop
dec %rdi
mov $0x6162636465666768, %rbx
movq %rbx, %xmm5
and $0xffffffffffffffc0, %r11
vmovntdq %ymm5, (%r11)
nop
nop
nop
xor $8253, %r14
lea addresses_WT_ht+0xd05c, %rsi
lea addresses_UC_ht+0xcc5c, %rdi
nop
nop
nop
cmp %rbx, %rbx
mov $17, %rcx
rep movsw
nop
nop
nop
nop
nop
xor $26289, %rsi
lea addresses_normal_ht+0xab0c, %r11
nop
add $62000, %rbp
movups (%r11), %xmm4
vpextrq $1, %xmm4, %rsi
nop
nop
nop
add %r14, %r14
lea addresses_UC_ht+0xf05c, %rsi
lea addresses_UC_ht+0x15c5c, %rdi
nop
nop
and %r11, %r11
mov $65, %rcx
rep movsb
nop
nop
nop
xor $4058, %rcx
lea addresses_WT_ht+0x985c, %r13
nop
nop
and %rsi, %rsi
mov (%r13), %rbx
nop
nop
nop
sub $49862, %rbx
lea addresses_WC_ht+0x1a85c, %rcx
and %r11, %r11
movb $0x61, (%rcx)
nop
nop
nop
nop
cmp %r11, %r11
lea addresses_WT_ht+0x19a5c, %rbx
nop
nop
xor $19008, %rcx
movb $0x61, (%rbx)
nop
nop
nop
cmp %rsi, %rsi
lea addresses_WT_ht+0x1935c, %rbp
nop
nop
nop
nop
nop
sub $4108, %rdi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm4
vmovups %ymm4, (%rbp)
nop
nop
nop
nop
dec %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r13
push %r14
push %r8
push %rbp
push %rsi
// Store
lea addresses_A+0x19d5c, %rsi
sub $24845, %r12
mov $0x5152535455565758, %r13
movq %r13, %xmm2
and $0xffffffffffffffc0, %rsi
vmovntdq %ymm2, (%rsi)
nop
nop
nop
xor $4252, %rbp
// Store
lea addresses_WT+0x16c5c, %r14
nop
nop
nop
nop
nop
and %r10, %r10
mov $0x5152535455565758, %r8
movq %r8, %xmm7
vmovups %ymm7, (%r14)
nop
nop
nop
nop
nop
sub %rsi, %rsi
// Load
lea addresses_UC+0xf65c, %r10
clflush (%r10)
nop
nop
nop
nop
nop
sub $2475, %r14
mov (%r10), %si
nop
nop
xor %r13, %r13
// Store
lea addresses_RW+0x17240, %r14
nop
nop
nop
nop
nop
cmp $41888, %r8
movl $0x51525354, (%r14)
nop
nop
nop
add %rsi, %rsi
// Store
lea addresses_PSE+0x1cd1c, %r14
nop
nop
nop
nop
nop
cmp $51033, %r12
mov $0x5152535455565758, %rsi
movq %rsi, %xmm3
movups %xmm3, (%r14)
nop
nop
nop
nop
nop
sub $5008, %r8
// Faulty Load
lea addresses_WT+0x1585c, %rsi
nop
nop
nop
nop
nop
add $14028, %r14
movups (%rsi), %xmm3
vpextrq $0, %xmm3, %r10
lea oracles, %rbp
and $0xff, %r10
shlq $12, %r10
mov (%rbp,%r10,1), %r10
pop %rsi
pop %rbp
pop %r8
pop %r14
pop %r13
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 7, 'type': 'addresses_A', 'AVXalign': False, 'size': 32}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT', 'AVXalign': False, 'size': 32}}
{'src': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_UC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_RW', 'AVXalign': False, 'size': 4}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 16}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_WT', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 2}}
{'src': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 32}}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WC_ht', 'AVXalign': True, 'size': 32}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 8, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 6, 'type': 'addresses_UC_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1}}
{'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 11, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32}}
{'src': {'same': True, 'congruent': 5, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}}
{'src': {'NT': True, 'same': False, 'congruent': 11, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': True, 'congruent': 3, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 32}}
{'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
*/
| 29.329154
| 2,999
| 0.657012
|
b843f897692068d5de4851ca0391306ce23199c3
| 255
|
asm
|
Assembly
|
programs/oeis/017/A017424.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 22
|
2018-02-06T19:19:31.000Z
|
2022-01-17T21:53:31.000Z
|
programs/oeis/017/A017424.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 41
|
2021-02-22T19:00:34.000Z
|
2021-08-28T10:47:47.000Z
|
programs/oeis/017/A017424.asm
|
neoneye/loda
|
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
|
[
"Apache-2.0"
] | 5
|
2021-02-24T21:14:16.000Z
|
2021-08-09T19:48:05.000Z
|
; A017424: (11n+2)^12.
; 4096,23298085122481,36520347436056576,3379220508056640625,89762301673555234816,1176246293903439668001,9774779120406941925376,59091511031674153381441,282429536481000000000000,1126825030131969720661201
mul $0,11
add $0,2
pow $0,12
| 36.428571
| 201
| 0.862745
|
5fcf606df105c05ee4079bfcecd8c826ccd777d3
| 1,027
|
asm
|
Assembly
|
tests/devices/zx128_default_pages.asm
|
cizo2000/sjasmplus
|
615d7c0e09a44aa2a923095fc9ed6dca6ecae4a4
|
[
"BSD-3-Clause"
] | 220
|
2016-10-22T19:44:39.000Z
|
2022-03-29T20:57:04.000Z
|
tests/devices/zx128_default_pages.asm
|
ped7g/sjasmplus
|
487635c8057cd5594c372d9b70bc00a3f3a1ecc4
|
[
"BSD-3-Clause"
] | 153
|
2018-05-07T10:31:23.000Z
|
2022-03-30T04:35:59.000Z
|
tests/devices/zx128_default_pages.asm
|
ped7g/sjasmplus
|
487635c8057cd5594c372d9b70bc00a3f3a1ecc4
|
[
"BSD-3-Clause"
] | 51
|
2016-05-12T21:27:36.000Z
|
2022-03-27T15:16:16.000Z
|
DEVICE ZXSPECTRUM128
; expected default is SLOT 3, ORG 0, pages: 7, 5, 2, 0
DB "77" : ORG 0x4000 : DB "55" : ORG 0x8000 : DB "22" : ORG 0xC000 : DB "00"
ASSERT {0x0000} == "77" : ASSERT {0x4000} == "55" : ASSERT {0x8000} == "22" : ASSERT {0xC000} == "00"
; test default slot == 3 (does test also default mapping - difficult to test only slot :/ )
PAGE 0 : ASSERT {0xC000} == "00" : PAGE 5 : ASSERT {0xC000} == "55" : PAGE 2 : ASSERT {0xC000} == "22" : PAGE 7 : ASSERT {0xC000} == "77"
; test remaining pages for writing, and final test by reading all
SLOT 0
PAGE 1 : ASSERT {0} == 0 : ORG 0 : DB "11"
PAGE 3 : ASSERT {0} == 0 : ORG 0 : DB "33"
PAGE 4 : ASSERT {0} == 0 : ORG 0 : DB "44"
PAGE 6 : ASSERT {0} == 0 : ORG 0 : DB "66"
PAGE 0 : ASSERT {0} == "00" : PAGE 1 : ASSERT {0} == "11"
PAGE 2 : ASSERT {0} == "22" : PAGE 3 : ASSERT {0} == "33"
PAGE 4 : ASSERT {0} == "44" : PAGE 5 : ASSERT {0} == "55"
PAGE 6 : ASSERT {0} == "66" : PAGE 7 : ASSERT {0} == "77"
| 57.055556
| 141
| 0.532619
|
43d8ea1d49178758ff714e7db329a6c954e90307
| 666
|
asm
|
Assembly
|
oeis/192/A192937.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 11
|
2021-08-22T19:44:55.000Z
|
2022-03-20T16:47:57.000Z
|
oeis/192/A192937.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 9
|
2021-08-29T13:15:54.000Z
|
2022-03-09T19:52:31.000Z
|
oeis/192/A192937.asm
|
neoneye/loda-programs
|
84790877f8e6c2e821b183d2e334d612045d29c0
|
[
"Apache-2.0"
] | 3
|
2021-08-22T20:56:47.000Z
|
2021-09-29T06:26:12.000Z
|
; A192937: a(n) = 100*a(n-1) - (n-1) with a(1)=100.
; Submitted by Jamie Morken(s4)
; 100,9999,999898,99989797,9998979696,999897969595,99989796959494,9998979695949393,999897969594939292,99989796959493929191,9998979695949392919090,999897969594939291908989,99989796959493929190898888,9998979695949392919089888787,999897969594939291908988878686,99989796959493929190898887868585,9998979695949392919089888786858484,999897969594939291908988878685848383,99989796959493929190898887868584838282,9998979695949392919089888786858483828181,999897969594939291908988878685848382818080
add $0,1
mov $2,1
lpb $0
sub $0,1
mul $2,100
sub $2,1
add $1,$2
lpe
mov $0,$1
add $0,1
| 44.4
| 485
| 0.843844
|
a1d24da0964658657e692fd4f7c3ff7e2d15301d
| 22
|
asm
|
Assembly
|
test/asm/use-label-outside-section.asm
|
michealccc/rgbds
|
b51e1c7c2c4ce2769f01e016967d0115893a7a88
|
[
"MIT"
] | 522
|
2017-02-25T21:10:13.000Z
|
2020-09-13T14:26:18.000Z
|
test/asm/use-label-outside-section.asm
|
michealccc/rgbds
|
b51e1c7c2c4ce2769f01e016967d0115893a7a88
|
[
"MIT"
] | 405
|
2017-02-25T21:32:37.000Z
|
2020-09-13T16:43:29.000Z
|
test/asm/use-label-outside-section.asm
|
michealccc/rgbds
|
b51e1c7c2c4ce2769f01e016967d0115893a7a88
|
[
"MIT"
] | 84
|
2017-02-25T21:10:26.000Z
|
2020-09-13T14:28:25.000Z
|
lab:
PRINTLN lab-lab
| 7.333333
| 16
| 0.727273
|
b020ca229f3bfa891a58de4c7f6cf8b2692a94b2
| 3,981
|
asm
|
Assembly
|
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_2_1203.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_2_1203.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_2_1203.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 %r14
push %r15
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1edf3, %rbx
nop
nop
nop
nop
nop
and %r10, %r10
movl $0x61626364, (%rbx)
nop
nop
and %r14, %r14
lea addresses_UC_ht+0xeef3, %rsi
lea addresses_WT_ht+0x18a33, %rdi
nop
nop
nop
nop
and $44059, %r15
mov $84, %rcx
rep movsq
xor %r13, %r13
lea addresses_WT_ht+0x12bab, %rsi
lea addresses_WT_ht+0x98da, %rdi
nop
nop
nop
nop
add %r10, %r10
mov $15, %rcx
rep movsq
nop
dec %rsi
lea addresses_A_ht+0x71f3, %r15
nop
nop
nop
xor %rcx, %rcx
mov $0x6162636465666768, %r10
movq %r10, %xmm1
movups %xmm1, (%r15)
nop
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_normal_ht+0x69f3, %rsi
nop
nop
nop
nop
and %r15, %r15
mov (%rsi), %ebx
cmp %r13, %r13
lea addresses_A_ht+0x1a0f3, %rsi
lea addresses_D_ht+0x4603, %rdi
nop
nop
nop
nop
and %r10, %r10
mov $69, %rcx
rep movsl
nop
nop
cmp %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r13
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %r14
push %r15
push %r9
push %rcx
// Store
mov $0x2fc23600000009f3, %r15
nop
nop
nop
and %r10, %r10
movw $0x5152, (%r15)
nop
nop
nop
nop
cmp $1406, %r9
// Store
lea addresses_WT+0x46e3, %r11
nop
nop
nop
nop
nop
xor %r14, %r14
mov $0x5152535455565758, %r9
movq %r9, %xmm3
vmovups %ymm3, (%r11)
nop
nop
nop
nop
nop
cmp %r11, %r11
// Store
mov $0xc7, %rcx
nop
nop
nop
nop
nop
xor %r12, %r12
mov $0x5152535455565758, %r9
movq %r9, %xmm0
vmovups %ymm0, (%rcx)
cmp $47921, %r12
// Store
lea addresses_RW+0x12753, %r15
nop
nop
nop
nop
nop
and %rcx, %rcx
movw $0x5152, (%r15)
and $27240, %r9
// Store
lea addresses_normal+0xe9c1, %rcx
nop
sub $20268, %r11
movb $0x51, (%rcx)
nop
and $23841, %rcx
// Load
lea addresses_A+0x17d73, %r11
nop
add $55449, %r10
movb (%r11), %cl
nop
nop
add %r10, %r10
// Faulty Load
lea addresses_D+0x176f3, %r11
nop
nop
nop
nop
nop
sub %r12, %r12
mov (%r11), %r14
lea oracles, %r9
and $0xff, %r14
shlq $12, %r14
mov (%r9,%r14,1), %r14
pop %rcx
pop %r9
pop %r15
pop %r14
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_D'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 8, 'same': False, 'type': 'addresses_NC'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 4, 'same': False, 'type': 'addresses_WT'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 1, 'same': False, 'type': 'addresses_P'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 5, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7, 'same': False, 'type': 'addresses_A'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0, 'same': True, 'type': 'addresses_D'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 8, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 3, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 0, 'same': True, 'type': 'addresses_WT_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 8, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 4, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'36': 2}
36 36
*/
| 18.690141
| 149
| 0.643306
|
b8a9cf0ca47742387413c91c5dbb9cde0ed25874
| 2,088
|
asm
|
Assembly
|
programs/oeis/204/A204556.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/204/A204556.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
programs/oeis/204/A204556.asm
|
karttu/loda
|
9c3b0fc57b810302220c044a9d17db733c76a598
|
[
"Apache-2.0"
] | null | null | null |
; A204556: Left edge of the triangle A045975.
; 1,2,9,24,45,90,133,224,297,450,561,792,949,1274,1485,1920,2193,2754,3097,3800,4221,5082,5589,6624,7225,8450,9153,10584,11397,13050,13981,15872,16929,19074,20265,22680,24013,26714,28197,31200,32841,36162,37969,41624,43605,47610,49773,54144,56497,61250,63801,68952,71709,77274,80245,86240,89433,95874,99297,106200,109861,117242,121149,129024,133185,141570,145993,154904,159597,169050,174021,184032,189289,199874,205425,216600,222453,234234,240397,252800,259281,272322,279129,292824,299965,314330,321813,336864,344697,360450,368641,385112,393669,410874,419805,437760,447073,465794,475497,495000,505101,525402,535909,557024,567945,589890,601233,624024,635797,659450,671661,696192,708849,734274,747385,773720,787293,814554,828597,856800,871321,900482,915489,945624,961125,992250,1008253,1040384,1056897,1090050,1107081,1141272,1158829,1194074,1212165,1248480,1267113,1304514,1323697,1362200,1381941,1421562,1441869,1482624,1503505,1545410,1566873,1609944,1631997,1676250,1698901,1744352,1767609,1814274,1838145,1886040,1910533,1959674,1984797,2035200,2060961,2112642,2139049,2192024,2219085,2273370,2301093,2356704,2385097,2442050,2471121,2529432,2559189,2618874,2649325,2710400,2741553,2804034,2835897,2899800,2932381,2997722,3031029,3097824,3131865,3200130,3234913,3304664,3340197,3411450,3447741,3520512,3557569,3631874,3669705,3745560,3784173,3861594,3900997,3980000,4020201,4100802,4141809,4224024,4265845,4349690,4392333,4477824,4521297,4608450,4652761,4741592,4786749,4877274,4923285,5015520,5062393,5156354,5204097,5299800,5348421,5445882,5495389,5594624,5645025,5746050,5797353,5900184,5952397,6057050,6110181,6216672,6270729,6379074,6434065,6544280,6600213,6712314,6769197,6883200,6941041,7056962,7115769,7233624,7293405,7413210,7473973,7595744,7657497,7781250
mov $4,$0
add $4,1
mov $7,$0
lpb $4,1
mov $0,$7
sub $4,1
sub $0,$4
mov $2,2
mov $3,$0
div $3,2
add $2,$3
mov $5,$0
gcd $0,2
mul $5,2
mul $5,$3
div $5,$0
mov $6,$2
add $6,$5
sub $6,1
mov $3,$6
sub $3,1
mul $3,2
add $3,1
add $1,$3
lpe
| 72
| 1,767
| 0.801724
|
11afea067c270c166795df0fedbc0e09f47850a8
| 2,032
|
asm
|
Assembly
|
day_14/funcs.asm
|
macrat/30days-os
|
58514889afd889dbd9d3f95d35592d2f898e4aaa
|
[
"MIT"
] | 1
|
2020-01-10T03:04:01.000Z
|
2020-01-10T03:04:01.000Z
|
day_16/funcs.asm
|
macrat/30days-os
|
58514889afd889dbd9d3f95d35592d2f898e4aaa
|
[
"MIT"
] | null | null | null |
day_16/funcs.asm
|
macrat/30days-os
|
58514889afd889dbd9d3f95d35592d2f898e4aaa
|
[
"MIT"
] | null | null | null |
; functions
section .text
GLOBAL io_in8, io_out8
GLOBAL load_gdtr, load_idtr
GLOBAL asm_interrupt21, asm_interrupt2c, asm_interrupt20
GLOBAL is_available_address
io_in8: ; int io_in8(int port);
MOV EDX, [ESP + 4]
MOV EAX, 0
IN AL, DX
RET
io_out8: ; void io_out8(int port, int data);
MOV EDX, [ESP + 4]
MOV EAX, [ESP + 8]
OUT DX, AL
RET
load_gdtr: ; void load_gdtr(int limit, void* addr);
MOV AX, [ESP + 4]
MOV [ESP + 6], AX
LGDT [ESP + 6]
RET
load_idtr: ; void load_idtr(int limit, void* addr);
MOV AX, [ESP + 4]
MOV [ESP + 6], AX
LIDT [ESP + 6]
RET
EXTERN keyboard_interrupt
asm_interrupt21: ; void asm_interrupt21(void);
PUSH ES
PUSH DS
PUSHAD
MOV EAX, ESP
PUSH EAX
MOV AX, SS
MOV DS, AX
MOV ES, AX
CALL keyboard_interrupt
POP EAX
POPAD
POP DS
POP ES
IRETD
EXTERN mouse_interrupt
asm_interrupt2c: ; void asm_interrupt2c(void);
PUSH ES
PUSH DS
PUSHAD
MOV EAX, ESP
PUSH EAX
MOV AX, SS
MOV DS, AX
MOV ES, AX
CALL mouse_interrupt
POP EAX
POPAD
POP DS
POP ES
IRETD
EXTERN timer_interrupt
asm_interrupt20: ; void asm_interrupt20(void);
PUSH ES
PUSH DS
PUSHAD
MOV EAX, ESP
PUSH EAX
MOV AX, SS
MOV DS, AX
MOV ES, AX
CALL timer_interrupt
POP EAX
POPAD
POP DS
POP ES
IRETD
is_available_address: ; bool is_available_address(void* address)
MOV EAX, [ESP+4]
MOV DWORD [EAX], 0xaa55aa55
XOR DWORD [EAX], 0xffffffff
CMP DWORD [EAX], 0x55aa55aa
JNE mem_unavail
XOR DWORD [EAX], 0xffffffff
CMP DWORD [EAX], 0xaa55aa55
JNE mem_unavail
MOV EAX, 1 ; return true
RET
mem_unavail:
MOV EAX, 0 ; return false
RET
| 20.734694
| 65
| 0.549705
|
2386e3bb5cd2d4b6cc079542d91ab217f0396dcd
| 16,369
|
asm
|
Assembly
|
cmd/debug/debuasm.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
cmd/debug/debuasm.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
cmd/debug/debuasm.asm
|
minblock/msdos
|
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
|
[
"Apache-2.0"
] | null | null | null |
PAGE 80,132 ;
TITLE DEBUASM.ASM
;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1991
; * All Rights Reserved.
; */
; Code for the UASSEMble command in the debugger
IF1
%OUT COMPONENT=DEBUG, MODULE=DEBUASM
ENDIF
.XLIST
.XCREF
include version.inc ; cas -- missing equates
INCLUDE DOSSYM.INC
INCLUDE debug.inc
.CREF
.LIST
CODE SEGMENT PUBLIC BYTE
CODE ENDS
CONST SEGMENT PUBLIC BYTE
EXTRN SYNERR_PTR:BYTE,UNASSEM_LN_PTR:WORD
EXTRN NSEG:WORD,SISAVE:WORD,BPSAVE:WORD,DISAVE:WORD
EXTRN BXSAVE:WORD,DSSAVE:WORD,ESSAVE:WORD,CSSAVE:WORD,IPSAVE:WORD
EXTRN SSSAVE:WORD,CXSAVE:WORD,SPSAVE:WORD,FLSAVE:WORD
EXTRN DISTAB:WORD,SHFTAB:WORD,IMMTAB:WORD,GRP1TAB:WORD,GRP2TAB:WORD
EXTRN DBMN:BYTE,ESCMN:BYTE,DISPB:WORD,STACK:BYTE,REG8:BYTE
EXTRN REG16:BYTE,SREG:BYTE,SIZ8:BYTE,SEGTAB:WORD,M8087_TAB:BYTE
EXTRN FI_TAB:BYTE,SIZE_TAB:BYTE,MD9_TAB:BYTE,MD9_TAB2:BYTE
EXTRN MDB_TAB:BYTE,MDB_TAB2:BYTE,MDD_TAB:BYTE,MDD_TAB2:BYTE
EXTRN MDF_TAB:BYTE
CONST ENDS
CSTACK SEGMENT STACK
CSTACK ENDS
DATA SEGMENT PUBLIC BYTE
EXTRN DISADD:BYTE,DISCNT:WORD,BYTCNT:BYTE,TEMP:BYTE,AWORD:BYTE
EXTRN MIDFLD:BYTE,MODE:BYTE,REGMEM:BYTE,OPCODE:WORD,OPBUF:BYTE
EXTRN INDEX:WORD,ARG_BUF:BYTE,ARG_BUF_PTR:BYTE,ARG_BUF_INDEX:WORD
EXTRN OPBUF:BYTE,OPCODE:WORD
DATA ENDS
DG GROUP CODE,CONST,CSTACK,DATA
CODE SEGMENT PUBLIC BYTE
ASSUME CS:DG,DS:DG,ES:DG,SS:DG
PUBLIC UNASSEM
PUBLIC DISASLN,MEMIMM,JMPCALL,SIGNIMM,ALUFROMREG,WORDTOALU
PUBLIC GRP2,PREFIX,OUTVARW,GRP1,SSPRE,MOVSEGTO,DSPRE,SHIFT
PUBLIC ESPRE,IMMED,CSPRE,OUTVARB,CHK10,ACCIMM,INT3,INVARB
PUBLIC MOVSEGFROM,LOADACC,OUTFIXB,XCHGAX,REGIMMW,SHORTJMP
PUBLIC SAV8,M8087,M8087_DB,M8087_DF,M8087_D9,M8087_DD
PUBLIC SAV16,SAVHEX,INFIXW,REGIMMB,OUTFIXW,SHIFTV,LONGJMP
PUBLIC INVARW,STOREACC,INFIXB,NOOPERANDS,ALUTOREG
PUBLIC SEGOP,REGOP,GETADDR
EXTRN CRLF:NEAR,BLANK:NEAR,TAB:NEAR,STD_PRINTF:NEAR
EXTRN HEX:NEAR,DEFAULT:NEAR,OUTSI:NEAR,OUTDI:NEAR
EXTRN HEX_ADDRESS_ONLY:NEAR
UNASSEM:
MOV BP,[CSSAVE] ; Default code segment
MOV DI,OFFSET DG:DISADD ; Default address
MOV CX,DISPB ; Default length
SHR CX,1
SHR CX,1
CALL DEFAULT
MOV WORD PTR [DISADD],DX ; Displacement of disassembly
MOV WORD PTR [DISADD+2],AX ; Segment
MOV WORD PTR [DISCNT],CX ; No. of bytes (but whole instructions)
DISLP:
CALL DISASLN ; Disassemble one line
CALL CRLF
TEST [DISCNT],-1 ; See if we've used up the range
JNZ DISLP
RET
GOTDIS:
PUSH DS ; RE-GET LAST BYTE
PUSH SI
LDS SI,DWORD PTR [DISADD]
MOV AL,[SI-1]
POP SI
POP DS
RET
GETDIS:
PUSH DS
LDS SI,DWORD PTR [DISADD]
LODSB ; Get the next byte of code
POP DS
MOV WORD PTR [DISADD],SI ; Update pointer
PUSH AX
PUSH DI
MOV DI,[ARG_BUF_INDEX]
CALL HEX ; Display each code byte
MOV [ARG_BUF_INDEX],DI
POP DI
MOV SI,[DISCNT]
OR SI,SI ; Check if range exhausted
JZ ENDRNG ; If so, don't wrap around
DEC SI ; Count off the bytes
MOV [DISCNT],SI
ENDRNG:
INC BYTE PTR[BYTCNT] ; Keep track of no. of bytes per line
POP AX
RET
DSPRE:
INC BYTE PTR [NSEG+1]
SSPRE:
INC BYTE PTR [NSEG+1]
CSPRE:
INC BYTE PTR [NSEG+1]
ESPRE:
INC BYTE PTR [NSEG+1]
PREFIX:
POP BX ; Dump off return address
CALL FINLN
CALL CRLF
DISASLN:
PUSH DS
LDS SI,DWORD PTR [DISADD]
CALL OUTSI ; Show disassembly address
POP DS
CALL HEX_ADDRESS_ONLY
DISASLN1:
MOV BYTE PTR [BYTCNT],0 ; Count of code bytes per line
; Fill overflow area with zeros
MOV DI,OFFSET DG:OPBUF
MOV CX,50
MOV AL,0
REP STOSB
; fill buffer with spaces
MOV DI,OFFSET DG:OPBUF
MOV CX,OPBUFLEN
MOV AL," "
REP STOSB
MOV DI,OFFSET DG:ARG_BUF
MOV [ARG_BUF_INDEX],DI
CALL GETDIS ; Get opcode
MOV DI,[ARG_BUF_INDEX]
MOV AH,0
MOV BX,AX
AND AL,1 ; Mask to "W" bit
MOV [AWORD],AL
MOV AL,BL ; Restore opcode
SHL BX,1
SHL BX,1 ; Multiply opcode by 4
ADD BX,OFFSET DG:DISTAB
MOV DX,[BX] ; Get pointer to mnemonic from table
MOV [OPCODE],DX
MOV [ARG_BUF_INDEX],DI
MOV DI,OFFSET DG:OPBUF
CALL WORD PTR [BX+2]
FINLN:
MOV AH,[BYTCNT] ; See how many bytes in this instruction
ADD AH,AH ; Each uses two characters
MOV AL,14 ; Amount of space we want to use
SUB AL,AH ; See how many fill characters needed
CBW
XCHG CX,AX ; Parameter for TAB needed in CX
MOV DI,[ARG_BUF_INDEX]
CALL TAB
MOV SI,[OPCODE]
OR SI,SI
JZ GET_TAB
GET_OPCODE:
LODSB
OR AL,AL
JZ GET_TAB
STOSB
JMP GET_OPCODE
GET_TAB:
MOV AL,9
STOSB
MOV BYTE PTR [DI],0 ; nul terminate address buffer
MOV DX,OFFSET DG:UNASSEM_LN_PTR
CALL STD_PRINTF
RET
GETMODE:
CALL GETDIS ; Get the address mode byte
MOV AH,AL
AND AL,7 ; Mask to "r/m" field
MOV [REGMEM],AL
SHR AH,1
SHR AH,1
SHR AH,1
MOV AL,AH
AND AL,7 ; Mask to center 3-bit field
MOV [MIDFLD],AL
SHR AH,1
SHR AH,1
SHR AH,1
MOV [MODE],AH ; Leaving 2-bit "MOD" field
RET
IMMED:
MOV BX,OFFSET DG:IMMTAB
CALL GETMNE
FINIMM:
CALL TESTREG
JMP SHORT IMM
MEMIMM:
CALL GETMODE
JMP SHORT FINIMM
ACCIMM:
XOR AL,AL
IMM1:
CALL SAVREG
IMM:
MOV AL,","
STOSB
TEST BYTE PTR [AWORD],-1
JNZ SAV16
SAV8:
CALL GETDIS
JMP SHORT SAVHEX
LONGJMP:
PUSH DI
MOV DI,OFFSET DG:TEMP
CALL SAV16
POP DI
CALL SAV16
MOV AL,":"
STOSB
MOV SI,OFFSET DG:TEMP
MOV CX,4
MOVDIG:
LODSB
STOSB
LOOP MOVDIG
RET
SAV16:
CALL GETDIS ; Get low byte
MOV DL,AL
CALL GETDIS ; Get high byte
MOV DH,AL
CALL SAVHEX ; Convert and store high byte
MOV AL,DL
SAVHEX:
MOV AH,AL
SHR AL,1
SHR AL,1
SHR AL,1
SHR AL,1
CALL SAVDIG
MOV AL,AH
SAVDIG:
AND AL,0FH
ADD AL,90H
DAA
ADC AL,40H
DAA
STOSB
RET
CHK10:
CALL GETDIS
CMP AL,10
JNZ SAVHEX
RET
SIGNIMM:
MOV BX,OFFSET DG:IMMTAB
CALL GETMNE
CALL TESTREG
MOV AL,","
STOSB
SAVD8:
CALL GETDIS ; Get signed 8-bit number
CBW
MOV DX,AX ; Save true 16-bit value in DX
MOV AH,AL
MOV AL,"+"
OR AH,AH
; JZ NOSIGN
JNS POSITIV ; OK if positive
MOV AL,"-"
NEG AH ; Get magnitude if negative
POSITIV:
STOSB
; NOSIGN:
MOV AL,AH
JMP SHORT SAVHEX
ALUFROMREG:
CALL GETADDR
MOV AL,","
STOSB
REGFLD:
MOV AL,[MIDFLD]
SAVREG:
MOV SI,OFFSET DG:REG8
CMP BYTE PTR [AWORD],1
JNE FNDREG
SAVREG16:
MOV SI,OFFSET DG:REG16
FNDREG:
CBW
ADD SI,AX
ADD SI,AX
MOVSW
RET
SEGOP:
SHR AL,1
SHR AL,1
SHR AL,1
SAVSEG:
AND AL,3
MOV SI,OFFSET DG:SREG
JMP SHORT FNDREG
REGOP:
AND AL,7
JMP SHORT SAVREG16
MOVSEGTO:
MOV BYTE PTR [AWORD],1
CALL GETADDR
MOV AL,","
STOSB
MOV AL,[MIDFLD]
JMP SHORT SAVSEG
MOVSEGFROM:
CALL GETMODE
CALL SAVSEG
MOV BYTE PTR [AWORD],1
JMP SHORT MEMOP2
GETADDR:
CALL GETMODE
JMP SHORT ADDRMOD
WORDTOALU:
MOV BYTE PTR [AWORD],1
ALUTOREG:
CALL GETMODE
CALL REGFLD
MEMOP2:
MOV AL,","
STOSB
ADDRMOD:
CMP BYTE PTR [MODE],3
MOV AL,[REGMEM]
JE SAVREG
XOR BX,BX
MOV BYTE PTR [NSEG],3
MOV BYTE PTR [DI],"["
INC DI
CMP AL,6
JNE NODRCT
CMP BYTE PTR [MODE],0
JE DIRECT ; Mode=0 and R/M=6 means direct addr.
NODRCT:
MOV DL,AL
CMP AL,1
JBE USEBX
CMP AL,7
JE USEBX
CMP AL,3
JBE USEBP
CMP AL,6
JNE CHKPLS
USEBP:
MOV BX,[BPSAVE]
MOV BYTE PTR [NSEG],2 ; Change default to Stack Segment
MOV AX,BPREG
SAVBASE:
STOSW
CHKPLS:
CMP DL,4
JAE NOPLUS
MOV AL,"+"
STOSB
NOPLUS:
CMP DL,6
JAE DOMODE ; No index register
AND DL,1 ; Even for SI, odd for DI
JZ USESI
ADD BX,[DISAVE]
MOV AX,DIREG
SAVINDX:
STOSW
DOMODE:
MOV AL,[MODE]
OR AL,AL
JZ CLOSADD ; If no displacement, then done
CMP AL,2
JZ ADDDIR
CALL SAVD8 ; Signed 8-bit displacement
ADDCLOS:
ADD BX,DX
CLOSADD:
MOV AL,"]"
STOSB
MOV [INDEX],BX
NOOPERANDS:
RET
ADDDIR:
MOV AL,"+"
STOSB
DIRECT:
CALL SAV16
JMP SHORT ADDCLOS
USEBX:
MOV BX,[BXSAVE]
MOV AX,BXREG
JMP SHORT SAVBASE
USESI:
ADD BX,[SISAVE]
MOV AX,SIREG
JMP SHORT SAVINDX
SHORTJMP:
CALL GETDIS
CBW
ADD AX,WORD PTR [DISADD]
XCHG DX,AX
SAVJMP:
MOV AL,DH
CALL SAVHEX
MOV AL,DL
JMP SAVHEX
JMPCALL:
CALL GETDIS
MOV DL,AL
CALL GETDIS
MOV DH,AL
ADD DX,WORD PTR [DISADD]
JMP SHORT SAVJMP
XCHGAX:
AND AL,7
CALL SAVREG16
MOV AL,","
STOSB
XOR AL,AL
JMP SAVREG16
LOADACC:
XOR AL,AL
CALL SAVREG
MOV AL,","
STOSB
MEMDIR:
MOV AL,"["
STOSB
XOR BX,BX
MOV BYTE PTR [NSEG],3
JMP DIRECT
STOREACC:
CALL MEMDIR
MOV AL,","
STOSB
XOR AL,AL
JMP SAVREG
REGIMMB:
MOV BYTE PTR [AWORD],0
JMP SHORT REGIMM
REGIMMW:
MOV BYTE PTR [AWORD],1
REGIMM:
AND AL,7
JMP IMM1
INT3:
MOV BYTE PTR [DI],"3"
INC DI
RET
; 8087 instructions whose first byte is 0dfh
M8087_DF:
CALL GET64F
JZ ISDD3
MOV SI,OFFSET DG:MDF_TAB
JMP short NODB3
; 8087 instructions whose first byte is 0ddh
M8087_DD:
CALL GET64F
JZ ISDD3
MOV SI,OFFSET DG:MDD_TAB
JMP short NOD93
ISDD3:
MOV AL,DL
TEST AL,100B
JZ ISSTI
JMP ESC0
ISSTI:
AND AL,11B
MOV SI,OFFSET DG:MDD_TAB2
MOV CL,AL
CALL MOVBYT
JMP short PUTRST
; 8087 instructions whose first byte is 0dbh
M8087_DB:
CALL GET64F
JZ ISDB3
MOV SI,OFFSET DG:MDB_TAB
NODB3:
CALL PUTOP
CALL PUTSIZE
JMP ADDRMOD
ISDB3:
MOV AL,DL
TEST AL,100B
JNZ ISDBIG
ESC0V:
JMP ESC0
ISDBIG:
CALL GOTDIS
AND AL,11111B
CMP AL,4
JAE ESC0V
MOV SI,OFFSET DG:MDB_TAB2
JMP short DOBIG
; 8087 instructions whose first byte is 0d9h
M8087_D9:
CALL GET64F
JZ ISD93
MOV SI,OFFSET DG:MD9_TAB
NOD93:
CALL PUTOP
AND AL,111B
CMP AL,3
JA NOSHO
MOV AL,DL
CALL PUTSIZE
NOSHO:
JMP ADDRMOD
ISD93:
MOV AL,DL
TEST AL,100B
JNZ ISD9BIG
AND AL,111B
OR AL,AL
JNZ NOTFLD
MOV AX,"DL"
STOSW
JMP SHORT PUTRST
NOTFLD:
CMP AL,1
JNZ NOTFXCH
MOV AX,"CX"
STOSW
MOV AL,"H"
JMP SHORT PUTRST1
NOTFXCH:
CMP AL,3
JNZ NOTFSTP
MOV AX,"TS"
STOSW
MOV AL,"P"
PUTRST1:
STOSB
PUTRST:
MOV AL,9
STOSB
JMP short PUTST0
NOTFSTP:
CALL GOTDIS
CMP AL,11010000B ; CHECK FOR FNOP
JZ GOTFNOP
JMP ESC0
GOTFNOP:
MOV AX,"ON"
STOSW
MOV AL,"P"
STOSB
RET
ISD9BIG:
CALL GOTDIS ; GET THE MODE BYTE
MOV SI,OFFSET DG:MD9_TAB2
DOBIG:
AND AL,11111B
MOV CL,AL
JMP MOVBYT
; entry point for the remaining 8087 instructions
M8087:
CALL GET64
CALL PUTFI ; PUT FIRST PART OF OPCODE
MOV AL,DL
CMP BYTE PTR [MODE],11B ; CHECK FOR REGISTER MODE
JZ MODEIS3
CALL PUTMN ; PUT MIDDLE PART OF OPCODE
NO3:
MOV AL,9 ; OUTPUT A TAB
STOSB
MOV AL,DL
CALL PUTSIZE ; OUTPUT THE OPERAND SIZE
JMP ADDRMOD
MODEIS3:
TEST AL,100000B ; D BIT SET?
JZ MPUT ; NOPE...
TEST AL,000100B ; FDIV OR FSUB?
JZ MPUT ; NOPE...
XOR AL,1 ; REVERSE SENSE OF R
MOV DL,AL ; SAVE CHANGE
MPUT:
CALL PUTMN ; PUT MIDDLE PART OF OPCODE
MOV AL,DL
TEST AL,010000B
JZ NOPSH
MOV AL,"P"
STOSB
NOPSH:
MOV AL,9
STOSB
MOV AL,DL
AND AL,00000111B
CMP AL,2 ; FCOM
JZ PUTST0
CMP AL,3 ; FCOMP
JZ PUTST0
MOV AL,DL
TEST AL,100000B
JZ PUTSTST0
; output 8087 registers in the form st(n),st
PUTST0ST:
CALL PUTST0
MOV AL,','
ISCOMP:
STOSB
PUTST:
MOV AX,"TS"
STOSW
RET
; output 8087 registers in the form st,st(n)
PUTSTST0:
CALL PUTST
MOV AL,','
STOSB
PUTST0:
CALL PUTST
MOV AL,"("
STOSB
MOV AL,[REGMEM]
ADD AL,"0"
STOSB
MOV AL,")"
STOSB
RET
; output an 8087 mnemonic
PUTMN:
MOV SI,OFFSET DG:M8087_TAB
MOV CL,AL
AND CL,00000111B
JMP SHORT MOVBYT
; output either 'FI' or 'F' for first byte of opcode
PUTFI:
MOV SI,OFFSET DG:FI_TAB
JMP SHORT PUTFI2
; output size (dword, tbyte, etc.)
PUTSIZE:
MOV SI,OFFSET DG:SIZE_TAB
PUTFI2:
CMP BYTE PTR [MODE],11B ; check if 8087 register
JNZ PUTFI3
AND AL,111000B ; LOOK FOR INVALID FORM OF 0DAH OPERANDS
CMP AL,010000B
JZ ESC0PJ
MOV AL,DL
CMP AL,110011B ; FCOMPP
JNZ GOFI
CMP BYTE PTR [REGMEM],1
JZ GOFI
ESC0PJ:
jmp short ESC0P ; we could've reached without a
; ; double branch here, but we needed
; ; a bridge for ESC0PJ
GOFI:
XOR CL,CL
JMP SHORT MOVBYT
; Look for qword
PUTFI3:
CMP AL,111101B
JZ GOTQU
CMP AL,111111B
JNZ NOTQU
GOTQU:
MOV CL,2
JMP SHORT MOVBYT
; look for tbyte
NOTQU:
CMP AL,011101B
JZ GOTTB
CMP AL,111100B
JZ GOTTB
CMP AL,111110B
JZ GOTTB
CMP AL,011111B
JNZ NOTTB
GOTTB:
MOV CL,5
JMP SHORT MOVBYT
NOTTB:
MOV CL,4
SHR AL,CL
MOV CL,AL
; SI POINTS TO A TABLE OF TEXT SEPARATED BY "$"
; CL = WHICH ELEMENT IN THE TABLE YOU WISH TO COPY TO [DI]
MOVBYT:
PUSH AX
INC CL
MOVBYT1:
DEC CL
JZ MOVBYT3
MOVBYT2:
LODSB
CMP AL,"$"
JZ MOVBYT1
JMP MOVBYT2
MOVBYT3:
LODSB
CMP AL,'$'
JZ MOVBYT5
CMP AL,'@' ; THIS MEANS RESVERED OP-CODE
JNZ MOVBYT4
POP AX
JMP SHORT ESC0P ; GO DO AN ESCAPE COMMAND
MOVBYT4:
STOSB
JMP MOVBYT3
MOVBYT5:
POP AX
RET
PUTOP:
AND AL,111B
MOV CL,AL
CALL MOVBYT
MOV AL,9
STOSB
MOV AL,DL
RET
GET64F:
CALL GET64
MOV AL,"F"
STOSB
CMP BYTE PTR [MODE],3
MOV AL,DL
RET
GET64:
AND AL,7
MOV DL,AL
CALL GETMODE
SHL DL,1
SHL DL,1
SHL DL,1
OR AL,DL
MOV DL,AL ; SAVE RESULT
RET
ESC0P:
POP DI ; CLEAN UP STACK
ESC0:
MOV WORD PTR [OPCODE],OFFSET DG:ESCMN
MOV AL,DL
MOV DI,OFFSET DG:OPBUF
JMP SHORT ESC1
ESCP:
CALL GET64
ESC1:
CALL SAVHEX
CMP BYTE PTR [MODE],3
JZ SHRTESC
MOV BYTE PTR [AWORD],1
JMP MEMOP2
SHRTESC:
MOV AL,","
STOSB
MOV AL,[REGMEM]
AND AL,7
JMP SAVREG
INVARW:
CALL PUTAX
JMP SHORT INVAR
INVARB:
CALL PUTAL
INVAR:
MOV AL,','
STOSB
JMP short PUTDX
INFIXW:
CALL PUTAX
JMP SHORT INFIX
INFIXB:
CALL PUTAL
INFIX:
MOV AL,','
STOSB
JMP SAV8
STOSW ;IS THIS DEAD CODE? EMK
RET
OUTVARB:
MOV BX,"LA"
JMP SHORT OUTVAR
OUTVARW:
MOV BX,"XA"
OUTVAR:
CALL PUTDX
OUTFV:
MOV AL,','
STOSB
MOV AX,BX
STOSW
RET
OUTFIXB:
MOV BX,"LA"
JMP SHORT OUTFIX
OUTFIXW:
MOV BX,"XA"
OUTFIX:
CALL SAV8
JMP OUTFV
PUTAL:
MOV AX,"A"+4C00H ; "AL"
JMP SHORT PUTX
PUTAX:
MOV AX,"A"+5800H ; "AX"
JMP SHORT PUTX
PUTDX:
MOV AX,"D"+5800H ; "DX"
PUTX:
STOSW
RET
SHFT:
MOV BX,OFFSET DG:SHFTAB
CALL GETMNE
TESTREG:
CMP BYTE PTR [MODE],3
JZ NOFLG
MOV SI,OFFSET DG:SIZE_TAB
MOV CL,3
TEST BYTE PTR [AWORD],-1
JNZ TEST_1
INC CL
TEST_1:
CALL MOVBYT
NOFLG:
JMP ADDRMOD
SHIFTV:
CALL SHFT
MOV AL,","
STOSB
MOV WORD PTR [DI],"C"+4C00H ; "CL"
ADD DI,2
RET
SHIFT:
CALL SHFT
MOV AX,"1,"
STOSW
RET
GETMNE:
CALL GETMODE
MOV DL,AL
CBW
SHL AX,1
ADD BX,AX
MOV AX,[BX]
MOV [OPCODE],AX
MOV AL,DL
RET
GRP1:
MOV BX,OFFSET DG:GRP1TAB
CALL GETMNE
OR AL,AL
JZ FINIMMJ
JMP TESTREG
FINIMMJ:
JMP FINIMM
GRP2:
MOV BX,OFFSET DG:GRP2TAB
CALL GETMNE
CMP AL,2
JB TESTREG
CMP AL,6
JAE INDIRECT
TEST AL,1
JZ INDIRECT
MOV AX,"AF" ; "FAR"
STOSW
MOV AX," R"
STOSW
INDIRECT:
JMP ADDRMOD
CODE ENDS
END UNASSEM
| 17.033299
| 71
| 0.612621
|
9b027ad42767229dec1db7277fa5c2515e92fe82
| 2,055
|
asm
|
Assembly
|
strings/strxmov.asm
|
euleryang/mysql-server-mysql-323-31
|
f9346bfa3055f2217fe183bcb182aa6f39bca4d9
|
[
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1
|
2020-03-31T15:03:51.000Z
|
2020-03-31T15:03:51.000Z
|
strings/strxmov.asm
|
euleryang/mysql-server-mysql-323-31
|
f9346bfa3055f2217fe183bcb182aa6f39bca4d9
|
[
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1
|
2020-03-31T15:04:54.000Z
|
2020-03-31T15:04:54.000Z
|
strings/strxmov.asm
|
euleryang/mysql-server-mysql-323-31
|
f9346bfa3055f2217fe183bcb182aa6f39bca4d9
|
[
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null |
; Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
;
; This library is free software; you can redistribute it and/or
; modify it under the terms of the GNU Library General Public
; License as published by the Free Software Foundation; either
; version 2 of the License, or (at your option) any later version.
;
; This library is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
; Library General Public License for more details.
;
; You should have received a copy of the GNU Library General Public
; License along with this library; if not, write to the Free
; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
; MA 02111-1307, USA
TITLE Optimized strxmov for MSDOS / Intel 8086
ifndef M_I386
.8087
DOSSEG
.MODEL LARGE
.CODE
PUBLIC _strxmov
_strxmov PROC
mov bx,sp
add bx,4
push si
push di
mov cx,ds ; Save ds
ASSUME DS: NOTHING
ASSUME ES: NOTHING
les di,DWORD PTR ss:[bx] ; dst
jmp next_str
start_str:
mov al,ds:[si]
movsb ; move arg
and al,al
jnz start_str ; Not last
dec di
next_str:
add bx,4
lds si,DWORD PTR ss:[bx]
mov ax,ds
or ax,si
jnz start_str
mov byte ptr es:[di],0 ; Force end null (if no source)
mov ds,cx
mov ax,di ; Return ptr to last 0
mov dx,es
pop di
pop si
ret
_strxmov ENDP
else
include macros.asm
begcode strxmov
public _strxmov
_strxmov PROC near
ASSUME DS: NOTHING
ASSUME ES: NOTHING
push EBP
mov EBP,ESP
mov EDX,EBX ; Save EBX
mov ECX,ESI ; Save ESI
push EDI
mov EDI,8[EBP] ; Get destination
lea EBX,8[EBP] ; Get adress to first source - 4
xor al,al
jmp next_str
start_str: movsb
cmp AL,[EDI-1]
jne start_str
dec EDI ; Don't copy last null
next_str: add EBX,4
mov ESI,[EBX]
or ESI,ESI
jne start_str
mov byte ptr [EDI],0 ; Force last null
mov EAX,EDI ; Return ptr to null
pop EDI
mov ESI,ECX
mov EBX,EDX
pop EBP
ret
_strxmov endp
endcode strxmov
endif
END
| 19.759615
| 69
| 0.714355
|
ddaed99b3ae49590352bc4a8fe7e0b0b6cf1d9dc
| 1,799
|
asm
|
Assembly
|
cpu/speed_change_timing_fine/main.asm
|
AntonioND/gbc-hw-tests
|
631e60000c885154a8526df0b148847f9c34ce42
|
[
"MIT"
] | 6
|
2018-07-21T12:11:21.000Z
|
2021-07-23T16:32:47.000Z
|
cpu/speed_change_timing_fine/main.asm
|
PMArkive/gbc-hw-tests
|
631e60000c885154a8526df0b148847f9c34ce42
|
[
"MIT"
] | null | null | null |
cpu/speed_change_timing_fine/main.asm
|
PMArkive/gbc-hw-tests
|
631e60000c885154a8526df0b148847f9c34ce42
|
[
"MIT"
] | 3
|
2016-04-26T07:45:34.000Z
|
2018-12-30T05:45:14.000Z
|
INCLUDE "hardware.inc"
INCLUDE "header.inc"
SECTION "Main",HOME
;--------------------------------------------------------------------------
;- Main() -
;--------------------------------------------------------------------------
Main:
ld hl,$A000
; -------------------------------------------------------
ld a,$0A
ld [$0000],a ; enable ram
; -------------------------------------------------------
ld a,0
ld [rIF],a
ld a,IEF_TIMER
ld [rIE],a
di
ld a,0
ld [rTMA],a
ld [rTIMA],a
ld [rDIV],a
ld a,TACF_STOP|TACF_4KHZ
ld [rTAC],a
ld a,TACF_START|TACF_4KHZ
ld [rTAC],a
ld a,$7F
ld [rTIMA],a
ld [rDIV],a
ei
; -----------------------
ld a,[rIE]
ld b,a ; save IE
xor a,a
ld [rIE],a
ld a,$30
ld [rP1],a
ld a,$01
ld [rKEY1],a
stop ; switch
ld a,b
ld [rIE],a ; restore IE
ld a,[rTIMA]
ld [hl+],a
xor a,a
REPT 256
inc a
ENDR
REPT 1000
nop
ENDR
; -----------------------
di
ld a,0
ld [rIF],a
ld a,IEF_TIMER
ld [rIE],a
ld a,0
ld [rTMA],a
ld [rTIMA],a
ld [rDIV],a
ld a,TACF_STOP|TACF_4KHZ
ld [rTAC],a
ld a,TACF_START|TACF_4KHZ
ld [rTAC],a
ld a,$7F
ld [rTIMA],a
ld [rDIV],a
ei
; -----------------------
ld a,[rIE]
ld b,a ; save IE
xor a,a
ld [rIE],a
ld a,$30
ld [rP1],a
ld a,$01
ld [rKEY1],a
stop ; switch
ld a,b
ld [rIE],a ; restore IE
ld a,[rTIMA]
ld [hl+],a
xor a,a
REPT 256
inc a
ENDR
REPT 1000
nop
ENDR
; -------------------------------------------------------
push hl ; magic number
ld [hl],$12
inc hl
ld [hl],$34
inc hl
ld [hl],$56
inc hl
ld [hl],$78
pop hl
ld a,$00
ld [$0000],a ; disable ram
; -------------------------------------------------------
.endloop:
halt
jr .endloop
| 12.58042
| 75
| 0.397443
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.