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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2991587c5afb1e6407792e40612d63ebab9b94f3 | 2,184 | asm | Assembly | Working Disassembly/Levels/MHZ/Misc Object Data/Map - Pulley Lift.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | 5 | 2021-07-09T08:17:56.000Z | 2022-02-27T19:57:47.000Z | Working Disassembly/Levels/MHZ/Misc Object Data/Map - Pulley Lift.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | Working Disassembly/Levels/MHZ/Misc Object Data/Map - Pulley Lift.asm | TeamASM-Blur/Sonic-3-Blue-Balls-Edition | 7e8a2c5df02271615ff4cae529521e6b1560d6b1 | [
"Apache-2.0"
] | null | null | null | dc.w word_3E730-Map_MHZPulleyLift
dc.w word_3E768-Map_MHZPulleyLift
dc.w word_3E794-Map_MHZPulleyLift
dc.w word_3E7A8-Map_MHZPulleyLift
dc.w word_3E7B6-Map_MHZPulleyLift
dc.w word_3E812-Map_MHZPulleyLift
dc.w word_3E81A-Map_MHZPulleyLift
dc.w word_3E822-Map_MHZPulleyLift
word_3E730: dc.w 9 ; DATA XREF: ROM:0003E720o
dc.b $D0, 3, $48, $A, $FF, $F6
dc.b $D0, 3, $40, $A, 0, 2
dc.b $F0, 3, $48, $A, $FF, $F6
dc.b $F0, 3, $40, $A, 0, 2
dc.b $10, $C, $20, $E, $FF, $F0
dc.b $18, $D, $60, $12, $FF, $F0
dc.b $28, $C, $20, $E, $FF, $F0
dc.b $28, 2, $20, $30, $FF, $E8
dc.b $28, 2, $28, $30, 0, $10
word_3E768: dc.w 7 ; DATA XREF: ROM:0003E720o
dc.b $F0, 3, $48, $A, $FF, $F6
dc.b $F0, 3, $40, $A, 0, 2
dc.b $10, $C, $20, $E, $FF, $F0
dc.b $18, $D, $60, $12, $FF, $F0
dc.b $28, $C, $20, $E, $FF, $F0
dc.b $28, 2, $20, $30, $FF, $E8
dc.b $28, 2, $28, $30, 0, $10
word_3E794: dc.w 3 ; DATA XREF: ROM:0003E720o
dc.b $E0, 2, $40, $A, $FF, $FA
dc.b $F8, 2, $40, $A, $FF, $FA
dc.b $10, $B, 0, $1C, $FF, $F4
word_3E7A8: dc.w 2 ; DATA XREF: ROM:0003E720o
dc.b $F8, 2, $40, $A, $FF, $FA
dc.b $10, $B, 0, $1C, $FF, $F4
word_3E7B6: dc.w $F ; DATA XREF: ROM:0003E720o
dc.b $F0, $C, $20, $E, $FF, $F0
dc.b $F8, $D, $60, $12, $FF, $F0
dc.b 8, $C, $20, $E, $FF, $F0
dc.b $F0, 4, $20, $1A, $FF, $D0
dc.b $F0, 4, $28, $1A, 0, $20
dc.b $F8, $D, $60, $28, $FF, $D2
dc.b $F8, $D, $60, $28, 0, $E
dc.b $F8, 1, $20, 0, $FF, $CA
dc.b $F8, 1, $28, 0, 0, $2E
dc.b $E8, 5, $40, 2, $FF, $CC
dc.b $E8, $C, $40, 6, $FF, $DC
dc.b $E8, $C, $48, 6, 0, 4
dc.b $E8, 5, $48, 2, 0, $24
dc.b $F2, 2, $40, $A, $FF, $C8
dc.b $F2, 2, $48, $A, 0, $30
word_3E812: dc.w 1 ; DATA XREF: ROM:0003E720o
dc.b 0, 8, $20, $33, $FF, $F4
word_3E81A: dc.w 1 ; DATA XREF: ROM:0003E720o
dc.b 0, 8, $28, $33, $FF, $F4
word_3E822: dc.w 3 ; DATA XREF: ROM:0003E720o
dc.b $D0, 3, $40, $A, $FF, $FA
dc.b $F0, 3, $40, $A, $FF, $FA
dc.b $10, $B, 0, $1C, $FF, $F4
| 37.655172 | 49 | 0.475733 |
198f6a0438565b508f1b0ad35e806de23314cdf6 | 9,872 | asm | Assembly | src/cm_gamestate.asm | spannerisms/lttphack | 8309fecd1b73db4d81616ec500253ae1aa52b399 | [
"MIT"
] | 6 | 2020-02-14T17:14:52.000Z | 2021-12-06T19:51:25.000Z | src/cm_gamestate.asm | spannerisms/lttphack | 8309fecd1b73db4d81616ec500253ae1aa52b399 | [
"MIT"
] | 1 | 2020-09-26T07:40:33.000Z | 2020-09-26T07:40:33.000Z | src/cm_gamestate.asm | spannerisms/lttphack | 8309fecd1b73db4d81616ec500253ae1aa52b399 | [
"MIT"
] | 7 | 2019-12-02T21:51:51.000Z | 2021-07-03T17:53:04.000Z | GAMESTATE_SUBMENU:
%menu_header("GAME STATE", 11)
;===================================================================================================
%func("Skip text", this)
LDA.b #$04
STA.w $1CD4
RTL
;===================================================================================================
%func("Remove sprites", this)
SEP #$30
LDA.b #$21 : STA.w $012F
JML Sprite_DisableAll
;===================================================================================================
%submenu("Reset dungeons", cm_game_reset_dungeons_submenu)
%submenu("Toggle bosses defeated", cm_game_state_bosses_submenu)
%submenu("Pendants and crystals", cm_game_state_crystals_submenu)
%submenu("Game flags", cm_game_state_game_flags_submenu)
%submenu("Drops", cm_game_state_drops_submenu)
;===================================================================================================
%choice_long_func_here("Follower", $7EF3CC, 15, $00D463)
%list_item("None")
%list_item("Zelda")
%list_item("Garbage")
%list_item("Trash")
%list_item("Old man")
%list_item("Zelda text")
%list_item("Blind")
%list_item("Frog")
%list_item("Dwarf")
%list_item("Sign man")
%list_item("Kiki")
%list_item("??????")
%list_item("Purple chest")
%list_item("Super bomb")
%list_item("Sasha text")
;===================================================================================================
%toggle_bit_long_customtext_here("World", $7EF3CA, 6)
%list_item("Dark World")
%list_item("Light World")
;===================================================================================================
%choice_long_here("Progress", $7EF3C5, 4)
%list_item("Started")
%list_item("Uncle")
%list_item("Zelda")
%list_item("Agahnim")
;===================================================================================================
%choice_long_here("Map indicator", $7EF3C7, 9)
%list_item("Castle")
%list_item("Kakariko")
%list_item("Sahasrahla")
%list_item("Pendants")
%list_item("Pedestal")
%list_item("Tower")
%list_item("Darkness")
%list_item("Crystals")
%list_item("GTower")
;===================================================================================================
cm_game_state_bosses_submenu:
%menu_header("BOSSES DEFEATED", 12)
%toggle_bit_long_customtext("Armos", $7EF191, 3, bossalivetext)
%toggle_bit_long_customtext("Lanmola", $7EF067, 3, bossalivetext)
%toggle_bit_long_customtext("Moldorm", $7EF00F, 3, bossalivetext)
%toggle_bit_long_customtext("Agahnim", $7EF041, 3, bossalivetext)
%toggle_bit_long_customtext("Helmasaur", $7EF0B5, 3, bossalivetext)
%toggle_bit_long_customtext("Blind", $7EF159, 3, bossalivetext)
%toggle_bit_long_customtext("Mothula", $7EF053, 3, bossalivetext)
%toggle_bit_long_customtext("Kholdstare", $7EF1BD, 3, bossalivetext)
%toggle_bit_long_customtext("Arrghus", $7EF00D, 3, bossalivetext)
%toggle_bit_long_customtext("Vitreous", $7EF121, 3, bossalivetext)
%toggle_bit_long_customtext("Trinexx", $7EF149, 3, bossalivetext)
%toggle_bit_long_customtext("Agahnim 2", $7EF01B, 3, bossalivetext)
#bossalivetext:
%list_header(2)
%list_item("Dead")
%list_item("Alive")
;===================================================================================================
cm_game_state_game_flags_submenu:
%menu_header("GAME FLAGS", 12)
%toggle_bit_long("Uncle dead", $7EF3C6, 0)
%toggle_bit_long("Sanc priest", $7EF3C6, 1)
%toggle_bit_long("Escaped", $7EF3C6, 2)
%toggle_bit_long("Uncle left", $7EF3C6, 4)
%toggle_bit_long("Aginah", $7EF3C6, 5)
%toggle_bit_long("Fortune cycle", $7EF3C6, 6)
%toggle_bit_long("Hobo bottle", $7EF3C9, 0)
%toggle_bit_long("Vendor bottle", $7EF3C9, 1)
%toggle_bit_long("Stumpy", $7EF3C9, 3)
%toggle_bit_long("Purple chest", $7EF3C9, 4)
%toggle_bit_long("Smithy rescued", $7EF3C9, 5)
%toggle_bit_long("Tempering", $7EF3C9, 7)
;===================================================================================================
cm_game_state_drops_submenu:
%menu_header("ENEMY DROPS", 11)
%choice_long_here("Drop luck", $7E0CF9, 3)
%list_item("None")
%list_item("Good")
%list_item("Bad")
%numfield_long("Lucky kills", $7E0CFA, 0, 10, 1)
%numfield_long("Rupee pull kills", $7E0CFB, 0, 255, 16)
%numfield_long("Rupee pull hits", $7E0CFC, 0, 255, 16)
%choice_long_prgtext("Prize pack 1", $7E0FC7, 8, draw_prize_pack_1)
%choice_long_prgtext("Prize pack 2", $7E0FC8, 8, draw_prize_pack_2)
%choice_long_prgtext("Prize pack 3", $7E0FC9, 8, draw_prize_pack_3)
%choice_long_prgtext("Prize pack 4", $7E0FCA, 8, draw_prize_pack_4)
%choice_long_prgtext("Prize pack 5", $7E0FCB, 8, draw_prize_pack_5)
%choice_long_prgtext("Prize pack 6", $7E0FCC, 8, draw_prize_pack_6)
%choice_long_prgtext("Prize pack 7", $7E0FCD, 8, draw_prize_pack_7)
;===================================================================================================
cm_game_state_crystals_submenu:
%menu_header("PENDANTS AND CRYSTALS", 10)
%toggle_bit_long("Eastern", $7EF374, 2)
%toggle_bit_long("Desert", $7EF374, 1)
%toggle_bit_long("Hera", $7EF374, 0)
%toggle_bit_long("Darkness", $7EF37A, 1)
%toggle_bit_long("Thieves", $7EF37A, 5)
%toggle_bit_long("Skull", $7EF37A, 6)
%toggle_bit_long("Ice", $7EF37A, 2)
%toggle_bit_long("Swamp", $7EF37A, 4)
%toggle_bit_long("Mire", $7EF37A, 0)
%toggle_bit_long("Turtle Rock", $7EF37A, 4)
;===================================================================================================
cm_game_reset_dungeons_submenu:
%menu_header("RESET DUNGEONS", 14)
%func("Escape", reset_dungeon_func)
%func("Eastern Palace", reset_dungeon_func)
%func("Desert Palace", reset_dungeon_func)
%func("Tower of Hera", reset_dungeon_func)
%func("Agahnim's Tower", reset_dungeon_func)
%func("Palace of Darkness", reset_dungeon_func)
%func("Swamp Palace", reset_dungeon_func)
%func("Skull Woods", reset_dungeon_func)
%func("Thieves' Town", reset_dungeon_func)
%func("Ice Palace", reset_dungeon_func)
%func("Misery Mire", reset_dungeon_func)
%func("Turtle Rock", reset_dungeon_func)
%func("Ganon's Tower", reset_dungeon_func)
%func("Other", reset_dungeon_func)
!EX = $01 ; escape
!EP = $02 ; eastern palace
!DP = $03 ; desert palace
!TH = $04 ; tower of hera
!AT = $0A ; aga's tower
!PD = $11 ; palace of darkness
!SP = $12 ; swamp palace
!SW = $13 ; skull woods
!TT = $14 ; thieves' town
!IP = $15 ; ice palace
!MM = $16 ; misery mire
!TR = $17 ; turtle rock
!GT = $18 ; ganon's tower
!CV = $FF ; caves and houses
!UU = !CV ; unused caves, just for convenience
#supertile_dungeons:
; eg1
dw !CV, !EX, !EX, !CV, !TR, !UU, !SP, !TH, !CV, !PD, !PD, !PD, !GT, !GT, !IP, !UU
dw !CV, !EX, !EX, !TR, !TR, !TR, !SP, !TH, !CV, !PD, !PD, !PD, !GT, !GT, !IP, !IP
dw !AT, !EX, !EX, !TR, !TR, !UU, !SP, !TH, !SP, !SW, !PD, !PD, !CV, !UU, !IP, !CV
dw !AT, !TH, !EX, !DP, !SP, !SP, !SP, !SP, !SP, !SW, !PD, !PD, !CV, !GT, !IP, !IP
dw !AT, !EX, !EX, !DP, !TT, !TT, !SP, !UU, !UU, !SW, !PD, !PD, !GT, !GT, !IP, !IP
dw !EX, !EX, !EX, !DP, !SP, !CV, !SW, !SW, !SW, !SW, !PD, !GT, !GT, !GT, !IP, !IP
dw !EX, !EX, !EX, !DP, !TT, !TT, !SP, !SW, !SW, !UU, !PD, !GT, !GT, !GT, !IP, !UU
dw !EX, !EX, !EX, !DP, !DP, !DP, !SP, !TH, !UU, !UU, !UU, !GT, !GT, !GT, !IP, !IP
dw !EX, !EX, !EX, !DP, !DP, !DP, !UU, !TH, !UU, !EP, !UU, !GT, !GT, !GT, !IP, !UU
dw !MM, !MM, !MM, !MM, !UU, !GT, !GT, !MM, !MM, !EP, !UU, !GT, !GT, !GT, !IP, !IP
dw !MM, !MM, !MM, !MM, !TR, !GT, !GT, !TH, !EP, !EP, !EP, !TT, !TT, !UU, !IP, !IP
dw !AT, !MM, !MM, !MM, !TR, !TR, !TR, !TR, !EP, !EP, !EP, !TT, !TT, !UU, !IP, !IP
dw !AT, !MM, !MM, !MM, !TR, !TR, !TR, !TR, !EP, !EP, !UU, !TT, !TT, !UU, !IP, !UU
dw !AT, !MM, !MM, !CV, !CV, !TR, !TR, !UU, !EP, !EP, !EP, !TT, !TT, !UU, !IP, !CV
dw !AT, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !UU, !CV, !CV, !UU, !CV, !CV, !CV
dw !CV, !CV, !CV, !CV, !CV, !CV, !UU, !UU, !CV, !CV, !CV, !CV, !UU, !CV, !CV, !CV
; eg 2
dw !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV
dw !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV
dw !CV, !CV, !CV, !CV, !CV, !CV, !CV, !CV
reset_dungeon_func:
PHB : PHK : PLB
PHD
LDY.b SA1IRAM.cm_cursor
LDX.w .list,Y
REP #$30
LDA.w #$0000
TCD
STX.b $00
LDX.w #(256+40)*2 ; eg1 size + eg2 size, words
-- LDY.w supertile_dungeons,X
CPY.b $00 : BNE ++
STA.l $7EF000,X
++ DEX #2 : BPL --
; check current room
INC ; sets accum to #$0001
BIT.b $1B : BEQ ++ ; make sure we're indoors
LDA.b $A0 : ASL : TAX
LDA.w supertile_dungeons,X
CMP.b $00 : BNE ++
STZ.w $0400 : STZ.w $0402 : STZ.w $0408
++ PLD
PLB
RTL
.list
db !EX
db !EP
db !DP
db !TH
db !AT
db !PD
db !SP
db !SW
db !TT
db !IP
db !MM
db !TR
db !GT
db !CV
;===================================================================================================
draw_prize_pack:
JSL CMDRAW_1_CHARACTER
LDA.b #' '
JSL CMDRAW_1_CHARACTER
REP #$20
PLA
SEP #$20
PHX
TAX
; get prize pack # from index + pack
ASL : ASL : ASL
ADC.w $0FC7,X
TAX
LDA.l $06FA78,X
SBC.b #$D7
REP #$F3
ASL
TAX
LDA.w .item_names,X
PLX
JSL CMDRAW_WORD_LONG_LONG
RTL
#draw_prize_pack_1:
PEA.w $0000 : BRA draw_prize_pack
#draw_prize_pack_2:
PEA.w $0001 : BRA draw_prize_pack
#draw_prize_pack_3:
PEA.w $0002 : BRA draw_prize_pack
#draw_prize_pack_4:
PEA.w $0003 : BRA draw_prize_pack
#draw_prize_pack_5:
PEA.w $0004 : BRA draw_prize_pack
#draw_prize_pack_6:
PEA.w $0005 : BRA draw_prize_pack
#draw_prize_pack_7:
PEA.w $0006 : BRA draw_prize_pack
.item_names
%list_header(12)
%list_item("Heart") ; $D8
%list_item("Grn rupee") ; $D9
%list_item("Blue rupee") ; $DA
%list_item("Red rupee") ; $DB
%list_item("Bomb (1)") ; $DC
%list_item("Bomb (4)") ; $DD
%list_item("Bomb (8)") ; $DE
%list_item("Magic") ; $DF
%list_item("Big magic") ; $E0
%list_item("Arrow (5)") ; $E1
%list_item("Arrow (10)") ; $E2
%list_item("Fairy") ; $E3
| 30.753894 | 100 | 0.569186 |
9bd7a400b1ccd2929c384db3b088ba7eb86ec3be | 2,173 | asm | Assembly | maps/RivalHouse1F.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | maps/RivalHouse1F.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | maps/RivalHouse1F.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 2 | 2021-08-11T19:47:07.000Z | 2022-01-01T07:07:56.000Z | object_const_def ; object_event constants
const RIVALHOUSE1F_OBJECT1
RivalHouse1F_MapScripts:
db 0 ; scene scripts
db 0 ; callbacks
RivalHouse1F_RivalsMomScript:
faceplayer
checkevent EVENT_TALKED_TO_RIVAL_IN_ROOM
iftrue .AfterRival
jumptext .CallingOnRivalText
.AfterRival:
checkevent EVENT_TALKED_TO_RIVALS_MOM_AFTER_RIVAL
iftrue .SecondTalk
setevent EVENT_TALKED_TO_RIVALS_MOM_AFTER_RIVAL
jumptext .RocketedOffText
.SecondTalk:
checkevent EVENT_GOT_STARTER
iftrue .AfterMon
jumptext .WaitingText
.AfterMon:
checkevent EVENT_GOT_POKEDEX
iftrue .AfterDex
jumptext .AfterMonText
.AfterDex:
jumptext .AfterDexText
.CallingOnRivalText:
text "<RIVAL>'s MOM: Oh,"
line "hi, <PLAYER>."
para "Are you looking"
line "for <RIVAL>?"
para "He was gone for a"
line "second, but then"
cont "he came running"
cont "right back home."
para "He just can't sit"
line "still. Who does he"
cont "take after?"
done
.RocketedOffText:
text "<RIVAL>'s MOM: That"
line "kid rocketed off"
cont "again like usual."
para "I'd guess he would"
line "be at ROUTE 201 by"
cont "now."
para "He just can't sit"
line "still. Who does he"
cont "take after?"
done
.WaitingText:
text "<RIVAL>'s MOM: My"
line "<RIVAL> should be"
cont "out on ROUTE 201"
cont "by now."
para "He just can't sit"
line "still. Who does he"
cont "take after?"
done
.AfterMonText:
text "<RIVAL>'s MOM: Oh,"
line "you've become"
cont "friends with a"
cont "#MON, too."
done
.AfterDexText:
text "<RIVAL>'s MOM: My"
line "<RIVAL> took off"
cont "like a rocket as"
cont "usual."
para "He was shouting"
line "something about"
cont "becoming the"
cont "greatest TRAINER"
cont "ever…"
para "He just can't sit"
line "still. Who does he"
cont "take after?"
done
RivalHouse1F_MapEvents:
db 0, 0 ; filler
db 3 ; warp events
warp_event 6, 7, TWINLEAF_TOWN, 2
warp_event 7, 7, TWINLEAF_TOWN, 2
warp_event 9, 0, RIVAL_HOUSE_2F, 1
db 0 ; coord events
db 0 ; bg events
db 1 ; object events
object_event 7, 4, SPRITE_POKEFAN_F, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_NPC_RED, OBJECTTYPE_SCRIPT, 0, RivalHouse1F_RivalsMomScript, -1
| 19.061404 | 151 | 0.723884 |
dc36ac43cc39fcd36f6d3f56ad2ab74b17059962 | 1,913 | asm | Assembly | programs/oeis/131/A131474.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/131/A131474.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/131/A131474.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A131474: a(n) = ceiling(n/2)*ceiling(n^2/2).
; 0,1,2,10,16,39,54,100,128,205,250,366,432,595,686,904,1024,1305,1458,1810,2000,2431,2662,3180,3456,4069,4394,5110,5488,6315,6750,7696,8192,9265,9826,11034,11664,13015,13718,15220,16000,17661,18522,20350,21296,23299,24334,26520,27648,30025,31250,33826,35152,37935,39366,42364,43904,47125,48778,52230,54000,57691,59582,63520,65536,69729,71874,76330,78608,83335,85750,90756,93312,98605,101306,106894,109744,115635,118638,124840,128000,134521,137842,144690,148176,155359,159014,166540,170368,178245,182250,190486,194672,203275,207646,216624,221184,230545,235298,245050,250000,260151,265302,275860,281216,292189,297754,309150,314928,326755,332750,345016,351232,363945,370386,383554,390224,403855,410758,424860,432000,446581,453962,469030,476656,492219,500094,516160,524288,540865,549250,566346,574992,592615,601526,619684,628864,647565,657018,676270,686000,705811,715822,736200,746496,767449,778034,799570,810448,832575,843750,866476,877952,901285,913066,937014,949104,973675,986078,1011280,1024000,1049841,1062882,1089370,1102736,1129879,1143574,1171380,1185408,1213885,1228250,1257406,1272112,1301955,1317006,1347544,1362944,1394185,1409938,1441890,1458000,1490671,1507142,1540540,1557376,1591509,1608714,1643590,1661168,1696795,1714750,1751136,1769472,1806625,1825346,1863274,1882384,1921095,1940598,1980100,2000000,2040301,2060602,2101710,2122416,2164339,2185454,2228200,2249728,2293305,2315250,2359666,2382032,2427295,2450086,2496204,2519424,2566405,2590058,2637910,2662000,2710731,2735262,2784880,2809856,2860369,2885794,2937210,2963088,3015415,3041750,3094996,3121792,3175965,3203226,3258334,3286064,3342115,3370318,3427320,3456000,3513961,3543122,3602050,3631696,3691599,3721734,3782620,3813248,3875125
mov $2,$0
lpb $0
lpb $0
add $3,$0
add $4,$0
sub $0,1
lpe
lpb $2
sub $3,$2
trn $2,2
add $5,$4
lpe
sub $5,$3
add $1,$5
lpe
| 100.684211 | 1,707 | 0.810246 |
634df3b2ddc544d35e97182bb6ed35977472d638 | 425 | asm | Assembly | oeis/213/A213061.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/213/A213061.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/213/A213061.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A213061: Triangle of Stirling numbers of second kind (A048993) read mod 2.
; Submitted by Simon Strandgaard
; 1,0,1,0,1,1,0,1,1,1,0,1,1,0,1,0,1,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,0,1,1,0,1,1,0,1,0,0,0,1,0,1,1,1,0,1,0,0,0,1,0,1,1,0,1,1,1,0,0,1,1,0,1,1,1,0,0,1,1,0,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1,0,1,1,1,0,1,0,0,0
lpb $0
add $1,1
sub $0,$1
lpe
sub $1,$0
add $0,$1
sub $1,$0
add $0,$1
mul $0,2
bin $1,$0
mov $0,$1
mod $0,2
| 25 | 201 | 0.571765 |
dfc5f1ff91a95348c877325639aab7ddaa5e0d53 | 797 | asm | Assembly | oeis/235/A235282.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/235/A235282.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/235/A235282.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A235282: Number of (n+1) X (1+1) 0..3 arrays with every 2 X 2 subblock having its diagonal sum differing from its antidiagonal sum by 4 (constant stress 1 X 1 tilings).
; Submitted by Christian Krause
; 20,40,68,136,236,472,836,1672,3020,6040,11108,22216,41516,83032,157316,314632,603020,1206040,2333348,4666696,9097196,18194392,35680196,71360392,140595020,281190040,556002788,1112005576,2204879276,4409758552,8762121476,17524242952,34876299020,69752598040,138988635428,277977270856,554404859756,1108809719512,2212970393156,4425940786312,8837934435020,17675868870040,35309896327268,70619792654536,141114061070636,282228122141272,564079671567236,1128159343134472,2255188968123020,4510377936246040
mov $1,2
pow $1,$0
add $0,2
seq $0,18311 ; Divisors of 162.
mul $1,2
add $1,$0
mov $0,$1
mul $0,4
| 61.307692 | 494 | 0.818068 |
f341c2d1f4bc032f4b7b9f7145d02911b9fae916 | 827 | asm | Assembly | oeis/142/A142454.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/142/A142454.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/142/A142454.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A142454: Primes congruent to 47 mod 49.
; Submitted by Jon Maiga
; 47,439,733,929,1223,1321,1811,2203,2399,2693,2791,3673,3967,4261,4457,4751,5437,5927,6221,6907,7103,7691,7789,8377,8573,8867,9161,9749,10141,10337,10631,10729,11317,11807,12101,12689,12983,13669,13963,14159,14551,14747,15139,15629,15727,15923,16217,16903,17099,17393,17491,17981,19157,19843,20333,20431,20627,20921,21019,21313,21803,22391,22783,23371,23567,24547,24841,25037,25919,26017,26801,27487,28663,28859,29153,29251,29741,30133,30427,31799,32191,32779,33073,33563,33857,34543,34739,35327
mov $2,$0
add $2,2
pow $2,2
lpb $2
add $1,23
sub $2,2
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,26
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
mul $0,2
sub $0,51
| 34.458333 | 496 | 0.727932 |
c36ab85e068751a37d02a3de8e3e36ce47109cd2 | 3,536 | asm | Assembly | input.asm | mehtabsinghmann/plcc | 590411437cb586fb8b626fa05b89e1a54ee3b931 | [
"Apache-2.0"
] | null | null | null | input.asm | mehtabsinghmann/plcc | 590411437cb586fb8b626fa05b89e1a54ee3b931 | [
"Apache-2.0"
] | null | null | null | input.asm | mehtabsinghmann/plcc | 590411437cb586fb8b626fa05b89e1a54ee3b931 | [
"Apache-2.0"
] | null | null | null | .model small
.data
.stack
a dw ?
b dw ?
d dw ?
temp dw ?
.code
.startup
MOV a,0
MOV CX,0
label0:
MOV AX,a
MOV BX,10
IMUL BX
MOV a,AX
ADD a,CX
MOV AH,1H
INT 21h
MOV AH,0
MOV BX,13
MOV CX,AX
SUB CX,30H
CMP AX,BX
JNE label0
MOV b,0
MOV CX,0
label1:
MOV AX,b
MOV BX,10
IMUL BX
MOV b,AX
ADD b,CX
MOV AH,1H
INT 21h
MOV AH,0
MOV BX,13
MOV CX,AX
SUB CX,30H
CMP AX,BX
JNE label1
MOV d,0
MOV CX,0
label2:
MOV AX,d
MOV BX,10
IMUL BX
MOV d,AX
ADD d,CX
MOV AH,1H
INT 21h
MOV AH,0
MOV BX,13
MOV CX,AX
SUB CX,30H
CMP AX,BX
JNE label2
MOV BX,Offset a
MOV CX,[BX]
MOV AX,[BX]
AND DX,0
MOV temp,0
label3:
MOV BX,10
CWD
IDIV BX
MOV CX,AX
AND DH,0
ADD DL,30H
PUSH DX
ADD temp,1
MOV BX,0
MOV AX,CX
CMP CX,BX
JNE label3
label4:
POP DX
MOV AH,2H
INT 21H
SUB temp,1
CMP temp,BX
JNE label4
MOV BX,Offset b
MOV CX,[BX]
MOV AX,[BX]
AND DX,0
MOV temp,0
label5:
MOV BX,10
CWD
IDIV BX
MOV CX,AX
AND DH,0
ADD DL,30H
PUSH DX
ADD temp,1
MOV BX,0
MOV AX,CX
CMP CX,BX
JNE label5
label6:
POP DX
MOV AH,2H
INT 21H
SUB temp,1
CMP temp,BX
JNE label6
MOV BX,Offset d
MOV CX,[BX]
MOV AX,[BX]
AND DX,0
MOV temp,0
label7:
MOV BX,10
CWD
IDIV BX
MOV CX,AX
AND DH,0
ADD DL,30H
PUSH DX
ADD temp,1
MOV BX,0
MOV AX,CX
CMP CX,BX
JNE label7
label8:
POP DX
MOV AH,2H
INT 21H
SUB temp,1
CMP temp,BX
JNE label8
MOV AX,a
MOV BX,b
CMP AX,BX
JL label9
MOV AX, a
PUSH AX
POP AX
MOV BX,AX
PUSH BX
MOV AX, 1
PUSH AX
POP AX
POP BX
ADD AX,BX
PUSH AX
POP AX
MOV BX,Offset a
MOV [BX],AX
MOV AX, b
PUSH AX
POP AX
MOV BX,AX
PUSH BX
MOV AX, a
PUSH AX
POP AX
POP BX
ADD AX,BX
PUSH AX
POP AX
MOV BX,Offset b
MOV [BX],AX
MOV BX,Offset a
MOV CX,[BX]
MOV AX,[BX]
AND DX,0
MOV temp,0
label10:
MOV BX,10
CWD
IDIV BX
MOV CX,AX
AND DH,0
ADD DL,30H
PUSH DX
ADD temp,1
MOV BX,0
MOV AX,CX
CMP CX,BX
JNE label10
label11:
POP DX
MOV AH,2H
INT 21H
SUB temp,1
CMP temp,BX
JNE label11
MOV BX,Offset b
MOV CX,[BX]
MOV AX,[BX]
AND DX,0
MOV temp,0
label12:
MOV BX,10
CWD
IDIV BX
MOV CX,AX
AND DH,0
ADD DL,30H
PUSH DX
ADD temp,1
MOV BX,0
MOV AX,CX
CMP CX,BX
JNE label12
label13:
POP DX
MOV AH,2H
INT 21H
SUB temp,1
CMP temp,BX
JNE label13
MOV BX,Offset d
MOV CX,[BX]
MOV AX,[BX]
AND DX,0
MOV temp,0
label14:
MOV BX,10
CWD
IDIV BX
MOV CX,AX
AND DH,0
ADD DL,30H
PUSH DX
ADD temp,1
MOV BX,0
MOV AX,CX
CMP CX,BX
JNE label14
label15:
POP DX
MOV AH,2H
INT 21H
SUB temp,1
CMP temp,BX
JNE label15
label9 :
MOV AX, a
PUSH AX
POP AX
MOV BX,AX
PUSH BX
MOV AX, 3
PUSH AX
POP AX
POP BX
IMUL BX
PUSH AX
POP AX
MOV BX,AX
PUSH BX
MOV AX, b
PUSH AX
POP AX
MOV BX,AX
PUSH BX
MOV AX, 8
PUSH AX
POP AX
MOV BX,AX
PUSH BX
MOV AX, 16
PUSH AX
POP AX
MOV BX,AX
PUSH BX
MOV AX, 4
PUSH AX
POP BX
POP AX
CWD
IDIV BX
PUSH AX
POP AX
POP BX
ADD AX,BX
PUSH AX
POP AX
POP BX
SUB BX,AX
MOV AX,BX
PUSH AX
POP AX
POP BX
ADD AX,BX
PUSH AX
POP AX
MOV BX,Offset d
MOV [BX],AX
MOV BX,Offset a
MOV CX,[BX]
MOV AX,[BX]
AND DX,0
MOV temp,0
label16:
MOV BX,10
CWD
IDIV BX
MOV CX,AX
AND DH,0
ADD DL,30H
PUSH DX
ADD temp,1
MOV BX,0
MOV AX,CX
CMP CX,BX
JNE label16
label17:
POP DX
MOV AH,2H
INT 21H
SUB temp,1
CMP temp,BX
JNE label17
MOV BX,Offset b
MOV CX,[BX]
MOV AX,[BX]
AND DX,0
MOV temp,0
label18:
MOV BX,10
CWD
IDIV BX
MOV CX,AX
AND DH,0
ADD DL,30H
PUSH DX
ADD temp,1
MOV BX,0
MOV AX,CX
CMP CX,BX
JNE label18
label19:
POP DX
MOV AH,2H
INT 21H
SUB temp,1
CMP temp,BX
JNE label19
MOV BX,Offset d
MOV CX,[BX]
MOV AX,[BX]
AND DX,0
MOV temp,0
label20:
MOV BX,10
CWD
IDIV BX
MOV CX,AX
AND DH,0
ADD DL,30H
PUSH DX
ADD temp,1
MOV BX,0
MOV AX,CX
CMP CX,BX
JNE label20
label21:
POP DX
MOV AH,2H
INT 21H
SUB temp,1
CMP temp,BX
JNE label21
.EXIT
END
| 9.479893 | 15 | 0.705882 |
e0a88361b56590cc2fc00b0b41fb1830d7cd15b6 | 842 | asm | Assembly | oeis/142/A142481.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/142/A142481.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/142/A142481.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A142481: Primes congruent to 8 mod 51.
; Submitted by Jon Maiga
; 59,263,467,569,773,977,1181,1283,1487,1997,2099,2609,2711,3119,3221,3323,3527,3833,4139,4241,4547,4649,4751,5261,5669,6689,6791,7607,8117,8219,8423,8627,8831,8933,9137,9239,9341,9749,9851,10259,10463,10667,10973,11177,11279,11483,11789,12197,12401,12503,12809,12911,13217,13421,13523,13829,13931,14033,14543,14747,14951,15053,15359,15461,15767,15971,16073,16481,16787,16889,17093,17807,17909,18521,19031,19541,19949,20051,20357,20663,21377,21683,22091,22193,22397,22907,23417,24029,25253,25457,25763
mov $1,29
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $2,2
mov $3,$1
add $1,13
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,38
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
mul $0,2
sub $0,101
| 33.68 | 501 | 0.724466 |
9f50e34dd6ba9a1cb1906f9eedb874007f8d3149 | 578 | asm | Assembly | mips/training/RemoveIf.asm | JMazurkiewicz/ARKO-assembly | a836cf7b5804c045545d7fbbb5785cdf27c00eaf | [
"MIT"
] | null | null | null | mips/training/RemoveIf.asm | JMazurkiewicz/ARKO-assembly | a836cf7b5804c045545d7fbbb5785cdf27c00eaf | [
"MIT"
] | null | null | null | mips/training/RemoveIf.asm | JMazurkiewicz/ARKO-assembly | a836cf7b5804c045545d7fbbb5785cdf27c00eaf | [
"MIT"
] | null | null | null | .data
prompt: .asciiz "Enter text: "
str: .space 128
.text
.globl main
main:
li $v0, 4
la $a0, prompt
syscall
li $v0, 8
la $a0, str
li $a1, 128
syscall
la $t0, str # source
la $t1, str # target
# we are going to remove all small letters
li $t3, 'A'
li $t4, 'Z'
loop:
lbu $t2, ($t0)
bltu $t2, ' ', exit
addiu $t0, $t0, 1
# "don't remove" conditions
bltu $t2, $t3, no_remove
bgtu $t2, $t4, no_remove
b loop
no_remove:
sb $t2, ($t1)
addiu $t1, $t1, 1
b loop
exit:
sb $zero, ($t1)
li $v0, 4
la $a0, str
syscall
li $v0, 10
syscall | 11.795918 | 43 | 0.577855 |
6dfeb35835af9d92576d97d3ecc7fcd728ff315c | 1,611 | asm | Assembly | programs/oeis/168/A168555.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/168/A168555.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/168/A168555.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A168555: a(n) = n^6*(n^3 + 1)/2.
; 0,1,288,10206,133120,984375,5062176,20235628,67239936,193975965,500500000,1179859626,2581383168,5304663091,10334288160,19227375000,34368126976,59306007033,99196651296,161367371830,256032000000,397182906351,603691298848,900650348676,1320999321600,1907470703125,2714906297376,3812992452738,5289468921856,7253870399595,9841864500000,13220254832176,17592722915328,23206387934961,30359268785440,39408738468750,50781066725376,64982152760743,82609556099616,104365939951260,131074048000000,163693342249101,203338436440608,251299466649946,309064547911680,378344473171875,461099818482976,559570626159048,676308845592576,814213719598825,976570312500000,1167091384689126,1389962827122688,1649892878081631,1952165353612320,2302697132312500,2708100144562176,3175748125915653,3713848404168736,4331518999594290,5038871328000000,5847098806604251,6768571673249568,7816938340178016,9007233614479360,10355994128390625,11881381333874976,13603312427338558,15543599581956096,17726097876869655,20176862324500000,22924314409366476,25999418564149248,29435869021247101,33270287490784800,37542432128906250,42295418273253376,47575951435775763,53434573056442656,59925919535036920,67108995072000000,75047458863267801,83809927208189728,93470291103956886,104108049914480640,115808661716359375,128663910939449376,142772293934615268,158239423116476416,175178450344388085,193710510220500000,213965183999520226,236080984820779008,260205864989335371,286497746049198880,315125072408250000,346267389291134976,380115945813285073,416874323986265376,456759094481895150
mov $1,$0
pow $0,6
pow $1,9
add $0,$1
div $0,2
| 179 | 1,527 | 0.909994 |
2ce700f7c3d3dab6e320e3d2127571976e2deba0 | 1,805 | asm | Assembly | programs/oeis/153/A153973.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/153/A153973.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/153/A153973.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A153973: a(n) = 3*a(n-1) - 2*a(n-2), with a(1) = 9, a(2) = 12.
; 9,12,18,30,54,102,198,390,774,1542,3078,6150,12294,24582,49158,98310,196614,393222,786438,1572870,3145734,6291462,12582918,25165830,50331654,100663302,201326598,402653190,805306374,1610612742,3221225478,6442450950,12884901894,25769803782,51539607558,103079215110,206158430214,412316860422,824633720838,1649267441670,3298534883334,6597069766662,13194139533318,26388279066630,52776558133254,105553116266502,211106232532998,422212465065990,844424930131974,1688849860263942,3377699720527878,6755399441055750,13510798882111494,27021597764222982,54043195528445958,108086391056891910,216172782113783814,432345564227567622,864691128455135238,1729382256910270470,3458764513820540934,6917529027641081862,13835058055282163718,27670116110564327430,55340232221128654854,110680464442257309702,221360928884514619398,442721857769029238790,885443715538058477574,1770887431076116955142,3541774862152233910278,7083549724304467820550,14167099448608935641094,28334198897217871282182,56668397794435742564358,113336795588871485128710,226673591177742970257414,453347182355485940514822,906694364710971881029638,1813388729421943762059270,3626777458843887524118534,7253554917687775048237062,14507109835375550096474118,29014219670751100192948230,58028439341502200385896454,116056878683004400771792902,232113757366008801543585798,464227514732017603087171590,928455029464035206174343174,1856910058928070412348686342,3713820117856140824697372678,7427640235712281649394745350,14855280471424563298789490694,29710560942849126597578981382,59421121885698253195157962758,118842243771396506390315925510,237684487542793012780631851014,475368975085586025561263702022,950737950171172051122527404038,1901475900342344102245054808070
mov $1,2
pow $1,$0
add $1,2
mul $1,3
mov $0,$1
| 200.555556 | 1,691 | 0.910249 |
99d7a993c6179863626ee2f37d2cb93b984762e4 | 1,572 | asm | Assembly | programs/oeis/151/A151917.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/151/A151917.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/151/A151917.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A151917: a(0)=0, a(1)=1; for n>=2, a(n) = (2/3)*(Sum_{i=1..n-1} 3^wt(i)) + 1, where wt() = A000120().
; 0,1,3,5,11,13,19,25,43,45,51,57,75,81,99,117,171,173,179,185,203,209,227,245,299,305,323,341,395,413,467,521,683,685,691,697,715,721,739,757,811,817,835,853,907,925,979,1033,1195,1201,1219,1237,1291,1309,1363,1417,1579,1597,1651,1705,1867,1921,2083,2245,2731,2733,2739,2745,2763,2769,2787,2805,2859,2865,2883,2901,2955,2973,3027,3081,3243,3249,3267,3285,3339,3357,3411,3465,3627,3645,3699,3753,3915,3969,4131,4293,4779,4785,4803,4821,4875,4893,4947,5001,5163,5181,5235,5289,5451,5505,5667,5829,6315,6333,6387,6441,6603,6657,6819,6981,7467,7521,7683,7845,8331,8493,8979,9465,10923,10925,10931,10937,10955,10961,10979,10997,11051,11057,11075,11093,11147,11165,11219,11273,11435,11441,11459,11477,11531,11549,11603,11657,11819,11837,11891,11945,12107,12161,12323,12485,12971,12977,12995,13013,13067,13085,13139,13193,13355,13373,13427,13481,13643,13697,13859,14021,14507,14525,14579,14633,14795,14849,15011,15173,15659,15713,15875,16037,16523,16685,17171,17657,19115,19121,19139,19157,19211,19229,19283,19337,19499,19517,19571,19625,19787,19841,20003,20165,20651,20669,20723,20777,20939,20993,21155,21317,21803,21857,22019,22181,22667,22829,23315,23801,25259,25277,25331,25385,25547,25601,25763,25925,26411,26465,26627,26789,27275,27437,27923,28409,29867,29921,30083,30245,30731,30893,31379,31865,33323,33485
mov $1,1
cal $0,147562 ; Number of "ON" cells at n-th stage in the "Ulam-Warburton" two-dimensional cellular automaton.
add $0,11
add $1,$0
sub $1,11
div $1,2
| 157.2 | 1,307 | 0.773537 |
13d2de9a7de80ea4be247d294de22f75098d0dcc | 4,662 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1382.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1382.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1382.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 %rcx
push %rdi
push %rsi
lea addresses_A_ht+0x1d862, %rsi
lea addresses_A_ht+0x1ec1c, %rdi
nop
nop
nop
sub %r12, %r12
mov $93, %rcx
rep movsw
nop
inc %r10
pop %rsi
pop %rdi
pop %rcx
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %r9
push %rbp
push %rdi
push %rsi
// Load
lea addresses_WC+0x18d1c, %rdi
nop
nop
nop
nop
cmp $3923, %r15
mov (%rdi), %r9
nop
cmp %r15, %r15
// Store
lea addresses_A+0x1e21c, %r9
nop
nop
nop
nop
nop
and %rsi, %rsi
mov $0x5152535455565758, %rbp
movq %rbp, (%r9)
nop
nop
nop
nop
and %r12, %r12
// Faulty Load
lea addresses_D+0x19c1c, %r15
clflush (%r15)
nop
nop
nop
and $62261, %rdi
vmovups (%r15), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $1, %xmm2, %rsi
lea oracles, %r15
and $0xff, %rsi
shlq $12, %rsi
mov (%r15,%rsi,1), %rsi
pop %rsi
pop %rdi
pop %rbp
pop %r9
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_D', 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WC', 'congruent': 8}}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A', 'congruent': 9}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_D', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 47.571429 | 2,999 | 0.660232 |
d86d55224a6499df4eb1b85ff4fea955d72772e1 | 2,496 | asm | Assembly | programs/oeis/219/A219056.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/219/A219056.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/219/A219056.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A219056: 3*n^4.
; 0,3,48,243,768,1875,3888,7203,12288,19683,30000,43923,62208,85683,115248,151875,196608,250563,314928,390963,480000,583443,702768,839523,995328,1171875,1370928,1594323,1843968,2121843,2430000,2770563,3145728,3557763,4009008,4501875,5038848,5622483,6255408,6940323,7680000,8477283,9335088,10256403,11244288,12301875,13432368,14639043,15925248,17294403,18750000,20295603,21934848,23671443,25509168,27451875,29503488,31668003,33949488,36352083,38880000,41537523,44329008,47258883,50331648,53551875,56924208,60453363,64144128,68001363,72030000,76235043,80621568,85194723,89959728,94921875,100086528,105459123,111045168,116850243,122880000,129140163,135636528,142374963,149361408,156601875,164102448,171869283,179908608,188226723,196830000,205724883,214917888,224415603,234224688,244351875,254803968,265587843,276710448,288178803,300000000,312181203,324729648,337652643,350957568,364651875,378743088,393238803,408146688,423474483,439230000,455421123,472055808,489142083,506688048,524701875,543191808,562166163,581633328,601601763,622080000,643076643,664600368,686659923,709264128,732421875,756142128,780433923,805306368,830768643,856830000,883499763,910787328,938702163,967253808,996451875,1026306048,1056826083,1088021808,1119903123,1152480000,1185762483,1219760688,1254484803,1289945088,1326151875,1363115568,1400846643,1439355648,1478653203,1518750000,1559656803,1601384448,1643943843,1687345968,1731601875,1776722688,1822719603,1869603888,1917386883,1966080000,2015694723,2066242608,2117735283,2170184448,2223601875,2277999408,2333388963,2389782528,2447192163,2505630000,2565108243,2625639168,2687235123,2749908528,2813671875,2878537728,2944518723,3011627568,3079877043,3149280000,3219849363,3291598128,3364539363,3438686208,3514051875,3590649648,3668492883,3747595008,3827969523,3909630000,3992590083,4076863488,4162464003,4249405488,4337701875,4427367168,4518415443,4610860848,4704717603,4800000000,4896722403,4994899248,5094545043,5195674368,5298301875,5402442288,5508110403,5615321088,5724089283,5834430000,5946358323,6059889408,6175038483,6291820848,6410251875,6530347008,6652121763,6775591728,6900772563,7027680000,7156329843,7286737968,7418920323,7552892928,7688671875,7826273328,7965713523,8107008768,8250175443,8395230000,8542188963,8691068928,8841886563,8994658608,9149401875,9306133248,9464869683,9625628208,9788425923,9953280000,10120207683,10289226288,10460353203,10633605888,10809001875,10986558768,11166294243,11348226048,11532372003
mov $1,$0
pow $1,4
mul $1,3
| 356.571429 | 2,448 | 0.890224 |
4252c358c8af74e3ec69eb77ac8a11e834b44736 | 347 | asm | Assembly | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_rename_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_rename_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/arch/zxn/esxdos/c/sccz80/esx_f_rename_callee.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; unsigned char esx_f_rename(unsigned char *old, unsigned char *new)
SECTION code_esxdos
PUBLIC esx_f_rename_callee
EXTERN asm_esx_f_rename
esx_f_rename_callee:
pop hl
pop de
ex (sp),hl
jp asm_esx_f_rename
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _esx_f_rename_callee
defc _esx_f_rename_callee = esx_f_rename_callee
ENDIF
| 15.086957 | 68 | 0.798271 |
8c8f99a42eab2fcb47a483d4651c733c648d9844 | 692 | asm | Assembly | oeis/250/A250554.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/250/A250554.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/250/A250554.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A250554: Number of length n+2 0..1 arrays with the sum of second differences multiplied by some arrangement of +-1 equal to zero.
; 2,8,14,32,62,128,254,512,1022,2048,4094,8192,16382,32768,65534,131072,262142,524288,1048574,2097152,4194302,8388608,16777214,33554432,67108862,134217728,268435454,536870912,1073741822,2147483648,4294967294,8589934592,17179869182,34359738368,68719476734,137438953472,274877906942,549755813888,1099511627774,2199023255552,4398046511102,8796093022208,17592186044414,35184372088832,70368744177662,140737488355328,281474976710654,562949953421312,1125899906842622,2251799813685248,4503599627370494
mov $1,2
pow $1,$0
mul $1,4
div $1,6
mul $1,6
add $1,2
mov $0,$1
| 62.909091 | 493 | 0.833815 |
835ff0b1d6c23b529033262266728a6571fe53f7 | 2,857 | asm | Assembly | src/asm_files/shell_prototypes/fastAndLoose.asm | zedth2/sunyat-c | cb036b32eff9e5e201d114c784b3198aa11d34d4 | [
"MIT"
] | null | null | null | src/asm_files/shell_prototypes/fastAndLoose.asm | zedth2/sunyat-c | cb036b32eff9e5e201d114c784b3198aa11d34d4 | [
"MIT"
] | null | null | null | src/asm_files/shell_prototypes/fastAndLoose.asm | zedth2/sunyat-c | cb036b32eff9e5e201d114c784b3198aa11d34d4 | [
"MIT"
] | null | null | null | ;------------------------------------
;The SUNYAT Shell
;'Fast and Loose' edition
;Uses hard-coded memory addresses instead of string analysis.
;------------------------------------
;.message SUNYAT Shell 'Fast and Loose' Prototype
.constant TERM 0xFF
.constant CR 0xD
.constant LF 0xA
jmp !main
!cmd_table
.variable cmd_exit_0 !cmd_exit
.variable cmd_reset_1 !cmd_reset
.variable cmd_awr_2 !cmd_awr
.variable cmd_populate_reg_3 !cmd_populate_reg
.variable cmd_savestate_4 !cmd_savestate
;commands--------------------------------------------------------
!cmd_exit
jmp !exit_shell
!cmd_reset
mov R0 'R'
STOR TERM R0
swr 0
jmp !get_cmd_end
!cmd_awr
awr 1
jmp !get_cmd_end
!cmd_populate_reg
mov R7 'Z'
jmp !get_cmd_end
!cmd_savestate
aux 0
jmp !get_cmd_end
!cmd_win_end;
;end of commands-------------------------------------------------
!crlf
.variable crlf0 CR
.variable crlf1 LF
.variable crlf2 0x00
!prompt
.variable prompt0 '['
.variable prompt1 'm'
.variable prompt2 'e'
.variable prompt3 '@'
.variable prompt4 'S'
.variable prompt5 'U'
.variable prompt6 'N'
.variable prompt7 'Y'
.variable prompt8 'A'
.variable prompt9 'T'
.variable prompt10 ']'
.variable prompt11 0x00
!main
mov R0 !prompt
call !print ;print the prompt
!get_cmd
load R0 TERM
!gc_while
cmp R0 '0'
jls !get_cmd
cmp R0 '9'
jgr !get_cmd
!gc_while_end
stor TERM R0
call !print_line
add R0 -46 ;0 = 48(ascii) !table is location 2.
;stor TERM R0
;call !print_line
loadp R1 R0
;stor TERM R1
;call !print_line
push R1
ret
!get_cmd_end
call !print_line
jmp !main ;back to the top
!exit_shell
ret
!main_end
;-!print-----------------------------------------------------------------------------------------
;-Prints chars individually from a memory location moved into R0
;-Stops when it finds a 0x00
;
;-Does not print the 0x00
;------------------------------------------------------------------------------------------------
!print
push R0 ;backup R1
push R1 ;backup R0
!while_PP
loadp R1 R0 ;Load character at address R0 into R1. R0 is an array pointer.
cmp R1 0x00
jeq !while_PP_end ;If the character is 0x00 stop printing.
stor TERM R1 ;print character
add R0 1 ;Increment array pointer
jmp !while_PP ;keep printing
!while_PP_end
pop R1 ;return value
pop R0 ;return value
ret
!print_end
;------------------------------------------------------------------------------------------------
;-!print_line------------------------------------------------------------------------------------
;-Prints a newline (!crlf) when called
;------------------------------------------------------------------------------------------------
!print_line
push R0
mov R0 !crlf
call !print
pop R0
ret
!print_line_end
;------------------------------------------------------------------------------------------------
| 23.227642 | 97 | 0.540777 |
40ce1b0ece304d1b07a9a1deaaf9e3cc4116fcd4 | 7,182 | asm | Assembly | tests/sample.asm | tonypdmtr/emu6809 | 2444447aa00882bc84fd3b0415c81edff4d85883 | [
"MIT"
] | 1 | 2020-12-11T00:36:51.000Z | 2020-12-11T00:36:51.000Z | tests/sample.asm | tonypdmtr/emu6809 | 2444447aa00882bc84fd3b0415c81edff4d85883 | [
"MIT"
] | 1 | 2020-05-29T14:15:55.000Z | 2020-06-01T11:29:42.000Z | tests/sample.asm | tonypdmtr/emu6809 | 2444447aa00882bc84fd3b0415c81edff4d85883 | [
"MIT"
] | null | null | null | **************************************************************
* Programmer: Tony Papadimitriou <tonyp@acm.org> *
* Program : SAMPLE *
* Includes : Nothing *
* Links : Nothing *
* Created : March 22, 1991 *
* Updated : March 28, 1991 *
* Language : (MSDOS/OS9) 6809 Assembler *
* Purpose : Prove the functionality of the 6809/OS-9 prog. *
* -------------------- Version History --------------------- *
* 1.00 : Original *
**************************************************************
********** OS-9 DEFINITIONS **********
F_Exit equ $06 B=error code (no error, B=0)
I_Read equ $89 A=handle, X->string, Y=length
I_Write equ $8A A=handle, X->string, Y=length
I_Readln equ $8B A=handle, X->string, Y=length
I_Writln equ $8C A=handle, X->string, Y=length
OS9_StdIn equ $00
OS9_StdOut equ $01
OS9_StdErr equ $02
********** PROGRAM DEFINITIONS **********
StackTop equ $F000
LowLimit equ $100
UpLimit equ $400
********** PROGRAM CODE **********
org $100
Begin jmp Start,pcr skip data segment
********** DATA SEGMENT **********
Error rmb 1 error code
Counter rmb 1 buffer position counter
Buffer rmb 75 dump line
BufferLen equ *-Buffer
Msg000 fcb $0d,$0a
fcc /OS-9 Memory Dumper ver. 1.00/
fcb $0d,$0a
fcc /Copyright (c) 1991 by Tony G. Papadimitriou/
fcb $0d,$0a
Len000 equ *-Msg000
Msg001 fcc /Addr 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF/
fcb $0d,$0a
fcc /---- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ----------------/
Len001 equ *-Msg001
ErrMsg fcc /*** Program terminated with error code /
ErrCode fdb ' '
ErrLen equ *-ErrMsg
********** CODE SEGMENT
Start lds #StackTop initialize stack pointer
lda #0 initialize exit error code
sta Error,pcr
bsr ShwCprght print the copyright message
bsr DoWork do the dumping
ldb Error,pcr
tstb #0 do we have an error?
beq GetOut no, exit
tfr b,a get error code in A
leax ErrCode,pcr point to error display buffer
lbsr ToHex convert to a hex string
lbsr Beep
leax ErrMsg,pcr point to error message
ldy #ErrLen and get its length
lbsr Writeln
GetOut swi2
fcb F_Exit exit to OS-9
ShwCprght equ *
leax Msg000,pcr
ldy #Len000
lbsr Writeln
rts
DoWork equ *
* print the header
leax Msg001,pcr
ldy #Len001
lbsr Writeln
* first clear the buffer with spaces
leax Buffer,pcr
ldy #BufferLen
lda #' '
ClearLoop sta ,x+
leay -1,y
bne ClearLoop
* initialize memory address and buffer pointer
ldu #LowLimit point to the starting point
leax Buffer,pcr point to output buffer
clr Counter,pcr zero buffer position counter
lbsr PutAddress
leax 1,x skip a space
* start decoding
MainLoop lda ,u+ get a bute in A
bsr ToHex convert to hex string
cmpa #' ' change to dot characters below space
bhs skip
lda #'.' unprintable character masking
skip pshs x,d
leax Buffer,pcr
ldb Counter,pcr
abx
sta 55,x
puls x,d
leax 1,x skip a space
inc Counter,pcr adjust counter
lda Counter,pcr
cmpa #16
blo GoOn
leax Buffer,pcr reset pointer to buffer
clr Counter,pcr reset buffer position counter
pshs y
ldy #BufferLen
lbsr Writeln print buffer
lbsr PutAddress
leax 1,x skip a space
puls y
GoOn cmpu #UpLimit have we reached the end?
bne MainLoop if not, go on
rts
PutAddress equ * U=address, X->4-byte output buffer
pshs d
tfr u,d
bsr ToHex
tfr b,a
bsr ToHex
puls d,pc
ToHex equ * A=byte, X->2-byte output buffer
pshs d save D and flags
tfr a,b save A in B
lsra down 4 bits
lsra
lsra
lsra
bsr ToLetter convert to hex letter in A
sta ,x+ put it in buffer
tfr b,a get back original value
anda #$0F mask off MSN
bsr ToLetter --- do the above for second nibble ---
sta ,x+
puls d,pc restore D and return
ToLetter equ * A=[IN] value (LSN) [OUT] hex digit
cmpa #$0A if less than 10, it's a number
blo ToNumber
suba #$0A
adda #'A'
rts
ToNumber adda #'0'
rts
********** SYSTEM SUBROUTINES **********
Beep equ * Ring the bell
bra Beeper
Bell fcb 7
Beeper pshs x,y
leax Bell,pcr
ldy #1
bsr Write
puls x,y,pc
Writeln equ * Display a string followed by newline
pshs d
lda #OS9_StdOut
swi2
fcb I_Writln
puls d,pc
Write equ * Display a string
pshs d
lda #OS9_StdOut
swi2
fcb I_Write
puls d,pc
Readln equ * Read a string followed by newline
pshs d
lda #OS9_StdIn
swi2
fcb I_Readln
puls d,pc
Read equ * Read a string
pshs d
lda #OS9_StdIn
swi2
fcb I_Read
puls d,pc
end Begin
| 37.212435 | 92 | 0.402256 |
4ce134e5011c2aa530ca5577d12faa7ef394cd78 | 74,680 | asm | Assembly | base/mvdm/wow16/kernel31/ldboot.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/mvdm/wow16/kernel31/ldboot.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/mvdm/wow16/kernel31/ldboot.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | PAGE ,132
TITLE LDBOOT - BootStrap procedure
?DFSTACK = 1
.xlist
include kernel.inc
include newexe.inc
include tdb.inc
include pdb.inc
include protect.inc
include gpcont.inc
ifdef WOW
include vint.inc
include doswow.inc
endif
.list
if 0; KDEBUG
ifdef WOW
BootTraceOn = 1
BootTrace macro char
push ax
mov ax,char
int 3
pop ax
endm
else
BootTraceOn = 1
BootTrace macro char
push char
call BootTraceChar
endm
endif
else
BootTrace macro char
endm
BootTraceOn = 0
endif
; Note that the following public constants require special handling
; for ROM Windows. If you add, delete, or change this list of constants,
; you must also check the ROM Image Builder.
public __ahshift
public __ahincr
public __0000h
public __0040h
public __A000h
public __B000h
public __B800h
public __C000h
public __D000h
public __E000h
public __F000h
public __ROMBIOS
public __WinFlags
public __flatcs
public __flatds
public __MOD_KERNEL
public __MOD_DKERNEL
public __MOD_USER
public __MOD_DUSER
public __MOD_GDI
public __MOD_DGDI
public __MOD_KEYBOARD
public __MOD_SOUND
public __MOD_SHELL
public __MOD_WINSOCK
public __MOD_TOOLHELP
public __MOD_MMEDIA
public __MOD_COMMDLG
ifdef FE_SB
public __MOD_WINNLS
public __MOD_WIFEMAN
endif ; FE_SB
__ahshift = 3
__ahincr = 1 shl __ahshift
__0000h = 00000h
__0040h = 00040h
__A000h = 0A000h
__B000h = 0B000h
__B800h = 0B800h
__C000h = 0C000h
__D000h = 0D000h
__E000h = 0E000h
__F000h = 0F000h
__ROMBIOS = 0F000h
__WinFlags = 1
__flatcs = 1Bh
__flatds = 23h
__MOD_KERNEL = 0h
__MOD_DKERNEL = 0h
__MOD_USER = 0h
__MOD_DUSER = 0h
__MOD_GDI = 0h
__MOD_DGDI = 0h
__MOD_KEYBOARD = 0h
__MOD_SOUND = 0h
__MOD_SHELL = 0h
__MOD_WINSOCK = 0h
__MOD_TOOLHELP = 0h
__MOD_MMEDIA = 0h
__MOD_COMMDLG = 0h
ifdef FE_SB
__MOD_WINNLS = 0h ; for IME
__MOD_WIFEMAN = 0h ; for WIFEMAN
endif ; FE_SB
BOOTSTACKSIZE = 512
EXTRASTACKSIZE = (4096-BOOTSTACKSIZE)
MultWIN386 EQU 16h ; Reserved to Win386
MW3_ReqInstall EQU 00h ; Installation check
MW3_ReqInstall_Ret_1 EQU 0FFh ; Return number 1
MW3_ReqInstall_Ret_2 EQU 01h ; Return number 2
MW3_ReqInstall_Ret_3 EQU 02h ; Return number 3
MW3_ReqInstall_Ret_4 EQU 03h ; Return number 4
DOS_FLAG_OFFSET EQU 086h
externFP lstrlen
externFP lstrcat
externFP lstrcpy
externFP IGlobalAlloc
externFP IGlobalFree
externFP IGlobalRealloc
externFP LoadModule
externFP IOpenFile
externFP lrusweep
externFP GetExePtr
externFP GetProfileInt
externFP GetPrivateProfileString
externFP GetPrivateProfileInt
externFP GetProcAddress
externFP GetTempDrive
externFP ExitKernel
externFP InternalEnableDOS
externFP FlushCachedFileHandle
externFP SetHandleCount
externFP IPrestoChangoSelector
externFP GPFault
externFP StackFault
externFP invalid_op_code_exception
externFP page_fault
ifdef WOW
externFP divide_overflow
externFP single_step
externFP breakpoint
endif
externFP DiagInit
ifdef WOW
externFP StartWOWTask
externFP AllocSelector_0x47
externW MOD_KERNEL
externW ModCount
externFP WOWGetTableOffsets
externFP WOWDosWowInit
externFP GetShortPathName
endif
if KDEBUG
externFP ValidateCodeSegments
endif
ifdef FE_SB
externFP GetSystemDefaultLangID
endif
externFP TermsrvGetWindowsDir
externW pStackBot
externW pStackMin
externW pStackTop
sBegin CODE
externFP Int21Handler
externFP Int10Handler
externD prevInt10proc
sEnd CODE
;------------------------------------------------------------------------
; Data Segment Variables
;------------------------------------------------------------------------
DataBegin
if SHERLOCK
externW gpEnable
endif
externB graphics
externB fBooting
externB Kernel_flags
externB fChkSum
externB fCheckFree
externB WOAName
externB grab_name
ifndef WOW
externB szUserPro
endif
externB szBootLoad
externB szCRLF
externB szMissingMod
externB szPleaseDoIt
externB fPadCode
;externW EMScurPID
;externW PID_for_fake
externW cBytesWinDir
externW cBytesSysDir
externW pGlobalHeap
externW hExeHead
externW MaxCodeSwapArea
externW curTDB
externW f8087
externB fastFP
externW topPDB
externW headTDB
externW winVer
externD Dos_Flag_Addr
ifndef WOW
externB WinIniInfo
externB PrivateProInfo
endif
externW gmove_stack
externW prev_gmove_SS
externW BaseDsc
externW WinFlags
externW hUser
externW hShell
externW MyCSSeg
externW MyDSSeg
externW MyCSAlias
externB fhCache
externW fhCacheEnd
externW fhCacheLen
externB fPokeAtSegments
externB fExitOnLastApp
externW segLoadBlock
externD pKeyProc
externD pKeyProc1
externW wDefRIP
externW cpShrunk
externW cpShrink
externW hLoadBlock
externD pTimerProc
externD pExitProc
externD pDisableProc
externD lpWindowsDir
externD lpSystemDir
;if KDEBUG and SWAPPRO
;externD prevIntF0proc
;endif
externD lpInt21 ; support for NOVELL stealing int 21h
ifdef WOW
externD pFileTable
externW cBytesSys16Dir
externD lpSystem16Dir
externB Sys16Suffix
externW cBytesSys16Suffix
externW cBytesSysWx86Dir
externD lpSystemWx86Dir
externB SysWx86Suffix
externW cBytesSysWx86Suffix
externD pPMDosCURDRV
externD pPMDosCDSCNT
externD pPMDosPDB
externD pPMDosExterr
externD pPMDosExterrLocus
externD pPMDosExterrActionClass
externD pDosWowData
globalW cbRealWindowsDir,0
WINDIR_BUFSIZE equ 121
achWindowsDir DB WINDIR_BUFSIZE DUP(?)
achRealWindowsDir DB WINDIR_BUFSIZE DUP(?)
achSystem16Dir DB 128 DUP(?)
achSystemWx86Dir DB 128 DUP(?)
public cbRealWindowsDir, achRealWindowsDir, achWindowsDir, achSystem16Dir
externB achTermSrvWindowsDir ; windows directory path (for win.ini)
endif
DataEnd
;------------------------------------------------------------------------
; INITDATA Variables
;------------------------------------------------------------------------
DataBegin INIT
ifndef WOW
; WOW doesn't muck with the WOAName buffer -- we just leave it
; as WINOLDAP.MOD
externB woa_286
externB woa_386
endif
externB bootExecBlock
externW oNRSeg
externW oMSeg
externW win_show
externD lpBootApp
staticW initTDBbias,0
staticW initSP,0
staticW initSSbias,0
staticW segNewCS,0
app_name db 68 dup(0)
DataEnd INIT
;------------------------------------------------------------------------
; EMSDATA Variables
;------------------------------------------------------------------------
;------------------------------------------------------------------------
externNP LoadSegment
externNP genter
externNP gleave
externNP GlobalInit
externNP DeleteTask
externNP BootSchedule
externNP InitFwdRef
externNP SaveState
externNP LKExeHeader
externNP GetPureName
externNP SegmentNotPresentFault
externNP LDT_Init
externNP alloc_data_sel
externNP get_physical_address
externNP set_physical_address
externNP set_sel_limit
externNP free_sel
externFP set_discarded_sel_owner
externNP SelToSeg
externNP DebugDefineSegment
externNP DebugFreeSegment
externNP SwitchToPMODE
externNP LKAllocSegs
ifdef WOW
externFP WOWFastBopInit
endif
if KDEBUG
if SWAPPRO
externB fSwapPro
externW hSwapPro
externW cur_dos_pdb
endif
endif
ifdef FE_SB
externFP FarMyIsDBCSTrailByte
endif
;------------------------------------------------------------------------
sBegin INITCODE
assumes cs,CODE
externD prevIntx6proc
externD prevInt0Cproc
externD prevInt0Dproc
externD prevInt0Eproc
externD prevInt21proc
externD prevInt3Fproc
ifdef WOW
externD prevInt01proc
externD prevInt03proc
externD oldInt00proc
externFP GlobalDosAlloc
externFP GlobalDosFree
endif
externNP TextMode
externNP InitDosVarP
externNP GrowSFTToMax
ifndef WOW
externNP SetUserPro
endif
externNP MyLock
externNP Shrink
externNP DebugDebug
externNP NoOpenFile
externNP NoLoadHeader
if SDEBUG
externNP DebugInit
endif
;if SWAPPRO
;externNP INTF0Handler
;endif
if SDEBUG
szModName db 'KERNEL',0
endif
ifdef WOW
externNP SetOwner
endif
;-----------------------------------------------------------------------;
; Bootstrap ;
; ;
; Determines whether we should initialize in a smaller amount of ;
; memory, leaving room for an EEMS swap area. If so, we rep-move the ;
; code to a lower address, and tell the PSP to report less memory ;
; available. It then does lots more of stuff. ;
; ;
; Arguments: ;
; DS:0 = new EXE header ;
; ES:0 = Program Segment Prefix block (PSP) ;
; SS:SP = new EXE header ;
; CX = file offset of new EXE header (set by KernStub) ;
; DS = automatic data segment if there is one ;
; ;
; Returns: ;
; ;
; Error Returns: ;
; ;
; Registers Preserved: ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; ;
; Sat Jun 20, 1987 06:00:00p -by- David N. Weise [davidw] ;
; Made fast booting work with real EMS. ;
; ;
; Tue Apr 21, 1987 06:31:42p -by- David N. Weise [davidw] ;
; Added some more EMS support. ;
; ;
; Thu Apr 09, 1987 02:52:37p -by- David N. Weise [davidw] ;
; Put back in the movement down if EMS. ;
; ;
; Sat Mar 14, 1987 05:55:29p -by- David N. Weise [davidw] ;
; Added this nifty comment block. ;
;-----------------------------------------------------------------------;
assumes ds,DATA
assumes es,nothing
assumes ss,nothing
cProc BootStrap,<PUBLIC,NEAR>
cBegin nogen
if KDEBUG
jmp short Hello_WDEB_End
Hello_WDEB:
db 'Windows Kernel Entry',13,10,0
Hello_WDEB_End:
push ax
push es
push si
xor ax, ax
mov es, ax
mov ax, es:[68h*4]
or ax, es:[68h*4+2]
jz @F
mov ax,cs
mov es,ax
lea si,Hello_WDEB
mov ah,47h
int 68h
@@:
pop si
pop es
pop ax
endif
BootTrace 'a'
cmp ax, "KO" ; OK to boot; set by kernstub.asm
je @F
xor ax, ax
retf
@@:
; Set up addressibility to our code & data segments
mov MyCSSeg, cs
mov MyDSSeg, ds
ifdef WOW
; Get pointer to sft so that I can find do direct protect mode
; file IO operations
mov CS:MyCSDS, ds
push es
mov ah,52h ; get pointer to internal vars
int 21h
mov ax, es
shl ax, 4
add ax, DOS_FLAG_OFFSET
sub ax, 400h
mov Dos_Flag_Addr.off, ax
mov Dos_Flag_Addr.sel, 40h
;
; Retrieve some pointers from the DosWowData structure in DOS.
;
push di
push dx
mov di, es:[bx+6ah] ;kernel data pointer
mov pDosWowData.off, di
mov pDosWowData.sel, es
mov ax, word ptr es:[di].DWD_lpCurPDB
; mov dx, word ptr es:[di].DWD_lpCurPDB+2
mov pPMDosPDB.off,ax
mov pPMDosPDB.sel,0 ;to force gpfault if not ready
mov ax, word ptr es:[di].DWD_lpCurDrv
; mov dx, word ptr es:[di].DWD_lpCurDrv+2
mov pPMDosCURDRV.off,ax
mov pPMDosCURDRV.sel,0 ;to force gpfault if not ready
mov ax, word ptr es:[di].DWD_lpCDSCount
; mov dx, word ptr es:[di].DWD_lpCDSCount+2
mov pPMDosCDSCNT.off,ax
mov pPMDosCDSCNT.sel,0 ;to force gpfault if not ready
mov ax, word ptr es:[di].DWD_lpExterr
mov pPMDosExterr.off, ax
mov pPMDosExtErr.sel, 0
mov ax, word ptr es:[di].DWD_lpExterrLocus
mov pPMDosExterrLocus.off, ax
mov pPMDosExtErrLocus.sel, 0
mov ax, word ptr es:[di].DWD_lpExterrActionClass
mov pPMDosExterrActionClass.off, ax
mov pPMDosExtErrActionClass.sel, 0
pop dx
pop di
lea bx,[bx+sftHead]
mov pFileTable.off,bx
mov pFileTable.sel,es
pop es
endif ; WOW
BootTrace 'b'
call SwitchToPMODE ; BX -> LDT, DS -> CS(DS), SI start of memory
BootTrace 'c'
ReSetKernelDS
mov BaseDsc,si
call LDT_Init
BootTrace 'd'
ifdef WOW
call AllocSelector_0x47
call WOWFastBopInit
endif
if SDEBUG
; In protected mode, initialize the debugger interface NOW. Only real mode
; needs to wait until the global heap is initialized.
cCall DebugInit
; In protected mode, define where our temp Code & Data segments are
mov ax,codeOffset szModName
cCall DebugDefineSegment,<cs,ax,0,cs,0,0>
mov ax,codeOffset szModName
cCall DebugDefineSegment,<cs,ax,3,ds,0,1>
endif
BootTrace 'e'
BootTrace 'f'
ifdef WOW
push ax
push bx
mov bx, pDosWowData.sel ;use this segment
mov ax, 2
int 31h
mov pPMDosPDB.sel,ax ;make this a PM pointer
mov pPMDosCURDRV.sel,ax ;make this a PM pointer
mov pPMDosCDSCNT.sel,ax ;make this a PM pointer
mov pPMDosExterr.sel,ax
mov pPMDosExterrLocus.sel,ax
mov pPMDosExterrActionClass.sel,ax
pop bx
pop ax
push pDosWowData.sel
push pDosWowData.off
call WOWDosWowInit
endif
; InitDosVarP just records a few variables, it does no hooking.
; It does dos version checking and other fun stuff that
; must be done as soon as possible.
call InitDosVarP
or ax,ax
jnz inited_ok
Debug_Out "KERNEL: InitDosVarP failed"
mov ax,4CFFh ; Goodbye!
INT21
inited_ok:
BootTrace 'g'
push bx
mov bx, WinFlags
ifndef JAPAN ; should be removed because of IBM dependent code.
; InitFwdRef routine will set 80x87 status bit in WinFlags
; and exported location #178.
; Determine if there is a co-processor present.
int 11h ; get equipment word
test al,2 ; this is the IBM approved method
jz no_80x87 ; to check for an 8087
or bh,WF1_80x87
no_80x87:
endif ;NOT JAPAN
ifdef WOW
or bh,WF1_WINNT ; Set NT flag ON
endif
mov WinFlags,bx
pop bx
; Determine if running under Windows/386 or the 286 DOS Extender
push bx
mov ax,(MultWin386 SHL 8) OR MW3_ReqInstall ; Win/386 install check
int 2Fh
BootTrace 'h'
cmp al,MW3_ReqInstall_Ret_4 ; Under WIN386 in pmode?
or Kernel_flags[1],kf1_Win386
or byte ptr WinFlags,WF_PMODE or WF_ENHANCED
jmps InstallChkDone
NotUnderWin386:
or Kernel_flags[2],KF2_DOSX
or byte ptr WinFlags,WF_PMODE or WF_STANDARD
InstallChkDone:
BootTrace 'i'
pop bx
ifndef WOW
; WOW doesn't muck with the WOAName buffer -- we just leave it
; as WINOLDAP.MOD
push cx
push di
push si
cld
mov cx,8
smov es,ds
mov di,dataOffset WOAName
mov si,dataOffset woa_286
test Kernel_flags[2],KF2_DOSX
jnz @F
mov si,dataOffset woa_386
@@: rep movsb
pop si
pop di
pop cx
endif
BootTrace 'j'
mov ax,cx
mov cl,4
shr ax,cl
mov cpShrunk,ax
; Compute paragraph address of new EXE header from SS:SP
mov bx,sp ; SS:SP -> new EXE header
cCall get_physical_address,<ss>
add ax,bx
adc dx,0
BootTrace 'k'
cCall alloc_data_sel,<dx,ax,0,0FFFFh>
BootTrace 'l'
mov segLoadBlock,ax ; hinitexe:0 -> new EXE header
; calculate the TDB bias
mov bx,dataOffset boottdb
mov initTDBbias,bx
; calculate the SS bias
mov bx,dataOffset stackbottom
mov initSSbias,bx
; calculate the initial SP
mov si,dataOffset stacktop
sub si,dataOffset stackbottom
mov initSP,si
cCall get_physical_address,<ds>
add ax,bx
adc dx,0
BootTrace 'm'
FCLI
mov prev_gmove_SS, ss ; Switch stack while we set up new SS
smov ss, ds
mov sp, dataOFFSET gmove_stack
cCall set_physical_address,<prev_gmove_SS>
xor ax, ax
xchg ax, prev_gmove_SS
BootTrace 'n'
mov ss,ax ; switch to new stack
mov sp,si
FSTI
xor bp,bp ; zero terminate BP chain.
sub si,BOOTSTACKSIZE
mov ss:[pStackBot],sp
mov ss:[pStackMin],sp
mov ss:[pStackTop],si
cld
mov es,topPDB
externB szNoGlobalInit
BootTrace 'o'
mov ax, BaseDsc ; Free memory starts after this
mov bx,segLoadBlock ; Make boot image be first busy block
mov cx,es:[PDB_block_len] ; cx is end of memory
mov dx,MASTER_OBJECT_SIZE
cCall GlobalInit,<dx,bx,ax,cx>
jc @F ; passed through from ginit
or ax,ax
jnz mem_init_ok
@@:
mov dx, codeoffset szNoGlobalInit
smov ds, cs
mov ah, 9
int 21h ; Whine
mov ax, 4CFFh
int 21h ; And exit
;NoGlobalInit db "KERNEL: Unable to initialise heap",13,10,'$'
mem_init_ok:
mov hLoadBlock,ax ; Save handle to first busy block
BootTrace 'p'
mov pExitProc.sel,cs
mov pExitProc.off,codeOffset ExitKernel
; Find out where we live, and where win.com lives.
mov ds,topPDB
UnSetKernelDS
mov bx,ds
mov ds,ds:[PDB_environ]
xor si,si
cld
envloop1:
lodsb
or al,al ; end of item?
jnz envloop1
lodsb
or al,al ; end of environment?
jnz envloop1
lodsw ; ignore argc, DS:SI -> kernel path
ifdef WOW
smov es, ds ; now ES:SI -> kernel path
else
call get_windir ; on return, DS:DI -> windir= value
smov es,ds
; Record where to find the 'windows' directory.
BootTrace 'q'
SetKernelDS
or di,di
jz no_win_dir_yet
mov lpWindowsDir.sel,es
mov lpWindowsDir.off,di
mov cBytesWinDir,cx
; Now set pointer to WIN.INI to be
; in the Windows directory
push si
push es
smov es, ds
mov si, dataoffset szUserPro+6
mov di, si
inc cx
add di, cx ; Move up the string WIN.INI
std
mov cx, 4
rep movsw
; Now copy Windows directory
cld
mov cx, cBytesWinDir
mov di, dataoffset szUserPro
lds si, lpWindowsDir
UnSetKernelDS
rep movsb
mov byte ptr es:[di], '\'
pop es
pop si
endif
SetKernelDS
BootTrace 'r'
no_win_dir_yet:
sub sp,SIZE OPENSTRUC + 127
mov di,sp
regptr ssdi,ss,di
mov bx,OF_EXIST
cCall IOpenFile,<essi,ssdi,bx>
BootTrace 's'
inc ax ; Test for -1
jnz opn1 ; Continue if success
mov dx, codeoffset NoOpenFile
fail1:
push dx ; Save string pointer
call textmode ; Switch to text mode
pop dx
smov ds, cs
mov ah, 9
int 21h ; Tell user why we're bailing out
mov ax,4CFFh ; Goodbye!
INT21
opn1:
; Now simulate loading ourselves from memory
; Load new EXE header for KERNEL.EXE from memory
cCall LKExeHeader,<segLoadBlock,ssdi>
BootTrace 't'
add sp,SIZE OPENSTRUC + 127
or ax,ax
jnz @F
mov dx, codeoffset NoLoadHeader
jmp SHORT fail1
@@:
mov hExeHead,ax
mov es,ax
ifndef WOW
; Record where to find the 'system' directory.
mov di,es:[ne_pfileinfo]
lea di,es:[di].opFile
mov lpSystemDir.sel,es
mov lpSystemDir.off,di
mov dx,di
call GetPureName
sub di,dx
dec di
mov cBytesSysDir,di
BootTrace 'u'
endif
; ndef WOW
; Make room at end of kernel data segment for stack--NOTE: DGROUP is
; assumed to be segment 4!
mov bx,es:[ne_segtab]
add es:[bx+(3*size NEW_SEG1)].ns_minalloc,EXTRASTACKSIZE
; Determine size of kernel's largest discardable code segment
; don't bother with swap area's anymore. Its fixed 192k (3segs)
; picked this up from Win95
xor ax,ax ; No max
mov es:[ne_swaparea],ax
BootTrace 'v'
; Allocate memory for kernel segments
cCall LKAllocSegs,<es>
mov oNRSeg,ax
mov oMSeg, bx ; Misc segment
mov es,hExeHead
; If this is a pMode debug version, the code and data segments have already
; been defined to the debugger once. We're about to LoadSegment and define
; these segments again in their final location. Use a special form of
; DebugFreeSegment to force the debugger to pull out any breakpoints in these
; segments. If we don't do this, any existing breakpoints become INT 3's
; in the new copy of the segment and the code has to be patched by hand.
; If only the debugger was smart enough to 'move' the breakpoints when it
; saw a second define for an already loaded segment...
if SDEBUG
cCall DebugFreeSegment,<cs,-1>
cCall DebugFreeSegment,<MyCSDS,-1>
endif
; Load kernel code segment 1 (resident code)
mov si,1
mov ax,-1 ; Indicate loading from memory
cCall LoadSegment,<es,si,cs,ax>
or ax,ax
jnz ll1
fail2: jmp bootfail
ll1:
mov segNewCS,ax ; Save new CS value
; Load kernel data segment (segment 4)
mov si,4
mov ax,-1
cCall LoadSegment,<hExeHead,si,ds,ax>
or ax,ax
jz fail2
BootTrace 'w'
; locate the stack in the new segment
mov bx,ax
mov si,initSP
add si,EXTRASTACKSIZE
cCall get_physical_address,<ax>
add ax,initSSbias
adc dx,0
sub ax,10h
sbb dx,0
or ax,10h
FCLI
mov prev_gmove_SS, ss ; Switch stack while we set up new SS
smov ss, ds
mov sp, OFFSET gmove_stack
cCall set_physical_address,<prev_gmove_SS>
push bx
mov bx, si
xor cx, cx ; cx:bx=stack len (for set_sel_limit)
cCall set_sel_limit,<prev_gmove_SS>
pop bx
xor ax, ax
xchg ax, prev_gmove_SS
mov ss,ax ; Switch to new stack location
mov sp,si
FSTI
mov ax,bx
; zero the new TDB
push ax
cCall get_physical_address,<ax>
add ax,initTDBbias
adc dx,0
YAH_WELL = (SIZE TDB+15) and NOT 15
cCall alloc_data_sel,<dx,ax,0,YAH_WELL>
mov es,ax
xor ax,ax
mov di,ax
mov cx,SIZE TDB
cld
rep stosb
pop ax
; put the limits in the stack
xor bp,bp ; zero terminate BP chain.
mov ss:[pStackBot],sp
mov ss:[pStackMin],sp
mov ss:[pStackTop],10h
mov ss:[0],bp ; To mark this stack as NOT linked
mov ss:[2],bp ; to another, see PatchStack.
mov ss:[4],bp
; initialize the new TDB
sub sp,SIZE TASK_REGS
mov es:[TDB_taskSS],ss
mov es:[TDB_taskSP],sp
mov cx,topPDB
mov es:[TDB_PDB],cx ; save new PDB
mov es:[TDB_DTA].off,80h ; set initial DTA
mov es:[TDB_DTA].sel,cx
mov bx,1 ; BX = 1
mov es:[TDB_nEvents],bx ; Start this guy up!
mov es:[TDB_pModule],-1 ; EMS requires -1
mov bx,winVer
mov es:[TDB_ExpWinVer],bx ; Windows Version #
mov es:[TDB_sig],TDB_SIGNATURE ; Set signature word.
; initialize the task BP and DS
push es
les bx,dword ptr es:[TDB_taskSP]
mov es:[bx].TASK_BP,bp ; initial BP = 0
mov es:[bx].TASK_DS,bp ; initial DS = 0
pop es
mov ds,ax ; switch to new DS segment
mov ax,segNewCS ; recover new CS value
push cs ; to free the selector
; do a far return to the new code segment
push ax
mov ax,codeOffset new_code
push ax
ret_far ; FAR return to new code segment
public new_code
new_code:
pop ax
push es
cCall free_sel,<ax> ; Free old CS selector
cCall IPrestoChangoSelector,<cs,MyCSAlias> ; Change our CS Alias
mov es,MyCSAlias ; Change MyCSDS to new DS
assumes es,CODE
mov ax,ds
xchg ax,es:MyCSDS
assumes es,nothing
cCall free_sel,<ax> ; Free old DS selector
call DebugDebug ; do after MyCSDS changes
mov pExitProc.sel,cs ; reset this!!
;;; pusha
;;; cCall get_physical_address,<cs>
;;; add ax, codeOffset end_page_locked
;;; adc dx, 0
;;; mov bx, dx
;;; mov cx, ax
;;; mov di, cs
;;; lsl di, di
;;; sub di, codeOffset end_page_locked
;;; xor si, si
;;; mov ax, 0601h
;;; int 31h ; Unlock some of Kernel!
;;; popa
cCall SelToSeg,<ds> ; Save DS segment value
mov MyDSSeg,ax
cCall SelToSeg,<cs> ; Set segment equivalent
mov MyCSSeg, ax
; calculate the maximum amount that we will allow SetSwapAreaSize to set
mov ax,-1 ; They can only harm themselves.
mov MaxCodeSwapArea,ax
ifndef WOW ; WOW uses 32 bit profile api's
; Allocate a handle for WIN.INI
xor ax,ax
mov bx,GA_SHAREABLE shl 8 OR GA_MOVEABLE
cCall IGlobalAlloc,<bx,ax,ax>
mov [WinIniInfo.hBuffer], ax
or ax,ax
jz nowinini
mov bx,ax ; put handle into base register
mov ax,hExeHead
mov es,ax
call set_discarded_sel_owner
; Set up the filename
mov word ptr [WinIniInfo.lpProFile], dataoffset szUserPro
mov word ptr [WinIniInfo.lpProFile][2], ds
nowinini:
; Allocate a handle for Private Profiles
xor ax,ax
mov bx,GA_SHAREABLE shl 8 OR GA_MOVEABLE
cCall IGlobalAlloc,<bx,ax,ax>
mov [PrivateProInfo.hBuffer],ax
or ax,ax
jz noprivate
mov bx,ax ; put handle into base register
mov ax,hExeHead
mov es,ax
call set_discarded_sel_owner
noprivate:
endif; WOW
ifdef WOW
; Allocate a ~128K discardable code selector to hide the
; GrowHeap - heap not sorted bugs, also present in Win 3.1.
;
; Since our system DLLs (like krnl386, user, gdi etc) contain a few
; discardable codesgements (of approx 40K), we need not be precise
;
push es
mov ax, 0C000H ; hiword is 01h , totalsize 0x1c000 bytes
mov bx, GA_MOVEABLE OR GA_DISCCODE
cCall IGlobalAlloc,<bx,01h,ax>
or ax,ax
jz short nogrowheap
cCall SetOwner, <ax, hExeHead>
nogrowheap:
pop es
endif; WOW
; Now shrink off exe header and segment 1 of KERNEL.EXE
mov si,2 ; Segment number
xor ax,ax
xchg oNRSeg,ax
nofastboot:
sub ax,cpShrunk
mov cpShrink,ax ; Amount to shrink by
cCall MyLock,<hLoadBlock>
mov bx,ax
xchg segLoadBlock,ax
cCall get_physical_address,<ax>
mov cx,dx
xchg bx,ax
cCall get_physical_address,<ax>
sub bx,ax
sbb cx,dx
REPT 4
shr cx,1
rcr bx,1
ENDM
mov ax,bx
add cpShrink,ax
push ax
cCall Shrink
pop ax
sub cpShrunk,ax
; Load kernel code segment 2 (non-resident code)
cCall MyLock,<hLoadBlock>
mov bx,-1 ; Indicate loading from memory
cCall LoadSegment,<hExeHead,si,ax,bx>
or ax,ax
jnz ll2
pop es
jmp bootfail
ll2:
inc si ; On to segment 3
xor ax, ax
xchg ax, oMSeg ; Once back only!
or ax, ax
jnz nofastboot
pop es
call genter
smov ds, es
UnSetKernelDS
SetKernelDS es
;;;mov ax,EMScurPID ; In case an EMS fast boot is going down.
;;;mov ds:[TDB_EMSPID],ax
;;;mov ax,ds:[TDB_EMSPID]
;;;mov PID_for_fake,ax
;;;mov EMScurPID,ax
mov curTDB,ds
mov headTDB,ds
push es
; vectors
SaveVec MACRO vec
mov ax, 35&vec
DOSCALL
mov [di.off], bx
mov [di.sel], es
add di, 4
ENDM
push di
mov di, TDB_INTVECS
SaveVec 00h
SaveVec 02h
SaveVec 04h
SaveVec 06h
SaveVec 07h
SaveVec 3Eh
SaveVec 75h
ifdef WOW
;; Hook Int10 so we can filter calls in WOW (see intnn.asm)
push es
push ds
mov ax,3510h
INT21
mov ax,codeOffset prevInt10proc
SetKernelCSDword ax,es,bx
mov ax,2510h
smov ds,cs
mov dx,codeOFFSET Int10Handler
INT21
pop ds
pop es
endif
pop di
cCall SaveState,<ds>
pop es
mov ds,pGlobalHeap
call gleave
UnSetKernelDS es
mov ax, 32 ; Kernel wants a big handle table
cCall SetHandleCount,<ax>
SetKernelDS
;
; The following variable initialization is done here to avoid having
; relocations in Kernel's data segment.
;
mov lpInt21.off,codeOFFSET Int21Handler
mov lpInt21.sel,cs
;
; Before we hook exception handlers, make sure the DPMI exception
; handler stack is set up the way Windows likes it.
;
mov bl,6
mov ax,0202h ; DPMI get exception handler vector
int 31h
push cx
push dx
mov cx,cs
lea dx,fixing_stack
mov bl,6
mov ax,0203h ; DPMI set exception handler vector
int 31h
pop dx
pop cx
;
; Generate an invalid opcode exception fault. This causes DPMI to call
; our "exception handler."
;
db 0fh,0ffh
fixing_stack:
push bp
mov bp,sp ; BP -> BP RETIP RETCS EC IP CS FL SP SS
;
; Restore the previous invalid exception handler vector.
;
mov bl,6
mov ax,0203h
int 31h
;
; Replace the return address on the DPMI fault handler routine with
; our exit code.
;
lea ax,done_fixing_stack
mov [bp+8],ax
mov [bp+10],cs
lea ax,[bp+16]
mov ss:[pStackBot],ax
mov ss:[pStackMin],sp
mov ss:[pStackTop],offset pStackBot + 150
mov sp,bp
pop bp
retf
done_fixing_stack:
mov es, MyCSAlias
assumes es, CODE
; Hook not present fault for segment reloader.
mov ax,0202h ; Record old not present fault.
mov bl,0Bh
int 31h
mov prevInt3Fproc.off,dx
mov prevInt3Fproc.sel,cx
mov ax,0203h ; Hook not present fault.
mov cx,cs
mov dx,codeOffset SegmentNotPresentFault
int 31h
; Hook GP fault in order to terminate app.
mov bl, 0Dh ; GP Fault
mov ax, 0202h
int 31h
mov prevInt0Dproc.off, dx
mov prevInt0Dproc.sel, cx
mov ax, 0203h
mov cx, cs
mov dx, codeOffset GPFault
int 31h
; Hook invalid op-code in order to terminate app.
mov bl, 06h ; invalid op-code
mov ax, 0202h
int 31h
mov prevIntx6proc.off, dx
mov prevIntx6proc.sel, cx
mov ax, 0203h
mov cx, cs
mov dx, codeOffset invalid_op_code_exception
int 31h
; Hook stack fault in order to terminate app.
mov bl, 0Ch ; stack fault
mov ax, 0202h
int 31h
mov prevInt0Cproc.off, dx
mov prevInt0Cproc.sel, cx
mov ax, 0203h
mov cx, cs
mov dx, codeOffset StackFault
int 31h
; Hook bad page fault in order to terminate app.
mov bl, 0Eh ; page fault
mov ax, 0202h
int 31h
mov prevInt0Eproc.off, dx
mov prevInt0Eproc.sel, cx
mov ax, 0203h
mov cx, cs
mov dx, codeOffset page_fault
int 31h
ifdef WOW
; Hook divide overflow trap in order to get better WOW debugging.
mov bl, 00h ; divide overflow
mov ax, 0202h
int 31h
mov oldInt00proc.off, dx
mov oldInt00proc.sel, cx
mov ax, 0203h
mov cx, cs
mov dx, codeOffset divide_overflow
int 31h
; Hook single step trap in order to get better WOW debugging.
mov bl, 01h ; single step
mov ax, 0202h
int 31h
mov prevInt01proc.off, dx
mov prevInt01proc.sel, cx
mov ax, 0203h
mov cx, cs
mov dx, codeOffset single_step
int 31h
; Hook breakpoint trap in order to get better WOW debugging.
mov bl, 03h ; page fault
mov ax, 0202h
int 31h
mov prevInt03proc.off, dx
mov prevInt03proc.sel, cx
mov ax, 0203h
mov cx, cs
mov dx, codeOffset breakpoint
int 31h
endif
assumes es, nothing
; Do a slimy fix-up of __WinFlags containing processor and protect mode flags
xor ax,ax
mov dx,178
cCall GetProcAddress,<hExeHead,ax,dx>
mov ax,WinFlags
mov es:[bx],ax
ifdef WOW
; get WOW32 thunk table offsets and do fixups
; WARNING: WOW32 has a dependency on this being called after
; kernel is done booting and addresses are fixed
push ds
push dataoffset MOD_KERNEL
call far ptr WOWGetTableOffsets
mov si, dataoffset MOD_KERNEL
mov cx, ModCount ; # fixups to do
mov di, 570 ; first ordinal of the group (DANGER hardcoded from kernel.def)
Mexico:
push si
push di
push cx
push hExeHead
push 0
push di
call GetProcAddress
pop cx
pop di
pop si
mov ax,[si]
mov es:[bx],ax
inc si ; point to next word
inc si
inc di ; get next ordinal
loop Mexico
endif
; Do a very slimy fix-up of the runtime constant __0000h
cCall GetProcAddress,<hExeHead,0,183>
mov si,bx
mov bx,00000h
mov ax,2
int 31h
mov es:[si],ax
; Do a very slimy fix-up of the runtime constant __0040h
cCall GetProcAddress,<hExeHead,0,193>
mov si,bx
mov bx,00040h
mov ax,2
int 31h
mov es:[si],ax
; Do a very slimy fix-up of the runtime constant __ROMBIOS
cCall GetProcAddress,<hExeHead,0,173>
mov si,bx
mov bx,0F000h
mov ax,2
int 31h
mov es:[si],ax
; Do a very slimy fix-up of the runtime constant __F000h
cCall GetProcAddress,<hExeHead,0,194>
mov si,bx
mov bx,0F000h
mov ax,2
int 31h
mov es:[si],ax
; Do a very slimy fix-up of the runtime constant __A000h
cCall GetProcAddress,<hExeHead,0,174>
mov si,bx
mov bx,0A000h
mov ax,2
int 31h
mov es:[si],ax
; Do a very slimy fix-up of the runtime constant __B000h
cCall GetProcAddress,<hExeHead,0,181>
mov si,bx
mov bx,0B000h
mov ax,2
int 31h
mov es:[si],ax
; Do a very slimy fix-up of the runtime constant __B800h
cCall GetProcAddress,<hExeHead,0,182>
mov si,bx
mov bx,0B800h
mov ax,2
int 31h
mov es:[si],ax
; Do a very slimy fix-up of the runtime constant __C000h
cCall GetProcAddress,<hExeHead,0,195>
mov si,bx
mov bx,0C000h
mov ax,2
int 31h
mov es:[si],ax
; Do a very slimy fix-up of the runtime constant __D000h
cCall GetProcAddress,<hExeHead,0,179>
mov si,bx
mov bx,0D000h
mov ax,2
int 31h
mov es:[si],ax
; Do a very slimy fix-up of the runtime constant __E000h
cCall GetProcAddress,<hExeHead,0,190>
mov si,bx
mov bx,0E000h
mov ax,2
int 31h
mov es:[si],ax
ifndef WOW
cCall SetUserPro ; Get WIN.INI filename from environment
endif
CheckKernelDS
; Free high memory copy of KERNEL.EXE
cCall IGlobalFree,<hLoadBlock>
mov hLoadBlock,ax
.386
mov fs, ax
mov gs, ax
.286p
ifndef WOW
cmp lpWindowsDir.sel,ax
jnz got_win_dir
mov si,dataOffset szUserPro
mov di,dataOffset [WinIniInfo.ProBuf]
cCall IOpenFile,<dssi,dsdi,OF_PARSE>
lea di,[di].opfile
mov lpWindowsDir.sel,ds
mov lpWindowsDir.off,di
mov dx,di
call GetPureName
sub di,dx
dec di
mov cBytesWinDir,di
got_win_dir:
endif
ifdef WOW
; Regular Windows kernel sets up the Windows directory very early in
; boot, before WOW kernel loads WOW32.DLL.
;
; It turns out we can delay setting up the 16-bit copy of the
; windows directory (referred by lpWindowsDir) until here, where
; we're in protected mode and about to set up the system directories
; as well. This allows us to call a GetShortPathName thunk in
; WOW32.
;
mov ds,topPDB
UnSetKernelDS
mov ds,ds:[PDB_environ]
call get_windir ; on return, DS:DI -> windows dir
smov es,ds
SetKernelDS
; Record where to find the 'windows' directory.
BootTrace 'q'
mov lpWindowsDir.sel,es
mov lpWindowsDir.off,di
mov cBytesWinDir,cx
; Record where to find the 'system32' directory.
mov ax,hExeHead
mov es,ax
mov di,es:[ne_pfileinfo]
lea di,es:[di].opFile
mov lpSystemDir.sel,es
mov lpSystemDir.off,di
mov dx,di
call GetPureName
sub di,dx
dec di
mov cBytesSysDir,di
BootTrace 'u'
;
; Under WOW there are two system directories: \nt\system and \nt\system32.
; lpSystemDir points to \nt\system32, while lpSystem16Dir points to
; \nt\system. We return the latter from GetSystemDirectory, since we want
; applications to install their shared stuff in \nt\system, but we want
; to search \nt\system32 before \nt\system when loading modules.
; Set up lpSystem16Dir using the Windows dir + \system.
; Note that the string pointed to by lpSystem16Dir is not null terminated!
mov lpSystem16Dir.sel,ds
mov lpSystem16Dir.off,dataoffset achSystem16Dir
cld
mov si,dataoffset achRealWindowsDir
mov es,lpSystem16Dir.sel
mov di,lpSystem16Dir.off
mov cx,cbRealWindowsDir
rep movsb ; copy Windows dir
mov si,dataoffset Sys16Suffix
mov cx,cBytesSys16Suffix
rep movsb ; tack on "\system"
mov cx,cbRealWindowsDir
add cx,cBytesSys16Suffix
mov cBytesSys16Dir,cx
;
; build the Wx86 system directory "Windir\Sys32x86"
;
mov lpSystemWx86Dir.sel,ds
mov lpSystemWx86Dir.off,dataoffset achSystemWx86Dir
mov es,lpSystemWx86Dir.sel
mov di,lpSystemWx86Dir.off
mov cx,cbRealWindowsDir
mov si,dataoffset achRealWindowsDir
rep movsb ; copy System dir (Windows\System32)
mov si,dataoffset SysWx86Suffix
mov cx,cBytesSysWx86Suffix
rep movsb ; tack on "\Wx86"
mov cx,cbRealWindowsDir
add cx,cBytesSysWx86Suffix
mov cBytesSysWx86Dir,cx
@@:
; WOW DPMI Supports wants to call GlobalDosAlloc and GlobalDosFree so that
; We don't have to write the same code for DPMI support. So we call DPMI
; Here with the addresses of those routines so he can call us back.
mov bx,cs
mov si,bx
mov dx,codeOffset GlobalDosAlloc
mov di,codeOffset GlobalDosFree
mov ax,4f3h
int 31h
; Now that we've built up the system dir from the windows dir, set
; the windows dir to where it should be for this user.
push es
cld
mov di,offset achTermsrvWindowsDir
cCall TermsrvGetWindowsDir,<ds, di, MaxFileLen>
or ax, ax
jz @F ; ax = 0 -> error, just leave windows dir
smov es,ds
mov cx,-1
xor ax,ax
repnz scasb
not cx
dec cx ; length of windows directory
mov lpWindowsDir.sel,ds
mov lpWindowsDir.off,offset achTermsrvWindowsDir
mov cBytesWinDir,cx
@@:
pop es
endif
; Under win 2.11 we allowed the ":" syntax to replace the shell.
; We no longer allow this, however to avoid messing up people
; with batch files that have ":" in them we will strip the
; ":" out of the command line. But we retain the :: syntax
; for the OS/2 VM!!
; We also do the check for the /b switch here. This puts us in "diagnostic
; mode and we set a flag to say this. Later, we will call the DiagInit()
; function to open the log file, etc.
push ds
cld
mov ds,topPDB
UnSetKernelDS
push ds
pop es
mov si,80h
xor ax,ax
lodsb
or al,al
jz no_colon
mov cx,ax
@@: lodsb
cmp al,' '
loopz @B
cmp al,':'
jnz no_colon
cmp byte ptr [si],':'
jz no_colon
mov byte ptr [si][-1],' '
no_colon:
cmp al,'/' ;Switch character?
je CheckSwitch ;Yes
cmp al,'-' ;Other switch character?
jne NoSwitch ;Nope.
CheckSwitch:
lodsb ;Get next char
or al,32 ;Convert to lowercase if necessary
cmp al,'b' ;Diagnostic mode?
jnz NoSwitch ;Nope
cCall DiagInit ;Initialize diagnostic mode
mov WORD PTR [si-2],2020h ;Blank out the switch
NoSwitch:
pop ds
ReSetKernelDS
;** Reset secret flag for memory manager. Fixed segments will go
;** >1MB after this
and fBooting, NOT 2
;** We want to grow the SFT *before* loading the modules,
;** not after, like was the case previous to win3.1
call GrowSFTToMax ;add to SFT chain in p mode
if 1
; old ldinit.c
cld
push ds
smov es,ds
xor ax,ax
xor cx,cx
mov ds,topPDB
UnSetKernelDS
mov si,80h
lodsb
or al,al
jz gwaphics_done
mov cl,al
lodsb
cmp al,' '
mov al,ah
jnz gwaphics_done
lodsb
cmp al,':'
mov al,ah
jnz gwaphics_done
lodsb
cmp al,':'
mov al,ah
jnz gwaphics_done
mov di,dataOffset app_name
find_delineator:
lodsb
stosb
cmp al,' '
ja find_delineator
mov es:[di][-1],ah
mov ds:[80h],ah ; assume no arguments
jnz gwaphics_done
add cx,82h
sub cx,si
smov es,ds
mov di,80h
mov al,cl
stosb
rep movsb
gwaphics_done:
pop ds
ReSetKernelDS
or ax,ax
jz @F
mov graphics,0
@@:
else
cld
xor ax,ax
xor bx,bx
endif
jmps SlowBoot
bootfail:
mov al,1
cCall ExitKernel,<ax>
cEnd nogen
sEnd INITCODE
;-----------------------------------------------------------------------;
; SlowBoot ;
; ;
; ;
; Arguments: ;
; ;
; Returns: ;
; ;
; Error Returns: ;
; ;
; Registers Preserved: ;
; ;
; Registers Destroyed: ;
; ;
; Calls: ;
; ;
; History: ;
; ;
; Sat Mar 14, 1987 05:52:22p -by- David N. Weise [davidw] ;
; Added this nifty comment block. ;
;-----------------------------------------------------------------------;
DataBegin INIT
BootSect db 'BOOT',0
BootFile db 'SYSTEM.INI',0
FilesCached db 'CACHEDFILEHANDLES',0
IdleSegLoad db 'LOADSEGMENTSATIDLE',0
ifdef WOW
ExitLastApp db 'CLOSEONLASTAPPEXIT',0
endif
if SHERLOCK
szGPC db 'GPCONTINUE',0
endif
szDebugSect db 'DEBUG',0
szOutputTo db 'OUTPUTTO', 0
szAux db 0 ;'AUX', 0 ; don't return a default
if KDEBUG
szKRInfo db 'KERNELINFO', 0
szKRBreak db 'KERNELBREAK', 0
szWin3Info db 'WIN3INFO', 0
szWin3Break db 'WIN3BREAK', 0
endif
BootBufLen equ 80
BootBuf db BootBufLen dup (?)
bootmods label byte
DB 'SYSTEM.DRV',0
winmods label byte
ifdef WOW
DB 'KEYBOARD.DRV',0
szAfterKeyboardDriver label byte ;Used so we can tell key driver loaded
DB 'MOUSE.DRV',0
ifdef FE_SB
szBeforeWifeMan label byte ;Used so we can tell key driver loaded
DB 'WIFEMAN.DLL', 0 ;WIFE manager has to be loaded before display driver
endif
DB 'VGA.DRV',0
DB 'SOUND.DRV',0
DB 'COMM.DRV',0
DB 'USER.EXE',0
DB 'GDI.EXE',0
ifdef FE_SB
szBeforeWinNls label byte ;Used so we can tell key driver loaded
DB 'WINNLS.DLL', 0 ;bug #112335
endif
else
DB 'KEYBOARD.DRV',0
szAfterKeyboardDriver label byte ;Used so we can tell key driver loaded
DB 'MOUSE.DRV',0
ifdef FE_SB
szBeforeWifeMan label byte ;Used so we can tell key driver loaded
DB 'WIFEMAN.DLL', 0 ;WIFE manager has to be loaded before
;display driver
endif
DB 'DISPLAY.DRV',0
DB 'SOUND.DRV',0
DB 'COMM.DRV',0
DB 'FONTS.FON',0
DB 'OEMFONTS.FON',0 ; For Internationals use.
DB 'GDI.EXE',0
DB 'USER.EXE',0
ifdef FE_SB
szBeforeWinNls label byte ;Used so we can tell key driver loaded
DB 'WINNLS.DLL', 0
endif
endif
ifdef WOW
defapp label byte
DB 'WOWEXEC.EXE',0
else
defapp label byte
DB 'PROGMAN.EXE',0
endif
Shell label byte
DB 'WOWSHELL',0
;** Ordinal strings for two of the Keyboard driver exports
keymodstr DB 'KEYBOARD',0
keyprocstr DB '#5',0 ; keyprocstr = AnsiToOem
keyprocstr1 DB '#6',0 ; keyprocstr = OemToAnsi
DataEnd INIT
sBegin INITCODE
assumes cs,CODE
assumes ds,nothing
assumes es,nothing
if BootTraceOn
cProc BootTraceChar,<PUBLIC,NEAR,NODATA>, <ax, dx>
parmW char
cBegin
mov dx, 3fdh
@@: in al, dx
test al, 20h
jz @B
mov ax, char
mov dx, 3f8h
out dx, al
cEnd
endif ; BootTraceOn
cProc ttywrite,<PUBLIC,NEAR,NODATA>, <ds, si>
parmD s
cBegin
; cCall lstrlen,<s>
; mov cx, ax
; lds bx, s
; mov bx,1
; mov ah,40h
; int 21h
lds si, s
cld
mov ah, 2
tty1:
lodsb
mov dl, al
or dl, dl
jz tty2
int 21h
jmps tty1
tty2:
cEnd
ifdef WOW
cProc LoadFail,<PUBLIC,NEAR,NODATA>, <ds,si,di,cx>
parmD s
cBegin
;** Put Up a Dialog Box If we can't load a module
; since szPleaseDoIt resides in protected cs we can't concat the module
; name to it -- so we need to copy it to the stack
;szPleaseDoIt db "Please re-install the following module to your system32
; directory: ",13,10,9,9,0
mov di,sp ; save current stack pointer
sub sp,100h ; allocate for new concat'd string on the stack
mov si,sp ; save the start of the stack string
push ss ; copy szPleaseDoIt to the stack buffer
push si
push cs
push codeOFFSET szPleaseDoIt
call lstrcpy
push ss ; concat module name to string on stack
push si
lds cx, s ; get the module name
push ds
push cx
call lstrcat
push ss ;push finished stack string now
push si
push cs ;szMissingMod db "KERNEL: Missing 16-bit module:",0
push codeOFFSET szMissingMod ; Set Caption
push 0 ;No left button
push SEB_CLOSE + SEB_DEFBUTTON ;Button 1 style
push 0 ;No right button
externFP kSYSERRORBOX
call kSYSERRORBOX ;Put up the system message
mov sp,di ; restore sp
cEnd
else // non-WOW
cProc LoadFail,<PUBLIC,NEAR,NODATA>, <ds>
parmD s
cBegin
SetKernelDS
cCall TextMode
mov bx, dataoffset szCRLF
cCall ttywrite, dsbx
mov bx, dataoffset szCRLF
cCall ttywrite, dsbx
mov bx, dataoffset szBootLoad
cCall ttywrite, dsbx
cCall ttywrite, s
mov bx, dataoffset szCRLF
cCall ttywrite, dsbx
cEnd
endif
cProc SlowBoot,<PUBLIC,NEAR>
cBegin nogen
CheckKernelDS
ReSetKernelDS
GPPI macro sect, key, defval, file, storeit
push ds
push dataoffset sect
push ds
push dataoffset key
push defval
push ds
push dataoffset file
call GetPrivateProfileInt
ifb <storeit>
mov defval, ax
endif
endm
GPPS macro sect, key, defval, here, hereLen, file
push ds
push dataoffset sect
push ds
push dataoffset key
push ds
push dataoffset defval
push ds
push dataoffset here
push hereLen
push ds
push dataoffset file
call GetPrivateProfileString
endm
GPPS1 macro sect, key, defval, here, hereLen, file
push ds
push dataoffset sect
push ds
push key
push ds
push defval
push ds
push dataoffset here
push hereLen
push ds
push dataoffset file
call GetPrivateProfileString
endm
GPI macro sect, key, defval, storeit
push ds
push dataoffset sect
push ds
push dataoffset key
push defval
call GetProfileInt
ifb <storeit>
mov defval, ax
endif
endm
if SHERLOCK
GPI szKernel, szGPC, gpEnable
endif
if KDEBUG
ifdef DISABLE
GPPI szDebugSect, szKRInfo, _krInfoLevel, BootFile
GPPI szDebugSect, szKRBreak, _krBreakLevel, BootFile
GPPI szDebugSect, szWin3Info, _Win3InfoLevel, Bootfile
GPPI szDebugSect, szWin3Break, _Win3BreakLevel, Bootfile
endif
endif ;KDEBUG
GPPS szDebugSect, szOutputTo, szAux, BootBuf, BootBufLen, BootFile
or ax, ax
jz @F
cmp ax, BootBufLen-2
jz @F
mov ah, 3ch ; creat file (zero length)
xor cx, cx
mov dx, dataOffset BootBuf
DOSCALL
jc @F
mov bx, ax
mov ah, 3eh ; now close it
DOSCALL
jc @F
mov ax, 3d42h ; open inherit, deny none, read/write
DOSCALL
jc @F
mov bx, ax ; dup handle
mov cx, 3 ; force AUX to be this file
mov ah, 46h
DOSCALL
mov ah, 3eh ; close temp file
DOSCALL
mov wDefRIP, 'i' ; since AUX is redirected, assume Ignore RIP
@@:
GPPI BootSect, FilesCached, MAXFHCACHELEN, BootFile, nostore
cmp ax, MINFHCACHELEN ; Validate length
jae @F
mov ax, MINFHCACHELEN
@@: cmp ax, MAXFHCACHELEN
jbe @F
mov ax, MAXFHCACHELEN
@@: mov fhCacheLen, ax ; Adjust # of cached file handles
shl ax, 1
shl ax, 1
add ax, dataoffset fhCache
mov fhCacheEnd, ax
GPPI BootSect, IdleSegLoad, 1, BootFile, nostore
mov fPokeAtSegments, al
ifdef WOW
GPPI BootSect, ExitLastApp, 0, BootFile, nostore
mov fExitOnLastApp, al
endif
mov bootExecBlock.lpfcb1.off,dataOffset win_show
mov bootExecBlock.lpfcb1.sel,ds
mov es,topPDB
mov bootExecBlock.lpcmdline.off,80h
mov bootExecBlock.lpcmdline.sel,es
mov lpBootApp.off,dataOffset app_name
mov lpBootApp.sel,ds
cmp graphics,1
jnz sb1
mov lpBootApp.off,dataOffset defapp
mov lpBootApp.sel,ds
sb1: mov di,dataOffset bootMods
sbloop1:
cCall LoadNewExe,<di>
SetKernelDS es
mov cx,-1
xor ax,ax
cld
repnz scasb
cmp di,dataOffset winmods
jb sbloop1
cmp graphics,1
jz sbloop2
; cCall InitFwdRef
jmps sb4
UnSetKernelDS es
sbloop2: ; load USER.EXE, GDI.EXE
ifdef FE_SB
;** If we just load the fae east modules, we want to
;** checks the system locale vale which is far east
;** locale.
;** If system locale is not far east, then we skip
;** to load far east module.
cmp di,dataOffset szBeforeWifeMan
je SB_DoFarEastModule
cmp di,dataOffset szBeforeWinNls
jne SB_DoLoadModule
SB_DoFarEastModule:
cCall GetSystemDefaultLangID
; return: ax is system locale value
cmp ax,411h
je SB_DoLoadModule
cmp ax,412h
je SB_DoLoadModule
cmp ax,404h
je SB_DoLoadModule
cmp ax,804h
je SB_DoLoadModule
cmp ax,0c04h
je SB_DoLoadModule
; skip to next module
mov cx,-1
xor ax,ax
cld
repnz scasb
jmp SB_NotKeyboardDriver
SB_DoLoadModule:
endif
cCall LoadNewExe,<di>
push ax ; Save hInst return value
SetKernelDS es
mov cx,-1
xor ax,ax
cld
repnz scasb
pop si ; Get hInst of latest module in SI
;** If we just loaded the keyboard driver, we want to
;** point our explicit link variables to the AnsiToOem and
;** OemToAnsi functions so OpenFile can use them for the
;** remaining boot modules
cmp di,dataOffset szAfterKeyboardDriver
jne SB_NotKeyboardDriver
push ds ; Save regs we care about
push di
regptr pStr,ds,bx
mov bx,dataOffset keyprocstr
cCall GetProcAddress,<si,pStr>
mov pKeyProc.off,ax
mov pKeyProc.sel,dx
mov bx,dataOffset keyprocstr1
cCall GetProcAddress,<si,pStr>
mov pKeyProc1.off,ax
mov pKeyProc1.sel,dx
pop di
pop ds
SB_NotKeyboardDriver:
cmp di,dataOffset defapp
jb sbloop2
; OPTIMIZE BEGIN
; OPTIMIZE END
sb4:
cCall InitFwdRef ; Gets stuff we can't dynalink to
cCall InternalEnableDOS ; Enable int21 hooks
;sb4:
call check_TEMP
; Get the shell name from SYSTEM.INI
mov ax,dataoffset Shell
GPPS1 BootSect, ax, lpBootApp.off, BootBuf, BootBufLen, BootFile
;** Here we need to convert the command line to ANSI
cmp WORD PTR pKeyProc1[2],0 ; Paranoia...
jz @F
;** Zero terminate the string before passing to OemToAnsi
mov es,bootExecBlock.lpcmdline.sel
mov bl,es:[80h] ; Get length byte
xor bh,bh
xchg BYTE PTR es:[bx+81h],bh ; Replace terminator char with zero
;** Call the keyboard driver
push es ; Save the seg reg
push bx ; Save offset and char saved
push es
push 81h ; Always starts here (fixed offset)
push es
push 81h
cCall [pKeyProc1] ; Call OemToAnsi in keyboard driver
pop bx ; Get saved info
pop es
mov al,bh ; Saved char from string
xor bh,bh
mov BYTE PTR es:[bx+81h],al ; Replace the character
@@:
mov ax,dataOffset bootExecBlock
regptr dsax,ds,ax
cmp graphics,1
jz @F
cCall LoadModule,<lpBootApp,dsax>
jmps asdf
@@: cCall FlushCachedFileHandle,<hUser> ; in case 100 fonts are loaded
farptr lpBootBuf,ds,di
mov di, dataoffset BootBuf
cCall LoadModule,<lpBootBuf,dsax>
asdf:
cmp ax,32
jbe sb6
cCall GetExePtr,<ax>
mov hShell, ax
jmp bootdone
sb6:
ReSetKernelDS
les bx, lpBootApp
krDebugOut DEB_ERROR, "BOOT: unable to load @ES:BX"
cCall LoadFail,<lpBootApp>
; cmp pDisableProc.sel,0 ; Is there a USER around yet?
; jz @F
; cCall pDisableProc
;@@:
jmp bootfail
UnSetKernelDS
cEnd nogen
;------------------------------------------------------------------------
assumes ds,nothing
assumes es,nothing
cProc LoadNewExe,<PUBLIC,NEAR>,<si,di>
parmW pname
cBegin
farptr lpparm,ax,ax
farptr lpBootBuf,ds,di
mov di, dataoffset BootBuf
CheckKernelDS
ReSetKernelDS
ifdef WOW
; ATM Alters system.ini registry boot section to load its own SYSTEM.DRV
; However on WOW this causes us to fail to load correctly. Also we
; would be hard pushed to support the current 16 bit ATM since it relies
; on internals of 16 bit GDI which are not present in WOW.
; For this Beta I'm going to ignore the bootsection of the registry
; when loading drivers and thus ATM will not get installed.
; At least the user will be protected from not being able to boot WOW
; BUGBUG - Consider
; MattFe Oct9 92
mov di,pname
else
GPPS1 BootSect, pname, pname, BootBuf, BootBufLen, BootFile
endif
xor ax,ax
cCall LoadModule,<lpBootBuf,lpparm>
cmp ax,2
jne lne1
krDebugOut DEB_ERROR, "Can't find @DS:DI"
; kerror ERR_LDBOOT,<BOOT: Unable to find file - >,ds,di
jmps lne4
lne1:
cmp ax,11
jne lne2
krDebugOut DEB_ERROR, "Invalid EXE file @DS:DI"
; kerror ERR_LDBOOT,<BOOT: Invalid .EXE file - >,ds,di
jmps lne4
lne2:
cmp ax,15
jnz lne3
krDebugOut DEB_ERROR, "Invalid protect mode EXE file @DS:DI"
; kerror ERR_LDBOOT,<BOOT: Invalid protect mode .EXE file - >,ds,di
jmps lne4
lne3:
cmp ax, 4
jne lne3a
krDebugOut DEB_ERROR, "Out of files (set FILES=30 in CONFIG.SYS) @DS:DI"
; kerror ERR_LDFILES,<BOOT: Out of files, (set FILES=30 in CONFIG.SYS) loading - >,ds,di
jmps lne4
lne3a:
cmp ax, 32
jae lnex
NoLoadIt:
; kerror ERR_LDBOOT,<BOOT: Unable to load - >,ds,pname
krDebugOut DEB_ERROR, "Unable to load @DS:DI (#ax)"
lne4:
cCall LoadFail,dsdi
mov ax,1
cCall ExitKernel,<ax>
lnex:
UnSetKernelDS
cEnd
sEnd INITCODE
;-----------------------------------------------------------------------;
; BootDone ;
; ;
; Boot is done when all of modules are loaded. Here we do a bit of ;
; clean up, such as validating code segments, initing free memory to ;
; CCCC, freeing up the fake TDB, and finally reallocating the init ;
; code away. ;
; ;
; Arguments: ;
; none ;
; ;
; Returns: ;
; nothing ;
; ;
; Error Returns: ;
; ;
; Registers Preserved: ;
; ;
; Registers Destroyed: ;
; all ;
; ;
; Calls: ;
; ;
; History: ;
; ;
; Wed Apr 15, 1987 08:53:23p -by- David N. Weise [davidw] ;
; Added this nifty comment block. ;
;-----------------------------------------------------------------------;
DataBegin INIT
externB beg_initdata
szKernel DB 'KERNEL',0
szWindows DB 'WINDOWS',0
if KDEBUG
szDebugOptions DB 'DebugOptions',0
szDebugFilter DB 'DebugFilter',0
szChecksum DB 'EnableSegmentChecksum',0
szSweepFreak DB 'LRUSweepFrequency',0
sz80x87 DB 'NoUse80x87',0
szFastFP DB 'FastFP', 0
externW DebugOptions
externW DebugFilter
ifdef DISABLE
externB fLoadTrace
endif
endif ; KDEBUG
ifdef SDEBUG
szEMSDebug DB 'EnableEMSDebug',0
endif
szgrab_386 DB '386GRABBER',0
if SWAPPRO
szSwapPro DB 'SwapProfile',0
szSwapFile DB 'SWAPPRO.DAT',0
endif
DataEnd INIT
sBegin INITCODE
assumes cs,CODE
assumes ds,nothing
assumes es,nothing
externB beg_initcode
cProc BootDone,<PUBLIC,NEAR>
cBegin nogen
SetKernelDS
if KDEBUG
; Get win.ini [Windows] DebugOptions
GPI szWindows, szDebugOptions, DebugOptions
; Get win.ini [Windows] DebugFilter
GPI szWindows, szDebugFilter, DebugFilter
; Now set various internal flags based on DebugOptions
xor ax,ax
test DebugOptions,DBO_CHECKHEAP
jz @F
inc ax
@@:
mov es,pGlobalHeap
mov es:[hi_check],ax
test DebugOptions,DBO_CHECKFREE
jz @F
or Kernel_flags,kf_check_free
@@:
ifdef DISABLE
xor ax,ax
test DebugOptions,DBO_LOADTRACE
jz @F
mov fLoadTrace, al
@@:
endif ; DISABLE
test DebugOptions,DBO_DISABLEGPTRAPPING
jz wants_trapping
mov ax,0203h ; Reset GP fault.
mov bl,0Dh
mov cx,prevInt0Dproc.sel
mov dx,prevInt0Dproc.off
int 31h
mov ax,0203h ; Reset invalid op-code exception.
mov bl,06h
mov cx,prevIntx6proc.sel
mov dx,prevIntx6proc.off
int 31h
mov ax,0203h ; Reset page fault.
mov bl,0Eh
mov cx,prevInt0Eproc.sel
mov dx,prevInt0Eproc.off
int 31h
wants_trapping:
if SWAPPRO
GPI szKernel, szSwapPro, 1, nostore
mov fSwapPro, al
mov bx,TopPDB
mov ah,50h
pushf
FCLI
call prevInt21Proc
lea dx,szSwapFile
xor cx,cx
mov ah,3Ch
pushf
FCLI
call prevInt21Proc
mov hSwapPro,ax
mov bx,cur_dos_pdb
mov ah,50h
pushf
FCLI
call prevInt21Proc
endif
GPI szKernel, szChecksum, 1, nostore
mov fChkSum,al
GPI szKernel, sz80x87, 0, nostore
or ax,ax
jz wants_8087
mov f8087,0
and WinFlags,NOT WF1_80x87 ;Turn off corresponding WinFlags bit
wants_8087:
GPI szKernel, szFastFP, 1, nostore
mov fastFP, al
GPI szKernel, szSweepFreak, 500, nostore
else
mov ax, 500
endif ; KDEBUG
ifdef WOW
xor ax,ax
endif
or ax,ax
jz nolrusweep
test WinFlags[1], WF1_PAGING
jnz short nolrusweep
mov bx,codeOffset lrusweep
regptr csbx,cs,bx
xor dx,dx
cCall pTimerProc,<dx,ax,csbx>
nolrusweep:
if SDEBUG
GPI szKernel, szEMSDebug, 0, nostore
or ax,ax
jz no_EMS_debug_wanted
or Kernel_flags,kf_EMS_debug
no_EMS_debug_wanted:
endif
if LDCHKSUM
cCall ValidateCodeSegments
endif
if KDEBUG
mov fCheckFree,0
endif
; Get the shell name from SYSTEM.INI
GPPS BootSect, szgrab_386, szgrab_386, grab_name, 128, BootFile
mov es,curTDB ; ES = TDB of fake task
push es
cCall DeleteTask,<es> ; Flush bogus task
pop es
xor dx,dx
mov es:[TDB_sig],dx ; Clear signature word.
mov curTDB,dx ; Let someone else be current task
; switch to the temp stack since we're about to Realloc the present one away
mov ax, ss
FCLI
SetKernelDS ss
mov sp,dataOffset gmove_stack
FSTI
cCall free_sel,<ax>
; Shrink DGROUP down to its post initialization size
mov cx,dataOFFSET beg_initdata ; don't need init data
; dx doubles as high word and specifies fixed
; reallocation
xor dx,dx
cCall IGlobalReAlloc,<ds,dx,cx,dx> ; Realloc DGROUP
xor dx,dx
; Now shrink the resident CODE segment
mov cx,codeOFFSET beg_initcode ; dont need init code
; cCall IGlobalReAlloc,<cs,dxcx,dx>
; jmps BootSchedule ; Jump to schedule first app
push cs ; Arguments to GlobalReAlloc
push dx
push cx
push dx
push cs ; Where GlobalReAlloc will eventually return
mov ax,codeOFFSET BootSchedule
push ax
jmp near ptr IGlobalReAlloc ; Jump to GlobalReAlloc
UnSetKernelDS ss
UnSetKernelDS
cEnd nogen
;-----------------------------------------------------------------------;
; check_TEMP
;
; If the environment variable TEMP points to garbage then GetTempFile
; screws up. We fix it by wiping out the TEMP string if it points
; to garbage.
;
; Entry:
; none
;
; Returns:
;
; Registers Preserved:
; all
;
; History:
; Thu 11-May-1989 16:39:34 -by- David N. Weise [davidw]
; Wrote it.
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
cProc check_TEMP,<PUBLIC,NEAR>,<ds,es>
ifdef FE_SB
localW pMyBuf
endif
cBegin
pusha
SetKernelDS
sub sp,130
mov di,sp
CheckKernelDS
mov ds,TopPDB
UnSetKernelDS
mov ds,ds:[PDB_environ]
xor si, si ; assume DS:SI points to environment
cCall GetTempDrive,<si>
smov es,ss
cld
stosw
ifdef FE_SB
mov pMyBuf,di ; save string offset(exclude D:)
endif
stmp2:
lodsw
or al,al ; no more enviroment
ifdef FE_SB
jnz @F ; I hate this
jmp stmpNo1
@@:
else
jz stmpNo1
endif
cmp ax,'ET' ; Look for TEMP=
jne stmp3
lodsw
cmp ax,'PM'
jne stmp3
lodsb
cmp al,'='
je stmpYes
stmp3: lodsb
or al,al
jnz stmp3
jmp stmp2
stmpYes:
push si ; save pointer to TEMP
push ds
push si ; spaces are legal, but they
lookForSpace: ; confuse too many apps, so
lodsb ; we treat them as illegal
cmp al, ' '
jz stmpFoundSpace
or al, al
jnz lookForSpace
pop si
cmp byte ptr [si+1],':'
jne stmpnodrive
and byte ptr [si],NOT 20h ; springboard needs this!
dec di
dec di
stmpnodrive:
lodsb
or al,al
jz stmpNo
stosb
jmp stmpnodrive
stmpNo:
mov ax,'~\'
cmp es:[di-1],al ; does it already end in \
jnz stmpNoF ; no, just store it
dec di ; override it
ifdef FE_SB
push si
mov si,pMyBuf
call FarMyIsDBCSTrailByte ;is that '\' a DBCS trailing byte?
cmc
adc di,0 ;skip it if yes.
pop si
endif
stmpNoF:
stosw
xor ax,ax
stosb ; zero terminate it
pop es ; recover pointer to TEMP
pop di
smov ds,ss
mov dx,sp
mov ax,5B00h
xor cx,cx
DOSCALL
jnc stmpClose
cmp al,80 ; Did we fail because the file
jz stmpNo1 ; already exists?
stmpNukeIt:
sub di,5 ; Get the TEMP= part.
@@: mov al,'x'
xchg al,es:[di]
inc di
or al,al
jnz @B
mov byte ptr es:[di-1],0
jmps stmpNo1
stmpClose:
mov bx,ax
mov ah,3Eh
DOSCALL
mov ah,41h
DOSCALL
stmpNo1:
add sp,130
popa
cEnd
stmpFoundSpace:
pop si
pop es
pop di
jmps stmpNukeIt
;-----------------------------------------------------------------------;
; get_windir
;
; Get a pointer to the 'windows' directory.
;
; Entry:
; DS => environment string
;
; Returns:
; CX = length of string
; DI => WFP of 'windows' directory
;
; Registers Preserved:
; all
;
; History:
; Mon 16-Oct-1989 23:17:23 -by- David N. Weise [davidw]
; Wrote it!
;-----------------------------------------------------------------------;
assumes ds,nothing
assumes es,nothing
ifdef WOW
;-----------------------------------------------------------------------;
; original get_windir looks for the environment variable 'windir' (all
; lowercase) to set the 'windows' directory.
;
; On NT the equivalent environment variable is 'SystemRoot' (all
; uppercase). Hence the code is different.
;
; - nanduri
;
; There are some customers that used the undocumented trick on win31
; of moving windir to some network location by putting win.com there.
; The result would be that the "Windows Directory" would point
; to the network location, and the system directory would be local.
; Currently, the way WINDIR is supported involves hacks in a couple
; of different places. What would be best is if you could do a
; "set windir=xxxx" in your autoexec.nt and we would look for windir
; here and we would code it to emulate win31 behavior. However, that's
; broken right now, and windir is only regenerated after krnlx86.exe
; has finished booting. So the approach taken here is to look for
; a new environment variable called win16dir, and if it exists, make
; the windows directory point to it. Systemroot is still used to
; generate the system directory.
;
; We want to allow NT to be installed into a directory with a long
; name, so we use GetShortPathName on the directory we get from
; either SystemRoot or Win16Dir variables.
; -- DaveHart 9-Feb-96
;-----------------------------------------------------------------------;
szSystemRoot DB 'SYSTEMROOT=',0
szWin16Dir DB 'WIN16DIR=',0
cProc get_windir,<PUBLIC,NEAR>
cBegin nogen
push es
mov ax, cs ; the string is in 'cs', see above
mov es, ax
mov di, codeoffset szSystemRoot
call get_env_var_ptr
push dx
mov dx, ds
mov es, dx
SetKernelDS
mov si, dataoffset achRealWindowsDir
regptr esdi,es,di
regptr dssi,ds,si
mov cx, WINDIR_BUFSIZE
push dx
cCall GetShortPathName, <esdi, dssi, cx>
pop dx
mov cbRealWindowsDir,ax
mov ds, dx ;restore ds
pop dx
assumes ds,nothing
push cx
push di
mov ax, cs ; the string is in 'cs', see above
mov es, ax
mov di, codeoffset szWin16Dir
call get_env_var_ptr
or di, di ;does win16dir exist?
jz gw_not
add sp, 4 ;throw away systemroot
jmp short gw_cont
gw_not:
pop di
pop cx
gw_cont:
; Now ds:di points to the Windows directory string in
; the environment block. It may be a long pathname,
; so fix it up.
smov es, ds
SetKernelDS
mov si, dataoffset achWindowsDir
regptr esdi,es,di
regptr dssi,ds,si
mov cx, WINDIR_BUFSIZE
cCall GetShortPathName, <esdi, dssi, cx>
mov cx, ax
smov ds, es
assumes ds,nothing
pop es
ret
cEnd nogen
cProc get_env_var_ptr,<PUBLIC,NEAR>
cBegin nogen
cld
push si
xor si,si
push di
mov cx,-1
xor ax,ax
repnz scasb
not cx
dec cx ; length of szSystemRoot
pop di
gw_cmp:
mov al, [si]
or al, al
jz gw_exit
push di
push cx
repz cmpsb ; compare the inputstring with szSystemRoot
pop cx
pop di
jnz gw_next ; not szSystemRoot
xor cx,cx ; yes szSystemRoot, cx=0 indicates so
mov di,si
gw_next:
lodsb
or al,al
jnz gw_next ; skip to the terminating NULL.
or cx,cx ; cx==0 implies... found szSystemRoot
jnz gw_cmp ; compare with the next environment string
mov cx,si ; here if found szSystemRoot.
sub cx,di
mov ax,di
dec cx
gw_exit:
mov di,ax
pop si
ret
cEnd nogen
;-----------------------------------------------------------------------;
; original get_windir is within the 'else' 'endif' block
;
;-----------------------------------------------------------------------;
else
cProc get_windir,<PUBLIC,NEAR>
cBegin nogen
cld
push si
xor di,di
xor si,si
gw: lodsw
or al,al ; no more enviroment
jz gw_exit
cmp ax,'iw' ; Look for windir=
jne @F
lodsw
cmp ax,'dn'
jne @F
lodsw
cmp ax,'ri'
jne @F
lodsb
cmp al,'='
je gw_got_it
@@: lodsb
or al,al
jnz @B
jmp gw
gw_got_it:
mov di,si
@@: lodsb
or al,al
jnz @B
mov cx,si
sub cx,di
dec cx
gw_exit:
pop si
ret
cEnd nogen
endif
sEnd INITCODE
;------------------------------------------------------------------------
sBegin STACK
; Boot TDB
boottdb equ this byte
DB SIZE TDB dup (0)
; do a clumsy paragraph alignment
rept 16
if ($ - boottdb) and 0Fh
db 0
endif
endm
; Dummy arena entry so boot SS looks like a valid object
DB 'M'
DW -1
DW (BOOTSTACKSIZE + 31)/16
DB 0
DW 5 DUP (0)
; Another in case we have to tweek the low order bit of SS
DB 'M'
DW -1
DW (BOOTSTACKSIZE + 15)/16
DB 0
DW 5 DUP (0)
; Boot stack
stackbottom equ this word
DB BOOTSTACKSIZE DUP (0)
stacktop equ this word
DW -1
sEnd STACK
end BootStrap
| 23.715465 | 92 | 0.576861 |
7cb5fe840c2dcb33de9fd59da0fc485bd09f2ecc | 1,917 | asm | Assembly | os/boot/print16.asm | rzakaan/os | a24104c7c9fbf18ce172575ae8fd27e7eaec341e | [
"MIT"
] | null | null | null | os/boot/print16.asm | rzakaan/os | a24104c7c9fbf18ce172575ae8fd27e7eaec341e | [
"MIT"
] | null | null | null | os/boot/print16.asm | rzakaan/os | a24104c7c9fbf18ce172575ae8fd27e7eaec341e | [
"MIT"
] | null | null | null | ;
; About
; clear screen
;
; Args
; no arguments
;
cls16:
pusha
mov ah, 0x00
mov al, 0x03 ; text mode 80x25 16 colors
int 0x10
popa
ret
;
; About
; prints the specified message to the screen
;
; Args
; bx - (ptr) it is the base address for the string
;
print16:
pusha
mov ah, 0x0e ; tty(teletype) mode
print16_loop:
mov al, [bx] ; *bx -> the value where the pointer points to
cmp al, 0
je done
int 0x10
add bx, 1 ; string[i++] increment pointer and do next loop
jmp print16_loop
done:
popa
ret
;
; About
; prints new line
;
; Args
; no args
;
; Notes
; Dec - Hex
; 10 - 0x0A - Line Feed
; 13 - 0x0D - Carriage Return
;
print16_nl:
pusha
mov ah, 0x0e
mov al, 0x0a
int 0x10
mov al, 0x0d
int 0x10
popa
ret
;
; About
; prints value to the screen in hex format
;
; Attr
; ax - working register
; bx - usage for call print value
; cx - usage for looping index
;
; Args
; dx - (ptr) data to be printed to the screen
;
; Notes
; Dec - Hex -
; 48 - 0x30 - '0'
; 57 - 0x39 - '9'
; 65 - 0x41 - 'A'
; 70 - 0x46 - '9'
print16_hex:
pusha
push cx
mov cx, 0
print16_hex_loop:
cmp cx, 4 ; cx usage for looping
je print16_hex_end
; convert last char in dx to ascii
mov ax, dx
and ax, 0x000f ; mask
add al, 0x30 ; '0'
cmp al, 0x39 ; if > 9 then represent 'A' to 'F'
jle print16_hex_loop2
add al, 7 ; 'A' is ASCII 65 instead of 58, so 65-58=7
print16_hex_loop2:
mov bx, HEX16 + 5
sub bx, cx
mov [bx], al
ror dx, 4 ; rotate right -> 0x1234 -> 0x4123 -> 0x3412 -> 0x2341 -> 0x1234
add cx, 1
jmp print16_hex_loop
print16_hex_end:
mov bx, HEX16
call print16
popa
ret
HEX16: db '0x0000',0 | 16.669565 | 88 | 0.552947 |
fa8e96d2175c9b5d8b0a51744b093b79294a5711 | 1,999 | asm | Assembly | bootloader/bootsector/stage1/stage1.asm | LetsPlaySomeUbuntu/XitongOS-test-1 | 792d0c76f9aa4bb2b579d47c2c728394a3acf9f9 | [
"MIT"
] | null | null | null | bootloader/bootsector/stage1/stage1.asm | LetsPlaySomeUbuntu/XitongOS-test-1 | 792d0c76f9aa4bb2b579d47c2c728394a3acf9f9 | [
"MIT"
] | null | null | null | bootloader/bootsector/stage1/stage1.asm | LetsPlaySomeUbuntu/XitongOS-test-1 | 792d0c76f9aa4bb2b579d47c2c728394a3acf9f9 | [
"MIT"
] | null | null | null | ;
; Stage1 Bootloader code
;
%include "config.asm"
[bits 16]
EXTERN load_lba
EXTERN print
EXTERN error
SECTION .bios_parameter_block
; Bios Parameter Block
; First 3 bytes E9 XX 90
jmp short intro
nop
; The rest of the BPB will be put by a formatting tool
SECTION .intro
intro:
; Reset CS
jmp 0x00:stage1
SECTION .text
stage1:
; We don't need any interrupts at this stage
cli
; Clear segment registers
xor ax, ax
mov ds, ax
mov es, ax
; Setup stack
mov ss, ax
mov sp, 0x7C00
mov bp, sp
; Load MBR at 0x500
mov eax, 0
mov cl, 1
mov bx, 0x500
call load_lba
int 0x13
jc error
mov si, booting_message
call print
; Find the drive we were booted from
mov dh, 1 ; partition number
mov bx, 0x500 + 0x1BE ; partition entry base, 0x1BE - start of partition table
mov cx, 4
.loop:
test byte [bx], 0x80
jnz bootable_drive_found
add bx, 0x10
inc dh
loop .loop
; No drive found
mov ah, 0xFF
jmp error
bootable_drive_found:
; Load the bootloader
mov eax, [bx + 0x08]
add eax, 2
mov bx, F_FATLOADER_MEMORY_LOCATION
mov cl, F_FATLOADER_SIZE_IN_SECTORS
call load_lba
jc error
; Magic check
mov ah, 0xFD
cmp DWORD [F_FATLOADER_MEMORY_LOCATION + F_FATLOADER_SIZE_IN_SECTORS * 0x200 - 4], F_FATLOADER_MAGIC
jne error
; Jump to bootloader
; DL - drive number
; DH - partition number
jmp 0x00:F_FATLOADER_MEMORY_LOCATION
SECTION .rodata
booting_message: db "FunnyOS Bootloader", 0
SECTION .boot_signature
dw 0xAA55
| 21.967033 | 112 | 0.535768 |
67472edfd22778b5c9b21f86b947da430f984ef1 | 5,930 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_537.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_537.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_zr_/i9-9900K_12_0xa0.log_21829_537.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x6b3c, %rbx
nop
nop
nop
nop
nop
cmp %rdi, %rdi
mov (%rbx), %eax
nop
nop
nop
nop
nop
cmp %rbx, %rbx
lea addresses_normal_ht+0x1a739, %rsi
lea addresses_UC_ht+0x18d0b, %rdi
nop
nop
nop
nop
nop
add %r11, %r11
mov $54, %rcx
rep movsw
nop
nop
nop
nop
add $49593, %rax
lea addresses_WC_ht+0xdb0b, %r11
nop
nop
nop
nop
nop
cmp $6147, %r8
mov (%r11), %rax
nop
nop
nop
nop
nop
xor $22499, %rdi
lea addresses_D_ht+0x10d0b, %rax
clflush (%rax)
sub %rcx, %rcx
movw $0x6162, (%rax)
nop
nop
nop
nop
nop
sub %r8, %r8
lea addresses_UC_ht+0x9b83, %rsi
nop
nop
nop
nop
and $26457, %rax
and $0xffffffffffffffc0, %rsi
movntdqa (%rsi), %xmm4
vpextrq $1, %xmm4, %r8
nop
nop
nop
nop
inc %rax
lea addresses_normal_ht+0xba33, %rsi
lea addresses_D_ht+0x110b, %rdi
cmp $46708, %r14
mov $126, %rcx
rep movsw
sub $12783, %r8
lea addresses_WT_ht+0x1ea8b, %r14
nop
nop
and %rdi, %rdi
mov (%r14), %r8d
nop
nop
nop
nop
nop
cmp $58882, %r11
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r8
push %rbp
push %rdx
push %rsi
// Load
lea addresses_A+0x19c03, %r8
nop
nop
nop
nop
inc %rbp
movb (%r8), %r14b
nop
inc %r12
// Faulty Load
lea addresses_UC+0x610b, %rsi
nop
nop
add $51463, %r13
mov (%rsi), %rdx
lea oracles, %r13
and $0xff, %rdx
shlq $12, %rdx
mov (%r13,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rbp
pop %r8
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 2}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_A', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'NT': True, 'same': True, 'congruent': 0, 'type': 'addresses_UC', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 4}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 7, 'type': 'addresses_WC_ht', 'AVXalign': True, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2}}
{'src': {'NT': True, 'same': False, 'congruent': 2, 'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 10, 'type': 'addresses_D_ht'}}
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4}, '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
*/
| 36.380368 | 2,999 | 0.658347 |
4e814205102dc5dcb7c3fdcdeb90c20e4bcf72be | 302 | asm | Assembly | programs/oeis/271/A271208.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/271/A271208.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/271/A271208.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A271208: a(n) = n^5 + n - 1.
; -1,1,33,245,1027,3129,7781,16813,32775,59057,100009,161061,248843,371305,537837,759389,1048591,1419873,1889585,2476117,3200019,4084121,5153653,6436365,7962647,9765649,11881401,14348933,17210395,20511177,24300029,28629181,33554463
mov $1,$0
pow $0,5
sub $1,1
add $0,$1
| 37.75 | 231 | 0.758278 |
be0ec82beb8533b8723e1023c302ce0edf172125 | 398 | asm | Assembly | oeis/220/A220236.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/220/A220236.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/220/A220236.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A220236: Binary palindromic numbers with only two 0 bits, both in the middle.
; 9,51,231,975,3999,16191,65151,261375,1047039,4191231,16771071,67096575,268410879,1073692671,4294868991,17179672575,68719083519,274877120511,1099510054911,4398043365375,17592179752959,70368731594751,281474951544831,1125899856510975
add $0,3
mov $1,2
pow $1,$0
sub $1,1
bin $1,2
mov $0,$1
sub $0,21
div $0,2
add $0,9
| 30.615385 | 232 | 0.791457 |
5f0f0c840971d8a6bf6f966e7cd0f0f3c935d5c3 | 473 | asm | Assembly | oeis/077/A077899.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/077/A077899.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/077/A077899.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A077899: Expansion of (1-x)^(-1)/(1+x-2*x^2+x^3).
; Submitted by Christian Krause
; 1,0,3,-3,10,-18,42,-87,190,-405,873,-1872,4024,-8640,18561,-39864,85627,-183915,395034,-848490,1822474,-3914487,8407926,-18059373,38789713,-83316384,178955184,-384377664,825604417,-1773314928,3808901427,-8181135699,17572253482,-37743426306
add $0,2
lpb $0
sub $0,1
sub $1,$3
add $4,12
add $2,$4
mov $3,$1
mov $1,$2
mov $2,$3
sub $4,$3
mul $3,2
lpe
add $0,$2
div $0,12
| 24.894737 | 241 | 0.661734 |
926b991d591e25ff3b66fc31a9d5cecc7fa34f22 | 430 | asm | Assembly | oeis/136/A136444.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/136/A136444.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/136/A136444.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A136444: a(n) = Sum_{k=0..n} k*binomial(n-k, 2*k).
; Submitted by Christian Krause
; 0,0,0,1,3,6,12,25,51,101,197,381,731,1392,2634,4958,9290,17337,32239,59760,110460,203651,374593,687567,1259597,2303449,4205493,7666560,13956532,25374108,46076436,83575025,151431099,274108826,495708364,895670733,1617003823,2916984121
sub $0,1
lpb $0
mul $1,$2
add $3,$1
mov $1,$0
sub $0,1
add $2,2
bin $1,$2
lpe
mov $0,$3
div $0,2
| 26.875 | 234 | 0.702326 |
a85d77949b68ea81cb0459267479f5fd8d5d0f8c | 3,391 | asm | Assembly | asm/tests/manual/mul_pt3.asm | ZopharsDomain/PCX86-JAVASCRIPT-jemul8 | 0c4828db606f9163e833258b77db8ebf3da09388 | [
"MIT"
] | 67 | 2015-01-04T14:55:27.000Z | 2022-01-05T05:41:55.000Z | asm/tests/manual/mul_pt3.asm | ZopharsDomain/PCX86-JAVASCRIPT-jemul8 | 0c4828db606f9163e833258b77db8ebf3da09388 | [
"MIT"
] | 3 | 2015-09-26T19:37:17.000Z | 2021-11-23T00:37:30.000Z | asm/tests/manual/mul_pt3.asm | ZopharsDomain/PCX86-JAVASCRIPT-jemul8 | 0c4828db606f9163e833258b77db8ebf3da09388 | [
"MIT"
] | 14 | 2015-01-17T11:32:49.000Z | 2021-12-26T12:47:22.000Z | ;
; jemul8 - JavaScript x86 Emulator
; Copyright (c) 2012 http://ovms.co. All Rights Reserved.
;
; MODULE: Flags test suite (boot sector)
;
org 0
jmp 0x07C0:start
start:
cli
; Update DS & ES to be 7C0 instead of 0
push CS
pop DS
push CS
pop ES
; Create stack
mov ax, 0x0000
mov ss, ax
mov sp, 0xFFFD
mov si, mulBanner
call printMsg
;****** specifying the destination register - 32 bit result
MOV EDX,-1 ;put -1 into edx
MOV EBX,-1 ;put -1 into ebx
IMUL EDX,EBX ;edx*ebx result of 1 in edx
cmp edx, 1
jne fail13
call pass
jmp end13
fail13:
call fail
end13:
MOV EAX,-1 ;put -1 into eax
MOV EDX,-2 ;put -2 into ebx
IMUL EDX,EAX ;edx*eax result of 2 in edx
cmp edx, 2
jne fail14
call pass
jmp end14
fail14:
call fail
end14:
;****** specifying the destination register and using immediate value - 2 operands
MOV ESI,-1 ;put -1 into esi
IMUL ESI,4 ;esi*4 result of -4 in esi
cmp esi, -4
jne fail15
call pass
jmp end15
fail15:
call fail
end15:
MOV EAX,-1 ;put -1 into eax
IMUL EAX,4 ;eax*4 result of -4 in eax
cmp eax, -4
jne fail16
call pass
jmp end16
fail16:
call fail
end16:
;****** specifying the destination register and using immediate value - 3 operands
MOV EBX,-1 ;put -1 into ebx
IMUL EDX,EBX,4 ;ebx*4 result of -4 in edx
cmp edx, -4
jne fail17
call pass
jmp end17
fail17:
call fail
end17:
MOV EAX,-1 ;put -1 into eax
IMUL EDX,EAX,5 ;eax*5 result of -5 in edx
cmp edx, -5
jne fail18
call pass
jmp end18
fail18:
call fail
end18:
;****** using same source and destination registers
MOV EDX,-2 ;put -2 into ebx
IMUL EDX,EDX ;edx*edx result of 4 in edx
cmp edx, 4
jne fail19
call pass
jmp end19
fail19:
call fail
end19:
MOV EAX,-1 ;put -1 into eax
IMUL EAX,EAX,5 ;eax*5 result of -5 in eax
cmp eax, -5
jne fail20
call pass
jmp end20
fail20:
call fail
end20:
;****** showing smaller code for multipliers between -128 and +127
MOV EAX,1111h ;4369 decimal
IMUL EAX,128 ;result is 88880h (559,232)
cmp eax, 0x88880
jne fail21
call pass
jmp end21
fail21:
call fail
end21:
MOV EAX,1111h ;4369 decimal
IMUL EAX,-129 ;result is 0FFF7666Fh (-563,601)
cmp eax, 0xFFF7666F
jne fail22
call pass
jmp end22
fail22:
call fail
end22:
MOV EAX,1111h ;4369 decimal
IMUL EAX,127 ;result is 8776Fh (554,863)
cmp eax, 0x8776F
jne fail23
call pass
jmp end23
fail23:
call fail
end23:
MOV EAX,1111h ;4369 decimal
IMUL EAX,-128 ;result is 0FFF77780h (-559,232)
cmp eax, 0xFFF77780
jne fail24
call pass
jmp end24
fail24:
call fail
end24:
; All stop when done
mov si, doneMsg
call printMsg
finished:
jmp finished;
printMsg:
mov ah, 0Eh
cld
lodsb
cmp al, 0
jz done
int 10h
jmp printMsg
done:
ret
pass:
mov si, passMsg
call printMsg
ret
fail:
mov si, failMsg
call printMsg
ret
mulBanner db 'jemul8 MUL/IMUL Test (Part 3)',13,10,0
passMsg db '.',0
failMsg db 'E',0
doneMsg db 13,10,'Done.',0
; ==== End of code ====
; Make the file 512 bytes long
TIMES 510-($-$$) DB 0
; Add the boot signature
dw 0AA55h
| 16.302885 | 83 | 0.615748 |
cd8e8d610be0d22b64791ef0300dd6e05c4d12cd | 455 | asm | Assembly | lib/rkplat/src/riscv64/entry.asm | OSH-2022/runikraft | 8b29bfe06984b9e07b499d28e7e1c65e6f058ea7 | [
"BSD-3-Clause"
] | null | null | null | lib/rkplat/src/riscv64/entry.asm | OSH-2022/runikraft | 8b29bfe06984b9e07b499d28e7e1c65e6f058ea7 | [
"BSD-3-Clause"
] | null | null | null | lib/rkplat/src/riscv64/entry.asm | OSH-2022/runikraft | 8b29bfe06984b9e07b499d28e7e1c65e6f058ea7 | [
"BSD-3-Clause"
] | null | null | null | .extern sbss
.extern ebss
.section .text.entry
.globl __runikraft_start
__runikraft_start:
#清空bss段
la t0,sbss
la t1,ebss
1:
bge t0,t1,2f
sd x0,(t0)
addi t0,t0,8
j 1b
2:
addi t0,zero,0
addi t1,zero,0
# 初始化中断响应函数
la t0, __rkplat_irq_handle_entry
csrw stvec, t0
#加载栈指针
la sp,boot_stack_top
call __runikraft_entry_point
.section .bss.stack
.space 4096
boot_stack_top:
| 15.689655 | 36 | 0.626374 |
fb39ad9fe9198ee459b0286efc302f42f7e6d51f | 394 | asm | Assembly | programs/oeis/085/A085374.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/085/A085374.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/085/A085374.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A085374: a(n) = binomial(2n+1, n+1)*binomial(n+3, 3).
; 1,12,100,700,4410,25872,144144,772200,4011150,20323160,100876776,492156392,2366136500,11232648000,52739956800,245240799120,1130632213590,5172827121000,23504600427000,106141827191400
mov $2,$0
add $0,1
add $2,2
cal $0,119581 ; (2*n+n^2)*(binomial(2*n,n))/2.
mov $1,$0
mul $1,2
add $0,$1
mov $1,$0
mul $1,$2
sub $1,18
div $1,18
add $1,1
| 24.625 | 183 | 0.705584 |
823d6f359f4ea974620b337c8884027555f91ab5 | 7,458 | asm | Assembly | Borland/CBuilder5/Source/RTL/source/process/setjmp.asm | TrevorDArcyEvans/DivingMagpieSoftware | 7ffcfef653b110e514d5db735d11be0aae9953ec | [
"MIT"
] | 1 | 2021-05-27T10:27:25.000Z | 2021-05-27T10:27:25.000Z | Borland/CBuilder5/Source/RTL/source/process/setjmp.asm | TrevorDArcyEvans/Diving-Magpie-Software | 7ffcfef653b110e514d5db735d11be0aae9953ec | [
"MIT"
] | null | null | null | Borland/CBuilder5/Source/RTL/source/process/setjmp.asm | TrevorDArcyEvans/Diving-Magpie-Software | 7ffcfef653b110e514d5db735d11be0aae9953ec | [
"MIT"
] | null | null | null | ;[]-----------------------------------------------------------------[]
;| SETJMP.ASM -- non-local gotos |
;[]-----------------------------------------------------------------[]
;
; C/C++ Run Time Library - Version 10.0
;
; Copyright (c) 1991, 2000 by Inprise Corporation
; All Rights Reserved.
;
; $Revision: 9.0 $
include RULES.ASI
; Segments Definitions
Header@
; Structure of a jmp_buf. The layout was chosen for compatibility with MSC.
jmp_buf STRUC
j_ebp dd ?
j_ebx dd ?
j_edi dd ?
j_esi dd ?
j_esp dd ?
j_ret dd ?
j_excep dd ?
j_context dd ?
jmp_buf ENDS
ExtFunc@ _CurrExcContext, _RTLENTRY, 4
ExtFunc@ _Local_unwind, _RTLENTRY, 8
;-----------------------------------------------------------------------
;
;Name setjmp - nonlocal goto
;
;Usage #include <setjmp.h>
; int setjmp(jmp_buf jmpb);
;
;Prototype in setjmp.h
;
;Description Saves current context information (register, stack
; position, and segment values) in the jmp_buf structure and
; then returns to the caller.
;
; Setjmp returns 0 when called directly. The caller of setjmp
; may be "returned to" again by longjmp, when the function
; result will never be zero.
;
; The jmp_buf contains the entire context necessary for a C
; task, including all segments and the complete flag word.
; Only the EX,ECX, and EDX registers are lost, but then the
; caller of setjmp does not expect them to be preserved
; through a function call.
;
; On entry, the stack frame looks like:
;
; top EIP
; jmp_buf pointer
;
;Return value setjmp returns 0 when it is initially called.
;
;------------------------------------------------------------------------
Code_seg@
Func@ setjmp, _EXPFUNC, _RTLENTRYF, <pointer jbuf>
mov eax, fs:[0] ; get exception error record
push eax
Call@ _CurrExcContext ; get exception context
mov edx, eax
pop ecx ; get return address
pop eax ; get pointer to jmp_buf
mov [eax.j_ebp], ebp ; save EBP
mov [eax.j_ebx], ebx ; save EBX
mov [eax.j_edi], edi ; save EDI
mov [eax.j_esi], esi ; save ESI
mov [eax.j_esp], esp ; save ESP
mov [eax.j_ret], ecx ; save return address
mov [eax.j_context], edx ; save context number
mov edx,fs:[0] ; get head of exception chain
mov [eax.j_excep],edx ; save it
xor eax,eax ; always return 0
if PopParms@ eq 0
sub esp, 4 ; fake setjmp arg for caller to pop
endif
jmp ecx ; return
EndFunc@ setjmp
;-----------------------------------------------------------------------
;
;Name longjmp - performs a nonlocal goto
;
;Usage #include <setjmp.h>
; void longjmp(jmp_buf jmpb, int retval);
;
;Prototype in setjmp.h
;
;Description Restores context information (register, stack position, and
; segment values) from the jmp_buf structure, which must
; previously have been saved there by setjmp, and then
; returns to the original caller of setjmp with val as the
; return value as if returning from setjmp. The difference
; between a setjmp return and a longjmp is that setjmp
; returns zero, longjmp returns "val". Val can never be zero:
; if zero argument is supplied, 1 is substituted.
;
; Longjmp never returns to its own caller. If the contents of
; jmpb are not set, or if the context therein is for a
; function which is not now active (if it has finished and
; returned) then the result will generally be to crash the
; program. The safest styles of use of the setjmp/longjmp
; pair are to effect a return upward through several nested
; procedure layers to a parent procedure designed to handle
; exceptions, or to place both setjmp and longjmp within a
; single scheduler/event handler lexical block.
;
;Return value longjmp cannot return the value 0; if passed 0 in val,
; longjmp will return 1.
;
;------------------------------------------------------------------------
ExtFunc@ RtlUnwind, APIENTRY, 12
Func@ longjmp, _EXPFUNC, _RTLENTRYF, <pointer jbuf>, <int retval>
; Call RtlUnwind to get rid of exception handlers that may been added to
; the chain since the setjmp() that set up this jmp_buf. Skip this step
; if the head handler on the the chain is the same as when setjmp() was
; called.
pop eax ; discard return address
mov ecx,[esp] ; get jmp_buf address
mov eax,[ecx.j_excep] ; address of excep. reg. record
cmp eax,fs:[0] ; if the exception list hasn't changed,
je no_global_unwind ; don't bother to unwind
push [saveESP]
mov saveESP, esp ; save ESP since it gets trashed
push 0 ; NULL exc.
push offset FLAT: return ; address of new EIP (simulate return)
push eax ; exc. reg. record
call RtlUnwind@ ; unwind exceptions
return:
mov esp, [saveESP] ; restore ESP
pop [saveESP]
mov ecx,[esp] ; get jmp_buf address
mov eax,[ecx.j_excep] ; address of excep. reg. record
mov fs:[0], eax ; set fs:0 for safety
no_global_unwind:
push eax
Call@ _CurrExcContext
cmp eax, -1 ; check if exception record is ours
je done_unwind ; if not then done
mov ecx,[esp] ; get jmp_buf address
cmp eax,[ecx.j_context] ; check if context records are same
je done_unwind ; if so then done
push [ecx.j_context]
push [ecx.j_excep]
Call@ _Local_unwind
done_unwind:
pop ecx ; get pointer to jmp_buf
; Restore registers and return to original setjmp() caller.
pop eax ; get return value
cmp eax, 1 ; disallow zero return
adc eax, 0 ; eax += (eax == 0)
mov ebp, [ecx.j_ebp] ; restore EBP
mov ebx, [ecx.j_ebx] ; restore EBX
mov edi, [ecx.j_edi] ; restore EDI
mov esi, [ecx.j_esi] ; restore ESI
mov esp, [ecx.j_esp] ; restore ESP
if PopParms@ eq 0
sub esp, 4 ; fake setjmp arg for caller to pop
endif
__DoLongJump__:
jmp dword ptr [ecx.j_ret] ; jump to return address
public __DoLongJump__
EndFunc@ longjmp
Code_EndS@
Data_Seg@
saveESP dd ?
Data_EndS@
end
| 36.380488 | 79 | 0.510593 |
bcdaaec0c2e1834c9524e48ef654ce0f8d4f13df | 677 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/am9511/c/sccz80/cam32_sccz80_fsub.asm | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | 1 | 2022-03-08T11:55:58.000Z | 2022-03-08T11:55:58.000Z | libsrc/_DEVELOPMENT/math/float/am9511/c/sccz80/cam32_sccz80_fsub.asm | dikdom/z88dk | 40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0 | [
"ClArtistic"
] | 2 | 2022-03-20T22:17:35.000Z | 2022-03-24T16:10:00.000Z | libsrc/_DEVELOPMENT/math/float/am9511/c/sccz80/cam32_sccz80_fsub.asm | jorgegv/z88dk | 127130cf11f9ff268ba53e308138b12d2b9be90a | [
"ClArtistic"
] | null | null | null |
; float __fsub (float left, float right)
SECTION code_clib
SECTION code_fp_am9511
PUBLIC cam32_sccz80_fsub
EXTERN asm_switch_arg, asm_sccz80_readl
EXTERN asm_am9511_fsub
; subtract sccz80 float from sccz80 float
;
; enter : stack = sccz80_float left, sccz80_float right, ret
;
; exit : DEHL = sccz80_float(left-right)
;
; uses : af, bc, de, hl, af', bc', de', hl'
.cam32_sccz80_fsub
call asm_switch_arg
call asm_sccz80_readl
jp asm_am9511_fsub ; enter stack = sccz80_float right, sccz80_float left, ret
; DEHL = sccz80_float right
; return DEHL = sccz80_float
| 26.038462 | 86 | 0.645495 |
2b153d081de6cfe065c9f278265acb9b3b91f099 | 1,165 | asm | Assembly | libsrc/_DEVELOPMENT/adt/b_vector/z80/asm_b_vector_insert.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/adt/b_vector/z80/asm_b_vector_insert.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/adt/b_vector/z80/asm_b_vector_insert.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; ===============================================================
; Mar 2014
; ===============================================================
;
; size_t b_vector_insert(b_vector_t *v, size_t idx, int c)
;
; Insert char c before vector.data[idx], returns index of
; char inserted.
;
; ===============================================================
SECTION code_clib
SECTION code_adt_b_vector
PUBLIC asm_b_vector_insert
EXTERN asm_b_vector_insert_block, error_mc
asm_b_vector_insert:
; enter : hl = vector *
; de = int c
; bc = idx
;
; exit : success
;
; de = & vector.data[idx]
; hl = idx of char inserted
; carry reset
;
; fail
;
; hl = -1
; carry set
;
; uses : af, bc, de, hl
push bc ; save idx
push de ; save int c
ld de,1
call asm_b_vector_insert_block
pop de ; de = int c
jp c, error_mc - 1 ; if insert error
ld (hl),e ; write inserted char
ex de,hl
pop hl ; hl = idx
ret
| 21.981132 | 65 | 0.407725 |
11e6b1820573180cc66a95dc5f17392acc583f8e | 734 | asm | Assembly | oeis/347/A347525.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/347/A347525.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/347/A347525.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A347525: Number of minimum dominating sets in the n-Andrásfai graph.
; Submitted by Jamie Morken(w2)
; 2,5,24,22,28,34,40,46,52,58,64,70,76,82,88,94,100,106,112,118,124,130,136,142,148,154,160,166,172,178,184,190,196,202,208,214,220,226,232,238,244,250,256,262,268,274,280,286,292,298,304,310,316,322,328,334
mov $6,2
mov $7,$0
lpb $6
mov $0,$7
sub $6,1
add $0,$6
sub $0,1
mov $4,$0
add $0,1
mov $2,1
mov $3,3
lpb $0
sub $0,1
div $0,$2
div $0,2
max $0,0
seq $0,151799 ; Version 2 of the "previous prime" function: largest prime < n.
sub $0,1
mul $2,2
mul $3,$4
add $2,$3
lpe
mov $0,$2
mov $5,$6
mul $5,$2
add $8,$5
lpe
min $7,1
mul $7,$0
mov $0,$8
sub $0,$7
add $0,1
| 19.837838 | 207 | 0.594005 |
9e2525282913f751f3bc2cc700e14eb0c4fe466a | 534 | asm | Assembly | libsrc/_DEVELOPMENT/l/z80/l_ini_loop.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/l/z80/l_ini_loop.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/l/z80/l_ini_loop.asm | ahjelm/z88dk | c4de367f39a76b41f6390ceeab77737e148178fa | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | INCLUDE "config_private.inc"
IF !__CPU_RABBIT__
SECTION code_clib
SECTION code_l
PUBLIC l_ini_loop
IF __CLIB_OPT_UNROLL & 0x80
EXTERN l_ini_loop_smc
defc l_ini_loop = l_ini_loop_smc
ELSE
EXTERN l_ini
EXTERN l_ini_256, l_ini_128
EXTERN l_ini_64, l_ini_32, l_ini_16
l_ini_loop:
ld a,b
cp 16
jp c, sub_16
rla
call c, l_ini_128
rla
call c, l_ini_64
rla
call c, l_ini_32
rla
call c, l_ini_16
ret z
inir
ret
sub_16:
or a
jp z, l_ini_256
inir
ret
ENDIF
ENDIF
| 9.709091 | 35 | 0.685393 |
86432b9dc01c4df81acd2c004363078249390f8f | 604 | asm | Assembly | oeis/131/A131128.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/131/A131128.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/131/A131128.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A131128: Binomial transform of [1, 1, 5, 1, 5, 1, 5, ...].
; 1,2,8,20,44,92,188,380,764,1532,3068,6140,12284,24572,49148,98300,196604,393212,786428,1572860,3145724,6291452,12582908,25165820,50331644,100663292,201326588,402653180,805306364,1610612732,3221225468,6442450940,12884901884,25769803772,51539607548,103079215100,206158430204,412316860412,824633720828,1649267441660,3298534883324,6597069766652,13194139533308,26388279066620,52776558133244,105553116266492,211106232532988,422212465065980,844424930131964,1688849860263932,3377699720527868
mov $1,2
pow $1,$0
mul $1,3
trn $1,5
add $1,1
mov $0,$1
| 60.4 | 485 | 0.821192 |
116dd6a17bfc3e17c444955a44a423e118ec0363 | 23,574 | asm | Assembly | Games/Cellar TI 84 CE/ray.asm | CiaranGruber/Ti-84-Calculator | 96742a4a2b9e21aa9d675575dc7e4f26365430c0 | [
"MIT"
] | 1 | 2019-03-31T11:49:12.000Z | 2019-03-31T11:49:12.000Z | Games/Cellar TI 84 CE/ray.asm | CiaranGruber/Ti-84-Calculator | 96742a4a2b9e21aa9d675575dc7e4f26365430c0 | [
"MIT"
] | null | null | null | Games/Cellar TI 84 CE/ray.asm | CiaranGruber/Ti-84-Calculator | 96742a4a2b9e21aa9d675575dc7e4f26365430c0 | [
"MIT"
] | 1 | 2020-03-09T13:21:19.000Z | 2020-03-09T13:21:19.000Z | .assume ADL=1
XDEF _octant_1_main,_octant_1_side
XDEF _octant_2_main,_octant_2_side
XDEF _octant_3_main,_octant_3_side
XDEF _octant_4_main,_octant_4_side
XDEF _octant_5_main,_octant_5_side
XDEF _octant_6_main,_octant_6_side
XDEF _octant_7_main,_octant_7_side
XDEF _octant_8_main,_octant_8_side
XREF _shared_struct,_map,_wall,__imulu,_init_map_pointer
XDEF __indcallhl
__indcallhl:
jp (hl)
_ray_x equ _shared_struct
_ray_y equ _shared_struct+3
_dxdy equ _shared_struct+6
_dydx equ _shared_struct+9
_test_x equ _shared_struct+12
_test_y equ _shared_struct+15
ray_x equ 0
ray_y equ 3
dxdy equ 6
dydx equ 9
test_x equ 12
test_y equ 15
MAP_WIDTH equ 16
; octant layout
;
; \ | /
; \ 6 | 7 /
; \ | /
; \ | /
; 5 \ | / 8
; \|/
;----------+-----------
; /|\
; 4 / | \ 1
; / | \
; / | \
; / 3 | 2 \
; / | \
_octant_1_side:
ld iy,_shared_struct
ld de,(_init_map_pointer)
jr octant_1_side
_octant_1_main:
ld iy,_shared_struct
ld de,(_init_map_pointer)
; Octant 1: mainly going right (X increasing), also down (Y increasing)
octant_1_main:
ld hl,(iy+ray_y) ; ray_y += dy/dx
ld bc,(iy+dydx) ; secondary direction, advance fractional amount
add hl,bc
octant_1_main_hl:
ld (iy+ray_y),hl
inc (iy+ray_x+2) ; ray_x += 0x10000, main direction, advance to next vertical line
inc de ; also adjust map pointer for one block X
ld a,(de)
or a
ld (_wall),a
ret nz ; exit if wall present
; test if we will cross a horizontal line before the next vertical line
octant_1_side:
ld hl,(iy+ray_y) ; test_y = ray_y + dy/dx
ld bc,(iy+dydx) ; secondary direction, advance fractional amount
add hl,bc
ld (iy+test_y),hl
ld a,(iy+ray_y+2)
cp (iy+test_y+2) ; continue if ipart(test_y) != ipart(ray_y)
jr z,octant_1_main_hl
ld hl,MAP_WIDTH
add hl,de
ld a,(hl)
ex de,hl ; advance wall pointer by one row
or a
jr z,octant_1_main ; continue if no wall present
ld (_wall),a ; save wall type
ld hl,(iy+ray_y)
ld de,0
ld d,h
ld e,l ; DE = fpart(ray_y)
ld hl,10000h
xor a
sbc hl,de ; HL = 0x10000 - fpart(ray_y)
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l ; HL = (0x10000 - fpart(ray_y)) >> 5
ld bc,(iy+dxdy)
call __imulu ; HL = ((0x10000 - fpart(ray_y)) >> 5) * dx/dy
xor a
add hl,hl ; shift AHL left 2
rla
add hl,hl
rla
ld (iy+test_x),hl ; shift right 8 bits (net shift right 6)
ld (iy+test_x+3),a
ld hl,(iy+test_x+1)
ld de,(iy+ray_x)
add hl,de
ld (iy+ray_x),hl ; point of intercept with horizontal line
lea hl,iy+ray_y ; Y coordinate is following horizontal line
xor a
ld (hl),a
inc hl
ld (hl),a
inc hl
ld a,(iy+test_y+2)
ld (hl),a
ret
_octant_8_side:
ld iy,_shared_struct
ld de,(_init_map_pointer)
jr octant_8_side
_octant_8_main:
ld iy,_shared_struct
ld de,(_init_map_pointer)
; Octant 8: mainly going right (X increasing), also up (Y decreasing)
octant_8_main:
ld hl,(iy+ray_y) ; ray_y -= dy/dx
ld bc,(iy+dydx) ; secondary direction, advance fractional amount
xor a
sbc hl,bc
octant_8_main_hl:
ld (iy+ray_y),hl
inc (iy+ray_x+2) ; ray_x += 0x10000, main direction, advance to next vertical line
inc de ; also adjust map pointer for one block X
ld a,(de)
or a
ld (_wall),a
ret nz ; exit if wall present
; test if we will cross a horizontal line before the next vertical line
octant_8_side:
ld hl,(iy+ray_y) ; test_y = ray_y - dy/dx
ld bc,(iy+dydx) ; secondary direction, advance fractional amount
xor a
sbc hl,bc
ld (iy+test_y),hl
ld a,(iy+ray_y+2)
cp (iy+test_y+2) ; continue if ipart(test_y) != ipart(ray_y)
jr z,octant_8_main_hl
ld hl,-MAP_WIDTH
add hl,de
ld a,(hl)
ex de,hl ; advance wall pointer by one row
or a
jr z,octant_8_main ; continue if no wall present
ld (_wall),a ; save wall type
ld de,(iy+ray_y)
ld hl,0
ld h,d
ld l,e ; HL = fpart(ray_y)
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l ; HL = (0x10000 - fpart(ray_y)) >> 5
ld bc,(iy+dxdy)
call __imulu ; HL = ((0x10000 - fpart(ray_y)) >> 5) * dx/dy
xor a
add hl,hl ; shift AHL left 2
rla
add hl,hl
rla
ld (iy+test_x),hl ; shift right 8 bits (net shift right 6)
ld (iy+test_x+3),a
ld hl,(iy+test_x+1)
ld de,(iy+ray_x)
add hl,de
ld (iy+ray_x),hl ; point of intercept with horizontal line
lea hl,iy+ray_y ; Y coordinate is following horizontal line
xor a
ld (hl),a
inc hl
ld (hl),a
ret
_octant_2_side:
ld iy,_shared_struct
ld de,(_init_map_pointer)
jr octant_2_side
_octant_2_main:
ld iy,_shared_struct
ld de,(_init_map_pointer)
; Octant 2: mainly going down (Y increasing), also right (X increasing)
octant_2_main:
ld hl,(iy+ray_x) ; ray_x += dx/dy
ld bc,(iy+dxdy) ; secondary direction, advance fractional amount
add hl,bc
octant_2_main_hl:
ld (iy+ray_x),hl
inc (iy+ray_y+2) ; ray_y += 0x10000, main direction, advance to next horizontal line crossing
ld hl,MAP_WIDTH
add hl,de
ld a,(hl)
ex de,hl ; advance wall pointer by one row
or a
ld (_wall),a
ret nz ; exit if wall present
; test if we will cross a vertical line before the next horizontal line
octant_2_side:
ld hl,(iy+ray_x) ; test_x = ray_x + dx/dy
ld bc,(iy+dxdy) ; secondary direction, advance fractional amount
add hl,bc
ld (iy+test_x),hl
ld a,(iy+ray_x+2)
cp (iy+test_x+2) ; continue if ipart(test_x) != ipart(ray_x)
jr z,octant_2_main_hl
inc de ; advance wall pointer by one column
ld a,(de)
or a
jr z,octant_2_main ; continue if no wall present
ld (_wall),a ; save wall type
ld hl,(iy+ray_x)
ld de,0
ld d,h
ld e,l ; DE = fpart(ray_x)
ld hl,10000h
xor a
sbc hl,de ; HL = 0x10000 - fpart(ray_x)
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l ; HL = (0x10000 - fpart(ray_x)) >> 5
ld bc,(iy+dydx)
call __imulu ; HL = ((0x10000 - fpart(ray_y)) >> 5) * dy/dx
xor a
add hl,hl ; shift AHL left 2
rla
add hl,hl
rla
ld (iy+test_x),hl ; shift right 8 bits (net shift right 6)
ld (iy+test_x+3),a
ld hl,(iy+test_x+1)
ld de,(iy+ray_y)
add hl,de
ld (iy+ray_y),hl ; point of intercept with vertical line
lea hl,iy+ray_x ; X coordinate of following vertical line
xor a
ld (hl),a
inc hl
ld (hl),a
inc hl
inc (hl)
ret
_octant_7_side:
ld iy,_shared_struct
ld de,(_init_map_pointer)
jr octant_7_side
_octant_7_main:
ld iy,_shared_struct
ld de,(_init_map_pointer)
; Octant 7: mainly going up (Y increasing), also right (X increasing)
octant_7_main:
ld hl,(iy+ray_x) ; ray_x += dx/dy
ld bc,(iy+dxdy) ; secondary direction, advance fractional amount
add hl,bc
octant_7_main_hl:
ld (iy+ray_x),hl
dec (iy+ray_y+2) ; ray_y -= 0x10000, main direction, advance to next horizontal line crossing
ld hl,-MAP_WIDTH
add hl,de
ld a,(hl)
ex de,hl ; advance wall pointer by one row
or a
ld (_wall),a
ret nz ; exit if wall present
; test if we will cross a vertical line before the next horizontal line
octant_7_side:
ld hl,(iy+ray_x) ; test_x = ray_x + dx/dy
ld bc,(iy+dxdy) ; secondary direction, advance fractional amount
add hl,bc
ld (iy+test_x),hl
ld a,(iy+ray_x+2)
cp (iy+test_x+2) ; continue if ipart(test_x) != ipart(ray_x)
jr z,octant_7_main_hl
inc de ; advance wall pointer by one column
ld a,(de)
or a
jr z,octant_7_main ; continue if no wall present
ld (_wall),a ; save wall type
ld hl,(iy+ray_x)
ld de,0
ld d,h
ld e,l ; DE = fpart(ray_x)
ld hl,10000h
xor a
sbc hl,de ; HL = 0x10000 - fpart(ray_x)
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l ; HL = (0x10000 - fpart(ray_x)) >> 5
ld bc,(iy+dydx)
call __imulu ; HL = ((0x10000 - fpart(ray_y)) >> 5) * dy/dx
xor a
add hl,hl ; shift AHL left 2
rla
add hl,hl
rla
ld (iy+test_x),hl ; shift right 8 bits (net shift right 6)
ld (iy+test_x+3),a
ld de,(iy+test_x+1)
ld hl,(iy+ray_y)
sbc hl,de
ld (iy+ray_y),hl ; point of intercept with vertical line
lea hl,iy+ray_x ; X coordinate of following vertical line
xor a
ld (hl),a
inc hl
ld (hl),a
inc hl
inc (hl)
ret
_octant_3_side:
ld iy,_shared_struct
ld de,(_init_map_pointer)
jr octant_3_side
_octant_3_main:
ld iy,_shared_struct
ld de,(_init_map_pointer)
; Octant 3: mainly going down (Y increasing), also left (X decreasing)
octant_3_main:
xor a
ld hl,(iy+ray_x) ; ray_x -= dx/dy
ld bc,(iy+dxdy) ; secondary direction, advance fractional amount
sbc hl,bc
octant_3_main_hl:
ld (iy+ray_x),hl
inc (iy+ray_y+2) ; ray_y += 0x10000, main direction, advance to next horizontal line crossing
ld hl,MAP_WIDTH
add hl,de
ld a,(hl)
ex de,hl ; advance wall pointer by one row
or a
ld (_wall),a
ret nz ; exit if wall present
; test if we will cross a vertical line before the next horizontal line
octant_3_side:
xor a
ld hl,(iy+ray_x) ; test_x = ray_x - dx/dy
ld bc,(iy+dxdy) ; secondary direction, advance fractional amount
sbc hl,bc
ld (iy+test_x),hl
ld a,(iy+ray_x+2)
cp (iy+test_x+2) ; continue if ipart(test_x) != ipart(ray_x)
jr z,octant_3_main_hl
dec de ; advance wall pointer by one column
ld a,(de)
or a
jr z,octant_3_main ; continue if no wall present
ld (_wall),a ; save wall type
ld de,(iy+ray_x)
ld hl,0
ld h,d
ld l,e ; HL = fpart(ray_x)
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l ; HL = (0x10000 - fpart(ray_x)) >> 5
ld bc,(_dydx)
call __imulu ; HL = ((0x10000 - fpart(ray_y)) >> 5) * dy/dx
xor a
add hl,hl ; shift AHL left 2
rla
add hl,hl
rla
ld (iy+test_x),hl ; shift right 8 bits (net shift right 6)
ld (iy+test_x+3),a
ld hl,(iy+test_x+1)
ld de,(iy+ray_y)
add hl,de
ld (iy+ray_y),hl ; point of intercept with vertical line
lea hl,iy+ray_x ; ray_x &= 0xFF0000
xor a
ld (hl),a
inc hl
ld (hl),a
ret
_octant_6_side:
ld iy,_shared_struct
ld de,(_init_map_pointer)
jr octant_6_side
_octant_6_main:
ld iy,_shared_struct
ld de,(_init_map_pointer)
; Octant 6: mainly going up (Y decreasing), also left (X decreasing)
octant_6_main:
xor a
ld hl,(iy+ray_x) ; ray_x -= dx/dy
ld bc,(iy+dxdy) ; secondary direction, advance fractional amount
sbc hl,bc
octant_6_main_hl:
ld (iy+ray_x),hl
dec (iy+ray_y+2) ; ray_y -= 0x10000, main direction, advance to next horizontal line crossing
ld hl,-MAP_WIDTH
add hl,de
ld a,(hl)
ex de,hl ; advance wall pointer by one row
or a
ld (_wall),a
ret nz ; exit if wall present
; test if we will cross a vertical line before the next horizontal line
octant_6_side:
xor a
ld hl,(iy+ray_x) ; test_x = ray_x - dx/dy
ld bc,(iy+dxdy) ; secondary direction, advance fractional amount
sbc hl,bc
ld (iy+test_x),hl
ld a,(iy+ray_x+2)
cp (iy+test_x+2) ; continue if ipart(test_x) != ipart(ray_x)
jr z,octant_6_main_hl
dec de ; advance wall pointer by one column
ld a,(de)
or a
jr z,octant_6_main ; continue if no wall present
ld (_wall),a ; save wall type
ld de,(iy+ray_x)
ld hl,0
ld h,d
ld l,e ; HL = fpart(ray_x)
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l ; HL = (0x10000 - fpart(ray_x)) >> 5
ld bc,(iy+dydx)
call __imulu ; HL = ((0x10000 - fpart(ray_y)) >> 5) * dy/dx
xor a
add hl,hl ; shift AHL left 2
rla
add hl,hl
rla
ld (iy+test_x),hl ; shift right 8 bits (net shift right 6)
ld (iy+test_x+3),a
ld de,(iy+test_x+1)
ld hl,(iy+ray_y)
sbc hl,de
ld (iy+ray_y),hl ; point of intercept with vertical line
lea hl,iy+ray_x ; ray_x &= 0xFF0000
xor a
ld (hl),a
inc hl
ld (hl),a
ret
_octant_4_side:
ld iy,_shared_struct
ld de,(_init_map_pointer)
jr octant_4_side
_octant_4_main:
ld iy,_shared_struct
ld de,(_init_map_pointer)
; Octant 4: mainly going left (X decreasing), also down (Y increasing)
octant_4_main:
ld hl,(iy+ray_y) ; ray_y += dy/dx
ld bc,(iy+dydx) ; secondary direction, advance fractional amount
add hl,bc
octant_4_main_hl:
ld (iy+ray_y),hl
dec (iy+ray_x+2) ; ray_x -= 0x10000, main direction, advance to next vertical line
dec de ; also adjust map pointer for one block X
ld a,(de)
or a
ld (_wall),a
ret nz ; exit if wall present
; test if we will cross a horizontal line before the next vertical line
octant_4_side:
ld hl,(iy+ray_y) ; test_y = ray_y + dy/dx
ld bc,(iy+dydx) ; secondary direction, advance fractional amount
add hl,bc
ld (iy+test_y),hl
ld a,(iy+ray_y+2)
cp (iy+test_y+2) ; continue if ipart(test_y) != ipart(ray_y)
jr z,octant_4_main_hl
ld hl,MAP_WIDTH ; advance wall pointer by one row
add hl,de
ld a,(hl)
ex de,hl
or a
jr z,octant_4_main ; continue if no wall present
ld (_wall),a ; save wall type
ld hl,(iy+ray_y)
ld de,0
ld d,h
ld e,l ; DE = fpart(ray_y)
ld hl,10000h
xor a
sbc hl,de ; HL = 0x10000 - fpart(ray_y)
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l ; HL = (0x10000 - fpart(ray_y)) >> 5
ld bc,(iy+dxdy)
call __imulu ; HL = ((0x10000 - fpart(ray_y)) >> 5) * dx/dy
xor a
add hl,hl ; shift AHL left 2
rla
add hl,hl
rla
ld (iy+test_x),hl ; shift right 8 bits (net shift right 6)
ld (iy+test_x+3),a
ld de,(iy+test_x+1)
ld hl,(iy+ray_x)
sbc hl,de
ld (iy+ray_x),hl ; point of intercept with horizontal line
lea hl,iy+ray_y ; Y coordinate is following horizontal line
xor a
ld (hl),a
inc hl
ld (hl),a
inc hl
inc (hl)
ret
_octant_5_side:
ld iy,_shared_struct
ld de,(_init_map_pointer)
jr octant_5_side
_octant_5_main:
ld iy,_shared_struct
ld de,(_init_map_pointer)
; Octant 5: mainly going left (X decreasing), also up (Y decreasing)
octant_5_main:
ld hl,(iy+ray_y) ; ray_y -= dy/dx
ld bc,(iy+dydx) ; secondary direction, advance fractional amount
xor a
sbc hl,bc
octant_5_main_hl:
ld (iy+ray_y),hl
dec (iy+ray_x+2) ; ray_x -= 0x10000, main direction, advance to next vertical line
dec de ; also adjust map pointer for one block X
ld a,(de)
or a
ld (_wall),a
ret nz ; exit if wall present
; test if we will cross a horizontal line before the next vertical line
octant_5_side:
ld hl,(iy+ray_y) ; test_y = ray_y + dy/dx
ld bc,(iy+dydx) ; secondary direction, advance fractional amount
xor a
sbc hl,bc
ld (iy+test_y),hl
ld a,(iy+ray_y+2)
cp (iy+test_y+2) ; continue if ipart(test_y) != ipart(ray_y)
jr z,octant_5_main_hl
ld hl,-MAP_WIDTH ; advance wall pointer by one row
add hl,de
ld a,(hl)
ex de,hl
or a
jr z,octant_5_main ; continue if no wall present
ld (_wall),a ; save wall type
ld de,(iy+ray_y)
ld hl,0
ld h,d
ld l,e ; HL = fpart(ray_y)
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l
srl h
rr l ; HL = (0x10000 - fpart(ray_y)) >> 5
ld bc,(iy+dxdy)
call __imulu ; HL = ((0x10000 - fpart(ray_y)) >> 5) * dx/dy
xor a
add hl,hl ; shift AHL left 2
rla
add hl,hl
rla
ld (iy+test_x),hl ; shift right 8 bits (net shift right 6)
ld (iy+test_x+3),a
ld de,(iy+test_x+1)
ld hl,(iy+ray_x)
sbc hl,de
ld (iy+ray_x),hl ; point of intercept with horizontal line
lea hl,iy+ray_y ; Y coordinate is following horizontal line
xor a
ld (hl),a
inc hl
ld (hl),a
ret | 33.29661 | 116 | 0.425851 |
2339e87c2f21df556b129b3b2d748bb7a93cf67e | 448 | asm | Assembly | oeis/125/A125107.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/125/A125107.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/125/A125107.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A125107: Subtract compositions (A011782) from Catalan numbers (A000108).
; Submitted by Christian Krause
; 0,0,0,1,6,26,100,365,1302,4606,16284,57762,205964,738804,2666248,9678461,35324902,129579254,477507628,1767001046,6563596132,24465218444,91480466488,343055419346,1289895758716,4861929624236,18367319517720
mov $3,$0
seq $0,262543 ; Number of rooted asymmetrical polyenoids of type U_n* having n edges.
mov $2,2
pow $2,$3
sub $0,$2
div $0,2
| 40.727273 | 205 | 0.790179 |
eed7c8f0bbdac4c014ba923cd40b8c985d7acd8a | 428 | asm | Assembly | oeis/096/A096657.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/096/A096657.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/096/A096657.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A096657: a(n) = (2^n)*a(n-1) + (2^(n-1))*a(n-2), a(0)=1, a(1)=3.
; Submitted by Simon Strandgaard
; 1,3,14,124,2096,69056,4486656,578711552,148724449280,76295068188672,78202296743231488,160236429879963287552,656488575092059763900416,5378610735570941915498020864,88128536246001466497105446043648
mov $1,$0
add $1,1
mov $2,1
mov $3,1
lpb $1
mov $0,$4
sub $1,1
mov $4,$2
mul $2,2
mul $4,$3
add $0,$4
mov $3,$0
lpe
| 23.777778 | 196 | 0.689252 |
7ef7663eddf380cb73ddef28ee4b3a2a1ca443ad | 3,625 | asm | Assembly | Lab8/longop.asm | YuriySavchenko/Assembler | d8ab6e8451d97255e639f0039f623ec00d5e9e2b | [
"Apache-2.0"
] | null | null | null | Lab8/longop.asm | YuriySavchenko/Assembler | d8ab6e8451d97255e639f0039f623ec00d5e9e2b | [
"Apache-2.0"
] | null | null | null | Lab8/longop.asm | YuriySavchenko/Assembler | d8ab6e8451d97255e639f0039f623ec00d5e9e2b | [
"Apache-2.0"
] | null | null | null | ;========================= code ============================
segment readable executable
;===========================================================
;========================= data ============================
segment readable writable
;===========================================================
;=================== div procedure table ===================
DIV_LONGOP_10:
;===========================================================
push ebp ; write EBP to STACK
mov ebp, esp ; write pointer on STACK to EBP
mov ecx, [ebp+8] ; ECX = count of bits for substraction
mov ebx, [ebp+12] ; EBX = devider
mov edi, [ebp+16] ; EDI = result
mov esi, [ebp+20] ; ESI = divided
xor eax, eax ; fill register EAX via zeros
.loop_div_out:
mov edx, 32 ; EDX = counter for inside loop
mov ebp, dword [esi+ecx*4-4] ; EBP = some bytes from some shift
.loop_div_in:
shld eax, ebp, 1 ; left shift with save carry-over
shl ebp, 1 ; left shift on one point
cmp eax, ebx ; compare remainder and devider
jb .label_1
sub eax, ebx ; substraction EAX = EAX - EBX
stc ; set CF as 1
rcl dword [edi+ecx*4-4], 1 ; left shift and set young bit as 1
jmp .label_2
.label_1:
clc ; set CF as 0
rcl dword [edi+ecx*4-4], 1 ; left shift and set young bit as 0
.label_2:
dec edx ; EDX--
jnz .loop_div_in
dec ecx ; ECX--
jnz .loop_div_out
pop ebp ; remove pointer on the STACK
ret 16 ; return parametrs from STACK
;================== div procedure groups =================
DIV_LONGOP_Nx32:
;=========================================================
push ebp ; write EBP to STACK
mov ebp, esp ; write pointer on STACK to EBP
mov ecx, [ebp+8] ; ECX = count of out loops
mov ebx, [ebp+12] ; EBX = divider
mov esi, [ebp+16] ; ESI = divided
mov edi, [ebp+20] ; EDI = result
xor edx, edx
xor eax, eax
.loop_out:
mov eax, dword [esi+ecx*4-4] ; cut group of bits by position
div ebx ; dividing
mov dword [edi+ecx*4-4], eax ; move result on place divided
dec ecx ; ECX--
jnz .loop_out
pop ebp ; remove pointer on the STACK
ret 16 ; return parametrs from STACK
| 43.154762 | 99 | 0.311172 |
3424167731e9e01db1942a24dd240310588e41b7 | 3,445 | asm | Assembly | drivers/video/ms/vga/disp/16bpp/i386/vgaregs.asm | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | drivers/video/ms/vga/disp/16bpp/i386/vgaregs.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | drivers/video/ms/vga/disp/16bpp/i386/vgaregs.asm | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | ;---------------------------Module-Header------------------------------;
; Module Name: vgaregs.asm
;
; Copyright (c) 1992 Microsoft Corporation
;-----------------------------------------------------------------------;
;-----------------------------------------------------------------------;
; VOID vInitRegs(void)
;
; Sets the VGA's data control registers to their default states.
;
;-----------------------------------------------------------------------;
.386
.model small,c
assume cs:FLAT,ds:FLAT,es:FLAT,ss:FLAT
assume fs:nothing,gs:nothing
.xlist
include stdcall.inc ;calling convention cmacros
include i386\strucs.inc
include i386\driver.inc
include i386\egavga.inc
.list
.code
cProc vInitRegs,4,< \
uses esi edi ebx, \
ppdev: ptr PDEV >
mov esi,ppdev
; Initialize sequencer to its defaults (all planes enabled, index
; pointing to Map Mask).
mov dx,VGA_BASE + SEQ_ADDR
mov ax,(MM_ALL shl 8) + SEQ_MAP_MASK
out dx,ax
; Initialize graphics controller to its defaults (set/reset disabled for
; all planes, no rotation & ALU function == replace, write mode 0 & read
; mode 0, color compare ignoring all planes (read mode 1 reads always
; return 0ffh, handy for ANDing), and the bit mask == 0ffh, gating all
; bytes from the CPU.
mov dl,GRAF_ADDR
mov ax,(0 shl 8) + GRAF_ENAB_SR
out dx,ax
mov ax,(DR_SET shl 8) + GRAF_DATA_ROT
out dx,ax
; Default to read mode 0, write mode 0:
mov edx,VGA_BASE + GRAF_ADDR
mov ah,byte ptr [esi].pdev_ulrm0_wmX[0]
mov al,GRAF_MODE
out dx,ax ;write mode 0, read mode 0
mov ax,(0 shl 8) + GRAF_CDC
out dx,ax
mov ax,(0FFh shl 8) + GRAF_BIT_MASK
out dx,ax
cRet vInitRegs
endProc vInitRegs
;-----------------------------------------------------------------------;
; VOID vSetWriteModes(ULONG * pulWriteModes);
;
; Sets the four bytes at *pulWriteModes to the values to be written to
; the Graphics Mode register to select read mode 0 and:
; write mode 0, write mode 1, write mode 2, and write mode 3,
; respectively.
;
; Must already be in graphics mode when this is called.
;-----------------------------------------------------------------------;
cProc vSetWriteModes,4,< \
pulWriteModes:ptr >
mov edx,VGA_BASE + GRAF_ADDR
mov al,GRAF_MODE
out dx,al ;point the GC Index to the Graphics Mode reg
inc edx ;point to the GC Data reg
in al,dx ;get the current setting of the Graphics Mode
and eax,0fch ;mask off the write mode fields
mov ah,al
mov edx,eax
shl edx,16
or eax,edx ;put the Graphics Mode setting in all 4 bytes
mov edx,pulWriteModes ;the mode values go here
or eax,03020100h ;insert the write mode fields
mov [edx],eax ;store the Graphics Mode settings
cRet vSetWriteModes
endProc vSetWriteModes
end
| 31.898148 | 79 | 0.487954 |
cf33865caaf017b069e00dadb83cbdb6c044e993 | 6,406 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_2606_2586.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_2606_2586.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_2606_2586.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 %rbp
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0xf706, %rsi
lea addresses_A_ht+0x1cc96, %rdi
and %rbp, %rbp
mov $51, %rcx
rep movsq
sub %r13, %r13
lea addresses_WT_ht+0x8b96, %rsi
nop
nop
nop
nop
xor $20993, %rbx
mov $0x6162636465666768, %rdi
movq %rdi, (%rsi)
nop
nop
nop
cmp $6956, %rbx
lea addresses_D_ht+0xff96, %r13
nop
nop
nop
nop
nop
sub $58735, %rbp
movl $0x61626364, (%r13)
nop
nop
nop
nop
sub $7575, %rcx
lea addresses_WT_ht+0xda96, %rsi
lea addresses_WC_ht+0x1796, %rdi
and $24902, %rbp
mov $64, %rcx
rep movsb
nop
nop
inc %rsi
lea addresses_A_ht+0x1313a, %rsi
lea addresses_A_ht+0x17a87, %rdi
nop
nop
nop
nop
and $29925, %rbx
mov $56, %rcx
rep movsl
nop
mfence
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %r8
push %rbx
push %rcx
push %rdx
// Load
lea addresses_RW+0x192f6, %r13
clflush (%r13)
xor %rcx, %rcx
mov (%r13), %r8d
nop
nop
nop
nop
nop
and %rdx, %rdx
// Load
lea addresses_US+0xd896, %rdx
nop
nop
nop
nop
nop
inc %r14
mov (%rdx), %bx
xor %r13, %r13
// Store
lea addresses_D+0x4016, %rdx
nop
nop
sub $62829, %r13
mov $0x5152535455565758, %r14
movq %r14, %xmm7
movups %xmm7, (%rdx)
nop
nop
nop
dec %r13
// Store
mov $0x74b9a30000000a16, %rcx
nop
nop
nop
nop
nop
and $31513, %r15
movb $0x51, (%rcx)
nop
nop
nop
xor %r14, %r14
// Store
lea addresses_WT+0x4796, %r14
clflush (%r14)
nop
nop
nop
nop
nop
xor $4510, %rcx
movw $0x5152, (%r14)
nop
nop
nop
inc %r15
// Faulty Load
lea addresses_D+0x19f96, %r8
nop
nop
nop
nop
and %r15, %r15
movb (%r8), %r13b
lea oracles, %rdx
and $0xff, %r13
shlq $12, %r13
mov (%rdx,%r13,1), %r13
pop %rdx
pop %rcx
pop %rbx
pop %r8
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 4, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 8, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 6, 'size': 16, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 4, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': True, 'congruent': 10, 'size': 2, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_D', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': True, 'congruent': 10, 'size': 8, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 11, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}}
{'36': 2606}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 35.005464 | 2,999 | 0.655323 |
ad48faff4a76237c48240a14d8bc803669b3571a | 7,854 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_2768.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_2768.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_2768.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 %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x16452, %rsi
lea addresses_UC_ht+0xcda2, %rdi
nop
nop
nop
sub $34397, %rdx
mov $28, %rcx
rep movsl
nop
nop
nop
cmp $146, %rsi
lea addresses_WT_ht+0x1d7a2, %rsi
lea addresses_WC_ht+0x5962, %rdi
and %r10, %r10
mov $113, %rcx
rep movsb
nop
nop
nop
nop
nop
lfence
lea addresses_normal_ht+0xa6d2, %rsi
lea addresses_UC_ht+0x117a2, %rdi
clflush (%rsi)
clflush (%rdi)
nop
nop
add %rbp, %rbp
mov $86, %rcx
rep movsq
nop
xor $41530, %rdx
lea addresses_UC_ht+0x182a2, %rsi
lea addresses_WT_ht+0x25ca, %rdi
nop
nop
nop
nop
add %r9, %r9
mov $112, %rcx
rep movsb
nop
add $57827, %r9
lea addresses_UC_ht+0x1efa2, %rsi
nop
nop
nop
add $33221, %rdx
movl $0x61626364, (%rsi)
nop
and $23938, %r9
lea addresses_D_ht+0x1aca, %r9
nop
nop
nop
nop
nop
add $9911, %rdi
mov (%r9), %rbp
nop
nop
add $65123, %rbp
lea addresses_normal_ht+0x7889, %r10
nop
nop
inc %r9
movups (%r10), %xmm7
vpextrq $1, %xmm7, %rdx
nop
nop
nop
add $10541, %rcx
lea addresses_WC_ht+0x76a2, %rbp
dec %rdx
movb (%rbp), %cl
nop
xor $61143, %rsi
lea addresses_A_ht+0x1a0a, %rbp
nop
nop
nop
nop
nop
cmp $61086, %rdx
movb (%rbp), %r9b
inc %rsi
lea addresses_D_ht+0x110a2, %rdi
nop
nop
nop
add $27152, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm7
vmovups %ymm7, (%rdi)
nop
cmp %rsi, %rsi
lea addresses_UC_ht+0xcb22, %rsi
lea addresses_A_ht+0x2062, %rdi
add $15214, %r8
mov $23, %rcx
rep movsq
nop
nop
add $43483, %rdx
lea addresses_WC_ht+0x303e, %rsi
lea addresses_UC_ht+0x1e46c, %rdi
nop
nop
nop
nop
nop
add %r8, %r8
mov $42, %rcx
rep movsb
add $55716, %r9
lea addresses_D_ht+0x1d884, %r8
nop
nop
nop
nop
nop
add $48799, %r10
mov $0x6162636465666768, %rdi
movq %rdi, (%r8)
nop
nop
nop
inc %rcx
lea addresses_UC_ht+0x14459, %rbp
clflush (%rbp)
nop
nop
nop
nop
nop
inc %rsi
mov $0x6162636465666768, %r9
movq %r9, %xmm7
movups %xmm7, (%rbp)
nop
nop
xor $42609, %r9
lea addresses_D_ht+0x7d74, %rsi
lea addresses_UC_ht+0x1e1a2, %rdi
nop
inc %rbp
mov $82, %rcx
rep movsb
nop
sub %r9, %r9
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r9
push %rbp
push %rbx
push %rcx
// Faulty Load
lea addresses_US+0x1afa2, %rcx
nop
nop
nop
nop
xor $63593, %r14
movb (%rcx), %r15b
lea oracles, %r14
and $0xff, %r15
shlq $12, %r15
mov (%r14,%r15,1), %r15
pop %rcx
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': True, 'congruent': 0, 'size': 32, 'same': True, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 11, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 8, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 3, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 8, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 34.599119 | 2,999 | 0.659409 |
6348965715ed51575203a28a53bb7fc5771e74ff | 566 | asm | Assembly | _incObj/sub DeleteObject.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 9 | 2021-01-15T13:47:53.000Z | 2022-01-17T15:33:55.000Z | _incObj/sub DeleteObject.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 7 | 2021-01-14T02:18:48.000Z | 2021-03-24T15:44:30.000Z | _incObj/sub DeleteObject.asm | kodishmediacenter/msu-md-sonic | 3aa7c5e8add9660df2cd0eceaa214e7d59f2415c | [
"CC0-1.0"
] | 2 | 2021-01-14T13:14:26.000Z | 2021-01-29T17:46:04.000Z | ; ---------------------------------------------------------------------------
; Subroutine to delete an object
; ---------------------------------------------------------------------------
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
DeleteObject:
movea.l a0,a1 ; move object RAM address to (a1)
DeleteChild: ; child objects are already in (a1)
moveq #0,d1
moveq #$F,d0
DelObj_Loop:
move.l d1,(a1)+ ; clear the object RAM
dbf d0,DelObj_Loop ; repeat for length of object RAM
rts
; End of function DeleteObject | 28.3 | 77 | 0.427562 |
dfd37bd0d4238f345a5acd7f027d6f99c1c07e08 | 359 | asm | Assembly | oeis/086/A086444.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/086/A086444.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/086/A086444.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A086444: Sequence associated with palindromic structures.
; Submitted by Jon Maiga
; 1,3,10,37,150,653,2990,14157,68470,335533,1657470,8227277,40957190,204250413,1019649550,5093448397,25452860310,127221189293,635976675230,3179495693517,15896315681830,79478090576173,397379990430510
mov $2,5
pow $2,$0
add $0,1
seq $0,173657 ; 2+2^n+3^n.
add $0,$2
div $0,6
| 32.636364 | 198 | 0.788301 |
53f3781e9b7dec289ece1ad15841a5c922a8faa6 | 104 | asm | Assembly | test/rv32f_test1.asm | kojad666/Vulcan | aae3da4ad04ffa8f8beb51bbc79916b9766d1576 | [
"MIT"
] | 102 | 2020-06-16T16:11:40.000Z | 2022-03-27T13:33:18.000Z | test/rv32f_test1.asm | kojad666/Vulcan | aae3da4ad04ffa8f8beb51bbc79916b9766d1576 | [
"MIT"
] | null | null | null | test/rv32f_test1.asm | kojad666/Vulcan | aae3da4ad04ffa8f8beb51bbc79916b9766d1576 | [
"MIT"
] | 11 | 2020-06-23T06:15:10.000Z | 2022-02-16T23:59:50.000Z | addi x10, x0, 13
addi x11, x0, -25
fcvt.s.w f0, x10
fcvt.s.w f1, x11
fdiv.s f2, f1, f0
fcvt.w.s x13, f2
| 14.857143 | 17 | 0.634615 |
ee57044f8fd8ae6d7ed54bead4d22936e6815bd3 | 1,305 | asm | Assembly | libsrc/_DEVELOPMENT/drivers/terminal/console_01/output/console_01_output_terminal_fzx/console_01_output_fzx_iterm_msg_readline_begin.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/drivers/terminal/console_01/output/console_01_output_terminal_fzx/console_01_output_fzx_iterm_msg_readline_begin.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/drivers/terminal/console_01/output/console_01_output_terminal_fzx/console_01_output_fzx_iterm_msg_readline_begin.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_driver
SECTION code_driver_terminal_output
PUBLIC console_01_output_fzx_iterm_msg_readline_begin
EXTERN OTERM_MSG_FZX_GET_XOR_DRAW
EXTERN l_offset_ix_de, l_jpix
EXTERN console_01_output_char_iterm_msg_readline_begin
console_01_output_fzx_iterm_msg_readline_begin:
; input terminal is starting a new edit line
; can use: af, bc, de, hl, ix
ld a,OTERM_MSG_FZX_GET_XOR_DRAW
call l_jpix ; bc = & fzx xor draw function
; save fzx variables during editing
ld hl,23
call l_offset_ix_de
ex de,hl ; de = & FDSTRUCT.temp_fzx_draw_mode
ld hl,8
add hl,de ; hl = & FDSTRUCT.fzx_draw
ld a,(hl) ; save current fzx_draw_mode
ld (de),a ; set new draw mode = __fzx_draw_xor
ld (hl),c
inc de
inc hl
ld a,(hl)
ld (de),a
ld (hl),b
inc de
inc hl
inc hl
inc hl
ldi ; edit line x coord = current x coord
ldi
ldi ; edit line y coord = current y coord
ldi
ld a,(ix+49)
ld (de),a ; save current space_expand
ld (ix+49),0 ; no space expand during editing
jp console_01_output_char_iterm_msg_readline_begin
| 23.303571 | 68 | 0.6 |
776babe1bd3bf9b69b678d831ceb5d32f4907dc0 | 3,520 | asm | Assembly | target/cos_117/disasm/iop_overlay1/STATION.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/STATION.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/STATION.asm | jrrk2/cray-sim | 52c9639808d6890517092637b188282c00cce4f7 | [
"BSL-1.0"
] | 6 | 2021-04-12T06:10:32.000Z | 2022-02-08T23:11:19.000Z | 0x0000 (0x000000) 0x2118- f:00020 d: 280 | A = OR[280]
0x0001 (0x000002) 0x8602- f:00103 d: 2 | P = P + 2 (0x0003), A # 0
0x0002 (0x000004) 0x7009- f:00070 d: 9 | P = P + 9 (0x000B)
0x0003 (0x000006) 0x2118- f:00020 d: 280 | A = OR[280]
0x0004 (0x000008) 0x0808- f:00004 d: 8 | A = A > 8 (0x0008)
0x0005 (0x00000A) 0x1630- f:00013 d: 48 | A = A - 48 (0x0030)
0x0006 (0x00000C) 0x2900- f:00024 d: 256 | OR[256] = A
0x0007 (0x00000E) 0x2100- f:00020 d: 256 | A = OR[256]
0x0008 (0x000010) 0x1604- f:00013 d: 4 | A = A - 4 (0x0004)
0x0009 (0x000012) 0x821C- f:00101 d: 28 | P = P + 28 (0x0025), C = 1
0x000A (0x000014) 0x700C- f:00070 d: 12 | P = P + 12 (0x0016)
0x000B (0x000016) 0x1027- f:00010 d: 39 | A = 39 (0x0027)
0x000C (0x000018) 0x1620- f:00013 d: 32 | A = A - 32 (0x0020)
0x000D (0x00001A) 0x1A00-0xFFFF f:00015 d: 0 | A = A & 65535 (0xFFFF)
0x000F (0x00001E) 0x0801- f:00004 d: 1 | A = A > 1 (0x0001)
0x0010 (0x000020) 0x2908- f:00024 d: 264 | OR[264] = A
0x0011 (0x000022) 0x2100- f:00020 d: 256 | A = OR[256]
0x0012 (0x000024) 0x2708- f:00023 d: 264 | A = A - OR[264]
0x0013 (0x000026) 0x8603- f:00103 d: 3 | P = P + 3 (0x0016), A # 0
0x0014 (0x000028) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x0015 (0x00002A) 0x2900- f:00024 d: 256 | OR[256] = A
0x0016 (0x00002C) 0x1028- f:00010 d: 40 | A = 40 (0x0028)
0x0017 (0x00002E) 0x2919- f:00024 d: 281 | OR[281] = A
0x0018 (0x000030) 0x1800-0x0166 f:00014 d: 0 | A = 358 (0x0166)
0x001A (0x000034) 0x291A- f:00024 d: 282 | OR[282] = A
0x001B (0x000036) 0x1800-0x0000 f:00014 d: 0 | A = 0 (0x0000)
0x001D (0x00003A) 0x291B- f:00024 d: 283 | OR[283] = A
0x001E (0x00003C) 0x2100- f:00020 d: 256 | A = OR[256]
0x001F (0x00003E) 0x291C- f:00024 d: 284 | OR[284] = A
0x0020 (0x000040) 0x1119- f:00010 d: 281 | A = 281 (0x0119)
0x0021 (0x000042) 0x5800- f:00054 d: 0 | B = A
0x0022 (0x000044) 0x1800-0x0318 f:00014 d: 0 | A = 792 (0x0318)
0x0024 (0x000048) 0x7C09- f:00076 d: 9 | R = OR[9]
0x0025 (0x00004A) 0x102A- f:00010 d: 42 | A = 42 (0x002A)
0x0026 (0x00004C) 0x2919- f:00024 d: 281 | OR[281] = A
0x0027 (0x00004E) 0x1119- f:00010 d: 281 | A = 281 (0x0119)
0x0028 (0x000050) 0x5800- f:00054 d: 0 | B = A
0x0029 (0x000052) 0x1000- f:00010 d: 0 | A = 0 (0x0000)
0x002A (0x000054) 0x7C09- f:00076 d: 9 | R = OR[9]
0x002B (0x000056) 0x0000- f:00000 d: 0 | PASS
0x002C (0x000058) 0x0000- f:00000 d: 0 | PASS
0x002D (0x00005A) 0x0000- f:00000 d: 0 | PASS
0x002E (0x00005C) 0x0000- f:00000 d: 0 | PASS
0x002F (0x00005E) 0x0000- f:00000 d: 0 | PASS
| 78.222222 | 79 | 0.459091 |
60469800416adef389b7539c0c0826b4b012623e | 466 | asm | Assembly | libsrc/_DEVELOPMENT/stdio/c/sccz80/fflush.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/c/sccz80/fflush.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/stdio/c/sccz80/fflush.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; int fflush(FILE *stream)
INCLUDE "clib_cfg.asm"
SECTION code_stdio
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
IF __CLIB_OPT_MULTITHREAD & $02
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC fflush
EXTERN asm_fflush
fflush:
push hl
pop ix
jp asm_fflush
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ELSE
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PUBLIC fflush
EXTERN fflush_unlocked
defc fflush = fflush_unlocked
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ENDIF
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
| 12.944444 | 31 | 0.437768 |
4f48787e0d4a5bb5f2b3baad7bd697e2ddf8b297 | 1,481 | asm | Assembly | program/print.asm | doowzs/BuggyOS | 4138261de7b25bd13ab7d343f3492a4e26939ae3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 7 | 2019-01-02T15:30:10.000Z | 2020-12-10T20:15:57.000Z | program/print.asm | doowzs/BuggyOS | 4138261de7b25bd13ab7d343f3492a4e26939ae3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | program/print.asm | doowzs/BuggyOS | 4138261de7b25bd13ab7d343f3492a4e26939ae3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 4 | 2019-07-18T13:13:01.000Z | 2020-12-14T02:41:34.000Z | _init:
xor $k0, $k0, $k0
xor $k1, $k1, $k1
xor $s0, $s0, $s0
addi $k0, $k0, 0x10000000
addi $k1, $k1, 0x10000118
addi $s0, $s0, 0x0000000d # ENTER KEY
#string HIT GOOD TRAP
addi $t0, $zero, 0x10002400
addi $t1, $zero, 0x48
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x49
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x54
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x20
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x47
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x4f
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x4f
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x44
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x20
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x54
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x52
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x41
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x50
sw $t1, ($t0)
addi $t0, $t0, 0x4
addi $t1, $zero, 0x0
sw $t1, ($t0)
addi $a0, $zero, 0x10002400
jal _print
j _end
_print:
add $t0, $zero, $a0
_print_start:
lw $a0, ($t0)
beq $a0, $zero, _print_end
add $t1, $zero, $ra
jal _write
add $ra, $zero, $t1
addi $t0, $t0, 0x4
j _print_start
_print_end:
jr $ra
_write:
sw $a0, ($k0)
addi $k0, $k0, 0x4
beq $a0, $s0, _write_newline
beq $k0, $k1, _write_newline
jr $ra
_write_newline:
add $t1, $zero, $ra
jal _newline
add $ra, $zero, $t1
jr $ra
_newline:
xor $k0, $k0, $k0
add $k0, $k0, $k1
addi $k1, $k1, 0x118 # 70 * 4
jr $ra
_end:
addi $s6, $s6, 0x99 | 16.640449 | 37 | 0.602296 |
82da09d6df33053e96d4008c364718856f1d6ad4 | 647 | asm | Assembly | cards/bn5/ModCards/136-B014 RedUFO.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | 10 | 2017-12-05T14:25:38.000Z | 2022-02-21T04:28:00.000Z | cards/bn5/ModCards/136-B014 RedUFO.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | null | null | null | cards/bn5/ModCards/136-B014 RedUFO.asm | RockmanEXEZone/MMBN-Mod-Card-Kit | d591ddca5566dbb323dc19c11e69410fa4073d1b | [
"Unlicense"
] | null | null | null | .include "defaults_mod.asm"
table_file_jp equ "exe5-utf8.tbl"
table_file_en equ "bn5-utf8.tbl"
game_code_len equ 3
game_code equ 0x4252424A // BRBJ
game_code_2 equ 0x42524245 // BRBE
game_code_3 equ 0x42524250 // BRBP
card_type equ 1
card_id equ 64
card_no equ "064"
card_sub equ "Mod Card 064"
card_sub_x equ 64
card_desc_len equ 2
card_desc_1 equ "RedUFO"
card_desc_2 equ "20MB"
card_desc_3 equ ""
card_name_jp_full equ "UFOサニー"
card_name_jp_game equ "UFOサニー"
card_name_en_full equ "RedUFO"
card_name_en_game equ "RedUFO"
card_address equ ""
card_address_id equ 0
card_bug equ 0
card_wrote_en equ ""
card_wrote_jp equ "" | 23.962963 | 35 | 0.771252 |
2d61a191fa01436b97e2c64e0f4a358e961eac31 | 21,646 | asm | Assembly | Tests/Graphics/Layer2Port/Main.asm | MrKWatkins/ZXSpectrumNextTests | d22f01338ef15b788bd324a32ba9c5ac335f71a3 | [
"MIT"
] | 23 | 2018-05-20T16:40:41.000Z | 2022-01-03T23:12:38.000Z | Tests/Graphics/Layer2Port/Main.asm | MrKWatkins/ZXSpectrumNextTests | d22f01338ef15b788bd324a32ba9c5ac335f71a3 | [
"MIT"
] | 3 | 2020-06-05T17:00:39.000Z | 2021-06-27T16:37:06.000Z | Tests/Graphics/Layer2Port/Main.asm | MrKWatkins/ZXSpectrumNextTests | d22f01338ef15b788bd324a32ba9c5ac335f71a3 | [
"MIT"
] | 2 | 2019-02-04T16:57:02.000Z | 2019-08-26T17:48:18.000Z | device zxspectrum48
org $C000 ; must be in last 16k as I'm using all-RAM mapping for Layer2
ds 32, $55 ; reserved space for stack
stack:
dw $AAAA
INCLUDE "../../Constants.asm"
INCLUDE "../../Macros.asm"
INCLUDE "../../TestFunctions.asm"
INCLUDE "../../OutputFunctions.asm"
LegendNr12:
db ' Visible Layer 2 (NextReg 0x12)', 0
LegendNr13:
db ' Shadow Layer 2 (NextReg 0x13)', 0
LegendTests:
db ' *** write-over-ROM 16kiB',0
db ' *** write-over-ROM 48kiB',0
db ' *** read-over-ROM 16kiB (data)',0
db ' *** read-over-ROM 48kiB (data)',0
db ' * read-over-ROM (code)',0
db ' * read-over-ROM (IM1 in L2)',0
LegendBankOffset:
db ' Bank offset (b4=1 I/O 0x123B)', 0
db '[ ] r+w-over-ROM 16ki 0x12',0
db '[ ] r+w-over-ROM 48ki 0x12',0
db 0
db '[ ] r+w-over-ROM 16ki 0x13',0
db '[ ] r+w-over-ROM 48ki 0x13',0
.lines equ 6
Start:
ld sp,stack
NEXTREG_nn TURBO_CONTROL_NR_07,3 ; 28MHz
call StartTest
ld de,MEM_ZX_SCREEN_4000+32*8*16+7*32+5 ; bottom right corner
ld bc,MEM_ZX_SCREEN_4000+32*8*16+7*32+19
call OutMachineIdAndCore_defLabels
;; preparing ULA screen for output
BORDER CYAN
call OutputLegend
;; preparing initial state of machine before tests
BORDER BLUE
; setup transparency features - make pink transparent and visible as fallback
NEXTREG_nn GLOBAL_TRANSPARENCY_NR_14, $E3
NEXTREG_nn TRANSPARENCY_FALLBACK_COL_NR_4A, $E3
; reset Layer2 scroll registers and set up clip window (to hide code/test values)
NEXTREG_nn LAYER2_XOFFSET_NR_16, 0
NEXTREG_nn LAYER2_YOFFSET_NR_17, 0
NEXTREG_nn CLIP_WINDOW_CONTROL_NR_1C,$01 ; reset index in L2 clip
NEXTREG_nn CLIP_LAYER2_NR_18,7 ; [7,1] -> [55,176] is enough for results
NEXTREG_nn CLIP_LAYER2_NR_18,55
NEXTREG_nn CLIP_LAYER2_NR_18,1
NEXTREG_nn CLIP_LAYER2_NR_18,176
; init banks + make layer 2 visible
NEXTREG_nn LAYER2_RAM_BANK_NR_12,9
NEXTREG_nn LAYER2_RAM_SHADOW_BANK_NR_13,12
ld bc,LAYER2_ACCESS_P_123B
ld a,LAYER2_ACCESS_L2_ENABLED
out (c),a
; banks 9, 10, 11 => visible Layer 2 (fill with 0xE3 = transparent)
; banks 12, 13, 14 => shadow layer 2 (fill with 0xE0 = red)
call FillLayer2Banks
; banks 15, 16, 17 => fill as 8kiB pages with 0x11, 0x12, .., 0x16
ld a,15*2
ld hl,$E000
ld bc,$0611
.MarkRamLoop:
NEXTREG_A MMU7_E000_NR_57
inc a
ld (hl),c
inc c
djnz .MarkRamLoop
; map banks 15, 16, 17 to whole region $0000..$BFFF with MMU
NEXTREG_nn MMU0_0000_NR_50,15*2
NEXTREG_nn MMU1_2000_NR_51,15*2+1
NEXTREG_nn MMU2_4000_NR_52,15*2+2
NEXTREG_nn MMU3_6000_NR_53,15*2+3
NEXTREG_nn MMU4_8000_NR_54,15*2+4
NEXTREG_nn MMU5_A000_NR_55,15*2+5
;; running tests one by one
BORDER YELLOW
ld e,$F0 ; all tests OK so far (top four bits must stay set to 1, zero bit = some error)
call TestWriteOverRom
call TestReadOverRom
call TestReadOverRomCode
call TestReadOverRomIm1
;;; read+write together?
call TestBankOffsetRead
; reset the L2 port settings
ld bc,LAYER2_ACCESS_P_123B
ld a,LAYER2_ACCESS_BANK_OFFSET|0
out (c),a
ld a,LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_SHADOW_OVER_ROM
out (c),a ; but set "shadow" mode to exercise emulators more
;; test done - do total border RED/GREEN depending on some error detected
ld a,e
cp $F0
ld a,GREEN
jr z,.AllTestsOk
ld a,RED
.AllTestsOk:
out (254),a
jp EndTest
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;test write-over-rom
MACRO Test8kiPage address?, writeVal?, readVal?
ld hl,address?
ld (hl),writeVal?
rlc d
ld a,(hl)
cp readVal?
jr nz,800F
set 4,d ; set "1" to bit in D when OK (read)
800:
ENDM
MACRO VerifyWrite page?, value?
NEXTREG_nn MMU7_E000_NR_57,page?
rlc d
ld a,($E000)
cp value?
jr nz,801F
set 4,d
801:
ENDM
MACRO Test16kiBank bankSelect?, bankNumber?, wAdr?, wVal1?, wVal2?, rVal1?, rVal2?, resultAdr?, resultBank?
; map bank for write
ld bc,LAYER2_ACCESS_P_123B
ld a,LAYER2_ACCESS_L2_ENABLED|bankSelect?
out (c),a
;write first byte of each 8kiB page ($F9.. values)
;read address + verify [$11..] (write didn't affect regular RAM)
ld d,0 ; clear result (all bad)
Test8kiPage wAdr?+$0000, wVal1?, rVal1?
Test8kiPage wAdr?+$2000, wVal2?, rVal2?
; map the Layer2 memory with regular MMU to $E000 and verify written values
VerifyWrite bankNumber?*2, wVal1?
VerifyWrite bankNumber?*2+1, wVal2?
; cumulative result
ld a,resultBank?
ld hl,resultAdr?
call CumulateErrorAndDisplay
ENDM
TestWriteOverRom:
; normal Layer 2 (NextReg $12)
.m1 EQU LAYER2_ACCESS_WRITE_OVER_ROM
Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_BANK_0, 9, $0000, $F9, $FA, $11, $12, $E808, 9*2
Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_BANK_1, 10, $0000, $FB, $FC, $11, $12, $E810, 9*2
Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_BANK_2, 11, $0000, $FD, $FE, $11, $12, $E818, 9*2
Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_48K, 9, $0000, $E9, $EA, $11, $12, $F00B, 9*2
Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_48K, 10, $4000, $EB, $EC, $13, $14, $F013, 9*2
Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_48K, 11, $8000, $ED, $EE, $15, $16, $F01B, 9*2
; shadow Layer 2 (NextReg $13)
.m2 EQU LAYER2_ACCESS_WRITE_OVER_ROM|LAYER2_ACCESS_SHADOW_OVER_ROM
Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_BANK_0, 12, $0000, $D9, $DA, $11, $12, $E808, 10*2
Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_BANK_1, 13, $0000, $DB, $DC, $11, $12, $E810, 10*2
Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_BANK_2, 14, $0000, $DD, $DE, $11, $12, $E818, 10*2
Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_48K, 12, $0000, $C9, $CA, $11, $12, $F00B, 10*2
Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_48K, 13, $4000, $CB, $CC, $13, $14, $F013, 10*2
Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_48K, 14, $8000, $CD, $CE, $15, $16, $F01B, 10*2
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; test read-over-rom
TestReadOverRom:
; the same Test16kiBank macro can be used also to test "read-over"
; testing if write goes through into mapped RAM, and if read is overshadowed by Layer2
; normal Layer 2 (NextReg $12)
.m1 EQU LAYER2_ACCESS_READ_OVER_ROM
Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_BANK_0, 15, $0000, $19, $1A, $E9, $EA, $F808, 9*2
Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_BANK_1, 15, $0000, $1B, $1C, $EB, $EC, $F810, 9*2
Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_BANK_2, 15, $0000, $1D, $1E, $ED, $EE, $F818, 9*2
Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_48K, 15, $0000, $19, $1A, $E9, $EA, $E00B, 9*2+1
Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_48K, 16, $4000, $1B, $1C, $EB, $EC, $E013, 9*2+1
Test16kiBank .m1|LAYER2_ACCESS_OVER_ROM_48K, 17, $8000, $1D, $1E, $ED, $EE, $E01B, 9*2+1
; shadow Layer 2 (NextReg $13)
.m2 EQU LAYER2_ACCESS_READ_OVER_ROM|LAYER2_ACCESS_SHADOW_OVER_ROM
Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_BANK_0, 15, $0000, $29, $2A, $C9, $CA, $F808, 10*2
Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_BANK_1, 15, $0000, $2B, $2C, $CB, $CC, $F810, 10*2
Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_BANK_2, 15, $0000, $2D, $2E, $CD, $CE, $F818, 10*2
Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_48K, 15, $0000, $29, $2A, $C9, $CA, $E00B, 10*2+1
Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_48K, 16, $4000, $2B, $2C, $CB, $CC, $E013, 10*2+1
Test16kiBank .m2|LAYER2_ACCESS_OVER_ROM_48K, 17, $8000, $2D, $2E, $CD, $CE, $E01B, 10*2+1
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; test read-over-rom for CPU executing code
MACRO TestCodeInLayer L2bank?, bank_access?, resultAdr?, resultBank?
ld d,$00 ; clear result (all bad)
; switch off all the Layer 2 settings (just keep display)
ld bc,LAYER2_ACCESS_P_123B
ld a,LAYER2_ACCESS_L2_ENABLED
out (c),a
; code test - set up the test code in the first layer 2 bank (targetting ROM $007D)
NEXTREG_nn MMU7_E000_NR_57,L2bank?
push de
ld hl,RomShadowTestCodeSource
ld de,$E000+$7D
ld bc,RomShadowTestCodeSourceLength
ldir
pop de
; verify there is ROM mapped as expected (`cp $21 : ret nc`)
NEXTREG_nn MMU0_0000_NR_50,$FF ; map ROM back
NEXTREG_nn MMU1_2000_NR_51,$FF
ld hl,RomExpectedCodeSourceEnd-1 ; pointer into expected values
ld bc,$007D+RomShadowTestCodeSourceLength-1 ; pointer into ROM
REPT 3 ; test three bytes of ROM code: 3x
ld a,(bc)
cpd ; HL--, BC--
jr nz,.UnexpectedRomContent
ENDR
; call the ROM code
ld a,'!'
call $7D ; CF=0 ROM, CF=1 L2
jr c,.NotRomResult
set 7,d
.NotRomResult:
; set read-over-rom
ld bc,LAYER2_ACCESS_P_123B
ld a,LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_READ_OVER_ROM|bank_access?
out (c),a
; call the Layer 2 code
ld a,'!'
call $7D ; CF=0 ROM, CF=1 L2
jr nc,.NotReadL2Result
set 6,d
.NotReadL2Result:
; set write-over-rom
ld bc,LAYER2_ACCESS_P_123B
ld a,LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_WRITE_OVER_ROM|bank_access?
out (c),a
; call the ROM code
ld a,'!'
call $7D ; CF=0 ROM, CF=1 L2
jr c,.NotRomResult2
set 5,d
.NotRomResult2:
; set read+write-over-rom
ld bc,LAYER2_ACCESS_P_123B
ld a,LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_READ_OVER_ROM|LAYER2_ACCESS_WRITE_OVER_ROM|bank_access?
out (c),a
; call the Layer 2 code
ld a,'!'
call $7D ; CF=0 ROM, CF=1 L2
jr nc,.NotReadL2Result2
set 4,d
.NotReadL2Result2:
.UnexpectedRomContent:
ld a,resultBank?
ld hl,resultAdr?
call CumulateErrorAndDisplay
ENDM
TestReadOverRomCode:
TestCodeInLayer 9*2, LAYER2_ACCESS_OVER_ROM_BANK_0, $E818, 9*2+1
TestCodeInLayer 12*2, LAYER2_ACCESS_SHADOW_OVER_ROM|LAYER2_ACCESS_OVER_ROM_BANK_0, $E818, 10*2+1
ret
RomShadowTestCodeSource:
cp $FF
ret
RomShadowTestCodeSourceLength EQU $ - RomShadowTestCodeSource
RomExpectedCodeSource: ; ROM code which is expected (ZX48 ROM)
cp $21
ret nc
RomExpectedCodeSourceEnd:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; test read-over-rom for CPU executing IM1 code
TestReadOverRomIm1:
; set up the IM1 handler in the third layer2's bank (targetting ROM $0038)
push de
; normal Layer 2
NEXTREG_nn MMU7_E000_NR_57,11*2
ld de,$E000+$38
ld hl,RomShadowTestIm1Source
ld bc,RomShadowTestIm1SourceLength
ldir
; shadow Layer 2
NEXTREG_nn MMU7_E000_NR_57,14*2
ld de,$E000+$38
ld hl,RomShadowTestIm1Source
ld bc,RomShadowTestIm1SourceLength
ldir
pop de
; normal Layer 2 - TEST is here
ld d,$00 ; clear result (all bad)
; set read-over-ROM
ld bc,LAYER2_ACCESS_P_123B
ld a,LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_READ_OVER_ROM|LAYER2_ACCESS_OVER_ROM_BANK_2
out (c),a
; EI + 4x HALT + DI
ei
.4 halt ; each IM1 should set one bit in D
di
; print result
ld a,9*2+1
ld hl,$F01B
call CumulateErrorAndDisplay
; shadow Layer 2 - TEST is here
ld d,$00 ; clear result (all bad)
; make normal layer 2 handler to fail
NEXTREG_nn MMU7_E000_NR_57,11*2
xor a
ld ($E03A),a ; `nop` instead of set 4,d
ld ($E03B),a
; set read-over-ROM
ld bc,LAYER2_ACCESS_P_123B
ld a,LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_READ_OVER_ROM|LAYER2_ACCESS_SHADOW_OVER_ROM|LAYER2_ACCESS_OVER_ROM_BANK_2
out (c),a
; EI + 4x HALT + DI
ei
.4 halt ; each IM1 should set one bit in D
di
; clear the visible part of Layer2
push de
NEXTREG_nn MMU7_E000_NR_57,11*2
ld hl,$E000+$38
ld de,$E000+$38+1
ld bc,RomShadowTestIm1SourceLength
ld (hl),$E3
ldir
pop de
; print result
ld a,10*2+1
ld hl,$F01B
jp CumulateErrorAndDisplay
RomShadowTestIm1Source:
; this is intentionally modifying the "result" register directly from interrupt code
rlc d
set 4,d
ei
ret
RomShadowTestIm1SourceLength EQU $ - RomShadowTestIm1Source
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; test new bank-offset of core3.1+ with read-over-rom mapping
TestBankOffsetRead:
; set up memory banks for the bank-offset tests again
BORDER BLUE
ld ix,$F000
ld a,9*2
.setMemoryLoop: ; mark even 8k pages (odd are not tested)
NEXTREG_A MMU7_E000_NR_57
cpl
ld (ix+1),a
cpl
ld (ix),a
inc a
inc a
cp (13+9)*2
jr nz,.setMemoryLoop
; revert the memory mapping to default rom:5:2:x
NEXTREG_nn MMU0_0000_NR_50,255
NEXTREG_nn MMU1_2000_NR_51,255
NEXTREG_nn MMU2_4000_NR_52,5*2+0
NEXTREG_nn MMU3_6000_NR_53,5*2+1
NEXTREG_nn MMU4_8000_NR_54,2*2+0
NEXTREG_nn MMU5_A000_NR_55,2*2+1
; run tests
BORDER YELLOW
; test visible L2 layer first (both 16ki and 48ki tests in one subroutine)
ld iy,(11*2<<8)+9*2 ; test value - visible first bank + result page number
ld hl,$E809 ; result output address
ld a,LAYER2_ACCESS_OVER_ROM_BANK_0
call Test16kiAnd48kiBankOffsets
; test shadow L2 layer first (both 16ki and 48ki tests in one subroutine)
ld iy,((11*2+1)<<8)+12*2 ; test value - shadow first bank + result page
ld hl,$E009 ; result output address
ld a,LAYER2_ACCESS_OVER_ROM_BANK_0|LAYER2_ACCESS_SHADOW_OVER_ROM
; |
; fallthrough into Test16kiAnd48kiBankOffsets and return from there
; |
Test16kiAnd48kiBankOffsets:
; IN:
; IYL = test-value and first page of first bank (8*2 for bank0 offset 0 NR$12=8)
; IYH = 8ki page number for result output (for MMU7_E000 slot)
; HL = result output address, E = global error tracking
; A = visible/shadow value for port $123B (Layer2 port)
; IX = check address in MMU7 slot ($F000 in this test)
; OUT: HL += $0300 (+3 lines below), updated E
; MOD: AF, BC, l2port, IYL
or LAYER2_ACCESS_L2_ENABLED|LAYER2_ACCESS_WRITE_OVER_ROM|LAYER2_ACCESS_READ_OVER_ROM
push iy
; do the three 16ki tests (base mapping changes, r+w test address is fixed $1000..+1)
.loopNextBankType:
; change the layer2 port mapping bank0/1/2 with desired mode
ld bc,LAYER2_ACCESS_P_123B
out (c),a
call TestEightBankOffsets
inc iyl ; starting at +1 bank later
inc iyl
add a,$40 ; next bank offset
cp LAYER2_ACCESS_OVER_ROM_48K
jr c,.loopNextBankType
; do the three 48ki tests (base mapping fixed, r+w test address: $1000, $5000, $9000)
ld bc,LAYER2_ACCESS_P_123B
out (c),a ; A = the 48ki mapping constant from last ADD above
pop iy ; restore test value - visible first bank
.loop48kiBankType:
call TestEightBankOffsets
inc iyl ; starting at +1 bank later
inc iyl
ld a,(TestEightBankOffsets.aR+1)
add a,$40
ld (TestEightBankOffsets.aR+1),a
ld (TestEightBankOffsets.aW+1),a
cp $C0
jr c,.loop48kiBankType
; reset test addresses inside TestEightBankOffsets subroutine
ld a,$10
ld (TestEightBankOffsets.aR+1),a
ld (TestEightBankOffsets.aW+1),a
ret
TestEightBankOffsets:
; IN:
; IYL = test-value and first page of first bank (8*2 for bank0 offset 0 NR$12=8)
; IYH = 8ki page number for result output (for MMU7_E000 slot)
; HL = result output address, E = global error tracking
; I/O $123B (Layer2 port) = read+write mapping for visible or shadow layer as desired
; IX = check address in MMU7 slot ($F000 in this test)
; OUT: HL += $0300 (+3 lines below), updated E
; MOD: BC
push af
push hl
push iy
ld a,LAYER2_ACCESS_BANK_OFFSET|0
.doNextBankOffset:
ld bc,LAYER2_ACCESS_P_123B
out (c),a
ld bc,%110'000'00'000'110'00 ; red:green (Bad:Correct)
ex af,af
.aR=$+1:ld a,($1000)
cp iyl
call DisplayResultDot
ld bc,%111'000'00'000'111'00 ; red:green (Bad:Correct)
ld a,iyl
.aW=$+1:ld ($1001),a
NEXTREG_A MMU7_E000_NR_57
cp (ix+1)
call DisplayResultDot
inc l
inc l
inc iyl
inc iyl
ex af,af
inc a
cp LAYER2_ACCESS_BANK_OFFSET|8
jr nz,.doNextBankOffset
pop iy
pop hl
inc h ; +3 pixel lines down
inc h
inc h
pop af
ret
DisplayResultDot:
; IYH = 8ki page number for result output (for MMU7_E000 slot)
; ZF = correctness, HL = target adr, BC = colors (bad:correct)
; E = global result tracking (will be damaged in case of incorrect result
; output: HL+=2, updated E, modifies: AF, MMU7_E000 mapping
ld a,iyh
NEXTREG_A MMU7_E000_NR_57
ld a,c ; "correct" color
jr z,.isCorrectResult
res 7,e ; mark error in total result
ld a,b ; "bad" color
.isCorrectResult:
ld (hl),a ; draw 2x2 dot
inc h
ld (hl),a
inc l
ld (hl),a
dec h
ld (hl),a
inc l
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; utility functions
CumulateErrorAndDisplay: ; A = bank to write result to, HL = address to draw at
NEXTREG_A MMU7_E000_NR_57
; cumulate the error results in register E
ld a,d
and e
ld e,a
; display results (rectangle 7x8 split into 4 parts horizontally green/red)
;;; continue into DisplayResultSquare
DisplayResultSquare: ; D = %xxxx'0000 => results, x=1 OK, x=0 BAD
call .TwoValues ; two values + two values = (all) four values
.TwoValues:
call .OneValue ; one + one value = two values
.OneValue:
ld a,%111'000'00 ; red
rl d
jr nc,.wasBad
ld a,%000'111'00 ; green
.wasBad:
call .OnePixelRow ; one + one row = two rows
and %110'110'11 ; darken the color a bit for second row
.OnePixelRow:
ld b,6
push hl
.rowLoop:
ld (hl),a
inc l
djnz .rowLoop
pop hl
inc h
ret
; display legend in ULA screen text
OutputLegend:
; new part of test - bank offset legend
ld de,MEM_ZX_SCREEN_4000+32*8*16 ; third third
ld hl,LegendBankOffset
ld b,LegendBankOffset.lines
.bankOfsLegendLoop:
call OutStringAtDe
ld a,e
add a,32
ld e,a
djnz .bankOfsLegendLoop
; old parts of test
ld de,MEM_ZX_SCREEN_4000
ld hl,LegendNr12
call OutStringAtDe
ld de,MEM_ZX_SCREEN_4000+32*8*8 ; second third
ld hl,LegendNr13
call OutStringAtDe
; display lines for separate tests
ld de,MEM_ZX_SCREEN_4000+32 ; second line
call .BatchLoop
ld de,MEM_ZX_SCREEN_4000+32*8*8+32 ; ninth line
.BatchLoop:
ld b,6
ld hl,LegendTests
.StringLoop:
call OutStringAtDe
ld a,e
add a,32
ld e,a
djnz .StringLoop
ret
FillLayer2Banks:
ld a,9*2
.fillVisibleL2:
ld c,$E3
call .fill8kiB
inc a
cp 12*2
jr nz,.fillVisibleL2
.fillShadowL2:
ld c,$E0
call .fill8kiB
inc a
cp 15*2
jr nz,.fillShadowL2
ret
.fill8kiB: ; A = page to map into MMU7, C = color to fill, modifies HL,DE,BC
NEXTREG_A MMU7_E000_NR_57
ld hl,$E000
ld de,$E001
ld (hl),c
ld bc,$1FFF
ldir
ret
ASSERT $ < $E000
savesna "L2Port.sna", Start
| 36.750424 | 126 | 0.580338 |
cd5fee2f486b954dfabfc1ab24e0d48e71a29adc | 709 | asm | Assembly | oeis/344/A344221.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/344/A344221.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/344/A344221.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A344221: a(n) = Sum_{k=1..n} tau(gcd(k,n)^3), where tau(n) is the number of divisors of n.
; Submitted by Jon Maiga
; 1,5,6,13,8,30,10,29,21,40,14,78,16,50,48,61,20,105,22,104,60,70,26,174,43,80,66,130,32,240,34,125,84,100,80,273,40,110,96,232,44,300,46,182,168,130,50,366,73,215,120,208,56,330,112,290,132,160,62,624,64,170,210,253,128,420,70,260,156,400,74,609,76,200,258,286,140,480,82,488,201,220,86,780,160,230,192,406,92,840,160,338,204,250,176,750,100,365,294,559
add $0,1
mov $1,1
mov $2,2
lpb $0
mov $3,$0
lpb $3
mov $4,$0
mod $4,$2
add $2,1
cmp $4,0
cmp $4,0
sub $3,$4
lpe
mov $5,1
lpb $0
dif $0,$2
mul $5,$2
add $5,3
lpe
mul $1,$5
lpe
mov $0,$1
| 26.259259 | 354 | 0.607898 |
ae2e569c613f1b8f8a649102b70446aff51495aa | 354 | asm | Assembly | programs/oeis/159/A159355.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/159/A159355.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/159/A159355.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A159355: Number of n X n arrays of squares of integers summing to 4.
; 5,135,1836,12675,58941,211925,635440,1663821,3921325,8495531,17179020,32795295,59626581,103962825,174792896,284660665,450710325,695946991,1050740300,1554600411,2258257485,3226077405,4538848176,6296973125
add $0,2
mov $2,$0
mul $2,$0
mov $1,$2
sub $1,4
bin $2,4
add $1,$2
add $1,4
| 29.5 | 205 | 0.771186 |
b4ea29a17c98a63f2ef70843459dc6aa508734d7 | 607 | asm | Assembly | programs/oeis/031/A031395.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/031/A031395.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/031/A031395.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A031395: a(n) = prime(8*n - 4).
; 7,37,71,107,151,193,239,281,337,383,433,479,541,593,641,683,743,809,857,911,971,1021,1069,1123,1193,1249,1301,1373,1439,1487,1549,1601,1657,1721,1783,1861,1907,1987,2029,2089,2143,2237,2287,2347,2393,2459,2543,2617,2677,2713,2777,2837,2903,2969,3041,3119,3191,3257,3323,3373,3461,3527,3571,3631,3697,3767,3833,3907,3947,4021,4093,4157,4231,4283,4363,4447,4513,4583,4649,4721,4789,4871,4937,4993,5051,5113,5197,5279,5351,5419,5479,5531,5639,5683,5743,5821,5867,5939,6043,6101
mul $0,8
add $0,2
seq $0,98090 ; Numbers k such that 2k-3 is prime.
sub $0,5
mul $0,2
add $0,7
| 60.7 | 476 | 0.744646 |
74bfcbd7968e0c04077f258e9f9a7cdea3fa1c23 | 404 | asm | Assembly | oeis/217/A217858.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/217/A217858.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/217/A217858.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A217858: Odd part of lcm(1,2,3,...,n).
; Submitted by Christian Krause
; 1,1,3,3,15,15,105,105,315,315,3465,3465,45045,45045,45045,45045,765765,765765,14549535,14549535,14549535,14549535,334639305,334639305,1673196525,1673196525,5019589575,5019589575,145568097675,145568097675,4512611027925,4512611027925,4512611027925
seq $0,51426 ; Least common multiple of {2, 4, 6, ..., 2n}.
lpb $0
dif $0,2
lpe
| 44.888889 | 247 | 0.764851 |
a18e9c7775317ff6f8a7b732b11ba7b07edf7e44 | 1,328 | asm | Assembly | libsrc/target/fp1100/stdio/generic_console_ioctl.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/fp1100/stdio/generic_console_ioctl.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/fp1100/stdio/generic_console_ioctl.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
PUBLIC generic_console_ioctl
EXTERN __console_w
EXTERN generic_console_font32
EXTERN generic_console_udg32
EXTERN __fp1100_mode
INCLUDE "target/fp1100/def/fp1100.def"
INCLUDE "ioctl.def"
PUBLIC CLIB_GENCON_CAPS
defc CLIB_GENCON_CAPS = CAP_GENCON_FG_COLOUR | CAP_GENCON_BG_COLOUR | CAP_GENCON_INVERSE
generic_console_ioctl:
ex de,hl
ld c,(hl) ;bc = where we point to
inc hl
ld b,(hl)
cp IOCTL_GENCON_SET_FONT32
jr nz,check_set_udg
ld (generic_console_font32),bc
success:
and a
ret
check_set_udg:
cp IOCTL_GENCON_SET_UDGS
jr nz,check_set_mode
ld (generic_console_udg32),bc
jr success
check_set_mode:
cp IOCTL_GENCON_SET_MODE
jr nz,failure
ld a,c
ld b,0
ld l,40
and 1
jr z,setmode
ld b,1
ld l,80
dec a
jr z,setmode
failure:
scf
ret
setmode:
ld a,c
ld (__fp1100_mode),a
ld a,l
ld (__console_w),a
ld a,SUB_SCREENSIZE
call TRNC2
and a
ret
| 22.896552 | 96 | 0.524849 |
cfc5b855ff2ee37a5293e805348db8c9ee909d38 | 42,876 | asm | Assembly | DevSound.asm | DevEd2/DevSound | 0e93abc15833fc1350c4a694575f95b04eb06ed8 | [
"MIT"
] | 49 | 2017-04-19T07:54:23.000Z | 2021-12-30T03:22:02.000Z | DevSound.asm | DevEd2/DevSound | 0e93abc15833fc1350c4a694575f95b04eb06ed8 | [
"MIT"
] | 3 | 2017-10-11T18:56:58.000Z | 2019-06-27T04:17:02.000Z | DevSound.asm | DevEd2/DevSound | 0e93abc15833fc1350c4a694575f95b04eb06ed8 | [
"MIT"
] | 5 | 2017-04-26T21:32:48.000Z | 2019-11-07T13:01:25.000Z | ; ================================================================
; DevSound - a Game Boy music system by DevEd
;
; Copyright (c) 2017 - 2018 DevEd
;
; 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.
; ================================================================
; Uncomment the following line to enable custom hooks.
; UseCustomHooks set 1
; Uncomment the following line if you want the DevSound player code to be in ROM0 instead of its own bank.
; Could be useful for multibank setups.
; TODO: Make some tweaks to song data format to allow for multiple banks
; UseROM0 set 1
; Uncomment the following line if you want to include song data elsewhere.
; Could be useful for multibank setups.
; TODO: Make some tweaks to song data format to allow for multiple banks
; DontIncludeSongData set 1
; Comment the following line to disable SFX support (via FX Hammer).
; Useful if you want to use your own sound effect system.
; (Note that DevSound may require some minor modifications if you
; want to use your own SFX system.)
UseFXHammer set 1
; Uncomment this to disable all time-consuming features
; This includes: wave buffer, PWM, random wave, zombie mode,
; wave volume scaling, channel volume
; WARNING: Any songs that use the additional features will crash DevSound!
; DemoSceneMode set 1
; Uncomment this to to disable wave volume scaling.
; PROS: Less CPU usage
; CONS: Less volume control for CH3
; NoWaveVolumeScaling set 1
; Uncomment this to disable zombie mode (for compatibility
; with old emulators such as VBA).
; NOTE: Zombie mode is known to be problematic with certain
; GBC CPU revisions. If you want your game/demo to be
; compatible with all GBC hardware revisions, I would
; recommend disabling this.
; PROS: Less CPU usage
; Compatible with old emulators such as VBA
; CONS: Volume envelopes will sound "dirtier"
; DisableZombieMode set 1
; Comment this line to enable Deflemask compatibility hacks.
DisableDeflehacks set 1
; Uncomment this line for a simplified echo buffer. Useful if RAM usage
; is a concern.
; PROS: Less RAM usage
; CONS: Echo delay will be disabled
; SimpleEchoBuffer set 1
if !def(UseFXHammerDisasm)
FXHammer_SFXCH2 equ $c7cc
FXHammer_SFXCH4 equ $c7d9
endc
DevSound:
include "DevSound_Vars.asm"
include "DevSound_Consts.asm"
include "DevSound_Macros.asm"
if !def(UseROM0)
SECTION "DevSound",ROMX
else
SECTION "DevSound",ROM0
endc
if !def(UseCustomHooks)
DevSound_JumpTable:
DS_Init: jp DevSound_Init
DS_Play: jp DevSound_Play
DS_Stop: jp DevSound_Stop
DS_Fade: jp DevSound_Fade
DS_ExternalCommand: jp DevSound_ExternalCommand
endc
; Driver thumbprint
db "DevSound GB music player by DevEd | email: deved8@gmail.com"
; ================================================================
; Init routine
; INPUT: a = ID of song to init
; ================================================================
DevSound_Init:
di
push af ; Preserve song ID
xor a
ldh [rNR52],a ; disable sound
ld [PWMEnabled],a
ld [RandomizerEnabled],a
ld [WaveBufUpdateFlag],a
; init sound RAM area
ld de,DefaultRegTable
ld hl,InitVarsStart
ld c,DSVarsEnd-InitVarsStart
.initLoop
ld a,[de]
ld [hl+],a
inc de
dec c
jr nz,.initLoop
xor a
ld c,DSBufVarsEnd-DSBufVars
.initLoop2
ld [hl+],a
dec c
jr nz,.initLoop2
; load default waveform
ld hl,DefaultWave
call LoadWave
; clear buffers
call ClearWaveBuffer
call ClearArpBuffer
call ClearEchoBuffers
pop af
add a
ld e,a
adc a,0
sub e
ld d,a
; set up song pointers
ld hl,SongPointerTable
add hl,de
ld a,[hl+]
ld h,[hl]
ld l,a
ld a,[hl+]
ld [CH1Ptr],a
ld a,[hl+]
ld [CH1Ptr+1],a
ld a,[hl+]
ld [CH2Ptr],a
ld a,[hl+]
ld [CH2Ptr+1],a
ld a,[hl+]
ld [CH3Ptr],a
ld a,[hl+]
ld [CH3Ptr+1],a
ld a,[hl+]
ld [CH4Ptr],a
ld a,[hl+]
ld [CH4Ptr+1],a
ld a,low(DummyChannel)
ld [CH1RetPtr],a
ld [CH2RetPtr],a
ld [CH3RetPtr],a
ld [CH4RetPtr],a
ld a,high(DummyChannel)
ld [CH1RetPtr+1],a
ld [CH2RetPtr+1],a
ld [CH3RetPtr+1],a
ld [CH4RetPtr+1],a
ld a,$11
ld [CH1Pan],a
ld [CH2Pan],a
ld [CH3Pan],a
ld [CH4Pan],a
ld a,15
ld [CH1ChanVol],a
ld [CH2ChanVol],a
ld [CH3ChanVol],a
ld [CH4ChanVol],a
; get tempo
ld hl,SongSpeedTable
add hl,de
ld a,[hl+]
dec a
ld [GlobalSpeed1],a
ld a,[hl]
dec a
ld [GlobalSpeed2],a
ld a,%10000000
ldh [rNR52],a
ld a,$FF
ldh [rNR51],a
ld a,7
ld [GlobalVolume],a
; if visualizer is enabled, init it too
if def(Visualizer)
if !def(DemoSceneMode) && !def(NoWaveVolumeScaling)
CopyBytes DefaultWave,VisualizerTempWave,16
endc
call VisualizerInit
endc
reti
; ================================================================
; External command processing routine
; INPUT: a = command ID
; bc = parameters
; ================================================================
DevSound_ExternalCommand:
cp (.commandTableEnd-.commandTable)/2
ret nc ; if command ID is out of bounds, exit
ld hl,.commandTable
add a
add l
ld l,a
jr nc,.nocarry
inc h
.nocarry
ld a,[hl+]
ld h,[hl]
ld l,a
jp hl
.commandTable
dw .dummy ; $00 - dummy
dw .setSpeed ; $01 - set speed
dw .muteChannel ; $02 - mute given sound channel (TODO)
.commandTableEnd
.setSpeed
ld a,b
ld [GlobalSpeed1],a
ld a,c
ld [GlobalSpeed2],a
; ret
.muteChannel ; TODO
; ld a,c
; and 3
.dummy
ret
; ================================================================
; Stop routine
; ================================================================
DevSound_Stop:
ld c,low(rNR52)
xor a
ld [c],a ; disable sound output (resets all sound regs)
set 7,a
ld [c],a ; enable sound output
dec c
xor a
ld [CH1Enabled],a
ld [CH2Enabled],a
ld [CH3Enabled],a
ld [CH4Enabled],a
ld [SoundEnabled],a
dec a ; Set a to $FF
ld [c],a ; all sound channels to left+right speakers
dec c
and $77
ld [c],a ; VIN output off + master volume max
; if visualizer is enabled, init it too (to make everything zero)
if def(Visualizer)
jp VisualizerInit
else
ret
endc
; ================================================================
; Fade routine
; Note: if planning to call both this and DS_Init, call this first.
; ================================================================
DevSound_Fade:
and 3
cp 3
ret z ; 3 is an invalid value, silently ignore it
inc a ; Increment...
set 2,a ; Mark this fade as the first
ld [FadeType],a
ld a,7
ld [FadeTimer],a
ret
; ================================================================
; Play routine
; ================================================================
DevSound_Play:
; Since this routine is called during an interrupt (which may
; happen in the middle of a routine), preserve all register
; values just to be safe.
; Other registers are saved at `.doUpdate`.
push af
ld a,[SoundEnabled]
and a
jr nz,.doUpdate ; if sound is enabled, jump ahead
pop af
ret
.doUpdate
push bc
push de
push hl
; do stuff with sync tick
ld a,[SyncTick]
and a
jr z,.getSongTimer
dec a
ld [SyncTick],a
.getSongTimer
ld a,[GlobalTimer] ; get global timer
and a ; is GlobalTimer non-zero?
jr nz,.noupdate ; if yes, don't update
ld a,[TickCount] ; get current tick count
xor 1 ; toggle between 0 and 1
ld [TickCount],a ; store it in RAM
jr nz,.odd ; if a is 1, jump
.even
ld a,[GlobalSpeed2]
jr .setTimer
.odd
ld a,[GlobalSpeed1]
.setTimer
ld [GlobalTimer],a ; store timer value
jr UpdateCH1 ; continue ahead
.noupdate
dec a ; subtract 1 from timer
ld [GlobalTimer],a ; store timer value
jp DoneUpdating ; done
; ================================================================
UpdateChannel: macro
IS_PULSE_CHANNEL equ (\1 == 1) || (\1 == 2)
IS_WAVE_CHANNEL equ \1 == 3
IS_NOISE_CHANNEL equ \1 == 4
ld a,[CH\1Enabled]
and a
jp z,CH\1Updated ; if channel is disabled, skip to next one
ld a,[CH\1Tick]
and a
jr z,.continue ; if channel tick = 0, then jump ahead
dec a ; otherwise...
ld [CH\1Tick],a ; decrement channel tick...
jp CH\1Updated ; ...and do echo buffer.
.continue
ld hl,CH\1Ptr ; get pointer
ld a,[hl+]
ld h,[hl]
ld l,a
CH\1_CheckByte:
ld a,[hl+] ; get byte
cp $ff ; if $ff...
jp z,.endChannel
cp $c9 ; if $c9...
jp z,.retSection
cp release ; if release
jp z,.release
cp ___ ; if null note...
jp z,.nullnote
cp echo ; if echo
jp z,.echo
bit 7,a ; if command...
jp nz,.getCommand
; if we have a note...
if !IS_NOISE_CHANNEL
ld b,a
xor a
ld [CH\1DoEcho],a
ld a,b
endc
.getNote
if IS_NOISE_CHANNEL
ld [CH\1ModeBackup],a
else
ld [CH\1NoteBackup],a ; set note
ld b,a
ld a,[CH\1NotePlayed]
and a
jr nz,.skipfill
ld a,b
call CH\1FillEchoBuffer
.skipfill
endc
ld a,[hl+] ; get note length
dec a ; subtract 1
ld [CH\1Tick],a ; set channel tick
ld a,l ; store back current pos
ld [CH\1Ptr],a
ld a,h
ld [CH\1Ptr+1],a
if !IS_NOISE_CHANNEL
ld a,[CH\1PortaType]
dec a ; if toneporta, don't reset everything
jr z,.noreset
endc
if !IS_WAVE_CHANNEL
if ((\1 == 2) || (\1 == 4)) && UseFXHammer
ld a,[FXHammer_SFXCH\1]
cp 3
jr z,.noupdate
endc
xor a
else
ld a, $FF
ld [CH\1Wave],a
ld a,[CH\1ComputedVol] ; Fix for volume not updating when unpausing
endc
ldh [rNR\12],a
.noupdate
xor a
if IS_NOISE_CHANNEL
ld [CH\1NoisePos],a
if !def(DisableDeflehacks)
ld [CH\1WavePos],a
endc
else
ld [CH\1ArpPos],a ; reset arp position
inc a
ld [CH\1VibPos],a ; reset vibrato position
ld hl,CH\1VibPtr
ld a,[hl+]
ld h,[hl]
ld l,a
ld a,[hl] ; get vibrato delay
ld [CH\1VibDelay],a ; set delay
endc
xor a
ld hl,CH\1Reset
if !IS_NOISE_CHANNEL
bit 0,[hl]
jr nz,.noreset_checkvol
if IS_PULSE_CHANNEL
ld [CH\1PulsePos],a
elif IS_WAVE_CHANNEL
ld [CH\1WavePos],a
endc
.noreset_checkvol
endc
bit 1,[hl]
jr nz,.noreset
ld [CH\1VolPos],a
if !IS_WAVE_CHANNEL
ld [CH\1VolLoop],a
endc
.noreset
ld a,[CH\1NoteCount]
inc a
ld [CH\1NoteCount],a
ld b,a
; check if instrument mode is 1 (alternating)
ld a,[CH\1InsMode]
and a
jr z,.noInstrumentChange
ld a,b
rra
jr nc,.notodd
ld a,[CH\1Ins1]
jr .odd
.notodd
ld a,[CH\1Ins2]
.odd
call CH\1_SetInstrument
.noInstrumentChange
if !IS_NOISE_CHANNEL
ld hl,CH\1Reset
set 7,[hl] ; signal the start of note for pitch bend
endc
jp CH\1Updated
.endChannel
xor a
ld [CH\1Enabled],a
jp CH\1Updated
.retSection
ld hl,CH\1RetPtr
ld a,[hl+]
ld [CH\1Ptr],a
ld a,[hl]
ld [CH\1Ptr+1],a
jp UpdateCH\1
.echo ; Not applicable to CH4
if !IS_NOISE_CHANNEL
ld b,a
ld a,1
ld [CH\1DoEcho],a
ld a,b
jp .getNote
endc
.nullnote
if !IS_NOISE_CHANNEL
xor a
ld [CH\1DoEcho],a
endc
ld a,[hl+]
dec a
ld [CH\1Tick],a ; set tick
ld a,l ; store back current pos
ld [CH\1Ptr],a
ld a,h
ld [CH\1Ptr+1],a
jp CH\1Updated
.release
; follows FamiTracker's behavior except only the volume table will be affected
if !IS_NOISE_CHANNEL
xor a
ld [CH\1DoEcho],a
endc
ld a,[hl+]
dec a
ld [CH\1Tick],a ; set tick
ld a,l ; store back current pos
ld [CH\1Ptr],a
ld a,h
ld [CH\1Ptr+1],a
ld hl,CH\1VolPtr
ld a,[hl+]
ld h,[hl]
ld l,a
ld b,0
.releaseloop
ld a,[hl+]
inc b
cp $ff
jr z,.norelease
cp $fe
jr nz,.releaseloop
ld a,b
inc a
ld [CH\1VolPos],a
.norelease
jp CH\1Updated
.getCommand
if !IS_NOISE_CHANNEL
ld b,a
xor a
ld [CH\1DoEcho],a
ld a,b
endc
cp DummyCommand
jp nc, CH\1_CheckByte
; Not needed because function performs "add a" which discards bit 7
; sub $80 ; subtract 128 from command value
call JumpTableBelow
dw .setInstrument
dw .setLoopPoint
dw .gotoLoopPoint
dw .callSection
dw .setChannelPtr
dw .pitchBendUp
dw .pitchBendDown
dw .setSweep
dw .setPan
dw .setSpeed
dw .setInsAlternate
if IS_WAVE_CHANNEL && !def(DemoSceneMode)
dw .randomizeWave
else
dw CH\1_CheckByte
endc
dw .combineWaves
dw .enablePWM
dw .enableRandomizer
if IS_WAVE_CHANNEL && !def(DemoSceneMode)
dw .disableAutoWave
else
dw CH\1_CheckByte
endc
dw .arp
dw .toneporta
dw .chanvol
dw .setSyncTick
dw .setEchoDelay
dw .setRepeatPoint
dw .repeatSection
dw .setMontyMode
.setInstrument
ld a,[hl+] ; get ID of instrument to switch to
push hl ; preserve HL
call CH\1_SetInstrument
pop hl ; restore HL
xor a
ld [CH\1InsMode],a ; reset instrument mode
jp CH\1_CheckByte
.setLoopPoint
ld a,l
ld [CH\1LoopPtr],a
ld a,h
ld [CH\1LoopPtr+1],a
jp CH\1_CheckByte
.gotoLoopPoint
ld hl,CH\1LoopPtr ; get loop pointer
ld a,[hl+]
ld [CH\1Ptr],a
ld a,[hl]
ld [CH\1Ptr+1],a
jp UpdateCH\1
.callSection
ld a,[hl+]
ld [CH\1Ptr],a
ld a,[hl+]
ld [CH\1Ptr+1],a
ld a,l
ld [CH\1RetPtr],a
ld a,h
ld [CH\1RetPtr+1],a
jp UpdateCH\1
.setChannelPtr
ld a,[hl+]
ld [CH\1Ptr],a
ld a,[hl]
ld [CH\1Ptr+1],a
jp UpdateCH\1
if !IS_NOISE_CHANNEL
.pitchBendUp
ld a,[hl+]
ld [CH\1PortaSpeed],a
and a
jr z,.loadPortaType
ld a,2
jr .loadPortaType
.pitchBendDown
ld a,[hl+]
ld [CH\1PortaSpeed],a
and a
jr z,.loadPortaType
ld a,3
jr .loadPortaType
.toneporta
ld a,[hl+]
ld [CH\1PortaSpeed],a
and a
jr z,.loadPortaType
ld a,1
.loadPortaType
ld [CH\1PortaType],a
jp CH\1_CheckByte
endc
if \1 == 1
.setSweep
ld a,[hl+]
ld [CH\1Sweep],a
jp CH\1_CheckByte
endc
.setPan
ld a,[hl+]
ld [CH\1Pan],a
jp CH\1_CheckByte
.setSpeed
ld a,[hl+]
dec a
ld [GlobalSpeed1],a
ld a,[hl+]
dec a
ld [GlobalSpeed2],a
jp CH\1_CheckByte
.setInsAlternate
ld a,[hl+]
ld [CH\1Ins1],a
ld a,[hl+]
ld [CH\1Ins2],a
ld a,1
ld [CH\1InsMode],a
jp CH\1_CheckByte
if IS_WAVE_CHANNEL && !def(DemoSceneMode)
.randomizeWave
push hl
call _RandomizeWave
pop hl
jp CH\1_CheckByte
.combineWaves
push bc
ld a,[hl+]
ld c,a
ld a,[hl+]
ld b,a
ld a,[hl+]
ld e,a
ld a,[hl+]
ld d,a
push hl
call _CombineWaves
pop hl
pop bc
jp CH\1_CheckByte
.enablePWM
push hl
call ClearWaveBuffer
pop hl
ld a,[hl+]
ld [PWMVol],a
ld a,[hl+]
ld [PWMSpeed],a
ld a,$ff
ld [WavePos],a
xor a
ld [PWMDir],a
ld [RandomizerEnabled],a
inc a
ld [PWMEnabled],a
ld [PWMTimer],a
jp CH\1_CheckByte
.enableRandomizer
push hl
call ClearWaveBuffer
pop hl
ld a,[hl+]
ld [RandomizerSpeed],a
xor a
ld [PWMEnabled],a
inc a
ld [RandomizerTimer],a
ld [RandomizerEnabled],a
jp CH\1_CheckByte
.disableAutoWave
xor a
ld [PWMEnabled],a
ld [RandomizerEnabled],a
jp CH\1_CheckByte
else
.combineWaves
inc hl
inc hl
.enablePWM
if IS_NOISE_CHANNEL
.arp
endc
inc hl
.enableRandomizer
endc
if IS_NOISE_CHANNEL
.pitchBendUp
.pitchBendDown
.toneporta
.setEchoDelay
endc
if \1 != 1
.setSweep
endc
inc hl
jp CH\1_CheckByte
.setSyncTick
ld a,[hl+]
ld [SyncTick],a
jp CH\1_CheckByte
.chanvol
ld a,[hl+]
and $f
ld [CH\1ChanVol],a
jp CH\1_CheckByte
if !IS_NOISE_CHANNEL
.arp
call DoArp
jp CH\1_CheckByte
.setEchoDelay
ld a,[hl+]
and $3f
ld [CH\1EchoDelay],a
jp CH\1_CheckByte
endc
.setRepeatPoint
ld a,l
ld [CH\1RepeatPtr],a
ld a,h
ld [CH\1RepeatPtr+1],a
jp CH\1_CheckByte
.repeatSection
ld a,[CH\1RepeatCount]
and a ; section currently repeating?
jr z,.notrepeating
dec a
ld [CH\1RepeatCount],a
and a
jr z,.stoprepeating
inc hl
jr .dorepeat
.notrepeating
ld a,[hl+]
dec a
ld [CH\1RepeatCount],a
ld a,1
ld [CH\1DoRepeat],a
.dorepeat
ld hl,CH\1RepeatPtr ; get loop pointer
ld a,[hl+]
ld [CH\1Ptr],a
ld a,[hl]
ld [CH\1Ptr+1],a
jp UpdateCH\1
.stoprepeating
xor a
ld [CH\1DoRepeat],a
.norepeat
inc hl
jp CH\1_CheckByte
.setMontyMode
ld a,[hl+]
and $7f ; upper bit is used as a flag
ld [CH\1MontyMode],a
ld [CH\1MontyTimer],a
jp CH\1_CheckByte
CH\1_SetInstrument:
ld hl,InstrumentTable
ld e,a
ld d,0
add hl,de
add hl,de
ld a,[hl+]
ld h,[hl]
ld l,a
; no reset flag
ld a,[hl+]
and 3
ld [CH\1Reset],a
ld b,a
; vol table
ld a,[hl+]
ld [CH\1VolPtr],a
ld a,[hl+]
ld [CH\1VolPtr+1],a
; arp table
ld a,[hl+]
if IS_NOISE_CHANNEL
ld [CH\1NoisePtr],a
else
ld [CH\1ArpPtr],a
endc
ld a,[hl+]
if IS_NOISE_CHANNEL
ld [CH\1NoisePtr+1],a
else
ld [CH\1ArpPtr+1],a
endc
if !IS_NOISE_CHANNEL || !def(DisableDeflehacks)
; pulse table
ld a,[hl+]
if IS_PULSE_CHANNEL
ld [CH\1PulsePtr],a
else
ld [CH\1WavePtr],a
endc
ld a,[hl+]
if IS_PULSE_CHANNEL
ld [CH\1PulsePtr+1],a
else
ld [CH\1WavePtr+1],a
endc
endc
if !IS_NOISE_CHANNEL
; vib table
ld a,[hl+]
ld [CH\1VibPtr],a
ld a,[hl+]
ld [CH\1VibPtr+1],a
ld hl,CH\1VibPtr
ld a,[hl+]
ld h,[hl]
ld l,a
ld a,[hl]
ld [CH\1VibDelay],a
endc
ret
CH\1Updated:
PURGE IS_PULSE_CHANNEL
PURGE IS_WAVE_CHANNEL
PURGE IS_NOISE_CHANNEL
endm
; ================================================================
UpdateCH1:
UpdateChannel 1
UpdateCH2:
UpdateChannel 2
UpdateCH3:
UpdateChannel 3
UpdateCH4:
UpdateChannel 4
; ================================================================
DoneUpdating:
call DoEchoBuffers
; update panning
ld a,[CH4Pan]
add a
ld b,a
ld a,[CH3Pan]
or b
add a
ld b,a
ld a,[CH2Pan]
or b
add a
ld b,a
ld a,[CH1Pan]
or b
ldh [rNR51],a
; update global volume + fade system
ld a,[FadeType]
ld b,a
and 3 ; Check if no fade
jr z,.updateVolume ; Update volume
bit 2,b ; Check if on first fade
jr z,.notfirstfade
res 2,b
ld a,b
ld [FadeType],a
dec a
dec a ; If fading in (value 2), volume is 0 ; otherwise, it's 7
jr z,.gotfirstfadevolume
ld a,7
.gotfirstfadevolume
ld [GlobalVolume],a
.notfirstfade
ld a,[FadeTimer]
and a
jr z,.doupdate
dec a
ld [FadeTimer],a
jr .updateVolume
.fadeout
ld a,[GlobalVolume]
and a
jr z,.fadeFinished
.decrementVolume
dec a
ld [GlobalVolume],a
jr .directlyUpdateVolume
.fadein
ld a,[GlobalVolume]
cp 7
jr z,.fadeFinished
inc a
ld [GlobalVolume],a
jr .directlyUpdateVolume
.doupdate
ld a,7
ld [FadeTimer],a
ld a,[FadeType]
and 3
dec a
jr z,.fadeout
dec a
jr z,.fadein
dec a
ld a,[GlobalVolume]
jr nz,.directlyUpdateVolume
.fadeoutstop
and a
jr nz,.decrementVolume
call DevSound_Stop
xor a
.fadeFinished
; a is zero
ld [FadeType],a
.updateVolume
ld a,[GlobalVolume]
.directlyUpdateVolume
and 7
ld b,a
swap a
or b
ldh [rNR50],a
; ================================================================
UpdateRegisters: macro
ld a,[CH\1Enabled]
and a
jp z,CH\1RegistersUpdated
if ((\1 == 2) || (\1 == 4)) && UseFXHammer
ld a,[FXHammer_SFXCH\1]
cp 3
jr z,.norest
endc
if \1 != 4
ld a,[CH\1NoteBackup]
ld [CH\1Note],a
else
ld a,[CH\1ModeBackup]
ld [CH\1Mode],a
endc
cp rest
jr nz,.norest
ld a,[CH\1IsResting]
and a
jp nz,.done
xor a
ldh [rNR\12],a
if \1 == 3
ld [CH\1Vol],a
ld [CH\1ComputedVol],a
elif def(Visualizer)
ld [CH\1OutputLevel],a
ld [CH\1TempEnvelope],a
endc
ldh a,[rNR\14]
or %10000000
ldh [rNR\14],a
ld a,1
ld [CH\1IsResting],a
jp .done
.norest
xor a
ld [CH\1IsResting],a
; update arps
.updatearp
; Deflemask compatibility: if pitch bend is active, don't update arp and force the transpose of 0
if \1 != 4 && !def(DisableDeflehacks)
ld a,[CH\1PortaType]
and a
jr z,.noskiparp
xor a
ld [CH\1Transpose],a
jr .continue
endc
.noskiparp
if \1 != 4
ld hl,CH\1ArpPtr
else
ld hl,CH\1NoisePtr
endc
ld a,[hl+]
ld h,[hl]
ld l,a
if \1 != 4
ld a,[CH\1ArpPos]
else
ld a,[CH\1NoisePos]
endc
add l
ld l,a
jr nc,.nocarry
inc h
.nocarry
ld a,[hl+]
cp $fe
jr nz,.noloop
ld a,[hl]
if \1 != 4
ld [CH\1ArpPos],a
else
ld [CH\1NoisePos],a
endc
jr .updatearp
.noloop
cp $ff
jr z,.continue
cp $80
jr nc,.absolute
sla a
sra a
jr .donearp
.absolute
and $7f
if \1 != 4
ld [CH\1Note],a
else
ld [CH\1Mode],a
endc
xor a
.donearp
ld [CH\1Transpose],a
.noreset
if \1 != 4
ld hl,CH\1ArpPos
else
ld hl,CH\1NoisePos
endc
inc [hl]
.continue
if \1 == 1
; update sweep
ld a,[CH\1Sweep]
ldh [rNR\10],a
elif \1 == 3
ld a,$80
ldh [rNR\10],a
endc
if \1 == 4
if !def(DisableDeflehacks)
ld hl,CH\1WavePtr
ld a,[hl+]
ld h,[hl]
ld l,a
ld a,[CH\1WavePos]
add l
ld l,a
jr nc,.nocarry3
inc h
.nocarry3
ld a,[hl+]
cp $ff
jr z,.updateNote
ld [CH\1Wave],a
ld a,[CH\1WavePos]
inc a
ld [CH\1WavePos],a
ld a,[hl+]
cp $fe
jr nz,.updateNote
ld a,[hl]
ld [CH\1WavePos],a
endc
elif \1 != 3
; update pulse
ld hl,CH\1PulsePtr
ld a,[hl+]
ld h,[hl]
ld l,a
ld a,[CH\1PulsePos]
add l
ld l,a
jr nc,.nocarry2
inc h
.nocarry2
ld a,[hl+]
cp $ff
jr z,.updateNote
; convert pulse value
and 3 ; make sure value does not exceed 3
if def(Visualizer)
ld [CH\1Pulse],a
endc
rrca ; rotate right
rrca ; "" ""
if (\1 == 2) && UseFXHammer
ld e,a
ld a,[FXHammer_SFXCH\1]
cp 3
jr z,.noreset2
ld a,e
endc
ldh [rNR\11],a ; transfer to register
.noreset2
ld a,[CH\1PulsePos]
inc a
ld [CH\1PulsePos],a
ld a,[hl+]
cp $fe
jr nz,.updateNote
ld a,[hl]
ld [CH\1PulsePos],a
endc
; get note
.updateNote
if \1 != 4
ld a,[CH\1DoEcho]
and a
jr z,.skipecho
ld a,[CH\1EchoDelay]
ld b,a
ld a,[EchoPos]
sub b
and $3f
ld hl,CH\1EchoBuffer
add l
ld l,a
jr nc,.nocarry3
inc h
.nocarry3
ld a,[hl]
cp $4a
jr nz,.getfrequency
; TODO: Prevent null byte from being played
jr .getfrequency
.skipecho
ld a,[CH\1PortaType]
cp 2
jr c,.skippitchbend
ld a,[CH\1Reset]
bit 7,a
jr z,.pitchbend
.skippitchbend
if \1 == 1
ld a,[CH\1Sweep]
and $70
jr z,.noskipsweep
ld a,[CH\1Reset]
bit 7,a
jp z,.updateVolume
.noskipsweep
endc
ld a,[CH\1Transpose]
ld b,a
ld a,[CH\1Note]
add b
.getfrequency
ld c,a
ld b,0
ld hl,FreqTable
add hl,bc
add hl,bc
ld a,[hl+]
ld e,a
ld [CH\1MontyFreq],a
ld a,[hl]
ld d,a
ld [CH\1MontyFreq+1],a
ld a,[CH\1PortaType]
cp 2
jr c,.updateVibTable
ld a,e
ld [CH\1TempFreq],a
ld a,d
ld [CH\1TempFreq+1],a
.updateVibTable
ld a,[CH\1VibDelay]
and a
jr z,.doVib
dec a
ld [CH\1VibDelay],a
jr .setFreq
.doVib
ld hl,CH\1VibPtr
ld a,[hl+]
ld h,[hl]
ld l,a
ld a,[CH\1VibPos]
add l
ld l,a
jr nc,.nocarry4
inc h
.nocarry4
ld a,[hl+]
cp $80
jr nz,.noloop2
ld a,[hl+]
ld [CH\1VibPos],a
jr .doVib
.noloop2
ld [CH\1FreqOffset],a
ld a,[CH\1VibPos]
inc a
ld [CH\1VibPos],a
jr .getPitchOffset
.pitchbend
ld a,[CH\1PortaSpeed]
ld b,a
ld a,[CH\1PortaType]
and 1
jr nz,.sub2
ld a,[CH\1TempFreq]
add b
ld e,a
ld a,[CH\1TempFreq+1]
jr nc,.nocarry6
inc a
.nocarry6
ld d,a
cp 8
jr c,.pitchbenddone
ld de,$7ff
jr .pitchbenddone
.sub2
ld a,[CH\1TempFreq]
sub b
ld e,a
ld a,[CH\1TempFreq+1]
jr nc,.nocarry7
dec a
.nocarry7
ld d,a
cp 8
jr c,.pitchbenddone
ld de,0
.pitchbenddone
ld hl,CH\1TempFreq
ld a,e
ld [hl+],a
ld [hl],d
.getPitchOffset
ld a,[CH\1FreqOffset]
bit 7,a
jr nz,.sub
add e
ld e,a
jr nc,.setFreq
inc d
jr .setFreq
.sub
ld c,a
ld a,e
add c
ld e,a
.setFreq
ld a,[CH\1MontyMode]
and a ; is Monty mode on?
jr z,.nomonty ; if not, skip
ld a,[CH\1MontyTimer]
dec a
jr nz,.montyset
ld a,[CH\1MontyMode]
and $7f ; strip monty flag
ld [CH\1MontyTimer],a
jr .montycontinue
.montyset:
ld [CH\1MontyTimer],a
ld a,[CH\1MontyMode]
jr .montycheck
.montycontinue
ld a,[CH\1MontyMode]
xor %10000000 ; flip monty flag
ld [CH\1MontyMode],a
.montycheck
bit 7,a ; is flag set?
jr nz,.nomonty
ld hl,CH\1MontyFreq ; use base pitch
ld a,[hl+]
ld d,[hl]
ld e,a
; TODO: Work out vibrato
jr .donesetFreq
.nomonty
ld hl,CH\1TempFreq ; use calculated pitch
.dogetpitchoffset
ld a,[CH\1PortaType]
and a
jr z,.normal
dec a
ld a,e
jr nz,.donesetFreq
; toneporta
ld a,[hl+]
ld h,[hl]
ld l,a
ld a,[CH\1PortaSpeed]
ld c,a
ld b,0
ld a,h
cp d
jr c,.lt
jr nz,.gt
ld a,l
cp e
jr z,.tonepordone
jr c,.lt
.gt
ld a,l
sub c
ld l,a
jr nc,.nocarry8
dec h
.nocarry8
ld a,h
cp d
jr c,.clamp
jr nz,.tonepordone
ld a,l
cp e
jr c,.clamp
jr .tonepordone
.lt
add hl,bc
ld a,h
cp d
jr c,.tonepordone
jr nz,.clamp
ld a,l
cp e
jr c,.tonepordone
.clamp
ld h,d
ld l,e
.tonepordone
ld a,l
ld [CH\1TempFreq],a
if def(Visualizer)
ld [CH\1ComputedFreq],a
endc
if \1 != 2 || !UseFXHammer
ldh [rNR\13],a
endc
ld a,h
ld d,a ; for later restart uses
ld [CH\1TempFreq+1],a
if def(Visualizer)
ld [CH\1ComputedFreq+1],a
endc
if \1 != 2 || !UseFXHammer
ldh [rNR\14],a
elif UseFXHammer
ld a,[FXHammer_SFXCH\1]
cp 3
jr z,.updateVolume
ld a,l
ldh [rNR\13],a
ld a,h
ldh [rNR\14],a
endc
jr .updateVolume
.normal
ld a,e
ld [hl+],a
ld [hl],d
.donesetFreq
if \1 == 2 && UseFXHammer
ld a,[FXHammer_SFXCH\1]
cp 3
ld a,e
jr z,.updateVolume
endc
if def(Visualizer)
ld [CH\1ComputedFreq],a
endc
ldh [rNR\13],a
ld a,d
if def(Visualizer)
ld [CH\1ComputedFreq+1],a
endc
ldh [rNR\14],a
else
; don't do per noise mode arp clamping if deflemask compatibility mode
; is disabled so that relative arp with noise mode change is possible
ld a,[CH\1Mode]
CLAMP_VALUE = 90
if !def(DisableDeflehacks)
CLAMP_VALUE = 45
cp CLAMP_VALUE
ld c,0
jr c,.noise15_2
sub CLAMP_VALUE
inc c
.noise15_2
endc
ld b,a
ld a,[CH\1Transpose]
bit 7,a
jr nz,.minus
if !def(DisableDeflehacks)
cp CLAMP_VALUE
jr c,.noise15_3
sub CLAMP_VALUE
ld c,1
.noise15_3
endc
add b
cp CLAMP_VALUE
jr c,.noclamp
ld a,CLAMP_VALUE - 1
jr .noclamp
.minus
add b
cp CLAMP_VALUE
jr c,.noclamp
xor a
.noclamp
if !def(DisableDeflehacks)
ld b,a
ld a,[CH\1Wave]
or c
and a
jr z,.noise15
ld a,CLAMP_VALUE
.noise15
add b
endc
if def(Visualizer)
ld [CH\1Noise],a
endc
ld hl,NoiseTable
add l
ld l,a
jr nc,.nocarry2
inc h
.nocarry2
if UseFXHammer
ld a,[FXHammer_SFXCH\1]
cp 3
jr z,.updateVolume
endc
ld a,[hl+]
ldh [rNR\13],a
endc
; update volume
.updateVolume
ld hl,CH\1Reset
res 7,[hl]
ld hl,CH\1VolPtr
ld a,[hl+]
ld h,[hl]
ld l,a
if \1 != 3
ld a,[CH\1VolLoop]
inc a ; ended
jp z,.done
endc
ld a,[CH\1VolPos]
add l
ld l,a
jr nc,.nocarry5
inc h
.nocarry5
ld a,[hl+]
cp $ff
jr z,.loadlast
cp $fd
jp z,.done
ld b,a
if !def(DemoSceneMode)
if !def(DisableZombieMode) || (\1 == 3)
ld a,[CH\1ChanVol]
push hl
call MultiplyVolume
pop hl
endc
if !def(DisableZombieMode) && (\1 != 3)
ld a,[CH\1VolLoop]
dec a
jr z,.zombieatpos0
ld a,[CH\1VolPos]
and a
jr z,.zombinit
.zombieatpos0
endc
endc
ld a,[CH\1Vol]
sub b
jr z,.noreset3
if \1 != 3
if !def(DemoSceneMode) && !def(DisableZombieMode)
or ~$0f
ld c,a
ld a,b
ld [CH\1Vol],a
if def(Visualizer)
ld [CH\1OutputLevel],a
endc
ld a,8
.zombloop
ldh [rNR\12],a
inc c
jr nz,.zombloop
jr .noreset3
.zombinit
endc
ld a,b
ld [CH\1Vol],a
if def(Visualizer)
ld [CH\1OutputLevel],a
endc
swap a
or 8
ldh [rNR\12],a
if def(Visualizer) && (\1 != 3)
xor a
ld [CH\1TempEnvelope],a
endc
ld a,d
or $80
ldh [rNR\14],a
.noreset3
else
ld a,b
ld [CH\1Vol],a
if def(DemoSceneMode) || def(NoWaveVolumeScaling)
and a
jr z,.skip
cp 8
ld b,%00100000
jr nc,.skip
cp 4
ld b,%01000000
jr nc,.skip
ld b,%01100000
.skip
ld a,[CH\1ComputedVol]
cp b
jr z,.noreset3
ld a,b
ld [CH\1ComputedVol],a
ld [rNR\12],a
ld a,d
or $80
ldh [rNR\14],a
.noreset3
else
ld a,1
.noreset3
ld [WaveBufUpdateFlag],a
endc
endc
ld a,[CH\1VolPos]
inc a
ld [CH\1VolPos],a
ld a,[hl+]
cp $fe
jr nz,.done
ld a,[hl]
ld [CH\1VolPos],a
if \1 != 3
if !def(DemoSceneMode) && !def(DisableZombieMode)
ld a,1
ld [CH\1VolLoop],a
endc
jr .done
.loadlast
ld a,[hl]
if !def(DemoSceneMode) && !def(DisableZombieMode)
push af
swap a
and $f
ld b,a
ld a,[CH\1ChanVol]
call MultiplyVolume
swap b
pop af
and $f
or b
endc
ldh [rNR\12],a
if def(Visualizer)
ld b,a
and $f
ld [CH\1TempEnvelope],a
and $7
inc a
ld [CH\1EnvelopeCounter],a
ld a,b
swap a
and $f
ld [CH\1OutputLevel],a
endc
ld a,d
or $80
ldh [rNR\14],a
ld a,$ff
ld [CH\1VolLoop],a
else
.loadlast
endc
.done
if \1 == 3
; Update wave
ld hl,CH\1WavePtr
ld a,[hl+]
ld h,[hl]
ld l,a
ld a,[CH\1WavePos]
add l
ld l,a
jr nc,.nocarry2
inc h
.nocarry2
ld a,[hl+]
cp $ff ; table end?
jr z,.updatebuffer
ld b,a
ld a,[CH\1Wave]
cp b
if def(DemoSceneMode) || def(NoWaveVolumeScaling)
jr z,.noreset2
ld a,b
ld [CH\1Wave],a
cp $c0
push hl
if def(DemoSceneMode)
jr z,.noreset2 ; if value = $c0, ignore (since this feature is disabled in DemoSceneMode)
else
ld hl,WaveBuffer
jr z,.wavebuf
endc
ld c,b
ld b,0
ld hl,WaveTable
add hl,bc
add hl,bc
ld a,[hl+]
ld h,[hl]
ld l,a
.wavebuf
call LoadWave
pop hl
ld a,d
or %10000000
ldh [rNR\34],a
.noreset2
else
ld c,0
jr z,.noreset2
ld a,b
ld [CH\1Wave],a
ld c,1
.noreset2
ld a,[WaveBufUpdateFlag]
or c
ld [WaveBufUpdateFlag],a
endc
ld a,[CH\1WavePos]
inc a
ld [CH\1WavePos],a
ld a,[hl+]
cp $fe
jr nz,.updatebuffer
ld a,[hl]
ld [CH\1WavePos],a
.updatebuffer
if !def(DemoSceneMode)
call DoPWM
call DoRandomizer
if !def(NoWaveVolumeScaling)
ld a,[WaveBufUpdateFlag]
and a
jp z,.noupdate
ld a,[CH\1Wave]
cp $c0 ; if value = $c0, use wave buffer
jr nz,.notwavebuf
ld bc,WaveBuffer
jr .multiplyvolume
.notwavebuf
ld c,a
ld b,0
ld hl,WaveTable
add hl,bc
add hl,bc
ld a,[hl+]
ld b,[hl]
ld c,a
.multiplyvolume
if def(Visualizer)
push bc
ld hl,VisualizerTempWave
ld e,16
.visuwavecopyloop
ld a,[bc]
inc bc
cpl
ld [hl+],a
dec e
jr nz,.visuwavecopyloop
pop bc
endc
ld a,[CH\1Vol]
and a
jr z,.mute
cp 8
ld e,%00100000
jr nc,.skip
add a
inc a
cp 8
ld e,%01000000
jr nc,.skip
add a
inc a
ld e,%01100000
.skip
push de
srl a
push af
ld l, a
ld h, 0
add hl, hl ; x2
add hl, hl ; x4
add hl, hl ; x8
add hl, hl ; x16
ld de, VolumeTable
add hl, de
ld d,h
ld e,l
pop af
ld a,16
ld hl,ComputedWaveBuffer
jr nc,.multnormal
.multswapped
push af
ld a,[bc]
call MultiplyVolume_
swap a
and $f
ld [hl],a
ld a,[bc]
inc bc
swap a
call MultiplyVolume_
and $f0
or [hl]
ld [hl+],a
pop af
dec a
jr nz,.multswapped
jr .multdone
.multnormal
push af
ld a,[bc]
call MultiplyVolume_
and $f
ld [hl],a
ld a,[bc]
inc bc
swap a
call MultiplyVolume_
and $f
swap a
or [hl]
ld [hl+],a
pop af
dec a
jr nz,.multnormal
.multdone
pop de
ld a,e
.mute
ld [CH\1ComputedVol],a
ld [rNR\12],a
and a
call nz,LoadWave
xor a
ld [WaveBufUpdateFlag],a
ld a,d
or $80
ldh [rNR\14],a
.noupdate
endc
endc
endc
CH\1RegistersUpdated:
endm
CH1_UpdateRegisters:
UpdateRegisters 1
CH2_UpdateRegisters:
UpdateRegisters 2
CH3_UpdateRegisters:
UpdateRegisters 3
CH4_UpdateRegisters:
UpdateRegisters 4
DoneUpdatingRegisters:
pop hl
pop de
pop bc
pop af
ret
; ================================================================
; Wave routines
; ================================================================
LoadWave:
if !def(DemoSceneMode) && !def(NoWaveVolumeScaling)
ld hl,ComputedWaveBuffer
elif def(Visualizer)
push hl
ld bc,VisualizerTempWave
ld e,16
.visuwavecopyloop
ld a,[hl+]
cpl
ld [bc],a
inc bc
dec e
jr nz,.visuwavecopyloop
pop hl
endc
ldh a,[rNR51]
ld c,a
and %10111011 ; Remove CH3 from final mixing while it's disabled
ldh [rNR51],a ; prevents spike on GBA
xor a
ldh [rNR30],a ; disable CH3
CUR_WAVE = _AUD3WAVERAM
rept 16
ld a, [hl+] ; get byte from hl
ldh [CUR_WAVE], a ; copy to wave ram
CUR_WAVE = CUR_WAVE + 1
endr
PURGE CUR_WAVE
ld a,%10000000
ldh [rNR30],a ; enable CH3
ld a,c
ldh [rNR51],a
ret
ClearWaveBuffer:
ld b,$20 ; spill to WaveBuffer too
xor a
ld hl,ComputedWaveBuffer
.loop
ld [hl+],a
dec b
jr nz,.loop
ret
if !def(DemoSceneMode)
; Combine two waves.
; INPUT: bc = first wave address
; de = second wave address
_CombineWaves:
ld hl,WaveBuffer
.loop
push hl
ld a,[bc]
and $f
ld l,a
ld a,[de]
and $f
add l
rra
ld l,a
ld a,[bc]
inc bc
and $f0
ld h,a
ld a,[de]
inc de
and $f0
add h
rra
and $f0
or l
pop hl
ld [hl+],a
ld a,l
cp LOW(WaveBuffer+16)
jr nz, .loop
ld a,[WaveBufUpdateFlag]
or 1
ld [WaveBufUpdateFlag],a
ret
DoRandomizer:
ld a,[RandomizerEnabled]
and a
ret z ; if randomizer is disabled, return
ld a,[RandomizerTimer]
dec a
ld [RandomizerTimer],a
ret nz
ld a,[RandomizerSpeed]
ld [RandomizerTimer],a
; Fall through
; Randomize the wave buffer
_RandomizeWave:
push de
ld hl,NoiseData
ld de,WaveBuffer
ld b,$10
ld a,[WavePos]
inc a
ld [WavePos],a
add l
ld l,a
jr nc,.nocarry
inc h
.nocarry
ld a,[hl+]
ld hl,NoiseData
add l
ld l,a
jr nc,.loop
inc h
.loop
ld a,[hl+]
ld [de],a
inc de
dec b
jr nz,.loop
ld a,[WaveBufUpdateFlag]
or 1
ld [WaveBufUpdateFlag],a
pop de
ret
; Do PWM
DoPWM:
ld a,[PWMEnabled]
and a
ret z ; if PWM is not enabled, return
ld a,[PWMTimer]
dec a
ld [PWMTimer],a
ret nz
ld a,[PWMSpeed]
ld [PWMTimer],a
ld a,[PWMDir]
and a
ld a,[WavePos]
jr nz,.decPos
.incPos
inc a
ld [WavePos],a
cp $1e
jr nz,.continue
ld a,[PWMDir]
xor 1
ld [PWMDir],a
jr .continue
.decPos
dec a
ld [WavePos],a
jr nz,.continue2
ld a,[PWMDir]
xor 1
ld [PWMDir],a
jr .continue2
.continue
ld hl,WaveBuffer
ld a,[WavePos]
rra
push af
and $f
add l
ld l,a
jr nc,.nocarry
inc h
.nocarry
pop af
jr nc,.even
.odd
ld a,[hl]
ld b,a
ld a,[PWMVol]
or b
jr .done
.continue2
ld hl,WaveBuffer
ld a,[WavePos]
inc a
rra
push af
and $f
add l
ld l,a
jr nc,.nocarry2
inc h
.nocarry2
pop af
jr nc,.odd2
.even
ld a,[PWMVol]
swap a
jr .done
.odd2
xor a
.done
ld [hl],a
ld a,[WaveBufUpdateFlag]
or 1
ld [WaveBufUpdateFlag],a
ret
endc
; ================================================================
; Echo buffer routines
; ================================================================
DoEchoBuffers:
.ch1
ld hl,CH1EchoBuffer
ld a,[EchoPos]
add l
ld l,a
jr nc,.nocarry
inc h
.nocarry
ld a,[CH1Note]
ld b,a
cp echo
jr nz,.continue1
ld a,___
jr .skiptranspose
.continue1
ld a,[CH1Transpose]
add b
ld b,a
.skiptranspose
ld [hl],a
.ch2
ld hl,CH2EchoBuffer
ld a,[EchoPos]
add l
ld l,a
jr nc,.nocarry2
inc h
.nocarry2
ld a,[CH2Note]
ld b,a
cp echo
jr nz,.continue2
ld a,___
jr .skiptranspose2
.continue2
ld a,[CH2Transpose]
add b
ld b,a
.skiptranspose2
ld [hl],a
.ch3
ld hl,CH3EchoBuffer
ld a,[EchoPos]
add l
ld l,a
jr nc,.nocarry3
inc h
.nocarry3
ld a,[CH3Note]
ld b,a
cp echo
jr nz,.continue3
ld a,___
jr .skiptranspose3
.continue3
ld a,[CH3Transpose]
add b
ld b,a
.skiptranspose3
ld [hl],a
ld a,[EchoPos]
inc a
and $3f
ld [EchoPos],a
ret
ClearEchoBuffers:
ld hl,CH1EchoBuffer
ld b,(EchoPos-1)-CH1EchoBuffer
xor a
.loop
ld [hl+],a
dec b
jr nz,.loop
ld [EchoPos],a
ld [CH1EchoDelay],a
ld [CH2EchoDelay],a
ld [CH3EchoDelay],a
ld [CH1NotePlayed],a
ld [CH2NotePlayed],a
ld [CH3NotePlayed],a
ret
; INPUT: a = note
CH1FillEchoBuffer:
push hl
ld b,a
ld a,1
ld [CH1NotePlayed],a
ld a,b
ld hl,CH1EchoBuffer
jr DoFillEchoBuffer
CH2FillEchoBuffer:
push hl
ld b,a
ld a,1
ld [CH2NotePlayed],a
ld a,b
ld hl,CH2EchoBuffer
jr DoFillEchoBuffer
CH3FillEchoBuffer:
push hl
ld b,a
ld a,1
ld [CH3NotePlayed],a
ld a,b
ld hl,CH3EchoBuffer
; fall through to DoFillEchoBuffer
DoFillEchoBuffer:
ld b,64
.loop
ld [hl+],a
dec b
jr nz,.loop
pop hl
ret
; ================================================================
; Misc routines
; ================================================================
JumpTableBelow:
; since the return pointer is now at the start of table,
; we can manipulate it to return to the address in the table instead
pop bc
push hl
add a ; It is recommended to use this to keep optimizations on the four channel's jumptables
add c
ld l,a
jr nc,.nocarry
inc b
.nocarry
ld h,b
ld a,[hl+]
ld b,[hl]
ld c,a
pop hl
push bc
ret
ClearArpBuffer:
ld hl,arp_Buffer
ld [hl],$ff
inc hl
ld b,7
xor a
.loop
ld [hl+],a
dec b
jr nz,.loop
ret
DoArp:
ld de,arp_Buffer
xor a
ld [de], a
inc de
ld a,[hl+]
and a
jr nz,.slow
.fast
ld a,[hl]
swap a
and $f
ld [de],a
inc de
ld a,[hl+]
and $f
jr .continue
.slow
xor a
ld [de],a
inc de
ld a,[hl]
swap a
and $f
ld [de],a
inc de
ld [de],a
inc de
ld a,[hl+]
and $f
ld [de],a
inc de
.continue
ld [de],a
inc de
ld a,$fe
ld [de],a
inc de
xor a
ld [de],a
ret
if !def(DemoSceneMode)
MultiplyVolume:
srl b
push af
ld l,b
ld h,0
add hl,hl ; x2
add hl,hl ; x4
add hl,hl ; x8
add hl,hl ; x16
ld bc,VolumeTable
add hl,bc
ld c,a
ld b,0
add hl,bc
pop af
ld a,[hl]
jr nc,.noswap
swap a
.noswap
and $f
ld b,a
ret
MultiplyVolume_:
; short version of MultiplyVolume for ch3 wave update
push de
and $f
add e
ld e,a
jr nc,.nocarry
inc d
.nocarry
ld a,[de]
pop de
ret
endc
; ================================================================
; Frequency table
; ================================================================
FreqTable:
; C-x C#x D-x D#x E-x F-x F#x G-x G#x A-x A#x B-x
dw $02c,$09c,$106,$16b,$1c9,$223,$277,$2c6,$312,$356,$39b,$3da ; octave 1
dw $416,$44e,$483,$4b5,$4e5,$511,$53b,$563,$589,$5ac,$5ce,$5ed ; octave 2
dw $60a,$627,$642,$65b,$672,$689,$69e,$6b2,$6c4,$6d6,$6e7,$6f7 ; octave 3
dw $706,$714,$721,$72d,$739,$744,$74f,$759,$762,$76b,$773,$77b ; octave 4
dw $783,$78a,$790,$797,$79d,$7a2,$7a7,$7ac,$7b1,$7b6,$7ba,$7be ; octave 5
dw $7c1,$7c4,$7c8,$7cb,$7ce,$7d1,$7d4,$7d6,$7d9,$7db,$7dd,$7df ; octave 6
dw $7e1,$7e3,$7e4,$7e6,$7e7,$7e9,$7ea,$7eb,$7ec,$7ed,$7ee,$7ef ; octave 7 (not used directly, is slightly out of tune)
NoiseTable: ; taken from deflemask
db $a4 ; 15 steps
db $97,$96,$95,$94,$87,$86,$85,$84,$77,$76,$75,$74,$67,$66,$65,$64
db $57,$56,$55,$54,$47,$46,$45,$44,$37,$36,$35,$34,$27,$26,$25,$24
db $17,$16,$15,$14,$07,$06,$05,$04,$03,$02,$01,$00
db $ac ; 7 steps
db $9f,$9e,$9d,$9c,$8f,$8e,$8d,$8c,$7f,$7e,$7d,$7c,$6f,$6e,$6d,$6c
db $5f,$5e,$5d,$5c,$4f,$4e,$4d,$4c,$3f,$3e,$3d,$3c,$2f,$2e,$2d,$2c
db $1f,$1e,$1d,$1c,$0f,$0e,$0d,$0c,$0b,$0a,$09,$08
if !def(DemoSceneMode)
VolumeTable: ; used for volume multiplication
db $00,$00,$00,$00,$00,$00,$00,$00 ; 10
db $10,$10,$10,$10,$10,$10,$10,$10
db $00,$00,$00,$00,$10,$11,$11,$11 ; 32
db $21,$21,$21,$22,$32,$32,$32,$32
db $00,$00,$10,$11,$11,$21,$22,$22 ; 54
db $32,$32,$33,$43,$43,$44,$54,$54
db $00,$00,$11,$11,$22,$22,$32,$33 ; 76
db $43,$44,$54,$54,$65,$65,$76,$76
db $00,$00,$11,$21,$22,$33,$43,$44 ; 98
db $54,$55,$65,$76,$77,$87,$98,$98
db $00,$11,$11,$22,$33,$43,$44,$55 ; ba
db $65,$76,$77,$87,$98,$a9,$a9,$ba
db $00,$11,$22,$33,$43,$44,$55,$66 ; dc
db $76,$87,$98,$99,$a9,$ba,$cb,$dc
db $00,$11,$22,$33,$44,$55,$66,$77 ; fe
db $87,$98,$a9,$ba,$cb,$dc,$ed,$fe
endc
; ================================================================
; misc stuff
; ================================================================
DefaultRegTable:
; global flags
db 0,7,0,0,0,0,0,1,1,1,1,1,0,0,0,0
; ch1
dw DummyTable,DummyTable,DummyTable,DummyTable,DummyTable
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; ch2
dw DummyTable,DummyTable,DummyTable,DummyTable,DummyTable
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; ch3
dw DummyTable,DummyTable,DummyTable,DummyTable,DummyTable
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; ch4
if def(DisableDeflehacks)
dw DummyTable,DummyTable,DummyTable
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
else
dw DummyTable,DummyTable,DummyTable,DummyTable
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
endc
DefaultWave: db $01,$23,$45,$67,$89,$ab,$cd,$ef,$fe,$dc,$ba,$98,$76,$54,$32,$10
NoiseData: incbin "NoiseData.bin"
; ================================================================
; Dummy data
; ================================================================
DummyTable: db $ff,0
vib_Dummy: db 0,0,$80,1
DummyChannel:
db EndChannel
; ================================================================
; Song data
; ================================================================
if !def(DontIncludeSongData)
include "DevSound_SongData.asm"
endc
| 17.351679 | 120 | 0.602575 |
4ecda70cdca2720d5948196fa281f2e3e3fa16f8 | 721 | asm | Assembly | bank-offset.asm | SvenMichaelKlose/libultimem | 6fbbff4b6abfa8da0c4177793d2df0caa44dc229 | [
"MIT"
] | null | null | null | bank-offset.asm | SvenMichaelKlose/libultimem | 6fbbff4b6abfa8da0c4177793d2df0caa44dc229 | [
"MIT"
] | null | null | null | bank-offset.asm | SvenMichaelKlose/libultimem | 6fbbff4b6abfa8da0c4177793d2df0caa44dc229 | [
"MIT"
] | null | null | null | .export ultimem_offset2bank
.export ultimem_bank2offset
.importzp s, d, c, tmp
.code
; Set bank register at $9ff0+Y to match the long offset at
; zero page address X.
.proc ultimem_offset2bank
lda 1,x
lsr
lsr
lsr
lsr
lsr
sta $9ff0,y
lda 2,x
asl
asl
asl
ora $9ff0,y
sta $9ff0,y
lda 2,x
lsr
lsr
lsr
lsr
lsr
sta $9ff1,y
lda 0,x
sta s
lda 1,x
and #%00011111
sta s+1
ldy #0
rts
.endproc
; Write long offset of bank index in A to zero page address X.
.proc ultimem_bank2offset
ldy #0
sty 0,x
sty 1,x
sty 2,x
sty 3,x
ldy #5
l1: asl
rol 2,x
dey
bne l1
sta 1,x
rts
.endproc
| 13.109091 | 62 | 0.571429 |
f5803d1cc61f2f2af844e3ba916809188a710676 | 3,225 | asm | Assembly | boot/src/stage1.asm | aryan-gupta/OS_2 | 50f7deb573fa50fead42bb748a8ff4743701cc67 | [
"MIT"
] | null | null | null | boot/src/stage1.asm | aryan-gupta/OS_2 | 50f7deb573fa50fead42bb748a8ff4743701cc67 | [
"MIT"
] | null | null | null | boot/src/stage1.asm | aryan-gupta/OS_2 | 50f7deb573fa50fead42bb748a8ff4743701cc67 | [
"MIT"
] | null | null | null |
[bits 16]
jmp short stage1_start ; FAT32 needs 3 bytes of code before any declarations
nop
; FAT32 boot sector https://technet.microsoft.com/en-us/library/cc976796.aspx
; nice read: http://board.flatassembler.net/topic.php?p=124387
; http://www.dewassoc.com/kbase/hard_drives/boot_sector.htm
OEM_Identifier db 'OS_2 0.0' ; need 8 bytes for OEM Identifier
BytesPerSector dw 0x200 ; number of bytes per sector -- 512 bytes, its a default
SectorsPerCluster db 0x8 ; number of sectors per cluster -- 8 sectors is one cluster (files are in 512B * 8 chunks)
ReservedSectors dw 0x20 ; number of erserved sectors -- always 0x2 on FAT32
NumberOfFATs db 0x2 ; number of File Allocator Tables
RootEntries dw 0x0 ; this is always 0 on FAT32
NumberOfSectors dw 0x0 ; Refer to BigNumberOfSectors
MediaDescriptor db 0xF8 ; we are on a hard drive
SectorsPerFAT dw 0x0 ; only used on FAT 12/16 so we set it to 0
SectorsPerTrack dw 0x3D ;
SectorsPerHead dw 0x2 ;
HiddenSectors dd 0x0 ; We eont have any hidden sectors right now
BigNumberOfSectors dd 0xFE3B1F ;
BigSectorsPerFAT dd 0x778
ExtFlags dw 0x0
FSVersion dw 0x0 ; File system version, always 0
RootDirectoryStart dd 0x2 ; Where the root directory starts
FSInfoSector dw 0x1 ;
BackupBootSector dw 0x6
times 12 db 0 ; 12 bytes are reserved
DriveNumber db 0x80
Reserved db 0x0
Signature db 0x29
VolumeID dd 0xA88B3652
VolumeLabel db "OS_2 BT LDR"
SystemID db "FAT32 "
; if we ever do ntfs then this is also a good read http://www.ntfs.com
stage1_start:
nop
; check for bios extensions
mov ah, 0x41
mov bx, 0x55AA ; reverse the bits so we are sure its not garbage
int 13h
jc boot_error
cmp bx, 0AA55h
jne boot_error
; if we get to this part then we can use LBA or Linear Block Adressing
; So first calculate where the data section of FAT32 starts -- calculate where the data on FAT32 starts
; this is calculateed by IndexSector = NumberOfFATs * BigSectorsPerFAT + ReservedSectors
; https://stackoverflow.com/questions/12030668/how-can-we-use-ex-in-16-bit-but-not-rx-in-32-bit
xor ah, ah ; reset ah
mov al, byte [NumberOfFATs] ; the size of the operand is unessary
mov ebx, dword [BigSectorsPerFAT]
mul ebx ; result is stored in ax
xor ebx, ebx
mov bx, word [ReservedSectors]
add eax, ebx
mov [DataSector], eax
; we need to get the location of the first FAT
; FirstFAT = ReservedSectors
; this is kinda redundant, and wastes space, might optimise this later
mov ax, word [ReservedSectors]
mov [FirstFATLoc], ax
; now we gets the bytes per each cluster
; BytesPerCluster = BytesPerSector * SectorsPerCluster
mov ax, [BytesPerSector]
mov bx, [SectorsPerCluster]
mul bx
mov [BytesPerCluster], bx
; converts cluster into lba adressing scheme
; remeber we enabled BIOS extensions
; LBA = (cluster - 2) * SectorsPerCluster + FirstFATLoc
cluster_to_lba:
pusha | 38.855422 | 129 | 0.674419 |
fadfd1c54cb4784fc403b8dcbfac62251e74eb2d | 1,752 | asm | Assembly | programs/oeis/035/A035928.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/035/A035928.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/035/A035928.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A035928: Numbers n such that BCR(n) = n, where BCR = binary-complement-and-reverse = take one's complement then reverse bit order.
; 2,10,12,38,42,52,56,142,150,170,178,204,212,232,240,542,558,598,614,666,682,722,738,796,812,852,868,920,936,976,992,2110,2142,2222,2254,2358,2390,2470,2502,2618,2650,2730,2762,2866,2898,2978,3010,3132,3164,3244,3276,3380,3412,3492,3524,3640,3672,3752,3784,3888,3920,4000,4032,8318,8382,8542,8606,8814,8878,9038,9102,9334,9398,9558,9622,9830,9894,10054,10118,10362,10426,10586,10650,10858,10922,11082,11146,11378,11442,11602,11666,11874,11938,12098,12162,12412,12476,12636,12700,12908,12972,13132,13196,13428,13492,13652,13716,13924,13988,14148,14212,14456,14520,14680,14744,14952,15016,15176,15240,15472,15536,15696,15760,15968,16032,16192,16256,33022,33150,33470,33598,34014,34142,34462,34590,35054,35182,35502,35630,36046,36174,36494,36622,37110,37238,37558,37686,38102,38230,38550,38678,39142,39270,39590,39718,40134,40262,40582,40710,41210,41338,41658,41786,42202,42330,42650,42778,43242,43370,43690,43818,44234,44362,44682,44810,45298,45426,45746,45874,46290,46418,46738,46866,47330,47458,47778,47906,48322,48450,48770,48898,49404,49532,49852,49980,50396,50524,50844,50972,51436,51564,51884,52012,52428,52556,52876,53004,53492,53620,53940,54068,54484,54612,54932,55060,55524,55652,55972,56100,56516,56644,56964,57092,57592,57720,58040,58168,58584,58712,59032,59160,59624,59752,60072,60200,60616,60744,61064,61192,61680,61808,62128,62256,62672,62800,63120,63248,63712,63840,64160
mov $2,1
lpb $0
sub $0,1
mov $3,$2
mov $4,2
add $4,$0
div $0,2
add $4,$2
mov $5,1
add $5,$4
mov $2,$5
add $2,$3
add $2,$0
lpe
mov $0,1
add $2,6
add $0,$2
mul $0,2
mov $1,$0
sub $1,15
div $1,2
mul $1,2
add $1,2
| 64.888889 | 1,385 | 0.768265 |
dc9b57407bcf86e15ef00d976b9a4fd843193296 | 339 | asm | Assembly | programs/oeis/043/A043655.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/043/A043655.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/043/A043655.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A043655: Numbers n such that base 12 representation has exactly 6 runs.
; 250572,250574,250575,250576,250577,250578,250579,250580,250581,250582,250583,250584,250585,250587,250588,250589,250590,250591,250592,250593,250594,250595,250596,250597,250598,250600,250601
add $0,2
mov $1,18
add $1,$0
add $1,$0
div $1,24
add $1,$0
add $1,250570
| 30.818182 | 190 | 0.772861 |
5ce24b9e1b767f6e5d71cd4e8e49332a008a8286 | 605 | asm | Assembly | Library/SpecUI/CommonUI/CGadget/copenRange.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/SpecUI/CommonUI/CGadget/copenRange.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/SpecUI/CommonUI/CGadget/copenRange.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: CommonUI/Open (gadgets)
FILE: copenRange.asm
ROUTINES:
Name Description
---- -----------
GLB OLRangeClass Open look numeric range gadget
REVISION HISTORY:
Name Date Description
---- ---- -----------
Chris 12/89 Initial version
DESCRIPTION:
$Id: copenRange.asm,v 1.1 97/04/07 10:54:15 newdeal Exp $
------------------------------------------------------------------------------@
Nuked. 7/ 7/92 cbh
| 24.2 | 80 | 0.471074 |
7f848c4fe9ebb00ee8cc1b60ac2627dbbe11d563 | 563 | asm | Assembly | asm/fpga_leds.asm | FKD13/RCPU | 1f27246494f60eaa2432470b2d218bb3f63578c7 | [
"MIT"
] | 17 | 2017-07-26T13:08:34.000Z | 2022-02-19T20:44:02.000Z | asm/fpga_leds.asm | FKD13/RCPU | 1f27246494f60eaa2432470b2d218bb3f63578c7 | [
"MIT"
] | 4 | 2017-10-12T20:56:39.000Z | 2020-05-04T09:19:44.000Z | asm/fpga_leds.asm | FKD13/RCPU | 1f27246494f60eaa2432470b2d218bb3f63578c7 | [
"MIT"
] | 4 | 2017-10-16T16:24:16.000Z | 2022-03-21T19:07:06.000Z | .text
.global main:
; displays the value in the D register
; pollutes the A register
leds_display:
PSH D
; push address of leds, and write option
LDV A, (0b1000000000)
LSH A, 4
INC A
PSH A
SYS
RET
sleep:
LDV A, 0
LDV C, while_sleep:
LDV B, 0
while_sleep:
INC B
NOP
NOP
NOP
NOP
JLT B, C
RET
main:
LDV A, leds_display:
LDV D, (0b11010)
CAL A
LDV A, sleep:
CAL A
LDV A, leds_display:
LDV D, (0b00110)
CAL A
LDV A, sleep:
CAL A
JMP main:
| 12.511111 | 44 | 0.550622 |
c7f40bbfb23617b6faf49f416359161e97e5f567 | 296 | asm | Assembly | programs/oeis/131/A131193.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/131/A131193.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/131/A131193.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A131193: Period 6: repeat [0, 1, -3, 3, -1, 0].
; 0,1,-3,3,-1,0,0,1,-3,3,-1,0,0,1,-3,3,-1,0,0,1,-3,3,-1,0,0,1,-3,3,-1,0,0,1,-3,3,-1,0,0,1,-3,3,-1,0,0,1,-3,3,-1,0,0,1,-3,3,-1,0,0,1,-3,3,-1,0,0,1,-3,3,-1,0,0,1,-3,3,-1,0,0,1,-3,3,-1,0,0,1,-3,3,-1,0
mod $0,6
mov $1,$0
sub $0,5
sub $1,1
bin $0,$1
| 32.888889 | 197 | 0.456081 |
a8b46248d826e510e746aaf5dbe6a38b6ac8cccd | 82 | asm | Assembly | src/02-vehicles/change-canoe-speed.asm | chaoshades/snes-ffci | a69349490ce3c71e400900d0744c1569bdb56eee | [
"MIT"
] | null | null | null | src/02-vehicles/change-canoe-speed.asm | chaoshades/snes-ffci | a69349490ce3c71e400900d0744c1569bdb56eee | [
"MIT"
] | null | null | null | src/02-vehicles/change-canoe-speed.asm | chaoshades/snes-ffci | a69349490ce3c71e400900d0744c1569bdb56eee | [
"MIT"
] | null | null | null | org $80830D ; Hack directly into ROM
db $00 ; Change speed of canoe
| 20.5 | 40 | 0.609756 |
8666252d7a48c410d442b26d5b8dbcee8f261e08 | 1,856 | asm | Assembly | programs/oeis/147/A147595.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/147/A147595.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/147/A147595.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A147595: a(n) is the number whose binary representation is A138144(n).
; 1,3,7,15,27,51,99,195,387,771,1539,3075,6147,12291,24579,49155,98307,196611,393219,786435,1572867,3145731,6291459,12582915,25165827,50331651,100663299,201326595,402653187,805306371,1610612739,3221225475,6442450947,12884901891,25769803779,51539607555,103079215107,206158430211,412316860419,824633720835,1649267441667,3298534883331,6597069766659,13194139533315,26388279066627,52776558133251,105553116266499,211106232532995,422212465065987,844424930131971,1688849860263939,3377699720527875,6755399441055747,13510798882111491,27021597764222979,54043195528445955,108086391056891907,216172782113783811,432345564227567619,864691128455135235,1729382256910270467,3458764513820540931,6917529027641081859,13835058055282163715,27670116110564327427,55340232221128654851,110680464442257309699,221360928884514619395,442721857769029238787,885443715538058477571,1770887431076116955139,3541774862152233910275,7083549724304467820547,14167099448608935641091,28334198897217871282179,56668397794435742564355,113336795588871485128707,226673591177742970257411,453347182355485940514819,906694364710971881029635,1813388729421943762059267,3626777458843887524118531,7253554917687775048237059,14507109835375550096474115,29014219670751100192948227,58028439341502200385896451,116056878683004400771792899,232113757366008801543585795,464227514732017603087171587,928455029464035206174343171,1856910058928070412348686339,3713820117856140824697372675,7427640235712281649394745347,14855280471424563298789490691,29710560942849126597578981379,59421121885698253195157962755,118842243771396506390315925507,237684487542793012780631851011,475368975085586025561263702019,950737950171172051122527404035
mov $1,$0
lpb $1
sub $3,$1
sub $1,1
mov $2,$3
mov $3,$0
sub $3,$1
add $0,$3
trn $2,2
lpe
sub $0,$2
add $0,1
| 116 | 1,659 | 0.899784 |
809c09189293af35f3ee1a79c25480048205fdce | 7,725 | asm | Assembly | boot/loader.asm | ValjeanTheWolfie/TinySYS | 2c59cca75eba58e1d454969ccc8c67521c27b832 | [
"MIT"
] | null | null | null | boot/loader.asm | ValjeanTheWolfie/TinySYS | 2c59cca75eba58e1d454969ccc8c67521c27b832 | [
"MIT"
] | null | null | null | boot/loader.asm | ValjeanTheWolfie/TinySYS | 2c59cca75eba58e1d454969ccc8c67521c27b832 | [
"MIT"
] | null | null | null | %include "boot.inc"
org 0x10000
loader_start:
;Initialize segment register DS
mov ax, cs
mov ds, ax
mov si, message_enter_loader
call fat12_print
; Open A20 line
in al, 92h
or al, 10b
out 92h, al
;Switch to unreal mode, expanding the addressing of FS
cli
lgdt [Gdt32_Register]
mov eax, cr0
or eax, 1
mov cr0, eax
mov ax, Selector32_Data
mov fs, ax
mov eax, cr0
and al, ~1
mov cr0, eax
sti
mov si, message_in_unreal_mode
call fat12_print
load_kernel:
mov ax, kernel_filename
call fat12_search_file_in_rootdir
cmp ax, 0
jnz .found_kernel
mov si, message_file_not_found
call fat12_print
jmp $
.found_kernel:
mov si, message_load_kernel
call fat12_print
mov ebx, 0x10_0000
call fat12_load_file
mov si, message_done
call fat12_print
.kill_floppy_monitor:
mov dx, 0x03f2
mov al, 0
out dx, al
dectect_memory:
mov si, message_detecting_memory
call fat12_print
xor ebx, ebx
mov di, 0x7000
.int_e820h:
mov si, message_wait_dot
call fat12_print
mov eax, 0xE820
mov ecx, 20
mov edx, 0x534D4150 ;'SMAP'
int 15h
jc .error
add di, 20
cmp ebx, 0
jnz .int_e820h
jmp .done
.error:
mov si, message_detecting_memory_error
call fat12_print
jmp $
.done:
mov si, message_done
call fat12_print
go_to_protected_mode:
call prepare_print_without_bios
cli
lgdt [Gdt32_Register]
lidt [Idt_Register]
mov eax, cr0
or eax, 1
mov cr0, eax
jmp dword Selector32_Code: protected_mode_start
[bits 32]
protected_mode_start:
mov ax, Selector32_Data
mov ds, ax
mov es, ax
mov fs, ax
mov ss, ax
mov esp, 0x7000
mov ax, Selector32_Video
mov gs, ax
mov esi, message_in_protected_mode
call print32
check_IA32_mode_supported:
; cpuid 80000000H
; EAX Maximum Input Value for Extended Function CPUID Information.
; cpuid 80000001H
; EDX Bit 29: Intel® 64 Architecture available if 1.
mov eax, 0x80000000
cpuid
cmp eax, 0x80000001
jb .not_supported
mov eax, 0x80000001
cpuid
test edx, 1 << 29
jnz .supported
.not_supported:
mov esi, message_not_support_ia32
call print32
jmp $
.supported:
mov esi, message_support_ia32
call print32
mov esi, message_go_to_long_mode
call print32
prepare_page_table:
mov dword [0x90000], 0x91007
mov dword [0x90004], 0
mov dword [0x90800], 0x91007
mov dword [0x90804], 0
mov dword [0x91000], 0x92007
mov dword [0x91004], 0
mov dword [0x92000], 0x000083
mov dword [0x92004], 0
mov dword [0x92008], 0x200083
mov dword [0x9200c], 0
mov dword [0x92010], 0x400083
mov dword [0x92014], 0
mov dword [0x92018], 0x600083
mov dword [0x9201c], 0
mov dword [0x92020], 0x800083
mov dword [0x92024], 0
mov dword [0x92028], 0xa00083
mov dword [0x9202c], 0
mov dword [0x92030], 0xc00083
mov dword [0x92034], 0
mov dword [0x92038], 0xe00083
mov dword [0x9203c], 0
go_to_long_mode:
; load GDT
lgdt [Gdt64_Register]
mov ax, Selector64_Data
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
mov esp, 0x7000
; open PAE
mov eax, cr4
bts eax, 5
mov cr4, eax
; load page table to cr3
mov eax, 0x90000
mov cr3, eax
; enable long mode
mov ecx, 0xC0000080
rdmsr
bts eax, 8
wrmsr
; open PE and paging
mov eax, cr0
bts eax, 0
bts eax, 31
mov cr0, eax
jmp Selector64_Code: 0x10_0000
[SECTION FAT12]
[bits 16]
%include "FAT12.inc"
[SECTION text]
kernel_filename db "KERNEL BIN"
message_enter_loader db "Loader start!", CR, LF, 0
message_in_unreal_mode db "Switched to unreal mode.", CR, LF, 0
message_load_kernel db "Loading kernel", 0
message_file_not_found db "KERNEL.BIN not found!!! System halt.", CR, LF, 0
message_done db "Done!!", CR, LF, 0
message_detecting_memory db "Dectecting memory", 0
message_detecting_memory_error db "Error are encountered. System halt", CR, LF, 0
message_in_protected_mode db "Entered protected mode!!", CR, LF, 0
message_support_ia32 db "CPU support IA-32e(64 bit) mode.", CR, LF, 0
message_not_support_ia32 db "CPU doesn't support 64 bit mode. System halt!", CR, LF, 0
message_go_to_long_mode db "Switching to long mode...", CR, LF, 0
message_wait_dot db ".", 0
message_endline db CR, LF, 0
[SECTION descriptors]
%include "descriptor.inc"
Gdt32: GDT32_ENTRY(0, 0, 0, 0)
Gdt32EntCode: GDT32_ENTRY(GDT_BASE_ADDR_ZERO, GDT_LIMIT_UNLIMITED, GDT_ACCESS_BYTE_CODE, GDT_FLAGS_4K_32)
Gdt32EntData: GDT32_ENTRY(GDT_BASE_ADDR_ZERO, GDT_LIMIT_UNLIMITED, GDT_ACCESS_BYTE_DATA, GDT_FLAGS_4K_32)
Gdt32EntVideo: GDT32_ENTRY(0xb8000, GDT_LIMIT_UNLIMITED, GDT_ACCESS_BYTE_DATA, GDT_FLAGS_4K_32)
Gdt32Len equ $ - Gdt32
Gdt32_Register dw Gdt32Len - 1
dd Gdt32
Selector32_Code equ Gdt32EntCode - Gdt32
Selector32_Data equ Gdt32EntData - Gdt32
Selector32_Video equ Gdt32EntVideo - Gdt32
Idt: times 0x50 dq 0
IdtLen equ $ - Idt
Idt_Register dw IdtLen - 1
dd Idt
Gdt64: GDT64_ENTRY(0, 0)
Gdt64EntCode: GDT64_ENTRY(GDT_ACCESS_BYTE_CODE, GDT_FLAGS_64)
Gdt64EntData: GDT64_ENTRY(GDT_ACCESS_BYTE_DATA, GDT_FLAGS_64)
Gdt64Len equ $ - Gdt64
Gdt64_Register dw Gdt64Len - 1
dd Gdt64
Selector64_Code equ Gdt64EntCode - Gdt64
Selector64_Data equ Gdt64EntData - Gdt64
[SECTION print32]
DefaulPrintColor equ 0x07 ; white
VideoMemPerLine equ 160 ; 80 char/line * 2 byte/char
dw_CursorPos dw 0 ; cursor position
; ----------------------------------------------------------
; Proc Name: prepare_print_without_bios
; Function : As its name is
; ----------------------------------------------------------
[bits 16]
prepare_print_without_bios:
; Save cursor position
; (BIOS interrupt INT 10H / AH=03H: Read Cursor Position)
; (Return: DH = Y coordinate DL = X coordinate )
mov ah, 03h
mov bh, 00h
int 10h
; Covert to video memory offset
xor eax, eax
mov al, dh
mov bl, 80 ; 80 char/line
mul bl
movzx bx, dl
add ax, bx
shl eax, 1 ; 2 byte/char
mov dword [dw_CursorPos], eax
; Disable the cursor (BIOS interrupt INT 10H / AH=01H: Set Cursor Type)
mov ah, 01h
mov ch, 0010_0000b ; bit5 set: no cursor
int 10h
ret
; ----------------------------------------------------------
; Proc Name: print32
; Function : Print a C-style string (ended with '\0').
; Input : ESI - the address of the string
; Output : void
; ----------------------------------------------------------
[bits 32]
print32:
pusha
mov ebx, [dw_CursorPos]
.loop:
lodsb
cmp al, 0
jz .end
call .putchar32
jmp .loop
.end:
mov dword [dw_CursorPos], ebx
popa
ret
.putchar32:
; SubProc: Print a char to the screen and update EBX
; Input : AL - char EBX - cursor position
; Output : EBX - updated cursor position
cmp al, CR
je .is_cr
cmp al, LF
je .is_lf
mov byte [gs:ebx], al
inc ebx
mov byte [gs:ebx], DefaulPrintColor
inc ebx
ret
.is_cr:
mov edx, 0
mov ecx, VideoMemPerLine
mov eax, ebx
div ecx
sub ebx, edx
ret
.is_lf:
add ebx, VideoMemPerLine
ret
| 22.587719 | 111 | 0.621489 |
a73fee3bb05026bb212b25ab76a177746a926a00 | 1,102 | asm | Assembly | defines/mame-defs.asm | dougmasten/coco_dev | 5ef0b3149ebea447dafcaa6b28f5e3a9c55de947 | [
"MIT"
] | 2 | 2020-07-26T13:35:00.000Z | 2020-10-03T04:08:07.000Z | defines/mame-defs.asm | dougmasten/coco_libraries | b3b460cfe3398e8f6678680d84f7a9c56a030a8a | [
"MIT"
] | null | null | null | defines/mame-defs.asm | dougmasten/coco_libraries | b3b460cfe3398e8f6678680d84f7a9c56a030a8a | [
"MIT"
] | 1 | 2019-06-01T21:23:52.000Z | 2019-06-01T21:23:52.000Z | ; mame-defs.asm
*pragmapush list ; Save state of list pragma
pragma nolist ; Turn off assembly listing and exclude from symbol list
ifndef MAME_DEFS ; Load defines only once
; Erik Milliluk's development fork of MAME with developers enhancements
; https://github.com/milliluk/mame
MAME_DEBUG_CTRL equ $ff04 ; MAME Debug Control (Milliluk's branch only)
; Bit 7:2 - n/a
; Bit 1 - Set to '1' snapshots Video Frame count to $FF09
; Bit 0 - Set to '1' snapshots System Cycle count to $FF05
MAME_CYCLE_COUNT equ $ff05 ; MAME System cycle counter (32-bit) snapshot
MAME_FRAME_COUNT equ $ff09 ; MAME Video frame counter (32-bit) snapshot
MAME_DEFS equ 1 ; Set flag for defines being loaded
endc
*pragmapop list ; restore assembly listing to previous state
| 52.47619 | 102 | 0.525408 |
d0fb716d143a35daf2ee8b7dbb2c41e5ed3d3846 | 5,673 | asm | Assembly | trunk/win/lib/openssl-1.0.1e/tmp32/sha256-586.asm | chundonglinlin/srs.win | 0e45a27ebf0df35509cac33741d4e3e8454d83fa | [
"MIT"
] | 9 | 2016-02-04T02:09:25.000Z | 2019-08-11T15:11:44.000Z | trunk/win/lib/openssl-1.0.1e/tmp32/sha256-586.asm | suhetao/srs.win | 0e45a27ebf0df35509cac33741d4e3e8454d83fa | [
"MIT"
] | null | null | null | trunk/win/lib/openssl-1.0.1e/tmp32/sha256-586.asm | suhetao/srs.win | 0e45a27ebf0df35509cac33741d4e3e8454d83fa | [
"MIT"
] | 23 | 2015-12-06T15:18:41.000Z | 2021-12-23T13:59:25.000Z | TITLE sha512-586.asm
IF @Version LT 800
ECHO MASM version 8.00 or later is strongly recommended.
ENDIF
.486
.MODEL FLAT
OPTION DOTNAME
IF @Version LT 800
.text$ SEGMENT PAGE 'CODE'
ELSE
.text$ SEGMENT ALIGN(64) 'CODE'
ENDIF
ALIGN 16
_sha256_block_data_order PROC PUBLIC
$L_sha256_block_data_order_begin::
push ebp
push ebx
push esi
push edi
mov esi,DWORD PTR 20[esp]
mov edi,DWORD PTR 24[esp]
mov eax,DWORD PTR 28[esp]
mov ebx,esp
call $L000pic_point
$L000pic_point:
pop ebp
lea ebp,DWORD PTR ($L001K256-$L000pic_point)[ebp]
sub esp,16
and esp,-64
shl eax,6
add eax,edi
mov DWORD PTR [esp],esi
mov DWORD PTR 4[esp],edi
mov DWORD PTR 8[esp],eax
mov DWORD PTR 12[esp],ebx
ALIGN 16
$L002loop:
mov eax,DWORD PTR [edi]
mov ebx,DWORD PTR 4[edi]
mov ecx,DWORD PTR 8[edi]
mov edx,DWORD PTR 12[edi]
bswap eax
bswap ebx
bswap ecx
bswap edx
push eax
push ebx
push ecx
push edx
mov eax,DWORD PTR 16[edi]
mov ebx,DWORD PTR 20[edi]
mov ecx,DWORD PTR 24[edi]
mov edx,DWORD PTR 28[edi]
bswap eax
bswap ebx
bswap ecx
bswap edx
push eax
push ebx
push ecx
push edx
mov eax,DWORD PTR 32[edi]
mov ebx,DWORD PTR 36[edi]
mov ecx,DWORD PTR 40[edi]
mov edx,DWORD PTR 44[edi]
bswap eax
bswap ebx
bswap ecx
bswap edx
push eax
push ebx
push ecx
push edx
mov eax,DWORD PTR 48[edi]
mov ebx,DWORD PTR 52[edi]
mov ecx,DWORD PTR 56[edi]
mov edx,DWORD PTR 60[edi]
bswap eax
bswap ebx
bswap ecx
bswap edx
push eax
push ebx
push ecx
push edx
add edi,64
sub esp,32
mov DWORD PTR 100[esp],edi
mov eax,DWORD PTR [esi]
mov ebx,DWORD PTR 4[esi]
mov ecx,DWORD PTR 8[esi]
mov edi,DWORD PTR 12[esi]
mov DWORD PTR 4[esp],ebx
mov DWORD PTR 8[esp],ecx
mov DWORD PTR 12[esp],edi
mov edx,DWORD PTR 16[esi]
mov ebx,DWORD PTR 20[esi]
mov ecx,DWORD PTR 24[esi]
mov edi,DWORD PTR 28[esi]
mov DWORD PTR 20[esp],ebx
mov DWORD PTR 24[esp],ecx
mov DWORD PTR 28[esp],edi
ALIGN 16
$L00300_15:
mov ebx,DWORD PTR 92[esp]
mov ecx,edx
ror ecx,14
mov esi,DWORD PTR 20[esp]
xor ecx,edx
ror ecx,5
xor ecx,edx
ror ecx,6
mov edi,DWORD PTR 24[esp]
add ebx,ecx
xor esi,edi
mov DWORD PTR 16[esp],edx
mov ecx,eax
and esi,edx
mov edx,DWORD PTR 12[esp]
xor esi,edi
mov edi,eax
add ebx,esi
ror ecx,9
add ebx,DWORD PTR 28[esp]
xor ecx,eax
ror ecx,11
mov esi,DWORD PTR 4[esp]
xor ecx,eax
ror ecx,2
add edx,ebx
mov edi,DWORD PTR 8[esp]
add ebx,ecx
mov DWORD PTR [esp],eax
mov ecx,eax
sub esp,4
or eax,esi
and ecx,esi
and eax,edi
mov esi,DWORD PTR [ebp]
or eax,ecx
add ebp,4
add eax,ebx
add edx,esi
add eax,esi
cmp esi,3248222580
jne $L00300_15
mov ebx,DWORD PTR 152[esp]
ALIGN 16
$L00416_63:
mov esi,ebx
mov ecx,DWORD PTR 100[esp]
ror esi,11
mov edi,ecx
xor esi,ebx
ror esi,7
shr ebx,3
ror edi,2
xor ebx,esi
xor edi,ecx
ror edi,17
shr ecx,10
add ebx,DWORD PTR 156[esp]
xor edi,ecx
add ebx,DWORD PTR 120[esp]
mov ecx,edx
add ebx,edi
ror ecx,14
mov esi,DWORD PTR 20[esp]
xor ecx,edx
ror ecx,5
mov DWORD PTR 92[esp],ebx
xor ecx,edx
ror ecx,6
mov edi,DWORD PTR 24[esp]
add ebx,ecx
xor esi,edi
mov DWORD PTR 16[esp],edx
mov ecx,eax
and esi,edx
mov edx,DWORD PTR 12[esp]
xor esi,edi
mov edi,eax
add ebx,esi
ror ecx,9
add ebx,DWORD PTR 28[esp]
xor ecx,eax
ror ecx,11
mov esi,DWORD PTR 4[esp]
xor ecx,eax
ror ecx,2
add edx,ebx
mov edi,DWORD PTR 8[esp]
add ebx,ecx
mov DWORD PTR [esp],eax
mov ecx,eax
sub esp,4
or eax,esi
and ecx,esi
and eax,edi
mov esi,DWORD PTR [ebp]
or eax,ecx
add ebp,4
add eax,ebx
mov ebx,DWORD PTR 152[esp]
add edx,esi
add eax,esi
cmp esi,3329325298
jne $L00416_63
mov esi,DWORD PTR 352[esp]
mov ebx,DWORD PTR 4[esp]
mov ecx,DWORD PTR 8[esp]
mov edi,DWORD PTR 12[esp]
add eax,DWORD PTR [esi]
add ebx,DWORD PTR 4[esi]
add ecx,DWORD PTR 8[esi]
add edi,DWORD PTR 12[esi]
mov DWORD PTR [esi],eax
mov DWORD PTR 4[esi],ebx
mov DWORD PTR 8[esi],ecx
mov DWORD PTR 12[esi],edi
mov eax,DWORD PTR 20[esp]
mov ebx,DWORD PTR 24[esp]
mov ecx,DWORD PTR 28[esp]
mov edi,DWORD PTR 356[esp]
add edx,DWORD PTR 16[esi]
add eax,DWORD PTR 20[esi]
add ebx,DWORD PTR 24[esi]
add ecx,DWORD PTR 28[esi]
mov DWORD PTR 16[esi],edx
mov DWORD PTR 20[esi],eax
mov DWORD PTR 24[esi],ebx
mov DWORD PTR 28[esi],ecx
add esp,352
sub ebp,256
cmp edi,DWORD PTR 8[esp]
jb $L002loop
mov esp,DWORD PTR 12[esp]
pop edi
pop esi
pop ebx
pop ebp
ret
ALIGN 64
$L001K256:
DD 1116352408,1899447441,3049323471,3921009573
DD 961987163,1508970993,2453635748,2870763221
DD 3624381080,310598401,607225278,1426881987
DD 1925078388,2162078206,2614888103,3248222580
DD 3835390401,4022224774,264347078,604807628
DD 770255983,1249150122,1555081692,1996064986
DD 2554220882,2821834349,2952996808,3210313671
DD 3336571891,3584528711,113926993,338241895
DD 666307205,773529912,1294757372,1396182291
DD 1695183700,1986661051,2177026350,2456956037
DD 2730485921,2820302411,3259730800,3345764771
DD 3516065817,3600352804,4094571909,275423344
DD 430227734,506948616,659060556,883997877
DD 958139571,1322822218,1537002063,1747873779
DD 1955562222,2024104815,2227730452,2361852424
DD 2428436474,2756734187,3204031479,3329325298
_sha256_block_data_order ENDP
DB 83,72,65,50,53,54,32,98,108,111,99,107,32,116,114,97
DB 110,115,102,111,114,109,32,102,111,114,32,120,56,54,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
.text$ ENDS
END
| 21.089219 | 65 | 0.697867 |
da89fe091c565d83e095c448c4396a98c260b174 | 250 | asm | Assembly | programs/oeis/070/A070431.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/070/A070431.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/070/A070431.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A070431: a(n) = n^2 mod 6.
; 0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3,4,1,0,1,4,3
pow $0,2
mod $0,6
| 41.666667 | 201 | 0.5 |
e42c96229c172b1d991268f8d5972b902f9e294e | 3,138 | asm | Assembly | font/text_ui.asm | speccytools/spectranet-index-module | d23b03c3b11ce4fb07129392ff5a16b4651e69ca | [
"MIT"
] | null | null | null | font/text_ui.asm | speccytools/spectranet-index-module | d23b03c3b11ce4fb07129392ff5a16b4651e69ca | [
"MIT"
] | null | null | null | font/text_ui.asm | speccytools/spectranet-index-module | d23b03c3b11ce4fb07129392ff5a16b4651e69ca | [
"MIT"
] | null | null | null | EXTERN asm_zx_cxy2saddr
EXTERN asm_zx_cxy2aaddr
include "../include/spectranet.inc"
include "../include/defs.inc"
include "../include/stdmodules.inc"
include "../include/fcntl.inc"
include "../include/zxrom.inc"
include "../include/sysvars.inc"
include "../include/zxsysvars.inc"
include "../src/memory.inc"
org 0x1000
; stack: string to write
; stack: amount to write
; registers used:
; ixl - number of characters left to write
; hl - current screen address
; de - current characted data address
; bc - current string address
text_ui_write:
pop iy ; ret
ld de, hl ; store string address into de for a bit
ld ix, 0xFF ; -1
count_loop:
ld a, (hl)
inc hl
inc ixl
and a
jr nz, count_loop ; string length is in ixl
pop hl ; yx
push hl ; preserve yx for asm_zx_cxy2aaddr
call asm_zx_cxy2aaddr ; get color data addr
ld c, ixl ; get chars amount into ixl
inc c ; divide it in half
rr c ; with round top
ld a, (TEXT_COLOR)
_text_ui_write_color_loop: ; fill up color info
ld (hl), a
inc hl
dec c
jr nz, _text_ui_write_color_loop
pop hl ; restore hl to yx
call asm_zx_cxy2saddr ; hl now holds a screen address
ld bc, de ; pop string address into bc
push iy ; ret
_text_ui_write_loop:
; even
include "text_ui_routine_loop_header.inc"
include "text_ui_routine_even.inc"
inc h
include "text_ui_routine_even.inc"
inc h
include "text_ui_routine_even.inc"
inc h
include "text_ui_routine_even.inc"
inc h
include "text_ui_routine_even.inc"
inc h
include "text_ui_routine_even.inc"
inc h
include "text_ui_routine_even.inc"
inc h
include "text_ui_routine_even.inc"
ld a, h ; restore (h)l from 7 increments
sub 7
ld h, a
inc bc ; onto next character
dec ixl ; do we have more to print?
ret z ; we're done
; odd
include "text_ui_routine_loop_header.inc"
include "text_ui_routine_odd.inc"
inc h
include "text_ui_routine_odd.inc"
inc h
include "text_ui_routine_odd.inc"
inc h
include "text_ui_routine_odd.inc"
inc h
include "text_ui_routine_odd.inc"
inc h
include "text_ui_routine_odd.inc"
inc h
include "text_ui_routine_odd.inc"
inc h
include "text_ui_routine_odd.inc"
inc hl ; onto next screen address position
ld a, h ; restore (h)l from 7 increments
sub 7
ld h, a
inc bc ; onto next character
dec ixl ; do we have more to print?
ret z ; we're done
jp _text_ui_write_loop
font:
binary "font_4x8_80columns.bin"
| 28.017857 | 76 | 0.561504 |
4d37e7554804afce23d3af6836e01f1e673195bd | 1,114 | asm | Assembly | Student/examples/Correct/CPRL0/Correct_102.asm | SoftMoore/CPRL-Kt | c2dfdbd5b30ed6175f419398071e2f98e582d23a | [
"Unlicense"
] | 6 | 2021-02-02T10:08:02.000Z | 2022-03-24T08:10:44.000Z | Student/examples/Correct/CPRL0/Correct_102.asm | SoftMoore/CPRL-Kt | c2dfdbd5b30ed6175f419398071e2f98e582d23a | [
"Unlicense"
] | 1 | 2021-02-27T21:55:26.000Z | 2021-02-28T12:39:29.000Z | Student/examples/Correct/CPRL0/Correct_102.asm | SoftMoore/CPRL-Kt | c2dfdbd5b30ed6175f419398071e2f98e582d23a | [
"Unlicense"
] | 6 | 2020-02-24T13:51:32.000Z | 2021-06-05T19:02:05.000Z | PROGRAM 60
LDGADDR 4
LDCINT 1
STOREW
LDGADDR 8
LDCINT 2
STOREW
LDGADDR 12
LDCINT 1
STOREW
LDGADDR 16
LDCINT 2
STOREW
LDGADDR 20
LDCINT 1
STOREW
LDGADDR 24
LDCINT 2
STOREW
LDGADDR 28
LDCINT 1
STOREW
LDGADDR 32
LDCINT 2
STOREW
LDGADDR 36
LDCINT 1
STOREW
LDGADDR 40
LDCINT 2
STOREW
LDGADDR 44
LDCINT 1
STOREW
LDGADDR 48
LDCINT 2
STOREW
LDGADDR 52
LDCINT 1
STOREW
LDGADDR 56
LDCINT 2
STOREW
LDGADDR 0
LDGADDR 4
LOADW
LDGADDR 8
LOADW
ADD
LDGADDR 12
LOADW
LDGADDR 16
LOADW
ADD
LDGADDR 20
LOADW
LDGADDR 24
LOADW
ADD
LDGADDR 28
LOADW
LDGADDR 32
LOADW
ADD
LDGADDR 36
LOADW
LDGADDR 40
LOADW
ADD
LDGADDR 44
LOADW
LDGADDR 48
LOADW
ADD
LDGADDR 52
LOADW
LDGADDR 56
LOADW
ADD
MUL
MUL
MUL
MUL
MUL
MUL
STOREW
LDCINT 1
LDCINT 2
ADD
PUTINT
LDCSTR " "
PUTSTR
LDCINT 1
NEG
PUTINT
LDCSTR " "
PUTSTR
LDGADDR 0
LOADW
PUTINT
HALT
| 10.921569 | 16 | 0.581688 |
09bd504768073f1832343d8916a717a3fd166e50 | 442 | asm | Assembly | oeis/037/A037696.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/037/A037696.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/037/A037696.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A037696: Base 5 digits are, in order, the first n terms of the periodic sequence with initial period 1,2,3,0.
; Submitted by Christian Krause
; 1,7,38,190,951,4757,23788,118940,594701,2973507,14867538,74337690,371688451,1858442257,9292211288,46461056440,232305282201,1161526411007,5807632055038,29038160275190,145190801375951,725954006879757
mov $2,1
lpb $0
sub $0,1
add $1,$2
mul $1,5
add $2,21
mod $2,4
lpe
add $1,$2
mov $0,$1
| 29.466667 | 199 | 0.755656 |
9d7dc90e06fc1fa61bd5266bf90d88f66615eb35 | 2,210 | asm | Assembly | func.asm | cotarr/calc-pi-x86-64-asm | 1135d8060d3bbcde411cca59587c52287b31ea70 | [
"MIT"
] | null | null | null | func.asm | cotarr/calc-pi-x86-64-asm | 1135d8060d3bbcde411cca59587c52287b31ea70 | [
"MIT"
] | null | null | null | func.asm | cotarr/calc-pi-x86-64-asm | 1135d8060d3bbcde411cca59587c52287b31ea70 | [
"MIT"
] | null | null | null | %define FUNC1234
%include "var_header.inc" ; Header has global variable definitions for other modules
%include "func_header.inc" ; Header has global function definitions for other modules
;--------------------------------------------------------------
;
; SINGLE THREAD FLOATING POINT MULTI-PRECISION CALCULATOR
;
; Contains higher level functions, generally function(XREG)
;
; File: func.asm
; Module: func.asm, func.o
; Exec: calc-pi
;
; Created: 11/08/2014
; Last Edit 04/25/2020
;
;--------------------------------------------------------------
; MIT License
;
; Copyright 2014-2020 David Bolenbaugh
;
; 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.
;-------------------------------------------------------------
SECTION .data ; Section containing initialized data
;
SECTION .bss ; Section containing uninitialized data
SECTION .text ; Section containing code
;--------------------------------------------------------------
;
; Include Functions
;
;--------------------------------------------------------------
%INCLUDE "func-trig.asm"
%INCLUDE "func-roots.asm"
%INCLUDE "func-exp.asm"
%INCLUDE "func-ln.asm"
;---------------------
; End functions.asm
;---------------------
| 35.645161 | 85 | 0.637557 |
578737f3509f7e445245113ba77c9fb53144fb9e | 6,083 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1723.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1723.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1723.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r8
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1c937, %rdi
nop
nop
nop
nop
sub $46210, %r14
mov (%rdi), %r13d
sub $59878, %rax
lea addresses_A_ht+0x1d247, %rbp
nop
nop
nop
nop
xor $62752, %r9
movb (%rbp), %r8b
nop
nop
nop
add %r14, %r14
lea addresses_WT_ht+0x5b6f, %r8
nop
nop
xor %rax, %rax
movb $0x61, (%r8)
dec %r9
lea addresses_UC_ht+0x8f8f, %rdi
nop
nop
sub $59501, %rax
movb (%rdi), %r9b
nop
nop
nop
nop
sub %r13, %r13
lea addresses_D_ht+0x156c7, %r9
nop
sub $62118, %r14
mov $0x6162636465666768, %rax
movq %rax, %xmm3
and $0xffffffffffffffc0, %r9
vmovntdq %ymm3, (%r9)
nop
nop
nop
nop
add $50259, %rdi
lea addresses_UC_ht+0x7e47, %rdi
nop
nop
xor %r9, %r9
vmovups (%rdi), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %rbp
nop
nop
inc %rax
lea addresses_WC_ht+0xc937, %rdi
nop
lfence
mov (%rdi), %ax
nop
nop
nop
xor %rax, %rax
lea addresses_D_ht+0xcb67, %r14
sub %rbp, %rbp
mov (%r14), %rax
nop
nop
mfence
lea addresses_A_ht+0xba87, %rsi
lea addresses_D_ht+0x5ed7, %rdi
clflush (%rsi)
nop
nop
nop
cmp %rax, %rax
mov $77, %rcx
rep movsb
nop
nop
nop
nop
xor %r13, %r13
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %rbp
push %rbx
push %rdx
push %rsi
// Faulty Load
lea addresses_D+0x11a47, %r10
clflush (%r10)
nop
nop
cmp %rsi, %rsi
movb (%r10), %dl
lea oracles, %rsi
and $0xff, %rdx
shlq $12, %rdx
mov (%rsi,%rdx,1), %rdx
pop %rsi
pop %rdx
pop %rbx
pop %rbp
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_normal_ht', 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_A_ht', 'congruent': 10}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WT_ht', 'congruent': 2}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 1, 'type': 'addresses_UC_ht', 'congruent': 3}}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 32, 'type': 'addresses_D_ht', 'congruent': 6}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC_ht', 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_WC_ht', 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_D_ht', 'congruent': 3}}
{'dst': {'same': False, 'congruent': 4, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_A_ht'}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 39.245161 | 2,999 | 0.656091 |
e42f7d6a4a554cf3f408260997ab8d1e454b3545 | 1,702 | asm | Assembly | programs/oeis/195/A195028.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/195/A195028.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/195/A195028.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A195028: a(n) = n*(14*n + 13).
; 0,27,82,165,276,415,582,777,1000,1251,1530,1837,2172,2535,2926,3345,3792,4267,4770,5301,5860,6447,7062,7705,8376,9075,9802,10557,11340,12151,12990,13857,14752,15675,16626,17605,18612,19647,20710,21801,22920,24067,25242,26445,27676,28935,30222,31537,32880,34251,35650,37077,38532,40015,41526,43065,44632,46227,47850,49501,51180,52887,54622,56385,58176,59995,61842,63717,65620,67551,69510,71497,73512,75555,77626,79725,81852,84007,86190,88401,90640,92907,95202,97525,99876,102255,104662,107097,109560,112051,114570,117117,119692,122295,124926,127585,130272,132987,135730,138501,141300,144127,146982,149865,152776,155715,158682,161677,164700,167751,170830,173937,177072,180235,183426,186645,189892,193167,196470,199801,203160,206547,209962,213405,216876,220375,223902,227457,231040,234651,238290,241957,245652,249375,253126,256905,260712,264547,268410,272301,276220,280167,284142,288145,292176,296235,300322,304437,308580,312751,316950,321177,325432,329715,334026,338365,342732,347127,351550,356001,360480,364987,369522,374085,378676,383295,387942,392617,397320,402051,406810,411597,416412,421255,426126,431025,435952,440907,445890,450901,455940,461007,466102,471225,476376,481555,486762,491997,497260,502551,507870,513217,518592,523995,529426,534885,540372,545887,551430,557001,562600,568227,573882,579565,585276,591015,596782,602577,608400,614251,620130,626037,631972,637935,643926,649945,655992,662067,668170,674301,680460,686647,692862,699105,705376,711675,718002,724357,730740,737151,743590,750057,756552,763075,769626,776205,782812,789447,796110,802801,809520,816267,823042,829845,836676,843535,850422,857337,864280,871251
mov $1,14
mul $1,$0
add $1,13
mul $1,$0
| 212.75 | 1,627 | 0.8302 |
1f446be576e1a2661d286469de0e0ed6ac5a5e3d | 351 | asm | Assembly | programs/oeis/189/A189674.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/189/A189674.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/189/A189674.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A189674: Partial sums of A189673.
; 0,1,1,2,3,3,3,4,4,5,6,6,7,8,8,8,9,9,9,10,10,11,12,12,12,13,13,14,15,15,16,17,17,17,18,18,19,20,20,21,22,22,22,23,23,23,24,24,25,26,26,26,27,27,27,28,28,29,30,30,30,31,31,32,33,33,34,35,35,35,36,36,36,37,37,38,39,39,39,40,40
mov $1,$0
lpb $1
mov $2,$1
div $1,3
add $2,$1
mod $2,2
add $0,$2
lpe
div $0,2
| 27 | 225 | 0.603989 |
9c3dcd94ca53ff7c3b72453019926a8de8045d51 | 399 | asm | Assembly | libsrc/_DEVELOPMENT/arch/zx/bifrost_h/z80/asm_BIFROSTH_resetTileImages.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/arch/zx/bifrost_h/z80/asm_BIFROSTH_resetTileImages.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/arch/zx/bifrost_h/z80/asm_BIFROSTH_resetTileImages.asm | teknoplop/z88dk | bb03fbfd6b2ab0f397a1358559089f9cd3706485 | [
"ClArtistic"
] | 1 | 2019-12-03T23:57:48.000Z | 2019-12-03T23:57:48.000Z | ; ----------------------------------------------------------------
; Z88DK INTERFACE LIBRARY FOR THE BIFROST* ENGINE - RELEASE 1.2/L
;
; See "bifrost_h.h" for further details
; ----------------------------------------------------------------
SECTION code_clib
SECTION code_bifrost_h
PUBLIC asm_BIFROSTH_resetTileImages
asm_BIFROSTH_resetTileImages:
; hl = void *addr
ld (58726),hl
ret
| 22.166667 | 66 | 0.503759 |
17ffaf5ea3d096181d4d8934797e24a9127ecbfb | 825 | asm | Assembly | libsrc/oz/memcpy.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | 1 | 2018-09-04T23:07:24.000Z | 2018-09-04T23:07:24.000Z | libsrc/oz/memcpy.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | libsrc/oz/memcpy.asm | dex4er/deb-z88dk | 9ee4f23444fa6f6043462332a1bff7ae20a8504b | [
"ClArtistic"
] | null | null | null | ;
; Sharp OZ family functions
;
; ported from the OZ-7xx SDK by by Alexander R. Pruss
; by Stefano Bodrato - Oct. 2003
;
;
; memory copy routine
; memcpy(dest,src,count)
;
;
; ------
; $Id: memcpy.asm,v 1.1 2003/10/29 13:03:05 stefano Exp $
;
XLIB memcpy
;
;blkcpy:
memcpy:
pop hl
ld (retval+1),hl
; pop de
; pop hl
; pop bc
pop bc
pop hl
pop de
push de ;; save destination
ld a,c
or b
jr z,NothingToDo
ldir
NothingToDo:
ex (sp),hl ;; get destination pointer
push hl
push hl ;; fill up stack
retval:
jp 0 ;;
;retval equ $-2 ;; self-modifying return
| 18.75 | 58 | 0.449697 |
fc30e72d035677d7fd5c0540c23d5f8db9862480 | 650 | asm | Assembly | oeis/064/A064491.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/064/A064491.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/064/A064491.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A064491: a(1) = 1, a(n+1) = a(n) + tau(a(n)), where tau(n) (A000005) is the number of divisors of n.
; Submitted by Jamie Morken(s2)
; 1,2,4,7,9,12,18,24,32,38,42,50,56,64,71,73,75,81,86,90,102,110,118,122,126,138,146,150,162,172,178,182,190,198,210,226,230,238,246,254,258,266,274,278,282,290,298,302,306,318,326,330,346,350,362,366,374,382,386,390,406,414,426,434,442,450,468,486,498,506,514,518,526,530,538,542,546,562,566,570,586,590,598,606,614,618,626,630,654,662,666,678,686,694,698,702,718,722,728,744
lpb $0
sub $0,1
seq $2,62249 ; a(n) = n + d(n), where d(n) = number of divisors of n, cf. A000005.
sub $2,1
lpe
mov $0,$2
add $0,1
| 54.166667 | 376 | 0.669231 |
5d8e81991418dfa8a5a3b3a1ef8439f144f5ea41 | 288 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_expm1_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_expm1_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math48/c/sdcc_iy/cm48_sdcciy_expm1_fastcall.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; float expm1(float x) __z88dk_fastcall
SECTION code_clib
SECTION code_fp_math48
PUBLIC cm48_sdcciy_expm1_fastcall
EXTERN cm48_sdcciyp_dx2m48, am48_expm1, cm48_sdcciyp_m482d
cm48_sdcciy_expm1_fastcall:
call cm48_sdcciyp_dx2m48
call am48_expm1
jp cm48_sdcciyp_m482d
| 16 | 58 | 0.822917 |
76624d692683f64c05df49ca8c7bec57d0a1cf7c | 576 | asm | Assembly | oeis/167/A167469.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/167/A167469.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/167/A167469.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A167469: a(n) = 3*n*(5*n-1)/2.
; 6,27,63,114,180,261,357,468,594,735,891,1062,1248,1449,1665,1896,2142,2403,2679,2970,3276,3597,3933,4284,4650,5031,5427,5838,6264,6705,7161,7632,8118,8619,9135,9666,10212,10773,11349,11940,12546,13167,13803,14454,15120,15801,16497,17208,17934,18675,19431,20202,20988,21789,22605,23436,24282,25143,26019,26910,27816,28737,29673,30624,31590,32571,33567,34578,35604,36645,37701,38772,39858,40959,42075,43206,44352,45513,46689,47880,49086,50307,51543,52794,54060,55341,56637,57948,59274,60615,61971
mul $0,5
add $0,5
bin $0,2
div $0,5
mul $0,3
| 64 | 496 | 0.770833 |
d38e18c2c5af89a9232e600fcf7b74a955920028 | 377 | asm | Assembly | programs/oeis/214/A214982.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/214/A214982.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/214/A214982.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A214982: a(n) = (Fibonacci(5n)/Fibonacci(n) - 5)/50.
; 0,1,6,45,300,2080,14196,97461,667590,4576825,31367160,215001216,1473620616,10100397385,69229018950,474503107365,3252291758436,22291541752096,152788493829180,1047227932532925,7177806988136070
cal $0,127546 ; a(n) = F(n)^2 + F(n+1)^2 + F(n+2)^2, where F(n) denotes the n-th Fibonacci number.
pow $0,2
mov $1,$0
div $1,32
| 47.125 | 192 | 0.734748 |
261503df3b241122e16c33c5995b1676263e8892 | 16,578 | asm | Assembly | Appl/GeoFile/DocAsm/docButtn.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/GeoFile/DocAsm/docButtn.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/GeoFile/DocAsm/docButtn.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1990 -- All Rights Reserved
PROJECT: GeoFile
MODULE: Document
FILE: documentTitledButton.asm
AUTHOR: Andrew Wilson, Dec 3, 1990
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 12/ 3/90 Initial revision
anna 11/25/92 copied to GeoFile, slightly revised
DESCRIPTION:
This file contains code to implement the TitledGenItemClass and
to create nifty titled summons.
$Id: docButtn.asm,v 1.1 97/04/04 15:53:45 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
include uiButton.rdef
TitledMonikerPrologue struc
TMP_height word (?)
TMP_drawbitmapOp byte (?)
TMP_drawbitmapX word (?)
TMP_drawbitmapY word (?)
TMP_drawbitmapOptr optr (?)
TMP_setfontOp byte (?)
TMP_setfontPtFrac byte (?)
TMP_setfontPtInt word (?)
TMP_setfontID word (?)
TMP_drawtextOp byte (?)
TMP_drawtextX word (?)
TMP_drawtextY word (?)
TMP_drawtextLen word (?)
TitledMonikerPrologue ends
.assert (TMP_drawbitmapOp eq VMGS_gstring)
;
; CONSTANTS FOR WIDTHS AND POSITIONS IN TITLED MONIKER
;
TITLE_MAX_LEN equ 32
if PZ_PCGEOS
TITLED_MONIKER_TITLE_FONT equ FID_PIZZA_KANJI
else
TITLED_MONIKER_TITLE_FONT equ FID_BERKELEY
endif
;Title font is Berkeley
if PZ_PCGEOS
TITLED_MONIKER_TITLE_SIZE equ 16
else
TITLED_MONIKER_TITLE_SIZE equ 9
endif
TITLED_MONIKER_WIDTH equ 83
if PZ_PCGEOS
TITLED_MONIKER_HEIGHT equ 42
else
TITLED_MONIKER_HEIGHT equ 37
endif
TITLED_BITMAP_WIDTH equ 64
CGA_TITLED_MONIKER_WIDTH equ TITLED_MONIKER_WIDTH
CGA_TITLED_MONIKER_HEIGHT equ 26
CGA_TITLED_BITMAP_WIDTH equ TITLED_BITMAP_WIDTH
TITLED_MONIKER_TEXT_OFFSET equ 26
CGA_TITLED_MONIKER_TEXT_OFFSET equ 16
TITLED_MONIKER_BITMAP_OFFSET equ 2
SetGeosConvention
TitleCode segment resource
COMMENT @----------------------------------------------------------------------
C FUNCTION: TitledGenItemSpecBuild
C DECLARATION: extern void
_far _pascal TitledGenItemSpecBuild(
optr objectPtr, ChunkHandle titleChunk,
word pictureNumber, ClassStruct _far *class,
SpecBuildFlags specBuildFlags);
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Joon 8/25/93 Initial version
------------------------------------------------------------------------------@
TITLEDGENITEMSPECBUILD proc far objectPtr:optr,
titleChunk:word,
pictureNumber:word,
classPtr:fptr,
specBuildflags:word
uses si, di, ds, es
.enter
movdw bxsi, objectPtr
call MemDerefDS ;*DS:SI <- titled object
mov bx, titleChunk ;*DS:BX <- title text
movdw esdi, classPtr ;ES:DI
mov ax, pictureNumber ;AX <- picture number
mov bp, specBuildflags ;BP <- SpecBuildFlags
call DoSpecBuildCommon
.leave
ret
TITLEDGENITEMSPECBUILD endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoSpecBuildCommon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This routine handles creating a titled vis moniker for the
passed object and for passing MSG_SPEC_BUILD off to the
superclass.
CALLED BY: GLOBAL
PASS: *DS:SI - object
*DS:BX - ptr to title text
AX - picture number
CX, DX, BP - MSG_SPEC_BUILD parameters
bp - SpecBuildFlags
ES:DI - ptr to class of object
RETURN: nada
DESTROYED: various important but undocumented things
PSEUDO CODE/STRATEGY:
This page intentionally left blank
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 12/ 3/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoSpecBuildCommon proc far
test bp, mask SBF_WIN_GROUP ; if doing win group, moniker
jnz done ; for button has already been
; set, don't bother again
push es,cx,dx,bp,di ; preserve SpecBuildFlags
push bx ; title text
EC < cmp ax, NUM_CGA_TITLED_MONIKERS >
EC < ERROR_AE -1 >
push ax
push si ;Save ptr to titled object
mov ax, MSG_GEN_APPLICATION_GET_DISPLAY_SCHEME
clr bx
call GeodeGetAppObject
mov di,mask MF_CALL
call ObjMessage ;Get app display scheme in AH
pop si ;Restore ptr to titled object
mov al, ah ;copy display type to AL
andnf ah, mask DT_DISP_ASPECT_RATIO
mov di, offset CGATitledMonikers
cmp ah, DAR_VERY_SQUISHED shl offset DT_DISP_ASPECT_RATIO
je 10$ ;CGA
mov di, offset VGATitledMonikers
cmp ah, DAR_NORMAL
je 8$ ;VGA or MCGA
mov di, offset EGATitledMonikers ;else, EGA or HGC
8$:
and al, mask DT_DISP_CLASS ;Get display class
cmp al, DC_GRAY_1 ;Are we on a monochrome display
jne 10$ ;EGA
mov di, offset HGCTitledMonikers
10$:
pop bp ;Restore picture number
shl bp,1 ;Multiply picture # by 4 (size of table
shl bp,1 ; entry -- optr)
; SET UP MONIKER
mov cx, ({optr} cs:[di][bp]).handle ;^lCX:DX <- bitmap to put in
mov dx, ({optr} cs:[di][bp]).chunk ; moniker
pop bx ;Restore title chunk
call TitledObjectSetMoniker
pop es,cx,dx,bp,di ; restore SpecBuildFlags
done:
; Continue by calling superclass with same
; method
mov ax, MSG_SPEC_BUILD
GOTO ObjCallSuperNoLock
DoSpecBuildCommon endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
TitledObjectSetMoniker
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This method combines the passed moniker and passed title
chunk to be one beautiful moniker.
CALLED BY: GLOBAL
PASS: CX:DX - optr of bitmap to be part of GCM moniker
BX - title chunk
*DS:SI - object to set moniker for
RETURN: nada
DESTROYED: ax, bx, cx, dx, bp, di
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 1/13/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
TitledObjectSetMoniker proc near
bitmap local optr
object local lptr
SBCS < titleStr local TITLE_MAX_LEN+4 dup (char) >
DBCS < titleStr local TITLE_MAX_LEN+4 dup (word) >
;Title max size + null +
; room for ellipsis
.enter
; SET UP LOCALS
mov object, si
mov bitmap.handle, cx
mov bitmap.chunk, dx
; COPY TITLE DATA OUT OF CHUNK AND ONTO STACK FOR MANIPULATION
mov si, ds:[bx] ;DS:SI <- ptr to title data
segmov es, ss
lea di, titleStr ;ES:DI <- where to put title
; data
ChunkSizePtr ds, si, cx
EC < cmp cx, TITLE_MAX_LEN >
EC < ERROR_AE -1 >
inc cx
shr cx, 1 ;CX <- # words
rep movsw ;Copy data over from title
; GET INFORMATION ABOUT TITLE AND CLIP IF NECESSARY
lea si, titleStr ;ES:SI <- ptr to title
mov bx, TITLED_MONIKER_WIDTH ;
mov cx, TITLED_MONIKER_TITLE_FONT ;
mov dx, TITLED_MONIKER_TITLE_SIZE ;
call GetTitleInfo ;Returns strlen in CX and width
; in BP (Clips title and adds
; ellipsis if necessary)
; ALLOCATE MONIKER CHUNK
;CX <- total size of moniker
add cx, size TitledMonikerPrologue + size VisMoniker + size OpEndGString
mov al, mask OCF_DIRTY ;Save this to the state file.
call LMemAlloc ;Allocate the moniker
; FILL IN MONIKER CHUNK
push cx,dx, ax, bp
mov ax, MSG_GEN_APPLICATION_GET_DISPLAY_SCHEME
clr bx
call GeodeGetAppObject
mov di,mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage ;Get app display scheme in AH
segmov es,ds,di ;ES <- moniker segment
pop cx, dx, di, bp
push di
mov di,ds:[di] ;Deref moniker chunk
mov ds:[di].VM_width, TITLED_MONIKER_WIDTH ;Set cached size
mov ({VisMonikerGString} ds:[di].VM_data).VMGS_height, \
TITLED_MONIKER_HEIGHT
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_drawtextY, TITLED_MONIKER_TEXT_OFFSET
cmp ah, CGA_DISPLAY_TYPE
jne notCGA ;Adjust height for CGA
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_drawtextY, CGA_TITLED_MONIKER_TEXT_OFFSET
mov ({VisMonikerGString} ds:[di].VM_data).VMGS_height, \
CGA_TITLED_MONIKER_HEIGHT
notCGA:
; See if b/w (GRAY_1) or not
and ah, mask DT_DISP_CLASS
cmp ah, DC_GRAY_1 shl offset DT_DISP_CLASS
jne drawOp
mov ({TitledMonikerPrologue}ds:[di].VM_data).TMP_drawbitmapOp, \
GR_FILL_BITMAP_OPTR
jmp gotOp
drawOp:
mov ({TitledMonikerPrologue}ds:[di].VM_data).TMP_drawbitmapOp, \
GR_DRAW_BITMAP_OPTR
gotOp:
mov ds:[di].VM_type,( mask VMT_GSTRING or (DAR_NORMAL shl offset VMT_GS_ASPECT_RATIO) or (DC_GRAY_1 shl offset VMT_GS_COLOR) )
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_drawbitmapX, (TITLED_MONIKER_WIDTH - TITLED_BITMAP_WIDTH)/2
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_drawbitmapY, TITLED_MONIKER_BITMAP_OFFSET
mov ax, bitmap.handle
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_drawbitmapOptr.handle, ax
mov ax, bitmap.chunk
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_drawbitmapOptr.chunk, ax
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_setfontOp, GR_SET_FONT
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_setfontPtFrac, 0
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_setfontPtInt, TITLED_MONIKER_TITLE_SIZE
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_setfontID, TITLED_MONIKER_TITLE_FONT
mov ax, TITLED_MONIKER_WIDTH
sub ax,dx
shr ax,1 ;AX <- offset to draw text at.
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_drawtextX, ax
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_drawtextOp, GR_DRAW_TEXT
sub cx, size TitledMonikerPrologue + size VisMoniker + size OpEndGString
;CX <- byte length of title
push cx
shr cx ;char = byte/2 in DBCS
mov ({TitledMonikerPrologue} ds:[di].VM_data).TMP_drawtextLen, cx
;Store string *char* length
;ES:DI <- ptr to store title
pop cx
add di,size TitledMonikerPrologue + size VisMoniker
push ds ;Save object block
segmov ds, ss, si ;
lea si, titleStr ;DS:SI <- title string
rep movsb ;Copy over string
mov es:[di].OEGS_opcode, GR_END_GSTRING ;End the string
pop ds ;Restore object block
pop cx ;Restore moniker chunk handle
push bp
mov si, object
mov dl, VUM_DELAYED_VIA_UI_QUEUE ;Update the moniker
mov ax, MSG_GEN_USE_VIS_MONIKER
call ObjCallInstanceNoLock
pop bp
.leave
ret
TitledObjectSetMoniker endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GetTitleInfo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: This routine gets the width/length of the passed string and
clips it if necessary.
CALLED BY: GLOBAL
PASS: ES:SI - null-terminated string
BX - width to clip to
CX - font ID
DX - point size of font
RETURN: CX - string length
DX - pixel width
DESTROYED: di, si
PSEUDO CODE/STRATEGY:
This page intentionally left blank
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 1/14/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GetTitleInfo proc near
uses ax,ds,bp
.enter
segmov ds,es,di ;DS:SI <- ptr to string
push cx, dx
mov di, si ;ES:DI <- ptr to string
mov cx, -1 ;
clr ax ;
repne scasw ;
not cx ;CX <- length of string
shl cx ;*2 for DBCS
push cx ;Save length
clr di
call GrCreateState ;Get a GState to manipulate
pop ax ;Restore string len
pop cx, dx ;Restore Font/Pt Size
push ax ;Save string len
clr ah ;
call GrSetFont ;
clr cx ;
call GrTextWidth ;Do trivial reject -- entire
; string fits
pop cx ;CX <- string length
mov bp,dx ;BP <- pixel width
cmp bp, bx ;If width < moniker width, then
jle noclip ; no clipping, dude!
mov ax, '.' ;Get width of a '.'
call GrCharWidth ;
mov bp, dx ;BP <- width of '.' * 3...
shl dx, 1 ;
add bp, dx ;
clr cx
cliploop:
inc cx
inc cx
lodsw ;Get next character from string
call GrCharWidth
add bp,dx ;BP += width of next char
cmp bp, bx ;
jl cliploop ;
sub bp, dx ;BP <- real width
mov ax, '.' ;Add '...'
push di ;Save GState
lea di, ds:[si][-2]
stosw
stosw
stosw
clr ax ;Add null terminator
stosw
add cx, 6 ;CX <- clipped string length
pop di ;Restore GState
noclip:
call GrDestroyState
mov dx, bp
.leave
ret
GetTitleInfo endp
VGATitledMonikers label optr
EGATitledMonikers optr DesignModeLRSCMoniker
optr DataEntryModeLRSCMoniker
optr SingleRecordLayoutLRSCMoniker
optr MultiRecordLayoutLRSCMoniker
.assert ($-EGATitledMonikers)/4 eq PictureNumber
HGCTitledMonikers optr DesignModeLRSMMoniker
optr DataEntryModeLRSMMoniker
optr SingleRecordLayoutLRSMMoniker
optr MultiRecordLayoutLRSMMoniker
NUM_HGC_TITLED_MONIKERS equ ($-HGCTitledMonikers)/4
.assert NUM_HGC_TITLED_MONIKERS eq PictureNumber
CGATitledMonikers optr DesignModeLRSCGAMoniker
optr DataEntryModeLRSCGAMoniker
optr SingleRecordLayoutLRSCGAMoniker
optr MultiRecordLayoutLRSCGAMoniker
NUM_CGA_TITLED_MONIKERS equ ($-CGATitledMonikers)/4
.assert NUM_CGA_TITLED_MONIKERS eq PictureNumber
TitleCode ends
SetDefaultConvention
| 34.901053 | 132 | 0.532453 |
ce184964aef729e659299dfb1ffbf6743a81c87c | 8,627 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_376.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_376.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_376.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 %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x5f72, %rsi
xor $56609, %r9
movw $0x6162, (%rsi)
nop
nop
and %rbx, %rbx
lea addresses_D_ht+0x11b72, %r14
nop
nop
xor $14514, %r10
mov (%r14), %r8d
and $5894, %r9
lea addresses_normal_ht+0x14082, %rbx
dec %r9
mov $0x6162636465666768, %r8
movq %r8, %xmm2
and $0xffffffffffffffc0, %rbx
movaps %xmm2, (%rbx)
nop
nop
nop
dec %r14
lea addresses_WC_ht+0xab72, %r14
nop
nop
nop
nop
inc %r9
mov $0x6162636465666768, %r8
movq %r8, %xmm3
movups %xmm3, (%r14)
nop
xor $62439, %r10
lea addresses_A_ht+0x1a772, %r10
nop
and $7735, %rsi
vmovups (%r10), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rbx
nop
nop
nop
nop
xor %rsi, %rsi
lea addresses_normal_ht+0x1a372, %rsi
lea addresses_A_ht+0x1b472, %rdi
clflush (%rdi)
nop
nop
and %r10, %r10
mov $54, %rcx
rep movsq
dec %r10
lea addresses_D_ht+0x1ec02, %rsi
lea addresses_normal_ht+0x9372, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
and $35726, %rbx
mov $55, %rcx
rep movsl
sub %rbx, %rbx
lea addresses_WT_ht+0x8494, %rbx
nop
nop
nop
add %r8, %r8
movl $0x61626364, (%rbx)
xor %rcx, %rcx
lea addresses_UC_ht+0xa372, %rbx
clflush (%rbx)
nop
nop
nop
nop
nop
mfence
mov $0x6162636465666768, %rdi
movq %rdi, %xmm4
vmovups %ymm4, (%rbx)
nop
cmp $25634, %r14
lea addresses_UC_ht+0x1ab72, %rsi
lea addresses_UC_ht+0xb992, %rdi
nop
nop
nop
nop
dec %r8
mov $107, %rcx
rep movsq
and %rbx, %rbx
lea addresses_normal_ht+0x6bdf, %rsi
lea addresses_WC_ht+0x3dde, %rdi
nop
nop
nop
and %r9, %r9
mov $25, %rcx
rep movsb
sub $4230, %rbx
lea addresses_D_ht+0xaf2, %r14
nop
nop
nop
nop
and $24262, %r10
movups (%r14), %xmm3
vpextrq $0, %xmm3, %rcx
dec %r10
lea addresses_D_ht+0x1c372, %r10
nop
nop
nop
nop
nop
inc %r14
and $0xffffffffffffffc0, %r10
movaps (%r10), %xmm5
vpextrq $0, %xmm5, %rbx
nop
nop
nop
nop
nop
add %r14, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r14
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %r8
push %rax
push %rcx
push %rdi
// Store
lea addresses_WC+0xaed2, %r13
nop
nop
nop
nop
cmp $41869, %rdi
mov $0x5152535455565758, %rcx
movq %rcx, %xmm2
vmovups %ymm2, (%r13)
nop
nop
nop
sub %r8, %r8
// Load
lea addresses_D+0x12a72, %r12
nop
nop
cmp %rax, %rax
mov (%r12), %r13w
nop
nop
nop
and $2400, %rdi
// Load
lea addresses_RW+0x1f71a, %r12
nop
nop
nop
nop
cmp %r14, %r14
mov (%r12), %cx
nop
nop
nop
nop
add $44120, %r8
// Store
lea addresses_WC+0x1c5d2, %r12
inc %r8
mov $0x5152535455565758, %rcx
movq %rcx, %xmm6
movups %xmm6, (%r12)
nop
nop
xor $3831, %r13
// Store
lea addresses_normal+0x74d6, %rcx
nop
nop
nop
inc %rax
movw $0x5152, (%rcx)
nop
add %r12, %r12
// Faulty Load
lea addresses_normal+0x17b72, %r13
nop
and $42175, %r8
mov (%r13), %cx
lea oracles, %r8
and $0xff, %rcx
shlq $12, %rcx
mov (%r8,%rcx,1), %rcx
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 4}}
{'src': {'type': 'addresses_D', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 8}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 1}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 2}}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 9}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': True, 'size': 4, 'NT': False, 'same': False, 'congruent': 11}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 4}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 10}}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 10}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': True}}
{'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 1}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 9}}
{'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 11}, '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
*/
| 32.432331 | 2,999 | 0.655848 |
bf1b74356019c5302028432c5c46725b179c6361 | 480 | asm | Assembly | programs/oeis/088/A088955.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/088/A088955.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/088/A088955.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A088955: Primes of the form 60*n + 1.
; 61,181,241,421,541,601,661,1021,1201,1321,1381,1621,1741,1801,1861,2161,2221,2281,2341,2521,3001,3061,3121,3181,3301,3361,3541,4021,4201,4261,4441,4561,4621,4801,4861,5101,5281,5521,5581,5641,5701,5821,5881
mov $2,$0
pow $2,2
add $2,3
lpb $2
sub $2,1
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,60
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
sub $1,59
mov $0,$1
| 24 | 208 | 0.664583 |
f1f24776e073dc5367acc9f08f32039453356282 | 750 | asm | Assembly | oeis/327/A327171.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/327/A327171.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/327/A327171.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A327171: a(n) = phi(n) * core(n), where phi is Euler totient function, and core gives the squarefree part of n.
; Submitted by Simon Strandgaard
; 1,2,6,2,20,12,42,8,6,40,110,12,156,84,120,8,272,12,342,40,252,220,506,48,20,312,54,84,812,240,930,32,660,544,840,12,1332,684,936,160,1640,504,1806,220,120,1012,2162,48,42,40,1632,312,2756,108,2200,336,2052,1624,3422,240,3660,1860,252,32,3120,1320,4422,544,3036,1680,4970,48,5256,2664,120,684,4620,1872,6162,160,54,3280,6806,504,5440,3612,4872,880,7832,240,6552,1012,5580,4324,6840,192,9312,84,660,40
mov $1,$0
seq $0,10 ; Euler totient function phi(n): count numbers <= n and prime to n.
seq $1,7913 ; Squarefree part of n: a(n) is the smallest positive number m such that n/m is a square.
mul $0,$1
| 83.333333 | 401 | 0.726667 |
95b1769661402330a4e3c4fb2c9e2751aef9f32a | 288 | asm | Assembly | oeis/250/A250000.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/250/A250000.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/250/A250000.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A250000: Peaceable coexisting armies of queens: the maximum number m such that m white queens and m black queens can coexist on an n X n chessboard without attacking each other.
; 0,0,1,2,4,5,7,9,12,14,17,21,24,28,32
seq $0,96 ; a(n) = n*(n+3)/2.
mul $0,3
add $0,13
div $0,11
sub $0,1
| 32 | 179 | 0.694444 |
d378962d6c2ee049fb02b1e44ab6d65c91cf384e | 710 | asm | Assembly | programs/oeis/173/A173154.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/173/A173154.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/173/A173154.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A173154: a(n) = n^3/6 + 3*n^2/4 + 7*n/3 + 7/8 + (-1)^n/8.
; 1,4,10,19,33,52,78,111,153,204,266,339,425,524,638,767,913,1076,1258,1459,1681,1924,2190,2479,2793,3132,3498,3891,4313,4764,5246,5759,6305,6884,7498,8147,8833,9556,10318,11119,11961,12844,13770,14739,15753,16812,17918,19071,20273,21524,22826,24179,25585,27044,28558,30127,31753,33436,35178,36979,38841,40764,42750,44799,46913,49092,51338,53651,56033,58484,61006,63599,66265,69004,71818,74707,77673,80716,83838,87039,90321,93684,97130,100659,104273,107972,111758,115631,119593,123644,127786,132019,136345,140764,145278,149887,154593,159396,164298,169299
add $0,1
mov $2,$0
add $0,1
mul $0,2
mov $1,$0
bin $0,3
add $0,$1
div $0,8
add $0,$2
sub $0,1
| 50.714286 | 554 | 0.742254 |
9caa37f45bb9570b161c64043c7a3233a3e91423 | 6,559 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_470.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_0xca.log_21829_470.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_0xca.log_21829_470.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 %r12
push %r13
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0xcc21, %r11
nop
nop
nop
cmp $32811, %r12
movl $0x61626364, (%r11)
nop
nop
nop
nop
xor %r11, %r11
lea addresses_A_ht+0x19621, %rsi
lea addresses_WT_ht+0x7ad7, %rdi
nop
nop
nop
sub $37507, %r12
mov $60, %rcx
rep movsw
cmp %rcx, %rcx
lea addresses_WC_ht+0x1821, %r12
nop
nop
nop
nop
inc %r10
mov $0x6162636465666768, %r13
movq %r13, %xmm4
vmovups %ymm4, (%r12)
nop
sub $22312, %r12
lea addresses_normal_ht+0x1e629, %r11
nop
nop
nop
nop
add $52114, %rsi
movb $0x61, (%r11)
nop
nop
and %r11, %r11
lea addresses_normal_ht+0x17921, %rsi
lea addresses_A_ht+0x60b1, %rdi
nop
nop
dec %rdx
mov $89, %rcx
rep movsb
nop
nop
nop
and %rdx, %rdx
lea addresses_WT_ht+0x62e7, %rsi
lea addresses_WT_ht+0x1c21, %rdi
nop
add %r12, %r12
mov $65, %rcx
rep movsw
nop
nop
xor %rdx, %rdx
lea addresses_A_ht+0x14130, %r10
nop
nop
nop
nop
nop
cmp %rsi, %rsi
mov $0x6162636465666768, %r11
movq %r11, (%r10)
nop
nop
nop
inc %r10
lea addresses_A_ht+0x1ae21, %rdi
sub %rcx, %rcx
mov $0x6162636465666768, %r10
movq %r10, %xmm7
and $0xffffffffffffffc0, %rdi
vmovaps %ymm7, (%rdi)
nop
nop
sub %r12, %r12
lea addresses_WT_ht+0x6ce1, %r10
nop
nop
nop
nop
and $23288, %rsi
mov $0x6162636465666768, %rdx
movq %rdx, (%r10)
nop
and %r12, %r12
lea addresses_WT_ht+0x25e6, %rsi
lea addresses_A_ht+0x22f4, %rdi
nop
nop
nop
nop
nop
sub %rdx, %rdx
mov $10, %rcx
rep movsw
nop
nop
nop
nop
nop
add $58926, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r13
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r15
push %r8
push %r9
push %rbp
push %rsi
// Faulty Load
lea addresses_A+0x7c21, %rbp
add %r10, %r10
mov (%rbp), %r9d
lea oracles, %rsi
and $0xff, %r9
shlq $12, %r9
mov (%rsi,%r9,1), %r9
pop %rsi
pop %rbp
pop %r9
pop %r8
pop %r15
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_A', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_A_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 1}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 10}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_normal_ht', 'congruent': 8}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 2}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 1}, 'dst': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_A_ht', 'same': True, 'AVXalign': True, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_WT_ht', 'congruent': 0}, 'dst': {'same': False, 'type': 'addresses_A_ht', 'congruent': 0}}
{'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
*/
| 37.48 | 2,999 | 0.661381 |
dbcedb91e9502d22f70eb4664ab97ad101897146 | 1,977 | asm | Assembly | programs/oeis/184/A184037.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/184/A184037.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/184/A184037.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A184037: 1/16 the number of (n+1) X 8 0..3 arrays with all 2 X 2 subblocks having the same four values.
; 625,637,658,700,778,934,1234,1834,3010,5362,10018,19330,37858,74914,148834,296674,591970,1182562,2362978,4723810,9443938,18884194,37761634,75516514,151020130,302027362,604029538,1208033890,2416018018,4831986274,9663873634,19327648354,38655099490,77310001762,154619609698,309238825570,618476864098,1236952941154,2473904308834,4947807044194,9895610942050,19791218737762,39582431183458,79164856074850,158329699566178,316659386548834,633318747931234,1266637470696034,2533274891059810,5066549731787362,10133099362910818,20266198625157730,40532397048988258,81064793896649314,162129587390644834,324259174378635874,648518347951964770,1297036695098622562,2594073388586631778,5188146775562650210,10376293547904074338,20752587092586922594,41505174178731393634,83010348351020335714,166020696689155768930,332041393365426635362,664082786705083466338,1328165573384397128290,2656331146717254648418,5312662293382969688674,10625324586662860161634,21250649173222641107554,42501298346239123784290,85002596692272089137762,170005193384131861414498,340010386767851405967970,680020773534878178214498,1360041547068931722707554,2720083094136214177972834,5440166188270779088503394,10880332376538259642122850,21760664753073220749361762,43521329506139844428956258,87042659012273091788145250,174085318024532989436756578,348170636049052784733979234,696341272098079181188891234,1392682544196131974098715234,2785365088392211171639296610,5570730176784369566720459362,11141460353568633580324651618,22282920707137161607533036130,44565841414274112108833538658,89131682828548013111434543714,178263365657095604010404020834,356526731314190785808342975074,713053462628380727191755817570,1426106925256760609958581502562,2852213850513519531067302740578,5704427701027037373284745216610
mov $1,4
mov $2,$0
lpb $0
mul $1,2
add $1,$2
sub $1,$0
sub $0,1
trn $2,2
lpe
sub $1,4
mul $1,3
add $1,625
mov $0,$1
| 116.294118 | 1,743 | 0.90086 |
74823b2ab5cb7a708da2ebd8f5fe2c8013f86007 | 2,181 | asm | Assembly | libsrc/target/x1/stdio/generic_console_ioctl.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/x1/stdio/generic_console_ioctl.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/x1/stdio/generic_console_ioctl.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
MODULE generic_console_ioctl
PUBLIC generic_console_ioctl
SECTION code_clib
INCLUDE "ioctl.def"
EXTERN generic_console_cls
EXTERN generic_console_font32
EXTERN generic_console_udg32
EXTERN asm_load_charset
EXTERN __x1_mode
EXTERN __x1_pcg_mode
EXTERN __console_w
EXTERN set_crtc_10
INCLUDE "target/mc1000/def/mc1000.def"
PUBLIC CLIB_GENCON_CAPS
defc CLIB_GENCON_CAPS = CAP_GENCON_FG_COLOUR | CAP_GENCON_CUSTOM_FONT | CAP_GENCON_UDGS
; a = ioctl
; de = arg
generic_console_ioctl:
ex de,hl
ld c,(hl) ;bc = where we point to
inc hl
ld b,(hl)
cp IOCTL_GENCON_SET_FONT32
jr nz,check_set_udg
ld (generic_console_font32),bc
ld l,c
ld h,b
ld b,96
ld c,32
ld e,1
call set_pcg_chars
success:
and a
ret
check_set_udg:
cp IOCTL_GENCON_SET_UDGS
jr nz,check_mode
ld (generic_console_udg32),bc
ld l,c
ld h,b
ld b,128
ld c,128
ld e,2
call set_pcg_chars
jr success
check_mode:
cp IOCTL_GENCON_SET_MODE
jr nz,failure
ld a,c
ld c,$f0
ld de,$1928 ;rows cols
ld hl,text40
and a
jr z,set_mode
ld c,$b0
ld de,$1950
ld hl,text80
cp 1
jr nz,failure
set_mode:
push bc
ld (__x1_mode),a
ld (__console_w),de
call set_crtc_10
pop de
ld bc,$1a03
ld a,$82
out (c),a
dec bc
out (c),e
call generic_console_cls
jr success
failure:
scf
dummy_return:
ret
set_pcg_chars:
ld a,h
or l
jr z,clear_mode
ld a,(__x1_pcg_mode)
or e
ld (__x1_pcg_mode),a
call asm_load_charset
ret
clear_mode:
ld a,e
cpl
ld hl,__x1_pcg_mode
and (hl)
ld (hl),a
ret
SECTION rodata_clib
text40: defb 37h, 28h, 2Dh, 34h, 1Fh, 02h, 19h, 1Ch, 00h, 07h
text80: defb 6Fh, 50h, 59h, 38h, 1Fh, 02h, 19h, 1Ch, 00h, 07h
| 19.827273 | 94 | 0.556167 |
c9c6922de1cb90f703549766c807f04537b131e9 | 5,138 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_203.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_203.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_203.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 %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_normal_ht+0x9698, %rbp
nop
nop
lfence
movw $0x6162, (%rbp)
nop
nop
nop
nop
nop
add $28158, %rdx
lea addresses_WC_ht+0x1268c, %rsi
lea addresses_UC_ht+0x1e808, %rdi
clflush (%rsi)
nop
nop
nop
dec %rax
mov $76, %rcx
rep movsl
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_UC_ht+0x6b60, %rsi
nop
nop
nop
nop
add $57788, %rdx
vmovups (%rsi), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $1, %xmm2, %rcx
nop
nop
and $33408, %rdx
lea addresses_A_ht+0x6098, %rax
nop
nop
nop
nop
nop
and $59913, %rbp
movb $0x61, (%rax)
nop
sub $31976, %rcx
lea addresses_A_ht+0x1c928, %rcx
inc %r12
mov (%rcx), %eax
nop
dec %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r8
push %rbp
push %rcx
push %rdi
// Faulty Load
lea addresses_UC+0x16898, %r14
clflush (%r14)
nop
nop
nop
nop
nop
cmp %r12, %r12
mov (%r14), %r11
lea oracles, %rcx
and $0xff, %r11
shlq $12, %r11
mov (%rcx,%r11,1), %r11
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_UC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_UC', 'AVXalign': False, 'size': 8, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2, 'NT': False, 'same': False, 'congruent': 9}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 4, 'same': False}}
{'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 10}}
{'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 3}, 'OP': 'LOAD'}
{'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
*/
| 43.176471 | 2,999 | 0.660763 |
97eb5a7cbedf50f326fcbf023c7c412cfdc488f3 | 644 | asm | Assembly | Relatorios/Tarefa 07/Resolucao/codigo/programa14.asm | RafaelAmauri/Arquitetura-de-Computadores-2 | 5f5a0164cf25c037a174a1598a428da815207b07 | [
"MIT"
] | null | null | null | Relatorios/Tarefa 07/Resolucao/codigo/programa14.asm | RafaelAmauri/Arquitetura-de-Computadores-2 | 5f5a0164cf25c037a174a1598a428da815207b07 | [
"MIT"
] | null | null | null | Relatorios/Tarefa 07/Resolucao/codigo/programa14.asm | RafaelAmauri/Arquitetura-de-Computadores-2 | 5f5a0164cf25c037a174a1598a428da815207b07 | [
"MIT"
] | null | null | null | .data
valor: .word 4
.text
ori $t0, $zero, 0x1001 # t0 = 0x1001
sll $t0, $t0, 16 # t0 = 0x10010000
lw $s0, 0($t0) # Pegando primeiro valor da memória
andi $t1, $s0, 1 # Verificando se termina com 1, se for é ímpar
beqz $t1, PAR # Se for par saltará direto para
sw $t1, 4($t0) # Salvar o resultado da operação no primeiro espaço livre da memória
j FINALIZAR # Terminar o programa
PAR:
sw $t1, 4($t0) # Salvar o resultado da operação no primeiro espaço livre da memória
FINALIZAR:
J FINALIZAR # FInalizar o programa | 35.777778 | 95 | 0.572981 |
85fdccc929412501fd13e0af00ea23ccd46c32ee | 542 | asm | Assembly | examples/ferris/gbasm/main.asm | rukai/ggbasm | 8b75b758e71a5d3771a73e77bc681e251b874c24 | [
"MIT"
] | 10 | 2019-01-01T02:41:02.000Z | 2021-07-07T21:18:04.000Z | examples/ferris/gbasm/main.asm | rukai/ggbasm | 8b75b758e71a5d3771a73e77bc681e251b874c24 | [
"MIT"
] | 2 | 2018-08-17T11:39:20.000Z | 2018-09-30T07:56:22.000Z | examples/ferris/gbasm/main.asm | rukai/ggbasm | 8b75b758e71a5d3771a73e77bc681e251b874c24 | [
"MIT"
] | 1 | 2019-10-05T08:59:12.000Z | 2019-10-05T08:59:12.000Z | start:
di
; TODO: load graphics
call GGBASMAudioInit
; start playing ferris theme
ld hl, GGBASMAudioEnable
ld [hl], 0x01
ld hl, GGBASMAudioBank
ld [hl], 0x00
ld hl, GGBASMAudioPointerHi
ld [hl], MusicFerrisTheme / 0x100
ld hl, GGBASMAudioPointerLo
ld [hl], MusicFerrisTheme % 0x100
ld hl, GGBASMAudioRest
ld [hl], 0x20
; setup interrupts
ei
ld a, 0x1
ld [0xFF00+0xFF], a
mainLoop:
call GGBASMAudioStep
halt
; quick, draw graphics now
; TODO
jp mainLoop
| 16.9375 | 37 | 0.640221 |
85ec84f29edc509bbe322411b64cf0d9f2010315 | 626 | asm | Assembly | oeis/115/A115129.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/115/A115129.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/115/A115129.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A115129: Partial sums of A005587. Fourth column of triangle A115127.
; 14,56,146,311,586,1015,1652,2562,3822,5522,7766,10673,14378,19033,24808,31892,40494,50844,63194,77819,95018,115115,138460,165430,196430,231894,272286,318101,369866,428141,493520,566632,648142,738752,839202,950271,1072778,1207583,1355588,1517738,1695022,1888474,2099174,2328249,2576874,2846273,3137720,3452540,3792110,4157860,4551274,4973891,5427306,5913171,6433196,6989150,7582862,8216222,8891182,9609757,10374026,11186133,12048288,12962768,13931918,14958152,16043954,17191879,18404554,19684679
mov $1,9
add $1,$0
bin $1,4
mul $0,$1
div $0,5
add $0,14
| 62.6 | 496 | 0.817891 |
3ea82e6c4a72b609fb266019f2aa3167897d3a18 | 416 | asm | Assembly | programs/oeis/249/A249349.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/249/A249349.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/249/A249349.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A249349: (A001147(n+1)-1)/2, equals the index of A249348(n) within the triangular numbers A000217.
; 0,1,7,52,472,5197,67567,1013512,17229712,327364537,6874655287,158117071612,3952926790312,106729023338437,3095141676814687,95949391981255312,3166329935381425312,110821547738349885937,4100397266318945779687,159915493386438885407812
mov $2,$0
mov $0,30
mul $2,2
add $2,1
lpb $2
mul $0,$2
sub $2,2
lpe
div $0,60
| 32 | 231 | 0.790865 |
2fcc5c2bfff88fa65a6add92c0ab67230cddf219 | 456 | asm | Assembly | oeis/048/A048297.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/048/A048297.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/048/A048297.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A048297: Coefficients in power series expansion over GF(2)[ X^(-1) ] of continued fraction [ 0, X, X^2, X^4, X^8, X^16, ... ].
; Submitted by Christian Krause
; 1,4,7,13,16,25,28,31,49,52,55,61,64,97,100,103,109,112,121,124,127,193,196,199,205,208,217,220,223,241,244,247,253,256,385,388,391,397,400,409,412,415,433,436,439,445,448,481,484,487,493,496,505
seq $0,22340 ; Even Fibbinary numbers (A003714); also 2*Fibbinary(n).
div $0,2
mul $0,3
add $0,1
| 50.666667 | 196 | 0.688596 |
91c8d64b6aeb8e9ca6302c7782ff5910f86569a9 | 525 | asm | Assembly | programs/oeis/088/A088117.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/088/A088117.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/088/A088117.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A088117: Let the decimal expansion of n be abcd...; then a(n) = (a*bcd... + b*acd... + c*abd... + d*abc... + ...) + (ab*cd... + bc*ad... + cd*ab... + ...) + ... . That is, a(n) = sum over all the digit strings of the product (number obtained by deleting a digit string) * (deleted digit string).
; 0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,0,2,4,6,8,10,12,14,16,18,0,3,6,9,12,15,18,21,24,27,0,4,8,12,16,20,24,28,32,36,0,5,10,15,20,25,30,35,40,45,0
add $0,1
lpb $0
mov $1,$0
mod $0,10
sub $1,$0
mul $1,$0
lpe
div $1,10
| 43.75 | 297 | 0.56381 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.