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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3b1ceb89a888699cd034b51e5bf930496eab54aa | 1,308 | asm | Assembly | programs/oeis/008/A008723.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/008/A008723.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/008/A008723.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A008723: Molien series for 3-dimensional group [2,11] = *2 2 11.
; 1,0,2,0,3,0,4,0,5,0,6,1,7,2,8,3,9,4,10,5,11,6,13,7,15,8,17,9,19,10,21,11,23,13,25,15,27,17,29,19,31,21,33,23,36,25,39,27,42,29,45,31,48,33,51,36,54,39,57,42,60,45,63,48,66,51,70,54,74,57,78,60,82,63,86,66,90,70,94,74,98,78,102,82,106,86,110,90,115,94,120,98,125,102,130,106,135,110,140,115,145,120,150,125,155,130,160,135,165,140,171,145,177,150,183,155,189,160,195,165,201,171,207,177,213,183,219,189,225,195,231,201,238,207,245,213,252,219,259,225,266,231,273,238,280,245,287,252,294,259,301,266,308,273,316,280,324,287,332,294,340,301,348,308,356,316,364,324,372,332,380,340,388,348,396,356,405,364,414,372,423,380,432,388,441,396,450,405,459,414,468,423,477,432,486,441,495,450,505,459,515,468,525,477,535,486,545,495,555,505,565,515,575,525,585,535,595,545,605,555,616,565,627,575,638,585,649,595,660,605,671,616,682,627,693,638,704,649,715,660,726,671,738,682,750,693,762,704,774,715
mov $5,$0
mov $7,2
lpb $7
clr $0,5
mov $0,$5
sub $7,1
add $0,$7
sub $0,1
add $2,17
lpb $0
mov $1,$0
sub $0,1
cal $1,25766 ; Expansion of 1/((1-x)(1-x^2)(1-x^11)).
sub $0,1
add $2,$1
lpe
mov $1,$2
sub $1,16
mov $8,$7
lpb $8
mov $6,$1
sub $8,1
lpe
lpe
lpb $5
mov $5,0
sub $6,$1
lpe
mov $1,$6
| 39.636364 | 891 | 0.646789 |
3879a01fa28a234a43339c47c810280f376f1dc5 | 357 | asm | Assembly | programs/oeis/094/A094025.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/094/A094025.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/094/A094025.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A094025: Expansion of (1+3x)/((1-x^2)(1-3x^2)).
; 1,3,4,12,13,39,40,120,121,363,364,1092,1093,3279,3280,9840,9841,29523,29524,88572,88573,265719,265720,797160,797161,2391483,2391484,7174452,7174453,21523359,21523360,64570080,64570081,193710243,193710244
mov $1,$0
lpb $0
trn $0,2
add $2,1
add $1,$2
mov $2,$1
sub $1,$0
add $2,$1
lpe
add $1,1
| 25.5 | 205 | 0.683473 |
3e3ff34960c71678c18ead283dde2543df266036 | 650 | asm | Assembly | programs/oeis/036/A036498.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/036/A036498.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/036/A036498.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A036498: Numbers of the form m*(6*m-1) and m*(6*m+1), where m is an integer.
; 0,5,7,22,26,51,57,92,100,145,155,210,222,287,301,376,392,477,495,590,610,715,737,852,876,1001,1027,1162,1190,1335,1365,1520,1552,1717,1751,1926,1962,2147,2185,2380,2420,2625,2667,2882,2926,3151,3197,3432,3480,3725,3775,4030,4082,4347,4401,4676,4732,5017,5075,5370,5430,5735,5797,6112,6176,6501,6567,6902,6970,7315,7385,7740,7812,8177,8251,8626,8702,9087,9165,9560,9640,10045,10127,10542,10626,11051,11137,11572,11660,12105,12195,12650,12742,13207,13301,13776,13872,14357,14455,14950
mul $0,2
mov $2,$0
lpb $2
add $1,$0
add $0,4
add $1,3
trn $2,4
lpe
mov $0,$1
| 50 | 484 | 0.732308 |
7678944598ade2f3a583806a6d98735c563b4757 | 223 | asm | Assembly | libsrc/stdio/ansi/nascom/f_ansi_attr.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/stdio/ansi/nascom/f_ansi_attr.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | libsrc/stdio/ansi/nascom/f_ansi_attr.asm | meesokim/z88dk | 5763c7778f19a71d936b3200374059d267066bb2 | [
"ClArtistic"
] | null | null | null | ;
; ANSI Video handling for the NASCOM1/2
; By Stefano Bodrato
;
; Text Attributes
; m - Set Graphic Rendition
;
; $Id: f_ansi_attr.asm,v 1.3 2015/01/19 01:33:18 pauloscustodio Exp $
;
PUBLIC ansi_attr
.ansi_attr
ret | 15.928571 | 69 | 0.70852 |
879c2e7bff2cb9b8f01618c2a3bca2c64b4f0ab9 | 41,686 | asm | Assembly | Library/Spool/Process/processApp.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 504 | 2018-11-18T03:35:53.000Z | 2022-03-29T01:02:51.000Z | Library/Spool/Process/processApp.asm | steakknife/pcgeos | 95edd7fad36df400aba9bab1d56e154fc126044a | [
"Apache-2.0"
] | 96 | 2018-11-19T21:06:50.000Z | 2022-03-06T10:26:48.000Z | Library/Spool/Process/processApp.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: System Spooler
FILE: processApp.asm
AUTHOR: Jim DeFrisco, 3 April 1990
ROUTINES:
Name Description
---- -----------
MTD MSG_GEN_PROCESS_CLOSE_APPLICATION
Finish our life as an application.
MTD MSG_SPOOL_KILL_FIRST_JOB
Kills the first job.
MTD MSG_SPOOL_PAUSE_FIRST_JOB
Pauses the first job.
INT KillPrinting All the threads will die of natural causes,
if we give them a little help. So we tell
each queue's current job to abort. and
remove the linkage to any subsequent jobs.
INT SaveQueueState Write out the queue to a state file in case
we die. Kind of like a last will....
MTD MSG_SPOOL_JOB_REMOVED Method received when a job exits
MTD MSG_SPOOL_JOB_ADDED Method received when a job is added to a
queue
INT CreateThreadStart Start the process of creating a thread for
a print queue
INT CreateThreadEnd Complete the process of creating a thread
for a print queue
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 3/13/90 Initial revision
DESCRIPTION:
This file contains the code to implement the application part of
the spooler
$Id: processApp.asm,v 1.1 97/04/07 11:11:28 newdeal Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolInit segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolOpenApplication
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Open the Spooler as an application
CALLED BY: UI (MSG_GEN_PROCESS_OPEN_APPLICATION)
PASS: AX = Meothd
CX = AppAttachFlags
DX = Handle to AppLaunchBlock
BP = Block handle
DS, ES = CoreBlock (DGroup)
RETURN: Nothing
DESTROYED: DI
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 10/25/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
spoolUICatString char "spool", 0
spoolUIKeyString char "uiOptions", 0
SpoolOpenApplication method SpoolProcClass, MSG_GEN_PROCESS_OPEN_APPLICATION
.enter
; Add the app object to the GCNSLT_SHUTDOWN_CONTROL system notification
; list so we can object if the user tries to shut down or suspend while
; we're printing.
push ax, cx, dx, bp
mov cx, handle spoolAppObj
mov dx, offset spoolAppObj
mov bx, MANUFACTURER_ID_GEOWORKS
mov ax, GCNSLT_SHUTDOWN_CONTROL
call GCNListAdd
pop ax, cx, dx, bp
; Allocate the error dialog ThreadLock.
;
push bx
call ThreadAllocThreadLock
mov ds:[errorThreadLock], bx
pop bx
; Restart any printing after we deal with this method
;
mov di, offset SpoolProcClass ; superclass => ES:DI
call ObjCallSuperNoLock ; method already in AX
; Re-start printing
;
call SpoolBirth ; restart printing, please
; See if we are operating in simple mode
;
mov ax, DEFAULT_SPOOL_UI_OPTIONS
segmov ds, cs, cx
mov si, offset spoolUICatString
mov dx, offset spoolUIKeyString
call InitFileReadInteger
mov es:[uiOptions], ax ; store SpoolUIOptions
; Generate MESN_MEDIUM_AVAILABLE messages for all printers, plus
; MESN_MEDIUM_CONNECTED messages for any that are marked as permanently
; connected...?
call SpoolGenerateMediumNotifies
.leave
ret
SpoolOpenApplication endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolGenerateMediumNotifies
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Enumerate all the printers in the printer::printers key
and generate an MESN_MEDIUM_AVAILABLE notification for
each one.
CALLED BY: (INTERNAL) SpoolOpenApplication
PASS: nothing
RETURN: nothing
DESTROYED: nothing
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/22/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
printerCatStr char 'printer', 0
printersKeyStr char 'printers', 0
SpoolGenerateMediumNotifies proc near
uses ax, bx, cx, dx, si, di, ds, es, bp
.enter
segmov ds, cs, cx
mov si, offset printerCatStr
mov dx, offset printersKeyStr
mov bp, (IFCC_INTACT shl offset IFRF_CHAR_CONVERT) or \
mask IFRF_READ_ALL
mov di, cs
mov ax, offset SpoolGenerateMediumNotifiesCallback
call InitFileEnumStringSection
.leave
ret
SpoolGenerateMediumNotifies endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolPrinterNameToMedium
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Convert a printer name into arguments suitable for sending
out medium notification or for checking to see if the medium
is available or connected.
CALLED BY: (GLOBAL)
PASS: ds:si = null-terminated printer name
RETURN: carry set if couldn't allocate memory
carry clear if ok:
al = MUT_MEM_BLOCK
bx = handle of medium unit block holding
name
cxdx = MANUFACTURER_ID_GEOWORKS/GMID_PRINTER
DESTROYED: nothing
SIDE EFFECTS: none
PSEUDO CODE/STRATEGY:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 11/ 3/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolPrinterNameToMedium proc far
uses es, di, si
.enter
;
; Find the size of the name.
;
movdw esdi, dssi
LocalStrSize includeNull
;
; Allocate room for the name, being sure to request the block be
; fully zero-initialized, so any extra cruft given us by the heap
; is consistently 0.
;
push cx
SBCS < Assert le, cx, MAXIMUM_PRINTER_NAME_LENGTH >
DBCS < Assert le, cx, MAXIMUM_PRINTER_NAME_LENGTH*2 >
mov ax, MAXIMUM_PRINTER_NAME_LENGTH*(size TCHAR)
mov cx, ALLOC_DYNAMIC_LOCK or (mask HAF_ZERO_INIT shl 8)
call MemAlloc
pop cx
jc done
;
; Copy the bytes of the name (and only those bytes) into the block,
; which we then unlock.
;
mov es, ax
clr di
rep movsb
call MemUnlock
mov cx, MANUFACTURER_ID_GEOWORKS
mov dx, GMID_PRINTER
mov al, MUT_MEM_BLOCK
done:
.leave
ret
SpoolPrinterNameToMedium endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolGenerateMediumNotifiesCallback
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Generate notification of the existence of a single printer.
CALLED BY: (INTERNAL) SpoolGenerateMediumNotifies via
InitFileEnumStringSection
PASS: ds:si = null-terminated string section
dx = section #
cx = length of section
RETURN: carry set to stop enumeration
DESTROYED: ax, cx, dx, di, si, bp, bx, es all allowed
SIDE EFFECTS:
PSEUDO CODE/STRATEGY:
Copy the name into a block o' memory
Generate the notification
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 9/22/94 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolGenerateMediumNotifiesCallback proc far
.enter
;
; Create the unit block.
;
call SpoolPrinterNameToMedium
;
; Now generate the notification of the medium being available, being
; careful to set SNT_BX_MEM in DI so the system knows to free the thing
; if the mailbox library doesn't actually load.
;
mov si, SST_MEDIUM
mov di, MESN_MEDIUM_AVAILABLE or mask SNT_BX_MEM
call SysSendNotification
;
; Keep going through the printers, please.
;
clc
.leave
ret
SpoolGenerateMediumNotifiesCallback endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolUICreateNewStateFile
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Prevent attaching to/creating any state file
CALLED BY: MSG_GEN_PROCESS_CREATE_NEW_STATE_FILE
PASS: ds = es = dgroup
ax = MSG_GEN_PROCESS_CREATE_NEW_STATE_FILE
cx = AppAttachMode
dx = Block handle of AppInstanceReference
RETURN: ax = handle of extra block of state data (=== 0)
DESTROYED: oh, you know. The usual.
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 4/ 5/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolUICreateNewStateFile method SpoolProcClass,
MSG_GEN_PROCESS_CREATE_NEW_STATE_FILE
clr ax
ret
SpoolUICreateNewStateFile endp
SpoolInit ends
SpoolExit segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolQuit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_META_QUIT for spooler app
CALLED BY: GLOBAL
PASS: ax - method number
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Check to see if we have any running threads. If not, just
exit, else kill everything -- but quietly.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolQuit method SpoolProcClass, MSG_META_QUIT
uses ax, bx, ds, di
.enter
; we just want to ignore all quits (this will happen if the
; user presses F3 while the PrintControlPanel is up). So
; send back a message that we're aborting the quit.
call GeodeGetProcessHandle
mov cx, -1 ;Want to abort the quit
mov ax, MSG_META_QUIT_ACK ;
mov di, mask MF_FORCE_QUEUE ;Send ack.
call ObjMessage ;
.leave
ret
SpoolQuit endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolCloseApplication
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Finish our life as an application.
CALLED BY: MSG_GEN_PROCESS_CLOSE_APPLICATION
PASS: ds = es = dgroup
RETURN: cx = handle of extra state block to save (0)
DESTROYED: ax, dx, bp
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
ardeb 5/ 5/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolCloseApplication method dynamic SpoolProcClass,
MSG_GEN_PROCESS_CLOSE_APPLICATION
uses bx
.enter
; Remove the app object from the GCNSLT_SHUTDOWN_CONTROL system
; notification list
mov cx, handle spoolAppObj
mov dx, offset spoolAppObj
mov bx, MANUFACTURER_ID_GEOWORKS
mov ax, GCNSLT_SHUTDOWN_CONTROL
call GCNListRemove
; Free the error dialog ThreadLock.
;
mov bx, ds:[errorThreadLock]
call ThreadFreeThreadLock
clr cx ; no state block to save
.leave
ret
SpoolCloseApplication endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolApplicationDetachConfirm
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: The system is about to detach. Determine if there are any
spool jobs that are printing, and if so, give the user
a choice to abort the detach.
CALLED BY: MSG_META_CONFIRM_SHUTDOWN
PASS: *DS:SI = SpoolApplicationClass object
ES = DGroup
bp = GCNShutdownControlType
RETURN: Nothing
DESTROYED: TBD
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 11/8/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolApplicationDetachConfirm method SpoolApplicationClass,
MSG_META_CONFIRM_SHUTDOWN
;
; Do nothing if told the system is unsuspending itself.
;
cmp bp, GCNSCT_UNSUSPEND
je exit
;
; Gain the exclusive right to ask the user to confirm.
;
mov ax, SST_CONFIRM_START
call SysShutdown
jc done ; => already denied, so we
; do nothing.
; See if there are any jobs left to be printed
;
ornf es:[spoolStateFlags], mask SS_DETACH_DIALOG
call SpoolQueueCheckJobsWantingWarning
jnc done ; => none, so do nothing
; Else put up dialog box querying the user
;
mov bx, handle ErrorBoxesUI
call MemLock
mov es, ax
mov di, offset ShutDownText
cmp bp, GCNSCT_SHUTDOWN
je haveText
mov di, offset SuspendText
haveText:
mov di, es:[di] ; text string => ES:DI
; Now prepare the arguments for the dialog box
;
mov dx, size GenAppDoDialogParams
sub sp, dx
mov bp, sp ; SS:BP holds the structure
mov ss:[bp].SDP_customFlags,
CustomDialogBoxFlags <1, CDT_QUESTION, GIT_AFFIRMATION,0>
mov ss:[bp].SDP_customString.high, es
mov ss:[bp].SDP_customString.low, di
;ss:[bp].SDP_customTriggers not needed for GIT_AFFIRMATION
mov bx, ds:[LMBH_handle] ; block handle => BX
mov ss:[bp].GADDP_finishOD.handle, bx
mov ss:[bp].GADDP_finishOD.chunk, si
mov ss:[bp].GADDP_message, MSG_SPOOL_APP_DETACH_CHOICE
clr ss:[bp].GADDP_dialog.SDP_helpContext.segment
mov ax, MSG_GEN_APPLICATION_DO_STANDARD_DIALOG
mov di, mask MF_STACK or mask MF_CALL or mask MF_FIXUP_DS
call ObjMessage ; put up the dialog box
mov es:[spoolConfirmBox].handle, cx
mov es:[spoolConfirmBox].chunk, dx
; Clean up (stack and unlock the strings resource)
;
add sp, size GenAppDoDialogParams
mov bx, handle ErrorBoxesUI
call MemUnlock
exit:
ret ; we're done - DON'T fall thru
done:
mov cx, IC_NULL ; just exit now
FALL_THRU SpoolApplicationDetachChoice
SpoolApplicationDetachConfirm endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolApplicationDetachChoice
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: The user (or an outside caller) has responded with the choice
to either shutdown, or to cancel the shutdown. We will
clean up before abiding by his/her wishes.
CALLED BY: GLOBAL (MSG_SPOOL_APP_DETACH_CHOICE)
PASS: DS:*SI = SpoolApplicationClass object
ES = DGroup
CX = InteractionCommand
IC_NO - abort the shutdown
anything else - shutdown
RETURN: Nothing
DESTROYED: AX, CX, DX, DI, BP
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 11/8/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolApplicationDetachChoice method SpoolApplicationClass, \
MSG_SPOOL_APP_DETACH_CHOICE
.enter
; If user cancels, abort the shutdown
;
test es:[spoolStateFlags], mask SS_DETACH_DIALOG
jz done ; if flag cleared, do nothing
mov ax, FALSE ; assume no shutdown
cmp cx, IC_NO ; cancel the shutdown
je callField ; cancel - so go do it!
mov ax, TRUE ; yes - we're shutting down
; Call SysShutdown telling it our decision
;
callField:
and es:[spoolStateFlags], not (mask SS_DETACH_DIALOG)
mov_tr cx, ax ; TRUE/FALSE
mov ax, SST_CONFIRM_END
call SysShutdown
done:
.leave
ret
SpoolApplicationDetachChoice endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolDetach
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: MSG_META_DETACH for spooler app
CALLED BY: GLOBAL
PASS: ax - method number
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Check to see if we have any running threads. If not, just
exit, else kill everything -- but quietly.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolDetach method SpoolProcClass, MSG_META_DETACH
.enter
; lock the Queue to see if anything there
PSem ds, queueSemaphore ; exclusive access
mov ds:[spoolAckOD].handle, 0; init OD to zero
mov ds:[spoolAckOD].chunk, 0
ornf ds:[spoolStateFlags], mask SS_DETACHING ; set a flag
; see if there are still threads printing
tst ds:[queueHandle] ; anything printing ?
jnz killPrintThreads ; yes, kill them
; nothing printing. just pass along the DETACH
VSem ds, queueSemaphore
.leave
mov di, offset SpoolProcClass
GOTO ObjCallSuperNoLock
killPrintThreads:
; kill all the threads.
; must wait until all the threads are gone before we pass
; this message on to our superclass.
mov ds:[spoolAckOD].handle, dx ; Save Ack OD
mov ds:[spoolAckOD].chunk, bp
mov ds:[spoolAckID], cx ; save ID as well
call KillPrinting ; kill it baby
VSem ds, queueSemaphore, TRASH_AX_BX
.leave
ret
SpoolDetach endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KillPrinting
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: All the threads will die of natural causes, if we give them
a little help. So we tell each queue's current job to abort.
and remove the linkage to any subsequent jobs.
CALLED BY: MSG_META_DETACH (see above)
PASS: ds - dgroup
have queueSemaphore
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
lock the queue;
for each printer queue
tell the first job to abort
set the first job's next ptr null
free the queue;
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/90 Initial version
Don 10/90 Clean up detach preparation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
KillPrinting proc near
uses ax, bx, di, si, ds
.enter
; lock down the queue and kill all the threads
mov bx, ds:[queueHandle] ; lock the queue
call MemLock ; ax = segment
mov ds, ax ; ds -> queue
call SaveQueueState ; write the file to disk
; loop through each queue
;
mov si, ds:[PQ_firstQueue] ; chunk handle of 1st queue
queueLoop:
mov si, ds:[si] ; get pointer to QueueInfo
mov ds:[si].QI_error, SI_DETACH ; set abort signal
mov si, ds:[si].QI_next ; get handle of next one
tst si ; all done ?
jnz queueLoop ; no, continue
; Clean up
;
call MemUnlock ; release the queue
.leave
ret
KillPrinting endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SaveQueueState
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Write out the queue to a state file in case we die.
Kind of like a last will....
CALLED BY: KillPrinting
PASS: ds - pointer to Queue block
Queue semaphore down
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
just write out the current state of things;
The "official" state file for the spooler is spoolsta.dat
and it is kept in the spool directory. When the system
boots, it looks for this file and will start things going
if it finds it.
To ensure that we always have something, this routine
goes throught the following steps:
* rename the current spoolsta.dat to spoolsta.bak
* write out the current state block to spoolsta.dat
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 03/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SaveQueueState proc near
uses ds, es, di, si, ax, bx, cx, dx
.enter
; save the current directory and get to the spool directory
push ds ; save pointer to block
mov ax, SP_SPOOL ; just use standard call
call FileSetStandardPath
; delete the old one
mov dx, dgroup ; filenames in idata
mov ds, dx
mov es, dx ; we'll need it here later
mov dx, offset dgroup:stateFile
call FileDelete
; now create a new one
mov ah, FILE_CREATE_TRUNCATE
mov al, FILE_DENY_W or FILE_ACCESS_W
mov cx, FILE_ATTR_NORMAL
call FileCreate ; create the file
; calc how much to write
pop ds ; restore ptr to blk
push ax ; save file handle
mov bx, ds:[PQ_header].LMBH_handle ; fetch handle
mov ax, MGIT_SIZE
call MemGetInfo ; return info
; write out the contents of the current buffer. We set
; LMBH_handle to the current nextJobID so we don't confuse
; the issue when restarting.
mov_tr cx, ax ; all we want is size
mov_tr ax, bx ; ax <- block handle
pop bx ; restore file handle
push ax
mov ax, es:[nextJobID]
mov ds:[LMBH_handle], ax
mov al, FILE_NO_ERRORS ; set some flags
clr dx ; ds:dx -> buffer
call FileWrite
call FileClose ; all done
pop ds:[LMBH_handle] ; restore block handle
.leave
ret
SaveQueueState endp
SpoolExit ends
QueueManagement segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolThreadExit
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Printing thread exiting notification
CALLED BY: MSG_PROCESS_NOTIFY_THREAD_EXIT
PASS: cx - thread ID of exiting thread
dx - exit code
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
printing thread has exited, check to see if we should boogie
try to lock the queue. if we can, then we don't exit, else
check to see if the spoolAckOD is zero. If not, then send
a MSG_META_DETACH to it.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 07/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolThreadExit method SpoolProcClass,
MSG_PROCESS_NOTIFY_THREAD_EXIT
call LockQueue ; lock it down
jc noJobsLeft ; bad PrintQueue - means no jobs left
; OK, there is a printQueue. This means that either there are
; other threads printing, or the thread we're being notified
; about has been killed by something else (like an out of
; memory error that the user has signaled "abort"). To make
; sure that the thread that is leaving has exited properly,
; we need to go through all the queues, and search for a
; match for the thread ID. If we find a match, then we need
; to remove all the jobs from that queue, remove the queue,
; and check again for more printing threads.
mov es, ax ; es -> printQueue
mov di, es:[PQ_firstQueue] ; handle of first queue
qLoop:
mov si, es:[di] ; dereference the queue
cmp es:[si].QI_thread, cx ; is this our beautiful thread?
je murderMurder ; we were killed.
mov di, es:[si].QI_next ; follow down the next thread
tst di ; any more to check ?
jnz qLoop ; yes, keep checking
done:
call UnlockQueue ; still going, just continue
ret
; bad queue handle, time to quit. Check for non-zero spoolAckOD
noJobsLeft:
test es:[spoolStateFlags], mask SS_DETACH_DIALOG
jz finishNoJobs
;
; Pretend the user clicked Yes so we confirm with the system the
; shutdown/suspend is ok by us.
;
mov bx, es:[spoolConfirmBox].handle
mov si, es:[spoolConfirmBox].chunk
mov cx, IC_YES
mov ax, MSG_GEN_INTERACTION_ACTIVATE_COMMAND
clr di
call ObjMessage
jmp done
finishNoJobs:
;
; If MSG_META_DETACH was received, pass it on to our superclass
; (finally).
;
test es:[spoolStateFlags], mask SS_DETACHING
jz done
clr dx, bp
xchg ds:[spoolAckOD].handle, dx
xchg ds:[spoolAckOD].chunk, bp ; ACK OD => DX:BP
mov cx, ds:[spoolAckID] ; set up ID as well
mov di, offset SpoolProcClass
mov ax, MSG_META_DETACH ; set up method to send
CallSuper MSG_META_DETACH
jmp done
; OK, the thread was knocked off by something else (memory
; full error ?). We need to remove the cancer from the
; PrintQueue and get outta here. If this was the only job
; left, then just biff the block and continue with the detach.
; We also need to biff the use of the printer driver and port
; driver, so that they get freed.
murderMurder:
mov bx, es:[si].QI_portHan ; remove the port driver
tst bx ; don't remove unfit drivers
jz tryPrinterDriver
call GeodeFreeDriver
tryPrinterDriver:
mov bx, es:[si].QI_pdHan ; remove the printer driver
tst bx
jz howManyQueues
call GeodeFreeDriver
howManyQueues:
cmp es:[PQ_numQueues], 1 ; is ours the only one ?
jne elimOneQueue ; yes, kill the SOB
; this is the only queue. so biff the block and leave.
mov bx, es:[LMBH_handle] ; get handle of this block
call MemFree ; be gone with it
clr ds:[queueHandle] ; no queue left
jmp noJobsLeft ; and be gone
; There are other print queues to be considered. Just get
; rid of our queue and all the jobs in it. Currently, we
; have ds:si -> our queue, di = lmem handle to our queue
elimOneQueue:
cmp di, es:[PQ_firstQueue] ; were we the first ?
jne followQueues ; no, keep going
mov di, es:[si].QI_next ; get the next handle
mov es:[PQ_firstQueue], di ; and save it as head
jmp weAreHistory ; unlock the queue and wait more
followQueues:
mov bx, es:[PQ_firstQueue] ; load up the first queue
sonOfQLoop:
mov bx, es:[bx] ; get pointer to next queue
EC < tst bx ; we are hosed if this is 0 >
EC < ERROR_Z SPOOL_PRINT_Q_IS_MESSED_UP ; whoa.
cmp es:[bx].QI_next, di ; found it yet ?
je foundUs ; yes
mov bx, es:[bx].QI_next ; no, keep looking
jmp sonOfQLoop
; we found ourselves. relink.
foundUs:
mov di, es:[si].QI_next ; stuff our next pointer
mov es:[bx].QI_next, di ; into prev's next field
weAreHistory:
dec es:[PQ_numQueues] ; done with one more...
jmp done
SpoolThreadExit endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolCommError
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: There's a problem with a parallel port....
CALLED BY: MSG_SPOOL_COMM_ERROR
PASS: cx - print queue handle for affected queue
dx - error type
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Set the error flag in the print queue, so the printing thread
can find it next time it looks.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 05/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolCommError method SpoolProcClass, MSG_SPOOL_COMM_ERROR
uses ax,bx,si
.enter
; lock the print queue and set the error flag. The thread
; will query the comm driver to figure out what the error
; was.
call LockQueue ; ax -> queue block
mov ds, ax ; ds -> queue block
; before we go tromping on some other block, make sure the
; queue we're after still exists. Just follow the chain of
; queues until we find one that matches. It will probably
; be the first one, since there won't be but one queue most
; of the time.
mov si, ds:[PQ_firstQueue] ; get first queue hand
qSearchLoop:
cmp si, cx ; if we have a match
je foundQueue
tst si ; if NULL, we're sunk
jz done
mov si, ds:[si] ; follow queue chain
jmp qSearchLoop
; found one we like. Set the error flag.
foundQueue:
CallMod CommPortErrorHandler ; *ds:si -> queue
jnc done ; no error
mov si, ds:[si] ; deref queue han
mov ds:[si].QI_error, SI_ABORT ; set abort flag
done:
call UnlockQueue ; release the queue
.leave
ret
SpoolCommError endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolCommInput
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: There's data coming in ! Ignore it !
CALLED BY: MSG_SPOOL_COMM_INPUT
PASS: cx - print queue handle for affected queue
dx - error type
RETURN: nothing
DESTROYED: nothing
PSEUDO CODE/STRATEGY:
Set the error flag in the print queue, so the printing thread
can find it next time it looks.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 06/93 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolCommInput method SpoolProcClass, MSG_SPOOL_COMM_INPUT
uses ax,bx,si
.enter
; lock the print queue and set the error flag. The thread
; will query the comm driver to figure out what the error
; was.
call LockQueue ; ax -> queue block
mov ds, ax ; ds -> queue block
; before we go tromping on some other block, make sure the
; queue we're after still exists. Just follow the chain of
; queues until we find one that matches. It will probably
; be the first one, since there won't be but one queue most
; of the time.
mov si, ds:[PQ_firstQueue] ; get first queue hand
qSearchLoop:
cmp si, cx ; if we have a match
je foundQueue
tst si ; if NULL, we're sunk
jz done
mov si, ds:[si] ; follow queue chain
jmp qSearchLoop
; found one we like. Read the data and quit.
foundQueue:
CallMod CommPortInputHandler ; *ds:si -> queue
jnc done ; no error
mov si, ds:[si] ; deref queue han
mov ds:[si].QI_error, SI_ABORT ; set abort flag
done:
call UnlockQueue ; release the queue
.leave
ret
SpoolCommInput endm
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolJobRemoved
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Method received when a job exits
PASS: cx - job id
dx - PrinterPortType
bp - ParallelPortNum or SerialPortNum
RETURN: nothing
DESTROYED: ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 10/15/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if _CONTROL_PANEL
SpoolJobRemoved method dynamic SpoolProcClass, MSG_SPOOL_JOB_REMOVED
.enter
mov_tr ax, dx
mov bx, bp
call SpoolPanelJobRemoved
.leave
ret
SpoolJobRemoved endp
endif
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolJobAdded
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Method received when a job is added to a queue
PASS: cx - job id
dx - PrinterPortType
bp - ParallelPortNum or SerialPortNum
RETURN: nothing
DESTROYED: ax,cx,dx,bp
PSEUDO CODE/STRATEGY:
none
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
srs 10/15/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
if _CONTROL_PANEL
SpoolJobAdded method dynamic SpoolProcClass, MSG_SPOOL_JOB_ADDED
.enter
mov_tr ax, dx
mov bx, bp
call SpoolPanelJobAdded
.leave
ret
SpoolJobAdded endp
endif
QueueManagement ends
;-------------------------------------------------------------------------
;
; START OF IDATA (FIXED) SEGMENT
;
;-------------------------------------------------------------------------
idata segment
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SpoolCreateThread
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Create a printing thread
CALLED BY: SpoolAddJob (via method call)
PASS: cx - chunk handle of Job to create thread for
RETURN: nothing
DESTROYED: doesn't matter
PSEUDO CODE/STRATEGY:
Allocate a device queue and create a print thread
To minimize the amount of code in fixed space,
most of the code implementing this function has been
moved into a non-fixed resource. This may add a few
cross-module calls, but it reduces the spooler's dgroup.
KNOWN BUGS/SIDE EFFECTS/IDEAS:
none
REVISION HISTORY:
Name Date Description
---- ---- -----------
Jim 06/90 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SpoolCreateThread method SpoolProcClass, MSG_SPOOL_CREATE_THREAD
.enter
; insert the job into the queue, or find that the
; queue doesn't yet exist.
call CreateThreadStart
jc incNumJobs ; if inserted, go finish up
; now that everything is in order, create the queue and thread
; we need to copy the JobInfoStruct onto the stack, so we can
; pass a valid pointer to it. If we leave it in the block, then
; the first LMemReAlloc (done right away in AllocDeviceQueue)
; will move our JIS block and cause all sorts of pain.
mov si, cx ; pass job handle
call AllocDeviceQueue
mov si, ds:[si] ; dereference handle again
tst bx ; problems allocating queue?
jz done ; yes, just quit
; now insert the job into the queue
call CreateThreadEnd
; job inserted, so inc the number of jobs to do
incNumJobs:
inc ds:[PQ_numJobs] ; one more job in queue
; notify process that a job has been added
mov bx, cx
call SendJobAddedNotification
done:
call UnlockQueue ; release it
.leave
ret
SpoolCreateThread endm
idata ends
QueueManagement segment resource
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CreateThreadStart
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Start the process of creating a thread for a print queue
CALLED BY: SpoolCreateThread
PASS: cx - JobInfoStruct chunk handle
RETURN: ds:si - JobInfoStruct in locked queue block
bx - queue handle (may be zero)
carry - clear if no queue, set otherwise
DESTROYED: ax, es
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 9/ 4/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CreateThreadStart proc far
.enter
; get a hold of the PrintQueue. We know the block exists,
; since our caller created one if it didn't exist before.
call LockQueue ; lock it down
mov ds, ax ; ds -> PrintQueue
mov si, cx ; *ds:si -> print job info
mov si, ds:[si] ; dereference handle
; now we have the job info. Before we go allocating another
; queue and printing thread, we should make sure that one
; didn't get created between the time the method was sent and
; now. This could happen if a few jobs get queued up right
; in a row.
segmov es, ds ; es -> PrintQueue
add si, JIS_info.JP_portInfo
call FindRightQueue ; see if it has been created
sub si, JIS_info.JP_portInfo
tst bx
jz done ; carry is clear
mov ds:[si].JIS_queue, bx ; save queue handle for job
mov ax, cx ; get job handle in ax
call InsertJobIntoQueue ; insert the job
stc ; indicate job was inserted
done:
.leave
ret
CreateThreadStart endp
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CreateThreadEnd
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SYNOPSIS: Complete the process of creating a thread for a print queue
CALLED BY: SpoolCreateThread
PASS: ds:si - JobInfoStruct
cx - JobInfoStruct handle
bx - queue handle
RETURN: Nothing
DESTROYED: ax
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
Don 9/ 4/92 Initial version
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
CreateThreadEnd proc far
.enter
; save the handle of the queue in the job info struct
mov ds:[si][JIS_queue], bx ; save queue handle in job info
; the job block is all initialized, so
; now that we have the queue, insert the job
; dereference the queue handle. If there are no jobs yet,
; just make this one the current job. Else follow the chain
; until we hit the end.
mov bx, ds:[bx] ; ds:bx -> queue info block
cmp ds:[bx].QI_curJob, 0 ; any jobs in the queue ?
jne followChain ; yes, follow the chain
mov ds:[bx].QI_curJob, cx ; store the job handle
clr ax
mov ds:[bx].QI_fileHan, ax ; clear out all the other info
mov {word} ds:[bx].QI_filePos, ax
mov {word} ds:[bx].QI_filePos+2, ax
mov ds:[bx].QI_curPage, ax
done:
.leave
ret
; at least one job is in the queue, follow the links
followChain:
mov si, ds:[bx].QI_curJob
linkLoop:
mov si, ds:[si] ; dereference next handle
cmp ds:[si].JIS_next, 0 ; is this the end ?
je foundIt ; yes, finish up
mov si, ds:[si].JIS_next ; no, get next link
jmp linkLoop
foundIt:
mov ds:[si].JIS_next, cx ; save link
jmp done
CreateThreadEnd endp
QueueManagement ends
if _PRINTING_DIALOG
PrintThread segment resource
COMMENT @----------------------------------------------------------------------
METHOD: SpoolProcKillFirstJob --
MSG_SPOOL_KILL_FIRST_JOB for SpoolProcClass
DESCRIPTION: Kills the first job.
PASS: *ds:si - instance data
es - segment of MetaClass
ax - MSG_SPOOL_KILL_FIRST_JOB
cx - handle of resource holding dialog box
RETURN: nothing
ax, cx, dx, bp - destroyed
ALLOWED TO DESTROY:
bx, si, di, ds, es
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
chris 11/30/93 Initial Version
------------------------------------------------------------------------------@
SpoolProcKillFirstJob method dynamic SpoolProcClass, \
MSG_SPOOL_KILL_FIRST_JOB
; lock down the queue and kill the first print job.
mov bx, ds:[queueHandle] ; lock the queue
tst bx
jz updateUI
call MemLock ; ax = segment
mov ds, ax ; ds -> queue
mov si, ds:[PQ_firstQueue] ; chunk handle of 1st queue
tst si ; is there a queue?
jz unlock ; ...no - we're done
mov si, ds:[si] ; get pointer to QueueInfo
mov ds:[si].QI_error, SI_ABORT ; set abort signal
; I have no ides why we're doing this, but the code was
; already there so I hope it works. Sigh. -Don 5/14/00
mov di, ds:[si].QI_curJob ; handle of first job => DI
tst di ; is there a job ?
jz unlock ; ...no - we're done
mov di, ds:[di] ; JobInfoStruct => DS:DI
mov ds:[di].JIS_next, 0 ; clear any next pointer
unlock:
call MemUnlock ; release the queue
; update the UI so the user sees something immediately
updateUI:
mov bx, cx
mov ax, MSG_GEN_SET_NOT_USABLE
mov si, offset PDPrintingGlyph
call sendMessage
mov ax, MSG_GEN_SET_NOT_USABLE
mov si, offset PDExplanation
call sendMessage
mov ax, MSG_GEN_SET_NOT_USABLE
mov si, offset PDChoice
call sendMessage
mov ax, MSG_GEN_SET_USABLE
mov si, offset PDCancelledGlyph
call sendMessage
; disable the Cancel and Pause trigger.
mov ax, MSG_GEN_SET_NOT_ENABLED
mov si, offset PDCancelTrigger
call sendMessage
ife _NO_PAUSE_RESUME_UI
mov ax, MSG_GEN_SET_NOT_ENABLED
mov si, offset PDPauseTrigger
call sendMessage
endif
ret
; send a message - doing this to save a few bytes
sendMessage:
mov dl, VUM_NOW
clr di ; no message flag.
call ObjMessage
retn
SpoolProcKillFirstJob endm
COMMENT @----------------------------------------------------------------------
METHOD: SpoolProcPauseFirstJob --
MSG_SPOOL_PAUSE_FIRST_JOB for SpoolProcClass
DESCRIPTION: Pauses the first job.
PASS: *ds:si - instance data
es - segment of MetaClass
ax - MSG_SPOOL_PAUSE_FIRST_JOB
RETURN: nothing
ax, cx, dx, bp - destroyed
ALLOWED TO DESTROY:
bx, si, di, ds, es
REGISTER/STACK USAGE:
PSEUDO CODE/STRATEGY:
KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS:
REVISION HISTORY:
Name Date Description
---- ---- -----------
chris 11/30/93 Initial Version
------------------------------------------------------------------------------@
ife _NO_PAUSE_RESUME_UI
SpoolProcPauseFirstJob method dynamic SpoolProcClass, \
MSG_SPOOL_PAUSE_FIRST_JOB
; lock down the queue and Pause the first print job.
mov bx, ds:[queueHandle] ; lock the queue
call MemLock ; ax = segment
mov ds, ax ; ds -> queue
mov si, ds:[PQ_firstQueue] ; chunk handle of 1st queue
mov si, ds:[si] ; get pointer to QueueInfo
cmp ds:[si].QI_error, SI_KEEP_GOING
je 10$
cmp ds:[si].QI_error, SI_PAUSE
jne 20$
10$:
xor ds:[si].QI_error, SI_PAUSE
20$:
call MemUnlock ; release the queue
ret
SpoolProcPauseFirstJob endm
endif ; !_NO_PAUSE_RESUME_UI
PrintThread ends
endif ; if _PRINTING_DIALOG
| 26.517812 | 80 | 0.601377 |
195cc68ccb8f61751c53cb7045838728055314e2 | 360 | asm | Assembly | programs/oeis/186/A186809.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/186/A186809.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/186/A186809.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A186809: Period 6 sequence [0, 1, 2, 0, -2, -1, ...].
; 0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0,1,2,0,-2,-1,0
sub $3,$0
lpb $0
sub $0,1
add $2,$1
sub $1,$2
gcd $3,2
add $1,$3
lpe
mov $0,$1
| 27.692308 | 213 | 0.447222 |
9e4d723af7822f5cb2b3bd9a43f46a30a7b523bd | 2,408 | asm | Assembly | vbox/src/VBox/Runtime/common/math/RTUInt128MulByU64.asm | Nurzamal/rest_api_docker | a9cc01dfc235467d490d9663755b33ef6990bdd8 | [
"MIT"
] | null | null | null | vbox/src/VBox/Runtime/common/math/RTUInt128MulByU64.asm | Nurzamal/rest_api_docker | a9cc01dfc235467d490d9663755b33ef6990bdd8 | [
"MIT"
] | null | null | null | vbox/src/VBox/Runtime/common/math/RTUInt128MulByU64.asm | Nurzamal/rest_api_docker | a9cc01dfc235467d490d9663755b33ef6990bdd8 | [
"MIT"
] | null | null | null | ; $Id: RTUInt128MulByU64.asm 69219 2017-10-24 15:01:30Z vboxsync $
;; @file
; IPRT - RTUInt128MulByU64 - AMD64 implementation.
;
;
; Copyright (C) 2006-2017 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; The contents of this file may alternatively be used under the terms
; of the Common Development and Distribution License Version 1.0
; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
; VirtualBox OSE distribution, in which case the provisions of the
; CDDL are applicable instead of those of the GPL.
;
; You may elect to license modified versions of this file under the
; terms and conditions of either the GPL or the CDDL or both.
;
%define RT_ASM_WITH_SEH64
%include "iprt/asmdefs.mac"
%include "internal/bignum.mac"
BEGINCODE
;;
; Multiplies a 128-bit number with a 64-bit one.
;
; @returns puResult.
; @param puResult x86:[ebp + 8] gcc:rdi msc:rcx
; @param puValue1 x86:[ebp + 12] gcc:rsi msc:rdx
; @param uValue2 x86:[ebp + 16] gcc:rdx msc:r8
;
BEGINPROC_EXPORTED RTUInt128MulByU64
; SEH64_SET_FRAME_xSP 0
SEH64_END_PROLOGUE
%ifdef RT_ARCH_AMD64
%ifdef ASM_CALL64_GCC
%define puResult rdi
%define puValue1 rsi
%define uValue2 r8
mov r8, rdx
%else
%define puResult rcx
%define puValue1 r9
%define uValue2 r8
mov r9, rdx
%endif
; puValue1->s.Lo * uValue2
mov rax, [puValue1]
mul uValue2
mov [puResult], rax
mov r11, rdx ; Store the lower half of the result.
; puValue1->s.Hi * uValue2
mov rax, [puValue1 + 8]
mul uValue2
add r11, rax ; Calc the second half of the result.
mov [puResult + 8], r11 ; Store the high half of the result.
mov rax, puResult
;%elifdef RT_ARCH_X86
%else
%error "unsupported arch"
%endif
ret
ENDPROC RTUInt128MulByU64
| 29.365854 | 77 | 0.664037 |
ecc6c460f5e14802986fee7cc84a691f13a009e7 | 353 | asm | Assembly | programs/oeis/138/A138450.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/138/A138450.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/138/A138450.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A138450: a(n) = ((n-th prime)^6-(n-th prime^2))/30.
; 2,24,520,3920,59048,160888,804576,1568184,4934512,19827416,29583424,85524168,158336752,210712040,359307104,738811944,1406017672,1717345688,3015279256,4270009296,5044474032,8102914976,10898012216,16566042768
seq $0,40 ; The prime numbers.
mov $2,$0
pow $2,5
sub $2,$0
mul $0,$2
div $0,60
mul $0,2
| 32.090909 | 208 | 0.747875 |
19699d4d813aa74570fcc816691af75502f4bb06 | 5,071 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca_notsx.log_21829_1370.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca_notsx.log_21829_1370.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i9-9900K_12_0xca_notsx.log_21829_1370.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 %r15
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0xe5c1, %rsi
lea addresses_normal_ht+0x19fa5, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
cmp %r12, %r12
mov $91, %rcx
rep movsw
nop
nop
nop
xor %r15, %r15
lea addresses_D_ht+0x13681, %r10
nop
nop
nop
nop
lfence
mov (%r10), %r15d
nop
add $10772, %rsi
lea addresses_UC_ht+0x12ec1, %rdi
nop
sub %rsi, %rsi
movl $0x61626364, (%rdi)
sub %rcx, %rcx
lea addresses_WT_ht+0x12481, %rdi
clflush (%rdi)
nop
nop
sub $56213, %r12
movb (%rdi), %r10b
cmp %rdi, %rdi
lea addresses_A_ht+0x1aec1, %rsi
lea addresses_D_ht+0x1d8c1, %rdi
clflush (%rsi)
and $16401, %r13
mov $0, %rcx
rep movsb
add %r15, %r15
pop %rsi
pop %rdi
pop %rcx
pop %r15
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r9
push %rax
push %rbp
push %rsi
// Faulty Load
lea addresses_RW+0x1a6c1, %r9
sub %rsi, %rsi
mov (%r9), %rax
lea oracles, %rbp
and $0xff, %rax
shlq $12, %rax
mov (%rbp,%rax,1), %rax
pop %rsi
pop %rbp
pop %rax
pop %r9
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_RW', 'NT': False, 'AVXalign': True, 'size': 8, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'REPM', 'src': {'same': False, 'congruent': 8, 'type': 'addresses_UC_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_normal_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 6}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 7, 'type': 'addresses_D_ht'}}
{'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
*/
| 50.71 | 2,999 | 0.65983 |
2066efae9e409e702dfbe8814099ab531a810964 | 681 | asm | Assembly | Float Operations/Float add and sub.asm | MrR0B0T777/MIPS_Programming | 5bbb84c8cf15b9e254f19b47a9e0b365ed7ca7d4 | [
"MIT"
] | null | null | null | Float Operations/Float add and sub.asm | MrR0B0T777/MIPS_Programming | 5bbb84c8cf15b9e254f19b47a9e0b365ed7ca7d4 | [
"MIT"
] | null | null | null | Float Operations/Float add and sub.asm | MrR0B0T777/MIPS_Programming | 5bbb84c8cf15b9e254f19b47a9e0b365ed7ca7d4 | [
"MIT"
] | null | null | null | .data
prompt1: .asciiz "\nEnter first num: "
prompt2: .asciiz "\nEnter second num: "
resadd: .asciiz "\nSum: "
ressub: .asciiz "\nDiff: "
resneg: .asciiz "\nDiff using neg.s: "
.text
main:
la $a0, prompt1
li $v0, 4
syscall
la $v0, 6
syscall
mov.s $f2, $f0 #moving so that next input wont overwrite
la $a0, prompt2
li $v0, 4
syscall
la $v0, 6
syscall
mov.s $f3, $f0
la $a0, resadd
li $v0, 4
syscall
add.s $f12, $f2, $f3
li $v0, 2
syscall
la $a0, ressub
li $v0, 4
syscall
sub.s $f12, $f2, $f3
li $v0, 2
syscall
la $a0, resneg
li $v0, 4
syscall
neg.s $f4, $f3
add.s $f12, $f2, $f4
li $v0, 2
syscall
li $v0, 10
syscall | 12.849057 | 60 | 0.590308 |
7ad9a5a31d787a5c0db2bea940f06a4c2bfaa2a9 | 1,242 | asm | Assembly | poker-hands/avr-asm/main.asm | matthewphilyaw/lunchtime-katas | 6308dd039eb9dcb20d3155dd13caa798b225d892 | [
"Apache-2.0"
] | null | null | null | poker-hands/avr-asm/main.asm | matthewphilyaw/lunchtime-katas | 6308dd039eb9dcb20d3155dd13caa798b225d892 | [
"Apache-2.0"
] | 2 | 2016-01-31T05:00:08.000Z | 2016-01-31T05:00:08.000Z | poker-hands/avr-asm/main.asm | matthewphilyaw/lunchtime-katas | 6308dd039eb9dcb20d3155dd13caa798b225d892 | [
"Apache-2.0"
] | null | null | null | .include "tn2313def.inc"
.equ baud = 115200
.equ F_CPU = 14745600
.def trbuf = r18
rjmp reset
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reti ; unused interrupt
reset:
ldi r16, lo8(RAMEND)
out SPL, r16
rjmp main
usart_init:
ldi r16, (1 << DDD1) ; Ensure TX pin is set to output
out DDRD, r16
ldi r17, hi8(F_CPU/(16*baud)-1)
ldi r16, lo8(F_CPU/(16*baud)-1)
out UBRRH, r17
out UBRRL, r16
ldi r16, (1 << RXEN)|(1 << TXEN) ; Enable receiver and transmitter
out UCSRB, r16
ldi r16, (0 << USBS)|(3 << UCSZ0)
out UCSRC, r16
ret
tx:
sbis UCSRA, UDRE
rjmp tx
out UDR, trbuf
ret
rx:
sbis UCSRA, RXC
rjmp rx
in trbuf, UDR
ret
main:
RCALL usart_init
rjmp echo
echo:
RCALL rx
RCALL tx
rjmp echo
| 18.264706 | 70 | 0.622383 |
bb3dfd67c3bfeede99d619b310c2083211b17c63 | 566 | asm | Assembly | oeis/272/A272871.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/272/A272871.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/272/A272871.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A272871: Imaginary part of (n + i)^4.
; 0,0,24,96,240,480,840,1344,2016,2880,3960,5280,6864,8736,10920,13440,16320,19584,23256,27360,31920,36960,42504,48576,55200,62400,70200,78624,87696,97440,107880,119040,130944,143616,157080,171360,186480,202464,219336,237120,255840,275520,296184,317856,340560,364320,389160,415104,442176,470400,499800,530400,562224,595296,629640,665280,702240,740544,780216,821280,863760,907680,953064,999936,1048320,1098240,1149720,1202784,1257456,1313760,1371720,1431360,1492704,1555776,1620600,1687200,1755600
add $0,1
bin $0,3
mul $0,24
| 80.857143 | 496 | 0.810954 |
7b791e3de747e0f35a57d486e06237521faaffa7 | 74 | asm | Assembly | gfx/pokemon/lotad/anim.asm | Ebernacher90/pokecrystal-allworld | 5d623c760e936842cf92563912c5bd64dd69baef | [
"blessing"
] | null | null | null | gfx/pokemon/lotad/anim.asm | Ebernacher90/pokecrystal-allworld | 5d623c760e936842cf92563912c5bd64dd69baef | [
"blessing"
] | null | null | null | gfx/pokemon/lotad/anim.asm | Ebernacher90/pokecrystal-allworld | 5d623c760e936842cf92563912c5bd64dd69baef | [
"blessing"
] | null | null | null | frame 1, 04
frame 2, 16
frame 1, 08
frame 0, 08
frame 1, 08
endanim
| 10.571429 | 12 | 0.635135 |
52b4687a3f8e05a7e70fe925264f6c832af47c64 | 548 | asm | Assembly | programs/oeis/077/A077107.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/077/A077107.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/077/A077107.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A077107: Least integer cube >= n^2.
; 0,1,8,27,27,27,64,64,64,125,125,125,216,216,216,343,343,343,343,512,512,512,512,729,729,729,729,729,1000,1000,1000,1000,1331,1331,1331,1331,1331,1728,1728,1728,1728,1728,2197,2197,2197,2197,2197,2744,2744,2744,2744,2744,2744,3375,3375,3375,3375,3375,3375,4096,4096,4096,4096,4096,4096,4913,4913,4913,4913,4913,4913,5832,5832,5832,5832,5832,5832,6859,6859,6859,6859,6859,6859,8000,8000,8000,8000,8000,8000,8000,9261,9261,9261,9261,9261,9261,9261,10648,10648,10648
pow $0,2
seq $0,48763 ; Smallest cube >= n.
| 91.333333 | 464 | 0.757299 |
68281ea0958c901756221b1fcdaabbdd06d824b3 | 205 | asm | Assembly | spectranet/libspectranet/get_ifconfig_inet.asm | speccytools/spectranet-gdbserver | c76acd970e5e8bbf793d8514bf64c32a180c26a4 | [
"MIT"
] | 40 | 2021-07-23T21:33:59.000Z | 2022-02-07T19:07:46.000Z | spectranet/libspectranet/get_ifconfig_inet.asm | speccytools/spectranet-gdbserver | c76acd970e5e8bbf793d8514bf64c32a180c26a4 | [
"MIT"
] | null | null | null | spectranet/libspectranet/get_ifconfig_inet.asm | speccytools/spectranet-gdbserver | c76acd970e5e8bbf793d8514bf64c32a180c26a4 | [
"MIT"
] | 2 | 2021-08-02T17:49:03.000Z | 2021-10-09T21:53:41.000Z | ; process
; void __FASTCALL__ get_ifconfig_inet(in_addr_t *addr);
PUBLIC get_ifconfig_inet
EXTERN libspectranet
include "spectranet.asm"
.get_ifconfig_inet
ex de, hl
HLCALL GET_IFCONFIG_INET_ROM
ret
| 17.083333 | 55 | 0.819512 |
8a11759be303b60413da516b0f0eb66db3b29833 | 5,028 | asm | Assembly | Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca.log_21829_1060.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca.log_21829_1060.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_zr_/i7-7700_9_0xca.log_21829_1060.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r12
push %r13
push %r14
push %r8
push %rcx
lea addresses_WT_ht+0x4d67, %r12
nop
nop
nop
and %rcx, %rcx
movb (%r12), %r10b
nop
nop
and %r8, %r8
lea addresses_UC_ht+0x1a937, %rcx
nop
nop
nop
nop
cmp $38858, %r11
mov $0x6162636465666768, %r14
movq %r14, (%rcx)
nop
nop
nop
dec %r11
lea addresses_WT_ht+0x7287, %r14
nop
nop
nop
inc %r13
mov (%r14), %r8w
nop
nop
nop
nop
add $42529, %r10
lea addresses_WT_ht+0x16f77, %rcx
clflush (%rcx)
nop
nop
nop
nop
inc %r13
mov (%rcx), %r10
nop
nop
nop
xor $39721, %r14
lea addresses_WT_ht+0xdbb7, %r10
clflush (%r10)
nop
nop
nop
cmp $18679, %r12
mov $0x6162636465666768, %r13
movq %r13, (%r10)
nop
lfence
pop %rcx
pop %r8
pop %r14
pop %r13
pop %r12
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r12
push %r14
push %r8
push %r9
push %rbp
// Faulty Load
mov $0x675da00000000377, %r8
sub %rbp, %rbp
movb (%r8), %r12b
lea oracles, %r9
and $0xff, %r12
shlq $12, %r12
mov (%r9,%r12,1), %r12
pop %rbp
pop %r9
pop %r8
pop %r14
pop %r12
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 1, 'NT': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 2, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 6, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_UC_ht'}}
{'src': {'congruent': 4, 'AVXalign': False, 'same': False, 'size': 2, 'NT': True, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 9, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WT_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 44.495575 | 2,999 | 0.65891 |
bb93976a4c521626bfc09f7b3d8ebf99d4d31263 | 5,919 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_/i7-7700_9_0x48.log_21829_2268.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.log_21829_2268.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.log_21829_2268.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r15
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x136e9, %r8
nop
nop
nop
nop
and $6923, %rdi
mov (%r8), %r15w
nop
nop
nop
nop
nop
add $51293, %r9
lea addresses_WC_ht+0x1c4d0, %rsi
lea addresses_D_ht+0x3b40, %rdi
clflush (%rsi)
dec %rax
mov $19, %rcx
rep movsq
nop
nop
inc %rcx
lea addresses_normal_ht+0x14b38, %r9
nop
nop
cmp %rsi, %rsi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm4
vmovups %ymm4, (%r9)
and $57050, %rcx
lea addresses_D_ht+0x1ad38, %r15
nop
lfence
mov $0x6162636465666768, %rax
movq %rax, (%r15)
nop
inc %r9
lea addresses_D_ht+0x1d0f8, %r9
dec %rax
vmovups (%r9), %ymm5
vextracti128 $0, %ymm5, %xmm5
vpextrq $0, %xmm5, %r15
nop
nop
nop
nop
sub $55447, %rax
lea addresses_A_ht+0x1869e, %rsi
lea addresses_WC_ht+0xa338, %rdi
nop
nop
add $56926, %r8
mov $121, %rcx
rep movsb
nop
xor $17806, %r8
lea addresses_A_ht+0x17300, %r8
nop
nop
nop
nop
dec %rax
movb (%r8), %cl
nop
nop
nop
nop
and %r8, %r8
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r15
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %r14
push %r8
push %r9
// Store
lea addresses_RW+0x1a238, %r11
clflush (%r11)
sub $64529, %r8
mov $0x5152535455565758, %r9
movq %r9, %xmm5
vmovups %ymm5, (%r11)
nop
nop
nop
nop
add $7108, %r10
// Faulty Load
lea addresses_WC+0xf738, %r14
nop
nop
and $52212, %r13
mov (%r14), %r11d
lea oracles, %r8
and $0xff, %r11
shlq $12, %r11
mov (%r8,%r11,1), %r11
pop %r9
pop %r8
pop %r14
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 16, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_RW', 'AVXalign': False, 'congruent': 8, 'size': 32, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_WC', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 0, 'size': 2, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WC_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 10, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 9, 'size': 8, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'congruent': 5, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': True}, 'dst': {'type': 'addresses_WC_ht', 'congruent': 10, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 1, 'same': False, 'NT': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 40.82069 | 2,999 | 0.658557 |
083d66832b01180595c57646823fc6c9dc952cc2 | 1,116 | asm | Assembly | home/indirection.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | home/indirection.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 1 | 2020-12-16T01:11:20.000Z | 2020-12-16T22:53:56.000Z | home/indirection.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 3 | 2021-01-15T18:45:40.000Z | 2021-10-16T03:35:27.000Z | LoadIndirectPointer::
; in: a:hl: indirect table, bc: index
; out: a:hl: pointer to element, b: copy of a, c: clobbered, de: preserved, zero flag: set if pointer is null
push de
ld d, a
ldh a, [hROMBank]
push af
ld a, d
rst Bankswitch
ld a, [hli]
ld e, a
ld a, [hli]
ld d, a
add a, a
jr nc, .loop
res 7, d
dec bc
ld a, b
and c
inc a
jr nz, .loop
.null
ld hl, 0
ld b, h
.done
pop af
rst Bankswitch
pop de
ld a, h
or l
ld a, b
ret
.next
inc hl
inc hl
inc hl
cpl
inc a
add a, c
ld c, a
jr c, .loop ;subtracting by addition has the carry flipped
dec b
.loop
ld a, [hli]
and a
jr z, .null
inc b
dec b
jr nz, .next
cp c
jr c, .next
jr z, .next
ld a, [hli]
ld b, a
ld a, [hli]
ld h, [hl]
ld l, a
or h
jr z, .done ;no point in setting them to zero if they already are
ld a, c
ld c, e
ld e, b
ld b, d
call AddNTimes
ld b, e
jr .done
LoadDoubleIndirectPointer::
; for indirect tables of near pointers to data, used for structures of varying size
; same calling convention as LoadIndirectPointer
call LoadIndirectPointer
call nz, GetFarHalfword
ld a, b
ret
| 14.493506 | 110 | 0.646953 |
1ec0f2b56a651a012169d4c20756796d343be63e | 28,219 | asm | Assembly | softrom.asm | nils-eilers/SoftROM | 4b4ac8eb5517726bb81687e405c0df8138f03e11 | [
"WTFPL"
] | 2 | 2021-05-05T00:59:55.000Z | 2021-06-25T14:12:17.000Z | softrom.asm | nils-eilers/SoftROM | 4b4ac8eb5517726bb81687e405c0df8138f03e11 | [
"WTFPL"
] | null | null | null | softrom.asm | nils-eilers/SoftROM | 4b4ac8eb5517726bb81687e405c0df8138f03e11 | [
"WTFPL"
] | 1 | 2017-07-25T20:01:38.000Z | 2017-07-25T20:01:38.000Z | ; **********************************************
; ************* SoftROM EEPROM tool ************
; **********************************************
;
; Assemble with "The Bit Shift Assembler"
; freely available from https://github.com/Edilbert/BSA
;
; Copyright (c) 2014 Nils Eilers <nils.eilers@gmx.de>
; This work is free. You can redistribute it and/or modify it under the
; terms of the Do What The Fuck You Want to Public License, Version 2,
; as published by Sam Hocevar. See the COPYING file for more details.
; ************
; * Keycodes *
; ************
TAB = 9 ; Tab
CR = 13 ; Carriage Return
HOME = 19 ; Home
DEL = 20 ; Delete
CLR = 147 ; Clear
CDOWN = 17 ; Cursor Down
CRIGHT = 29 ; Cursor Right
CUP = 145 ; Cursor Up
CLEFT = 157 ; Cursor Left
; ****************
; * Screen codes *
; ****************
C8296 = 0
#if C8296
HOR_BAR = 102 ; -
VER_BAR = 97 ; |
UL = 104 ; upper left
UR = 106 ; upper right
LL = 98 ; lower left
LR = 100 ; lower right
TL = 101 ; T left
TR = 103 ; T right
TU = 105 ; T upper
TB = 99 ; T bottom
#else
HOR_BAR = 64 ; -
VER_BAR = 93 ; |
UL = 112 ; upper left
UR = 110 ; upper right
LL = 109 ; lower left
LR = 125 ; lower right
TL = 107 ; T left
TR = 115 ; T right
#endif
ROWS = 25
; ****************************
; * Some Zero Page Variables *
; ****************************
BP = $5e ; Buffer Pointer
STRPTR = $60 ; String Pointer
SP = $62 ; SCREEN Pointer
TP = $64 ; Temporary Pointer
SelPtr = $66 ; Selection pointer
; ************************
; * CBM Kernal Variables *
; ************************
STATUS = $96 ; Status byte
STKEY = $9b ; Stop key pressed?
BLNSW = $a7 ; Blink switch
BLNCT = $a8 ; Blink count
BLNON = $aa ; Blink On
EAL = $c9 ; used for LOAD, SAVE and TIM
FNLEN = $d1 ; Filename length
SA = $d3 ; Secondary address
FA = $d4 ; First sddress
FNADR = $da ; Filename address
DOS_Filename = $0342
; *************
; * Constants *
; *************
Screen = $8000
EntriesPerPage = 20
; *****************************************
; * Put the buffer after the program code *
; *****************************************
Buffer = [EOP & $ff00] + $100
PosDiskName = 8
PosDiskID = 26
; ***************************************************
; * The CBM 8000 Kernal has no jump table for these *
; ***************************************************
READY = $b403 ; $b3ff ; $b406 omitting prompt
TALK = $f0d2
LISTEN = $f0d5
SECOND = $f143
TKSA = $f193
CIOUT = $f19e
UNTLK = $f1ae
UNLSN = $f1b9
ACPTR = $f1c0
BSOUT = $ffd2
CHROUT = $ffd2
GETIN = $ffe4
Kernal_STOP = $f343
; ***************
; * Print Macro *
; ***************
MACRO MAC_Print(lab)
LDY #<lab
LDA #>lab
LDX #?lab
JSR PrintText
ENDMAC
MACRO MAC_Plot(Row,Col,Char)
LDA #Char
LDX #Row
LDY #Col
JSR PlotAt
ENDMAC
MACRO MAC_PutString(Row,Col,Text)
LDX #Row
LDY #Col
JSR GotoXY
LDX #<Text
LDY #>Text
JSR PutString
ENDMAC
; ***************************************************
; The directory is loaded into RAM beyond the program
; SOD = Start of directory
; EOD = End of directory
; ***************************************************
; **********************************
; * BASIC header for program start *
; **********************************
START = $0401
* = START ; *** BASIC *** CBM / PET series
.LOAD START ; LOAD address
.STORE START,EOP-START,"softrom.prg"
Link .WORD EndLink
; **********
Linenumber
; **********
.WORD 2015
; **********
SysCommand
; **********
.BYTE $9e ; SYS token
StartML .BYTE "(1065)"
.BYTE ':',$8f ; REM token
.BYTE " SOFTROM EEPROM TOOL 0.2"
LineEnd .BYTE 0
EndLink .WORD 0
JMP Main
NUMBER .BYTE "00000 "
UnitText .PET 'unit:',0
DriveText .PET 'drive:',0
HelpText .BYTE "<H> = HELP",0
ProgramText .BYTE " SOFTROM EEPROM TOOL (C) NILS EILERS & BS ",0
Msg_READY .BYTE "READY.",0
Cols .BYTE 80
Count .BYTE 0
CursorRow .BYTE 0
CursorCol .BYTE 0
Entries .BYTE 0
FirstLine .BYTE 0
LastLine .BYTE 20
HelpScreen .BYTE 0
Pages .BYTE 2
ScreenLo .FILL 25 (0)
ScreenHi .FILL 25 (0)
EntryLo .FILL 40 (0)
EntryHi .FILL 40 (0)
Page .BYTE 0
Offset .BYTE 0
Unit .BYTE 8
Drive .BYTE '0'
LV0 .BYTE 0
LV1 .BYTE 0
Reverse .BYTE 0
Select .BYTE 2
FirstFile .BYTE 0 ; First file on display
SOD .WORD 0 ; Start Of Directory
EOD .WORD 0 ; End Of Directory
TargetLo .BYTE $00
TargetHi .BYTE $90
SelectionLo .BYTE 0
SelectionHi .BYTE 0
SelFilename .BYTE 16
DiskStatus = $8000 + 201
HelpLen = 30
HelpLines = 7
HelpWin .BYTE "UP/DN MOVE SELECTION BAR ",0
.BYTE "+ / - CHANGE UNIT OR DRIVE #",0
.BYTE "HOME RESET THE SCREEN ",0
.BYTE "RETURN FLASH EEPROM FROM FILE",0
.BYTE "STOP QUIT THE PROGRAM ",0
.BYTE "H SHOW THIS HELP WINDOW ",0
.BYTE "ESC CLOSE HELP WINDOW ",0
; ********
ShowHelp
; ********
LDA #0
STA Offset
LDX #53
STX Count
LDX #8
LDY #24
JSR HorLine
LDX #16
LDY #24
JSR HorLine
LDX #16
STX Count
LDX #8
LDY #23
JSR VerLine
LDX #8
LDY #53
JSR VerLine
MAC_Plot( 8,23,UL)
MAC_Plot( 8,53,UR)
MAC_Plot(16,23,LL)
MAC_Plot(16,53,LR)
LDA #HelpLines
STA Count
LDX #9
LDY #24
JSR GotoXY
LDX #<HelpWin
LDY #>HelpWin
ShHe10 JSR PutString
LDX CursorRow
INX
LDY #24
JSR GotoXY
CLC
LDA STRPTR
ADC #HelpLen
TAX
LDA STRPTR+1
ADC #0
TAY
DEC Count
BNE ShHe10
LDA #$ff
STA HelpScreen
RTS
; ****
STOP
; ****
LDA STKEY
CMP #$ef
RTS
; **********
Error_Beep
; **********
LDA #7
JMP BSOUT
; *********
PrintText
; *********
STY SP
STA SP+1
LDY #0
PrTe_10 LDA (SP),Y
JSR BSOUT
INY
DEX
BNE PrTe_10
RTS
; ********************
Flush_Keyboard_Queue
; ********************
JSR GETIN
BNE Flush_Keyboard_Queue
RTS
; ***********
FormatByte
; ***********
; Convert binary number in (A) to
; three decimal digits in (Y),(X) and (A)
LDY #'0' ; 100
LDX #'0'-1 ; 10
SEC
asts_01 INX
SBC #10
BCS asts_01
ADC #$3a
CPX #$3a
BCC asts_rt ; X < 10
PHA
TXA
SBC #10 ; X -= 10
TAX
PLA
INY ; Y = 1
asts_rt RTS
; **************
FormatInteger
; **************
LDY #$2f ; X = low byte
SEC ; A = high byte
FORINT_01 INY
STX LV0
STA LV1
TXA
SBC #<10000
TAX
LDA LV1
SBC #>10000
BCS FORINT_01
STY NUMBER
LDX LV0
LDA LV1
LDY #$2f
SEC
FORINT_02 INY
STX LV0
STA LV1
TXA
SBC #<1000
TAX
LDA LV1
SBC #>1000
BCS FORINT_02
STY NUMBER+1
LDX LV0
LDA LV1
LDY #$2f
SEC
FORINT_03 INY
STX LV0
STA LV1
TXA
SBC #100
TAX
LDA LV1
SBC #0
BCS FORINT_03
STY NUMBER+2
LDA LV0
LDY #$2f
SEC
FORINT_04 INY
SBC #10
BCS FORINT_04
STY NUMBER+3
ADC #$3a
STA NUMBER+4
LDX #0
LDA #' '
FORINT_05 LDY NUMBER,X
CPY #'0'
BNE FORINT_06
STA NUMBER,X
INX
CPX #4
BCC FORINT_05
FORINT_06 RTS
; ********
ShowUnit
; ********
LDX #0
LDY Select
BNE ShUn10
LDX #$80
ShUn10 STX Reverse
LDX #2
LDY #6
JSR GotoXY
LDA Unit
JSR FormatByte
CPX #'0'
BEQ ShUn20
PHA
TXA
JSR PutCharR
PLA
ShUn20 JSR PutCharR
LDA #' '
JMP PutChar
; *********
ShowDrive
; *********
LDX #0
LDY Select
DEY
BNE ShDr10
LDX #$80
ShDr10 STX Reverse
LDA Drive
LDX #2
LDY #15
JMP PlotAtR
; ************
ShowDiskName
; ************
LDX #2
LDY #18
JSR GotoXY
LDA #' '
STA Buffer + PosDiskName + 16 ; delete quote
LDA #0
STA Buffer + PosDiskName + 20 ; mark string end
LDX #<[Buffer + PosDiskName]
LDY #>[Buffer + PosDiskName]
JMP PutString
; **************
FormatFilename
; **************
LDA BP
STA STRPTR
LDA BP+1
STA STRPTR+1
LDY #2
LDA (BP),Y ; Blocks low
TAX
INY
LDA (BP),Y ; Blocks high
JSR FormatInteger
LDY #0
FoFi10 LDA NUMBER+2,Y
STA (BP),Y
INY
CPY #4
BCC FoFi10
LDA (BP),Y
CMP #' '
BNE FoFi99
FoFi20 INC STRPTR
LDA (STRPTR),Y
CMP #' '
BEQ FoFi20
CMP #$22
BEQ FoFi20
STA (BP),Y
FoFi40 INY
CPY #$20
BCS FoFi99
FoFi50 LDA (STRPTR),Y
STA (BP),Y
BNE FoFi40
INC Entries
FoFi99 RTS
; *************
FormatEntries
; *************
LDA #0
STA Entries
LDA #$20 ; 1st. file
STA BP
LDA #>Buffer
STA BP+1
FoEn10 LDY #4 ; after link and #
LDA (BP),Y
CMP #' ' ; for filename must be blank
BNE FoEn99
JSR FormatFilename
JSR GetLoadAddress
LDX Entries
DEX
JSR ShowEntry
CLC
LDA BP
ADC #$20
STA BP
BCC FoEn20
INC BP+1
FoEn20 LDA EOD ; check for End Of Directory
CMP BP
LDA EOD+1
SBC BP+1
BCS FoEn10
FoEn99 RTS
; *******
PET2SCR
; *******
CMP #$41
BCC P2C99
CMP #$5b
BCS P2C10
AND #$1f ; a - z
RTS
P2C10 CMP #$c1
BCC P2C99
CMP #$ca
BCS P2C99
AND #$7f ; A - Z
P2C99 RTS
; *********
ShowEntry
; *********
; Input: (X) = entry # (unchanged)
; (BP) = buffer pointer
; Used: (A),(Y)
CPX LastLine
BCS ShEn99
LDY #0 ; no reverse
TXA ; entry # in (X)
CLC
ADC #2
CMP Select
BNE ShEn10
LDA EntryLo,X
STA SelectionLo
LDA EntryHi,X
STA SelectionHi
LDA BP
STA SelPtr
LDA BP+1
STA SelPtr+1
LDY #$80 ; selected
ShEn10 STY Reverse
LDA EntryLo,X
STA SP
LDA EntryHi,X
STA SP+1
LDY #0
ShEn20 LDA (BP),Y
BEQ ShEn99
CMP #$22 ; hide quote
BNE ShEn30
LDA #' '
ShEn30 JSR PET2SCR
ORA Reverse
STA (SP),Y
INY
CPY #32
BCC ShEn20
ShEn99 RTS
; ***********
ShowEntries
; ***********
LDA SOD
STA BP
LDA SOD+1
STA BP+1
LDX #0
ShoE10 JSR ShowEntry
CLC
LDA BP
ADC #$20
STA BP
BCC ShoE20
INC BP+1
ShoE20 INX
CPX LastLine
BCS ShoE99
TXA
ADC FirstLine ; Carry is clear
CMP Entries
BCC ShoE10
ShoE99 RTS
; ***********
RightSelect
; ***********
LDA Select
BEQ IncSelect ; Unit -> Drive
CMP #2
BCC RiSe99 ; Drive
CLC
ADC #18
CMP Entries
BCS RiSe99
ADC #2
STA Select
RiSe99 RTS
; **********
LeftSelect
; **********
LDA Select
CMP #1
BEQ DecSelect ; Unit <- Drive
CMP #23
BCC LeSe99
SBC #20
STA Select
LeSe99 RTS
; *********
IncSelect
; *********
; Increment selection
; 0 : unit
; 1 : drive
; > 1 : filename
LDX Select
BEQ InSe40 ; Unit
DEX
BEQ InSe40 ; Drive
CPX LastLine
BCC InSe20
CLC ; Scroll display
LDA FirstLine
ADC LastLine
CMP Entries
BCS InSe30 ; At end alreay
INC FirstLine
LDA SOD ; Advance SOD
ADC #$20
STA SOD
BCC InSe10
INC SOD+1
InSe10 RTS
InSe20 CPX Entries
BCC InSe40 ; in range
InSe30 LDX #1
STX Select ; wrap around
InSe40 INC Select
InSe99 RTS
; *********
DecSelect
; *********
; Decrement selection
; 0 : unit
; 1 : drive
; > 1 : filename
LDX Select
CPX #2 ; First file
BNE DeSe20
LDA FirstLine ; Scroll display
BEQ DeSe20
DEC FirstLine
SEC
LDA SOD
SBC #$20
STA SOD
BCS DeSe10
DEC SOD+1
DeSe10 RTS
DeSe20 DEC Select
BPL DeSe99
LDX Entries
CPX LastLine
BCC DeSe30
LDX LastLine
DeSe30 INX
STX Select ; wrap around
DeSe99 RTS
; *************
ShowSelection
; *************
JSR ShowUnit
JSR ShowDrive
JMP ShowEntries
; ********
IncValue
; ********
LDX Select
BNE InVa10
LDA Unit
CMP #11
BCS InVa99
INC Unit
BNE InVa20
InVa10 DEX
BNE InVa99
LDA Drive
CMP #'9'
BCS InVa99
INC Drive
InVa20 JSR Reload
InVa99 RTS
; ********
DecValue
; ********
LDX Select
BNE DeVa10
LDA Unit
CMP #9
BCC DeVa99
DEC Unit
BNE DeVa20
DeVa10 DEX
BNE DeVa99
LDA Drive
CMP #'1'
BCC DeVa99
DEC Drive
DeVa20 JSR Reload
DeVa99 RTS
; **********
HomeSelect
; **********
LDA #0
STA Select
STA FirstLine
LDA #$20
STA SOD
LDA #>Buffer
STA SOD+1
RTS
; ********
MainLoop
; ********
JSR GETIN
BEQ MainLoop
BIT HelpScreen
BPL MaLo02
PHA
JSR Repaint
PLA
MaLo02 CMP #3 ; STOP key
BEQ MaLo99
CMP #TAB
BEQ MaLo85
CMP #CDOWN
BEQ MaLo85
MaLo05 CMP #CUP
BNE MaLo10
JSR DecSelect
JMP MaLo90
MaLo10 CMP #CRIGHT
BNE MaLo15
JSR RightSelect
JMP MaLo90
MaLo15 CMP #CLEFT
BNE MaLo20
JSR LeftSelect
JMP MaLo90
MaLo20 CMP #'+'
BNE MaLo25
JSR IncValue
JMP MaLo90
MaLo25 CMP #'-'
BNE MaLo30
JSR DecValue
JMP MaLo90
MaLo30 CMP #HOME
BNE MaLo35
JSR HomeSelect
JMP MaLo90
MaLo35 CMP #'H'
BNE MaLo40
JSR ShowHelp
JMP MainLoop
MaLo40 CMP #13
BNE MaLo45
JMP Flash
MaLo45 JMP MainLoop
MaLo85 JSR IncSelect
MaLo90 JSR ShowSelection
JMP MainLoop
MaLo99 RTS
; *******
Repaint
; *******
LDA #0
STA HelpScreen
JSR PaintMask
JSR ShowUnit
JSR ShowDrive
JSR ShowDiskName
LDA Entries
BEQ Repa10
LDA #2
STA Select
JSR ShowEntries
JSR ShowUnit
Repa10 RTS
; ******
Reload
; ******
LDA #0
STA Entries
JSR LoadDirectory
JSR FormatEntries
JSR Repaint
RTS
; ****
Init
; ****
LDA #8
STA Unit
LDA #'0'
STA Drive
LDA #0
STA CursorRow
STA CursorCol
STA Entries
STA Offset
STA Reverse
STA Select
STA FirstLine
RTS
; ****
Main
; ****
JSR Detect_BASIC_version
JSR Detect_Screen_Width
JSR SetupScreen
JSR Repaint
JSR SetupEntries
JSR Init
JSR Reload
JSR MainLoop
JSR Flush_Keyboard_Queue
LDA #<Msg_READY
LDY #>Msg_READY
JMP READY
; ********************
Detect_BASIC_version
; ********************
; TODO: detect BASIC version and patch vectors
RTS
; *******************
Detect_Screen_Width
; *******************
; TODO: detect Screen Width
LDA #80
STA Cols
LDA #2
STA Pages
LDA #40
STA LastLine
RTS
; ***********
SetupScreen
; ***********
LDA #CLR
JSR CHROUT ; clear screen
LDA #130
JSR CHROUT ; legacy character set
LDA #<Screen
LDX #>Screen
LDY #0
SeSe10 STA ScreenLo,Y
TXA
STA ScreenHi,Y
CLC
LDA ScreenLo,Y
ADC Cols
BCC SeSe20
INX
SeSe20 INY
CPY #ROWS
BCC SeSe10
RTS
; ************
SetupEntries
; ************
LDY #0
SeEn10 LDA ScreenLo+4,Y
LDX ScreenHi+4,Y
ORA #1
STA EntryLo,Y
PHA
TXA
STA EntryHi,Y
PLA
CLC
ADC #40
STA EntryLo+EntriesPerPage,Y
BCC SeEn20
INX
SeEn20 TXA
STA EntryHi+EntriesPerPage,Y
INY
CPY #EntriesPerPage
BCC SeEn10
RTS
; ********
HorLine
; ********
; Draw a horizontal line
; (X) = Row
; (Y) = Start column
; Count = Last column + 1
CLC
LDA ScreenLo,X
ADC Offset
STA SP
LDA ScreenHi,X
ADC #0
STA SP+1
LDA #HOR_BAR
HoLi10 STA (SP),Y
INY
CPY Count
BCC HoLi10
RTS
; ********
VerLine
; ********
; Draw a vertical line
; (Y) = Column
; (X) = Start row
; Count = Last row + 1
CLC
TYA
ADC Offset
TAY
VeLi10 LDA ScreenLo,X
STA SP
LDA ScreenHi,X
STA SP+1
LDA #VER_BAR
STA (SP),Y
INX
CPX Count
BCC VeLi10
RTS
; ******
GotoXY
; ******
STX CursorRow
STY CursorCol
RTS
; *******
PutChar
; *******
PHA ; A = Char
LDX CursorRow
CLC
LDA ScreenLo,X
ADC CursorCol
STA SP
LDA ScreenHi,X
ADC #0
STA SP+1
PLA
LDY #0
STA (SP),Y
INC CursorCol
RTS
; ********
PutCharR
; ********
PHA ; A = Char
LDX CursorRow
CLC
LDA ScreenLo,X
ADC CursorCol
STA SP
LDA ScreenHi,X
ADC #0
STA SP+1
PLA
LDY #0
JSR PET2SCR
ORA Reverse
STA (SP),Y
INC CursorCol
RTS
; *********
PutString
; *********
STX STRPTR
STY STRPTR+1
LDY #0
LDA (STRPTR),Y
BEQ PuSt99
JSR PET2SCR
JSR PutCharR
PuSt10 INY
CPY #80
BCS PuSt99 ; safety exit
LDA (STRPTR),Y
BEQ PuSt99
JSR PET2SCR
ORA Reverse
STA (SP),Y
INC CursorCol
BNE PuSt10
PuSt99 RTS
; ******
PlotAt
; ******
PHA ; X = Row
CLC ; Y = Col
TYA ; A = Char
ADC Offset
TAY
LDA ScreenLo,X
STA SP
LDA ScreenHi,X
STA SP+1
PLA
STA (SP),Y
RTS
; *******
PlotAtR
; *******
PHA ; X = Row
CLC ; Y = Col
TYA ; A = Char
ADC Offset
TAY
LDA ScreenLo,X
STA SP
LDA ScreenHi,X
STA SP+1
PLA
ORA Reverse
STA (SP),Y
RTS
; *********
PaintPage
; *********
LDX #39
STX Count
LDX #1
LDY #1
JSR HorLine
LDX #3
LDY #1
JSR HorLine
LDX #24
LDY #1
JSR HorLine
LDX #24
STX Count
LDX #1
LDY #0
JSR VerLine
LDX #1
LDY #39
JSR VerLine
MAC_Plot( 1, 0,UL)
MAC_Plot( 1,39,UR)
MAC_Plot(24, 0,LL)
MAC_Plot(24,39,LR)
MAC_Plot( 3, 0,TL)
MAC_Plot( 3,39,TR)
RTS
; *********
PaintMask
; *********
LDA #142 ; Screen Mode
JSR BSOUT
LDA #CLR
JSR BSOUT ; clear screen
JSR BSOUT ; amd remove window settings
LDA #14
STA $e84c ; text char set
LDA Pages
STA Page
LDA #0
STA Offset
PaMa10 JSR PaintPage
CLC
LDA Offset
ADC #40
STA Offset
DEC Page
BNE PaMa10
LDA #0
STA Offset
MAC_PutString(2,1,UnitText)
MAC_PutString(2,9,DriveText)
LDA #$80
STA Reverse
MAC_PutString(0,19,ProgramText)
LDA #0
STA Reverse
MAC_PutString(0,69,HelpText)
RTS
; *************
GetDiskStatus
; *************
LDA Unit
STA FA
JSR TALK
LDA #$6f
JSR TKSA
LDY #0
gss_10 JSR ACPTR
CMP #' '
BCC gss_20
JSR PET2SCR
STA DiskStatus,Y
INY
CPY #40
BCC gss_10
gss_20 JSR UNTLK
RTS
; *************
LoadDirectory
; *************
LDA #<Buffer ; Initialize buffer pointer BP
STA BP ; and End Of Directory EOD
STA EOD
LDA #$20
STA SOD
LDA #>Buffer
STA BP+1
STA EOD+1
STA SOD+1
LDY #0
TYA
LoDi05 STA Buffer,Y
INY
BNE LoDi05
LDA Unit ; Send LOAD "$n" to Unit
STA FA
JSR LISTEN
LDA #$f0
JSR SECOND
LDA #'$'
JSR CIOUT
LDA Drive
JSR CIOUT
JSR UNLSN
JSR GetDiskStatus
LDA DiskStatus
CMP #'0'
BNE LoDi99
JSR TALK
LDA #$60
JSR TKSA
LDA #$bd
AND STATUS
STA STATUS
LDY #0
LoDi10 JSR ACPTR
STA (BP),Y
BIT STATUS
BVS LoDi20
INY
BNE LoDi10
INC BP+1
BPL LoDi10
LoDi20 JSR UNTLK
STY EOD
LDA BP+1
STA EOD+1
LoDi99 JMP Close_Disk_File
; **************
GetLoadAddress
; **************
LDY #$1e
LDA #0
STA (BP),Y ; new end of string
LDY #$16 ; position of file type
LDA (BP),Y
CMP #'P' ; PRG files only
BNE GLA99
LDA Unit ; send LOAD "Filename" to Unit
STA FA
JSR LISTEN
LDA #$f0
JSR SECOND
LDY #4 ; start of ilename
GLA10 LDA (BP),Y
CMP #$22 ; quote marks end of filename
BEQ GLA20
JSR CIOUT
INY
CPY #20
BCC GLA10
GLA20 JSR UNLSN
JSR GetDiskStatus
LDA DiskStatus
CMP #'0'
BNE GLA99
JSR TALK
LDA #$60
JSR TKSA
JSR ACPTR
JSR ASCII_Hex
LDY #$1d ; load address low
STA (BP),Y
DEY
TXA
STA (BP),Y
JSR ACPTR
JSR ASCII_Hex
DEY ; load address high
STA (BP),Y
DEY
TXA
STA (BP),Y
JSR UNTLK
GLA99 JMP Close_Disk_File
; **********
ASCII_Hex
; **********
; Input: (A)
; Output: (X) = High nibble (A) = Low nibble
PHA
LSR A
LSR A
LSR A
LSR A
ORA #'0'
CMP #$3a
BCC Hex_11
ADC #6
Hex_11 TAX
PLA
AND #15
ORA #'0'
CMP #$3a
BCC Hex_12
ADC #6
Hex_12 RTS
; *********
Load_File
; *********
JSR Send_Filename
JSR TALK ; send primary address
LDA #$60
JSR TKSA ; send secondary address
JSR ACPTR ; read first byte
TAY ; flash start address
LDA STATUS ; check time out bit
BEQ LoFi_22 ; no time out -> continue
; JMP Display_File_Not_Found
LoFi_22 JSR ACPTR
STA EAL+1 ; flash start address
LDA #0
STA EAL
STA STATUS
LoFi_30 JSR ACPTR ; read next byte
STA (EAL),Y ; store byte
LoFi_40 LDA (EAL),Y ; this comparison is false for an
CMP (EAL),Y ; unfinished write cycle to EEPROM
BNE LoFi_40
INY ; increment write address
BNE LoFi_60
INC EAL+1
LoFi_60 LDA STATUS ; Get EOF marker in bit 6
BEQ LoFi_30 ; repeat until EOF or ERROR
STY EAL ; store end address+1 in EAL
JSR UNTLK
; ***************
Close_Disk_File
; ***************
JSR LISTEN
LDA #$e0
JSR SECOND
JMP UNLSN
; *************
Send_Filename
; *************
JSR LISTEN
LDA #$f0
JSR SECOND
LDY #0
SeFi_10 LDA (FNADR),Y
JSR CIOUT
INY
CPY FNLEN
BCC SeFi_10
SeFi_20 JMP UNLSN
; **************
Setup_Filename
; **************
CLC
LDA SelPtr
ADC #4
STA TP
LDA SelPtr+1
ADC #0
STA TP+1
LDY #0
SpFi_10 LDA (TP),Y
CMP #$22
BEQ SpFi_20
STA DOS_Filename,Y
INY
CPY #16
BCC SpFi_10
SpFi_20 STY FNLEN
LDA #<DOS_Filename
STA FNADR
LDA #>DOS_Filename
STA FNADR+1
RTS
; *****
Flash
; *****
JSR Setup_Filename
JSR Load_File
; JSR Verify_File
RTS
EOP ; END-OF-PROGRAM
| 19.461379 | 71 | 0.410964 |
ac2622cb4dd863ab229c5e197ed0bebfa3e5c527 | 108 | asm | Assembly | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/dge.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/dge.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/math/float/math48/lm/c/sccz80/dge.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
SECTION code_fp_math48
PUBLIC dge
EXTERN cm48_sccz80p_dge
defc dge = cm48_sccz80p_dge
| 10.8 | 27 | 0.842593 |
15f6b7e13aaf67f86710749ec7e40eb24dc31762 | 551 | asm | Assembly | oeis/016/A016889.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/016/A016889.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/016/A016889.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A016889: (5n+3)^5.
; 243,32768,371293,1889568,6436343,17210368,39135393,79235168,147008443,254803968,418195493,656356768,992436543,1453933568,2073071593,2887174368,3939040643,5277319168,6956883693,9039207968,11592740743,14693280768,18424351793,22877577568,28153056843,34359738368,41615795893,50049003168,59797108943,71008211968,83841135993,98465804768,115063617043,133827821568,154963892093,178689902368,205236901143,234849287168,267785184193,304316815968,344730881243,389328928768,438427732293,492359665568,551473077343
mul $0,5
add $0,3
pow $0,5
| 78.714286 | 501 | 0.872958 |
d39aa5f9b59c0764a49adf85290dc6e3cd102132 | 419 | asm | Assembly | src/skeleton_sound_engine_vars.6502.asm | mrpopogod/nes-fun | 80e6af809874f2de89bd52f05f04c451dc29b333 | [
"MIT"
] | null | null | null | src/skeleton_sound_engine_vars.6502.asm | mrpopogod/nes-fun | 80e6af809874f2de89bd52f05f04c451dc29b333 | [
"MIT"
] | null | null | null | src/skeleton_sound_engine_vars.6502.asm | mrpopogod/nes-fun | 80e6af809874f2de89bd52f05f04c451dc29b333 | [
"MIT"
] | null | null | null | .org $0300 ;sound engine variables will be on the $0300 page of RAM
sound_disable_flag .ds 1 ;a flag variable that keeps track of whether the sound engine is disabled or not.
sound_frame_counter .ds 1 ;a primitive counter used to time notes in this demo
sfx_playing .ds 1 ;a flag that tells us if our sound is playing or not.
sfx_index .ds 1 ;our current position in the sound data. | 69.833333 | 110 | 0.713604 |
dbee0c0c85a7c7ab03708b70fc317bc52b0094e4 | 394 | asm | Assembly | wof/lcs/123p/61.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | wof/lcs/123p/61.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | wof/lcs/123p/61.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
0017DC rts [123p+ 61, enemy+61]
007E90 blt $7ec4 [123p+ 61, enemy+61]
007E9E move.b D0, ($61,A1)
007EA2 moveq #$3, D0
007F2A move.b D5, ($61,A1)
007F2E move.b D0, ($99,A1)
011C7C move.b D0, ($61,A0)
011C80 moveq #$4, D2
01AA84 tst.b ($78,A0) [123p+ 61]
copyright zengfr site:http://github.com/zengfr/romhack
| 28.142857 | 54 | 0.64467 |
226dfd98cdbe1b57684f4c388929b8a7ccae84ab | 1,159 | asm | Assembly | programs/oeis/017/A017750.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/017/A017750.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/017/A017750.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A017750: Binomial coefficients C(n,86).
; 1,87,3828,113564,2555190,46504458,713068356,9473622444,111315063717,1174992339235,11279926456656,99468442390512,812325612855848,6186171974825304,44186942677323600,297525414027312240,1896724514424115530,11491919116804935270,66397754897095181560,366934961273420740200,1944755294749129923060,9908991263721757227020,48644138930997717296280,230530919281684834143240,1056600046707722156489850,4691304207382286374814934,20208695047185233614587408,84577131123404866609199152,344349748145291242623167976,1365524863334775617298769560,5280029471561132386888575632,19927853166859757718256882224,73483958552795356586072253201,264987608114625679810381761543,935250381581031811095465040740,3233294176322995689787179140844,10957274708650152059834329310638,36425534842269424415124932573202,118862271590563384933565569449396,380968819200523669658864004645500,1200051780481649559425421614633325,3717233563930963269439720611181275,11328711813884840440197243767409600,33986135441654521320591731302228800,100413581986706540265384660665676000,292315094227967928328119789937856800,838817226915038403028517658082545600
add $0,86
bin $0,86
| 193.166667 | 1,095 | 0.940466 |
f777ccdd842c274c19ae4d5c90d52edf6aea1a2b | 5,377 | asm | Assembly | Transynther/x86/_processed/NONE/_zr_xt_/i9-9900K_12_0xa0_notsx.log_21829_1961.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_zr_xt_/i9-9900K_12_0xa0_notsx.log_21829_1961.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_zr_xt_/i9-9900K_12_0xa0_notsx.log_21829_1961.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r14
push %r15
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x1a9d8, %rsi
nop
nop
xor %r9, %r9
movb (%rsi), %r11b
nop
add %r15, %r15
lea addresses_WC_ht+0x434a, %rbx
nop
inc %r14
movb (%rbx), %r15b
nop
nop
nop
add $54183, %r14
lea addresses_UC_ht+0x1298, %r15
nop
cmp $60087, %rdi
movb $0x61, (%r15)
dec %rsi
lea addresses_A_ht+0xe918, %r9
clflush (%r9)
nop
nop
xor $36033, %r14
mov $0x6162636465666768, %rdi
movq %rdi, %xmm7
vmovups %ymm7, (%r9)
nop
nop
nop
nop
dec %rdi
lea addresses_A_ht+0x178c0, %rsi
lea addresses_D_ht+0x13680, %rdi
nop
cmp $36374, %rbx
mov $11, %rcx
rep movsb
nop
nop
nop
nop
xor %r15, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r15
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %rax
push %rbp
push %rsi
// Store
lea addresses_UC+0x1e98, %rsi
nop
nop
nop
nop
nop
xor %r13, %r13
movb $0x51, (%rsi)
nop
nop
nop
nop
sub %r12, %r12
// Faulty Load
lea addresses_A+0x3a98, %rbp
nop
nop
nop
cmp %r14, %r14
vmovups (%rbp), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %r12
lea oracles, %rbp
and $0xff, %r12
shlq $12, %r12
mov (%rbp,%r12,1), %r12
pop %rsi
pop %rbp
pop %rax
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_A', 'AVXalign': True, 'size': 16, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 9}}
[Faulty Load]
{'src': {'type': 'addresses_A', 'AVXalign': False, 'size': 32, 'NT': False, 'same': True, 'congruent': 0}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 6}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 0}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'size': 1, 'NT': False, 'same': False, 'congruent': 11}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'size': 32, 'NT': False, 'same': False, 'congruent': 7}}
{'src': {'type': 'addresses_A_ht', 'congruent': 1, 'same': True}, 'OP': 'REPM', 'dst': {'type': 'addresses_D_ht', 'congruent': 2, 'same': False}}
{'35': 21828, '00': 1}
00 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35
*/
| 42.674603 | 2,999 | 0.657058 |
764e75f2d187565828afdd3b3910800bf56db707 | 12,351 | asm | Assembly | routines/drawField.asm | jacobly0/Age-Of-CEmpires-I | 9cd54b9899f0bc5bbf6e0bf1d02306b187034384 | [
"MIT"
] | null | null | null | routines/drawField.asm | jacobly0/Age-Of-CEmpires-I | 9cd54b9899f0bc5bbf6e0bf1d02306b187034384 | [
"MIT"
] | null | null | null | routines/drawField.asm | jacobly0/Age-Of-CEmpires-I | 9cd54b9899f0bc5bbf6e0bf1d02306b187034384 | [
"MIT"
] | null | null | null | relocate DrawField, cursorImage, 1024
DrawField:
DrawIsometricTile.copy
ld b, (OFFSET_X) ; We start with the shadow registers active
bit 4, b
ld a, TILE_WIDTH / 2
ld c, jr_z
jr z, .jump1
neg
ld c, jr_nz
.jump1: ld (TopRowLeftOrRight), a
ld a, c
ld (IncrementRowXOrNot1), a
ld hl, DrawIsometricTile
ld (TileDrawingRoutinePtr1), hl
ld (TileDrawingRoutinePtr2), hl
ld hl, TilePointersEnd - 3
ld (TilePointersSMC), hl
ld hl, add_iy_sp_lea_de_iy
ld (DrawTile_Clipped_Stop1), hl
ld (DrawTile_Clipped_Stop2), hl
ld (DrawTile_Clipped_Stop3), hl
ld e, (OFFSET_Y)
ld d, 10
xor a, a
bit 3, e
jr z, .jump2
inc d
ld a, dec_c
.jump2: ld (TileWhichAction), a ; Write "dec c" or "nop"
ld a, d
ld (TileHowManyRowsClipped), a
bit 2, e
ld hl, DrawTile_Clipped_Stop2
ld d, StopDrawingTile - DrawTile_Clipped_Stop2 - 2
jr z, .jump3
ld hl, DrawTile_Clipped_Stop3
ld (hl), jr_
inc hl
ld (hl), StopDrawingTile - DrawTile_Clipped_Stop3 - 2
ld hl, DrawTile_Clipped_Stop1
ld d, StopDrawingTile - DrawTile_Clipped_Stop1 - 2
.jump3: ld (DrawTile_Clipped_SetJRSMC), hl
ld hl, DrawTile_Clipped_SetJRStop
ld (hl), jr_
inc hl
ld (hl), d
set 4, e ; Point to the row of the bottom right pixel
ld d, lcdWidth / 2
mlt de
ld a, b
sub a, TILE_WIDTH * 2 - (TILE_WIDTH / 2 - 1) ; We start at column 17 (bottom right pixel), but 2 tiles to the left
sbc hl, hl
ld l, a
add hl, de
add hl, de
ld de, (currDrawingBuffer)
add hl, de
ld (startingPosition), hl
ld ix, (TopLeftYTile)
lea ix, ix + 2 ; Remember the 2 columns at the left
lea hl, ix ; Y * MAP_SIZE + X, point to the map data
add hl, hl
add hl, hl
add hl, hl
add hl, hl
add hl, hl
add hl, hl
add hl, hl
ld de, (TopLeftXTile)
dec de ; Remember the 2 columns at the left
dec de
add hl, de
add hl, hl ; Each tile is 2 bytes worth
ld bc, (MapDataPtr)
add hl, bc
ld a, AMOUNT_OF_ROWS ; Last X rows only trees/buildings
exx
DisplayEachRowLoopExx:
exx
DisplayEachRowLoop: ; Display X rows
; Registers:
; BC = length of row tile
; DE = pointer to output
; HL = pointer to tile/black tile
; A' = row index
; B' = column index
; BC' = amount of tiles to be added when changing row
; DE' = x index tile
; HL' = pointer to map data
; IX = y index tile
; IY = pointer to output
; SP = -SCREEN_WIDTH + offset
startingPosition = $+2 ; Here are the shadow registers active
ld iy, 0 ; Advance to the next row
ld bc, (TILE_HEIGHT / 2) * lcdWidth
add iy, bc
ld (startingPosition), iy
bit 0, a ; Check if we need to add half a tile to it
jr nz, NoOffsetAtStart
TopRowLeftOrRight = $+2
lea iy, iy + 0
NoOffsetAtStart:
ex af, af'
ld a, AMOUNT_OF_COLUMNS
ld bc, (-MAP_SIZE + 1) * 2 ; How much to advance to the next row in the map
DisplayTile: ; Display X tiles in a row
ld b, a ; Check if we only need to display buildings (at the left/right)
cp a, AMOUNT_OF_COLUMNS - 1
jr nc, TileOnlyDisplayBuilding
cp a, 3
jr c, TileOnlyDisplayBuilding
ld a, e ; Check out of field: DE and IX < MAP_SIZE
or a, ixl
add a, a
sbc a, a
or a, d
or a, ixh
jr nz, TileIsOutOfField
or a, (hl) ; Tile index
jp z, SkipDrawingOfTile ; Tile is part of a building, which will be overwritten later
exx ; Here are the main registers active
ld c, a ; Get the pointer to the tile
ld b, 3
mlt bc
TilePointersSMC = $+1
ld hl, TilePointersEnd - 3 ; The clipped tiles needs different pointers, so this pointer will be modified after X rows
add hl, bc
ld hl, (hl)
cp a, TILE_TREE ; Check if it's a tile (with unit)
TileDrawingRoutinePtr1 = $+1
jp c, DrawIsometricTile ; This will be modified to the clipped version after X rows
sub a, TILE_BUILDING
jr c, DisplayTileWithTree ; It's a tree
jp DisplayBuilding ; It's a building
TileIsOutOfField:
xor a, a ; Reset A otherwise it might think that it was a tile with unit(s)
exx
ld hl, blackBuffer
TileDrawingRoutinePtr2 = $+1
jp DrawIsometricTile ; This will be modified to the clipped version after X rows
TileOnlyDisplayBuilding:
ld a, e ; Check if out of field
or a, ixl
add a, a
sbc a, a
or a, d
or a, ixh
jp nz, SkipDrawingOfTile
ld a, (hl)
sub a, TILE_BUILDING ; Check if it's a building
jp c, SkipDrawingOfTile
jp DisplayBuildingExx
DisplayTileWithTree:
; Inputs:
; A' = row index
; B' = column index
; HL = pointer to tree sprite
; Y coordinate: A' * 8 + 17 - tree_height
; X coordinate: B' * 32 + !(A' & 0) && ((B' & 1 << 4) ? -16 : 16)
ld (BackupIY2), iy ; Backup IY, it's quite useful
ld iy, iy_base
TempSP3 = $+1
ld sp, 0
push hl ; Sprite struct
ex af, af'
ld c, a ; C = row index
ex af, af'
ld a, AMOUNT_OF_ROWS + 1
sub a, c
ld e, a
ld d, TILE_HEIGHT / 2 / 2
mlt de
inc hl
ld a, (hl)
ld hl, 17
add hl, de
add hl, de
ld e, (OFFSET_Y)
add hl, de
ld e, a
sbc hl, de
push hl ; Y coordinate
ld a, AMOUNT_OF_COLUMNS - 2
exx
sub a, b ; B' = column index
exx
ld l, a
ld h, TILE_WIDTH
mlt hl
ld e, (OFFSET_X)
add hl, de
bit 0, c
jr nz, .jump
bit 4, e
ld e, TILE_WIDTH / 2
add hl, de
jr z, .jump
sla e
sbc hl, de
jr z, DontDisplayTree ; If X offset 0, and the tree is at the most left column, it's fully offscreen
.jump: push hl ; X coordinate
call _RLETSprite ; No need to pop
DontDisplayTree:
ld iy, 0
BackupIY2 = $-3
jp SkipDrawingOfTileExx
DrawIsometricTileSecondPart:
lddr
ld c, 30
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
inc sp
inc sp
ld c, 30
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
inc sp
inc sp
ld c, 26
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
ld c, 22
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
ld c, 18
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
ld c, 14
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
ld c, 10
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
ld c, 6
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
ld c, 2
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
cp a, TILE_UNIT_GRASS
jr nc, DisplayUnits
SkipDrawingOfTileExx:
exx
SkipDrawingOfTile:
lea iy, iy + TILE_WIDTH ; Advance to next tile
inc de ; Next X index in map
dec ix ; Previous Y index in map
ld a, b
ld b, 255 ; BCU and C still holds (-MAP_SIZE + 1) * 2)
add hl, bc ; Advance to the next tile in the map data
dec a
jp nz, DisplayTile ; Display all the tiles in the row
ex af, af'
IncrementRowXOrNot1 = $
jr nz, NoExtraColumnChange ; The zero flag is still set/reset from the "bit 0, a"
inc de ; Advance an extra diagonal tile
dec ix
add hl, bc
NoExtraColumnChange:
ex de, hl
ld c, -AMOUNT_OF_COLUMNS ; Advance to the next row tiles
add hl, bc
ex de, hl
ld bc, (MAP_SIZE * (AMOUNT_OF_COLUMNS + 1) - AMOUNT_OF_COLUMNS) * 2
add hl, bc
lea ix, ix + AMOUNT_OF_COLUMNS + 1
TileHowManyRowsClipped = $+1 ; Check if we need an extra routine to set the clipped tiles
cp a, 0
dec a
jp nc, DisplayEachRowLoop
exx
ld c, a ; Get the routine
TileWhichAction = $
nop ; Can be SMC'd into a "dec c"
ld b, 3
mlt bc
ld hl, FieldRowActionTable
add hl, bc
ld hl, (hl)
jp (hl) ; And jump to it
DisplayUnits:
; Display them units!
ld (BackupIY4), iy
;ld iy, iy_base
TempSP5 = $+1
ld sp, 0
;ld e, 5 ; Amount of units at the tile
;exx
;inc hl
;ld a, (hl) ; Unit index
;dec hl
;exx
;ld hl, UnitsPerTile
FindNextUnit:
;ld c, a
;ld b, SIZEOF_UNIT_STRUCT
;mlt bc
;ld iy, (UnitsStackPtr)
;add iy, bc
;ld bc, (iy + UnitOffsetX - 1)
;ld c, a
;ld (hl), bc
;inc hl
;inc hl
;inc hl
;ld a, (iy + UnitNext)
;inc a
;jr z, DisplayUnitsAtTile
;dec a
;dec e
;jr nz, FindNextUnit
DisplayUnitsAtTile:
BackupIY4 = $+2
ld iy, 0
jr SkipDrawingOfTileExx
SetClippedRoutine:
ld hl, DrawTile_Clipped ; Set the clipped routine
ld (TileDrawingRoutinePtr1), hl
ld (TileDrawingRoutinePtr2), hl
ld hl, (startingPosition) ; The starting position is now different
ld bc, -lcdWidth * (TILE_HEIGHT - 1) - 1 ; -1 because we start at the left pixel of the top row, not the right one
add hl, bc
ld (startingPosition), hl
ld hl, TilePointersStart - 3 ; Also use different pointers for displaying tiles
ld (TilePointersSMC), hl
jp DisplayEachRowLoopExx
SetClippedRoutine2:
DrawTile_Clipped_SetJRStop = $+1
ld hl, 0 ; Insert a JR X in the clipped tile routine
DrawTile_Clipped_SetJRSMC = $+1
ld (0), hl
jp DisplayEachRowLoopExx
SetOnlyTreesRoutine:
ld hl, SkipDrawingOfTileExx ; Normal tiles shouldn't be displayed anymore
ld (TileDrawingRoutinePtr1), hl
ld (TileDrawingRoutinePtr2), hl
jp DisplayEachRowLoopExx
StopDisplayTiles:
ld de, mpShaData ; Copy routine to mpShaData
ld hl, DrawScreenBorderStart
ld bc, DrawScreenBorderEnd - DrawScreenBorderStart
ldir
ld de, (currDrawingBuffer) ; Display food, wood, stone etc placeholder
ld hl, resources_offset
ld bc, resources_width * resources_height
ldir
ld hl, blackBuffer ; Display the right and left black edge
ld b, (lcdWidth * 13 + TILE_WIDTH) shr 8
jp mpShaData
DrawScreenBorderStart:
ld c, (lcdWidth * 13 + TILE_WIDTH) and 255
ldir
ex de, hl ; Fill the edges with black; 21 pushes = 21*3=63+1 = 64 bytes, so 32 bytes on each side
ld a, lcdHeight - 15 - 13 - 1
ld de, lcdWidth ; Used to advance to the next 'half-row'
dec hl
FillBorderLoop:
add hl, de
ld (hl), c
ld sp, hl
push bc ; Fill with black using pushes (bc = 0, writes 3 bytes at the same time)
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
dec a
jr nz, FillBorderLoop
ld de, lcdWidth - TILE_WIDTH + 2
add hl, de ; Clear the last row of the right edge
ld sp, hl
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
push bc
TempSP2 = $+1
ld sp, 0 ; Yay, we are finally done!
ret
DrawScreenBorderEnd:
DrawTile_Clipped:
ld (BackupIY), iy
ld sp, lcdWidth
lea de, iy
ld bc, 2
ldir
add iy, sp
lea de, iy-2
ld c, 6
ldir
add iy, sp
lea de, iy-4
ld c, 10
ldir
DrawTile_Clipped_Stop1 = $
add iy, sp
lea de, iy-6
ld c, 14
ldir
add iy, sp
lea de, iy-8
ld c, 18
ldir
add iy, sp
lea de, iy-10
ld c, 22
ldir
add iy, sp
lea de, iy-12
ld c, 26
ldir
DrawTile_Clipped_Stop2 = $
add iy, sp
lea de, iy-14
ld c, 30
ldir
add iy, sp
lea de, iy-14
ld c, 30
ldir
add iy, sp
lea de, iy-12
ld c, 26
ldir
add iy, sp
lea de, iy-10
ld c, 22
ldir
DrawTile_Clipped_Stop3 = $
add iy, sp
lea de, iy-8
ld c, 18
ldir
add iy, sp
lea de, iy-6
ld c, 14
ldir
add iy, sp
lea de, iy-4
ld c, 10
ldir
add iy, sp
lea de, iy-2
ld c, 6
ldir
StopDrawingTile:
ld iy, 0
BackupIY = $-3
exx
jp SkipDrawingOfTile
end relocate
relocate DrawIsometricTile, mpShaData, 64
DrawIsometricTile:
ld sp, -lcdWidth - 2
lea de, iy
ld bc, 2
lddr
ld c, 6
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
ld c, 10
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
ld c, 14
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
ld c, 18
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
ld c, 22
ex de, hl
add hl, sp
add hl, bc
ex de, hl
lddr
ld c, 26
ex de, hl
add hl, sp
add hl, bc
ex de, hl
jp DrawIsometricTileSecondPart
end relocate
DisplayBuildingExx:
exx
DisplayBuilding:
; Inputs:
; A' = row index
; B' = column index
; A = building index
; Y coordinate: A' * 8 + 17 - building_height
; X coordinate: B' * 32 + !(A' & 0) && ((B' & 1 << 4) ? -16 : 16) - (building_width - 30) / 2
ld c, a
ld b, 3
mlt bc
BuildingsTablePointer = $+1 ; Yay, ages! :D
ld hl, BuildingsAge1
add hl, bc
ld hl, (hl)
ld b, (hl)
ld (BackupIY3), iy
ld iy, iy_base
TempSP4 = $+1
ld sp, 0
push hl ; Sprite struct
ex af, af'
ld c, a ; C = row index
ex af, af'
ld a, AMOUNT_OF_ROWS + 1
sub a, c
ld e, a
ld d, TILE_HEIGHT / 2 / 2
mlt de
inc hl
ld a, (hl)
ld hl, 17
add hl, de
add hl, de
ld e, (OFFSET_Y)
add hl, de
ld e, a
sbc hl, de
push hl ; Y coordinate
ld a, AMOUNT_OF_COLUMNS - 2
exx
sub a, b
exx
sbc hl, hl
ld l, a
add hl, hl
add hl, hl
add hl, hl
add hl, hl
add hl, hl
ld e, (OFFSET_X)
add hl, de
ld a, b
bit 0, c
jr nz, .jump
bit 4, e
ld e, TILE_WIDTH / 2
add hl, de
jr z, .jump
sla e
sbc hl, de
.jump: sub a, 30
srl a
ld e, a
sbc hl, de
push hl ; X coordinate
call _RLETSprite ; No need to pop
BackupIY3 = $+2
ld iy, 0
jp SkipDrawingOfTileExx
| 19.328638 | 119 | 0.668367 |
282ad8c27157452286fb459031f222c4de0671e9 | 1,202 | asm | Assembly | programs/oeis/206/A206248.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/206/A206248.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/206/A206248.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A206248: Number of (n+1) X 2 0..3 arrays with every 2 X 2 subblock having zero permanent.
; 49,361,1600,9409,47089,258064,1343281,7198489,37945600,201895681,1068570721,5672499856,30061664689,159465247561,845443470400,4483691905729,23774527583569,126075439502224,668536407557041,3545138659498489,18798954662118400,99686999558415361,528616710372623041,2803139060314279696,14864407777651380529,78822648654316056361,417978733320595240000,2216447707137586362049,11753324114730954806449,62325243144918784090384,330496773863731762263601,1752550262096216678364889,9293380769836840690182400,49280713330181205319991041,261324565482169059246300961,1385745541105256002190171536,7348297690292160176076539569,38966373986413148130938090761,206629938619316602577536206400,1095712204676335863127335346369,5810315984503987683904447411729,30810802051410432823552336230544,163382770493428515196624659510961,866382175009031587203706592693689,4594230290569186844938409206681600,24362172459062556515889250132254721,129187134597836615348317833006468481,685050390054729094770605285032527376
add $0,2
seq $0,208558 ; Number of 6 X n 0..1 arrays avoiding 0 0 0 and 0 0 1 horizontally and 0 0 1 and 0 1 1 vertically.
div $0,16
| 171.714286 | 975 | 0.900998 |
b20025ce4312fbdbfaecd4323592958eaba6e65c | 278 | asm | Assembly | programs/oeis/128/A128615.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/128/A128615.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/128/A128615.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A128615: Expansion of x/(1+x+x^2-x^3-x^4-x^5).
; 0,1,-1,0,2,-2,0,3,-3,0,4,-4,0,5,-5,0,6,-6,0,7,-7,0,8,-8,0,9,-9,0,10,-10,0,11,-11,0,12,-12,0,13,-13,0,14,-14,0,15,-15,0,16,-16,0,17,-17,0,18,-18,0,19,-19
mov $1,$0
lpb $0,1
sub $0,3
sub $1,1
lpe
add $1,1
mul $1,$0
div $1,2
| 23.166667 | 154 | 0.517986 |
7b70a9f59f61979987aeb7a6787586b3ba20e68b | 666 | asm | Assembly | src/start.asm | llGuy/lGkn | a4ae1bafa50b73b7dc497094287e0939c9c29afc | [
"MIT"
] | 1 | 2021-04-04T22:36:32.000Z | 2021-04-04T22:36:32.000Z | src/start.asm | llGuy/lGkn | a4ae1bafa50b73b7dc497094287e0939c9c29afc | [
"MIT"
] | null | null | null | src/start.asm | llGuy/lGkn | a4ae1bafa50b73b7dc497094287e0939c9c29afc | [
"MIT"
] | null | null | null | ;; 32-bit mode
bits 32
MBOOT_HEADER_MAGIC equ 0xe85250d6
MBOOT_I386_ARCHITECTURE equ 0
extern kernel_main
extern stack_top
global start
section .multiboot
mboot_start:
;; Magic number
dd MBOOT_HEADER_MAGIC
;; Architecture (protected mode i386)
dd MBOOT_I386_ARCHITECTURE
;; Header length
dd mboot_end - mboot_start
;; Checksum
dd 0x100000000 - (MBOOT_HEADER_MAGIC + MBOOT_I386_ARCHITECTURE + (mboot_end - mboot_start))
;; End tag
dw 0
dw 0
dd 8
mboot_end:
section .text
start:
push ebx
mov esp, stack_top
cli ; Clear interrupts
call kernel_main
jmp $
| 15.488372 | 95 | 0.663664 |
39f3abcbc1bf2511abc90ffcfee422cd50d2da45 | 19,099 | asm | Assembly | asg/asm/rdmurmur2.asm | asgkafka/librdkafka | d0a14ca313ed1efafb3924ff33fb6c4d474efe3c | [
"BSD-2-Clause-NetBSD",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | asg/asm/rdmurmur2.asm | asgkafka/librdkafka | d0a14ca313ed1efafb3924ff33fb6c4d474efe3c | [
"BSD-2-Clause-NetBSD",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | asg/asm/rdmurmur2.asm | asgkafka/librdkafka | d0a14ca313ed1efafb3924ff33fb6c4d474efe3c | [
"BSD-2-Clause-NetBSD",
"Zlib",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | 1 | 2021-05-05T11:49:00.000Z | 2021-05-05T11:49:00.000Z | *PROCESS DUPALIAS
*
* Compiled by DCC Version 2.25.07 Mar 6 2021 08:51:07
* on Fri Apr 30 15:36:20 2021
*
WXTRN @@ZARCH#
*
*
*
* Code Section
*
@CODE ALIAS C'@RDMURMUR2'
@CODE CSECT
@CODE AMODE ANY
@CODE RMODE ANY
@DATA ALIAS C'@rdmurmur2'
fprintf ALIAS C'fprintf'
EXTRN fprintf
__assert ALIAS C'@@ASSERT'
EXTRN __assert
__stderrp ALIAS C'@@STDERP'
__stderrp DXD 0F
rd_unittest_assert_on_failure ALIAS X'99846DA49589A3A385A2A36D81A2A2859*
9A36D96956D86818993A49985'
rd_unittest_assert_on_failure DXD 0F
*
*
*
* ....... start of rd_murmur2
rd_murmur2 ALIAS X'99846D94A49994A499F2'
@LNAME760 DS 0H
DC X'0000000A'
DC C'rd_murmur2'
DC X'00'
rd_murmur2 DCCPRLG CINDEX=760,BASER=12,FRAME=176,SAVEAREA=NO,ENTRY=YES,*
ARCH=ZARCH,LNAMEADDR=@LNAME760
* ******* End of Prologue
* *
* *** const uint32_t seed = 0x9747b28c;
LG 15,0(0,1) ; key
LG 1,8(0,1) ; len
IILF 4,X'9747B28C' ; -1756908916
* *** const uint32_t m = 0x5bd1e995;
IILF 2,X'5BD1E995' ; 1540483477
* *** const int r = 24;
LHI 3,24 ; 24
* *** uint32_t h = seed ^ (uint32_t)len;
XR 4,1
* *** const unsigned char *tail;
* ***
* *** if (((((intptr_t)key & 0x3) == 0))) {
LGR 5,15
NG 5,@lit_760_3
LTGR 5,5
BNE @L44
* ***
* *** const uint32_t *data = (const uint32_t *)key;
* ***
* *** while (len >= 4) {
B @L48
DS 0D
@lit_760_3 DC FD'3' 0x0000000000000003
@L47 DS 0H
* *** uint32_t k = __builtin_bswap32(*(uint3\
* 2_t *)data);
LRV 5,0(0,15)
* ***
* *** { k *= m; k ^= k >> r; k *= m; h *= m;\
* h ^= k; };
MSR 5,2
LR 6,5
SRL 6,0(3)
XR 5,6
MSR 5,2
MSR 4,2
XR 4,5
* ***
* *** data++;
LA 15,4(0,15)
* *** len -= 4;
AGHI 1,-4
* *** }
@L48 DS 0H
CLGFI 1,X'00000004'
BNL @L47
* ***
* *** tail = (const unsigned char *)data;
* ***
* *** } else {
B @L54
@L44 DS 0H
* ***
* *** const unsigned char *data = (const unsigned ch\
* ar *)key;
* ***
* *** while (len >= 4) {
B @L53
@L52 DS 0H
* *** uint32_t k;
* ***
* *** k = data[0];
LLC 5,0(0,15)
* *** k |= data[1] << 8;
LLC 6,1(0,15)
SLL 6,8(0)
OR 5,6
* *** k |= data[2] << 16;
LLC 6,2(0,15)
SLL 6,16(0)
OR 5,6
* *** k |= data[3] << 24;
LLC 6,3(0,15)
SLL 6,24(0)
OR 5,6
* ***
* *** { k *= m; k ^= k >> r; k *= m; h *= m;\
* h ^= k; };
MSR 5,2
LR 6,5
SRL 6,0(3)
XR 5,6
MSR 5,2
MSR 4,2
XR 4,5
* ***
* *** data += 4;
LA 15,4(0,15)
* *** len -= 4;
AGHI 1,-4
* *** }
@L53 DS 0H
CLGFI 1,X'00000004'
BNL @L52
* ***
* *** tail = data;
* *** }
@L49 DS 0H
* ***
* ***
* *** switch(len)
B @L54
* *** {
* *** case 3: h ^= tail[2] << 16;
@L56 DS 0H
LLC 1,2(0,15)
SLL 1,16(0)
XR 4,1
* *** case 2: h ^= tail[1] << 8;
@L57 DS 0H
LLC 1,1(0,15)
SLL 1,8(0)
XR 4,1
* *** case 1: h ^= tail[0];
@L58 DS 0H
LLC 15,0(0,15)
XR 4,15
* *** h *= m;
MSR 4,2
* *** };
B @L55
@L54 DS 0H
CLGFI 1,X'00000001'
BL @L55
CLGFI 1,X'00000001'
BE @L58
CLGFI 1,X'00000002'
BE @L57
CLGFI 1,X'00000003'
BE @L56
@L55 DS 0H
* ***
* *** h ^= h >> 13;
LR 15,4
SRL 15,13(0)
XR 4,15
* *** h *= m;
MSR 4,2
* *** h ^= h >> 15;
LR 15,4
SRL 15,15(0)
XR 4,15
* ***
* ***
* ***
* *** return h;
LLGFR 15,4
* *** }
* * **** Start of Epilogue
DCCEPIL
* * **** End of Epilogue
DROP 12
*
* DSECT for automatic variables in "rd_murmur2"
* (FUNCTION #760)
*
@AUTO#rd_murmur2 DSECT
DS XL168
rd_murmur2#k#5 DS 1F ; k
ORG @AUTO#rd_murmur2+168
rd_murmur2#k#2 DS 1F ; k
ORG @AUTO#rd_murmur2+168
rd_murmur2#h#0 DS 1F ; h
ORG @AUTO#rd_murmur2+168
rd_murmur2#r#0 DS 1F ; r
ORG @AUTO#rd_murmur2+168
rd_murmur2#m#0 DS 1F ; m
ORG @AUTO#rd_murmur2+168
rd_murmur2#seed#0 DS 1F ; seed
*
@CODE CSECT
*
*
*
* ....... start of unittest_murmur2
unittest_murmur2 ALIAS X'A49589A3A385A2A36D94A49994A499F2'
@LNAME761 DS 0H
DC X'00000010'
DC C'unittest_murmur2'
DC X'00'
unittest_murmur2 DCCPRLG CINDEX=761,BASER=12,FRAME=352,ENTRY=YES,ARCH=Z*
ARCH,LNAMEADDR=@LNAME761
DCCPRV REG=4 ; Get PRV from DVT
* ******* End of Prologue
* *
* *** const char *short_unaligned = "1234";
LG 15,@lit_761_4
* *** const char *unaligned = "PreAmbleWillBeRemoved,ThePreP\
* artThatIs";
LA 1,6(0,15)
* *** const char *keysToTest[] = {
* *** "kafka",
LA 2,46(0,15)
STG 2,168(0,13)
* *** "giberish123456789",
LA 2,52(0,15)
STG 2,176(0,13)
* *** short_unaligned,
STG 15,184(0,13)
* *** short_unaligned+1,
LA 2,1(0,15)
STG 2,192(0,13)
* *** short_unaligned+2,
LA 2,2(0,15)
STG 2,200(0,13)
* *** short_unaligned+3,
LA 2,3(0,15)
STG 2,208(0,13)
* *** unaligned,
STG 1,216(0,13)
* *** unaligned+1,
LA 2,1(0,1)
STG 2,224(0,13)
* *** unaligned+2,
LA 2,2(0,1)
STG 2,232(0,13)
* *** unaligned+3,
LA 1,3(0,1)
STG 1,240(0,13)
* *** "",
LA 15,70(0,15)
STG 15,248(0,13)
* *** ((void *)0),
* *** };
* setting 8 bytes to 0x00
XC 256(8,13),256(13)
* ***
* *** const int32_t java_murmur2_results[] = {
* *** 0xd067cf64,
IILF 15,X'D067CF64' ; -798503068
ST 15,264(0,13)
* *** 0x8f552b0c,
IILF 15,X'8F552B0C' ; -1890243828
ST 15,268(0,13)
* *** 0x9fc97b14,
IILF 15,X'9FC97B14' ; -1614185708
ST 15,272(0,13)
* *** 0xe7c009ca,
IILF 15,X'E7C009CA' ; -406844982
ST 15,276(0,13)
* *** 0x873930da,
IILF 15,X'873930DA' ; -2026295078
ST 15,280(0,13)
* *** 0x5a4b5ca1,
IILF 15,X'5A4B5CA1' ; 1514888353
ST 15,284(0,13)
* *** 0x78424f1c,
IILF 15,X'78424F1C' ; 2017611548
ST 15,288(0,13)
* *** 0x4a62b377,
IILF 15,X'4A62B377' ; 1247982455
ST 15,292(0,13)
* *** 0xe0e4e09e,
IILF 15,X'E0E4E09E' ; -521871202
ST 15,296(0,13)
* *** 0x62b8b43f,
IILF 15,X'62B8B43F' ; 1656271935
ST 15,300(0,13)
* *** 0x106e08d9,
IILF 15,X'106E08D9' ; 275646681
ST 15,304(0,13)
* *** 0x106e08d9,
ST 15,308(0,13)
* *** };
* ***
* *** size_t i;
* *** for (i = 0; i < (sizeof((keysToTest)) / sizeof(*(keysT\
* oTest))); i++) {
LGHI 2,0 ; 0
B @L60
DS 0D
@FRAMESIZE_761 DC F'352'
@lit_761_4 DC AD(@strings@)
@lit_761_19 DC AD(rd_murmur2)
@lit_761_23 DC AD(fprintf)
@lit_761_22 DC AD(@DATA)
@lit_761_20 DC Q(__stderrp)
@lit_761_28 DC Q(rd_unittest_assert_on_failure)
@lit_761_29 DC AD(__assert)
@L59 DS 0H
* *** uint32_t h = rd_murmur2(keysToTest[i],
* *** keysToTest[i] ?
SLLG 15,2,3(0) ; *0x8
LTG 15,168(15,13)
BZ @L63
* *** __strlen(keysToTest[i]\
* ) : 0);
SLLG 15,2,3(0) ; *0x8
LG 15,168(15,13)
LGR 1,15
LGHI 0,0
@@gen_label4 DS 0H
SRST 0,15
BC 1,@@gen_label4
SLGR 0,1
B @L64
@L63 DS 0H
LGHI 0,0 ; 0
@L64 DS 0H
SLLG 15,2,3(0) ; *0x8
LG 15,168(15,13)
STMG 15,0,312(13)
LA 1,312(0,13)
LG 15,@lit_761_19 ; rd_murmur2
@@gen_label5 DS 0H
BALR 14,15
@@gen_label6 DS 0H
LR 3,15
* *** do { if (!((int32_t)h == java_murmur2_results[\
* i])) { fprintf(__stderrp, "\033[31mRDUT: FAIL: %s:%d: %s: " "assert \
* failed: " "(int32_t)h == java_murmur2_results[i]" ": ", "C:\\asgkafk\
* a\\librdkafka\\src\\rdmurmur2.c", 153, __FUNCTION__); fprintf(__stde\
* rrp, "Calculated murmur2 hash 0x%x for \"%s\", " "expected 0x%x", h,\
* keysToTest[i], java_murmur2_results[i]); fprintf(__stderrp, "\033[0\
* m\n"); if (rd_unittest_assert_on_failure) (((int32_t)h == java_murmu\
* r2_results[i]) ? (void)0 : __assert(__func__, "C:\\asgkafka\\librdka\
* fka\\src\\rdmurmur2.c", 153, "(int32_t)h == java_murmur2_results[i]"\
* )); return 1; } } while (0);
@L65 DS 0H
SLLG 15,2,2(0) ; *0x4
C 3,264(15,13)
BE @L68
LLGF 5,@lit_761_20 ; __stderrp
LG 15,0(5,4) ; __stderrp
STG 15,312(0,13)
LG 6,@lit_761_4
LA 15,72(0,6)
STG 15,320(0,13)
LA 15,156(0,6)
STG 15,328(0,13)
MVGHI 336(13),153
LG 7,@lit_761_22
LA 15,70(0,7)
STG 15,344(0,13)
LA 1,312(0,13)
LG 8,@lit_761_23 ; fprintf
LGR 15,8
@@gen_label8 DS 0H
BALR 14,15
@@gen_label9 DS 0H
LG 15,0(5,4) ; __stderrp
STG 15,312(0,13)
LA 15,196(0,6)
STG 15,320(0,13)
LLGFR 15,3
STG 15,328(0,13)
SLLG 15,2,3(0) ; *0x8
LG 15,168(15,13)
STG 15,336(0,13)
SLLG 15,2,2(0) ; *0x4
LGF 15,264(15,13)
STG 15,344(0,13)
LA 1,312(0,13)
LGR 15,8
@@gen_label10 DS 0H
BALR 14,15
@@gen_label11 DS 0H
LG 15,0(5,4) ; __stderrp
STG 15,312(0,13)
LA 15,250(0,6)
STG 15,320(0,13)
LA 1,312(0,13)
LGR 15,8
@@gen_label12 DS 0H
BALR 14,15
@@gen_label13 DS 0H
LLGF 15,@lit_761_28 ; rd_unittest_assert_on_failure
LA 15,0(15,4)
CLI 0(15),0
BE @L69
SLLG 15,2,2(0) ; *0x4
C 3,264(15,13)
BE @L69
@L70 DS 0H
LA 15,70(0,7)
STG 15,312(0,13)
LA 15,156(0,6)
STG 15,320(0,13)
MVGHI 328(13),153
LA 15,256(0,6)
STG 15,336(0,13)
LA 1,312(0,13)
LG 15,@lit_761_29 ; __assert
@@gen_label16 DS 0H
BALR 14,15
@@gen_label17 DS 0H
@L71 DS 0H
@L69 DS 0H
LGHI 15,1 ; 1
B @ret_lab_761
@L68 DS 0H
* ***
* ***
* ***
* *** }
AGHI 2,1
@L60 DS 0H
CLGFI 2,X'0000000C'
BL @L59
* *** do { fprintf(__stderrp, "\033[32mRDUT: PASS: %s:%d: %s\
* \033[0m\n", "C:\\asgkafka\\librdkafka\\src\\rdmurmur2.c", 158, __FUN\
* CTION__); return 0; } while (0);
@L72 DS 0H
LLGF 15,@lit_761_20 ; __stderrp
LG 15,0(15,4) ; __stderrp
STG 15,312(0,13)
LG 15,@lit_761_4
LA 1,294(0,15)
STG 1,320(0,13)
LA 15,156(0,15)
STG 15,328(0,13)
MVGHI 336(13),158
LG 15,@lit_761_22
LA 15,70(0,15)
STG 15,344(0,13)
LA 1,312(0,13)
LG 15,@lit_761_23 ; fprintf
@@gen_label19 DS 0H
BALR 14,15
@@gen_label20 DS 0H
LGHI 15,0 ; 0
* *** }
@ret_lab_761 DS 0H
* * **** Start of Epilogue
DCCEPIL
* * **** End of Epilogue
DROP 12
*
* DSECT for automatic variables in "unittest_murmur2"
* (FUNCTION #761)
*
@AUTO#unittest_murmur2 DSECT
DS XL168
unittest_murmur2#h#1 DS 1F ; h
ORG @AUTO#unittest_murmur2+168
unittest_murmur2#i#0 DS 8XL1 ; i
ORG @AUTO#unittest_murmur2+168
unittest_murmur2#keys$To$Test#0 DS 96XL1 ; keysToTest
ORG @AUTO#unittest_murmur2+264
unittest_murmur2#java_murmur2_results#0 DS 48XL1 ; java_murmur2_results
*
@CODE CSECT
@@STATIC ALIAS X'7C998494A49994A499F250'
@@STATIC DXD 64D
*
* Non-Re-Entrant Data Section
*
@DATA CSECT
@DATA RMODE ANY
@DATA AMODE ANY
@@T349 DC X'99846D838193939683' rd.calloc
DC 1X'00'
@@T34D DC X'99846D948193939683' rd.malloc
DC 1X'00'
@@T352 DC X'99846D99858193939683' rd.realloc
DC 2X'00'
@@T358 DC X'99846DA2A39984A497' rd.strdup
DC 1X'00'
@@T35D DC X'99846DA2A3999584A497' rd.strndup
DC 2X'00'
@@T365 DC X'99846D9985868395A36DA2A482F0' rd.refcnt.sub0
DC 2X'00'
@@T37E DC X'A49589A3A385A2A36D94A49994A499F2' unittest.murmur2
DC 1X'00'
@strings@ DS 0H
DC X'F1F2F3F40000D79985C194829385E689' 1234..PreAmbleWi
DC X'9393C285D9859496A585846BE38885D7' llBeRemoved.TheP
DC X'9985D78199A3E38881A3C9A200009281' rePartThatIs..ka
DC X'86928100878982859989A288F1F2F3F4' fka.giberish1234
DC X'F5F6F7F8F90000001BADF3F194D9C4E4' 56789.....31mRDU
DC X'E37A40C6C1C9D37A406CA27A6C847A40' T..FAIL...s..d..
DC X'6CA27A4081A2A28599A3408681899385' .s..assert.faile
DC X'847A404D8995A3F3F26DA35D88407E7E' d...int32.t.h...
DC X'409181A5816D94A49994A499F26D9985' .java.murmur2.re
DC X'A2A493A3A2AD89BD7A400000C37AE081' sults.i.....C..a
DC X'A2879281869281E09389829984928186' sgkafka.librdkaf
DC X'9281E0A29983E0998494A49994A499F2' ka.src.rdmurmur2
DC X'4B830000C3819383A49381A385844094' .c..Calculated.m
DC X'A49994A499F2408881A28840F0A76CA7' urmur2.hash.0x.x
DC X'40869699407F6CA27F6B4085A7978583' .for...s...expec
DC X'A3858440F0A76CA700001BADF0941500' ted.0x.x....0m..
DC X'4D8995A3F3F26DA35D88407E7E409181' .int32.t.h....ja
DC X'A5816D94A49994A499F26D9985A2A493' va.murmur2.resul
DC X'A3A2AD89BD001BADF3F294D9C4E4E37A' ts.i....32mRDUT.
DC X'40D7C1E2E27A406CA27A6C847A406CA2' .PASS...s..d...s
DC X'1BADF0941500' ..0m..
@Erd_unittest_assert_on_failure ALIAS X'99846DA49589A3A385A2A36D81A2A28*
599A36D96956D86818993A49985'
EXTRN @Erd_unittest_assert_on_failure
@E__stderrp ALIAS C'@@STDERP'
EXTRN @E__stderrp
*
*
* Re-entrant Data Initialization Section
*
@@INIT@ ALIAS C'rdmurmur2:'
@@INIT@ CSECT
@@INIT@ AMODE ANY
@@INIT@ RMODE ANY
DC XL1'5'
DC AL3(0)
DC AL4(288)
DC 4X'00'
DC Q(@@STATIC)
DC X'00000000'
DC X'00000001'
DC X'00000000'
DC X'000000FF'
DC X'0102039C09867F978D8E0B0C0D0E0F10' .....f.p........
DC X'1112139D8508871819928F1C1D1E1F80' ....e.g..k......
DC X'818283840A171B88898A8B8C05060790' abcd...hi.......
DC X'9116939495960498999A9B14159E1A20' j.lmno.qr.......
DC X'A0E2E4E0E1E3E5E7F1A22E3C282B7C26' .SU..TVX1s......
DC X'E9EAEBE8EDEEEFECDF21242A293B5E2D' Z..Y............
DC X'2FC2C4C0C1C3C5C7D1A62C255F3E3FF8' .BD.ACEGJw.....8
DC X'C9CACBC8CDCECFCC603A2340273D22D8' I..H...........Q
DC X'616263646566676869ABBBF0FDFEB1B0' ...........0....
DC X'6A6B6C6D6E6F707172AABAE6B8C6A4B5' ...........W.Fu.
DC X'7E737475767778797AA1BFD05BDEAEAC' ................
DC X'A3A5B7A9A7B6BCBDBEDDA8AF5DB4D77B' tv.zx.....y...P.
DC X'414243444546474849ADF4F6F2F3F57D' ..........46235.
DC X'4A4B4C4D4E4F505152B9FBFCF9FAFF5C' ............9...
DC X'F7535455565758595AB2D4D6D2D3D530' 7.........MOKLN.
DC X'313233343536373839B3DBDCD9DA9F40' ............R...
*
DC XL1'5'
DC AL3(0)
DC AL4(480)
DC 4X'00'
DC Q(@@STATIC)
DC X'00000000'
DC X'00000101'
DC X'00000000'
DC X'000000A0'
DC X'010203372D2E2F1605150B0C0D0E0F10' ................
DC X'1112133C3D322618193F271C1D1E1F40' ................
DC X'5A7F7B5B6C507D4D5D5C4E6B604B61F0' ...............0
DC X'F1F2F3F4F5F6F7F8F97A5E4C7E6E6F7C' 123456789.......
DC X'C1C2C3C4C5C6C7C8C9D1D2D3D4D5D6D7' ABCDEFGHIJKLMNOP
DC X'D8D9E2E3E4E5E6E7E8E9ADE0BD5F6D79' QRSTUVWXYZ......
DC X'81828384858687888991929394959697' abcdefghijklmnop
DC X'9899A2A3A4A5A6A7A8A9C04FD0A10720' qrstuvwxyz......
DC X'2122232425061728292A2B2C090A1B30' ................
DC X'311A333435360838393A3B04143EFF80' ................
*
DC XL1'5'
DC AL3(0)
DC AL4(520)
DC 4X'00'
DC Q(@@STATIC)
DC X'00000000'
DC X'000001C0'
DC X'00000000'
DC X'00000001'
DC X'8A40404040404040' ........
*
DC XL1'5'
DC AL3(0)
DC AL4(0)
DC 4X'00'
DC Q(@@STATIC)
DC X'00000000'
DC X'000001E0'
DC X'00000000'
DC X'00000001'
DC X'8B40404040404040' ........
*
END
| 31.361248 | 72 | 0.460391 |
74a0213515b202447725bb12655775d18ac7d181 | 787 | asm | Assembly | oeis/086/A086787.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/086/A086787.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/086/A086787.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A086787: a(n) = Sum_{i=1..n} ( Sum_{j=1..n} i^j ).
; Submitted by Christian Krause
; 1,8,56,494,5699,82200,1419760,28501116,651233661,16676686696,472883843992,14705395791306,497538872883727,18193397941038736,714950006521386976,30046260016074301944,1344648068888240941017,63841580906470188418224,3205037832959611351099144,169632644582122797919941830,9440074338296075628412318331,551043319898085426656275417448,33665976392689262324788687783376,2148453916451773094814306082184820,142954315115171592920461281336269845,9900928274622390826195640947695867096
add $0,1
mov $2,1
mov $3,$0
mov $4,$0
mul $0,0
lpb $3
mov $5,$4
mov $6,0
lpb $5
add $6,1
mul $6,$2
mov $7,$0
cmp $7,0
sub $5,$7
lpe
add $1,$6
add $2,1
mov $7,$0
cmp $7,0
sub $3,$7
lpe
mov $0,$1
| 29.148148 | 468 | 0.757306 |
ec9431c047b691dd548f94bc1b1b878a0af6a27d | 11,271 | asm | Assembly | xbuild/loader.asm | iOSPrincekin/simpleOS | 4e90153b2425561e4ef587247198614a0779f62a | [
"MIT"
] | null | null | null | xbuild/loader.asm | iOSPrincekin/simpleOS | 4e90153b2425561e4ef587247198614a0779f62a | [
"MIT"
] | null | null | null | xbuild/loader.asm | iOSPrincekin/simpleOS | 4e90153b2425561e4ef587247198614a0779f62a | [
"MIT"
] | null | null | null | %include "boot.inc"
;section loader vstart=LOADER_BASE_ADDR
[BITS 16] ; Tells nasm to build 16 bits code
[ORG LOADER_BASE_ADDR] ; The address the code will start
;构建gdt及其内部的描述符
GDT_BASE:dd 0x00000000
dd 0x00000000
CODE_DESC:dd 0x0000FFFF
dd DESC_CODE_HIGH4
DATA_STACK_DESC:dd 0x0000FFFF
dd DESC_DATA_HIGH4
VIDEO_DESC:dd 0x80000007;limit=(0xbffff-0xb8000)/4k=0x7
dd DESC_VIDEO_HIGH4 ;此时dpl为0
GDT_SIZE equ $ - GDT_BASE
GDT_LIMIT equ GDT_SIZE - 1
times 60 dq 0 ; 此处预留60个描述符的空位
SELECTOR_CODE equ (0x0001<<3) + TI_GDT + RPL0 ;相当于(CODE_DESC - GDT_BASE)/8 + TI_GDT + RPL0
SELECTOR_DATA equ (0x0002<<3) + TI_GDT + RPL0 ;同上
SELECTOR_VIDEO equ (0x0003<<3) + TI_GDT + RPL0 ;同上
; total_mem_bytes 用于保存内存容量,以字节为单位,此位置比较好记
; 当前偏移 loader.bin 头文件 0x200 字节, loader.bin 的加载地址是 0x900
; 故 total_mem_bytes 内存中的地址是 0xb00. 将来在内核中咱们会引用到此地址
total_mem_bytes dd 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;以下是gdt的指针,前2字节是gdt界限,后4字节是gdt起始地址
gdt_ptr dw GDT_LIMIT
dd GDT_BASE
;人工对齐:total_mem_bytes4+gdt_ptr6+ards_buf224+ards_nr2,共 256 字节
ards_buf times 244 db 0
ards_nr dw 0 ;用于记录 ARDS 结构体数量
loader_start:
LOADER_TEXT_BASE_ADDR equ 0x140 ;相当于(CODE_DESC - GDT_BASE)/8 + TI_GDT + RPL0
LOADER_TEXT_BASE_ATTRIBUTE equ 0x4A
;--------------------- 0.显示loader -----------------------------------
; 输出背景色绿色,前景色红色,并且跳动的字符串"1 MBR"
mov byte [gs:LOADER_TEXT_BASE_ADDR],'l'
mov byte [gs:LOADER_TEXT_BASE_ADDR+1],LOADER_TEXT_BASE_ATTRIBUTE
mov byte [gs:LOADER_TEXT_BASE_ADDR+2],'o'
mov byte [gs:LOADER_TEXT_BASE_ADDR+3],LOADER_TEXT_BASE_ATTRIBUTE
mov byte [gs:LOADER_TEXT_BASE_ADDR+4],'a'
mov byte [gs:LOADER_TEXT_BASE_ADDR+5],LOADER_TEXT_BASE_ATTRIBUTE
mov byte [gs:LOADER_TEXT_BASE_ADDR+6],'d'
mov byte [gs:LOADER_TEXT_BASE_ADDR+7],LOADER_TEXT_BASE_ATTRIBUTE
mov byte [gs:LOADER_TEXT_BASE_ADDR+8],'e'
mov byte [gs:LOADER_TEXT_BASE_ADDR+9],LOADER_TEXT_BASE_ATTRIBUTE
mov byte [gs:LOADER_TEXT_BASE_ADDR+10],'r'
mov byte [gs:LOADER_TEXT_BASE_ADDR+11],LOADER_TEXT_BASE_ATTRIBUTE
;--------------------- 1.加载 kernel -----------------------------------
mov eax, KERNEL_BIN_BASE_ADDR_SEG
mov si, KERNEL_START_SECTOR
mov edx, 0
mov ecx, 400
xor ebx, ebx
call read_sectors
;-------------------- 2.通过 int 15h eax = 0000E820h, edx = 534D4150h ('SMAP') 获取内存布局 --------
xor ebx,ebx ;第一次调用时,ebx值要为0
mov edx, 0x534d4150 ;edx 只赋值一次,循环体中不会改变
mov di, ards_buf ;ards 结构缓冲区
.e820_mem_get_loop: ;循环获取每个 ARDS 内存范围描述结构
mov eax, 0x0000e820 ;执行 int 0x15 后,eax 值变为 0x534d4150,所以每次执行 int 前都要更新为子功能号
mov ecx, 20 ;ARDS 地址范围描述符结构大小是20字节
int 0x15
jc .e820_failed_so_try_e801 ;若cf位为 1 则有错误发生,尝试 0xe801 子功能
add di, cx ;使 di 增加 20 字节指向缓冲区新的 ARDS 结构体位置
inc word [ards_nr] ;记录 ARDS 数量
cmp ebx, 0 ;若 ebx 为 0 且 cf 不为1,这说明 ards 全部返回,当前已是最后一个
jnz .e820_mem_get_loop
;在所有 ards 结构体中,找出(base_add_low + length_low)的最大值,即内存的容量
mov cx,[ards_nr] ;遍历每一个 ARDS 结构体,循环次数是 ARDS 的数量
mov ebx, ards_buf
xor edx,edx ;edx 为最大的内存容量,在此先清0
.find_max_mem_area: ;无需判断 type 是否为1,最大的内存块一定是可被使用的
mov eax, [ebx] ;base_add_low
add eax, [ebx+8] ;length_low
add ebx, 20 ;指向缓冲区下一个 ARDS 结构
cmp edx, eax ;冒泡排序,找出最大,edx寄存器始终是最大的内存容量
jge .next_ards
mov edx, eax ;edx为总内存大小
.next_ards:
loop .find_max_mem_area
jmp .mem_get_ok
;---------------- int 15h ax = E801h 获取内存大小,最大支持 4G -----------
; 返回后,ax cx 值一样,已 KB 为单位,bx dx 值一样,以 64KB 为单位
; 在 ax 和 cx 寄存器中为低 16MB, 在 dx 和 dx 寄存器中为 16MB 到 4GB
.e820_failed_so_try_e801:
mov ax, 0xe801
int 0x15
jc .e801_failed_so_try88 ;若当前 e801 方法失败,就尝试 0x88 方法
;1 先计算出低 15MB 的内存, ax 和 cx 中是以 KB 为单位的内存数量,将其转换为以 byte 为单温
mov cx, 0x400 ;cx 和 ax 值一样,cx 用作乘数
mul cx
shl edx, 16
and eax, 0x0000FFFF
or edx, eax
add edx, 0x100000 ;ax只是15MB,故要加1MB
mov esi, edx ;先把低 15MB 的内存容量存入 esi 寄存器备份
;2 再将 16MB 以上的内存转换为 byte 为单位,寄存器 bx 和 dx 中是以 64KB 为单位的内存数量
xor eax, eax
mov ax, bx
mov ecx, 0x10000 ;0x10000 十进制为 64KB
mul ecx ;32位乘法,默认的被乘数是eax,积为64位
add esi, eax;由于此方法只能测出 4GB 以内的内存, 故 32 位 eax 足够了,edx 肯定为 0,只加 eax 便可
mov edx, esi ;edx 为总内存大小
jmp .mem_get_ok
;--------------- int 15h ah = 0x88 获取内存大小,只能获取 64MB 之内 -------
.e801_failed_so_try88:
;int 15 后,ax 存入的是以 KB 为单位的内存容量
mov ah, 0x88
int 0x15
jc .error_hlt
and eax, 0x0000FFFF
;16 位乘法,被乘数是 ax,积为 32 位。 积的高 16 位在 dx 中,积的低 16 位在 ax 中
mov cx, 0x400 ;0x400 等于 1024,将 ax 中的内存容量换为以 byte 为单位
mul cx
shl edx, 16 ;把 dx 移到高 16 位
or edx, eax ;把积的低 16 位组合到 edx, 为 32 位的积
add edx, 0x100000 ;0x88 子功能只会返回到 1MB 以上的内存,故实际内存大小要加上 1MB
.mem_get_ok:
mov [total_mem_bytes], edx ;将内存换为 byte 单位后存入 total_mem_bytes 处
;------------------- 3.准备进入保护模式 ------------------
;0 关闭中断
;1 打开A20
;2 加载gdt
;3 将cr0的pe位置1
cli ;close the interruption
;------------------- 3.1 打开A20 ----------------------
in al,0x92
or al,0000_0010b
out 0x92,al
;------------------- 3.2 加载GDT --------------------
lgdt [gdt_ptr]
;------------------- 3.3 cr0第0位置1 -----------------
mov eax,cr0
or eax,0x00000001
mov cr0,eax
.jump_test:
;jmp .jump_test
;------------------ 4.跳转至 保护模式 -----------------
jmp word SELECTOR_CODE:p_mode_start ; 刷新流水线,避免分支预测的影响,这种cpu优化策略,最怕jmp跳转,
; 这将导致之前做的预测失效,从而起了刷新的作用。
.error_hlt: ;出错则挂起
;hlt
align 4
DAP: ; disk address packet
db 0x10 ; [0]: packet size in bytes
db 0 ; [1]: reserved, must be 0
db 0 ; [2]: nr of blocks to transfer (0~127)
db 0 ; [3]: reserved, must be 0
dw 0 ; [4]: buf addr(offset)
dw 0 ; [6]: buf addr(seg)
dd 0 ; [8]: lba. low 32-bit
dd 0 ; [12]: lba. high 32-bit
; function: read a sector data from harddisk
; @input:
; ax: dx -> buffer seg: off
; si -> lba low 32 bits
harddisk_read_sector:
push ax
push bx
push cx
push dx
push si
mov word [DAP + 2], 1 ; count
mov word [DAP + 4], dx ; offset
mov word [DAP + 6], ax ; segment
mov word [DAP + 8], si ; lba low 32 bits
mov dword [DAP + 12], 0 ; lba high 32 bits
xor bx, bx
mov ah, 0x42
mov dl, 0x80
mov si, DAP
int 0x13
pop si
pop dx
pop cx
pop bx
pop ax
ret
read_sectors:
push ax
push bx
push cx
push dx
push si
push di
push es
.reply:
call harddisk_read_sector
add ax, 0x20 ; next buffer
inc si ; next lba
loop .reply
pop es
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
;------------------ 5.保护模式,代码开始 -----------------------
[bits 32]
p_mode_start:
mov ax,SELECTOR_DATA
mov ds,ax
mov es,ax
mov ss,ax
mov esp,LOADER_STACK_TOP
mov ax,SELECTOR_VIDEO
mov gs,ax
;5.1 创建页目录及页表并初始化页内存位图
call setup_page
;5.2 要将描述符地址及偏移量写入内存 gdt_ptr,修改后,一会儿用新地址重新加载
sgdt [gdt_ptr] ;存储到原来 gdt 所有的位置
;将 gdt 描述符中视频段描述符中的段基址 + 0xc0000000
mov ebx, [gdt_ptr + 2]
or dword [ebx + 0x18 + 4], 0xc0000000 ;视频段是第3个段描述符,每个描述符是8字节,故0x18。
;段描述符的高4字节的最高位是段基址的31~24位
;将gdt的基址加上0xc0000000使其成为内核所在的高地址
add dword [gdt_ptr + 2], 0xc0000000
;5.3 将修改后的基于 保护模式高地址的 gdt 重新加载
lgdt [gdt_ptr] ; 重新加载
add esp, 0xc0000000 ; 将栈指针同样映射到内核地址
;5.4 把页目录·地址赋值给 cr3
mov eax, PAGE_DIR_TABLE_POS
mov cr3, eax
;5.5 打开 cr0 的pg位 (第 31 位)
mov eax, cr0
or eax, 0x80000000
mov cr0, eax
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 此时不刷新流水线也没问题 ;;;;;;;;;;;;;;;;;;;;;;;
;由于一直处在 32 位下,原则上不需要强制刷新,经过实际测试以下两句也没问题.
;但以防万一,还是加上了,免得将来出来莫名其妙的问题.
jmp SELECTOR_CODE:enter_kernel ;强制刷新流水线,更新gdt
enter_kernel:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
call kernel_init
mov esp, 0xc009f000 ;0xd3d
jmp KERNEL_ENTRY_POINT ; 用地址 0x1500 访问测试,结果ok 0xd42
;--------------- 讲 kernel.bin 中的 segment 拷贝到编译的地址 ----------------
kernel_init: ; 0x0d47
xor eax, eax
xor ebx, ebx ;ebx 记录程序头表地址
xor ecx, ecx ;cx 记录程序头表中的 program header 数量
xor edx, edx ;dx 记录program header 尺寸,即 e_phentsize
mov dx,[KERNEL_BIN_BASE_ADDR + 42] ;编译文件 42 字节处的属性是 e_phentsize, 表示 program header 大小
mov ebx, [KERNEL_BIN_BASE_ADDR + 28] ;偏移文件开始部分 28 字节的地方是 e_phoff,表示第 1 个program header 在文件中的偏移量
;其实该值是 0x34,不过还是谨慎一点,这里来读取实际值
add ebx, KERNEL_BIN_BASE_ADDR
mov cx, [KERNEL_BIN_BASE_ADDR + 44] ;偏移文件开始部分 44 字节的地方是 e_phnum,表示有几个 program header
.each_segment:
cmp byte [ebx + 0], PT_NULL ; 若 p_type 等于 PT_NULL, 说明此 program header 未使用 0xd62
je .PTNULL
;为函数 memcpy 压入参数,参数是从右往左依次压入,函数原型类似于 memcpy(dst, src, size)
push dword [ebx + 16] ; program header 中偏移 16 字节的地方是 p_filesz,压入函数 memcpy 的第三个参数:size
mov eax, [ebx + 4] ; 距程序偏移量为 4 字节的位置是 p_offset
add eax, KERNEL_BIN_BASE_ADDR ;加上 kernel.bin 被加载到的物理地址, eax 为该段的物理地址
push eax ; 压入函数 memcpy 的第二个参数: 源地址
mov eax,[ebx + 8]
push eax
;push dword [ebx + 8]; 压入函数 memcpy 的第一个参数: 目的地址,偏移程序头 8 字节的位置是 p_vaddr, 这就是目的地址
call mem_cpy ; 调用 mem_cpy 完成段复制
add esp, 12 ; 清理栈中压入的三个参数
.PTNULL:
add ebx, edx ; edx 为 program header 大小,即 e_phentsize,在此 ebx 指向下一个 program header
loop .each_segment
ret
;-------------------------- 逐字节拷贝 mem_cpy(dst, src, size) -----------
; 输入:栈中三个参数(dst,src,size)
;输出: 无
;--------------------------------------------------------------------------
mem_cpy: ;0xd8a
cld
push ebp
mov ebp, esp
push ecx ; rep 指令用到了 ecx,但 ecx 对于外层段的循环还有用,故先入栈备份
mov edi, [ebp + 8] ;dst
mov esi, [ebp + 12] ;src
mov ecx, [ebp + 16] ;size
rep movsb ;逐字节拷贝 0xd98
;恢复环境
pop ecx ; 0xd9a
pop ebp
ret
;-------------------- 创建页目录及页表 ------------------------
setup_page:
;先把页目录占用的空间逐字节清0
mov ecx, 4096
mov esi, 0
.clear_page_dir:
mov byte [PAGE_DIR_TABLE_POS + esi], 0
inc esi
loop .clear_page_dir
;开始创建页目录项(PDE)
.create_pde: ;创建 Page Directory Entry
mov eax, PAGE_DIR_TABLE_POS
add eax, 0x1000 ; 此时 eax 为第一个页表的位置及属性
mov ebx, eax ; 此处为 ebx 赋值, 是为 .create_pte 做准备, ebx 为基址
;下面将页目录 0 和 0xc00 都存为第一个页表的地址,每个页表表示 4MB 内存
;这样 0xc03fffff 以下的地址和 0x003fffff 以下的地址都指向相同的页表
;这是为将地址映射为内核地址做准备
or eax, PG_US_U | PG_RW_W | PG_P ;页目录项的属性 RW 和 P 位为1, US 为 1,表示用户属性,所有特权级别都可以访问
mov [PAGE_DIR_TABLE_POS + 0x0], eax ;第1个目录项,在页目录表中的第1个目录项写入第一个页表的位置(0x101000)及属性(3)
mov [PAGE_DIR_TABLE_POS + 0xc00], eax;一个页表占用 4 字节,0xc00 表示第 768 个页表占用的目录项,0xc00 以上的目录项用于内核控件
;也就是页表的 0xc0000000 ~ 0xffffffff 共计 1G 属于内核, 0x0~0xbfffffff共计3G属于用户进程
sub eax, 0x1000
mov [PAGE_DIR_TABLE_POS + 4092], eax ;使最后一个目录项指向页目录表自己的地址
;下面创建页表项(PTE)
mov ecx, 256 ; 1M 低端内存 / 每页大小 4k = 256
mov esi, 0
mov edx, PG_US_U | PG_RW_W | PG_P ; 属性为7, US=1,RW=1,P=1
.create_pte: ;创建 Page Table Entry
mov [ebx+esi*4], edx ;此时的 ebx 已经在上面通过 eax 赋值为 0x101000,也就是第一个页表的地址
add edx, 4096
inc esi
loop .create_pte
;创建内核其他页表的PDE,创建 >=769 的页目录项
mov eax, PAGE_DIR_TABLE_POS
add eax, 0x2000 ;此时eax 为第二个页表的位置
or eax, PG_US_U | PG_RW_W | PG_P ; 页目录项的属性US,RW和P位都为1
mov ebx, PAGE_DIR_TABLE_POS
mov ecx,254 ; 范围为第 769~1022 的所有目录数量
mov esi,769
.create_kernel_pde:
mov [ebx+esi*4], eax
inc esi
add eax, 0x1000
loop .create_kernel_pde
ret
| 28.037313 | 95 | 0.629314 |
7afc242df8aa4a426b3a7413f311ae566c7b4d25 | 26,239 | asm | Assembly | src/00/filesystem.asm | Willem3141/kernel | c7b72f75b78a9b23e66432801f8d8df1727637ed | [
"MIT"
] | null | null | null | src/00/filesystem.asm | Willem3141/kernel | c7b72f75b78a9b23e66432801f8d8df1727637ed | [
"MIT"
] | null | null | null | src/00/filesystem.asm | Willem3141/kernel | c7b72f75b78a9b23e66432801f8d8df1727637ed | [
"MIT"
] | null | null | null | ;; deleteFile [Filesystem]
;; Deletes a file.
;; Inputs:
;; DE: Path to file (string pointer)
;; Outputs:
;; Z: Set if file was deleted, reset if file did not exist
;; A: Preserved on success, error code on failure
deleteFile:
push hl
push af
call findFileEntry
jr nz, ++_
; Delete file
push bc
ld b, a
ld a, i
push af
di
ld a, b
setBankA
call unlockFlash
ld a, fsDeletedFile
call writeFlashByte
call lockFlash
pop af
jp po, _
ei
_: pop bc
pop af
pop hl
cp a
ret
_: ; File not found
ld h, a
pop af
or 1
ld a, h
pop hl
ret
;; fileExists [Filesystem]
;; Determines if a file exists.
;; Inputs:
;; DE: Path to file (string pointer)
;; Outputs:
;; Z: Set if file exists, reset if not
fileExists:
push hl
push af
call findFileEntry
jr nz, _
pop af
pop hl
cp a
ret
_: ld h, a
pop af
or 1
ld a, h
pop hl
ret
;; directoryExists [Filesystem]
;; Determines if a directory exists.
;; Inputs:
;; DE: Path to directory (string pointer)
;; Outputs:
;; Z: Set if file exists, reset if not
directoryExists:
push hl
push af
call findDirectoryEntry
jr nz, _
pop af
pop hl
cp a
ret
_: ld h, a
pop af
or 1
ld a, h
pop hl
ret
;; listDirectory [Filesystem]
;; Lists the contents of a directory on the filesystem.
;; Inputs:
;; DE: Path to directory
;; HL: Callback
;; Outputs:
;; Z: Set on success, reset on failure
;; A: Error code on failure, preserved on success
;; Notes:
;; This function will call your callback every time it encounters a
;; relevant entry on the filesystem. You are free to use IX, IY, and
;; the shadow registers in this callback, but must preserve all other
;; registers. Your function will be called with the following state:
;;
;; * HL: Address of entry
;; * BC: Length of entry
;; * A: Type of entry
;; * kernelGarbage: Name of entry
;; * Correct page swapped into bank A
;; * Interrupts disabled (do not enable them)
;;
;; You must leave these registers intact.
listDirectory:
push af
ld a, i
push af
di
push de
push bc
push hl
push hl
call findDirectoryEntry
;jr nz, .error ; TODO
ld bc, 0
call cpHLBC
call z, .correctForRoot
jr z, .loop
dec hl
ld c, (hl)
dec hl
ld b, (hl)
dec hl
; Grab directory ID
dec hl \ dec hl
ld e, (hl)
dec hl
ld d, (hl)
ex de, hl
ld (kernelGarbage + 0x100), hl
ex de, hl
inc hl \ inc hl
getBankA
ld (kernelGarbage + 0x102), a
inc hl
jr .skip
.loop:
ld a, (hl)
dec hl
ld c, (hl)
dec hl
ld b, (hl)
dec hl
cp fsFile
jr z, .handleFile
cp fsSymLink
jr z, .handleLink
cp fsDirectory
jr z, .handleDirectory
cp fsEndOfTable
jp z, .endOfTable
.skip:
or a
sbc hl, bc
; TODO: Handle swapping out next page
jr .loop
.handleFile:
.handleDirectory:
.handleLink:
push hl
push bc
ld c, (hl)
dec hl
ld b, (hl)
ld hl, (kernelGarbage + 0x100)
call cpHLBC
jr z, .matchingItem
pop bc
pop hl
jr .skip
.matchingItem:
pop bc
pop hl \ push hl
cp fsFile
jr z, .file
cp fsSymLink
jr z, .link
.directory:
ld bc, 5
jr .add
.file:
ld bc, 8
jr .add
.link:
ld bc, 3
.add:
or a
sbc hl, bc ; Move HL to first character of name
ld bc, kernelGarbage
_: ld a, (hl)
ld (bc), a
inc bc
dec hl
or a
jr nz, -_
pop bc
inc bc \ inc bc \ inc bc
ld a, (bc)
ld hl, .returnPoint
ex (sp), hl
push hl
ld h, b \ ld l, c
ret
.returnPoint:
pop hl \ push hl
push hl
ld h, b
ld l, c
ld a, (kernelGarbage + 0x102)
setBankA
dec hl
ld c, (hl)
dec hl
ld b, (hl)
dec hl
jp .skip
.endOfTable:
pop hl
pop hl
pop bc
pop de
pop af
jp po, _
ei
_: pop af
cp a
ret
.correctForRoot:
ld (kernelGarbage + 0x100), hl
ld hl, 0x7FFF
ld a, fatStart
setBankA
ld (kernelGarbage + 0x102), a
ret
; createFileEntry [Internal]
; Creates a new file entry in the FAT.
; Inputs:
; HL: File name
; DE: Parent ID
; ABC: Length
; IY: Section ID
; Outputs:
; Z: Set on success, reset on failure
; A: New entry Flash page (on success); Error code (on failure)
; HL: New entry address relative to 0x4000 (on success)
createFileEntry:
; TODO: Check for file name too long
push af
ld a, i
push af
di
push ix
ld ix, 0
add ix, sp
push hl
push de
push bc
call findFATEnd
jp nz, .endOfFilesystem
.endOfTable:
; Write new entry here
ld de, 0x3FFF
scf
push hl
sbc hl, de
ld b, h \ ld c, l
pop hl
; BC is space left in this FAT page
ld d, h \ ld e, l ; Save HL in DE
ld h, (ix + -1)
ld l, (ix + -2) ; Grab file name from stack
push bc
call strlen
inc bc ; Zero delimited
pop hl
push bc
ld a, 10
add c
ld c, a
jr nc, _
inc c
_: call cpHLBC
pop bc
jp c, .endOfFilesystem
; We're good to go, let's do this
; DE is the address in FAT (here, we'll modify it to be the end of the entry):
ex de, hl
scf
sbc hl, bc
push bc
scf
ld bc, 8
sbc hl, bc
pop bc
ex de, hl
; BC is the length of the filename
; Everything else is on the stack
; Let's build a new entry in kernelGarbage and then write it all at once
ld hl, kernelGarbage + 10
add hl, bc
ld a, fsFile
ld (hl), a ; Entry ID
dec hl
; Increase BC to full length of entry for a moment
push bc
ld a, 8
add c
ld c, a
jr nc, _
inc c
_: ; And write that length down
ld (hl), c
dec hl
ld (hl), b
dec hl
pop bc
; Write parent ID
ld a, (ix + -4)
ld (hl), a
dec hl
ld a, (ix + -3)
ld (hl), a
dec hl
; Write flags (0xFF, someone else can modify it later if they want)
ld a, 0xFF
ld (hl), a
dec hl
; File size
ld a, (ix + -6)
ld (hl), a
dec hl
ld a, (ix + -5)
ld (hl), a
dec hl
ld a, (ix + 5)
ld (hl), a
dec hl
; Section ID
push iy \ pop bc
ld (hl), c
dec hl
ld (hl), b
dec hl
ld b, (ix + -1)
ld c, (ix + -2) ; Grab file name from stack
push de
ld de, 0
.nameLoop:
ld a, (bc)
ld (hl), a
dec hl
inc bc
inc de
or a ; cp 0
jr nz, .nameLoop
ld b, d \ ld c, e
pop de
; Grab full length of entry
ld a, 11
add c
ld c, a
jr nc, _
inc b
_: ; Write to flash
inc hl
call unlockFlash
call writeFlashBuffer
call lockFlash
ex de, hl ; Return HL with file entry address
add hl, bc
dec hl
getBankA
ld (ix + 5), a ; And return A with Flash page
pop bc
pop de
inc sp \ inc sp ; Skip HL
pop ix
pop af
jp po, _
ei
_: pop af
cp a
ret
.endOfFilesystem:
pop bc
pop de
pop hl
pop af
jp po, _
ei
_: pop af
pop ix
or 1
ld a, errFilesystemFull
ret
; Internal function - finds the end of the FAT, swaps that page in, and leaves HL for you to use
findFATEnd:
; Find end of FAT
ld d, fatStart
ld a, d
setBankA
ld hl, 0x7FFF
.search:
ld a, (hl)
cp fsEndOfTable
jr z, .endOfTable
dec hl
ld c, (hl)
dec hl
ld b, (hl)
scf
sbc hl, bc ; Skip to next entry
ld a, 0x40
cp h
jr c, .search
; Swap in next page of FAT
dec d
ld a, d
cp fatStart - 4
jp z, .exitError
setBankA
ld hl, 0x7FFF
jr .search
.endOfTable:
cp a
ret
.exitError:
or 1
ret
; createDirectoryEntry [Internal]
; Creates a new directory entry in the FAT.
; Inputs:
; HL: Directory name
; DE: Parent ID
; Outputs:
; Z: Set on success, reset on failure
; A: New entry Flash page (on success); Error code (on failure)
; HL: New entry address relative to 0x4000 (on success)
createDirectoryEntry:
push ix
push af
ld a, i
push af
di
push bc
push de
push hl
ld ix, 0
add ix, sp
; Traverse the FAT
ld hl, 0
ld (kernelGarbage + kernelGarbageSize - 2), hl ; Working directory ID
ld a, fatStart
setBankA
ld hl, 0x7FFF
.search:
ld a, (hl)
cp fsEndOfTable
jr z, .endOfTable
dec hl
ld c, (hl)
dec hl
ld b, (hl)
dec hl
cp fsDirectory
jr z, .directory
.skip:
or a
sbc hl, bc ; Skip to next entry
ld a, 0x40
cp h
jr c, .search
; Swap in next page of FAT
dec d
ld a, d
cp fatStart - 4
jp z, .exitError
setBankA
ld hl, 0x7FFF
jr .search
.directory:
dec hl \ dec hl
ld e, (hl) \ dec hl
ld d, (hl) \ dec hl
push hl
ld hl, (kernelGarbage + kernelGarbageSize - 2)
or a
sbc hl, de
pop hl
jr z, .update
jr c, .update
jr .search
.update:
ex de, hl
inc hl
ld (kernelGarbage + kernelGarbageSize - 2), hl
ex de, hl
inc hl \ inc hl \ inc hl \ inc hl
jr .skip
.endOfTable:
; HL: Address of next entry in FAT
; end of kernel garbage: New directory ID
push hl
ld l, (ix + 0)
ld h, (ix + 1)
call strlen
ld hl, 6
add hl, bc
ld b, h \ ld c, l
pop hl
; BC: Length of new entry
ld de, kernelGarbage
ex de, hl
add hl, bc
inc hl \ inc hl
ld a, fsDirectory
ld (hl), a ; Entry type
dec hl
ld (hl), c ; Length of entry
dec hl
ld (hl), b ; cotd.
dec hl
ld c, (ix + 2)
ld b, (ix + 3)
ld (hl), c ; Parent ID
dec hl
ld (hl), b ; cotd.
dec hl
push hl
ld hl, (kernelGarbage + kernelGarbageSize - 2)
ld b, h \ ld c, l
pop hl
ld (hl), c ; New ID
dec hl
ld (hl), b ; cotd.
dec hl
ld a, 0xFF ; Flags
ld (hl), a
dec hl
ld c, (ix + 0)
ld b, (ix + 1) ; Grab file name from stack
push de
ld de, 0
.nameLoop:
ld a, (bc)
ld (hl), a
dec hl
inc bc
inc de
or a ; cp 0
jr nz, .nameLoop
ld b, d \ ld c, e
pop de
; Set BC to full length of entry
ld a, 8
add c
ld c, a
jr nc, _
inc b
_: ; Move DE to end of file entry
ex de, hl
or a
sbc hl, bc
ex de, hl
inc de
; Write new entry
inc hl
call unlockFlash
call writeFlashBuffer
call lockFlash
ex de, hl ; HL has file entry address
add hl, bc
dec hl
getBankA
ld (ix + 7), a ; Flash page in A (on stack)
inc sp \ inc sp ; Skip HL
pop de
pop bc
pop af
jp po, _
ei
_: pop af
pop ix
ret
.exitError:
pop hl
pop de
pop bc
pop af
pop ix
or 1
ld a, errFilesystemFull
ret
;; createDirectory [Filesystem]
;; Creates a new directory in the filesystem and returns information about the new
;; filesystem entry.
;; Inputs:
;; DE: Path to new directory
;; Outputs:
;; Z: Set on success, reset on failure
;; A: Flash page (on success); Error code (on failure)
;; HL: Address relative to 0x4000 (on success)
createDirectory:
call directoryExists
call nz, fileExists ; TODO: Make a combined "entryExists" or something?
jr nz, _
or 1
ld a, errAlreadyExists
ret
_: push af
ld a, i
push af
di
push de
push hl
; Move string to RAM
push bc
ld h, d \ ld l, e
ld bc, 0x8000
scf
sbc hl, bc
jr nc, _ ; It's already in RAM
ld h, d \ ld l, e
call strlen
ld de, kernelGarbage + 10 ; + 10 gets us past what findDirectoryEntry uses
ldir
ld de, kernelGarbage + 10
_: pop bc
ld hl, 0
ld a, (de)
cp '/' ; Skip leading / (todo: working directories, see issue 75)
jr nz, _
inc de
_: push de
call checkForRemainingSlashes
pop de
ex de, hl
jr z, .createRootEntry
; Find parent directory
push bc
xor a
ld d, h \ ld e, l
ld bc, 0
cpir
dec hl
ld a, '/'
ld bc, 0
cpdr
inc hl
xor a
ld (hl), a ; Remove final '/'
push hl
call findDirectoryEntry
jr nz, .error
ld bc, 4
scf
sbc hl, bc ; Skip some stuff we don't need
ld e, (hl)
dec hl
ld d, (hl)
pop hl
ld a, '/'
ld (hl), a ; Replace / in path
inc hl ; HL is name of new directory
pop bc
jr .createEntry
.createRootEntry:
ld de, 0
.createEntry:
call createDirectoryEntry
inc sp \ inc sp ; pop hl
pop de
pop af
jp po, _
ei
_: pop af
ret
.error:
pop hl
pop bc
pop hl
pop de
pop af
jp po, _
ei
_: pop af
or 1
ld a, errFileNotFound
ret
;; findFileEntry [Filesystem]
;; Finds a file entry in the FAT.
;; Inputs:
;; DE: Path to file (string pointer)
;; Outputs:
;; Z: Set on success, reset on failure
;; A: Flash page (on success); Error code (on failure)
;; HL: Address relative to 0x4000 (on success)
findFileEntry:
push de
push bc
push af
ld a, i
push af
di
.startOver:
; Skip initial / if present
; TODO: Allow for relative paths somehow
ld a, (de)
cp '/'
jr nz, _
inc de
_: setBankA(fatStart)
ld hl, 0
ld (kernelGarbage), hl ; Used as temporary storage of parent directory ID
ld hl, 0x7FFF
push af
push de \ call checkForRemainingSlashes \ pop de
jp z, findFileEntry_fileLoop
_: ld a, (hl)
dec hl \ ld c, (hl) \ dec hl \ ld b, (hl) \ dec hl
cp fsDirectory
jr z, .handleDirectory
cp fsSymLink ; TODO: Symlinks to directories?
cp fsEndOfTable
jr z, findFileEntry_handleEndOfTable
.continueSearch:
or a
sbc hl, bc
; TODO: Handle running off the page
jr -_
.handleDirectory:
push bc
push hl
ld c, (hl) \ dec hl \ ld b, (hl)
ld hl, (kernelGarbage)
call cpHLBC
jr z, .compareNames
; Not correct parent
pop hl
pop bc
jr .continueSearch
.compareNames:
pop hl \ push hl
ld bc, 5
or a
sbc hl, bc
push de
call compareDirectories
jr z, .updateDirectory
pop de
pop hl
pop bc
jr .continueSearch
.updateDirectory:
inc sp \ inc sp
inc de
push de \ call checkForRemainingSlashes \ pop de
pop hl \ push hl
dec hl \ dec hl
ld c, (hl) \ dec hl \ ld b, (hl)
ld h, b \ ld l, c
ld (kernelGarbage), hl
pop hl
pop bc
jr nz, .continueSearch
or a
sbc hl, bc
jr findFileEntry_fileLoop
findFileEntry_handleEndOfTable:
pop af
pop af
jp po, _
ei
_: pop af
ld a, errFileNotFound
or a ; Resets z
pop bc
pop de
ret
findFileEntry_fileLoop:
; Run once we've eliminated all slashes in the path
_: ld a, (hl)
dec hl \ ld c, (hl) \ dec hl \ ld b, (hl) \ dec hl
cp fsFile
jr z, .handleFile
cp fsSymLink
jr z, .handleLink
cp fsEndOfTable
jr z, findFileEntry_handleEndOfTable
.continueSearch:
or a
sbc hl, bc
jr -_
.handleLink:
; Similar to handling files
push bc
push hl
; Check parent directory ID
ld c, (hl) \ dec hl \ ld b, (hl)
ld hl, (kernelGarbage)
call cpHLBC
jr z, .compareLinkNames
; Not correct parent
pop hl
pop bc
jr .continueSearch
.compareLinkNames:
pop hl \ push hl
ld bc, 3
or a
sbc hl, bc
push de
call compareFileStrings
pop de
pop hl
pop bc
jr z, .linkFound
jr .continueSearch
.handleFile:
push bc
push hl
; Check parent directory ID
ld c, (hl) \ dec hl \ ld b, (hl)
ld hl, (kernelGarbage)
call cpHLBC
jr z, .compareNames
; Not correct parent
pop hl
pop bc
jr .continueSearch
.compareNames:
pop hl \ push hl
ld bc, 8
or a
sbc hl, bc
push de
call compareFileStrings
pop de
pop hl
pop bc
jr z, .fileFound
jr .continueSearch
.fileFound:
ld bc, 3
add hl, bc
pop bc ; pop af
pop af
jp po, _
ei
_: pop af
ld a, b
pop bc
pop de
cp a
ret
.linkFound:
; We need to replace the current path with this link and then start over
; TODO: Consider the implications of using kernelGarbage to store this
; string, what if it's too long?
ld c, (hl)
dec hl
ld b, (hl)
dec hl
or a
sbc hl, bc
ld de, kernelGarbage + 2
.skipNameLoop:
ld a, (hl)
dec hl
or a
jr nz, .skipNameLoop
.loadLinkLoop:
ld a, (hl)
ld (de), a
inc de \ dec hl
or a
jr nz, .loadLinkLoop
pop af
ld de, kernelGarbage + 2
jp startOver@findFileEntry
;; findDirectoryEntry [Filesystem]
;; Finds a directory entry in the FAT.
;; Inputs:
;; DE: Path to directory
;; Outputs:
;; Z: Set on success, reset on failure
;; A: Flash page (on success); Error code (on failure)
;; HL: Address relative to 0x4000 (on success)
;; Notes:
;; This function returns HL=0 for the root directory. You should
;; handle this special case yourself. The root directory has ID 0
;; and has no parent directory.
findDirectoryEntry:
push de
push bc
push af
ld a, i
push af
di
; TODO: Relative paths
setBankA(fatStart)
ld hl, 0
ld (kernelGarbage), hl ; Parent ID
ld hl, 0x7FFF
.search:
ld a, (de)
cp '/'
jr nz, _
inc de
ld a, (de)
_: or a ; cp 0
jr z, .done_root ; Root is a special case
.traversalLoop:
; Traverse the table
ld a, (hl)
dec hl
ld c, (hl)
dec hl
ld b, (hl)
dec hl
cp fsDirectory
jr z, .handleDirectory
cp fsSymLink ; TODO
cp fsEndOfTable
jr z, .endOfTable
_:
.seekandcontinue:
or a
sbc hl, bc
; TODO: Handle swapping out next page
jr .traversalLoop
.skip:
inc hl
inc hl
inc hl
inc hl
inc hl
jr -_
.handleDirectory:
; Check parent IDs
push bc
push hl
ld c, (hl)
dec hl
ld b, (hl)
dec hl
push hl
ld hl, (kernelGarbage)
call cpHLBC
pop hl
jr z, _
pop hl
pop bc
jr -_
_: ; Parent IDs match, check name
ld c, (hl)
dec hl
ld b, (hl) ; Grab new directory ID just in case
dec hl
dec hl ; Skip flags
push de
call compareDirectories
jr z, _
pop de
pop hl
pop bc
jr .seekandcontinue
_: inc sp \ inc sp ; pop de
; Directories match, update kernelGarbage
ld (kernelGarbage), bc
; We might be done here
ld a, (de)
cp '/'
jr nz, _
inc de
ld a, (de)
_: or a ; cp 0
jr nz, .continue
; We are done!
pop hl
pop bc
ld bc, 3
add hl, bc
jr .done
.continue:
inc sp \ inc sp ; pop hl
pop bc
dec hl
jr .traversalLoop
.endOfTable:
pop af
jp po, _
ei
_: pop af
pop bc
pop de
or 1
ld a, errFileNotFound
ret
.done_root:
ld hl, (kernelGarbage)
.done:
getBankA
ld b, a
pop af
jp po, _
ei
_: pop af
ld a, b
pop bc
pop de
cp a
ret
;; fixKFS [Filesystem]
;; Fixes issues found from [[checkFilesystem]]
fixKFS:
; TODO
ret
;; checkFilesystem [Filesystem]
;; Checks the integrity of the filesystem and sets certain bits of A with the results.
;; Outputs:
;; A=0: No problems
;; A/1: Unformatted pages found
;; A/2: Invalid FAT entries found
;; A/3: Invalid heap blocks found
;; A/4: Unclosed new file entries found
;; Notes:
;; Passing A into [[fixFilesystem]] is the appropriate course of action if A is nonzero.
checkKFS:
; TODO
ret
; Checks string at (DE) for '/'
; Z for no slashes, NZ for slashes
checkForRemainingSlashes:
ld a, (de)
or a ; CP 0
ret z
cp '/'
jr z, .found
inc de
jr checkForRemainingSlashes
.found:
; Check for one last slash
or a
ret
; Compare string, but also allows '/' as a delimiter. Also compares HL in reverse.
; Also allows for paths to have a trailing '/'
; Z for equal, NZ for not equal
; HL = backwards string
; DE = fowards string
compareDirectories:
ld a, (de)
or a
jr z, .return
cp '/'
jr z, .return
cp ' '
jr z, .return
cp (hl)
ret nz
dec hl
inc de
jr compareDirectories
.return:
ld a, (hl)
or a
ret
; Compare File Strings (HL is reverse)
; Z for equal, NZ for not equal
; Inputs: HL and DE are strings to compare
compareFileStrings:
ld a, (de)
or a
jr z, .return
cp ' '
jr z, .return
cp (hl)
ret nz
dec hl
inc de
jr compareFileStrings
.return:
ld a, (hl)
or a
ret
;; renameFile [Filesystem]
;; Renames a file.
;; Inputs:
;; DE: Path to file (string pointer)
;; HL: New filename
;; Outputs:
;; Z: Set if the file was renamed, reset if file did not exist
;; A: Preserved on success, error code on failure
renameFile:
push hl \ push ix \ push bc \ push de \ push iy
push af
ld a, i
push af
push hl
; Set the filetype to indicate the file's modified
call findFileEntry
jr nz, .notFound
setBankA
di
ld a, fsModifiedFile
call unlockFlash
call writeFlashByte
call lockFlash
push hl \ pop ix
pop hl
; Copy everything but the filename to a new entry
ld e, (ix + -3)
ld d, (ix + -4)
ld c, (ix + -6)
ld b, (ix + -7)
ld a, (ix + -9) \ ld iyl, a
ld a, (ix + -10) \ ld iyh, a
ld a, (ix + -8)
call createFileEntry
pop af
jp po, _
ei
_: pop af
jr .done
.notFound:
pop hl
ld h, a
pop af
jp po, _
ei
_: pop af
or 1
ld a, h
.done:
pop iy \ pop de \ pop bc \ pop ix \ pop hl
ret
| 22.580895 | 96 | 0.471969 |
d77266ab021d95ead19e15659ac8f8f2ab4517c4 | 2,379 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_24_1271.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_24_1271.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca.log_24_1271.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r11
push %r13
push %r14
push %rax
push %rbp
push %rcx
push %rsi
lea addresses_WC_ht+0x1e045, %rsi
nop
nop
inc %rcx
mov $0x6162636465666768, %r11
movq %r11, %xmm5
movups %xmm5, (%rsi)
nop
and %r14, %r14
lea addresses_normal_ht+0x1311d, %r13
nop
nop
nop
nop
xor %rbp, %rbp
movl $0x61626364, (%r13)
nop
nop
nop
nop
and $42383, %r11
lea addresses_normal_ht+0x315, %r13
clflush (%r13)
nop
nop
and $61337, %r14
mov (%r13), %eax
nop
and $17224, %rax
lea addresses_A_ht+0xdf45, %rbp
nop
and %rcx, %rcx
mov (%rbp), %r11
nop
nop
nop
mfence
lea addresses_D_ht+0x13585, %rsi
nop
cmp %r13, %r13
mov (%rsi), %bp
xor %r13, %r13
pop %rsi
pop %rcx
pop %rbp
pop %rax
pop %r14
pop %r13
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r15
push %r8
push %r9
push %rbx
push %rcx
// Store
mov $0x4197cc0000000c55, %r13
nop
nop
nop
nop
nop
xor %r15, %r15
mov $0x5152535455565758, %rcx
movq %rcx, %xmm5
vmovups %ymm5, (%r13)
and $15789, %r13
// Faulty Load
lea addresses_normal+0x12445, %r12
nop
cmp %r9, %r9
mov (%r12), %ebx
lea oracles, %r15
and $0xff, %rbx
shlq $12, %rbx
mov (%r15,%rbx,1), %rbx
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_normal', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 32, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 4}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 4, 'NT': False, 'type': 'addresses_normal', 'same': True, 'AVXalign': False, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'size': 16, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 4, 'NT': True, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 5}}
{'34': 24}
34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34 34
*/
| 20.161017 | 128 | 0.648172 |
cc68c7f2cc5e497e2a6c86c3e16cc36ab268fb09 | 37,190 | asm | Assembly | dev/emm386/umbseg.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | dev/emm386/umbseg.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | dev/emm386/umbseg.asm | minblock/msdos | 479ffd237d9bb7cc83cb06361db2c4ef42dfbac0 | [
"Apache-2.0"
] | null | null | null | .386p
page 58,132
;******************************************************************************
title EMM - Expanded Memory Manager interface for EMM386
;******************************************************************************
;
; (C) Copyright MICROSOFT Corp. 1986-1991
;
; Title: EMM386.EXE - MICROSOFT Expanded Memory Manager 386 Driver
;
; Module: EMM - Expanded Memory Manager interface
;
; Version: 2.05
;
; Date: June 28, 1991
;
; Author: Harish Naidu
;
;******************************************************************************
;
; Change Log:
;
; DATE REVISION Description
; -------- -------- --------------------------------------------
; 06/28/91 original
;
;******************************************************************************
; Functional Description:
;
; This module contains most of R1_CODE segment. The other files that
; contain R1_CODE are vcpi.asm and errhndlr.asm. This segment will be
; moved into UMBs if noems or ram is specifed in the emm386.exe device
; line. The user can use nohi to prevent this segment from going into
; UMBs.
;
;******************************************************************************
page
;******************************************************************************
; P U B L I C D E C L A R A T I O N S
;******************************************************************************
;
public UMBFARTABLE
public UMBADDRLEN
public EMM_rFarEntry
public StrategyEntry
public InterruptEntry
public rInt13HEntry
public ReqPtr
public OldInt13
public PrevInt4B
public rINT4BhHandler
public I13SectTrans
public I13DriveTrap
public SectorsInDMABuffer
public LongSectorsInDMABuffer
public CopyInstData
public ValidPathFar
public PrevXmm
public rXMMentry
public XMMAllocHMAFar
public XMMDeallHMAFar
public checkXMMFar
public PrevInt10
public PrevInt11
public Int10_Hook
public Int11_Hook
public chkMcStateFar
public EHFarReturn
page
;******************************************************************************
; L O C A L C O N S T A N T S
;******************************************************************************
;
include vdmseg.inc
include vdmsel.inc
include vm386.inc
include emm386.inc
include emmfunct.inc
include emmdata.inc
include driver.equ
include driver.inc
include i13.inc
include winemm.inc
include xmm.inc
include desc.inc
;******************************************************************************
; E X T E R N A L R E F E R E N C E S
;******************************************************************************
;
_TEXT segment
extrn EMSDispatcher:far
extrn EnterVirtual:far
extrn VCPIDispatcher:far
_TEXT ends
LAST segment
extrn Init_CEMM386:far ; initializes VDM,EMM, and driver
extrn Inv_DOS_msg:byte
extrn InitMessage:byte
LAST ends
R1_CODE segment
extrn CEMMpath:byte
extrn EHReturnFar:byte
extrn end_of_R1_CODE:byte
R1_CODE ends
R_CODE segment
;
; This table contains dword ptrs thru which R_CODE accesses R1_CODE.
; The actual segment value of R1_CODE is patched into this table
; if R1_CODE is moved in MovUmbSeg in init.asm
;
EVEN
UMBFARTABLE LABEL WORD
EMM_rFarEntry DW OFFSET R1_CODE:EMM_rEntryFar , seg R1_CODE
EMM_rFarReturn DW OFFSET R1_CODE:EMM_rReturnFar , seg R1_CODE
EMM_vFarReturn DW OFFSET R1_CODE:EMM_vReturnFar , seg R1_CODE
StrategyEntry DW OFFSET R1_CODE:STRATEGY_Far , seg R1_CODE
InterruptEntry DW OFFSET R1_CODE:Interrupt_Far , seg R1_CODE
rInt13HEntry DW OFFSET R1_CODE:rFarINT13hHandler, seg R1_CODE
CopyInstData DW OFFSET R1_CODE:Copy_Inst_Data , seg R1_CODE
ValidPathFar DW OFFSET R1_CODE:ValidatePath , seg R1_CODE
XMMAllocHMAFar DW OFFSET R1_CODE:XMMAllocateHMA , seg R1_CODE
XMMDeallHMAFar DW OFFSET R1_CODE:XMMDeallocateHMA , seg R1_CODE
checkXMMFar DW OFFSET R1_CODE:check_XMM , seg R1_CODE
chkMcStateFar DW OFFSET R1_CODE:chk_machine_state, seg R1_CODE
EHFarReturn DW OFFSET R1_CODE:EHReturnFar , seg R1_CODE
UMBADDRLEN EQU ($ - UMBFARTABLE) / 4
extrn GoVirtualMode:near
extrn GoRealMode:near
extrn GoProtMode:near
extrn ChkA20:near
extrn Devname:byte
extrn ELIM_Entry:far ; general entry for CEMM functions
extrn SIG_LENGTH:abs
extrn Linkbuf_length:abs
extrn EMMGIDataVer:word
extrn XMMcontrol:dword
extrn DriverVersion:word
R_CODE ends
R_CODE segment
assume cs:R_CODE
;-------------------------------------------------------------------------
;
; Far interfaces to routines in R_CODE segment. Note that these far
; interfaces are used only by the routine EMM_rEntryFar and hence their
; returns are hard coded.
;
;------------------------------------------------------------------------
FarGoVirtualMode proc far
call GoVirtualMode
jmp dword ptr cs:[EMM_vFarReturn]
FarGoVirtualMode endp
FarGoRealMode proc far
call GoRealMode
jmp dword ptr cs:[EMM_rFarReturn]
FarGoRealMode endp
FarGoProtMode proc far
call GoProtMode
PJmp R1CODE_GSEL,R1_CODE:EMS_Entry
FarGoProtMode endp
FarChkA20 proc far
call ChkA20
ret
FarChkA20 endp
R_CODE ends
R1_CODE segment
assume cs:R1_CODE
;#########################################################################
;
; EMM_rEntryFar - real/virtual mode entry point for EMM function calls
;
; ENTRY:
; real/virtual mode
; GS = R_CODE
;
; EXIT:
; real/virtual mode
;
; DESCRIPTION:
; If CEMM is off then an appropriate error code is returned in AH.
; If CEMM is in auto mode and off then the EMS call is done from here
; and CEMM is returned in either auto off state or ON state. If CEMM
; is on this this call simply reflects it back to the protected entry
; point.
;
;##########################################################################
EMM_rEntryFar proc far
; The interrupts are cleared in case the user didn't use the
; int opcode but just pushed the flags and called.
cli
;
; If CEMM is active (ON) then the call to here is done so that
; any routines that patched out int 67h will be done first.
; Now the EMMp_Entry routine is called with the flag set.
;
test gs:[Current_State],fState_Active
jz short EMM_rChkOFF
or gs:[TrapFlags],fI67trap
int 67h
ret
;
; If CEMM is off then an appropriate error code needs to be set.
;
EMM_rChkOFF:
cmp gs:[Current_Mode],MODE_OFF
jne short EMM_protected_mode
mov ah,EMM_SW_MALFUNCTION
ret
;
; At this point EMM386 is inactive. Which means UMBs could not have
; been present. Hence this segment could not have been in UMBs.
; Therefore the following code is free to switch modes.
;
EMM_protected_mode:
;
; The user stack is changed to the CEMM Real Stack
;
mov gs:[UserSS],ss
mov gs:[UserSP],sp
push seg R_STACK
pop ss
lea sp,R_STACK:RealStackTop
;
; The user's segment registers are pushed on the stack.
;
push gs
push fs
push es
push ds
call far ptr chk_machine_state
; Q: is the machine in real mode
jc Emm_rError1 ; N: return error
mov gs:[UserDS],ds
mov gs:[UserES],es
;
; The A20 line is activated and the system taken in protected
; mode.
;
call FarChkA20
jmp FarGoProtMode
EMS_Entry:
jc EMM_rError
;
; The DS and GS selectors are set up.
;
push VDMD_GSEL
pop ds
assume ds:_DATA
push RCODEA_GSEL
pop gs
assume gs:R_CODE
;
; Save CEMM real stack and change to protected mode stack
;
mov gs:[RealSS],ss
mov gs:[RealSP],sp
push VDMS_GSEL
pop ss
mov sp,gs:[StackTop]
push gs:[UserES]
push gs:[UserDS]
;
; The function number is saved and the call done.
;
mov [function_number],ah
;
; Check to see if its a VCPI function or EMS function. Call
; proper dispatcher.
;
cmp ah,VCPI_FUNCTION_OPCODE
je short ErE_VCPI_function
PCall VDMC_GSEL,_TEXT:EMSDispatcher
jmp short ErEcont
ErE_VCPI_function:
PCall VDMC_GSEL,_TEXT:VCPIDispatcher
ErEcont:
;
; Restore CEMM real stack
;
mov ss,gs:[RealSS]
mov sp,gs:[RealSP]
;
; Failures (namely invalid functions) should not turn on.
;
cmp ah,0
jne short EMM_rRetReal
;
; The function is checked for the status call. If anything
; but status is done then take CEMM in ON mode.
;
cmp [function_number],EMS_STATUS_FUNCTION
JE SHORT EMM_rRetReal ; Y: Return to real mode ;@PIW
EMM_turn_CEMM_on:
PCall VDMC_GSEL, _TEXT:EnterVirtual
PJmp RCODE_GSEL, R_CODE:FarGoVirtualMode
EMM_vReturnFar:
mov gs:[Current_Mode],MODE_ON
or gs:[Current_State],fState_Active
jmp short EMM_rExit
EMM_rRetReal:
;
; At this point we're in protected mode hence we have to do a far
; jmp
;
PJmp RCODE_GSEL,R_CODE:FarGoRealMode
EMM_rReturnFar:
EMM_rExit:
pop ds
pop es
pop fs
pop gs
;
; Restore user stack
;
mov ss,gs:[UserSS]
mov sp,gs:[UserSP]
ret
EMM_rError:
mov gs:[Current_Mode],MODE_OFF ; set mode to OFF
mov gs:[Devname],'$' ; set to prevent presense detect
and gs:[Current_State],NOT fState_Active ; reset active flag &
EMM_rError1:
mov ah,EMM_SW_MALFUNCTION ; S/W cannot control A20
jmp short EMM_rExit
EMM_rEntryFar endp
;===========================================================================
;
; Routines associated with STRATEGY and INTERRUPT
;
;===========================================================================
; Define the command dispatch table for the driver functions
;
Cmd_Table LABEL NEAR
DW Init_Call ;0 - Initialization
DW Null_Exit ;1 - Media Check
DW Null_Exit ;2 - Get BPB
DW EMM_IOCTL_READ ;3 - IOCTL input
DW Null_Exit ;4 - Input (Destructive)
DW Null_Exit ;5 - No wait input
DW Null_Exit ;6 - Input status
DW Null_Exit ;7 - Input buffer flush
DW Null_Exit ;8 - Output (Write)
DW Null_Exit ;9 - Output with verify
DW Null_Exit ;A - Output status
DW Null_Exit ;B - Output buffer flush
DW Null_Exit ;C - IOCTL output
TBL_LENGTH EQU (THIS BYTE-CMD_TABLE)/2
ReqPtr label dword ; dword ptr to Request Header
ReqOff dw 0 ; saved offset of Request Header
ReqSeg dw 0 ; saved segment of Request Header
fFirstTime db 0 ; first time initialization flag
;=============================================================================
STRATEGY_Far proc far
mov cs:[ReqOff],bx ;Save header offset
mov cs:[ReqSeg],es ;Save header segment
ret
STRATEGY_Far endp
;******************************************************************************
; Interrupt - device driver interrupt routine for CEMM
;
; ENTRY: R1_CODE:ReqPtr = pointer to request header.
;
; EXIT: Request completed.
;
; USED: none
;
;******************************************************************************
Interrupt_Far proc far
push ax
push bx
push cx
push dx
push si
push di
push ds
push es
cld ;All strings forward
lds bx,CS:[ReqPtr] ;DS:BX pts to Request Header
mov al,[bx].COMMAND_CODE ;Get the command code
cmp al,TBL_LENGTH ;Check for validity
jae short Invalid ;Jump if command invalid
cbw ;Command to a full word
shl ax,1 ;Compute dispatch index
mov si,OFFSET Cmd_Table ;Point to dispatch table
add si,ax ;Index based on command
call CS:[si] ;Call correct routine
;
; ENTRY: AX = Status field for Request Header
;
FINISH:
lds bx,CS:[ReqPtr] ;Get request header ptr.
or ah,DON ;Set done bit in status
mov DS:[bx.STATUS_WORD],ax ;Save status in header
pop es ;Restore the ES register
pop ds
pop di
pop si
pop dx
pop cx
pop bx
pop ax
ret
Invalid:
mov al,UNK_COMMAND ; unknown command
mov ah,ERR ; error
stc
jmp SHORT Finish
Interrupt_Far endp
;******************************************************************************
; Null_Exit: do nothing
;
; ENTRY: DS:BX pts to request header
;
; EXIT: No error returned.
; CLC
;
;******************************************************************************
Null_Exit proc near
;
xor ax,ax
clc
ret
;
Null_Exit endp
;******************************************************************************
; Init_Call - call initialization routine
;
; ENTRY: DS:BX pts to request header
;
; EXIT: AX = status field for request header
;
;******************************************************************************
Init_Call proc near
;
cmp cs:[fFirstTime], 0 ; Will be called twice if 2 device
jne init_done ; headers used, only init once
inc cs:[fFirstTime] ; Don't init again
call Init_CEMM386
init_done:
ret
;
Init_Call endp
;
; Dispatch Table for IOCTL read ax=4402
;
EMMRDTBL DB 05
DW Rtn_Signet
dw EMMGlobImpIOCTL
dw GetVersion
dw GetEMSMinMax
dw GetUMBsegInfo
;###########################################################################
;
; Procedure name : EMM_IOCTL_READ
;
; Entry: The destination buffer pointed to by the request header points to
; an 8 byte buffer whos first byte is a function code (either 0 or 1)
;
; exit: the appropriate function is executed if wrong code then error.
;
;############################################################################
EMM_IOCTL_READ proc near
push ax
push si
les di,ds:[bx+14] ; es:di -> dest. buffer
mov al,es:[di] ; al = command code
cmp al,cs:[EMMRDTBL]
jae IOCTLerr
cbw
mov si,ax
shl si,1
call cs:word ptr [EMMRDTBL][1][si]
xor ax,ax
IOCTLexit:
pop si
pop ax
ret
IOCTLerr:
mov al,UNK_COMMAND ; unknown command *C
mov ah,ERR ; error *C
mov word ptr DS:[bx+18],0 ; no bytes transferred *C
jmp short IOCTLexit
EMM_IOCTL_READ endp
;*****************************************************************************C
; Rtn_Signet - return signature and entry address *C
; *C
; ENTRY: DS:BX pts to request header *C
; *C
; EXIT: AX = status field for request header *C
; *C
;*****************************************************************************C
Rtn_Signet proc near ; special read request from CEMM.EXE *C
cmp word ptr DS:[bx+18],Linkbuf_length ; make sure our length *C
jne short Rerr ; *C
mov word ptr ES:[di],SIG_LENGTH ; send back signature length *C
mov word ptr ES:[di+2],OFFSET ELIM_Entry ; entry offset *C
mov word ptr ES:[di+4],SEG ELIM_Entry ; entry segment *C
xor ax,ax ; good status *C
ret ; *C
; *C
Rerr: mov al,UNK_COMMAND ; unknown command *C
mov ah,ERR ; error *C
mov word ptr DS:[bx+18],0 ; no bytes transferred *C
ret ; *C
Rtn_Signet endp ; *C
;==============================================================================
;==
;== GetVersion: Returns version of CEMM/EMM386 driver.
;==
;== Entry: Buffer is pointed to by request header.
;== DS:BX = Request Header
;== ES:DI = Destination Buffer
;==
;== Exit: Fills buffer with version number of CEMM/EMM386 driver.
;==
;==============================================================================
GetVersion proc near
push ax
push gs
mov ax, seg R_CODE
mov gs, ax
cmp word ptr ds:[bx][18],2 ;Q: Must be a 2 byte buffer?
jne short GVerror ; N: error
;
; Set version number of driver.
;
mov ax,gs:[DriverVersion] ; get driver version number
mov es:[di],ax ; return address
; Also an entry point from GetEMSMinMax
GVexit:
pop gs
pop ax
ret
;
; Error return, also an entry point from GetEMSMinMax
;
GVerror:
mov al,UNK_COMMAND ; unknown command
mov ah,ERR ; error
mov word ptr ds:[bx][18],0 ; no bytes transferred
jmp short GVexit
GetVersion endp
;==============================================================================
;==
;== GetEMSMinMax: Returns max/min EMS/VCPI size info
;==
;== Entry: Buffer is pointed to by request header.
;== DS:BX = Request Header
;== ES:DI = Destination Buffer
;==
;== Exit: Fills buffer with max & min EMS/VCPI pool size
;==
;==============================================================================
GetEMSMinMax proc near
push ax
push gs
push seg R_CODE
pop gs
cmp word ptr ds:[bx][18],4 ;Q: Must be a 4 byte buffer?
jne short GVerror ; N: error
mov ax, gs:[MaxEMSpool]
mov es:[di], ax
mov ax, gs:[MinEMSpool]
mov es:[di+2], ax
jmp short GVexit
GetEMSMinMax endp
;==============================================================================
;==
;== GetUMBsegInfo: Returns location and size of UMB segment
;==
;== Entry: Buffer is pointed to by request header.
;== DS:BX = Request Header
;== ES:DI = Destination Buffer
;==
;== Exit: Fills buffer with UMB segment paragraph address & length, and
;== count of WIN= pages
;==
;==============================================================================
GetUMBsegInfo proc near
push ax
push gs
push seg R_CODE
pop gs
cmp word ptr ds:[bx][18],6 ;Q: Must be a 6 byte buffer?
jne short GVerror ; N: error
mov ax, gs:[segR1_CODE]
mov es:[di], ax
mov ax, offset R1_CODE:end_of_R1_CODE
add ax, 0fh
shr ax, 4 ;round size up to nearest paragraph
mov es:[di+2], ax
mov ax, gs:[cntWinPages] ;count of WIN= pages
mov es:[di+4], ax
jmp short GVexit
GetUMBsegInfo endp
;==============================================================================
;==
;== EMMGlobImpIOCTL: Windows opens that "EMMXXX0" device and does a read IOCTL.
;== This routine fills up a buffer with version information
;== and the physical address of the EMM Global Import Data
;== Structure.
;==
;== Entry: Buffer is pointed to by request header.
;== DS:BX = Request Header
;== ES:DI = Destination Buffer
;==
;== Exit: Fills buffer with version number and physical address of EMM
;== Global Import Data Structure.
;==
;==============================================================================
EMMGlobImpIOCTL proc near
push ebx
push gs
push seg R_CODE
pop gs
cmp word ptr ds:[bx][18],6 ;Q: Must be a 6 byte buffer?
jne short EGIIerror ; N: error
mov ebx,gs:[PageD_Addr] ; get physical address of PD
;
; Set physical address for EMM Global Import Data Structure
;
add ebx,PAGE_SIZE ; PF0 address: used for data structure
mov es:[di],ebx ; return address
;
; Set version of EMM Global Import Interface to execute
;
mov bx,gs:[EMMGIDataVer]
xchg bh,bl
mov es:[di][4],bx
EMMGIIOCTLexit:
pop gs
pop ebx
ret
;
; Error return
;
EGIIerror:
mov al,UNK_COMMAND ; unknown command
mov ah,ERR ; error
mov word ptr ds:[bx][18],0 ; no bytes transferred
jmp short EMMGIIOCTLexit
EMMGlobImpIOCTL endp
;==========================================================================
;
; DATA and CODE for INT13Handler
;
;==========================================================================
I13SectTrans db 0 ; Number of sectors transferred
I13DriveTrap dd -1 ; Initially, trap all drives
SectorsInDMABuffer db 0 ; Sectors in DMA buffer
db TotalDrives-1 dup (0)
LongSectorsInDMABuffer db 0 ; Long Sectors in DMA buffer
db TotalDrives-1 dup (0)
OldInt13 dd ?
;==============================================================================
;==
;== rFarINT13hHandler:
;==
;== This is an interrupt 13h handler which monitors activity to
;== the drives for DMA purposes. If it detects a user buffer
;== (ES:BX) in an EMS window and its corresponding physical
;== memory is discontiguous, the operation will be modified.
;==
;== 1) The operation will be broken down to multiple read/
;== write requests, each being less than the DMA buffer.
;==
;== 2) If a format request is encountered, a flag will be
;== set so the DMA programming by the ROM will be modified
;== not to use a 64K buffer.
;==
;== Entry: (Real Mode)
;== INT 13h interface
;==
;== Exit:
;==
;==============================================================================
rFarINT13hHandler:
test cl,3Fh ;Q: Sector 0?
jz short rfI13oldHandler ; Y: let the ROM handle it!
cmp ah,READ ;Q: Read request?
je short rI13Buffered ; Y: process
cmp ah,WRITE ;Q: Write request?
je short rI13Buffered ; Y: process
cmp ah,LONG+READ ;Q: Long read request?
je short rI13Buffered ; Y: process
cmp ah,LONG+WRITE ;Q: Long write request?
je short rI13Buffered ; Y: process
jmp short rfI13oldHandler
rI13oldHandlerX:
pop edx
rfI13oldHandler:
jmp cs:[OldInt13]
rI13Buffered:
push edx
and edx,0FFh ; drive number
btr dx,7 ;Q: Is it a hard drive?
jc short rI13index ; Y: continue
add dx,FixedDrives ; N: floppy data
rI13index:
cmp dx,TotalDrives ;Q: Trap this drive?
jae short rI13oldHandlerX ; N: let ROM handle it
bt cs:[I13DriveTrap],edx ;Q: Trap this drive?
jnc short rI13oldHandlerX ; N: let ROM handle it
;M012: use ah to test for LONG
test ah,LONG ;Q: Long sectors?
jnz rI13LongIO ; Y: use long sectors
cmp al,cs:[SectorsInDMABuffer][edx]
;Q: Will it fit in DMA buffer?
jbe short rI13oldHandlerX ; Y: let ROM go ahead
jmp short rI13ProcessIO ; N: process IO
rI13LongIO:
cmp al,cs:[LongSectorsInDMABuffer][edx]
;Q: Fit in DMA buffer?
jbe short rI13oldHandlerX ; Y: let ROM go ahead
rI13ProcessIO:
pop edx
push ebx
push ecx
push edx
push esi
push es
push fs ;
push seg R_CODE ;
pop fs ;
;
; Need to trap into protected mode to check for a contiguous buffer for floppy.
; If buffer is not contiguous, the I/O will be broken down to no larger than
; the DMA buffer size.
;
rI13SetUpIO:
or fs:[TrapFlags],fI13trap ; QHKN:trap this next int 13h
int 13h ; and set up for next I/O
push fs ; save fs as the NCR386SX's SCSI ROM
; destroys it
pushf
cli
call cs:[OldInt13] ; Q: Error on the I/O
pop fs ; restore fs
jc short rI13Return ; Y: return the error
test fs:[TrapFlags],fI13trap ;Q: Is the I/O request complete?
jnz rI13SetUpIO ; N: set up for the next I/O
mov al,cs:[I13SectTrans] ; Y: return total sectors transferred
rI13Return:
pushf ; need to preserve carry flag
and fs:[TrapFlags],not fI13trap ; don't trap next int 13h **128KDMA
popf
pop fs ;
pop es
pop esi
pop edx
pop ecx
pop ebx
retf 02 ; and return to caller
;===========================================================================
;
; INT 4B Handler and data
;
;============================================================================
PrevInt4B dd 0 ; The old int4B vector
;==============================================================================
;==
;== rINT4BhHandler: This is an entry point to the DMA/bus master services.
;==
;== Entry: (Real Mode)
;==
;== Exit:
;==
;==============================================================================
rINT4BhHandler:
push bp
mov bp,sp
pushf
push fs
push seg R_CODE
pop fs
assume fs:R_CODE
cmp ah,81h ;Q: DMA/bus master service request
jne short rI4BoldHandler ; N: chain it down
;
; Need to trap into protected mode handler.
;
push ds
push seg ABS0
pop ds
assume ds:ABS0
test [DBSflag],fDBSactive ;Q: Active?
pop ds ; - restore DS
jz short rI4BoldHandler ; N: chain it down
or fs:[TrapFlags],fI4Btrap ; trap into DMA/bus master services
pop fs
popf
int 4Bh
push ax ; save ax
pushf
pop ax ; return flags
xchg ax,[bp].INT_FLAGS ; entry flag in AX, return flags on stack
and ax,FLAGS_IF ; restore entry IF
or [bp].INT_FLAGS,ax
pop ax
pop bp
iret
rI4BoldHandler:
test fs:[GenFlags], fMCA ; Q: MCA
jz short rI4BISA ; N: check is old vector 0
push ds
push 40h
pop ds
test byte ptr ds:[7bh], 8 ; Q is bit 3 of byte at 40:7b set
pop ds
jnz short rI4BChain ; Y: chaining required
cmp word ptr cs:[PrevInt4B+2], 0e000h
; Q: is previous seg e000
je short rI14Biret ; Y: don't chain, return
cmp word ptr cs:[PrevInt4B+2], 0f000h
; Q: is previous seg f000
je short rI14Biret ; Y: don't chain, return
rI4BISA:
cmp cs:[PrevInt4B],0 ;Q: Is old vector ZERO?
jz short rI14Biret ; Y: don't chain, return
rI4BChain:
pop fs
popf
pop bp
jmp cs:[PrevInt4B]
rI14Biret:
pop fs
popf
pop bp
iret
;==========================================================================
;
; Windows Interface Code and data
;
;==========================================================================
assume ds:nothing,es:nothing,fs:nothing,gs:nothing
;===========================================================================
;
; Copy_Inst_Data
;
; DESCRIPTION:
; This procedure will copy instance data fields from the Windows/386 3.00
; initialization data structure that specify instance data in Upper Memory
; Blocks into a table inside of a LIMulator. When Copy_Inst_Data returns
; it will have filled in the LIMulator's table and removed the entries from
; the Win386 initialization data structure.
;
; ENTRY:
; CX = Maximum number of entries to copy (6 bytes each)
; ES:DI -> Area to copy instance info into
; Table should be of size CX*6+4 (add 4 for term dword 0)
; ESI = Value passed by Windows 3.00 to LIMulator shut down procedure
;
; EXIT:
; If carry flag is clear then
; Success!
; CX = Number of entries NOT used in table
; ES:DI -> Byte past null termination dword in table
; else
; ERROR: Not enough space in table for all instance items
;
; USES:
; DS, EAX, EBX, ECX, EDX, ESI, EDI, EBP, Flags
;
; Version: 1.00
;
; Date: 24-Jul-1990
;
; Author: RAL
;
; Change log:
;
; DATE REV DESCRIPTION
; ----------- --- -----------------------------------------------------------
; 24-Jul-1990 RAL Original
; 25-Jul-1990 RAL Updated documentation
; 26-Jul-1990 RAL Fixed 2 bugs
;
;
;==============================================================================
Copy_Inst_Data PROC far
cld
mov bx, si
and bx, 1111b
shr esi, 4
mov ds, si
cmp BYTE PTR [bx+4Bh], 1
jne CID_Success
mov esi, DWORD PTR [bx+26h]
mov ebx, esi
shr ebx, 4
mov ds, bx
and si, 1111b
;
; At this point DS:SI -> Win386_Startup_Info_Struc
;
push ds
push si
lds si, [si.WSSInstData]
mov ax, ds ; Just to be paranoid...
or ax, si
jz CID_Success
;
; Now move all instance fields from the current table into our private
; table. This code will shift all instance fields that are not in the
; Upper Memory region down. If there are no instance regions remaining
; after the loop then it will zero out the SIS_Instance_Data_Ptr in the
; init data area's fake Int 2Fh data structure.
;
push si
mov bx, si
CID_Move_Data_Loop:
lodsd
test eax, eax ; Q: At the end?
jz CID_At_End_Of_List
mov ebp, eax
shr ebp, 16
shl ebp, 4
movzx edx, ax
add ebp, edx
cmp ebp, 0A0000h ; Q: Is this in a UMB?
jae CID_Found_One ; Y: Copy data into us
; N: Shift into correct pos
;
; This entry does NOT specify instance data in a UMB. Leave it in the
; init data table.
;
mov DWORD PTR [bx], eax
lodsw
mov WORD PTR [bx+4], ax
add bx, 6
jmp CID_Move_Data_Loop
;
; This entry specifies instance data in a UMB. Copy it into our
; internal table if enough room remains.
;
CID_Found_One:
dec cx ; Q: Enough room left?
jl CID_Out_Of_Copy_Space ; N: ERROR!
stosd
movsw
jmp CID_Move_Data_Loop
;
; We're at the end of the list of instance regions. We may have copied
; all of the instance regions into our internal table. If so, then zero
; the SIS_Instance_Data_Ptr in the fake Int 2Fh startup info data structure
; to indicate that there is no instance data. Otherwise, null terminate
; the table and leave the SIS_Instance_Data_Ptr alone.
;
CID_At_End_Of_List:
pop si ; SI->Start of original table
cmp bx, si ; Q: Has copy pointer moved?
je CID_None_Left_In_List ; N: The table is empty
; Y: Still some in table
mov DWORD PTR [bx], eax ; Terminate original table
add sp, 4 ; Junk DS and SI on stack
jmp CID_Success ; Return success!
;
; All of the instance fields were in UMB's -- Zap the entire table
;
CID_None_Left_In_List:
pop si
pop ds ; DS:SI -> Startup info struc
mov [si.WSSInstData], eax ; Zero instance table ptr
;
; In all cases where we return with success, we must null terminate the
; table.
;
CID_Success:
xor eax, eax
stosd ; Terminate internal list
clc ; Indicate that it worked
ret
;
; ERROR: Out of space in internal table. Clear stack and return
; with carry flag set to indicate an error.
;
CID_Out_Of_Copy_Space:
add sp, 6
stc ; Indicate an error
ret
Copy_Inst_Data ENDP
;============================================================================
;
; M010:
;
; Procedure Name : ValidatePath
;
; Inputs : None
;
; Outputs : CY if unable to access file
; ; NC otherwise
;
;============================================================================
ValidatePath proc far
push ds
push si
push bx
push dx
push cx
push ax
push cs
pop ds
lea si,R1_CODE:[CEMMpath]
; ds:si -> ASCIZ file spec
mov bx, 2000h ; read only+compatibilty+supress I24.
mov dx, 1 ; if file exits open it.
xor cx, cx
mov ax, 6c00h ; do extended open
int 21h
jc Vpdone ; error done.
mov bx, ax ; bx has handle
mov ah, 3eh ; close file
int 21h
clc ; it better succeed
Vpdone:
pop ax
pop cx
pop dx
pop bx
pop si
pop ds
ret
ValidatePath endp
;============================================================================
;
; real mode XMS entry Code and Data
;
;============================================================================
;=============================================================================
;== L O C A L D A T A
;=============================================================================
PrevXMM dd 0 ; previous XMM handler's entry point
XMMtrapTable label word
dw offset GetVer ; 0
dw offset HMA ; 1
dw offset HMA ; 2
ifdef MSFLAG
dw offset XeTrap ; 3
dw offset XeTrap ; 4
dw offset XeTrap ; 5
dw offset XeTrap ; 6
dw offset XeTrap ; 7 M005
else
dw offset XePrev ; 3
dw offset XePrev ; 4
dw offset XePrev ; 5
dw offset XePrev ; 6
dw offset XePrev ; 7 M005
endif
dw offset XePrev ; 8
dw offset XePrev ; 9
dw offset XePrev ; 10
dw offset XePrev ; 11
dw offset XePrev ; 12
dw offset XePrev ; 13
dw offset XePrev ; 14
dw offset XePrev ; 15
dw offset UMB ; 16
dw offset UMB ; 17
MaxXMMtrap equ ($-XMMtrapTable)/2
;==============================================================================
;==
;== rXMMentry: CEMM XMM real mode entry point.
;==
;== Enter:
;==
;== Exit:
;==
;==============================================================================
rXMMentry proc far
jmp short XeCont ; allow hooking of XMS
nop
nop
nop
XeCont:
pushf
push ecx
push es
push seg R_CODE
pop es
assume es:R_CODE
test es:[Current_State],fState_Active
jz short XePrev
cmp ah,MaxXMMtrap
jae short XePrev
movzx ecx,ah
jmp cs:[XMMtrapTable][ecx*2]
XePrev:
pop es
pop ecx
popf
jmp dword ptr cs:[PrevXMM] ; previous XMS handler
GetVer:
cmp es:[HMAptr],100000h ;Q: Virtual HMA?
je short XePrev ; N: don't trap
pop es
pop ecx
popf
call dword ptr cs:[PrevXMM] ; call previous XMS handler
mov dx,1 ; indicate the HMA exists
jmp short XeExit
HMA:
cmp es:[HMAptr],100000h ;Q: Virtual HMA?
je short XePrev ; N: don't trap
jmp short XeTrap
UMB:
cmp es:[UMBptr],0 ;Q: UMB manager?
je short XePrev ; N: don't trap
XeTrap:
cli ; no interrupts allowed before TRAP
or es:[TrapFlags],fXMMtrap ; trap this function
pop es
int ProtTrap
pop ecx
popf
XeExit:
ret
rXMMentry endp
;*****************************************************************************;
;*** XMMAllocateHMA - allocate HMA ;
; ;
; This routine is used to allocate HMA area ;
; ;
; ENTRY none ;ds = _DATA ;
; EXIT CY: set if not available ;
; USES ax, flags modified ;
; ;
;*****************************************************************************;
XMMAllocateHMA proc far
push ax
push dx
push fs
mov dx, seg R_CODE
mov fs, dx
assume fs:R_CODE
mov dx,0FFFFh ; requesting entire HMA
mov ah,XMM_REQUEST_HMA
call fs:[XMMcontrol]
or ax,ax ;Q: Error?
jz short XAHerr ; Y: set carry
or fs:[GenFlags],fHMA
clc
XAHexit:
pop fs
pop dx
pop ax
ret
XAHerr:
stc
jmp short XAHexit
XMMAllocateHMA endp
;*****************************************************************************;
;*** XMMDeallocateHMA - Deallocate HMA ;
; ;
; This routine is used to deallocate HMA area ;
; ;
; ENTRY none ;ds = _DATA ;
; EXIT CY: set if unable to deallocate HMA ;
; USES ax, flags modified ;
; ;
;*****************************************************************************;
XMMDeallocateHMA proc far
push ax
push fs
mov ax, seg R_CODE
mov fs, ax
assume fs:R_CODE
mov ah,XMM_RELEASE_HMA
call fs:[XMMcontrol]
or ax,ax
jz short XDHerr
and fs:[GenFlags],not fHMA
clc
XDHexit:
pop fs
pop ax
ret
XDHerr:
stc
jmp short XDHexit
XMMDeallocateHMA endp
;******************************************************************************
; check_XMM: routine to check presence of XMM driver
;
; ENTRY: DS = _DATA
; EXIT: [msg_flag] set with error number if error occur
; USED: none
;
;******************************************************************************
check_XMM proc far
;
; determine whether or not an XMM driver is installed
;
push ax
push fs
mov ax,seg R_CODE
mov fs,ax
assume fs:R_CODE
and fs:[GenFlags],not fXMM ; assume XMM not invoked
mov ax,XMM_MULTIPLEX SHL 8 + XMM_INSTALL_CHECK
int 2Fh
cmp al,80h ; Q: installed
jne short cXMM_no_driver ; N: set error, quit
;
; get the XMM control functions entry point, save it, we
; need to call it later.
;
push bx
push dx
push es
mov ax,XMM_MULTIPLEX SHL 8 + XMM_FUNCTION_ADDR
int 2Fh
mov word ptr fs:[XMMcontrol], bx
mov word ptr fs:[XMMcontrol+2],es
; M009 : EMM386 always uses XMS driver for A20 control
; But we leave CEMM as it is with the 'ifndef'
ifndef MSFLAG ; M009
;
; Has XMM already stolen all extended memory?
mov ax,8800h
int 15h
or ax,ax ;Q: XMM invoked?
jnz short cXMMexit ; N: don't use it
endif ; M009
or fs:[GenFlags],fXMM ; Y: use it for A20 control
cXMMexit:
clc
pop es
pop dx
pop bx
pop fs
pop ax
ret ; done
;
; set carry if XMM driver not present
;
cXMM_no_driver:
stc
pop fs
pop ax
ret
check_XMM endp
;=========================================================================
;
; Int 10 and int 11 handlers
;
;=========================================================================
PrevInt10 dd 0 ; The old int10 vector
PrevInt11 dd 0 ; The old int11 vector
;******************************************************************************
; Int10_Hook - Int 10 hook when EGA present and using E000h page frame
;
; This hook is necessary when the E000h segment is used for the page
; frame and an EGA is in the system. In this case CEMM "moves" the
; EGA ROM back to C000h by modifying the page table entry for C000h
; linear to point to E000h physical. Additionally, CEMM changes the
; int 10h, int 1fh, and int 43h vectors. Changing the int 10h vector
; could be a problem if a program had already chained into the int 10h
; vector and had saved the E000 segment for the EGA vector. If CEMM
; subsequently "moved" the EGA ROM away from E000h, the int10h chain
; would not work. To fix this, CEMM attempts to placed itself at the
; end of the int10h chain by patching int10h at device driver load
; time. This allows CEMM to change the EGA segment in it's in10h
; hook when necessary and everything should work fine then.
;
; ENTRY: Real Mode/Virtual Mode
;
; EXIT: same as entry
; chains on to current "true" int 10h vector.
;
; USED: none
;
;******************************************************************************
Int10_Hook proc near
jmp CS:[PrevInt10] ; chain to previous Int 10h
Int10_Hook endp
;******************************************************************************
; Int11_Hook - Int 11 hook when Weitek processor present
;
; This hook is used when the Weitek processor is present. It returns
; bit 23 of EAX = 1 when the Weitek mapping is enabled.
;
; ENTRY: Real Mode/Virtual Mode
;
; EXIT: bit 32 of EAX = 0 => Weitek mapping is disabled
; bit 32 of EAX = 1 => Weitek mapping is enabled
;
; USED: none
;
;******************************************************************************
Int11_Hook proc near
pushf
call CS:[PrevInt11] ; call previous int 11 handler
; default to Weitek not mapped
and eax,((NOT fI11h_Weitek_Map) SHL 16) + 0FFFFh
push fs
push seg R_CODE
pop fs
assume fs:R_CODE
test fs:[Current_State],fState_Active;Q: CEMM active ?
jz SHORT I11_iret ; N: then Weitek not mapped
test fs:[Weitek_State],fWeitek_Map ; Y:Q: Weitek mapped ?
jz SHORT I11_iret ; N: say so ...
or eax,(fI11h_Weitek_Map SHL 16) ; Y: set bit 23
I11_iret:
pop fs
iret
Int11_Hook endp
;----------------------------------------------------------------------------
;
; Procedure name : chk_machine_state
;
; ENTRY :
;
; EXIT : NC if real mode
; CY otherwise
;
;----------------------------------------------------------------------------
chk_machine_state proc far
push ax
smsw ax
test ax,MSW_PROTECT ; Q: is bit 0 set
pop ax
jz cms_real ; N: machine in real mode
stc
ret
cms_real:
clc
ret
chk_machine_state endp
R1_CODE ends
end
| 23.302005 | 80 | 0.590562 |
6924cbae4ad78b4cd862db85ec3ad86aebf5724c | 6,022 | asm | Assembly | creditcalc.asm | pvsoriano/credit-calc-asm | 4f47a4545c831a234755d8c81b7e303d9a3cded0 | [
"MIT"
] | null | null | null | creditcalc.asm | pvsoriano/credit-calc-asm | 4f47a4545c831a234755d8c81b7e303d9a3cded0 | [
"MIT"
] | null | null | null | creditcalc.asm | pvsoriano/credit-calc-asm | 4f47a4545c831a234755d8c81b7e303d9a3cded0 | [
"MIT"
] | null | null | null | ; Source Name: creditcalc.asm
; Compiled Name: creditcalc.o
; Executable Name: creditcalc
; Code Model: Flat mode protected model
; Version: 1.0
; Created Date: 08 MAR 2006
; Last Updated: 05 MAY 2006
; Author: Paul V. Soriano
; Description: This module will take in input from the user and manipulate the data
; inputted from the user. This module will serve as the foundation for a more
; complicated and robust input module that will do more than simple arithmetic
; and manipulation of data.
;
; Assemble using this code:
; clear;nasm -l outcode -f elf creditcalc.asm
[SECTION .text]
;; These externals are from the standard C library
extern fprintf
extern printf
extern scanf
extern sscanf
extern fopen
extern fclose
extern system
;; These externals are from the associated library CALCULATE.ASM
extern calculate
extern open_file
extern assign_args
extern pause_data
;; These externals are from the associated library READDATA.ASM
extern read_data
;; needed so linker can find entry point
global creditcalc
global main_menu
global gohome
creditcalc:
push ebp ; setup stack frame
mov ebp,esp
push ebx ; pushing necessary registers
push esi
push edi
jmp check_args
assign_args_jump:
call printf
add esp,4
call assign_args ; shortcut
check_args:
;-------------------------------------------------------;
; check_args: ;
; Here we are going to check the arguments from the ;
; command line and process them if there are. ;
;-------------------------------------------------------;
;;; Check to see if there are more than 1 argument
mov eax,[ebp+8] ; load argument count from stack into eax
cmp eax,1 ; if count is 1, there are no args
ja assign_args_jump ; continue if arg count is < 1
;-----------------------------------------------------------------------;
; Main Menu Switch Case ;
; ;
; This subroutine is a switch case for the main menu, but isn't a true ;
; switch case, in that it doesn't fall through if the conditions ;
; aren't met. You can adjust the calls or jumps to your needs. ;
;-----------------------------------------------------------------------;
main_menu:
;;; The following code display's the menu items
push dword clear_scr ; push "clear" onto stack
call system ; clear terminal screen
add esp,4 ; clean up stack
mov ebx, dword switch_msg ; move pointer to message
.checkline:
cmp dword [ebx],0 ; is the message line null?
jne .show ; if not, show more lines
jmp switch_answer ; once done, get answer
.show:
push ebx ; push address of switch message
call printf ; display the message
add esp,4 ; clean up stack
add ebx,SWITCHSIZE ; increment address by length of switch message line
jmp .checkline ; loop back to see if we're done yet
switch_answer:
;;; Asks the user what he wants to do
push dword answer_msg ; push address of the answer message
call printf ; displays message
add esp,4 ; clean up
push dword answer ; push address of answer on stack
push dword int_fmt ; push format of answer
call scanf ; calls scanf to get data from user
add esp,8 ; clean up
switch_case:
;;; start switch case
mov eax,[answer] ; move answer into eax
cmp eax,0 ; see if eax is 0
jnz .Not0 ; move to next case if not 0
jmp gohome ; quit program
.Not0:
cmp eax,1 ; see if eax is 1
jne .Not1 ; move to next case if not 1
call open_file ; call getdata to get data from user manually
.Not1:
cmp eax,2 ; see if eax is 2
jne .Not2 ; move to next case if not 2
call read_data ; call readdata to get data from file
.Not2
cmp eax,3 ; see if eax is 3
jne .Not3 ; move to next case if not 3
jmp calchelp ; call the help file
.Not3
cmp eax,4
jge endcase ; go directly to endcase if not 0, 1, 2, 3 or 4.
endcase:
;;; This ends the switch case
push dword endmsg ; push address of end message
call printf ; display message
add esp,4 ; clean up stack
jmp main_menu ; go back to the main menu
;-----------------------------------------------------------------------;
; CreditCalc Help ;
; ;
; This subroutine displays the help menu for the user. ;
;-----------------------------------------------------------------------;
calchelp:
;;; Clear the screen first
push dword clear_scr ; push "clear" onto stack
call system ; clear terminal screen
add esp,4 ; clean up stack
push dword helpmsg ; push address of end message
call printf ; display message
add esp,4 ; clean up stack
call pause_data
gohome:
pop edi
pop esi
pop ebx ; restore registers
mov esp,ebp ; destroy stack
pop ebp
ret ; return control to Linux
[SECTION .data]
clear_scr db "clear",0
; Different formats for scanf
float_fmt db "%f",0
int_fmt db "%d",0
; Below relate to the Main Menu Switch Case
answer_msg db "Please select one of the menu item: ",0
msg2 db "----------Import Data From a File----------",10,0
msg3 db "Task 3",10,0
endmsg db "You have chosen an incorrect menu item, please try again.",10,0
switch_msg db "Credit Calc Main Menu - please select from the following:",10,0
SWITCHSIZE EQU $-switch_msg
db "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",10,0
db "1. Manually Input Data For One Credit Card ",10,0
db "2. Import Data From a File ",10,0
db "3. Help ",10,0
db "---------------------------------------------------------",10,0
db "0. Quit Program ",10,0
db "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~",10,10,0
switch_end dd 0
; Below is for the help file
helpmsg db "Example help file.",10,0
[SECTION .bss]
answer resd 1 ; answer to loop for getdata
debt resd 1
| 30.414141 | 84 | 0.594653 |
4959f11cae97d8ee6f65da098943c6529e1ece51 | 463 | asm | Assembly | programs/oeis/100/A100659.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/100/A100659.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/100/A100659.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A100659: Floor of measure (in degrees) of the internal angles of a regular polygon with n sides.
; 60,90,108,120,128,135,140,144,147,150,152,154,156,157,158,160,161,162,162,163,164,165,165,166,166,167,167,168,168,168,169,169,169,170,170,170,170,171,171,171,171,171,172,172,172,172,172,172,172,173,173,173,173,173
mov $3,$0
mul $0,4
mov $2,5
mul $3,4
lpb $0,1
sub $0,1
add $1,5
lpe
mul $1,6
mul $2,4
add $3,5
add $2,$3
div $2,4
sub $2,3
div $1,$2
add $1,60
| 23.15 | 215 | 0.680346 |
52794ae4ed82d9c255023b41840e6c960f79bece | 556 | asm | Assembly | oeis/057/A057020.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/057/A057020.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/057/A057020.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A057020: Numerator of (sum of divisors of n / number of divisors of n).
; Submitted by Christian Krause
; 1,3,2,7,3,3,4,15,13,9,6,14,7,6,6,31,9,13,10,7,8,9,12,15,31,21,10,28,15,9,16,21,12,27,12,91,19,15,14,45,21,12,22,14,13,18,24,62,19,31,18,49,27,15,18,15,20,45,30,14,31,24,52,127,21,18,34,21,24,18,36,65,37,57,62,70,24,21,40,93,121,63,42,56,27,33,30,45,45,39,28,28,32,36,30,21,49,57,26,217
add $0,1
mov $2,$0
lpb $0
add $1,$4
mov $3,$2
dif $3,$0
sub $0,1
cmp $3,$2
cmp $3,0
add $4,$3
lpe
add $4,1
add $4,$1
gcd $1,$4
div $4,$1
mov $0,$4
| 26.47619 | 287 | 0.615108 |
e205c53fdf855c4a7328aaab27464069125da537 | 273 | asm | Assembly | libsrc/_DEVELOPMENT/alloc/balloc/c/sccz80/balloc_reset.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/_DEVELOPMENT/alloc/balloc/c/sccz80/balloc_reset.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/_DEVELOPMENT/alloc/balloc/c/sccz80/balloc_reset.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z | ; void *balloc_reset(unsigned char queue)
SECTION code_clib
SECTION code_alloc_balloc
PUBLIC balloc_reset
EXTERN asm_balloc_reset
defc balloc_reset = asm_balloc_reset
; SDCC bridge for Classic
IF __CLASSIC
PUBLIC _balloc_reset
defc _balloc_reset = balloc_reset
ENDIF
| 15.166667 | 41 | 0.838828 |
14384c63b5ed5f8f30747d85a3ce75904eafb047 | 42,305 | asm | Assembly | init.asm | tzulang/xv6_4 | 41ad7ba1ae112e6d99a022e2c6989b69d0789cc0 | [
"MIT-0"
] | null | null | null | init.asm | tzulang/xv6_4 | 41ad7ba1ae112e6d99a022e2c6989b69d0789cc0 | [
"MIT-0"
] | null | null | null | init.asm | tzulang/xv6_4 | 41ad7ba1ae112e6d99a022e2c6989b69d0789cc0 | [
"MIT-0"
] | null | null | null |
_init: file format elf32-i386
Disassembly of section .text:
00000000 <main>:
char *argv[] = { "sh", 0 };
int
main(void)
{
0: 55 push %ebp
1: 89 e5 mov %esp,%ebp
3: 83 e4 f0 and $0xfffffff0,%esp
6: 83 ec 20 sub $0x20,%esp
int pid, wpid;
mknod("proc", 2, 0);
9: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp)
10: 00
11: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp)
18: 00
19: c7 04 24 e2 08 00 00 movl $0x8e2,(%esp)
20: e8 b6 03 00 00 call 3db <mknod>
if(open("console", O_RDWR) < 0){
25: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp)
2c: 00
2d: c7 04 24 e7 08 00 00 movl $0x8e7,(%esp)
34: e8 9a 03 00 00 call 3d3 <open>
39: 85 c0 test %eax,%eax
3b: 79 30 jns 6d <main+0x6d>
mknod("console", 1, 1);
3d: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
44: 00
45: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp)
4c: 00
4d: c7 04 24 e7 08 00 00 movl $0x8e7,(%esp)
54: e8 82 03 00 00 call 3db <mknod>
open("console", O_RDWR);
59: c7 44 24 04 02 00 00 movl $0x2,0x4(%esp)
60: 00
61: c7 04 24 e7 08 00 00 movl $0x8e7,(%esp)
68: e8 66 03 00 00 call 3d3 <open>
}
dup(0); // stdout
6d: c7 04 24 00 00 00 00 movl $0x0,(%esp)
74: e8 92 03 00 00 call 40b <dup>
dup(0); // stderr
79: c7 04 24 00 00 00 00 movl $0x0,(%esp)
80: e8 86 03 00 00 call 40b <dup>
for(;;){
printf(1, "init: starting sh\n");
85: c7 44 24 04 ef 08 00 movl $0x8ef,0x4(%esp)
8c: 00
8d: c7 04 24 01 00 00 00 movl $0x1,(%esp)
94: e8 7a 04 00 00 call 513 <printf>
pid = fork();
99: e8 ed 02 00 00 call 38b <fork>
9e: 89 44 24 1c mov %eax,0x1c(%esp)
if(pid < 0){
a2: 83 7c 24 1c 00 cmpl $0x0,0x1c(%esp)
a7: 79 19 jns c2 <main+0xc2>
printf(1, "init: fork failed\n");
a9: c7 44 24 04 02 09 00 movl $0x902,0x4(%esp)
b0: 00
b1: c7 04 24 01 00 00 00 movl $0x1,(%esp)
b8: e8 56 04 00 00 call 513 <printf>
exit();
bd: e8 d1 02 00 00 call 393 <exit>
}
if(pid == 0){
c2: 83 7c 24 1c 00 cmpl $0x0,0x1c(%esp)
c7: 75 2d jne f6 <main+0xf6>
exec("sh", argv);
c9: c7 44 24 04 80 0b 00 movl $0xb80,0x4(%esp)
d0: 00
d1: c7 04 24 df 08 00 00 movl $0x8df,(%esp)
d8: e8 ee 02 00 00 call 3cb <exec>
printf(1, "init: exec sh failed\n");
dd: c7 44 24 04 15 09 00 movl $0x915,0x4(%esp)
e4: 00
e5: c7 04 24 01 00 00 00 movl $0x1,(%esp)
ec: e8 22 04 00 00 call 513 <printf>
exit();
f1: e8 9d 02 00 00 call 393 <exit>
}
while((wpid=wait()) >= 0 && wpid != pid)
f6: eb 14 jmp 10c <main+0x10c>
printf(1, "zombie!\n");
f8: c7 44 24 04 2b 09 00 movl $0x92b,0x4(%esp)
ff: 00
100: c7 04 24 01 00 00 00 movl $0x1,(%esp)
107: e8 07 04 00 00 call 513 <printf>
if(pid == 0){
exec("sh", argv);
printf(1, "init: exec sh failed\n");
exit();
}
while((wpid=wait()) >= 0 && wpid != pid)
10c: e8 8a 02 00 00 call 39b <wait>
111: 89 44 24 18 mov %eax,0x18(%esp)
115: 83 7c 24 18 00 cmpl $0x0,0x18(%esp)
11a: 78 0a js 126 <main+0x126>
11c: 8b 44 24 18 mov 0x18(%esp),%eax
120: 3b 44 24 1c cmp 0x1c(%esp),%eax
124: 75 d2 jne f8 <main+0xf8>
printf(1, "zombie!\n");
}
126: e9 5a ff ff ff jmp 85 <main+0x85>
0000012b <stosb>:
"cc");
}
static inline void
stosb(void *addr, int data, int cnt)
{
12b: 55 push %ebp
12c: 89 e5 mov %esp,%ebp
12e: 57 push %edi
12f: 53 push %ebx
asm volatile("cld; rep stosb" :
130: 8b 4d 08 mov 0x8(%ebp),%ecx
133: 8b 55 10 mov 0x10(%ebp),%edx
136: 8b 45 0c mov 0xc(%ebp),%eax
139: 89 cb mov %ecx,%ebx
13b: 89 df mov %ebx,%edi
13d: 89 d1 mov %edx,%ecx
13f: fc cld
140: f3 aa rep stos %al,%es:(%edi)
142: 89 ca mov %ecx,%edx
144: 89 fb mov %edi,%ebx
146: 89 5d 08 mov %ebx,0x8(%ebp)
149: 89 55 10 mov %edx,0x10(%ebp)
"=D" (addr), "=c" (cnt) :
"0" (addr), "1" (cnt), "a" (data) :
"memory", "cc");
}
14c: 5b pop %ebx
14d: 5f pop %edi
14e: 5d pop %ebp
14f: c3 ret
00000150 <strcpy>:
#include "user.h"
#include "x86.h"
char*
strcpy(char *s, char *t)
{
150: 55 push %ebp
151: 89 e5 mov %esp,%ebp
153: 83 ec 10 sub $0x10,%esp
char *os;
os = s;
156: 8b 45 08 mov 0x8(%ebp),%eax
159: 89 45 fc mov %eax,-0x4(%ebp)
while((*s++ = *t++) != 0)
15c: 90 nop
15d: 8b 45 08 mov 0x8(%ebp),%eax
160: 8d 50 01 lea 0x1(%eax),%edx
163: 89 55 08 mov %edx,0x8(%ebp)
166: 8b 55 0c mov 0xc(%ebp),%edx
169: 8d 4a 01 lea 0x1(%edx),%ecx
16c: 89 4d 0c mov %ecx,0xc(%ebp)
16f: 0f b6 12 movzbl (%edx),%edx
172: 88 10 mov %dl,(%eax)
174: 0f b6 00 movzbl (%eax),%eax
177: 84 c0 test %al,%al
179: 75 e2 jne 15d <strcpy+0xd>
;
return os;
17b: 8b 45 fc mov -0x4(%ebp),%eax
}
17e: c9 leave
17f: c3 ret
00000180 <strcmp>:
int
strcmp(const char *p, const char *q)
{
180: 55 push %ebp
181: 89 e5 mov %esp,%ebp
while(*p && *p == *q)
183: eb 08 jmp 18d <strcmp+0xd>
p++, q++;
185: 83 45 08 01 addl $0x1,0x8(%ebp)
189: 83 45 0c 01 addl $0x1,0xc(%ebp)
}
int
strcmp(const char *p, const char *q)
{
while(*p && *p == *q)
18d: 8b 45 08 mov 0x8(%ebp),%eax
190: 0f b6 00 movzbl (%eax),%eax
193: 84 c0 test %al,%al
195: 74 10 je 1a7 <strcmp+0x27>
197: 8b 45 08 mov 0x8(%ebp),%eax
19a: 0f b6 10 movzbl (%eax),%edx
19d: 8b 45 0c mov 0xc(%ebp),%eax
1a0: 0f b6 00 movzbl (%eax),%eax
1a3: 38 c2 cmp %al,%dl
1a5: 74 de je 185 <strcmp+0x5>
p++, q++;
return (uchar)*p - (uchar)*q;
1a7: 8b 45 08 mov 0x8(%ebp),%eax
1aa: 0f b6 00 movzbl (%eax),%eax
1ad: 0f b6 d0 movzbl %al,%edx
1b0: 8b 45 0c mov 0xc(%ebp),%eax
1b3: 0f b6 00 movzbl (%eax),%eax
1b6: 0f b6 c0 movzbl %al,%eax
1b9: 29 c2 sub %eax,%edx
1bb: 89 d0 mov %edx,%eax
}
1bd: 5d pop %ebp
1be: c3 ret
000001bf <strlen>:
uint
strlen(char *s)
{
1bf: 55 push %ebp
1c0: 89 e5 mov %esp,%ebp
1c2: 83 ec 10 sub $0x10,%esp
int n;
for(n = 0; s[n]; n++)
1c5: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
1cc: eb 04 jmp 1d2 <strlen+0x13>
1ce: 83 45 fc 01 addl $0x1,-0x4(%ebp)
1d2: 8b 55 fc mov -0x4(%ebp),%edx
1d5: 8b 45 08 mov 0x8(%ebp),%eax
1d8: 01 d0 add %edx,%eax
1da: 0f b6 00 movzbl (%eax),%eax
1dd: 84 c0 test %al,%al
1df: 75 ed jne 1ce <strlen+0xf>
;
return n;
1e1: 8b 45 fc mov -0x4(%ebp),%eax
}
1e4: c9 leave
1e5: c3 ret
000001e6 <memset>:
void*
memset(void *dst, int c, uint n)
{
1e6: 55 push %ebp
1e7: 89 e5 mov %esp,%ebp
1e9: 83 ec 0c sub $0xc,%esp
stosb(dst, c, n);
1ec: 8b 45 10 mov 0x10(%ebp),%eax
1ef: 89 44 24 08 mov %eax,0x8(%esp)
1f3: 8b 45 0c mov 0xc(%ebp),%eax
1f6: 89 44 24 04 mov %eax,0x4(%esp)
1fa: 8b 45 08 mov 0x8(%ebp),%eax
1fd: 89 04 24 mov %eax,(%esp)
200: e8 26 ff ff ff call 12b <stosb>
return dst;
205: 8b 45 08 mov 0x8(%ebp),%eax
}
208: c9 leave
209: c3 ret
0000020a <strchr>:
char*
strchr(const char *s, char c)
{
20a: 55 push %ebp
20b: 89 e5 mov %esp,%ebp
20d: 83 ec 04 sub $0x4,%esp
210: 8b 45 0c mov 0xc(%ebp),%eax
213: 88 45 fc mov %al,-0x4(%ebp)
for(; *s; s++)
216: eb 14 jmp 22c <strchr+0x22>
if(*s == c)
218: 8b 45 08 mov 0x8(%ebp),%eax
21b: 0f b6 00 movzbl (%eax),%eax
21e: 3a 45 fc cmp -0x4(%ebp),%al
221: 75 05 jne 228 <strchr+0x1e>
return (char*)s;
223: 8b 45 08 mov 0x8(%ebp),%eax
226: eb 13 jmp 23b <strchr+0x31>
}
char*
strchr(const char *s, char c)
{
for(; *s; s++)
228: 83 45 08 01 addl $0x1,0x8(%ebp)
22c: 8b 45 08 mov 0x8(%ebp),%eax
22f: 0f b6 00 movzbl (%eax),%eax
232: 84 c0 test %al,%al
234: 75 e2 jne 218 <strchr+0xe>
if(*s == c)
return (char*)s;
return 0;
236: b8 00 00 00 00 mov $0x0,%eax
}
23b: c9 leave
23c: c3 ret
0000023d <gets>:
char*
gets(char *buf, int max)
{
23d: 55 push %ebp
23e: 89 e5 mov %esp,%ebp
240: 83 ec 28 sub $0x28,%esp
int i, cc;
char c;
for(i=0; i+1 < max; ){
243: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
24a: eb 4c jmp 298 <gets+0x5b>
cc = read(0, &c, 1);
24c: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
253: 00
254: 8d 45 ef lea -0x11(%ebp),%eax
257: 89 44 24 04 mov %eax,0x4(%esp)
25b: c7 04 24 00 00 00 00 movl $0x0,(%esp)
262: e8 44 01 00 00 call 3ab <read>
267: 89 45 f0 mov %eax,-0x10(%ebp)
if(cc < 1)
26a: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
26e: 7f 02 jg 272 <gets+0x35>
break;
270: eb 31 jmp 2a3 <gets+0x66>
buf[i++] = c;
272: 8b 45 f4 mov -0xc(%ebp),%eax
275: 8d 50 01 lea 0x1(%eax),%edx
278: 89 55 f4 mov %edx,-0xc(%ebp)
27b: 89 c2 mov %eax,%edx
27d: 8b 45 08 mov 0x8(%ebp),%eax
280: 01 c2 add %eax,%edx
282: 0f b6 45 ef movzbl -0x11(%ebp),%eax
286: 88 02 mov %al,(%edx)
if(c == '\n' || c == '\r')
288: 0f b6 45 ef movzbl -0x11(%ebp),%eax
28c: 3c 0a cmp $0xa,%al
28e: 74 13 je 2a3 <gets+0x66>
290: 0f b6 45 ef movzbl -0x11(%ebp),%eax
294: 3c 0d cmp $0xd,%al
296: 74 0b je 2a3 <gets+0x66>
gets(char *buf, int max)
{
int i, cc;
char c;
for(i=0; i+1 < max; ){
298: 8b 45 f4 mov -0xc(%ebp),%eax
29b: 83 c0 01 add $0x1,%eax
29e: 3b 45 0c cmp 0xc(%ebp),%eax
2a1: 7c a9 jl 24c <gets+0xf>
break;
buf[i++] = c;
if(c == '\n' || c == '\r')
break;
}
buf[i] = '\0';
2a3: 8b 55 f4 mov -0xc(%ebp),%edx
2a6: 8b 45 08 mov 0x8(%ebp),%eax
2a9: 01 d0 add %edx,%eax
2ab: c6 00 00 movb $0x0,(%eax)
return buf;
2ae: 8b 45 08 mov 0x8(%ebp),%eax
}
2b1: c9 leave
2b2: c3 ret
000002b3 <stat>:
int
stat(char *n, struct stat *st)
{
2b3: 55 push %ebp
2b4: 89 e5 mov %esp,%ebp
2b6: 83 ec 28 sub $0x28,%esp
int fd;
int r;
fd = open(n, O_RDONLY);
2b9: c7 44 24 04 00 00 00 movl $0x0,0x4(%esp)
2c0: 00
2c1: 8b 45 08 mov 0x8(%ebp),%eax
2c4: 89 04 24 mov %eax,(%esp)
2c7: e8 07 01 00 00 call 3d3 <open>
2cc: 89 45 f4 mov %eax,-0xc(%ebp)
if(fd < 0)
2cf: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
2d3: 79 07 jns 2dc <stat+0x29>
return -1;
2d5: b8 ff ff ff ff mov $0xffffffff,%eax
2da: eb 23 jmp 2ff <stat+0x4c>
r = fstat(fd, st);
2dc: 8b 45 0c mov 0xc(%ebp),%eax
2df: 89 44 24 04 mov %eax,0x4(%esp)
2e3: 8b 45 f4 mov -0xc(%ebp),%eax
2e6: 89 04 24 mov %eax,(%esp)
2e9: e8 fd 00 00 00 call 3eb <fstat>
2ee: 89 45 f0 mov %eax,-0x10(%ebp)
close(fd);
2f1: 8b 45 f4 mov -0xc(%ebp),%eax
2f4: 89 04 24 mov %eax,(%esp)
2f7: e8 bf 00 00 00 call 3bb <close>
return r;
2fc: 8b 45 f0 mov -0x10(%ebp),%eax
}
2ff: c9 leave
300: c3 ret
00000301 <atoi>:
int
atoi(const char *s)
{
301: 55 push %ebp
302: 89 e5 mov %esp,%ebp
304: 83 ec 10 sub $0x10,%esp
int n;
n = 0;
307: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp)
while('0' <= *s && *s <= '9')
30e: eb 25 jmp 335 <atoi+0x34>
n = n*10 + *s++ - '0';
310: 8b 55 fc mov -0x4(%ebp),%edx
313: 89 d0 mov %edx,%eax
315: c1 e0 02 shl $0x2,%eax
318: 01 d0 add %edx,%eax
31a: 01 c0 add %eax,%eax
31c: 89 c1 mov %eax,%ecx
31e: 8b 45 08 mov 0x8(%ebp),%eax
321: 8d 50 01 lea 0x1(%eax),%edx
324: 89 55 08 mov %edx,0x8(%ebp)
327: 0f b6 00 movzbl (%eax),%eax
32a: 0f be c0 movsbl %al,%eax
32d: 01 c8 add %ecx,%eax
32f: 83 e8 30 sub $0x30,%eax
332: 89 45 fc mov %eax,-0x4(%ebp)
atoi(const char *s)
{
int n;
n = 0;
while('0' <= *s && *s <= '9')
335: 8b 45 08 mov 0x8(%ebp),%eax
338: 0f b6 00 movzbl (%eax),%eax
33b: 3c 2f cmp $0x2f,%al
33d: 7e 0a jle 349 <atoi+0x48>
33f: 8b 45 08 mov 0x8(%ebp),%eax
342: 0f b6 00 movzbl (%eax),%eax
345: 3c 39 cmp $0x39,%al
347: 7e c7 jle 310 <atoi+0xf>
n = n*10 + *s++ - '0';
return n;
349: 8b 45 fc mov -0x4(%ebp),%eax
}
34c: c9 leave
34d: c3 ret
0000034e <memmove>:
void*
memmove(void *vdst, void *vsrc, int n)
{
34e: 55 push %ebp
34f: 89 e5 mov %esp,%ebp
351: 83 ec 10 sub $0x10,%esp
char *dst, *src;
dst = vdst;
354: 8b 45 08 mov 0x8(%ebp),%eax
357: 89 45 fc mov %eax,-0x4(%ebp)
src = vsrc;
35a: 8b 45 0c mov 0xc(%ebp),%eax
35d: 89 45 f8 mov %eax,-0x8(%ebp)
while(n-- > 0)
360: eb 17 jmp 379 <memmove+0x2b>
*dst++ = *src++;
362: 8b 45 fc mov -0x4(%ebp),%eax
365: 8d 50 01 lea 0x1(%eax),%edx
368: 89 55 fc mov %edx,-0x4(%ebp)
36b: 8b 55 f8 mov -0x8(%ebp),%edx
36e: 8d 4a 01 lea 0x1(%edx),%ecx
371: 89 4d f8 mov %ecx,-0x8(%ebp)
374: 0f b6 12 movzbl (%edx),%edx
377: 88 10 mov %dl,(%eax)
{
char *dst, *src;
dst = vdst;
src = vsrc;
while(n-- > 0)
379: 8b 45 10 mov 0x10(%ebp),%eax
37c: 8d 50 ff lea -0x1(%eax),%edx
37f: 89 55 10 mov %edx,0x10(%ebp)
382: 85 c0 test %eax,%eax
384: 7f dc jg 362 <memmove+0x14>
*dst++ = *src++;
return vdst;
386: 8b 45 08 mov 0x8(%ebp),%eax
}
389: c9 leave
38a: c3 ret
0000038b <fork>:
name: \
movl $SYS_ ## name, %eax; \
int $T_SYSCALL; \
ret
SYSCALL(fork)
38b: b8 01 00 00 00 mov $0x1,%eax
390: cd 40 int $0x40
392: c3 ret
00000393 <exit>:
SYSCALL(exit)
393: b8 02 00 00 00 mov $0x2,%eax
398: cd 40 int $0x40
39a: c3 ret
0000039b <wait>:
SYSCALL(wait)
39b: b8 03 00 00 00 mov $0x3,%eax
3a0: cd 40 int $0x40
3a2: c3 ret
000003a3 <pipe>:
SYSCALL(pipe)
3a3: b8 04 00 00 00 mov $0x4,%eax
3a8: cd 40 int $0x40
3aa: c3 ret
000003ab <read>:
SYSCALL(read)
3ab: b8 05 00 00 00 mov $0x5,%eax
3b0: cd 40 int $0x40
3b2: c3 ret
000003b3 <write>:
SYSCALL(write)
3b3: b8 10 00 00 00 mov $0x10,%eax
3b8: cd 40 int $0x40
3ba: c3 ret
000003bb <close>:
SYSCALL(close)
3bb: b8 15 00 00 00 mov $0x15,%eax
3c0: cd 40 int $0x40
3c2: c3 ret
000003c3 <kill>:
SYSCALL(kill)
3c3: b8 06 00 00 00 mov $0x6,%eax
3c8: cd 40 int $0x40
3ca: c3 ret
000003cb <exec>:
SYSCALL(exec)
3cb: b8 07 00 00 00 mov $0x7,%eax
3d0: cd 40 int $0x40
3d2: c3 ret
000003d3 <open>:
SYSCALL(open)
3d3: b8 0f 00 00 00 mov $0xf,%eax
3d8: cd 40 int $0x40
3da: c3 ret
000003db <mknod>:
SYSCALL(mknod)
3db: b8 11 00 00 00 mov $0x11,%eax
3e0: cd 40 int $0x40
3e2: c3 ret
000003e3 <unlink>:
SYSCALL(unlink)
3e3: b8 12 00 00 00 mov $0x12,%eax
3e8: cd 40 int $0x40
3ea: c3 ret
000003eb <fstat>:
SYSCALL(fstat)
3eb: b8 08 00 00 00 mov $0x8,%eax
3f0: cd 40 int $0x40
3f2: c3 ret
000003f3 <link>:
SYSCALL(link)
3f3: b8 13 00 00 00 mov $0x13,%eax
3f8: cd 40 int $0x40
3fa: c3 ret
000003fb <mkdir>:
SYSCALL(mkdir)
3fb: b8 14 00 00 00 mov $0x14,%eax
400: cd 40 int $0x40
402: c3 ret
00000403 <chdir>:
SYSCALL(chdir)
403: b8 09 00 00 00 mov $0x9,%eax
408: cd 40 int $0x40
40a: c3 ret
0000040b <dup>:
SYSCALL(dup)
40b: b8 0a 00 00 00 mov $0xa,%eax
410: cd 40 int $0x40
412: c3 ret
00000413 <getpid>:
SYSCALL(getpid)
413: b8 0b 00 00 00 mov $0xb,%eax
418: cd 40 int $0x40
41a: c3 ret
0000041b <sbrk>:
SYSCALL(sbrk)
41b: b8 0c 00 00 00 mov $0xc,%eax
420: cd 40 int $0x40
422: c3 ret
00000423 <sleep>:
SYSCALL(sleep)
423: b8 0d 00 00 00 mov $0xd,%eax
428: cd 40 int $0x40
42a: c3 ret
0000042b <uptime>:
SYSCALL(uptime)
42b: b8 0e 00 00 00 mov $0xe,%eax
430: cd 40 int $0x40
432: c3 ret
00000433 <putc>:
#include "stat.h"
#include "user.h"
static void
putc(int fd, char c)
{
433: 55 push %ebp
434: 89 e5 mov %esp,%ebp
436: 83 ec 18 sub $0x18,%esp
439: 8b 45 0c mov 0xc(%ebp),%eax
43c: 88 45 f4 mov %al,-0xc(%ebp)
write(fd, &c, 1);
43f: c7 44 24 08 01 00 00 movl $0x1,0x8(%esp)
446: 00
447: 8d 45 f4 lea -0xc(%ebp),%eax
44a: 89 44 24 04 mov %eax,0x4(%esp)
44e: 8b 45 08 mov 0x8(%ebp),%eax
451: 89 04 24 mov %eax,(%esp)
454: e8 5a ff ff ff call 3b3 <write>
}
459: c9 leave
45a: c3 ret
0000045b <printint>:
static void
printint(int fd, int xx, int base, int sgn)
{
45b: 55 push %ebp
45c: 89 e5 mov %esp,%ebp
45e: 56 push %esi
45f: 53 push %ebx
460: 83 ec 30 sub $0x30,%esp
static char digits[] = "0123456789ABCDEF";
char buf[16];
int i, neg;
uint x;
neg = 0;
463: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
if(sgn && xx < 0){
46a: 83 7d 14 00 cmpl $0x0,0x14(%ebp)
46e: 74 17 je 487 <printint+0x2c>
470: 83 7d 0c 00 cmpl $0x0,0xc(%ebp)
474: 79 11 jns 487 <printint+0x2c>
neg = 1;
476: c7 45 f0 01 00 00 00 movl $0x1,-0x10(%ebp)
x = -xx;
47d: 8b 45 0c mov 0xc(%ebp),%eax
480: f7 d8 neg %eax
482: 89 45 ec mov %eax,-0x14(%ebp)
485: eb 06 jmp 48d <printint+0x32>
} else {
x = xx;
487: 8b 45 0c mov 0xc(%ebp),%eax
48a: 89 45 ec mov %eax,-0x14(%ebp)
}
i = 0;
48d: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp)
do{
buf[i++] = digits[x % base];
494: 8b 4d f4 mov -0xc(%ebp),%ecx
497: 8d 41 01 lea 0x1(%ecx),%eax
49a: 89 45 f4 mov %eax,-0xc(%ebp)
49d: 8b 5d 10 mov 0x10(%ebp),%ebx
4a0: 8b 45 ec mov -0x14(%ebp),%eax
4a3: ba 00 00 00 00 mov $0x0,%edx
4a8: f7 f3 div %ebx
4aa: 89 d0 mov %edx,%eax
4ac: 0f b6 80 88 0b 00 00 movzbl 0xb88(%eax),%eax
4b3: 88 44 0d dc mov %al,-0x24(%ebp,%ecx,1)
}while((x /= base) != 0);
4b7: 8b 75 10 mov 0x10(%ebp),%esi
4ba: 8b 45 ec mov -0x14(%ebp),%eax
4bd: ba 00 00 00 00 mov $0x0,%edx
4c2: f7 f6 div %esi
4c4: 89 45 ec mov %eax,-0x14(%ebp)
4c7: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
4cb: 75 c7 jne 494 <printint+0x39>
if(neg)
4cd: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
4d1: 74 10 je 4e3 <printint+0x88>
buf[i++] = '-';
4d3: 8b 45 f4 mov -0xc(%ebp),%eax
4d6: 8d 50 01 lea 0x1(%eax),%edx
4d9: 89 55 f4 mov %edx,-0xc(%ebp)
4dc: c6 44 05 dc 2d movb $0x2d,-0x24(%ebp,%eax,1)
while(--i >= 0)
4e1: eb 1f jmp 502 <printint+0xa7>
4e3: eb 1d jmp 502 <printint+0xa7>
putc(fd, buf[i]);
4e5: 8d 55 dc lea -0x24(%ebp),%edx
4e8: 8b 45 f4 mov -0xc(%ebp),%eax
4eb: 01 d0 add %edx,%eax
4ed: 0f b6 00 movzbl (%eax),%eax
4f0: 0f be c0 movsbl %al,%eax
4f3: 89 44 24 04 mov %eax,0x4(%esp)
4f7: 8b 45 08 mov 0x8(%ebp),%eax
4fa: 89 04 24 mov %eax,(%esp)
4fd: e8 31 ff ff ff call 433 <putc>
buf[i++] = digits[x % base];
}while((x /= base) != 0);
if(neg)
buf[i++] = '-';
while(--i >= 0)
502: 83 6d f4 01 subl $0x1,-0xc(%ebp)
506: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
50a: 79 d9 jns 4e5 <printint+0x8a>
putc(fd, buf[i]);
}
50c: 83 c4 30 add $0x30,%esp
50f: 5b pop %ebx
510: 5e pop %esi
511: 5d pop %ebp
512: c3 ret
00000513 <printf>:
// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
513: 55 push %ebp
514: 89 e5 mov %esp,%ebp
516: 83 ec 38 sub $0x38,%esp
char *s;
int c, i, state;
uint *ap;
state = 0;
519: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
ap = (uint*)(void*)&fmt + 1;
520: 8d 45 0c lea 0xc(%ebp),%eax
523: 83 c0 04 add $0x4,%eax
526: 89 45 e8 mov %eax,-0x18(%ebp)
for(i = 0; fmt[i]; i++){
529: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp)
530: e9 7c 01 00 00 jmp 6b1 <printf+0x19e>
c = fmt[i] & 0xff;
535: 8b 55 0c mov 0xc(%ebp),%edx
538: 8b 45 f0 mov -0x10(%ebp),%eax
53b: 01 d0 add %edx,%eax
53d: 0f b6 00 movzbl (%eax),%eax
540: 0f be c0 movsbl %al,%eax
543: 25 ff 00 00 00 and $0xff,%eax
548: 89 45 e4 mov %eax,-0x1c(%ebp)
if(state == 0){
54b: 83 7d ec 00 cmpl $0x0,-0x14(%ebp)
54f: 75 2c jne 57d <printf+0x6a>
if(c == '%'){
551: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
555: 75 0c jne 563 <printf+0x50>
state = '%';
557: c7 45 ec 25 00 00 00 movl $0x25,-0x14(%ebp)
55e: e9 4a 01 00 00 jmp 6ad <printf+0x19a>
} else {
putc(fd, c);
563: 8b 45 e4 mov -0x1c(%ebp),%eax
566: 0f be c0 movsbl %al,%eax
569: 89 44 24 04 mov %eax,0x4(%esp)
56d: 8b 45 08 mov 0x8(%ebp),%eax
570: 89 04 24 mov %eax,(%esp)
573: e8 bb fe ff ff call 433 <putc>
578: e9 30 01 00 00 jmp 6ad <printf+0x19a>
}
} else if(state == '%'){
57d: 83 7d ec 25 cmpl $0x25,-0x14(%ebp)
581: 0f 85 26 01 00 00 jne 6ad <printf+0x19a>
if(c == 'd'){
587: 83 7d e4 64 cmpl $0x64,-0x1c(%ebp)
58b: 75 2d jne 5ba <printf+0xa7>
printint(fd, *ap, 10, 1);
58d: 8b 45 e8 mov -0x18(%ebp),%eax
590: 8b 00 mov (%eax),%eax
592: c7 44 24 0c 01 00 00 movl $0x1,0xc(%esp)
599: 00
59a: c7 44 24 08 0a 00 00 movl $0xa,0x8(%esp)
5a1: 00
5a2: 89 44 24 04 mov %eax,0x4(%esp)
5a6: 8b 45 08 mov 0x8(%ebp),%eax
5a9: 89 04 24 mov %eax,(%esp)
5ac: e8 aa fe ff ff call 45b <printint>
ap++;
5b1: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5b5: e9 ec 00 00 00 jmp 6a6 <printf+0x193>
} else if(c == 'x' || c == 'p'){
5ba: 83 7d e4 78 cmpl $0x78,-0x1c(%ebp)
5be: 74 06 je 5c6 <printf+0xb3>
5c0: 83 7d e4 70 cmpl $0x70,-0x1c(%ebp)
5c4: 75 2d jne 5f3 <printf+0xe0>
printint(fd, *ap, 16, 0);
5c6: 8b 45 e8 mov -0x18(%ebp),%eax
5c9: 8b 00 mov (%eax),%eax
5cb: c7 44 24 0c 00 00 00 movl $0x0,0xc(%esp)
5d2: 00
5d3: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp)
5da: 00
5db: 89 44 24 04 mov %eax,0x4(%esp)
5df: 8b 45 08 mov 0x8(%ebp),%eax
5e2: 89 04 24 mov %eax,(%esp)
5e5: e8 71 fe ff ff call 45b <printint>
ap++;
5ea: 83 45 e8 04 addl $0x4,-0x18(%ebp)
5ee: e9 b3 00 00 00 jmp 6a6 <printf+0x193>
} else if(c == 's'){
5f3: 83 7d e4 73 cmpl $0x73,-0x1c(%ebp)
5f7: 75 45 jne 63e <printf+0x12b>
s = (char*)*ap;
5f9: 8b 45 e8 mov -0x18(%ebp),%eax
5fc: 8b 00 mov (%eax),%eax
5fe: 89 45 f4 mov %eax,-0xc(%ebp)
ap++;
601: 83 45 e8 04 addl $0x4,-0x18(%ebp)
if(s == 0)
605: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
609: 75 09 jne 614 <printf+0x101>
s = "(null)";
60b: c7 45 f4 34 09 00 00 movl $0x934,-0xc(%ebp)
while(*s != 0){
612: eb 1e jmp 632 <printf+0x11f>
614: eb 1c jmp 632 <printf+0x11f>
putc(fd, *s);
616: 8b 45 f4 mov -0xc(%ebp),%eax
619: 0f b6 00 movzbl (%eax),%eax
61c: 0f be c0 movsbl %al,%eax
61f: 89 44 24 04 mov %eax,0x4(%esp)
623: 8b 45 08 mov 0x8(%ebp),%eax
626: 89 04 24 mov %eax,(%esp)
629: e8 05 fe ff ff call 433 <putc>
s++;
62e: 83 45 f4 01 addl $0x1,-0xc(%ebp)
} else if(c == 's'){
s = (char*)*ap;
ap++;
if(s == 0)
s = "(null)";
while(*s != 0){
632: 8b 45 f4 mov -0xc(%ebp),%eax
635: 0f b6 00 movzbl (%eax),%eax
638: 84 c0 test %al,%al
63a: 75 da jne 616 <printf+0x103>
63c: eb 68 jmp 6a6 <printf+0x193>
putc(fd, *s);
s++;
}
} else if(c == 'c'){
63e: 83 7d e4 63 cmpl $0x63,-0x1c(%ebp)
642: 75 1d jne 661 <printf+0x14e>
putc(fd, *ap);
644: 8b 45 e8 mov -0x18(%ebp),%eax
647: 8b 00 mov (%eax),%eax
649: 0f be c0 movsbl %al,%eax
64c: 89 44 24 04 mov %eax,0x4(%esp)
650: 8b 45 08 mov 0x8(%ebp),%eax
653: 89 04 24 mov %eax,(%esp)
656: e8 d8 fd ff ff call 433 <putc>
ap++;
65b: 83 45 e8 04 addl $0x4,-0x18(%ebp)
65f: eb 45 jmp 6a6 <printf+0x193>
} else if(c == '%'){
661: 83 7d e4 25 cmpl $0x25,-0x1c(%ebp)
665: 75 17 jne 67e <printf+0x16b>
putc(fd, c);
667: 8b 45 e4 mov -0x1c(%ebp),%eax
66a: 0f be c0 movsbl %al,%eax
66d: 89 44 24 04 mov %eax,0x4(%esp)
671: 8b 45 08 mov 0x8(%ebp),%eax
674: 89 04 24 mov %eax,(%esp)
677: e8 b7 fd ff ff call 433 <putc>
67c: eb 28 jmp 6a6 <printf+0x193>
} else {
// Unknown % sequence. Print it to draw attention.
putc(fd, '%');
67e: c7 44 24 04 25 00 00 movl $0x25,0x4(%esp)
685: 00
686: 8b 45 08 mov 0x8(%ebp),%eax
689: 89 04 24 mov %eax,(%esp)
68c: e8 a2 fd ff ff call 433 <putc>
putc(fd, c);
691: 8b 45 e4 mov -0x1c(%ebp),%eax
694: 0f be c0 movsbl %al,%eax
697: 89 44 24 04 mov %eax,0x4(%esp)
69b: 8b 45 08 mov 0x8(%ebp),%eax
69e: 89 04 24 mov %eax,(%esp)
6a1: e8 8d fd ff ff call 433 <putc>
}
state = 0;
6a6: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp)
int c, i, state;
uint *ap;
state = 0;
ap = (uint*)(void*)&fmt + 1;
for(i = 0; fmt[i]; i++){
6ad: 83 45 f0 01 addl $0x1,-0x10(%ebp)
6b1: 8b 55 0c mov 0xc(%ebp),%edx
6b4: 8b 45 f0 mov -0x10(%ebp),%eax
6b7: 01 d0 add %edx,%eax
6b9: 0f b6 00 movzbl (%eax),%eax
6bc: 84 c0 test %al,%al
6be: 0f 85 71 fe ff ff jne 535 <printf+0x22>
putc(fd, c);
}
state = 0;
}
}
}
6c4: c9 leave
6c5: c3 ret
000006c6 <free>:
static Header base;
static Header *freep;
void
free(void *ap)
{
6c6: 55 push %ebp
6c7: 89 e5 mov %esp,%ebp
6c9: 83 ec 10 sub $0x10,%esp
Header *bp, *p;
bp = (Header*)ap - 1;
6cc: 8b 45 08 mov 0x8(%ebp),%eax
6cf: 83 e8 08 sub $0x8,%eax
6d2: 89 45 f8 mov %eax,-0x8(%ebp)
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6d5: a1 a4 0b 00 00 mov 0xba4,%eax
6da: 89 45 fc mov %eax,-0x4(%ebp)
6dd: eb 24 jmp 703 <free+0x3d>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
6df: 8b 45 fc mov -0x4(%ebp),%eax
6e2: 8b 00 mov (%eax),%eax
6e4: 3b 45 fc cmp -0x4(%ebp),%eax
6e7: 77 12 ja 6fb <free+0x35>
6e9: 8b 45 f8 mov -0x8(%ebp),%eax
6ec: 3b 45 fc cmp -0x4(%ebp),%eax
6ef: 77 24 ja 715 <free+0x4f>
6f1: 8b 45 fc mov -0x4(%ebp),%eax
6f4: 8b 00 mov (%eax),%eax
6f6: 3b 45 f8 cmp -0x8(%ebp),%eax
6f9: 77 1a ja 715 <free+0x4f>
free(void *ap)
{
Header *bp, *p;
bp = (Header*)ap - 1;
for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
6fb: 8b 45 fc mov -0x4(%ebp),%eax
6fe: 8b 00 mov (%eax),%eax
700: 89 45 fc mov %eax,-0x4(%ebp)
703: 8b 45 f8 mov -0x8(%ebp),%eax
706: 3b 45 fc cmp -0x4(%ebp),%eax
709: 76 d4 jbe 6df <free+0x19>
70b: 8b 45 fc mov -0x4(%ebp),%eax
70e: 8b 00 mov (%eax),%eax
710: 3b 45 f8 cmp -0x8(%ebp),%eax
713: 76 ca jbe 6df <free+0x19>
if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
break;
if(bp + bp->s.size == p->s.ptr){
715: 8b 45 f8 mov -0x8(%ebp),%eax
718: 8b 40 04 mov 0x4(%eax),%eax
71b: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
722: 8b 45 f8 mov -0x8(%ebp),%eax
725: 01 c2 add %eax,%edx
727: 8b 45 fc mov -0x4(%ebp),%eax
72a: 8b 00 mov (%eax),%eax
72c: 39 c2 cmp %eax,%edx
72e: 75 24 jne 754 <free+0x8e>
bp->s.size += p->s.ptr->s.size;
730: 8b 45 f8 mov -0x8(%ebp),%eax
733: 8b 50 04 mov 0x4(%eax),%edx
736: 8b 45 fc mov -0x4(%ebp),%eax
739: 8b 00 mov (%eax),%eax
73b: 8b 40 04 mov 0x4(%eax),%eax
73e: 01 c2 add %eax,%edx
740: 8b 45 f8 mov -0x8(%ebp),%eax
743: 89 50 04 mov %edx,0x4(%eax)
bp->s.ptr = p->s.ptr->s.ptr;
746: 8b 45 fc mov -0x4(%ebp),%eax
749: 8b 00 mov (%eax),%eax
74b: 8b 10 mov (%eax),%edx
74d: 8b 45 f8 mov -0x8(%ebp),%eax
750: 89 10 mov %edx,(%eax)
752: eb 0a jmp 75e <free+0x98>
} else
bp->s.ptr = p->s.ptr;
754: 8b 45 fc mov -0x4(%ebp),%eax
757: 8b 10 mov (%eax),%edx
759: 8b 45 f8 mov -0x8(%ebp),%eax
75c: 89 10 mov %edx,(%eax)
if(p + p->s.size == bp){
75e: 8b 45 fc mov -0x4(%ebp),%eax
761: 8b 40 04 mov 0x4(%eax),%eax
764: 8d 14 c5 00 00 00 00 lea 0x0(,%eax,8),%edx
76b: 8b 45 fc mov -0x4(%ebp),%eax
76e: 01 d0 add %edx,%eax
770: 3b 45 f8 cmp -0x8(%ebp),%eax
773: 75 20 jne 795 <free+0xcf>
p->s.size += bp->s.size;
775: 8b 45 fc mov -0x4(%ebp),%eax
778: 8b 50 04 mov 0x4(%eax),%edx
77b: 8b 45 f8 mov -0x8(%ebp),%eax
77e: 8b 40 04 mov 0x4(%eax),%eax
781: 01 c2 add %eax,%edx
783: 8b 45 fc mov -0x4(%ebp),%eax
786: 89 50 04 mov %edx,0x4(%eax)
p->s.ptr = bp->s.ptr;
789: 8b 45 f8 mov -0x8(%ebp),%eax
78c: 8b 10 mov (%eax),%edx
78e: 8b 45 fc mov -0x4(%ebp),%eax
791: 89 10 mov %edx,(%eax)
793: eb 08 jmp 79d <free+0xd7>
} else
p->s.ptr = bp;
795: 8b 45 fc mov -0x4(%ebp),%eax
798: 8b 55 f8 mov -0x8(%ebp),%edx
79b: 89 10 mov %edx,(%eax)
freep = p;
79d: 8b 45 fc mov -0x4(%ebp),%eax
7a0: a3 a4 0b 00 00 mov %eax,0xba4
}
7a5: c9 leave
7a6: c3 ret
000007a7 <morecore>:
static Header*
morecore(uint nu)
{
7a7: 55 push %ebp
7a8: 89 e5 mov %esp,%ebp
7aa: 83 ec 28 sub $0x28,%esp
char *p;
Header *hp;
if(nu < 4096)
7ad: 81 7d 08 ff 0f 00 00 cmpl $0xfff,0x8(%ebp)
7b4: 77 07 ja 7bd <morecore+0x16>
nu = 4096;
7b6: c7 45 08 00 10 00 00 movl $0x1000,0x8(%ebp)
p = sbrk(nu * sizeof(Header));
7bd: 8b 45 08 mov 0x8(%ebp),%eax
7c0: c1 e0 03 shl $0x3,%eax
7c3: 89 04 24 mov %eax,(%esp)
7c6: e8 50 fc ff ff call 41b <sbrk>
7cb: 89 45 f4 mov %eax,-0xc(%ebp)
if(p == (char*)-1)
7ce: 83 7d f4 ff cmpl $0xffffffff,-0xc(%ebp)
7d2: 75 07 jne 7db <morecore+0x34>
return 0;
7d4: b8 00 00 00 00 mov $0x0,%eax
7d9: eb 22 jmp 7fd <morecore+0x56>
hp = (Header*)p;
7db: 8b 45 f4 mov -0xc(%ebp),%eax
7de: 89 45 f0 mov %eax,-0x10(%ebp)
hp->s.size = nu;
7e1: 8b 45 f0 mov -0x10(%ebp),%eax
7e4: 8b 55 08 mov 0x8(%ebp),%edx
7e7: 89 50 04 mov %edx,0x4(%eax)
free((void*)(hp + 1));
7ea: 8b 45 f0 mov -0x10(%ebp),%eax
7ed: 83 c0 08 add $0x8,%eax
7f0: 89 04 24 mov %eax,(%esp)
7f3: e8 ce fe ff ff call 6c6 <free>
return freep;
7f8: a1 a4 0b 00 00 mov 0xba4,%eax
}
7fd: c9 leave
7fe: c3 ret
000007ff <malloc>:
void*
malloc(uint nbytes)
{
7ff: 55 push %ebp
800: 89 e5 mov %esp,%ebp
802: 83 ec 28 sub $0x28,%esp
Header *p, *prevp;
uint nunits;
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
805: 8b 45 08 mov 0x8(%ebp),%eax
808: 83 c0 07 add $0x7,%eax
80b: c1 e8 03 shr $0x3,%eax
80e: 83 c0 01 add $0x1,%eax
811: 89 45 ec mov %eax,-0x14(%ebp)
if((prevp = freep) == 0){
814: a1 a4 0b 00 00 mov 0xba4,%eax
819: 89 45 f0 mov %eax,-0x10(%ebp)
81c: 83 7d f0 00 cmpl $0x0,-0x10(%ebp)
820: 75 23 jne 845 <malloc+0x46>
base.s.ptr = freep = prevp = &base;
822: c7 45 f0 9c 0b 00 00 movl $0xb9c,-0x10(%ebp)
829: 8b 45 f0 mov -0x10(%ebp),%eax
82c: a3 a4 0b 00 00 mov %eax,0xba4
831: a1 a4 0b 00 00 mov 0xba4,%eax
836: a3 9c 0b 00 00 mov %eax,0xb9c
base.s.size = 0;
83b: c7 05 a0 0b 00 00 00 movl $0x0,0xba0
842: 00 00 00
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
845: 8b 45 f0 mov -0x10(%ebp),%eax
848: 8b 00 mov (%eax),%eax
84a: 89 45 f4 mov %eax,-0xc(%ebp)
if(p->s.size >= nunits){
84d: 8b 45 f4 mov -0xc(%ebp),%eax
850: 8b 40 04 mov 0x4(%eax),%eax
853: 3b 45 ec cmp -0x14(%ebp),%eax
856: 72 4d jb 8a5 <malloc+0xa6>
if(p->s.size == nunits)
858: 8b 45 f4 mov -0xc(%ebp),%eax
85b: 8b 40 04 mov 0x4(%eax),%eax
85e: 3b 45 ec cmp -0x14(%ebp),%eax
861: 75 0c jne 86f <malloc+0x70>
prevp->s.ptr = p->s.ptr;
863: 8b 45 f4 mov -0xc(%ebp),%eax
866: 8b 10 mov (%eax),%edx
868: 8b 45 f0 mov -0x10(%ebp),%eax
86b: 89 10 mov %edx,(%eax)
86d: eb 26 jmp 895 <malloc+0x96>
else {
p->s.size -= nunits;
86f: 8b 45 f4 mov -0xc(%ebp),%eax
872: 8b 40 04 mov 0x4(%eax),%eax
875: 2b 45 ec sub -0x14(%ebp),%eax
878: 89 c2 mov %eax,%edx
87a: 8b 45 f4 mov -0xc(%ebp),%eax
87d: 89 50 04 mov %edx,0x4(%eax)
p += p->s.size;
880: 8b 45 f4 mov -0xc(%ebp),%eax
883: 8b 40 04 mov 0x4(%eax),%eax
886: c1 e0 03 shl $0x3,%eax
889: 01 45 f4 add %eax,-0xc(%ebp)
p->s.size = nunits;
88c: 8b 45 f4 mov -0xc(%ebp),%eax
88f: 8b 55 ec mov -0x14(%ebp),%edx
892: 89 50 04 mov %edx,0x4(%eax)
}
freep = prevp;
895: 8b 45 f0 mov -0x10(%ebp),%eax
898: a3 a4 0b 00 00 mov %eax,0xba4
return (void*)(p + 1);
89d: 8b 45 f4 mov -0xc(%ebp),%eax
8a0: 83 c0 08 add $0x8,%eax
8a3: eb 38 jmp 8dd <malloc+0xde>
}
if(p == freep)
8a5: a1 a4 0b 00 00 mov 0xba4,%eax
8aa: 39 45 f4 cmp %eax,-0xc(%ebp)
8ad: 75 1b jne 8ca <malloc+0xcb>
if((p = morecore(nunits)) == 0)
8af: 8b 45 ec mov -0x14(%ebp),%eax
8b2: 89 04 24 mov %eax,(%esp)
8b5: e8 ed fe ff ff call 7a7 <morecore>
8ba: 89 45 f4 mov %eax,-0xc(%ebp)
8bd: 83 7d f4 00 cmpl $0x0,-0xc(%ebp)
8c1: 75 07 jne 8ca <malloc+0xcb>
return 0;
8c3: b8 00 00 00 00 mov $0x0,%eax
8c8: eb 13 jmp 8dd <malloc+0xde>
nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
if((prevp = freep) == 0){
base.s.ptr = freep = prevp = &base;
base.s.size = 0;
}
for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
8ca: 8b 45 f4 mov -0xc(%ebp),%eax
8cd: 89 45 f0 mov %eax,-0x10(%ebp)
8d0: 8b 45 f4 mov -0xc(%ebp),%eax
8d3: 8b 00 mov (%eax),%eax
8d5: 89 45 f4 mov %eax,-0xc(%ebp)
return (void*)(p + 1);
}
if(p == freep)
if((p = morecore(nunits)) == 0)
return 0;
}
8d8: e9 70 ff ff ff jmp 84d <malloc+0x4e>
}
8dd: c9 leave
8de: c3 ret
| 34.144471 | 60 | 0.43262 |
03915d862046e883b4ccc01a07c0009c4b6708be | 566 | asm | Assembly | oeis/024/A024012.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/024/A024012.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/024/A024012.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A024012: 2^n - n^2.
; 1,1,0,-1,0,7,28,79,192,431,924,1927,3952,8023,16188,32543,65280,130783,261820,523927,1048176,2096711,4193820,8388079,16776640,33553807,67108188,134216999,268434672,536870071,1073740924,2147482687,4294966272,8589933503,17179868028,34359737143,68719475440,137438952103,274877905500,549755812367,1099511626176,2199023253871,4398046509340,8796093020359,17592186042480,35184372086807,70368744175548,140737488353119,281474976708352,562949953418911,1125899906840124,2251799813682647,4503599627367792
mov $1,2
pow $1,$0
pow $0,2
sub $1,$0
mov $0,$1
| 62.888889 | 494 | 0.839223 |
0eb7a38750cbc26b0a48083b1037d84160712326 | 13,701 | asm | Assembly | examples/benchmark/sort/qsort-native.asm | gregdionne/mcbasic | bdf8892068bab7dc552b92e473b835721ef0c354 | [
"MIT"
] | 5 | 2021-02-02T18:44:13.000Z | 2022-03-08T16:53:09.000Z | examples/benchmark/sort/qsort-native.asm | gregdionne/mcbasic | bdf8892068bab7dc552b92e473b835721ef0c354 | [
"MIT"
] | 6 | 2021-01-28T04:38:48.000Z | 2021-04-05T03:06:33.000Z | examples/benchmark/sort/qsort-native.asm | gregdionne/mcbasic | bdf8892068bab7dc552b92e473b835721ef0c354 | [
"MIT"
] | 3 | 2021-01-18T04:13:25.000Z | 2021-10-29T23:25:49.000Z | ; Assembly for qsort-native.bas
; compiled with mcbasic -native
; Equates for MC-10 MICROCOLOR BASIC 1.0
;
; Direct page equates
DP_LNUM .equ $E2 ; current line in BASIC
DP_TABW .equ $E4 ; current tab width on console
DP_LPOS .equ $E6 ; current line position on console
DP_LWID .equ $E7 ; current line width of console
;
; Memory equates
M_KBUF .equ $4231 ; keystrobe buffer (8 bytes)
M_PMSK .equ $423C ; pixel mask for SET, RESET and POINT
M_IKEY .equ $427F ; key code for INKEY$
M_CRSR .equ $4280 ; cursor location
M_LBUF .equ $42B2 ; line input buffer (130 chars)
M_MSTR .equ $4334 ; buffer for small string moves
M_CODE .equ $4346 ; start of program space
;
; ROM equates
R_BKMSG .equ $E1C1 ; 'BREAK' string location
R_ERROR .equ $E238 ; generate error and restore direct mode
R_BREAK .equ $E266 ; generate break and restore direct mode
R_RESET .equ $E3EE ; setup stack and disable CONT
R_SPACE .equ $E7B9 ; emit " " to console
R_QUEST .equ $E7BC ; emit "?" to console
R_REDO .equ $E7C1 ; emit "?REDO" to console
R_EXTRA .equ $E8AB ; emit "?EXTRA IGNORED" to console
R_DMODE .equ $F7AA ; display OK prompt and restore direct mode
R_KPOLL .equ $F879 ; if key is down, do KEYIN, else set Z CCR flag
R_KEYIN .equ $F883 ; poll key for key-down transition set Z otherwise
R_PUTC .equ $F9C9 ; write ACCA to console
R_MKTAB .equ $FA7B ; setup tabs for console
R_GETLN .equ $FAA4 ; get line, returning with X pointing to M_BUF-1
R_SETPX .equ $FB44 ; write pixel character to X
R_CLRPX .equ $FB59 ; clear pixel character in X
R_MSKPX .equ $FB7C ; get pixel screen location X and mask in R_PMSK
R_CLSN .equ $FBC4 ; clear screen with color code in ACCB
R_CLS .equ $FBD4 ; clear screen with space character
R_SOUND .equ $FFAB ; play sound with pitch in ACCA and duration in ACCB
R_MCXID .equ $FFDA ; ID location for MCX BASIC
; direct page registers
.org $80
strtcnt .block 1
strbuf .block 2
strend .block 2
strfree .block 2
strstop .block 2
dataptr .block 2
inptptr .block 2
redoptr .block 2
letptr .block 2
.org $a3
r1 .block 5
r2 .block 5
rend
rvseed .block 2
tmp1 .block 2
tmp2 .block 2
tmp3 .block 2
tmp4 .block 2
tmp5 .block 2
argv .block 10
; main program
.org M_CODE
jsr progbegin
jsr clear
LINE_10
; DIM ST(50)
ldab #50
jsr ld_ir1_pb
ldx #INTARR_ST
jsr arrdim1_ir1_ix
LINE_20
; SP=0
ldx #INTVAR_SP
ldab #0
jsr ld_ix_pb
; L=16384
ldx #INTVAR_L
ldd #16384
jsr ld_ix_pw
; H=16895
ldx #INTVAR_H
ldd #16895
jsr ld_ix_pw
; GOSUB 100
ldx #LINE_100
jsr gosub_ix
LINE_30
; END
jsr progend
LINE_100
; A=PEEK(L)
ldx #INTVAR_L
jsr peek_ir1_ix
ldx #INTVAR_A
jsr ld_ix_ir1
LINE_110
; B=PEEK(H)
ldx #INTVAR_H
jsr peek_ir1_ix
ldx #INTVAR_B
jsr ld_ix_ir1
LINE_120
; IF A>B THEN
ldx #INTVAR_B
jsr ld_ir1_ix
ldx #INTVAR_A
jsr ldlt_ir1_ir1_ix
ldx #LINE_130
jsr jmpeq_ir1_ix
; POKE H,A
ldx #INTVAR_A
jsr ld_ir1_ix
ldx #INTVAR_H
jsr poke_ix_ir1
; POKE L,B
ldx #INTVAR_B
jsr ld_ir1_ix
ldx #INTVAR_L
jsr poke_ix_ir1
LINE_130
; Z=INT(SHIFT(H-L,-1))
ldx #INTVAR_H
jsr ld_ir1_ix
ldx #INTVAR_L
jsr sub_ir1_ir1_ix
ldab #-1
jsr shift_fr1_ir1_nb
ldx #INTVAR_Z
jsr ld_ix_ir1
LINE_140
; IF Z<1 THEN
ldx #INTVAR_Z
jsr ld_ir1_ix
ldab #1
jsr ldlt_ir1_ir1_pb
ldx #LINE_150
jsr jmpeq_ir1_ix
; RETURN
jsr return
LINE_150
; Z+=L
ldx #INTVAR_L
jsr ld_ir1_ix
ldx #INTVAR_Z
jsr add_ix_ix_ir1
LINE_160
; A=PEEK(Z)
ldx #INTVAR_Z
jsr peek_ir1_ix
ldx #INTVAR_A
jsr ld_ix_ir1
LINE_170
; IF A<PEEK(L) THEN
ldx #INTVAR_A
jsr ld_ir1_ix
ldx #INTVAR_L
jsr peek_ir2_ix
jsr ldlt_ir1_ir1_ir2
ldx #LINE_180
jsr jmpeq_ir1_ix
; A=PEEK(L)
ldx #INTVAR_L
jsr peek_ir1_ix
ldx #INTVAR_A
jsr ld_ix_ir1
LINE_180
; IF A>PEEK(H) THEN
ldx #INTVAR_H
jsr peek_ir1_ix
ldx #INTVAR_A
jsr ldlt_ir1_ir1_ix
ldx #LINE_190
jsr jmpeq_ir1_ix
; A=PEEK(H)
ldx #INTVAR_H
jsr peek_ir1_ix
ldx #INTVAR_A
jsr ld_ix_ir1
LINE_190
; LP=L
ldx #INTVAR_L
jsr ld_ir1_ix
ldx #INTVAR_LP
jsr ld_ix_ir1
; HP=H
ldx #INTVAR_H
jsr ld_ir1_ix
ldx #INTVAR_HP
jsr ld_ix_ir1
LINE_200
; WHEN A<=PEEK(LP) GOTO 220
ldx #INTVAR_LP
jsr peek_ir1_ix
ldx #INTVAR_A
jsr ldge_ir1_ir1_ix
ldx #LINE_220
jsr jmpne_ir1_ix
LINE_210
; LP+=1
ldx #INTVAR_LP
ldab #1
jsr add_ix_ix_pb
; GOTO 200
ldx #LINE_200
jsr goto_ix
LINE_220
; WHEN LP=HP GOTO 270
ldx #INTVAR_LP
jsr ld_ir1_ix
ldx #INTVAR_HP
jsr ldeq_ir1_ir1_ix
ldx #LINE_270
jsr jmpne_ir1_ix
LINE_230
; WHEN A>PEEK(HP) GOTO 250
ldx #INTVAR_HP
jsr peek_ir1_ix
ldx #INTVAR_A
jsr ldlt_ir1_ir1_ix
ldx #LINE_250
jsr jmpne_ir1_ix
LINE_240
; HP-=1
ldx #INTVAR_HP
ldab #1
jsr sub_ix_ix_pb
; GOTO 220
ldx #LINE_220
jsr goto_ix
LINE_250
; WHEN LP=HP GOTO 270
ldx #INTVAR_LP
jsr ld_ir1_ix
ldx #INTVAR_HP
jsr ldeq_ir1_ir1_ix
ldx #LINE_270
jsr jmpne_ir1_ix
LINE_260
; T=PEEK(LP)
ldx #INTVAR_LP
jsr peek_ir1_ix
ldx #INTVAR_T
jsr ld_ix_ir1
; POKE LP,PEEK(HP)
ldx #INTVAR_HP
jsr peek_ir1_ix
ldx #INTVAR_LP
jsr poke_ix_ir1
; POKE HP,T
ldx #INTVAR_T
jsr ld_ir1_ix
ldx #INTVAR_HP
jsr poke_ix_ir1
; GOTO 200
ldx #LINE_200
jsr goto_ix
LINE_270
; WHEN (A<>PEEK(L)) OR (L=H) GOTO 290
ldx #INTVAR_A
jsr ld_ir1_ix
ldx #INTVAR_L
jsr peek_ir2_ix
jsr ldne_ir1_ir1_ir2
ldx #INTVAR_L
jsr ld_ir2_ix
ldx #INTVAR_H
jsr ldeq_ir2_ir2_ix
jsr or_ir1_ir1_ir2
ldx #LINE_290
jsr jmpne_ir1_ix
LINE_280
; L+=1
ldx #INTVAR_L
ldab #1
jsr add_ix_ix_pb
; GOTO 270
ldx #LINE_270
jsr goto_ix
LINE_290
; IF LP<L THEN
ldx #INTVAR_LP
jsr ld_ir1_ix
ldx #INTVAR_L
jsr ldlt_ir1_ir1_ix
ldx #LINE_300
jsr jmpeq_ir1_ix
; LP=L
ldx #INTVAR_L
jsr ld_ir1_ix
ldx #INTVAR_LP
jsr ld_ix_ir1
LINE_300
; ST(SP)=LP
ldx #INTVAR_SP
jsr ld_ir1_ix
ldx #INTARR_ST
jsr arrref1_ir1_ix
ldx #INTVAR_LP
jsr ld_ir1_ix
jsr ld_ip_ir1
; ST(SP+1)=H
ldx #INTVAR_SP
jsr ld_ir1_ix
ldab #1
jsr add_ir1_ir1_pb
ldx #INTARR_ST
jsr arrref1_ir1_ix
ldx #INTVAR_H
jsr ld_ir1_ix
jsr ld_ip_ir1
; SP+=2
ldx #INTVAR_SP
ldab #2
jsr add_ix_ix_pb
LINE_310
; H=LP
ldx #INTVAR_LP
jsr ld_ir1_ix
ldx #INTVAR_H
jsr ld_ix_ir1
; GOSUB 100
ldx #LINE_100
jsr gosub_ix
LINE_320
; SP-=2
ldx #INTVAR_SP
ldab #2
jsr sub_ix_ix_pb
; L=ST(SP)
ldx #INTVAR_SP
jsr ld_ir1_ix
ldx #INTARR_ST
jsr arrval1_ir1_ix
ldx #INTVAR_L
jsr ld_ix_ir1
; H=ST(SP+1)
ldx #INTVAR_SP
jsr ld_ir1_ix
ldab #1
jsr add_ir1_ir1_pb
ldx #INTARR_ST
jsr arrval1_ir1_ix
ldx #INTVAR_H
jsr ld_ix_ir1
LINE_330
; GOTO 100
ldx #LINE_100
jsr goto_ix
LLAST
; END
jsr progend
.module mdalloc
; alloc D bytes in array memory.
; then relink strings.
alloc
std tmp1
ldx strfree
addd strfree
std strfree
ldd strend
addd tmp1
std strend
sts tmp2
subd tmp2
blo _ok
ldab #OM_ERROR
jmp error
_ok
lds strfree
des
_again
dex
dex
ldd ,x
pshb
psha
cpx strbuf
bhi _again
lds tmp2
ldx strbuf
ldd strbuf
addd tmp1
std strbuf
clra
_nxtz
staa ,x
inx
cpx strbuf
blo _nxtz
ldx strbuf
; relink permanent strings
; ENTRY: X points to offending link word in strbuf
; EXIT: X points to strend
strlink
cpx strend
bhs _rts
stx tmp1
ldd tmp1
addd #2
ldx ,x
std 1,x
ldab 0,x
ldx 1,x
abx
bra strlink
_rts
rts
.module mdgeteq
geteq
beq _1
ldd #0
rts
_1
ldd #-1
rts
.module mdgetge
getge
bge _1
ldd #0
rts
_1
ldd #-1
rts
.module mdgetlt
getlt
blt _1
ldd #0
rts
_1
ldd #-1
rts
.module mdgetne
getne
bne _1
ldd #0
rts
_1
ldd #-1
rts
.module mdpeek
; perform PEEK(X), emulating keypolling
; ENTRY: X holds storage byte
; EXIT: ACCB holds peeked byte
peek
cpx #M_KBUF
blo _peek
cpx #M_IKEY
bhi _peek
beq _poll
cpx #M_KBUF+7
bhi _peek
_poll
jsr R_KPOLL
beq _peek
staa M_IKEY
_peek
ldab ,x
rts
.module mdprint
print
_loop
ldaa ,x
jsr R_PUTC
inx
decb
bne _loop
rts
.module mdref1
; validate offset from 1D descriptor X and argv
; if empty desc, then alloc D bytes in array memory and 11 elements.
; return word offset in D and byte offset in tmp1
ref1
std tmp1
ldd ,x
bne _preexist
ldd strbuf
std ,x
ldd #11
std 2,x
ldd tmp1
pshx
jsr alloc
pulx
_preexist
ldd 0+argv
subd 2,x
bhi _err
ldd 0+argv
std tmp1
lsld
rts
_err
ldab #BS_ERROR
jmp error
.module mdrefint
; return int/str array reference in D/tmp1
refint
addd tmp1
addd 0,x
std tmp1
rts
.module mdshrflt
; divide X by 2^ACCB for positive ACCB
; ENTRY X contains multiplicand in (0,x 1,x 2,x 3,x 4,x)
; EXIT X*2^ACCB in (0,x 1,x 2,x 3,x 4,x)
; uses tmp1
shrint
clr 3,x
clr 4,x
shrflt
cmpb #8
blo _shrbit
stab tmp1
ldd 2,x
std 3,x
ldd 0,x
std 1,x
clrb
lsla
sbcb #0
stab 0,x
ldab tmp1
subb #8
bne shrflt
rts
_shrbit
asr 0,x
ror 1,x
ror 2,x
ror 3,x
ror 4,x
decb
bne _shrbit
rts
add_ir1_ir1_pb ; numCalls = 2
.module modadd_ir1_ir1_pb
clra
addd r1+1
std r1+1
ldab #0
adcb r1
stab r1
rts
add_ix_ix_ir1 ; numCalls = 1
.module modadd_ix_ix_ir1
ldd 1,x
addd r1+1
std 1,x
ldab 0,x
adcb r1
stab 0,x
rts
add_ix_ix_pb ; numCalls = 3
.module modadd_ix_ix_pb
clra
addd 1,x
std 1,x
ldab #0
adcb 0,x
stab 0,x
rts
arrdim1_ir1_ix ; numCalls = 1
.module modarrdim1_ir1_ix
ldd ,x
beq _ok
ldab #DD_ERROR
jmp error
_ok
ldd strbuf
std ,x
ldd r1+1
addd #1
std 2,x
lsld
addd 2,x
jmp alloc
arrref1_ir1_ix ; numCalls = 2
.module modarrref1_ir1_ix
ldd r1+1
std 0+argv
ldd #33
jsr ref1
jsr refint
std letptr
rts
arrval1_ir1_ix ; numCalls = 2
.module modarrval1_ir1_ix
ldd r1+1
std 0+argv
ldd #33
jsr ref1
jsr refint
ldx tmp1
ldab ,x
stab r1
ldd 1,x
std r1+1
rts
clear ; numCalls = 1
.module modclear
clra
ldx #bss
bra _start
_again
staa ,x
inx
_start
cpx #bes
bne _again
stx strbuf
stx strend
inx
inx
stx strfree
ldx #$8FFF
stx strstop
ldx #startdata
stx dataptr
rts
gosub_ix ; numCalls = 2
.module modgosub_ix
ldab #3
pshb
jmp ,x
goto_ix ; numCalls = 5
.module modgoto_ix
ins
ins
jmp ,x
jmpeq_ir1_ix ; numCalls = 5
.module modjmpeq_ir1_ix
ldd r1+1
bne _rts
ldaa r1
bne _rts
ins
ins
jmp ,x
_rts
rts
jmpne_ir1_ix ; numCalls = 5
.module modjmpne_ir1_ix
ldd r1+1
bne _go
ldaa r1
bne _go
rts
_go
ins
ins
jmp ,x
ld_ip_ir1 ; numCalls = 2
.module modld_ip_ir1
ldx letptr
ldd r1+1
std 1,x
ldab r1
stab 0,x
rts
ld_ir1_ix ; numCalls = 22
.module modld_ir1_ix
ldd 1,x
std r1+1
ldab 0,x
stab r1
rts
ld_ir1_pb ; numCalls = 1
.module modld_ir1_pb
stab r1+2
ldd #0
std r1
rts
ld_ir2_ix ; numCalls = 1
.module modld_ir2_ix
ldd 1,x
std r2+1
ldab 0,x
stab r2
rts
ld_ix_ir1 ; numCalls = 13
.module modld_ix_ir1
ldd r1+1
std 1,x
ldab r1
stab 0,x
rts
ld_ix_pb ; numCalls = 1
.module modld_ix_pb
stab 2,x
ldd #0
std 0,x
rts
ld_ix_pw ; numCalls = 2
.module modld_ix_pw
std 1,x
ldab #0
stab 0,x
rts
ldeq_ir1_ir1_ix ; numCalls = 2
.module modldeq_ir1_ir1_ix
ldd r1+1
subd 1,x
bne _done
ldab r1
cmpb 0,x
_done
jsr geteq
std r1+1
stab r1
rts
ldeq_ir2_ir2_ix ; numCalls = 1
.module modldeq_ir2_ir2_ix
ldd r2+1
subd 1,x
bne _done
ldab r2
cmpb 0,x
_done
jsr geteq
std r2+1
stab r2
rts
ldge_ir1_ir1_ix ; numCalls = 1
.module modldge_ir1_ir1_ix
ldd r1+1
subd 1,x
ldab r1
sbcb 0,x
jsr getge
std r1+1
stab r1
rts
ldlt_ir1_ir1_ir2 ; numCalls = 1
.module modldlt_ir1_ir1_ir2
ldd r1+1
subd r2+1
ldab r1
sbcb r2
jsr getlt
std r1+1
stab r1
rts
ldlt_ir1_ir1_ix ; numCalls = 4
.module modldlt_ir1_ir1_ix
ldd r1+1
subd 1,x
ldab r1
sbcb 0,x
jsr getlt
std r1+1
stab r1
rts
ldlt_ir1_ir1_pb ; numCalls = 1
.module modldlt_ir1_ir1_pb
clra
std tmp1
ldd r1+1
subd tmp1
ldab r1
sbcb #0
jsr getlt
std r1+1
stab r1
rts
ldne_ir1_ir1_ir2 ; numCalls = 1
.module modldne_ir1_ir1_ir2
ldd r1+1
subd r2+1
bne _done
ldab r1
cmpb r2
_done
jsr getne
std r1+1
stab r1
rts
or_ir1_ir1_ir2 ; numCalls = 1
.module modor_ir1_ir1_ir2
ldd r2+1
orab r1+2
oraa r1+1
std r1+1
ldab r2
orab r1
stab r1
rts
peek_ir1_ix ; numCalls = 10
.module modpeek_ir1_ix
ldx 1,x
jsr peek
stab r1+2
ldd #0
std r1
rts
peek_ir2_ix ; numCalls = 2
.module modpeek_ir2_ix
ldx 1,x
jsr peek
stab r2+2
ldd #0
std r2
rts
poke_ix_ir1 ; numCalls = 4
.module modpoke_ix_ir1
ldab r1+2
ldx 1,x
stab ,x
rts
progbegin ; numCalls = 1
.module modprogbegin
ldx R_MCXID
cpx #'h'*256+'C'
bne _mcbasic
pulx
clrb
pshb
pshb
pshb
stab strtcnt
jmp ,x
_reqmsg .text "?MICROCOLOR BASIC ROM REQUIRED"
_mcbasic
ldx #_reqmsg
ldab #30
jsr print
pulx
rts
progend ; numCalls = 2
.module modprogend
pulx
pula
pula
pula
jsr R_RESET
jmp R_DMODE
NF_ERROR .equ 0
RG_ERROR .equ 4
OD_ERROR .equ 6
FC_ERROR .equ 8
OV_ERROR .equ 10
OM_ERROR .equ 12
BS_ERROR .equ 16
DD_ERROR .equ 18
LS_ERROR .equ 28
error
jmp R_ERROR
return ; numCalls = 1
.module modreturn
pulx
tsx
clrb
_nxt
abx
ldab ,x
bne _ok
ldab #RG_ERROR
jmp error
_ok
cmpb #3
bne _nxt
inx
txs
rts
shift_fr1_ir1_nb ; numCalls = 1
.module modshift_fr1_ir1_nb
ldx #r1
negb
jmp shrint
sub_ir1_ir1_ix ; numCalls = 1
.module modsub_ir1_ir1_ix
ldd r1+1
subd 1,x
std r1+1
ldab r1
sbcb 0,x
stab r1
rts
sub_ix_ix_pb ; numCalls = 2
.module modsub_ix_ix_pb
stab tmp1
ldd 1,x
subb tmp1
sbca #0
std 1,x
ldab 0,x
sbcb #0
stab 0,x
rts
; data table
startdata
enddata
; block started by symbol
bss
; Numeric Variables
INTVAR_A .block 3
INTVAR_B .block 3
INTVAR_H .block 3
INTVAR_HP .block 3
INTVAR_L .block 3
INTVAR_LP .block 3
INTVAR_SP .block 3
INTVAR_T .block 3
INTVAR_Z .block 3
; String Variables
; Numeric Arrays
INTARR_ST .block 4 ; dims=1
; String Arrays
; block ended by symbol
bes
.end
| 11.893229 | 71 | 0.706956 |
b36b198b1d2236e4b8b90f46f753d49b8e6a38df | 555 | asm | Assembly | oeis/226/A226939.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/226/A226939.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/226/A226939.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A226939: A recursive variation of the Collatz-Fibonacci sequence: a(n) = 1 + min(a(C(n)),a(C(C(n)))) where C(n) = A006370(n), the Collatz map.
; Submitted by Jon Maiga
; 1,1,4,2,3,5,9,2,10,4,8,5,5,9,9,3,7,11,11,4,4,8,8,6,12,6,56,10,10,10,54,3,14,7,7,11,11,11,18,5,55,5,15,9,9,9,53,6,13,13,13,6,6,57,57,10,17,10,17,10,10,54,54,4,14,14,14,8,8,8,52,12,58,12,8,12,12,18,18,5,12,56,56,5,5,16,16,9,16,9,47,9,9,53,53,7,60,13,13,13
seq $0,6577 ; Number of halving and tripling steps to reach 1 in '3x+1' problem, or -1 if 1 is never reached.
div $0,2
add $0,1
| 69.375 | 255 | 0.645045 |
9098aa63d0f6f73a9fad37390e17840ba7864927 | 265 | asm | Assembly | kernel/GRUBloader.asm | gitter-badger/DepthOS | cfef2e1d65f2ae47088176727329056fdbca8ce5 | [
"MIT"
] | null | null | null | kernel/GRUBloader.asm | gitter-badger/DepthOS | cfef2e1d65f2ae47088176727329056fdbca8ce5 | [
"MIT"
] | null | null | null | kernel/GRUBloader.asm | gitter-badger/DepthOS | cfef2e1d65f2ae47088176727329056fdbca8ce5 | [
"MIT"
] | null | null | null | MAGIC equ 0x1BADB002
FLAGS equ 0
CHECKSUM equ -(MAGIC + FLAGS)
section .multiboot
global bootGRUB
; extern bss
; extern text
; extern end
; extern _loadkernel
dd MAGIC ; multiboot 2
dd FLAGS
dd CHECKSUM
;dd bootGRUB
;dd .bss
;dd .text
;dd .end
;dd _loadkernel
| 11.521739 | 29 | 0.739623 |
20f8cc48625b892c779d5548beb83c3205c132aa | 2,017 | asm | Assembly | inc/palettes.asm | gb-archive/cgb-acid2 | 04c6ca40cf75b6a93513fe596de4ab797efaff97 | [
"MIT"
] | 60 | 2020-04-13T10:37:23.000Z | 2022-03-23T20:11:44.000Z | inc/palettes.asm | gb-archive/cgb-acid2 | 04c6ca40cf75b6a93513fe596de4ab797efaff97 | [
"MIT"
] | 2 | 2020-07-12T21:01:12.000Z | 2021-02-26T06:34:02.000Z | inc/palettes.asm | gb-archive/cgb-acid2 | 04c6ca40cf75b6a93513fe596de4ab797efaff97 | [
"MIT"
] | 2 | 2020-04-20T10:43:01.000Z | 2020-12-21T03:00:13.000Z |
BackgroundPalette::
; palette 0
rgb 31, 31, 31
rgb 21, 21, 21
rgb 11, 11, 11
rgb 0, 0, 0
; palette 1
rgb 0, 0, 31 ; 0 = blue
rgb 0, 31, 00 ; 1 = green
rgb 31, 0, 0 ; 2 = red
rgb 0, 0, 0 ; 3 = black
; palette 2
rgb 0, 19, 00 ; 0 = mid-green
rgb 31, 31, 00 ; 1 = yellow
rgb 31, 31, 31 ; 2 = white
rgb 0, 0, 0 ; 3 = black
; palette 3
rgb 31, 0, 00 ; 0 = red
rgb 31, 31, 00 ; 1 = yellow
rgb 31, 31, 31 ; 2 = white
rgb 0, 0, 0 ; 3 = black
; palette 4 - "!" in "hello world!" text
rgb 31, 31, 31 ; 0 = white
rgb 0, 0, 31 ; 1 = blue
rgb 31, 0, 31 ; 2 = purple
rgb 13, 23, 31 ; 3 = light blue
.end:
ObjectPalette::
; palette 0
rgb 31, 0, 31 ; 0 = purple (unused)
rgb 31, 31, 0 ; 1 = yellow
rgb 31, 31, 31 ; 2 = white
rgb 0, 0, 0 ; 3 = black
; palette 1
rgb 31, 31, 31 ; 0 = white (unused)
rgb 31, 31, 31 ; 1 = white
rgb 31, 0, 0 ; 2 = red
rgb 31, 0, 0 ; 3 = red
; palette 2
rgb 31, 31, 31 ; 0 = white (unused)
rgb 31, 31, 31 ; 1 = white
rgb 31, 0, 0 ; 2 = white
rgb 0, 19, 0 ; 3 = red
; palette 3 - "hello world!" text
rgb 31, 0, 31 ; 0 = purple (unused)
rgb 0, 0, 31 ; 1 = blue
rgb 31, 0, 31 ; 2 = purple
rgb 13, 23, 31 ; 3 = light blue
; palette 4 - cover for the "!" in "hello world!" text -
; if the sprite limit doesn't kick in this will overlap the "!" from the background
rgb 31, 31, 31 ; 0 = white
rgb 31, 31, 31 ; 1 = white
rgb 31, 31, 31 ; 2 = white
rgb 31, 31, 31 ; 3 = white
; palette 5 - eye lash
rgb 31, 0, 31 ; 0 = purple (unused)
rgb 21, 21, 0 ; 1 = mid yellow
rgb 14, 14, 0 ; 2 = dark yellow
rgb 0, 0, 0 ; 3 = black
.end: | 28.408451 | 87 | 0.439762 |
2695f1feb15a92b1afed5886cf671159fe7267e5 | 7,022 | asm | Assembly | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_409.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_409.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/US/_zr_/i7-7700_9_0x48.log_21829_409.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %r14
push %r8
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_UC_ht+0x451c, %r14
nop
nop
nop
nop
nop
and $59884, %r8
movb $0x61, (%r14)
nop
nop
add %rbp, %rbp
lea addresses_UC_ht+0x1630c, %r10
nop
cmp $44126, %rdi
movw $0x6162, (%r10)
and %r11, %r11
lea addresses_A_ht+0x179c, %r14
nop
sub $39972, %r13
mov $0x6162636465666768, %r8
movq %r8, %xmm5
movups %xmm5, (%r14)
add $53740, %r11
lea addresses_WT_ht+0x69c, %r10
nop
nop
nop
nop
nop
sub %r14, %r14
and $0xffffffffffffffc0, %r10
vmovntdqa (%r10), %ymm7
vextracti128 $0, %ymm7, %xmm7
vpextrq $1, %xmm7, %rbp
nop
and $4246, %r13
lea addresses_WT_ht+0x19b34, %rdi
nop
nop
nop
nop
and %r8, %r8
vmovups (%rdi), %ymm6
vextracti128 $1, %ymm6, %xmm6
vpextrq $0, %xmm6, %rbp
nop
nop
cmp $15230, %r10
lea addresses_WC_ht+0x1119c, %r11
nop
nop
nop
and $39919, %r10
mov (%r11), %r13
nop
sub %r11, %r11
lea addresses_WC_ht+0x731c, %r14
nop
inc %rbp
movb (%r14), %r8b
nop
nop
xor %rbp, %rbp
lea addresses_normal_ht+0x3eac, %rbp
nop
nop
nop
nop
cmp $63895, %r10
mov $0x6162636465666768, %rdi
movq %rdi, (%rbp)
nop
nop
nop
nop
nop
add %r14, %r14
lea addresses_UC_ht+0x10e1c, %rsi
lea addresses_WT_ht+0xce44, %rdi
nop
and %r11, %r11
mov $126, %rcx
rep movsq
nop
nop
nop
nop
sub %r13, %r13
lea addresses_A_ht+0x16c4c, %rsi
lea addresses_A_ht+0x1defc, %rdi
nop
nop
nop
cmp %rbp, %rbp
mov $72, %rcx
rep movsw
nop
nop
nop
inc %r11
lea addresses_A_ht+0x1c4b0, %rdi
nop
nop
nop
nop
cmp $28909, %r14
movups (%rdi), %xmm2
vpextrq $1, %xmm2, %rsi
nop
nop
nop
nop
nop
add %r11, %r11
lea addresses_WT_ht+0x131dc, %rsi
lea addresses_WT_ht+0x1199c, %rdi
nop
nop
add %r10, %r10
mov $98, %rcx
rep movsb
xor $35973, %rbp
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r8
pop %r14
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r12
push %r13
push %r14
push %rax
push %rdi
push %rsi
// Faulty Load
lea addresses_US+0x1e99c, %rsi
add %r13, %r13
movb (%rsi), %r12b
lea oracles, %rsi
and $0xff, %r12
shlq $12, %r12
mov (%rsi,%r12,1), %r12
pop %rsi
pop %rdi
pop %rax
pop %r14
pop %r13
pop %r12
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 4, 'same': False, 'NT': False}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'type': 'addresses_US', 'AVXalign': False, 'congruent': 0, 'size': 1, 'same': True, 'NT': False}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 7, 'size': 1, 'same': False, 'NT': False}}
{'OP': 'STOR', 'dst': {'type': 'addresses_UC_ht', 'AVXalign': False, 'congruent': 4, 'size': 2, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 9, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 6, 'size': 32, 'same': False, 'NT': True}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WT_ht', 'AVXalign': False, 'congruent': 2, 'size': 32, 'same': False, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 11, 'size': 8, 'same': True, 'NT': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_WC_ht', 'AVXalign': False, 'congruent': 5, 'size': 1, 'same': False, 'NT': True}}
{'OP': 'STOR', 'dst': {'type': 'addresses_normal_ht', 'AVXalign': False, 'congruent': 3, 'size': 8, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_UC_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': True}}
{'OP': 'REPM', 'src': {'type': 'addresses_A_ht', 'congruent': 3, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'OP': 'LOAD', 'src': {'type': 'addresses_A_ht', 'AVXalign': False, 'congruent': 2, 'size': 16, 'same': False, 'NT': False}}
{'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 11, 'same': False}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 36.572917 | 2,999 | 0.657363 |
f94a2b8c7f4fde2ab40907986291253b46c3cd08 | 871 | asm | Assembly | mappings/sprite/GHZ Edge Walls.asm | kramlat/Open-Source-Sonic-ROM-Base | ba438ade0c74bc563aa83e4cd9cd08d4aded55af | [
"BSD-3-Clause"
] | null | null | null | mappings/sprite/GHZ Edge Walls.asm | kramlat/Open-Source-Sonic-ROM-Base | ba438ade0c74bc563aa83e4cd9cd08d4aded55af | [
"BSD-3-Clause"
] | null | null | null | mappings/sprite/GHZ Edge Walls.asm | kramlat/Open-Source-Sonic-ROM-Base | ba438ade0c74bc563aa83e4cd9cd08d4aded55af | [
"BSD-3-Clause"
] | null | null | null | ; --------------------------------------------------------------------------------
; Sprite mappings - output from SonMapEd - Sonic 2 format
; --------------------------------------------------------------------------------
Map_GHZ_Wall:
dc.w Map_GHZ_Wall_6-Map_GHZ_Wall, Map_GHZ_Wall_28-Map_GHZ_Wall
dc.w Map_GHZ_Wall_4A-Map_GHZ_Wall
Map_GHZ_Wall_6: dc.b 0, 4
dc.b $E0, 5, 0, 4, 0, 2, $FF, $F8
dc.b $F0, 5, 0, 8, 0, 4, $FF, $F8
dc.b 0, 5, 0, 8, 0, 4, $FF, $F8
dc.b $10, 5, 0, 8, 0, 4, $FF, $F8
Map_GHZ_Wall_28: dc.b 0, 4
dc.b $E0, 5, 0, 8, 0, 4, $FF, $F8
dc.b $F0, 5, 0, 8, 0, 4, $FF, $F8
dc.b 0, 5, 0, 8, 0, 4, $FF, $F8
dc.b $10, 5, 0, 8, 0, 4, $FF, $F8
Map_GHZ_Wall_4A: dc.b 0, 4
dc.b $E0, 5, 0, 0, 0, 0, $FF, $F8
dc.b $F0, 5, 0, 0, 0, 0, $FF, $F8
dc.b 0, 5, 0, 0, 0, 0, $FF, $F8
dc.b $10, 5, 0, 0, 0, 0, $FF, $F8
even
| 36.291667 | 82 | 0.424799 |
f9742a268a17ef915a4c6aacda15d15c212bb25f | 6,648 | asm | Assembly | audio/music/dungeon3.asm | etdv-thevoid/pokemon-rgb-enhanced | 5b244c1cf46aab98b9c820d1b7888814eb7fa53f | [
"MIT"
] | 9 | 2020-07-12T19:44:21.000Z | 2022-03-03T23:32:40.000Z | audio/music/dungeon3.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 7 | 2020-07-16T10:48:52.000Z | 2021-01-28T18:32:02.000Z | audio/music/dungeon3.asm | JStar-debug2020/pokemon-rby-dx | c2fdd8145d96683addbd8d9075f946a68d1527a1 | [
"MIT"
] | 2 | 2021-03-28T18:33:43.000Z | 2021-05-06T13:12:09.000Z | Music_Dungeon3_Ch0::
tempo 160
volume 7, 7
duty 3
toggleperfectpitch
vibrato 8, 1, 4
Music_Dungeon3_branch_7e9fc::
notetype 12, 12, 3
Music_Dungeon3_branch_7e9fe::
callchannel Music_Dungeon3_branch_7eab2
loopchannel 3, Music_Dungeon3_branch_7e9fe
octave 2
B_ 2
octave 3
D# 2
G_ 2
octave 2
B_ 2
octave 3
D# 2
G_ 2
D# 2
E_ 2
Music_Dungeon3_branch_7ea11::
callchannel Music_Dungeon3_branch_7eac1
loopchannel 4, Music_Dungeon3_branch_7ea11
Music_Dungeon3_branch_7ea18::
callchannel Music_Dungeon3_branch_7eab2
loopchannel 4, Music_Dungeon3_branch_7ea18
octave 4
F_ 2
F_ 2
rest 2
F_ 2
E_ 2
E_ 2
D# 2
D# 2
rest 2
D# 2
D_ 2
D_ 2
callchannel Music_Dungeon3_branch_7eafc
octave 4
D_ 2
D_ 2
rest 2
D_ 2
D# 2
D# 2
E_ 2
E_ 2
rest 2
E_ 2
F_ 2
F_ 2
Music_Dungeon3_branch_7ea3c::
callchannel Music_Dungeon3_branch_7eace
loopchannel 4, Music_Dungeon3_branch_7ea3c
Music_Dungeon3_branch_7ea43::
callchannel Music_Dungeon3_branch_7eadd
loopchannel 3, Music_Dungeon3_branch_7ea43
octave 3
C# 2
octave 2
A_ 2
F_ 2
octave 3
C# 2
octave 2
A_ 2
F_ 2
octave 3
A_ 2
F_ 2
octave 4
C# 2
octave 3
A_ 2
F_ 2
octave 4
C# 2
octave 3
A_ 2
F_ 2
A_ 2
F_ 2
octave 4
C# 2
octave 3
A_ 2
F_ 2
octave 4
C# 2
octave 3
A_ 2
F_ 2
octave 4
C# 2
octave 3
A_ 2
F_ 2
octave 4
C# 2
octave 3
A_ 2
F_ 2
octave 4
C# 2
octave 3
A_ 2
F_ 2
octave 4
C# 2
octave 3
A_ 2
F_ 2
G# 2
E_ 2
octave 4
C_ 2
octave 3
G# 2
E_ 2
octave 4
C_ 2
callchannel Music_Dungeon3_branch_7eaea
callchannel Music_Dungeon3_branch_7eaea
octave 3
G# 2
E_ 2
octave 4
C_ 2
octave 3
G# 2
E_ 2
octave 4
C_ 2
octave 3
G# 2
E_ 2
rest 16
rest 8
callchannel Music_Dungeon3_branch_7eaf7
callchannel Music_Dungeon3_branch_7eaf7
callchannel Music_Dungeon3_branch_7eaf7
callchannel Music_Dungeon3_branch_7eaf7
D# 2
rest 16
rest 16
loopchannel 0, Music_Dungeon3_branch_7e9fc
Music_Dungeon3_branch_7eab2::
octave 2
B_ 2
octave 3
D# 2
G_ 2
octave 2
B_ 2
octave 3
D# 2
G_ 2
octave 2
B_ 2
octave 3
D# 2
endchannel
Music_Dungeon3_branch_7eac1::
E_ 2
G# 2
octave 4
C_ 2
octave 3
E_ 2
G# 2
octave 4
C_ 2
octave 3
E_ 2
G# 2
endchannel
Music_Dungeon3_branch_7eace::
octave 3
D# 2
octave 2
B_ 2
octave 3
G_ 2
D# 2
octave 2
B_ 2
octave 3
G_ 2
D# 2
octave 2
B_ 2
endchannel
Music_Dungeon3_branch_7eadd::
A_ 2
F_ 2
octave 3
C# 2
octave 2
A_ 2
F_ 2
octave 3
C# 2
octave 2
A_ 2
F_ 2
endchannel
Music_Dungeon3_branch_7eaea::
octave 3
G# 2
E_ 2
G# 2
E_ 2
octave 4
C_ 2
octave 3
G# 2
E_ 2
octave 4
C_ 2
endchannel
Music_Dungeon3_branch_7eaf7::
D# 2
G_ 2
D# 2
C# 6
endchannel
Music_Dungeon3_branch_7eafc::
tempo 168
octave 1
A# 1
B_ 1
octave 2
C_ 1
C# 1
D_ 1
D# 1
E_ 1
F_ 1
tempo 176
octave 1
A# 1
B_ 1
octave 2
C_ 1
C# 1
D_ 1
D# 1
E_ 1
F_ 1
tempo 184
octave 1
A# 1
B_ 1
octave 2
C_ 1
C# 1
D_ 1
D# 1
E_ 1
F_ 1
tempo 192
octave 1
A_ 1
A# 1
B_ 1
octave 2
C_ 1
C# 1
D_ 1
D# 1
E_ 1
tempo 200
octave 1
G# 1
A_ 1
A# 1
B_ 1
octave 2
C_ 1
C# 1
D_ 1
D# 1
tempo 208
octave 1
G_ 1
G# 1
A_ 1
A# 1
B_ 1
octave 2
C_ 1
C# 1
D_ 1
tempo 216
octave 1
F# 1
G_ 1
G# 1
A_ 1
A# 1
B_ 1
octave 2
C_ 1
C# 1
tempo 224
octave 1
F_ 1
F# 1
G_ 1
G# 1
A_ 1
A# 1
B_ 1
octave 2
C_ 1
tempo 160
endchannel
Music_Dungeon3_Ch1::
vibrato 11, 1, 5
duty 3
Music_Dungeon3_branch_7eb6d::
notetype 12, 13, 3
octave 4
D# 6
C# 6
octave 3
B_ 2
octave 4
C# 2
D# 2
G_ 2
D# 2
C# 6
octave 3
B_ 2
octave 4
C# 2
D# 2
G_ 2
D# 2
C# 6
octave 3
B_ 2
A# 2
B_ 6
octave 4
C# 8
rest 2
G# 6
F# 6
E_ 2
F# 2
G# 2
octave 5
C_ 2
octave 4
G# 2
F# 6
E_ 2
F# 2
G# 2
octave 5
C_ 2
octave 4
G# 2
F# 6
E_ 2
D# 2
E_ 6
F# 6
E_ 4
D# 6
C# 6
octave 3
B_ 2
octave 4
C# 2
D# 2
G_ 2
D# 2
C# 6
octave 3
B_ 2
octave 4
C# 2
D# 2
G_ 2
D# 2
C# 6
octave 3
B_ 2
A# 2
B_ 6
octave 4
C# 8
rest 2
G# 2
G# 2
rest 2
G# 2
A_ 2
A_ 2
A# 2
A# 2
rest 2
A# 2
B_ 2
B_ 2
rest 8
rest 8
rest 8
rest 8
rest 8
rest 8
rest 8
rest 8
octave 4
B_ 2
B_ 2
rest 2
B_ 2
A# 2
A# 2
A_ 2
A_ 2
rest 2
A_ 2
G# 2
G# 2
C# 8
rest 2
octave 3
B_ 6
A# 2
B_ 2
octave 4
D# 2
G_ 2
D# 2
C# 6
octave 3
B_ 2
octave 4
C# 2
D# 2
G_ 2
D# 2
C# 6
octave 3
B_ 2
octave 4
C# 2
D# 6
G_ 6
octave 3
G_ 8
rest 2
F_ 6
E_ 2
F_ 2
A_ 2
octave 4
C# 2
octave 3
A_ 2
G_ 6
F_ 2
G_ 2
A_ 2
octave 4
C# 2
octave 3
A_ 2
G_ 6
A_ 6
octave 4
C# 6
G_ 8
rest 2
F_ 6
E_ 2
F_ 2
A_ 2
octave 5
C# 2
octave 4
A_ 2
G_ 6
A_ 2
octave 5
C# 2
octave 4
A_ 2
G_ 6
A_ 6
octave 5
C# 6
octave 4
F# 8
rest 2
E_ 6
D# 2
E_ 2
G# 2
octave 5
C_ 2
octave 4
G# 2
F# 6
E_ 2
F# 2
G# 2
octave 5
C_ 2
octave 4
G# 2
F# 6
G# 6
octave 5
C_ 6
octave 3
D# 2
G_ 2
D# 2
C# 6
D# 2
G_ 2
D# 2
C# 6
octave 2
E_ 2
G# 2
octave 3
C_ 2
E_ 2
G# 2
octave 4
C_ 2
E_ 2
G# 2
C_ 2
E_ 2
G# 2
C_ 2
E_ 2
G# 2
C_ 2
E_ 2
G# 2
C_ 2
E_ 2
G# 2
C_ 2
E_ 2
G# 2
C_ 2
D# 2
octave 2
B_ 2
octave 3
D# 2
G_ 2
octave 2
B_ 2
octave 3
D# 2
G_ 2
octave 2
B_ 2
octave 3
D# 2
octave 2
B_ 2
octave 3
D# 2
G_ 2
octave 2
B_ 2
octave 3
D# 2
G_ 2
octave 2
B_ 2
octave 3
D# 2
loopchannel 0, Music_Dungeon3_branch_7eb6d
Music_Dungeon3_Ch2::
notetype 12, 1, 2
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 12
notetype 6, 1, 0
octave 3
B_ 1
octave 4
C_ 1
C# 1
D_ 1
D# 1
E_ 1
rest 2
C_ 1
C# 1
D_ 1
D# 1
E_ 1
F_ 1
rest 16
rest 16
rest 10
octave 5
E_ 8
octave 4
B_ 8
octave 5
D# 8
octave 4
A# 8
octave 5
D_ 8
octave 4
A_ 8
octave 5
C# 8
octave 4
G# 8
octave 5
C_ 8
octave 4
G_ 8
B_ 8
F# 8
A# 8
F_ 8
A_ 8
E_ 8
rest 16
rest 16
rest 8
F_ 1
E_ 1
D# 1
D_ 1
C# 1
C_ 1
rest 2
E_ 1
D# 1
D_ 1
C# 1
C_ 1
octave 3
B_ 1
rest 10
rest 16
notetype 12, 1, 0
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 10
loopchannel 0, Music_Dungeon3_Ch2
Music_Dungeon3_Ch3::
dspeed 12
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 16
rest 10
endchannel
| 8.782034 | 43 | 0.632972 |
d0949c4b3e908d0d42468b79a08f581c7b59869a | 320 | asm | Assembly | programs/oeis/040/A040219.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/040/A040219.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/040/A040219.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A040219: Continued fraction for sqrt(235).
; 15,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30,3,30
sub $0,1
mod $0,2
mul $0,11
add $0,2
pow $0,2
mov $1,$0
div $1,17
mul $1,3
add $1,3
| 24.615385 | 189 | 0.60625 |
e5e2aedfbd8e528d857a750b72f0fa1a97575c92 | 12,002 | asm | Assembly | code/jukebox.asm | sinusoid-studios/rhythm-land | 6471f1d7b7d885bbb898888645ac291d45125134 | [
"MIT"
] | 11 | 2021-08-10T20:31:11.000Z | 2021-12-28T11:57:03.000Z | code/jukebox.asm | sinusoid-studios/rhythm-land | 6471f1d7b7d885bbb898888645ac291d45125134 | [
"MIT"
] | null | null | null | code/jukebox.asm | sinusoid-studios/rhythm-land | 6471f1d7b7d885bbb898888645ac291d45125134 | [
"MIT"
] | 1 | 2021-10-02T17:49:10.000Z | 2021-10-02T17:49:10.000Z | INCLUDE "constants/hardware.inc"
INCLUDE "constants/SoundSystem.inc"
INCLUDE "constants/SoundSystemNotes.inc"
INCLUDE "constants/music.inc"
INCLUDE "constants/sfx.inc"
;==============================================================
; starting point
;==============================================================
WaitVRAMAvailable: MACRO
ld hl,rSTAT
.waitvram\@
bit 1,[hl] ; wait for mode 0 or 1
jr nz,.waitvram\@
ENDM
SECTION "Start",ROM0
ScreenJukebox::
ld a,LCDCF_ON|LCDCF_BG8000|LCDCF_BG9800|LCDCF_BGON
ldh [hLCDC],a
ld a,BANK(InitializeGB)
ld [rROMB0], a
call InitializeGB
call InitializeVariables
;--------------------------------------
call SoundSystem_Init
; prepare the sfx
ld bc,BANK(SFX_Table)
ld de,SFX_Table
call SFX_Prepare
; start the first song playing
call ChangeMusic
;--------------------------------------
mainloop:
; check to see if Start is held down
ldh a,[hPressedKeys]
bit PADB_START,a
jr z,.notoggle
; channel toggle
ldh a,[hNewKeys]
ld b,a
ld a,AUDTERM_1_LEFT|AUDTERM_1_RIGHT
bit PADB_UP,b
jr nz,.channeltoggle
ASSERT AUDTERM_2_LEFT|AUDTERM_2_RIGHT == (AUDTERM_1_LEFT|AUDTERM_1_RIGHT) << 1
add a ; shift to channel 2
bit PADB_RIGHT,b
jr nz,.channeltoggle
ASSERT AUDTERM_3_LEFT|AUDTERM_3_RIGHT == (AUDTERM_2_LEFT|AUDTERM_2_RIGHT) << 1
add a ; shift to channel 3
bit PADB_DOWN,b
jr nz,.channeltoggle
ASSERT AUDTERM_4_LEFT|AUDTERM_4_RIGHT == (AUDTERM_3_LEFT|AUDTERM_3_RIGHT) << 1
add a ; shift to channel 4
bit PADB_LEFT,b
jr z,.notoggle
.channeltoggle
; toggle the selected channel's bits in the channel mask
ld hl,wChannelMask
xor [hl]
ld [hl],a
; update immediately
ld a,[wMusicSFXPanning]
and [hl]
ldh [rAUDTERM],a
jr .waitraster
.notoggle
; check to see if A was pressed
ldh a,[hNewKeys]
ASSERT PADB_A == 0
rra ; move bit 0 (PADB_A) to carry
call c,BtnAPressed
; check to see if B was pressed
ldh a,[hNewKeys]
bit PADB_B,a
call nz,BtnBPressed
; check to see if Select was pressed
ldh a,[hNewKeys]
bit PADB_SELECT,a
call nz,BtnSelectPressed
; check to see if right was pressed
ldh a,[hNewKeys]
bit PADB_RIGHT,a
call nz,BtnRightPressed
; check to see if left was pressed
ldh a,[hNewKeys]
bit PADB_LEFT,a
call nz,BtnLeftPressed
; check to see if up was pressed
ldh a,[hNewKeys]
bit PADB_UP,a
call nz,BtnUpPressed
; check to see if down was pressed
ldh a,[hNewKeys]
ASSERT PADB_DOWN == 7
add a ; move bit 7 (PADB_DOWN) to carry
call c,BtnDownPressed
;--------------------------------------
; audio processing
; Note: For the sake of this example showing timing,
; SoundSystem_Process is called at specific time.
; In normal use, you would call it when appropriate.
.waitraster
ldh a,[rLY]
cp 83
jr nz,.waitraster
; set the bg palette
WaitVRAMAvailable
ld a,$E5
ldh [rBGP],a
call SoundSystem_Process
; reset the bg palette
ld a,$E4
ldh [rBGP],a
;--------------------------------------
rst WaitVBlank
; update the ui (i.e. do all the Mode1 tasks first)
call DisplaySongTitle
call DisplayMusicState
call DisplaySync
call DisplaySongID
call DisplaySFXID
call DisplayVUMeters
; update the frame counter
ld hl,wFrameCounter
inc [hl]
jp mainloop
;==============================================================
; Support Routines (Bank 0)
;==============================================================
; set the coords register (de) for use with PrintString
MakeStringXY: MACRO
ld de,(\1 << 8)|\2
ENDM
;--------------------------------------------------------------
ChangeMusic:
call Music_Pause
ld a,[wCurrentSongID]
add a ; * 2
ld hl,SongDataTable
add l
ld l,a
ld a,[hl+]
ld h,[hl]
ld l,a
; put the instrument bank in bc
ld a,[hl+]
ld c,a
ld b,0
; put the insrument table pointer in de
ld a,[hl+]
ld e,a
ld a,[hl+]
ld d,a
push hl
call Music_PrepareInst
pop hl
; put the imusic bank in bc
ld a,[hl+]
ld c,a
ld b,0
; put the music table pointer in de
ld a,[hl+]
ld e,a
ld a,[hl+]
ld d,a
call Music_Play
ret
;--------------------------------------------------------------
ToggleMusic:
ld a,[wMusicPlayState]
and MUSIC_STATE_PLAYING
jr nz,.pause
call Music_Resume
ret
.pause
call Music_Pause
ret
;--------------------------------------------------------------
TriggerSFX:
ld a,[wSFXID]
ld b,a
ld c,MID_C
call SFX_Play
ret
;--------------------------------------------------------------
DisplaySongTitle:
ld h,HIGH(SongTitleTable)
ld a,[wSongID]
add a ; * 2
ld l,a
ld a,[hl+]
ld b,[hl]
ld c,a
MakeStringXY 0,8
call PrintString
ret
;--------------------------------------------------------------
DisplayMusicState:
ld a,[wMusicPlayState]
and MUSIC_STATE_PLAYING
jr nz,.playing
ld bc,StoppedString
jr .display
.playing
ld bc,PlayingString
.display
MakeStringXY 6,14
call PrintString
ret
StoppedString:
DB "Stop",$00
PlayingString:
DB "Play",$00
;--------------------------------------------------------------
DisplaySync:
ld h,HIGH(HexTable)
ld de,$99E7
ld a,[wMusicSyncData]
ld b,a
; left digit
swap a
and $0F
ld l,a
ld a,[hl]
ld [de],a
; right digit
inc e
ld a,b
and $0F
ld l,a
ld a,[hl]
ld [de],a
ret
PUSHS
SECTION "Hex Table",ROM0,ALIGN[8]
HexTable:
DB "0123456789ABCDEF"
POPS
;--------------------------------------------------------------
DisplaySongID:
ld a,[wCurrentSongID]
add $30
ld [$9A07],a
ret
;--------------------------------------------------------------
DisplaySFXID:
ld a,[wSFXID]
add $30
ld [$9A27],a
ret
;--------------------------------------------------------------
DisplayVUMeters:
; channel 1
; $99EC/$9A0C
ld a,[wVUMeter1]
ld b,a
and $08
jr nz,.split1
; top half
xor a
ld [$99EC],a
; bottom half
ld a,b
ld [$9A0C],a
jr .channel2
.split1
; top half
ld a,b
sub 8
ld [$99EC],a
; bottom half
ld a,8
ld [$9A0C],a
; channel 2
; $99EE/$9A0E
.channel2
ld a,[wVUMeter2]
ld b,a
and $08
jr nz,.split2
; top half
xor a
ld [$99EE],a
; bottom half
ld a,b
ld [$9A0E],a
jr .channel3
.split2
; top half
ld a,b
sub 8
ld [$99EE],a
; bottom half
ld a,8
ld [$9A0E],a
; channel 3
; $99F0/$9A10
.channel3
ld a,[wVUMeter3]
ld b,a
and $08
jr nz,.split3
; top half
xor a
ld [$99F0],a
; bottom half
ld a,b
ld [$9A10],a
jr .channel4
.split3
; top half
ld a,b
sub 8
ld [$99F0],a
; bottom half
ld a,8
ld [$9A10],a
; channel 4
; $99F2/$9A12
.channel4
ld a,[wVUMeter4]
ld b,a
and $08
jr nz,.split4
; top half
xor a
ld [$99F2],a
; bottom half
ld a,b
ld [$9A12],a
ret
.split4
; top half
ld a,b
sub 8
ld [$99F2],a
; bottom half
ld a,8
ld [$9A12],a
ret
;--------------------------------------------------------------
; print a null-terminated string in bc at d,e
; d,e are screen coords in tiles
PrintString:
; set the y coord
ld h,0
ld l,e
add hl,hl ; * 2
add hl,hl ; * 4
add hl,hl ; * 8
add hl,hl ; * 16
add hl,hl ; * 32
ld a,$98
add h
ld h,a
; set the x coord
ld a,l
add d
ld l,a
; copy the characters to vram
.charloop
ld a,[bc]
or a ; is this the NULL terminator?
ret z ; yes, exit
ld [hl+],a
inc bc
jr .charloop
;--------------------------------------------------------------
ReadJoypad:
; read D-Pad
ld a,P1F_GET_DPAD
call .readNibble
swap a ; move directions to high nibble
ld b,a
; read buttons
ld a,P1F_GET_BTN
call .readNibble
xor b ; combine buttons and directions + complement
ld b,a
; update hNewKeys
ldh a,[hPressedKeys]
xor b ; a = keys that changed state
and b ; a = keys that changed to pressed
ldh [hNewKeys],a
ld a,b
ldh [hPressedKeys],a
; done reading
ld a,P1F_GET_NONE
ldh [rP1],a
ret
; @param a Value to write to rP1
; @return a Reading from rP1, ignoring non-input bits (forced high)
.readNibble
ldh [rP1],a
; burn 16 cycles between write and read
call .ret ; 6+4 cycles
ldh a,[rP1] ; 3 cycles
ldh a,[rP1] ; 3 cycles
ldh a,[rP1] ; read
or $F0 ; ignore non-input bits
.ret
ret
;==============================================================
; Button press handlers
;==============================================================
BtnAPressed:
call ToggleMusic
ret
BtnBPressed:
call TriggerSFX
ret
BtnSelectPressed:
ASSERT wSongID == wCurrentSongID + 1 ; make sure wSongID follows wCurrentSongID
ld hl,wSongID
ld a,[hl-] ; get hSongID
; set the current song id
ld [hl],a
call ChangeMusic
ret
BtnRightPressed:
ld hl,wSongID
ld a,[hl]
inc a
cp NUM_SONGS
jr nz,.store
xor a
.store
ld [hl],a
ret
BtnLeftPressed:
ld hl,wSongID
ld a,[hl]
dec a
cp -1
jr nz,.store
ld a,NUM_SONGS-1
.store
ld [hl],a
ret
BtnUpPressed:
ld hl,wSFXID
ld a,[hl]
inc a
cp NUM_SFX
jr nz,.store
xor a
.store
ld [hl],a
ret
BtnDownPressed:
ld hl,wSFXID
ld a,[hl]
dec a
cp -1
jr nz,.store
ld a,NUM_SFX-1
.store
ld [hl],a
ret
;==============================================================
; Support Routines (Bank 1)
;==============================================================
; wait for the start of the next V-Blank
WaitVBlankStart: MACRO
.waitvbl\@
ldh a,[rLY]
cp SCRN_Y
jr nz,.waitvbl\@
ENDM
SECTION "Bank 1 Routines",ROMX
InitializeGB:
di
;--------------------------------------
; turn off the screen after entering a vblank
WaitVBlankStart
;--------------------------------------
; clear LCD control registers and disable audio
xor a
ldh [rLCDC],a
ldh [rIE],a
ldh [rIF],a
ldh [rSCX],a
ldh [rSCY],a
ldh [rSTAT],a
ldh [rAUDENA],a ; disable the audio
;--------------------------------------
; initialize the window posision to 255,255
dec a
ldh [rWY],a
ldh [rWX],a
;--------------------------------------
; set the bg palette
ld a,$E4
ldh [rBGP],a
;--------------------------------------
; copy the font tiles to vram
ld de,FontTiles ; source
ld hl,_VRAM8000 ; dest
ld bc,(FontTilesEnd - FontTiles) ; num bytes
call CopyMem
;--------------------------------------
; copy the ui map to vram
ld de,UIMap ; source
ld hl,_SCRN0 ; dest
ld bc,(UIMapEnd - UIMap) ; num bytes
call CopyMem
ld bc,SoundSystem_Version
ld de,$00
call PrintString
;--------------------------------------
; turn on the display
ld a,LCDCF_ON|LCDCF_BG8000|LCDCF_BG9800|LCDCF_OBJOFF|LCDCF_BGON
ldh [rLCDC],a
WaitVBlankStart
;--------------------------------------
; enable the interrupts
ld a,IEF_VBLANK
ldh [rIE],a
xor a
ei
ldh [rIF],a
ret
FontTiles:
INCBIN "data/jukebox-font.bin"
FontTilesEnd:
UIMap:
DB " "
DB " "
DB " A Music Toggle "
DB " ",$EB,"/",$EC," Change Song ID "
DB " Sel Select Song "
DB " ",$E9,"/",$EA," Change SFX ID "
DB " B Play SFX "
DB " "
DB " "
DB $DA,"Timing",$D9,$CC,$CC,$CC,$CC,$CC,$CC,$CC,$CC,$CC,$CC,$CC,$DA," "
DB " "
DB " "
DB " "
DB $DA,"State",$D9,$CC,$CC,$CC,$B7,$DA,"VUM",$D9,$CC,$CC,$CC,$CC," "
DB "Music: ",$CD," "
DB " Sync:$ ",$CD," "
DB " Song:0 ",$CD," "
DB " SFX:0 ",$CD," "
UIMapEnd:
;--------------------------------------------------------------
InitializeVariables:
ld hl,wVBlankDone
xor a
ld [hl+],a ; wVBlankDone
ld [hl+],a ; wFrameCounter
ld [hl+],a ; wCurrentSongID
ld [hl+],a ; wSongID
ld [hl+],a ; wSFXID
ldh [hPressedKeys],a
ldh [hNewKeys],a
ret
;--------------------------------------------------------------
; copy bc bytes from de to hl
; no need to wait for STAT, the display is off
CopyMem:
ld a,[de]
ld [hl+],a
inc de
dec bc
ld a,b
or c
jr nz,CopyMem
ret
;==============================================================
; work ram
;==============================================================
SECTION "Variables",WRAM0
wVBlankDone: DS 1
wFrameCounter: DS 1
wCurrentSongID: DS 1
wSongID: DS 1
wSFXID: DS 1
| 18.157337 | 83 | 0.545576 |
59dd97b1e18c38ff34c36681092e75800f347dd4 | 780 | asm | Assembly | oeis/287/A287470.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/287/A287470.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/287/A287470.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A287470: Decimal representation of the diagonal from the origin to the corner of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 276", based on the 5-celled von Neumann neighborhood.
; 1,0,6,0,28,0,120,0,496,0,2016,0,8128,0,32640,0,130816,0,523776,0,2096128,0,8386560,0,33550336,0,134209536,0,536854528,0,2147450880,0,8589869056,0,34359607296,0,137438691328,0,549755289600,0,2199022206976,0,8796090925056,0,35184367894528,0,140737479966720,0,562949936644096,0,2251799780130816,0,9007199187632128,0,36028796884746240,0,144115187807420416,0,576460751766552576,0,2305843008139952128,0,9223372034707292160,0,36893488143124135936,0,147573952581086478336,0,590295810341525782528,0
sub $1,$0
add $0,2
div $0,2
gcd $1,2
pow $1,$0
bin $1,2
mov $0,$1
| 70.909091 | 491 | 0.810256 |
da12c3797363f082610308ba1b21444bf3c53b05 | 430 | asm | Assembly | programs/oeis/132/A132046.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/132/A132046.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/132/A132046.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A132046: Triangle read by rows: T(n,0) = T(n,n) = 1, and T(n,k) = 2*binomial(n,k) for 1 <= k <= n - 1.
; 1,1,1,1,4,1,1,6,6,1,1,8,12,8,1,1,10,20,20,10,1,1,12,30,40,30,12,1,1,14,42,70,70,42,14,1,1,16,56,112,140,112,56,16,1,1,18,72,168,252,252,168,72,18,1,1,20,90,240,420,504,420,240,90,20,1
seq $0,7318 ; Pascal's triangle read by rows: C(n,k) = binomial(n,k) = n!/(k!*(n-k)!), 0 <= k <= n.
mov $1,$0
mul $0,2
cmp $1,1
sub $0,$1
| 47.777778 | 185 | 0.574419 |
5abac2b62e14d9f809a6bfb921452bb063e8318c | 273 | asm | Assembly | programs/oeis/026/A026322.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/026/A026322.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/026/A026322.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A026322: |sin(2n)| > |sin(n)|.
; 1,3,4,6,7,9,10,12,13,15,16,18,19,21,22,23,25,26,28,29,31,32,34,35,37,38,40,41,43,44,45,47,48,50,51,53,54,56,57,59,60,62,63,65,66,67,69,70,72,73,75,76,78,79,81,82,84,85,87,88,89,91
mov $1,$0
add $1,2
mul $1,7
div $1,15
add $1,1
add $1,$0
| 27.3 | 181 | 0.604396 |
497a259af587854eb8e60086867ed9e1ea770ef6 | 194 | asm | Assembly | data/pokemon/dex_entries/chix.asm | AtmaBuster/pokeplat-gen2 | fa83b2e75575949b8f72cb2c48f7a1042e97f70f | [
"blessing"
] | 6 | 2021-06-19T06:41:19.000Z | 2022-02-15T17:12:33.000Z | data/pokemon/dex_entries/chix.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | null | null | null | data/pokemon/dex_entries/chix.asm | AtmaBuster/pokeplat-gen2-old | 01e42c55db5408d72d89133dc84a46c699d849ad | [
"blessing"
] | 3 | 2021-01-15T18:45:40.000Z | 2021-10-16T03:35:27.000Z | db "HATCHLING@" ; species name
db "The two better fed"
next "heads become DODUO"
next "while the other is"
page "withdrawn. It ends"
next "up as the angriest"
next "head of DODRIO.@"
| 19.4 | 31 | 0.680412 |
57008111af949ed4ccecb28fe4b83e8a56c8c4b3 | 8,332 | asm | Assembly | Transynther/x86/_processed/NC/_st_zr_un_/i7-7700_9_0xca_notsx.log_21829_467.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NC/_st_zr_un_/i7-7700_9_0xca_notsx.log_21829_467.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NC/_st_zr_un_/i7-7700_9_0xca_notsx.log_21829_467.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r15
push %r8
push %r9
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x1d1ba, %r8
clflush (%r8)
nop
nop
nop
nop
inc %r15
mov (%r8), %bx
nop
nop
nop
nop
nop
add %r15, %r15
lea addresses_UC_ht+0x2dba, %r13
clflush (%r13)
nop
sub $44434, %r9
movb (%r13), %r12b
nop
sub $52492, %r13
lea addresses_WC_ht+0x127a6, %rsi
lea addresses_normal_ht+0x436c, %rdi
clflush (%rdi)
nop
nop
nop
nop
nop
add $63557, %r8
mov $122, %rcx
rep movsq
cmp %r15, %r15
lea addresses_normal_ht+0x1d2ea, %rsi
lea addresses_UC_ht+0x41ba, %rdi
nop
nop
nop
nop
nop
sub $61275, %r8
mov $4, %rcx
rep movsq
nop
inc %r8
lea addresses_WT_ht+0x6717, %rsi
lea addresses_D_ht+0x148ba, %rdi
add %r13, %r13
mov $106, %rcx
rep movsb
xor %rdi, %rdi
lea addresses_WT_ht+0xf13e, %rsi
lea addresses_WC_ht+0x1ba, %rdi
nop
nop
nop
nop
sub %r13, %r13
mov $85, %rcx
rep movsb
nop
inc %r15
lea addresses_WT_ht+0x51f9, %rsi
clflush (%rsi)
nop
nop
nop
cmp $19904, %r15
mov $0x6162636465666768, %r9
movq %r9, %xmm0
movups %xmm0, (%rsi)
nop
nop
nop
nop
nop
add %r12, %r12
lea addresses_WT_ht+0x187cc, %rsi
lea addresses_D_ht+0x10ba, %rdi
nop
nop
dec %rbx
mov $114, %rcx
rep movsw
nop
sub %r13, %r13
lea addresses_UC_ht+0x123ea, %rsi
lea addresses_WC_ht+0xa2fa, %rdi
nop
sub %r12, %r12
mov $45, %rcx
rep movsb
nop
nop
nop
nop
xor $19730, %r12
lea addresses_WT_ht+0x73b0, %rsi
lea addresses_A_ht+0x12932, %rdi
clflush (%rsi)
nop
nop
nop
nop
nop
xor $31702, %r9
mov $97, %rcx
rep movsl
nop
nop
nop
nop
nop
add %r12, %r12
lea addresses_A_ht+0xe85a, %rsi
lea addresses_UC_ht+0x75ba, %rdi
nop
cmp $53916, %rbx
mov $82, %rcx
rep movsl
sub $52684, %r9
lea addresses_WT_ht+0x178ba, %r9
clflush (%r9)
nop
nop
nop
nop
cmp %rsi, %rsi
vmovups (%r9), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %r8
nop
nop
dec %r8
lea addresses_WC_ht+0x50ea, %r15
clflush (%r15)
nop
nop
nop
nop
sub %rsi, %rsi
movw $0x6162, (%r15)
nop
nop
dec %r8
lea addresses_normal_ht+0x921a, %rsi
nop
add $62364, %rbx
movl $0x61626364, (%rsi)
nop
nop
nop
dec %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %r9
pop %r8
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r9
push %rax
push %rbp
push %rcx
push %rdx
// Store
lea addresses_A+0x123ba, %r10
nop
nop
nop
nop
add %rax, %rax
mov $0x5152535455565758, %rdx
movq %rdx, %xmm2
vmovups %ymm2, (%r10)
nop
nop
nop
nop
nop
dec %rax
// Store
lea addresses_UC+0x19ba, %r10
nop
add %rbp, %rbp
mov $0x5152535455565758, %rcx
movq %rcx, %xmm0
movups %xmm0, (%r10)
nop
nop
inc %rdx
// Faulty Load
mov $0x3df08f00000009ba, %rax
nop
nop
inc %r10
mov (%rax), %dx
lea oracles, %r10
and $0xff, %rdx
shlq $12, %rdx
mov (%r10,%rdx,1), %rdx
pop %rdx
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0, 'same': False, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 9, 'same': False, 'type': 'addresses_A'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 10, 'same': False, 'type': 'addresses_UC'}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 0, 'same': True, 'type': 'addresses_NC'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 10, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_WC_ht'}, 'dst': {'congruent': 0, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_normal_ht'}, 'dst': {'congruent': 11, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 2, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 9, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'STOR'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 4, 'same': False, 'type': 'addresses_UC_ht'}, 'dst': {'congruent': 6, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 0, 'same': False, 'type': 'addresses_WT_ht'}, 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM'}
{'src': {'congruent': 5, 'same': False, 'type': 'addresses_A_ht'}, 'dst': {'congruent': 8, 'same': False, 'type': 'addresses_UC_ht'}, 'OP': 'REPM'}
{'src': {'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 6, 'same': False, 'type': 'addresses_WT_ht'}, 'OP': 'LOAD'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 2, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'STOR'}
{'dst': {'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 5, 'same': False, 'type': 'addresses_normal_ht'}, 'OP': 'STOR'}
{'6d': 16961, '00': 951, '58': 3917}
58 6d 58 6d 6d 6d 6d 6d 00 58 6d 6d 58 58 6d 58 6d 58 6d 6d 6d 6d 6d 58 6d 6d 58 58 58 6d 6d 58 6d 00 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 58 58 58 6d 58 6d 58 6d 6d 6d 6d 58 6d 58 6d 6d 6d 6d 6d 58 00 6d 58 00 58 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 58 58 58 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 00 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 00 6d 6d 58 6d 6d 58 6d 6d 6d 58 6d 6d 6d 6d 58 6d 58 00 58 00 6d 6d 6d 58 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 00 6d 6d 6d 6d 00 6d 58 58 6d 6d 6d 6d 58 6d 6d 6d 6d 58 6d 6d 6d 58 6d 00 58 6d 58 6d 58 6d 6d 58 00 58 6d 00 58 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 58 6d 6d 6d 6d 58 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 58 6d 6d 6d 58 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 00 58 6d 6d 58 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 58 6d 58 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 58 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 58 6d 00 6d 6d 58 58 6d 6d 6d 6d 6d 00 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 00 6d 6d 6d 6d 58 00 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 58 6d 58 58 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 00 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 00 58 58 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 58 58 6d 58 00 6d 58 6d 58 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 58 6d 58 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 00 58 6d 00 6d 6d 6d 6d 58 6d 58 6d 6d 6d 6d 6d 58 6d 58 6d 6d 58 00 00 6d 6d 6d 6d 58 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 00 00 58 6d 58 58 00 6d 6d 6d 6d 58 6d 58 6d 6d 6d 58 6d 6d 58 6d 58 6d 6d 6d 6d 6d 58 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 58 6d 58 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 58 58 00 58 6d 6d 6d 6d 00 00 6d 58 6d 6d 6d 58 6d 58 6d 6d 58 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 00 00 00 6d 58 6d 6d 58 6d 6d 6d 6d 6d 00 58 58 6d 6d 6d 6d 58 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 00 6d 58 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 58 00 6d 58 6d 6d 6d 6d 6d 6d 58 58 6d 6d 6d 58 58 6d 6d 58 6d 6d 6d 58 58 6d 6d 6d 6d 6d 6d 6d 6d 58 58 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 58 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 58 6d 00 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 58 6d 6d 6d 6d 6d 6d 00 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 00 6d 00 58 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 6d 58 6d 6d 6d 6d 6d 6d 58 58 6d 6d 6d 6d 58 6d 6d 6d 6d 58 6d 6d 6d 6d 58 6d 00 6d 6d 6d 6d 6d 6d 6d 58 58 58 6d 6d 6d 58 6d 6d 6d 58 58 6d 6d 6d 6d 58 6d 58 6d 58 6d 6d 58 6d 6d 58 6d 6d 6d 6d 6d 58 6d 58 6d 58 6d 6d 6d 6d 6d 6d 58 6d 00 6d 00 6d 58 6d 58 6d 6d 6d 6d 58 58 6d 6d 6d 6d 58 6d 6d 6d 6d 58 6d 58 6d 6d 58 6d 6d
*/
| 32.169884 | 2,999 | 0.659025 |
daab67b044faef04f039775f58c478d5a00f4341 | 7,724 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1787.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1787.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_sm_/i9-9900K_12_0xca_notsx.log_21829_1787.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 %r9
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_UC_ht+0x17288, %rsi
xor %rdx, %rdx
mov (%rsi), %cx
nop
nop
nop
nop
nop
xor %rbp, %rbp
lea addresses_normal_ht+0x688, %rsi
lea addresses_A_ht+0xc30, %rdi
nop
nop
nop
nop
and $22175, %r14
mov $43, %rcx
rep movsq
nop
nop
nop
nop
and $10504, %rsi
lea addresses_WT_ht+0x6248, %rdi
nop
dec %r12
movw $0x6162, (%rdi)
nop
nop
nop
nop
nop
and $5379, %rsi
lea addresses_D_ht+0x1d3d8, %rsi
lea addresses_WT_ht+0x7778, %rdi
xor %r9, %r9
mov $116, %rcx
rep movsq
nop
nop
nop
and %r12, %r12
lea addresses_D_ht+0x288, %r9
xor %r14, %r14
movb $0x61, (%r9)
nop
cmp $15981, %r12
lea addresses_normal_ht+0xcc88, %rdi
cmp $40266, %r12
movb (%rdi), %r9b
nop
nop
cmp $27907, %r9
lea addresses_WT_ht+0xd298, %r12
clflush (%r12)
nop
sub $61370, %rdx
movups (%r12), %xmm1
vpextrq $0, %xmm1, %r9
inc %rsi
lea addresses_WC_ht+0x12088, %rdi
nop
add %rbp, %rbp
movb $0x61, (%rdi)
nop
add %rbp, %rbp
lea addresses_WT_ht+0x1a308, %rsi
lea addresses_WC_ht+0xa138, %rdi
nop
nop
nop
lfence
mov $103, %rcx
rep movsw
nop
xor $53658, %rdx
lea addresses_WC_ht+0x9708, %rdx
nop
nop
nop
sub $31691, %rcx
mov $0x6162636465666768, %rdi
movq %rdi, (%rdx)
nop
nop
nop
nop
and $17613, %rsi
lea addresses_WT_ht+0x166c8, %r9
nop
nop
nop
nop
nop
inc %rcx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm3
and $0xffffffffffffffc0, %r9
movntdq %xmm3, (%r9)
nop
nop
and $39144, %r12
lea addresses_D_ht+0xea27, %r12
nop
nop
nop
nop
cmp $38910, %rdx
mov $0x6162636465666768, %r14
movq %r14, %xmm5
movups %xmm5, (%r12)
nop
nop
nop
nop
nop
cmp $13946, %rcx
lea addresses_normal_ht+0x12608, %r12
nop
nop
nop
nop
nop
cmp %rdx, %rdx
mov (%r12), %rdi
nop
nop
sub $43430, %rcx
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %r9
pop %r14
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r15
push %rbx
push %rcx
push %rdi
push %rdx
// Store
lea addresses_A+0x9288, %rdi
nop
nop
nop
sub %r14, %r14
mov $0x5152535455565758, %rdx
movq %rdx, %xmm7
movups %xmm7, (%rdi)
nop
nop
nop
and %rdx, %rdx
// Store
lea addresses_WC+0x10f88, %r15
nop
nop
nop
nop
nop
add $5191, %rcx
movb $0x51, (%r15)
nop
nop
nop
nop
xor %rdi, %rdi
// Faulty Load
lea addresses_A+0x9288, %rdx
nop
add $33249, %r10
movb (%rdx), %r15b
lea oracles, %r10
and $0xff, %r15
shlq $12, %r15
mov (%r10,%r15,1), %r15
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r15
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 32, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_A', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 2, 'congruent': 11}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_A_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WT_ht', 'NT': True, 'AVXalign': False, 'size': 2, 'congruent': 3}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 2, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 2, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 2}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 8}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 4, 'type': 'addresses_WT_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_WC_ht'}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'same': True, 'type': 'addresses_WT_ht', 'NT': True, 'AVXalign': False, 'size': 16, 'congruent': 5}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7}}
{'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
*/
| 33.437229 | 2,999 | 0.656007 |
f47b0381c61fb3400009b9a6d330f07d93b5f494 | 3,467 | asm | Assembly | dino/lcs/base/742.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 6 | 2020-10-14T15:29:10.000Z | 2022-02-12T18:58:54.000Z | dino/lcs/base/742.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | null | null | null | dino/lcs/base/742.asm | zengfr/arcade_game_romhacking_sourcecode_top_secret_data | a4a0c86c200241494b3f1834cd0aef8dc02f7683 | [
"Apache-2.0"
] | 1 | 2020-12-17T08:59:10.000Z | 2020-12-17T08:59:10.000Z | copyright zengfr site:http://github.com/zengfr/romhack
00042A move.l D1, (A0)+
00042C dbra D0, $42a
004D20 move.l D0, (A4)+
004D22 move.l D0, (A4)+
020402 clr.l ($740,A5)
020406 clr.l ($744,A5) [base+740, base+742]
0209EA clr.w ($6,A6) [base+741]
0209EE move.b ($c,A4), ($4b,A6) [base+742]
020BF6 move.b ($6,A6), D0
020BFA move.w ($6,PC,D0.w), D0 [base+742]
020C0C addq.b #2, ($6,A6)
020C10 move.b #$1, ($78,A6) [base+742]
020C44 addq.b #2, ($6,A6)
020C48 jsr $a5ea.l [base+742]
020CAC addq.b #2, ($6,A6)
020CB0 jsr $12be4.l [base+742]
020CC0 addq.b #2, ($6,A6)
020CC4 jsr $162ae.l [base+742]
020CF8 clr.b ($6,A6) [base+792, base+794]
020CFC rts
020D00 move.b ($6,A6), D0
020D04 move.w ($6,PC,D0.w), D0 [base+742]
020D14 addq.b #2, ($6,A6)
020D18 move.b #$1, ($78,A6) [base+742]
020D34 addq.b #2, ($6,A6)
020D38 rts [base+742]
020D74 addq.b #2, ($6,A6)
020D78 jsr $12be4.l [base+742]
020D9A clr.b ($6,A6) [base+792, base+794]
020D9E jmp $892c.l
020DA8 move.b ($6,A6), D0
020DAC move.w ($6,PC,D0.w), D0 [base+742]
020DBA addq.b #2, ($6,A6)
020DBE move.b #$2, ($78,A6) [base+742]
020E78 tst.b ($6,A6)
020E7C bne $20e92 [base+742]
020E7E addq.b #2, ($6,A6)
020E82 clr.b ($6d,A6) [base+742]
021086 tst.b ($6,A6)
02108A bne $210b2 [base+742]
02108C addq.b #2, ($6,A6)
021090 clr.b ($6d,A6) [base+742]
0210D2 clr.b ($6,A6) [base+741]
0210D6 clr.b ($78,A6) [base+742]
02255C clr.w ($6,A6)
022560 move.b ($c,A4), ($4b,A6)
022920 addq.b #2, ($6,A6)
022924 move.b #$2, ($78,A6) [base+742]
022A6A move.b ($6,A6), D0
022A6E move.w ($c,PC,D0.w), D0 [base+742]
022A82 addq.b #2, ($6,A6)
022A86 cmpi.b #$2, ($518,A5) [base+742]
022AF4 clr.b ($6,A6) [base+741]
022AF8 rts
0AAACA move.l (A0), D2
0AAACC move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAACE move.w D0, ($2,A0)
0AAAD2 cmp.l (A0), D0
0AAAD4 bne $aaafc
0AAAD8 move.l D2, (A0)+
0AAADA cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAE6 move.l (A0), D2
0AAAE8 move.w D0, (A0) [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
0AAAF4 move.l D2, (A0)+
0AAAF6 cmpa.l A0, A1 [123p+11A, 123p+11C, 123p+11E, 123p+120, 123p+122, 123p+124, 123p+126, 123p+128, 123p+12A, enemy+BC, enemy+C0, enemy+C2, enemy+C4, enemy+CC, enemy+CE, enemy+D0, enemy+D2, enemy+D4, enemy+D6, enemy+D8, enemy+DA, enemy+DE, item+86, item+88, item+8A, item+98, item+9A, item+9C, item+9E, item+A0, item+A2, item+A4, item+A6, scr1]
copyright zengfr site:http://github.com/zengfr/romhack
| 49.528571 | 350 | 0.621286 |
65dc9c1a00915badb2daf3fda8a5071cce37d802 | 132 | asm | Assembly | libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sccz80/tshr_cls.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 38 | 2021-06-18T12:56:15.000Z | 2022-03-12T20:38:40.000Z | libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sccz80/tshr_cls.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 2 | 2021-06-20T16:28:12.000Z | 2021-11-17T21:33:56.000Z | libsrc/_DEVELOPMENT/arch/ts2068/misc/c/sccz80/tshr_cls.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 6 | 2021-06-18T18:18:36.000Z | 2021-12-22T08:01:32.000Z | ; void tshr_cls(uchar ink)
SECTION code_clib
SECTION code_arch
PUBLIC tshr_cls
EXTERN asm_tshr_cls
defc tshr_cls = asm_tshr_cls
| 12 | 28 | 0.818182 |
0c36ae101ece658cafa7a3a738843f7db72935aa | 42,854 | asm | Assembly | snake/main.asm | greenstatic/snake-embedded | 54717b621387d8335ca5294b8604ef690529a3c2 | [
"MIT"
] | null | null | null | snake/main.asm | greenstatic/snake-embedded | 54717b621387d8335ca5294b8604ef690529a3c2 | [
"MIT"
] | null | null | null | snake/main.asm | greenstatic/snake-embedded | 54717b621387d8335ca5294b8604ef690529a3c2 | [
"MIT"
] | null | null | null | .include "m128def.inc"
#define DISPLAY_NO_CHARACTERS_PER_LINE 16
#define DISPLAY_NO_LINES 2
#define GAME_DISPLAY_LINES 4
#define GAME_DISPLAY_RAM_SIZE (DISPLAY_NO_CHARACTERS_PER_LINE * GAME_DISPLAY_LINES)
#define DISPLAY_RAM_SIZE (DISPLAY_NO_CHARACTERS_PER_LINE * DISPLAY_NO_LINES)
#define SPRITE_EMPTY 0
#define SPRITE_BODY 1
#define SPRITE_HEAD 2
#define SPRITE_DROP 3
#define DISPLAY_CHAR_BODY_TOP 0x00
#define DISPLAY_CHAR_BODY_BOTTOM 0x01
#define DISPLAY_CHAR_BODY_BOTH 0x02
#define DISPLAY_CHAR_HEAD_TOP 0x03
#define DISPLAY_CHAR_HEAD_BOTTOM 0x04
#define DISPLAY_CHAR_HEAD_TOP_BODY_BOTTOM 0x05
#define DISPLAY_CHAR_BODY_TOP_HEAD_BOTTOM 0x06
#define DISPLAY_CHAR_EMPTY 0x20
#define DISPLAY_CHAR_DROP 0x2A
#define DISPLAY_CHAR_UNKNOWN 0x21
#define SNAKE_POS_MAX_LENGTH 64
#define SNAKE_POS_INIT_X 7
#define SNAKE_POS_INIT_Y 1
#define DIRECTION_RIGHT 0
#define DIRECTION_DOWN 1
#define DIRECTION_LEFT 2
#define DIRECTION_UP 3
#define DIRECTION_PREVIOUS 4
#define JOYSTICK_THRESHOLD_DELTA 30 ; how sensative the controls are
; Parameters for Lehmer random number generator
#define RNG_SEED 1
#define RNG_M 31
#define RNG_A 3
#define COLLISION_NO 0
#define COLLISION_DROP 1
#define COLLISION_SELF 2
#define TRUE 1
#define FALSE 0
; We treat these register values as 'variables' with local scope, therefore
; we assume when we call a subroutine they will be pushed/popped by the subroutine
.def TEMP = R18
.def TEMP2 = R19
.def TEMP3 = R20
.DSEG
GAME_DISPLAY_RAM: .byte GAME_DISPLAY_RAM_SIZE
DISPLAY_RAM: .byte DISPLAY_RAM_SIZE
POINTS: .byte 1
DIRECTION: .byte 1
JOYSTICK_BUFFER: .byte 1
DROP_COORDINATES: .byte 2 * 2 ; two drops with x,y
SNAKE_POS_SIZE: .byte 1
SNAKE_POS: .byte (SNAKE_POS_MAX_LENGTH + 1) * 2; we store X,Y for one position
; +1 to add a buffer when we add the new
; head and remove the last element
TEMP_8_BYTE: .byte 8
RNG_NUMBER: .byte 1
TEMP_64_byte: .byte 64 + 1 ; first byte should have written the size of the array
.CSEG
START:
; Initilize the stack pointer
ldi TEMP, LOW(RAMEND)
out SPL, TEMP
ldi TEMP, HIGH(RAMEND)
out SPH, TEMP
MAIN:
rcall DISPLAY_INIT
rcall SPRITE_INIT
rcall GAME_DISPLAY_RAM_RESET
rcall DISPLAY_RAM_RESET
rcall DISPLAY_SYNC_LED_INIT
rcall RNG_INIT
;rcall SPRITE_DEBUG_DISPLAY
rcall GAME_INIT
rcall JOYSTICK_INIT
; Pre-render the game as part of initialization
rcall GAME_SNAKE_POSITION_MAP_GAME_DISPLAY_RAM
rcall GAME_DISPLAY_RAM_MAP_DISPLAY_RAM
rcall DROP_NEXT
rcall DROP_RENDER
; End pre-render
; Main game loop
MAIN_GAME_LOOP:
rcall JOYSTICK_READ
rcall MOVE_DIRECTION_VALID
rcall GAME_TICK
rcall GAME_SNAKE_POSITION_MAP_GAME_DISPLAY_RAM
rcall DROP_RENDER
rcall GAME_DISPLAY_RAM_MAP_DISPLAY_RAM
rcall DISPLAY_SYNC
rcall DISPLAY_SYNC_LED_BLINK
; 50 ms delay
ldi r24, 50
rcall delay_nms
rjmp MAIN_GAME_LOOP
; Blocks until the button is pressed
BUTTON_PRESS_WAIT:
; GPIO E0
BUTTON_PRESS_WAIT__LOOP:
in r24, PINE
andi r24, 0x01
cpi r24, 0
breq BUTTON_PRESS_WAIT__LOOP_END
rjmp BUTTON_PRESS_WAIT__LOOP
BUTTON_PRESS_WAIT__LOOP_END:
; Minor 200ms delay
ldi r24, 200
rcall DELAY_Nms
ret
; Renders the game over screen, showing the number of points
; and waits for the user to press conitnue to restart the game.
; Only jump into this subroutine, DO NOT CALL IT (rcall). Even
; though we restart the game by jumping to START (therefore
; initializing the stack from the beginning), it is more
; clear what is happening in the code.
GAME_OVER_SCREEN:
rcall GAME_OVER_SCREEN_DISPLAY_PRINT
rcall BUTTON_PRESS_WAIT
rjmp START ; restart game
; Sends to the display the text for the game over screen.
GAME_OVER_SCREEN_DISPLAY_PRINT:
rcall DISPLAY_CLEAR
; First line
ldi r24, 0x82
rcall DISPLAY_SEND_COMMAND
ldi r24, 'G'
rcall DISPLAY_SEND_CHARACTER
ldi r24, 'A'
rcall DISPLAY_SEND_CHARACTER
ldi r24, 'M'
rcall DISPLAY_SEND_CHARACTER
ldi r24, 'E'
rcall DISPLAY_SEND_CHARACTER
ldi r24, ' '
rcall DISPLAY_SEND_CHARACTER
ldi r24, 'O'
rcall DISPLAY_SEND_CHARACTER
ldi r24, 'V'
rcall DISPLAY_SEND_CHARACTER
ldi r24, 'E'
rcall DISPLAY_SEND_CHARACTER
ldi r24, 'R'
rcall DISPLAY_SEND_CHARACTER
ldi r24, ' '
rcall DISPLAY_SEND_CHARACTER
ldi r24, '='
rcall DISPLAY_SEND_CHARACTER
ldi r24, '('
rcall DISPLAY_SEND_CHARACTER
; Second line
ldi r24, 0xC2
rcall DISPLAY_SEND_COMMAND
ldi r24, 'P'
rcall DISPLAY_SEND_CHARACTER
ldi r24, 'O'
rcall DISPLAY_SEND_CHARACTER
ldi r24, 'I'
rcall DISPLAY_SEND_CHARACTER
ldi r24, 'N'
rcall DISPLAY_SEND_CHARACTER
ldi r24, 'T'
rcall DISPLAY_SEND_CHARACTER
ldi r24, 'S'
rcall DISPLAY_SEND_CHARACTER
ldi r24, ':'
rcall DISPLAY_SEND_CHARACTER
ldi r24, ' '
rcall DISPLAY_SEND_CHARACTER
lds r24, POINTS
rcall DISPLAY_SEND_DECIMAL
ret
; Call when the snake has collided with a drop. Increases the points and spawns
; a new drop.
; r24: Input Snake head X coordinate
; r25: Input Snake head Y coordinate
SNAKE_COLLIDED_WITH_DROP:
push TEMP
push TEMP2
push TEMP3
mov TEMP2, r24
mov TEMP3, r25
; Increment points by one
lds r24, POINTS
inc r24
sts POINTS, r24
; Add's the drops position to the snakes position stack
; Get stack size
lds TEMP, SNAKE_POS_SIZE
; Set pointer to top most element
ldi XH, high(SNAKE_POS)
ldi XL, low(SNAKE_POS)
; XH | XL + r24 | TEMP
ldi r24, 0
add XL, TEMP
adc XH, r24
; Create a new element on the top with the coordinates of
; the drop
st x+, TEMP2
st x+, TEMP3
; Increment stack size
lds TEMP, SNAKE_POS_SIZE
inc TEMP
inc TEMP
sts SNAKE_POS_SIZE, TEMP
rcall DROP_NEXT
pop TEMP3
pop TEMP2
pop TEMP
ret
; Checks if the snake has collided with anything.
; r24: Input register with snake head X coordinate (game display coordinate)
; r25: Input register with snake head Y coordinate (game display coordinate)
;
; r25: Return register value with collision, if any (COLLISION_NO, COLLISION_DROP, COLLISION_SELF).
SNAKE_COLLISION_DETECTION:
push TEMP
push TEMP2
mov TEMP, r24
mov TEMP2, r25
; Check if collision with self
SNAKE_COLLISION__CHECK_SELF:
mov r24, TEMP
mov r25, TEMP2
rcall SNAKE_POS_CONTAINS
cpi r25, TRUE
brne SNAKE_COLLISION__CHECK_DROP_1
; Collision with self detected
ldi r25, COLLISION_SELF
rjmp SNAKE_COLLISION__END
SNAKE_COLLISION__CHECK_DROP_1:
; Check if drop collision (upper part)
lds r24, DROP_COORDINATES
lds r25, DROP_COORDINATES + 1
cp TEMP, r24
brne SNAKE_COLLISION__CHECK_DROP_2
cp TEMP2, r25
brne SNAKE_COLLISION__CHECK_DROP_2
; Drop collision
ldi r25, COLLISION_DROP
rjmp SNAKE_COLLISION__END
; Check if drop collision (bottom part)
SNAKE_COLLISION__CHECK_DROP_2:
lds r24, DROP_COORDINATES + 2
lds r25, DROP_COORDINATES + 3
cp TEMP, r24
brne SNAKE_COLLISION__NO_COLLISION
cp TEMP2, r25
brne SNAKE_COLLISION__NO_COLLISION
; Drop collision
ldi r25, COLLISION_DROP
rjmp SNAKE_COLLISION__END
; No collision
SNAKE_COLLISION__NO_COLLISION:
ldi r25, COLLISION_NO
SNAKE_COLLISION__END:
pop TEMP2
pop TEMP
ret
; Renders drops to the game display RAM
DROP_RENDER:
lds r24, DROP_COORDINATES
lds r25, DROP_COORDINATES + 1
ldi r23, SPRITE_DROP
rcall GAME_DISPLAY_WRITE_XY
lds r24, DROP_COORDINATES + 2
lds r25, DROP_COORDINATES + 3
ldi r23, SPRITE_DROP
rcall GAME_DISPLAY_WRITE_XY
ret
; Places the drop with respect to the game state (position of the snake)
DROP_NEXT:
push TEMP
ldi XH, high(TEMP_64_byte)
ldi XL, low(TEMP_64_byte)
rcall SNAKE_POS_FREE_COORDINATES
ldi XH, high(TEMP_64_byte)
ldi XL, low(TEMP_64_byte)
ld TEMP, X+ ; Number of free characters (possible placements of drop)
; X now points to the array
rcall RNG_NEXT
mov r24, r25
mov r25, TEMP
rcall MOD
; r24 now contains the offset of the array which points to the display RAM offset
; where the drop is going to be
; XH | XL + r25 | r24
ldi r25, 0
add XL, r24
adc XH, r25
ld TEMP, X ; The offset of display RAM where the drop is going to be
; Assume we have only two lines on our display
cpi TEMP, DISPLAY_NO_CHARACTERS_PER_LINE
brlo DROP_COORDINATES_UPDATE__TRANSFORM_DISPLAY_OFFSET_FIRST_LINE
; Second character line
subi TEMP, DISPLAY_NO_CHARACTERS_PER_LINE
sts DROP_COORDINATES, TEMP
ldi r24, 2
sts DROP_COORDINATES + 1, r24
sts DROP_COORDINATES + 2, TEMP
ldi r24, 3
sts DROP_COORDINATES + 3, r24
rjmp DROP_COORDINATES_UPDATE__TRANSFORM_DISPLAY_OFFSET_END
DROP_COORDINATES_UPDATE__TRANSFORM_DISPLAY_OFFSET_FIRST_LINE:
; First character line
sts DROP_COORDINATES, TEMP
ldi r24, 0
sts DROP_COORDINATES + 1, r24
sts DROP_COORDINATES + 2, TEMP
ldi r24, 1
sts DROP_COORDINATES + 3, r24
DROP_COORDINATES_UPDATE__TRANSFORM_DISPLAY_OFFSET_END:
pop TEMP
ret
; Saves into memory the offsets of the character display RAM which are free (empty)
; in the game world.
; X: Base pointer to block of memory where we can write the empty character offsets
SNAKE_POS_FREE_COORDINATES:
push TEMP
push TEMP2
push XH
push XL
adiw X, 1 ; first element is for the size which we will write in the end
ldi YH, high(DISPLAY_RAM)
ldi YL, low(DISPLAY_RAM)
ldi TEMP2, 0 ; size counter of empty chars
ldi TEMP, 0
SNAKE_POS_FREE_COORDINATES__LOOP:
cpi TEMP, DISPLAY_RAM_SIZE
breq SNAKE_POS_FREE_COORDINATES__LOOP_END
ld r24, Y+
cpi r24, DISPLAY_CHAR_EMPTY
brne SNAKE_POS_FREE_COORDINATES__LOOP_CONTINUE
; write the offset into memory where the empty char is in display RAM
st X+, TEMP
inc TEMP2
SNAKE_POS_FREE_COORDINATES__LOOP_CONTINUE:
inc TEMP
rjmp SNAKE_POS_FREE_COORDINATES__LOOP
SNAKE_POS_FREE_COORDINATES__LOOP_END:
; Write the size of the array
pop XL
pop XH
st X, TEMP2
pop TEMP2
pop TEMP
ret
; Initialize the pseudo random number generator.
RNG_INIT:
ldi r24, RNG_SEED
sts RNG_NUMBER, r24
ret
; Returns the next random number from the pseudo random number generator.
; We use a very primitive Lehmer random number generator with a period of
; 30. We subtract from the original answer 1 in order to get numbers [0,29]
; r25: Return register for the random number
RNG_NEXT:
push TEMP
push TEMP2
lds TEMP, RNG_NUMBER
mov TEMP2, TEMP
ldi r24, RNG_A
mul r24, TEMP2
; 3 * 30 = 90 can be the max product, the lower byte is all we need
mov r24, r0
ldi r25, RNG_M
rcall MOD
sts RNG_NUMBER, r24
; Return the "previous" value and subtract one
mov r25, TEMP
subi r25, 1
pop TEMP2
pop TEMP
ret
; Take a 8-bit unsigned number and convert it into ASCII decimal, then
; send it to the display. Make sure the cursor is set where you wish the
; first digit to appear and that there is enough room to print the entire number
; (3 characters since 8-bits can be max 2^8 = 255 DEC, three digits).
;
; r24: Input register value to display as a deciaml number on the display
DISPLAY_SEND_DECIMAL:
push TEMP
ldi XH, high(TEMP_8_BYTE)
ldi XL, low(TEMP_8_BYTE)
rcall BIN_2_ASCII_DEC
ldi XH, high(TEMP_8_BYTE)
ldi XL, low(TEMP_8_BYTE)
ldi TEMP, 8
DISPLAY_SEND_DECIMAL__LOOP:
cpi TEMP, 0
breq DISPLAY_SEND_DECIMAL__LOOP_END
ld r24, X+
cpi r24, 0
breq DISPLAY_SEND_DECIMAL__LOOP_SKIP
rcall DISPLAY_SEND_CHARACTER
DISPLAY_SEND_DECIMAL__LOOP_SKIP:
dec TEMP
rjmp DISPLAY_SEND_DECIMAL__LOOP
DISPLAY_SEND_DECIMAL__LOOP_END:
pop TEMP
ret
; Convert a 8-bit register value into an ASCII decimal number stored in memory.
; r24: Input register unsigned number
; X: Base pointer to memory space where we will save the decimal number (1 byte = 1 DEC digit)
BIN_2_ASCII_DEC:
push TEMP
push TEMP2
; Add 8 to base pointer since we will decrement it in the loop below
; XH | XL + TEMP2 | TEMP
ldi TEMP, 8
ldi TEMP2, 0
add XL, TEMP
adc XH, TEMP2
; Check if input is 0
cpi r24, 0
brne BIN_2_ASCII_DEC__LOOP_INIT
ldi TEMP, 0x30
add r24, TEMP
st -X, r24
rjmp BIN_2_ASCII_DEC__LOOP_END
; Input is not equal to 0
BIN_2_ASCII_DEC__LOOP_INIT:
mov TEMP2, r24
BIN_2_ASCII_DEC__LOOP:
cpi TEMP, 0
breq BIN_2_ASCII_DEC__LOOP_END
cpi TEMP2, 0
brne BIN_2_ASCII_DEC__LOOP_1
ldi r24, 0
st -X, r24
rjmp BIN_2_ASCII_DEC__LOOP_2
BIN_2_ASCII_DEC__LOOP_1:
mov r24, TEMP2
ldi r25, 10
rcall MOD
ldi r25, 0x30 ; ASCII digit section
add r24, r25
st -X, r24
mov r24, TEMP2
ldi r25, 10
rcall DIV
mov TEMP2, r24
BIN_2_ASCII_DEC__LOOP_2:
dec TEMP
rjmp BIN_2_ASCII_DEC__LOOP
BIN_2_ASCII_DEC__LOOP_END:
pop TEMP2
pop TEMP
ret
; Take the modulo (remainder) of two 8-bit unsigned numbers
; r24: Input dividend register with unsigned number
; r25: Input divisor register with unsigned number
;
; r24: Return register with remainder
;
; If divisor is 0, undefined behaviour.
MOD:
rcall DIV
mov r24, r25
ret
; Divide two 8-bit unsigned numbers
; r24: Input dividend register with unsigned number
; r25: Input divisor register with unsigned number
;
; r24: Return register with quotient
; r25: Return register with remainder
;
; If divisor is 0, undefined behaviour.
DIV:
push TEMP
ldi TEMP, 0 ; quotient
; Cannot divide by 0, if we do, simply end the subroutine
cpi r25, 0
breq DIV__LOOP_END
DIV__LOOP:
cp r24, r25
brlo DIV__LOOP_END ; r24 < r25
sub r24, r25
inc TEMP
rjmp DIV__LOOP
DIV__LOOP_END:
mov r25, r24 ; remainder
mov r24, TEMP
pop TEMP
ret
; Checks the players desired direction from the JOYSTICK_BUFFER
; and verifies it is a valid movement for the current state, if
; it is update the DIRECTION memory value.
MOVE_DIRECTION_VALID:
push TEMP
push TEMP2
push TEMP3
lds TEMP, JOYSTICK_BUFFER
rcall SNAKE_HEAD_POS
mov r23, TEMP
rcall SNAKE_POS_TRANSFORM
mov TEMP2, r24 ; new X coordinate if joystick buffer direction is applied
mov TEMP3, r25 ; new Y coordinate if joystick buffer direction is applied
; Check if the second element (after head) in the snake position stack contains
; the new X/Y coordinates, if it does ignore the joystick buffer direction
lds r24, SNAKE_POS_SIZE
cpi r24, 2 + 1
brlo MOVE_DIRECTION_VALID__UPDATE_DIRECTION ; only head is in the stack, skip this check
ldi XH, HIGH(SNAKE_POS)
ldi XL, LOW(SNAKE_POS)
subi r24, 2 + 4 ; since offset is at 0 not 1 (the 2), then to get the third last element
; in the array (the 4)
; XH | XL + r25 | r24
ldi r25, 0
add XL, r24
adc XH, r25
ld r24, X+
ld r25, X+
cp r24, TEMP2
brne MOVE_DIRECTION_VALID__SECOND_CHECK
cp r25, TEMP3
brne MOVE_DIRECTION_VALID__SECOND_CHECK
; Second element in position stack is equal to the new head coordinates.
; This is an invalid move, ignore joystick buffer direction.
rjmp MOVE_DIRECTION_VALID__END
; We check the third element (from the top), since if the user picks up a
; drop and moves 'incorrectly' our checking of just the second element is
; not enough.
MOVE_DIRECTION_VALID__SECOND_CHECK:
ld r24, X+
ld r25, X+
cp r24, TEMP2
brne MOVE_DIRECTION_VALID__UPDATE_DIRECTION
cp r25, TEMP3
brne MOVE_DIRECTION_VALID__UPDATE_DIRECTION
; third element in position stack is equal to the new head coordinates.
; This is an invalid move, ignore joystick buffer direction.
rjmp MOVE_DIRECTION_VALID__END
; Update the direction from the joystick buffer if buffer is not set
; to DIRECTION_PREVIOUS
MOVE_DIRECTION_VALID__UPDATE_DIRECTION:
cpi TEMP, DIRECTION_PREVIOUS
breq MOVE_DIRECTION_VALID__END
sts DIRECTION, TEMP
MOVE_DIRECTION_VALID__END:
pop TEMP3
pop TEMP2
pop TEMP
ret
; Initialize the Joystick by turning on the ADC and configuring the switch.
; Joystick should be connected to PF0 (x), PF1 (y), PE0 (sw).
JOYSTICK_INIT:
push TEMP
; Set the port for the switch GPIO E0 as an input pin
in TEMP, DDRE
andi TEMP, 0xFE
out DDRE, TEMP
; Enable pull-up resistor for GPIO E0
in TEMP, PORTE
ori TEMP, 0x01
out PORTE, TEMP
; Setup the port for X/Y axis potenciometer
ldi TEMP, 0x00
sts DDRF, TEMP
; Disable pull-up resistors for X/Y axis potenciometer
ldi TEMP, 0x00
sts PORTF, TEMP
; Enable ADC for X/Y axis potenciometer
ldi TEMP, 0b1000_0111
out ADCSRA, TEMP
; Enable ADC Left Adjust Result
ldi TEMP, 0b0010_0000
out ADMUX, TEMP
pop TEMP
ret
; Read the values of the joystick and write the snake direction
; in the JOYSTICK_BUFFER.
JOYSTICK_READ:
push TEMP
push TEMP2
push TEMP3
rcall JOYSTICK_ADC_READ
mov TEMP2, r24 ; X-axis
mov TEMP3, r25 ; Y-axis
; X-axis
; 0 <= TEMP2 <= JOYSTICK_THRESHOLD_DELTA -> DIRECTION_LEFT
; 255 - JOYSTICK_THRESHOLD_DELTA <= TEMP2 <= 255 -> DIRECTION_RIGHT
JOYSTICK_READ__X_LEFT:
cpi TEMP2, JOYSTICK_THRESHOLD_DELTA + 1
brsh JOYSTICK_READ__X_RIGHT
ldi TEMP, DIRECTION_LEFT
sts JOYSTICK_BUFFER, TEMP
rjmp JOYSTICK_READ__END
JOYSTICK_READ__X_RIGHT:
cpi TEMP2, 255 - JOYSTICK_THRESHOLD_DELTA
brlo JOYSTICK_READ__Y_UP
ldi TEMP, DIRECTION_RIGHT
sts JOYSTICK_BUFFER, TEMP
rjmp JOYSTICK_READ__END
; Y-axis
; 0 <= TEMP3 <= JOYSTICK_THRESHOLD_DELTA -> DIRECTION_UP
; 255 - JOYSTICK_THRESHOLD_DELTA <= TEMP3 <= 255 -> DIRECTION_DOWN
JOYSTICK_READ__Y_UP:
cpi TEMP3, JOYSTICK_THRESHOLD_DELTA + 1
brsh JOYSTICK_READ__Y_DOWN
ldi TEMP, DIRECTION_UP
sts JOYSTICK_BUFFER, TEMP
rjmp JOYSTICK_READ__END
JOYSTICK_READ__Y_DOWN:
cpi TEMP3, 255 - JOYSTICK_THRESHOLD_DELTA
brlo JOYSTICK_READ__KEEP_DIRECTION
ldi TEMP, DIRECTION_DOWN
sts JOYSTICK_BUFFER, TEMP
rjmp JOYSTICK_READ__END
; Keep the previous direction
JOYSTICK_READ__KEEP_DIRECTION:
ldi TEMP, DIRECTION_PREVIOUS
sts JOYSTICK_BUFFER, TEMP
JOYSTICK_READ__END:
pop TEMP3
pop TEMP2
pop TEMP
ret
; Reads the ADC values of the joystick with 8-bit precision.
; r24: Return value of joystick X-axis (0-255)
; r25: Return value of joystick Y-axis (0-255)
JOYSTICK_ADC_READ:
push TEMP
; Read value for X-axis
; Select ADC00 (X-axis)
; Enable ADLAR (Left adjusted), meaning we cut off the last
; two bits of the ADCH | ADCL 10-bit value (which is the equivalent
; of dividing by 2^2=4).
in TEMP, ADMUX
andi TEMP, 0xF8 ; remove the first 3 LSB (MUX) selector
ori TEMP, 0x00
out ADMUX, TEMP
; Start conversion
in TEMP, ADCSRA
sbr TEMP, 0x40
out ADCSRA, TEMP
; Wait until the conversion is done
JOYSTICK_ADC_READ__LOOP_X:
in TEMP, ADCSRA
sbrc TEMP, 6
rjmp JOYSTICK_ADC_READ__LOOP_X
in r24, ADCH
; Read value for Y-axis
; Select ADC01 (Y-axis) and enable ADLAR (see above why)
in TEMP, ADMUX
andi TEMP, 0xF8 ; remove the first 3 LSB (MUX) selector
ori TEMP, 0x01
out ADMUX, TEMP
; Start conversion
in TEMP, ADCSRA
sbr TEMP, 0x40
out ADCSRA, TEMP
; Wait until the conversion is done
JOYSTICK_ADC_READ__LOOP_Y:
in TEMP, ADCSRA
sbrc TEMP, 6
rjmp JOYSTICK_ADC_READ__LOOP_Y
in r25, ADCH
pop TEMP
ret
; Clears the display
DISPLAY_CLEAR:
ldi r24, 0x1
rcall DISPLAY_SEND_COMMAND
ret
; Initialize the game
GAME_INIT:
; Add to the snake position stack the initial
; snake position
ldi TEMP, SNAKE_POS_INIT_X
sts SNAKE_POS, TEMP
ldi TEMP, SNAKE_POS_INIT_Y
sts SNAKE_POS + 1, TEMP
; Initialize the snake position stack size
ldi TEMP, 2
sts SNAKE_POS_SIZE, TEMP
; Initialize the number of points the user has
ldi TEMP, 0
sts POINTS, TEMP
; Initialize the direction
ldi TEMP, DIRECTION_RIGHT
sts DIRECTION, TEMP
; Initialize the joystick buffer
ldi TEMP, DIRECTION_PREVIOUS
sts JOYSTICK_BUFFER, TEMP
ret
; Perform one game tick
GAME_TICK:
push TEMP
push TEMP2
rcall SNAKE_HEAD_POS
mov TEMP, r24 ; old x-coordinate
mov TEMP2, r25 ; old y-coordinate
push XH ; Pointer to next stack element (empty)
push XL
lds r23, DIRECTION
rcall SNAKE_POS_TRANSFORM
mov TEMP, r24 ; new x-coordinate
mov TEMP2, r25 ; new y-coordinate
; Check if snake hit obstacle
rcall SNAKE_COLLISION_DETECTION
cpi r25, COLLISION_DROP
brne GAME_TICK__CHECK_COLLISION_SELF
; Increment the X register by 2
pop XL
pop XH
; XH | XL + r24 | r25
ldi r24, 0
ldi r25, 2
add XL, r25
adc XH, r24
push XH
push XL
mov r24, TEMP ; restore the new x/y coordinates
mov r25, TEMP2
rcall SNAKE_COLLIDED_WITH_DROP
rjmp GAME_TICK__COLLISION_DONE
GAME_TICK__CHECK_COLLISION_SELF:
cpi r25, COLLISION_SELF
brne GAME_TICK__COLLISION_DONE
; Collision with self
rjmp GAME_OVER_SCREEN
; Should not be reachable when jumping to GAME_OVER_SCREEN
rjmp GAME_TICK__COLLISION_DONE
GAME_TICK__COLLISION_DONE:
pop XL
pop XH
; Push new head postion to snake position stack and increment the stack size counter
st X+, TEMP
st X+, TEMP2
lds TEMP, SNAKE_POS_SIZE
inc TEMP
inc TEMP
sts SNAKE_POS_SIZE, TEMP
; Remove the first element (the lowest element) in the snake position stack
ldi XH, high(SNAKE_POS)
ldi XL, low(SNAKE_POS)
ldi YH, high(SNAKE_POS + 2) ; Y points to the next stack element (2 because we have x,y as 1 'element')
ldi YL, low(SNAKE_POS + 2)
GAME_TICK__LOOP:
cpi TEMP, 0
breq GAME_TICK__LOOP_END
ld TEMP2, Y+ ; next X coordinate
ld TEMP3, Y+ ; next Y coordinate
st X+, TEMP2
st X+, TEMP3
dec TEMP ; two dec because of x,y
dec TEMP
rjmp GAME_TICK__LOOP
GAME_TICK__LOOP_END:
; Decrement stack size by 2
lds TEMP, SNAKE_POS_SIZE
dec TEMP
dec TEMP
sts SNAKE_POS_SIZE, TEMP
; End of removal of first snake position stack element
pop TEMP2
pop TEMP
ret
; Checks to see if the provided X/Y coordinate is a part
; of the snake position stack (if it is a member of the stack)
; r24: Input x coordinate
; r25: Input y coordinate
;
; r25: Return value TRUE if match otherwise FALSE
SNAKE_POS_CONTAINS:
push TEMP
push TEMP2
push TEMP3
mov TEMP2, r24 ; x coordinate
mov TEMP3, r25 ; y coordinate
ldi XH, HIGH(SNAKE_POS)
ldi XL, LOW(SNAKE_POS)
lds TEMP, SNAKE_POS_SIZE
SNAKE_POS_CONTAINS__LOOP:
cpi TEMP, 0
breq SNAKE_POS_CONTAINS__LOOP_END
ld r24, X+
ld r25, X+
cp r24, TEMP2
brne SNAKE_POS_CONTAINS__LOOP_CONTINUE
cp r25, TEMP3
brne SNAKE_POS_CONTAINS__LOOP_CONTINUE
; Found match
ldi r25, TRUE
rjmp SNAKE_POS_CONTAINS__END
SNAKE_POS_CONTAINS__LOOP_CONTINUE:
dec TEMP
dec TEMP
rjmp SNAKE_POS_CONTAINS__LOOP
SNAKE_POS_CONTAINS__LOOP_END:
; No match
ldi r25, FALSE
SNAKE_POS_CONTAINS__END:
pop TEMP3
pop TEMP2
pop TEMP
ret
; Gets the snakes head position in r24,r25 (x,y)
; r24: Return value X coordinate
; r25: Return value Y coordinate
SNAKE_HEAD_POS:
push TEMP
push TEMP2
; Get the head of the snake position stack
ldi XH, high(SNAKE_POS)
ldi XL, low(SNAKE_POS)
lds TEMP, SNAKE_POS_SIZE
subi TEMP, 2 ; SIZE - 2 (offset of the head of the stack)
ldi XH, high(SNAKE_POS)
ldi XL, low(SNAKE_POS)
; XH | XL + TEMP2 | TEMP
ldi TEMP2, 0
add XL, TEMP
adc XH, TEMP2
ld r24, X+ ; X coordinate
ld r25, X+ ; Y coordinate
pop TEMP2
pop TEMP
ret
; Transforms the position of a block of snake
; in relation to the direction
; r24: X coordinate
; r25: Y coordinate
; r23: direction (DIRECTION_RIGHT, DIRECTION_DOWN, etc.)
;
; Return's the transofmred X,Y coordinates
; r24: Return value X coordinate
; r25: Return value Y coordinate
SNAKE_POS_TRANSFORM:
push TEMP
cpi r23, DIRECTION_RIGHT
breq SNAKE_POS_TRANSFORM__DIRECTION_RIGHT
cpi r23, DIRECTION_DOWN
breq SNAKE_POS_TRANSFORM__DIRECTION_DOWN
cpi r23, DIRECTION_LEFT
breq SNAKE_POS_TRANSFORM__DIRECTION_LEFT
cpi r23, DIRECTION_UP
breq SNAKE_POS_TRANSFORM__DIRECTION_UP
; Unknown direction
rjmp SNAKE_POS_TRANSFORM__DONE
; Transform direction: Right
SNAKE_POS_TRANSFORM__DIRECTION_RIGHT:
ldi TEMP, 1
add r24, TEMP
; r24 < DISPLAY_NO_CHARACTERS_PER_LINE ? r24 : 0
cpi r24, DISPLAY_NO_CHARACTERS_PER_LINE
brlo SNAKE_POS_TRANSFORM__DIRECTION_RIGHT_
ldi r24, 0
SNAKE_POS_TRANSFORM__DIRECTION_RIGHT_:
rjmp SNAKE_POS_TRANSFORM__DONE
; Transform direction: Down
SNAKE_POS_TRANSFORM__DIRECTION_DOWN:
ldi TEMP, 1
add r25, TEMP
; r25 < GAME_DISPLAY_LINES ? r25 : 0
cpi r25, GAME_DISPLAY_LINES
brlo SNAKE_POS_TRANSFORM__DIRECTION_DOWN_
ldi r25, 0
SNAKE_POS_TRANSFORM__DIRECTION_DOWN_:
rjmp SNAKE_POS_TRANSFORM__DONE
; Transform direction: Left
SNAKE_POS_TRANSFORM__DIRECTION_LEFT:
ldi TEMP, 1
sub r24, TEMP
; r24 >= 0 ? r24 : (DISPLAY_NO_CHARACTERS_PER_LINE - 1)
cpi r24, 0
brge SNAKE_POS_TRANSFORM__DIRECTION_LEFT_
ldi r24, (DISPLAY_NO_CHARACTERS_PER_LINE - 1)
SNAKE_POS_TRANSFORM__DIRECTION_LEFT_:
rjmp SNAKE_POS_TRANSFORM__DONE
; Transform direction: Up
SNAKE_POS_TRANSFORM__DIRECTION_UP:
ldi TEMP, 1
sub r25, TEMP
; r25 >= 0 ? r25 : (GAME_DISPLAY_LINES - 1)
brge SNAKE_POS_TRANSFORM__DIRECTION_UP_
ldi r25, GAME_DISPLAY_LINES - 1
SNAKE_POS_TRANSFORM__DIRECTION_UP_:
rjmp SNAKE_POS_TRANSFORM__DONE
SNAKE_POS_TRANSFORM__DONE:
pop TEMP
ret
; Maps the Snakes position stack to the game's display RAM
GAME_SNAKE_POSITION_MAP_GAME_DISPLAY_RAM:
rcall GAME_DISPLAY_RAM_RESET
ldi XH, high(SNAKE_POS)
ldi XL, low(SNAKE_POS)
lds TEMP, SNAKE_POS_SIZE
lsr TEMP ; divide by two since we pop two elements (x,y)
GAME_SNAKE_POSITION_MAP_GAME_DISPLAY_RAM_LOOP:
cpi TEMP, 0
breq GAME_SNAKE_POSITION_MAP_GAME_DISPLAY_RAM_LOOP_END
ld r24, X+ ; X coordinate
ld r25, X+ ; Y coordinate
; If we are on the head of stack, then select SPRITE_HEAD
; otherwise SPRITE_BODY
ldi r23, SPRITE_BODY
cpi TEMP, 1
brne GAME_SNAKE_POSITION_MAP_GAME_DISPLAY_RAM_LOOP_1
ldi r23, SPRITE_HEAD
GAME_SNAKE_POSITION_MAP_GAME_DISPLAY_RAM_LOOP_1:
rcall GAME_DISPLAY_WRITE_XY
dec TEMP
rjmp GAME_SNAKE_POSITION_MAP_GAME_DISPLAY_RAM_LOOP
GAME_SNAKE_POSITION_MAP_GAME_DISPLAY_RAM_LOOP_END:
ret
; Write to the game display RAM using X,Y coordinates
;
; Point = X,Y
;
; |-------- ... -----|
; |0,0|1,0| ... |15,0|
; |0,1| | ... | |
; |0,2| | ... | |
; |0,3| | ... |15,3|
; |-------- ... -----|
;
; r24: X
; r25: Y
; r23: DATA to write
GAME_DISPLAY_WRITE_XY:
push TEMP
push TEMP2
push XH
push XL
; (GAME_DISPLAY_RAM + DISPLAY_NO_CHARACTERS_PER_LINE * Y + X)
ldi XH, high(GAME_DISPLAY_RAM)
ldi XL, low(GAME_DISPLAY_RAM)
; TEMP = DISPLAY_NO_CHARACTERS_PER_LINE * Y
ldi TEMP, DISPLAY_NO_CHARACTERS_PER_LINE
mul TEMP, r25
mov TEMP, r0
; XH | XL + TEMP2 (0) | TEMP
ldi TEMP2, 0
add XL, TEMP
adc XH, TEMP2
; XH | XL + TEMP2 (0) | X
ldi TEMP2, 0
add XL, r24
adc XH, TEMP2
st X, r23
pop XL
pop XH
pop TEMP2
pop TEMP
ret
; Maps the game display character into the display character font necessary
; to render the character to the display.
; r24: top game display character
; r25: bottom game display character
;
; r25: return value (display character)
; |-------|
; | Top |
; | Char |
; |-------|
; | Bottom|
; | Char |
; |-------|
;
GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER:
; t = Top character
; b = Bottom character
; t = Empty & b = Empty => 'Empty'
cpi r24, SPRITE_EMPTY
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_1
cpi r25, SPRITE_EMPTY
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_1
ldi r25, DISPLAY_CHAR_EMPTY
rjmp GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_RETURN
GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_1:
; t = Empty & b = Body => 'Body bottom'
cpi r24, SPRITE_EMPTY
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_2
cpi r25, SPRITE_BODY
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_2
ldi r25, DISPLAY_CHAR_BODY_BOTTOM
rjmp GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_RETURN
GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_2:
; t = Body & b = Empty => 'Body top'
cpi r24, SPRITE_BODY
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_3
cpi r25, SPRITE_EMPTY
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_3
ldi r25, DISPLAY_CHAR_BODY_TOP
rjmp GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_RETURN
GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_3:
; t = Empty & b = Head => 'Head bottom'
cpi r24, SPRITE_EMPTY
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_4
cpi r25, SPRITE_HEAD
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_4
ldi r25, DISPLAY_CHAR_HEAD_BOTTOM
rjmp GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_RETURN
GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_4:
; t = Head & b = Empty => 'Head top'
cpi r24, SPRITE_HEAD
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_5
cpi r25, SPRITE_EMPTY
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_5
ldi r25, DISPLAY_CHAR_HEAD_TOP
rjmp GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_RETURN
GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_5:
; t = Body & b = Body => 'Body both'
cpi r24, SPRITE_BODY
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_6
cpi r25, SPRITE_BODY
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_6
ldi r25, DISPLAY_CHAR_BODY_BOTH
rjmp GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_RETURN
GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_6:
; t = Body & b = Head => 'Body top, head bottom'
cpi r24, SPRITE_BODY
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_7
cpi r25, SPRITE_HEAD
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_7
ldi r25, DISPLAY_CHAR_BODY_TOP_HEAD_BOTTOM
rjmp GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_RETURN
GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_7:
; t = Head & b = Body => 'Head top, body bottom'
cpi r24, SPRITE_HEAD
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_8
cpi r25, SPRITE_BODY
brne GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_8
ldi r25, DISPLAY_CHAR_HEAD_TOP_BODY_BOTTOM
rjmp GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_RETURN
GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_8:
; t = Drop or b = Drop => 'Drop'
cpi r24, SPRITE_DROP
breq GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_8_
cpi r25, SPRITE_DROP
breq GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_8_
rjmp GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_UNKNOWN
GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_8_:
ldi r25, DISPLAY_CHAR_DROP
rjmp GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_RETURN
GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_UNKNOWN:
; SOMETHING ELSE??!?! Return the 'unknown' character
ldi r25, DISPLAY_CHAR_UNKNOWN
GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER_RETURN:
ret
; Maps the game display ram to the display ram, accounting for the display's
; limitations (i.e. 1 display line is 2 game display lines).
GAME_DISPLAY_RAM_MAP_DISPLAY_RAM:
ldi XH, high(GAME_DISPLAY_RAM)
ldi XL, low(GAME_DISPLAY_RAM)
ldi YH, high(GAME_DISPLAY_RAM + DISPLAY_NO_CHARACTERS_PER_LINE)
ldi YL, low(GAME_DISPLAY_RAM + DISPLAY_NO_CHARACTERS_PER_LINE)
ldi ZH, high(DISPLAY_RAM)
ldi ZL, low(DISPLAY_RAM)
; LOOP
ldi TEMP, DISPLAY_NO_CHARACTERS_PER_LINE
ldi TEMP2, 0 ; line number 0 = 1st line, 1 = 2nd line
GAME_DISPLAY_RAM_MAP_DISPLAY_RAM_LOOP:
cpi TEMP, 0
breq GAME_DISPLAY_RAM_MAP_DISPLAY_RAM_LOOP_END
ld r24, X+
ld r25, Y+
rcall GAME_DISPLAY_CHARACTER_MAP_DISPLAY_CHARACTER
st Z+, r25
dec TEMP
rjmp GAME_DISPLAY_RAM_MAP_DISPLAY_RAM_LOOP
GAME_DISPLAY_RAM_MAP_DISPLAY_RAM_LOOP_END:
cpi TEMP2, 1
breq GAME_DISPLAY_RAM_MAP_DISPLAY_RAM_RETURN
inc TEMP2
ldi TEMP, DISPLAY_NO_CHARACTERS_PER_LINE
ldi XH, high(GAME_DISPLAY_RAM + DISPLAY_NO_CHARACTERS_PER_LINE * 2)
ldi XL, low(GAME_DISPLAY_RAM + DISPLAY_NO_CHARACTERS_PER_LINE * 2)
ldi YH, high(GAME_DISPLAY_RAM + DISPLAY_NO_CHARACTERS_PER_LINE * 3)
ldi YL, low(GAME_DISPLAY_RAM + DISPLAY_NO_CHARACTERS_PER_LINE * 3)
ldi ZH, high(DISPLAY_RAM + DISPLAY_NO_CHARACTERS_PER_LINE)
ldi ZL, low(DISPLAY_RAM + DISPLAY_NO_CHARACTERS_PER_LINE)
rjmp GAME_DISPLAY_RAM_MAP_DISPLAY_RAM_LOOP
GAME_DISPLAY_RAM_MAP_DISPLAY_RAM_RETURN:
ret
; Display sync status LED, Pin A0
DISPLAY_SYNC_LED_INIT:
ldi TEMP, 0x01
out DDRA, TEMP
ret
DISPLAY_SYNC_LED_BLINK:
ldi TEMP, 0x01
out PORTA, TEMP
ldi r24, 200
rcall DELAY_Nms
ldi TEMP, 0x00
out PORTA, TEMP
ldi r24, 200
rcall DELAY_Nms
ret
GAME_DISPLAY_RAM_RESET:
ldi TEMP, SPRITE_EMPTY
ldi XH, high(GAME_DISPLAY_RAM)
ldi XL, low(GAME_DISPLAY_RAM)
ldi TEMP2, GAME_DISPLAY_RAM_SIZE
GAME_DISPLAY_RAM_RESET_LOOP:
cpi TEMP2, 0
breq GAME_DISPLAY_RAM_RESET_LOOP_END
st X+, TEMP
;inc XL
dec TEMP2
rjmp GAME_DISPLAY_RAM_RESET_LOOP
GAME_DISPLAY_RAM_RESET_LOOP_END:
ret
; Resets the area of memory where the DISPLAY_RAM is with ' ' characters.
DISPLAY_RAM_RESET:
ldi TEMP, ' '
ldi XH, high(DISPLAY_RAM)
ldi XL, low(DISPLAY_RAM)
ldi TEMP2, DISPLAY_RAM_SIZE
DISPLAY_RAM_RESET_LOOP:
cpi TEMP2, 0
breq DISPLAY_RAM_RESET_LOOP_END
st X+, TEMP
;inc XL
dec TEMP2
rjmp DISPLAY_RAM_RESET_LOOP
DISPLAY_RAM_RESET_LOOP_END:
ret
; Writes the contents of DISPLAY_RAM to the display.
DISPLAY_SYNC:
; Move cursor to beginning of the first line
ldi r24, 0x80
rcall DISPLAY_SEND_COMMAND
ldi XH, high(DISPLAY_RAM)
ldi XL, low(DISPLAY_RAM)
ldi TEMP, DISPLAY_NO_CHARACTERS_PER_LINE
DISPLAY_SYNC_LOOP_1:
cpi TEMP, 0
breq DISPLAY_SYNC_LOOP_1_END
ld r24, X+
rcall DISPLAY_SEND_CHARACTER
dec TEMP
rjmp DISPLAY_SYNC_LOOP_1
DISPLAY_SYNC_LOOP_1_END:
; Move cursor to the beginning of the second line
ldi r24, 0xC0
rcall DISPLAY_SEND_COMMAND
ldi TEMP, DISPLAY_NO_CHARACTERS_PER_LINE
DISPLAY_SYNC_LOOP_2:
cpi TEMP, 0
breq DISPLAY_SYNC_LOOP_2_END
ld r24, X+
rcall DISPLAY_SEND_CHARACTER
dec TEMP
rjmp DISPLAY_SYNC_LOOP_2
DISPLAY_SYNC_LOOP_2_END:
ret
; Initialize the game sprites in the HD4470 display. The display needs to be
; first initialized (rcall DISPLAY_INIT).
SPRITE_INIT:
; The game sprites, each byte represents one pixel row
; 8 bytes make up a single 'character' which we will
; display on the display by storing it into the CGRAM
BODY_TOP_PIXEL_ROW:
.db 0x0E, 0x1F, 0x1F, 0x0E, 0, 0, 0, 0
BODY_BOTTOM_PIXEL_ROW:
.db 0, 0, 0, 0, 0x0E, 0x1F, 0x1F, 0x0E
BODY_BOTH_PIXEL_ROW:
.db 0x0E, 0x1F, 0x1F, 0x0E, 0x0E, 0x1F, 0x1F, 0x0E
HEAD_TOP_PIXEL_ROW:
.db 0x0E, 0x11, 0x11, 0x0E, 0, 0, 0, 0
HEAD_BOTTOM_PIXEL_ROW:
.db 0, 0, 0, 0, 0x0E, 0x11, 0x11, 0x0E
HEAD_TOP_BODY_BOTTOM_PIXEL_ROW:
.db 0x0E, 0x11, 0x11, 0x0E, 0x0E, 0x1F, 0x1F, 0x0E
HEAD_BOTTOM_BODY_TOP_PIXEL_ROW:
.db 0x0E, 0x1F, 0x1F, 0x0E, 0x0E, 0x11, 0x11, 0x0E
; Create the sprites in the display's RAM
ldi ZH, high(BODY_TOP_PIXEL_ROW * 2)
ldi ZL, low(BODY_TOP_PIXEL_ROW * 2)
ldi r24, DISPLAY_CHAR_BODY_TOP
rcall SPRITE_CREATE
ldi ZH, high(BODY_BOTTOM_PIXEL_ROW * 2)
ldi ZL, low(BODY_BOTTOM_PIXEL_ROW * 2)
ldi r24, DISPLAY_CHAR_BODY_BOTTOM
rcall SPRITE_CREATE
ldi ZH, high(BODY_BOTH_PIXEL_ROW * 2)
ldi ZL, low(BODY_BOTH_PIXEL_ROW * 2)
ldi r24, DISPLAY_CHAR_BODY_BOTH
rcall SPRITE_CREATE
ldi ZH, high(HEAD_TOP_PIXEL_ROW * 2)
ldi ZL, low(HEAD_TOP_PIXEL_ROW * 2)
ldi r24, DISPLAY_CHAR_HEAD_TOP
rcall SPRITE_CREATE
ldi ZH, high(HEAD_BOTTOM_PIXEL_ROW * 2)
ldi ZL, low(HEAD_BOTTOM_PIXEL_ROW * 2)
ldi r24, DISPLAY_CHAR_HEAD_BOTTOM
rcall SPRITE_CREATE
ldi ZH, high(HEAD_TOP_BODY_BOTTOM_PIXEL_ROW * 2)
ldi ZL, low(HEAD_TOP_BODY_BOTTOM_PIXEL_ROW * 2)
ldi r24, DISPLAY_CHAR_HEAD_TOP_BODY_BOTTOM
rcall SPRITE_CREATE
ldi ZH, high(HEAD_BOTTOM_BODY_TOP_PIXEL_ROW * 2)
ldi ZL, low(HEAD_BOTTOM_BODY_TOP_PIXEL_ROW * 2)
ldi r24, DISPLAY_CHAR_BODY_TOP_HEAD_BOTTOM
rcall SPRITE_CREATE
; Go to beginning of display (exit CGRAM mode)
ldi r24, 0x80
rcall DISPLAY_SEND_COMMAND
ret
; Outputs to the display all the sprites we have created prefixed and suffixed with '|'.
SPRITE_DEBUG_DISPLAY:
; Seperator
ldi r24, '|'
rcall DISPLAY_SEND_CHARACTER
ldi r24, DISPLAY_CHAR_BODY_TOP
rcall DISPLAY_SEND_CHARACTER
ldi r24, DISPLAY_CHAR_BODY_BOTTOM
rcall DISPLAY_SEND_CHARACTER
ldi r24, DISPLAY_CHAR_BODY_BOTH
rcall DISPLAY_SEND_CHARACTER
ldi r24, DISPLAY_CHAR_HEAD_TOP
rcall DISPLAY_SEND_CHARACTER
ldi r24, DISPLAY_CHAR_HEAD_BOTTOM
rcall DISPLAY_SEND_CHARACTER
ldi r24, DISPLAY_CHAR_HEAD_TOP_BODY_BOTTOM
rcall DISPLAY_SEND_CHARACTER
ldi r24, DISPLAY_CHAR_BODY_TOP_HEAD_BOTTOM
rcall DISPLAY_SEND_CHARACTER
ldi r24, DISPLAY_CHAR_EMPTY
rcall DISPLAY_SEND_CHARACTER
; Seperator
ldi r24, '|'
rcall DISPLAY_SEND_CHARACTER
ret
; Create a sprite in the display's RAM by creating a custom character pattern (CGRAM data)
; Z: Base pointer to 8 bytes of memory with the contents of the character pattern.
; Each byte represents a single pixel line
; r24: Character code (0-7)
SPRITE_CREATE:
lsl r24
lsl r24
lsl r24
ori r24, 0b0100_0000 ; CGRAM mode + CGRAM Address
rcall DISPLAY_SEND_COMMAND
lpm r24, Z+
rcall DISPLAY_SEND_CHARACTER
lpm r24, Z+
rcall DISPLAY_SEND_CHARACTER
lpm r24, Z+
rcall DISPLAY_SEND_CHARACTER
lpm r24, Z+
rcall DISPLAY_SEND_CHARACTER
lpm r24, Z+
rcall DISPLAY_SEND_CHARACTER
lpm r24, Z+
rcall DISPLAY_SEND_CHARACTER
lpm r24, Z+
rcall DISPLAY_SEND_CHARACTER
lpm r24, Z+ ; strickly speaking + not necessary here
rcall DISPLAY_SEND_CHARACTER
ret
; Initializes the Hitachi HD44780U display in 4-bit mode with the cursor and blinking turned on.
; Connect the following pins:
; GPIO_PORT_G_0 -> DISPLAY_DATA_4
; GPIO_PORT_G_1 -> DISPLAY_DATA_5
; GPIO_PORT_G_2 -> DISPLAY_DATA_6
; GPIO_PORT_G_3 -> DISPLAY_DATA_7
; GPIO_PORT_G_4 -> DISPLAY_RS
; GPIO_PORT_D_7 -> DISPLAY_EN
;
; Pin layout identical to ET-BASE AVR ATmega64/128 layout of PORT ET-CLCD.
; You can still use the remaining PORT_G and PORT_D pins not in use.
DISPLAY_INIT:
push TEMP
; GPIO D7: OUTPUT
ldi TEMP, 0b1000_0000
out DDRD, TEMP
; GPIO G0-4: OUTPUT
ldi TEMP, 0b0001_1111
sts DDRG, TEMP
; Delay 15 ms
ldi r24, 15
rcall DELAY_Nms
; We send 8-bit mode command three times because that is the official way how initialize the
; display according to the documentation (Hitachi HD44780U documentation pg. 26).
; Function set instruction: 8-bit mode command #1
ldi TEMP, 0b0000_0011
sts PORTG, TEMP
rcall DISPLAY_TOGGLE_EN
; Function set instruction: 8-bit mode command #2
ldi TEMP, 0b0000_0011
sts PORTG, TEMP
rcall DISPLAY_TOGGLE_EN
; Function set instruction: 8-bit mode command #3
ldi TEMP, 0b0000_0011
sts PORTG, TEMP
rcall DISPLAY_TOGGLE_EN
; Function set instruction: 4-bit mode command #1 (we are still operating in 8-bit mode)
ldi TEMP, 0b0000_0010
sts PORTG, TEMP
rcall DISPLAY_TOGGLE_EN
; Function set instruction: 4-bit mode command #2
; (we are now operating in 4-bit mode, so send it using our DISPLAY_SEND_COMMAND routine)
ldi r24, 0b0010_1100
rcall DISPLAY_SEND_COMMAND
; Display on/off control instruction - Turn display off
ldi r24, 0b0001_0000
rcall DISPLAY_SEND_COMMAND
; Clear display instruction - Clear display
ldi r24, 0b0000_0001
rcall DISPLAY_SEND_COMMAND
; Entry mode set instruction - Cursor move direction: increment and no display shift
ldi r24, 0b0000_0110
rcall DISPLAY_SEND_COMMAND
; Display on/off control instruction - Turn display on, cursor & blinking off
ldi r24, 0b0000_1100
rcall DISPLAY_SEND_COMMAND
pop TEMP
ret
; Toggles the display enable (EN) pin. We use this when sending stuff to the display
; so that it reads the data pins.
DISPLAY_TOGGLE_EN:
ldi TEMP, 0b1000_0000
out PORTD, TEMP
ldi r24, 1
rcall DELAY_Nms
ldi TEMP, 0b0000_0000
out PORTD, TEMP
ldi r24, 1
rcall DELAY_Nms
ret
; Send to display command. Set r24 with the command value.
DISPLAY_SEND_COMMAND:
ldi r25, 0x0
rcall DISPLAY_SEND
ret
; Send to display character. Set r24 with the character value.
DISPLAY_SEND_CHARACTER:
ldi r25, 0x1
rcall DISPLAY_SEND
ret
; Send to display command/data. Set r24 with the data and set r25 with 1 for data or 0 for command mode.
DISPLAY_SEND:
push TEMP
push TEMP2
push TEMP3
; r24 => | TEMP | TEMP2 | we split the byte into two nibbles
mov TEMP, r24
mov TEMP2, r24
lsr TEMP
lsr TEMP
lsr TEMP
lsr TEMP
andi TEMP2, 0x0F ; clear first nibble since we have it stored in TEMP
; Move value (which can be 0/1) to high nibble
lsl r25
lsl r25
lsl r25
lsl r25
or TEMP, r25 ; set Port G pin 4 to RS value
or TEMP2, r25 ; set Port G pin 4 to RS value
lds TEMP3, PORTG
andi TEMP3, 0xE0 ; get the previous non-display Port G pin values
or TEMP, TEMP3 ; combine the upper nibble with the previous non-display Port G pin values
or TEMP2, TEMP3 ; combine the lower nibble with the previous non-display Port G pin values
; Send high nibble
sts PORTG, TEMP
rcall DISPLAY_TOGGLE_EN
; Send low nibble
sts PORTG, TEMP2
rcall DISPLAY_TOGGLE_EN
pop TEMP3
pop TEMP2
pop TEMP
ret
; Delay for n milliseconds
; Clock frequency must be 16 Mhz.
; The parameter n must be:
; 1 <= n <= 255
;
; n is stored in r24. Load into r24 n before rcall-ing
; this routine.
;
; Formula to calculate cycles:
; IL = Inner loop constant = 15976
; Calculate by setting n=1 and using the debugger to count the cycles
; between DELAY_Nms_INNER and DELAY_Nms_INNER_END
;
; HEAD: 3 (RCALL) + 4 (2 * push) + 1 + 2 +
; FILLER 2 + (18+3)(n-1) +
; 1 (nop) + 1 (nop)
; LOOP n(IL + 3) - 1 +
; FOOTER 4 (2 * pop) + 4
;
DELAY_Nms:
push r19
push r20
mov r19, r24
rjmp DELAY_Nms_SKIP
DELAY_Nms_FILLER: ; | 18 OP
ldi r20, 5 ; |
DELAY_Nms_FILLER_JMP: ; |
dec r20 ; |
brne DELAY_Nms_FILLER_JMP ; |
nop ; |
nop ; |
nop ; |
DELAY_Nms_SKIP:
dec r19
brne DELAY_Nms_FILLER
nop
nop
DELAY_Nms_OUTER:
ldi r19, 21
ldi r20, 191
DELAY_Nms_INNER:
dec r20
brne DELAY_Nms_INNER
dec r19
brne DELAY_Nms_INNER
dec r24
brne DELAY_Nms_OUTER
DELAY_Nms_INNER_END:
pop r20
pop r19
ret
| 23.08944 | 105 | 0.733887 |
5267fb2170bf8dd35f63f92f64b8837f1a7d990f | 639 | asm | Assembly | oeis/007/A007667.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/007/A007667.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/007/A007667.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A007667: The sum of both two and three consecutive squares.
; Submitted by Jon Maiga
; 5,365,35645,3492725,342251285,33537133085,3286296790925,322023548377445,31555021444198565,3092070077983081805,302991312620897818205,29690056566770003102165,2909322552230839406193845,285083920062055491803894525,27935314843529207357375469485,2737375770745800265530992114885,268234890218244896814679851789125,26284281865617254087573094483219245,2575591387940272655685348579503696765,252381671736281103003076587696879063605,24730828238767607821645820245714644536405
seq $0,54320 ; Expansion of g.f.: (1 + x)/(1 - 10*x + x^2).
pow $0,2
mul $0,3
add $0,2
| 71 | 463 | 0.865415 |
4b9b19b5c816b40e59c2f2b94b9e3cc0b4ef1bca | 399 | a51 | Assembly | Lab_5/C_Task_3.a51 | DeeptimaanB/8051_Programs | d65b45d906caac16859129082431fa196ac4db56 | [
"BSD-3-Clause"
] | null | null | null | Lab_5/C_Task_3.a51 | DeeptimaanB/8051_Programs | d65b45d906caac16859129082431fa196ac4db56 | [
"BSD-3-Clause"
] | null | null | null | Lab_5/C_Task_3.a51 | DeeptimaanB/8051_Programs | d65b45d906caac16859129082431fa196ac4db56 | [
"BSD-3-Clause"
] | 1 | 2021-09-19T12:10:50.000Z | 2021-09-19T12:10:50.000Z | ;A switch is connected to port pin P0.1. Write an 8051 assembly language program to check the status
;of the switch and perform the following
;(i). If switch = 1 send a High to Low pulse to activate a siren connected to port pin P1.7
;(ii). Continue monitoring the pin status
ORG 0000H
MOV P0,#0FFH
MOV P1,#00H
BACK:MOV C,P0.1
JNC OFF
SETB P1.7
OFF:SJMP BACK
END ;Deeptimaan Banerjee
| 28.5 | 101 | 0.73183 |
f5c6a8836b916402bab072330fb1ce426990c6d1 | 614 | asm | Assembly | oeis/298/A298881.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/298/A298881.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/298/A298881.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A298881: a(0) = 0; for n>0, a(n) = 6*n!.
; 0,6,12,36,144,720,4320,30240,241920,2177280,21772800,239500800,2874009600,37362124800,523069747200,7846046208000,125536739328000,2134124568576000,38414242234368000,729870602452992000,14597412049059840000,306545653030256640000,6744004366665646080000,155112100433309859840000,3722690410399436636160000,93067260259985915904000000,2419748766759633813504000000,65333216702510112964608000000,1829330067670283163009024000000,53050571962438211727261696000000,1591517158873146351817850880000000
mov $2,$0
sub $0,1
mov $3,$0
lpb $3
mul $2,$3
sub $3,1
lpe
mov $0,$2
mul $0,6
| 47.230769 | 487 | 0.840391 |
a1ba1654defb09c75c2092e679711186ff2c21c8 | 2,301 | asm | Assembly | programs/oeis/211/A211622.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/211/A211622.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/211/A211622.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A211622: Number of ordered triples (w,x,y) with all terms in {-n,...-1,1,...,n} and w+2x+3y>1.
; 0,3,26,94,229,457,800,1284,1931,2767,3814,5098,6641,8469,10604,13072,15895,19099,22706,26742,31229,36193,41656,47644,54179,61287,68990,77314,86281,95917,106244,117288,129071,141619,154954,169102,184085,199929,216656,234292,252859,272383,292886,314394,336929,360517,385180,410944,437831,465867,495074,525478,557101,589969,624104,659532,696275,734359,773806,814642,856889,900573,945716,992344,1040479,1090147,1141370,1194174,1248581,1304617,1362304,1421668,1482731,1545519,1610054,1676362,1744465,1814389,1886156,1959792,2035319,2112763,2192146,2273494,2356829,2442177,2529560,2619004,2710531,2804167,2899934,2997858,3097961,3200269,3304804,3411592,3520655,3632019,3745706,3861742,3980149,4100953,4224176,4349844,4477979,4608607,4741750,4877434,5015681,5156517,5299964,5446048,5594791,5746219,5900354,6057222,6216845,6379249,6544456,6712492,6883379,7057143,7233806,7413394,7595929,7781437,7969940,8161464,8356031,8553667,8754394,8958238,9165221,9375369,9588704,9805252,10025035,10248079,10474406,10704042,10937009,11173333,11413036,11656144,11902679,12152667,12406130,12663094,12923581,13187617,13455224,13726428,14001251,14279719,14561854,14847682,15137225,15430509,15727556,16028392,16333039,16641523,16953866,17270094,17590229,17914297,18242320,18574324,18910331,19250367,19594454,19942618,20294881,20651269,21011804,21376512,21745415,22118539,22495906,22877542,23263469,23653713,24048296,24447244,24850579,25258327,25670510,26087154,26508281,26933917,27364084,27798808,28238111,28682019,29130554,29583742,30041605,30504169,30971456,31443492,31920299,32401903,32888326,33379594,33875729,34376757,34882700,35393584,35909431,36430267,36956114,37486998,38022941,38563969,39110104,39661372,40217795,40779399,41346206,41918242,42495529,43078093,43665956,44259144,44857679,45461587,46070890,46685614,47305781,47931417,48562544,49199188,49841371,50489119,51142454,51801402,52465985,53136229,53812156,54493792,55181159,55874283,56573186,57277894,57988429,58704817,59427080,60155244,60889331,61629367
mov $2,$0
mov $5,$0
mul $0,2
lpb $0,1
sub $0,1
mov $1,$0
mul $2,$0
sub $0,$0
add $2,1
lpe
mov $0,$2
mul $0,$1
mov $2,$0
div $2,2
mov $1,$2
mov $3,$5
mul $3,$5
mul $3,$5
mov $4,$3
mul $4,2
add $1,$4
| 92.04 | 1,994 | 0.827901 |
82666e58d77f7a691451ae09336497a13c2851f7 | 376 | asm | Assembly | programs/oeis/101/A101328.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/101/A101328.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/101/A101328.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A101328: Recurring numbers in the count of consecutive composite numbers between balanced primes and their lower or upper prime neighbors.
; 1,5,11,17,23,29,35,41,47,53,59,65,71,77,83,89,95,101,107,113,119,125,131,137,143,149,155,161,167,173,179,185,191,197,203,209,215,221,227,233,239,245,251,257,263,269,275,281,287,293,299,305,311,317,323,329
mul $0,6
trn $0,2
add $0,1
| 53.714286 | 206 | 0.74734 |
5c0c777de48e23817f923980ffc5c016ca2e360c | 10,810 | asm | Assembly | sources/ippcp/asm_ia32/pcpmd5w7as.asm | idesai/ipp-crypto | 67220e3042f23d423c7977cdfd8b4f54f3cba2e0 | [
"Apache-2.0"
] | 1 | 2020-11-03T21:30:58.000Z | 2020-11-03T21:30:58.000Z | sources/ippcp/asm_ia32/pcpmd5w7as.asm | idesai/ipp-crypto | 67220e3042f23d423c7977cdfd8b4f54f3cba2e0 | [
"Apache-2.0"
] | null | null | null | sources/ippcp/asm_ia32/pcpmd5w7as.asm | idesai/ipp-crypto | 67220e3042f23d423c7977cdfd8b4f54f3cba2e0 | [
"Apache-2.0"
] | null | null | null | ;===============================================================================
; Copyright 2014-2018 Intel Corporation
; All Rights Reserved.
;
; If this software was obtained under the Intel Simplified Software License,
; the following terms apply:
;
; The source code, information and material ("Material") contained herein is
; owned by Intel Corporation or its suppliers or licensors, and title to such
; Material remains with Intel Corporation or its suppliers or licensors. The
; Material contains proprietary information of Intel or its suppliers and
; licensors. The Material is protected by worldwide copyright laws and treaty
; provisions. No part of the Material may be used, copied, reproduced,
; modified, published, uploaded, posted, transmitted, distributed or disclosed
; in any way without Intel's prior express written permission. No license under
; any patent, copyright or other intellectual property rights in the Material
; is granted to or conferred upon you, either expressly, by implication,
; inducement, estoppel or otherwise. Any license under such intellectual
; property rights must be express and approved by Intel in writing.
;
; Unless otherwise agreed by Intel in writing, you may not remove or alter this
; notice or any other notice embedded in Materials by Intel or Intel's
; suppliers or licensors in any way.
;
;
; If this software was obtained under the Apache License, Version 2.0 (the
; "License"), the following terms apply:
;
; You may not use this file except in compliance with the License. You may
; obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
;
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
; WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;
; See the License for the specific language governing permissions and
; limitations under the License.
;===============================================================================
;
;
; Purpose: Cryptography Primitive.
; Message block processing according to MD5
; (derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm)
;
; Content:
; UpdateMD5
;
;
.686P
.XMM
.MODEL FLAT,C
INCLUDE asmdefs.inc
INCLUDE ia_emm.inc
INCLUDE pcpvariant.inc
IF (_ENABLE_ALG_MD5_)
IF _IPP GE _IPP_M5
;;
;; Magic functions defined in RFC 1321
;;
MAGIC_F MACRO F:REQ, X:REQ,Y:REQ,Z:REQ ;; ((Z) ^ ((X) & ((Y) ^ (Z))))
mov F,Z
xor F,Y
and F,X
xor F,Z
ENDM
MAGIC_G MACRO F:REQ, X:REQ,Y:REQ,Z:REQ ;; F((Z),(X),(Y))
MAGIC_F F,Z,X,Y
ENDM
MAGIC_H MACRO F:REQ, X:REQ,Y:REQ,Z:REQ ;; ((X) ^ (Y) ^ (Z))
mov F,Z
xor F,Y
xor F,X
ENDM
MAGIC_I MACRO F:REQ, X:REQ,Y:REQ,Z:REQ ;; ((Y) ^ ((X) | ~(Z)))
mov F,Z
not F
or F,X
xor F,Y
ENDM
;;
;; single MD5 step
;;
;; A = B +ROL32((A +MAGIC(B,C,D) +data +const), nrot)
;;
MD5_STEP MACRO MAGIC_FUN:REQ, A:REQ,B:REQ,C:REQ,D:REQ, FUN:REQ, data:REQ, MD5const:REQ, nrot:REQ
add A,MD5const
add A,[data]
MAGIC_FUN FUN, B,C,D
add A,FUN
rol A,nrot
add A,B
ENDM
MD5_RND MACRO MAGIC_FUN:REQ, A:REQ,B:REQ,C:REQ,D:REQ, FUN:REQ, MD5const:REQ, nrot:REQ, nextdata
MAGIC_FUN FUN, B,C,D
lea A,[A+ebp+MD5const]
ifnb <nextdata>
mov ebp,[nextdata]
endif
; MAGIC_FUN FUN, B,C,D
add A,FUN
rol A,nrot
add A,B
ENDM
IPPCODE SEGMENT 'CODE' ALIGN (IPP_ALIGN_FACTOR)
;*****************************************************************************************
;* Purpose: Update internal digest according to message block
;*
;* void UpdateMD5(DigestMD5digest, const Ipp32u* mblk, int mlen, const void* pParam)
;*
;*****************************************************************************************
;;
;; MD5 left rotations (number of bits)
;;
rot11 = 7
rot12 = 12
rot13 = 17
rot14 = 22
rot21 = 5
rot22 = 9
rot23 = 14
rot24 = 20
rot31 = 4
rot32 = 11
rot33 = 16
rot34 = 23
rot41 = 6
rot42 = 10
rot43 = 15
rot44 = 21
;;
;; Lib = W7
;;
;; Caller = ippsSHA1Update
;; Caller = ippsSHA1Final
;; Caller = ippsSHA1MessageDigest
;;
;; Caller = ippsHMACSHA1Update
;; Caller = ippsHMACSHA1Final
;; Caller = ippsHMACSHA1MessageDigest
;;
ALIGN IPP_ALIGN_FACTOR
IPPASM UpdateMD5 PROC NEAR C PUBLIC \
USES esi edi ebx ebp,\
digest: PTR DWORD,\ ; digest address
mblk: PTR BYTE,\ ; buffer address
mlen: DWORD,\ ; buffer length
pParam: PTR DWORD ; dummy parameter
MBS_MD5 equ (64)
mov eax, pParam ; due to bug in ml12 - dummy instruction
mov edi,digest ; digest address
mov esi,mblk ; source data address
mov eax,mlen ; data length
sub esp,2*sizeof(dword)
mov [esp+0*sizeof(dword)],edi ; save digest address
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; process next data block
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
md5_block_loop:
mov [esp+1*sizeof(dword)],eax ; save data length
mov ebp,[esi+ 0*4] ; preload data
;;
;; init A, B, C, D by the internal digest
;;
mov eax,[edi+0*4] ; eax = digest[0] (A)
mov ebx,[edi+1*4] ; ebx = digest[1] (B)
mov ecx,[edi+2*4] ; ecx = digest[2] (C)
mov edx,[edi+3*4] ; edx = digest[3] (D)
;;
;; perform 0-63 steps
;;
;; MAGIC A, B, C, D, FUN, cnt, nrot, pNextData (ebp)
;; ------------------------------------------------------------
MD5_RND MAGIC_F, eax,ebx,ecx,edx, edi, 0d76aa478h, rot11, <esi+ 1*4>
MD5_RND MAGIC_F, edx,eax,ebx,ecx, edi, 0e8c7b756h, rot12, <esi+ 2*4>
MD5_RND MAGIC_F, ecx,edx,eax,ebx, edi, 0242070dbh, rot13, <esi+ 3*4>
MD5_RND MAGIC_F, ebx,ecx,edx,eax, edi, 0c1bdceeeh, rot14, <esi+ 4*4>
MD5_RND MAGIC_F, eax,ebx,ecx,edx, edi, 0f57c0fafh, rot11, <esi+ 5*4>
MD5_RND MAGIC_F, edx,eax,ebx,ecx, edi, 04787c62ah, rot12, <esi+ 6*4>
MD5_RND MAGIC_F, ecx,edx,eax,ebx, edi, 0a8304613h, rot13, <esi+ 7*4>
MD5_RND MAGIC_F, ebx,ecx,edx,eax, edi, 0fd469501h, rot14, <esi+ 8*4>
MD5_RND MAGIC_F, eax,ebx,ecx,edx, edi, 0698098d8h, rot11, <esi+ 9*4>
MD5_RND MAGIC_F, edx,eax,ebx,ecx, edi, 08b44f7afh, rot12, <esi+10*4>
MD5_RND MAGIC_F, ecx,edx,eax,ebx, edi, 0ffff5bb1h, rot13, <esi+11*4>
MD5_RND MAGIC_F, ebx,ecx,edx,eax, edi, 0895cd7beh, rot14, <esi+12*4>
MD5_RND MAGIC_F, eax,ebx,ecx,edx, edi, 06b901122h, rot11, <esi+13*4>
MD5_RND MAGIC_F, edx,eax,ebx,ecx, edi, 0fd987193h, rot12, <esi+14*4>
MD5_RND MAGIC_F, ecx,edx,eax,ebx, edi, 0a679438eh, rot13, <esi+15*4>
MD5_RND MAGIC_F, ebx,ecx,edx,eax, edi, 049b40821h, rot14, <esi+ 1*4>
MD5_RND MAGIC_G, eax,ebx,ecx,edx, edi, 0f61e2562h, rot21, <esi+ 6*4>
MD5_RND MAGIC_G, edx,eax,ebx,ecx, edi, 0c040b340h, rot22, <esi+11*4>
MD5_RND MAGIC_G, ecx,edx,eax,ebx, edi, 0265e5a51h, rot23, <esi+ 0*4>
MD5_RND MAGIC_G, ebx,ecx,edx,eax, edi, 0e9b6c7aah, rot24, <esi+ 5*4>
MD5_RND MAGIC_G, eax,ebx,ecx,edx, edi, 0d62f105dh, rot21, <esi+10*4>
MD5_RND MAGIC_G, edx,eax,ebx,ecx, edi, 002441453h, rot22, <esi+15*4>
MD5_RND MAGIC_G, ecx,edx,eax,ebx, edi, 0d8a1e681h, rot23, <esi+ 4*4>
MD5_RND MAGIC_G, ebx,ecx,edx,eax, edi, 0e7d3fbc8h, rot24, <esi+ 9*4>
MD5_RND MAGIC_G, eax,ebx,ecx,edx, edi, 021e1cde6h, rot21, <esi+14*4>
MD5_RND MAGIC_G, edx,eax,ebx,ecx, edi, 0c33707d6h, rot22, <esi+ 3*4>
MD5_RND MAGIC_G, ecx,edx,eax,ebx, edi, 0f4d50d87h, rot23, <esi+ 8*4>
MD5_RND MAGIC_G, ebx,ecx,edx,eax, edi, 0455a14edh, rot24, <esi+13*4>
MD5_RND MAGIC_G, eax,ebx,ecx,edx, edi, 0a9e3e905h, rot21, <esi+ 2*4>
MD5_RND MAGIC_G, edx,eax,ebx,ecx, edi, 0fcefa3f8h, rot22, <esi+ 7*4>
MD5_RND MAGIC_G, ecx,edx,eax,ebx, edi, 0676f02d9h, rot23, <esi+12*4>
MD5_RND MAGIC_G, ebx,ecx,edx,eax, edi, 08d2a4c8ah, rot24, <esi+ 5*4>
MD5_RND MAGIC_H, eax,ebx,ecx,edx, edi, 0fffa3942h, rot31, <esi+ 8*4>
MD5_RND MAGIC_H, edx,eax,ebx,ecx, edi, 08771f681h, rot32, <esi+11*4>
MD5_RND MAGIC_H, ecx,edx,eax,ebx, edi, 06d9d6122h, rot33, <esi+14*4>
MD5_RND MAGIC_H, ebx,ecx,edx,eax, edi, 0fde5380ch, rot34, <esi+ 1*4>
MD5_RND MAGIC_H, eax,ebx,ecx,edx, edi, 0a4beea44h, rot31, <esi+ 4*4>
MD5_RND MAGIC_H, edx,eax,ebx,ecx, edi, 04bdecfa9h, rot32, <esi+ 7*4>
MD5_RND MAGIC_H, ecx,edx,eax,ebx, edi, 0f6bb4b60h, rot33, <esi+10*4>
MD5_RND MAGIC_H, ebx,ecx,edx,eax, edi, 0bebfbc70h, rot34, <esi+13*4>
MD5_RND MAGIC_H, eax,ebx,ecx,edx, edi, 0289b7ec6h, rot31, <esi+ 0*4>
MD5_RND MAGIC_H, edx,eax,ebx,ecx, edi, 0eaa127fah, rot32, <esi+ 3*4>
MD5_RND MAGIC_H, ecx,edx,eax,ebx, edi, 0d4ef3085h, rot33, <esi+ 6*4>
MD5_RND MAGIC_H, ebx,ecx,edx,eax, edi, 004881d05h, rot34, <esi+ 9*4>
MD5_RND MAGIC_H, eax,ebx,ecx,edx, edi, 0d9d4d039h, rot31, <esi+12*4>
MD5_RND MAGIC_H, edx,eax,ebx,ecx, edi, 0e6db99e5h, rot32, <esi+15*4>
MD5_RND MAGIC_H, ecx,edx,eax,ebx, edi, 01fa27cf8h, rot33, <esi+ 2*4>
MD5_RND MAGIC_H, ebx,ecx,edx,eax, edi, 0c4ac5665h, rot34, <esi+ 0*4>
MD5_RND MAGIC_I, eax,ebx,ecx,edx, edi, 0f4292244h, rot41, <esi+ 7*4>
MD5_RND MAGIC_I, edx,eax,ebx,ecx, edi, 0432aff97h, rot42, <esi+14*4>
MD5_RND MAGIC_I, ecx,edx,eax,ebx, edi, 0ab9423a7h, rot43, <esi+ 5*4>
MD5_RND MAGIC_I, ebx,ecx,edx,eax, edi, 0fc93a039h, rot44, <esi+12*4>
MD5_RND MAGIC_I, eax,ebx,ecx,edx, edi, 0655b59c3h, rot41, <esi+ 3*4>
MD5_RND MAGIC_I, edx,eax,ebx,ecx, edi, 08f0ccc92h, rot42, <esi+10*4>
MD5_RND MAGIC_I, ecx,edx,eax,ebx, edi, 0ffeff47dh, rot43, <esi+ 1*4>
MD5_RND MAGIC_I, ebx,ecx,edx,eax, edi, 085845dd1h, rot44, <esi+ 8*4>
MD5_RND MAGIC_I, eax,ebx,ecx,edx, edi, 06fa87e4fh, rot41, <esi+15*4>
MD5_RND MAGIC_I, edx,eax,ebx,ecx, edi, 0fe2ce6e0h, rot42, <esi+ 6*4>
MD5_RND MAGIC_I, ecx,edx,eax,ebx, edi, 0a3014314h, rot43, <esi+13*4>
MD5_RND MAGIC_I, ebx,ecx,edx,eax, edi, 04e0811a1h, rot44, <esi+ 4*4>
MD5_RND MAGIC_I, eax,ebx,ecx,edx, edi, 0f7537e82h, rot41, <esi+11*4>
MD5_RND MAGIC_I, edx,eax,ebx,ecx, edi, 0bd3af235h, rot42, <esi+ 2*4>
MD5_RND MAGIC_I, ecx,edx,eax,ebx, edi, 02ad7d2bbh, rot43, <esi+ 9*4>
MD5_RND MAGIC_I, ebx,ecx,edx,eax, edi, 0eb86d391h, rot44, <esp>
;;
;; update digest
;;
add [ebp+0*4],eax ; advance digest
mov eax, dword ptr[esp+1*sizeof(dword)]
add [ebp+1*4],ebx
add [ebp+2*4],ecx
add [ebp+3*4],edx
mov edi, ebp ; restore hash address
add esi, MBS_MD5
sub eax, MBS_MD5
jg md5_block_loop
add esp,2*sizeof(dword)
ret
IPPASM UpdateMD5 ENDP
ENDIF
ENDIF
END
| 37.147766 | 96 | 0.620167 |
e7b1ef564436377883d482e4902695702f012fdc | 602 | asm | Assembly | libsrc/gfx/portable/commoncircle.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/gfx/portable/commoncircle.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/gfx/portable/commoncircle.asm | Frodevan/z88dk | f27af9fe840ff995c63c80a73673ba7ee33fffac | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_graphics
PUBLIC commoncircle
EXTERN _circledraw
; Common line drawing entry point
;
;void *(int x, int y, int radius, int skip) __smallc
;Note ints are actually uint8_t
;Entry: hl = draw function
commoncircle:
push hl ;Function pointer
ld hl,sp+4 ; &skip
ld e,(hl)
inc hl
ld d,(hl)
inc hl
push de
ld e,(hl) ;radius
inc hl
ld d,(hl)
inc hl
push de
ld e,(hl) ;y
inc hl
ld d,(hl)
inc hl
push de
ld e,(hl) ;x
inc hl
ld d,(hl)
push de
call _circledraw
IF __CPU_GBZ80__
add sp,10
ELSE
ld hl,10
add hl,sp
ld sp,hl
ENDIF
ret
| 13.377778 | 53 | 0.634551 |
6d02c8950a321544904151f0fbc769f826ffc0f9 | 6,123 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0x84_notsx.log_21829_2691.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_2691.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_2691.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 %rbx
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_D_ht+0x17298, %rbx
nop
nop
nop
nop
dec %r12
mov $0x6162636465666768, %r13
movq %r13, %xmm7
and $0xffffffffffffffc0, %rbx
vmovntdq %ymm7, (%rbx)
nop
nop
cmp %rdx, %rdx
lea addresses_A_ht+0x138e8, %rsi
lea addresses_A_ht+0x16c2c, %rdi
nop
nop
cmp $61610, %rbx
mov $77, %rcx
rep movsb
nop
nop
nop
nop
nop
dec %rdi
lea addresses_WT_ht+0x1edd8, %rsi
nop
nop
nop
nop
xor $64415, %rcx
mov $0x6162636465666768, %rdi
movq %rdi, %xmm2
vmovups %ymm2, (%rsi)
nop
nop
nop
nop
nop
cmp %rcx, %rcx
lea addresses_normal_ht+0x15f98, %rsi
lea addresses_normal_ht+0x14098, %rdi
nop
nop
nop
nop
cmp $11617, %r10
mov $21, %rcx
rep movsw
nop
dec %r12
lea addresses_WC_ht+0x17318, %r12
nop
nop
and $24732, %rdx
vmovups (%r12), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %rsi
nop
nop
nop
and %rsi, %rsi
lea addresses_D_ht+0x5918, %rsi
lea addresses_WT_ht+0x12298, %rdi
cmp %rbx, %rbx
mov $28, %rcx
rep movsw
nop
nop
nop
nop
nop
inc %rcx
lea addresses_A_ht+0xfc90, %rbx
clflush (%rbx)
nop
nop
cmp $1065, %r12
movl $0x61626364, (%rbx)
nop
nop
nop
nop
nop
xor %rbx, %rbx
lea addresses_UC_ht+0x9458, %rsi
lea addresses_normal_ht+0x1ee98, %rdi
add %r13, %r13
mov $120, %rcx
rep movsb
nop
and $49475, %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbx
pop %r13
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r13
push %r14
push %r15
push %r8
push %r9
// Faulty Load
lea addresses_WT+0x18e98, %r14
nop
xor %r9, %r9
mov (%r14), %r15w
lea oracles, %r9
and $0xff, %r15
shlq $12, %r15
mov (%r9,%r15,1), %r15
pop %r9
pop %r8
pop %r15
pop %r14
pop %r13
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WT', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'type': 'addresses_WT', 'same': True, 'size': 2, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 32, 'congruent': 10, 'NT': True, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 32, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 8, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 32, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_D_ht', 'congruent': 7, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 10, 'same': True}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_A_ht', 'same': False, 'size': 4, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM'}
{'39': 21829}
39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39 39
*/
| 39.25 | 2,999 | 0.664054 |
41328c1fa9d83ee495bcd01f80dd3577bf4b938a | 376 | asm | Assembly | oeis/245/A245343.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/245/A245343.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/245/A245343.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A245343: Sum of digits of n written in fractional base 5/3.
; Submitted by Jamie Morken(s3)
; 0,1,2,3,4,3,4,5,6,7,4,5,6,7,8,7,8,9,10,11,6,7,8,9,10,7,8,9,10,11,10,11,12,13,14,7,8,9,10,11,10,11,12,13,14,9,10,11,12,13,10,11,12,13,14,13,14,15,16,17,8,9,10,11,12,11,12,13,14,15
lpb $0
mul $0,2
mov $2,$0
div $0,10
mul $0,3
mod $2,10
add $3,$2
lpe
mov $0,$3
div $0,2
| 25.066667 | 180 | 0.606383 |
0307a3f974d20637fe4a926063ca5666282ad1d1 | 1,517 | asm | Assembly | kernel/arch/debug.asm | TheMachine02/Sorcery | ee657f5a64049bee0c947add7ff2cb92d7281ec1 | [
"MIT"
] | 14 | 2020-05-27T13:20:35.000Z | 2022-02-10T01:19:54.000Z | kernel/arch/debug.asm | TheMachine02/Sorcery | ee657f5a64049bee0c947add7ff2cb92d7281ec1 | [
"MIT"
] | 10 | 2020-06-12T20:53:03.000Z | 2021-03-21T23:11:44.000Z | kernel/arch/debug.asm | TheMachine02/Sorcery | ee657f5a64049bee0c947add7ff2cb92d7281ec1 | [
"MIT"
] | 84 | 2020-06-11T06:27:03.000Z | 2021-05-29T17:06:24.000Z | ; set of CEmu software debug command ;
macro dbg command,func,data
if CONFIG_DEBUG
match =cmd?, command
push af
push hl
scf
sbc hl, hl
ld (hl), a
pop hl
pop af
else match =thread?, command
push iy
ld iy, DEBUG_THREAD
call kthread.create
pop iy
else match =open?, command
push af
push hl
scf
sbc hl, hl
ld (hl), 2
pop hl
pop af
else match =set?, command
push de
ld de, data
push af
push hl
scf
sbc hl, hl
match =break?, func
ld (hl), 3
else match =watch
ld (hl), 11
end match
pop hl
pop af
pop de
else match =rm?, command
push de
ld de, data
push af
push hl
scf
sbc hl, hl
match =break?, func
ld (hl), 4
else match =watch?, func
ld (hl), 8
end match
pop hl
pop af
pop de
else
err 'dbg : invalid argument'
end match
end if
end macro
macro dbg_rm_all_break
push hl
scf
sbc hl, hl
ld (hl), 9
pop hl
end macro
macro dbg_rm_all_watch
push hl
scf
sbc hl, hl
ld (hl), 10
pop hl
end macro
if CONFIG_DEBUG
DEBUG_THREAD:
dbg open
; ; hl is path, bc is flags, de is mode
ld hl, DEBUG_PATH_2
ld bc, KERNEL_VFS_O_RW or (KERNEL_VFS_O_CREAT *256)
call _open
push hl
ld de, $D01000
ld bc, 32768
call _write
pop hl
push hl
; fd is hl, de is offset, bc is whence
ld de, 0
ld bc, SEEK_SET
call _lseek
pop hl
ld de, $D60000
ld bc, 32768
call _read
ret
DEBUG_PATH:
db "/tifs/SORCERY",0
DEBUG_PATH_2:
db "/file", 0
DEBUG_PATH_LINK:
db "/tifs/", 0
DEBUG_PATH_LINK2:
db "/bin/", 0
end if
| 13.077586 | 52 | 0.649967 |
ce3d8f322b08b47285bce0f650c7a12462a3651d | 19 | asm | Assembly | src/main/fragment/csg65ce02-common/vbuzz_lt_vbum1_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | 2 | 2022-03-01T02:21:14.000Z | 2022-03-01T04:33:35.000Z | src/main/fragment/csg65ce02-common/vbuzz_lt_vbum1_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | src/main/fragment/csg65ce02-common/vbuzz_lt_vbum1_then_la1.asm | jbrandwood/kickc | d4b68806f84f8650d51b0e3ef254e40f38b0ffad | [
"MIT"
] | null | null | null | cpz {m1}
bcc {la1}
| 6.333333 | 9 | 0.578947 |
f1e83977d5f7c657e6d715607a02e9a758145ad1 | 5,651 | asm | Assembly | helloworld.asm | billyrayvalentine/asm68k-megadrive-helloworld | d821744182e5184338436c7590e9db49411f17de | [
"WTFPL"
] | 4 | 2020-08-19T19:52:21.000Z | 2021-12-30T11:47:33.000Z | helloworld.asm | billyrayvalentine/asm68k-megadrive-helloworld | d821744182e5184338436c7590e9db49411f17de | [
"WTFPL"
] | 1 | 2020-08-19T21:42:18.000Z | 2020-08-19T21:42:18.000Z | helloworld.asm | billyrayvalentine/asm68k-megadrive-helloworld | d821744182e5184338436c7590e9db49411f17de | [
"WTFPL"
] | 1 | 2020-08-19T20:40:13.000Z | 2020-08-19T20:40:13.000Z | /*
* helloworld.asm
* Written for use with GNU AS
* Copyright © 2020 Ben Sampson <github.com/billyrayvalentine>
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
* Everything kicks off here. Must be at 0x200
.include "rom_header.asm"
cpu_entrypoint:
* Setup the TMSS stuff
jsr tmss
* Initialise joypad 1
move.b #0x40, IO_CTRL_PORT1
move.b #0x40, IO_DATA_PORT1
* Setup the VDP registers
jsr init_vdp
* All the commands to send to the control port can be worked out using the
* example in the README
* Load the palette into CRAM
move.l #0xC0000000, VDP_CTRL_PORT
lea Palette0, a0
moveq #16-1, d0
1: move.w (a0)+, VDP_DATA_PORT
dbra d0, 1b
* Load 7 "cells" (tiles) into the (7*8-1) longwords
* Skip the first 32 bytes of VRAM so we have a blank tile
move.l #0x40200000, VDP_CTRL_PORT
lea TilesLetters, a0
moveq #56-1, d0
1: move.l (a0)+, VDP_DATA_PORT
dbra d0, 1b
* Load the bar tiles
lea TilesBar, a0
moveq #32-1, d0
1: move.l (a0)+, VDP_DATA_PORT
dbra d0, 1b
* Update plane A table @ 0xC000
move.l #0x40000003, VDP_CTRL_PORT
move.w #0x001, VDP_DATA_PORT
move.w #0x002, VDP_DATA_PORT
move.w #0x003, VDP_DATA_PORT
move.w #0x003, VDP_DATA_PORT
move.w #0x004, VDP_DATA_PORT
move.w #0x000, VDP_DATA_PORT
* Update plane table B @ 0xE000
move.l #0x60000003, VDP_CTRL_PORT
move.w #0x005, VDP_DATA_PORT
move.w #0x004, VDP_DATA_PORT
move.w #0x006, VDP_DATA_PORT
move.w #0x003, VDP_DATA_PORT
move.w #0x007, VDP_DATA_PORT
* Load initial sprite table to 0xAB00
move.l #0x68000002, VDP_CTRL_PORT
lea BarSprite, a0
move.l (a0)+, VDP_DATA_PORT
move.l (a0)+, VDP_DATA_PORT
* Set the initial X and Y positions
move.w #128, RAM_SPRITE_TARGET_X
move.w #128, RAM_SPRITE_TARGET_Y
move.w #128, d6 /* Counter for x */
move.w #128, d7 /* Counter for y */
move.l #0, d4 /* Counter for x scroll offset */
move.l #0, d5 /* Counter for y scroll offset */
/*
* Main loop
* Wait for the VBLANK to start
* Get the input for the joy pad
* Move the sprite and the scroll planes
* Wait for the VBLANK to end
*
* Joypad values and sprite positions are kept in RAM
*/
forever:
jsr wait_vblank_start
jsr read_controller_1
* If right then move sprite right
btst.b #3, RAM_CONTROLLER_1
beq 1f
* Check the sprite is at the screen boundary, if so skip
* Screen h
cmpi.w #320 + 128 - 32, RAM_SPRITE_TARGET_X
beq 4f
addi.w #1, RAM_SPRITE_TARGET_X
addi.w #1, d6
* If left then move sprite left
1: btst.b #2, RAM_CONTROLLER_1
beq 2f
* Check the sprite is at the screen boundary, if so skip
cmpi.w #0 + 128, RAM_SPRITE_TARGET_X
beq 4f
subi.w #1, RAM_SPRITE_TARGET_X
subi.w #1, d6
* If up then move the sprite up
2: btst.b #0, RAM_CONTROLLER_1
beq 3f
* check the sprite is at the screen boundary, if so skip
cmpi.w #0 + 128, RAM_SPRITE_TARGET_Y
beq 4f
subi.w #1, RAM_SPRITE_TARGET_Y
subi.w #1, d7
* If down then move the sprite down
3: btst.b #1, RAM_CONTROLLER_1
beq 4f
* Check the sprite is at the screen boundary, if so skip
cmpi.w #224 + 128 - 8, RAM_SPRITE_TARGET_Y
beq 4f
addi.w #1, RAM_SPRITE_TARGET_Y
addi.w #1, d7
* Update horizontal scroll table @ 0xAC00 and scroll plane A
* If the offset is >320 (size of screen width) then reset to 0
4: cmp.w #320, d4
bls.s 1f
move.w #0, d4
1: move.l #0x6C000002, VDP_CTRL_PORT
move.w d4, VDP_DATA_PORT
* Update vertical scroll table which is in VSRAM
* skip the first word as we want to scroll plane B
cmp.w #224, d5
bls.s 1f
move.w #0, d5
1: move.l #0x40020010, VDP_CTRL_PORT
move.w d5, VDP_DATA_PORT
add.w #1, d4
add.b #1, d5
jsr update_sprite_table
jsr wait_vblank_end
jmp forever
update_sprite_table:
* Update sprite table
move.l #0x68000002, VDP_CTRL_PORT
move.w RAM_SPRITE_TARGET_Y, VDP_DATA_PORT
move.w #0x0C00, VDP_DATA_PORT
move.w #0x0008, VDP_DATA_PORT
move.w RAM_SPRITE_TARGET_X, VDP_DATA_PORT
rts
read_controller_1:
* Read controller 1 input into $FF0000
move.l #IO_DATA_PORT1, a0
move.b #0x40, (a0)
nop
nop
move.b (a0), d0
move.b #0x00, (a0)
nop
nop
move.b (a0), d1
andi.b #0x3f, d0
andi.b #0x30, d1
lsl.b #2, d1
or.b d1, d0
* NOT The bits so that that we have SACBRLDU
* and a 1 rather than 0 when the bit is set
* Finally write the value to RAM
not d0
move.b d0, RAM_CONTROLLER_1
rts
wait_vblank_start:
* Bit 4 of the VDP register is set to 1 when the vblanking is in progress
* Keep looping until this is set
* The VDP register can be read simply by reading from the control port
* address
move.w VDP_CTRL_PORT, d0
btst.b #4-1, d0
beq wait_vblank_start
rts
wait_vblank_end:
* Similar to wait_vblank_start but the inverse
move.w VDP_CTRL_PORT, d0
btst.b #4-1, d0
bne wait_vblank_end
rts
.include "globals.asm"
.include "init_vdp.asm"
.include "tmss.asm"
.include "palletes.asm"
/*
* Interrupt handler
*/
cpu_exception:
rte
int_null:
rte
int_hinterrupt:
rte
int_vinterrupt:
rte
rom_end:
| 23.159836 | 78 | 0.647142 |
e1814942cc58d6ab44ae0789cb086e49f58e2f3d | 827 | asm | Assembly | oeis/142/A142619.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/142/A142619.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/142/A142619.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A142619: Primes congruent to 26 mod 55.
; Submitted by Jon Maiga
; 191,521,631,1181,1291,1511,1621,1951,2281,3271,3491,3821,3931,4261,4481,4591,5471,5581,5801,6131,6571,6791,7121,7451,7561,8111,8221,9431,9871,10091,10531,10861,11411,12071,12401,12511,12841,13171,13721,13831,14051,14821,16141,16361,16691,17021,17351,17681,17791,18121,18341,18451,18671,19001,19441,19661,19991,20101,20431,20981,21751,22741,22961,23071,23291,24061,24281,24391,24611,25601,25931,26041,26261,26371,26591,26701,26921,27031,27361,27581,27691,28351,28571,28901,29231,29671,30661,30881
mov $1,40
mov $2,$0
add $2,2
pow $2,2
lpb $2
sub $2,1
mov $3,$1
mul $3,2
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,55
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
mov $0,$1
mul $0,2
sub $0,109
| 34.458333 | 497 | 0.730351 |
d3f72e21bf95fcacf9b2768d793da57a39de96d5 | 12,393 | asm | Assembly | Palmtree.Math.Core.Sint/vs_build/x86_Debug/TEST_op_ParseX.asm | rougemeilland/Palmtree.Math.Core.Sint | 0895fd4988b146f01ec705e091ef3fd79a721b40 | [
"MIT"
] | null | null | null | Palmtree.Math.Core.Sint/vs_build/x86_Debug/TEST_op_ParseX.asm | rougemeilland/Palmtree.Math.Core.Sint | 0895fd4988b146f01ec705e091ef3fd79a721b40 | [
"MIT"
] | null | null | null | Palmtree.Math.Core.Sint/vs_build/x86_Debug/TEST_op_ParseX.asm | rougemeilland/Palmtree.Math.Core.Sint | 0895fd4988b146f01ec705e091ef3fd79a721b40 | [
"MIT"
] | null | null | null | ; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27026.1
TITLE Z:\Sources\Lunor\Repos\rougemeilland\Palmtree.Math.Core.Sint\Palmtree.Math.Core.Sint\TEST_op_ParseX.c
.686P
.XMM
include listing.inc
.model flat
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
_DATA SEGMENT
COMM _uint_number_zero:DWORD
COMM _uint_number_one:DWORD
_DATA ENDS
msvcjmc SEGMENT
__7B7A869E_ctype@h DB 01H
__457DD326_basetsd@h DB 01H
__4384A2D9_corecrt_memcpy_s@h DB 01H
__4E51A221_corecrt_wstring@h DB 01H
__2140C079_string@h DB 01H
__1887E595_winnt@h DB 01H
__9FC7C64B_processthreadsapi@h DB 01H
__FA470AEC_memoryapi@h DB 01H
__F37DAFF1_winerror@h DB 01H
__7A450CCC_winbase@h DB 01H
__B4B40122_winioctl@h DB 01H
__86261D59_stralign@h DB 01H
__059414E1_pmc_sint_debug@h DB 01H
__01E814D2_test_op_parsex@c DB 01H
msvcjmc ENDS
PUBLIC _TEST_ParseX
PUBLIC __JustMyCode_Default
PUBLIC ??_C@_1DI@IKFBJCFO@?$AAT?$AAr?$AAy?$AAP?$AAa?$AAr?$AAs?$AAe?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM?$PP?I?$AAL@ ; `string'
PUBLIC ??_C@_1BO@HCNCHDIP@?$AAP?$AAa?$AAr?$AAs?$AAe?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4?$AA?$CF?$AAd?$AA?$CJ@ ; `string'
PUBLIC ??_C@_1EG@MCOLJMDD@?$AAP?$AAM?$AAC?$AA_?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy@ ; `string'
PUBLIC ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ ; `string'
EXTRN _TEST_Assert:PROC
EXTRN _FormatTestLabel:PROC
EXTRN _FormatTestMesssage:PROC
EXTRN @_RTC_CheckStackVars@8:PROC
EXTRN @__CheckForDebuggerJustMyCode@4:PROC
EXTRN @__security_check_cookie@4:PROC
EXTRN __RTC_CheckEsp:PROC
EXTRN __RTC_InitBase:PROC
EXTRN __RTC_Shutdown:PROC
EXTRN ___security_cookie:DWORD
_BSS SEGMENT
?actual_buf@?1??TEST_ParseX@@9@9 DB 0100H DUP (?) ; `TEST_ParseX'::`2'::actual_buf
?actual_buf_size@?1??TEST_ParseX@@9@9 DD 01H DUP (?) ; `TEST_ParseX'::`2'::actual_buf_size
_BSS ENDS
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
__RTC_Shutdown.rtc$TMZ DD FLAT:__RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
__RTC_InitBase.rtc$IMZ DD FLAT:__RTC_InitBase
rtc$IMZ ENDS
; COMDAT ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@
CONST SEGMENT
??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@ DB 0c7H
DB '0', 0fcH, '0', 0bfH, '0n0', 085H, 'Q', 0b9H, '[L0', 00H, 'N', 0f4H
DB 081H, 'W0j0D0', 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1EG@MCOLJMDD@?$AAP?$AAM?$AAC?$AA_?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy@
CONST SEGMENT
??_C@_1EG@MCOLJMDD@?$AAP?$AAM?$AAC?$AA_?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy@ DB 'P'
DB 00H, 'M', 00H, 'C', 00H, '_', 00H, 'T', 00H, 'o', 00H, 'B', 00H
DB 'y', 00H, 't', 00H, 'e', 00H, 'A', 00H, 'r', 00H, 'r', 00H, 'a'
DB 00H, 'y', 00H, 'n0', 0a9H, '_0^', 0b3H, '0', 0fcH, '0', 0c9H, '0'
DB 'L0', 01fH, 'g', 085H, '_', 01aH, 090H, 08aH, '0g0o0j0D0(', 00H
DB '%', 00H, 'd', 00H, ')', 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1BO@HCNCHDIP@?$AAP?$AAa?$AAr?$AAs?$AAe?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4?$AA?$CF?$AAd?$AA?$CJ@
CONST SEGMENT
??_C@_1BO@HCNCHDIP@?$AAP?$AAa?$AAr?$AAs?$AAe?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4?$AA?$CF?$AAd?$AA?$CJ@ DB 'P'
DB 00H, 'a', 00H, 'r', 00H, 's', 00H, 'e', 00H, 'X', 00H, ' ', 00H
DB '(', 00H, '%', 00H, 'd', 00H, '.', 00H, '%', 00H, 'd', 00H, ')'
DB 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_1DI@IKFBJCFO@?$AAT?$AAr?$AAy?$AAP?$AAa?$AAr?$AAs?$AAe?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM?$PP?I?$AAL@
CONST SEGMENT
??_C@_1DI@IKFBJCFO@?$AAT?$AAr?$AAy?$AAP?$AAa?$AAr?$AAs?$AAe?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM?$PP?I?$AAL@ DB 'T'
DB 00H, 'r', 00H, 'y', 00H, 'P', 00H, 'a', 00H, 'r', 00H, 's', 00H
DB 'e', 00H, 'n0', 0a9H, '_0^', 0b3H, '0', 0fcH, '0', 0c9H, '0L0', 01fH
DB 'g', 085H, '_', 01aH, 090H, 08aH, '0g0o0j0D0(', 00H, '%', 00H, 'd'
DB 00H, ')', 00H, 00H, 00H ; `string'
CONST ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
push ebp
mov ebp, esp
pop ebp
ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\pmc_sint_debug.h
; COMDAT __EQUALS_MEMORY
_TEXT SEGMENT
_buffer1$ = 8 ; size = 4
_count1$ = 12 ; size = 4
_buffer2$ = 16 ; size = 4
_count2$ = 20 ; size = 4
__EQUALS_MEMORY PROC ; COMDAT
; 140 : {
push ebp
mov ebp, esp
sub esp, 192 ; 000000c0H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-192]
mov ecx, 48 ; 00000030H
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, OFFSET __059414E1_pmc_sint_debug@h
call @__CheckForDebuggerJustMyCode@4
; 141 : if (count1 != count2)
mov eax, DWORD PTR _count1$[ebp]
cmp eax, DWORD PTR _count2$[ebp]
je SHORT $LN2@EQUALS_MEM
; 142 : return (-1);
or eax, -1
jmp SHORT $LN1@EQUALS_MEM
$LN2@EQUALS_MEM:
; 143 : while (count1 > 0)
cmp DWORD PTR _count1$[ebp], 0
jbe SHORT $LN3@EQUALS_MEM
; 144 : {
; 145 : if (*buffer1 != *buffer2)
mov eax, DWORD PTR _buffer1$[ebp]
movzx ecx, BYTE PTR [eax]
mov edx, DWORD PTR _buffer2$[ebp]
movzx eax, BYTE PTR [edx]
cmp ecx, eax
je SHORT $LN5@EQUALS_MEM
; 146 : return (-1);
or eax, -1
jmp SHORT $LN1@EQUALS_MEM
$LN5@EQUALS_MEM:
; 147 : ++buffer1;
mov eax, DWORD PTR _buffer1$[ebp]
add eax, 1
mov DWORD PTR _buffer1$[ebp], eax
; 148 : ++buffer2;
mov eax, DWORD PTR _buffer2$[ebp]
add eax, 1
mov DWORD PTR _buffer2$[ebp], eax
; 149 : --count1;
mov eax, DWORD PTR _count1$[ebp]
sub eax, 1
mov DWORD PTR _count1$[ebp], eax
; 150 : }
jmp SHORT $LN2@EQUALS_MEM
$LN3@EQUALS_MEM:
; 151 : return (0);
xor eax, eax
$LN1@EQUALS_MEM:
; 152 : }
pop edi
pop esi
pop ebx
add esp, 192 ; 000000c0H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
__EQUALS_MEMORY ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.sint\palmtree.math.core.sint\test_op_parsex.c
; COMDAT _TEST_ParseX
_TEXT SEGMENT
tv144 = -436 ; size = 4
tv129 = -436 ; size = 4
tv77 = -436 ; size = 4
_opt$ = -236 ; size = 192
_x_result$ = -36 ; size = 4
_result$ = -24 ; size = 4
_x$ = -12 ; size = 4
__$ArrayPad$ = -4 ; size = 4
_env$ = 8 ; size = 4
_ep$ = 12 ; size = 4
_no$ = 16 ; size = 4
_str$ = 20 ; size = 4
_styles$ = 24 ; size = 4
_desired_result_code$ = 28 ; size = 4
_desired_buf$ = 32 ; size = 4
_desired_buf_size$ = 36 ; size = 4
_TEST_ParseX PROC ; COMDAT
; 32 : {
push ebp
mov ebp, esp
sub esp, 436 ; 000001b4H
push ebx
push esi
push edi
lea edi, DWORD PTR [ebp-436]
mov ecx, 109 ; 0000006dH
mov eax, -858993460 ; ccccccccH
rep stosd
mov eax, DWORD PTR ___security_cookie
xor eax, ebp
mov DWORD PTR __$ArrayPad$[ebp], eax
mov ecx, OFFSET __01E814D2_test_op_parsex@c
call @__CheckForDebuggerJustMyCode@4
; 33 : PMC_HANDLE_SINT x;
; 34 : static unsigned char actual_buf[256];
; 35 : static size_t actual_buf_size;
; 36 : PMC_STATUS_CODE result;
; 37 : PMC_STATUS_CODE x_result;
; 38 : PMC_NUMBER_FORMAT_INFO opt;
; 39 : ep->UINT_ENTRY_POINTS.InitializeNumberFormatInfo(&opt);
mov esi, esp
lea eax, DWORD PTR _opt$[ebp]
push eax
mov ecx, DWORD PTR _ep$[ebp]
mov edx, DWORD PTR [ecx+44]
call edx
cmp esi, esp
call __RTC_CheckEsp
; 40 : TEST_Assert(env, FormatTestLabel(L"ParseX (%d.%d)", no, 1), (x_result = ep->TryParse(str, styles, &opt, &x)) == desired_result_code, FormatTestMesssage(L"TryParseの復帰コードが期待通りではない(%d)", x_result));
mov esi, esp
lea eax, DWORD PTR _x$[ebp]
push eax
lea ecx, DWORD PTR _opt$[ebp]
push ecx
mov edx, DWORD PTR _styles$[ebp]
push edx
mov eax, DWORD PTR _str$[ebp]
push eax
mov ecx, DWORD PTR _ep$[ebp]
mov edx, DWORD PTR [ecx+328]
call edx
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _x_result$[ebp], eax
mov eax, DWORD PTR _x_result$[ebp]
cmp eax, DWORD PTR _desired_result_code$[ebp]
jne SHORT $LN5@TEST_Parse
mov DWORD PTR tv77[ebp], 1
jmp SHORT $LN6@TEST_Parse
$LN5@TEST_Parse:
mov DWORD PTR tv77[ebp], 0
$LN6@TEST_Parse:
mov ecx, DWORD PTR _x_result$[ebp]
push ecx
push OFFSET ??_C@_1DI@IKFBJCFO@?$AAT?$AAr?$AAy?$AAP?$AAa?$AAr?$AAs?$AAe?$AAn?$PP?$KJ?$AA0?$PP?$LD?$PP?$PM?$PP?I?$AAL@
call _FormatTestMesssage
add esp, 8
push eax
mov edx, DWORD PTR tv77[ebp]
push edx
push 1
mov eax, DWORD PTR _no$[ebp]
push eax
push OFFSET ??_C@_1BO@HCNCHDIP@?$AAP?$AAa?$AAr?$AAs?$AAe?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4?$AA?$CF?$AAd?$AA?$CJ@
call _FormatTestLabel
add esp, 12 ; 0000000cH
push eax
mov ecx, DWORD PTR _env$[ebp]
push ecx
call _TEST_Assert
add esp, 16 ; 00000010H
; 41 : if (desired_result_code == PMC_STATUS_OK)
cmp DWORD PTR _desired_result_code$[ebp], 0
jne $LN2@TEST_Parse
; 42 : {
; 43 : TEST_Assert(env, FormatTestLabel(L"ParseX (%d.%d)", no, 2), (result = ep->ToByteArray(x, actual_buf, sizeof(actual_buf), &actual_buf_size)) == PMC_STATUS_OK, FormatTestMesssage(L"PMC_ToByteArrayの復帰コードが期待通りではない(%d)", result));
mov esi, esp
push OFFSET ?actual_buf_size@?1??TEST_ParseX@@9@9
push 256 ; 00000100H
push OFFSET ?actual_buf@?1??TEST_ParseX@@9@9
mov eax, DWORD PTR _x$[ebp]
push eax
mov ecx, DWORD PTR _ep$[ebp]
mov edx, DWORD PTR [ecx+308]
call edx
cmp esi, esp
call __RTC_CheckEsp
mov DWORD PTR _result$[ebp], eax
cmp DWORD PTR _result$[ebp], 0
jne SHORT $LN7@TEST_Parse
mov DWORD PTR tv129[ebp], 1
jmp SHORT $LN8@TEST_Parse
$LN7@TEST_Parse:
mov DWORD PTR tv129[ebp], 0
$LN8@TEST_Parse:
mov eax, DWORD PTR _result$[ebp]
push eax
push OFFSET ??_C@_1EG@MCOLJMDD@?$AAP?$AAM?$AAC?$AA_?$AAT?$AAo?$AAB?$AAy?$AAt?$AAe?$AAA?$AAr?$AAr?$AAa?$AAy@
call _FormatTestMesssage
add esp, 8
push eax
mov ecx, DWORD PTR tv129[ebp]
push ecx
push 2
mov edx, DWORD PTR _no$[ebp]
push edx
push OFFSET ??_C@_1BO@HCNCHDIP@?$AAP?$AAa?$AAr?$AAs?$AAe?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4?$AA?$CF?$AAd?$AA?$CJ@
call _FormatTestLabel
add esp, 12 ; 0000000cH
push eax
mov eax, DWORD PTR _env$[ebp]
push eax
call _TEST_Assert
add esp, 16 ; 00000010H
; 44 : TEST_Assert(env, FormatTestLabel(L"ParseX (%d.%d)", no, 3), _EQUALS_MEMORY(actual_buf, actual_buf_size, desired_buf, desired_buf_size) == 0, L"データの内容が一致しない");
mov eax, DWORD PTR _desired_buf_size$[ebp]
push eax
mov ecx, DWORD PTR _desired_buf$[ebp]
push ecx
mov edx, DWORD PTR ?actual_buf_size@?1??TEST_ParseX@@9@9
push edx
push OFFSET ?actual_buf@?1??TEST_ParseX@@9@9
call __EQUALS_MEMORY
add esp, 16 ; 00000010H
test eax, eax
jne SHORT $LN9@TEST_Parse
mov DWORD PTR tv144[ebp], 1
jmp SHORT $LN10@TEST_Parse
$LN9@TEST_Parse:
mov DWORD PTR tv144[ebp], 0
$LN10@TEST_Parse:
push OFFSET ??_C@_1BK@CBDJCOBM@?$PP?G?$PP?$PM?$PP?$LP?$AAn?$PP?$IF?$PP?$LJ?$AAL?$AA?$AA?$PP?t?$AAW?$AAj?$AAD@
mov eax, DWORD PTR tv144[ebp]
push eax
push 3
mov ecx, DWORD PTR _no$[ebp]
push ecx
push OFFSET ??_C@_1BO@HCNCHDIP@?$AAP?$AAa?$AAr?$AAs?$AAe?$AAX?$AA?5?$AA?$CI?$AA?$CF?$AAd?$AA?4?$AA?$CF?$AAd?$AA?$CJ@
call _FormatTestLabel
add esp, 12 ; 0000000cH
push eax
mov edx, DWORD PTR _env$[ebp]
push edx
call _TEST_Assert
add esp, 16 ; 00000010H
$LN2@TEST_Parse:
; 45 : }
; 46 : if (x_result == PMC_STATUS_OK)
cmp DWORD PTR _x_result$[ebp], 0
jne SHORT $LN1@TEST_Parse
; 47 : ep->Dispose(x);
mov esi, esp
mov eax, DWORD PTR _x$[ebp]
push eax
mov ecx, DWORD PTR _ep$[ebp]
mov edx, DWORD PTR [ecx+296]
call edx
cmp esi, esp
call __RTC_CheckEsp
$LN1@TEST_Parse:
; 48 : }
push edx
mov ecx, ebp
push eax
lea edx, DWORD PTR $LN14@TEST_Parse
call @_RTC_CheckStackVars@8
pop eax
pop edx
pop edi
pop esi
pop ebx
mov ecx, DWORD PTR __$ArrayPad$[ebp]
xor ecx, ebp
call @__security_check_cookie@4
add esp, 436 ; 000001b4H
cmp ebp, esp
call __RTC_CheckEsp
mov esp, ebp
pop ebp
ret 0
npad 1
$LN14@TEST_Parse:
DD 2
DD $LN13@TEST_Parse
$LN13@TEST_Parse:
DD -12 ; fffffff4H
DD 4
DD $LN11@TEST_Parse
DD -236 ; ffffff14H
DD 192 ; 000000c0H
DD $LN12@TEST_Parse
$LN12@TEST_Parse:
DB 111 ; 0000006fH
DB 112 ; 00000070H
DB 116 ; 00000074H
DB 0
$LN11@TEST_Parse:
DB 120 ; 00000078H
DB 0
_TEST_ParseX ENDP
_TEXT ENDS
END
| 27.975169 | 242 | 0.665214 |
7c137c04dd237eebd716c9b829a5568b88196bdc | 645 | asm | Assembly | oeis/020/A020963.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/020/A020963.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/020/A020963.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A020963: Sum of Floor[ 2*(1+sqrt(2))^(n-k) ] for k from 1 to infinity.
; 2,6,17,45,112,276,671,1627,3934,9506,22957,55433,133836,323120,780091,1883319,4546746,10976830,26500425,63977701,154455848,372889420,900234711,2173358867,5246952470,12667263834,30581480165,73830224193,178241928580,430314081384,1038870091379,2508054264175,6054978619762,14618011503734,35291001627265,85200014758301,205691031143904,496582077046148,1198855185236239,2894292447518667,6987440080273614,16869172608065938,40725785296405533,98320743200877049,237367271698159676,573055286597196448
mov $2,$0
seq $0,133654 ; a(n) = 2*A000129(n) - 1.
div $2,2
sub $2,$0
sub $0,$2
| 71.666667 | 490 | 0.821705 |
7cb6d10cecaf7ad8ff25a8fed37994098004cca3 | 6,989 | asm | Assembly | Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_2703.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_2703.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/AVXALIGN/_st_/i3-7100_9_0x84_notsx.log_21829_2703.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r11
push %r13
push %r14
push %rbp
push %rcx
push %rdi
push %rsi
lea addresses_D_ht+0x47a1, %rsi
lea addresses_A_ht+0x941, %rdi
nop
nop
nop
nop
sub %r10, %r10
mov $41, %rcx
rep movsb
nop
nop
nop
nop
add $48033, %r13
lea addresses_D_ht+0x19fdb, %rsi
lea addresses_normal_ht+0x1acf9, %rdi
dec %r14
mov $98, %rcx
rep movsl
nop
nop
sub $40311, %r13
lea addresses_D_ht+0x167c1, %r14
nop
nop
nop
nop
nop
dec %rbp
mov $0x6162636465666768, %rcx
movq %rcx, (%r14)
nop
nop
xor %rdi, %rdi
lea addresses_D_ht+0x1965f, %rsi
clflush (%rsi)
nop
nop
cmp %r10, %r10
mov (%rsi), %di
nop
nop
nop
nop
dec %r10
lea addresses_WC_ht+0x1d241, %r10
nop
nop
nop
nop
nop
cmp $59707, %rbp
mov (%r10), %r13w
nop
nop
nop
nop
inc %r10
lea addresses_D_ht+0x7e92, %r13
nop
nop
nop
dec %rcx
mov $0x6162636465666768, %r10
movq %r10, %xmm6
vmovups %ymm6, (%r13)
nop
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_normal_ht+0x1a241, %rsi
lea addresses_WT_ht+0x16441, %rdi
cmp $51132, %r11
mov $70, %rcx
rep movsq
sub $28594, %r10
lea addresses_WT_ht+0x1548d, %r11
nop
nop
nop
nop
sub $529, %rdi
movw $0x6162, (%r11)
nop
nop
mfence
lea addresses_normal_ht+0x13c41, %r11
nop
nop
add %r13, %r13
mov (%r11), %rbp
nop
nop
nop
nop
xor %rbp, %rbp
lea addresses_WT_ht+0x4989, %r10
nop
nop
nop
nop
nop
and $3645, %r11
movb $0x61, (%r10)
nop
nop
and %rcx, %rcx
lea addresses_UC_ht+0x19c41, %rsi
lea addresses_WT_ht+0x9a41, %rdi
nop
nop
nop
nop
inc %r13
mov $67, %rcx
rep movsq
nop
nop
nop
xor %r14, %r14
pop %rsi
pop %rdi
pop %rcx
pop %rbp
pop %r14
pop %r13
pop %r11
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r14
push %r9
push %rax
push %rbx
push %rsi
// Store
lea addresses_WC+0x15b9, %rbx
and $12535, %r9
mov $0x5152535455565758, %r14
movq %r14, %xmm4
movups %xmm4, (%rbx)
nop
nop
nop
nop
inc %r9
// Faulty Load
lea addresses_WC+0x8041, %r9
nop
nop
nop
nop
xor $29169, %rbx
mov (%r9), %r14d
lea oracles, %rsi
and $0xff, %r14
shlq $12, %r14
mov (%rsi,%r14,1), %r14
pop %rsi
pop %rbx
pop %rax
pop %r9
pop %r14
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'type': 'addresses_WC', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WC', 'same': False, 'size': 16, 'congruent': 3, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
[Faulty Load]
{'src': {'type': 'addresses_WC', 'same': True, 'size': 4, 'congruent': 0, 'NT': False, 'AVXalign': True}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'type': 'addresses_D_ht', 'congruent': 4, 'same': False}, 'dst': {'type': 'addresses_A_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM'}
{'src': {'type': 'addresses_D_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_normal_ht', 'congruent': 3, 'same': False}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 8, 'congruent': 7, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_D_ht', 'same': False, 'size': 2, 'congruent': 1, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_WC_ht', 'same': False, 'size': 2, 'congruent': 6, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_D_ht', 'same': False, 'size': 32, 'congruent': 0, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': True}, 'OP': 'REPM'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 2, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_normal_ht', 'same': False, 'size': 8, 'congruent': 10, 'NT': False, 'AVXalign': False}, 'OP': 'LOAD'}
{'dst': {'type': 'addresses_WT_ht', 'same': False, 'size': 1, 'congruent': 2, 'NT': False, 'AVXalign': False}, 'OP': 'STOR'}
{'src': {'type': 'addresses_UC_ht', 'congruent': 9, 'same': False}, 'dst': {'type': 'addresses_WT_ht', 'congruent': 9, 'same': False}, 'OP': 'REPM'}
{'38': 21829}
38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38 38
*/
| 33.927184 | 2,999 | 0.659465 |
361d33849c13595ceae720c7303d6c873a4d4ff1 | 3,511 | asm | Assembly | kernel/compiler/com_define.asm | paulscottrobson/color-forth-old-next | 3fbec603078f187e29852821f824c35cca68bb42 | [
"MIT"
] | 1 | 2020-06-10T09:57:08.000Z | 2020-06-10T09:57:08.000Z | kernel/compiler/com_define.asm | paulscottrobson/color-forth-old-next | 3fbec603078f187e29852821f824c35cca68bb42 | [
"MIT"
] | 1 | 2020-06-25T07:46:16.000Z | 2020-07-02T09:17:12.000Z | kernel/compiler/com_define.asm | paulscottrobson/color-forth-old-next | 3fbec603078f187e29852821f824c35cca68bb42 | [
"MIT"
] | null | null | null | ; ***************************************************************************************
; ***************************************************************************************
;
; Name : com_define.asm
; Author : Paul Robson (paul@robsons.org.uk)
; Date : 8th December 2018
; Purpose : Executes a red or magenta word.
;
; ***************************************************************************************
; ***************************************************************************************
; ***************************************************************************************
;
; Compile the magenta word (variable definition)
;
; ***************************************************************************************
COMDCompileMagentaWord:
ld a,$80 ; add it to the MACRO dictionary.
call DICTAddWord
ld a,$CD ; add a caller to the standard variable handler
call FARCompileByte
ld hl,COMDVariableHandler
call FARCompileWord
ld hl,$0000 ; and space for the variable.
call FARCompileWord
ret
;
; Magenta word call this routine - their code (compiled above) is
; CALL COMDVariableHandler ; dw 0
;
COMDVariableHandler:
pop hl ; address of the data
call COMUCompileConstant ; compile the code to load the constant.
ret
; ***************************************************************************************
;
; Compiles a red word. If the previous word is open (e.g. CurrentDef is non-zero)
; throw an error as previous not closed. Store current def and compile prefix, set
; CurrentExit to zero so ;s can compile the postfix.
;
; ***************************************************************************************
COMDCompileRedWord:
ld hl,(__COMPCurrentDef) ; check if it's been closed
ld a,h
or l
jr z,__COMRedClosed
ld hl,__COMRedNotClosedMsg ; not closed.
jp ErrorHandler
__COMRedNotClosedMsg:
db "not closed",$00
;
; Adding red word okay.
;
__COMRedClosed:
xor a ; add to FORTH
call DICTAddWord
ld hl,(Here) ; copy HERE to CurrentDef
ld (__COMPCurrentDef),hl
ld hl,$0000 ; zero current exit as one not done yet.
ld (__COMPCurrentExit),hl
ld a,$E1 ; pop HL
call FARCompileByte
ld a,$22 ; ld (xxxx),hl
call FARCompileByte
ld hl,$0000 ; zero address
call FARCompileWord
ret
; ***************************************************************************************
;
; Code for compiling ;s - this is ; without the THEN closure
;
; ***************************************************************************************
COMDExitRoutine:
ld hl,(__COMPCurrentExit) ; current exit already done.
ld a,h
or l
jr z,__COMDExitCreate
ld a,$C3 ; JP to that exit
call FARCompileByte
call FARCompileWord
ret
__COMDExitCreate:
ld hl,(Here) ; get and save Here.
ld (__COMPCurrentExit),hl ; save as current exit
ld a,$C3 ; compile JP $0000
call FARCompileByte
ld hl,$0000
call FARCompileWord
ld bc,(Here) ; put current here in BC
ld hl,(__COMPCurrentDef) ; get current definition
inc hl ; point to address part of prefix.
inc hl
ld (Here),hl
ld h,b ; overwrite with BC + 1
ld l,c
dec hl
dec hl
call FARCompileWord
ld (Here),bc ; restore HERE.
ld hl,$0000
ld (__COMPCurrentDef),hl ; zero current definition as old one closed.
ret
ret
| 30.530435 | 89 | 0.483338 |
ecbf970826ef3a8e31c236f1a1359f62da0db7e3 | 2,983 | asm | Assembly | Source_code/inputs.asm | alexcw234/dlxtetris | c369516fa1ac6a35b9209dd9cc009e1b016f81c2 | [
"MIT"
] | null | null | null | Source_code/inputs.asm | alexcw234/dlxtetris | c369516fa1ac6a35b9209dd9cc009e1b016f81c2 | [
"MIT"
] | null | null | null | Source_code/inputs.asm | alexcw234/dlxtetris | c369516fa1ac6a35b9209dd9cc009e1b016f81c2 | [
"MIT"
] | null | null | null | ; ICS 331
; Tetris
; Alex Watanabe
; Using DLX architecture
; Contains anything to do with input computation
; so I don't have to scroll through many things while working
; Function that will read inputs
; x-input returned as R2. 1 = l, 2 = n, 3 = r
; y-input returned as R3. 1 = rotL, 2 = n, 3 = rotR
readIn: addi R4 R0 0x2000
lw R2 R4 0x0
lw R3 R4 0x1
jr R31
; Function that calculates position/orientation from inputs
; Arguments Taken-
; R4 | The piece we're rotating (0x_0)
; R5 |
; R6 |
: R7 |
; Arguments Passed-
; rotate |
; R4 | Sublocation pointer to rotation (0xE)
; R5 | Address of the piece rotation block (0x1300)
; R6 | The direction to shift (normally from y input)
; R7 | The piece we're rotating (0x_0)
;
; pshift |
; R4 | Sublocation pointer to current shift (0xC)
; R5 | Address of the piece rotation block (0x1300)
; R6 | The direction to shift (normally from x input)
: R7 | The sublocation pointer for the piece set (the 0x_0 in R5)
;
; Temporaries-
; R8 | Returned pointer to lower row rotation
; R9 | Returned pointer to upper row rotation
; R10 |
; R11 |
; R12 |
; R13 |
; R14 |
; R15 |
;
; R16 | Saved x input
; R17 | Saved y input
; R18 | Saved current piece
; R19 |
; R20 |
; R21 |
; R22 |
; R23 |
;
; R24 | Logical temporary
; R25 | Logical temporary 2
; Returns-
; R2 | Currentpiece lower row for 0x1202
; R3 | Currentpiece upper row for 0x1203
;
; Function start, get inputs
getInput: sw R31 R29 0x0
jali readIn
lw R31 R29 0x0
; Set saved variables
addi R16 R2 0x0
addi R17 R3 0x0
addi R18 R4 0x0
; We check shift before rotate
; set shift arguments
addi R4 R0 0xC
addi R5 R0 0x1300
addi R6 R16 0x0
addi R7 R18 0x0
; Save saved variables before function call
sw R31 R29 0x0
addi R29 R29 -1
jali savesv
addi R31 R2 0x0
; Call Function
jali pshift
; Load saved variables
sw R31 R29 0x0
addi R29 R29 -1
jali loadsv
addi R31 R2 0x0
; set rotation arguments
addi R4 R0 0xE
addi R5 R0 0x1300
addi R6 R17 0x0
addi R7 R18 0x0
; Save saved variables before function call
sw R31 R29 0x0
addi R29 R29 -1
jali savesv
addi R31 R2 0x0
; Call Function
jali rotate
; Handle return
addi R8 R2 0x0
addi R9 R2 0x0
; Load saved variables
sw R31 R29 0x0
addi R29 R29 -1
jali loadsv
addi R31 R2 0x0
; Get return values
lw R2 R8 0x0
lw R3 R9 0x0
jr R31
;
| 23.304688 | 71 | 0.543413 |
1d3bc6e76be5df571cf0bdfd627e44f66d39a340 | 1,072 | asm | Assembly | kernel/arch/x86/syscalls.asm | GhostBirdOperatingSystemProject/GhostBirdOS | 15d3499208029d1a811cccda435f0cfbbf08b482 | [
"BSD-2-Clause"
] | 10 | 2017-06-08T07:38:37.000Z | 2022-01-27T20:15:52.000Z | kernel/arch/x86/syscalls.asm | GhostBirdOperatingSystemProject/GhostBirdOS | 15d3499208029d1a811cccda435f0cfbbf08b482 | [
"BSD-2-Clause"
] | 1 | 2018-07-07T15:47:33.000Z | 2018-07-07T15:47:33.000Z | kernel/arch/x86/syscalls.asm | MakeOS/GhostBirdOS | 15d3499208029d1a811cccda435f0cfbbf08b482 | [
"BSD-2-Clause"
] | 13 | 2017-06-06T05:26:04.000Z | 2022-01-28T22:18:00.000Z | ; Copyright 2013-2015 by 2013-2015 by Explorer OS Developers. All rights reserved.
; made by Lab Explorer Developers<1@GhostBirdOS.org>
; Explorer x86 syscalls support
; Explorer/arch/x86/syscalls.asm
; 2/8/2015 10:23 PM
; Explorer临时系统调用规划
; EAX = 功能号
global do_syscalls ; 系统调用处理函数
extern printk ; 标准输入输出函数
extern sys_GUI_API ; GUI API函数
extern sys_msg ; MSG API函数
%define NUM_SYS_FUNCTION 32 ; 最多功能数量
[section .data]
; 功能调用指针列表
sys_function_list:
dd 0 ; 0内存管理
dd 0 ; 1进程管理
dd sys_msg ; 2进程通信
dd 0 ; 3文件系统
dd 0 ; 4网络
dd sys_GUI_API ; 5图形化用户界面
.end times (NUM_SYS_FUNCTION * 4) - (.end - sys_function_list) dd 0
[section .text]
[bits 32]
do_syscalls:
; 判断需要的功能是否超过了功能数量的限制
cmp eax,(NUM_SYS_FUNCTION - 1)
ja .end
; 根据EAX从系统调用列表中选择一个功能进行调用
; 重要:在这里EAX从功能号变成功能指令指针
mov eax,[((eax * 4) + sys_function_list)]
; 判断该功能的指令指针是否为NULL
cmp eax,0x0
jz .finish
push dword .finish ; 压入返回指针
; 返回跳转
push eax
ret
; 完成系统调用
.finish:
; 结束系统调用
.end:
popad ; 还原上下文
add esp,8 ; 恢复栈
iretd ; 中断返回
| 18.169492 | 82 | 0.679104 |
7a346297485aea957d73dad5e7d9aaf841554ff8 | 256 | asm | Assembly | programs/oeis/092/A092503.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/092/A092503.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/092/A092503.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A092503: a(n) = n^floor(n/2).
; 1,1,2,3,16,25,216,343,4096,6561,100000,161051,2985984,4826809,105413504,170859375,4294967296,6975757441,198359290368,322687697779,10240000000000,16679880978201,584318301411328,952809757913927
mov $1,$0
div $0,2
pow $1,$0
| 36.571429 | 193 | 0.78125 |
95e0489108426b6ba537954fb0e36e36744b9720 | 728 | nasm | Assembly | Projetos/J-VMTranslator/bin/nasm/SimpleGoto.nasm | gabrielvf1/Z01---Grupo-H | ef44894eb6a245c9b856802dd96ebe0051315602 | [
"Unlicense"
] | null | null | null | Projetos/J-VMTranslator/bin/nasm/SimpleGoto.nasm | gabrielvf1/Z01---Grupo-H | ef44894eb6a245c9b856802dd96ebe0051315602 | [
"Unlicense"
] | 77 | 2018-03-09T12:33:31.000Z | 2018-05-18T10:42:22.000Z | Projetos/J-VMTranslator/bin/nasm/SimpleGoto.nasm | gabrielvf1/Z01---Grupo-H | ef44894eb6a245c9b856802dd96ebe0051315602 | [
"Unlicense"
] | null | null | null | ; 0 - PUSH constant 5
leaw $5, %A
movw %A, %D
leaw $SP, %A
movw (%A), %A
movw %D, (%A)
leaw $SP, %A
movw (%A), %A
incw %A
movw %A, %D
leaw $SP, %A
movw %D, (%A)
; 1 - Goto Incondicional
leaw $scripts/../../I-VM/src/vmExamples/SimpleGoto-END2, %A
jmp
nop
; Label (marcador)
scripts/../../I-VM/src/vmExamples/SimpleGoto-DUMMY:
; 2 - PUSH constant 3
leaw $3, %A
movw %A, %D
leaw $SP, %A
movw (%A), %A
movw %D, (%A)
leaw $SP, %A
movw (%A), %A
incw %A
movw %A, %D
leaw $SP, %A
movw %D, (%A)
; Label (marcador)
scripts/../../I-VM/src/vmExamples/SimpleGoto-END2:
; 3 - POP temp 0
leaw $SP, %A
movw (%A), %A
decw %A
movw (%A), %D
leaw $5, %A
movw %D, (%A)
leaw $SP, %A
movw (%A), %A
decw %A
movw %A, %D
leaw $SP, %A
movw %D, (%A)
; End
| 15.489362 | 59 | 0.571429 |
98fe4b9e39cd2c59d53e8752ccddcc703e8c1dab | 896 | asm | Assembly | Assembler/AssemblyCode/LowLevel/RET_MACRO.asm | KPU-RISC/KPU | 9f85c322e1b8489eef31f0696799e0c6c7273c0e | [
"MIT"
] | 8 | 2017-04-16T16:53:03.000Z | 2021-09-14T22:29:28.000Z | Assembler/AssemblyCode/LowLevel/RET_MACRO.asm | KPU-RISC/KPU | 9f85c322e1b8489eef31f0696799e0c6c7273c0e | [
"MIT"
] | null | null | null | Assembler/AssemblyCode/LowLevel/RET_MACRO.asm | KPU-RISC/KPU | 9f85c322e1b8489eef31f0696799e0c6c7273c0e | [
"MIT"
] | null | null | null | ; Initialize the stack pointer
MOV8 XL, "11111111"
MOV8 XH, "11111111"
MOV16 SP, X
MOV8 F, "11110000"
; Call a subroutine...
CALL :SUBROUTINE
MOV8 F, "10101010"
; Stops program execution
HLT
:SUBROUTINE
MOV8 F, "01010101"
; ======================
; RET implementation...
; ======================
; 1. Increment the stack pointer by 1
MOV8 XL, "00000001"
MOV8 XH, "00000000"
MOV16 J, X
MOV16 X, SP
16BIT_ADDER
MOV16 SP, X
; 2. Load the bits 8 - 15 from the stack into the register XH,
; and cache it in register M
MOV16 M, SP
LOAD XH
MOV16 M, X
; 3. Increment the stack pointer by 1
MOV8 XL, "00000001"
MOV8 XH, "00000000"
MOV16 J, X
MOV16 X, SP
16BIT_ADDER
MOV16 SP, X
; 4. Load the bits 0 - 7 from the stack into the register XL
MOV16 X, M
MOV16 M, SP
LOAD XL
; 5. Transfer the POPed PC into the PC register to
; jump back to the callee...
MOV16 PC, X
; ============================ | 16.592593 | 63 | 0.641741 |
1755099fcabb830bbf528b63acbeab2e901c76ca | 436 | asm | Assembly | programs/oeis/188/A188434.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/188/A188434.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/188/A188434.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A188434: Positions of 0 in A188433; complement of A188435.
; 2,5,10,13,18,23,26,31,34,39,44,47,52,57,60,65,68,73,78,81,86,89,94,99,102,107,112,115,120,123,128,133,136,141,146,149,154,157,162,167,170,175,178,183,188,191,196,201,204,209,212,217,222,225,230,233,238,243,246,251,256,259,264,267,272,277,280
mov $2,$0
seq $0,130568 ; Generalized Beatty sequence 1+2*floor(n*phi), which contains infinitely many primes.
add $0,$2
add $0,1
| 54.5 | 243 | 0.724771 |
0fc45a0087c2ff20ba4d49fdcc8bf98878248c7f | 192 | asm | Assembly | libsrc/target/nc100/padinserial.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 640 | 2017-01-14T23:33:45.000Z | 2022-03-30T11:28:42.000Z | libsrc/target/nc100/padinserial.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 1,600 | 2017-01-15T16:12:02.000Z | 2022-03-31T12:11:12.000Z | libsrc/target/nc100/padinserial.asm | jpoikela/z88dk | 7108b2d7e3a98a77de99b30c9a7c9199da9c75cb | [
"ClArtistic"
] | 215 | 2017-01-17T10:43:03.000Z | 2022-03-23T17:25:02.000Z |
SECTION code_clib
PUBLIC padinserial
PUBLIC _padinserial
.padinserial
._padinserial
call 0xb85d
jr nc, nochar
ld h, 0
ld l, a
ret
nochar: ld hl, 0xffff
ret
| 12 | 33 | 0.645833 |
278739bdbb322f0648c92b40490d7058cd51999d | 341 | asm | Assembly | libsrc/ctype/isxdigit.asm | RC2014Z80/z88dk | e5b9447b970e5fae26544b6d8aa5957c98ba0e6a | [
"ClArtistic"
] | 8 | 2017-01-18T12:02:17.000Z | 2021-06-12T09:40:28.000Z | libsrc/ctype/isxdigit.asm | RC2014Z80/z88dk | e5b9447b970e5fae26544b6d8aa5957c98ba0e6a | [
"ClArtistic"
] | 1 | 2017-03-06T07:41:56.000Z | 2017-03-06T07:41:56.000Z | libsrc/ctype/isxdigit.asm | RC2014Z80/z88dk | e5b9447b970e5fae26544b6d8aa5957c98ba0e6a | [
"ClArtistic"
] | 3 | 2017-03-07T03:19:40.000Z | 2021-09-15T17:59:19.000Z | ;
; Small C+ z88 Character functions
; Written by Dominic Morris <djm@jb.man.ac.uk>
;
; 1/3/99 djm
;
; $Id: isxdigit.asm,v 1.7 2016-03-06 21:41:15 dom Exp $
;
SECTION code_clib
PUBLIC _isxdigit
PUBLIC isxdigit
EXTERN asm_isxdigit
; FASTCALL
._isxdigit
.isxdigit
ld a,l
call asm_isxdigit
ld hl,0
ret c
inc l
ret
| 13.115385 | 55 | 0.668622 |
79e8fd41e280c4352913c530b31f63de2b6c4b08 | 1,536 | asm | Assembly | Lab4/Lab4.asm | Kameron97/CMPE12 | 591962c848155c4f9f08f5dd55dce8abe263fb41 | [
"MIT"
] | null | null | null | Lab4/Lab4.asm | Kameron97/CMPE12 | 591962c848155c4f9f08f5dd55dce8abe263fb41 | [
"MIT"
] | null | null | null | Lab4/Lab4.asm | Kameron97/CMPE12 | 591962c848155c4f9f08f5dd55dce8abe263fb41 | [
"MIT"
] | null | null | null | ;Kameron Gill
;1476833
;kgill2@ucsc.edu
;Tues/Thurs 7-9PM
;Lab 4 : Cipher decryption
.ORIG x300
LEA R0, GREETINGS ;R0=>GREETING MESSAGE
PUTS ;PRINTS GREETING MESSAGE
;RESET ALL MEMORY COUNTERS
START R0, R0, #0
AND R1, R1, #0 ;FLAG
AND R2, R2, #0 ;INT
AND R3, R3, #0 COUNT
AND R4, R4, #0
AND R5, R5, #0
AND R6, R6, #0
AND R7, R7, #0 ;TEMP
LEA R0, TYPE ;R0=>D/ECRPYT QUESTION
PUTS ;PRINTS QUESTION
GETC ;INPUT
OUT
;DECREPT ENCRYPT OR EXIT CHECKERS
;ENCRYPT
LD R4, CHECKE ;R4=>-69
ADD R2, R0, R4 ;R2=INPUT(R0)+(-69)
BRz CIPHER ;IF R2==0 => CIPHER FUNCTION
;DECRYPT
LD R4, CHECKD ;R4=>-68
ADD R2, R0, R4 ;R2=INPUT+(-68)
BRz CIPHER
;EXIT
LD R4, CHECKX ;R4=>-88
ADD R2, R0, R4 ;R2=INPUT+(-88)
BRz EXIT ;R2==0 =>EXIT
;ERROR CHECK
BRnp START ;IF D E X NOT HIT, REPEAT
;ENCRYPT OR DECRYPT
FLAG1 ADD R1, R1, #1
ST R1, FLAG
AND R1, R1, 0
CIPHER LEA R0, WHATNUM ;R0 SET TO WHAT CIPHER #
PUTS ;PRINTS OUT QUESTION FOR CIPHER
NUMBER GETC ;GETS NEXT USER INPUT
OUT
LD R4, #-10 ;R4=> NEWLINE INVERT
ADD R2, R0, R4 ;R2+INPUT+-(-10)
BRz DECRYPT
;VARIABLES
ECHECK .FILL #-69 ;E
DCHECK .FILL #-68 ;D
XCHECK .FILL #-88 ;X
FLAG .FILL #0 ;FLAG
;STRINGS
GREETING STRINGZ "WELCOME TO LAB4"
TYPE .STRINGZ "Would you like to (E)ncrypt, (D)ecrpyt, or (X)it?"
WHATNUM .STRINGZ "Pick a cipher from 1-25"
REULT: "Here is your string and decrypted result:"
.END
| 20.210526 | 65 | 0.60026 |
1e6a2ae2d455f9a4c6fbbba774701a9db4a14115 | 784 | asm | Assembly | oeis/208/A208060.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/208/A208060.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/208/A208060.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A208060: a(n) = 1 + 2*n + 2^2*n*[n/2] + 2^3*n*[n/2]*[n/3] + 2^4*n*[n/2]*[n/3]*[n/4] + ... where [x]=floor(x).
; Submitted by Jon Maiga
; 1,3,13,43,233,611,4405,10515,64145,218755,1215821,2689083,28162105,61179795,307475813,1236997051,8042542625,17101581699,146671231501,309740445795,2415132010441,8877053064643,40919003272005,85564885298027,1068638260341937,2783025471994851,12542168429988861,43958782407189835,305471099364663065,632768001156443043,7013438436600829861,14494513173352889523,97277257146520741953,331047507544684590595,1449586813880699692797,4352318885037073651611,55845870408025090758505,114794362159958711341299
mov $3,$0
mul $3,2
lpb $3
sub $3,1
mov $2,$3
cmp $2,0
add $3,$2
add $4,1
mul $4,2
mov $5,$0
div $5,$3
mul $4,$5
lpe
mov $0,$4
add $0,1
| 39.2 | 492 | 0.751276 |
5b6a63c64ae479676c6291b0bbebc641e775db6e | 74 | asm | Assembly | gfx/pokemon/steelix/anim.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 28 | 2019-11-08T07:19:00.000Z | 2021-12-20T10:17:54.000Z | gfx/pokemon/steelix/anim.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 13 | 2020-01-11T17:00:40.000Z | 2021-09-14T01:27:38.000Z | gfx/pokemon/steelix/anim.asm | Dev727/ancientplatinum | 8b212a1728cc32a95743e1538b9eaa0827d013a7 | [
"blessing"
] | 22 | 2020-05-28T17:31:38.000Z | 2022-03-07T20:49:35.000Z | frame 1, 14
frame 2, 18
frame 3, 28
frame 2, 08
frame 1, 06
endanim
| 10.571429 | 12 | 0.635135 |
b841eca28e29403ebf992e2e7a5579e1bcdcc5f9 | 1,110 | asm | Assembly | programs/oeis/072/A072154.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/072/A072154.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | programs/oeis/072/A072154.asm | jmorken/loda | 99c09d2641e858b074f6344a352d13bc55601571 | [
"Apache-2.0"
] | null | null | null | ; A072154: Coordination sequence for the planar net 4.6.12.
; 1,3,5,7,9,12,15,17,19,21,24,27,29,31,33,36,39,41,43,45,48,51,53,55,57,60,63,65,67,69,72,75,77,79,81,84,87,89,91,93,96,99,101,103,105,108,111,113,115,117,120,123,125,127,129,132,135,137,139,141,144,147,149,151,153,156,159,161,163,165,168,171,173,175,177,180,183,185,187,189,192,195,197,199,201,204,207,209,211,213,216,219,221,223,225,228,231,233,235,237,240,243,245,247,249,252,255,257,259,261,264,267,269,271,273,276,279,281,283,285,288,291,293,295,297,300,303,305,307,309,312,315,317,319,321,324,327,329,331,333,336,339,341,343,345,348,351,353,355,357,360,363,365,367,369,372,375,377,379,381,384,387,389,391,393,396,399,401,403,405,408,411,413,415,417,420,423,425,427,429,432,435,437,439,441,444,447,449,451,453,456,459,461,463,465,468,471,473,475,477,480,483,485,487,489,492,495,497,499,501,504,507,509,511,513,516,519,521,523,525,528,531,533,535,537,540,543,545,547,549,552,555,557,559,561,564,567,569,571,573,576,579,581,583,585,588,591,593,595,597
mov $1,1
mov $3,$0
add $3,4
mov $2,$3
lpb $0
sub $0,1
trn $1,$2
add $1,3
trn $2,5
lpe
| 79.285714 | 954 | 0.717117 |
887a6cde01db79601f7ee321e77e056273a8c472 | 812 | asm | Assembly | programs/oeis/113/A113047.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/113/A113047.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/113/A113047.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A113047: a(n) = C(3n,n)/(2n+1) mod 3.
; 1,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
mov $2,$0
mov $3,1
mov $5,2
lpb $3,1
add $0,$2
lpb $5,1
add $6,$0
mov $0,$6
sub $5,$3
lpe
add $3,1
add $6,1
lpb $6,1
mov $1,$3
mul $3,2
mov $4,$1
trn $6,$3
add $3,$1
sub $4,$0
lpe
sub $3,$3
trn $4,1
mov $1,$4
lpe
| 29 | 501 | 0.472906 |
c40d17a78f9915beaaed8fde45fa54ca1028b51e | 15,403 | asm | Assembly | Games/Quake II/quake2-3.21/ref_soft/r_surf8.asm | TwTravel/3dGameGuru | 50f204da32b7d3ddcbdb0daf140d503eac424153 | [
"Unlicense"
] | null | null | null | Games/Quake II/quake2-3.21/ref_soft/r_surf8.asm | TwTravel/3dGameGuru | 50f204da32b7d3ddcbdb0daf140d503eac424153 | [
"Unlicense"
] | 1 | 2019-12-10T15:47:15.000Z | 2019-12-10T15:47:15.000Z | Games/Quake II/quake2-3.21/ref_soft/r_surf8.asm | TwTravel/3dGameGuru | 50f204da32b7d3ddcbdb0daf140d503eac424153 | [
"Unlicense"
] | null | null | null | .386P
.model FLAT
;
; surf8.s
; x86 assembly-language 8 bpp surface block drawing code.
;
include qasm.inc
if id386
_DATA SEGMENT
sb_v dd 0
_DATA ENDS
_TEXT SEGMENT
align 4
public _R_Surf8Start
_R_Surf8Start:
;----------------------------------------------------------------------
; Surface block drawer for mip level 0
;----------------------------------------------------------------------
align 4
public _R_DrawSurfaceBlock8_mip0
_R_DrawSurfaceBlock8_mip0:
push ebp ; preserve caller's stack frame
push edi
push esi ; preserve register variables
push ebx
; for (v=0 ; v<numvblocks ; v++)
; {
mov ebx,ds:dword ptr[_r_lightptr]
mov eax,ds:dword ptr[_r_numvblocks]
mov ds:dword ptr[sb_v],eax
mov edi,ds:dword ptr[_prowdestbase]
mov esi,ds:dword ptr[_pbasesource]
Lv_loop_mip0:
; lightleft = lightptr[0];
; lightright = lightptr[1];
; lightdelta = (lightleft - lightright) & 0xFFFFF;
mov eax,ds:dword ptr[ebx] ; lightleft
mov edx,ds:dword ptr[4+ebx] ; lightright
mov ebp,eax
mov ecx,ds:dword ptr[_r_lightwidth]
mov ds:dword ptr[_lightright],edx
sub ebp,edx
and ebp,0FFFFFh
lea ebx,ds:dword ptr[ebx+ecx*4]
; lightptr += lightwidth;
mov ds:dword ptr[_r_lightptr],ebx
; lightleftstep = (lightptr[0] - lightleft) >> blockdivshift;
; lightrightstep = (lightptr[1] - lightright) >> blockdivshift;
; lightdeltastep = ((lightleftstep - lightrightstep) & 0xFFFFF) |
; 0xF0000000;
mov ecx,ds:dword ptr[4+ebx] ; lightptr[1]
mov ebx,ds:dword ptr[ebx] ; lightptr[0]
sub ebx,eax
sub ecx,edx
sar ecx,4
or ebp,0F0000000h
sar ebx,4
mov ds:dword ptr[_lightrightstep],ecx
sub ebx,ecx
and ebx,0FFFFFh
or ebx,0F0000000h
sub ecx,ecx ; high word must be 0 in loop for addressing
mov ds:dword ptr[_lightdeltastep],ebx
sub ebx,ebx ; high word must be 0 in loop for addressing
Lblockloop8_mip0:
mov ds:dword ptr[_lightdelta],ebp
mov cl,ds:byte ptr[14+esi]
sar ebp,4
mov bh,dh
mov bl,ds:byte ptr[15+esi]
add edx,ebp
mov ch,dh
add edx,ebp
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch0:
mov bl,ds:byte ptr[13+esi]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch1:
mov cl,ds:byte ptr[12+esi]
mov bh,dh
add edx,ebp
ror eax,16
mov ch,dh
add edx,ebp
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch2:
mov bl,ds:byte ptr[11+esi]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch3:
mov cl,ds:byte ptr[10+esi]
mov ds:dword ptr[12+edi],eax
mov bh,dh
add edx,ebp
mov ch,dh
add edx,ebp
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch4:
mov bl,ds:byte ptr[9+esi]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch5:
mov cl,ds:byte ptr[8+esi]
mov bh,dh
add edx,ebp
ror eax,16
mov ch,dh
add edx,ebp
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch6:
mov bl,ds:byte ptr[7+esi]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch7:
mov cl,ds:byte ptr[6+esi]
mov ds:dword ptr[8+edi],eax
mov bh,dh
add edx,ebp
mov ch,dh
add edx,ebp
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch8:
mov bl,ds:byte ptr[5+esi]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch9:
mov cl,ds:byte ptr[4+esi]
mov bh,dh
add edx,ebp
ror eax,16
mov ch,dh
add edx,ebp
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch10:
mov bl,ds:byte ptr[3+esi]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch11:
mov cl,ds:byte ptr[2+esi]
mov ds:dword ptr[4+edi],eax
mov bh,dh
add edx,ebp
mov ch,dh
add edx,ebp
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch12:
mov bl,ds:byte ptr[1+esi]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch13:
mov cl,ds:byte ptr[esi]
mov bh,dh
add edx,ebp
ror eax,16
mov ch,dh
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch14:
mov edx,ds:dword ptr[_lightright]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch15:
mov ebp,ds:dword ptr[_lightdelta]
mov ds:dword ptr[edi],eax
add esi,ds:dword ptr[_sourcetstep]
add edi,ds:dword ptr[_surfrowbytes]
add edx,ds:dword ptr[_lightrightstep]
add ebp,ds:dword ptr[_lightdeltastep]
mov ds:dword ptr[_lightright],edx
jc Lblockloop8_mip0
; if (pbasesource >= r_sourcemax)
; pbasesource -= stepback;
cmp esi,ds:dword ptr[_r_sourcemax]
jb LSkip_mip0
sub esi,ds:dword ptr[_r_stepback]
LSkip_mip0:
mov ebx,ds:dword ptr[_r_lightptr]
dec ds:dword ptr[sb_v]
jnz Lv_loop_mip0
pop ebx ; restore register variables
pop esi
pop edi
pop ebp ; restore the caller's stack frame
ret
;----------------------------------------------------------------------
; Surface block drawer for mip level 1
;----------------------------------------------------------------------
align 4
public _R_DrawSurfaceBlock8_mip1
_R_DrawSurfaceBlock8_mip1:
push ebp ; preserve caller's stack frame
push edi
push esi ; preserve register variables
push ebx
; for (v=0 ; v<numvblocks ; v++)
; {
mov ebx,ds:dword ptr[_r_lightptr]
mov eax,ds:dword ptr[_r_numvblocks]
mov ds:dword ptr[sb_v],eax
mov edi,ds:dword ptr[_prowdestbase]
mov esi,ds:dword ptr[_pbasesource]
Lv_loop_mip1:
; lightleft = lightptr[0];
; lightright = lightptr[1];
; lightdelta = (lightleft - lightright) & 0xFFFFF;
mov eax,ds:dword ptr[ebx] ; lightleft
mov edx,ds:dword ptr[4+ebx] ; lightright
mov ebp,eax
mov ecx,ds:dword ptr[_r_lightwidth]
mov ds:dword ptr[_lightright],edx
sub ebp,edx
and ebp,0FFFFFh
lea ebx,ds:dword ptr[ebx+ecx*4]
; lightptr += lightwidth;
mov ds:dword ptr[_r_lightptr],ebx
; lightleftstep = (lightptr[0] - lightleft) >> blockdivshift;
; lightrightstep = (lightptr[1] - lightright) >> blockdivshift;
; lightdeltastep = ((lightleftstep - lightrightstep) & 0xFFFFF) |
; 0xF0000000;
mov ecx,ds:dword ptr[4+ebx] ; lightptr[1]
mov ebx,ds:dword ptr[ebx] ; lightptr[0]
sub ebx,eax
sub ecx,edx
sar ecx,3
or ebp,070000000h
sar ebx,3
mov ds:dword ptr[_lightrightstep],ecx
sub ebx,ecx
and ebx,0FFFFFh
or ebx,0F0000000h
sub ecx,ecx ; high word must be 0 in loop for addressing
mov ds:dword ptr[_lightdeltastep],ebx
sub ebx,ebx ; high word must be 0 in loop for addressing
Lblockloop8_mip1:
mov ds:dword ptr[_lightdelta],ebp
mov cl,ds:byte ptr[6+esi]
sar ebp,3
mov bh,dh
mov bl,ds:byte ptr[7+esi]
add edx,ebp
mov ch,dh
add edx,ebp
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch22:
mov bl,ds:byte ptr[5+esi]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch23:
mov cl,ds:byte ptr[4+esi]
mov bh,dh
add edx,ebp
ror eax,16
mov ch,dh
add edx,ebp
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch24:
mov bl,ds:byte ptr[3+esi]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch25:
mov cl,ds:byte ptr[2+esi]
mov ds:dword ptr[4+edi],eax
mov bh,dh
add edx,ebp
mov ch,dh
add edx,ebp
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch26:
mov bl,ds:byte ptr[1+esi]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch27:
mov cl,ds:byte ptr[esi]
mov bh,dh
add edx,ebp
ror eax,16
mov ch,dh
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch28:
mov edx,ds:dword ptr[_lightright]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch29:
mov ebp,ds:dword ptr[_lightdelta]
mov ds:dword ptr[edi],eax
mov eax,ds:dword ptr[_sourcetstep]
add esi,eax
mov eax,ds:dword ptr[_surfrowbytes]
add edi,eax
mov eax,ds:dword ptr[_lightrightstep]
add edx,eax
mov eax,ds:dword ptr[_lightdeltastep]
add ebp,eax
mov ds:dword ptr[_lightright],edx
jc Lblockloop8_mip1
; if (pbasesource >= r_sourcemax)
; pbasesource -= stepback;
cmp esi,ds:dword ptr[_r_sourcemax]
jb LSkip_mip1
sub esi,ds:dword ptr[_r_stepback]
LSkip_mip1:
mov ebx,ds:dword ptr[_r_lightptr]
dec ds:dword ptr[sb_v]
jnz Lv_loop_mip1
pop ebx ; restore register variables
pop esi
pop edi
pop ebp ; restore the caller's stack frame
ret
;----------------------------------------------------------------------
; Surface block drawer for mip level 2
;----------------------------------------------------------------------
align 4
public _R_DrawSurfaceBlock8_mip2
_R_DrawSurfaceBlock8_mip2:
push ebp ; preserve caller's stack frame
push edi
push esi ; preserve register variables
push ebx
; for (v=0 ; v<numvblocks ; v++)
; {
mov ebx,ds:dword ptr[_r_lightptr]
mov eax,ds:dword ptr[_r_numvblocks]
mov ds:dword ptr[sb_v],eax
mov edi,ds:dword ptr[_prowdestbase]
mov esi,ds:dword ptr[_pbasesource]
Lv_loop_mip2:
; lightleft = lightptr[0];
; lightright = lightptr[1];
; lightdelta = (lightleft - lightright) & 0xFFFFF;
mov eax,ds:dword ptr[ebx] ; lightleft
mov edx,ds:dword ptr[4+ebx] ; lightright
mov ebp,eax
mov ecx,ds:dword ptr[_r_lightwidth]
mov ds:dword ptr[_lightright],edx
sub ebp,edx
and ebp,0FFFFFh
lea ebx,ds:dword ptr[ebx+ecx*4]
; lightptr += lightwidth;
mov ds:dword ptr[_r_lightptr],ebx
; lightleftstep = (lightptr[0] - lightleft) >> blockdivshift;
; lightrightstep = (lightptr[1] - lightright) >> blockdivshift;
; lightdeltastep = ((lightleftstep - lightrightstep) & 0xFFFFF) |
; 0xF0000000;
mov ecx,ds:dword ptr[4+ebx] ; lightptr[1]
mov ebx,ds:dword ptr[ebx] ; lightptr[0]
sub ebx,eax
sub ecx,edx
sar ecx,2
or ebp,030000000h
sar ebx,2
mov ds:dword ptr[_lightrightstep],ecx
sub ebx,ecx
and ebx,0FFFFFh
or ebx,0F0000000h
sub ecx,ecx ; high word must be 0 in loop for addressing
mov ds:dword ptr[_lightdeltastep],ebx
sub ebx,ebx ; high word must be 0 in loop for addressing
Lblockloop8_mip2:
mov ds:dword ptr[_lightdelta],ebp
mov cl,ds:byte ptr[2+esi]
sar ebp,2
mov bh,dh
mov bl,ds:byte ptr[3+esi]
add edx,ebp
mov ch,dh
add edx,ebp
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch18:
mov bl,ds:byte ptr[1+esi]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch19:
mov cl,ds:byte ptr[esi]
mov bh,dh
add edx,ebp
ror eax,16
mov ch,dh
mov ah,ds:byte ptr[12345678h+ebx]
LBPatch20:
mov edx,ds:dword ptr[_lightright]
mov al,ds:byte ptr[12345678h+ecx]
LBPatch21:
mov ebp,ds:dword ptr[_lightdelta]
mov ds:dword ptr[edi],eax
mov eax,ds:dword ptr[_sourcetstep]
add esi,eax
mov eax,ds:dword ptr[_surfrowbytes]
add edi,eax
mov eax,ds:dword ptr[_lightrightstep]
add edx,eax
mov eax,ds:dword ptr[_lightdeltastep]
add ebp,eax
mov ds:dword ptr[_lightright],edx
jc Lblockloop8_mip2
; if (pbasesource >= r_sourcemax)
; pbasesource -= stepback;
cmp esi,ds:dword ptr[_r_sourcemax]
jb LSkip_mip2
sub esi,ds:dword ptr[_r_stepback]
LSkip_mip2:
mov ebx,ds:dword ptr[_r_lightptr]
dec ds:dword ptr[sb_v]
jnz Lv_loop_mip2
pop ebx ; restore register variables
pop esi
pop edi
pop ebp ; restore the caller's stack frame
ret
;----------------------------------------------------------------------
; Surface block drawer for mip level 3
;----------------------------------------------------------------------
align 4
public _R_DrawSurfaceBlock8_mip3
_R_DrawSurfaceBlock8_mip3:
push ebp ; preserve caller's stack frame
push edi
push esi ; preserve register variables
push ebx
; for (v=0 ; v<numvblocks ; v++)
; {
mov ebx,ds:dword ptr[_r_lightptr]
mov eax,ds:dword ptr[_r_numvblocks]
mov ds:dword ptr[sb_v],eax
mov edi,ds:dword ptr[_prowdestbase]
mov esi,ds:dword ptr[_pbasesource]
Lv_loop_mip3:
; lightleft = lightptr[0];
; lightright = lightptr[1];
; lightdelta = (lightleft - lightright) & 0xFFFFF;
mov eax,ds:dword ptr[ebx] ; lightleft
mov edx,ds:dword ptr[4+ebx] ; lightright
mov ebp,eax
mov ecx,ds:dword ptr[_r_lightwidth]
mov ds:dword ptr[_lightright],edx
sub ebp,edx
and ebp,0FFFFFh
lea ebx,ds:dword ptr[ebx+ecx*4]
mov ds:dword ptr[_lightdelta],ebp
; lightptr += lightwidth;
mov ds:dword ptr[_r_lightptr],ebx
; lightleftstep = (lightptr[0] - lightleft) >> blockdivshift;
; lightrightstep = (lightptr[1] - lightright) >> blockdivshift;
; lightdeltastep = ((lightleftstep - lightrightstep) & 0xFFFFF) |
; 0xF0000000;
mov ecx,ds:dword ptr[4+ebx] ; lightptr[1]
mov ebx,ds:dword ptr[ebx] ; lightptr[0]
sub ebx,eax
sub ecx,edx
sar ecx,1
sar ebx,1
mov ds:dword ptr[_lightrightstep],ecx
sub ebx,ecx
and ebx,0FFFFFh
sar ebp,1
or ebx,0F0000000h
mov ds:dword ptr[_lightdeltastep],ebx
sub ebx,ebx ; high word must be 0 in loop for addressing
mov bl,ds:byte ptr[1+esi]
sub ecx,ecx ; high word must be 0 in loop for addressing
mov bh,dh
mov cl,ds:byte ptr[esi]
add edx,ebp
mov ch,dh
mov al,ds:byte ptr[12345678h+ebx]
LBPatch16:
mov edx,ds:dword ptr[_lightright]
mov ds:byte ptr[1+edi],al
mov al,ds:byte ptr[12345678h+ecx]
LBPatch17:
mov ds:byte ptr[edi],al
mov eax,ds:dword ptr[_sourcetstep]
add esi,eax
mov eax,ds:dword ptr[_surfrowbytes]
add edi,eax
mov eax,ds:dword ptr[_lightdeltastep]
mov ebp,ds:dword ptr[_lightdelta]
mov cl,ds:byte ptr[esi]
add ebp,eax
mov eax,ds:dword ptr[_lightrightstep]
sar ebp,1
add edx,eax
mov bh,dh
mov bl,ds:byte ptr[1+esi]
add edx,ebp
mov ch,dh
mov al,ds:byte ptr[12345678h+ebx]
LBPatch30:
mov edx,ds:dword ptr[_sourcetstep]
mov ds:byte ptr[1+edi],al
mov al,ds:byte ptr[12345678h+ecx]
LBPatch31:
mov ds:byte ptr[edi],al
mov ebp,ds:dword ptr[_surfrowbytes]
add esi,edx
add edi,ebp
; if (pbasesource >= r_sourcemax)
; pbasesource -= stepback;
cmp esi,ds:dword ptr[_r_sourcemax]
jb LSkip_mip3
sub esi,ds:dword ptr[_r_stepback]
LSkip_mip3:
mov ebx,ds:dword ptr[_r_lightptr]
dec ds:dword ptr[sb_v]
jnz Lv_loop_mip3
pop ebx ; restore register variables
pop esi
pop edi
pop ebp ; restore the caller's stack frame
ret
public _R_Surf8End
_R_Surf8End:
;----------------------------------------------------------------------
; Code patching routines
;----------------------------------------------------------------------
_TEXT ENDS
_DATA SEGMENT
align 4
LPatchTable8:
dd LBPatch0-4
dd LBPatch1-4
dd LBPatch2-4
dd LBPatch3-4
dd LBPatch4-4
dd LBPatch5-4
dd LBPatch6-4
dd LBPatch7-4
dd LBPatch8-4
dd LBPatch9-4
dd LBPatch10-4
dd LBPatch11-4
dd LBPatch12-4
dd LBPatch13-4
dd LBPatch14-4
dd LBPatch15-4
dd LBPatch16-4
dd LBPatch17-4
dd LBPatch18-4
dd LBPatch19-4
dd LBPatch20-4
dd LBPatch21-4
dd LBPatch22-4
dd LBPatch23-4
dd LBPatch24-4
dd LBPatch25-4
dd LBPatch26-4
dd LBPatch27-4
dd LBPatch28-4
dd LBPatch29-4
dd LBPatch30-4
dd LBPatch31-4
_DATA ENDS
_TEXT SEGMENT
align 4
public _R_Surf8Patch
_R_Surf8Patch:
push ebx
mov eax,ds:dword ptr[_colormap]
mov ebx,offset LPatchTable8
mov ecx,32
LPatchLoop8:
mov edx,ds:dword ptr[ebx]
add ebx,4
mov ds:dword ptr[edx],eax
dec ecx
jnz LPatchLoop8
pop ebx
ret
_TEXT ENDS
endif ;id386
END
| 19.952073 | 72 | 0.630202 |
0aed54338e18ef9a01bc72e6b369cee64f6b2d52 | 190,502 | asm | Assembly | Palmtree.Math.Core.Implements/vs_build/x64_Debug/pmc_parse.asm | rougemeilland/Palmtree.Math.Core.Implements | 52f4f6c765d16c9b0baf1fd212c61a33daae138c | [
"MIT"
] | null | null | null | Palmtree.Math.Core.Implements/vs_build/x64_Debug/pmc_parse.asm | rougemeilland/Palmtree.Math.Core.Implements | 52f4f6c765d16c9b0baf1fd212c61a33daae138c | [
"MIT"
] | null | null | null | Palmtree.Math.Core.Implements/vs_build/x64_Debug/pmc_parse.asm | rougemeilland/Palmtree.Math.Core.Implements | 52f4f6c765d16c9b0baf1fd212c61a33daae138c | [
"MIT"
] | null | null | null | ; Listing generated by Microsoft (R) Optimizing Compiler Version 19.16.27026.1
include listing.inc
INCLUDELIB MSVCRTD
INCLUDELIB OLDNAMES
msvcjmc SEGMENT
__7B7A869E_ctype@h DB 01H
__457DD326_basetsd@h DB 01H
__4384A2D9_corecrt_memcpy_s@h DB 01H
__4E51A221_corecrt_wstring@h DB 01H
__2140C079_string@h DB 01H
__1887E595_winnt@h DB 01H
__9FC7C64B_processthreadsapi@h DB 01H
__FA470AEC_memoryapi@h DB 01H
__F37DAFF1_winerror@h DB 01H
__7A450CCC_winbase@h DB 01H
__B4B40122_winioctl@h DB 01H
__86261D59_stralign@h DB 01H
__7B8DBFC3_pmc_uint_internal@h DB 01H
__6B0481B0_pmc_inline_func@h DB 01H
__C5BBD3C1_pmc_parse@c DB 01H
msvcjmc ENDS
PUBLIC Initialize_Parse
PUBLIC PMC_TryParse
PUBLIC __JustMyCode_Default
PUBLIC ??_C@_13DEFPDAGF@?$AA?0@ ; `string'
PUBLIC ??_C@_13JOFGPIOO@?$AA?4@ ; `string'
PUBLIC ??_C@_01EKENIIDA@3@ ; `string'
PUBLIC ??_C@_13KJIIAINM@?$AA?$CL@ ; `string'
PUBLIC ??_C@_13IMODFHAA@?$AA?9@ ; `string'
EXTRN __imp_lstrcpyA:PROC
EXTRN __imp_lstrcpyW:PROC
EXTRN __imp_lstrlenW:PROC
EXTRN AllocateBlock:PROC
EXTRN DeallocateBlock:PROC
EXTRN CheckBlockLight:PROC
EXTRN AllocateNumber:PROC
EXTRN DeallocateNumber:PROC
EXTRN CommitNumber:PROC
EXTRN CheckNumber:PROC
EXTRN _RTC_CheckStackVars:PROC
EXTRN _RTC_InitBase:PROC
EXTRN _RTC_Shutdown:PROC
EXTRN __CheckForDebuggerJustMyCode:PROC
EXTRN __GSHandlerCheck:PROC
EXTRN __security_check_cookie:PROC
EXTRN number_zero:BYTE
EXTRN statistics_info:BYTE
EXTRN __ImageBase:BYTE
EXTRN __security_cookie:QWORD
_BSS SEGMENT
default_number_format_option DB 028H DUP (?)
fp_MultiplyAndAdd DQ 01H DUP (?)
_BSS ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$Initialize_Parse DD imagerel $LN5
DD imagerel $LN5+243
DD imagerel $unwind$Initialize_Parse
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$PMC_TryParse DD imagerel $LN12
DD imagerel $LN12+348
DD imagerel $unwind$PMC_TryParse
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$IncrementMULTI32Counter DD imagerel IncrementMULTI32Counter
DD imagerel IncrementMULTI32Counter+62
DD imagerel $unwind$IncrementMULTI32Counter
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$IncrementMULTI64Counter DD imagerel IncrementMULTI64Counter
DD imagerel IncrementMULTI64Counter+62
DD imagerel $unwind$IncrementMULTI64Counter
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$AddToMULTI32Counter DD imagerel AddToMULTI32Counter
DD imagerel AddToMULTI32Counter+78
DD imagerel $unwind$AddToMULTI32Counter
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$AddToMULTI64Counter DD imagerel AddToMULTI64Counter
DD imagerel AddToMULTI64Counter+78
DD imagerel $unwind$AddToMULTI64Counter
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_COPY_MEMORY_UNIT DD imagerel _COPY_MEMORY_UNIT
DD imagerel _COPY_MEMORY_UNIT+100
DD imagerel $unwind$_COPY_MEMORY_UNIT
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_DIVIDE_CEILING_UNIT DD imagerel _DIVIDE_CEILING_UNIT
DD imagerel _DIVIDE_CEILING_UNIT+97
DD imagerel $unwind$_DIVIDE_CEILING_UNIT
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_DIVIDE_CEILING_SIZE DD imagerel _DIVIDE_CEILING_SIZE
DD imagerel _DIVIDE_CEILING_SIZE+97
DD imagerel $unwind$_DIVIDE_CEILING_SIZE
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_ADD_UNIT DD imagerel _ADD_UNIT
DD imagerel _ADD_UNIT+118
DD imagerel $unwind$_ADD_UNIT
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_ADDX_UNIT DD imagerel _ADDX_UNIT
DD imagerel _ADDX_UNIT+121
DD imagerel $unwind$_ADDX_UNIT
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_MULTIPLY_UNIT DD imagerel _MULTIPLY_UNIT
DD imagerel _MULTIPLY_UNIT+118
DD imagerel $unwind$_MULTIPLY_UNIT
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$_MULTIPLYX_UNIT DD imagerel _MULTIPLYX_UNIT
DD imagerel _MULTIPLYX_UNIT+103
DD imagerel $unwind$_MULTIPLYX_UNIT
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$StartsWith DD imagerel StartsWith
DD imagerel StartsWith+154
DD imagerel $unwind$StartsWith
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$InitializeParserState DD imagerel InitializeParserState
DD imagerel InitializeParserState+561
DD imagerel $unwind$InitializeParserState
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$FinalizeParserState DD imagerel FinalizeParserState
DD imagerel FinalizeParserState+113
DD imagerel $unwind$FinalizeParserState
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$SkipSpace DD imagerel SkipSpace
DD imagerel SkipSpace+142
DD imagerel $unwind$SkipSpace
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$ParseAsIntegerPartNumberSequence DD imagerel ParseAsIntegerPartNumberSequence
DD imagerel ParseAsIntegerPartNumberSequence+650
DD imagerel $unwind$ParseAsIntegerPartNumberSequence
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$ParseAsFractionPartNumberSequence DD imagerel ParseAsFractionPartNumberSequence
DD imagerel ParseAsFractionPartNumberSequence+460
DD imagerel $unwind$ParseAsFractionPartNumberSequence
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$ParseAsDecimalNumberString DD imagerel ParseAsDecimalNumberString
DD imagerel ParseAsDecimalNumberString+1133
DD imagerel $unwind$ParseAsDecimalNumberString
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$ParseAsHexNumberString DD imagerel ParseAsHexNumberString
DD imagerel ParseAsHexNumberString+265
DD imagerel $unwind$ParseAsHexNumberString
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$BuildLeading1WordFromDecimalString DD imagerel BuildLeading1WordFromDecimalString
DD imagerel BuildLeading1WordFromDecimalString+156
DD imagerel $unwind$BuildLeading1WordFromDecimalString
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$Build1WordFromDecimalString DD imagerel Build1WordFromDecimalString
DD imagerel Build1WordFromDecimalString+969
DD imagerel $unwind$Build1WordFromDecimalString
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$BuildBinaryFromDecimalString DD imagerel BuildBinaryFromDecimalString
DD imagerel BuildBinaryFromDecimalString+347
DD imagerel $unwind$BuildBinaryFromDecimalString
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$MultiplyAndAdd1Word_using_ADC_MUL DD imagerel MultiplyAndAdd1Word_using_ADC_MUL
DD imagerel MultiplyAndAdd1Word_using_ADC_MUL+188
DD imagerel $unwind$MultiplyAndAdd1Word_using_ADC_MUL
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$MultiplyAndAdd1Word_using_ADCX_MULX DD imagerel MultiplyAndAdd1Word_using_ADCX_MULX
DD imagerel MultiplyAndAdd1Word_using_ADCX_MULX+188
DD imagerel $unwind$MultiplyAndAdd1Word_using_ADCX_MULX
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$MultiplyAndAdd_using_ADC_MUL DD imagerel MultiplyAndAdd_using_ADC_MUL
DD imagerel MultiplyAndAdd_using_ADC_MUL+4203
DD imagerel $unwind$MultiplyAndAdd_using_ADC_MUL
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$MultiplyAndAdd_using_ADCX_MULX DD imagerel MultiplyAndAdd_using_ADCX_MULX
DD imagerel MultiplyAndAdd_using_ADCX_MULX+4203
DD imagerel $unwind$MultiplyAndAdd_using_ADCX_MULX
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$ConvertCardinalNumber DD imagerel ConvertCardinalNumber
DD imagerel ConvertCardinalNumber+404
DD imagerel $unwind$ConvertCardinalNumber
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$TryParseDN DD imagerel TryParseDN
DD imagerel TryParseDN+1565
DD imagerel $unwind$TryParseDN
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$Parse1DigitFromHexChar DD imagerel Parse1DigitFromHexChar
DD imagerel Parse1DigitFromHexChar+247
DD imagerel $unwind$Parse1DigitFromHexChar
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$BuildLeading1WordFromHexString DD imagerel BuildLeading1WordFromHexString
DD imagerel BuildLeading1WordFromHexString+222
DD imagerel $unwind$BuildLeading1WordFromHexString
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$Build1WordFromHexString DD imagerel Build1WordFromHexString
DD imagerel Build1WordFromHexString+1121
DD imagerel $unwind$Build1WordFromHexString
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$BuildBinaryFromHexString DD imagerel BuildBinaryFromHexString
DD imagerel BuildBinaryFromHexString+332
DD imagerel $unwind$BuildBinaryFromHexString
pdata ENDS
; COMDAT pdata
pdata SEGMENT
$pdata$TryParseX DD imagerel TryParseX
DD imagerel TryParseX+485
DD imagerel $unwind$TryParseX
pdata ENDS
; COMDAT rtc$TMZ
rtc$TMZ SEGMENT
_RTC_Shutdown.rtc$TMZ DQ FLAT:_RTC_Shutdown
rtc$TMZ ENDS
; COMDAT rtc$IMZ
rtc$IMZ SEGMENT
_RTC_InitBase.rtc$IMZ DQ FLAT:_RTC_InitBase
rtc$IMZ ENDS
; COMDAT ??_C@_13IMODFHAA@?$AA?9@
CONST SEGMENT
??_C@_13IMODFHAA@?$AA?9@ DB '-', 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_13KJIIAINM@?$AA?$CL@
CONST SEGMENT
??_C@_13KJIIAINM@?$AA?$CL@ DB '+', 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_01EKENIIDA@3@
CONST SEGMENT
??_C@_01EKENIIDA@3@ DB '3', 00H ; `string'
CONST ENDS
; COMDAT ??_C@_13JOFGPIOO@?$AA?4@
CONST SEGMENT
??_C@_13JOFGPIOO@?$AA?4@ DB '.', 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT ??_C@_13DEFPDAGF@?$AA?0@
CONST SEGMENT
??_C@_13DEFPDAGF@?$AA?0@ DB ',', 00H, 00H, 00H ; `string'
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$TryParseX DD 025053801H
DD 011c2321H
DD 07015003dH
DD 05014H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
TryParseX$rtcName$0 DB 069H
DB 06eH
DB 074H
DB 05fH
DB 070H
DB 061H
DB 072H
DB 074H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 063H
DB 06fH
DB 064H
DB 065H
DB 00H
ORG $+6
TryParseX$rtcName$1 DB 069H
DB 06eH
DB 074H
DB 05fH
DB 070H
DB 061H
DB 072H
DB 074H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 077H
DB 06fH
DB 072H
DB 064H
DB 073H
DB 00H
ORG $+5
TryParseX$rtcName$2 DB 06fH
DB 05fH
DB 06cH
DB 069H
DB 067H
DB 068H
DB 074H
DB 05fH
DB 063H
DB 068H
DB 065H
DB 063H
DB 06bH
DB 05fH
DB 063H
DB 06fH
DB 064H
DB 065H
DB 00H
ORG $+13
TryParseX$rtcVarDesc DD 0108H
DD 08H
DQ FLAT:TryParseX$rtcName$2
DD 088H
DD 08H
DQ FLAT:TryParseX$rtcName$1
DD 068H
DD 08H
DQ FLAT:TryParseX$rtcName$0
ORG $+144
TryParseX$rtcFrameData DD 03H
DD 00H
DQ FLAT:TryParseX$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$BuildBinaryFromHexString DD 025052f01H
DD 01132318H
DD 0700c0031H
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$Build1WordFromHexString DD 025052a01H
DD 010e2313H
DD 070070021H
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$BuildLeading1WordFromHexString DD 025052f01H
DD 01132318H
DD 0700c0021H
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$Parse1DigitFromHexChar DD 025052a01H
DD 010e2313H
DD 07007001fH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$TryParseDN DD 035053801H
DD 011c3321H
DD 070150087H
DD 05014H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
TryParseDN$rtcName$0 DB 069H
DB 06eH
DB 074H
DB 05fH
DB 070H
DB 061H
DB 072H
DB 074H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 063H
DB 06fH
DB 064H
DB 065H
DB 00H
ORG $+6
TryParseDN$rtcName$1 DB 069H
DB 06eH
DB 074H
DB 05fH
DB 070H
DB 061H
DB 072H
DB 074H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 077H
DB 06fH
DB 072H
DB 064H
DB 073H
DB 00H
ORG $+5
TryParseDN$rtcName$2 DB 066H
DB 072H
DB 061H
DB 063H
DB 05fH
DB 070H
DB 061H
DB 072H
DB 074H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 063H
DB 06fH
DB 064H
DB 065H
DB 00H
ORG $+5
TryParseDN$rtcName$3 DB 066H
DB 072H
DB 061H
DB 063H
DB 05fH
DB 070H
DB 061H
DB 072H
DB 074H
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 077H
DB 06fH
DB 072H
DB 064H
DB 073H
DB 00H
TryParseDN$rtcName$4 DB 073H
DB 069H
DB 067H
DB 06eH
DB 00H
ORG $+7
TryParseDN$rtcName$5 DB 062H
DB 069H
DB 06eH
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 063H
DB 06fH
DB 064H
DB 065H
DB 00H
ORG $+3
TryParseDN$rtcName$6 DB 062H
DB 069H
DB 06eH
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 077H
DB 06fH
DB 072H
DB 064H
DB 073H
DB 00H
ORG $+2
TryParseDN$rtcName$7 DB 062H
DB 069H
DB 06eH
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 063H
DB 06fH
DB 075H
DB 06eH
DB 074H
DB 00H
ORG $+2
TryParseDN$rtcName$8 DB 06eH
DB 06fH
DB 05fH
DB 06cH
DB 069H
DB 067H
DB 068H
DB 074H
DB 05fH
DB 063H
DB 068H
DB 065H
DB 063H
DB 06bH
DB 05fH
DB 063H
DB 06fH
DB 064H
DB 065H
DB 00H
ORG $+4
TryParseDN$rtcVarDesc DD 0298H
DD 08H
DQ FLAT:TryParseDN$rtcName$8
DD 0258H
DD 08H
DQ FLAT:TryParseDN$rtcName$7
DD 0218H
DD 08H
DQ FLAT:TryParseDN$rtcName$6
DD 01f8H
DD 08H
DQ FLAT:TryParseDN$rtcName$5
DD 0154H
DD 04H
DQ FLAT:TryParseDN$rtcName$4
DD 0118H
DD 08H
DQ FLAT:TryParseDN$rtcName$3
DD 0f8H
DD 08H
DQ FLAT:TryParseDN$rtcName$2
DD 0b8H
DD 08H
DQ FLAT:TryParseDN$rtcName$1
DD 098H
DD 08H
DQ FLAT:TryParseDN$rtcName$0
ORG $+432
TryParseDN$rtcFrameData DD 09H
DD 00H
DQ FLAT:TryParseDN$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$ConvertCardinalNumber DD 025053401H
DD 0118231dH
DD 070110035H
DD 05010H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
ConvertCardinalNumber$rtcName$0 DB 077H
DB 06fH
DB 072H
DB 06bH
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 063H
DB 06fH
DB 064H
DB 065H
DB 00H
ORG $+2
ConvertCardinalNumber$rtcName$1 DB 077H
DB 06fH
DB 072H
DB 06bH
DB 05fH
DB 062H
DB 075H
DB 066H
DB 05fH
DB 077H
DB 06fH
DB 072H
DB 064H
DB 073H
DB 00H
ORG $+1
ConvertCardinalNumber$rtcVarDesc DD 068H
DD 08H
DQ FLAT:ConvertCardinalNumber$rtcName$1
DD 048H
DD 08H
DQ FLAT:ConvertCardinalNumber$rtcName$0
ORG $+96
ConvertCardinalNumber$rtcFrameData DD 02H
DD 00H
DQ FLAT:ConvertCardinalNumber$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$MultiplyAndAdd_using_ADCX_MULX DD 025053401H
DD 0118231dH
DD 070110025H
DD 05010H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$MultiplyAndAdd_using_ADC_MUL DD 025053401H
DD 0118231dH
DD 070110025H
DD 05010H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$MultiplyAndAdd1Word_using_ADCX_MULX DD 025053401H
DD 0118231dH
DD 070110029H
DD 05010H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
MultiplyAndAdd1Word_using_ADCX_MULX$rtcName$0 DB 074H
DB 05fH
DB 068H
DB 069H
DB 00H
ORG $+11
MultiplyAndAdd1Word_using_ADCX_MULX$rtcVarDesc DD 048H
DD 08H
DQ FLAT:MultiplyAndAdd1Word_using_ADCX_MULX$rtcName$0
ORG $+48
MultiplyAndAdd1Word_using_ADCX_MULX$rtcFrameData DD 01H
DD 00H
DQ FLAT:MultiplyAndAdd1Word_using_ADCX_MULX$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$MultiplyAndAdd1Word_using_ADC_MUL DD 025053401H
DD 0118231dH
DD 070110029H
DD 05010H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
MultiplyAndAdd1Word_using_ADC_MUL$rtcName$0 DB 074H
DB 05fH
DB 068H
DB 069H
DB 00H
ORG $+11
MultiplyAndAdd1Word_using_ADC_MUL$rtcVarDesc DD 048H
DD 08H
DQ FLAT:MultiplyAndAdd1Word_using_ADC_MUL$rtcName$0
ORG $+48
MultiplyAndAdd1Word_using_ADC_MUL$rtcFrameData DD 01H
DD 00H
DQ FLAT:MultiplyAndAdd1Word_using_ADC_MUL$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$BuildBinaryFromDecimalString DD 025053401H
DD 0118231dH
DD 070110031H
DD 05010H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$Build1WordFromDecimalString DD 025052a01H
DD 010e2313H
DD 070070021H
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$BuildLeading1WordFromDecimalString DD 025052f01H
DD 01132318H
DD 0700c0021H
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$ParseAsHexNumberString DD 035054919H
DD 011c3321H
DD 07015002fH
DD 05014H
DD imagerel __GSHandlerCheck
DD 0168H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
ParseAsHexNumberString$rtcName$0 DB 073H
DB 074H
DB 061H
DB 074H
DB 065H
DB 00H
ORG $+10
ParseAsHexNumberString$rtcVarDesc DD 040H
DD 060H
DQ FLAT:ParseAsHexNumberString$rtcName$0
ORG $+48
ParseAsHexNumberString$rtcFrameData DD 01H
DD 00H
DQ FLAT:ParseAsHexNumberString$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$ParseAsDecimalNumberString DD 035054919H
DD 011c3321H
DD 07015002fH
DD 05014H
DD imagerel __GSHandlerCheck
DD 0168H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
ParseAsDecimalNumberString$rtcName$0 DB 073H
DB 074H
DB 061H
DB 074H
DB 065H
DB 00H
ORG $+10
ParseAsDecimalNumberString$rtcVarDesc DD 040H
DD 060H
DQ FLAT:ParseAsDecimalNumberString$rtcName$0
ORG $+48
ParseAsDecimalNumberString$rtcFrameData DD 01H
DD 00H
DQ FLAT:ParseAsDecimalNumberString$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$ParseAsFractionPartNumberSequence DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$ParseAsIntegerPartNumberSequence DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$SkipSpace DD 025052a01H
DD 010e2313H
DD 07007001fH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$FinalizeParserState DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$InitializeParserState DD 025053901H
DD 011d2322H
DD 07016001dH
DD 05015H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$StartsWith DD 025052f01H
DD 01132318H
DD 0700c001dH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$_MULTIPLYX_UNIT DD 025053401H
DD 0118231dH
DD 07011001dH
DD 05010H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$_MULTIPLY_UNIT DD 025053401H
DD 0118231dH
DD 07011001fH
DD 05010H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$_ADDX_UNIT DD 025053801H
DD 011c2321H
DD 07015001dH
DD 05014H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$_ADD_UNIT DD 025053801H
DD 011c2321H
DD 07015001dH
DD 05014H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$_DIVIDE_CEILING_SIZE DD 025052f01H
DD 01132318H
DD 0700c001dH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$_DIVIDE_CEILING_UNIT DD 025052f01H
DD 01132318H
DD 0700c001dH
DD 0500bH
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$_COPY_MEMORY_UNIT DD 025063501H
DD 0119231eH
DD 07012001cH
DD 050106011H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$AddToMULTI64Counter DD 025052801H
DD 010d2312H
DD 07006001dH
DD 05005H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$AddToMULTI32Counter DD 025052801H
DD 010d2312H
DD 07006001dH
DD 05005H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$IncrementMULTI64Counter DD 025051e01H
DD 010a230fH
DD 07003001dH
DD 05002H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$IncrementMULTI32Counter DD 025051e01H
DD 010a230fH
DD 07003001dH
DD 05002H
xdata ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$PMC_TryParse DD 025053801H
DD 011c2321H
DD 070150029H
DD 05014H
xdata ENDS
; COMDAT CONST
CONST SEGMENT
PMC_TryParse$rtcName$0 DB 06eH
DB 06fH
DB 00H
ORG $+13
PMC_TryParse$rtcVarDesc DD 048H
DD 08H
DQ FLAT:PMC_TryParse$rtcName$0
ORG $+48
PMC_TryParse$rtcFrameData DD 01H
DD 00H
DQ FLAT:PMC_TryParse$rtcVarDesc
CONST ENDS
; COMDAT xdata
xdata SEGMENT
$unwind$Initialize_Parse DD 025052a01H
DD 010e2313H
DD 07007001dH
DD 05006H
xdata ENDS
; Function compile flags: /Odt
; COMDAT __JustMyCode_Default
_TEXT SEGMENT
__JustMyCode_Default PROC ; COMDAT
ret 0
__JustMyCode_Default ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT TryParseX
_TEXT SEGMENT
result$ = 4
source_len$ = 40
int_part_buf_code$ = 72
int_part_buf_words$ = 104
int_part_buf$ = 136
result_parsing$ = 164
o_bit_count$ = 200
o_light_check_code$ = 232
source$ = 480
number_styles$ = 488
format_option$ = 496
o$ = 504
TryParseX PROC ; COMDAT
; 968 : {
mov QWORD PTR [rsp+32], r9
mov QWORD PTR [rsp+24], r8
mov DWORD PTR [rsp+16], edx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 488 ; 000001e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 122 ; 0000007aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+520]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 969 : PMC_STATUS_CODE result;
; 970 : __UNIT_TYPE source_len = lstrlenW(source);
mov rcx, QWORD PTR source$[rbp]
call QWORD PTR __imp_lstrlenW
cdqe
mov QWORD PTR source_len$[rbp], rax
; 971 : __UNIT_TYPE int_part_buf_code;
; 972 : __UNIT_TYPE int_part_buf_words;
; 973 : wchar_t* int_part_buf = (wchar_t*)AllocateBlock((source_len + 1) * sizeof(wchar_t) * 8, &int_part_buf_words, &int_part_buf_code);
mov rax, QWORD PTR source_len$[rbp]
lea rax, QWORD PTR [rax+rax+2]
shl rax, 3
lea r8, QWORD PTR int_part_buf_code$[rbp]
lea rdx, QWORD PTR int_part_buf_words$[rbp]
mov rcx, rax
call AllocateBlock
mov QWORD PTR int_part_buf$[rbp], rax
; 974 : if (int_part_buf == NULL)
cmp QWORD PTR int_part_buf$[rbp], 0
jne SHORT $LN2@TryParseX
; 975 : return (PMC_STATUS_NOT_ENOUGH_MEMORY);
mov eax, -5
jmp $LN1@TryParseX
$LN2@TryParseX:
; 976 : int result_parsing = ParseAsHexNumberString(source, number_styles, format_option, int_part_buf);
mov r9, QWORD PTR int_part_buf$[rbp]
mov r8, QWORD PTR format_option$[rbp]
mov edx, DWORD PTR number_styles$[rbp]
mov rcx, QWORD PTR source$[rbp]
call ParseAsHexNumberString
mov DWORD PTR result_parsing$[rbp], eax
; 977 : if ((result = CheckBlockLight((__UNIT_TYPE*)int_part_buf, int_part_buf_code)) != PMC_STATUS_OK)
mov rdx, QWORD PTR int_part_buf_code$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call CheckBlockLight
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN3@TryParseX
; 978 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp $LN1@TryParseX
$LN3@TryParseX:
; 979 : if (!result_parsing || int_part_buf[0] == L'\0')
cmp DWORD PTR result_parsing$[rbp], 0
je SHORT $LN5@TryParseX
mov eax, 2
imul rax, rax, 0
mov rcx, QWORD PTR int_part_buf$[rbp]
movzx eax, WORD PTR [rcx+rax]
test eax, eax
jne SHORT $LN4@TryParseX
$LN5@TryParseX:
; 980 : {
; 981 : DeallocateBlock((__UNIT_TYPE*)int_part_buf, int_part_buf_words);
mov rdx, QWORD PTR int_part_buf_words$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call DeallocateBlock
; 982 : return (PMC_STATUS_PARSING_ERROR);
mov eax, 1
jmp $LN1@TryParseX
$LN4@TryParseX:
; 983 : }
; 984 : __UNIT_TYPE o_bit_count = lstrlenW(int_part_buf) * 4;
mov rcx, QWORD PTR int_part_buf$[rbp]
call QWORD PTR __imp_lstrlenW
shl eax, 2
cdqe
mov QWORD PTR o_bit_count$[rbp], rax
; 985 : __UNIT_TYPE o_light_check_code;
; 986 : if ((result = AllocateNumber(o, o_bit_count, &o_light_check_code)) != PMC_STATUS_OK)
lea r8, QWORD PTR o_light_check_code$[rbp]
mov rdx, QWORD PTR o_bit_count$[rbp]
mov rcx, QWORD PTR o$[rbp]
call AllocateNumber
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN6@TryParseX
; 987 : {
; 988 : DeallocateBlock((__UNIT_TYPE*)int_part_buf, int_part_buf_words);
mov rdx, QWORD PTR int_part_buf_words$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call DeallocateBlock
; 989 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp SHORT $LN1@TryParseX
$LN6@TryParseX:
; 990 : }
; 991 : BuildBinaryFromHexString(int_part_buf, (*o)->BLOCK);
mov rax, QWORD PTR o$[rbp]
mov rax, QWORD PTR [rax]
mov rdx, QWORD PTR [rax+56]
mov rcx, QWORD PTR int_part_buf$[rbp]
call BuildBinaryFromHexString
; 992 : if ((result = CheckBlockLight((*o)->BLOCK, o_light_check_code)) != PMC_STATUS_OK)
mov rax, QWORD PTR o$[rbp]
mov rax, QWORD PTR [rax]
mov rdx, QWORD PTR o_light_check_code$[rbp]
mov rcx, QWORD PTR [rax+56]
call CheckBlockLight
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN7@TryParseX
; 993 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp SHORT $LN1@TryParseX
$LN7@TryParseX:
; 994 : DeallocateBlock((__UNIT_TYPE*)int_part_buf, int_part_buf_words);
mov rdx, QWORD PTR int_part_buf_words$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call DeallocateBlock
; 995 : CommitNumber(*o);
mov rax, QWORD PTR o$[rbp]
mov rcx, QWORD PTR [rax]
call CommitNumber
; 996 : return (PMC_STATUS_OK);
xor eax, eax
$LN1@TryParseX:
; 997 : }
mov rdi, rax
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:TryParseX$rtcFrameData
call _RTC_CheckStackVars
mov rax, rdi
lea rsp, QWORD PTR [rbp+456]
pop rdi
pop rbp
ret 0
TryParseX ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT BuildBinaryFromHexString
_TEXT SEGMENT
word_digit_count$ = 4
source_count$ = 40
in_ptr$ = 72
out_ptr$ = 104
r$ = 132
tv74 = 344
source$ = 384
out_buf$ = 392
BuildBinaryFromHexString PROC ; COMDAT
; 947 : {
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 392 ; 00000188H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 98 ; 00000062H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+424]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 948 : int word_digit_count = __UNIT_TYPE_BIT_COUNT / 4;
mov DWORD PTR word_digit_count$[rbp], 16
; 949 : __UNIT_TYPE source_count = lstrlenW(source);
mov rcx, QWORD PTR source$[rbp]
call QWORD PTR __imp_lstrlenW
cdqe
mov QWORD PTR source_count$[rbp], rax
; 950 : wchar_t* in_ptr = source;
mov rax, QWORD PTR source$[rbp]
mov QWORD PTR in_ptr$[rbp], rax
; 951 : __UNIT_TYPE* out_ptr = out_buf + _DIVIDE_CEILING_UNIT(source_count, word_digit_count) - 1;
movsxd rax, DWORD PTR word_digit_count$[rbp]
mov rdx, rax
mov rcx, QWORD PTR source_count$[rbp]
call _DIVIDE_CEILING_UNIT
mov rcx, QWORD PTR out_buf$[rbp]
lea rax, QWORD PTR [rcx+rax*8-8]
mov QWORD PTR out_ptr$[rbp], rax
; 952 : int r = source_count % word_digit_count;
movsxd rax, DWORD PTR word_digit_count$[rbp]
mov QWORD PTR tv74[rbp], rax
xor edx, edx
mov rax, QWORD PTR source_count$[rbp]
mov rcx, QWORD PTR tv74[rbp]
div rcx
mov rax, rdx
mov DWORD PTR r$[rbp], eax
; 953 : if (r > 0)
cmp DWORD PTR r$[rbp], 0
jle SHORT $LN4@BuildBinar
; 954 : {
; 955 : *out_ptr-- = BuildLeading1WordFromHexString(in_ptr, r);
movsxd rax, DWORD PTR r$[rbp]
mov rdx, rax
mov rcx, QWORD PTR in_ptr$[rbp]
call BuildLeading1WordFromHexString
mov rcx, QWORD PTR out_ptr$[rbp]
mov QWORD PTR [rcx], rax
mov rax, QWORD PTR out_ptr$[rbp]
sub rax, 8
mov QWORD PTR out_ptr$[rbp], rax
; 956 : in_ptr += r;
movsxd rax, DWORD PTR r$[rbp]
mov rcx, QWORD PTR in_ptr$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR in_ptr$[rbp], rax
; 957 : source_count -= r;
movsxd rax, DWORD PTR r$[rbp]
mov rcx, QWORD PTR source_count$[rbp]
sub rcx, rax
mov rax, rcx
mov QWORD PTR source_count$[rbp], rax
$LN4@BuildBinar:
$LN2@BuildBinar:
; 958 : }
; 959 : while (source_count > 0)
cmp QWORD PTR source_count$[rbp], 0
jbe SHORT $LN3@BuildBinar
; 960 : {
; 961 : *out_ptr-- = Build1WordFromHexString(in_ptr);
mov rcx, QWORD PTR in_ptr$[rbp]
call Build1WordFromHexString
mov rcx, QWORD PTR out_ptr$[rbp]
mov QWORD PTR [rcx], rax
mov rax, QWORD PTR out_ptr$[rbp]
sub rax, 8
mov QWORD PTR out_ptr$[rbp], rax
; 962 : in_ptr += word_digit_count;
movsxd rax, DWORD PTR word_digit_count$[rbp]
mov rcx, QWORD PTR in_ptr$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR in_ptr$[rbp], rax
; 963 : source_count -= word_digit_count;
movsxd rax, DWORD PTR word_digit_count$[rbp]
mov rcx, QWORD PTR source_count$[rbp]
sub rcx, rax
mov rax, rcx
mov QWORD PTR source_count$[rbp], rax
; 964 : }
jmp SHORT $LN2@BuildBinar
$LN3@BuildBinar:
; 965 : }
lea rsp, QWORD PTR [rbp+360]
pop rdi
pop rbp
ret 0
BuildBinaryFromHexString ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT Build1WordFromHexString
_TEXT SEGMENT
x$ = 8
tv206 = 212
tv198 = 212
tv191 = 212
tv183 = 212
tv176 = 212
tv169 = 212
tv162 = 212
tv154 = 212
tv147 = 212
tv140 = 212
tv133 = 212
tv94 = 212
tv87 = 212
tv80 = 212
tv73 = 212
tv66 = 212
in_ptr$ = 256
Build1WordFromHexString PROC ; COMDAT
; 914 : {
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 264 ; 00000108H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 66 ; 00000042H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+296]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 915 : __UNIT_TYPE x = Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv66[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv66[rbp]
call Parse1DigitFromHexChar
mov eax, eax
mov QWORD PTR x$[rbp], rax
; 916 : if (sizeof(__UNIT_TYPE) >= sizeof(_UINT64_T))
xor eax, eax
cmp eax, 1
je $LN2@Build1Word
; 917 : {
; 918 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv73[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv73[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
; 919 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv80[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv80[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
; 920 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv87[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv87[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
; 921 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv94[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv94[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
; 922 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv133[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv133[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
; 923 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv140[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv140[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
; 924 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv147[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv147[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
; 925 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv154[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv154[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
$LN2@Build1Word:
; 926 : }
; 927 : if (sizeof(__UNIT_TYPE) >= sizeof(_UINT32_T))
xor eax, eax
cmp eax, 1
je $LN3@Build1Word
; 928 : {
; 929 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv162[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv162[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
; 930 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv169[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv169[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
; 931 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv176[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv176[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
; 932 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv183[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv183[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
$LN3@Build1Word:
; 933 : }
; 934 : if (sizeof(__UNIT_TYPE) >= sizeof(_UINT16_T))
xor eax, eax
cmp eax, 1
je $LN4@Build1Word
; 935 : {
; 936 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv191[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv191[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
; 937 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv198[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv198[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
$LN4@Build1Word:
; 938 : }
; 939 : if (sizeof(__UNIT_TYPE) >= sizeof(_BYTE_T))
xor eax, eax
cmp eax, 1
je SHORT $LN5@Build1Word
; 940 : {
; 941 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr++);
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
mov WORD PTR tv206[rbp], ax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
movzx ecx, WORD PTR tv206[rbp]
call Parse1DigitFromHexChar
mov eax, eax
imul rcx, QWORD PTR x$[rbp], 16
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
$LN5@Build1Word:
; 942 : }
; 943 : return (x);
mov rax, QWORD PTR x$[rbp]
; 944 : }
lea rsp, QWORD PTR [rbp+232]
pop rdi
pop rbp
ret 0
Build1WordFromHexString ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT BuildLeading1WordFromHexString
_TEXT SEGMENT
x$ = 8
tv70 = 216
in_ptr$ = 256
count$ = 264
BuildLeading1WordFromHexString PROC ; COMDAT
; 900 : {
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 264 ; 00000108H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 66 ; 00000042H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+296]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 901 : __UNIT_TYPE x = Parse1DigitFromHexChar(*in_ptr);
mov rax, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rax]
call Parse1DigitFromHexChar
mov eax, eax
mov QWORD PTR x$[rbp], rax
; 902 : ++in_ptr;
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 903 : --count;
mov rax, QWORD PTR count$[rbp]
dec rax
mov QWORD PTR count$[rbp], rax
$LN2@BuildLeadi:
; 904 : while (count > 0)
cmp QWORD PTR count$[rbp], 0
jbe SHORT $LN3@BuildLeadi
; 905 : {
; 906 : x = x * 16 + Parse1DigitFromHexChar(*in_ptr);
imul rax, QWORD PTR x$[rbp], 16
mov QWORD PTR tv70[rbp], rax
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
call Parse1DigitFromHexChar
mov eax, eax
mov rcx, QWORD PTR tv70[rbp]
add rcx, rax
mov rax, rcx
mov QWORD PTR x$[rbp], rax
; 907 : ++in_ptr;
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 908 : --count;
mov rax, QWORD PTR count$[rbp]
dec rax
mov QWORD PTR count$[rbp], rax
; 909 : }
jmp SHORT $LN2@BuildLeadi
$LN3@BuildLeadi:
; 910 : return (x);
mov rax, QWORD PTR x$[rbp]
; 911 : }
lea rsp, QWORD PTR [rbp+232]
pop rdi
pop rbp
ret 0
BuildLeading1WordFromHexString ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT Parse1DigitFromHexChar
_TEXT SEGMENT
tv65 = 192
c$ = 240
Parse1DigitFromHexChar PROC ; COMDAT
; 866 : {
mov WORD PTR [rsp+8], cx
push rbp
push rdi
sub rsp, 248 ; 000000f8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 62 ; 0000003eH
mov eax, -858993460 ; ccccccccH
rep stosd
movzx ecx, WORD PTR [rsp+280]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 867 : switch (c)
movzx eax, WORD PTR c$[rbp]
mov DWORD PTR tv65[rbp], eax
mov eax, DWORD PTR tv65[rbp]
sub eax, 48 ; 00000030H
mov DWORD PTR tv65[rbp], eax
cmp DWORD PTR tv65[rbp], 54 ; 00000036H
ja SHORT $LN7@Parse1Digi
movsxd rax, DWORD PTR tv65[rbp]
lea rcx, OFFSET FLAT:__ImageBase
movzx eax, BYTE PTR $LN9@Parse1Digi[rcx+rax]
mov eax, DWORD PTR $LN10@Parse1Digi[rcx+rax*4]
add rax, rcx
jmp rax
$LN4@Parse1Digi:
; 868 : {
; 869 : case L'0':
; 870 : case L'1':
; 871 : case L'2':
; 872 : case L'3':
; 873 : case L'4':
; 874 : case L'5':
; 875 : case L'6':
; 876 : case L'7':
; 877 : case L'8':
; 878 : case L'9':
; 879 : return (c - L'0');
movzx eax, WORD PTR c$[rbp]
sub eax, 48 ; 00000030H
jmp SHORT $LN1@Parse1Digi
$LN5@Parse1Digi:
; 880 : case L'a':
; 881 : case L'b':
; 882 : case L'c':
; 883 : case L'd':
; 884 : case L'e':
; 885 : case L'f':
; 886 : return (c - L'a' + 10);
movzx eax, WORD PTR c$[rbp]
sub eax, 87 ; 00000057H
jmp SHORT $LN1@Parse1Digi
$LN6@Parse1Digi:
; 887 : case L'A':
; 888 : case L'B':
; 889 : case L'C':
; 890 : case L'D':
; 891 : case L'E':
; 892 : case L'F':
; 893 : return (c - L'A' + 10);
movzx eax, WORD PTR c$[rbp]
sub eax, 55 ; 00000037H
jmp SHORT $LN1@Parse1Digi
$LN7@Parse1Digi:
; 894 : default:
; 895 : return ((_UINT32_T)-1);
mov eax, -1 ; ffffffffH
$LN1@Parse1Digi:
; 896 : }
; 897 : }
lea rsp, QWORD PTR [rbp+216]
pop rdi
pop rbp
ret 0
$LN10@Parse1Digi:
DD $LN4@Parse1Digi
DD $LN6@Parse1Digi
DD $LN5@Parse1Digi
DD $LN7@Parse1Digi
$LN9@Parse1Digi:
DB 0
DB 0
DB 0
DB 0
DB 0
DB 0
DB 0
DB 0
DB 0
DB 0
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 1
DB 1
DB 1
DB 1
DB 1
DB 1
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 3
DB 2
DB 2
DB 2
DB 2
DB 2
DB 2
Parse1DigitFromHexChar ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT TryParseDN
_TEXT SEGMENT
result$ = 4
word_digit_count$ = 36
source_len$ = 72
int_part_buf_code$ = 104
int_part_buf_words$ = 136
int_part_buf$ = 168
frac_part_buf_code$ = 200
frac_part_buf_words$ = 232
frac_part_buf$ = 264
sign$ = 292
result_parsing$ = 324
s_ptr$12 = 360
d_ptr$13 = 392
frac_ptr$ = 424
bin_buf_code$ = 456
bin_buf_words$ = 488
bin_buf$ = 520
bin_buf_count$ = 552
o_bit_count$ = 584
no_light_check_code$ = 616
tv202 = 1016
source$ = 1056
number_styles$ = 1064
format_option$ = 1072
o$ = 1080
TryParseDN PROC ; COMDAT
; 722 : {
mov QWORD PTR [rsp+32], r9
mov QWORD PTR [rsp+24], r8
mov DWORD PTR [rsp+16], edx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 1080 ; 00000438H
lea rbp, QWORD PTR [rsp+48]
mov rdi, rsp
mov ecx, 270 ; 0000010eH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+1112]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 723 : PMC_STATUS_CODE result;
; 724 : #ifdef _M_IX86
; 725 : int word_digit_count = 9;
; 726 : #elif defined(_M_IX64)
; 727 : int word_digit_count = 19;
mov DWORD PTR word_digit_count$[rbp], 19
; 728 : #else
; 729 : #error unknown platform
; 730 : #endif
; 731 : __UNIT_TYPE source_len = lstrlenW(source);
mov rcx, QWORD PTR source$[rbp]
call QWORD PTR __imp_lstrlenW
cdqe
mov QWORD PTR source_len$[rbp], rax
; 732 :
; 733 : __UNIT_TYPE int_part_buf_code;
; 734 : __UNIT_TYPE int_part_buf_words;
; 735 : wchar_t* int_part_buf = (wchar_t*)AllocateBlock((source_len + 1) * sizeof(wchar_t) * 8, &int_part_buf_words, &int_part_buf_code);
mov rax, QWORD PTR source_len$[rbp]
lea rax, QWORD PTR [rax+rax+2]
shl rax, 3
lea r8, QWORD PTR int_part_buf_code$[rbp]
lea rdx, QWORD PTR int_part_buf_words$[rbp]
mov rcx, rax
call AllocateBlock
mov QWORD PTR int_part_buf$[rbp], rax
; 736 : if (int_part_buf == NULL)
cmp QWORD PTR int_part_buf$[rbp], 0
jne SHORT $LN9@TryParseDN
; 737 : return (PMC_STATUS_NOT_ENOUGH_MEMORY);
mov eax, -5
jmp $LN1@TryParseDN
$LN9@TryParseDN:
; 738 :
; 739 : __UNIT_TYPE frac_part_buf_code;
; 740 : __UNIT_TYPE frac_part_buf_words;
; 741 : wchar_t* frac_part_buf = (wchar_t*)AllocateBlock((source_len + 1) * sizeof(wchar_t) * 8, &frac_part_buf_words, &frac_part_buf_code);
mov rax, QWORD PTR source_len$[rbp]
lea rax, QWORD PTR [rax+rax+2]
shl rax, 3
lea r8, QWORD PTR frac_part_buf_code$[rbp]
lea rdx, QWORD PTR frac_part_buf_words$[rbp]
mov rcx, rax
call AllocateBlock
mov QWORD PTR frac_part_buf$[rbp], rax
; 742 : if (frac_part_buf == NULL)
cmp QWORD PTR frac_part_buf$[rbp], 0
jne SHORT $LN10@TryParseDN
; 743 : {
; 744 : DeallocateBlock((__UNIT_TYPE*)int_part_buf, int_part_buf_words);
mov rdx, QWORD PTR int_part_buf_words$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call DeallocateBlock
; 745 : return (PMC_STATUS_NOT_ENOUGH_MEMORY);
mov eax, -5
jmp $LN1@TryParseDN
$LN10@TryParseDN:
; 746 : }
; 747 : int sign;
; 748 : int result_parsing = ParseAsDecimalNumberString(source, number_styles, format_option, &sign, int_part_buf, frac_part_buf);
mov rax, QWORD PTR frac_part_buf$[rbp]
mov QWORD PTR [rsp+40], rax
mov rax, QWORD PTR int_part_buf$[rbp]
mov QWORD PTR [rsp+32], rax
lea r9, QWORD PTR sign$[rbp]
mov r8, QWORD PTR format_option$[rbp]
mov edx, DWORD PTR number_styles$[rbp]
mov rcx, QWORD PTR source$[rbp]
call ParseAsDecimalNumberString
mov DWORD PTR result_parsing$[rbp], eax
; 749 : if ((result = CheckBlockLight((__UNIT_TYPE*)int_part_buf, int_part_buf_code)) != PMC_STATUS_OK)
mov rdx, QWORD PTR int_part_buf_code$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call CheckBlockLight
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN11@TryParseDN
; 750 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp $LN1@TryParseDN
$LN11@TryParseDN:
; 751 : if ((result = CheckBlockLight((__UNIT_TYPE*)frac_part_buf, frac_part_buf_code)) != PMC_STATUS_OK)
mov rdx, QWORD PTR frac_part_buf_code$[rbp]
mov rcx, QWORD PTR frac_part_buf$[rbp]
call CheckBlockLight
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN12@TryParseDN
; 752 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp $LN1@TryParseDN
$LN12@TryParseDN:
; 753 : if (!result_parsing)
cmp DWORD PTR result_parsing$[rbp], 0
jne SHORT $LN13@TryParseDN
; 754 : {
; 755 : DeallocateBlock((__UNIT_TYPE*)frac_part_buf, frac_part_buf_words);
mov rdx, QWORD PTR frac_part_buf_words$[rbp]
mov rcx, QWORD PTR frac_part_buf$[rbp]
call DeallocateBlock
; 756 : DeallocateBlock((__UNIT_TYPE*)int_part_buf, int_part_buf_words);
mov rdx, QWORD PTR int_part_buf_words$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call DeallocateBlock
; 757 : return (PMC_STATUS_PARSING_ERROR);
mov eax, 1
jmp $LN1@TryParseDN
$LN13@TryParseDN:
; 758 : }
; 759 : // 整数部と小数部がともに空ならばエラーとする
; 760 : if (int_part_buf[0] == L'\0' && frac_part_buf[0] == L'\0')
mov eax, 2
imul rax, rax, 0
mov rcx, QWORD PTR int_part_buf$[rbp]
movzx eax, WORD PTR [rcx+rax]
test eax, eax
jne SHORT $LN14@TryParseDN
mov eax, 2
imul rax, rax, 0
mov rcx, QWORD PTR frac_part_buf$[rbp]
movzx eax, WORD PTR [rcx+rax]
test eax, eax
jne SHORT $LN14@TryParseDN
; 761 : {
; 762 : DeallocateBlock((__UNIT_TYPE*)frac_part_buf, frac_part_buf_words);
mov rdx, QWORD PTR frac_part_buf_words$[rbp]
mov rcx, QWORD PTR frac_part_buf$[rbp]
call DeallocateBlock
; 763 : DeallocateBlock((__UNIT_TYPE*)int_part_buf, int_part_buf_words);
mov rdx, QWORD PTR int_part_buf_words$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call DeallocateBlock
; 764 : return (PMC_STATUS_PARSING_ERROR);
mov eax, 1
jmp $LN1@TryParseDN
$LN14@TryParseDN:
; 765 : }
; 766 :
; 767 : if (int_part_buf[0] == L'0')
mov eax, 2
imul rax, rax, 0
mov rcx, QWORD PTR int_part_buf$[rbp]
movzx eax, WORD PTR [rcx+rax]
cmp eax, 48 ; 00000030H
jne $LN15@TryParseDN
; 768 : {
; 769 : // 整数部の先行する 0 を削除する
; 770 : wchar_t* s_ptr = int_part_buf;
mov rax, QWORD PTR int_part_buf$[rbp]
mov QWORD PTR s_ptr$12[rbp], rax
; 771 : wchar_t* d_ptr = int_part_buf;
mov rax, QWORD PTR int_part_buf$[rbp]
mov QWORD PTR d_ptr$13[rbp], rax
$LN2@TryParseDN:
; 772 : while (*s_ptr == L'0')
mov rax, QWORD PTR s_ptr$12[rbp]
movzx eax, WORD PTR [rax]
cmp eax, 48 ; 00000030H
jne SHORT $LN3@TryParseDN
; 773 : ++s_ptr;
mov rax, QWORD PTR s_ptr$12[rbp]
add rax, 2
mov QWORD PTR s_ptr$12[rbp], rax
jmp SHORT $LN2@TryParseDN
$LN3@TryParseDN:
$LN4@TryParseDN:
; 774 : for (;;)
; 775 : {
; 776 : *d_ptr = *s_ptr;
mov rax, QWORD PTR d_ptr$13[rbp]
mov rcx, QWORD PTR s_ptr$12[rbp]
movzx ecx, WORD PTR [rcx]
mov WORD PTR [rax], cx
; 777 : if (*s_ptr == L'\0')
mov rax, QWORD PTR s_ptr$12[rbp]
movzx eax, WORD PTR [rax]
test eax, eax
jne SHORT $LN16@TryParseDN
; 778 : break;
jmp SHORT $LN5@TryParseDN
$LN16@TryParseDN:
; 779 : ++s_ptr;
mov rax, QWORD PTR s_ptr$12[rbp]
add rax, 2
mov QWORD PTR s_ptr$12[rbp], rax
; 780 : ++d_ptr;
mov rax, QWORD PTR d_ptr$13[rbp]
add rax, 2
mov QWORD PTR d_ptr$13[rbp], rax
; 781 : }
jmp SHORT $LN4@TryParseDN
$LN5@TryParseDN:
$LN15@TryParseDN:
; 782 : }
; 783 :
; 784 : // 小数部の末尾の 0 を削除する
; 785 : wchar_t* frac_ptr = frac_part_buf + lstrlenW(frac_part_buf);
mov rcx, QWORD PTR frac_part_buf$[rbp]
call QWORD PTR __imp_lstrlenW
cdqe
mov rcx, QWORD PTR frac_part_buf$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR frac_ptr$[rbp], rax
$LN7@TryParseDN:
; 786 : while (frac_ptr > frac_part_buf && frac_ptr[-1] == L'0')
mov rax, QWORD PTR frac_part_buf$[rbp]
cmp QWORD PTR frac_ptr$[rbp], rax
jbe SHORT $LN8@TryParseDN
mov eax, 2
imul rax, rax, -1
mov rcx, QWORD PTR frac_ptr$[rbp]
movzx eax, WORD PTR [rcx+rax]
cmp eax, 48 ; 00000030H
jne SHORT $LN8@TryParseDN
; 787 : --frac_ptr;
mov rax, QWORD PTR frac_ptr$[rbp]
sub rax, 2
mov QWORD PTR frac_ptr$[rbp], rax
jmp SHORT $LN7@TryParseDN
$LN8@TryParseDN:
; 788 : *frac_ptr = L'\0';
xor eax, eax
mov rcx, QWORD PTR frac_ptr$[rbp]
mov WORD PTR [rcx], ax
; 789 :
; 790 : // 小数部が 0 ではない場合、エラーとする
; 791 : if (frac_part_buf[0] != L'\0')
mov eax, 2
imul rax, rax, 0
mov rcx, QWORD PTR frac_part_buf$[rbp]
movzx eax, WORD PTR [rcx+rax]
test eax, eax
je SHORT $LN17@TryParseDN
; 792 : {
; 793 : DeallocateBlock((__UNIT_TYPE*)frac_part_buf, frac_part_buf_words);
mov rdx, QWORD PTR frac_part_buf_words$[rbp]
mov rcx, QWORD PTR frac_part_buf$[rbp]
call DeallocateBlock
; 794 : DeallocateBlock((__UNIT_TYPE*)int_part_buf, int_part_buf_words);
mov rdx, QWORD PTR int_part_buf_words$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call DeallocateBlock
; 795 : return (PMC_STATUS_PARSING_ERROR);
mov eax, 1
jmp $LN1@TryParseDN
$LN17@TryParseDN:
; 796 : }
; 797 :
; 798 : if (sign < 0)
cmp DWORD PTR sign$[rbp], 0
jge SHORT $LN18@TryParseDN
; 799 : {
; 800 : if (int_part_buf[0] == L'\0')
mov eax, 2
imul rax, rax, 0
mov rcx, QWORD PTR int_part_buf$[rbp]
movzx eax, WORD PTR [rcx+rax]
test eax, eax
jne SHORT $LN19@TryParseDN
; 801 : {
; 802 : // - 符号が与えられていてかつ整数部が 0 であるなら符号を修正する
; 803 : sign = 0;
mov DWORD PTR sign$[rbp], 0
; 804 : }
jmp SHORT $LN20@TryParseDN
$LN19@TryParseDN:
; 805 : else
; 806 : {
; 807 : // - 符号が与えられていてかつ整数部が 0 ではないなら、エラーとする
; 808 : DeallocateBlock((__UNIT_TYPE*)frac_part_buf, frac_part_buf_words);
mov rdx, QWORD PTR frac_part_buf_words$[rbp]
mov rcx, QWORD PTR frac_part_buf$[rbp]
call DeallocateBlock
; 809 : DeallocateBlock((__UNIT_TYPE*)int_part_buf, int_part_buf_words);
mov rdx, QWORD PTR int_part_buf_words$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call DeallocateBlock
; 810 : return (PMC_STATUS_OVERFLOW);
mov eax, -2
jmp $LN1@TryParseDN
$LN20@TryParseDN:
$LN18@TryParseDN:
; 811 : }
; 812 : }
; 813 :
; 814 : // 整数部が空である場合、1桁の 0 を設定する
; 815 : if (int_part_buf[0] == L'\0')
mov eax, 2
imul rax, rax, 0
mov rcx, QWORD PTR int_part_buf$[rbp]
movzx eax, WORD PTR [rcx+rax]
test eax, eax
jne SHORT $LN21@TryParseDN
; 816 : {
; 817 : int_part_buf[0] = L'0';
mov eax, 2
imul rax, rax, 0
mov ecx, 48 ; 00000030H
mov rdx, QWORD PTR int_part_buf$[rbp]
mov WORD PTR [rdx+rax], cx
; 818 : int_part_buf[1] = L'\0';
mov eax, 2
imul rax, rax, 1
xor ecx, ecx
mov rdx, QWORD PTR int_part_buf$[rbp]
mov WORD PTR [rdx+rax], cx
$LN21@TryParseDN:
; 819 : }
; 820 :
; 821 : // 小数部は捨てる
; 822 : DeallocateBlock((__UNIT_TYPE*)frac_part_buf, frac_part_buf_words);
mov rdx, QWORD PTR frac_part_buf_words$[rbp]
mov rcx, QWORD PTR frac_part_buf$[rbp]
call DeallocateBlock
; 823 :
; 824 : __UNIT_TYPE bin_buf_code;
; 825 : __UNIT_TYPE bin_buf_words;
; 826 : __UNIT_TYPE* bin_buf = AllocateBlock(_DIVIDE_CEILING_SIZE(lstrlenW(int_part_buf), word_digit_count) * __UNIT_TYPE_BIT_COUNT, &bin_buf_words, &bin_buf_code);
movsxd rax, DWORD PTR word_digit_count$[rbp]
mov QWORD PTR tv202[rbp], rax
mov rcx, QWORD PTR int_part_buf$[rbp]
call QWORD PTR __imp_lstrlenW
cdqe
mov rcx, QWORD PTR tv202[rbp]
mov rdx, rcx
mov rcx, rax
call _DIVIDE_CEILING_SIZE
imul rax, rax, 64 ; 00000040H
lea r8, QWORD PTR bin_buf_code$[rbp]
lea rdx, QWORD PTR bin_buf_words$[rbp]
mov rcx, rax
call AllocateBlock
mov QWORD PTR bin_buf$[rbp], rax
; 827 : if (bin_buf == NULL)
cmp QWORD PTR bin_buf$[rbp], 0
jne SHORT $LN22@TryParseDN
; 828 : {
; 829 : DeallocateBlock((__UNIT_TYPE*)int_part_buf, int_part_buf_words);
mov rdx, QWORD PTR int_part_buf_words$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call DeallocateBlock
; 830 : return (PMC_STATUS_NOT_ENOUGH_MEMORY);
mov eax, -5
jmp $LN1@TryParseDN
$LN22@TryParseDN:
; 831 : }
; 832 : __UNIT_TYPE bin_buf_count;
; 833 : BuildBinaryFromDecimalString(int_part_buf, bin_buf, &bin_buf_count);
lea r8, QWORD PTR bin_buf_count$[rbp]
mov rdx, QWORD PTR bin_buf$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call BuildBinaryFromDecimalString
; 834 : if ((result = CheckBlockLight(bin_buf, bin_buf_code)) != PMC_STATUS_OK)
mov rdx, QWORD PTR bin_buf_code$[rbp]
mov rcx, QWORD PTR bin_buf$[rbp]
call CheckBlockLight
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN23@TryParseDN
; 835 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp $LN1@TryParseDN
$LN23@TryParseDN:
; 836 : DeallocateBlock((__UNIT_TYPE*)int_part_buf, int_part_buf_words);
mov rdx, QWORD PTR int_part_buf_words$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
call DeallocateBlock
; 837 :
; 838 : __UNIT_TYPE o_bit_count = bin_buf_count * __UNIT_TYPE_BIT_COUNT;
imul rax, QWORD PTR bin_buf_count$[rbp], 64 ; 00000040H
mov QWORD PTR o_bit_count$[rbp], rax
; 839 : __UNIT_TYPE no_light_check_code;
; 840 : if ((result = AllocateNumber(o, o_bit_count, &no_light_check_code)) != PMC_STATUS_OK)
lea r8, QWORD PTR no_light_check_code$[rbp]
mov rdx, QWORD PTR o_bit_count$[rbp]
mov rcx, QWORD PTR o$[rbp]
call AllocateNumber
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN24@TryParseDN
; 841 : {
; 842 : DeallocateBlock(bin_buf, bin_buf_words);
mov rdx, QWORD PTR bin_buf_words$[rbp]
mov rcx, QWORD PTR bin_buf$[rbp]
call DeallocateBlock
; 843 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp $LN1@TryParseDN
$LN24@TryParseDN:
; 844 : }
; 845 :
; 846 : if ((result = ConvertCardinalNumber(bin_buf, bin_buf_count, (*o)->BLOCK)) != PMC_STATUS_OK)
mov rax, QWORD PTR o$[rbp]
mov rax, QWORD PTR [rax]
mov r8, QWORD PTR [rax+56]
mov rdx, QWORD PTR bin_buf_count$[rbp]
mov rcx, QWORD PTR bin_buf$[rbp]
call ConvertCardinalNumber
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN25@TryParseDN
; 847 : {
; 848 : DeallocateNumber(*o);
mov rax, QWORD PTR o$[rbp]
mov rcx, QWORD PTR [rax]
call DeallocateNumber
; 849 : DeallocateBlock(bin_buf, bin_buf_words);
mov rdx, QWORD PTR bin_buf_words$[rbp]
mov rcx, QWORD PTR bin_buf$[rbp]
call DeallocateBlock
; 850 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp $LN1@TryParseDN
$LN25@TryParseDN:
; 851 : }
; 852 : if ((result = CheckBlockLight((*o)->BLOCK, no_light_check_code)) != PMC_STATUS_OK)
mov rax, QWORD PTR o$[rbp]
mov rax, QWORD PTR [rax]
mov rdx, QWORD PTR no_light_check_code$[rbp]
mov rcx, QWORD PTR [rax+56]
call CheckBlockLight
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN26@TryParseDN
; 853 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp SHORT $LN1@TryParseDN
$LN26@TryParseDN:
; 854 : DeallocateBlock(bin_buf, bin_buf_words);
mov rdx, QWORD PTR bin_buf_words$[rbp]
mov rcx, QWORD PTR bin_buf$[rbp]
call DeallocateBlock
; 855 : CommitNumber(*o);
mov rax, QWORD PTR o$[rbp]
mov rcx, QWORD PTR [rax]
call CommitNumber
; 856 : if ((*o)->IS_ZERO)
mov rax, QWORD PTR o$[rbp]
mov rax, QWORD PTR [rax]
mov eax, DWORD PTR [rax+40]
shr eax, 1
and eax, 1
test eax, eax
je SHORT $LN27@TryParseDN
; 857 : {
; 858 : DeallocateNumber(*o);
mov rax, QWORD PTR o$[rbp]
mov rcx, QWORD PTR [rax]
call DeallocateNumber
; 859 : *o = &number_zero;
mov rax, QWORD PTR o$[rbp]
lea rcx, OFFSET FLAT:number_zero
mov QWORD PTR [rax], rcx
$LN27@TryParseDN:
; 860 : }
; 861 : return (PMC_STATUS_OK);
xor eax, eax
$LN1@TryParseDN:
; 862 : }
mov rdi, rax
lea rcx, QWORD PTR [rbp-48]
lea rdx, OFFSET FLAT:TryParseDN$rtcFrameData
call _RTC_CheckStackVars
mov rax, rdi
lea rsp, QWORD PTR [rbp+1032]
pop rdi
pop rbp
ret 0
TryParseDN ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT ConvertCardinalNumber
_TEXT SEGMENT
result$ = 4
work_buf_code$ = 40
work_buf_words$ = 72
work_buf$ = 104
work_buf_count$ = 136
w_tail$5 = 168
in_buf$ = 416
in_buf_count$ = 424
out_buf$ = 432
ConvertCardinalNumber PROC ; COMDAT
; 694 : {
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 424 ; 000001a8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 106 ; 0000006aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+456]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 695 : PMC_STATUS_CODE result;
; 696 : __UNIT_TYPE work_buf_code;
; 697 : __UNIT_TYPE work_buf_words;
; 698 : __UNIT_TYPE* work_buf = AllocateBlock(__UNIT_TYPE_BIT_COUNT * (in_buf_count + 1), &work_buf_words, &work_buf_code);
mov rax, QWORD PTR in_buf_count$[rbp]
inc rax
imul rax, rax, 64 ; 00000040H
lea r8, QWORD PTR work_buf_code$[rbp]
lea rdx, QWORD PTR work_buf_words$[rbp]
mov rcx, rax
call AllocateBlock
mov QWORD PTR work_buf$[rbp], rax
; 699 : if (work_buf == NULL)
cmp QWORD PTR work_buf$[rbp], 0
jne SHORT $LN4@ConvertCar
; 700 : return (PMC_STATUS_NOT_ENOUGH_MEMORY);
mov eax, -5
jmp $LN1@ConvertCar
$LN4@ConvertCar:
; 701 :
; 702 : __UNIT_TYPE work_buf_count = 1;
mov QWORD PTR work_buf_count$[rbp], 1
; 703 : work_buf[0] = in_buf[0];
mov eax, 8
imul rax, rax, 0
mov ecx, 8
imul rcx, rcx, 0
mov rdx, QWORD PTR work_buf$[rbp]
mov r8, QWORD PTR in_buf$[rbp]
mov rax, QWORD PTR [r8+rax]
mov QWORD PTR [rdx+rcx], rax
; 704 : ++in_buf;
mov rax, QWORD PTR in_buf$[rbp]
add rax, 8
mov QWORD PTR in_buf$[rbp], rax
; 705 : --in_buf_count;
mov rax, QWORD PTR in_buf_count$[rbp]
dec rax
mov QWORD PTR in_buf_count$[rbp], rax
$LN2@ConvertCar:
; 706 :
; 707 : while (in_buf_count > 0)
cmp QWORD PTR in_buf_count$[rbp], 0
jbe SHORT $LN3@ConvertCar
; 708 : {
; 709 : __UNIT_TYPE* w_tail = (*fp_MultiplyAndAdd)(work_buf, work_buf_count, *in_buf);
mov rax, QWORD PTR in_buf$[rbp]
mov r8, QWORD PTR [rax]
mov rdx, QWORD PTR work_buf_count$[rbp]
mov rcx, QWORD PTR work_buf$[rbp]
call QWORD PTR fp_MultiplyAndAdd
mov QWORD PTR w_tail$5[rbp], rax
; 710 : work_buf_count = w_tail - work_buf;
mov rax, QWORD PTR work_buf$[rbp]
mov rcx, QWORD PTR w_tail$5[rbp]
sub rcx, rax
mov rax, rcx
sar rax, 3
mov QWORD PTR work_buf_count$[rbp], rax
; 711 : ++in_buf;
mov rax, QWORD PTR in_buf$[rbp]
add rax, 8
mov QWORD PTR in_buf$[rbp], rax
; 712 : --in_buf_count;
mov rax, QWORD PTR in_buf_count$[rbp]
dec rax
mov QWORD PTR in_buf_count$[rbp], rax
; 713 : }
jmp SHORT $LN2@ConvertCar
$LN3@ConvertCar:
; 714 : if ((result = CheckBlockLight(work_buf, work_buf_code)) != PMC_STATUS_OK)
mov rdx, QWORD PTR work_buf_code$[rbp]
mov rcx, QWORD PTR work_buf$[rbp]
call CheckBlockLight
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN5@ConvertCar
; 715 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp SHORT $LN1@ConvertCar
$LN5@ConvertCar:
; 716 : _COPY_MEMORY_UNIT(out_buf, work_buf, work_buf_count);
mov r8, QWORD PTR work_buf_count$[rbp]
mov rdx, QWORD PTR work_buf$[rbp]
mov rcx, QWORD PTR out_buf$[rbp]
call _COPY_MEMORY_UNIT
; 717 : DeallocateBlock(work_buf, work_buf_words);
mov rdx, QWORD PTR work_buf_words$[rbp]
mov rcx, QWORD PTR work_buf$[rbp]
call DeallocateBlock
; 718 : return (PMC_STATUS_OK);
xor eax, eax
$LN1@ConvertCar:
; 719 : }
mov rdi, rax
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:ConvertCardinalNumber$rtcFrameData
call _RTC_CheckStackVars
mov rax, rdi
lea rsp, QWORD PTR [rbp+392]
pop rdi
pop rbp
ret 0
ConvertCardinalNumber ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT MultiplyAndAdd_using_ADCX_MULX
_TEXT SEGMENT
k$ = 8
count$ = 40
u_buf$ = 288
u_count$ = 296
x$ = 304
MultiplyAndAdd_using_ADCX_MULX PROC ; COMDAT
; 551 : {
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 296 ; 00000128H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 74 ; 0000004aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+328]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 552 : __UNIT_TYPE k = x;
mov rax, QWORD PTR x$[rbp]
mov QWORD PTR k$[rbp], rax
; 553 : __UNIT_TYPE count = u_count >> 5;
mov rax, QWORD PTR u_count$[rbp]
shr rax, 5
mov QWORD PTR count$[rbp], rax
$LN2@MultiplyAn:
; 554 : while (count > 0)
cmp QWORD PTR count$[rbp], 0
jbe $LN3@MultiplyAn
; 555 : {
; 556 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[0], &u_buf[0]);
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 0
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 557 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[1], &u_buf[1]);
mov eax, 8
imul rax, rax, 1
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 1
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 558 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[2], &u_buf[2]);
mov eax, 8
imul rax, rax, 2
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 2
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 559 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[3], &u_buf[3]);
mov eax, 8
imul rax, rax, 3
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 3
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 560 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[4], &u_buf[4]);
mov eax, 8
imul rax, rax, 4
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 4
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 561 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[5], &u_buf[5]);
mov eax, 8
imul rax, rax, 5
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 5
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 562 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[6], &u_buf[6]);
mov eax, 8
imul rax, rax, 6
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 6
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 563 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[7], &u_buf[7]);
mov eax, 8
imul rax, rax, 7
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 7
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 564 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[8], &u_buf[8]);
mov eax, 8
imul rax, rax, 8
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 8
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 565 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[9], &u_buf[9]);
mov eax, 8
imul rax, rax, 9
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 9
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 566 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[10], &u_buf[10]);
mov eax, 8
imul rax, rax, 10
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 10
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 567 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[11], &u_buf[11]);
mov eax, 8
imul rax, rax, 11
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 11
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 568 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[12], &u_buf[12]);
mov eax, 8
imul rax, rax, 12
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 12
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 569 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[13], &u_buf[13]);
mov eax, 8
imul rax, rax, 13
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 13
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 570 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[14], &u_buf[14]);
mov eax, 8
imul rax, rax, 14
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 14
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 571 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[15], &u_buf[15]);
mov eax, 8
imul rax, rax, 15
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 15
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 572 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[16], &u_buf[16]);
mov eax, 8
imul rax, rax, 16
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 16
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 573 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[17], &u_buf[17]);
mov eax, 8
imul rax, rax, 17
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 17
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 574 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[18], &u_buf[18]);
mov eax, 8
imul rax, rax, 18
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 18
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 575 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[19], &u_buf[19]);
mov eax, 8
imul rax, rax, 19
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 19
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 576 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[20], &u_buf[20]);
mov eax, 8
imul rax, rax, 20
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 20
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 577 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[21], &u_buf[21]);
mov eax, 8
imul rax, rax, 21
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 21
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 578 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[22], &u_buf[22]);
mov eax, 8
imul rax, rax, 22
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 22
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 579 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[23], &u_buf[23]);
mov eax, 8
imul rax, rax, 23
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 23
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 580 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[24], &u_buf[24]);
mov eax, 8
imul rax, rax, 24
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 24
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 581 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[25], &u_buf[25]);
mov eax, 8
imul rax, rax, 25
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 25
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 582 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[26], &u_buf[26]);
mov eax, 8
imul rax, rax, 26
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 26
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 583 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[27], &u_buf[27]);
mov eax, 8
imul rax, rax, 27
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 27
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 584 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[28], &u_buf[28]);
mov eax, 8
imul rax, rax, 28
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 28
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 585 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[29], &u_buf[29]);
mov eax, 8
imul rax, rax, 29
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 29
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 586 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[30], &u_buf[30]);
mov eax, 8
imul rax, rax, 30
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 30
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 587 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[31], &u_buf[31]);
mov eax, 8
imul rax, rax, 31
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 31
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 588 : u_buf += 32;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 256 ; 00000100H
mov QWORD PTR u_buf$[rbp], rax
; 589 : --count;
mov rax, QWORD PTR count$[rbp]
dec rax
mov QWORD PTR count$[rbp], rax
; 590 : #ifdef ENABLED_PERFORMANCE_COUNTER
; 591 : if (sizeof(k) == sizeof(_UINT32_T))
xor eax, eax
test eax, eax
je SHORT $LN4@MultiplyAn
; 592 : AddToMULTI32Counter(32);
mov ecx, 32 ; 00000020H
call AddToMULTI32Counter
jmp SHORT $LN5@MultiplyAn
$LN4@MultiplyAn:
; 593 : else
; 594 : AddToMULTI64Counter(32);
mov ecx, 32 ; 00000020H
call AddToMULTI64Counter
$LN5@MultiplyAn:
; 595 : #endif
; 596 : }
jmp $LN2@MultiplyAn
$LN3@MultiplyAn:
; 597 :
; 598 : if (u_count & 0x10)
mov rax, QWORD PTR u_count$[rbp]
and rax, 16
test rax, rax
je $LN6@MultiplyAn
; 599 : {
; 600 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[0], &u_buf[0]);
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 0
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 601 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[1], &u_buf[1]);
mov eax, 8
imul rax, rax, 1
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 1
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 602 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[2], &u_buf[2]);
mov eax, 8
imul rax, rax, 2
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 2
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 603 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[3], &u_buf[3]);
mov eax, 8
imul rax, rax, 3
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 3
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 604 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[4], &u_buf[4]);
mov eax, 8
imul rax, rax, 4
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 4
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 605 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[5], &u_buf[5]);
mov eax, 8
imul rax, rax, 5
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 5
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 606 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[6], &u_buf[6]);
mov eax, 8
imul rax, rax, 6
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 6
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 607 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[7], &u_buf[7]);
mov eax, 8
imul rax, rax, 7
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 7
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 608 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[8], &u_buf[8]);
mov eax, 8
imul rax, rax, 8
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 8
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 609 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[9], &u_buf[9]);
mov eax, 8
imul rax, rax, 9
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 9
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 610 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[10], &u_buf[10]);
mov eax, 8
imul rax, rax, 10
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 10
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 611 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[11], &u_buf[11]);
mov eax, 8
imul rax, rax, 11
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 11
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 612 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[12], &u_buf[12]);
mov eax, 8
imul rax, rax, 12
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 12
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 613 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[13], &u_buf[13]);
mov eax, 8
imul rax, rax, 13
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 13
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 614 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[14], &u_buf[14]);
mov eax, 8
imul rax, rax, 14
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 14
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 615 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[15], &u_buf[15]);
mov eax, 8
imul rax, rax, 15
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 15
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 616 : u_buf += 16;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 128 ; 00000080H
mov QWORD PTR u_buf$[rbp], rax
; 617 : #ifdef ENABLED_PERFORMANCE_COUNTER
; 618 : if (sizeof(k) == sizeof(_UINT32_T))
xor eax, eax
test eax, eax
je SHORT $LN7@MultiplyAn
; 619 : AddToMULTI32Counter(16);
mov ecx, 16
call AddToMULTI32Counter
jmp SHORT $LN8@MultiplyAn
$LN7@MultiplyAn:
; 620 : else
; 621 : AddToMULTI64Counter(16);
mov ecx, 16
call AddToMULTI64Counter
$LN8@MultiplyAn:
$LN6@MultiplyAn:
; 622 : #endif
; 623 : }
; 624 :
; 625 : if (u_count & 0x8)
mov rax, QWORD PTR u_count$[rbp]
and rax, 8
test rax, rax
je $LN9@MultiplyAn
; 626 : {
; 627 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[0], &u_buf[0]);
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 0
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 628 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[1], &u_buf[1]);
mov eax, 8
imul rax, rax, 1
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 1
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 629 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[2], &u_buf[2]);
mov eax, 8
imul rax, rax, 2
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 2
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 630 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[3], &u_buf[3]);
mov eax, 8
imul rax, rax, 3
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 3
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 631 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[4], &u_buf[4]);
mov eax, 8
imul rax, rax, 4
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 4
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 632 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[5], &u_buf[5]);
mov eax, 8
imul rax, rax, 5
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 5
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 633 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[6], &u_buf[6]);
mov eax, 8
imul rax, rax, 6
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 6
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 634 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[7], &u_buf[7]);
mov eax, 8
imul rax, rax, 7
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 7
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 635 : u_buf += 8;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 64 ; 00000040H
mov QWORD PTR u_buf$[rbp], rax
; 636 : #ifdef ENABLED_PERFORMANCE_COUNTER
; 637 : if (sizeof(k) == sizeof(_UINT32_T))
xor eax, eax
test eax, eax
je SHORT $LN10@MultiplyAn
; 638 : AddToMULTI32Counter(8);
mov ecx, 8
call AddToMULTI32Counter
jmp SHORT $LN11@MultiplyAn
$LN10@MultiplyAn:
; 639 : else
; 640 : AddToMULTI64Counter(8);
mov ecx, 8
call AddToMULTI64Counter
$LN11@MultiplyAn:
$LN9@MultiplyAn:
; 641 : #endif
; 642 : }
; 643 :
; 644 : if (u_count & 0x4)
mov rax, QWORD PTR u_count$[rbp]
and rax, 4
test rax, rax
je $LN12@MultiplyAn
; 645 : {
; 646 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[0], &u_buf[0]);
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 0
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 647 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[1], &u_buf[1]);
mov eax, 8
imul rax, rax, 1
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 1
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 648 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[2], &u_buf[2]);
mov eax, 8
imul rax, rax, 2
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 2
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 649 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[3], &u_buf[3]);
mov eax, 8
imul rax, rax, 3
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 3
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 650 : u_buf += 4;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 32 ; 00000020H
mov QWORD PTR u_buf$[rbp], rax
; 651 : #ifdef ENABLED_PERFORMANCE_COUNTER
; 652 : if (sizeof(k) == sizeof(_UINT32_T))
xor eax, eax
test eax, eax
je SHORT $LN13@MultiplyAn
; 653 : AddToMULTI32Counter(4);
mov ecx, 4
call AddToMULTI32Counter
jmp SHORT $LN14@MultiplyAn
$LN13@MultiplyAn:
; 654 : else
; 655 : AddToMULTI64Counter(4);
mov ecx, 4
call AddToMULTI64Counter
$LN14@MultiplyAn:
$LN12@MultiplyAn:
; 656 : #endif
; 657 : }
; 658 :
; 659 : if (u_count & 0x2)
mov rax, QWORD PTR u_count$[rbp]
and rax, 2
test rax, rax
je $LN15@MultiplyAn
; 660 : {
; 661 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[0], &u_buf[0]);
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 0
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 662 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[1], &u_buf[1]);
mov eax, 8
imul rax, rax, 1
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 1
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 663 : u_buf += 2;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 16
mov QWORD PTR u_buf$[rbp], rax
; 664 : #ifdef ENABLED_PERFORMANCE_COUNTER
; 665 : if (sizeof(k) == sizeof(_UINT32_T))
xor eax, eax
test eax, eax
je SHORT $LN16@MultiplyAn
; 666 : AddToMULTI32Counter(2);
mov ecx, 2
call AddToMULTI32Counter
jmp SHORT $LN17@MultiplyAn
$LN16@MultiplyAn:
; 667 : else
; 668 : AddToMULTI64Counter(2);
mov ecx, 2
call AddToMULTI64Counter
$LN17@MultiplyAn:
$LN15@MultiplyAn:
; 669 : #endif
; 670 : }
; 671 :
; 672 : if (u_count & 0x1)
mov rax, QWORD PTR u_count$[rbp]
and rax, 1
test rax, rax
je SHORT $LN18@MultiplyAn
; 673 : {
; 674 : k = MultiplyAndAdd1Word_using_ADCX_MULX(k, u_buf[0], &u_buf[0]);
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 0
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADCX_MULX
mov QWORD PTR k$[rbp], rax
; 675 : u_buf += 1;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 8
mov QWORD PTR u_buf$[rbp], rax
; 676 : #ifdef ENABLED_PERFORMANCE_COUNTER
; 677 : if (sizeof(k) == sizeof(_UINT32_T))
xor eax, eax
test eax, eax
je SHORT $LN19@MultiplyAn
; 678 : IncrementMULTI32Counter();
call IncrementMULTI32Counter
jmp SHORT $LN20@MultiplyAn
$LN19@MultiplyAn:
; 679 : else
; 680 : IncrementMULTI64Counter();
call IncrementMULTI64Counter
$LN20@MultiplyAn:
$LN18@MultiplyAn:
; 681 : #endif
; 682 : }
; 683 :
; 684 : if (k > 0)
cmp QWORD PTR k$[rbp], 0
jbe SHORT $LN21@MultiplyAn
; 685 : {
; 686 : u_buf[0] = k;
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR k$[rbp]
mov QWORD PTR [rcx+rax], rdx
; 687 : u_buf += 1;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 8
mov QWORD PTR u_buf$[rbp], rax
$LN21@MultiplyAn:
; 688 : }
; 689 :
; 690 : return (u_buf);
mov rax, QWORD PTR u_buf$[rbp]
; 691 : }
lea rsp, QWORD PTR [rbp+264]
pop rdi
pop rbp
ret 0
MultiplyAndAdd_using_ADCX_MULX ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT MultiplyAndAdd_using_ADC_MUL
_TEXT SEGMENT
k$ = 8
count$ = 40
u_buf$ = 288
u_count$ = 296
x$ = 304
MultiplyAndAdd_using_ADC_MUL PROC ; COMDAT
; 408 : {
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 296 ; 00000128H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 74 ; 0000004aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+328]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 409 : __UNIT_TYPE k = x;
mov rax, QWORD PTR x$[rbp]
mov QWORD PTR k$[rbp], rax
; 410 : __UNIT_TYPE count = u_count >> 5;
mov rax, QWORD PTR u_count$[rbp]
shr rax, 5
mov QWORD PTR count$[rbp], rax
$LN2@MultiplyAn:
; 411 : while (count > 0)
cmp QWORD PTR count$[rbp], 0
jbe $LN3@MultiplyAn
; 412 : {
; 413 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[0], &u_buf[0]);
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 0
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 414 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[1], &u_buf[1]);
mov eax, 8
imul rax, rax, 1
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 1
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 415 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[2], &u_buf[2]);
mov eax, 8
imul rax, rax, 2
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 2
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 416 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[3], &u_buf[3]);
mov eax, 8
imul rax, rax, 3
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 3
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 417 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[4], &u_buf[4]);
mov eax, 8
imul rax, rax, 4
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 4
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 418 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[5], &u_buf[5]);
mov eax, 8
imul rax, rax, 5
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 5
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 419 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[6], &u_buf[6]);
mov eax, 8
imul rax, rax, 6
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 6
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 420 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[7], &u_buf[7]);
mov eax, 8
imul rax, rax, 7
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 7
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 421 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[8], &u_buf[8]);
mov eax, 8
imul rax, rax, 8
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 8
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 422 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[9], &u_buf[9]);
mov eax, 8
imul rax, rax, 9
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 9
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 423 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[10], &u_buf[10]);
mov eax, 8
imul rax, rax, 10
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 10
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 424 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[11], &u_buf[11]);
mov eax, 8
imul rax, rax, 11
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 11
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 425 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[12], &u_buf[12]);
mov eax, 8
imul rax, rax, 12
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 12
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 426 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[13], &u_buf[13]);
mov eax, 8
imul rax, rax, 13
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 13
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 427 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[14], &u_buf[14]);
mov eax, 8
imul rax, rax, 14
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 14
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 428 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[15], &u_buf[15]);
mov eax, 8
imul rax, rax, 15
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 15
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 429 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[16], &u_buf[16]);
mov eax, 8
imul rax, rax, 16
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 16
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 430 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[17], &u_buf[17]);
mov eax, 8
imul rax, rax, 17
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 17
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 431 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[18], &u_buf[18]);
mov eax, 8
imul rax, rax, 18
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 18
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 432 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[19], &u_buf[19]);
mov eax, 8
imul rax, rax, 19
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 19
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 433 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[20], &u_buf[20]);
mov eax, 8
imul rax, rax, 20
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 20
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 434 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[21], &u_buf[21]);
mov eax, 8
imul rax, rax, 21
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 21
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 435 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[22], &u_buf[22]);
mov eax, 8
imul rax, rax, 22
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 22
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 436 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[23], &u_buf[23]);
mov eax, 8
imul rax, rax, 23
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 23
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 437 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[24], &u_buf[24]);
mov eax, 8
imul rax, rax, 24
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 24
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 438 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[25], &u_buf[25]);
mov eax, 8
imul rax, rax, 25
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 25
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 439 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[26], &u_buf[26]);
mov eax, 8
imul rax, rax, 26
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 26
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 440 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[27], &u_buf[27]);
mov eax, 8
imul rax, rax, 27
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 27
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 441 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[28], &u_buf[28]);
mov eax, 8
imul rax, rax, 28
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 28
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 442 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[29], &u_buf[29]);
mov eax, 8
imul rax, rax, 29
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 29
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 443 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[30], &u_buf[30]);
mov eax, 8
imul rax, rax, 30
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 30
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 444 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[31], &u_buf[31]);
mov eax, 8
imul rax, rax, 31
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 31
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 445 : u_buf += 32;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 256 ; 00000100H
mov QWORD PTR u_buf$[rbp], rax
; 446 : --count;
mov rax, QWORD PTR count$[rbp]
dec rax
mov QWORD PTR count$[rbp], rax
; 447 : #ifdef ENABLED_PERFORMANCE_COUNTER
; 448 : if (sizeof(k) == sizeof(_UINT32_T))
xor eax, eax
test eax, eax
je SHORT $LN4@MultiplyAn
; 449 : AddToMULTI32Counter(32);
mov ecx, 32 ; 00000020H
call AddToMULTI32Counter
jmp SHORT $LN5@MultiplyAn
$LN4@MultiplyAn:
; 450 : else
; 451 : AddToMULTI64Counter(32);
mov ecx, 32 ; 00000020H
call AddToMULTI64Counter
$LN5@MultiplyAn:
; 452 : #endif
; 453 : }
jmp $LN2@MultiplyAn
$LN3@MultiplyAn:
; 454 :
; 455 : if (u_count & 0x10)
mov rax, QWORD PTR u_count$[rbp]
and rax, 16
test rax, rax
je $LN6@MultiplyAn
; 456 : {
; 457 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[0], &u_buf[0]);
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 0
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 458 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[1], &u_buf[1]);
mov eax, 8
imul rax, rax, 1
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 1
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 459 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[2], &u_buf[2]);
mov eax, 8
imul rax, rax, 2
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 2
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 460 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[3], &u_buf[3]);
mov eax, 8
imul rax, rax, 3
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 3
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 461 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[4], &u_buf[4]);
mov eax, 8
imul rax, rax, 4
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 4
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 462 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[5], &u_buf[5]);
mov eax, 8
imul rax, rax, 5
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 5
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 463 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[6], &u_buf[6]);
mov eax, 8
imul rax, rax, 6
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 6
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 464 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[7], &u_buf[7]);
mov eax, 8
imul rax, rax, 7
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 7
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 465 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[8], &u_buf[8]);
mov eax, 8
imul rax, rax, 8
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 8
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 466 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[9], &u_buf[9]);
mov eax, 8
imul rax, rax, 9
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 9
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 467 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[10], &u_buf[10]);
mov eax, 8
imul rax, rax, 10
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 10
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 468 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[11], &u_buf[11]);
mov eax, 8
imul rax, rax, 11
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 11
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 469 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[12], &u_buf[12]);
mov eax, 8
imul rax, rax, 12
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 12
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 470 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[13], &u_buf[13]);
mov eax, 8
imul rax, rax, 13
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 13
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 471 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[14], &u_buf[14]);
mov eax, 8
imul rax, rax, 14
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 14
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 472 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[15], &u_buf[15]);
mov eax, 8
imul rax, rax, 15
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 15
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 473 : u_buf += 16;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 128 ; 00000080H
mov QWORD PTR u_buf$[rbp], rax
; 474 : #ifdef ENABLED_PERFORMANCE_COUNTER
; 475 : if (sizeof(k) == sizeof(_UINT32_T))
xor eax, eax
test eax, eax
je SHORT $LN7@MultiplyAn
; 476 : AddToMULTI32Counter(16);
mov ecx, 16
call AddToMULTI32Counter
jmp SHORT $LN8@MultiplyAn
$LN7@MultiplyAn:
; 477 : else
; 478 : AddToMULTI64Counter(16);
mov ecx, 16
call AddToMULTI64Counter
$LN8@MultiplyAn:
$LN6@MultiplyAn:
; 479 : #endif
; 480 : }
; 481 :
; 482 : if (u_count & 0x8)
mov rax, QWORD PTR u_count$[rbp]
and rax, 8
test rax, rax
je $LN9@MultiplyAn
; 483 : {
; 484 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[0], &u_buf[0]);
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 0
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 485 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[1], &u_buf[1]);
mov eax, 8
imul rax, rax, 1
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 1
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 486 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[2], &u_buf[2]);
mov eax, 8
imul rax, rax, 2
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 2
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 487 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[3], &u_buf[3]);
mov eax, 8
imul rax, rax, 3
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 3
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 488 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[4], &u_buf[4]);
mov eax, 8
imul rax, rax, 4
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 4
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 489 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[5], &u_buf[5]);
mov eax, 8
imul rax, rax, 5
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 5
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 490 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[6], &u_buf[6]);
mov eax, 8
imul rax, rax, 6
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 6
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 491 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[7], &u_buf[7]);
mov eax, 8
imul rax, rax, 7
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 7
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 492 : u_buf += 8;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 64 ; 00000040H
mov QWORD PTR u_buf$[rbp], rax
; 493 : #ifdef ENABLED_PERFORMANCE_COUNTER
; 494 : if (sizeof(k) == sizeof(_UINT32_T))
xor eax, eax
test eax, eax
je SHORT $LN10@MultiplyAn
; 495 : AddToMULTI32Counter(8);
mov ecx, 8
call AddToMULTI32Counter
jmp SHORT $LN11@MultiplyAn
$LN10@MultiplyAn:
; 496 : else
; 497 : AddToMULTI64Counter(8);
mov ecx, 8
call AddToMULTI64Counter
$LN11@MultiplyAn:
$LN9@MultiplyAn:
; 498 : #endif
; 499 : }
; 500 :
; 501 : if (u_count & 0x4)
mov rax, QWORD PTR u_count$[rbp]
and rax, 4
test rax, rax
je $LN12@MultiplyAn
; 502 : {
; 503 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[0], &u_buf[0]);
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 0
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 504 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[1], &u_buf[1]);
mov eax, 8
imul rax, rax, 1
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 1
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 505 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[2], &u_buf[2]);
mov eax, 8
imul rax, rax, 2
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 2
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 506 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[3], &u_buf[3]);
mov eax, 8
imul rax, rax, 3
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 3
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 507 : u_buf += 4;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 32 ; 00000020H
mov QWORD PTR u_buf$[rbp], rax
; 508 : #ifdef ENABLED_PERFORMANCE_COUNTER
; 509 : if (sizeof(k) == sizeof(_UINT32_T))
xor eax, eax
test eax, eax
je SHORT $LN13@MultiplyAn
; 510 : AddToMULTI32Counter(4);
mov ecx, 4
call AddToMULTI32Counter
jmp SHORT $LN14@MultiplyAn
$LN13@MultiplyAn:
; 511 : else
; 512 : AddToMULTI64Counter(4);
mov ecx, 4
call AddToMULTI64Counter
$LN14@MultiplyAn:
$LN12@MultiplyAn:
; 513 : #endif
; 514 : }
; 515 :
; 516 : if (u_count & 0x2)
mov rax, QWORD PTR u_count$[rbp]
and rax, 2
test rax, rax
je $LN15@MultiplyAn
; 517 : {
; 518 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[0], &u_buf[0]);
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 0
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 519 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[1], &u_buf[1]);
mov eax, 8
imul rax, rax, 1
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 1
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 520 : u_buf += 2;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 16
mov QWORD PTR u_buf$[rbp], rax
; 521 : #ifdef ENABLED_PERFORMANCE_COUNTER
; 522 : if (sizeof(k) == sizeof(_UINT32_T))
xor eax, eax
test eax, eax
je SHORT $LN16@MultiplyAn
; 523 : AddToMULTI32Counter(2);
mov ecx, 2
call AddToMULTI32Counter
jmp SHORT $LN17@MultiplyAn
$LN16@MultiplyAn:
; 524 : else
; 525 : AddToMULTI64Counter(2);
mov ecx, 2
call AddToMULTI64Counter
$LN17@MultiplyAn:
$LN15@MultiplyAn:
; 526 : #endif
; 527 : }
; 528 :
; 529 : if (u_count & 0x1)
mov rax, QWORD PTR u_count$[rbp]
and rax, 1
test rax, rax
je SHORT $LN18@MultiplyAn
; 530 : {
; 531 : k = MultiplyAndAdd1Word_using_ADC_MUL(k, u_buf[0], &u_buf[0]);
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
add rcx, rax
mov rax, rcx
mov ecx, 8
imul rcx, rcx, 0
mov r8, rax
mov rax, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR [rax+rcx]
mov rcx, QWORD PTR k$[rbp]
call MultiplyAndAdd1Word_using_ADC_MUL
mov QWORD PTR k$[rbp], rax
; 532 : u_buf += 1;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 8
mov QWORD PTR u_buf$[rbp], rax
; 533 : #ifdef ENABLED_PERFORMANCE_COUNTER
; 534 : if (sizeof(k) == sizeof(_UINT32_T))
xor eax, eax
test eax, eax
je SHORT $LN19@MultiplyAn
; 535 : IncrementMULTI32Counter();
call IncrementMULTI32Counter
jmp SHORT $LN20@MultiplyAn
$LN19@MultiplyAn:
; 536 : else
; 537 : IncrementMULTI64Counter();
call IncrementMULTI64Counter
$LN20@MultiplyAn:
$LN18@MultiplyAn:
; 538 : #endif
; 539 : }
; 540 :
; 541 : if (k > 0)
cmp QWORD PTR k$[rbp], 0
jbe SHORT $LN21@MultiplyAn
; 542 : {
; 543 : u_buf[0] = k;
mov eax, 8
imul rax, rax, 0
mov rcx, QWORD PTR u_buf$[rbp]
mov rdx, QWORD PTR k$[rbp]
mov QWORD PTR [rcx+rax], rdx
; 544 : u_buf += 1;
mov rax, QWORD PTR u_buf$[rbp]
add rax, 8
mov QWORD PTR u_buf$[rbp], rax
$LN21@MultiplyAn:
; 545 : }
; 546 :
; 547 : return (u_buf);
mov rax, QWORD PTR u_buf$[rbp]
; 548 : }
lea rsp, QWORD PTR [rbp+264]
pop rdi
pop rbp
ret 0
MultiplyAndAdd_using_ADC_MUL ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT MultiplyAndAdd1Word_using_ADCX_MULX
_TEXT SEGMENT
base_value$ = 8
t_hi$ = 40
t_lo$ = 72
k$ = 320
u$ = 328
w_buf$ = 336
MultiplyAndAdd1Word_using_ADCX_MULX PROC ; COMDAT
; 393 : {
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 328 ; 00000148H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 82 ; 00000052H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+360]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 394 : #ifdef _M_IX86
; 395 : __UNIT_TYPE base_value = 1000000000U; // 10^9
; 396 : #elif defined(_M_IX64)
; 397 : __UNIT_TYPE base_value = 10000000000000000000UL; // 10^19
mov rax, -8446744073709551616 ; 8ac7230489e80000H
mov QWORD PTR base_value$[rbp], rax
; 398 : #else
; 399 : #error unknown platform
; 400 : #endif
; 401 : __UNIT_TYPE t_hi;
; 402 : __UNIT_TYPE t_lo = _MULTIPLYX_UNIT(u, base_value, &t_hi);
lea r8, QWORD PTR t_hi$[rbp]
mov rdx, QWORD PTR base_value$[rbp]
mov rcx, QWORD PTR u$[rbp]
call _MULTIPLYX_UNIT
mov QWORD PTR t_lo$[rbp], rax
; 403 : _ADDX_UNIT(_ADDX_UNIT(0, t_lo, k, w_buf), t_hi, 0, &k);
mov r9, QWORD PTR w_buf$[rbp]
mov r8, QWORD PTR k$[rbp]
mov rdx, QWORD PTR t_lo$[rbp]
xor ecx, ecx
call _ADDX_UNIT
lea r9, QWORD PTR k$[rbp]
xor r8d, r8d
mov rdx, QWORD PTR t_hi$[rbp]
movzx ecx, al
call _ADDX_UNIT
; 404 : return (k);
mov rax, QWORD PTR k$[rbp]
; 405 : }
mov rdi, rax
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:MultiplyAndAdd1Word_using_ADCX_MULX$rtcFrameData
call _RTC_CheckStackVars
mov rax, rdi
lea rsp, QWORD PTR [rbp+296]
pop rdi
pop rbp
ret 0
MultiplyAndAdd1Word_using_ADCX_MULX ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT MultiplyAndAdd1Word_using_ADC_MUL
_TEXT SEGMENT
base_value$ = 8
t_hi$ = 40
t_lo$ = 72
k$ = 320
u$ = 328
w_buf$ = 336
MultiplyAndAdd1Word_using_ADC_MUL PROC ; COMDAT
; 378 : {
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 328 ; 00000148H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 82 ; 00000052H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+360]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 379 : #ifdef _M_IX86
; 380 : __UNIT_TYPE base_value = 1000000000U; // 10^9
; 381 : #elif defined(_M_IX64)
; 382 : __UNIT_TYPE base_value = 10000000000000000000UL; // 10^19
mov rax, -8446744073709551616 ; 8ac7230489e80000H
mov QWORD PTR base_value$[rbp], rax
; 383 : #else
; 384 : #error unknown platform
; 385 : #endif
; 386 : __UNIT_TYPE t_hi;
; 387 : __UNIT_TYPE t_lo = _MULTIPLY_UNIT(u, base_value, &t_hi);
lea r8, QWORD PTR t_hi$[rbp]
mov rdx, QWORD PTR base_value$[rbp]
mov rcx, QWORD PTR u$[rbp]
call _MULTIPLY_UNIT
mov QWORD PTR t_lo$[rbp], rax
; 388 : _ADD_UNIT(_ADD_UNIT(0, t_lo, k, w_buf), t_hi, 0, &k);
mov r9, QWORD PTR w_buf$[rbp]
mov r8, QWORD PTR k$[rbp]
mov rdx, QWORD PTR t_lo$[rbp]
xor ecx, ecx
call _ADD_UNIT
lea r9, QWORD PTR k$[rbp]
xor r8d, r8d
mov rdx, QWORD PTR t_hi$[rbp]
movzx ecx, al
call _ADD_UNIT
; 389 : return (k);
mov rax, QWORD PTR k$[rbp]
; 390 : }
mov rdi, rax
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:MultiplyAndAdd1Word_using_ADC_MUL$rtcFrameData
call _RTC_CheckStackVars
mov rax, rdi
lea rsp, QWORD PTR [rbp+296]
pop rdi
pop rbp
ret 0
MultiplyAndAdd1Word_using_ADC_MUL ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT BuildBinaryFromDecimalString
_TEXT SEGMENT
word_digit_count$ = 4
in_ptr$ = 40
out_ptr$ = 72
source_count$ = 104
r$ = 132
tv67 = 344
source$ = 384
out_buf$ = 392
out_buf_count$ = 400
BuildBinaryFromDecimalString PROC ; COMDAT
; 350 : {
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 392 ; 00000188H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 98 ; 00000062H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+424]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 351 : #ifdef _M_IX86
; 352 : int word_digit_count = 9;
; 353 : #elif defined(_M_IX64)
; 354 : int word_digit_count = 19;
mov DWORD PTR word_digit_count$[rbp], 19
; 355 : #else
; 356 : #error unknown platform
; 357 : #endif
; 358 : wchar_t* in_ptr = source;
mov rax, QWORD PTR source$[rbp]
mov QWORD PTR in_ptr$[rbp], rax
; 359 : __UNIT_TYPE* out_ptr = out_buf;
mov rax, QWORD PTR out_buf$[rbp]
mov QWORD PTR out_ptr$[rbp], rax
; 360 : __UNIT_TYPE source_count = lstrlenW(source);
mov rcx, QWORD PTR source$[rbp]
call QWORD PTR __imp_lstrlenW
cdqe
mov QWORD PTR source_count$[rbp], rax
; 361 : int r = source_count % word_digit_count;
movsxd rax, DWORD PTR word_digit_count$[rbp]
mov QWORD PTR tv67[rbp], rax
xor edx, edx
mov rax, QWORD PTR source_count$[rbp]
mov rcx, QWORD PTR tv67[rbp]
div rcx
mov rax, rdx
mov DWORD PTR r$[rbp], eax
; 362 : if (r > 0)
cmp DWORD PTR r$[rbp], 0
jle SHORT $LN4@BuildBinar
; 363 : {
; 364 : *out_ptr++ = BuildLeading1WordFromDecimalString(in_ptr, r);
movsxd rax, DWORD PTR r$[rbp]
mov rdx, rax
mov rcx, QWORD PTR in_ptr$[rbp]
call BuildLeading1WordFromDecimalString
mov rcx, QWORD PTR out_ptr$[rbp]
mov QWORD PTR [rcx], rax
mov rax, QWORD PTR out_ptr$[rbp]
add rax, 8
mov QWORD PTR out_ptr$[rbp], rax
; 365 : in_ptr += r;
movsxd rax, DWORD PTR r$[rbp]
mov rcx, QWORD PTR in_ptr$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR in_ptr$[rbp], rax
; 366 : source_count -= r;
movsxd rax, DWORD PTR r$[rbp]
mov rcx, QWORD PTR source_count$[rbp]
sub rcx, rax
mov rax, rcx
mov QWORD PTR source_count$[rbp], rax
$LN4@BuildBinar:
$LN2@BuildBinar:
; 367 : }
; 368 : while (source_count > 0)
cmp QWORD PTR source_count$[rbp], 0
jbe SHORT $LN3@BuildBinar
; 369 : {
; 370 : *out_ptr++ = Build1WordFromDecimalString(in_ptr);
mov rcx, QWORD PTR in_ptr$[rbp]
call Build1WordFromDecimalString
mov rcx, QWORD PTR out_ptr$[rbp]
mov QWORD PTR [rcx], rax
mov rax, QWORD PTR out_ptr$[rbp]
add rax, 8
mov QWORD PTR out_ptr$[rbp], rax
; 371 : in_ptr += word_digit_count;
movsxd rax, DWORD PTR word_digit_count$[rbp]
mov rcx, QWORD PTR in_ptr$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR in_ptr$[rbp], rax
; 372 : source_count -= word_digit_count;
movsxd rax, DWORD PTR word_digit_count$[rbp]
mov rcx, QWORD PTR source_count$[rbp]
sub rcx, rax
mov rax, rcx
mov QWORD PTR source_count$[rbp], rax
; 373 : }
jmp SHORT $LN2@BuildBinar
$LN3@BuildBinar:
; 374 : *out_buf_count = out_ptr - out_buf;
mov rax, QWORD PTR out_buf$[rbp]
mov rcx, QWORD PTR out_ptr$[rbp]
sub rcx, rax
mov rax, rcx
sar rax, 3
mov rcx, QWORD PTR out_buf_count$[rbp]
mov QWORD PTR [rcx], rax
; 375 : }
lea rsp, QWORD PTR [rbp+360]
pop rdi
pop rbp
ret 0
BuildBinaryFromDecimalString ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT Build1WordFromDecimalString
_TEXT SEGMENT
x$ = 8
in_ptr$ = 256
Build1WordFromDecimalString PROC ; COMDAT
; 313 : {
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 264 ; 00000108H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 66 ; 00000042H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+296]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 314 : __UNIT_TYPE x = (*in_ptr++ - L'0');
mov rax, QWORD PTR in_ptr$[rbp]
movzx eax, WORD PTR [rax]
sub eax, 48 ; 00000030H
cdqe
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 315 : if (sizeof(__UNIT_TYPE) >= sizeof(_UINT64_T))
xor eax, eax
cmp eax, 1
je $LN2@Build1Word
; 316 : {
; 317 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 318 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 319 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 320 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 321 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 322 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 323 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 324 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 325 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 326 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
$LN2@Build1Word:
; 327 : }
; 328 : if (sizeof(__UNIT_TYPE) >= sizeof(_UINT32_T))
xor eax, eax
cmp eax, 1
je $LN3@Build1Word
; 329 : {
; 330 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 331 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 332 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 333 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 334 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
$LN3@Build1Word:
; 335 : }
; 336 : if (sizeof(__UNIT_TYPE) >= sizeof(_UINT16_T))
xor eax, eax
cmp eax, 1
je SHORT $LN4@Build1Word
; 337 : {
; 338 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 339 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
$LN4@Build1Word:
; 340 : }
; 341 : if (sizeof(__UNIT_TYPE) >= sizeof(_BYTE_T))
xor eax, eax
cmp eax, 1
je SHORT $LN5@Build1Word
; 342 : {
; 343 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
$LN5@Build1Word:
; 344 : }
; 345 : return (x);
mov rax, QWORD PTR x$[rbp]
; 346 : }
lea rsp, QWORD PTR [rbp+232]
pop rdi
pop rbp
ret 0
Build1WordFromDecimalString ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT BuildLeading1WordFromDecimalString
_TEXT SEGMENT
x$ = 8
in_ptr$ = 256
count$ = 264
BuildLeading1WordFromDecimalString PROC ; COMDAT
; 302 : {
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 264 ; 00000108H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 66 ; 00000042H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+296]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 303 : __UNIT_TYPE x = 0;
mov QWORD PTR x$[rbp], 0
$LN2@BuildLeadi:
; 304 : while (count > 0)
cmp QWORD PTR count$[rbp], 0
jbe SHORT $LN3@BuildLeadi
; 305 : {
; 306 : x = x * 10 + (*in_ptr++ - L'0');
imul rax, QWORD PTR x$[rbp], 10
mov rcx, QWORD PTR in_ptr$[rbp]
movzx ecx, WORD PTR [rcx]
sub ecx, 48 ; 00000030H
movsxd rcx, ecx
add rax, rcx
mov QWORD PTR x$[rbp], rax
mov rax, QWORD PTR in_ptr$[rbp]
add rax, 2
mov QWORD PTR in_ptr$[rbp], rax
; 307 : --count;
mov rax, QWORD PTR count$[rbp]
dec rax
mov QWORD PTR count$[rbp], rax
; 308 : }
jmp SHORT $LN2@BuildLeadi
$LN3@BuildLeadi:
; 309 : return (x);
mov rax, QWORD PTR x$[rbp]
; 310 : }
lea rsp, QWORD PTR [rbp+232]
pop rdi
pop rbp
ret 0
BuildLeading1WordFromDecimalString ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT ParseAsHexNumberString
_TEXT SEGMENT
state$ = 16
__$ArrayPad$ = 312
in_ptr$ = 352
number_styles$ = 360
format_option$ = 368
int_part_buf$ = 376
ParseAsHexNumberString PROC ; COMDAT
; 287 : {
mov QWORD PTR [rsp+32], r9
mov QWORD PTR [rsp+24], r8
mov DWORD PTR [rsp+16], edx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 376 ; 00000178H
lea rbp, QWORD PTR [rsp+48]
mov rdi, rsp
mov ecx, 94 ; 0000005eH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+408]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 288 : struct __tag_PARSER_STATE state;
; 289 : InitializeParserState(&state, in_ptr, number_styles, format_option, int_part_buf, NULL);
mov QWORD PTR [rsp+40], 0
mov rax, QWORD PTR int_part_buf$[rbp]
mov QWORD PTR [rsp+32], rax
mov r9, QWORD PTR format_option$[rbp]
mov r8d, DWORD PTR number_styles$[rbp]
mov rdx, QWORD PTR in_ptr$[rbp]
lea rcx, QWORD PTR state$[rbp]
call InitializeParserState
; 290 : if (number_styles & PMC_NUMBER_STYLE_ALLOW_LEADING_WHITE)
mov eax, DWORD PTR number_styles$[rbp]
and eax, 1
test eax, eax
je SHORT $LN2@ParseAsHex
; 291 : SkipSpace(&state);
lea rcx, QWORD PTR state$[rbp]
call SkipSpace
$LN2@ParseAsHex:
; 292 : ParseAsIntegerPartNumberSequence(&state);
lea rcx, QWORD PTR state$[rbp]
call ParseAsIntegerPartNumberSequence
; 293 : if (number_styles & PMC_NUMBER_STYLE_ALLOW_TRAILING_WHITE)
mov eax, DWORD PTR number_styles$[rbp]
and eax, 2
test eax, eax
je SHORT $LN3@ParseAsHex
; 294 : SkipSpace(&state);
lea rcx, QWORD PTR state$[rbp]
call SkipSpace
$LN3@ParseAsHex:
; 295 : if (*state.IN_PTR != L'\0')
mov rax, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rax]
test eax, eax
je SHORT $LN4@ParseAsHex
; 296 : return (0);
xor eax, eax
jmp SHORT $LN1@ParseAsHex
$LN4@ParseAsHex:
; 297 : FinalizeParserState(&state);
lea rcx, QWORD PTR state$[rbp]
call FinalizeParserState
; 298 : return (1);
mov eax, 1
$LN1@ParseAsHex:
; 299 : }
mov rdi, rax
lea rcx, QWORD PTR [rbp-48]
lea rdx, OFFSET FLAT:ParseAsHexNumberString$rtcFrameData
call _RTC_CheckStackVars
mov rax, rdi
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+328]
pop rdi
pop rbp
ret 0
ParseAsHexNumberString ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT ParseAsDecimalNumberString
_TEXT SEGMENT
state$ = 16
__$ArrayPad$ = 312
in_ptr$ = 352
number_styles$ = 360
format_option$ = 368
sign$ = 376
int_part_buf$ = 384
frac_part_buf$ = 392
ParseAsDecimalNumberString PROC ; COMDAT
; 190 : {
mov QWORD PTR [rsp+32], r9
mov QWORD PTR [rsp+24], r8
mov DWORD PTR [rsp+16], edx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 376 ; 00000178H
lea rbp, QWORD PTR [rsp+48]
mov rdi, rsp
mov ecx, 94 ; 0000005eH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+408]
mov rax, QWORD PTR __security_cookie
xor rax, rbp
mov QWORD PTR __$ArrayPad$[rbp], rax
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 191 : struct __tag_PARSER_STATE state;
; 192 : InitializeParserState(&state, in_ptr, number_styles, format_option, int_part_buf, frac_part_buf);
mov rax, QWORD PTR frac_part_buf$[rbp]
mov QWORD PTR [rsp+40], rax
mov rax, QWORD PTR int_part_buf$[rbp]
mov QWORD PTR [rsp+32], rax
mov r9, QWORD PTR format_option$[rbp]
mov r8d, DWORD PTR number_styles$[rbp]
mov rdx, QWORD PTR in_ptr$[rbp]
lea rcx, QWORD PTR state$[rbp]
call InitializeParserState
; 193 : if (number_styles & PMC_NUMBER_STYLE_ALLOW_LEADING_WHITE)
mov eax, DWORD PTR number_styles$[rbp]
and eax, 1
test eax, eax
je SHORT $LN2@ParseAsDec
; 194 : SkipSpace(&state);
lea rcx, QWORD PTR state$[rbp]
call SkipSpace
$LN2@ParseAsDec:
; 195 : if ((number_styles & PMC_NUMBER_STYLE_ALLOW_PARENTHESES) && *state.IN_PTR == L'(')
mov eax, DWORD PTR number_styles$[rbp]
and eax, 16
test eax, eax
je $LN3@ParseAsDec
mov rax, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rax]
cmp eax, 40 ; 00000028H
jne $LN3@ParseAsDec
; 196 : {
; 197 : state.SIGN = -1;
mov DWORD PTR state$[rbp+12], -1
; 198 : state.IN_PTR += 1;
mov rax, QWORD PTR state$[rbp]
add rax, 2
mov QWORD PTR state$[rbp], rax
; 199 : if (*state.IN_PTR >= L'0' && *state.IN_PTR <= L'9')
mov rax, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rax]
cmp eax, 48 ; 00000030H
jl SHORT $LN5@ParseAsDec
mov rax, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rax]
cmp eax, 57 ; 00000039H
jg SHORT $LN5@ParseAsDec
; 200 : ParseAsIntegerPartNumberSequence(&state);
lea rcx, QWORD PTR state$[rbp]
call ParseAsIntegerPartNumberSequence
$LN5@ParseAsDec:
; 201 : if ((number_styles & PMC_NUMBER_STYLE_ALLOW_DECIMAL_POINT) && StartsWith(state.IN_PTR, state.DECIMAL_SEPARATOR))
mov eax, DWORD PTR number_styles$[rbp]
and eax, 32 ; 00000020H
test eax, eax
je SHORT $LN6@ParseAsDec
lea rdx, QWORD PTR state$[rbp+40]
mov rcx, QWORD PTR state$[rbp]
call StartsWith
test eax, eax
je SHORT $LN6@ParseAsDec
; 202 : {
; 203 : state.IN_PTR += state.DECIMAL_SEPARATOR_LENGTH;
movsxd rax, DWORD PTR state$[rbp+48]
mov rcx, QWORD PTR state$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR state$[rbp], rax
; 204 : ParseAsFractionPartNumberSequence(&state);
lea rcx, QWORD PTR state$[rbp]
call ParseAsFractionPartNumberSequence
$LN6@ParseAsDec:
; 205 : }
; 206 : if (*state.IN_PTR != L')')
mov rax, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rax]
cmp eax, 41 ; 00000029H
je SHORT $LN7@ParseAsDec
; 207 : return (0);
xor eax, eax
jmp $LN1@ParseAsDec
$LN7@ParseAsDec:
; 208 : state.IN_PTR += 1;
mov rax, QWORD PTR state$[rbp]
add rax, 2
mov QWORD PTR state$[rbp], rax
; 209 : }
jmp $LN4@ParseAsDec
$LN3@ParseAsDec:
; 210 : else if ((number_styles & PMC_NUMBER_STYLE_ALLOW_LEADING_SIGN) && StartsWith(state.IN_PTR, state.POSITIVE_SIGN))
mov eax, DWORD PTR number_styles$[rbp]
and eax, 4
test eax, eax
je $LN8@ParseAsDec
lea rdx, QWORD PTR state$[rbp+16]
mov rcx, QWORD PTR state$[rbp]
call StartsWith
test eax, eax
je SHORT $LN8@ParseAsDec
; 211 : {
; 212 : state.SIGN = 1;
mov DWORD PTR state$[rbp+12], 1
; 213 : state.IN_PTR += state.POSITIVE_SIGN_LENGTH;
movsxd rax, DWORD PTR state$[rbp+24]
mov rcx, QWORD PTR state$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR state$[rbp], rax
; 214 : if (*state.IN_PTR >= L'0' && *state.IN_PTR <= L'9')
mov rax, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rax]
cmp eax, 48 ; 00000030H
jl SHORT $LN10@ParseAsDec
mov rax, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rax]
cmp eax, 57 ; 00000039H
jg SHORT $LN10@ParseAsDec
; 215 : ParseAsIntegerPartNumberSequence(&state);
lea rcx, QWORD PTR state$[rbp]
call ParseAsIntegerPartNumberSequence
$LN10@ParseAsDec:
; 216 : if ((number_styles & PMC_NUMBER_STYLE_ALLOW_DECIMAL_POINT) && StartsWith(state.IN_PTR, state.DECIMAL_SEPARATOR))
mov eax, DWORD PTR number_styles$[rbp]
and eax, 32 ; 00000020H
test eax, eax
je SHORT $LN11@ParseAsDec
lea rdx, QWORD PTR state$[rbp+40]
mov rcx, QWORD PTR state$[rbp]
call StartsWith
test eax, eax
je SHORT $LN11@ParseAsDec
; 217 : {
; 218 : state.IN_PTR += state.DECIMAL_SEPARATOR_LENGTH;
movsxd rax, DWORD PTR state$[rbp+48]
mov rcx, QWORD PTR state$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR state$[rbp], rax
; 219 : ParseAsFractionPartNumberSequence(&state);
lea rcx, QWORD PTR state$[rbp]
call ParseAsFractionPartNumberSequence
$LN11@ParseAsDec:
; 220 : }
; 221 : }
jmp $LN9@ParseAsDec
$LN8@ParseAsDec:
; 222 : else if ((number_styles & PMC_NUMBER_STYLE_ALLOW_LEADING_SIGN) && StartsWith(state.IN_PTR, state.NEGATIVE_SIGN))
mov eax, DWORD PTR number_styles$[rbp]
and eax, 4
test eax, eax
je $LN12@ParseAsDec
lea rdx, QWORD PTR state$[rbp+28]
mov rcx, QWORD PTR state$[rbp]
call StartsWith
test eax, eax
je SHORT $LN12@ParseAsDec
; 223 : {
; 224 : state.SIGN = -1;
mov DWORD PTR state$[rbp+12], -1
; 225 : state.IN_PTR += state.NEGATIVE_SIGN_LENGTH;
movsxd rax, DWORD PTR state$[rbp+36]
mov rcx, QWORD PTR state$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR state$[rbp], rax
; 226 : if (*state.IN_PTR >= L'0' && *state.IN_PTR <= L'9')
mov rax, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rax]
cmp eax, 48 ; 00000030H
jl SHORT $LN14@ParseAsDec
mov rax, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rax]
cmp eax, 57 ; 00000039H
jg SHORT $LN14@ParseAsDec
; 227 : ParseAsIntegerPartNumberSequence(&state);
lea rcx, QWORD PTR state$[rbp]
call ParseAsIntegerPartNumberSequence
$LN14@ParseAsDec:
; 228 : if ((number_styles & PMC_NUMBER_STYLE_ALLOW_DECIMAL_POINT) && StartsWith(state.IN_PTR, state.DECIMAL_SEPARATOR))
mov eax, DWORD PTR number_styles$[rbp]
and eax, 32 ; 00000020H
test eax, eax
je SHORT $LN15@ParseAsDec
lea rdx, QWORD PTR state$[rbp+40]
mov rcx, QWORD PTR state$[rbp]
call StartsWith
test eax, eax
je SHORT $LN15@ParseAsDec
; 229 : {
; 230 : state.IN_PTR += state.DECIMAL_SEPARATOR_LENGTH;
movsxd rax, DWORD PTR state$[rbp+48]
mov rcx, QWORD PTR state$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR state$[rbp], rax
; 231 : ParseAsFractionPartNumberSequence(&state);
lea rcx, QWORD PTR state$[rbp]
call ParseAsFractionPartNumberSequence
$LN15@ParseAsDec:
; 232 : }
; 233 : }
jmp $LN13@ParseAsDec
$LN12@ParseAsDec:
; 234 : else if (*state.IN_PTR >= L'0' && *state.IN_PTR <= L'9')
mov rax, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rax]
cmp eax, 48 ; 00000030H
jl $LN16@ParseAsDec
mov rax, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rax]
cmp eax, 57 ; 00000039H
jg $LN16@ParseAsDec
; 235 : {
; 236 : ParseAsIntegerPartNumberSequence(&state);
lea rcx, QWORD PTR state$[rbp]
call ParseAsIntegerPartNumberSequence
; 237 : if ((number_styles & PMC_NUMBER_STYLE_ALLOW_DECIMAL_POINT) && StartsWith(state.IN_PTR, state.DECIMAL_SEPARATOR))
mov eax, DWORD PTR number_styles$[rbp]
and eax, 32 ; 00000020H
test eax, eax
je SHORT $LN18@ParseAsDec
lea rdx, QWORD PTR state$[rbp+40]
mov rcx, QWORD PTR state$[rbp]
call StartsWith
test eax, eax
je SHORT $LN18@ParseAsDec
; 238 : {
; 239 : state.IN_PTR += state.DECIMAL_SEPARATOR_LENGTH;
movsxd rax, DWORD PTR state$[rbp+48]
mov rcx, QWORD PTR state$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR state$[rbp], rax
; 240 : ParseAsFractionPartNumberSequence(&state);
lea rcx, QWORD PTR state$[rbp]
call ParseAsFractionPartNumberSequence
$LN18@ParseAsDec:
; 241 : }
; 242 : if ((number_styles & PMC_NUMBER_STYLE_ALLOW_TRAILING_SIGN) && StartsWith(state.IN_PTR, state.POSITIVE_SIGN))
mov eax, DWORD PTR number_styles$[rbp]
and eax, 8
test eax, eax
je SHORT $LN19@ParseAsDec
lea rdx, QWORD PTR state$[rbp+16]
mov rcx, QWORD PTR state$[rbp]
call StartsWith
test eax, eax
je SHORT $LN19@ParseAsDec
; 243 : {
; 244 : state.SIGN = 1;
mov DWORD PTR state$[rbp+12], 1
; 245 : state.IN_PTR += state.POSITIVE_SIGN_LENGTH;
movsxd rax, DWORD PTR state$[rbp+24]
mov rcx, QWORD PTR state$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR state$[rbp], rax
; 246 : }
jmp SHORT $LN20@ParseAsDec
$LN19@ParseAsDec:
; 247 : else if ((number_styles & PMC_NUMBER_STYLE_ALLOW_TRAILING_SIGN) && StartsWith(state.IN_PTR, state.NEGATIVE_SIGN))
mov eax, DWORD PTR number_styles$[rbp]
and eax, 8
test eax, eax
je SHORT $LN21@ParseAsDec
lea rdx, QWORD PTR state$[rbp+28]
mov rcx, QWORD PTR state$[rbp]
call StartsWith
test eax, eax
je SHORT $LN21@ParseAsDec
; 248 : {
; 249 : state.SIGN = -1;
mov DWORD PTR state$[rbp+12], -1
; 250 : state.IN_PTR += state.NEGATIVE_SIGN_LENGTH;
movsxd rax, DWORD PTR state$[rbp+36]
mov rcx, QWORD PTR state$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR state$[rbp], rax
$LN21@ParseAsDec:
$LN20@ParseAsDec:
; 251 : }
; 252 : else
; 253 : {
; 254 : }
; 255 : }
jmp $LN17@ParseAsDec
$LN16@ParseAsDec:
; 256 : else if ((number_styles & PMC_NUMBER_STYLE_ALLOW_DECIMAL_POINT) && StartsWith(state.IN_PTR, state.DECIMAL_SEPARATOR))
mov eax, DWORD PTR number_styles$[rbp]
and eax, 32 ; 00000020H
test eax, eax
je $LN23@ParseAsDec
lea rdx, QWORD PTR state$[rbp+40]
mov rcx, QWORD PTR state$[rbp]
call StartsWith
test eax, eax
je $LN23@ParseAsDec
; 257 : {
; 258 : state.IN_PTR += state.DECIMAL_SEPARATOR_LENGTH;
movsxd rax, DWORD PTR state$[rbp+48]
mov rcx, QWORD PTR state$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR state$[rbp], rax
; 259 : ParseAsFractionPartNumberSequence(&state);
lea rcx, QWORD PTR state$[rbp]
call ParseAsFractionPartNumberSequence
; 260 : if ((number_styles & PMC_NUMBER_STYLE_ALLOW_TRAILING_SIGN) && StartsWith(state.IN_PTR, state.POSITIVE_SIGN))
mov eax, DWORD PTR number_styles$[rbp]
and eax, 8
test eax, eax
je SHORT $LN25@ParseAsDec
lea rdx, QWORD PTR state$[rbp+16]
mov rcx, QWORD PTR state$[rbp]
call StartsWith
test eax, eax
je SHORT $LN25@ParseAsDec
; 261 : {
; 262 : state.SIGN = 1;
mov DWORD PTR state$[rbp+12], 1
; 263 : state.IN_PTR += state.POSITIVE_SIGN_LENGTH;
movsxd rax, DWORD PTR state$[rbp+24]
mov rcx, QWORD PTR state$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR state$[rbp], rax
; 264 : }
jmp SHORT $LN26@ParseAsDec
$LN25@ParseAsDec:
; 265 : else if ((number_styles & PMC_NUMBER_STYLE_ALLOW_TRAILING_SIGN) && StartsWith(state.IN_PTR, state.NEGATIVE_SIGN))
mov eax, DWORD PTR number_styles$[rbp]
and eax, 8
test eax, eax
je SHORT $LN27@ParseAsDec
lea rdx, QWORD PTR state$[rbp+28]
mov rcx, QWORD PTR state$[rbp]
call StartsWith
test eax, eax
je SHORT $LN27@ParseAsDec
; 266 : {
; 267 : state.SIGN = -1;
mov DWORD PTR state$[rbp+12], -1
; 268 : state.IN_PTR += state.NEGATIVE_SIGN_LENGTH;
movsxd rax, DWORD PTR state$[rbp+36]
mov rcx, QWORD PTR state$[rbp]
lea rax, QWORD PTR [rcx+rax*2]
mov QWORD PTR state$[rbp], rax
$LN27@ParseAsDec:
$LN26@ParseAsDec:
; 269 : }
; 270 : else
; 271 : {
; 272 : }
; 273 : }
jmp SHORT $LN24@ParseAsDec
$LN23@ParseAsDec:
; 274 : else
; 275 : return (0);
xor eax, eax
jmp SHORT $LN1@ParseAsDec
$LN24@ParseAsDec:
$LN17@ParseAsDec:
$LN13@ParseAsDec:
$LN9@ParseAsDec:
$LN4@ParseAsDec:
; 276 : if (number_styles & PMC_NUMBER_STYLE_ALLOW_TRAILING_WHITE)
mov eax, DWORD PTR number_styles$[rbp]
and eax, 2
test eax, eax
je SHORT $LN29@ParseAsDec
; 277 : SkipSpace(&state);
lea rcx, QWORD PTR state$[rbp]
call SkipSpace
$LN29@ParseAsDec:
; 278 : if (*state.IN_PTR != L'\0')
mov rax, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rax]
test eax, eax
je SHORT $LN30@ParseAsDec
; 279 : return (0);
xor eax, eax
jmp SHORT $LN1@ParseAsDec
$LN30@ParseAsDec:
; 280 : FinalizeParserState(&state);
lea rcx, QWORD PTR state$[rbp]
call FinalizeParserState
; 281 : *sign = state.SIGN;
mov rax, QWORD PTR sign$[rbp]
mov ecx, DWORD PTR state$[rbp+12]
mov DWORD PTR [rax], ecx
; 282 : return (1);
mov eax, 1
$LN1@ParseAsDec:
; 283 : }
mov rdi, rax
lea rcx, QWORD PTR [rbp-48]
lea rdx, OFFSET FLAT:ParseAsDecimalNumberString$rtcFrameData
call _RTC_CheckStackVars
mov rax, rdi
mov rcx, QWORD PTR __$ArrayPad$[rbp]
xor rcx, rbp
call __security_check_cookie
lea rsp, QWORD PTR [rbp+328]
pop rdi
pop rbp
ret 0
ParseAsDecimalNumberString ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT ParseAsFractionPartNumberSequence
_TEXT SEGMENT
state$ = 224
ParseAsFractionPartNumberSequence PROC ; COMDAT
; 162 : {
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
$LN2@ParseAsFra:
; 163 : for (;;)
; 164 : {
; 165 : if (*state->IN_PTR >= L'0' && *state->IN_PTR <= L'9')
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
cmp eax, 48 ; 00000030H
jl SHORT $LN5@ParseAsFra
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
cmp eax, 57 ; 00000039H
jg SHORT $LN5@ParseAsFra
; 166 : {
; 167 : *state->FRAC_PART_PTR = *state->IN_PTR;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
mov rcx, QWORD PTR state$[rbp]
mov rcx, QWORD PTR [rcx+88]
movzx eax, WORD PTR [rax]
mov WORD PTR [rcx], ax
; 168 : state->FRAC_PART_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax+88]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx+88], rax
; 169 : state->IN_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx], rax
; 170 : }
jmp $LN6@ParseAsFra
$LN5@ParseAsFra:
; 171 : else if (state->NUMBER_STYLES & PMC_NUMBER_STYLE_ALLOW_HEX_SPECIFIER && *state->IN_PTR >= L'a' && *state->IN_PTR <= L'f')
mov rax, QWORD PTR state$[rbp]
mov eax, DWORD PTR [rax+8]
and eax, 512 ; 00000200H
test eax, eax
je SHORT $LN7@ParseAsFra
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
cmp eax, 97 ; 00000061H
jl SHORT $LN7@ParseAsFra
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
cmp eax, 102 ; 00000066H
jg SHORT $LN7@ParseAsFra
; 172 : {
; 173 : *state->FRAC_PART_PTR = *state->IN_PTR;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
mov rcx, QWORD PTR state$[rbp]
mov rcx, QWORD PTR [rcx+88]
movzx eax, WORD PTR [rax]
mov WORD PTR [rcx], ax
; 174 : state->FRAC_PART_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax+88]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx+88], rax
; 175 : state->IN_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx], rax
; 176 : }
jmp $LN8@ParseAsFra
$LN7@ParseAsFra:
; 177 : else if (state->NUMBER_STYLES & PMC_NUMBER_STYLE_ALLOW_HEX_SPECIFIER && *state->IN_PTR >= L'A' && *state->IN_PTR <= L'F')
mov rax, QWORD PTR state$[rbp]
mov eax, DWORD PTR [rax+8]
and eax, 512 ; 00000200H
test eax, eax
je SHORT $LN9@ParseAsFra
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
cmp eax, 65 ; 00000041H
jl SHORT $LN9@ParseAsFra
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
cmp eax, 70 ; 00000046H
jg SHORT $LN9@ParseAsFra
; 178 : {
; 179 : *state->FRAC_PART_PTR = *state->IN_PTR;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
mov rcx, QWORD PTR state$[rbp]
mov rcx, QWORD PTR [rcx+88]
movzx eax, WORD PTR [rax]
mov WORD PTR [rcx], ax
; 180 : state->FRAC_PART_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax+88]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx+88], rax
; 181 : state->IN_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx], rax
; 182 : }
jmp SHORT $LN10@ParseAsFra
$LN9@ParseAsFra:
; 183 : else
; 184 : break;
jmp SHORT $LN3@ParseAsFra
$LN10@ParseAsFra:
$LN8@ParseAsFra:
$LN6@ParseAsFra:
; 185 : }
jmp $LN2@ParseAsFra
$LN3@ParseAsFra:
; 186 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
ParseAsFractionPartNumberSequence ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT ParseAsIntegerPartNumberSequence
_TEXT SEGMENT
state$ = 224
ParseAsIntegerPartNumberSequence PROC ; COMDAT
; 131 : {
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
$LN2@ParseAsInt:
; 132 : for (;;)
; 133 : {
; 134 : if (*state->IN_PTR >= L'0' && *state->IN_PTR <= L'9')
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
cmp eax, 48 ; 00000030H
jl SHORT $LN5@ParseAsInt
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
cmp eax, 57 ; 00000039H
jg SHORT $LN5@ParseAsInt
; 135 : {
; 136 : *state->INT_PART_PTR = *state->IN_PTR;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
mov rcx, QWORD PTR state$[rbp]
mov rcx, QWORD PTR [rcx+80]
movzx eax, WORD PTR [rax]
mov WORD PTR [rcx], ax
; 137 : state->INT_PART_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax+80]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx+80], rax
; 138 : state->IN_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx], rax
; 139 : }
jmp $LN6@ParseAsInt
$LN5@ParseAsInt:
; 140 : else if (state->NUMBER_STYLES & PMC_NUMBER_STYLE_ALLOW_HEX_SPECIFIER && *state->IN_PTR >= L'a' && *state->IN_PTR <= L'f')
mov rax, QWORD PTR state$[rbp]
mov eax, DWORD PTR [rax+8]
and eax, 512 ; 00000200H
test eax, eax
je SHORT $LN7@ParseAsInt
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
cmp eax, 97 ; 00000061H
jl SHORT $LN7@ParseAsInt
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
cmp eax, 102 ; 00000066H
jg SHORT $LN7@ParseAsInt
; 141 : {
; 142 : *state->INT_PART_PTR = *state->IN_PTR;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
mov rcx, QWORD PTR state$[rbp]
mov rcx, QWORD PTR [rcx+80]
movzx eax, WORD PTR [rax]
mov WORD PTR [rcx], ax
; 143 : state->INT_PART_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax+80]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx+80], rax
; 144 : state->IN_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx], rax
; 145 : }
jmp $LN8@ParseAsInt
$LN7@ParseAsInt:
; 146 : else if (state->NUMBER_STYLES & PMC_NUMBER_STYLE_ALLOW_HEX_SPECIFIER && *state->IN_PTR >= L'A' && *state->IN_PTR <= L'F')
mov rax, QWORD PTR state$[rbp]
mov eax, DWORD PTR [rax+8]
and eax, 512 ; 00000200H
test eax, eax
je SHORT $LN9@ParseAsInt
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
cmp eax, 65 ; 00000041H
jl SHORT $LN9@ParseAsInt
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
cmp eax, 70 ; 00000046H
jg SHORT $LN9@ParseAsInt
; 147 : {
; 148 : *state->INT_PART_PTR = *state->IN_PTR;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
mov rcx, QWORD PTR state$[rbp]
mov rcx, QWORD PTR [rcx+80]
movzx eax, WORD PTR [rax]
mov WORD PTR [rcx], ax
; 149 : state->INT_PART_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax+80]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx+80], rax
; 150 : state->IN_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx], rax
; 151 : }
jmp $LN10@ParseAsInt
$LN9@ParseAsInt:
; 152 : else if (state->NUMBER_STYLES & PMC_NUMBER_STYLE_ALLOW_THOUSANDS && StartsWith(state->IN_PTR, state->GROUP_SEPARATOR))
mov rax, QWORD PTR state$[rbp]
mov eax, DWORD PTR [rax+8]
and eax, 64 ; 00000040H
test eax, eax
je SHORT $LN11@ParseAsInt
mov rax, QWORD PTR state$[rbp]
add rax, 52 ; 00000034H
mov rdx, rax
mov rax, QWORD PTR state$[rbp]
mov rcx, QWORD PTR [rax]
call StartsWith
test eax, eax
je SHORT $LN11@ParseAsInt
; 153 : state->IN_PTR += state->GROUP_SEPARATOR_LENGTH;
mov rax, QWORD PTR state$[rbp]
movsxd rax, DWORD PTR [rax+60]
mov rcx, QWORD PTR state$[rbp]
mov rcx, QWORD PTR [rcx]
lea rax, QWORD PTR [rcx+rax*2]
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx], rax
jmp SHORT $LN12@ParseAsInt
$LN11@ParseAsInt:
; 154 : else if (state->NUMBER_STYLES & PMC_NUMBER_STYLE_ALLOW_THOUSANDS && state->SECONDARY_GROUP_SEPARATOR_LENGTH > 0 && StartsWith(state->IN_PTR, state->SECONDARY_GROUP_SEPARATOR))
mov rax, QWORD PTR state$[rbp]
mov eax, DWORD PTR [rax+8]
and eax, 64 ; 00000040H
test eax, eax
je SHORT $LN13@ParseAsInt
mov rax, QWORD PTR state$[rbp]
cmp DWORD PTR [rax+72], 0
jle SHORT $LN13@ParseAsInt
mov rax, QWORD PTR state$[rbp]
add rax, 64 ; 00000040H
mov rdx, rax
mov rax, QWORD PTR state$[rbp]
mov rcx, QWORD PTR [rax]
call StartsWith
test eax, eax
je SHORT $LN13@ParseAsInt
; 155 : state->IN_PTR += state->SECONDARY_GROUP_SEPARATOR_LENGTH;
mov rax, QWORD PTR state$[rbp]
movsxd rax, DWORD PTR [rax+72]
mov rcx, QWORD PTR state$[rbp]
mov rcx, QWORD PTR [rcx]
lea rax, QWORD PTR [rcx+rax*2]
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx], rax
jmp SHORT $LN14@ParseAsInt
$LN13@ParseAsInt:
; 156 : else
; 157 : break;
jmp SHORT $LN3@ParseAsInt
$LN14@ParseAsInt:
$LN12@ParseAsInt:
$LN10@ParseAsInt:
$LN8@ParseAsInt:
$LN6@ParseAsInt:
; 158 : }
jmp $LN2@ParseAsInt
$LN3@ParseAsInt:
; 159 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
ParseAsIntegerPartNumberSequence ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT SkipSpace
_TEXT SEGMENT
tv67 = 192
state$ = 240
SkipSpace PROC ; COMDAT
; 110 : {
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 248 ; 000000f8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 62 ; 0000003eH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+280]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
$LN2@SkipSpace:
; 111 : for (;;)
; 112 : {
; 113 : switch (*state->IN_PTR)
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
movzx eax, WORD PTR [rax]
mov DWORD PTR tv67[rbp], eax
cmp DWORD PTR tv67[rbp], 9
jl SHORT $LN8@SkipSpace
cmp DWORD PTR tv67[rbp], 13
jle SHORT $LN7@SkipSpace
cmp DWORD PTR tv67[rbp], 32 ; 00000020H
je SHORT $LN7@SkipSpace
jmp SHORT $LN8@SkipSpace
$LN7@SkipSpace:
; 114 : {
; 115 : case L' ':
; 116 : case L'\t':
; 117 : case L'\n':
; 118 : case L'\r':
; 119 : case L'\f':
; 120 : case L'\v':
; 121 : break;
jmp SHORT $LN5@SkipSpace
$LN8@SkipSpace:
; 122 :
; 123 : default:
; 124 : return;
jmp SHORT $LN1@SkipSpace
$LN5@SkipSpace:
; 125 : }
; 126 : state->IN_PTR += 1;
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax]
add rax, 2
mov rcx, QWORD PTR state$[rbp]
mov QWORD PTR [rcx], rax
; 127 : }
jmp SHORT $LN2@SkipSpace
$LN1@SkipSpace:
; 128 : }
lea rsp, QWORD PTR [rbp+216]
pop rdi
pop rbp
ret 0
SkipSpace ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT FinalizeParserState
_TEXT SEGMENT
state$ = 224
FinalizeParserState PROC ; COMDAT
; 102 : {
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 103 : *state->INT_PART_PTR = L'\0';
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax+80]
xor ecx, ecx
mov WORD PTR [rax], cx
; 104 : if (state->NUMBER_STYLES & PMC_NUMBER_STYLE_ALLOW_DECIMAL_POINT)
mov rax, QWORD PTR state$[rbp]
mov eax, DWORD PTR [rax+8]
and eax, 32 ; 00000020H
test eax, eax
je SHORT $LN2@FinalizePa
; 105 : *state->FRAC_PART_PTR = L'\0';
mov rax, QWORD PTR state$[rbp]
mov rax, QWORD PTR [rax+88]
xor ecx, ecx
mov WORD PTR [rax], cx
$LN2@FinalizePa:
; 106 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
FinalizeParserState ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT InitializeParserState
_TEXT SEGMENT
state$ = 224
in_ptr$ = 232
number_styles$ = 240
format_option$ = 248
int_part_buf$ = 256
frac_part_buf$ = 264
InitializeParserState PROC ; COMDAT
; 74 : {
mov QWORD PTR [rsp+32], r9
mov DWORD PTR [rsp+24], r8d
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 75 : state->IN_PTR = in_ptr;
mov rax, QWORD PTR state$[rbp]
mov rcx, QWORD PTR in_ptr$[rbp]
mov QWORD PTR [rax], rcx
; 76 : state->NUMBER_STYLES = number_styles;
mov rax, QWORD PTR state$[rbp]
mov ecx, DWORD PTR number_styles$[rbp]
mov DWORD PTR [rax+8], ecx
; 77 : state->SIGN = 0;
mov rax, QWORD PTR state$[rbp]
mov DWORD PTR [rax+12], 0
; 78 : lstrcpyW(state->POSITIVE_SIGN, format_option->PositiveSign);
mov rax, QWORD PTR format_option$[rbp]
add rax, 16
mov rcx, QWORD PTR state$[rbp]
add rcx, 16
mov rdx, rax
call QWORD PTR __imp_lstrcpyW
; 79 : state->POSITIVE_SIGN_LENGTH = lstrlenW(state->POSITIVE_SIGN);
mov rax, QWORD PTR state$[rbp]
add rax, 16
mov rcx, rax
call QWORD PTR __imp_lstrlenW
mov rcx, QWORD PTR state$[rbp]
mov DWORD PTR [rcx+24], eax
; 80 : lstrcpyW(state->NEGATIVE_SIGN, format_option->NegativeSign);
mov rax, QWORD PTR format_option$[rbp]
add rax, 22
mov rcx, QWORD PTR state$[rbp]
add rcx, 28
mov rdx, rax
call QWORD PTR __imp_lstrcpyW
; 81 : state->NEGATIVE_SIGN_LENGTH = lstrlenW(state->NEGATIVE_SIGN);
mov rax, QWORD PTR state$[rbp]
add rax, 28
mov rcx, rax
call QWORD PTR __imp_lstrlenW
mov rcx, QWORD PTR state$[rbp]
mov DWORD PTR [rcx+36], eax
; 82 : lstrcpyW(state->DECIMAL_SEPARATOR, format_option->DecimalSeparator);
mov rax, QWORD PTR format_option$[rbp]
add rax, 10
mov rcx, QWORD PTR state$[rbp]
add rcx, 40 ; 00000028H
mov rdx, rax
call QWORD PTR __imp_lstrcpyW
; 83 : state->DECIMAL_SEPARATOR_LENGTH = lstrlenW(state->DECIMAL_SEPARATOR);
mov rax, QWORD PTR state$[rbp]
add rax, 40 ; 00000028H
mov rcx, rax
call QWORD PTR __imp_lstrlenW
mov rcx, QWORD PTR state$[rbp]
mov DWORD PTR [rcx+48], eax
; 84 : lstrcpyW(state->GROUP_SEPARATOR, format_option->GroupSeparator);
mov rax, QWORD PTR format_option$[rbp]
add rax, 4
mov rcx, QWORD PTR state$[rbp]
add rcx, 52 ; 00000034H
mov rdx, rax
call QWORD PTR __imp_lstrcpyW
; 85 : state->GROUP_SEPARATOR_LENGTH = lstrlenW(state->GROUP_SEPARATOR);
mov rax, QWORD PTR state$[rbp]
add rax, 52 ; 00000034H
mov rcx, rax
call QWORD PTR __imp_lstrlenW
mov rcx, QWORD PTR state$[rbp]
mov DWORD PTR [rcx+60], eax
; 86 : if (state->GROUP_SEPARATOR[0] == L'\xa0' && state->GROUP_SEPARATOR[1] == L'\0')
mov eax, 2
imul rax, rax, 0
mov rcx, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rcx+rax+52]
cmp eax, 160 ; 000000a0H
jne SHORT $LN2@Initialize
mov eax, 2
imul rax, rax, 1
mov rcx, QWORD PTR state$[rbp]
movzx eax, WORD PTR [rcx+rax+52]
test eax, eax
jne SHORT $LN2@Initialize
; 87 : {
; 88 : state->SECONDARY_GROUP_SEPARATOR[0] = L'\x20';
mov eax, 2
imul rax, rax, 0
mov ecx, 32 ; 00000020H
mov rdx, QWORD PTR state$[rbp]
mov WORD PTR [rdx+rax+64], cx
; 89 : state->SECONDARY_GROUP_SEPARATOR[1] = L'\0';
mov eax, 2
imul rax, rax, 1
xor ecx, ecx
mov rdx, QWORD PTR state$[rbp]
mov WORD PTR [rdx+rax+64], cx
; 90 : state->SECONDARY_GROUP_SEPARATOR_LENGTH = 1;
mov rax, QWORD PTR state$[rbp]
mov DWORD PTR [rax+72], 1
; 91 : }
jmp SHORT $LN3@Initialize
$LN2@Initialize:
; 92 : else
; 93 : {
; 94 : state->SECONDARY_GROUP_SEPARATOR[0] = L'\0';
mov eax, 2
imul rax, rax, 0
xor ecx, ecx
mov rdx, QWORD PTR state$[rbp]
mov WORD PTR [rdx+rax+64], cx
; 95 : state->SECONDARY_GROUP_SEPARATOR_LENGTH = 0;
mov rax, QWORD PTR state$[rbp]
mov DWORD PTR [rax+72], 0
$LN3@Initialize:
; 96 : }
; 97 : state->INT_PART_PTR = int_part_buf;
mov rax, QWORD PTR state$[rbp]
mov rcx, QWORD PTR int_part_buf$[rbp]
mov QWORD PTR [rax+80], rcx
; 98 : state->FRAC_PART_PTR = frac_part_buf;
mov rax, QWORD PTR state$[rbp]
mov rcx, QWORD PTR frac_part_buf$[rbp]
mov QWORD PTR [rax+88], rcx
; 99 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
InitializeParserState ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT StartsWith
_TEXT SEGMENT
a$ = 224
b$ = 232
StartsWith PROC ; COMDAT
; 62 : {
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
$LN2@StartsWith:
; 63 : while (*b != L'\0')
mov rax, QWORD PTR b$[rbp]
movzx eax, WORD PTR [rax]
test eax, eax
je SHORT $LN3@StartsWith
; 64 : {
; 65 : if (*a != *b)
mov rax, QWORD PTR a$[rbp]
movzx eax, WORD PTR [rax]
mov rcx, QWORD PTR b$[rbp]
movzx ecx, WORD PTR [rcx]
cmp eax, ecx
je SHORT $LN4@StartsWith
; 66 : return (0);
xor eax, eax
jmp SHORT $LN1@StartsWith
$LN4@StartsWith:
; 67 : ++a;
mov rax, QWORD PTR a$[rbp]
add rax, 2
mov QWORD PTR a$[rbp], rax
; 68 : ++b;
mov rax, QWORD PTR b$[rbp]
add rax, 2
mov QWORD PTR b$[rbp], rax
; 69 : }
jmp SHORT $LN2@StartsWith
$LN3@StartsWith:
; 70 : return (1);
mov eax, 1
$LN1@StartsWith:
; 71 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
StartsWith ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; COMDAT _MULTIPLYX_UNIT
_TEXT SEGMENT
u$ = 224
v$ = 232
w_hi$ = 240
_MULTIPLYX_UNIT PROC ; COMDAT
; 335 : {
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__6B0481B0_pmc_inline_func@h
call __CheckForDebuggerJustMyCode
; 336 : #ifdef _MSC_VER
; 337 : #ifdef _M_IX86
; 338 : return (_FROMDWORDTOWORD((_UINT64_T)u * v, w_hi));
; 339 : #elif defined(_M_X64)
; 340 : return (_mulx_u64(u, v, w_hi));
mov rdx, QWORD PTR v$[rbp]
mulx rax, rcx, QWORD PTR u$[rbp]
mov rdx, QWORD PTR w_hi$[rbp]
mov QWORD PTR [rdx], rax
mov rax, rcx
; 341 : #else
; 342 : #error unknown platform
; 343 : #endif
; 344 : #elif defined(__GNUC__)
; 345 : #ifdef _M_IX86
; 346 : _UINT32_T w_lo;
; 347 : __asm__("mulxl %3, %0, %1" : "=r"(w_lo), "=r"(*w_hi), "+d"(u) : "rm"(v));
; 348 : return (w_lo);
; 349 : #elif defined(_M_X64)
; 350 : _UINT64_T w_lo;
; 351 : __asm__("mulxq %3, %0, %1" : "=r"(w_lo), "=r"(*w_hi), "+d"(u) : "rm"(v));
; 352 : return (w_lo);
; 353 : #else
; 354 : #error unknown platform
; 355 : #endif
; 356 : #else
; 357 : #error unknown compiler
; 358 : #endif
; 359 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
_MULTIPLYX_UNIT ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; COMDAT _MULTIPLY_UNIT
_TEXT SEGMENT
tv69 = 192
u$ = 240
v$ = 248
w_hi$ = 256
_MULTIPLY_UNIT PROC ; COMDAT
; 297 : {
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 248 ; 000000f8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 62 ; 0000003eH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+280]
lea rcx, OFFSET FLAT:__6B0481B0_pmc_inline_func@h
call __CheckForDebuggerJustMyCode
; 298 : #ifdef _M_IX86
; 299 : #ifdef _MSC_VER
; 300 : return (_FROMDWORDTOWORD((_UINT64_T)u * v, w_hi));
; 301 : #elif defined(__GNUC__)
; 302 : _UINT32_T w_lo;
; 303 : __asm__("mull %3": "=a"(w_lo), "=d"(*w_hi) : "0"(u), "rm"(v));
; 304 : return (w_lo);
; 305 : #else
; 306 : #error unknown compiler
; 307 : #endif
; 308 : #elif defined(_M_X64)
; 309 : return (_umul128(u, v, w_hi));
mov rax, QWORD PTR u$[rbp]
mov QWORD PTR tv69[rbp], rax
mov rcx, QWORD PTR v$[rbp]
mov rax, rcx
mov rcx, QWORD PTR tv69[rbp]
mul rcx
mov rcx, QWORD PTR w_hi$[rbp]
mov QWORD PTR [rcx], rdx
; 310 : #else
; 311 : #error unknown platform
; 312 : #endif
; 313 : }
lea rsp, QWORD PTR [rbp+216]
pop rdi
pop rbp
ret 0
_MULTIPLY_UNIT ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; COMDAT _ADDX_UNIT
_TEXT SEGMENT
carry$ = 224
u$ = 232
v$ = 240
w$ = 248
_ADDX_UNIT PROC ; COMDAT
; 241 : {
mov QWORD PTR [rsp+32], r9
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov BYTE PTR [rsp+8], cl
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
movzx ecx, BYTE PTR [rsp+264]
lea rcx, OFFSET FLAT:__6B0481B0_pmc_inline_func@h
call __CheckForDebuggerJustMyCode
; 242 : #ifdef _M_IX86
; 243 : return (_addcarryx_u32(carry, u, v, w));
; 244 : #elif defined(_M_X64)
; 245 : return (_addcarryx_u64(carry, u, v, w));
mov rax, QWORD PTR u$[rbp]
movzx ecx, BYTE PTR carry$[rbp]
add cl, -1
adcx rax, QWORD PTR v$[rbp]
setb cl
mov rdx, QWORD PTR w$[rbp]
mov QWORD PTR [rdx], rax
movzx eax, cl
; 246 : #else
; 247 : #error unknown platform
; 248 : #endif
; 249 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
_ADDX_UNIT ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; COMDAT _ADD_UNIT
_TEXT SEGMENT
carry$ = 224
u$ = 232
v$ = 240
w$ = 248
_ADD_UNIT PROC ; COMDAT
; 213 : {
mov QWORD PTR [rsp+32], r9
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov BYTE PTR [rsp+8], cl
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
movzx ecx, BYTE PTR [rsp+264]
lea rcx, OFFSET FLAT:__6B0481B0_pmc_inline_func@h
call __CheckForDebuggerJustMyCode
; 214 : #ifdef _M_IX86
; 215 : return (_addcarry_u32(carry, u, v, w));
; 216 : #elif defined(_M_X64)
; 217 : return (_addcarry_u64(carry, u, v, w));
mov rax, QWORD PTR u$[rbp]
movzx ecx, BYTE PTR carry$[rbp]
add cl, -1
adc rax, QWORD PTR v$[rbp]
setb cl
mov rdx, QWORD PTR w$[rbp]
mov QWORD PTR [rdx], rax
movzx eax, cl
; 218 : #else
; 219 : #error unknown platform
; 220 : #endif
; 221 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
_ADD_UNIT ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; COMDAT _DIVIDE_CEILING_SIZE
_TEXT SEGMENT
u$ = 224
v$ = 232
_DIVIDE_CEILING_SIZE PROC ; COMDAT
; 198 : {
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__6B0481B0_pmc_inline_func@h
call __CheckForDebuggerJustMyCode
; 199 : return ((u + v - 1) / v);
mov rax, QWORD PTR u$[rbp]
mov rcx, QWORD PTR v$[rbp]
lea rax, QWORD PTR [rax+rcx-1]
xor edx, edx
div QWORD PTR v$[rbp]
; 200 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
_DIVIDE_CEILING_SIZE ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; COMDAT _DIVIDE_CEILING_UNIT
_TEXT SEGMENT
u$ = 224
v$ = 232
_DIVIDE_CEILING_UNIT PROC ; COMDAT
; 193 : {
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__6B0481B0_pmc_inline_func@h
call __CheckForDebuggerJustMyCode
; 194 : return ((u + v - 1) / v);
mov rax, QWORD PTR u$[rbp]
mov rcx, QWORD PTR v$[rbp]
lea rax, QWORD PTR [rax+rcx-1]
xor edx, edx
div QWORD PTR v$[rbp]
; 195 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
_DIVIDE_CEILING_UNIT ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_inline_func.h
; COMDAT _COPY_MEMORY_UNIT
_TEXT SEGMENT
d$ = 224
s$ = 232
count$ = 240
_COPY_MEMORY_UNIT PROC ; COMDAT
; 66 : {
mov QWORD PTR [rsp+24], r8
mov QWORD PTR [rsp+16], rdx
mov QWORD PTR [rsp+8], rcx
push rbp
push rsi
push rdi
sub rsp, 224 ; 000000e0H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 56 ; 00000038H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__6B0481B0_pmc_inline_func@h
call __CheckForDebuggerJustMyCode
; 67 : #ifdef _M_IX86
; 68 : __movsd((unsigned long *)d, (unsigned long *)s, (unsigned long)count);
; 69 : #elif defined(_M_X64)
; 70 : __movsq(d, s, count);
mov rdi, QWORD PTR d$[rbp]
mov rsi, QWORD PTR s$[rbp]
mov rcx, QWORD PTR count$[rbp]
rep movsq
; 71 : #else
; 72 : #error unknown platform
; 73 : #endif
; 74 : }
lea rsp, QWORD PTR [rbp+192]
pop rdi
pop rsi
pop rbp
ret 0
_COPY_MEMORY_UNIT ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_uint_internal.h
; COMDAT AddToMULTI64Counter
_TEXT SEGMENT
value$ = 224
AddToMULTI64Counter PROC ; COMDAT
; 357 : {
mov DWORD PTR [rsp+8], ecx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, DWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__7B8DBFC3_pmc_uint_internal@h
call __CheckForDebuggerJustMyCode
; 358 : _InterlockedExchangeAdd(&statistics_info.COUNT_MULTI64, value);
lea rax, OFFSET FLAT:statistics_info
mov ecx, DWORD PTR value$[rbp]
lock add DWORD PTR [rax], ecx
; 359 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
AddToMULTI64Counter ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_uint_internal.h
; COMDAT AddToMULTI32Counter
_TEXT SEGMENT
value$ = 224
AddToMULTI32Counter PROC ; COMDAT
; 351 : {
mov DWORD PTR [rsp+8], ecx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov ecx, DWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__7B8DBFC3_pmc_uint_internal@h
call __CheckForDebuggerJustMyCode
; 352 : _InterlockedExchangeAdd(&statistics_info.COUNT_MULTI32, value);
lea rax, OFFSET FLAT:statistics_info+4
mov ecx, DWORD PTR value$[rbp]
lock add DWORD PTR [rax], ecx
; 353 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
AddToMULTI32Counter ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_uint_internal.h
; COMDAT IncrementMULTI64Counter
_TEXT SEGMENT
IncrementMULTI64Counter PROC ; COMDAT
; 334 : {
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
lea rcx, OFFSET FLAT:__7B8DBFC3_pmc_uint_internal@h
call __CheckForDebuggerJustMyCode
; 335 : _InterlockedIncrement(&statistics_info.COUNT_MULTI64);
lea rax, OFFSET FLAT:statistics_info
lock inc DWORD PTR [rax]
; 336 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
IncrementMULTI64Counter ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_uint_internal.h
; COMDAT IncrementMULTI32Counter
_TEXT SEGMENT
IncrementMULTI32Counter PROC ; COMDAT
; 328 : {
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
lea rcx, OFFSET FLAT:__7B8DBFC3_pmc_uint_internal@h
call __CheckForDebuggerJustMyCode
; 329 : _InterlockedIncrement(&statistics_info.COUNT_MULTI32);
lea rax, OFFSET FLAT:statistics_info+4
lock inc DWORD PTR [rax]
; 330 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
IncrementMULTI32Counter ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT PMC_TryParse
_TEXT SEGMENT
result$ = 4
no$ = 40
mask$4 = 68
source$ = 320
number_styles$ = 328
format_option$ = 336
o$ = 344
PMC_TryParse PROC ; COMDAT
; 1000 : {
$LN12:
mov QWORD PTR [rsp+32], r9
mov QWORD PTR [rsp+24], r8
mov DWORD PTR [rsp+16], edx
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 328 ; 00000148H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 82 ; 00000052H
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+360]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 1001 : PMC_STATUS_CODE result;
; 1002 : if (source == NULL)
cmp QWORD PTR source$[rbp], 0
jne SHORT $LN2@PMC_TryPar
; 1003 : return (PMC_STATUS_ARGUMENT_ERROR);
mov eax, -1
jmp $LN1@PMC_TryPar
$LN2@PMC_TryPar:
; 1004 : if (o == NULL)
cmp QWORD PTR o$[rbp], 0
jne SHORT $LN3@PMC_TryPar
; 1005 : return (PMC_STATUS_ARGUMENT_ERROR);
mov eax, -1
jmp $LN1@PMC_TryPar
$LN3@PMC_TryPar:
; 1006 : if (format_option == NULL)
cmp QWORD PTR format_option$[rbp], 0
jne SHORT $LN4@PMC_TryPar
; 1007 : format_option = &default_number_format_option;
lea rax, OFFSET FLAT:default_number_format_option
mov QWORD PTR format_option$[rbp], rax
$LN4@PMC_TryPar:
; 1008 : NUMBER_HEADER* no;
; 1009 : if (number_styles & PMC_NUMBER_STYLE_ALLOW_HEX_SPECIFIER)
mov eax, DWORD PTR number_styles$[rbp]
and eax, 512 ; 00000200H
test eax, eax
je SHORT $LN5@PMC_TryPar
; 1010 : {
; 1011 : // 許可されている組み合わせのフラグ
; 1012 : _UINT32_T mask = PMC_NUMBER_STYLE_ALLOW_HEX_SPECIFIER | PMC_NUMBER_STYLE_ALLOW_LEADING_WHITE | PMC_NUMBER_STYLE_ALLOW_TRAILING_WHITE;
mov DWORD PTR mask$4[rbp], 515 ; 00000203H
; 1013 :
; 1014 : // 許可されていないフラグが指定されていればエラー
; 1015 : if (number_styles & ~mask)
mov eax, DWORD PTR mask$4[rbp]
not eax
mov ecx, DWORD PTR number_styles$[rbp]
and ecx, eax
mov eax, ecx
test eax, eax
je SHORT $LN7@PMC_TryPar
; 1016 : return (PMC_STATUS_ARGUMENT_ERROR);
mov eax, -1
jmp $LN1@PMC_TryPar
$LN7@PMC_TryPar:
; 1017 :
; 1018 : if ((result = TryParseX(source, number_styles, format_option, &no)) != PMC_STATUS_OK)
lea r9, QWORD PTR no$[rbp]
mov r8, QWORD PTR format_option$[rbp]
mov edx, DWORD PTR number_styles$[rbp]
mov rcx, QWORD PTR source$[rbp]
call TryParseX
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN8@PMC_TryPar
; 1019 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp SHORT $LN1@PMC_TryPar
$LN8@PMC_TryPar:
; 1020 : }
jmp SHORT $LN6@PMC_TryPar
$LN5@PMC_TryPar:
; 1021 : else
; 1022 : {
; 1023 : if ((result = TryParseDN(source, number_styles, format_option, &no)) != PMC_STATUS_OK)
lea r9, QWORD PTR no$[rbp]
mov r8, QWORD PTR format_option$[rbp]
mov edx, DWORD PTR number_styles$[rbp]
mov rcx, QWORD PTR source$[rbp]
call TryParseDN
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN9@PMC_TryPar
; 1024 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp SHORT $LN1@PMC_TryPar
$LN9@PMC_TryPar:
$LN6@PMC_TryPar:
; 1025 : }
; 1026 : *o = no;
mov rax, QWORD PTR o$[rbp]
mov rcx, QWORD PTR no$[rbp]
mov QWORD PTR [rax], rcx
; 1027 : #ifdef _DEBUG
; 1028 : if ((result = CheckNumber(*o)) != PMC_STATUS_OK)
mov rax, QWORD PTR o$[rbp]
mov rcx, QWORD PTR [rax]
call CheckNumber
mov DWORD PTR result$[rbp], eax
cmp DWORD PTR result$[rbp], 0
je SHORT $LN10@PMC_TryPar
; 1029 : return (result);
mov eax, DWORD PTR result$[rbp]
jmp SHORT $LN1@PMC_TryPar
$LN10@PMC_TryPar:
; 1030 : #endif
; 1031 : return (PMC_STATUS_OK);
xor eax, eax
$LN1@PMC_TryPar:
; 1032 : }
mov rdi, rax
lea rcx, QWORD PTR [rbp-32]
lea rdx, OFFSET FLAT:PMC_TryParse$rtcFrameData
call _RTC_CheckStackVars
mov rax, rdi
lea rsp, QWORD PTR [rbp+296]
pop rdi
pop rbp
ret 0
PMC_TryParse ENDP
_TEXT ENDS
; Function compile flags: /Odtp /RTCsu /ZI
; File z:\sources\lunor\repos\rougemeilland\palmtree.math.core.implements\palmtree.math.core.implements\pmc_parse.c
; COMDAT Initialize_Parse
_TEXT SEGMENT
feature$ = 224
Initialize_Parse PROC ; COMDAT
; 1035 : {
$LN5:
mov QWORD PTR [rsp+8], rcx
push rbp
push rdi
sub rsp, 232 ; 000000e8H
lea rbp, QWORD PTR [rsp+32]
mov rdi, rsp
mov ecx, 58 ; 0000003aH
mov eax, -858993460 ; ccccccccH
rep stosd
mov rcx, QWORD PTR [rsp+264]
lea rcx, OFFSET FLAT:__C5BBD3C1_pmc_parse@c
call __CheckForDebuggerJustMyCode
; 1036 : default_number_format_option.DecimalDigits = 2;
mov DWORD PTR default_number_format_option, 2
; 1037 : lstrcpyW(default_number_format_option.GroupSeparator, L",");
lea rdx, OFFSET FLAT:??_C@_13DEFPDAGF@?$AA?0@
lea rcx, OFFSET FLAT:default_number_format_option+4
call QWORD PTR __imp_lstrcpyW
; 1038 : lstrcpyW(default_number_format_option.DecimalSeparator, L".");
lea rdx, OFFSET FLAT:??_C@_13JOFGPIOO@?$AA?4@
lea rcx, OFFSET FLAT:default_number_format_option+10
call QWORD PTR __imp_lstrcpyW
; 1039 : lstrcpy(default_number_format_option.GroupSizes, "3");
lea rdx, OFFSET FLAT:??_C@_01EKENIIDA@3@
lea rcx, OFFSET FLAT:default_number_format_option+28
call QWORD PTR __imp_lstrcpyA
; 1040 : lstrcpyW(default_number_format_option.PositiveSign, L"+");
lea rdx, OFFSET FLAT:??_C@_13KJIIAINM@?$AA?$CL@
lea rcx, OFFSET FLAT:default_number_format_option+16
call QWORD PTR __imp_lstrcpyW
; 1041 : lstrcpyW(default_number_format_option.NegativeSign, L"-");
lea rdx, OFFSET FLAT:??_C@_13IMODFHAA@?$AA?9@
lea rcx, OFFSET FLAT:default_number_format_option+22
call QWORD PTR __imp_lstrcpyW
; 1042 :
; 1043 : if (feature->PROCESSOR_FEATURE_ADX && feature->PROCESSOR_FEATURE_BMI2)
mov rax, QWORD PTR feature$[rbp]
mov eax, DWORD PTR [rax]
shr eax, 1
and eax, 1
test eax, eax
je SHORT $LN2@Initialize
mov rax, QWORD PTR feature$[rbp]
mov eax, DWORD PTR [rax]
shr eax, 3
and eax, 1
test eax, eax
je SHORT $LN2@Initialize
; 1044 : fp_MultiplyAndAdd = MultiplyAndAdd_using_ADCX_MULX;
lea rax, OFFSET FLAT:MultiplyAndAdd_using_ADCX_MULX
mov QWORD PTR fp_MultiplyAndAdd, rax
jmp SHORT $LN3@Initialize
$LN2@Initialize:
; 1045 : else
; 1046 : fp_MultiplyAndAdd = MultiplyAndAdd_using_ADC_MUL;
lea rax, OFFSET FLAT:MultiplyAndAdd_using_ADC_MUL
mov QWORD PTR fp_MultiplyAndAdd, rax
$LN3@Initialize:
; 1047 :
; 1048 : return (PMC_STATUS_OK);
xor eax, eax
; 1049 : }
lea rsp, QWORD PTR [rbp+200]
pop rdi
pop rbp
ret 0
Initialize_Parse ENDP
_TEXT ENDS
END
| 22.7248 | 192 | 0.678812 |
148c10722637f4c898b6d3ef6a40518951c8e088 | 830 | asm | Assembly | programs/oeis/142/A142044.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/142/A142044.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/142/A142044.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A142044: Primes congruent to 23 mod 32.
; 23,151,311,439,503,599,631,727,823,887,919,983,1303,1367,1399,1559,1783,1847,1879,2039,2423,2551,2647,2711,2903,2999,3191,3319,3511,3607,3671,3767,3863,4567,4663,4759,4919,4951,5303,5399,5431,5527,5591,5623,5783,5879,6007,6199,6263,6359,6551,6679,6871,6967,7127,7159,7351,7607,7639,7703,7927,8087,8311,8599,8663,8887,8951,9239,9431,9463,9623,9719,10007,10039,10103,10391,10487,10711,10903,11159,11287,11351,11383,11447,11831,11863,11927,11959,12119,12343,12503,12791,12823,12919,12983,13367,13399,13463,13591,13687
mov $2,$0
add $2,2
pow $2,2
lpb $2
add $1,22
sub $2,1
mov $3,$1
seq $3,10051 ; Characteristic function of primes: 1 if n is prime, else 0.
sub $0,$3
add $1,10
mov $4,$0
max $4,0
cmp $4,$0
mul $2,$4
lpe
div $1,2
sub $1,22
mul $1,2
add $1,35
mov $0,$1
| 34.583333 | 516 | 0.719277 |
ec0328bec21977ca088cb5a41217a3c19e7f9e33 | 573 | asm | Assembly | programs/oeis/267/A267845.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/267/A267845.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/267/A267845.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A267845: Triangle read by rows giving successive states of cellular automaton generated by "Rule 227" initiated with a single ON (black) cell.
; 1,1,0,0,1,1,0,1,0,1,1,1,1,0,1,0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0
mov $4,4
mov $6,$0
lpb $4
mov $0,$6
mov $3,0
sub $4,1
add $0,$4
sub $0,1
lpb $0
mov $2,$0
sub $0,1
add $1,$5
add $3,1
div $2,$3
mov $5,8
add $5,$2
lpe
lpe
add $1,1
mod $1,2
mov $0,$1
| 22.92 | 201 | 0.547993 |
f914f195f8837020a6e495c9722bc263533a5868 | 2,740 | asm | Assembly | sim/asm/fn63.asm | nanamake/avr_cpu | b557e64f471bbcabe7ef104e24ae9b3024cddcba | [
"MIT"
] | 2 | 2021-01-21T01:36:26.000Z | 2022-03-30T21:01:04.000Z | sim/asm/fn63.asm | nanamake/avr_cpu | b557e64f471bbcabe7ef104e24ae9b3024cddcba | [
"MIT"
] | null | null | null | sim/asm/fn63.asm | nanamake/avr_cpu | b557e64f471bbcabe7ef104e24ae9b3024cddcba | [
"MIT"
] | 1 | 2020-03-05T06:04:24.000Z | 2020-03-05T06:04:24.000Z | ;-------------------
; test for adiw/sreg
;-------------------
.equ sreg = 0x3f
;-------------------
ldi r24,0x00
ldi r25,0x00
ldi r26,0x01
ldi r27,0x00
ldi r28,0xff
ldi r29,0x7f
ldi r30,0xff
ldi r31,0xff
movw r0 ,r24
movw r2 ,r26
movw r4 ,r28
movw r6 ,r30
;-------------------
out sreg,r7
adiw r26,0x00
in r8 ,sreg
out sreg,r0
adiw r24,0x00
in r9 ,sreg
adiw r28,0x01
in r10,sreg
adiw r30,0x01
in r11,sreg
movw r16,r24
movw r18,r26
movw r20,r28
movw r22,r30
;-------------------
out sreg,r7
sbiw r26,0x00
in r12,sreg
out sreg,r0
sbiw r24,0x00
in r13,sreg
sbiw r28,0x01
in r14,sreg
sbiw r30,0x01
in r15,sreg
;-------------------
sts 0x0100,r2 ; (ldi) 0x01
sts 0x0101,r3 ; (ldi) 0x00
sts 0x0102,r0 ; (ldi) 0x00
sts 0x0103,r8 ; (adiw) 0x0001 0x00 ith-----
sts 0x0104,r0 ; (ldi) 0x00
sts 0x0105,r1 ; (ldi) 0x00
sts 0x0106,r0 ; (ldi) 0x00
sts 0x0107,r9 ; (adiw) 0x0000 0x00 ------z-
sts 0x0108,r4 ; (ldi) 0xff
sts 0x0109,r5 ; (ldi) 0x7f
sts 0x010a,r2 ; (ldi) 0x01
sts 0x010b,r10 ; (adiw) 0x7fff 0x01 ----vn--
sts 0x010c,r6 ; (ldi) 0xff
sts 0x010d,r7 ; (ldi) 0xff
sts 0x010e,r2 ; (ldi) 0x01
sts 0x010f,r11 ; (adiw) 0xffff 0x01 ------zc
sts 0x0110,r18 ; (ldi) 0x01
sts 0x0111,r19 ; (ldi) 0x00
sts 0x0112,r0 ; (ldi) 0x00
sts 0x0113,r12 ; (sbiw) 0x0001 0x00 ith-----
sts 0x0114,r16 ; (ldi) 0x00
sts 0x0115,r17 ; (ldi) 0x00
sts 0x0116,r0 ; (ldi) 0x00
sts 0x0117,r13 ; (sbiw) 0x0000 0x00 ------z-
sts 0x0118,r20 ; (ldi) 0x00
sts 0x0119,r21 ; (ldi) 0x80
sts 0x011a,r2 ; (ldi) 0x01
sts 0x011b,r14 ; (sbiw) 0x8000 0x01 ---sv---
sts 0x011c,r22 ; (ldi) 0x00
sts 0x011d,r23 ; (ldi) 0x00
sts 0x011e,r2 ; (ldi) 0x01
sts 0x011f,r15 ; (sbiw) 0x0000 0x01 ---s-n-c
sts 0x0120,r18 ; (adiw) 0x0001 0x00
sts 0x0121,r19
sts 0x0122,r16 ; (adiw) 0x0000 0x00
sts 0x0123,r17
sts 0x0124,r20 ; (adiw) 0x7fff 0x01
sts 0x0125,r21
sts 0x0126,r22 ; (adiw) 0xffff 0x01
sts 0x0127,r23
sts 0x0128,r26 ; (sbiw) 0x0001 0x00
sts 0x0129,r27
sts 0x012a,r24 ; (sbiw) 0x0000 0x00
sts 0x012b,r25
sts 0x012c,r28 ; (sbiw) 0x8000 0x01
sts 0x012d,r29
sts 0x012e,r30 ; (sbiw) 0x0000 0x01
sts 0x012f,r31
;-------------------
ldi r16,0xff
sts 0xffff,r16
halt:
rjmp halt
| 23.826087 | 53 | 0.502555 |
8acd1b878f947b628d6491a2a662262c553b888e | 1,816 | asm | Assembly | lib/exo.h.asm | kieranhj/funky-fresh | 739962d911ba7a3719878b3bd593d3c79e9e52b8 | [
"MIT"
] | null | null | null | lib/exo.h.asm | kieranhj/funky-fresh | 739962d911ba7a3719878b3bd593d3c79e9e52b8 | [
"MIT"
] | null | null | null | lib/exo.h.asm | kieranhj/funky-fresh | 739962d911ba7a3719878b3bd593d3c79e9e52b8 | [
"MIT"
] | null | null | null | ;
; Copyright (c) 2002 - 2018 Magnus Lind.
;
; This software is provided 'as-is', without any express or implied warranty.
; In no event will the authors be held liable for any damages arising from
; the use of this software.
;
; Permission is granted to anyone to use this software for any purpose,
; including commercial applications, and to alter it and redistribute it
; freely, subject to the following restrictions:
;
; 1. The origin of this software must not be misrepresented; you must not
; claim that you wrote the original software. If you use this software in a
; product, an acknowledgment in the product documentation would be
; appreciated but is not required.
;
; 2. Altered source versions must be plainly marked as such, and must not
; be misrepresented as being the original software.
;
; 3. This notice may not be removed or altered from any distribution.
;
; 4. The names of this software and/or it's copyright holders may not be
; used to endorse or promote products derived from this software without
; specific prior written permission.
;
; -------------------------------------------------------------------
; -------------------------------------------------------------------
; zero page addresses used
; -------------------------------------------------------------------
.exo_zp_start
.zp_len_lo skip 1
.zp_len_hi skip 1
.zp_bits_hi skip 1
.zp_bitbuf skip 1
.zp_dest_lo skip 1 ; dest addr lo - must come after zp_bitbuf
.zp_dest_hi skip 1 ; dest addr hi
.zp_src_lo skip 1
.zp_src_hi skip 1
.get_crunched_byte
skip 1 ; LDA abs
.INPOS skip 2 ; &FFFF
.get_crunched_byte_code
skip 7 ; inc INCPOS: bne no_carry: inc INPOS+1: .no_carry RTS
.get_crunched_byte_code_end
| 38.638298 | 82 | 0.629956 |
1ec04f6b6f4e999fdf8b5422ce7c45d8323f3da8 | 263 | asm | Assembly | programs/oeis/070/A070646.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/070/A070646.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/070/A070646.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A070646: n^6 mod 23.
; 0,1,18,16,2,8,12,4,13,3,6,9,9,6,3,13,4,12,8,2,16,18,1,0,1,18,16,2,8,12,4,13,3,6,9,9,6,3,13,4,12,8,2,16,18,1,0,1,18,16,2,8,12,4,13,3,6,9,9,6,3,13,4,12,8,2,16,18,1,0,1,18,16,2,8,12,4,13,3,6,9,9,6,3,13,4,12,8,2
pow $0,6
mod $0,23
mov $1,$0
| 37.571429 | 209 | 0.56654 |
1f01467b9d0d6d83cba564e771092a5c77630195 | 1,038 | asm | Assembly | programs/oeis/020/A020914.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/020/A020914.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/020/A020914.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A020914: Number of digits in the base-2 representation of 3^n.
; 1,2,4,5,7,8,10,12,13,15,16,18,20,21,23,24,26,27,29,31,32,34,35,37,39,40,42,43,45,46,48,50,51,53,54,56,58,59,61,62,64,65,67,69,70,72,73,75,77,78,80,81,83,85,86,88,89,91,92,94,96,97,99,100,102,104,105,107,108,110,111,113,115,116,118,119,121,123,124,126,127,129,130,132,134,135,137,138,140,142,143,145,146,148,149,151,153,154,156,157,159,161,162,164,165,167,169,170,172,173,175,176,178,180,181,183,184,186,188,189,191,192,194,195,197,199,200,202,203,205,207,208,210,211,213,214,216,218,219,221,222,224,226,227,229,230,232,233,235,237,238,240,241,243,245,246,248,249,251,253,254,256,257,259,260,262,264,265,267,268,270,272,273,275,276,278,279,281,283,284,286,287,289,291,292,294,295,297,298,300,302,303,305,306,308,310,311,313,314,316,317,319,321,322,324,325,327,329,330,332,333,335,337,338,340,341,343,344,346,348,349,351,352,354,356,357,359,360,362,363,365,367,368,370,371,373,375,376,378,379,381,382,384,386,387,389,390,392,394,395
mul $0,84
mov $1,$0
div $1,53
add $1,1
| 129.75 | 932 | 0.72447 |
7385e270bca2558bb1bbede4a7f00c1db02e5775 | 4,136 | asm | Assembly | anteater/main.asm | bushy555/ZX-Spectrum-1-Bit-Routines | 4d336dec9d7abc979a97af76d515104a9263f127 | [
"BSD-3-Clause"
] | 59 | 2015-02-28T14:15:56.000Z | 2022-03-26T12:06:01.000Z | anteater/main.asm | bushy555/ZX-Spectrum-1-Bit-Routines | 4d336dec9d7abc979a97af76d515104a9263f127 | [
"BSD-3-Clause"
] | 1 | 2016-08-22T05:32:43.000Z | 2016-08-22T09:33:28.000Z | anteater/main.asm | bushy555/ZX-Spectrum-1-Bit-Routines | 4d336dec9d7abc979a97af76d515104a9263f127 | [
"BSD-3-Clause"
] | 9 | 2015-02-28T14:16:31.000Z | 2022-01-18T17:52:48.000Z | ;AntEater - ZX Spectrum beeper engine
;by utz 08'2014
org #8000
init
di
ld hl,musicdata
ld (OrderPntr),hl
call readOrder
jr z,init
xor a
out (#fe),a
ld hl,#2758 ;restore alternative HL to default value
exx
ei
ret
;**************************************************************************************************
readOrder
ld hl,(OrderPntr) ;get order pointer
ld e,(hl) ;read pnt pointer
inc hl
ld d,(hl)
inc hl
ld (OrderPntr),hl
ld a,d ;if pattern pointer = #0000, end of song reached
or e
ret z
ld (PtnPntr),de
;**************************************************************************************************
readPtn
in a,(#fe)
cpl
and #1f
ret nz
ld a,#10
ld (switch1),a
ld (switch2),a
ld hl,(PtnPntr)
ld a,(hl) ;check for pattern end
cp #ff
jr z,readOrder
ld a,(hl)
and %11111100 ;mask lowest 2 bits
ld b,a ;speed
ld c,b
ld a,(hl)
and %00000011
or a ;if !=0, we have drum
call nz,drums
drdata
inc hl
xor a
ld d,(hl) ;counter ch2
ld e,d
push hl
ld h,#10 ;output mask ch2
or d
jr nz,rdskip1
ld h,a ;mute if note byte = 0
rdskip1
ld l,h ;swap mask
exx
pop hl
inc hl
ld b,(hl) ;counter A
or b
jr nz,rdskip2
ld (switch1),a
ld (switch2),a
rdskip2
ld c,b ;backup counter A/B
ld d,b ;counter B
inc hl
ld (PtnPntr),hl
ld hl,#1000 ;output mask ch1
exx
;**************************************************************************************************
play
ld a,h ;4 ;load output mask ch2
exx ;4
dec b ;4 ;dec counter A
out (#fe),a ;11 ;output ch2
jr nz,wait1 ;12/7
ld a,h ;4 ;flip output mask and restore counter
switch1 equ $+1 ;mute switch
xor #10 ;7
ld h,a ;4
ld b,c ;4
skip1
dec d ;4 ;dec counter B
ld a,l ;4 ;load output mask ch1
jr nz,wait2 ;12/7
ld d,c ;4 ;restore counter
switch2 equ $+1 ;mute switch
xor #10 ;7 ;swap output mask
ld l,a ;4
rra ;4 ;increment counter to create pwm effect if output mask = #10
rra ;4
rra ;4
rra ;4
add a,d ;4
ld d,a ;4
skip2
ld a,l ;4
and h ;4 ;combine output masks
out (#fe),a ;11 ;output ch1
exx ;4
dec d ;4 ;decrement counter ch1
jp nz,wait3 ;10
ld d,e ;4 ;restore counter
ld a,h ;4 ;swap output mask
xor l ;4
ld h,a ;4
skip3
dec bc ;6 ;decrement speed counter
ld a,b ;4
or c ;4
nop ;4 ;take care of IO contention
jp nz,play ;10
;184
jr readPtn
;**************************************************************************************************
wait1
nop ;4
jp skip1 ;10
wait2
sla (hl) ;15
sla (hl) ;15
nop ;4
jr skip2 ;12
;46
;ld (hl),b ;7 ;why on earth I can't read the keyboard here
;in a,(#fe) ;11 ;is a mystery to me.
;cpl ;4
;and #1f ;7
;ret nz ;11/5
;jr skip2 ;12
wait3
nop ;4
jr skip3 ;12
;**************************************************************************************************
drums
push hl
dec a
ld hl,switch2
ld d,#fd
jr z,drum2
dec a
ld d,#bf
ld hl,drdata+7
jr z,drumloop3
drum1
ld hl,drdata
ld a,c ;timing correction
sub #c2
ld c,a
jr nc,tskip1
dec b
tskip1
push bc
ld b,12
drum1a
ld a,#10
out (#fe),a
ld a,(hl)
drumloop1
dec a
jr nz,drumloop1
out (#fe),a
ld a,(hl)
drumloop2
dec a
jr nz,drumloop2
inc hl
djnz drum1a
jr drumret
drum2
dec b ;timing correction
ld a,#d9
ld (switch3),a ;modify end marker value
drumloop3
ld a,c ;timing correction
sub d
jr nc,tskip2
dec b
tskip2
push bc
drumloop30
ld a,#10
out (#fe),a
switch3 equ $+1
ld a,6
ld b,(hl)
xor b
jr z,drumret
dl3a
push hl
pop hl
djnz dl3a
xor a
out (#fe),a
ld b,(hl)
dl3b
push hl
pop hl
djnz dl3b
inc hl
jr drumloop30
ld a,6
ld (switch3),a
drumret
pop bc
pop hl
ret
;**************************************************************************************************
OrderPntr
dw 0
PtnPntr
dw 0
musicdata
include "music.asm"
| 16.283465 | 101 | 0.495648 |
433d666ee4592e4928a15f08fd043ec42a769938 | 713 | asm | Assembly | oeis/016/A016302.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/016/A016302.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/016/A016302.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A016302: Expansion of 1/((1-2*x)*(1-5*x)*(1-12*x)).
; Submitted by Jon Maiga
; 1,19,267,3407,41915,508167,6124003,73618159,884068779,10612080215,127361237939,1528416234111,18341401707643,220098854991463,2641196432412675,31694408051560463,380333150931832907,4563999082747662711,54767995350800553811,657215975998750176415,7886591870930720818971,94639103245897245434759,1135669242924409927446947,13628030934961134048901167,163536371318874683201280235,1962436456323201571521248407,23549237478361945723851517683,282590849752760983014335113919,3391090197095219967812874311099
mov $1,1
mov $3,2
lpb $0
sub $0,1
mul $1,5
mul $3,6
add $3,2
sub $3,$2
add $1,$3
mul $2,2
sub $2,2
mul $3,2
lpe
mov $0,$1
| 37.526316 | 492 | 0.809257 |
fb568898b9c2e2534b34b7e6e6398710addba530 | 468 | asm | Assembly | programs/oeis/098/A098662.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/098/A098662.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/098/A098662.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A098662: E.g.f. BesselI(0,2sqrt(3)x)+BesselI(1,2sqrt(3)x)/sqrt(3).
; 1,1,6,9,54,90,540,945,5670,10206,61236,112266,673596,1250964,7505784,14073345,84440070,159497910,956987460,1818276174,10909657044,20827527084,124965162504,239516561466,1437099368796,2763652632300,16581915793800,31979409030900,191876454185400,370961144758440,2225766868550640,4312423307816865
mov $3,$0
div $3,2
bin $0,$3
mov $1,$0
mov $2,3
pow $2,$3
mul $2,6
mul $1,$2
sub $1,6
div $1,6
add $1,1
| 31.2 | 293 | 0.769231 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.