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
d5cf1d38c14c4b05a54c71e7122b005b2c016099
20,006
asm
Assembly
maps/TeamRocketBaseB1F.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
maps/TeamRocketBaseB1F.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
maps/TeamRocketBaseB1F.asm
Dev727/ancientplatinum
8b212a1728cc32a95743e1538b9eaa0827d013a7
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
object_const_def ; object_event constants const TEAMROCKETBASEB1F_ROCKET1 const TEAMROCKETBASEB1F_ROCKET2 const TEAMROCKETBASEB1F_SCIENTIST const TEAMROCKETBASEB1F_POKE_BALL1 const TEAMROCKETBASEB1F_POKE_BALL2 const TEAMROCKETBASEB1F_POKE_BALL3 TeamRocketBaseB1F_MapScripts: db 1 ; scene scripts scene_script .DummyScene ; SCENE_DEFAULT db 1 ; callbacks callback MAPCALLBACK_OBJECTS, .HideSecurityGrunt .DummyScene: end .HideSecurityGrunt: disappear TEAMROCKETBASEB1F_ROCKET1 return SecurityCamera1a: checkevent EVENT_SECURITY_CAMERA_1 iftrue NoSecurityCamera scall PlaySecurityCameraSounds checkevent EVENT_TEAM_ROCKET_BASE_POPULATION iftrue NoSecurityCamera showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER moveobject TEAMROCKETBASEB1F_ROCKET1, 19, 2 appear TEAMROCKETBASEB1F_ROCKET1 turnobject PLAYER, LEFT applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement1 scall TrainerCameraGrunt1 ifequal TRUE, NoSecurityCamera scall PlaySecurityCameraSounds showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER moveobject TEAMROCKETBASEB1F_ROCKET1, 19, 2 appear TEAMROCKETBASEB1F_ROCKET1 applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement1 scall TrainerCameraGrunt2 ifequal TRUE, NoSecurityCamera setevent EVENT_SECURITY_CAMERA_1 end SecurityCamera1b: checkevent EVENT_SECURITY_CAMERA_1 iftrue NoSecurityCamera scall PlaySecurityCameraSounds checkevent EVENT_TEAM_ROCKET_BASE_POPULATION iftrue NoSecurityCamera showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER moveobject TEAMROCKETBASEB1F_ROCKET1, 19, 3 appear TEAMROCKETBASEB1F_ROCKET1 turnobject PLAYER, LEFT applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement1 scall TrainerCameraGrunt1 ifequal TRUE, NoSecurityCamera scall PlaySecurityCameraSounds showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER moveobject TEAMROCKETBASEB1F_ROCKET1, 19, 3 appear TEAMROCKETBASEB1F_ROCKET1 applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement1 scall TrainerCameraGrunt2 ifequal TRUE, NoSecurityCamera setevent EVENT_SECURITY_CAMERA_1 end SecurityCamera2a: checkevent EVENT_SECURITY_CAMERA_2 iftrue NoSecurityCamera scall PlaySecurityCameraSounds checkevent EVENT_TEAM_ROCKET_BASE_POPULATION iftrue NoSecurityCamera showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER moveobject TEAMROCKETBASEB1F_ROCKET1, 4, 7 appear TEAMROCKETBASEB1F_ROCKET1 turnobject PLAYER, LEFT applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement2 scall TrainerCameraGrunt1 ifequal TRUE, NoSecurityCamera scall PlaySecurityCameraSounds showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER turnobject PLAYER, RIGHT moveobject TEAMROCKETBASEB1F_ROCKET1, 12, 5 appear TEAMROCKETBASEB1F_ROCKET1 applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement3 scall TrainerCameraGrunt2 ifequal TRUE, NoSecurityCamera setevent EVENT_SECURITY_CAMERA_2 end SecurityCamera2b: checkevent EVENT_SECURITY_CAMERA_2 iftrue NoSecurityCamera scall PlaySecurityCameraSounds checkevent EVENT_TEAM_ROCKET_BASE_POPULATION iftrue NoSecurityCamera showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER moveobject TEAMROCKETBASEB1F_ROCKET1, 4, 8 appear TEAMROCKETBASEB1F_ROCKET1 turnobject PLAYER, LEFT applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement4 scall TrainerCameraGrunt1 ifequal TRUE, NoSecurityCamera scall PlaySecurityCameraSounds showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER turnobject PLAYER, RIGHT moveobject TEAMROCKETBASEB1F_ROCKET1, 12, 5 appear TEAMROCKETBASEB1F_ROCKET1 applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement5 scall TrainerCameraGrunt2 ifequal TRUE, NoSecurityCamera setevent EVENT_SECURITY_CAMERA_2 end SecurityCamera3a: checkevent EVENT_SECURITY_CAMERA_3 iftrue NoSecurityCamera scall PlaySecurityCameraSounds checkevent EVENT_TEAM_ROCKET_BASE_POPULATION iftrue NoSecurityCamera showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER moveobject TEAMROCKETBASEB1F_ROCKET1, 19, 6 appear TEAMROCKETBASEB1F_ROCKET1 turnobject PLAYER, LEFT applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement1 scall TrainerCameraGrunt1 ifequal TRUE, NoSecurityCamera scall PlaySecurityCameraSounds showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER turnobject PLAYER, RIGHT moveobject TEAMROCKETBASEB1F_ROCKET1, 25, 11 appear TEAMROCKETBASEB1F_ROCKET1 applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement6 scall TrainerCameraGrunt2 ifequal TRUE, NoSecurityCamera setevent EVENT_SECURITY_CAMERA_3 end SecurityCamera3b: checkevent EVENT_SECURITY_CAMERA_3 iftrue NoSecurityCamera scall PlaySecurityCameraSounds checkevent EVENT_TEAM_ROCKET_BASE_POPULATION iftrue NoSecurityCamera showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER moveobject TEAMROCKETBASEB1F_ROCKET1, 19, 7 appear TEAMROCKETBASEB1F_ROCKET1 turnobject PLAYER, LEFT applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement1 scall TrainerCameraGrunt1 ifequal TRUE, NoSecurityCamera scall PlaySecurityCameraSounds showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER turnobject PLAYER, RIGHT moveobject TEAMROCKETBASEB1F_ROCKET1, 25, 12 appear TEAMROCKETBASEB1F_ROCKET1 applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement7 scall TrainerCameraGrunt2 ifequal TRUE, NoSecurityCamera setevent EVENT_SECURITY_CAMERA_3 end SecurityCamera4: checkevent EVENT_SECURITY_CAMERA_4 iftrue NoSecurityCamera scall PlaySecurityCameraSounds checkevent EVENT_TEAM_ROCKET_BASE_POPULATION iftrue NoSecurityCamera showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER moveobject TEAMROCKETBASEB1F_ROCKET1, 17, 16 appear TEAMROCKETBASEB1F_ROCKET1 turnobject PLAYER, LEFT applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement1 scall TrainerCameraGrunt1 ifequal TRUE, NoSecurityCamera scall PlaySecurityCameraSounds showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER turnobject PLAYER, RIGHT moveobject TEAMROCKETBASEB1F_ROCKET1, 25, 11 appear TEAMROCKETBASEB1F_ROCKET1 applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement8 scall TrainerCameraGrunt2 ifequal TRUE, NoSecurityCamera setevent EVENT_SECURITY_CAMERA_4 end SecurityCamera5: checkevent EVENT_SECURITY_CAMERA_5 iftrue NoSecurityCamera scall PlaySecurityCameraSounds checkevent EVENT_TEAM_ROCKET_BASE_POPULATION iftrue NoSecurityCamera showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER moveobject TEAMROCKETBASEB1F_ROCKET1, 3, 16 appear TEAMROCKETBASEB1F_ROCKET1 turnobject PLAYER, LEFT applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement1 scall TrainerCameraGrunt1 ifequal TRUE, NoSecurityCamera scall PlaySecurityCameraSounds showemote EMOTE_SHOCK, PLAYER, 15 playmusic MUSIC_ROCKET_ENCOUNTER turnobject PLAYER, RIGHT moveobject TEAMROCKETBASEB1F_ROCKET1, 14, 16 appear TEAMROCKETBASEB1F_ROCKET1 applymovement TEAMROCKETBASEB1F_ROCKET1, SecurityCameraMovement9 scall TrainerCameraGrunt2 ifequal TRUE, NoSecurityCamera setevent EVENT_SECURITY_CAMERA_5 end NoSecurityCamera: end TrainerCameraGrunt1: opentext writetext CameraGrunt1SeenText waitbutton closetext winlosstext CameraGrunt1BeatenText, 0 setlasttalked TEAMROCKETBASEB1F_ROCKET1 loadtrainer GRUNTM, GRUNTM_20 startbattle disappear TEAMROCKETBASEB1F_ROCKET1 reloadmapafterbattle end TrainerCameraGrunt2: opentext writetext CameraGrunt2SeenText waitbutton closetext winlosstext CameraGrunt2BeatenText, 0 setlasttalked TEAMROCKETBASEB1F_ROCKET1 loadtrainer GRUNTM, GRUNTM_21 startbattle disappear TEAMROCKETBASEB1F_ROCKET1 reloadmapafterbattle end PlaySecurityCameraSounds: playsound SFX_LICK pause 10 playsound SFX_LICK pause 10 playsound SFX_LICK pause 10 playsound SFX_LICK pause 10 playsound SFX_LICK pause 10 playsound SFX_LICK end ExplodingTrap1: checkevent EVENT_EXPLODING_TRAP_1 iftrue NoExplodingTrap scall KoffingExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_1 end ExplodingTrap2: checkevent EVENT_EXPLODING_TRAP_2 iftrue NoExplodingTrap scall VoltorbExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_2 end ExplodingTrap3: checkevent EVENT_EXPLODING_TRAP_3 iftrue NoExplodingTrap scall GeodudeExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_3 end ExplodingTrap4: checkevent EVENT_EXPLODING_TRAP_4 iftrue NoExplodingTrap scall VoltorbExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_4 end ExplodingTrap5: checkevent EVENT_EXPLODING_TRAP_5 iftrue NoExplodingTrap scall GeodudeExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_5 end ExplodingTrap6: checkevent EVENT_EXPLODING_TRAP_6 iftrue NoExplodingTrap scall KoffingExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_6 end ExplodingTrap7: checkevent EVENT_EXPLODING_TRAP_7 iftrue NoExplodingTrap scall VoltorbExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_7 end ExplodingTrap8: checkevent EVENT_EXPLODING_TRAP_8 iftrue NoExplodingTrap scall KoffingExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_8 end ExplodingTrap9: checkevent EVENT_EXPLODING_TRAP_9 iftrue NoExplodingTrap scall KoffingExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_9 end ExplodingTrap10: checkevent EVENT_EXPLODING_TRAP_10 iftrue NoExplodingTrap scall VoltorbExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_10 end ExplodingTrap11: checkevent EVENT_EXPLODING_TRAP_11 iftrue NoExplodingTrap scall GeodudeExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_11 end ExplodingTrap12: checkevent EVENT_EXPLODING_TRAP_12 iftrue NoExplodingTrap scall GeodudeExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_12 end ExplodingTrap13: checkevent EVENT_EXPLODING_TRAP_13 iftrue NoExplodingTrap scall GeodudeExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_13 end ExplodingTrap14: checkevent EVENT_EXPLODING_TRAP_14 iftrue NoExplodingTrap scall KoffingExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_14 end ExplodingTrap15: checkevent EVENT_EXPLODING_TRAP_15 iftrue NoExplodingTrap scall VoltorbExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_15 end ExplodingTrap16: checkevent EVENT_EXPLODING_TRAP_16 iftrue NoExplodingTrap scall KoffingExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_16 end ExplodingTrap17: checkevent EVENT_EXPLODING_TRAP_17 iftrue NoExplodingTrap scall VoltorbExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_17 end ExplodingTrap18: checkevent EVENT_EXPLODING_TRAP_18 iftrue NoExplodingTrap scall GeodudeExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_18 end ExplodingTrap19: checkevent EVENT_EXPLODING_TRAP_19 iftrue NoExplodingTrap scall GeodudeExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_19 end ExplodingTrap20: checkevent EVENT_EXPLODING_TRAP_20 iftrue NoExplodingTrap scall VoltorbExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_20 end ExplodingTrap21: checkevent EVENT_EXPLODING_TRAP_21 iftrue NoExplodingTrap scall KoffingExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_21 end ExplodingTrap22: checkevent EVENT_EXPLODING_TRAP_22 iftrue NoExplodingTrap scall VoltorbExplodingTrap reloadmapafterbattle setevent EVENT_EXPLODING_TRAP_22 end VoltorbExplodingTrap: special FadeOutPalettes cry VOLTORB special FadeInPalettes setlasttalked -1 loadvar VAR_BATTLETYPE, BATTLETYPE_TRAP loadwildmon VOLTORB, 23 startbattle end GeodudeExplodingTrap: special FadeOutPalettes cry GEODUDE special FadeInPalettes setlasttalked -1 loadvar VAR_BATTLETYPE, BATTLETYPE_TRAP loadwildmon GEODUDE, 21 startbattle end KoffingExplodingTrap: special FadeOutPalettes cry KOFFING special FadeInPalettes setlasttalked -1 loadvar VAR_BATTLETYPE, BATTLETYPE_TRAP loadwildmon KOFFING, 21 startbattle end NoExplodingTrap: end TrainerScientistJed: trainer SCIENTIST, JED, EVENT_BEAT_SCIENTIST_JED, ScientistJedSeenText, ScientistJedBeatenText, 0, .Script .Script: endifjustbattled opentext writetext ScientistJedAfterBattleText waitbutton closetext end TrainerGruntM16: trainer GRUNTM, GRUNTM_16, EVENT_BEAT_ROCKET_GRUNTM_16, GruntM16SeenText, GruntM16BeatenText, 0, .Script .Script: endifjustbattled opentext writetext GruntM16AfterBattleText waitbutton closetext end TeamRocketBaseB1FSecurityCamera: jumptext TeamRocketBaseB1FSecurityCameraText TeamRocketBaseB1FBookshelf: jumpstd teamrocketoath TeamRocketBaseB1FSecretSwitch: opentext checkevent EVENT_TURNED_OFF_SECURITY_CAMERAS iftrue .SecretSwitchOff writetext TeamRocketBaseB1FSecretSwitchText playsound SFX_TALLY waitbutton closetext setevent EVENT_TURNED_OFF_SECURITY_CAMERAS setevent EVENT_SECURITY_CAMERA_1 setevent EVENT_SECURITY_CAMERA_2 setevent EVENT_SECURITY_CAMERA_3 setevent EVENT_SECURITY_CAMERA_4 setevent EVENT_SECURITY_CAMERA_5 end .SecretSwitchOff: writetext TeamRocketBaseB1FSwitchOffText waitbutton closetext end TeamRocketBaseB1FHyperPotion: itemball HYPER_POTION TeamRocketBaseB1FNugget: itemball NUGGET TeamRocketBaseB1FGuardSpec: itemball GUARD_SPEC TeamRocketBaseB1FHiddenRevive: hiddenitem REVIVE, EVENT_TEAM_ROCKET_BASE_B1F_HIDDEN_REVIVE SecurityCameraMovement1: big_step RIGHT big_step RIGHT big_step RIGHT big_step RIGHT step_end SecurityCameraMovement2: big_step UP big_step RIGHT big_step UP big_step UP big_step UP big_step UP turn_head RIGHT step_end SecurityCameraMovement3: big_step LEFT big_step LEFT big_step LEFT big_step UP big_step UP big_step UP big_step LEFT big_step LEFT step_end SecurityCameraMovement4: ; he jumps over a trap jump_step UP big_step RIGHT big_step UP big_step UP big_step UP turn_head RIGHT step_end SecurityCameraMovement5: big_step LEFT big_step LEFT big_step LEFT big_step UP big_step UP big_step LEFT big_step LEFT step_end SecurityCameraMovement6: big_step UP big_step UP big_step RIGHT big_step UP big_step UP big_step UP big_step LEFT step_end SecurityCameraMovement7: big_step UP big_step UP big_step UP big_step RIGHT big_step UP big_step UP big_step LEFT step_end SecurityCameraMovement8: big_step DOWN big_step DOWN big_step RIGHT big_step DOWN big_step DOWN big_step DOWN big_step LEFT big_step LEFT big_step LEFT step_end SecurityCameraMovement9: big_step LEFT big_step LEFT big_step LEFT big_step LEFT big_step LEFT step_end CameraGrunt1SeenText: text "Hey!" line "Intruder alert!" done CameraGrunt1BeatenText: text "Dang… I failed…" done CameraGrunt2SeenText: text "It's my turn!" line "There's no escape!" done CameraGrunt2BeatenText: text "Surveillance cams" line "are in the #MON" cont "statues." para "We'll keep appear-" line "ing until you trip" cont "a secret switch." done ScientistJedSeenText: text "This was once a" line "ninja hideout." para "There are traps to" line "confound intruders" cont "like you." done ScientistJedBeatenText: text "I get it…" done ScientistJedAfterBattleText: text "All right. I'll" line "divulge a secret" cont "about our hideout." para "That thing on the" line "floor up ahead is" cont "a warp panel." para "If you step on it," line "you'll be warped" para "back to the en-" line "trance." done GruntM16SeenText: text "Heheh. Feeling" line "lucky, punk?" para "Go ahead, take" line "another step." para "We've got traps" line "set in the floor!" done GruntM16BeatenText: text "Kaboom!" done GruntM16AfterBattleText: text "I don't even know" line "where the traps" cont "are planted." para "You'll just have" line "to collect your" cont "courage and walk." done TeamRocketBaseB1FSecurityCameraText: text "It's a PERSIAN" line "statue…" para "Its eyes are oddly" line "shiny." done TeamRocketBaseB1FSecretSwitchText: text "A secret switch!" line "Better press it." done TeamRocketBaseB1FSwitchOffText: text "The switch is" line "turned off." done TeamRocketBaseB1F_MapEvents: db 0, 0 ; filler db 4 ; warp events warp_event 27, 2, MAHOGANY_MART_1F, 3 warp_event 3, 14, TEAM_ROCKET_BASE_B2F, 1 warp_event 5, 15, TEAM_ROCKET_BASE_B1F, 4 warp_event 25, 2, TEAM_ROCKET_BASE_B1F, 3 db 30 ; coord events ; There are five security cameras in the base. ; Walking in front of one triggers two Rocket Grunts. coord_event 24, 2, SCENE_DEFAULT, SecurityCamera1a coord_event 24, 3, SCENE_DEFAULT, SecurityCamera1b coord_event 6, 2, SCENE_DEFAULT, SecurityCamera2a coord_event 6, 3, SCENE_DEFAULT, SecurityCamera2b coord_event 24, 6, SCENE_DEFAULT, SecurityCamera3a coord_event 24, 7, SCENE_DEFAULT, SecurityCamera3b coord_event 22, 16, SCENE_DEFAULT, SecurityCamera4 coord_event 8, 16, SCENE_DEFAULT, SecurityCamera5 ; There are spots on the floor that trigger a Pokémon battle. ; Each Pokémon (Voltorb, Koffing, Geodude) knows Selfdestruct. coord_event 2, 7, SCENE_DEFAULT, ExplodingTrap1 coord_event 3, 7, SCENE_DEFAULT, ExplodingTrap2 coord_event 4, 7, SCENE_DEFAULT, ExplodingTrap3 coord_event 1, 8, SCENE_DEFAULT, ExplodingTrap4 coord_event 3, 8, SCENE_DEFAULT, ExplodingTrap5 coord_event 5, 8, SCENE_DEFAULT, ExplodingTrap6 coord_event 3, 9, SCENE_DEFAULT, ExplodingTrap7 coord_event 4, 9, SCENE_DEFAULT, ExplodingTrap8 coord_event 1, 10, SCENE_DEFAULT, ExplodingTrap9 coord_event 2, 10, SCENE_DEFAULT, ExplodingTrap10 coord_event 3, 10, SCENE_DEFAULT, ExplodingTrap11 coord_event 5, 10, SCENE_DEFAULT, ExplodingTrap12 coord_event 2, 11, SCENE_DEFAULT, ExplodingTrap13 coord_event 4, 11, SCENE_DEFAULT, ExplodingTrap14 coord_event 1, 12, SCENE_DEFAULT, ExplodingTrap15 coord_event 2, 12, SCENE_DEFAULT, ExplodingTrap16 coord_event 4, 12, SCENE_DEFAULT, ExplodingTrap17 coord_event 5, 12, SCENE_DEFAULT, ExplodingTrap18 coord_event 1, 13, SCENE_DEFAULT, ExplodingTrap19 coord_event 3, 13, SCENE_DEFAULT, ExplodingTrap20 coord_event 4, 13, SCENE_DEFAULT, ExplodingTrap21 coord_event 5, 13, SCENE_DEFAULT, ExplodingTrap22 db 9 ; bg events bg_event 19, 11, BGEVENT_READ, TeamRocketBaseB1FSecretSwitch bg_event 24, 1, BGEVENT_UP, TeamRocketBaseB1FSecurityCamera bg_event 6, 1, BGEVENT_UP, TeamRocketBaseB1FSecurityCamera bg_event 8, 15, BGEVENT_UP, TeamRocketBaseB1FSecurityCamera bg_event 22, 15, BGEVENT_UP, TeamRocketBaseB1FSecurityCamera bg_event 24, 5, BGEVENT_UP, TeamRocketBaseB1FSecurityCamera bg_event 20, 11, BGEVENT_READ, TeamRocketBaseB1FBookshelf bg_event 21, 11, BGEVENT_READ, TeamRocketBaseB1FBookshelf bg_event 3, 11, BGEVENT_ITEM, TeamRocketBaseB1FHiddenRevive db 6 ; object events object_event 0, 0, SPRITE_ROCKET, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, ObjectEvent, EVENT_TEAM_ROCKET_BASE_SECURITY_GRUNTS object_event 2, 4, SPRITE_ROCKET, SPRITEMOVEDATA_STANDING_RIGHT, 0, 0, -1, -1, 0, OBJECTTYPE_TRAINER, 3, TrainerGruntM16, EVENT_TEAM_ROCKET_BASE_POPULATION object_event 18, 12, SPRITE_SCIENTIST, SPRITEMOVEDATA_STANDING_LEFT, 0, 0, -1, -1, PAL_NPC_BLUE, OBJECTTYPE_TRAINER, 3, TrainerScientistJed, EVENT_TEAM_ROCKET_BASE_POPULATION object_event 27, 6, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, TeamRocketBaseB1FHyperPotion, EVENT_TEAM_ROCKET_BASE_B1F_HYPER_POTION object_event 14, 15, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, TeamRocketBaseB1FNugget, EVENT_TEAM_ROCKET_BASE_B1F_NUGGET object_event 21, 12, SPRITE_POKE_BALL, SPRITEMOVEDATA_STILL, 0, 0, -1, -1, 0, OBJECTTYPE_ITEMBALL, 0, TeamRocketBaseB1FGuardSpec, EVENT_TEAM_ROCKET_BASE_B1F_GUARD_SPEC
25.324051
175
0.847496
9d9838ef0e2dae4f8c9640a757fc95fc9aa23950
488
asm
Assembly
programs/oeis/129/A129819.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/129/A129819.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/129/A129819.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A129819: Antidiagonal sums of triangular array T: T(j,k) = (k+1)/2 for odd k, T(j,k) = 0 for k = 0, T(j,k) = j+1-k/2 for even k > 0; 0 <= k <= j. ; 0,0,1,1,3,4,7,8,12,14,19,21,27,30,37,40,48,52,61,65,75,80,91,96,108,114,127,133,147,154,169,176,192,200,217,225,243,252,271,280,300,310,331,341,363,374,397,408,432,444,469,481,507,520,547,560,588,602,631 mul $0,3 div $0,2 pow $0,2 add $0,9 mov $1,12 mov $2,12 lpb $0 add $1,6 add $1,$0 mov $0,6 div $1,$2 add $1,2 lpe sub $1,4
27.111111
205
0.606557
76c869e1e5151017a74479dc6dc110323d6f091c
680
asm
Assembly
programs/oeis/187/A187950.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/187/A187950.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/187/A187950.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A187950: [nr+kr] - [nr] - [kr], where r = (1+sqrt(5))/2, k = 4, [.]=floor. ; 1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,0 add $0,4 cal $0,188014 ; a(n) = [nr]-[nr-kr]-[kr], where r=(1+sqrt(5))/2, k=4, [ ]=floor. mov $1,$0
97.142857
501
0.492647
e2acc7d4a5563afa07979f88b47204fccbffba2a
1,907
asm
Assembly
snapgear_linux/lib/libgmp/mpn/sparc32/umul.asm
impedimentToProgress/UCI-BlueChip
53e5d48b79079eaf60d42f7cb65bb795743d19fc
[ "MIT" ]
null
null
null
snapgear_linux/lib/libgmp/mpn/sparc32/umul.asm
impedimentToProgress/UCI-BlueChip
53e5d48b79079eaf60d42f7cb65bb795743d19fc
[ "MIT" ]
null
null
null
snapgear_linux/lib/libgmp/mpn/sparc32/umul.asm
impedimentToProgress/UCI-BlueChip
53e5d48b79079eaf60d42f7cb65bb795743d19fc
[ "MIT" ]
3
2016-06-13T13:20:56.000Z
2019-12-05T02:31:23.000Z
dnl SPARC __umul_ppmm -- support for longlong.h for non-gcc. dnl Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc. dnl This file is part of the GNU MP Library. dnl The GNU MP Library is free software; you can redistribute it and/or modify dnl it under the terms of the GNU Library General Public License as published dnl by the Free Software Foundation; either version 2 of the License, or (at dnl your option) any later version. dnl The GNU MP Library is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public dnl License for more details. dnl You should have received a copy of the GNU Library General Public License dnl along with the GNU MP Library; see the file COPYING.LIB. If not, write to dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, dnl MA 02111-1307, USA. include(`../config.m4') ASM_START() PROLOGUE(__umul_ppmm) wr %g0,%o1,%y sra %o2,31,%g2 C Don't move this insn and %o1,%g2,%g2 C Don't move this insn andcc %g0,0,%g1 C Don't move this insn mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,%o2,%g1 mulscc %g1,0,%g1 rd %y,%g3 st %g3,[%o0] retl add %g1,%g2,%o0 EPILOGUE(__umul_ppmm)
27.637681
79
0.694809
5119599cea8ab6f1c582fb4fe216abd6357a78f3
133
asm
Assembly
sw/552tests/inst_tests/xori_13.asm
JPShen-UWM/ThreadKraken
849c510531f28e36d3469535737b2120bd774935
[ "MIT" ]
1
2022-02-15T16:03:25.000Z
2022-02-15T16:03:25.000Z
sw/552tests/inst_tests/xori_13.asm
JPShen-UWM/ThreadKraken
849c510531f28e36d3469535737b2120bd774935
[ "MIT" ]
null
null
null
sw/552tests/inst_tests/xori_13.asm
JPShen-UWM/ThreadKraken
849c510531f28e36d3469535737b2120bd774935
[ "MIT" ]
null
null
null
// Original test: ./shojaei/hw4/problem6/xori_6.asm // Author: shojaei // Test source code follows lbi r1, 224 xori r1, r1, 0 halt
14.777778
51
0.706767
513cf79971eb8637ab87fd59673b655feab2d04b
1,958
asm
Assembly
programs/oeis/080/A080143.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/080/A080143.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/080/A080143.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A080143: a(n) = F(3)*F(n)*F(n+1) + F(4)*F(n+1)^2 - F(4) if n even, F(3)*F(n)*F(n+1) + F(4)*F(n+1)^2 if n odd, where F(n) is the n-th Fibonacci number (A000045). ; 0,5,13,39,102,272,712,1869,4893,12815,33550,87840,229968,602069,1576237,4126647,10803702,28284464,74049688,193864605,507544125,1328767775,3478759198,9107509824,23843770272,62423800997,163427632717,427859097159,1120149658758,2932589879120,7677619978600,20100270056685,52623190191453,137769300517679,360684711361582,944284833567072,2472169789339632,6472224534451829,16944503814015853,44361286907595735,116139356908771350,304056783818718320,796030994547383608,2084036199823432509,5456077604922913917,14284196614945309247,37396512239913013822,97905340104793732224,256319508074468182848,671053184118610816325,1756840044281364266125,4599466948725481982055,12041560801895081680038,31525215456959763058064,82534085568984207494152,216077041249992859424397,565697038180994370779037,1481014073292990252912719,3877345181697976387959118,10151021471800938910964640,26575719233704840344934800,69576136229313582123839765,182152689454235906026584493,476881932133394135955913719,1248493106945946501841156662,3268597388704445369567556272,8557299059167389606861512152,22403299788797723451016980189,58652600307225780746189428413,153554501132879618787551305055,402010903091413075616464486750,1052478208141359608061842155200,2755423721332665748569061978848,7213792955856637637645343781349,18885955146237247164366969365197,49444072482855103855455564314247,129446262302328064401999723577542,338894714424129089350543606418384,887237880970059203649631095677608,2322818928486048521598349680614445,6081218904488086361145417946165725,15920837784978210561837904157882735,41681294450446545324368294527482478,109123045566361425411266979424564704,285687842248637730909432643746211632,747940481179551767317030951814070197 lpb $0 mov $2,$0 trn $0,2 seq $2,48575 ; Pisot sequences L(2,5), E(2,5). add $1,$2 lpe mov $0,$1
178
1,688
0.890705
5920910ecf3bd14ee7e4f943e43a1d156aeb0fc6
564
asm
Assembly
programs/oeis/110/A110667.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/110/A110667.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/110/A110667.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A110667: Sequence is {a(2,n)}, where a(m,n) is defined at sequence A110665. ; 0,1,2,0,-6,-12,-12,-5,2,0,-12,-24,-24,-11,2,0,-18,-36,-36,-17,2,0,-24,-48,-48,-23,2,0,-30,-60,-60,-29,2,0,-36,-72,-72,-35,2,0,-42,-84,-84,-41,2,0,-48,-96,-96,-47,2,0,-54,-108,-108,-53,2,0,-60,-120,-120,-59,2,0,-66,-132,-132,-65,2,0,-72,-144,-144,-71,2,0,-78,-156,-156,-77,2,0,-84,-168,-168,-83,2,0,-90,-180,-180,-89,2,0,-96,-192,-192,-95,2,0 lpb $0 mov $2,$0 sub $0,1 seq $2,110666 ; Sequence is {a(1,n)}, where a(m,n) is defined at sequence A110665. add $1,$2 lpe mov $0,$1
51.272727
343
0.560284
b3eb4ae8d89aa89af366f95cbe61429278c2e389
31,016
asm
Assembly
csgocheat/CV/Via ASM module/VirtualizerSDKCustomVmMacros.asm
garryhvh420/e_xyz
668d8c8c2b7ccfc3bae9e321b1a50379a5e33ec9
[ "Apache-2.0" ]
null
null
null
csgocheat/CV/Via ASM module/VirtualizerSDKCustomVmMacros.asm
garryhvh420/e_xyz
668d8c8c2b7ccfc3bae9e321b1a50379a5e33ec9
[ "Apache-2.0" ]
null
null
null
csgocheat/CV/Via ASM module/VirtualizerSDKCustomVmMacros.asm
garryhvh420/e_xyz
668d8c8c2b7ccfc3bae9e321b1a50379a5e33ec9
[ "Apache-2.0" ]
null
null
null
; **************************************************************************** ; Module: VirtualizerSDKCustomVmMacros.asm ; Description: Another way to link with the SecureEngine SDK via an ASM module ; ; Author/s: Oreans Technologies ; (c) 2015 Oreans Technologies ; ; --- File generated automatically from Oreans VM Generator (16/6/2015) --- ; **************************************************************************** IFDEF RAX ELSE .586 .model flat,stdcall option casemap:none ENDIF ; **************************************************************************** ; Constants ; **************************************************************************** .CONST ; **************************************************************************** ; Data Segment ; **************************************************************************** .DATA ; **************************************************************************** ; Code Segment ; **************************************************************************** .CODE IFDEF RAX ; **************************************************************************** ; VIRTUALIZER_TIGER_WHITE definition ; **************************************************************************** VIRTUALIZER_TIGER_WHITE_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 103 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_TIGER_WHITE_START_ASM64 ENDP VIRTUALIZER_TIGER_WHITE_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 503 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_TIGER_WHITE_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_TIGER_RED definition ; **************************************************************************** VIRTUALIZER_TIGER_RED_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 104 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_TIGER_RED_START_ASM64 ENDP VIRTUALIZER_TIGER_RED_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 504 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_TIGER_RED_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_TIGER_BLACK definition ; **************************************************************************** VIRTUALIZER_TIGER_BLACK_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 105 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_TIGER_BLACK_START_ASM64 ENDP VIRTUALIZER_TIGER_BLACK_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 505 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_TIGER_BLACK_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_FISH_WHITE definition ; **************************************************************************** VIRTUALIZER_FISH_WHITE_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 107 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_FISH_WHITE_START_ASM64 ENDP VIRTUALIZER_FISH_WHITE_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 507 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_FISH_WHITE_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_FISH_RED definition ; **************************************************************************** VIRTUALIZER_FISH_RED_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 109 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_FISH_RED_START_ASM64 ENDP VIRTUALIZER_FISH_RED_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 509 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_FISH_RED_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_FISH_BLACK definition ; **************************************************************************** VIRTUALIZER_FISH_BLACK_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 111 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_FISH_BLACK_START_ASM64 ENDP VIRTUALIZER_FISH_BLACK_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 511 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_FISH_BLACK_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_PUMA_WHITE definition ; **************************************************************************** VIRTUALIZER_PUMA_WHITE_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 113 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_PUMA_WHITE_START_ASM64 ENDP VIRTUALIZER_PUMA_WHITE_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 513 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_PUMA_WHITE_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_PUMA_RED definition ; **************************************************************************** VIRTUALIZER_PUMA_RED_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 115 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_PUMA_RED_START_ASM64 ENDP VIRTUALIZER_PUMA_RED_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 515 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_PUMA_RED_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_PUMA_BLACK definition ; **************************************************************************** VIRTUALIZER_PUMA_BLACK_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 117 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_PUMA_BLACK_START_ASM64 ENDP VIRTUALIZER_PUMA_BLACK_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 517 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_PUMA_BLACK_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_SHARK_WHITE definition ; **************************************************************************** VIRTUALIZER_SHARK_WHITE_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 119 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_SHARK_WHITE_START_ASM64 ENDP VIRTUALIZER_SHARK_WHITE_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 519 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_SHARK_WHITE_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_SHARK_RED definition ; **************************************************************************** VIRTUALIZER_SHARK_RED_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 121 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_SHARK_RED_START_ASM64 ENDP VIRTUALIZER_SHARK_RED_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 521 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_SHARK_RED_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_SHARK_BLACK definition ; **************************************************************************** VIRTUALIZER_SHARK_BLACK_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 123 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_SHARK_BLACK_START_ASM64 ENDP VIRTUALIZER_SHARK_BLACK_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 523 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_SHARK_BLACK_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_DOLPHIN_WHITE definition ; **************************************************************************** VIRTUALIZER_DOLPHIN_WHITE_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 135 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_DOLPHIN_WHITE_START_ASM64 ENDP VIRTUALIZER_DOLPHIN_WHITE_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 535 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_DOLPHIN_WHITE_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_DOLPHIN_RED definition ; **************************************************************************** VIRTUALIZER_DOLPHIN_RED_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 137 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_DOLPHIN_RED_START_ASM64 ENDP VIRTUALIZER_DOLPHIN_RED_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 537 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_DOLPHIN_RED_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_DOLPHIN_BLACK definition ; **************************************************************************** VIRTUALIZER_DOLPHIN_BLACK_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 139 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_DOLPHIN_BLACK_START_ASM64 ENDP VIRTUALIZER_DOLPHIN_BLACK_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 539 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_DOLPHIN_BLACK_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_EAGLE_WHITE definition ; **************************************************************************** VIRTUALIZER_EAGLE_WHITE_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 147 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_EAGLE_WHITE_START_ASM64 ENDP VIRTUALIZER_EAGLE_WHITE_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 547 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_EAGLE_WHITE_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_EAGLE_RED definition ; **************************************************************************** VIRTUALIZER_EAGLE_RED_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 149 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_EAGLE_RED_START_ASM64 ENDP VIRTUALIZER_EAGLE_RED_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 549 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_EAGLE_RED_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_EAGLE_BLACK definition ; **************************************************************************** VIRTUALIZER_EAGLE_BLACK_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 151 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_EAGLE_BLACK_START_ASM64 ENDP VIRTUALIZER_EAGLE_BLACK_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 551 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_EAGLE_BLACK_END_ASM64 ENDP ; **************************************************************************** ; VIRTUALIZER_MUTATE_ONLY definition ; **************************************************************************** VIRTUALIZER_MUTATE_ONLY_START_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 16 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_MUTATE_ONLY_START_ASM64 ENDP VIRTUALIZER_MUTATE_ONLY_END_ASM64 PROC push rax push rbx push rcx mov eax, 'CV' mov ebx, 17 mov ecx, 'CV' add ebx, eax add ecx, eax pop rcx pop rbx pop rax ret VIRTUALIZER_MUTATE_ONLY_END_ASM64 ENDP ELSE ; **************************************************************************** ; VIRTUALIZER_TIGER_WHITE definition ; **************************************************************************** VIRTUALIZER_TIGER_WHITE_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 100 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_TIGER_WHITE_START_ASM32 ENDP VIRTUALIZER_TIGER_WHITE_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 500 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_TIGER_WHITE_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_TIGER_RED definition ; **************************************************************************** VIRTUALIZER_TIGER_RED_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 101 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_TIGER_RED_START_ASM32 ENDP VIRTUALIZER_TIGER_RED_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 501 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_TIGER_RED_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_TIGER_BLACK definition ; **************************************************************************** VIRTUALIZER_TIGER_BLACK_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 102 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_TIGER_BLACK_START_ASM32 ENDP VIRTUALIZER_TIGER_BLACK_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 502 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_TIGER_BLACK_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_FISH_WHITE definition ; **************************************************************************** VIRTUALIZER_FISH_WHITE_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 106 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_FISH_WHITE_START_ASM32 ENDP VIRTUALIZER_FISH_WHITE_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 506 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_FISH_WHITE_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_FISH_RED definition ; **************************************************************************** VIRTUALIZER_FISH_RED_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 108 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_FISH_RED_START_ASM32 ENDP VIRTUALIZER_FISH_RED_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 508 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_FISH_RED_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_FISH_BLACK definition ; **************************************************************************** VIRTUALIZER_FISH_BLACK_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 110 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_FISH_BLACK_START_ASM32 ENDP VIRTUALIZER_FISH_BLACK_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 510 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_FISH_BLACK_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_PUMA_WHITE definition ; **************************************************************************** VIRTUALIZER_PUMA_WHITE_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 112 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_PUMA_WHITE_START_ASM32 ENDP VIRTUALIZER_PUMA_WHITE_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 512 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_PUMA_WHITE_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_PUMA_RED definition ; **************************************************************************** VIRTUALIZER_PUMA_RED_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 114 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_PUMA_RED_START_ASM32 ENDP VIRTUALIZER_PUMA_RED_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 514 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_PUMA_RED_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_PUMA_BLACK definition ; **************************************************************************** VIRTUALIZER_PUMA_BLACK_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 116 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_PUMA_BLACK_START_ASM32 ENDP VIRTUALIZER_PUMA_BLACK_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 516 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_PUMA_BLACK_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_SHARK_WHITE definition ; **************************************************************************** VIRTUALIZER_SHARK_WHITE_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 118 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_SHARK_WHITE_START_ASM32 ENDP VIRTUALIZER_SHARK_WHITE_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 518 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_SHARK_WHITE_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_SHARK_RED definition ; **************************************************************************** VIRTUALIZER_SHARK_RED_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 120 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_SHARK_RED_START_ASM32 ENDP VIRTUALIZER_SHARK_RED_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 520 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_SHARK_RED_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_SHARK_BLACK definition ; **************************************************************************** VIRTUALIZER_SHARK_BLACK_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 122 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_SHARK_BLACK_START_ASM32 ENDP VIRTUALIZER_SHARK_BLACK_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 522 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_SHARK_BLACK_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_DOLPHIN_WHITE definition ; **************************************************************************** VIRTUALIZER_DOLPHIN_WHITE_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 134 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_DOLPHIN_WHITE_START_ASM32 ENDP VIRTUALIZER_DOLPHIN_WHITE_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 534 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_DOLPHIN_WHITE_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_DOLPHIN_RED definition ; **************************************************************************** VIRTUALIZER_DOLPHIN_RED_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 136 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_DOLPHIN_RED_START_ASM32 ENDP VIRTUALIZER_DOLPHIN_RED_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 536 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_DOLPHIN_RED_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_DOLPHIN_BLACK definition ; **************************************************************************** VIRTUALIZER_DOLPHIN_BLACK_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 138 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_DOLPHIN_BLACK_START_ASM32 ENDP VIRTUALIZER_DOLPHIN_BLACK_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 538 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_DOLPHIN_BLACK_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_EAGLE_WHITE definition ; **************************************************************************** VIRTUALIZER_EAGLE_WHITE_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 146 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_EAGLE_WHITE_START_ASM32 ENDP VIRTUALIZER_EAGLE_WHITE_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 546 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_EAGLE_WHITE_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_EAGLE_RED definition ; **************************************************************************** VIRTUALIZER_EAGLE_RED_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 148 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_EAGLE_RED_START_ASM32 ENDP VIRTUALIZER_EAGLE_RED_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 548 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_EAGLE_RED_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_EAGLE_BLACK definition ; **************************************************************************** VIRTUALIZER_EAGLE_BLACK_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 150 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_EAGLE_BLACK_START_ASM32 ENDP VIRTUALIZER_EAGLE_BLACK_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 550 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_EAGLE_BLACK_END_ASM32 ENDP ; **************************************************************************** ; VIRTUALIZER_MUTATE_ONLY definition ; **************************************************************************** VIRTUALIZER_MUTATE_ONLY_START_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 16 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_MUTATE_ONLY_START_ASM32 ENDP VIRTUALIZER_MUTATE_ONLY_END_ASM32 PROC push eax push ebx push ecx mov eax, 'CV' mov ebx, 17 mov ecx, 'CV' add ebx, eax add ecx, eax pop ecx pop ebx pop eax ret VIRTUALIZER_MUTATE_ONLY_END_ASM32 ENDP ENDIF END
18.439952
78
0.441224
a27395e477b4ab73ca12f6f2a862131603dfed82
9,981
asm
Assembly
src/args.asm
cmounce/all-purpose-tsr
196ad7912a425bb9d2a785af5339970a53ad735a
[ "MIT" ]
null
null
null
src/args.asm
cmounce/all-purpose-tsr
196ad7912a425bb9d2a785af5339970a53ad735a
[ "MIT" ]
null
null
null
src/args.asm
cmounce/all-purpose-tsr
196ad7912a425bb9d2a785af5339970a53ad735a
[ "MIT" ]
null
null
null
;; Code for parsing command-line arguments %include 'macros.asm' %include 'print.asm' %include 'string.asm' ;------------------------------------------------------------------------------- ; Consts ;------------------------------------------------------------------------------- ; The command-line string in the PSP. arg_string_length equ 80h arg_string_contents equ 81h ;------------------------------------------------------------------------------- ; Strings ;------------------------------------------------------------------------------- section .data ; Define a list of all the subcommand strings, with a named label for each one. ; These labels are used like enum values, allowing storage in registers and ; convenient comparisons: e.g., does AX == subcommands.install? %macro db_subcommand 1 %deftok %%t %1 .%[%%t]: db_wstring %1 %endmacro subcommands: ; Each subcommand begins with a different letter, in order to allow the ; user to make single-character abbreviations (e.g., "foo i" to install). db_subcommand "about" db_subcommand "install" db_subcommand "new" db_subcommand "preview" db_subcommand "reset" db_subcommand "uninstall" dw 0 ; end of list ; Define some boolean flags arg_flags: .help: db_wstring "/?" ; Define some key-value options arg_options: .blink: db_wstring "/b" .font: db_wstring "/f" .font2: db_wstring "/f2" .output: db_wstring "/o" .palette: db_wstring "/p" ; Non-filename values for certain options arg_option_values: ; Blink value .off: db_wstring "off" .on: db_wstring "on" ;------------------------------------------------------------------------------- ; Parsed data ;------------------------------------------------------------------------------- section .bss ; String list representing the tokenized argument string. ; How much space do we need? We could have up to 127 tokens, each token taking ; up three bytes (2 byte string header, 1 byte content). Additionally, the list ; itself is terminated with an empty string (2 byte header, no content). MAX_TOKENS equ 127 ; Worst case: arg string is nothing but forward-slashes arg_tokens: resb MAX_TOKENS * 3 + 2 ; Pointer to a wstring from the subcommands list, e.g., subcommands.install parsed_subcommand: resw 1 ; Booleans representing flags that are present/absent parsed_flags: .help: resb 1 ; Pointers to wstrings representing option values parsed_options: .blink: resw 1 .font: resw 1 .font2: resw 1 .output: resw 1 .palette: resw 1 ;------------------------------------------------------------------------------- ; Code ;------------------------------------------------------------------------------- section .text ; Read command line flags and initialize status variables accordingly. ; ; This is the main subroutine for parsing the command line, from start to ; end. It takes no parameters and returns nothing: it just mutates the global ; variables to match what the command line args specify. parse_command_line: push si ; Set up SI = start of token list call tokenize_arg_string ; arg_tokens = string list of tokens mov si, arg_tokens ; SI = first token ; Parse first word as a subcommand, if it exists call parse_subcommand ; Consume all remaining arguments while_condition cmp word [si], 0 begin_while ne call parse_argument begin_if c die EXIT_BAD_ARGS, "Unknown argument: %s", si end_if end_while pop si ret ;------------------------------------------------------------------------------- ; Internal helpers: tokenization ;------------------------------------------------------------------------------- ; Tokenize the PSP argument string and store the result in arg_tokens. tokenize_arg_string: push bx push di push si ; Set up all our pointers mov si, arg_string_contents ; SI = argument string to read from mov bl, [arg_string_length] ; BL = number of characters in string mov di, arg_tokens ; DI = token list to write to ; Loop over each char in the arg string while_condition cmp bl, 0 ; Loop while we have characters remaining begin_while ne ; Read next character into AL lodsb dec bl ; Whitespace and '=' are never included in tokens. ; If we see these, skip the character and start a new token. call is_token_separator begin_if e call .flush_current_token jmp continue end_if ; Forward slashes always indicate the start of a new token. cmp al, '/' begin_if e call .flush_current_token end_if ; Append the character to the current token in DI. call concat_byte_wstring end_while ; Terminate the list if it isn't terminated already call .flush_current_token pop si pop di pop bx ret ; Helper: Make DI point to an empty string at the end of the token list. ; This is a no-op if DI already points to an empty string. .flush_current_token: cmp word [di], 0 begin_if ne next_wstring di ; Advance DI to point after current contents mov word [di], 0 ; Write length header for empty string end_if ret ; Sets ZF if the character in AL is a token separator. ; ; Token separators are spaces, tabs, and any other ASCII control characters. ; Additionally, '=' is counted as a separator character: this is so that ; arguments like "/foo=bar" are separated into two tokens. ; ; Clobbers no registers! is_token_separator: cmp al, ' ' ; Is it an ASCII control character or a space? jbe .true cmp al, '=' ; Is it a '='? ret .true: cmp al, al ret ;------------------------------------------------------------------------------- ; Internal helpers: recursive-descent parsing ;------------------------------------------------------------------------------- ; Tries to consume the token in SI as a subcommand. ; ; On success: sets parsed_subcommand and consumes the token, advancing SI. ; On failure: leaves parsed_subcommand untouched (should be zero). parse_subcommand: push di mov di, subcommands ; Loop DI = each possible subcommand while_condition cmp word [di], 0 ; Break if we run out of subcommands begin_while ne call icmp_wstring ; If SI == DI, this is a full subcommand. je .found call icmp_short_subcommand ; If the first letters of SI and DI match, je .found ; this is an abbreviated subcommand. next_wstring di ; Otherwise, advance DI to the next one. end_while ; No matches for subcommand found jmp .ret .found: mov [parsed_subcommand], di ; SI is a valid subcommand. Record it and next_wstring si ; advance to the next token. .ret: pop di ret ; Returns whether SI is a one-character abbreviation of the string in DI. ; ; Examples: "i" or "I" would match "install", but "x" or "inst" would not. ; Sets ZF if there's a match. icmp_short_subcommand: cmp word [si], 1 ; Is the input string one character long? jne .ret mov al, [si + 2] ; Get the only character of SI call tolower_accumulator mov ah, al mov al, [di + 2] ; Get first character of DI call tolower_accumulator cmp ah, al ; Do a case-insensitive comparison .ret: ret ; Tries to consume 1-2 tokens from SI as a single argument. ; ; 1-token args are boolean flags, e.g., "/?". ; 2-token args are key-value options, e.g., "/foo=bar" or "/foo bar". ; Sets CF on failure. parse_argument: ; Try to parse SI as a 1-token flag call parse_flag begin_if nc ret ; Success: forward CF = 0 end_if ; Try to parse SI as the start of a key-value option call parse_option begin_if nc ret ; Success: forward CF = 0 end_if stc ; Failed to parse anything ret ; Tries to consume a 1-token boolean flag from SI, e.g., "/?". ; ; Sets CF on failure. parse_flag: push di ; Compare SI against each of the flag strings mov di, arg_flags.help call icmp_wstring begin_if e mov byte [parsed_flags.help], 1 else stc ; Error: flag not recognized jmp .ret end_if ; Found a match: consume the matched token and return success next_wstring si clc .ret: pop di ret ; Tries to consume a 2-token option from SI, e.g., "/foo=bar" ; ; Sets CF on failure. parse_option: push bx push di ; Set SI = option key, BX = option value cmp word [si], 0 je .failure ; Not enough tokens (0) mov bx, si next_wstring bx cmp word [bx], 0 je .failure ; Not enough tokens (1) ; Compare SI against each of the option strings mov di, arg_options.blink call icmp_wstring begin_if e mov [parsed_options.blink], bx else mov di, arg_options.font call icmp_wstring if e mov [parsed_options.font], bx else mov di, arg_options.font2 call icmp_wstring if e mov [parsed_options.font2], bx else mov di, arg_options.output call icmp_wstring if e mov [parsed_options.output], bx else mov di, arg_options.palette call icmp_wstring if e mov [parsed_options.palette], bx else jmp .failure end_if ; We found a match: consume both key and value tokens mov si, bx ; SI = value token next_wstring si ; SI = token following value token clc ; Return success .ret: pop di pop bx ret .failure: stc jmp .ret
27.879888
80
0.579401
0cfd8353f0a238ed1d71014e0ee96d3cfaa200ad
3,654
asm
Assembly
src/crtc_patch.asm
sikorama/still_scrolling
e8305a3cf4a58e27c213295aa55c2049f385ebc1
[ "MIT" ]
null
null
null
src/crtc_patch.asm
sikorama/still_scrolling
e8305a3cf4a58e27c213295aa55c2049f385ebc1
[ "MIT" ]
null
null
null
src/crtc_patch.asm
sikorama/still_scrolling
e8305a3cf4a58e27c213295aa55c2049f385ebc1
[ "MIT" ]
null
null
null
; 0: Test VBL ; 1: Test Reg12/13 TEST034 EQU 0 ; http://quasar.cpcscene.net/doku.php?id=coding:test_crtc ; Il faudrait tester le CRTC4 aussi, car il faudrait le patcher aussi ; Pour le CRTC2 par contre... TestCRTC: if PATCH_MODE==2 print "Pas de Patch CRTC" else if PATCH_MODE==0 ; Test si CRTC 1 ou 2 if TEST034==2 TestLongueurVBL print "Test VBL" ld b,#f5 ; Boucle d'attente de la VBL SyncTLV1 in a,(c) rra jr nc,synctlv1 NoSyncTLV1 in a,(c) ; Pre-Synchronisation rra ; Attente de la fin de la VBL jr c,nosynctlv1 SyncTLV2 in a,(c) ; Deuxième boucle d'attente rra ; de la VBL jr nc,synctlv2 ld hl,140 ; Boucle d'attente de WaitTLV dec hl ; 983 micro-secondes ld a,h or l jr nz,waittlv in a,(c) ; Test de la VBL rra ; Si elle est encore en cours ret NC ; type 0,3,4 = On ne fait rien, c'est sensé marcher endif ; Autres test possible if TEST034==1 TestBFxx print "Test BFXX" ld bc,#bc0c ; On sélectionne le reg12 out (c),c ld b,#bf ; On lit sa valeur in a,(c) ld c,a ; si les bits 6 ou 7 sont and #3f ; non nuls alors on a un cp c ; problème ret nz ; emulateur alien => on ne fait rien ld a,c or a ; si la valeur est non nulle ret nz ; alors on a un type 0,3,4 ld bc,#bc0d out (c),c ; On sélectionne le reg13 ld b,#bf in a,(c) ; On lit sa valeur or a ; Si la valeur est non nulle ret nz ; alors on a un type 0,3,4 endif ; Sinon on a un type 1,2... si c'est 1 on devrait pouvoir patcher ; Si c'est 2, on doit désactiver les split CRTC, rester en raster ; Ou quitter... ; Test CRTC 1 ; Test basé sur la détection du balayage des lignes hors border ; Permet d'identifier le type 1 ; Bug connu rarissime: si reg6=0 ou reg6>reg4+1 alors le test est faussé ! TestBorder: print "Test Border" ld b,#f5 NoSyncTDB1 in a,(c) ; On attend un peu pour etre rra ; sur d'etre sortis de la VBL jr c,nosynctdb1 ; en cours du test précédent SyncTDB1 in a,(c) ; On attend le début d'une rra ; nouvelle VBL jr nc,synctdb1 NoSyncTDB2 in a,(c) ; On attend la fin de la VBL rra jr c,nosynctdb2 ld ix,0 ; On met @ zéro les compteurs ld hl,0 ; de changement de valeur (IX), ld d,l ; de ligne hors VBL (HL) et ld e,d ; de ligne hors border (DE) ld b,#be in a,(c) and 32 ld c,a SyncTDB2 inc de ; On attend la VBL suivante ld b,#be ; en mettant @ jour les divers in a,(c) ; compteurs and 32 jr nz,border inc hl ; Ligne de paper ! jr noborder Border ds 4 NoBorder cp c jr z,nochange inc ix ; Transition paper/border ! jr change NoChange ds 5 Change ld c,a ds 27 ld b,#f5 in a,(c) rra jr nc,synctdb2 ; On boucle en attendant la VBL db #dd: ld a,l ; Si on n'a pas eu juste deux transitions alors ce n'est cp 2 ; ret nz ; pas un type 1 endif ; Type 1: on patche le code split CRTC ; => il faudrait tester si c'est pas un type2 ; auquel cas, on arrete (ou on fait que du split raster) patch_crtc1: ; c = Numero du registre ld bc,#0B06 ; b = 11 entrées dans la table ld de,4 ; Pas ld HL,scr_bloc+3 patch_tab: ld (hl),c add hl,de djnz patch_tab ; 2 octets pour les valeur a envoyer au reg ;ld a,e ; e=4 ld a,#7f ld (CRTC_PATCH2+1),a xor a ld (CRTC_PATCH1+1),a ; Valeur a rétablir? ret endif
21.88024
74
0.593049
ac488fdc59e5ba26f2cafdc973f0cdde47d66bca
560
asm
Assembly
libsrc/enterprise/exos_create_channel.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
38
2021-06-18T12:56:15.000Z
2022-03-12T20:38:40.000Z
libsrc/enterprise/exos_create_channel.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
2
2021-06-20T16:28:12.000Z
2021-11-17T21:33:56.000Z
libsrc/enterprise/exos_create_channel.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
6
2021-06-18T18:18:36.000Z
2021-12-22T08:01:32.000Z
; ; Enterprise 64/128 specific routines ; by Stefano Bodrato, 2011 ; ; exos_create_channel(unsigned char ch_number, char *device); ; ; ; $Id: exos_create_channel.asm,v 1.4 2016-06-19 20:17:32 dom Exp $ ; SECTION code_clib PUBLIC exos_create_channel PUBLIC _exos_create_channel EXTERN exos_create_channel_callee EXTERN ASMDISP_EXOS_CREATE_CHANNEL_CALLEE exos_create_channel: _exos_create_channel: pop bc pop de pop hl push hl push de push bc jp exos_create_channel_callee + ASMDISP_EXOS_CREATE_CHANNEL_CALLEE
18.064516
69
0.751786
9ad109ee56f524aa4b2adbf32d270d5699b9affa
4,944
asm
Assembly
sdk-6.5.16/tools/led/example/sdk56636.asm
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.16/tools/led/example/sdk56636.asm
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.16/tools/led/example/sdk56636.asm
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
; ; ; ; This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. ; ; Copyright 2007-2019 Broadcom Inc. All rights reserved. ; ; ; This is the default program for the (25 GE + 6 XE/HG port) BCM56636 SDKs. ; To start it, use the following commands from BCM: ; ; led load sdk56636.hex ; led auto on ; led start ; ; The is 1 LEDs per XE port. ; ; There is one bit per 10 gigabit Ethernet LED with the following colors: ; ONE Black ; ZERO Green ; ; Each chip drives only its own LEDs and needs to write them in the order: ; A05/L05,L06/A06,A01/L01,L02/A02,A03/L03,L04/A04 ; ; Link up/down info cannot be derived from LINKEN or LINKUP, as the LED ; processor does not always have access to link status. This program ; assumes link status is kept current in bit 0 of RAM byte (0xA0 + portnum). ; Generally, a program running on the main CPU must update these ; locations on link change; see linkscan callback in ; $SDK/src/appl/diag/ledproc.c. ; ; Current implementation: ; ; L01/A01 reflects port 1 link status: ; Black: no link ; Green: Link/Activity ; ; MAX_XE_PORT EQU 31 NUM_PORT EQU 8 ; Device ports ;xe4( 42) ;xe0( 26) ;xe1( 27) ;xe2( 28) ;xe3( 29) ;xe5( 50) PORT_XE4 EQU 42 PORT_XE5 EQU 50 PORT_XE0 EQU 26 PORT_XE1 EQU 27 PORT_XE2 EQU 28 PORT_XE3 EQU 29 ; The TX/RX activity lights will be extended for ACT_EXT_TICKS ; so they will be more visible. TICKS EQU 1 SECOND_TICKS EQU (30*TICKS) ACT_EXT_TICKS EQU (SECOND_TICKS/3) TXRX_ALT_TICKS EQU (SECOND_TICKS/6) ; ; Main Update Routine ; ; This routine is called once per tick. ; update: ld a, PORT_XE4 port a call link_activity ; Off if no link ld a, PORT_XE5 port a call link_activity ; Off if no link ld a, PORT_XE0 port a call link_activity ; Off if no link ld a, PORT_XE1 port a call link_activity ; Off if no link ld a, PORT_XE2 port a call link_activity ; Off if no link ld a, PORT_XE3 port a call link_activity ; Off if no link ; Update various timers inc (TXRX_ALT_COUNT) send NUM_PORT * 1 ; ; link_activity ; ; This routine calculates the activity LED for the current port. ; It extends the activity lights using timers (new activity overrides ; and resets the timers). ; ; Inputs: (PORT_NUM) ; Outputs: one bit sent to LED stream ; link_activity: ;jmp led_green ;DEBUG ONLY call get_link jnc led_black port a pushst RX pushst TX tor pop jnc led_green ; Always green Link up, No Activity ;jmp led_green ;DEBUG ONLY ld b, (TXRX_ALT_COUNT) and b, TXRX_ALT_TICKS jnz led_green jmp led_black link_status: ;jmp led_black ;DEBUG ONLY call get_link jnc led_black jmp led_green ; ; get_link ; ; This routine finds the link status LED for a port. ; Link info is in bit 0 of the byte read from PORTDATA[port] ; ; Inputs: Port number in a ; Outputs: Carry flag set if link is up, clear if link is down. ; Destroys: a, b ; get_link: ld b,PORTDATA add b,a ld b,(b) tst b,0 ret ; ; led_black, led_green ; ; Inputs: None ; Outputs: one bit to the LED stream indicating color ; Destroys: None ; led_black: pushst ONE pack ret led_green: pushst ZERO pack ret ; ; Variables (SDK software initializes LED memory from 0xa0-0xff to 0) ; TXRX_ALT_COUNT equ 0xe0 PORT_NUM equ 0xe1 ; ; Port data, which must be updated continually by main CPU's ; linkscan task. See $SDK/src/appl/diag/ledproc.c for examples. ; In this program, bit 0 is assumed to contain the link up/down status. ; ;Offset 0x1e00 - 0x80 ;LED scan chain assembly area ;Offset 0x1e80 - 0xa0 PORTDATA equ 0xa0 ; Size 48 + 1 + 4 bytes ; ; Symbolic names for the bits of the port status fields ; RX equ 0x0 ; received packet TX equ 0x1 ; transmitted packet COLL equ 0x2 ; collision indicator SPEED_C equ 0x3 ; 100 Mbps SPEED_M equ 0x4 ; 1000 Mbps DUPLEX equ 0x5 ; half/full duplex FLOW equ 0x6 ; flow control capable LINKUP equ 0x7 ; link down/up status LINKEN equ 0x8 ; link disabled/enabled status ZERO equ 0xE ; always 0 ONE equ 0xF ; always 1
23.884058
133
0.593244
a08c717855df71169bf85035aa9801fda3e8d8d7
896
asm
Assembly
base/runtime/macros.asm
zbyti/Mad-Pascal
546cae9724828f93047080109488be7d0d07d47e
[ "MIT" ]
1
2021-12-15T23:47:19.000Z
2021-12-15T23:47:19.000Z
base/runtime/macros.asm
michalkolodziejski/Mad-Pascal
0a7a1e2f379e50b0a23878b0d881ff3407269ed6
[ "MIT" ]
null
null
null
base/runtime/macros.asm
michalkolodziejski/Mad-Pascal
0a7a1e2f379e50b0a23878b0d881ff3407269ed6
[ "MIT" ]
null
null
null
.macro m@ora lda %%1 ora %%2 sta %%3 .endm .macro m@add lda %%1 clc adc %%2 sta %%3 .endm .macro m@adc lda %%1 adc %%2 sta %%3 .endm .macro m@sub lda %%1 sec sbc %%2 sta %%3 .endm .macro m@sbc lda %%1 sbc %%2 sta %%3 .endm .macro m@index2 (Ofset) asl :STACKORIGIN-%%Ofset,x rol :STACKORIGIN-%%Ofset+STACKWIDTH,x .endm .macro m@index4 (Ofset) asl :STACKORIGIN-%%Ofset,x rol :STACKORIGIN-%%Ofset+STACKWIDTH,x asl :STACKORIGIN-%%Ofset,x rol :STACKORIGIN-%%Ofset+STACKWIDTH,x .endm m@fill .macro lda #0 tay tax loop cpx >VLEN bne fil cpy <VLEN beq @+ fil sta VADR,y iny bne loop inx inc fil+2 bne loop @ mva >VADR fil+2 .endm m@call .macro (os_proc) .ifdef MAIN.@DEFINES.ROMOFF inc portb jsr %%os_proc dec portb .else jsr %%os_proc .endif .endm
10.418605
39
0.570313
0c581ffcbe8c2176d0ec4ef8f677ee2c3034d936
9,593
asm
Assembly
raklogo.asm
hwreverse/PC-G850V
53a4dca7b31f940412e0ebddba395f2b8deda895
[ "MIT" ]
7
2020-09-30T19:56:39.000Z
2021-09-30T12:05:18.000Z
raklogo.asm
hwreverse/PC-G850V
53a4dca7b31f940412e0ebddba395f2b8deda895
[ "MIT" ]
1
2021-09-04T02:52:33.000Z
2021-09-04T02:52:33.000Z
raklogo.asm
hwreverse/PC-G850V
53a4dca7b31f940412e0ebddba395f2b8deda895
[ "MIT" ]
2
2021-09-03T12:28:16.000Z
2021-09-30T13:47:01.000Z
10 ORG 100H 11 XOR A 12 LD B,144 13 LD D,0 14 LD E,0 15 CALL 0BFEEH 16 JP MAIN 17GPF EQU 0BFD0H 18MAIN: LD HL,L0 19 LD B,144 20 LD DE,0 21 CALL GPF 22 LD HL,L1 23 LD B,144 24 LD DE,0100H 25 CALL GPF 26 LD HL,L2 27 LD B,144 28 LD DE,0200H 29 CALL GPF 30 LD HL,L3 31 LD B,144 32 LD DE,0300H 33 CALL GPF 34 LD HL,L4 35 LD B,144 36 LD DE,0400H 37 CALL GPF 38 LD HL,L5 39 LD B,144 40 LD DE,0500H 41 CALL GPF 42 CALL WAIT 43 LD HL,L6 44 LD B,144 45 LD DE,0000H 46 CALL GPF 47 LD HL,L7 48 LD B,144 49 LD DE,0100H 50 CALL GPF 51 LD HL,L8 52 LD B,144 53 LD DE,0200H 54 CALL GPF 55 LD HL,L9 56 LD B,144 57 LD DE,0300H 58 CALL GPF 59 LD HL,L10 60 LD B,144 61 LD DE,0400H 62 CALL GPF 63 LD HL,L11 64 LD B,144 65 LD DE,0500H 66 CALL GPF 67 CALL WAIT 68 IN A,(1FH) 69 RLCA 70 RET C 71 JP MAIN 72 RET 73WAIT: LD BC,500 74WLOOP: DEC BC 75 LD A,B 76 OR C 77 JR NZ,WLOOP 78 RET 79L0: DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 80 DB 00H,00H,80H,0C0H,0E0H,0F0H,0F8H,0F8H,0FCH,0FCH,0FEH,0FEH 81 DB 7EH,7EH,7FH,3FH,3FH,3EH,3EH,3EH,3EH,0CH,00H,00H 82 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 83 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 84 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 85 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 86 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 87 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 88 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 89 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 90 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 91L1: DB 00H,00H,80H,80H,80H,80H,00H,00H,80H,0C0H,0C0H,0D8H 92 DB 0DEH,0BFH,3FH,9FH,0DFH,0CFH,0D7H,9BH,39H,3CH,0BEH,0BEH 93 DB 9FH,0DFH,0DFH,0DFH,0DFH,0DFH,0DFH,9FH,9FH,1FH,60H,0F8H 94 DB 0F8H,0F8H,0F0H,0E0H,0E0H,0C0H,80H,00H,00H,00H,00H,00H 95 DB 00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,1FH 96 DB 1FH,1FH,1FH,1FH,1FH,1FH,1FH,1FH,3FH,3FH,7FH,0FFH 97 DB 0FFH,0FFH,0FEH,0FCH,0F8H,0F0H,80H,00H,00H,00H,00H,00H 98 DB 00H,00H,00H,00H,00H,80H,0F0H,0FEH,0FFH,0FFH,0FFH,0FFH 99 DB 0FFH,0FFH,0FFH,0FFH,0FCH,0F0H,80H,00H,00H,00H,00H,00H 100 DB 00H,00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 101 DB 0FFH,00H,00H,00H,00H,80H,0C0H,0E0H,0F0H,0F8H,0FCH,0FEH 102 DB 0FFH,0FFH,7FH,3FH,1FH,0FH,07H,03H,01H,00H,00H,00H 103L2: DB 3CH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,00H,7FH,0FFH,0FFH,0FFH 104 DB 0FFH,0C1H,1CH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,00H,1FH,1FH 105 DB 1FH,1FH,1FH,0DFH,0DFH,0DFH,0DFH,0CFH,0EFH,07H,70H,0FCH 106 DB 0F9H,0F3H,0CFH,1FH,7FH,0FFH,0FFH,0FFH,0FCH,0F8H,0C0H,00H 107 DB 00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0C0H 108 DB 0C0H,0C0H,0C0H,0C0H,0C0H,0C0H,0C0H,0C0H,0C0H,0E0H,0F0H,0FFH 109 DB 0FFH,0FFH,0FFH,0FFH,7FH,1FH,03H,00H,00H,00H,00H,00H 110 DB 00H,00H,80H,0F0H,0FEH,0FFH,0FFH,0FFH,0FFH,7FH,0FH,01H 111 DB 03H,1FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FCH,0F0H,80H,00H,00H 112 DB 00H,00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 113 DB 0F7H,0F0H,0F8H,0FCH,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0C7H,83H 114 DB 01H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 115L3: DB 00H,01H,0FH,3FH,7FH,0FFH,0FFH,0FFH,0FCH,0F3H,0E7H,0CFH 116 DB 0BFH,1FH,40H,0F3H,0FBH,0FBH,0FBH,0FBH,0FBH,0F8H,0F8H,0F8H 117 DB 0F8H,0F8H,0C0H,0FH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,00H,0FFH 118 DB 0FFH,0FFH,0FFH,0FFH,00H,03H,0FFH,0FFH,0FFH,0FFH,0FFH,7EH 119 DB 00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,07H 120 DB 07H,07H,07H,07H,07H,07H,0FH,0FH,0FH,1FH,3FH,0FFH 121 DB 0FFH,0FFH,0FEH,0FCH,0F8H,0E0H,00H,00H,00H,00H,00H,80H 122 DB 0F0H,0FEH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F9H,0F8H,0F8H,0F8H 123 DB 0F8H,0F8H,0F8H,0FBH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FCH,0F0H 124 DB 80H,00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 125 DB 0FFH,1FH,0FH,07H,03H,07H,1FH,3FH,0FFH,0FFH,0FFH,0FFH 126 DB 0FEH,0FCH,0F0H,0E0H,0C0H,00H,00H,00H,00H,00H,00H,00H 127L4: DB 00H,00H,00H,00H,00H,00H,01H,03H,07H,0FH,0FH,1FH 128 DB 1FH,07H,70H,0F9H,0FDH,0F9H,0FBH,0FBH,0FBH,0FBH,0FBH,0F9H 129 DB 7DH,7DH,3DH,0BCH,0DDH,0E9H,0E3H,0F3H,0F9H,0FCH,0FCH,79H 130 DB 3BH,03H,03H,01H,00H,00H,01H,01H,01H,01H,01H,00H 131 DB 00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,00H 132 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,1FH 133 DB 0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F0H,00H,80H,0F0H,0FEH,0FFH 134 DB 0FFH,0FFH,0FFH,0FFH,1FH,03H,01H,01H,01H,01H,01H,01H 135 DB 01H,01H,01H,01H,01H,01H,07H,3FH,0FFH,0FFH,0FFH,0FFH 136 DB 0FFH,0FCH,0F0H,80H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 137 DB 0FFH,00H,00H,00H,00H,00H,00H,00H,00H,01H,07H,0FH 138 DB 3FH,7FH,0FFH,0FFH,0FFH,0FFH,0FEH,0F8H,0F0H,0E0H,80H,00H 139L5: DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 140 DB 00H,00H,00H,3CH,7EH,0FEH,0FEH,0FEH,0FEH,0FEH,0FEH,7EH 141 DB 7FH,7FH,3FH,3FH,1FH,1FH,0FH,07H,07H,03H,01H,00H 142 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 143 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 144 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 145 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 146 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 147 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 148 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 149 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 150 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 151L6: DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 152 DB 00H,00H,80H,0C0H,0E0H,0F0H,0F0H,0F8H,0F8H,0FCH,0FCH,7CH 153 DB 7EH,3EH,3EH,3EH,3EH,3EH,3EH,3EH,1CH,00H,00H,00H 154 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 155 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 156 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 157 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 158 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 159 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 160 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 161 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 162 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 163L7: DB 00H,00H,80H,80H,80H,00H,00H,00H,00H,80H,0C0H,80H 164 DB 9CH,1FH,3FH,1FH,8FH,87H,83H,91H,19H,3CH,9CH,9EH 165 DB 9EH,9EH,9FH,9FH,9FH,9FH,9FH,9FH,9FH,0EH,00H,0F0H 166 DB 0F8H,0F0H,0E0H,0E0H,0C0H,80H,00H,00H,00H,00H,00H,00H 167 DB 00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,1FH,1FH 168 DB 1FH,1FH,1FH,1FH,1FH,1FH,1FH,1FH,1FH,3FH,3FH,0FFH 169 DB 0FEH,0FEH,0FCH,0FCH,0F8H,0E0H,00H,00H,00H,00H,00H,00H 170 DB 00H,00H,00H,00H,00H,00H,0E0H,0F8H,0FFH,0FFH,0FFH,0FFH 171 DB 0FFH,0FFH,0FFH,0FFH,0F8H,0E0H,00H,00H,00H,00H,00H,00H 172 DB 00H,00H,00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 173 DB 00H,00H,00H,00H,00H,00H,80H,0C0H,0E0H,0F0H,0F8H,0FCH 174 DB 0FEH,0FFH,7FH,3FH,1FH,0FH,07H,03H,01H,00H,00H,00H 175L8: DB 00H,0FFH,0FFH,0FFH,0FFH,0FFH,0C0H,00H,1FH,0FFH,0FFH,0FFH 176 DB 0FFH,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0D4H,00H,0FH,0FH 177 DB 0FH,0FH,0FH,0FH,0CFH,0CFH,0CFH,0CFH,0CFH,03H,10H,0F8H 178 DB 0F1H,0E3H,0C7H,0FH,3FH,0FFH,0FFH,0FEH,0FCH,0F0H,80H,00H 179 DB 00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0C0H,80H 180 DB 80H,80H,80H,80H,80H,80H,80H,80H,0C0H,0C0H,0E0H,0F8H 181 DB 0FFH,0FFH,0FFH,7FH,3FH,0FH,00H,00H,00H,00H,00H,00H 182 DB 00H,00H,00H,0E0H,0F8H,0FFH,0FFH,0FFH,0FFH,1FH,07H,00H 183 DB 00H,07H,3FH,0FFH,0FFH,0FFH,0FFH,0F8H,0E0H,00H,00H,00H 184 DB 00H,00H,00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 185 DB 0E0H,0F0H,0F8H,0FCH,0FEH,0FFH,0FFH,0FFH,0FFH,0EFH,87H,03H 186 DB 01H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 187L9: DB 00H,00H,07H,1FH,3FH,0FFH,0FFH,0FEH,0F8H,0F1H,0C7H,8FH 188 DB 1FH,0EH,00H,0E1H,0F3H,0F3H,0F3H,0F3H,0F3H,0F0H,0F0H,0F0H 189 DB 0F0H,0F0H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,08H,00H,0E7H 190 DB 0FFH,0FFH,0FFH,0FEH,00H,01H,0FFH,0FFH,0FFH,0FFH,0FFH,00H 191 DB 00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,07H,07H 192 DB 07H,07H,07H,07H,07H,07H,07H,07H,07H,0FH,1FH,0FFH 193 DB 0FFH,0FFH,0FCH,0FCH,0F8H,0C0H,00H,00H,00H,00H,00H,00H 194 DB 0E0H,0F8H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F0H,0F0H,0F0H,0F0H 195 DB 0F0H,0F0H,0F0H,0F1H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,0F8H,0E0H 196 DB 00H,00H,00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 197 DB 1FH,0FH,07H,03H,03H,03H,0FH,1FH,7FH,0FFH,0FFH,0FFH 198 DB 0FEH,0F8H,0F0H,0C0H,80H,00H,00H,00H,00H,00H,00H,00H 199L10: DB 00H,00H,00H,00H,00H,00H,01H,03H,03H,07H,0FH,0FH 200 DB 1FH,06H,00H,78H,0F9H,0F9H,0F9H,0F9H,0F9H,0F9H,79H,79H 201 DB 79H,39H,3CH,9CH,88H,0C9H,0E1H,0F1H,0F9H,0FCH,0FCH,39H 202 DB 19H,01H,01H,01H,00H,00H,00H,01H,01H,01H,00H,00H 203 DB 00H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH,00H,00H 204 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 205 DB 7FH,0FFH,0FFH,0FFH,0FFH,0FFH,80H,00H,00H,0E0H,0FCH,0FFH 206 DB 0FFH,0FFH,0FFH,3FH,0FH,01H,01H,01H,01H,01H,01H,01H 207 DB 01H,01H,01H,01H,01H,01H,03H,1FH,7FH,0FFH,0FFH,0FFH 208 DB 0FFH,0F8H,0C0H,00H,00H,00H,0FFH,0FFH,0FFH,0FFH,0FFH,0FFH 209 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,03H,07H 210 DB 1FH,3FH,0FFH,0FFH,0FFH,0FFH,0FCH,0F8H,0E0H,0C0H,00H,00H 211L11: DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 212 DB 00H,00H,00H,38H,3CH,7CH,7CH,7CH,7CH,7CH,7CH,7EH 213 DB 3EH,3FH,3FH,1FH,1FH,0FH,0FH,07H,03H,01H,00H,00H 214 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 215 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 216 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 217 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 218 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 219 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 220 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 221 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 222 DB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H 
44.618605
67
0.73981
5baf7bb60e3ae58fdeb56337d703f598a4a5b73a
309
asm
Assembly
programs/oeis/204/A204502.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/204/A204502.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/204/A204502.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A204502: Numbers such that floor[a(n)^2 / 9] is a square. ; 0,1,2,3,4,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177 mov $1,$0 mul $1,2 trn $1,9 add $0,$1
38.625
209
0.66343
c1727b3e34d250efd3de8ed3161c9777c6f2f365
531
asm
Assembly
onnxruntime/core/mlas/lib/amd64/QgemvU8S8KernelAvx512Core.asm
dennyac/onnxruntime
d5175795d2b7f2db18b0390f394a49238f814668
[ "MIT" ]
6,036
2019-05-07T06:03:57.000Z
2022-03-31T17:59:54.000Z
onnxruntime/core/mlas/lib/amd64/QgemvU8S8KernelAvx512Core.asm
dennyac/onnxruntime
d5175795d2b7f2db18b0390f394a49238f814668
[ "MIT" ]
5,730
2019-05-06T23:04:55.000Z
2022-03-31T23:55:56.000Z
onnxruntime/core/mlas/lib/amd64/QgemvU8S8KernelAvx512Core.asm
dennyac/onnxruntime
d5175795d2b7f2db18b0390f394a49238f814668
[ "MIT" ]
1,566
2019-05-07T01:30:07.000Z
2022-03-31T17:06:50.000Z
;++ ; ; Copyright (c) Microsoft Corporation. All rights reserved. ; ; Licensed under the MIT License. ; ; Module Name: ; ; QgemvU8S8KernelAvx512Core.asm ; ; Abstract: ; ; This module implements the kernels for the quantized integer matrix/vector ; multiply operation (QGEMV). ; ; This implementation uses AVX512 core instructions (BW/DQ/VL). ; ;-- .xlist INCLUDE mlasi.inc INCLUDE QgemvU8S8KernelAvx512Common.inc .list ; ; Generate the GEMV kernel. ; GemvU8S8KernelAvx512Function Avx512Core END
16.59375
78
0.711864
8eaf6f008dc1ffdbc24146ccb1ca6527d5efb23a
147
asm
Assembly
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/日本_Ver3/asm/z00_mut1.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/日本_Ver3/asm/z00_mut1.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/日本_Ver3/asm/z00_mut1.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
Name: z00_mut1.asm Type: file Size: 149479 Last-Modified: '2016-05-13T04:36:32Z' SHA-1: 53F22F18712BA63430F58695F8C3A20A4916B395 Description: null
21
47
0.816327
099c087728510b2239e40f1176c4008b0237e716
658
asm
Assembly
programs/oeis/300/A300270.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/300/A300270.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/300/A300270.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A300270: a(n) = Sum_{1 <= i <= j <= n} mu(i*j)*floor((n/i)/j)). ; 1,1,1,1,1,2,2,2,2,3,3,4,4,5,6,6,6,7,7,8,9,10,10,11,11,12,12,13,13,13,13,13,14,15,16,17,17,18,19,20,20,20,20,21,22,23,23,24,24,25,26,27,27,28,29,30,31,32,32,32,32,33,34,34,35,35,35,36,37,37,37,38,38,39,40,41,42,42,42,43,43,44,44,44,45,46,47,48,48,48 mov $27,$0 mov $29,$0 add $29,1 lpb $29 clr $0,27 mov $0,$27 sub $29,1 sub $0,$29 cal $0,76479 ; a(n) = mu(rad(n)), where mu is the Moebius-function (A008683) and rad is the radical or squarefree kernel (A007947). mov $1,$0 add $4,$0 mul $4,3 lpb $4 mul $1,$4 sub $4,4 lpe div $1,3 add $28,$1 lpe mov $1,$28
27.416667
250
0.579027
33b678a11db4b1a077a53ca8c39a5400bb1e5325
881
asm
Assembly
programs/oeis/272/A272007.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/272/A272007.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/272/A272007.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A272007: Number of active (ON,black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 413", based on the 5-celled von Neumann neighborhood. ; 1,8,5,48,5,120,5,224,5,360,5,528,5,728,5,960,5,1224,5,1520,5,1848,5,2208,5,2600,5,3024,5,3480,5,3968,5,4488,5,5040,5,5624,5,6240,5,6888,5,7568,5,8280,5,9024,5,9800,5,10608,5,11448,5,12320,5,13224,5,14160,5,15128,5,16128,5,17160,5,18224,5,19320,5,20448,5,21608,5,22800,5,24024,5,25280,5,26568,5,27888,5,29240,5,30624,5,32040,5,33488,5,34968,5,36480,5,38024,5,39600,5,41208,5,42848,5,44520,5,46224,5,47960,5,49728,5,51528,5,53360,5,55224,5,57120,5,59048,5,61008,5,63000,5,65024,5 mov $1,$0 mov $2,$0 sub $0,1 mod $0,2 add $1,$2 mov $3,2 mov $4,2 mul $4,$1 lpb $0,1 sub $0,1 mov $1,4 mov $2,1 mov $3,1 sub $4,$4 lpe mov $0,$4 add $0,1 pow $1,$3 trn $2,$4 add $1,$2 add $1,$0 trn $1,2 add $1,1
32.62963
479
0.682179
8fe934ae459da07e8506684713e97e9e428d7efa
569
asm
Assembly
data/mapObjects/viridianforestentrance.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
16
2018-08-28T21:47:01.000Z
2022-02-20T20:29:59.000Z
data/mapObjects/viridianforestentrance.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
5
2019-04-03T19:53:11.000Z
2022-03-11T22:49:34.000Z
data/mapObjects/viridianforestentrance.asm
adhi-thirumala/EvoYellow
6fb1b1d6a1fa84b02e2d982f270887f6c63cdf4c
[ "Unlicense" ]
2
2019-12-09T19:46:02.000Z
2020-12-05T21:36:30.000Z
ViridianForestEntranceObject: db $a ; border block db $4 ; warps db $0, $4, $3, VIRIDIAN_FOREST db $0, $5, $3, VIRIDIAN_FOREST db $7, $4, $5, $ff db $7, $5, $5, $ff db $0 ; signs db $2 ; objects object SPRITE_GIRL, $8, $4, STAY, LEFT, $1 ; person object SPRITE_LITTLE_GIRL, $2, $4, WALK, $1, $2 ; person ; warp-to EVENT_DISP VIRIDIAN_FOREST_ENTRANCE_WIDTH, $0, $4 ; VIRIDIAN_FOREST EVENT_DISP VIRIDIAN_FOREST_ENTRANCE_WIDTH, $0, $5 ; VIRIDIAN_FOREST EVENT_DISP VIRIDIAN_FOREST_ENTRANCE_WIDTH, $7, $4 EVENT_DISP VIRIDIAN_FOREST_ENTRANCE_WIDTH, $7, $5
27.095238
68
0.699473
af2b7caa1e89149311b39745678c5f1e6f312823
2,010
asm
Assembly
libsrc/graphics/nascom/xorpixl.asm
Toysoft/z88dk
f930bef9ac4feeec91a07303b79ddd9071131a24
[ "ClArtistic" ]
null
null
null
libsrc/graphics/nascom/xorpixl.asm
Toysoft/z88dk
f930bef9ac4feeec91a07303b79ddd9071131a24
[ "ClArtistic" ]
null
null
null
libsrc/graphics/nascom/xorpixl.asm
Toysoft/z88dk
f930bef9ac4feeec91a07303b79ddd9071131a24
[ "ClArtistic" ]
1
2019-12-03T23:28:20.000Z
2019-12-03T23:28:20.000Z
; ; Generic pseudo graphics routines for text-only platforms ; Version for the 2x3 graphics symbols ; ; Written by Stefano Bodrato 19/12/2006 ; ; ; Invert pixel at (x,y) coordinate. ; ; ; $Id: xorpixl.asm,v 1.7 2016-07-02 09:01:36 dom Exp $ ; INCLUDE "graphics/grafix.inc" SECTION code_clib PUBLIC xorpixel EXTERN textpixl EXTERN div3 EXTERN __gfx_coords EXTERN base_graphics .xorpixel ld a,h cp maxx ret nc ld a,l cp maxy ret nc ; y0 out of range dec a dec a ld (__gfx_coords),hl push bc ld c,a ; y ld b,h ; x push bc ld hl,div3 ld d,0 ld e,c inc e add hl,de ld a,(hl) ld c,a ; y/3 srl b ; x/2 ld a,c ld c,b ; !! ;--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ld hl,0BCAh ld b,a ; keep y/3 and a jr z,r_zero ld hl,$80a dec a jr z,r_zero ld de,64 .r_loop add hl,de dec a jr nz,r_loop .r_zero ld e,c add hl,de ;--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ld a,(hl) ; get current symbol from screen ld e,a ; ..and its copy push hl ; char address push bc ; keep y/3 ld hl,textpixl ld e,0 ld b,64 ; whole symbol table size .ckmap cp (hl) ; compare symbol with the one in map jr z,chfound inc hl inc e djnz ckmap ld e,0 .chfound ld a,e pop bc ; restore y/3 in b pop hl ; char address ex (sp),hl ; save char address <=> restore x,y (y=h, x=l) ld c,a ; keep the symbol ld a,l inc a inc a sub b sub b sub b ; we get the remainder of y/3 ld l,a ld a,1 ; the pixel we want to draw jr z,iszero bit 0,l jr nz,is1 add a,a add a,a .is1 add a,a add a,a .iszero bit 0,h jr z,evenrow add a,a ; move down the bit .evenrow xor c ld hl,textpixl ld d,0 ld e,a add hl,de ld a,(hl) pop hl ld (hl),a pop bc ret
14.565217
72
0.51393
735f98874e72ba7541cfd326754f21a89ea8c610
809
asm
Assembly
oeis/142/A142001.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/142/A142001.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/142/A142001.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A142001: Primes congruent to 25 mod 29. ; Submitted by Jon Maiga ; 83,199,257,373,431,547,953,1069,1301,1823,1997,2113,2287,2693,3041,3331,3389,3853,3911,4027,4201,4259,4549,4723,5303,5419,5477,5651,6173,6521,6637,6869,7043,7159,7333,7507,7681,8087,8377,8609,8783,9421,9479,9769,10639,10987,11161,11393,12263,12379,12437,12553,12611,12959,13249,13597,13829,14177,14293,14699,15511,15569,15859,16033,16091,16381,16729,16787,16903,17077,17483,17599,17657,18121,18353,18701,19571,19687,19861,19919,20441,20731,20789,20963,21601,22123,22877,22993,23167,23399,23689,23747 mov $1,24 mov $2,$0 add $2,2 pow $2,2 lpb $2 mov $3,$1 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 add $1,58 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 sub $2,2 lpe mov $0,$1 add $0,1
36.772727
501
0.731768
b70d587a8e38fdf9fd2e6ee2b28693da88ac64a0
197
asm
Assembly
libsrc/_DEVELOPMENT/adt/p_stack/c/sdcc_iy/p_stack_clear_fastcall.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/adt/p_stack/c/sdcc_iy/p_stack_clear_fastcall.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/adt/p_stack/c/sdcc_iy/p_stack_clear_fastcall.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void p_stack_clear_fastcall(p_stack_t *s) SECTION code_clib SECTION code_adt_p_stack PUBLIC _p_stack_clear_fastcall EXTERN asm_p_stack_clear defc _p_stack_clear_fastcall = asm_p_stack_clear
16.416667
48
0.86802
388a7d719838ce2f1079c7660822e4e269f6ca92
54,103
asm
Assembly
vp9/common/arm/neon/vp9_short_idct32x32_add_neon.asm
tizenorg/platform.upstream.libvpx
fa8ddbf339415d2af2323d21b7fda2737db81fdd
[ "BSD-3-Clause" ]
49
2015-01-07T04:37:04.000Z
2022-03-25T08:37:14.000Z
src/third_party/libvpx/source/libvpx/vp9/common/arm/neon/vp9_short_idct32x32_add_neon.asm
mcanthony/Chromium-WebCL
41baee31a8e6e3241e097db4047025a3ecbfc9f4
[ "MIT" ]
1
2016-03-22T11:48:22.000Z
2016-12-05T15:26:52.000Z
src/third_party/libvpx/source/libvpx/vp9/common/arm/neon/vp9_short_idct32x32_add_neon.asm
mcanthony/Chromium-WebCL
41baee31a8e6e3241e097db4047025a3ecbfc9f4
[ "MIT" ]
8
2015-06-29T21:53:18.000Z
2019-11-01T21:22:47.000Z
; ; Copyright (c) 2013 The WebM project authors. All Rights Reserved. ; ; Use of this source code is governed by a BSD-style license ; that can be found in the LICENSE file in the root of the source ; tree. An additional intellectual property rights grant can be found ; in the file PATENTS. All contributing project authors may ; be found in the AUTHORS file in the root of the source tree. ; ;TODO(cd): adjust these constant to be able to use vqdmulh for faster ; dct_const_round_shift(a * b) within butterfly calculations. cospi_1_64 EQU 16364 cospi_2_64 EQU 16305 cospi_3_64 EQU 16207 cospi_4_64 EQU 16069 cospi_5_64 EQU 15893 cospi_6_64 EQU 15679 cospi_7_64 EQU 15426 cospi_8_64 EQU 15137 cospi_9_64 EQU 14811 cospi_10_64 EQU 14449 cospi_11_64 EQU 14053 cospi_12_64 EQU 13623 cospi_13_64 EQU 13160 cospi_14_64 EQU 12665 cospi_15_64 EQU 12140 cospi_16_64 EQU 11585 cospi_17_64 EQU 11003 cospi_18_64 EQU 10394 cospi_19_64 EQU 9760 cospi_20_64 EQU 9102 cospi_21_64 EQU 8423 cospi_22_64 EQU 7723 cospi_23_64 EQU 7005 cospi_24_64 EQU 6270 cospi_25_64 EQU 5520 cospi_26_64 EQU 4756 cospi_27_64 EQU 3981 cospi_28_64 EQU 3196 cospi_29_64 EQU 2404 cospi_30_64 EQU 1606 cospi_31_64 EQU 804 EXPORT |vp9_idct32x32_1024_add_neon| ARM REQUIRE8 PRESERVE8 AREA ||.text||, CODE, READONLY, ALIGN=2 AREA Block, CODE, READONLY ; -------------------------------------------------------------------------- ; Load from transposed_buffer ; q13 = transposed_buffer[first_offset] ; q14 = transposed_buffer[second_offset] ; for proper address calculation, the last offset used when manipulating ; transposed_buffer must be passed in. use 0 for first use. MACRO LOAD_FROM_TRANSPOSED $prev_offset, $first_offset, $second_offset ; address calculation with proper stride and loading add r0, #($first_offset - $prev_offset )*8*2 vld1.s16 {q14}, [r0] add r0, #($second_offset - $first_offset)*8*2 vld1.s16 {q13}, [r0] ; (used) two registers (q14, q13) MEND ; -------------------------------------------------------------------------- ; Load from output (used as temporary storage) ; reg1 = output[first_offset] ; reg2 = output[second_offset] ; for proper address calculation, the last offset used when manipulating ; output, wethere reading or storing) must be passed in. use 0 for first ; use. MACRO LOAD_FROM_OUTPUT $prev_offset, $first_offset, $second_offset, $reg1, $reg2 ; address calculation with proper stride and loading add r1, #($first_offset - $prev_offset )*32*2 vld1.s16 {$reg1}, [r1] add r1, #($second_offset - $first_offset)*32*2 vld1.s16 {$reg2}, [r1] ; (used) two registers ($reg1, $reg2) MEND ; -------------------------------------------------------------------------- ; Store into output (sometimes as as temporary storage) ; output[first_offset] = reg1 ; output[second_offset] = reg2 ; for proper address calculation, the last offset used when manipulating ; output, wethere reading or storing) must be passed in. use 0 for first ; use. MACRO STORE_IN_OUTPUT $prev_offset, $first_offset, $second_offset, $reg1, $reg2 ; address calculation with proper stride and storing add r1, #($first_offset - $prev_offset )*32*2 vst1.16 {$reg1}, [r1] add r1, #($second_offset - $first_offset)*32*2 vst1.16 {$reg2}, [r1] MEND ; -------------------------------------------------------------------------- ; Combine-add results with current destination content ; q6-q9 contain the results (out[j * 32 + 0-31]) MACRO STORE_COMBINE_CENTER_RESULTS ; load dest[j * dest_stride + 0-31] vld1.s16 {d8}, [r10], r2 vld1.s16 {d11}, [r9], r11 vld1.s16 {d9}, [r10] vld1.s16 {d10}, [r9] ; ROUND_POWER_OF_TWO vrshr.s16 q7, q7, #6 vrshr.s16 q8, q8, #6 vrshr.s16 q9, q9, #6 vrshr.s16 q6, q6, #6 ; add to dest[j * dest_stride + 0-31] vaddw.u8 q7, q7, d9 vaddw.u8 q8, q8, d10 vaddw.u8 q9, q9, d11 vaddw.u8 q6, q6, d8 ; clip pixel vqmovun.s16 d9, q7 vqmovun.s16 d10, q8 vqmovun.s16 d11, q9 vqmovun.s16 d8, q6 ; store back into dest[j * dest_stride + 0-31] vst1.16 {d9}, [r10], r11 vst1.16 {d10}, [r9], r2 vst1.16 {d8}, [r10] vst1.16 {d11}, [r9] ; update pointers (by dest_stride * 2) sub r9, r9, r2, lsl #1 add r10, r10, r2, lsl #1 MEND ; -------------------------------------------------------------------------- ; Combine-add results with current destination content ; q6-q9 contain the results (out[j * 32 + 0-31]) MACRO STORE_COMBINE_CENTER_RESULTS_LAST ; load dest[j * dest_stride + 0-31] vld1.s16 {d8}, [r10], r2 vld1.s16 {d11}, [r9], r11 vld1.s16 {d9}, [r10] vld1.s16 {d10}, [r9] ; ROUND_POWER_OF_TWO vrshr.s16 q7, q7, #6 vrshr.s16 q8, q8, #6 vrshr.s16 q9, q9, #6 vrshr.s16 q6, q6, #6 ; add to dest[j * dest_stride + 0-31] vaddw.u8 q7, q7, d9 vaddw.u8 q8, q8, d10 vaddw.u8 q9, q9, d11 vaddw.u8 q6, q6, d8 ; clip pixel vqmovun.s16 d9, q7 vqmovun.s16 d10, q8 vqmovun.s16 d11, q9 vqmovun.s16 d8, q6 ; store back into dest[j * dest_stride + 0-31] vst1.16 {d9}, [r10], r11 vst1.16 {d10}, [r9], r2 vst1.16 {d8}, [r10]! vst1.16 {d11}, [r9]! ; update pointers (by dest_stride * 2) sub r9, r9, r2, lsl #1 add r10, r10, r2, lsl #1 MEND ; -------------------------------------------------------------------------- ; Combine-add results with current destination content ; q4-q7 contain the results (out[j * 32 + 0-31]) MACRO STORE_COMBINE_EXTREME_RESULTS ; load dest[j * dest_stride + 0-31] vld1.s16 {d4}, [r7], r2 vld1.s16 {d7}, [r6], r11 vld1.s16 {d5}, [r7] vld1.s16 {d6}, [r6] ; ROUND_POWER_OF_TWO vrshr.s16 q5, q5, #6 vrshr.s16 q6, q6, #6 vrshr.s16 q7, q7, #6 vrshr.s16 q4, q4, #6 ; add to dest[j * dest_stride + 0-31] vaddw.u8 q5, q5, d5 vaddw.u8 q6, q6, d6 vaddw.u8 q7, q7, d7 vaddw.u8 q4, q4, d4 ; clip pixel vqmovun.s16 d5, q5 vqmovun.s16 d6, q6 vqmovun.s16 d7, q7 vqmovun.s16 d4, q4 ; store back into dest[j * dest_stride + 0-31] vst1.16 {d5}, [r7], r11 vst1.16 {d6}, [r6], r2 vst1.16 {d7}, [r6] vst1.16 {d4}, [r7] ; update pointers (by dest_stride * 2) sub r6, r6, r2, lsl #1 add r7, r7, r2, lsl #1 MEND ; -------------------------------------------------------------------------- ; Combine-add results with current destination content ; q4-q7 contain the results (out[j * 32 + 0-31]) MACRO STORE_COMBINE_EXTREME_RESULTS_LAST ; load dest[j * dest_stride + 0-31] vld1.s16 {d4}, [r7], r2 vld1.s16 {d7}, [r6], r11 vld1.s16 {d5}, [r7] vld1.s16 {d6}, [r6] ; ROUND_POWER_OF_TWO vrshr.s16 q5, q5, #6 vrshr.s16 q6, q6, #6 vrshr.s16 q7, q7, #6 vrshr.s16 q4, q4, #6 ; add to dest[j * dest_stride + 0-31] vaddw.u8 q5, q5, d5 vaddw.u8 q6, q6, d6 vaddw.u8 q7, q7, d7 vaddw.u8 q4, q4, d4 ; clip pixel vqmovun.s16 d5, q5 vqmovun.s16 d6, q6 vqmovun.s16 d7, q7 vqmovun.s16 d4, q4 ; store back into dest[j * dest_stride + 0-31] vst1.16 {d5}, [r7], r11 vst1.16 {d6}, [r6], r2 vst1.16 {d7}, [r6]! vst1.16 {d4}, [r7]! ; update pointers (by dest_stride * 2) sub r6, r6, r2, lsl #1 add r7, r7, r2, lsl #1 MEND ; -------------------------------------------------------------------------- ; Touches q8-q12, q15 (q13-q14 are preserved) ; valid output registers are anything but q8-q11 MACRO DO_BUTTERFLY $regC, $regD, $regA, $regB, $first_constant, $second_constant, $reg1, $reg2, $reg3, $reg4 ; TODO(cd): have special case to re-use constants when they are similar for ; consecutive butterflies ; TODO(cd): have special case when both constants are the same, do the ; additions/substractions before the multiplies. ; generate the constants ; generate scalar constants mov r8, #$first_constant & 0xFF00 mov r12, #$second_constant & 0xFF00 add r8, #$first_constant & 0x00FF add r12, #$second_constant & 0x00FF ; generate vector constants vdup.16 d30, r8 vdup.16 d31, r12 ; (used) two for inputs (regA-regD), one for constants (q15) ; do some multiplications (ordered for maximum latency hiding) vmull.s16 q8, $regC, d30 vmull.s16 q10, $regA, d31 vmull.s16 q9, $regD, d30 vmull.s16 q11, $regB, d31 vmull.s16 q12, $regC, d31 ; (used) five for intermediate (q8-q12), one for constants (q15) ; do some addition/substractions (to get back two register) vsub.s32 q8, q8, q10 vsub.s32 q9, q9, q11 ; do more multiplications (ordered for maximum latency hiding) vmull.s16 q10, $regD, d31 vmull.s16 q11, $regA, d30 vmull.s16 q15, $regB, d30 ; (used) six for intermediate (q8-q12, q15) ; do more addition/substractions vadd.s32 q11, q12, q11 vadd.s32 q10, q10, q15 ; (used) four for intermediate (q8-q11) ; dct_const_round_shift vqrshrn.s32 $reg1, q8, #14 vqrshrn.s32 $reg2, q9, #14 vqrshrn.s32 $reg3, q11, #14 vqrshrn.s32 $reg4, q10, #14 ; (used) two for results, well four d registers MEND ; -------------------------------------------------------------------------- ; Touches q8-q12, q15 (q13-q14 are preserved) ; valid output registers are anything but q8-q11 MACRO DO_BUTTERFLY_STD $first_constant, $second_constant, $reg1, $reg2, $reg3, $reg4 DO_BUTTERFLY d28, d29, d26, d27, $first_constant, $second_constant, $reg1, $reg2, $reg3, $reg4 MEND ; -------------------------------------------------------------------------- ;void vp9_idct32x32_1024_add_neon(int16_t *input, uint8_t *dest, int dest_stride); ; ; r0 int16_t *input, ; r1 uint8_t *dest, ; r2 int dest_stride) ; loop counters ; r4 bands loop counter ; r5 pass loop counter ; r8 transpose loop counter ; combine-add pointers ; r6 dest + 31 * dest_stride, descending (30, 29, 28, ...) ; r7 dest + 0 * dest_stride, ascending (1, 2, 3, ...) ; r9 dest + 15 * dest_stride, descending (14, 13, 12, ...) ; r10 dest + 16 * dest_stride, ascending (17, 18, 19, ...) |vp9_idct32x32_1024_add_neon| PROC ; This function does one pass of idct32x32 transform. ; ; This is done by transposing the input and then doing a 1d transform on ; columns. In the first pass, the transposed columns are the original ; rows. In the second pass, after the transposition, the colums are the ; original columns. ; The 1d transform is done by looping over bands of eight columns (the ; idct32_bands loop). For each band, the transform input transposition ; is done on demand, one band of four 8x8 matrices at a time. The four ; matrices are transposed by pairs (the idct32_transpose_pair loop). push {r4-r11} vpush {d8-d15} ; stack operation ; internal buffer used to transpose 8 lines into before transforming them ; int16_t transpose_buffer[32 * 8]; ; at sp + [4096, 4607] ; results of the first pass (transpose and transform rows) ; int16_t pass1[32 * 32]; ; at sp + [0, 2047] ; results of the second pass (transpose and transform columns) ; int16_t pass2[32 * 32]; ; at sp + [2048, 4095] sub sp, sp, #512+2048+2048 ; r6 = dest + 31 * dest_stride ; r7 = dest + 0 * dest_stride ; r9 = dest + 15 * dest_stride ; r10 = dest + 16 * dest_stride rsb r6, r2, r2, lsl #5 rsb r9, r2, r2, lsl #4 add r10, r1, r2, lsl #4 mov r7, r1 add r6, r6, r1 add r9, r9, r1 ; r11 = -dest_stride neg r11, r2 ; r3 = input mov r3, r0 ; parameters for first pass ; r0 = transpose_buffer[32 * 8] add r0, sp, #4096 ; r1 = pass1[32 * 32] mov r1, sp mov r5, #0 ; initialize pass loop counter idct32_pass_loop mov r4, #4 ; initialize bands loop counter idct32_bands_loop mov r8, #2 ; initialize transpose loop counter idct32_transpose_pair_loop ; Load two horizontally consecutive 8x8 16bit data matrices. The first one ; into q0-q7 and the second one into q8-q15. There is a stride of 64, ; adjusted to 32 because of the two post-increments. vld1.s16 {q8}, [r3]! vld1.s16 {q0}, [r3]! add r3, #32 vld1.s16 {q9}, [r3]! vld1.s16 {q1}, [r3]! add r3, #32 vld1.s16 {q10}, [r3]! vld1.s16 {q2}, [r3]! add r3, #32 vld1.s16 {q11}, [r3]! vld1.s16 {q3}, [r3]! add r3, #32 vld1.s16 {q12}, [r3]! vld1.s16 {q4}, [r3]! add r3, #32 vld1.s16 {q13}, [r3]! vld1.s16 {q5}, [r3]! add r3, #32 vld1.s16 {q14}, [r3]! vld1.s16 {q6}, [r3]! add r3, #32 vld1.s16 {q15}, [r3]! vld1.s16 {q7}, [r3]! ; Transpose the two 8x8 16bit data matrices. vswp d17, d24 vswp d23, d30 vswp d21, d28 vswp d19, d26 vswp d1, d8 vswp d7, d14 vswp d5, d12 vswp d3, d10 vtrn.32 q8, q10 vtrn.32 q9, q11 vtrn.32 q12, q14 vtrn.32 q13, q15 vtrn.32 q0, q2 vtrn.32 q1, q3 vtrn.32 q4, q6 vtrn.32 q5, q7 vtrn.16 q8, q9 vtrn.16 q10, q11 vtrn.16 q12, q13 vtrn.16 q14, q15 vtrn.16 q0, q1 vtrn.16 q2, q3 vtrn.16 q4, q5 vtrn.16 q6, q7 ; Store both matrices after each other. There is a stride of 32, which ; adjusts to nothing because of the post-increments. vst1.16 {q8}, [r0]! vst1.16 {q9}, [r0]! vst1.16 {q10}, [r0]! vst1.16 {q11}, [r0]! vst1.16 {q12}, [r0]! vst1.16 {q13}, [r0]! vst1.16 {q14}, [r0]! vst1.16 {q15}, [r0]! vst1.16 {q0}, [r0]! vst1.16 {q1}, [r0]! vst1.16 {q2}, [r0]! vst1.16 {q3}, [r0]! vst1.16 {q4}, [r0]! vst1.16 {q5}, [r0]! vst1.16 {q6}, [r0]! vst1.16 {q7}, [r0]! ; increment pointers by adjusted stride (not necessary for r0/out) ; go back by 7*32 for the seven lines moved fully by read and add ; go back by 32 for the eigth line only read ; advance by 16*2 to go the next pair sub r3, r3, #7*32*2 + 32 - 16*2 ; transpose pair loop processing subs r8, r8, #1 bne idct32_transpose_pair_loop ; restore r0/input to its original value sub r0, r0, #32*8*2 ; Instead of doing the transforms stage by stage, it is done by loading ; some input values and doing as many stages as possible to minimize the ; storing/loading of intermediate results. To fit within registers, the ; final coefficients are cut into four blocks: ; BLOCK A: 16-19,28-31 ; BLOCK B: 20-23,24-27 ; BLOCK C: 8-10,11-15 ; BLOCK D: 0-3,4-7 ; Blocks A and C are straight calculation through the various stages. In ; block B, further calculations are performed using the results from ; block A. In block D, further calculations are performed using the results ; from block C and then the final calculations are done using results from ; block A and B which have been combined at the end of block B. ; -------------------------------------------------------------------------- ; BLOCK A: 16-19,28-31 ; -------------------------------------------------------------------------- ; generate 16,17,30,31 ; -------------------------------------------------------------------------- ; part of stage 1 ;temp1 = input[1 * 32] * cospi_31_64 - input[31 * 32] * cospi_1_64; ;temp2 = input[1 * 32] * cospi_1_64 + input[31 * 32] * cospi_31_64; ;step1b[16][i] = dct_const_round_shift(temp1); ;step1b[31][i] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 0, 1, 31 DO_BUTTERFLY_STD cospi_31_64, cospi_1_64, d0, d1, d4, d5 ; -------------------------------------------------------------------------- ; part of stage 1 ;temp1 = input[17 * 32] * cospi_15_64 - input[15 * 32] * cospi_17_64; ;temp2 = input[17 * 32] * cospi_17_64 + input[15 * 32] * cospi_15_64; ;step1b[17][i] = dct_const_round_shift(temp1); ;step1b[30][i] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 31, 17, 15 DO_BUTTERFLY_STD cospi_15_64, cospi_17_64, d2, d3, d6, d7 ; -------------------------------------------------------------------------- ; part of stage 2 ;step2[16] = step1b[16][i] + step1b[17][i]; ;step2[17] = step1b[16][i] - step1b[17][i]; ;step2[30] = -step1b[30][i] + step1b[31][i]; ;step2[31] = step1b[30][i] + step1b[31][i]; vadd.s16 q4, q0, q1 vsub.s16 q13, q0, q1 vadd.s16 q6, q2, q3 vsub.s16 q14, q2, q3 ; -------------------------------------------------------------------------- ; part of stage 3 ;temp1 = step1b[30][i] * cospi_28_64 - step1b[17][i] * cospi_4_64; ;temp2 = step1b[30][i] * cospi_4_64 - step1b[17][i] * cospi_28_64; ;step3[17] = dct_const_round_shift(temp1); ;step3[30] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD cospi_28_64, cospi_4_64, d10, d11, d14, d15 ; -------------------------------------------------------------------------- ; generate 18,19,28,29 ; -------------------------------------------------------------------------- ; part of stage 1 ;temp1 = input[9 * 32] * cospi_23_64 - input[23 * 32] * cospi_9_64; ;temp2 = input[9 * 32] * cospi_9_64 + input[23 * 32] * cospi_23_64; ;step1b[18][i] = dct_const_round_shift(temp1); ;step1b[29][i] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 15, 9, 23 DO_BUTTERFLY_STD cospi_23_64, cospi_9_64, d0, d1, d4, d5 ; -------------------------------------------------------------------------- ; part of stage 1 ;temp1 = input[25 * 32] * cospi_7_64 - input[7 * 32] * cospi_25_64; ;temp2 = input[25 * 32] * cospi_25_64 + input[7 * 32] * cospi_7_64; ;step1b[19][i] = dct_const_round_shift(temp1); ;step1b[28][i] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 23, 25, 7 DO_BUTTERFLY_STD cospi_7_64, cospi_25_64, d2, d3, d6, d7 ; -------------------------------------------------------------------------- ; part of stage 2 ;step2[18] = -step1b[18][i] + step1b[19][i]; ;step2[19] = step1b[18][i] + step1b[19][i]; ;step2[28] = step1b[28][i] + step1b[29][i]; ;step2[29] = step1b[28][i] - step1b[29][i]; vsub.s16 q13, q3, q2 vadd.s16 q3, q3, q2 vsub.s16 q14, q1, q0 vadd.s16 q2, q1, q0 ; -------------------------------------------------------------------------- ; part of stage 3 ;temp1 = step1b[18][i] * (-cospi_4_64) - step1b[29][i] * (-cospi_28_64); ;temp2 = step1b[18][i] * (-cospi_28_64) + step1b[29][i] * (-cospi_4_64); ;step3[29] = dct_const_round_shift(temp1); ;step3[18] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD (-cospi_4_64), (-cospi_28_64), d2, d3, d0, d1 ; -------------------------------------------------------------------------- ; combine 16-19,28-31 ; -------------------------------------------------------------------------- ; part of stage 4 ;step1[16] = step1b[16][i] + step1b[19][i]; ;step1[17] = step1b[17][i] + step1b[18][i]; ;step1[18] = step1b[17][i] - step1b[18][i]; ;step1[29] = step1b[30][i] - step1b[29][i]; ;step1[30] = step1b[30][i] + step1b[29][i]; ;step1[31] = step1b[31][i] + step1b[28][i]; vadd.s16 q8, q4, q2 vadd.s16 q9, q5, q0 vadd.s16 q10, q7, q1 vadd.s16 q15, q6, q3 vsub.s16 q13, q5, q0 vsub.s16 q14, q7, q1 STORE_IN_OUTPUT 0, 16, 31, q8, q15 STORE_IN_OUTPUT 31, 17, 30, q9, q10 ; -------------------------------------------------------------------------- ; part of stage 5 ;temp1 = step1b[29][i] * cospi_24_64 - step1b[18][i] * cospi_8_64; ;temp2 = step1b[29][i] * cospi_8_64 + step1b[18][i] * cospi_24_64; ;step2[18] = dct_const_round_shift(temp1); ;step2[29] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD cospi_24_64, cospi_8_64, d0, d1, d2, d3 STORE_IN_OUTPUT 30, 29, 18, q1, q0 ; -------------------------------------------------------------------------- ; part of stage 4 ;step1[19] = step1b[16][i] - step1b[19][i]; ;step1[28] = step1b[31][i] - step1b[28][i]; vsub.s16 q13, q4, q2 vsub.s16 q14, q6, q3 ; -------------------------------------------------------------------------- ; part of stage 5 ;temp1 = step1b[28][i] * cospi_24_64 - step1b[19][i] * cospi_8_64; ;temp2 = step1b[28][i] * cospi_8_64 + step1b[19][i] * cospi_24_64; ;step2[19] = dct_const_round_shift(temp1); ;step2[28] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD cospi_24_64, cospi_8_64, d8, d9, d12, d13 STORE_IN_OUTPUT 18, 19, 28, q4, q6 ; -------------------------------------------------------------------------- ; -------------------------------------------------------------------------- ; BLOCK B: 20-23,24-27 ; -------------------------------------------------------------------------- ; generate 20,21,26,27 ; -------------------------------------------------------------------------- ; part of stage 1 ;temp1 = input[5 * 32] * cospi_27_64 - input[27 * 32] * cospi_5_64; ;temp2 = input[5 * 32] * cospi_5_64 + input[27 * 32] * cospi_27_64; ;step1b[20][i] = dct_const_round_shift(temp1); ;step1b[27][i] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 7, 5, 27 DO_BUTTERFLY_STD cospi_27_64, cospi_5_64, d0, d1, d4, d5 ; -------------------------------------------------------------------------- ; part of stage 1 ;temp1 = input[21 * 32] * cospi_11_64 - input[11 * 32] * cospi_21_64; ;temp2 = input[21 * 32] * cospi_21_64 + input[11 * 32] * cospi_11_64; ;step1b[21][i] = dct_const_round_shift(temp1); ;step1b[26][i] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 27, 21, 11 DO_BUTTERFLY_STD cospi_11_64, cospi_21_64, d2, d3, d6, d7 ; -------------------------------------------------------------------------- ; part of stage 2 ;step2[20] = step1b[20][i] + step1b[21][i]; ;step2[21] = step1b[20][i] - step1b[21][i]; ;step2[26] = -step1b[26][i] + step1b[27][i]; ;step2[27] = step1b[26][i] + step1b[27][i]; vsub.s16 q13, q0, q1 vadd.s16 q0, q0, q1 vsub.s16 q14, q2, q3 vadd.s16 q2, q2, q3 ; -------------------------------------------------------------------------- ; part of stage 3 ;temp1 = step1b[26][i] * cospi_12_64 - step1b[21][i] * cospi_20_64; ;temp2 = step1b[26][i] * cospi_20_64 + step1b[21][i] * cospi_12_64; ;step3[21] = dct_const_round_shift(temp1); ;step3[26] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD cospi_12_64, cospi_20_64, d2, d3, d6, d7 ; -------------------------------------------------------------------------- ; generate 22,23,24,25 ; -------------------------------------------------------------------------- ; part of stage 1 ;temp1 = input[13 * 32] * cospi_19_64 - input[19 * 32] * cospi_13_64; ;temp2 = input[13 * 32] * cospi_13_64 + input[19 * 32] * cospi_19_64; ;step1b[22][i] = dct_const_round_shift(temp1); ;step1b[25][i] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 11, 13, 19 DO_BUTTERFLY_STD cospi_19_64, cospi_13_64, d10, d11, d14, d15 ; -------------------------------------------------------------------------- ; part of stage 1 ;temp1 = input[29 * 32] * cospi_3_64 - input[3 * 32] * cospi_29_64; ;temp2 = input[29 * 32] * cospi_29_64 + input[3 * 32] * cospi_3_64; ;step1b[23][i] = dct_const_round_shift(temp1); ;step1b[24][i] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 19, 29, 3 DO_BUTTERFLY_STD cospi_3_64, cospi_29_64, d8, d9, d12, d13 ; -------------------------------------------------------------------------- ; part of stage 2 ;step2[22] = -step1b[22][i] + step1b[23][i]; ;step2[23] = step1b[22][i] + step1b[23][i]; ;step2[24] = step1b[24][i] + step1b[25][i]; ;step2[25] = step1b[24][i] - step1b[25][i]; vsub.s16 q14, q4, q5 vadd.s16 q5, q4, q5 vsub.s16 q13, q6, q7 vadd.s16 q6, q6, q7 ; -------------------------------------------------------------------------- ; part of stage 3 ;temp1 = step1b[22][i] * (-cospi_20_64) - step1b[25][i] * (-cospi_12_64); ;temp2 = step1b[22][i] * (-cospi_12_64) + step1b[25][i] * (-cospi_20_64); ;step3[25] = dct_const_round_shift(temp1); ;step3[22] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD (-cospi_20_64), (-cospi_12_64), d8, d9, d14, d15 ; -------------------------------------------------------------------------- ; combine 20-23,24-27 ; -------------------------------------------------------------------------- ; part of stage 4 ;step1[22] = step1b[22][i] + step1b[21][i]; ;step1[23] = step1b[23][i] + step1b[20][i]; vadd.s16 q10, q7, q1 vadd.s16 q11, q5, q0 ;step1[24] = step1b[24][i] + step1b[27][i]; ;step1[25] = step1b[25][i] + step1b[26][i]; vadd.s16 q12, q6, q2 vadd.s16 q15, q4, q3 ; -------------------------------------------------------------------------- ; part of stage 6 ;step3[16] = step1b[16][i] + step1b[23][i]; ;step3[17] = step1b[17][i] + step1b[22][i]; ;step3[22] = step1b[17][i] - step1b[22][i]; ;step3[23] = step1b[16][i] - step1b[23][i]; LOAD_FROM_OUTPUT 28, 16, 17, q14, q13 vadd.s16 q8, q14, q11 vadd.s16 q9, q13, q10 vsub.s16 q13, q13, q10 vsub.s16 q11, q14, q11 STORE_IN_OUTPUT 17, 17, 16, q9, q8 ; -------------------------------------------------------------------------- ; part of stage 6 ;step3[24] = step1b[31][i] - step1b[24][i]; ;step3[25] = step1b[30][i] - step1b[25][i]; ;step3[30] = step1b[30][i] + step1b[25][i]; ;step3[31] = step1b[31][i] + step1b[24][i]; LOAD_FROM_OUTPUT 16, 30, 31, q14, q9 vsub.s16 q8, q9, q12 vadd.s16 q10, q14, q15 vsub.s16 q14, q14, q15 vadd.s16 q12, q9, q12 STORE_IN_OUTPUT 31, 30, 31, q10, q12 ; -------------------------------------------------------------------------- ; TODO(cd) do some register allocation change to remove these push/pop vpush {q8} ; [24] vpush {q11} ; [23] ; -------------------------------------------------------------------------- ; part of stage 7 ;temp1 = (step1b[25][i] - step1b[22][i]) * cospi_16_64; ;temp2 = (step1b[25][i] + step1b[22][i]) * cospi_16_64; ;step1[22] = dct_const_round_shift(temp1); ;step1[25] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d26, d27, d28, d29 STORE_IN_OUTPUT 31, 25, 22, q14, q13 ; -------------------------------------------------------------------------- ; part of stage 7 ;temp1 = (step1b[24][i] - step1b[23][i]) * cospi_16_64; ;temp2 = (step1b[24][i] + step1b[23][i]) * cospi_16_64; ;step1[23] = dct_const_round_shift(temp1); ;step1[24] = dct_const_round_shift(temp2); ; TODO(cd) do some register allocation change to remove these push/pop vpop {q13} ; [23] vpop {q14} ; [24] DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d26, d27, d28, d29 STORE_IN_OUTPUT 22, 24, 23, q14, q13 ; -------------------------------------------------------------------------- ; part of stage 4 ;step1[20] = step1b[23][i] - step1b[20][i]; ;step1[27] = step1b[24][i] - step1b[27][i]; vsub.s16 q14, q5, q0 vsub.s16 q13, q6, q2 ; -------------------------------------------------------------------------- ; part of stage 5 ;temp1 = step1b[20][i] * (-cospi_8_64) - step1b[27][i] * (-cospi_24_64); ;temp2 = step1b[20][i] * (-cospi_24_64) + step1b[27][i] * (-cospi_8_64); ;step2[27] = dct_const_round_shift(temp1); ;step2[20] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD (-cospi_8_64), (-cospi_24_64), d10, d11, d12, d13 ; -------------------------------------------------------------------------- ; part of stage 4 ;step1[21] = step1b[22][i] - step1b[21][i]; ;step1[26] = step1b[25][i] - step1b[26][i]; vsub.s16 q14, q7, q1 vsub.s16 q13, q4, q3 ; -------------------------------------------------------------------------- ; part of stage 5 ;temp1 = step1b[21][i] * (-cospi_8_64) - step1b[26][i] * (-cospi_24_64); ;temp2 = step1b[21][i] * (-cospi_24_64) + step1b[26][i] * (-cospi_8_64); ;step2[26] = dct_const_round_shift(temp1); ;step2[21] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD (-cospi_8_64), (-cospi_24_64), d0, d1, d2, d3 ; -------------------------------------------------------------------------- ; part of stage 6 ;step3[18] = step1b[18][i] + step1b[21][i]; ;step3[19] = step1b[19][i] + step1b[20][i]; ;step3[20] = step1b[19][i] - step1b[20][i]; ;step3[21] = step1b[18][i] - step1b[21][i]; LOAD_FROM_OUTPUT 23, 18, 19, q14, q13 vadd.s16 q8, q14, q1 vadd.s16 q9, q13, q6 vsub.s16 q13, q13, q6 vsub.s16 q1, q14, q1 STORE_IN_OUTPUT 19, 18, 19, q8, q9 ; -------------------------------------------------------------------------- ; part of stage 6 ;step3[27] = step1b[28][i] - step1b[27][i]; ;step3[28] = step1b[28][i] + step1b[27][i]; ;step3[29] = step1b[29][i] + step1b[26][i]; ;step3[26] = step1b[29][i] - step1b[26][i]; LOAD_FROM_OUTPUT 19, 28, 29, q8, q9 vsub.s16 q14, q8, q5 vadd.s16 q10, q8, q5 vadd.s16 q11, q9, q0 vsub.s16 q0, q9, q0 STORE_IN_OUTPUT 29, 28, 29, q10, q11 ; -------------------------------------------------------------------------- ; part of stage 7 ;temp1 = (step1b[27][i] - step1b[20][i]) * cospi_16_64; ;temp2 = (step1b[27][i] + step1b[20][i]) * cospi_16_64; ;step1[20] = dct_const_round_shift(temp1); ;step1[27] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d26, d27, d28, d29 STORE_IN_OUTPUT 29, 20, 27, q13, q14 ; -------------------------------------------------------------------------- ; part of stage 7 ;temp1 = (step1b[26][i] - step1b[21][i]) * cospi_16_64; ;temp2 = (step1b[26][i] + step1b[21][i]) * cospi_16_64; ;step1[21] = dct_const_round_shift(temp1); ;step1[26] = dct_const_round_shift(temp2); DO_BUTTERFLY d0, d1, d2, d3, cospi_16_64, cospi_16_64, d2, d3, d0, d1 STORE_IN_OUTPUT 27, 21, 26, q1, q0 ; -------------------------------------------------------------------------- ; -------------------------------------------------------------------------- ; BLOCK C: 8-10,11-15 ; -------------------------------------------------------------------------- ; generate 8,9,14,15 ; -------------------------------------------------------------------------- ; part of stage 2 ;temp1 = input[2 * 32] * cospi_30_64 - input[30 * 32] * cospi_2_64; ;temp2 = input[2 * 32] * cospi_2_64 + input[30 * 32] * cospi_30_64; ;step2[8] = dct_const_round_shift(temp1); ;step2[15] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 3, 2, 30 DO_BUTTERFLY_STD cospi_30_64, cospi_2_64, d0, d1, d4, d5 ; -------------------------------------------------------------------------- ; part of stage 2 ;temp1 = input[18 * 32] * cospi_14_64 - input[14 * 32] * cospi_18_64; ;temp2 = input[18 * 32] * cospi_18_64 + input[14 * 32] * cospi_14_64; ;step2[9] = dct_const_round_shift(temp1); ;step2[14] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 30, 18, 14 DO_BUTTERFLY_STD cospi_14_64, cospi_18_64, d2, d3, d6, d7 ; -------------------------------------------------------------------------- ; part of stage 3 ;step3[8] = step1b[8][i] + step1b[9][i]; ;step3[9] = step1b[8][i] - step1b[9][i]; ;step3[14] = step1b[15][i] - step1b[14][i]; ;step3[15] = step1b[15][i] + step1b[14][i]; vsub.s16 q13, q0, q1 vadd.s16 q0, q0, q1 vsub.s16 q14, q2, q3 vadd.s16 q2, q2, q3 ; -------------------------------------------------------------------------- ; part of stage 4 ;temp1 = step1b[14][i] * cospi_24_64 - step1b[9][i] * cospi_8_64; ;temp2 = step1b[14][i] * cospi_8_64 + step1b[9][i] * cospi_24_64; ;step1[9] = dct_const_round_shift(temp1); ;step1[14] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD cospi_24_64, cospi_8_64, d2, d3, d6, d7 ; -------------------------------------------------------------------------- ; generate 10,11,12,13 ; -------------------------------------------------------------------------- ; part of stage 2 ;temp1 = input[10 * 32] * cospi_22_64 - input[22 * 32] * cospi_10_64; ;temp2 = input[10 * 32] * cospi_10_64 + input[22 * 32] * cospi_22_64; ;step2[10] = dct_const_round_shift(temp1); ;step2[13] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 14, 10, 22 DO_BUTTERFLY_STD cospi_22_64, cospi_10_64, d10, d11, d14, d15 ; -------------------------------------------------------------------------- ; part of stage 2 ;temp1 = input[26 * 32] * cospi_6_64 - input[6 * 32] * cospi_26_64; ;temp2 = input[26 * 32] * cospi_26_64 + input[6 * 32] * cospi_6_64; ;step2[11] = dct_const_round_shift(temp1); ;step2[12] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 22, 26, 6 DO_BUTTERFLY_STD cospi_6_64, cospi_26_64, d8, d9, d12, d13 ; -------------------------------------------------------------------------- ; part of stage 3 ;step3[10] = step1b[11][i] - step1b[10][i]; ;step3[11] = step1b[11][i] + step1b[10][i]; ;step3[12] = step1b[12][i] + step1b[13][i]; ;step3[13] = step1b[12][i] - step1b[13][i]; vsub.s16 q14, q4, q5 vadd.s16 q5, q4, q5 vsub.s16 q13, q6, q7 vadd.s16 q6, q6, q7 ; -------------------------------------------------------------------------- ; part of stage 4 ;temp1 = step1b[10][i] * (-cospi_8_64) - step1b[13][i] * (-cospi_24_64); ;temp2 = step1b[10][i] * (-cospi_24_64) + step1b[13][i] * (-cospi_8_64); ;step1[13] = dct_const_round_shift(temp1); ;step1[10] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD (-cospi_8_64), (-cospi_24_64), d8, d9, d14, d15 ; -------------------------------------------------------------------------- ; combine 8-10,11-15 ; -------------------------------------------------------------------------- ; part of stage 5 ;step2[8] = step1b[8][i] + step1b[11][i]; ;step2[9] = step1b[9][i] + step1b[10][i]; ;step2[10] = step1b[9][i] - step1b[10][i]; vadd.s16 q8, q0, q5 vadd.s16 q9, q1, q7 vsub.s16 q13, q1, q7 ;step2[13] = step1b[14][i] - step1b[13][i]; ;step2[14] = step1b[14][i] + step1b[13][i]; ;step2[15] = step1b[15][i] + step1b[12][i]; vsub.s16 q14, q3, q4 vadd.s16 q10, q3, q4 vadd.s16 q15, q2, q6 STORE_IN_OUTPUT 26, 8, 15, q8, q15 STORE_IN_OUTPUT 15, 9, 14, q9, q10 ; -------------------------------------------------------------------------- ; part of stage 6 ;temp1 = (step1b[13][i] - step1b[10][i]) * cospi_16_64; ;temp2 = (step1b[13][i] + step1b[10][i]) * cospi_16_64; ;step3[10] = dct_const_round_shift(temp1); ;step3[13] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d2, d3, d6, d7 STORE_IN_OUTPUT 14, 13, 10, q3, q1 ; -------------------------------------------------------------------------- ; part of stage 5 ;step2[11] = step1b[8][i] - step1b[11][i]; ;step2[12] = step1b[15][i] - step1b[12][i]; vsub.s16 q13, q0, q5 vsub.s16 q14, q2, q6 ; -------------------------------------------------------------------------- ; part of stage 6 ;temp1 = (step1b[12][i] - step1b[11][i]) * cospi_16_64; ;temp2 = (step1b[12][i] + step1b[11][i]) * cospi_16_64; ;step3[11] = dct_const_round_shift(temp1); ;step3[12] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d2, d3, d6, d7 STORE_IN_OUTPUT 10, 11, 12, q1, q3 ; -------------------------------------------------------------------------- ; -------------------------------------------------------------------------- ; BLOCK D: 0-3,4-7 ; -------------------------------------------------------------------------- ; generate 4,5,6,7 ; -------------------------------------------------------------------------- ; part of stage 3 ;temp1 = input[4 * 32] * cospi_28_64 - input[28 * 32] * cospi_4_64; ;temp2 = input[4 * 32] * cospi_4_64 + input[28 * 32] * cospi_28_64; ;step3[4] = dct_const_round_shift(temp1); ;step3[7] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 6, 4, 28 DO_BUTTERFLY_STD cospi_28_64, cospi_4_64, d0, d1, d4, d5 ; -------------------------------------------------------------------------- ; part of stage 3 ;temp1 = input[20 * 32] * cospi_12_64 - input[12 * 32] * cospi_20_64; ;temp2 = input[20 * 32] * cospi_20_64 + input[12 * 32] * cospi_12_64; ;step3[5] = dct_const_round_shift(temp1); ;step3[6] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 28, 20, 12 DO_BUTTERFLY_STD cospi_12_64, cospi_20_64, d2, d3, d6, d7 ; -------------------------------------------------------------------------- ; part of stage 4 ;step1[4] = step1b[4][i] + step1b[5][i]; ;step1[5] = step1b[4][i] - step1b[5][i]; ;step1[6] = step1b[7][i] - step1b[6][i]; ;step1[7] = step1b[7][i] + step1b[6][i]; vsub.s16 q13, q0, q1 vadd.s16 q0, q0, q1 vsub.s16 q14, q2, q3 vadd.s16 q2, q2, q3 ; -------------------------------------------------------------------------- ; part of stage 5 ;temp1 = (step1b[6][i] - step1b[5][i]) * cospi_16_64; ;temp2 = (step1b[5][i] + step1b[6][i]) * cospi_16_64; ;step2[5] = dct_const_round_shift(temp1); ;step2[6] = dct_const_round_shift(temp2); DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d2, d3, d6, d7 ; -------------------------------------------------------------------------- ; generate 0,1,2,3 ; -------------------------------------------------------------------------- ; part of stage 4 ;temp1 = (input[0 * 32] - input[16 * 32]) * cospi_16_64; ;temp2 = (input[0 * 32] + input[16 * 32]) * cospi_16_64; ;step1[1] = dct_const_round_shift(temp1); ;step1[0] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 12, 0, 16 DO_BUTTERFLY_STD cospi_16_64, cospi_16_64, d10, d11, d14, d15 ; -------------------------------------------------------------------------- ; part of stage 4 ;temp1 = input[8 * 32] * cospi_24_64 - input[24 * 32] * cospi_8_64; ;temp2 = input[8 * 32] * cospi_8_64 + input[24 * 32] * cospi_24_64; ;step1[2] = dct_const_round_shift(temp1); ;step1[3] = dct_const_round_shift(temp2); LOAD_FROM_TRANSPOSED 16, 8, 24 DO_BUTTERFLY_STD cospi_24_64, cospi_8_64, d28, d29, d12, d13 ; -------------------------------------------------------------------------- ; part of stage 5 ;step2[0] = step1b[0][i] + step1b[3][i]; ;step2[1] = step1b[1][i] + step1b[2][i]; ;step2[2] = step1b[1][i] - step1b[2][i]; ;step2[3] = step1b[0][i] - step1b[3][i]; vadd.s16 q4, q7, q6 vsub.s16 q7, q7, q6 vsub.s16 q6, q5, q14 vadd.s16 q5, q5, q14 ; -------------------------------------------------------------------------- ; combine 0-3,4-7 ; -------------------------------------------------------------------------- ; part of stage 6 ;step3[0] = step1b[0][i] + step1b[7][i]; ;step3[1] = step1b[1][i] + step1b[6][i]; ;step3[2] = step1b[2][i] + step1b[5][i]; ;step3[3] = step1b[3][i] + step1b[4][i]; vadd.s16 q8, q4, q2 vadd.s16 q9, q5, q3 vadd.s16 q10, q6, q1 vadd.s16 q11, q7, q0 ;step3[4] = step1b[3][i] - step1b[4][i]; ;step3[5] = step1b[2][i] - step1b[5][i]; ;step3[6] = step1b[1][i] - step1b[6][i]; ;step3[7] = step1b[0][i] - step1b[7][i]; vsub.s16 q12, q7, q0 vsub.s16 q13, q6, q1 vsub.s16 q14, q5, q3 vsub.s16 q15, q4, q2 ; -------------------------------------------------------------------------- ; part of stage 7 ;step1[0] = step1b[0][i] + step1b[15][i]; ;step1[1] = step1b[1][i] + step1b[14][i]; ;step1[14] = step1b[1][i] - step1b[14][i]; ;step1[15] = step1b[0][i] - step1b[15][i]; LOAD_FROM_OUTPUT 12, 14, 15, q0, q1 vadd.s16 q2, q8, q1 vadd.s16 q3, q9, q0 vsub.s16 q4, q9, q0 vsub.s16 q5, q8, q1 ; -------------------------------------------------------------------------- ; part of final stage ;output[14 * 32] = step1b[14][i] + step1b[17][i]; ;output[15 * 32] = step1b[15][i] + step1b[16][i]; ;output[16 * 32] = step1b[15][i] - step1b[16][i]; ;output[17 * 32] = step1b[14][i] - step1b[17][i]; LOAD_FROM_OUTPUT 15, 16, 17, q0, q1 vadd.s16 q8, q4, q1 vadd.s16 q9, q5, q0 vsub.s16 q6, q5, q0 vsub.s16 q7, q4, q1 cmp r5, #0 bgt idct32_bands_end_2nd_pass idct32_bands_end_1st_pass STORE_IN_OUTPUT 17, 16, 17, q6, q7 STORE_IN_OUTPUT 17, 14, 15, q8, q9 ; -------------------------------------------------------------------------- ; part of final stage ;output[ 0 * 32] = step1b[0][i] + step1b[31][i]; ;output[ 1 * 32] = step1b[1][i] + step1b[30][i]; ;output[30 * 32] = step1b[1][i] - step1b[30][i]; ;output[31 * 32] = step1b[0][i] - step1b[31][i]; LOAD_FROM_OUTPUT 15, 30, 31, q0, q1 vadd.s16 q4, q2, q1 vadd.s16 q5, q3, q0 vsub.s16 q6, q3, q0 vsub.s16 q7, q2, q1 STORE_IN_OUTPUT 31, 30, 31, q6, q7 STORE_IN_OUTPUT 31, 0, 1, q4, q5 ; -------------------------------------------------------------------------- ; part of stage 7 ;step1[2] = step1b[2][i] + step1b[13][i]; ;step1[3] = step1b[3][i] + step1b[12][i]; ;step1[12] = step1b[3][i] - step1b[12][i]; ;step1[13] = step1b[2][i] - step1b[13][i]; LOAD_FROM_OUTPUT 1, 12, 13, q0, q1 vadd.s16 q2, q10, q1 vadd.s16 q3, q11, q0 vsub.s16 q4, q11, q0 vsub.s16 q5, q10, q1 ; -------------------------------------------------------------------------- ; part of final stage ;output[12 * 32] = step1b[12][i] + step1b[19][i]; ;output[13 * 32] = step1b[13][i] + step1b[18][i]; ;output[18 * 32] = step1b[13][i] - step1b[18][i]; ;output[19 * 32] = step1b[12][i] - step1b[19][i]; LOAD_FROM_OUTPUT 13, 18, 19, q0, q1 vadd.s16 q8, q4, q1 vadd.s16 q9, q5, q0 vsub.s16 q6, q5, q0 vsub.s16 q7, q4, q1 STORE_IN_OUTPUT 19, 18, 19, q6, q7 STORE_IN_OUTPUT 19, 12, 13, q8, q9 ; -------------------------------------------------------------------------- ; part of final stage ;output[ 2 * 32] = step1b[2][i] + step1b[29][i]; ;output[ 3 * 32] = step1b[3][i] + step1b[28][i]; ;output[28 * 32] = step1b[3][i] - step1b[28][i]; ;output[29 * 32] = step1b[2][i] - step1b[29][i]; LOAD_FROM_OUTPUT 13, 28, 29, q0, q1 vadd.s16 q4, q2, q1 vadd.s16 q5, q3, q0 vsub.s16 q6, q3, q0 vsub.s16 q7, q2, q1 STORE_IN_OUTPUT 29, 28, 29, q6, q7 STORE_IN_OUTPUT 29, 2, 3, q4, q5 ; -------------------------------------------------------------------------- ; part of stage 7 ;step1[4] = step1b[4][i] + step1b[11][i]; ;step1[5] = step1b[5][i] + step1b[10][i]; ;step1[10] = step1b[5][i] - step1b[10][i]; ;step1[11] = step1b[4][i] - step1b[11][i]; LOAD_FROM_OUTPUT 3, 10, 11, q0, q1 vadd.s16 q2, q12, q1 vadd.s16 q3, q13, q0 vsub.s16 q4, q13, q0 vsub.s16 q5, q12, q1 ; -------------------------------------------------------------------------- ; part of final stage ;output[10 * 32] = step1b[10][i] + step1b[21][i]; ;output[11 * 32] = step1b[11][i] + step1b[20][i]; ;output[20 * 32] = step1b[11][i] - step1b[20][i]; ;output[21 * 32] = step1b[10][i] - step1b[21][i]; LOAD_FROM_OUTPUT 11, 20, 21, q0, q1 vadd.s16 q8, q4, q1 vadd.s16 q9, q5, q0 vsub.s16 q6, q5, q0 vsub.s16 q7, q4, q1 STORE_IN_OUTPUT 21, 20, 21, q6, q7 STORE_IN_OUTPUT 21, 10, 11, q8, q9 ; -------------------------------------------------------------------------- ; part of final stage ;output[ 4 * 32] = step1b[4][i] + step1b[27][i]; ;output[ 5 * 32] = step1b[5][i] + step1b[26][i]; ;output[26 * 32] = step1b[5][i] - step1b[26][i]; ;output[27 * 32] = step1b[4][i] - step1b[27][i]; LOAD_FROM_OUTPUT 11, 26, 27, q0, q1 vadd.s16 q4, q2, q1 vadd.s16 q5, q3, q0 vsub.s16 q6, q3, q0 vsub.s16 q7, q2, q1 STORE_IN_OUTPUT 27, 26, 27, q6, q7 STORE_IN_OUTPUT 27, 4, 5, q4, q5 ; -------------------------------------------------------------------------- ; part of stage 7 ;step1[6] = step1b[6][i] + step1b[9][i]; ;step1[7] = step1b[7][i] + step1b[8][i]; ;step1[8] = step1b[7][i] - step1b[8][i]; ;step1[9] = step1b[6][i] - step1b[9][i]; LOAD_FROM_OUTPUT 5, 8, 9, q0, q1 vadd.s16 q2, q14, q1 vadd.s16 q3, q15, q0 vsub.s16 q4, q15, q0 vsub.s16 q5, q14, q1 ; -------------------------------------------------------------------------- ; part of final stage ;output[ 8 * 32] = step1b[8][i] + step1b[23][i]; ;output[ 9 * 32] = step1b[9][i] + step1b[22][i]; ;output[22 * 32] = step1b[9][i] - step1b[22][i]; ;output[23 * 32] = step1b[8][i] - step1b[23][i]; LOAD_FROM_OUTPUT 9, 22, 23, q0, q1 vadd.s16 q8, q4, q1 vadd.s16 q9, q5, q0 vsub.s16 q6, q5, q0 vsub.s16 q7, q4, q1 STORE_IN_OUTPUT 23, 22, 23, q6, q7 STORE_IN_OUTPUT 23, 8, 9, q8, q9 ; -------------------------------------------------------------------------- ; part of final stage ;output[ 6 * 32] = step1b[6][i] + step1b[25][i]; ;output[ 7 * 32] = step1b[7][i] + step1b[24][i]; ;output[24 * 32] = step1b[7][i] - step1b[24][i]; ;output[25 * 32] = step1b[6][i] - step1b[25][i]; LOAD_FROM_OUTPUT 9, 24, 25, q0, q1 vadd.s16 q4, q2, q1 vadd.s16 q5, q3, q0 vsub.s16 q6, q3, q0 vsub.s16 q7, q2, q1 STORE_IN_OUTPUT 25, 24, 25, q6, q7 STORE_IN_OUTPUT 25, 6, 7, q4, q5 ; restore r0 by removing the last offset from the last ; operation (LOAD_FROM_TRANSPOSED 16, 8, 24) => 24*8*2 sub r0, r0, #24*8*2 ; restore r1 by removing the last offset from the last ; operation (STORE_IN_OUTPUT 24, 6, 7) => 7*32*2 ; advance by 8 columns => 8*2 sub r1, r1, #7*32*2 - 8*2 ; advance by 8 lines (8*32*2) ; go back by the two pairs from the loop (32*2) add r3, r3, #8*32*2 - 32*2 ; bands loop processing subs r4, r4, #1 bne idct32_bands_loop ; parameters for second pass ; the input of pass2 is the result of pass1. we have to remove the offset ; of 32 columns induced by the above idct32_bands_loop sub r3, r1, #32*2 ; r1 = pass2[32 * 32] add r1, sp, #2048 ; pass loop processing add r5, r5, #1 b idct32_pass_loop idct32_bands_end_2nd_pass STORE_COMBINE_CENTER_RESULTS ; -------------------------------------------------------------------------- ; part of final stage ;output[ 0 * 32] = step1b[0][i] + step1b[31][i]; ;output[ 1 * 32] = step1b[1][i] + step1b[30][i]; ;output[30 * 32] = step1b[1][i] - step1b[30][i]; ;output[31 * 32] = step1b[0][i] - step1b[31][i]; LOAD_FROM_OUTPUT 17, 30, 31, q0, q1 vadd.s16 q4, q2, q1 vadd.s16 q5, q3, q0 vsub.s16 q6, q3, q0 vsub.s16 q7, q2, q1 STORE_COMBINE_EXTREME_RESULTS ; -------------------------------------------------------------------------- ; part of stage 7 ;step1[2] = step1b[2][i] + step1b[13][i]; ;step1[3] = step1b[3][i] + step1b[12][i]; ;step1[12] = step1b[3][i] - step1b[12][i]; ;step1[13] = step1b[2][i] - step1b[13][i]; LOAD_FROM_OUTPUT 31, 12, 13, q0, q1 vadd.s16 q2, q10, q1 vadd.s16 q3, q11, q0 vsub.s16 q4, q11, q0 vsub.s16 q5, q10, q1 ; -------------------------------------------------------------------------- ; part of final stage ;output[12 * 32] = step1b[12][i] + step1b[19][i]; ;output[13 * 32] = step1b[13][i] + step1b[18][i]; ;output[18 * 32] = step1b[13][i] - step1b[18][i]; ;output[19 * 32] = step1b[12][i] - step1b[19][i]; LOAD_FROM_OUTPUT 13, 18, 19, q0, q1 vadd.s16 q8, q4, q1 vadd.s16 q9, q5, q0 vsub.s16 q6, q5, q0 vsub.s16 q7, q4, q1 STORE_COMBINE_CENTER_RESULTS ; -------------------------------------------------------------------------- ; part of final stage ;output[ 2 * 32] = step1b[2][i] + step1b[29][i]; ;output[ 3 * 32] = step1b[3][i] + step1b[28][i]; ;output[28 * 32] = step1b[3][i] - step1b[28][i]; ;output[29 * 32] = step1b[2][i] - step1b[29][i]; LOAD_FROM_OUTPUT 19, 28, 29, q0, q1 vadd.s16 q4, q2, q1 vadd.s16 q5, q3, q0 vsub.s16 q6, q3, q0 vsub.s16 q7, q2, q1 STORE_COMBINE_EXTREME_RESULTS ; -------------------------------------------------------------------------- ; part of stage 7 ;step1[4] = step1b[4][i] + step1b[11][i]; ;step1[5] = step1b[5][i] + step1b[10][i]; ;step1[10] = step1b[5][i] - step1b[10][i]; ;step1[11] = step1b[4][i] - step1b[11][i]; LOAD_FROM_OUTPUT 29, 10, 11, q0, q1 vadd.s16 q2, q12, q1 vadd.s16 q3, q13, q0 vsub.s16 q4, q13, q0 vsub.s16 q5, q12, q1 ; -------------------------------------------------------------------------- ; part of final stage ;output[10 * 32] = step1b[10][i] + step1b[21][i]; ;output[11 * 32] = step1b[11][i] + step1b[20][i]; ;output[20 * 32] = step1b[11][i] - step1b[20][i]; ;output[21 * 32] = step1b[10][i] - step1b[21][i]; LOAD_FROM_OUTPUT 11, 20, 21, q0, q1 vadd.s16 q8, q4, q1 vadd.s16 q9, q5, q0 vsub.s16 q6, q5, q0 vsub.s16 q7, q4, q1 STORE_COMBINE_CENTER_RESULTS ; -------------------------------------------------------------------------- ; part of final stage ;output[ 4 * 32] = step1b[4][i] + step1b[27][i]; ;output[ 5 * 32] = step1b[5][i] + step1b[26][i]; ;output[26 * 32] = step1b[5][i] - step1b[26][i]; ;output[27 * 32] = step1b[4][i] - step1b[27][i]; LOAD_FROM_OUTPUT 21, 26, 27, q0, q1 vadd.s16 q4, q2, q1 vadd.s16 q5, q3, q0 vsub.s16 q6, q3, q0 vsub.s16 q7, q2, q1 STORE_COMBINE_EXTREME_RESULTS ; -------------------------------------------------------------------------- ; part of stage 7 ;step1[6] = step1b[6][i] + step1b[9][i]; ;step1[7] = step1b[7][i] + step1b[8][i]; ;step1[8] = step1b[7][i] - step1b[8][i]; ;step1[9] = step1b[6][i] - step1b[9][i]; LOAD_FROM_OUTPUT 27, 8, 9, q0, q1 vadd.s16 q2, q14, q1 vadd.s16 q3, q15, q0 vsub.s16 q4, q15, q0 vsub.s16 q5, q14, q1 ; -------------------------------------------------------------------------- ; part of final stage ;output[ 8 * 32] = step1b[8][i] + step1b[23][i]; ;output[ 9 * 32] = step1b[9][i] + step1b[22][i]; ;output[22 * 32] = step1b[9][i] - step1b[22][i]; ;output[23 * 32] = step1b[8][i] - step1b[23][i]; LOAD_FROM_OUTPUT 9, 22, 23, q0, q1 vadd.s16 q8, q4, q1 vadd.s16 q9, q5, q0 vsub.s16 q6, q5, q0 vsub.s16 q7, q4, q1 STORE_COMBINE_CENTER_RESULTS_LAST ; -------------------------------------------------------------------------- ; part of final stage ;output[ 6 * 32] = step1b[6][i] + step1b[25][i]; ;output[ 7 * 32] = step1b[7][i] + step1b[24][i]; ;output[24 * 32] = step1b[7][i] - step1b[24][i]; ;output[25 * 32] = step1b[6][i] - step1b[25][i]; LOAD_FROM_OUTPUT 23, 24, 25, q0, q1 vadd.s16 q4, q2, q1 vadd.s16 q5, q3, q0 vsub.s16 q6, q3, q0 vsub.s16 q7, q2, q1 STORE_COMBINE_EXTREME_RESULTS_LAST ; -------------------------------------------------------------------------- ; restore pointers to their initial indices for next band pass by ; removing/adding dest_stride * 8. The actual increment by eight ; is taken care of within the _LAST macros. add r6, r6, r2, lsl #3 add r9, r9, r2, lsl #3 sub r7, r7, r2, lsl #3 sub r10, r10, r2, lsl #3 ; restore r0 by removing the last offset from the last ; operation (LOAD_FROM_TRANSPOSED 16, 8, 24) => 24*8*2 sub r0, r0, #24*8*2 ; restore r1 by removing the last offset from the last ; operation (LOAD_FROM_OUTPUT 23, 24, 25) => 25*32*2 ; advance by 8 columns => 8*2 sub r1, r1, #25*32*2 - 8*2 ; advance by 8 lines (8*32*2) ; go back by the two pairs from the loop (32*2) add r3, r3, #8*32*2 - 32*2 ; bands loop processing subs r4, r4, #1 bne idct32_bands_loop ; stack operation add sp, sp, #512+2048+2048 vpop {d8-d15} pop {r4-r11} bx lr ENDP ; |vp9_idct32x32_1024_add_neon| END
41.617692
106
0.49391
e98b6706e80dc891628729209df7d7a5f8962b92
21,829
asm
Assembly
ZX-Spectrum/assembly/streams.asm
peroff/8-Bit-Tea-Party
374d486a9712a7d6286d8080c1e98e28b1c5e066
[ "MIT" ]
13
2018-08-01T20:29:20.000Z
2021-09-03T21:49:25.000Z
ZX-Spectrum/assembly/streams.asm
peroff/8-Bit-Tea-Party
374d486a9712a7d6286d8080c1e98e28b1c5e066
[ "MIT" ]
3
2019-09-18T21:13:41.000Z
2021-10-10T13:45:17.000Z
ZX-Spectrum/assembly/streams.asm
peroff/8-Bit-Tea-Party
374d486a9712a7d6286d8080c1e98e28b1c5e066
[ "MIT" ]
4
2019-09-18T20:25:37.000Z
2021-08-19T10:17:46.000Z
;WELCOME TO 8-BIT TEA PARTY! ; ;MAIN FILE FOR ASSEMBLER CODE ON STREAMS. ;WE USING PENTAGON-128K MODEL EMULATION. ; ;CPU: Zilog Z80, 3.5HhZ, 1976. ;RAM: 48Kb, 128Kb With more memory. ;ROM: 16Kb, base and more with 128Kb. ;SCREEN:256x192 monohrome pixels, ; 32x24 color attributes. ;SOUND: 1-Bit beeper, ; AY-3-8910 or YM2149F chip. ;CTRL: Keybord and kempston joystick. ;ADRESS WIDTH: ; 16 BITS OR 0..64Kb OR #0000..#FFFF ;REGISTERS: 8-BIT PART OR 16-BIT AS PAIR. ; AF - ACCUMULATOR AND FLAGS ; BC - DATA/ADDR, FOR LOOPS ; DE - DATA/ADDR, OPERAND HL ; HL - 16-BIT ACCUMULATOR ; I - INTERRUPT, R(DRAM). ;REGISTERS: 16-BIT ONLY. ; IX - INDEX REGISTER. ; IY - INDEX REGISTER. ; SP - STACK POINTER. ; PC - PROGRAM COUNTER. ;INTERRUPTS: ; NMI - NON MASKABLE INTERRUPT. ; IM0 - MASKABLE, HARDWARE. ; IM1 - MASKABLE, STANDARD. ; IM2 - MASKABLE, USER DEFINED. ;IM2 function [I] * 256 + [D]=255. OPEN_CHANNEL EQU #1601 PRINT_STRING EQU #203C SCREEN_PIXELS EQU #4000 ;16384 SCREEN_ATTRIB EQU #5800 ;22528 SCREEN_P_SIZE EQU #1800 ;6Kb SCREEN_A_SIZE EQU #300 ;768Bytes SCREEN_ATTRIB_H EQU #58 SCREEN_ATTRIB_L EQU #00 SCREEN_ADDR_TOP EQU #5B00 SCREEN_ATTR_WS EQU #180 ;In words SCREEN_PIX_WS EQU #0C00 ;In words SCR_A_MID_ADDR EQU #5900 ;S+256 SCR_ATTR_SIZE_X EQU #20 ;32 SCR_ATTR_SIZE_Y EQU #18 ;24 SCR_A_PART_SIZE EQU #100 ;256 Bytes FONT_SIZE EQU #08 ;8x8 TIMER_FONT_SIZE EQU #58 ;88 bytes FONT_CODE_START EQU #00 ;32 Space IM2_PER_SEC EQU #32 ;50 ints SEC_PER_MIN EQU #3C ;60 secs NUM_SYS_BASE EQU #0A ;DEC(10) IM2_I_REG EQU #5B IM2_B_DATA EQU #FF ORG #6000 ;START ADDRESS LD (ALASM_STACK),SP LD SP,(PROGRAM_STACK) PUSH DE LD DE,IM2 CALL IM2_SETUP ;Stream 12. Draw basic sprite function. ;TESTING BOB AS SPRITE IN OUR GAME. LD D,%01000111 LD E,%00000000 CALL CLEAR_SCR LD HL,BG_GAME LD DE,#0400 ;SIZE BACKGROUND LD BC,#1020 LD IX,SPRITE_MASK CALL DRAW_SPRITE LD BC,#0010 T_AN_0: PUSH BC LD A,#10 CALL IM2_DELAY LD HL,BOB_DATA_1 LD IX,BOB_MASK LD BC,#0404 LD DE,#1312 CALL DRAW_SPRITE LD A,#10 CALL IM2_DELAY CALL DRAW_SPRITE LD HL,BOB_DATA_2 CALL DRAW_SPRITE POP BC DEC BC LD A,B OR C JR NZ,T_AN_0 JP TO_RET ;TESTING PERFORMANCE ON SIZES. LD HL,#0400 T_SPR_2:HALT PUSH HL LD HL,SPRITE_DATA LD DE,#080C LD BC,#0208 LD IX,SPRITE_MASK CALL DRAW_SPRITE LD A,#04 OUT (#FE),A POP HL DEC HL LD A,H OR L JR NZ,T_SPR_2 JP TO_RET ;SIMPLE SPRITE TEST 1x1, ALL COORDINATES. LD DE,#0000 T_SPR_1:PUSH DE LD BC,#0101 LD HL,SPRITE_DATA LD IX,SPRITE_MASK T_SPR_0:;HALT ;HALT CALL DRAW_SPRITE INC E LD A,E CP SCR_ATTR_SIZE_X JR NZ,T_SPR_0 POP DE INC D LD A,D CP SCR_ATTR_SIZE_Y JR NZ,T_SPR_1 ;CALL SCROLL_TEXT_WIN ;CALL PRINT_TEXT_SCALE ;CALL PRINT_CHARS_SCR ;CALL SCROLL_TEXT_ATTR ;CALL TIMER_ATTR_FONTS ;CALL TEXT_DYNAMIC_ATTR ;CALL CLEAR_SCR_FUNCS ;CALL IM2_PERFORMANCE TO_RET: POP DE LD SP,(ALASM_STACK) RET ;Global variables and data. STR_HELLO DEFB "Hello World!",0 PROGRAM_STACK DEFW #5F00 ALASM_STACK DEFW #0000 SPRITE_DATA: DUP #100 DEFB %01010101 DEFB %10101010 EDUP SPRITE_MASK: DUP #100 DEFB %00000000 EDUP ;Draw fast sprite with mask on std screen. ;A [BITS:] ;0..7 reserved; ;BC sprite size in attributes Y and X; ;DE sprite position on screen Y and X; ;HL pixel array address; ;IX mask address. DRAW_SPRITE: PUSH AF ;SAVE REGISTERS PUSH BC PUSH DE PUSH HL PUSH IX D_SPR_3:PUSH BC ;OFFSET ADDRESS PUSH DE PUSH HL LD A,D ;USING TABLE AND %00011000 OR %01000000 ;ONLY ON SCREEN 0 LD H,A LD A,D AND %00000111 ;1/8 PART RRCA RRCA RRCA ADD A,E ;PLUS X COORDINATE LD L,A EX DE,HL POP HL LD B,#08 ;LINES IN ATTRIB D_SPR_2:PUSH BC ;LINE PUSH DE D_SPR_1:LD A,(DE) ;SCREEN BACKGROUND AND (IX+0) ;USING MASK OR (HL) ;SPRITE DATA LD (DE),A ;DRAW ON SCREEN INC HL ;7+19+7+7+6+6+10 INC DE ;+15[JR] = 75 INC IX ; DEC C JR NZ,D_SPR_1 POP DE INC D ;NEXT LINE POP BC DJNZ D_SPR_2 POP DE ;COORDINATES INC D ;NEXT 1/8 PART POP BC ;SIZES DJNZ D_SPR_3 D_SPR_0:POP IX ;RESTORE REGISTERS POP HL POP DE POP BC POP AF RET ;Stream 11. Print string, vertical scroll. SCROLL_TEXT_WIN: PUSH AF PUSH BC PUSH DE PUSH HL PUSH IX PUSH IY ;SCROLL EFFECT FOR TEXT. LD D,%01000111 LD E,#00 CALL CLEAR_SCR LD A,#00 OUT (#FE),A LD C,#0C ;ANIMATION FRAMES LD IX,SCROLL_TXT M_TXT_8:PUSH BC PUSH IX LD IX,TXT_ATTR_1 LD B,#08 LD DE,#0000 LD HL,FONT_ENG M_TXT_1:PUSH BC LD A,C ;FROM COUNTER AND %00000111 RLCA RLCA RLCA ;TO PAPER ATTR OR %01000000 ;BRIGHT BIT LD B,A LD C,%01000000 LD A,(IX+0) SCF CALL PRINT_A_CHAR LD A,E ADD A,FONT_SIZE ;PLUS 8 CP SCR_ATTR_SIZE_X JR NZ,M_TXT_2 LD A,#00 LD D,#10 M_TXT_2:LD E,A ;NEXT POSITION INC IX POP BC DJNZ M_TXT_1 POP IX ;SCROLL TEXT LD IY,STRING_BUFFER ;LD IY,SCREEN_PIXELS LD HL,FONT_ENG LD D,#00 LD E,%00100000 ;SCALE 2X LD BC,#0110 CALL PRINT_STRING_WIN LD B,#10 ;LINE = 16PIXELS M_TXT_7:PUSH BC LD HL,#4800 ;SECOND PART SCR LD DE,#4800 LD A,#08 ;8 PARTS M_TXT_6:PUSH AF PUSH HL LD A,#07 ;7 LINES M_TXT_3:INC H ;NEXT LINE PUSH DE PUSH HL LD BC,#0020 ;32 BYTES IN LINE LDIR POP HL POP DE INC D DEC A ;NEXT 7TH LINE JR NZ,M_TXT_3 POP HL POP AF BIT 0,A ;NEXT FRAM SCREEN JR Z,M_TXT_9 HALT ;PAUSE EVER 16PX M_TXT_9:DEC A ;LAST PART LINE JR NZ,M_TXT_4 POP BC PUSH BC LD A,B CP #08 ;LOWER PART JR Z,M_TXT_A PUSH IY POP HL ;COPY FROM BUFFER LD BC,#0100 ;NEXT LINE ADD IY,BC XOR A JR M_TXT_5 M_TXT_A:LD IY,STRING_BUFFER LD BC,#0020 ;NEXT LOWER PART ADD IY,BC PUSH IY POP HL ;HL = IY XOR A JR M_TXT_5 M_TXT_4:LD BC,#0020 ADD HL,BC M_TXT_5:PUSH HL ;LAST LINE LD BC,#0020 LDIR POP HL PUSH HL ;DE = HL POP DE OR A ;NEXT PART JR NZ,M_TXT_6 POP BC DJNZ M_TXT_7 ;NEXT 16TH LINE LD BC,#0010 ADD IX,BC POP BC ;NEXT FRAME ANIM DEC C JP NZ,M_TXT_8 JP S_WIN_R ;TESTING ALL WINDOW PRINT SCALES. LD IX,SCROLL_TXT LD IY,SCREEN_PIXELS LD B,#04 LD C,%00000000 LD H,SCR_ATTR_SIZE_Y LD L,SCR_ATTR_SIZE_X P_WIN_1:PUSH BC PUSH HL LD DE,#0000 LD A,C ;SCALE RRCA RRCA RRCA ;TO BITS 5,6 OR E ;ADD COORDINATE LD E,A PUSH HL ;BC = SIZES POP BC ;BC = HL LD HL,FONT_ENG CALL PRINT_STRING_WIN POP HL ;HL = SIZES SRL H ;SIZES TO SCALE SRL L POP BC LD A,#32 CALL IM2_DELAY INC C DJNZ P_WIN_1 JP S_WIN_R LD D,#02 LD E,%01100010 LD BC,#0102 LD HL,FONT_ENG LD IX,STRING_TXT LD IY,SCREEN_PIXELS CALL PRINT_STRING_WIN JP S_WIN_R ;Testing function of address offsest from ;coordinates by D.Krapivin. LD DE,#0F00 CALL OFFSET_ATTR LD DE,#0000 OFF_A_1:CALL OFFSET_ATTR INC E LD A,E CP SCR_ATTR_SIZE_X JR NZ,OFF_A_1 LD E,#00 INC D LD A,D CP SCR_ATTR_SIZE_Y JR NZ,OFF_A_1 S_WIN_R:POP IY POP IX POP HL POP DE POP BC POP AF RET TXT_ATTR_1: DEFB "8BITTEA!" SCROLL_TXT: DEFB " WELCOME TO " DEFB "8-BIT TEA PARTY!" DEFB " " DEFB " SLOW VERTICAL " DEFB " SCROLL, USING " DEFB " SIMPLE ADDRESS " DEFB " ARITHMETIC... " DEFB " " DEFB "HELLO TO ALL OUR" DEFB " FRIENDS AND " DEFB " VIEWERS! " DEFB " ",0 STRING_BUFFER: DUP #0800 ;2Kb DEFB %10101010 EDUP ;Print text string to window. ;D window coordinate Y[0..23]; ;E [BITS:] ;0..4 window coordinate X[0..31]; ;5..6 scaling for font; ;7 reserved; ;B window size Y[1..23]; ;C window size X[1..32]; ;HL address of font; ;IX address of string; ;IY address of screen or buffer. PRINT_STRING_WIN: PUSH AF PUSH BC PUSH DE PUSH HL PUSH IX PUSH DE ;SAVE COORDINATES PUSH BC ;AND SIZES LD A,E ;SCALE PARAMETER AND %01100000 RLCA RLCA RLCA OR A JR Z,PR_ST_2 PUSH HL LD H,A ;H SCALE LD A,E ;ONLY COORDINATE AND %00011111 LD E,A PR_ST_1:SLA D ;SCALE WINDOW SLA E ;COORDINATES AND SLA B ;SIZES X AND Y SLA C DEC H JR NZ,PR_ST_1 POP HL ;HL = FONT PR_ST_2: LD A,B ;CHECK Y SIZES OR A JR Z,PR_ST_3 ADD A,D ;PLUS COORDINATE LD D,A LD A,SCR_ATTR_SIZE_Y CP D ;OUT OF SCREEN Y JR C,PR_ST_3 LD A,C ;CHECK X SIZES OR A JR Z,PR_ST_3 ;IF SIZE X = 0 LD A,E ADD A,C LD E,A LD A,SCR_ATTR_SIZE_X CP E ;OUT OF SCREEN X JR C,PR_ST_3 JR PR_ST_4 PR_ST_3:POP BC ;WINDOW INCORRECT POP DE JR PR_ST_0 ;EXIT PR_ST_4:POP BC ;RESTORE SOURCE POP DE ;COORDINATES PR_ST_7:PUSH BC ;PRINT TEXT PUSH DE PR_ST_6:LD A,(IX+0) ;A = CHAR OR A ;IF NULL CHAR JR Z,PR_ST_5 PUSH BC PUSH IY POP BC ;BC - BUFFER CALL PRINT_CHAR_AT POP BC INC IX ;NEXT CHAR INC E DEC C JR NZ,PR_ST_6 POP DE ;NEXT LINE Y INC D POP BC DJNZ PR_ST_7 JR PR_ST_0 PR_ST_5:POP DE ;CORRECT STACK POP BC PR_ST_0:POP IX POP HL POP DE POP BC POP AF RET ;Convert char coordinates to address. ;DE coordinates Y[0..23] and X[0..31]; ;HL address on screen. OFFSET_ATTR: PUSH AF PUSH DE LD HL,#4000 ;#40 = %01000000 LD A,D ;CORRECT IF ONLY AND %00011000 ;BITS 3,4 SET TO 0 ADD A,H LD H,A LD A,D AND %00000111 LD D,A ;L MUST BE 0 SRL D ;4 BYTES, 16 TACTS RR L ; SRL D RR L SRL D RR L ;12 BYTES AND ADD HL,DE ;48 TACTS LD A,#FF LD (HL),A POP DE POP AF RET ;Stream 10. Print text with scaling. PRINT_TEXT_SCALE: PUSH AF PUSH BC PUSH DE PUSH HL PUSH IX LD IX,STRING_TXT LD HL,FONT_ENG LD D,%00000001 LD E,%01100000 LD B,#04 STR_1: PUSH BC LD A,(IX+0) LD BC,SCREEN_PIXELS CALL PRINT_CHAR_AT POP BC INC IX INC E DJNZ STR_1 POP IX POP HL POP DE POP BC POP AF RET STRING_TXT: DEFB "8-BIT TEA PARTY!",0 ;Stream 9. Print char at screen position. PRINT_CHARS_SCR: PUSH AF PUSH BC PUSH DE PUSH HL LD A,FONT_CODE_START LD BC,SCREEN_PIXELS LD DE,#0000 LD HL,FONT_ENG PRC_S3: CALL PRINT_CHAR_AT INC A ;NEXT CHAR CP #60 JR NZ,PRC_S1 LD A,FONT_CODE_START PRC_S1: PUSH AF INC E ;NEXT X LD A,E CP SCR_ATTR_SIZE_X JR NZ,PRC_S2 XOR A ;X = 0 LD E,A INC D LD A,D ;IF Y MAX CP SCR_ATTR_SIZE_Y JR NZ,PRC_S2 POP AF JR PRC_S4 PRC_S2: POP AF JR PRC_S3 ;NEXT PRINT PRC_S4: POP HL POP DE POP BC POP AF RET ;Testing russian codepage. DEFB "©æãª¥­£èé§" ;Print char 8x8 pixels on screen. ;A char to print; ;BC address of screen(left-top); ;E [BITS]: ;0..4 coordinate X [0..31]; ;5..6 char scale [0..3] parameter: ; 0 - no scale; ; 1..3 - scale 2,4,8 pixel size; ;7 reserved; ;D coordinate on screen Y [0..23]; ;HL address of font. ;EXAMPLE WITH DATA FONT TO SCREEN: ;01001101 SCALE 2: 00110000_11110011 PIX:4 ;0100.... SCALE 4: 00001111_00000000_.... ;SCALE: 0 - 8 PIXELS PER BYTE, X1. ;SCALE: 1 - 4 PIXELS PER BYTE, X2. PRINT_CHAR_AT: PUSH AF PUSH BC PUSH DE PUSH HL PUSH IX PUSH IY PUSH DE ;HL CHAR IN FONT EX DE,HL ;THX TO D.KRAPIVIN SUB FONT_CODE_START LD L,A LD H,#00 ;HACK FROM OUR VIEWERS LD H,#10 ;FOR FIXED FONT ADDRESS. ADD HL,HL ;CODE * 8 BYTES ADD HL,HL ADD HL,HL ADD HL,DE ;ADD BASE ADDR PUSH HL ;HL CLEAR POP IX ;IX = FONT ADDR POP DE LD A,E ;SCALE PARAMETER AND %01100000 JR Z,P_CHR_1 RLCA ;A = 1..3 SCALE RLCA RLCA LD H,A ;SAVE COUNTER LD L,A LD A,E AND %00011111 ;5 LOW BITS AS X LD E,A P_CHR_2:SLA E ;SCALE COORDINATES SLA D DEC H JR NZ,P_CHR_2 LD A,L ;RESTORE SCALE P_CHR_1:LD L,A ;CHECK COORDINATES LD A,D ;COORDINATE Y CP SCR_ATTR_SIZE_Y JP NC,P_CHR_R LD A,E ;COORDINATE X CP SCR_ATTR_SIZE_X JP NC,P_CHR_R LD A,L ;SCALE ;OFFSET OF SCREEN LD A,D ;[0..23] 5 BITS AND %00011000 ;3,4 BITS 2K PART ADD A,B ;2048 = 2^11 LD B,A LD A,D AND %00000111 ;[0..7] * 32 RRCA ;5,6,7 BITS OFFS RRCA ;CYCLE RRCA ADD A,E ;PLUS X POSITION ADD A,C ;FROM BUFFER X JR NC,P_CHR_G INC B ;INC H_BUFFER P_CHR_G:LD C,A LD A,L ;A = SCALE PUSH BC ;BC CLEAR POP IY ;IY = BUFFER ADDR LD H,#08 ;H = PIXS PER BYTE LD L,#01 ;L = CELLS ON CHAR OR A ;AS 0 = DEFAULT X1 JR Z,P_CHR_3 P_CHR_4:SRL H ;DIV 2 PIXELS SLA L ;MUL 2 CELLS DEC A ;DEC COUNTER JR NZ,P_CHR_4 P_CHR_3:LD C,L ;C = VERT CELLS P_CHR_B:PUSH IY LD B,FONT_SIZE ;B = LINES IN CELL LD A,L ;FONT NEXT LINE P_CHR_A:PUSH AF PUSH BC PUSH IY LD E,L ;E = HORIZ CELLS LD A,(IX+0) ;A = FONT DATA ROM P_CHR_9:LD C,H ;C = PIXS PER BYTE LD D,%00000000 ;D = DATA TO WRITE P_CHR_8:LD B,L ;FOR ONE BYTE RLCA ;IF 7 IS BIT SET JR C,P_CHR_5 P_CHR_6:RL D ;SAVE 0 AND ROLL DJNZ P_CHR_6 JR P_CHR_7 P_CHR_5:SCF ;SAVE 1 AND ROLL RL D DJNZ P_CHR_5 P_CHR_7:DEC C ;NEXT PART OF BYTE JR NZ,P_CHR_8 LD (IY+0),D INC IY ;NEXT CELL DEC E JR NZ,P_CHR_9 POP IY ;MOVE TO LEFT BUF LD DE,#0100 ;NEXT LINE BUFFER ADD IY,DE ;+256 BYTES OFFSET POP BC POP AF ;IF NEED NEXT FONT DEC A JR NZ,P_CHR_C LD A,L ;RESET COUNTER INC IX ;NEXT FONT LINE P_CHR_C:DJNZ P_CHR_A ;NEXT LINE CELL POP IY LD DE,SCR_ATTR_SIZE_X ADD IY,DE ;NEXT CELL BUFFER DEC C JR NZ,P_CHR_B P_CHR_R:POP IY POP IX POP HL POP DE POP BC POP AF RET TEXT_TO_SCROLL: DB "WELCOME TO 8-BIT TEA PARTY! " DB "RETRO CODE FOR ZX SPECTRUM! " DB "Z80 ASSEMBLER AND 8-BIT TEA! " DB "HELLO TO ALL OUR FRIENDS! " ;Print character using colors attributes. ;A character from 0..3; ;F[FLAGS]: ;C is using next color on next line; ;BC first color attribute and paper; ;DE vertical and horizontal position; ;HL address of font. PRINT_A_CHAR: PUSH AF ;SAVE REGS EX AF,AF' ;SAVE AF' PUSH AF EX AF,AF' PUSH BC PUSH DE PUSH HL PUSH IX ;NO PERFORMANCE PUSH AF ;AF' = AF EX AF,AF' ;C FLAG FOR POP AF ;NEXT COLOR EX AF,AF' PUSH DE EX DE,HL SUB FONT_CODE_START LD L,A LD H,#00 ADD HL,HL ;A(CHAR)*8 ADD HL,HL ADD HL,HL ADD HL,DE PUSH HL POP IX ;IX=HL=FONT CHAR POP DE LD H,FONT_SIZE ;8 LINES PRA_C3: PUSH DE PUSH BC LD L,FONT_SIZE ;8 BITS(PIXELS) PRA_C2: LD A,C RLC (IX+0) ;IF BIT SET JR NC,PRA_C1 ;C-10110101 LD A,B ;COLOR PRA_C1: CALL SET_ATTRIBUTE INC E DEC L JR NZ,PRA_C2 POP BC EX AF,AF' JR NC,PRA_C5 EX AF,AF' LD A,B ;NEXT COLOR AND %11000111 LD E,A ;E OTHER BITS LD A,B ;B=01011011 AND %00111000 ;M=00111000 ADD A,%00001000 ;R=00011000 AND %00111000 ;MULTIPLY COMMON OR E ;1+2=3 4+8=12 LD B,A ;NEW COLOR JR PRA_C4 PRA_C5: EX AF,AF' PRA_C4: POP DE INC D ;NEXT LINE INC IX DEC H ;COUNTER LINE JR NZ,PRA_C3 POP IX POP HL POP DE POP BC EX AF,AF' ;AF' RESTORE POP AF EX AF,AF' POP AF RET ;Setup IM2 interrupt mode and function. ;DE address function to call AT 1/50s. IM2_SETUP: DI PUSH AF PUSH HL LD H,IM2_I_REG ;HL - IM2 ADDR LD L,IM2_B_DATA LD A,H LD I,A ;I - IM2 LD (HL),E INC HL LD (HL),D ;[IM2] - ADDR POP HL POP AF IM 2 EI RET ;Interrupt function, called every 1/50sec. IM2: DI PUSH AF LD A,#01 OUT (#FE),A POP AF EI RETI ;INCLUDE LIBRARY FUNCTIONS AND MAIN FONT. LIBRARY: INCLUDE "STR_LIB.A",1 ALL_FONTS_DATA: INCLUDE "FONTS.A",0 BG_GAME: INCBIN "BG02.C",4096 BOB_MASK: INCBIN "BOB_MSK1.C" INCBIN "BOB_MSK2.C" BOB_DATA_1: INCBIN "BOB_P1F1.C" INCBIN "BOB_P2F2.C" BOB_DATA_2: INCBIN "BOB_P1F1.C" INCBIN "BOB_P2F3.C"
24.093819
43
0.464474
79f02d33f33350c70e120e4e635736d55ac501f0
2,095
asm
Assembly
Appl/Tools/ProtoBiffer/protoManager.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Appl/Tools/ProtoBiffer/protoManager.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Appl/Tools/ProtoBiffer/protoManager.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) Berkeley Softworks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: Tools/ProtoBiffer FILE: protoManager.asm AUTHOR: Don Reeves: July 29, 1991 REVISION HISTORY: Name Date Description ---- ---- ----------- Don 7/29/91 Initial revision DESCRIPTION: File to include everything else. $Id: protoManager.asm,v 1.1 97/04/04 17:15:13 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ;------------------------------------------------------------------------------ ; Common include files ;------------------------------------------------------------------------------ include geos.def include geode.def include resource.def include ec.def include object.def include system.def include heap.def include disk.def ACCESS_FILE_STRUC = 1 ; for GFH_SIG_1_2 & GFH_SIG_3_4 include fileEnum.def ; for FileEnum() include Internal/fileStr.def ; for GeosFileHeader include Internal/fileInt.def ; for FileFullAccessFlags include Internal/geodeStr.def ; for ExecutableFileHeader ;------------------------------------------------------------------------------ ; Common libraries ;------------------------------------------------------------------------------ UseLib ui.def UseLib Objects/vTextC.def ;------------------------------------------------------------------------------ ; Application definitions ;------------------------------------------------------------------------------ include protoConstant.def include protoMacro.def include protoVariable.def ;------------------------------------------------------------------------------ ; UI definitions ;------------------------------------------------------------------------------ include proto.rdef ;------------------------------------------------------------------------------ ; Source code ;------------------------------------------------------------------------------ include protoMain.asm
28.69863
80
0.387589
ffbd32656f446ccdadc63e2d71cf46a8d190611b
565
asm
Assembly
oeis/017/A017752.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/017/A017752.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/017/A017752.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A017752: Binomial coefficients C(n,88). ; 1,89,4005,121485,2794155,51971283,814216767,11050084695,132601016340,1429144287220,14005614014756,126050526132804,1050421051106700,8160963550905900,59458448728028700,408281347932463740,2653828761561014310,16391295291994500150,96526516719523167550,543596699420472575150,2935422176870551905810,15236238918042388463490,76181194590211942317450,367657069544066330314650,1715732991205642874801700,7755113120249505794103684,34003188296478602327993076,144828394596112565471081620,600003349041037771237338140 add $0,88 bin $0,88
94.166667
501
0.909735
e8045a3ec3737e8476061ec1385f146ba2fb1c6c
2,774
asm
Assembly
Engine/source/platform/platformCPUInfo.asm
fr1tz/alux3d
249a3b51751ce3184d52879b481f83eabe89e7e3
[ "MIT" ]
46
2015-01-05T17:34:43.000Z
2022-01-04T04:03:09.000Z
Engine/source/platform/platformCPUInfo.asm
fr1tz/alux3d
249a3b51751ce3184d52879b481f83eabe89e7e3
[ "MIT" ]
10
2015-01-20T23:14:46.000Z
2019-04-05T22:04:15.000Z
Engine/source/platform/platformCPUInfo.asm
fr1tz/terminal-overload
85f0689a40022e5eb7e54dcb6ddfb5ddd82a0a60
[ "CC-BY-4.0" ]
9
2015-08-08T18:46:06.000Z
2021-02-01T13:53:20.000Z
; Copyright information can be found in the file named COPYING ; located in the root directory of this distribution. segment .text ; syntax: export_fn <function name> %macro export_fn 1 %ifidn __OUTPUT_FORMAT__, elf ; No underscore needed for ELF object files global %1 %1: %else global _%1 _%1: %endif %endmacro ; push registers %macro pushreg 0 ; pushad push ebx push ebp push esi push edi %endmacro ; pop registers %macro popreg 0 pop edi pop esi pop ebp pop ebx ; popad %endmacro ; void detectX86CPUInfo(char *vendor, U32 *processor, U32 *properties); export_fn detectX86CPUInfo push ebp mov ebp, esp pushreg push edx push ecx pushfd pushfd ; save EFLAGS to stack pop eax ; move EFLAGS into EAX mov ebx, eax xor eax, 0x200000 ; flip bit 21 push eax popfd ; restore EFLAGS pushfd pop eax cmp eax, ebx jz EXIT ; doesn't support CPUID instruction ; ; get vendor information using CPUID eax == 0 xor eax, eax cpuid ; store the vendor tag (12 bytes in ebx, edx, ecx) in the first parameter, ; which should be a char[13] push eax ; save eax mov eax, [ebp+8] ; store the char* address in eax mov [eax], ebx ; move ebx into the first 4 bytes add eax, 4 ; advance the char* 4 bytes mov [eax], edx ; move edx into the next 4 bytes add eax, 4 ; advance the char* 4 bytes mov [eax], ecx ; move ecx into the last 4 bytes pop eax ; restore eax ; get generic extended CPUID info mov eax, 1 cpuid ; eax=1, so cpuid queries feature information and eax, 0x0fff3fff push ecx mov ecx, [ebp+12] mov [ecx], eax ; just store the model bits in processor param mov ecx, [ebp+16] mov [ecx], edx ; set properties param pop ecx ; want to check for 3DNow(tm). ; need to see if extended cpuid functions present. mov eax, 0x80000000 cpuid cmp eax, 0x80000000 jbe MAYBE_3DLATER mov eax, 0x80000001 cpuid ; 3DNow if bit 31 set -> put bit in our properties and edx, 0x80000000 push eax mov eax, [ebp+16] or [eax], edx pop eax MAYBE_3DLATER: EXIT: popfd pop ecx pop edx popreg pop ebp ret
25.449541
78
0.526316
64f88bfee7f8d3406197c41c94fae2d61c28b099
173
asm
Assembly
libsrc/_DEVELOPMENT/stdio/c/sdcc_iy/puts_unlocked_fastcall.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/stdio/c/sdcc_iy/puts_unlocked_fastcall.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/stdio/c/sdcc_iy/puts_unlocked_fastcall.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
; int puts_unlocked_fastcall(const char *s) SECTION code_stdio PUBLIC _puts_unlocked_fastcall EXTERN asm_puts_unlocked defc _puts_unlocked_fastcall = asm_puts_unlocked
15.727273
48
0.855491
c69e313d50fb937428b5590a1845a0c117f3d336
854
asm
Assembly
programs/oeis/307/A307304.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/307/A307304.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/307/A307304.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A307304: Number of inequivalent ways of placing 2 nonattacking rooks on n X n board up to rotations and reflections of the board. ; 0,1,4,13,31,66,123,214,346,535,790,1131,1569,2128,2821,3676,4708,5949,7416,9145,11155,13486,16159,19218,22686,26611,31018,35959,41461,47580,54345,61816,70024,79033,88876,99621,111303,123994,137731,152590,168610,185871 mov $15,$0 mov $17,$0 lpb $17,1 clr $0,15 mov $0,$15 sub $17,1 sub $0,$17 mov $12,$0 mov $14,$0 lpb $14,1 clr $0,12 mov $0,$12 sub $14,1 sub $0,$14 mov $9,$0 mov $11,$0 lpb $11,1 mov $0,$9 sub $11,1 sub $0,$11 mov $8,$0 mul $0,2 mov $6,$0 trn $6,3 gcd $8,2 add $6,$8 add $6,1 div $6,$8 mov $1,$6 sub $1,1 add $10,$1 lpe add $13,$10 lpe add $16,$13 lpe mov $1,$16
20.829268
219
0.566745
c10ccdecc4de3f8e26e749cf8b34e8ea33a62d24
276
asm
Assembly
libsrc/_DEVELOPMENT/alloc/obstack/c/sdcc_iy/obstack_copy_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/alloc/obstack/c/sdcc_iy/obstack_copy_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/alloc/obstack/c/sdcc_iy/obstack_copy_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void *obstack_copy_callee(struct obstack *ob, void *address, size_t size) SECTION code_clib SECTION code_alloc_obstack PUBLIC _obstack_copy_callee EXTERN asm_obstack_copy _obstack_copy_callee: pop af pop hl pop de pop bc push af jp asm_obstack_copy
13.8
75
0.768116
3bad12e41b4d034bbe6c6ef2feeeb56218f45290
669
asm
Assembly
data/pokemon/base_stats/chinchou.asm
genterz/pokecross
5e62ab6c23e624ea82d599af306f9c52d768a8b4
[ "blessing" ]
28
2019-11-08T07:19:00.000Z
2021-12-20T10:17:54.000Z
data/pokemon/base_stats/chinchou.asm
genterz/pokecross
5e62ab6c23e624ea82d599af306f9c52d768a8b4
[ "blessing" ]
13
2020-01-11T17:00:40.000Z
2021-09-14T01:27:38.000Z
data/pokemon/base_stats/chinchou.asm
genterz/pokecross
5e62ab6c23e624ea82d599af306f9c52d768a8b4
[ "blessing" ]
22
2020-05-28T17:31:38.000Z
2022-03-07T20:49:35.000Z
db CHINCHOU ; 170 db 75, 38, 38, 67, 56, 56 ; hp atk def spd sat sdf db WATER, ELECTRIC ; type db 190 ; catch rate db 90 ; base exp db NO_ITEM, NO_ITEM ; items db GENDER_F50 ; gender ratio db 100 ; unknown 1 db 20 ; step cycles to hatch db 5 ; unknown 2 INCBIN "gfx/pokemon/chinchou/front.dimensions" db 0, 0, 0, 0 ; padding db GROWTH_SLOW ; growth rate dn EGG_WATER_2, EGG_WATER_2 ; egg groups ; tm/hm learnset tmhm CURSE, TOXIC, ZAP_CANNON, HIDDEN_POWER, SNORE, PROTECT, RAIN_DANCE, ENDURE, FRUSTRATION, THUNDER, RETURN, DOUBLE_TEAM, SWAGGER, SLEEP_TALK, REST, ATTRACT, SURF, FLASH, WHIRLPOOL, WATERFALL, THUNDERBOLT, ICE_BEAM ; end
30.409091
217
0.707025
15b6253bd2bd8054218fd5aab9cfbb2c5797401f
352
asm
Assembly
oeis/114/A114002.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/114/A114002.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/114/A114002.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A114002: Expansion of x^k(1+x^(k+1))/(1-x^(k+1)). ; Submitted by Simon Strandgaard ; 1,2,1,2,0,1,2,2,0,1,2,0,0,0,1,2,2,2,0,0,1,2,0,0,0,0,0,1,2,2,0,2,0,0,0,1,2,0,2,0,0,0,0,0,1,2,2,0,0,2,0,0,0,0,1,2,0,0,0,0,0,0,0,0,0,1,2,2,2,2,0,2,0,0,0,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,2,0,0 mov $1,$0 seq $0,134576 ; A127733 * A051731. add $1,1 div $0,$1
39.111111
201
0.551136
5b647ad420f452c71e122b3adf7dae52624cb38c
1,292
asm
Assembly
main.asm
theposeidonas/pic16f877_counter
c49071d2f725c8293a4fce55131d897f5f2ff34d
[ "MIT" ]
null
null
null
main.asm
theposeidonas/pic16f877_counter
c49071d2f725c8293a4fce55131d897f5f2ff34d
[ "MIT" ]
null
null
null
main.asm
theposeidonas/pic16f877_counter
c49071d2f725c8293a4fce55131d897f5f2ff34d
[ "MIT" ]
null
null
null
; ########## EXPERIMENT FOR PIC16F877 ############################ ; FOR PIC 16F877 40 PIN DEVICE ; RESONATOR 10MHz ; WATCHDOG DISABLED ; CODE PROTECTION OFF TITLE "COUNT AND SEND TO PORTD" list p = 16f877 include <p16f877.inc> DELAY_ULT EQU H'30' DELAY_HI EQU H'31' DELAY_LO EQU H'32' COUNT EQU H'33' ORG H'00' NOP GOTO START ; ; ********** THE ROUTINES START HERE ********* ; ORG 0x20 START BCF STATUS,RP0 ;BANK 0 CLRF PORTD ;INITIALIZE PORTC BY CLEARING OUTPUT DATA LATCHES BSF STATUS,RP0 ;SELECT BANK1 MOVLW 0X00 ;W REG =00 MOVWF TRISD ;SET RD AS OUTPUTS BCF STATUS,RP0 ;BANK 0 CLRF COUNT ;COUNT = 0 ;************************** MAIN MOVF COUNT,W ;GET COUNT MOVWF PORTD ;OUTPUT W REG TO PORTB CALL DELAY ;DELAY CALL DELAY ;DELAY INCF COUNT ;COUNT = COUNT + 1 GOTO MAIN ;************************************ ;SUBROUTINES ;************************************ ; DELAY MOVLW 0X01 MOVWF DELAY_LO MOVLW 0X71 MOVWF DELAY_HI MOVLW 0XFF MOVWF DELAY_ULT BIG OUTER INNER INCFSZ DELAY_LO GOTO INNER INCFSZ DELAY_HI GOTO OUTER INCFSZ DELAY_ULT GOTO INNER RETURN END
16.35443
69
0.534056
c69fee55c775203624b33ea78d37cefda1f22685
440
asm
Assembly
tests/docs_examples/st_usage_example.asm
fengjixuchui/sjasmplus
df0fabd2411bf89e23637fce46d273f52dafbe16
[ "BSD-3-Clause" ]
220
2016-10-22T19:44:39.000Z
2022-03-29T20:57:04.000Z
tests/docs_examples/st_usage_example.asm
ped7g/sjasmplus
487635c8057cd5594c372d9b70bc00a3f3a1ecc4
[ "BSD-3-Clause" ]
153
2018-05-07T10:31:23.000Z
2022-03-30T04:35:59.000Z
tests/docs_examples/st_usage_example.asm
ped7g/sjasmplus
487635c8057cd5594c372d9b70bc00a3f3a1ecc4
[ "BSD-3-Clause" ]
51
2016-05-12T21:27:36.000Z
2022-03-27T15:16:16.000Z
STRUCT BIN_FILE_MAP, 256 value1 BYTE value2 WORD ENDS ORG 0x8000 binData BIN_FILE_MAP = $ ; set up label values only (no bytes) ; INCBIN "some_data.bin" ; load the bytes from file instead INCBIN "st_usage_example.asm" ; include the source itself to not error out ; using the data through struct definition ld a,(binData.value1) ld hl,(binData.value2)
31.428571
84
0.620455
5dc22ec78d265d7d362a860db0856013c5cdfccc
570
asm
Assembly
oeis/145/A145826.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/145/A145826.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/145/A145826.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A145826: Arises from critical number of finite Abelian groups. ; Submitted by Jon Maiga ; 7,8,11,14,19,21,26,29,34,41,43,50,55,57,62,68,75,77,84,89,91,98,102,109,117,122,124,128,131,135,150,155,161,163,174,176,183,189,194,200,206,209,219,221,226,228,241,254,258,260,264,271,273,283,290,296,302,305,311,315,317,328,343,347,349,353,368,374,385,387,391,398,406,412,419,423,429,437,442,450,461,463,473,475,482,486,492,500,505,507,511,523,532,536,544,548,555,567,569,588 seq $0,40 ; The prime numbers. seq $0,183868 ; a(n) = n + floor(2*sqrt(n+1)); complement of A079524.
81.428571
377
0.722807
5b946719704cc8e584cf066ff682a155834ceab2
827
asm
Assembly
oeis/142/A142817.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/142/A142817.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/142/A142817.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A142817: Primes congruent to 19 mod 61. ; Submitted by Jon Maiga ; 19,263,751,1117,1361,1483,2459,3191,3313,3557,3923,4289,5021,5387,6607,7583,7949,8681,8803,9413,9901,10267,11243,11731,12097,12829,14293,14537,15269,15391,16001,17099,19051,19417,19661,20149,20393,20759,21247,21491,21613,23321,23687,24419,24907,25639,26249,26371,26737,26981,27103,28201,28933,30763,33203,33569,34057,34301,34667,35521,36131,36497,37717,38083,38327,38449,38693,39181,39791,41011,41621,42719,42841,43207,43451,43573,44549,45281,45403,46867,47111,47599,47843,49307,49429,50527,50893 mov $1,9 mov $2,$0 add $2,2 pow $2,2 lpb $2 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,61 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,121
34.458333
498
0.73156
ced88ebb7e8730b7840b0389c6ed0c3df470f186
2,531
asm
Assembly
PRG/levels/Ice/6-4.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
PRG/levels/Ice/6-4.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
PRG/levels/Ice/6-4.asm
narfman0/smb3_pp1
38a58adafff67a403591e38875e9fae943a5fe76
[ "Unlicense" ]
null
null
null
; Original address was $B625 .word W604_CoinHeavL ; Alternate level layout .word W604_CoinHeavO ; Alternate object layout .byte LEVEL1_SIZE_11 | LEVEL1_YSTART_170 .byte LEVEL2_BGPAL_00 | LEVEL2_OBJPAL_08 | LEVEL2_XSTART_18 .byte LEVEL3_TILESET_13 | LEVEL3_VSCROLL_LOCKLOW | LEVEL3_PIPENOTEXIT .byte LEVEL4_BGBANK_INDEX(12) | LEVEL4_INITACT_NOTHING .byte LEVEL5_BGM_ATHLETIC | LEVEL5_TIME_300 .byte $1A, $0B, $10, $03, $17, $0C, $71, $19, $00, $35, $14, $01, $C2, $11, $0A, $C2 .byte $05, $07, $C2, $31, $04, $82, $73, $04, $42, $73, $14, $80, $73, $1B, $11, $73 .byte $1E, $10, $77, $1C, $11, $74, $1E, $80, $76, $1F, $80, $18, $09, $C2, $34, $18 .byte $82, $32, $1B, $40, $75, $16, $10, $11, $17, $C2, $73, $21, $13, $79, $26, $10 .byte $77, $21, $10, $78, $22, $10, $79, $23, $11, $35, $26, $0B, $09, $28, $C2, $14 .byte $22, $C2, $73, $28, $82, $75, $28, $82, $77, $28, $82, $79, $28, $82, $09, $28 .byte $C2, $12, $2F, $95, $11, $2F, $07, $73, $32, $80, $75, $32, $80, $30, $32, $81 .byte $06, $34, $C2, $17, $30, $83, $17, $34, $B5, $12, $3A, $A3, $19, $3A, $B3, $17 .byte $37, $A2, $16, $37, $B2, $14, $3A, $A1, $17, $3A, $B1, $17, $39, $A0, $16, $39 .byte $B0, $15, $3A, $07, $31, $3B, $01, $33, $39, $81, $35, $37, $80, $35, $3C, $80 .byte $37, $38, $80, $37, $3B, $80, $38, $39, $81, $11, $35, $C2, $13, $3D, $C2, $53 .byte $34, $07, $E3, $77, $50, $05, $44, $C2, $0A, $4A, $C2, $16, $4A, $E1, $15, $49 .byte $E1, $15, $4F, $E1, $14, $4E, $E1, $15, $4A, $A0, $19, $48, $A0, $14, $4F, $A0 .byte $18, $4D, $A0, $38, $44, $41, $11, $43, $C2, $13, $4B, $C2, $73, $52, $80, $75 .byte $52, $80, $77, $52, $80, $79, $52, $80, $78, $59, $8A, $25, $55, $12, $26, $56 .byte $10, $27, $56, $10, $33, $56, $10, $34, $56, $10, $35, $56, $10, $36, $56, $10 .byte $37, $56, $10, $38, $56, $10, $24, $56, $0A, $39, $56, $40, $52, $56, $08, $01 .byte $5A, $C2, $07, $52, $C2, $08, $59, $C2, $11, $5A, $C2, $05, $6C, $C2, $09, $64 .byte $C2, $11, $6B, $C2, $12, $63, $C2, $75, $62, $10, $76, $62, $10, $76, $6B, $10 .byte $77, $6B, $10, $37, $60, $14, $20, $61, $D1, $35, $6F, $81, $78, $71, $8F, $76 .byte $75, $10, $77, $75, $10, $75, $7E, $10, $76, $7E, $10, $03, $7A, $C2, $09, $77 .byte $C2, $0F, $74, $C2, $10, $7D, $C2, $27, $72, $82, $28, $72, $82, $29, $72, $82 .byte $34, $74, $82, $28, $73, $0F, $75, $87, $10, $76, $87, $10, $77, $87, $10, $71 .byte $8F, $80, $76, $8F, $80, $05, $83, $C2, $08, $8A, $C2, $12, $8B, $C2, $36, $8A .byte $82, $1A, $93, $10, $1C, $15, $94, $72, $40, $98, $09, $FF
70.305556
85
0.483208
d38302341b6613353fabdfa7d01346c437daff47
5,921
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1221.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1221.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0.log_21829_1221.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r11 push %r14 push %r15 push %rax push %rbp push %rdi push %rsi lea addresses_A_ht+0x10186, %rsi clflush (%rsi) sub $54196, %r15 movb (%rsi), %r14b nop nop nop dec %rbp lea addresses_UC_ht+0x188f6, %rsi nop nop nop cmp $35720, %r14 mov (%rsi), %r11 nop dec %rbp lea addresses_normal_ht+0xed96, %rax nop nop nop nop and %rdi, %rdi movw $0x6162, (%rax) dec %rsi lea addresses_WC_ht+0x5226, %rbp nop nop and $19187, %r15 vmovups (%rbp), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $0, %xmm0, %r14 nop nop nop nop add $62251, %rsi lea addresses_A_ht+0x1af96, %r15 nop nop nop cmp %rdi, %rdi mov (%r15), %ax nop nop cmp $2828, %rax pop %rsi pop %rdi pop %rbp pop %rax pop %r15 pop %r14 pop %r11 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r14 push %rcx push %rdi push %rdx push %rsi // Store lea addresses_WT+0x14296, %rcx cmp $22323, %r10 movw $0x5152, (%rcx) nop nop nop nop dec %rdx // Store lea addresses_PSE+0x14e72, %rdi nop nop nop nop and $52918, %r14 mov $0x5152535455565758, %rcx movq %rcx, %xmm7 vmovups %ymm7, (%rdi) nop nop nop nop nop dec %r11 // Store lea addresses_WC+0x12d16, %rdi nop nop nop cmp $42825, %rdx mov $0x5152535455565758, %rsi movq %rsi, %xmm0 movups %xmm0, (%rdi) nop nop nop nop and $20906, %r10 // Faulty Load lea addresses_normal+0x1d96, %r10 nop nop sub $9442, %rdi vmovups (%r10), %ymm7 vextracti128 $0, %ymm7, %xmm7 vpextrq $1, %xmm7, %r14 lea oracles, %r10 and $0xff, %r14 shlq $12, %r14 mov (%r10,%r14,1), %r14 pop %rsi pop %rdx pop %rdi pop %rcx pop %r14 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 8, 'type': 'addresses_WT', 'AVXalign': False, 'size': 2}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_PSE', 'AVXalign': False, 'size': 32}} {'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 5, 'type': 'addresses_WC', 'AVXalign': False, 'size': 16}} [Faulty Load] {'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_normal', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'} {'src': {'NT': False, 'same': False, 'congruent': 3, 'type': 'addresses_UC_ht', 'AVXalign': True, 'size': 8}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'NT': True, 'same': False, 'congruent': 8, 'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 2}} {'src': {'NT': False, 'same': False, 'congruent': 2, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 32}, 'OP': 'LOAD'} {'src': {'NT': True, 'same': False, 'congruent': 9, 'type': 'addresses_A_ht', 'AVXalign': False, 'size': 2}, '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 */
38.2
2,999
0.657321
64b1048de8428604261685eaeadccfe3460a2383
4,091
asm
Assembly
bluetooth rec/rec.asm
SREEHARIR/POV-Clock
1e34a803046837453d159b8536200e73133129f1
[ "Apache-2.0" ]
null
null
null
bluetooth rec/rec.asm
SREEHARIR/POV-Clock
1e34a803046837453d159b8536200e73133129f1
[ "Apache-2.0" ]
null
null
null
bluetooth rec/rec.asm
SREEHARIR/POV-Clock
1e34a803046837453d159b8536200e73133129f1
[ "Apache-2.0" ]
null
null
null
_main: ;rec.c,18 :: void main() ;rec.c,21 :: TRISA=0xFF; MOVLW 255 MOVWF TRISA+0 ;rec.c,22 :: TRISB=0x00; CLRF TRISB+0 ;rec.c,23 :: PORTB=0x00; CLRF PORTB+0 ;rec.c,24 :: Lcd_Init(); CALL _Lcd_Init+0, 0 ;rec.c,25 :: TRISC.RC6 = 0x00; //TX pin set as output BCF TRISC+0, 6 ;rec.c,26 :: TRISC.RC7 = 0xFF; //RX pin set as input BSF TRISC+0, 7 ;rec.c,27 :: UART1_Init(9600); MOVLW 25 MOVWF SPBRG+0 BSF TXSTA+0, 2, 0 CALL _UART1_Init+0, 0 ;rec.c,28 :: delay_ms(100); //Dealy for UART to become stable MOVLW 130 MOVWF R12, 0 MOVLW 221 MOVWF R13, 0 L_main0: DECFSZ R13, 1, 1 BRA L_main0 DECFSZ R12, 1, 1 BRA L_main0 NOP NOP ;rec.c,31 :: UART1_Init(9600); // Initialize UART module at 9600 bps MOVLW 25 MOVWF SPBRG+0 BSF TXSTA+0, 2, 0 CALL _UART1_Init+0, 0 ;rec.c,32 :: Delay_ms(10000); // Wait for UART module to stabilize MOVLW 51 MOVWF R11, 0 MOVLW 187 MOVWF R12, 0 MOVLW 223 MOVWF R13, 0 L_main1: DECFSZ R13, 1, 1 BRA L_main1 DECFSZ R12, 1, 1 BRA L_main1 DECFSZ R11, 1, 1 BRA L_main1 NOP NOP ;rec.c,33 :: while (1) // Endless loop L_main2: ;rec.c,35 :: if (UART1_Data_Ready()) // If data is received, CALL _UART1_Data_Ready+0, 0 MOVF R0, 1 BTFSC STATUS+0, 2 GOTO L_main4 ;rec.c,37 :: for(i=0;i<100;i++) CLRF main_i_L0+0 CLRF main_i_L0+1 L_main5: MOVLW 128 XORWF main_i_L0+1, 0 MOVWF R0 MOVLW 128 SUBWF R0, 0 BTFSS STATUS+0, 2 GOTO L__main13 MOVLW 100 SUBWF main_i_L0+0, 0 L__main13: BTFSC STATUS+0, 0 GOTO L_main6 ;rec.c,39 :: uart_rd[i]= UART1_Read(); MOVLW _uart_rd+0 ADDWF main_i_L0+0, 0 MOVWF FLOC__main+0 MOVLW hi_addr(_uart_rd+0) ADDWFC main_i_L0+1, 0 MOVWF FLOC__main+1 CALL _UART1_Read+0, 0 MOVFF FLOC__main+0, FSR1L MOVFF FLOC__main+1, FSR1H MOVF R0, 0 MOVWF POSTINC1+0 ;rec.c,40 :: UART1_Write(uart_rd); MOVLW _uart_rd+0 MOVWF FARG_UART1_Write_data_+0 CALL _UART1_Write+0, 0 ;rec.c,41 :: delay_ms(1000); MOVLW 6 MOVWF R11, 0 MOVLW 19 MOVWF R12, 0 MOVLW 173 MOVWF R13, 0 L_main8: DECFSZ R13, 1, 1 BRA L_main8 DECFSZ R12, 1, 1 BRA L_main8 DECFSZ R11, 1, 1 BRA L_main8 NOP NOP ;rec.c,37 :: for(i=0;i<100;i++) INFSNZ main_i_L0+0, 1 INCF main_i_L0+1, 1 ;rec.c,42 :: } GOTO L_main5 L_main6: ;rec.c,43 :: for(i=0;i<100;i++) CLRF main_i_L0+0 CLRF main_i_L0+1 L_main9: MOVLW 128 XORWF main_i_L0+1, 0 MOVWF R0 MOVLW 128 SUBWF R0, 0 BTFSS STATUS+0, 2 GOTO L__main14 MOVLW 100 SUBWF main_i_L0+0, 0 L__main14: BTFSC STATUS+0, 0 GOTO L_main10 ;rec.c,45 :: Lcd_Cmd(_LCD_CLEAR); // Clear display MOVLW 1 MOVWF FARG_Lcd_Cmd_out_char+0 CALL _Lcd_Cmd+0, 0 ;rec.c,46 :: Lcd_Out(1,0,text); MOVLW 1 MOVWF FARG_Lcd_Out_row+0 CLRF FARG_Lcd_Out_column+0 MOVLW _text+0 MOVWF FARG_Lcd_Out_text+0 MOVLW hi_addr(_text+0) MOVWF FARG_Lcd_Out_text+1 CALL _Lcd_Out+0, 0 ;rec.c,47 :: delay_ms(10000); MOVLW 51 MOVWF R11, 0 MOVLW 187 MOVWF R12, 0 MOVLW 223 MOVWF R13, 0 L_main12: DECFSZ R13, 1, 1 BRA L_main12 DECFSZ R12, 1, 1 BRA L_main12 DECFSZ R11, 1, 1 BRA L_main12 NOP NOP ;rec.c,43 :: for(i=0;i<100;i++) INFSNZ main_i_L0+0, 1 INCF main_i_L0+1, 1 ;rec.c,48 :: } GOTO L_main9 L_main10: ;rec.c,49 :: } L_main4: ;rec.c,50 :: } GOTO L_main2 ;rec.c,51 :: } GOTO $+0 ; end of _main
23.377143
75
0.535077
afef5bca61e7b4907a860e7b35a22dbae9966a24
2,310
asm
Assembly
programs/oeis/176/A176060.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/176/A176060.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/176/A176060.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A176060: a(n) = n*(n+1)*(3*n^2+5*n+4)/12. ; 0,2,13,46,120,260,497,868,1416,2190,3245,4642,6448,8736,11585,15080,19312,24378,30381,37430,45640,55132,66033,78476,92600,108550,126477,146538,168896,193720,221185,251472,284768,321266,361165,404670,451992,503348,558961,619060,683880,753662,828653,909106,995280,1087440,1185857,1290808,1402576,1521450,1647725,1781702,1923688,2073996,2232945,2400860,2578072,2764918,2961741,3168890,3386720,3615592,3855873,4107936,4372160,4648930,4938637,5241678,5558456,5889380,6234865,6595332,6971208,7362926,7770925,8195650,8637552,9097088,9574721,10070920,10586160,11120922,11675693,12250966,12847240,13465020,14104817,14767148,15452536,16161510,16894605,17652362,18435328,19244056,20079105,20941040,21830432,22747858,23693901,24669150,25674200,26709652,27776113,28874196,30004520,31167710,32364397,33595218,34860816,36161840,37498945,38872792,40284048,41733386,43221485,44749030,46316712,47925228,49575281,51267580,53002840,54781782,56605133,58473626,60388000,62349000,64357377,66413888,68519296,70674370,72879885,75136622,77445368,79806916,82222065,84691620,87216392,89797198,92434861,95130210,97884080,100697312,103570753,106505256,109501680,112560890,115683757,118871158,122123976,125443100,128829425,132283852,135807288,139400646,143064845,146800810,150609472,154491768,158448641,162481040,166589920,170776242,175040973,179385086,183809560,188315380,192903537,197575028,202330856,207172030,212099565,217114482,222217808,227410576,232693825,238068600,243535952,249096938,254752621,260504070,266352360,272298572,278343793,284489116,290735640,297084470,303536717,310093498,316755936,323525160,330402305,337388512,344484928,351692706,359013005,366446990,373995832,381660708,389442801,397343300,405363400,413504302,421767213,430153346,438663920,447300160,456063297,464954568,473975216,483126490,492409645,501825942,511376648,521063036,530886385,540847980,550949112,561191078,571575181,582102730,592775040,603593432,614559233,625673776,636938400,648354450,659923277,671646238,683524696,695560020,707753585,720106772,732620968,745297566,758137965,771143570,784315792,797656048,811165761,824846360,838699280,852725962,866927853,881306406,895863080,910599340,925516657,940616508,955900376,971369750 lpb $0 add $2,$0 add $2,$0 sub $0,1 add $3,$2 add $1,$3 sub $2,1 lpe
192.5
2,183
0.861039
906f908f4a2462b705cbafe44fc40c90c6e88eca
2,179
asm
Assembly
dyncode_zx_romcall_err.asm
imneme/spectrum-dyncode
3acd5e0e87acb2311a2134bf7ab8d2bd3dad2afd
[ "MIT" ]
1
2021-11-17T00:18:38.000Z
2021-11-17T00:18:38.000Z
dyncode_zx_romcall_err.asm
imneme/spectrum-dyncode
3acd5e0e87acb2311a2134bf7ab8d2bd3dad2afd
[ "MIT" ]
null
null
null
dyncode_zx_romcall_err.asm
imneme/spectrum-dyncode
3acd5e0e87acb2311a2134bf7ab8d2bd3dad2afd
[ "MIT" ]
null
null
null
SECTION data_compiler SECTION code_compiler GLOBAL _dyncode_zx_romcall_err GLOBAL _zx_romcall_err GLOBAL _zx_romcall GLOBAL _zx_romcall_private_restore_stack GLOBAL _call_with_errhandler SYSVAR_ERR_SP equ $5C3D ;;; _zx_romcall_err is a standard calling conventions shim for ;;; _asm_zx_romcall_err ;;; ;;; On entry: stack has: routine-to-call, handler, return addr <- TOS ;;; On exit: IX,IY unchanged + (see _asm_zx_romcall_err) _zx_romcall_err: pop de ; return address pop bc ; error handler pop hl ; subroutine push de ; restore return address jp _asm_zx_romcall_err ;;; _dyncode_zx_romcall_err runs arbitary code that has been pushed ;;; onto the stack, falling through into asm_zx_romcall_err ;;; (described below), which does the heavy lifting. ;;; ;;; On entry: stack has: .... code .... start, handler, return addr <- TOS ;;; On exit: IX,IY unchanged + whatever the routine leaves in the registers _dyncode_zx_romcall_err: ld hl, 2 ; load HL to stack beyond retaddr add hl, sp ld c, (hl) ; copy error handler, and adjust inc hl ; HL to be past that ld b, (hl) inc hl ; this is where the dynamic code is ;; fall through ;;; _asm_zx_romcall_err runs code pointed to by HL with an error ;;; handling routine in BC. It preserves the caller's IX and IY, and calls ;;; the ROM with IY and HL' as they were when the program was started. The ;;; code is run with the stack in its normal below-RAMTOP position, as various ;;; ROM routines would expect. This is the surest way to call into the ROM, ;;; especially if there is a chance of an error via RST 8. ;;; ;;; On entry: HL = Routine to call ;;; BC = Error handler routine ;;; BC',AF' = (Optionally) any arguments to the call, BC' will be ;;; in BC a the time of the call. ;;; On exit: IX,IY unchanged + BC trashed + whatever the routine leaves ;;; in the registers ;;; ;;; Note: The code you call cannot expect to find its arguments on the ;;; stack, because the stack has moved. Stack restoration is ;;; via self-modifying code. _asm_zx_romcall_err: ex de, hl exx ld hl, _call_with_errhandler jp _zx_romcall
34.046875
78
0.707205
d5e26cbe14c18160147b63cd0c74091f0cad36b2
2,292
asm
Assembly
externals/mpir-3.0.0/mpn/x86_64/nehalem/lshift.asm
JaminChan/eos_win
c03e57151cfe152d0d3120abb13226f4df74f37e
[ "MIT" ]
1
2018-08-14T03:52:21.000Z
2018-08-14T03:52:21.000Z
externals/mpir-3.0.0/mpn/x86_64/nehalem/lshift.asm
JaminChan/eos_win
c03e57151cfe152d0d3120abb13226f4df74f37e
[ "MIT" ]
null
null
null
externals/mpir-3.0.0/mpn/x86_64/nehalem/lshift.asm
JaminChan/eos_win
c03e57151cfe152d0d3120abb13226f4df74f37e
[ "MIT" ]
null
null
null
dnl mpn_lshift dnl Copyright 2009 Jason Moxham dnl This file is part of the MPIR Library. dnl The MPIR Library is free software; you can redistribute it and/or modify dnl it under the terms of the GNU Lesser General Public License as published dnl by the Free Software Foundation; either version 2.1 of the License, or (at dnl your option) any later version. dnl The MPIR Library is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl You should have received a copy of the GNU Lesser General Public License dnl along with the MPIR Library; see the file COPYING.LIB. If not, write dnl to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, dnl Boston, MA 02110-1301, USA. include(`../config.m4') C mpn_lshift(mp_ptr rdi,mp_ptr rsi,mp_size_t rdx,mp_limb_t rcx) C rax=carry ASM_START() PROLOGUE(mpn_lshift) C // odd and even n seem to have different runtimes push %rbx mov %rdx,%rbx lea 24(%rsi),%rsi lea 24(%rdi),%rdi mov -32(%rsi,%rbx,8),%rdx xor %rax,%rax shld %cl,%rdx,%rax sub $5,%rbx js skiplp ALIGN(16) lp: mov (%rsi,%rbx,8),%r8 mov -24(%rsi,%rbx,8),%r11 mov -8(%rsi,%rbx,8),%r9 shld %cl,%r8,%rdx mov %rdx,8(%rdi,%rbx,8) mov %r11,%rdx mov -16(%rsi,%rbx,8),%r10 shld %cl,%r9,%r8 shld %cl,%r10,%r9 mov %r8,(%rdi,%rbx,8) mov %r9,-8(%rdi,%rbx,8) shld %cl,%r11,%r10 sub $4,%rbx mov %r10,16(%rdi,%rbx,8) jns lp skiplp: cmp $-2,%rbx ja case3 je case2 jp case1 case0: shl %cl,%rdx mov %rdx,8(%rdi,%rbx,8) pop %rbx ret ALIGN(16) case3: mov (%rsi,%rbx,8),%r8 mov -8(%rsi,%rbx,8),%r9 shld %cl,%r8,%rdx mov %rdx,8(%rdi,%rbx,8) mov -16(%rsi,%rbx,8),%r10 shld %cl,%r9,%r8 shld %cl,%r10,%r9 mov %r8,(%rdi,%rbx,8) mov %r9,-8(%rdi,%rbx,8) shl %cl,%r10 mov %r10,16-32(%rdi,%rbx,8) pop %rbx ret ALIGN(16) case2: mov (%rsi,%rbx,8),%r8 mov -8(%rsi,%rbx,8),%r9 shld %cl,%r8,%rdx mov %rdx,8(%rdi,%rbx,8) shld %cl,%r9,%r8 shl %cl,%r9 mov %r8,(%rdi,%rbx,8) mov %r9,-8(%rdi,%rbx,8) pop %rbx ret ALIGN(16) case1: mov (%rsi,%rbx,8),%r8 shld %cl,%r8,%rdx mov %rdx,8(%rdi,%rbx,8) shl %cl,%r8 mov %r8,(%rdi,%rbx,8) pop %rbx ret EPILOGUE()
22.252427
79
0.671902
2fab60678ee2a769f8f38a26a2803bc3a0d91131
253
asm
Assembly
pin-3.22-98547-g7a303a835-gcc-linux/source/tools/MemTrace/atomic_increment_intel64.asm
ArthasZhang007/15418FinalProject
a71f698ea48ebbc446111734c198f16a55633669
[ "MIT" ]
null
null
null
pin-3.22-98547-g7a303a835-gcc-linux/source/tools/MemTrace/atomic_increment_intel64.asm
ArthasZhang007/15418FinalProject
a71f698ea48ebbc446111734c198f16a55633669
[ "MIT" ]
null
null
null
pin-3.22-98547-g7a303a835-gcc-linux/source/tools/MemTrace/atomic_increment_intel64.asm
ArthasZhang007/15418FinalProject
a71f698ea48ebbc446111734c198f16a55633669
[ "MIT" ]
null
null
null
; ; Copyright (C) 2011-2012 Intel Corporation. ; SPDX-License-Identifier: MIT ; PUBLIC AtomicIncrement extern numthreadsStarted:dword .code AtomicIncrement PROC lea rcx, numthreadsStarted inc DWORD PTR [rcx] ret AtomicIncrement ENDP end
14.055556
44
0.758893
3912791de2a880298e911b63280a79b65beb8a56
455
asm
Assembly
libsrc/target/bondwell/ioctl/generic_console_xypos.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/target/bondwell/ioctl/generic_console_xypos.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/target/bondwell/ioctl/generic_console_xypos.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION code_graphics PUBLIC generic_console_xypos defc DISPLAY = 0xF800 ; Entry: b = y, c = x ; Exit: hl = screen position generic_console_xypos: ld hl,DISPLAY - 80 ld de,80 inc b generic_console_printc_1: add hl,de djnz generic_console_printc_1 generic_console_printc_3: add hl,bc ;hl now points to address in display ret
22.75
76
0.569231
e5240bd0b803cdc216b7c0b12142b99614b03b52
1,839
asm
Assembly
programs/oeis/035/A035107.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/035/A035107.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/035/A035107.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A035107: First differences give (essentially) A028242. ; 3,9,17,29,44,64,88,118,153,195,243,299,362,434,514,604,703,813,933,1065,1208,1364,1532,1714,1909,2119,2343,2583,2838,3110,3398,3704,4027,4369,4729,5109,5508,5928,6368,6830,7313,7819,8347,8899,9474,10074,10698,11348,12023,12725,13453,14209,14992,15804,16644,17514,18413,19343,20303,21295,22318,23374,24462,25584,26739,27929,29153,30413,31708,33040,34408,35814,37257,38739,40259,41819,43418,45058,46738,48460,50223,52029,53877,55769,57704,59684,61708,63778,65893,68055,70263,72519,74822,77174,79574,82024,84523,87073,89673,92325,95028,97784,100592,103454,106369,109339,112363,115443,118578,121770,125018,128324,131687,135109,138589,142129,145728,149388,153108,156890,160733,164639,168607,172639,176734,180894,185118,189408,193763,198185,202673,207229,211852,216544,221304,226134,231033,236003,241043,246155,251338,256594,261922,267324,272799,278349,283973,289673,295448,301300,307228,313234,319317,325479,331719,338039,344438,350918,357478,364120,370843,377649,384537,391509,398564,405704,412928,420238,427633,435115,442683,450339,458082,465914,473834,481844,489943,498133,506413,514785,523248,531804,540452,549194,558029,566959,575983,585103,594318,603630,613038,622544,632147,641849,651649,661549,671548,681648,691848,702150,712553,723059,733667,744379,755194,766114,777138,788268,799503,810845,822293,833849,845512,857284,869164,881154,893253,905463,917783,930215,942758,955414,968182,981064,994059,1007169,1020393,1033733,1047188,1060760,1074448,1088254,1102177,1116219,1130379,1144659,1159058,1173578,1188218,1202980,1217863,1232869,1247997,1263249,1278624,1294124,1309748,1325498,1341373,1357375 mov $2,$0 add $2,1 mov $3,1 mov $4,3 lpb $2,1 add $4,$2 lpb $4,1 mov $0,$2 sub $4,$3 add $1,$4 add $1,1 trn $4,1 lpe add $1,$0 sub $2,1 lpe sub $1,4
87.571429
1,601
0.80261
7bf13b019ea0f59546174bcddcd89a138f7c15b9
1,215
asm
Assembly
programs/oeis/248/A248598.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/248/A248598.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/248/A248598.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A248598: a(n) = (2*n+23)*n*(n-1), a coefficient appearing in the formula a(n)*Pi/324+n+1 giving the average number of regions into which n random planes divide the cube. ; 0,0,54,174,372,660,1050,1554,2184,2952,3870,4950,6204,7644,9282,11130,13200,15504,18054,20862,23940,27300,30954,34914,39192,43800,48750,54054,59724,65772,72210,79050,86304,93984,102102,110670,119700 mov $19,$0 mov $21,$0 lpb $21,1 clr $0,19 mov $0,$19 sub $21,1 sub $0,$21 mov $16,$0 mov $18,$0 lpb $18,1 clr $0,16 mov $0,$16 sub $18,1 sub $0,$18 mov $13,$0 mov $15,$0 lpb $15,1 mov $0,$13 sub $15,1 sub $0,$15 mov $9,$0 mov $11,2 lpb $11,1 clr $0,9 mov $0,$9 sub $11,1 add $0,$11 sub $0,1 mov $4,$0 lpb $0,1 mov $0,1 mov $1,1 mul $1,$4 add $1,2 mul $1,2 add $1,1 lpe mov $12,$11 lpb $12,1 mov $10,$1 sub $12,1 lpe lpe lpb $9,1 mov $9,0 sub $10,$1 lpe mov $1,$10 mul $1,6 add $14,$1 lpe add $17,$14 lpe add $20,$17 lpe mov $1,$20
20.25
200
0.484774
5de9584ee5fcc4032d7162c56da66f8b8cc35ad1
628
asm
Assembly
oeis/022/A022145.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/022/A022145.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/022/A022145.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A022145: Coordination sequence for root lattice B_3. ; 1,18,74,170,306,482,698,954,1250,1586,1962,2378,2834,3330,3866,4442,5058,5714,6410,7146,7922,8738,9594,10490,11426,12402,13418,14474,15570,16706,17882,19098,20354,21650,22986,24362,25778,27234,28730,30266,31842,33458,35114,36810,38546,40322,42138,43994,45890,47826,49802,51818,53874,55970,58106,60282,62498,64754,67050,69386,71762,74178,76634,79130,81666,84242,86858,89514,92210,94946,97722,100538,103394,106290,109226,112202,115218,118274,121370,124506,127682,130898,134154,137450,140786,144162 mul $0,2 mov $1,2 mul $1,$0 trn $0,1 pow $0,2 pow $1,2 add $0,$1 add $0,1
52.333333
497
0.786624
4ddd07401d63ca26d50f7c24f43ce8a7ffb4f49a
266
asm
Assembly
programs/oeis/040/A040420.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/040/A040420.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/040/A040420.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A040420: Continued fraction for sqrt(442). ; 21,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42 pow $1,$0 gcd $1,2 mul $1,21
38
190
0.661654
c12f70c9fcd1d777573be1566d3cc4e0b6735732
564
asm
Assembly
oeis/024/A024094.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/024/A024094.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/024/A024094.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A024094: 8^n-n^6. ; 1,7,0,-217,0,17143,215488,1979503,16515072,133686287,1072741824,8588163031,68716490752,549750987079,4398038981568,35184360698207,281474959933440,2251799789547679,18014398475469760,144115188028809991,1152921504542846976,9223372036769009687,73786976294724826560,590295810358557615823,4722366482869454110720,37778931862956917568943,302231454903656984760768,2417851639229257961991863,19342813113834066313408512,154742504910672533767567207,1237940039285380274170124224,9903520314283042198305490111 mov $1,8 pow $1,$0 pow $0,6 sub $1,$0 mov $0,$1
62.666667
494
0.879433
29a92de4c5ca06d004a8eaedbffb97a6fad99976
1,785
asm
Assembly
pwnlib/shellcraft/templates/thumb/linux/findpeer.asm
DrKeineLust/pwntools
415f11bba7096b7d68fe144f5b3432b9c12a4f0a
[ "MIT" ]
8,966
2015-01-02T11:58:14.000Z
2022-03-31T21:19:56.000Z
pwnlib/shellcraft/templates/thumb/linux/findpeer.asm
DrKeineLust/pwntools
415f11bba7096b7d68fe144f5b3432b9c12a4f0a
[ "MIT" ]
1,401
2015-01-01T00:56:22.000Z
2022-03-31T16:19:53.000Z
pwnlib/shellcraft/templates/thumb/linux/findpeer.asm
DrKeineLust/pwntools
415f11bba7096b7d68fe144f5b3432b9c12a4f0a
[ "MIT" ]
1,844
2015-01-07T04:38:06.000Z
2022-03-30T03:54:46.000Z
<% from pwnlib.shellcraft.thumb import mov %> <% from socket import htons %> <%page args="port = None"/> <%docstring> findpeer(port) Finds a connected socket. If port is specified it is checked against the peer port. Resulting socket is left in r6. Example: >>> enhex(asm(shellcraft.findpeer(1337))) '6ff00006ee4606f101064ff001074fea072707f11f07f54630461fb401a96a4601df0130efdd01994fea11414ff039024fea022202f105029142e4d1' </%docstring> findpeer: /* File descriptor in r6 */ /* Inside the loop we begin by incrementing it */ /* so initially we want it to be -1 */ ${mov('r6', -1)} /* Let us restore stack easily */ mov lr, sp next_socket: /* Next file descriptor */ add r6, #1 ${mov('r7', 'SYS_getpeername')} /* Reset stack */ mov sp, lr /* First argument is file descriptor */ mov r0, r6 /* Make room on stack - inet addr structure is 16 bytes and size of addr is four bytes */ /* First four bytes will be the size of the address, the remaining 16 bytes will be */ /* the address structure */ push {r0, r1, r2, r3, r4} /* Second argument is pointer to where to store inet addr */ add r1, sp, #4 /* Third argument is pointer to size */ mov r2, sp /* Now issue system call */ svc 1 /* If the syscall returned negative this was a bad socket */ /* so move on to the next one */ adds r0, #1 ble next_socket %if not port is None: compare_port: /* Read the port into r1 */ ldr r1, [sp, #4] lsr r1, #16 /* Put the port (${port}) to search for into r2 */ ${mov('r2', htons(int(port)))} /* Is it the one we have been searching for? */ cmp r1, r2 /* If not try the next one */ bne next_socket %endif
26.25
130
0.628011
f14218924d0770df166810c14bfdbb014439c720
13
asm
Assembly
tests/inputs/test_single_inst/test_sd_one_inst/sd_single.asm
danielstumpp/tomasulo-simulator
54fd896adc6a7bcb098ad51cc35e7127ef7911b5
[ "MIT" ]
null
null
null
tests/inputs/test_single_inst/test_sd_one_inst/sd_single.asm
danielstumpp/tomasulo-simulator
54fd896adc6a7bcb098ad51cc35e7127ef7911b5
[ "MIT" ]
6
2021-11-13T03:26:46.000Z
2021-11-17T15:20:10.000Z
tests/inputs/test_single_inst/test_sd_one_inst/sd_single.asm
danielstumpp/tomasulo-simulator
54fd896adc6a7bcb098ad51cc35e7127ef7911b5
[ "MIT" ]
null
null
null
sd, F1, 6(R1)
13
13
0.538462
14415a37c23e5efe865194018fb4fc802d38ea5d
702
asm
Assembly
programs/oeis/045/A045807.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/045/A045807.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/045/A045807.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A045807: 7-ish numbers (end in 53, 71, 79, 97). ; 53,71,79,97,153,171,179,197,253,271,279,297,353,371,379,397,453,471,479,497,553,571,579,597,653,671,679,697,753,771,779,797,853,871,879,897,953,971,979,997,1053,1071,1079,1097,1153,1171,1179,1197,1253,1271,1279,1297,1353,1371,1379,1397,1453,1471,1479,1497,1553,1571,1579,1597,1653,1671,1679,1697,1753,1771,1779,1797,1853,1871,1879,1897,1953,1971,1979,1997,2053,2071,2079,2097,2153,2171,2179,2197,2253,2271,2279,2297,2353,2371,2379,2397,2453,2471,2479,2497 mov $6,3 add $6,$0 gcd $6,2 mov $7,$0 div $0,2 mod $0,2 mov $3,$6 mul $3,7 mov $4,6 mov $5,8 sub $5,$0 mul $4,$5 mul $4,4 sub $4,$3 mov $1,$4 sub $1,132 mov $2,$7 mul $2,25 add $1,$2 mov $0,$1
29.25
457
0.698006
a0c476ff2549a7fa6f796912246fc101685eacc5
13,895
asm
Assembly
libsrc/target/zx81/zx_lprintc5.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/target/zx81/zx_lprintc5.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/target/zx81/zx_lprintc5.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; ; Print on the ZX PRINTER with a small ZX81 font in 51 columns ; use -D ASCIIFONT for a bigger version supporting lowercase text etc.. ; add also -DXFONT for an even more accurate, slightly different behavior ; (closer text rows, 50 columns, more symbols on chr$ <32) ; ; Stefano Bodrato, 2018 ; ; ; $Id: zx_lprintc5.asm $ ; SECTION code_clib PUBLIC zx_lprintc5 PUBLIC _zx_lprintc5 EXTERN zx_print_buf EXTERN asctozx81 EXTERN prbuf_x ; set this one to 0 to wipe the buffer EXTERN zx_print_row .offsets_table defb 128,64,32,16,8,4,2,1 .zx_lprintc5 ._zx_lprintc5 ld a,(prbuf_x) and a call z,buf_reset ld hl,2 add hl,sp ld (charptr+1),hl ld a,(hl) .charptr ld hl,0 ld a,(hl) IF STANDARDESCAPECHARS cp 10 ; CR? jp z,newline ELSE cp 13 ; CR? jp z,newline ENDIF IF ASCIIFONT ; ld a,(hl) ELSE call asctozx81 ; now A holds the character code ENDIF ld e,a rla ld a,0 ; NOP jr nc,nocpl ld a,$2f ; CPL .nocpl ld (invrs),a ld (invrs2),a ld a,e IF ASCIIFONT and 127 ; mask the inverse bit cp 32 ELSE and 127 ; mask the inverse bit ENDIF jr z,space ; space chr ld c,a IF ASCIIFONT EXTERN font ld ix,font-256-8+1 ld de,8 .fontptr add ix,de dec a jr nz,fontptr ELSE ld ix,font5-7 ld de,7 .fontptr add ix,de dec a jr nz,fontptr ld a,9 ; font is slightly condensed, here we rebuild the first row sub c sbc a,a ; 0 (nop) or FF and $AF ; xor a, overrides "ld a,(ix+1)" used on characters 0..8 ld (firstbyte),a ENDIF ld a,(prbuf_x) ld c,a AND 7 ; @00000111 ld hl,offsets_table ld e,a ;ld d,0 add hl,de ld a,(hl) ld (_smc1+1),a ld a,c rra srl a srl a ;ld d,0 ld e,a ld hl,buf add hl,de ld (rowadr1)+1,hl ld d,8 IF ASCIIFONT ld a,(ix-1) ; First chr shape line ELSE ld a,(ix+1) ; First chr shape line (=third one for chr$ codes <=8) .firstbyte xor a ; ld a,0 ..first chr shape line for the other characters, SMC disables it when necessary ENDIF .invrs nop ; toggles between "nop" and "cpl" ld c,a ._oloop ld b,5 ;Load width ._smc1 ld a,1 ;Load pixel mask ._iloop sla c ;Test leftmost pixel jr nc,_noplot ;See if a plot is needed ld e,a or (hl) ld (hl),a ld a,e ._noplot rrca jr nc,_notedge ;Test if edge of byte reached inc hl ;Go to next byte ._notedge djnz _iloop ; --------- .rowadr1 ld hl,0 ; current address push de ld de,32 add hl,de pop de ld (rowadr1+1),hl ; --------- ld a,(ix+0) ;Load one line of image .invrs2 nop ; changed into nop / cpl ld c,a inc ix dec d jr nz,_oloop .space ld a,(prbuf_x) cp 250 ; last valid column position ? jr z,newline add 5 ld (prbuf_x),a ret .newline ld hl,buf call zx_print_buf .buf_reset ld hl,buf xor a ld (prbuf_x),a ld (hl),a ld d,h ld e,l inc de ld bc,255 ldir ; -- optional text line spacing ld hl,buf call zx_print_row IF XFONT jr space ELSE ret ENDIF SECTION rodata_clib IF ASCIIFONT IF XFONT ; graphics and umlaut defb 0x00 , 0x60 , 0x90 , 0xE0 , 0x90 , 0x90 , 0xA0 , 0x00 ;11 - ss defb 0x00 , 0x00 , 0x60 , 0x90 , 0xE0 , 0x90 , 0xA0 , 0x80 ;12 - SS defb 0,0,0,0,0,0,0,0 defb 0x90 , 0x00 , 0x60 , 0x90 , 0xF0 , 0x90 , 0x90 , 0x00 ;14 - a defb 0x90 , 0x00 , 0x60 , 0x90 , 0x90 , 0x90 , 0x60 , 0x00 ;15 - o defb 0x90 , 0x00 , 0x90 , 0x90 , 0x90 , 0x90 , 0x60 , 0x00 ;16 - u defb 0x00 , 0x90 , 0x00 , 0x60 , 0x90 , 0x90 , 0x70 , 0x00 ;17 - A defb 0x00 , 0x90 , 0x00 , 0x60 , 0x90 , 0x90 , 0x60 , 0x00 ;18 - O defb 0x00 , 0x00 , 0x90 , 0x00 , 0x90 , 0x90 , 0x60 , 0x00 ;19 - U defb 0x00 , 0x60 , 0x90 , 0xC0 , 0xE0 , 0x80 , 0x90 , 0x60 ;20 (euro symbol) defb 0xE0 , 0xE0 , 0xE0 , 0xE0 , 0x00 , 0x00 , 0x00 , 0x00 defb 0x38 , 0x38 , 0x38 , 0x38 , 0x00 , 0x00 , 0x00 , 0x00 ;22 defb 0xF8 , 0xF8 , 0xF8 , 0xF8 , 0x00 , 0x00 , 0x00 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x00 , 0xE0 , 0xE0 , 0xE0 , 0xE0 ;24 defb 0xE0 , 0xE0 , 0xE0 , 0xE0 , 0xE0 , 0xE0 , 0xE0 , 0xE0 defb 0x38 , 0x38 , 0x38 , 0x38 , 0xE0 , 0xE0 , 0xE0 , 0xE0 ;26 defb 0xF8 , 0xF8 , 0xF8 , 0xF8 , 0xE0 , 0xE0 , 0xE0 , 0xE0 defb 0xA8 , 0x50 , 0xA8 , 0x50 , 0xA8 , 0x50 , 0xA8 , 0x50 ;28 (gray block) defb 0x00 , 0x00 , 0x00 , 0x00 , 0xA8 , 0x50 , 0xA8 , 0x50 defb 0xA8 , 0x50 , 0xA8 , 0x50 , 0x00 , 0x00 , 0x00 , 0x00 ;30 defb 0x50 , 0x50 , 0x50 , 0x50 , 0x00 , 0x00 , 0x00 , 0x00 defb 0,0,0,0,0,0,0,0 ENDIF .font defb 0x00 , 0x20 , 0x20 , 0x20 , 0x20 , 0x00 , 0x20 , 0x00 defb 0x00 , 0x50 , 0x50 , 0x50 , 0x00 , 0x00 , 0x00 , 0x00 defb 0x50 , 0x50 , 0xF8 , 0x50 , 0xF8 , 0x50 , 0x50 , 0x00 defb 0x20 , 0x70 , 0xA0 , 0x70 , 0x28 , 0x70 , 0x20 , 0x00 defb 0x00 , 0x40 , 0x50 , 0x20 , 0x50 , 0x10 , 0x00 , 0x00 defb 0x40 , 0xA0 , 0xA0 , 0x40 , 0xA0 , 0xA0 , 0x50 , 0x00 defb 0x00 , 0x20 , 0x20 , 0x20 , 0x00 , 0x00 , 0x00 , 0x00 defb 0x00 , 0x20 , 0x40 , 0x40 , 0x40 , 0x40 , 0x20 , 0x00 defb 0x00 , 0x40 , 0x20 , 0x20 , 0x20 , 0x20 , 0x40 , 0x00 defb 0x00 , 0x00 , 0x90 , 0x60 , 0xF0 , 0x60 , 0x90 , 0x00 defb 0x00 , 0x00 , 0x20 , 0x20 , 0xF8 , 0x20 , 0x20 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x30 , 0x20 , 0x40 defb 0x00 , 0x00 , 0x00 , 0x00 , 0xF0 , 0x00 , 0x00 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x20 , 0x70 , 0x00 ; '.' ;defb 0x00 , 0x10 , 0x10 , 0x20 , 0x40 , 0x80 , 0x80 , 0x00 ; '/' defb 0x00 , 0x10 , 0x10 , 0x20 , 0x40 , 0x80 , 0x80 , 0x00 ; '/' defb 0x00 , 0x60 , 0x90 , 0xB0 , 0xD0 , 0x90 , 0x60 , 0x00 ; '0' defb 0x00 , 0x20 , 0x60 , 0x20 , 0x20 , 0x20 , 0x70 , 0x00 defb 0x00 , 0x60 , 0x90 , 0x10 , 0x60 , 0x80 , 0xF0 , 0x00 defb 0x00 , 0xF0 , 0x20 , 0x60 , 0x10 , 0x90 , 0x60 , 0x00 defb 0x00 , 0x20 , 0x60 , 0xA0 , 0xF0 , 0x20 , 0x20 , 0x00 defb 0x00 , 0xF0 , 0x80 , 0xE0 , 0x10 , 0x90 , 0x60 , 0x00 defb 0x00 , 0x60 , 0x80 , 0xE0 , 0x90 , 0x90 , 0x60 , 0x00 defb 0x00 , 0xF0 , 0x10 , 0x20 , 0x20 , 0x40 , 0x40 , 0x00 defb 0x00 , 0x60 , 0x90 , 0x60 , 0x90 , 0x90 , 0x60 , 0x00 defb 0x00 , 0x60 , 0x90 , 0x90 , 0x70 , 0x10 , 0x60 , 0x00 defb 0x00 , 0x00 , 0x60 , 0x60 , 0x00 , 0x60 , 0x60 , 0x00 defb 0x00 , 0x00 , 0x30 , 0x30 , 0x00 , 0x30 , 0x20 , 0x40 defb 0x00 , 0x10 , 0x20 , 0x40 , 0x40 , 0x20 , 0x10 , 0x00 defb 0x00 , 0x00 , 0x00 , 0xF0 , 0x00 , 0xF0 , 0x00 , 0x00 defb 0x00 , 0x40 , 0x20 , 0x10 , 0x10 , 0x20 , 0x40 , 0x00 defb 0x00 , 0x20 , 0x50 , 0x10 , 0x20 , 0x00 , 0x20 , 0x00 defb 0x30 , 0x48 , 0x98 , 0xA8 , 0xA8 , 0x90 , 0x40 , 0x30 defb 0x00 , 0x60 , 0x90 , 0x90 , 0xF0 , 0x90 , 0x90 , 0x00 defb 0x00 , 0xE0 , 0x90 , 0xE0 , 0x90 , 0x90 , 0xE0 , 0x00 defb 0x00 , 0x60 , 0x90 , 0x80 , 0x80 , 0x90 , 0x60 , 0x00 defb 0x00 , 0xE0 , 0x90 , 0x90 , 0x90 , 0x90 , 0xE0 , 0x00 defb 0x00 , 0xF0 , 0x80 , 0xE0 , 0x80 , 0x80 , 0xF0 , 0x00 defb 0x00 , 0xF0 , 0x80 , 0xE0 , 0x80 , 0x80 , 0x80 , 0x00 defb 0x00 , 0x60 , 0x90 , 0x80 , 0xB0 , 0x90 , 0x60 , 0x00 defb 0x00 , 0x90 , 0x90 , 0xF0 , 0x90 , 0x90 , 0x90 , 0x00 defb 0x00 , 0x70 , 0x20 , 0x20 , 0x20 , 0x20 , 0x70 , 0x00 defb 0x00 , 0x70 , 0x20 , 0x20 , 0x20 , 0xA0 , 0x40 , 0x00 defb 0x00 , 0x90 , 0xA0 , 0xC0 , 0xA0 , 0xA0 , 0x90 , 0x00 defb 0x00 , 0x80 , 0x80 , 0x80 , 0x80 , 0x80 , 0xF0 , 0x00 defb 0x00 , 0x90 , 0xF0 , 0xF0 , 0x90 , 0x90 , 0x90 , 0x00 defb 0x00 , 0x90 , 0xD0 , 0xF0 , 0xB0 , 0xB0 , 0x90 , 0x00 defb 0x00 , 0x60 , 0x90 , 0x90 , 0x90 , 0x90 , 0x60 , 0x00 defb 0x00 , 0xE0 , 0x90 , 0x90 , 0xE0 , 0x80 , 0x80 , 0x00 defb 0x00 , 0x60 , 0x90 , 0x90 , 0xD0 , 0xB0 , 0x60 , 0x10 defb 0x00 , 0xE0 , 0x90 , 0x90 , 0xE0 , 0x90 , 0x90 , 0x00 defb 0x00 , 0x60 , 0x90 , 0x40 , 0x20 , 0x90 , 0x60 , 0x00 defb 0x00 , 0x70 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x00 defb 0x00 , 0x90 , 0x90 , 0x90 , 0x90 , 0x90 , 0x60 , 0x00 defb 0x00 , 0x90 , 0x90 , 0x90 , 0x90 , 0x60 , 0x60 , 0x00 defb 0x00 , 0x90 , 0x90 , 0x90 , 0xF0 , 0xF0 , 0x90 , 0x00 defb 0x00 , 0x90 , 0x90 , 0x60 , 0x60 , 0x90 , 0x90 , 0x00 defb 0x00 , 0x88 , 0x88 , 0x50 , 0x20 , 0x20 , 0x20 , 0x00 defb 0x00 , 0xF0 , 0x10 , 0x20 , 0x40 , 0x80 , 0xF0 , 0x00 defb 0x00 , 0x70 , 0x40 , 0x40 , 0x40 , 0x40 , 0x70 , 0x00 defb 0x00 , 0x80 , 0x80 , 0x40 , 0x20 , 0x10 , 0x10 , 0x00 ; '\' defb 0x00 , 0x70 , 0x10 , 0x10 , 0x10 , 0x10 , 0x70 , 0x00 defb 0x00 , 0x20 , 0x50 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0xF0 ; '_' defb 0x00 , 0x40 , 0x20 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x70 , 0x90 , 0x90 , 0x70 , 0x00 defb 0x00 , 0x80 , 0x80 , 0xE0 , 0x90 , 0x90 , 0xE0 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x30 , 0x40 , 0x40 , 0x30 , 0x00 defb 0x00 , 0x10 , 0x10 , 0x70 , 0x90 , 0x90 , 0x70 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x60 , 0xB0 , 0xC0 , 0x60 , 0x00 defb 0x00 , 0x20 , 0x50 , 0x40 , 0xE0 , 0x40 , 0x40 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x60 , 0x90 , 0x70 , 0x10 , 0x60 defb 0x00 , 0x80 , 0x80 , 0xE0 , 0x90 , 0x90 , 0x90 , 0x00 defb 0x00 , 0x20 , 0x00 , 0x60 , 0x20 , 0x20 , 0x70 , 0x00 defb 0x00 , 0x10 , 0x00 , 0x10 , 0x10 , 0x10 , 0x50 , 0x20 defb 0x00 , 0x80 , 0x80 , 0x90 , 0xE0 , 0x90 , 0x90 , 0x00 defb 0x00 , 0x60 , 0x20 , 0x20 , 0x20 , 0x20 , 0x70 , 0x00 defb 0x00 , 0x00 , 0x00 , 0xD0 , 0xA8 , 0xA8 , 0xA8 , 0x00 defb 0x00 , 0x00 , 0x00 , 0xE0 , 0x90 , 0x90 , 0x90 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x60 , 0x90 , 0x90 , 0x60 , 0x00 defb 0x00 , 0x00 , 0x00 , 0xE0 , 0x90 , 0xE0 , 0x80 , 0x80 defb 0x00 , 0x00 , 0x00 , 0x70 , 0x90 , 0x70 , 0x10 , 0x10 defb 0x00 , 0x00 , 0x00 , 0xA0 , 0xD0 , 0x80 , 0x80 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x30 , 0x60 , 0x10 , 0x60 , 0x00 defb 0x00 , 0x40 , 0x40 , 0xE0 , 0x40 , 0x50 , 0x20 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x90 , 0x90 , 0x90 , 0x70 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x50 , 0x50 , 0x50 , 0x20 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x88 , 0xA8 , 0xA8 , 0x50 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x90 , 0x60 , 0x60 , 0x90 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x90 , 0x90 , 0x70 , 0x90 , 0x60 defb 0x00 , 0x00 , 0x00 , 0xF0 , 0x20 , 0x40 , 0xF0 , 0x00 defb 0x30 , 0x40 , 0x20 , 0xC0 , 0x20 , 0x40 , 0x30 , 0x00 defb 0x00 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x00 defb 0xC0 , 0x20 , 0x40 , 0x30 , 0x40 , 0x20 , 0xC0 , 0x00 defb 0x00 , 0x50 , 0xA0 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ELSE .font5 ; 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00, ; 0 defb 0xE0 , 0xE0 , 0xE0 , 0x00 , 0x00 , 0x00 , 0x00 defb 0x38 , 0x38 , 0x38 , 0x00 , 0x00 , 0x00 , 0x00 defb 0xF8 , 0xF8 , 0xF8 , 0x00 , 0x00 , 0x00 , 0x00 defb 0x00 , 0x00 , 0x00 , 0xE0 , 0xE0 , 0xE0 , 0xE0 defb 0xE0 , 0xE0 , 0xE0 , 0xE0 , 0xE0 , 0xE0 , 0xE0 defb 0x38 , 0x38 , 0x38 , 0xE0 , 0xE0 , 0xE0 , 0xE0 defb 0xF8 , 0xF8 , 0xF8 , 0xE0 , 0xE0 , 0xE0 , 0xE0 defb 0x50 , 0xA8 , 0x50 , 0xA8 , 0x50 , 0xA8 , 0x50 defb 0x00 , 0x00 , 0x00 , 0xA8 , 0x50 , 0xA8 , 0x50 defb 0x50 , 0xA8 , 0x50 , 0x00 , 0x00 , 0x00 , 0x00 ; 10 defb 0x50 , 0x50 , 0x50 , 0x00 , 0x00 , 0x00 , 0x00 defb 0x60 , 0x90 , 0xC0 , 0x80 , 0x80 , 0xF0 , 0x00 defb 0x20 , 0x70 , 0x40 , 0x70 , 0x10 , 0x70 , 0x20 defb 0x00 , 0x20 , 0x00 , 0x00 , 0x00 , 0x20 , 0x00 defb 0x20 , 0x50 , 0x10 , 0x20 , 0x00 , 0x20 , 0x00 defb 0x10 , 0x20 , 0x20 , 0x20 , 0x20 , 0x10 , 0x00 defb 0x40 , 0x20 , 0x20 , 0x20 , 0x20 , 0x40 , 0x00 defb 0x00 , 0x40 , 0x20 , 0x10 , 0x20 , 0x40 , 0x00 defb 0x00 , 0x10 , 0x20 , 0x40 , 0x20 , 0x10 , 0x00 defb 0x00 , 0x00 , 0x70 , 0x00 , 0x70 , 0x00 , 0x00 ; 20 defb 0x00 , 0x00 , 0x20 , 0x70 , 0x20 , 0x00 , 0x00 defb 0x00 , 0x00 , 0x00 , 0x70 , 0x00 , 0x00 , 0x00 defb 0x00 , 0x00 , 0x50 , 0x20 , 0x50 , 0x00 , 0x00 defb 0x10 , 0x10 , 0x20 , 0x20 , 0x40 , 0x40 , 0x00 defb 0x00 , 0x20 , 0x00 , 0x00 , 0x00 , 0x20 , 0x40 defb 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x20 , 0x40 defb 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x20 , 0x00 defb 0x60 , 0x90 , 0xB0 , 0xD0 , 0x90 , 0x60 , 0x00 ; '0' defb 0x20 , 0x60 , 0x20 , 0x20 , 0x20 , 0x70 , 0x00 defb 0x60 , 0x90 , 0x10 , 0x60 , 0x80 , 0xF0 , 0x00 ; 30 defb 0xE0 , 0x10 , 0x60 , 0x10 , 0x10 , 0xE0 , 0x00 defb 0x20 , 0x60 , 0xA0 , 0xA0 , 0xF0 , 0x20 , 0x00 defb 0xF0 , 0x80 , 0x60 , 0x10 , 0x90 , 0x60 , 0x00 defb 0x70 , 0x80 , 0xE0 , 0x90 , 0x90 , 0x60 , 0x00 defb 0xF0 , 0x10 , 0x20 , 0x20 , 0x40 , 0x40 , 0x00 defb 0x60 , 0x90 , 0x60 , 0x90 , 0x90 , 0x60 , 0x00 defb 0x60 , 0x90 , 0x90 , 0x70 , 0x10 , 0xE0 , 0x00 defb 0x60 , 0x90 , 0x90 , 0xF0 , 0x90 , 0x90 , 0x00 defb 0xE0 , 0x90 , 0xE0 , 0x90 , 0x90 , 0xE0 , 0x00 defb 0x60 , 0x90 , 0x80 , 0x80 , 0x90 , 0x60 , 0x00 ; 40 defb 0xC0 , 0xA0 , 0x90 , 0x90 , 0x90 , 0xE0 , 0x00 defb 0xF0 , 0x80 , 0xE0 , 0x80 , 0x80 , 0xF0 , 0x00 defb 0xF0 , 0x80 , 0xE0 , 0x80 , 0x80 , 0x80 , 0x00 defb 0x60 , 0x80 , 0x80 , 0xB0 , 0x90 , 0x60 , 0x00 defb 0x90 , 0x90 , 0xF0 , 0x90 , 0x90 , 0x90 , 0x00 defb 0x70 , 0x20 , 0x20 , 0x20 , 0x20 , 0x70 , 0x00 defb 0x30 , 0x10 , 0x10 , 0x10 , 0x90 , 0x60 , 0x00 defb 0x90 , 0xA0 , 0xC0 , 0xA0 , 0x90 , 0x90 , 0x00 defb 0x80 , 0x80 , 0x80 , 0x80 , 0x80 , 0xF0 , 0x00 defb 0x88 , 0xD8 , 0xA8 , 0x88 , 0x88 , 0x88 , 0x00 ; 50 defb 0x90 , 0xD0 , 0xB0 , 0x90 , 0x90 , 0x90 , 0x00 defb 0x60 , 0x90 , 0x90 , 0x90 , 0x90 , 0x60 , 0x00 defb 0xE0 , 0x90 , 0x90 , 0xE0 , 0x80 , 0x80 , 0x00 defb 0x60 , 0x90 , 0x90 , 0x90 , 0xB0 , 0x70 , 0x00 defb 0xE0 , 0x90 , 0x90 , 0xE0 , 0x90 , 0x90 , 0x00 defb 0x60 , 0x80 , 0x60 , 0x10 , 0x10 , 0xE0 , 0x00 defb 0xF8 , 0x20 , 0x20 , 0x20 , 0x20 , 0x20 , 0x00 defb 0x90 , 0x90 , 0x90 , 0x90 , 0x90 , 0x60 , 0x00 defb 0x88 , 0x88 , 0x50 , 0x50 , 0x50 , 0x20 , 0x00 ; 'V' defb 0x88 , 0x88 , 0x88 , 0x88 , 0xA8 , 0x50 , 0x00 ; 60 defb 0x88 , 0x50 , 0x20 , 0x20 , 0x50 , 0x88 , 0x00 defb 0x90 , 0x90 , 0x50 , 0x20 , 0x40 , 0x80 , 0x00 defb 0xF0 , 0x10 , 0x20 , 0x40 , 0x80 , 0xF0 , 0x00 ; ENDIF SECTION data_clib .prbuf_x defb 0 SECTION bss_clib .buf defs 256
33.481928
96
0.601511
3ff39312a4a2b1b05045cf7a5b3e5a06b8f8ea77
239,228
asm
Assembly
配套代码/L008/L008A/008A.asm
zmrbak/ReverseAnalysis
994fdc61c8af2eecc2a065a6f5ee0aacf371e836
[ "MIT" ]
35
2019-11-19T03:12:09.000Z
2022-02-18T08:38:53.000Z
配套代码/L008/L008A/008A.asm
zmrbak/ReverseAnalysis
994fdc61c8af2eecc2a065a6f5ee0aacf371e836
[ "MIT" ]
null
null
null
配套代码/L008/L008A/008A.asm
zmrbak/ReverseAnalysis
994fdc61c8af2eecc2a065a6f5ee0aacf371e836
[ "MIT" ]
22
2019-08-03T17:07:17.000Z
2022-02-18T08:38:55.000Z
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.23.28008.0 TITLE C:\Users\libit\source\repos\L008A\L008A\L008A.cpp .686P .XMM include listing.inc .model flat INCLUDELIB LIBCMT INCLUDELIB OLDNAMES CONST SEGMENT $SG29959 DB 'Hello World!', 0aH, 00H CONST ENDS PUBLIC ??2@YAPAXIPAX@Z ; operator new PUBLIC ??0exception@std@@QAE@QBD@Z ; std::exception::exception PUBLIC ??0exception@std@@QAE@QBDH@Z ; std::exception::exception PUBLIC ??0exception@std@@QAE@ABV01@@Z ; std::exception::exception PUBLIC ??1exception@std@@UAE@XZ ; std::exception::~exception PUBLIC ?what@exception@std@@UBEPBDXZ ; std::exception::what PUBLIC ??_Gexception@std@@UAEPAXI@Z ; std::exception::`scalar deleting destructor' PUBLIC ??0bad_alloc@std@@AAE@QBD@Z ; std::bad_alloc::bad_alloc PUBLIC ??1bad_alloc@std@@UAE@XZ ; std::bad_alloc::~bad_alloc PUBLIC ??0bad_alloc@std@@QAE@ABV01@@Z ; std::bad_alloc::bad_alloc PUBLIC ??_Gbad_alloc@std@@UAEPAXI@Z ; std::bad_alloc::`scalar deleting destructor' PUBLIC ??0bad_array_new_length@std@@QAE@XZ ; std::bad_array_new_length::bad_array_new_length PUBLIC ??1bad_array_new_length@std@@UAE@XZ ; std::bad_array_new_length::~bad_array_new_length PUBLIC ??0bad_array_new_length@std@@QAE@ABV01@@Z ; std::bad_array_new_length::bad_array_new_length PUBLIC ??_Gbad_array_new_length@std@@UAEPAXI@Z ; std::bad_array_new_length::`scalar deleting destructor' PUBLIC ?_Throw_bad_array_new_length@std@@YAXXZ ; std::_Throw_bad_array_new_length PUBLIC ?max@?$numeric_limits@H@std@@SAHXZ ; std::numeric_limits<int>::max PUBLIC ?_Allocate@_Default_allocate_traits@std@@SAPAXI@Z ; std::_Default_allocate_traits::_Allocate PUBLIC ?_Adjust_manually_vector_aligned@std@@YAXAAPAXAAI@Z ; std::_Adjust_manually_vector_aligned PUBLIC ??$_Convert_size@I@std@@YAII@Z ; std::_Convert_size<unsigned int> PUBLIC ?_Orphan_all@_Container_base0@std@@QAEXXZ ; std::_Container_base0::_Orphan_all PUBLIC ?_Alloc_proxy@_Container_base0@std@@QAEXABU_Fake_allocator@2@@Z ; std::_Container_base0::_Alloc_proxy PUBLIC ??0_Fake_proxy_ptr_impl@std@@QAE@ABU_Fake_allocator@1@ABU_Container_base0@1@@Z ; std::_Fake_proxy_ptr_impl::_Fake_proxy_ptr_impl PUBLIC ?_Release@_Fake_proxy_ptr_impl@std@@QAEXXZ ; std::_Fake_proxy_ptr_impl::_Release PUBLIC ?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z ; std::_Narrow_char_traits<char,int>::length PUBLIC ?copy@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z ; std::_Narrow_char_traits<char,int>::copy PUBLIC ?move@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z ; std::_Narrow_char_traits<char,int>::move PUBLIC ?assign@?$_Narrow_char_traits@DH@std@@SAXAADABD@Z ; std::_Narrow_char_traits<char,int>::assign PUBLIC ?to_int_type@?$_Narrow_char_traits@DH@std@@SAHABD@Z ; std::_Narrow_char_traits<char,int>::to_int_type PUBLIC ?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z ; std::_Narrow_char_traits<char,int>::eq_int_type PUBLIC ?eof@?$_Narrow_char_traits@DH@std@@SAHXZ ; std::_Narrow_char_traits<char,int>::eof PUBLIC ??0?$allocator@D@std@@QAE@XZ ; std::allocator<char>::allocator<char> PUBLIC ?deallocate@?$allocator@D@std@@QAEXQADI@Z ; std::allocator<char>::deallocate PUBLIC ?allocate@?$allocator@D@std@@QAEPADI@Z ; std::allocator<char>::allocate PUBLIC ?max_size@?$_Default_allocator_traits@V?$allocator@D@std@@@std@@SAIABV?$allocator@D@2@@Z ; std::_Default_allocator_traits<std::allocator<char> >::max_size PUBLIC ?select_on_container_copy_construction@?$_Default_allocator_traits@V?$allocator@D@std@@@std@@SA?AV?$allocator@D@2@ABV32@@Z ; std::_Default_allocator_traits<std::allocator<char> >::select_on_container_copy_construction PUBLIC ??0?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ; std::_String_val<std::_Simple_types<char> >::_String_val<std::_Simple_types<char> > PUBLIC ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QAEPADXZ ; std::_String_val<std::_Simple_types<char> >::_Myptr PUBLIC ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QBEPBDXZ ; std::_String_val<std::_Simple_types<char> >::_Myptr PUBLIC ?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QBE_NXZ ; std::_String_val<std::_Simple_types<char> >::_Large_string_engaged PUBLIC ??0_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ; std::_String_val<std::_Simple_types<char> >::_Bxty::_Bxty PUBLIC ??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ; std::_String_val<std::_Simple_types<char> >::_Bxty::~_Bxty PUBLIC ??1?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ; std::_String_val<std::_Simple_types<char> >::~_String_val<std::_Simple_types<char> > PUBLIC ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > PUBLIC ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@QBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > PUBLIC ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@$$QAV01@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > PUBLIC ?_Memcpy_val_from@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXABV12@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Memcpy_val_from PUBLIC ?_Take_contents@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXAAV12@U?$integral_constant@_N$00@2@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Take_contents PUBLIC ?_Construct_lv_contents@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXABV12@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Construct_lv_contents PUBLIC ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> > PUBLIC ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append PUBLIC ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBDI@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append PUBLIC ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append PUBLIC ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBDI@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign PUBLIC ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign PUBLIC ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::c_str PUBLIC ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size PUBLIC ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::max_size PUBLIC ?empty@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE_NXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::empty PUBLIC ?_Calculate_growth@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAIIII@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Calculate_growth PUBLIC ?_Calculate_growth@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABEII@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Calculate_growth PUBLIC ?_Tidy_init@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_init PUBLIC ?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_deallocate PUBLIC ?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAXXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Xlen PUBLIC ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV?$allocator@D@2@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal PUBLIC ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABEABV?$allocator@D@2@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal PUBLIC ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAEAAV?$allocator@D@2@XZ ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Get_first PUBLIC ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QBEABV?$allocator@D@2@XZ ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Get_first PUBLIC ??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@XZ ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::~_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1> PUBLIC ??0runtime_error@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z ; std::runtime_error::runtime_error PUBLIC ??1runtime_error@std@@UAE@XZ ; std::runtime_error::~runtime_error PUBLIC ??0runtime_error@std@@QAE@ABV01@@Z ; std::runtime_error::runtime_error PUBLIC ??_Gruntime_error@std@@UAEPAXI@Z ; std::runtime_error::`scalar deleting destructor' PUBLIC ?make_error_code@std@@YA?AVerror_code@1@W4io_errc@1@@Z ; std::make_error_code PUBLIC ?iostream_category@std@@YAABVerror_category@1@XZ ; std::iostream_category PUBLIC ??0error_category@std@@QAE@XZ ; std::error_category::error_category PUBLIC ??1error_category@std@@UAE@XZ ; std::error_category::~error_category PUBLIC ?default_error_condition@error_category@std@@UBE?AVerror_condition@2@H@Z ; std::error_category::default_error_condition PUBLIC ?equivalent@error_category@std@@UBE_NHABVerror_condition@2@@Z ; std::error_category::equivalent PUBLIC ?equivalent@error_category@std@@UBE_NABVerror_code@2@H@Z ; std::error_category::equivalent PUBLIC ??8error_category@std@@QBE_NABV01@@Z ; std::error_category::operator== PUBLIC ??0error_code@std@@QAE@HABVerror_category@1@@Z ; std::error_code::error_code PUBLIC ?value@error_code@std@@QBEHXZ ; std::error_code::value PUBLIC ?category@error_code@std@@QBEABVerror_category@2@XZ ; std::error_code::category PUBLIC ?message@error_code@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ ; std::error_code::message PUBLIC ??0error_condition@std@@QAE@HABVerror_category@1@@Z ; std::error_condition::error_condition PUBLIC ?value@error_condition@std@@QBEHXZ ; std::error_condition::value PUBLIC ?category@error_condition@std@@QBEABVerror_category@2@XZ ; std::error_condition::category PUBLIC ??8std@@YA_NABVerror_condition@0@0@Z ; std::operator== PUBLIC ?_Makestr@_System_error@std@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@Verror_code@2@V32@@Z ; std::_System_error::_Makestr PUBLIC ??0_System_error@std@@IAE@Verror_code@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z ; std::_System_error::_System_error PUBLIC ??1_System_error@std@@UAE@XZ ; std::_System_error::~_System_error PUBLIC ??0_System_error@std@@QAE@ABV01@@Z ; std::_System_error::_System_error PUBLIC ??_G_System_error@std@@UAEPAXI@Z ; std::_System_error::`scalar deleting destructor' PUBLIC ??0system_error@std@@QAE@Verror_code@1@PBD@Z ; std::system_error::system_error PUBLIC ??1system_error@std@@UAE@XZ ; std::system_error::~system_error PUBLIC ??0system_error@std@@QAE@ABV01@@Z ; std::system_error::system_error PUBLIC ??_Gsystem_error@std@@UAEPAXI@Z ; std::system_error::`scalar deleting destructor' PUBLIC ??0_Generic_error_category@std@@QAE@XZ ; std::_Generic_error_category::_Generic_error_category PUBLIC ?name@_Generic_error_category@std@@UBEPBDXZ ; std::_Generic_error_category::name PUBLIC ?message@_Generic_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z ; std::_Generic_error_category::message PUBLIC ??1_Generic_error_category@std@@UAE@XZ ; std::_Generic_error_category::~_Generic_error_category PUBLIC ??_G_Generic_error_category@std@@UAEPAXI@Z ; std::_Generic_error_category::`scalar deleting destructor' PUBLIC ??0_Iostream_error_category@std@@QAE@XZ ; std::_Iostream_error_category::_Iostream_error_category PUBLIC ?name@_Iostream_error_category@std@@UBEPBDXZ ; std::_Iostream_error_category::name PUBLIC ?message@_Iostream_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z ; std::_Iostream_error_category::message PUBLIC ??1_Iostream_error_category@std@@UAE@XZ ; std::_Iostream_error_category::~_Iostream_error_category PUBLIC ??_G_Iostream_error_category@std@@UAEPAXI@Z ; std::_Iostream_error_category::`scalar deleting destructor' PUBLIC ??$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@0@XZ ; std::_Immortalize<std::_Iostream_error_category> PUBLIC ??0failure@ios_base@std@@QAE@PBDABVerror_code@2@@Z ; std::ios_base::failure::failure PUBLIC ??1failure@ios_base@std@@UAE@XZ ; std::ios_base::failure::~failure PUBLIC ??0failure@ios_base@std@@QAE@ABV012@@Z ; std::ios_base::failure::failure PUBLIC ??_Gfailure@ios_base@std@@UAEPAXI@Z ; std::ios_base::failure::`scalar deleting destructor' PUBLIC ?clear@ios_base@std@@QAEXH_N@Z ; std::ios_base::clear PUBLIC ?rdstate@ios_base@std@@QBEHXZ ; std::ios_base::rdstate PUBLIC ?good@ios_base@std@@QBE_NXZ ; std::ios_base::good PUBLIC ?flags@ios_base@std@@QBEHXZ ; std::ios_base::flags PUBLIC ?width@ios_base@std@@QBE_JXZ ; std::ios_base::width PUBLIC ?width@ios_base@std@@QAE_J_J@Z ; std::ios_base::width PUBLIC ?f@@YAXXZ ; f PUBLIC _main PUBLIC ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z ; std::basic_ios<char,std::char_traits<char> >::clear PUBLIC ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z ; std::basic_ios<char,std::char_traits<char> >::setstate PUBLIC ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ ; std::basic_ios<char,std::char_traits<char> >::tie PUBLIC ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ ; std::basic_ios<char,std::char_traits<char> >::rdbuf PUBLIC ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ ; std::basic_ios<char,std::char_traits<char> >::fill PUBLIC ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ ; std::basic_ostream<char,std::char_traits<char> >::_Osfx PUBLIC ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ ; std::basic_ostream<char,std::char_traits<char> >::flush PUBLIC ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<<<std::char_traits<char> > PUBLIC ??$_Min_value@I@std@@YAABIABI0@Z ; std::_Min_value<unsigned int> PUBLIC ??$_Unfancy@D@std@@YAPADPAD@Z ; std::_Unfancy<char> PUBLIC ??$move@AAV?$allocator@D@std@@@std@@YA$$QAV?$allocator@D@0@AAV10@@Z ; std::move<std::allocator<char> &> PUBLIC ??$?0V?$allocator@D@std@@$$V@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@U_One_then_variadic_args_t@1@$$QAV?$allocator@D@1@@Z ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1><std::allocator<char> > PUBLIC ??$?0$$V@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@U_Zero_then_variadic_args_t@1@@Z ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1><> PUBLIC ??$_Destroy_in_place@PAD@std@@YAXAAPAD@Z ; std::_Destroy_in_place<char *> PUBLIC ??$_Max_value@I@std@@YAABIABI0@Z ; std::_Max_value<unsigned int> PUBLIC ??R<lambda_9366063389c5f42a00a5088cf24e69de>@@QBEXQADIQBD@Z ; <lambda_9366063389c5f42a00a5088cf24e69de>::operator() PUBLIC ??$_Reallocate_for@V<lambda_9366063389c5f42a00a5088cf24e69de>@@PBD@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV01@IV<lambda_9366063389c5f42a00a5088cf24e69de>@@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Reallocate_for<<lambda_9366063389c5f42a00a5088cf24e69de>,char const *> PUBLIC ??R<lambda_ab246b20b9526e2ef7792587e4298a77>@@QBEXQADQBDI1I@Z ; <lambda_ab246b20b9526e2ef7792587e4298a77>::operator() PUBLIC ??$_Reallocate_grow_by@V<lambda_ab246b20b9526e2ef7792587e4298a77>@@PBDI@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV01@IV<lambda_ab246b20b9526e2ef7792587e4298a77>@@PBDI@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Reallocate_grow_by<<lambda_ab246b20b9526e2ef7792587e4298a77>,char const *,unsigned int> PUBLIC ??$_Construct_in_place@PADABQAD@std@@YAXAAPADABQAD@Z ; std::_Construct_in_place<char *,char * const &> PUBLIC ??$_Get_size_of_n@$00@std@@YAII@Z ; std::_Get_size_of_n<1> PUBLIC ??$_Allocate@$07U_Default_allocate_traits@std@@$0A@@std@@YAPAXI@Z ; std::_Allocate<8,std::_Default_allocate_traits,0> PUBLIC ??$_Deallocate@$07$0A@@std@@YAXPAXI@Z ; std::_Deallocate<8,0> PUBLIC ??$addressof@V?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@YAPAV?$_String_val@U?$_Simple_types@D@std@@@0@AAV10@@Z ; std::addressof<std::_String_val<std::_Simple_types<char> > > PUBLIC ??$addressof@$$CBV?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@YAPBV?$_String_val@U?$_Simple_types@D@std@@@0@ABV10@@Z ; std::addressof<std::_String_val<std::_Simple_types<char> > const > PUBLIC ??$_Immortalize_impl@V_Iostream_error_category@std@@@std@@YGHPAX0PAPAX@Z ; std::_Immortalize_impl<std::_Iostream_error_category> PUBLIC ??0_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::_Sentry_base PUBLIC ??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::~_Sentry_base PUBLIC ??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ; std::basic_ostream<char,std::char_traits<char> >::sentry::sentry PUBLIC ??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ; std::basic_ostream<char,std::char_traits<char> >::sentry::~sentry PUBLIC ??Bsentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QBE_NXZ ; std::basic_ostream<char,std::char_traits<char> >::sentry::operator bool PUBLIC ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ ; std::basic_streambuf<char,std::char_traits<char> >::pubsync PUBLIC ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z ; std::basic_streambuf<char,std::char_traits<char> >::sputc PUBLIC ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z ; std::basic_streambuf<char,std::char_traits<char> >::sputn PUBLIC ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ ; std::basic_streambuf<char,std::char_traits<char> >::_Pninc PUBLIC ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBE_JXZ ; std::basic_streambuf<char,std::char_traits<char> >::_Pnavail PUBLIC ??$forward@V?$allocator@D@std@@@std@@YA$$QAV?$allocator@D@0@AAV10@@Z ; std::forward<std::allocator<char> > PUBLIC ??$addressof@PAD@std@@YAPAPADAAPAD@Z ; std::addressof<char *> PUBLIC ??$forward@ABQAD@std@@YAABQADABQAD@Z ; std::forward<char * const &> PUBLIC ??$_Allocate_manually_vector_aligned@U_Default_allocate_traits@std@@@std@@YAPAXI@Z ; std::_Allocate_manually_vector_aligned<std::_Default_allocate_traits> PUBLIC ??_7exception@std@@6B@ ; std::exception::`vftable' PUBLIC ??_C@_0BC@EOODALEL@Unknown?5exception@ ; `string' PUBLIC ??_7bad_alloc@std@@6B@ ; std::bad_alloc::`vftable' PUBLIC ??_7bad_array_new_length@std@@6B@ ; std::bad_array_new_length::`vftable' PUBLIC ??_C@_0BF@KINCDENJ@bad?5array?5new?5length@ ; `string' PUBLIC __TI3?AVbad_array_new_length@std@@ PUBLIC __CTA3?AVbad_array_new_length@std@@ PUBLIC ??_R0?AVbad_array_new_length@std@@@8 ; std::bad_array_new_length `RTTI Type Descriptor' PUBLIC __CT??_R0?AVbad_array_new_length@std@@@8??0bad_array_new_length@std@@QAE@ABV01@@Z12 PUBLIC ??_R0?AVbad_alloc@std@@@8 ; std::bad_alloc `RTTI Type Descriptor' PUBLIC __CT??_R0?AVbad_alloc@std@@@8??0bad_alloc@std@@QAE@ABV01@@Z12 PUBLIC ??_R0?AVexception@std@@@8 ; std::exception `RTTI Type Descriptor' PUBLIC __CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12 PUBLIC ??_7runtime_error@std@@6B@ ; std::runtime_error::`vftable' PUBLIC ??_R0?AVruntime_error@std@@@8 ; std::runtime_error `RTTI Type Descriptor' PUBLIC __CT??_R0?AVruntime_error@std@@@8??0runtime_error@std@@QAE@ABV01@@Z12 PUBLIC ??_7_System_error@std@@6B@ ; std::_System_error::`vftable' PUBLIC ??_C@_02LMMGGCAJ@?3?5@ ; `string' PUBLIC ??_7system_error@std@@6B@ ; std::system_error::`vftable' PUBLIC ??_R0?AVsystem_error@std@@@8 ; std::system_error `RTTI Type Descriptor' PUBLIC __CT??_R0?AVsystem_error@std@@@8??0system_error@std@@QAE@ABV01@@Z20 PUBLIC ??_R0?AV_System_error@std@@@8 ; std::_System_error `RTTI Type Descriptor' PUBLIC __CT??_R0?AV_System_error@std@@@8??0_System_error@std@@QAE@ABV01@@Z20 PUBLIC ??_7_Generic_error_category@std@@6B@ ; std::_Generic_error_category::`vftable' PUBLIC ??_C@_07DCLBNMLN@generic@ ; `string' PUBLIC ??_7_Iostream_error_category@std@@6B@ ; std::_Iostream_error_category::`vftable' PUBLIC ??_C@_08LLGCOLLL@iostream@ ; `string' PUBLIC ??_C@_0BG@PADBLCHM@iostream?5stream?5error@ ; `string' PUBLIC ??_7failure@ios_base@std@@6B@ ; std::ios_base::failure::`vftable' PUBLIC ??_C@_0BF@PHHKMMFD@ios_base?3?3badbit?5set@ ; `string' PUBLIC ??_C@_0BG@FMKFHCIL@ios_base?3?3failbit?5set@ ; `string' PUBLIC ??_C@_0BF@OOHOMBOF@ios_base?3?3eofbit?5set@ ; `string' PUBLIC __TI5?AVfailure@ios_base@std@@ PUBLIC __CTA5?AVfailure@ios_base@std@@ PUBLIC ??_R0?AVfailure@ios_base@std@@@8 ; std::ios_base::failure `RTTI Type Descriptor' PUBLIC __CT??_R0?AVfailure@ios_base@std@@@8??0failure@ios_base@std@@QAE@ABV012@@Z20 PUBLIC ?_Flag@?1???$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@1@XZ@4PAXA ; `std::_Immortalize<std::_Iostream_error_category>'::`2'::_Flag PUBLIC ?_Storage@?1???$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@1@XZ@4T?$_Align_type@H$07@1@A ; `std::_Immortalize<std::_Iostream_error_category>'::`2'::_Storage PUBLIC ??_C@_0BA@JFNIOLAK@string?5too?5long@ ; `string' PUBLIC ??_R4exception@std@@6B@ ; std::exception::`RTTI Complete Object Locator' PUBLIC ??_R3exception@std@@8 ; std::exception::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2exception@std@@8 ; std::exception::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@exception@std@@8 ; std::exception::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC ??_R4bad_alloc@std@@6B@ ; std::bad_alloc::`RTTI Complete Object Locator' PUBLIC ??_R3bad_alloc@std@@8 ; std::bad_alloc::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2bad_alloc@std@@8 ; std::bad_alloc::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@bad_alloc@std@@8 ; std::bad_alloc::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC ??_R4bad_array_new_length@std@@6B@ ; std::bad_array_new_length::`RTTI Complete Object Locator' PUBLIC ??_R3bad_array_new_length@std@@8 ; std::bad_array_new_length::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2bad_array_new_length@std@@8 ; std::bad_array_new_length::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@bad_array_new_length@std@@8 ; std::bad_array_new_length::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC ??_R4runtime_error@std@@6B@ ; std::runtime_error::`RTTI Complete Object Locator' PUBLIC ??_R3runtime_error@std@@8 ; std::runtime_error::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2runtime_error@std@@8 ; std::runtime_error::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@runtime_error@std@@8 ; std::runtime_error::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC ??_R0?AVerror_category@std@@@8 ; std::error_category `RTTI Type Descriptor' PUBLIC ??_R3error_category@std@@8 ; std::error_category::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2error_category@std@@8 ; std::error_category::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@error_category@std@@8 ; std::error_category::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC ??_R4_System_error@std@@6B@ ; std::_System_error::`RTTI Complete Object Locator' PUBLIC ??_R3_System_error@std@@8 ; std::_System_error::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2_System_error@std@@8 ; std::_System_error::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@_System_error@std@@8 ; std::_System_error::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC ??_R4system_error@std@@6B@ ; std::system_error::`RTTI Complete Object Locator' PUBLIC ??_R3system_error@std@@8 ; std::system_error::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2system_error@std@@8 ; std::system_error::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@system_error@std@@8 ; std::system_error::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC ??_R4_Generic_error_category@std@@6B@ ; std::_Generic_error_category::`RTTI Complete Object Locator' PUBLIC ??_R0?AV_Generic_error_category@std@@@8 ; std::_Generic_error_category `RTTI Type Descriptor' PUBLIC ??_R3_Generic_error_category@std@@8 ; std::_Generic_error_category::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2_Generic_error_category@std@@8 ; std::_Generic_error_category::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@_Generic_error_category@std@@8 ; std::_Generic_error_category::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC ??_R4_Iostream_error_category@std@@6B@ ; std::_Iostream_error_category::`RTTI Complete Object Locator' PUBLIC ??_R0?AV_Iostream_error_category@std@@@8 ; std::_Iostream_error_category `RTTI Type Descriptor' PUBLIC ??_R3_Iostream_error_category@std@@8 ; std::_Iostream_error_category::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2_Iostream_error_category@std@@8 ; std::_Iostream_error_category::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@_Iostream_error_category@std@@8 ; std::_Iostream_error_category::`RTTI Base Class Descriptor at (0,-1,0,64)' PUBLIC ??_R4failure@ios_base@std@@6B@ ; std::ios_base::failure::`RTTI Complete Object Locator' PUBLIC ??_R3failure@ios_base@std@@8 ; std::ios_base::failure::`RTTI Class Hierarchy Descriptor' PUBLIC ??_R2failure@ios_base@std@@8 ; std::ios_base::failure::`RTTI Base Class Array' PUBLIC ??_R1A@?0A@EA@failure@ios_base@std@@8 ; std::ios_base::failure::`RTTI Base Class Descriptor at (0,-1,0,64)' EXTRN ??2@YAPAXI@Z:PROC ; operator new EXTRN ??3@YAXPAXI@Z:PROC ; operator delete EXTRN __invalid_parameter_noinfo_noreturn:PROC EXTRN ?uncaught_exception@std@@YA_NXZ:PROC ; std::uncaught_exception EXTRN _terminate:PROC EXTRN ___std_exception_copy:PROC EXTRN ___std_exception_destroy:PROC EXTRN ??_Eexception@std@@UAEPAXI@Z:PROC ; std::exception::`vector deleting destructor' EXTRN ??_Ebad_alloc@std@@UAEPAXI@Z:PROC ; std::bad_alloc::`vector deleting destructor' EXTRN ??_Ebad_array_new_length@std@@UAEPAXI@Z:PROC ; std::bad_array_new_length::`vector deleting destructor' EXTRN _memcpy:PROC EXTRN _memmove:PROC EXTRN _strlen:PROC EXTRN ?_Xlength_error@std@@YAXPBD@Z:PROC ; std::_Xlength_error EXTRN ??_Eruntime_error@std@@UAEPAXI@Z:PROC ; std::runtime_error::`vector deleting destructor' EXTRN ?_Execute_once@std@@YAHAAUonce_flag@1@P6GHPAX1PAPAX@Z1@Z:PROC ; std::_Execute_once EXTRN ??_E_System_error@std@@UAEPAXI@Z:PROC ; std::_System_error::`vector deleting destructor' EXTRN ??_Esystem_error@std@@UAEPAXI@Z:PROC ; std::system_error::`vector deleting destructor' EXTRN ?_Syserror_map@std@@YAPBDH@Z:PROC ; std::_Syserror_map EXTRN ??_E_Generic_error_category@std@@UAEPAXI@Z:PROC ; std::_Generic_error_category::`vector deleting destructor' EXTRN ??_E_Iostream_error_category@std@@UAEPAXI@Z:PROC ; std::_Iostream_error_category::`vector deleting destructor' EXTRN ??_Efailure@ios_base@std@@UAEPAXI@Z:PROC ; std::ios_base::failure::`vector deleting destructor' EXTRN @__security_check_cookie@4:PROC EXTRN __CxxThrowException@8:PROC EXTRN ___CxxFrameHandler3:PROC EXTRN ??_7type_info@@6B@:QWORD ; type_info::`vftable' EXTRN ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A:BYTE ; std::cout EXTRN ___security_cookie:DWORD ; COMDAT ?_Flag@?1???$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@1@XZ@4PAXA _BSS SEGMENT ?_Flag@?1???$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@1@XZ@4PAXA DD 01H DUP (?) ; `std::_Immortalize<std::_Iostream_error_category>'::`2'::_Flag _BSS ENDS ; COMDAT ?_Storage@?1???$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@1@XZ@4T?$_Align_type@H$07@1@A _BSS SEGMENT ?_Storage@?1???$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@1@XZ@4T?$_Align_type@H$07@1@A DQ 01H DUP (?) ; `std::_Immortalize<std::_Iostream_error_category>'::`2'::_Storage _BSS ENDS ; COMDAT ??_R1A@?0A@EA@failure@ios_base@std@@8 rdata$r SEGMENT ??_R1A@?0A@EA@failure@ios_base@std@@8 DD FLAT:??_R0?AVfailure@ios_base@std@@@8 ; std::ios_base::failure::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 04H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3failure@ios_base@std@@8 rdata$r ENDS ; COMDAT ??_R2failure@ios_base@std@@8 rdata$r SEGMENT ??_R2failure@ios_base@std@@8 DD FLAT:??_R1A@?0A@EA@failure@ios_base@std@@8 ; std::ios_base::failure::`RTTI Base Class Array' DD FLAT:??_R1A@?0A@EA@system_error@std@@8 DD FLAT:??_R1A@?0A@EA@_System_error@std@@8 DD FLAT:??_R1A@?0A@EA@runtime_error@std@@8 DD FLAT:??_R1A@?0A@EA@exception@std@@8 rdata$r ENDS ; COMDAT ??_R3failure@ios_base@std@@8 rdata$r SEGMENT ??_R3failure@ios_base@std@@8 DD 00H ; std::ios_base::failure::`RTTI Class Hierarchy Descriptor' DD 00H DD 05H DD FLAT:??_R2failure@ios_base@std@@8 rdata$r ENDS ; COMDAT ??_R4failure@ios_base@std@@6B@ rdata$r SEGMENT ??_R4failure@ios_base@std@@6B@ DD 00H ; std::ios_base::failure::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AVfailure@ios_base@std@@@8 DD FLAT:??_R3failure@ios_base@std@@8 rdata$r ENDS ; COMDAT ??_R1A@?0A@EA@_Iostream_error_category@std@@8 rdata$r SEGMENT ??_R1A@?0A@EA@_Iostream_error_category@std@@8 DD FLAT:??_R0?AV_Iostream_error_category@std@@@8 ; std::_Iostream_error_category::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 02H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3_Iostream_error_category@std@@8 rdata$r ENDS ; COMDAT ??_R2_Iostream_error_category@std@@8 rdata$r SEGMENT ??_R2_Iostream_error_category@std@@8 DD FLAT:??_R1A@?0A@EA@_Iostream_error_category@std@@8 ; std::_Iostream_error_category::`RTTI Base Class Array' DD FLAT:??_R1A@?0A@EA@_Generic_error_category@std@@8 DD FLAT:??_R1A@?0A@EA@error_category@std@@8 rdata$r ENDS ; COMDAT ??_R3_Iostream_error_category@std@@8 rdata$r SEGMENT ??_R3_Iostream_error_category@std@@8 DD 00H ; std::_Iostream_error_category::`RTTI Class Hierarchy Descriptor' DD 00H DD 03H DD FLAT:??_R2_Iostream_error_category@std@@8 rdata$r ENDS ; COMDAT ??_R0?AV_Iostream_error_category@std@@@8 data$r SEGMENT ??_R0?AV_Iostream_error_category@std@@@8 DD FLAT:??_7type_info@@6B@ ; std::_Iostream_error_category `RTTI Type Descriptor' DD 00H DB '.?AV_Iostream_error_category@std@@', 00H data$r ENDS ; COMDAT ??_R4_Iostream_error_category@std@@6B@ rdata$r SEGMENT ??_R4_Iostream_error_category@std@@6B@ DD 00H ; std::_Iostream_error_category::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AV_Iostream_error_category@std@@@8 DD FLAT:??_R3_Iostream_error_category@std@@8 rdata$r ENDS ; COMDAT ??_R1A@?0A@EA@_Generic_error_category@std@@8 rdata$r SEGMENT ??_R1A@?0A@EA@_Generic_error_category@std@@8 DD FLAT:??_R0?AV_Generic_error_category@std@@@8 ; std::_Generic_error_category::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 01H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3_Generic_error_category@std@@8 rdata$r ENDS ; COMDAT ??_R2_Generic_error_category@std@@8 rdata$r SEGMENT ??_R2_Generic_error_category@std@@8 DD FLAT:??_R1A@?0A@EA@_Generic_error_category@std@@8 ; std::_Generic_error_category::`RTTI Base Class Array' DD FLAT:??_R1A@?0A@EA@error_category@std@@8 rdata$r ENDS ; COMDAT ??_R3_Generic_error_category@std@@8 rdata$r SEGMENT ??_R3_Generic_error_category@std@@8 DD 00H ; std::_Generic_error_category::`RTTI Class Hierarchy Descriptor' DD 00H DD 02H DD FLAT:??_R2_Generic_error_category@std@@8 rdata$r ENDS ; COMDAT ??_R0?AV_Generic_error_category@std@@@8 data$r SEGMENT ??_R0?AV_Generic_error_category@std@@@8 DD FLAT:??_7type_info@@6B@ ; std::_Generic_error_category `RTTI Type Descriptor' DD 00H DB '.?AV_Generic_error_category@std@@', 00H data$r ENDS ; COMDAT ??_R4_Generic_error_category@std@@6B@ rdata$r SEGMENT ??_R4_Generic_error_category@std@@6B@ DD 00H ; std::_Generic_error_category::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AV_Generic_error_category@std@@@8 DD FLAT:??_R3_Generic_error_category@std@@8 rdata$r ENDS ; COMDAT ??_R1A@?0A@EA@system_error@std@@8 rdata$r SEGMENT ??_R1A@?0A@EA@system_error@std@@8 DD FLAT:??_R0?AVsystem_error@std@@@8 ; std::system_error::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 03H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3system_error@std@@8 rdata$r ENDS ; COMDAT ??_R2system_error@std@@8 rdata$r SEGMENT ??_R2system_error@std@@8 DD FLAT:??_R1A@?0A@EA@system_error@std@@8 ; std::system_error::`RTTI Base Class Array' DD FLAT:??_R1A@?0A@EA@_System_error@std@@8 DD FLAT:??_R1A@?0A@EA@runtime_error@std@@8 DD FLAT:??_R1A@?0A@EA@exception@std@@8 rdata$r ENDS ; COMDAT ??_R3system_error@std@@8 rdata$r SEGMENT ??_R3system_error@std@@8 DD 00H ; std::system_error::`RTTI Class Hierarchy Descriptor' DD 00H DD 04H DD FLAT:??_R2system_error@std@@8 rdata$r ENDS ; COMDAT ??_R4system_error@std@@6B@ rdata$r SEGMENT ??_R4system_error@std@@6B@ DD 00H ; std::system_error::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AVsystem_error@std@@@8 DD FLAT:??_R3system_error@std@@8 rdata$r ENDS ; COMDAT ??_R1A@?0A@EA@_System_error@std@@8 rdata$r SEGMENT ??_R1A@?0A@EA@_System_error@std@@8 DD FLAT:??_R0?AV_System_error@std@@@8 ; std::_System_error::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 02H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3_System_error@std@@8 rdata$r ENDS ; COMDAT ??_R2_System_error@std@@8 rdata$r SEGMENT ??_R2_System_error@std@@8 DD FLAT:??_R1A@?0A@EA@_System_error@std@@8 ; std::_System_error::`RTTI Base Class Array' DD FLAT:??_R1A@?0A@EA@runtime_error@std@@8 DD FLAT:??_R1A@?0A@EA@exception@std@@8 rdata$r ENDS ; COMDAT ??_R3_System_error@std@@8 rdata$r SEGMENT ??_R3_System_error@std@@8 DD 00H ; std::_System_error::`RTTI Class Hierarchy Descriptor' DD 00H DD 03H DD FLAT:??_R2_System_error@std@@8 rdata$r ENDS ; COMDAT ??_R4_System_error@std@@6B@ rdata$r SEGMENT ??_R4_System_error@std@@6B@ DD 00H ; std::_System_error::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AV_System_error@std@@@8 DD FLAT:??_R3_System_error@std@@8 rdata$r ENDS ; COMDAT ??_R1A@?0A@EA@error_category@std@@8 rdata$r SEGMENT ??_R1A@?0A@EA@error_category@std@@8 DD FLAT:??_R0?AVerror_category@std@@@8 ; std::error_category::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 00H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3error_category@std@@8 rdata$r ENDS ; COMDAT ??_R2error_category@std@@8 rdata$r SEGMENT ??_R2error_category@std@@8 DD FLAT:??_R1A@?0A@EA@error_category@std@@8 ; std::error_category::`RTTI Base Class Array' rdata$r ENDS ; COMDAT ??_R3error_category@std@@8 rdata$r SEGMENT ??_R3error_category@std@@8 DD 00H ; std::error_category::`RTTI Class Hierarchy Descriptor' DD 00H DD 01H DD FLAT:??_R2error_category@std@@8 rdata$r ENDS ; COMDAT ??_R0?AVerror_category@std@@@8 data$r SEGMENT ??_R0?AVerror_category@std@@@8 DD FLAT:??_7type_info@@6B@ ; std::error_category `RTTI Type Descriptor' DD 00H DB '.?AVerror_category@std@@', 00H data$r ENDS ; COMDAT ??_R1A@?0A@EA@runtime_error@std@@8 rdata$r SEGMENT ??_R1A@?0A@EA@runtime_error@std@@8 DD FLAT:??_R0?AVruntime_error@std@@@8 ; std::runtime_error::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 01H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3runtime_error@std@@8 rdata$r ENDS ; COMDAT ??_R2runtime_error@std@@8 rdata$r SEGMENT ??_R2runtime_error@std@@8 DD FLAT:??_R1A@?0A@EA@runtime_error@std@@8 ; std::runtime_error::`RTTI Base Class Array' DD FLAT:??_R1A@?0A@EA@exception@std@@8 rdata$r ENDS ; COMDAT ??_R3runtime_error@std@@8 rdata$r SEGMENT ??_R3runtime_error@std@@8 DD 00H ; std::runtime_error::`RTTI Class Hierarchy Descriptor' DD 00H DD 02H DD FLAT:??_R2runtime_error@std@@8 rdata$r ENDS ; COMDAT ??_R4runtime_error@std@@6B@ rdata$r SEGMENT ??_R4runtime_error@std@@6B@ DD 00H ; std::runtime_error::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AVruntime_error@std@@@8 DD FLAT:??_R3runtime_error@std@@8 rdata$r ENDS ; COMDAT ??_R1A@?0A@EA@bad_array_new_length@std@@8 rdata$r SEGMENT ??_R1A@?0A@EA@bad_array_new_length@std@@8 DD FLAT:??_R0?AVbad_array_new_length@std@@@8 ; std::bad_array_new_length::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 02H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3bad_array_new_length@std@@8 rdata$r ENDS ; COMDAT ??_R2bad_array_new_length@std@@8 rdata$r SEGMENT ??_R2bad_array_new_length@std@@8 DD FLAT:??_R1A@?0A@EA@bad_array_new_length@std@@8 ; std::bad_array_new_length::`RTTI Base Class Array' DD FLAT:??_R1A@?0A@EA@bad_alloc@std@@8 DD FLAT:??_R1A@?0A@EA@exception@std@@8 rdata$r ENDS ; COMDAT ??_R3bad_array_new_length@std@@8 rdata$r SEGMENT ??_R3bad_array_new_length@std@@8 DD 00H ; std::bad_array_new_length::`RTTI Class Hierarchy Descriptor' DD 00H DD 03H DD FLAT:??_R2bad_array_new_length@std@@8 rdata$r ENDS ; COMDAT ??_R4bad_array_new_length@std@@6B@ rdata$r SEGMENT ??_R4bad_array_new_length@std@@6B@ DD 00H ; std::bad_array_new_length::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AVbad_array_new_length@std@@@8 DD FLAT:??_R3bad_array_new_length@std@@8 rdata$r ENDS ; COMDAT ??_R1A@?0A@EA@bad_alloc@std@@8 rdata$r SEGMENT ??_R1A@?0A@EA@bad_alloc@std@@8 DD FLAT:??_R0?AVbad_alloc@std@@@8 ; std::bad_alloc::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 01H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3bad_alloc@std@@8 rdata$r ENDS ; COMDAT ??_R2bad_alloc@std@@8 rdata$r SEGMENT ??_R2bad_alloc@std@@8 DD FLAT:??_R1A@?0A@EA@bad_alloc@std@@8 ; std::bad_alloc::`RTTI Base Class Array' DD FLAT:??_R1A@?0A@EA@exception@std@@8 rdata$r ENDS ; COMDAT ??_R3bad_alloc@std@@8 rdata$r SEGMENT ??_R3bad_alloc@std@@8 DD 00H ; std::bad_alloc::`RTTI Class Hierarchy Descriptor' DD 00H DD 02H DD FLAT:??_R2bad_alloc@std@@8 rdata$r ENDS ; COMDAT ??_R4bad_alloc@std@@6B@ rdata$r SEGMENT ??_R4bad_alloc@std@@6B@ DD 00H ; std::bad_alloc::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AVbad_alloc@std@@@8 DD FLAT:??_R3bad_alloc@std@@8 rdata$r ENDS ; COMDAT ??_R1A@?0A@EA@exception@std@@8 rdata$r SEGMENT ??_R1A@?0A@EA@exception@std@@8 DD FLAT:??_R0?AVexception@std@@@8 ; std::exception::`RTTI Base Class Descriptor at (0,-1,0,64)' DD 00H DD 00H DD 0ffffffffH DD 00H DD 040H DD FLAT:??_R3exception@std@@8 rdata$r ENDS ; COMDAT ??_R2exception@std@@8 rdata$r SEGMENT ??_R2exception@std@@8 DD FLAT:??_R1A@?0A@EA@exception@std@@8 ; std::exception::`RTTI Base Class Array' rdata$r ENDS ; COMDAT ??_R3exception@std@@8 rdata$r SEGMENT ??_R3exception@std@@8 DD 00H ; std::exception::`RTTI Class Hierarchy Descriptor' DD 00H DD 01H DD FLAT:??_R2exception@std@@8 rdata$r ENDS ; COMDAT ??_R4exception@std@@6B@ rdata$r SEGMENT ??_R4exception@std@@6B@ DD 00H ; std::exception::`RTTI Complete Object Locator' DD 00H DD 00H DD FLAT:??_R0?AVexception@std@@@8 DD FLAT:??_R3exception@std@@8 rdata$r ENDS ; COMDAT ??_C@_0BA@JFNIOLAK@string?5too?5long@ CONST SEGMENT ??_C@_0BA@JFNIOLAK@string?5too?5long@ DB 'string too long', 00H ; `string' CONST ENDS ; COMDAT __CT??_R0?AVfailure@ios_base@std@@@8??0failure@ios_base@std@@QAE@ABV012@@Z20 xdata$x SEGMENT __CT??_R0?AVfailure@ios_base@std@@@8??0failure@ios_base@std@@QAE@ABV012@@Z20 DD 00H DD FLAT:??_R0?AVfailure@ios_base@std@@@8 DD 00H DD 0ffffffffH ORG $+4 DD 014H DD FLAT:??0failure@ios_base@std@@QAE@ABV012@@Z xdata$x ENDS ; COMDAT ??_R0?AVfailure@ios_base@std@@@8 data$r SEGMENT ??_R0?AVfailure@ios_base@std@@@8 DD FLAT:??_7type_info@@6B@ ; std::ios_base::failure `RTTI Type Descriptor' DD 00H DB '.?AVfailure@ios_base@std@@', 00H data$r ENDS ; COMDAT __CTA5?AVfailure@ios_base@std@@ xdata$x SEGMENT __CTA5?AVfailure@ios_base@std@@ DD 05H DD FLAT:__CT??_R0?AVfailure@ios_base@std@@@8??0failure@ios_base@std@@QAE@ABV012@@Z20 DD FLAT:__CT??_R0?AVsystem_error@std@@@8??0system_error@std@@QAE@ABV01@@Z20 DD FLAT:__CT??_R0?AV_System_error@std@@@8??0_System_error@std@@QAE@ABV01@@Z20 DD FLAT:__CT??_R0?AVruntime_error@std@@@8??0runtime_error@std@@QAE@ABV01@@Z12 DD FLAT:__CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12 xdata$x ENDS ; COMDAT __TI5?AVfailure@ios_base@std@@ xdata$x SEGMENT __TI5?AVfailure@ios_base@std@@ DD 00H DD FLAT:??1failure@ios_base@std@@UAE@XZ DD 00H DD FLAT:__CTA5?AVfailure@ios_base@std@@ xdata$x ENDS ; COMDAT ??_C@_0BF@OOHOMBOF@ios_base?3?3eofbit?5set@ CONST SEGMENT ??_C@_0BF@OOHOMBOF@ios_base?3?3eofbit?5set@ DB 'ios_base::eofbit set', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0BG@FMKFHCIL@ios_base?3?3failbit?5set@ CONST SEGMENT ??_C@_0BG@FMKFHCIL@ios_base?3?3failbit?5set@ DB 'ios_base::failbit set', 00H ; `string' CONST ENDS ; COMDAT ??_C@_0BF@PHHKMMFD@ios_base?3?3badbit?5set@ CONST SEGMENT ??_C@_0BF@PHHKMMFD@ios_base?3?3badbit?5set@ DB 'ios_base::badbit set', 00H ; `string' CONST ENDS ; COMDAT ??_7failure@ios_base@std@@6B@ CONST SEGMENT ??_7failure@ios_base@std@@6B@ DD FLAT:??_R4failure@ios_base@std@@6B@ ; std::ios_base::failure::`vftable' DD FLAT:??_Efailure@ios_base@std@@UAEPAXI@Z DD FLAT:?what@exception@std@@UBEPBDXZ CONST ENDS ; COMDAT ??_C@_0BG@PADBLCHM@iostream?5stream?5error@ CONST SEGMENT ??_C@_0BG@PADBLCHM@iostream?5stream?5error@ DB 'iostream stream error', 00H ; `string' CONST ENDS ; COMDAT ??_C@_08LLGCOLLL@iostream@ CONST SEGMENT ??_C@_08LLGCOLLL@iostream@ DB 'iostream', 00H ; `string' CONST ENDS ; COMDAT ??_7_Iostream_error_category@std@@6B@ CONST SEGMENT ??_7_Iostream_error_category@std@@6B@ DD FLAT:??_R4_Iostream_error_category@std@@6B@ ; std::_Iostream_error_category::`vftable' DD FLAT:??_E_Iostream_error_category@std@@UAEPAXI@Z DD FLAT:?name@_Iostream_error_category@std@@UBEPBDXZ DD FLAT:?message@_Iostream_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z DD FLAT:?default_error_condition@error_category@std@@UBE?AVerror_condition@2@H@Z DD FLAT:?equivalent@error_category@std@@UBE_NABVerror_code@2@H@Z DD FLAT:?equivalent@error_category@std@@UBE_NHABVerror_condition@2@@Z CONST ENDS ; COMDAT ??_C@_07DCLBNMLN@generic@ CONST SEGMENT ??_C@_07DCLBNMLN@generic@ DB 'generic', 00H ; `string' CONST ENDS ; COMDAT ??_7_Generic_error_category@std@@6B@ CONST SEGMENT ??_7_Generic_error_category@std@@6B@ DD FLAT:??_R4_Generic_error_category@std@@6B@ ; std::_Generic_error_category::`vftable' DD FLAT:??_E_Generic_error_category@std@@UAEPAXI@Z DD FLAT:?name@_Generic_error_category@std@@UBEPBDXZ DD FLAT:?message@_Generic_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z DD FLAT:?default_error_condition@error_category@std@@UBE?AVerror_condition@2@H@Z DD FLAT:?equivalent@error_category@std@@UBE_NABVerror_code@2@H@Z DD FLAT:?equivalent@error_category@std@@UBE_NHABVerror_condition@2@@Z CONST ENDS ; COMDAT __CT??_R0?AV_System_error@std@@@8??0_System_error@std@@QAE@ABV01@@Z20 xdata$x SEGMENT __CT??_R0?AV_System_error@std@@@8??0_System_error@std@@QAE@ABV01@@Z20 DD 00H DD FLAT:??_R0?AV_System_error@std@@@8 DD 00H DD 0ffffffffH ORG $+4 DD 014H DD FLAT:??0_System_error@std@@QAE@ABV01@@Z xdata$x ENDS ; COMDAT ??_R0?AV_System_error@std@@@8 data$r SEGMENT ??_R0?AV_System_error@std@@@8 DD FLAT:??_7type_info@@6B@ ; std::_System_error `RTTI Type Descriptor' DD 00H DB '.?AV_System_error@std@@', 00H data$r ENDS ; COMDAT __CT??_R0?AVsystem_error@std@@@8??0system_error@std@@QAE@ABV01@@Z20 xdata$x SEGMENT __CT??_R0?AVsystem_error@std@@@8??0system_error@std@@QAE@ABV01@@Z20 DD 00H DD FLAT:??_R0?AVsystem_error@std@@@8 DD 00H DD 0ffffffffH ORG $+4 DD 014H DD FLAT:??0system_error@std@@QAE@ABV01@@Z xdata$x ENDS ; COMDAT ??_R0?AVsystem_error@std@@@8 data$r SEGMENT ??_R0?AVsystem_error@std@@@8 DD FLAT:??_7type_info@@6B@ ; std::system_error `RTTI Type Descriptor' DD 00H DB '.?AVsystem_error@std@@', 00H data$r ENDS ; COMDAT ??_7system_error@std@@6B@ CONST SEGMENT ??_7system_error@std@@6B@ DD FLAT:??_R4system_error@std@@6B@ ; std::system_error::`vftable' DD FLAT:??_Esystem_error@std@@UAEPAXI@Z DD FLAT:?what@exception@std@@UBEPBDXZ CONST ENDS ; COMDAT ??_C@_02LMMGGCAJ@?3?5@ CONST SEGMENT ??_C@_02LMMGGCAJ@?3?5@ DB ': ', 00H ; `string' CONST ENDS ; COMDAT ??_7_System_error@std@@6B@ CONST SEGMENT ??_7_System_error@std@@6B@ DD FLAT:??_R4_System_error@std@@6B@ ; std::_System_error::`vftable' DD FLAT:??_E_System_error@std@@UAEPAXI@Z DD FLAT:?what@exception@std@@UBEPBDXZ CONST ENDS ; COMDAT __CT??_R0?AVruntime_error@std@@@8??0runtime_error@std@@QAE@ABV01@@Z12 xdata$x SEGMENT __CT??_R0?AVruntime_error@std@@@8??0runtime_error@std@@QAE@ABV01@@Z12 DD 00H DD FLAT:??_R0?AVruntime_error@std@@@8 DD 00H DD 0ffffffffH ORG $+4 DD 0cH DD FLAT:??0runtime_error@std@@QAE@ABV01@@Z xdata$x ENDS ; COMDAT ??_R0?AVruntime_error@std@@@8 data$r SEGMENT ??_R0?AVruntime_error@std@@@8 DD FLAT:??_7type_info@@6B@ ; std::runtime_error `RTTI Type Descriptor' DD 00H DB '.?AVruntime_error@std@@', 00H data$r ENDS ; COMDAT ??_7runtime_error@std@@6B@ CONST SEGMENT ??_7runtime_error@std@@6B@ DD FLAT:??_R4runtime_error@std@@6B@ ; std::runtime_error::`vftable' DD FLAT:??_Eruntime_error@std@@UAEPAXI@Z DD FLAT:?what@exception@std@@UBEPBDXZ CONST ENDS ; COMDAT __CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12 xdata$x SEGMENT __CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12 DD 00H DD FLAT:??_R0?AVexception@std@@@8 DD 00H DD 0ffffffffH ORG $+4 DD 0cH DD FLAT:??0exception@std@@QAE@ABV01@@Z xdata$x ENDS ; COMDAT ??_R0?AVexception@std@@@8 data$r SEGMENT ??_R0?AVexception@std@@@8 DD FLAT:??_7type_info@@6B@ ; std::exception `RTTI Type Descriptor' DD 00H DB '.?AVexception@std@@', 00H data$r ENDS ; COMDAT __CT??_R0?AVbad_alloc@std@@@8??0bad_alloc@std@@QAE@ABV01@@Z12 xdata$x SEGMENT __CT??_R0?AVbad_alloc@std@@@8??0bad_alloc@std@@QAE@ABV01@@Z12 DD 010H DD FLAT:??_R0?AVbad_alloc@std@@@8 DD 00H DD 0ffffffffH ORG $+4 DD 0cH DD FLAT:??0bad_alloc@std@@QAE@ABV01@@Z xdata$x ENDS ; COMDAT ??_R0?AVbad_alloc@std@@@8 data$r SEGMENT ??_R0?AVbad_alloc@std@@@8 DD FLAT:??_7type_info@@6B@ ; std::bad_alloc `RTTI Type Descriptor' DD 00H DB '.?AVbad_alloc@std@@', 00H data$r ENDS ; COMDAT __CT??_R0?AVbad_array_new_length@std@@@8??0bad_array_new_length@std@@QAE@ABV01@@Z12 xdata$x SEGMENT __CT??_R0?AVbad_array_new_length@std@@@8??0bad_array_new_length@std@@QAE@ABV01@@Z12 DD 00H DD FLAT:??_R0?AVbad_array_new_length@std@@@8 DD 00H DD 0ffffffffH ORG $+4 DD 0cH DD FLAT:??0bad_array_new_length@std@@QAE@ABV01@@Z xdata$x ENDS ; COMDAT ??_R0?AVbad_array_new_length@std@@@8 data$r SEGMENT ??_R0?AVbad_array_new_length@std@@@8 DD FLAT:??_7type_info@@6B@ ; std::bad_array_new_length `RTTI Type Descriptor' DD 00H DB '.?AVbad_array_new_length@std@@', 00H data$r ENDS ; COMDAT __CTA3?AVbad_array_new_length@std@@ xdata$x SEGMENT __CTA3?AVbad_array_new_length@std@@ DD 03H DD FLAT:__CT??_R0?AVbad_array_new_length@std@@@8??0bad_array_new_length@std@@QAE@ABV01@@Z12 DD FLAT:__CT??_R0?AVbad_alloc@std@@@8??0bad_alloc@std@@QAE@ABV01@@Z12 DD FLAT:__CT??_R0?AVexception@std@@@8??0exception@std@@QAE@ABV01@@Z12 xdata$x ENDS ; COMDAT __TI3?AVbad_array_new_length@std@@ xdata$x SEGMENT __TI3?AVbad_array_new_length@std@@ DD 00H DD FLAT:??1bad_array_new_length@std@@UAE@XZ DD 00H DD FLAT:__CTA3?AVbad_array_new_length@std@@ xdata$x ENDS ; COMDAT ??_C@_0BF@KINCDENJ@bad?5array?5new?5length@ CONST SEGMENT ??_C@_0BF@KINCDENJ@bad?5array?5new?5length@ DB 'bad array new length', 00H ; `string' CONST ENDS ; COMDAT ??_7bad_array_new_length@std@@6B@ CONST SEGMENT ??_7bad_array_new_length@std@@6B@ DD FLAT:??_R4bad_array_new_length@std@@6B@ ; std::bad_array_new_length::`vftable' DD FLAT:??_Ebad_array_new_length@std@@UAEPAXI@Z DD FLAT:?what@exception@std@@UBEPBDXZ CONST ENDS ; COMDAT ??_7bad_alloc@std@@6B@ CONST SEGMENT ??_7bad_alloc@std@@6B@ DD FLAT:??_R4bad_alloc@std@@6B@ ; std::bad_alloc::`vftable' DD FLAT:??_Ebad_alloc@std@@UAEPAXI@Z DD FLAT:?what@exception@std@@UBEPBDXZ CONST ENDS ; COMDAT ??_C@_0BC@EOODALEL@Unknown?5exception@ CONST SEGMENT ??_C@_0BC@EOODALEL@Unknown?5exception@ DB 'Unknown exception', 00H ; `string' CONST ENDS ; COMDAT ??_7exception@std@@6B@ CONST SEGMENT ??_7exception@std@@6B@ DD FLAT:??_R4exception@std@@6B@ ; std::exception::`vftable' DD FLAT:??_Eexception@std@@UAEPAXI@Z DD FLAT:?what@exception@std@@UBEPBDXZ CONST ENDS ; COMDAT xdata$x xdata$x SEGMENT __catchsym$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$2 DD 00H DD 00H DD 00H DD FLAT:__catch$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$0 __unwindtable$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z DD 0ffffffffH DD 00H DD 0ffffffffH DD 00H __tryblocktable$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z DD 00H DD 00H DD 01H DD 01H DD FLAT:__catchsym$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$2 __ehfuncinfo$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z DD 019930522H DD 02H DD FLAT:__unwindtable$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z DD 01H DD FLAT:__tryblocktable$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z DD 2 DUP(00H) DD 00H DD 00H xdata$x ENDS ; COMDAT xdata$x xdata$x SEGMENT __catchsym$?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ$2 DD 00H DD 00H DD 00H DD FLAT:__catch$?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ$0 __unwindtable$?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ DD 0ffffffffH DD 00H DD 0ffffffffH DD 00H __tryblocktable$?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ DD 00H DD 00H DD 01H DD 01H DD FLAT:__catchsym$?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ$2 __ehfuncinfo$?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ DD 019930522H DD 02H DD FLAT:__unwindtable$?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ DD 01H DD FLAT:__tryblocktable$?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ DD 2 DUP(00H) DD 00H DD 00H xdata$x ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Allocate_manually_vector_aligned@U_Default_allocate_traits@std@@@std@@YAPAXI@Z _TEXT SEGMENT __Ptr$ = -12 ; size = 4 __Block_size$ = -8 ; size = 4 __Ptr_container$ = -4 ; size = 4 __Bytes$ = 8 ; size = 4 ??$_Allocate_manually_vector_aligned@U_Default_allocate_traits@std@@@std@@YAPAXI@Z PROC ; std::_Allocate_manually_vector_aligned<std::_Default_allocate_traits>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 83 push ebp mov ebp, esp sub esp, 12 ; 0000000cH ; Line 85 mov eax, DWORD PTR __Bytes$[ebp] add eax, 35 ; 00000023H mov DWORD PTR __Block_size$[ebp], eax ; Line 86 mov ecx, DWORD PTR __Block_size$[ebp] cmp ecx, DWORD PTR __Bytes$[ebp] ja SHORT $LN8@Allocate_m ; Line 87 call ?_Throw_bad_array_new_length@std@@YAXXZ ; std::_Throw_bad_array_new_length $LN8@Allocate_m: ; Line 90 mov edx, DWORD PTR __Block_size$[ebp] push edx call ?_Allocate@_Default_allocate_traits@std@@SAPAXI@Z ; std::_Default_allocate_traits::_Allocate add esp, 4 mov DWORD PTR __Ptr_container$[ebp], eax $LN4@Allocate_m: ; Line 91 cmp DWORD PTR __Ptr_container$[ebp], 0 je SHORT $LN7@Allocate_m jmp SHORT $LN2@Allocate_m $LN7@Allocate_m: call __invalid_parameter_noinfo_noreturn xor eax, eax jne SHORT $LN7@Allocate_m $LN2@Allocate_m: xor ecx, ecx jne SHORT $LN4@Allocate_m ; Line 92 mov edx, DWORD PTR __Ptr_container$[ebp] add edx, 35 ; 00000023H and edx, -32 ; ffffffe0H mov DWORD PTR __Ptr$[ebp], edx ; Line 93 mov eax, 4 imul ecx, eax, -1 mov edx, DWORD PTR __Ptr$[ebp] mov eax, DWORD PTR __Ptr_container$[ebp] mov DWORD PTR [edx+ecx], eax ; Line 98 mov eax, DWORD PTR __Ptr$[ebp] $LN11@Allocate_m: ; Line 99 mov esp, ebp pop ebp ret 0 ??$_Allocate_manually_vector_aligned@U_Default_allocate_traits@std@@@std@@YAPAXI@Z ENDP ; std::_Allocate_manually_vector_aligned<std::_Default_allocate_traits> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$forward@ABQAD@std@@YAABQADABQAD@Z _TEXT SEGMENT __Arg$ = 8 ; size = 4 ??$forward@ABQAD@std@@YAABQADABQAD@Z PROC ; std::forward<char * const &>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\type_traits ; Line 1420 push ebp mov ebp, esp ; Line 1421 mov eax, DWORD PTR __Arg$[ebp] ; Line 1422 pop ebp ret 0 ??$forward@ABQAD@std@@YAABQADABQAD@Z ENDP ; std::forward<char * const &> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$addressof@PAD@std@@YAPAPADAAPAD@Z _TEXT SEGMENT __Val$ = 8 ; size = 4 ??$addressof@PAD@std@@YAPAPADAAPAD@Z PROC ; std::addressof<char *>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstddef ; Line 279 push ebp mov ebp, esp ; Line 280 mov eax, DWORD PTR __Val$[ebp] ; Line 281 pop ebp ret 0 ??$addressof@PAD@std@@YAPAPADAAPAD@Z ENDP ; std::addressof<char *> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$forward@V?$allocator@D@std@@@std@@YA$$QAV?$allocator@D@0@AAV10@@Z _TEXT SEGMENT __Arg$ = 8 ; size = 4 ??$forward@V?$allocator@D@std@@@std@@YA$$QAV?$allocator@D@0@AAV10@@Z PROC ; std::forward<std::allocator<char> >, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\type_traits ; Line 1420 push ebp mov ebp, esp ; Line 1421 mov eax, DWORD PTR __Arg$[ebp] ; Line 1422 pop ebp ret 0 ??$forward@V?$allocator@D@std@@@std@@YA$$QAV?$allocator@D@0@AAV10@@Z ENDP ; std::forward<std::allocator<char> > _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBE_JXZ _TEXT SEGMENT tv69 = -8 ; size = 4 _this$ = -4 ; size = 4 ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBE_JXZ PROC ; std::basic_streambuf<char,std::char_traits<char> >::_Pnavail, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\streambuf ; Line 257 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 258 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax+32] cmp DWORD PTR [ecx], 0 je SHORT $LN3@Pnavail mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx+48] mov ecx, DWORD PTR [eax] mov DWORD PTR tv69[ebp], ecx jmp SHORT $LN4@Pnavail $LN3@Pnavail: mov DWORD PTR tv69[ebp], 0 $LN4@Pnavail: mov eax, DWORD PTR tv69[ebp] cdq ; Line 259 mov esp, ebp pop ebp ret 0 ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBE_JXZ ENDP ; std::basic_streambuf<char,std::char_traits<char> >::_Pnavail _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ _TEXT SEGMENT tv76 = -8 ; size = 4 _this$ = -4 ; size = 4 ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ PROC ; std::basic_streambuf<char,std::char_traits<char> >::_Pninc, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\streambuf ; Line 252 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 253 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax+48] mov edx, DWORD PTR [ecx] sub edx, 1 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax+48] mov DWORD PTR [ecx], edx ; Line 254 mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx+32] mov ecx, DWORD PTR [eax] mov DWORD PTR tv76[ebp], ecx mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx+32] mov ecx, DWORD PTR [eax] add ecx, 1 mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx+32] mov DWORD PTR [eax], ecx mov eax, DWORD PTR tv76[ebp] ; Line 255 mov esp, ebp pop ebp ret 0 ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ ENDP ; std::basic_streambuf<char,std::char_traits<char> >::_Pninc _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Ptr$ = 8 ; size = 4 __Count$ = 12 ; size = 8 ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z PROC ; std::basic_streambuf<char,std::char_traits<char> >::sputn, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\streambuf ; Line 169 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 170 mov eax, DWORD PTR __Count$[ebp+4] push eax mov ecx, DWORD PTR __Count$[ebp] push ecx mov edx, DWORD PTR __Ptr$[ebp] push edx mov eax, DWORD PTR _this$[ebp] mov edx, DWORD PTR [eax] mov ecx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx+36] call eax ; Line 171 mov esp, ebp pop ebp ret 12 ; 0000000cH ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z ENDP ; std::basic_streambuf<char,std::char_traits<char> >::sputn _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z _TEXT SEGMENT tv85 = -20 ; size = 8 tv78 = -12 ; size = 4 $T1 = -8 ; size = 4 _this$ = -4 ; size = 4 __Ch$ = 8 ; size = 1 ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z PROC ; std::basic_streambuf<char,std::char_traits<char> >::sputc, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\streambuf ; Line 164 push ebp mov ebp, esp sub esp, 20 ; 00000014H mov DWORD PTR _this$[ebp], ecx ; Line 165 mov ecx, DWORD PTR _this$[ebp] call ?_Pnavail@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IBE_JXZ ; std::basic_streambuf<char,std::char_traits<char> >::_Pnavail mov DWORD PTR tv85[ebp], eax mov DWORD PTR tv85[ebp+4], edx cmp DWORD PTR tv85[ebp+4], 0 jl SHORT $LN3@sputc jg SHORT $LN5@sputc cmp DWORD PTR tv85[ebp], 0 jbe SHORT $LN3@sputc $LN5@sputc: mov ecx, DWORD PTR _this$[ebp] call ?_Pninc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@IAEPADXZ ; std::basic_streambuf<char,std::char_traits<char> >::_Pninc mov DWORD PTR $T1[ebp], eax mov eax, DWORD PTR $T1[ebp] mov cl, BYTE PTR __Ch$[ebp] mov BYTE PTR [eax], cl mov edx, DWORD PTR $T1[ebp] push edx call ?to_int_type@?$_Narrow_char_traits@DH@std@@SAHABD@Z ; std::_Narrow_char_traits<char,int>::to_int_type add esp, 4 mov DWORD PTR tv78[ebp], eax jmp SHORT $LN4@sputc $LN3@sputc: lea eax, DWORD PTR __Ch$[ebp] push eax call ?to_int_type@?$_Narrow_char_traits@DH@std@@SAHABD@Z ; std::_Narrow_char_traits<char,int>::to_int_type add esp, 4 push eax mov ecx, DWORD PTR _this$[ebp] mov edx, DWORD PTR [ecx] mov ecx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx+12] call eax mov DWORD PTR tv78[ebp], eax $LN4@sputc: mov eax, DWORD PTR tv78[ebp] ; Line 166 mov esp, ebp pop ebp ret 4 ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z ENDP ; std::basic_streambuf<char,std::char_traits<char> >::sputc _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ PROC ; std::basic_streambuf<char,std::char_traits<char> >::pubsync, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\streambuf ; Line 120 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 121 mov eax, DWORD PTR _this$[ebp] mov edx, DWORD PTR [eax] mov ecx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx+52] call eax ; Line 122 mov esp, ebp pop ebp ret 0 ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ ENDP ; std::basic_streambuf<char,std::char_traits<char> >::pubsync _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??Bsentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QBE_NXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??Bsentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QBE_NXZ PROC ; std::basic_ostream<char,std::char_traits<char> >::sentry::operator bool, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ostream ; Line 130 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 131 mov eax, DWORD PTR _this$[ebp] mov al, BYTE PTR [eax+4] ; Line 132 mov esp, ebp pop ebp ret 0 ??Bsentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QBE_NXZ ENDP ; std::basic_ostream<char,std::char_traits<char> >::sentry::operator bool _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ PROC ; std::basic_ostream<char,std::char_traits<char> >::sentry::~sentry, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ostream ; Line 115 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 117 call ?uncaught_exception@std@@YA_NXZ ; std::uncaught_exception movzx eax, al test eax, eax jne SHORT $LN1@sentry ; Line 118 mov ecx, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [ecx] call ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ ; std::basic_ostream<char,std::char_traits<char> >::_Osfx $LN1@sentry: ; Line 123 mov ecx, DWORD PTR _this$[ebp] call ??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::~_Sentry_base mov esp, ebp pop ebp ret 0 ??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ENDP ; std::basic_ostream<char,std::char_traits<char> >::sentry::~sentry _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z _TEXT SEGMENT __Tied$ = -8 ; size = 4 _this$ = -4 ; size = 4 __Ostr$ = 8 ; size = 4 ??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z PROC ; std::basic_ostream<char,std::char_traits<char> >::sentry::sentry, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ostream ; Line 90 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 91 mov eax, DWORD PTR __Ostr$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??0_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::_Sentry_base ; Line 92 mov ecx, DWORD PTR __Ostr$[ebp] mov edx, DWORD PTR [ecx] mov ecx, DWORD PTR __Ostr$[ebp] add ecx, DWORD PTR [edx+4] call ?good@ios_base@std@@QBE_NXZ ; std::ios_base::good movzx eax, al test eax, eax jne SHORT $LN2@sentry ; Line 93 mov ecx, DWORD PTR _this$[ebp] mov BYTE PTR [ecx+4], 0 ; Line 94 jmp SHORT $LN1@sentry $LN2@sentry: ; Line 97 mov edx, DWORD PTR __Ostr$[ebp] mov eax, DWORD PTR [edx] mov ecx, DWORD PTR __Ostr$[ebp] add ecx, DWORD PTR [eax+4] call ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ ; std::basic_ios<char,std::char_traits<char> >::tie mov DWORD PTR __Tied$[ebp], eax ; Line 98 cmp DWORD PTR __Tied$[ebp], 0 je SHORT $LN4@sentry mov ecx, DWORD PTR __Tied$[ebp] cmp ecx, DWORD PTR __Ostr$[ebp] jne SHORT $LN3@sentry $LN4@sentry: ; Line 99 mov edx, DWORD PTR _this$[ebp] mov BYTE PTR [edx+4], 1 ; Line 100 jmp SHORT $LN1@sentry $LN3@sentry: ; Line 104 mov ecx, DWORD PTR __Tied$[ebp] call ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ ; std::basic_ostream<char,std::char_traits<char> >::flush ; Line 105 mov eax, DWORD PTR __Ostr$[ebp] mov ecx, DWORD PTR [eax] mov edx, DWORD PTR __Ostr$[ebp] add edx, DWORD PTR [ecx+4] mov ecx, edx call ?good@ios_base@std@@QBE_NXZ ; std::ios_base::good mov ecx, DWORD PTR _this$[ebp] mov BYTE PTR [ecx+4], al $LN1@sentry: ; Line 106 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ENDP ; std::basic_ostream<char,std::char_traits<char> >::sentry::sentry _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ _TEXT SEGMENT _this$ = -12 ; size = 4 tv72 = -8 ; size = 4 __Rdbuf$ = -4 ; size = 4 ??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ PROC ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::~_Sentry_base, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ostream ; Line 76 push ebp mov ebp, esp sub esp, 12 ; 0000000cH mov DWORD PTR _this$[ebp], ecx ; Line 77 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax] mov DWORD PTR tv72[ebp], ecx mov edx, DWORD PTR tv72[ebp] mov eax, DWORD PTR [edx] mov ecx, DWORD PTR tv72[ebp] add ecx, DWORD PTR [eax+4] call ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ ; std::basic_ios<char,std::char_traits<char> >::rdbuf mov DWORD PTR __Rdbuf$[ebp], eax ; Line 78 cmp DWORD PTR __Rdbuf$[ebp], 0 je SHORT $LN1@Sentry_bas ; Line 79 mov ecx, DWORD PTR __Rdbuf$[ebp] mov edx, DWORD PTR [ecx] mov ecx, DWORD PTR __Rdbuf$[ebp] mov eax, DWORD PTR [edx+8] call eax $LN1@Sentry_bas: ; Line 81 mov esp, ebp pop ebp ret 0 ??1_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ENDP ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::~_Sentry_base _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z _TEXT SEGMENT tv73 = -12 ; size = 4 _this$ = -8 ; size = 4 __Rdbuf$ = -4 ; size = 4 __Ostr$ = 8 ; size = 4 ??0_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z PROC ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::_Sentry_base, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ostream ; Line 69 push ebp mov ebp, esp sub esp, 12 ; 0000000cH mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR __Ostr$[ebp] mov DWORD PTR [eax], ecx ; Line 70 mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx] mov DWORD PTR tv73[ebp], eax mov ecx, DWORD PTR tv73[ebp] mov edx, DWORD PTR [ecx] mov ecx, DWORD PTR tv73[ebp] add ecx, DWORD PTR [edx+4] call ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ ; std::basic_ios<char,std::char_traits<char> >::rdbuf mov DWORD PTR __Rdbuf$[ebp], eax ; Line 71 cmp DWORD PTR __Rdbuf$[ebp], 0 je SHORT $LN1@Sentry_bas ; Line 72 mov eax, DWORD PTR __Rdbuf$[ebp] mov edx, DWORD PTR [eax] mov ecx, DWORD PTR __Rdbuf$[ebp] mov eax, DWORD PTR [edx+4] call eax $LN1@Sentry_bas: ; Line 74 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0_Sentry_base@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ENDP ; std::basic_ostream<char,std::char_traits<char> >::_Sentry_base::_Sentry_base _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Immortalize_impl@V_Iostream_error_category@std@@@std@@YGHPAX0PAPAX@Z _TEXT SEGMENT $T1 = -4 ; size = 4 ___formal$ = 8 ; size = 4 __Storage_ptr$ = 12 ; size = 4 ___formal$ = 16 ; size = 4 ??$_Immortalize_impl@V_Iostream_error_category@std@@@std@@YGHPAX0PAPAX@Z PROC ; std::_Immortalize_impl<std::_Iostream_error_category>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xcall_once.h ; Line 55 push ebp mov ebp, esp push ecx ; Line 57 mov eax, DWORD PTR __Storage_ptr$[ebp] push eax push 8 call ??2@YAPAXIPAX@Z ; operator new add esp, 8 mov DWORD PTR $T1[ebp], eax mov ecx, DWORD PTR $T1[ebp] call ??0_Iostream_error_category@std@@QAE@XZ ; std::_Iostream_error_category::_Iostream_error_category ; Line 58 mov eax, 1 ; Line 59 mov esp, ebp pop ebp ret 12 ; 0000000cH ??$_Immortalize_impl@V_Iostream_error_category@std@@@std@@YGHPAX0PAPAX@Z ENDP ; std::_Immortalize_impl<std::_Iostream_error_category> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$addressof@$$CBV?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@YAPBV?$_String_val@U?$_Simple_types@D@std@@@0@ABV10@@Z _TEXT SEGMENT __Val$ = 8 ; size = 4 ??$addressof@$$CBV?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@YAPBV?$_String_val@U?$_Simple_types@D@std@@@0@ABV10@@Z PROC ; std::addressof<std::_String_val<std::_Simple_types<char> > const >, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstddef ; Line 279 push ebp mov ebp, esp ; Line 280 mov eax, DWORD PTR __Val$[ebp] ; Line 281 pop ebp ret 0 ??$addressof@$$CBV?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@YAPBV?$_String_val@U?$_Simple_types@D@std@@@0@ABV10@@Z ENDP ; std::addressof<std::_String_val<std::_Simple_types<char> > const > _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$addressof@V?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@YAPAV?$_String_val@U?$_Simple_types@D@std@@@0@AAV10@@Z _TEXT SEGMENT __Val$ = 8 ; size = 4 ??$addressof@V?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@YAPAV?$_String_val@U?$_Simple_types@D@std@@@0@AAV10@@Z PROC ; std::addressof<std::_String_val<std::_Simple_types<char> > >, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstddef ; Line 279 push ebp mov ebp, esp ; Line 280 mov eax, DWORD PTR __Val$[ebp] ; Line 281 pop ebp ret 0 ??$addressof@V?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@YAPAV?$_String_val@U?$_Simple_types@D@std@@@0@AAV10@@Z ENDP ; std::addressof<std::_String_val<std::_Simple_types<char> > > _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Deallocate@$07$0A@@std@@YAXPAXI@Z _TEXT SEGMENT __Ptr$ = 8 ; size = 4 __Bytes$ = 12 ; size = 4 ??$_Deallocate@$07$0A@@std@@YAXPAXI@Z PROC ; std::_Deallocate<8,0>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 183 push ebp mov ebp, esp ; Line 186 cmp DWORD PTR __Bytes$[ebp], 4096 ; 00001000H jb SHORT $LN2@Deallocate ; Line 187 lea eax, DWORD PTR __Bytes$[ebp] push eax lea ecx, DWORD PTR __Ptr$[ebp] push ecx call ?_Adjust_manually_vector_aligned@std@@YAXAAPAXAAI@Z ; std::_Adjust_manually_vector_aligned add esp, 8 $LN2@Deallocate: ; Line 191 mov edx, DWORD PTR __Bytes$[ebp] push edx mov eax, DWORD PTR __Ptr$[ebp] push eax call ??3@YAXPAXI@Z ; operator delete add esp, 8 ; Line 192 pop ebp ret 0 ??$_Deallocate@$07$0A@@std@@YAXPAXI@Z ENDP ; std::_Deallocate<8,0> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Allocate@$07U_Default_allocate_traits@std@@$0A@@std@@YAPAXI@Z _TEXT SEGMENT __Bytes$ = 8 ; size = 4 ??$_Allocate@$07U_Default_allocate_traits@std@@$0A@@std@@YAPAXI@Z PROC ; std::_Allocate<8,std::_Default_allocate_traits,0>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 167 push ebp mov ebp, esp ; Line 170 cmp DWORD PTR __Bytes$[ebp], 4096 ; 00001000H jb SHORT $LN2@Allocate ; Line 171 mov eax, DWORD PTR __Bytes$[ebp] push eax call ??$_Allocate_manually_vector_aligned@U_Default_allocate_traits@std@@@std@@YAPAXI@Z ; std::_Allocate_manually_vector_aligned<std::_Default_allocate_traits> add esp, 4 jmp SHORT $LN1@Allocate $LN2@Allocate: ; Line 175 cmp DWORD PTR __Bytes$[ebp], 0 je SHORT $LN3@Allocate ; Line 176 mov ecx, DWORD PTR __Bytes$[ebp] push ecx call ?_Allocate@_Default_allocate_traits@std@@SAPAXI@Z ; std::_Default_allocate_traits::_Allocate add esp, 4 jmp SHORT $LN1@Allocate $LN3@Allocate: ; Line 179 xor eax, eax $LN1@Allocate: ; Line 180 pop ebp ret 0 ??$_Allocate@$07U_Default_allocate_traits@std@@$0A@@std@@YAPAXI@Z ENDP ; std::_Allocate<8,std::_Default_allocate_traits,0> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Get_size_of_n@$00@std@@YAII@Z _TEXT SEGMENT __Overflow_is_possible$ = -1 ; size = 1 __Count$ = 8 ; size = 4 ??$_Get_size_of_n@$00@std@@YAII@Z PROC ; std::_Get_size_of_n<1>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 24 push ebp mov ebp, esp push ecx ; Line 25 mov BYTE PTR __Overflow_is_possible$[ebp], 0 ; Line 35 mov eax, DWORD PTR __Count$[ebp] ; Line 36 mov esp, ebp pop ebp ret 0 ??$_Get_size_of_n@$00@std@@YAII@Z ENDP ; std::_Get_size_of_n<1> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Construct_in_place@PADABQAD@std@@YAXAAPADABQAD@Z _TEXT SEGMENT $T1 = -4 ; size = 4 __Obj$ = 8 ; size = 4 _<_Args_0>$ = 12 ; size = 4 ??$_Construct_in_place@PADABQAD@std@@YAXAAPADABQAD@Z PROC ; std::_Construct_in_place<char *,char * const &>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 198 push ebp mov ebp, esp push ecx ; Line 199 mov eax, DWORD PTR __Obj$[ebp] push eax call ??$addressof@PAD@std@@YAPAPADAAPAD@Z ; std::addressof<char *> add esp, 4 push eax push 4 call ??2@YAPAXIPAX@Z ; operator new add esp, 8 mov DWORD PTR $T1[ebp], eax mov ecx, DWORD PTR _<_Args_0>$[ebp] push ecx call ??$forward@ABQAD@std@@YAABQADABQAD@Z ; std::forward<char * const &> add esp, 4 mov edx, DWORD PTR $T1[ebp] mov eax, DWORD PTR [eax] mov DWORD PTR [edx], eax ; Line 201 mov esp, ebp pop ebp ret 0 ??$_Construct_in_place@PADABQAD@std@@YAXAAPADABQAD@Z ENDP ; std::_Construct_in_place<char *,char * const &> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Reallocate_grow_by@V<lambda_ab246b20b9526e2ef7792587e4298a77>@@PBDI@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV01@IV<lambda_ab246b20b9526e2ef7792587e4298a77>@@PBDI@Z _TEXT SEGMENT __Raw_new$ = -40 ; size = 4 __Al$ = -36 ; size = 4 __Old_ptr$1 = -32 ; size = 4 __Old_capacity$ = -28 ; size = 4 __New_capacity$ = -24 ; size = 4 __New_size$ = -20 ; size = 4 __New_ptr$ = -16 ; size = 4 __Old_size$ = -12 ; size = 4 _this$ = -8 ; size = 4 __My_data$ = -4 ; size = 4 __Size_increase$ = 8 ; size = 4 __Fn$ = 12 ; size = 1 _<_Args_0>$ = 16 ; size = 4 _<_Args_1>$ = 20 ; size = 4 ??$_Reallocate_grow_by@V<lambda_ab246b20b9526e2ef7792587e4298a77>@@PBDI@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV01@IV<lambda_ab246b20b9526e2ef7792587e4298a77>@@PBDI@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Reallocate_grow_by<<lambda_ab246b20b9526e2ef7792587e4298a77>,char const *,unsigned int>, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 4108 push ebp mov ebp, esp sub esp, 40 ; 00000028H mov DWORD PTR _this$[ebp], ecx ; Line 4111 mov eax, DWORD PTR _this$[ebp] mov DWORD PTR __My_data$[ebp], eax ; Line 4112 mov ecx, DWORD PTR __My_data$[ebp] mov edx, DWORD PTR [ecx+16] mov DWORD PTR __Old_size$[ebp], edx ; Line 4113 mov ecx, DWORD PTR _this$[ebp] call ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::max_size sub eax, DWORD PTR __Old_size$[ebp] cmp eax, DWORD PTR __Size_increase$[ebp] jae SHORT $LN2@Reallocate ; Line 4114 call ?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAXXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Xlen $LN2@Reallocate: ; Line 4117 mov eax, DWORD PTR __Old_size$[ebp] add eax, DWORD PTR __Size_increase$[ebp] mov DWORD PTR __New_size$[ebp], eax ; Line 4118 mov ecx, DWORD PTR __My_data$[ebp] mov edx, DWORD PTR [ecx+20] mov DWORD PTR __Old_capacity$[ebp], edx ; Line 4119 mov eax, DWORD PTR __New_size$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ?_Calculate_growth@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABEII@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Calculate_growth mov DWORD PTR __New_capacity$[ebp], eax ; Line 4120 mov ecx, DWORD PTR _this$[ebp] call ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV?$allocator@D@2@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal mov DWORD PTR __Al$[ebp], eax ; Line 4121 mov ecx, DWORD PTR __New_capacity$[ebp] add ecx, 1 push ecx mov ecx, DWORD PTR __Al$[ebp] call ?allocate@?$allocator@D@std@@QAEPADI@Z ; std::allocator<char>::allocate mov DWORD PTR __New_ptr$[ebp], eax ; Line 4122 mov ecx, DWORD PTR __My_data$[ebp] call ?_Orphan_all@_Container_base0@std@@QAEXXZ ; std::_Container_base0::_Orphan_all ; Line 4123 mov edx, DWORD PTR __My_data$[ebp] mov eax, DWORD PTR __New_size$[ebp] mov DWORD PTR [edx+16], eax ; Line 4124 mov ecx, DWORD PTR __My_data$[ebp] mov edx, DWORD PTR __New_capacity$[ebp] mov DWORD PTR [ecx+20], edx ; Line 4125 mov eax, DWORD PTR __New_ptr$[ebp] push eax call ??$_Unfancy@D@std@@YAPADPAD@Z ; std::_Unfancy<char> add esp, 4 mov DWORD PTR __Raw_new$[ebp], eax ; Line 4126 cmp DWORD PTR __Old_capacity$[ebp], 16 ; 00000010H jb SHORT $LN3@Reallocate ; Line 4127 mov ecx, DWORD PTR __My_data$[ebp] mov edx, DWORD PTR [ecx] mov DWORD PTR __Old_ptr$1[ebp], edx ; Line 4128 mov eax, DWORD PTR _<_Args_1>$[ebp] push eax mov ecx, DWORD PTR _<_Args_0>$[ebp] push ecx mov edx, DWORD PTR __Old_size$[ebp] push edx mov eax, DWORD PTR __Old_ptr$1[ebp] push eax call ??$_Unfancy@D@std@@YAPADPAD@Z ; std::_Unfancy<char> add esp, 4 push eax mov ecx, DWORD PTR __Raw_new$[ebp] push ecx lea ecx, DWORD PTR __Fn$[ebp] call ??R<lambda_ab246b20b9526e2ef7792587e4298a77>@@QBEXQADQBDI1I@Z ; <lambda_ab246b20b9526e2ef7792587e4298a77>::operator() ; Line 4129 mov edx, DWORD PTR __Old_capacity$[ebp] add edx, 1 push edx mov eax, DWORD PTR __Old_ptr$1[ebp] push eax mov ecx, DWORD PTR __Al$[ebp] call ?deallocate@?$allocator@D@std@@QAEXQADI@Z ; std::allocator<char>::deallocate ; Line 4130 mov ecx, DWORD PTR __My_data$[ebp] mov edx, DWORD PTR __New_ptr$[ebp] mov DWORD PTR [ecx], edx ; Line 4131 jmp SHORT $LN4@Reallocate $LN3@Reallocate: ; Line 4132 mov eax, DWORD PTR _<_Args_1>$[ebp] push eax mov ecx, DWORD PTR _<_Args_0>$[ebp] push ecx mov edx, DWORD PTR __Old_size$[ebp] push edx mov eax, DWORD PTR __My_data$[ebp] push eax mov ecx, DWORD PTR __Raw_new$[ebp] push ecx lea ecx, DWORD PTR __Fn$[ebp] call ??R<lambda_ab246b20b9526e2ef7792587e4298a77>@@QBEXQADQBDI1I@Z ; <lambda_ab246b20b9526e2ef7792587e4298a77>::operator() ; Line 4133 lea edx, DWORD PTR __New_ptr$[ebp] push edx mov eax, DWORD PTR __My_data$[ebp] push eax call ??$_Construct_in_place@PADABQAD@std@@YAXAAPADABQAD@Z ; std::_Construct_in_place<char *,char * const &> add esp, 8 $LN4@Reallocate: ; Line 4136 mov eax, DWORD PTR _this$[ebp] $LN5@Reallocate: ; Line 4137 mov esp, ebp pop ebp ret 16 ; 00000010H ??$_Reallocate_grow_by@V<lambda_ab246b20b9526e2ef7792587e4298a77>@@PBDI@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV01@IV<lambda_ab246b20b9526e2ef7792587e4298a77>@@PBDI@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Reallocate_grow_by<<lambda_ab246b20b9526e2ef7792587e4298a77>,char const *,unsigned int> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??R<lambda_ab246b20b9526e2ef7792587e4298a77>@@QBEXQADQBDI1I@Z _TEXT SEGMENT _this$ = -8 ; size = 4 $T1 = -1 ; size = 1 __New_ptr$ = 8 ; size = 4 __Old_ptr$ = 12 ; size = 4 __Old_size$ = 16 ; size = 4 __Ptr$ = 20 ; size = 4 __Count$ = 24 ; size = 4 ??R<lambda_ab246b20b9526e2ef7792587e4298a77>@@QBEXQADQBDI1I@Z PROC ; <lambda_ab246b20b9526e2ef7792587e4298a77>::operator(), COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2748 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 2749 mov eax, DWORD PTR __Old_size$[ebp] push eax mov ecx, DWORD PTR __Old_ptr$[ebp] push ecx mov edx, DWORD PTR __New_ptr$[ebp] push edx call ?copy@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z ; std::_Narrow_char_traits<char,int>::copy add esp, 12 ; 0000000cH ; Line 2750 mov eax, DWORD PTR __Count$[ebp] push eax mov ecx, DWORD PTR __Ptr$[ebp] push ecx mov edx, DWORD PTR __New_ptr$[ebp] add edx, DWORD PTR __Old_size$[ebp] push edx call ?copy@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z ; std::_Narrow_char_traits<char,int>::copy add esp, 12 ; 0000000cH ; Line 2751 mov BYTE PTR $T1[ebp], 0 lea eax, DWORD PTR $T1[ebp] push eax mov ecx, DWORD PTR __Old_size$[ebp] add ecx, DWORD PTR __Count$[ebp] add ecx, DWORD PTR __New_ptr$[ebp] push ecx call ?assign@?$_Narrow_char_traits@DH@std@@SAXAADABD@Z ; std::_Narrow_char_traits<char,int>::assign add esp, 8 ; Line 2752 mov esp, ebp pop ebp ret 20 ; 00000014H ??R<lambda_ab246b20b9526e2ef7792587e4298a77>@@QBEXQADQBDI1I@Z ENDP ; <lambda_ab246b20b9526e2ef7792587e4298a77>::operator() _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Reallocate_for@V<lambda_9366063389c5f42a00a5088cf24e69de>@@PBD@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV01@IV<lambda_9366063389c5f42a00a5088cf24e69de>@@PBD@Z _TEXT SEGMENT __Al$ = -20 ; size = 4 __Old_capacity$ = -16 ; size = 4 __New_capacity$ = -12 ; size = 4 __New_ptr$ = -8 ; size = 4 _this$ = -4 ; size = 4 __New_size$ = 8 ; size = 4 __Fn$ = 12 ; size = 1 _<_Args_0>$ = 16 ; size = 4 ??$_Reallocate_for@V<lambda_9366063389c5f42a00a5088cf24e69de>@@PBD@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV01@IV<lambda_9366063389c5f42a00a5088cf24e69de>@@PBD@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Reallocate_for<<lambda_9366063389c5f42a00a5088cf24e69de>,char const *>, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 4082 push ebp mov ebp, esp sub esp, 20 ; 00000014H mov DWORD PTR _this$[ebp], ecx ; Line 4085 mov ecx, DWORD PTR _this$[ebp] call ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::max_size cmp DWORD PTR __New_size$[ebp], eax jbe SHORT $LN2@Reallocate ; Line 4086 call ?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAXXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Xlen $LN2@Reallocate: ; Line 4089 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax+20] mov DWORD PTR __Old_capacity$[ebp], ecx ; Line 4090 mov edx, DWORD PTR __New_size$[ebp] push edx mov ecx, DWORD PTR _this$[ebp] call ?_Calculate_growth@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABEII@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Calculate_growth mov DWORD PTR __New_capacity$[ebp], eax ; Line 4091 mov ecx, DWORD PTR _this$[ebp] call ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV?$allocator@D@2@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal mov DWORD PTR __Al$[ebp], eax ; Line 4092 mov eax, DWORD PTR __New_capacity$[ebp] add eax, 1 push eax mov ecx, DWORD PTR __Al$[ebp] call ?allocate@?$allocator@D@std@@QAEPADI@Z ; std::allocator<char>::allocate mov DWORD PTR __New_ptr$[ebp], eax ; Line 4093 mov ecx, DWORD PTR _this$[ebp] call ?_Orphan_all@_Container_base0@std@@QAEXXZ ; std::_Container_base0::_Orphan_all ; Line 4094 mov ecx, DWORD PTR _this$[ebp] mov edx, DWORD PTR __New_size$[ebp] mov DWORD PTR [ecx+16], edx ; Line 4095 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR __New_capacity$[ebp] mov DWORD PTR [eax+20], ecx ; Line 4096 mov edx, DWORD PTR _<_Args_0>$[ebp] push edx mov eax, DWORD PTR __New_size$[ebp] push eax mov ecx, DWORD PTR __New_ptr$[ebp] push ecx call ??$_Unfancy@D@std@@YAPADPAD@Z ; std::_Unfancy<char> add esp, 4 push eax lea ecx, DWORD PTR __Fn$[ebp] call ??R<lambda_9366063389c5f42a00a5088cf24e69de>@@QBEXQADIQBD@Z ; <lambda_9366063389c5f42a00a5088cf24e69de>::operator() ; Line 4097 cmp DWORD PTR __Old_capacity$[ebp], 16 ; 00000010H jb SHORT $LN3@Reallocate ; Line 4098 mov edx, DWORD PTR __Old_capacity$[ebp] add edx, 1 push edx mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax] push ecx mov ecx, DWORD PTR __Al$[ebp] call ?deallocate@?$allocator@D@std@@QAEXQADI@Z ; std::allocator<char>::deallocate ; Line 4099 mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR __New_ptr$[ebp] mov DWORD PTR [edx], eax ; Line 4100 jmp SHORT $LN4@Reallocate $LN3@Reallocate: ; Line 4101 lea ecx, DWORD PTR __New_ptr$[ebp] push ecx mov edx, DWORD PTR _this$[ebp] push edx call ??$_Construct_in_place@PADABQAD@std@@YAXAAPADABQAD@Z ; std::_Construct_in_place<char *,char * const &> add esp, 8 $LN4@Reallocate: ; Line 4104 mov eax, DWORD PTR _this$[ebp] $LN5@Reallocate: ; Line 4105 mov esp, ebp pop ebp ret 12 ; 0000000cH ??$_Reallocate_for@V<lambda_9366063389c5f42a00a5088cf24e69de>@@PBD@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV01@IV<lambda_9366063389c5f42a00a5088cf24e69de>@@PBD@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Reallocate_for<<lambda_9366063389c5f42a00a5088cf24e69de>,char const *> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??R<lambda_9366063389c5f42a00a5088cf24e69de>@@QBEXQADIQBD@Z _TEXT SEGMENT _this$ = -8 ; size = 4 $T1 = -1 ; size = 1 __New_ptr$ = 8 ; size = 4 __Count$ = 12 ; size = 4 __Ptr$ = 16 ; size = 4 ??R<lambda_9366063389c5f42a00a5088cf24e69de>@@QBEXQADIQBD@Z PROC ; <lambda_9366063389c5f42a00a5088cf24e69de>::operator(), COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2853 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 2854 mov eax, DWORD PTR __Count$[ebp] push eax mov ecx, DWORD PTR __Ptr$[ebp] push ecx mov edx, DWORD PTR __New_ptr$[ebp] push edx call ?copy@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z ; std::_Narrow_char_traits<char,int>::copy add esp, 12 ; 0000000cH ; Line 2855 mov BYTE PTR $T1[ebp], 0 lea eax, DWORD PTR $T1[ebp] push eax mov ecx, DWORD PTR __New_ptr$[ebp] add ecx, DWORD PTR __Count$[ebp] push ecx call ?assign@?$_Narrow_char_traits@DH@std@@SAXAADABD@Z ; std::_Narrow_char_traits<char,int>::assign add esp, 8 ; Line 2856 mov esp, ebp pop ebp ret 12 ; 0000000cH ??R<lambda_9366063389c5f42a00a5088cf24e69de>@@QBEXQADIQBD@Z ENDP ; <lambda_9366063389c5f42a00a5088cf24e69de>::operator() _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Max_value@I@std@@YAABIABI0@Z _TEXT SEGMENT $T1 = -8 ; size = 4 tv65 = -4 ; size = 4 __Left$ = 8 ; size = 4 __Right$ = 12 ; size = 4 ??$_Max_value@I@std@@YAABIABI0@Z PROC ; std::_Max_value<unsigned int>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\utility ; Line 32 push ebp mov ebp, esp sub esp, 8 ; Line 33 mov eax, DWORD PTR __Left$[ebp] mov ecx, DWORD PTR __Right$[ebp] mov edx, DWORD PTR [eax] cmp edx, DWORD PTR [ecx] jae SHORT $LN3@Max_value mov eax, DWORD PTR __Right$[ebp] mov DWORD PTR tv65[ebp], eax jmp SHORT $LN4@Max_value $LN3@Max_value: mov ecx, DWORD PTR __Left$[ebp] mov DWORD PTR tv65[ebp], ecx $LN4@Max_value: mov edx, DWORD PTR tv65[ebp] mov DWORD PTR $T1[ebp], edx mov eax, DWORD PTR $T1[ebp] ; Line 34 mov esp, ebp pop ebp ret 0 ??$_Max_value@I@std@@YAABIABI0@Z ENDP ; std::_Max_value<unsigned int> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Destroy_in_place@PAD@std@@YAXAAPAD@Z _TEXT SEGMENT __Obj$ = 8 ; size = 4 ??$_Destroy_in_place@PAD@std@@YAXAAPAD@Z PROC ; std::_Destroy_in_place<char *>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 321 push ebp mov ebp, esp ; Line 323 pop ebp ret 0 ??$_Destroy_in_place@PAD@std@@YAXAAPAD@Z ENDP ; std::_Destroy_in_place<char *> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$?0$$V@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@U_Zero_then_variadic_args_t@1@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___formal$ = 8 ; size = 1 ??$?0$$V@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@U_Zero_then_variadic_args_t@1@@Z PROC ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1><>, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 1414 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??0?$allocator@D@std@@QAE@XZ ; std::allocator<char>::allocator<char> mov ecx, DWORD PTR _this$[ebp] call ??0?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ; std::_String_val<std::_Simple_types<char> >::_String_val<std::_Simple_types<char> > mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??$?0$$V@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@U_Zero_then_variadic_args_t@1@@Z ENDP ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1><> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$?0V?$allocator@D@std@@$$V@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@U_One_then_variadic_args_t@1@$$QAV?$allocator@D@1@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___formal$ = 8 ; size = 1 __Val1$ = 12 ; size = 4 ??$?0V?$allocator@D@std@@$$V@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@U_One_then_variadic_args_t@1@$$QAV?$allocator@D@1@@Z PROC ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1><std::allocator<char> >, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 1418 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR __Val1$[ebp] push eax call ??$forward@V?$allocator@D@std@@@std@@YA$$QAV?$allocator@D@0@AAV10@@Z ; std::forward<std::allocator<char> > add esp, 4 mov ecx, DWORD PTR _this$[ebp] call ??0?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ; std::_String_val<std::_Simple_types<char> >::_String_val<std::_Simple_types<char> > mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 8 ??$?0V?$allocator@D@std@@$$V@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@U_One_then_variadic_args_t@1@$$QAV?$allocator@D@1@@Z ENDP ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1><std::allocator<char> > _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$move@AAV?$allocator@D@std@@@std@@YA$$QAV?$allocator@D@0@AAV10@@Z _TEXT SEGMENT __Arg$ = 8 ; size = 4 ??$move@AAV?$allocator@D@std@@@std@@YA$$QAV?$allocator@D@0@AAV10@@Z PROC ; std::move<std::allocator<char> &>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\type_traits ; Line 1432 push ebp mov ebp, esp ; Line 1433 mov eax, DWORD PTR __Arg$[ebp] ; Line 1434 pop ebp ret 0 ??$move@AAV?$allocator@D@std@@@std@@YA$$QAV?$allocator@D@0@AAV10@@Z ENDP ; std::move<std::allocator<char> &> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Unfancy@D@std@@YAPADPAD@Z _TEXT SEGMENT __Ptr$ = 8 ; size = 4 ??$_Unfancy@D@std@@YAPADPAD@Z PROC ; std::_Unfancy<char>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstddef ; Line 293 push ebp mov ebp, esp ; Line 294 mov eax, DWORD PTR __Ptr$[ebp] ; Line 295 pop ebp ret 0 ??$_Unfancy@D@std@@YAPADPAD@Z ENDP ; std::_Unfancy<char> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Min_value@I@std@@YAABIABI0@Z _TEXT SEGMENT $T1 = -8 ; size = 4 tv65 = -4 ; size = 4 __Left$ = 8 ; size = 4 __Right$ = 12 ; size = 4 ??$_Min_value@I@std@@YAABIABI0@Z PROC ; std::_Min_value<unsigned int>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\utility ; Line 25 push ebp mov ebp, esp sub esp, 8 ; Line 26 mov eax, DWORD PTR __Right$[ebp] mov ecx, DWORD PTR __Left$[ebp] mov edx, DWORD PTR [eax] cmp edx, DWORD PTR [ecx] jae SHORT $LN3@Min_value mov eax, DWORD PTR __Right$[ebp] mov DWORD PTR tv65[ebp], eax jmp SHORT $LN4@Min_value $LN3@Min_value: mov ecx, DWORD PTR __Left$[ebp] mov DWORD PTR tv65[ebp], ecx $LN4@Min_value: mov edx, DWORD PTR tv65[ebp] mov DWORD PTR $T1[ebp], edx mov eax, DWORD PTR $T1[ebp] ; Line 27 mov esp, ebp pop ebp ret 0 ??$_Min_value@I@std@@YAABIABI0@Z ENDP ; std::_Min_value<unsigned int> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z _TEXT SEGMENT __Ok$ = -96 ; size = 8 tv390 = -88 ; size = 8 tv328 = -80 ; size = 8 tv316 = -72 ; size = 8 tv135 = -64 ; size = 8 __Count$ = -56 ; size = 8 __Pad$ = -48 ; size = 8 $T2 = -40 ; size = 4 $T3 = -36 ; size = 4 $T4 = -32 ; size = 4 $T5 = -28 ; size = 4 $T6 = -24 ; size = 4 __State$ = -20 ; size = 4 __$EHRec$ = -16 ; size = 16 __Ostr$ = 8 ; size = 4 __Val$ = 12 ; size = 4 ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z PROC ; std::operator<<<std::char_traits<char> >, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ostream ; Line 738 push ebp mov ebp, esp push -1 push __ehhandler$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z mov eax, DWORD PTR fs:0 push eax push ecx sub esp, 80 ; 00000050H push ebx push esi push edi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp+4] mov DWORD PTR fs:0, eax mov DWORD PTR __$EHRec$[ebp], esp ; Line 742 mov DWORD PTR __State$[ebp], 0 ; Line 743 mov eax, DWORD PTR __Val$[ebp] push eax call ?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z ; std::_Narrow_char_traits<char,int>::length add esp, 4 xor ecx, ecx mov DWORD PTR __Count$[ebp], eax mov DWORD PTR __Count$[ebp+4], ecx ; Line 744 mov edx, DWORD PTR __Ostr$[ebp] mov eax, DWORD PTR [edx] mov ecx, DWORD PTR __Ostr$[ebp] add ecx, DWORD PTR [eax+4] call ?width@ios_base@std@@QBE_JXZ ; std::ios_base::width mov DWORD PTR tv316[ebp], eax mov DWORD PTR tv316[ebp+4], edx cmp DWORD PTR tv316[ebp+4], 0 jl SHORT $LN17@operator jg SHORT $LN23@operator cmp DWORD PTR tv316[ebp], 0 jbe SHORT $LN17@operator $LN23@operator: mov ecx, DWORD PTR __Ostr$[ebp] mov edx, DWORD PTR [ecx] mov ecx, DWORD PTR __Ostr$[ebp] add ecx, DWORD PTR [edx+4] call ?width@ios_base@std@@QBE_JXZ ; std::ios_base::width mov DWORD PTR tv328[ebp], eax mov DWORD PTR tv328[ebp+4], edx mov eax, DWORD PTR tv328[ebp+4] cmp eax, DWORD PTR __Count$[ebp+4] jl SHORT $LN17@operator jg SHORT $LN24@operator mov ecx, DWORD PTR tv328[ebp] cmp ecx, DWORD PTR __Count$[ebp] jbe SHORT $LN17@operator $LN24@operator: mov edx, DWORD PTR __Ostr$[ebp] mov eax, DWORD PTR [edx] mov ecx, DWORD PTR __Ostr$[ebp] add ecx, DWORD PTR [eax+4] call ?width@ios_base@std@@QBE_JXZ ; std::ios_base::width sub eax, DWORD PTR __Count$[ebp] sbb edx, DWORD PTR __Count$[ebp+4] mov DWORD PTR tv135[ebp], eax mov DWORD PTR tv135[ebp+4], edx jmp SHORT $LN18@operator $LN17@operator: xorps xmm0, xmm0 movlpd QWORD PTR tv135[ebp], xmm0 $LN18@operator: mov ecx, DWORD PTR tv135[ebp] mov DWORD PTR __Pad$[ebp], ecx mov edx, DWORD PTR tv135[ebp+4] mov DWORD PTR __Pad$[ebp+4], edx ; Line 745 mov eax, DWORD PTR __Ostr$[ebp] push eax lea ecx, DWORD PTR __Ok$[ebp] call ??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ; std::basic_ostream<char,std::char_traits<char> >::sentry::sentry ; Line 747 lea ecx, DWORD PTR __Ok$[ebp] call ??Bsentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QBE_NXZ ; std::basic_ostream<char,std::char_traits<char> >::sentry::operator bool movzx ecx, al test ecx, ecx jne SHORT $LN8@operator ; Line 748 mov edx, DWORD PTR __State$[ebp] or edx, 4 mov DWORD PTR __State$[ebp], edx ; Line 749 jmp $LN9@operator $LN8@operator: ; Line 750 mov DWORD PTR __$EHRec$[ebp+12], 0 ; Line 751 mov eax, DWORD PTR __Ostr$[ebp] mov ecx, DWORD PTR [eax] mov edx, DWORD PTR __Ostr$[ebp] add edx, DWORD PTR [ecx+4] mov ecx, edx call ?flags@ios_base@std@@QBEHXZ ; std::ios_base::flags and eax, 448 ; 000001c0H cmp eax, 64 ; 00000040H je SHORT $LN11@operator ; Line 752 jmp SHORT $LN4@operator $LN2@operator: mov eax, DWORD PTR __Pad$[ebp] sub eax, 1 mov ecx, DWORD PTR __Pad$[ebp+4] sbb ecx, 0 mov DWORD PTR __Pad$[ebp], eax mov DWORD PTR __Pad$[ebp+4], ecx $LN4@operator: cmp DWORD PTR __Pad$[ebp+4], 0 jl SHORT $LN11@operator jg SHORT $LN25@operator cmp DWORD PTR __Pad$[ebp], 0 jbe SHORT $LN11@operator $LN25@operator: ; Line 753 mov edx, DWORD PTR __Ostr$[ebp] mov eax, DWORD PTR [edx] mov ecx, DWORD PTR __Ostr$[ebp] add ecx, DWORD PTR [eax+4] call ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ ; std::basic_ios<char,std::char_traits<char> >::fill movzx ecx, al push ecx mov edx, DWORD PTR __Ostr$[ebp] mov eax, DWORD PTR [edx] mov ecx, DWORD PTR __Ostr$[ebp] add ecx, DWORD PTR [eax+4] call ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ ; std::basic_ios<char,std::char_traits<char> >::rdbuf mov ecx, eax call ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z ; std::basic_streambuf<char,std::char_traits<char> >::sputc mov DWORD PTR $T6[ebp], eax call ?eof@?$_Narrow_char_traits@DH@std@@SAHXZ ; std::_Narrow_char_traits<char,int>::eof mov DWORD PTR $T5[ebp], eax lea ecx, DWORD PTR $T6[ebp] push ecx lea edx, DWORD PTR $T5[ebp] push edx call ?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z ; std::_Narrow_char_traits<char,int>::eq_int_type add esp, 8 movzx eax, al test eax, eax je SHORT $LN12@operator ; Line 754 mov ecx, DWORD PTR __State$[ebp] or ecx, 4 mov DWORD PTR __State$[ebp], ecx ; Line 755 jmp SHORT $LN11@operator $LN12@operator: ; Line 757 jmp SHORT $LN2@operator $LN11@operator: ; Line 760 cmp DWORD PTR __State$[ebp], 0 jne SHORT $LN13@operator mov edx, DWORD PTR __Count$[ebp+4] push edx mov eax, DWORD PTR __Count$[ebp] push eax mov ecx, DWORD PTR __Val$[ebp] push ecx mov edx, DWORD PTR __Ostr$[ebp] mov eax, DWORD PTR [edx] mov ecx, DWORD PTR __Ostr$[ebp] add ecx, DWORD PTR [eax+4] call ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ ; std::basic_ios<char,std::char_traits<char> >::rdbuf mov ecx, eax call ?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAE_JPBD_J@Z ; std::basic_streambuf<char,std::char_traits<char> >::sputn mov DWORD PTR tv390[ebp], eax mov DWORD PTR tv390[ebp+4], edx mov ecx, DWORD PTR tv390[ebp] cmp ecx, DWORD PTR __Count$[ebp] jne SHORT $LN26@operator mov edx, DWORD PTR tv390[ebp+4] cmp edx, DWORD PTR __Count$[ebp+4] je SHORT $LN13@operator $LN26@operator: ; Line 761 mov eax, DWORD PTR __State$[ebp] or eax, 4 mov DWORD PTR __State$[ebp], eax $LN13@operator: ; Line 764 cmp DWORD PTR __State$[ebp], 0 jne SHORT $LN14@operator ; Line 765 jmp SHORT $LN7@operator $LN5@operator: mov ecx, DWORD PTR __Pad$[ebp] sub ecx, 1 mov edx, DWORD PTR __Pad$[ebp+4] sbb edx, 0 mov DWORD PTR __Pad$[ebp], ecx mov DWORD PTR __Pad$[ebp+4], edx $LN7@operator: cmp DWORD PTR __Pad$[ebp+4], 0 jl SHORT $LN14@operator jg SHORT $LN27@operator cmp DWORD PTR __Pad$[ebp], 0 jbe SHORT $LN14@operator $LN27@operator: ; Line 766 mov eax, DWORD PTR __Ostr$[ebp] mov ecx, DWORD PTR [eax] mov edx, DWORD PTR __Ostr$[ebp] add edx, DWORD PTR [ecx+4] mov ecx, edx call ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ ; std::basic_ios<char,std::char_traits<char> >::fill movzx eax, al push eax mov ecx, DWORD PTR __Ostr$[ebp] mov edx, DWORD PTR [ecx] mov ecx, DWORD PTR __Ostr$[ebp] add ecx, DWORD PTR [edx+4] call ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ ; std::basic_ios<char,std::char_traits<char> >::rdbuf mov ecx, eax call ?sputc@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHD@Z ; std::basic_streambuf<char,std::char_traits<char> >::sputc mov DWORD PTR $T4[ebp], eax call ?eof@?$_Narrow_char_traits@DH@std@@SAHXZ ; std::_Narrow_char_traits<char,int>::eof mov DWORD PTR $T3[ebp], eax lea eax, DWORD PTR $T4[ebp] push eax lea ecx, DWORD PTR $T3[ebp] push ecx call ?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z ; std::_Narrow_char_traits<char,int>::eq_int_type add esp, 8 movzx edx, al test edx, edx je SHORT $LN15@operator ; Line 767 mov eax, DWORD PTR __State$[ebp] or eax, 4 mov DWORD PTR __State$[ebp], eax ; Line 768 jmp SHORT $LN14@operator $LN15@operator: ; Line 770 jmp SHORT $LN5@operator $LN14@operator: ; Line 773 push 0 push 0 mov ecx, DWORD PTR __Ostr$[ebp] mov edx, DWORD PTR [ecx] mov ecx, DWORD PTR __Ostr$[ebp] add ecx, DWORD PTR [edx+4] call ?width@ios_base@std@@QAE_J_J@Z ; std::ios_base::width jmp SHORT $LN19@operator __catch$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z$0: ; Line 774 push 1 push 4 mov eax, DWORD PTR __Ostr$[ebp] mov ecx, DWORD PTR [eax] mov edx, DWORD PTR __Ostr$[ebp] add edx, DWORD PTR [ecx+4] mov ecx, edx call ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z ; std::basic_ios<char,std::char_traits<char> >::setstate mov eax, $LN22@operator ret 0 $LN19@operator: mov DWORD PTR __$EHRec$[ebp+12], -1 jmp SHORT $LN9@operator $LN22@operator: mov DWORD PTR __$EHRec$[ebp+12], -1 $LN9@operator: ; Line 777 push 0 mov eax, DWORD PTR __State$[ebp] push eax mov ecx, DWORD PTR __Ostr$[ebp] mov edx, DWORD PTR [ecx] mov ecx, DWORD PTR __Ostr$[ebp] add ecx, DWORD PTR [edx+4] call ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z ; std::basic_ios<char,std::char_traits<char> >::setstate ; Line 778 mov eax, DWORD PTR __Ostr$[ebp] mov DWORD PTR $T2[ebp], eax lea ecx, DWORD PTR __Ok$[ebp] call ??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ; std::basic_ostream<char,std::char_traits<char> >::sentry::~sentry mov eax, DWORD PTR $T2[ebp] ; Line 779 mov ecx, DWORD PTR __$EHRec$[ebp+4] mov DWORD PTR fs:0, ecx pop ecx pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __ehhandler$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-100] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z jmp ___CxxFrameHandler3 text$x ENDS ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ENDP ; std::operator<<<std::char_traits<char> > ; Function compile flags: /Odtp ; COMDAT ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ _TEXT SEGMENT __Ok$1 = -16 ; size = 8 __Rdbuf$ = -8 ; size = 4 _this$ = -4 ; size = 4 ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ PROC ; std::basic_ostream<char,std::char_traits<char> >::flush, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ostream ; Line 549 push ebp mov ebp, esp sub esp, 16 ; 00000010H mov DWORD PTR _this$[ebp], ecx ; Line 550 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax] mov edx, DWORD PTR _this$[ebp] add edx, DWORD PTR [ecx+4] mov ecx, edx call ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ ; std::basic_ios<char,std::char_traits<char> >::rdbuf mov DWORD PTR __Rdbuf$[ebp], eax ; Line 551 cmp DWORD PTR __Rdbuf$[ebp], 0 je SHORT $LN2@flush ; Line 552 mov eax, DWORD PTR _this$[ebp] push eax lea ecx, DWORD PTR __Ok$1[ebp] call ??0sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@AAV12@@Z ; std::basic_ostream<char,std::char_traits<char> >::sentry::sentry ; Line 554 lea ecx, DWORD PTR __Ok$1[ebp] call ??Bsentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QBE_NXZ ; std::basic_ostream<char,std::char_traits<char> >::sentry::operator bool movzx ecx, al test ecx, ecx je SHORT $LN3@flush mov ecx, DWORD PTR __Rdbuf$[ebp] call ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ ; std::basic_streambuf<char,std::char_traits<char> >::pubsync cmp eax, -1 jne SHORT $LN3@flush ; Line 555 push 0 push 4 mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx] mov ecx, DWORD PTR _this$[ebp] add ecx, DWORD PTR [eax+4] call ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z ; std::basic_ios<char,std::char_traits<char> >::setstate $LN3@flush: ; Line 557 lea ecx, DWORD PTR __Ok$1[ebp] call ??1sentry@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAE@XZ ; std::basic_ostream<char,std::char_traits<char> >::sentry::~sentry $LN2@flush: ; Line 558 mov eax, DWORD PTR _this$[ebp] ; Line 559 mov esp, ebp pop ebp ret 0 ?flush@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV12@XZ ENDP ; std::basic_ostream<char,std::char_traits<char> >::flush _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ _TEXT SEGMENT _this$ = -20 ; size = 4 __$EHRec$ = -16 ; size = 16 ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ PROC ; std::basic_ostream<char,std::char_traits<char> >::_Osfx, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ostream ; Line 159 push ebp mov ebp, esp push -1 push __ehhandler$?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ mov eax, DWORD PTR fs:0 push eax push ecx push ecx push ebx push esi push edi mov eax, DWORD PTR ___security_cookie xor eax, ebp push eax lea eax, DWORD PTR __$EHRec$[ebp+4] mov DWORD PTR fs:0, eax mov DWORD PTR __$EHRec$[ebp], esp mov DWORD PTR _this$[ebp], ecx ; Line 160 mov DWORD PTR __$EHRec$[ebp+12], 0 ; Line 161 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax] mov edx, DWORD PTR _this$[ebp] add edx, DWORD PTR [ecx+4] mov ecx, edx call ?good@ios_base@std@@QBE_NXZ ; std::ios_base::good movzx eax, al test eax, eax je SHORT $LN3@Osfx mov ecx, DWORD PTR _this$[ebp] mov edx, DWORD PTR [ecx] mov ecx, DWORD PTR _this$[ebp] add ecx, DWORD PTR [edx+4] call ?flags@ios_base@std@@QBEHXZ ; std::ios_base::flags and eax, 2 je SHORT $LN3@Osfx ; Line 162 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax] mov edx, DWORD PTR _this$[ebp] add edx, DWORD PTR [ecx+4] mov ecx, edx call ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ ; std::basic_ios<char,std::char_traits<char> >::rdbuf mov ecx, eax call ?pubsync@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHXZ ; std::basic_streambuf<char,std::char_traits<char> >::pubsync cmp eax, -1 jne SHORT $LN3@Osfx ; Line 163 push 0 push 4 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax] mov edx, DWORD PTR _this$[ebp] add edx, DWORD PTR [ecx+4] mov ecx, edx call ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z ; std::basic_ios<char,std::char_traits<char> >::setstate $LN3@Osfx: jmp SHORT $LN6@Osfx __catch$?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ$0: ; Line 167 mov eax, $LN9@Osfx ret 0 $LN6@Osfx: mov DWORD PTR __$EHRec$[ebp+12], -1 jmp SHORT $LN1@Osfx $LN9@Osfx: mov DWORD PTR __$EHRec$[ebp+12], -1 $LN1@Osfx: ; Line 168 mov ecx, DWORD PTR __$EHRec$[ebp+4] mov DWORD PTR fs:0, ecx pop ecx pop edi pop esi pop ebx mov esp, ebp pop ebp ret 0 _TEXT ENDS ; COMDAT text$x text$x SEGMENT __ehhandler$?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ: mov edx, DWORD PTR [esp+8] lea eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx-24] xor ecx, eax call @__security_check_cookie@4 mov eax, OFFSET __ehfuncinfo$?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ jmp ___CxxFrameHandler3 text$x ENDS ?_Osfx@?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEXXZ ENDP ; std::basic_ostream<char,std::char_traits<char> >::_Osfx ; Function compile flags: /Odtp ; COMDAT ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ PROC ; std::basic_ios<char,std::char_traits<char> >::fill, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ios ; Line 96 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 97 mov eax, DWORD PTR _this$[ebp] mov al, BYTE PTR [eax+64] ; Line 98 mov esp, ebp pop ebp ret 0 ?fill@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEDXZ ENDP ; std::basic_ios<char,std::char_traits<char> >::fill _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ PROC ; std::basic_ios<char,std::char_traits<char> >::rdbuf, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ios ; Line 75 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 76 mov eax, DWORD PTR _this$[ebp] mov eax, DWORD PTR [eax+56] ; Line 77 mov esp, ebp pop ebp ret 0 ?rdbuf@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_streambuf@DU?$char_traits@D@std@@@2@XZ ENDP ; std::basic_ios<char,std::char_traits<char> >::rdbuf _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ PROC ; std::basic_ios<char,std::char_traits<char> >::tie, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ios ; Line 65 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 66 mov eax, DWORD PTR _this$[ebp] mov eax, DWORD PTR [eax+60] ; Line 67 mov esp, ebp pop ebp ret 0 ?tie@?$basic_ios@DU?$char_traits@D@std@@@std@@QBEPAV?$basic_ostream@DU?$char_traits@D@std@@@2@XZ ENDP ; std::basic_ios<char,std::char_traits<char> >::tie _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __State$ = 8 ; size = 4 __Reraise$ = 12 ; size = 1 ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z PROC ; std::basic_ios<char,std::char_traits<char> >::setstate, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ios ; Line 48 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 49 movzx eax, BYTE PTR __Reraise$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ?rdstate@ios_base@std@@QBEHXZ ; std::ios_base::rdstate or eax, DWORD PTR __State$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z ; std::basic_ios<char,std::char_traits<char> >::clear ; Line 50 mov esp, ebp pop ebp ret 8 ?setstate@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z ENDP ; std::basic_ios<char,std::char_traits<char> >::setstate _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z _TEXT SEGMENT _this$ = -8 ; size = 4 tv72 = -4 ; size = 4 __State$ = 8 ; size = 4 __Reraise$ = 12 ; size = 1 ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z PROC ; std::basic_ios<char,std::char_traits<char> >::clear, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\ios ; Line 36 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 38 mov eax, DWORD PTR _this$[ebp] cmp DWORD PTR [eax+56], 0 je SHORT $LN3@clear mov DWORD PTR tv72[ebp], 0 jmp SHORT $LN4@clear $LN3@clear: mov DWORD PTR tv72[ebp], 4 $LN4@clear: movzx ecx, BYTE PTR __Reraise$[ebp] push ecx mov edx, DWORD PTR __State$[ebp] or edx, DWORD PTR tv72[ebp] push edx mov ecx, DWORD PTR _this$[ebp] call ?clear@ios_base@std@@QAEXH_N@Z ; std::ios_base::clear ; Line 39 mov esp, ebp pop ebp ret 8 ?clear@?$basic_ios@DU?$char_traits@D@std@@@std@@QAEXH_N@Z ENDP ; std::basic_ios<char,std::char_traits<char> >::clear _TEXT ENDS ; Function compile flags: /Odtp _TEXT SEGMENT _main PROC ; File C:\Users\libit\source\repos\L008A\L008A\L008A.cpp ; Line 12 push ebp mov ebp, esp ; Line 13 push OFFSET $SG29959 push OFFSET ?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A ; std::cout call ??$?6U?$char_traits@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z ; std::operator<<<std::char_traits<char> > add esp, 8 ; Line 14 call ?f@@YAXXZ ; f ; Line 15 xor eax, eax pop ebp ret 0 _main ENDP _TEXT ENDS ; Function compile flags: /Odtp _TEXT SEGMENT ?f@@YAXXZ PROC ; f ; File C:\Users\libit\source\repos\L008A\L008A\L008A.cpp ; Line 7 push ebp mov ebp, esp ; Line 9 pop ebp ret 0 ?f@@YAXXZ ENDP ; f _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?width@ios_base@std@@QAE_J_J@Z _TEXT SEGMENT __Oldwidth$ = -12 ; size = 8 _this$ = -4 ; size = 4 __Newwidth$ = 8 ; size = 8 ?width@ios_base@std@@QAE_J_J@Z PROC ; std::ios_base::width, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xiosbase ; Line 366 push ebp mov ebp, esp sub esp, 12 ; 0000000cH mov DWORD PTR _this$[ebp], ecx ; Line 367 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax+32] mov DWORD PTR __Oldwidth$[ebp], ecx mov edx, DWORD PTR [eax+36] mov DWORD PTR __Oldwidth$[ebp+4], edx ; Line 368 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR __Newwidth$[ebp] mov DWORD PTR [eax+32], ecx mov edx, DWORD PTR __Newwidth$[ebp+4] mov DWORD PTR [eax+36], edx ; Line 369 mov eax, DWORD PTR __Oldwidth$[ebp] mov edx, DWORD PTR __Oldwidth$[ebp+4] ; Line 370 mov esp, ebp pop ebp ret 8 ?width@ios_base@std@@QAE_J_J@Z ENDP ; std::ios_base::width _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?width@ios_base@std@@QBE_JXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?width@ios_base@std@@QBE_JXZ PROC ; std::ios_base::width, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xiosbase ; Line 362 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 363 mov ecx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [ecx+32] mov edx, DWORD PTR [ecx+36] ; Line 364 mov esp, ebp pop ebp ret 0 ?width@ios_base@std@@QBE_JXZ ENDP ; std::ios_base::width _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?flags@ios_base@std@@QBEHXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?flags@ios_base@std@@QBEHXZ PROC ; std::ios_base::flags, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xiosbase ; Line 325 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 326 mov eax, DWORD PTR _this$[ebp] mov eax, DWORD PTR [eax+20] ; Line 327 mov esp, ebp pop ebp ret 0 ?flags@ios_base@std@@QBEHXZ ENDP ; std::ios_base::flags _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?good@ios_base@std@@QBE_NXZ _TEXT SEGMENT _this$ = -8 ; size = 4 tv67 = -4 ; size = 4 ?good@ios_base@std@@QBE_NXZ PROC ; std::ios_base::good, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xiosbase ; Line 294 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 295 mov ecx, DWORD PTR _this$[ebp] call ?rdstate@ios_base@std@@QBEHXZ ; std::ios_base::rdstate test eax, eax jne SHORT $LN3@good mov DWORD PTR tv67[ebp], 1 jmp SHORT $LN4@good $LN3@good: mov DWORD PTR tv67[ebp], 0 $LN4@good: mov al, BYTE PTR tv67[ebp] ; Line 296 mov esp, ebp pop ebp ret 0 ?good@ios_base@std@@QBE_NXZ ENDP ; std::ios_base::good _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?rdstate@ios_base@std@@QBEHXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?rdstate@ios_base@std@@QBEHXZ PROC ; std::ios_base::rdstate, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xiosbase ; Line 275 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 276 mov eax, DWORD PTR _this$[ebp] mov eax, DWORD PTR [eax+12] ; Line 277 mov esp, ebp pop ebp ret 0 ?rdstate@ios_base@std@@QBEHXZ ENDP ; std::ios_base::rdstate _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?clear@ios_base@std@@QAEXH_N@Z _TEXT SEGMENT $T1 = -40 ; size = 20 $T2 = -20 ; size = 8 _this$ = -12 ; size = 4 __Msg$3 = -8 ; size = 4 __Filtered$ = -4 ; size = 4 __State$ = 8 ; size = 4 __Reraise$ = 12 ; size = 1 ?clear@ios_base@std@@QAEXH_N@Z PROC ; std::ios_base::clear, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xiosbase ; Line 243 push ebp mov ebp, esp sub esp, 40 ; 00000028H mov DWORD PTR _this$[ebp], ecx ; Line 244 mov eax, DWORD PTR __State$[ebp] and eax, 23 ; 00000017H mov DWORD PTR __State$[ebp], eax ; Line 245 mov ecx, DWORD PTR _this$[ebp] mov edx, DWORD PTR __State$[ebp] mov DWORD PTR [ecx+12], edx ; Line 246 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR __State$[ebp] and ecx, DWORD PTR [eax+16] mov DWORD PTR __Filtered$[ebp], ecx ; Line 247 je SHORT $LN8@clear ; Line 248 movzx edx, BYTE PTR __Reraise$[ebp] test edx, edx je SHORT $LN3@clear ; Line 249 push 0 push 0 call __CxxThrowException@8 $LN3@clear: ; Line 253 mov eax, DWORD PTR __Filtered$[ebp] and eax, 4 je SHORT $LN4@clear ; Line 254 mov DWORD PTR __Msg$3[ebp], OFFSET ??_C@_0BF@PHHKMMFD@ios_base?3?3badbit?5set@ jmp SHORT $LN5@clear $LN4@clear: ; Line 255 mov ecx, DWORD PTR __Filtered$[ebp] and ecx, 2 je SHORT $LN6@clear ; Line 256 mov DWORD PTR __Msg$3[ebp], OFFSET ??_C@_0BG@FMKFHCIL@ios_base?3?3failbit?5set@ ; Line 257 jmp SHORT $LN5@clear $LN6@clear: ; Line 258 mov DWORD PTR __Msg$3[ebp], OFFSET ??_C@_0BF@OOHOMBOF@ios_base?3?3eofbit?5set@ $LN5@clear: ; Line 261 push 1 lea edx, DWORD PTR $T2[ebp] push edx call ?make_error_code@std@@YA?AVerror_code@1@W4io_errc@1@@Z ; std::make_error_code add esp, 8 push eax mov eax, DWORD PTR __Msg$3[ebp] push eax lea ecx, DWORD PTR $T1[ebp] call ??0failure@ios_base@std@@QAE@PBDABVerror_code@2@@Z ; std::ios_base::failure::failure push OFFSET __TI5?AVfailure@ios_base@std@@ lea ecx, DWORD PTR $T1[ebp] push ecx call __CxxThrowException@8 $LN8@clear: ; Line 263 mov esp, ebp pop ebp ret 8 ?clear@ios_base@std@@QAEXH_N@Z ENDP ; std::ios_base::clear _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??_Gfailure@ios_base@std@@UAEPAXI@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___flags$ = 8 ; size = 4 ??_Gfailure@ios_base@std@@UAEPAXI@Z PROC ; std::ios_base::failure::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1failure@ios_base@std@@UAE@XZ mov eax, DWORD PTR ___flags$[ebp] and eax, 1 je SHORT $LN2@scalar push 20 ; 00000014H mov ecx, DWORD PTR _this$[ebp] push ecx call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN2@scalar: mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??_Gfailure@ios_base@std@@UAEPAXI@Z ENDP ; std::ios_base::failure::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0failure@ios_base@std@@QAE@ABV012@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___that$ = 8 ; size = 4 ??0failure@ios_base@std@@QAE@ABV012@@Z PROC ; std::ios_base::failure::failure, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR ___that$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??0system_error@std@@QAE@ABV01@@Z mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx], OFFSET ??_7failure@ios_base@std@@6B@ mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0failure@ios_base@std@@QAE@ABV012@@Z ENDP ; std::ios_base::failure::failure _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1failure@ios_base@std@@UAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1failure@ios_base@std@@UAE@XZ PROC ; std::ios_base::failure::~failure, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1system_error@std@@UAE@XZ mov esp, ebp pop ebp ret 0 ??1failure@ios_base@std@@UAE@XZ ENDP ; std::ios_base::failure::~failure _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0failure@ios_base@std@@QAE@PBDABVerror_code@2@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Message$ = 8 ; size = 4 __Errcode$ = 12 ; size = 4 ??0failure@ios_base@std@@QAE@PBDABVerror_code@2@@Z PROC ; std::ios_base::failure::failure, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xiosbase ; Line 201 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 202 mov eax, DWORD PTR __Message$[ebp] push eax mov ecx, DWORD PTR __Errcode$[ebp] mov edx, DWORD PTR [ecx+4] push edx mov eax, DWORD PTR [ecx] push eax mov ecx, DWORD PTR _this$[ebp] call ??0system_error@std@@QAE@Verror_code@1@PBD@Z ; std::system_error::system_error mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx], OFFSET ??_7failure@ios_base@std@@6B@ ; Line 203 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 8 ??0failure@ios_base@std@@QAE@PBDABVerror_code@2@@Z ENDP ; std::ios_base::failure::failure _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@0@XZ _TEXT SEGMENT ??$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@0@XZ PROC ; std::_Immortalize<std::_Iostream_error_category>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xcall_once.h ; Line 62 push ebp mov ebp, esp ; Line 67 push OFFSET ?_Storage@?1???$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@1@XZ@4T?$_Align_type@H$07@1@A ; `std::_Immortalize<std::_Iostream_error_category>'::`2'::_Storage push OFFSET ??$_Immortalize_impl@V_Iostream_error_category@std@@@std@@YGHPAX0PAPAX@Z ; std::_Immortalize_impl<std::_Iostream_error_category> push OFFSET ?_Flag@?1???$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@1@XZ@4PAXA ; `std::_Immortalize<std::_Iostream_error_category>'::`2'::_Flag call ?_Execute_once@std@@YAHAAUonce_flag@1@P6GHPAX1PAPAX@Z1@Z ; std::_Execute_once add esp, 12 ; 0000000cH test eax, eax jne SHORT $LN2@Immortaliz ; Line 69 call _terminate $LN2@Immortaliz: ; Line 72 mov eax, OFFSET ?_Storage@?1???$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@1@XZ@4T?$_Align_type@H$07@1@A ; `std::_Immortalize<std::_Iostream_error_category>'::`2'::_Storage $LN3@Immortaliz: ; Line 73 pop ebp ret 0 ??$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@0@XZ ENDP ; std::_Immortalize<std::_Iostream_error_category> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??_G_Iostream_error_category@std@@UAEPAXI@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___flags$ = 8 ; size = 4 ??_G_Iostream_error_category@std@@UAEPAXI@Z PROC ; std::_Iostream_error_category::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1_Iostream_error_category@std@@UAE@XZ mov eax, DWORD PTR ___flags$[ebp] and eax, 1 je SHORT $LN2@scalar push 8 mov ecx, DWORD PTR _this$[ebp] push ecx call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN2@scalar: mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??_G_Iostream_error_category@std@@UAEPAXI@Z ENDP ; std::_Iostream_error_category::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1_Iostream_error_category@std@@UAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1_Iostream_error_category@std@@UAE@XZ PROC ; std::_Iostream_error_category::~_Iostream_error_category, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1_Generic_error_category@std@@UAE@XZ mov esp, ebp pop ebp ret 0 ??1_Iostream_error_category@std@@UAE@XZ ENDP ; std::_Iostream_error_category::~_Iostream_error_category _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?message@_Iostream_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___$ReturnUdt$ = 8 ; size = 4 __Errcode$ = 12 ; size = 4 ?message@_Iostream_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z PROC ; std::_Iostream_error_category::message, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 432 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 433 cmp DWORD PTR __Errcode$[ebp], 1 jne SHORT $LN2@message ; Line 434 push OFFSET ??_C@_0BG@PADBLCHM@iostream?5stream?5error@ mov ecx, DWORD PTR ___$ReturnUdt$[ebp] call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@QBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > mov eax, DWORD PTR ___$ReturnUdt$[ebp] jmp SHORT $LN1@message ; Line 435 jmp SHORT $LN1@message $LN2@message: ; Line 436 mov eax, DWORD PTR __Errcode$[ebp] push eax mov ecx, DWORD PTR ___$ReturnUdt$[ebp] push ecx mov ecx, DWORD PTR _this$[ebp] call ?message@_Generic_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z ; std::_Generic_error_category::message mov eax, DWORD PTR ___$ReturnUdt$[ebp] $LN1@message: ; Line 438 mov esp, ebp pop ebp ret 8 ?message@_Iostream_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z ENDP ; std::_Iostream_error_category::message _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?name@_Iostream_error_category@std@@UBEPBDXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?name@_Iostream_error_category@std@@UBEPBDXZ PROC ; std::_Iostream_error_category::name, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 428 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 429 mov eax, OFFSET ??_C@_08LLGCOLLL@iostream@ ; Line 430 mov esp, ebp pop ebp ret 0 ?name@_Iostream_error_category@std@@UBEPBDXZ ENDP ; std::_Iostream_error_category::name _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0_Iostream_error_category@std@@QAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??0_Iostream_error_category@std@@QAE@XZ PROC ; std::_Iostream_error_category::_Iostream_error_category, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 424 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??0_Generic_error_category@std@@QAE@XZ ; std::_Generic_error_category::_Generic_error_category mov eax, DWORD PTR _this$[ebp] mov DWORD PTR [eax], OFFSET ??_7_Iostream_error_category@std@@6B@ ; Line 425 mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx+4], 5 ; Line 426 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 0 ??0_Iostream_error_category@std@@QAE@XZ ENDP ; std::_Iostream_error_category::_Iostream_error_category _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??_G_Generic_error_category@std@@UAEPAXI@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___flags$ = 8 ; size = 4 ??_G_Generic_error_category@std@@UAEPAXI@Z PROC ; std::_Generic_error_category::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1_Generic_error_category@std@@UAE@XZ mov eax, DWORD PTR ___flags$[ebp] and eax, 1 je SHORT $LN2@scalar push 8 mov ecx, DWORD PTR _this$[ebp] push ecx call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN2@scalar: mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??_G_Generic_error_category@std@@UAEPAXI@Z ENDP ; std::_Generic_error_category::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1_Generic_error_category@std@@UAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1_Generic_error_category@std@@UAE@XZ PROC ; std::_Generic_error_category::~_Generic_error_category, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1error_category@std@@UAE@XZ ; std::error_category::~error_category mov esp, ebp pop ebp ret 0 ??1_Generic_error_category@std@@UAE@XZ ENDP ; std::_Generic_error_category::~_Generic_error_category _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?message@_Generic_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___$ReturnUdt$ = 8 ; size = 4 __Errcode$ = 12 ; size = 4 ?message@_Generic_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z PROC ; std::_Generic_error_category::message, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 416 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 417 mov eax, DWORD PTR __Errcode$[ebp] push eax call ?_Syserror_map@std@@YAPBDH@Z ; std::_Syserror_map add esp, 4 push eax mov ecx, DWORD PTR ___$ReturnUdt$[ebp] call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@QBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 418 mov esp, ebp pop ebp ret 8 ?message@_Generic_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z ENDP ; std::_Generic_error_category::message _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?name@_Generic_error_category@std@@UBEPBDXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?name@_Generic_error_category@std@@UBEPBDXZ PROC ; std::_Generic_error_category::name, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 412 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 413 mov eax, OFFSET ??_C@_07DCLBNMLN@generic@ ; Line 414 mov esp, ebp pop ebp ret 0 ?name@_Generic_error_category@std@@UBEPBDXZ ENDP ; std::_Generic_error_category::name _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0_Generic_error_category@std@@QAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??0_Generic_error_category@std@@QAE@XZ PROC ; std::_Generic_error_category::_Generic_error_category, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 408 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??0error_category@std@@QAE@XZ ; std::error_category::error_category mov eax, DWORD PTR _this$[ebp] mov DWORD PTR [eax], OFFSET ??_7_Generic_error_category@std@@6B@ ; Line 409 mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx+4], 3 ; Line 410 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 0 ??0_Generic_error_category@std@@QAE@XZ ENDP ; std::_Generic_error_category::_Generic_error_category _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??_Gsystem_error@std@@UAEPAXI@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___flags$ = 8 ; size = 4 ??_Gsystem_error@std@@UAEPAXI@Z PROC ; std::system_error::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1system_error@std@@UAE@XZ mov eax, DWORD PTR ___flags$[ebp] and eax, 1 je SHORT $LN2@scalar push 20 ; 00000014H mov ecx, DWORD PTR _this$[ebp] push ecx call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN2@scalar: mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??_Gsystem_error@std@@UAEPAXI@Z ENDP ; std::system_error::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0system_error@std@@QAE@ABV01@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___that$ = 8 ; size = 4 ??0system_error@std@@QAE@ABV01@@Z PROC ; std::system_error::system_error, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR ___that$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??0_System_error@std@@QAE@ABV01@@Z mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx], OFFSET ??_7system_error@std@@6B@ mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0system_error@std@@QAE@ABV01@@Z ENDP ; std::system_error::system_error _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1system_error@std@@UAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1system_error@std@@UAE@XZ PROC ; std::system_error::~system_error, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1_System_error@std@@UAE@XZ mov esp, ebp pop ebp ret 0 ??1system_error@std@@UAE@XZ ENDP ; std::system_error::~system_error _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0system_error@std@@QAE@Verror_code@1@PBD@Z _TEXT SEGMENT _this$ = -32 ; size = 4 $T1 = -28 ; size = 24 __$ArrayPad$ = -4 ; size = 4 __Errcode$ = 8 ; size = 8 __Message$ = 16 ; size = 4 ??0system_error@std@@QAE@Verror_code@1@PBD@Z PROC ; std::system_error::system_error, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 366 push ebp mov ebp, esp sub esp, 32 ; 00000020H mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax mov DWORD PTR _this$[ebp], ecx ; Line 367 mov eax, DWORD PTR __Message$[ebp] push eax lea ecx, DWORD PTR $T1[ebp] call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@QBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > lea ecx, DWORD PTR $T1[ebp] push ecx mov edx, DWORD PTR __Errcode$[ebp+4] push edx mov eax, DWORD PTR __Errcode$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??0_System_error@std@@IAE@Verror_code@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z ; std::_System_error::_System_error lea ecx, DWORD PTR $T1[ebp] call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> > mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx], OFFSET ??_7system_error@std@@6B@ ; Line 368 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 mov esp, ebp pop ebp ret 12 ; 0000000cH ??0system_error@std@@QAE@Verror_code@1@PBD@Z ENDP ; std::system_error::system_error _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??_G_System_error@std@@UAEPAXI@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___flags$ = 8 ; size = 4 ??_G_System_error@std@@UAEPAXI@Z PROC ; std::_System_error::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1_System_error@std@@UAE@XZ mov eax, DWORD PTR ___flags$[ebp] and eax, 1 je SHORT $LN2@scalar push 20 ; 00000014H mov ecx, DWORD PTR _this$[ebp] push ecx call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN2@scalar: mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??_G_System_error@std@@UAEPAXI@Z ENDP ; std::_System_error::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0_System_error@std@@QAE@ABV01@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___that$ = 8 ; size = 4 ??0_System_error@std@@QAE@ABV01@@Z PROC ; std::_System_error::_System_error, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR ___that$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??0runtime_error@std@@QAE@ABV01@@Z mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx], OFFSET ??_7_System_error@std@@6B@ mov edx, DWORD PTR ___that$[ebp] mov eax, DWORD PTR [edx+12] mov ecx, DWORD PTR [edx+16] mov edx, DWORD PTR _this$[ebp] mov DWORD PTR [edx+12], eax mov DWORD PTR [edx+16], ecx mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0_System_error@std@@QAE@ABV01@@Z ENDP ; std::_System_error::_System_error _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1_System_error@std@@UAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1_System_error@std@@UAE@XZ PROC ; std::_System_error::~_System_error, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1runtime_error@std@@UAE@XZ mov esp, ebp pop ebp ret 0 ??1_System_error@std@@UAE@XZ ENDP ; std::_System_error::~_System_error _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0_System_error@std@@IAE@Verror_code@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z _TEXT SEGMENT _this$ = -32 ; size = 4 $T1 = -28 ; size = 24 __$ArrayPad$ = -4 ; size = 4 __Errcode$ = 8 ; size = 8 __Message$ = 16 ; size = 4 ??0_System_error@std@@IAE@Verror_code@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z PROC ; std::_System_error::_System_error, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 348 push ebp mov ebp, esp sub esp, 32 ; 00000020H mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax mov DWORD PTR _this$[ebp], ecx ; Line 347 sub esp, 24 ; 00000018H mov ecx, esp mov eax, DWORD PTR __Message$[ebp] push eax call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > mov ecx, DWORD PTR __Errcode$[ebp+4] push ecx mov edx, DWORD PTR __Errcode$[ebp] push edx lea eax, DWORD PTR $T1[ebp] push eax call ?_Makestr@_System_error@std@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@Verror_code@2@V32@@Z ; std::_System_error::_Makestr add esp, 36 ; 00000024H push eax mov ecx, DWORD PTR _this$[ebp] call ??0runtime_error@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z ; std::runtime_error::runtime_error lea ecx, DWORD PTR $T1[ebp] call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> > ; Line 348 mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx], OFFSET ??_7_System_error@std@@6B@ mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR __Errcode$[ebp] mov DWORD PTR [edx+12], eax mov ecx, DWORD PTR __Errcode$[ebp+4] mov DWORD PTR [edx+16], ecx ; Line 349 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 mov esp, ebp pop ebp ret 12 ; 0000000cH ??0_System_error@std@@IAE@Verror_code@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z ENDP ; std::_System_error::_System_error _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Makestr@_System_error@std@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@Verror_code@2@V32@@Z _TEXT SEGMENT $T1 = -28 ; size = 24 __$ArrayPad$ = -4 ; size = 4 ___$ReturnUdt$ = 8 ; size = 4 __Errcode$ = 12 ; size = 8 __Message$ = 20 ; size = 24 ?_Makestr@_System_error@std@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@Verror_code@2@V32@@Z PROC ; std::_System_error::_Makestr, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 336 push ebp mov ebp, esp sub esp, 28 ; 0000001cH mov eax, DWORD PTR ___security_cookie xor eax, ebp mov DWORD PTR __$ArrayPad$[ebp], eax ; Line 337 lea ecx, DWORD PTR __Message$[ebp] call ?empty@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE_NXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::empty movzx eax, al test eax, eax jne SHORT $LN2@Makestr ; Line 338 push OFFSET ??_C@_02LMMGGCAJ@?3?5@ lea ecx, DWORD PTR __Message$[ebp] call ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append $LN2@Makestr: ; Line 341 lea ecx, DWORD PTR $T1[ebp] push ecx lea ecx, DWORD PTR __Errcode$[ebp] call ?message@error_code@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ ; std::error_code::message push eax lea ecx, DWORD PTR __Message$[ebp] call ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append lea ecx, DWORD PTR $T1[ebp] call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> > ; Line 342 lea edx, DWORD PTR __Message$[ebp] push edx mov ecx, DWORD PTR ___$ReturnUdt$[ebp] call ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@$$QAV01@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > lea ecx, DWORD PTR __Message$[ebp] call ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> > mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 343 mov ecx, DWORD PTR __$ArrayPad$[ebp] xor ecx, ebp call @__security_check_cookie@4 mov esp, ebp pop ebp ret 0 ?_Makestr@_System_error@std@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@Verror_code@2@V32@@Z ENDP ; std::_System_error::_Makestr _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??8std@@YA_NABVerror_condition@0@0@Z _TEXT SEGMENT tv78 = -4 ; size = 4 __Left$ = 8 ; size = 4 __Right$ = 12 ; size = 4 ??8std@@YA_NABVerror_condition@0@0@Z PROC ; std::operator==, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 233 push ebp mov ebp, esp push ecx push esi ; Line 234 mov ecx, DWORD PTR __Right$[ebp] call ?category@error_condition@std@@QBEABVerror_category@2@XZ ; std::error_condition::category push eax mov ecx, DWORD PTR __Left$[ebp] call ?category@error_condition@std@@QBEABVerror_category@2@XZ ; std::error_condition::category mov ecx, eax call ??8error_category@std@@QBE_NABV01@@Z ; std::error_category::operator== movzx eax, al test eax, eax je SHORT $LN3@operator mov ecx, DWORD PTR __Left$[ebp] call ?value@error_condition@std@@QBEHXZ ; std::error_condition::value mov esi, eax mov ecx, DWORD PTR __Right$[ebp] call ?value@error_condition@std@@QBEHXZ ; std::error_condition::value cmp esi, eax jne SHORT $LN3@operator mov DWORD PTR tv78[ebp], 1 jmp SHORT $LN4@operator $LN3@operator: mov DWORD PTR tv78[ebp], 0 $LN4@operator: mov al, BYTE PTR tv78[ebp] ; Line 235 pop esi mov esp, ebp pop ebp ret 0 ??8std@@YA_NABVerror_condition@0@0@Z ENDP ; std::operator== _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?category@error_condition@std@@QBEABVerror_category@2@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?category@error_condition@std@@QBEABVerror_category@2@XZ PROC ; std::error_condition::category, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 199 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 200 mov eax, DWORD PTR _this$[ebp] mov eax, DWORD PTR [eax+4] ; Line 201 mov esp, ebp pop ebp ret 0 ?category@error_condition@std@@QBEABVerror_category@2@XZ ENDP ; std::error_condition::category _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?value@error_condition@std@@QBEHXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?value@error_condition@std@@QBEHXZ PROC ; std::error_condition::value, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 195 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 196 mov eax, DWORD PTR _this$[ebp] mov eax, DWORD PTR [eax] ; Line 197 mov esp, ebp pop ebp ret 0 ?value@error_condition@std@@QBEHXZ ENDP ; std::error_condition::value _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0error_condition@std@@QAE@HABVerror_category@1@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Val$ = 8 ; size = 4 __Cat$ = 12 ; size = 4 ??0error_condition@std@@QAE@HABVerror_category@1@@Z PROC ; std::error_condition::error_condition, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 169 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 170 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR __Val$[ebp] mov DWORD PTR [eax], ecx mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR __Cat$[ebp] mov DWORD PTR [edx+4], eax ; Line 171 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 8 ??0error_condition@std@@QAE@HABVerror_category@1@@Z ENDP ; std::error_condition::error_condition _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?message@error_code@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ _TEXT SEGMENT tv67 = -8 ; size = 4 _this$ = -4 ; size = 4 ___$ReturnUdt$ = 8 ; size = 4 ?message@error_code@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ PROC ; std::error_code::message, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 150 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 151 mov ecx, DWORD PTR _this$[ebp] call ?category@error_code@std@@QBEABVerror_category@2@XZ ; std::error_code::category mov DWORD PTR tv67[ebp], eax mov ecx, DWORD PTR _this$[ebp] call ?value@error_code@std@@QBEHXZ ; std::error_code::value push eax mov eax, DWORD PTR ___$ReturnUdt$[ebp] push eax mov ecx, DWORD PTR tv67[ebp] mov edx, DWORD PTR [ecx] mov ecx, DWORD PTR tv67[ebp] mov eax, DWORD PTR [edx+8] call eax mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 152 mov esp, ebp pop ebp ret 4 ?message@error_code@std@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@XZ ENDP ; std::error_code::message _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?category@error_code@std@@QBEABVerror_category@2@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?category@error_code@std@@QBEABVerror_category@2@XZ PROC ; std::error_code::category, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 144 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 145 mov eax, DWORD PTR _this$[ebp] mov eax, DWORD PTR [eax+4] ; Line 146 mov esp, ebp pop ebp ret 0 ?category@error_code@std@@QBEABVerror_category@2@XZ ENDP ; std::error_code::category _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?value@error_code@std@@QBEHXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?value@error_code@std@@QBEHXZ PROC ; std::error_code::value, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 140 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 141 mov eax, DWORD PTR _this$[ebp] mov eax, DWORD PTR [eax] ; Line 142 mov esp, ebp pop ebp ret 0 ?value@error_code@std@@QBEHXZ ENDP ; std::error_code::value _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0error_code@std@@QAE@HABVerror_category@1@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Val$ = 8 ; size = 4 __Cat$ = 12 ; size = 4 ??0error_code@std@@QAE@HABVerror_category@1@@Z PROC ; std::error_code::error_code, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 114 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 115 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR __Val$[ebp] mov DWORD PTR [eax], ecx mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR __Cat$[ebp] mov DWORD PTR [edx+4], eax ; Line 116 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 8 ??0error_code@std@@QAE@HABVerror_category@1@@Z ENDP ; std::error_code::error_code _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??8error_category@std@@QBE_NABV01@@Z _TEXT SEGMENT _this$ = -8 ; size = 4 tv67 = -4 ; size = 4 __Right$ = 8 ; size = 4 ??8error_category@std@@QBE_NABV01@@Z PROC ; std::error_category::operator==, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 82 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 83 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR __Right$[ebp] mov edx, DWORD PTR [eax+4] cmp edx, DWORD PTR [ecx+4] jne SHORT $LN3@operator mov DWORD PTR tv67[ebp], 1 jmp SHORT $LN4@operator $LN3@operator: mov DWORD PTR tv67[ebp], 0 $LN4@operator: mov al, BYTE PTR tv67[ebp] ; Line 84 mov esp, ebp pop ebp ret 4 ??8error_category@std@@QBE_NABV01@@Z ENDP ; std::error_category::operator== _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?equivalent@error_category@std@@UBE_NABVerror_code@2@H@Z _TEXT SEGMENT _this$ = -8 ; size = 4 tv74 = -4 ; size = 4 __Code$ = 8 ; size = 4 __Errval$ = 12 ; size = 4 ?equivalent@error_category@std@@UBE_NABVerror_code@2@H@Z PROC ; std::error_category::equivalent, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 282 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 283 mov ecx, DWORD PTR __Code$[ebp] call ?category@error_code@std@@QBEABVerror_category@2@XZ ; std::error_code::category push eax mov ecx, DWORD PTR _this$[ebp] call ??8error_category@std@@QBE_NABV01@@Z ; std::error_category::operator== movzx eax, al test eax, eax je SHORT $LN3@equivalent mov ecx, DWORD PTR __Code$[ebp] call ?value@error_code@std@@QBEHXZ ; std::error_code::value cmp eax, DWORD PTR __Errval$[ebp] jne SHORT $LN3@equivalent mov DWORD PTR tv74[ebp], 1 jmp SHORT $LN4@equivalent $LN3@equivalent: mov DWORD PTR tv74[ebp], 0 $LN4@equivalent: mov al, BYTE PTR tv74[ebp] ; Line 284 mov esp, ebp pop ebp ret 8 ?equivalent@error_category@std@@UBE_NABVerror_code@2@H@Z ENDP ; std::error_category::equivalent _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?equivalent@error_category@std@@UBE_NHABVerror_condition@2@@Z _TEXT SEGMENT $T1 = -12 ; size = 8 _this$ = -4 ; size = 4 __Errval$ = 8 ; size = 4 __Cond$ = 12 ; size = 4 ?equivalent@error_category@std@@UBE_NHABVerror_condition@2@@Z PROC ; std::error_category::equivalent, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 277 push ebp mov ebp, esp sub esp, 12 ; 0000000cH mov DWORD PTR _this$[ebp], ecx ; Line 278 mov eax, DWORD PTR __Cond$[ebp] push eax mov ecx, DWORD PTR __Errval$[ebp] push ecx lea edx, DWORD PTR $T1[ebp] push edx mov eax, DWORD PTR _this$[ebp] mov edx, DWORD PTR [eax] mov ecx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx+12] call eax push eax call ??8std@@YA_NABVerror_condition@0@0@Z ; std::operator== add esp, 8 ; Line 279 mov esp, ebp pop ebp ret 8 ?equivalent@error_category@std@@UBE_NHABVerror_condition@2@@Z ENDP ; std::error_category::equivalent _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?default_error_condition@error_category@std@@UBE?AVerror_condition@2@H@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___$ReturnUdt$ = 8 ; size = 4 __Errval$ = 12 ; size = 4 ?default_error_condition@error_category@std@@UBE?AVerror_condition@2@H@Z PROC ; std::error_category::default_error_condition, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 272 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 273 mov eax, DWORD PTR _this$[ebp] push eax mov ecx, DWORD PTR __Errval$[ebp] push ecx mov ecx, DWORD PTR ___$ReturnUdt$[ebp] call ??0error_condition@std@@QAE@HABVerror_category@1@@Z ; std::error_condition::error_condition mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 274 mov esp, ebp pop ebp ret 8 ?default_error_condition@error_category@std@@UBE?AVerror_condition@2@H@Z ENDP ; std::error_category::default_error_condition _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1error_category@std@@UAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1error_category@std@@UAE@XZ PROC ; std::error_category::~error_category, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 70 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov esp, ebp pop ebp ret 0 ??1error_category@std@@UAE@XZ ENDP ; std::error_category::~error_category _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0error_category@std@@QAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??0error_category@std@@QAE@XZ PROC ; std::error_category::error_category, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 66 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 67 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [eax+4], ecx ; Line 68 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 0 ??0error_category@std@@QAE@XZ ENDP ; std::error_category::error_category _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?iostream_category@std@@YAABVerror_category@1@XZ _TEXT SEGMENT ?iostream_category@std@@YAABVerror_category@1@XZ PROC ; std::iostream_category, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 482 push ebp mov ebp, esp ; Line 483 call ??$_Immortalize@V_Iostream_error_category@std@@@std@@YAAAV_Iostream_error_category@0@XZ ; std::_Immortalize<std::_Iostream_error_category> ; Line 484 pop ebp ret 0 ?iostream_category@std@@YAABVerror_category@1@XZ ENDP ; std::iostream_category _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?make_error_code@std@@YA?AVerror_code@1@W4io_errc@1@@Z _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 __Errno$ = 12 ; size = 4 ?make_error_code@std@@YA?AVerror_code@1@W4io_errc@1@@Z PROC ; std::make_error_code, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\system_error ; Line 297 push ebp mov ebp, esp ; Line 298 call ?iostream_category@std@@YAABVerror_category@1@XZ ; std::iostream_category push eax mov eax, DWORD PTR __Errno$[ebp] push eax mov ecx, DWORD PTR ___$ReturnUdt$[ebp] call ??0error_code@std@@QAE@HABVerror_category@1@@Z ; std::error_code::error_code mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 299 pop ebp ret 0 ?make_error_code@std@@YA?AVerror_code@1@W4io_errc@1@@Z ENDP ; std::make_error_code _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??_Gruntime_error@std@@UAEPAXI@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___flags$ = 8 ; size = 4 ??_Gruntime_error@std@@UAEPAXI@Z PROC ; std::runtime_error::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1runtime_error@std@@UAE@XZ mov eax, DWORD PTR ___flags$[ebp] and eax, 1 je SHORT $LN2@scalar push 12 ; 0000000cH mov ecx, DWORD PTR _this$[ebp] push ecx call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN2@scalar: mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??_Gruntime_error@std@@UAEPAXI@Z ENDP ; std::runtime_error::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0runtime_error@std@@QAE@ABV01@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___that$ = 8 ; size = 4 ??0runtime_error@std@@QAE@ABV01@@Z PROC ; std::runtime_error::runtime_error, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR ___that$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??0exception@std@@QAE@ABV01@@Z ; std::exception::exception mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx], OFFSET ??_7runtime_error@std@@6B@ mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0runtime_error@std@@QAE@ABV01@@Z ENDP ; std::runtime_error::runtime_error _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1runtime_error@std@@UAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1runtime_error@std@@UAE@XZ PROC ; std::runtime_error::~runtime_error, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1exception@std@@UAE@XZ ; std::exception::~exception mov esp, ebp pop ebp ret 0 ??1runtime_error@std@@UAE@XZ ENDP ; std::runtime_error::~runtime_error _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0runtime_error@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Message$ = 8 ; size = 4 ??0runtime_error@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z PROC ; std::runtime_error::runtime_error, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\stdexcept ; Line 127 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR __Message$[ebp] call ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::c_str push eax mov ecx, DWORD PTR _this$[ebp] call ??0exception@std@@QAE@QBD@Z ; std::exception::exception mov eax, DWORD PTR _this$[ebp] mov DWORD PTR [eax], OFFSET ??_7runtime_error@std@@6B@ ; Line 128 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0runtime_error@std@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z ENDP ; std::runtime_error::runtime_error _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@XZ PROC ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::~_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ mov esp, ebp pop ebp ret 0 ??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@XZ ENDP ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::~_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QBEABV?$allocator@D@2@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QBEABV?$allocator@D@2@XZ PROC ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Get_first, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 1424 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 1425 mov eax, DWORD PTR _this$[ebp] ; Line 1426 mov esp, ebp pop ebp ret 0 ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QBEABV?$allocator@D@2@XZ ENDP ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Get_first _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAEAAV?$allocator@D@2@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAEAAV?$allocator@D@2@XZ PROC ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Get_first, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 1420 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 1421 mov eax, DWORD PTR _this$[ebp] ; Line 1422 mov esp, ebp pop ebp ret 0 ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAEAAV?$allocator@D@2@XZ ENDP ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Get_first _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABEABV?$allocator@D@2@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABEABV?$allocator@D@2@XZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 4198 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 4199 mov ecx, DWORD PTR _this$[ebp] call ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QBEABV?$allocator@D@2@XZ ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Get_first ; Line 4200 mov esp, ebp pop ebp ret 0 ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABEABV?$allocator@D@2@XZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV?$allocator@D@2@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV?$allocator@D@2@XZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 4194 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 4195 mov ecx, DWORD PTR _this$[ebp] call ?_Get_first@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAEAAV?$allocator@D@2@XZ ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Get_first ; Line 4196 mov esp, ebp pop ebp ret 0 ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV?$allocator@D@2@XZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAXXZ _TEXT SEGMENT ?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAXXZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Xlen, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 4180 push ebp mov ebp, esp ; Line 4181 push OFFSET ??_C@_0BA@JFNIOLAK@string?5too?5long@ call ?_Xlength_error@std@@YAXPBD@Z ; std::_Xlength_error $LN2@Xlen: ; Line 4182 pop ebp ret 0 ?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAXXZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Xlen _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ _TEXT SEGMENT __Al$1 = -16 ; size = 4 __Ptr$2 = -12 ; size = 4 _this$ = -8 ; size = 4 $T3 = -1 ; size = 1 ?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_deallocate, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 4164 push ebp mov ebp, esp sub esp, 16 ; 00000010H mov DWORD PTR _this$[ebp], ecx ; Line 4165 mov ecx, DWORD PTR _this$[ebp] call ?_Orphan_all@_Container_base0@std@@QAEXXZ ; std::_Container_base0::_Orphan_all ; Line 4166 mov ecx, DWORD PTR _this$[ebp] call ?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QBE_NXZ ; std::_String_val<std::_Simple_types<char> >::_Large_string_engaged movzx eax, al test eax, eax je SHORT $LN2@Tidy_deall ; Line 4167 mov ecx, DWORD PTR _this$[ebp] mov edx, DWORD PTR [ecx] mov DWORD PTR __Ptr$2[ebp], edx ; Line 4168 mov ecx, DWORD PTR _this$[ebp] call ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV?$allocator@D@2@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal mov DWORD PTR __Al$1[ebp], eax ; Line 4169 mov eax, DWORD PTR _this$[ebp] push eax call ??$_Destroy_in_place@PAD@std@@YAXAAPAD@Z ; std::_Destroy_in_place<char *> add esp, 4 ; Line 4170 mov ecx, DWORD PTR _this$[ebp] mov edx, DWORD PTR [ecx+20] add edx, 1 push edx mov eax, DWORD PTR __Ptr$2[ebp] push eax mov ecx, DWORD PTR __Al$1[ebp] call ?deallocate@?$allocator@D@std@@QAEXQADI@Z ; std::allocator<char>::deallocate $LN2@Tidy_deall: ; Line 4173 mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx+16], 0 ; Line 4174 mov edx, DWORD PTR _this$[ebp] mov DWORD PTR [edx+20], 15 ; 0000000fH ; Line 4177 mov BYTE PTR $T3[ebp], 0 lea eax, DWORD PTR $T3[ebp] push eax mov ecx, 1 imul edx, ecx, 0 add edx, DWORD PTR _this$[ebp] push edx call ?assign@?$_Narrow_char_traits@DH@std@@SAXAADABD@Z ; std::_Narrow_char_traits<char,int>::assign add esp, 8 ; Line 4178 mov esp, ebp pop ebp ret 0 ?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_deallocate _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Tidy_init@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ _TEXT SEGMENT _this$ = -8 ; size = 4 $T1 = -1 ; size = 1 ?_Tidy_init@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_init, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 4156 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 4157 mov eax, DWORD PTR _this$[ebp] mov DWORD PTR [eax+16], 0 ; Line 4158 mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx+20], 15 ; 0000000fH ; Line 4161 mov BYTE PTR $T1[ebp], 0 lea edx, DWORD PTR $T1[ebp] push edx mov eax, 1 imul ecx, eax, 0 add ecx, DWORD PTR _this$[ebp] push ecx call ?assign@?$_Narrow_char_traits@DH@std@@SAXAADABD@Z ; std::_Narrow_char_traits<char,int>::assign add esp, 8 ; Line 4162 mov esp, ebp pop ebp ret 0 ?_Tidy_init@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_init _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Calculate_growth@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABEII@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Requested$ = 8 ; size = 4 ?_Calculate_growth@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABEII@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Calculate_growth, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 4077 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 4078 mov ecx, DWORD PTR _this$[ebp] call ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::max_size push eax mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax+20] push ecx mov edx, DWORD PTR __Requested$[ebp] push edx call ?_Calculate_growth@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAIIII@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Calculate_growth add esp, 12 ; 0000000cH ; Line 4079 mov esp, ebp pop ebp ret 4 ?_Calculate_growth@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABEII@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Calculate_growth _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Calculate_growth@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAIIII@Z _TEXT SEGMENT $T1 = -8 ; size = 4 __Masked$ = -4 ; size = 4 __Requested$ = 8 ; size = 4 __Old$ = 12 ; size = 4 __Max$ = 16 ; size = 4 ?_Calculate_growth@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAIIII@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Calculate_growth, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 4064 push ebp mov ebp, esp sub esp, 8 ; Line 4065 mov eax, DWORD PTR __Requested$[ebp] or eax, 15 ; 0000000fH mov DWORD PTR __Masked$[ebp], eax ; Line 4066 mov ecx, DWORD PTR __Masked$[ebp] cmp ecx, DWORD PTR __Max$[ebp] jbe SHORT $LN2@Calculate_ ; Line 4067 mov eax, DWORD PTR __Max$[ebp] jmp SHORT $LN1@Calculate_ $LN2@Calculate_: ; Line 4070 mov edx, DWORD PTR __Old$[ebp] shr edx, 1 mov eax, DWORD PTR __Max$[ebp] sub eax, edx cmp DWORD PTR __Old$[ebp], eax jbe SHORT $LN3@Calculate_ ; Line 4071 mov eax, DWORD PTR __Max$[ebp] jmp SHORT $LN1@Calculate_ $LN3@Calculate_: ; Line 4074 mov ecx, DWORD PTR __Old$[ebp] shr ecx, 1 add ecx, DWORD PTR __Old$[ebp] mov DWORD PTR $T1[ebp], ecx lea edx, DWORD PTR $T1[ebp] push edx lea eax, DWORD PTR __Masked$[ebp] push eax call ??$_Max_value@I@std@@YAABIABI0@Z ; std::_Max_value<unsigned int> add esp, 8 mov eax, DWORD PTR [eax] $LN1@Calculate_: ; Line 4075 mov esp, ebp pop ebp ret 0 ?_Calculate_growth@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAIIII@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Calculate_growth _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?empty@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE_NXZ _TEXT SEGMENT _this$ = -8 ; size = 4 tv67 = -4 ; size = 4 ?empty@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE_NXZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::empty, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 3622 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 3623 mov ecx, DWORD PTR _this$[ebp] call ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size test eax, eax jne SHORT $LN3@empty mov DWORD PTR tv67[ebp], 1 jmp SHORT $LN4@empty $LN3@empty: mov DWORD PTR tv67[ebp], 0 $LN4@empty: mov al, BYTE PTR tv67[ebp] ; Line 3624 mov esp, ebp pop ebp ret 0 ?empty@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBE_NXZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::empty _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ _TEXT SEGMENT $T1 = -24 ; size = 4 $T2 = -20 ; size = 4 __Storage_max$ = -16 ; size = 4 __Alloc_max$ = -12 ; size = 4 $T3 = -8 ; size = 4 _this$ = -4 ; size = 4 ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::max_size, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 3570 push ebp mov ebp, esp sub esp, 24 ; 00000018H mov DWORD PTR _this$[ebp], ecx ; Line 3571 mov ecx, DWORD PTR _this$[ebp] call ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABEABV?$allocator@D@2@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal push eax call ?max_size@?$_Default_allocator_traits@V?$allocator@D@std@@@std@@SAIABV?$allocator@D@2@@Z ; std::_Default_allocator_traits<std::allocator<char> >::max_size add esp, 4 mov DWORD PTR __Alloc_max$[ebp], eax ; Line 3572 mov DWORD PTR $T3[ebp], 16 ; 00000010H lea eax, DWORD PTR $T3[ebp] push eax lea ecx, DWORD PTR __Alloc_max$[ebp] push ecx call ??$_Max_value@I@std@@YAABIABI0@Z ; std::_Max_value<unsigned int> add esp, 8 mov edx, DWORD PTR [eax] mov DWORD PTR __Storage_max$[ebp], edx ; Line 3574 mov eax, DWORD PTR __Storage_max$[ebp] sub eax, 1 mov DWORD PTR $T2[ebp], eax call ?max@?$numeric_limits@H@std@@SAHXZ ; std::numeric_limits<int>::max mov DWORD PTR $T1[ebp], eax lea ecx, DWORD PTR $T2[ebp] push ecx lea edx, DWORD PTR $T1[ebp] push edx call ??$_Min_value@I@std@@YAABIABI0@Z ; std::_Min_value<unsigned int> add esp, 8 mov eax, DWORD PTR [eax] ; Line 3577 mov esp, ebp pop ebp ret 0 ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::max_size _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 3566 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 3567 mov eax, DWORD PTR _this$[ebp] mov eax, DWORD PTR [eax+16] ; Line 3568 mov esp, ebp pop ebp ret 0 ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::size _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::c_str, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 3548 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 3549 mov ecx, DWORD PTR _this$[ebp] call ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QBEPBDXZ ; std::_String_val<std::_Simple_types<char> >::_Myptr ; Line 3550 mov esp, ebp pop ebp ret 0 ?c_str@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEPBDXZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::c_str _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBD@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Ptr$ = 8 ; size = 4 ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBD@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2860 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 2861 mov eax, DWORD PTR __Ptr$[ebp] push eax call ?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z ; std::_Narrow_char_traits<char,int>::length add esp, 4 push eax call ??$_Convert_size@I@std@@YAII@Z ; std::_Convert_size<unsigned int> add esp, 4 push eax mov ecx, DWORD PTR __Ptr$[ebp] push ecx mov ecx, DWORD PTR _this$[ebp] call ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBDI@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign ; Line 2862 mov esp, ebp pop ebp ret 4 ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBD@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBDI@Z _TEXT SEGMENT __Old_ptr$1 = -12 ; size = 4 _this$ = -8 ; size = 4 $T2 = -2 ; size = 1 $T3 = -1 ; size = 1 __Ptr$ = 8 ; size = 4 __Count$ = 12 ; size = 4 ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBDI@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2841 push ebp mov ebp, esp sub esp, 12 ; 0000000cH mov DWORD PTR _this$[ebp], ecx ; Line 2843 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR __Count$[ebp] cmp ecx, DWORD PTR [eax+20] ja SHORT $LN2@assign ; Line 2844 mov ecx, DWORD PTR _this$[ebp] call ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QAEPADXZ ; std::_String_val<std::_Simple_types<char> >::_Myptr mov DWORD PTR __Old_ptr$1[ebp], eax ; Line 2845 mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR __Count$[ebp] mov DWORD PTR [edx+16], eax ; Line 2846 mov ecx, DWORD PTR __Count$[ebp] push ecx mov edx, DWORD PTR __Ptr$[ebp] push edx mov eax, DWORD PTR __Old_ptr$1[ebp] push eax call ?move@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z ; std::_Narrow_char_traits<char,int>::move add esp, 12 ; 0000000cH ; Line 2847 mov BYTE PTR $T3[ebp], 0 lea ecx, DWORD PTR $T3[ebp] push ecx mov edx, DWORD PTR __Old_ptr$1[ebp] add edx, DWORD PTR __Count$[ebp] push edx call ?assign@?$_Narrow_char_traits@DH@std@@SAXAADABD@Z ; std::_Narrow_char_traits<char,int>::assign add esp, 8 ; Line 2848 mov eax, DWORD PTR _this$[ebp] jmp SHORT $LN1@assign $LN2@assign: ; Line 2851 xor eax, eax mov BYTE PTR $T2[ebp], al mov ecx, DWORD PTR __Ptr$[ebp] push ecx movzx edx, BYTE PTR $T2[ebp] push edx mov eax, DWORD PTR __Count$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??$_Reallocate_for@V<lambda_9366063389c5f42a00a5088cf24e69de>@@PBD@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV01@IV<lambda_9366063389c5f42a00a5088cf24e69de>@@PBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Reallocate_for<<lambda_9366063389c5f42a00a5088cf24e69de>,char const *> $LN1@assign: ; Line 2858 mov esp, ebp pop ebp ret 8 ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBDI@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBD@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Ptr$ = 8 ; size = 4 ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBD@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2756 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 2757 mov eax, DWORD PTR __Ptr$[ebp] push eax call ?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z ; std::_Narrow_char_traits<char,int>::length add esp, 4 push eax call ??$_Convert_size@I@std@@YAII@Z ; std::_Convert_size<unsigned int> add esp, 4 push eax mov ecx, DWORD PTR __Ptr$[ebp] push ecx mov ecx, DWORD PTR _this$[ebp] call ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBDI@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append ; Line 2758 mov esp, ebp pop ebp ret 4 ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBD@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBDI@Z _TEXT SEGMENT __Old_ptr$1 = -16 ; size = 4 __Old_size$ = -12 ; size = 4 _this$ = -8 ; size = 4 $T2 = -2 ; size = 1 $T3 = -1 ; size = 1 __Ptr$ = 8 ; size = 4 __Count$ = 12 ; size = 4 ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBDI@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2734 push ebp mov ebp, esp sub esp, 16 ; 00000010H mov DWORD PTR _this$[ebp], ecx ; Line 2736 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR [eax+16] mov DWORD PTR __Old_size$[ebp], ecx ; Line 2737 mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx+20] sub eax, DWORD PTR __Old_size$[ebp] cmp DWORD PTR __Count$[ebp], eax ja SHORT $LN2@append ; Line 2738 mov ecx, DWORD PTR __Old_size$[ebp] add ecx, DWORD PTR __Count$[ebp] mov edx, DWORD PTR _this$[ebp] mov DWORD PTR [edx+16], ecx ; Line 2739 mov ecx, DWORD PTR _this$[ebp] call ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QAEPADXZ ; std::_String_val<std::_Simple_types<char> >::_Myptr mov DWORD PTR __Old_ptr$1[ebp], eax ; Line 2740 mov eax, DWORD PTR __Count$[ebp] push eax mov ecx, DWORD PTR __Ptr$[ebp] push ecx mov edx, DWORD PTR __Old_ptr$1[ebp] add edx, DWORD PTR __Old_size$[ebp] push edx call ?move@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z ; std::_Narrow_char_traits<char,int>::move add esp, 12 ; 0000000cH ; Line 2741 mov BYTE PTR $T3[ebp], 0 lea eax, DWORD PTR $T3[ebp] push eax mov ecx, DWORD PTR __Old_size$[ebp] add ecx, DWORD PTR __Count$[ebp] add ecx, DWORD PTR __Old_ptr$1[ebp] push ecx call ?assign@?$_Narrow_char_traits@DH@std@@SAXAADABD@Z ; std::_Narrow_char_traits<char,int>::assign add esp, 8 ; Line 2742 mov eax, DWORD PTR _this$[ebp] jmp SHORT $LN1@append $LN2@append: ; Line 2745 xor edx, edx mov BYTE PTR $T2[ebp], dl mov eax, DWORD PTR __Count$[ebp] push eax mov ecx, DWORD PTR __Ptr$[ebp] push ecx movzx edx, BYTE PTR $T2[ebp] push edx mov eax, DWORD PTR __Count$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??$_Reallocate_grow_by@V<lambda_ab246b20b9526e2ef7792587e4298a77>@@PBDI@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV01@IV<lambda_ab246b20b9526e2ef7792587e4298a77>@@PBDI@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Reallocate_grow_by<<lambda_ab246b20b9526e2ef7792587e4298a77>,char const *,unsigned int> $LN1@append: ; Line 2754 mov esp, ebp pop ebp ret 8 ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBDI@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Right$ = 8 ; size = 4 ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2708 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 2709 mov eax, DWORD PTR __Right$[ebp] mov ecx, DWORD PTR [eax+16] push ecx mov ecx, DWORD PTR __Right$[ebp] call ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QBEPBDXZ ; std::_String_val<std::_Simple_types<char> >::_Myptr push eax mov ecx, DWORD PTR _this$[ebp] call ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBDI@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append ; Line 2710 mov esp, ebp pop ebp ret 4 ?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::append _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2597 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 2598 mov ecx, DWORD PTR _this$[ebp] call ?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_deallocate ; Line 2605 mov ecx, DWORD PTR _this$[ebp] call ??1?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@XZ mov esp, ebp pop ebp ret 0 ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> > _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Construct_lv_contents@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXABV12@@Z _TEXT SEGMENT __Al$ = -40 ; size = 4 $T1 = -36 ; size = 4 $T2 = -32 ; size = 4 __New_capacity$ = -28 ; size = 4 __New_array$ = -24 ; size = 4 __Right_ptr$ = -20 ; size = 4 __Right_data$ = -16 ; size = 4 _this$ = -12 ; size = 4 __Right_size$ = -8 ; size = 4 __My_data$ = -4 ; size = 4 __Right$ = 8 ; size = 4 ?_Construct_lv_contents@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXABV12@@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Construct_lv_contents, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2525 push ebp mov ebp, esp sub esp, 40 ; 00000028H mov DWORD PTR _this$[ebp], ecx ; Line 2530 mov eax, DWORD PTR __Right$[ebp] mov DWORD PTR __Right_data$[ebp], eax ; Line 2531 mov ecx, DWORD PTR __Right_data$[ebp] mov edx, DWORD PTR [ecx+16] mov DWORD PTR __Right_size$[ebp], edx ; Line 2532 mov ecx, DWORD PTR __Right_data$[ebp] call ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QBEPBDXZ ; std::_String_val<std::_Simple_types<char> >::_Myptr mov DWORD PTR __Right_ptr$[ebp], eax ; Line 2533 mov eax, DWORD PTR _this$[ebp] mov DWORD PTR __My_data$[ebp], eax ; Line 2534 cmp DWORD PTR __Right_size$[ebp], 16 ; 00000010H jae SHORT $LN2@Construct_ ; Line 2535 push 16 ; 00000010H mov ecx, DWORD PTR __Right_ptr$[ebp] push ecx mov edx, DWORD PTR __My_data$[ebp] push edx call ?copy@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z ; std::_Narrow_char_traits<char,int>::copy add esp, 12 ; 0000000cH ; Line 2536 mov eax, DWORD PTR __My_data$[ebp] mov ecx, DWORD PTR __Right_size$[ebp] mov DWORD PTR [eax+16], ecx ; Line 2537 mov edx, DWORD PTR __My_data$[ebp] mov DWORD PTR [edx+20], 15 ; 0000000fH ; Line 2538 jmp $LN1@Construct_ $LN2@Construct_: ; Line 2541 mov ecx, DWORD PTR _this$[ebp] call ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV?$allocator@D@2@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal mov DWORD PTR __Al$[ebp], eax ; Line 2542 mov ecx, DWORD PTR _this$[ebp] call ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::max_size mov DWORD PTR $T2[ebp], eax mov eax, DWORD PTR __Right_size$[ebp] or eax, 15 ; 0000000fH mov DWORD PTR $T1[ebp], eax lea ecx, DWORD PTR $T2[ebp] push ecx lea edx, DWORD PTR $T1[ebp] push edx call ??$_Min_value@I@std@@YAABIABI0@Z ; std::_Min_value<unsigned int> add esp, 8 mov eax, DWORD PTR [eax] mov DWORD PTR __New_capacity$[ebp], eax ; Line 2543 mov ecx, DWORD PTR __New_capacity$[ebp] add ecx, 1 push ecx mov ecx, DWORD PTR __Al$[ebp] call ?allocate@?$allocator@D@std@@QAEPADI@Z ; std::allocator<char>::allocate mov DWORD PTR __New_array$[ebp], eax ; Line 2544 lea edx, DWORD PTR __New_array$[ebp] push edx mov eax, DWORD PTR __My_data$[ebp] push eax call ??$_Construct_in_place@PADABQAD@std@@YAXAAPADABQAD@Z ; std::_Construct_in_place<char *,char * const &> add esp, 8 ; Line 2545 mov ecx, DWORD PTR __Right_size$[ebp] add ecx, 1 push ecx mov edx, DWORD PTR __Right_ptr$[ebp] push edx mov eax, DWORD PTR __New_array$[ebp] push eax call ??$_Unfancy@D@std@@YAPADPAD@Z ; std::_Unfancy<char> add esp, 4 push eax call ?copy@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z ; std::_Narrow_char_traits<char,int>::copy add esp, 12 ; 0000000cH ; Line 2546 mov ecx, DWORD PTR __My_data$[ebp] mov edx, DWORD PTR __Right_size$[ebp] mov DWORD PTR [ecx+16], edx ; Line 2547 mov eax, DWORD PTR __My_data$[ebp] mov ecx, DWORD PTR __New_capacity$[ebp] mov DWORD PTR [eax+20], ecx $LN1@Construct_: ; Line 2548 mov esp, ebp pop ebp ret 4 ?_Construct_lv_contents@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXABV12@@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Construct_lv_contents _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Take_contents@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXAAV12@U?$integral_constant@_N$00@2@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Right$ = 8 ; size = 4 ___formal$ = 12 ; size = 1 ?_Take_contents@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXAAV12@U?$integral_constant@_N$00@2@@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Take_contents, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2484 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 2499 mov eax, DWORD PTR __Right$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ?_Memcpy_val_from@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXABV12@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Memcpy_val_from ; Line 2500 mov ecx, DWORD PTR __Right$[ebp] call ?_Tidy_init@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_init ; Line 2501 mov esp, ebp pop ebp ret 8 ?_Take_contents@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXAAV12@U?$integral_constant@_N$00@2@@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Take_contents _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Memcpy_val_from@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXABV12@@Z _TEXT SEGMENT __My_data_mem$ = -12 ; size = 4 __Right_data_mem$ = -8 ; size = 4 _this$ = -4 ; size = 4 __Right$ = 8 ; size = 4 ?_Memcpy_val_from@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXABV12@@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Memcpy_val_from, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2475 push ebp mov ebp, esp sub esp, 12 ; 0000000cH mov DWORD PTR _this$[ebp], ecx ; Line 2477 mov eax, DWORD PTR _this$[ebp] push eax call ??$addressof@V?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@YAPAV?$_String_val@U?$_Simple_types@D@std@@@0@AAV10@@Z ; std::addressof<std::_String_val<std::_Simple_types<char> > > add esp, 4 mov DWORD PTR __My_data_mem$[ebp], eax ; Line 2479 mov ecx, DWORD PTR __Right$[ebp] push ecx call ??$addressof@$$CBV?$_String_val@U?$_Simple_types@D@std@@@std@@@std@@YAPBV?$_String_val@U?$_Simple_types@D@std@@@0@ABV10@@Z ; std::addressof<std::_String_val<std::_Simple_types<char> > const > add esp, 4 mov DWORD PTR __Right_data_mem$[ebp], eax ; Line 2481 push 24 ; 00000018H mov edx, DWORD PTR __Right_data_mem$[ebp] push edx mov eax, DWORD PTR __My_data_mem$[ebp] push eax call _memcpy add esp, 12 ; 0000000cH ; Line 2482 mov esp, ebp pop ebp ret 4 ?_Memcpy_val_from@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXABV12@@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Memcpy_val_from _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@$$QAV01@@Z _TEXT SEGMENT _this$ = -8 ; size = 4 $T1 = -3 ; size = 1 $T2 = -2 ; size = 1 $T3 = -1 ; size = 1 __Right$ = 8 ; size = 4 ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@$$QAV01@@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2383 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR __Right$[ebp] call ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEAAV?$allocator@D@2@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal push eax call ??$move@AAV?$allocator@D@std@@@std@@YA$$QAV?$allocator@D@0@AAV10@@Z ; std::move<std::allocator<char> &> add esp, 4 push eax movzx eax, BYTE PTR $T2[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??$?0V?$allocator@D@std@@$$V@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@U_One_then_variadic_args_t@1@$$QAV?$allocator@D@1@@Z ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1><std::allocator<char> > ; Line 2385 lea ecx, DWORD PTR $T1[ebp] push ecx mov ecx, DWORD PTR _this$[ebp] call ?_Alloc_proxy@_Container_base0@std@@QAEXABU_Fake_allocator@2@@Z ; std::_Container_base0::_Alloc_proxy ; Line 2386 xor edx, edx mov BYTE PTR $T3[ebp], dl movzx eax, BYTE PTR $T3[ebp] push eax mov ecx, DWORD PTR __Right$[ebp] push ecx mov ecx, DWORD PTR _this$[ebp] call ?_Take_contents@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXAAV12@U?$integral_constant@_N$00@2@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Take_contents ; Line 2387 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@$$QAV01@@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@QBD@Z _TEXT SEGMENT __Alproxy$ = -12 ; size = 4 _this$ = -8 ; size = 4 _$S5$ = -3 ; size = 1 $T1 = -2 ; size = 1 __Proxy$ = -1 ; size = 1 __Ptr$ = 8 ; size = 4 ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@QBD@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2297 push ebp mov ebp, esp sub esp, 12 ; 0000000cH mov DWORD PTR _this$[ebp], ecx movzx eax, BYTE PTR $T1[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??$?0$$V@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@U_Zero_then_variadic_args_t@1@@Z ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1><> ; Line 2299 lea ecx, DWORD PTR _$S5$[ebp] mov DWORD PTR __Alproxy$[ebp], ecx ; Line 2300 mov edx, DWORD PTR _this$[ebp] push edx mov eax, DWORD PTR __Alproxy$[ebp] push eax lea ecx, DWORD PTR __Proxy$[ebp] call ??0_Fake_proxy_ptr_impl@std@@QAE@ABU_Fake_allocator@1@ABU_Container_base0@1@@Z ; std::_Fake_proxy_ptr_impl::_Fake_proxy_ptr_impl ; Line 2301 mov ecx, DWORD PTR _this$[ebp] call ?_Tidy_init@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_init ; Line 2302 mov ecx, DWORD PTR __Ptr$[ebp] push ecx mov ecx, DWORD PTR _this$[ebp] call ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@QBD@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign ; Line 2303 lea ecx, DWORD PTR __Proxy$[ebp] call ?_Release@_Fake_proxy_ptr_impl@std@@QAEXXZ ; std::_Fake_proxy_ptr_impl::_Release ; Line 2304 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@QBD@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z _TEXT SEGMENT __Alproxy$ = -12 ; size = 4 _this$ = -8 ; size = 4 _$S7$ = -4 ; size = 1 $T1 = -3 ; size = 1 $T2 = -2 ; size = 1 __Proxy$ = -1 ; size = 1 __Right$ = 8 ; size = 4 ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> >, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2230 push ebp mov ebp, esp sub esp, 12 ; 0000000cH mov DWORD PTR _this$[ebp], ecx ; Line 2231 mov ecx, DWORD PTR __Right$[ebp] call ?_Getal@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABEABV?$allocator@D@2@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Getal push eax lea eax, DWORD PTR $T2[ebp] push eax call ?select_on_container_copy_construction@?$_Default_allocator_traits@V?$allocator@D@std@@@std@@SA?AV?$allocator@D@2@ABV32@@Z ; std::_Default_allocator_traits<std::allocator<char> >::select_on_container_copy_construction add esp, 8 push eax movzx ecx, BYTE PTR $T1[ebp] push ecx mov ecx, DWORD PTR _this$[ebp] call ??$?0V?$allocator@D@std@@$$V@?$_Compressed_pair@V?$allocator@D@std@@V?$_String_val@U?$_Simple_types@D@std@@@2@$00@std@@QAE@U_One_then_variadic_args_t@1@$$QAV?$allocator@D@1@@Z ; std::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1>::_Compressed_pair<std::allocator<char>,std::_String_val<std::_Simple_types<char> >,1><std::allocator<char> > ; Line 2233 lea edx, DWORD PTR _$S7$[ebp] mov DWORD PTR __Alproxy$[ebp], edx ; Line 2234 mov eax, DWORD PTR _this$[ebp] push eax mov ecx, DWORD PTR __Alproxy$[ebp] push ecx lea ecx, DWORD PTR __Proxy$[ebp] call ??0_Fake_proxy_ptr_impl@std@@QAE@ABU_Fake_allocator@1@ABU_Container_base0@1@@Z ; std::_Fake_proxy_ptr_impl::_Fake_proxy_ptr_impl ; Line 2235 mov edx, DWORD PTR __Right$[ebp] push edx mov ecx, DWORD PTR _this$[ebp] call ?_Construct_lv_contents@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AAEXABV12@@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Construct_lv_contents ; Line 2236 lea ecx, DWORD PTR __Proxy$[ebp] call ?_Release@_Fake_proxy_ptr_impl@std@@QAEXXZ ; std::_Fake_proxy_ptr_impl::_Release ; Line 2237 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ PROC ; std::_String_val<std::_Simple_types<char> >::~_String_val<std::_Simple_types<char> >, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ; std::_String_val<std::_Simple_types<char> >::_Bxty::~_Bxty mov esp, ebp pop ebp ret 0 ??1?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ENDP ; std::_String_val<std::_Simple_types<char> >::~_String_val<std::_Simple_types<char> > _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ PROC ; std::_String_val<std::_Simple_types<char> >::_Bxty::~_Bxty, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2148 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov esp, ebp pop ebp ret 0 ??1_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ENDP ; std::_String_val<std::_Simple_types<char> >::_Bxty::~_Bxty _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??0_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ PROC ; std::_String_val<std::_Simple_types<char> >::_Bxty::_Bxty, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2146 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 0 ??0_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ENDP ; std::_String_val<std::_Simple_types<char> >::_Bxty::_Bxty _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QBE_NXZ _TEXT SEGMENT _this$ = -8 ; size = 4 tv66 = -4 ; size = 4 ?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QBE_NXZ PROC ; std::_String_val<std::_Simple_types<char> >::_Large_string_engaged, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2120 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 2121 mov eax, DWORD PTR _this$[ebp] cmp DWORD PTR [eax+20], 16 ; 00000010H jb SHORT $LN3@Large_stri mov DWORD PTR tv66[ebp], 1 jmp SHORT $LN4@Large_stri $LN3@Large_stri: mov DWORD PTR tv66[ebp], 0 $LN4@Large_stri: mov al, BYTE PTR tv66[ebp] ; Line 2122 mov esp, ebp pop ebp ret 0 ?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QBE_NXZ ENDP ; std::_String_val<std::_Simple_types<char> >::_Large_string_engaged _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QBEPBDXZ _TEXT SEGMENT __Result$ = -8 ; size = 4 _this$ = -4 ; size = 4 ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QBEPBDXZ PROC ; std::_String_val<std::_Simple_types<char> >::_Myptr, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2111 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 2112 mov eax, DWORD PTR _this$[ebp] mov DWORD PTR __Result$[ebp], eax ; Line 2113 mov ecx, DWORD PTR _this$[ebp] call ?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QBE_NXZ ; std::_String_val<std::_Simple_types<char> >::_Large_string_engaged movzx ecx, al test ecx, ecx je SHORT $LN2@Myptr ; Line 2114 mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx] push eax call ??$_Unfancy@D@std@@YAPADPAD@Z ; std::_Unfancy<char> add esp, 4 mov DWORD PTR __Result$[ebp], eax $LN2@Myptr: ; Line 2117 mov eax, DWORD PTR __Result$[ebp] ; Line 2118 mov esp, ebp pop ebp ret 0 ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QBEPBDXZ ENDP ; std::_String_val<std::_Simple_types<char> >::_Myptr _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QAEPADXZ _TEXT SEGMENT __Result$ = -8 ; size = 4 _this$ = -4 ; size = 4 ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QAEPADXZ PROC ; std::_String_val<std::_Simple_types<char> >::_Myptr, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2102 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 2103 mov eax, DWORD PTR _this$[ebp] mov DWORD PTR __Result$[ebp], eax ; Line 2104 mov ecx, DWORD PTR _this$[ebp] call ?_Large_string_engaged@?$_String_val@U?$_Simple_types@D@std@@@std@@QBE_NXZ ; std::_String_val<std::_Simple_types<char> >::_Large_string_engaged movzx ecx, al test ecx, ecx je SHORT $LN2@Myptr ; Line 2105 mov edx, DWORD PTR _this$[ebp] mov eax, DWORD PTR [edx] push eax call ??$_Unfancy@D@std@@YAPADPAD@Z ; std::_Unfancy<char> add esp, 4 mov DWORD PTR __Result$[ebp], eax $LN2@Myptr: ; Line 2108 mov eax, DWORD PTR __Result$[ebp] ; Line 2109 mov esp, ebp pop ebp ret 0 ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QAEPADXZ ENDP ; std::_String_val<std::_Simple_types<char> >::_Myptr _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??0?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ PROC ; std::_String_val<std::_Simple_types<char> >::_String_val<std::_Simple_types<char> >, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 2092 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??0_Bxty@?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ; std::_String_val<std::_Simple_types<char> >::_Bxty::_Bxty mov eax, DWORD PTR _this$[ebp] mov DWORD PTR [eax+16], 0 mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx+20], 0 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 0 ??0?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ENDP ; std::_String_val<std::_Simple_types<char> >::_String_val<std::_Simple_types<char> > _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?select_on_container_copy_construction@?$_Default_allocator_traits@V?$allocator@D@std@@@std@@SA?AV?$allocator@D@2@ABV32@@Z _TEXT SEGMENT ___$ReturnUdt$ = 8 ; size = 4 __Al$ = 12 ; size = 4 ?select_on_container_copy_construction@?$_Default_allocator_traits@V?$allocator@D@std@@@std@@SA?AV?$allocator@D@2@ABV32@@Z PROC ; std::_Default_allocator_traits<std::allocator<char> >::select_on_container_copy_construction, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 770 push ebp mov ebp, esp ; Line 771 mov eax, DWORD PTR ___$ReturnUdt$[ebp] ; Line 772 pop ebp ret 0 ?select_on_container_copy_construction@?$_Default_allocator_traits@V?$allocator@D@std@@@std@@SA?AV?$allocator@D@2@ABV32@@Z ENDP ; std::_Default_allocator_traits<std::allocator<char> >::select_on_container_copy_construction _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?max_size@?$_Default_allocator_traits@V?$allocator@D@std@@@std@@SAIABV?$allocator@D@2@@Z _TEXT SEGMENT ___formal$ = 8 ; size = 4 ?max_size@?$_Default_allocator_traits@V?$allocator@D@std@@@std@@SAIABV?$allocator@D@2@@Z PROC ; std::_Default_allocator_traits<std::allocator<char> >::max_size, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 766 push ebp mov ebp, esp ; Line 767 or eax, -1 ; Line 768 pop ebp ret 0 ?max_size@?$_Default_allocator_traits@V?$allocator@D@std@@@std@@SAIABV?$allocator@D@2@@Z ENDP ; std::_Default_allocator_traits<std::allocator<char> >::max_size _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?allocate@?$allocator@D@std@@QAEPADI@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Count$ = 8 ; size = 4 ?allocate@?$allocator@D@std@@QAEPADI@Z PROC ; std::allocator<char>::allocate, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 870 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 871 mov eax, DWORD PTR __Count$[ebp] push eax call ??$_Get_size_of_n@$00@std@@YAII@Z ; std::_Get_size_of_n<1> add esp, 4 push eax call ??$_Allocate@$07U_Default_allocate_traits@std@@$0A@@std@@YAPAXI@Z ; std::_Allocate<8,std::_Default_allocate_traits,0> add esp, 4 ; Line 872 mov esp, ebp pop ebp ret 4 ?allocate@?$allocator@D@std@@QAEPADI@Z ENDP ; std::allocator<char>::allocate _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?deallocate@?$allocator@D@std@@QAEXQADI@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Ptr$ = 8 ; size = 4 __Count$ = 12 ; size = 4 ?deallocate@?$allocator@D@std@@QAEXQADI@Z PROC ; std::allocator<char>::deallocate, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 865 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 867 mov eax, DWORD PTR __Count$[ebp] push eax mov ecx, DWORD PTR __Ptr$[ebp] push ecx call ??$_Deallocate@$07$0A@@std@@YAXPAXI@Z ; std::_Deallocate<8,0> add esp, 8 ; Line 868 mov esp, ebp pop ebp ret 8 ?deallocate@?$allocator@D@std@@QAEXQADI@Z ENDP ; std::allocator<char>::deallocate _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0?$allocator@D@std@@QAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??0?$allocator@D@std@@QAE@XZ PROC ; std::allocator<char>::allocator<char>, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 859 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 0 ??0?$allocator@D@std@@QAE@XZ ENDP ; std::allocator<char>::allocator<char> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?eof@?$_Narrow_char_traits@DH@std@@SAHXZ _TEXT SEGMENT ?eof@?$_Narrow_char_traits@DH@std@@SAHXZ PROC ; std::_Narrow_char_traits<char,int>::eof, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 410 push ebp mov ebp, esp ; Line 411 or eax, -1 ; Line 412 pop ebp ret 0 ?eof@?$_Narrow_char_traits@DH@std@@SAHXZ ENDP ; std::_Narrow_char_traits<char,int>::eof _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z _TEXT SEGMENT tv65 = -4 ; size = 4 __Left$ = 8 ; size = 4 __Right$ = 12 ; size = 4 ?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z PROC ; std::_Narrow_char_traits<char,int>::eq_int_type, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 401 push ebp mov ebp, esp push ecx ; Line 403 mov eax, DWORD PTR __Left$[ebp] mov ecx, DWORD PTR __Right$[ebp] mov edx, DWORD PTR [eax] cmp edx, DWORD PTR [ecx] jne SHORT $LN3@eq_int_typ mov DWORD PTR tv65[ebp], 1 jmp SHORT $LN4@eq_int_typ $LN3@eq_int_typ: mov DWORD PTR tv65[ebp], 0 $LN4@eq_int_typ: mov al, BYTE PTR tv65[ebp] ; Line 404 mov esp, ebp pop ebp ret 0 ?eq_int_type@?$_Narrow_char_traits@DH@std@@SA_NABH0@Z ENDP ; std::_Narrow_char_traits<char,int>::eq_int_type _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?to_int_type@?$_Narrow_char_traits@DH@std@@SAHABD@Z _TEXT SEGMENT __Ch$ = 8 ; size = 4 ?to_int_type@?$_Narrow_char_traits@DH@std@@SAHABD@Z PROC ; std::_Narrow_char_traits<char,int>::to_int_type, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 396 push ebp mov ebp, esp ; Line 398 mov eax, DWORD PTR __Ch$[ebp] movzx eax, BYTE PTR [eax] ; Line 399 pop ebp ret 0 ?to_int_type@?$_Narrow_char_traits@DH@std@@SAHABD@Z ENDP ; std::_Narrow_char_traits<char,int>::to_int_type _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?assign@?$_Narrow_char_traits@DH@std@@SAXAADABD@Z _TEXT SEGMENT __Left$ = 8 ; size = 4 __Right$ = 12 ; size = 4 ?assign@?$_Narrow_char_traits@DH@std@@SAXAADABD@Z PROC ; std::_Narrow_char_traits<char,int>::assign, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 377 push ebp mov ebp, esp ; Line 378 mov eax, DWORD PTR __Left$[ebp] mov ecx, DWORD PTR __Right$[ebp] mov dl, BYTE PTR [ecx] mov BYTE PTR [eax], dl ; Line 379 pop ebp ret 0 ?assign@?$_Narrow_char_traits@DH@std@@SAXAADABD@Z ENDP ; std::_Narrow_char_traits<char,int>::assign _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?move@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z _TEXT SEGMENT __First1$ = 8 ; size = 4 __First2$ = 12 ; size = 4 __Count$ = 16 ; size = 4 ?move@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z PROC ; std::_Narrow_char_traits<char,int>::move, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 366 push ebp mov ebp, esp ; Line 368 mov eax, DWORD PTR __Count$[ebp] push eax mov ecx, DWORD PTR __First2$[ebp] push ecx mov edx, DWORD PTR __First1$[ebp] push edx call _memmove add esp, 12 ; 0000000cH ; Line 369 pop ebp ret 0 ?move@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z ENDP ; std::_Narrow_char_traits<char,int>::move _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?copy@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z _TEXT SEGMENT __First1$ = 8 ; size = 4 __First2$ = 12 ; size = 4 __Count$ = 16 ; size = 4 ?copy@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z PROC ; std::_Narrow_char_traits<char,int>::copy, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 331 push ebp mov ebp, esp ; Line 333 mov eax, DWORD PTR __Count$[ebp] push eax mov ecx, DWORD PTR __First2$[ebp] push ecx mov edx, DWORD PTR __First1$[ebp] push edx call _memcpy add esp, 12 ; 0000000cH ; Line 334 pop ebp ret 0 ?copy@?$_Narrow_char_traits@DH@std@@SAPADQADQBDI@Z ENDP ; std::_Narrow_char_traits<char,int>::copy _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z _TEXT SEGMENT __First$ = 8 ; size = 4 ?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z PROC ; std::_Narrow_char_traits<char,int>::length, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xstring ; Line 310 push ebp mov ebp, esp ; Line 326 mov eax, DWORD PTR __First$[ebp] push eax call _strlen add esp, 4 ; Line 328 pop ebp ret 0 ?length@?$_Narrow_char_traits@DH@std@@SAIQBD@Z ENDP ; std::_Narrow_char_traits<char,int>::length _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Release@_Fake_proxy_ptr_impl@std@@QAEXXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?_Release@_Fake_proxy_ptr_impl@std@@QAEXXZ PROC ; std::_Fake_proxy_ptr_impl::_Release, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 1341 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov esp, ebp pop ebp ret 0 ?_Release@_Fake_proxy_ptr_impl@std@@QAEXXZ ENDP ; std::_Fake_proxy_ptr_impl::_Release _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0_Fake_proxy_ptr_impl@std@@QAE@ABU_Fake_allocator@1@ABU_Container_base0@1@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___formal$ = 8 ; size = 4 ___formal$ = 12 ; size = 4 ??0_Fake_proxy_ptr_impl@std@@QAE@ABU_Fake_allocator@1@ABU_Container_base0@1@@Z PROC ; std::_Fake_proxy_ptr_impl::_Fake_proxy_ptr_impl, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 1338 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 8 ??0_Fake_proxy_ptr_impl@std@@QAE@ABU_Fake_allocator@1@ABU_Container_base0@1@@Z ENDP ; std::_Fake_proxy_ptr_impl::_Fake_proxy_ptr_impl _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Alloc_proxy@_Container_base0@std@@QAEXABU_Fake_allocator@2@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___formal$ = 8 ; size = 4 ?_Alloc_proxy@_Container_base0@std@@QAEXABU_Fake_allocator@2@@Z PROC ; std::_Container_base0::_Alloc_proxy, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 1150 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov esp, ebp pop ebp ret 4 ?_Alloc_proxy@_Container_base0@std@@QAEXABU_Fake_allocator@2@@Z ENDP ; std::_Container_base0::_Alloc_proxy _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Orphan_all@_Container_base0@std@@QAEXXZ _TEXT SEGMENT _this$ = -4 ; size = 4 ?_Orphan_all@_Container_base0@std@@QAEXXZ PROC ; std::_Container_base0::_Orphan_all, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 1148 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov esp, ebp pop ebp ret 0 ?_Orphan_all@_Container_base0@std@@QAEXXZ ENDP ; std::_Container_base0::_Orphan_all _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??$_Convert_size@I@std@@YAII@Z _TEXT SEGMENT __Len$ = 8 ; size = 4 ??$_Convert_size@I@std@@YAII@Z PROC ; std::_Convert_size<unsigned int>, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 1073 push ebp mov ebp, esp ; Line 1075 mov eax, DWORD PTR __Len$[ebp] ; Line 1076 pop ebp ret 0 ??$_Convert_size@I@std@@YAII@Z ENDP ; std::_Convert_size<unsigned int> _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Adjust_manually_vector_aligned@std@@YAXAAPAXAAI@Z _TEXT SEGMENT __Min_back_shift$ = -16 ; size = 4 __Ptr_user$ = -12 ; size = 4 __Ptr_container$ = -8 ; size = 4 __Back_shift$ = -4 ; size = 4 __Ptr$ = 8 ; size = 4 __Bytes$ = 12 ; size = 4 ?_Adjust_manually_vector_aligned@std@@YAXAAPAXAAI@Z PROC ; std::_Adjust_manually_vector_aligned, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 102 push ebp mov ebp, esp sub esp, 16 ; 00000010H ; Line 104 mov eax, DWORD PTR __Bytes$[ebp] mov ecx, DWORD PTR [eax] add ecx, 35 ; 00000023H mov edx, DWORD PTR __Bytes$[ebp] mov DWORD PTR [edx], ecx ; Line 106 mov eax, DWORD PTR __Ptr$[ebp] mov ecx, DWORD PTR [eax] mov DWORD PTR __Ptr_user$[ebp], ecx ; Line 107 mov edx, 4 imul eax, edx, -1 mov ecx, DWORD PTR __Ptr_user$[ebp] mov edx, DWORD PTR [ecx+eax] mov DWORD PTR __Ptr_container$[ebp], edx ; Line 118 mov DWORD PTR __Min_back_shift$[ebp], 4 ; Line 120 mov eax, DWORD PTR __Ptr$[ebp] mov ecx, DWORD PTR [eax] sub ecx, DWORD PTR __Ptr_container$[ebp] mov DWORD PTR __Back_shift$[ebp], ecx $LN4@Adjust_man: ; Line 121 cmp DWORD PTR __Back_shift$[ebp], 4 jb SHORT $LN7@Adjust_man cmp DWORD PTR __Back_shift$[ebp], 35 ; 00000023H ja SHORT $LN7@Adjust_man jmp SHORT $LN2@Adjust_man $LN7@Adjust_man: call __invalid_parameter_noinfo_noreturn xor edx, edx jne SHORT $LN7@Adjust_man $LN2@Adjust_man: xor eax, eax jne SHORT $LN4@Adjust_man ; Line 122 mov ecx, DWORD PTR __Ptr$[ebp] mov edx, DWORD PTR __Ptr_container$[ebp] mov DWORD PTR [ecx], edx $LN10@Adjust_man: ; Line 123 mov esp, ebp pop ebp ret 0 ?_Adjust_manually_vector_aligned@std@@YAXAAPAXAAI@Z ENDP ; std::_Adjust_manually_vector_aligned _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Allocate@_Default_allocate_traits@std@@SAPAXI@Z _TEXT SEGMENT __Bytes$ = 8 ; size = 4 ?_Allocate@_Default_allocate_traits@std@@SAPAXI@Z PROC ; std::_Default_allocate_traits::_Allocate, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\xmemory ; Line 46 push ebp mov ebp, esp ; Line 47 mov eax, DWORD PTR __Bytes$[ebp] push eax call ??2@YAPAXI@Z ; operator new add esp, 4 ; Line 48 pop ebp ret 0 ?_Allocate@_Default_allocate_traits@std@@SAPAXI@Z ENDP ; std::_Default_allocate_traits::_Allocate _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?max@?$numeric_limits@H@std@@SAHXZ _TEXT SEGMENT ?max@?$numeric_limits@H@std@@SAHXZ PROC ; std::numeric_limits<int>::max, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\limits ; Line 553 push ebp mov ebp, esp ; Line 554 mov eax, 2147483647 ; 7fffffffH ; Line 555 pop ebp ret 0 ?max@?$numeric_limits@H@std@@SAHXZ ENDP ; std::numeric_limits<int>::max _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?_Throw_bad_array_new_length@std@@YAXXZ _TEXT SEGMENT $T1 = -12 ; size = 12 ?_Throw_bad_array_new_length@std@@YAXXZ PROC ; std::_Throw_bad_array_new_length, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\exception ; Line 323 push ebp mov ebp, esp sub esp, 12 ; 0000000cH ; Line 324 lea ecx, DWORD PTR $T1[ebp] call ??0bad_array_new_length@std@@QAE@XZ ; std::bad_array_new_length::bad_array_new_length push OFFSET __TI3?AVbad_array_new_length@std@@ lea eax, DWORD PTR $T1[ebp] push eax call __CxxThrowException@8 $LN2@Throw_bad_: ; Line 325 mov esp, ebp pop ebp ret 0 ?_Throw_bad_array_new_length@std@@YAXXZ ENDP ; std::_Throw_bad_array_new_length _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??_Gbad_array_new_length@std@@UAEPAXI@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___flags$ = 8 ; size = 4 ??_Gbad_array_new_length@std@@UAEPAXI@Z PROC ; std::bad_array_new_length::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1bad_array_new_length@std@@UAE@XZ mov eax, DWORD PTR ___flags$[ebp] and eax, 1 je SHORT $LN2@scalar push 12 ; 0000000cH mov ecx, DWORD PTR _this$[ebp] push ecx call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN2@scalar: mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??_Gbad_array_new_length@std@@UAEPAXI@Z ENDP ; std::bad_array_new_length::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0bad_array_new_length@std@@QAE@ABV01@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___that$ = 8 ; size = 4 ??0bad_array_new_length@std@@QAE@ABV01@@Z PROC ; std::bad_array_new_length::bad_array_new_length, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR ___that$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??0bad_alloc@std@@QAE@ABV01@@Z mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx], OFFSET ??_7bad_array_new_length@std@@6B@ mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0bad_array_new_length@std@@QAE@ABV01@@Z ENDP ; std::bad_array_new_length::bad_array_new_length _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1bad_array_new_length@std@@UAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1bad_array_new_length@std@@UAE@XZ PROC ; std::bad_array_new_length::~bad_array_new_length, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1bad_alloc@std@@UAE@XZ mov esp, ebp pop ebp ret 0 ??1bad_array_new_length@std@@UAE@XZ ENDP ; std::bad_array_new_length::~bad_array_new_length _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0bad_array_new_length@std@@QAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??0bad_array_new_length@std@@QAE@XZ PROC ; std::bad_array_new_length::bad_array_new_length, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\vcruntime_exception.h ; Line 138 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 137 push OFFSET ??_C@_0BF@KINCDENJ@bad?5array?5new?5length@ mov ecx, DWORD PTR _this$[ebp] call ??0bad_alloc@std@@AAE@QBD@Z ; std::bad_alloc::bad_alloc ; Line 138 mov eax, DWORD PTR _this$[ebp] mov DWORD PTR [eax], OFFSET ??_7bad_array_new_length@std@@6B@ ; Line 139 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 0 ??0bad_array_new_length@std@@QAE@XZ ENDP ; std::bad_array_new_length::bad_array_new_length _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??_Gbad_alloc@std@@UAEPAXI@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___flags$ = 8 ; size = 4 ??_Gbad_alloc@std@@UAEPAXI@Z PROC ; std::bad_alloc::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1bad_alloc@std@@UAE@XZ mov eax, DWORD PTR ___flags$[ebp] and eax, 1 je SHORT $LN2@scalar push 12 ; 0000000cH mov ecx, DWORD PTR _this$[ebp] push ecx call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN2@scalar: mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??_Gbad_alloc@std@@UAEPAXI@Z ENDP ; std::bad_alloc::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0bad_alloc@std@@QAE@ABV01@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___that$ = 8 ; size = 4 ??0bad_alloc@std@@QAE@ABV01@@Z PROC ; std::bad_alloc::bad_alloc, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR ___that$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??0exception@std@@QAE@ABV01@@Z ; std::exception::exception mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx], OFFSET ??_7bad_alloc@std@@6B@ mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0bad_alloc@std@@QAE@ABV01@@Z ENDP ; std::bad_alloc::bad_alloc _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1bad_alloc@std@@UAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1bad_alloc@std@@UAE@XZ PROC ; std::bad_alloc::~bad_alloc, COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1exception@std@@UAE@XZ ; std::exception::~exception mov esp, ebp pop ebp ret 0 ??1bad_alloc@std@@UAE@XZ ENDP ; std::bad_alloc::~bad_alloc _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0bad_alloc@std@@AAE@QBD@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Message$ = 8 ; size = 4 ??0bad_alloc@std@@AAE@QBD@Z PROC ; std::bad_alloc::bad_alloc, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\vcruntime_exception.h ; Line 127 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx ; Line 126 push 1 mov eax, DWORD PTR __Message$[ebp] push eax mov ecx, DWORD PTR _this$[ebp] call ??0exception@std@@QAE@QBDH@Z ; std::exception::exception ; Line 127 mov ecx, DWORD PTR _this$[ebp] mov DWORD PTR [ecx], OFFSET ??_7bad_alloc@std@@6B@ ; Line 128 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0bad_alloc@std@@AAE@QBD@Z ENDP ; std::bad_alloc::bad_alloc _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??_Gexception@std@@UAEPAXI@Z _TEXT SEGMENT _this$ = -4 ; size = 4 ___flags$ = 8 ; size = 4 ??_Gexception@std@@UAEPAXI@Z PROC ; std::exception::`scalar deleting destructor', COMDAT ; _this$ = ecx push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov ecx, DWORD PTR _this$[ebp] call ??1exception@std@@UAE@XZ ; std::exception::~exception mov eax, DWORD PTR ___flags$[ebp] and eax, 1 je SHORT $LN2@scalar push 12 ; 0000000cH mov ecx, DWORD PTR _this$[ebp] push ecx call ??3@YAXPAXI@Z ; operator delete add esp, 8 $LN2@scalar: mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??_Gexception@std@@UAEPAXI@Z ENDP ; std::exception::`scalar deleting destructor' _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ?what@exception@std@@UBEPBDXZ _TEXT SEGMENT tv69 = -8 ; size = 4 _this$ = -4 ; size = 4 ?what@exception@std@@UBEPBDXZ PROC ; std::exception::what, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\vcruntime_exception.h ; Line 91 push ebp mov ebp, esp sub esp, 8 mov DWORD PTR _this$[ebp], ecx ; Line 92 mov eax, DWORD PTR _this$[ebp] cmp DWORD PTR [eax+4], 0 je SHORT $LN3@what mov ecx, DWORD PTR _this$[ebp] mov edx, DWORD PTR [ecx+4] mov DWORD PTR tv69[ebp], edx jmp SHORT $LN4@what $LN3@what: mov DWORD PTR tv69[ebp], OFFSET ??_C@_0BC@EOODALEL@Unknown?5exception@ $LN4@what: mov eax, DWORD PTR tv69[ebp] ; Line 93 mov esp, ebp pop ebp ret 0 ?what@exception@std@@UBEPBDXZ ENDP ; std::exception::what _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??1exception@std@@UAE@XZ _TEXT SEGMENT _this$ = -4 ; size = 4 ??1exception@std@@UAE@XZ PROC ; std::exception::~exception, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\vcruntime_exception.h ; Line 86 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR _this$[ebp] mov DWORD PTR [eax], OFFSET ??_7exception@std@@6B@ ; Line 87 mov ecx, DWORD PTR _this$[ebp] add ecx, 4 push ecx call ___std_exception_destroy add esp, 4 ; Line 88 mov esp, ebp pop ebp ret 0 ??1exception@std@@UAE@XZ ENDP ; std::exception::~exception _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0exception@std@@QAE@ABV01@@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Other$ = 8 ; size = 4 ??0exception@std@@QAE@ABV01@@Z PROC ; std::exception::exception, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\vcruntime_exception.h ; Line 69 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR _this$[ebp] mov DWORD PTR [eax], OFFSET ??_7exception@std@@6B@ ; Line 68 xor ecx, ecx mov edx, DWORD PTR _this$[ebp] add edx, 4 mov DWORD PTR [edx], ecx mov DWORD PTR [edx+4], ecx ; Line 70 mov eax, DWORD PTR _this$[ebp] add eax, 4 push eax mov ecx, DWORD PTR __Other$[ebp] add ecx, 4 push ecx call ___std_exception_copy add esp, 8 ; Line 71 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0exception@std@@QAE@ABV01@@Z ENDP ; std::exception::exception _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0exception@std@@QAE@QBDH@Z _TEXT SEGMENT _this$ = -4 ; size = 4 __Message$ = 8 ; size = 4 ___formal$ = 12 ; size = 4 ??0exception@std@@QAE@QBDH@Z PROC ; std::exception::exception, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\vcruntime_exception.h ; Line 63 push ebp mov ebp, esp push ecx mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR _this$[ebp] mov DWORD PTR [eax], OFFSET ??_7exception@std@@6B@ ; Line 62 xor ecx, ecx mov edx, DWORD PTR _this$[ebp] add edx, 4 mov DWORD PTR [edx], ecx mov DWORD PTR [edx+4], ecx ; Line 64 mov eax, DWORD PTR _this$[ebp] mov ecx, DWORD PTR __Message$[ebp] mov DWORD PTR [eax+4], ecx ; Line 65 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 8 ??0exception@std@@QAE@QBDH@Z ENDP ; std::exception::exception _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??0exception@std@@QAE@QBD@Z _TEXT SEGMENT __InitData$ = -12 ; size = 8 _this$ = -4 ; size = 4 __Message$ = 8 ; size = 4 ??0exception@std@@QAE@QBD@Z PROC ; std::exception::exception, COMDAT ; _this$ = ecx ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\vcruntime_exception.h ; Line 56 push ebp mov ebp, esp sub esp, 12 ; 0000000cH mov DWORD PTR _this$[ebp], ecx mov eax, DWORD PTR _this$[ebp] mov DWORD PTR [eax], OFFSET ??_7exception@std@@6B@ ; Line 55 xor ecx, ecx mov edx, DWORD PTR _this$[ebp] add edx, 4 mov DWORD PTR [edx], ecx mov DWORD PTR [edx+4], ecx ; Line 57 mov eax, DWORD PTR __Message$[ebp] mov DWORD PTR __InitData$[ebp], eax mov BYTE PTR __InitData$[ebp+4], 1 ; Line 58 mov ecx, DWORD PTR _this$[ebp] add ecx, 4 push ecx lea edx, DWORD PTR __InitData$[ebp] push edx call ___std_exception_copy add esp, 8 ; Line 59 mov eax, DWORD PTR _this$[ebp] mov esp, ebp pop ebp ret 4 ??0exception@std@@QAE@QBD@Z ENDP ; std::exception::exception _TEXT ENDS ; Function compile flags: /Odtp ; COMDAT ??2@YAPAXIPAX@Z _TEXT SEGMENT __Size$ = 8 ; size = 4 __Where$ = 12 ; size = 4 ??2@YAPAXIPAX@Z PROC ; operator new, COMDAT ; File C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.23.28008\include\vcruntime_new.h ; Line 168 push ebp mov ebp, esp ; Line 170 mov eax, DWORD PTR __Where$[ebp] ; Line 171 pop ebp ret 0 ??2@YAPAXIPAX@Z ENDP ; operator new _TEXT ENDS END
38.123984
389
0.72321
908c8c160fa651d52bebfd8c91911c1ca7d0fe0e
5,308
asm
Assembly
non_regression/other_x86_linux_29.s.asm
LRGH/plasmasm
4cd50546c3dc895763d72dd60b7c46179c1916bc
[ "Apache-2.0" ]
1
2021-02-28T21:31:18.000Z
2021-02-28T21:31:18.000Z
non_regression/other_x86_linux_29.s.asm
LRGH/plasmasm
4cd50546c3dc895763d72dd60b7c46179c1916bc
[ "Apache-2.0" ]
null
null
null
non_regression/other_x86_linux_29.s.asm
LRGH/plasmasm
4cd50546c3dc895763d72dd60b7c46179c1916bc
[ "Apache-2.0" ]
null
null
null
.file "(extract)plotport.c" .section .rodata.str1.1 .LC658: .string "mallocing NULL object" # ---------------------- .text .p2align 2,,3 # ---------------------- .local pari_malloc .type pari_malloc, @function pari_malloc: pushl %esi pushl %ebx testl %eax, %eax pushl %ebx je .L6 subl $12, %esp movl PARI_SIGINT_block, %ebx pushl %eax movl $1, PARI_SIGINT_block call malloc addl $16, %esp testl %ebx, %ebx movl %eax, %esi movl %ebx, PARI_SIGINT_block jne .L7 movl PARI_SIGINT_pending, %eax testl %eax, %eax jne .L10 .L7: testl %esi, %esi je .L11 .L8: movl %esi, %eax .L5: popl %edx popl %ebx popl %esi ret .p2align 2,,3 .L6: movl DEBUGMEM, %ecx testl %ecx, %ecx jne .L12 xorl %eax, %eax .L13: popl %edx popl %ebx popl %esi ret .p2align 2,,3 .L10: subl $12, %esp movl PARI_SIGINT_pending, %edx pushl %edx movl $0, PARI_SIGINT_pending call raise addl $16, %esp testl %esi, %esi jne .L8 .L11: subl $12, %esp pushl $28 call pari_err addl $16, %esp movl %esi, %eax jmp .L5 .L12: subl $8, %esp pushl $.LC658 pushl $0 call pari_warn addl $16, %esp xorl %eax, %eax jmp .L13 .size pari_malloc, .-pari_malloc # ---------------------- .p2align 2,,3 # ---------------------- .globl rectstring .type rectstring, @function rectstring: pushl %ebp pushl %edi pushl %esi pushl %ebx subl $12, %esp cmpl $17, 32(%esp) ja .L1165 movl 32(%esp), %eax movl rectgraph(,%eax,4), %esi movl (%esi), %edx testl %edx, %edx je .L1173 .L1167: movl $40, %eax call pari_malloc movl %eax, %ebp movl 36(%esp), %edi cld xorl %eax, %eax movl $-1, %ecx repnz scasb notl %ecx movl %ecx, %eax leal -1(%ecx), %edi call pari_malloc subl $8, %esp pushl 44(%esp) movl %eax, %ebx pushl %eax call strcpy movl $6, 4(%ebp) movl %edi, 12(%ebp) movl %ebx, 16(%ebp) fldl 16(%esi) fmull 32(%esi) faddl 48(%esi) fstpl 20(%ebp) fldl 24(%esi) fmull 40(%esi) faddl 56(%esi) fstpl 28(%ebp) movl $0, 36(%ebp) movl (%esi), %ecx addl $16, %esp testl %ecx, %ecx jne .L1169 movl %ebp, (%esi) movl %ebp, 4(%esi) movl $0, (%ebp) movl 32(%esp), %ebx movl current_color(,%ebx,4), %esi movl %esi, 8(%ebp) addl $12, %esp popl %ebx popl %esi popl %edi popl %ebp ret .p2align 2,,3 .L1169: movl 4(%esi), %edx movl %ebp, (%edx) movl %ebp, 4(%esi) movl $0, (%ebp) movl 32(%esp), %ebx movl current_color(,%ebx,4), %esi movl %esi, 8(%ebp) addl $12, %esp popl %ebx popl %esi popl %edi popl %ebp ret .p2align 2,,3 .L1165: pushl $17 pushl 36(%esp) pushl $.LC678 pushl $5 xorl %esi, %esi call pari_err movl (%esi), %edx addl $16, %esp testl %edx, %edx jne .L1167 .p2align 2,,3 .L1173: subl $8, %esp pushl $.LC679 pushl $5 call pari_err addl $16, %esp jmp .L1167 .size rectstring, .-rectstring # ---------------------- .p2align 2,,3 # ---------------------- .globl rectpointtype .type rectpointtype, @function rectpointtype: pushl %esi pushl %ebx pushl %eax movl 16(%esp), %eax cmpl $-1, %eax movl 20(%esp), %esi je .L1186 cmpl $17, %eax ja .L1179 movl rectgraph(,%eax,4), %ebx movl (%ebx), %eax testl %eax, %eax je .L1187 .L1181: movl $16, %eax call pari_malloc movl $7, 4(%eax) movl %esi, 12(%eax) movl (%ebx), %ecx testl %ecx, %ecx movl %eax, %edx jne .L1183 .L1188: movl %eax, (%ebx) .L1184: movl %edx, 4(%ebx) movl $0, (%edx) popl %eax popl %ebx popl %esi ret .p2align 2,,3 .L1179: pushl $17 pushl %eax pushl $.LC678 pushl $5 xorl %ebx, %ebx call pari_err movl (%ebx), %eax addl $16, %esp testl %eax, %eax jne .L1181 .p2align 2,,3 .L1187: subl $8, %esp pushl $.LC679 pushl $5 call pari_err addl $16, %esp movl $16, %eax call pari_malloc movl $7, 4(%eax) movl %esi, 12(%eax) movl (%ebx), %ecx testl %ecx, %ecx movl %eax, %edx je .L1188 .p2align 2,,3 .L1183: movl 4(%ebx), %esi movl %eax, (%esi) jmp .L1184 .p2align 2,,3 .L1186: movl %esi, rectpoint_itype popl %eax popl %ebx popl %esi ret .size rectpointtype, .-rectpointtype # ---------------------- .comm pari_plot,52,32 # ---------------------- .comm pari_psplot,52,32 # ---------------------- .comm rectgraph,72,32 # ---------------------- .local current_color .comm current_color,72,32 # ---------------------- .ident "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-11)" .section .note.GNU-stack,"",@progbits
19.954887
54
0.485305
953989090e77c0482dad495ae662fabc8254781b
1,009
asm
Assembly
programs/oeis/082/A082143.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/082/A082143.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/082/A082143.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A082143: First subdiagonal of number array A082137. ; 1,3,20,140,1008,7392,54912,411840,3111680,23648768,180590592,1384527872,10650214400,82158796800,635361361920,4924050554880,38233804308480,297374033510400,2316387208396800,18067820225495040,141101072237199360,1103153837490831360,8633377858623897600,67628126559220531200,530204512224288964608,4160066172836728799232,32664223283014315016192,256647468652255332270080,2017780098369455715778560,15873203440506384964124672,124937472241405094556336128,983882593901065119631147008,7751802254978088821336309760,61102441303944935415239147520,481836394282537204988742991872,3801153777117793506022305824768,29998294673470154155635494617088,236828642158974901228701273292800,1870339020127288963549743389081600,14775678259005582812042972773744640,116763896485800215392729833626664960,922990800792515988342531065810780160 mov $1,$0 add $0,1 add $0,$1 seq $0,98660 ; E.g.f. BesselI(0,2*sqrt(2)*x) + BesselI(1,2*sqrt(2)*x)/sqrt(2). mov $2,$0 mod $0,2 add $0,$2 div $0,2
84.083333
807
0.88107
fcbdad23cfb0ba943bc06e8ff0ee563df912df34
587
asm
Assembly
oeis/170/A170795.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/170/A170795.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/170/A170795.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A170795: a(n) = n^10*(n^3 + 1)/2. ; 0,1,4608,826686,34078720,615234375,6560580096,48585742828,275414777856,1272676306365,5005000000000,17274324784266,53527561371648,151506482542051,397002013954560,973385859375000,2252349569499136,4953297013403193,10413267666448896,21029557264257430,40965120000000000,77244528810048831,141418308902937088,252038894223840516,438275870923161600,745105743408203125,1240647020149694976,2026380522075535458,3251203809632321536,5130524710095951195,7971910245000000000,12209182962866011696 mov $1,$0 pow $0,10 mov $2,$1 pow $2,3 mul $2,$0 add $0,$2 div $0,2
53.363636
481
0.851789
564f27ed6c0c8badbf41d34af8c14261fb4144e7
1,676
asm
Assembly
libsrc/target/zx/if1/if1_checkblock.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/target/zx/if1/if1_checkblock.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/target/zx/if1/if1_checkblock.asm
C-Chads/z88dk
a4141a8e51205c6414b4ae3263b633c4265778e6
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; ; ZX IF1 & Microdrive functions ; ; Stefano Bodrato - Oct. 2004 ; ; ; if1_checkblock: ; - check the loaded block for integrity ; - other various checks ; - when a checksum is reported wrong, it is automatically fixed ; ; This function is also used internally by if1_load_sector() and if1_load_record() ; to verify that a block is loaded and valid (if1_sect_ready is affected also when a block was not found) ; ; $Id: if1_checkblock.asm $ ; SECTION code_clib PUBLIC if1_checkblock EXTERN if1_checksum EXTERN mdvbuffer PUBLIC mdv_seek_count PUBLIC if1_sect_ready ;PUBLIC if1_verifymode if1_checkblock: push ix pop hl ld de,43h ; RECFLAG add hl,de ld bc,14 call if1_checksum ld hl,status ld (hl),1 ; jr nz,chksector inc (hl) ld a,(ix+43h) ; RECFLG or (ix+46h) ; 2nd byte of RECLEN and 2 jr z,chk1 bit 1,(ix+43h) ; RECFLG jr z,chksector ld a,(ix+47h) ; RECNAM: file name or a jr nz,chksector chk1: ld a,4 jr chk2 chksector: push ix pop hl ld de,52h ; CHDATA add hl,de ld bc,512 ; 512 bytes of data call if1_checksum ; verify checksum ld a,(status) jr nz,chk2 inc a inc a chk2: ld hl,if1_sect_ready ; flag for "sector read" cp (hl) ret c ret z ld (hl),a ; ld b,a ; ld a,(if1_verifymode) ; bit 2,a ; ld a,b ; ret nz ; Copy microdrive channel to work buffer push ix pop hl ld de,(mdvbuffer) ld bc,595 ldir ret SECTION data_clib ; in the Interface 1 ROM it is usually set to 255*5 ; we risk to reduce it roughly by 1 tape revolution mdv_seek_count: defw 256*4 SECTION bss_clib status: defb 0 if1_sect_ready: defb 0 ;if1_verifymode: defb 0
16.76
106
0.680788
2f65e5dd980e08be35661fe83c5f4a3d92b798d9
1,616
asm
Assembly
util/cv/d1asc.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
util/cv/d1asc.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
util/cv/d1asc.asm
olifink/smsqe
c546d882b26566a46d71820d1539bed9ea8af108
[ "BSD-2-Clause" ]
null
null
null
* Convert D1 to ASCII v0.00  May 1988 J.R.Oakley QJUMP * section cv * xref cv_uldiv * xdef cv_d1asc *+++ * Convert a number of up to 8 digits into ASCII: the number is assumed * to be unsigned. * * Registers: * Entry Exit * D1 number to convert smashed * A0 buffer updated *--- cv_d1asc d1areg reg d0/d2/d3 movem.l d1areg,-(sp) moveq #0,d2 ; answer moveq #0,d3 ; number of digits bra.s cnvle cnvlp jsr cv_uldiv(pc) or.b d1,d2 ; add in a digit lsl.l #4,d2 ; and shift it backwards a nibble move.l d0,d1 ; now divide quotient cnvle addq.w #1,d3 ; one more digit moveq #10,d0 ; we want to divide by ten cmp.l d1,d0 ; is it worth it? ble.s cnvlp ; yes or.b d1,d2 ; no, just whack in the last digit * bra.s cpde ; convert to ASCII in buffer cpdl moveq #$f,d0 ; mask a nibble and.b d2,d0 ; from the list lsr.l #4,d2 ; here's the next one add.b #'0',d0 ; make it a digit move.b d0,(a0)+ ; and fill it in cpde dbra d3,cpdl movem.l (sp)+,d1areg rts * end
33.666667
76
0.405941
5ec8da1384192c13ed78d728fc74768e4e84c6b5
102
asm
Assembly
libsrc/_DEVELOPMENT/target/yaz180/device/asci/c/asci0_pollc.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/target/yaz180/device/asci/c/asci0_pollc.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/target/yaz180/device/asci/c/asci0_pollc.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION code_driver PUBLIC _asci0_pollc EXTERN asm_asci0_pollc defc _asci0_pollc = asm_asci0_pollc
12.75
35
0.862745
bb8e76d27b6c2b099da404d8a9307c98b73b2200
722
asm
Assembly
oeis/115/A115032.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/115/A115032.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/115/A115032.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A115032: Expansion of (5-14*x+x^2)/((1-x)*(x^2-18*x+1)). ; Submitted by Jamie Morken(s1.) ; 5,81,1445,25921,465125,8346321,149768645,2687489281,48225038405,865363202001,15528312597605,278644263554881,5000068431390245,89722587501469521,1610006506595061125,28890394531209630721,518417095055178291845,9302617316461999622481,166928694601260814912805,2995413885506232668808001,53750521244510927223631205,964513968515690457356553681,17307500912037917305194335045,310570502448166821036141477121,5572961543154964861345352253125,100002737274341200683180199079121,1794476309394986647435898231171045 mov $3,1 lpb $0 sub $0,$3 add $2,2 add $4,1 mov $1,$4 mul $1,16 add $2,$1 add $4,$2 lpe mov $0,$4 mul $0,4 add $0,5
40.111111
498
0.815789
943fc8adf5d490cde5fbf21ef1067f7fcb13c6b7
15,880
asm
Assembly
Library/Styles/Manip/manipCopy.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/Styles/Manip/manipCopy.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/Styles/Manip/manipCopy.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @---------------------------------------------------------------------- Copyright (c) Berkeley Softworks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: Library/Styles FILE: Manip/manipCopy.asm REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 12/91 Initial version DESCRIPTION: This file contains code for StyleSheetGetStyle $Id: manipCopy.asm,v 1.1 97/04/07 11:15:27 newdeal Exp $ ------------------------------------------------------------------------------@ OPTIMIZE_STYLE_COPY = TRUE OPT_STYLE_ARRAY_CHUNK = size LMemBlockHeader OPT_ATTR_ARRAY_CHUNK = OPT_STYLE_ARRAY_CHUNK+2 OptEntry struct OE_sourceToken word OE_destToken word OE_sourceRef word OptEntry ends STYLE_COPY_LOCALS equ <\ STYLE_MANIP_LOCALS\ .warn -unref_local\ styleFlags local word\ destStyle local word\ destCopyFromStyle local word\ fromTransfer local byte\ changeDestStyles local byte\ optBlock local word\ createdNew local word\ oldBaseStyle local word\ .warn @unref_local\ > ManipCode segment resource COMMENT @---------------------------------------------------------------------- FUNCTION: CopyStyle DESCRIPTION: Copy a style from one attribute space to another. This routine can be called recusrively. CALLED BY: INTERNAL PASS: ss:bp - inherited variables ax - style to move fromTransfer - set if copying *from* transfer space changeDestStyles - set to force the source's definition of a style to the destination optBlock - optimization block RETURN: ax - style token in destination space DESTROYED: bx, cx, dx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/15/92 Initial version ------------------------------------------------------------------------------@ CopyStyle proc near STYLE_COPY_LOCALS .enter inherit far push styleToChange, destStyle, createdNew, oldBaseStyle ;*** base case: null element is the same everywhere cmp ax, CA_NULL_ELEMENT jnz 1$ toDone: jmp done 1$: clr createdNew mov bx, OPT_STYLE_ARRAY_CHUNK clr dx call LookupOpt jc toDone ;*** try to locate the style in the destination space mov styleToChange, ax call Load_dssi_sourceStyle call ChunkArrayElementToPtr ;ds:di = element, cx = size mov ax, ds:[di].SEH_baseStyle mov oldBaseStyle, ax mov ax, ds:[di].SEH_flags mov styleFlags, ax movdw privateData, ds:[di].SEH_privateData, ax CheckHack <(size SEH_reserved) eq 6> mov ax, {word} ds:[di].SEH_reserved mov {word} reserved, ax mov ax, {word} ds:[di].SEH_reserved+2 mov {word} reserved+2, ax mov ax, {word} ds:[di].SEH_reserved+4 mov {word} reserved+4, ax segmov es, ds mov si, ds:[si] mov bx, ds:[si].NAH_dataSize add bx, NameArrayElement add di, bx ;es:di = name sub cx, bx ;cx = name size DBCS < shr cx, 1 ;cx <- name length > call Load_dssi_destStyle clr dx call NameArrayFind ;ax = token found cmp ax, CA_NULL_ELEMENT jz doesNotExistInDest ;*** The style exists in the destination space -- if we are not ; forcing the source's view of the world then we're done, ; otherwise we have to change the destination to our view of the ; world ; Also, if we are copying to the transfer space then we can assume ; that the spaces have the same definition of styles tst fromTransfer jz skipMerge tst changeDestStyles jnz common skipMerge: jmp addOpt ;*** The style does not exist in the destination space -- create it doesNotExistInDest: inc createdNew tst fromTransfer jz afterInc call StyleSheetIncNotifyCounter afterInc: clr bx call NameArrayAdd ;ax = token EC < ERROR_NC STYLE_SHOULD_NOT_HAVE_EXISTED > call DerefStyleLocals call ChunkArrayElementToPtr movdw ds:[di].SEH_privateData, privateData, cx CheckHack <(size SEH_reserved) eq 6> mov cx, {word} reserved mov {word} ds:[di].SEH_reserved, cx mov cx, {word} reserved+2 mov {word} ds:[di].SEH_reserved+2, cx mov cx, {word} reserved+4 mov {word} ds:[di].SEH_reserved+4, cx mov cx, styleFlags mov ds:[di].SEH_flags, cx common: mov destStyle, ax ;*** copy the base style mov ax, oldBaseStyle ;ax = base style call CopyStyle ;ax = base style (in dest) mov_tr bx, ax call Load_dssi_destStyle call ObjMarkDirty mov ax, destStyle call ChunkArrayElementToPtr mov ds:[di].SEH_baseStyle, bx mov destCopyFromStyle, bx ;*** copy attributes from source to dest attrLoop: mov ax, CA_NULL_ELEMENT call LockLoopAttrArray call Load_dssi_sourceStyle mov ax, styleToChange call ChunkArrayElementToPtr add di, attrCounter2 mov ax, ds:[di].SEH_attrTokens ;ax = source element ; pass base style of style being copied as old base style push styleToChange mov dx, oldBaseStyle mov styleToChange, dx clr dx call CopyElement ;ax = element in dest space pop styleToChange lea di, changeAttrs add di, attrCounter2 mov ss:[di], ax call UnlockLoopAttrArray jnz attrLoop ; We have now copied the attribute elements to the destination space. ; If the destination space and the attribute elements are different ; then we need to change the style call Load_dssi_destStyle mov ax, destStyle call ChunkArrayElementToPtr ;ds:di = dest style mov cx, attrTotal clr dx ;dx = differ flag lea bx, changeAttrs copyOrCompareLoop: mov ax, ss:[bx] tst createdNew jnz storeAttr tst fromTransfer jnz compare ; going to transfer, just copy the tokens storeAttr: mov ds:[di].SEH_attrTokens, ax jmp common2 ; going to object, store the tokens in changeAttrs compare: cmp ax, ds:[di].SEH_attrTokens jz common2 inc dx common2: add bx, size word add di, size word loop copyOrCompareLoop tst fromTransfer jz afterChangeStyle tst createdNew jnz afterChangeStyle tst dx jz decRefCountLoop ; we're copying from the transfer -- set the sucker mov ax, destStyle xchg ax, styleToChange push ax call ChangeStyle pop styleToChange decRefCountLoop: mov ax, CA_NULL_ELEMENT call LockLoopAttrArray ;ds:si = attr array ;ds:di = element, cx = size ;ax = change element lea di, changeAttrs add di, attrCounter2 mov ax, ss:[di] ;ax = old attribute token call Load_dssi_destAttr clr bx call ElementArrayRemoveReference call UnlockLoopAttrArray jnz decRefCountLoop afterChangeStyle: mov ax, destStyle addOpt: mov bx, OPT_STYLE_ARRAY_CHUNK mov cx, styleToChange clr dx call AddOpt done: pop styleToChange, destStyle, createdNew, oldBaseStyle .leave ret CopyStyle endp COMMENT @---------------------------------------------------------------------- FUNCTION: CopyElement DESCRIPTION: Copy an style from one attribute space to another. This *IS NOT* called recusrively. This adds a reference for the element in the destination space. CALLED BY: INTERNAL PASS: ss:bp - inherited variables ax - element # to copy (source space) dx - non-zero if styleToChange actually holds an attribute token styleToChange - style element to be based on in source space destStyle - style for element to be based on in destination space destCopyFromStyle - style to copy elements from in destination space attrCounter2 - offset of attribute array to work on fromTransfer - set if copying *from* transfer space changeDestStyles - set to force the source's definition of a style to the destination optBlock - optimization block RETURN: ax - element token in destination space DESTROYED: bx, cx, dx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/15/92 Initial version ------------------------------------------------------------------------------@ CopyElement proc near STYLE_COPY_LOCALS .enter inherit far ; if we are not forcing the source's views to the destination then ; we need to merge stuff tst fromTransfer jz noMerge tst changeDestStyles jnz noMerge cmp destCopyFromStyle, CA_NULL_ELEMENT jz noMerge ; copy the element to transfer mov bx, -2 ;fake base style for element call LowLevelCopyElement ;ax = style in dest (TARGET) ; get the OLD base element and temporarily add it to the destination push ax ;save TARGET mov ax, styleToChange tst dx jnz 10$ call Load_dssi_sourceStyle call ElementToPtrCheckNull jnc 20$ add di, attrCounter2 mov ax, ds:[di].SEH_attrTokens ;ax = old element in source 10$: mov bx, destCopyFromStyle ;base style for element call LowLevelCopyElement ;ax = old element in dest 20$: push ax ;push OLD call Load_dssi_destStyle mov ax, destCopyFromStyle call ChunkArrayElementToPtr add di, attrCounter2 mov ax, ds:[di].SEH_attrTokens ;ax = NEW mov_tr cx, ax ;cx = NEW pop ax ;ax = OLD pop bx ;bx = TARGET call MergeToken ; remove OLD (which we temporarily added) push bx call Load_dssi_destAttr clr bx cmp ax, CA_NULL_ELEMENT jz noRemoveOld call ElementArrayRemoveReference noRemoveOld: pop ax ; change target to have the correct base element call ChunkArrayElementToPtr mov bx, destStyle mov ds:[di].SEH_baseStyle, bx clr bx ;no callback call ElementArrayElementChanged ;ax possibly changed done: .leave ret noMerge: mov bx, destStyle call LowLevelCopyElement ;ax = style in dest jmp done CopyElement endp COMMENT @---------------------------------------------------------------------- FUNCTION: LowLevelCopyElement DESCRIPTION: Copy an element This adds a reference for the element in the destination space. CALLED BY: INTERNAL PASS: ss:bp - inherited variables ax - element # to copy (source space) bx - style for element attrCounter2 - offset of attribute array to work on RETURN: ax - element token in destination space DESTROYED: bx, cx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 1/15/92 Initial version ------------------------------------------------------------------------------@ LowLevelCopyElement proc near uses dx STYLE_COPY_LOCALS .enter inherit far ; get the source element into a buffer call Load_dssi_destAttr ;dssi = dest movdw cxdx, dssi ;cxdx = dest call Load_dssi_sourceAttr ;dssi = source mov di, STYLE_SHEET_MAX_ELEMENT_SIZE + 200 call ThreadBorrowStackSpace push di push bp sub sp, STYLE_SHEET_MAX_ELEMENT_SIZE mov bp, sp pushdw cxdx ;save dest array EC < cmp ax, CA_NULL_ELEMENT > EC < ERROR_Z STYLE_SHEET_CANNOT_COPY_NULL_ELEMENT > call ElementToPtrCheckNull ;cx = size EC < cmp cx, STYLE_SHEET_MAX_ELEMENT_SIZE > EC < ERROR_A STYLE_SHEET_ELEMENT_IS_TOO_LARGE > mov si, di ;ds:si = source segmov es, ss mov di, bp ;es:di = dest push cx rep movsb pop ax ;ax = size ; add the element in the destination (after setting the style) mov es:[bp].SSEH_style, bx popdw dssi ;dssi = dest array movdw cxdx, ssbp ;cx:dx = element clr bx call ElementArrayAddElement ;ax = token add sp, STYLE_SHEET_MAX_ELEMENT_SIZE pop bp pop di call ThreadReturnStackSpace call DerefStyleLocals .leave ret LowLevelCopyElement endp ;--- Load_dssi_sourceStyle proc near STYLE_COPY_LOCALS .enter inherit far tst fromTransfer jnz from GOTO Load_dssi_styleArray from: .leave FALL_THRU Load_dssi_xferStyleArray Load_dssi_sourceStyle endp ;--- Load_dssi_xferStyleArray proc near STYLE_LOCALS .enter inherit far movdw dssi, xferStyleArray .leave ret Load_dssi_xferStyleArray endp ;--- Load_dssi_destStyle proc near STYLE_COPY_LOCALS .enter inherit far tst fromTransfer jnz from GOTO Load_dssi_xferStyleArray from: .leave GOTO Load_dssi_styleArray Load_dssi_destStyle endp ;--- Load_dssi_sourceAttr proc near STYLE_COPY_LOCALS .enter inherit far tst fromTransfer jnz from GOTO Load_dssi_attrArray from: .leave FALL_THRU Load_dssi_xferAttrArray Load_dssi_sourceAttr endp ;--- Load_dssi_xferAttrArray proc near STYLE_LOCALS .enter inherit far movdw dssi, xferAttrArray .leave ret Load_dssi_xferAttrArray endp ;--- Load_dssi_destAttr proc near STYLE_COPY_LOCALS .enter inherit far tst fromTransfer jnz from GOTO Load_dssi_xferAttrArray from: .leave GOTO Load_dssi_attrArray Load_dssi_destAttr endp COMMENT @---------------------------------------------------------------------- FUNCTION: LookupOpt DESCRIPTION: Look for a specific entry in the optimization block CALLED BY: INTERNAL PASS: ax - source token to look for bx - chunk to look in dx - source reference ss:bp - inherited variables RETURN: carry - set if found ax - token in destination space (in found) else unchanged DESTROYED: cx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 2/14/92 Initial version ------------------------------------------------------------------------------@ LookupOpt proc near STYLE_COPY_LOCALS .enter inherit far if OPTIMIZE_STYLE_COPY mov di, bx mov bx, optBlock tst bx jz exit push ax call MemLock mov es, ax ;*es:di = chunk pop ax mov di, es:[di] cmp di, -1 jz notFound ChunkSizePtr es, di, cx searchLoop: scasw jz maybeFound next: add di, (size OptEntry) - (size word) sub cx, size OptEntry jnz searchLoop notFound: clc jmp done maybeFound: cmp dx, es:[di-2].OE_sourceRef jnz next mov ax, es:[di-2].OE_destToken stc done: call MemUnlock exit: else clc endif .leave ret LookupOpt endp COMMENT @---------------------------------------------------------------------- FUNCTION: AddOpt DESCRIPTION: Add a source-dest pair to the optimization block CALLED BY: INTERNAL PASS: ax - destination token bx - chunk to look in cx - source token dx - source reference ss:bp - inherited variables RETURN: none DESTROYED: bx, si, di, ds, es REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 2/14/92 Initial version ------------------------------------------------------------------------------@ AddOpt proc near STYLE_COPY_LOCALS .enter inherit far if OPTIMIZE_STYLE_COPY push ax, cx mov si, bx mov bx, optBlock tst bx jnz haveOptBlock ; allocate an optimization block mov ax, LMEM_TYPE_GENERAL clr cx call MemAllocLMem mov optBlock, bx call MemLock mov ds, ax call LMemAlloc EC < cmp ax, OPT_STYLE_ARRAY_CHUNK > EC < ERROR_NZ STYLE_SHEET_WRONG_CHUNK_ALLOCATED > call LMemAlloc EC < cmp ax, OPT_ATTR_ARRAY_CHUNK > EC < ERROR_NZ STYLE_SHEET_WRONG_CHUNK_ALLOCATED > call LMemAlloc call LMemAlloc call LMemAlloc jmp common haveOptBlock: call MemLock mov ds, ax common: ; insert an entry at the front mov ax, si ;ax = chunk clr bx mov cx, size OptEntry call LMemInsertAt ; fill it in mov si, ds:[si] pop ax, cx mov ds:[si].OE_destToken, ax mov ds:[si].OE_sourceRef, dx mov ds:[si].OE_sourceToken, cx mov bx, optBlock call MemUnlock endif .leave ret AddOpt endp ManipCode ends
20.650195
80
0.667758
4a3b5e30a80a1ac4ec912c7d81803705893e4c43
239
asm
Assembly
hidecpu2/src/test/resources/data_indirect.asm
mmastrac/oblivious-cpu
bc8e7925708d74a3c6e220c4e4a29f58fd835c0c
[ "Apache-2.0" ]
14
2016-12-13T16:38:16.000Z
2020-09-22T01:49:09.000Z
hidecpu2/src/test/resources/data_indirect.asm
mmastrac/oblivious-cpu
bc8e7925708d74a3c6e220c4e4a29f58fd835c0c
[ "Apache-2.0" ]
4
2017-03-28T18:07:38.000Z
2020-10-12T17:35:37.000Z
hidecpu2/src/test/resources/data_indirect.asm
mmastrac/oblivious-cpu
bc8e7925708d74a3c6e220c4e4a29f58fd835c0c
[ "Apache-2.0" ]
3
2020-05-22T14:44:20.000Z
2021-09-23T18:42:42.000Z
mov r0, pointers mov r2, 4 loop: mov r1, [r0] mov r1, [r1] add r3, r1 add r0, 1 loop r2, loop sub r3, 1 # 10+20+40+30-1=99 mov [out], r3 halt .data out: data 0 pointers: data p1, p2, p3, p4 p1: data 10 p2: data 20 p4: data 40 p3: data 30
11.95
29
0.640167
5a9473d36ece08b8113ea68cf2b30d6738671bca
42,677
asm
Assembly
xv6-l/mkdir.asm
xsuler/osPlayground
da1b828540b178fd9dc154539616af7f3431da45
[ "MIT" ]
null
null
null
xv6-l/mkdir.asm
xsuler/osPlayground
da1b828540b178fd9dc154539616af7f3431da45
[ "MIT" ]
null
null
null
xv6-l/mkdir.asm
xsuler/osPlayground
da1b828540b178fd9dc154539616af7f3431da45
[ "MIT" ]
null
null
null
_mkdir: file format elf32-i386 Disassembly of section .text: 00000000 <main>: #include "stat.h" #include "user.h" int main(int argc, char *argv[]) { 0: 8d 4c 24 04 lea 0x4(%esp),%ecx 4: 83 e4 f0 and $0xfffffff0,%esp 7: ff 71 fc pushl -0x4(%ecx) a: 55 push %ebp b: 89 e5 mov %esp,%ebp d: 57 push %edi e: bf 01 00 00 00 mov $0x1,%edi 13: 56 push %esi 14: 53 push %ebx 15: 51 push %ecx 16: 83 ec 08 sub $0x8,%esp 19: 8b 59 04 mov 0x4(%ecx),%ebx 1c: 8b 31 mov (%ecx),%esi 1e: 83 c3 04 add $0x4,%ebx int i; if(argc < 2){ 21: 83 fe 01 cmp $0x1,%esi 24: 7e 3e jle 64 <main+0x64> 26: 8d 76 00 lea 0x0(%esi),%esi 29: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi printf(2, "Usage: mkdir files...\n"); exit(); } for(i = 1; i < argc; i++){ if(mkdir(argv[i]) < 0){ 30: 83 ec 0c sub $0xc,%esp 33: ff 33 pushl (%ebx) 35: e8 ff 02 00 00 call 339 <mkdir> 3a: 83 c4 10 add $0x10,%esp 3d: 85 c0 test %eax,%eax 3f: 78 0f js 50 <main+0x50> for(i = 1; i < argc; i++){ 41: 83 c7 01 add $0x1,%edi 44: 83 c3 04 add $0x4,%ebx 47: 39 fe cmp %edi,%esi 49: 75 e5 jne 30 <main+0x30> printf(2, "mkdir: %s failed to create\n", argv[i]); break; } } exit(); 4b: e8 81 02 00 00 call 2d1 <exit> printf(2, "mkdir: %s failed to create\n", argv[i]); 50: 50 push %eax 51: ff 33 pushl (%ebx) 53: 68 ff 07 00 00 push $0x7ff 58: 6a 02 push $0x2 5a: e8 21 04 00 00 call 480 <printf> break; 5f: 83 c4 10 add $0x10,%esp 62: eb e7 jmp 4b <main+0x4b> printf(2, "Usage: mkdir files...\n"); 64: 52 push %edx 65: 52 push %edx 66: 68 e8 07 00 00 push $0x7e8 6b: 6a 02 push $0x2 6d: e8 0e 04 00 00 call 480 <printf> exit(); 72: e8 5a 02 00 00 call 2d1 <exit> 77: 66 90 xchg %ax,%ax 79: 66 90 xchg %ax,%ax 7b: 66 90 xchg %ax,%ax 7d: 66 90 xchg %ax,%ax 7f: 90 nop 00000080 <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 80: 55 push %ebp char *os; os = s; while((*s++ = *t++) != 0) 81: 31 d2 xor %edx,%edx { 83: 89 e5 mov %esp,%ebp 85: 53 push %ebx 86: 8b 45 08 mov 0x8(%ebp),%eax 89: 8b 5d 0c mov 0xc(%ebp),%ebx 8c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi while((*s++ = *t++) != 0) 90: 0f b6 0c 13 movzbl (%ebx,%edx,1),%ecx 94: 88 0c 10 mov %cl,(%eax,%edx,1) 97: 83 c2 01 add $0x1,%edx 9a: 84 c9 test %cl,%cl 9c: 75 f2 jne 90 <strcpy+0x10> ; return os; } 9e: 5b pop %ebx 9f: 5d pop %ebp a0: c3 ret a1: eb 0d jmp b0 <strcmp> a3: 90 nop a4: 90 nop a5: 90 nop a6: 90 nop a7: 90 nop a8: 90 nop a9: 90 nop aa: 90 nop ab: 90 nop ac: 90 nop ad: 90 nop ae: 90 nop af: 90 nop 000000b0 <strcmp>: int strcmp(const char *p, const char *q) { b0: 55 push %ebp b1: 89 e5 mov %esp,%ebp b3: 56 push %esi b4: 53 push %ebx b5: 8b 5d 08 mov 0x8(%ebp),%ebx b8: 8b 75 0c mov 0xc(%ebp),%esi while(*p && *p == *q) bb: 0f b6 13 movzbl (%ebx),%edx be: 0f b6 0e movzbl (%esi),%ecx c1: 84 d2 test %dl,%dl c3: 74 1e je e3 <strcmp+0x33> c5: b8 01 00 00 00 mov $0x1,%eax ca: 38 ca cmp %cl,%dl cc: 74 09 je d7 <strcmp+0x27> ce: eb 20 jmp f0 <strcmp+0x40> d0: 83 c0 01 add $0x1,%eax d3: 38 ca cmp %cl,%dl d5: 75 19 jne f0 <strcmp+0x40> d7: 0f b6 14 03 movzbl (%ebx,%eax,1),%edx db: 0f b6 0c 06 movzbl (%esi,%eax,1),%ecx df: 84 d2 test %dl,%dl e1: 75 ed jne d0 <strcmp+0x20> e3: 31 c0 xor %eax,%eax p++, q++; return (uchar)*p - (uchar)*q; } e5: 5b pop %ebx e6: 5e pop %esi return (uchar)*p - (uchar)*q; e7: 29 c8 sub %ecx,%eax } e9: 5d pop %ebp ea: c3 ret eb: 90 nop ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi f0: 0f b6 c2 movzbl %dl,%eax f3: 5b pop %ebx f4: 5e pop %esi return (uchar)*p - (uchar)*q; f5: 29 c8 sub %ecx,%eax } f7: 5d pop %ebp f8: c3 ret f9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 00000100 <strlen>: uint strlen(char *s) { 100: 55 push %ebp 101: 89 e5 mov %esp,%ebp 103: 8b 4d 08 mov 0x8(%ebp),%ecx int n; for(n = 0; s[n]; n++) 106: 80 39 00 cmpb $0x0,(%ecx) 109: 74 15 je 120 <strlen+0x20> 10b: 31 d2 xor %edx,%edx 10d: 8d 76 00 lea 0x0(%esi),%esi 110: 83 c2 01 add $0x1,%edx 113: 80 3c 11 00 cmpb $0x0,(%ecx,%edx,1) 117: 89 d0 mov %edx,%eax 119: 75 f5 jne 110 <strlen+0x10> ; return n; } 11b: 5d pop %ebp 11c: c3 ret 11d: 8d 76 00 lea 0x0(%esi),%esi for(n = 0; s[n]; n++) 120: 31 c0 xor %eax,%eax } 122: 5d pop %ebp 123: c3 ret 124: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 12a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 00000130 <memset>: void* memset(void *dst, int c, uint n) { 130: 55 push %ebp 131: 89 e5 mov %esp,%ebp 133: 57 push %edi 134: 8b 55 08 mov 0x8(%ebp),%edx } static inline void stosb(void *addr, int data, int cnt) { asm volatile("cld; rep stosb" : 137: 8b 4d 10 mov 0x10(%ebp),%ecx 13a: 8b 45 0c mov 0xc(%ebp),%eax 13d: 89 d7 mov %edx,%edi 13f: fc cld 140: f3 aa rep stos %al,%es:(%edi) stosb(dst, c, n); return dst; } 142: 89 d0 mov %edx,%eax 144: 5f pop %edi 145: 5d pop %ebp 146: c3 ret 147: 89 f6 mov %esi,%esi 149: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000150 <strchr>: char* strchr(const char *s, char c) { 150: 55 push %ebp 151: 89 e5 mov %esp,%ebp 153: 53 push %ebx 154: 8b 45 08 mov 0x8(%ebp),%eax 157: 8b 55 0c mov 0xc(%ebp),%edx for(; *s; s++) 15a: 0f b6 18 movzbl (%eax),%ebx 15d: 84 db test %bl,%bl 15f: 74 1d je 17e <strchr+0x2e> 161: 89 d1 mov %edx,%ecx if(*s == c) 163: 38 d3 cmp %dl,%bl 165: 75 0d jne 174 <strchr+0x24> 167: eb 17 jmp 180 <strchr+0x30> 169: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 170: 38 ca cmp %cl,%dl 172: 74 0c je 180 <strchr+0x30> for(; *s; s++) 174: 83 c0 01 add $0x1,%eax 177: 0f b6 10 movzbl (%eax),%edx 17a: 84 d2 test %dl,%dl 17c: 75 f2 jne 170 <strchr+0x20> return (char*)s; return 0; 17e: 31 c0 xor %eax,%eax } 180: 5b pop %ebx 181: 5d pop %ebp 182: c3 ret 183: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 189: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000190 <gets>: char* gets(char *buf, int max) { 190: 55 push %ebp 191: 89 e5 mov %esp,%ebp 193: 57 push %edi 194: 56 push %esi int i, cc; char c; for(i=0; i+1 < max; ){ 195: 31 f6 xor %esi,%esi { 197: 53 push %ebx 198: 89 f3 mov %esi,%ebx 19a: 83 ec 1c sub $0x1c,%esp 19d: 8b 7d 08 mov 0x8(%ebp),%edi for(i=0; i+1 < max; ){ 1a0: eb 2f jmp 1d1 <gets+0x41> 1a2: 8d b6 00 00 00 00 lea 0x0(%esi),%esi cc = read(0, &c, 1); 1a8: 83 ec 04 sub $0x4,%esp 1ab: 8d 45 e7 lea -0x19(%ebp),%eax 1ae: 6a 01 push $0x1 1b0: 50 push %eax 1b1: 6a 00 push $0x0 1b3: e8 31 01 00 00 call 2e9 <read> if(cc < 1) 1b8: 83 c4 10 add $0x10,%esp 1bb: 85 c0 test %eax,%eax 1bd: 7e 1c jle 1db <gets+0x4b> break; buf[i++] = c; 1bf: 0f b6 45 e7 movzbl -0x19(%ebp),%eax 1c3: 83 c7 01 add $0x1,%edi 1c6: 88 47 ff mov %al,-0x1(%edi) if(c == '\n' || c == '\r') 1c9: 3c 0a cmp $0xa,%al 1cb: 74 23 je 1f0 <gets+0x60> 1cd: 3c 0d cmp $0xd,%al 1cf: 74 1f je 1f0 <gets+0x60> for(i=0; i+1 < max; ){ 1d1: 83 c3 01 add $0x1,%ebx 1d4: 89 fe mov %edi,%esi 1d6: 3b 5d 0c cmp 0xc(%ebp),%ebx 1d9: 7c cd jl 1a8 <gets+0x18> 1db: 89 f3 mov %esi,%ebx break; } buf[i] = '\0'; return buf; } 1dd: 8b 45 08 mov 0x8(%ebp),%eax buf[i] = '\0'; 1e0: c6 03 00 movb $0x0,(%ebx) } 1e3: 8d 65 f4 lea -0xc(%ebp),%esp 1e6: 5b pop %ebx 1e7: 5e pop %esi 1e8: 5f pop %edi 1e9: 5d pop %ebp 1ea: c3 ret 1eb: 90 nop 1ec: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 1f0: 8b 75 08 mov 0x8(%ebp),%esi 1f3: 8b 45 08 mov 0x8(%ebp),%eax 1f6: 01 de add %ebx,%esi 1f8: 89 f3 mov %esi,%ebx buf[i] = '\0'; 1fa: c6 03 00 movb $0x0,(%ebx) } 1fd: 8d 65 f4 lea -0xc(%ebp),%esp 200: 5b pop %ebx 201: 5e pop %esi 202: 5f pop %edi 203: 5d pop %ebp 204: c3 ret 205: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 209: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000210 <stat>: int stat(char *n, struct stat *st) { 210: 55 push %ebp 211: 89 e5 mov %esp,%ebp 213: 56 push %esi 214: 53 push %ebx int fd; int r; fd = open(n, O_RDONLY); 215: 83 ec 08 sub $0x8,%esp 218: 6a 00 push $0x0 21a: ff 75 08 pushl 0x8(%ebp) 21d: e8 ef 00 00 00 call 311 <open> if(fd < 0) 222: 83 c4 10 add $0x10,%esp 225: 85 c0 test %eax,%eax 227: 78 27 js 250 <stat+0x40> return -1; r = fstat(fd, st); 229: 83 ec 08 sub $0x8,%esp 22c: ff 75 0c pushl 0xc(%ebp) 22f: 89 c3 mov %eax,%ebx 231: 50 push %eax 232: e8 f2 00 00 00 call 329 <fstat> close(fd); 237: 89 1c 24 mov %ebx,(%esp) r = fstat(fd, st); 23a: 89 c6 mov %eax,%esi close(fd); 23c: e8 b8 00 00 00 call 2f9 <close> return r; 241: 83 c4 10 add $0x10,%esp } 244: 8d 65 f8 lea -0x8(%ebp),%esp 247: 89 f0 mov %esi,%eax 249: 5b pop %ebx 24a: 5e pop %esi 24b: 5d pop %ebp 24c: c3 ret 24d: 8d 76 00 lea 0x0(%esi),%esi return -1; 250: be ff ff ff ff mov $0xffffffff,%esi 255: eb ed jmp 244 <stat+0x34> 257: 89 f6 mov %esi,%esi 259: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 00000260 <atoi>: int atoi(const char *s) { 260: 55 push %ebp 261: 89 e5 mov %esp,%ebp 263: 53 push %ebx 264: 8b 4d 08 mov 0x8(%ebp),%ecx int n; n = 0; while('0' <= *s && *s <= '9') 267: 0f be 11 movsbl (%ecx),%edx 26a: 8d 42 d0 lea -0x30(%edx),%eax 26d: 3c 09 cmp $0x9,%al n = 0; 26f: b8 00 00 00 00 mov $0x0,%eax while('0' <= *s && *s <= '9') 274: 77 1f ja 295 <atoi+0x35> 276: 8d 76 00 lea 0x0(%esi),%esi 279: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi n = n*10 + *s++ - '0'; 280: 83 c1 01 add $0x1,%ecx 283: 8d 04 80 lea (%eax,%eax,4),%eax 286: 8d 44 42 d0 lea -0x30(%edx,%eax,2),%eax while('0' <= *s && *s <= '9') 28a: 0f be 11 movsbl (%ecx),%edx 28d: 8d 5a d0 lea -0x30(%edx),%ebx 290: 80 fb 09 cmp $0x9,%bl 293: 76 eb jbe 280 <atoi+0x20> return n; } 295: 5b pop %ebx 296: 5d pop %ebp 297: c3 ret 298: 90 nop 299: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi 000002a0 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 2a0: 55 push %ebp 2a1: 89 e5 mov %esp,%ebp 2a3: 57 push %edi 2a4: 8b 55 10 mov 0x10(%ebp),%edx 2a7: 8b 45 08 mov 0x8(%ebp),%eax 2aa: 56 push %esi 2ab: 8b 75 0c mov 0xc(%ebp),%esi char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 2ae: 85 d2 test %edx,%edx 2b0: 7e 13 jle 2c5 <memmove+0x25> 2b2: 01 c2 add %eax,%edx dst = vdst; 2b4: 89 c7 mov %eax,%edi 2b6: 8d 76 00 lea 0x0(%esi),%esi 2b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi *dst++ = *src++; 2c0: a4 movsb %ds:(%esi),%es:(%edi) while(n-- > 0) 2c1: 39 fa cmp %edi,%edx 2c3: 75 fb jne 2c0 <memmove+0x20> return vdst; } 2c5: 5e pop %esi 2c6: 5f pop %edi 2c7: 5d pop %ebp 2c8: c3 ret 000002c9 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 2c9: b8 01 00 00 00 mov $0x1,%eax 2ce: cd 40 int $0x40 2d0: c3 ret 000002d1 <exit>: SYSCALL(exit) 2d1: b8 02 00 00 00 mov $0x2,%eax 2d6: cd 40 int $0x40 2d8: c3 ret 000002d9 <wait>: SYSCALL(wait) 2d9: b8 03 00 00 00 mov $0x3,%eax 2de: cd 40 int $0x40 2e0: c3 ret 000002e1 <pipe>: SYSCALL(pipe) 2e1: b8 04 00 00 00 mov $0x4,%eax 2e6: cd 40 int $0x40 2e8: c3 ret 000002e9 <read>: SYSCALL(read) 2e9: b8 05 00 00 00 mov $0x5,%eax 2ee: cd 40 int $0x40 2f0: c3 ret 000002f1 <write>: SYSCALL(write) 2f1: b8 10 00 00 00 mov $0x10,%eax 2f6: cd 40 int $0x40 2f8: c3 ret 000002f9 <close>: SYSCALL(close) 2f9: b8 15 00 00 00 mov $0x15,%eax 2fe: cd 40 int $0x40 300: c3 ret 00000301 <kill>: SYSCALL(kill) 301: b8 06 00 00 00 mov $0x6,%eax 306: cd 40 int $0x40 308: c3 ret 00000309 <exec>: SYSCALL(exec) 309: b8 07 00 00 00 mov $0x7,%eax 30e: cd 40 int $0x40 310: c3 ret 00000311 <open>: SYSCALL(open) 311: b8 0f 00 00 00 mov $0xf,%eax 316: cd 40 int $0x40 318: c3 ret 00000319 <mknod>: SYSCALL(mknod) 319: b8 11 00 00 00 mov $0x11,%eax 31e: cd 40 int $0x40 320: c3 ret 00000321 <unlink>: SYSCALL(unlink) 321: b8 12 00 00 00 mov $0x12,%eax 326: cd 40 int $0x40 328: c3 ret 00000329 <fstat>: SYSCALL(fstat) 329: b8 08 00 00 00 mov $0x8,%eax 32e: cd 40 int $0x40 330: c3 ret 00000331 <link>: SYSCALL(link) 331: b8 13 00 00 00 mov $0x13,%eax 336: cd 40 int $0x40 338: c3 ret 00000339 <mkdir>: SYSCALL(mkdir) 339: b8 14 00 00 00 mov $0x14,%eax 33e: cd 40 int $0x40 340: c3 ret 00000341 <chdir>: SYSCALL(chdir) 341: b8 09 00 00 00 mov $0x9,%eax 346: cd 40 int $0x40 348: c3 ret 00000349 <dup>: SYSCALL(dup) 349: b8 0a 00 00 00 mov $0xa,%eax 34e: cd 40 int $0x40 350: c3 ret 00000351 <getpid>: SYSCALL(getpid) 351: b8 0b 00 00 00 mov $0xb,%eax 356: cd 40 int $0x40 358: c3 ret 00000359 <sbrk>: SYSCALL(sbrk) 359: b8 0c 00 00 00 mov $0xc,%eax 35e: cd 40 int $0x40 360: c3 ret 00000361 <sleep>: SYSCALL(sleep) 361: b8 0d 00 00 00 mov $0xd,%eax 366: cd 40 int $0x40 368: c3 ret 00000369 <uptime>: SYSCALL(uptime) 369: b8 0e 00 00 00 mov $0xe,%eax 36e: cd 40 int $0x40 370: c3 ret 00000371 <trace>: SYSCALL(trace) 371: b8 16 00 00 00 mov $0x16,%eax 376: cd 40 int $0x40 378: c3 ret 00000379 <getsharem>: SYSCALL(getsharem) 379: b8 17 00 00 00 mov $0x17,%eax 37e: cd 40 int $0x40 380: c3 ret 00000381 <releasesharem>: SYSCALL(releasesharem) 381: b8 18 00 00 00 mov $0x18,%eax 386: cd 40 int $0x40 388: c3 ret 00000389 <split>: SYSCALL(split) 389: b8 19 00 00 00 mov $0x19,%eax 38e: cd 40 int $0x40 390: c3 ret 00000391 <memo>: SYSCALL(memo) 391: b8 1a 00 00 00 mov $0x1a,%eax 396: cd 40 int $0x40 398: c3 ret 00000399 <getmemo>: SYSCALL(getmemo) 399: b8 1b 00 00 00 mov $0x1b,%eax 39e: cd 40 int $0x40 3a0: c3 ret 000003a1 <setmemo>: SYSCALL(setmemo) 3a1: b8 1c 00 00 00 mov $0x1c,%eax 3a6: cd 40 int $0x40 3a8: c3 ret 000003a9 <att>: SYSCALL(att) 3a9: b8 1d 00 00 00 mov $0x1d,%eax 3ae: cd 40 int $0x40 3b0: c3 ret 3b1: 66 90 xchg %ax,%ax 3b3: 66 90 xchg %ax,%ax 3b5: 66 90 xchg %ax,%ax 3b7: 66 90 xchg %ax,%ax 3b9: 66 90 xchg %ax,%ax 3bb: 66 90 xchg %ax,%ax 3bd: 66 90 xchg %ax,%ax 3bf: 90 nop 000003c0 <printint>: write(fd, &c, 1); } static void printint(int fd, int xx, int base, int sgn) { 3c0: 55 push %ebp 3c1: 89 e5 mov %esp,%ebp 3c3: 57 push %edi 3c4: 56 push %esi 3c5: 53 push %ebx uint x; neg = 0; if(sgn && xx < 0){ neg = 1; x = -xx; 3c6: 89 d3 mov %edx,%ebx { 3c8: 83 ec 3c sub $0x3c,%esp 3cb: 89 45 bc mov %eax,-0x44(%ebp) if(sgn && xx < 0){ 3ce: 85 d2 test %edx,%edx 3d0: 0f 89 92 00 00 00 jns 468 <printint+0xa8> 3d6: f6 45 08 01 testb $0x1,0x8(%ebp) 3da: 0f 84 88 00 00 00 je 468 <printint+0xa8> neg = 1; 3e0: c7 45 c0 01 00 00 00 movl $0x1,-0x40(%ebp) x = -xx; 3e7: f7 db neg %ebx } else { x = xx; } i = 0; 3e9: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 3f0: 8d 75 d7 lea -0x29(%ebp),%esi 3f3: eb 08 jmp 3fd <printint+0x3d> 3f5: 8d 76 00 lea 0x0(%esi),%esi do{ buf[i++] = digits[x % base]; 3f8: 89 7d c4 mov %edi,-0x3c(%ebp) }while((x /= base) != 0); 3fb: 89 c3 mov %eax,%ebx buf[i++] = digits[x % base]; 3fd: 89 d8 mov %ebx,%eax 3ff: 31 d2 xor %edx,%edx 401: 8b 7d c4 mov -0x3c(%ebp),%edi 404: f7 f1 div %ecx 406: 83 c7 01 add $0x1,%edi 409: 0f b6 92 24 08 00 00 movzbl 0x824(%edx),%edx 410: 88 14 3e mov %dl,(%esi,%edi,1) }while((x /= base) != 0); 413: 39 d9 cmp %ebx,%ecx 415: 76 e1 jbe 3f8 <printint+0x38> if(neg) 417: 8b 45 c0 mov -0x40(%ebp),%eax 41a: 85 c0 test %eax,%eax 41c: 74 0d je 42b <printint+0x6b> buf[i++] = '-'; 41e: c6 44 3d d8 2d movb $0x2d,-0x28(%ebp,%edi,1) 423: ba 2d 00 00 00 mov $0x2d,%edx buf[i++] = digits[x % base]; 428: 89 7d c4 mov %edi,-0x3c(%ebp) 42b: 8b 45 c4 mov -0x3c(%ebp),%eax 42e: 8b 7d bc mov -0x44(%ebp),%edi 431: 8d 5c 05 d7 lea -0x29(%ebp,%eax,1),%ebx 435: eb 0f jmp 446 <printint+0x86> 437: 89 f6 mov %esi,%esi 439: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 440: 0f b6 13 movzbl (%ebx),%edx 443: 83 eb 01 sub $0x1,%ebx write(fd, &c, 1); 446: 83 ec 04 sub $0x4,%esp 449: 88 55 d7 mov %dl,-0x29(%ebp) 44c: 6a 01 push $0x1 44e: 56 push %esi 44f: 57 push %edi 450: e8 9c fe ff ff call 2f1 <write> while(--i >= 0) 455: 83 c4 10 add $0x10,%esp 458: 39 de cmp %ebx,%esi 45a: 75 e4 jne 440 <printint+0x80> putc(fd, buf[i]); } 45c: 8d 65 f4 lea -0xc(%ebp),%esp 45f: 5b pop %ebx 460: 5e pop %esi 461: 5f pop %edi 462: 5d pop %ebp 463: c3 ret 464: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi neg = 0; 468: c7 45 c0 00 00 00 00 movl $0x0,-0x40(%ebp) 46f: e9 75 ff ff ff jmp 3e9 <printint+0x29> 474: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 47a: 8d bf 00 00 00 00 lea 0x0(%edi),%edi 00000480 <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 480: 55 push %ebp 481: 89 e5 mov %esp,%ebp 483: 57 push %edi 484: 56 push %esi 485: 53 push %ebx 486: 83 ec 2c sub $0x2c,%esp int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 489: 8b 75 0c mov 0xc(%ebp),%esi 48c: 0f b6 1e movzbl (%esi),%ebx 48f: 84 db test %bl,%bl 491: 0f 84 b9 00 00 00 je 550 <printf+0xd0> ap = (uint*)(void*)&fmt + 1; 497: 8d 45 10 lea 0x10(%ebp),%eax 49a: 83 c6 01 add $0x1,%esi write(fd, &c, 1); 49d: 8d 7d e7 lea -0x19(%ebp),%edi state = 0; 4a0: 31 d2 xor %edx,%edx ap = (uint*)(void*)&fmt + 1; 4a2: 89 45 d0 mov %eax,-0x30(%ebp) 4a5: eb 38 jmp 4df <printf+0x5f> 4a7: 89 f6 mov %esi,%esi 4a9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 4b0: 89 55 d4 mov %edx,-0x2c(%ebp) c = fmt[i] & 0xff; if(state == 0){ if(c == '%'){ state = '%'; 4b3: ba 25 00 00 00 mov $0x25,%edx if(c == '%'){ 4b8: 83 f8 25 cmp $0x25,%eax 4bb: 74 17 je 4d4 <printf+0x54> write(fd, &c, 1); 4bd: 83 ec 04 sub $0x4,%esp 4c0: 88 5d e7 mov %bl,-0x19(%ebp) 4c3: 6a 01 push $0x1 4c5: 57 push %edi 4c6: ff 75 08 pushl 0x8(%ebp) 4c9: e8 23 fe ff ff call 2f1 <write> 4ce: 8b 55 d4 mov -0x2c(%ebp),%edx } else { putc(fd, c); 4d1: 83 c4 10 add $0x10,%esp 4d4: 83 c6 01 add $0x1,%esi for(i = 0; fmt[i]; i++){ 4d7: 0f b6 5e ff movzbl -0x1(%esi),%ebx 4db: 84 db test %bl,%bl 4dd: 74 71 je 550 <printf+0xd0> c = fmt[i] & 0xff; 4df: 0f be cb movsbl %bl,%ecx 4e2: 0f b6 c3 movzbl %bl,%eax if(state == 0){ 4e5: 85 d2 test %edx,%edx 4e7: 74 c7 je 4b0 <printf+0x30> } } else if(state == '%'){ 4e9: 83 fa 25 cmp $0x25,%edx 4ec: 75 e6 jne 4d4 <printf+0x54> if(c == 'd'){ 4ee: 83 f8 64 cmp $0x64,%eax 4f1: 0f 84 99 00 00 00 je 590 <printf+0x110> printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 4f7: 81 e1 f7 00 00 00 and $0xf7,%ecx 4fd: 83 f9 70 cmp $0x70,%ecx 500: 74 5e je 560 <printf+0xe0> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 502: 83 f8 73 cmp $0x73,%eax 505: 0f 84 d5 00 00 00 je 5e0 <printf+0x160> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 50b: 83 f8 63 cmp $0x63,%eax 50e: 0f 84 8c 00 00 00 je 5a0 <printf+0x120> putc(fd, *ap); ap++; } else if(c == '%'){ 514: 83 f8 25 cmp $0x25,%eax 517: 0f 84 b3 00 00 00 je 5d0 <printf+0x150> write(fd, &c, 1); 51d: 83 ec 04 sub $0x4,%esp 520: c6 45 e7 25 movb $0x25,-0x19(%ebp) 524: 6a 01 push $0x1 526: 57 push %edi 527: ff 75 08 pushl 0x8(%ebp) 52a: e8 c2 fd ff ff call 2f1 <write> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); putc(fd, c); 52f: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 532: 83 c4 0c add $0xc,%esp 535: 6a 01 push $0x1 537: 83 c6 01 add $0x1,%esi 53a: 57 push %edi 53b: ff 75 08 pushl 0x8(%ebp) 53e: e8 ae fd ff ff call 2f1 <write> for(i = 0; fmt[i]; i++){ 543: 0f b6 5e ff movzbl -0x1(%esi),%ebx putc(fd, c); 547: 83 c4 10 add $0x10,%esp } state = 0; 54a: 31 d2 xor %edx,%edx for(i = 0; fmt[i]; i++){ 54c: 84 db test %bl,%bl 54e: 75 8f jne 4df <printf+0x5f> } } } 550: 8d 65 f4 lea -0xc(%ebp),%esp 553: 5b pop %ebx 554: 5e pop %esi 555: 5f pop %edi 556: 5d pop %ebp 557: c3 ret 558: 90 nop 559: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi printint(fd, *ap, 16, 0); 560: 83 ec 0c sub $0xc,%esp 563: b9 10 00 00 00 mov $0x10,%ecx 568: 6a 00 push $0x0 56a: 8b 5d d0 mov -0x30(%ebp),%ebx 56d: 8b 45 08 mov 0x8(%ebp),%eax 570: 8b 13 mov (%ebx),%edx 572: e8 49 fe ff ff call 3c0 <printint> ap++; 577: 89 d8 mov %ebx,%eax 579: 83 c4 10 add $0x10,%esp state = 0; 57c: 31 d2 xor %edx,%edx ap++; 57e: 83 c0 04 add $0x4,%eax 581: 89 45 d0 mov %eax,-0x30(%ebp) 584: e9 4b ff ff ff jmp 4d4 <printf+0x54> 589: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi printint(fd, *ap, 10, 1); 590: 83 ec 0c sub $0xc,%esp 593: b9 0a 00 00 00 mov $0xa,%ecx 598: 6a 01 push $0x1 59a: eb ce jmp 56a <printf+0xea> 59c: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi putc(fd, *ap); 5a0: 8b 5d d0 mov -0x30(%ebp),%ebx write(fd, &c, 1); 5a3: 83 ec 04 sub $0x4,%esp putc(fd, *ap); 5a6: 8b 03 mov (%ebx),%eax write(fd, &c, 1); 5a8: 6a 01 push $0x1 ap++; 5aa: 83 c3 04 add $0x4,%ebx write(fd, &c, 1); 5ad: 57 push %edi 5ae: ff 75 08 pushl 0x8(%ebp) putc(fd, *ap); 5b1: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 5b4: e8 38 fd ff ff call 2f1 <write> ap++; 5b9: 89 5d d0 mov %ebx,-0x30(%ebp) 5bc: 83 c4 10 add $0x10,%esp state = 0; 5bf: 31 d2 xor %edx,%edx 5c1: e9 0e ff ff ff jmp 4d4 <printf+0x54> 5c6: 8d 76 00 lea 0x0(%esi),%esi 5c9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi putc(fd, c); 5d0: 88 5d e7 mov %bl,-0x19(%ebp) write(fd, &c, 1); 5d3: 83 ec 04 sub $0x4,%esp 5d6: e9 5a ff ff ff jmp 535 <printf+0xb5> 5db: 90 nop 5dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi s = (char*)*ap; 5e0: 8b 45 d0 mov -0x30(%ebp),%eax 5e3: 8b 18 mov (%eax),%ebx ap++; 5e5: 83 c0 04 add $0x4,%eax 5e8: 89 45 d0 mov %eax,-0x30(%ebp) if(s == 0) 5eb: 85 db test %ebx,%ebx 5ed: 74 17 je 606 <printf+0x186> while(*s != 0){ 5ef: 0f b6 03 movzbl (%ebx),%eax state = 0; 5f2: 31 d2 xor %edx,%edx while(*s != 0){ 5f4: 84 c0 test %al,%al 5f6: 0f 84 d8 fe ff ff je 4d4 <printf+0x54> 5fc: 89 75 d4 mov %esi,-0x2c(%ebp) 5ff: 89 de mov %ebx,%esi 601: 8b 5d 08 mov 0x8(%ebp),%ebx 604: eb 1a jmp 620 <printf+0x1a0> s = "(null)"; 606: bb 1b 08 00 00 mov $0x81b,%ebx while(*s != 0){ 60b: 89 75 d4 mov %esi,-0x2c(%ebp) 60e: b8 28 00 00 00 mov $0x28,%eax 613: 89 de mov %ebx,%esi 615: 8b 5d 08 mov 0x8(%ebp),%ebx 618: 90 nop 619: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi write(fd, &c, 1); 620: 83 ec 04 sub $0x4,%esp s++; 623: 83 c6 01 add $0x1,%esi 626: 88 45 e7 mov %al,-0x19(%ebp) write(fd, &c, 1); 629: 6a 01 push $0x1 62b: 57 push %edi 62c: 53 push %ebx 62d: e8 bf fc ff ff call 2f1 <write> while(*s != 0){ 632: 0f b6 06 movzbl (%esi),%eax 635: 83 c4 10 add $0x10,%esp 638: 84 c0 test %al,%al 63a: 75 e4 jne 620 <printf+0x1a0> 63c: 8b 75 d4 mov -0x2c(%ebp),%esi state = 0; 63f: 31 d2 xor %edx,%edx 641: e9 8e fe ff ff jmp 4d4 <printf+0x54> 646: 66 90 xchg %ax,%ax 648: 66 90 xchg %ax,%ax 64a: 66 90 xchg %ax,%ax 64c: 66 90 xchg %ax,%ax 64e: 66 90 xchg %ax,%ax 00000650 <free>: static Header base; static Header *freep; void free(void *ap) { 650: 55 push %ebp Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 651: a1 dc 0a 00 00 mov 0xadc,%eax { 656: 89 e5 mov %esp,%ebp 658: 57 push %edi 659: 56 push %esi 65a: 53 push %ebx 65b: 8b 5d 08 mov 0x8(%ebp),%ebx 65e: 8b 10 mov (%eax),%edx bp = (Header*)ap - 1; 660: 8d 4b f8 lea -0x8(%ebx),%ecx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 663: 39 c8 cmp %ecx,%eax 665: 73 19 jae 680 <free+0x30> 667: 89 f6 mov %esi,%esi 669: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi 670: 39 d1 cmp %edx,%ecx 672: 72 14 jb 688 <free+0x38> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 674: 39 d0 cmp %edx,%eax 676: 73 10 jae 688 <free+0x38> { 678: 89 d0 mov %edx,%eax 67a: 8b 10 mov (%eax),%edx for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 67c: 39 c8 cmp %ecx,%eax 67e: 72 f0 jb 670 <free+0x20> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 680: 39 d0 cmp %edx,%eax 682: 72 f4 jb 678 <free+0x28> 684: 39 d1 cmp %edx,%ecx 686: 73 f0 jae 678 <free+0x28> break; if(bp + bp->s.size == p->s.ptr){ 688: 8b 73 fc mov -0x4(%ebx),%esi 68b: 8d 3c f1 lea (%ecx,%esi,8),%edi 68e: 39 fa cmp %edi,%edx 690: 74 1e je 6b0 <free+0x60> bp->s.size += p->s.ptr->s.size; bp->s.ptr = p->s.ptr->s.ptr; } else bp->s.ptr = p->s.ptr; 692: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 695: 8b 50 04 mov 0x4(%eax),%edx 698: 8d 34 d0 lea (%eax,%edx,8),%esi 69b: 39 f1 cmp %esi,%ecx 69d: 74 28 je 6c7 <free+0x77> p->s.size += bp->s.size; p->s.ptr = bp->s.ptr; } else p->s.ptr = bp; 69f: 89 08 mov %ecx,(%eax) freep = p; } 6a1: 5b pop %ebx freep = p; 6a2: a3 dc 0a 00 00 mov %eax,0xadc } 6a7: 5e pop %esi 6a8: 5f pop %edi 6a9: 5d pop %ebp 6aa: c3 ret 6ab: 90 nop 6ac: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi bp->s.size += p->s.ptr->s.size; 6b0: 03 72 04 add 0x4(%edx),%esi 6b3: 89 73 fc mov %esi,-0x4(%ebx) bp->s.ptr = p->s.ptr->s.ptr; 6b6: 8b 10 mov (%eax),%edx 6b8: 8b 12 mov (%edx),%edx 6ba: 89 53 f8 mov %edx,-0x8(%ebx) if(p + p->s.size == bp){ 6bd: 8b 50 04 mov 0x4(%eax),%edx 6c0: 8d 34 d0 lea (%eax,%edx,8),%esi 6c3: 39 f1 cmp %esi,%ecx 6c5: 75 d8 jne 69f <free+0x4f> p->s.size += bp->s.size; 6c7: 03 53 fc add -0x4(%ebx),%edx freep = p; 6ca: a3 dc 0a 00 00 mov %eax,0xadc p->s.size += bp->s.size; 6cf: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 6d2: 8b 53 f8 mov -0x8(%ebx),%edx 6d5: 89 10 mov %edx,(%eax) } 6d7: 5b pop %ebx 6d8: 5e pop %esi 6d9: 5f pop %edi 6da: 5d pop %ebp 6db: c3 ret 6dc: 8d 74 26 00 lea 0x0(%esi,%eiz,1),%esi 000006e0 <malloc>: return freep; } void* malloc(uint nbytes) { 6e0: 55 push %ebp 6e1: 89 e5 mov %esp,%ebp 6e3: 57 push %edi 6e4: 56 push %esi 6e5: 53 push %ebx 6e6: 83 ec 1c sub $0x1c,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6e9: 8b 45 08 mov 0x8(%ebp),%eax if((prevp = freep) == 0){ 6ec: 8b 3d dc 0a 00 00 mov 0xadc,%edi nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6f2: 8d 70 07 lea 0x7(%eax),%esi 6f5: c1 ee 03 shr $0x3,%esi 6f8: 83 c6 01 add $0x1,%esi if((prevp = freep) == 0){ 6fb: 85 ff test %edi,%edi 6fd: 0f 84 ad 00 00 00 je 7b0 <malloc+0xd0> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 703: 8b 17 mov (%edi),%edx if(p->s.size >= nunits){ 705: 8b 4a 04 mov 0x4(%edx),%ecx 708: 39 ce cmp %ecx,%esi 70a: 76 72 jbe 77e <malloc+0x9e> 70c: 81 fe 00 10 00 00 cmp $0x1000,%esi 712: bb 00 10 00 00 mov $0x1000,%ebx 717: 0f 43 de cmovae %esi,%ebx p = sbrk(nu * sizeof(Header)); 71a: 8d 04 dd 00 00 00 00 lea 0x0(,%ebx,8),%eax 721: 89 45 e4 mov %eax,-0x1c(%ebp) 724: eb 1b jmp 741 <malloc+0x61> 726: 8d 76 00 lea 0x0(%esi),%esi 729: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 730: 8b 02 mov (%edx),%eax if(p->s.size >= nunits){ 732: 8b 48 04 mov 0x4(%eax),%ecx 735: 39 f1 cmp %esi,%ecx 737: 73 4f jae 788 <malloc+0xa8> 739: 8b 3d dc 0a 00 00 mov 0xadc,%edi 73f: 89 c2 mov %eax,%edx p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 741: 39 d7 cmp %edx,%edi 743: 75 eb jne 730 <malloc+0x50> p = sbrk(nu * sizeof(Header)); 745: 83 ec 0c sub $0xc,%esp 748: ff 75 e4 pushl -0x1c(%ebp) 74b: e8 09 fc ff ff call 359 <sbrk> if(p == (char*)-1) 750: 83 c4 10 add $0x10,%esp 753: 83 f8 ff cmp $0xffffffff,%eax 756: 74 1c je 774 <malloc+0x94> hp->s.size = nu; 758: 89 58 04 mov %ebx,0x4(%eax) free((void*)(hp + 1)); 75b: 83 ec 0c sub $0xc,%esp 75e: 83 c0 08 add $0x8,%eax 761: 50 push %eax 762: e8 e9 fe ff ff call 650 <free> return freep; 767: 8b 15 dc 0a 00 00 mov 0xadc,%edx if((p = morecore(nunits)) == 0) 76d: 83 c4 10 add $0x10,%esp 770: 85 d2 test %edx,%edx 772: 75 bc jne 730 <malloc+0x50> return 0; } } 774: 8d 65 f4 lea -0xc(%ebp),%esp return 0; 777: 31 c0 xor %eax,%eax } 779: 5b pop %ebx 77a: 5e pop %esi 77b: 5f pop %edi 77c: 5d pop %ebp 77d: c3 ret if(p->s.size >= nunits){ 77e: 89 d0 mov %edx,%eax 780: 89 fa mov %edi,%edx 782: 8d b6 00 00 00 00 lea 0x0(%esi),%esi if(p->s.size == nunits) 788: 39 ce cmp %ecx,%esi 78a: 74 54 je 7e0 <malloc+0x100> p->s.size -= nunits; 78c: 29 f1 sub %esi,%ecx 78e: 89 48 04 mov %ecx,0x4(%eax) p += p->s.size; 791: 8d 04 c8 lea (%eax,%ecx,8),%eax p->s.size = nunits; 794: 89 70 04 mov %esi,0x4(%eax) freep = prevp; 797: 89 15 dc 0a 00 00 mov %edx,0xadc } 79d: 8d 65 f4 lea -0xc(%ebp),%esp return (void*)(p + 1); 7a0: 83 c0 08 add $0x8,%eax } 7a3: 5b pop %ebx 7a4: 5e pop %esi 7a5: 5f pop %edi 7a6: 5d pop %ebp 7a7: c3 ret 7a8: 90 nop 7a9: 8d b4 26 00 00 00 00 lea 0x0(%esi,%eiz,1),%esi base.s.ptr = freep = prevp = &base; 7b0: c7 05 dc 0a 00 00 e0 movl $0xae0,0xadc 7b7: 0a 00 00 base.s.size = 0; 7ba: bf e0 0a 00 00 mov $0xae0,%edi base.s.ptr = freep = prevp = &base; 7bf: c7 05 e0 0a 00 00 e0 movl $0xae0,0xae0 7c6: 0a 00 00 for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 7c9: 89 fa mov %edi,%edx base.s.size = 0; 7cb: c7 05 e4 0a 00 00 00 movl $0x0,0xae4 7d2: 00 00 00 if(p->s.size >= nunits){ 7d5: e9 32 ff ff ff jmp 70c <malloc+0x2c> 7da: 8d b6 00 00 00 00 lea 0x0(%esi),%esi prevp->s.ptr = p->s.ptr; 7e0: 8b 08 mov (%eax),%ecx 7e2: 89 0a mov %ecx,(%edx) 7e4: eb b1 jmp 797 <malloc+0xb7>
33.710111
60
0.409284
22cad28d514b00a43a5c7818f4ef9f4e046e55c7
972
asm
Assembly
programs/oeis/253/A253475.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/253/A253475.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/253/A253475.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A253475: Indices of centered square numbers (A001844) which are also centered hexagonal numbers (A003215). ; 1,6,55,540,5341,52866,523315,5180280,51279481,507614526,5024865775,49741043220,492385566421,4874114620986,48248760643435,477613491813360,4727886157490161,46801248083088246,463284594673392295,4586044698650834700,45397162391834954701,449385579219698712306,4448458629805152168355,44035200718831822971240,435903548558513077544041,4315000284866298952469166,42714099300104476447147615,422825992716178465519006980,4185545827861680178742922181,41432632285900623321910214826,410140777031144553040359226075,4059975138025544907081682045920,40189610603224304517776461233121,397836130894217500270682930285286,3938171698338950698189052841619735,38983880852495289481619845485912060,385900636826613944118009402017500861 lpb $0 mov $2,$0 sub $0,1 seq $2,87799 ; a(n) = 10*a(n-1) - a(n-2), starting with a(0) = 2 and a(1) = 10. add $1,$2 lpe div $1,2 add $1,1 mov $0,$1
74.769231
705
0.855967
416cfcf35d4927a1a3700f74adb43e2ececafc40
9,549
asm
Assembly
events.asm
kieranhj/stniccc-archie
d13365997b27a932e2b61c9de90e71edd7466d0b
[ "MIT" ]
3
2020-01-10T13:45:26.000Z
2021-04-07T18:34:29.000Z
events.asm
kieranhj/stniccc-archie
d13365997b27a932e2b61c9de90e71edd7466d0b
[ "MIT" ]
null
null
null
events.asm
kieranhj/stniccc-archie
d13365997b27a932e2b61c9de90e71edd7466d0b
[ "MIT" ]
1
2020-07-12T15:05:08.000Z
2020-07-12T15:05:08.000Z
; ============================================================================ ; Events system ; ============================================================================ ;.equ TRACK_SPEED, 4 .macro do_event pattern, temp, func, data ; .long \temp*TRACK_SPEED+\pattern*64*TRACK_SPEED .long \temp+\pattern*256 .long \data b \func .endm events_update: ; read current tracker position mov r0, #-1 mov r1, #-1 swi QTM_Pos ldr r2, events_ptr ; load pattern/line for the next event ldr r3, [r2], #4 mov r4, r3, lsr #8 ; pattern cmp r0, r4 bne do_nothing and r4, r3, #0xff ; line cmp r1, r4 blt do_nothing ; if we miss a line still process this event ; call event function ldr r0, [r2], #4 add r3, r2, #4 str r3, events_ptr str lr, [sp, #-4]! ; push lr on stack adr lr, .2 mov pc, r2 ; call fn. .2: ldr lr, [sp], #4 ; pull lr from stack b events_update ; repeat until all events processed do_nothing: mov pc, lr show_pause: mov r0, #0 str r0, update_fn_id mov pc, lr events_ptr: .long events_data ; ============================================================================ ; Events data ; ; Available functions: ; show_image, data = image no. ; show_parser = STNICC sequence, clear screen if data = 1 (needed for restarting after image) ; parser_set_frame, data = STNICCC frame no. [0-1799] ; parser_set_speed, data = frame step (negative for backwards) ; parser_set_filter, colour if data = 0, b&w if data = 1 (STNICCC only), white flas = 2 (STNICCC only) ; show_text_block, data = text block no. ; ============================================================================ events_data: do_event 0, 0, show_image, 0 ; slide 1 'back by popular demand' do_event 0, 0x30, fade_to_black, 3 ; fade to black, speed = 2 do_event 1, 0, parser_set_frame, 1799 do_event 1, 0, parser_set_speed, -1 do_event 1, 0, show_parser, 1 ; STNICCC forwards do_event 1, 0x30, parser_set_speed, 1 ; forwards do_event 1, 0x34, parser_set_speed, -1 ; backwards do_event 1, 0x36, parser_set_speed, 1 ; forwards do_event 1, 0x38, parser_set_speed, -2 ; backwards do_event 2, 0, show_image, 1 ; slide 2 'recognise this?' do_event 2, 0x20, parser_set_frame, 1700 do_event 2, 0x20, show_parser, 1 ; STNICCC do_event 3, 0, show_image, 2 ; slide 3 'yeah?' do_event 3, 0x20, parser_set_frame, 1650 do_event 3, 0x20, show_parser, 1 ; STNICCC ;do_event 3, 0x2e, parser_set_speed, -1 ; backwards do_event 3, 0x30, parser_set_speed, 2 ; forwards do_event 3, 0x32, parser_set_speed, -2 ; backwards do_event 3, 0x34, parser_set_speed, 2 ; forwards do_event 3, 0x38, parser_set_speed, -2 ; backwards do_event 4, 0, show_image, 3 ; slide 4 'it's called' do_event 4, 0x20, show_parser, 1 ; STNICCC do_event 5, 0, show_image, 4 ; slide 5 'compo filler' ;do_event 5, 0x20, parser_set_filter, 1 ; b&w do_event 5, 0x20, parser_set_speed, -1 ; backwards do_event 5, 0x20, parser_set_frame, 1375 do_event 5, 0x20, show_parser, 1 ; STNICCC do_event 6, 0, show_image, 5 ; slide 6 'Remain calm' ;do_event 6, 32, parser_set_filter, 0 ; colour ;do_event 6, 32, parser_set_speed, 1 ; forwards do_event 6, 32, show_parser, 1 ; STNICCC do_event 7, 0, show_image, 6 ; slide 7 'This demo is short' ;do_event 7, 32, parser_set_filter, 0 ; colour ;do_event 7, 32, parser_set_speed, 1 ; forwards do_event 7, 0x20, show_parser, 1 ; STNICCC do_event 7, 0x30, parser_set_speed, 2 ; forwards do_event 7, 0x32, parser_set_speed, -2 ; backwards do_event 7, 0x34, parser_set_speed, 2 ; forwards do_event 7, 0x38, parser_set_speed, -2 ; backwards do_event 7, 0x3a, parser_set_speed, 2 ; forwards do_event 7, 0x3c, parser_set_speed, -2 ; backwards do_event 8, 0, show_image, 7 ; slide 8 'The End' do_event 8, 0x18, show_image, 8 ; slide 9 'Only Joking' do_event 9, 0, show_parser, 1 ; STNICCC ;do_event 9, 32, parser_set_filter, 1 ; b&w ;do_event 9, 32, parser_set_speed, -3 ; back ;do_event 9, 32, show_parser, 1 ; STNICCC do_event 9, 0x8, parser_set_filter, 2 ; flash white do_event 9, 0x18, parser_set_filter, 2 ; flash white do_event 9, 0x28, parser_set_filter, 2 ; flash white do_event 9, 0x38, parser_set_filter, 2 ; flash white do_event 0xa, 0, show_image, 10 ; slide 11 'Well this is fun' do_event 0xa, 0x20, show_parser, 1 ; STNICCC do_event 0xa, 0x28, parser_set_filter, 2 ; flash white do_event 0xa, 0x34, parser_set_filter, 2 ; flash white do_event 0xa, 0x3a, parser_set_filter, 2 ; flash white ;do_event 0xb, 0, show_image, 20 ; bitshifters logo do_event 0xb, 0, show_image, 11 ; slide 12 'black and white?' do_event 0xb, 0x20, parser_set_filter, 1 ; b@w do_event 0xb, 0x20, parser_set_frame, 300 do_event 0xb, 0x20, parser_set_speed, 2 ; forwards do_event 0xb, 0x20, show_parser, 1 ; STNICCC do_event 0xb, 0x28, parser_set_filter, 3 ; flash white to b&w do_event 0xb, 0x38, parser_set_filter, 3 ; flash white to b&w do_event 0xc, 0, show_image, 21 ; patarty do_event 0xc, 0x20, parser_set_filter, 0 ; colour do_event 0xc, 0x20, parser_set_speed, 4 ; forwards do_event 0xc, 0x20, show_parser, 1 ; STNICCC do_event 0xc, 0x28, parser_set_filter, 2 ; flash white do_event 0xc, 0x34, parser_set_filter, 2 ; flash white do_event 0xc, 0x3a, parser_set_filter, 2 ; flash white do_event 0xd, 0, show_image, 22 ; pic gangster do_event 0xd, 0x20, parser_set_filter, 0 ; colour do_event 0xd, 0x20, parser_set_speed, 4 ; forwards do_event 0xd, 0x20, show_parser, 1 ; STNICCC do_event 0xd, 0x28, parser_set_filter, 2 ; flash white do_event 0xd, 0x38, parser_set_filter, 2 ; flash white do_event 0xe, 0, show_image, 9 ; slide 10 'avon' do_event 0xe, 0x20, parser_set_filter, 0 ; colour do_event 0xe, 0x20, parser_set_speed, 4 ; forwards do_event 0xe, 0x20, show_parser, 1 ; STNICCC do_event 0xe, 0x32, parser_set_filter, 2 ; flash white ;do_event 0xe, 0x35, parser_set_filter, 2 ; flash white do_event 0xe, 0x38, parser_set_filter, 2 ; flash white ;do_event 0xe, 0x3b, parser_set_filter, 2 ; flash white do_event 0xe, 0x3e, parser_set_filter, 2 ; flash white do_event 0xf, 0, show_image, 12 ; slide 13 'nearly done' do_event 0x10, 0, parser_set_frame, 0 do_event 0x10, 0, parser_set_filter, 0 ; colour do_event 0x10, 0, parser_set_speed, 4 ; forwards do_event 0x10, 0, show_parser, 1 ; STNICCC do_event 0x10, 0x8, parser_set_filter, 2 ; flash white do_event 0x10, 0x18, parser_set_filter, 2 ; flash white do_event 0x10, 0x20, show_image, 15 ; slide 16 'greets 1' do_event 0x11, 0, parser_set_frame, 450 do_event 0x11, 0, parser_set_filter, 0 ; colour do_event 0x11, 0, parser_set_speed, 4 ; forwards do_event 0x11, 0, show_parser, 1 ; STNICCC do_event 0x11, 0x8, parser_set_filter, 2 ; flash white do_event 0x11, 0x18, parser_set_filter, 2 ; flash white do_event 0x11, 0x20, show_image, 16 ; slide 17 'greets 2' do_event 0x12, 0, parser_set_frame, 900 do_event 0x12, 0, parser_set_filter, 0 ; colour do_event 0x12, 0, parser_set_speed, 4 ; forwards do_event 0x12, 0, show_parser, 1 ; STNICCC do_event 0x12, 0x8, parser_set_filter, 2 ; flash white do_event 0x12, 0x18, parser_set_filter, 2 ; flash white do_event 0x12, 0x20, show_image, 17 ; slide 18 'greets 3' do_event 0x13, 0, parser_set_frame, 1350 do_event 0x13, 0, parser_set_filter, 0 ; colour do_event 0x13, 0, parser_set_speed, 4 ; forwards do_event 0x13, 0, show_parser, 1 ; STNICCC do_event 0x13, 0x8, parser_set_filter, 2 ; flash white do_event 0x13, 0x18, parser_set_filter, 2 ; flash white do_event 0x13, 0x20, show_image, 23 ; credits do_event 0x14, 0, show_image, 13 ; slide 14 'the end again' do_event 0x14, 0x18, fade_to_black, 3 ; fade to black, speed = 2 do_event 0x15, 0, show_image, 14 ; slide 15 'no, really' do_event 0x15, 0x18, fade_to_black, 3 ; fade to black, speed = 2 do_event 0x16, 0, show_image, 20 ; bitshifters logo' do_event 0x16, 0x28, fade_to_black, 2 ; fade to black, speed = 2 ;do_event 16, 0, show_image, 23 ; Credits ;do_event 16, 32, show_parser, 1 ; STNICCC ; When Tracker module loops around we'll get back to pattern 0 do_event 0, 0, exit, 0 ; end ; ============================================================================ ; IF YOU GET THE FOLLOWING ERROR MESSAGE WHEN BUILDING: ; fatal error 8: cannot resolve section <seg8000>, maximum number of passes reached ; Just keep adding 4 to the number below until it works! (Stupid assembler bug.) ; ============================================================================ .skip 32
42.066079
104
0.61043
f962fe5261d7a906877289991adf79e83ad10429
159
asm
Assembly
pwnlib/shellcraft/templates/amd64/linux/sh.asm
magnologan/pwntools
32b05024d33019e16801cc50ec0108ee783eff27
[ "MIT" ]
7
2015-05-22T03:48:47.000Z
2022-03-30T13:59:48.000Z
pwnlib/shellcraft/templates/amd64/linux/sh.asm
magnologan/pwntools
32b05024d33019e16801cc50ec0108ee783eff27
[ "MIT" ]
1
2015-06-11T02:22:28.000Z
2015-06-11T02:22:28.000Z
pwnlib/shellcraft/templates/amd64/linux/sh.asm
magnologan/pwntools
32b05024d33019e16801cc50ec0108ee783eff27
[ "MIT" ]
3
2017-01-24T18:53:29.000Z
2019-04-29T03:41:10.000Z
<% from pwnlib.shellcraft import amd64 %> <%docstring>Execute /bin/sh</%docstring> ${amd64.pushstr("/bin///sh")} ${amd64.syscall('SYS_execve', 'rsp', 0, 0)}
22.714286
43
0.660377
c1e1d2a88230d3510e41c03ae87d705657e580bc
575
asm
Assembly
programs/oeis/305/A305066.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/305/A305066.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/305/A305066.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A305066: a(n) = 234*2^n - 120. ; 114,348,816,1752,3624,7368,14856,29832,59784,119688,239496,479112,958344,1916808,3833736,7667592,15335304,30670728,61341576,122683272,245366664,490733448,981467016,1962934152,3925868424,7851736968,15703474056,31406948232,62813896584,125627793288,251255586696,502511173512,1005022347144,2010044694408,4020089388936,8040178777992,16080357556104,32160715112328,64321430224776,128642860449672,257285720899464,514571441799048,1029142883598216,2058285767196552,4116571534393224,8233143068786568 mov $1,2 pow $1,$0 sub $1,1 mul $1,234 add $1,114
63.888889
490
0.850435
b215ad28d6f43de990f3557f36017c1dac7fda8f
1,208
asm
Assembly
programs/oeis/159/A159481.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/159/A159481.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/159/A159481.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A159481: Number of evil numbers <= n, see A001969. ; 1,1,1,2,2,3,4,4,4,5,6,6,7,7,7,8,8,9,10,10,11,11,11,12,13,13,13,14,14,15,16,16,16,17,18,18,19,19,19,20,21,21,21,22,22,23,24,24,25,25,25,26,26,27,28,28,28,29,30,30,31,31,31,32,32,33,34,34,35,35,35,36,37,37,37,38,38,39,40,40,41,41,41,42,42,43,44,44,44,45,46,46,47,47,47,48,49,49,49,50,50,51,52,52,52,53,54,54,55,55,55,56,56,57,58,58,59,59,59,60,61,61,61,62,62,63,64,64,64,65,66,66,67,67,67,68,69,69,69,70,70,71,72,72,73,73,73,74,74,75,76,76,76,77,78,78,79,79,79,80,81,81,81,82,82,83,84,84,84,85,86,86,87,87,87,88,88,89,90,90,91,91,91,92,93,93,93,94,94,95,96,96,97,97,97,98,98,99,100,100,100,101,102,102,103,103,103,104,104,105,106,106,107,107,107,108,109,109,109,110,110,111,112,112,112,113,114,114,115,115,115,116,117,117,117,118,118,119,120,120,121,121,121,122,122,123,124,124,124,125 mov $4,$0 add $4,1 mov $9,$0 lpb $4 mov $0,$9 sub $4,1 sub $0,$4 mov $2,7 mov $3,$0 mov $8,$0 lpb $2 mov $5,2401 lpb $5 sub $5,$3 div $3,2 trn $6,$8 lpe add $6,1 lpb $6 add $3,4 div $3,$3 gcd $5,8 div $3,$5 sub $6,$3 add $7,4 lpe mov $2,2 lpe div $7,4 add $1,$7 lpe
34.514286
785
0.593543
681a3def2734c4de099086b25247da00f03aae74
423
asm
Assembly
libsrc/osca/dir_get_entry_name.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/osca/dir_get_entry_name.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/osca/dir_get_entry_name.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; ; Old School Computer Architecture - interfacing FLOS ; Stefano Bodrato, 2011 ; ; Get filename associated to current directory entry ; ; $Id: dir_get_entry_name.asm,v 1.3 2016-06-22 22:13:09 dom Exp $ ; INCLUDE "target/osca/def/flos.def" SECTION code_clib PUBLIC dir_get_entry_name PUBLIC _dir_get_entry_name dir_get_entry_name: _dir_get_entry_name: push iy call kjt_dir_list_get_entry pop iy ret
19.227273
65
0.758865
c2de7b74b1e83a68398897ab587ba340e1ad2cab
640
asm
Assembly
programs/oeis/183/A183425.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/183/A183425.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/183/A183425.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A183425: Half the number of n X 2 0..2 arrays with no element equal its row sum plus its column sum mod 3. ; 3,9,32,129,513,2048,8193,32769,131072,524289,2097153,8388608,33554433,134217729,536870912,2147483649,8589934593,34359738368,137438953473,549755813889,2199023255552,8796093022209,35184372088833,140737488355328,562949953421313,2251799813685249,9007199254740992 mov $3,2 mov $7,$0 lpb $3 mov $0,$7 sub $3,1 add $0,$3 mov $2,$3 mov $5,$0 mul $5,2 mov $6,2 pow $6,$5 mul $6,2 mov $8,$0 add $8,$0 add $6,$8 div $6,3 mov $4,$6 lpb $2 mov $1,$4 sub $2,1 lpe lpe lpb $7 sub $1,$4 mov $7,0 lpe
21.333333
260
0.676563
e2e5fae322989204e62cedca7b14a0551ac41bdb
634
asm
Assembly
audio/sfx/cry1d_3.asm
etdv-thevoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
1
2022-01-09T05:28:52.000Z
2022-01-09T05:28:52.000Z
audio/sfx/cry1d_3.asm
ETDV-TheVoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
null
null
null
audio/sfx/cry1d_3.asm
ETDV-TheVoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
null
null
null
SFX_Cry1D_3_Ch4: dutycycle 244 unknownsfx0x20 15, 240, 5, 7 unknownsfx0x20 10, 224, 0, 7 unknownsfx0x20 6, 180, 16, 7 unknownsfx0x20 4, 211, 0, 7 unknownsfx0x20 6, 178, 32, 6 unknownsfx0x20 8, 161, 36, 6 endchannel SFX_Cry1D_3_Ch5: dutycycle 34 unknownsfx0x20 15, 176, 195, 6 unknownsfx0x20 10, 160, 193, 6 unknownsfx0x20 6, 132, 210, 6 unknownsfx0x20 4, 147, 193, 6 unknownsfx0x20 6, 130, 225, 5 unknownsfx0x20 8, 97, 232, 5 endchannel SFX_Cry1D_3_Ch7: unknownnoise0x20 6, 230, 76 unknownnoise0x20 15, 214, 60 unknownnoise0x20 10, 197, 74 unknownnoise0x20 1, 178, 91 unknownnoise0x20 15, 194, 76 endchannel
21.133333
31
0.739748
9fa5528820897fcddda684015a6f40a26e42c916
1,722
asm
Assembly
r2/c2.asm
mcjonker/csce-212-computer-architecture
1d66405253aa348f9fc8a3dba8b4f7e8e4ac1320
[ "MIT" ]
null
null
null
r2/c2.asm
mcjonker/csce-212-computer-architecture
1d66405253aa348f9fc8a3dba8b4f7e8e4ac1320
[ "MIT" ]
null
null
null
r2/c2.asm
mcjonker/csce-212-computer-architecture
1d66405253aa348f9fc8a3dba8b4f7e8e4ac1320
[ "MIT" ]
null
null
null
# Property of Mitchell Jonker .data prompt: .asciiz "Welcome to the BMI calculator!\n" weight: .asciiz "Enter the weight (in pounds).\n" height: .asciiz "Enter the height (in feet).\n" underw: .asciiz "BMI Index is Underweight.\n\n" normalw: .asciiz "BMI Index is Normal.\n\n" overw: .asciiz "BMI Index is Overweight.\n\n" bmi: .asciiz "BMI #: " nl: .asciiz "\n" w: .float 0.0 h: .float 0.0 fti: .float 12.0 bmic: .float 703.0 buw: .float 18.5 bnw: .float 24.9 bow: .float 25.0 .text # Initialize SFPVs l.s $f1, w l.s $f2, h # Prompt Welcome li $v0, 4 la $a0, prompt syscall j process process: # Prompt to enter weight li $v0, 4 la $a0, weight syscall # Accept weight value li $v0, 6 syscall mov.s $f1, $f0 # Prompt to enter height li $v0, 4 la $a0, height syscall # Accept height value li $v0, 6 syscall mov.s $f2, $f0 ## Calculate the BMI # Feet to Inches l.s $f4, fti mul.s $f2, $f2, $f4 # Inches squared mul.s $f2, $f2, $f2 # Pounds per Inches squared div.s $f3, $f1, $f2 # Multiply by BMI metric constant l.s $f4, bmic mul.s $f3, $f3, $f4 # BMI is stored in $f3 ## Print BMI li $v0, 4 la $a0, bmi syscall li $v0, 2 mov.s $f12, $f3 syscall li $v0, 4 la $a0, nl syscall ## Read BMI and find status. # Underweight? l.s $f4, buw c.lt.s $f3, $f4 bc1t underweight # Overweight? l.s $f4, bow c.le.s $f4, $f3 bc1t overweight # If not uw or ow, normal j normalweight underweight: li $v0, 4 la $a0, underw syscall la $a0, nl syscall j process normalweight: li $v0, 4 la $a0, normalw syscall la $a0, nl syscall j process overweight: li $v0, 4 la $a0, overw syscall la $a0, nl syscall j process
14.231405
51
0.626597
59fbc469890464078aa78e25b390a66bc7a57d45
6,229
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_21829_1808.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_1808.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_1808.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r13 push %r14 push %r15 push %rcx push %rdi push %rsi lea addresses_A_ht+0x17970, %r14 nop nop nop nop nop and $56633, %r10 movw $0x6162, (%r14) nop nop sub $18108, %rcx lea addresses_D_ht+0xadb2, %r13 nop nop nop dec %rsi mov (%r13), %r11 and $31891, %r13 lea addresses_normal_ht+0x19b0a, %rsi nop nop nop nop nop and $48352, %rcx mov (%rsi), %r11w nop xor $49953, %r15 lea addresses_D_ht+0x1552, %rsi lea addresses_D_ht+0xa392, %rdi clflush (%rsi) nop nop nop nop and $28895, %r15 mov $123, %rcx rep movsw add %r14, %r14 lea addresses_WT_ht+0x1a000, %r15 dec %rdi movw $0x6162, (%r15) nop nop nop nop nop and %rdi, %rdi lea addresses_UC_ht+0x14499, %r10 nop nop dec %r13 mov (%r10), %edi xor %r15, %r15 lea addresses_UC_ht+0x179de, %r15 nop nop nop nop nop xor %r13, %r13 mov (%r15), %r14 nop nop nop nop nop xor $47907, %rdi lea addresses_UC_ht+0x8152, %r11 nop nop nop nop dec %r13 mov (%r11), %esi nop nop nop dec %r14 pop %rsi pop %rdi pop %rcx pop %r15 pop %r14 pop %r13 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r14 push %r8 push %rax push %rcx push %rdx // Store lea addresses_PSE+0x11d92, %r14 nop nop nop xor $27646, %r11 movb $0x51, (%r14) nop and $37853, %rdx // Store lea addresses_UC+0xc452, %r8 nop nop nop nop nop inc %r12 movb $0x51, (%r8) nop nop xor %r8, %r8 // Faulty Load lea addresses_UC+0x1a952, %rdx nop nop nop nop and $49631, %rax mov (%rdx), %r12 lea oracles, %r11 and $0xff, %r12 shlq $12, %r12 mov (%r11,%r12,1), %r12 pop %rdx pop %rcx pop %rax pop %r8 pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 6}} {'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_UC', 'same': False, 'AVXalign': False, 'congruent': 8}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 3}} {'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'REPM', 'src': {'same': False, 'type': 'addresses_D_ht', 'congruent': 9}, 'dst': {'same': False, 'type': 'addresses_D_ht', 'congruent': 6}} {'OP': 'STOR', 'dst': {'size': 2, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 1}} {'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 11}} {'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 */
35.798851
2,999
0.654198
1d967036bce0f5d9cd74bb789b8b7aff4f0b2d14
6,575
a51
Assembly
Default Firmware/Ocelot_Unmanaged-1.0.1_SourceCode/Ocelot_Unmanaged-1.0.1/src/switch/pidrv.a51
botblox/GigaBlox-Rugged-FW
427eafb82be26d8b9446cd2178db3779faa0d2c0
[ "MIT" ]
1
2021-12-01T01:12:57.000Z
2021-12-01T01:12:57.000Z
Default Firmware/Ocelot_Unmanaged-1.0.1_SourceCode/Ocelot_Unmanaged-1.0.1/src/switch/pidrv.a51
botblox/GigaBlox-Rugged-FW
427eafb82be26d8b9446cd2178db3779faa0d2c0
[ "MIT" ]
null
null
null
Default Firmware/Ocelot_Unmanaged-1.0.1_SourceCode/Ocelot_Unmanaged-1.0.1/src/switch/pidrv.a51
botblox/GigaBlox-Rugged-FW
427eafb82be26d8b9446cd2178db3779faa0d2c0
[ "MIT" ]
null
null
null
;* ;* ;* Copyright (c) 2017 Microsemi Corporation "Microsemi". ;* ;* 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. ;* ;* ;* $NOMOD51 $INCLUDE (REG52.INC) $INCLUDE (hwconf.inc) NAME PIDRV $IF (USE_PI = 1) PUBLIC _pi_read, _pi_write PROG SEGMENT CODE RSEG PROG ;* ************************************************************************ */ ;ulong pi_read (void *addr) small; _pi_read: ;* ------------------------------------------------------------------------ -- ;* Purpose : Read specified register. ;* Remarks : r2: block mask plus subblock ;* r1: register address within block ;* Restrictions: Not c-compatible. Must be called via h2io.a51 ;* See also : ;* Example : ;* ************************************************************************ */ ;* ;* Build 17-bit address: ;* A16-A14: block id ;* A13-A10: subblock ;* A9 - A2: register address ;* A1 - A0: zeros ;* Save A16 in carry and A15-A0 in dptr ;* mov a, r1 ; Get reg. addr. rlc a ; Shift one bit left, C gets MSB mov r1, a ; Save 7 bits from reg. addr. temporarily mov a, r2 ; Get block id mask (7:5) and subblock (3:0). anl a, #0FH ; Isolate subblock addc a, r2 ; Add subblock, ie. shift subblock 1 bit left, ; and with C to get MSB of reg. addr. xch a, r1 ; Save temp. and get rem. bits of reg. addr. rlc a ; Shift one bit more to the left, C gets MSB anl a, #0FCH ; Reset A1 and A0 mov dpl, a ; Save A7-A0 in dpl mov a, r1 ; Get A16-A9. rlc a ; Shift one bit left to get A16 in C and ; to get yet another reg. addr. bit. mov dph, a ; Save A15-A8 in dph SELECT_SWITCH ; Select switch and set A16 according to C ; Determine whether it is a fast or slow register by checking block ; id (Carry holds most significant bit of block id, acc holds ; remaining 2 bits in bit 7 and 6. jnc L2_1 ; Blocks 1-3 are all slow anl a, #0C0H ; Isolate bit 7 and 6 jz L2_2 ; Block 4 is fast cjne a, #0C0H, L2_1 ; Block 5 and 6 are slow jmp L2_2 ; Block 7 is fast L2_1: ; Slow register. ; Do a dummy read from right address, then read result from the ; SLOWDATA register movx a, @dptr ; Dummy read SET_SWITCH_ADDR_MSB ; Most significant bit of SLOWDATA register mov dptr, #SLOWDATA_ADDR; Remaining address bits of SLOWDATA register L2_2: ; Fast register movx a, @dptr ; Read 1st byte mov r4, a inc dptr movx a, @dptr ; Read 2nd byte mov r5, a inc dptr movx a, @dptr ; Read 3rd byte mov r6, a inc dptr movx a, @dptr ; Read 4th byte mov r7, a DESELECT_SWITCH ret ;* ************************************************************************ */ ; void pi_write (void *addr, ulong value) small; _pi_write: ;* ------------------------------------------------------------------------ -- ;* Purpose : Write a value to specified register ;* Remarks : r2: block mask plus subblock ;* r1: register address within block ;* r4-7: 32-bit value ;* Restrictions: Not C-compatible. Must be called via h2io.a51 ;* See also : ;* Example : ; * ************************************************************************ */ ;* ;* Build 17-bit address: ;* A16-A14: block id ;* A13-A10; subblock ;* A9 - A2: register address ;* A1 - A0: zeros ;* Save A16 in carry and A15-A0 in dptr ;* mov a, r1 ; Get reg. addr. rlc a ; Shift one bit left, C gets MSB mov r1, a ; Save 7 bits from reg. addr. temporarily mov a, r2 ; Get block id mask (7:5) and subblock (3:0). anl a, #0FH ; Isolate subblock addc a, r2 ; Add subblock, ie. shift subblock 1 bit left, ; and with C to get MSB of reg. addr. xch a, r1 ; Save temp. and get rem. bits of reg. addr. rlc a ; Shift one bit more to the left, C gets MSB anl a, #0FCH ; Reset A1 and A0 mov dpl, a ; Save A7-A0 in dpl mov a, r1 ; Get A16-A9. rlc a ; Shift one bit left to get A16 in C and ; to get yet another reg. addr. bit. mov dph, a ; Save A15-A8 in dph SELECT_SWITCH ; Select switch and set A16 according to C mov a, r4 movx @dptr, a ; Write 1st byte inc dptr mov a, r5 movx @dptr, a ; Write 2nd byte inc dptr mov a, r6 movx @dptr, a ; Write 3rd byte inc dptr mov a, r7 movx @dptr, a ; Write 4th byte DESELECT_SWITCH ret $ENDIF END
35.928962
81
0.492776
ab0fae67c8efd65907bdcb0f57a6bca8a0479b7b
58
asm
Assembly
data/test_bmi.asm
colinw7/C6502
a79e573e3b16da0d895b18d0081716d9a76e4654
[ "MIT" ]
null
null
null
data/test_bmi.asm
colinw7/C6502
a79e573e3b16da0d895b18d0081716d9a76e4654
[ "MIT" ]
null
null
null
data/test_bmi.asm
colinw7/C6502
a79e573e3b16da0d895b18d0081716d9a76e4654
[ "MIT" ]
null
null
null
LDA #$37 BMI LABEL OUT A LABEL: LDA #$FF OUT A
8.285714
11
0.534483
26e58a73d0228630fd676257e9455c5ce7df49eb
366
asm
Assembly
programs/oeis/250/A250352.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/250/A250352.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/250/A250352.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A250352: Number of length 3 arrays x(i), i=1..3 with x(i) in i..i+n and no value appearing more than 2 times. ; 8,26,62,122,212,338,506,722,992,1322,1718,2186,2732,3362,4082,4898,5816,6842,7982,9242,10628,12146,13802,15602,17552,19658,21926,24362,26972,29762,32738,35906,39272,42842,46622,50618,54836,59282,63962,68882,74048 mov $1,2 add $1,$0 pow $1,3 sub $1,$0
45.75
214
0.734973
3e5d219522fa529460539e30e261b0c0af28694f
1,023
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i9-9900K_12_0xca.log_4_797.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_4_797.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_4_797.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r10 push %r13 push %rax push %rbx push %rcx push %rdi // Store lea addresses_D+0xc597, %r13 nop nop nop nop nop add %rax, %rax mov $0x5152535455565758, %rbx movq %rbx, %xmm4 vmovups %ymm4, (%r13) nop nop xor $41551, %r10 // Faulty Load lea addresses_A+0x1b197, %r10 nop nop nop xor $51494, %rcx movups (%r10), %xmm1 vpextrq $1, %xmm1, %rbx lea oracles, %rax and $0xff, %rbx shlq $12, %rbx mov (%rax,%rbx,1), %rbx pop %rdi pop %rcx pop %rbx pop %rax pop %r13 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_A', 'same': False, 'AVXalign': False, 'congruent': 0}} {'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 10}} [Faulty Load] {'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_A', 'same': True, 'AVXalign': False, 'congruent': 0}} <gen_prepare_buffer> {'00': 4} 00 00 00 00 */
17.05
122
0.649071
414aa94340f1cdf934e9955ea570d87ba02ea098
22,301
asm
Assembly
dev/emm386/except.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
dev/emm386/except.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
dev/emm386/except.asm
minblock/msdos
479ffd237d9bb7cc83cb06361db2c4ef42dfbac0
[ "Apache-2.0" ]
null
null
null
.386p page 58,132 ;============================================================================= title EXCEPT - 80386 Processor Exception Handlers ;============================================================================= ;== ;== (C) Copyright MICROSOFT Corp. 1986-1991 ;== (C) Copyright COMPAQ Computer Corp. 1986-1991 ;== ;== Title: MEMM.EXE - MICROSOFT Expanded Memory Manager 386 Driver ;== ;== Module: EXCEPT - 80386 Processor Exception Handlers ;== ;== Version: 1.00 ;== ;== Date: March 11,1990 ;== ;== Author: Leo Cohen ;== ;============================================================================= ;== ;== Change Log: ;== ;== DATE REVISION Description ;== -------- -------- -------------------------------------------- ;== 03/11/90 0.00 Original ;== ;============================================================================= ;== ;== Functional Description: ;== ;== This module handles all 80386 processor exceptions. ;== ;== ;============================================================================= ;== P U B L I C D E C L A R A T I O N S ;============================================================================= public ExceptHandler0 public ExceptHandler1 public ExceptHandler2 public ExceptHandler3 public ExceptHandler4 public ExceptHandler5 public ExceptHandler6 public ExceptHandler7 public ExceptHandler8 public ExceptHandler9 public ExceptHandler10 public ExceptHandler11 public ExceptHandler12 public ExceptHandler13 public ExceptHandler14 public ExceptHandler15 public ExceptHandler16 public ExceptHandler17 public _PFUser ;============================================================================= ;== L O C A L C O N S T A N T S ;============================================================================= include vdmseg.inc include vdmsel.inc include vm386.inc include oemdep.inc include emm386.inc include emmfunct.inc include emmdata.inc include page.inc include desc.inc ifdef BETA include except.pub endif ProcessExcep macro ExcepNum mov bx, ExcepNum mov ax, ExcpErr PJmp R1CODE_GSEL, R1_CODE:ErrHndlr endm ;============================================================================= ;== E X T E R N A L R E F E R E N C E S ;============================================================================= _TEXT segment extrn ReflectInterrupt:near extrn pIRQHandlerMaster:near extrn pIRQHandler:near extrn VmFault:near extrn MoveBlockParity:near extrn PageFaultHandler:near extrn TrapWrites:near extrn MBMoveW:near extrn MBrepMovD:near _TEXT ends R_CODE segment ifdef PICtrap extrn VirMasterPICVec:word extrn MasterPICVec:word extrn LastOCW3:byte extrn MasterIS:word endif R_CODE ends R1_CODE segment extrn ErrHndlr:near R1_CODE ends ifdef BugMode DCODE segment extrn _Trap00:far ; divide by zero extrn _Trap01:far ; single step interrupt extrn _Trap02:far ; NMI interrupt extrn _Trap03:far ; breakpoint interrupt extrn _Trap04:far ; INTO detected overflow extrn _Trap05:far ; BOUND range exceeded extrn _Trap06:far ; invalid opcode extrn _Trap07:far ; processor extension not avaliable extrn _Trap08:far ; double exception detected extrn _Trap09:far ; processor extension segment overrun extrn _Trap10:far ; invalid task state segment extrn _Trap11:far ; segment not present extrn _Trap12:far ; stack segment overrun or not present extrn _Trap13:far ; general proctection fault extrn _Trap14:far ; page fault DCODE ends endif ;============================================================================= ;== L O C A L D A T A ;============================================================================= _DATA segment _TABLE_ENTRIES EQU 1024 _PF DW 0 ; Most recently referenced _PFAddr DW 1000h DW 2000h _PFUser DW 0 ; Owner of page fault table 0 DW 0 ; Owner of page fault table 1 _DATA ends ;============================================================================= ;== C O D E S E G M E N T ;============================================================================= _TEXT segment assume cs:_TEXT, ds:NOTHING, es:NOTHING, ss:NOTHING ;============================================================================== ;== ;== ExceptHandler0: Divide error fault ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== No error code on stack ;== ;== Exit: Reflect to real mode handler if fault occurred in virtual 8086 ;== mode, else go to debugger. ;== ;============================================================================== ExceptHandler0: push ebp movzx ebp,sp test [bp][VTFO].VMTF_EFLAGShi,FLAGS_VM;Q: Virtual Mode? jz short EH0debug ; N: go to debugger push 0000 ; Y: interrupt 00 jmp ReflectInterrupt ; reflect it to virtual mode EH0debug: ifndef BugMode ProcessExcep ErrDIV else pop ebp db 0EAh ; far jump opcode dw offset DCODE:_trap00 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler1: Debug trap ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== No error code on stack ;== ;== Exit: Reflect to real mode handler if fault occurred in virtual 8086 ;== mode, else go to debugger. ;== ;============================================================================== ExceptHandler1: push ebp movzx ebp,sp call TrapWrites ;Q: Trap due to write violation? jc short EH1iretd ; Y: return to client ifndef BugMode test [bp][VTFO].VMTF_EFLAGShi,FLAGS_VM;Q: Virtual Mode? jz short EH1debug ; N: go to debugger push 0001 ; Y: interrupt 01 jmp ReflectInterrupt ; reflect it to virtual mode EH1debug: ProcessExcep ErrINT1 else pop ebp db 0EAh ; far jump opcode dw offset DCODE:_trap01 ; offset dw DEBC_GSEL ; selector endif EH1iretd: pop ebp iretd ;============================================================================== ;== ;== ExceptHandler2: NMI handler (H/W) ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== No error code on stack ;== ;== Exit: Reflect to real mode handler ;== ;==QLEO: Need to make this handler reentrant in protected mode! ;============================================================================== ExceptHandler2: push ebp movzx ebp,sp ifndef BugMode test [bp][VTFO].VMTF_EFLAGShi,FLAGS_VM;Q: Virtual Mode? jz short EH2prot ; N: check for parity push 02 ; Y: reflect it/debugger jmp ReflectInterrupt ; reflect it EH2prot: ; ; Check if move block function was executing ; cmp [bp][VTFO].VMTF_CS,VDMC_GSEL ;Q: Executing in _TEXT segment? jne short EH2check ; N: check parity cmp [bp][VTFO].VMTF_EIP,offset _TEXT:MBMoveW ;Q: MB code? jb short EH2check cmp [bp][VTFO].VMTF_EIP,offset _TEXT:MBrepMovD ;Q: MB code? ja short EH2check jmp MoveBlockParity ; Y: fail the move block. EH2check: call CheckParity ;Q: Was this a true parity error ? jc short EH2parity ; Y: error/debug trap pop ebp ; N: NMI cleared, continue iretd ; and toss the NMI EH2parity: push 2 ; reflect NMI to virtual mode (INT 2) push ebx push esi mov bx,DATA32_GSEL push ds mov si,seg R_CODE mov ds,bx movzx esi,si shl esi,4 ; DS:[ESI] point to R_CODE jmp pIRQHandler ; reflect interrupt EH2MB: ;QLEO ProcessExcep ErrNMI else pop ebp db 0EAh ; far jump opcode dw offset DCODE:_trap02 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler3: Breakpoint trap. Unfortunately, this breaks the ;== debugger's ability to GO and TRACE the VM program. ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== No error code on stack ;== Will never be entered unless BugMode is chosen. ;== ;== Exit: Send to debugger ;== ;============================================================================== ExceptHandler3: ifndef BugMode push 0 push 0 push ebp movzx ebp,sp ProcessExcep ErrINT3 else db 0EAh ; far jump opcode dw offset DCODE:_trap03 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler4: Overflow trap ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== No error code on stack ;== ;== Exit: Send to debugger ;== ;============================================================================== ExceptHandler4: ifndef BugMode push 0 push 0 push ebp movzx ebp,sp ProcessExcep ErrINTO else db 0EAh ; far jump opcode dw offset DCODE:_trap04 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler5: Array bounds fault ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== No error code on stack ;== ;== Exit: Reflect to real mode handler if fault occurred in virtual 8086 ;== mode, else go to debugger. ;== ;============================================================================== ExceptHandler5: push ebp movzx ebp,sp test [bp][VTFO].VMTF_EFLAGShi,FLAGS_VM;Q: Virtual Mode? jz SHORT EH5debug ; N: exit to debugger push 0005 ; Y: interrupt 01 jmp ReflectInterrupt ; reflect it to virtual mode EH5debug: ifndef BugMode ProcessExcep ErrBounds else pop ebp db 0EAh ; far jump opcode dw offset DCODE:_trap05 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler6: Invalid opcode fault ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== No error code on stack ;== ;== Exit: Reflect to real mode handler if fault occurred in virtual 8086 ;== mode, else go to debugger. ;== ;============================================================================== ExceptHandler6: push 0 ; align stack with error offset push 0 ; for VmFault push ebp movzx ebp,sp test [bp][VTFOE].VMTF_EFLAGShi,FLAGS_VM;Q: Virtual Mode? jnz VmFault ; Y: enter VM 06 Invalid handler EH6debug: ifndef BugMode ProcessExcep ErrOpCode else pop ebp add sp,4 ; throw away dummy error code db 0EAh ; far jump opcode dw offset DCODE:_trap06 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler7: Coprocessor not present fault ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== No error code on stack ;== ;== Exit: Reflect to real mode handler if fault occurred in virtual 8086 ;== mode, else go to debugger. ;== ;============================================================================== ExceptHandler7: push ebp movzx ebp,sp test [bp][VTFO].VMTF_EFLAGShi,FLAGS_VM;Q: Virtual Mode? jz SHORT EH7debug ; N: exit to debugger push 0007 ; Y: interrupt 07 jmp ReflectInterrupt ; reflect it to virtual mode EH7debug: ifndef BugMode ProcessExcep ErrCoPNA else pop ebp db 0EAh ; far jump opcode dw offset DCODE:_trap07 ; offset dw DEBC_GSEL ; selector endif ALIGN 16 ;============================================================================== ;== ;== ExceptHandler8: Double Fault ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== Error Code on stack = 0000 ;== ;== Exit: Send to debugger ;== ;============================================================================== ExceptHandler8: push ebp ; fix stack for pIRQHandler movzx ebp,sp push 8 ; interrupt level ;QLEO jmp CheckInt push ebx push esi mov bx,DATA32_GSEL push ds mov si,seg R_CODE mov ds,bx movzx esi,si shl esi,4 ; DS:[ESI] point to R_CODE assume ds:R_CODE ifdef PICtrap ;QLEO mov ebx,[esi][p_DATA] ; DS:[EBX] point to _DATA ;QLEO assume ds:_DATA or ds:[esi][MasterIS],1 ; virtualize the master ISR for IRQ0 endif jmp pIRQHandler ; reflect interrupt assume ds:nothing EH8except: ifndef BugMode ProcessExcep ErrDouble else pop ebp db 0EAh ; far jump opcode dw offset DCODE:_trap08 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler9: Coprocessor segment overrun ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== No error code on stack ;== ;== Exit: Send to debugger ;== ;============================================================================== ExceptHandler9: push ebp ; fix stack for pIRQHandler movzx ebp,sp push 9 ; interrupt level ifndef LC910611 push ebx push esi mov bx,DATA32_GSEL push ds mov si,seg R_CODE mov ds,bx movzx esi,si shl esi,4 ; DS:[ESI] point to R_CODE assume ds:R_CODE mov ebx,[esi][p_DATA] ; DS:[EBX] points to _DATA assume ds:_DATA mov [ebx][IRQ1Event],TRUE ; set flag indicating IRQ1 ocurred assume ds:nothing jmp pIRQHandler else jmp CheckInt endif EH9except: ifndef BugMode ProcessExcep ErrCoPseg else pop ebp db 0EAh ; far jump opcode dw offset DCODE:_trap09 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler10: Invalid TSS fault ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== Error Code on stack = Selector ;== ;== Exit: Send to debugger ;== ;============================================================================== ExceptHandler10: push ebp ; fix stack for pIRQHandler movzx ebp,sp push 10 ; interrupt level jmp CheckInt EH10except: ifndef BugMode ProcessExcep ErrTSS else pop ebp db 0EAh ; far jump opcode dw offset DCODE:_trap10 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler11: Segment not present fault ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== Error Code on stack = Selector ;== ;== Exit: Send to debugger ;== ;============================================================================== ExceptHandler11: push ebp ; fix stack for pIRQHandler movzx ebp,sp push 11 ; interrupt level jmp CheckInt EH11except: ifndef BugMode ProcessExcep ErrSegNP else pop ebp db 0EAh ; far jump opcode dw offset DCODE:_trap11 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler12: Stack fault ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== Error Code on stack = Selector or 0000 ;== ;== Exit: Send to debugger ;== ;============================================================================== ExceptHandler12: push ebp ; fix stack for pIRQHandler movzx ebp,sp push 12 ; interrupt level jmp CheckInt EH12except: ifndef BugMode ProcessExcep ErrStack else pop ebp db 0EAh ; far jump opcode dw offset DCODE:_trap12 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler13: General protection fault ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== Error Code on stack = Selector or 0000 ;== ;== Exit: Send to debugger ;== ;============================================================================== ExceptHandler13: push ebp movzx ebp,sp ifdef BugMode push ax mov al,1011b out 20h,al in al,20h test al,100000b pop ax jz short EH13except endif ifdef BETA push ax mov al,1011b out 20h,al in al,20h test al,100000b pop ax jz short EH13except endif push 13 ; interrupt level jmp CheckInt add sp,2 EH13except: test [bp][VTFOE].VMTF_EFLAGShi,FLAGS_VM;Q: Virtual Mode? jnz VmFault ; Y: try to handle it! ifdef BugMode pop ebp db 0EAh ; far jump opcode dw offset DCODE:_trap13 ; offset dw DEBC_GSEL ; selector endif ifdef BETA int 1;BETA got here do to a protected mode GP fault endif ProcessExcep ErrGP ;============================================================================== ;== ;== ExceptHandler14: Page fault ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== Error Code on stack = type of fault ;== ;== Exit: A page table is created to handle faulting address ;== (PIW) ;============================================================================== ExceptHandler14: push ebp movzx ebp,sp push 14 ; interrupt level push ebx push esi mov bx,DATA32_GSEL push ds mov si,seg R_CODE mov ds,bx movzx esi,si shl esi,4 ; DS:[ESI] point to R_CODE assume ds:R_CODE ; DS:[EBX] point to _DATA mov ebx,cr2 or ebx,ebx ;Q: Page Fault Exception? jz pIRQHandler ; N: H/W interrupt pop ds ; clear stack for exception processing pop esi pop ebx add sp,2 ; interrupt vector must be cleared EH14except: call PageFaultHandler ;Q: Manageable page fault? jc short _exception ; N: error pop ebp ; Y: restore regs add sp,4 ; throw away error code iretd _exception: ifndef BugMode ProcessExcep ErrPage else pop ebp db 0EAh ; far jump opcode dw offset DCODE:_trap14 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler15: N/A (Dummy handler) Reflect spurious interrupts. ;== ;== Entry: N/A ;== ;== Exit: N/A ;== ;============================================================================== ExceptHandler15: push ebp ; fix stack for pIRQHandler movzx ebp,sp push 15 ; interrupt level push ebx push esi mov bx,DATA32_GSEL push ds mov si,seg R_CODE mov ds,bx movzx esi,si shl esi,4 ; DS:[ESI] point to R_CODE jmp pIRQHandler ; reflect interrupt EH15except: ProcessExcep 15 ;============================================================================== ;== ;== ExceptHandler16: Coprocessor Error ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== No error code on stack ;== ;== Exit: Send to debugger - GOES TO NOT PRESENT FAULT IN DEBUGGER FOR NOW ;== ;============================================================================== ExceptHandler16: ifndef BugMode push 0 push 0 push ebp movzx ebp,sp ProcessExcep ErrCoPerr else db 0EAh ; far jump opcode dw offset DCODE:_trap07 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== ExceptHandler17: Alignment Check ;== ;== Entry: Protected Mode via 386 Interrupt gate ;== Error code on stack = 0 ;== ;== Exit: Send to debugger - GOES TO NOT PRESENT FAULT IN DEBUGGER FOR NOW ;== ;============================================================================== ExceptHandler17: ifndef BugMode push ebp movzx ebp,sp ProcessExcep 17 else db 0EAh ; far jump opcode dw offset DCODE:_trap07 ; offset dw DEBC_GSEL ; selector endif ;============================================================================== ;== ;== CheckInt: Check if entry is due to an exception or a H/W interrupt. ;== ;== Entry: Protected Mode ;== EBP and interrupt number on STACK ;== ;== Exit: ;== ;============================================================================== CheckInt: push ebx push esi mov bx,DATA32_GSEL push ds mov si,seg R_CODE push ax mov ds,bx movzx esi,si shl esi,4 ; DS:[ESI] point to R_CODE assume ds:R_CODE ; DS:[EBX] point to _DATA ifndef PICtrap mov ebx,[esi][p_DATA] ; DS:[EBX] points to _DATA assume ds:_DATA mov ebx,[ebx][TSS].TSS386_ESP0 sub bx,size VM_TRAP_FRAME+VTFOE cmp bp,bx ;Q: Exception with error code? je short CIexcept ; Y: it is an exception pop ax ; N: reflect interrupt jmp pIRQHandler else test [esi][GenFlags],fNoINT ;Q: Interruptible protected mode kernel? jnz short CInoINT ; N: check for an exception via stack cmp [esi][MasterPICVec],DOS_MASTER_VECTOR ;Q: Need to check ISR? jne short CIexcept ; N: it's an exception ;QLEO mov ebx,[esi][p_DATA] ; Y: get _DATA pointer ;QLEO assume ds:_DATA mov ah,[bp][-2] ; get interrupt number mov al,1011b out 20h,al in al,20h ; read ISR from master PIC ;QLEO push ax mov al,[esi][LastOCW3] out 20h,al pop ax ;QLEO xchg al,ah bt ax,ax ;Q: ISR bit set? jnc short CIexcept ; N: must be an exception sub ax,8 ; Y: get IRQ number xor ah,ah bts ds:[esi][MasterIS],ax ;Q: Is this an exception before the EOI? pop ax jnc pIRQHandler ; N: reflect interrupt push ax endif CIexcept: movzx ebx,word ptr [bp][-2] ; interrupt number sub bx,8 ; zero relative mov bx,cs:[Exception][ebx*2] mov [bp][-2],bx pop ax pop ds pop esi pop ebx ret ifdef PICtrap CInoINT: ; ;QLEO Need to detect an exception/interrupt via stack depth! QLEO ; cmp bp,Stack0Size*4-size VM_TRAP_FRAME-VTFO ;Q: H/W interrupt from VM ? jne short CIexcept ; N: it is an exception pop ax ; Y: reflect interrupt jmp pIRQHandler endif Exception label word dw offset _TEXT:EH8except dw offset _TEXT:EH9except dw offset _TEXT:EH10except dw offset _TEXT:EH11except dw offset _TEXT:EH12except dw offset _TEXT:EH13except dw offset _TEXT:EH14except dw offset _TEXT:EH15except ;=============================================================================== ;== ;== CheckParity : Check for parity error and clear NMI. ;== This routine clears the parity error on the system board. ;== If the NMI/parity line is still set, a parity error is ;== assumed. The purpose of this routine is to distiguish ;== between true parity errors and NMIs from add in boards. ;== ;== Entry: CLI ;== ;== Exit: CLC = no parity error ;== STC = parity error ;== ;=============================================================================== CheckParity proc near push ax in al,PPI ; get parity error flags, reset then set jmp $+2 ; parity checking to reset parity on jmp $+2 ; system board ; ; Disable IOCHECK & PCHECK ; or al,PPO_MASK_IOCHECK+PPO_MASK_PCHECK out PPO,al ; disable them jmp $+2 jmp $+2 jmp $+2 ; ; Enable IOCHECK & PCHECK ; and al,NOT (PPO_MASK_IOCHECK+PPO_MASK_PCHECK) out PPO,al ; enable them system board parity now reset in al,PPI ; get parity error flags again test al,(PPI_IOCHECK OR PPI_PCHECK) ;Q: any parity errors still? jnz short CPParity ; Y: return parity clc ; N: wasn't a parity error CPexit: pop ax ret CPParity: stc jmp short CPexit CheckParity endp _TEXT ends ; end of segment ; end ; end of module 
25.142052
80
0.566387
217ee2c081e9b2a12ca24864e91fb145223aea64
704
asm
Assembly
oeis/062/A062152.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/062/A062152.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/062/A062152.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A062152: Sixth (unsigned) column of triangle A062138 (generalized a=5 Laguerre). ; Submitted by Jon Maiga ; 1,66,2772,96096,3027024,90810720,2663781120,77630192640,2270683134720,67111301537280,2013339046118400,61498356317798400,1916698771904716800,61039483966811750400,1988143192061868441600,66271439735395614720000,2261512880970375352320000,79019920664494291722240000,2827157161551906881617920000,103563230760006694189793280000,3883621153500251032117248000000,149057078558152491994595328000000,5853877994283806958333198336000000,235173185509488592586951098368000000,9661698371348156345447240957952000000 mov $1,$0 add $1,5 mov $0,$1 bin $0,5 add $1,5 lpb $1 mul $0,$1 sub $1,1 lpe div $0,3628800
46.933333
498
0.863636
dbd183ddf2f6faabc26c064c8b17a0fd2634de9c
1,607
asm
Assembly
libsrc/math/genmath/c/sccz80/norm.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/math/genmath/c/sccz80/norm.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/math/genmath/c/sccz80/norm.asm
ahjelm/z88dk
c4de367f39a76b41f6390ceeab77737e148178fa
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; ; Z88dk Generic Floating Point Math Library ; ; Normalise 48bit number in c ix de b ; current exponent in fa+5 ; Result -> fa +5 ; ; $Id: norm.asm,v 1.5 2016-06-21 21:16:49 dom Exp $: SECTION code_fp PUBLIC norm EXTERN pack EXTERN norm4 EXTERN fa .norm LD L,B LD H,E XOR A .NORM2 LD B,A LD A,C OR A JR NZ,NORM12 ;nz => 7 or fewer shifts needed ; shift c ix d hl left by one byte LD C,IXH LD A,IXL LD IXH,A LD IXL,D XOR A LD D,H LD H,L LD L,A ;...end of shifting ; LD A,B SUB 8 ;adjust exponent CP $D0 JR NZ,NORM2 jp norm4 ; .NORM8 DEC B ; shift c ix d hl left one bit... ADD HL,HL RL D EX AF,AF' ADD IX,IX EX AF,AF' JR NC,NORM10 INC IX .NORM10 EX AF,AF' RL C ;...end of shifting ; .NORM12 JP P,NORM8 ;p => high order bit still zero LD A,B ; move number to c ix de b LD E,H LD B,L OR A JP Z,pack ;z => exponent unchanged LD HL,fa+5 ;update exponent ADD A,(HL) LD (HL),A JP NC,norm4 ;nc => underflow (set to 0) RET Z ;z => underflow (leave as 0) jp pack
23.985075
60
0.400124
aacfec710c080876950ae3c4437546e100494e9c
277
asm
Assembly
libsrc/target/hemc/stdio/fputc_cons_native.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/target/hemc/stdio/fputc_cons_native.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/target/hemc/stdio/fputc_cons_native.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
SECTION code_clib PUBLIC fputc_cons_native PUBLIC _fputc_cons_native INCLUDE "target/hemc/def/hemc.def" fputc_cons_native: _fputc_cons_native: ld hl,2 add hl,sp ld a,(hl) cp 10 jr nz,continue ld c,13 call CONSOLE_OUT continue: ld c,(hl) call CONSOLE_OUT ret
12.590909
35
0.754513
2083b182a55aa6bfd14f74caf409e3db1034aa39
3,716
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_905.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_905.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_905.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %rbx push %rdi push %rdx push %rsi // Faulty Load lea addresses_WT+0x890e, %r13 nop add %rdx, %rdx movups (%r13), %xmm7 vpextrq $1, %xmm7, %rdi lea oracles, %rdx and $0xff, %rdi shlq $12, %rdi mov (%rdx,%rdi,1), %rdi pop %rsi pop %rdx pop %rdi pop %rbx pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WT', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_WT', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'39': 21829} 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 */
88.47619
2,999
0.663617
39a2eb05fd82f7ea1cf2698123ab30ab7eaf5a64
185,646
asm
Assembly
avx512/gcm_vaes_avx512.asm
spdk/intel-ipsec-mb
57e19c3598865745550a727b76f4612a4be420d1
[ "BSD-3-Clause" ]
1
2022-01-03T08:18:08.000Z
2022-01-03T08:18:08.000Z
avx512/gcm_vaes_avx512.asm
spdk/intel-ipsec-mb
57e19c3598865745550a727b76f4612a4be420d1
[ "BSD-3-Clause" ]
null
null
null
avx512/gcm_vaes_avx512.asm
spdk/intel-ipsec-mb
57e19c3598865745550a727b76f4612a4be420d1
[ "BSD-3-Clause" ]
9
2018-11-30T06:17:59.000Z
2022-01-07T02:43:07.000Z
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Copyright(c) 2018-2019, Intel Corporation All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions ; are met: ; * Redistributions of source code must retain the above copyright ; notice, this list of conditions and the following disclaimer. ; * Redistributions in binary form must reproduce the above copyright ; notice, this list of conditions and the following disclaimer in ; the documentation and/or other materials provided with the ; distribution. ; * Neither the name of Intel Corporation nor the names of its ; contributors may be used to endorse or promote products derived ; from this software without specific prior written permission. ; ; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Authors: ; Erdinc Ozturk ; Vinodh Gopal ; James Guilford ; Tomasz Kantecki ; ; ; References: ; This code was derived and highly optimized from the code described in paper: ; Vinodh Gopal et. al. Optimized Galois-Counter-Mode Implementation on Intel Architecture Processors. August, 2010 ; The details of the implementation is explained in: ; Erdinc Ozturk et. al. Enabling High-Performance Galois-Counter-Mode on Intel Architecture Processors. October, 2012. ; ; ; ; ; Assumptions: ; ; ; ; iv: ; 0 1 2 3 ; 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; | Salt (From the SA) | ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; | Initialization Vector | ; | (This is the sequence number from IPSec header) | ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; | 0x1 | ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; ; ; ; AAD: ; AAD will be padded with 0 to the next 16byte multiple ; for example, assume AAD is a u32 vector ; ; if AAD is 8 bytes: ; AAD[3] = {A0, A1}; ; padded AAD in xmm register = {A1 A0 0 0} ; ; 0 1 2 3 ; 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; | SPI (A1) | ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; | 32-bit Sequence Number (A0) | ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; | 0x0 | ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; ; AAD Format with 32-bit Sequence Number ; ; if AAD is 12 bytes: ; AAD[3] = {A0, A1, A2}; ; padded AAD in xmm register = {A2 A1 A0 0} ; ; 0 1 2 3 ; 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; | SPI (A2) | ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; | 64-bit Extended Sequence Number {A1,A0} | ; | | ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; | 0x0 | ; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ; ; AAD Format with 64-bit Extended Sequence Number ; ; ; aadLen: ; Must be a multiple of 4 bytes and from the definition of the spec. ; The code additionally supports any aadLen length. ; ; TLen: ; from the definition of the spec, TLen can only be 8, 12 or 16 bytes. ; ; poly = x^128 + x^127 + x^126 + x^121 + 1 ; throughout the code, one tab and two tab indentations are used. one tab is for GHASH part, two tabs is for AES part. ; %include "include/os.asm" %include "include/reg_sizes.asm" %include "gcm_defines.asm" %include "mb_mgr_datastruct.asm" %include "job_aes_hmac.asm" %include "include/memcpy.asm" %ifndef GCM128_MODE %ifndef GCM192_MODE %ifndef GCM256_MODE %error "No GCM mode selected for gcm_avx512.asm!" %endif %endif %endif ;; Decide on AES-GCM key size to compile for %ifdef GCM128_MODE %define NROUNDS 9 %define FN_NAME(x,y) aes_gcm_ %+ x %+ _128 %+ y %+ vaes_avx512 %endif %ifdef GCM192_MODE %define NROUNDS 11 %define FN_NAME(x,y) aes_gcm_ %+ x %+ _192 %+ y %+ vaes_avx512 %endif %ifdef GCM256_MODE %define NROUNDS 13 %define FN_NAME(x,y) aes_gcm_ %+ x %+ _256 %+ y %+ vaes_avx512 %endif section .text default rel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Stack frame definition ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %ifidn __OUTPUT_FORMAT__, win64 %define XMM_STORAGE (10*16) ; space for 10 XMM registers %define GP_STORAGE (10*8) ; space for 9 GP registers + 1 for alignment %else %define XMM_STORAGE 0 %define GP_STORAGE (8*8) ; space for 7 GP registers + 1 for alignment %endif %define LOCAL_STORAGE (2*8) ; space for 1 GP register + 1 for alignment ;;; sequence is (bottom-up): GP, XMM, local %define STACK_GP_OFFSET 0 %define STACK_XMM_OFFSET (STACK_GP_OFFSET + GP_STORAGE) %define STACK_LOCAL_OFFSET (STACK_XMM_OFFSET + XMM_STORAGE) %define STACK_FRAME_SIZE (STACK_LOCAL_OFFSET + LOCAL_STORAGE) ;; for compatibility with stack argument definitions in gcm_defines.asm %define STACK_OFFSET 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Utility Macros ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; =========================================================================== ;;; =========================================================================== ;;; Horizontal XOR - 4 x 128bits xored together %macro VHPXORI4x128 2 %define %%REG %1 ; [in/out] zmm512 4x128bits to xor; i128 on output %define %%TMP %2 ; temporary register vextracti64x4 YWORD(%%TMP), %%REG, 1 vpxorq YWORD(%%REG), YWORD(%%REG), YWORD(%%TMP) vextracti32x4 XWORD(%%TMP), YWORD(%%REG), 1 vpxorq XWORD(%%REG), XWORD(%%REG), XWORD(%%TMP) %endmacro ; VHPXORI4x128 ;;; =========================================================================== ;;; =========================================================================== ;;; schoolbook multiply - 1st step %macro VCLMUL_STEP1 6-7 %define %%KP %1 ; [in] key pointer %define %%HI %2 ; [in] previous blocks 4 to 7 %define %%TMP %3 %define %%TH %4 ; [out] tmp high %define %%TM %5 ; [out] tmp medium %define %%TL %6 ; [out] tmp low %define %%HKEY %7 ; [in] optional hash key to start multiply with %if %0 == 6 vmovdqu64 %%TMP, [%%KP + HashKey_4] %else vmovdqu64 %%TMP, %%HKEY %endif vpclmulqdq %%TH, %%HI, %%TMP, 0x11 ; %%T5 = a1*b1 vpclmulqdq %%TL, %%HI, %%TMP, 0x00 ; %%T7 = a0*b0 vpclmulqdq %%TM, %%HI, %%TMP, 0x01 ; %%T6 = a1*b0 vpclmulqdq %%TMP, %%HI, %%TMP, 0x10 ; %%T4 = a0*b1 vpxorq %%TM, %%TM, %%TMP ; [%%TH : %%TM : %%TL] %endmacro ; VCLMUL_STEP1 ;;; =========================================================================== ;;; =========================================================================== ;;; schoolbook multiply - 2nd step %macro VCLMUL_STEP2 9-10 %define %%KP %1 ; [in] key pointer %define %%HI %2 ; [out] high 128b of hash to reduce %define %%LO %3 ; [in/out] previous blocks 0 to 3; low 128b of hash to reduce %define %%TMP0 %4 %define %%TMP1 %5 %define %%TMP2 %6 %define %%TH %7 ; [in] tmp high %define %%TM %8 ; [in] tmp medium %define %%TL %9 ; [in] tmp low %define %%HKEY %10 ; [in] optional hash key to start multiply with %if %0 == 9 vmovdqu64 %%TMP0, [%%KP + HashKey_8] %else vmovdqu64 %%TMP0, %%HKEY %endif vpclmulqdq %%TMP1, %%LO, %%TMP0, 0x10 ; %%TMP1 = a0*b1 vpclmulqdq %%TMP2, %%LO, %%TMP0, 0x11 ; %%TMP2 = a1*b1 vpxorq %%TH, %%TH, %%TMP2 vpclmulqdq %%TMP2, %%LO, %%TMP0, 0x00 ; %%TMP2 = a0*b0 vpxorq %%TL, %%TL, %%TMP2 vpclmulqdq %%TMP0, %%LO, %%TMP0, 0x01 ; %%TMP0 = a1*b0 vpternlogq %%TM, %%TMP1, %%TMP0, 0x96 ; %%TM = TM xor TMP1 xor TMP0 ;; finish multiplications vpsrldq %%TMP2, %%TM, 8 vpxorq %%HI, %%TH, %%TMP2 vpslldq %%TMP2, %%TM, 8 vpxorq %%LO, %%TL, %%TMP2 ;; xor 128bit words horizontally and compute [(X8*H1) + (X7*H2) + ... ((X1+Y0)*H8] ;; note: (X1+Y0) handled elsewhere VHPXORI4x128 %%HI, %%TMP2 VHPXORI4x128 %%LO, %%TMP1 ;; HIx holds top 128 bits ;; LOx holds low 128 bits ;; - further reductions to follow %endmacro ; VCLMUL_STEP2 ;;; =========================================================================== ;;; =========================================================================== ;;; AVX512 reduction macro %macro VCLMUL_REDUCE 6 %define %%OUT %1 ;; [out] zmm/ymm/xmm: result (must not be %%TMP1 or %%HI128) %define %%POLY %2 ;; [in] zmm/ymm/xmm: polynomial %define %%HI128 %3 ;; [in] zmm/ymm/xmm: high 128b of hash to reduce %define %%LO128 %4 ;; [in] zmm/ymm/xmm: low 128b of hash to reduce %define %%TMP0 %5 ;; [in] zmm/ymm/xmm: temporary register %define %%TMP1 %6 ;; [in] zmm/ymm/xmm: temporary register ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; first phase of the reduction vpclmulqdq %%TMP0, %%POLY, %%LO128, 0x01 vpslldq %%TMP0, %%TMP0, 8 ; shift-L xmm2 2 DWs vpxorq %%TMP0, %%LO128, %%TMP0 ; first phase of the reduction complete ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; second phase of the reduction vpclmulqdq %%TMP1, %%POLY, %%TMP0, 0x00 vpsrldq %%TMP1, %%TMP1, 4 ; shift-R 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) vpclmulqdq %%OUT, %%POLY, %%TMP0, 0x10 vpslldq %%OUT, %%OUT, 4 ; shift-L 1 DW (Shift-L 1-DW to obtain result with no shifts) vpternlogq %%OUT, %%TMP1, %%HI128, 0x96 ; OUT (GHASH) = OUT xor TMP1 xor HI128(HI) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %endmacro ;;; =========================================================================== ;;; =========================================================================== ;;; AVX512 VPCLMULQDQ SINGLE BLOCK GHASH MUL %macro VCLMUL_1BLOCK 10 %define %%OUT %1 ;; [in/out] zmm intermediate result %define %%AAD_HASH %2 ;; [in] xmm register with current hash value or 'no_aad' %define %%GDATA %3 ;; [in] pointer to hash key table %define %%HKEY_OFFSET %4 ;; [in] offset to hash key table %define %%TEXT %5 ;; [in] pointer to data or an xmm register %define %%TEXT_SRC %6 ;; [in] selects source of the text (text_mem, text_zmm, text_ready) %define %%FIRST_BLOCK %7 ;; [in] selects which block is processed (first or not_first) %define %%SHFMSK %8 ;; [in] ZMM register with byte shuffle mask or 'no_shuffle' %define %%LT0 %9 ;; [clobbered] temporary zmm %define %%LT1 %10 ;; [clobbered] temporary zmm ;; load, broadcast and permute the hash key vbroadcastf64x2 %%LT1, [%%GDATA + %%HKEY_OFFSET] ;; 0110_1001b => [ Med Med Low High ] multiply products ;; - see vpermilpd further down and VCLMUL_1BLOCK_GATHER for details vpermilpd %%LT1, %%LT1, 0110_1001b ; => [ MM LH ] %ifidn %%FIRST_BLOCK, first %ifnidn %%AAD_HASH, no_aad ;; current AAD needs to be broadcasted across ZMM then XOR with TEXT ;; use %%OUT for broadcasted AAD vmovdqa64 XWORD(%%OUT), %%AAD_HASH vshufi64x2 %%OUT, %%OUT, %%OUT, 0 %endif ; !no_aad %endif ; first block ;; load and broadcast the text block %ifidn %%TEXT_SRC, text_mem vbroadcastf64x2 %%LT0, [%%TEXT] %endif %ifidn %%TEXT_SRC, text_zmm vshufi64x2 %%LT0, %%TEXT, %%TEXT, 0000_0000b %endif %ifidn %%TEXT_SRC, text_ready vmovdqa64 %%LT0, %%TEXT %endif ;; shuffle the text block %ifnidn %%SHFMSK, no_shuffle vpshufb %%LT0, %%SHFMSK %endif %ifidn %%FIRST_BLOCK, first %ifnidn %%AAD_HASH, no_aad ;; xor current hash with the 1st text block vpxorq %%LT0, %%LT0, %%OUT %endif %endif %ifnidn %%TEXT_SRC, text_ready ;; 1001_1001b => [ Med Med Low High ] multiply products ;; - see vpermilpd above and VCLMUL_1BLOCK_GATHER for details vpermilpd %%LT0, %%LT0, 1001_1001b %endif %ifidn %%FIRST_BLOCK, first ;; put result directly into OUT vpclmulqdq %%OUT, %%LT0, %%LT1, 0x00 ; all 64-bit words permuted above %else ;; xor CLMUL result with OUT and put result into OUT vpclmulqdq %%LT0, %%LT0, %%LT1, 0x00 ; all 64-bit words permuted above vpxorq %%OUT, %%LT0, %%OUT %endif %endmacro ;;; =========================================================================== ;;; =========================================================================== ;;; SINGLE BLOCK GHASH MUL PREPARE DATA BLOCK ;;; get the blocks ready for hashing ;;; - extract block ;;; - replicate block across whole ZMM register ;;; - permute 64-bit words for CLMUL %macro VCLMUL_1BLOCK_DATAPREP 3 %define %%OUT %1 ;; [out] zmm %define %%IN %2 ;; [in] zmm %define %%INDEX %3 ;; [in] 0 to 3 %if %%INDEX == 0 vshufi64x2 %%OUT, %%IN, %%IN, 0000_0000b %elif %%INDEX == 1 vshufi64x2 %%OUT, %%IN, %%IN, 0101_0101b %elif %%INDEX == 2 vshufi64x2 %%OUT, %%IN, %%IN, 1010_1010b %else vshufi64x2 %%OUT, %%IN, %%IN, 1111_1111b %endif ;; 1001_1001b => [ Med Med Low High ] multiply products ;; - see vpermilpd above and VCLMUL_1BLOCK_GATHER for details vpermilpd %%OUT, %%OUT, 1001_1001b %endmacro ;;; =========================================================================== ;;; =========================================================================== ;;; AVX512 VPCLMULQDQ GATHER GHASH result for further reduction ;;; ;;; %%IN here looks as follows ;;; [127.. 0] sum of hi 64-bit word multiplies (hi hash key with hi text) ;;; [255..128] sum of lo 64-bit word multiplies (lo hash key with lo text) ;;; [383..256] sum of med 64-bit word multiplies (hi hash key with lo text) ;;; [511..384] sum of med 64-bit word multiplies (lo hash key with hi text) ;;; ;;; - medium 128-bit words need to be xor'ed together ;;; - then the med results need to be added to lo and hi words accordingly ;;; %macro VCLMUL_1BLOCK_GATHER 6 %define %%OUTH %1 ;; [out] xmm result high 128 bits %define %%OUTL %2 ;; [out] xmm result low 128 bits %define %%IN %3 ;; [in] zmm intermediate result %define %%LT1 %4 ;; [clobbered] temporary zmm %define %%LT2 %5 ;; [clobbered] temporary zmm %define %%LT3 %6 ;; [clobbered] temporary zmm vextracti32x4 XWORD(%%LT1), %%IN, 1 vextracti32x4 XWORD(%%LT2), %%IN, 2 vextracti32x4 XWORD(%%LT3), %%IN, 3 vpxorq XWORD(%%LT2), XWORD(%%LT2), XWORD(%%LT3) vpslldq XWORD(%%LT3), XWORD(%%LT2), 8 ; shift-L 2 DWs vpsrldq XWORD(%%LT2), XWORD(%%LT2), 8 ; shift-R 2 DWs ;; accumulate the results in %%OUTH:%%OUTL vpxorq %%OUTH, XWORD(%%LT2), XWORD(%%IN) vpxorq %%OUTL, XWORD(%%LT3), XWORD(%%LT1) %endmacro ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; GHASH_MUL MACRO to implement: Data*HashKey mod (128,127,126,121,0) ; Input: A and B (128-bits each, bit-reflected) ; Output: C = A*B*x mod poly, (i.e. >>1 ) ; To compute GH = GH*HashKey mod poly, give HK = HashKey<<1 mod poly as input ; GH = GH * HK * x mod poly which is equivalent to GH*HashKey mod poly. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %macro GHASH_MUL 7 %define %%GH %1 ; 16 Bytes %define %%HK %2 ; 16 Bytes %define %%T1 %3 %define %%T2 %4 %define %%T3 %5 %define %%T4 %6 %define %%T5 %7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; vpclmulqdq %%T1, %%GH, %%HK, 0x11 ; %%T1 = a1*b1 vpclmulqdq %%T2, %%GH, %%HK, 0x00 ; %%T2 = a0*b0 vpclmulqdq %%T3, %%GH, %%HK, 0x01 ; %%T3 = a1*b0 vpclmulqdq %%GH, %%GH, %%HK, 0x10 ; %%GH = a0*b1 vpxorq %%GH, %%GH, %%T3 vpsrldq %%T3, %%GH, 8 ; shift-R %%GH 2 DWs vpslldq %%GH, %%GH, 8 ; shift-L %%GH 2 DWs vpxorq %%T1, %%T1, %%T3 vpxorq %%GH, %%GH, %%T2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;first phase of the reduction vmovdqu64 %%T3, [rel POLY2] vpclmulqdq %%T2, %%T3, %%GH, 0x01 vpslldq %%T2, %%T2, 8 ; shift-L %%T2 2 DWs vpxorq %%GH, %%GH, %%T2 ; first phase of the reduction complete ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;second phase of the reduction vpclmulqdq %%T2, %%T3, %%GH, 0x00 vpsrldq %%T2, %%T2, 4 ; shift-R %%T2 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) vpclmulqdq %%GH, %%T3, %%GH, 0x10 vpslldq %%GH, %%GH, 4 ; shift-L %%GH 1 DW (Shift-L 1-DW to obtain result with no shifts) ; second phase of the reduction complete, the result is in %%GH vpternlogq %%GH, %%T1, %%T2, 0x96 ; GH = GH xor T1 xor T2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %endmacro ; In PRECOMPUTE, the commands filling Hashkey_i_k are not required for avx512 ; functions, but are kept to allow users to switch cpu architectures between calls ; of pre, init, update, and finalize. %macro PRECOMPUTE 8 %define %%GDATA %1 %define %%HK %2 %define %%T1 %3 %define %%T2 %4 %define %%T3 %5 %define %%T4 %6 %define %%T5 %7 %define %%T6 %8 ; Haskey_i_k holds XORed values of the low and high parts of the Haskey_i vmovdqa %%T5, %%HK vpshufd %%T1, %%T5, 01001110b vpxor %%T1, %%T5 vmovdqu [%%GDATA + HashKey_k], %%T1 GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^2<<1 mod poly vmovdqu [%%GDATA + HashKey_2], %%T5 ; [HashKey_2] = HashKey^2<<1 mod poly vpshufd %%T1, %%T5, 01001110b vpxor %%T1, %%T5 vmovdqu [%%GDATA + HashKey_2_k], %%T1 GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^3<<1 mod poly vmovdqu [%%GDATA + HashKey_3], %%T5 vpshufd %%T1, %%T5, 01001110b vpxor %%T1, %%T5 vmovdqu [%%GDATA + HashKey_3_k], %%T1 GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^4<<1 mod poly vmovdqu [%%GDATA + HashKey_4], %%T5 vpshufd %%T1, %%T5, 01001110b vpxor %%T1, %%T5 vmovdqu [%%GDATA + HashKey_4_k], %%T1 GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^5<<1 mod poly vmovdqu [%%GDATA + HashKey_5], %%T5 vpshufd %%T1, %%T5, 01001110b vpxor %%T1, %%T5 vmovdqu [%%GDATA + HashKey_5_k], %%T1 GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^6<<1 mod poly vmovdqu [%%GDATA + HashKey_6], %%T5 vpshufd %%T1, %%T5, 01001110b vpxor %%T1, %%T5 vmovdqu [%%GDATA + HashKey_6_k], %%T1 GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^7<<1 mod poly vmovdqu [%%GDATA + HashKey_7], %%T5 vpshufd %%T1, %%T5, 01001110b vpxor %%T1, %%T5 vmovdqu [%%GDATA + HashKey_7_k], %%T1 GHASH_MUL %%T5, %%HK, %%T1, %%T3, %%T4, %%T6, %%T2 ; %%T5 = HashKey^8<<1 mod poly vmovdqu [%%GDATA + HashKey_8], %%T5 vpshufd %%T1, %%T5, 01001110b vpxor %%T1, %%T5 vmovdqu [%%GDATA + HashKey_8_k], %%T1 %endmacro ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; READ_SMALL_DATA_INPUT ;;; Packs xmm register with data when data input is less or equal to 16 bytes ;;; Returns 0 if data has length 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %macro READ_SMALL_DATA_INPUT 5 %define %%OUTPUT %1 ; [out] xmm register %define %%INPUT %2 ; [in] buffer pointer to read from %define %%LENGTH %3 ; [in] number of bytes to read %define %%TMP1 %4 ; [clobbered] %define %%MASK %5 ; [out] k1 to k7 register to store the partial block mask cmp %%LENGTH, 16 jge %%_read_small_data_ge16 lea %%TMP1, [rel byte_len_to_mask_table] %ifidn __OUTPUT_FORMAT__, win64 add %%TMP1, %%LENGTH add %%TMP1, %%LENGTH kmovw %%MASK, [%%TMP1] %else kmovw %%MASK, [%%TMP1 + %%LENGTH*2] %endif vmovdqu8 %%OUTPUT{%%MASK}{z}, [%%INPUT] jmp %%_read_small_data_end %%_read_small_data_ge16: VX512LDR %%OUTPUT, [%%INPUT] mov %%TMP1, 0xffff kmovq %%MASK, %%TMP1 %%_read_small_data_end: %endmacro ; READ_SMALL_DATA_INPUT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; CALC_AAD_HASH: Calculates the hash of the data which will not be encrypted. ; Input: The input data (A_IN), that data's length (A_LEN), and the hash key (HASH_KEY). ; Output: The hash of the data (AAD_HASH). ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %macro CALC_AAD_HASH 17 %define %%A_IN %1 %define %%A_LEN %2 %define %%AAD_HASH %3 ; xmm output register %define %%GDATA_KEY %4 %define %%ZT0 %5 ; zmm temp reg 0 %define %%ZT1 %6 ; zmm temp reg 1 %define %%ZT2 %7 %define %%ZT3 %8 %define %%ZT4 %9 %define %%ZT5 %10 ; zmm temp reg 5 %define %%ZT6 %11 ; zmm temp reg 6 %define %%ZT7 %12 ; zmm temp reg 7 %define %%ZT8 %13 ; zmm temp reg 8 %define %%ZT9 %14 ; zmm temp reg 9 %define %%T1 %15 ; temp reg 1 %define %%T2 %16 %define %%T3 %17 %define %%SHFMSK %%ZT9 %define %%POLY %%ZT8 %define %%TH %%ZT7 %define %%TM %%ZT6 %define %%TL %%ZT5 mov %%T1, %%A_IN ; T1 = AAD mov %%T2, %%A_LEN ; T2 = aadLen vpxor %%AAD_HASH, %%AAD_HASH vmovdqa64 %%SHFMSK, [rel SHUF_MASK] vmovdqa64 %%POLY, [rel POLY2] %%_get_AAD_loop128: cmp %%T2, 128 jl %%_exit_AAD_loop128 vmovdqu64 %%ZT2, [%%T1 + 64*0] ; LO blocks (0-3) vmovdqu64 %%ZT1, [%%T1 + 64*1] ; HI blocks (4-7) vpshufb %%ZT2, %%SHFMSK vpshufb %%ZT1, %%SHFMSK vpxorq %%ZT2, %%ZT2, ZWORD(%%AAD_HASH) VCLMUL_STEP1 %%GDATA_KEY, %%ZT1, %%ZT0, %%TH, %%TM, %%TL VCLMUL_STEP2 %%GDATA_KEY, %%ZT1, %%ZT2, %%ZT0, %%ZT3, %%ZT4, %%TH, %%TM, %%TL ;; result in %%ZT1(H):%%ZT2(L) ;; reduce and put the result in AAD_HASH VCLMUL_REDUCE %%AAD_HASH, XWORD(%%POLY), XWORD(%%ZT1), XWORD(%%ZT2), XWORD(%%ZT0), XWORD(%%ZT3) sub %%T2, 128 je %%_CALC_AAD_done add %%T1, 128 jmp %%_get_AAD_loop128 %%_exit_AAD_loop128: or %%T2, %%T2 jz %%_CALC_AAD_done ;; calculate hash_key position to start with mov %%T3, %%T2 add %%T3, 15 and %%T3, -16 ; 1 to 8 blocks possible here neg %%T3 add %%T3, HashKey_1 + 16 lea %%T3, [%%GDATA_KEY + %%T3] ;; load, broadcast and shuffle TEXT cmp %%T2, 16 jl %%_AAD_rd_partial_block VCLMUL_1BLOCK %%ZT1, %%AAD_HASH, %%T3, 0, \ %%T1, text_mem, first, \ %%SHFMSK, %%ZT5, %%ZT6 add %%T3, 16 ; move to next hashkey add %%T1, 16 ; move to next data block sub %%T2, 16 jmp %%_AAD_blocks %%_AAD_rd_partial_block: ;; need T3 as temporary register for partial read ;; save in ZT3 and restore later vmovq XWORD(%%ZT3), %%T3 READ_SMALL_DATA_INPUT XWORD(%%ZT0), %%T1, %%T2, %%T3, k1 vmovq %%T3, XWORD(%%ZT3) VCLMUL_1BLOCK %%ZT1, %%AAD_HASH, %%T3, 0, \ %%ZT0, text_zmm, first, \ %%SHFMSK, %%ZT5, %%ZT6 jmp %%_AAD_reduce %%_AAD_blocks: or %%T2, %%T2 jz %%_AAD_reduce cmp %%T2, 16 jl %%_AAD_rd_partial_block_2 VCLMUL_1BLOCK %%ZT1, %%AAD_HASH, %%T3, 0, \ %%T1, text_mem, not_first, \ %%SHFMSK, %%ZT5, %%ZT6 add %%T3, 16 ; move to next hashkey add %%T1, 16 sub %%T2, 16 jmp %%_AAD_blocks %%_AAD_rd_partial_block_2: ;; need T3 as temporary register for partial read ;; save in ZT3 and restore later vmovq XWORD(%%ZT3), %%T3 READ_SMALL_DATA_INPUT \ XWORD(%%ZT0), %%T1, %%T2, %%T3, k1 vmovq %%T3, XWORD(%%ZT3) VCLMUL_1BLOCK %%ZT1, %%AAD_HASH, %%T3, 0, \ %%ZT0, text_zmm, not_first, \ %%SHFMSK, %%ZT5, %%ZT6 %%_AAD_reduce: ;; accumulate the results in %%ZT0(H):%%ZT2(L) VCLMUL_1BLOCK_GATHER \ XWORD(%%ZT0), XWORD(%%ZT2), %%ZT1, %%ZT5, %%ZT6, %%ZT7 VCLMUL_REDUCE %%AAD_HASH, XWORD(%%POLY), \ XWORD(%%ZT0), XWORD(%%ZT2), \ XWORD(%%ZT5), XWORD(%%ZT6) %%_CALC_AAD_done: %endmacro ; CALC_AAD_HASH ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; PARTIAL_BLOCK ;;; Handles encryption/decryption and the tag partial blocks between ;;; update calls. ;;; Requires the input data be at least 1 byte long. ;;; Output: ;;; A cipher/plain of the first partial block (CYPH_PLAIN_OUT), ;;; AAD_HASH and updated GDATA_CTX ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %macro PARTIAL_BLOCK 22 %define %%GDATA_KEY %1 ; [in] key pointer %define %%GDATA_CTX %2 ; [in] context pointer %define %%CYPH_PLAIN_OUT %3 ; [in] output buffer %define %%PLAIN_CYPH_IN %4 ; [in] input buffer %define %%PLAIN_CYPH_LEN %5 ; [in] buffer length %define %%DATA_OFFSET %6 ; [in/out] data offset (gets updated) %define %%AAD_HASH %7 ; [out] updated GHASH value %define %%ENC_DEC %8 ; [in] cipher direction %define %%GPTMP0 %9 ; [clobbered] GP temporary register %define %%GPTMP1 %10 ; [clobbered] GP temporary register %define %%GPTMP2 %11 ; [clobbered] GP temporary register %define %%ZTMP0 %12 ; [clobbered] ZMM temporary register %define %%ZTMP1 %13 ; [clobbered] ZMM temporary register %define %%ZTMP2 %14 ; [clobbered] ZMM temporary register %define %%ZTMP3 %15 ; [clobbered] ZMM temporary register %define %%ZTMP4 %16 ; [clobbered] ZMM temporary register %define %%ZTMP5 %17 ; [clobbered] ZMM temporary register %define %%ZTMP6 %18 ; [clobbered] ZMM temporary register %define %%ZTMP7 %19 ; [clobbered] ZMM temporary register %define %%ZTMP8 %20 ; [clobbered] ZMM temporary register %define %%ZTMP9 %21 ; [clobbered] ZMM temporary register %define %%MASKREG %22 ; [clobbered] mask temporary register %define %%XTMP0 XWORD(%%ZTMP0) %define %%XTMP1 XWORD(%%ZTMP1) %define %%XTMP2 XWORD(%%ZTMP2) %define %%XTMP3 XWORD(%%ZTMP3) %define %%XTMP4 XWORD(%%ZTMP4) %define %%XTMP5 XWORD(%%ZTMP5) %define %%XTMP6 XWORD(%%ZTMP6) %define %%XTMP7 XWORD(%%ZTMP7) %define %%XTMP8 XWORD(%%ZTMP8) %define %%XTMP9 XWORD(%%ZTMP9) %define %%LENGTH %%GPTMP0 %define %%IA0 %%GPTMP1 %define %%IA1 %%GPTMP2 mov %%LENGTH, [%%GDATA_CTX + PBlockLen] or %%LENGTH, %%LENGTH je %%_partial_block_done ;Leave Macro if no partial blocks READ_SMALL_DATA_INPUT %%XTMP0, %%PLAIN_CYPH_IN, %%PLAIN_CYPH_LEN, %%IA0, %%MASKREG ;; XTMP1 = my_ctx_data.partial_block_enc_key vmovdqu64 %%XTMP1, [%%GDATA_CTX + PBlockEncKey] vmovdqu64 %%XTMP2, [%%GDATA_KEY + HashKey] ;; adjust the shuffle mask pointer to be able to shift right %%LENGTH bytes ;; (16 - %%LENGTH) is the number of bytes in plaintext mod 16) lea %%IA0, [rel SHIFT_MASK] add %%IA0, %%LENGTH vmovdqu64 %%XTMP3, [%%IA0] ; shift right shuffle mask vpshufb %%XTMP1, %%XTMP3 %ifidn %%ENC_DEC, DEC ;; keep copy of cipher text in %%XTMP4 vmovdqa64 %%XTMP4, %%XTMP0 %endif vpxorq %%XTMP1, %%XTMP0 ; Cyphertext XOR E(K, Yn) ;; Set %%IA1 to be the amount of data left in CYPH_PLAIN_IN after filling the block ;; Determine if partial block is not being filled and shift mask accordingly mov %%IA1, %%PLAIN_CYPH_LEN add %%IA1, %%LENGTH sub %%IA1, 16 jge %%_no_extra_mask sub %%IA0, %%IA1 %%_no_extra_mask: ;; get the appropriate mask to mask out bottom %%LENGTH bytes of %%XTMP1 ;; - mask out bottom %%LENGTH bytes of %%XTMP1 vmovdqu64 %%XTMP0, [%%IA0 + ALL_F - SHIFT_MASK] vpand %%XTMP1, %%XTMP0 %ifidn %%ENC_DEC, DEC vpand %%XTMP4, %%XTMP0 vpshufb %%XTMP4, [rel SHUF_MASK] vpshufb %%XTMP4, %%XTMP3 vpxorq %%AAD_HASH, %%XTMP4 %else vpshufb %%XTMP1, [rel SHUF_MASK] vpshufb %%XTMP1, %%XTMP3 vpxorq %%AAD_HASH, %%XTMP1 %endif cmp %%IA1, 0 jl %%_partial_incomplete ;; GHASH computation for the last <16 Byte block GHASH_MUL %%AAD_HASH, %%XTMP2, %%XTMP5, %%XTMP6, %%XTMP7, %%XTMP8, %%XTMP9 mov qword [%%GDATA_CTX + PBlockLen], 0 ;; Set %%IA1 to be the number of bytes to write out mov %%IA0, %%LENGTH mov %%LENGTH, 16 sub %%LENGTH, %%IA0 jmp %%_enc_dec_done %%_partial_incomplete: %ifidn __OUTPUT_FORMAT__, win64 mov %%IA0, %%PLAIN_CYPH_LEN add [%%GDATA_CTX + PBlockLen], %%IA0 %else add [%%GDATA_CTX + PBlockLen], %%PLAIN_CYPH_LEN %endif mov %%LENGTH, %%PLAIN_CYPH_LEN %%_enc_dec_done: ;; output encrypted Bytes lea %%IA0, [rel byte_len_to_mask_table] kmovw %%MASKREG, [%%IA0 + %%LENGTH*2] vmovdqu64 [%%GDATA_CTX + AadHash], %%AAD_HASH %ifidn %%ENC_DEC, ENC ;; shuffle XTMP1 back to output as ciphertext vpshufb %%XTMP1, [rel SHUF_MASK] vpshufb %%XTMP1, %%XTMP3 %endif vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET]{%%MASKREG}, %%XTMP1 add %%DATA_OFFSET, %%LENGTH %%_partial_block_done: %endmacro ; PARTIAL_BLOCK %macro GHASH_SINGLE_MUL 9 %define %%GDATA %1 %define %%HASHKEY %2 %define %%CIPHER %3 %define %%STATE_11 %4 %define %%STATE_00 %5 %define %%STATE_MID %6 %define %%T1 %7 %define %%T2 %8 %define %%FIRST %9 vmovdqu %%T1, [%%GDATA + %%HASHKEY] %ifidn %%FIRST, first vpclmulqdq %%STATE_11, %%CIPHER, %%T1, 0x11 ; %%T4 = a1*b1 vpclmulqdq %%STATE_00, %%CIPHER, %%T1, 0x00 ; %%T4_2 = a0*b0 vpclmulqdq %%STATE_MID, %%CIPHER, %%T1, 0x01 ; %%T6 = a1*b0 vpclmulqdq %%T2, %%CIPHER, %%T1, 0x10 ; %%T5 = a0*b1 vpxor %%STATE_MID, %%STATE_MID, %%T2 %else vpclmulqdq %%T2, %%CIPHER, %%T1, 0x11 vpxor %%STATE_11, %%STATE_11, %%T2 vpclmulqdq %%T2, %%CIPHER, %%T1, 0x00 vpxor %%STATE_00, %%STATE_00, %%T2 vpclmulqdq %%T2, %%CIPHER, %%T1, 0x01 vpxor %%STATE_MID, %%STATE_MID, %%T2 vpclmulqdq %%T2, %%CIPHER, %%T1, 0x10 vpxor %%STATE_MID, %%STATE_MID, %%T2 %endif %endmacro ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; This macro is used to "warm-up" pipeline for GHASH_8_ENCRYPT_8_PARALLEL ;;; macro code. It is called only for data lenghts 128 and above. ;;; The flow is as follows: ;;; - encrypt the initial %%num_initial_blocks blocks (can be 0) ;;; - encrypt the next 8 blocks and stitch with ;;; GHASH for the first %%num_initial_blocks ;;; - the last 8th block can be partial (lengths between 129 and 239) ;;; - partial block ciphering is handled within this macro ;;; - top bytes of such block are cleared for ;;; the subsequent GHASH calculations ;;; - PBlockEncKey needs to be setup in case of multi-call ;;; - top bytes of the block need to include encrypted counter block so that ;;; when handling partial block case text is read and XOR'ed against it. ;;; This needs to be in un-shuffled format. %macro INITIAL_BLOCKS 22 %define %%GDATA_KEY %1 ; [in] pointer to GCM keys %define %%GDATA_CTX %2 ; [in] pointer to GCM context %define %%CYPH_PLAIN_OUT %3 ; [in] output buffer %define %%PLAIN_CYPH_IN %4 ; [in] input buffer %define %%LENGTH %5 ; [in/out] number of bytes to process %define %%DATA_OFFSET %6 ; [in/out] data offset %define %%num_initial_blocks %7 ; [in] can be 0, 1, 2, 3, 4, 5, 6 or 7 %define %%CTR %8 ; [in/out] XMM counter block %define %%AAD_HASH %9 ; [in/out] ZMM with AAD hash %define %%ZT1 %10 ; [out] ZMM cipher blocks 0-3 for GHASH %define %%ZT2 %11 ; [out] ZMM cipher blocks 4-7 for GHASH %define %%ZT3 %12 ; [clobbered] ZMM temporary %define %%ZT4 %13 ; [clobbered] ZMM temporary %define %%ZT5 %14 ; [clobbered] ZMM temporary %define %%ZT6 %15 ; [clobbered] ZMM temporary %define %%ZT7 %16 ; [clobbered] ZMM temporary %define %%ZT8 %17 ; [clobbered] ZMM temporary %define %%ZT9 %18 ; [clobbered] ZMM temporary %define %%ZT0 %19 ; [clobbered] ZMM temporary %define %%IA0 %20 ; [clobbered] GP temporary %define %%IA1 %21 ; [clobbered] GP temporary %define %%ENC_DEC %22 ; [in] ENC/DEC selector %define %%T1 XWORD(%%ZT1) %define %%T2 XWORD(%%ZT2) %define %%T3 XWORD(%%ZT3) %define %%T4 XWORD(%%ZT4) %define %%T5 XWORD(%%ZT5) %define %%T6 XWORD(%%ZT6) %define %%T7 XWORD(%%ZT7) %define %%T8 XWORD(%%ZT8) %define %%T9 XWORD(%%ZT9) %define %%T0 XWORD(%%ZT0) %if %%num_initial_blocks > 0 ;; prepare AES counter blocks %if %%num_initial_blocks == 1 vpaddd %%T3, %%CTR, [rel ONE] %elif %%num_initial_blocks == 2 vshufi64x2 YWORD(%%ZT3), YWORD(%%CTR), YWORD(%%CTR), 0 vpaddd YWORD(%%ZT3), YWORD(%%ZT3), [rel ddq_add_1234] %else vshufi64x2 ZWORD(%%CTR), ZWORD(%%CTR), ZWORD(%%CTR), 0 vpaddd %%ZT3, ZWORD(%%CTR), [rel ddq_add_1234] vpaddd %%ZT4, ZWORD(%%CTR), [rel ddq_add_5678] %endif ;; get load/store mask %if (%%num_initial_blocks == 3) || (%%num_initial_blocks == 7) mov %%IA0, 0x0000_ffff_ffff_ffff kmovq k1, %%IA0 %endif ;; extract new counter value (%%T3) ;; shuffle the counters for AES rounds %if %%num_initial_blocks == 1 vmovdqa64 %%CTR, %%T3 vpshufb %%T3, [rel SHUF_MASK] %elif %%num_initial_blocks == 2 vextracti32x4 %%CTR, YWORD(%%ZT3), (%%num_initial_blocks - 1) vpshufb YWORD(%%ZT3), [rel SHUF_MASK] %elif %%num_initial_blocks <= 4 vextracti32x4 %%CTR, %%ZT3, (%%num_initial_blocks - 1) vpshufb %%ZT3, [rel SHUF_MASK] %elif %%num_initial_blocks == 5 vmovdqa64 %%CTR, %%T4 vpshufb %%ZT3, [rel SHUF_MASK] vpshufb %%T4, [rel SHUF_MASK] %elif %%num_initial_blocks == 6 vextracti32x4 %%CTR, YWORD(%%ZT4), (%%num_initial_blocks - 5) vpshufb %%ZT3, [rel SHUF_MASK] vpshufb YWORD(%%ZT4), [rel SHUF_MASK] %else vextracti32x4 %%CTR, %%ZT4, (%%num_initial_blocks - 5) vpshufb %%ZT3, [rel SHUF_MASK] vpshufb %%ZT4, [rel SHUF_MASK] %endif ;; load plain/cipher text %if %%num_initial_blocks == 1 vmovdqu8 %%T5, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] %elif %%num_initial_blocks == 2 vmovdqu8 YWORD(%%ZT5), [%%PLAIN_CYPH_IN + %%DATA_OFFSET] %elif %%num_initial_blocks == 3 vmovdqu8 %%ZT5{k1}{z}, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] %elif %%num_initial_blocks == 4 vmovdqu8 %%ZT5, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] %elif %%num_initial_blocks == 5 vmovdqu8 %%ZT5, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] vmovdqu8 %%T6, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 64] %elif %%num_initial_blocks == 6 vmovdqu8 %%ZT5, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] vmovdqu8 YWORD(%%ZT6), [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 64] %else vmovdqu8 %%ZT5, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] vmovdqu8 %%ZT6{k1}{z}, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 64] %endif ;; AES rounds and XOR with plain/cipher text %assign j 0 %rep (NROUNDS + 2) AESROUND_1_TO_8_BLOCKS \ %%ZT3, %%ZT4, %%ZT1, %%GDATA_KEY, j, \ %%ZT5, %%ZT6, %%num_initial_blocks %assign j (j + 1) %endrep ;; write cipher/plain text back to output and ;; zero bytes outside the mask before hashing %if %%num_initial_blocks == 1 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%T3 %elif %%num_initial_blocks == 2 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], YWORD(%%ZT3) %elif %%num_initial_blocks == 3 ;; Blocks 3 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET]{k1}, %%ZT3 %elif %%num_initial_blocks == 4 ;; Blocks 4 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%ZT3 %elif %%num_initial_blocks == 5 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%ZT3 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 64], %%T4 %elif %%num_initial_blocks == 6 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%ZT3 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 64], YWORD(%%ZT4) %else ;; Blocks 7 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%ZT3 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 64]{k1}, %%ZT4 %endif ;; Shuffle the cipher text blocks for hashing part ;; ZT5 and ZT6 are expected outputs with blocks for hashing %ifidn %%ENC_DEC, DEC ;; Decrypt case ;; - cipher blocks are in ZT5 & ZT6 %if %%num_initial_blocks == 1 vpshufb %%T5, [rel SHUF_MASK] %elif %%num_initial_blocks == 2 vpshufb YWORD(%%ZT5), [rel SHUF_MASK] %elif %%num_initial_blocks <= 4 vpshufb %%ZT5, [rel SHUF_MASK] %elif %%num_initial_blocks == 5 vpshufb %%ZT5, [rel SHUF_MASK] vpshufb %%T6, [rel SHUF_MASK] %elif %%num_initial_blocks == 6 vpshufb %%ZT5, [rel SHUF_MASK] vpshufb YWORD(%%ZT6), [rel SHUF_MASK] %else vpshufb %%ZT5, [rel SHUF_MASK] vpshufb %%ZT6, [rel SHUF_MASK] %endif %else ;; Encrypt case ;; - cipher blocks are in ZT3 & ZT4 %if %%num_initial_blocks == 1 vpshufb %%T5, %%T3, [rel SHUF_MASK] %elif %%num_initial_blocks == 2 vpshufb YWORD(%%ZT5), YWORD(%%ZT3), [rel SHUF_MASK] %elif %%num_initial_blocks <= 4 vpshufb %%ZT5, %%ZT3, [rel SHUF_MASK] %elif %%num_initial_blocks == 5 vpshufb %%ZT5, %%ZT3, [rel SHUF_MASK] vpshufb %%T6, %%T4, [rel SHUF_MASK] %elif %%num_initial_blocks == 6 vpshufb %%ZT5, %%ZT3, [rel SHUF_MASK] vpshufb YWORD(%%ZT6), YWORD(%%ZT4), [rel SHUF_MASK] %else vpshufb %%ZT5, %%ZT3, [rel SHUF_MASK] vpshufb %%ZT6, %%ZT4, [rel SHUF_MASK] %endif %endif ; Encrypt ;; adjust data offset and length sub %%LENGTH, (%%num_initial_blocks * 16) add %%DATA_OFFSET, (%%num_initial_blocks * 16) ;; At this stage ;; - ZT5:ZT6 include cipher blocks to be GHASH'ed %endif ; %%num_initial_blocks > 0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; - cipher of %%num_initial_blocks is done ;; - prepare counter blocks for the next 8 blocks (ZT3 & ZT4) ;; - save the last block in %%CTR ;; - shuffle the blocks for AES ;; - stitch encryption of the new blocks with ;; GHASHING the previous blocks vshufi64x2 ZWORD(%%CTR), ZWORD(%%CTR), ZWORD(%%CTR), 0 vpaddd %%ZT3, ZWORD(%%CTR), [rel ddq_add_1234] vpaddd %%ZT4, ZWORD(%%CTR), [rel ddq_add_5678] vextracti32x4 %%CTR, %%ZT4, 3 vpshufb %%ZT3, [rel SHUF_MASK] vpshufb %%ZT4, [rel SHUF_MASK] ;; get text load/store mask (assume full mask by default) mov %%IA0, 0xffff_ffff_ffff_ffff %if %%num_initial_blocks > 0 ;; NOTE: 'jge' is always taken for %%num_initial_blocks = 0 ;; This macro is executed for lenght 128 and up, ;; zero length is checked in GCM_ENC_DEC. ;; We know there is partial block if: ;; LENGTH - 16*num_initial_blocks < 128 cmp %%LENGTH, 128 jge %%_initial_partial_block_continue mov %%IA1, rcx mov rcx, 128 sub rcx, %%LENGTH shr %%IA0, cl mov rcx, %%IA1 %%_initial_partial_block_continue: %endif kmovq k1, %%IA0 ;; load plain or cipher text vmovdqu8 %%ZT1, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] vmovdqu8 %%ZT2{k1}{z}, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 64] ;; === GHASH block 0 plus AES ROUND 0 %assign aes_round 0 %assign hash_index 0 %assign k (%%num_initial_blocks) %if (hash_index < %%num_initial_blocks) ;; Hash in AES state vpxorq %%ZT5, %%ZT5, %%AAD_HASH ;; take blocks from ZT5 VCLMUL_1BLOCK_DATAPREP \ %%ZT8, %%ZT5, hash_index VCLMUL_1BLOCK %%ZT9, no_aad, %%GDATA_KEY, HashKey_ %+ k, \ %%ZT8, text_ready, first, no_shuffle, %%ZT0, %%ZT7 %assign hash_index (hash_index + 1) %assign k (k - 1) %endif ; (hash_index < %%num_initial_blocks) AESROUND_1_TO_8_BLOCKS \ %%ZT3, %%ZT4, %%ZT8, %%GDATA_KEY, aes_round, \ %%ZT1, %%ZT2, 8 %assign aes_round (aes_round + 1) ;; === GHASH one block plus 2 x AES ROUNDS ;; For GCM128, it will be %rep 5, so the last block ;; that can be ghash'ed is 5. ;; Block 7 (8th) is never ghashed in this code path. %rep (((NROUNDS + 2) - 1) / 2) %if (hash_index < %%num_initial_blocks) %if hash_index < 4 ;; take blocks from ZT5 VCLMUL_1BLOCK_DATAPREP \ %%ZT8, %%ZT5, hash_index %else ;; take blocks from ZT6 VCLMUL_1BLOCK_DATAPREP \ %%ZT8, %%ZT6, hash_index - 4 %endif VCLMUL_1BLOCK %%ZT9, no_aad, %%GDATA_KEY, HashKey_ %+ k, \ %%ZT8, text_ready, not_first, no_shuffle, %%ZT0, %%ZT7 %assign hash_index (hash_index + 1) %assign k (k - 1) %endif ; (hash_index < %%num_initial_blocks) AESROUND_1_TO_8_BLOCKS \ %%ZT3, %%ZT4, %%ZT8, %%GDATA_KEY, aes_round, \ %%ZT1, %%ZT2, 8 %assign aes_round (aes_round + 1) AESROUND_1_TO_8_BLOCKS \ %%ZT3, %%ZT4, %%ZT8, %%GDATA_KEY, aes_round, \ %%ZT1, %%ZT2, 8 %assign aes_round (aes_round + 1) %endrep ; %rep (((NROUNDS + 2) - 1) / 2) ;; === in case of GCM128 and 7 initial blocks ;; one more blocks needs to be GHASH'ed %if (hash_index < %%num_initial_blocks) %if hash_index < 4 ;; take blocks from ZT5 VCLMUL_1BLOCK_DATAPREP \ %%ZT8, %%ZT5, hash_index %else ;; take blocks from ZT6 VCLMUL_1BLOCK_DATAPREP \ %%ZT8, %%ZT6, hash_index - 4 %endif VCLMUL_1BLOCK %%ZT9, no_aad, %%GDATA_KEY, HashKey_ %+ k, \ %%ZT8, text_ready, not_first, no_shuffle, %%ZT0, %%ZT7 %assign hash_index (hash_index + 1) %assign k (k - 1) %endif ; (hash_index < %%num_initial_blocks) ;; write cipher/plain text back to output and ;; zero bytes outside the mask before hashing vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%ZT3 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 64]{k1}, %%ZT4 ;; check if there is partial block cmp %%LENGTH, 128 jl %%_initial_save_partial ;; adjust offset and length add %%DATA_OFFSET, 128 sub %%LENGTH, 128 jmp %%_initial_blocks_done %%_initial_save_partial: ;; partial block case ;; - save the partial block in unshuffled format ;; - ZT4 is partially XOR'ed with data and top bytes contain ;; encrypted counter block only ;; - save number of bytes process in the partial block ;; - adjust offset and zero the length ;; - clear top bytes of the partial block for subsequent GHASH calculations vextracti32x4 [%%GDATA_CTX + PBlockEncKey], %%ZT4, 3 add %%DATA_OFFSET, %%LENGTH sub %%LENGTH, (128 - 16) mov [%%GDATA_CTX + PBlockLen], %%LENGTH xor %%LENGTH, %%LENGTH vmovdqu8 %%ZT4{k1}{z}, %%ZT4 %%_initial_blocks_done: ;; Shuffle AES result for GHASH. %ifidn %%ENC_DEC, DEC ;; Decrypt case ;; - cipher blocks are in ZT1 & ZT2 vpshufb %%ZT1, [rel SHUF_MASK] vpshufb %%ZT2, [rel SHUF_MASK] %else ;; Encrypt case ;; - cipher blocks are in ZT3 & ZT4 vpshufb %%ZT1, %%ZT3, [rel SHUF_MASK] vpshufb %%ZT2, %%ZT4, [rel SHUF_MASK] %endif ; Encrypt %if (%%num_initial_blocks > 0) ;; gather result from ZT9 into T6:T5 ;; ZT8, ZT0 and ZT7 are temporary VCLMUL_1BLOCK_GATHER %%T6, %%T5, %%ZT9, %%ZT8, %%ZT0, %%ZT7 ;; [out] AAD_HASH - hash output ;; [in] T8 - polynomial ;; [in] T6 - high, T5 - low ;; [clobbered] T0, T7 - temporary vmovdqu64 %%T8, [rel POLY2] VCLMUL_REDUCE XWORD(%%AAD_HASH), %%T8, %%T6, %%T5, %%T0, %%T7 %else ;; Current hash value is in AAD_HASH %endif ;; Combine GHASHed value with the corresponding ciphertext vpxorq %%ZT1, %%ZT1, %%AAD_HASH %endmacro ; INITIAL_BLOCKS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; INITIAL_BLOCKS_PARTIAL macro with support for a partial final block. ;;; It may look similar to INITIAL_BLOCKS but its usage is different: ;;; - It is not meant to cipher counter blocks for the main by8 loop. ;;; Just ciphers amount of blocks and ghashes them. ;;; - Small packets (<128 bytes) - single or multi call ;;; - Remaining data chunks below 128 bytes (multi buffer code) ;;; ;;; num_initial_blocks is expected to include the partial final block ;;; in the count. %macro INITIAL_BLOCKS_PARTIAL 22 %define %%GDATA_KEY %1 ; [in] key pointer %define %%GDATA_CTX %2 ; [in] context pointer %define %%CYPH_PLAIN_OUT %3 ; [in] text out pointer %define %%PLAIN_CYPH_IN %4 ; [in] text out pointer %define %%LENGTH %5 ; [in/clobbered] length in bytes %define %%DATA_OFFSET %6 ; [in/out] current data offset (updated) %define %%num_initial_blocks %7 ; [in] can only be 1, 2, 3, 4, 5, 6, 7 or 8 (not 0) %define %%CTR %8 ; [in/out] current counter value %define %%HASH_IN_OUT %9 ; [in/out] XMM ghash in/out value %define %%ENC_DEC %10 ; [in] cipher direction (ENC/DEC) %define %%INSTANCE_TYPE %11 ; [in] multi_call or single_call %define %%ZT1 %12 ; [clobbered] ZMM temporary %define %%ZT2 %13 ; [clobbered] ZMM temporary %define %%ZT3 %14 ; [clobbered] ZMM temporary %define %%ZT4 %15 ; [clobbered] ZMM temporary %define %%ZT5 %16 ; [clobbered] ZMM temporary %define %%ZT6 %17 ; [clobbered] ZMM temporary %define %%ZT7 %18 ; [clobbered] ZMM temporary %define %%ZT8 %19 ; [clobbered] ZMM temporary %define %%IA0 %20 ; [clobbered] GP temporary %define %%IA1 %21 ; [clobbered] GP temporary %define %%MASKREG %22 ; [clobbered] mask register %define %%T1 XWORD(%%ZT1) %define %%T2 XWORD(%%ZT2) %define %%T3 XWORD(%%ZT3) %define %%T4 XWORD(%%ZT4) %define %%T5 XWORD(%%ZT5) %define %%T6 XWORD(%%ZT6) %define %%T7 XWORD(%%ZT7) %define %%T8 XWORD(%%ZT8) ;; Copy ghash to temp reg vmovdqa64 %%T2, %%HASH_IN_OUT ;; prepare AES counter blocks %if %%num_initial_blocks == 1 vpaddd %%T3, %%CTR, [rel ONE] %elif %%num_initial_blocks == 2 vshufi64x2 YWORD(%%ZT3), YWORD(%%CTR), YWORD(%%CTR), 0 vpaddd YWORD(%%ZT3), YWORD(%%ZT3), [rel ddq_add_1234] %else vshufi64x2 ZWORD(%%CTR), ZWORD(%%CTR), ZWORD(%%CTR), 0 vpaddd %%ZT3, ZWORD(%%CTR), [rel ddq_add_1234] vpaddd %%ZT4, ZWORD(%%CTR), [rel ddq_add_5678] %endif ;; get load/store mask lea %%IA0, [rel byte64_len_to_mask_table] mov %%IA1, %%LENGTH %if %%num_initial_blocks > 4 sub %%IA1, 64 %endif kmovq k1, [%%IA0 + %%IA1*8] ;; extract new counter value (%%T3) ;; shuffle the counters for AES rounds %if %%num_initial_blocks == 1 vmovdqa64 %%CTR, %%T3 vpshufb %%T3, [rel SHUF_MASK] %elif %%num_initial_blocks == 2 vextracti32x4 %%CTR, YWORD(%%ZT3), (%%num_initial_blocks - 1) vpshufb YWORD(%%ZT3), [rel SHUF_MASK] %elif %%num_initial_blocks <= 4 vextracti32x4 %%CTR, %%ZT3, (%%num_initial_blocks - 1) vpshufb %%ZT3, [rel SHUF_MASK] %elif %%num_initial_blocks == 5 vmovdqa64 %%CTR, %%T4 vpshufb %%ZT3, [rel SHUF_MASK] vpshufb %%T4, [rel SHUF_MASK] %elif %%num_initial_blocks == 6 vextracti32x4 %%CTR, YWORD(%%ZT4), (%%num_initial_blocks - 5) vpshufb %%ZT3, [rel SHUF_MASK] vpshufb YWORD(%%ZT4), [rel SHUF_MASK] %else vextracti32x4 %%CTR, %%ZT4, (%%num_initial_blocks - 5) vpshufb %%ZT3, [rel SHUF_MASK] vpshufb %%ZT4, [rel SHUF_MASK] %endif ;; load plain/cipher text %if %%num_initial_blocks == 1 vmovdqu8 %%T5{k1}{z}, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] %elif %%num_initial_blocks == 2 vmovdqu8 YWORD(%%ZT5){k1}{z}, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] %elif %%num_initial_blocks <= 4 vmovdqu8 %%ZT5{k1}{z}, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] %elif %%num_initial_blocks == 5 vmovdqu8 %%ZT5, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] vmovdqu8 %%T6{k1}{z}, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 64] %elif %%num_initial_blocks == 6 vmovdqu8 %%ZT5, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] vmovdqu8 YWORD(%%ZT6){k1}{z}, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 64] %else vmovdqu8 %%ZT5, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] vmovdqu8 %%ZT6{k1}{z}, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 64] %endif ;; AES rounds and XOR with plain/cipher text %assign j 0 %rep (NROUNDS + 2) AESROUND_1_TO_8_BLOCKS \ %%ZT3, %%ZT4, %%ZT1, %%GDATA_KEY, j, \ %%ZT5, %%ZT6, %%num_initial_blocks %assign j (j + 1) %endrep ;; retrieve the last cipher counter block (partially XOR'ed with text) ;; - this is needed for partial block cases %if %%num_initial_blocks == 1 vmovdqa64 %%T1, %%T3 %elif %%num_initial_blocks == 2 vextracti32x4 %%T1, YWORD(%%ZT3), (%%num_initial_blocks - 1) %elif %%num_initial_blocks <= 4 ;; Blocks 3 and 4 vextracti32x4 %%T1, %%ZT3, (%%num_initial_blocks - 1) %elif %%num_initial_blocks == 5 vmovdqa64 %%T1, %%T4 %elif %%num_initial_blocks == 6 vextracti32x4 %%T1, YWORD(%%ZT4), (%%num_initial_blocks - 5) %else ;; Blocks 7 and 8 vextracti32x4 %%T1, %%ZT4, (%%num_initial_blocks - 5) %endif ;; write cipher/plain text back to output and ;; zero bytes outside the mask before hashing %if %%num_initial_blocks == 1 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET]{k1}, %%T3 vmovdqu8 %%T3{k1}{z}, %%T3 %elif %%num_initial_blocks == 2 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET]{k1}, YWORD(%%ZT3) vmovdqu8 YWORD(%%ZT3){k1}{z}, YWORD(%%ZT3) %elif %%num_initial_blocks <= 4 ;; Blocks 3 and 4 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET]{k1}, %%ZT3 vmovdqu8 %%ZT3{k1}{z}, %%ZT3 %elif %%num_initial_blocks == 5 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%ZT3 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 64]{k1}, %%T4 vmovdqu8 %%T4{k1}{z}, %%T4 %elif %%num_initial_blocks == 6 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%ZT3 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 64]{k1}, YWORD(%%ZT4) vmovdqu8 YWORD(%%ZT4){k1}{z}, YWORD(%%ZT4) %else ;; Blocks 7 and 8 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%ZT3 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 64]{k1}, %%ZT4 vmovdqu8 %%ZT4{k1}{z}, %%ZT4 %endif ;; Shuffle the cipher text blocks for hashing part ;; ZT5 and ZT6 are expected outputs with blocks for hashing %ifidn %%ENC_DEC, DEC ;; Decrypt case ;; - cipher blocks are in ZT5 & ZT6 %if %%num_initial_blocks == 1 vpshufb %%T5, [rel SHUF_MASK] %elif %%num_initial_blocks == 2 vpshufb YWORD(%%ZT5), [rel SHUF_MASK] %elif %%num_initial_blocks <= 4 vpshufb %%ZT5, [rel SHUF_MASK] %elif %%num_initial_blocks == 5 vpshufb %%ZT5, [rel SHUF_MASK] vpshufb %%T6, [rel SHUF_MASK] %elif %%num_initial_blocks == 6 vpshufb %%ZT5, [rel SHUF_MASK] vpshufb YWORD(%%ZT6), [rel SHUF_MASK] %else vpshufb %%ZT5, [rel SHUF_MASK] vpshufb %%ZT6, [rel SHUF_MASK] %endif %else ;; Encrypt case ;; - cipher blocks are in ZT3 & ZT4 %if %%num_initial_blocks == 1 vpshufb %%T5, %%T3, [rel SHUF_MASK] %elif %%num_initial_blocks == 2 vpshufb YWORD(%%ZT5), YWORD(%%ZT3), [rel SHUF_MASK] %elif %%num_initial_blocks <= 4 vpshufb %%ZT5, %%ZT3, [rel SHUF_MASK] %elif %%num_initial_blocks == 5 vpshufb %%ZT5, %%ZT3, [rel SHUF_MASK] vpshufb %%T6, %%T4, [rel SHUF_MASK] %elif %%num_initial_blocks == 6 vpshufb %%ZT5, %%ZT3, [rel SHUF_MASK] vpshufb YWORD(%%ZT6), YWORD(%%ZT4), [rel SHUF_MASK] %else vpshufb %%ZT5, %%ZT3, [rel SHUF_MASK] vpshufb %%ZT6, %%ZT4, [rel SHUF_MASK] %endif %endif ; Encrypt ;; Extract the last block for partials and multi_call cases %if %%num_initial_blocks <= 4 vextracti32x4 %%T7, %%ZT5, %%num_initial_blocks - 1 %else vextracti32x4 %%T7, %%ZT6, %%num_initial_blocks - 5 %endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Hash all but the last block of data ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; update data offset %if %%num_initial_blocks > 1 ;; The final block of data may be <16B add %%DATA_OFFSET, 16 * (%%num_initial_blocks - 1) sub %%LENGTH, 16 * (%%num_initial_blocks - 1) %endif %if %%num_initial_blocks < 8 ;; NOTE: the 'jl' is always taken for num_initial_blocks = 8. ;; This is run in the context of GCM_ENC_DEC_SMALL for length < 128. cmp %%LENGTH, 16 jl %%_small_initial_partial_block ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Handle a full length final block - encrypt and hash all blocks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sub %%LENGTH, 16 add %%DATA_OFFSET, 16 mov [%%GDATA_CTX + PBlockLen], %%LENGTH ;; Hash all of the data %assign j (9 - %%num_initial_blocks) %assign k (%%num_initial_blocks) %assign i 0 ;; ZT2 - incoming AAD hash (low 128bits) ;; ZT5, ZT6 - hold ciphertext ;; ZT1 - updated xor ;; ZT3, ZT4 - temporary registers ;; Hash in AES state vpxorq %%ZT5, %%ZT5, %%ZT2 VCLMUL_1BLOCK_DATAPREP \ %%ZT8, %%ZT5, i VCLMUL_1BLOCK %%ZT1, no_aad, %%GDATA_KEY, HashKey_ %+ k, \ %%ZT8, text_ready, first, no_shuffle, %%ZT3, %%ZT4 %assign rep_count (%%num_initial_blocks - 1) %rep rep_count %assign j (j + 1) %assign k (k - 1) %assign i (i + 1) %if i < 4 ;; take blocks from ZT5 VCLMUL_1BLOCK_DATAPREP \ %%ZT8, %%ZT5, i %else ;; take blocks from ZT6 VCLMUL_1BLOCK_DATAPREP \ %%ZT8, %%ZT6, i - 4 %endif VCLMUL_1BLOCK %%ZT1, no_aad, %%GDATA_KEY, HashKey_ %+ k, \ %%ZT8, text_ready, not_first, no_shuffle, %%ZT3, %%ZT4 %endrep ;; reduction is needed jmp %%_small_initial_compute_reduction %endif ; %if %%num_initial_blocks < 8 %%_small_initial_partial_block: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Handle ghash for a <16B final block ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; In this case if it's a single call to encrypt we can ;; hash all of the data but if it's an init / update / finalize ;; series of call we need to leave the last block if it's ;; less than a full block of data. mov [%%GDATA_CTX + PBlockLen], %%LENGTH ;; %%T1 is ciphered counter block vmovdqu64 [%%GDATA_CTX + PBlockEncKey], %%T1 %ifidn %%INSTANCE_TYPE, multi_call %assign rep_count (%%num_initial_blocks - 2) %assign k (%%num_initial_blocks - 1) %assign last_block_to_hash 1 %else %assign rep_count (%%num_initial_blocks - 1) %assign k (%%num_initial_blocks) %assign last_block_to_hash 0 %endif %if (%%num_initial_blocks > last_block_to_hash) %assign j (9 - %%num_initial_blocks) %assign i 0 ;; T2 - incoming AAD hash ;; ZT5, ZT6 - hold ciphertext ;; ZT1 - updated xor ;; ZT3, ZT4 - temporary registers ;; Hash in AES state vpxorq %%ZT5, %%ZT5, %%ZT2 VCLMUL_1BLOCK_DATAPREP \ %%ZT8, %%ZT5, i VCLMUL_1BLOCK %%ZT1, no_aad, %%GDATA_KEY, HashKey_ %+ k, \ %%ZT8, text_ready, first, no_shuffle, %%ZT3, %%ZT4 %if rep_count > 0 ;; rule out negative cases or zero %rep rep_count %assign j (j+1) %assign k (k-1) %assign i (i + 1) %if i < 4 ;; take blocks from ZT5 VCLMUL_1BLOCK_DATAPREP \ %%ZT8, %%ZT5, i %else ;; take blocks from ZT6 VCLMUL_1BLOCK_DATAPREP \ %%ZT8, %%ZT6, i - 4 %endif VCLMUL_1BLOCK %%ZT1, no_aad, %%GDATA_KEY, HashKey_ %+ k, \ %%ZT8, text_ready, not_first, no_shuffle, %%ZT3, %%ZT4 %endrep %endif ; rep_count > 0 ;; reduction is required - just fall through no jmp needed %else ;; Record that a reduction is not needed - ;; In this case no hashes are computed because there ;; is only one initial block and it is < 16B in length. ;; We only need to check if a reduction is needed if ;; initial_blocks == 1 and init/update/final is being used. ;; In this case we may just have a partial block, and that ;; gets hashed in finalize. ;; The hash should end up in HASH_IN_OUT. ;; The only way we should get here is if there is ;; a partial block of data, so xor that into the hash. vpxorq %%HASH_IN_OUT, %%T2, %%T7 ;; The result is in %%HASH_IN_OUT jmp %%_after_reduction %endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Ghash reduction ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %%_small_initial_compute_reduction: ;; gather result from ZT1 into T1:T4 VCLMUL_1BLOCK_GATHER %%T1, %%T4, %%ZT1, %%ZT4, %%ZT5, %%ZT6 ;; [out] HASH_IN_OUT - hash output ;; [in] T3 - polynomial ;; [in] T1 - high, T4 - low ;; [clobbered] T5, T6 - temporary vmovdqu64 %%T3, [rel POLY2] VCLMUL_REDUCE %%HASH_IN_OUT, %%T3, %%T1, %%T4, %%T5, %%T6 %ifidn %%INSTANCE_TYPE, multi_call ;; If using init/update/finalize, we need to xor any partial block data ;; into the hash. %if %%num_initial_blocks > 1 ;; NOTE: for %%num_initial_blocks = 0 the xor never takes place %if %%num_initial_blocks != 8 ;; NOTE: for %%num_initial_blocks = 8, %%LENGTH, stored in [PBlockLen] is never zero or %%LENGTH, %%LENGTH je %%_after_reduction %endif ; %%num_initial_blocks != 8 vpxorq %%HASH_IN_OUT, %%HASH_IN_OUT, %%T7 %endif ; %%num_initial_blocks > 1 %endif ; %%INSTANCE_TYPE, multi_call %%_after_reduction: ;; Final hash is now in HASH_IN_OUT %endmacro ; INITIAL_BLOCKS_PARTIAL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Main GCM macro stitching cipher with GHASH ;;; - operates on single stream ;;; - encrypts 8 blocks at a time ;;; - ghash the 8 previously encrypted ciphertext blocks ;;; For partial block case and multi_call , AES_PARTIAL_BLOCK on output ;;; contains encrypted counter block. %macro GHASH_8_ENCRYPT_8_PARALLEL 29 %define %%GDATA %1 ; [in] key pointer %define %%CYPH_PLAIN_OUT %2 ; [in] pointer to output buffer %define %%PLAIN_CYPH_IN %3 ; [in] pointer to input buffer %define %%DATA_OFFSET %4 ; [in] data offset %define %%CTR %5 ; [in/out] ZMM last counter block (b-casted across ZMM) %define %%GHASHIN_AESOUT_B03 %6 ; [in/out] ZMM ghash in / aes out blocks 0 to 3 %define %%GHASHIN_AESOUT_B47 %7 ; [in/out] ZMM ghash in / aes out blocks 4 to 7 %define %%AES_PARTIAL_BLOCK %8 ; [out] XMM partial block (AES) %define %%loop_idx %9 ; [in] counter block prep selection "add+shuffle" or "add" %define %%ENC_DEC %10 ; [in] cipher direction %define %%FULL_PARTIAL %11 ; [in] last block type selection "full" or "partial" %define %%IA0 %12 ; [clobbered] temporary GP register %define %%IA1 %13 ; [clobbered] temporary GP register %define %%LENGTH %14 ; [in] length %define %%INSTANCE_TYPE %15 ; [in] 'single_call' or 'multi_call' selection %define %%ZT1 %16 ; [clobbered] temporary ZMM (cipher) %define %%ZT2 %17 ; [clobbered] temporary ZMM (cipher) %define %%ZT3 %18 ; [clobbered] temporary ZMM (cipher) %define %%ZT4 %19 ; [clobbered] temporary ZMM (cipher) %define %%ZT5 %20 ; [clobbered] temporary ZMM (cipher) %define %%ZT10 %21 ; [clobbered] temporary ZMM (ghash) %define %%ZT11 %22 ; [clobbered] temporary ZMM (ghash) %define %%ZT12 %23 ; [clobbered] temporary ZMM (ghash) %define %%ZT13 %24 ; [clobbered] temporary ZMM (ghash) %define %%ZT14 %25 ; [clobbered] temporary ZMM (ghash) %define %%ZT15 %26 ; [clobbered] temporary ZMM (ghash) %define %%ZT16 %27 ; [clobbered] temporary ZMM (ghash) %define %%ZT17 %28 ; [clobbered] temporary ZMM (ghash) %define %%MASKREG %29 ; [clobbered] mask register for partial loads/stores ;; keep the cipher blocks for further GHASH vmovdqa64 %%ZT10, %%GHASHIN_AESOUT_B03 vmovdqa64 %%ZT11, %%GHASHIN_AESOUT_B47 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; populate counter blocks %ifidn %%loop_idx, in_order ;; %%CTR is shuffled outside the scope of this macro ;; it has to be kept in unshuffled form vpaddd %%ZT1, %%CTR, [rel ddq_add_1234] vpaddd %%ZT2, %%CTR, [rel ddq_add_5678] vshufi64x2 %%CTR, %%ZT2, %%ZT2, 1111_1111b vpshufb %%ZT1, [rel SHUF_MASK] vpshufb %%ZT2, [rel SHUF_MASK] %else vpaddd %%ZT1, %%CTR, [rel ddq_addbe_1234] vpaddd %%ZT2, %%CTR, [rel ddq_addbe_5678] vshufi64x2 %%CTR, %%ZT2, %%ZT2, 1111_1111b %endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; load/store mask (partial case) and load the text data %ifidn %%FULL_PARTIAL, full vmovdqu8 %%ZT4, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] vmovdqu8 %%ZT5, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 64] %else lea %%IA0, [rel byte64_len_to_mask_table] mov %%IA1, %%LENGTH sub %%IA1, 64 kmovq %%MASKREG, [%%IA0 + 8*%%IA1] vmovdqu8 %%ZT4, [%%PLAIN_CYPH_IN + %%DATA_OFFSET] vmovdqu8 %%ZT5{%%MASKREG}{z}, [%%PLAIN_CYPH_IN + %%DATA_OFFSET + 64] %endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; stitch AES rounds with GHASH %assign aes_round 0 %assign hash_index 0 %rep (((NROUNDS + 2) / 3) + 1) ;; === 3 x AES ROUND %rep 3 %if aes_round < (NROUNDS + 2) AESROUND_1_TO_8_BLOCKS \ %%ZT1, %%ZT2, %%ZT3, %%GDATA, aes_round, \ %%ZT4, %%ZT5, 8 %assign aes_round (aes_round + 1) %endif ; aes_round < (NROUNDS + 2) %endrep ; 3 x AES ROUND ;; === GHASH on 8 blocks %if hash_index == 0 ;; GHASH - 1st round ;; [in] ZT11 - high blocks ;; [out] ZT12, ZT13, ZT14 - low, medium and high sums ;; [clobbered] ZT15 VCLMUL_STEP1 %%GDATA, %%ZT11, %%ZT15, %%ZT12, %%ZT13, %%ZT14 %assign hash_index (hash_index + 1) %elif hash_index == 1 ;; GHASH - 2nd round ;; [in] ZT11 - high blocks ;; [in] ZT10 - low blocks ;; [in] ZT12, ZT13, ZT14 - low, medium and high sums ;; [clobbered] ZT15, ZT16, ZT17 ;; [out] ZT11, ZT10 - high and low sums for further reduction VCLMUL_STEP2 %%GDATA, %%ZT11, %%ZT10, %%ZT15, %%ZT16, %%ZT17, %%ZT12, %%ZT13, %%ZT14 %assign hash_index (hash_index + 1) %elif hash_index == 2 ;; GHASH - reduction ;; [out] ZT13 - ghash result ;; [in] ZT12 - polynomial ;; [in] ZT11 - high, ZT10 - low ;; [clobbered] ZT15, ZT16 - temporary vmovdqu64 XWORD(%%ZT12), [rel POLY2] VCLMUL_REDUCE XWORD(%%ZT13), XWORD(%%ZT12), XWORD(%%ZT11), XWORD(%%ZT10), \ XWORD(%%ZT15), XWORD(%%ZT16) %assign hash_index (hash_index + 1) %endif %endrep ; stitched AES and GHASH loop ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; store the text data %ifidn %%FULL_PARTIAL, full vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%ZT1 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 64], %%ZT2 %else vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET], %%ZT1 vmovdqu8 [%%CYPH_PLAIN_OUT + %%DATA_OFFSET + 64]{%%MASKREG}, %%ZT2 %endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; prep cipher text blocks for the next ghash round %ifnidn %%FULL_PARTIAL, full %ifidn %%INSTANCE_TYPE, multi_call ;; for partial block & multi_call we need encrypted counter block vpxorq %%ZT3, %%ZT2, %%ZT5 vextracti32x4 %%AES_PARTIAL_BLOCK, %%ZT3, 3 %endif ;; for GHASH computation purpose clear the top bytes of the partial block %ifidn %%ENC_DEC, ENC vmovdqu8 %%ZT2{%%MASKREG}{z}, %%ZT2 %else vmovdqu8 %%ZT5{%%MASKREG}{z}, %%ZT5 %endif %endif ;; shuffle cipher text blocks for GHASH computation %ifidn %%ENC_DEC, ENC vpshufb %%ZT1, [rel SHUF_MASK] vpshufb %%ZT2, [rel SHUF_MASK] %else vpshufb %%ZT1, %%ZT4, [rel SHUF_MASK] vpshufb %%ZT2, %%ZT5, [rel SHUF_MASK] %endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; copy shuffled cipher text blocks for GHASH vmovdqa64 %%GHASHIN_AESOUT_B03, %%ZT1 vmovdqa64 %%GHASHIN_AESOUT_B47, %%ZT2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; XOR current GHASH value (ZT13) into block 0 vpxorq %%GHASHIN_AESOUT_B03, %%ZT13 %endmacro ; GHASH_8_ENCRYPT_8_PARALLEL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; GHASH the last 8 ciphertext blocks. %macro GHASH_LAST_8 10 %define %%GDATA %1 ; [in] key pointer %define %%BL47 %2 ; [in/clobbered] ZMM AES blocks 4 to 7 %define %%BL03 %3 ; [in/cloberred] ZMM AES blocks 0 to 3 %define %%ZTH %4 ; [cloberred] ZMM temporary %define %%ZTM %5 ; [cloberred] ZMM temporary %define %%ZTL %6 ; [cloberred] ZMM temporary %define %%ZT01 %7 ; [cloberred] ZMM temporary %define %%ZT02 %8 ; [cloberred] ZMM temporary %define %%ZT03 %9 ; [cloberred] ZMM temporary %define %%AAD_HASH %10 ; [out] XMM hash value VCLMUL_STEP1 %%GDATA, %%BL47, %%ZT01, %%ZTH, %%ZTM, %%ZTL VCLMUL_STEP2 %%GDATA, %%BL47, %%BL03, %%ZT01, %%ZT02, %%ZT03, %%ZTH, %%ZTM, %%ZTL vmovdqa64 XWORD(%%ZT03), [rel POLY2] VCLMUL_REDUCE %%AAD_HASH, XWORD(%%ZT03), XWORD(%%BL47), XWORD(%%BL03), \ XWORD(%%ZT01), XWORD(%%ZT02) %endmacro ; GHASH_LAST_8 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; GHASH the last 7 cipher text blocks. ;;; - it uses same GHASH macros as GHASH_LAST_8 but with some twist ;;; - it loads GHASH keys for each of the data blocks, so that: ;;; - blocks 4, 5 and 6 will use GHASH keys 3, 2, 1 respectively ;;; - code ensures that unused block 7 and corresponding GHASH key are zeroed ;;; (clmul product is zero this way and will not affect the result) ;;; - blocks 0, 1, 2 and 3 will use USE GHASH keys 7, 6, 5 and 4 respectively %macro GHASH_LAST_7 13 %define %%GDATA %1 ; [in] key pointer %define %%BL47 %2 ; [in/clobbered] ZMM AES blocks 4 to 7 %define %%BL03 %3 ; [in/cloberred] ZMM AES blocks 0 to 3 %define %%ZTH %4 ; [cloberred] ZMM temporary %define %%ZTM %5 ; [cloberred] ZMM temporary %define %%ZTL %6 ; [cloberred] ZMM temporary %define %%ZT01 %7 ; [cloberred] ZMM temporary %define %%ZT02 %8 ; [cloberred] ZMM temporary %define %%ZT03 %9 ; [cloberred] ZMM temporary %define %%ZT04 %10 ; [cloberred] ZMM temporary %define %%AAD_HASH %11 ; [out] XMM hash value %define %%MASKREG %12 ; [clobbered] mask register to use for loads %define %%IA0 %13 ; [clobbered] GP temporary register mov %%IA0, 0x0000_ffff_ffff_ffff kmovq %%MASKREG, %%IA0 vmovdqu8 %%ZT04{%%MASKREG}{z}, [%%GDATA + HashKey_3] vmovdqu8 %%BL47{%%MASKREG}{z}, %%BL47 VCLMUL_STEP1 %%GDATA, %%BL47, %%ZT01, %%ZTH, %%ZTM, %%ZTL, %%ZT04 vmovdqu64 %%ZT04, [%%GDATA + HashKey_7] VCLMUL_STEP2 %%GDATA, %%BL47, %%BL03, \ %%ZT01, %%ZT02, %%ZT03, %%ZTH, \ %%ZTM, %%ZTL, %%ZT04 vmovdqa64 XWORD(%%ZT03), [rel POLY2] VCLMUL_REDUCE %%AAD_HASH, XWORD(%%ZT03), XWORD(%%BL47), XWORD(%%BL03), \ XWORD(%%ZT01), XWORD(%%ZT02) %endmacro ; GHASH_LAST_7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Encryption of a single block %macro ENCRYPT_SINGLE_BLOCK 2 %define %%GDATA %1 %define %%XMM0 %2 vpxorq %%XMM0, %%XMM0, [%%GDATA+16*0] %assign i 1 %rep NROUNDS vaesenc %%XMM0, [%%GDATA+16*i] %assign i (i+1) %endrep vaesenclast %%XMM0, [%%GDATA+16*i] %endmacro ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Save register content for the caller %macro FUNC_SAVE 0 ;; Required for Update/GMC_ENC ;the number of pushes must equal STACK_OFFSET mov rax, rsp sub rsp, STACK_FRAME_SIZE and rsp, ~63 mov [rsp + STACK_GP_OFFSET + 0*8], r12 mov [rsp + STACK_GP_OFFSET + 1*8], r13 mov [rsp + STACK_GP_OFFSET + 2*8], r14 mov [rsp + STACK_GP_OFFSET + 3*8], r15 mov [rsp + STACK_GP_OFFSET + 4*8], rax ; stack mov r14, rax ; r14 is used to retrieve stack args mov [rsp + STACK_GP_OFFSET + 5*8], rbp mov [rsp + STACK_GP_OFFSET + 6*8], rbx %ifidn __OUTPUT_FORMAT__, win64 mov [rsp + STACK_GP_OFFSET + 7*8], rdi mov [rsp + STACK_GP_OFFSET + 8*8], rsi %endif %ifidn __OUTPUT_FORMAT__, win64 ; xmm6:xmm15 need to be maintained for Windows vmovdqu [rsp + STACK_XMM_OFFSET + 0*16], xmm6 vmovdqu [rsp + STACK_XMM_OFFSET + 1*16], xmm7 vmovdqu [rsp + STACK_XMM_OFFSET + 2*16], xmm8 vmovdqu [rsp + STACK_XMM_OFFSET + 3*16], xmm9 vmovdqu [rsp + STACK_XMM_OFFSET + 4*16], xmm10 vmovdqu [rsp + STACK_XMM_OFFSET + 5*16], xmm11 vmovdqu [rsp + STACK_XMM_OFFSET + 6*16], xmm12 vmovdqu [rsp + STACK_XMM_OFFSET + 7*16], xmm13 vmovdqu [rsp + STACK_XMM_OFFSET + 8*16], xmm14 vmovdqu [rsp + STACK_XMM_OFFSET + 9*16], xmm15 %endif %endmacro ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Restore register content for the caller %macro FUNC_RESTORE 0 %ifidn __OUTPUT_FORMAT__, win64 vmovdqu xmm15, [rsp + STACK_XMM_OFFSET + 9*16] vmovdqu xmm14, [rsp + STACK_XMM_OFFSET + 8*16] vmovdqu xmm13, [rsp + STACK_XMM_OFFSET + 7*16] vmovdqu xmm12, [rsp + STACK_XMM_OFFSET + 6*16] vmovdqu xmm11, [rsp + STACK_XMM_OFFSET + 5*16] vmovdqu xmm10, [rsp + STACK_XMM_OFFSET + 4*16] vmovdqu xmm9, [rsp + STACK_XMM_OFFSET + 3*16] vmovdqu xmm8, [rsp + STACK_XMM_OFFSET + 2*16] vmovdqu xmm7, [rsp + STACK_XMM_OFFSET + 1*16] vmovdqu xmm6, [rsp + STACK_XMM_OFFSET + 0*16] %endif ;; Required for Update/GMC_ENC mov rbp, [rsp + STACK_GP_OFFSET + 5*8] mov rbx, [rsp + STACK_GP_OFFSET + 6*8] %ifidn __OUTPUT_FORMAT__, win64 mov rdi, [rsp + STACK_GP_OFFSET + 7*8] mov rsi, [rsp + STACK_GP_OFFSET + 8*8] %endif mov r12, [rsp + STACK_GP_OFFSET + 0*8] mov r13, [rsp + STACK_GP_OFFSET + 1*8] mov r14, [rsp + STACK_GP_OFFSET + 2*8] mov r15, [rsp + STACK_GP_OFFSET + 3*8] mov rsp, [rsp + STACK_GP_OFFSET + 4*8] ; stack %endmacro ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; GCM_INIT initializes a gcm_context_data struct to prepare for encoding/decoding. ; Input: gcm_key_data * (GDATA_KEY), gcm_context_data *(GDATA_CTX), IV, ; Additional Authentication data (A_IN), Additional Data length (A_LEN). ; Output: Updated GDATA_CTX with the hash of A_IN (AadHash) and initialized other parts of GDATA_CTX. ; Clobbers rax, r10-r13, and xmm0-xmm6 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %macro GCM_INIT 8 %define %%GDATA_KEY %1 ; [in] GCM expanded keys pointer %define %%GDATA_CTX %2 ; [in] GCM context pointer %define %%IV %3 ; [in] IV pointer %define %%A_IN %4 ; [in] AAD pointer %define %%A_LEN %5 ; [in] AAD length in bytes %define %%GPR1 %6 ; temp GPR %define %%GPR2 %7 ; temp GPR %define %%GPR3 %8 ; temp GPR %define %%AAD_HASH xmm14 CALC_AAD_HASH %%A_IN, %%A_LEN, %%AAD_HASH, %%GDATA_KEY, \ zmm1, zmm2, zmm3, zmm4, zmm5, zmm6, zmm7, zmm8, zmm9, zmm10, \ %%GPR1, %%GPR2, %%GPR3 mov %%GPR1, %%A_LEN vmovdqu [%%GDATA_CTX + AadHash], %%AAD_HASH ; ctx_data.aad hash = aad_hash mov [%%GDATA_CTX + AadLen], %%GPR1 ; ctx_data.aad_length = aad_length xor %%GPR1, %%GPR1 mov [%%GDATA_CTX + InLen], %%GPR1 ; ctx_data.in_length = 0 mov [%%GDATA_CTX + PBlockLen], %%GPR1 ; ctx_data.partial_block_length = 0 ;; read 12 IV bytes and pad with 0x00000001 mov %%GPR2, %%IV vmovd xmm3, [%%GPR2 + 8] vpslldq xmm3, 8 vmovq xmm2, [%%GPR2] vmovdqa xmm4, [rel ONEf] vpternlogq xmm2, xmm3, xmm4, 0xfe ; xmm2 = xmm2 or xmm3 or xmm4 vmovdqu [%%GDATA_CTX + OrigIV], xmm2 ; ctx_data.orig_IV = iv ;; store IV as counter in LE format vpshufb xmm2, [rel SHUF_MASK] vmovdqu [%%GDATA_CTX + CurCount], xmm2 ; ctx_data.current_counter = iv %endmacro ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Cipher and ghash of payloads shorter than 128 bytes ;;; - number of blocks in the message comes as argument ;;; - depending on the number of blocks an optimized variant of ;;; INITIAL_BLOCKS_PARTIAL is invoked %macro GCM_ENC_DEC_SMALL 23 %define %%GDATA_KEY %1 ; [in] key pointer %define %%GDATA_CTX %2 ; [in] context pointer %define %%CYPH_PLAIN_OUT %3 ; [in] output buffer %define %%PLAIN_CYPH_IN %4 ; [in] input buffer %define %%PLAIN_CYPH_LEN %5 ; [in] buffer length %define %%ENC_DEC %6 ; [in] cipher direction %define %%DATA_OFFSET %7 ; [in] data offset %define %%LENGTH %8 ; [in] data length %define %%NUM_BLOCKS %9 ; [in] number of blocks to process 1 to 8 %define %%CTR %10 ; [in/out] XMM counter block %define %%HASH_IN_OUT %11 ; [in/out] XMM GHASH value %define %%INSTANCE_TYPE %12 ; [in] single or multi call %define %%ZTMP1 %13 ; [clobbered] ZMM register %define %%ZTMP2 %14 ; [clobbered] ZMM register %define %%ZTMP3 %15 ; [clobbered] ZMM register %define %%ZTMP4 %16 ; [clobbered] ZMM register %define %%ZTMP5 %17 ; [clobbered] ZMM register %define %%ZTMP6 %18 ; [clobbered] ZMM register %define %%ZTMP7 %19 ; [clobbered] ZMM register %define %%ZTMP8 %20 ; [clobbered] ZMM register %define %%IA0 %21 ; [clobbered] GP register %define %%IA1 %22 ; [clobbered] GP register %define %%MASKREG %23 ; [clobbered] mask register cmp %%NUM_BLOCKS, 8 je %%_small_initial_num_blocks_is_8 cmp %%NUM_BLOCKS, 7 je %%_small_initial_num_blocks_is_7 cmp %%NUM_BLOCKS, 6 je %%_small_initial_num_blocks_is_6 cmp %%NUM_BLOCKS, 5 je %%_small_initial_num_blocks_is_5 cmp %%NUM_BLOCKS, 4 je %%_small_initial_num_blocks_is_4 cmp %%NUM_BLOCKS, 3 je %%_small_initial_num_blocks_is_3 cmp %%NUM_BLOCKS, 2 je %%_small_initial_num_blocks_is_2 jmp %%_small_initial_num_blocks_is_1 %%_small_initial_num_blocks_is_8: INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 8, \ %%CTR, %%HASH_IN_OUT, %%ENC_DEC, %%INSTANCE_TYPE, \ %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \ %%ZTMP7, %%ZTMP8, %%IA0, %%IA1, %%MASKREG jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_7: INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 7, \ %%CTR, %%HASH_IN_OUT, %%ENC_DEC, %%INSTANCE_TYPE, \ %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \ %%ZTMP7, %%ZTMP8, %%IA0, %%IA1, %%MASKREG jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_6: INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 6, \ %%CTR, %%HASH_IN_OUT, %%ENC_DEC, %%INSTANCE_TYPE, \ %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \ %%ZTMP7, %%ZTMP8, %%IA0, %%IA1, %%MASKREG jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_5: INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 5, \ %%CTR, %%HASH_IN_OUT, %%ENC_DEC, %%INSTANCE_TYPE, \ %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \ %%ZTMP7, %%ZTMP8, %%IA0, %%IA1, %%MASKREG jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_4: INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 4, \ %%CTR, %%HASH_IN_OUT, %%ENC_DEC, %%INSTANCE_TYPE, \ %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \ %%ZTMP7, %%ZTMP8, %%IA0, %%IA1, %%MASKREG jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_3: INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 3, \ %%CTR, %%HASH_IN_OUT, %%ENC_DEC, %%INSTANCE_TYPE, \ %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \ %%ZTMP7, %%ZTMP8, %%IA0, %%IA1, %%MASKREG jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_2: INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 2, \ %%CTR, %%HASH_IN_OUT, %%ENC_DEC, %%INSTANCE_TYPE, \ %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \ %%ZTMP7, %%ZTMP8, %%IA0, %%IA1, %%MASKREG jmp %%_small_initial_blocks_encrypted %%_small_initial_num_blocks_is_1: INITIAL_BLOCKS_PARTIAL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ %%PLAIN_CYPH_IN, %%LENGTH, %%DATA_OFFSET, 1, \ %%CTR, %%HASH_IN_OUT, %%ENC_DEC, %%INSTANCE_TYPE, \ %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \ %%ZTMP7, %%ZTMP8, %%IA0, %%IA1, %%MASKREG %%_small_initial_blocks_encrypted: %endmacro ; GCM_ENC_DEC_SMALL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; GCM_ENC_DEC Encodes/Decodes given data. Assumes that the passed gcm_context_data struct ; has been initialized by GCM_INIT ; Requires the input data be at least 1 byte long because of READ_SMALL_INPUT_DATA. ; Input: gcm_key_data struct* (GDATA_KEY), gcm_context_data *(GDATA_CTX), input text (PLAIN_CYPH_IN), ; input text length (PLAIN_CYPH_LEN) and whether encoding or decoding (ENC_DEC). ; Output: A cypher of the given plain text (CYPH_PLAIN_OUT), and updated GDATA_CTX ; Clobbers rax, r10-r15, and xmm0-xmm15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %macro GCM_ENC_DEC 7 %define %%GDATA_KEY %1 ; [in] key pointer %define %%GDATA_CTX %2 ; [in] context pointer %define %%CYPH_PLAIN_OUT %3 ; [in] output buffer pointer %define %%PLAIN_CYPH_IN %4 ; [in] input buffer pointer %define %%PLAIN_CYPH_LEN %5 ; [in] buffer length %define %%ENC_DEC %6 ; [in] cipher direction %define %%INSTANCE_TYPE %7 ; [in] 'single_call' or 'multi_call' selection %define %%IA0 r10 %define %%IA1 r12 %define %%IA2 r13 %define %%IA3 r15 %define %%IA4 r11 %define %%LENGTH %%IA2 %define %%CTR_CHECK %%IA3 %define %%DATA_OFFSET %%IA4 %define %%GHASH_IN_AES_OUT_B03 zmm1 %define %%GHASH_IN_AES_OUT_B47 zmm2 %define %%GCM_INIT_CTR_BLOCK xmm2 ; hardcoded in GCM_INIT for now %define %%AES_PARTIAL_BLOCK xmm8 %define %%CTR_BLOCKz zmm9 %define %%CTR_BLOCKx xmm9 %define %%AAD_HASHz zmm14 %define %%AAD_HASHx xmm14 %define %%ZTMP0 zmm0 %define %%ZTMP1 zmm3 %define %%ZTMP2 zmm4 %define %%ZTMP3 zmm5 %define %%ZTMP4 zmm6 %define %%ZTMP5 zmm7 %define %%ZTMP6 zmm10 %define %%ZTMP7 zmm11 %define %%ZTMP8 zmm12 %define %%ZTMP9 zmm13 %define %%ZTMP10 zmm15 %define %%ZTMP11 zmm16 %define %%ZTMP12 zmm17 %define %%MASKREG k1 ;;; Macro flow: ;;; - calculate the number of 16byte blocks in the message ;;; - process (number of 16byte blocks) mod 8 '%%_initial_num_blocks_is_# .. %%_initial_blocks_encrypted' ;;; - process 8 16 byte blocks at a time until all are done in %%_encrypt_by_8_new %ifidn __OUTPUT_FORMAT__, win64 cmp %%PLAIN_CYPH_LEN, 0 %else or %%PLAIN_CYPH_LEN, %%PLAIN_CYPH_LEN %endif je %%_enc_dec_done xor %%DATA_OFFSET, %%DATA_OFFSET ;; Update length of data processed %ifidn __OUTPUT_FORMAT__, win64 mov %%IA0, %%PLAIN_CYPH_LEN add [%%GDATA_CTX + InLen], %%IA0 %else add [%%GDATA_CTX + InLen], %%PLAIN_CYPH_LEN %endif vmovdqu64 %%AAD_HASHx, [%%GDATA_CTX + AadHash] %ifidn %%INSTANCE_TYPE, multi_call ;; NOTE: partial block processing makes only sense for multi_call here. ;; Used for the update flow - if there was a previous partial ;; block fill the remaining bytes here. PARTIAL_BLOCK %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%PLAIN_CYPH_LEN, %%DATA_OFFSET, %%AAD_HASHx, %%ENC_DEC, \ %%IA0, %%IA1, %%IA2, %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, \ %%ZTMP5, %%ZTMP6, %%ZTMP7, %%ZTMP8, %%ZTMP9, %%MASKREG %endif ;; lift counter block from GCM_INIT to here %ifidn %%INSTANCE_TYPE, single_call vmovdqu64 %%CTR_BLOCKx, %%GCM_INIT_CTR_BLOCK %else vmovdqu64 %%CTR_BLOCKx, [%%GDATA_CTX + CurCount] %endif ;; Save the amount of data left to process in %%LENGTH mov %%LENGTH, %%PLAIN_CYPH_LEN %ifidn %%INSTANCE_TYPE, multi_call ;; NOTE: %%DATA_OFFSET is zero in single_call case. ;; Consequently PLAIN_CYPH_LEN will never be zero after ;; %%DATA_OFFSET subtraction below. ;; There may be no more data if it was consumed in the partial block. sub %%LENGTH, %%DATA_OFFSET je %%_enc_dec_done %endif ; %%INSTANCE_TYPE, multi_call ;; Determine how many blocks to process in INITIAL mov %%IA1, %%LENGTH shr %%IA1, 4 and %%IA1, 7 ;; Process one additional block in INITIAL if there is a partial block mov %%IA0, %%LENGTH and %%IA0, 0xf add %%IA0, 0xf shr %%IA0, 4 add %%IA1, %%IA0 ;; %%IA1 can be in the range from 0 to 8 ;; Less than 128B will be handled by the small message code, which ;; can process up to 8 x blocks (16 bytes each) cmp %%LENGTH, 128 jge %%_large_message_path GCM_ENC_DEC_SMALL \ %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%PLAIN_CYPH_LEN, %%ENC_DEC, %%DATA_OFFSET, \ %%LENGTH, %%IA1, %%CTR_BLOCKx, %%AAD_HASHx, %%INSTANCE_TYPE, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, \ %%ZTMP6, %%ZTMP7, %%IA0, %%IA3, %%MASKREG jmp %%_ghash_done %%_large_message_path: ;; Still, don't allow 8 INITIAL blocks since this will ;; can be handled by the x8 partial loop. and %%IA1, 0x7 je %%_initial_num_blocks_is_0 cmp %%IA1, 7 je %%_initial_num_blocks_is_7 cmp %%IA1, 6 je %%_initial_num_blocks_is_6 cmp %%IA1, 5 je %%_initial_num_blocks_is_5 cmp %%IA1, 4 je %%_initial_num_blocks_is_4 cmp %%IA1, 3 je %%_initial_num_blocks_is_3 cmp %%IA1, 2 je %%_initial_num_blocks_is_2 jmp %%_initial_num_blocks_is_1 %%_initial_num_blocks_is_7: INITIAL_BLOCKS %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%LENGTH, %%DATA_OFFSET, 7, %%CTR_BLOCKx, %%AAD_HASHz, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, \ %%ZTMP5, %%ZTMP6, %%ZTMP7, %%ZTMP8, %%ZTMP9, \ %%IA0, %%IA1, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_6: INITIAL_BLOCKS %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%LENGTH, %%DATA_OFFSET, 6, %%CTR_BLOCKx, %%AAD_HASHz, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, \ %%ZTMP5, %%ZTMP6, %%ZTMP7, %%ZTMP8, %%ZTMP9, \ %%IA0, %%IA1, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_5: INITIAL_BLOCKS %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%LENGTH, %%DATA_OFFSET, 5, %%CTR_BLOCKx, %%AAD_HASHz, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, \ %%ZTMP5, %%ZTMP6, %%ZTMP7, %%ZTMP8, %%ZTMP9, \ %%IA0, %%IA1, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_4: INITIAL_BLOCKS %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%LENGTH, %%DATA_OFFSET, 4, %%CTR_BLOCKx, %%AAD_HASHz, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, \ %%ZTMP5, %%ZTMP6, %%ZTMP7, %%ZTMP8, %%ZTMP9, \ %%IA0, %%IA1, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_3: INITIAL_BLOCKS %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%LENGTH, %%DATA_OFFSET, 3, %%CTR_BLOCKx, %%AAD_HASHz, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, \ %%ZTMP5, %%ZTMP6, %%ZTMP7, %%ZTMP8, %%ZTMP9, \ %%IA0, %%IA1, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_2: INITIAL_BLOCKS %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%LENGTH, %%DATA_OFFSET, 2, %%CTR_BLOCKx, %%AAD_HASHz, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, \ %%ZTMP5, %%ZTMP6, %%ZTMP7, %%ZTMP8, %%ZTMP9, \ %%IA0, %%IA1, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_1: INITIAL_BLOCKS %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%LENGTH, %%DATA_OFFSET, 1, %%CTR_BLOCKx, %%AAD_HASHz, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, \ %%ZTMP5, %%ZTMP6, %%ZTMP7, %%ZTMP8, %%ZTMP9, \ %%IA0, %%IA1, %%ENC_DEC jmp %%_initial_blocks_encrypted %%_initial_num_blocks_is_0: INITIAL_BLOCKS %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%LENGTH, %%DATA_OFFSET, 0, %%CTR_BLOCKx, %%AAD_HASHz, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, \ %%ZTMP5, %%ZTMP6, %%ZTMP7, %%ZTMP8, %%ZTMP9, \ %%IA0, %%IA1, %%ENC_DEC %%_initial_blocks_encrypted: ;; move cipher blocks from intial blocks to input of by8 macro vmovdqa64 %%GHASH_IN_AES_OUT_B03, %%ZTMP0 vmovdqa64 %%GHASH_IN_AES_OUT_B47, %%ZTMP1 ;; The entire message was encrypted processed in initial and now need to be hashed or %%LENGTH, %%LENGTH je %%_encrypt_done vshufi64x2 %%CTR_BLOCKz, %%CTR_BLOCKz, %%CTR_BLOCKz, 0 ;; Process 7 full blocks plus a partial block cmp %%LENGTH, 128 jl %%_encrypt_by_8_partial %%_encrypt_by_8_parallel: ;; in_order vs. out_order is an optimization to increment the counter ;; without shuffling it back into little endian. ;; %%CTR_CHECK keeps track of when we need to increment in order so ;; that the carry is handled correctly. vmovd DWORD(%%CTR_CHECK), %%CTR_BLOCKx and DWORD(%%CTR_CHECK), 255 vpshufb %%CTR_BLOCKz, [rel SHUF_MASK] %%_encrypt_by_8_new: cmp DWORD(%%CTR_CHECK), (255 - 8) jg %%_encrypt_by_8 add BYTE(%%CTR_CHECK), 8 GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%DATA_OFFSET, %%CTR_BLOCKz, \ %%GHASH_IN_AES_OUT_B03, %%GHASH_IN_AES_OUT_B47, %%AES_PARTIAL_BLOCK, \ out_order, %%ENC_DEC, full, %%IA0, %%IA1, %%LENGTH, %%INSTANCE_TYPE, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \ %%ZTMP7, %%ZTMP8, %%ZTMP9, %%ZTMP10, %%ZTMP11, %%ZTMP12, %%MASKREG add %%DATA_OFFSET, 128 sub %%LENGTH, 128 cmp %%LENGTH, 128 jge %%_encrypt_by_8_new vpshufb %%CTR_BLOCKz, [rel SHUF_MASK] jmp %%_encrypt_by_8_parallel_done %%_encrypt_by_8: vpshufb %%CTR_BLOCKz, [rel SHUF_MASK] add BYTE(%%CTR_CHECK), 8 GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%DATA_OFFSET, %%CTR_BLOCKz, \ %%GHASH_IN_AES_OUT_B03, %%GHASH_IN_AES_OUT_B47, %%AES_PARTIAL_BLOCK, \ in_order, %%ENC_DEC, full, %%IA0, %%IA1, %%LENGTH, %%INSTANCE_TYPE, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \ %%ZTMP7, %%ZTMP8, %%ZTMP9, %%ZTMP10, %%ZTMP11, %%ZTMP12, %%MASKREG vpshufb %%CTR_BLOCKz, [rel SHUF_MASK] add %%DATA_OFFSET, 128 sub %%LENGTH, 128 cmp %%LENGTH, 128 jge %%_encrypt_by_8_new vpshufb %%CTR_BLOCKz, [rel SHUF_MASK] %%_encrypt_by_8_parallel_done: ;; Test to see if we need a by 8 with partial block. At this point ;; bytes remaining should be either zero or between 113-127. or %%LENGTH, %%LENGTH je %%_encrypt_done %%_encrypt_by_8_partial: ;; Process parallel buffers with a final partial block. ;; 'in_order' shuffle needed to align key for partial block xor. ;; 'out_order' is a little faster because it avoids extra shuffles. ;; - here it would require to account for byte overflow GHASH_8_ENCRYPT_8_PARALLEL %%GDATA_KEY, %%CYPH_PLAIN_OUT, %%PLAIN_CYPH_IN, \ %%DATA_OFFSET, %%CTR_BLOCKz, \ %%GHASH_IN_AES_OUT_B03, %%GHASH_IN_AES_OUT_B47, %%AES_PARTIAL_BLOCK, \ in_order, %%ENC_DEC, partial, %%IA0, %%IA1, %%LENGTH, %%INSTANCE_TYPE, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \ %%ZTMP7, %%ZTMP8, %%ZTMP9, %%ZTMP10, %%ZTMP11, %%ZTMP12, %%MASKREG add %%DATA_OFFSET, (128 - 16) sub %%LENGTH, (128 - 16) %ifidn %%INSTANCE_TYPE, multi_call mov [%%GDATA_CTX + PBlockLen], %%LENGTH vmovdqu64 [%%GDATA_CTX + PBlockEncKey], %%AES_PARTIAL_BLOCK %endif %%_encrypt_done: ;; GHASH last cipher text blocks in xmm1-xmm8 ;; - if block 8th is partial in a multi-call path then skip the block %ifidn %%INSTANCE_TYPE, multi_call cmp qword [%%GDATA_CTX + PBlockLen], 0 jz %%_hash_last_8 ;; save the 8th partial block as GHASH_LAST_7 will clobber %%GHASH_IN_AES_OUT_B47 vextracti32x4 XWORD(%%ZTMP7), %%GHASH_IN_AES_OUT_B47, 3 GHASH_LAST_7 %%GDATA_KEY, %%GHASH_IN_AES_OUT_B47, %%GHASH_IN_AES_OUT_B03, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%ZTMP6, \ %%AAD_HASHx, %%MASKREG, %%IA0 ;; XOR the partial word into the hash vpxorq %%AAD_HASHx, %%AAD_HASHx, XWORD(%%ZTMP7) jmp %%_ghash_done %%_hash_last_8: %endif GHASH_LAST_8 %%GDATA_KEY, %%GHASH_IN_AES_OUT_B47, %%GHASH_IN_AES_OUT_B03, \ %%ZTMP0, %%ZTMP1, %%ZTMP2, %%ZTMP3, %%ZTMP4, %%ZTMP5, %%AAD_HASHx %%_ghash_done: vmovdqu64 [%%GDATA_CTX + CurCount], %%CTR_BLOCKx vmovdqu64 [%%GDATA_CTX + AadHash], %%AAD_HASHx %%_enc_dec_done: %endmacro ; GCM_ENC_DEC ;;; =========================================================================== ;;; AESROUND4x128 macro ;;; - 4 lanes, 8 blocks per lane ;;; - it handles special cases: the last and zero rounds ;;; Uses NROUNDS macro defined at the top of the file to check the last round %macro AESROUND4x128 25 %define %%L0B03 %1 ; [in/out] lane 0, blocks 0 to 3 %define %%L0B47 %2 ; [in/out] lane 0, blocks 4 to 7 %define %%L1B03 %3 ; [in/out] lane 1, blocks 0 to 3 %define %%L1B47 %4 ; ... %define %%L2B03 %5 %define %%L2B47 %6 %define %%L3B03 %7 ; ... %define %%L3B47 %8 ; [in/out] lane 3, blocks 4 to 7 %define %%TMP0 %9 %define %%TMP1 %10 %define %%TMP2 %11 %define %%TMP3 %12 %define %%KP0 %13 ; [in] expanded key pointer lane 0 %define %%KP1 %14 ; [in] expanded key pointer lane 1 %define %%KP2 %15 ; [in] expanded key pointer lane 2 %define %%KP3 %16 ; [in] expanded key pointer lane 3 %define %%ROUND %17 ; [in] round number %define %%D0L %18 ; [in] plain/cipher text blocks 0-3 lane 0 - NEEDED FOR THE LAST ROUND ONLY (CAN BE EMPTY OTHERWISE) %define %%D0H %19 ; [in] plain/cipher text blocks 4-7 lane 0 %define %%D1L %20 ; [in] plain/cipher text blocks 0-3 lane 1 %define %%D1H %21 ; ... %define %%D2L %22 %define %%D2H %23 %define %%D3L %24 ; ... %define %%D3H %25 ; [in] plain/cipher text blocks 4-7 lane 3 vbroadcastf64x2 %%TMP0, [%%KP0 + 16*(%%ROUND)] vbroadcastf64x2 %%TMP1, [%%KP1 + 16*(%%ROUND)] vbroadcastf64x2 %%TMP2, [%%KP2 + 16*(%%ROUND)] vbroadcastf64x2 %%TMP3, [%%KP3 + 16*(%%ROUND)] %if %%ROUND < 1 ;; round 0 vpxorq %%L0B03, %%L0B03, %%TMP0 vpxorq %%L0B47, %%L0B47, %%TMP0 vpxorq %%L1B03, %%L1B03, %%TMP1 vpxorq %%L1B47, %%L1B47, %%TMP1 vpxorq %%L2B03, %%L2B03, %%TMP2 vpxorq %%L2B47, %%L2B47, %%TMP2 vpxorq %%L3B03, %%L3B03, %%TMP3 vpxorq %%L3B47, %%L3B47, %%TMP3 %else %if %%ROUND <= NROUNDS ;; rounds 1 to 9/11/13 vaesenc %%L0B03, %%L0B03, %%TMP0 vaesenc %%L0B47, %%L0B47, %%TMP0 vaesenc %%L1B03, %%L1B03, %%TMP1 vaesenc %%L1B47, %%L1B47, %%TMP1 vaesenc %%L2B03, %%L2B03, %%TMP2 vaesenc %%L2B47, %%L2B47, %%TMP2 vaesenc %%L3B03, %%L3B03, %%TMP3 vaesenc %%L3B47, %%L3B47, %%TMP3 %else ;; the last round - mix enclast with text xor's vaesenclast %%L0B03, %%L0B03, %%TMP0 vpxorq %%L0B03, %%L0B03, %%D0L vaesenclast %%L0B47, %%L0B47, %%TMP0 vpxorq %%L0B47, %%L0B47, %%D0H vaesenclast %%L1B03, %%L1B03, %%TMP1 vpxorq %%L1B03, %%L1B03, %%D1L vaesenclast %%L1B47, %%L1B47, %%TMP1 vpxorq %%L1B47, %%L1B47, %%D1H vaesenclast %%L2B03, %%L2B03, %%TMP2 vpxorq %%L2B03, %%L2B03, %%D2L vaesenclast %%L2B47, %%L2B47, %%TMP2 vpxorq %%L2B47, %%L2B47, %%D2H vaesenclast %%L3B03, %%L3B03, %%TMP3 vpxorq %%L3B03, %%L3B03, %%D3L vaesenclast %%L3B47, %%L3B47, %%TMP3 vpxorq %%L3B47, %%L3B47, %%D3H %endif %endif %endmacro ; AESROUND4x128 ;;; =========================================================================== ;;; AESROUND_1_TO_8_BLOCKS macro ;;; - 1 lane, 1 to 8 blocks per lane ;;; - it handles special cases: the last and zero rounds ;;; Uses NROUNDS macro defined at the top of the file to check the last round %macro AESROUND_1_TO_8_BLOCKS 8 %define %%L0B03 %1 ; [in/out] zmm; blocks 0 to 3 %define %%L0B47 %2 ; [in/out] zmm; blocks 4 to 7 %define %%TMP0 %3 ; [clobbered] zmm %define %%KP %4 ; [in] expanded key pointer %define %%ROUND %5 ; [in] round number %define %%D0L %6 ; [in] zmm or no_data; plain/cipher text blocks 0-3 %define %%D0H %7 ; [in] zmm or no_data; plain/cipher text blocks 4-7 %define %%NUMBL %8 ; [in] number of blocks; numerical value %if (%%NUMBL == 1) ;; don't load the key %elif (%%NUMBL == 2) vbroadcastf64x2 YWORD(%%TMP0), [%%KP + 16*(%%ROUND)] %else vbroadcastf64x2 %%TMP0, [%%KP + 16*(%%ROUND)] %endif ;;; === first AES round %if (%%ROUND < 1) ;; round 0 %if (%%NUMBL > 6) ;; 7, 8 blocks vpxorq %%L0B03, %%L0B03, %%TMP0 vpxorq %%L0B47, %%L0B47, %%TMP0 %elif (%%NUMBL == 6) ;; 6 blocks vpxorq %%L0B03, %%L0B03, %%TMP0 vpxorq YWORD(%%L0B47), YWORD(%%L0B47), YWORD(%%TMP0) %elif (%%NUMBL == 5) ;; 5 blocks vpxorq %%L0B03, %%L0B03, %%TMP0 vpxorq XWORD(%%L0B47), XWORD(%%L0B47), XWORD(%%TMP0) %elif (%%NUMBL > 2) ;; 3, 4 blocks vpxorq %%L0B03, %%L0B03, %%TMP0 %elif (%%NUMBL == 2) ;; 2 blocks vpxorq YWORD(%%L0B03), YWORD(%%L0B03), YWORD(%%TMP0) %else ;; 1 block vpxorq XWORD(%%L0B03), XWORD(%%L0B03), [%%KP + 16*(%%ROUND)] %endif ; NUM BLOCKS %endif ; ROUND 0 ;;; === middle AES rounds %if (%%ROUND >= 1 && %%ROUND <= NROUNDS) ;; rounds 1 to 9/11/13 %if (%%NUMBL > 6) ;; 7, 8 blocks vaesenc %%L0B03, %%L0B03, %%TMP0 vaesenc %%L0B47, %%L0B47, %%TMP0 %elif (%%NUMBL == 6) ;; 6 blocks vaesenc %%L0B03, %%L0B03, %%TMP0 vaesenc YWORD(%%L0B47), YWORD(%%L0B47), YWORD(%%TMP0) %elif (%%NUMBL == 5) ;; 5 blocks vaesenc %%L0B03, %%L0B03, %%TMP0 vaesenc XWORD(%%L0B47), XWORD(%%L0B47), XWORD(%%TMP0) %elif (%%NUMBL > 2) ;; 3, 4 blocks vaesenc %%L0B03, %%L0B03, %%TMP0 %elif (%%NUMBL == 2) ;; 2 blocks vaesenc YWORD(%%L0B03), YWORD(%%L0B03), YWORD(%%TMP0) %else ;; 1 block vaesenc XWORD(%%L0B03), XWORD(%%L0B03), [%%KP + 16*(%%ROUND)] %endif ; NUM BLOCKS %endif ; rounds 1 to 9/11/13 ;;; === last AES round %if (%%ROUND > NROUNDS) ;; the last round - mix enclast with text xor's %if (%%NUMBL > 6) ;; 7, 8 blocks vaesenclast %%L0B03, %%L0B03, %%TMP0 vaesenclast %%L0B47, %%L0B47, %%TMP0 %elif (%%NUMBL == 6) ;; 6 blocks vaesenclast %%L0B03, %%L0B03, %%TMP0 vaesenclast YWORD(%%L0B47), YWORD(%%L0B47), YWORD(%%TMP0) %elif (%%NUMBL == 5) ;; 5 blocks vaesenclast %%L0B03, %%L0B03, %%TMP0 vaesenclast XWORD(%%L0B47), XWORD(%%L0B47), XWORD(%%TMP0) %elif (%%NUMBL > 2) ;; 3, 4 blocks vaesenclast %%L0B03, %%L0B03, %%TMP0 %elif (%%NUMBL == 2) ;; 2 blocks vaesenclast YWORD(%%L0B03), YWORD(%%L0B03), YWORD(%%TMP0) %else ;; 1 block vaesenclast XWORD(%%L0B03), XWORD(%%L0B03), [%%KP + 16*(%%ROUND)] %endif ; NUM BLOCKS ;;; === XOR with data %ifnidn %%D0L, no_data %if (%%NUMBL == 1) vpxorq XWORD(%%L0B03), XWORD(%%L0B03), XWORD(%%D0L) %elif (%%NUMBL == 2) vpxorq YWORD(%%L0B03), YWORD(%%L0B03), YWORD(%%D0L) %else vpxorq %%L0B03, %%L0B03, %%D0L %endif %endif ; !no_data %ifnidn %%D0H, no_data %if (%%NUMBL == 5) vpxorq XWORD(%%L0B47), XWORD(%%L0B47), XWORD(%%D0H) %elif (%%NUMBL == 6) vpxorq YWORD(%%L0B47), YWORD(%%L0B47), YWORD(%%D0H) %elif (%%NUMBL > 6) vpxorq %%L0B47, %%L0B47, %%D0H %endif %endif ; !no_data %endif ; The last round %endmacro ; AESROUND_1_TO_8_BLOCKS ;;; =========================================================================== ;;; =========================================================================== ;;; Encrypt the initial 8 blocks from 4 lanes and apply ghash on the ciphertext %macro INITIAL_BLOCKS_x4 33 %define %%IN %1 ; pointer to array of pointers to input text %define %%OUT %2 ; pointer to array of pointers to output text %define %%KEYP0 %3 ; pointer to expanded keys, lane 0 %define %%KEYP1 %4 ; pointer to expanded keys, lane 1 %define %%KEYP2 %5 ; pointer to expanded keys, lane 2 %define %%KEYP3 %6 ; pointer to expanded keys, lane 3 %define %%TPTR0 %7 ; temporary GP register %define %%TPTR1 %8 ; temporary GP register %define %%TPTR2 %9 ; temporary GP register %define %%TPTR3 %10 ; temporary GP register %define %%L0B03 %11 ; [out] cipher text blocks 0 to 3, lane 0 %define %%L0B47 %12 ; [out] cipher text blocks 4 to 7, lane 0 %define %%L1B03 %13 ; [out] cipher text blocks 0 to 3, lane 1 %define %%L1B47 %14 ; ... %define %%L2B03 %15 %define %%L2B47 %16 %define %%L3B03 %17 ; ... %define %%L3B47 %18 ; [out] cipher text blocks 4 to 7, lane 3 %define %%GHASH %19 ; [in] AAD lane 0, 1, 2 and 3 %define %%T0 %20 ; temporary AVX512 register %define %%T1 %21 ; temporary AVX512 register %define %%T2 %22 ; temporary AVX512 register %define %%T3 %23 ; temporary AVX512 register %define %%T4 %24 ; temporary AVX512 register %define %%T5 %25 ; temporary AVX512 register %define %%T6 %26 ; temporary AVX512 register %define %%T7 %27 ; temporary AVX512 register %define %%T8 %28 ; temporary AVX512 register %define %%T9 %29 ; temporary AVX512 register %define %%T10 %30 ; temporary AVX512 register %define %%T11 %31 ; temporary AVX512 register %define %%ZMM_SHFMASK %32 ; [in] shuffle mask changing byte order in 4 128bit words %define %%ENC_DEC %33 ; [in] ENC (encrypt) or DEC (decrypt) selector %define %%INP0 %%TPTR0 %define %%INP1 %%TPTR1 %define %%INP2 %%TPTR2 %define %%INP3 %%TPTR3 %define %%OUTP0 %%TPTR0 %define %%OUTP1 %%TPTR1 %define %%OUTP2 %%TPTR2 %define %%OUTP3 %%TPTR3 ;; load data in mov %%INP0, [%%IN + 8*0] mov %%INP1, [%%IN + 8*1] mov %%INP2, [%%IN + 8*2] mov %%INP3, [%%IN + 8*3] VX512LDR %%T4, [%%INP0 + (16*0)] VX512LDR %%T5, [%%INP0 + (16*4)] VX512LDR %%T6, [%%INP1 + (16*0)] VX512LDR %%T7, [%%INP1 + (16*4)] VX512LDR %%T8, [%%INP2 + (16*0)] VX512LDR %%T9, [%%INP2 + (16*4)] VX512LDR %%T10,[%%INP3 + (16*0)] VX512LDR %%T11,[%%INP3 + (16*4)] ;; shuffle IVB's vpshufb %%L0B03, %%ZMM_SHFMASK ; perform a 16Byte swap vpshufb %%L0B47, %%ZMM_SHFMASK ; perform a 16Byte swap vpshufb %%L1B03, %%ZMM_SHFMASK ; perform a 16Byte swap vpshufb %%L1B47, %%ZMM_SHFMASK ; perform a 16Byte swap vpshufb %%L2B03, %%ZMM_SHFMASK ; perform a 16Byte swap vpshufb %%L2B47, %%ZMM_SHFMASK ; perform a 16Byte swap vpshufb %%L3B03, %%ZMM_SHFMASK ; perform a 16Byte swap vpshufb %%L3B47, %%ZMM_SHFMASK ; perform a 16Byte swap ;; move to AES encryption rounds AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 0, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 1, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 2, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 3, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 4, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 5, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 6, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 7, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 8, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 9, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 10, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 %ifndef GCM128_MODE AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 11, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 12, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 %ifdef GCM256_MODE AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 13, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 14, \ %%T4, %%T5, %%T6, %%T7, %%T8, %%T9, %%T10, %%T11 %endif %endif ;; store mov %%OUTP0, [%%OUT + 8*0] mov %%OUTP1, [%%OUT + 8*1] mov %%OUTP2, [%%OUT + 8*2] mov %%OUTP3, [%%OUT + 8*3] VX512STR [%%OUTP0 + (16*0)], %%L0B03 VX512STR [%%OUTP0 + (16*4)], %%L0B47 VX512STR [%%OUTP1 + (16*0)], %%L1B03 VX512STR [%%OUTP1 + (16*4)], %%L1B47 VX512STR [%%OUTP2 + (16*0)], %%L2B03 VX512STR [%%OUTP2 + (16*4)], %%L2B47 VX512STR [%%OUTP3 + (16*0)], %%L3B03 VX512STR [%%OUTP3 + (16*4)], %%L3B47 %ifidn %%ENC_DEC, DEC ;; decryption - cipher text needs to go to GHASH phase vpshufb %%L0B03, %%T4, %%ZMM_SHFMASK vpshufb %%L0B47, %%T5, %%ZMM_SHFMASK vpshufb %%L1B03, %%T6, %%ZMM_SHFMASK vpshufb %%L1B47, %%T7, %%ZMM_SHFMASK vpshufb %%L2B03, %%T8, %%ZMM_SHFMASK vpshufb %%L2B47, %%T9, %%ZMM_SHFMASK vpshufb %%L3B03, %%T10, %%ZMM_SHFMASK vpshufb %%L3B47, %%T11, %%ZMM_SHFMASK %else ;; encryption vpshufb %%L0B03, %%L0B03, %%ZMM_SHFMASK vpshufb %%L0B47, %%L0B47, %%ZMM_SHFMASK vpshufb %%L1B03, %%L1B03, %%ZMM_SHFMASK vpshufb %%L1B47, %%L1B47, %%ZMM_SHFMASK vpshufb %%L2B03, %%L2B03, %%ZMM_SHFMASK vpshufb %%L2B47, %%L2B47, %%ZMM_SHFMASK vpshufb %%L3B03, %%L3B03, %%ZMM_SHFMASK vpshufb %%L3B47, %%L3B47, %%ZMM_SHFMASK %endif ;; xor encrypted block 0 with GHASH for the next GHASH round vmovdqa64 XWORD(%%T1), XWORD(%%GHASH) vextracti32x4 XWORD(%%T2), %%GHASH, 1 vextracti32x4 XWORD(%%T3), %%GHASH, 2 vextracti32x4 XWORD(%%T4), %%GHASH, 3 vpxorq %%L0B03, %%T1 vpxorq %%L1B03, %%T2 vpxorq %%L2B03, %%T3 vpxorq %%L3B03, %%T4 %endmacro ;INITIAL_BLOCKS_x4 ;;; =========================================================================== ;;; =========================================================================== ;;; Encrypt 8 blocks at a time on 4 lanes ;;; GHASH the 8 previously encrypted ciphertext blocks (4 lanes) %macro GHASH_8_ENCRYPT_8_PARALLEL_x4 44 %define %%IN %1 ; pointer to array of pointers to plain/cipher text %define %%OUT %2 ; pointer to array of pointers to cipher/plain text %define %%KEYP0 %3 ; pointer to expanded keys, lane 0 %define %%KEYP1 %4 ; pointer to expanded keys, lane 1 %define %%KEYP2 %5 ; pointer to expanded keys, lane 2 %define %%KEYP3 %6 ; pointer to expanded keys, lane 3 %define %%TPTR0 %7 ; temporary GP register (used as pointer) %define %%TPTR1 %8 ; temporary GP register (used as pointer) %define %%TPTR2 %9 ; temporary GP register (used as pointer) %define %%TPTR3 %10 ; temporary GP register (used as pointer) %define %%DATA_OFFSET %11 ; current data offset (used with text loads and stores) %define %%CTRL0 %12 ; counter blocks 4 to 7 for lane 0 %define %%CTRL1 %13 ; counter blocks 4 to 7 for lane 1 %define %%CTRL2 %14 ; counter blocks 4 to 7 for lane 2 %define %%CTRL3 %15 ; counter blocks 4 to 7 for lane 3 %define %%L0B03 %16 ; lane 0 blocks 0 to 3 %define %%L0B47 %17 ; lane 0 blocks 4 to 7 %define %%L1B03 %18 ; lane 1 blocks 0 to 3 %define %%L1B47 %19 ; lane 1 blocks 4 to 7 %define %%L2B03 %20 ; lane 2 blocks 0 to 3 %define %%L2B47 %21 ; lane 2 blocks 4 to 7 %define %%L3B03 %22 ; lane 3 blocks 0 to 3 %define %%L3B47 %23 ; lane 3 blocks 4 to 7 %define %%GHASH %24 ; [in/out] GHASH for 4 lanes %define %%T0 %25 %define %%T1 %26 %define %%T2 %27 %define %%T3 %28 %define %%T4 %29 %define %%T5 %30 %define %%T6 %31 %define %%T7 %32 %define %%T8 %33 %define %%T9 %34 %define %%PREVLO0 %35 ; [in] 4 lanes x 8 blocks of cipher text for GHASH %define %%PREVHI0 %36 %define %%PREVLO1 %37 %define %%PREVHI1 %38 %define %%PREVLO2 %39 %define %%PREVHI2 %40 %define %%PREVLO3 %41 %define %%PREVHI3 %42 %define %%ZMM_SHFMASK %43 ; [in] byte swap shuffle mask for 128 bits %define %%ENC_DEC %44 ; [in] ENC (encryption) or DEC (decryption) ;;; ============================================================================ ;;; a few virtual register mappings %define %%INP0 %%TPTR0 %define %%INP1 %%TPTR1 %define %%INP2 %%TPTR2 %define %%INP3 %%TPTR3 %define %%OUTP0 %%TPTR0 %define %%OUTP1 %%TPTR1 %define %%OUTP2 %%TPTR2 %define %%OUTP3 %%TPTR3 %define %%TH %%T5 %define %%TM %%T6 %define %%TL %%T7 %define %%TEXTL0B03 %%T8 %define %%TEXTL0B47 %%T9 %define %%TEXTL1B03 %%PREVLO1 ; GHASH needs to be complete before using these %define %%TEXTL1B47 %%PREVHI1 %define %%TEXTL2B03 %%PREVLO2 %define %%TEXTL2B47 %%PREVHI2 %define %%TEXTL3B03 %%PREVLO3 %define %%TEXTL3B47 %%PREVHI3 ;;; ============================================================================ AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 0, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 mov %%INP0, [%%IN + 8*0] mov %%INP1, [%%IN + 8*1] mov %%INP2, [%%IN + 8*2] mov %%INP3, [%%IN + 8*3] ;; ===================================================================== VCLMUL_STEP1 %%KEYP0, %%PREVHI0, %%T4, %%TH, %%TM, %%TL AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 1, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 VCLMUL_STEP2 %%KEYP0, %%PREVHI0, %%PREVLO0, %%T4, %%T8, %%T9, %%TH, %%TM, %%TL AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 2, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 ;; ===================================================================== VCLMUL_STEP1 %%KEYP1, %%PREVHI1, %%T4, %%TH, %%TM, %%TL AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 3, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 VCLMUL_STEP2 %%KEYP1, %%PREVHI1, %%PREVLO1, %%T4, %%T8, %%T9, %%TH, %%TM, %%TL AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 4, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 ;; accumulate GHASH results from 4 lanes into [%%PREVHI0 (msb) : %%PREVLO0 (lsb)] vinserti64x2 %%PREVLO0, XWORD(%%PREVLO1), 1 vinserti64x2 %%PREVHI0, XWORD(%%PREVHI1), 1 ;; ===================================================================== VCLMUL_STEP1 %%KEYP2, %%PREVHI2, %%T4, %%T5, %%T6, %%T7 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 5, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 VCLMUL_STEP2 %%KEYP2, %%PREVHI2, %%PREVLO2, %%T4, %%T8, %%T9, %%T5, %%T6, %%T7 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 6, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 ;; accumulate GHASH results from 4 lanes into [%%PREVHI0 (msb) : %%PREVLO0 (lsb)] vinserti64x2 %%PREVLO0, XWORD(%%PREVLO2), 2 vinserti64x2 %%PREVHI0, XWORD(%%PREVHI2), 2 ;; ===================================================================== VCLMUL_STEP1 %%KEYP3, %%PREVHI3, %%T4, %%T5, %%T6, %%T7 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 7, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 VCLMUL_STEP2 %%KEYP3, %%PREVHI3, %%PREVLO3, %%T4, %%T8, %%T9, %%T5, %%T6, %%T7 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 8, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 ;; accumulate GHASH results from 4 lanes into [%%PREVHI0 (msb) : %%PREVLO0 (lsb)] vinserti64x2 %%PREVLO0, XWORD(%%PREVLO3), 3 vinserti64x2 %%PREVHI0, XWORD(%%PREVHI3), 3 ;; ===================================================================== ;; load plain/cipher text ;; - this cannot be done before GHASH is complete (reuses same registers) VX512LDR %%TEXTL0B03, [%%INP0 + %%DATA_OFFSET + 64*0] VX512LDR %%TEXTL0B47, [%%INP0 + %%DATA_OFFSET + 64*1] VX512LDR %%TEXTL1B03, [%%INP1 + %%DATA_OFFSET + 64*0] VX512LDR %%TEXTL1B47, [%%INP1 + %%DATA_OFFSET + 64*1] VX512LDR %%TEXTL2B03, [%%INP2 + %%DATA_OFFSET + 64*0] VX512LDR %%TEXTL2B47, [%%INP2 + %%DATA_OFFSET + 64*1] VX512LDR %%TEXTL3B03, [%%INP3 + %%DATA_OFFSET + 64*0] VX512LDR %%TEXTL3B47, [%%INP3 + %%DATA_OFFSET + 64*1] mov %%OUTP0, [%%OUT + 8*0] mov %%OUTP1, [%%OUT + 8*1] mov %%OUTP2, [%%OUT + 8*2] mov %%OUTP3, [%%OUT + 8*3] ;; ===================================================================== AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 9, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 10, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 %ifndef GCM128_MODE AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 11, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 12, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 %ifdef GCM256_MODE AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 13, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 AESROUND4x128 %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%T0, %%T1, %%T2, %%T3, \ %%KEYP0, %%KEYP1, %%KEYP2, %%KEYP3, 14, \ %%TEXTL0B03, %%TEXTL0B47, %%TEXTL1B03, %%TEXTL1B47, \ %%TEXTL2B03, %%TEXTL2B47, %%TEXTL3B03, %%TEXTL3B47 %endif ; GCM256 %endif ; !GCM128 ;; ===================================================================== ;; ===================================================================== ;; ===================================================================== ;; ===================================================================== ;; first phase of the reduction (barret) ;; - becasue of bit ordering, LSB 128 bit word is reduced rather than MSB ;; - accumulated GHASH in [%%PREVHI0 (msb) : %%PREVLO0 (lsb)] vmovdqu64 %%T3, [rel POLY2] vpclmulqdq %%T4, %%T3, %%PREVLO0, 0x01 vpslldq %%T4, %%T4, 8 ; shift-L 2 DWs vpxorq %%PREVLO0, %%PREVLO0, %%T4 ; first phase of the reduction complete ;; ===================================================================== ;; store cipher/plain text VX512STR [%%OUTP0 + %%DATA_OFFSET + 64*0], %%L0B03 VX512STR [%%OUTP0 + %%DATA_OFFSET + 64*1], %%L0B47 VX512STR [%%OUTP1 + %%DATA_OFFSET + 64*0], %%L1B03 VX512STR [%%OUTP1 + %%DATA_OFFSET + 64*1], %%L1B47 VX512STR [%%OUTP2 + %%DATA_OFFSET + 64*0], %%L2B03 VX512STR [%%OUTP2 + %%DATA_OFFSET + 64*1], %%L2B47 VX512STR [%%OUTP3 + %%DATA_OFFSET + 64*0], %%L3B03 VX512STR [%%OUTP3 + %%DATA_OFFSET + 64*1], %%L3B47 ;; ===================================================================== ;; second phase of the reduction vpclmulqdq %%T4, %%T3, %%PREVLO0, 0x00 vpsrldq %%T4, %%T4, 4 ; shift-R 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) vpclmulqdq %%GHASH, %%T3, %%PREVLO0, 0x10 vpslldq %%GHASH, %%GHASH, 4 ; shift-L 1 DW (Shift-L 1-DW to obtain result with no shifts) ;; second phase of the reduction complete vpternlogq %%GHASH, %%T4, %%PREVHI0, 0x96 ; GHASH = GHASH xor T4 xor PREVHI0 ;; ===================================================================== ;; prepare cipher blocks for the next GHASH round %ifidn %%ENC_DEC, ENC vpshufb %%L0B03, %%L0B03, %%ZMM_SHFMASK vpshufb %%L0B47, %%L0B47, %%ZMM_SHFMASK vpshufb %%L1B03, %%L1B03, %%ZMM_SHFMASK vpshufb %%L1B47, %%L1B47, %%ZMM_SHFMASK vpshufb %%L2B03, %%L2B03, %%ZMM_SHFMASK vpshufb %%L2B47, %%L2B47, %%ZMM_SHFMASK vpshufb %%L3B03, %%L3B03, %%ZMM_SHFMASK vpshufb %%L3B47, %%L3B47, %%ZMM_SHFMASK %else ;; GHASH is computed over cipher text (use text) vpshufb %%L0B03, %%TEXTL0B03, %%ZMM_SHFMASK vpshufb %%L0B47, %%TEXTL0B47, %%ZMM_SHFMASK vpshufb %%L1B03, %%TEXTL1B03, %%ZMM_SHFMASK vpshufb %%L1B47, %%TEXTL1B47, %%ZMM_SHFMASK vpshufb %%L2B03, %%TEXTL2B03, %%ZMM_SHFMASK vpshufb %%L2B47, %%TEXTL2B47, %%ZMM_SHFMASK vpshufb %%L3B03, %%TEXTL3B03, %%ZMM_SHFMASK vpshufb %%L3B47, %%TEXTL3B47, %%ZMM_SHFMASK %endif ;; xor encrypted block 0 with GHASH for the next round vmovdqa64 XWORD(%%T1), XWORD(%%GHASH) vextracti32x4 XWORD(%%T2), %%GHASH, 1 vextracti32x4 XWORD(%%T3), %%GHASH, 2 vextracti32x4 XWORD(%%T4), %%GHASH, 3 vpxorq %%L0B03, %%T1 vpxorq %%L1B03, %%T2 vpxorq %%L2B03, %%T3 vpxorq %%L3B03, %%T4 %endmacro ; GHASH_8_ENCRYPT_8_PARALLEL_x4 ;;; =========================================================================== ;;; =========================================================================== ;;; GHASH the last 8 ciphertext blocks on 4 lanes %macro GHASH_LAST_8x4 25 %define %%KEYP0 %1 ; [in] pointer to expanded keys, lane 0 %define %%KEYP1 %2 ; [in] pointer to expanded keys, lane 1 %define %%KEYP2 %3 ; [in] pointer to expanded keys, lane 2 %define %%KEYP3 %4 ; [in] pointer to expanded keys, lane 3 %define %%L0B03 %5 ; [in] clobbered, ciper text, lane 0, blocks 0 to 3 (Y0 already XOR'ed on X1) %define %%L0B47 %6 ; [in] clobbered, ciper text, lane 0, blocks 4 to 7 %define %%L1B03 %7 ; ... %define %%L1B47 %8 %define %%L2B03 %9 %define %%L2B47 %10 %define %%L3B03 %11 ; ... %define %%L3B47 %12 ; [in] clobbered, ciper text, lane 3, blocks 4 to 7 %define %%GHASH %13 ; [out] ghash output %define %%T1 %14 %define %%T2 %15 %define %%T3 %16 %define %%T4 %17 %define %%T5 %18 %define %%T6 %19 %define %%T7 %20 %define %%T8 %21 %define %%T9 %22 %define %%T10 %23 %define %%T11 %24 %define %%T12 %25 %define %%TH %%T5 %define %%TM %%T6 %define %%TL %%T7 %define %%L %%T1 %define %%H %%T2 ;; ===================================================================== ;; lane 0, 8 blocks VCLMUL_STEP1 %%KEYP0, %%L0B47, %%T4, %%TH, %%TM, %%TL VCLMUL_STEP2 %%KEYP0, %%L0B47, %%L0B03, \ %%T4, %%T8, %%T9, \ %%TH, %%TM, %%TL vmovdqa64 XWORD(%%L), XWORD(%%L0B03) vmovdqa64 XWORD(%%H), XWORD(%%L0B47) ;; ===================================================================== ;; lane 1, 8 blocks VCLMUL_STEP1 %%KEYP1, %%L1B47, %%T4, %%TH, %%TM, %%TL VCLMUL_STEP2 %%KEYP1, %%L1B47, %%L1B03, \ %%T4, %%T8, %%T9, \ %%TH, %%TM, %%TL vinserti64x2 %%L, XWORD(%%L1B03), 1 vinserti64x2 %%H, XWORD(%%L1B47), 1 ;; ===================================================================== ;; lane 2, 8 blocks VCLMUL_STEP1 %%KEYP2, %%L2B47, %%T4, %%TH, %%TM, %%TL VCLMUL_STEP2 %%KEYP2, %%L2B47, %%L2B03, \ %%T4, %%T8, %%T9, \ %%TH, %%TM, %%TL vinserti64x2 %%L, XWORD(%%L2B03), 2 vinserti64x2 %%H, XWORD(%%L2B47), 2 ;; ===================================================================== ;; lane 3, 8 blocks VCLMUL_STEP1 %%KEYP3, %%L3B47, %%T4, %%TH, %%TM, %%TL VCLMUL_STEP2 %%KEYP3, %%L3B47, %%L3B03, \ %%T4, %%T8, %%T9, \ %%TH, %%TM, %%TL vinserti64x2 %%L, XWORD(%%L3B03), 3 vinserti64x2 %%H, XWORD(%%L3B47), 3 ;; ===================================================================== ;; ===================================================================== ;; first phase of the reduction <H(hi):L(low)> ;; - reducing L, rather H, due to bit ordering vmovdqu64 %%T3, [rel POLY2] vpclmulqdq %%T4, %%T3, %%L, 0x01 vpslldq %%T4, %%T4, 8 ; shift-L xmm2 2 DWs vpxorq %%L, %%L, %%T4 ; first phase of the reduction complete ;; ===================================================================== ;; second phase of the reduction vpclmulqdq %%T4, %%T3, %%L, 0x00 vpsrldq %%T4, %%T4, 4 ; shift-R 1 DW (Shift-R only 1-DW to obtain 2-DWs shift-R) vpclmulqdq %%GHASH, %%T3, %%L, 0x10 vpslldq %%GHASH, %%GHASH, 4 ; shift-L 1 DW (Shift-L 1-DW to obtain result with no shifts) ;; second phase of the reduction complete vpternlogq %%GHASH, %%T4, %%H, 0x96 ; GHASH = GHASH xor T4 xor H ;; ===================================================================== %endmacro ;;; =========================================================================== ;;; =========================================================================== ;;; GCM_ENC_DEC_4x128 Encodes/Decodes given data ;;; - 4 lanes, 8 blocks at a time (hence 4x128 bytes or 4x8 blocks) ;;; - assumes that the passed gcm_context_data struct has been initialized by GCM_INIT ;;; - requires the input data be multiple of 128 bytes ;;; Input: gcm_key_data struct *GDATA_KEY[4] ;;; gcm_context_data *GDATA_CTX[4] ;;; input text PLAIN_CYPH_IN[4] ;;; input text length (PLAIN_CYPH_LEN) and ;;; whether encoding or decoding (ENC_DEC). ;;; Output: A cipher of the given plain text CYPH_PLAIN_OUT[4] ;;; updated GDATA_CTX[4] ;;; Linux clobbers: rax, rbx, rcx, rdx, rbp, r8-r15, zmm0-zmm31 ;;; Windows clobbers: rax, rbx, rdi ,rsi, rbp, r8-r15, zmm0-zmm31 ;;; =========================================================================== %macro GCM_ENC_DEC_4x128 3 %define %%STATE %1 ; [in] pointer to an array with 4 pointers to expanded keys %define %%PLAIN_CYPH_LEN %2 ; [in] length of the text to process (multiple of 128 bytes) %define %%ENC_DEC %3 ; [in] ENC (encrypt) or DEC (decrypt) selector %define %%GDATA_KEY %%STATE + _gcm_args_keys %define %%GDATA_CTX %%STATE + _gcm_args_ctx %define %%CYPH_PLAIN_OUT %%STATE + _gcm_args_out %define %%PLAIN_CYPH_IN %%STATE + _gcm_args_in %define %%LEN_REG %%PLAIN_CYPH_LEN %define %%DATA_OFFSET r14 ;; @note: on windows this reg is used to retrive stack args ;;; =========================================================================== ;;; register mappings within the macro %define %%TPTR0 r9 %define %%TPTR1 r10 %define %%TPTR2 r11 %define %%TPTR3 r12 %define %%GPR0 rax %define %%GPR1 rbx %define %%GPR2 rbp %define %%GPR3 r15 %ifidn __OUTPUT_FORMAT__, win64 %define %%KPTR0 r8 %define %%KPTR1 r13 %define %%KPTR2 rdi %define %%KPTR3 rsi %else %define %%KPTR0 rdx %define %%KPTR1 rcx %define %%KPTR2 r8 %define %%KPTR3 r13 %endif %define %%L0B03 zmm0 %define %%L0B47 zmm1 %define %%L1B03 zmm2 %define %%L1B47 zmm3 %define %%L2B03 zmm4 %define %%L2B47 zmm5 %define %%L3B03 zmm6 %define %%L3B47 zmm7 %define %%T1 zmm8 %define %%T2 zmm9 %define %%T3 zmm10 %define %%T4 zmm11 %define %%T5 zmm12 %define %%T6 zmm13 %define %%T7 zmm14 %define %%T8 zmm15 %define %%T9 zmm16 %define %%T10 zmm17 %define %%T11 zmm18 %define %%T12 zmm19 %define %%T13 zmm20 %define %%T14 zmm21 %define %%T15 zmm22 %define %%T16 zmm23 %define %%T17 zmm24 %define %%T18 zmm25 %define %%GHASH zmm26 %define %%CTRL0 zmm27 %define %%CTRL1 zmm28 %define %%CTRL2 zmm29 %define %%CTRL3 zmm30 %define %%ZMM_SHUF_MASK zmm31 ;;; =========================================================================== ;;; virtual register mappings %define %%PREVLO0 %%T11 ; 4 lanes x 8 blocks of cipher text for GHASH %define %%PREVHI0 %%T12 %define %%PREVLO1 %%T13 %define %%PREVHI1 %%T14 %define %%PREVLO2 %%T15 %define %%PREVHI2 %%T16 %define %%PREVLO3 %%T17 %define %%PREVHI3 %%T18 ;;; =========================================================================== or %%LEN_REG, %%LEN_REG jz %%_enc_dec_done_x4 mov %%DATA_OFFSET, 128 ;; load GCM CTX pointers for 4 lanes mov %%TPTR0, [%%GDATA_CTX + (0*8)] mov %%TPTR1, [%%GDATA_CTX + (1*8)] mov %%TPTR2, [%%GDATA_CTX + (2*8)] mov %%TPTR3, [%%GDATA_CTX + (3*8)] ;; load common constants used in the code vmovdqa64 %%ZMM_SHUF_MASK, [rel SHUF_MASK] ;; Update length of data processed add [%%TPTR0 + InLen], %%LEN_REG add [%%TPTR1 + InLen], %%LEN_REG add [%%TPTR2 + InLen], %%LEN_REG add [%%TPTR3 + InLen], %%LEN_REG ;; extract current hash values from 4 lanes vmovdqu64 XWORD(%%GHASH), [%%TPTR0 + AadHash] vinserti64x2 %%GHASH, [%%TPTR1 + AadHash], 1 vinserti64x2 %%GHASH, [%%TPTR2 + AadHash], 2 vinserti64x2 %%GHASH, [%%TPTR3 + AadHash], 3 ;; lift CTR set from initial_blocks to here vmovdqa64 %%T1, [rel ddq_add_1234] vmovdqa64 %%T2, [rel ddq_add_5678] vbroadcastf64x2 %%CTRL0, [%%TPTR0 + CurCount] vbroadcastf64x2 %%CTRL1, [%%TPTR1 + CurCount] vbroadcastf64x2 %%CTRL2, [%%TPTR2 + CurCount] vbroadcastf64x2 %%CTRL3, [%%TPTR3 + CurCount] vpaddd %%L0B03, %%CTRL0, %%T1 vpaddd %%L1B03, %%CTRL1, %%T1 vpaddd %%L2B03, %%CTRL2, %%T1 vpaddd %%L3B03, %%CTRL3, %%T1 vpaddd %%L0B47, %%CTRL0, %%T2 vpaddd %%L1B47, %%CTRL1, %%T2 vpaddd %%L2B47, %%CTRL2, %%T2 vpaddd %%L3B47, %%CTRL3, %%T2 vmovdqa64 %%CTRL0, %%L0B47 vmovdqa64 %%CTRL1, %%L1B47 vmovdqa64 %%CTRL2, %%L2B47 vmovdqa64 %%CTRL3, %%L3B47 ;; load GCM key pointers for 4 lanes mov %%KPTR0, [%%GDATA_KEY + (0*8)] mov %%KPTR1, [%%GDATA_KEY + (1*8)] mov %%KPTR2, [%%GDATA_KEY + (2*8)] mov %%KPTR3, [%%GDATA_KEY + (3*8)] %%_cipher_only_x4: ;; run cipher only over the first 8 blocks INITIAL_BLOCKS_x4 %%PLAIN_CYPH_IN, %%CYPH_PLAIN_OUT, \ %%KPTR0, %%KPTR1, %%KPTR2, %%KPTR3, \ %%TPTR0, %%TPTR1, %%TPTR2, %%TPTR3, \ %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%GHASH, \ %%T1, %%T2, %%T3, %%T4, %%T5, %%T6, %%T7, %%T8, \ %%T9, %%T10, %%T11, %%T12, \ %%ZMM_SHUF_MASK, %%ENC_DEC ;; Update length sub %%LEN_REG, 128 jz %%_encrypt_done_x4 vmovq %%GPR0, XWORD(%%CTRL0) vmovq %%GPR1, XWORD(%%CTRL1) vmovq %%GPR2, XWORD(%%CTRL2) vmovq %%GPR3, XWORD(%%CTRL3) and %%GPR0, 255 and %%GPR1, 255 and %%GPR2, 255 and %%GPR3, 255 ;; shuffle the counters to BE vpshufb %%CTRL0, %%ZMM_SHUF_MASK vpshufb %%CTRL1, %%ZMM_SHUF_MASK vpshufb %%CTRL2, %%ZMM_SHUF_MASK vpshufb %%CTRL3, %%ZMM_SHUF_MASK %%_encrypt_by_8_parallel_x4: ;; get max counter value cmp %%GPR0, %%GPR1 cmova %%GPR1, %%GPR0 cmp %%GPR2, %%GPR1 cmova %%GPR1, %%GPR2 cmp %%GPR3, %%GPR1 cmova %%GPR1, %%GPR3 ;; at this stage %%GPR1 includes max 8-bit LS counter from 4 lanes ;; if max counter is above 244 then overflow will occur cmp %%GPR1, 244 ja %%_encrypt_by_8_overflow_x4 ;; (256 - 8) because we process 8 blocks at a time ;; Max number of blocks that can be processed in a lane ;; without shuffling is (256 - 8) mov %%GPR0, (256 - 8) sub %%GPR0, %%GPR1 shr %%GPR0, 3 ;; GPR0 holds number of iterations based on remaing blocks before overflow ;; get number of iterations from the remaining byte length mov %%GPR1, %%LEN_REG shr %%GPR1, 7 ;; pick the smallest one (GPR0 will be the counter) cmp %%GPR1, %%GPR0 cmovb %%GPR0, %%GPR1 %%_encrypt_by_8_x4: ;; copy previously encrypted blocks for GHASH vmovdqa64 %%PREVLO0, %%L0B03 vmovdqa64 %%PREVHI0, %%L0B47 vmovdqa64 %%PREVLO1, %%L1B03 vmovdqa64 %%PREVHI1, %%L1B47 vmovdqa64 %%PREVLO2, %%L2B03 vmovdqa64 %%PREVHI2, %%L2B47 vmovdqa64 %%PREVLO3, %%L3B03 vmovdqa64 %%PREVHI3, %%L3B47 ;; - no byte overflow and no shuffling required vmovdqa64 %%T1, [rel ddq_addbe_4444] vmovdqa64 %%T2, [rel ddq_addbe_8888] vpaddd %%L0B03, %%CTRL0, %%T1 vpaddd %%L1B03, %%CTRL1, %%T1 vpaddd %%L2B03, %%CTRL2, %%T1 vpaddd %%L3B03, %%CTRL3, %%T1 vpaddd %%L0B47, %%CTRL0, %%T2 vpaddd %%L1B47, %%CTRL1, %%T2 vpaddd %%L2B47, %%CTRL2, %%T2 vpaddd %%L3B47, %%CTRL3, %%T2 vmovdqa64 %%CTRL0, %%L0B47 vmovdqa64 %%CTRL1, %%L1B47 vmovdqa64 %%CTRL2, %%L2B47 vmovdqa64 %%CTRL3, %%L3B47 GHASH_8_ENCRYPT_8_PARALLEL_x4 %%PLAIN_CYPH_IN, %%CYPH_PLAIN_OUT, \ %%KPTR0, %%KPTR1, %%KPTR2, %%KPTR3, \ %%TPTR0, %%TPTR1, %%TPTR2, %%TPTR3, \ %%DATA_OFFSET, \ %%CTRL0, %%CTRL1, %%CTRL2, %%CTRL3, \ %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%GHASH, \ %%T1, %%T2, %%T3, %%T4, %%T5, %%T6, %%T7, \ %%T8, %%T9, %%T10, \ %%PREVLO0, %%PREVHI0, %%PREVLO1, %%PREVHI1, \ %%PREVLO2, %%PREVHI2, %%PREVLO3, %%PREVHI3, \ %%ZMM_SHUF_MASK, %%ENC_DEC add %%DATA_OFFSET, 128 sub %%LEN_REG, 128 sub %%GPR0, 1 jnz %%_encrypt_by_8_x4 %%_encrypt_by_8_overflow_x4: ;; shuffle the counters back to LE vpshufb %%CTRL0, %%ZMM_SHUF_MASK vpshufb %%CTRL1, %%ZMM_SHUF_MASK vpshufb %%CTRL2, %%ZMM_SHUF_MASK vpshufb %%CTRL3, %%ZMM_SHUF_MASK or %%LEN_REG, %%LEN_REG jz %%_encrypt_done_x4 ;; copy previously encrypted blocks for GHASH vmovdqa64 %%PREVLO0, %%L0B03 vmovdqa64 %%PREVHI0, %%L0B47 vmovdqa64 %%PREVLO1, %%L1B03 vmovdqa64 %%PREVHI1, %%L1B47 vmovdqa64 %%PREVLO2, %%L2B03 vmovdqa64 %%PREVHI2, %%L2B47 vmovdqa64 %%PREVLO3, %%L3B03 vmovdqa64 %%PREVHI3, %%L3B47 ;; prepare new counter blocks in LE vmovdqa64 %%T1, [rel ddq_add_4444] vmovdqa64 %%T2, [rel ddq_add_8888] vpaddd %%L0B03, %%CTRL0, %%T1 vpaddd %%L1B03, %%CTRL1, %%T1 vpaddd %%L2B03, %%CTRL2, %%T1 vpaddd %%L3B03, %%CTRL3, %%T1 vpaddd %%L0B47, %%CTRL0, %%T2 vpaddd %%L1B47, %%CTRL1, %%T2 vpaddd %%L2B47, %%CTRL2, %%T2 vpaddd %%L3B47, %%CTRL3, %%T2 ;; save the counter to GPR's for calculation of number of loops vmovq %%GPR0, XWORD(%%L0B47) vmovq %%GPR1, XWORD(%%L1B47) vmovq %%GPR2, XWORD(%%L2B47) vmovq %%GPR3, XWORD(%%L3B47) and %%GPR0, 255 and %%GPR1, 255 and %%GPR2, 255 and %%GPR3, 255 ;; convert counter blocks to BE vpshufb %%L0B03, %%ZMM_SHUF_MASK vpshufb %%L0B47, %%ZMM_SHUF_MASK vpshufb %%L1B03, %%ZMM_SHUF_MASK vpshufb %%L1B47, %%ZMM_SHUF_MASK vpshufb %%L2B03, %%ZMM_SHUF_MASK vpshufb %%L2B47, %%ZMM_SHUF_MASK vpshufb %%L3B03, %%ZMM_SHUF_MASK vpshufb %%L3B47, %%ZMM_SHUF_MASK ;; update 4 lane CTR in BE vmovdqa64 %%CTRL0, %%L0B47 vmovdqa64 %%CTRL1, %%L1B47 vmovdqa64 %%CTRL2, %%L2B47 vmovdqa64 %%CTRL3, %%L3B47 GHASH_8_ENCRYPT_8_PARALLEL_x4 %%PLAIN_CYPH_IN, %%CYPH_PLAIN_OUT, \ %%KPTR0, %%KPTR1, %%KPTR2, %%KPTR3, \ %%TPTR0, %%TPTR1, %%TPTR2, %%TPTR3, \ %%DATA_OFFSET, \ %%CTRL0, %%CTRL1, %%CTRL2, %%CTRL3, \ %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%GHASH, \ %%T1, %%T2, %%T3, %%T4, %%T5, %%T6, %%T7, \ %%T8, %%T9, %%T10, \ %%PREVLO0, %%PREVHI0, %%PREVLO1, %%PREVHI1, \ %%PREVLO2, %%PREVHI2, %%PREVLO3, %%PREVHI3, \ %%ZMM_SHUF_MASK, %%ENC_DEC add %%DATA_OFFSET, 128 sub %%LEN_REG, 128 jnz %%_encrypt_by_8_parallel_x4 ;; shuffle the counters back to LE vpshufb %%CTRL0, %%ZMM_SHUF_MASK vpshufb %%CTRL1, %%ZMM_SHUF_MASK vpshufb %%CTRL2, %%ZMM_SHUF_MASK vpshufb %%CTRL3, %%ZMM_SHUF_MASK %%_encrypt_done_x4: GHASH_LAST_8x4 %%KPTR0, %%KPTR1, %%KPTR2, %%KPTR3, \ %%L0B03, %%L0B47, %%L1B03, %%L1B47, \ %%L2B03, %%L2B47, %%L3B03, %%L3B47, \ %%GHASH, \ %%T1, %%T2, %%T3, %%T4, %%T5, %%T6, \ %%T7, %%T8, %%T9, %%T10, %%T11, %%T12 %%_ghash_done_x4: mov %%TPTR0, [%%GDATA_CTX + (0*8)] mov %%TPTR1, [%%GDATA_CTX + (1*8)] mov %%TPTR2, [%%GDATA_CTX + (2*8)] mov %%TPTR3, [%%GDATA_CTX + (3*8)] ;; save current counter blocks vextracti32x4 [%%TPTR0 + CurCount], %%CTRL0, 3 vextracti32x4 [%%TPTR1 + CurCount], %%CTRL1, 3 vextracti32x4 [%%TPTR2 + CurCount], %%CTRL2, 3 vextracti32x4 [%%TPTR3 + CurCount], %%CTRL3, 3 ;; save current hash values vmovdqu64 [%%TPTR0 + AadHash], XWORD(%%GHASH) vextracti64x2 [%%TPTR1 + AadHash], %%GHASH, 1 vextracti64x2 [%%TPTR2 + AadHash], %%GHASH, 2 vextracti64x2 [%%TPTR3 + AadHash], %%GHASH, 3 ;; decrement lens ;; increment the input / output pointers ;; - output and input pointers are next to one another in the structure ;; so updating all 8 pointers with a single zmm vpbroadcastq %%T1, %%DATA_OFFSET ; DATA_OFFSET should be equal to length vpaddq %%T2, %%T1, [%%CYPH_PLAIN_OUT] vmovdqu64 [%%CYPH_PLAIN_OUT], %%T2 vmovdqu64 YWORD(%%T3), [%%STATE + _gcm_lens] vpsubq YWORD(%%T3), YWORD(%%T3), YWORD(%%T1) vmovdqu64 [%%STATE + _gcm_lens], YWORD(%%T3) %%_enc_dec_done_x4: %endmacro ; GCM_ENC_DEC_4x128 ;;; =========================================================================== ;;; =========================================================================== ;;; GCM_COMPLETE_x4 - completes one of MB jobs ;;; Clobbers rax, r9-r12, r14, r15 and zmm0-zmm31 ;;; =========================================================================== %macro GCM_COMPLETE_x4 3 %define %%STATE %1 ; [in] pointer to an array with 4 pointers to expanded key %define %%IDX %2 ; [in] lane index to be completed %define %%ENC_DEC %3 %ifidn __OUTPUT_FORMAT__, win64 %define %%GDATA_KEY rdi %define %%GDATA_CTX rsi %define %%CYPH_PLAIN_OUT r11 %define %%PLAIN_CYPH_IN r9 %else %define %%GDATA_KEY arg3 %define %%GDATA_CTX arg4 %define %%CYPH_PLAIN_OUT r8 %define %%PLAIN_CYPH_IN r9 %endif %define %%PLAIN_CYPH_LEN rbp %define %%AUTH_TAG rbp %define %%AUTH_TAGLEN rbp %define %%GPR rax %define %%DATA_OFFSET rbx mov %%PLAIN_CYPH_LEN, [%%STATE + _gcm_lens + %%IDX*8] mov %%GDATA_KEY, [%%STATE + _gcm_args_keys + %%IDX*8] mov %%GDATA_CTX, [%%STATE + _gcm_args_ctx + %%IDX*8] mov %%PLAIN_CYPH_IN, [%%STATE + _gcm_args_in + %%IDX*8] mov %%CYPH_PLAIN_OUT, [%%STATE + _gcm_args_out + %%IDX*8] vmovdqu64 xmm16, [%%GDATA_KEY + HashKey] vmovdqu64 xmm17, [%%GDATA_CTX + AadHash] ;;; =========================================================================== ;;; finalize last blocks (<128 bytes) ;;; Macro flow: ;;; calculate the number of 16byte blocks in the message ;;; process (number of 16byte blocks) mod 8 '%%_initial_num_blocks_is_# .. %%_initial_blocks_encrypted' ;;; process 8 16 byte blocks at a time until all are done '%%_encrypt_by_8_new .. %%_eight_cipher_left' ;;; if there is a block of less tahn 16 bytes process it '%%_zero_cipher_left .. %%_multiple_of_16_bytes' or %%PLAIN_CYPH_LEN, %%PLAIN_CYPH_LEN je %%_enc_dec_done_x4 xor %%DATA_OFFSET, %%DATA_OFFSET ;; Update length of data processed add [%%GDATA_CTX + InLen], %%PLAIN_CYPH_LEN vmovdqa64 xmm13, xmm16 ; load HashKey vmovdqu xmm9, [%%GDATA_CTX + CurCount] ;; Save the amount of data left to process in r10 mov r13, %%PLAIN_CYPH_LEN ;; Determine how many blocks to process in INITIAL ;; - round up number of blocks for INITIAL in case of partial block mov r12, %%PLAIN_CYPH_LEN add r12, 15 shr r12, 4 GCM_ENC_DEC_SMALL %%GDATA_KEY, %%GDATA_CTX, %%CYPH_PLAIN_OUT, \ %%PLAIN_CYPH_IN, %%PLAIN_CYPH_LEN, %%ENC_DEC, %%DATA_OFFSET, \ r13, r12, xmm9, xmm17, single_call, \ zmm18, zmm19, zmm20, zmm21, zmm22, zmm23, zmm24, zmm25, %%GPR, r15, k1 %%_ghash_done_x4: vmovdqu [%%GDATA_CTX + CurCount], xmm9 ; current_counter = xmm9 %%_enc_dec_done_x4: ;;; =========================================================================== ;;; COMPLETE ;; Start AES as early as possible vmovdqu64 xmm9, [%%GDATA_CTX + OrigIV] ; xmm9 = Y0 ENCRYPT_SINGLE_BLOCK %%GDATA_KEY, xmm9 ; E(K, Y0) ;; If the GCM function is called as a single function call rather ;; than invoking the individual parts (init, update, finalize) we ;; can remove a write to read dependency on AadHash. vmovdqa64 xmm14, xmm17 ; xmm14 = AadHash vmovdqa64 xmm13, xmm16 ; load HashKey %%_partial_done_x4: mov %%GPR, [%%GDATA_CTX + AadLen] ; aadLen (number of bytes) shl %%GPR, 3 ; convert into number of bits vmovd xmm15, DWORD(%%GPR) ; len(A) in xmm15 mov %%GPR, [%%GDATA_CTX + InLen] shl %%GPR, 3 ; len(C) in bits (*128) vmovq xmm1, %%GPR vpslldq xmm15, xmm15, 8 ; xmm15 = len(A)|| 0x0000000000000000 vpor xmm15, xmm15, xmm1 ; xmm15 = len(A)||len(C) ;; prep auth_tag store mask mov %%AUTH_TAGLEN, [%%STATE + _gcm_args_taglen + %%IDX*8] lea %%GPR, [rel byte_len_to_mask_table] kmovw k1, [%%GPR + %%AUTH_TAGLEN*2] mov %%AUTH_TAG, [%%STATE + _gcm_args_tag + %%IDX*8] ;; XOR current hash value with the next block xmm15 vpxorq xmm14, xmm15 ;; xmm14: hash value [in/out] ;; xmm13: hash key [in] ;; xmm0, xmm10, xmm11, xmm5, xmm6 - temporary registers GHASH_MUL xmm14, xmm13, xmm0, xmm10, xmm11, xmm5, xmm6 vpshufb xmm14, [rel SHUF_MASK] ; perform a 16Byte swap vpxorq xmm9, xmm9, xmm14 %%_return_T: vmovdqu8 [%%AUTH_TAG]{k1}, xmm9 ; store TAG vmovdqu64 [%%GDATA_CTX + AadHash], xmm17 ; store AadHash ;; put the lane back on free list mov rax, [%%STATE + _gcm_unused_lanes] shl rax, 4 or rax, %%IDX mov [%%STATE + _gcm_unused_lanes], rax ;; mark job as complete mov rax, [%%STATE + _gcm_job_in_lane + 8*%%IDX] or dword [rax + _status], STS_COMPLETED ;; clear job pointer in this lane mov qword [%%STATE + _gcm_job_in_lane + 8*%%IDX], 0 ;; return finished job (rax) %%_return_T_done: %endmacro ; GCM_COMPLETE_x4 ;;; =========================================================================== ;;; =========================================================================== ;;; GCM_FINALIZE_x4: ;;; - runs all lanes in parallel for %LEN ;;; - completes slected lane (any outstanding bytes < 128 bytes) ;;; - returns pointer of completed JOB ;;; Clobbers rax, r9-r12, r14, r15 and zmm0-zmm31 ;;; =========================================================================== %macro GCM_FINALIZE_x4 4 %define %%STATE %1 ; [in] pointer to an array with 4 pointers to expanded key %define %%IDX %2 ; [in] lane index to be completed %define %%LEN %3 ; [in] common length to be prcessed across all lanes %define %%ENC_DEC %4 %%_gcm_finalize_4x128: ;; save %IDX as it will get clobbered mov [rsp + STACK_LOCAL_OFFSET + 0*8], %%IDX and %%LEN, -128 mov arg2, %%LEN GCM_ENC_DEC_4x128 %%STATE, arg2, %%ENC_DEC %%_gcm_complete_min_lane: ;; restore %%IDX mov arg2, [rsp + STACK_LOCAL_OFFSET + 0*8] GCM_COMPLETE_x4 %%STATE, arg2, %%ENC_DEC %endmacro ; GCM_FINALIZE_x4 ;;; =========================================================================== ;;; =========================================================================== ;;; =========================================================================== ;;; GCM_FLUSH_MB: ;;; - finds min not null lane ;;; - replicates non_null data across null lanes ;;; - returns min length lane index and length ;;; =========================================================================== %macro GCM_FLUSH_MB 3 %define %%STATE %1 ; [in] pointer to an array with 4 pointers to expanded key %define %%IDX %2 ; [out] lane index to be completed %define %%LEN %3 ; [out] common length to be prcessed across all lanes ;; put max length into null lanes vmovdqu64 ymm0, [%%STATE + _gcm_job_in_lane] vpxorq ymm1, ymm1 vpcmpq k2, ymm0, ymm1, 0 ; EQ kmovq rax, k2 ; k2 = mask for null lanes xor rax, 0xf kmovq k1, rax ; k1 = mask for not null lanes (~k2) vmovdqu64 ymm2, [%%STATE + _gcm_lens] vbroadcastf64x2 ymm4, [rel ALL_F] vporq ymm2{k2}, ymm2, ymm4 ;; find min lane & index vpsllq ymm3, ymm2, 2 ; vporq ymm3, ymm3, [rel index_to_lane4] vextracti32x4 xmm2, ymm3, 1 vpminuq xmm2, xmm3, xmm2 vpsrldq xmm3, xmm2, 8 vpminuq xmm2, xmm3, xmm2 vmovq %%LEN, xmm2 mov %%IDX, %%LEN and %%IDX, 3 shr %%LEN, 2 ;; At this stage: ;; %%LEN - min length ;; %%IDX - lane index ;; load context structure content from the non-null lane ;; it is 88 bytes long (64 + 24) ;; zmm7:ymm11 mov rax, 0x7 kmovq k3, rax mov r10, [%%STATE + _gcm_args_ctx + 8*%%IDX] vmovdqu64 zmm7, [r10] vmovdqu64 ymm11{k3}, [r10 + 64] vmovdqu64 ymm7, [%%STATE + _gcm_args_in] vmovdqu64 ymm8, [%%STATE + _gcm_args_out] vmovdqu64 ymm9, [%%STATE + _gcm_args_keys] mov r10, [%%STATE + _gcm_args_in + 8*%%IDX] mov r11, [%%STATE + _gcm_args_out + 8*%%IDX] mov r12, [%%STATE + _gcm_args_keys + 8*%%IDX] ;; r10 = (min lane) valid in ptr ;; r11 = (min lane) valid out ptr ;; r12 = (min lane) valid keys ptr ;; store valid in/out/key pointers to empty lanes vpbroadcastq ymm4, r10 vpbroadcastq ymm5, r11 vpbroadcastq ymm6, r12 vmovdqa64 ymm4{k1}, ymm7 vmovdqa64 ymm5{k1}, ymm8 vmovdqa64 ymm6{k1}, ymm9 vmovdqu64 [%%STATE + _gcm_args_in], ymm4 vmovdqu64 [%%STATE + _gcm_args_out], ymm5 vmovdqu64 [%%STATE + _gcm_args_keys], ymm6 ;; copy valid context into empty lanes kmovq rax, k2 ; null lane mask to rax test rax, 1 jz %%_copy_ctx_lane1 mov r10, [%%STATE + _gcm_args_ctx + 8*0] vmovdqu64 [r10], zmm7 vmovdqu64 [r10 + 64]{k3}, ymm11 %%_copy_ctx_lane1: test rax, 2 jz %%_copy_ctx_lane2 mov r10, [%%STATE + _gcm_args_ctx + 8*1] vmovdqu64 [r10], zmm7 vmovdqu64 [r10 + 64]{k3}, ymm11 %%_copy_ctx_lane2: test rax, 4 jz %%_copy_ctx_lane3 mov r10, [%%STATE + _gcm_args_ctx + 8*2] vmovdqu64 [r10], zmm7 vmovdqu64 [r10 + 64]{k3}, ymm11 %%_copy_ctx_lane3: test rax, 8 jz %%_copy_ctx_end mov r10, [%%STATE + _gcm_args_ctx + 8*3] vmovdqu64 [r10], zmm7 vmovdqu64 [r10 + 64]{k3}, ymm11 %%_copy_ctx_end: %endmacro ; GCM_FLUSH_MB ;;; =========================================================================== ;;; =========================================================================== ;;; =========================================================================== ;;; GCM_SUBMIT_MB: ;;; - finds free lane and populates it with data from JOB ;;; - if all lanes populated then finds min common length ;;; - returns min length lane index and size ;;; =========================================================================== %macro GCM_SUBMIT_MB 4 %define %%STATE %1 ; [in] pointer to an array with 4 pointers to expanded key %define %%JOB %2 ; [in] lane index to be completed / [out] index %define %%LEN %3 ; [out] common length to be prcessed across all lanes %define %%ENC_DEC %4 ; [in] encrypt / decrypt selector %define %%IDX rbp %define %%RET_IDX %%JOB %ifidn __OUTPUT_FORMAT__, win64 %define %%LCTX rdi %else %define %%LCTX r8 %endif ;; get free lane mov rbx, [%%STATE + _gcm_unused_lanes] mov %%IDX, rbx shr rbx, 4 and %%IDX, 0xf mov [%%STATE + _gcm_unused_lanes], rbx ;; copy job data into the lane mov [%%STATE + _gcm_job_in_lane + 8*%%IDX], %%JOB mov r9, [%%JOB + _aes_enc_key_expanded] mov [%%STATE + _gcm_args_keys + 8*%%IDX], r9 mov rax, [%%JOB + _src] add rax, [%%JOB + _cipher_start_src_offset_in_bytes] mov [%%STATE + _gcm_args_in + 8*%%IDX], rax mov rax, [%%JOB + _dst] mov [%%STATE + _gcm_args_out + 8*%%IDX], rax mov rax, [%%JOB + _auth_tag_output] mov [%%STATE + _gcm_args_tag + 8*%%IDX], rax mov rax, [%%JOB + _auth_tag_output_len_in_bytes] mov [%%STATE + _gcm_args_taglen + 8*%%IDX], rax vpbroadcastq ymm15, [%%JOB + _msg_len_to_cipher_in_bytes] lea rax, [rel index_to_lane4_mask] kmovw k2, [rax + (index_to_lane4_not_mask - index_to_lane4_mask) + %%IDX*2] kmovw k1, [rax + %%IDX*2] vmovdqu64 ymm14{k2}{z}, [%%STATE + _gcm_lens] vporq ymm14{k1}, ymm14, ymm15 vmovdqu64 [%%STATE + _gcm_lens], ymm14 vmovdqu64 ymm31, ymm14 ;; call gcm_init mov r13, [%%JOB + _iv] mov r14, [%%JOB + _gcm_aad] mov rax, [%%JOB + _gcm_aad_len] mov %%LCTX, [%%STATE + _gcm_args_ctx + 8*%%IDX] ;; GDATA_KEY %1 ;; GDATA_CTX %2 ;; IV %3 ;; A_IN %4 ;; A_LEN %5 ;; r10-r12 - temporary GPR's GCM_INIT r9, %%LCTX, r13, r14, rax, r10, r11, r12 ;; check if all lanes populated cmp rbx, 0xf je %%_gcm_ooo_ready %%_gcm_ooo_not_ready: xor rax, rax ; return NULL jmp %%_gcm_submit_return %%_gcm_ooo_ready: ;; find min lane & index vpsllq ymm2, ymm31, 2 ; vporq ymm2, ymm2, [rel index_to_lane4] vextracti32x4 xmm3, ymm2, 1 vpminuq xmm2, xmm3, xmm2 vpsrldq xmm3, xmm2, 8 vpminuq xmm2, xmm3, xmm2 vmovq %%LEN, xmm2 mov %%RET_IDX, %%LEN and %%RET_IDX, 3 shr %%LEN, 2 ;; At this stage: ;; %%LEN - min length ;; %%RET_IDX - lane index ;; finalize puts returned job into RAX ;; arg1 - state ;; arg2 - min_lane_idx ;; arg3 - min_len %%_gcm_ooo_run: GCM_FINALIZE_x4 arg1, arg2, arg3, %%ENC_DEC ;; rax = finished job pointer %%_gcm_submit_return: %endmacro ; GCM_SUBMIT_MB ;;; =========================================================================== ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; GCM_COMPLETE Finishes Encyrption/Decryption of last partial block after GCM_UPDATE finishes. ; Input: A gcm_key_data * (GDATA_KEY), gcm_context_data (GDATA_CTX) and whether encoding or decoding (ENC_DEC). ; Output: Authorization Tag (AUTH_TAG) and Authorization Tag length (AUTH_TAG_LEN) ; Clobbers rax, r10-r12, and xmm0, xmm1, xmm5, xmm6, xmm9, xmm11, xmm14, xmm15 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; %macro GCM_COMPLETE 6 %define %%GDATA_KEY %1 %define %%GDATA_CTX %2 %define %%AUTH_TAG %3 %define %%AUTH_TAG_LEN %4 %define %%ENC_DEC %5 %define %%INSTANCE_TYPE %6 %define %%PLAIN_CYPH_LEN rax vmovdqu xmm13, [%%GDATA_KEY + HashKey] ;; Start AES as early as possible vmovdqu xmm9, [%%GDATA_CTX + OrigIV] ; xmm9 = Y0 ENCRYPT_SINGLE_BLOCK %%GDATA_KEY, xmm9 ; E(K, Y0) %ifidn %%INSTANCE_TYPE, multi_call ;; If the GCM function is called as a single function call rather ;; than invoking the individual parts (init, update, finalize) we ;; can remove a write to read dependency on AadHash. vmovdqu xmm14, [%%GDATA_CTX + AadHash] ;; Encrypt the final partial block. If we did this as a single call then ;; the partial block was handled in the main GCM_ENC_DEC macro. mov r12, [%%GDATA_CTX + PBlockLen] cmp r12, 0 je %%_partial_done GHASH_MUL xmm14, xmm13, xmm0, xmm10, xmm11, xmm5, xmm6 ;GHASH computation for the last <16 Byte block vmovdqu [%%GDATA_CTX + AadHash], xmm14 %%_partial_done: %endif mov r12, [%%GDATA_CTX + AadLen] ; r12 = aadLen (number of bytes) mov %%PLAIN_CYPH_LEN, [%%GDATA_CTX + InLen] shl r12, 3 ; convert into number of bits vmovd xmm15, r12d ; len(A) in xmm15 shl %%PLAIN_CYPH_LEN, 3 ; len(C) in bits (*128) vmovq xmm1, %%PLAIN_CYPH_LEN vpslldq xmm15, xmm15, 8 ; xmm15 = len(A)|| 0x0000000000000000 vpxor xmm15, xmm15, xmm1 ; xmm15 = len(A)||len(C) vpxor xmm14, xmm15 GHASH_MUL xmm14, xmm13, xmm0, xmm10, xmm11, xmm5, xmm6 vpshufb xmm14, [rel SHUF_MASK] ; perform a 16Byte swap vpxor xmm9, xmm9, xmm14 %%_return_T: mov r10, %%AUTH_TAG ; r10 = authTag mov r11, %%AUTH_TAG_LEN ; r11 = auth_tag_len cmp r11, 16 je %%_T_16 cmp r11, 12 je %%_T_12 cmp r11, 8 je %%_T_8 simd_store_avx r10, xmm9, r11, r12, rax jmp %%_return_T_done %%_T_8: vmovq rax, xmm9 mov [r10], rax jmp %%_return_T_done %%_T_12: vmovq rax, xmm9 mov [r10], rax vpsrldq xmm9, xmm9, 8 vmovd eax, xmm9 mov [r10 + 8], eax jmp %%_return_T_done %%_T_16: vmovdqu [r10], xmm9 %%_return_T_done: %endmacro ; GCM_COMPLETE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;void aes_gcm_precomp_128_vaes_avx512 / ; aes_gcm_precomp_192_vaes_avx512 / ; aes_gcm_precomp_256_vaes_avx512 ; (struct gcm_key_data *key_data) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MKGLOBAL(FN_NAME(precomp,_),function,) FN_NAME(precomp,_): FUNC_SAVE vpxor xmm6, xmm6 ENCRYPT_SINGLE_BLOCK arg1, xmm6 ; xmm6 = HashKey vpshufb xmm6, [rel SHUF_MASK] ;;;;;;;;;;;;;;; PRECOMPUTATION of HashKey<<1 mod poly from the HashKey;;;;;;;;;;;;;;; vmovdqa xmm2, xmm6 vpsllq xmm6, xmm6, 1 vpsrlq xmm2, xmm2, 63 vmovdqa xmm1, xmm2 vpslldq xmm2, xmm2, 8 vpsrldq xmm1, xmm1, 8 vpor xmm6, xmm6, xmm2 ;reduction vpshufd xmm2, xmm1, 00100100b vpcmpeqd xmm2, [rel TWOONE] vpand xmm2, xmm2, [rel POLY] vpxor xmm6, xmm6, xmm2 ; xmm6 holds the HashKey<<1 mod poly ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; vmovdqu [arg1 + HashKey], xmm6 ; store HashKey<<1 mod poly PRECOMPUTE arg1, xmm6, xmm0, xmm1, xmm2, xmm3, xmm4, xmm5 FUNC_RESTORE ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;void aes_gcm_init_128_vaes_avx512 / aes_gcm_init_192_vaes_avx512 / aes_gcm_init_256_vaes_avx512 ; (const struct gcm_key_data *key_data, ; struct gcm_context_data *context_data, ; u8 *iv, ; const u8 *aad, ; u64 aad_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MKGLOBAL(FN_NAME(init,_),function,) FN_NAME(init,_): FUNC_SAVE GCM_INIT arg1, arg2, arg3, arg4, arg5, r10, r11, r12 FUNC_RESTORE ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;void aes_gcm_enc_128_update_vaes_avx512 / aes_gcm_enc_192_update_vaes_avx512 / ; aes_gcm_enc_256_update_vaes_avx512 ; (const struct gcm_key_data *key_data, ; struct gcm_context_data *context_data, ; u8 *out, ; const u8 *in, ; u64 plaintext_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MKGLOBAL(FN_NAME(enc,_update_),function,) FN_NAME(enc,_update_): FUNC_SAVE GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, ENC, multi_call FUNC_RESTORE ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;void aes_gcm_dec_128_update_vaes_avx512 / aes_gcm_dec_192_update_vaes_avx512 / ; aes_gcm_dec_256_update_vaes_avx512 ; (const struct gcm_key_data *key_data, ; struct gcm_context_data *context_data, ; u8 *out, ; const u8 *in, ; u64 plaintext_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MKGLOBAL(FN_NAME(dec,_update_),function,) FN_NAME(dec,_update_): FUNC_SAVE GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, DEC, multi_call FUNC_RESTORE ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;void aes_gcm_enc_128_finalize_vaes_avx512 / aes_gcm_enc_192_finalize_vaes_avx512 / ; aes_gcm_enc_256_finalize_vaes_avx512 ; (const struct gcm_key_data *key_data, ; struct gcm_context_data *context_data, ; u8 *auth_tag, ; u64 auth_tag_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MKGLOBAL(FN_NAME(enc,_finalize_),function,) FN_NAME(enc,_finalize_): FUNC_SAVE GCM_COMPLETE arg1, arg2, arg3, arg4, ENC, multi_call FUNC_RESTORE ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;void aes_gcm_dec_128_finalize_vaes_avx512 / aes_gcm_dec_192_finalize_vaes_avx512 ; aes_gcm_dec_256_finalize_vaes_avx512 ; (const struct gcm_key_data *key_data, ; struct gcm_context_data *context_data, ; u8 *auth_tag, ; u64 auth_tag_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MKGLOBAL(FN_NAME(dec,_finalize_),function,) FN_NAME(dec,_finalize_): FUNC_SAVE GCM_COMPLETE arg1, arg2, arg3, arg4, DEC, multi_call FUNC_RESTORE ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;void aes_gcm_enc_128_vaes_avx512 / aes_gcm_enc_192_vaes_avx512 / aes_gcm_enc_256_vaes_avx512 ; (const struct gcm_key_data *key_data, ; struct gcm_context_data *context_data, ; u8 *out, ; const u8 *in, ; u64 plaintext_len, ; u8 *iv, ; const u8 *aad, ; u64 aad_len, ; u8 *auth_tag, ; u64 auth_tag_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MKGLOBAL(FN_NAME(enc,_),function,) FN_NAME(enc,_): FUNC_SAVE GCM_INIT arg1, arg2, arg6, arg7, arg8, r10, r11, r12 GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, ENC, single_call GCM_COMPLETE arg1, arg2, arg9, arg10, ENC, single_call FUNC_RESTORE ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;void aes_gcm_dec_128_vaes_avx512 / aes_gcm_dec_192_vaes_avx512 / aes_gcm_dec_256_vaes_avx512 ; (const struct gcm_key_data *key_data, ; struct gcm_context_data *context_data, ; u8 *out, ; const u8 *in, ; u64 plaintext_len, ; u8 *iv, ; const u8 *aad, ; u64 aad_len, ; u8 *auth_tag, ; u64 auth_tag_len); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MKGLOBAL(FN_NAME(dec,_),function,) FN_NAME(dec,_): FUNC_SAVE GCM_INIT arg1, arg2, arg6, arg7, arg8, r10, r11, r12 GCM_ENC_DEC arg1, arg2, arg3, arg4, arg5, DEC, single_call GCM_COMPLETE arg1, arg2, arg9, arg10, DEC, single_call FUNC_RESTORE ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;JOB_AES_HMAC *aes_gcm_enc_128_submit_vaes_vaes_avx512 / aes_gcm_enc_192_submit_vaes_vaes_avx512 / ; aes_gcm_enc_256_submit_vaes_vaes_avx512 ; (MB_MGR_GCM_OOO *state, JOB_AES_HMAC *job) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MKGLOBAL(FN_NAME(enc,_submit_),function,internal) FN_NAME(enc,_submit_): FUNC_SAVE ;; arg1 - [in] state ;; arg2 - [in] job / [out] index ;; arg3 - [out] length GCM_SUBMIT_MB arg1, arg2, arg3, ENC FUNC_RESTORE ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;JOB_AES_HMAC *aes_gcm_enc_128_flush_vaes_avx512 / aes_gcm_enc_192_flush_vaes_avx512 / ; aes_gcm_enc_256_flush_vaes_avx512 ; (MB_MGR_GCM_OOO *state) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MKGLOBAL(FN_NAME(enc,_flush_),function,internal) FN_NAME(enc,_flush_): FUNC_SAVE ;; arg1 - [in] state ;; arg2 - [out] index ;; arg3 - [out] length GCM_FLUSH_MB arg1, arg2, arg3 ;; finalize puts returned job into RAX ;; arg1 - state ;; arg2 - min_lane_idx ;; arg3 - min_len GCM_FINALIZE_x4 arg1, arg2, arg3, ENC FUNC_RESTORE ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;JOB_AES_HMAC *aes_gcm_dec_128_submit_vaes_avx512 / aes_gcm_dec_192_submit_vaes_avx512 / ; aes_gcm_dec_256_submit_vaes_avx512 ; (MB_MGR_GCM_OOO *state, JOB_AES_HMAC *job) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MKGLOBAL(FN_NAME(dec,_submit_),function,internal) FN_NAME(dec,_submit_): FUNC_SAVE ;; arg1 - [in] state ;; arg2 - [in] job / [out] index ;; arg3 - [out] length GCM_SUBMIT_MB arg1, arg2, arg3, DEC FUNC_RESTORE ret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;JOB_AES_HMAC *aes_gcm_dec_128_flush_vaes_avx512 / aes_gcm_dec_192_flush_vaes_avx512 / ; aes_gcm_dec_256_flush_vaes_avx512 ; (MB_MGR_GCM_OOO *state) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MKGLOBAL(FN_NAME(dec,_flush_),function,internal) FN_NAME(dec,_flush_): FUNC_SAVE ;; arg1 - [in] state ;; arg2 - [out] index ;; arg3 - [out] length GCM_FLUSH_MB arg1, arg2, arg3 ;; finalize puts returned job into RAX ;; arg1 - state ;; arg2 - min_lane_idx ;; arg3 - min_len GCM_FINALIZE_x4 arg1, arg2, arg3, DEC FUNC_RESTORE ret %ifdef LINUX section .note.GNU-stack noalloc noexec nowrite progbits %endif
42.481922
132
0.488187
3558f9ac50de8684f97964ea1fe16e216ba56437
3,237
asm
Assembly
rocket-beeb.asm
kieranhj/rocket-beeb
99a686b3a73d8f5294eea4fb37a5128b69a9acf7
[ "MIT" ]
null
null
null
rocket-beeb.asm
kieranhj/rocket-beeb
99a686b3a73d8f5294eea4fb37a5128b69a9acf7
[ "MIT" ]
null
null
null
rocket-beeb.asm
kieranhj/rocket-beeb
99a686b3a73d8f5294eea4fb37a5128b69a9acf7
[ "MIT" ]
null
null
null
;****************************************************************** ; 6502 BBC Micro Compressed VGM (VGC) Music Player ; By Simon Morris ; https://github.com/simondotm/vgm-player-bbc ; https://github.com/simondotm/vgm-packer ;****************************************************************** ; Allocate vars in ZP ORG &70 GUARD &8f .zp_start ;---------------------------------------------------------------------------------------------------------- ; Common code headers ;---------------------------------------------------------------------------------------------------------- ; Include common code headers here - these can declare ZP vars from the pool using SKIP... INCLUDE "lib/vgcplayer_config.h.asm" INCLUDE "lib/vgcplayer.h.asm" .zp_end rocket_vsync_count = &9C rocket_audio_flag = &9E rocket_fast_mode = &9F \ ****************************************************************** \ * Utility code - always memory resident \ ****************************************************************** ORG &2000 GUARD &5800 .start ;---------------------------- ;------------------------------------------- ; main ;------------------------------------------- .entry { JMP init ; &0 JMP play ; &3 JMP pause ; &6 JMP seek ; &9 JMP stop ; &C } .init { ; initialize the vgm player with a vgc data stream lda #hi(vgm_stream_buffers) ldx #lo(vgm_data) ldy #hi(vgm_data) sec ; set carry to enable looping jsr vgm_init lda #0:sta rocket_vsync_count:sta rocket_vsync_count+1 sei lda &220:sta old_eventv ; EVENTV lda &221:sta old_eventv+1 lda #LO(event_handler):sta &220 ; EVENTV lda #HI(event_handler):sta &221 cli rts } .event_handler { php cmp #4 bne not_vsync \\ Preserve registers pha:txa:pha:tya:pha \\ Poll the music player jsr vgm_update \\ Update vsync count. { inc rocket_vsync_count bne no_carry inc rocket_vsync_count+1 .no_carry } \\ Restore registers pla:tay:pla:tax:pla \\ Return .not_vsync plp rts } .play { \\ Enable VSYNC event. lda #14 ldx #4 jmp &fff4 } .pause { \\ Disable VSYNC event. lda #13 ldx #4 jsr &fff4 jmp sn_reset } .seek { \ Assume paused! lda #&ff:sta rocket_fast_mode ; turbo button on! jsr vgm_seek lda #0:sta rocket_fast_mode ; turbo button off! rts } .stop { jsr pause \\ Reset old Event handler sei lda old_eventv:sta &220 lda old_eventv+1:sta &221 cli rts } .old_eventv equw 0 ; code routines INCLUDE "lib/vgcplayer.asm" ; include your tune of choice here, some samples provided.... .vgm_data ;INCBIN "music/vgc/song_091.vgc" ;INCBIN "music/vgc/axelf.vgc" ;INCBIN "music/vgc/bbcapple.vgc" ;INCBIN "music/vgc/nd-ui.vgc" ;INCBIN "music/vgc/outruneu.vgc" ;INCBIN "music/vgc/ym_009.vgc" ;INCBIN "music/vgc/test_bbc.vgc" INCBIN "vgc/acid_demo.vgc" ALIGN 256 .vgm_buffer_start ; reserve space for the vgm decode buffers (8x256 = 2Kb) .vgm_stream_buffers skip 256 skip 256 skip 256 skip 256 skip 256 skip 256 skip 256 skip 256 .vgm_buffer_end .end PRINT ~vgm_data SAVE "Main", start, end, entry PUTBASIC "rocket.bas", "rocket"
17.592391
107
0.538153
b34aa5b9f046baa63d325636d60e9b749f2857f4
7,518
asm
Assembly
asm/win64_msvc.asm
GongHeng2017/XOpcodeCalc
a3d6ef1ad6db32af15fd5295ab646dbe099b574a
[ "MIT" ]
null
null
null
asm/win64_msvc.asm
GongHeng2017/XOpcodeCalc
a3d6ef1ad6db32af15fd5295ab646dbe099b574a
[ "MIT" ]
null
null
null
asm/win64_msvc.asm
GongHeng2017/XOpcodeCalc
a3d6ef1ad6db32af15fd5295ab646dbe099b574a
[ "MIT" ]
null
null
null
RECDATA64 STRUCT OPERAND DQ(2) dup(?) RESULT DQ(4) dup(?) FLAG DQ(2) dup(?) RECDATA64 ENDS __ENTER MACRO push rbp mov rbp,rsp push rax push rcx push rdx push rbx push rsi push rdi pushf mov rsi,RCX ; // Microsoft x64 calling convention mov rax,(RECDATA64 PTR [rsi]).OPERAND[0] mov rcx,(RECDATA64 PTR [rsi]).OPERAND[8] mov rdx,0 mov rbx,0 push (RECDATA64 PTR [rsi]).FLAG[0] popf ENDM __LEAVE MACRO mov (RECDATA64 PTR [rsi]).RESULT[0],rax mov (RECDATA64 PTR [rsi]).RESULT[8],rdx mov (RECDATA64 PTR [rsi]).RESULT[16],rcx mov (RECDATA64 PTR [rsi]).RESULT[24],rbx pushf pop (RECDATA64 PTR [rsi]).FLAG[8] popf pop rdi pop rsi pop rbx pop rdx pop rcx pop rax mov rsp,rbp pop rbp ret ENDM _TEXT SEGMENT ;################################ ; ADD ;################################ op_add PROC __ENTER add rax,rcx __LEAVE op_add ENDP ;################################ ; SUB ;################################ op_sub PROC __ENTER sub rax,rcx __LEAVE op_sub ENDP ;################################ ; ADC ;################################ op_adc PROC __ENTER adc rax,rcx __LEAVE op_adc ENDP ;################################ ; SBB ;################################ op_sbb PROC __ENTER sbb rax,rcx __LEAVE op_sbb ENDP ;################################ ; AND ;################################ op_and PROC __ENTER and rax,rcx __LEAVE op_and ENDP ;################################ ; XOR ;################################ op_xor PROC __ENTER xor rax,rcx __LEAVE op_xor ENDP ;################################ ; OR ;################################ op_or PROC __ENTER or rax,rcx __LEAVE op_or ENDP ;################################ ; INC ;################################ op_inc PROC __ENTER inc rax __LEAVE op_inc ENDP ;################################ ; DEC ;################################ op_dec PROC __ENTER dec rax __LEAVE op_dec ENDP ;################################ ; TEST ;################################ op_test PROC __ENTER test rax,rcx __LEAVE op_test ENDP ;################################ ; CMP ;################################ op_cmp PROC __ENTER cmp rax,rcx __LEAVE op_cmp ENDP ;################################ ; MUL ;################################ op_mul PROC __ENTER mul rcx __LEAVE op_mul ENDP ;################################ ; IMUL ;################################ op_imul PROC __ENTER imul rcx __LEAVE op_imul ENDP ;################################ ; DIV ;################################ op_div PROC __ENTER div rcx __LEAVE op_div ENDP ;################################ ; IDIV ;################################ op_idiv PROC __ENTER idiv rcx __LEAVE op_idiv ENDP ;################################ ; NOT ;################################ op_not PROC __ENTER not rax __LEAVE op_not ENDP ;################################ ; NEG ;################################ op_neg PROC __ENTER neg rax __LEAVE op_neg ENDP ;################################ ; SHR ;################################ op_shr PROC __ENTER shr rax,cl __LEAVE op_shr ENDP ;################################ ; SHL ;################################ op_shl PROC __ENTER shl rax,cl __LEAVE op_shl ENDP ;################################ ; SAR ;################################ op_sar PROC __ENTER sar rax,cl __LEAVE op_sar ENDP ;################################ ; ROL ;################################ op_rol PROC __ENTER rol rax,cl __LEAVE op_rol ENDP ;################################ ; ROR ;################################ op_ror PROC __ENTER ror rax,cl __LEAVE op_ror ENDP ;################################ ; RCL ;################################ op_rcl PROC __ENTER rcl rax,cl __LEAVE op_rcl ENDP ;################################ ; RCR ;################################ op_rcr PROC __ENTER rcr rax,cl __LEAVE op_rcr ENDP ;################################ ; CPUID ;################################ op_cpuid PROC __ENTER cpuid __LEAVE op_cpuid ENDP ;################################ ; BSWAP ;################################ op_bswap PROC __ENTER bswap rax __LEAVE op_bswap ENDP ;################################ ; BSF ;################################ op_bsf PROC __ENTER bsf rax,rcx __LEAVE op_bsf ENDP ;################################ ; BSR ;################################ op_bsr PROC __ENTER bsr rax,rcx __LEAVE op_bsr ENDP ;################################ ; BT ;################################ op_bt PROC __ENTER bt rax,rcx __LEAVE op_bt ENDP ;################################ ; BTS ;################################ op_bts PROC __ENTER bts rax,rcx __LEAVE op_bts ENDP ;################################ ; BTR ;################################ op_btr PROC __ENTER btr rax,rcx __LEAVE op_btr ENDP ;################################ ; BTC ;################################ op_btc PROC __ENTER btc rax,rcx __LEAVE op_btc ENDP ;################################ ;################################ _TEXT ENDS END
24.330097
70
0.262304
e93bbcbb3b5a01dbf0d725c233ba7e2af6f0c3be
52
asm
Assembly
src/mmap/sample2/asm.asm
freepvps/hseos
1356d580535aef29608b3aed2af59ceaa8cf9d31
[ "MIT" ]
null
null
null
src/mmap/sample2/asm.asm
freepvps/hseos
1356d580535aef29608b3aed2af59ceaa8cf9d31
[ "MIT" ]
null
null
null
src/mmap/sample2/asm.asm
freepvps/hseos
1356d580535aef29608b3aed2af59ceaa8cf9d31
[ "MIT" ]
null
null
null
f: imul %esi,%edi lea 0x1(%rdi),%eax retq
13
22
0.519231
8773fbf519c89f98ce71a80f2fe96cc720b55570
778
asm
Assembly
oeis/334/A334396.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/334/A334396.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/334/A334396.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A334396: Number of fault-free tilings of a 3 X n rectangle with squares and dominos. ; Submitted by Christian Krause ; 0,0,2,2,10,16,52,104,286,634,1622,3768,9336,22152,54106,129610,314546,756728,1831196,4413952,10667462,25735346,62160046,150020016,362257392,874442064,2111291570,5096782418,12305249242,29706645280,71719568260,173144117720,418010496238,1009160753578,2436339052550,5881827452904,14200012413288,34281822418776,82763705566474,199809155375386,482382142809218,1164573236325512,2811528946620524,6787630593737968,16386791001085334,39561211193091170,95509215657074014,230579638834615392,556668499268734944 lpb $0 sub $0,1 add $1,$3 sub $4,$5 add $4,1 add $4,$2 mov $5,$4 mov $4,$2 mov $2,$3 add $4,$1 add $5,$4 mov $3,$5 lpe mov $0,$2 mul $0,2
38.9
497
0.786632
2271d7d81513bbdf40f20b2c01068f62d4818874
448
asm
Assembly
arch/x86/asm/runtime.asm
mvdnes/element76
87e0206b022bda177dd1ca8fb6e2989429c2c8bf
[ "MIT" ]
30
2015-01-05T00:46:08.000Z
2021-12-01T12:33:46.000Z
arch/x86/asm/runtime.asm
mvdnes/element76
87e0206b022bda177dd1ca8fb6e2989429c2c8bf
[ "MIT" ]
5
2015-01-10T08:18:13.000Z
2015-02-09T07:27:41.000Z
arch/x86/asm/runtime.asm
mvdnes/element76
87e0206b022bda177dd1ca8fb6e2989429c2c8bf
[ "MIT" ]
7
2015-01-10T06:18:13.000Z
2021-03-19T17:07:35.000Z
global __morestack __morestack: cli hlt jmp __morestack ; Allocate a 16KiB stack section .bootstrap_stack align 4 stack_bottom: times 16384 db 0 stack_top: extern entry ; Entry point section .text global start start: cli ; Set up the stack mov esp, stack_top ; Make everything play nice with segmented stacks - see __morestack below mov [gs:0x30], dword 0 call entry jmp hang global abort abort: jmp hang hang: cli hlt jmp hang
12.108108
74
0.756696
308bce98f896cf6b9feaacc6c387263bc55c33f4
643
asm
Assembly
oeis/004/A004566.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/004/A004566.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/004/A004566.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A004566: Expansion of sqrt(6) in base 7. ; Submitted by Jamie Morken(s2) ; 2,3,1,0,1,1,4,0,0,6,3,0,0,5,2,3,4,1,1,2,1,6,2,5,6,6,1,6,3,2,0,5,4,5,0,1,5,1,6,6,6,6,4,2,6,1,1,3,2,6,6,0,5,4,6,3,1,3,6,6,2,4,0,4,4,1,0,1,0,2,3,2,2,3,4,5,5,6,1,2,5,5,0,1,6,4,6,2,4,2,0,0,4,5,0,6,2,3,6,0 mov $1,1 mov $2,1 mov $3,$0 add $3,2 mov $4,$0 add $4,2 mul $4,2 mov $7,10 pow $7,$4 lpb $3 mov $4,$2 pow $4,2 mul $4,6 mov $5,$1 pow $5,2 add $4,$5 mov $6,$1 mov $1,$4 mul $6,$2 mul $6,2 mov $2,$6 mov $8,$4 div $8,$7 max $8,1 div $1,$8 div $2,$8 sub $3,1 mov $9,7 lpe mov $3,$9 pow $3,$0 div $2,$3 div $1,$2 mod $1,$9 mov $0,$1
16.075
201
0.508554
a58d9a1d0930ef7bb4a2223a54c17eecce5af51c
38,273
asm
Assembly
user/test.asm
noakrams/OS-assignment1
fd87b500b2e47ee94db540c4ce241e55b6dc34b6
[ "MIT-0" ]
null
null
null
user/test.asm
noakrams/OS-assignment1
fd87b500b2e47ee94db540c4ce241e55b6dc34b6
[ "MIT-0" ]
null
null
null
user/test.asm
noakrams/OS-assignment1
fd87b500b2e47ee94db540c4ce241e55b6dc34b6
[ "MIT-0" ]
null
null
null
user/_test: file format elf64-littleriscv Disassembly of section .text: 0000000000000000 <strcpy>: #include "kernel/fcntl.h" #include "user/user.h" char* strcpy(char *s, const char *t) { 0: 1141 addi sp,sp,-16 2: e422 sd s0,8(sp) 4: 0800 addi s0,sp,16 char *os; os = s; while((*s++ = *t++) != 0) 6: 87aa mv a5,a0 8: 0585 addi a1,a1,1 a: 0785 addi a5,a5,1 c: fff5c703 lbu a4,-1(a1) 10: fee78fa3 sb a4,-1(a5) 14: fb75 bnez a4,8 <strcpy+0x8> ; return os; } 16: 6422 ld s0,8(sp) 18: 0141 addi sp,sp,16 1a: 8082 ret 000000000000001c <strcmp>: int strcmp(const char *p, const char *q) { 1c: 1141 addi sp,sp,-16 1e: e422 sd s0,8(sp) 20: 0800 addi s0,sp,16 while(*p && *p == *q) 22: 00054783 lbu a5,0(a0) 26: cb91 beqz a5,3a <strcmp+0x1e> 28: 0005c703 lbu a4,0(a1) 2c: 00f71763 bne a4,a5,3a <strcmp+0x1e> p++, q++; 30: 0505 addi a0,a0,1 32: 0585 addi a1,a1,1 while(*p && *p == *q) 34: 00054783 lbu a5,0(a0) 38: fbe5 bnez a5,28 <strcmp+0xc> return (uchar)*p - (uchar)*q; 3a: 0005c503 lbu a0,0(a1) } 3e: 40a7853b subw a0,a5,a0 42: 6422 ld s0,8(sp) 44: 0141 addi sp,sp,16 46: 8082 ret 0000000000000048 <strlen>: uint strlen(const char *s) { 48: 1141 addi sp,sp,-16 4a: e422 sd s0,8(sp) 4c: 0800 addi s0,sp,16 int n; for(n = 0; s[n]; n++) 4e: 00054783 lbu a5,0(a0) 52: cf91 beqz a5,6e <strlen+0x26> 54: 0505 addi a0,a0,1 56: 87aa mv a5,a0 58: 4685 li a3,1 5a: 9e89 subw a3,a3,a0 5c: 00f6853b addw a0,a3,a5 60: 0785 addi a5,a5,1 62: fff7c703 lbu a4,-1(a5) 66: fb7d bnez a4,5c <strlen+0x14> ; return n; } 68: 6422 ld s0,8(sp) 6a: 0141 addi sp,sp,16 6c: 8082 ret for(n = 0; s[n]; n++) 6e: 4501 li a0,0 70: bfe5 j 68 <strlen+0x20> 0000000000000072 <memset>: void* memset(void *dst, int c, uint n) { 72: 1141 addi sp,sp,-16 74: e422 sd s0,8(sp) 76: 0800 addi s0,sp,16 char *cdst = (char *) dst; int i; for(i = 0; i < n; i++){ 78: ca19 beqz a2,8e <memset+0x1c> 7a: 87aa mv a5,a0 7c: 1602 slli a2,a2,0x20 7e: 9201 srli a2,a2,0x20 80: 00a60733 add a4,a2,a0 cdst[i] = c; 84: 00b78023 sb a1,0(a5) for(i = 0; i < n; i++){ 88: 0785 addi a5,a5,1 8a: fee79de3 bne a5,a4,84 <memset+0x12> } return dst; } 8e: 6422 ld s0,8(sp) 90: 0141 addi sp,sp,16 92: 8082 ret 0000000000000094 <strchr>: char* strchr(const char *s, char c) { 94: 1141 addi sp,sp,-16 96: e422 sd s0,8(sp) 98: 0800 addi s0,sp,16 for(; *s; s++) 9a: 00054783 lbu a5,0(a0) 9e: cb99 beqz a5,b4 <strchr+0x20> if(*s == c) a0: 00f58763 beq a1,a5,ae <strchr+0x1a> for(; *s; s++) a4: 0505 addi a0,a0,1 a6: 00054783 lbu a5,0(a0) aa: fbfd bnez a5,a0 <strchr+0xc> return (char*)s; return 0; ac: 4501 li a0,0 } ae: 6422 ld s0,8(sp) b0: 0141 addi sp,sp,16 b2: 8082 ret return 0; b4: 4501 li a0,0 b6: bfe5 j ae <strchr+0x1a> 00000000000000b8 <gets>: char* gets(char *buf, int max) { b8: 711d addi sp,sp,-96 ba: ec86 sd ra,88(sp) bc: e8a2 sd s0,80(sp) be: e4a6 sd s1,72(sp) c0: e0ca sd s2,64(sp) c2: fc4e sd s3,56(sp) c4: f852 sd s4,48(sp) c6: f456 sd s5,40(sp) c8: f05a sd s6,32(sp) ca: ec5e sd s7,24(sp) cc: 1080 addi s0,sp,96 ce: 8baa mv s7,a0 d0: 8a2e mv s4,a1 int i, cc; char c; for(i=0; i+1 < max; ){ d2: 892a mv s2,a0 d4: 4481 li s1,0 cc = read(0, &c, 1); if(cc < 1) break; buf[i++] = c; if(c == '\n' || c == '\r') d6: 4aa9 li s5,10 d8: 4b35 li s6,13 for(i=0; i+1 < max; ){ da: 89a6 mv s3,s1 dc: 2485 addiw s1,s1,1 de: 0344d863 bge s1,s4,10e <gets+0x56> cc = read(0, &c, 1); e2: 4605 li a2,1 e4: faf40593 addi a1,s0,-81 e8: 4501 li a0,0 ea: 00000097 auipc ra,0x0 ee: 19c080e7 jalr 412(ra) # 286 <read> if(cc < 1) f2: 00a05e63 blez a0,10e <gets+0x56> buf[i++] = c; f6: faf44783 lbu a5,-81(s0) fa: 00f90023 sb a5,0(s2) if(c == '\n' || c == '\r') fe: 01578763 beq a5,s5,10c <gets+0x54> 102: 0905 addi s2,s2,1 104: fd679be3 bne a5,s6,da <gets+0x22> for(i=0; i+1 < max; ){ 108: 89a6 mv s3,s1 10a: a011 j 10e <gets+0x56> 10c: 89a6 mv s3,s1 break; } buf[i] = '\0'; 10e: 99de add s3,s3,s7 110: 00098023 sb zero,0(s3) return buf; } 114: 855e mv a0,s7 116: 60e6 ld ra,88(sp) 118: 6446 ld s0,80(sp) 11a: 64a6 ld s1,72(sp) 11c: 6906 ld s2,64(sp) 11e: 79e2 ld s3,56(sp) 120: 7a42 ld s4,48(sp) 122: 7aa2 ld s5,40(sp) 124: 7b02 ld s6,32(sp) 126: 6be2 ld s7,24(sp) 128: 6125 addi sp,sp,96 12a: 8082 ret 000000000000012c <stat>: int stat(const char *n, struct stat *st) { 12c: 1101 addi sp,sp,-32 12e: ec06 sd ra,24(sp) 130: e822 sd s0,16(sp) 132: e426 sd s1,8(sp) 134: e04a sd s2,0(sp) 136: 1000 addi s0,sp,32 138: 892e mv s2,a1 int fd; int r; fd = open(n, O_RDONLY); 13a: 4581 li a1,0 13c: 00000097 auipc ra,0x0 140: 172080e7 jalr 370(ra) # 2ae <open> if(fd < 0) 144: 02054563 bltz a0,16e <stat+0x42> 148: 84aa mv s1,a0 return -1; r = fstat(fd, st); 14a: 85ca mv a1,s2 14c: 00000097 auipc ra,0x0 150: 17a080e7 jalr 378(ra) # 2c6 <fstat> 154: 892a mv s2,a0 close(fd); 156: 8526 mv a0,s1 158: 00000097 auipc ra,0x0 15c: 13e080e7 jalr 318(ra) # 296 <close> return r; } 160: 854a mv a0,s2 162: 60e2 ld ra,24(sp) 164: 6442 ld s0,16(sp) 166: 64a2 ld s1,8(sp) 168: 6902 ld s2,0(sp) 16a: 6105 addi sp,sp,32 16c: 8082 ret return -1; 16e: 597d li s2,-1 170: bfc5 j 160 <stat+0x34> 0000000000000172 <atoi>: int atoi(const char *s) { 172: 1141 addi sp,sp,-16 174: e422 sd s0,8(sp) 176: 0800 addi s0,sp,16 int n; n = 0; while('0' <= *s && *s <= '9') 178: 00054603 lbu a2,0(a0) 17c: fd06079b addiw a5,a2,-48 180: 0ff7f793 andi a5,a5,255 184: 4725 li a4,9 186: 02f76963 bltu a4,a5,1b8 <atoi+0x46> 18a: 86aa mv a3,a0 n = 0; 18c: 4501 li a0,0 while('0' <= *s && *s <= '9') 18e: 45a5 li a1,9 n = n*10 + *s++ - '0'; 190: 0685 addi a3,a3,1 192: 0025179b slliw a5,a0,0x2 196: 9fa9 addw a5,a5,a0 198: 0017979b slliw a5,a5,0x1 19c: 9fb1 addw a5,a5,a2 19e: fd07851b addiw a0,a5,-48 while('0' <= *s && *s <= '9') 1a2: 0006c603 lbu a2,0(a3) 1a6: fd06071b addiw a4,a2,-48 1aa: 0ff77713 andi a4,a4,255 1ae: fee5f1e3 bgeu a1,a4,190 <atoi+0x1e> return n; } 1b2: 6422 ld s0,8(sp) 1b4: 0141 addi sp,sp,16 1b6: 8082 ret n = 0; 1b8: 4501 li a0,0 1ba: bfe5 j 1b2 <atoi+0x40> 00000000000001bc <memmove>: void* memmove(void *vdst, const void *vsrc, int n) { 1bc: 1141 addi sp,sp,-16 1be: e422 sd s0,8(sp) 1c0: 0800 addi s0,sp,16 char *dst; const char *src; dst = vdst; src = vsrc; if (src > dst) { 1c2: 02b57463 bgeu a0,a1,1ea <memmove+0x2e> while(n-- > 0) 1c6: 00c05f63 blez a2,1e4 <memmove+0x28> 1ca: 1602 slli a2,a2,0x20 1cc: 9201 srli a2,a2,0x20 1ce: 00c507b3 add a5,a0,a2 dst = vdst; 1d2: 872a mv a4,a0 *dst++ = *src++; 1d4: 0585 addi a1,a1,1 1d6: 0705 addi a4,a4,1 1d8: fff5c683 lbu a3,-1(a1) 1dc: fed70fa3 sb a3,-1(a4) while(n-- > 0) 1e0: fee79ae3 bne a5,a4,1d4 <memmove+0x18> src += n; while(n-- > 0) *--dst = *--src; } return vdst; } 1e4: 6422 ld s0,8(sp) 1e6: 0141 addi sp,sp,16 1e8: 8082 ret dst += n; 1ea: 00c50733 add a4,a0,a2 src += n; 1ee: 95b2 add a1,a1,a2 while(n-- > 0) 1f0: fec05ae3 blez a2,1e4 <memmove+0x28> 1f4: fff6079b addiw a5,a2,-1 1f8: 1782 slli a5,a5,0x20 1fa: 9381 srli a5,a5,0x20 1fc: fff7c793 not a5,a5 200: 97ba add a5,a5,a4 *--dst = *--src; 202: 15fd addi a1,a1,-1 204: 177d addi a4,a4,-1 206: 0005c683 lbu a3,0(a1) 20a: 00d70023 sb a3,0(a4) while(n-- > 0) 20e: fee79ae3 bne a5,a4,202 <memmove+0x46> 212: bfc9 j 1e4 <memmove+0x28> 0000000000000214 <memcmp>: int memcmp(const void *s1, const void *s2, uint n) { 214: 1141 addi sp,sp,-16 216: e422 sd s0,8(sp) 218: 0800 addi s0,sp,16 const char *p1 = s1, *p2 = s2; while (n-- > 0) { 21a: ca05 beqz a2,24a <memcmp+0x36> 21c: fff6069b addiw a3,a2,-1 220: 1682 slli a3,a3,0x20 222: 9281 srli a3,a3,0x20 224: 0685 addi a3,a3,1 226: 96aa add a3,a3,a0 if (*p1 != *p2) { 228: 00054783 lbu a5,0(a0) 22c: 0005c703 lbu a4,0(a1) 230: 00e79863 bne a5,a4,240 <memcmp+0x2c> return *p1 - *p2; } p1++; 234: 0505 addi a0,a0,1 p2++; 236: 0585 addi a1,a1,1 while (n-- > 0) { 238: fed518e3 bne a0,a3,228 <memcmp+0x14> } return 0; 23c: 4501 li a0,0 23e: a019 j 244 <memcmp+0x30> return *p1 - *p2; 240: 40e7853b subw a0,a5,a4 } 244: 6422 ld s0,8(sp) 246: 0141 addi sp,sp,16 248: 8082 ret return 0; 24a: 4501 li a0,0 24c: bfe5 j 244 <memcmp+0x30> 000000000000024e <memcpy>: void * memcpy(void *dst, const void *src, uint n) { 24e: 1141 addi sp,sp,-16 250: e406 sd ra,8(sp) 252: e022 sd s0,0(sp) 254: 0800 addi s0,sp,16 return memmove(dst, src, n); 256: 00000097 auipc ra,0x0 25a: f66080e7 jalr -154(ra) # 1bc <memmove> } 25e: 60a2 ld ra,8(sp) 260: 6402 ld s0,0(sp) 262: 0141 addi sp,sp,16 264: 8082 ret 0000000000000266 <fork>: # generated by usys.pl - do not edit #include "kernel/syscall.h" .global fork fork: li a7, SYS_fork 266: 4885 li a7,1 ecall 268: 00000073 ecall ret 26c: 8082 ret 000000000000026e <exit>: .global exit exit: li a7, SYS_exit 26e: 4889 li a7,2 ecall 270: 00000073 ecall ret 274: 8082 ret 0000000000000276 <wait>: .global wait wait: li a7, SYS_wait 276: 488d li a7,3 ecall 278: 00000073 ecall ret 27c: 8082 ret 000000000000027e <pipe>: .global pipe pipe: li a7, SYS_pipe 27e: 4891 li a7,4 ecall 280: 00000073 ecall ret 284: 8082 ret 0000000000000286 <read>: .global read read: li a7, SYS_read 286: 4895 li a7,5 ecall 288: 00000073 ecall ret 28c: 8082 ret 000000000000028e <write>: .global write write: li a7, SYS_write 28e: 48c1 li a7,16 ecall 290: 00000073 ecall ret 294: 8082 ret 0000000000000296 <close>: .global close close: li a7, SYS_close 296: 48d5 li a7,21 ecall 298: 00000073 ecall ret 29c: 8082 ret 000000000000029e <kill>: .global kill kill: li a7, SYS_kill 29e: 4899 li a7,6 ecall 2a0: 00000073 ecall ret 2a4: 8082 ret 00000000000002a6 <exec>: .global exec exec: li a7, SYS_exec 2a6: 489d li a7,7 ecall 2a8: 00000073 ecall ret 2ac: 8082 ret 00000000000002ae <open>: .global open open: li a7, SYS_open 2ae: 48bd li a7,15 ecall 2b0: 00000073 ecall ret 2b4: 8082 ret 00000000000002b6 <mknod>: .global mknod mknod: li a7, SYS_mknod 2b6: 48c5 li a7,17 ecall 2b8: 00000073 ecall ret 2bc: 8082 ret 00000000000002be <unlink>: .global unlink unlink: li a7, SYS_unlink 2be: 48c9 li a7,18 ecall 2c0: 00000073 ecall ret 2c4: 8082 ret 00000000000002c6 <fstat>: .global fstat fstat: li a7, SYS_fstat 2c6: 48a1 li a7,8 ecall 2c8: 00000073 ecall ret 2cc: 8082 ret 00000000000002ce <link>: .global link link: li a7, SYS_link 2ce: 48cd li a7,19 ecall 2d0: 00000073 ecall ret 2d4: 8082 ret 00000000000002d6 <mkdir>: .global mkdir mkdir: li a7, SYS_mkdir 2d6: 48d1 li a7,20 ecall 2d8: 00000073 ecall ret 2dc: 8082 ret 00000000000002de <chdir>: .global chdir chdir: li a7, SYS_chdir 2de: 48a5 li a7,9 ecall 2e0: 00000073 ecall ret 2e4: 8082 ret 00000000000002e6 <dup>: .global dup dup: li a7, SYS_dup 2e6: 48a9 li a7,10 ecall 2e8: 00000073 ecall ret 2ec: 8082 ret 00000000000002ee <getpid>: .global getpid getpid: li a7, SYS_getpid 2ee: 48ad li a7,11 ecall 2f0: 00000073 ecall ret 2f4: 8082 ret 00000000000002f6 <sbrk>: .global sbrk sbrk: li a7, SYS_sbrk 2f6: 48b1 li a7,12 ecall 2f8: 00000073 ecall ret 2fc: 8082 ret 00000000000002fe <sleep>: .global sleep sleep: li a7, SYS_sleep 2fe: 48b5 li a7,13 ecall 300: 00000073 ecall ret 304: 8082 ret 0000000000000306 <uptime>: .global uptime uptime: li a7, SYS_uptime 306: 48b9 li a7,14 ecall 308: 00000073 ecall ret 30c: 8082 ret 000000000000030e <trace>: .global trace trace: li a7, SYS_trace 30e: 48d9 li a7,22 ecall 310: 00000073 ecall ret 314: 8082 ret 0000000000000316 <wait_stat>: .global wait_stat wait_stat: li a7, SYS_wait_stat 316: 48dd li a7,23 ecall 318: 00000073 ecall ret 31c: 8082 ret 000000000000031e <set_priority>: .global set_priority set_priority: li a7, SYS_set_priority 31e: 48e1 li a7,24 ecall 320: 00000073 ecall ret 324: 8082 ret 0000000000000326 <putc>: static char digits[] = "0123456789ABCDEF"; static void putc(int fd, char c) { 326: 1101 addi sp,sp,-32 328: ec06 sd ra,24(sp) 32a: e822 sd s0,16(sp) 32c: 1000 addi s0,sp,32 32e: feb407a3 sb a1,-17(s0) write(fd, &c, 1); 332: 4605 li a2,1 334: fef40593 addi a1,s0,-17 338: 00000097 auipc ra,0x0 33c: f56080e7 jalr -170(ra) # 28e <write> } 340: 60e2 ld ra,24(sp) 342: 6442 ld s0,16(sp) 344: 6105 addi sp,sp,32 346: 8082 ret 0000000000000348 <printint>: static void printint(int fd, int xx, int base, int sgn) { 348: 7139 addi sp,sp,-64 34a: fc06 sd ra,56(sp) 34c: f822 sd s0,48(sp) 34e: f426 sd s1,40(sp) 350: f04a sd s2,32(sp) 352: ec4e sd s3,24(sp) 354: 0080 addi s0,sp,64 356: 84aa mv s1,a0 char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 358: c299 beqz a3,35e <printint+0x16> 35a: 0805c863 bltz a1,3ea <printint+0xa2> neg = 1; x = -xx; } else { x = xx; 35e: 2581 sext.w a1,a1 neg = 0; 360: 4881 li a7,0 362: fc040693 addi a3,s0,-64 } i = 0; 366: 4701 li a4,0 do{ buf[i++] = digits[x % base]; 368: 2601 sext.w a2,a2 36a: 00000517 auipc a0,0x0 36e: 44650513 addi a0,a0,1094 # 7b0 <digits> 372: 883a mv a6,a4 374: 2705 addiw a4,a4,1 376: 02c5f7bb remuw a5,a1,a2 37a: 1782 slli a5,a5,0x20 37c: 9381 srli a5,a5,0x20 37e: 97aa add a5,a5,a0 380: 0007c783 lbu a5,0(a5) 384: 00f68023 sb a5,0(a3) }while((x /= base) != 0); 388: 0005879b sext.w a5,a1 38c: 02c5d5bb divuw a1,a1,a2 390: 0685 addi a3,a3,1 392: fec7f0e3 bgeu a5,a2,372 <printint+0x2a> if(neg) 396: 00088b63 beqz a7,3ac <printint+0x64> buf[i++] = '-'; 39a: fd040793 addi a5,s0,-48 39e: 973e add a4,a4,a5 3a0: 02d00793 li a5,45 3a4: fef70823 sb a5,-16(a4) 3a8: 0028071b addiw a4,a6,2 while(--i >= 0) 3ac: 02e05863 blez a4,3dc <printint+0x94> 3b0: fc040793 addi a5,s0,-64 3b4: 00e78933 add s2,a5,a4 3b8: fff78993 addi s3,a5,-1 3bc: 99ba add s3,s3,a4 3be: 377d addiw a4,a4,-1 3c0: 1702 slli a4,a4,0x20 3c2: 9301 srli a4,a4,0x20 3c4: 40e989b3 sub s3,s3,a4 putc(fd, buf[i]); 3c8: fff94583 lbu a1,-1(s2) 3cc: 8526 mv a0,s1 3ce: 00000097 auipc ra,0x0 3d2: f58080e7 jalr -168(ra) # 326 <putc> while(--i >= 0) 3d6: 197d addi s2,s2,-1 3d8: ff3918e3 bne s2,s3,3c8 <printint+0x80> } 3dc: 70e2 ld ra,56(sp) 3de: 7442 ld s0,48(sp) 3e0: 74a2 ld s1,40(sp) 3e2: 7902 ld s2,32(sp) 3e4: 69e2 ld s3,24(sp) 3e6: 6121 addi sp,sp,64 3e8: 8082 ret x = -xx; 3ea: 40b005bb negw a1,a1 neg = 1; 3ee: 4885 li a7,1 x = -xx; 3f0: bf8d j 362 <printint+0x1a> 00000000000003f2 <vprintf>: } // Print to the given fd. Only understands %d, %x, %p, %s. void vprintf(int fd, const char *fmt, va_list ap) { 3f2: 7119 addi sp,sp,-128 3f4: fc86 sd ra,120(sp) 3f6: f8a2 sd s0,112(sp) 3f8: f4a6 sd s1,104(sp) 3fa: f0ca sd s2,96(sp) 3fc: ecce sd s3,88(sp) 3fe: e8d2 sd s4,80(sp) 400: e4d6 sd s5,72(sp) 402: e0da sd s6,64(sp) 404: fc5e sd s7,56(sp) 406: f862 sd s8,48(sp) 408: f466 sd s9,40(sp) 40a: f06a sd s10,32(sp) 40c: ec6e sd s11,24(sp) 40e: 0100 addi s0,sp,128 char *s; int c, i, state; state = 0; for(i = 0; fmt[i]; i++){ 410: 0005c903 lbu s2,0(a1) 414: 18090f63 beqz s2,5b2 <vprintf+0x1c0> 418: 8aaa mv s5,a0 41a: 8b32 mv s6,a2 41c: 00158493 addi s1,a1,1 state = 0; 420: 4981 li s3,0 if(c == '%'){ state = '%'; } else { putc(fd, c); } } else if(state == '%'){ 422: 02500a13 li s4,37 if(c == 'd'){ 426: 06400c13 li s8,100 printint(fd, va_arg(ap, int), 10, 1); } else if(c == 'l') { 42a: 06c00c93 li s9,108 printint(fd, va_arg(ap, uint64), 10, 0); } else if(c == 'x') { 42e: 07800d13 li s10,120 printint(fd, va_arg(ap, int), 16, 0); } else if(c == 'p') { 432: 07000d93 li s11,112 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 436: 00000b97 auipc s7,0x0 43a: 37ab8b93 addi s7,s7,890 # 7b0 <digits> 43e: a839 j 45c <vprintf+0x6a> putc(fd, c); 440: 85ca mv a1,s2 442: 8556 mv a0,s5 444: 00000097 auipc ra,0x0 448: ee2080e7 jalr -286(ra) # 326 <putc> 44c: a019 j 452 <vprintf+0x60> } else if(state == '%'){ 44e: 01498f63 beq s3,s4,46c <vprintf+0x7a> for(i = 0; fmt[i]; i++){ 452: 0485 addi s1,s1,1 454: fff4c903 lbu s2,-1(s1) 458: 14090d63 beqz s2,5b2 <vprintf+0x1c0> c = fmt[i] & 0xff; 45c: 0009079b sext.w a5,s2 if(state == 0){ 460: fe0997e3 bnez s3,44e <vprintf+0x5c> if(c == '%'){ 464: fd479ee3 bne a5,s4,440 <vprintf+0x4e> state = '%'; 468: 89be mv s3,a5 46a: b7e5 j 452 <vprintf+0x60> if(c == 'd'){ 46c: 05878063 beq a5,s8,4ac <vprintf+0xba> } else if(c == 'l') { 470: 05978c63 beq a5,s9,4c8 <vprintf+0xd6> } else if(c == 'x') { 474: 07a78863 beq a5,s10,4e4 <vprintf+0xf2> } else if(c == 'p') { 478: 09b78463 beq a5,s11,500 <vprintf+0x10e> printptr(fd, va_arg(ap, uint64)); } else if(c == 's'){ 47c: 07300713 li a4,115 480: 0ce78663 beq a5,a4,54c <vprintf+0x15a> s = "(null)"; while(*s != 0){ putc(fd, *s); s++; } } else if(c == 'c'){ 484: 06300713 li a4,99 488: 0ee78e63 beq a5,a4,584 <vprintf+0x192> putc(fd, va_arg(ap, uint)); } else if(c == '%'){ 48c: 11478863 beq a5,s4,59c <vprintf+0x1aa> putc(fd, c); } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 490: 85d2 mv a1,s4 492: 8556 mv a0,s5 494: 00000097 auipc ra,0x0 498: e92080e7 jalr -366(ra) # 326 <putc> putc(fd, c); 49c: 85ca mv a1,s2 49e: 8556 mv a0,s5 4a0: 00000097 auipc ra,0x0 4a4: e86080e7 jalr -378(ra) # 326 <putc> } state = 0; 4a8: 4981 li s3,0 4aa: b765 j 452 <vprintf+0x60> printint(fd, va_arg(ap, int), 10, 1); 4ac: 008b0913 addi s2,s6,8 4b0: 4685 li a3,1 4b2: 4629 li a2,10 4b4: 000b2583 lw a1,0(s6) 4b8: 8556 mv a0,s5 4ba: 00000097 auipc ra,0x0 4be: e8e080e7 jalr -370(ra) # 348 <printint> 4c2: 8b4a mv s6,s2 state = 0; 4c4: 4981 li s3,0 4c6: b771 j 452 <vprintf+0x60> printint(fd, va_arg(ap, uint64), 10, 0); 4c8: 008b0913 addi s2,s6,8 4cc: 4681 li a3,0 4ce: 4629 li a2,10 4d0: 000b2583 lw a1,0(s6) 4d4: 8556 mv a0,s5 4d6: 00000097 auipc ra,0x0 4da: e72080e7 jalr -398(ra) # 348 <printint> 4de: 8b4a mv s6,s2 state = 0; 4e0: 4981 li s3,0 4e2: bf85 j 452 <vprintf+0x60> printint(fd, va_arg(ap, int), 16, 0); 4e4: 008b0913 addi s2,s6,8 4e8: 4681 li a3,0 4ea: 4641 li a2,16 4ec: 000b2583 lw a1,0(s6) 4f0: 8556 mv a0,s5 4f2: 00000097 auipc ra,0x0 4f6: e56080e7 jalr -426(ra) # 348 <printint> 4fa: 8b4a mv s6,s2 state = 0; 4fc: 4981 li s3,0 4fe: bf91 j 452 <vprintf+0x60> printptr(fd, va_arg(ap, uint64)); 500: 008b0793 addi a5,s6,8 504: f8f43423 sd a5,-120(s0) 508: 000b3983 ld s3,0(s6) putc(fd, '0'); 50c: 03000593 li a1,48 510: 8556 mv a0,s5 512: 00000097 auipc ra,0x0 516: e14080e7 jalr -492(ra) # 326 <putc> putc(fd, 'x'); 51a: 85ea mv a1,s10 51c: 8556 mv a0,s5 51e: 00000097 auipc ra,0x0 522: e08080e7 jalr -504(ra) # 326 <putc> 526: 4941 li s2,16 putc(fd, digits[x >> (sizeof(uint64) * 8 - 4)]); 528: 03c9d793 srli a5,s3,0x3c 52c: 97de add a5,a5,s7 52e: 0007c583 lbu a1,0(a5) 532: 8556 mv a0,s5 534: 00000097 auipc ra,0x0 538: df2080e7 jalr -526(ra) # 326 <putc> for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) 53c: 0992 slli s3,s3,0x4 53e: 397d addiw s2,s2,-1 540: fe0914e3 bnez s2,528 <vprintf+0x136> printptr(fd, va_arg(ap, uint64)); 544: f8843b03 ld s6,-120(s0) state = 0; 548: 4981 li s3,0 54a: b721 j 452 <vprintf+0x60> s = va_arg(ap, char*); 54c: 008b0993 addi s3,s6,8 550: 000b3903 ld s2,0(s6) if(s == 0) 554: 02090163 beqz s2,576 <vprintf+0x184> while(*s != 0){ 558: 00094583 lbu a1,0(s2) 55c: c9a1 beqz a1,5ac <vprintf+0x1ba> putc(fd, *s); 55e: 8556 mv a0,s5 560: 00000097 auipc ra,0x0 564: dc6080e7 jalr -570(ra) # 326 <putc> s++; 568: 0905 addi s2,s2,1 while(*s != 0){ 56a: 00094583 lbu a1,0(s2) 56e: f9e5 bnez a1,55e <vprintf+0x16c> s = va_arg(ap, char*); 570: 8b4e mv s6,s3 state = 0; 572: 4981 li s3,0 574: bdf9 j 452 <vprintf+0x60> s = "(null)"; 576: 00000917 auipc s2,0x0 57a: 23290913 addi s2,s2,562 # 7a8 <malloc+0xec> while(*s != 0){ 57e: 02800593 li a1,40 582: bff1 j 55e <vprintf+0x16c> putc(fd, va_arg(ap, uint)); 584: 008b0913 addi s2,s6,8 588: 000b4583 lbu a1,0(s6) 58c: 8556 mv a0,s5 58e: 00000097 auipc ra,0x0 592: d98080e7 jalr -616(ra) # 326 <putc> 596: 8b4a mv s6,s2 state = 0; 598: 4981 li s3,0 59a: bd65 j 452 <vprintf+0x60> putc(fd, c); 59c: 85d2 mv a1,s4 59e: 8556 mv a0,s5 5a0: 00000097 auipc ra,0x0 5a4: d86080e7 jalr -634(ra) # 326 <putc> state = 0; 5a8: 4981 li s3,0 5aa: b565 j 452 <vprintf+0x60> s = va_arg(ap, char*); 5ac: 8b4e mv s6,s3 state = 0; 5ae: 4981 li s3,0 5b0: b54d j 452 <vprintf+0x60> } } } 5b2: 70e6 ld ra,120(sp) 5b4: 7446 ld s0,112(sp) 5b6: 74a6 ld s1,104(sp) 5b8: 7906 ld s2,96(sp) 5ba: 69e6 ld s3,88(sp) 5bc: 6a46 ld s4,80(sp) 5be: 6aa6 ld s5,72(sp) 5c0: 6b06 ld s6,64(sp) 5c2: 7be2 ld s7,56(sp) 5c4: 7c42 ld s8,48(sp) 5c6: 7ca2 ld s9,40(sp) 5c8: 7d02 ld s10,32(sp) 5ca: 6de2 ld s11,24(sp) 5cc: 6109 addi sp,sp,128 5ce: 8082 ret 00000000000005d0 <fprintf>: void fprintf(int fd, const char *fmt, ...) { 5d0: 715d addi sp,sp,-80 5d2: ec06 sd ra,24(sp) 5d4: e822 sd s0,16(sp) 5d6: 1000 addi s0,sp,32 5d8: e010 sd a2,0(s0) 5da: e414 sd a3,8(s0) 5dc: e818 sd a4,16(s0) 5de: ec1c sd a5,24(s0) 5e0: 03043023 sd a6,32(s0) 5e4: 03143423 sd a7,40(s0) va_list ap; va_start(ap, fmt); 5e8: fe843423 sd s0,-24(s0) vprintf(fd, fmt, ap); 5ec: 8622 mv a2,s0 5ee: 00000097 auipc ra,0x0 5f2: e04080e7 jalr -508(ra) # 3f2 <vprintf> } 5f6: 60e2 ld ra,24(sp) 5f8: 6442 ld s0,16(sp) 5fa: 6161 addi sp,sp,80 5fc: 8082 ret 00000000000005fe <printf>: void printf(const char *fmt, ...) { 5fe: 711d addi sp,sp,-96 600: ec06 sd ra,24(sp) 602: e822 sd s0,16(sp) 604: 1000 addi s0,sp,32 606: e40c sd a1,8(s0) 608: e810 sd a2,16(s0) 60a: ec14 sd a3,24(s0) 60c: f018 sd a4,32(s0) 60e: f41c sd a5,40(s0) 610: 03043823 sd a6,48(s0) 614: 03143c23 sd a7,56(s0) va_list ap; va_start(ap, fmt); 618: 00840613 addi a2,s0,8 61c: fec43423 sd a2,-24(s0) vprintf(1, fmt, ap); 620: 85aa mv a1,a0 622: 4505 li a0,1 624: 00000097 auipc ra,0x0 628: dce080e7 jalr -562(ra) # 3f2 <vprintf> } 62c: 60e2 ld ra,24(sp) 62e: 6442 ld s0,16(sp) 630: 6125 addi sp,sp,96 632: 8082 ret 0000000000000634 <free>: static Header base; static Header *freep; void free(void *ap) { 634: 1141 addi sp,sp,-16 636: e422 sd s0,8(sp) 638: 0800 addi s0,sp,16 Header *bp, *p; bp = (Header*)ap - 1; 63a: ff050693 addi a3,a0,-16 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 63e: 00000797 auipc a5,0x0 642: 18a7b783 ld a5,394(a5) # 7c8 <freep> 646: a805 j 676 <free+0x42> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ bp->s.size += p->s.ptr->s.size; 648: 4618 lw a4,8(a2) 64a: 9db9 addw a1,a1,a4 64c: feb52c23 sw a1,-8(a0) bp->s.ptr = p->s.ptr->s.ptr; 650: 6398 ld a4,0(a5) 652: 6318 ld a4,0(a4) 654: fee53823 sd a4,-16(a0) 658: a091 j 69c <free+0x68> } else bp->s.ptr = p->s.ptr; if(p + p->s.size == bp){ p->s.size += bp->s.size; 65a: ff852703 lw a4,-8(a0) 65e: 9e39 addw a2,a2,a4 660: c790 sw a2,8(a5) p->s.ptr = bp->s.ptr; 662: ff053703 ld a4,-16(a0) 666: e398 sd a4,0(a5) 668: a099 j 6ae <free+0x7a> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 66a: 6398 ld a4,0(a5) 66c: 00e7e463 bltu a5,a4,674 <free+0x40> 670: 00e6ea63 bltu a3,a4,684 <free+0x50> { 674: 87ba mv a5,a4 for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 676: fed7fae3 bgeu a5,a3,66a <free+0x36> 67a: 6398 ld a4,0(a5) 67c: 00e6e463 bltu a3,a4,684 <free+0x50> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 680: fee7eae3 bltu a5,a4,674 <free+0x40> if(bp + bp->s.size == p->s.ptr){ 684: ff852583 lw a1,-8(a0) 688: 6390 ld a2,0(a5) 68a: 02059813 slli a6,a1,0x20 68e: 01c85713 srli a4,a6,0x1c 692: 9736 add a4,a4,a3 694: fae60ae3 beq a2,a4,648 <free+0x14> bp->s.ptr = p->s.ptr; 698: fec53823 sd a2,-16(a0) if(p + p->s.size == bp){ 69c: 4790 lw a2,8(a5) 69e: 02061593 slli a1,a2,0x20 6a2: 01c5d713 srli a4,a1,0x1c 6a6: 973e add a4,a4,a5 6a8: fae689e3 beq a3,a4,65a <free+0x26> } else p->s.ptr = bp; 6ac: e394 sd a3,0(a5) freep = p; 6ae: 00000717 auipc a4,0x0 6b2: 10f73d23 sd a5,282(a4) # 7c8 <freep> } 6b6: 6422 ld s0,8(sp) 6b8: 0141 addi sp,sp,16 6ba: 8082 ret 00000000000006bc <malloc>: return freep; } void* malloc(uint nbytes) { 6bc: 7139 addi sp,sp,-64 6be: fc06 sd ra,56(sp) 6c0: f822 sd s0,48(sp) 6c2: f426 sd s1,40(sp) 6c4: f04a sd s2,32(sp) 6c6: ec4e sd s3,24(sp) 6c8: e852 sd s4,16(sp) 6ca: e456 sd s5,8(sp) 6cc: e05a sd s6,0(sp) 6ce: 0080 addi s0,sp,64 Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 6d0: 02051493 slli s1,a0,0x20 6d4: 9081 srli s1,s1,0x20 6d6: 04bd addi s1,s1,15 6d8: 8091 srli s1,s1,0x4 6da: 0014899b addiw s3,s1,1 6de: 0485 addi s1,s1,1 if((prevp = freep) == 0){ 6e0: 00000517 auipc a0,0x0 6e4: 0e853503 ld a0,232(a0) # 7c8 <freep> 6e8: c515 beqz a0,714 <malloc+0x58> base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 6ea: 611c ld a5,0(a0) if(p->s.size >= nunits){ 6ec: 4798 lw a4,8(a5) 6ee: 02977f63 bgeu a4,s1,72c <malloc+0x70> 6f2: 8a4e mv s4,s3 6f4: 0009871b sext.w a4,s3 6f8: 6685 lui a3,0x1 6fa: 00d77363 bgeu a4,a3,700 <malloc+0x44> 6fe: 6a05 lui s4,0x1 700: 000a0b1b sext.w s6,s4 p = sbrk(nu * sizeof(Header)); 704: 004a1a1b slliw s4,s4,0x4 p->s.size = nunits; } freep = prevp; return (void*)(p + 1); } if(p == freep) 708: 00000917 auipc s2,0x0 70c: 0c090913 addi s2,s2,192 # 7c8 <freep> if(p == (char*)-1) 710: 5afd li s5,-1 712: a895 j 786 <malloc+0xca> base.s.ptr = freep = prevp = &base; 714: 00000797 auipc a5,0x0 718: 0bc78793 addi a5,a5,188 # 7d0 <base> 71c: 00000717 auipc a4,0x0 720: 0af73623 sd a5,172(a4) # 7c8 <freep> 724: e39c sd a5,0(a5) base.s.size = 0; 726: 0007a423 sw zero,8(a5) if(p->s.size >= nunits){ 72a: b7e1 j 6f2 <malloc+0x36> if(p->s.size == nunits) 72c: 02e48c63 beq s1,a4,764 <malloc+0xa8> p->s.size -= nunits; 730: 4137073b subw a4,a4,s3 734: c798 sw a4,8(a5) p += p->s.size; 736: 02071693 slli a3,a4,0x20 73a: 01c6d713 srli a4,a3,0x1c 73e: 97ba add a5,a5,a4 p->s.size = nunits; 740: 0137a423 sw s3,8(a5) freep = prevp; 744: 00000717 auipc a4,0x0 748: 08a73223 sd a0,132(a4) # 7c8 <freep> return (void*)(p + 1); 74c: 01078513 addi a0,a5,16 if((p = morecore(nunits)) == 0) return 0; } } 750: 70e2 ld ra,56(sp) 752: 7442 ld s0,48(sp) 754: 74a2 ld s1,40(sp) 756: 7902 ld s2,32(sp) 758: 69e2 ld s3,24(sp) 75a: 6a42 ld s4,16(sp) 75c: 6aa2 ld s5,8(sp) 75e: 6b02 ld s6,0(sp) 760: 6121 addi sp,sp,64 762: 8082 ret prevp->s.ptr = p->s.ptr; 764: 6398 ld a4,0(a5) 766: e118 sd a4,0(a0) 768: bff1 j 744 <malloc+0x88> hp->s.size = nu; 76a: 01652423 sw s6,8(a0) free((void*)(hp + 1)); 76e: 0541 addi a0,a0,16 770: 00000097 auipc ra,0x0 774: ec4080e7 jalr -316(ra) # 634 <free> return freep; 778: 00093503 ld a0,0(s2) if((p = morecore(nunits)) == 0) 77c: d971 beqz a0,750 <malloc+0x94> for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 77e: 611c ld a5,0(a0) if(p->s.size >= nunits){ 780: 4798 lw a4,8(a5) 782: fa9775e3 bgeu a4,s1,72c <malloc+0x70> if(p == freep) 786: 00093703 ld a4,0(s2) 78a: 853e mv a0,a5 78c: fef719e3 bne a4,a5,77e <malloc+0xc2> p = sbrk(nu * sizeof(Header)); 790: 8552 mv a0,s4 792: 00000097 auipc ra,0x0 796: b64080e7 jalr -1180(ra) # 2f6 <sbrk> if(p == (char*)-1) 79a: fd5518e3 bne a0,s5,76a <malloc+0xae> return 0; 79e: 4501 li a0,0 7a0: bf45 j 750 <malloc+0x94>
29.216031
60
0.460089
19b020136307e917457299123958914e5d4fe171
314
asm
Assembly
libsrc/_DEVELOPMENT/arch/zx/misc/c/sdcc_iy/zx_scroll_wc_up_attr_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/zx/misc/c/sdcc_iy/zx_scroll_wc_up_attr_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/zx/misc/c/sdcc_iy/zx_scroll_wc_up_attr_callee.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void zx_scroll_wc_up_callee(struct r_Rect8 *r, uchar rows, uchar attr) SECTION code_clib SECTION code_arch PUBLIC _zx_scroll_wc_up_attr_callee EXTERN asm0_zx_scroll_wc_up_attr _zx_scroll_wc_up_attr_callee: pop hl pop ix ex (sp),hl ld e,l ld d,0 ld l,h jp asm0_zx_scroll_wc_up_attr
14.952381
72
0.757962
c5f3da74b5dccb90461cdc14dc88266328abda58
14,827
asm
Assembly
cpm2/RomWBW/Source/HBIOS/font_tms.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
null
null
null
cpm2/RomWBW/Source/HBIOS/font_tms.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
null
null
null
cpm2/RomWBW/Source/HBIOS/font_tms.asm
grancier/z180
e83f35e36c9b4d1457e40585019430e901c86ed9
[ "ClArtistic" ]
1
2019-12-03T23:57:48.000Z
2019-12-03T23:57:48.000Z
; tms_font.inc - automatically generated by n8vidtst FONT_TMS: .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x00(0) .DB 030h,030h,030h,03ch,03ch,000h,000h,000h ; 0x01(1) .DB 030h,030h,030h,0f0h,0f0h,000h,000h,000h ; 0x02(2) .DB 000h,000h,000h,03ch,03ch,030h,030h,030h ; 0x03(3) .DB 000h,000h,000h,0f0h,0f0h,030h,030h,030h ; 0x04(4) .DB 030h,030h,030h,030h,030h,030h,030h,030h ; 0x05(5) .DB 000h,000h,000h,0ffh,0ffh,000h,000h,000h ; 0x06(6) .DB 000h,000h,020h,070h,0f8h,070h,020h,000h ; 0x07(7) .DB 000h,0f8h,0d8h,088h,000h,088h,0d8h,0f8h ; 0x08(8) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x09(9) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x0a(10) .DB 000h,000h,060h,090h,060h,020h,018h,018h ; 0x0b(11) .DB 000h,000h,020h,070h,020h,020h,050h,020h ; 0x0c(12) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x0d(13) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x0e(14) .DB 000h,0a8h,050h,050h,0d8h,050h,050h,0a8h ; 0x0f(15) .DB 030h,030h,030h,0fch,0fch,030h,030h,030h ; 0x10(16) .DB 000h,010h,030h,070h,0f0h,070h,030h,010h ; 0x11(17) .DB 000h,020h,070h,020h,020h,020h,070h,020h ; 0x12(18) .DB 000h,000h,050h,000h,050h,050h,050h,050h ; 0x13(19) .DB 000h,000h,028h,028h,068h,0a8h,0a8h,078h ; 0x14(20) .DB 000h,000h,000h,0fch,0fch,030h,030h,030h ; 0x15(21) .DB 030h,030h,030h,0fch,0fch,000h,000h,000h ; 0x16(22) .DB 030h,030h,030h,0f0h,0f0h,030h,030h,030h ; 0x17(23) .DB 020h,020h,020h,020h,020h,020h,070h,020h ; 0x18(24) .DB 030h,030h,030h,03ch,03ch,030h,030h,030h ; 0x19(25) .DB 000h,000h,010h,018h,0fch,018h,010h,000h ; 0x1a(26) .DB 000h,000h,020h,060h,0fch,060h,020h,000h ; 0x1b(27) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x1c(28) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x1d(29) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x1e(30) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x1f(31) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x20(32) .DB 000h,000h,030h,000h,030h,078h,078h,030h ; 0x21(33) .DB 000h,000h,000h,000h,000h,050h,0d8h,0d8h ; 0x22(34) .DB 048h,048h,0fch,048h,048h,0fch,048h,048h ; 0x23(35) .DB 000h,020h,0f8h,024h,078h,0a0h,078h,020h ; 0x24(36) .DB 000h,000h,098h,058h,020h,0d0h,0c8h,000h ; 0x25(37) .DB 000h,078h,090h,060h,050h,048h,048h,030h ; 0x26(38) .DB 000h,000h,000h,000h,000h,040h,030h,030h ; 0x27(39) .DB 000h,010h,020h,020h,020h,020h,020h,010h ; 0x28(40) .DB 000h,020h,010h,010h,010h,010h,010h,020h ; 0x29(41) .DB 000h,020h,0a8h,070h,0f8h,070h,0a8h,020h ; 0x2a(42) .DB 000h,000h,020h,020h,0f8h,020h,020h,000h ; 0x2b(43) .DB 040h,030h,030h,000h,000h,000h,000h,000h ; 0x2c(44) .DB 000h,000h,000h,000h,070h,000h,000h,000h ; 0x2d(45) .DB 000h,030h,030h,000h,000h,000h,000h,000h ; 0x2e(46) .DB 000h,000h,080h,040h,020h,010h,008h,004h ; 0x2f(47) .DB 000h,070h,0c8h,0a8h,0a8h,0a8h,098h,070h ; 0x30(48) .DB 000h,0f8h,020h,020h,020h,020h,060h,020h ; 0x31(49) .DB 000h,0f8h,080h,060h,010h,008h,088h,070h ; 0x32(50) .DB 000h,070h,088h,008h,070h,008h,088h,070h ; 0x33(51) .DB 000h,010h,010h,010h,0f8h,090h,050h,030h ; 0x34(52) .DB 000h,070h,088h,008h,0f0h,080h,080h,0f8h ; 0x35(53) .DB 000h,070h,088h,088h,0f0h,080h,040h,038h ; 0x36(54) .DB 000h,020h,020h,020h,020h,010h,008h,0f8h ; 0x37(55) .DB 000h,070h,088h,088h,070h,088h,088h,070h ; 0x38(56) .DB 000h,070h,088h,008h,078h,088h,088h,070h ; 0x39(57) .DB 000h,000h,030h,030h,000h,030h,030h,000h ; 0x3a(58) .DB 000h,060h,030h,030h,000h,030h,030h,000h ; 0x3b(59) .DB 000h,010h,020h,040h,080h,040h,020h,010h ; 0x3c(60) .DB 000h,000h,000h,0fch,000h,0fch,000h,000h ; 0x3d(61) .DB 000h,040h,020h,010h,008h,010h,020h,040h ; 0x3e(62) .DB 000h,020h,000h,020h,030h,008h,088h,070h ; 0x3f(63) .DB 000h,070h,080h,080h,0b0h,0b8h,088h,070h ; 0x40(64) .DB 000h,088h,088h,088h,0f8h,088h,050h,020h ; 0x41(65) .DB 000h,0f0h,048h,048h,070h,048h,048h,0f0h ; 0x42(66) .DB 000h,070h,088h,080h,080h,080h,088h,070h ; 0x43(67) .DB 000h,0f0h,048h,048h,048h,048h,048h,0f0h ; 0x44(68) .DB 000h,0f8h,088h,080h,0e0h,080h,088h,0f8h ; 0x45(69) .DB 000h,080h,080h,080h,0f0h,080h,088h,0f8h ; 0x46(70) .DB 000h,070h,088h,088h,0b8h,080h,088h,070h ; 0x47(71) .DB 000h,088h,088h,088h,0f8h,088h,088h,088h ; 0x48(72) .DB 000h,0f8h,020h,020h,020h,020h,020h,0f8h ; 0x49(73) .DB 000h,070h,088h,008h,008h,008h,008h,01ch ; 0x4a(74) .DB 000h,088h,090h,0a0h,0c0h,0a0h,090h,088h ; 0x4b(75) .DB 000h,0f8h,088h,080h,080h,080h,080h,080h ; 0x4c(76) .DB 000h,088h,088h,088h,088h,0a8h,0d8h,088h ; 0x4d(77) .DB 000h,088h,098h,0a8h,0a8h,0a8h,0c8h,088h ; 0x4e(78) .DB 000h,070h,088h,088h,088h,088h,088h,070h ; 0x4f(79) .DB 000h,080h,080h,080h,0f0h,088h,088h,0f0h ; 0x50(80) .DB 004h,078h,098h,0a8h,088h,088h,088h,070h ; 0x51(81) .DB 000h,088h,090h,0a0h,0f0h,088h,088h,0f0h ; 0x52(82) .DB 000h,070h,088h,010h,020h,040h,088h,070h ; 0x53(83) .DB 000h,020h,020h,020h,020h,020h,020h,0f8h ; 0x54(84) .DB 000h,070h,088h,088h,088h,088h,088h,088h ; 0x55(85) .DB 000h,020h,050h,050h,050h,088h,088h,088h ; 0x56(86) .DB 000h,050h,0a8h,0a8h,0a8h,088h,088h,088h ; 0x57(87) .DB 000h,088h,088h,050h,020h,050h,088h,088h ; 0x58(88) .DB 000h,020h,020h,020h,020h,050h,088h,088h ; 0x59(89) .DB 000h,0f8h,088h,040h,020h,010h,088h,0f8h ; 0x5a(90) .DB 000h,078h,040h,040h,040h,040h,040h,078h ; 0x5b(91) .DB 000h,000h,008h,010h,020h,040h,080h,000h ; 0x5c(92) .DB 000h,078h,008h,008h,008h,008h,008h,078h ; 0x5d(93) .DB 000h,000h,000h,000h,000h,088h,050h,020h ; 0x5e(94) .DB 000h,0fch,000h,000h,000h,000h,000h,000h ; 0x5f(95) .DB 000h,000h,000h,000h,000h,010h,060h,060h ; 0x60(96) .DB 000h,070h,088h,078h,008h,0f0h,000h,000h ; 0x61(97) .DB 000h,0f0h,088h,088h,0f0h,080h,080h,080h ; 0x62(98) .DB 000h,070h,080h,080h,070h,000h,000h,000h ; 0x63(99) .DB 000h,078h,088h,088h,078h,008h,008h,008h ; 0x64(100) .DB 000h,070h,080h,0f8h,088h,070h,000h,000h ; 0x65(101) .DB 000h,040h,040h,040h,0e0h,048h,030h,000h ; 0x66(102) .DB 070h,008h,038h,048h,048h,038h,000h,000h ; 0x67(103) .DB 000h,088h,088h,0c8h,0b0h,080h,080h,000h ; 0x68(104) .DB 000h,070h,020h,060h,000h,020h,000h,000h ; 0x69(105) .DB 030h,048h,008h,008h,018h,000h,008h,000h ; 0x6a(106) .DB 000h,090h,0a0h,0c0h,0a0h,090h,080h,080h ; 0x6b(107) .DB 000h,020h,020h,020h,020h,020h,020h,020h ; 0x6c(108) .DB 000h,088h,0a8h,0a8h,050h,000h,000h,000h ; 0x6d(109) .DB 000h,088h,088h,0c8h,0b0h,000h,000h,000h ; 0x6e(110) .DB 000h,070h,088h,088h,070h,000h,000h,000h ; 0x6f(111) .DB 040h,040h,070h,048h,048h,070h,000h,000h ; 0x70(112) .DB 008h,008h,038h,048h,048h,038h,060h,000h ; 0x71(113) .DB 000h,080h,080h,0c8h,0b0h,000h,000h,000h ; 0x72(114) .DB 000h,060h,010h,060h,080h,060h,000h,000h ; 0x73(115) .DB 000h,020h,040h,040h,0e0h,040h,000h,000h ; 0x74(116) .DB 000h,068h,090h,090h,090h,000h,000h,000h ; 0x75(117) .DB 000h,020h,050h,088h,088h,000h,000h,000h ; 0x76(118) .DB 000h,050h,0a8h,0a8h,088h,000h,000h,000h ; 0x77(119) .DB 000h,048h,030h,030h,048h,000h,000h,000h ; 0x78(120) .DB 000h,080h,040h,020h,050h,088h,000h,000h ; 0x79(121) .DB 000h,0f8h,040h,020h,010h,0f8h,000h,000h ; 0x7a(122) .DB 000h,010h,020h,020h,040h,020h,020h,010h ; 0x7b(123) .DB 000h,020h,020h,020h,000h,020h,020h,020h ; 0x7c(124) .DB 000h,040h,020h,020h,010h,020h,020h,040h ; 0x7d(125) .DB 000h,000h,000h,000h,000h,000h,090h,06ch ; 0x7e(126) .DB 000h,070h,050h,050h,050h,050h,050h,070h ; 0x7f(127) .DB 0a8h,0a8h,0a8h,0ach,0a0h,0bch,080h,0fch ; 0x80(128) .DB 000h,000h,000h,0fch,000h,0fch,000h,0fch ; 0x81(129) .DB 054h,054h,054h,0d4h,014h,0f4h,004h,0fch ; 0x82(130) .DB 054h,054h,054h,054h,054h,054h,054h,054h ; 0x83(131) .DB 0fch,004h,0f4h,014h,0d4h,054h,054h,054h ; 0x84(132) .DB 0ffh,000h,0ffh,000h,0ffh,000h,000h,000h ; 0x85(133) .DB 0fch,080h,0bch,0a0h,0ach,0a8h,0a8h,0a8h ; 0x86(134) .DB 0a8h,0a8h,0a8h,0a8h,0a8h,0a8h,0a8h,0a8h ; 0x87(135) .DB 0a8h,0a8h,0a8h,0ach,0a0h,0ach,0a8h,0a8h ; 0x88(136) .DB 054h,054h,054h,0d4h,014h,0d4h,054h,054h ; 0x89(137) .DB 000h,000h,000h,0fch,000h,0fch,000h,000h ; 0x8a(138) .DB 080h,080h,080h,080h,080h,080h,080h,0fch ; 0x8b(139) .DB 000h,000h,000h,000h,000h,000h,000h,0fch ; 0x8c(140) .DB 004h,004h,004h,004h,004h,004h,004h,0fch ; 0x8d(141) .DB 004h,004h,004h,004h,004h,004h,004h,004h ; 0x8e(142) .DB 0fch,004h,004h,004h,004h,004h,004h,004h ; 0x8f(143) .DB 0fch,000h,000h,000h,000h,000h,000h,000h ; 0x90(144) .DB 0fch,080h,080h,080h,080h,080h,080h,080h ; 0x91(145) .DB 080h,080h,080h,080h,080h,080h,080h,080h ; 0x92(146) .DB 080h,080h,080h,080h,0fch,080h,080h,080h ; 0x93(147) .DB 004h,004h,004h,004h,0fch,004h,004h,004h ; 0x94(148) .DB 000h,000h,000h,000h,0fch,000h,000h,000h ; 0x95(149) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x96(150) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x97(151) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x98(152) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x99(153) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x9a(154) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x9b(155) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x9c(156) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x9d(157) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x9e(158) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0x9f(159) .DB 000h,070h,088h,078h,008h,0f0h,040h,020h ; 0xa0(160) .DB 000h,0f8h,020h,020h,060h,000h,020h,010h ; 0xa1(161) .DB 000h,070h,088h,088h,070h,000h,020h,010h ; 0xa2(162) .DB 000h,074h,088h,088h,088h,000h,020h,010h ; 0xa3(163) .DB 000h,088h,088h,0c8h,0b0h,000h,020h,010h ; 0xa4(164) .DB 000h,088h,098h,0a8h,0c8h,000h,020h,010h ; 0xa5(165) .DB 000h,000h,0fch,000h,07ch,088h,088h,070h ; 0xa6(166) .DB 000h,000h,0fch,000h,070h,088h,088h,070h ; 0xa7(167) .DB 000h,070h,088h,040h,020h,020h,000h,020h ; 0xa8(168) .DB 080h,080h,080h,0fch,000h,000h,000h,000h ; 0xa9(169) .DB 004h,004h,004h,0fch,000h,000h,000h,000h ; 0xaa(170) .DB 000h,000h,01ch,088h,054h,0a8h,090h,088h ; 0xab(171) .DB 000h,000h,008h,0b8h,058h,0a8h,090h,088h ; 0xac(172) .DB 000h,000h,030h,078h,078h,030h,000h,030h ; 0xad(173) .DB 000h,014h,028h,050h,0a0h,050h,028h,014h ; 0xae(174) .DB 000h,0a0h,050h,028h,014h,028h,050h,0a0h ; 0xaf(175) .DB 0aah,054h,0aah,054h,0aah,054h,0aah,054h ; 0xb0(176) .DB 054h,0aah,054h,0aah,054h,0aah,054h,0aah ; 0xb1(177) .DB 06ch,0b6h,0dah,06ch,0b6h,0dah,06ch,0b6h ; 0xb2(178) .DB 018h,018h,018h,018h,018h,018h,018h,018h ; 0xb3(179) .DB 018h,018h,018h,0f8h,018h,018h,018h,018h ; 0xb4(180) .DB 018h,018h,0f8h,018h,0f8h,018h,018h,018h ; 0xb5(181) .DB 06ch,06ch,06ch,0ech,06ch,06ch,06ch,06ch ; 0xb6(182) .DB 06ch,06ch,06ch,0fch,000h,000h,000h,000h ; 0xb7(183) .DB 06ch,06ch,0ech,06ch,0fch,000h,000h,000h ; 0xb8(184) .DB 06ch,06ch,06ch,0ech,00ch,0ech,06ch,06ch ; 0xb9(185) .DB 06ch,06ch,06ch,06ch,06ch,06ch,06ch,06ch ; 0xba(186) .DB 06ch,06ch,06ch,0eeh,00eh,0fch,000h,000h ; 0xbb(187) .DB 000h,000h,000h,0fch,00ch,0ech,06ch,06ch ; 0xbc(188) .DB 000h,000h,000h,000h,000h,0fch,064h,064h ; 0xbd(189) .DB 000h,000h,0f0h,030h,030h,0f0h,030h,030h ; 0xbe(190) .DB 030h,030h,030h,0f0h,000h,000h,000h,000h ; 0xbf(191) .DB 000h,000h,000h,03ch,030h,030h,030h,030h ; 0xc0(192) .DB 000h,000h,000h,0fch,030h,030h,030h,030h ; 0xc1(193) .DB 030h,030h,030h,0fch,000h,000h,000h,000h ; 0xc2(194) .DB 030h,030h,030h,03ch,030h,030h,030h,030h ; 0xc3(195) .DB 000h,000h,000h,0fch,000h,000h,000h,000h ; 0xc4(196) .DB 030h,030h,030h,0fch,030h,030h,030h,030h ; 0xc5(197) .DB 030h,030h,030h,03ch,030h,03ch,030h,030h ; 0xc6(198) .DB 0d8h,0d8h,0d8h,0d8h,0d8h,0dch,0d8h,0d8h ; 0xc7(199) .DB 000h,000h,0fch,0c0h,0dch,0d8h,0d8h,0d8h ; 0xc8(200) .DB 0d8h,0d8h,0dch,0c0h,0fch,000h,000h,000h ; 0xc9(201) .DB 000h,0fch,000h,0c0h,0dch,0d8h,0d8h,0d8h ; 0xca(202) .DB 000h,0fch,000h,000h,000h,000h,000h,000h ; 0xcb(203) .DB 0d8h,0d8h,0dch,0c0h,0dch,0d8h,0d8h,0d8h ; 0xcc(204) .DB 000h,000h,0fch,000h,0fch,000h,000h,000h ; 0xcd(205) .DB 0d8h,0d8h,0dch,000h,0dch,0d8h,0d8h,0d8h ; 0xce(206) .DB 000h,0fch,000h,000h,0fch,030h,030h,030h ; 0xcf(207) .DB 000h,000h,000h,000h,0fch,0d8h,0d8h,0d8h ; 0xd0(208) .DB 030h,030h,0fch,000h,000h,0fch,000h,000h ; 0xd1(209) .DB 0d8h,0d8h,0fch,000h,000h,000h,000h,000h ; 0xd2(210) .DB 000h,000h,000h,000h,0fch,0d8h,0d8h,0d8h ; 0xd3(211) .DB 000h,03ch,030h,030h,03ch,030h,030h,030h ; 0xd4(212) .DB 030h,030h,03eh,030h,03eh,000h,000h,000h ; 0xd5(213) .DB 0d8h,0d8h,0fch,000h,000h,000h,000h,000h ; 0xd6(214) .DB 0d8h,0d8h,0d8h,0dch,0d8h,0d8h,0d8h,0d8h ; 0xd7(215) .DB 030h,030h,0fch,000h,000h,0fch,030h,030h ; 0xd8(216) .DB 000h,000h,000h,000h,0f0h,030h,030h,030h ; 0xd9(217) .DB 030h,030h,030h,030h,03ch,000h,000h,000h ; 0xda(218) .DB 0fch,0fch,0fch,0fch,0fch,0fch,0fch,0fch ; 0xdb(219) .DB 0c0h,0c0h,0fch,0fch,0fch,000h,000h,000h ; 0xdc(220) .DB 0c0h,0c0h,0c0h,0c0h,0c0h,0c0h,0c0h,0c0h ; 0xdd(221) .DB 00ch,00ch,00ch,00ch,00ch,00ch,00ch,00ch ; 0xde(222) .DB 000h,0fch,0fch,0fch,00ch,00ch,00ch,00ch ; 0xdf(223) .DB 000h,068h,090h,090h,068h,000h,000h,000h ; 0xe0(224) .DB 040h,0f0h,088h,088h,0b0h,088h,088h,070h ; 0xe1(225) .DB 000h,080h,080h,080h,080h,080h,090h,0f0h ; 0xe2(226) .DB 000h,000h,048h,050h,050h,050h,050h,0f8h ; 0xe3(227) .DB 000h,0f8h,088h,040h,020h,040h,088h,0f8h ; 0xe4(228) .DB 000h,070h,088h,088h,07ch,000h,000h,000h ; 0xe5(229) .DB 080h,070h,088h,088h,088h,000h,000h,000h ; 0xe6(230) .DB 000h,01ch,010h,010h,098h,074h,000h,000h ; 0xe7(231) .DB 000h,0fch,010h,038h,044h,038h,010h,0fch ; 0xe8(232) .DB 000h,038h,0cch,0cch,0fch,0cch,0cch,030h ; 0xe9(233) .DB 000h,084h,048h,048h,084h,084h,084h,078h ; 0xea(234) .DB 000h,038h,044h,044h,044h,038h,040h,03ch ; 0xeb(235) .DB 000h,000h,06ch,092h,092h,06ch,000h,000h ; 0xec(236) .DB 000h,070h,068h,058h,038h,000h,000h,000h ; 0xed(237) .DB 000h,038h,040h,080h,0f8h,080h,040h,038h ; 0xee(238) .DB 000h,0cch,0cch,0cch,0cch,030h,000h,000h ; 0xef(239) .DB 000h,0fch,000h,000h,0fch,000h,000h,0fch ; 0xf0(240) .DB 000h,0feh,000h,010h,010h,07ch,010h,010h ; 0xf1(241) .DB 000h,0feh,000h,020h,010h,008h,010h,020h ; 0xf2(242) .DB 000h,0feh,000h,010h,020h,040h,020h,010h ; 0xf3(243) .DB 030h,030h,030h,030h,030h,030h,034h,018h ; 0xf4(244) .DB 070h,0b0h,030h,030h,030h,030h,030h,030h ; 0xf5(245) .DB 000h,030h,030h,000h,0fch,000h,030h,030h ; 0xf6(246) .DB 000h,000h,098h,064h,000h,098h,064h,000h ; 0xf7(247) .DB 000h,000h,000h,000h,038h,044h,044h,038h ; 0xf8(248) .DB 000h,000h,000h,000h,000h,038h,038h,000h ; 0xf9(249) .DB 000h,000h,000h,000h,000h,038h,000h,000h ; 0xfa(250) .DB 000h,008h,018h,028h,048h,008h,008h,00eh ; 0xfb(251) .DB 000h,048h,048h,048h,0b0h,000h,000h,000h ; 0xfc(252) .DB 000h,0f8h,080h,040h,03ch,0f0h,000h,000h ; 0xfd(253) .DB 0fch,0fch,0fch,0fch,0fch,0fch,0fch,0fch ; 0xfe(254) .DB 000h,000h,000h,000h,000h,000h,000h,000h ; 0xff(255) ; eof - tms_font.inc
56.808429
57
0.704863
c4a3d817cc653a10e01940e58f189a050525d83b
65,387
asm
Assembly
stressfs.asm
swu038/CS183lab2
b9c4db70ae1b36f4a6b7c26c0361d6728532d1cb
[ "MIT-0" ]
null
null
null
stressfs.asm
swu038/CS183lab2
b9c4db70ae1b36f4a6b7c26c0361d6728532d1cb
[ "MIT-0" ]
null
null
null
stressfs.asm
swu038/CS183lab2
b9c4db70ae1b36f4a6b7c26c0361d6728532d1cb
[ "MIT-0" ]
null
null
null
_stressfs: file format elf32-i386 Disassembly of section .text: 00001000 <main>: #include "fs.h" #include "fcntl.h" int main(int argc, char *argv[]) { 1000: 55 push %ebp 1001: 89 e5 mov %esp,%ebp 1003: 83 e4 f0 and $0xfffffff0,%esp 1006: 81 ec 30 02 00 00 sub $0x230,%esp int fd, i; char path[] = "stressfs0"; 100c: c7 84 24 1e 02 00 00 movl $0x65727473,0x21e(%esp) 1013: 73 74 72 65 1017: c7 84 24 22 02 00 00 movl $0x73667373,0x222(%esp) 101e: 73 73 66 73 1022: 66 c7 84 24 26 02 00 movw $0x30,0x226(%esp) 1029: 00 30 00 char data[512]; printf(1, "stressfs starting\n"); 102c: c7 44 24 04 d3 1c 00 movl $0x1cd3,0x4(%esp) 1033: 00 1034: c7 04 24 01 00 00 00 movl $0x1,(%esp) 103b: e8 7d 05 00 00 call 15bd <printf> memset(data, 'a', sizeof(data)); 1040: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp) 1047: 00 1048: c7 44 24 04 61 00 00 movl $0x61,0x4(%esp) 104f: 00 1050: 8d 44 24 1e lea 0x1e(%esp),%eax 1054: 89 04 24 mov %eax,(%esp) 1057: e8 1a 02 00 00 call 1276 <memset> for(i = 0; i < 4; i++) 105c: c7 84 24 2c 02 00 00 movl $0x0,0x22c(%esp) 1063: 00 00 00 00 1067: eb 11 jmp 107a <main+0x7a> if(fork() > 0) 1069: e8 a6 03 00 00 call 1414 <fork> 106e: 85 c0 test %eax,%eax 1070: 7f 14 jg 1086 <main+0x86> char data[512]; printf(1, "stressfs starting\n"); memset(data, 'a', sizeof(data)); for(i = 0; i < 4; i++) 1072: 83 84 24 2c 02 00 00 addl $0x1,0x22c(%esp) 1079: 01 107a: 83 bc 24 2c 02 00 00 cmpl $0x3,0x22c(%esp) 1081: 03 1082: 7e e5 jle 1069 <main+0x69> 1084: eb 01 jmp 1087 <main+0x87> if(fork() > 0) break; 1086: 90 nop printf(1, "write %d\n", i); 1087: 8b 84 24 2c 02 00 00 mov 0x22c(%esp),%eax 108e: 89 44 24 08 mov %eax,0x8(%esp) 1092: c7 44 24 04 e6 1c 00 movl $0x1ce6,0x4(%esp) 1099: 00 109a: c7 04 24 01 00 00 00 movl $0x1,(%esp) 10a1: e8 17 05 00 00 call 15bd <printf> path[8] += i; 10a6: 0f b6 84 24 26 02 00 movzbl 0x226(%esp),%eax 10ad: 00 10ae: 89 c2 mov %eax,%edx 10b0: 8b 84 24 2c 02 00 00 mov 0x22c(%esp),%eax 10b7: 8d 04 02 lea (%edx,%eax,1),%eax 10ba: 88 84 24 26 02 00 00 mov %al,0x226(%esp) fd = open(path, O_CREATE | O_RDWR); 10c1: c7 44 24 04 02 02 00 movl $0x202,0x4(%esp) 10c8: 00 10c9: 8d 84 24 1e 02 00 00 lea 0x21e(%esp),%eax 10d0: 89 04 24 mov %eax,(%esp) 10d3: e8 84 03 00 00 call 145c <open> 10d8: 89 84 24 28 02 00 00 mov %eax,0x228(%esp) for(i = 0; i < 20; i++) 10df: c7 84 24 2c 02 00 00 movl $0x0,0x22c(%esp) 10e6: 00 00 00 00 10ea: eb 27 jmp 1113 <main+0x113> // printf(fd, "%d\n", i); write(fd, data, sizeof(data)); 10ec: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp) 10f3: 00 10f4: 8d 44 24 1e lea 0x1e(%esp),%eax 10f8: 89 44 24 04 mov %eax,0x4(%esp) 10fc: 8b 84 24 28 02 00 00 mov 0x228(%esp),%eax 1103: 89 04 24 mov %eax,(%esp) 1106: e8 31 03 00 00 call 143c <write> printf(1, "write %d\n", i); path[8] += i; fd = open(path, O_CREATE | O_RDWR); for(i = 0; i < 20; i++) 110b: 83 84 24 2c 02 00 00 addl $0x1,0x22c(%esp) 1112: 01 1113: 83 bc 24 2c 02 00 00 cmpl $0x13,0x22c(%esp) 111a: 13 111b: 7e cf jle 10ec <main+0xec> // printf(fd, "%d\n", i); write(fd, data, sizeof(data)); close(fd); 111d: 8b 84 24 28 02 00 00 mov 0x228(%esp),%eax 1124: 89 04 24 mov %eax,(%esp) 1127: e8 18 03 00 00 call 1444 <close> printf(1, "read\n"); 112c: c7 44 24 04 f0 1c 00 movl $0x1cf0,0x4(%esp) 1133: 00 1134: c7 04 24 01 00 00 00 movl $0x1,(%esp) 113b: e8 7d 04 00 00 call 15bd <printf> fd = open(path, O_RDONLY); 1140: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 1147: 00 1148: 8d 84 24 1e 02 00 00 lea 0x21e(%esp),%eax 114f: 89 04 24 mov %eax,(%esp) 1152: e8 05 03 00 00 call 145c <open> 1157: 89 84 24 28 02 00 00 mov %eax,0x228(%esp) for (i = 0; i < 20; i++) 115e: c7 84 24 2c 02 00 00 movl $0x0,0x22c(%esp) 1165: 00 00 00 00 1169: eb 27 jmp 1192 <main+0x192> read(fd, data, sizeof(data)); 116b: c7 44 24 08 00 02 00 movl $0x200,0x8(%esp) 1172: 00 1173: 8d 44 24 1e lea 0x1e(%esp),%eax 1177: 89 44 24 04 mov %eax,0x4(%esp) 117b: 8b 84 24 28 02 00 00 mov 0x228(%esp),%eax 1182: 89 04 24 mov %eax,(%esp) 1185: e8 aa 02 00 00 call 1434 <read> close(fd); printf(1, "read\n"); fd = open(path, O_RDONLY); for (i = 0; i < 20; i++) 118a: 83 84 24 2c 02 00 00 addl $0x1,0x22c(%esp) 1191: 01 1192: 83 bc 24 2c 02 00 00 cmpl $0x13,0x22c(%esp) 1199: 13 119a: 7e cf jle 116b <main+0x16b> read(fd, data, sizeof(data)); close(fd); 119c: 8b 84 24 28 02 00 00 mov 0x228(%esp),%eax 11a3: 89 04 24 mov %eax,(%esp) 11a6: e8 99 02 00 00 call 1444 <close> wait(); 11ab: e8 74 02 00 00 call 1424 <wait> exit(); 11b0: e8 67 02 00 00 call 141c <exit> 11b5: 90 nop 11b6: 90 nop 11b7: 90 nop 000011b8 <stosb>: "cc"); } static inline void stosb(void *addr, int data, int cnt) { 11b8: 55 push %ebp 11b9: 89 e5 mov %esp,%ebp 11bb: 57 push %edi 11bc: 53 push %ebx asm volatile("cld; rep stosb" : 11bd: 8b 4d 08 mov 0x8(%ebp),%ecx 11c0: 8b 55 10 mov 0x10(%ebp),%edx 11c3: 8b 45 0c mov 0xc(%ebp),%eax 11c6: 89 cb mov %ecx,%ebx 11c8: 89 df mov %ebx,%edi 11ca: 89 d1 mov %edx,%ecx 11cc: fc cld 11cd: f3 aa rep stos %al,%es:(%edi) 11cf: 89 ca mov %ecx,%edx 11d1: 89 fb mov %edi,%ebx 11d3: 89 5d 08 mov %ebx,0x8(%ebp) 11d6: 89 55 10 mov %edx,0x10(%ebp) "=D" (addr), "=c" (cnt) : "0" (addr), "1" (cnt), "a" (data) : "memory", "cc"); } 11d9: 5b pop %ebx 11da: 5f pop %edi 11db: 5d pop %ebp 11dc: c3 ret 000011dd <strcpy>: #include "user.h" #include "x86.h" char* strcpy(char *s, char *t) { 11dd: 55 push %ebp 11de: 89 e5 mov %esp,%ebp 11e0: 83 ec 10 sub $0x10,%esp char *os; os = s; 11e3: 8b 45 08 mov 0x8(%ebp),%eax 11e6: 89 45 fc mov %eax,-0x4(%ebp) while((*s++ = *t++) != 0) 11e9: 8b 45 0c mov 0xc(%ebp),%eax 11ec: 0f b6 10 movzbl (%eax),%edx 11ef: 8b 45 08 mov 0x8(%ebp),%eax 11f2: 88 10 mov %dl,(%eax) 11f4: 8b 45 08 mov 0x8(%ebp),%eax 11f7: 0f b6 00 movzbl (%eax),%eax 11fa: 84 c0 test %al,%al 11fc: 0f 95 c0 setne %al 11ff: 83 45 08 01 addl $0x1,0x8(%ebp) 1203: 83 45 0c 01 addl $0x1,0xc(%ebp) 1207: 84 c0 test %al,%al 1209: 75 de jne 11e9 <strcpy+0xc> ; return os; 120b: 8b 45 fc mov -0x4(%ebp),%eax } 120e: c9 leave 120f: c3 ret 00001210 <strcmp>: int strcmp(const char *p, const char *q) { 1210: 55 push %ebp 1211: 89 e5 mov %esp,%ebp while(*p && *p == *q) 1213: eb 08 jmp 121d <strcmp+0xd> p++, q++; 1215: 83 45 08 01 addl $0x1,0x8(%ebp) 1219: 83 45 0c 01 addl $0x1,0xc(%ebp) } int strcmp(const char *p, const char *q) { while(*p && *p == *q) 121d: 8b 45 08 mov 0x8(%ebp),%eax 1220: 0f b6 00 movzbl (%eax),%eax 1223: 84 c0 test %al,%al 1225: 74 10 je 1237 <strcmp+0x27> 1227: 8b 45 08 mov 0x8(%ebp),%eax 122a: 0f b6 10 movzbl (%eax),%edx 122d: 8b 45 0c mov 0xc(%ebp),%eax 1230: 0f b6 00 movzbl (%eax),%eax 1233: 38 c2 cmp %al,%dl 1235: 74 de je 1215 <strcmp+0x5> p++, q++; return (uchar)*p - (uchar)*q; 1237: 8b 45 08 mov 0x8(%ebp),%eax 123a: 0f b6 00 movzbl (%eax),%eax 123d: 0f b6 d0 movzbl %al,%edx 1240: 8b 45 0c mov 0xc(%ebp),%eax 1243: 0f b6 00 movzbl (%eax),%eax 1246: 0f b6 c0 movzbl %al,%eax 1249: 89 d1 mov %edx,%ecx 124b: 29 c1 sub %eax,%ecx 124d: 89 c8 mov %ecx,%eax } 124f: 5d pop %ebp 1250: c3 ret 00001251 <strlen>: uint strlen(char *s) { 1251: 55 push %ebp 1252: 89 e5 mov %esp,%ebp 1254: 83 ec 10 sub $0x10,%esp int n; for(n = 0; s[n]; n++) 1257: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) 125e: eb 04 jmp 1264 <strlen+0x13> 1260: 83 45 fc 01 addl $0x1,-0x4(%ebp) 1264: 8b 45 fc mov -0x4(%ebp),%eax 1267: 03 45 08 add 0x8(%ebp),%eax 126a: 0f b6 00 movzbl (%eax),%eax 126d: 84 c0 test %al,%al 126f: 75 ef jne 1260 <strlen+0xf> ; return n; 1271: 8b 45 fc mov -0x4(%ebp),%eax } 1274: c9 leave 1275: c3 ret 00001276 <memset>: void* memset(void *dst, int c, uint n) { 1276: 55 push %ebp 1277: 89 e5 mov %esp,%ebp 1279: 83 ec 0c sub $0xc,%esp stosb(dst, c, n); 127c: 8b 45 10 mov 0x10(%ebp),%eax 127f: 89 44 24 08 mov %eax,0x8(%esp) 1283: 8b 45 0c mov 0xc(%ebp),%eax 1286: 89 44 24 04 mov %eax,0x4(%esp) 128a: 8b 45 08 mov 0x8(%ebp),%eax 128d: 89 04 24 mov %eax,(%esp) 1290: e8 23 ff ff ff call 11b8 <stosb> return dst; 1295: 8b 45 08 mov 0x8(%ebp),%eax } 1298: c9 leave 1299: c3 ret 0000129a <strchr>: char* strchr(const char *s, char c) { 129a: 55 push %ebp 129b: 89 e5 mov %esp,%ebp 129d: 83 ec 04 sub $0x4,%esp 12a0: 8b 45 0c mov 0xc(%ebp),%eax 12a3: 88 45 fc mov %al,-0x4(%ebp) for(; *s; s++) 12a6: eb 14 jmp 12bc <strchr+0x22> if(*s == c) 12a8: 8b 45 08 mov 0x8(%ebp),%eax 12ab: 0f b6 00 movzbl (%eax),%eax 12ae: 3a 45 fc cmp -0x4(%ebp),%al 12b1: 75 05 jne 12b8 <strchr+0x1e> return (char*)s; 12b3: 8b 45 08 mov 0x8(%ebp),%eax 12b6: eb 13 jmp 12cb <strchr+0x31> } char* strchr(const char *s, char c) { for(; *s; s++) 12b8: 83 45 08 01 addl $0x1,0x8(%ebp) 12bc: 8b 45 08 mov 0x8(%ebp),%eax 12bf: 0f b6 00 movzbl (%eax),%eax 12c2: 84 c0 test %al,%al 12c4: 75 e2 jne 12a8 <strchr+0xe> if(*s == c) return (char*)s; return 0; 12c6: b8 00 00 00 00 mov $0x0,%eax } 12cb: c9 leave 12cc: c3 ret 000012cd <gets>: char* gets(char *buf, int max) { 12cd: 55 push %ebp 12ce: 89 e5 mov %esp,%ebp 12d0: 83 ec 28 sub $0x28,%esp int i, cc; char c; for(i=0; i+1 < max; ){ 12d3: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) 12da: eb 44 jmp 1320 <gets+0x53> cc = read(0, &c, 1); 12dc: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 12e3: 00 12e4: 8d 45 ef lea -0x11(%ebp),%eax 12e7: 89 44 24 04 mov %eax,0x4(%esp) 12eb: c7 04 24 00 00 00 00 movl $0x0,(%esp) 12f2: e8 3d 01 00 00 call 1434 <read> 12f7: 89 45 f4 mov %eax,-0xc(%ebp) if(cc < 1) 12fa: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 12fe: 7e 2d jle 132d <gets+0x60> break; buf[i++] = c; 1300: 8b 45 f0 mov -0x10(%ebp),%eax 1303: 03 45 08 add 0x8(%ebp),%eax 1306: 0f b6 55 ef movzbl -0x11(%ebp),%edx 130a: 88 10 mov %dl,(%eax) 130c: 83 45 f0 01 addl $0x1,-0x10(%ebp) if(c == '\n' || c == '\r') 1310: 0f b6 45 ef movzbl -0x11(%ebp),%eax 1314: 3c 0a cmp $0xa,%al 1316: 74 16 je 132e <gets+0x61> 1318: 0f b6 45 ef movzbl -0x11(%ebp),%eax 131c: 3c 0d cmp $0xd,%al 131e: 74 0e je 132e <gets+0x61> gets(char *buf, int max) { int i, cc; char c; for(i=0; i+1 < max; ){ 1320: 8b 45 f0 mov -0x10(%ebp),%eax 1323: 83 c0 01 add $0x1,%eax 1326: 3b 45 0c cmp 0xc(%ebp),%eax 1329: 7c b1 jl 12dc <gets+0xf> 132b: eb 01 jmp 132e <gets+0x61> cc = read(0, &c, 1); if(cc < 1) break; 132d: 90 nop buf[i++] = c; if(c == '\n' || c == '\r') break; } buf[i] = '\0'; 132e: 8b 45 f0 mov -0x10(%ebp),%eax 1331: 03 45 08 add 0x8(%ebp),%eax 1334: c6 00 00 movb $0x0,(%eax) return buf; 1337: 8b 45 08 mov 0x8(%ebp),%eax } 133a: c9 leave 133b: c3 ret 0000133c <stat>: int stat(char *n, struct stat *st) { 133c: 55 push %ebp 133d: 89 e5 mov %esp,%ebp 133f: 83 ec 28 sub $0x28,%esp int fd; int r; fd = open(n, O_RDONLY); 1342: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 1349: 00 134a: 8b 45 08 mov 0x8(%ebp),%eax 134d: 89 04 24 mov %eax,(%esp) 1350: e8 07 01 00 00 call 145c <open> 1355: 89 45 f0 mov %eax,-0x10(%ebp) if(fd < 0) 1358: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 135c: 79 07 jns 1365 <stat+0x29> return -1; 135e: b8 ff ff ff ff mov $0xffffffff,%eax 1363: eb 23 jmp 1388 <stat+0x4c> r = fstat(fd, st); 1365: 8b 45 0c mov 0xc(%ebp),%eax 1368: 89 44 24 04 mov %eax,0x4(%esp) 136c: 8b 45 f0 mov -0x10(%ebp),%eax 136f: 89 04 24 mov %eax,(%esp) 1372: e8 fd 00 00 00 call 1474 <fstat> 1377: 89 45 f4 mov %eax,-0xc(%ebp) close(fd); 137a: 8b 45 f0 mov -0x10(%ebp),%eax 137d: 89 04 24 mov %eax,(%esp) 1380: e8 bf 00 00 00 call 1444 <close> return r; 1385: 8b 45 f4 mov -0xc(%ebp),%eax } 1388: c9 leave 1389: c3 ret 0000138a <atoi>: int atoi(const char *s) { 138a: 55 push %ebp 138b: 89 e5 mov %esp,%ebp 138d: 83 ec 10 sub $0x10,%esp int n; n = 0; 1390: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) while('0' <= *s && *s <= '9') 1397: eb 24 jmp 13bd <atoi+0x33> n = n*10 + *s++ - '0'; 1399: 8b 55 fc mov -0x4(%ebp),%edx 139c: 89 d0 mov %edx,%eax 139e: c1 e0 02 shl $0x2,%eax 13a1: 01 d0 add %edx,%eax 13a3: 01 c0 add %eax,%eax 13a5: 89 c2 mov %eax,%edx 13a7: 8b 45 08 mov 0x8(%ebp),%eax 13aa: 0f b6 00 movzbl (%eax),%eax 13ad: 0f be c0 movsbl %al,%eax 13b0: 8d 04 02 lea (%edx,%eax,1),%eax 13b3: 83 e8 30 sub $0x30,%eax 13b6: 89 45 fc mov %eax,-0x4(%ebp) 13b9: 83 45 08 01 addl $0x1,0x8(%ebp) atoi(const char *s) { int n; n = 0; while('0' <= *s && *s <= '9') 13bd: 8b 45 08 mov 0x8(%ebp),%eax 13c0: 0f b6 00 movzbl (%eax),%eax 13c3: 3c 2f cmp $0x2f,%al 13c5: 7e 0a jle 13d1 <atoi+0x47> 13c7: 8b 45 08 mov 0x8(%ebp),%eax 13ca: 0f b6 00 movzbl (%eax),%eax 13cd: 3c 39 cmp $0x39,%al 13cf: 7e c8 jle 1399 <atoi+0xf> n = n*10 + *s++ - '0'; return n; 13d1: 8b 45 fc mov -0x4(%ebp),%eax } 13d4: c9 leave 13d5: c3 ret 000013d6 <memmove>: void* memmove(void *vdst, void *vsrc, int n) { 13d6: 55 push %ebp 13d7: 89 e5 mov %esp,%ebp 13d9: 83 ec 10 sub $0x10,%esp char *dst, *src; dst = vdst; 13dc: 8b 45 08 mov 0x8(%ebp),%eax 13df: 89 45 f8 mov %eax,-0x8(%ebp) src = vsrc; 13e2: 8b 45 0c mov 0xc(%ebp),%eax 13e5: 89 45 fc mov %eax,-0x4(%ebp) while(n-- > 0) 13e8: eb 13 jmp 13fd <memmove+0x27> *dst++ = *src++; 13ea: 8b 45 fc mov -0x4(%ebp),%eax 13ed: 0f b6 10 movzbl (%eax),%edx 13f0: 8b 45 f8 mov -0x8(%ebp),%eax 13f3: 88 10 mov %dl,(%eax) 13f5: 83 45 f8 01 addl $0x1,-0x8(%ebp) 13f9: 83 45 fc 01 addl $0x1,-0x4(%ebp) { char *dst, *src; dst = vdst; src = vsrc; while(n-- > 0) 13fd: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 1401: 0f 9f c0 setg %al 1404: 83 6d 10 01 subl $0x1,0x10(%ebp) 1408: 84 c0 test %al,%al 140a: 75 de jne 13ea <memmove+0x14> *dst++ = *src++; return vdst; 140c: 8b 45 08 mov 0x8(%ebp),%eax } 140f: c9 leave 1410: c3 ret 1411: 90 nop 1412: 90 nop 1413: 90 nop 00001414 <fork>: name: \ movl $SYS_ ## name, %eax; \ int $T_SYSCALL; \ ret SYSCALL(fork) 1414: b8 01 00 00 00 mov $0x1,%eax 1419: cd 40 int $0x40 141b: c3 ret 0000141c <exit>: SYSCALL(exit) 141c: b8 02 00 00 00 mov $0x2,%eax 1421: cd 40 int $0x40 1423: c3 ret 00001424 <wait>: SYSCALL(wait) 1424: b8 03 00 00 00 mov $0x3,%eax 1429: cd 40 int $0x40 142b: c3 ret 0000142c <pipe>: SYSCALL(pipe) 142c: b8 04 00 00 00 mov $0x4,%eax 1431: cd 40 int $0x40 1433: c3 ret 00001434 <read>: SYSCALL(read) 1434: b8 05 00 00 00 mov $0x5,%eax 1439: cd 40 int $0x40 143b: c3 ret 0000143c <write>: SYSCALL(write) 143c: b8 10 00 00 00 mov $0x10,%eax 1441: cd 40 int $0x40 1443: c3 ret 00001444 <close>: SYSCALL(close) 1444: b8 15 00 00 00 mov $0x15,%eax 1449: cd 40 int $0x40 144b: c3 ret 0000144c <kill>: SYSCALL(kill) 144c: b8 06 00 00 00 mov $0x6,%eax 1451: cd 40 int $0x40 1453: c3 ret 00001454 <exec>: SYSCALL(exec) 1454: b8 07 00 00 00 mov $0x7,%eax 1459: cd 40 int $0x40 145b: c3 ret 0000145c <open>: SYSCALL(open) 145c: b8 0f 00 00 00 mov $0xf,%eax 1461: cd 40 int $0x40 1463: c3 ret 00001464 <mknod>: SYSCALL(mknod) 1464: b8 11 00 00 00 mov $0x11,%eax 1469: cd 40 int $0x40 146b: c3 ret 0000146c <unlink>: SYSCALL(unlink) 146c: b8 12 00 00 00 mov $0x12,%eax 1471: cd 40 int $0x40 1473: c3 ret 00001474 <fstat>: SYSCALL(fstat) 1474: b8 08 00 00 00 mov $0x8,%eax 1479: cd 40 int $0x40 147b: c3 ret 0000147c <link>: SYSCALL(link) 147c: b8 13 00 00 00 mov $0x13,%eax 1481: cd 40 int $0x40 1483: c3 ret 00001484 <mkdir>: SYSCALL(mkdir) 1484: b8 14 00 00 00 mov $0x14,%eax 1489: cd 40 int $0x40 148b: c3 ret 0000148c <chdir>: SYSCALL(chdir) 148c: b8 09 00 00 00 mov $0x9,%eax 1491: cd 40 int $0x40 1493: c3 ret 00001494 <dup>: SYSCALL(dup) 1494: b8 0a 00 00 00 mov $0xa,%eax 1499: cd 40 int $0x40 149b: c3 ret 0000149c <getpid>: SYSCALL(getpid) 149c: b8 0b 00 00 00 mov $0xb,%eax 14a1: cd 40 int $0x40 14a3: c3 ret 000014a4 <sbrk>: SYSCALL(sbrk) 14a4: b8 0c 00 00 00 mov $0xc,%eax 14a9: cd 40 int $0x40 14ab: c3 ret 000014ac <sleep>: SYSCALL(sleep) 14ac: b8 0d 00 00 00 mov $0xd,%eax 14b1: cd 40 int $0x40 14b3: c3 ret 000014b4 <uptime>: SYSCALL(uptime) 14b4: b8 0e 00 00 00 mov $0xe,%eax 14b9: cd 40 int $0x40 14bb: c3 ret 000014bc <clone>: SYSCALL(clone) 14bc: b8 16 00 00 00 mov $0x16,%eax 14c1: cd 40 int $0x40 14c3: c3 ret 000014c4 <texit>: SYSCALL(texit) 14c4: b8 17 00 00 00 mov $0x17,%eax 14c9: cd 40 int $0x40 14cb: c3 ret 000014cc <tsleep>: SYSCALL(tsleep) 14cc: b8 18 00 00 00 mov $0x18,%eax 14d1: cd 40 int $0x40 14d3: c3 ret 000014d4 <twakeup>: SYSCALL(twakeup) 14d4: b8 19 00 00 00 mov $0x19,%eax 14d9: cd 40 int $0x40 14db: c3 ret 000014dc <thread_yield>: SYSCALL(thread_yield) 14dc: b8 1a 00 00 00 mov $0x1a,%eax 14e1: cd 40 int $0x40 14e3: c3 ret 000014e4 <putc>: #include "stat.h" #include "user.h" static void putc(int fd, char c) { 14e4: 55 push %ebp 14e5: 89 e5 mov %esp,%ebp 14e7: 83 ec 28 sub $0x28,%esp 14ea: 8b 45 0c mov 0xc(%ebp),%eax 14ed: 88 45 f4 mov %al,-0xc(%ebp) write(fd, &c, 1); 14f0: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp) 14f7: 00 14f8: 8d 45 f4 lea -0xc(%ebp),%eax 14fb: 89 44 24 04 mov %eax,0x4(%esp) 14ff: 8b 45 08 mov 0x8(%ebp),%eax 1502: 89 04 24 mov %eax,(%esp) 1505: e8 32 ff ff ff call 143c <write> } 150a: c9 leave 150b: c3 ret 0000150c <printint>: static void printint(int fd, int xx, int base, int sgn) { 150c: 55 push %ebp 150d: 89 e5 mov %esp,%ebp 150f: 53 push %ebx 1510: 83 ec 44 sub $0x44,%esp static char digits[] = "0123456789ABCDEF"; char buf[16]; int i, neg; uint x; neg = 0; 1513: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) if(sgn && xx < 0){ 151a: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 151e: 74 17 je 1537 <printint+0x2b> 1520: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 1524: 79 11 jns 1537 <printint+0x2b> neg = 1; 1526: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp) x = -xx; 152d: 8b 45 0c mov 0xc(%ebp),%eax 1530: f7 d8 neg %eax 1532: 89 45 f4 mov %eax,-0xc(%ebp) char buf[16]; int i, neg; uint x; neg = 0; if(sgn && xx < 0){ 1535: eb 06 jmp 153d <printint+0x31> neg = 1; x = -xx; } else { x = xx; 1537: 8b 45 0c mov 0xc(%ebp),%eax 153a: 89 45 f4 mov %eax,-0xc(%ebp) } i = 0; 153d: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) do{ buf[i++] = digits[x % base]; 1544: 8b 4d ec mov -0x14(%ebp),%ecx 1547: 8b 5d 10 mov 0x10(%ebp),%ebx 154a: 8b 45 f4 mov -0xc(%ebp),%eax 154d: ba 00 00 00 00 mov $0x0,%edx 1552: f7 f3 div %ebx 1554: 89 d0 mov %edx,%eax 1556: 0f b6 80 2c 1d 00 00 movzbl 0x1d2c(%eax),%eax 155d: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1) 1561: 83 45 ec 01 addl $0x1,-0x14(%ebp) }while((x /= base) != 0); 1565: 8b 45 10 mov 0x10(%ebp),%eax 1568: 89 45 d4 mov %eax,-0x2c(%ebp) 156b: 8b 45 f4 mov -0xc(%ebp),%eax 156e: ba 00 00 00 00 mov $0x0,%edx 1573: f7 75 d4 divl -0x2c(%ebp) 1576: 89 45 f4 mov %eax,-0xc(%ebp) 1579: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 157d: 75 c5 jne 1544 <printint+0x38> if(neg) 157f: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 1583: 74 28 je 15ad <printint+0xa1> buf[i++] = '-'; 1585: 8b 45 ec mov -0x14(%ebp),%eax 1588: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1) 158d: 83 45 ec 01 addl $0x1,-0x14(%ebp) while(--i >= 0) 1591: eb 1a jmp 15ad <printint+0xa1> putc(fd, buf[i]); 1593: 8b 45 ec mov -0x14(%ebp),%eax 1596: 0f b6 44 05 dc movzbl -0x24(%ebp,%eax,1),%eax 159b: 0f be c0 movsbl %al,%eax 159e: 89 44 24 04 mov %eax,0x4(%esp) 15a2: 8b 45 08 mov 0x8(%ebp),%eax 15a5: 89 04 24 mov %eax,(%esp) 15a8: e8 37 ff ff ff call 14e4 <putc> buf[i++] = digits[x % base]; }while((x /= base) != 0); if(neg) buf[i++] = '-'; while(--i >= 0) 15ad: 83 6d ec 01 subl $0x1,-0x14(%ebp) 15b1: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 15b5: 79 dc jns 1593 <printint+0x87> putc(fd, buf[i]); } 15b7: 83 c4 44 add $0x44,%esp 15ba: 5b pop %ebx 15bb: 5d pop %ebp 15bc: c3 ret 000015bd <printf>: // Print to the given fd. Only understands %d, %x, %p, %s. void printf(int fd, char *fmt, ...) { 15bd: 55 push %ebp 15be: 89 e5 mov %esp,%ebp 15c0: 83 ec 38 sub $0x38,%esp char *s; int c, i, state; uint *ap; state = 0; 15c3: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) ap = (uint*)(void*)&fmt + 1; 15ca: 8d 45 0c lea 0xc(%ebp),%eax 15cd: 83 c0 04 add $0x4,%eax 15d0: 89 45 f4 mov %eax,-0xc(%ebp) for(i = 0; fmt[i]; i++){ 15d3: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) 15da: e9 7e 01 00 00 jmp 175d <printf+0x1a0> c = fmt[i] & 0xff; 15df: 8b 55 0c mov 0xc(%ebp),%edx 15e2: 8b 45 ec mov -0x14(%ebp),%eax 15e5: 8d 04 02 lea (%edx,%eax,1),%eax 15e8: 0f b6 00 movzbl (%eax),%eax 15eb: 0f be c0 movsbl %al,%eax 15ee: 25 ff 00 00 00 and $0xff,%eax 15f3: 89 45 e8 mov %eax,-0x18(%ebp) if(state == 0){ 15f6: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 15fa: 75 2c jne 1628 <printf+0x6b> if(c == '%'){ 15fc: 83 7d e8 25 cmpl $0x25,-0x18(%ebp) 1600: 75 0c jne 160e <printf+0x51> state = '%'; 1602: c7 45 f0 25 00 00 00 movl $0x25,-0x10(%ebp) 1609: e9 4b 01 00 00 jmp 1759 <printf+0x19c> } else { putc(fd, c); 160e: 8b 45 e8 mov -0x18(%ebp),%eax 1611: 0f be c0 movsbl %al,%eax 1614: 89 44 24 04 mov %eax,0x4(%esp) 1618: 8b 45 08 mov 0x8(%ebp),%eax 161b: 89 04 24 mov %eax,(%esp) 161e: e8 c1 fe ff ff call 14e4 <putc> 1623: e9 31 01 00 00 jmp 1759 <printf+0x19c> } } else if(state == '%'){ 1628: 83 7d f0 25 cmpl $0x25,-0x10(%ebp) 162c: 0f 85 27 01 00 00 jne 1759 <printf+0x19c> if(c == 'd'){ 1632: 83 7d e8 64 cmpl $0x64,-0x18(%ebp) 1636: 75 2d jne 1665 <printf+0xa8> printint(fd, *ap, 10, 1); 1638: 8b 45 f4 mov -0xc(%ebp),%eax 163b: 8b 00 mov (%eax),%eax 163d: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp) 1644: 00 1645: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp) 164c: 00 164d: 89 44 24 04 mov %eax,0x4(%esp) 1651: 8b 45 08 mov 0x8(%ebp),%eax 1654: 89 04 24 mov %eax,(%esp) 1657: e8 b0 fe ff ff call 150c <printint> ap++; 165c: 83 45 f4 04 addl $0x4,-0xc(%ebp) 1660: e9 ed 00 00 00 jmp 1752 <printf+0x195> } else if(c == 'x' || c == 'p'){ 1665: 83 7d e8 78 cmpl $0x78,-0x18(%ebp) 1669: 74 06 je 1671 <printf+0xb4> 166b: 83 7d e8 70 cmpl $0x70,-0x18(%ebp) 166f: 75 2d jne 169e <printf+0xe1> printint(fd, *ap, 16, 0); 1671: 8b 45 f4 mov -0xc(%ebp),%eax 1674: 8b 00 mov (%eax),%eax 1676: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp) 167d: 00 167e: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 1685: 00 1686: 89 44 24 04 mov %eax,0x4(%esp) 168a: 8b 45 08 mov 0x8(%ebp),%eax 168d: 89 04 24 mov %eax,(%esp) 1690: e8 77 fe ff ff call 150c <printint> ap++; 1695: 83 45 f4 04 addl $0x4,-0xc(%ebp) } } else if(state == '%'){ if(c == 'd'){ printint(fd, *ap, 10, 1); ap++; } else if(c == 'x' || c == 'p'){ 1699: e9 b4 00 00 00 jmp 1752 <printf+0x195> printint(fd, *ap, 16, 0); ap++; } else if(c == 's'){ 169e: 83 7d e8 73 cmpl $0x73,-0x18(%ebp) 16a2: 75 46 jne 16ea <printf+0x12d> s = (char*)*ap; 16a4: 8b 45 f4 mov -0xc(%ebp),%eax 16a7: 8b 00 mov (%eax),%eax 16a9: 89 45 e4 mov %eax,-0x1c(%ebp) ap++; 16ac: 83 45 f4 04 addl $0x4,-0xc(%ebp) if(s == 0) 16b0: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 16b4: 75 27 jne 16dd <printf+0x120> s = "(null)"; 16b6: c7 45 e4 f6 1c 00 00 movl $0x1cf6,-0x1c(%ebp) while(*s != 0){ 16bd: eb 1f jmp 16de <printf+0x121> putc(fd, *s); 16bf: 8b 45 e4 mov -0x1c(%ebp),%eax 16c2: 0f b6 00 movzbl (%eax),%eax 16c5: 0f be c0 movsbl %al,%eax 16c8: 89 44 24 04 mov %eax,0x4(%esp) 16cc: 8b 45 08 mov 0x8(%ebp),%eax 16cf: 89 04 24 mov %eax,(%esp) 16d2: e8 0d fe ff ff call 14e4 <putc> s++; 16d7: 83 45 e4 01 addl $0x1,-0x1c(%ebp) 16db: eb 01 jmp 16de <printf+0x121> } else if(c == 's'){ s = (char*)*ap; ap++; if(s == 0) s = "(null)"; while(*s != 0){ 16dd: 90 nop 16de: 8b 45 e4 mov -0x1c(%ebp),%eax 16e1: 0f b6 00 movzbl (%eax),%eax 16e4: 84 c0 test %al,%al 16e6: 75 d7 jne 16bf <printf+0x102> 16e8: eb 68 jmp 1752 <printf+0x195> putc(fd, *s); s++; } } else if(c == 'c'){ 16ea: 83 7d e8 63 cmpl $0x63,-0x18(%ebp) 16ee: 75 1d jne 170d <printf+0x150> putc(fd, *ap); 16f0: 8b 45 f4 mov -0xc(%ebp),%eax 16f3: 8b 00 mov (%eax),%eax 16f5: 0f be c0 movsbl %al,%eax 16f8: 89 44 24 04 mov %eax,0x4(%esp) 16fc: 8b 45 08 mov 0x8(%ebp),%eax 16ff: 89 04 24 mov %eax,(%esp) 1702: e8 dd fd ff ff call 14e4 <putc> ap++; 1707: 83 45 f4 04 addl $0x4,-0xc(%ebp) 170b: eb 45 jmp 1752 <printf+0x195> } else if(c == '%'){ 170d: 83 7d e8 25 cmpl $0x25,-0x18(%ebp) 1711: 75 17 jne 172a <printf+0x16d> putc(fd, c); 1713: 8b 45 e8 mov -0x18(%ebp),%eax 1716: 0f be c0 movsbl %al,%eax 1719: 89 44 24 04 mov %eax,0x4(%esp) 171d: 8b 45 08 mov 0x8(%ebp),%eax 1720: 89 04 24 mov %eax,(%esp) 1723: e8 bc fd ff ff call 14e4 <putc> 1728: eb 28 jmp 1752 <printf+0x195> } else { // Unknown % sequence. Print it to draw attention. putc(fd, '%'); 172a: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp) 1731: 00 1732: 8b 45 08 mov 0x8(%ebp),%eax 1735: 89 04 24 mov %eax,(%esp) 1738: e8 a7 fd ff ff call 14e4 <putc> putc(fd, c); 173d: 8b 45 e8 mov -0x18(%ebp),%eax 1740: 0f be c0 movsbl %al,%eax 1743: 89 44 24 04 mov %eax,0x4(%esp) 1747: 8b 45 08 mov 0x8(%ebp),%eax 174a: 89 04 24 mov %eax,(%esp) 174d: e8 92 fd ff ff call 14e4 <putc> } state = 0; 1752: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) int c, i, state; uint *ap; state = 0; ap = (uint*)(void*)&fmt + 1; for(i = 0; fmt[i]; i++){ 1759: 83 45 ec 01 addl $0x1,-0x14(%ebp) 175d: 8b 55 0c mov 0xc(%ebp),%edx 1760: 8b 45 ec mov -0x14(%ebp),%eax 1763: 8d 04 02 lea (%edx,%eax,1),%eax 1766: 0f b6 00 movzbl (%eax),%eax 1769: 84 c0 test %al,%al 176b: 0f 85 6e fe ff ff jne 15df <printf+0x22> putc(fd, c); } state = 0; } } } 1771: c9 leave 1772: c3 ret 1773: 90 nop 00001774 <free>: static Header base; static Header *freep; void free(void *ap) { 1774: 55 push %ebp 1775: 89 e5 mov %esp,%ebp 1777: 83 ec 10 sub $0x10,%esp Header *bp, *p; bp = (Header*)ap - 1; 177a: 8b 45 08 mov 0x8(%ebp),%eax 177d: 83 e8 08 sub $0x8,%eax 1780: 89 45 f8 mov %eax,-0x8(%ebp) for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 1783: a1 4c 1d 00 00 mov 0x1d4c,%eax 1788: 89 45 fc mov %eax,-0x4(%ebp) 178b: eb 24 jmp 17b1 <free+0x3d> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) 178d: 8b 45 fc mov -0x4(%ebp),%eax 1790: 8b 00 mov (%eax),%eax 1792: 3b 45 fc cmp -0x4(%ebp),%eax 1795: 77 12 ja 17a9 <free+0x35> 1797: 8b 45 f8 mov -0x8(%ebp),%eax 179a: 3b 45 fc cmp -0x4(%ebp),%eax 179d: 77 24 ja 17c3 <free+0x4f> 179f: 8b 45 fc mov -0x4(%ebp),%eax 17a2: 8b 00 mov (%eax),%eax 17a4: 3b 45 f8 cmp -0x8(%ebp),%eax 17a7: 77 1a ja 17c3 <free+0x4f> free(void *ap) { Header *bp, *p; bp = (Header*)ap - 1; for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) 17a9: 8b 45 fc mov -0x4(%ebp),%eax 17ac: 8b 00 mov (%eax),%eax 17ae: 89 45 fc mov %eax,-0x4(%ebp) 17b1: 8b 45 f8 mov -0x8(%ebp),%eax 17b4: 3b 45 fc cmp -0x4(%ebp),%eax 17b7: 76 d4 jbe 178d <free+0x19> 17b9: 8b 45 fc mov -0x4(%ebp),%eax 17bc: 8b 00 mov (%eax),%eax 17be: 3b 45 f8 cmp -0x8(%ebp),%eax 17c1: 76 ca jbe 178d <free+0x19> if(p >= p->s.ptr && (bp > p || bp < p->s.ptr)) break; if(bp + bp->s.size == p->s.ptr){ 17c3: 8b 45 f8 mov -0x8(%ebp),%eax 17c6: 8b 40 04 mov 0x4(%eax),%eax 17c9: c1 e0 03 shl $0x3,%eax 17cc: 89 c2 mov %eax,%edx 17ce: 03 55 f8 add -0x8(%ebp),%edx 17d1: 8b 45 fc mov -0x4(%ebp),%eax 17d4: 8b 00 mov (%eax),%eax 17d6: 39 c2 cmp %eax,%edx 17d8: 75 24 jne 17fe <free+0x8a> bp->s.size += p->s.ptr->s.size; 17da: 8b 45 f8 mov -0x8(%ebp),%eax 17dd: 8b 50 04 mov 0x4(%eax),%edx 17e0: 8b 45 fc mov -0x4(%ebp),%eax 17e3: 8b 00 mov (%eax),%eax 17e5: 8b 40 04 mov 0x4(%eax),%eax 17e8: 01 c2 add %eax,%edx 17ea: 8b 45 f8 mov -0x8(%ebp),%eax 17ed: 89 50 04 mov %edx,0x4(%eax) bp->s.ptr = p->s.ptr->s.ptr; 17f0: 8b 45 fc mov -0x4(%ebp),%eax 17f3: 8b 00 mov (%eax),%eax 17f5: 8b 10 mov (%eax),%edx 17f7: 8b 45 f8 mov -0x8(%ebp),%eax 17fa: 89 10 mov %edx,(%eax) 17fc: eb 0a jmp 1808 <free+0x94> } else bp->s.ptr = p->s.ptr; 17fe: 8b 45 fc mov -0x4(%ebp),%eax 1801: 8b 10 mov (%eax),%edx 1803: 8b 45 f8 mov -0x8(%ebp),%eax 1806: 89 10 mov %edx,(%eax) if(p + p->s.size == bp){ 1808: 8b 45 fc mov -0x4(%ebp),%eax 180b: 8b 40 04 mov 0x4(%eax),%eax 180e: c1 e0 03 shl $0x3,%eax 1811: 03 45 fc add -0x4(%ebp),%eax 1814: 3b 45 f8 cmp -0x8(%ebp),%eax 1817: 75 20 jne 1839 <free+0xc5> p->s.size += bp->s.size; 1819: 8b 45 fc mov -0x4(%ebp),%eax 181c: 8b 50 04 mov 0x4(%eax),%edx 181f: 8b 45 f8 mov -0x8(%ebp),%eax 1822: 8b 40 04 mov 0x4(%eax),%eax 1825: 01 c2 add %eax,%edx 1827: 8b 45 fc mov -0x4(%ebp),%eax 182a: 89 50 04 mov %edx,0x4(%eax) p->s.ptr = bp->s.ptr; 182d: 8b 45 f8 mov -0x8(%ebp),%eax 1830: 8b 10 mov (%eax),%edx 1832: 8b 45 fc mov -0x4(%ebp),%eax 1835: 89 10 mov %edx,(%eax) 1837: eb 08 jmp 1841 <free+0xcd> } else p->s.ptr = bp; 1839: 8b 45 fc mov -0x4(%ebp),%eax 183c: 8b 55 f8 mov -0x8(%ebp),%edx 183f: 89 10 mov %edx,(%eax) freep = p; 1841: 8b 45 fc mov -0x4(%ebp),%eax 1844: a3 4c 1d 00 00 mov %eax,0x1d4c } 1849: c9 leave 184a: c3 ret 0000184b <morecore>: static Header* morecore(uint nu) { 184b: 55 push %ebp 184c: 89 e5 mov %esp,%ebp 184e: 83 ec 28 sub $0x28,%esp char *p; Header *hp; if(nu < 4096) 1851: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp) 1858: 77 07 ja 1861 <morecore+0x16> nu = 4096; 185a: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp) p = sbrk(nu * sizeof(Header)); 1861: 8b 45 08 mov 0x8(%ebp),%eax 1864: c1 e0 03 shl $0x3,%eax 1867: 89 04 24 mov %eax,(%esp) 186a: e8 35 fc ff ff call 14a4 <sbrk> 186f: 89 45 f0 mov %eax,-0x10(%ebp) if(p == (char*)-1) 1872: 83 7d f0 ff cmpl $0xffffffff,-0x10(%ebp) 1876: 75 07 jne 187f <morecore+0x34> return 0; 1878: b8 00 00 00 00 mov $0x0,%eax 187d: eb 22 jmp 18a1 <morecore+0x56> hp = (Header*)p; 187f: 8b 45 f0 mov -0x10(%ebp),%eax 1882: 89 45 f4 mov %eax,-0xc(%ebp) hp->s.size = nu; 1885: 8b 45 f4 mov -0xc(%ebp),%eax 1888: 8b 55 08 mov 0x8(%ebp),%edx 188b: 89 50 04 mov %edx,0x4(%eax) free((void*)(hp + 1)); 188e: 8b 45 f4 mov -0xc(%ebp),%eax 1891: 83 c0 08 add $0x8,%eax 1894: 89 04 24 mov %eax,(%esp) 1897: e8 d8 fe ff ff call 1774 <free> return freep; 189c: a1 4c 1d 00 00 mov 0x1d4c,%eax } 18a1: c9 leave 18a2: c3 ret 000018a3 <malloc>: void* malloc(uint nbytes) { 18a3: 55 push %ebp 18a4: 89 e5 mov %esp,%ebp 18a6: 83 ec 28 sub $0x28,%esp Header *p, *prevp; uint nunits; nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; 18a9: 8b 45 08 mov 0x8(%ebp),%eax 18ac: 83 c0 07 add $0x7,%eax 18af: c1 e8 03 shr $0x3,%eax 18b2: 83 c0 01 add $0x1,%eax 18b5: 89 45 f4 mov %eax,-0xc(%ebp) if((prevp = freep) == 0){ 18b8: a1 4c 1d 00 00 mov 0x1d4c,%eax 18bd: 89 45 f0 mov %eax,-0x10(%ebp) 18c0: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 18c4: 75 23 jne 18e9 <malloc+0x46> base.s.ptr = freep = prevp = &base; 18c6: c7 45 f0 44 1d 00 00 movl $0x1d44,-0x10(%ebp) 18cd: 8b 45 f0 mov -0x10(%ebp),%eax 18d0: a3 4c 1d 00 00 mov %eax,0x1d4c 18d5: a1 4c 1d 00 00 mov 0x1d4c,%eax 18da: a3 44 1d 00 00 mov %eax,0x1d44 base.s.size = 0; 18df: c7 05 48 1d 00 00 00 movl $0x0,0x1d48 18e6: 00 00 00 } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 18e9: 8b 45 f0 mov -0x10(%ebp),%eax 18ec: 8b 00 mov (%eax),%eax 18ee: 89 45 ec mov %eax,-0x14(%ebp) if(p->s.size >= nunits){ 18f1: 8b 45 ec mov -0x14(%ebp),%eax 18f4: 8b 40 04 mov 0x4(%eax),%eax 18f7: 3b 45 f4 cmp -0xc(%ebp),%eax 18fa: 72 4d jb 1949 <malloc+0xa6> if(p->s.size == nunits) 18fc: 8b 45 ec mov -0x14(%ebp),%eax 18ff: 8b 40 04 mov 0x4(%eax),%eax 1902: 3b 45 f4 cmp -0xc(%ebp),%eax 1905: 75 0c jne 1913 <malloc+0x70> prevp->s.ptr = p->s.ptr; 1907: 8b 45 ec mov -0x14(%ebp),%eax 190a: 8b 10 mov (%eax),%edx 190c: 8b 45 f0 mov -0x10(%ebp),%eax 190f: 89 10 mov %edx,(%eax) 1911: eb 26 jmp 1939 <malloc+0x96> else { p->s.size -= nunits; 1913: 8b 45 ec mov -0x14(%ebp),%eax 1916: 8b 40 04 mov 0x4(%eax),%eax 1919: 89 c2 mov %eax,%edx 191b: 2b 55 f4 sub -0xc(%ebp),%edx 191e: 8b 45 ec mov -0x14(%ebp),%eax 1921: 89 50 04 mov %edx,0x4(%eax) p += p->s.size; 1924: 8b 45 ec mov -0x14(%ebp),%eax 1927: 8b 40 04 mov 0x4(%eax),%eax 192a: c1 e0 03 shl $0x3,%eax 192d: 01 45 ec add %eax,-0x14(%ebp) p->s.size = nunits; 1930: 8b 45 ec mov -0x14(%ebp),%eax 1933: 8b 55 f4 mov -0xc(%ebp),%edx 1936: 89 50 04 mov %edx,0x4(%eax) } freep = prevp; 1939: 8b 45 f0 mov -0x10(%ebp),%eax 193c: a3 4c 1d 00 00 mov %eax,0x1d4c return (void*)(p + 1); 1941: 8b 45 ec mov -0x14(%ebp),%eax 1944: 83 c0 08 add $0x8,%eax 1947: eb 38 jmp 1981 <malloc+0xde> } if(p == freep) 1949: a1 4c 1d 00 00 mov 0x1d4c,%eax 194e: 39 45 ec cmp %eax,-0x14(%ebp) 1951: 75 1b jne 196e <malloc+0xcb> if((p = morecore(nunits)) == 0) 1953: 8b 45 f4 mov -0xc(%ebp),%eax 1956: 89 04 24 mov %eax,(%esp) 1959: e8 ed fe ff ff call 184b <morecore> 195e: 89 45 ec mov %eax,-0x14(%ebp) 1961: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 1965: 75 07 jne 196e <malloc+0xcb> return 0; 1967: b8 00 00 00 00 mov $0x0,%eax 196c: eb 13 jmp 1981 <malloc+0xde> nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1; if((prevp = freep) == 0){ base.s.ptr = freep = prevp = &base; base.s.size = 0; } for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){ 196e: 8b 45 ec mov -0x14(%ebp),%eax 1971: 89 45 f0 mov %eax,-0x10(%ebp) 1974: 8b 45 ec mov -0x14(%ebp),%eax 1977: 8b 00 mov (%eax),%eax 1979: 89 45 ec mov %eax,-0x14(%ebp) return (void*)(p + 1); } if(p == freep) if((p = morecore(nunits)) == 0) return 0; } 197c: e9 70 ff ff ff jmp 18f1 <malloc+0x4e> } 1981: c9 leave 1982: c3 ret 1983: 90 nop 00001984 <xchg>: asm volatile("sti"); } static inline uint xchg(volatile uint *addr, uint newval) { 1984: 55 push %ebp 1985: 89 e5 mov %esp,%ebp 1987: 83 ec 10 sub $0x10,%esp uint result; // The + in "+m" denotes a read-modify-write operand. asm volatile("lock; xchgl %0, %1" : 198a: 8b 55 08 mov 0x8(%ebp),%edx 198d: 8b 45 0c mov 0xc(%ebp),%eax 1990: 8b 4d 08 mov 0x8(%ebp),%ecx 1993: f0 87 02 lock xchg %eax,(%edx) 1996: 89 45 fc mov %eax,-0x4(%ebp) "+m" (*addr), "=a" (result) : "1" (newval) : "cc"); return result; 1999: 8b 45 fc mov -0x4(%ebp),%eax } 199c: c9 leave 199d: c3 ret 0000199e <lock_init>: #include "x86.h" #include "proc.h" unsigned long rands = 1; void lock_init(lock_t *lock){ 199e: 55 push %ebp 199f: 89 e5 mov %esp,%ebp lock->locked = 0; 19a1: 8b 45 08 mov 0x8(%ebp),%eax 19a4: c7 00 00 00 00 00 movl $0x0,(%eax) } 19aa: 5d pop %ebp 19ab: c3 ret 000019ac <lock_acquire>: void lock_acquire(lock_t *lock){ 19ac: 55 push %ebp 19ad: 89 e5 mov %esp,%ebp 19af: 83 ec 08 sub $0x8,%esp while(xchg(&lock->locked,1) != 0); 19b2: 8b 45 08 mov 0x8(%ebp),%eax 19b5: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) 19bc: 00 19bd: 89 04 24 mov %eax,(%esp) 19c0: e8 bf ff ff ff call 1984 <xchg> 19c5: 85 c0 test %eax,%eax 19c7: 75 e9 jne 19b2 <lock_acquire+0x6> } 19c9: c9 leave 19ca: c3 ret 000019cb <lock_release>: void lock_release(lock_t *lock){ 19cb: 55 push %ebp 19cc: 89 e5 mov %esp,%ebp 19ce: 83 ec 08 sub $0x8,%esp xchg(&lock->locked,0); 19d1: 8b 45 08 mov 0x8(%ebp),%eax 19d4: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp) 19db: 00 19dc: 89 04 24 mov %eax,(%esp) 19df: e8 a0 ff ff ff call 1984 <xchg> } 19e4: c9 leave 19e5: c3 ret 000019e6 <thread_create>: void *thread_create(void(*start_routine)(void*), void *arg){ 19e6: 55 push %ebp 19e7: 89 e5 mov %esp,%ebp 19e9: 83 ec 28 sub $0x28,%esp int tid; void * stack = malloc(2 * 4096); 19ec: c7 04 24 00 20 00 00 movl $0x2000,(%esp) 19f3: e8 ab fe ff ff call 18a3 <malloc> 19f8: 89 45 f0 mov %eax,-0x10(%ebp) void *garbage_stack = stack; 19fb: 8b 45 f0 mov -0x10(%ebp),%eax 19fe: 89 45 f4 mov %eax,-0xc(%ebp) // printf(1,"start routine addr : %d\n",(uint)start_routine); if((uint)stack % 4096){ 1a01: 8b 45 f0 mov -0x10(%ebp),%eax 1a04: 25 ff 0f 00 00 and $0xfff,%eax 1a09: 85 c0 test %eax,%eax 1a0b: 74 15 je 1a22 <thread_create+0x3c> stack = stack + (4096 - (uint)stack % 4096); 1a0d: 8b 45 f0 mov -0x10(%ebp),%eax 1a10: 89 c2 mov %eax,%edx 1a12: 81 e2 ff 0f 00 00 and $0xfff,%edx 1a18: b8 00 10 00 00 mov $0x1000,%eax 1a1d: 29 d0 sub %edx,%eax 1a1f: 01 45 f0 add %eax,-0x10(%ebp) } if (stack == 0){ 1a22: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 1a26: 75 1b jne 1a43 <thread_create+0x5d> printf(1,"malloc fail \n"); 1a28: c7 44 24 04 fd 1c 00 movl $0x1cfd,0x4(%esp) 1a2f: 00 1a30: c7 04 24 01 00 00 00 movl $0x1,(%esp) 1a37: e8 81 fb ff ff call 15bd <printf> return 0; 1a3c: b8 00 00 00 00 mov $0x0,%eax 1a41: eb 6f jmp 1ab2 <thread_create+0xcc> } tid = clone((uint)stack,PSIZE,(uint)start_routine,(int)arg); 1a43: 8b 4d 0c mov 0xc(%ebp),%ecx 1a46: 8b 55 08 mov 0x8(%ebp),%edx 1a49: 8b 45 f0 mov -0x10(%ebp),%eax 1a4c: 89 4c 24 0c mov %ecx,0xc(%esp) 1a50: 89 54 24 08 mov %edx,0x8(%esp) 1a54: c7 44 24 04 00 10 00 movl $0x1000,0x4(%esp) 1a5b: 00 1a5c: 89 04 24 mov %eax,(%esp) 1a5f: e8 58 fa ff ff call 14bc <clone> 1a64: 89 45 ec mov %eax,-0x14(%ebp) if(tid < 0){ 1a67: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 1a6b: 79 1b jns 1a88 <thread_create+0xa2> printf(1,"clone fails\n"); 1a6d: c7 44 24 04 0b 1d 00 movl $0x1d0b,0x4(%esp) 1a74: 00 1a75: c7 04 24 01 00 00 00 movl $0x1,(%esp) 1a7c: e8 3c fb ff ff call 15bd <printf> return 0; 1a81: b8 00 00 00 00 mov $0x0,%eax 1a86: eb 2a jmp 1ab2 <thread_create+0xcc> } if(tid > 0){ 1a88: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 1a8c: 7e 05 jle 1a93 <thread_create+0xad> //store threads on thread table return garbage_stack; 1a8e: 8b 45 f4 mov -0xc(%ebp),%eax 1a91: eb 1f jmp 1ab2 <thread_create+0xcc> } if(tid == 0){ 1a93: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 1a97: 75 14 jne 1aad <thread_create+0xc7> printf(1,"tid = 0 return \n"); 1a99: c7 44 24 04 18 1d 00 movl $0x1d18,0x4(%esp) 1aa0: 00 1aa1: c7 04 24 01 00 00 00 movl $0x1,(%esp) 1aa8: e8 10 fb ff ff call 15bd <printf> } // wait(); // free(garbage_stack); return 0; 1aad: b8 00 00 00 00 mov $0x0,%eax } 1ab2: c9 leave 1ab3: c3 ret 00001ab4 <random>: // generate 0 -> max random number exclude max. int random(int max){ 1ab4: 55 push %ebp 1ab5: 89 e5 mov %esp,%ebp rands = rands * 1664525 + 1013904233; 1ab7: a1 40 1d 00 00 mov 0x1d40,%eax 1abc: 69 c0 0d 66 19 00 imul $0x19660d,%eax,%eax 1ac2: 05 69 f3 6e 3c add $0x3c6ef369,%eax 1ac7: a3 40 1d 00 00 mov %eax,0x1d40 return (int)(rands % max); 1acc: a1 40 1d 00 00 mov 0x1d40,%eax 1ad1: 8b 4d 08 mov 0x8(%ebp),%ecx 1ad4: ba 00 00 00 00 mov $0x0,%edx 1ad9: f7 f1 div %ecx 1adb: 89 d0 mov %edx,%eax } 1add: 5d pop %ebp 1ade: c3 ret 1adf: 90 nop 00001ae0 <init_q>: #include "queue.h" #include "types.h" #include "user.h" void init_q(struct queue *q){ 1ae0: 55 push %ebp 1ae1: 89 e5 mov %esp,%ebp q->size = 0; 1ae3: 8b 45 08 mov 0x8(%ebp),%eax 1ae6: c7 00 00 00 00 00 movl $0x0,(%eax) q->head = 0; 1aec: 8b 45 08 mov 0x8(%ebp),%eax 1aef: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) q->tail = 0; 1af6: 8b 45 08 mov 0x8(%ebp),%eax 1af9: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } 1b00: 5d pop %ebp 1b01: c3 ret 00001b02 <add_q>: void add_q(struct queue *q, int v){ 1b02: 55 push %ebp 1b03: 89 e5 mov %esp,%ebp 1b05: 83 ec 28 sub $0x28,%esp struct node * n = malloc(sizeof(struct node)); 1b08: c7 04 24 08 00 00 00 movl $0x8,(%esp) 1b0f: e8 8f fd ff ff call 18a3 <malloc> 1b14: 89 45 f4 mov %eax,-0xc(%ebp) n->next = 0; 1b17: 8b 45 f4 mov -0xc(%ebp),%eax 1b1a: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) n->value = v; 1b21: 8b 45 f4 mov -0xc(%ebp),%eax 1b24: 8b 55 0c mov 0xc(%ebp),%edx 1b27: 89 10 mov %edx,(%eax) if(q->head == 0){ 1b29: 8b 45 08 mov 0x8(%ebp),%eax 1b2c: 8b 40 04 mov 0x4(%eax),%eax 1b2f: 85 c0 test %eax,%eax 1b31: 75 0b jne 1b3e <add_q+0x3c> q->head = n; 1b33: 8b 45 08 mov 0x8(%ebp),%eax 1b36: 8b 55 f4 mov -0xc(%ebp),%edx 1b39: 89 50 04 mov %edx,0x4(%eax) 1b3c: eb 0c jmp 1b4a <add_q+0x48> }else{ q->tail->next = n; 1b3e: 8b 45 08 mov 0x8(%ebp),%eax 1b41: 8b 40 08 mov 0x8(%eax),%eax 1b44: 8b 55 f4 mov -0xc(%ebp),%edx 1b47: 89 50 04 mov %edx,0x4(%eax) } q->tail = n; 1b4a: 8b 45 08 mov 0x8(%ebp),%eax 1b4d: 8b 55 f4 mov -0xc(%ebp),%edx 1b50: 89 50 08 mov %edx,0x8(%eax) q->size++; 1b53: 8b 45 08 mov 0x8(%ebp),%eax 1b56: 8b 00 mov (%eax),%eax 1b58: 8d 50 01 lea 0x1(%eax),%edx 1b5b: 8b 45 08 mov 0x8(%ebp),%eax 1b5e: 89 10 mov %edx,(%eax) } 1b60: c9 leave 1b61: c3 ret 00001b62 <empty_q>: int empty_q(struct queue *q){ 1b62: 55 push %ebp 1b63: 89 e5 mov %esp,%ebp if(q->size == 0) 1b65: 8b 45 08 mov 0x8(%ebp),%eax 1b68: 8b 00 mov (%eax),%eax 1b6a: 85 c0 test %eax,%eax 1b6c: 75 07 jne 1b75 <empty_q+0x13> return 1; 1b6e: b8 01 00 00 00 mov $0x1,%eax 1b73: eb 05 jmp 1b7a <empty_q+0x18> else return 0; 1b75: b8 00 00 00 00 mov $0x0,%eax } 1b7a: 5d pop %ebp 1b7b: c3 ret 00001b7c <pop_q>: int pop_q(struct queue *q){ 1b7c: 55 push %ebp 1b7d: 89 e5 mov %esp,%ebp 1b7f: 83 ec 28 sub $0x28,%esp int val; struct node *destroy; if(!empty_q(q)){ 1b82: 8b 45 08 mov 0x8(%ebp),%eax 1b85: 89 04 24 mov %eax,(%esp) 1b88: e8 d5 ff ff ff call 1b62 <empty_q> 1b8d: 85 c0 test %eax,%eax 1b8f: 75 5d jne 1bee <pop_q+0x72> val = q->head->value; 1b91: 8b 45 08 mov 0x8(%ebp),%eax 1b94: 8b 40 04 mov 0x4(%eax),%eax 1b97: 8b 00 mov (%eax),%eax 1b99: 89 45 f0 mov %eax,-0x10(%ebp) destroy = q->head; 1b9c: 8b 45 08 mov 0x8(%ebp),%eax 1b9f: 8b 40 04 mov 0x4(%eax),%eax 1ba2: 89 45 f4 mov %eax,-0xc(%ebp) q->head = q->head->next; 1ba5: 8b 45 08 mov 0x8(%ebp),%eax 1ba8: 8b 40 04 mov 0x4(%eax),%eax 1bab: 8b 50 04 mov 0x4(%eax),%edx 1bae: 8b 45 08 mov 0x8(%ebp),%eax 1bb1: 89 50 04 mov %edx,0x4(%eax) free(destroy); 1bb4: 8b 45 f4 mov -0xc(%ebp),%eax 1bb7: 89 04 24 mov %eax,(%esp) 1bba: e8 b5 fb ff ff call 1774 <free> q->size--; 1bbf: 8b 45 08 mov 0x8(%ebp),%eax 1bc2: 8b 00 mov (%eax),%eax 1bc4: 8d 50 ff lea -0x1(%eax),%edx 1bc7: 8b 45 08 mov 0x8(%ebp),%eax 1bca: 89 10 mov %edx,(%eax) if(q->size == 0){ 1bcc: 8b 45 08 mov 0x8(%ebp),%eax 1bcf: 8b 00 mov (%eax),%eax 1bd1: 85 c0 test %eax,%eax 1bd3: 75 14 jne 1be9 <pop_q+0x6d> q->head = 0; 1bd5: 8b 45 08 mov 0x8(%ebp),%eax 1bd8: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) q->tail = 0; 1bdf: 8b 45 08 mov 0x8(%ebp),%eax 1be2: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) } return val; 1be9: 8b 45 f0 mov -0x10(%ebp),%eax 1bec: eb 05 jmp 1bf3 <pop_q+0x77> } return -1; 1bee: b8 ff ff ff ff mov $0xffffffff,%eax } 1bf3: c9 leave 1bf4: c3 ret 1bf5: 90 nop 1bf6: 90 nop 1bf7: 90 nop 00001bf8 <sem_acquire>: #include "semaphore.h" void sem_acquire(struct Semaphore *s) { 1bf8: 55 push %ebp 1bf9: 89 e5 mov %esp,%ebp 1bfb: 83 ec 18 sub $0x18,%esp lock_acquire(&s->lock); 1bfe: 8b 45 08 mov 0x8(%ebp),%eax 1c01: 89 04 24 mov %eax,(%esp) 1c04: e8 a3 fd ff ff call 19ac <lock_acquire> s->count--; 1c09: 8b 45 08 mov 0x8(%ebp),%eax 1c0c: 8b 40 04 mov 0x4(%eax),%eax 1c0f: 8d 50 ff lea -0x1(%eax),%edx 1c12: 8b 45 08 mov 0x8(%ebp),%eax 1c15: 89 50 04 mov %edx,0x4(%eax) if( s->count < 0) 1c18: 8b 45 08 mov 0x8(%ebp),%eax 1c1b: 8b 40 04 mov 0x4(%eax),%eax 1c1e: 85 c0 test %eax,%eax 1c20: 79 27 jns 1c49 <sem_acquire+0x51> { add_q(&s->q, getpid()); 1c22: e8 75 f8 ff ff call 149c <getpid> 1c27: 8b 55 08 mov 0x8(%ebp),%edx 1c2a: 83 c2 08 add $0x8,%edx 1c2d: 89 44 24 04 mov %eax,0x4(%esp) 1c31: 89 14 24 mov %edx,(%esp) 1c34: e8 c9 fe ff ff call 1b02 <add_q> lock_release(&s->lock); 1c39: 8b 45 08 mov 0x8(%ebp),%eax 1c3c: 89 04 24 mov %eax,(%esp) 1c3f: e8 87 fd ff ff call 19cb <lock_release> tsleep(); 1c44: e8 83 f8 ff ff call 14cc <tsleep> } lock_release(&s->lock); 1c49: 8b 45 08 mov 0x8(%ebp),%eax 1c4c: 89 04 24 mov %eax,(%esp) 1c4f: e8 77 fd ff ff call 19cb <lock_release> } 1c54: c9 leave 1c55: c3 ret 00001c56 <sem_signal>: void sem_signal(struct Semaphore *s) { 1c56: 55 push %ebp 1c57: 89 e5 mov %esp,%ebp 1c59: 83 ec 28 sub $0x28,%esp lock_acquire(&s->lock); 1c5c: 8b 45 08 mov 0x8(%ebp),%eax 1c5f: 89 04 24 mov %eax,(%esp) 1c62: e8 45 fd ff ff call 19ac <lock_acquire> s->count++; 1c67: 8b 45 08 mov 0x8(%ebp),%eax 1c6a: 8b 40 04 mov 0x4(%eax),%eax 1c6d: 8d 50 01 lea 0x1(%eax),%edx 1c70: 8b 45 08 mov 0x8(%ebp),%eax 1c73: 89 50 04 mov %edx,0x4(%eax) if( s->count <= 0) 1c76: 8b 45 08 mov 0x8(%ebp),%eax 1c79: 8b 40 04 mov 0x4(%eax),%eax 1c7c: 85 c0 test %eax,%eax 1c7e: 7f 1c jg 1c9c <sem_signal+0x46> { int tid = pop_q(&s->q); 1c80: 8b 45 08 mov 0x8(%ebp),%eax 1c83: 83 c0 08 add $0x8,%eax 1c86: 89 04 24 mov %eax,(%esp) 1c89: e8 ee fe ff ff call 1b7c <pop_q> 1c8e: 89 45 f4 mov %eax,-0xc(%ebp) twakeup(tid); 1c91: 8b 45 f4 mov -0xc(%ebp),%eax 1c94: 89 04 24 mov %eax,(%esp) 1c97: e8 38 f8 ff ff call 14d4 <twakeup> } lock_release(&s->lock); 1c9c: 8b 45 08 mov 0x8(%ebp),%eax 1c9f: 89 04 24 mov %eax,(%esp) 1ca2: e8 24 fd ff ff call 19cb <lock_release> } 1ca7: c9 leave 1ca8: c3 ret 00001ca9 <sem_init>: void sem_init(struct Semaphore *s, int size){ 1ca9: 55 push %ebp 1caa: 89 e5 mov %esp,%ebp 1cac: 83 ec 18 sub $0x18,%esp lock_init(&s->lock); 1caf: 8b 45 08 mov 0x8(%ebp),%eax 1cb2: 89 04 24 mov %eax,(%esp) 1cb5: e8 e4 fc ff ff call 199e <lock_init> s->count = size; 1cba: 8b 45 08 mov 0x8(%ebp),%eax 1cbd: 8b 55 0c mov 0xc(%ebp),%edx 1cc0: 89 50 04 mov %edx,0x4(%eax) init_q(&s->q); 1cc3: 8b 45 08 mov 0x8(%ebp),%eax 1cc6: 83 c0 08 add $0x8,%eax 1cc9: 89 04 24 mov %eax,(%esp) 1ccc: e8 0f fe ff ff call 1ae0 <init_q> } 1cd1: c9 leave 1cd2: c3 ret
36.549469
64
0.430376
4aa1d2c7d65daf054a15efe9ef97e86013292ba1
565,750
asm
Assembly
kernel/kernel.asm
airaShrestha/xv6Modification
bb2e2799da71b0e66e6a390fa147fd964c460efd
[ "MIT-0" ]
null
null
null
kernel/kernel.asm
airaShrestha/xv6Modification
bb2e2799da71b0e66e6a390fa147fd964c460efd
[ "MIT-0" ]
null
null
null
kernel/kernel.asm
airaShrestha/xv6Modification
bb2e2799da71b0e66e6a390fa147fd964c460efd
[ "MIT-0" ]
null
null
null
kernel/kernel: file format elf64-littleriscv Disassembly of section .text: 0000000080000000 <_entry>: 80000000: 00009117 auipc sp,0x9 80000004: 96013103 ld sp,-1696(sp) # 80008960 <_GLOBAL_OFFSET_TABLE_+0x8> 80000008: 6505 lui a0,0x1 8000000a: f14025f3 csrr a1,mhartid 8000000e: 0585 addi a1,a1,1 80000010: 02b50533 mul a0,a0,a1 80000014: 912a add sp,sp,a0 80000016: 078000ef jal ra,8000008e <start> 000000008000001a <spin>: 8000001a: a001 j 8000001a <spin> 000000008000001c <timerinit>: // which arrive at timervec in kernelvec.S, // which turns them into software interrupts for // devintr() in trap.c. void timerinit() { 8000001c: 1141 addi sp,sp,-16 8000001e: e422 sd s0,8(sp) 80000020: 0800 addi s0,sp,16 // which hart (core) is this? static inline uint64 r_mhartid() { uint64 x; asm volatile("csrr %0, mhartid" : "=r" (x) ); 80000022: f14027f3 csrr a5,mhartid // each CPU has a separate source of timer interrupts. int id = r_mhartid(); 80000026: 0007869b sext.w a3,a5 // ask the CLINT for a timer interrupt. int interval = 1000000; // cycles; about 1/10th second in qemu. *(uint64*)CLINT_MTIMECMP(id) = *(uint64*)CLINT_MTIME + interval; 8000002a: 0037979b slliw a5,a5,0x3 8000002e: 02004737 lui a4,0x2004 80000032: 97ba add a5,a5,a4 80000034: 0200c737 lui a4,0x200c 80000038: ff873583 ld a1,-8(a4) # 200bff8 <_entry-0x7dff4008> 8000003c: 000f4637 lui a2,0xf4 80000040: 24060613 addi a2,a2,576 # f4240 <_entry-0x7ff0bdc0> 80000044: 95b2 add a1,a1,a2 80000046: e38c sd a1,0(a5) // prepare information in scratch[] for timervec. // scratch[0..2] : space for timervec to save registers. // scratch[3] : address of CLINT MTIMECMP register. // scratch[4] : desired interval (in cycles) between timer interrupts. uint64 *scratch = &timer_scratch[id][0]; 80000048: 00269713 slli a4,a3,0x2 8000004c: 9736 add a4,a4,a3 8000004e: 00371693 slli a3,a4,0x3 80000052: 00009717 auipc a4,0x9 80000056: fee70713 addi a4,a4,-18 # 80009040 <timer_scratch> 8000005a: 9736 add a4,a4,a3 scratch[3] = CLINT_MTIMECMP(id); 8000005c: ef1c sd a5,24(a4) scratch[4] = interval; 8000005e: f310 sd a2,32(a4) } static inline void w_mscratch(uint64 x) { asm volatile("csrw mscratch, %0" : : "r" (x)); 80000060: 34071073 csrw mscratch,a4 asm volatile("csrw mtvec, %0" : : "r" (x)); 80000064: 00006797 auipc a5,0x6 80000068: ecc78793 addi a5,a5,-308 # 80005f30 <timervec> 8000006c: 30579073 csrw mtvec,a5 asm volatile("csrr %0, mstatus" : "=r" (x) ); 80000070: 300027f3 csrr a5,mstatus // set the machine-mode trap handler. w_mtvec((uint64)timervec); // enable machine-mode interrupts. w_mstatus(r_mstatus() | MSTATUS_MIE); 80000074: 0087e793 ori a5,a5,8 asm volatile("csrw mstatus, %0" : : "r" (x)); 80000078: 30079073 csrw mstatus,a5 asm volatile("csrr %0, mie" : "=r" (x) ); 8000007c: 304027f3 csrr a5,mie // enable machine-mode timer interrupts. w_mie(r_mie() | MIE_MTIE); 80000080: 0807e793 ori a5,a5,128 asm volatile("csrw mie, %0" : : "r" (x)); 80000084: 30479073 csrw mie,a5 } 80000088: 6422 ld s0,8(sp) 8000008a: 0141 addi sp,sp,16 8000008c: 8082 ret 000000008000008e <start>: { 8000008e: 1141 addi sp,sp,-16 80000090: e406 sd ra,8(sp) 80000092: e022 sd s0,0(sp) 80000094: 0800 addi s0,sp,16 asm volatile("csrr %0, mstatus" : "=r" (x) ); 80000096: 300027f3 csrr a5,mstatus x &= ~MSTATUS_MPP_MASK; 8000009a: 7779 lui a4,0xffffe 8000009c: 7ff70713 addi a4,a4,2047 # ffffffffffffe7ff <end+0xffffffff7ffd77ff> 800000a0: 8ff9 and a5,a5,a4 x |= MSTATUS_MPP_S; 800000a2: 6705 lui a4,0x1 800000a4: 80070713 addi a4,a4,-2048 # 800 <_entry-0x7ffff800> 800000a8: 8fd9 or a5,a5,a4 asm volatile("csrw mstatus, %0" : : "r" (x)); 800000aa: 30079073 csrw mstatus,a5 asm volatile("csrw mepc, %0" : : "r" (x)); 800000ae: 00001797 auipc a5,0x1 800000b2: de078793 addi a5,a5,-544 # 80000e8e <main> 800000b6: 34179073 csrw mepc,a5 asm volatile("csrw satp, %0" : : "r" (x)); 800000ba: 4781 li a5,0 800000bc: 18079073 csrw satp,a5 asm volatile("csrw medeleg, %0" : : "r" (x)); 800000c0: 67c1 lui a5,0x10 800000c2: 17fd addi a5,a5,-1 800000c4: 30279073 csrw medeleg,a5 asm volatile("csrw mideleg, %0" : : "r" (x)); 800000c8: 30379073 csrw mideleg,a5 asm volatile("csrr %0, sie" : "=r" (x) ); 800000cc: 104027f3 csrr a5,sie w_sie(r_sie() | SIE_SEIE | SIE_STIE | SIE_SSIE); 800000d0: 2227e793 ori a5,a5,546 asm volatile("csrw sie, %0" : : "r" (x)); 800000d4: 10479073 csrw sie,a5 asm volatile("csrw pmpaddr0, %0" : : "r" (x)); 800000d8: 57fd li a5,-1 800000da: 83a9 srli a5,a5,0xa 800000dc: 3b079073 csrw pmpaddr0,a5 asm volatile("csrw pmpcfg0, %0" : : "r" (x)); 800000e0: 47bd li a5,15 800000e2: 3a079073 csrw pmpcfg0,a5 timerinit(); 800000e6: 00000097 auipc ra,0x0 800000ea: f36080e7 jalr -202(ra) # 8000001c <timerinit> asm volatile("csrr %0, mhartid" : "=r" (x) ); 800000ee: f14027f3 csrr a5,mhartid w_tp(id); 800000f2: 2781 sext.w a5,a5 } static inline void w_tp(uint64 x) { asm volatile("mv tp, %0" : : "r" (x)); 800000f4: 823e mv tp,a5 asm volatile("mret"); 800000f6: 30200073 mret } 800000fa: 60a2 ld ra,8(sp) 800000fc: 6402 ld s0,0(sp) 800000fe: 0141 addi sp,sp,16 80000100: 8082 ret 0000000080000102 <consolewrite>: // // user write()s to the console go here. // int consolewrite(int user_src, uint64 src, int n) { 80000102: 715d addi sp,sp,-80 80000104: e486 sd ra,72(sp) 80000106: e0a2 sd s0,64(sp) 80000108: fc26 sd s1,56(sp) 8000010a: f84a sd s2,48(sp) 8000010c: f44e sd s3,40(sp) 8000010e: f052 sd s4,32(sp) 80000110: ec56 sd s5,24(sp) 80000112: 0880 addi s0,sp,80 int i; for(i = 0; i < n; i++){ 80000114: 04c05663 blez a2,80000160 <consolewrite+0x5e> 80000118: 8a2a mv s4,a0 8000011a: 84ae mv s1,a1 8000011c: 89b2 mv s3,a2 8000011e: 4901 li s2,0 char c; if(either_copyin(&c, user_src, src+i, 1) == -1) 80000120: 5afd li s5,-1 80000122: 4685 li a3,1 80000124: 8626 mv a2,s1 80000126: 85d2 mv a1,s4 80000128: fbf40513 addi a0,s0,-65 8000012c: 00002097 auipc ra,0x2 80000130: 348080e7 jalr 840(ra) # 80002474 <either_copyin> 80000134: 01550c63 beq a0,s5,8000014c <consolewrite+0x4a> break; uartputc(c); 80000138: fbf44503 lbu a0,-65(s0) 8000013c: 00000097 auipc ra,0x0 80000140: 78e080e7 jalr 1934(ra) # 800008ca <uartputc> for(i = 0; i < n; i++){ 80000144: 2905 addiw s2,s2,1 80000146: 0485 addi s1,s1,1 80000148: fd299de3 bne s3,s2,80000122 <consolewrite+0x20> } return i; } 8000014c: 854a mv a0,s2 8000014e: 60a6 ld ra,72(sp) 80000150: 6406 ld s0,64(sp) 80000152: 74e2 ld s1,56(sp) 80000154: 7942 ld s2,48(sp) 80000156: 79a2 ld s3,40(sp) 80000158: 7a02 ld s4,32(sp) 8000015a: 6ae2 ld s5,24(sp) 8000015c: 6161 addi sp,sp,80 8000015e: 8082 ret for(i = 0; i < n; i++){ 80000160: 4901 li s2,0 80000162: b7ed j 8000014c <consolewrite+0x4a> 0000000080000164 <consoleread>: // user_dist indicates whether dst is a user // or kernel address. // int consoleread(int user_dst, uint64 dst, int n) { 80000164: 7119 addi sp,sp,-128 80000166: fc86 sd ra,120(sp) 80000168: f8a2 sd s0,112(sp) 8000016a: f4a6 sd s1,104(sp) 8000016c: f0ca sd s2,96(sp) 8000016e: ecce sd s3,88(sp) 80000170: e8d2 sd s4,80(sp) 80000172: e4d6 sd s5,72(sp) 80000174: e0da sd s6,64(sp) 80000176: fc5e sd s7,56(sp) 80000178: f862 sd s8,48(sp) 8000017a: f466 sd s9,40(sp) 8000017c: f06a sd s10,32(sp) 8000017e: ec6e sd s11,24(sp) 80000180: 0100 addi s0,sp,128 80000182: 8b2a mv s6,a0 80000184: 8aae mv s5,a1 80000186: 8a32 mv s4,a2 uint target; int c; char cbuf; target = n; 80000188: 00060b9b sext.w s7,a2 acquire(&cons.lock); 8000018c: 00011517 auipc a0,0x11 80000190: ff450513 addi a0,a0,-12 # 80011180 <cons> 80000194: 00001097 auipc ra,0x1 80000198: a50080e7 jalr -1456(ra) # 80000be4 <acquire> while(n > 0){ // wait until interrupt handler has put some // input into cons.buffer. while(cons.r == cons.w){ 8000019c: 00011497 auipc s1,0x11 800001a0: fe448493 addi s1,s1,-28 # 80011180 <cons> if(myproc()->killed){ release(&cons.lock); return -1; } sleep(&cons.r, &cons.lock); 800001a4: 89a6 mv s3,s1 800001a6: 00011917 auipc s2,0x11 800001aa: 07290913 addi s2,s2,114 # 80011218 <cons+0x98> } c = cons.buf[cons.r++ % INPUT_BUF]; if(c == C('D')){ // end-of-file 800001ae: 4c91 li s9,4 break; } // copy the input byte to the user-space buffer. cbuf = c; if(either_copyout(user_dst, dst, &cbuf, 1) == -1) 800001b0: 5d7d li s10,-1 break; dst++; --n; if(c == '\n'){ 800001b2: 4da9 li s11,10 while(n > 0){ 800001b4: 07405863 blez s4,80000224 <consoleread+0xc0> while(cons.r == cons.w){ 800001b8: 0984a783 lw a5,152(s1) 800001bc: 09c4a703 lw a4,156(s1) 800001c0: 02f71463 bne a4,a5,800001e8 <consoleread+0x84> if(myproc()->killed){ 800001c4: 00001097 auipc ra,0x1 800001c8: 7f2080e7 jalr 2034(ra) # 800019b6 <myproc> 800001cc: 551c lw a5,40(a0) 800001ce: e7b5 bnez a5,8000023a <consoleread+0xd6> sleep(&cons.r, &cons.lock); 800001d0: 85ce mv a1,s3 800001d2: 854a mv a0,s2 800001d4: 00002097 auipc ra,0x2 800001d8: ea6080e7 jalr -346(ra) # 8000207a <sleep> while(cons.r == cons.w){ 800001dc: 0984a783 lw a5,152(s1) 800001e0: 09c4a703 lw a4,156(s1) 800001e4: fef700e3 beq a4,a5,800001c4 <consoleread+0x60> c = cons.buf[cons.r++ % INPUT_BUF]; 800001e8: 0017871b addiw a4,a5,1 800001ec: 08e4ac23 sw a4,152(s1) 800001f0: 07f7f713 andi a4,a5,127 800001f4: 9726 add a4,a4,s1 800001f6: 01874703 lbu a4,24(a4) 800001fa: 00070c1b sext.w s8,a4 if(c == C('D')){ // end-of-file 800001fe: 079c0663 beq s8,s9,8000026a <consoleread+0x106> cbuf = c; 80000202: f8e407a3 sb a4,-113(s0) if(either_copyout(user_dst, dst, &cbuf, 1) == -1) 80000206: 4685 li a3,1 80000208: f8f40613 addi a2,s0,-113 8000020c: 85d6 mv a1,s5 8000020e: 855a mv a0,s6 80000210: 00002097 auipc ra,0x2 80000214: 20e080e7 jalr 526(ra) # 8000241e <either_copyout> 80000218: 01a50663 beq a0,s10,80000224 <consoleread+0xc0> dst++; 8000021c: 0a85 addi s5,s5,1 --n; 8000021e: 3a7d addiw s4,s4,-1 if(c == '\n'){ 80000220: f9bc1ae3 bne s8,s11,800001b4 <consoleread+0x50> // a whole line has arrived, return to // the user-level read(). break; } } release(&cons.lock); 80000224: 00011517 auipc a0,0x11 80000228: f5c50513 addi a0,a0,-164 # 80011180 <cons> 8000022c: 00001097 auipc ra,0x1 80000230: a6c080e7 jalr -1428(ra) # 80000c98 <release> return target - n; 80000234: 414b853b subw a0,s7,s4 80000238: a811 j 8000024c <consoleread+0xe8> release(&cons.lock); 8000023a: 00011517 auipc a0,0x11 8000023e: f4650513 addi a0,a0,-186 # 80011180 <cons> 80000242: 00001097 auipc ra,0x1 80000246: a56080e7 jalr -1450(ra) # 80000c98 <release> return -1; 8000024a: 557d li a0,-1 } 8000024c: 70e6 ld ra,120(sp) 8000024e: 7446 ld s0,112(sp) 80000250: 74a6 ld s1,104(sp) 80000252: 7906 ld s2,96(sp) 80000254: 69e6 ld s3,88(sp) 80000256: 6a46 ld s4,80(sp) 80000258: 6aa6 ld s5,72(sp) 8000025a: 6b06 ld s6,64(sp) 8000025c: 7be2 ld s7,56(sp) 8000025e: 7c42 ld s8,48(sp) 80000260: 7ca2 ld s9,40(sp) 80000262: 7d02 ld s10,32(sp) 80000264: 6de2 ld s11,24(sp) 80000266: 6109 addi sp,sp,128 80000268: 8082 ret if(n < target){ 8000026a: 000a071b sext.w a4,s4 8000026e: fb777be3 bgeu a4,s7,80000224 <consoleread+0xc0> cons.r--; 80000272: 00011717 auipc a4,0x11 80000276: faf72323 sw a5,-90(a4) # 80011218 <cons+0x98> 8000027a: b76d j 80000224 <consoleread+0xc0> 000000008000027c <consputc>: { 8000027c: 1141 addi sp,sp,-16 8000027e: e406 sd ra,8(sp) 80000280: e022 sd s0,0(sp) 80000282: 0800 addi s0,sp,16 if(c == BACKSPACE){ 80000284: 10000793 li a5,256 80000288: 00f50a63 beq a0,a5,8000029c <consputc+0x20> uartputc_sync(c); 8000028c: 00000097 auipc ra,0x0 80000290: 564080e7 jalr 1380(ra) # 800007f0 <uartputc_sync> } 80000294: 60a2 ld ra,8(sp) 80000296: 6402 ld s0,0(sp) 80000298: 0141 addi sp,sp,16 8000029a: 8082 ret uartputc_sync('\b'); uartputc_sync(' '); uartputc_sync('\b'); 8000029c: 4521 li a0,8 8000029e: 00000097 auipc ra,0x0 800002a2: 552080e7 jalr 1362(ra) # 800007f0 <uartputc_sync> 800002a6: 02000513 li a0,32 800002aa: 00000097 auipc ra,0x0 800002ae: 546080e7 jalr 1350(ra) # 800007f0 <uartputc_sync> 800002b2: 4521 li a0,8 800002b4: 00000097 auipc ra,0x0 800002b8: 53c080e7 jalr 1340(ra) # 800007f0 <uartputc_sync> 800002bc: bfe1 j 80000294 <consputc+0x18> 00000000800002be <consoleintr>: // do erase/kill processing, append to cons.buf, // wake up consoleread() if a whole line has arrived. // void consoleintr(int c) { 800002be: 1101 addi sp,sp,-32 800002c0: ec06 sd ra,24(sp) 800002c2: e822 sd s0,16(sp) 800002c4: e426 sd s1,8(sp) 800002c6: e04a sd s2,0(sp) 800002c8: 1000 addi s0,sp,32 800002ca: 84aa mv s1,a0 acquire(&cons.lock); 800002cc: 00011517 auipc a0,0x11 800002d0: eb450513 addi a0,a0,-332 # 80011180 <cons> 800002d4: 00001097 auipc ra,0x1 800002d8: 910080e7 jalr -1776(ra) # 80000be4 <acquire> switch(c){ 800002dc: 47d5 li a5,21 800002de: 0af48663 beq s1,a5,8000038a <consoleintr+0xcc> 800002e2: 0297ca63 blt a5,s1,80000316 <consoleintr+0x58> 800002e6: 47a1 li a5,8 800002e8: 0ef48763 beq s1,a5,800003d6 <consoleintr+0x118> 800002ec: 47c1 li a5,16 800002ee: 10f49a63 bne s1,a5,80000402 <consoleintr+0x144> case C('P'): // Print process list. procdump(); 800002f2: 00002097 auipc ra,0x2 800002f6: 1fa080e7 jalr 506(ra) # 800024ec <procdump> } } break; } release(&cons.lock); 800002fa: 00011517 auipc a0,0x11 800002fe: e8650513 addi a0,a0,-378 # 80011180 <cons> 80000302: 00001097 auipc ra,0x1 80000306: 996080e7 jalr -1642(ra) # 80000c98 <release> } 8000030a: 60e2 ld ra,24(sp) 8000030c: 6442 ld s0,16(sp) 8000030e: 64a2 ld s1,8(sp) 80000310: 6902 ld s2,0(sp) 80000312: 6105 addi sp,sp,32 80000314: 8082 ret switch(c){ 80000316: 07f00793 li a5,127 8000031a: 0af48e63 beq s1,a5,800003d6 <consoleintr+0x118> if(c != 0 && cons.e-cons.r < INPUT_BUF){ 8000031e: 00011717 auipc a4,0x11 80000322: e6270713 addi a4,a4,-414 # 80011180 <cons> 80000326: 0a072783 lw a5,160(a4) 8000032a: 09872703 lw a4,152(a4) 8000032e: 9f99 subw a5,a5,a4 80000330: 07f00713 li a4,127 80000334: fcf763e3 bltu a4,a5,800002fa <consoleintr+0x3c> c = (c == '\r') ? '\n' : c; 80000338: 47b5 li a5,13 8000033a: 0cf48763 beq s1,a5,80000408 <consoleintr+0x14a> consputc(c); 8000033e: 8526 mv a0,s1 80000340: 00000097 auipc ra,0x0 80000344: f3c080e7 jalr -196(ra) # 8000027c <consputc> cons.buf[cons.e++ % INPUT_BUF] = c; 80000348: 00011797 auipc a5,0x11 8000034c: e3878793 addi a5,a5,-456 # 80011180 <cons> 80000350: 0a07a703 lw a4,160(a5) 80000354: 0017069b addiw a3,a4,1 80000358: 0006861b sext.w a2,a3 8000035c: 0ad7a023 sw a3,160(a5) 80000360: 07f77713 andi a4,a4,127 80000364: 97ba add a5,a5,a4 80000366: 00978c23 sb s1,24(a5) if(c == '\n' || c == C('D') || cons.e == cons.r+INPUT_BUF){ 8000036a: 47a9 li a5,10 8000036c: 0cf48563 beq s1,a5,80000436 <consoleintr+0x178> 80000370: 4791 li a5,4 80000372: 0cf48263 beq s1,a5,80000436 <consoleintr+0x178> 80000376: 00011797 auipc a5,0x11 8000037a: ea27a783 lw a5,-350(a5) # 80011218 <cons+0x98> 8000037e: 0807879b addiw a5,a5,128 80000382: f6f61ce3 bne a2,a5,800002fa <consoleintr+0x3c> cons.buf[cons.e++ % INPUT_BUF] = c; 80000386: 863e mv a2,a5 80000388: a07d j 80000436 <consoleintr+0x178> while(cons.e != cons.w && 8000038a: 00011717 auipc a4,0x11 8000038e: df670713 addi a4,a4,-522 # 80011180 <cons> 80000392: 0a072783 lw a5,160(a4) 80000396: 09c72703 lw a4,156(a4) cons.buf[(cons.e-1) % INPUT_BUF] != '\n'){ 8000039a: 00011497 auipc s1,0x11 8000039e: de648493 addi s1,s1,-538 # 80011180 <cons> while(cons.e != cons.w && 800003a2: 4929 li s2,10 800003a4: f4f70be3 beq a4,a5,800002fa <consoleintr+0x3c> cons.buf[(cons.e-1) % INPUT_BUF] != '\n'){ 800003a8: 37fd addiw a5,a5,-1 800003aa: 07f7f713 andi a4,a5,127 800003ae: 9726 add a4,a4,s1 while(cons.e != cons.w && 800003b0: 01874703 lbu a4,24(a4) 800003b4: f52703e3 beq a4,s2,800002fa <consoleintr+0x3c> cons.e--; 800003b8: 0af4a023 sw a5,160(s1) consputc(BACKSPACE); 800003bc: 10000513 li a0,256 800003c0: 00000097 auipc ra,0x0 800003c4: ebc080e7 jalr -324(ra) # 8000027c <consputc> while(cons.e != cons.w && 800003c8: 0a04a783 lw a5,160(s1) 800003cc: 09c4a703 lw a4,156(s1) 800003d0: fcf71ce3 bne a4,a5,800003a8 <consoleintr+0xea> 800003d4: b71d j 800002fa <consoleintr+0x3c> if(cons.e != cons.w){ 800003d6: 00011717 auipc a4,0x11 800003da: daa70713 addi a4,a4,-598 # 80011180 <cons> 800003de: 0a072783 lw a5,160(a4) 800003e2: 09c72703 lw a4,156(a4) 800003e6: f0f70ae3 beq a4,a5,800002fa <consoleintr+0x3c> cons.e--; 800003ea: 37fd addiw a5,a5,-1 800003ec: 00011717 auipc a4,0x11 800003f0: e2f72a23 sw a5,-460(a4) # 80011220 <cons+0xa0> consputc(BACKSPACE); 800003f4: 10000513 li a0,256 800003f8: 00000097 auipc ra,0x0 800003fc: e84080e7 jalr -380(ra) # 8000027c <consputc> 80000400: bded j 800002fa <consoleintr+0x3c> if(c != 0 && cons.e-cons.r < INPUT_BUF){ 80000402: ee048ce3 beqz s1,800002fa <consoleintr+0x3c> 80000406: bf21 j 8000031e <consoleintr+0x60> consputc(c); 80000408: 4529 li a0,10 8000040a: 00000097 auipc ra,0x0 8000040e: e72080e7 jalr -398(ra) # 8000027c <consputc> cons.buf[cons.e++ % INPUT_BUF] = c; 80000412: 00011797 auipc a5,0x11 80000416: d6e78793 addi a5,a5,-658 # 80011180 <cons> 8000041a: 0a07a703 lw a4,160(a5) 8000041e: 0017069b addiw a3,a4,1 80000422: 0006861b sext.w a2,a3 80000426: 0ad7a023 sw a3,160(a5) 8000042a: 07f77713 andi a4,a4,127 8000042e: 97ba add a5,a5,a4 80000430: 4729 li a4,10 80000432: 00e78c23 sb a4,24(a5) cons.w = cons.e; 80000436: 00011797 auipc a5,0x11 8000043a: dec7a323 sw a2,-538(a5) # 8001121c <cons+0x9c> wakeup(&cons.r); 8000043e: 00011517 auipc a0,0x11 80000442: dda50513 addi a0,a0,-550 # 80011218 <cons+0x98> 80000446: 00002097 auipc ra,0x2 8000044a: dc0080e7 jalr -576(ra) # 80002206 <wakeup> 8000044e: b575 j 800002fa <consoleintr+0x3c> 0000000080000450 <consoleinit>: void consoleinit(void) { 80000450: 1141 addi sp,sp,-16 80000452: e406 sd ra,8(sp) 80000454: e022 sd s0,0(sp) 80000456: 0800 addi s0,sp,16 initlock(&cons.lock, "cons"); 80000458: 00008597 auipc a1,0x8 8000045c: bb858593 addi a1,a1,-1096 # 80008010 <etext+0x10> 80000460: 00011517 auipc a0,0x11 80000464: d2050513 addi a0,a0,-736 # 80011180 <cons> 80000468: 00000097 auipc ra,0x0 8000046c: 6ec080e7 jalr 1772(ra) # 80000b54 <initlock> uartinit(); 80000470: 00000097 auipc ra,0x0 80000474: 330080e7 jalr 816(ra) # 800007a0 <uartinit> // connect read and write system calls // to consoleread and consolewrite. devsw[CONSOLE].read = consoleread; 80000478: 00022797 auipc a5,0x22 8000047c: ba078793 addi a5,a5,-1120 # 80022018 <devsw> 80000480: 00000717 auipc a4,0x0 80000484: ce470713 addi a4,a4,-796 # 80000164 <consoleread> 80000488: eb98 sd a4,16(a5) devsw[CONSOLE].write = consolewrite; 8000048a: 00000717 auipc a4,0x0 8000048e: c7870713 addi a4,a4,-904 # 80000102 <consolewrite> 80000492: ef98 sd a4,24(a5) } 80000494: 60a2 ld ra,8(sp) 80000496: 6402 ld s0,0(sp) 80000498: 0141 addi sp,sp,16 8000049a: 8082 ret 000000008000049c <printint>: static char digits[] = "0123456789abcdef"; static void printint(int xx, int base, int sign) { 8000049c: 7179 addi sp,sp,-48 8000049e: f406 sd ra,40(sp) 800004a0: f022 sd s0,32(sp) 800004a2: ec26 sd s1,24(sp) 800004a4: e84a sd s2,16(sp) 800004a6: 1800 addi s0,sp,48 char buf[16]; int i; uint x; if(sign && (sign = xx < 0)) 800004a8: c219 beqz a2,800004ae <printint+0x12> 800004aa: 08054663 bltz a0,80000536 <printint+0x9a> x = -xx; else x = xx; 800004ae: 2501 sext.w a0,a0 800004b0: 4881 li a7,0 800004b2: fd040693 addi a3,s0,-48 i = 0; 800004b6: 4701 li a4,0 do { buf[i++] = digits[x % base]; 800004b8: 2581 sext.w a1,a1 800004ba: 00008617 auipc a2,0x8 800004be: b8660613 addi a2,a2,-1146 # 80008040 <digits> 800004c2: 883a mv a6,a4 800004c4: 2705 addiw a4,a4,1 800004c6: 02b577bb remuw a5,a0,a1 800004ca: 1782 slli a5,a5,0x20 800004cc: 9381 srli a5,a5,0x20 800004ce: 97b2 add a5,a5,a2 800004d0: 0007c783 lbu a5,0(a5) 800004d4: 00f68023 sb a5,0(a3) } while((x /= base) != 0); 800004d8: 0005079b sext.w a5,a0 800004dc: 02b5553b divuw a0,a0,a1 800004e0: 0685 addi a3,a3,1 800004e2: feb7f0e3 bgeu a5,a1,800004c2 <printint+0x26> if(sign) 800004e6: 00088b63 beqz a7,800004fc <printint+0x60> buf[i++] = '-'; 800004ea: fe040793 addi a5,s0,-32 800004ee: 973e add a4,a4,a5 800004f0: 02d00793 li a5,45 800004f4: fef70823 sb a5,-16(a4) 800004f8: 0028071b addiw a4,a6,2 while(--i >= 0) 800004fc: 02e05763 blez a4,8000052a <printint+0x8e> 80000500: fd040793 addi a5,s0,-48 80000504: 00e784b3 add s1,a5,a4 80000508: fff78913 addi s2,a5,-1 8000050c: 993a add s2,s2,a4 8000050e: 377d addiw a4,a4,-1 80000510: 1702 slli a4,a4,0x20 80000512: 9301 srli a4,a4,0x20 80000514: 40e90933 sub s2,s2,a4 consputc(buf[i]); 80000518: fff4c503 lbu a0,-1(s1) 8000051c: 00000097 auipc ra,0x0 80000520: d60080e7 jalr -672(ra) # 8000027c <consputc> while(--i >= 0) 80000524: 14fd addi s1,s1,-1 80000526: ff2499e3 bne s1,s2,80000518 <printint+0x7c> } 8000052a: 70a2 ld ra,40(sp) 8000052c: 7402 ld s0,32(sp) 8000052e: 64e2 ld s1,24(sp) 80000530: 6942 ld s2,16(sp) 80000532: 6145 addi sp,sp,48 80000534: 8082 ret x = -xx; 80000536: 40a0053b negw a0,a0 if(sign && (sign = xx < 0)) 8000053a: 4885 li a7,1 x = -xx; 8000053c: bf9d j 800004b2 <printint+0x16> 000000008000053e <panic>: release(&pr.lock); } void panic(char *s) { 8000053e: 1101 addi sp,sp,-32 80000540: ec06 sd ra,24(sp) 80000542: e822 sd s0,16(sp) 80000544: e426 sd s1,8(sp) 80000546: 1000 addi s0,sp,32 80000548: 84aa mv s1,a0 pr.locking = 0; 8000054a: 00011797 auipc a5,0x11 8000054e: ce07ab23 sw zero,-778(a5) # 80011240 <pr+0x18> printf("panic: "); 80000552: 00008517 auipc a0,0x8 80000556: ac650513 addi a0,a0,-1338 # 80008018 <etext+0x18> 8000055a: 00000097 auipc ra,0x0 8000055e: 02e080e7 jalr 46(ra) # 80000588 <printf> printf(s); 80000562: 8526 mv a0,s1 80000564: 00000097 auipc ra,0x0 80000568: 024080e7 jalr 36(ra) # 80000588 <printf> printf("\n"); 8000056c: 00008517 auipc a0,0x8 80000570: d9c50513 addi a0,a0,-612 # 80008308 <digits+0x2c8> 80000574: 00000097 auipc ra,0x0 80000578: 014080e7 jalr 20(ra) # 80000588 <printf> panicked = 1; // freeze uart output from other CPUs 8000057c: 4785 li a5,1 8000057e: 00009717 auipc a4,0x9 80000582: a8f72123 sw a5,-1406(a4) # 80009000 <panicked> for(;;) 80000586: a001 j 80000586 <panic+0x48> 0000000080000588 <printf>: { 80000588: 7131 addi sp,sp,-192 8000058a: fc86 sd ra,120(sp) 8000058c: f8a2 sd s0,112(sp) 8000058e: f4a6 sd s1,104(sp) 80000590: f0ca sd s2,96(sp) 80000592: ecce sd s3,88(sp) 80000594: e8d2 sd s4,80(sp) 80000596: e4d6 sd s5,72(sp) 80000598: e0da sd s6,64(sp) 8000059a: fc5e sd s7,56(sp) 8000059c: f862 sd s8,48(sp) 8000059e: f466 sd s9,40(sp) 800005a0: f06a sd s10,32(sp) 800005a2: ec6e sd s11,24(sp) 800005a4: 0100 addi s0,sp,128 800005a6: 8a2a mv s4,a0 800005a8: e40c sd a1,8(s0) 800005aa: e810 sd a2,16(s0) 800005ac: ec14 sd a3,24(s0) 800005ae: f018 sd a4,32(s0) 800005b0: f41c sd a5,40(s0) 800005b2: 03043823 sd a6,48(s0) 800005b6: 03143c23 sd a7,56(s0) locking = pr.locking; 800005ba: 00011d97 auipc s11,0x11 800005be: c86dad83 lw s11,-890(s11) # 80011240 <pr+0x18> if(locking) 800005c2: 020d9b63 bnez s11,800005f8 <printf+0x70> if (fmt == 0) 800005c6: 040a0263 beqz s4,8000060a <printf+0x82> va_start(ap, fmt); 800005ca: 00840793 addi a5,s0,8 800005ce: f8f43423 sd a5,-120(s0) for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 800005d2: 000a4503 lbu a0,0(s4) 800005d6: 16050263 beqz a0,8000073a <printf+0x1b2> 800005da: 4481 li s1,0 if(c != '%'){ 800005dc: 02500a93 li s5,37 switch(c){ 800005e0: 07000b13 li s6,112 consputc('x'); 800005e4: 4d41 li s10,16 consputc(digits[x >> (sizeof(uint64) * 8 - 4)]); 800005e6: 00008b97 auipc s7,0x8 800005ea: a5ab8b93 addi s7,s7,-1446 # 80008040 <digits> switch(c){ 800005ee: 07300c93 li s9,115 800005f2: 06400c13 li s8,100 800005f6: a82d j 80000630 <printf+0xa8> acquire(&pr.lock); 800005f8: 00011517 auipc a0,0x11 800005fc: c3050513 addi a0,a0,-976 # 80011228 <pr> 80000600: 00000097 auipc ra,0x0 80000604: 5e4080e7 jalr 1508(ra) # 80000be4 <acquire> 80000608: bf7d j 800005c6 <printf+0x3e> panic("null fmt"); 8000060a: 00008517 auipc a0,0x8 8000060e: a1e50513 addi a0,a0,-1506 # 80008028 <etext+0x28> 80000612: 00000097 auipc ra,0x0 80000616: f2c080e7 jalr -212(ra) # 8000053e <panic> consputc(c); 8000061a: 00000097 auipc ra,0x0 8000061e: c62080e7 jalr -926(ra) # 8000027c <consputc> for(i = 0; (c = fmt[i] & 0xff) != 0; i++){ 80000622: 2485 addiw s1,s1,1 80000624: 009a07b3 add a5,s4,s1 80000628: 0007c503 lbu a0,0(a5) 8000062c: 10050763 beqz a0,8000073a <printf+0x1b2> if(c != '%'){ 80000630: ff5515e3 bne a0,s5,8000061a <printf+0x92> c = fmt[++i] & 0xff; 80000634: 2485 addiw s1,s1,1 80000636: 009a07b3 add a5,s4,s1 8000063a: 0007c783 lbu a5,0(a5) 8000063e: 0007891b sext.w s2,a5 if(c == 0) 80000642: cfe5 beqz a5,8000073a <printf+0x1b2> switch(c){ 80000644: 05678a63 beq a5,s6,80000698 <printf+0x110> 80000648: 02fb7663 bgeu s6,a5,80000674 <printf+0xec> 8000064c: 09978963 beq a5,s9,800006de <printf+0x156> 80000650: 07800713 li a4,120 80000654: 0ce79863 bne a5,a4,80000724 <printf+0x19c> printint(va_arg(ap, int), 16, 1); 80000658: f8843783 ld a5,-120(s0) 8000065c: 00878713 addi a4,a5,8 80000660: f8e43423 sd a4,-120(s0) 80000664: 4605 li a2,1 80000666: 85ea mv a1,s10 80000668: 4388 lw a0,0(a5) 8000066a: 00000097 auipc ra,0x0 8000066e: e32080e7 jalr -462(ra) # 8000049c <printint> break; 80000672: bf45 j 80000622 <printf+0x9a> switch(c){ 80000674: 0b578263 beq a5,s5,80000718 <printf+0x190> 80000678: 0b879663 bne a5,s8,80000724 <printf+0x19c> printint(va_arg(ap, int), 10, 1); 8000067c: f8843783 ld a5,-120(s0) 80000680: 00878713 addi a4,a5,8 80000684: f8e43423 sd a4,-120(s0) 80000688: 4605 li a2,1 8000068a: 45a9 li a1,10 8000068c: 4388 lw a0,0(a5) 8000068e: 00000097 auipc ra,0x0 80000692: e0e080e7 jalr -498(ra) # 8000049c <printint> break; 80000696: b771 j 80000622 <printf+0x9a> printptr(va_arg(ap, uint64)); 80000698: f8843783 ld a5,-120(s0) 8000069c: 00878713 addi a4,a5,8 800006a0: f8e43423 sd a4,-120(s0) 800006a4: 0007b983 ld s3,0(a5) consputc('0'); 800006a8: 03000513 li a0,48 800006ac: 00000097 auipc ra,0x0 800006b0: bd0080e7 jalr -1072(ra) # 8000027c <consputc> consputc('x'); 800006b4: 07800513 li a0,120 800006b8: 00000097 auipc ra,0x0 800006bc: bc4080e7 jalr -1084(ra) # 8000027c <consputc> 800006c0: 896a mv s2,s10 consputc(digits[x >> (sizeof(uint64) * 8 - 4)]); 800006c2: 03c9d793 srli a5,s3,0x3c 800006c6: 97de add a5,a5,s7 800006c8: 0007c503 lbu a0,0(a5) 800006cc: 00000097 auipc ra,0x0 800006d0: bb0080e7 jalr -1104(ra) # 8000027c <consputc> for (i = 0; i < (sizeof(uint64) * 2); i++, x <<= 4) 800006d4: 0992 slli s3,s3,0x4 800006d6: 397d addiw s2,s2,-1 800006d8: fe0915e3 bnez s2,800006c2 <printf+0x13a> 800006dc: b799 j 80000622 <printf+0x9a> if((s = va_arg(ap, char*)) == 0) 800006de: f8843783 ld a5,-120(s0) 800006e2: 00878713 addi a4,a5,8 800006e6: f8e43423 sd a4,-120(s0) 800006ea: 0007b903 ld s2,0(a5) 800006ee: 00090e63 beqz s2,8000070a <printf+0x182> for(; *s; s++) 800006f2: 00094503 lbu a0,0(s2) 800006f6: d515 beqz a0,80000622 <printf+0x9a> consputc(*s); 800006f8: 00000097 auipc ra,0x0 800006fc: b84080e7 jalr -1148(ra) # 8000027c <consputc> for(; *s; s++) 80000700: 0905 addi s2,s2,1 80000702: 00094503 lbu a0,0(s2) 80000706: f96d bnez a0,800006f8 <printf+0x170> 80000708: bf29 j 80000622 <printf+0x9a> s = "(null)"; 8000070a: 00008917 auipc s2,0x8 8000070e: 91690913 addi s2,s2,-1770 # 80008020 <etext+0x20> for(; *s; s++) 80000712: 02800513 li a0,40 80000716: b7cd j 800006f8 <printf+0x170> consputc('%'); 80000718: 8556 mv a0,s5 8000071a: 00000097 auipc ra,0x0 8000071e: b62080e7 jalr -1182(ra) # 8000027c <consputc> break; 80000722: b701 j 80000622 <printf+0x9a> consputc('%'); 80000724: 8556 mv a0,s5 80000726: 00000097 auipc ra,0x0 8000072a: b56080e7 jalr -1194(ra) # 8000027c <consputc> consputc(c); 8000072e: 854a mv a0,s2 80000730: 00000097 auipc ra,0x0 80000734: b4c080e7 jalr -1204(ra) # 8000027c <consputc> break; 80000738: b5ed j 80000622 <printf+0x9a> if(locking) 8000073a: 020d9163 bnez s11,8000075c <printf+0x1d4> } 8000073e: 70e6 ld ra,120(sp) 80000740: 7446 ld s0,112(sp) 80000742: 74a6 ld s1,104(sp) 80000744: 7906 ld s2,96(sp) 80000746: 69e6 ld s3,88(sp) 80000748: 6a46 ld s4,80(sp) 8000074a: 6aa6 ld s5,72(sp) 8000074c: 6b06 ld s6,64(sp) 8000074e: 7be2 ld s7,56(sp) 80000750: 7c42 ld s8,48(sp) 80000752: 7ca2 ld s9,40(sp) 80000754: 7d02 ld s10,32(sp) 80000756: 6de2 ld s11,24(sp) 80000758: 6129 addi sp,sp,192 8000075a: 8082 ret release(&pr.lock); 8000075c: 00011517 auipc a0,0x11 80000760: acc50513 addi a0,a0,-1332 # 80011228 <pr> 80000764: 00000097 auipc ra,0x0 80000768: 534080e7 jalr 1332(ra) # 80000c98 <release> } 8000076c: bfc9 j 8000073e <printf+0x1b6> 000000008000076e <printfinit>: ; } void printfinit(void) { 8000076e: 1101 addi sp,sp,-32 80000770: ec06 sd ra,24(sp) 80000772: e822 sd s0,16(sp) 80000774: e426 sd s1,8(sp) 80000776: 1000 addi s0,sp,32 initlock(&pr.lock, "pr"); 80000778: 00011497 auipc s1,0x11 8000077c: ab048493 addi s1,s1,-1360 # 80011228 <pr> 80000780: 00008597 auipc a1,0x8 80000784: 8b858593 addi a1,a1,-1864 # 80008038 <etext+0x38> 80000788: 8526 mv a0,s1 8000078a: 00000097 auipc ra,0x0 8000078e: 3ca080e7 jalr 970(ra) # 80000b54 <initlock> pr.locking = 1; 80000792: 4785 li a5,1 80000794: cc9c sw a5,24(s1) } 80000796: 60e2 ld ra,24(sp) 80000798: 6442 ld s0,16(sp) 8000079a: 64a2 ld s1,8(sp) 8000079c: 6105 addi sp,sp,32 8000079e: 8082 ret 00000000800007a0 <uartinit>: void uartstart(); void uartinit(void) { 800007a0: 1141 addi sp,sp,-16 800007a2: e406 sd ra,8(sp) 800007a4: e022 sd s0,0(sp) 800007a6: 0800 addi s0,sp,16 // disable interrupts. WriteReg(IER, 0x00); 800007a8: 100007b7 lui a5,0x10000 800007ac: 000780a3 sb zero,1(a5) # 10000001 <_entry-0x6fffffff> // special mode to set baud rate. WriteReg(LCR, LCR_BAUD_LATCH); 800007b0: f8000713 li a4,-128 800007b4: 00e781a3 sb a4,3(a5) // LSB for baud rate of 38.4K. WriteReg(0, 0x03); 800007b8: 470d li a4,3 800007ba: 00e78023 sb a4,0(a5) // MSB for baud rate of 38.4K. WriteReg(1, 0x00); 800007be: 000780a3 sb zero,1(a5) // leave set-baud mode, // and set word length to 8 bits, no parity. WriteReg(LCR, LCR_EIGHT_BITS); 800007c2: 00e781a3 sb a4,3(a5) // reset and enable FIFOs. WriteReg(FCR, FCR_FIFO_ENABLE | FCR_FIFO_CLEAR); 800007c6: 469d li a3,7 800007c8: 00d78123 sb a3,2(a5) // enable transmit and receive interrupts. WriteReg(IER, IER_TX_ENABLE | IER_RX_ENABLE); 800007cc: 00e780a3 sb a4,1(a5) initlock(&uart_tx_lock, "uart"); 800007d0: 00008597 auipc a1,0x8 800007d4: 88858593 addi a1,a1,-1912 # 80008058 <digits+0x18> 800007d8: 00011517 auipc a0,0x11 800007dc: a7050513 addi a0,a0,-1424 # 80011248 <uart_tx_lock> 800007e0: 00000097 auipc ra,0x0 800007e4: 374080e7 jalr 884(ra) # 80000b54 <initlock> } 800007e8: 60a2 ld ra,8(sp) 800007ea: 6402 ld s0,0(sp) 800007ec: 0141 addi sp,sp,16 800007ee: 8082 ret 00000000800007f0 <uartputc_sync>: // use interrupts, for use by kernel printf() and // to echo characters. it spins waiting for the uart's // output register to be empty. void uartputc_sync(int c) { 800007f0: 1101 addi sp,sp,-32 800007f2: ec06 sd ra,24(sp) 800007f4: e822 sd s0,16(sp) 800007f6: e426 sd s1,8(sp) 800007f8: 1000 addi s0,sp,32 800007fa: 84aa mv s1,a0 push_off(); 800007fc: 00000097 auipc ra,0x0 80000800: 39c080e7 jalr 924(ra) # 80000b98 <push_off> if(panicked){ 80000804: 00008797 auipc a5,0x8 80000808: 7fc7a783 lw a5,2044(a5) # 80009000 <panicked> for(;;) ; } // wait for Transmit Holding Empty to be set in LSR. while((ReadReg(LSR) & LSR_TX_IDLE) == 0) 8000080c: 10000737 lui a4,0x10000 if(panicked){ 80000810: c391 beqz a5,80000814 <uartputc_sync+0x24> for(;;) 80000812: a001 j 80000812 <uartputc_sync+0x22> while((ReadReg(LSR) & LSR_TX_IDLE) == 0) 80000814: 00574783 lbu a5,5(a4) # 10000005 <_entry-0x6ffffffb> 80000818: 0ff7f793 andi a5,a5,255 8000081c: 0207f793 andi a5,a5,32 80000820: dbf5 beqz a5,80000814 <uartputc_sync+0x24> ; WriteReg(THR, c); 80000822: 0ff4f793 andi a5,s1,255 80000826: 10000737 lui a4,0x10000 8000082a: 00f70023 sb a5,0(a4) # 10000000 <_entry-0x70000000> pop_off(); 8000082e: 00000097 auipc ra,0x0 80000832: 40a080e7 jalr 1034(ra) # 80000c38 <pop_off> } 80000836: 60e2 ld ra,24(sp) 80000838: 6442 ld s0,16(sp) 8000083a: 64a2 ld s1,8(sp) 8000083c: 6105 addi sp,sp,32 8000083e: 8082 ret 0000000080000840 <uartstart>: // called from both the top- and bottom-half. void uartstart() { while(1){ if(uart_tx_w == uart_tx_r){ 80000840: 00008717 auipc a4,0x8 80000844: 7c873703 ld a4,1992(a4) # 80009008 <uart_tx_r> 80000848: 00008797 auipc a5,0x8 8000084c: 7c87b783 ld a5,1992(a5) # 80009010 <uart_tx_w> 80000850: 06e78c63 beq a5,a4,800008c8 <uartstart+0x88> { 80000854: 7139 addi sp,sp,-64 80000856: fc06 sd ra,56(sp) 80000858: f822 sd s0,48(sp) 8000085a: f426 sd s1,40(sp) 8000085c: f04a sd s2,32(sp) 8000085e: ec4e sd s3,24(sp) 80000860: e852 sd s4,16(sp) 80000862: e456 sd s5,8(sp) 80000864: 0080 addi s0,sp,64 // transmit buffer is empty. return; } if((ReadReg(LSR) & LSR_TX_IDLE) == 0){ 80000866: 10000937 lui s2,0x10000 // so we cannot give it another byte. // it will interrupt when it's ready for a new byte. return; } int c = uart_tx_buf[uart_tx_r % UART_TX_BUF_SIZE]; 8000086a: 00011a17 auipc s4,0x11 8000086e: 9dea0a13 addi s4,s4,-1570 # 80011248 <uart_tx_lock> uart_tx_r += 1; 80000872: 00008497 auipc s1,0x8 80000876: 79648493 addi s1,s1,1942 # 80009008 <uart_tx_r> if(uart_tx_w == uart_tx_r){ 8000087a: 00008997 auipc s3,0x8 8000087e: 79698993 addi s3,s3,1942 # 80009010 <uart_tx_w> if((ReadReg(LSR) & LSR_TX_IDLE) == 0){ 80000882: 00594783 lbu a5,5(s2) # 10000005 <_entry-0x6ffffffb> 80000886: 0ff7f793 andi a5,a5,255 8000088a: 0207f793 andi a5,a5,32 8000088e: c785 beqz a5,800008b6 <uartstart+0x76> int c = uart_tx_buf[uart_tx_r % UART_TX_BUF_SIZE]; 80000890: 01f77793 andi a5,a4,31 80000894: 97d2 add a5,a5,s4 80000896: 0187ca83 lbu s5,24(a5) uart_tx_r += 1; 8000089a: 0705 addi a4,a4,1 8000089c: e098 sd a4,0(s1) // maybe uartputc() is waiting for space in the buffer. wakeup(&uart_tx_r); 8000089e: 8526 mv a0,s1 800008a0: 00002097 auipc ra,0x2 800008a4: 966080e7 jalr -1690(ra) # 80002206 <wakeup> WriteReg(THR, c); 800008a8: 01590023 sb s5,0(s2) if(uart_tx_w == uart_tx_r){ 800008ac: 6098 ld a4,0(s1) 800008ae: 0009b783 ld a5,0(s3) 800008b2: fce798e3 bne a5,a4,80000882 <uartstart+0x42> } } 800008b6: 70e2 ld ra,56(sp) 800008b8: 7442 ld s0,48(sp) 800008ba: 74a2 ld s1,40(sp) 800008bc: 7902 ld s2,32(sp) 800008be: 69e2 ld s3,24(sp) 800008c0: 6a42 ld s4,16(sp) 800008c2: 6aa2 ld s5,8(sp) 800008c4: 6121 addi sp,sp,64 800008c6: 8082 ret 800008c8: 8082 ret 00000000800008ca <uartputc>: { 800008ca: 7179 addi sp,sp,-48 800008cc: f406 sd ra,40(sp) 800008ce: f022 sd s0,32(sp) 800008d0: ec26 sd s1,24(sp) 800008d2: e84a sd s2,16(sp) 800008d4: e44e sd s3,8(sp) 800008d6: e052 sd s4,0(sp) 800008d8: 1800 addi s0,sp,48 800008da: 89aa mv s3,a0 acquire(&uart_tx_lock); 800008dc: 00011517 auipc a0,0x11 800008e0: 96c50513 addi a0,a0,-1684 # 80011248 <uart_tx_lock> 800008e4: 00000097 auipc ra,0x0 800008e8: 300080e7 jalr 768(ra) # 80000be4 <acquire> if(panicked){ 800008ec: 00008797 auipc a5,0x8 800008f0: 7147a783 lw a5,1812(a5) # 80009000 <panicked> 800008f4: c391 beqz a5,800008f8 <uartputc+0x2e> for(;;) 800008f6: a001 j 800008f6 <uartputc+0x2c> if(uart_tx_w == uart_tx_r + UART_TX_BUF_SIZE){ 800008f8: 00008797 auipc a5,0x8 800008fc: 7187b783 ld a5,1816(a5) # 80009010 <uart_tx_w> 80000900: 00008717 auipc a4,0x8 80000904: 70873703 ld a4,1800(a4) # 80009008 <uart_tx_r> 80000908: 02070713 addi a4,a4,32 8000090c: 02f71b63 bne a4,a5,80000942 <uartputc+0x78> sleep(&uart_tx_r, &uart_tx_lock); 80000910: 00011a17 auipc s4,0x11 80000914: 938a0a13 addi s4,s4,-1736 # 80011248 <uart_tx_lock> 80000918: 00008497 auipc s1,0x8 8000091c: 6f048493 addi s1,s1,1776 # 80009008 <uart_tx_r> if(uart_tx_w == uart_tx_r + UART_TX_BUF_SIZE){ 80000920: 00008917 auipc s2,0x8 80000924: 6f090913 addi s2,s2,1776 # 80009010 <uart_tx_w> sleep(&uart_tx_r, &uart_tx_lock); 80000928: 85d2 mv a1,s4 8000092a: 8526 mv a0,s1 8000092c: 00001097 auipc ra,0x1 80000930: 74e080e7 jalr 1870(ra) # 8000207a <sleep> if(uart_tx_w == uart_tx_r + UART_TX_BUF_SIZE){ 80000934: 00093783 ld a5,0(s2) 80000938: 6098 ld a4,0(s1) 8000093a: 02070713 addi a4,a4,32 8000093e: fef705e3 beq a4,a5,80000928 <uartputc+0x5e> uart_tx_buf[uart_tx_w % UART_TX_BUF_SIZE] = c; 80000942: 00011497 auipc s1,0x11 80000946: 90648493 addi s1,s1,-1786 # 80011248 <uart_tx_lock> 8000094a: 01f7f713 andi a4,a5,31 8000094e: 9726 add a4,a4,s1 80000950: 01370c23 sb s3,24(a4) uart_tx_w += 1; 80000954: 0785 addi a5,a5,1 80000956: 00008717 auipc a4,0x8 8000095a: 6af73d23 sd a5,1722(a4) # 80009010 <uart_tx_w> uartstart(); 8000095e: 00000097 auipc ra,0x0 80000962: ee2080e7 jalr -286(ra) # 80000840 <uartstart> release(&uart_tx_lock); 80000966: 8526 mv a0,s1 80000968: 00000097 auipc ra,0x0 8000096c: 330080e7 jalr 816(ra) # 80000c98 <release> } 80000970: 70a2 ld ra,40(sp) 80000972: 7402 ld s0,32(sp) 80000974: 64e2 ld s1,24(sp) 80000976: 6942 ld s2,16(sp) 80000978: 69a2 ld s3,8(sp) 8000097a: 6a02 ld s4,0(sp) 8000097c: 6145 addi sp,sp,48 8000097e: 8082 ret 0000000080000980 <uartgetc>: // read one input character from the UART. // return -1 if none is waiting. int uartgetc(void) { 80000980: 1141 addi sp,sp,-16 80000982: e422 sd s0,8(sp) 80000984: 0800 addi s0,sp,16 if(ReadReg(LSR) & 0x01){ 80000986: 100007b7 lui a5,0x10000 8000098a: 0057c783 lbu a5,5(a5) # 10000005 <_entry-0x6ffffffb> 8000098e: 8b85 andi a5,a5,1 80000990: cb91 beqz a5,800009a4 <uartgetc+0x24> // input data is ready. return ReadReg(RHR); 80000992: 100007b7 lui a5,0x10000 80000996: 0007c503 lbu a0,0(a5) # 10000000 <_entry-0x70000000> 8000099a: 0ff57513 andi a0,a0,255 } else { return -1; } } 8000099e: 6422 ld s0,8(sp) 800009a0: 0141 addi sp,sp,16 800009a2: 8082 ret return -1; 800009a4: 557d li a0,-1 800009a6: bfe5 j 8000099e <uartgetc+0x1e> 00000000800009a8 <uartintr>: // handle a uart interrupt, raised because input has // arrived, or the uart is ready for more output, or // both. called from trap.c. void uartintr(void) { 800009a8: 1101 addi sp,sp,-32 800009aa: ec06 sd ra,24(sp) 800009ac: e822 sd s0,16(sp) 800009ae: e426 sd s1,8(sp) 800009b0: 1000 addi s0,sp,32 // read and process incoming characters. while(1){ int c = uartgetc(); if(c == -1) 800009b2: 54fd li s1,-1 int c = uartgetc(); 800009b4: 00000097 auipc ra,0x0 800009b8: fcc080e7 jalr -52(ra) # 80000980 <uartgetc> if(c == -1) 800009bc: 00950763 beq a0,s1,800009ca <uartintr+0x22> break; consoleintr(c); 800009c0: 00000097 auipc ra,0x0 800009c4: 8fe080e7 jalr -1794(ra) # 800002be <consoleintr> while(1){ 800009c8: b7f5 j 800009b4 <uartintr+0xc> } // send buffered characters. acquire(&uart_tx_lock); 800009ca: 00011497 auipc s1,0x11 800009ce: 87e48493 addi s1,s1,-1922 # 80011248 <uart_tx_lock> 800009d2: 8526 mv a0,s1 800009d4: 00000097 auipc ra,0x0 800009d8: 210080e7 jalr 528(ra) # 80000be4 <acquire> uartstart(); 800009dc: 00000097 auipc ra,0x0 800009e0: e64080e7 jalr -412(ra) # 80000840 <uartstart> release(&uart_tx_lock); 800009e4: 8526 mv a0,s1 800009e6: 00000097 auipc ra,0x0 800009ea: 2b2080e7 jalr 690(ra) # 80000c98 <release> } 800009ee: 60e2 ld ra,24(sp) 800009f0: 6442 ld s0,16(sp) 800009f2: 64a2 ld s1,8(sp) 800009f4: 6105 addi sp,sp,32 800009f6: 8082 ret 00000000800009f8 <kfree>: // which normally should have been returned by a // call to kalloc(). (The exception is when // initializing the allocator; see kinit above.) void kfree(void *pa) { 800009f8: 1101 addi sp,sp,-32 800009fa: ec06 sd ra,24(sp) 800009fc: e822 sd s0,16(sp) 800009fe: e426 sd s1,8(sp) 80000a00: e04a sd s2,0(sp) 80000a02: 1000 addi s0,sp,32 struct run *r; if(((uint64)pa % PGSIZE) != 0 || (char*)pa < end || (uint64)pa >= PHYSTOP) 80000a04: 03451793 slli a5,a0,0x34 80000a08: ebb9 bnez a5,80000a5e <kfree+0x66> 80000a0a: 84aa mv s1,a0 80000a0c: 00026797 auipc a5,0x26 80000a10: 5f478793 addi a5,a5,1524 # 80027000 <end> 80000a14: 04f56563 bltu a0,a5,80000a5e <kfree+0x66> 80000a18: 47c5 li a5,17 80000a1a: 07ee slli a5,a5,0x1b 80000a1c: 04f57163 bgeu a0,a5,80000a5e <kfree+0x66> panic("kfree"); // Fill with junk to catch dangling refs. memset(pa, 1, PGSIZE); 80000a20: 6605 lui a2,0x1 80000a22: 4585 li a1,1 80000a24: 00000097 auipc ra,0x0 80000a28: 2bc080e7 jalr 700(ra) # 80000ce0 <memset> r = (struct run*)pa; acquire(&kmem.lock); 80000a2c: 00011917 auipc s2,0x11 80000a30: 85490913 addi s2,s2,-1964 # 80011280 <kmem> 80000a34: 854a mv a0,s2 80000a36: 00000097 auipc ra,0x0 80000a3a: 1ae080e7 jalr 430(ra) # 80000be4 <acquire> r->next = kmem.freelist; 80000a3e: 01893783 ld a5,24(s2) 80000a42: e09c sd a5,0(s1) kmem.freelist = r; 80000a44: 00993c23 sd s1,24(s2) release(&kmem.lock); 80000a48: 854a mv a0,s2 80000a4a: 00000097 auipc ra,0x0 80000a4e: 24e080e7 jalr 590(ra) # 80000c98 <release> } 80000a52: 60e2 ld ra,24(sp) 80000a54: 6442 ld s0,16(sp) 80000a56: 64a2 ld s1,8(sp) 80000a58: 6902 ld s2,0(sp) 80000a5a: 6105 addi sp,sp,32 80000a5c: 8082 ret panic("kfree"); 80000a5e: 00007517 auipc a0,0x7 80000a62: 60250513 addi a0,a0,1538 # 80008060 <digits+0x20> 80000a66: 00000097 auipc ra,0x0 80000a6a: ad8080e7 jalr -1320(ra) # 8000053e <panic> 0000000080000a6e <freerange>: { 80000a6e: 7179 addi sp,sp,-48 80000a70: f406 sd ra,40(sp) 80000a72: f022 sd s0,32(sp) 80000a74: ec26 sd s1,24(sp) 80000a76: e84a sd s2,16(sp) 80000a78: e44e sd s3,8(sp) 80000a7a: e052 sd s4,0(sp) 80000a7c: 1800 addi s0,sp,48 p = (char*)PGROUNDUP((uint64)pa_start); 80000a7e: 6785 lui a5,0x1 80000a80: fff78493 addi s1,a5,-1 # fff <_entry-0x7ffff001> 80000a84: 94aa add s1,s1,a0 80000a86: 757d lui a0,0xfffff 80000a88: 8ce9 and s1,s1,a0 for(; p + PGSIZE <= (char*)pa_end; p += PGSIZE) 80000a8a: 94be add s1,s1,a5 80000a8c: 0095ee63 bltu a1,s1,80000aa8 <freerange+0x3a> 80000a90: 892e mv s2,a1 kfree(p); 80000a92: 7a7d lui s4,0xfffff for(; p + PGSIZE <= (char*)pa_end; p += PGSIZE) 80000a94: 6985 lui s3,0x1 kfree(p); 80000a96: 01448533 add a0,s1,s4 80000a9a: 00000097 auipc ra,0x0 80000a9e: f5e080e7 jalr -162(ra) # 800009f8 <kfree> for(; p + PGSIZE <= (char*)pa_end; p += PGSIZE) 80000aa2: 94ce add s1,s1,s3 80000aa4: fe9979e3 bgeu s2,s1,80000a96 <freerange+0x28> } 80000aa8: 70a2 ld ra,40(sp) 80000aaa: 7402 ld s0,32(sp) 80000aac: 64e2 ld s1,24(sp) 80000aae: 6942 ld s2,16(sp) 80000ab0: 69a2 ld s3,8(sp) 80000ab2: 6a02 ld s4,0(sp) 80000ab4: 6145 addi sp,sp,48 80000ab6: 8082 ret 0000000080000ab8 <kinit>: { 80000ab8: 1141 addi sp,sp,-16 80000aba: e406 sd ra,8(sp) 80000abc: e022 sd s0,0(sp) 80000abe: 0800 addi s0,sp,16 initlock(&kmem.lock, "kmem"); 80000ac0: 00007597 auipc a1,0x7 80000ac4: 5a858593 addi a1,a1,1448 # 80008068 <digits+0x28> 80000ac8: 00010517 auipc a0,0x10 80000acc: 7b850513 addi a0,a0,1976 # 80011280 <kmem> 80000ad0: 00000097 auipc ra,0x0 80000ad4: 084080e7 jalr 132(ra) # 80000b54 <initlock> freerange(end, (void*)PHYSTOP); 80000ad8: 45c5 li a1,17 80000ada: 05ee slli a1,a1,0x1b 80000adc: 00026517 auipc a0,0x26 80000ae0: 52450513 addi a0,a0,1316 # 80027000 <end> 80000ae4: 00000097 auipc ra,0x0 80000ae8: f8a080e7 jalr -118(ra) # 80000a6e <freerange> } 80000aec: 60a2 ld ra,8(sp) 80000aee: 6402 ld s0,0(sp) 80000af0: 0141 addi sp,sp,16 80000af2: 8082 ret 0000000080000af4 <kalloc>: // Allocate one 4096-byte page of physical memory. // Returns a pointer that the kernel can use. // Returns 0 if the memory cannot be allocated. void * kalloc(void) { 80000af4: 1101 addi sp,sp,-32 80000af6: ec06 sd ra,24(sp) 80000af8: e822 sd s0,16(sp) 80000afa: e426 sd s1,8(sp) 80000afc: 1000 addi s0,sp,32 struct run *r; acquire(&kmem.lock); 80000afe: 00010497 auipc s1,0x10 80000b02: 78248493 addi s1,s1,1922 # 80011280 <kmem> 80000b06: 8526 mv a0,s1 80000b08: 00000097 auipc ra,0x0 80000b0c: 0dc080e7 jalr 220(ra) # 80000be4 <acquire> r = kmem.freelist; 80000b10: 6c84 ld s1,24(s1) if(r) 80000b12: c885 beqz s1,80000b42 <kalloc+0x4e> kmem.freelist = r->next; 80000b14: 609c ld a5,0(s1) 80000b16: 00010517 auipc a0,0x10 80000b1a: 76a50513 addi a0,a0,1898 # 80011280 <kmem> 80000b1e: ed1c sd a5,24(a0) release(&kmem.lock); 80000b20: 00000097 auipc ra,0x0 80000b24: 178080e7 jalr 376(ra) # 80000c98 <release> if(r) memset((char*)r, 5, PGSIZE); // fill with junk 80000b28: 6605 lui a2,0x1 80000b2a: 4595 li a1,5 80000b2c: 8526 mv a0,s1 80000b2e: 00000097 auipc ra,0x0 80000b32: 1b2080e7 jalr 434(ra) # 80000ce0 <memset> return (void*)r; } 80000b36: 8526 mv a0,s1 80000b38: 60e2 ld ra,24(sp) 80000b3a: 6442 ld s0,16(sp) 80000b3c: 64a2 ld s1,8(sp) 80000b3e: 6105 addi sp,sp,32 80000b40: 8082 ret release(&kmem.lock); 80000b42: 00010517 auipc a0,0x10 80000b46: 73e50513 addi a0,a0,1854 # 80011280 <kmem> 80000b4a: 00000097 auipc ra,0x0 80000b4e: 14e080e7 jalr 334(ra) # 80000c98 <release> if(r) 80000b52: b7d5 j 80000b36 <kalloc+0x42> 0000000080000b54 <initlock>: #include "proc.h" #include "defs.h" void initlock(struct spinlock *lk, char *name) { 80000b54: 1141 addi sp,sp,-16 80000b56: e422 sd s0,8(sp) 80000b58: 0800 addi s0,sp,16 lk->name = name; 80000b5a: e50c sd a1,8(a0) lk->locked = 0; 80000b5c: 00052023 sw zero,0(a0) lk->cpu = 0; 80000b60: 00053823 sd zero,16(a0) } 80000b64: 6422 ld s0,8(sp) 80000b66: 0141 addi sp,sp,16 80000b68: 8082 ret 0000000080000b6a <holding>: // Interrupts must be off. int holding(struct spinlock *lk) { int r; r = (lk->locked && lk->cpu == mycpu()); 80000b6a: 411c lw a5,0(a0) 80000b6c: e399 bnez a5,80000b72 <holding+0x8> 80000b6e: 4501 li a0,0 return r; } 80000b70: 8082 ret { 80000b72: 1101 addi sp,sp,-32 80000b74: ec06 sd ra,24(sp) 80000b76: e822 sd s0,16(sp) 80000b78: e426 sd s1,8(sp) 80000b7a: 1000 addi s0,sp,32 r = (lk->locked && lk->cpu == mycpu()); 80000b7c: 6904 ld s1,16(a0) 80000b7e: 00001097 auipc ra,0x1 80000b82: e16080e7 jalr -490(ra) # 80001994 <mycpu> 80000b86: 40a48533 sub a0,s1,a0 80000b8a: 00153513 seqz a0,a0 } 80000b8e: 60e2 ld ra,24(sp) 80000b90: 6442 ld s0,16(sp) 80000b92: 64a2 ld s1,8(sp) 80000b94: 6105 addi sp,sp,32 80000b96: 8082 ret 0000000080000b98 <push_off>: // it takes two pop_off()s to undo two push_off()s. Also, if interrupts // are initially off, then push_off, pop_off leaves them off. void push_off(void) { 80000b98: 1101 addi sp,sp,-32 80000b9a: ec06 sd ra,24(sp) 80000b9c: e822 sd s0,16(sp) 80000b9e: e426 sd s1,8(sp) 80000ba0: 1000 addi s0,sp,32 asm volatile("csrr %0, sstatus" : "=r" (x) ); 80000ba2: 100024f3 csrr s1,sstatus 80000ba6: 100027f3 csrr a5,sstatus w_sstatus(r_sstatus() & ~SSTATUS_SIE); 80000baa: 9bf5 andi a5,a5,-3 asm volatile("csrw sstatus, %0" : : "r" (x)); 80000bac: 10079073 csrw sstatus,a5 int old = intr_get(); intr_off(); if(mycpu()->noff == 0) 80000bb0: 00001097 auipc ra,0x1 80000bb4: de4080e7 jalr -540(ra) # 80001994 <mycpu> 80000bb8: 5d3c lw a5,120(a0) 80000bba: cf89 beqz a5,80000bd4 <push_off+0x3c> mycpu()->intena = old; mycpu()->noff += 1; 80000bbc: 00001097 auipc ra,0x1 80000bc0: dd8080e7 jalr -552(ra) # 80001994 <mycpu> 80000bc4: 5d3c lw a5,120(a0) 80000bc6: 2785 addiw a5,a5,1 80000bc8: dd3c sw a5,120(a0) } 80000bca: 60e2 ld ra,24(sp) 80000bcc: 6442 ld s0,16(sp) 80000bce: 64a2 ld s1,8(sp) 80000bd0: 6105 addi sp,sp,32 80000bd2: 8082 ret mycpu()->intena = old; 80000bd4: 00001097 auipc ra,0x1 80000bd8: dc0080e7 jalr -576(ra) # 80001994 <mycpu> return (x & SSTATUS_SIE) != 0; 80000bdc: 8085 srli s1,s1,0x1 80000bde: 8885 andi s1,s1,1 80000be0: dd64 sw s1,124(a0) 80000be2: bfe9 j 80000bbc <push_off+0x24> 0000000080000be4 <acquire>: { 80000be4: 1101 addi sp,sp,-32 80000be6: ec06 sd ra,24(sp) 80000be8: e822 sd s0,16(sp) 80000bea: e426 sd s1,8(sp) 80000bec: 1000 addi s0,sp,32 80000bee: 84aa mv s1,a0 push_off(); // disable interrupts to avoid deadlock. 80000bf0: 00000097 auipc ra,0x0 80000bf4: fa8080e7 jalr -88(ra) # 80000b98 <push_off> if(holding(lk)) 80000bf8: 8526 mv a0,s1 80000bfa: 00000097 auipc ra,0x0 80000bfe: f70080e7 jalr -144(ra) # 80000b6a <holding> while(__sync_lock_test_and_set(&lk->locked, 1) != 0) 80000c02: 4705 li a4,1 if(holding(lk)) 80000c04: e115 bnez a0,80000c28 <acquire+0x44> while(__sync_lock_test_and_set(&lk->locked, 1) != 0) 80000c06: 87ba mv a5,a4 80000c08: 0cf4a7af amoswap.w.aq a5,a5,(s1) 80000c0c: 2781 sext.w a5,a5 80000c0e: ffe5 bnez a5,80000c06 <acquire+0x22> __sync_synchronize(); 80000c10: 0ff0000f fence lk->cpu = mycpu(); 80000c14: 00001097 auipc ra,0x1 80000c18: d80080e7 jalr -640(ra) # 80001994 <mycpu> 80000c1c: e888 sd a0,16(s1) } 80000c1e: 60e2 ld ra,24(sp) 80000c20: 6442 ld s0,16(sp) 80000c22: 64a2 ld s1,8(sp) 80000c24: 6105 addi sp,sp,32 80000c26: 8082 ret panic("acquire"); 80000c28: 00007517 auipc a0,0x7 80000c2c: 44850513 addi a0,a0,1096 # 80008070 <digits+0x30> 80000c30: 00000097 auipc ra,0x0 80000c34: 90e080e7 jalr -1778(ra) # 8000053e <panic> 0000000080000c38 <pop_off>: void pop_off(void) { 80000c38: 1141 addi sp,sp,-16 80000c3a: e406 sd ra,8(sp) 80000c3c: e022 sd s0,0(sp) 80000c3e: 0800 addi s0,sp,16 struct cpu *c = mycpu(); 80000c40: 00001097 auipc ra,0x1 80000c44: d54080e7 jalr -684(ra) # 80001994 <mycpu> asm volatile("csrr %0, sstatus" : "=r" (x) ); 80000c48: 100027f3 csrr a5,sstatus return (x & SSTATUS_SIE) != 0; 80000c4c: 8b89 andi a5,a5,2 if(intr_get()) 80000c4e: e78d bnez a5,80000c78 <pop_off+0x40> panic("pop_off - interruptible"); if(c->noff < 1) 80000c50: 5d3c lw a5,120(a0) 80000c52: 02f05b63 blez a5,80000c88 <pop_off+0x50> panic("pop_off"); c->noff -= 1; 80000c56: 37fd addiw a5,a5,-1 80000c58: 0007871b sext.w a4,a5 80000c5c: dd3c sw a5,120(a0) if(c->noff == 0 && c->intena) 80000c5e: eb09 bnez a4,80000c70 <pop_off+0x38> 80000c60: 5d7c lw a5,124(a0) 80000c62: c799 beqz a5,80000c70 <pop_off+0x38> asm volatile("csrr %0, sstatus" : "=r" (x) ); 80000c64: 100027f3 csrr a5,sstatus w_sstatus(r_sstatus() | SSTATUS_SIE); 80000c68: 0027e793 ori a5,a5,2 asm volatile("csrw sstatus, %0" : : "r" (x)); 80000c6c: 10079073 csrw sstatus,a5 intr_on(); } 80000c70: 60a2 ld ra,8(sp) 80000c72: 6402 ld s0,0(sp) 80000c74: 0141 addi sp,sp,16 80000c76: 8082 ret panic("pop_off - interruptible"); 80000c78: 00007517 auipc a0,0x7 80000c7c: 40050513 addi a0,a0,1024 # 80008078 <digits+0x38> 80000c80: 00000097 auipc ra,0x0 80000c84: 8be080e7 jalr -1858(ra) # 8000053e <panic> panic("pop_off"); 80000c88: 00007517 auipc a0,0x7 80000c8c: 40850513 addi a0,a0,1032 # 80008090 <digits+0x50> 80000c90: 00000097 auipc ra,0x0 80000c94: 8ae080e7 jalr -1874(ra) # 8000053e <panic> 0000000080000c98 <release>: { 80000c98: 1101 addi sp,sp,-32 80000c9a: ec06 sd ra,24(sp) 80000c9c: e822 sd s0,16(sp) 80000c9e: e426 sd s1,8(sp) 80000ca0: 1000 addi s0,sp,32 80000ca2: 84aa mv s1,a0 if(!holding(lk)) 80000ca4: 00000097 auipc ra,0x0 80000ca8: ec6080e7 jalr -314(ra) # 80000b6a <holding> 80000cac: c115 beqz a0,80000cd0 <release+0x38> lk->cpu = 0; 80000cae: 0004b823 sd zero,16(s1) __sync_synchronize(); 80000cb2: 0ff0000f fence __sync_lock_release(&lk->locked); 80000cb6: 0f50000f fence iorw,ow 80000cba: 0804a02f amoswap.w zero,zero,(s1) pop_off(); 80000cbe: 00000097 auipc ra,0x0 80000cc2: f7a080e7 jalr -134(ra) # 80000c38 <pop_off> } 80000cc6: 60e2 ld ra,24(sp) 80000cc8: 6442 ld s0,16(sp) 80000cca: 64a2 ld s1,8(sp) 80000ccc: 6105 addi sp,sp,32 80000cce: 8082 ret panic("release"); 80000cd0: 00007517 auipc a0,0x7 80000cd4: 3c850513 addi a0,a0,968 # 80008098 <digits+0x58> 80000cd8: 00000097 auipc ra,0x0 80000cdc: 866080e7 jalr -1946(ra) # 8000053e <panic> 0000000080000ce0 <memset>: #include "types.h" void* memset(void *dst, int c, uint n) { 80000ce0: 1141 addi sp,sp,-16 80000ce2: e422 sd s0,8(sp) 80000ce4: 0800 addi s0,sp,16 char *cdst = (char *) dst; int i; for(i = 0; i < n; i++){ 80000ce6: ce09 beqz a2,80000d00 <memset+0x20> 80000ce8: 87aa mv a5,a0 80000cea: fff6071b addiw a4,a2,-1 80000cee: 1702 slli a4,a4,0x20 80000cf0: 9301 srli a4,a4,0x20 80000cf2: 0705 addi a4,a4,1 80000cf4: 972a add a4,a4,a0 cdst[i] = c; 80000cf6: 00b78023 sb a1,0(a5) for(i = 0; i < n; i++){ 80000cfa: 0785 addi a5,a5,1 80000cfc: fee79de3 bne a5,a4,80000cf6 <memset+0x16> } return dst; } 80000d00: 6422 ld s0,8(sp) 80000d02: 0141 addi sp,sp,16 80000d04: 8082 ret 0000000080000d06 <memcmp>: int memcmp(const void *v1, const void *v2, uint n) { 80000d06: 1141 addi sp,sp,-16 80000d08: e422 sd s0,8(sp) 80000d0a: 0800 addi s0,sp,16 const uchar *s1, *s2; s1 = v1; s2 = v2; while(n-- > 0){ 80000d0c: ca05 beqz a2,80000d3c <memcmp+0x36> 80000d0e: fff6069b addiw a3,a2,-1 80000d12: 1682 slli a3,a3,0x20 80000d14: 9281 srli a3,a3,0x20 80000d16: 0685 addi a3,a3,1 80000d18: 96aa add a3,a3,a0 if(*s1 != *s2) 80000d1a: 00054783 lbu a5,0(a0) 80000d1e: 0005c703 lbu a4,0(a1) 80000d22: 00e79863 bne a5,a4,80000d32 <memcmp+0x2c> return *s1 - *s2; s1++, s2++; 80000d26: 0505 addi a0,a0,1 80000d28: 0585 addi a1,a1,1 while(n-- > 0){ 80000d2a: fed518e3 bne a0,a3,80000d1a <memcmp+0x14> } return 0; 80000d2e: 4501 li a0,0 80000d30: a019 j 80000d36 <memcmp+0x30> return *s1 - *s2; 80000d32: 40e7853b subw a0,a5,a4 } 80000d36: 6422 ld s0,8(sp) 80000d38: 0141 addi sp,sp,16 80000d3a: 8082 ret return 0; 80000d3c: 4501 li a0,0 80000d3e: bfe5 j 80000d36 <memcmp+0x30> 0000000080000d40 <memmove>: void* memmove(void *dst, const void *src, uint n) { 80000d40: 1141 addi sp,sp,-16 80000d42: e422 sd s0,8(sp) 80000d44: 0800 addi s0,sp,16 const char *s; char *d; if(n == 0) 80000d46: ca0d beqz a2,80000d78 <memmove+0x38> return dst; s = src; d = dst; if(s < d && s + n > d){ 80000d48: 00a5f963 bgeu a1,a0,80000d5a <memmove+0x1a> 80000d4c: 02061693 slli a3,a2,0x20 80000d50: 9281 srli a3,a3,0x20 80000d52: 00d58733 add a4,a1,a3 80000d56: 02e56463 bltu a0,a4,80000d7e <memmove+0x3e> s += n; d += n; while(n-- > 0) *--d = *--s; } else while(n-- > 0) 80000d5a: fff6079b addiw a5,a2,-1 80000d5e: 1782 slli a5,a5,0x20 80000d60: 9381 srli a5,a5,0x20 80000d62: 0785 addi a5,a5,1 80000d64: 97ae add a5,a5,a1 80000d66: 872a mv a4,a0 *d++ = *s++; 80000d68: 0585 addi a1,a1,1 80000d6a: 0705 addi a4,a4,1 80000d6c: fff5c683 lbu a3,-1(a1) 80000d70: fed70fa3 sb a3,-1(a4) while(n-- > 0) 80000d74: fef59ae3 bne a1,a5,80000d68 <memmove+0x28> return dst; } 80000d78: 6422 ld s0,8(sp) 80000d7a: 0141 addi sp,sp,16 80000d7c: 8082 ret d += n; 80000d7e: 96aa add a3,a3,a0 while(n-- > 0) 80000d80: fff6079b addiw a5,a2,-1 80000d84: 1782 slli a5,a5,0x20 80000d86: 9381 srli a5,a5,0x20 80000d88: fff7c793 not a5,a5 80000d8c: 97ba add a5,a5,a4 *--d = *--s; 80000d8e: 177d addi a4,a4,-1 80000d90: 16fd addi a3,a3,-1 80000d92: 00074603 lbu a2,0(a4) 80000d96: 00c68023 sb a2,0(a3) while(n-- > 0) 80000d9a: fef71ae3 bne a4,a5,80000d8e <memmove+0x4e> 80000d9e: bfe9 j 80000d78 <memmove+0x38> 0000000080000da0 <memcpy>: // memcpy exists to placate GCC. Use memmove. void* memcpy(void *dst, const void *src, uint n) { 80000da0: 1141 addi sp,sp,-16 80000da2: e406 sd ra,8(sp) 80000da4: e022 sd s0,0(sp) 80000da6: 0800 addi s0,sp,16 return memmove(dst, src, n); 80000da8: 00000097 auipc ra,0x0 80000dac: f98080e7 jalr -104(ra) # 80000d40 <memmove> } 80000db0: 60a2 ld ra,8(sp) 80000db2: 6402 ld s0,0(sp) 80000db4: 0141 addi sp,sp,16 80000db6: 8082 ret 0000000080000db8 <strncmp>: int strncmp(const char *p, const char *q, uint n) { 80000db8: 1141 addi sp,sp,-16 80000dba: e422 sd s0,8(sp) 80000dbc: 0800 addi s0,sp,16 while(n > 0 && *p && *p == *q) 80000dbe: ce11 beqz a2,80000dda <strncmp+0x22> 80000dc0: 00054783 lbu a5,0(a0) 80000dc4: cf89 beqz a5,80000dde <strncmp+0x26> 80000dc6: 0005c703 lbu a4,0(a1) 80000dca: 00f71a63 bne a4,a5,80000dde <strncmp+0x26> n--, p++, q++; 80000dce: 367d addiw a2,a2,-1 80000dd0: 0505 addi a0,a0,1 80000dd2: 0585 addi a1,a1,1 while(n > 0 && *p && *p == *q) 80000dd4: f675 bnez a2,80000dc0 <strncmp+0x8> if(n == 0) return 0; 80000dd6: 4501 li a0,0 80000dd8: a809 j 80000dea <strncmp+0x32> 80000dda: 4501 li a0,0 80000ddc: a039 j 80000dea <strncmp+0x32> if(n == 0) 80000dde: ca09 beqz a2,80000df0 <strncmp+0x38> return (uchar)*p - (uchar)*q; 80000de0: 00054503 lbu a0,0(a0) 80000de4: 0005c783 lbu a5,0(a1) 80000de8: 9d1d subw a0,a0,a5 } 80000dea: 6422 ld s0,8(sp) 80000dec: 0141 addi sp,sp,16 80000dee: 8082 ret return 0; 80000df0: 4501 li a0,0 80000df2: bfe5 j 80000dea <strncmp+0x32> 0000000080000df4 <strncpy>: char* strncpy(char *s, const char *t, int n) { 80000df4: 1141 addi sp,sp,-16 80000df6: e422 sd s0,8(sp) 80000df8: 0800 addi s0,sp,16 char *os; os = s; while(n-- > 0 && (*s++ = *t++) != 0) 80000dfa: 872a mv a4,a0 80000dfc: 8832 mv a6,a2 80000dfe: 367d addiw a2,a2,-1 80000e00: 01005963 blez a6,80000e12 <strncpy+0x1e> 80000e04: 0705 addi a4,a4,1 80000e06: 0005c783 lbu a5,0(a1) 80000e0a: fef70fa3 sb a5,-1(a4) 80000e0e: 0585 addi a1,a1,1 80000e10: f7f5 bnez a5,80000dfc <strncpy+0x8> ; while(n-- > 0) 80000e12: 00c05d63 blez a2,80000e2c <strncpy+0x38> 80000e16: 86ba mv a3,a4 *s++ = 0; 80000e18: 0685 addi a3,a3,1 80000e1a: fe068fa3 sb zero,-1(a3) while(n-- > 0) 80000e1e: fff6c793 not a5,a3 80000e22: 9fb9 addw a5,a5,a4 80000e24: 010787bb addw a5,a5,a6 80000e28: fef048e3 bgtz a5,80000e18 <strncpy+0x24> return os; } 80000e2c: 6422 ld s0,8(sp) 80000e2e: 0141 addi sp,sp,16 80000e30: 8082 ret 0000000080000e32 <safestrcpy>: // Like strncpy but guaranteed to NUL-terminate. char* safestrcpy(char *s, const char *t, int n) { 80000e32: 1141 addi sp,sp,-16 80000e34: e422 sd s0,8(sp) 80000e36: 0800 addi s0,sp,16 char *os; os = s; if(n <= 0) 80000e38: 02c05363 blez a2,80000e5e <safestrcpy+0x2c> 80000e3c: fff6069b addiw a3,a2,-1 80000e40: 1682 slli a3,a3,0x20 80000e42: 9281 srli a3,a3,0x20 80000e44: 96ae add a3,a3,a1 80000e46: 87aa mv a5,a0 return os; while(--n > 0 && (*s++ = *t++) != 0) 80000e48: 00d58963 beq a1,a3,80000e5a <safestrcpy+0x28> 80000e4c: 0585 addi a1,a1,1 80000e4e: 0785 addi a5,a5,1 80000e50: fff5c703 lbu a4,-1(a1) 80000e54: fee78fa3 sb a4,-1(a5) 80000e58: fb65 bnez a4,80000e48 <safestrcpy+0x16> ; *s = 0; 80000e5a: 00078023 sb zero,0(a5) return os; } 80000e5e: 6422 ld s0,8(sp) 80000e60: 0141 addi sp,sp,16 80000e62: 8082 ret 0000000080000e64 <strlen>: int strlen(const char *s) { 80000e64: 1141 addi sp,sp,-16 80000e66: e422 sd s0,8(sp) 80000e68: 0800 addi s0,sp,16 int n; for(n = 0; s[n]; n++) 80000e6a: 00054783 lbu a5,0(a0) 80000e6e: cf91 beqz a5,80000e8a <strlen+0x26> 80000e70: 0505 addi a0,a0,1 80000e72: 87aa mv a5,a0 80000e74: 4685 li a3,1 80000e76: 9e89 subw a3,a3,a0 80000e78: 00f6853b addw a0,a3,a5 80000e7c: 0785 addi a5,a5,1 80000e7e: fff7c703 lbu a4,-1(a5) 80000e82: fb7d bnez a4,80000e78 <strlen+0x14> ; return n; } 80000e84: 6422 ld s0,8(sp) 80000e86: 0141 addi sp,sp,16 80000e88: 8082 ret for(n = 0; s[n]; n++) 80000e8a: 4501 li a0,0 80000e8c: bfe5 j 80000e84 <strlen+0x20> 0000000080000e8e <main>: volatile static int started = 0; // start() jumps here in supervisor mode on all CPUs. void main() { 80000e8e: 1141 addi sp,sp,-16 80000e90: e406 sd ra,8(sp) 80000e92: e022 sd s0,0(sp) 80000e94: 0800 addi s0,sp,16 if(cpuid() == 0){ 80000e96: 00001097 auipc ra,0x1 80000e9a: aee080e7 jalr -1298(ra) # 80001984 <cpuid> virtio_disk_init(); // emulated hard disk userinit(); // first user process __sync_synchronize(); started = 1; } else { while(started == 0) 80000e9e: 00008717 auipc a4,0x8 80000ea2: 17a70713 addi a4,a4,378 # 80009018 <started> if(cpuid() == 0){ 80000ea6: c139 beqz a0,80000eec <main+0x5e> while(started == 0) 80000ea8: 431c lw a5,0(a4) 80000eaa: 2781 sext.w a5,a5 80000eac: dff5 beqz a5,80000ea8 <main+0x1a> ; __sync_synchronize(); 80000eae: 0ff0000f fence printf("hart %d starting\n", cpuid()); 80000eb2: 00001097 auipc ra,0x1 80000eb6: ad2080e7 jalr -1326(ra) # 80001984 <cpuid> 80000eba: 85aa mv a1,a0 80000ebc: 00007517 auipc a0,0x7 80000ec0: 1fc50513 addi a0,a0,508 # 800080b8 <digits+0x78> 80000ec4: fffff097 auipc ra,0xfffff 80000ec8: 6c4080e7 jalr 1732(ra) # 80000588 <printf> kvminithart(); // turn on paging 80000ecc: 00000097 auipc ra,0x0 80000ed0: 0d8080e7 jalr 216(ra) # 80000fa4 <kvminithart> trapinithart(); // install kernel trap vector 80000ed4: 00002097 auipc ra,0x2 80000ed8: a98080e7 jalr -1384(ra) # 8000296c <trapinithart> plicinithart(); // ask PLIC for device interrupts 80000edc: 00005097 auipc ra,0x5 80000ee0: 094080e7 jalr 148(ra) # 80005f70 <plicinithart> } scheduler(); 80000ee4: 00001097 auipc ra,0x1 80000ee8: fe2080e7 jalr -30(ra) # 80001ec6 <scheduler> consoleinit(); 80000eec: fffff097 auipc ra,0xfffff 80000ef0: 564080e7 jalr 1380(ra) # 80000450 <consoleinit> printfinit(); 80000ef4: 00000097 auipc ra,0x0 80000ef8: 87a080e7 jalr -1926(ra) # 8000076e <printfinit> printf("\n"); 80000efc: 00007517 auipc a0,0x7 80000f00: 40c50513 addi a0,a0,1036 # 80008308 <digits+0x2c8> 80000f04: fffff097 auipc ra,0xfffff 80000f08: 684080e7 jalr 1668(ra) # 80000588 <printf> printf("xv6 kernel is booting\n"); 80000f0c: 00007517 auipc a0,0x7 80000f10: 19450513 addi a0,a0,404 # 800080a0 <digits+0x60> 80000f14: fffff097 auipc ra,0xfffff 80000f18: 674080e7 jalr 1652(ra) # 80000588 <printf> printf("\n"); 80000f1c: 00007517 auipc a0,0x7 80000f20: 3ec50513 addi a0,a0,1004 # 80008308 <digits+0x2c8> 80000f24: fffff097 auipc ra,0xfffff 80000f28: 664080e7 jalr 1636(ra) # 80000588 <printf> kinit(); // physical page allocator 80000f2c: 00000097 auipc ra,0x0 80000f30: b8c080e7 jalr -1140(ra) # 80000ab8 <kinit> kvminit(); // create kernel page table 80000f34: 00000097 auipc ra,0x0 80000f38: 322080e7 jalr 802(ra) # 80001256 <kvminit> kvminithart(); // turn on paging 80000f3c: 00000097 auipc ra,0x0 80000f40: 068080e7 jalr 104(ra) # 80000fa4 <kvminithart> procinit(); // process table 80000f44: 00001097 auipc ra,0x1 80000f48: 990080e7 jalr -1648(ra) # 800018d4 <procinit> trapinit(); // trap vectors 80000f4c: 00002097 auipc ra,0x2 80000f50: 9f8080e7 jalr -1544(ra) # 80002944 <trapinit> trapinithart(); // install kernel trap vector 80000f54: 00002097 auipc ra,0x2 80000f58: a18080e7 jalr -1512(ra) # 8000296c <trapinithart> plicinit(); // set up interrupt controller 80000f5c: 00005097 auipc ra,0x5 80000f60: ffe080e7 jalr -2(ra) # 80005f5a <plicinit> plicinithart(); // ask PLIC for device interrupts 80000f64: 00005097 auipc ra,0x5 80000f68: 00c080e7 jalr 12(ra) # 80005f70 <plicinithart> binit(); // buffer cache 80000f6c: 00002097 auipc ra,0x2 80000f70: 1f2080e7 jalr 498(ra) # 8000315e <binit> iinit(); // inode table 80000f74: 00003097 auipc ra,0x3 80000f78: 882080e7 jalr -1918(ra) # 800037f6 <iinit> fileinit(); // file table 80000f7c: 00004097 auipc ra,0x4 80000f80: 82c080e7 jalr -2004(ra) # 800047a8 <fileinit> virtio_disk_init(); // emulated hard disk 80000f84: 00005097 auipc ra,0x5 80000f88: 10e080e7 jalr 270(ra) # 80006092 <virtio_disk_init> userinit(); // first user process 80000f8c: 00001097 auipc ra,0x1 80000f90: d08080e7 jalr -760(ra) # 80001c94 <userinit> __sync_synchronize(); 80000f94: 0ff0000f fence started = 1; 80000f98: 4785 li a5,1 80000f9a: 00008717 auipc a4,0x8 80000f9e: 06f72f23 sw a5,126(a4) # 80009018 <started> 80000fa2: b789 j 80000ee4 <main+0x56> 0000000080000fa4 <kvminithart>: // Switch h/w page table register to the kernel's page table, // and enable paging. void kvminithart() { 80000fa4: 1141 addi sp,sp,-16 80000fa6: e422 sd s0,8(sp) 80000fa8: 0800 addi s0,sp,16 w_satp(MAKE_SATP(kernel_pagetable)); 80000faa: 00008797 auipc a5,0x8 80000fae: 0767b783 ld a5,118(a5) # 80009020 <kernel_pagetable> 80000fb2: 83b1 srli a5,a5,0xc 80000fb4: 577d li a4,-1 80000fb6: 177e slli a4,a4,0x3f 80000fb8: 8fd9 or a5,a5,a4 asm volatile("csrw satp, %0" : : "r" (x)); 80000fba: 18079073 csrw satp,a5 // flush the TLB. static inline void sfence_vma() { // the zero, zero means flush all TLB entries. asm volatile("sfence.vma zero, zero"); 80000fbe: 12000073 sfence.vma sfence_vma(); } 80000fc2: 6422 ld s0,8(sp) 80000fc4: 0141 addi sp,sp,16 80000fc6: 8082 ret 0000000080000fc8 <walk>: // 21..29 -- 9 bits of level-1 index. // 12..20 -- 9 bits of level-0 index. // 0..11 -- 12 bits of byte offset within the page. pte_t * walk(pagetable_t pagetable, uint64 va, int alloc) { 80000fc8: 7139 addi sp,sp,-64 80000fca: fc06 sd ra,56(sp) 80000fcc: f822 sd s0,48(sp) 80000fce: f426 sd s1,40(sp) 80000fd0: f04a sd s2,32(sp) 80000fd2: ec4e sd s3,24(sp) 80000fd4: e852 sd s4,16(sp) 80000fd6: e456 sd s5,8(sp) 80000fd8: e05a sd s6,0(sp) 80000fda: 0080 addi s0,sp,64 80000fdc: 84aa mv s1,a0 80000fde: 89ae mv s3,a1 80000fe0: 8ab2 mv s5,a2 if(va >= MAXVA) 80000fe2: 57fd li a5,-1 80000fe4: 83e9 srli a5,a5,0x1a 80000fe6: 4a79 li s4,30 panic("walk"); for(int level = 2; level > 0; level--) { 80000fe8: 4b31 li s6,12 if(va >= MAXVA) 80000fea: 04b7f263 bgeu a5,a1,8000102e <walk+0x66> panic("walk"); 80000fee: 00007517 auipc a0,0x7 80000ff2: 0e250513 addi a0,a0,226 # 800080d0 <digits+0x90> 80000ff6: fffff097 auipc ra,0xfffff 80000ffa: 548080e7 jalr 1352(ra) # 8000053e <panic> pte_t *pte = &pagetable[PX(level, va)]; if(*pte & PTE_V) { pagetable = (pagetable_t)PTE2PA(*pte); } else { if(!alloc || (pagetable = (pde_t*)kalloc()) == 0) 80000ffe: 060a8663 beqz s5,8000106a <walk+0xa2> 80001002: 00000097 auipc ra,0x0 80001006: af2080e7 jalr -1294(ra) # 80000af4 <kalloc> 8000100a: 84aa mv s1,a0 8000100c: c529 beqz a0,80001056 <walk+0x8e> return 0; memset(pagetable, 0, PGSIZE); 8000100e: 6605 lui a2,0x1 80001010: 4581 li a1,0 80001012: 00000097 auipc ra,0x0 80001016: cce080e7 jalr -818(ra) # 80000ce0 <memset> *pte = PA2PTE(pagetable) | PTE_V; 8000101a: 00c4d793 srli a5,s1,0xc 8000101e: 07aa slli a5,a5,0xa 80001020: 0017e793 ori a5,a5,1 80001024: 00f93023 sd a5,0(s2) for(int level = 2; level > 0; level--) { 80001028: 3a5d addiw s4,s4,-9 8000102a: 036a0063 beq s4,s6,8000104a <walk+0x82> pte_t *pte = &pagetable[PX(level, va)]; 8000102e: 0149d933 srl s2,s3,s4 80001032: 1ff97913 andi s2,s2,511 80001036: 090e slli s2,s2,0x3 80001038: 9926 add s2,s2,s1 if(*pte & PTE_V) { 8000103a: 00093483 ld s1,0(s2) 8000103e: 0014f793 andi a5,s1,1 80001042: dfd5 beqz a5,80000ffe <walk+0x36> pagetable = (pagetable_t)PTE2PA(*pte); 80001044: 80a9 srli s1,s1,0xa 80001046: 04b2 slli s1,s1,0xc 80001048: b7c5 j 80001028 <walk+0x60> } } return &pagetable[PX(0, va)]; 8000104a: 00c9d513 srli a0,s3,0xc 8000104e: 1ff57513 andi a0,a0,511 80001052: 050e slli a0,a0,0x3 80001054: 9526 add a0,a0,s1 } 80001056: 70e2 ld ra,56(sp) 80001058: 7442 ld s0,48(sp) 8000105a: 74a2 ld s1,40(sp) 8000105c: 7902 ld s2,32(sp) 8000105e: 69e2 ld s3,24(sp) 80001060: 6a42 ld s4,16(sp) 80001062: 6aa2 ld s5,8(sp) 80001064: 6b02 ld s6,0(sp) 80001066: 6121 addi sp,sp,64 80001068: 8082 ret return 0; 8000106a: 4501 li a0,0 8000106c: b7ed j 80001056 <walk+0x8e> 000000008000106e <walkaddr>: walkaddr(pagetable_t pagetable, uint64 va) { pte_t *pte; uint64 pa; if(va >= MAXVA) 8000106e: 57fd li a5,-1 80001070: 83e9 srli a5,a5,0x1a 80001072: 00b7f463 bgeu a5,a1,8000107a <walkaddr+0xc> return 0; 80001076: 4501 li a0,0 return 0; if((*pte & PTE_U) == 0) return 0; pa = PTE2PA(*pte); return pa; } 80001078: 8082 ret { 8000107a: 1141 addi sp,sp,-16 8000107c: e406 sd ra,8(sp) 8000107e: e022 sd s0,0(sp) 80001080: 0800 addi s0,sp,16 pte = walk(pagetable, va, 0); 80001082: 4601 li a2,0 80001084: 00000097 auipc ra,0x0 80001088: f44080e7 jalr -188(ra) # 80000fc8 <walk> if(pte == 0) 8000108c: c105 beqz a0,800010ac <walkaddr+0x3e> if((*pte & PTE_V) == 0) 8000108e: 611c ld a5,0(a0) if((*pte & PTE_U) == 0) 80001090: 0117f693 andi a3,a5,17 80001094: 4745 li a4,17 return 0; 80001096: 4501 li a0,0 if((*pte & PTE_U) == 0) 80001098: 00e68663 beq a3,a4,800010a4 <walkaddr+0x36> } 8000109c: 60a2 ld ra,8(sp) 8000109e: 6402 ld s0,0(sp) 800010a0: 0141 addi sp,sp,16 800010a2: 8082 ret pa = PTE2PA(*pte); 800010a4: 00a7d513 srli a0,a5,0xa 800010a8: 0532 slli a0,a0,0xc return pa; 800010aa: bfcd j 8000109c <walkaddr+0x2e> return 0; 800010ac: 4501 li a0,0 800010ae: b7fd j 8000109c <walkaddr+0x2e> 00000000800010b0 <mappages>: // physical addresses starting at pa. va and size might not // be page-aligned. Returns 0 on success, -1 if walk() couldn't // allocate a needed page-table page. int mappages(pagetable_t pagetable, uint64 va, uint64 size, uint64 pa, int perm) { 800010b0: 715d addi sp,sp,-80 800010b2: e486 sd ra,72(sp) 800010b4: e0a2 sd s0,64(sp) 800010b6: fc26 sd s1,56(sp) 800010b8: f84a sd s2,48(sp) 800010ba: f44e sd s3,40(sp) 800010bc: f052 sd s4,32(sp) 800010be: ec56 sd s5,24(sp) 800010c0: e85a sd s6,16(sp) 800010c2: e45e sd s7,8(sp) 800010c4: 0880 addi s0,sp,80 uint64 a, last; pte_t *pte; if(size == 0) 800010c6: c205 beqz a2,800010e6 <mappages+0x36> 800010c8: 8aaa mv s5,a0 800010ca: 8b3a mv s6,a4 panic("mappages: size"); a = PGROUNDDOWN(va); 800010cc: 77fd lui a5,0xfffff 800010ce: 00f5fa33 and s4,a1,a5 last = PGROUNDDOWN(va + size - 1); 800010d2: 15fd addi a1,a1,-1 800010d4: 00c589b3 add s3,a1,a2 800010d8: 00f9f9b3 and s3,s3,a5 a = PGROUNDDOWN(va); 800010dc: 8952 mv s2,s4 800010de: 41468a33 sub s4,a3,s4 if(*pte & PTE_V) panic("mappages: remap"); *pte = PA2PTE(pa) | perm | PTE_V; if(a == last) break; a += PGSIZE; 800010e2: 6b85 lui s7,0x1 800010e4: a015 j 80001108 <mappages+0x58> panic("mappages: size"); 800010e6: 00007517 auipc a0,0x7 800010ea: ff250513 addi a0,a0,-14 # 800080d8 <digits+0x98> 800010ee: fffff097 auipc ra,0xfffff 800010f2: 450080e7 jalr 1104(ra) # 8000053e <panic> panic("mappages: remap"); 800010f6: 00007517 auipc a0,0x7 800010fa: ff250513 addi a0,a0,-14 # 800080e8 <digits+0xa8> 800010fe: fffff097 auipc ra,0xfffff 80001102: 440080e7 jalr 1088(ra) # 8000053e <panic> a += PGSIZE; 80001106: 995e add s2,s2,s7 for(;;){ 80001108: 012a04b3 add s1,s4,s2 if((pte = walk(pagetable, a, 1)) == 0) 8000110c: 4605 li a2,1 8000110e: 85ca mv a1,s2 80001110: 8556 mv a0,s5 80001112: 00000097 auipc ra,0x0 80001116: eb6080e7 jalr -330(ra) # 80000fc8 <walk> 8000111a: cd19 beqz a0,80001138 <mappages+0x88> if(*pte & PTE_V) 8000111c: 611c ld a5,0(a0) 8000111e: 8b85 andi a5,a5,1 80001120: fbf9 bnez a5,800010f6 <mappages+0x46> *pte = PA2PTE(pa) | perm | PTE_V; 80001122: 80b1 srli s1,s1,0xc 80001124: 04aa slli s1,s1,0xa 80001126: 0164e4b3 or s1,s1,s6 8000112a: 0014e493 ori s1,s1,1 8000112e: e104 sd s1,0(a0) if(a == last) 80001130: fd391be3 bne s2,s3,80001106 <mappages+0x56> pa += PGSIZE; } return 0; 80001134: 4501 li a0,0 80001136: a011 j 8000113a <mappages+0x8a> return -1; 80001138: 557d li a0,-1 } 8000113a: 60a6 ld ra,72(sp) 8000113c: 6406 ld s0,64(sp) 8000113e: 74e2 ld s1,56(sp) 80001140: 7942 ld s2,48(sp) 80001142: 79a2 ld s3,40(sp) 80001144: 7a02 ld s4,32(sp) 80001146: 6ae2 ld s5,24(sp) 80001148: 6b42 ld s6,16(sp) 8000114a: 6ba2 ld s7,8(sp) 8000114c: 6161 addi sp,sp,80 8000114e: 8082 ret 0000000080001150 <kvmmap>: { 80001150: 1141 addi sp,sp,-16 80001152: e406 sd ra,8(sp) 80001154: e022 sd s0,0(sp) 80001156: 0800 addi s0,sp,16 80001158: 87b6 mv a5,a3 if(mappages(kpgtbl, va, sz, pa, perm) != 0) 8000115a: 86b2 mv a3,a2 8000115c: 863e mv a2,a5 8000115e: 00000097 auipc ra,0x0 80001162: f52080e7 jalr -174(ra) # 800010b0 <mappages> 80001166: e509 bnez a0,80001170 <kvmmap+0x20> } 80001168: 60a2 ld ra,8(sp) 8000116a: 6402 ld s0,0(sp) 8000116c: 0141 addi sp,sp,16 8000116e: 8082 ret panic("kvmmap"); 80001170: 00007517 auipc a0,0x7 80001174: f8850513 addi a0,a0,-120 # 800080f8 <digits+0xb8> 80001178: fffff097 auipc ra,0xfffff 8000117c: 3c6080e7 jalr 966(ra) # 8000053e <panic> 0000000080001180 <kvmmake>: { 80001180: 1101 addi sp,sp,-32 80001182: ec06 sd ra,24(sp) 80001184: e822 sd s0,16(sp) 80001186: e426 sd s1,8(sp) 80001188: e04a sd s2,0(sp) 8000118a: 1000 addi s0,sp,32 kpgtbl = (pagetable_t) kalloc(); 8000118c: 00000097 auipc ra,0x0 80001190: 968080e7 jalr -1688(ra) # 80000af4 <kalloc> 80001194: 84aa mv s1,a0 memset(kpgtbl, 0, PGSIZE); 80001196: 6605 lui a2,0x1 80001198: 4581 li a1,0 8000119a: 00000097 auipc ra,0x0 8000119e: b46080e7 jalr -1210(ra) # 80000ce0 <memset> kvmmap(kpgtbl, UART0, UART0, PGSIZE, PTE_R | PTE_W); 800011a2: 4719 li a4,6 800011a4: 6685 lui a3,0x1 800011a6: 10000637 lui a2,0x10000 800011aa: 100005b7 lui a1,0x10000 800011ae: 8526 mv a0,s1 800011b0: 00000097 auipc ra,0x0 800011b4: fa0080e7 jalr -96(ra) # 80001150 <kvmmap> kvmmap(kpgtbl, VIRTIO0, VIRTIO0, PGSIZE, PTE_R | PTE_W); 800011b8: 4719 li a4,6 800011ba: 6685 lui a3,0x1 800011bc: 10001637 lui a2,0x10001 800011c0: 100015b7 lui a1,0x10001 800011c4: 8526 mv a0,s1 800011c6: 00000097 auipc ra,0x0 800011ca: f8a080e7 jalr -118(ra) # 80001150 <kvmmap> kvmmap(kpgtbl, PLIC, PLIC, 0x400000, PTE_R | PTE_W); 800011ce: 4719 li a4,6 800011d0: 004006b7 lui a3,0x400 800011d4: 0c000637 lui a2,0xc000 800011d8: 0c0005b7 lui a1,0xc000 800011dc: 8526 mv a0,s1 800011de: 00000097 auipc ra,0x0 800011e2: f72080e7 jalr -142(ra) # 80001150 <kvmmap> kvmmap(kpgtbl, KERNBASE, KERNBASE, (uint64)etext-KERNBASE, PTE_R | PTE_X); 800011e6: 00007917 auipc s2,0x7 800011ea: e1a90913 addi s2,s2,-486 # 80008000 <etext> 800011ee: 4729 li a4,10 800011f0: 80007697 auipc a3,0x80007 800011f4: e1068693 addi a3,a3,-496 # 8000 <_entry-0x7fff8000> 800011f8: 4605 li a2,1 800011fa: 067e slli a2,a2,0x1f 800011fc: 85b2 mv a1,a2 800011fe: 8526 mv a0,s1 80001200: 00000097 auipc ra,0x0 80001204: f50080e7 jalr -176(ra) # 80001150 <kvmmap> kvmmap(kpgtbl, (uint64)etext, (uint64)etext, PHYSTOP-(uint64)etext, PTE_R | PTE_W); 80001208: 4719 li a4,6 8000120a: 46c5 li a3,17 8000120c: 06ee slli a3,a3,0x1b 8000120e: 412686b3 sub a3,a3,s2 80001212: 864a mv a2,s2 80001214: 85ca mv a1,s2 80001216: 8526 mv a0,s1 80001218: 00000097 auipc ra,0x0 8000121c: f38080e7 jalr -200(ra) # 80001150 <kvmmap> kvmmap(kpgtbl, TRAMPOLINE, (uint64)trampoline, PGSIZE, PTE_R | PTE_X); 80001220: 4729 li a4,10 80001222: 6685 lui a3,0x1 80001224: 00006617 auipc a2,0x6 80001228: ddc60613 addi a2,a2,-548 # 80007000 <_trampoline> 8000122c: 040005b7 lui a1,0x4000 80001230: 15fd addi a1,a1,-1 80001232: 05b2 slli a1,a1,0xc 80001234: 8526 mv a0,s1 80001236: 00000097 auipc ra,0x0 8000123a: f1a080e7 jalr -230(ra) # 80001150 <kvmmap> proc_mapstacks(kpgtbl); 8000123e: 8526 mv a0,s1 80001240: 00000097 auipc ra,0x0 80001244: 5fe080e7 jalr 1534(ra) # 8000183e <proc_mapstacks> } 80001248: 8526 mv a0,s1 8000124a: 60e2 ld ra,24(sp) 8000124c: 6442 ld s0,16(sp) 8000124e: 64a2 ld s1,8(sp) 80001250: 6902 ld s2,0(sp) 80001252: 6105 addi sp,sp,32 80001254: 8082 ret 0000000080001256 <kvminit>: { 80001256: 1141 addi sp,sp,-16 80001258: e406 sd ra,8(sp) 8000125a: e022 sd s0,0(sp) 8000125c: 0800 addi s0,sp,16 kernel_pagetable = kvmmake(); 8000125e: 00000097 auipc ra,0x0 80001262: f22080e7 jalr -222(ra) # 80001180 <kvmmake> 80001266: 00008797 auipc a5,0x8 8000126a: daa7bd23 sd a0,-582(a5) # 80009020 <kernel_pagetable> } 8000126e: 60a2 ld ra,8(sp) 80001270: 6402 ld s0,0(sp) 80001272: 0141 addi sp,sp,16 80001274: 8082 ret 0000000080001276 <uvmunmap>: // Remove npages of mappings starting from va. va must be // page-aligned. The mappings must exist. // Optionally free the physical memory. void uvmunmap(pagetable_t pagetable, uint64 va, uint64 npages, int do_free) { 80001276: 715d addi sp,sp,-80 80001278: e486 sd ra,72(sp) 8000127a: e0a2 sd s0,64(sp) 8000127c: fc26 sd s1,56(sp) 8000127e: f84a sd s2,48(sp) 80001280: f44e sd s3,40(sp) 80001282: f052 sd s4,32(sp) 80001284: ec56 sd s5,24(sp) 80001286: e85a sd s6,16(sp) 80001288: e45e sd s7,8(sp) 8000128a: 0880 addi s0,sp,80 uint64 a; pte_t *pte; if((va % PGSIZE) != 0) 8000128c: 03459793 slli a5,a1,0x34 80001290: e795 bnez a5,800012bc <uvmunmap+0x46> 80001292: 8a2a mv s4,a0 80001294: 892e mv s2,a1 80001296: 8ab6 mv s5,a3 panic("uvmunmap: not aligned"); for(a = va; a < va + npages*PGSIZE; a += PGSIZE){ 80001298: 0632 slli a2,a2,0xc 8000129a: 00b609b3 add s3,a2,a1 if((pte = walk(pagetable, a, 0)) == 0) panic("uvmunmap: walk"); if((*pte & PTE_V) == 0) panic("uvmunmap: not mapped"); if(PTE_FLAGS(*pte) == PTE_V) 8000129e: 4b85 li s7,1 for(a = va; a < va + npages*PGSIZE; a += PGSIZE){ 800012a0: 6b05 lui s6,0x1 800012a2: 0735e863 bltu a1,s3,80001312 <uvmunmap+0x9c> uint64 pa = PTE2PA(*pte); kfree((void*)pa); } *pte = 0; } } 800012a6: 60a6 ld ra,72(sp) 800012a8: 6406 ld s0,64(sp) 800012aa: 74e2 ld s1,56(sp) 800012ac: 7942 ld s2,48(sp) 800012ae: 79a2 ld s3,40(sp) 800012b0: 7a02 ld s4,32(sp) 800012b2: 6ae2 ld s5,24(sp) 800012b4: 6b42 ld s6,16(sp) 800012b6: 6ba2 ld s7,8(sp) 800012b8: 6161 addi sp,sp,80 800012ba: 8082 ret panic("uvmunmap: not aligned"); 800012bc: 00007517 auipc a0,0x7 800012c0: e4450513 addi a0,a0,-444 # 80008100 <digits+0xc0> 800012c4: fffff097 auipc ra,0xfffff 800012c8: 27a080e7 jalr 634(ra) # 8000053e <panic> panic("uvmunmap: walk"); 800012cc: 00007517 auipc a0,0x7 800012d0: e4c50513 addi a0,a0,-436 # 80008118 <digits+0xd8> 800012d4: fffff097 auipc ra,0xfffff 800012d8: 26a080e7 jalr 618(ra) # 8000053e <panic> panic("uvmunmap: not mapped"); 800012dc: 00007517 auipc a0,0x7 800012e0: e4c50513 addi a0,a0,-436 # 80008128 <digits+0xe8> 800012e4: fffff097 auipc ra,0xfffff 800012e8: 25a080e7 jalr 602(ra) # 8000053e <panic> panic("uvmunmap: not a leaf"); 800012ec: 00007517 auipc a0,0x7 800012f0: e5450513 addi a0,a0,-428 # 80008140 <digits+0x100> 800012f4: fffff097 auipc ra,0xfffff 800012f8: 24a080e7 jalr 586(ra) # 8000053e <panic> uint64 pa = PTE2PA(*pte); 800012fc: 8129 srli a0,a0,0xa kfree((void*)pa); 800012fe: 0532 slli a0,a0,0xc 80001300: fffff097 auipc ra,0xfffff 80001304: 6f8080e7 jalr 1784(ra) # 800009f8 <kfree> *pte = 0; 80001308: 0004b023 sd zero,0(s1) for(a = va; a < va + npages*PGSIZE; a += PGSIZE){ 8000130c: 995a add s2,s2,s6 8000130e: f9397ce3 bgeu s2,s3,800012a6 <uvmunmap+0x30> if((pte = walk(pagetable, a, 0)) == 0) 80001312: 4601 li a2,0 80001314: 85ca mv a1,s2 80001316: 8552 mv a0,s4 80001318: 00000097 auipc ra,0x0 8000131c: cb0080e7 jalr -848(ra) # 80000fc8 <walk> 80001320: 84aa mv s1,a0 80001322: d54d beqz a0,800012cc <uvmunmap+0x56> if((*pte & PTE_V) == 0) 80001324: 6108 ld a0,0(a0) 80001326: 00157793 andi a5,a0,1 8000132a: dbcd beqz a5,800012dc <uvmunmap+0x66> if(PTE_FLAGS(*pte) == PTE_V) 8000132c: 3ff57793 andi a5,a0,1023 80001330: fb778ee3 beq a5,s7,800012ec <uvmunmap+0x76> if(do_free){ 80001334: fc0a8ae3 beqz s5,80001308 <uvmunmap+0x92> 80001338: b7d1 j 800012fc <uvmunmap+0x86> 000000008000133a <uvmcreate>: // create an empty user page table. // returns 0 if out of memory. pagetable_t uvmcreate() { 8000133a: 1101 addi sp,sp,-32 8000133c: ec06 sd ra,24(sp) 8000133e: e822 sd s0,16(sp) 80001340: e426 sd s1,8(sp) 80001342: 1000 addi s0,sp,32 pagetable_t pagetable; pagetable = (pagetable_t) kalloc(); 80001344: fffff097 auipc ra,0xfffff 80001348: 7b0080e7 jalr 1968(ra) # 80000af4 <kalloc> 8000134c: 84aa mv s1,a0 if(pagetable == 0) 8000134e: c519 beqz a0,8000135c <uvmcreate+0x22> return 0; memset(pagetable, 0, PGSIZE); 80001350: 6605 lui a2,0x1 80001352: 4581 li a1,0 80001354: 00000097 auipc ra,0x0 80001358: 98c080e7 jalr -1652(ra) # 80000ce0 <memset> return pagetable; } 8000135c: 8526 mv a0,s1 8000135e: 60e2 ld ra,24(sp) 80001360: 6442 ld s0,16(sp) 80001362: 64a2 ld s1,8(sp) 80001364: 6105 addi sp,sp,32 80001366: 8082 ret 0000000080001368 <uvminit>: // Load the user initcode into address 0 of pagetable, // for the very first process. // sz must be less than a page. void uvminit(pagetable_t pagetable, uchar *src, uint sz) { 80001368: 7179 addi sp,sp,-48 8000136a: f406 sd ra,40(sp) 8000136c: f022 sd s0,32(sp) 8000136e: ec26 sd s1,24(sp) 80001370: e84a sd s2,16(sp) 80001372: e44e sd s3,8(sp) 80001374: e052 sd s4,0(sp) 80001376: 1800 addi s0,sp,48 char *mem; if(sz >= PGSIZE) 80001378: 6785 lui a5,0x1 8000137a: 04f67863 bgeu a2,a5,800013ca <uvminit+0x62> 8000137e: 8a2a mv s4,a0 80001380: 89ae mv s3,a1 80001382: 84b2 mv s1,a2 panic("inituvm: more than a page"); mem = kalloc(); 80001384: fffff097 auipc ra,0xfffff 80001388: 770080e7 jalr 1904(ra) # 80000af4 <kalloc> 8000138c: 892a mv s2,a0 memset(mem, 0, PGSIZE); 8000138e: 6605 lui a2,0x1 80001390: 4581 li a1,0 80001392: 00000097 auipc ra,0x0 80001396: 94e080e7 jalr -1714(ra) # 80000ce0 <memset> mappages(pagetable, 0, PGSIZE, (uint64)mem, PTE_W|PTE_R|PTE_X|PTE_U); 8000139a: 4779 li a4,30 8000139c: 86ca mv a3,s2 8000139e: 6605 lui a2,0x1 800013a0: 4581 li a1,0 800013a2: 8552 mv a0,s4 800013a4: 00000097 auipc ra,0x0 800013a8: d0c080e7 jalr -756(ra) # 800010b0 <mappages> memmove(mem, src, sz); 800013ac: 8626 mv a2,s1 800013ae: 85ce mv a1,s3 800013b0: 854a mv a0,s2 800013b2: 00000097 auipc ra,0x0 800013b6: 98e080e7 jalr -1650(ra) # 80000d40 <memmove> } 800013ba: 70a2 ld ra,40(sp) 800013bc: 7402 ld s0,32(sp) 800013be: 64e2 ld s1,24(sp) 800013c0: 6942 ld s2,16(sp) 800013c2: 69a2 ld s3,8(sp) 800013c4: 6a02 ld s4,0(sp) 800013c6: 6145 addi sp,sp,48 800013c8: 8082 ret panic("inituvm: more than a page"); 800013ca: 00007517 auipc a0,0x7 800013ce: d8e50513 addi a0,a0,-626 # 80008158 <digits+0x118> 800013d2: fffff097 auipc ra,0xfffff 800013d6: 16c080e7 jalr 364(ra) # 8000053e <panic> 00000000800013da <uvmdealloc>: // newsz. oldsz and newsz need not be page-aligned, nor does newsz // need to be less than oldsz. oldsz can be larger than the actual // process size. Returns the new process size. uint64 uvmdealloc(pagetable_t pagetable, uint64 oldsz, uint64 newsz) { 800013da: 1101 addi sp,sp,-32 800013dc: ec06 sd ra,24(sp) 800013de: e822 sd s0,16(sp) 800013e0: e426 sd s1,8(sp) 800013e2: 1000 addi s0,sp,32 if(newsz >= oldsz) return oldsz; 800013e4: 84ae mv s1,a1 if(newsz >= oldsz) 800013e6: 00b67d63 bgeu a2,a1,80001400 <uvmdealloc+0x26> 800013ea: 84b2 mv s1,a2 if(PGROUNDUP(newsz) < PGROUNDUP(oldsz)){ 800013ec: 6785 lui a5,0x1 800013ee: 17fd addi a5,a5,-1 800013f0: 00f60733 add a4,a2,a5 800013f4: 767d lui a2,0xfffff 800013f6: 8f71 and a4,a4,a2 800013f8: 97ae add a5,a5,a1 800013fa: 8ff1 and a5,a5,a2 800013fc: 00f76863 bltu a4,a5,8000140c <uvmdealloc+0x32> int npages = (PGROUNDUP(oldsz) - PGROUNDUP(newsz)) / PGSIZE; uvmunmap(pagetable, PGROUNDUP(newsz), npages, 1); } return newsz; } 80001400: 8526 mv a0,s1 80001402: 60e2 ld ra,24(sp) 80001404: 6442 ld s0,16(sp) 80001406: 64a2 ld s1,8(sp) 80001408: 6105 addi sp,sp,32 8000140a: 8082 ret int npages = (PGROUNDUP(oldsz) - PGROUNDUP(newsz)) / PGSIZE; 8000140c: 8f99 sub a5,a5,a4 8000140e: 83b1 srli a5,a5,0xc uvmunmap(pagetable, PGROUNDUP(newsz), npages, 1); 80001410: 4685 li a3,1 80001412: 0007861b sext.w a2,a5 80001416: 85ba mv a1,a4 80001418: 00000097 auipc ra,0x0 8000141c: e5e080e7 jalr -418(ra) # 80001276 <uvmunmap> 80001420: b7c5 j 80001400 <uvmdealloc+0x26> 0000000080001422 <uvmalloc>: if(newsz < oldsz) 80001422: 0ab66163 bltu a2,a1,800014c4 <uvmalloc+0xa2> { 80001426: 7139 addi sp,sp,-64 80001428: fc06 sd ra,56(sp) 8000142a: f822 sd s0,48(sp) 8000142c: f426 sd s1,40(sp) 8000142e: f04a sd s2,32(sp) 80001430: ec4e sd s3,24(sp) 80001432: e852 sd s4,16(sp) 80001434: e456 sd s5,8(sp) 80001436: 0080 addi s0,sp,64 80001438: 8aaa mv s5,a0 8000143a: 8a32 mv s4,a2 oldsz = PGROUNDUP(oldsz); 8000143c: 6985 lui s3,0x1 8000143e: 19fd addi s3,s3,-1 80001440: 95ce add a1,a1,s3 80001442: 79fd lui s3,0xfffff 80001444: 0135f9b3 and s3,a1,s3 for(a = oldsz; a < newsz; a += PGSIZE){ 80001448: 08c9f063 bgeu s3,a2,800014c8 <uvmalloc+0xa6> 8000144c: 894e mv s2,s3 mem = kalloc(); 8000144e: fffff097 auipc ra,0xfffff 80001452: 6a6080e7 jalr 1702(ra) # 80000af4 <kalloc> 80001456: 84aa mv s1,a0 if(mem == 0){ 80001458: c51d beqz a0,80001486 <uvmalloc+0x64> memset(mem, 0, PGSIZE); 8000145a: 6605 lui a2,0x1 8000145c: 4581 li a1,0 8000145e: 00000097 auipc ra,0x0 80001462: 882080e7 jalr -1918(ra) # 80000ce0 <memset> if(mappages(pagetable, a, PGSIZE, (uint64)mem, PTE_W|PTE_X|PTE_R|PTE_U) != 0){ 80001466: 4779 li a4,30 80001468: 86a6 mv a3,s1 8000146a: 6605 lui a2,0x1 8000146c: 85ca mv a1,s2 8000146e: 8556 mv a0,s5 80001470: 00000097 auipc ra,0x0 80001474: c40080e7 jalr -960(ra) # 800010b0 <mappages> 80001478: e905 bnez a0,800014a8 <uvmalloc+0x86> for(a = oldsz; a < newsz; a += PGSIZE){ 8000147a: 6785 lui a5,0x1 8000147c: 993e add s2,s2,a5 8000147e: fd4968e3 bltu s2,s4,8000144e <uvmalloc+0x2c> return newsz; 80001482: 8552 mv a0,s4 80001484: a809 j 80001496 <uvmalloc+0x74> uvmdealloc(pagetable, a, oldsz); 80001486: 864e mv a2,s3 80001488: 85ca mv a1,s2 8000148a: 8556 mv a0,s5 8000148c: 00000097 auipc ra,0x0 80001490: f4e080e7 jalr -178(ra) # 800013da <uvmdealloc> return 0; 80001494: 4501 li a0,0 } 80001496: 70e2 ld ra,56(sp) 80001498: 7442 ld s0,48(sp) 8000149a: 74a2 ld s1,40(sp) 8000149c: 7902 ld s2,32(sp) 8000149e: 69e2 ld s3,24(sp) 800014a0: 6a42 ld s4,16(sp) 800014a2: 6aa2 ld s5,8(sp) 800014a4: 6121 addi sp,sp,64 800014a6: 8082 ret kfree(mem); 800014a8: 8526 mv a0,s1 800014aa: fffff097 auipc ra,0xfffff 800014ae: 54e080e7 jalr 1358(ra) # 800009f8 <kfree> uvmdealloc(pagetable, a, oldsz); 800014b2: 864e mv a2,s3 800014b4: 85ca mv a1,s2 800014b6: 8556 mv a0,s5 800014b8: 00000097 auipc ra,0x0 800014bc: f22080e7 jalr -222(ra) # 800013da <uvmdealloc> return 0; 800014c0: 4501 li a0,0 800014c2: bfd1 j 80001496 <uvmalloc+0x74> return oldsz; 800014c4: 852e mv a0,a1 } 800014c6: 8082 ret return newsz; 800014c8: 8532 mv a0,a2 800014ca: b7f1 j 80001496 <uvmalloc+0x74> 00000000800014cc <freewalk>: // Recursively free page-table pages. // All leaf mappings must already have been removed. void freewalk(pagetable_t pagetable) { 800014cc: 7179 addi sp,sp,-48 800014ce: f406 sd ra,40(sp) 800014d0: f022 sd s0,32(sp) 800014d2: ec26 sd s1,24(sp) 800014d4: e84a sd s2,16(sp) 800014d6: e44e sd s3,8(sp) 800014d8: e052 sd s4,0(sp) 800014da: 1800 addi s0,sp,48 800014dc: 8a2a mv s4,a0 // there are 2^9 = 512 PTEs in a page table. for(int i = 0; i < 512; i++){ 800014de: 84aa mv s1,a0 800014e0: 6905 lui s2,0x1 800014e2: 992a add s2,s2,a0 pte_t pte = pagetable[i]; if((pte & PTE_V) && (pte & (PTE_R|PTE_W|PTE_X)) == 0){ 800014e4: 4985 li s3,1 800014e6: a821 j 800014fe <freewalk+0x32> // this PTE points to a lower-level page table. uint64 child = PTE2PA(pte); 800014e8: 8129 srli a0,a0,0xa freewalk((pagetable_t)child); 800014ea: 0532 slli a0,a0,0xc 800014ec: 00000097 auipc ra,0x0 800014f0: fe0080e7 jalr -32(ra) # 800014cc <freewalk> pagetable[i] = 0; 800014f4: 0004b023 sd zero,0(s1) for(int i = 0; i < 512; i++){ 800014f8: 04a1 addi s1,s1,8 800014fa: 03248163 beq s1,s2,8000151c <freewalk+0x50> pte_t pte = pagetable[i]; 800014fe: 6088 ld a0,0(s1) if((pte & PTE_V) && (pte & (PTE_R|PTE_W|PTE_X)) == 0){ 80001500: 00f57793 andi a5,a0,15 80001504: ff3782e3 beq a5,s3,800014e8 <freewalk+0x1c> } else if(pte & PTE_V){ 80001508: 8905 andi a0,a0,1 8000150a: d57d beqz a0,800014f8 <freewalk+0x2c> panic("freewalk: leaf"); 8000150c: 00007517 auipc a0,0x7 80001510: c6c50513 addi a0,a0,-916 # 80008178 <digits+0x138> 80001514: fffff097 auipc ra,0xfffff 80001518: 02a080e7 jalr 42(ra) # 8000053e <panic> } } kfree((void*)pagetable); 8000151c: 8552 mv a0,s4 8000151e: fffff097 auipc ra,0xfffff 80001522: 4da080e7 jalr 1242(ra) # 800009f8 <kfree> } 80001526: 70a2 ld ra,40(sp) 80001528: 7402 ld s0,32(sp) 8000152a: 64e2 ld s1,24(sp) 8000152c: 6942 ld s2,16(sp) 8000152e: 69a2 ld s3,8(sp) 80001530: 6a02 ld s4,0(sp) 80001532: 6145 addi sp,sp,48 80001534: 8082 ret 0000000080001536 <uvmfree>: // Free user memory pages, // then free page-table pages. void uvmfree(pagetable_t pagetable, uint64 sz) { 80001536: 1101 addi sp,sp,-32 80001538: ec06 sd ra,24(sp) 8000153a: e822 sd s0,16(sp) 8000153c: e426 sd s1,8(sp) 8000153e: 1000 addi s0,sp,32 80001540: 84aa mv s1,a0 if(sz > 0) 80001542: e999 bnez a1,80001558 <uvmfree+0x22> uvmunmap(pagetable, 0, PGROUNDUP(sz)/PGSIZE, 1); freewalk(pagetable); 80001544: 8526 mv a0,s1 80001546: 00000097 auipc ra,0x0 8000154a: f86080e7 jalr -122(ra) # 800014cc <freewalk> } 8000154e: 60e2 ld ra,24(sp) 80001550: 6442 ld s0,16(sp) 80001552: 64a2 ld s1,8(sp) 80001554: 6105 addi sp,sp,32 80001556: 8082 ret uvmunmap(pagetable, 0, PGROUNDUP(sz)/PGSIZE, 1); 80001558: 6605 lui a2,0x1 8000155a: 167d addi a2,a2,-1 8000155c: 962e add a2,a2,a1 8000155e: 4685 li a3,1 80001560: 8231 srli a2,a2,0xc 80001562: 4581 li a1,0 80001564: 00000097 auipc ra,0x0 80001568: d12080e7 jalr -750(ra) # 80001276 <uvmunmap> 8000156c: bfe1 j 80001544 <uvmfree+0xe> 000000008000156e <uvmcopy>: pte_t *pte; uint64 pa, i; uint flags; char *mem; for(i = 0; i < sz; i += PGSIZE){ 8000156e: c679 beqz a2,8000163c <uvmcopy+0xce> { 80001570: 715d addi sp,sp,-80 80001572: e486 sd ra,72(sp) 80001574: e0a2 sd s0,64(sp) 80001576: fc26 sd s1,56(sp) 80001578: f84a sd s2,48(sp) 8000157a: f44e sd s3,40(sp) 8000157c: f052 sd s4,32(sp) 8000157e: ec56 sd s5,24(sp) 80001580: e85a sd s6,16(sp) 80001582: e45e sd s7,8(sp) 80001584: 0880 addi s0,sp,80 80001586: 8b2a mv s6,a0 80001588: 8aae mv s5,a1 8000158a: 8a32 mv s4,a2 for(i = 0; i < sz; i += PGSIZE){ 8000158c: 4981 li s3,0 if((pte = walk(old, i, 0)) == 0) 8000158e: 4601 li a2,0 80001590: 85ce mv a1,s3 80001592: 855a mv a0,s6 80001594: 00000097 auipc ra,0x0 80001598: a34080e7 jalr -1484(ra) # 80000fc8 <walk> 8000159c: c531 beqz a0,800015e8 <uvmcopy+0x7a> panic("uvmcopy: pte should exist"); if((*pte & PTE_V) == 0) 8000159e: 6118 ld a4,0(a0) 800015a0: 00177793 andi a5,a4,1 800015a4: cbb1 beqz a5,800015f8 <uvmcopy+0x8a> panic("uvmcopy: page not present"); pa = PTE2PA(*pte); 800015a6: 00a75593 srli a1,a4,0xa 800015aa: 00c59b93 slli s7,a1,0xc flags = PTE_FLAGS(*pte); 800015ae: 3ff77493 andi s1,a4,1023 if((mem = kalloc()) == 0) 800015b2: fffff097 auipc ra,0xfffff 800015b6: 542080e7 jalr 1346(ra) # 80000af4 <kalloc> 800015ba: 892a mv s2,a0 800015bc: c939 beqz a0,80001612 <uvmcopy+0xa4> goto err; memmove(mem, (char*)pa, PGSIZE); 800015be: 6605 lui a2,0x1 800015c0: 85de mv a1,s7 800015c2: fffff097 auipc ra,0xfffff 800015c6: 77e080e7 jalr 1918(ra) # 80000d40 <memmove> if(mappages(new, i, PGSIZE, (uint64)mem, flags) != 0){ 800015ca: 8726 mv a4,s1 800015cc: 86ca mv a3,s2 800015ce: 6605 lui a2,0x1 800015d0: 85ce mv a1,s3 800015d2: 8556 mv a0,s5 800015d4: 00000097 auipc ra,0x0 800015d8: adc080e7 jalr -1316(ra) # 800010b0 <mappages> 800015dc: e515 bnez a0,80001608 <uvmcopy+0x9a> for(i = 0; i < sz; i += PGSIZE){ 800015de: 6785 lui a5,0x1 800015e0: 99be add s3,s3,a5 800015e2: fb49e6e3 bltu s3,s4,8000158e <uvmcopy+0x20> 800015e6: a081 j 80001626 <uvmcopy+0xb8> panic("uvmcopy: pte should exist"); 800015e8: 00007517 auipc a0,0x7 800015ec: ba050513 addi a0,a0,-1120 # 80008188 <digits+0x148> 800015f0: fffff097 auipc ra,0xfffff 800015f4: f4e080e7 jalr -178(ra) # 8000053e <panic> panic("uvmcopy: page not present"); 800015f8: 00007517 auipc a0,0x7 800015fc: bb050513 addi a0,a0,-1104 # 800081a8 <digits+0x168> 80001600: fffff097 auipc ra,0xfffff 80001604: f3e080e7 jalr -194(ra) # 8000053e <panic> kfree(mem); 80001608: 854a mv a0,s2 8000160a: fffff097 auipc ra,0xfffff 8000160e: 3ee080e7 jalr 1006(ra) # 800009f8 <kfree> } } return 0; err: uvmunmap(new, 0, i / PGSIZE, 1); 80001612: 4685 li a3,1 80001614: 00c9d613 srli a2,s3,0xc 80001618: 4581 li a1,0 8000161a: 8556 mv a0,s5 8000161c: 00000097 auipc ra,0x0 80001620: c5a080e7 jalr -934(ra) # 80001276 <uvmunmap> return -1; 80001624: 557d li a0,-1 } 80001626: 60a6 ld ra,72(sp) 80001628: 6406 ld s0,64(sp) 8000162a: 74e2 ld s1,56(sp) 8000162c: 7942 ld s2,48(sp) 8000162e: 79a2 ld s3,40(sp) 80001630: 7a02 ld s4,32(sp) 80001632: 6ae2 ld s5,24(sp) 80001634: 6b42 ld s6,16(sp) 80001636: 6ba2 ld s7,8(sp) 80001638: 6161 addi sp,sp,80 8000163a: 8082 ret return 0; 8000163c: 4501 li a0,0 } 8000163e: 8082 ret 0000000080001640 <uvmclear>: // mark a PTE invalid for user access. // used by exec for the user stack guard page. void uvmclear(pagetable_t pagetable, uint64 va) { 80001640: 1141 addi sp,sp,-16 80001642: e406 sd ra,8(sp) 80001644: e022 sd s0,0(sp) 80001646: 0800 addi s0,sp,16 pte_t *pte; pte = walk(pagetable, va, 0); 80001648: 4601 li a2,0 8000164a: 00000097 auipc ra,0x0 8000164e: 97e080e7 jalr -1666(ra) # 80000fc8 <walk> if(pte == 0) 80001652: c901 beqz a0,80001662 <uvmclear+0x22> panic("uvmclear"); *pte &= ~PTE_U; 80001654: 611c ld a5,0(a0) 80001656: 9bbd andi a5,a5,-17 80001658: e11c sd a5,0(a0) } 8000165a: 60a2 ld ra,8(sp) 8000165c: 6402 ld s0,0(sp) 8000165e: 0141 addi sp,sp,16 80001660: 8082 ret panic("uvmclear"); 80001662: 00007517 auipc a0,0x7 80001666: b6650513 addi a0,a0,-1178 # 800081c8 <digits+0x188> 8000166a: fffff097 auipc ra,0xfffff 8000166e: ed4080e7 jalr -300(ra) # 8000053e <panic> 0000000080001672 <copyout>: int copyout(pagetable_t pagetable, uint64 dstva, char *src, uint64 len) { uint64 n, va0, pa0; while(len > 0){ 80001672: c6bd beqz a3,800016e0 <copyout+0x6e> { 80001674: 715d addi sp,sp,-80 80001676: e486 sd ra,72(sp) 80001678: e0a2 sd s0,64(sp) 8000167a: fc26 sd s1,56(sp) 8000167c: f84a sd s2,48(sp) 8000167e: f44e sd s3,40(sp) 80001680: f052 sd s4,32(sp) 80001682: ec56 sd s5,24(sp) 80001684: e85a sd s6,16(sp) 80001686: e45e sd s7,8(sp) 80001688: e062 sd s8,0(sp) 8000168a: 0880 addi s0,sp,80 8000168c: 8b2a mv s6,a0 8000168e: 8c2e mv s8,a1 80001690: 8a32 mv s4,a2 80001692: 89b6 mv s3,a3 va0 = PGROUNDDOWN(dstva); 80001694: 7bfd lui s7,0xfffff pa0 = walkaddr(pagetable, va0); if(pa0 == 0) return -1; n = PGSIZE - (dstva - va0); 80001696: 6a85 lui s5,0x1 80001698: a015 j 800016bc <copyout+0x4a> if(n > len) n = len; memmove((void *)(pa0 + (dstva - va0)), src, n); 8000169a: 9562 add a0,a0,s8 8000169c: 0004861b sext.w a2,s1 800016a0: 85d2 mv a1,s4 800016a2: 41250533 sub a0,a0,s2 800016a6: fffff097 auipc ra,0xfffff 800016aa: 69a080e7 jalr 1690(ra) # 80000d40 <memmove> len -= n; 800016ae: 409989b3 sub s3,s3,s1 src += n; 800016b2: 9a26 add s4,s4,s1 dstva = va0 + PGSIZE; 800016b4: 01590c33 add s8,s2,s5 while(len > 0){ 800016b8: 02098263 beqz s3,800016dc <copyout+0x6a> va0 = PGROUNDDOWN(dstva); 800016bc: 017c7933 and s2,s8,s7 pa0 = walkaddr(pagetable, va0); 800016c0: 85ca mv a1,s2 800016c2: 855a mv a0,s6 800016c4: 00000097 auipc ra,0x0 800016c8: 9aa080e7 jalr -1622(ra) # 8000106e <walkaddr> if(pa0 == 0) 800016cc: cd01 beqz a0,800016e4 <copyout+0x72> n = PGSIZE - (dstva - va0); 800016ce: 418904b3 sub s1,s2,s8 800016d2: 94d6 add s1,s1,s5 if(n > len) 800016d4: fc99f3e3 bgeu s3,s1,8000169a <copyout+0x28> 800016d8: 84ce mv s1,s3 800016da: b7c1 j 8000169a <copyout+0x28> } return 0; 800016dc: 4501 li a0,0 800016de: a021 j 800016e6 <copyout+0x74> 800016e0: 4501 li a0,0 } 800016e2: 8082 ret return -1; 800016e4: 557d li a0,-1 } 800016e6: 60a6 ld ra,72(sp) 800016e8: 6406 ld s0,64(sp) 800016ea: 74e2 ld s1,56(sp) 800016ec: 7942 ld s2,48(sp) 800016ee: 79a2 ld s3,40(sp) 800016f0: 7a02 ld s4,32(sp) 800016f2: 6ae2 ld s5,24(sp) 800016f4: 6b42 ld s6,16(sp) 800016f6: 6ba2 ld s7,8(sp) 800016f8: 6c02 ld s8,0(sp) 800016fa: 6161 addi sp,sp,80 800016fc: 8082 ret 00000000800016fe <copyin>: int copyin(pagetable_t pagetable, char *dst, uint64 srcva, uint64 len) { uint64 n, va0, pa0; while(len > 0){ 800016fe: c6bd beqz a3,8000176c <copyin+0x6e> { 80001700: 715d addi sp,sp,-80 80001702: e486 sd ra,72(sp) 80001704: e0a2 sd s0,64(sp) 80001706: fc26 sd s1,56(sp) 80001708: f84a sd s2,48(sp) 8000170a: f44e sd s3,40(sp) 8000170c: f052 sd s4,32(sp) 8000170e: ec56 sd s5,24(sp) 80001710: e85a sd s6,16(sp) 80001712: e45e sd s7,8(sp) 80001714: e062 sd s8,0(sp) 80001716: 0880 addi s0,sp,80 80001718: 8b2a mv s6,a0 8000171a: 8a2e mv s4,a1 8000171c: 8c32 mv s8,a2 8000171e: 89b6 mv s3,a3 va0 = PGROUNDDOWN(srcva); 80001720: 7bfd lui s7,0xfffff pa0 = walkaddr(pagetable, va0); if(pa0 == 0) return -1; n = PGSIZE - (srcva - va0); 80001722: 6a85 lui s5,0x1 80001724: a015 j 80001748 <copyin+0x4a> if(n > len) n = len; memmove(dst, (void *)(pa0 + (srcva - va0)), n); 80001726: 9562 add a0,a0,s8 80001728: 0004861b sext.w a2,s1 8000172c: 412505b3 sub a1,a0,s2 80001730: 8552 mv a0,s4 80001732: fffff097 auipc ra,0xfffff 80001736: 60e080e7 jalr 1550(ra) # 80000d40 <memmove> len -= n; 8000173a: 409989b3 sub s3,s3,s1 dst += n; 8000173e: 9a26 add s4,s4,s1 srcva = va0 + PGSIZE; 80001740: 01590c33 add s8,s2,s5 while(len > 0){ 80001744: 02098263 beqz s3,80001768 <copyin+0x6a> va0 = PGROUNDDOWN(srcva); 80001748: 017c7933 and s2,s8,s7 pa0 = walkaddr(pagetable, va0); 8000174c: 85ca mv a1,s2 8000174e: 855a mv a0,s6 80001750: 00000097 auipc ra,0x0 80001754: 91e080e7 jalr -1762(ra) # 8000106e <walkaddr> if(pa0 == 0) 80001758: cd01 beqz a0,80001770 <copyin+0x72> n = PGSIZE - (srcva - va0); 8000175a: 418904b3 sub s1,s2,s8 8000175e: 94d6 add s1,s1,s5 if(n > len) 80001760: fc99f3e3 bgeu s3,s1,80001726 <copyin+0x28> 80001764: 84ce mv s1,s3 80001766: b7c1 j 80001726 <copyin+0x28> } return 0; 80001768: 4501 li a0,0 8000176a: a021 j 80001772 <copyin+0x74> 8000176c: 4501 li a0,0 } 8000176e: 8082 ret return -1; 80001770: 557d li a0,-1 } 80001772: 60a6 ld ra,72(sp) 80001774: 6406 ld s0,64(sp) 80001776: 74e2 ld s1,56(sp) 80001778: 7942 ld s2,48(sp) 8000177a: 79a2 ld s3,40(sp) 8000177c: 7a02 ld s4,32(sp) 8000177e: 6ae2 ld s5,24(sp) 80001780: 6b42 ld s6,16(sp) 80001782: 6ba2 ld s7,8(sp) 80001784: 6c02 ld s8,0(sp) 80001786: 6161 addi sp,sp,80 80001788: 8082 ret 000000008000178a <copyinstr>: copyinstr(pagetable_t pagetable, char *dst, uint64 srcva, uint64 max) { uint64 n, va0, pa0; int got_null = 0; while(got_null == 0 && max > 0){ 8000178a: c6c5 beqz a3,80001832 <copyinstr+0xa8> { 8000178c: 715d addi sp,sp,-80 8000178e: e486 sd ra,72(sp) 80001790: e0a2 sd s0,64(sp) 80001792: fc26 sd s1,56(sp) 80001794: f84a sd s2,48(sp) 80001796: f44e sd s3,40(sp) 80001798: f052 sd s4,32(sp) 8000179a: ec56 sd s5,24(sp) 8000179c: e85a sd s6,16(sp) 8000179e: e45e sd s7,8(sp) 800017a0: 0880 addi s0,sp,80 800017a2: 8a2a mv s4,a0 800017a4: 8b2e mv s6,a1 800017a6: 8bb2 mv s7,a2 800017a8: 84b6 mv s1,a3 va0 = PGROUNDDOWN(srcva); 800017aa: 7afd lui s5,0xfffff pa0 = walkaddr(pagetable, va0); if(pa0 == 0) return -1; n = PGSIZE - (srcva - va0); 800017ac: 6985 lui s3,0x1 800017ae: a035 j 800017da <copyinstr+0x50> n = max; char *p = (char *) (pa0 + (srcva - va0)); while(n > 0){ if(*p == '\0'){ *dst = '\0'; 800017b0: 00078023 sb zero,0(a5) # 1000 <_entry-0x7ffff000> 800017b4: 4785 li a5,1 dst++; } srcva = va0 + PGSIZE; } if(got_null){ 800017b6: 0017b793 seqz a5,a5 800017ba: 40f00533 neg a0,a5 return 0; } else { return -1; } } 800017be: 60a6 ld ra,72(sp) 800017c0: 6406 ld s0,64(sp) 800017c2: 74e2 ld s1,56(sp) 800017c4: 7942 ld s2,48(sp) 800017c6: 79a2 ld s3,40(sp) 800017c8: 7a02 ld s4,32(sp) 800017ca: 6ae2 ld s5,24(sp) 800017cc: 6b42 ld s6,16(sp) 800017ce: 6ba2 ld s7,8(sp) 800017d0: 6161 addi sp,sp,80 800017d2: 8082 ret srcva = va0 + PGSIZE; 800017d4: 01390bb3 add s7,s2,s3 while(got_null == 0 && max > 0){ 800017d8: c8a9 beqz s1,8000182a <copyinstr+0xa0> va0 = PGROUNDDOWN(srcva); 800017da: 015bf933 and s2,s7,s5 pa0 = walkaddr(pagetable, va0); 800017de: 85ca mv a1,s2 800017e0: 8552 mv a0,s4 800017e2: 00000097 auipc ra,0x0 800017e6: 88c080e7 jalr -1908(ra) # 8000106e <walkaddr> if(pa0 == 0) 800017ea: c131 beqz a0,8000182e <copyinstr+0xa4> n = PGSIZE - (srcva - va0); 800017ec: 41790833 sub a6,s2,s7 800017f0: 984e add a6,a6,s3 if(n > max) 800017f2: 0104f363 bgeu s1,a6,800017f8 <copyinstr+0x6e> 800017f6: 8826 mv a6,s1 char *p = (char *) (pa0 + (srcva - va0)); 800017f8: 955e add a0,a0,s7 800017fa: 41250533 sub a0,a0,s2 while(n > 0){ 800017fe: fc080be3 beqz a6,800017d4 <copyinstr+0x4a> 80001802: 985a add a6,a6,s6 80001804: 87da mv a5,s6 if(*p == '\0'){ 80001806: 41650633 sub a2,a0,s6 8000180a: 14fd addi s1,s1,-1 8000180c: 9b26 add s6,s6,s1 8000180e: 00f60733 add a4,a2,a5 80001812: 00074703 lbu a4,0(a4) 80001816: df49 beqz a4,800017b0 <copyinstr+0x26> *dst = *p; 80001818: 00e78023 sb a4,0(a5) --max; 8000181c: 40fb04b3 sub s1,s6,a5 dst++; 80001820: 0785 addi a5,a5,1 while(n > 0){ 80001822: ff0796e3 bne a5,a6,8000180e <copyinstr+0x84> dst++; 80001826: 8b42 mv s6,a6 80001828: b775 j 800017d4 <copyinstr+0x4a> 8000182a: 4781 li a5,0 8000182c: b769 j 800017b6 <copyinstr+0x2c> return -1; 8000182e: 557d li a0,-1 80001830: b779 j 800017be <copyinstr+0x34> int got_null = 0; 80001832: 4781 li a5,0 if(got_null){ 80001834: 0017b793 seqz a5,a5 80001838: 40f00533 neg a0,a5 } 8000183c: 8082 ret 000000008000183e <proc_mapstacks>: // Allocate a page for each process's kernel stack. // Map it high in memory, followed by an invalid // guard page. void proc_mapstacks(pagetable_t kpgtbl) { 8000183e: 7139 addi sp,sp,-64 80001840: fc06 sd ra,56(sp) 80001842: f822 sd s0,48(sp) 80001844: f426 sd s1,40(sp) 80001846: f04a sd s2,32(sp) 80001848: ec4e sd s3,24(sp) 8000184a: e852 sd s4,16(sp) 8000184c: e456 sd s5,8(sp) 8000184e: e05a sd s6,0(sp) 80001850: 0080 addi s0,sp,64 80001852: 89aa mv s3,a0 struct proc *p; for(p = proc; p < &proc[NPROC]; p++) { 80001854: 00010497 auipc s1,0x10 80001858: a7c48493 addi s1,s1,-1412 # 800112d0 <proc> char *pa = kalloc(); if(pa == 0) panic("kalloc"); uint64 va = KSTACK((int) (p - proc)); 8000185c: 8b26 mv s6,s1 8000185e: 00006a97 auipc s5,0x6 80001862: 7a2a8a93 addi s5,s5,1954 # 80008000 <etext> 80001866: 04000937 lui s2,0x4000 8000186a: 197d addi s2,s2,-1 8000186c: 0932 slli s2,s2,0xc for(p = proc; p < &proc[NPROC]; p++) { 8000186e: 00016a17 auipc s4,0x16 80001872: a62a0a13 addi s4,s4,-1438 # 800172d0 <cpus> char *pa = kalloc(); 80001876: fffff097 auipc ra,0xfffff 8000187a: 27e080e7 jalr 638(ra) # 80000af4 <kalloc> 8000187e: 862a mv a2,a0 if(pa == 0) 80001880: c131 beqz a0,800018c4 <proc_mapstacks+0x86> uint64 va = KSTACK((int) (p - proc)); 80001882: 416485b3 sub a1,s1,s6 80001886: 859d srai a1,a1,0x7 80001888: 000ab783 ld a5,0(s5) 8000188c: 02f585b3 mul a1,a1,a5 80001890: 2585 addiw a1,a1,1 80001892: 00d5959b slliw a1,a1,0xd kvmmap(kpgtbl, va, (uint64)pa, PGSIZE, PTE_R | PTE_W); 80001896: 4719 li a4,6 80001898: 6685 lui a3,0x1 8000189a: 40b905b3 sub a1,s2,a1 8000189e: 854e mv a0,s3 800018a0: 00000097 auipc ra,0x0 800018a4: 8b0080e7 jalr -1872(ra) # 80001150 <kvmmap> for(p = proc; p < &proc[NPROC]; p++) { 800018a8: 18048493 addi s1,s1,384 800018ac: fd4495e3 bne s1,s4,80001876 <proc_mapstacks+0x38> } } 800018b0: 70e2 ld ra,56(sp) 800018b2: 7442 ld s0,48(sp) 800018b4: 74a2 ld s1,40(sp) 800018b6: 7902 ld s2,32(sp) 800018b8: 69e2 ld s3,24(sp) 800018ba: 6a42 ld s4,16(sp) 800018bc: 6aa2 ld s5,8(sp) 800018be: 6b02 ld s6,0(sp) 800018c0: 6121 addi sp,sp,64 800018c2: 8082 ret panic("kalloc"); 800018c4: 00007517 auipc a0,0x7 800018c8: 91450513 addi a0,a0,-1772 # 800081d8 <digits+0x198> 800018cc: fffff097 auipc ra,0xfffff 800018d0: c72080e7 jalr -910(ra) # 8000053e <panic> 00000000800018d4 <procinit>: // initialize the proc table at boot time. void procinit(void) { 800018d4: 7139 addi sp,sp,-64 800018d6: fc06 sd ra,56(sp) 800018d8: f822 sd s0,48(sp) 800018da: f426 sd s1,40(sp) 800018dc: f04a sd s2,32(sp) 800018de: ec4e sd s3,24(sp) 800018e0: e852 sd s4,16(sp) 800018e2: e456 sd s5,8(sp) 800018e4: e05a sd s6,0(sp) 800018e6: 0080 addi s0,sp,64 struct proc *p; initlock(&pid_lock, "nextpid"); 800018e8: 00007597 auipc a1,0x7 800018ec: 8f858593 addi a1,a1,-1800 # 800081e0 <digits+0x1a0> 800018f0: 00010517 auipc a0,0x10 800018f4: 9b050513 addi a0,a0,-1616 # 800112a0 <pid_lock> 800018f8: fffff097 auipc ra,0xfffff 800018fc: 25c080e7 jalr 604(ra) # 80000b54 <initlock> initlock(&wait_lock, "wait_lock"); 80001900: 00007597 auipc a1,0x7 80001904: 8e858593 addi a1,a1,-1816 # 800081e8 <digits+0x1a8> 80001908: 00010517 auipc a0,0x10 8000190c: 9b050513 addi a0,a0,-1616 # 800112b8 <wait_lock> 80001910: fffff097 auipc ra,0xfffff 80001914: 244080e7 jalr 580(ra) # 80000b54 <initlock> for(p = proc; p < &proc[NPROC]; p++) { 80001918: 00010497 auipc s1,0x10 8000191c: 9b848493 addi s1,s1,-1608 # 800112d0 <proc> initlock(&p->lock, "proc"); 80001920: 00007b17 auipc s6,0x7 80001924: 8d8b0b13 addi s6,s6,-1832 # 800081f8 <digits+0x1b8> p->kstack = KSTACK((int) (p - proc)); 80001928: 8aa6 mv s5,s1 8000192a: 00006a17 auipc s4,0x6 8000192e: 6d6a0a13 addi s4,s4,1750 # 80008000 <etext> 80001932: 04000937 lui s2,0x4000 80001936: 197d addi s2,s2,-1 80001938: 0932 slli s2,s2,0xc for(p = proc; p < &proc[NPROC]; p++) { 8000193a: 00016997 auipc s3,0x16 8000193e: 99698993 addi s3,s3,-1642 # 800172d0 <cpus> initlock(&p->lock, "proc"); 80001942: 85da mv a1,s6 80001944: 8526 mv a0,s1 80001946: fffff097 auipc ra,0xfffff 8000194a: 20e080e7 jalr 526(ra) # 80000b54 <initlock> p->kstack = KSTACK((int) (p - proc)); 8000194e: 415487b3 sub a5,s1,s5 80001952: 879d srai a5,a5,0x7 80001954: 000a3703 ld a4,0(s4) 80001958: 02e787b3 mul a5,a5,a4 8000195c: 2785 addiw a5,a5,1 8000195e: 00d7979b slliw a5,a5,0xd 80001962: 40f907b3 sub a5,s2,a5 80001966: e0bc sd a5,64(s1) for(p = proc; p < &proc[NPROC]; p++) { 80001968: 18048493 addi s1,s1,384 8000196c: fd349be3 bne s1,s3,80001942 <procinit+0x6e> } } 80001970: 70e2 ld ra,56(sp) 80001972: 7442 ld s0,48(sp) 80001974: 74a2 ld s1,40(sp) 80001976: 7902 ld s2,32(sp) 80001978: 69e2 ld s3,24(sp) 8000197a: 6a42 ld s4,16(sp) 8000197c: 6aa2 ld s5,8(sp) 8000197e: 6b02 ld s6,0(sp) 80001980: 6121 addi sp,sp,64 80001982: 8082 ret 0000000080001984 <cpuid>: // Must be called with interrupts disabled, // to prevent race with process being moved // to a different CPU. int cpuid() { 80001984: 1141 addi sp,sp,-16 80001986: e422 sd s0,8(sp) 80001988: 0800 addi s0,sp,16 asm volatile("mv %0, tp" : "=r" (x) ); 8000198a: 8512 mv a0,tp int id = r_tp(); return id; } 8000198c: 2501 sext.w a0,a0 8000198e: 6422 ld s0,8(sp) 80001990: 0141 addi sp,sp,16 80001992: 8082 ret 0000000080001994 <mycpu>: // Return this CPU's cpu struct. // Interrupts must be disabled. struct cpu* mycpu(void) { 80001994: 1141 addi sp,sp,-16 80001996: e422 sd s0,8(sp) 80001998: 0800 addi s0,sp,16 8000199a: 8792 mv a5,tp int id = cpuid(); struct cpu *c = &cpus[id]; 8000199c: 2781 sext.w a5,a5 8000199e: 16000513 li a0,352 800019a2: 02a787b3 mul a5,a5,a0 return c; } 800019a6: 00016517 auipc a0,0x16 800019aa: 92a50513 addi a0,a0,-1750 # 800172d0 <cpus> 800019ae: 953e add a0,a0,a5 800019b0: 6422 ld s0,8(sp) 800019b2: 0141 addi sp,sp,16 800019b4: 8082 ret 00000000800019b6 <myproc>: // Return the current struct proc *, or zero if none. struct proc* myproc(void) { 800019b6: 1101 addi sp,sp,-32 800019b8: ec06 sd ra,24(sp) 800019ba: e822 sd s0,16(sp) 800019bc: e426 sd s1,8(sp) 800019be: 1000 addi s0,sp,32 push_off(); 800019c0: fffff097 auipc ra,0xfffff 800019c4: 1d8080e7 jalr 472(ra) # 80000b98 <push_off> 800019c8: 8792 mv a5,tp struct cpu *c = mycpu(); struct proc *p = c->proc; 800019ca: 2781 sext.w a5,a5 800019cc: 16000713 li a4,352 800019d0: 02e787b3 mul a5,a5,a4 800019d4: 00016717 auipc a4,0x16 800019d8: 8fc70713 addi a4,a4,-1796 # 800172d0 <cpus> 800019dc: 97ba add a5,a5,a4 800019de: 6384 ld s1,0(a5) pop_off(); 800019e0: fffff097 auipc ra,0xfffff 800019e4: 258080e7 jalr 600(ra) # 80000c38 <pop_off> return p; } 800019e8: 8526 mv a0,s1 800019ea: 60e2 ld ra,24(sp) 800019ec: 6442 ld s0,16(sp) 800019ee: 64a2 ld s1,8(sp) 800019f0: 6105 addi sp,sp,32 800019f2: 8082 ret 00000000800019f4 <forkret>: // A fork child's very first scheduling by scheduler() // will swtch to forkret. void forkret(void) { 800019f4: 1141 addi sp,sp,-16 800019f6: e406 sd ra,8(sp) 800019f8: e022 sd s0,0(sp) 800019fa: 0800 addi s0,sp,16 static int first = 1; // Still holding p->lock from scheduler. release(&myproc()->lock); 800019fc: 00000097 auipc ra,0x0 80001a00: fba080e7 jalr -70(ra) # 800019b6 <myproc> 80001a04: fffff097 auipc ra,0xfffff 80001a08: 294080e7 jalr 660(ra) # 80000c98 <release> if (first) { 80001a0c: 00007797 auipc a5,0x7 80001a10: f047a783 lw a5,-252(a5) # 80008910 <first.1692> 80001a14: eb89 bnez a5,80001a26 <forkret+0x32> // be run from main(). first = 0; fsinit(ROOTDEV); } usertrapret(); 80001a16: 00001097 auipc ra,0x1 80001a1a: f6e080e7 jalr -146(ra) # 80002984 <usertrapret> } 80001a1e: 60a2 ld ra,8(sp) 80001a20: 6402 ld s0,0(sp) 80001a22: 0141 addi sp,sp,16 80001a24: 8082 ret first = 0; 80001a26: 00007797 auipc a5,0x7 80001a2a: ee07a523 sw zero,-278(a5) # 80008910 <first.1692> fsinit(ROOTDEV); 80001a2e: 4505 li a0,1 80001a30: 00002097 auipc ra,0x2 80001a34: d46080e7 jalr -698(ra) # 80003776 <fsinit> 80001a38: bff9 j 80001a16 <forkret+0x22> 0000000080001a3a <allocpid>: allocpid() { 80001a3a: 1101 addi sp,sp,-32 80001a3c: ec06 sd ra,24(sp) 80001a3e: e822 sd s0,16(sp) 80001a40: e426 sd s1,8(sp) 80001a42: e04a sd s2,0(sp) 80001a44: 1000 addi s0,sp,32 acquire(&pid_lock); 80001a46: 00010917 auipc s2,0x10 80001a4a: 85a90913 addi s2,s2,-1958 # 800112a0 <pid_lock> 80001a4e: 854a mv a0,s2 80001a50: fffff097 auipc ra,0xfffff 80001a54: 194080e7 jalr 404(ra) # 80000be4 <acquire> pid = nextpid; 80001a58: 00007797 auipc a5,0x7 80001a5c: ebc78793 addi a5,a5,-324 # 80008914 <nextpid> 80001a60: 4384 lw s1,0(a5) nextpid = nextpid + 1; 80001a62: 0014871b addiw a4,s1,1 80001a66: c398 sw a4,0(a5) release(&pid_lock); 80001a68: 854a mv a0,s2 80001a6a: fffff097 auipc ra,0xfffff 80001a6e: 22e080e7 jalr 558(ra) # 80000c98 <release> } 80001a72: 8526 mv a0,s1 80001a74: 60e2 ld ra,24(sp) 80001a76: 6442 ld s0,16(sp) 80001a78: 64a2 ld s1,8(sp) 80001a7a: 6902 ld s2,0(sp) 80001a7c: 6105 addi sp,sp,32 80001a7e: 8082 ret 0000000080001a80 <proc_pagetable>: { 80001a80: 1101 addi sp,sp,-32 80001a82: ec06 sd ra,24(sp) 80001a84: e822 sd s0,16(sp) 80001a86: e426 sd s1,8(sp) 80001a88: e04a sd s2,0(sp) 80001a8a: 1000 addi s0,sp,32 80001a8c: 892a mv s2,a0 pagetable = uvmcreate(); 80001a8e: 00000097 auipc ra,0x0 80001a92: 8ac080e7 jalr -1876(ra) # 8000133a <uvmcreate> 80001a96: 84aa mv s1,a0 if(pagetable == 0) 80001a98: c121 beqz a0,80001ad8 <proc_pagetable+0x58> if(mappages(pagetable, TRAMPOLINE, PGSIZE, 80001a9a: 4729 li a4,10 80001a9c: 00005697 auipc a3,0x5 80001aa0: 56468693 addi a3,a3,1380 # 80007000 <_trampoline> 80001aa4: 6605 lui a2,0x1 80001aa6: 040005b7 lui a1,0x4000 80001aaa: 15fd addi a1,a1,-1 80001aac: 05b2 slli a1,a1,0xc 80001aae: fffff097 auipc ra,0xfffff 80001ab2: 602080e7 jalr 1538(ra) # 800010b0 <mappages> 80001ab6: 02054863 bltz a0,80001ae6 <proc_pagetable+0x66> if(mappages(pagetable, TRAPFRAME, PGSIZE, 80001aba: 4719 li a4,6 80001abc: 05893683 ld a3,88(s2) 80001ac0: 6605 lui a2,0x1 80001ac2: 020005b7 lui a1,0x2000 80001ac6: 15fd addi a1,a1,-1 80001ac8: 05b6 slli a1,a1,0xd 80001aca: 8526 mv a0,s1 80001acc: fffff097 auipc ra,0xfffff 80001ad0: 5e4080e7 jalr 1508(ra) # 800010b0 <mappages> 80001ad4: 02054163 bltz a0,80001af6 <proc_pagetable+0x76> } 80001ad8: 8526 mv a0,s1 80001ada: 60e2 ld ra,24(sp) 80001adc: 6442 ld s0,16(sp) 80001ade: 64a2 ld s1,8(sp) 80001ae0: 6902 ld s2,0(sp) 80001ae2: 6105 addi sp,sp,32 80001ae4: 8082 ret uvmfree(pagetable, 0); 80001ae6: 4581 li a1,0 80001ae8: 8526 mv a0,s1 80001aea: 00000097 auipc ra,0x0 80001aee: a4c080e7 jalr -1460(ra) # 80001536 <uvmfree> return 0; 80001af2: 4481 li s1,0 80001af4: b7d5 j 80001ad8 <proc_pagetable+0x58> uvmunmap(pagetable, TRAMPOLINE, 1, 0); 80001af6: 4681 li a3,0 80001af8: 4605 li a2,1 80001afa: 040005b7 lui a1,0x4000 80001afe: 15fd addi a1,a1,-1 80001b00: 05b2 slli a1,a1,0xc 80001b02: 8526 mv a0,s1 80001b04: fffff097 auipc ra,0xfffff 80001b08: 772080e7 jalr 1906(ra) # 80001276 <uvmunmap> uvmfree(pagetable, 0); 80001b0c: 4581 li a1,0 80001b0e: 8526 mv a0,s1 80001b10: 00000097 auipc ra,0x0 80001b14: a26080e7 jalr -1498(ra) # 80001536 <uvmfree> return 0; 80001b18: 4481 li s1,0 80001b1a: bf7d j 80001ad8 <proc_pagetable+0x58> 0000000080001b1c <proc_freepagetable>: { 80001b1c: 1101 addi sp,sp,-32 80001b1e: ec06 sd ra,24(sp) 80001b20: e822 sd s0,16(sp) 80001b22: e426 sd s1,8(sp) 80001b24: e04a sd s2,0(sp) 80001b26: 1000 addi s0,sp,32 80001b28: 84aa mv s1,a0 80001b2a: 892e mv s2,a1 uvmunmap(pagetable, TRAMPOLINE, 1, 0); 80001b2c: 4681 li a3,0 80001b2e: 4605 li a2,1 80001b30: 040005b7 lui a1,0x4000 80001b34: 15fd addi a1,a1,-1 80001b36: 05b2 slli a1,a1,0xc 80001b38: fffff097 auipc ra,0xfffff 80001b3c: 73e080e7 jalr 1854(ra) # 80001276 <uvmunmap> uvmunmap(pagetable, TRAPFRAME, 1, 0); 80001b40: 4681 li a3,0 80001b42: 4605 li a2,1 80001b44: 020005b7 lui a1,0x2000 80001b48: 15fd addi a1,a1,-1 80001b4a: 05b6 slli a1,a1,0xd 80001b4c: 8526 mv a0,s1 80001b4e: fffff097 auipc ra,0xfffff 80001b52: 728080e7 jalr 1832(ra) # 80001276 <uvmunmap> uvmfree(pagetable, sz); 80001b56: 85ca mv a1,s2 80001b58: 8526 mv a0,s1 80001b5a: 00000097 auipc ra,0x0 80001b5e: 9dc080e7 jalr -1572(ra) # 80001536 <uvmfree> } 80001b62: 60e2 ld ra,24(sp) 80001b64: 6442 ld s0,16(sp) 80001b66: 64a2 ld s1,8(sp) 80001b68: 6902 ld s2,0(sp) 80001b6a: 6105 addi sp,sp,32 80001b6c: 8082 ret 0000000080001b6e <freeproc>: { 80001b6e: 1101 addi sp,sp,-32 80001b70: ec06 sd ra,24(sp) 80001b72: e822 sd s0,16(sp) 80001b74: e426 sd s1,8(sp) 80001b76: 1000 addi s0,sp,32 80001b78: 84aa mv s1,a0 if(p->trapframe) 80001b7a: 6d28 ld a0,88(a0) 80001b7c: c509 beqz a0,80001b86 <freeproc+0x18> kfree((void*)p->trapframe); 80001b7e: fffff097 auipc ra,0xfffff 80001b82: e7a080e7 jalr -390(ra) # 800009f8 <kfree> p->trapframe = 0; 80001b86: 0404bc23 sd zero,88(s1) if(p->pagetable) 80001b8a: 68a8 ld a0,80(s1) 80001b8c: c511 beqz a0,80001b98 <freeproc+0x2a> proc_freepagetable(p->pagetable, p->sz); 80001b8e: 64ac ld a1,72(s1) 80001b90: 00000097 auipc ra,0x0 80001b94: f8c080e7 jalr -116(ra) # 80001b1c <proc_freepagetable> p->pagetable = 0; 80001b98: 0404b823 sd zero,80(s1) p->sz = 0; 80001b9c: 0404b423 sd zero,72(s1) p->pid = 0; 80001ba0: 0204a823 sw zero,48(s1) p->parent = 0; 80001ba4: 0204bc23 sd zero,56(s1) p->name[0] = 0; 80001ba8: 14048c23 sb zero,344(s1) p->chan = 0; 80001bac: 0204b023 sd zero,32(s1) p->killed = 0; 80001bb0: 0204a423 sw zero,40(s1) p->xstate = 0; 80001bb4: 0204a623 sw zero,44(s1) p->state = UNUSED; 80001bb8: 0004ac23 sw zero,24(s1) } 80001bbc: 60e2 ld ra,24(sp) 80001bbe: 6442 ld s0,16(sp) 80001bc0: 64a2 ld s1,8(sp) 80001bc2: 6105 addi sp,sp,32 80001bc4: 8082 ret 0000000080001bc6 <allocproc>: { 80001bc6: 1101 addi sp,sp,-32 80001bc8: ec06 sd ra,24(sp) 80001bca: e822 sd s0,16(sp) 80001bcc: e426 sd s1,8(sp) 80001bce: e04a sd s2,0(sp) 80001bd0: 1000 addi s0,sp,32 for(p = proc; p < &proc[NPROC]; p++) { 80001bd2: 0000f497 auipc s1,0xf 80001bd6: 6fe48493 addi s1,s1,1790 # 800112d0 <proc> 80001bda: 00015917 auipc s2,0x15 80001bde: 6f690913 addi s2,s2,1782 # 800172d0 <cpus> acquire(&p->lock); 80001be2: 8526 mv a0,s1 80001be4: fffff097 auipc ra,0xfffff 80001be8: 000080e7 jalr ra # 80000be4 <acquire> if(p->state == UNUSED) { 80001bec: 4c9c lw a5,24(s1) 80001bee: cf81 beqz a5,80001c06 <allocproc+0x40> release(&p->lock); 80001bf0: 8526 mv a0,s1 80001bf2: fffff097 auipc ra,0xfffff 80001bf6: 0a6080e7 jalr 166(ra) # 80000c98 <release> for(p = proc; p < &proc[NPROC]; p++) { 80001bfa: 18048493 addi s1,s1,384 80001bfe: ff2492e3 bne s1,s2,80001be2 <allocproc+0x1c> return 0; 80001c02: 4481 li s1,0 80001c04: a889 j 80001c56 <allocproc+0x90> p->pid = allocpid(); 80001c06: 00000097 auipc ra,0x0 80001c0a: e34080e7 jalr -460(ra) # 80001a3a <allocpid> 80001c0e: d888 sw a0,48(s1) p->state = USED; 80001c10: 4785 li a5,1 80001c12: cc9c sw a5,24(s1) if((p->trapframe = (struct trapframe *)kalloc()) == 0){ 80001c14: fffff097 auipc ra,0xfffff 80001c18: ee0080e7 jalr -288(ra) # 80000af4 <kalloc> 80001c1c: 892a mv s2,a0 80001c1e: eca8 sd a0,88(s1) 80001c20: c131 beqz a0,80001c64 <allocproc+0x9e> p->pagetable = proc_pagetable(p); 80001c22: 8526 mv a0,s1 80001c24: 00000097 auipc ra,0x0 80001c28: e5c080e7 jalr -420(ra) # 80001a80 <proc_pagetable> 80001c2c: 892a mv s2,a0 80001c2e: e8a8 sd a0,80(s1) if(p->pagetable == 0){ 80001c30: c531 beqz a0,80001c7c <allocproc+0xb6> memset(&p->context, 0, sizeof(p->context)); 80001c32: 07000613 li a2,112 80001c36: 4581 li a1,0 80001c38: 06048513 addi a0,s1,96 80001c3c: fffff097 auipc ra,0xfffff 80001c40: 0a4080e7 jalr 164(ra) # 80000ce0 <memset> p->context.ra = (uint64)forkret; 80001c44: 00000797 auipc a5,0x0 80001c48: db078793 addi a5,a5,-592 # 800019f4 <forkret> 80001c4c: f0bc sd a5,96(s1) p->context.sp = p->kstack + PGSIZE; 80001c4e: 60bc ld a5,64(s1) 80001c50: 6705 lui a4,0x1 80001c52: 97ba add a5,a5,a4 80001c54: f4bc sd a5,104(s1) } 80001c56: 8526 mv a0,s1 80001c58: 60e2 ld ra,24(sp) 80001c5a: 6442 ld s0,16(sp) 80001c5c: 64a2 ld s1,8(sp) 80001c5e: 6902 ld s2,0(sp) 80001c60: 6105 addi sp,sp,32 80001c62: 8082 ret freeproc(p); 80001c64: 8526 mv a0,s1 80001c66: 00000097 auipc ra,0x0 80001c6a: f08080e7 jalr -248(ra) # 80001b6e <freeproc> release(&p->lock); 80001c6e: 8526 mv a0,s1 80001c70: fffff097 auipc ra,0xfffff 80001c74: 028080e7 jalr 40(ra) # 80000c98 <release> return 0; 80001c78: 84ca mv s1,s2 80001c7a: bff1 j 80001c56 <allocproc+0x90> freeproc(p); 80001c7c: 8526 mv a0,s1 80001c7e: 00000097 auipc ra,0x0 80001c82: ef0080e7 jalr -272(ra) # 80001b6e <freeproc> release(&p->lock); 80001c86: 8526 mv a0,s1 80001c88: fffff097 auipc ra,0xfffff 80001c8c: 010080e7 jalr 16(ra) # 80000c98 <release> return 0; 80001c90: 84ca mv s1,s2 80001c92: b7d1 j 80001c56 <allocproc+0x90> 0000000080001c94 <userinit>: { 80001c94: 1101 addi sp,sp,-32 80001c96: ec06 sd ra,24(sp) 80001c98: e822 sd s0,16(sp) 80001c9a: e426 sd s1,8(sp) 80001c9c: 1000 addi s0,sp,32 p = allocproc(); 80001c9e: 00000097 auipc ra,0x0 80001ca2: f28080e7 jalr -216(ra) # 80001bc6 <allocproc> 80001ca6: 84aa mv s1,a0 initproc = p; 80001ca8: 00007797 auipc a5,0x7 80001cac: 38a7b423 sd a0,904(a5) # 80009030 <initproc> uvminit(p->pagetable, initcode, sizeof(initcode)); 80001cb0: 03400613 li a2,52 80001cb4: 00007597 auipc a1,0x7 80001cb8: c6c58593 addi a1,a1,-916 # 80008920 <initcode> 80001cbc: 6928 ld a0,80(a0) 80001cbe: fffff097 auipc ra,0xfffff 80001cc2: 6aa080e7 jalr 1706(ra) # 80001368 <uvminit> p->sz = PGSIZE; 80001cc6: 6785 lui a5,0x1 80001cc8: e4bc sd a5,72(s1) p->trapframe->epc = 0; // user program counter 80001cca: 6cb8 ld a4,88(s1) 80001ccc: 00073c23 sd zero,24(a4) # 1018 <_entry-0x7fffefe8> p->trapframe->sp = PGSIZE; // user stack pointer 80001cd0: 6cb8 ld a4,88(s1) 80001cd2: fb1c sd a5,48(a4) safestrcpy(p->name, "initcode", sizeof(p->name)); 80001cd4: 4641 li a2,16 80001cd6: 00006597 auipc a1,0x6 80001cda: 52a58593 addi a1,a1,1322 # 80008200 <digits+0x1c0> 80001cde: 15848513 addi a0,s1,344 80001ce2: fffff097 auipc ra,0xfffff 80001ce6: 150080e7 jalr 336(ra) # 80000e32 <safestrcpy> p->cwd = namei("/"); 80001cea: 00006517 auipc a0,0x6 80001cee: 52650513 addi a0,a0,1318 # 80008210 <digits+0x1d0> 80001cf2: 00002097 auipc ra,0x2 80001cf6: 4b2080e7 jalr 1202(ra) # 800041a4 <namei> 80001cfa: 14a4b823 sd a0,336(s1) p->state = RUNNABLE; 80001cfe: 478d li a5,3 80001d00: cc9c sw a5,24(s1) release(&p->lock); 80001d02: 8526 mv a0,s1 80001d04: fffff097 auipc ra,0xfffff 80001d08: f94080e7 jalr -108(ra) # 80000c98 <release> } 80001d0c: 60e2 ld ra,24(sp) 80001d0e: 6442 ld s0,16(sp) 80001d10: 64a2 ld s1,8(sp) 80001d12: 6105 addi sp,sp,32 80001d14: 8082 ret 0000000080001d16 <growproc>: { 80001d16: 1101 addi sp,sp,-32 80001d18: ec06 sd ra,24(sp) 80001d1a: e822 sd s0,16(sp) 80001d1c: e426 sd s1,8(sp) 80001d1e: e04a sd s2,0(sp) 80001d20: 1000 addi s0,sp,32 80001d22: 84aa mv s1,a0 struct proc *p = myproc(); 80001d24: 00000097 auipc ra,0x0 80001d28: c92080e7 jalr -878(ra) # 800019b6 <myproc> 80001d2c: 892a mv s2,a0 sz = p->sz; 80001d2e: 652c ld a1,72(a0) 80001d30: 0005861b sext.w a2,a1 if(n > 0){ 80001d34: 00904f63 bgtz s1,80001d52 <growproc+0x3c> } else if(n < 0){ 80001d38: 0204cc63 bltz s1,80001d70 <growproc+0x5a> p->sz = sz; 80001d3c: 1602 slli a2,a2,0x20 80001d3e: 9201 srli a2,a2,0x20 80001d40: 04c93423 sd a2,72(s2) return 0; 80001d44: 4501 li a0,0 } 80001d46: 60e2 ld ra,24(sp) 80001d48: 6442 ld s0,16(sp) 80001d4a: 64a2 ld s1,8(sp) 80001d4c: 6902 ld s2,0(sp) 80001d4e: 6105 addi sp,sp,32 80001d50: 8082 ret if((sz = uvmalloc(p->pagetable, sz, sz + n)) == 0) { 80001d52: 9e25 addw a2,a2,s1 80001d54: 1602 slli a2,a2,0x20 80001d56: 9201 srli a2,a2,0x20 80001d58: 1582 slli a1,a1,0x20 80001d5a: 9181 srli a1,a1,0x20 80001d5c: 6928 ld a0,80(a0) 80001d5e: fffff097 auipc ra,0xfffff 80001d62: 6c4080e7 jalr 1732(ra) # 80001422 <uvmalloc> 80001d66: 0005061b sext.w a2,a0 80001d6a: fa69 bnez a2,80001d3c <growproc+0x26> return -1; 80001d6c: 557d li a0,-1 80001d6e: bfe1 j 80001d46 <growproc+0x30> sz = uvmdealloc(p->pagetable, sz, sz + n); 80001d70: 9e25 addw a2,a2,s1 80001d72: 1602 slli a2,a2,0x20 80001d74: 9201 srli a2,a2,0x20 80001d76: 1582 slli a1,a1,0x20 80001d78: 9181 srli a1,a1,0x20 80001d7a: 6928 ld a0,80(a0) 80001d7c: fffff097 auipc ra,0xfffff 80001d80: 65e080e7 jalr 1630(ra) # 800013da <uvmdealloc> 80001d84: 0005061b sext.w a2,a0 80001d88: bf55 j 80001d3c <growproc+0x26> 0000000080001d8a <fork>: { 80001d8a: 7179 addi sp,sp,-48 80001d8c: f406 sd ra,40(sp) 80001d8e: f022 sd s0,32(sp) 80001d90: ec26 sd s1,24(sp) 80001d92: e84a sd s2,16(sp) 80001d94: e44e sd s3,8(sp) 80001d96: e052 sd s4,0(sp) 80001d98: 1800 addi s0,sp,48 struct proc *p = myproc(); 80001d9a: 00000097 auipc ra,0x0 80001d9e: c1c080e7 jalr -996(ra) # 800019b6 <myproc> 80001da2: 892a mv s2,a0 if((np = allocproc()) == 0){ 80001da4: 00000097 auipc ra,0x0 80001da8: e22080e7 jalr -478(ra) # 80001bc6 <allocproc> 80001dac: 10050b63 beqz a0,80001ec2 <fork+0x138> 80001db0: 89aa mv s3,a0 if(uvmcopy(p->pagetable, np->pagetable, p->sz) < 0){ 80001db2: 04893603 ld a2,72(s2) 80001db6: 692c ld a1,80(a0) 80001db8: 05093503 ld a0,80(s2) 80001dbc: fffff097 auipc ra,0xfffff 80001dc0: 7b2080e7 jalr 1970(ra) # 8000156e <uvmcopy> 80001dc4: 04054663 bltz a0,80001e10 <fork+0x86> np->sz = p->sz; 80001dc8: 04893783 ld a5,72(s2) 80001dcc: 04f9b423 sd a5,72(s3) *(np->trapframe) = *(p->trapframe); 80001dd0: 05893683 ld a3,88(s2) 80001dd4: 87b6 mv a5,a3 80001dd6: 0589b703 ld a4,88(s3) 80001dda: 12068693 addi a3,a3,288 80001dde: 0007b803 ld a6,0(a5) # 1000 <_entry-0x7ffff000> 80001de2: 6788 ld a0,8(a5) 80001de4: 6b8c ld a1,16(a5) 80001de6: 6f90 ld a2,24(a5) 80001de8: 01073023 sd a6,0(a4) 80001dec: e708 sd a0,8(a4) 80001dee: eb0c sd a1,16(a4) 80001df0: ef10 sd a2,24(a4) 80001df2: 02078793 addi a5,a5,32 80001df6: 02070713 addi a4,a4,32 80001dfa: fed792e3 bne a5,a3,80001dde <fork+0x54> np->trapframe->a0 = 0; 80001dfe: 0589b783 ld a5,88(s3) 80001e02: 0607b823 sd zero,112(a5) 80001e06: 0d000493 li s1,208 for(i = 0; i < NOFILE; i++) 80001e0a: 15000a13 li s4,336 80001e0e: a03d j 80001e3c <fork+0xb2> freeproc(np); 80001e10: 854e mv a0,s3 80001e12: 00000097 auipc ra,0x0 80001e16: d5c080e7 jalr -676(ra) # 80001b6e <freeproc> release(&np->lock); 80001e1a: 854e mv a0,s3 80001e1c: fffff097 auipc ra,0xfffff 80001e20: e7c080e7 jalr -388(ra) # 80000c98 <release> return -1; 80001e24: 5a7d li s4,-1 80001e26: a069 j 80001eb0 <fork+0x126> np->ofile[i] = filedup(p->ofile[i]); 80001e28: 00003097 auipc ra,0x3 80001e2c: a12080e7 jalr -1518(ra) # 8000483a <filedup> 80001e30: 009987b3 add a5,s3,s1 80001e34: e388 sd a0,0(a5) for(i = 0; i < NOFILE; i++) 80001e36: 04a1 addi s1,s1,8 80001e38: 01448763 beq s1,s4,80001e46 <fork+0xbc> if(p->ofile[i]) 80001e3c: 009907b3 add a5,s2,s1 80001e40: 6388 ld a0,0(a5) 80001e42: f17d bnez a0,80001e28 <fork+0x9e> 80001e44: bfcd j 80001e36 <fork+0xac> np->cwd = idup(p->cwd); 80001e46: 15093503 ld a0,336(s2) 80001e4a: 00002097 auipc ra,0x2 80001e4e: b66080e7 jalr -1178(ra) # 800039b0 <idup> 80001e52: 14a9b823 sd a0,336(s3) safestrcpy(np->name, p->name, sizeof(p->name)); 80001e56: 4641 li a2,16 80001e58: 15890593 addi a1,s2,344 80001e5c: 15898513 addi a0,s3,344 80001e60: fffff097 auipc ra,0xfffff 80001e64: fd2080e7 jalr -46(ra) # 80000e32 <safestrcpy> pid = np->pid; 80001e68: 0309aa03 lw s4,48(s3) release(&np->lock); 80001e6c: 854e mv a0,s3 80001e6e: fffff097 auipc ra,0xfffff 80001e72: e2a080e7 jalr -470(ra) # 80000c98 <release> acquire(&wait_lock); 80001e76: 0000f497 auipc s1,0xf 80001e7a: 44248493 addi s1,s1,1090 # 800112b8 <wait_lock> 80001e7e: 8526 mv a0,s1 80001e80: fffff097 auipc ra,0xfffff 80001e84: d64080e7 jalr -668(ra) # 80000be4 <acquire> np->parent = p; 80001e88: 0329bc23 sd s2,56(s3) release(&wait_lock); 80001e8c: 8526 mv a0,s1 80001e8e: fffff097 auipc ra,0xfffff 80001e92: e0a080e7 jalr -502(ra) # 80000c98 <release> acquire(&np->lock); 80001e96: 854e mv a0,s3 80001e98: fffff097 auipc ra,0xfffff 80001e9c: d4c080e7 jalr -692(ra) # 80000be4 <acquire> np->state = RUNNABLE; 80001ea0: 478d li a5,3 80001ea2: 00f9ac23 sw a5,24(s3) release(&np->lock); 80001ea6: 854e mv a0,s3 80001ea8: fffff097 auipc ra,0xfffff 80001eac: df0080e7 jalr -528(ra) # 80000c98 <release> } 80001eb0: 8552 mv a0,s4 80001eb2: 70a2 ld ra,40(sp) 80001eb4: 7402 ld s0,32(sp) 80001eb6: 64e2 ld s1,24(sp) 80001eb8: 6942 ld s2,16(sp) 80001eba: 69a2 ld s3,8(sp) 80001ebc: 6a02 ld s4,0(sp) 80001ebe: 6145 addi sp,sp,48 80001ec0: 8082 ret return -1; 80001ec2: 5a7d li s4,-1 80001ec4: b7f5 j 80001eb0 <fork+0x126> 0000000080001ec6 <scheduler>: { 80001ec6: 7139 addi sp,sp,-64 80001ec8: fc06 sd ra,56(sp) 80001eca: f822 sd s0,48(sp) 80001ecc: f426 sd s1,40(sp) 80001ece: f04a sd s2,32(sp) 80001ed0: ec4e sd s3,24(sp) 80001ed2: e852 sd s4,16(sp) 80001ed4: e456 sd s5,8(sp) 80001ed6: e05a sd s6,0(sp) 80001ed8: 0080 addi s0,sp,64 80001eda: 8792 mv a5,tp int id = r_tp(); 80001edc: 2781 sext.w a5,a5 c->proc = 0; 80001ede: 00015a97 auipc s5,0x15 80001ee2: 3f2a8a93 addi s5,s5,1010 # 800172d0 <cpus> 80001ee6: 16000713 li a4,352 80001eea: 02e78733 mul a4,a5,a4 80001eee: 00ea86b3 add a3,s5,a4 80001ef2: 0006b023 sd zero,0(a3) swtch(&c->context, &p->context); 80001ef6: 0721 addi a4,a4,8 80001ef8: 9aba add s5,s5,a4 p->state = RUNNING; 80001efa: 4b11 li s6,4 c->proc = p; 80001efc: 8a36 mv s4,a3 for(p = proc; p < &proc[NPROC]; p++) { 80001efe: 00015997 auipc s3,0x15 80001f02: 3d298993 addi s3,s3,978 # 800172d0 <cpus> asm volatile("csrr %0, sstatus" : "=r" (x) ); 80001f06: 100027f3 csrr a5,sstatus w_sstatus(r_sstatus() | SSTATUS_SIE); 80001f0a: 0027e793 ori a5,a5,2 asm volatile("csrw sstatus, %0" : : "r" (x)); 80001f0e: 10079073 csrw sstatus,a5 80001f12: 0000f497 auipc s1,0xf 80001f16: 3be48493 addi s1,s1,958 # 800112d0 <proc> if(p->state == RUNNABLE) { 80001f1a: 490d li s2,3 80001f1c: a03d j 80001f4a <scheduler+0x84> p->state = RUNNING; 80001f1e: 0164ac23 sw s6,24(s1) c->proc = p; 80001f22: 009a3023 sd s1,0(s4) swtch(&c->context, &p->context); 80001f26: 06048593 addi a1,s1,96 80001f2a: 8556 mv a0,s5 80001f2c: 00001097 auipc ra,0x1 80001f30: 9ae080e7 jalr -1618(ra) # 800028da <swtch> c->proc = 0; 80001f34: 000a3023 sd zero,0(s4) release(&p->lock); 80001f38: 8526 mv a0,s1 80001f3a: fffff097 auipc ra,0xfffff 80001f3e: d5e080e7 jalr -674(ra) # 80000c98 <release> for(p = proc; p < &proc[NPROC]; p++) { 80001f42: 18048493 addi s1,s1,384 80001f46: fd3480e3 beq s1,s3,80001f06 <scheduler+0x40> acquire(&p->lock); 80001f4a: 8526 mv a0,s1 80001f4c: fffff097 auipc ra,0xfffff 80001f50: c98080e7 jalr -872(ra) # 80000be4 <acquire> if(p->state == RUNNABLE) { 80001f54: 4c9c lw a5,24(s1) 80001f56: ff2791e3 bne a5,s2,80001f38 <scheduler+0x72> 80001f5a: b7d1 j 80001f1e <scheduler+0x58> 0000000080001f5c <sched>: { 80001f5c: 7179 addi sp,sp,-48 80001f5e: f406 sd ra,40(sp) 80001f60: f022 sd s0,32(sp) 80001f62: ec26 sd s1,24(sp) 80001f64: e84a sd s2,16(sp) 80001f66: e44e sd s3,8(sp) 80001f68: e052 sd s4,0(sp) 80001f6a: 1800 addi s0,sp,48 struct proc *p = myproc(); 80001f6c: 00000097 auipc ra,0x0 80001f70: a4a080e7 jalr -1462(ra) # 800019b6 <myproc> 80001f74: 84aa mv s1,a0 if(!holding(&p->lock)) 80001f76: fffff097 auipc ra,0xfffff 80001f7a: bf4080e7 jalr -1036(ra) # 80000b6a <holding> 80001f7e: c141 beqz a0,80001ffe <sched+0xa2> asm volatile("mv %0, tp" : "=r" (x) ); 80001f80: 8792 mv a5,tp if(mycpu()->noff != 1) 80001f82: 2781 sext.w a5,a5 80001f84: 16000713 li a4,352 80001f88: 02e787b3 mul a5,a5,a4 80001f8c: 00015717 auipc a4,0x15 80001f90: 34470713 addi a4,a4,836 # 800172d0 <cpus> 80001f94: 97ba add a5,a5,a4 80001f96: 5fb8 lw a4,120(a5) 80001f98: 4785 li a5,1 80001f9a: 06f71a63 bne a4,a5,8000200e <sched+0xb2> if(p->state == RUNNING) 80001f9e: 4c98 lw a4,24(s1) 80001fa0: 4791 li a5,4 80001fa2: 06f70e63 beq a4,a5,8000201e <sched+0xc2> asm volatile("csrr %0, sstatus" : "=r" (x) ); 80001fa6: 100027f3 csrr a5,sstatus return (x & SSTATUS_SIE) != 0; 80001faa: 8b89 andi a5,a5,2 if(intr_get()) 80001fac: e3c9 bnez a5,8000202e <sched+0xd2> asm volatile("mv %0, tp" : "=r" (x) ); 80001fae: 8792 mv a5,tp intena = mycpu()->intena; 80001fb0: 00015917 auipc s2,0x15 80001fb4: 32090913 addi s2,s2,800 # 800172d0 <cpus> 80001fb8: 2781 sext.w a5,a5 80001fba: 16000993 li s3,352 80001fbe: 033787b3 mul a5,a5,s3 80001fc2: 97ca add a5,a5,s2 80001fc4: 07c7aa03 lw s4,124(a5) 80001fc8: 8592 mv a1,tp swtch(&p->context, &mycpu()->context);/* 80001fca: 2581 sext.w a1,a1 80001fcc: 033585b3 mul a1,a1,s3 80001fd0: 05a1 addi a1,a1,8 80001fd2: 95ca add a1,a1,s2 80001fd4: 06048513 addi a0,s1,96 80001fd8: 00001097 auipc ra,0x1 80001fdc: 902080e7 jalr -1790(ra) # 800028da <swtch> 80001fe0: 8792 mv a5,tp mycpu()->intena = intena; 80001fe2: 2781 sext.w a5,a5 80001fe4: 033787b3 mul a5,a5,s3 80001fe8: 993e add s2,s2,a5 80001fea: 07492e23 sw s4,124(s2) } 80001fee: 70a2 ld ra,40(sp) 80001ff0: 7402 ld s0,32(sp) 80001ff2: 64e2 ld s1,24(sp) 80001ff4: 6942 ld s2,16(sp) 80001ff6: 69a2 ld s3,8(sp) 80001ff8: 6a02 ld s4,0(sp) 80001ffa: 6145 addi sp,sp,48 80001ffc: 8082 ret panic("sched p->lock"); 80001ffe: 00006517 auipc a0,0x6 80002002: 21a50513 addi a0,a0,538 # 80008218 <digits+0x1d8> 80002006: ffffe097 auipc ra,0xffffe 8000200a: 538080e7 jalr 1336(ra) # 8000053e <panic> panic("sched locks"); 8000200e: 00006517 auipc a0,0x6 80002012: 21a50513 addi a0,a0,538 # 80008228 <digits+0x1e8> 80002016: ffffe097 auipc ra,0xffffe 8000201a: 528080e7 jalr 1320(ra) # 8000053e <panic> panic("sched running"); 8000201e: 00006517 auipc a0,0x6 80002022: 21a50513 addi a0,a0,538 # 80008238 <digits+0x1f8> 80002026: ffffe097 auipc ra,0xffffe 8000202a: 518080e7 jalr 1304(ra) # 8000053e <panic> panic("sched interruptible"); 8000202e: 00006517 auipc a0,0x6 80002032: 21a50513 addi a0,a0,538 # 80008248 <digits+0x208> 80002036: ffffe097 auipc ra,0xffffe 8000203a: 508080e7 jalr 1288(ra) # 8000053e <panic> 000000008000203e <yield>: { 8000203e: 1101 addi sp,sp,-32 80002040: ec06 sd ra,24(sp) 80002042: e822 sd s0,16(sp) 80002044: e426 sd s1,8(sp) 80002046: 1000 addi s0,sp,32 struct proc *p = myproc(); 80002048: 00000097 auipc ra,0x0 8000204c: 96e080e7 jalr -1682(ra) # 800019b6 <myproc> 80002050: 84aa mv s1,a0 acquire(&p->lock); 80002052: fffff097 auipc ra,0xfffff 80002056: b92080e7 jalr -1134(ra) # 80000be4 <acquire> p->state = RUNNABLE; 8000205a: 478d li a5,3 8000205c: cc9c sw a5,24(s1) sched(); 8000205e: 00000097 auipc ra,0x0 80002062: efe080e7 jalr -258(ra) # 80001f5c <sched> release(&p->lock); 80002066: 8526 mv a0,s1 80002068: fffff097 auipc ra,0xfffff 8000206c: c30080e7 jalr -976(ra) # 80000c98 <release> } 80002070: 60e2 ld ra,24(sp) 80002072: 6442 ld s0,16(sp) 80002074: 64a2 ld s1,8(sp) 80002076: 6105 addi sp,sp,32 80002078: 8082 ret 000000008000207a <sleep>: // Atomically release lock and sleep on chan. // Reacquires lock when awakened. void sleep(void *chan, struct spinlock *lk) { 8000207a: 7179 addi sp,sp,-48 8000207c: f406 sd ra,40(sp) 8000207e: f022 sd s0,32(sp) 80002080: ec26 sd s1,24(sp) 80002082: e84a sd s2,16(sp) 80002084: e44e sd s3,8(sp) 80002086: 1800 addi s0,sp,48 80002088: 89aa mv s3,a0 8000208a: 892e mv s2,a1 struct proc *p = myproc(); 8000208c: 00000097 auipc ra,0x0 80002090: 92a080e7 jalr -1750(ra) # 800019b6 <myproc> 80002094: 84aa mv s1,a0 // Once we hold p->lock, we can be // guaranteed that we won't miss any wakeup // (wakeup locks p->lock), // so it's okay to release lk. acquire(&p->lock); //DOC: sleeplock1 80002096: fffff097 auipc ra,0xfffff 8000209a: b4e080e7 jalr -1202(ra) # 80000be4 <acquire> release(lk); 8000209e: 854a mv a0,s2 800020a0: fffff097 auipc ra,0xfffff 800020a4: bf8080e7 jalr -1032(ra) # 80000c98 <release> // Go to sleep. p->chan = chan; 800020a8: 0334b023 sd s3,32(s1) p->state = SLEEPING; 800020ac: 4789 li a5,2 800020ae: cc9c sw a5,24(s1) sched(); 800020b0: 00000097 auipc ra,0x0 800020b4: eac080e7 jalr -340(ra) # 80001f5c <sched> // Tidy up. p->chan = 0; 800020b8: 0204b023 sd zero,32(s1) // Reacquire original lock. release(&p->lock); 800020bc: 8526 mv a0,s1 800020be: fffff097 auipc ra,0xfffff 800020c2: bda080e7 jalr -1062(ra) # 80000c98 <release> acquire(lk); 800020c6: 854a mv a0,s2 800020c8: fffff097 auipc ra,0xfffff 800020cc: b1c080e7 jalr -1252(ra) # 80000be4 <acquire> } 800020d0: 70a2 ld ra,40(sp) 800020d2: 7402 ld s0,32(sp) 800020d4: 64e2 ld s1,24(sp) 800020d6: 6942 ld s2,16(sp) 800020d8: 69a2 ld s3,8(sp) 800020da: 6145 addi sp,sp,48 800020dc: 8082 ret 00000000800020de <wait>: { 800020de: 715d addi sp,sp,-80 800020e0: e486 sd ra,72(sp) 800020e2: e0a2 sd s0,64(sp) 800020e4: fc26 sd s1,56(sp) 800020e6: f84a sd s2,48(sp) 800020e8: f44e sd s3,40(sp) 800020ea: f052 sd s4,32(sp) 800020ec: ec56 sd s5,24(sp) 800020ee: e85a sd s6,16(sp) 800020f0: e45e sd s7,8(sp) 800020f2: e062 sd s8,0(sp) 800020f4: 0880 addi s0,sp,80 800020f6: 8b2a mv s6,a0 struct proc *p = myproc(); 800020f8: 00000097 auipc ra,0x0 800020fc: 8be080e7 jalr -1858(ra) # 800019b6 <myproc> 80002100: 892a mv s2,a0 acquire(&wait_lock); 80002102: 0000f517 auipc a0,0xf 80002106: 1b650513 addi a0,a0,438 # 800112b8 <wait_lock> 8000210a: fffff097 auipc ra,0xfffff 8000210e: ada080e7 jalr -1318(ra) # 80000be4 <acquire> havekids = 0; 80002112: 4b81 li s7,0 if(np->state == ZOMBIE){ 80002114: 4a15 li s4,5 for(np = proc; np < &proc[NPROC]; np++){ 80002116: 00015997 auipc s3,0x15 8000211a: 1ba98993 addi s3,s3,442 # 800172d0 <cpus> havekids = 1; 8000211e: 4a85 li s5,1 sleep(p, &wait_lock); //DOC: wait-sleep 80002120: 0000fc17 auipc s8,0xf 80002124: 198c0c13 addi s8,s8,408 # 800112b8 <wait_lock> havekids = 0; 80002128: 875e mv a4,s7 for(np = proc; np < &proc[NPROC]; np++){ 8000212a: 0000f497 auipc s1,0xf 8000212e: 1a648493 addi s1,s1,422 # 800112d0 <proc> 80002132: a0bd j 800021a0 <wait+0xc2> pid = np->pid; 80002134: 0304a983 lw s3,48(s1) if(addr != 0 && copyout(p->pagetable, addr, (char *)&np->xstate, 80002138: 000b0e63 beqz s6,80002154 <wait+0x76> 8000213c: 4691 li a3,4 8000213e: 02c48613 addi a2,s1,44 80002142: 85da mv a1,s6 80002144: 05093503 ld a0,80(s2) 80002148: fffff097 auipc ra,0xfffff 8000214c: 52a080e7 jalr 1322(ra) # 80001672 <copyout> 80002150: 02054563 bltz a0,8000217a <wait+0x9c> freeproc(np); 80002154: 8526 mv a0,s1 80002156: 00000097 auipc ra,0x0 8000215a: a18080e7 jalr -1512(ra) # 80001b6e <freeproc> release(&np->lock); 8000215e: 8526 mv a0,s1 80002160: fffff097 auipc ra,0xfffff 80002164: b38080e7 jalr -1224(ra) # 80000c98 <release> release(&wait_lock); 80002168: 0000f517 auipc a0,0xf 8000216c: 15050513 addi a0,a0,336 # 800112b8 <wait_lock> 80002170: fffff097 auipc ra,0xfffff 80002174: b28080e7 jalr -1240(ra) # 80000c98 <release> return pid; 80002178: a09d j 800021de <wait+0x100> release(&np->lock); 8000217a: 8526 mv a0,s1 8000217c: fffff097 auipc ra,0xfffff 80002180: b1c080e7 jalr -1252(ra) # 80000c98 <release> release(&wait_lock); 80002184: 0000f517 auipc a0,0xf 80002188: 13450513 addi a0,a0,308 # 800112b8 <wait_lock> 8000218c: fffff097 auipc ra,0xfffff 80002190: b0c080e7 jalr -1268(ra) # 80000c98 <release> return -1; 80002194: 59fd li s3,-1 80002196: a0a1 j 800021de <wait+0x100> for(np = proc; np < &proc[NPROC]; np++){ 80002198: 18048493 addi s1,s1,384 8000219c: 03348463 beq s1,s3,800021c4 <wait+0xe6> if(np->parent == p){ 800021a0: 7c9c ld a5,56(s1) 800021a2: ff279be3 bne a5,s2,80002198 <wait+0xba> acquire(&np->lock); 800021a6: 8526 mv a0,s1 800021a8: fffff097 auipc ra,0xfffff 800021ac: a3c080e7 jalr -1476(ra) # 80000be4 <acquire> if(np->state == ZOMBIE){ 800021b0: 4c9c lw a5,24(s1) 800021b2: f94781e3 beq a5,s4,80002134 <wait+0x56> release(&np->lock); 800021b6: 8526 mv a0,s1 800021b8: fffff097 auipc ra,0xfffff 800021bc: ae0080e7 jalr -1312(ra) # 80000c98 <release> havekids = 1; 800021c0: 8756 mv a4,s5 800021c2: bfd9 j 80002198 <wait+0xba> if(!havekids || p->killed){ 800021c4: c701 beqz a4,800021cc <wait+0xee> 800021c6: 02892783 lw a5,40(s2) 800021ca: c79d beqz a5,800021f8 <wait+0x11a> release(&wait_lock); 800021cc: 0000f517 auipc a0,0xf 800021d0: 0ec50513 addi a0,a0,236 # 800112b8 <wait_lock> 800021d4: fffff097 auipc ra,0xfffff 800021d8: ac4080e7 jalr -1340(ra) # 80000c98 <release> return -1; 800021dc: 59fd li s3,-1 } 800021de: 854e mv a0,s3 800021e0: 60a6 ld ra,72(sp) 800021e2: 6406 ld s0,64(sp) 800021e4: 74e2 ld s1,56(sp) 800021e6: 7942 ld s2,48(sp) 800021e8: 79a2 ld s3,40(sp) 800021ea: 7a02 ld s4,32(sp) 800021ec: 6ae2 ld s5,24(sp) 800021ee: 6b42 ld s6,16(sp) 800021f0: 6ba2 ld s7,8(sp) 800021f2: 6c02 ld s8,0(sp) 800021f4: 6161 addi sp,sp,80 800021f6: 8082 ret sleep(p, &wait_lock); //DOC: wait-sleep 800021f8: 85e2 mv a1,s8 800021fa: 854a mv a0,s2 800021fc: 00000097 auipc ra,0x0 80002200: e7e080e7 jalr -386(ra) # 8000207a <sleep> havekids = 0; 80002204: b715 j 80002128 <wait+0x4a> 0000000080002206 <wakeup>: // Wake up all processes sleeping on chan. // Must be called without any p->lock. void wakeup(void *chan) { 80002206: 7139 addi sp,sp,-64 80002208: fc06 sd ra,56(sp) 8000220a: f822 sd s0,48(sp) 8000220c: f426 sd s1,40(sp) 8000220e: f04a sd s2,32(sp) 80002210: ec4e sd s3,24(sp) 80002212: e852 sd s4,16(sp) 80002214: e456 sd s5,8(sp) 80002216: 0080 addi s0,sp,64 80002218: 8a2a mv s4,a0 struct proc *p; for(p = proc; p < &proc[NPROC]; p++) { 8000221a: 0000f497 auipc s1,0xf 8000221e: 0b648493 addi s1,s1,182 # 800112d0 <proc> if(p != myproc()){ acquire(&p->lock); if(p->state == SLEEPING && p->chan == chan) { 80002222: 4989 li s3,2 p->state = RUNNABLE; 80002224: 4a8d li s5,3 for(p = proc; p < &proc[NPROC]; p++) { 80002226: 00015917 auipc s2,0x15 8000222a: 0aa90913 addi s2,s2,170 # 800172d0 <cpus> 8000222e: a821 j 80002246 <wakeup+0x40> p->state = RUNNABLE; 80002230: 0154ac23 sw s5,24(s1) } release(&p->lock); 80002234: 8526 mv a0,s1 80002236: fffff097 auipc ra,0xfffff 8000223a: a62080e7 jalr -1438(ra) # 80000c98 <release> for(p = proc; p < &proc[NPROC]; p++) { 8000223e: 18048493 addi s1,s1,384 80002242: 03248463 beq s1,s2,8000226a <wakeup+0x64> if(p != myproc()){ 80002246: fffff097 auipc ra,0xfffff 8000224a: 770080e7 jalr 1904(ra) # 800019b6 <myproc> 8000224e: fea488e3 beq s1,a0,8000223e <wakeup+0x38> acquire(&p->lock); 80002252: 8526 mv a0,s1 80002254: fffff097 auipc ra,0xfffff 80002258: 990080e7 jalr -1648(ra) # 80000be4 <acquire> if(p->state == SLEEPING && p->chan == chan) { 8000225c: 4c9c lw a5,24(s1) 8000225e: fd379be3 bne a5,s3,80002234 <wakeup+0x2e> 80002262: 709c ld a5,32(s1) 80002264: fd4798e3 bne a5,s4,80002234 <wakeup+0x2e> 80002268: b7e1 j 80002230 <wakeup+0x2a> } } } 8000226a: 70e2 ld ra,56(sp) 8000226c: 7442 ld s0,48(sp) 8000226e: 74a2 ld s1,40(sp) 80002270: 7902 ld s2,32(sp) 80002272: 69e2 ld s3,24(sp) 80002274: 6a42 ld s4,16(sp) 80002276: 6aa2 ld s5,8(sp) 80002278: 6121 addi sp,sp,64 8000227a: 8082 ret 000000008000227c <reparent>: { 8000227c: 7179 addi sp,sp,-48 8000227e: f406 sd ra,40(sp) 80002280: f022 sd s0,32(sp) 80002282: ec26 sd s1,24(sp) 80002284: e84a sd s2,16(sp) 80002286: e44e sd s3,8(sp) 80002288: e052 sd s4,0(sp) 8000228a: 1800 addi s0,sp,48 8000228c: 892a mv s2,a0 for(pp = proc; pp < &proc[NPROC]; pp++){ 8000228e: 0000f497 auipc s1,0xf 80002292: 04248493 addi s1,s1,66 # 800112d0 <proc> pp->parent = initproc; 80002296: 00007a17 auipc s4,0x7 8000229a: d9aa0a13 addi s4,s4,-614 # 80009030 <initproc> for(pp = proc; pp < &proc[NPROC]; pp++){ 8000229e: 00015997 auipc s3,0x15 800022a2: 03298993 addi s3,s3,50 # 800172d0 <cpus> 800022a6: a029 j 800022b0 <reparent+0x34> 800022a8: 18048493 addi s1,s1,384 800022ac: 01348d63 beq s1,s3,800022c6 <reparent+0x4a> if(pp->parent == p){ 800022b0: 7c9c ld a5,56(s1) 800022b2: ff279be3 bne a5,s2,800022a8 <reparent+0x2c> pp->parent = initproc; 800022b6: 000a3503 ld a0,0(s4) 800022ba: fc88 sd a0,56(s1) wakeup(initproc); 800022bc: 00000097 auipc ra,0x0 800022c0: f4a080e7 jalr -182(ra) # 80002206 <wakeup> 800022c4: b7d5 j 800022a8 <reparent+0x2c> } 800022c6: 70a2 ld ra,40(sp) 800022c8: 7402 ld s0,32(sp) 800022ca: 64e2 ld s1,24(sp) 800022cc: 6942 ld s2,16(sp) 800022ce: 69a2 ld s3,8(sp) 800022d0: 6a02 ld s4,0(sp) 800022d2: 6145 addi sp,sp,48 800022d4: 8082 ret 00000000800022d6 <exit>: { 800022d6: 7179 addi sp,sp,-48 800022d8: f406 sd ra,40(sp) 800022da: f022 sd s0,32(sp) 800022dc: ec26 sd s1,24(sp) 800022de: e84a sd s2,16(sp) 800022e0: e44e sd s3,8(sp) 800022e2: e052 sd s4,0(sp) 800022e4: 1800 addi s0,sp,48 800022e6: 8a2a mv s4,a0 struct proc *p = myproc(); 800022e8: fffff097 auipc ra,0xfffff 800022ec: 6ce080e7 jalr 1742(ra) # 800019b6 <myproc> 800022f0: 89aa mv s3,a0 if(p == initproc) 800022f2: 00007797 auipc a5,0x7 800022f6: d3e7b783 ld a5,-706(a5) # 80009030 <initproc> 800022fa: 0d050493 addi s1,a0,208 800022fe: 15050913 addi s2,a0,336 80002302: 02a79363 bne a5,a0,80002328 <exit+0x52> panic("init exiting"); 80002306: 00006517 auipc a0,0x6 8000230a: f5a50513 addi a0,a0,-166 # 80008260 <digits+0x220> 8000230e: ffffe097 auipc ra,0xffffe 80002312: 230080e7 jalr 560(ra) # 8000053e <panic> fileclose(f); 80002316: 00002097 auipc ra,0x2 8000231a: 576080e7 jalr 1398(ra) # 8000488c <fileclose> p->ofile[fd] = 0; 8000231e: 0004b023 sd zero,0(s1) for(int fd = 0; fd < NOFILE; fd++){ 80002322: 04a1 addi s1,s1,8 80002324: 01248563 beq s1,s2,8000232e <exit+0x58> if(p->ofile[fd]){ 80002328: 6088 ld a0,0(s1) 8000232a: f575 bnez a0,80002316 <exit+0x40> 8000232c: bfdd j 80002322 <exit+0x4c> begin_op(); 8000232e: 00002097 auipc ra,0x2 80002332: 092080e7 jalr 146(ra) # 800043c0 <begin_op> iput(p->cwd); 80002336: 1509b503 ld a0,336(s3) 8000233a: 00002097 auipc ra,0x2 8000233e: 86e080e7 jalr -1938(ra) # 80003ba8 <iput> end_op(); 80002342: 00002097 auipc ra,0x2 80002346: 0fe080e7 jalr 254(ra) # 80004440 <end_op> p->cwd = 0; 8000234a: 1409b823 sd zero,336(s3) acquire(&wait_lock); 8000234e: 0000f497 auipc s1,0xf 80002352: f6a48493 addi s1,s1,-150 # 800112b8 <wait_lock> 80002356: 8526 mv a0,s1 80002358: fffff097 auipc ra,0xfffff 8000235c: 88c080e7 jalr -1908(ra) # 80000be4 <acquire> reparent(p); 80002360: 854e mv a0,s3 80002362: 00000097 auipc ra,0x0 80002366: f1a080e7 jalr -230(ra) # 8000227c <reparent> wakeup(p->parent); 8000236a: 0389b503 ld a0,56(s3) 8000236e: 00000097 auipc ra,0x0 80002372: e98080e7 jalr -360(ra) # 80002206 <wakeup> acquire(&p->lock); 80002376: 854e mv a0,s3 80002378: fffff097 auipc ra,0xfffff 8000237c: 86c080e7 jalr -1940(ra) # 80000be4 <acquire> p->xstate = status; 80002380: 0349a623 sw s4,44(s3) p->state = ZOMBIE; 80002384: 4795 li a5,5 80002386: 00f9ac23 sw a5,24(s3) release(&wait_lock); 8000238a: 8526 mv a0,s1 8000238c: fffff097 auipc ra,0xfffff 80002390: 90c080e7 jalr -1780(ra) # 80000c98 <release> sched(); 80002394: 00000097 auipc ra,0x0 80002398: bc8080e7 jalr -1080(ra) # 80001f5c <sched> panic("zombie exit"); 8000239c: 00006517 auipc a0,0x6 800023a0: ed450513 addi a0,a0,-300 # 80008270 <digits+0x230> 800023a4: ffffe097 auipc ra,0xffffe 800023a8: 19a080e7 jalr 410(ra) # 8000053e <panic> 00000000800023ac <kill>: // Kill the process with the given pid. // The victim won't exit until it tries to return // to user space (see usertrap() in trap.c). int kill(int pid) { 800023ac: 7179 addi sp,sp,-48 800023ae: f406 sd ra,40(sp) 800023b0: f022 sd s0,32(sp) 800023b2: ec26 sd s1,24(sp) 800023b4: e84a sd s2,16(sp) 800023b6: e44e sd s3,8(sp) 800023b8: 1800 addi s0,sp,48 800023ba: 892a mv s2,a0 struct proc *p; for(p = proc; p < &proc[NPROC]; p++){ 800023bc: 0000f497 auipc s1,0xf 800023c0: f1448493 addi s1,s1,-236 # 800112d0 <proc> 800023c4: 00015997 auipc s3,0x15 800023c8: f0c98993 addi s3,s3,-244 # 800172d0 <cpus> acquire(&p->lock); 800023cc: 8526 mv a0,s1 800023ce: fffff097 auipc ra,0xfffff 800023d2: 816080e7 jalr -2026(ra) # 80000be4 <acquire> if(p->pid == pid){ 800023d6: 589c lw a5,48(s1) 800023d8: 01278d63 beq a5,s2,800023f2 <kill+0x46> p->state = RUNNABLE; } release(&p->lock); return 0; } release(&p->lock); 800023dc: 8526 mv a0,s1 800023de: fffff097 auipc ra,0xfffff 800023e2: 8ba080e7 jalr -1862(ra) # 80000c98 <release> for(p = proc; p < &proc[NPROC]; p++){ 800023e6: 18048493 addi s1,s1,384 800023ea: ff3491e3 bne s1,s3,800023cc <kill+0x20> } return -1; 800023ee: 557d li a0,-1 800023f0: a829 j 8000240a <kill+0x5e> p->killed = 1; 800023f2: 4785 li a5,1 800023f4: d49c sw a5,40(s1) if(p->state == SLEEPING){ 800023f6: 4c98 lw a4,24(s1) 800023f8: 4789 li a5,2 800023fa: 00f70f63 beq a4,a5,80002418 <kill+0x6c> release(&p->lock); 800023fe: 8526 mv a0,s1 80002400: fffff097 auipc ra,0xfffff 80002404: 898080e7 jalr -1896(ra) # 80000c98 <release> return 0; 80002408: 4501 li a0,0 } 8000240a: 70a2 ld ra,40(sp) 8000240c: 7402 ld s0,32(sp) 8000240e: 64e2 ld s1,24(sp) 80002410: 6942 ld s2,16(sp) 80002412: 69a2 ld s3,8(sp) 80002414: 6145 addi sp,sp,48 80002416: 8082 ret p->state = RUNNABLE; 80002418: 478d li a5,3 8000241a: cc9c sw a5,24(s1) 8000241c: b7cd j 800023fe <kill+0x52> 000000008000241e <either_copyout>: // Copy to either a user address, or kernel address, // depending on usr_dst. // Returns 0 on success, -1 on error. int either_copyout(int user_dst, uint64 dst, void *src, uint64 len) { 8000241e: 7179 addi sp,sp,-48 80002420: f406 sd ra,40(sp) 80002422: f022 sd s0,32(sp) 80002424: ec26 sd s1,24(sp) 80002426: e84a sd s2,16(sp) 80002428: e44e sd s3,8(sp) 8000242a: e052 sd s4,0(sp) 8000242c: 1800 addi s0,sp,48 8000242e: 84aa mv s1,a0 80002430: 892e mv s2,a1 80002432: 89b2 mv s3,a2 80002434: 8a36 mv s4,a3 struct proc *p = myproc(); 80002436: fffff097 auipc ra,0xfffff 8000243a: 580080e7 jalr 1408(ra) # 800019b6 <myproc> if(user_dst){ 8000243e: c08d beqz s1,80002460 <either_copyout+0x42> return copyout(p->pagetable, dst, src, len); 80002440: 86d2 mv a3,s4 80002442: 864e mv a2,s3 80002444: 85ca mv a1,s2 80002446: 6928 ld a0,80(a0) 80002448: fffff097 auipc ra,0xfffff 8000244c: 22a080e7 jalr 554(ra) # 80001672 <copyout> } else { memmove((char *)dst, src, len); return 0; } } 80002450: 70a2 ld ra,40(sp) 80002452: 7402 ld s0,32(sp) 80002454: 64e2 ld s1,24(sp) 80002456: 6942 ld s2,16(sp) 80002458: 69a2 ld s3,8(sp) 8000245a: 6a02 ld s4,0(sp) 8000245c: 6145 addi sp,sp,48 8000245e: 8082 ret memmove((char *)dst, src, len); 80002460: 000a061b sext.w a2,s4 80002464: 85ce mv a1,s3 80002466: 854a mv a0,s2 80002468: fffff097 auipc ra,0xfffff 8000246c: 8d8080e7 jalr -1832(ra) # 80000d40 <memmove> return 0; 80002470: 8526 mv a0,s1 80002472: bff9 j 80002450 <either_copyout+0x32> 0000000080002474 <either_copyin>: // Copy from either a user address, or kernel address, // depending on usr_src. // Returns 0 on success, -1 on error. int either_copyin(void *dst, int user_src, uint64 src, uint64 len) { 80002474: 7179 addi sp,sp,-48 80002476: f406 sd ra,40(sp) 80002478: f022 sd s0,32(sp) 8000247a: ec26 sd s1,24(sp) 8000247c: e84a sd s2,16(sp) 8000247e: e44e sd s3,8(sp) 80002480: e052 sd s4,0(sp) 80002482: 1800 addi s0,sp,48 80002484: 892a mv s2,a0 80002486: 84ae mv s1,a1 80002488: 89b2 mv s3,a2 8000248a: 8a36 mv s4,a3 struct proc *p = myproc(); 8000248c: fffff097 auipc ra,0xfffff 80002490: 52a080e7 jalr 1322(ra) # 800019b6 <myproc> if(user_src){ 80002494: c08d beqz s1,800024b6 <either_copyin+0x42> return copyin(p->pagetable, dst, src, len); 80002496: 86d2 mv a3,s4 80002498: 864e mv a2,s3 8000249a: 85ca mv a1,s2 8000249c: 6928 ld a0,80(a0) 8000249e: fffff097 auipc ra,0xfffff 800024a2: 260080e7 jalr 608(ra) # 800016fe <copyin> } else { memmove(dst, (char*)src, len); return 0; } } 800024a6: 70a2 ld ra,40(sp) 800024a8: 7402 ld s0,32(sp) 800024aa: 64e2 ld s1,24(sp) 800024ac: 6942 ld s2,16(sp) 800024ae: 69a2 ld s3,8(sp) 800024b0: 6a02 ld s4,0(sp) 800024b2: 6145 addi sp,sp,48 800024b4: 8082 ret memmove(dst, (char*)src, len); 800024b6: 000a061b sext.w a2,s4 800024ba: 85ce mv a1,s3 800024bc: 854a mv a0,s2 800024be: fffff097 auipc ra,0xfffff 800024c2: 882080e7 jalr -1918(ra) # 80000d40 <memmove> return 0; 800024c6: 8526 mv a0,s1 800024c8: bff9 j 800024a6 <either_copyin+0x32> 00000000800024ca <print_hello>: //hello: printing hello message void print_hello(int n) { 800024ca: 1141 addi sp,sp,-16 800024cc: e406 sd ra,8(sp) 800024ce: e022 sd s0,0(sp) 800024d0: 0800 addi s0,sp,16 800024d2: 85aa mv a1,a0 printf ("Hello from kernel space %d\n",n); 800024d4: 00006517 auipc a0,0x6 800024d8: dac50513 addi a0,a0,-596 # 80008280 <digits+0x240> 800024dc: ffffe097 auipc ra,0xffffe 800024e0: 0ac080e7 jalr 172(ra) # 80000588 <printf> } 800024e4: 60a2 ld ra,8(sp) 800024e6: 6402 ld s0,0(sp) 800024e8: 0141 addi sp,sp,16 800024ea: 8082 ret 00000000800024ec <procdump>: // Print a process listing to console. For debugging. // Runs when user types ^P on console. // No lock to avoid wedging a stuck machine further. void procdump(void) { 800024ec: 715d addi sp,sp,-80 800024ee: e486 sd ra,72(sp) 800024f0: e0a2 sd s0,64(sp) 800024f2: fc26 sd s1,56(sp) 800024f4: f84a sd s2,48(sp) 800024f6: f44e sd s3,40(sp) 800024f8: f052 sd s4,32(sp) 800024fa: ec56 sd s5,24(sp) 800024fc: e85a sd s6,16(sp) 800024fe: e45e sd s7,8(sp) 80002500: 0880 addi s0,sp,80 [ZOMBIE] "zombie" }; struct proc *p; char *state; printf("\n"); 80002502: 00006517 auipc a0,0x6 80002506: e0650513 addi a0,a0,-506 # 80008308 <digits+0x2c8> 8000250a: ffffe097 auipc ra,0xffffe 8000250e: 07e080e7 jalr 126(ra) # 80000588 <printf> for(p = proc; p < &proc[NPROC]; p++){ 80002512: 0000f497 auipc s1,0xf 80002516: f1648493 addi s1,s1,-234 # 80011428 <proc+0x158> 8000251a: 00015917 auipc s2,0x15 8000251e: f0e90913 addi s2,s2,-242 # 80017428 <cpus+0x158> if(p->state == UNUSED) continue; if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 80002522: 4b15 li s6,5 state = states[p->state]; else state = "???"; 80002524: 00006997 auipc s3,0x6 80002528: d7c98993 addi s3,s3,-644 # 800082a0 <digits+0x260> printf("%d %s %s", p->pid, state, p->name); 8000252c: 00006a97 auipc s5,0x6 80002530: d7ca8a93 addi s5,s5,-644 # 800082a8 <digits+0x268> printf("\n"); 80002534: 00006a17 auipc s4,0x6 80002538: dd4a0a13 addi s4,s4,-556 # 80008308 <digits+0x2c8> if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 8000253c: 00006b97 auipc s7,0x6 80002540: e64b8b93 addi s7,s7,-412 # 800083a0 <states.1732> 80002544: a00d j 80002566 <procdump+0x7a> printf("%d %s %s", p->pid, state, p->name); 80002546: ed86a583 lw a1,-296(a3) 8000254a: 8556 mv a0,s5 8000254c: ffffe097 auipc ra,0xffffe 80002550: 03c080e7 jalr 60(ra) # 80000588 <printf> printf("\n"); 80002554: 8552 mv a0,s4 80002556: ffffe097 auipc ra,0xffffe 8000255a: 032080e7 jalr 50(ra) # 80000588 <printf> for(p = proc; p < &proc[NPROC]; p++){ 8000255e: 18048493 addi s1,s1,384 80002562: 03248163 beq s1,s2,80002584 <procdump+0x98> if(p->state == UNUSED) 80002566: 86a6 mv a3,s1 80002568: ec04a783 lw a5,-320(s1) 8000256c: dbed beqz a5,8000255e <procdump+0x72> state = "???"; 8000256e: 864e mv a2,s3 if(p->state >= 0 && p->state < NELEM(states) && states[p->state]) 80002570: fcfb6be3 bltu s6,a5,80002546 <procdump+0x5a> 80002574: 1782 slli a5,a5,0x20 80002576: 9381 srli a5,a5,0x20 80002578: 078e slli a5,a5,0x3 8000257a: 97de add a5,a5,s7 8000257c: 6390 ld a2,0(a5) 8000257e: f661 bnez a2,80002546 <procdump+0x5a> state = "???"; 80002580: 864e mv a2,s3 80002582: b7d1 j 80002546 <procdump+0x5a> } } 80002584: 60a6 ld ra,72(sp) 80002586: 6406 ld s0,64(sp) 80002588: 74e2 ld s1,56(sp) 8000258a: 7942 ld s2,48(sp) 8000258c: 79a2 ld s3,40(sp) 8000258e: 7a02 ld s4,32(sp) 80002590: 6ae2 ld s5,24(sp) 80002592: 6b42 ld s6,16(sp) 80002594: 6ba2 ld s7,8(sp) 80002596: 6161 addi sp,sp,80 80002598: 8082 ret 000000008000259a <print_info>: // lab1 starts from here void print_info(int n) { 8000259a: 7179 addi sp,sp,-48 8000259c: f406 sd ra,40(sp) 8000259e: f022 sd s0,32(sp) 800025a0: ec26 sd s1,24(sp) 800025a2: e84a sd s2,16(sp) 800025a4: e44e sd s3,8(sp) 800025a6: 1800 addi s0,sp,48 if(n==1) // This condition is about if you pass parameter 1 to integer n than it passes the print statement 800025a8: 4785 li a5,1 800025aa: 02f50763 beq a0,a5,800025d8 <print_info+0x3e> if(p->state !=0) count++; release(&p->lock); } printf("The total numbers of processes are: %d\n",count); // It prints the no of processes } else if(n==2) // This returns the number of system calls this program has used 800025ae: 4789 li a5,2 800025b0: 06f50a63 beq a0,a5,80002624 <print_info+0x8a> { // We have used a counter named "syscallCounter" which gets increamented every time printf("The total number of system calls are: %d\n",myproc()->syscallCounter); } else if(n==3) // This statement returns the number of pages this program invokes 800025b4: 478d li a5,3 800025b6: 08f50663 beq a0,a5,80002642 <print_info+0xa8> { // To count the number pages we simply divide the page size by Number of pages printf("The total number of page table entries are: %d\n",myproc()->sz / 4096); } else { printf("This is an invalid choice please enter from 1 to 3"); 800025ba: 00006517 auipc a0,0x6 800025be: d8650513 addi a0,a0,-634 # 80008340 <digits+0x300> 800025c2: ffffe097 auipc ra,0xffffe 800025c6: fc6080e7 jalr -58(ra) # 80000588 <printf> } } 800025ca: 70a2 ld ra,40(sp) 800025cc: 7402 ld s0,32(sp) 800025ce: 64e2 ld s1,24(sp) 800025d0: 6942 ld s2,16(sp) 800025d2: 69a2 ld s3,8(sp) 800025d4: 6145 addi sp,sp,48 800025d6: 8082 ret for(p=proc; p < &proc[NPROC]; p++) // It goes to the schedular and counts how many pages are unused 800025d8: 0000f497 auipc s1,0xf 800025dc: cf848493 addi s1,s1,-776 # 800112d0 <proc> int count=0; 800025e0: 4901 li s2,0 for(p=proc; p < &proc[NPROC]; p++) // It goes to the schedular and counts how many pages are unused 800025e2: 00015997 auipc s3,0x15 800025e6: cee98993 addi s3,s3,-786 # 800172d0 <cpus> 800025ea: a811 j 800025fe <print_info+0x64> release(&p->lock); 800025ec: 8526 mv a0,s1 800025ee: ffffe097 auipc ra,0xffffe 800025f2: 6aa080e7 jalr 1706(ra) # 80000c98 <release> for(p=proc; p < &proc[NPROC]; p++) // It goes to the schedular and counts how many pages are unused 800025f6: 18048493 addi s1,s1,384 800025fa: 01348b63 beq s1,s3,80002610 <print_info+0x76> acquire(&p->lock); 800025fe: 8526 mv a0,s1 80002600: ffffe097 auipc ra,0xffffe 80002604: 5e4080e7 jalr 1508(ra) # 80000be4 <acquire> if(p->state !=0) count++; 80002608: 4c9c lw a5,24(s1) 8000260a: d3ed beqz a5,800025ec <print_info+0x52> 8000260c: 2905 addiw s2,s2,1 8000260e: bff9 j 800025ec <print_info+0x52> printf("The total numbers of processes are: %d\n",count); // It prints the no of processes 80002610: 85ca mv a1,s2 80002612: 00006517 auipc a0,0x6 80002616: ca650513 addi a0,a0,-858 # 800082b8 <digits+0x278> 8000261a: ffffe097 auipc ra,0xffffe 8000261e: f6e080e7 jalr -146(ra) # 80000588 <printf> 80002622: b765 j 800025ca <print_info+0x30> printf("The total number of system calls are: %d\n",myproc()->syscallCounter); 80002624: fffff097 auipc ra,0xfffff 80002628: 392080e7 jalr 914(ra) # 800019b6 <myproc> 8000262c: 16852583 lw a1,360(a0) 80002630: 00006517 auipc a0,0x6 80002634: cb050513 addi a0,a0,-848 # 800082e0 <digits+0x2a0> 80002638: ffffe097 auipc ra,0xffffe 8000263c: f50080e7 jalr -176(ra) # 80000588 <printf> 80002640: b769 j 800025ca <print_info+0x30> printf("The total number of page table entries are: %d\n",myproc()->sz / 4096); 80002642: fffff097 auipc ra,0xfffff 80002646: 374080e7 jalr 884(ra) # 800019b6 <myproc> 8000264a: 652c ld a1,72(a0) 8000264c: 81b1 srli a1,a1,0xc 8000264e: 00006517 auipc a0,0x6 80002652: cc250513 addi a0,a0,-830 # 80008310 <digits+0x2d0> 80002656: ffffe097 auipc ra,0xffffe 8000265a: f32080e7 jalr -206(ra) # 80000588 <printf> 8000265e: b7b5 j 800025ca <print_info+0x30> 0000000080002660 <set_tickets>: //lab2 void set_tickets(int numTickets) { 80002660: 7179 addi sp,sp,-48 80002662: f406 sd ra,40(sp) 80002664: f022 sd s0,32(sp) 80002666: ec26 sd s1,24(sp) 80002668: e84a sd s2,16(sp) 8000266a: e44e sd s3,8(sp) 8000266c: 1800 addi s0,sp,48 8000266e: 892a mv s2,a0 struct proc *curproc = myproc(); 80002670: fffff097 auipc ra,0xfffff 80002674: 346080e7 jalr 838(ra) # 800019b6 <myproc> 80002678: 84aa mv s1,a0 acquire(&pid_lock); 8000267a: 0000f997 auipc s3,0xf 8000267e: c2698993 addi s3,s3,-986 # 800112a0 <pid_lock> 80002682: 854e mv a0,s3 80002684: ffffe097 auipc ra,0xffffe 80002688: 560080e7 jalr 1376(ra) # 80000be4 <acquire> curproc->tickets = numTickets; 8000268c: 1724a623 sw s2,364(s1) release(&pid_lock); 80002690: 854e mv a0,s3 80002692: ffffe097 auipc ra,0xffffe 80002696: 606080e7 jalr 1542(ra) # 80000c98 <release> } 8000269a: 70a2 ld ra,40(sp) 8000269c: 7402 ld s0,32(sp) 8000269e: 64e2 ld s1,24(sp) 800026a0: 6942 ld s2,16(sp) 800026a2: 69a2 ld s3,8(sp) 800026a4: 6145 addi sp,sp,48 800026a6: 8082 ret 00000000800026a8 <sched_statistics>: }*/ void sched_statistics() { 800026a8: 1141 addi sp,sp,-16 800026aa: e406 sd ra,8(sp) 800026ac: e022 sd s0,0(sp) 800026ae: 0800 addi s0,sp,16 printf("The total number of system calls are: %d\n",myproc()->syscallCounter); 800026b0: fffff097 auipc ra,0xfffff 800026b4: 306080e7 jalr 774(ra) # 800019b6 <myproc> 800026b8: 16852583 lw a1,360(a0) 800026bc: 00006517 auipc a0,0x6 800026c0: c2450513 addi a0,a0,-988 # 800082e0 <digits+0x2a0> 800026c4: ffffe097 auipc ra,0xffffe 800026c8: ec4080e7 jalr -316(ra) # 80000588 <printf> } 800026cc: 60a2 ld ra,8(sp) 800026ce: 6402 ld s0,0(sp) 800026d0: 0141 addi sp,sp,16 800026d2: 8082 ret 00000000800026d4 <stride_runs>: int stride_runs() { 800026d4: 1141 addi sp,sp,-16 800026d6: e422 sd s0,8(sp) 800026d8: 0800 addi s0,sp,16 //struct proc *p; //return p->numRan; return 0; } 800026da: 4501 li a0,0 800026dc: 6422 ld s0,8(sp) 800026de: 0141 addi sp,sp,16 800026e0: 8082 ret 00000000800026e2 <rand>: #define RAND_MAX_32 ((1U << 31) - 1) int rseed = 0; int rand() { 800026e2: 1141 addi sp,sp,-16 800026e4: e422 sd s0,8(sp) 800026e6: 0800 addi s0,sp,16 return (rseed = (rseed * 214013 + 2531011) & RAND_MAX_32) >> 16; 800026e8: 00007717 auipc a4,0x7 800026ec: 94070713 addi a4,a4,-1728 # 80009028 <rseed> 800026f0: 4308 lw a0,0(a4) 800026f2: 000347b7 lui a5,0x34 800026f6: 3fd7879b addiw a5,a5,1021 800026fa: 02f5053b mulw a0,a0,a5 800026fe: 0026a7b7 lui a5,0x26a 80002702: ec37879b addiw a5,a5,-317 80002706: 9d3d addw a0,a0,a5 80002708: 1506 slli a0,a0,0x21 8000270a: 9105 srli a0,a0,0x21 8000270c: c308 sw a0,0(a4) } 8000270e: 8141 srli a0,a0,0x10 80002710: 6422 ld s0,8(sp) 80002712: 0141 addi sp,sp,16 80002714: 8082 ret 0000000080002716 <lottery_scheduler>: //#ifdef LOTTERY //lottery scheduler void lottery_scheduler(void) { 80002716: 715d addi sp,sp,-80 80002718: e486 sd ra,72(sp) 8000271a: e0a2 sd s0,64(sp) 8000271c: fc26 sd s1,56(sp) 8000271e: f84a sd s2,48(sp) 80002720: f44e sd s3,40(sp) 80002722: f052 sd s4,32(sp) 80002724: ec56 sd s5,24(sp) 80002726: e85a sd s6,16(sp) 80002728: e45e sd s7,8(sp) 8000272a: 0880 addi s0,sp,80 8000272c: 8792 mv a5,tp int id = r_tp(); 8000272e: 2781 sext.w a5,a5 struct proc *p; struct cpu *c = mycpu(); c->proc = 0; 80002730: 00015b97 auipc s7,0x15 80002734: ba0b8b93 addi s7,s7,-1120 # 800172d0 <cpus> 80002738: 16000713 li a4,352 8000273c: 02e78733 mul a4,a5,a4 80002740: 00eb86b3 add a3,s7,a4 80002744: 0006b023 sd zero,0(a3) // Schedule this process c->proc = p; //switchuvm(p); p->state = RUNNING; swtch(&c->lottery_scheduler,&p->context); 80002748: 08070713 addi a4,a4,128 8000274c: 9bba add s7,s7,a4 tot_tickets = 0; 8000274e: 4b01 li s6,0 if (p->state != RUNNABLE) { 80002750: 490d li s2,3 for(p = proc; p < &proc[NPROC]; p++) { 80002752: 00015997 auipc s3,0x15 80002756: b7e98993 addi s3,s3,-1154 # 800172d0 <cpus> c->proc = p; 8000275a: 8ab6 mv s5,a3 8000275c: a895 j 800027d0 <lottery_scheduler+0xba> for(p = proc; p < &proc[NPROC]; p++) { 8000275e: 18048493 addi s1,s1,384 80002762: 01348f63 beq s1,s3,80002780 <lottery_scheduler+0x6a> acquire(&p->lock); 80002766: 8526 mv a0,s1 80002768: ffffe097 auipc ra,0xffffe 8000276c: 47c080e7 jalr 1148(ra) # 80000be4 <acquire> if (p->state != RUNNABLE) { 80002770: 4c9c lw a5,24(s1) 80002772: ff2796e3 bne a5,s2,8000275e <lottery_scheduler+0x48> tot_tickets += p->tickets; 80002776: 16c4a783 lw a5,364(s1) 8000277a: 01478a3b addw s4,a5,s4 8000277e: b7c5 j 8000275e <lottery_scheduler+0x48> chosenTicket = rand() % tot_tickets; 80002780: 00000097 auipc ra,0x0 80002784: f62080e7 jalr -158(ra) # 800026e2 <rand> 80002788: 03456a3b remw s4,a0,s4 counter = 0; 8000278c: 875a mv a4,s6 for (p = proc; p < &proc[NPROC]; p++) { 8000278e: 0000f497 auipc s1,0xf 80002792: b4248493 addi s1,s1,-1214 # 800112d0 <proc> 80002796: a029 j 800027a0 <lottery_scheduler+0x8a> 80002798: 18048493 addi s1,s1,384 8000279c: 03348563 beq s1,s3,800027c6 <lottery_scheduler+0xb0> if (p->state != RUNNABLE) continue; 800027a0: 4c9c lw a5,24(s1) 800027a2: ff279be3 bne a5,s2,80002798 <lottery_scheduler+0x82> ++counter; 800027a6: 2705 addiw a4,a4,1 if (counter != chosenTicket) continue; 800027a8: feea18e3 bne s4,a4,80002798 <lottery_scheduler+0x82> c->proc = p; 800027ac: 009ab023 sd s1,0(s5) p->state = RUNNING; 800027b0: 4791 li a5,4 800027b2: cc9c sw a5,24(s1) swtch(&c->lottery_scheduler,&p->context); 800027b4: 06048593 addi a1,s1,96 800027b8: 855e mv a0,s7 800027ba: 00000097 auipc ra,0x0 800027be: 120080e7 jalr 288(ra) # 800028da <swtch> //swtch(&c->context, &p->context); //kvminithart(); c->proc = 0; 800027c2: 000ab023 sd zero,0(s5) break; } release(&p->lock); 800027c6: 8526 mv a0,s1 800027c8: ffffe097 auipc ra,0xffffe 800027cc: 4d0080e7 jalr 1232(ra) # 80000c98 <release> asm volatile("csrr %0, sstatus" : "=r" (x) ); 800027d0: 100027f3 csrr a5,sstatus w_sstatus(r_sstatus() | SSTATUS_SIE); 800027d4: 0027e793 ori a5,a5,2 asm volatile("csrw sstatus, %0" : : "r" (x)); 800027d8: 10079073 csrw sstatus,a5 tot_tickets = 0; 800027dc: 8a5a mv s4,s6 for(p = proc; p < &proc[NPROC]; p++) { 800027de: 0000f497 auipc s1,0xf 800027e2: af248493 addi s1,s1,-1294 # 800112d0 <proc> 800027e6: b741 j 80002766 <lottery_scheduler+0x50> 00000000800027e8 <stride_scheduler>: // Stride Scheduler void stride_scheduler(void) { 800027e8: 711d addi sp,sp,-96 800027ea: ec86 sd ra,88(sp) 800027ec: e8a2 sd s0,80(sp) 800027ee: e4a6 sd s1,72(sp) 800027f0: e0ca sd s2,64(sp) 800027f2: fc4e sd s3,56(sp) 800027f4: f852 sd s4,48(sp) 800027f6: f456 sd s5,40(sp) 800027f8: f05a sd s6,32(sp) 800027fa: ec5e sd s7,24(sp) 800027fc: a422 fsd fs0,8(sp) 800027fe: a026 fsd fs1,0(sp) 80002800: 1080 addi s0,sp,96 asm volatile("mv %0, tp" : "=r" (x) ); 80002802: 8492 mv s1,tp int id = r_tp(); 80002804: 2481 sext.w s1,s1 struct proc *p; struct cpu *c = mycpu(); c->proc = 0; 80002806: 00015b17 auipc s6,0x15 8000280a: acab0b13 addi s6,s6,-1334 # 800172d0 <cpus> 8000280e: 16000913 li s2,352 80002812: 03248933 mul s2,s1,s2 80002816: 012b07b3 add a5,s6,s2 8000281a: 0007b023 sd zero,0(a5) # 26a000 <_entry-0x7fd96000> float min_stride; struct proc *min_proc = myproc(); 8000281e: fffff097 auipc ra,0xfffff 80002822: 198080e7 jalr 408(ra) # 800019b6 <myproc> 80002826: 8a2a mv s4,a0 //cprintf("Process %d's stride: %d\n", min_proc->pid, min_proc->stride); c->proc = min_proc; //switchuvm(min_proc); min_proc->state = RUNNING; swtch(&c->stride_scheduler, &min_proc->context); 80002828: 0f090913 addi s2,s2,240 8000282c: 9b4a add s6,s6,s2 min_stride = 1000000000; 8000282e: 00005797 auipc a5,0x5 80002832: 7da7a487 flw fs1,2010(a5) # 80008008 <etext+0x8> if (p->state != RUNNABLE) continue; 80002836: 498d li s3,3 for (p = proc; p < &proc[NPROC]; p++) { 80002838: 00015917 auipc s2,0x15 8000283c: a9890913 addi s2,s2,-1384 # 800172d0 <cpus> c->proc = min_proc; 80002840: 16000a93 li s5,352 80002844: 035484b3 mul s1,s1,s5 80002848: 00015a97 auipc s5,0x15 8000284c: a88a8a93 addi s5,s5,-1400 # 800172d0 <cpus> 80002850: 9aa6 add s5,s5,s1 min_proc->state = RUNNING; 80002852: 4b91 li s7,4 80002854: a0b5 j 800028c0 <stride_scheduler+0xd8> for (p = proc; p < &proc[NPROC]; p++) { 80002856: 18048493 addi s1,s1,384 8000285a: 03248563 beq s1,s2,80002884 <stride_scheduler+0x9c> acquire(&p->lock); 8000285e: 8526 mv a0,s1 80002860: ffffe097 auipc ra,0xffffe 80002864: 384080e7 jalr 900(ra) # 80000be4 <acquire> if (p->state != RUNNABLE) continue; 80002868: 4c9c lw a5,24(s1) 8000286a: ff3796e3 bne a5,s3,80002856 <stride_scheduler+0x6e> if (p->stride < min_stride) { 8000286e: 1744a783 lw a5,372(s1) 80002872: d007f7d3 fcvt.s.w fa5,a5 80002876: a08797d3 flt.s a5,fa5,fs0 8000287a: dff1 beqz a5,80002856 <stride_scheduler+0x6e> 8000287c: 8a26 mv s4,s1 min_stride = p->stride; 8000287e: 20f78453 fmv.s fs0,fa5 80002882: bfd1 j 80002856 <stride_scheduler+0x6e> min_proc->stride += min_proc->original_stride; 80002884: 174a2783 lw a5,372(s4) 80002888: 170a2703 lw a4,368(s4) 8000288c: 9fb9 addw a5,a5,a4 8000288e: 16fa2a23 sw a5,372(s4) ++min_proc->numRan; 80002892: 178a2783 lw a5,376(s4) 80002896: 2785 addiw a5,a5,1 80002898: 16fa2c23 sw a5,376(s4) c->proc = min_proc; 8000289c: 014ab023 sd s4,0(s5) min_proc->state = RUNNING; 800028a0: 017a2c23 sw s7,24(s4) swtch(&c->stride_scheduler, &min_proc->context); 800028a4: 060a0593 addi a1,s4,96 800028a8: 855a mv a0,s6 800028aa: 00000097 auipc ra,0x0 800028ae: 030080e7 jalr 48(ra) # 800028da <swtch> //swtch(&c->context, &p->context); //kvminithart(); // Process is done running now // It should have changed its p->state before coming back c->proc = 0; 800028b2: 000ab023 sd zero,0(s5) release(&p->lock); 800028b6: 854a mv a0,s2 800028b8: ffffe097 auipc ra,0xffffe 800028bc: 3e0080e7 jalr 992(ra) # 80000c98 <release> asm volatile("csrr %0, sstatus" : "=r" (x) ); 800028c0: 100027f3 csrr a5,sstatus w_sstatus(r_sstatus() | SSTATUS_SIE); 800028c4: 0027e793 ori a5,a5,2 asm volatile("csrw sstatus, %0" : : "r" (x)); 800028c8: 10079073 csrw sstatus,a5 min_stride = 1000000000; 800028cc: 20948453 fmv.s fs0,fs1 for (p = proc; p < &proc[NPROC]; p++) { 800028d0: 0000f497 auipc s1,0xf 800028d4: a0048493 addi s1,s1,-1536 # 800112d0 <proc> 800028d8: b759 j 8000285e <stride_scheduler+0x76> 00000000800028da <swtch>: 800028da: 00153023 sd ra,0(a0) 800028de: 00253423 sd sp,8(a0) 800028e2: e900 sd s0,16(a0) 800028e4: ed04 sd s1,24(a0) 800028e6: 03253023 sd s2,32(a0) 800028ea: 03353423 sd s3,40(a0) 800028ee: 03453823 sd s4,48(a0) 800028f2: 03553c23 sd s5,56(a0) 800028f6: 05653023 sd s6,64(a0) 800028fa: 05753423 sd s7,72(a0) 800028fe: 05853823 sd s8,80(a0) 80002902: 05953c23 sd s9,88(a0) 80002906: 07a53023 sd s10,96(a0) 8000290a: 07b53423 sd s11,104(a0) 8000290e: 0005b083 ld ra,0(a1) 80002912: 0085b103 ld sp,8(a1) 80002916: 6980 ld s0,16(a1) 80002918: 6d84 ld s1,24(a1) 8000291a: 0205b903 ld s2,32(a1) 8000291e: 0285b983 ld s3,40(a1) 80002922: 0305ba03 ld s4,48(a1) 80002926: 0385ba83 ld s5,56(a1) 8000292a: 0405bb03 ld s6,64(a1) 8000292e: 0485bb83 ld s7,72(a1) 80002932: 0505bc03 ld s8,80(a1) 80002936: 0585bc83 ld s9,88(a1) 8000293a: 0605bd03 ld s10,96(a1) 8000293e: 0685bd83 ld s11,104(a1) 80002942: 8082 ret 0000000080002944 <trapinit>: extern int devintr(); void trapinit(void) { 80002944: 1141 addi sp,sp,-16 80002946: e406 sd ra,8(sp) 80002948: e022 sd s0,0(sp) 8000294a: 0800 addi s0,sp,16 initlock(&tickslock, "time"); 8000294c: 00006597 auipc a1,0x6 80002950: a8458593 addi a1,a1,-1404 # 800083d0 <states.1732+0x30> 80002954: 00015517 auipc a0,0x15 80002958: 47c50513 addi a0,a0,1148 # 80017dd0 <tickslock> 8000295c: ffffe097 auipc ra,0xffffe 80002960: 1f8080e7 jalr 504(ra) # 80000b54 <initlock> } 80002964: 60a2 ld ra,8(sp) 80002966: 6402 ld s0,0(sp) 80002968: 0141 addi sp,sp,16 8000296a: 8082 ret 000000008000296c <trapinithart>: // set up to take exceptions and traps while in the kernel. void trapinithart(void) { 8000296c: 1141 addi sp,sp,-16 8000296e: e422 sd s0,8(sp) 80002970: 0800 addi s0,sp,16 asm volatile("csrw stvec, %0" : : "r" (x)); 80002972: 00003797 auipc a5,0x3 80002976: 52e78793 addi a5,a5,1326 # 80005ea0 <kernelvec> 8000297a: 10579073 csrw stvec,a5 w_stvec((uint64)kernelvec); } 8000297e: 6422 ld s0,8(sp) 80002980: 0141 addi sp,sp,16 80002982: 8082 ret 0000000080002984 <usertrapret>: // // return to user space // void usertrapret(void) { 80002984: 1141 addi sp,sp,-16 80002986: e406 sd ra,8(sp) 80002988: e022 sd s0,0(sp) 8000298a: 0800 addi s0,sp,16 struct proc *p = myproc(); 8000298c: fffff097 auipc ra,0xfffff 80002990: 02a080e7 jalr 42(ra) # 800019b6 <myproc> asm volatile("csrr %0, sstatus" : "=r" (x) ); 80002994: 100027f3 csrr a5,sstatus w_sstatus(r_sstatus() & ~SSTATUS_SIE); 80002998: 9bf5 andi a5,a5,-3 asm volatile("csrw sstatus, %0" : : "r" (x)); 8000299a: 10079073 csrw sstatus,a5 // kerneltrap() to usertrap(), so turn off interrupts until // we're back in user space, where usertrap() is correct. intr_off(); // send syscalls, interrupts, and exceptions to trampoline.S w_stvec(TRAMPOLINE + (uservec - trampoline)); 8000299e: 00004617 auipc a2,0x4 800029a2: 66260613 addi a2,a2,1634 # 80007000 <_trampoline> 800029a6: 00004697 auipc a3,0x4 800029aa: 65a68693 addi a3,a3,1626 # 80007000 <_trampoline> 800029ae: 8e91 sub a3,a3,a2 800029b0: 040007b7 lui a5,0x4000 800029b4: 17fd addi a5,a5,-1 800029b6: 07b2 slli a5,a5,0xc 800029b8: 96be add a3,a3,a5 asm volatile("csrw stvec, %0" : : "r" (x)); 800029ba: 10569073 csrw stvec,a3 // set up trapframe values that uservec will need when // the process next re-enters the kernel. p->trapframe->kernel_satp = r_satp(); // kernel page table 800029be: 6d38 ld a4,88(a0) asm volatile("csrr %0, satp" : "=r" (x) ); 800029c0: 180026f3 csrr a3,satp 800029c4: e314 sd a3,0(a4) p->trapframe->kernel_sp = p->kstack + PGSIZE; // process's kernel stack 800029c6: 6d38 ld a4,88(a0) 800029c8: 6134 ld a3,64(a0) 800029ca: 6585 lui a1,0x1 800029cc: 96ae add a3,a3,a1 800029ce: e714 sd a3,8(a4) p->trapframe->kernel_trap = (uint64)usertrap; 800029d0: 6d38 ld a4,88(a0) 800029d2: 00000697 auipc a3,0x0 800029d6: 13868693 addi a3,a3,312 # 80002b0a <usertrap> 800029da: eb14 sd a3,16(a4) p->trapframe->kernel_hartid = r_tp(); // hartid for cpuid() 800029dc: 6d38 ld a4,88(a0) asm volatile("mv %0, tp" : "=r" (x) ); 800029de: 8692 mv a3,tp 800029e0: f314 sd a3,32(a4) asm volatile("csrr %0, sstatus" : "=r" (x) ); 800029e2: 100026f3 csrr a3,sstatus // set up the registers that trampoline.S's sret will use // to get to user space. // set S Previous Privilege mode to User. unsigned long x = r_sstatus(); x &= ~SSTATUS_SPP; // clear SPP to 0 for user mode 800029e6: eff6f693 andi a3,a3,-257 x |= SSTATUS_SPIE; // enable interrupts in user mode 800029ea: 0206e693 ori a3,a3,32 asm volatile("csrw sstatus, %0" : : "r" (x)); 800029ee: 10069073 csrw sstatus,a3 w_sstatus(x); // set S Exception Program Counter to the saved user pc. w_sepc(p->trapframe->epc); 800029f2: 6d38 ld a4,88(a0) asm volatile("csrw sepc, %0" : : "r" (x)); 800029f4: 6f18 ld a4,24(a4) 800029f6: 14171073 csrw sepc,a4 // tell trampoline.S the user page table to switch to. uint64 satp = MAKE_SATP(p->pagetable); 800029fa: 692c ld a1,80(a0) 800029fc: 81b1 srli a1,a1,0xc // jump to trampoline.S at the top of memory, which // switches to the user page table, restores user registers, // and switches to user mode with sret. uint64 fn = TRAMPOLINE + (userret - trampoline); 800029fe: 00004717 auipc a4,0x4 80002a02: 69270713 addi a4,a4,1682 # 80007090 <userret> 80002a06: 8f11 sub a4,a4,a2 80002a08: 97ba add a5,a5,a4 ((void (*)(uint64,uint64))fn)(TRAPFRAME, satp); 80002a0a: 577d li a4,-1 80002a0c: 177e slli a4,a4,0x3f 80002a0e: 8dd9 or a1,a1,a4 80002a10: 02000537 lui a0,0x2000 80002a14: 157d addi a0,a0,-1 80002a16: 0536 slli a0,a0,0xd 80002a18: 9782 jalr a5 } 80002a1a: 60a2 ld ra,8(sp) 80002a1c: 6402 ld s0,0(sp) 80002a1e: 0141 addi sp,sp,16 80002a20: 8082 ret 0000000080002a22 <clockintr>: w_sstatus(sstatus); } void clockintr() { 80002a22: 1101 addi sp,sp,-32 80002a24: ec06 sd ra,24(sp) 80002a26: e822 sd s0,16(sp) 80002a28: e426 sd s1,8(sp) 80002a2a: 1000 addi s0,sp,32 acquire(&tickslock); 80002a2c: 00015497 auipc s1,0x15 80002a30: 3a448493 addi s1,s1,932 # 80017dd0 <tickslock> 80002a34: 8526 mv a0,s1 80002a36: ffffe097 auipc ra,0xffffe 80002a3a: 1ae080e7 jalr 430(ra) # 80000be4 <acquire> ticks++; 80002a3e: 00006517 auipc a0,0x6 80002a42: 5fa50513 addi a0,a0,1530 # 80009038 <ticks> 80002a46: 411c lw a5,0(a0) 80002a48: 2785 addiw a5,a5,1 80002a4a: c11c sw a5,0(a0) wakeup(&ticks); 80002a4c: fffff097 auipc ra,0xfffff 80002a50: 7ba080e7 jalr 1978(ra) # 80002206 <wakeup> release(&tickslock); 80002a54: 8526 mv a0,s1 80002a56: ffffe097 auipc ra,0xffffe 80002a5a: 242080e7 jalr 578(ra) # 80000c98 <release> } 80002a5e: 60e2 ld ra,24(sp) 80002a60: 6442 ld s0,16(sp) 80002a62: 64a2 ld s1,8(sp) 80002a64: 6105 addi sp,sp,32 80002a66: 8082 ret 0000000080002a68 <devintr>: // returns 2 if timer interrupt, // 1 if other device, // 0 if not recognized. int devintr() { 80002a68: 1101 addi sp,sp,-32 80002a6a: ec06 sd ra,24(sp) 80002a6c: e822 sd s0,16(sp) 80002a6e: e426 sd s1,8(sp) 80002a70: 1000 addi s0,sp,32 asm volatile("csrr %0, scause" : "=r" (x) ); 80002a72: 14202773 csrr a4,scause uint64 scause = r_scause(); if((scause & 0x8000000000000000L) && 80002a76: 00074d63 bltz a4,80002a90 <devintr+0x28> // now allowed to interrupt again. if(irq) plic_complete(irq); return 1; } else if(scause == 0x8000000000000001L){ 80002a7a: 57fd li a5,-1 80002a7c: 17fe slli a5,a5,0x3f 80002a7e: 0785 addi a5,a5,1 // the SSIP bit in sip. w_sip(r_sip() & ~2); return 2; } else { return 0; 80002a80: 4501 li a0,0 } else if(scause == 0x8000000000000001L){ 80002a82: 06f70363 beq a4,a5,80002ae8 <devintr+0x80> } } 80002a86: 60e2 ld ra,24(sp) 80002a88: 6442 ld s0,16(sp) 80002a8a: 64a2 ld s1,8(sp) 80002a8c: 6105 addi sp,sp,32 80002a8e: 8082 ret (scause & 0xff) == 9){ 80002a90: 0ff77793 andi a5,a4,255 if((scause & 0x8000000000000000L) && 80002a94: 46a5 li a3,9 80002a96: fed792e3 bne a5,a3,80002a7a <devintr+0x12> int irq = plic_claim(); 80002a9a: 00003097 auipc ra,0x3 80002a9e: 50e080e7 jalr 1294(ra) # 80005fa8 <plic_claim> 80002aa2: 84aa mv s1,a0 if(irq == UART0_IRQ){ 80002aa4: 47a9 li a5,10 80002aa6: 02f50763 beq a0,a5,80002ad4 <devintr+0x6c> } else if(irq == VIRTIO0_IRQ){ 80002aaa: 4785 li a5,1 80002aac: 02f50963 beq a0,a5,80002ade <devintr+0x76> return 1; 80002ab0: 4505 li a0,1 } else if(irq){ 80002ab2: d8f1 beqz s1,80002a86 <devintr+0x1e> printf("unexpected interrupt irq=%d\n", irq); 80002ab4: 85a6 mv a1,s1 80002ab6: 00006517 auipc a0,0x6 80002aba: 92250513 addi a0,a0,-1758 # 800083d8 <states.1732+0x38> 80002abe: ffffe097 auipc ra,0xffffe 80002ac2: aca080e7 jalr -1334(ra) # 80000588 <printf> plic_complete(irq); 80002ac6: 8526 mv a0,s1 80002ac8: 00003097 auipc ra,0x3 80002acc: 504080e7 jalr 1284(ra) # 80005fcc <plic_complete> return 1; 80002ad0: 4505 li a0,1 80002ad2: bf55 j 80002a86 <devintr+0x1e> uartintr(); 80002ad4: ffffe097 auipc ra,0xffffe 80002ad8: ed4080e7 jalr -300(ra) # 800009a8 <uartintr> 80002adc: b7ed j 80002ac6 <devintr+0x5e> virtio_disk_intr(); 80002ade: 00004097 auipc ra,0x4 80002ae2: 9ce080e7 jalr -1586(ra) # 800064ac <virtio_disk_intr> 80002ae6: b7c5 j 80002ac6 <devintr+0x5e> if(cpuid() == 0){ 80002ae8: fffff097 auipc ra,0xfffff 80002aec: e9c080e7 jalr -356(ra) # 80001984 <cpuid> 80002af0: c901 beqz a0,80002b00 <devintr+0x98> asm volatile("csrr %0, sip" : "=r" (x) ); 80002af2: 144027f3 csrr a5,sip w_sip(r_sip() & ~2); 80002af6: 9bf5 andi a5,a5,-3 asm volatile("csrw sip, %0" : : "r" (x)); 80002af8: 14479073 csrw sip,a5 return 2; 80002afc: 4509 li a0,2 80002afe: b761 j 80002a86 <devintr+0x1e> clockintr(); 80002b00: 00000097 auipc ra,0x0 80002b04: f22080e7 jalr -222(ra) # 80002a22 <clockintr> 80002b08: b7ed j 80002af2 <devintr+0x8a> 0000000080002b0a <usertrap>: { 80002b0a: 1101 addi sp,sp,-32 80002b0c: ec06 sd ra,24(sp) 80002b0e: e822 sd s0,16(sp) 80002b10: e426 sd s1,8(sp) 80002b12: e04a sd s2,0(sp) 80002b14: 1000 addi s0,sp,32 asm volatile("csrr %0, sstatus" : "=r" (x) ); 80002b16: 100027f3 csrr a5,sstatus if((r_sstatus() & SSTATUS_SPP) != 0) 80002b1a: 1007f793 andi a5,a5,256 80002b1e: e3ad bnez a5,80002b80 <usertrap+0x76> asm volatile("csrw stvec, %0" : : "r" (x)); 80002b20: 00003797 auipc a5,0x3 80002b24: 38078793 addi a5,a5,896 # 80005ea0 <kernelvec> 80002b28: 10579073 csrw stvec,a5 struct proc *p = myproc(); 80002b2c: fffff097 auipc ra,0xfffff 80002b30: e8a080e7 jalr -374(ra) # 800019b6 <myproc> 80002b34: 84aa mv s1,a0 p->trapframe->epc = r_sepc(); 80002b36: 6d3c ld a5,88(a0) asm volatile("csrr %0, sepc" : "=r" (x) ); 80002b38: 14102773 csrr a4,sepc 80002b3c: ef98 sd a4,24(a5) asm volatile("csrr %0, scause" : "=r" (x) ); 80002b3e: 14202773 csrr a4,scause if(r_scause() == 8){ 80002b42: 47a1 li a5,8 80002b44: 04f71c63 bne a4,a5,80002b9c <usertrap+0x92> if(p->killed) 80002b48: 551c lw a5,40(a0) 80002b4a: e3b9 bnez a5,80002b90 <usertrap+0x86> p->trapframe->epc += 4; 80002b4c: 6cb8 ld a4,88(s1) 80002b4e: 6f1c ld a5,24(a4) 80002b50: 0791 addi a5,a5,4 80002b52: ef1c sd a5,24(a4) asm volatile("csrr %0, sstatus" : "=r" (x) ); 80002b54: 100027f3 csrr a5,sstatus w_sstatus(r_sstatus() | SSTATUS_SIE); 80002b58: 0027e793 ori a5,a5,2 asm volatile("csrw sstatus, %0" : : "r" (x)); 80002b5c: 10079073 csrw sstatus,a5 syscall(); 80002b60: 00000097 auipc ra,0x0 80002b64: 2e0080e7 jalr 736(ra) # 80002e40 <syscall> if(p->killed) 80002b68: 549c lw a5,40(s1) 80002b6a: ebc1 bnez a5,80002bfa <usertrap+0xf0> usertrapret(); 80002b6c: 00000097 auipc ra,0x0 80002b70: e18080e7 jalr -488(ra) # 80002984 <usertrapret> } 80002b74: 60e2 ld ra,24(sp) 80002b76: 6442 ld s0,16(sp) 80002b78: 64a2 ld s1,8(sp) 80002b7a: 6902 ld s2,0(sp) 80002b7c: 6105 addi sp,sp,32 80002b7e: 8082 ret panic("usertrap: not from user mode"); 80002b80: 00006517 auipc a0,0x6 80002b84: 87850513 addi a0,a0,-1928 # 800083f8 <states.1732+0x58> 80002b88: ffffe097 auipc ra,0xffffe 80002b8c: 9b6080e7 jalr -1610(ra) # 8000053e <panic> exit(-1); 80002b90: 557d li a0,-1 80002b92: fffff097 auipc ra,0xfffff 80002b96: 744080e7 jalr 1860(ra) # 800022d6 <exit> 80002b9a: bf4d j 80002b4c <usertrap+0x42> } else if((which_dev = devintr()) != 0){ 80002b9c: 00000097 auipc ra,0x0 80002ba0: ecc080e7 jalr -308(ra) # 80002a68 <devintr> 80002ba4: 892a mv s2,a0 80002ba6: c501 beqz a0,80002bae <usertrap+0xa4> if(p->killed) 80002ba8: 549c lw a5,40(s1) 80002baa: c3a1 beqz a5,80002bea <usertrap+0xe0> 80002bac: a815 j 80002be0 <usertrap+0xd6> asm volatile("csrr %0, scause" : "=r" (x) ); 80002bae: 142025f3 csrr a1,scause printf("usertrap(): unexpected scause %p pid=%d\n", r_scause(), p->pid); 80002bb2: 5890 lw a2,48(s1) 80002bb4: 00006517 auipc a0,0x6 80002bb8: 86450513 addi a0,a0,-1948 # 80008418 <states.1732+0x78> 80002bbc: ffffe097 auipc ra,0xffffe 80002bc0: 9cc080e7 jalr -1588(ra) # 80000588 <printf> asm volatile("csrr %0, sepc" : "=r" (x) ); 80002bc4: 141025f3 csrr a1,sepc asm volatile("csrr %0, stval" : "=r" (x) ); 80002bc8: 14302673 csrr a2,stval printf(" sepc=%p stval=%p\n", r_sepc(), r_stval()); 80002bcc: 00006517 auipc a0,0x6 80002bd0: 87c50513 addi a0,a0,-1924 # 80008448 <states.1732+0xa8> 80002bd4: ffffe097 auipc ra,0xffffe 80002bd8: 9b4080e7 jalr -1612(ra) # 80000588 <printf> p->killed = 1; 80002bdc: 4785 li a5,1 80002bde: d49c sw a5,40(s1) exit(-1); 80002be0: 557d li a0,-1 80002be2: fffff097 auipc ra,0xfffff 80002be6: 6f4080e7 jalr 1780(ra) # 800022d6 <exit> if(which_dev == 2) 80002bea: 4789 li a5,2 80002bec: f8f910e3 bne s2,a5,80002b6c <usertrap+0x62> yield(); 80002bf0: fffff097 auipc ra,0xfffff 80002bf4: 44e080e7 jalr 1102(ra) # 8000203e <yield> 80002bf8: bf95 j 80002b6c <usertrap+0x62> int which_dev = 0; 80002bfa: 4901 li s2,0 80002bfc: b7d5 j 80002be0 <usertrap+0xd6> 0000000080002bfe <kerneltrap>: { 80002bfe: 7179 addi sp,sp,-48 80002c00: f406 sd ra,40(sp) 80002c02: f022 sd s0,32(sp) 80002c04: ec26 sd s1,24(sp) 80002c06: e84a sd s2,16(sp) 80002c08: e44e sd s3,8(sp) 80002c0a: 1800 addi s0,sp,48 asm volatile("csrr %0, sepc" : "=r" (x) ); 80002c0c: 14102973 csrr s2,sepc asm volatile("csrr %0, sstatus" : "=r" (x) ); 80002c10: 100024f3 csrr s1,sstatus asm volatile("csrr %0, scause" : "=r" (x) ); 80002c14: 142029f3 csrr s3,scause if((sstatus & SSTATUS_SPP) == 0) 80002c18: 1004f793 andi a5,s1,256 80002c1c: cb85 beqz a5,80002c4c <kerneltrap+0x4e> asm volatile("csrr %0, sstatus" : "=r" (x) ); 80002c1e: 100027f3 csrr a5,sstatus return (x & SSTATUS_SIE) != 0; 80002c22: 8b89 andi a5,a5,2 if(intr_get() != 0) 80002c24: ef85 bnez a5,80002c5c <kerneltrap+0x5e> if((which_dev = devintr()) == 0){ 80002c26: 00000097 auipc ra,0x0 80002c2a: e42080e7 jalr -446(ra) # 80002a68 <devintr> 80002c2e: cd1d beqz a0,80002c6c <kerneltrap+0x6e> if(which_dev == 2 && myproc() != 0 && myproc()->state == RUNNING) 80002c30: 4789 li a5,2 80002c32: 06f50a63 beq a0,a5,80002ca6 <kerneltrap+0xa8> asm volatile("csrw sepc, %0" : : "r" (x)); 80002c36: 14191073 csrw sepc,s2 asm volatile("csrw sstatus, %0" : : "r" (x)); 80002c3a: 10049073 csrw sstatus,s1 } 80002c3e: 70a2 ld ra,40(sp) 80002c40: 7402 ld s0,32(sp) 80002c42: 64e2 ld s1,24(sp) 80002c44: 6942 ld s2,16(sp) 80002c46: 69a2 ld s3,8(sp) 80002c48: 6145 addi sp,sp,48 80002c4a: 8082 ret panic("kerneltrap: not from supervisor mode"); 80002c4c: 00006517 auipc a0,0x6 80002c50: 81c50513 addi a0,a0,-2020 # 80008468 <states.1732+0xc8> 80002c54: ffffe097 auipc ra,0xffffe 80002c58: 8ea080e7 jalr -1814(ra) # 8000053e <panic> panic("kerneltrap: interrupts enabled"); 80002c5c: 00006517 auipc a0,0x6 80002c60: 83450513 addi a0,a0,-1996 # 80008490 <states.1732+0xf0> 80002c64: ffffe097 auipc ra,0xffffe 80002c68: 8da080e7 jalr -1830(ra) # 8000053e <panic> printf("scause %p\n", scause); 80002c6c: 85ce mv a1,s3 80002c6e: 00006517 auipc a0,0x6 80002c72: 84250513 addi a0,a0,-1982 # 800084b0 <states.1732+0x110> 80002c76: ffffe097 auipc ra,0xffffe 80002c7a: 912080e7 jalr -1774(ra) # 80000588 <printf> asm volatile("csrr %0, sepc" : "=r" (x) ); 80002c7e: 141025f3 csrr a1,sepc asm volatile("csrr %0, stval" : "=r" (x) ); 80002c82: 14302673 csrr a2,stval printf("sepc=%p stval=%p\n", r_sepc(), r_stval()); 80002c86: 00006517 auipc a0,0x6 80002c8a: 83a50513 addi a0,a0,-1990 # 800084c0 <states.1732+0x120> 80002c8e: ffffe097 auipc ra,0xffffe 80002c92: 8fa080e7 jalr -1798(ra) # 80000588 <printf> panic("kerneltrap"); 80002c96: 00006517 auipc a0,0x6 80002c9a: 84250513 addi a0,a0,-1982 # 800084d8 <states.1732+0x138> 80002c9e: ffffe097 auipc ra,0xffffe 80002ca2: 8a0080e7 jalr -1888(ra) # 8000053e <panic> if(which_dev == 2 && myproc() != 0 && myproc()->state == RUNNING) 80002ca6: fffff097 auipc ra,0xfffff 80002caa: d10080e7 jalr -752(ra) # 800019b6 <myproc> 80002cae: d541 beqz a0,80002c36 <kerneltrap+0x38> 80002cb0: fffff097 auipc ra,0xfffff 80002cb4: d06080e7 jalr -762(ra) # 800019b6 <myproc> 80002cb8: 4d18 lw a4,24(a0) 80002cba: 4791 li a5,4 80002cbc: f6f71de3 bne a4,a5,80002c36 <kerneltrap+0x38> yield(); 80002cc0: fffff097 auipc ra,0xfffff 80002cc4: 37e080e7 jalr 894(ra) # 8000203e <yield> 80002cc8: b7bd j 80002c36 <kerneltrap+0x38> 0000000080002cca <argraw>: return strlen(buf); } static uint64 argraw(int n) { 80002cca: 1101 addi sp,sp,-32 80002ccc: ec06 sd ra,24(sp) 80002cce: e822 sd s0,16(sp) 80002cd0: e426 sd s1,8(sp) 80002cd2: 1000 addi s0,sp,32 80002cd4: 84aa mv s1,a0 struct proc *p = myproc(); 80002cd6: fffff097 auipc ra,0xfffff 80002cda: ce0080e7 jalr -800(ra) # 800019b6 <myproc> switch (n) { 80002cde: 4795 li a5,5 80002ce0: 0497e163 bltu a5,s1,80002d22 <argraw+0x58> 80002ce4: 048a slli s1,s1,0x2 80002ce6: 00006717 auipc a4,0x6 80002cea: 82a70713 addi a4,a4,-2006 # 80008510 <states.1732+0x170> 80002cee: 94ba add s1,s1,a4 80002cf0: 409c lw a5,0(s1) 80002cf2: 97ba add a5,a5,a4 80002cf4: 8782 jr a5 case 0: return p->trapframe->a0; 80002cf6: 6d3c ld a5,88(a0) 80002cf8: 7ba8 ld a0,112(a5) case 5: return p->trapframe->a5; } panic("argraw"); return -1; } 80002cfa: 60e2 ld ra,24(sp) 80002cfc: 6442 ld s0,16(sp) 80002cfe: 64a2 ld s1,8(sp) 80002d00: 6105 addi sp,sp,32 80002d02: 8082 ret return p->trapframe->a1; 80002d04: 6d3c ld a5,88(a0) 80002d06: 7fa8 ld a0,120(a5) 80002d08: bfcd j 80002cfa <argraw+0x30> return p->trapframe->a2; 80002d0a: 6d3c ld a5,88(a0) 80002d0c: 63c8 ld a0,128(a5) 80002d0e: b7f5 j 80002cfa <argraw+0x30> return p->trapframe->a3; 80002d10: 6d3c ld a5,88(a0) 80002d12: 67c8 ld a0,136(a5) 80002d14: b7dd j 80002cfa <argraw+0x30> return p->trapframe->a4; 80002d16: 6d3c ld a5,88(a0) 80002d18: 6bc8 ld a0,144(a5) 80002d1a: b7c5 j 80002cfa <argraw+0x30> return p->trapframe->a5; 80002d1c: 6d3c ld a5,88(a0) 80002d1e: 6fc8 ld a0,152(a5) 80002d20: bfe9 j 80002cfa <argraw+0x30> panic("argraw"); 80002d22: 00005517 auipc a0,0x5 80002d26: 7c650513 addi a0,a0,1990 # 800084e8 <states.1732+0x148> 80002d2a: ffffe097 auipc ra,0xffffe 80002d2e: 814080e7 jalr -2028(ra) # 8000053e <panic> 0000000080002d32 <fetchaddr>: { 80002d32: 1101 addi sp,sp,-32 80002d34: ec06 sd ra,24(sp) 80002d36: e822 sd s0,16(sp) 80002d38: e426 sd s1,8(sp) 80002d3a: e04a sd s2,0(sp) 80002d3c: 1000 addi s0,sp,32 80002d3e: 84aa mv s1,a0 80002d40: 892e mv s2,a1 struct proc *p = myproc(); 80002d42: fffff097 auipc ra,0xfffff 80002d46: c74080e7 jalr -908(ra) # 800019b6 <myproc> if(addr >= p->sz || addr+sizeof(uint64) > p->sz) 80002d4a: 653c ld a5,72(a0) 80002d4c: 02f4f863 bgeu s1,a5,80002d7c <fetchaddr+0x4a> 80002d50: 00848713 addi a4,s1,8 80002d54: 02e7e663 bltu a5,a4,80002d80 <fetchaddr+0x4e> if(copyin(p->pagetable, (char *)ip, addr, sizeof(*ip)) != 0) 80002d58: 46a1 li a3,8 80002d5a: 8626 mv a2,s1 80002d5c: 85ca mv a1,s2 80002d5e: 6928 ld a0,80(a0) 80002d60: fffff097 auipc ra,0xfffff 80002d64: 99e080e7 jalr -1634(ra) # 800016fe <copyin> 80002d68: 00a03533 snez a0,a0 80002d6c: 40a00533 neg a0,a0 } 80002d70: 60e2 ld ra,24(sp) 80002d72: 6442 ld s0,16(sp) 80002d74: 64a2 ld s1,8(sp) 80002d76: 6902 ld s2,0(sp) 80002d78: 6105 addi sp,sp,32 80002d7a: 8082 ret return -1; 80002d7c: 557d li a0,-1 80002d7e: bfcd j 80002d70 <fetchaddr+0x3e> 80002d80: 557d li a0,-1 80002d82: b7fd j 80002d70 <fetchaddr+0x3e> 0000000080002d84 <fetchstr>: { 80002d84: 7179 addi sp,sp,-48 80002d86: f406 sd ra,40(sp) 80002d88: f022 sd s0,32(sp) 80002d8a: ec26 sd s1,24(sp) 80002d8c: e84a sd s2,16(sp) 80002d8e: e44e sd s3,8(sp) 80002d90: 1800 addi s0,sp,48 80002d92: 892a mv s2,a0 80002d94: 84ae mv s1,a1 80002d96: 89b2 mv s3,a2 struct proc *p = myproc(); 80002d98: fffff097 auipc ra,0xfffff 80002d9c: c1e080e7 jalr -994(ra) # 800019b6 <myproc> int err = copyinstr(p->pagetable, buf, addr, max); 80002da0: 86ce mv a3,s3 80002da2: 864a mv a2,s2 80002da4: 85a6 mv a1,s1 80002da6: 6928 ld a0,80(a0) 80002da8: fffff097 auipc ra,0xfffff 80002dac: 9e2080e7 jalr -1566(ra) # 8000178a <copyinstr> if(err < 0) 80002db0: 00054763 bltz a0,80002dbe <fetchstr+0x3a> return strlen(buf); 80002db4: 8526 mv a0,s1 80002db6: ffffe097 auipc ra,0xffffe 80002dba: 0ae080e7 jalr 174(ra) # 80000e64 <strlen> } 80002dbe: 70a2 ld ra,40(sp) 80002dc0: 7402 ld s0,32(sp) 80002dc2: 64e2 ld s1,24(sp) 80002dc4: 6942 ld s2,16(sp) 80002dc6: 69a2 ld s3,8(sp) 80002dc8: 6145 addi sp,sp,48 80002dca: 8082 ret 0000000080002dcc <argint>: // Fetch the nth 32-bit system call argument. int argint(int n, int *ip) { 80002dcc: 1101 addi sp,sp,-32 80002dce: ec06 sd ra,24(sp) 80002dd0: e822 sd s0,16(sp) 80002dd2: e426 sd s1,8(sp) 80002dd4: 1000 addi s0,sp,32 80002dd6: 84ae mv s1,a1 *ip = argraw(n); 80002dd8: 00000097 auipc ra,0x0 80002ddc: ef2080e7 jalr -270(ra) # 80002cca <argraw> 80002de0: c088 sw a0,0(s1) return 0; } 80002de2: 4501 li a0,0 80002de4: 60e2 ld ra,24(sp) 80002de6: 6442 ld s0,16(sp) 80002de8: 64a2 ld s1,8(sp) 80002dea: 6105 addi sp,sp,32 80002dec: 8082 ret 0000000080002dee <argaddr>: // Retrieve an argument as a pointer. // Doesn't check for legality, since // copyin/copyout will do that. int argaddr(int n, uint64 *ip) { 80002dee: 1101 addi sp,sp,-32 80002df0: ec06 sd ra,24(sp) 80002df2: e822 sd s0,16(sp) 80002df4: e426 sd s1,8(sp) 80002df6: 1000 addi s0,sp,32 80002df8: 84ae mv s1,a1 *ip = argraw(n); 80002dfa: 00000097 auipc ra,0x0 80002dfe: ed0080e7 jalr -304(ra) # 80002cca <argraw> 80002e02: e088 sd a0,0(s1) return 0; } 80002e04: 4501 li a0,0 80002e06: 60e2 ld ra,24(sp) 80002e08: 6442 ld s0,16(sp) 80002e0a: 64a2 ld s1,8(sp) 80002e0c: 6105 addi sp,sp,32 80002e0e: 8082 ret 0000000080002e10 <argstr>: // Fetch the nth word-sized system call argument as a null-terminated string. // Copies into buf, at most max. // Returns string length if OK (including nul), -1 if error. int argstr(int n, char *buf, int max) { 80002e10: 1101 addi sp,sp,-32 80002e12: ec06 sd ra,24(sp) 80002e14: e822 sd s0,16(sp) 80002e16: e426 sd s1,8(sp) 80002e18: e04a sd s2,0(sp) 80002e1a: 1000 addi s0,sp,32 80002e1c: 84ae mv s1,a1 80002e1e: 8932 mv s2,a2 *ip = argraw(n); 80002e20: 00000097 auipc ra,0x0 80002e24: eaa080e7 jalr -342(ra) # 80002cca <argraw> uint64 addr; if(argaddr(n, &addr) < 0) return -1; return fetchstr(addr, buf, max); 80002e28: 864a mv a2,s2 80002e2a: 85a6 mv a1,s1 80002e2c: 00000097 auipc ra,0x0 80002e30: f58080e7 jalr -168(ra) # 80002d84 <fetchstr> } 80002e34: 60e2 ld ra,24(sp) 80002e36: 6442 ld s0,16(sp) 80002e38: 64a2 ld s1,8(sp) 80002e3a: 6902 ld s2,0(sp) 80002e3c: 6105 addi sp,sp,32 80002e3e: 8082 ret 0000000080002e40 <syscall>: [SYS_hello] sys_hello, //hello: syscall entry }; void syscall(void) { 80002e40: 1101 addi sp,sp,-32 80002e42: ec06 sd ra,24(sp) 80002e44: e822 sd s0,16(sp) 80002e46: e426 sd s1,8(sp) 80002e48: e04a sd s2,0(sp) 80002e4a: 1000 addi s0,sp,32 int num; struct proc *p = myproc(); 80002e4c: fffff097 auipc ra,0xfffff 80002e50: b6a080e7 jalr -1174(ra) # 800019b6 <myproc> 80002e54: 84aa mv s1,a0 num = p->trapframe->a7; 80002e56: 05853903 ld s2,88(a0) 80002e5a: 0a893783 ld a5,168(s2) 80002e5e: 0007869b sext.w a3,a5 if(num > 0 && num < NELEM(syscalls) && syscalls[num]) { 80002e62: 37fd addiw a5,a5,-1 80002e64: 4761 li a4,24 80002e66: 02f76463 bltu a4,a5,80002e8e <syscall+0x4e> 80002e6a: 00369713 slli a4,a3,0x3 80002e6e: 00005797 auipc a5,0x5 80002e72: 6ba78793 addi a5,a5,1722 # 80008528 <syscalls> 80002e76: 97ba add a5,a5,a4 80002e78: 6398 ld a4,0(a5) 80002e7a: cb11 beqz a4,80002e8e <syscall+0x4e> p->syscallCounter++; // lab1: We have called the counter named as syscallCounter 80002e7c: 16852783 lw a5,360(a0) 80002e80: 2785 addiw a5,a5,1 80002e82: 16f52423 sw a5,360(a0) p->trapframe->a0 = syscalls[num](); 80002e86: 9702 jalr a4 80002e88: 06a93823 sd a0,112(s2) 80002e8c: a839 j 80002eaa <syscall+0x6a> } else { printf("%d %s: unknown sys call %d\n", 80002e8e: 15848613 addi a2,s1,344 80002e92: 588c lw a1,48(s1) 80002e94: 00005517 auipc a0,0x5 80002e98: 65c50513 addi a0,a0,1628 # 800084f0 <states.1732+0x150> 80002e9c: ffffd097 auipc ra,0xffffd 80002ea0: 6ec080e7 jalr 1772(ra) # 80000588 <printf> p->pid, p->name, num); p->trapframe->a0 = -1; 80002ea4: 6cbc ld a5,88(s1) 80002ea6: 577d li a4,-1 80002ea8: fbb8 sd a4,112(a5) } } 80002eaa: 60e2 ld ra,24(sp) 80002eac: 6442 ld s0,16(sp) 80002eae: 64a2 ld s1,8(sp) 80002eb0: 6902 ld s2,0(sp) 80002eb2: 6105 addi sp,sp,32 80002eb4: 8082 ret 0000000080002eb6 <sys_exit>: #include "spinlock.h" #include "proc.h" uint64 sys_exit(void) { 80002eb6: 1101 addi sp,sp,-32 80002eb8: ec06 sd ra,24(sp) 80002eba: e822 sd s0,16(sp) 80002ebc: 1000 addi s0,sp,32 int n; if(argint(0, &n) < 0) 80002ebe: fec40593 addi a1,s0,-20 80002ec2: 4501 li a0,0 80002ec4: 00000097 auipc ra,0x0 80002ec8: f08080e7 jalr -248(ra) # 80002dcc <argint> return -1; 80002ecc: 57fd li a5,-1 if(argint(0, &n) < 0) 80002ece: 00054963 bltz a0,80002ee0 <sys_exit+0x2a> exit(n); 80002ed2: fec42503 lw a0,-20(s0) 80002ed6: fffff097 auipc ra,0xfffff 80002eda: 400080e7 jalr 1024(ra) # 800022d6 <exit> return 0; // not reached 80002ede: 4781 li a5,0 } 80002ee0: 853e mv a0,a5 80002ee2: 60e2 ld ra,24(sp) 80002ee4: 6442 ld s0,16(sp) 80002ee6: 6105 addi sp,sp,32 80002ee8: 8082 ret 0000000080002eea <sys_getpid>: uint64 sys_getpid(void) { 80002eea: 1141 addi sp,sp,-16 80002eec: e406 sd ra,8(sp) 80002eee: e022 sd s0,0(sp) 80002ef0: 0800 addi s0,sp,16 return myproc()->pid; 80002ef2: fffff097 auipc ra,0xfffff 80002ef6: ac4080e7 jalr -1340(ra) # 800019b6 <myproc> } 80002efa: 5908 lw a0,48(a0) 80002efc: 60a2 ld ra,8(sp) 80002efe: 6402 ld s0,0(sp) 80002f00: 0141 addi sp,sp,16 80002f02: 8082 ret 0000000080002f04 <sys_fork>: uint64 sys_fork(void) { 80002f04: 1141 addi sp,sp,-16 80002f06: e406 sd ra,8(sp) 80002f08: e022 sd s0,0(sp) 80002f0a: 0800 addi s0,sp,16 return fork(); 80002f0c: fffff097 auipc ra,0xfffff 80002f10: e7e080e7 jalr -386(ra) # 80001d8a <fork> } 80002f14: 60a2 ld ra,8(sp) 80002f16: 6402 ld s0,0(sp) 80002f18: 0141 addi sp,sp,16 80002f1a: 8082 ret 0000000080002f1c <sys_wait>: uint64 sys_wait(void) { 80002f1c: 1101 addi sp,sp,-32 80002f1e: ec06 sd ra,24(sp) 80002f20: e822 sd s0,16(sp) 80002f22: 1000 addi s0,sp,32 uint64 p; if(argaddr(0, &p) < 0) 80002f24: fe840593 addi a1,s0,-24 80002f28: 4501 li a0,0 80002f2a: 00000097 auipc ra,0x0 80002f2e: ec4080e7 jalr -316(ra) # 80002dee <argaddr> 80002f32: 87aa mv a5,a0 return -1; 80002f34: 557d li a0,-1 if(argaddr(0, &p) < 0) 80002f36: 0007c863 bltz a5,80002f46 <sys_wait+0x2a> return wait(p); 80002f3a: fe843503 ld a0,-24(s0) 80002f3e: fffff097 auipc ra,0xfffff 80002f42: 1a0080e7 jalr 416(ra) # 800020de <wait> } 80002f46: 60e2 ld ra,24(sp) 80002f48: 6442 ld s0,16(sp) 80002f4a: 6105 addi sp,sp,32 80002f4c: 8082 ret 0000000080002f4e <sys_sbrk>: uint64 sys_sbrk(void) { 80002f4e: 7179 addi sp,sp,-48 80002f50: f406 sd ra,40(sp) 80002f52: f022 sd s0,32(sp) 80002f54: ec26 sd s1,24(sp) 80002f56: 1800 addi s0,sp,48 int addr; int n; if(argint(0, &n) < 0) 80002f58: fdc40593 addi a1,s0,-36 80002f5c: 4501 li a0,0 80002f5e: 00000097 auipc ra,0x0 80002f62: e6e080e7 jalr -402(ra) # 80002dcc <argint> 80002f66: 87aa mv a5,a0 return -1; 80002f68: 557d li a0,-1 if(argint(0, &n) < 0) 80002f6a: 0207c063 bltz a5,80002f8a <sys_sbrk+0x3c> addr = myproc()->sz; 80002f6e: fffff097 auipc ra,0xfffff 80002f72: a48080e7 jalr -1464(ra) # 800019b6 <myproc> 80002f76: 4524 lw s1,72(a0) if(growproc(n) < 0) 80002f78: fdc42503 lw a0,-36(s0) 80002f7c: fffff097 auipc ra,0xfffff 80002f80: d9a080e7 jalr -614(ra) # 80001d16 <growproc> 80002f84: 00054863 bltz a0,80002f94 <sys_sbrk+0x46> return -1; return addr; 80002f88: 8526 mv a0,s1 } 80002f8a: 70a2 ld ra,40(sp) 80002f8c: 7402 ld s0,32(sp) 80002f8e: 64e2 ld s1,24(sp) 80002f90: 6145 addi sp,sp,48 80002f92: 8082 ret return -1; 80002f94: 557d li a0,-1 80002f96: bfd5 j 80002f8a <sys_sbrk+0x3c> 0000000080002f98 <sys_sleep>: uint64 sys_sleep(void) { 80002f98: 7139 addi sp,sp,-64 80002f9a: fc06 sd ra,56(sp) 80002f9c: f822 sd s0,48(sp) 80002f9e: f426 sd s1,40(sp) 80002fa0: f04a sd s2,32(sp) 80002fa2: ec4e sd s3,24(sp) 80002fa4: 0080 addi s0,sp,64 int n; uint ticks0; if(argint(0, &n) < 0) 80002fa6: fcc40593 addi a1,s0,-52 80002faa: 4501 li a0,0 80002fac: 00000097 auipc ra,0x0 80002fb0: e20080e7 jalr -480(ra) # 80002dcc <argint> return -1; 80002fb4: 57fd li a5,-1 if(argint(0, &n) < 0) 80002fb6: 06054563 bltz a0,80003020 <sys_sleep+0x88> acquire(&tickslock); 80002fba: 00015517 auipc a0,0x15 80002fbe: e1650513 addi a0,a0,-490 # 80017dd0 <tickslock> 80002fc2: ffffe097 auipc ra,0xffffe 80002fc6: c22080e7 jalr -990(ra) # 80000be4 <acquire> ticks0 = ticks; 80002fca: 00006917 auipc s2,0x6 80002fce: 06e92903 lw s2,110(s2) # 80009038 <ticks> while(ticks - ticks0 < n){ 80002fd2: fcc42783 lw a5,-52(s0) 80002fd6: cf85 beqz a5,8000300e <sys_sleep+0x76> if(myproc()->killed){ release(&tickslock); return -1; } sleep(&ticks, &tickslock); 80002fd8: 00015997 auipc s3,0x15 80002fdc: df898993 addi s3,s3,-520 # 80017dd0 <tickslock> 80002fe0: 00006497 auipc s1,0x6 80002fe4: 05848493 addi s1,s1,88 # 80009038 <ticks> if(myproc()->killed){ 80002fe8: fffff097 auipc ra,0xfffff 80002fec: 9ce080e7 jalr -1586(ra) # 800019b6 <myproc> 80002ff0: 551c lw a5,40(a0) 80002ff2: ef9d bnez a5,80003030 <sys_sleep+0x98> sleep(&ticks, &tickslock); 80002ff4: 85ce mv a1,s3 80002ff6: 8526 mv a0,s1 80002ff8: fffff097 auipc ra,0xfffff 80002ffc: 082080e7 jalr 130(ra) # 8000207a <sleep> while(ticks - ticks0 < n){ 80003000: 409c lw a5,0(s1) 80003002: 412787bb subw a5,a5,s2 80003006: fcc42703 lw a4,-52(s0) 8000300a: fce7efe3 bltu a5,a4,80002fe8 <sys_sleep+0x50> } release(&tickslock); 8000300e: 00015517 auipc a0,0x15 80003012: dc250513 addi a0,a0,-574 # 80017dd0 <tickslock> 80003016: ffffe097 auipc ra,0xffffe 8000301a: c82080e7 jalr -894(ra) # 80000c98 <release> return 0; 8000301e: 4781 li a5,0 } 80003020: 853e mv a0,a5 80003022: 70e2 ld ra,56(sp) 80003024: 7442 ld s0,48(sp) 80003026: 74a2 ld s1,40(sp) 80003028: 7902 ld s2,32(sp) 8000302a: 69e2 ld s3,24(sp) 8000302c: 6121 addi sp,sp,64 8000302e: 8082 ret release(&tickslock); 80003030: 00015517 auipc a0,0x15 80003034: da050513 addi a0,a0,-608 # 80017dd0 <tickslock> 80003038: ffffe097 auipc ra,0xffffe 8000303c: c60080e7 jalr -928(ra) # 80000c98 <release> return -1; 80003040: 57fd li a5,-1 80003042: bff9 j 80003020 <sys_sleep+0x88> 0000000080003044 <sys_kill>: uint64 sys_kill(void) { 80003044: 1101 addi sp,sp,-32 80003046: ec06 sd ra,24(sp) 80003048: e822 sd s0,16(sp) 8000304a: 1000 addi s0,sp,32 int pid; if(argint(0, &pid) < 0) 8000304c: fec40593 addi a1,s0,-20 80003050: 4501 li a0,0 80003052: 00000097 auipc ra,0x0 80003056: d7a080e7 jalr -646(ra) # 80002dcc <argint> 8000305a: 87aa mv a5,a0 return -1; 8000305c: 557d li a0,-1 if(argint(0, &pid) < 0) 8000305e: 0007c863 bltz a5,8000306e <sys_kill+0x2a> return kill(pid); 80003062: fec42503 lw a0,-20(s0) 80003066: fffff097 auipc ra,0xfffff 8000306a: 346080e7 jalr 838(ra) # 800023ac <kill> } 8000306e: 60e2 ld ra,24(sp) 80003070: 6442 ld s0,16(sp) 80003072: 6105 addi sp,sp,32 80003074: 8082 ret 0000000080003076 <sys_uptime>: // return how many clock tick interrupts have occurred // since start. uint64 sys_uptime(void) { 80003076: 1101 addi sp,sp,-32 80003078: ec06 sd ra,24(sp) 8000307a: e822 sd s0,16(sp) 8000307c: e426 sd s1,8(sp) 8000307e: 1000 addi s0,sp,32 uint xticks; acquire(&tickslock); 80003080: 00015517 auipc a0,0x15 80003084: d5050513 addi a0,a0,-688 # 80017dd0 <tickslock> 80003088: ffffe097 auipc ra,0xffffe 8000308c: b5c080e7 jalr -1188(ra) # 80000be4 <acquire> xticks = ticks; 80003090: 00006497 auipc s1,0x6 80003094: fa84a483 lw s1,-88(s1) # 80009038 <ticks> release(&tickslock); 80003098: 00015517 auipc a0,0x15 8000309c: d3850513 addi a0,a0,-712 # 80017dd0 <tickslock> 800030a0: ffffe097 auipc ra,0xffffe 800030a4: bf8080e7 jalr -1032(ra) # 80000c98 <release> return xticks; } 800030a8: 02049513 slli a0,s1,0x20 800030ac: 9101 srli a0,a0,0x20 800030ae: 60e2 ld ra,24(sp) 800030b0: 6442 ld s0,16(sp) 800030b2: 64a2 ld s1,8(sp) 800030b4: 6105 addi sp,sp,32 800030b6: 8082 ret 00000000800030b8 <sys_hello>: uint64 sys_hello(void) //hello syscall definition { 800030b8: 1101 addi sp,sp,-32 800030ba: ec06 sd ra,24(sp) 800030bc: e822 sd s0,16(sp) 800030be: 1000 addi s0,sp,32 int n; argint(0, &n); 800030c0: fec40593 addi a1,s0,-20 800030c4: 4501 li a0,0 800030c6: 00000097 auipc ra,0x0 800030ca: d06080e7 jalr -762(ra) # 80002dcc <argint> print_hello(n); 800030ce: fec42503 lw a0,-20(s0) 800030d2: fffff097 auipc ra,0xfffff 800030d6: 3f8080e7 jalr 1016(ra) # 800024ca <print_hello> return 0; } 800030da: 4501 li a0,0 800030dc: 60e2 ld ra,24(sp) 800030de: 6442 ld s0,16(sp) 800030e0: 6105 addi sp,sp,32 800030e2: 8082 ret 00000000800030e4 <sys_info>: uint64 sys_info(void) //lab1 { 800030e4: 1101 addi sp,sp,-32 800030e6: ec06 sd ra,24(sp) 800030e8: e822 sd s0,16(sp) 800030ea: 1000 addi s0,sp,32 int n; argint(0,&n); 800030ec: fec40593 addi a1,s0,-20 800030f0: 4501 li a0,0 800030f2: 00000097 auipc ra,0x0 800030f6: cda080e7 jalr -806(ra) # 80002dcc <argint> print_info(n); 800030fa: fec42503 lw a0,-20(s0) 800030fe: fffff097 auipc ra,0xfffff 80003102: 49c080e7 jalr 1180(ra) # 8000259a <print_info> return 0; } 80003106: 4501 li a0,0 80003108: 60e2 ld ra,24(sp) 8000310a: 6442 ld s0,16(sp) 8000310c: 6105 addi sp,sp,32 8000310e: 8082 ret 0000000080003110 <sys_set_tickets>: //lab2 uint64 sys_set_tickets(void) { 80003110: 1101 addi sp,sp,-32 80003112: ec06 sd ra,24(sp) 80003114: e822 sd s0,16(sp) 80003116: 1000 addi s0,sp,32 // cprintf("Calling sys_set_tickets function in sysproc.c\n"); int pid; if (argint(0, &pid) < 0) 80003118: fec40593 addi a1,s0,-20 8000311c: 4501 li a0,0 8000311e: 00000097 auipc ra,0x0 80003122: cae080e7 jalr -850(ra) # 80002dcc <argint> return -1; 80003126: 57fd li a5,-1 if (argint(0, &pid) < 0) 80003128: 00054963 bltz a0,8000313a <sys_set_tickets+0x2a> set_tickets(pid); 8000312c: fec42503 lw a0,-20(s0) 80003130: fffff097 auipc ra,0xfffff 80003134: 530080e7 jalr 1328(ra) # 80002660 <set_tickets> return 0; 80003138: 4781 li a5,0 } 8000313a: 853e mv a0,a5 8000313c: 60e2 ld ra,24(sp) 8000313e: 6442 ld s0,16(sp) 80003140: 6105 addi sp,sp,32 80003142: 8082 ret 0000000080003144 <sys_sched_statistics>: uint64 sys_sched_statistics(void) { 80003144: 1141 addi sp,sp,-16 80003146: e406 sd ra,8(sp) 80003148: e022 sd s0,0(sp) 8000314a: 0800 addi s0,sp,16 // cprintf("Calling sys_sched_statisticss in sysproc.c\n"); sched_statistics(); 8000314c: fffff097 auipc ra,0xfffff 80003150: 55c080e7 jalr 1372(ra) # 800026a8 <sched_statistics> return 0; } 80003154: 4501 li a0,0 80003156: 60a2 ld ra,8(sp) 80003158: 6402 ld s0,0(sp) 8000315a: 0141 addi sp,sp,16 8000315c: 8082 ret 000000008000315e <binit>: struct buf head; } bcache; void binit(void) { 8000315e: 7179 addi sp,sp,-48 80003160: f406 sd ra,40(sp) 80003162: f022 sd s0,32(sp) 80003164: ec26 sd s1,24(sp) 80003166: e84a sd s2,16(sp) 80003168: e44e sd s3,8(sp) 8000316a: e052 sd s4,0(sp) 8000316c: 1800 addi s0,sp,48 struct buf *b; initlock(&bcache.lock, "bcache"); 8000316e: 00005597 auipc a1,0x5 80003172: 48a58593 addi a1,a1,1162 # 800085f8 <syscalls+0xd0> 80003176: 00015517 auipc a0,0x15 8000317a: c7250513 addi a0,a0,-910 # 80017de8 <bcache> 8000317e: ffffe097 auipc ra,0xffffe 80003182: 9d6080e7 jalr -1578(ra) # 80000b54 <initlock> // Create linked list of buffers bcache.head.prev = &bcache.head; 80003186: 0001d797 auipc a5,0x1d 8000318a: c6278793 addi a5,a5,-926 # 8001fde8 <bcache+0x8000> 8000318e: 0001d717 auipc a4,0x1d 80003192: ec270713 addi a4,a4,-318 # 80020050 <bcache+0x8268> 80003196: 2ae7b823 sd a4,688(a5) bcache.head.next = &bcache.head; 8000319a: 2ae7bc23 sd a4,696(a5) for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 8000319e: 00015497 auipc s1,0x15 800031a2: c6248493 addi s1,s1,-926 # 80017e00 <bcache+0x18> b->next = bcache.head.next; 800031a6: 893e mv s2,a5 b->prev = &bcache.head; 800031a8: 89ba mv s3,a4 initsleeplock(&b->lock, "buffer"); 800031aa: 00005a17 auipc s4,0x5 800031ae: 456a0a13 addi s4,s4,1110 # 80008600 <syscalls+0xd8> b->next = bcache.head.next; 800031b2: 2b893783 ld a5,696(s2) 800031b6: e8bc sd a5,80(s1) b->prev = &bcache.head; 800031b8: 0534b423 sd s3,72(s1) initsleeplock(&b->lock, "buffer"); 800031bc: 85d2 mv a1,s4 800031be: 01048513 addi a0,s1,16 800031c2: 00001097 auipc ra,0x1 800031c6: 4bc080e7 jalr 1212(ra) # 8000467e <initsleeplock> bcache.head.next->prev = b; 800031ca: 2b893783 ld a5,696(s2) 800031ce: e7a4 sd s1,72(a5) bcache.head.next = b; 800031d0: 2a993c23 sd s1,696(s2) for(b = bcache.buf; b < bcache.buf+NBUF; b++){ 800031d4: 45848493 addi s1,s1,1112 800031d8: fd349de3 bne s1,s3,800031b2 <binit+0x54> } } 800031dc: 70a2 ld ra,40(sp) 800031de: 7402 ld s0,32(sp) 800031e0: 64e2 ld s1,24(sp) 800031e2: 6942 ld s2,16(sp) 800031e4: 69a2 ld s3,8(sp) 800031e6: 6a02 ld s4,0(sp) 800031e8: 6145 addi sp,sp,48 800031ea: 8082 ret 00000000800031ec <bread>: } // Return a locked buf with the contents of the indicated block. struct buf* bread(uint dev, uint blockno) { 800031ec: 7179 addi sp,sp,-48 800031ee: f406 sd ra,40(sp) 800031f0: f022 sd s0,32(sp) 800031f2: ec26 sd s1,24(sp) 800031f4: e84a sd s2,16(sp) 800031f6: e44e sd s3,8(sp) 800031f8: 1800 addi s0,sp,48 800031fa: 89aa mv s3,a0 800031fc: 892e mv s2,a1 acquire(&bcache.lock); 800031fe: 00015517 auipc a0,0x15 80003202: bea50513 addi a0,a0,-1046 # 80017de8 <bcache> 80003206: ffffe097 auipc ra,0xffffe 8000320a: 9de080e7 jalr -1570(ra) # 80000be4 <acquire> for(b = bcache.head.next; b != &bcache.head; b = b->next){ 8000320e: 0001d497 auipc s1,0x1d 80003212: e924b483 ld s1,-366(s1) # 800200a0 <bcache+0x82b8> 80003216: 0001d797 auipc a5,0x1d 8000321a: e3a78793 addi a5,a5,-454 # 80020050 <bcache+0x8268> 8000321e: 02f48f63 beq s1,a5,8000325c <bread+0x70> 80003222: 873e mv a4,a5 80003224: a021 j 8000322c <bread+0x40> 80003226: 68a4 ld s1,80(s1) 80003228: 02e48a63 beq s1,a4,8000325c <bread+0x70> if(b->dev == dev && b->blockno == blockno){ 8000322c: 449c lw a5,8(s1) 8000322e: ff379ce3 bne a5,s3,80003226 <bread+0x3a> 80003232: 44dc lw a5,12(s1) 80003234: ff2799e3 bne a5,s2,80003226 <bread+0x3a> b->refcnt++; 80003238: 40bc lw a5,64(s1) 8000323a: 2785 addiw a5,a5,1 8000323c: c0bc sw a5,64(s1) release(&bcache.lock); 8000323e: 00015517 auipc a0,0x15 80003242: baa50513 addi a0,a0,-1110 # 80017de8 <bcache> 80003246: ffffe097 auipc ra,0xffffe 8000324a: a52080e7 jalr -1454(ra) # 80000c98 <release> acquiresleep(&b->lock); 8000324e: 01048513 addi a0,s1,16 80003252: 00001097 auipc ra,0x1 80003256: 466080e7 jalr 1126(ra) # 800046b8 <acquiresleep> return b; 8000325a: a8b9 j 800032b8 <bread+0xcc> for(b = bcache.head.prev; b != &bcache.head; b = b->prev){ 8000325c: 0001d497 auipc s1,0x1d 80003260: e3c4b483 ld s1,-452(s1) # 80020098 <bcache+0x82b0> 80003264: 0001d797 auipc a5,0x1d 80003268: dec78793 addi a5,a5,-532 # 80020050 <bcache+0x8268> 8000326c: 00f48863 beq s1,a5,8000327c <bread+0x90> 80003270: 873e mv a4,a5 if(b->refcnt == 0) { 80003272: 40bc lw a5,64(s1) 80003274: cf81 beqz a5,8000328c <bread+0xa0> for(b = bcache.head.prev; b != &bcache.head; b = b->prev){ 80003276: 64a4 ld s1,72(s1) 80003278: fee49de3 bne s1,a4,80003272 <bread+0x86> panic("bget: no buffers"); 8000327c: 00005517 auipc a0,0x5 80003280: 38c50513 addi a0,a0,908 # 80008608 <syscalls+0xe0> 80003284: ffffd097 auipc ra,0xffffd 80003288: 2ba080e7 jalr 698(ra) # 8000053e <panic> b->dev = dev; 8000328c: 0134a423 sw s3,8(s1) b->blockno = blockno; 80003290: 0124a623 sw s2,12(s1) b->valid = 0; 80003294: 0004a023 sw zero,0(s1) b->refcnt = 1; 80003298: 4785 li a5,1 8000329a: c0bc sw a5,64(s1) release(&bcache.lock); 8000329c: 00015517 auipc a0,0x15 800032a0: b4c50513 addi a0,a0,-1204 # 80017de8 <bcache> 800032a4: ffffe097 auipc ra,0xffffe 800032a8: 9f4080e7 jalr -1548(ra) # 80000c98 <release> acquiresleep(&b->lock); 800032ac: 01048513 addi a0,s1,16 800032b0: 00001097 auipc ra,0x1 800032b4: 408080e7 jalr 1032(ra) # 800046b8 <acquiresleep> struct buf *b; b = bget(dev, blockno); if(!b->valid) { 800032b8: 409c lw a5,0(s1) 800032ba: cb89 beqz a5,800032cc <bread+0xe0> virtio_disk_rw(b, 0); b->valid = 1; } return b; } 800032bc: 8526 mv a0,s1 800032be: 70a2 ld ra,40(sp) 800032c0: 7402 ld s0,32(sp) 800032c2: 64e2 ld s1,24(sp) 800032c4: 6942 ld s2,16(sp) 800032c6: 69a2 ld s3,8(sp) 800032c8: 6145 addi sp,sp,48 800032ca: 8082 ret virtio_disk_rw(b, 0); 800032cc: 4581 li a1,0 800032ce: 8526 mv a0,s1 800032d0: 00003097 auipc ra,0x3 800032d4: f06080e7 jalr -250(ra) # 800061d6 <virtio_disk_rw> b->valid = 1; 800032d8: 4785 li a5,1 800032da: c09c sw a5,0(s1) return b; 800032dc: b7c5 j 800032bc <bread+0xd0> 00000000800032de <bwrite>: // Write b's contents to disk. Must be locked. void bwrite(struct buf *b) { 800032de: 1101 addi sp,sp,-32 800032e0: ec06 sd ra,24(sp) 800032e2: e822 sd s0,16(sp) 800032e4: e426 sd s1,8(sp) 800032e6: 1000 addi s0,sp,32 800032e8: 84aa mv s1,a0 if(!holdingsleep(&b->lock)) 800032ea: 0541 addi a0,a0,16 800032ec: 00001097 auipc ra,0x1 800032f0: 466080e7 jalr 1126(ra) # 80004752 <holdingsleep> 800032f4: cd01 beqz a0,8000330c <bwrite+0x2e> panic("bwrite"); virtio_disk_rw(b, 1); 800032f6: 4585 li a1,1 800032f8: 8526 mv a0,s1 800032fa: 00003097 auipc ra,0x3 800032fe: edc080e7 jalr -292(ra) # 800061d6 <virtio_disk_rw> } 80003302: 60e2 ld ra,24(sp) 80003304: 6442 ld s0,16(sp) 80003306: 64a2 ld s1,8(sp) 80003308: 6105 addi sp,sp,32 8000330a: 8082 ret panic("bwrite"); 8000330c: 00005517 auipc a0,0x5 80003310: 31450513 addi a0,a0,788 # 80008620 <syscalls+0xf8> 80003314: ffffd097 auipc ra,0xffffd 80003318: 22a080e7 jalr 554(ra) # 8000053e <panic> 000000008000331c <brelse>: // Release a locked buffer. // Move to the head of the most-recently-used list. void brelse(struct buf *b) { 8000331c: 1101 addi sp,sp,-32 8000331e: ec06 sd ra,24(sp) 80003320: e822 sd s0,16(sp) 80003322: e426 sd s1,8(sp) 80003324: e04a sd s2,0(sp) 80003326: 1000 addi s0,sp,32 80003328: 84aa mv s1,a0 if(!holdingsleep(&b->lock)) 8000332a: 01050913 addi s2,a0,16 8000332e: 854a mv a0,s2 80003330: 00001097 auipc ra,0x1 80003334: 422080e7 jalr 1058(ra) # 80004752 <holdingsleep> 80003338: c92d beqz a0,800033aa <brelse+0x8e> panic("brelse"); releasesleep(&b->lock); 8000333a: 854a mv a0,s2 8000333c: 00001097 auipc ra,0x1 80003340: 3d2080e7 jalr 978(ra) # 8000470e <releasesleep> acquire(&bcache.lock); 80003344: 00015517 auipc a0,0x15 80003348: aa450513 addi a0,a0,-1372 # 80017de8 <bcache> 8000334c: ffffe097 auipc ra,0xffffe 80003350: 898080e7 jalr -1896(ra) # 80000be4 <acquire> b->refcnt--; 80003354: 40bc lw a5,64(s1) 80003356: 37fd addiw a5,a5,-1 80003358: 0007871b sext.w a4,a5 8000335c: c0bc sw a5,64(s1) if (b->refcnt == 0) { 8000335e: eb05 bnez a4,8000338e <brelse+0x72> // no one is waiting for it. b->next->prev = b->prev; 80003360: 68bc ld a5,80(s1) 80003362: 64b8 ld a4,72(s1) 80003364: e7b8 sd a4,72(a5) b->prev->next = b->next; 80003366: 64bc ld a5,72(s1) 80003368: 68b8 ld a4,80(s1) 8000336a: ebb8 sd a4,80(a5) b->next = bcache.head.next; 8000336c: 0001d797 auipc a5,0x1d 80003370: a7c78793 addi a5,a5,-1412 # 8001fde8 <bcache+0x8000> 80003374: 2b87b703 ld a4,696(a5) 80003378: e8b8 sd a4,80(s1) b->prev = &bcache.head; 8000337a: 0001d717 auipc a4,0x1d 8000337e: cd670713 addi a4,a4,-810 # 80020050 <bcache+0x8268> 80003382: e4b8 sd a4,72(s1) bcache.head.next->prev = b; 80003384: 2b87b703 ld a4,696(a5) 80003388: e724 sd s1,72(a4) bcache.head.next = b; 8000338a: 2a97bc23 sd s1,696(a5) } release(&bcache.lock); 8000338e: 00015517 auipc a0,0x15 80003392: a5a50513 addi a0,a0,-1446 # 80017de8 <bcache> 80003396: ffffe097 auipc ra,0xffffe 8000339a: 902080e7 jalr -1790(ra) # 80000c98 <release> } 8000339e: 60e2 ld ra,24(sp) 800033a0: 6442 ld s0,16(sp) 800033a2: 64a2 ld s1,8(sp) 800033a4: 6902 ld s2,0(sp) 800033a6: 6105 addi sp,sp,32 800033a8: 8082 ret panic("brelse"); 800033aa: 00005517 auipc a0,0x5 800033ae: 27e50513 addi a0,a0,638 # 80008628 <syscalls+0x100> 800033b2: ffffd097 auipc ra,0xffffd 800033b6: 18c080e7 jalr 396(ra) # 8000053e <panic> 00000000800033ba <bpin>: void bpin(struct buf *b) { 800033ba: 1101 addi sp,sp,-32 800033bc: ec06 sd ra,24(sp) 800033be: e822 sd s0,16(sp) 800033c0: e426 sd s1,8(sp) 800033c2: 1000 addi s0,sp,32 800033c4: 84aa mv s1,a0 acquire(&bcache.lock); 800033c6: 00015517 auipc a0,0x15 800033ca: a2250513 addi a0,a0,-1502 # 80017de8 <bcache> 800033ce: ffffe097 auipc ra,0xffffe 800033d2: 816080e7 jalr -2026(ra) # 80000be4 <acquire> b->refcnt++; 800033d6: 40bc lw a5,64(s1) 800033d8: 2785 addiw a5,a5,1 800033da: c0bc sw a5,64(s1) release(&bcache.lock); 800033dc: 00015517 auipc a0,0x15 800033e0: a0c50513 addi a0,a0,-1524 # 80017de8 <bcache> 800033e4: ffffe097 auipc ra,0xffffe 800033e8: 8b4080e7 jalr -1868(ra) # 80000c98 <release> } 800033ec: 60e2 ld ra,24(sp) 800033ee: 6442 ld s0,16(sp) 800033f0: 64a2 ld s1,8(sp) 800033f2: 6105 addi sp,sp,32 800033f4: 8082 ret 00000000800033f6 <bunpin>: void bunpin(struct buf *b) { 800033f6: 1101 addi sp,sp,-32 800033f8: ec06 sd ra,24(sp) 800033fa: e822 sd s0,16(sp) 800033fc: e426 sd s1,8(sp) 800033fe: 1000 addi s0,sp,32 80003400: 84aa mv s1,a0 acquire(&bcache.lock); 80003402: 00015517 auipc a0,0x15 80003406: 9e650513 addi a0,a0,-1562 # 80017de8 <bcache> 8000340a: ffffd097 auipc ra,0xffffd 8000340e: 7da080e7 jalr 2010(ra) # 80000be4 <acquire> b->refcnt--; 80003412: 40bc lw a5,64(s1) 80003414: 37fd addiw a5,a5,-1 80003416: c0bc sw a5,64(s1) release(&bcache.lock); 80003418: 00015517 auipc a0,0x15 8000341c: 9d050513 addi a0,a0,-1584 # 80017de8 <bcache> 80003420: ffffe097 auipc ra,0xffffe 80003424: 878080e7 jalr -1928(ra) # 80000c98 <release> } 80003428: 60e2 ld ra,24(sp) 8000342a: 6442 ld s0,16(sp) 8000342c: 64a2 ld s1,8(sp) 8000342e: 6105 addi sp,sp,32 80003430: 8082 ret 0000000080003432 <bfree>: } // Free a disk block. static void bfree(int dev, uint b) { 80003432: 1101 addi sp,sp,-32 80003434: ec06 sd ra,24(sp) 80003436: e822 sd s0,16(sp) 80003438: e426 sd s1,8(sp) 8000343a: e04a sd s2,0(sp) 8000343c: 1000 addi s0,sp,32 8000343e: 84ae mv s1,a1 struct buf *bp; int bi, m; bp = bread(dev, BBLOCK(b, sb)); 80003440: 00d5d59b srliw a1,a1,0xd 80003444: 0001d797 auipc a5,0x1d 80003448: 0807a783 lw a5,128(a5) # 800204c4 <sb+0x1c> 8000344c: 9dbd addw a1,a1,a5 8000344e: 00000097 auipc ra,0x0 80003452: d9e080e7 jalr -610(ra) # 800031ec <bread> bi = b % BPB; m = 1 << (bi % 8); 80003456: 0074f713 andi a4,s1,7 8000345a: 4785 li a5,1 8000345c: 00e797bb sllw a5,a5,a4 if((bp->data[bi/8] & m) == 0) 80003460: 14ce slli s1,s1,0x33 80003462: 90d9 srli s1,s1,0x36 80003464: 00950733 add a4,a0,s1 80003468: 05874703 lbu a4,88(a4) 8000346c: 00e7f6b3 and a3,a5,a4 80003470: c69d beqz a3,8000349e <bfree+0x6c> 80003472: 892a mv s2,a0 panic("freeing free block"); bp->data[bi/8] &= ~m; 80003474: 94aa add s1,s1,a0 80003476: fff7c793 not a5,a5 8000347a: 8ff9 and a5,a5,a4 8000347c: 04f48c23 sb a5,88(s1) log_write(bp); 80003480: 00001097 auipc ra,0x1 80003484: 118080e7 jalr 280(ra) # 80004598 <log_write> brelse(bp); 80003488: 854a mv a0,s2 8000348a: 00000097 auipc ra,0x0 8000348e: e92080e7 jalr -366(ra) # 8000331c <brelse> } 80003492: 60e2 ld ra,24(sp) 80003494: 6442 ld s0,16(sp) 80003496: 64a2 ld s1,8(sp) 80003498: 6902 ld s2,0(sp) 8000349a: 6105 addi sp,sp,32 8000349c: 8082 ret panic("freeing free block"); 8000349e: 00005517 auipc a0,0x5 800034a2: 19250513 addi a0,a0,402 # 80008630 <syscalls+0x108> 800034a6: ffffd097 auipc ra,0xffffd 800034aa: 098080e7 jalr 152(ra) # 8000053e <panic> 00000000800034ae <balloc>: { 800034ae: 711d addi sp,sp,-96 800034b0: ec86 sd ra,88(sp) 800034b2: e8a2 sd s0,80(sp) 800034b4: e4a6 sd s1,72(sp) 800034b6: e0ca sd s2,64(sp) 800034b8: fc4e sd s3,56(sp) 800034ba: f852 sd s4,48(sp) 800034bc: f456 sd s5,40(sp) 800034be: f05a sd s6,32(sp) 800034c0: ec5e sd s7,24(sp) 800034c2: e862 sd s8,16(sp) 800034c4: e466 sd s9,8(sp) 800034c6: 1080 addi s0,sp,96 for(b = 0; b < sb.size; b += BPB){ 800034c8: 0001d797 auipc a5,0x1d 800034cc: fe47a783 lw a5,-28(a5) # 800204ac <sb+0x4> 800034d0: cbd1 beqz a5,80003564 <balloc+0xb6> 800034d2: 8baa mv s7,a0 800034d4: 4a81 li s5,0 bp = bread(dev, BBLOCK(b, sb)); 800034d6: 0001db17 auipc s6,0x1d 800034da: fd2b0b13 addi s6,s6,-46 # 800204a8 <sb> for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 800034de: 4c01 li s8,0 m = 1 << (bi % 8); 800034e0: 4985 li s3,1 for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 800034e2: 6a09 lui s4,0x2 for(b = 0; b < sb.size; b += BPB){ 800034e4: 6c89 lui s9,0x2 800034e6: a831 j 80003502 <balloc+0x54> brelse(bp); 800034e8: 854a mv a0,s2 800034ea: 00000097 auipc ra,0x0 800034ee: e32080e7 jalr -462(ra) # 8000331c <brelse> for(b = 0; b < sb.size; b += BPB){ 800034f2: 015c87bb addw a5,s9,s5 800034f6: 00078a9b sext.w s5,a5 800034fa: 004b2703 lw a4,4(s6) 800034fe: 06eaf363 bgeu s5,a4,80003564 <balloc+0xb6> bp = bread(dev, BBLOCK(b, sb)); 80003502: 41fad79b sraiw a5,s5,0x1f 80003506: 0137d79b srliw a5,a5,0x13 8000350a: 015787bb addw a5,a5,s5 8000350e: 40d7d79b sraiw a5,a5,0xd 80003512: 01cb2583 lw a1,28(s6) 80003516: 9dbd addw a1,a1,a5 80003518: 855e mv a0,s7 8000351a: 00000097 auipc ra,0x0 8000351e: cd2080e7 jalr -814(ra) # 800031ec <bread> 80003522: 892a mv s2,a0 for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 80003524: 004b2503 lw a0,4(s6) 80003528: 000a849b sext.w s1,s5 8000352c: 8662 mv a2,s8 8000352e: faa4fde3 bgeu s1,a0,800034e8 <balloc+0x3a> m = 1 << (bi % 8); 80003532: 41f6579b sraiw a5,a2,0x1f 80003536: 01d7d69b srliw a3,a5,0x1d 8000353a: 00c6873b addw a4,a3,a2 8000353e: 00777793 andi a5,a4,7 80003542: 9f95 subw a5,a5,a3 80003544: 00f997bb sllw a5,s3,a5 if((bp->data[bi/8] & m) == 0){ // Is block free? 80003548: 4037571b sraiw a4,a4,0x3 8000354c: 00e906b3 add a3,s2,a4 80003550: 0586c683 lbu a3,88(a3) 80003554: 00d7f5b3 and a1,a5,a3 80003558: cd91 beqz a1,80003574 <balloc+0xc6> for(bi = 0; bi < BPB && b + bi < sb.size; bi++){ 8000355a: 2605 addiw a2,a2,1 8000355c: 2485 addiw s1,s1,1 8000355e: fd4618e3 bne a2,s4,8000352e <balloc+0x80> 80003562: b759 j 800034e8 <balloc+0x3a> panic("balloc: out of blocks"); 80003564: 00005517 auipc a0,0x5 80003568: 0e450513 addi a0,a0,228 # 80008648 <syscalls+0x120> 8000356c: ffffd097 auipc ra,0xffffd 80003570: fd2080e7 jalr -46(ra) # 8000053e <panic> bp->data[bi/8] |= m; // Mark block in use. 80003574: 974a add a4,a4,s2 80003576: 8fd5 or a5,a5,a3 80003578: 04f70c23 sb a5,88(a4) log_write(bp); 8000357c: 854a mv a0,s2 8000357e: 00001097 auipc ra,0x1 80003582: 01a080e7 jalr 26(ra) # 80004598 <log_write> brelse(bp); 80003586: 854a mv a0,s2 80003588: 00000097 auipc ra,0x0 8000358c: d94080e7 jalr -620(ra) # 8000331c <brelse> bp = bread(dev, bno); 80003590: 85a6 mv a1,s1 80003592: 855e mv a0,s7 80003594: 00000097 auipc ra,0x0 80003598: c58080e7 jalr -936(ra) # 800031ec <bread> 8000359c: 892a mv s2,a0 memset(bp->data, 0, BSIZE); 8000359e: 40000613 li a2,1024 800035a2: 4581 li a1,0 800035a4: 05850513 addi a0,a0,88 800035a8: ffffd097 auipc ra,0xffffd 800035ac: 738080e7 jalr 1848(ra) # 80000ce0 <memset> log_write(bp); 800035b0: 854a mv a0,s2 800035b2: 00001097 auipc ra,0x1 800035b6: fe6080e7 jalr -26(ra) # 80004598 <log_write> brelse(bp); 800035ba: 854a mv a0,s2 800035bc: 00000097 auipc ra,0x0 800035c0: d60080e7 jalr -672(ra) # 8000331c <brelse> } 800035c4: 8526 mv a0,s1 800035c6: 60e6 ld ra,88(sp) 800035c8: 6446 ld s0,80(sp) 800035ca: 64a6 ld s1,72(sp) 800035cc: 6906 ld s2,64(sp) 800035ce: 79e2 ld s3,56(sp) 800035d0: 7a42 ld s4,48(sp) 800035d2: 7aa2 ld s5,40(sp) 800035d4: 7b02 ld s6,32(sp) 800035d6: 6be2 ld s7,24(sp) 800035d8: 6c42 ld s8,16(sp) 800035da: 6ca2 ld s9,8(sp) 800035dc: 6125 addi sp,sp,96 800035de: 8082 ret 00000000800035e0 <bmap>: // Return the disk block address of the nth block in inode ip. // If there is no such block, bmap allocates one. static uint bmap(struct inode *ip, uint bn) { 800035e0: 7179 addi sp,sp,-48 800035e2: f406 sd ra,40(sp) 800035e4: f022 sd s0,32(sp) 800035e6: ec26 sd s1,24(sp) 800035e8: e84a sd s2,16(sp) 800035ea: e44e sd s3,8(sp) 800035ec: e052 sd s4,0(sp) 800035ee: 1800 addi s0,sp,48 800035f0: 892a mv s2,a0 uint addr, *a; struct buf *bp; if(bn < NDIRECT){ 800035f2: 47ad li a5,11 800035f4: 04b7fe63 bgeu a5,a1,80003650 <bmap+0x70> if((addr = ip->addrs[bn]) == 0) ip->addrs[bn] = addr = balloc(ip->dev); return addr; } bn -= NDIRECT; 800035f8: ff45849b addiw s1,a1,-12 800035fc: 0004871b sext.w a4,s1 if(bn < NINDIRECT){ 80003600: 0ff00793 li a5,255 80003604: 0ae7e363 bltu a5,a4,800036aa <bmap+0xca> // Load indirect block, allocating if necessary. if((addr = ip->addrs[NDIRECT]) == 0) 80003608: 08052583 lw a1,128(a0) 8000360c: c5ad beqz a1,80003676 <bmap+0x96> ip->addrs[NDIRECT] = addr = balloc(ip->dev); bp = bread(ip->dev, addr); 8000360e: 00092503 lw a0,0(s2) 80003612: 00000097 auipc ra,0x0 80003616: bda080e7 jalr -1062(ra) # 800031ec <bread> 8000361a: 8a2a mv s4,a0 a = (uint*)bp->data; 8000361c: 05850793 addi a5,a0,88 if((addr = a[bn]) == 0){ 80003620: 02049593 slli a1,s1,0x20 80003624: 9181 srli a1,a1,0x20 80003626: 058a slli a1,a1,0x2 80003628: 00b784b3 add s1,a5,a1 8000362c: 0004a983 lw s3,0(s1) 80003630: 04098d63 beqz s3,8000368a <bmap+0xaa> a[bn] = addr = balloc(ip->dev); log_write(bp); } brelse(bp); 80003634: 8552 mv a0,s4 80003636: 00000097 auipc ra,0x0 8000363a: ce6080e7 jalr -794(ra) # 8000331c <brelse> return addr; } panic("bmap: out of range"); } 8000363e: 854e mv a0,s3 80003640: 70a2 ld ra,40(sp) 80003642: 7402 ld s0,32(sp) 80003644: 64e2 ld s1,24(sp) 80003646: 6942 ld s2,16(sp) 80003648: 69a2 ld s3,8(sp) 8000364a: 6a02 ld s4,0(sp) 8000364c: 6145 addi sp,sp,48 8000364e: 8082 ret if((addr = ip->addrs[bn]) == 0) 80003650: 02059493 slli s1,a1,0x20 80003654: 9081 srli s1,s1,0x20 80003656: 048a slli s1,s1,0x2 80003658: 94aa add s1,s1,a0 8000365a: 0504a983 lw s3,80(s1) 8000365e: fe0990e3 bnez s3,8000363e <bmap+0x5e> ip->addrs[bn] = addr = balloc(ip->dev); 80003662: 4108 lw a0,0(a0) 80003664: 00000097 auipc ra,0x0 80003668: e4a080e7 jalr -438(ra) # 800034ae <balloc> 8000366c: 0005099b sext.w s3,a0 80003670: 0534a823 sw s3,80(s1) 80003674: b7e9 j 8000363e <bmap+0x5e> ip->addrs[NDIRECT] = addr = balloc(ip->dev); 80003676: 4108 lw a0,0(a0) 80003678: 00000097 auipc ra,0x0 8000367c: e36080e7 jalr -458(ra) # 800034ae <balloc> 80003680: 0005059b sext.w a1,a0 80003684: 08b92023 sw a1,128(s2) 80003688: b759 j 8000360e <bmap+0x2e> a[bn] = addr = balloc(ip->dev); 8000368a: 00092503 lw a0,0(s2) 8000368e: 00000097 auipc ra,0x0 80003692: e20080e7 jalr -480(ra) # 800034ae <balloc> 80003696: 0005099b sext.w s3,a0 8000369a: 0134a023 sw s3,0(s1) log_write(bp); 8000369e: 8552 mv a0,s4 800036a0: 00001097 auipc ra,0x1 800036a4: ef8080e7 jalr -264(ra) # 80004598 <log_write> 800036a8: b771 j 80003634 <bmap+0x54> panic("bmap: out of range"); 800036aa: 00005517 auipc a0,0x5 800036ae: fb650513 addi a0,a0,-74 # 80008660 <syscalls+0x138> 800036b2: ffffd097 auipc ra,0xffffd 800036b6: e8c080e7 jalr -372(ra) # 8000053e <panic> 00000000800036ba <iget>: { 800036ba: 7179 addi sp,sp,-48 800036bc: f406 sd ra,40(sp) 800036be: f022 sd s0,32(sp) 800036c0: ec26 sd s1,24(sp) 800036c2: e84a sd s2,16(sp) 800036c4: e44e sd s3,8(sp) 800036c6: e052 sd s4,0(sp) 800036c8: 1800 addi s0,sp,48 800036ca: 89aa mv s3,a0 800036cc: 8a2e mv s4,a1 acquire(&itable.lock); 800036ce: 0001d517 auipc a0,0x1d 800036d2: dfa50513 addi a0,a0,-518 # 800204c8 <itable> 800036d6: ffffd097 auipc ra,0xffffd 800036da: 50e080e7 jalr 1294(ra) # 80000be4 <acquire> empty = 0; 800036de: 4901 li s2,0 for(ip = &itable.inode[0]; ip < &itable.inode[NINODE]; ip++){ 800036e0: 0001d497 auipc s1,0x1d 800036e4: e0048493 addi s1,s1,-512 # 800204e0 <itable+0x18> 800036e8: 0001f697 auipc a3,0x1f 800036ec: 88868693 addi a3,a3,-1912 # 80021f70 <log> 800036f0: a039 j 800036fe <iget+0x44> if(empty == 0 && ip->ref == 0) // Remember empty slot. 800036f2: 02090b63 beqz s2,80003728 <iget+0x6e> for(ip = &itable.inode[0]; ip < &itable.inode[NINODE]; ip++){ 800036f6: 08848493 addi s1,s1,136 800036fa: 02d48a63 beq s1,a3,8000372e <iget+0x74> if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){ 800036fe: 449c lw a5,8(s1) 80003700: fef059e3 blez a5,800036f2 <iget+0x38> 80003704: 4098 lw a4,0(s1) 80003706: ff3716e3 bne a4,s3,800036f2 <iget+0x38> 8000370a: 40d8 lw a4,4(s1) 8000370c: ff4713e3 bne a4,s4,800036f2 <iget+0x38> ip->ref++; 80003710: 2785 addiw a5,a5,1 80003712: c49c sw a5,8(s1) release(&itable.lock); 80003714: 0001d517 auipc a0,0x1d 80003718: db450513 addi a0,a0,-588 # 800204c8 <itable> 8000371c: ffffd097 auipc ra,0xffffd 80003720: 57c080e7 jalr 1404(ra) # 80000c98 <release> return ip; 80003724: 8926 mv s2,s1 80003726: a03d j 80003754 <iget+0x9a> if(empty == 0 && ip->ref == 0) // Remember empty slot. 80003728: f7f9 bnez a5,800036f6 <iget+0x3c> 8000372a: 8926 mv s2,s1 8000372c: b7e9 j 800036f6 <iget+0x3c> if(empty == 0) 8000372e: 02090c63 beqz s2,80003766 <iget+0xac> ip->dev = dev; 80003732: 01392023 sw s3,0(s2) ip->inum = inum; 80003736: 01492223 sw s4,4(s2) ip->ref = 1; 8000373a: 4785 li a5,1 8000373c: 00f92423 sw a5,8(s2) ip->valid = 0; 80003740: 04092023 sw zero,64(s2) release(&itable.lock); 80003744: 0001d517 auipc a0,0x1d 80003748: d8450513 addi a0,a0,-636 # 800204c8 <itable> 8000374c: ffffd097 auipc ra,0xffffd 80003750: 54c080e7 jalr 1356(ra) # 80000c98 <release> } 80003754: 854a mv a0,s2 80003756: 70a2 ld ra,40(sp) 80003758: 7402 ld s0,32(sp) 8000375a: 64e2 ld s1,24(sp) 8000375c: 6942 ld s2,16(sp) 8000375e: 69a2 ld s3,8(sp) 80003760: 6a02 ld s4,0(sp) 80003762: 6145 addi sp,sp,48 80003764: 8082 ret panic("iget: no inodes"); 80003766: 00005517 auipc a0,0x5 8000376a: f1250513 addi a0,a0,-238 # 80008678 <syscalls+0x150> 8000376e: ffffd097 auipc ra,0xffffd 80003772: dd0080e7 jalr -560(ra) # 8000053e <panic> 0000000080003776 <fsinit>: fsinit(int dev) { 80003776: 7179 addi sp,sp,-48 80003778: f406 sd ra,40(sp) 8000377a: f022 sd s0,32(sp) 8000377c: ec26 sd s1,24(sp) 8000377e: e84a sd s2,16(sp) 80003780: e44e sd s3,8(sp) 80003782: 1800 addi s0,sp,48 80003784: 892a mv s2,a0 bp = bread(dev, 1); 80003786: 4585 li a1,1 80003788: 00000097 auipc ra,0x0 8000378c: a64080e7 jalr -1436(ra) # 800031ec <bread> 80003790: 84aa mv s1,a0 memmove(sb, bp->data, sizeof(*sb)); 80003792: 0001d997 auipc s3,0x1d 80003796: d1698993 addi s3,s3,-746 # 800204a8 <sb> 8000379a: 02000613 li a2,32 8000379e: 05850593 addi a1,a0,88 800037a2: 854e mv a0,s3 800037a4: ffffd097 auipc ra,0xffffd 800037a8: 59c080e7 jalr 1436(ra) # 80000d40 <memmove> brelse(bp); 800037ac: 8526 mv a0,s1 800037ae: 00000097 auipc ra,0x0 800037b2: b6e080e7 jalr -1170(ra) # 8000331c <brelse> if(sb.magic != FSMAGIC) 800037b6: 0009a703 lw a4,0(s3) 800037ba: 102037b7 lui a5,0x10203 800037be: 04078793 addi a5,a5,64 # 10203040 <_entry-0x6fdfcfc0> 800037c2: 02f71263 bne a4,a5,800037e6 <fsinit+0x70> initlog(dev, &sb); 800037c6: 0001d597 auipc a1,0x1d 800037ca: ce258593 addi a1,a1,-798 # 800204a8 <sb> 800037ce: 854a mv a0,s2 800037d0: 00001097 auipc ra,0x1 800037d4: b4c080e7 jalr -1204(ra) # 8000431c <initlog> } 800037d8: 70a2 ld ra,40(sp) 800037da: 7402 ld s0,32(sp) 800037dc: 64e2 ld s1,24(sp) 800037de: 6942 ld s2,16(sp) 800037e0: 69a2 ld s3,8(sp) 800037e2: 6145 addi sp,sp,48 800037e4: 8082 ret panic("invalid file system"); 800037e6: 00005517 auipc a0,0x5 800037ea: ea250513 addi a0,a0,-350 # 80008688 <syscalls+0x160> 800037ee: ffffd097 auipc ra,0xffffd 800037f2: d50080e7 jalr -688(ra) # 8000053e <panic> 00000000800037f6 <iinit>: { 800037f6: 7179 addi sp,sp,-48 800037f8: f406 sd ra,40(sp) 800037fa: f022 sd s0,32(sp) 800037fc: ec26 sd s1,24(sp) 800037fe: e84a sd s2,16(sp) 80003800: e44e sd s3,8(sp) 80003802: 1800 addi s0,sp,48 initlock(&itable.lock, "itable"); 80003804: 00005597 auipc a1,0x5 80003808: e9c58593 addi a1,a1,-356 # 800086a0 <syscalls+0x178> 8000380c: 0001d517 auipc a0,0x1d 80003810: cbc50513 addi a0,a0,-836 # 800204c8 <itable> 80003814: ffffd097 auipc ra,0xffffd 80003818: 340080e7 jalr 832(ra) # 80000b54 <initlock> for(i = 0; i < NINODE; i++) { 8000381c: 0001d497 auipc s1,0x1d 80003820: cd448493 addi s1,s1,-812 # 800204f0 <itable+0x28> 80003824: 0001e997 auipc s3,0x1e 80003828: 75c98993 addi s3,s3,1884 # 80021f80 <log+0x10> initsleeplock(&itable.inode[i].lock, "inode"); 8000382c: 00005917 auipc s2,0x5 80003830: e7c90913 addi s2,s2,-388 # 800086a8 <syscalls+0x180> 80003834: 85ca mv a1,s2 80003836: 8526 mv a0,s1 80003838: 00001097 auipc ra,0x1 8000383c: e46080e7 jalr -442(ra) # 8000467e <initsleeplock> for(i = 0; i < NINODE; i++) { 80003840: 08848493 addi s1,s1,136 80003844: ff3498e3 bne s1,s3,80003834 <iinit+0x3e> } 80003848: 70a2 ld ra,40(sp) 8000384a: 7402 ld s0,32(sp) 8000384c: 64e2 ld s1,24(sp) 8000384e: 6942 ld s2,16(sp) 80003850: 69a2 ld s3,8(sp) 80003852: 6145 addi sp,sp,48 80003854: 8082 ret 0000000080003856 <ialloc>: { 80003856: 715d addi sp,sp,-80 80003858: e486 sd ra,72(sp) 8000385a: e0a2 sd s0,64(sp) 8000385c: fc26 sd s1,56(sp) 8000385e: f84a sd s2,48(sp) 80003860: f44e sd s3,40(sp) 80003862: f052 sd s4,32(sp) 80003864: ec56 sd s5,24(sp) 80003866: e85a sd s6,16(sp) 80003868: e45e sd s7,8(sp) 8000386a: 0880 addi s0,sp,80 for(inum = 1; inum < sb.ninodes; inum++){ 8000386c: 0001d717 auipc a4,0x1d 80003870: c4872703 lw a4,-952(a4) # 800204b4 <sb+0xc> 80003874: 4785 li a5,1 80003876: 04e7fa63 bgeu a5,a4,800038ca <ialloc+0x74> 8000387a: 8aaa mv s5,a0 8000387c: 8bae mv s7,a1 8000387e: 4485 li s1,1 bp = bread(dev, IBLOCK(inum, sb)); 80003880: 0001da17 auipc s4,0x1d 80003884: c28a0a13 addi s4,s4,-984 # 800204a8 <sb> 80003888: 00048b1b sext.w s6,s1 8000388c: 0044d593 srli a1,s1,0x4 80003890: 018a2783 lw a5,24(s4) 80003894: 9dbd addw a1,a1,a5 80003896: 8556 mv a0,s5 80003898: 00000097 auipc ra,0x0 8000389c: 954080e7 jalr -1708(ra) # 800031ec <bread> 800038a0: 892a mv s2,a0 dip = (struct dinode*)bp->data + inum%IPB; 800038a2: 05850993 addi s3,a0,88 800038a6: 00f4f793 andi a5,s1,15 800038aa: 079a slli a5,a5,0x6 800038ac: 99be add s3,s3,a5 if(dip->type == 0){ // a free inode 800038ae: 00099783 lh a5,0(s3) 800038b2: c785 beqz a5,800038da <ialloc+0x84> brelse(bp); 800038b4: 00000097 auipc ra,0x0 800038b8: a68080e7 jalr -1432(ra) # 8000331c <brelse> for(inum = 1; inum < sb.ninodes; inum++){ 800038bc: 0485 addi s1,s1,1 800038be: 00ca2703 lw a4,12(s4) 800038c2: 0004879b sext.w a5,s1 800038c6: fce7e1e3 bltu a5,a4,80003888 <ialloc+0x32> panic("ialloc: no inodes"); 800038ca: 00005517 auipc a0,0x5 800038ce: de650513 addi a0,a0,-538 # 800086b0 <syscalls+0x188> 800038d2: ffffd097 auipc ra,0xffffd 800038d6: c6c080e7 jalr -916(ra) # 8000053e <panic> memset(dip, 0, sizeof(*dip)); 800038da: 04000613 li a2,64 800038de: 4581 li a1,0 800038e0: 854e mv a0,s3 800038e2: ffffd097 auipc ra,0xffffd 800038e6: 3fe080e7 jalr 1022(ra) # 80000ce0 <memset> dip->type = type; 800038ea: 01799023 sh s7,0(s3) log_write(bp); // mark it allocated on the disk 800038ee: 854a mv a0,s2 800038f0: 00001097 auipc ra,0x1 800038f4: ca8080e7 jalr -856(ra) # 80004598 <log_write> brelse(bp); 800038f8: 854a mv a0,s2 800038fa: 00000097 auipc ra,0x0 800038fe: a22080e7 jalr -1502(ra) # 8000331c <brelse> return iget(dev, inum); 80003902: 85da mv a1,s6 80003904: 8556 mv a0,s5 80003906: 00000097 auipc ra,0x0 8000390a: db4080e7 jalr -588(ra) # 800036ba <iget> } 8000390e: 60a6 ld ra,72(sp) 80003910: 6406 ld s0,64(sp) 80003912: 74e2 ld s1,56(sp) 80003914: 7942 ld s2,48(sp) 80003916: 79a2 ld s3,40(sp) 80003918: 7a02 ld s4,32(sp) 8000391a: 6ae2 ld s5,24(sp) 8000391c: 6b42 ld s6,16(sp) 8000391e: 6ba2 ld s7,8(sp) 80003920: 6161 addi sp,sp,80 80003922: 8082 ret 0000000080003924 <iupdate>: { 80003924: 1101 addi sp,sp,-32 80003926: ec06 sd ra,24(sp) 80003928: e822 sd s0,16(sp) 8000392a: e426 sd s1,8(sp) 8000392c: e04a sd s2,0(sp) 8000392e: 1000 addi s0,sp,32 80003930: 84aa mv s1,a0 bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 80003932: 415c lw a5,4(a0) 80003934: 0047d79b srliw a5,a5,0x4 80003938: 0001d597 auipc a1,0x1d 8000393c: b885a583 lw a1,-1144(a1) # 800204c0 <sb+0x18> 80003940: 9dbd addw a1,a1,a5 80003942: 4108 lw a0,0(a0) 80003944: 00000097 auipc ra,0x0 80003948: 8a8080e7 jalr -1880(ra) # 800031ec <bread> 8000394c: 892a mv s2,a0 dip = (struct dinode*)bp->data + ip->inum%IPB; 8000394e: 05850793 addi a5,a0,88 80003952: 40c8 lw a0,4(s1) 80003954: 893d andi a0,a0,15 80003956: 051a slli a0,a0,0x6 80003958: 953e add a0,a0,a5 dip->type = ip->type; 8000395a: 04449703 lh a4,68(s1) 8000395e: 00e51023 sh a4,0(a0) dip->major = ip->major; 80003962: 04649703 lh a4,70(s1) 80003966: 00e51123 sh a4,2(a0) dip->minor = ip->minor; 8000396a: 04849703 lh a4,72(s1) 8000396e: 00e51223 sh a4,4(a0) dip->nlink = ip->nlink; 80003972: 04a49703 lh a4,74(s1) 80003976: 00e51323 sh a4,6(a0) dip->size = ip->size; 8000397a: 44f8 lw a4,76(s1) 8000397c: c518 sw a4,8(a0) memmove(dip->addrs, ip->addrs, sizeof(ip->addrs)); 8000397e: 03400613 li a2,52 80003982: 05048593 addi a1,s1,80 80003986: 0531 addi a0,a0,12 80003988: ffffd097 auipc ra,0xffffd 8000398c: 3b8080e7 jalr 952(ra) # 80000d40 <memmove> log_write(bp); 80003990: 854a mv a0,s2 80003992: 00001097 auipc ra,0x1 80003996: c06080e7 jalr -1018(ra) # 80004598 <log_write> brelse(bp); 8000399a: 854a mv a0,s2 8000399c: 00000097 auipc ra,0x0 800039a0: 980080e7 jalr -1664(ra) # 8000331c <brelse> } 800039a4: 60e2 ld ra,24(sp) 800039a6: 6442 ld s0,16(sp) 800039a8: 64a2 ld s1,8(sp) 800039aa: 6902 ld s2,0(sp) 800039ac: 6105 addi sp,sp,32 800039ae: 8082 ret 00000000800039b0 <idup>: { 800039b0: 1101 addi sp,sp,-32 800039b2: ec06 sd ra,24(sp) 800039b4: e822 sd s0,16(sp) 800039b6: e426 sd s1,8(sp) 800039b8: 1000 addi s0,sp,32 800039ba: 84aa mv s1,a0 acquire(&itable.lock); 800039bc: 0001d517 auipc a0,0x1d 800039c0: b0c50513 addi a0,a0,-1268 # 800204c8 <itable> 800039c4: ffffd097 auipc ra,0xffffd 800039c8: 220080e7 jalr 544(ra) # 80000be4 <acquire> ip->ref++; 800039cc: 449c lw a5,8(s1) 800039ce: 2785 addiw a5,a5,1 800039d0: c49c sw a5,8(s1) release(&itable.lock); 800039d2: 0001d517 auipc a0,0x1d 800039d6: af650513 addi a0,a0,-1290 # 800204c8 <itable> 800039da: ffffd097 auipc ra,0xffffd 800039de: 2be080e7 jalr 702(ra) # 80000c98 <release> } 800039e2: 8526 mv a0,s1 800039e4: 60e2 ld ra,24(sp) 800039e6: 6442 ld s0,16(sp) 800039e8: 64a2 ld s1,8(sp) 800039ea: 6105 addi sp,sp,32 800039ec: 8082 ret 00000000800039ee <ilock>: { 800039ee: 1101 addi sp,sp,-32 800039f0: ec06 sd ra,24(sp) 800039f2: e822 sd s0,16(sp) 800039f4: e426 sd s1,8(sp) 800039f6: e04a sd s2,0(sp) 800039f8: 1000 addi s0,sp,32 if(ip == 0 || ip->ref < 1) 800039fa: c115 beqz a0,80003a1e <ilock+0x30> 800039fc: 84aa mv s1,a0 800039fe: 451c lw a5,8(a0) 80003a00: 00f05f63 blez a5,80003a1e <ilock+0x30> acquiresleep(&ip->lock); 80003a04: 0541 addi a0,a0,16 80003a06: 00001097 auipc ra,0x1 80003a0a: cb2080e7 jalr -846(ra) # 800046b8 <acquiresleep> if(ip->valid == 0){ 80003a0e: 40bc lw a5,64(s1) 80003a10: cf99 beqz a5,80003a2e <ilock+0x40> } 80003a12: 60e2 ld ra,24(sp) 80003a14: 6442 ld s0,16(sp) 80003a16: 64a2 ld s1,8(sp) 80003a18: 6902 ld s2,0(sp) 80003a1a: 6105 addi sp,sp,32 80003a1c: 8082 ret panic("ilock"); 80003a1e: 00005517 auipc a0,0x5 80003a22: caa50513 addi a0,a0,-854 # 800086c8 <syscalls+0x1a0> 80003a26: ffffd097 auipc ra,0xffffd 80003a2a: b18080e7 jalr -1256(ra) # 8000053e <panic> bp = bread(ip->dev, IBLOCK(ip->inum, sb)); 80003a2e: 40dc lw a5,4(s1) 80003a30: 0047d79b srliw a5,a5,0x4 80003a34: 0001d597 auipc a1,0x1d 80003a38: a8c5a583 lw a1,-1396(a1) # 800204c0 <sb+0x18> 80003a3c: 9dbd addw a1,a1,a5 80003a3e: 4088 lw a0,0(s1) 80003a40: fffff097 auipc ra,0xfffff 80003a44: 7ac080e7 jalr 1964(ra) # 800031ec <bread> 80003a48: 892a mv s2,a0 dip = (struct dinode*)bp->data + ip->inum%IPB; 80003a4a: 05850593 addi a1,a0,88 80003a4e: 40dc lw a5,4(s1) 80003a50: 8bbd andi a5,a5,15 80003a52: 079a slli a5,a5,0x6 80003a54: 95be add a1,a1,a5 ip->type = dip->type; 80003a56: 00059783 lh a5,0(a1) 80003a5a: 04f49223 sh a5,68(s1) ip->major = dip->major; 80003a5e: 00259783 lh a5,2(a1) 80003a62: 04f49323 sh a5,70(s1) ip->minor = dip->minor; 80003a66: 00459783 lh a5,4(a1) 80003a6a: 04f49423 sh a5,72(s1) ip->nlink = dip->nlink; 80003a6e: 00659783 lh a5,6(a1) 80003a72: 04f49523 sh a5,74(s1) ip->size = dip->size; 80003a76: 459c lw a5,8(a1) 80003a78: c4fc sw a5,76(s1) memmove(ip->addrs, dip->addrs, sizeof(ip->addrs)); 80003a7a: 03400613 li a2,52 80003a7e: 05b1 addi a1,a1,12 80003a80: 05048513 addi a0,s1,80 80003a84: ffffd097 auipc ra,0xffffd 80003a88: 2bc080e7 jalr 700(ra) # 80000d40 <memmove> brelse(bp); 80003a8c: 854a mv a0,s2 80003a8e: 00000097 auipc ra,0x0 80003a92: 88e080e7 jalr -1906(ra) # 8000331c <brelse> ip->valid = 1; 80003a96: 4785 li a5,1 80003a98: c0bc sw a5,64(s1) if(ip->type == 0) 80003a9a: 04449783 lh a5,68(s1) 80003a9e: fbb5 bnez a5,80003a12 <ilock+0x24> panic("ilock: no type"); 80003aa0: 00005517 auipc a0,0x5 80003aa4: c3050513 addi a0,a0,-976 # 800086d0 <syscalls+0x1a8> 80003aa8: ffffd097 auipc ra,0xffffd 80003aac: a96080e7 jalr -1386(ra) # 8000053e <panic> 0000000080003ab0 <iunlock>: { 80003ab0: 1101 addi sp,sp,-32 80003ab2: ec06 sd ra,24(sp) 80003ab4: e822 sd s0,16(sp) 80003ab6: e426 sd s1,8(sp) 80003ab8: e04a sd s2,0(sp) 80003aba: 1000 addi s0,sp,32 if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1) 80003abc: c905 beqz a0,80003aec <iunlock+0x3c> 80003abe: 84aa mv s1,a0 80003ac0: 01050913 addi s2,a0,16 80003ac4: 854a mv a0,s2 80003ac6: 00001097 auipc ra,0x1 80003aca: c8c080e7 jalr -884(ra) # 80004752 <holdingsleep> 80003ace: cd19 beqz a0,80003aec <iunlock+0x3c> 80003ad0: 449c lw a5,8(s1) 80003ad2: 00f05d63 blez a5,80003aec <iunlock+0x3c> releasesleep(&ip->lock); 80003ad6: 854a mv a0,s2 80003ad8: 00001097 auipc ra,0x1 80003adc: c36080e7 jalr -970(ra) # 8000470e <releasesleep> } 80003ae0: 60e2 ld ra,24(sp) 80003ae2: 6442 ld s0,16(sp) 80003ae4: 64a2 ld s1,8(sp) 80003ae6: 6902 ld s2,0(sp) 80003ae8: 6105 addi sp,sp,32 80003aea: 8082 ret panic("iunlock"); 80003aec: 00005517 auipc a0,0x5 80003af0: bf450513 addi a0,a0,-1036 # 800086e0 <syscalls+0x1b8> 80003af4: ffffd097 auipc ra,0xffffd 80003af8: a4a080e7 jalr -1462(ra) # 8000053e <panic> 0000000080003afc <itrunc>: // Truncate inode (discard contents). // Caller must hold ip->lock. void itrunc(struct inode *ip) { 80003afc: 7179 addi sp,sp,-48 80003afe: f406 sd ra,40(sp) 80003b00: f022 sd s0,32(sp) 80003b02: ec26 sd s1,24(sp) 80003b04: e84a sd s2,16(sp) 80003b06: e44e sd s3,8(sp) 80003b08: e052 sd s4,0(sp) 80003b0a: 1800 addi s0,sp,48 80003b0c: 89aa mv s3,a0 int i, j; struct buf *bp; uint *a; for(i = 0; i < NDIRECT; i++){ 80003b0e: 05050493 addi s1,a0,80 80003b12: 08050913 addi s2,a0,128 80003b16: a021 j 80003b1e <itrunc+0x22> 80003b18: 0491 addi s1,s1,4 80003b1a: 01248d63 beq s1,s2,80003b34 <itrunc+0x38> if(ip->addrs[i]){ 80003b1e: 408c lw a1,0(s1) 80003b20: dde5 beqz a1,80003b18 <itrunc+0x1c> bfree(ip->dev, ip->addrs[i]); 80003b22: 0009a503 lw a0,0(s3) 80003b26: 00000097 auipc ra,0x0 80003b2a: 90c080e7 jalr -1780(ra) # 80003432 <bfree> ip->addrs[i] = 0; 80003b2e: 0004a023 sw zero,0(s1) 80003b32: b7dd j 80003b18 <itrunc+0x1c> } } if(ip->addrs[NDIRECT]){ 80003b34: 0809a583 lw a1,128(s3) 80003b38: e185 bnez a1,80003b58 <itrunc+0x5c> brelse(bp); bfree(ip->dev, ip->addrs[NDIRECT]); ip->addrs[NDIRECT] = 0; } ip->size = 0; 80003b3a: 0409a623 sw zero,76(s3) iupdate(ip); 80003b3e: 854e mv a0,s3 80003b40: 00000097 auipc ra,0x0 80003b44: de4080e7 jalr -540(ra) # 80003924 <iupdate> } 80003b48: 70a2 ld ra,40(sp) 80003b4a: 7402 ld s0,32(sp) 80003b4c: 64e2 ld s1,24(sp) 80003b4e: 6942 ld s2,16(sp) 80003b50: 69a2 ld s3,8(sp) 80003b52: 6a02 ld s4,0(sp) 80003b54: 6145 addi sp,sp,48 80003b56: 8082 ret bp = bread(ip->dev, ip->addrs[NDIRECT]); 80003b58: 0009a503 lw a0,0(s3) 80003b5c: fffff097 auipc ra,0xfffff 80003b60: 690080e7 jalr 1680(ra) # 800031ec <bread> 80003b64: 8a2a mv s4,a0 for(j = 0; j < NINDIRECT; j++){ 80003b66: 05850493 addi s1,a0,88 80003b6a: 45850913 addi s2,a0,1112 80003b6e: a811 j 80003b82 <itrunc+0x86> bfree(ip->dev, a[j]); 80003b70: 0009a503 lw a0,0(s3) 80003b74: 00000097 auipc ra,0x0 80003b78: 8be080e7 jalr -1858(ra) # 80003432 <bfree> for(j = 0; j < NINDIRECT; j++){ 80003b7c: 0491 addi s1,s1,4 80003b7e: 01248563 beq s1,s2,80003b88 <itrunc+0x8c> if(a[j]) 80003b82: 408c lw a1,0(s1) 80003b84: dde5 beqz a1,80003b7c <itrunc+0x80> 80003b86: b7ed j 80003b70 <itrunc+0x74> brelse(bp); 80003b88: 8552 mv a0,s4 80003b8a: fffff097 auipc ra,0xfffff 80003b8e: 792080e7 jalr 1938(ra) # 8000331c <brelse> bfree(ip->dev, ip->addrs[NDIRECT]); 80003b92: 0809a583 lw a1,128(s3) 80003b96: 0009a503 lw a0,0(s3) 80003b9a: 00000097 auipc ra,0x0 80003b9e: 898080e7 jalr -1896(ra) # 80003432 <bfree> ip->addrs[NDIRECT] = 0; 80003ba2: 0809a023 sw zero,128(s3) 80003ba6: bf51 j 80003b3a <itrunc+0x3e> 0000000080003ba8 <iput>: { 80003ba8: 1101 addi sp,sp,-32 80003baa: ec06 sd ra,24(sp) 80003bac: e822 sd s0,16(sp) 80003bae: e426 sd s1,8(sp) 80003bb0: e04a sd s2,0(sp) 80003bb2: 1000 addi s0,sp,32 80003bb4: 84aa mv s1,a0 acquire(&itable.lock); 80003bb6: 0001d517 auipc a0,0x1d 80003bba: 91250513 addi a0,a0,-1774 # 800204c8 <itable> 80003bbe: ffffd097 auipc ra,0xffffd 80003bc2: 026080e7 jalr 38(ra) # 80000be4 <acquire> if(ip->ref == 1 && ip->valid && ip->nlink == 0){ 80003bc6: 4498 lw a4,8(s1) 80003bc8: 4785 li a5,1 80003bca: 02f70363 beq a4,a5,80003bf0 <iput+0x48> ip->ref--; 80003bce: 449c lw a5,8(s1) 80003bd0: 37fd addiw a5,a5,-1 80003bd2: c49c sw a5,8(s1) release(&itable.lock); 80003bd4: 0001d517 auipc a0,0x1d 80003bd8: 8f450513 addi a0,a0,-1804 # 800204c8 <itable> 80003bdc: ffffd097 auipc ra,0xffffd 80003be0: 0bc080e7 jalr 188(ra) # 80000c98 <release> } 80003be4: 60e2 ld ra,24(sp) 80003be6: 6442 ld s0,16(sp) 80003be8: 64a2 ld s1,8(sp) 80003bea: 6902 ld s2,0(sp) 80003bec: 6105 addi sp,sp,32 80003bee: 8082 ret if(ip->ref == 1 && ip->valid && ip->nlink == 0){ 80003bf0: 40bc lw a5,64(s1) 80003bf2: dff1 beqz a5,80003bce <iput+0x26> 80003bf4: 04a49783 lh a5,74(s1) 80003bf8: fbf9 bnez a5,80003bce <iput+0x26> acquiresleep(&ip->lock); 80003bfa: 01048913 addi s2,s1,16 80003bfe: 854a mv a0,s2 80003c00: 00001097 auipc ra,0x1 80003c04: ab8080e7 jalr -1352(ra) # 800046b8 <acquiresleep> release(&itable.lock); 80003c08: 0001d517 auipc a0,0x1d 80003c0c: 8c050513 addi a0,a0,-1856 # 800204c8 <itable> 80003c10: ffffd097 auipc ra,0xffffd 80003c14: 088080e7 jalr 136(ra) # 80000c98 <release> itrunc(ip); 80003c18: 8526 mv a0,s1 80003c1a: 00000097 auipc ra,0x0 80003c1e: ee2080e7 jalr -286(ra) # 80003afc <itrunc> ip->type = 0; 80003c22: 04049223 sh zero,68(s1) iupdate(ip); 80003c26: 8526 mv a0,s1 80003c28: 00000097 auipc ra,0x0 80003c2c: cfc080e7 jalr -772(ra) # 80003924 <iupdate> ip->valid = 0; 80003c30: 0404a023 sw zero,64(s1) releasesleep(&ip->lock); 80003c34: 854a mv a0,s2 80003c36: 00001097 auipc ra,0x1 80003c3a: ad8080e7 jalr -1320(ra) # 8000470e <releasesleep> acquire(&itable.lock); 80003c3e: 0001d517 auipc a0,0x1d 80003c42: 88a50513 addi a0,a0,-1910 # 800204c8 <itable> 80003c46: ffffd097 auipc ra,0xffffd 80003c4a: f9e080e7 jalr -98(ra) # 80000be4 <acquire> 80003c4e: b741 j 80003bce <iput+0x26> 0000000080003c50 <iunlockput>: { 80003c50: 1101 addi sp,sp,-32 80003c52: ec06 sd ra,24(sp) 80003c54: e822 sd s0,16(sp) 80003c56: e426 sd s1,8(sp) 80003c58: 1000 addi s0,sp,32 80003c5a: 84aa mv s1,a0 iunlock(ip); 80003c5c: 00000097 auipc ra,0x0 80003c60: e54080e7 jalr -428(ra) # 80003ab0 <iunlock> iput(ip); 80003c64: 8526 mv a0,s1 80003c66: 00000097 auipc ra,0x0 80003c6a: f42080e7 jalr -190(ra) # 80003ba8 <iput> } 80003c6e: 60e2 ld ra,24(sp) 80003c70: 6442 ld s0,16(sp) 80003c72: 64a2 ld s1,8(sp) 80003c74: 6105 addi sp,sp,32 80003c76: 8082 ret 0000000080003c78 <stati>: // Copy stat information from inode. // Caller must hold ip->lock. void stati(struct inode *ip, struct stat *st) { 80003c78: 1141 addi sp,sp,-16 80003c7a: e422 sd s0,8(sp) 80003c7c: 0800 addi s0,sp,16 st->dev = ip->dev; 80003c7e: 411c lw a5,0(a0) 80003c80: c19c sw a5,0(a1) st->ino = ip->inum; 80003c82: 415c lw a5,4(a0) 80003c84: c1dc sw a5,4(a1) st->type = ip->type; 80003c86: 04451783 lh a5,68(a0) 80003c8a: 00f59423 sh a5,8(a1) st->nlink = ip->nlink; 80003c8e: 04a51783 lh a5,74(a0) 80003c92: 00f59523 sh a5,10(a1) st->size = ip->size; 80003c96: 04c56783 lwu a5,76(a0) 80003c9a: e99c sd a5,16(a1) } 80003c9c: 6422 ld s0,8(sp) 80003c9e: 0141 addi sp,sp,16 80003ca0: 8082 ret 0000000080003ca2 <readi>: readi(struct inode *ip, int user_dst, uint64 dst, uint off, uint n) { uint tot, m; struct buf *bp; if(off > ip->size || off + n < off) 80003ca2: 457c lw a5,76(a0) 80003ca4: 0ed7e963 bltu a5,a3,80003d96 <readi+0xf4> { 80003ca8: 7159 addi sp,sp,-112 80003caa: f486 sd ra,104(sp) 80003cac: f0a2 sd s0,96(sp) 80003cae: eca6 sd s1,88(sp) 80003cb0: e8ca sd s2,80(sp) 80003cb2: e4ce sd s3,72(sp) 80003cb4: e0d2 sd s4,64(sp) 80003cb6: fc56 sd s5,56(sp) 80003cb8: f85a sd s6,48(sp) 80003cba: f45e sd s7,40(sp) 80003cbc: f062 sd s8,32(sp) 80003cbe: ec66 sd s9,24(sp) 80003cc0: e86a sd s10,16(sp) 80003cc2: e46e sd s11,8(sp) 80003cc4: 1880 addi s0,sp,112 80003cc6: 8baa mv s7,a0 80003cc8: 8c2e mv s8,a1 80003cca: 8ab2 mv s5,a2 80003ccc: 84b6 mv s1,a3 80003cce: 8b3a mv s6,a4 if(off > ip->size || off + n < off) 80003cd0: 9f35 addw a4,a4,a3 return 0; 80003cd2: 4501 li a0,0 if(off > ip->size || off + n < off) 80003cd4: 0ad76063 bltu a4,a3,80003d74 <readi+0xd2> if(off + n > ip->size) 80003cd8: 00e7f463 bgeu a5,a4,80003ce0 <readi+0x3e> n = ip->size - off; 80003cdc: 40d78b3b subw s6,a5,a3 for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80003ce0: 0a0b0963 beqz s6,80003d92 <readi+0xf0> 80003ce4: 4981 li s3,0 bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); 80003ce6: 40000d13 li s10,1024 if(either_copyout(user_dst, dst, bp->data + (off % BSIZE), m) == -1) { 80003cea: 5cfd li s9,-1 80003cec: a82d j 80003d26 <readi+0x84> 80003cee: 020a1d93 slli s11,s4,0x20 80003cf2: 020ddd93 srli s11,s11,0x20 80003cf6: 05890613 addi a2,s2,88 80003cfa: 86ee mv a3,s11 80003cfc: 963a add a2,a2,a4 80003cfe: 85d6 mv a1,s5 80003d00: 8562 mv a0,s8 80003d02: ffffe097 auipc ra,0xffffe 80003d06: 71c080e7 jalr 1820(ra) # 8000241e <either_copyout> 80003d0a: 05950d63 beq a0,s9,80003d64 <readi+0xc2> brelse(bp); tot = -1; break; } brelse(bp); 80003d0e: 854a mv a0,s2 80003d10: fffff097 auipc ra,0xfffff 80003d14: 60c080e7 jalr 1548(ra) # 8000331c <brelse> for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80003d18: 013a09bb addw s3,s4,s3 80003d1c: 009a04bb addw s1,s4,s1 80003d20: 9aee add s5,s5,s11 80003d22: 0569f763 bgeu s3,s6,80003d70 <readi+0xce> bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80003d26: 000ba903 lw s2,0(s7) 80003d2a: 00a4d59b srliw a1,s1,0xa 80003d2e: 855e mv a0,s7 80003d30: 00000097 auipc ra,0x0 80003d34: 8b0080e7 jalr -1872(ra) # 800035e0 <bmap> 80003d38: 0005059b sext.w a1,a0 80003d3c: 854a mv a0,s2 80003d3e: fffff097 auipc ra,0xfffff 80003d42: 4ae080e7 jalr 1198(ra) # 800031ec <bread> 80003d46: 892a mv s2,a0 m = min(n - tot, BSIZE - off%BSIZE); 80003d48: 3ff4f713 andi a4,s1,1023 80003d4c: 40ed07bb subw a5,s10,a4 80003d50: 413b06bb subw a3,s6,s3 80003d54: 8a3e mv s4,a5 80003d56: 2781 sext.w a5,a5 80003d58: 0006861b sext.w a2,a3 80003d5c: f8f679e3 bgeu a2,a5,80003cee <readi+0x4c> 80003d60: 8a36 mv s4,a3 80003d62: b771 j 80003cee <readi+0x4c> brelse(bp); 80003d64: 854a mv a0,s2 80003d66: fffff097 auipc ra,0xfffff 80003d6a: 5b6080e7 jalr 1462(ra) # 8000331c <brelse> tot = -1; 80003d6e: 59fd li s3,-1 } return tot; 80003d70: 0009851b sext.w a0,s3 } 80003d74: 70a6 ld ra,104(sp) 80003d76: 7406 ld s0,96(sp) 80003d78: 64e6 ld s1,88(sp) 80003d7a: 6946 ld s2,80(sp) 80003d7c: 69a6 ld s3,72(sp) 80003d7e: 6a06 ld s4,64(sp) 80003d80: 7ae2 ld s5,56(sp) 80003d82: 7b42 ld s6,48(sp) 80003d84: 7ba2 ld s7,40(sp) 80003d86: 7c02 ld s8,32(sp) 80003d88: 6ce2 ld s9,24(sp) 80003d8a: 6d42 ld s10,16(sp) 80003d8c: 6da2 ld s11,8(sp) 80003d8e: 6165 addi sp,sp,112 80003d90: 8082 ret for(tot=0; tot<n; tot+=m, off+=m, dst+=m){ 80003d92: 89da mv s3,s6 80003d94: bff1 j 80003d70 <readi+0xce> return 0; 80003d96: 4501 li a0,0 } 80003d98: 8082 ret 0000000080003d9a <writei>: writei(struct inode *ip, int user_src, uint64 src, uint off, uint n) { uint tot, m; struct buf *bp; if(off > ip->size || off + n < off) 80003d9a: 457c lw a5,76(a0) 80003d9c: 10d7e863 bltu a5,a3,80003eac <writei+0x112> { 80003da0: 7159 addi sp,sp,-112 80003da2: f486 sd ra,104(sp) 80003da4: f0a2 sd s0,96(sp) 80003da6: eca6 sd s1,88(sp) 80003da8: e8ca sd s2,80(sp) 80003daa: e4ce sd s3,72(sp) 80003dac: e0d2 sd s4,64(sp) 80003dae: fc56 sd s5,56(sp) 80003db0: f85a sd s6,48(sp) 80003db2: f45e sd s7,40(sp) 80003db4: f062 sd s8,32(sp) 80003db6: ec66 sd s9,24(sp) 80003db8: e86a sd s10,16(sp) 80003dba: e46e sd s11,8(sp) 80003dbc: 1880 addi s0,sp,112 80003dbe: 8b2a mv s6,a0 80003dc0: 8c2e mv s8,a1 80003dc2: 8ab2 mv s5,a2 80003dc4: 8936 mv s2,a3 80003dc6: 8bba mv s7,a4 if(off > ip->size || off + n < off) 80003dc8: 00e687bb addw a5,a3,a4 80003dcc: 0ed7e263 bltu a5,a3,80003eb0 <writei+0x116> return -1; if(off + n > MAXFILE*BSIZE) 80003dd0: 00043737 lui a4,0x43 80003dd4: 0ef76063 bltu a4,a5,80003eb4 <writei+0x11a> return -1; for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80003dd8: 0c0b8863 beqz s7,80003ea8 <writei+0x10e> 80003ddc: 4a01 li s4,0 bp = bread(ip->dev, bmap(ip, off/BSIZE)); m = min(n - tot, BSIZE - off%BSIZE); 80003dde: 40000d13 li s10,1024 if(either_copyin(bp->data + (off % BSIZE), user_src, src, m) == -1) { 80003de2: 5cfd li s9,-1 80003de4: a091 j 80003e28 <writei+0x8e> 80003de6: 02099d93 slli s11,s3,0x20 80003dea: 020ddd93 srli s11,s11,0x20 80003dee: 05848513 addi a0,s1,88 80003df2: 86ee mv a3,s11 80003df4: 8656 mv a2,s5 80003df6: 85e2 mv a1,s8 80003df8: 953a add a0,a0,a4 80003dfa: ffffe097 auipc ra,0xffffe 80003dfe: 67a080e7 jalr 1658(ra) # 80002474 <either_copyin> 80003e02: 07950263 beq a0,s9,80003e66 <writei+0xcc> brelse(bp); break; } log_write(bp); 80003e06: 8526 mv a0,s1 80003e08: 00000097 auipc ra,0x0 80003e0c: 790080e7 jalr 1936(ra) # 80004598 <log_write> brelse(bp); 80003e10: 8526 mv a0,s1 80003e12: fffff097 auipc ra,0xfffff 80003e16: 50a080e7 jalr 1290(ra) # 8000331c <brelse> for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80003e1a: 01498a3b addw s4,s3,s4 80003e1e: 0129893b addw s2,s3,s2 80003e22: 9aee add s5,s5,s11 80003e24: 057a7663 bgeu s4,s7,80003e70 <writei+0xd6> bp = bread(ip->dev, bmap(ip, off/BSIZE)); 80003e28: 000b2483 lw s1,0(s6) 80003e2c: 00a9559b srliw a1,s2,0xa 80003e30: 855a mv a0,s6 80003e32: fffff097 auipc ra,0xfffff 80003e36: 7ae080e7 jalr 1966(ra) # 800035e0 <bmap> 80003e3a: 0005059b sext.w a1,a0 80003e3e: 8526 mv a0,s1 80003e40: fffff097 auipc ra,0xfffff 80003e44: 3ac080e7 jalr 940(ra) # 800031ec <bread> 80003e48: 84aa mv s1,a0 m = min(n - tot, BSIZE - off%BSIZE); 80003e4a: 3ff97713 andi a4,s2,1023 80003e4e: 40ed07bb subw a5,s10,a4 80003e52: 414b86bb subw a3,s7,s4 80003e56: 89be mv s3,a5 80003e58: 2781 sext.w a5,a5 80003e5a: 0006861b sext.w a2,a3 80003e5e: f8f674e3 bgeu a2,a5,80003de6 <writei+0x4c> 80003e62: 89b6 mv s3,a3 80003e64: b749 j 80003de6 <writei+0x4c> brelse(bp); 80003e66: 8526 mv a0,s1 80003e68: fffff097 auipc ra,0xfffff 80003e6c: 4b4080e7 jalr 1204(ra) # 8000331c <brelse> } if(off > ip->size) 80003e70: 04cb2783 lw a5,76(s6) 80003e74: 0127f463 bgeu a5,s2,80003e7c <writei+0xe2> ip->size = off; 80003e78: 052b2623 sw s2,76(s6) // write the i-node back to disk even if the size didn't change // because the loop above might have called bmap() and added a new // block to ip->addrs[]. iupdate(ip); 80003e7c: 855a mv a0,s6 80003e7e: 00000097 auipc ra,0x0 80003e82: aa6080e7 jalr -1370(ra) # 80003924 <iupdate> return tot; 80003e86: 000a051b sext.w a0,s4 } 80003e8a: 70a6 ld ra,104(sp) 80003e8c: 7406 ld s0,96(sp) 80003e8e: 64e6 ld s1,88(sp) 80003e90: 6946 ld s2,80(sp) 80003e92: 69a6 ld s3,72(sp) 80003e94: 6a06 ld s4,64(sp) 80003e96: 7ae2 ld s5,56(sp) 80003e98: 7b42 ld s6,48(sp) 80003e9a: 7ba2 ld s7,40(sp) 80003e9c: 7c02 ld s8,32(sp) 80003e9e: 6ce2 ld s9,24(sp) 80003ea0: 6d42 ld s10,16(sp) 80003ea2: 6da2 ld s11,8(sp) 80003ea4: 6165 addi sp,sp,112 80003ea6: 8082 ret for(tot=0; tot<n; tot+=m, off+=m, src+=m){ 80003ea8: 8a5e mv s4,s7 80003eaa: bfc9 j 80003e7c <writei+0xe2> return -1; 80003eac: 557d li a0,-1 } 80003eae: 8082 ret return -1; 80003eb0: 557d li a0,-1 80003eb2: bfe1 j 80003e8a <writei+0xf0> return -1; 80003eb4: 557d li a0,-1 80003eb6: bfd1 j 80003e8a <writei+0xf0> 0000000080003eb8 <namecmp>: // Directories int namecmp(const char *s, const char *t) { 80003eb8: 1141 addi sp,sp,-16 80003eba: e406 sd ra,8(sp) 80003ebc: e022 sd s0,0(sp) 80003ebe: 0800 addi s0,sp,16 return strncmp(s, t, DIRSIZ); 80003ec0: 4639 li a2,14 80003ec2: ffffd097 auipc ra,0xffffd 80003ec6: ef6080e7 jalr -266(ra) # 80000db8 <strncmp> } 80003eca: 60a2 ld ra,8(sp) 80003ecc: 6402 ld s0,0(sp) 80003ece: 0141 addi sp,sp,16 80003ed0: 8082 ret 0000000080003ed2 <dirlookup>: // Look for a directory entry in a directory. // If found, set *poff to byte offset of entry. struct inode* dirlookup(struct inode *dp, char *name, uint *poff) { 80003ed2: 7139 addi sp,sp,-64 80003ed4: fc06 sd ra,56(sp) 80003ed6: f822 sd s0,48(sp) 80003ed8: f426 sd s1,40(sp) 80003eda: f04a sd s2,32(sp) 80003edc: ec4e sd s3,24(sp) 80003ede: e852 sd s4,16(sp) 80003ee0: 0080 addi s0,sp,64 uint off, inum; struct dirent de; if(dp->type != T_DIR) 80003ee2: 04451703 lh a4,68(a0) 80003ee6: 4785 li a5,1 80003ee8: 00f71a63 bne a4,a5,80003efc <dirlookup+0x2a> 80003eec: 892a mv s2,a0 80003eee: 89ae mv s3,a1 80003ef0: 8a32 mv s4,a2 panic("dirlookup not DIR"); for(off = 0; off < dp->size; off += sizeof(de)){ 80003ef2: 457c lw a5,76(a0) 80003ef4: 4481 li s1,0 inum = de.inum; return iget(dp->dev, inum); } } return 0; 80003ef6: 4501 li a0,0 for(off = 0; off < dp->size; off += sizeof(de)){ 80003ef8: e79d bnez a5,80003f26 <dirlookup+0x54> 80003efa: a8a5 j 80003f72 <dirlookup+0xa0> panic("dirlookup not DIR"); 80003efc: 00004517 auipc a0,0x4 80003f00: 7ec50513 addi a0,a0,2028 # 800086e8 <syscalls+0x1c0> 80003f04: ffffc097 auipc ra,0xffffc 80003f08: 63a080e7 jalr 1594(ra) # 8000053e <panic> panic("dirlookup read"); 80003f0c: 00004517 auipc a0,0x4 80003f10: 7f450513 addi a0,a0,2036 # 80008700 <syscalls+0x1d8> 80003f14: ffffc097 auipc ra,0xffffc 80003f18: 62a080e7 jalr 1578(ra) # 8000053e <panic> for(off = 0; off < dp->size; off += sizeof(de)){ 80003f1c: 24c1 addiw s1,s1,16 80003f1e: 04c92783 lw a5,76(s2) 80003f22: 04f4f763 bgeu s1,a5,80003f70 <dirlookup+0x9e> if(readi(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de)) 80003f26: 4741 li a4,16 80003f28: 86a6 mv a3,s1 80003f2a: fc040613 addi a2,s0,-64 80003f2e: 4581 li a1,0 80003f30: 854a mv a0,s2 80003f32: 00000097 auipc ra,0x0 80003f36: d70080e7 jalr -656(ra) # 80003ca2 <readi> 80003f3a: 47c1 li a5,16 80003f3c: fcf518e3 bne a0,a5,80003f0c <dirlookup+0x3a> if(de.inum == 0) 80003f40: fc045783 lhu a5,-64(s0) 80003f44: dfe1 beqz a5,80003f1c <dirlookup+0x4a> if(namecmp(name, de.name) == 0){ 80003f46: fc240593 addi a1,s0,-62 80003f4a: 854e mv a0,s3 80003f4c: 00000097 auipc ra,0x0 80003f50: f6c080e7 jalr -148(ra) # 80003eb8 <namecmp> 80003f54: f561 bnez a0,80003f1c <dirlookup+0x4a> if(poff) 80003f56: 000a0463 beqz s4,80003f5e <dirlookup+0x8c> *poff = off; 80003f5a: 009a2023 sw s1,0(s4) return iget(dp->dev, inum); 80003f5e: fc045583 lhu a1,-64(s0) 80003f62: 00092503 lw a0,0(s2) 80003f66: fffff097 auipc ra,0xfffff 80003f6a: 754080e7 jalr 1876(ra) # 800036ba <iget> 80003f6e: a011 j 80003f72 <dirlookup+0xa0> return 0; 80003f70: 4501 li a0,0 } 80003f72: 70e2 ld ra,56(sp) 80003f74: 7442 ld s0,48(sp) 80003f76: 74a2 ld s1,40(sp) 80003f78: 7902 ld s2,32(sp) 80003f7a: 69e2 ld s3,24(sp) 80003f7c: 6a42 ld s4,16(sp) 80003f7e: 6121 addi sp,sp,64 80003f80: 8082 ret 0000000080003f82 <namex>: // If parent != 0, return the inode for the parent and copy the final // path element into name, which must have room for DIRSIZ bytes. // Must be called inside a transaction since it calls iput(). static struct inode* namex(char *path, int nameiparent, char *name) { 80003f82: 711d addi sp,sp,-96 80003f84: ec86 sd ra,88(sp) 80003f86: e8a2 sd s0,80(sp) 80003f88: e4a6 sd s1,72(sp) 80003f8a: e0ca sd s2,64(sp) 80003f8c: fc4e sd s3,56(sp) 80003f8e: f852 sd s4,48(sp) 80003f90: f456 sd s5,40(sp) 80003f92: f05a sd s6,32(sp) 80003f94: ec5e sd s7,24(sp) 80003f96: e862 sd s8,16(sp) 80003f98: e466 sd s9,8(sp) 80003f9a: 1080 addi s0,sp,96 80003f9c: 84aa mv s1,a0 80003f9e: 8b2e mv s6,a1 80003fa0: 8ab2 mv s5,a2 struct inode *ip, *next; if(*path == '/') 80003fa2: 00054703 lbu a4,0(a0) 80003fa6: 02f00793 li a5,47 80003faa: 02f70363 beq a4,a5,80003fd0 <namex+0x4e> ip = iget(ROOTDEV, ROOTINO); else ip = idup(myproc()->cwd); 80003fae: ffffe097 auipc ra,0xffffe 80003fb2: a08080e7 jalr -1528(ra) # 800019b6 <myproc> 80003fb6: 15053503 ld a0,336(a0) 80003fba: 00000097 auipc ra,0x0 80003fbe: 9f6080e7 jalr -1546(ra) # 800039b0 <idup> 80003fc2: 89aa mv s3,a0 while(*path == '/') 80003fc4: 02f00913 li s2,47 len = path - s; 80003fc8: 4b81 li s7,0 if(len >= DIRSIZ) 80003fca: 4cb5 li s9,13 while((path = skipelem(path, name)) != 0){ ilock(ip); if(ip->type != T_DIR){ 80003fcc: 4c05 li s8,1 80003fce: a865 j 80004086 <namex+0x104> ip = iget(ROOTDEV, ROOTINO); 80003fd0: 4585 li a1,1 80003fd2: 4505 li a0,1 80003fd4: fffff097 auipc ra,0xfffff 80003fd8: 6e6080e7 jalr 1766(ra) # 800036ba <iget> 80003fdc: 89aa mv s3,a0 80003fde: b7dd j 80003fc4 <namex+0x42> iunlockput(ip); 80003fe0: 854e mv a0,s3 80003fe2: 00000097 auipc ra,0x0 80003fe6: c6e080e7 jalr -914(ra) # 80003c50 <iunlockput> return 0; 80003fea: 4981 li s3,0 if(nameiparent){ iput(ip); return 0; } return ip; } 80003fec: 854e mv a0,s3 80003fee: 60e6 ld ra,88(sp) 80003ff0: 6446 ld s0,80(sp) 80003ff2: 64a6 ld s1,72(sp) 80003ff4: 6906 ld s2,64(sp) 80003ff6: 79e2 ld s3,56(sp) 80003ff8: 7a42 ld s4,48(sp) 80003ffa: 7aa2 ld s5,40(sp) 80003ffc: 7b02 ld s6,32(sp) 80003ffe: 6be2 ld s7,24(sp) 80004000: 6c42 ld s8,16(sp) 80004002: 6ca2 ld s9,8(sp) 80004004: 6125 addi sp,sp,96 80004006: 8082 ret iunlock(ip); 80004008: 854e mv a0,s3 8000400a: 00000097 auipc ra,0x0 8000400e: aa6080e7 jalr -1370(ra) # 80003ab0 <iunlock> return ip; 80004012: bfe9 j 80003fec <namex+0x6a> iunlockput(ip); 80004014: 854e mv a0,s3 80004016: 00000097 auipc ra,0x0 8000401a: c3a080e7 jalr -966(ra) # 80003c50 <iunlockput> return 0; 8000401e: 89d2 mv s3,s4 80004020: b7f1 j 80003fec <namex+0x6a> len = path - s; 80004022: 40b48633 sub a2,s1,a1 80004026: 00060a1b sext.w s4,a2 if(len >= DIRSIZ) 8000402a: 094cd463 bge s9,s4,800040b2 <namex+0x130> memmove(name, s, DIRSIZ); 8000402e: 4639 li a2,14 80004030: 8556 mv a0,s5 80004032: ffffd097 auipc ra,0xffffd 80004036: d0e080e7 jalr -754(ra) # 80000d40 <memmove> while(*path == '/') 8000403a: 0004c783 lbu a5,0(s1) 8000403e: 01279763 bne a5,s2,8000404c <namex+0xca> path++; 80004042: 0485 addi s1,s1,1 while(*path == '/') 80004044: 0004c783 lbu a5,0(s1) 80004048: ff278de3 beq a5,s2,80004042 <namex+0xc0> ilock(ip); 8000404c: 854e mv a0,s3 8000404e: 00000097 auipc ra,0x0 80004052: 9a0080e7 jalr -1632(ra) # 800039ee <ilock> if(ip->type != T_DIR){ 80004056: 04499783 lh a5,68(s3) 8000405a: f98793e3 bne a5,s8,80003fe0 <namex+0x5e> if(nameiparent && *path == '\0'){ 8000405e: 000b0563 beqz s6,80004068 <namex+0xe6> 80004062: 0004c783 lbu a5,0(s1) 80004066: d3cd beqz a5,80004008 <namex+0x86> if((next = dirlookup(ip, name, 0)) == 0){ 80004068: 865e mv a2,s7 8000406a: 85d6 mv a1,s5 8000406c: 854e mv a0,s3 8000406e: 00000097 auipc ra,0x0 80004072: e64080e7 jalr -412(ra) # 80003ed2 <dirlookup> 80004076: 8a2a mv s4,a0 80004078: dd51 beqz a0,80004014 <namex+0x92> iunlockput(ip); 8000407a: 854e mv a0,s3 8000407c: 00000097 auipc ra,0x0 80004080: bd4080e7 jalr -1068(ra) # 80003c50 <iunlockput> ip = next; 80004084: 89d2 mv s3,s4 while(*path == '/') 80004086: 0004c783 lbu a5,0(s1) 8000408a: 05279763 bne a5,s2,800040d8 <namex+0x156> path++; 8000408e: 0485 addi s1,s1,1 while(*path == '/') 80004090: 0004c783 lbu a5,0(s1) 80004094: ff278de3 beq a5,s2,8000408e <namex+0x10c> if(*path == 0) 80004098: c79d beqz a5,800040c6 <namex+0x144> path++; 8000409a: 85a6 mv a1,s1 len = path - s; 8000409c: 8a5e mv s4,s7 8000409e: 865e mv a2,s7 while(*path != '/' && *path != 0) 800040a0: 01278963 beq a5,s2,800040b2 <namex+0x130> 800040a4: dfbd beqz a5,80004022 <namex+0xa0> path++; 800040a6: 0485 addi s1,s1,1 while(*path != '/' && *path != 0) 800040a8: 0004c783 lbu a5,0(s1) 800040ac: ff279ce3 bne a5,s2,800040a4 <namex+0x122> 800040b0: bf8d j 80004022 <namex+0xa0> memmove(name, s, len); 800040b2: 2601 sext.w a2,a2 800040b4: 8556 mv a0,s5 800040b6: ffffd097 auipc ra,0xffffd 800040ba: c8a080e7 jalr -886(ra) # 80000d40 <memmove> name[len] = 0; 800040be: 9a56 add s4,s4,s5 800040c0: 000a0023 sb zero,0(s4) 800040c4: bf9d j 8000403a <namex+0xb8> if(nameiparent){ 800040c6: f20b03e3 beqz s6,80003fec <namex+0x6a> iput(ip); 800040ca: 854e mv a0,s3 800040cc: 00000097 auipc ra,0x0 800040d0: adc080e7 jalr -1316(ra) # 80003ba8 <iput> return 0; 800040d4: 4981 li s3,0 800040d6: bf19 j 80003fec <namex+0x6a> if(*path == 0) 800040d8: d7fd beqz a5,800040c6 <namex+0x144> while(*path != '/' && *path != 0) 800040da: 0004c783 lbu a5,0(s1) 800040de: 85a6 mv a1,s1 800040e0: b7d1 j 800040a4 <namex+0x122> 00000000800040e2 <dirlink>: { 800040e2: 7139 addi sp,sp,-64 800040e4: fc06 sd ra,56(sp) 800040e6: f822 sd s0,48(sp) 800040e8: f426 sd s1,40(sp) 800040ea: f04a sd s2,32(sp) 800040ec: ec4e sd s3,24(sp) 800040ee: e852 sd s4,16(sp) 800040f0: 0080 addi s0,sp,64 800040f2: 892a mv s2,a0 800040f4: 8a2e mv s4,a1 800040f6: 89b2 mv s3,a2 if((ip = dirlookup(dp, name, 0)) != 0){ 800040f8: 4601 li a2,0 800040fa: 00000097 auipc ra,0x0 800040fe: dd8080e7 jalr -552(ra) # 80003ed2 <dirlookup> 80004102: e93d bnez a0,80004178 <dirlink+0x96> for(off = 0; off < dp->size; off += sizeof(de)){ 80004104: 04c92483 lw s1,76(s2) 80004108: c49d beqz s1,80004136 <dirlink+0x54> 8000410a: 4481 li s1,0 if(readi(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de)) 8000410c: 4741 li a4,16 8000410e: 86a6 mv a3,s1 80004110: fc040613 addi a2,s0,-64 80004114: 4581 li a1,0 80004116: 854a mv a0,s2 80004118: 00000097 auipc ra,0x0 8000411c: b8a080e7 jalr -1142(ra) # 80003ca2 <readi> 80004120: 47c1 li a5,16 80004122: 06f51163 bne a0,a5,80004184 <dirlink+0xa2> if(de.inum == 0) 80004126: fc045783 lhu a5,-64(s0) 8000412a: c791 beqz a5,80004136 <dirlink+0x54> for(off = 0; off < dp->size; off += sizeof(de)){ 8000412c: 24c1 addiw s1,s1,16 8000412e: 04c92783 lw a5,76(s2) 80004132: fcf4ede3 bltu s1,a5,8000410c <dirlink+0x2a> strncpy(de.name, name, DIRSIZ); 80004136: 4639 li a2,14 80004138: 85d2 mv a1,s4 8000413a: fc240513 addi a0,s0,-62 8000413e: ffffd097 auipc ra,0xffffd 80004142: cb6080e7 jalr -842(ra) # 80000df4 <strncpy> de.inum = inum; 80004146: fd341023 sh s3,-64(s0) if(writei(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de)) 8000414a: 4741 li a4,16 8000414c: 86a6 mv a3,s1 8000414e: fc040613 addi a2,s0,-64 80004152: 4581 li a1,0 80004154: 854a mv a0,s2 80004156: 00000097 auipc ra,0x0 8000415a: c44080e7 jalr -956(ra) # 80003d9a <writei> 8000415e: 872a mv a4,a0 80004160: 47c1 li a5,16 return 0; 80004162: 4501 li a0,0 if(writei(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de)) 80004164: 02f71863 bne a4,a5,80004194 <dirlink+0xb2> } 80004168: 70e2 ld ra,56(sp) 8000416a: 7442 ld s0,48(sp) 8000416c: 74a2 ld s1,40(sp) 8000416e: 7902 ld s2,32(sp) 80004170: 69e2 ld s3,24(sp) 80004172: 6a42 ld s4,16(sp) 80004174: 6121 addi sp,sp,64 80004176: 8082 ret iput(ip); 80004178: 00000097 auipc ra,0x0 8000417c: a30080e7 jalr -1488(ra) # 80003ba8 <iput> return -1; 80004180: 557d li a0,-1 80004182: b7dd j 80004168 <dirlink+0x86> panic("dirlink read"); 80004184: 00004517 auipc a0,0x4 80004188: 58c50513 addi a0,a0,1420 # 80008710 <syscalls+0x1e8> 8000418c: ffffc097 auipc ra,0xffffc 80004190: 3b2080e7 jalr 946(ra) # 8000053e <panic> panic("dirlink"); 80004194: 00004517 auipc a0,0x4 80004198: 68c50513 addi a0,a0,1676 # 80008820 <syscalls+0x2f8> 8000419c: ffffc097 auipc ra,0xffffc 800041a0: 3a2080e7 jalr 930(ra) # 8000053e <panic> 00000000800041a4 <namei>: struct inode* namei(char *path) { 800041a4: 1101 addi sp,sp,-32 800041a6: ec06 sd ra,24(sp) 800041a8: e822 sd s0,16(sp) 800041aa: 1000 addi s0,sp,32 char name[DIRSIZ]; return namex(path, 0, name); 800041ac: fe040613 addi a2,s0,-32 800041b0: 4581 li a1,0 800041b2: 00000097 auipc ra,0x0 800041b6: dd0080e7 jalr -560(ra) # 80003f82 <namex> } 800041ba: 60e2 ld ra,24(sp) 800041bc: 6442 ld s0,16(sp) 800041be: 6105 addi sp,sp,32 800041c0: 8082 ret 00000000800041c2 <nameiparent>: struct inode* nameiparent(char *path, char *name) { 800041c2: 1141 addi sp,sp,-16 800041c4: e406 sd ra,8(sp) 800041c6: e022 sd s0,0(sp) 800041c8: 0800 addi s0,sp,16 800041ca: 862e mv a2,a1 return namex(path, 1, name); 800041cc: 4585 li a1,1 800041ce: 00000097 auipc ra,0x0 800041d2: db4080e7 jalr -588(ra) # 80003f82 <namex> } 800041d6: 60a2 ld ra,8(sp) 800041d8: 6402 ld s0,0(sp) 800041da: 0141 addi sp,sp,16 800041dc: 8082 ret 00000000800041de <write_head>: // Write in-memory log header to disk. // This is the true point at which the // current transaction commits. static void write_head(void) { 800041de: 1101 addi sp,sp,-32 800041e0: ec06 sd ra,24(sp) 800041e2: e822 sd s0,16(sp) 800041e4: e426 sd s1,8(sp) 800041e6: e04a sd s2,0(sp) 800041e8: 1000 addi s0,sp,32 struct buf *buf = bread(log.dev, log.start); 800041ea: 0001e917 auipc s2,0x1e 800041ee: d8690913 addi s2,s2,-634 # 80021f70 <log> 800041f2: 01892583 lw a1,24(s2) 800041f6: 02892503 lw a0,40(s2) 800041fa: fffff097 auipc ra,0xfffff 800041fe: ff2080e7 jalr -14(ra) # 800031ec <bread> 80004202: 84aa mv s1,a0 struct logheader *hb = (struct logheader *) (buf->data); int i; hb->n = log.lh.n; 80004204: 02c92683 lw a3,44(s2) 80004208: cd34 sw a3,88(a0) for (i = 0; i < log.lh.n; i++) { 8000420a: 02d05763 blez a3,80004238 <write_head+0x5a> 8000420e: 0001e797 auipc a5,0x1e 80004212: d9278793 addi a5,a5,-622 # 80021fa0 <log+0x30> 80004216: 05c50713 addi a4,a0,92 8000421a: 36fd addiw a3,a3,-1 8000421c: 1682 slli a3,a3,0x20 8000421e: 9281 srli a3,a3,0x20 80004220: 068a slli a3,a3,0x2 80004222: 0001e617 auipc a2,0x1e 80004226: d8260613 addi a2,a2,-638 # 80021fa4 <log+0x34> 8000422a: 96b2 add a3,a3,a2 hb->block[i] = log.lh.block[i]; 8000422c: 4390 lw a2,0(a5) 8000422e: c310 sw a2,0(a4) for (i = 0; i < log.lh.n; i++) { 80004230: 0791 addi a5,a5,4 80004232: 0711 addi a4,a4,4 80004234: fed79ce3 bne a5,a3,8000422c <write_head+0x4e> } bwrite(buf); 80004238: 8526 mv a0,s1 8000423a: fffff097 auipc ra,0xfffff 8000423e: 0a4080e7 jalr 164(ra) # 800032de <bwrite> brelse(buf); 80004242: 8526 mv a0,s1 80004244: fffff097 auipc ra,0xfffff 80004248: 0d8080e7 jalr 216(ra) # 8000331c <brelse> } 8000424c: 60e2 ld ra,24(sp) 8000424e: 6442 ld s0,16(sp) 80004250: 64a2 ld s1,8(sp) 80004252: 6902 ld s2,0(sp) 80004254: 6105 addi sp,sp,32 80004256: 8082 ret 0000000080004258 <install_trans>: for (tail = 0; tail < log.lh.n; tail++) { 80004258: 0001e797 auipc a5,0x1e 8000425c: d447a783 lw a5,-700(a5) # 80021f9c <log+0x2c> 80004260: 0af05d63 blez a5,8000431a <install_trans+0xc2> { 80004264: 7139 addi sp,sp,-64 80004266: fc06 sd ra,56(sp) 80004268: f822 sd s0,48(sp) 8000426a: f426 sd s1,40(sp) 8000426c: f04a sd s2,32(sp) 8000426e: ec4e sd s3,24(sp) 80004270: e852 sd s4,16(sp) 80004272: e456 sd s5,8(sp) 80004274: e05a sd s6,0(sp) 80004276: 0080 addi s0,sp,64 80004278: 8b2a mv s6,a0 8000427a: 0001ea97 auipc s5,0x1e 8000427e: d26a8a93 addi s5,s5,-730 # 80021fa0 <log+0x30> for (tail = 0; tail < log.lh.n; tail++) { 80004282: 4a01 li s4,0 struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block 80004284: 0001e997 auipc s3,0x1e 80004288: cec98993 addi s3,s3,-788 # 80021f70 <log> 8000428c: a035 j 800042b8 <install_trans+0x60> bunpin(dbuf); 8000428e: 8526 mv a0,s1 80004290: fffff097 auipc ra,0xfffff 80004294: 166080e7 jalr 358(ra) # 800033f6 <bunpin> brelse(lbuf); 80004298: 854a mv a0,s2 8000429a: fffff097 auipc ra,0xfffff 8000429e: 082080e7 jalr 130(ra) # 8000331c <brelse> brelse(dbuf); 800042a2: 8526 mv a0,s1 800042a4: fffff097 auipc ra,0xfffff 800042a8: 078080e7 jalr 120(ra) # 8000331c <brelse> for (tail = 0; tail < log.lh.n; tail++) { 800042ac: 2a05 addiw s4,s4,1 800042ae: 0a91 addi s5,s5,4 800042b0: 02c9a783 lw a5,44(s3) 800042b4: 04fa5963 bge s4,a5,80004306 <install_trans+0xae> struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block 800042b8: 0189a583 lw a1,24(s3) 800042bc: 014585bb addw a1,a1,s4 800042c0: 2585 addiw a1,a1,1 800042c2: 0289a503 lw a0,40(s3) 800042c6: fffff097 auipc ra,0xfffff 800042ca: f26080e7 jalr -218(ra) # 800031ec <bread> 800042ce: 892a mv s2,a0 struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst 800042d0: 000aa583 lw a1,0(s5) 800042d4: 0289a503 lw a0,40(s3) 800042d8: fffff097 auipc ra,0xfffff 800042dc: f14080e7 jalr -236(ra) # 800031ec <bread> 800042e0: 84aa mv s1,a0 memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst 800042e2: 40000613 li a2,1024 800042e6: 05890593 addi a1,s2,88 800042ea: 05850513 addi a0,a0,88 800042ee: ffffd097 auipc ra,0xffffd 800042f2: a52080e7 jalr -1454(ra) # 80000d40 <memmove> bwrite(dbuf); // write dst to disk 800042f6: 8526 mv a0,s1 800042f8: fffff097 auipc ra,0xfffff 800042fc: fe6080e7 jalr -26(ra) # 800032de <bwrite> if(recovering == 0) 80004300: f80b1ce3 bnez s6,80004298 <install_trans+0x40> 80004304: b769 j 8000428e <install_trans+0x36> } 80004306: 70e2 ld ra,56(sp) 80004308: 7442 ld s0,48(sp) 8000430a: 74a2 ld s1,40(sp) 8000430c: 7902 ld s2,32(sp) 8000430e: 69e2 ld s3,24(sp) 80004310: 6a42 ld s4,16(sp) 80004312: 6aa2 ld s5,8(sp) 80004314: 6b02 ld s6,0(sp) 80004316: 6121 addi sp,sp,64 80004318: 8082 ret 8000431a: 8082 ret 000000008000431c <initlog>: { 8000431c: 7179 addi sp,sp,-48 8000431e: f406 sd ra,40(sp) 80004320: f022 sd s0,32(sp) 80004322: ec26 sd s1,24(sp) 80004324: e84a sd s2,16(sp) 80004326: e44e sd s3,8(sp) 80004328: 1800 addi s0,sp,48 8000432a: 892a mv s2,a0 8000432c: 89ae mv s3,a1 initlock(&log.lock, "log"); 8000432e: 0001e497 auipc s1,0x1e 80004332: c4248493 addi s1,s1,-958 # 80021f70 <log> 80004336: 00004597 auipc a1,0x4 8000433a: 3ea58593 addi a1,a1,1002 # 80008720 <syscalls+0x1f8> 8000433e: 8526 mv a0,s1 80004340: ffffd097 auipc ra,0xffffd 80004344: 814080e7 jalr -2028(ra) # 80000b54 <initlock> log.start = sb->logstart; 80004348: 0149a583 lw a1,20(s3) 8000434c: cc8c sw a1,24(s1) log.size = sb->nlog; 8000434e: 0109a783 lw a5,16(s3) 80004352: ccdc sw a5,28(s1) log.dev = dev; 80004354: 0324a423 sw s2,40(s1) struct buf *buf = bread(log.dev, log.start); 80004358: 854a mv a0,s2 8000435a: fffff097 auipc ra,0xfffff 8000435e: e92080e7 jalr -366(ra) # 800031ec <bread> log.lh.n = lh->n; 80004362: 4d3c lw a5,88(a0) 80004364: d4dc sw a5,44(s1) for (i = 0; i < log.lh.n; i++) { 80004366: 02f05563 blez a5,80004390 <initlog+0x74> 8000436a: 05c50713 addi a4,a0,92 8000436e: 0001e697 auipc a3,0x1e 80004372: c3268693 addi a3,a3,-974 # 80021fa0 <log+0x30> 80004376: 37fd addiw a5,a5,-1 80004378: 1782 slli a5,a5,0x20 8000437a: 9381 srli a5,a5,0x20 8000437c: 078a slli a5,a5,0x2 8000437e: 06050613 addi a2,a0,96 80004382: 97b2 add a5,a5,a2 log.lh.block[i] = lh->block[i]; 80004384: 4310 lw a2,0(a4) 80004386: c290 sw a2,0(a3) for (i = 0; i < log.lh.n; i++) { 80004388: 0711 addi a4,a4,4 8000438a: 0691 addi a3,a3,4 8000438c: fef71ce3 bne a4,a5,80004384 <initlog+0x68> brelse(buf); 80004390: fffff097 auipc ra,0xfffff 80004394: f8c080e7 jalr -116(ra) # 8000331c <brelse> static void recover_from_log(void) { read_head(); install_trans(1); // if committed, copy from log to disk 80004398: 4505 li a0,1 8000439a: 00000097 auipc ra,0x0 8000439e: ebe080e7 jalr -322(ra) # 80004258 <install_trans> log.lh.n = 0; 800043a2: 0001e797 auipc a5,0x1e 800043a6: be07ad23 sw zero,-1030(a5) # 80021f9c <log+0x2c> write_head(); // clear the log 800043aa: 00000097 auipc ra,0x0 800043ae: e34080e7 jalr -460(ra) # 800041de <write_head> } 800043b2: 70a2 ld ra,40(sp) 800043b4: 7402 ld s0,32(sp) 800043b6: 64e2 ld s1,24(sp) 800043b8: 6942 ld s2,16(sp) 800043ba: 69a2 ld s3,8(sp) 800043bc: 6145 addi sp,sp,48 800043be: 8082 ret 00000000800043c0 <begin_op>: } // called at the start of each FS system call. void begin_op(void) { 800043c0: 1101 addi sp,sp,-32 800043c2: ec06 sd ra,24(sp) 800043c4: e822 sd s0,16(sp) 800043c6: e426 sd s1,8(sp) 800043c8: e04a sd s2,0(sp) 800043ca: 1000 addi s0,sp,32 acquire(&log.lock); 800043cc: 0001e517 auipc a0,0x1e 800043d0: ba450513 addi a0,a0,-1116 # 80021f70 <log> 800043d4: ffffd097 auipc ra,0xffffd 800043d8: 810080e7 jalr -2032(ra) # 80000be4 <acquire> while(1){ if(log.committing){ 800043dc: 0001e497 auipc s1,0x1e 800043e0: b9448493 addi s1,s1,-1132 # 80021f70 <log> sleep(&log, &log.lock); } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 800043e4: 4979 li s2,30 800043e6: a039 j 800043f4 <begin_op+0x34> sleep(&log, &log.lock); 800043e8: 85a6 mv a1,s1 800043ea: 8526 mv a0,s1 800043ec: ffffe097 auipc ra,0xffffe 800043f0: c8e080e7 jalr -882(ra) # 8000207a <sleep> if(log.committing){ 800043f4: 50dc lw a5,36(s1) 800043f6: fbed bnez a5,800043e8 <begin_op+0x28> } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ 800043f8: 509c lw a5,32(s1) 800043fa: 0017871b addiw a4,a5,1 800043fe: 0007069b sext.w a3,a4 80004402: 0027179b slliw a5,a4,0x2 80004406: 9fb9 addw a5,a5,a4 80004408: 0017979b slliw a5,a5,0x1 8000440c: 54d8 lw a4,44(s1) 8000440e: 9fb9 addw a5,a5,a4 80004410: 00f95963 bge s2,a5,80004422 <begin_op+0x62> // this op might exhaust log space; wait for commit. sleep(&log, &log.lock); 80004414: 85a6 mv a1,s1 80004416: 8526 mv a0,s1 80004418: ffffe097 auipc ra,0xffffe 8000441c: c62080e7 jalr -926(ra) # 8000207a <sleep> 80004420: bfd1 j 800043f4 <begin_op+0x34> } else { log.outstanding += 1; 80004422: 0001e517 auipc a0,0x1e 80004426: b4e50513 addi a0,a0,-1202 # 80021f70 <log> 8000442a: d114 sw a3,32(a0) release(&log.lock); 8000442c: ffffd097 auipc ra,0xffffd 80004430: 86c080e7 jalr -1940(ra) # 80000c98 <release> break; } } } 80004434: 60e2 ld ra,24(sp) 80004436: 6442 ld s0,16(sp) 80004438: 64a2 ld s1,8(sp) 8000443a: 6902 ld s2,0(sp) 8000443c: 6105 addi sp,sp,32 8000443e: 8082 ret 0000000080004440 <end_op>: // called at the end of each FS system call. // commits if this was the last outstanding operation. void end_op(void) { 80004440: 7139 addi sp,sp,-64 80004442: fc06 sd ra,56(sp) 80004444: f822 sd s0,48(sp) 80004446: f426 sd s1,40(sp) 80004448: f04a sd s2,32(sp) 8000444a: ec4e sd s3,24(sp) 8000444c: e852 sd s4,16(sp) 8000444e: e456 sd s5,8(sp) 80004450: 0080 addi s0,sp,64 int do_commit = 0; acquire(&log.lock); 80004452: 0001e497 auipc s1,0x1e 80004456: b1e48493 addi s1,s1,-1250 # 80021f70 <log> 8000445a: 8526 mv a0,s1 8000445c: ffffc097 auipc ra,0xffffc 80004460: 788080e7 jalr 1928(ra) # 80000be4 <acquire> log.outstanding -= 1; 80004464: 509c lw a5,32(s1) 80004466: 37fd addiw a5,a5,-1 80004468: 0007891b sext.w s2,a5 8000446c: d09c sw a5,32(s1) if(log.committing) 8000446e: 50dc lw a5,36(s1) 80004470: efb9 bnez a5,800044ce <end_op+0x8e> panic("log.committing"); if(log.outstanding == 0){ 80004472: 06091663 bnez s2,800044de <end_op+0x9e> do_commit = 1; log.committing = 1; 80004476: 0001e497 auipc s1,0x1e 8000447a: afa48493 addi s1,s1,-1286 # 80021f70 <log> 8000447e: 4785 li a5,1 80004480: d0dc sw a5,36(s1) // begin_op() may be waiting for log space, // and decrementing log.outstanding has decreased // the amount of reserved space. wakeup(&log); } release(&log.lock); 80004482: 8526 mv a0,s1 80004484: ffffd097 auipc ra,0xffffd 80004488: 814080e7 jalr -2028(ra) # 80000c98 <release> } static void commit() { if (log.lh.n > 0) { 8000448c: 54dc lw a5,44(s1) 8000448e: 06f04763 bgtz a5,800044fc <end_op+0xbc> acquire(&log.lock); 80004492: 0001e497 auipc s1,0x1e 80004496: ade48493 addi s1,s1,-1314 # 80021f70 <log> 8000449a: 8526 mv a0,s1 8000449c: ffffc097 auipc ra,0xffffc 800044a0: 748080e7 jalr 1864(ra) # 80000be4 <acquire> log.committing = 0; 800044a4: 0204a223 sw zero,36(s1) wakeup(&log); 800044a8: 8526 mv a0,s1 800044aa: ffffe097 auipc ra,0xffffe 800044ae: d5c080e7 jalr -676(ra) # 80002206 <wakeup> release(&log.lock); 800044b2: 8526 mv a0,s1 800044b4: ffffc097 auipc ra,0xffffc 800044b8: 7e4080e7 jalr 2020(ra) # 80000c98 <release> } 800044bc: 70e2 ld ra,56(sp) 800044be: 7442 ld s0,48(sp) 800044c0: 74a2 ld s1,40(sp) 800044c2: 7902 ld s2,32(sp) 800044c4: 69e2 ld s3,24(sp) 800044c6: 6a42 ld s4,16(sp) 800044c8: 6aa2 ld s5,8(sp) 800044ca: 6121 addi sp,sp,64 800044cc: 8082 ret panic("log.committing"); 800044ce: 00004517 auipc a0,0x4 800044d2: 25a50513 addi a0,a0,602 # 80008728 <syscalls+0x200> 800044d6: ffffc097 auipc ra,0xffffc 800044da: 068080e7 jalr 104(ra) # 8000053e <panic> wakeup(&log); 800044de: 0001e497 auipc s1,0x1e 800044e2: a9248493 addi s1,s1,-1390 # 80021f70 <log> 800044e6: 8526 mv a0,s1 800044e8: ffffe097 auipc ra,0xffffe 800044ec: d1e080e7 jalr -738(ra) # 80002206 <wakeup> release(&log.lock); 800044f0: 8526 mv a0,s1 800044f2: ffffc097 auipc ra,0xffffc 800044f6: 7a6080e7 jalr 1958(ra) # 80000c98 <release> if(do_commit){ 800044fa: b7c9 j 800044bc <end_op+0x7c> for (tail = 0; tail < log.lh.n; tail++) { 800044fc: 0001ea97 auipc s5,0x1e 80004500: aa4a8a93 addi s5,s5,-1372 # 80021fa0 <log+0x30> struct buf *to = bread(log.dev, log.start+tail+1); // log block 80004504: 0001ea17 auipc s4,0x1e 80004508: a6ca0a13 addi s4,s4,-1428 # 80021f70 <log> 8000450c: 018a2583 lw a1,24(s4) 80004510: 012585bb addw a1,a1,s2 80004514: 2585 addiw a1,a1,1 80004516: 028a2503 lw a0,40(s4) 8000451a: fffff097 auipc ra,0xfffff 8000451e: cd2080e7 jalr -814(ra) # 800031ec <bread> 80004522: 84aa mv s1,a0 struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block 80004524: 000aa583 lw a1,0(s5) 80004528: 028a2503 lw a0,40(s4) 8000452c: fffff097 auipc ra,0xfffff 80004530: cc0080e7 jalr -832(ra) # 800031ec <bread> 80004534: 89aa mv s3,a0 memmove(to->data, from->data, BSIZE); 80004536: 40000613 li a2,1024 8000453a: 05850593 addi a1,a0,88 8000453e: 05848513 addi a0,s1,88 80004542: ffffc097 auipc ra,0xffffc 80004546: 7fe080e7 jalr 2046(ra) # 80000d40 <memmove> bwrite(to); // write the log 8000454a: 8526 mv a0,s1 8000454c: fffff097 auipc ra,0xfffff 80004550: d92080e7 jalr -622(ra) # 800032de <bwrite> brelse(from); 80004554: 854e mv a0,s3 80004556: fffff097 auipc ra,0xfffff 8000455a: dc6080e7 jalr -570(ra) # 8000331c <brelse> brelse(to); 8000455e: 8526 mv a0,s1 80004560: fffff097 auipc ra,0xfffff 80004564: dbc080e7 jalr -580(ra) # 8000331c <brelse> for (tail = 0; tail < log.lh.n; tail++) { 80004568: 2905 addiw s2,s2,1 8000456a: 0a91 addi s5,s5,4 8000456c: 02ca2783 lw a5,44(s4) 80004570: f8f94ee3 blt s2,a5,8000450c <end_op+0xcc> write_log(); // Write modified blocks from cache to log write_head(); // Write header to disk -- the real commit 80004574: 00000097 auipc ra,0x0 80004578: c6a080e7 jalr -918(ra) # 800041de <write_head> install_trans(0); // Now install writes to home locations 8000457c: 4501 li a0,0 8000457e: 00000097 auipc ra,0x0 80004582: cda080e7 jalr -806(ra) # 80004258 <install_trans> log.lh.n = 0; 80004586: 0001e797 auipc a5,0x1e 8000458a: a007ab23 sw zero,-1514(a5) # 80021f9c <log+0x2c> write_head(); // Erase the transaction from the log 8000458e: 00000097 auipc ra,0x0 80004592: c50080e7 jalr -944(ra) # 800041de <write_head> 80004596: bdf5 j 80004492 <end_op+0x52> 0000000080004598 <log_write>: // modify bp->data[] // log_write(bp) // brelse(bp) void log_write(struct buf *b) { 80004598: 1101 addi sp,sp,-32 8000459a: ec06 sd ra,24(sp) 8000459c: e822 sd s0,16(sp) 8000459e: e426 sd s1,8(sp) 800045a0: e04a sd s2,0(sp) 800045a2: 1000 addi s0,sp,32 800045a4: 84aa mv s1,a0 int i; acquire(&log.lock); 800045a6: 0001e917 auipc s2,0x1e 800045aa: 9ca90913 addi s2,s2,-1590 # 80021f70 <log> 800045ae: 854a mv a0,s2 800045b0: ffffc097 auipc ra,0xffffc 800045b4: 634080e7 jalr 1588(ra) # 80000be4 <acquire> if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) 800045b8: 02c92603 lw a2,44(s2) 800045bc: 47f5 li a5,29 800045be: 06c7c563 blt a5,a2,80004628 <log_write+0x90> 800045c2: 0001e797 auipc a5,0x1e 800045c6: 9ca7a783 lw a5,-1590(a5) # 80021f8c <log+0x1c> 800045ca: 37fd addiw a5,a5,-1 800045cc: 04f65e63 bge a2,a5,80004628 <log_write+0x90> panic("too big a transaction"); if (log.outstanding < 1) 800045d0: 0001e797 auipc a5,0x1e 800045d4: 9c07a783 lw a5,-1600(a5) # 80021f90 <log+0x20> 800045d8: 06f05063 blez a5,80004638 <log_write+0xa0> panic("log_write outside of trans"); for (i = 0; i < log.lh.n; i++) { 800045dc: 4781 li a5,0 800045de: 06c05563 blez a2,80004648 <log_write+0xb0> if (log.lh.block[i] == b->blockno) // log absorption 800045e2: 44cc lw a1,12(s1) 800045e4: 0001e717 auipc a4,0x1e 800045e8: 9bc70713 addi a4,a4,-1604 # 80021fa0 <log+0x30> for (i = 0; i < log.lh.n; i++) { 800045ec: 4781 li a5,0 if (log.lh.block[i] == b->blockno) // log absorption 800045ee: 4314 lw a3,0(a4) 800045f0: 04b68c63 beq a3,a1,80004648 <log_write+0xb0> for (i = 0; i < log.lh.n; i++) { 800045f4: 2785 addiw a5,a5,1 800045f6: 0711 addi a4,a4,4 800045f8: fef61be3 bne a2,a5,800045ee <log_write+0x56> break; } log.lh.block[i] = b->blockno; 800045fc: 0621 addi a2,a2,8 800045fe: 060a slli a2,a2,0x2 80004600: 0001e797 auipc a5,0x1e 80004604: 97078793 addi a5,a5,-1680 # 80021f70 <log> 80004608: 963e add a2,a2,a5 8000460a: 44dc lw a5,12(s1) 8000460c: ca1c sw a5,16(a2) if (i == log.lh.n) { // Add new block to log? bpin(b); 8000460e: 8526 mv a0,s1 80004610: fffff097 auipc ra,0xfffff 80004614: daa080e7 jalr -598(ra) # 800033ba <bpin> log.lh.n++; 80004618: 0001e717 auipc a4,0x1e 8000461c: 95870713 addi a4,a4,-1704 # 80021f70 <log> 80004620: 575c lw a5,44(a4) 80004622: 2785 addiw a5,a5,1 80004624: d75c sw a5,44(a4) 80004626: a835 j 80004662 <log_write+0xca> panic("too big a transaction"); 80004628: 00004517 auipc a0,0x4 8000462c: 11050513 addi a0,a0,272 # 80008738 <syscalls+0x210> 80004630: ffffc097 auipc ra,0xffffc 80004634: f0e080e7 jalr -242(ra) # 8000053e <panic> panic("log_write outside of trans"); 80004638: 00004517 auipc a0,0x4 8000463c: 11850513 addi a0,a0,280 # 80008750 <syscalls+0x228> 80004640: ffffc097 auipc ra,0xffffc 80004644: efe080e7 jalr -258(ra) # 8000053e <panic> log.lh.block[i] = b->blockno; 80004648: 00878713 addi a4,a5,8 8000464c: 00271693 slli a3,a4,0x2 80004650: 0001e717 auipc a4,0x1e 80004654: 92070713 addi a4,a4,-1760 # 80021f70 <log> 80004658: 9736 add a4,a4,a3 8000465a: 44d4 lw a3,12(s1) 8000465c: cb14 sw a3,16(a4) if (i == log.lh.n) { // Add new block to log? 8000465e: faf608e3 beq a2,a5,8000460e <log_write+0x76> } release(&log.lock); 80004662: 0001e517 auipc a0,0x1e 80004666: 90e50513 addi a0,a0,-1778 # 80021f70 <log> 8000466a: ffffc097 auipc ra,0xffffc 8000466e: 62e080e7 jalr 1582(ra) # 80000c98 <release> } 80004672: 60e2 ld ra,24(sp) 80004674: 6442 ld s0,16(sp) 80004676: 64a2 ld s1,8(sp) 80004678: 6902 ld s2,0(sp) 8000467a: 6105 addi sp,sp,32 8000467c: 8082 ret 000000008000467e <initsleeplock>: #include "proc.h" #include "sleeplock.h" void initsleeplock(struct sleeplock *lk, char *name) { 8000467e: 1101 addi sp,sp,-32 80004680: ec06 sd ra,24(sp) 80004682: e822 sd s0,16(sp) 80004684: e426 sd s1,8(sp) 80004686: e04a sd s2,0(sp) 80004688: 1000 addi s0,sp,32 8000468a: 84aa mv s1,a0 8000468c: 892e mv s2,a1 initlock(&lk->lk, "sleep lock"); 8000468e: 00004597 auipc a1,0x4 80004692: 0e258593 addi a1,a1,226 # 80008770 <syscalls+0x248> 80004696: 0521 addi a0,a0,8 80004698: ffffc097 auipc ra,0xffffc 8000469c: 4bc080e7 jalr 1212(ra) # 80000b54 <initlock> lk->name = name; 800046a0: 0324b023 sd s2,32(s1) lk->locked = 0; 800046a4: 0004a023 sw zero,0(s1) lk->pid = 0; 800046a8: 0204a423 sw zero,40(s1) } 800046ac: 60e2 ld ra,24(sp) 800046ae: 6442 ld s0,16(sp) 800046b0: 64a2 ld s1,8(sp) 800046b2: 6902 ld s2,0(sp) 800046b4: 6105 addi sp,sp,32 800046b6: 8082 ret 00000000800046b8 <acquiresleep>: void acquiresleep(struct sleeplock *lk) { 800046b8: 1101 addi sp,sp,-32 800046ba: ec06 sd ra,24(sp) 800046bc: e822 sd s0,16(sp) 800046be: e426 sd s1,8(sp) 800046c0: e04a sd s2,0(sp) 800046c2: 1000 addi s0,sp,32 800046c4: 84aa mv s1,a0 acquire(&lk->lk); 800046c6: 00850913 addi s2,a0,8 800046ca: 854a mv a0,s2 800046cc: ffffc097 auipc ra,0xffffc 800046d0: 518080e7 jalr 1304(ra) # 80000be4 <acquire> while (lk->locked) { 800046d4: 409c lw a5,0(s1) 800046d6: cb89 beqz a5,800046e8 <acquiresleep+0x30> sleep(lk, &lk->lk); 800046d8: 85ca mv a1,s2 800046da: 8526 mv a0,s1 800046dc: ffffe097 auipc ra,0xffffe 800046e0: 99e080e7 jalr -1634(ra) # 8000207a <sleep> while (lk->locked) { 800046e4: 409c lw a5,0(s1) 800046e6: fbed bnez a5,800046d8 <acquiresleep+0x20> } lk->locked = 1; 800046e8: 4785 li a5,1 800046ea: c09c sw a5,0(s1) lk->pid = myproc()->pid; 800046ec: ffffd097 auipc ra,0xffffd 800046f0: 2ca080e7 jalr 714(ra) # 800019b6 <myproc> 800046f4: 591c lw a5,48(a0) 800046f6: d49c sw a5,40(s1) release(&lk->lk); 800046f8: 854a mv a0,s2 800046fa: ffffc097 auipc ra,0xffffc 800046fe: 59e080e7 jalr 1438(ra) # 80000c98 <release> } 80004702: 60e2 ld ra,24(sp) 80004704: 6442 ld s0,16(sp) 80004706: 64a2 ld s1,8(sp) 80004708: 6902 ld s2,0(sp) 8000470a: 6105 addi sp,sp,32 8000470c: 8082 ret 000000008000470e <releasesleep>: void releasesleep(struct sleeplock *lk) { 8000470e: 1101 addi sp,sp,-32 80004710: ec06 sd ra,24(sp) 80004712: e822 sd s0,16(sp) 80004714: e426 sd s1,8(sp) 80004716: e04a sd s2,0(sp) 80004718: 1000 addi s0,sp,32 8000471a: 84aa mv s1,a0 acquire(&lk->lk); 8000471c: 00850913 addi s2,a0,8 80004720: 854a mv a0,s2 80004722: ffffc097 auipc ra,0xffffc 80004726: 4c2080e7 jalr 1218(ra) # 80000be4 <acquire> lk->locked = 0; 8000472a: 0004a023 sw zero,0(s1) lk->pid = 0; 8000472e: 0204a423 sw zero,40(s1) wakeup(lk); 80004732: 8526 mv a0,s1 80004734: ffffe097 auipc ra,0xffffe 80004738: ad2080e7 jalr -1326(ra) # 80002206 <wakeup> release(&lk->lk); 8000473c: 854a mv a0,s2 8000473e: ffffc097 auipc ra,0xffffc 80004742: 55a080e7 jalr 1370(ra) # 80000c98 <release> } 80004746: 60e2 ld ra,24(sp) 80004748: 6442 ld s0,16(sp) 8000474a: 64a2 ld s1,8(sp) 8000474c: 6902 ld s2,0(sp) 8000474e: 6105 addi sp,sp,32 80004750: 8082 ret 0000000080004752 <holdingsleep>: int holdingsleep(struct sleeplock *lk) { 80004752: 7179 addi sp,sp,-48 80004754: f406 sd ra,40(sp) 80004756: f022 sd s0,32(sp) 80004758: ec26 sd s1,24(sp) 8000475a: e84a sd s2,16(sp) 8000475c: e44e sd s3,8(sp) 8000475e: 1800 addi s0,sp,48 80004760: 84aa mv s1,a0 int r; acquire(&lk->lk); 80004762: 00850913 addi s2,a0,8 80004766: 854a mv a0,s2 80004768: ffffc097 auipc ra,0xffffc 8000476c: 47c080e7 jalr 1148(ra) # 80000be4 <acquire> r = lk->locked && (lk->pid == myproc()->pid); 80004770: 409c lw a5,0(s1) 80004772: ef99 bnez a5,80004790 <holdingsleep+0x3e> 80004774: 4481 li s1,0 release(&lk->lk); 80004776: 854a mv a0,s2 80004778: ffffc097 auipc ra,0xffffc 8000477c: 520080e7 jalr 1312(ra) # 80000c98 <release> return r; } 80004780: 8526 mv a0,s1 80004782: 70a2 ld ra,40(sp) 80004784: 7402 ld s0,32(sp) 80004786: 64e2 ld s1,24(sp) 80004788: 6942 ld s2,16(sp) 8000478a: 69a2 ld s3,8(sp) 8000478c: 6145 addi sp,sp,48 8000478e: 8082 ret r = lk->locked && (lk->pid == myproc()->pid); 80004790: 0284a983 lw s3,40(s1) 80004794: ffffd097 auipc ra,0xffffd 80004798: 222080e7 jalr 546(ra) # 800019b6 <myproc> 8000479c: 5904 lw s1,48(a0) 8000479e: 413484b3 sub s1,s1,s3 800047a2: 0014b493 seqz s1,s1 800047a6: bfc1 j 80004776 <holdingsleep+0x24> 00000000800047a8 <fileinit>: struct file file[NFILE]; } ftable; void fileinit(void) { 800047a8: 1141 addi sp,sp,-16 800047aa: e406 sd ra,8(sp) 800047ac: e022 sd s0,0(sp) 800047ae: 0800 addi s0,sp,16 initlock(&ftable.lock, "ftable"); 800047b0: 00004597 auipc a1,0x4 800047b4: fd058593 addi a1,a1,-48 # 80008780 <syscalls+0x258> 800047b8: 0001e517 auipc a0,0x1e 800047bc: 90050513 addi a0,a0,-1792 # 800220b8 <ftable> 800047c0: ffffc097 auipc ra,0xffffc 800047c4: 394080e7 jalr 916(ra) # 80000b54 <initlock> } 800047c8: 60a2 ld ra,8(sp) 800047ca: 6402 ld s0,0(sp) 800047cc: 0141 addi sp,sp,16 800047ce: 8082 ret 00000000800047d0 <filealloc>: // Allocate a file structure. struct file* filealloc(void) { 800047d0: 1101 addi sp,sp,-32 800047d2: ec06 sd ra,24(sp) 800047d4: e822 sd s0,16(sp) 800047d6: e426 sd s1,8(sp) 800047d8: 1000 addi s0,sp,32 struct file *f; acquire(&ftable.lock); 800047da: 0001e517 auipc a0,0x1e 800047de: 8de50513 addi a0,a0,-1826 # 800220b8 <ftable> 800047e2: ffffc097 auipc ra,0xffffc 800047e6: 402080e7 jalr 1026(ra) # 80000be4 <acquire> for(f = ftable.file; f < ftable.file + NFILE; f++){ 800047ea: 0001e497 auipc s1,0x1e 800047ee: 8e648493 addi s1,s1,-1818 # 800220d0 <ftable+0x18> 800047f2: 0001f717 auipc a4,0x1f 800047f6: 87e70713 addi a4,a4,-1922 # 80023070 <ftable+0xfb8> if(f->ref == 0){ 800047fa: 40dc lw a5,4(s1) 800047fc: cf99 beqz a5,8000481a <filealloc+0x4a> for(f = ftable.file; f < ftable.file + NFILE; f++){ 800047fe: 02848493 addi s1,s1,40 80004802: fee49ce3 bne s1,a4,800047fa <filealloc+0x2a> f->ref = 1; release(&ftable.lock); return f; } } release(&ftable.lock); 80004806: 0001e517 auipc a0,0x1e 8000480a: 8b250513 addi a0,a0,-1870 # 800220b8 <ftable> 8000480e: ffffc097 auipc ra,0xffffc 80004812: 48a080e7 jalr 1162(ra) # 80000c98 <release> return 0; 80004816: 4481 li s1,0 80004818: a819 j 8000482e <filealloc+0x5e> f->ref = 1; 8000481a: 4785 li a5,1 8000481c: c0dc sw a5,4(s1) release(&ftable.lock); 8000481e: 0001e517 auipc a0,0x1e 80004822: 89a50513 addi a0,a0,-1894 # 800220b8 <ftable> 80004826: ffffc097 auipc ra,0xffffc 8000482a: 472080e7 jalr 1138(ra) # 80000c98 <release> } 8000482e: 8526 mv a0,s1 80004830: 60e2 ld ra,24(sp) 80004832: 6442 ld s0,16(sp) 80004834: 64a2 ld s1,8(sp) 80004836: 6105 addi sp,sp,32 80004838: 8082 ret 000000008000483a <filedup>: // Increment ref count for file f. struct file* filedup(struct file *f) { 8000483a: 1101 addi sp,sp,-32 8000483c: ec06 sd ra,24(sp) 8000483e: e822 sd s0,16(sp) 80004840: e426 sd s1,8(sp) 80004842: 1000 addi s0,sp,32 80004844: 84aa mv s1,a0 acquire(&ftable.lock); 80004846: 0001e517 auipc a0,0x1e 8000484a: 87250513 addi a0,a0,-1934 # 800220b8 <ftable> 8000484e: ffffc097 auipc ra,0xffffc 80004852: 396080e7 jalr 918(ra) # 80000be4 <acquire> if(f->ref < 1) 80004856: 40dc lw a5,4(s1) 80004858: 02f05263 blez a5,8000487c <filedup+0x42> panic("filedup"); f->ref++; 8000485c: 2785 addiw a5,a5,1 8000485e: c0dc sw a5,4(s1) release(&ftable.lock); 80004860: 0001e517 auipc a0,0x1e 80004864: 85850513 addi a0,a0,-1960 # 800220b8 <ftable> 80004868: ffffc097 auipc ra,0xffffc 8000486c: 430080e7 jalr 1072(ra) # 80000c98 <release> return f; } 80004870: 8526 mv a0,s1 80004872: 60e2 ld ra,24(sp) 80004874: 6442 ld s0,16(sp) 80004876: 64a2 ld s1,8(sp) 80004878: 6105 addi sp,sp,32 8000487a: 8082 ret panic("filedup"); 8000487c: 00004517 auipc a0,0x4 80004880: f0c50513 addi a0,a0,-244 # 80008788 <syscalls+0x260> 80004884: ffffc097 auipc ra,0xffffc 80004888: cba080e7 jalr -838(ra) # 8000053e <panic> 000000008000488c <fileclose>: // Close file f. (Decrement ref count, close when reaches 0.) void fileclose(struct file *f) { 8000488c: 7139 addi sp,sp,-64 8000488e: fc06 sd ra,56(sp) 80004890: f822 sd s0,48(sp) 80004892: f426 sd s1,40(sp) 80004894: f04a sd s2,32(sp) 80004896: ec4e sd s3,24(sp) 80004898: e852 sd s4,16(sp) 8000489a: e456 sd s5,8(sp) 8000489c: 0080 addi s0,sp,64 8000489e: 84aa mv s1,a0 struct file ff; acquire(&ftable.lock); 800048a0: 0001e517 auipc a0,0x1e 800048a4: 81850513 addi a0,a0,-2024 # 800220b8 <ftable> 800048a8: ffffc097 auipc ra,0xffffc 800048ac: 33c080e7 jalr 828(ra) # 80000be4 <acquire> if(f->ref < 1) 800048b0: 40dc lw a5,4(s1) 800048b2: 06f05163 blez a5,80004914 <fileclose+0x88> panic("fileclose"); if(--f->ref > 0){ 800048b6: 37fd addiw a5,a5,-1 800048b8: 0007871b sext.w a4,a5 800048bc: c0dc sw a5,4(s1) 800048be: 06e04363 bgtz a4,80004924 <fileclose+0x98> release(&ftable.lock); return; } ff = *f; 800048c2: 0004a903 lw s2,0(s1) 800048c6: 0094ca83 lbu s5,9(s1) 800048ca: 0104ba03 ld s4,16(s1) 800048ce: 0184b983 ld s3,24(s1) f->ref = 0; 800048d2: 0004a223 sw zero,4(s1) f->type = FD_NONE; 800048d6: 0004a023 sw zero,0(s1) release(&ftable.lock); 800048da: 0001d517 auipc a0,0x1d 800048de: 7de50513 addi a0,a0,2014 # 800220b8 <ftable> 800048e2: ffffc097 auipc ra,0xffffc 800048e6: 3b6080e7 jalr 950(ra) # 80000c98 <release> if(ff.type == FD_PIPE){ 800048ea: 4785 li a5,1 800048ec: 04f90d63 beq s2,a5,80004946 <fileclose+0xba> pipeclose(ff.pipe, ff.writable); } else if(ff.type == FD_INODE || ff.type == FD_DEVICE){ 800048f0: 3979 addiw s2,s2,-2 800048f2: 4785 li a5,1 800048f4: 0527e063 bltu a5,s2,80004934 <fileclose+0xa8> begin_op(); 800048f8: 00000097 auipc ra,0x0 800048fc: ac8080e7 jalr -1336(ra) # 800043c0 <begin_op> iput(ff.ip); 80004900: 854e mv a0,s3 80004902: fffff097 auipc ra,0xfffff 80004906: 2a6080e7 jalr 678(ra) # 80003ba8 <iput> end_op(); 8000490a: 00000097 auipc ra,0x0 8000490e: b36080e7 jalr -1226(ra) # 80004440 <end_op> 80004912: a00d j 80004934 <fileclose+0xa8> panic("fileclose"); 80004914: 00004517 auipc a0,0x4 80004918: e7c50513 addi a0,a0,-388 # 80008790 <syscalls+0x268> 8000491c: ffffc097 auipc ra,0xffffc 80004920: c22080e7 jalr -990(ra) # 8000053e <panic> release(&ftable.lock); 80004924: 0001d517 auipc a0,0x1d 80004928: 79450513 addi a0,a0,1940 # 800220b8 <ftable> 8000492c: ffffc097 auipc ra,0xffffc 80004930: 36c080e7 jalr 876(ra) # 80000c98 <release> } } 80004934: 70e2 ld ra,56(sp) 80004936: 7442 ld s0,48(sp) 80004938: 74a2 ld s1,40(sp) 8000493a: 7902 ld s2,32(sp) 8000493c: 69e2 ld s3,24(sp) 8000493e: 6a42 ld s4,16(sp) 80004940: 6aa2 ld s5,8(sp) 80004942: 6121 addi sp,sp,64 80004944: 8082 ret pipeclose(ff.pipe, ff.writable); 80004946: 85d6 mv a1,s5 80004948: 8552 mv a0,s4 8000494a: 00000097 auipc ra,0x0 8000494e: 34c080e7 jalr 844(ra) # 80004c96 <pipeclose> 80004952: b7cd j 80004934 <fileclose+0xa8> 0000000080004954 <filestat>: // Get metadata about file f. // addr is a user virtual address, pointing to a struct stat. int filestat(struct file *f, uint64 addr) { 80004954: 715d addi sp,sp,-80 80004956: e486 sd ra,72(sp) 80004958: e0a2 sd s0,64(sp) 8000495a: fc26 sd s1,56(sp) 8000495c: f84a sd s2,48(sp) 8000495e: f44e sd s3,40(sp) 80004960: 0880 addi s0,sp,80 80004962: 84aa mv s1,a0 80004964: 89ae mv s3,a1 struct proc *p = myproc(); 80004966: ffffd097 auipc ra,0xffffd 8000496a: 050080e7 jalr 80(ra) # 800019b6 <myproc> struct stat st; if(f->type == FD_INODE || f->type == FD_DEVICE){ 8000496e: 409c lw a5,0(s1) 80004970: 37f9 addiw a5,a5,-2 80004972: 4705 li a4,1 80004974: 04f76763 bltu a4,a5,800049c2 <filestat+0x6e> 80004978: 892a mv s2,a0 ilock(f->ip); 8000497a: 6c88 ld a0,24(s1) 8000497c: fffff097 auipc ra,0xfffff 80004980: 072080e7 jalr 114(ra) # 800039ee <ilock> stati(f->ip, &st); 80004984: fb840593 addi a1,s0,-72 80004988: 6c88 ld a0,24(s1) 8000498a: fffff097 auipc ra,0xfffff 8000498e: 2ee080e7 jalr 750(ra) # 80003c78 <stati> iunlock(f->ip); 80004992: 6c88 ld a0,24(s1) 80004994: fffff097 auipc ra,0xfffff 80004998: 11c080e7 jalr 284(ra) # 80003ab0 <iunlock> if(copyout(p->pagetable, addr, (char *)&st, sizeof(st)) < 0) 8000499c: 46e1 li a3,24 8000499e: fb840613 addi a2,s0,-72 800049a2: 85ce mv a1,s3 800049a4: 05093503 ld a0,80(s2) 800049a8: ffffd097 auipc ra,0xffffd 800049ac: cca080e7 jalr -822(ra) # 80001672 <copyout> 800049b0: 41f5551b sraiw a0,a0,0x1f return -1; return 0; } return -1; } 800049b4: 60a6 ld ra,72(sp) 800049b6: 6406 ld s0,64(sp) 800049b8: 74e2 ld s1,56(sp) 800049ba: 7942 ld s2,48(sp) 800049bc: 79a2 ld s3,40(sp) 800049be: 6161 addi sp,sp,80 800049c0: 8082 ret return -1; 800049c2: 557d li a0,-1 800049c4: bfc5 j 800049b4 <filestat+0x60> 00000000800049c6 <fileread>: // Read from file f. // addr is a user virtual address. int fileread(struct file *f, uint64 addr, int n) { 800049c6: 7179 addi sp,sp,-48 800049c8: f406 sd ra,40(sp) 800049ca: f022 sd s0,32(sp) 800049cc: ec26 sd s1,24(sp) 800049ce: e84a sd s2,16(sp) 800049d0: e44e sd s3,8(sp) 800049d2: 1800 addi s0,sp,48 int r = 0; if(f->readable == 0) 800049d4: 00854783 lbu a5,8(a0) 800049d8: c3d5 beqz a5,80004a7c <fileread+0xb6> 800049da: 84aa mv s1,a0 800049dc: 89ae mv s3,a1 800049de: 8932 mv s2,a2 return -1; if(f->type == FD_PIPE){ 800049e0: 411c lw a5,0(a0) 800049e2: 4705 li a4,1 800049e4: 04e78963 beq a5,a4,80004a36 <fileread+0x70> r = piperead(f->pipe, addr, n); } else if(f->type == FD_DEVICE){ 800049e8: 470d li a4,3 800049ea: 04e78d63 beq a5,a4,80004a44 <fileread+0x7e> if(f->major < 0 || f->major >= NDEV || !devsw[f->major].read) return -1; r = devsw[f->major].read(1, addr, n); } else if(f->type == FD_INODE){ 800049ee: 4709 li a4,2 800049f0: 06e79e63 bne a5,a4,80004a6c <fileread+0xa6> ilock(f->ip); 800049f4: 6d08 ld a0,24(a0) 800049f6: fffff097 auipc ra,0xfffff 800049fa: ff8080e7 jalr -8(ra) # 800039ee <ilock> if((r = readi(f->ip, 1, addr, f->off, n)) > 0) 800049fe: 874a mv a4,s2 80004a00: 5094 lw a3,32(s1) 80004a02: 864e mv a2,s3 80004a04: 4585 li a1,1 80004a06: 6c88 ld a0,24(s1) 80004a08: fffff097 auipc ra,0xfffff 80004a0c: 29a080e7 jalr 666(ra) # 80003ca2 <readi> 80004a10: 892a mv s2,a0 80004a12: 00a05563 blez a0,80004a1c <fileread+0x56> f->off += r; 80004a16: 509c lw a5,32(s1) 80004a18: 9fa9 addw a5,a5,a0 80004a1a: d09c sw a5,32(s1) iunlock(f->ip); 80004a1c: 6c88 ld a0,24(s1) 80004a1e: fffff097 auipc ra,0xfffff 80004a22: 092080e7 jalr 146(ra) # 80003ab0 <iunlock> } else { panic("fileread"); } return r; } 80004a26: 854a mv a0,s2 80004a28: 70a2 ld ra,40(sp) 80004a2a: 7402 ld s0,32(sp) 80004a2c: 64e2 ld s1,24(sp) 80004a2e: 6942 ld s2,16(sp) 80004a30: 69a2 ld s3,8(sp) 80004a32: 6145 addi sp,sp,48 80004a34: 8082 ret r = piperead(f->pipe, addr, n); 80004a36: 6908 ld a0,16(a0) 80004a38: 00000097 auipc ra,0x0 80004a3c: 3c8080e7 jalr 968(ra) # 80004e00 <piperead> 80004a40: 892a mv s2,a0 80004a42: b7d5 j 80004a26 <fileread+0x60> if(f->major < 0 || f->major >= NDEV || !devsw[f->major].read) 80004a44: 02451783 lh a5,36(a0) 80004a48: 03079693 slli a3,a5,0x30 80004a4c: 92c1 srli a3,a3,0x30 80004a4e: 4725 li a4,9 80004a50: 02d76863 bltu a4,a3,80004a80 <fileread+0xba> 80004a54: 0792 slli a5,a5,0x4 80004a56: 0001d717 auipc a4,0x1d 80004a5a: 5c270713 addi a4,a4,1474 # 80022018 <devsw> 80004a5e: 97ba add a5,a5,a4 80004a60: 639c ld a5,0(a5) 80004a62: c38d beqz a5,80004a84 <fileread+0xbe> r = devsw[f->major].read(1, addr, n); 80004a64: 4505 li a0,1 80004a66: 9782 jalr a5 80004a68: 892a mv s2,a0 80004a6a: bf75 j 80004a26 <fileread+0x60> panic("fileread"); 80004a6c: 00004517 auipc a0,0x4 80004a70: d3450513 addi a0,a0,-716 # 800087a0 <syscalls+0x278> 80004a74: ffffc097 auipc ra,0xffffc 80004a78: aca080e7 jalr -1334(ra) # 8000053e <panic> return -1; 80004a7c: 597d li s2,-1 80004a7e: b765 j 80004a26 <fileread+0x60> return -1; 80004a80: 597d li s2,-1 80004a82: b755 j 80004a26 <fileread+0x60> 80004a84: 597d li s2,-1 80004a86: b745 j 80004a26 <fileread+0x60> 0000000080004a88 <filewrite>: // Write to file f. // addr is a user virtual address. int filewrite(struct file *f, uint64 addr, int n) { 80004a88: 715d addi sp,sp,-80 80004a8a: e486 sd ra,72(sp) 80004a8c: e0a2 sd s0,64(sp) 80004a8e: fc26 sd s1,56(sp) 80004a90: f84a sd s2,48(sp) 80004a92: f44e sd s3,40(sp) 80004a94: f052 sd s4,32(sp) 80004a96: ec56 sd s5,24(sp) 80004a98: e85a sd s6,16(sp) 80004a9a: e45e sd s7,8(sp) 80004a9c: e062 sd s8,0(sp) 80004a9e: 0880 addi s0,sp,80 int r, ret = 0; if(f->writable == 0) 80004aa0: 00954783 lbu a5,9(a0) 80004aa4: 10078663 beqz a5,80004bb0 <filewrite+0x128> 80004aa8: 892a mv s2,a0 80004aaa: 8aae mv s5,a1 80004aac: 8a32 mv s4,a2 return -1; if(f->type == FD_PIPE){ 80004aae: 411c lw a5,0(a0) 80004ab0: 4705 li a4,1 80004ab2: 02e78263 beq a5,a4,80004ad6 <filewrite+0x4e> ret = pipewrite(f->pipe, addr, n); } else if(f->type == FD_DEVICE){ 80004ab6: 470d li a4,3 80004ab8: 02e78663 beq a5,a4,80004ae4 <filewrite+0x5c> if(f->major < 0 || f->major >= NDEV || !devsw[f->major].write) return -1; ret = devsw[f->major].write(1, addr, n); } else if(f->type == FD_INODE){ 80004abc: 4709 li a4,2 80004abe: 0ee79163 bne a5,a4,80004ba0 <filewrite+0x118> // and 2 blocks of slop for non-aligned writes. // this really belongs lower down, since writei() // might be writing a device like the console. int max = ((MAXOPBLOCKS-1-1-2) / 2) * BSIZE; int i = 0; while(i < n){ 80004ac2: 0ac05d63 blez a2,80004b7c <filewrite+0xf4> int i = 0; 80004ac6: 4981 li s3,0 80004ac8: 6b05 lui s6,0x1 80004aca: c00b0b13 addi s6,s6,-1024 # c00 <_entry-0x7ffff400> 80004ace: 6b85 lui s7,0x1 80004ad0: c00b8b9b addiw s7,s7,-1024 80004ad4: a861 j 80004b6c <filewrite+0xe4> ret = pipewrite(f->pipe, addr, n); 80004ad6: 6908 ld a0,16(a0) 80004ad8: 00000097 auipc ra,0x0 80004adc: 22e080e7 jalr 558(ra) # 80004d06 <pipewrite> 80004ae0: 8a2a mv s4,a0 80004ae2: a045 j 80004b82 <filewrite+0xfa> if(f->major < 0 || f->major >= NDEV || !devsw[f->major].write) 80004ae4: 02451783 lh a5,36(a0) 80004ae8: 03079693 slli a3,a5,0x30 80004aec: 92c1 srli a3,a3,0x30 80004aee: 4725 li a4,9 80004af0: 0cd76263 bltu a4,a3,80004bb4 <filewrite+0x12c> 80004af4: 0792 slli a5,a5,0x4 80004af6: 0001d717 auipc a4,0x1d 80004afa: 52270713 addi a4,a4,1314 # 80022018 <devsw> 80004afe: 97ba add a5,a5,a4 80004b00: 679c ld a5,8(a5) 80004b02: cbdd beqz a5,80004bb8 <filewrite+0x130> ret = devsw[f->major].write(1, addr, n); 80004b04: 4505 li a0,1 80004b06: 9782 jalr a5 80004b08: 8a2a mv s4,a0 80004b0a: a8a5 j 80004b82 <filewrite+0xfa> 80004b0c: 00048c1b sext.w s8,s1 int n1 = n - i; if(n1 > max) n1 = max; begin_op(); 80004b10: 00000097 auipc ra,0x0 80004b14: 8b0080e7 jalr -1872(ra) # 800043c0 <begin_op> ilock(f->ip); 80004b18: 01893503 ld a0,24(s2) 80004b1c: fffff097 auipc ra,0xfffff 80004b20: ed2080e7 jalr -302(ra) # 800039ee <ilock> if ((r = writei(f->ip, 1, addr + i, f->off, n1)) > 0) 80004b24: 8762 mv a4,s8 80004b26: 02092683 lw a3,32(s2) 80004b2a: 01598633 add a2,s3,s5 80004b2e: 4585 li a1,1 80004b30: 01893503 ld a0,24(s2) 80004b34: fffff097 auipc ra,0xfffff 80004b38: 266080e7 jalr 614(ra) # 80003d9a <writei> 80004b3c: 84aa mv s1,a0 80004b3e: 00a05763 blez a0,80004b4c <filewrite+0xc4> f->off += r; 80004b42: 02092783 lw a5,32(s2) 80004b46: 9fa9 addw a5,a5,a0 80004b48: 02f92023 sw a5,32(s2) iunlock(f->ip); 80004b4c: 01893503 ld a0,24(s2) 80004b50: fffff097 auipc ra,0xfffff 80004b54: f60080e7 jalr -160(ra) # 80003ab0 <iunlock> end_op(); 80004b58: 00000097 auipc ra,0x0 80004b5c: 8e8080e7 jalr -1816(ra) # 80004440 <end_op> if(r != n1){ 80004b60: 009c1f63 bne s8,s1,80004b7e <filewrite+0xf6> // error from writei break; } i += r; 80004b64: 013489bb addw s3,s1,s3 while(i < n){ 80004b68: 0149db63 bge s3,s4,80004b7e <filewrite+0xf6> int n1 = n - i; 80004b6c: 413a07bb subw a5,s4,s3 if(n1 > max) 80004b70: 84be mv s1,a5 80004b72: 2781 sext.w a5,a5 80004b74: f8fb5ce3 bge s6,a5,80004b0c <filewrite+0x84> 80004b78: 84de mv s1,s7 80004b7a: bf49 j 80004b0c <filewrite+0x84> int i = 0; 80004b7c: 4981 li s3,0 } ret = (i == n ? n : -1); 80004b7e: 013a1f63 bne s4,s3,80004b9c <filewrite+0x114> } else { panic("filewrite"); } return ret; } 80004b82: 8552 mv a0,s4 80004b84: 60a6 ld ra,72(sp) 80004b86: 6406 ld s0,64(sp) 80004b88: 74e2 ld s1,56(sp) 80004b8a: 7942 ld s2,48(sp) 80004b8c: 79a2 ld s3,40(sp) 80004b8e: 7a02 ld s4,32(sp) 80004b90: 6ae2 ld s5,24(sp) 80004b92: 6b42 ld s6,16(sp) 80004b94: 6ba2 ld s7,8(sp) 80004b96: 6c02 ld s8,0(sp) 80004b98: 6161 addi sp,sp,80 80004b9a: 8082 ret ret = (i == n ? n : -1); 80004b9c: 5a7d li s4,-1 80004b9e: b7d5 j 80004b82 <filewrite+0xfa> panic("filewrite"); 80004ba0: 00004517 auipc a0,0x4 80004ba4: c1050513 addi a0,a0,-1008 # 800087b0 <syscalls+0x288> 80004ba8: ffffc097 auipc ra,0xffffc 80004bac: 996080e7 jalr -1642(ra) # 8000053e <panic> return -1; 80004bb0: 5a7d li s4,-1 80004bb2: bfc1 j 80004b82 <filewrite+0xfa> return -1; 80004bb4: 5a7d li s4,-1 80004bb6: b7f1 j 80004b82 <filewrite+0xfa> 80004bb8: 5a7d li s4,-1 80004bba: b7e1 j 80004b82 <filewrite+0xfa> 0000000080004bbc <pipealloc>: int writeopen; // write fd is still open }; int pipealloc(struct file **f0, struct file **f1) { 80004bbc: 7179 addi sp,sp,-48 80004bbe: f406 sd ra,40(sp) 80004bc0: f022 sd s0,32(sp) 80004bc2: ec26 sd s1,24(sp) 80004bc4: e84a sd s2,16(sp) 80004bc6: e44e sd s3,8(sp) 80004bc8: e052 sd s4,0(sp) 80004bca: 1800 addi s0,sp,48 80004bcc: 84aa mv s1,a0 80004bce: 8a2e mv s4,a1 struct pipe *pi; pi = 0; *f0 = *f1 = 0; 80004bd0: 0005b023 sd zero,0(a1) 80004bd4: 00053023 sd zero,0(a0) if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0) 80004bd8: 00000097 auipc ra,0x0 80004bdc: bf8080e7 jalr -1032(ra) # 800047d0 <filealloc> 80004be0: e088 sd a0,0(s1) 80004be2: c551 beqz a0,80004c6e <pipealloc+0xb2> 80004be4: 00000097 auipc ra,0x0 80004be8: bec080e7 jalr -1044(ra) # 800047d0 <filealloc> 80004bec: 00aa3023 sd a0,0(s4) 80004bf0: c92d beqz a0,80004c62 <pipealloc+0xa6> goto bad; if((pi = (struct pipe*)kalloc()) == 0) 80004bf2: ffffc097 auipc ra,0xffffc 80004bf6: f02080e7 jalr -254(ra) # 80000af4 <kalloc> 80004bfa: 892a mv s2,a0 80004bfc: c125 beqz a0,80004c5c <pipealloc+0xa0> goto bad; pi->readopen = 1; 80004bfe: 4985 li s3,1 80004c00: 23352023 sw s3,544(a0) pi->writeopen = 1; 80004c04: 23352223 sw s3,548(a0) pi->nwrite = 0; 80004c08: 20052e23 sw zero,540(a0) pi->nread = 0; 80004c0c: 20052c23 sw zero,536(a0) initlock(&pi->lock, "pipe"); 80004c10: 00004597 auipc a1,0x4 80004c14: bb058593 addi a1,a1,-1104 # 800087c0 <syscalls+0x298> 80004c18: ffffc097 auipc ra,0xffffc 80004c1c: f3c080e7 jalr -196(ra) # 80000b54 <initlock> (*f0)->type = FD_PIPE; 80004c20: 609c ld a5,0(s1) 80004c22: 0137a023 sw s3,0(a5) (*f0)->readable = 1; 80004c26: 609c ld a5,0(s1) 80004c28: 01378423 sb s3,8(a5) (*f0)->writable = 0; 80004c2c: 609c ld a5,0(s1) 80004c2e: 000784a3 sb zero,9(a5) (*f0)->pipe = pi; 80004c32: 609c ld a5,0(s1) 80004c34: 0127b823 sd s2,16(a5) (*f1)->type = FD_PIPE; 80004c38: 000a3783 ld a5,0(s4) 80004c3c: 0137a023 sw s3,0(a5) (*f1)->readable = 0; 80004c40: 000a3783 ld a5,0(s4) 80004c44: 00078423 sb zero,8(a5) (*f1)->writable = 1; 80004c48: 000a3783 ld a5,0(s4) 80004c4c: 013784a3 sb s3,9(a5) (*f1)->pipe = pi; 80004c50: 000a3783 ld a5,0(s4) 80004c54: 0127b823 sd s2,16(a5) return 0; 80004c58: 4501 li a0,0 80004c5a: a025 j 80004c82 <pipealloc+0xc6> bad: if(pi) kfree((char*)pi); if(*f0) 80004c5c: 6088 ld a0,0(s1) 80004c5e: e501 bnez a0,80004c66 <pipealloc+0xaa> 80004c60: a039 j 80004c6e <pipealloc+0xb2> 80004c62: 6088 ld a0,0(s1) 80004c64: c51d beqz a0,80004c92 <pipealloc+0xd6> fileclose(*f0); 80004c66: 00000097 auipc ra,0x0 80004c6a: c26080e7 jalr -986(ra) # 8000488c <fileclose> if(*f1) 80004c6e: 000a3783 ld a5,0(s4) fileclose(*f1); return -1; 80004c72: 557d li a0,-1 if(*f1) 80004c74: c799 beqz a5,80004c82 <pipealloc+0xc6> fileclose(*f1); 80004c76: 853e mv a0,a5 80004c78: 00000097 auipc ra,0x0 80004c7c: c14080e7 jalr -1004(ra) # 8000488c <fileclose> return -1; 80004c80: 557d li a0,-1 } 80004c82: 70a2 ld ra,40(sp) 80004c84: 7402 ld s0,32(sp) 80004c86: 64e2 ld s1,24(sp) 80004c88: 6942 ld s2,16(sp) 80004c8a: 69a2 ld s3,8(sp) 80004c8c: 6a02 ld s4,0(sp) 80004c8e: 6145 addi sp,sp,48 80004c90: 8082 ret return -1; 80004c92: 557d li a0,-1 80004c94: b7fd j 80004c82 <pipealloc+0xc6> 0000000080004c96 <pipeclose>: void pipeclose(struct pipe *pi, int writable) { 80004c96: 1101 addi sp,sp,-32 80004c98: ec06 sd ra,24(sp) 80004c9a: e822 sd s0,16(sp) 80004c9c: e426 sd s1,8(sp) 80004c9e: e04a sd s2,0(sp) 80004ca0: 1000 addi s0,sp,32 80004ca2: 84aa mv s1,a0 80004ca4: 892e mv s2,a1 acquire(&pi->lock); 80004ca6: ffffc097 auipc ra,0xffffc 80004caa: f3e080e7 jalr -194(ra) # 80000be4 <acquire> if(writable){ 80004cae: 02090d63 beqz s2,80004ce8 <pipeclose+0x52> pi->writeopen = 0; 80004cb2: 2204a223 sw zero,548(s1) wakeup(&pi->nread); 80004cb6: 21848513 addi a0,s1,536 80004cba: ffffd097 auipc ra,0xffffd 80004cbe: 54c080e7 jalr 1356(ra) # 80002206 <wakeup> } else { pi->readopen = 0; wakeup(&pi->nwrite); } if(pi->readopen == 0 && pi->writeopen == 0){ 80004cc2: 2204b783 ld a5,544(s1) 80004cc6: eb95 bnez a5,80004cfa <pipeclose+0x64> release(&pi->lock); 80004cc8: 8526 mv a0,s1 80004cca: ffffc097 auipc ra,0xffffc 80004cce: fce080e7 jalr -50(ra) # 80000c98 <release> kfree((char*)pi); 80004cd2: 8526 mv a0,s1 80004cd4: ffffc097 auipc ra,0xffffc 80004cd8: d24080e7 jalr -732(ra) # 800009f8 <kfree> } else release(&pi->lock); } 80004cdc: 60e2 ld ra,24(sp) 80004cde: 6442 ld s0,16(sp) 80004ce0: 64a2 ld s1,8(sp) 80004ce2: 6902 ld s2,0(sp) 80004ce4: 6105 addi sp,sp,32 80004ce6: 8082 ret pi->readopen = 0; 80004ce8: 2204a023 sw zero,544(s1) wakeup(&pi->nwrite); 80004cec: 21c48513 addi a0,s1,540 80004cf0: ffffd097 auipc ra,0xffffd 80004cf4: 516080e7 jalr 1302(ra) # 80002206 <wakeup> 80004cf8: b7e9 j 80004cc2 <pipeclose+0x2c> release(&pi->lock); 80004cfa: 8526 mv a0,s1 80004cfc: ffffc097 auipc ra,0xffffc 80004d00: f9c080e7 jalr -100(ra) # 80000c98 <release> } 80004d04: bfe1 j 80004cdc <pipeclose+0x46> 0000000080004d06 <pipewrite>: int pipewrite(struct pipe *pi, uint64 addr, int n) { 80004d06: 7159 addi sp,sp,-112 80004d08: f486 sd ra,104(sp) 80004d0a: f0a2 sd s0,96(sp) 80004d0c: eca6 sd s1,88(sp) 80004d0e: e8ca sd s2,80(sp) 80004d10: e4ce sd s3,72(sp) 80004d12: e0d2 sd s4,64(sp) 80004d14: fc56 sd s5,56(sp) 80004d16: f85a sd s6,48(sp) 80004d18: f45e sd s7,40(sp) 80004d1a: f062 sd s8,32(sp) 80004d1c: ec66 sd s9,24(sp) 80004d1e: 1880 addi s0,sp,112 80004d20: 84aa mv s1,a0 80004d22: 8aae mv s5,a1 80004d24: 8a32 mv s4,a2 int i = 0; struct proc *pr = myproc(); 80004d26: ffffd097 auipc ra,0xffffd 80004d2a: c90080e7 jalr -880(ra) # 800019b6 <myproc> 80004d2e: 89aa mv s3,a0 acquire(&pi->lock); 80004d30: 8526 mv a0,s1 80004d32: ffffc097 auipc ra,0xffffc 80004d36: eb2080e7 jalr -334(ra) # 80000be4 <acquire> while(i < n){ 80004d3a: 0d405163 blez s4,80004dfc <pipewrite+0xf6> 80004d3e: 8ba6 mv s7,s1 int i = 0; 80004d40: 4901 li s2,0 if(pi->nwrite == pi->nread + PIPESIZE){ //DOC: pipewrite-full wakeup(&pi->nread); sleep(&pi->nwrite, &pi->lock); } else { char ch; if(copyin(pr->pagetable, &ch, addr + i, 1) == -1) 80004d42: 5b7d li s6,-1 wakeup(&pi->nread); 80004d44: 21848c93 addi s9,s1,536 sleep(&pi->nwrite, &pi->lock); 80004d48: 21c48c13 addi s8,s1,540 80004d4c: a08d j 80004dae <pipewrite+0xa8> release(&pi->lock); 80004d4e: 8526 mv a0,s1 80004d50: ffffc097 auipc ra,0xffffc 80004d54: f48080e7 jalr -184(ra) # 80000c98 <release> return -1; 80004d58: 597d li s2,-1 } wakeup(&pi->nread); release(&pi->lock); return i; } 80004d5a: 854a mv a0,s2 80004d5c: 70a6 ld ra,104(sp) 80004d5e: 7406 ld s0,96(sp) 80004d60: 64e6 ld s1,88(sp) 80004d62: 6946 ld s2,80(sp) 80004d64: 69a6 ld s3,72(sp) 80004d66: 6a06 ld s4,64(sp) 80004d68: 7ae2 ld s5,56(sp) 80004d6a: 7b42 ld s6,48(sp) 80004d6c: 7ba2 ld s7,40(sp) 80004d6e: 7c02 ld s8,32(sp) 80004d70: 6ce2 ld s9,24(sp) 80004d72: 6165 addi sp,sp,112 80004d74: 8082 ret wakeup(&pi->nread); 80004d76: 8566 mv a0,s9 80004d78: ffffd097 auipc ra,0xffffd 80004d7c: 48e080e7 jalr 1166(ra) # 80002206 <wakeup> sleep(&pi->nwrite, &pi->lock); 80004d80: 85de mv a1,s7 80004d82: 8562 mv a0,s8 80004d84: ffffd097 auipc ra,0xffffd 80004d88: 2f6080e7 jalr 758(ra) # 8000207a <sleep> 80004d8c: a839 j 80004daa <pipewrite+0xa4> pi->data[pi->nwrite++ % PIPESIZE] = ch; 80004d8e: 21c4a783 lw a5,540(s1) 80004d92: 0017871b addiw a4,a5,1 80004d96: 20e4ae23 sw a4,540(s1) 80004d9a: 1ff7f793 andi a5,a5,511 80004d9e: 97a6 add a5,a5,s1 80004da0: f9f44703 lbu a4,-97(s0) 80004da4: 00e78c23 sb a4,24(a5) i++; 80004da8: 2905 addiw s2,s2,1 while(i < n){ 80004daa: 03495d63 bge s2,s4,80004de4 <pipewrite+0xde> if(pi->readopen == 0 || pr->killed){ 80004dae: 2204a783 lw a5,544(s1) 80004db2: dfd1 beqz a5,80004d4e <pipewrite+0x48> 80004db4: 0289a783 lw a5,40(s3) 80004db8: fbd9 bnez a5,80004d4e <pipewrite+0x48> if(pi->nwrite == pi->nread + PIPESIZE){ //DOC: pipewrite-full 80004dba: 2184a783 lw a5,536(s1) 80004dbe: 21c4a703 lw a4,540(s1) 80004dc2: 2007879b addiw a5,a5,512 80004dc6: faf708e3 beq a4,a5,80004d76 <pipewrite+0x70> if(copyin(pr->pagetable, &ch, addr + i, 1) == -1) 80004dca: 4685 li a3,1 80004dcc: 01590633 add a2,s2,s5 80004dd0: f9f40593 addi a1,s0,-97 80004dd4: 0509b503 ld a0,80(s3) 80004dd8: ffffd097 auipc ra,0xffffd 80004ddc: 926080e7 jalr -1754(ra) # 800016fe <copyin> 80004de0: fb6517e3 bne a0,s6,80004d8e <pipewrite+0x88> wakeup(&pi->nread); 80004de4: 21848513 addi a0,s1,536 80004de8: ffffd097 auipc ra,0xffffd 80004dec: 41e080e7 jalr 1054(ra) # 80002206 <wakeup> release(&pi->lock); 80004df0: 8526 mv a0,s1 80004df2: ffffc097 auipc ra,0xffffc 80004df6: ea6080e7 jalr -346(ra) # 80000c98 <release> return i; 80004dfa: b785 j 80004d5a <pipewrite+0x54> int i = 0; 80004dfc: 4901 li s2,0 80004dfe: b7dd j 80004de4 <pipewrite+0xde> 0000000080004e00 <piperead>: int piperead(struct pipe *pi, uint64 addr, int n) { 80004e00: 715d addi sp,sp,-80 80004e02: e486 sd ra,72(sp) 80004e04: e0a2 sd s0,64(sp) 80004e06: fc26 sd s1,56(sp) 80004e08: f84a sd s2,48(sp) 80004e0a: f44e sd s3,40(sp) 80004e0c: f052 sd s4,32(sp) 80004e0e: ec56 sd s5,24(sp) 80004e10: e85a sd s6,16(sp) 80004e12: 0880 addi s0,sp,80 80004e14: 84aa mv s1,a0 80004e16: 892e mv s2,a1 80004e18: 8ab2 mv s5,a2 int i; struct proc *pr = myproc(); 80004e1a: ffffd097 auipc ra,0xffffd 80004e1e: b9c080e7 jalr -1124(ra) # 800019b6 <myproc> 80004e22: 8a2a mv s4,a0 char ch; acquire(&pi->lock); 80004e24: 8b26 mv s6,s1 80004e26: 8526 mv a0,s1 80004e28: ffffc097 auipc ra,0xffffc 80004e2c: dbc080e7 jalr -580(ra) # 80000be4 <acquire> while(pi->nread == pi->nwrite && pi->writeopen){ //DOC: pipe-empty 80004e30: 2184a703 lw a4,536(s1) 80004e34: 21c4a783 lw a5,540(s1) if(pr->killed){ release(&pi->lock); return -1; } sleep(&pi->nread, &pi->lock); //DOC: piperead-sleep 80004e38: 21848993 addi s3,s1,536 while(pi->nread == pi->nwrite && pi->writeopen){ //DOC: pipe-empty 80004e3c: 02f71463 bne a4,a5,80004e64 <piperead+0x64> 80004e40: 2244a783 lw a5,548(s1) 80004e44: c385 beqz a5,80004e64 <piperead+0x64> if(pr->killed){ 80004e46: 028a2783 lw a5,40(s4) 80004e4a: ebc1 bnez a5,80004eda <piperead+0xda> sleep(&pi->nread, &pi->lock); //DOC: piperead-sleep 80004e4c: 85da mv a1,s6 80004e4e: 854e mv a0,s3 80004e50: ffffd097 auipc ra,0xffffd 80004e54: 22a080e7 jalr 554(ra) # 8000207a <sleep> while(pi->nread == pi->nwrite && pi->writeopen){ //DOC: pipe-empty 80004e58: 2184a703 lw a4,536(s1) 80004e5c: 21c4a783 lw a5,540(s1) 80004e60: fef700e3 beq a4,a5,80004e40 <piperead+0x40> } for(i = 0; i < n; i++){ //DOC: piperead-copy 80004e64: 09505263 blez s5,80004ee8 <piperead+0xe8> 80004e68: 4981 li s3,0 if(pi->nread == pi->nwrite) break; ch = pi->data[pi->nread++ % PIPESIZE]; if(copyout(pr->pagetable, addr + i, &ch, 1) == -1) 80004e6a: 5b7d li s6,-1 if(pi->nread == pi->nwrite) 80004e6c: 2184a783 lw a5,536(s1) 80004e70: 21c4a703 lw a4,540(s1) 80004e74: 02f70d63 beq a4,a5,80004eae <piperead+0xae> ch = pi->data[pi->nread++ % PIPESIZE]; 80004e78: 0017871b addiw a4,a5,1 80004e7c: 20e4ac23 sw a4,536(s1) 80004e80: 1ff7f793 andi a5,a5,511 80004e84: 97a6 add a5,a5,s1 80004e86: 0187c783 lbu a5,24(a5) 80004e8a: faf40fa3 sb a5,-65(s0) if(copyout(pr->pagetable, addr + i, &ch, 1) == -1) 80004e8e: 4685 li a3,1 80004e90: fbf40613 addi a2,s0,-65 80004e94: 85ca mv a1,s2 80004e96: 050a3503 ld a0,80(s4) 80004e9a: ffffc097 auipc ra,0xffffc 80004e9e: 7d8080e7 jalr 2008(ra) # 80001672 <copyout> 80004ea2: 01650663 beq a0,s6,80004eae <piperead+0xae> for(i = 0; i < n; i++){ //DOC: piperead-copy 80004ea6: 2985 addiw s3,s3,1 80004ea8: 0905 addi s2,s2,1 80004eaa: fd3a91e3 bne s5,s3,80004e6c <piperead+0x6c> break; } wakeup(&pi->nwrite); //DOC: piperead-wakeup 80004eae: 21c48513 addi a0,s1,540 80004eb2: ffffd097 auipc ra,0xffffd 80004eb6: 354080e7 jalr 852(ra) # 80002206 <wakeup> release(&pi->lock); 80004eba: 8526 mv a0,s1 80004ebc: ffffc097 auipc ra,0xffffc 80004ec0: ddc080e7 jalr -548(ra) # 80000c98 <release> return i; } 80004ec4: 854e mv a0,s3 80004ec6: 60a6 ld ra,72(sp) 80004ec8: 6406 ld s0,64(sp) 80004eca: 74e2 ld s1,56(sp) 80004ecc: 7942 ld s2,48(sp) 80004ece: 79a2 ld s3,40(sp) 80004ed0: 7a02 ld s4,32(sp) 80004ed2: 6ae2 ld s5,24(sp) 80004ed4: 6b42 ld s6,16(sp) 80004ed6: 6161 addi sp,sp,80 80004ed8: 8082 ret release(&pi->lock); 80004eda: 8526 mv a0,s1 80004edc: ffffc097 auipc ra,0xffffc 80004ee0: dbc080e7 jalr -580(ra) # 80000c98 <release> return -1; 80004ee4: 59fd li s3,-1 80004ee6: bff9 j 80004ec4 <piperead+0xc4> for(i = 0; i < n; i++){ //DOC: piperead-copy 80004ee8: 4981 li s3,0 80004eea: b7d1 j 80004eae <piperead+0xae> 0000000080004eec <exec>: static int loadseg(pde_t *pgdir, uint64 addr, struct inode *ip, uint offset, uint sz); int exec(char *path, char **argv) { 80004eec: df010113 addi sp,sp,-528 80004ef0: 20113423 sd ra,520(sp) 80004ef4: 20813023 sd s0,512(sp) 80004ef8: ffa6 sd s1,504(sp) 80004efa: fbca sd s2,496(sp) 80004efc: f7ce sd s3,488(sp) 80004efe: f3d2 sd s4,480(sp) 80004f00: efd6 sd s5,472(sp) 80004f02: ebda sd s6,464(sp) 80004f04: e7de sd s7,456(sp) 80004f06: e3e2 sd s8,448(sp) 80004f08: ff66 sd s9,440(sp) 80004f0a: fb6a sd s10,432(sp) 80004f0c: f76e sd s11,424(sp) 80004f0e: 0c00 addi s0,sp,528 80004f10: 84aa mv s1,a0 80004f12: dea43c23 sd a0,-520(s0) 80004f16: e0b43023 sd a1,-512(s0) uint64 argc, sz = 0, sp, ustack[MAXARG], stackbase; struct elfhdr elf; struct inode *ip; struct proghdr ph; pagetable_t pagetable = 0, oldpagetable; struct proc *p = myproc(); 80004f1a: ffffd097 auipc ra,0xffffd 80004f1e: a9c080e7 jalr -1380(ra) # 800019b6 <myproc> 80004f22: 892a mv s2,a0 begin_op(); 80004f24: fffff097 auipc ra,0xfffff 80004f28: 49c080e7 jalr 1180(ra) # 800043c0 <begin_op> if((ip = namei(path)) == 0){ 80004f2c: 8526 mv a0,s1 80004f2e: fffff097 auipc ra,0xfffff 80004f32: 276080e7 jalr 630(ra) # 800041a4 <namei> 80004f36: c92d beqz a0,80004fa8 <exec+0xbc> 80004f38: 84aa mv s1,a0 end_op(); return -1; } ilock(ip); 80004f3a: fffff097 auipc ra,0xfffff 80004f3e: ab4080e7 jalr -1356(ra) # 800039ee <ilock> // Check ELF header if(readi(ip, 0, (uint64)&elf, 0, sizeof(elf)) != sizeof(elf)) 80004f42: 04000713 li a4,64 80004f46: 4681 li a3,0 80004f48: e5040613 addi a2,s0,-432 80004f4c: 4581 li a1,0 80004f4e: 8526 mv a0,s1 80004f50: fffff097 auipc ra,0xfffff 80004f54: d52080e7 jalr -686(ra) # 80003ca2 <readi> 80004f58: 04000793 li a5,64 80004f5c: 00f51a63 bne a0,a5,80004f70 <exec+0x84> goto bad; if(elf.magic != ELF_MAGIC) 80004f60: e5042703 lw a4,-432(s0) 80004f64: 464c47b7 lui a5,0x464c4 80004f68: 57f78793 addi a5,a5,1407 # 464c457f <_entry-0x39b3ba81> 80004f6c: 04f70463 beq a4,a5,80004fb4 <exec+0xc8> bad: if(pagetable) proc_freepagetable(pagetable, sz); if(ip){ iunlockput(ip); 80004f70: 8526 mv a0,s1 80004f72: fffff097 auipc ra,0xfffff 80004f76: cde080e7 jalr -802(ra) # 80003c50 <iunlockput> end_op(); 80004f7a: fffff097 auipc ra,0xfffff 80004f7e: 4c6080e7 jalr 1222(ra) # 80004440 <end_op> } return -1; 80004f82: 557d li a0,-1 } 80004f84: 20813083 ld ra,520(sp) 80004f88: 20013403 ld s0,512(sp) 80004f8c: 74fe ld s1,504(sp) 80004f8e: 795e ld s2,496(sp) 80004f90: 79be ld s3,488(sp) 80004f92: 7a1e ld s4,480(sp) 80004f94: 6afe ld s5,472(sp) 80004f96: 6b5e ld s6,464(sp) 80004f98: 6bbe ld s7,456(sp) 80004f9a: 6c1e ld s8,448(sp) 80004f9c: 7cfa ld s9,440(sp) 80004f9e: 7d5a ld s10,432(sp) 80004fa0: 7dba ld s11,424(sp) 80004fa2: 21010113 addi sp,sp,528 80004fa6: 8082 ret end_op(); 80004fa8: fffff097 auipc ra,0xfffff 80004fac: 498080e7 jalr 1176(ra) # 80004440 <end_op> return -1; 80004fb0: 557d li a0,-1 80004fb2: bfc9 j 80004f84 <exec+0x98> if((pagetable = proc_pagetable(p)) == 0) 80004fb4: 854a mv a0,s2 80004fb6: ffffd097 auipc ra,0xffffd 80004fba: aca080e7 jalr -1334(ra) # 80001a80 <proc_pagetable> 80004fbe: 8baa mv s7,a0 80004fc0: d945 beqz a0,80004f70 <exec+0x84> for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80004fc2: e7042983 lw s3,-400(s0) 80004fc6: e8845783 lhu a5,-376(s0) 80004fca: c7ad beqz a5,80005034 <exec+0x148> uint64 argc, sz = 0, sp, ustack[MAXARG], stackbase; 80004fcc: 4901 li s2,0 for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 80004fce: 4b01 li s6,0 if((ph.vaddr % PGSIZE) != 0) 80004fd0: 6c85 lui s9,0x1 80004fd2: fffc8793 addi a5,s9,-1 # fff <_entry-0x7ffff001> 80004fd6: def43823 sd a5,-528(s0) 80004fda: a42d j 80005204 <exec+0x318> uint64 pa; for(i = 0; i < sz; i += PGSIZE){ pa = walkaddr(pagetable, va + i); if(pa == 0) panic("loadseg: address should exist"); 80004fdc: 00003517 auipc a0,0x3 80004fe0: 7ec50513 addi a0,a0,2028 # 800087c8 <syscalls+0x2a0> 80004fe4: ffffb097 auipc ra,0xffffb 80004fe8: 55a080e7 jalr 1370(ra) # 8000053e <panic> if(sz - i < PGSIZE) n = sz - i; else n = PGSIZE; if(readi(ip, 0, (uint64)pa, offset+i, n) != n) 80004fec: 8756 mv a4,s5 80004fee: 012d86bb addw a3,s11,s2 80004ff2: 4581 li a1,0 80004ff4: 8526 mv a0,s1 80004ff6: fffff097 auipc ra,0xfffff 80004ffa: cac080e7 jalr -852(ra) # 80003ca2 <readi> 80004ffe: 2501 sext.w a0,a0 80005000: 1aaa9963 bne s5,a0,800051b2 <exec+0x2c6> for(i = 0; i < sz; i += PGSIZE){ 80005004: 6785 lui a5,0x1 80005006: 0127893b addw s2,a5,s2 8000500a: 77fd lui a5,0xfffff 8000500c: 01478a3b addw s4,a5,s4 80005010: 1f897163 bgeu s2,s8,800051f2 <exec+0x306> pa = walkaddr(pagetable, va + i); 80005014: 02091593 slli a1,s2,0x20 80005018: 9181 srli a1,a1,0x20 8000501a: 95ea add a1,a1,s10 8000501c: 855e mv a0,s7 8000501e: ffffc097 auipc ra,0xffffc 80005022: 050080e7 jalr 80(ra) # 8000106e <walkaddr> 80005026: 862a mv a2,a0 if(pa == 0) 80005028: d955 beqz a0,80004fdc <exec+0xf0> n = PGSIZE; 8000502a: 8ae6 mv s5,s9 if(sz - i < PGSIZE) 8000502c: fd9a70e3 bgeu s4,s9,80004fec <exec+0x100> n = sz - i; 80005030: 8ad2 mv s5,s4 80005032: bf6d j 80004fec <exec+0x100> uint64 argc, sz = 0, sp, ustack[MAXARG], stackbase; 80005034: 4901 li s2,0 iunlockput(ip); 80005036: 8526 mv a0,s1 80005038: fffff097 auipc ra,0xfffff 8000503c: c18080e7 jalr -1000(ra) # 80003c50 <iunlockput> end_op(); 80005040: fffff097 auipc ra,0xfffff 80005044: 400080e7 jalr 1024(ra) # 80004440 <end_op> p = myproc(); 80005048: ffffd097 auipc ra,0xffffd 8000504c: 96e080e7 jalr -1682(ra) # 800019b6 <myproc> 80005050: 8aaa mv s5,a0 uint64 oldsz = p->sz; 80005052: 04853d03 ld s10,72(a0) sz = PGROUNDUP(sz); 80005056: 6785 lui a5,0x1 80005058: 17fd addi a5,a5,-1 8000505a: 993e add s2,s2,a5 8000505c: 757d lui a0,0xfffff 8000505e: 00a977b3 and a5,s2,a0 80005062: e0f43423 sd a5,-504(s0) if((sz1 = uvmalloc(pagetable, sz, sz + 2*PGSIZE)) == 0) 80005066: 6609 lui a2,0x2 80005068: 963e add a2,a2,a5 8000506a: 85be mv a1,a5 8000506c: 855e mv a0,s7 8000506e: ffffc097 auipc ra,0xffffc 80005072: 3b4080e7 jalr 948(ra) # 80001422 <uvmalloc> 80005076: 8b2a mv s6,a0 ip = 0; 80005078: 4481 li s1,0 if((sz1 = uvmalloc(pagetable, sz, sz + 2*PGSIZE)) == 0) 8000507a: 12050c63 beqz a0,800051b2 <exec+0x2c6> uvmclear(pagetable, sz-2*PGSIZE); 8000507e: 75f9 lui a1,0xffffe 80005080: 95aa add a1,a1,a0 80005082: 855e mv a0,s7 80005084: ffffc097 auipc ra,0xffffc 80005088: 5bc080e7 jalr 1468(ra) # 80001640 <uvmclear> stackbase = sp - PGSIZE; 8000508c: 7c7d lui s8,0xfffff 8000508e: 9c5a add s8,s8,s6 for(argc = 0; argv[argc]; argc++) { 80005090: e0043783 ld a5,-512(s0) 80005094: 6388 ld a0,0(a5) 80005096: c535 beqz a0,80005102 <exec+0x216> 80005098: e9040993 addi s3,s0,-368 8000509c: f9040c93 addi s9,s0,-112 sp = sz; 800050a0: 895a mv s2,s6 sp -= strlen(argv[argc]) + 1; 800050a2: ffffc097 auipc ra,0xffffc 800050a6: dc2080e7 jalr -574(ra) # 80000e64 <strlen> 800050aa: 2505 addiw a0,a0,1 800050ac: 40a90933 sub s2,s2,a0 sp -= sp % 16; // riscv sp must be 16-byte aligned 800050b0: ff097913 andi s2,s2,-16 if(sp < stackbase) 800050b4: 13896363 bltu s2,s8,800051da <exec+0x2ee> if(copyout(pagetable, sp, argv[argc], strlen(argv[argc]) + 1) < 0) 800050b8: e0043d83 ld s11,-512(s0) 800050bc: 000dba03 ld s4,0(s11) 800050c0: 8552 mv a0,s4 800050c2: ffffc097 auipc ra,0xffffc 800050c6: da2080e7 jalr -606(ra) # 80000e64 <strlen> 800050ca: 0015069b addiw a3,a0,1 800050ce: 8652 mv a2,s4 800050d0: 85ca mv a1,s2 800050d2: 855e mv a0,s7 800050d4: ffffc097 auipc ra,0xffffc 800050d8: 59e080e7 jalr 1438(ra) # 80001672 <copyout> 800050dc: 10054363 bltz a0,800051e2 <exec+0x2f6> ustack[argc] = sp; 800050e0: 0129b023 sd s2,0(s3) for(argc = 0; argv[argc]; argc++) { 800050e4: 0485 addi s1,s1,1 800050e6: 008d8793 addi a5,s11,8 800050ea: e0f43023 sd a5,-512(s0) 800050ee: 008db503 ld a0,8(s11) 800050f2: c911 beqz a0,80005106 <exec+0x21a> if(argc >= MAXARG) 800050f4: 09a1 addi s3,s3,8 800050f6: fb3c96e3 bne s9,s3,800050a2 <exec+0x1b6> sz = sz1; 800050fa: e1643423 sd s6,-504(s0) ip = 0; 800050fe: 4481 li s1,0 80005100: a84d j 800051b2 <exec+0x2c6> sp = sz; 80005102: 895a mv s2,s6 for(argc = 0; argv[argc]; argc++) { 80005104: 4481 li s1,0 ustack[argc] = 0; 80005106: 00349793 slli a5,s1,0x3 8000510a: f9040713 addi a4,s0,-112 8000510e: 97ba add a5,a5,a4 80005110: f007b023 sd zero,-256(a5) # f00 <_entry-0x7ffff100> sp -= (argc+1) * sizeof(uint64); 80005114: 00148693 addi a3,s1,1 80005118: 068e slli a3,a3,0x3 8000511a: 40d90933 sub s2,s2,a3 sp -= sp % 16; 8000511e: ff097913 andi s2,s2,-16 if(sp < stackbase) 80005122: 01897663 bgeu s2,s8,8000512e <exec+0x242> sz = sz1; 80005126: e1643423 sd s6,-504(s0) ip = 0; 8000512a: 4481 li s1,0 8000512c: a059 j 800051b2 <exec+0x2c6> if(copyout(pagetable, sp, (char *)ustack, (argc+1)*sizeof(uint64)) < 0) 8000512e: e9040613 addi a2,s0,-368 80005132: 85ca mv a1,s2 80005134: 855e mv a0,s7 80005136: ffffc097 auipc ra,0xffffc 8000513a: 53c080e7 jalr 1340(ra) # 80001672 <copyout> 8000513e: 0a054663 bltz a0,800051ea <exec+0x2fe> p->trapframe->a1 = sp; 80005142: 058ab783 ld a5,88(s5) 80005146: 0727bc23 sd s2,120(a5) for(last=s=path; *s; s++) 8000514a: df843783 ld a5,-520(s0) 8000514e: 0007c703 lbu a4,0(a5) 80005152: cf11 beqz a4,8000516e <exec+0x282> 80005154: 0785 addi a5,a5,1 if(*s == '/') 80005156: 02f00693 li a3,47 8000515a: a039 j 80005168 <exec+0x27c> last = s+1; 8000515c: def43c23 sd a5,-520(s0) for(last=s=path; *s; s++) 80005160: 0785 addi a5,a5,1 80005162: fff7c703 lbu a4,-1(a5) 80005166: c701 beqz a4,8000516e <exec+0x282> if(*s == '/') 80005168: fed71ce3 bne a4,a3,80005160 <exec+0x274> 8000516c: bfc5 j 8000515c <exec+0x270> safestrcpy(p->name, last, sizeof(p->name)); 8000516e: 4641 li a2,16 80005170: df843583 ld a1,-520(s0) 80005174: 158a8513 addi a0,s5,344 80005178: ffffc097 auipc ra,0xffffc 8000517c: cba080e7 jalr -838(ra) # 80000e32 <safestrcpy> oldpagetable = p->pagetable; 80005180: 050ab503 ld a0,80(s5) p->pagetable = pagetable; 80005184: 057ab823 sd s7,80(s5) p->sz = sz; 80005188: 056ab423 sd s6,72(s5) p->trapframe->epc = elf.entry; // initial program counter = main 8000518c: 058ab783 ld a5,88(s5) 80005190: e6843703 ld a4,-408(s0) 80005194: ef98 sd a4,24(a5) p->trapframe->sp = sp; // initial stack pointer 80005196: 058ab783 ld a5,88(s5) 8000519a: 0327b823 sd s2,48(a5) proc_freepagetable(oldpagetable, oldsz); 8000519e: 85ea mv a1,s10 800051a0: ffffd097 auipc ra,0xffffd 800051a4: 97c080e7 jalr -1668(ra) # 80001b1c <proc_freepagetable> return argc; // this ends up in a0, the first argument to main(argc, argv) 800051a8: 0004851b sext.w a0,s1 800051ac: bbe1 j 80004f84 <exec+0x98> 800051ae: e1243423 sd s2,-504(s0) proc_freepagetable(pagetable, sz); 800051b2: e0843583 ld a1,-504(s0) 800051b6: 855e mv a0,s7 800051b8: ffffd097 auipc ra,0xffffd 800051bc: 964080e7 jalr -1692(ra) # 80001b1c <proc_freepagetable> if(ip){ 800051c0: da0498e3 bnez s1,80004f70 <exec+0x84> return -1; 800051c4: 557d li a0,-1 800051c6: bb7d j 80004f84 <exec+0x98> 800051c8: e1243423 sd s2,-504(s0) 800051cc: b7dd j 800051b2 <exec+0x2c6> 800051ce: e1243423 sd s2,-504(s0) 800051d2: b7c5 j 800051b2 <exec+0x2c6> 800051d4: e1243423 sd s2,-504(s0) 800051d8: bfe9 j 800051b2 <exec+0x2c6> sz = sz1; 800051da: e1643423 sd s6,-504(s0) ip = 0; 800051de: 4481 li s1,0 800051e0: bfc9 j 800051b2 <exec+0x2c6> sz = sz1; 800051e2: e1643423 sd s6,-504(s0) ip = 0; 800051e6: 4481 li s1,0 800051e8: b7e9 j 800051b2 <exec+0x2c6> sz = sz1; 800051ea: e1643423 sd s6,-504(s0) ip = 0; 800051ee: 4481 li s1,0 800051f0: b7c9 j 800051b2 <exec+0x2c6> if((sz1 = uvmalloc(pagetable, sz, ph.vaddr + ph.memsz)) == 0) 800051f2: e0843903 ld s2,-504(s0) for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){ 800051f6: 2b05 addiw s6,s6,1 800051f8: 0389899b addiw s3,s3,56 800051fc: e8845783 lhu a5,-376(s0) 80005200: e2fb5be3 bge s6,a5,80005036 <exec+0x14a> if(readi(ip, 0, (uint64)&ph, off, sizeof(ph)) != sizeof(ph)) 80005204: 2981 sext.w s3,s3 80005206: 03800713 li a4,56 8000520a: 86ce mv a3,s3 8000520c: e1840613 addi a2,s0,-488 80005210: 4581 li a1,0 80005212: 8526 mv a0,s1 80005214: fffff097 auipc ra,0xfffff 80005218: a8e080e7 jalr -1394(ra) # 80003ca2 <readi> 8000521c: 03800793 li a5,56 80005220: f8f517e3 bne a0,a5,800051ae <exec+0x2c2> if(ph.type != ELF_PROG_LOAD) 80005224: e1842783 lw a5,-488(s0) 80005228: 4705 li a4,1 8000522a: fce796e3 bne a5,a4,800051f6 <exec+0x30a> if(ph.memsz < ph.filesz) 8000522e: e4043603 ld a2,-448(s0) 80005232: e3843783 ld a5,-456(s0) 80005236: f8f669e3 bltu a2,a5,800051c8 <exec+0x2dc> if(ph.vaddr + ph.memsz < ph.vaddr) 8000523a: e2843783 ld a5,-472(s0) 8000523e: 963e add a2,a2,a5 80005240: f8f667e3 bltu a2,a5,800051ce <exec+0x2e2> if((sz1 = uvmalloc(pagetable, sz, ph.vaddr + ph.memsz)) == 0) 80005244: 85ca mv a1,s2 80005246: 855e mv a0,s7 80005248: ffffc097 auipc ra,0xffffc 8000524c: 1da080e7 jalr 474(ra) # 80001422 <uvmalloc> 80005250: e0a43423 sd a0,-504(s0) 80005254: d141 beqz a0,800051d4 <exec+0x2e8> if((ph.vaddr % PGSIZE) != 0) 80005256: e2843d03 ld s10,-472(s0) 8000525a: df043783 ld a5,-528(s0) 8000525e: 00fd77b3 and a5,s10,a5 80005262: fba1 bnez a5,800051b2 <exec+0x2c6> if(loadseg(pagetable, ph.vaddr, ip, ph.off, ph.filesz) < 0) 80005264: e2042d83 lw s11,-480(s0) 80005268: e3842c03 lw s8,-456(s0) for(i = 0; i < sz; i += PGSIZE){ 8000526c: f80c03e3 beqz s8,800051f2 <exec+0x306> 80005270: 8a62 mv s4,s8 80005272: 4901 li s2,0 80005274: b345 j 80005014 <exec+0x128> 0000000080005276 <argfd>: // Fetch the nth word-sized system call argument as a file descriptor // and return both the descriptor and the corresponding struct file. static int argfd(int n, int *pfd, struct file **pf) { 80005276: 7179 addi sp,sp,-48 80005278: f406 sd ra,40(sp) 8000527a: f022 sd s0,32(sp) 8000527c: ec26 sd s1,24(sp) 8000527e: e84a sd s2,16(sp) 80005280: 1800 addi s0,sp,48 80005282: 892e mv s2,a1 80005284: 84b2 mv s1,a2 int fd; struct file *f; if(argint(n, &fd) < 0) 80005286: fdc40593 addi a1,s0,-36 8000528a: ffffe097 auipc ra,0xffffe 8000528e: b42080e7 jalr -1214(ra) # 80002dcc <argint> 80005292: 04054063 bltz a0,800052d2 <argfd+0x5c> return -1; if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0) 80005296: fdc42703 lw a4,-36(s0) 8000529a: 47bd li a5,15 8000529c: 02e7ed63 bltu a5,a4,800052d6 <argfd+0x60> 800052a0: ffffc097 auipc ra,0xffffc 800052a4: 716080e7 jalr 1814(ra) # 800019b6 <myproc> 800052a8: fdc42703 lw a4,-36(s0) 800052ac: 01a70793 addi a5,a4,26 800052b0: 078e slli a5,a5,0x3 800052b2: 953e add a0,a0,a5 800052b4: 611c ld a5,0(a0) 800052b6: c395 beqz a5,800052da <argfd+0x64> return -1; if(pfd) 800052b8: 00090463 beqz s2,800052c0 <argfd+0x4a> *pfd = fd; 800052bc: 00e92023 sw a4,0(s2) if(pf) *pf = f; return 0; 800052c0: 4501 li a0,0 if(pf) 800052c2: c091 beqz s1,800052c6 <argfd+0x50> *pf = f; 800052c4: e09c sd a5,0(s1) } 800052c6: 70a2 ld ra,40(sp) 800052c8: 7402 ld s0,32(sp) 800052ca: 64e2 ld s1,24(sp) 800052cc: 6942 ld s2,16(sp) 800052ce: 6145 addi sp,sp,48 800052d0: 8082 ret return -1; 800052d2: 557d li a0,-1 800052d4: bfcd j 800052c6 <argfd+0x50> return -1; 800052d6: 557d li a0,-1 800052d8: b7fd j 800052c6 <argfd+0x50> 800052da: 557d li a0,-1 800052dc: b7ed j 800052c6 <argfd+0x50> 00000000800052de <fdalloc>: // Allocate a file descriptor for the given file. // Takes over file reference from caller on success. static int fdalloc(struct file *f) { 800052de: 1101 addi sp,sp,-32 800052e0: ec06 sd ra,24(sp) 800052e2: e822 sd s0,16(sp) 800052e4: e426 sd s1,8(sp) 800052e6: 1000 addi s0,sp,32 800052e8: 84aa mv s1,a0 int fd; struct proc *p = myproc(); 800052ea: ffffc097 auipc ra,0xffffc 800052ee: 6cc080e7 jalr 1740(ra) # 800019b6 <myproc> 800052f2: 862a mv a2,a0 for(fd = 0; fd < NOFILE; fd++){ 800052f4: 0d050793 addi a5,a0,208 # fffffffffffff0d0 <end+0xffffffff7ffd80d0> 800052f8: 4501 li a0,0 800052fa: 46c1 li a3,16 if(p->ofile[fd] == 0){ 800052fc: 6398 ld a4,0(a5) 800052fe: cb19 beqz a4,80005314 <fdalloc+0x36> for(fd = 0; fd < NOFILE; fd++){ 80005300: 2505 addiw a0,a0,1 80005302: 07a1 addi a5,a5,8 80005304: fed51ce3 bne a0,a3,800052fc <fdalloc+0x1e> p->ofile[fd] = f; return fd; } } return -1; 80005308: 557d li a0,-1 } 8000530a: 60e2 ld ra,24(sp) 8000530c: 6442 ld s0,16(sp) 8000530e: 64a2 ld s1,8(sp) 80005310: 6105 addi sp,sp,32 80005312: 8082 ret p->ofile[fd] = f; 80005314: 01a50793 addi a5,a0,26 80005318: 078e slli a5,a5,0x3 8000531a: 963e add a2,a2,a5 8000531c: e204 sd s1,0(a2) return fd; 8000531e: b7f5 j 8000530a <fdalloc+0x2c> 0000000080005320 <create>: return -1; } static struct inode* create(char *path, short type, short major, short minor) { 80005320: 715d addi sp,sp,-80 80005322: e486 sd ra,72(sp) 80005324: e0a2 sd s0,64(sp) 80005326: fc26 sd s1,56(sp) 80005328: f84a sd s2,48(sp) 8000532a: f44e sd s3,40(sp) 8000532c: f052 sd s4,32(sp) 8000532e: ec56 sd s5,24(sp) 80005330: 0880 addi s0,sp,80 80005332: 89ae mv s3,a1 80005334: 8ab2 mv s5,a2 80005336: 8a36 mv s4,a3 struct inode *ip, *dp; char name[DIRSIZ]; if((dp = nameiparent(path, name)) == 0) 80005338: fb040593 addi a1,s0,-80 8000533c: fffff097 auipc ra,0xfffff 80005340: e86080e7 jalr -378(ra) # 800041c2 <nameiparent> 80005344: 892a mv s2,a0 80005346: 12050f63 beqz a0,80005484 <create+0x164> return 0; ilock(dp); 8000534a: ffffe097 auipc ra,0xffffe 8000534e: 6a4080e7 jalr 1700(ra) # 800039ee <ilock> if((ip = dirlookup(dp, name, 0)) != 0){ 80005352: 4601 li a2,0 80005354: fb040593 addi a1,s0,-80 80005358: 854a mv a0,s2 8000535a: fffff097 auipc ra,0xfffff 8000535e: b78080e7 jalr -1160(ra) # 80003ed2 <dirlookup> 80005362: 84aa mv s1,a0 80005364: c921 beqz a0,800053b4 <create+0x94> iunlockput(dp); 80005366: 854a mv a0,s2 80005368: fffff097 auipc ra,0xfffff 8000536c: 8e8080e7 jalr -1816(ra) # 80003c50 <iunlockput> ilock(ip); 80005370: 8526 mv a0,s1 80005372: ffffe097 auipc ra,0xffffe 80005376: 67c080e7 jalr 1660(ra) # 800039ee <ilock> if(type == T_FILE && (ip->type == T_FILE || ip->type == T_DEVICE)) 8000537a: 2981 sext.w s3,s3 8000537c: 4789 li a5,2 8000537e: 02f99463 bne s3,a5,800053a6 <create+0x86> 80005382: 0444d783 lhu a5,68(s1) 80005386: 37f9 addiw a5,a5,-2 80005388: 17c2 slli a5,a5,0x30 8000538a: 93c1 srli a5,a5,0x30 8000538c: 4705 li a4,1 8000538e: 00f76c63 bltu a4,a5,800053a6 <create+0x86> panic("create: dirlink"); iunlockput(dp); return ip; } 80005392: 8526 mv a0,s1 80005394: 60a6 ld ra,72(sp) 80005396: 6406 ld s0,64(sp) 80005398: 74e2 ld s1,56(sp) 8000539a: 7942 ld s2,48(sp) 8000539c: 79a2 ld s3,40(sp) 8000539e: 7a02 ld s4,32(sp) 800053a0: 6ae2 ld s5,24(sp) 800053a2: 6161 addi sp,sp,80 800053a4: 8082 ret iunlockput(ip); 800053a6: 8526 mv a0,s1 800053a8: fffff097 auipc ra,0xfffff 800053ac: 8a8080e7 jalr -1880(ra) # 80003c50 <iunlockput> return 0; 800053b0: 4481 li s1,0 800053b2: b7c5 j 80005392 <create+0x72> if((ip = ialloc(dp->dev, type)) == 0) 800053b4: 85ce mv a1,s3 800053b6: 00092503 lw a0,0(s2) 800053ba: ffffe097 auipc ra,0xffffe 800053be: 49c080e7 jalr 1180(ra) # 80003856 <ialloc> 800053c2: 84aa mv s1,a0 800053c4: c529 beqz a0,8000540e <create+0xee> ilock(ip); 800053c6: ffffe097 auipc ra,0xffffe 800053ca: 628080e7 jalr 1576(ra) # 800039ee <ilock> ip->major = major; 800053ce: 05549323 sh s5,70(s1) ip->minor = minor; 800053d2: 05449423 sh s4,72(s1) ip->nlink = 1; 800053d6: 4785 li a5,1 800053d8: 04f49523 sh a5,74(s1) iupdate(ip); 800053dc: 8526 mv a0,s1 800053de: ffffe097 auipc ra,0xffffe 800053e2: 546080e7 jalr 1350(ra) # 80003924 <iupdate> if(type == T_DIR){ // Create . and .. entries. 800053e6: 2981 sext.w s3,s3 800053e8: 4785 li a5,1 800053ea: 02f98a63 beq s3,a5,8000541e <create+0xfe> if(dirlink(dp, name, ip->inum) < 0) 800053ee: 40d0 lw a2,4(s1) 800053f0: fb040593 addi a1,s0,-80 800053f4: 854a mv a0,s2 800053f6: fffff097 auipc ra,0xfffff 800053fa: cec080e7 jalr -788(ra) # 800040e2 <dirlink> 800053fe: 06054b63 bltz a0,80005474 <create+0x154> iunlockput(dp); 80005402: 854a mv a0,s2 80005404: fffff097 auipc ra,0xfffff 80005408: 84c080e7 jalr -1972(ra) # 80003c50 <iunlockput> return ip; 8000540c: b759 j 80005392 <create+0x72> panic("create: ialloc"); 8000540e: 00003517 auipc a0,0x3 80005412: 3da50513 addi a0,a0,986 # 800087e8 <syscalls+0x2c0> 80005416: ffffb097 auipc ra,0xffffb 8000541a: 128080e7 jalr 296(ra) # 8000053e <panic> dp->nlink++; // for ".." 8000541e: 04a95783 lhu a5,74(s2) 80005422: 2785 addiw a5,a5,1 80005424: 04f91523 sh a5,74(s2) iupdate(dp); 80005428: 854a mv a0,s2 8000542a: ffffe097 auipc ra,0xffffe 8000542e: 4fa080e7 jalr 1274(ra) # 80003924 <iupdate> if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0) 80005432: 40d0 lw a2,4(s1) 80005434: 00003597 auipc a1,0x3 80005438: 3c458593 addi a1,a1,964 # 800087f8 <syscalls+0x2d0> 8000543c: 8526 mv a0,s1 8000543e: fffff097 auipc ra,0xfffff 80005442: ca4080e7 jalr -860(ra) # 800040e2 <dirlink> 80005446: 00054f63 bltz a0,80005464 <create+0x144> 8000544a: 00492603 lw a2,4(s2) 8000544e: 00003597 auipc a1,0x3 80005452: 3b258593 addi a1,a1,946 # 80008800 <syscalls+0x2d8> 80005456: 8526 mv a0,s1 80005458: fffff097 auipc ra,0xfffff 8000545c: c8a080e7 jalr -886(ra) # 800040e2 <dirlink> 80005460: f80557e3 bgez a0,800053ee <create+0xce> panic("create dots"); 80005464: 00003517 auipc a0,0x3 80005468: 3a450513 addi a0,a0,932 # 80008808 <syscalls+0x2e0> 8000546c: ffffb097 auipc ra,0xffffb 80005470: 0d2080e7 jalr 210(ra) # 8000053e <panic> panic("create: dirlink"); 80005474: 00003517 auipc a0,0x3 80005478: 3a450513 addi a0,a0,932 # 80008818 <syscalls+0x2f0> 8000547c: ffffb097 auipc ra,0xffffb 80005480: 0c2080e7 jalr 194(ra) # 8000053e <panic> return 0; 80005484: 84aa mv s1,a0 80005486: b731 j 80005392 <create+0x72> 0000000080005488 <sys_dup>: { 80005488: 7179 addi sp,sp,-48 8000548a: f406 sd ra,40(sp) 8000548c: f022 sd s0,32(sp) 8000548e: ec26 sd s1,24(sp) 80005490: 1800 addi s0,sp,48 if(argfd(0, 0, &f) < 0) 80005492: fd840613 addi a2,s0,-40 80005496: 4581 li a1,0 80005498: 4501 li a0,0 8000549a: 00000097 auipc ra,0x0 8000549e: ddc080e7 jalr -548(ra) # 80005276 <argfd> return -1; 800054a2: 57fd li a5,-1 if(argfd(0, 0, &f) < 0) 800054a4: 02054363 bltz a0,800054ca <sys_dup+0x42> if((fd=fdalloc(f)) < 0) 800054a8: fd843503 ld a0,-40(s0) 800054ac: 00000097 auipc ra,0x0 800054b0: e32080e7 jalr -462(ra) # 800052de <fdalloc> 800054b4: 84aa mv s1,a0 return -1; 800054b6: 57fd li a5,-1 if((fd=fdalloc(f)) < 0) 800054b8: 00054963 bltz a0,800054ca <sys_dup+0x42> filedup(f); 800054bc: fd843503 ld a0,-40(s0) 800054c0: fffff097 auipc ra,0xfffff 800054c4: 37a080e7 jalr 890(ra) # 8000483a <filedup> return fd; 800054c8: 87a6 mv a5,s1 } 800054ca: 853e mv a0,a5 800054cc: 70a2 ld ra,40(sp) 800054ce: 7402 ld s0,32(sp) 800054d0: 64e2 ld s1,24(sp) 800054d2: 6145 addi sp,sp,48 800054d4: 8082 ret 00000000800054d6 <sys_read>: { 800054d6: 7179 addi sp,sp,-48 800054d8: f406 sd ra,40(sp) 800054da: f022 sd s0,32(sp) 800054dc: 1800 addi s0,sp,48 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 800054de: fe840613 addi a2,s0,-24 800054e2: 4581 li a1,0 800054e4: 4501 li a0,0 800054e6: 00000097 auipc ra,0x0 800054ea: d90080e7 jalr -624(ra) # 80005276 <argfd> return -1; 800054ee: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 800054f0: 04054163 bltz a0,80005532 <sys_read+0x5c> 800054f4: fe440593 addi a1,s0,-28 800054f8: 4509 li a0,2 800054fa: ffffe097 auipc ra,0xffffe 800054fe: 8d2080e7 jalr -1838(ra) # 80002dcc <argint> return -1; 80005502: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 80005504: 02054763 bltz a0,80005532 <sys_read+0x5c> 80005508: fd840593 addi a1,s0,-40 8000550c: 4505 li a0,1 8000550e: ffffe097 auipc ra,0xffffe 80005512: 8e0080e7 jalr -1824(ra) # 80002dee <argaddr> return -1; 80005516: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 80005518: 00054d63 bltz a0,80005532 <sys_read+0x5c> return fileread(f, p, n); 8000551c: fe442603 lw a2,-28(s0) 80005520: fd843583 ld a1,-40(s0) 80005524: fe843503 ld a0,-24(s0) 80005528: fffff097 auipc ra,0xfffff 8000552c: 49e080e7 jalr 1182(ra) # 800049c6 <fileread> 80005530: 87aa mv a5,a0 } 80005532: 853e mv a0,a5 80005534: 70a2 ld ra,40(sp) 80005536: 7402 ld s0,32(sp) 80005538: 6145 addi sp,sp,48 8000553a: 8082 ret 000000008000553c <sys_write>: { 8000553c: 7179 addi sp,sp,-48 8000553e: f406 sd ra,40(sp) 80005540: f022 sd s0,32(sp) 80005542: 1800 addi s0,sp,48 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 80005544: fe840613 addi a2,s0,-24 80005548: 4581 li a1,0 8000554a: 4501 li a0,0 8000554c: 00000097 auipc ra,0x0 80005550: d2a080e7 jalr -726(ra) # 80005276 <argfd> return -1; 80005554: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 80005556: 04054163 bltz a0,80005598 <sys_write+0x5c> 8000555a: fe440593 addi a1,s0,-28 8000555e: 4509 li a0,2 80005560: ffffe097 auipc ra,0xffffe 80005564: 86c080e7 jalr -1940(ra) # 80002dcc <argint> return -1; 80005568: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 8000556a: 02054763 bltz a0,80005598 <sys_write+0x5c> 8000556e: fd840593 addi a1,s0,-40 80005572: 4505 li a0,1 80005574: ffffe097 auipc ra,0xffffe 80005578: 87a080e7 jalr -1926(ra) # 80002dee <argaddr> return -1; 8000557c: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argaddr(1, &p) < 0) 8000557e: 00054d63 bltz a0,80005598 <sys_write+0x5c> return filewrite(f, p, n); 80005582: fe442603 lw a2,-28(s0) 80005586: fd843583 ld a1,-40(s0) 8000558a: fe843503 ld a0,-24(s0) 8000558e: fffff097 auipc ra,0xfffff 80005592: 4fa080e7 jalr 1274(ra) # 80004a88 <filewrite> 80005596: 87aa mv a5,a0 } 80005598: 853e mv a0,a5 8000559a: 70a2 ld ra,40(sp) 8000559c: 7402 ld s0,32(sp) 8000559e: 6145 addi sp,sp,48 800055a0: 8082 ret 00000000800055a2 <sys_close>: { 800055a2: 1101 addi sp,sp,-32 800055a4: ec06 sd ra,24(sp) 800055a6: e822 sd s0,16(sp) 800055a8: 1000 addi s0,sp,32 if(argfd(0, &fd, &f) < 0) 800055aa: fe040613 addi a2,s0,-32 800055ae: fec40593 addi a1,s0,-20 800055b2: 4501 li a0,0 800055b4: 00000097 auipc ra,0x0 800055b8: cc2080e7 jalr -830(ra) # 80005276 <argfd> return -1; 800055bc: 57fd li a5,-1 if(argfd(0, &fd, &f) < 0) 800055be: 02054463 bltz a0,800055e6 <sys_close+0x44> myproc()->ofile[fd] = 0; 800055c2: ffffc097 auipc ra,0xffffc 800055c6: 3f4080e7 jalr 1012(ra) # 800019b6 <myproc> 800055ca: fec42783 lw a5,-20(s0) 800055ce: 07e9 addi a5,a5,26 800055d0: 078e slli a5,a5,0x3 800055d2: 97aa add a5,a5,a0 800055d4: 0007b023 sd zero,0(a5) fileclose(f); 800055d8: fe043503 ld a0,-32(s0) 800055dc: fffff097 auipc ra,0xfffff 800055e0: 2b0080e7 jalr 688(ra) # 8000488c <fileclose> return 0; 800055e4: 4781 li a5,0 } 800055e6: 853e mv a0,a5 800055e8: 60e2 ld ra,24(sp) 800055ea: 6442 ld s0,16(sp) 800055ec: 6105 addi sp,sp,32 800055ee: 8082 ret 00000000800055f0 <sys_fstat>: { 800055f0: 1101 addi sp,sp,-32 800055f2: ec06 sd ra,24(sp) 800055f4: e822 sd s0,16(sp) 800055f6: 1000 addi s0,sp,32 if(argfd(0, 0, &f) < 0 || argaddr(1, &st) < 0) 800055f8: fe840613 addi a2,s0,-24 800055fc: 4581 li a1,0 800055fe: 4501 li a0,0 80005600: 00000097 auipc ra,0x0 80005604: c76080e7 jalr -906(ra) # 80005276 <argfd> return -1; 80005608: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argaddr(1, &st) < 0) 8000560a: 02054563 bltz a0,80005634 <sys_fstat+0x44> 8000560e: fe040593 addi a1,s0,-32 80005612: 4505 li a0,1 80005614: ffffd097 auipc ra,0xffffd 80005618: 7da080e7 jalr 2010(ra) # 80002dee <argaddr> return -1; 8000561c: 57fd li a5,-1 if(argfd(0, 0, &f) < 0 || argaddr(1, &st) < 0) 8000561e: 00054b63 bltz a0,80005634 <sys_fstat+0x44> return filestat(f, st); 80005622: fe043583 ld a1,-32(s0) 80005626: fe843503 ld a0,-24(s0) 8000562a: fffff097 auipc ra,0xfffff 8000562e: 32a080e7 jalr 810(ra) # 80004954 <filestat> 80005632: 87aa mv a5,a0 } 80005634: 853e mv a0,a5 80005636: 60e2 ld ra,24(sp) 80005638: 6442 ld s0,16(sp) 8000563a: 6105 addi sp,sp,32 8000563c: 8082 ret 000000008000563e <sys_link>: { 8000563e: 7169 addi sp,sp,-304 80005640: f606 sd ra,296(sp) 80005642: f222 sd s0,288(sp) 80005644: ee26 sd s1,280(sp) 80005646: ea4a sd s2,272(sp) 80005648: 1a00 addi s0,sp,304 if(argstr(0, old, MAXPATH) < 0 || argstr(1, new, MAXPATH) < 0) 8000564a: 08000613 li a2,128 8000564e: ed040593 addi a1,s0,-304 80005652: 4501 li a0,0 80005654: ffffd097 auipc ra,0xffffd 80005658: 7bc080e7 jalr 1980(ra) # 80002e10 <argstr> return -1; 8000565c: 57fd li a5,-1 if(argstr(0, old, MAXPATH) < 0 || argstr(1, new, MAXPATH) < 0) 8000565e: 10054e63 bltz a0,8000577a <sys_link+0x13c> 80005662: 08000613 li a2,128 80005666: f5040593 addi a1,s0,-176 8000566a: 4505 li a0,1 8000566c: ffffd097 auipc ra,0xffffd 80005670: 7a4080e7 jalr 1956(ra) # 80002e10 <argstr> return -1; 80005674: 57fd li a5,-1 if(argstr(0, old, MAXPATH) < 0 || argstr(1, new, MAXPATH) < 0) 80005676: 10054263 bltz a0,8000577a <sys_link+0x13c> begin_op(); 8000567a: fffff097 auipc ra,0xfffff 8000567e: d46080e7 jalr -698(ra) # 800043c0 <begin_op> if((ip = namei(old)) == 0){ 80005682: ed040513 addi a0,s0,-304 80005686: fffff097 auipc ra,0xfffff 8000568a: b1e080e7 jalr -1250(ra) # 800041a4 <namei> 8000568e: 84aa mv s1,a0 80005690: c551 beqz a0,8000571c <sys_link+0xde> ilock(ip); 80005692: ffffe097 auipc ra,0xffffe 80005696: 35c080e7 jalr 860(ra) # 800039ee <ilock> if(ip->type == T_DIR){ 8000569a: 04449703 lh a4,68(s1) 8000569e: 4785 li a5,1 800056a0: 08f70463 beq a4,a5,80005728 <sys_link+0xea> ip->nlink++; 800056a4: 04a4d783 lhu a5,74(s1) 800056a8: 2785 addiw a5,a5,1 800056aa: 04f49523 sh a5,74(s1) iupdate(ip); 800056ae: 8526 mv a0,s1 800056b0: ffffe097 auipc ra,0xffffe 800056b4: 274080e7 jalr 628(ra) # 80003924 <iupdate> iunlock(ip); 800056b8: 8526 mv a0,s1 800056ba: ffffe097 auipc ra,0xffffe 800056be: 3f6080e7 jalr 1014(ra) # 80003ab0 <iunlock> if((dp = nameiparent(new, name)) == 0) 800056c2: fd040593 addi a1,s0,-48 800056c6: f5040513 addi a0,s0,-176 800056ca: fffff097 auipc ra,0xfffff 800056ce: af8080e7 jalr -1288(ra) # 800041c2 <nameiparent> 800056d2: 892a mv s2,a0 800056d4: c935 beqz a0,80005748 <sys_link+0x10a> ilock(dp); 800056d6: ffffe097 auipc ra,0xffffe 800056da: 318080e7 jalr 792(ra) # 800039ee <ilock> if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){ 800056de: 00092703 lw a4,0(s2) 800056e2: 409c lw a5,0(s1) 800056e4: 04f71d63 bne a4,a5,8000573e <sys_link+0x100> 800056e8: 40d0 lw a2,4(s1) 800056ea: fd040593 addi a1,s0,-48 800056ee: 854a mv a0,s2 800056f0: fffff097 auipc ra,0xfffff 800056f4: 9f2080e7 jalr -1550(ra) # 800040e2 <dirlink> 800056f8: 04054363 bltz a0,8000573e <sys_link+0x100> iunlockput(dp); 800056fc: 854a mv a0,s2 800056fe: ffffe097 auipc ra,0xffffe 80005702: 552080e7 jalr 1362(ra) # 80003c50 <iunlockput> iput(ip); 80005706: 8526 mv a0,s1 80005708: ffffe097 auipc ra,0xffffe 8000570c: 4a0080e7 jalr 1184(ra) # 80003ba8 <iput> end_op(); 80005710: fffff097 auipc ra,0xfffff 80005714: d30080e7 jalr -720(ra) # 80004440 <end_op> return 0; 80005718: 4781 li a5,0 8000571a: a085 j 8000577a <sys_link+0x13c> end_op(); 8000571c: fffff097 auipc ra,0xfffff 80005720: d24080e7 jalr -732(ra) # 80004440 <end_op> return -1; 80005724: 57fd li a5,-1 80005726: a891 j 8000577a <sys_link+0x13c> iunlockput(ip); 80005728: 8526 mv a0,s1 8000572a: ffffe097 auipc ra,0xffffe 8000572e: 526080e7 jalr 1318(ra) # 80003c50 <iunlockput> end_op(); 80005732: fffff097 auipc ra,0xfffff 80005736: d0e080e7 jalr -754(ra) # 80004440 <end_op> return -1; 8000573a: 57fd li a5,-1 8000573c: a83d j 8000577a <sys_link+0x13c> iunlockput(dp); 8000573e: 854a mv a0,s2 80005740: ffffe097 auipc ra,0xffffe 80005744: 510080e7 jalr 1296(ra) # 80003c50 <iunlockput> ilock(ip); 80005748: 8526 mv a0,s1 8000574a: ffffe097 auipc ra,0xffffe 8000574e: 2a4080e7 jalr 676(ra) # 800039ee <ilock> ip->nlink--; 80005752: 04a4d783 lhu a5,74(s1) 80005756: 37fd addiw a5,a5,-1 80005758: 04f49523 sh a5,74(s1) iupdate(ip); 8000575c: 8526 mv a0,s1 8000575e: ffffe097 auipc ra,0xffffe 80005762: 1c6080e7 jalr 454(ra) # 80003924 <iupdate> iunlockput(ip); 80005766: 8526 mv a0,s1 80005768: ffffe097 auipc ra,0xffffe 8000576c: 4e8080e7 jalr 1256(ra) # 80003c50 <iunlockput> end_op(); 80005770: fffff097 auipc ra,0xfffff 80005774: cd0080e7 jalr -816(ra) # 80004440 <end_op> return -1; 80005778: 57fd li a5,-1 } 8000577a: 853e mv a0,a5 8000577c: 70b2 ld ra,296(sp) 8000577e: 7412 ld s0,288(sp) 80005780: 64f2 ld s1,280(sp) 80005782: 6952 ld s2,272(sp) 80005784: 6155 addi sp,sp,304 80005786: 8082 ret 0000000080005788 <sys_unlink>: { 80005788: 7151 addi sp,sp,-240 8000578a: f586 sd ra,232(sp) 8000578c: f1a2 sd s0,224(sp) 8000578e: eda6 sd s1,216(sp) 80005790: e9ca sd s2,208(sp) 80005792: e5ce sd s3,200(sp) 80005794: 1980 addi s0,sp,240 if(argstr(0, path, MAXPATH) < 0) 80005796: 08000613 li a2,128 8000579a: f3040593 addi a1,s0,-208 8000579e: 4501 li a0,0 800057a0: ffffd097 auipc ra,0xffffd 800057a4: 670080e7 jalr 1648(ra) # 80002e10 <argstr> 800057a8: 18054163 bltz a0,8000592a <sys_unlink+0x1a2> begin_op(); 800057ac: fffff097 auipc ra,0xfffff 800057b0: c14080e7 jalr -1004(ra) # 800043c0 <begin_op> if((dp = nameiparent(path, name)) == 0){ 800057b4: fb040593 addi a1,s0,-80 800057b8: f3040513 addi a0,s0,-208 800057bc: fffff097 auipc ra,0xfffff 800057c0: a06080e7 jalr -1530(ra) # 800041c2 <nameiparent> 800057c4: 84aa mv s1,a0 800057c6: c979 beqz a0,8000589c <sys_unlink+0x114> ilock(dp); 800057c8: ffffe097 auipc ra,0xffffe 800057cc: 226080e7 jalr 550(ra) # 800039ee <ilock> if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0) 800057d0: 00003597 auipc a1,0x3 800057d4: 02858593 addi a1,a1,40 # 800087f8 <syscalls+0x2d0> 800057d8: fb040513 addi a0,s0,-80 800057dc: ffffe097 auipc ra,0xffffe 800057e0: 6dc080e7 jalr 1756(ra) # 80003eb8 <namecmp> 800057e4: 14050a63 beqz a0,80005938 <sys_unlink+0x1b0> 800057e8: 00003597 auipc a1,0x3 800057ec: 01858593 addi a1,a1,24 # 80008800 <syscalls+0x2d8> 800057f0: fb040513 addi a0,s0,-80 800057f4: ffffe097 auipc ra,0xffffe 800057f8: 6c4080e7 jalr 1732(ra) # 80003eb8 <namecmp> 800057fc: 12050e63 beqz a0,80005938 <sys_unlink+0x1b0> if((ip = dirlookup(dp, name, &off)) == 0) 80005800: f2c40613 addi a2,s0,-212 80005804: fb040593 addi a1,s0,-80 80005808: 8526 mv a0,s1 8000580a: ffffe097 auipc ra,0xffffe 8000580e: 6c8080e7 jalr 1736(ra) # 80003ed2 <dirlookup> 80005812: 892a mv s2,a0 80005814: 12050263 beqz a0,80005938 <sys_unlink+0x1b0> ilock(ip); 80005818: ffffe097 auipc ra,0xffffe 8000581c: 1d6080e7 jalr 470(ra) # 800039ee <ilock> if(ip->nlink < 1) 80005820: 04a91783 lh a5,74(s2) 80005824: 08f05263 blez a5,800058a8 <sys_unlink+0x120> if(ip->type == T_DIR && !isdirempty(ip)){ 80005828: 04491703 lh a4,68(s2) 8000582c: 4785 li a5,1 8000582e: 08f70563 beq a4,a5,800058b8 <sys_unlink+0x130> memset(&de, 0, sizeof(de)); 80005832: 4641 li a2,16 80005834: 4581 li a1,0 80005836: fc040513 addi a0,s0,-64 8000583a: ffffb097 auipc ra,0xffffb 8000583e: 4a6080e7 jalr 1190(ra) # 80000ce0 <memset> if(writei(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de)) 80005842: 4741 li a4,16 80005844: f2c42683 lw a3,-212(s0) 80005848: fc040613 addi a2,s0,-64 8000584c: 4581 li a1,0 8000584e: 8526 mv a0,s1 80005850: ffffe097 auipc ra,0xffffe 80005854: 54a080e7 jalr 1354(ra) # 80003d9a <writei> 80005858: 47c1 li a5,16 8000585a: 0af51563 bne a0,a5,80005904 <sys_unlink+0x17c> if(ip->type == T_DIR){ 8000585e: 04491703 lh a4,68(s2) 80005862: 4785 li a5,1 80005864: 0af70863 beq a4,a5,80005914 <sys_unlink+0x18c> iunlockput(dp); 80005868: 8526 mv a0,s1 8000586a: ffffe097 auipc ra,0xffffe 8000586e: 3e6080e7 jalr 998(ra) # 80003c50 <iunlockput> ip->nlink--; 80005872: 04a95783 lhu a5,74(s2) 80005876: 37fd addiw a5,a5,-1 80005878: 04f91523 sh a5,74(s2) iupdate(ip); 8000587c: 854a mv a0,s2 8000587e: ffffe097 auipc ra,0xffffe 80005882: 0a6080e7 jalr 166(ra) # 80003924 <iupdate> iunlockput(ip); 80005886: 854a mv a0,s2 80005888: ffffe097 auipc ra,0xffffe 8000588c: 3c8080e7 jalr 968(ra) # 80003c50 <iunlockput> end_op(); 80005890: fffff097 auipc ra,0xfffff 80005894: bb0080e7 jalr -1104(ra) # 80004440 <end_op> return 0; 80005898: 4501 li a0,0 8000589a: a84d j 8000594c <sys_unlink+0x1c4> end_op(); 8000589c: fffff097 auipc ra,0xfffff 800058a0: ba4080e7 jalr -1116(ra) # 80004440 <end_op> return -1; 800058a4: 557d li a0,-1 800058a6: a05d j 8000594c <sys_unlink+0x1c4> panic("unlink: nlink < 1"); 800058a8: 00003517 auipc a0,0x3 800058ac: f8050513 addi a0,a0,-128 # 80008828 <syscalls+0x300> 800058b0: ffffb097 auipc ra,0xffffb 800058b4: c8e080e7 jalr -882(ra) # 8000053e <panic> for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 800058b8: 04c92703 lw a4,76(s2) 800058bc: 02000793 li a5,32 800058c0: f6e7f9e3 bgeu a5,a4,80005832 <sys_unlink+0xaa> 800058c4: 02000993 li s3,32 if(readi(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de)) 800058c8: 4741 li a4,16 800058ca: 86ce mv a3,s3 800058cc: f1840613 addi a2,s0,-232 800058d0: 4581 li a1,0 800058d2: 854a mv a0,s2 800058d4: ffffe097 auipc ra,0xffffe 800058d8: 3ce080e7 jalr 974(ra) # 80003ca2 <readi> 800058dc: 47c1 li a5,16 800058de: 00f51b63 bne a0,a5,800058f4 <sys_unlink+0x16c> if(de.inum != 0) 800058e2: f1845783 lhu a5,-232(s0) 800058e6: e7a1 bnez a5,8000592e <sys_unlink+0x1a6> for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){ 800058e8: 29c1 addiw s3,s3,16 800058ea: 04c92783 lw a5,76(s2) 800058ee: fcf9ede3 bltu s3,a5,800058c8 <sys_unlink+0x140> 800058f2: b781 j 80005832 <sys_unlink+0xaa> panic("isdirempty: readi"); 800058f4: 00003517 auipc a0,0x3 800058f8: f4c50513 addi a0,a0,-180 # 80008840 <syscalls+0x318> 800058fc: ffffb097 auipc ra,0xffffb 80005900: c42080e7 jalr -958(ra) # 8000053e <panic> panic("unlink: writei"); 80005904: 00003517 auipc a0,0x3 80005908: f5450513 addi a0,a0,-172 # 80008858 <syscalls+0x330> 8000590c: ffffb097 auipc ra,0xffffb 80005910: c32080e7 jalr -974(ra) # 8000053e <panic> dp->nlink--; 80005914: 04a4d783 lhu a5,74(s1) 80005918: 37fd addiw a5,a5,-1 8000591a: 04f49523 sh a5,74(s1) iupdate(dp); 8000591e: 8526 mv a0,s1 80005920: ffffe097 auipc ra,0xffffe 80005924: 004080e7 jalr 4(ra) # 80003924 <iupdate> 80005928: b781 j 80005868 <sys_unlink+0xe0> return -1; 8000592a: 557d li a0,-1 8000592c: a005 j 8000594c <sys_unlink+0x1c4> iunlockput(ip); 8000592e: 854a mv a0,s2 80005930: ffffe097 auipc ra,0xffffe 80005934: 320080e7 jalr 800(ra) # 80003c50 <iunlockput> iunlockput(dp); 80005938: 8526 mv a0,s1 8000593a: ffffe097 auipc ra,0xffffe 8000593e: 316080e7 jalr 790(ra) # 80003c50 <iunlockput> end_op(); 80005942: fffff097 auipc ra,0xfffff 80005946: afe080e7 jalr -1282(ra) # 80004440 <end_op> return -1; 8000594a: 557d li a0,-1 } 8000594c: 70ae ld ra,232(sp) 8000594e: 740e ld s0,224(sp) 80005950: 64ee ld s1,216(sp) 80005952: 694e ld s2,208(sp) 80005954: 69ae ld s3,200(sp) 80005956: 616d addi sp,sp,240 80005958: 8082 ret 000000008000595a <sys_open>: uint64 sys_open(void) { 8000595a: 7131 addi sp,sp,-192 8000595c: fd06 sd ra,184(sp) 8000595e: f922 sd s0,176(sp) 80005960: f526 sd s1,168(sp) 80005962: f14a sd s2,160(sp) 80005964: ed4e sd s3,152(sp) 80005966: 0180 addi s0,sp,192 int fd, omode; struct file *f; struct inode *ip; int n; if((n = argstr(0, path, MAXPATH)) < 0 || argint(1, &omode) < 0) 80005968: 08000613 li a2,128 8000596c: f5040593 addi a1,s0,-176 80005970: 4501 li a0,0 80005972: ffffd097 auipc ra,0xffffd 80005976: 49e080e7 jalr 1182(ra) # 80002e10 <argstr> return -1; 8000597a: 54fd li s1,-1 if((n = argstr(0, path, MAXPATH)) < 0 || argint(1, &omode) < 0) 8000597c: 0c054163 bltz a0,80005a3e <sys_open+0xe4> 80005980: f4c40593 addi a1,s0,-180 80005984: 4505 li a0,1 80005986: ffffd097 auipc ra,0xffffd 8000598a: 446080e7 jalr 1094(ra) # 80002dcc <argint> 8000598e: 0a054863 bltz a0,80005a3e <sys_open+0xe4> begin_op(); 80005992: fffff097 auipc ra,0xfffff 80005996: a2e080e7 jalr -1490(ra) # 800043c0 <begin_op> if(omode & O_CREATE){ 8000599a: f4c42783 lw a5,-180(s0) 8000599e: 2007f793 andi a5,a5,512 800059a2: cbdd beqz a5,80005a58 <sys_open+0xfe> ip = create(path, T_FILE, 0, 0); 800059a4: 4681 li a3,0 800059a6: 4601 li a2,0 800059a8: 4589 li a1,2 800059aa: f5040513 addi a0,s0,-176 800059ae: 00000097 auipc ra,0x0 800059b2: 972080e7 jalr -1678(ra) # 80005320 <create> 800059b6: 892a mv s2,a0 if(ip == 0){ 800059b8: c959 beqz a0,80005a4e <sys_open+0xf4> end_op(); return -1; } } if(ip->type == T_DEVICE && (ip->major < 0 || ip->major >= NDEV)){ 800059ba: 04491703 lh a4,68(s2) 800059be: 478d li a5,3 800059c0: 00f71763 bne a4,a5,800059ce <sys_open+0x74> 800059c4: 04695703 lhu a4,70(s2) 800059c8: 47a5 li a5,9 800059ca: 0ce7ec63 bltu a5,a4,80005aa2 <sys_open+0x148> iunlockput(ip); end_op(); return -1; } if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){ 800059ce: fffff097 auipc ra,0xfffff 800059d2: e02080e7 jalr -510(ra) # 800047d0 <filealloc> 800059d6: 89aa mv s3,a0 800059d8: 10050263 beqz a0,80005adc <sys_open+0x182> 800059dc: 00000097 auipc ra,0x0 800059e0: 902080e7 jalr -1790(ra) # 800052de <fdalloc> 800059e4: 84aa mv s1,a0 800059e6: 0e054663 bltz a0,80005ad2 <sys_open+0x178> iunlockput(ip); end_op(); return -1; } if(ip->type == T_DEVICE){ 800059ea: 04491703 lh a4,68(s2) 800059ee: 478d li a5,3 800059f0: 0cf70463 beq a4,a5,80005ab8 <sys_open+0x15e> f->type = FD_DEVICE; f->major = ip->major; } else { f->type = FD_INODE; 800059f4: 4789 li a5,2 800059f6: 00f9a023 sw a5,0(s3) f->off = 0; 800059fa: 0209a023 sw zero,32(s3) } f->ip = ip; 800059fe: 0129bc23 sd s2,24(s3) f->readable = !(omode & O_WRONLY); 80005a02: f4c42783 lw a5,-180(s0) 80005a06: 0017c713 xori a4,a5,1 80005a0a: 8b05 andi a4,a4,1 80005a0c: 00e98423 sb a4,8(s3) f->writable = (omode & O_WRONLY) || (omode & O_RDWR); 80005a10: 0037f713 andi a4,a5,3 80005a14: 00e03733 snez a4,a4 80005a18: 00e984a3 sb a4,9(s3) if((omode & O_TRUNC) && ip->type == T_FILE){ 80005a1c: 4007f793 andi a5,a5,1024 80005a20: c791 beqz a5,80005a2c <sys_open+0xd2> 80005a22: 04491703 lh a4,68(s2) 80005a26: 4789 li a5,2 80005a28: 08f70f63 beq a4,a5,80005ac6 <sys_open+0x16c> itrunc(ip); } iunlock(ip); 80005a2c: 854a mv a0,s2 80005a2e: ffffe097 auipc ra,0xffffe 80005a32: 082080e7 jalr 130(ra) # 80003ab0 <iunlock> end_op(); 80005a36: fffff097 auipc ra,0xfffff 80005a3a: a0a080e7 jalr -1526(ra) # 80004440 <end_op> return fd; } 80005a3e: 8526 mv a0,s1 80005a40: 70ea ld ra,184(sp) 80005a42: 744a ld s0,176(sp) 80005a44: 74aa ld s1,168(sp) 80005a46: 790a ld s2,160(sp) 80005a48: 69ea ld s3,152(sp) 80005a4a: 6129 addi sp,sp,192 80005a4c: 8082 ret end_op(); 80005a4e: fffff097 auipc ra,0xfffff 80005a52: 9f2080e7 jalr -1550(ra) # 80004440 <end_op> return -1; 80005a56: b7e5 j 80005a3e <sys_open+0xe4> if((ip = namei(path)) == 0){ 80005a58: f5040513 addi a0,s0,-176 80005a5c: ffffe097 auipc ra,0xffffe 80005a60: 748080e7 jalr 1864(ra) # 800041a4 <namei> 80005a64: 892a mv s2,a0 80005a66: c905 beqz a0,80005a96 <sys_open+0x13c> ilock(ip); 80005a68: ffffe097 auipc ra,0xffffe 80005a6c: f86080e7 jalr -122(ra) # 800039ee <ilock> if(ip->type == T_DIR && omode != O_RDONLY){ 80005a70: 04491703 lh a4,68(s2) 80005a74: 4785 li a5,1 80005a76: f4f712e3 bne a4,a5,800059ba <sys_open+0x60> 80005a7a: f4c42783 lw a5,-180(s0) 80005a7e: dba1 beqz a5,800059ce <sys_open+0x74> iunlockput(ip); 80005a80: 854a mv a0,s2 80005a82: ffffe097 auipc ra,0xffffe 80005a86: 1ce080e7 jalr 462(ra) # 80003c50 <iunlockput> end_op(); 80005a8a: fffff097 auipc ra,0xfffff 80005a8e: 9b6080e7 jalr -1610(ra) # 80004440 <end_op> return -1; 80005a92: 54fd li s1,-1 80005a94: b76d j 80005a3e <sys_open+0xe4> end_op(); 80005a96: fffff097 auipc ra,0xfffff 80005a9a: 9aa080e7 jalr -1622(ra) # 80004440 <end_op> return -1; 80005a9e: 54fd li s1,-1 80005aa0: bf79 j 80005a3e <sys_open+0xe4> iunlockput(ip); 80005aa2: 854a mv a0,s2 80005aa4: ffffe097 auipc ra,0xffffe 80005aa8: 1ac080e7 jalr 428(ra) # 80003c50 <iunlockput> end_op(); 80005aac: fffff097 auipc ra,0xfffff 80005ab0: 994080e7 jalr -1644(ra) # 80004440 <end_op> return -1; 80005ab4: 54fd li s1,-1 80005ab6: b761 j 80005a3e <sys_open+0xe4> f->type = FD_DEVICE; 80005ab8: 00f9a023 sw a5,0(s3) f->major = ip->major; 80005abc: 04691783 lh a5,70(s2) 80005ac0: 02f99223 sh a5,36(s3) 80005ac4: bf2d j 800059fe <sys_open+0xa4> itrunc(ip); 80005ac6: 854a mv a0,s2 80005ac8: ffffe097 auipc ra,0xffffe 80005acc: 034080e7 jalr 52(ra) # 80003afc <itrunc> 80005ad0: bfb1 j 80005a2c <sys_open+0xd2> fileclose(f); 80005ad2: 854e mv a0,s3 80005ad4: fffff097 auipc ra,0xfffff 80005ad8: db8080e7 jalr -584(ra) # 8000488c <fileclose> iunlockput(ip); 80005adc: 854a mv a0,s2 80005ade: ffffe097 auipc ra,0xffffe 80005ae2: 172080e7 jalr 370(ra) # 80003c50 <iunlockput> end_op(); 80005ae6: fffff097 auipc ra,0xfffff 80005aea: 95a080e7 jalr -1702(ra) # 80004440 <end_op> return -1; 80005aee: 54fd li s1,-1 80005af0: b7b9 j 80005a3e <sys_open+0xe4> 0000000080005af2 <sys_mkdir>: uint64 sys_mkdir(void) { 80005af2: 7175 addi sp,sp,-144 80005af4: e506 sd ra,136(sp) 80005af6: e122 sd s0,128(sp) 80005af8: 0900 addi s0,sp,144 char path[MAXPATH]; struct inode *ip; begin_op(); 80005afa: fffff097 auipc ra,0xfffff 80005afe: 8c6080e7 jalr -1850(ra) # 800043c0 <begin_op> if(argstr(0, path, MAXPATH) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){ 80005b02: 08000613 li a2,128 80005b06: f7040593 addi a1,s0,-144 80005b0a: 4501 li a0,0 80005b0c: ffffd097 auipc ra,0xffffd 80005b10: 304080e7 jalr 772(ra) # 80002e10 <argstr> 80005b14: 02054963 bltz a0,80005b46 <sys_mkdir+0x54> 80005b18: 4681 li a3,0 80005b1a: 4601 li a2,0 80005b1c: 4585 li a1,1 80005b1e: f7040513 addi a0,s0,-144 80005b22: fffff097 auipc ra,0xfffff 80005b26: 7fe080e7 jalr 2046(ra) # 80005320 <create> 80005b2a: cd11 beqz a0,80005b46 <sys_mkdir+0x54> end_op(); return -1; } iunlockput(ip); 80005b2c: ffffe097 auipc ra,0xffffe 80005b30: 124080e7 jalr 292(ra) # 80003c50 <iunlockput> end_op(); 80005b34: fffff097 auipc ra,0xfffff 80005b38: 90c080e7 jalr -1780(ra) # 80004440 <end_op> return 0; 80005b3c: 4501 li a0,0 } 80005b3e: 60aa ld ra,136(sp) 80005b40: 640a ld s0,128(sp) 80005b42: 6149 addi sp,sp,144 80005b44: 8082 ret end_op(); 80005b46: fffff097 auipc ra,0xfffff 80005b4a: 8fa080e7 jalr -1798(ra) # 80004440 <end_op> return -1; 80005b4e: 557d li a0,-1 80005b50: b7fd j 80005b3e <sys_mkdir+0x4c> 0000000080005b52 <sys_mknod>: uint64 sys_mknod(void) { 80005b52: 7135 addi sp,sp,-160 80005b54: ed06 sd ra,152(sp) 80005b56: e922 sd s0,144(sp) 80005b58: 1100 addi s0,sp,160 struct inode *ip; char path[MAXPATH]; int major, minor; begin_op(); 80005b5a: fffff097 auipc ra,0xfffff 80005b5e: 866080e7 jalr -1946(ra) # 800043c0 <begin_op> if((argstr(0, path, MAXPATH)) < 0 || 80005b62: 08000613 li a2,128 80005b66: f7040593 addi a1,s0,-144 80005b6a: 4501 li a0,0 80005b6c: ffffd097 auipc ra,0xffffd 80005b70: 2a4080e7 jalr 676(ra) # 80002e10 <argstr> 80005b74: 04054a63 bltz a0,80005bc8 <sys_mknod+0x76> argint(1, &major) < 0 || 80005b78: f6c40593 addi a1,s0,-148 80005b7c: 4505 li a0,1 80005b7e: ffffd097 auipc ra,0xffffd 80005b82: 24e080e7 jalr 590(ra) # 80002dcc <argint> if((argstr(0, path, MAXPATH)) < 0 || 80005b86: 04054163 bltz a0,80005bc8 <sys_mknod+0x76> argint(2, &minor) < 0 || 80005b8a: f6840593 addi a1,s0,-152 80005b8e: 4509 li a0,2 80005b90: ffffd097 auipc ra,0xffffd 80005b94: 23c080e7 jalr 572(ra) # 80002dcc <argint> argint(1, &major) < 0 || 80005b98: 02054863 bltz a0,80005bc8 <sys_mknod+0x76> (ip = create(path, T_DEVICE, major, minor)) == 0){ 80005b9c: f6841683 lh a3,-152(s0) 80005ba0: f6c41603 lh a2,-148(s0) 80005ba4: 458d li a1,3 80005ba6: f7040513 addi a0,s0,-144 80005baa: fffff097 auipc ra,0xfffff 80005bae: 776080e7 jalr 1910(ra) # 80005320 <create> argint(2, &minor) < 0 || 80005bb2: c919 beqz a0,80005bc8 <sys_mknod+0x76> end_op(); return -1; } iunlockput(ip); 80005bb4: ffffe097 auipc ra,0xffffe 80005bb8: 09c080e7 jalr 156(ra) # 80003c50 <iunlockput> end_op(); 80005bbc: fffff097 auipc ra,0xfffff 80005bc0: 884080e7 jalr -1916(ra) # 80004440 <end_op> return 0; 80005bc4: 4501 li a0,0 80005bc6: a031 j 80005bd2 <sys_mknod+0x80> end_op(); 80005bc8: fffff097 auipc ra,0xfffff 80005bcc: 878080e7 jalr -1928(ra) # 80004440 <end_op> return -1; 80005bd0: 557d li a0,-1 } 80005bd2: 60ea ld ra,152(sp) 80005bd4: 644a ld s0,144(sp) 80005bd6: 610d addi sp,sp,160 80005bd8: 8082 ret 0000000080005bda <sys_chdir>: uint64 sys_chdir(void) { 80005bda: 7135 addi sp,sp,-160 80005bdc: ed06 sd ra,152(sp) 80005bde: e922 sd s0,144(sp) 80005be0: e526 sd s1,136(sp) 80005be2: e14a sd s2,128(sp) 80005be4: 1100 addi s0,sp,160 char path[MAXPATH]; struct inode *ip; struct proc *p = myproc(); 80005be6: ffffc097 auipc ra,0xffffc 80005bea: dd0080e7 jalr -560(ra) # 800019b6 <myproc> 80005bee: 892a mv s2,a0 begin_op(); 80005bf0: ffffe097 auipc ra,0xffffe 80005bf4: 7d0080e7 jalr 2000(ra) # 800043c0 <begin_op> if(argstr(0, path, MAXPATH) < 0 || (ip = namei(path)) == 0){ 80005bf8: 08000613 li a2,128 80005bfc: f6040593 addi a1,s0,-160 80005c00: 4501 li a0,0 80005c02: ffffd097 auipc ra,0xffffd 80005c06: 20e080e7 jalr 526(ra) # 80002e10 <argstr> 80005c0a: 04054b63 bltz a0,80005c60 <sys_chdir+0x86> 80005c0e: f6040513 addi a0,s0,-160 80005c12: ffffe097 auipc ra,0xffffe 80005c16: 592080e7 jalr 1426(ra) # 800041a4 <namei> 80005c1a: 84aa mv s1,a0 80005c1c: c131 beqz a0,80005c60 <sys_chdir+0x86> end_op(); return -1; } ilock(ip); 80005c1e: ffffe097 auipc ra,0xffffe 80005c22: dd0080e7 jalr -560(ra) # 800039ee <ilock> if(ip->type != T_DIR){ 80005c26: 04449703 lh a4,68(s1) 80005c2a: 4785 li a5,1 80005c2c: 04f71063 bne a4,a5,80005c6c <sys_chdir+0x92> iunlockput(ip); end_op(); return -1; } iunlock(ip); 80005c30: 8526 mv a0,s1 80005c32: ffffe097 auipc ra,0xffffe 80005c36: e7e080e7 jalr -386(ra) # 80003ab0 <iunlock> iput(p->cwd); 80005c3a: 15093503 ld a0,336(s2) 80005c3e: ffffe097 auipc ra,0xffffe 80005c42: f6a080e7 jalr -150(ra) # 80003ba8 <iput> end_op(); 80005c46: ffffe097 auipc ra,0xffffe 80005c4a: 7fa080e7 jalr 2042(ra) # 80004440 <end_op> p->cwd = ip; 80005c4e: 14993823 sd s1,336(s2) return 0; 80005c52: 4501 li a0,0 } 80005c54: 60ea ld ra,152(sp) 80005c56: 644a ld s0,144(sp) 80005c58: 64aa ld s1,136(sp) 80005c5a: 690a ld s2,128(sp) 80005c5c: 610d addi sp,sp,160 80005c5e: 8082 ret end_op(); 80005c60: ffffe097 auipc ra,0xffffe 80005c64: 7e0080e7 jalr 2016(ra) # 80004440 <end_op> return -1; 80005c68: 557d li a0,-1 80005c6a: b7ed j 80005c54 <sys_chdir+0x7a> iunlockput(ip); 80005c6c: 8526 mv a0,s1 80005c6e: ffffe097 auipc ra,0xffffe 80005c72: fe2080e7 jalr -30(ra) # 80003c50 <iunlockput> end_op(); 80005c76: ffffe097 auipc ra,0xffffe 80005c7a: 7ca080e7 jalr 1994(ra) # 80004440 <end_op> return -1; 80005c7e: 557d li a0,-1 80005c80: bfd1 j 80005c54 <sys_chdir+0x7a> 0000000080005c82 <sys_exec>: uint64 sys_exec(void) { 80005c82: 7145 addi sp,sp,-464 80005c84: e786 sd ra,456(sp) 80005c86: e3a2 sd s0,448(sp) 80005c88: ff26 sd s1,440(sp) 80005c8a: fb4a sd s2,432(sp) 80005c8c: f74e sd s3,424(sp) 80005c8e: f352 sd s4,416(sp) 80005c90: ef56 sd s5,408(sp) 80005c92: 0b80 addi s0,sp,464 char path[MAXPATH], *argv[MAXARG]; int i; uint64 uargv, uarg; if(argstr(0, path, MAXPATH) < 0 || argaddr(1, &uargv) < 0){ 80005c94: 08000613 li a2,128 80005c98: f4040593 addi a1,s0,-192 80005c9c: 4501 li a0,0 80005c9e: ffffd097 auipc ra,0xffffd 80005ca2: 172080e7 jalr 370(ra) # 80002e10 <argstr> return -1; 80005ca6: 597d li s2,-1 if(argstr(0, path, MAXPATH) < 0 || argaddr(1, &uargv) < 0){ 80005ca8: 0c054a63 bltz a0,80005d7c <sys_exec+0xfa> 80005cac: e3840593 addi a1,s0,-456 80005cb0: 4505 li a0,1 80005cb2: ffffd097 auipc ra,0xffffd 80005cb6: 13c080e7 jalr 316(ra) # 80002dee <argaddr> 80005cba: 0c054163 bltz a0,80005d7c <sys_exec+0xfa> } memset(argv, 0, sizeof(argv)); 80005cbe: 10000613 li a2,256 80005cc2: 4581 li a1,0 80005cc4: e4040513 addi a0,s0,-448 80005cc8: ffffb097 auipc ra,0xffffb 80005ccc: 018080e7 jalr 24(ra) # 80000ce0 <memset> for(i=0;; i++){ if(i >= NELEM(argv)){ 80005cd0: e4040493 addi s1,s0,-448 memset(argv, 0, sizeof(argv)); 80005cd4: 89a6 mv s3,s1 80005cd6: 4901 li s2,0 if(i >= NELEM(argv)){ 80005cd8: 02000a13 li s4,32 80005cdc: 00090a9b sext.w s5,s2 goto bad; } if(fetchaddr(uargv+sizeof(uint64)*i, (uint64*)&uarg) < 0){ 80005ce0: 00391513 slli a0,s2,0x3 80005ce4: e3040593 addi a1,s0,-464 80005ce8: e3843783 ld a5,-456(s0) 80005cec: 953e add a0,a0,a5 80005cee: ffffd097 auipc ra,0xffffd 80005cf2: 044080e7 jalr 68(ra) # 80002d32 <fetchaddr> 80005cf6: 02054a63 bltz a0,80005d2a <sys_exec+0xa8> goto bad; } if(uarg == 0){ 80005cfa: e3043783 ld a5,-464(s0) 80005cfe: c3b9 beqz a5,80005d44 <sys_exec+0xc2> argv[i] = 0; break; } argv[i] = kalloc(); 80005d00: ffffb097 auipc ra,0xffffb 80005d04: df4080e7 jalr -524(ra) # 80000af4 <kalloc> 80005d08: 85aa mv a1,a0 80005d0a: 00a9b023 sd a0,0(s3) if(argv[i] == 0) 80005d0e: cd11 beqz a0,80005d2a <sys_exec+0xa8> goto bad; if(fetchstr(uarg, argv[i], PGSIZE) < 0) 80005d10: 6605 lui a2,0x1 80005d12: e3043503 ld a0,-464(s0) 80005d16: ffffd097 auipc ra,0xffffd 80005d1a: 06e080e7 jalr 110(ra) # 80002d84 <fetchstr> 80005d1e: 00054663 bltz a0,80005d2a <sys_exec+0xa8> if(i >= NELEM(argv)){ 80005d22: 0905 addi s2,s2,1 80005d24: 09a1 addi s3,s3,8 80005d26: fb491be3 bne s2,s4,80005cdc <sys_exec+0x5a> kfree(argv[i]); return ret; bad: for(i = 0; i < NELEM(argv) && argv[i] != 0; i++) 80005d2a: 10048913 addi s2,s1,256 80005d2e: 6088 ld a0,0(s1) 80005d30: c529 beqz a0,80005d7a <sys_exec+0xf8> kfree(argv[i]); 80005d32: ffffb097 auipc ra,0xffffb 80005d36: cc6080e7 jalr -826(ra) # 800009f8 <kfree> for(i = 0; i < NELEM(argv) && argv[i] != 0; i++) 80005d3a: 04a1 addi s1,s1,8 80005d3c: ff2499e3 bne s1,s2,80005d2e <sys_exec+0xac> return -1; 80005d40: 597d li s2,-1 80005d42: a82d j 80005d7c <sys_exec+0xfa> argv[i] = 0; 80005d44: 0a8e slli s5,s5,0x3 80005d46: fc040793 addi a5,s0,-64 80005d4a: 9abe add s5,s5,a5 80005d4c: e80ab023 sd zero,-384(s5) int ret = exec(path, argv); 80005d50: e4040593 addi a1,s0,-448 80005d54: f4040513 addi a0,s0,-192 80005d58: fffff097 auipc ra,0xfffff 80005d5c: 194080e7 jalr 404(ra) # 80004eec <exec> 80005d60: 892a mv s2,a0 for(i = 0; i < NELEM(argv) && argv[i] != 0; i++) 80005d62: 10048993 addi s3,s1,256 80005d66: 6088 ld a0,0(s1) 80005d68: c911 beqz a0,80005d7c <sys_exec+0xfa> kfree(argv[i]); 80005d6a: ffffb097 auipc ra,0xffffb 80005d6e: c8e080e7 jalr -882(ra) # 800009f8 <kfree> for(i = 0; i < NELEM(argv) && argv[i] != 0; i++) 80005d72: 04a1 addi s1,s1,8 80005d74: ff3499e3 bne s1,s3,80005d66 <sys_exec+0xe4> 80005d78: a011 j 80005d7c <sys_exec+0xfa> return -1; 80005d7a: 597d li s2,-1 } 80005d7c: 854a mv a0,s2 80005d7e: 60be ld ra,456(sp) 80005d80: 641e ld s0,448(sp) 80005d82: 74fa ld s1,440(sp) 80005d84: 795a ld s2,432(sp) 80005d86: 79ba ld s3,424(sp) 80005d88: 7a1a ld s4,416(sp) 80005d8a: 6afa ld s5,408(sp) 80005d8c: 6179 addi sp,sp,464 80005d8e: 8082 ret 0000000080005d90 <sys_pipe>: uint64 sys_pipe(void) { 80005d90: 7139 addi sp,sp,-64 80005d92: fc06 sd ra,56(sp) 80005d94: f822 sd s0,48(sp) 80005d96: f426 sd s1,40(sp) 80005d98: 0080 addi s0,sp,64 uint64 fdarray; // user pointer to array of two integers struct file *rf, *wf; int fd0, fd1; struct proc *p = myproc(); 80005d9a: ffffc097 auipc ra,0xffffc 80005d9e: c1c080e7 jalr -996(ra) # 800019b6 <myproc> 80005da2: 84aa mv s1,a0 if(argaddr(0, &fdarray) < 0) 80005da4: fd840593 addi a1,s0,-40 80005da8: 4501 li a0,0 80005daa: ffffd097 auipc ra,0xffffd 80005dae: 044080e7 jalr 68(ra) # 80002dee <argaddr> return -1; 80005db2: 57fd li a5,-1 if(argaddr(0, &fdarray) < 0) 80005db4: 0e054063 bltz a0,80005e94 <sys_pipe+0x104> if(pipealloc(&rf, &wf) < 0) 80005db8: fc840593 addi a1,s0,-56 80005dbc: fd040513 addi a0,s0,-48 80005dc0: fffff097 auipc ra,0xfffff 80005dc4: dfc080e7 jalr -516(ra) # 80004bbc <pipealloc> return -1; 80005dc8: 57fd li a5,-1 if(pipealloc(&rf, &wf) < 0) 80005dca: 0c054563 bltz a0,80005e94 <sys_pipe+0x104> fd0 = -1; 80005dce: fcf42223 sw a5,-60(s0) if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){ 80005dd2: fd043503 ld a0,-48(s0) 80005dd6: fffff097 auipc ra,0xfffff 80005dda: 508080e7 jalr 1288(ra) # 800052de <fdalloc> 80005dde: fca42223 sw a0,-60(s0) 80005de2: 08054c63 bltz a0,80005e7a <sys_pipe+0xea> 80005de6: fc843503 ld a0,-56(s0) 80005dea: fffff097 auipc ra,0xfffff 80005dee: 4f4080e7 jalr 1268(ra) # 800052de <fdalloc> 80005df2: fca42023 sw a0,-64(s0) 80005df6: 06054863 bltz a0,80005e66 <sys_pipe+0xd6> p->ofile[fd0] = 0; fileclose(rf); fileclose(wf); return -1; } if(copyout(p->pagetable, fdarray, (char*)&fd0, sizeof(fd0)) < 0 || 80005dfa: 4691 li a3,4 80005dfc: fc440613 addi a2,s0,-60 80005e00: fd843583 ld a1,-40(s0) 80005e04: 68a8 ld a0,80(s1) 80005e06: ffffc097 auipc ra,0xffffc 80005e0a: 86c080e7 jalr -1940(ra) # 80001672 <copyout> 80005e0e: 02054063 bltz a0,80005e2e <sys_pipe+0x9e> copyout(p->pagetable, fdarray+sizeof(fd0), (char *)&fd1, sizeof(fd1)) < 0){ 80005e12: 4691 li a3,4 80005e14: fc040613 addi a2,s0,-64 80005e18: fd843583 ld a1,-40(s0) 80005e1c: 0591 addi a1,a1,4 80005e1e: 68a8 ld a0,80(s1) 80005e20: ffffc097 auipc ra,0xffffc 80005e24: 852080e7 jalr -1966(ra) # 80001672 <copyout> p->ofile[fd1] = 0; fileclose(rf); fileclose(wf); return -1; } return 0; 80005e28: 4781 li a5,0 if(copyout(p->pagetable, fdarray, (char*)&fd0, sizeof(fd0)) < 0 || 80005e2a: 06055563 bgez a0,80005e94 <sys_pipe+0x104> p->ofile[fd0] = 0; 80005e2e: fc442783 lw a5,-60(s0) 80005e32: 07e9 addi a5,a5,26 80005e34: 078e slli a5,a5,0x3 80005e36: 97a6 add a5,a5,s1 80005e38: 0007b023 sd zero,0(a5) p->ofile[fd1] = 0; 80005e3c: fc042503 lw a0,-64(s0) 80005e40: 0569 addi a0,a0,26 80005e42: 050e slli a0,a0,0x3 80005e44: 9526 add a0,a0,s1 80005e46: 00053023 sd zero,0(a0) fileclose(rf); 80005e4a: fd043503 ld a0,-48(s0) 80005e4e: fffff097 auipc ra,0xfffff 80005e52: a3e080e7 jalr -1474(ra) # 8000488c <fileclose> fileclose(wf); 80005e56: fc843503 ld a0,-56(s0) 80005e5a: fffff097 auipc ra,0xfffff 80005e5e: a32080e7 jalr -1486(ra) # 8000488c <fileclose> return -1; 80005e62: 57fd li a5,-1 80005e64: a805 j 80005e94 <sys_pipe+0x104> if(fd0 >= 0) 80005e66: fc442783 lw a5,-60(s0) 80005e6a: 0007c863 bltz a5,80005e7a <sys_pipe+0xea> p->ofile[fd0] = 0; 80005e6e: 01a78513 addi a0,a5,26 80005e72: 050e slli a0,a0,0x3 80005e74: 9526 add a0,a0,s1 80005e76: 00053023 sd zero,0(a0) fileclose(rf); 80005e7a: fd043503 ld a0,-48(s0) 80005e7e: fffff097 auipc ra,0xfffff 80005e82: a0e080e7 jalr -1522(ra) # 8000488c <fileclose> fileclose(wf); 80005e86: fc843503 ld a0,-56(s0) 80005e8a: fffff097 auipc ra,0xfffff 80005e8e: a02080e7 jalr -1534(ra) # 8000488c <fileclose> return -1; 80005e92: 57fd li a5,-1 } 80005e94: 853e mv a0,a5 80005e96: 70e2 ld ra,56(sp) 80005e98: 7442 ld s0,48(sp) 80005e9a: 74a2 ld s1,40(sp) 80005e9c: 6121 addi sp,sp,64 80005e9e: 8082 ret 0000000080005ea0 <kernelvec>: 80005ea0: 7111 addi sp,sp,-256 80005ea2: e006 sd ra,0(sp) 80005ea4: e40a sd sp,8(sp) 80005ea6: e80e sd gp,16(sp) 80005ea8: ec12 sd tp,24(sp) 80005eaa: f016 sd t0,32(sp) 80005eac: f41a sd t1,40(sp) 80005eae: f81e sd t2,48(sp) 80005eb0: fc22 sd s0,56(sp) 80005eb2: e0a6 sd s1,64(sp) 80005eb4: e4aa sd a0,72(sp) 80005eb6: e8ae sd a1,80(sp) 80005eb8: ecb2 sd a2,88(sp) 80005eba: f0b6 sd a3,96(sp) 80005ebc: f4ba sd a4,104(sp) 80005ebe: f8be sd a5,112(sp) 80005ec0: fcc2 sd a6,120(sp) 80005ec2: e146 sd a7,128(sp) 80005ec4: e54a sd s2,136(sp) 80005ec6: e94e sd s3,144(sp) 80005ec8: ed52 sd s4,152(sp) 80005eca: f156 sd s5,160(sp) 80005ecc: f55a sd s6,168(sp) 80005ece: f95e sd s7,176(sp) 80005ed0: fd62 sd s8,184(sp) 80005ed2: e1e6 sd s9,192(sp) 80005ed4: e5ea sd s10,200(sp) 80005ed6: e9ee sd s11,208(sp) 80005ed8: edf2 sd t3,216(sp) 80005eda: f1f6 sd t4,224(sp) 80005edc: f5fa sd t5,232(sp) 80005ede: f9fe sd t6,240(sp) 80005ee0: d1ffc0ef jal ra,80002bfe <kerneltrap> 80005ee4: 6082 ld ra,0(sp) 80005ee6: 6122 ld sp,8(sp) 80005ee8: 61c2 ld gp,16(sp) 80005eea: 7282 ld t0,32(sp) 80005eec: 7322 ld t1,40(sp) 80005eee: 73c2 ld t2,48(sp) 80005ef0: 7462 ld s0,56(sp) 80005ef2: 6486 ld s1,64(sp) 80005ef4: 6526 ld a0,72(sp) 80005ef6: 65c6 ld a1,80(sp) 80005ef8: 6666 ld a2,88(sp) 80005efa: 7686 ld a3,96(sp) 80005efc: 7726 ld a4,104(sp) 80005efe: 77c6 ld a5,112(sp) 80005f00: 7866 ld a6,120(sp) 80005f02: 688a ld a7,128(sp) 80005f04: 692a ld s2,136(sp) 80005f06: 69ca ld s3,144(sp) 80005f08: 6a6a ld s4,152(sp) 80005f0a: 7a8a ld s5,160(sp) 80005f0c: 7b2a ld s6,168(sp) 80005f0e: 7bca ld s7,176(sp) 80005f10: 7c6a ld s8,184(sp) 80005f12: 6c8e ld s9,192(sp) 80005f14: 6d2e ld s10,200(sp) 80005f16: 6dce ld s11,208(sp) 80005f18: 6e6e ld t3,216(sp) 80005f1a: 7e8e ld t4,224(sp) 80005f1c: 7f2e ld t5,232(sp) 80005f1e: 7fce ld t6,240(sp) 80005f20: 6111 addi sp,sp,256 80005f22: 10200073 sret 80005f26: 00000013 nop 80005f2a: 00000013 nop 80005f2e: 0001 nop 0000000080005f30 <timervec>: 80005f30: 34051573 csrrw a0,mscratch,a0 80005f34: e10c sd a1,0(a0) 80005f36: e510 sd a2,8(a0) 80005f38: e914 sd a3,16(a0) 80005f3a: 6d0c ld a1,24(a0) 80005f3c: 7110 ld a2,32(a0) 80005f3e: 6194 ld a3,0(a1) 80005f40: 96b2 add a3,a3,a2 80005f42: e194 sd a3,0(a1) 80005f44: 4589 li a1,2 80005f46: 14459073 csrw sip,a1 80005f4a: 6914 ld a3,16(a0) 80005f4c: 6510 ld a2,8(a0) 80005f4e: 610c ld a1,0(a0) 80005f50: 34051573 csrrw a0,mscratch,a0 80005f54: 30200073 mret ... 0000000080005f5a <plicinit>: // the riscv Platform Level Interrupt Controller (PLIC). // void plicinit(void) { 80005f5a: 1141 addi sp,sp,-16 80005f5c: e422 sd s0,8(sp) 80005f5e: 0800 addi s0,sp,16 // set desired IRQ priorities non-zero (otherwise disabled). *(uint32*)(PLIC + UART0_IRQ*4) = 1; 80005f60: 0c0007b7 lui a5,0xc000 80005f64: 4705 li a4,1 80005f66: d798 sw a4,40(a5) *(uint32*)(PLIC + VIRTIO0_IRQ*4) = 1; 80005f68: c3d8 sw a4,4(a5) } 80005f6a: 6422 ld s0,8(sp) 80005f6c: 0141 addi sp,sp,16 80005f6e: 8082 ret 0000000080005f70 <plicinithart>: void plicinithart(void) { 80005f70: 1141 addi sp,sp,-16 80005f72: e406 sd ra,8(sp) 80005f74: e022 sd s0,0(sp) 80005f76: 0800 addi s0,sp,16 int hart = cpuid(); 80005f78: ffffc097 auipc ra,0xffffc 80005f7c: a0c080e7 jalr -1524(ra) # 80001984 <cpuid> // set uart's enable bit for this hart's S-mode. *(uint32*)PLIC_SENABLE(hart)= (1 << UART0_IRQ) | (1 << VIRTIO0_IRQ); 80005f80: 0085171b slliw a4,a0,0x8 80005f84: 0c0027b7 lui a5,0xc002 80005f88: 97ba add a5,a5,a4 80005f8a: 40200713 li a4,1026 80005f8e: 08e7a023 sw a4,128(a5) # c002080 <_entry-0x73ffdf80> // set this hart's S-mode priority threshold to 0. *(uint32*)PLIC_SPRIORITY(hart) = 0; 80005f92: 00d5151b slliw a0,a0,0xd 80005f96: 0c2017b7 lui a5,0xc201 80005f9a: 953e add a0,a0,a5 80005f9c: 00052023 sw zero,0(a0) } 80005fa0: 60a2 ld ra,8(sp) 80005fa2: 6402 ld s0,0(sp) 80005fa4: 0141 addi sp,sp,16 80005fa6: 8082 ret 0000000080005fa8 <plic_claim>: // ask the PLIC what interrupt we should serve. int plic_claim(void) { 80005fa8: 1141 addi sp,sp,-16 80005faa: e406 sd ra,8(sp) 80005fac: e022 sd s0,0(sp) 80005fae: 0800 addi s0,sp,16 int hart = cpuid(); 80005fb0: ffffc097 auipc ra,0xffffc 80005fb4: 9d4080e7 jalr -1580(ra) # 80001984 <cpuid> int irq = *(uint32*)PLIC_SCLAIM(hart); 80005fb8: 00d5179b slliw a5,a0,0xd 80005fbc: 0c201537 lui a0,0xc201 80005fc0: 953e add a0,a0,a5 return irq; } 80005fc2: 4148 lw a0,4(a0) 80005fc4: 60a2 ld ra,8(sp) 80005fc6: 6402 ld s0,0(sp) 80005fc8: 0141 addi sp,sp,16 80005fca: 8082 ret 0000000080005fcc <plic_complete>: // tell the PLIC we've served this IRQ. void plic_complete(int irq) { 80005fcc: 1101 addi sp,sp,-32 80005fce: ec06 sd ra,24(sp) 80005fd0: e822 sd s0,16(sp) 80005fd2: e426 sd s1,8(sp) 80005fd4: 1000 addi s0,sp,32 80005fd6: 84aa mv s1,a0 int hart = cpuid(); 80005fd8: ffffc097 auipc ra,0xffffc 80005fdc: 9ac080e7 jalr -1620(ra) # 80001984 <cpuid> *(uint32*)PLIC_SCLAIM(hart) = irq; 80005fe0: 00d5151b slliw a0,a0,0xd 80005fe4: 0c2017b7 lui a5,0xc201 80005fe8: 97aa add a5,a5,a0 80005fea: c3c4 sw s1,4(a5) } 80005fec: 60e2 ld ra,24(sp) 80005fee: 6442 ld s0,16(sp) 80005ff0: 64a2 ld s1,8(sp) 80005ff2: 6105 addi sp,sp,32 80005ff4: 8082 ret 0000000080005ff6 <free_desc>: } // mark a descriptor as free. static void free_desc(int i) { 80005ff6: 1141 addi sp,sp,-16 80005ff8: e406 sd ra,8(sp) 80005ffa: e022 sd s0,0(sp) 80005ffc: 0800 addi s0,sp,16 if(i >= NUM) 80005ffe: 479d li a5,7 80006000: 06a7c963 blt a5,a0,80006072 <free_desc+0x7c> panic("free_desc 1"); if(disk.free[i]) 80006004: 0001e797 auipc a5,0x1e 80006008: ffc78793 addi a5,a5,-4 # 80024000 <disk> 8000600c: 00a78733 add a4,a5,a0 80006010: 6789 lui a5,0x2 80006012: 97ba add a5,a5,a4 80006014: 0187c783 lbu a5,24(a5) # 2018 <_entry-0x7fffdfe8> 80006018: e7ad bnez a5,80006082 <free_desc+0x8c> panic("free_desc 2"); disk.desc[i].addr = 0; 8000601a: 00451793 slli a5,a0,0x4 8000601e: 00020717 auipc a4,0x20 80006022: fe270713 addi a4,a4,-30 # 80026000 <disk+0x2000> 80006026: 6314 ld a3,0(a4) 80006028: 96be add a3,a3,a5 8000602a: 0006b023 sd zero,0(a3) disk.desc[i].len = 0; 8000602e: 6314 ld a3,0(a4) 80006030: 96be add a3,a3,a5 80006032: 0006a423 sw zero,8(a3) disk.desc[i].flags = 0; 80006036: 6314 ld a3,0(a4) 80006038: 96be add a3,a3,a5 8000603a: 00069623 sh zero,12(a3) disk.desc[i].next = 0; 8000603e: 6318 ld a4,0(a4) 80006040: 97ba add a5,a5,a4 80006042: 00079723 sh zero,14(a5) disk.free[i] = 1; 80006046: 0001e797 auipc a5,0x1e 8000604a: fba78793 addi a5,a5,-70 # 80024000 <disk> 8000604e: 97aa add a5,a5,a0 80006050: 6509 lui a0,0x2 80006052: 953e add a0,a0,a5 80006054: 4785 li a5,1 80006056: 00f50c23 sb a5,24(a0) # 2018 <_entry-0x7fffdfe8> wakeup(&disk.free[0]); 8000605a: 00020517 auipc a0,0x20 8000605e: fbe50513 addi a0,a0,-66 # 80026018 <disk+0x2018> 80006062: ffffc097 auipc ra,0xffffc 80006066: 1a4080e7 jalr 420(ra) # 80002206 <wakeup> } 8000606a: 60a2 ld ra,8(sp) 8000606c: 6402 ld s0,0(sp) 8000606e: 0141 addi sp,sp,16 80006070: 8082 ret panic("free_desc 1"); 80006072: 00002517 auipc a0,0x2 80006076: 7f650513 addi a0,a0,2038 # 80008868 <syscalls+0x340> 8000607a: ffffa097 auipc ra,0xffffa 8000607e: 4c4080e7 jalr 1220(ra) # 8000053e <panic> panic("free_desc 2"); 80006082: 00002517 auipc a0,0x2 80006086: 7f650513 addi a0,a0,2038 # 80008878 <syscalls+0x350> 8000608a: ffffa097 auipc ra,0xffffa 8000608e: 4b4080e7 jalr 1204(ra) # 8000053e <panic> 0000000080006092 <virtio_disk_init>: { 80006092: 1101 addi sp,sp,-32 80006094: ec06 sd ra,24(sp) 80006096: e822 sd s0,16(sp) 80006098: e426 sd s1,8(sp) 8000609a: 1000 addi s0,sp,32 initlock(&disk.vdisk_lock, "virtio_disk"); 8000609c: 00002597 auipc a1,0x2 800060a0: 7ec58593 addi a1,a1,2028 # 80008888 <syscalls+0x360> 800060a4: 00020517 auipc a0,0x20 800060a8: 08450513 addi a0,a0,132 # 80026128 <disk+0x2128> 800060ac: ffffb097 auipc ra,0xffffb 800060b0: aa8080e7 jalr -1368(ra) # 80000b54 <initlock> if(*R(VIRTIO_MMIO_MAGIC_VALUE) != 0x74726976 || 800060b4: 100017b7 lui a5,0x10001 800060b8: 4398 lw a4,0(a5) 800060ba: 2701 sext.w a4,a4 800060bc: 747277b7 lui a5,0x74727 800060c0: 97678793 addi a5,a5,-1674 # 74726976 <_entry-0xb8d968a> 800060c4: 0ef71163 bne a4,a5,800061a6 <virtio_disk_init+0x114> *R(VIRTIO_MMIO_VERSION) != 1 || 800060c8: 100017b7 lui a5,0x10001 800060cc: 43dc lw a5,4(a5) 800060ce: 2781 sext.w a5,a5 if(*R(VIRTIO_MMIO_MAGIC_VALUE) != 0x74726976 || 800060d0: 4705 li a4,1 800060d2: 0ce79a63 bne a5,a4,800061a6 <virtio_disk_init+0x114> *R(VIRTIO_MMIO_DEVICE_ID) != 2 || 800060d6: 100017b7 lui a5,0x10001 800060da: 479c lw a5,8(a5) 800060dc: 2781 sext.w a5,a5 *R(VIRTIO_MMIO_VERSION) != 1 || 800060de: 4709 li a4,2 800060e0: 0ce79363 bne a5,a4,800061a6 <virtio_disk_init+0x114> *R(VIRTIO_MMIO_VENDOR_ID) != 0x554d4551){ 800060e4: 100017b7 lui a5,0x10001 800060e8: 47d8 lw a4,12(a5) 800060ea: 2701 sext.w a4,a4 *R(VIRTIO_MMIO_DEVICE_ID) != 2 || 800060ec: 554d47b7 lui a5,0x554d4 800060f0: 55178793 addi a5,a5,1361 # 554d4551 <_entry-0x2ab2baaf> 800060f4: 0af71963 bne a4,a5,800061a6 <virtio_disk_init+0x114> *R(VIRTIO_MMIO_STATUS) = status; 800060f8: 100017b7 lui a5,0x10001 800060fc: 4705 li a4,1 800060fe: dbb8 sw a4,112(a5) *R(VIRTIO_MMIO_STATUS) = status; 80006100: 470d li a4,3 80006102: dbb8 sw a4,112(a5) uint64 features = *R(VIRTIO_MMIO_DEVICE_FEATURES); 80006104: 4b94 lw a3,16(a5) features &= ~(1 << VIRTIO_RING_F_INDIRECT_DESC); 80006106: c7ffe737 lui a4,0xc7ffe 8000610a: 75f70713 addi a4,a4,1887 # ffffffffc7ffe75f <end+0xffffffff47fd775f> 8000610e: 8f75 and a4,a4,a3 *R(VIRTIO_MMIO_DRIVER_FEATURES) = features; 80006110: 2701 sext.w a4,a4 80006112: d398 sw a4,32(a5) *R(VIRTIO_MMIO_STATUS) = status; 80006114: 472d li a4,11 80006116: dbb8 sw a4,112(a5) *R(VIRTIO_MMIO_STATUS) = status; 80006118: 473d li a4,15 8000611a: dbb8 sw a4,112(a5) *R(VIRTIO_MMIO_GUEST_PAGE_SIZE) = PGSIZE; 8000611c: 6705 lui a4,0x1 8000611e: d798 sw a4,40(a5) *R(VIRTIO_MMIO_QUEUE_SEL) = 0; 80006120: 0207a823 sw zero,48(a5) # 10001030 <_entry-0x6fffefd0> uint32 max = *R(VIRTIO_MMIO_QUEUE_NUM_MAX); 80006124: 5bdc lw a5,52(a5) 80006126: 2781 sext.w a5,a5 if(max == 0) 80006128: c7d9 beqz a5,800061b6 <virtio_disk_init+0x124> if(max < NUM) 8000612a: 471d li a4,7 8000612c: 08f77d63 bgeu a4,a5,800061c6 <virtio_disk_init+0x134> *R(VIRTIO_MMIO_QUEUE_NUM) = NUM; 80006130: 100014b7 lui s1,0x10001 80006134: 47a1 li a5,8 80006136: dc9c sw a5,56(s1) memset(disk.pages, 0, sizeof(disk.pages)); 80006138: 6609 lui a2,0x2 8000613a: 4581 li a1,0 8000613c: 0001e517 auipc a0,0x1e 80006140: ec450513 addi a0,a0,-316 # 80024000 <disk> 80006144: ffffb097 auipc ra,0xffffb 80006148: b9c080e7 jalr -1124(ra) # 80000ce0 <memset> *R(VIRTIO_MMIO_QUEUE_PFN) = ((uint64)disk.pages) >> PGSHIFT; 8000614c: 0001e717 auipc a4,0x1e 80006150: eb470713 addi a4,a4,-332 # 80024000 <disk> 80006154: 00c75793 srli a5,a4,0xc 80006158: 2781 sext.w a5,a5 8000615a: c0bc sw a5,64(s1) disk.desc = (struct virtq_desc *) disk.pages; 8000615c: 00020797 auipc a5,0x20 80006160: ea478793 addi a5,a5,-348 # 80026000 <disk+0x2000> 80006164: e398 sd a4,0(a5) disk.avail = (struct virtq_avail *)(disk.pages + NUM*sizeof(struct virtq_desc)); 80006166: 0001e717 auipc a4,0x1e 8000616a: f1a70713 addi a4,a4,-230 # 80024080 <disk+0x80> 8000616e: e798 sd a4,8(a5) disk.used = (struct virtq_used *) (disk.pages + PGSIZE); 80006170: 0001f717 auipc a4,0x1f 80006174: e9070713 addi a4,a4,-368 # 80025000 <disk+0x1000> 80006178: eb98 sd a4,16(a5) disk.free[i] = 1; 8000617a: 4705 li a4,1 8000617c: 00e78c23 sb a4,24(a5) 80006180: 00e78ca3 sb a4,25(a5) 80006184: 00e78d23 sb a4,26(a5) 80006188: 00e78da3 sb a4,27(a5) 8000618c: 00e78e23 sb a4,28(a5) 80006190: 00e78ea3 sb a4,29(a5) 80006194: 00e78f23 sb a4,30(a5) 80006198: 00e78fa3 sb a4,31(a5) } 8000619c: 60e2 ld ra,24(sp) 8000619e: 6442 ld s0,16(sp) 800061a0: 64a2 ld s1,8(sp) 800061a2: 6105 addi sp,sp,32 800061a4: 8082 ret panic("could not find virtio disk"); 800061a6: 00002517 auipc a0,0x2 800061aa: 6f250513 addi a0,a0,1778 # 80008898 <syscalls+0x370> 800061ae: ffffa097 auipc ra,0xffffa 800061b2: 390080e7 jalr 912(ra) # 8000053e <panic> panic("virtio disk has no queue 0"); 800061b6: 00002517 auipc a0,0x2 800061ba: 70250513 addi a0,a0,1794 # 800088b8 <syscalls+0x390> 800061be: ffffa097 auipc ra,0xffffa 800061c2: 380080e7 jalr 896(ra) # 8000053e <panic> panic("virtio disk max queue too short"); 800061c6: 00002517 auipc a0,0x2 800061ca: 71250513 addi a0,a0,1810 # 800088d8 <syscalls+0x3b0> 800061ce: ffffa097 auipc ra,0xffffa 800061d2: 370080e7 jalr 880(ra) # 8000053e <panic> 00000000800061d6 <virtio_disk_rw>: return 0; } void virtio_disk_rw(struct buf *b, int write) { 800061d6: 7159 addi sp,sp,-112 800061d8: f486 sd ra,104(sp) 800061da: f0a2 sd s0,96(sp) 800061dc: eca6 sd s1,88(sp) 800061de: e8ca sd s2,80(sp) 800061e0: e4ce sd s3,72(sp) 800061e2: e0d2 sd s4,64(sp) 800061e4: fc56 sd s5,56(sp) 800061e6: f85a sd s6,48(sp) 800061e8: f45e sd s7,40(sp) 800061ea: f062 sd s8,32(sp) 800061ec: ec66 sd s9,24(sp) 800061ee: e86a sd s10,16(sp) 800061f0: 1880 addi s0,sp,112 800061f2: 892a mv s2,a0 800061f4: 8d2e mv s10,a1 uint64 sector = b->blockno * (BSIZE / 512); 800061f6: 00c52c83 lw s9,12(a0) 800061fa: 001c9c9b slliw s9,s9,0x1 800061fe: 1c82 slli s9,s9,0x20 80006200: 020cdc93 srli s9,s9,0x20 acquire(&disk.vdisk_lock); 80006204: 00020517 auipc a0,0x20 80006208: f2450513 addi a0,a0,-220 # 80026128 <disk+0x2128> 8000620c: ffffb097 auipc ra,0xffffb 80006210: 9d8080e7 jalr -1576(ra) # 80000be4 <acquire> for(int i = 0; i < 3; i++){ 80006214: 4981 li s3,0 for(int i = 0; i < NUM; i++){ 80006216: 4c21 li s8,8 disk.free[i] = 0; 80006218: 0001eb97 auipc s7,0x1e 8000621c: de8b8b93 addi s7,s7,-536 # 80024000 <disk> 80006220: 6b09 lui s6,0x2 for(int i = 0; i < 3; i++){ 80006222: 4a8d li s5,3 for(int i = 0; i < NUM; i++){ 80006224: 8a4e mv s4,s3 80006226: a051 j 800062aa <virtio_disk_rw+0xd4> disk.free[i] = 0; 80006228: 00fb86b3 add a3,s7,a5 8000622c: 96da add a3,a3,s6 8000622e: 00068c23 sb zero,24(a3) idx[i] = alloc_desc(); 80006232: c21c sw a5,0(a2) if(idx[i] < 0){ 80006234: 0207c563 bltz a5,8000625e <virtio_disk_rw+0x88> for(int i = 0; i < 3; i++){ 80006238: 2485 addiw s1,s1,1 8000623a: 0711 addi a4,a4,4 8000623c: 25548063 beq s1,s5,8000647c <virtio_disk_rw+0x2a6> idx[i] = alloc_desc(); 80006240: 863a mv a2,a4 for(int i = 0; i < NUM; i++){ 80006242: 00020697 auipc a3,0x20 80006246: dd668693 addi a3,a3,-554 # 80026018 <disk+0x2018> 8000624a: 87d2 mv a5,s4 if(disk.free[i]){ 8000624c: 0006c583 lbu a1,0(a3) 80006250: fde1 bnez a1,80006228 <virtio_disk_rw+0x52> for(int i = 0; i < NUM; i++){ 80006252: 2785 addiw a5,a5,1 80006254: 0685 addi a3,a3,1 80006256: ff879be3 bne a5,s8,8000624c <virtio_disk_rw+0x76> idx[i] = alloc_desc(); 8000625a: 57fd li a5,-1 8000625c: c21c sw a5,0(a2) for(int j = 0; j < i; j++) 8000625e: 02905a63 blez s1,80006292 <virtio_disk_rw+0xbc> free_desc(idx[j]); 80006262: f9042503 lw a0,-112(s0) 80006266: 00000097 auipc ra,0x0 8000626a: d90080e7 jalr -624(ra) # 80005ff6 <free_desc> for(int j = 0; j < i; j++) 8000626e: 4785 li a5,1 80006270: 0297d163 bge a5,s1,80006292 <virtio_disk_rw+0xbc> free_desc(idx[j]); 80006274: f9442503 lw a0,-108(s0) 80006278: 00000097 auipc ra,0x0 8000627c: d7e080e7 jalr -642(ra) # 80005ff6 <free_desc> for(int j = 0; j < i; j++) 80006280: 4789 li a5,2 80006282: 0097d863 bge a5,s1,80006292 <virtio_disk_rw+0xbc> free_desc(idx[j]); 80006286: f9842503 lw a0,-104(s0) 8000628a: 00000097 auipc ra,0x0 8000628e: d6c080e7 jalr -660(ra) # 80005ff6 <free_desc> int idx[3]; while(1){ if(alloc3_desc(idx) == 0) { break; } sleep(&disk.free[0], &disk.vdisk_lock); 80006292: 00020597 auipc a1,0x20 80006296: e9658593 addi a1,a1,-362 # 80026128 <disk+0x2128> 8000629a: 00020517 auipc a0,0x20 8000629e: d7e50513 addi a0,a0,-642 # 80026018 <disk+0x2018> 800062a2: ffffc097 auipc ra,0xffffc 800062a6: dd8080e7 jalr -552(ra) # 8000207a <sleep> for(int i = 0; i < 3; i++){ 800062aa: f9040713 addi a4,s0,-112 800062ae: 84ce mv s1,s3 800062b0: bf41 j 80006240 <virtio_disk_rw+0x6a> // qemu's virtio-blk.c reads them. struct virtio_blk_req *buf0 = &disk.ops[idx[0]]; if(write) buf0->type = VIRTIO_BLK_T_OUT; // write the disk 800062b2: 20058713 addi a4,a1,512 800062b6: 00471693 slli a3,a4,0x4 800062ba: 0001e717 auipc a4,0x1e 800062be: d4670713 addi a4,a4,-698 # 80024000 <disk> 800062c2: 9736 add a4,a4,a3 800062c4: 4685 li a3,1 800062c6: 0ad72423 sw a3,168(a4) else buf0->type = VIRTIO_BLK_T_IN; // read the disk buf0->reserved = 0; 800062ca: 20058713 addi a4,a1,512 800062ce: 00471693 slli a3,a4,0x4 800062d2: 0001e717 auipc a4,0x1e 800062d6: d2e70713 addi a4,a4,-722 # 80024000 <disk> 800062da: 9736 add a4,a4,a3 800062dc: 0a072623 sw zero,172(a4) buf0->sector = sector; 800062e0: 0b973823 sd s9,176(a4) disk.desc[idx[0]].addr = (uint64) buf0; 800062e4: 7679 lui a2,0xffffe 800062e6: 963e add a2,a2,a5 800062e8: 00020697 auipc a3,0x20 800062ec: d1868693 addi a3,a3,-744 # 80026000 <disk+0x2000> 800062f0: 6298 ld a4,0(a3) 800062f2: 9732 add a4,a4,a2 800062f4: e308 sd a0,0(a4) disk.desc[idx[0]].len = sizeof(struct virtio_blk_req); 800062f6: 6298 ld a4,0(a3) 800062f8: 9732 add a4,a4,a2 800062fa: 4541 li a0,16 800062fc: c708 sw a0,8(a4) disk.desc[idx[0]].flags = VRING_DESC_F_NEXT; 800062fe: 6298 ld a4,0(a3) 80006300: 9732 add a4,a4,a2 80006302: 4505 li a0,1 80006304: 00a71623 sh a0,12(a4) disk.desc[idx[0]].next = idx[1]; 80006308: f9442703 lw a4,-108(s0) 8000630c: 6288 ld a0,0(a3) 8000630e: 962a add a2,a2,a0 80006310: 00e61723 sh a4,14(a2) # ffffffffffffe00e <end+0xffffffff7ffd700e> disk.desc[idx[1]].addr = (uint64) b->data; 80006314: 0712 slli a4,a4,0x4 80006316: 6290 ld a2,0(a3) 80006318: 963a add a2,a2,a4 8000631a: 05890513 addi a0,s2,88 8000631e: e208 sd a0,0(a2) disk.desc[idx[1]].len = BSIZE; 80006320: 6294 ld a3,0(a3) 80006322: 96ba add a3,a3,a4 80006324: 40000613 li a2,1024 80006328: c690 sw a2,8(a3) if(write) 8000632a: 140d0063 beqz s10,8000646a <virtio_disk_rw+0x294> disk.desc[idx[1]].flags = 0; // device reads b->data 8000632e: 00020697 auipc a3,0x20 80006332: cd26b683 ld a3,-814(a3) # 80026000 <disk+0x2000> 80006336: 96ba add a3,a3,a4 80006338: 00069623 sh zero,12(a3) else disk.desc[idx[1]].flags = VRING_DESC_F_WRITE; // device writes b->data disk.desc[idx[1]].flags |= VRING_DESC_F_NEXT; 8000633c: 0001e817 auipc a6,0x1e 80006340: cc480813 addi a6,a6,-828 # 80024000 <disk> 80006344: 00020517 auipc a0,0x20 80006348: cbc50513 addi a0,a0,-836 # 80026000 <disk+0x2000> 8000634c: 6114 ld a3,0(a0) 8000634e: 96ba add a3,a3,a4 80006350: 00c6d603 lhu a2,12(a3) 80006354: 00166613 ori a2,a2,1 80006358: 00c69623 sh a2,12(a3) disk.desc[idx[1]].next = idx[2]; 8000635c: f9842683 lw a3,-104(s0) 80006360: 6110 ld a2,0(a0) 80006362: 9732 add a4,a4,a2 80006364: 00d71723 sh a3,14(a4) disk.info[idx[0]].status = 0xff; // device writes 0 on success 80006368: 20058613 addi a2,a1,512 8000636c: 0612 slli a2,a2,0x4 8000636e: 9642 add a2,a2,a6 80006370: 577d li a4,-1 80006372: 02e60823 sb a4,48(a2) disk.desc[idx[2]].addr = (uint64) &disk.info[idx[0]].status; 80006376: 00469713 slli a4,a3,0x4 8000637a: 6114 ld a3,0(a0) 8000637c: 96ba add a3,a3,a4 8000637e: 03078793 addi a5,a5,48 80006382: 97c2 add a5,a5,a6 80006384: e29c sd a5,0(a3) disk.desc[idx[2]].len = 1; 80006386: 611c ld a5,0(a0) 80006388: 97ba add a5,a5,a4 8000638a: 4685 li a3,1 8000638c: c794 sw a3,8(a5) disk.desc[idx[2]].flags = VRING_DESC_F_WRITE; // device writes the status 8000638e: 611c ld a5,0(a0) 80006390: 97ba add a5,a5,a4 80006392: 4809 li a6,2 80006394: 01079623 sh a6,12(a5) disk.desc[idx[2]].next = 0; 80006398: 611c ld a5,0(a0) 8000639a: 973e add a4,a4,a5 8000639c: 00071723 sh zero,14(a4) // record struct buf for virtio_disk_intr(). b->disk = 1; 800063a0: 00d92223 sw a3,4(s2) disk.info[idx[0]].b = b; 800063a4: 03263423 sd s2,40(a2) // tell the device the first index in our chain of descriptors. disk.avail->ring[disk.avail->idx % NUM] = idx[0]; 800063a8: 6518 ld a4,8(a0) 800063aa: 00275783 lhu a5,2(a4) 800063ae: 8b9d andi a5,a5,7 800063b0: 0786 slli a5,a5,0x1 800063b2: 97ba add a5,a5,a4 800063b4: 00b79223 sh a1,4(a5) __sync_synchronize(); 800063b8: 0ff0000f fence // tell the device another avail ring entry is available. disk.avail->idx += 1; // not % NUM ... 800063bc: 6518 ld a4,8(a0) 800063be: 00275783 lhu a5,2(a4) 800063c2: 2785 addiw a5,a5,1 800063c4: 00f71123 sh a5,2(a4) __sync_synchronize(); 800063c8: 0ff0000f fence *R(VIRTIO_MMIO_QUEUE_NOTIFY) = 0; // value is queue number 800063cc: 100017b7 lui a5,0x10001 800063d0: 0407a823 sw zero,80(a5) # 10001050 <_entry-0x6fffefb0> // Wait for virtio_disk_intr() to say request has finished. while(b->disk == 1) { 800063d4: 00492703 lw a4,4(s2) 800063d8: 4785 li a5,1 800063da: 02f71163 bne a4,a5,800063fc <virtio_disk_rw+0x226> sleep(b, &disk.vdisk_lock); 800063de: 00020997 auipc s3,0x20 800063e2: d4a98993 addi s3,s3,-694 # 80026128 <disk+0x2128> while(b->disk == 1) { 800063e6: 4485 li s1,1 sleep(b, &disk.vdisk_lock); 800063e8: 85ce mv a1,s3 800063ea: 854a mv a0,s2 800063ec: ffffc097 auipc ra,0xffffc 800063f0: c8e080e7 jalr -882(ra) # 8000207a <sleep> while(b->disk == 1) { 800063f4: 00492783 lw a5,4(s2) 800063f8: fe9788e3 beq a5,s1,800063e8 <virtio_disk_rw+0x212> } disk.info[idx[0]].b = 0; 800063fc: f9042903 lw s2,-112(s0) 80006400: 20090793 addi a5,s2,512 80006404: 00479713 slli a4,a5,0x4 80006408: 0001e797 auipc a5,0x1e 8000640c: bf878793 addi a5,a5,-1032 # 80024000 <disk> 80006410: 97ba add a5,a5,a4 80006412: 0207b423 sd zero,40(a5) int flag = disk.desc[i].flags; 80006416: 00020997 auipc s3,0x20 8000641a: bea98993 addi s3,s3,-1046 # 80026000 <disk+0x2000> 8000641e: 00491713 slli a4,s2,0x4 80006422: 0009b783 ld a5,0(s3) 80006426: 97ba add a5,a5,a4 80006428: 00c7d483 lhu s1,12(a5) int nxt = disk.desc[i].next; 8000642c: 854a mv a0,s2 8000642e: 00e7d903 lhu s2,14(a5) free_desc(i); 80006432: 00000097 auipc ra,0x0 80006436: bc4080e7 jalr -1084(ra) # 80005ff6 <free_desc> if(flag & VRING_DESC_F_NEXT) 8000643a: 8885 andi s1,s1,1 8000643c: f0ed bnez s1,8000641e <virtio_disk_rw+0x248> free_chain(idx[0]); release(&disk.vdisk_lock); 8000643e: 00020517 auipc a0,0x20 80006442: cea50513 addi a0,a0,-790 # 80026128 <disk+0x2128> 80006446: ffffb097 auipc ra,0xffffb 8000644a: 852080e7 jalr -1966(ra) # 80000c98 <release> } 8000644e: 70a6 ld ra,104(sp) 80006450: 7406 ld s0,96(sp) 80006452: 64e6 ld s1,88(sp) 80006454: 6946 ld s2,80(sp) 80006456: 69a6 ld s3,72(sp) 80006458: 6a06 ld s4,64(sp) 8000645a: 7ae2 ld s5,56(sp) 8000645c: 7b42 ld s6,48(sp) 8000645e: 7ba2 ld s7,40(sp) 80006460: 7c02 ld s8,32(sp) 80006462: 6ce2 ld s9,24(sp) 80006464: 6d42 ld s10,16(sp) 80006466: 6165 addi sp,sp,112 80006468: 8082 ret disk.desc[idx[1]].flags = VRING_DESC_F_WRITE; // device writes b->data 8000646a: 00020697 auipc a3,0x20 8000646e: b966b683 ld a3,-1130(a3) # 80026000 <disk+0x2000> 80006472: 96ba add a3,a3,a4 80006474: 4609 li a2,2 80006476: 00c69623 sh a2,12(a3) 8000647a: b5c9 j 8000633c <virtio_disk_rw+0x166> struct virtio_blk_req *buf0 = &disk.ops[idx[0]]; 8000647c: f9042583 lw a1,-112(s0) 80006480: 20058793 addi a5,a1,512 80006484: 0792 slli a5,a5,0x4 80006486: 0001e517 auipc a0,0x1e 8000648a: c2250513 addi a0,a0,-990 # 800240a8 <disk+0xa8> 8000648e: 953e add a0,a0,a5 if(write) 80006490: e20d11e3 bnez s10,800062b2 <virtio_disk_rw+0xdc> buf0->type = VIRTIO_BLK_T_IN; // read the disk 80006494: 20058713 addi a4,a1,512 80006498: 00471693 slli a3,a4,0x4 8000649c: 0001e717 auipc a4,0x1e 800064a0: b6470713 addi a4,a4,-1180 # 80024000 <disk> 800064a4: 9736 add a4,a4,a3 800064a6: 0a072423 sw zero,168(a4) 800064aa: b505 j 800062ca <virtio_disk_rw+0xf4> 00000000800064ac <virtio_disk_intr>: void virtio_disk_intr() { 800064ac: 1101 addi sp,sp,-32 800064ae: ec06 sd ra,24(sp) 800064b0: e822 sd s0,16(sp) 800064b2: e426 sd s1,8(sp) 800064b4: e04a sd s2,0(sp) 800064b6: 1000 addi s0,sp,32 acquire(&disk.vdisk_lock); 800064b8: 00020517 auipc a0,0x20 800064bc: c7050513 addi a0,a0,-912 # 80026128 <disk+0x2128> 800064c0: ffffa097 auipc ra,0xffffa 800064c4: 724080e7 jalr 1828(ra) # 80000be4 <acquire> // we've seen this interrupt, which the following line does. // this may race with the device writing new entries to // the "used" ring, in which case we may process the new // completion entries in this interrupt, and have nothing to do // in the next interrupt, which is harmless. *R(VIRTIO_MMIO_INTERRUPT_ACK) = *R(VIRTIO_MMIO_INTERRUPT_STATUS) & 0x3; 800064c8: 10001737 lui a4,0x10001 800064cc: 533c lw a5,96(a4) 800064ce: 8b8d andi a5,a5,3 800064d0: d37c sw a5,100(a4) __sync_synchronize(); 800064d2: 0ff0000f fence // the device increments disk.used->idx when it // adds an entry to the used ring. while(disk.used_idx != disk.used->idx){ 800064d6: 00020797 auipc a5,0x20 800064da: b2a78793 addi a5,a5,-1238 # 80026000 <disk+0x2000> 800064de: 6b94 ld a3,16(a5) 800064e0: 0207d703 lhu a4,32(a5) 800064e4: 0026d783 lhu a5,2(a3) 800064e8: 06f70163 beq a4,a5,8000654a <virtio_disk_intr+0x9e> __sync_synchronize(); int id = disk.used->ring[disk.used_idx % NUM].id; 800064ec: 0001e917 auipc s2,0x1e 800064f0: b1490913 addi s2,s2,-1260 # 80024000 <disk> 800064f4: 00020497 auipc s1,0x20 800064f8: b0c48493 addi s1,s1,-1268 # 80026000 <disk+0x2000> __sync_synchronize(); 800064fc: 0ff0000f fence int id = disk.used->ring[disk.used_idx % NUM].id; 80006500: 6898 ld a4,16(s1) 80006502: 0204d783 lhu a5,32(s1) 80006506: 8b9d andi a5,a5,7 80006508: 078e slli a5,a5,0x3 8000650a: 97ba add a5,a5,a4 8000650c: 43dc lw a5,4(a5) if(disk.info[id].status != 0) 8000650e: 20078713 addi a4,a5,512 80006512: 0712 slli a4,a4,0x4 80006514: 974a add a4,a4,s2 80006516: 03074703 lbu a4,48(a4) # 10001030 <_entry-0x6fffefd0> 8000651a: e731 bnez a4,80006566 <virtio_disk_intr+0xba> panic("virtio_disk_intr status"); struct buf *b = disk.info[id].b; 8000651c: 20078793 addi a5,a5,512 80006520: 0792 slli a5,a5,0x4 80006522: 97ca add a5,a5,s2 80006524: 7788 ld a0,40(a5) b->disk = 0; // disk is done with buf 80006526: 00052223 sw zero,4(a0) wakeup(b); 8000652a: ffffc097 auipc ra,0xffffc 8000652e: cdc080e7 jalr -804(ra) # 80002206 <wakeup> disk.used_idx += 1; 80006532: 0204d783 lhu a5,32(s1) 80006536: 2785 addiw a5,a5,1 80006538: 17c2 slli a5,a5,0x30 8000653a: 93c1 srli a5,a5,0x30 8000653c: 02f49023 sh a5,32(s1) while(disk.used_idx != disk.used->idx){ 80006540: 6898 ld a4,16(s1) 80006542: 00275703 lhu a4,2(a4) 80006546: faf71be3 bne a4,a5,800064fc <virtio_disk_intr+0x50> } release(&disk.vdisk_lock); 8000654a: 00020517 auipc a0,0x20 8000654e: bde50513 addi a0,a0,-1058 # 80026128 <disk+0x2128> 80006552: ffffa097 auipc ra,0xffffa 80006556: 746080e7 jalr 1862(ra) # 80000c98 <release> } 8000655a: 60e2 ld ra,24(sp) 8000655c: 6442 ld s0,16(sp) 8000655e: 64a2 ld s1,8(sp) 80006560: 6902 ld s2,0(sp) 80006562: 6105 addi sp,sp,32 80006564: 8082 ret panic("virtio_disk_intr status"); 80006566: 00002517 auipc a0,0x2 8000656a: 39250513 addi a0,a0,914 # 800088f8 <syscalls+0x3d0> 8000656e: ffffa097 auipc ra,0xffffa 80006572: fd0080e7 jalr -48(ra) # 8000053e <panic> ... 0000000080007000 <_trampoline>: 80007000: 14051573 csrrw a0,sscratch,a0 80007004: 02153423 sd ra,40(a0) 80007008: 02253823 sd sp,48(a0) 8000700c: 02353c23 sd gp,56(a0) 80007010: 04453023 sd tp,64(a0) 80007014: 04553423 sd t0,72(a0) 80007018: 04653823 sd t1,80(a0) 8000701c: 04753c23 sd t2,88(a0) 80007020: f120 sd s0,96(a0) 80007022: f524 sd s1,104(a0) 80007024: fd2c sd a1,120(a0) 80007026: e150 sd a2,128(a0) 80007028: e554 sd a3,136(a0) 8000702a: e958 sd a4,144(a0) 8000702c: ed5c sd a5,152(a0) 8000702e: 0b053023 sd a6,160(a0) 80007032: 0b153423 sd a7,168(a0) 80007036: 0b253823 sd s2,176(a0) 8000703a: 0b353c23 sd s3,184(a0) 8000703e: 0d453023 sd s4,192(a0) 80007042: 0d553423 sd s5,200(a0) 80007046: 0d653823 sd s6,208(a0) 8000704a: 0d753c23 sd s7,216(a0) 8000704e: 0f853023 sd s8,224(a0) 80007052: 0f953423 sd s9,232(a0) 80007056: 0fa53823 sd s10,240(a0) 8000705a: 0fb53c23 sd s11,248(a0) 8000705e: 11c53023 sd t3,256(a0) 80007062: 11d53423 sd t4,264(a0) 80007066: 11e53823 sd t5,272(a0) 8000706a: 11f53c23 sd t6,280(a0) 8000706e: 140022f3 csrr t0,sscratch 80007072: 06553823 sd t0,112(a0) 80007076: 00853103 ld sp,8(a0) 8000707a: 02053203 ld tp,32(a0) 8000707e: 01053283 ld t0,16(a0) 80007082: 00053303 ld t1,0(a0) 80007086: 18031073 csrw satp,t1 8000708a: 12000073 sfence.vma 8000708e: 8282 jr t0 0000000080007090 <userret>: 80007090: 18059073 csrw satp,a1 80007094: 12000073 sfence.vma 80007098: 07053283 ld t0,112(a0) 8000709c: 14029073 csrw sscratch,t0 800070a0: 02853083 ld ra,40(a0) 800070a4: 03053103 ld sp,48(a0) 800070a8: 03853183 ld gp,56(a0) 800070ac: 04053203 ld tp,64(a0) 800070b0: 04853283 ld t0,72(a0) 800070b4: 05053303 ld t1,80(a0) 800070b8: 05853383 ld t2,88(a0) 800070bc: 7120 ld s0,96(a0) 800070be: 7524 ld s1,104(a0) 800070c0: 7d2c ld a1,120(a0) 800070c2: 6150 ld a2,128(a0) 800070c4: 6554 ld a3,136(a0) 800070c6: 6958 ld a4,144(a0) 800070c8: 6d5c ld a5,152(a0) 800070ca: 0a053803 ld a6,160(a0) 800070ce: 0a853883 ld a7,168(a0) 800070d2: 0b053903 ld s2,176(a0) 800070d6: 0b853983 ld s3,184(a0) 800070da: 0c053a03 ld s4,192(a0) 800070de: 0c853a83 ld s5,200(a0) 800070e2: 0d053b03 ld s6,208(a0) 800070e6: 0d853b83 ld s7,216(a0) 800070ea: 0e053c03 ld s8,224(a0) 800070ee: 0e853c83 ld s9,232(a0) 800070f2: 0f053d03 ld s10,240(a0) 800070f6: 0f853d83 ld s11,248(a0) 800070fa: 10053e03 ld t3,256(a0) 800070fe: 10853e83 ld t4,264(a0) 80007102: 11053f03 ld t5,272(a0) 80007106: 11853f83 ld t6,280(a0) 8000710a: 14051573 csrrw a0,sscratch,a0 8000710e: 10200073 sret ...
41.950912
109
0.519033
d03431f1dc5912ae179bdcd13040cbb4ba86d688
1,620
asm
Assembly
Aurora/Aurora/x64/Debug/ioquery.asm
manaskamal/aurora-xeneva
fe277f7ac155a40465c70f1db3c27046e4d0f7b5
[ "BSD-2-Clause" ]
8
2021-07-19T04:46:35.000Z
2022-03-12T17:56:00.000Z
Aurora/Aurora/x64/Debug/ioquery.asm
manaskamal/aurora-xeneva
fe277f7ac155a40465c70f1db3c27046e4d0f7b5
[ "BSD-2-Clause" ]
null
null
null
Aurora/Aurora/x64/Debug/ioquery.asm
manaskamal/aurora-xeneva
fe277f7ac155a40465c70f1db3c27046e4d0f7b5
[ "BSD-2-Clause" ]
null
null
null
; Listing generated by Microsoft (R) Optimizing Compiler Version 17.00.50727.1 include listing.inc INCLUDELIB LIBCMT INCLUDELIB OLDNAMES PUBLIC ?ioquery@@YAXHHPEAX@Z ; ioquery EXTRN ?vfs_ioquery@@YAHPEAU_vfs_node_@@HPEAX@Z:PROC ; vfs_ioquery EXTRN x64_cli:PROC EXTRN ?get_current_thread@@YAPEAU_thread_@@XZ:PROC ; get_current_thread pdata SEGMENT $pdata$?ioquery@@YAXHHPEAX@Z DD imagerel $LN4 DD imagerel $LN4+77 DD imagerel $unwind$?ioquery@@YAXHHPEAX@Z pdata ENDS xdata SEGMENT $unwind$?ioquery@@YAXHHPEAX@Z DD 011101H DD 06211H xdata ENDS ; Function compile flags: /Odtpy ; File e:\xeneva project\xeneva\aurora\aurora\sysserv\ioquery.cpp _TEXT SEGMENT node$ = 32 device_id$ = 64 code$ = 72 arg$ = 80 ?ioquery@@YAXHHPEAX@Z PROC ; ioquery ; 22 : void ioquery (int device_id, int code, void* arg) { $LN4: mov QWORD PTR [rsp+24], r8 mov DWORD PTR [rsp+16], edx mov DWORD PTR [rsp+8], ecx sub rsp, 56 ; 00000038H ; 23 : x64_cli(); call x64_cli ; 24 : vfs_node_t *node = get_current_thread()->fd[device_id]; call ?get_current_thread@@YAPEAU_thread_@@XZ ; get_current_thread movsxd rcx, DWORD PTR device_id$[rsp] mov rax, QWORD PTR [rax+rcx*8+272] mov QWORD PTR node$[rsp], rax ; 25 : if (node) cmp QWORD PTR node$[rsp], 0 je SHORT $LN1@ioquery ; 26 : vfs_ioquery(node, code, arg); mov r8, QWORD PTR arg$[rsp] mov edx, DWORD PTR code$[rsp] mov rcx, QWORD PTR node$[rsp] call ?vfs_ioquery@@YAHPEAU_vfs_node_@@HPEAX@Z ; vfs_ioquery $LN1@ioquery: ; 27 : return; ; 28 : } add rsp, 56 ; 00000038H ret 0 ?ioquery@@YAXHHPEAX@Z ENDP ; ioquery _TEXT ENDS END
23.142857
79
0.712346
3eae34c5b6592a0b2154d5bb02939ace7aacb6f4
307
asm
Assembly
programs/oeis/054/A054405.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/054/A054405.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/054/A054405.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A054405: Row sums of array T as in A055215. ; 1,2,3,5,7,10,14,19,26,35,47,63,84,112,149,198,263,349,463,614,814,1079,1430,1895,2511,3327,4408,5840,7737,10250,13579,17989,23831,31570,41822,55403,73394,97227,128799,170623,226028,299424 add $0,5 cal $0,134816 ; Padovan's spiral numbers. mov $1,$0 sub $1,2
38.375
189
0.732899
5139e294bc93b053a69680be2b9f8a4e3a092c2c
127
asm
Assembly
kernel/_idt.asm
campaul/vermilion
8fc678cce17bf5d3fcd3381bd89840ffedd754cf
[ "MIT" ]
null
null
null
kernel/_idt.asm
campaul/vermilion
8fc678cce17bf5d3fcd3381bd89840ffedd754cf
[ "MIT" ]
null
null
null
kernel/_idt.asm
campaul/vermilion
8fc678cce17bf5d3fcd3381bd89840ffedd754cf
[ "MIT" ]
null
null
null
[bits 32] global idt_pointer idt_pointer: dd 0 dd 0 global load_idt load_idt: lidt [idt_pointer] sti ret
9.769231
22
0.653543
8f9e48b8c782d9ed1d04a25f8c8fabc55ff0e1c6
9,263
asm
Assembly
bin/JWASM/Samples/Win64_8.asm
Abd-Beltaji/ASMEMU
4122099e188e951357407152c4666346e45871d3
[ "MIT" ]
3
2022-03-08T16:53:42.000Z
2022-03-18T21:55:57.000Z
bin/JWASM/Samples/Win64_8.asm
Abd-Beltaji/ASMEMU
4122099e188e951357407152c4666346e45871d3
[ "MIT" ]
null
null
null
bin/JWASM/Samples/Win64_8.asm
Abd-Beltaji/ASMEMU
4122099e188e951357407152c4666346e45871d3
[ "MIT" ]
null
null
null
;--- create a 64-bit binary with -pe cmdline option ;--- ;--- JWasm -pe Win64_8.asm .x64 ; -pe requires to set cpu, model & language .model flat, fastcall option casemap:none option frame:auto ; generate SEH-compatible prologues and epilogues option win64:3 ; init shadow space, reserve stack at PROC level ;--- resource IDs IDR_MENU1 EQU 100 IDR_BITMAP1 EQU 101 IDM_EXIT EQU 1000 NULL equ 0 LPSTR typedef ptr LPVOID typedef ptr UINT typedef DWORD BOOL typedef DWORD ;--- winbase definitions HINSTANCE typedef ptr ;--- winuser definitions HWND typedef ptr HMENU typedef ptr HICON typedef ptr HBRUSH typedef ptr HCURSOR typedef ptr HDC typedef ptr HBITMAP typedef ptr WPARAM typedef ptr LPARAM typedef QWORD WS_OVERLAPPEDWINDOW equ 0CF0000h CW_USEDEFAULT equ 80000000h SW_SHOWDEFAULT equ 10 SW_SHOWNORMAL equ 1 IDC_ARROW equ 32512 IDI_APPLICATION equ 32512 CS_VREDRAW equ 1 CS_HREDRAW equ 2 COLOR_WINDOW equ 5 WM_DESTROY equ 2 WM_PAINT equ 000Fh WM_COMMAND equ 0111h proto_WNDPROC typedef proto :HWND,:QWORD,:WPARAM,:LPARAM WNDPROC typedef ptr proto_WNDPROC WNDCLASSEXA struct 8 cbSize DWORD ? style DWORD ? lpfnWndProc WNDPROC ? cbClsExtra DWORD ? cbWndExtra DWORD ? hInstance HINSTANCE ? hIcon HICON ? hCursor HCURSOR ? hbrBackground HBRUSH ? lpszMenuName LPSTR ? lpszClassName LPSTR ? hIconSm HICON ? WNDCLASSEXA ends POINT struct x SDWORD ? y SDWORD ? POINT ends MSG struct 8 hwnd HWND ? message DWORD ? wParam WPARAM ? lParam LPARAM ? time DWORD ? pt POINT <> MSG ends RECT struct left SDWORD ? top SDWORD ? right SDWORD ? bottom SDWORD ? RECT ends PAINTSTRUCT struct 8 hdc HDC ? fErase BOOL ? rcPaint RECT <> fRestore BOOL ? fIncUpdate BOOL ? rgbReserved BYTE 32 dup (?) PAINTSTRUCT ends ;--- wingdi definitions DIB_RGB_COLORS EQU 0 SRCCOPY EQU 00CC0020h HGDIOBJ typedef ptr BITMAPINFOHEADER struct biSize DWORD ? biWidth SDWORD ? biHeight SDWORD ? biPlanes WORD ? biBitCount WORD ? biCompression DWORD ? biSizeImage DWORD ? biXPelsPerMeter SDWORD ? biYPelsPerMeter SDWORD ? biClrUsed DWORD ? biClrImportant DWORD ? BITMAPINFOHEADER ends option dllimport:<kernel32.dll> GetModuleHandleA proto :LPSTR GetCommandLineA proto ExitProcess proto :UINT option dllimport:<user32.dll> BeginPaint proto :HWND, :ptr PAINTSTRUCT CreateWindowExA proto :DWORD, :LPSTR, :LPSTR, :DWORD, :SDWORD, :SDWORD, :SDWORD, :SDWORD, :HWND, :HMENU, :HINSTANCE, :LPVOID DefWindowProcA proto :HWND, :UINT, :WPARAM, :LPARAM DestroyWindow proto :HWND DispatchMessageA proto :ptr MSG EndPaint proto :HWND, :ptr PAINTSTRUCT GetClientRect proto :HWND, :ptr RECT GetMessageA proto :ptr MSG, :HWND, :SDWORD, :SDWORD LoadBitmapA proto :HINSTANCE, :LPSTR LoadCursorA proto :HINSTANCE, :LPSTR LoadIconA proto :HINSTANCE, :LPSTR PostQuitMessage proto :SDWORD RegisterClassExA proto :ptr WNDCLASSEXA ShowWindow proto :HWND, :SDWORD TranslateMessage proto :ptr MSG UpdateWindow proto :HWND option DLLIMPORT:<gdi32.dll> BitBlt proto :HDC, :DWORD, :DWORD, :DWORD, :DWORD, :HDC, :DWORD, :DWORD, :DWORD CreateCompatibleDC proto :HDC DeleteDC proto :HDC GetDIBits proto :HDC, :HBITMAP, :DWORD, :DWORD, :ptr, :ptr BITMAPINFO, :DWORD SelectObject proto :HDC, :HGDIOBJ option dllimport:none WinMain proto :HINSTANCE, :HINSTANCE, :LPSTR, :UINT .data ClassName db "SimpleWinClass",0 AppName db "Bitmap rendering",0 .data? hInstance HINSTANCE ? hBitmap HBITMAP ? CommandLine LPSTR ? .code WinMainCRTStartup proc FRAME invoke GetModuleHandleA, NULL mov hInstance, rax invoke GetCommandLineA mov CommandLine, rax invoke WinMain, hInstance, NULL, CommandLine, SW_SHOWDEFAULT invoke ExitProcess, eax WinMainCRTStartup endp WinMain proc FRAME hInst:HINSTANCE, hPrevInst:HINSTANCE, CmdLine:LPSTR, CmdShow:UINT LOCAL wc:WNDCLASSEXA LOCAL msg:MSG LOCAL hwnd:HWND invoke LoadBitmapA, hInst, IDR_BITMAP1 mov hBitmap, rax mov wc.cbSize, SIZEOF WNDCLASSEXA mov wc.style, CS_HREDRAW or CS_VREDRAW lea rax, [WndProc] mov wc.lpfnWndProc, rax mov wc.cbClsExtra, 0 mov wc.cbWndExtra, 0 mov rcx, hInst mov wc.hInstance, rcx mov wc.hbrBackground, COLOR_WINDOW+1 mov wc.lpszMenuName, IDR_MENU1 lea rax, [ClassName] mov wc.lpszClassName, rax invoke LoadIconA, NULL, IDI_APPLICATION mov wc.hIcon, rax mov wc.hIconSm, rax invoke LoadCursorA, NULL, IDC_ARROW mov wc.hCursor,rax invoke RegisterClassExA, addr wc invoke CreateWindowExA, NULL, ADDR ClassName, ADDR AppName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT, NULL, NULL, hInst, NULL mov hwnd,rax invoke ShowWindow, hwnd, SW_SHOWNORMAL invoke UpdateWindow, hwnd .while (1) invoke GetMessageA, ADDR msg, NULL, 0, 0 .break .if (!eax) invoke TranslateMessage, ADDR msg invoke DispatchMessageA, ADDR msg .endw mov rax, msg.wParam ret WinMain endp WndProc proc FRAME hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM local hdc2:HDC local ps:PAINTSTRUCT local rect:RECT local bmi:BITMAPINFOHEADER .if edx == WM_DESTROY invoke PostQuitMessage, NULL xor rax,rax .elseif edx == WM_COMMAND .if wParam == IDM_EXIT invoke DestroyWindow, hWnd .endif xor eax, eax .elseif edx == WM_PAINT invoke BeginPaint, hWnd, addr ps invoke CreateCompatibleDC, ps.hdc mov hdc2, rax invoke SelectObject, hdc2, hBitmap mov bmi.biSize, sizeof BITMAPINFOHEADER mov bmi.biBitCount, 0 invoke GetDIBits, hdc2, hBitmap, 0, 0, 0, addr bmi, DIB_RGB_COLORS invoke GetClientRect, hWnd, addr rect mov r8d, rect.right sub r8d, bmi.biWidth jnc @F xor r8d, r8d @@: shr r8d, 1 mov r9d, rect.bottom sub r9d, bmi.biHeight jnc @F xor r9d, r9d @@: shr r9d, 1 invoke BitBlt, ps.hdc, r8d, r9d, bmi.biWidth, bmi.biHeight, hdc2, 0, 0, SRCCOPY invoke DeleteDC, hdc2 invoke EndPaint, hWnd, addr ps xor eax,eax .else invoke DefWindowProcA, rcx, edx, r8, r9 .endif ret WndProc endp if 1 ;for -pe RT_BITMAP EQU 2 RT_MENU EQU 4 ;--- menu resource flags MF_POPUP EQU 10h MF_END EQU 80h IMAGE_RESOURCE_DIRECTORY struct Characteristics DWORD ? TimeDateStamp DWORD ? MajorVersion WORD ? MinorVersion WORD ? NumberOfNamedEntries WORD ? NumberOfIdEntries WORD ? IMAGE_RESOURCE_DIRECTORY ends IMAGE_RESOURCE_DIRECTORY_ENTRY struct union r0 RECORD NameIsString:1, NameOffset:31 Name_ DWORD ? Id WORD ? ends union OffsetToData DWORD ? r1 RECORD DataIsDirectory:1, OffsetToDirectory:31 ends IMAGE_RESOURCE_DIRECTORY_ENTRY ends IMAGE_RESOURCE_DATA_ENTRY struct OffsetToData DWORD ? Size_ DWORD ? CodePage DWORD ? Reserved DWORD ? IMAGE_RESOURCE_DATA_ENTRY ends option dotname .rsrc segment dword read FLAT public 'RSRC' ;--- define menu IDR_MENU1 and bitmap IDR_BITMAP1 ;--- root level: enum the resource types IMAGE_RESOURCE_DIRECTORY <0,0,0,0,0,2> IMAGE_RESOURCE_DIRECTORY_ENTRY < <RT_BITMAP>, <SECTIONREL bms + 80000000h> > IMAGE_RESOURCE_DIRECTORY_ENTRY < <RT_MENU>, <SECTIONREL menus + 80000000h> > ;--- second level: enum the IDs of resource type X bms IMAGE_RESOURCE_DIRECTORY <0,0,0,0,0,1> IMAGE_RESOURCE_DIRECTORY_ENTRY < <IDR_BITMAP1>, <SECTIONREL bm1 + 80000000h> > menus IMAGE_RESOURCE_DIRECTORY <0,0,0,0,0,1> IMAGE_RESOURCE_DIRECTORY_ENTRY < <IDR_MENU1>, <SECTIONREL menu1 + 80000000h> > ;--- third level: enum the languages of ID X bm1 IMAGE_RESOURCE_DIRECTORY <0,0,0,0,0,1> IMAGE_RESOURCE_DIRECTORY_ENTRY < <409h>, <SECTIONREL bm1_l1> > menu1 IMAGE_RESOURCE_DIRECTORY <0,0,0,0,0,1> IMAGE_RESOURCE_DIRECTORY_ENTRY < <409h>, <SECTIONREL m1_l1> > ;--- last level: define the resource data ;--- data for menu IDR_MENU1, language 409h m1_l1 IMAGE_RESOURCE_DATA_ENTRY <IMAGEREL m1_l1_data, size_m1_l1, 0, 0> m1_l1_data dw 0,0 ;menu header dw MF_POPUP or MF_END, '&','F','i','l','e',0 dw MF_END, IDM_EXIT, 'E','&','x','i','t',0 size_m1_l1 equ $ - m1_l1_data align 4 ;--- data for bitmap IDR_BITMAP1 bm1_l1 IMAGE_RESOURCE_DATA_ENTRY <IMAGEREL bm1_l1_data, size_bm1_l1, 0, 0> bm1_l1_data label word incbin <Win32_8.bmp>,14 ;skip bitmap file header size_bm1_l1 equ $ - ( bm1_l1_data ) .rsrc ends ;--- set /subsystem:windows ;--- the PE header is stored in section .hdr$2 option dotname .hdr$2 segment DWORD FLAT public 'HDR' org 5Ch ;position to IMAGE_NT_HEADER64.OptionalHeader.Subsystem dw 2 ;2=subsystem windows .hdr$2 ends endif end WinMainCRTStartup
25.946779
125
0.682068